From 107873b43ede48a20383887b02e6edda5a158954 Mon Sep 17 00:00:00 2001 From: support Date: Wed, 26 Oct 2022 12:13:12 +0000 Subject: [PATCH] Built motion from commit 18decb32.|2.6.20 --- apidoc/api_project.js | 2 +- apidoc/api_project.json | 2 +- server/api/action/action.attributes.js | 2 +- server/api/action/action.controller.js | 2 +- server/api/action/action.model.js | 2 +- server/api/action/action.rpc.js | 2 +- server/api/action/index.js | 2 +- .../analyticCustomReport.attributes.js | 2 +- .../analyticCustomReport.controller.js | 2 +- .../analyticCustomReport.model.js | 2 +- .../analyticCustomReport.rpc.js | 2 +- server/api/analyticCustomReport/index.js | 2 +- .../analyticDefaultReport.attributes.js | 2 +- .../analyticDefaultReport.controller.js | 2 +- .../analyticDefaultReport.model.js | 2 +- .../analyticDefaultReport.rpc.js | 2 +- server/api/analyticDefaultReport/index.js | 2 +- .../analyticExtractedReport.attributes.js | 2 +- .../analyticExtractedReport.controller.js | 2 +- .../analyticExtractedReport.model.js | 2 +- .../analyticExtractedReport.rpc.js | 2 +- server/api/analyticExtractedReport/index.js | 2 +- .../analyticFieldReport.attributes.js | 2 +- .../analyticFieldReport.controller.js | 2 +- .../analyticFieldReport.model.js | 2 +- .../analyticFieldReport/analyticFieldReport.rpc.js | 2 +- server/api/analyticFieldReport/index.js | 2 +- .../analyticMetric/analyticMetric.attributes.js | 2 +- .../analyticMetric/analyticMetric.controller.js | 2 +- server/api/analyticMetric/analyticMetric.model.js | 2 +- server/api/analyticMetric/analyticMetric.rpc.js | 2 +- server/api/analyticMetric/index.js | 2 +- .../analyticTreeReport.attributes.js | 2 +- .../analyticTreeReport.controller.js | 2 +- .../analyticTreeReport/analyticTreeReport.model.js | 2 +- .../analyticTreeReport/analyticTreeReport.rpc.js | 2 +- server/api/analyticTreeReport/index.js | 2 +- server/api/attachment/attachment.attributes.js | 2 +- server/api/attachment/attachment.controller.js | 2 +- server/api/attachment/attachment.model.js | 2 +- server/api/attachment/attachment.rpc.js | 2 +- server/api/attachment/index.js | 2 +- .../authActiveDirectory.controller.js | 2 +- server/api/authActiveDirectory/index.js | 2 +- server/api/authGoogle/authGoogle.controller.js | 2 +- server/api/authGoogle/index.js | 2 +- server/api/authLocal/authLocal.controller.js | 2 +- server/api/authLocal/index.js | 2 +- server/api/automation/automation.attributes.js | 2 +- server/api/automation/automation.controller.js | 2 +- server/api/automation/automation.model.js | 2 +- server/api/automation/automation.rpc.js | 2 +- server/api/automation/index.js | 2 +- server/api/campaign/campaign.attributes.js | 2 +- server/api/campaign/campaign.controller.js | 2 +- server/api/campaign/campaign.model.js | 2 +- server/api/campaign/campaign.rpc.js | 2 +- server/api/campaign/index.js | 2 +- server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +- server/api/cannedAnswer/cannedAnswer.controller.js | 2 +- server/api/cannedAnswer/cannedAnswer.model.js | 2 +- server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +- server/api/cannedAnswer/index.js | 2 +- server/api/cdr/cdr.attributes.js | 2 +- server/api/cdr/cdr.controller.js | 2 +- server/api/cdr/cdr.model.js | 2 +- server/api/cdr/cdr.rpc.js | 2 +- server/api/cdr/index.js | 2 +- .../chatApplication/chatApplication.attributes.js | 2 +- .../chatApplication/chatApplication.controller.js | 2 +- .../api/chatApplication/chatApplication.model.js | 2 +- server/api/chatApplication/chatApplication.rpc.js | 2 +- server/api/chatApplication/index.js | 2 +- server/api/chatGroup/chatGroup.attributes.js | 2 +- server/api/chatGroup/chatGroup.controller.js | 2 +- server/api/chatGroup/chatGroup.events.js | 2 +- server/api/chatGroup/chatGroup.model.js | 2 +- server/api/chatGroup/chatGroup.rpc.js | 2 +- server/api/chatGroup/chatGroup.socket.js | 2 +- server/api/chatGroup/index.js | 2 +- .../chatInteraction/chatInteraction.attributes.js | 2 +- .../chatInteraction/chatInteraction.controller.js | 2 +- .../api/chatInteraction/chatInteraction.events.js | 2 +- .../api/chatInteraction/chatInteraction.model.js | 2 +- server/api/chatInteraction/chatInteraction.rpc.js | 2 +- .../api/chatInteraction/chatInteraction.socket.js | 2 +- server/api/chatInteraction/index.js | 2 +- .../chatInternalMessage.attributes.js | 2 +- .../chatInternalMessage.controller.js | 2 +- .../chatInternalMessage.events.js | 2 +- .../chatInternalMessage.model.js | 2 +- .../chatInternalMessage/chatInternalMessage.rpc.js | 2 +- .../chatInternalMessage.socket.js | 2 +- server/api/chatInternalMessage/index.js | 2 +- server/api/chatMessage/chatMessage.attributes.js | 2 +- server/api/chatMessage/chatMessage.controller.js | 2 +- server/api/chatMessage/chatMessage.events.js | 2 +- server/api/chatMessage/chatMessage.model.js | 2 +- server/api/chatMessage/chatMessage.rpc.js | 2 +- server/api/chatMessage/chatMessage.socket.js | 2 +- server/api/chatMessage/index.js | 2 +- .../chatOfflineMessage.attributes.js | 2 +- .../chatOfflineMessage.controller.js | 2 +- .../chatOfflineMessage.events.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.model.js | 2 +- .../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +- server/api/chatOfflineMessage/index.js | 2 +- .../chatProactiveAction.attributes.js | 2 +- .../chatProactiveAction.controller.js | 2 +- .../chatProactiveAction.model.js | 2 +- .../chatProactiveAction/chatProactiveAction.rpc.js | 2 +- server/api/chatProactiveAction/index.js | 2 +- server/api/chatQueue/chatQueue.attributes.js | 2 +- server/api/chatQueue/chatQueue.controller.js | 2 +- server/api/chatQueue/chatQueue.events.js | 2 +- server/api/chatQueue/chatQueue.model.js | 2 +- server/api/chatQueue/chatQueue.rpc.js | 2 +- server/api/chatQueue/chatQueue.socket.js | 2 +- server/api/chatQueue/index.js | 2 +- .../chatQueueReport/chatQueueReport.attributes.js | 2 +- .../chatQueueReport/chatQueueReport.controller.js | 2 +- .../api/chatQueueReport/chatQueueReport.model.js | 2 +- server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +- server/api/chatQueueReport/index.js | 2 +- .../chatTransferReport.attributes.js | 2 +- .../chatTransferReport.controller.js | 2 +- .../chatTransferReport/chatTransferReport.model.js | 2 +- .../chatTransferReport/chatTransferReport.rpc.js | 2 +- server/api/chatTransferReport/index.js | 2 +- server/api/chatWebsite/chatWebsite.attributes.js | 2 +- server/api/chatWebsite/chatWebsite.controller.js | 2 +- server/api/chatWebsite/chatWebsite.events.js | 2 +- server/api/chatWebsite/chatWebsite.model.js | 2 +- server/api/chatWebsite/chatWebsite.rpc.js | 2 +- server/api/chatWebsite/chatWebsite.socket.js | 2 +- server/api/chatWebsite/index.js | 2 +- server/api/client-side-logs.js | 2 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.js | 2 +- server/api/cloudProvider/cloudProvider.oauth.js | 2 +- server/api/cloudProvider/cloudProvider.rpc.js | 2 +- server/api/cloudProvider/index.js | 2 +- server/api/cmCompany/cmCompany.attributes.js | 2 +- server/api/cmCompany/cmCompany.controller.js | 2 +- server/api/cmCompany/cmCompany.model.js | 2 +- server/api/cmCompany/cmCompany.rpc.js | 2 +- server/api/cmCompany/index.js | 2 +- server/api/cmContact/cmContact.attributes.js | 2 +- server/api/cmContact/cmContact.controller.js | 2 +- server/api/cmContact/cmContact.events.js | 2 +- server/api/cmContact/cmContact.model.js | 2 +- server/api/cmContact/cmContact.rpc.js | 2 +- server/api/cmContact/cmContact.socket.js | 2 +- server/api/cmContact/index.js | 2 +- .../cmContactHasItem.attributes.js | 2 +- .../cmContactHasItem.controller.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.model.js | 2 +- .../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +- server/api/cmContactHasItem/index.js | 2 +- .../api/cmCustomField/cmCustomField.attributes.js | 2 +- .../api/cmCustomField/cmCustomField.controller.js | 2 +- server/api/cmCustomField/cmCustomField.model.js | 2 +- server/api/cmCustomField/cmCustomField.rpc.js | 2 +- server/api/cmCustomField/index.js | 2 +- server/api/cmHopper/cmHopper.attributes.js | 2 +- server/api/cmHopper/cmHopper.controller.js | 2 +- server/api/cmHopper/cmHopper.model.js | 2 +- server/api/cmHopper/cmHopper.rpc.js | 2 +- server/api/cmHopper/index.js | 2 +- .../cmHopperAdditionalPhone.attributes.js | 2 +- .../cmHopperAdditionalPhone.controller.js | 2 +- .../cmHopperAdditionalPhone.model.js | 2 +- .../cmHopperAdditionalPhone.rpc.js | 2 +- server/api/cmHopperAdditionalPhone/index.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +- .../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +- server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +- server/api/cmHopperBlack/index.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +- .../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +- server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +- server/api/cmHopperFinal/index.js | 2 +- .../cmHopperHistory/cmHopperHistory.attributes.js | 2 +- .../cmHopperHistory/cmHopperHistory.controller.js | 2 +- .../api/cmHopperHistory/cmHopperHistory.model.js | 2 +- server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +- server/api/cmHopperHistory/index.js | 2 +- server/api/cmList/cmList.attributes.js | 2 +- server/api/cmList/cmList.controller.js | 2 +- server/api/cmList/cmList.events.js | 2 +- server/api/cmList/cmList.model.js | 2 +- server/api/cmList/cmList.rpc.js | 2 +- server/api/cmList/cmList.socket.js | 2 +- server/api/cmList/index.js | 2 +- server/api/condition/condition.attributes.js | 2 +- server/api/condition/condition.controller.js | 2 +- server/api/condition/condition.model.js | 2 +- server/api/condition/condition.rpc.js | 2 +- server/api/condition/index.js | 2 +- .../contactItemType/contactItemType.attributes.js | 2 +- .../contactItemType/contactItemType.controller.js | 2 +- .../api/contactItemType/contactItemType.model.js | 2 +- server/api/contactItemType/contactItemType.rpc.js | 2 +- server/api/contactItemType/index.js | 2 +- server/api/dashboard/dashboard.attributes.js | 2 +- server/api/dashboard/dashboard.controller.js | 2 +- server/api/dashboard/dashboard.events.js | 2 +- server/api/dashboard/dashboard.model.js | 2 +- server/api/dashboard/dashboard.rpc.js | 2 +- server/api/dashboard/dashboard.socket.js | 2 +- server/api/dashboard/index.js | 2 +- .../api/dashboardItem/dashboardItem.attributes.js | 2 +- .../api/dashboardItem/dashboardItem.controller.js | 2 +- server/api/dashboardItem/dashboardItem.events.js | 2 +- server/api/dashboardItem/dashboardItem.model.js | 2 +- server/api/dashboardItem/dashboardItem.rpc.js | 2 +- server/api/dashboardItem/dashboardItem.socket.js | 2 +- server/api/dashboardItem/index.js | 2 +- server/api/disposition/disposition.attributes.js | 2 +- server/api/disposition/disposition.controller.js | 2 +- server/api/disposition/disposition.model.js | 2 +- server/api/disposition/disposition.rpc.js | 2 +- server/api/disposition/index.js | 2 +- server/api/faxAccount/faxAccount.attributes.js | 2 +- server/api/faxAccount/faxAccount.controller.js | 2 +- server/api/faxAccount/faxAccount.events.js | 2 +- server/api/faxAccount/faxAccount.model.js | 2 +- server/api/faxAccount/faxAccount.rpc.js | 2 +- server/api/faxAccount/faxAccount.socket.js | 2 +- server/api/faxAccount/index.js | 2 +- .../faxApplication/faxApplication.attributes.js | 2 +- .../faxApplication/faxApplication.controller.js | 2 +- server/api/faxApplication/faxApplication.model.js | 2 +- server/api/faxApplication/faxApplication.rpc.js | 2 +- server/api/faxApplication/index.js | 2 +- .../faxInteraction/faxInteraction.attributes.js | 2 +- .../faxInteraction/faxInteraction.controller.js | 2 +- server/api/faxInteraction/faxInteraction.events.js | 2 +- server/api/faxInteraction/faxInteraction.model.js | 2 +- server/api/faxInteraction/faxInteraction.rpc.js | 2 +- server/api/faxInteraction/faxInteraction.socket.js | 2 +- server/api/faxInteraction/index.js | 2 +- server/api/faxMessage/faxMessage.attributes.js | 2 +- server/api/faxMessage/faxMessage.controller.js | 2 +- server/api/faxMessage/faxMessage.events.js | 2 +- server/api/faxMessage/faxMessage.model.js | 2 +- server/api/faxMessage/faxMessage.rpc.js | 2 +- server/api/faxMessage/faxMessage.socket.js | 2 +- server/api/faxMessage/index.js | 2 +- server/api/faxQueue/faxQueue.attributes.js | 2 +- server/api/faxQueue/faxQueue.controller.js | 2 +- server/api/faxQueue/faxQueue.events.js | 2 +- server/api/faxQueue/faxQueue.model.js | 2 +- server/api/faxQueue/faxQueue.rpc.js | 2 +- server/api/faxQueue/faxQueue.socket.js | 2 +- server/api/faxQueue/index.js | 2 +- .../faxQueueReport/faxQueueReport.attributes.js | 2 +- .../faxQueueReport/faxQueueReport.controller.js | 2 +- server/api/faxQueueReport/faxQueueReport.model.js | 2 +- server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +- server/api/faxQueueReport/index.js | 2 +- .../faxTransferReport.attributes.js | 2 +- .../faxTransferReport.controller.js | 2 +- .../faxTransferReport/faxTransferReport.model.js | 2 +- .../api/faxTransferReport/faxTransferReport.rpc.js | 2 +- server/api/faxTransferReport/index.js | 2 +- server/api/intDeskAccount/index.js | 2 +- .../intDeskAccount/intDeskAccount.attributes.js | 2 +- .../intDeskAccount/intDeskAccount.controller.js | 2 +- server/api/intDeskAccount/intDeskAccount.model.js | 2 +- server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +- server/api/intDeskConfiguration/index.js | 2 +- .../intDeskConfiguration.attributes.js | 2 +- .../intDeskConfiguration.controller.js | 2 +- .../intDeskConfiguration.model.js | 2 +- .../intDeskConfiguration.rpc.js | 2 +- server/api/intDeskField/index.js | 2 +- server/api/intDeskField/intDeskField.attributes.js | 2 +- server/api/intDeskField/intDeskField.controller.js | 2 +- server/api/intDeskField/intDeskField.model.js | 2 +- server/api/intDeskField/intDeskField.rpc.js | 2 +- server/api/intDynamics365Account/index.js | 2 +- .../intDynamics365Account.attributes.js | 2 +- .../intDynamics365Account.controller.js | 2 +- .../intDynamics365Account.model.js | 2 +- .../intDynamics365Account.rpc.js | 2 +- server/api/intDynamics365Configuration/index.js | 2 +- .../intDynamics365Configuration.attributes.js | 2 +- .../intDynamics365Configuration.controller.js | 2 +- .../intDynamics365Configuration.model.js | 2 +- .../intDynamics365Configuration.rpc.js | 2 +- server/api/intDynamics365Field/index.js | 2 +- .../intDynamics365Field.attributes.js | 2 +- .../intDynamics365Field.controller.js | 2 +- .../intDynamics365Field.model.js | 2 +- .../intDynamics365Field/intDynamics365Field.rpc.js | 2 +- server/api/intFreshdeskAccount/index.js | 2 +- .../intFreshdeskAccount.attributes.js | 2 +- .../intFreshdeskAccount.controller.js | 2 +- .../intFreshdeskAccount.model.js | 2 +- .../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +- server/api/intFreshdeskConfiguration/index.js | 2 +- .../intFreshdeskConfiguration.attributes.js | 2 +- .../intFreshdeskConfiguration.controller.js | 2 +- .../intFreshdeskConfiguration.model.js | 2 +- .../intFreshdeskConfiguration.rpc.js | 2 +- server/api/intFreshdeskField/index.js | 2 +- .../intFreshdeskField.attributes.js | 2 +- .../intFreshdeskField.controller.js | 2 +- .../intFreshdeskField/intFreshdeskField.model.js | 2 +- .../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +- server/api/intFreshsalesAccount/index.js | 2 +- .../intFreshsalesAccount.attributes.js | 2 +- .../intFreshsalesAccount.controller.js | 2 +- .../intFreshsalesAccount.model.js | 2 +- .../intFreshsalesAccount.rpc.js | 2 +- server/api/intFreshsalesConfiguration/index.js | 2 +- .../intFreshsalesConfiguration.attributes.js | 2 +- .../intFreshsalesConfiguration.controller.js | 2 +- .../intFreshsalesConfiguration.model.js | 2 +- .../intFreshsalesConfiguration.rpc.js | 2 +- server/api/intFreshsalesField/index.js | 2 +- .../intFreshsalesField.attributes.js | 2 +- .../intFreshsalesField.controller.js | 2 +- .../intFreshsalesField/intFreshsalesField.model.js | 2 +- .../intFreshsalesField/intFreshsalesField.rpc.js | 2 +- server/api/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.events.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/realtime/index.js | 2 +- server/api/realtime/realtime.controller.js | 2 +- server/api/reportAgentPreview/index.js | 2 +- .../reportAgentPreview.attributes.js | 2 +- .../reportAgentPreview/reportAgentPreview.model.js | 2 +- .../reportAgentPreview/reportAgentPreview.rpc.js | 2 +- server/api/rpc/index.js | 2 +- server/api/rpc/rpc.controller.js | 2 +- server/api/schedule/index.js | 2 +- server/api/schedule/schedule.attributes.js | 2 +- server/api/schedule/schedule.controller.js | 2 +- server/api/schedule/schedule.model.js | 2 +- server/api/schedule/schedule.rpc.js | 2 +- server/api/screenRecording/index.js | 2 +- .../screenRecording/screenRecording.attributes.js | 2 +- .../screenRecording/screenRecording.controller.js | 2 +- .../api/screenRecording/screenRecording.model.js | 2 +- server/api/screenRecording/screenRecording.rpc.js | 2 +- server/api/setting/index.js | 2 +- server/api/setting/setting.attributes.js | 2 +- server/api/setting/setting.controller.js | 2 +- server/api/setting/setting.model.js | 2 +- server/api/setting/setting.rpc.js | 2 +- server/api/smsAccount/index.js | 2 +- server/api/smsAccount/smsAccount.attributes.js | 2 +- server/api/smsAccount/smsAccount.controller.js | 2 +- server/api/smsAccount/smsAccount.events.js | 2 +- server/api/smsAccount/smsAccount.model.js | 2 +- server/api/smsAccount/smsAccount.rpc.js | 2 +- server/api/smsAccount/smsAccount.socket.js | 2 +- server/api/smsApplication/index.js | 2 +- .../smsApplication/smsApplication.attributes.js | 2 +- .../smsApplication/smsApplication.controller.js | 2 +- server/api/smsApplication/smsApplication.model.js | 2 +- server/api/smsApplication/smsApplication.rpc.js | 2 +- server/api/smsInteraction/index.js | 2 +- .../smsInteraction/smsInteraction.attributes.js | 2 +- .../smsInteraction/smsInteraction.controller.js | 2 +- server/api/smsInteraction/smsInteraction.events.js | 2 +- server/api/smsInteraction/smsInteraction.model.js | 2 +- server/api/smsInteraction/smsInteraction.rpc.js | 2 +- server/api/smsInteraction/smsInteraction.socket.js | 2 +- server/api/smsMessage/index.js | 2 +- server/api/smsMessage/smsMessage.attributes.js | 2 +- server/api/smsMessage/smsMessage.controller.js | 2 +- server/api/smsMessage/smsMessage.events.js | 2 +- server/api/smsMessage/smsMessage.model.js | 2 +- server/api/smsMessage/smsMessage.rpc.js | 2 +- server/api/smsMessage/smsMessage.socket.js | 2 +- server/api/smsQueue/index.js | 2 +- server/api/smsQueue/smsQueue.attributes.js | 2 +- server/api/smsQueue/smsQueue.controller.js | 2 +- server/api/smsQueue/smsQueue.events.js | 2 +- server/api/smsQueue/smsQueue.model.js | 2 +- server/api/smsQueue/smsQueue.rpc.js | 2 +- server/api/smsQueue/smsQueue.socket.js | 2 +- server/api/smsQueueReport/index.js | 2 +- .../smsQueueReport/smsQueueReport.attributes.js | 2 +- .../smsQueueReport/smsQueueReport.controller.js | 2 +- server/api/smsQueueReport/smsQueueReport.model.js | 2 +- server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +- server/api/smsTransferReport/index.js | 2 +- .../smsTransferReport.attributes.js | 2 +- .../smsTransferReport.controller.js | 2 +- .../smsTransferReport/smsTransferReport.model.js | 2 +- .../api/smsTransferReport/smsTransferReport.rpc.js | 2 +- server/api/sound/index.js | 2 +- server/api/sound/sound.attributes.js | 2 +- server/api/sound/sound.controller.js | 2 +- server/api/sound/sound.model.js | 2 +- server/api/sound/sound.rpc.js | 2 +- server/api/squareMessage/index.js | 2 +- .../api/squareMessage/squareMessage.attributes.js | 2 +- .../api/squareMessage/squareMessage.controller.js | 2 +- server/api/squareMessage/squareMessage.model.js | 2 +- server/api/squareMessage/squareMessage.rpc.js | 2 +- server/api/squareOdbc/index.js | 2 +- server/api/squareOdbc/squareOdbc.attributes.js | 2 +- server/api/squareOdbc/squareOdbc.controller.js | 2 +- server/api/squareOdbc/squareOdbc.model.js | 2 +- server/api/squareOdbc/squareOdbc.rpc.js | 2 +- server/api/squareProject/index.js | 2 +- .../api/squareProject/squareProject.attributes.js | 2 +- .../api/squareProject/squareProject.controller.js | 2 +- server/api/squareProject/squareProject.events.js | 2 +- server/api/squareProject/squareProject.model.js | 2 +- server/api/squareProject/squareProject.rpc.js | 2 +- server/api/squareProject/squareProject.socket.js | 2 +- server/api/squareRecording/index.js | 2 +- .../squareRecording/squareRecording.attributes.js | 2 +- .../squareRecording/squareRecording.controller.js | 2 +- .../api/squareRecording/squareRecording.model.js | 2 +- server/api/squareRecording/squareRecording.rpc.js | 2 +- server/api/squareReport/index.js | 2 +- server/api/squareReport/squareReport.attributes.js | 2 +- server/api/squareReport/squareReport.controller.js | 2 +- server/api/squareReport/squareReport.model.js | 2 +- server/api/squareReport/squareReport.rpc.js | 2 +- server/api/squareReportDetail/index.js | 2 +- .../squareReportDetail.attributes.js | 2 +- .../squareReportDetail.controller.js | 2 +- .../squareReportDetail/squareReportDetail.model.js | 2 +- .../squareReportDetail/squareReportDetail.rpc.js | 2 +- server/api/system/index.js | 2 +- server/api/system/system.controller.js | 2 +- server/api/tag/index.js | 2 +- server/api/tag/tag.attributes.js | 2 +- server/api/tag/tag.controller.js | 2 +- server/api/tag/tag.model.js | 2 +- server/api/tag/tag.rpc.js | 2 +- server/api/team/index.js | 2 +- server/api/team/team.attributes.js | 2 +- server/api/team/team.controller.js | 2 +- server/api/team/team.events.js | 2 +- server/api/team/team.model.js | 2 +- server/api/team/team.rpc.js | 2 +- server/api/team/team.socket.js | 2 +- .../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +- .../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +- server/api/teamVoiceQueue/index.js | 2 +- .../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +- server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +- server/api/template/index.js | 2 +- server/api/template/template.attributes.js | 2 +- server/api/template/template.controller.js | 2 +- server/api/template/template.model.js | 2 +- server/api/template/template.rpc.js | 2 +- server/api/trigger/index.js | 2 +- server/api/trigger/trigger.attributes.js | 2 +- server/api/trigger/trigger.controller.js | 2 +- server/api/trigger/trigger.model.js | 2 +- server/api/trigger/trigger.rpc.js | 2 +- server/api/trunk/index.js | 2 +- server/api/trunk/trunk.attributes.js | 2 +- server/api/trunk/trunk.controller.js | 2 +- server/api/trunk/trunk.model.js | 2 +- server/api/trunk/trunk.rpc.js | 2 +- server/api/user-setting/index.js | 2 +- server/api/user-setting/user-setting.attributes.js | 2 +- server/api/user-setting/user-setting.controller.js | 2 +- server/api/user-setting/user-setting.events.js | 2 +- server/api/user-setting/user-setting.model.js | 2 +- server/api/user-setting/user-setting.socket.js | 2 +- server/api/user/index.js | 2 +- server/api/user/user.attributes.js | 2 +- server/api/user/user.controller.js | 2 +- server/api/user/user.events.js | 2 +- server/api/user/user.model.js | 2 +- server/api/user/user.rpc.js | 2 +- server/api/user/user.socket.js | 2 +- server/api/userChatQueue/index.js | 2 +- .../api/userChatQueue/userChatQueue.attributes.js | 2 +- server/api/userChatQueue/userChatQueue.model.js | 2 +- server/api/userChatQueue/userChatQueue.rpc.js | 2 +- server/api/userFaxQueue/index.js | 2 +- server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +- server/api/userFaxQueue/userFaxQueue.model.js | 2 +- server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +- server/api/userMailQueue/index.js | 2 +- .../api/userMailQueue/userMailQueue.attributes.js | 2 +- server/api/userMailQueue/userMailQueue.model.js | 2 +- server/api/userMailQueue/userMailQueue.rpc.js | 2 +- server/api/userNotification/index.js | 2 +- .../userNotification.attributes.js | 2 +- .../userNotification.controller.js | 2 +- .../userNotification/userNotification.events.js | 2 +- .../api/userNotification/userNotification.model.js | 2 +- .../api/userNotification/userNotification.rpc.js | 2 +- .../userNotification/userNotification.socket.js | 2 +- server/api/userOpenchannelQueue/index.js | 2 +- .../userOpenchannelQueue.attributes.js | 2 +- .../userOpenchannelQueue.model.js | 2 +- .../userOpenchannelQueue.rpc.js | 2 +- server/api/userProfile/index.js | 2 +- server/api/userProfile/userProfile.attributes.js | 2 +- server/api/userProfile/userProfile.controller.js | 2 +- server/api/userProfile/userProfile.events.js | 2 +- server/api/userProfile/userProfile.model.js | 2 +- server/api/userProfile/userProfile.rpc.js | 2 +- server/api/userProfile/userProfile.socket.js | 2 +- server/api/userProfileResource/index.js | 2 +- .../userProfileResource.attributes.js | 2 +- .../userProfileResource.controller.js | 2 +- .../userProfileResource.model.js | 2 +- .../userProfileResource/userProfileResource.rpc.js | 2 +- server/api/userProfileSection/index.js | 2 +- .../userProfileSection.attributes.js | 2 +- .../userProfileSection.controller.js | 2 +- .../userProfileSection/userProfileSection.model.js | 2 +- .../userProfileSection/userProfileSection.rpc.js | 2 +- server/api/userSmsQueue/index.js | 2 +- server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +- server/api/userSmsQueue/userSmsQueue.model.js | 2 +- server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +- .../userVoicePrefix/userVoicePrefix.attributes.js | 2 +- .../api/userVoicePrefix/userVoicePrefix.model.js | 2 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/contacts/index.js | 2 +- server/components/contacts/sql-utils.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/interaction/sql-utils.js | 2 +- .../components/interaction/update-interaction.js | 2 +- server/components/interaction/utils.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/components/realtime/agents.js | 2 +- server/components/realtime/queues.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/cloud-provider.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/schedule/whatsapp.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/api.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/events.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/project.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/models/action.js | 2 +- server/services/ami/dialer/models/agentComplete.js | 2 +- server/services/ami/dialer/models/final.js | 2 +- server/services/ami/dialer/models/hangup.js | 2 +- server/services/ami/dialer/models/history.js | 2 +- .../ami/dialer/models/queueCallerAbandon.js | 2 +- server/services/ami/dialer/utils/hopper.js | 2 +- server/services/ami/dialer/utils/index.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/voiceQueueSummary.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/realtime/utils.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/interval.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/setting.js | 2 +- server/services/ami/rpc/template.js | 2 +- server/services/ami/rpc/trigger.js | 2 +- server/services/ami/rpc/trunk.js | 2 +- server/services/ami/rpc/user.js | 2 +- server/services/ami/rpc/voiceAgentReport.js | 2 +- server/services/ami/rpc/voiceCallReport.js | 2 +- server/services/ami/rpc/voiceDialReport.js | 2 +- server/services/ami/rpc/voiceExtension.js | 2 +- server/services/ami/rpc/voiceQueue.js | 2 +- server/services/ami/rpc/voiceQueueReport.js | 2 +- server/services/ami/rpc/voiceQueueRt.js | 2 +- server/services/ami/rpc/voiceRecording.js | 2 +- server/services/ami/rpc/voiceTransferReport.js | 2 +- server/services/ami/server/index.js | 2 +- server/services/ami/trigger/cmContact/index.js | 2 +- server/services/ami/trigger/index.js | 2 +- server/services/ami/trigger/integration/desk.js | 2 +- .../ami/trigger/integration/dynamics365.js | 2 +- .../services/ami/trigger/integration/freshdesk.js | 2 +- .../services/ami/trigger/integration/freshsales.js | 2 +- server/services/ami/trigger/integration/index.js | 2 +- .../services/ami/trigger/integration/salesforce.js | 2 +- .../services/ami/trigger/integration/servicenow.js | 2 +- .../services/ami/trigger/integration/sugarcrm.js | 2 +- server/services/ami/trigger/integration/util.js | 2 +- server/services/ami/trigger/integration/vtiger.js | 2 +- server/services/ami/trigger/integration/zendesk.js | 2 +- server/services/ami/trigger/integration/zoho.js | 2 +- server/services/ami/trigger/script/index.js | 2 +- server/services/ami/trigger/urlforward/index.js | 2 +- server/services/email/client.js | 2 +- server/services/email/index.js | 2 +- server/services/email/lib/email.js | 2 +- server/services/email/lib/imap.js | 2 +- server/services/email/lib/smtp.js | 2 +- server/services/email/lib/utils.js | 2 +- server/services/email/model/mailAccount.js | 2 +- server/services/email/realtime/index.js | 2 +- server/services/email/rpc/mailAccount.js | 2 +- server/services/email/rpc/setting.js | 2 +- server/services/email/server/index.js | 2 +- server/services/express/index.js | 2 +- server/services/routing/client.js | 2 +- server/services/routing/index.js | 2 +- server/services/routing/lib/rule-engine.js | 2 +- server/services/routing/mailRpc/index.js | 2 +- server/services/routing/model/agent.js | 2 +- server/services/routing/model/chatQueue.js | 2 +- server/services/routing/model/faxQueue.js | 2 +- server/services/routing/model/interval.js | 2 +- server/services/routing/model/mailQueue.js | 2 +- server/services/routing/model/openchannelQueue.js | 2 +- server/services/routing/model/smsQueue.js | 2 +- server/services/routing/model/whatsappQueue.js | 2 +- server/services/routing/realtime/index.js | 2 +- server/services/routing/rpc/chatInteraction.js | 2 +- server/services/routing/rpc/chatMessage.js | 2 +- server/services/routing/rpc/chatQueue.js | 2 +- server/services/routing/rpc/chatQueueReport.js | 2 +- server/services/routing/rpc/faxInteraction.js | 2 +- server/services/routing/rpc/faxMessage.js | 2 +- server/services/routing/rpc/faxQueue.js | 2 +- server/services/routing/rpc/faxQueueReport.js | 2 +- server/services/routing/rpc/interval.js | 2 +- server/services/routing/rpc/mailInteraction.js | 2 +- server/services/routing/rpc/mailMessage.js | 2 +- server/services/routing/rpc/mailQueue.js | 2 +- server/services/routing/rpc/mailQueueReport.js | 2 +- .../services/routing/rpc/openchannelInteraction.js | 2 +- server/services/routing/rpc/openchannelMessage.js | 2 +- server/services/routing/rpc/openchannelQueue.js | 2 +- .../services/routing/rpc/openchannelQueueReport.js | 2 +- server/services/routing/rpc/smsInteraction.js | 2 +- server/services/routing/rpc/smsMessage.js | 2 +- server/services/routing/rpc/smsQueue.js | 2 +- server/services/routing/rpc/smsQueueReport.js | 2 +- server/services/routing/rpc/user.js | 2 +- server/services/routing/rpc/whatsappInteraction.js | 2 +- server/services/routing/rpc/whatsappMessage.js | 2 +- server/services/routing/rpc/whatsappQueue.js | 2 +- server/services/routing/rpc/whatsappQueueReport.js | 2 +- .../services/routing/server/applications/agent.js | 2 +- .../routing/server/applications/amazonlex.js | 2 +- .../routing/server/applications/autoreply.js | 2 +- .../services/routing/server/applications/close.js | 2 +- .../routing/server/applications/dialogflow.js | 2 +- .../routing/server/applications/dialogflowV2.js | 2 +- .../services/routing/server/applications/gotoif.js | 2 +- .../services/routing/server/applications/gotop.js | 2 +- .../routing/server/applications/message.js | 2 +- .../services/routing/server/applications/noop.js | 2 +- .../services/routing/server/applications/queue.js | 2 +- .../routing/server/applications/strategy/agent.js | 2 +- .../server/applications/strategy/beepall.js | 2 +- .../routing/server/applications/strategy/index.js | 2 +- .../server/applications/strategy/rrmemory.js | 2 +- .../routing/server/applications/strategy/util.js | 2 +- .../services/routing/server/applications/system.js | 2 +- server/services/routing/server/applications/tag.js | 2 +- .../services/routing/server/applications/tvox.js | 2 +- .../services/routing/server/applications/utils.js | 2 +- server/services/routing/server/index.js | 2 +- server/services/routing/server/interval.js | 2 +- server/services/xdr/agents.controller.js | 2 +- server/services/xdr/calls.controller.js | 2 +- server/services/xdr/core.controller.js | 2 +- server/services/xdr/dials.controller.js | 2 +- server/services/xdr/index.js | 2 +- server/services/xdr/members.controller.js | 2 +- server/services/xdr/queues.controller.js | 2 +- server/services/xdr/recordings.controller.js | 2 +- server/services/xdr/transfers.controller.js | 2 +- server/services/xdr/utils.js | 2 +- server/utils/client-side-logger.js | 2 +- server/utils/iftime.js | 2 +- server/utils/loggers.js | 2 +- server/utils/mask-sensitive-data.js | 2 +- server/utils/safe-template.js | 2 +- server/utils/update-app-config.js | 2 +- 1203 files changed, 1203 insertions(+), 1203 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9188002..72584d1 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-26T04:35:14.451Z", + "time": "2022-10-26T12:04:32.698Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index cacf6e5..b881c6a 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-10-26T04:35:14.451Z", + "time": "2022-10-26T12:04:32.698Z", "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 f0811cd..d868ee3 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 _0x0e93=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','exports','getDataValue','action','contactManager','integration','motionbar','jscripty','urlForward','browser','script'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e93,0x1b6));var _0x30e9=function(_0x5c27f4,_0x502ce2){_0x5c27f4=_0x5c27f4-0x0;var _0x55698c=_0x0e93[_0x5c27f4];return _0x55698c;};'use strict';var Sequelize=require('sequelize');module[_0x30e9('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x501c36){return this[_0x30e9('0x1')](_0x30e9('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x30e9('0x3'),_0x30e9('0x4'),_0x30e9('0x5'),_0x30e9('0x6'),_0x30e9('0x7'),_0x30e9('0x8'),'bot',_0x30e9('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x30e9('0xa')},'data1':{'type':Sequelize[_0x30e9('0xb')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x30e9('0xb')](0x1000),'comment':_0x30e9('0xc')},'data4':{'type':Sequelize[_0x30e9('0xb')](0x1000),'comments':_0x30e9('0xd')},'data5':{'type':Sequelize[_0x30e9('0xb')](0x1000),'comments':_0x30e9('0xe')},'data6':{'type':Sequelize[_0x30e9('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x30e9('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x7a95=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x5e84ee,_0x4e49af){var _0x14a436=function(_0x5ba5eb){while(--_0x5ba5eb){_0x5e84ee['push'](_0x5e84ee['shift']());}};_0x14a436(++_0x4e49af);}(_0x7a95,0xa5));var _0x57a9=function(_0x28259f,_0x4f7913){_0x28259f=_0x28259f-0x0;var _0x3d4d2b=_0x7a95[_0x28259f];return _0x3d4d2b;};'use strict';var Sequelize=require('sequelize');module[_0x57a9('0x0')]={'name':{'type':Sequelize[_0x57a9('0x1')],'get':function(_0x4620d1){return this[_0x57a9('0x2')](_0x57a9('0x3'));}},'action':{'type':Sequelize[_0x57a9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x57a9('0x5'),_0x57a9('0x6'),_0x57a9('0x7'),_0x57a9('0x8'),_0x57a9('0x9'),_0x57a9('0xa'),_0x57a9('0xb'),_0x57a9('0xc')]],'msg':_0x57a9('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x57a9('0xe')},'data2':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0xf')},'data3':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0x10')},'data4':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':_0x57a9('0x11')},'data6':{'type':Sequelize[_0x57a9('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x57a9('0x12')],'comments':_0x57a9('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 7a29727..2b3c200 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 _0xf0e9=['catch','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','body','Action','find'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xf0e9,0x197));var _0x9f0e=function(_0x51dbe1,_0x18f331){_0x51dbe1=_0x51dbe1-0x0;var _0x99910e=_0xf0e9[_0x51dbe1];return _0x99910e;};'use strict';var emlformat=require(_0x9f0e('0x0'));var rimraf=require(_0x9f0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9f0e('0x2'));var moment=require(_0x9f0e('0x3'));var BPromise=require(_0x9f0e('0x4'));var Mustache=require(_0x9f0e('0x5'));var util=require(_0x9f0e('0x6'));var path=require(_0x9f0e('0x7'));var sox=require(_0x9f0e('0x8'));var csv=require(_0x9f0e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9f0e('0xa'));var crypto=require(_0x9f0e('0xb'));var jsforce=require(_0x9f0e('0xc'));var deskjs=require(_0x9f0e('0xd'));var toCsv=require(_0x9f0e('0x9'));var querystring=require('querystring');var Papa=require(_0x9f0e('0xe'));var Redis=require(_0x9f0e('0xf'));var authService=require(_0x9f0e('0x10'));var qs=require(_0x9f0e('0x11'));var as=require(_0x9f0e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9f0e('0x13'));var utils=require(_0x9f0e('0x14'));var config=require(_0x9f0e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f0e('0x16'))['db'];function respondWithStatusCode(_0x5e901a,_0x32d9ac){_0x32d9ac=_0x32d9ac||0xcc;return function(_0x48cac0){if(_0x48cac0){return _0x5e901a['sendStatus'](_0x32d9ac);}return _0x5e901a[_0x9f0e('0x17')](_0x32d9ac)['end']();};}function respondWithResult(_0x2c60a5,_0x5d393f){_0x5d393f=_0x5d393f||0xc8;return function(_0x42b47d){if(_0x42b47d){return _0x2c60a5[_0x9f0e('0x17')](_0x5d393f)['json'](_0x42b47d);}};}function respondWithFilteredResult(_0x15d79c,_0x9f5e87){return function(_0x28f464){if(_0x28f464){var _0x4d7520=typeof _0x9f5e87['offset']===_0x9f0e('0x18')&&typeof _0x9f5e87[_0x9f0e('0x19')]===_0x9f0e('0x18');var _0x41952f=_0x28f464['count'];var _0x41ac56=_0x4d7520?0x0:_0x9f5e87['offset'];var _0x178742=_0x4d7520?_0x28f464['count']:_0x9f5e87[_0x9f0e('0x1a')]+_0x9f5e87[_0x9f0e('0x19')];var _0x44edc5;if(_0x178742>=_0x41952f){_0x178742=_0x41952f;_0x44edc5=0xc8;}else{_0x44edc5=0xce;}_0x15d79c[_0x9f0e('0x17')](_0x44edc5);return _0x15d79c[_0x9f0e('0x1b')](_0x9f0e('0x1c'),_0x41ac56+'-'+_0x178742+'/'+_0x41952f)[_0x9f0e('0x1d')](_0x28f464);}return null;};}function patchUpdates(_0x3575b9){return function(_0x19008e){try{jsonpatch[_0x9f0e('0x1e')](_0x19008e,_0x3575b9,!![]);}catch(_0x505659){return BPromise[_0x9f0e('0x1f')](_0x505659);}return _0x19008e[_0x9f0e('0x20')]();};}function saveUpdates(_0x52c048,_0x50a5c7){return function(_0x965772){if(_0x965772){return _0x965772[_0x9f0e('0x21')](_0x52c048)[_0x9f0e('0x22')](function(_0xe78e6d){return _0xe78e6d;});}return null;};}function removeEntity(_0x2c9b51,_0xdf5433){return function(_0x1488b3){if(_0x1488b3){return _0x1488b3[_0x9f0e('0x23')]()[_0x9f0e('0x22')](function(){_0x2c9b51[_0x9f0e('0x17')](0xcc)[_0x9f0e('0x24')]();});}};}function handleEntityNotFound(_0x23ffd2,_0x42413b){return function(_0x318e4e){if(!_0x318e4e){_0x23ffd2['sendStatus'](0x194);}return _0x318e4e;};}function handleError(_0x50a1e5,_0x3cf944){_0x3cf944=_0x3cf944||0x1f4;return function(_0x445164){logger[_0x9f0e('0x25')](_0x445164[_0x9f0e('0x26')]);if(_0x445164[_0x9f0e('0x27')]){delete _0x445164[_0x9f0e('0x27')];}_0x50a1e5[_0x9f0e('0x17')](_0x3cf944)['send'](_0x445164);};}exports[_0x9f0e('0x21')]=function(_0x3db57e,_0x1a25b4){if(_0x3db57e[_0x9f0e('0x28')]['id']){delete _0x3db57e[_0x9f0e('0x28')]['id'];}return db[_0x9f0e('0x29')][_0x9f0e('0x2a')]({'where':{'id':_0x3db57e['params']['id']}})[_0x9f0e('0x22')](handleEntityNotFound(_0x1a25b4,null))[_0x9f0e('0x22')](saveUpdates(_0x3db57e[_0x9f0e('0x28')],null))[_0x9f0e('0x22')](respondWithResult(_0x1a25b4,null))[_0x9f0e('0x2b')](handleError(_0x1a25b4,null));};exports[_0x9f0e('0x23')]=function(_0x579486,_0x5a41cf){return db[_0x9f0e('0x29')][_0x9f0e('0x2a')]({'where':{'id':_0x579486[_0x9f0e('0x2c')]['id']}})[_0x9f0e('0x22')](handleEntityNotFound(_0x5a41cf,null))[_0x9f0e('0x22')](removeEntity(_0x5a41cf,null))[_0x9f0e('0x2b')](handleError(_0x5a41cf,null));}; \ No newline at end of file +var _0xc5a0=['stack','name','send','update','body','Action','params','catch','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x5adb00,_0x329c2a){var _0xc32601=function(_0x4bdff8){while(--_0x4bdff8){_0x5adb00['push'](_0x5adb00['shift']());}};_0xc32601(++_0x329c2a);}(_0xc5a0,0xbc));var _0x0c5a=function(_0x504f5d,_0xefefa7){_0x504f5d=_0x504f5d-0x0;var _0x3f794d=_0xc5a0[_0x504f5d];return _0x3f794d;};'use strict';var emlformat=require(_0x0c5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c5a('0x1'));var rp=require('request-promise');var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var Mustache=require(_0x0c5a('0x4'));var util=require(_0x0c5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0c5a('0x6'));var ejs=require(_0x0c5a('0x7'));var fs=require('fs');var fs_extra=require(_0x0c5a('0x8'));var _=require(_0x0c5a('0x9'));var squel=require(_0x0c5a('0xa'));var crypto=require(_0x0c5a('0xb'));var jsforce=require(_0x0c5a('0xc'));var deskjs=require(_0x0c5a('0xd'));var toCsv=require(_0x0c5a('0x6'));var querystring=require(_0x0c5a('0xe'));var Papa=require('papaparse');var Redis=require(_0x0c5a('0xf'));var authService=require(_0x0c5a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c5a('0x11'));var logger=require(_0x0c5a('0x12'))('api');var utils=require(_0x0c5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c5a('0x14'));var db=require(_0x0c5a('0x15'))['db'];function respondWithStatusCode(_0x14cd6b,_0x324ae9){_0x324ae9=_0x324ae9||0xcc;return function(_0x289a0c){if(_0x289a0c){return _0x14cd6b['sendStatus'](_0x324ae9);}return _0x14cd6b['status'](_0x324ae9)[_0x0c5a('0x16')]();};}function respondWithResult(_0x56c3b1,_0x7c71a8){_0x7c71a8=_0x7c71a8||0xc8;return function(_0x138720){if(_0x138720){return _0x56c3b1[_0x0c5a('0x17')](_0x7c71a8)[_0x0c5a('0x18')](_0x138720);}};}function respondWithFilteredResult(_0x396bf2,_0x5e50b9){return function(_0x443258){if(_0x443258){var _0x73520f=typeof _0x5e50b9[_0x0c5a('0x19')]===_0x0c5a('0x1a')&&typeof _0x5e50b9['limit']===_0x0c5a('0x1a');var _0x3bf1db=_0x443258[_0x0c5a('0x1b')];var _0x425ac7=_0x73520f?0x0:_0x5e50b9[_0x0c5a('0x19')];var _0x43cc7b=_0x73520f?_0x443258[_0x0c5a('0x1b')]:_0x5e50b9[_0x0c5a('0x19')]+_0x5e50b9[_0x0c5a('0x1c')];var _0x4475f5;if(_0x43cc7b>=_0x3bf1db){_0x43cc7b=_0x3bf1db;_0x4475f5=0xc8;}else{_0x4475f5=0xce;}_0x396bf2[_0x0c5a('0x17')](_0x4475f5);return _0x396bf2[_0x0c5a('0x1d')](_0x0c5a('0x1e'),_0x425ac7+'-'+_0x43cc7b+'/'+_0x3bf1db)[_0x0c5a('0x18')](_0x443258);}return null;};}function patchUpdates(_0x1a933a){return function(_0x1f05f0){try{jsonpatch[_0x0c5a('0x1f')](_0x1f05f0,_0x1a933a,!![]);}catch(_0x332993){return BPromise[_0x0c5a('0x20')](_0x332993);}return _0x1f05f0[_0x0c5a('0x21')]();};}function saveUpdates(_0x2b9586,_0x2dabcb){return function(_0x3f599c){if(_0x3f599c){return _0x3f599c['update'](_0x2b9586)[_0x0c5a('0x22')](function(_0x4d00d4){return _0x4d00d4;});}return null;};}function removeEntity(_0x575f5e,_0x457d63){return function(_0x26de60){if(_0x26de60){return _0x26de60[_0x0c5a('0x23')]()['then'](function(){_0x575f5e[_0x0c5a('0x17')](0xcc)[_0x0c5a('0x16')]();});}};}function handleEntityNotFound(_0x91c3ed,_0x29a79f){return function(_0x1d5ee9){if(!_0x1d5ee9){_0x91c3ed['sendStatus'](0x194);}return _0x1d5ee9;};}function handleError(_0x44b87c,_0x1ff181){_0x1ff181=_0x1ff181||0x1f4;return function(_0x3ceee3){logger[_0x0c5a('0x24')](_0x3ceee3[_0x0c5a('0x25')]);if(_0x3ceee3[_0x0c5a('0x26')]){delete _0x3ceee3[_0x0c5a('0x26')];}_0x44b87c[_0x0c5a('0x17')](_0x1ff181)[_0x0c5a('0x27')](_0x3ceee3);};}exports[_0x0c5a('0x28')]=function(_0x2949c1,_0x332bcf){if(_0x2949c1['body']['id']){delete _0x2949c1[_0x0c5a('0x29')]['id'];}return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x2949c1[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x332bcf,null))[_0x0c5a('0x22')](saveUpdates(_0x2949c1['body'],null))[_0x0c5a('0x22')](respondWithResult(_0x332bcf,null))['catch'](handleError(_0x332bcf,null));};exports[_0x0c5a('0x23')]=function(_0x5e7bc2,_0x2e60c9){return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x5e7bc2[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x2e60c9,null))[_0x0c5a('0x22')](removeEntity(_0x2e60c9,null))[_0x0c5a('0x2c')](handleError(_0x2e60c9,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 1a4b3b7..23dea0d 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 _0x3b91=['path','rimraf','../../config/environment','exports','define','Action','tools_actions','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0xa76f70,_0x115a75){var _0x24459b=function(_0x425831){while(--_0x425831){_0xa76f70['push'](_0xa76f70['shift']());}};_0x24459b(++_0x115a75);}(_0x3b91,0x127));var _0x13b9=function(_0x909ba0,_0x48d8be){_0x909ba0=_0x909ba0-0x0;var _0x2673c5=_0x3b91[_0x909ba0];return _0x2673c5;};'use strict';var _=require(_0x13b9('0x0'));var util=require(_0x13b9('0x1'));var logger=require(_0x13b9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x13b9('0x3'));var rp=require(_0x13b9('0x4'));var fs=require('fs');var path=require(_0x13b9('0x5'));var rimraf=require(_0x13b9('0x6'));var config=require(_0x13b9('0x7'));var attributes=require('./action.attributes');module[_0x13b9('0x8')]=function(_0x33bcd2,_0x4fe8dd){return _0x33bcd2[_0x13b9('0x9')](_0x13b9('0xa'),attributes,{'tableName':_0x13b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff3c=['tools_actions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x361e2c,_0x5f584f){var _0x859c70=function(_0x1f0ab5){while(--_0x1f0ab5){_0x361e2c['push'](_0x361e2c['shift']());}};_0x859c70(++_0x5f584f);}(_0xff3c,0x1a3));var _0xcff3=function(_0x3c4322,_0x2e87f9){_0x3c4322=_0x3c4322-0x0;var _0x4ea1b5=_0xff3c[_0x3c4322];return _0x4ea1b5;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var logger=require(_0xcff3('0x2'))('api');var moment=require(_0xcff3('0x3'));var BPromise=require(_0xcff3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcff3('0x5'));var rimraf=require(_0xcff3('0x6'));var config=require(_0xcff3('0x7'));var attributes=require(_0xcff3('0x8'));module['exports']=function(_0x205a14,_0x48a6b2){return _0x205a14[_0xcff3('0x9')]('Action',attributes,{'tableName':_0xcff3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index c120798..bd6da6e 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x4975,0x86));var _0x5497=function(_0x14f63f,_0x24fb36){_0x14f63f=_0x14f63f-0x0;var _0x256758=_0x4975[_0x14f63f];return _0x256758;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0xf96866,_0x547647){var _0x336c0d=function(_0x4d03be){while(--_0x4d03be){_0xf96866['push'](_0xf96866['shift']());}};_0x336c0d(++_0x547647);}(_0xe14b,0x93));var _0xbe14=function(_0x38dd04,_0xabfd0b){_0x38dd04=_0x38dd04-0x0;var _0x429407=_0xe14b[_0x38dd04];return _0x429407;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 65d88f1..cb48595 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 _0x9ea3=['isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./action.controller','put'];(function(_0x28101b,_0x264a9b){var _0x1d562f=function(_0x35f53e){while(--_0x35f53e){_0x28101b['push'](_0x28101b['shift']());}};_0x1d562f(++_0x264a9b);}(_0x9ea3,0x170));var _0x39ea=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0x9ea3[_0x3358ba];return _0x296e73;};'use strict';var multer=require(_0x39ea('0x0'));var util=require(_0x39ea('0x1'));var path=require('path');var timeout=require(_0x39ea('0x2'));var express=require(_0x39ea('0x3'));var router=express[_0x39ea('0x4')]();var fs_extra=require(_0x39ea('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x39ea('0x6'));var controller=require(_0x39ea('0x7'));router[_0x39ea('0x8')]('/:id',auth[_0x39ea('0x9')](),controller[_0x39ea('0xa')]);router[_0x39ea('0xb')]('/:id',auth[_0x39ea('0x9')](),controller['destroy']);module[_0x39ea('0xc')]=router; \ No newline at end of file +var _0x6859=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer'];(function(_0x5a66d8,_0x988719){var _0x488c3b=function(_0x53023f){while(--_0x53023f){_0x5a66d8['push'](_0x5a66d8['shift']());}};_0x488c3b(++_0x988719);}(_0x6859,0xc3));var _0x9685=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x6859[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0x9685('0x0'));var util=require('util');var path=require(_0x9685('0x1'));var timeout=require(_0x9685('0x2'));var express=require(_0x9685('0x3'));var router=express[_0x9685('0x4')]();var fs_extra=require(_0x9685('0x5'));var auth=require(_0x9685('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9685('0x7'));var controller=require(_0x9685('0x8'));router['put'](_0x9685('0x9'),auth[_0x9685('0xa')](),controller[_0x9685('0xb')]);router[_0x9685('0xc')](_0x9685('0x9'),auth['isAuthenticated'](),controller[_0x9685('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 9e87710..8cc0b0f 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 _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0x5fd1,0x155));var _0x15fd=function(_0x12bd4a,_0x12b7a0){_0x12bd4a=_0x12bd4a-0x0;var _0x298112=_0x5fd1[_0x12bd4a];return _0x298112;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}}; \ No newline at end of file +var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x3b9e53,_0x2f9366){var _0x51af53=function(_0x56bbe8){while(--_0x56bbe8){_0x3b9e53['push'](_0x3b9e53['shift']());}};_0x51af53(++_0x2f9366);}(_0x687b,0x14a));var _0xb687=function(_0x29b886,_0x3ec7c2){_0x29b886=_0x29b886-0x0;var _0x263ef9=_0x687b[_0x29b886];return _0x263ef9;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 559ce66..e9aff69 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 _0xdd73=['startDate','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','run','cross_join','Sequelize','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','preview','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MIN(%s)','ROUND(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','foreignKey','format','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dba26,_0x32927e){var _0x1ad78c=function(_0x1fe9e5){while(--_0x1fe9e5){_0x3dba26['push'](_0x3dba26['shift']());}};_0x1ad78c(++_0x32927e);}(_0xdd73,0x156));var _0x3dd7=function(_0x9571f9,_0x5a7460){_0x9571f9=_0x9571f9-0x0;var _0x5cd19b=_0xdd73[_0x9571f9];return _0x5cd19b;};'use strict';var emlformat=require(_0x3dd7('0x0'));var rimraf=require(_0x3dd7('0x1'));var zipdir=require(_0x3dd7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3dd7('0x3'));var BPromise=require(_0x3dd7('0x4'));var Mustache=require(_0x3dd7('0x5'));var util=require(_0x3dd7('0x6'));var path=require(_0x3dd7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3dd7('0x8'));var fs=require('fs');var fs_extra=require(_0x3dd7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dd7('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3dd7('0xb'));var querystring=require(_0x3dd7('0xc'));var Papa=require(_0x3dd7('0xd'));var Redis=require('ioredis');var authService=require(_0x3dd7('0xe'));var qs=require(_0x3dd7('0xf'));var as=require(_0x3dd7('0x10'));var hardwareService=require(_0x3dd7('0x11'));var logger=require(_0x3dd7('0x12'))(_0x3dd7('0x13'));var utils=require(_0x3dd7('0x14'));var config=require(_0x3dd7('0x15'));var licenseUtil=require(_0x3dd7('0x16'));var db=require(_0x3dd7('0x17'))['db'];var dbH=require('../../mysqldb')[_0x3dd7('0x18')];function respondWithStatusCode(_0x21acfc,_0x1c2586){_0x1c2586=_0x1c2586||0xcc;return function(_0x4dff40){if(_0x4dff40){return _0x21acfc[_0x3dd7('0x19')](_0x1c2586);}return _0x21acfc[_0x3dd7('0x1a')](_0x1c2586)[_0x3dd7('0x1b')]();};}function respondWithResult(_0x5dbc24,_0x1397aa){_0x1397aa=_0x1397aa||0xc8;return function(_0x4421fa){if(_0x4421fa){return _0x5dbc24['status'](_0x1397aa)['json'](_0x4421fa);}};}function respondWithFilteredResult(_0x586a3,_0x5cb42c){return function(_0x34f265){if(_0x34f265){var _0x345e24=typeof _0x5cb42c[_0x3dd7('0x1c')]===_0x3dd7('0x1d')&&typeof _0x5cb42c[_0x3dd7('0x1e')]==='undefined';var _0xaa09cd=_0x34f265[_0x3dd7('0x1f')];var _0x275bd1=_0x345e24?0x0:_0x5cb42c[_0x3dd7('0x1c')];var _0x258236=_0x345e24?_0x34f265[_0x3dd7('0x1f')]:_0x5cb42c[_0x3dd7('0x1c')]+_0x5cb42c[_0x3dd7('0x1e')];var _0x3d7a64;if(_0x258236>=_0xaa09cd){_0x258236=_0xaa09cd;_0x3d7a64=0xc8;}else{_0x3d7a64=0xce;}_0x586a3['status'](_0x3d7a64);return _0x586a3[_0x3dd7('0x20')](_0x3dd7('0x21'),_0x275bd1+'-'+_0x258236+'/'+_0xaa09cd)['json'](_0x34f265);}return null;};}function patchUpdates(_0xa23a78){return function(_0x5cbd1d){try{jsonpatch[_0x3dd7('0x22')](_0x5cbd1d,_0xa23a78,!![]);}catch(_0x4247dd){return BPromise['reject'](_0x4247dd);}return _0x5cbd1d[_0x3dd7('0x23')]();};}function saveUpdates(_0x44682b,_0x4d0e1a){return function(_0x48b6a9){if(_0x48b6a9){return _0x48b6a9[_0x3dd7('0x24')](_0x44682b)[_0x3dd7('0x25')](function(_0x5bc765){return _0x5bc765;});}return null;};}function removeEntity(_0x1f72f9,_0x20530a){return function(_0x1b822b){if(_0x1b822b){return _0x1b822b['destroy']()['then'](function(){var _0x4b675d=_0x1b822b[_0x3dd7('0x26')]({'plain':!![]});var _0x5eab9b=_0x3dd7('0x27');return db[_0x3dd7('0x28')][_0x3dd7('0x29')]({'where':{'type':_0x5eab9b,'resourceId':_0x4b675d['id']}})[_0x3dd7('0x25')](function(){return _0x1b822b;});})[_0x3dd7('0x25')](function(){_0x1f72f9[_0x3dd7('0x1a')](0xcc)[_0x3dd7('0x1b')]();});}};}function handleEntityNotFound(_0x302adb,_0x2342d1){return function(_0x402b38){if(!_0x402b38){_0x302adb[_0x3dd7('0x19')](0x194);}return _0x402b38;};}function handleError(_0x553848,_0x599ef5){_0x599ef5=_0x599ef5||0x1f4;return function(_0x356a11){logger[_0x3dd7('0x2a')](_0x356a11[_0x3dd7('0x2b')]);if(_0x356a11[_0x3dd7('0x2c')]){delete _0x356a11[_0x3dd7('0x2c')];}_0x553848[_0x3dd7('0x1a')](_0x599ef5)[_0x3dd7('0x2d')](_0x356a11);};}exports[_0x3dd7('0x2e')]=function(_0x236b89,_0x659681){var _0xb41b98={},_0x5ef5a4={},_0x1aaacc={'count':0x0,'rows':[]};var _0x4745b2=_[_0x3dd7('0x2f')](db[_0x3dd7('0x30')][_0x3dd7('0x31')],function(_0x40717e){return{'name':_0x40717e['fieldName'],'type':_0x40717e['type'][_0x3dd7('0x32')]};});_0x5ef5a4[_0x3dd7('0x33')]=_[_0x3dd7('0x2f')](_0x4745b2,_0x3dd7('0x2c'));_0x5ef5a4[_0x3dd7('0x34')]=_[_0x3dd7('0x35')](_0x236b89[_0x3dd7('0x34')]);_0x5ef5a4['filters']=_[_0x3dd7('0x36')](_0x5ef5a4[_0x3dd7('0x33')],_0x5ef5a4[_0x3dd7('0x34')]);_0xb41b98[_0x3dd7('0x37')]=_[_0x3dd7('0x36')](_0x5ef5a4[_0x3dd7('0x33')],qs['fields'](_0x236b89['query'][_0x3dd7('0x38')]));_0xb41b98[_0x3dd7('0x37')]=_0xb41b98[_0x3dd7('0x37')][_0x3dd7('0x39')]?_0xb41b98[_0x3dd7('0x37')]:_0x5ef5a4[_0x3dd7('0x33')];if(!_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x3a')](_0x3dd7('0x3b'))){_0xb41b98['limit']=qs[_0x3dd7('0x1e')](_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x1e')]);_0xb41b98[_0x3dd7('0x1c')]=qs[_0x3dd7('0x1c')](_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x1c')]);}_0xb41b98[_0x3dd7('0x3c')]=qs[_0x3dd7('0x3d')](_0x236b89[_0x3dd7('0x34')]['sort']);_0xb41b98[_0x3dd7('0x3e')]=qs[_0x3dd7('0x3f')](_[_0x3dd7('0x40')](_0x236b89[_0x3dd7('0x34')],_0x5ef5a4[_0x3dd7('0x3f')]),_0x4745b2);if(_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x41')]){_0xb41b98['where']=_[_0x3dd7('0x42')](_0xb41b98[_0x3dd7('0x3e')],{'$or':_[_0x3dd7('0x2f')](_0x4745b2,function(_0x210076){if(_0x210076[_0x3dd7('0x43')]!==_0x3dd7('0x44')){var _0xa9eae1={};_0xa9eae1[_0x210076[_0x3dd7('0x2c')]]={'$like':'%'+_0x236b89[_0x3dd7('0x34')][_0x3dd7('0x41')]+'%'};return _0xa9eae1;}})});}_0xb41b98=_[_0x3dd7('0x42')]({},_0xb41b98,_0x236b89['options']);var _0x59f0fe={'where':_0xb41b98[_0x3dd7('0x3e')]};return db[_0x3dd7('0x30')][_0x3dd7('0x1f')](_0x59f0fe)['then'](function(_0x3b7c6c){_0x1aaacc[_0x3dd7('0x1f')]=_0x3b7c6c;if(_0x236b89['query'][_0x3dd7('0x45')]){_0xb41b98['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3dd7('0x46')](_0xb41b98);})['then'](function(_0x1922b8){_0x1aaacc[_0x3dd7('0x47')]=_0x1922b8;return _0x1aaacc;})[_0x3dd7('0x25')](respondWithFilteredResult(_0x659681,_0xb41b98))[_0x3dd7('0x48')](handleError(_0x659681,null));};exports[_0x3dd7('0x49')]=function(_0x512385,_0x212017){var _0x174cca={'raw':![],'where':{'id':_0x512385[_0x3dd7('0x4a')]['id']}},_0x11db02={};_0x11db02['model']=_[_0x3dd7('0x35')](db[_0x3dd7('0x30')][_0x3dd7('0x31')]);_0x11db02[_0x3dd7('0x34')]=_['keys'](_0x512385[_0x3dd7('0x34')]);_0x11db02[_0x3dd7('0x3f')]=_[_0x3dd7('0x36')](_0x11db02[_0x3dd7('0x33')],_0x11db02[_0x3dd7('0x34')]);_0x174cca['attributes']=_[_0x3dd7('0x36')](_0x11db02[_0x3dd7('0x33')],qs[_0x3dd7('0x38')](_0x512385[_0x3dd7('0x34')][_0x3dd7('0x38')]));_0x174cca['attributes']=_0x174cca[_0x3dd7('0x37')]['length']?_0x174cca['attributes']:_0x11db02[_0x3dd7('0x33')];if(_0x512385[_0x3dd7('0x34')][_0x3dd7('0x45')]){_0x174cca[_0x3dd7('0x4b')]=[{'all':!![]}];}_0x174cca=_[_0x3dd7('0x42')]({},_0x174cca,_0x512385[_0x3dd7('0x4c')]);return db['AnalyticCustomReport'][_0x3dd7('0x4d')](_0x174cca)[_0x3dd7('0x25')](handleEntityNotFound(_0x212017,null))[_0x3dd7('0x25')](respondWithResult(_0x212017,null))[_0x3dd7('0x48')](handleError(_0x212017,null));};exports['create']=function(_0x202768,_0x2cfa9e){return db[_0x3dd7('0x30')][_0x3dd7('0x4e')](_0x202768[_0x3dd7('0x4f')],{})[_0x3dd7('0x25')](function(_0x2b0e06){var _0x3eb418=_0x202768[_0x3dd7('0x50')][_0x3dd7('0x26')]({'plain':!![]});if(!_0x3eb418)throw new Error(_0x3dd7('0x51'));if(_0x3eb418[_0x3dd7('0x52')]===_0x3dd7('0x50')){var _0x3bace7=_0x2b0e06[_0x3dd7('0x26')]({'plain':!![]});var _0x12302e=_0x3dd7('0x53');return db[_0x3dd7('0x54')][_0x3dd7('0x4d')]({'where':{'name':_0x12302e,'userProfileId':_0x3eb418['userProfileId']},'raw':!![]})['then'](function(_0x25abf7){if(_0x25abf7&&_0x25abf7[_0x3dd7('0x55')]===0x0){return db['UserProfileResource'][_0x3dd7('0x4e')]({'name':_0x3bace7[_0x3dd7('0x2c')],'resourceId':_0x3bace7['id'],'type':_0x3dd7('0x27'),'sectionId':_0x25abf7['id']},{})['then'](function(){return _0x2b0e06;});}else{return _0x2b0e06;}})[_0x3dd7('0x48')](function(_0xc51c6f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc51c6f);throw _0xc51c6f;});}return _0x2b0e06;})[_0x3dd7('0x25')](respondWithResult(_0x2cfa9e,0xc9))[_0x3dd7('0x48')](handleError(_0x2cfa9e,null));};exports[_0x3dd7('0x24')]=function(_0x163be2,_0x37e0fe){if(_0x163be2['body']['id']){delete _0x163be2[_0x3dd7('0x4f')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x163be2[_0x3dd7('0x4a')]['id']}})[_0x3dd7('0x25')](handleEntityNotFound(_0x37e0fe,null))['then'](saveUpdates(_0x163be2[_0x3dd7('0x4f')],null))[_0x3dd7('0x25')](respondWithResult(_0x37e0fe,null))[_0x3dd7('0x48')](handleError(_0x37e0fe,null));};exports['destroy']=function(_0x1ac726,_0xfc940){return db[_0x3dd7('0x30')]['find']({'where':{'id':_0x1ac726[_0x3dd7('0x4a')]['id']}})[_0x3dd7('0x25')](handleEntityNotFound(_0xfc940,null))[_0x3dd7('0x25')](removeEntity(_0xfc940,null))[_0x3dd7('0x48')](handleError(_0xfc940,null));};exports[_0x3dd7('0x56')]=function(_0x255448,_0x3cd7bc){var _0x52fa58=0xa;var _0x28f017=['join',_0x3dd7('0x57'),'right_join','cross_join'];var _0x302e94={'SUM':_0x3dd7('0x58'),'COUNT':_0x3dd7('0x59'),'COUNT DISTINCT':_0x3dd7('0x5a'),'MAX':_0x3dd7('0x5b'),'MIN':'MIN(%s)','AVG':_0x3dd7('0x5c'),'GROUP_CONCAT':_0x3dd7('0x5d'),'GROUP_CONCAT ASC':_0x3dd7('0x5e'),'GROUP_CONCAT DESC':_0x3dd7('0x5f')};var _0x3cc273={'SEC_TO_TIME':_0x3dd7('0x60'),'DATE':'DATE(%s)','HOUR':_0x3dd7('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3dd7('0x62')};var _0x30d44d=function(_0x10e80c){return!_[_0x3dd7('0x63')]([_0x3dd7('0x64'),_0x3dd7('0x65'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x10e80c);};var _0x6c940d=function(_0x4255d5){if(!_0x4255d5||!_0x4255d5['rules'][_0x3dd7('0x39')]){return'';}for(var _0x1d4f6b='(',_0x72ffff=0x0;_0x72ffff<_0x4255d5[_0x3dd7('0x66')][_0x3dd7('0x39')];_0x72ffff+=0x1){_0x72ffff>0x0&&(_0x1d4f6b+='\x20'+_0x4255d5[_0x3dd7('0x67')]+'\x20');_0x1d4f6b+=_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x68')]?_0x6c940d(_0x4255d5[_0x3dd7('0x66')][_0x72ffff]['group']):_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x69')]+'\x20'+_0x4255d5[_0x3dd7('0x66')][_0x72ffff]['condition']+(_0x30d44d(_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x6a')])?'\x20'+_0x4255d5[_0x3dd7('0x66')][_0x72ffff][_0x3dd7('0x6b')]:'');}return _0x1d4f6b+')';};var _0x1fc654={'where':{'id':_0x255448['params']['id']}},_0x35cd83,_0x56e578,_0xe8ba3d,_0x39afd7,_0x3e635d;_0x1fc654=_['merge']({},_0x1fc654,_0x255448[_0x3dd7('0x4c')]);return db[_0x3dd7('0x30')][_0x3dd7('0x4d')](_0x1fc654)[_0x3dd7('0x25')](function(_0x1cd570){if(_0x1cd570){_0x35cd83=_0x1cd570;return _0x1cd570[_0x3dd7('0x6c')]();}return null;})[_0x3dd7('0x25')](function(_0x319886){if(_0x319886){if(!_0x319886[_0x3dd7('0x39')]){throw new db['Sequelize'][(_0x3dd7('0x6d'))](_0x3dd7('0x6e'),0x193);}_0x56e578=_0x319886;return db[_0x3dd7('0x6f')][_0x3dd7('0x46')]({'raw':!![]});}return null;})[_0x3dd7('0x25')](function(_0x3d3c0a){if(_0x3d3c0a){_0xe8ba3d=_[_0x3dd7('0x70')](_0x3d3c0a,'id');var _0xbec089;var _0x2fad32=squel[_0x3dd7('0x71')]();_0x2fad32[_0x3dd7('0x72')](_0x35cd83[_0x3dd7('0x73')]);for(var _0x45b605=0x0;_0x45b605<_0x56e578[_0x3dd7('0x39')];_0x45b605+=0x1){_0xbec089=_0x56e578[_0x45b605][_0x3dd7('0x74')]?_0xe8ba3d[_0x56e578[_0x45b605]['MetricId']][_0x3dd7('0x75')]:_0x56e578[_0x45b605]['field'];_0xbec089=_0x56e578[_0x45b605][_0x3dd7('0x76')]?_[_0x3dd7('0x77')](_0x302e94[_0x56e578[_0x45b605]['function']],'%s',_0xbec089):_0xbec089;_0xbec089=_0x56e578[_0x45b605]['format']?_[_0x3dd7('0x77')](_0x3cc273[_0x56e578[_0x45b605]['format']],'%s',_0xbec089):_0xbec089;if(_0x56e578[_0x45b605][_0x3dd7('0x78')]){_0x2fad32[_0x3dd7('0x68')](_0xbec089);}_0x56e578[_0x45b605][_0x3dd7('0x79')]&&_0x2fad32[_0x3dd7('0x3c')](_0xbec089,_0x56e578[_0x45b605][_0x3dd7('0x79')]===_0x3dd7('0x7a')?![]:!![]);_0x2fad32[_0x3dd7('0x69')](_0xbec089,_0x56e578[_0x45b605][_0x3dd7('0x7b')]||_0xbec089);}if(_0x35cd83[_0x3dd7('0x7c')]){_0x35cd83[_0x3dd7('0x7c')]=JSON['parse'](_0x35cd83[_0x3dd7('0x7c')]);for(var _0x4b214d=0x0;_0x4b214d<_0x35cd83[_0x3dd7('0x7c')]['length'];_0x4b214d+=0x1){if(_0x35cd83[_0x3dd7('0x7c')][_0x4b214d][_0x3dd7('0x43')]&&_[_0x3dd7('0x63')](_0x28f017,_0x35cd83['joins'][_0x4b214d][_0x3dd7('0x43')])&&_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['parentKey']&&_0x35cd83['joins'][_0x4b214d]['foreignTable']&&_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['foreignKey']){_0x2fad32[_0x35cd83[_0x3dd7('0x7c')][_0x4b214d][_0x3dd7('0x43')]](_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x35cd83[_0x3dd7('0x73')],_0x35cd83['joins'][_0x4b214d][_0x3dd7('0x7d')],_0x35cd83[_0x3dd7('0x7c')][_0x4b214d][_0x3dd7('0x7e')],_0x35cd83[_0x3dd7('0x7c')][_0x4b214d]['foreignKey']));}}}if(_0x35cd83[_0x3dd7('0x7f')]){_0x35cd83['conditions']=JSON[_0x3dd7('0x80')](_0x35cd83[_0x3dd7('0x7f')]);_0x2fad32['where'](_0x6c940d(_0x35cd83['conditions'][_0x3dd7('0x68')]));}_0x3e635d=_0x2fad32[_0x3dd7('0x81')]();_0x2fad32[_0x3dd7('0x1e')](_0x52fa58);_0x2fad32[_0x3dd7('0x1c')](0x0);logger[_0x3dd7('0x82')](_0x3dd7('0x83'),_0x2fad32[_0x3dd7('0x84')]());return dbH[_0x3dd7('0x85')][_0x3dd7('0x34')](_0x2fad32[_0x3dd7('0x84')](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]});}})['then'](respondWithResult(_0x3cd7bc,null))['catch'](handleError(_0x3cd7bc,null));};function runReport(_0x5867b2,_0x512a73,_0x7aab8c){var _0x3da8ef=_0x512a73[_0x3dd7('0x2c')];var _0x4b2210=0xa;var _0x3e37c2=[_0x3dd7('0x88'),'left_join','right_join','cross_join'];var _0x3a867a={'SUM':'SUM(%s)','COUNT':_0x3dd7('0x59'),'COUNT DISTINCT':_0x3dd7('0x5a'),'MAX':_0x3dd7('0x5b'),'MIN':_0x3dd7('0x89'),'AVG':_0x3dd7('0x5c'),'GROUP_CONCAT':_0x3dd7('0x5d'),'GROUP_CONCAT ASC':_0x3dd7('0x5e'),'GROUP_CONCAT DESC':_0x3dd7('0x5f')};var _0x2d3c9e={'SEC_TO_TIME':_0x3dd7('0x60'),'DATE':'DATE(%s)','HOUR':_0x3dd7('0x61'),'ROUND':_0x3dd7('0x8a'),'UNIX_TIMESTAMP':_0x3dd7('0x62')};var _0x212cc9=function(_0xadf7c7){return!_[_0x3dd7('0x63')](['IS\x20NULL',_0x3dd7('0x65'),_0x3dd7('0x8b'),_0x3dd7('0x8c')],_0xadf7c7);};var _0x22ae12=function(_0x5521d0){if(!_0x5521d0||!_0x5521d0[_0x3dd7('0x66')]['length']){return'';}for(var _0x5028ec='(',_0x432293=0x0;_0x432293<_0x5521d0[_0x3dd7('0x66')]['length'];_0x432293+=0x1){_0x432293>0x0&&(_0x5028ec+='\x20'+_0x5521d0[_0x3dd7('0x67')]+'\x20');_0x5028ec+=_0x5521d0['rules'][_0x432293][_0x3dd7('0x68')]?_0x22ae12(_0x5521d0['rules'][_0x432293][_0x3dd7('0x68')]):_0x5521d0[_0x3dd7('0x66')][_0x432293]['field']+'\x20'+_0x5521d0['rules'][_0x432293][_0x3dd7('0x6a')]+(_0x212cc9(_0x5521d0[_0x3dd7('0x66')][_0x432293][_0x3dd7('0x6a')])?'\x20'+_0x5521d0[_0x3dd7('0x66')][_0x432293][_0x3dd7('0x6b')]:'');}return _0x5028ec+')';};var _0x31a9b7={'where':{'id':_0x5867b2['id']}},_0x95f6f0,_0x392990,_0x48dfa1,_0x5dbabd,_0x1deea7;_0x31a9b7=_[_0x3dd7('0x42')]({},_0x31a9b7,_0x7aab8c);return db['AnalyticCustomReport'][_0x3dd7('0x4d')](_0x31a9b7)['then'](function(_0x45def3){if(_0x45def3){_0x95f6f0=_0x45def3;return _0x45def3[_0x3dd7('0x6c')]();}return null;})['then'](function(_0x29646f){if(_0x29646f){if(!_0x29646f[_0x3dd7('0x39')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x392990=_0x29646f;return db[_0x3dd7('0x6f')][_0x3dd7('0x46')]({'raw':!![]});}return null;})[_0x3dd7('0x25')](function(_0x3f04ca){if(_0x3f04ca){_0x48dfa1=_[_0x3dd7('0x70')](_0x3f04ca,'id');var _0x3e156f;var _0x466eb1=squel[_0x3dd7('0x71')]();_0x466eb1['from'](_0x95f6f0[_0x3dd7('0x73')]);for(var _0x2e99b9=0x0;_0x2e99b9<_0x392990[_0x3dd7('0x39')];_0x2e99b9+=0x1){_0x3e156f=_0x392990[_0x2e99b9]['MetricId']?_0x48dfa1[_0x392990[_0x2e99b9]['MetricId']][_0x3dd7('0x75')]:_0x392990[_0x2e99b9][_0x3dd7('0x69')];_0x3e156f=_0x392990[_0x2e99b9][_0x3dd7('0x76')]?_[_0x3dd7('0x77')](_0x3a867a[_0x392990[_0x2e99b9][_0x3dd7('0x76')]],'%s',_0x3e156f):_0x3e156f;_0x3e156f=_0x392990[_0x2e99b9]['format']?_[_0x3dd7('0x77')](_0x2d3c9e[_0x392990[_0x2e99b9]['format']],'%s',_0x3e156f):_0x3e156f;if(_0x392990[_0x2e99b9][_0x3dd7('0x78')]){_0x466eb1[_0x3dd7('0x68')](_0x3e156f);}_0x392990[_0x2e99b9]['orderBy']&&_0x466eb1[_0x3dd7('0x3c')](_0x3e156f,_0x392990[_0x2e99b9]['orderBy']==='DESC'?![]:!![]);_0x466eb1[_0x3dd7('0x69')](_0x3e156f,_0x392990[_0x2e99b9][_0x3dd7('0x7b')]||_0x3e156f);}if(_0x95f6f0[_0x3dd7('0x7c')]){_0x95f6f0[_0x3dd7('0x7c')]=JSON['parse'](_0x95f6f0['joins']);for(var _0x3787b8=0x0;_0x3787b8<_0x95f6f0[_0x3dd7('0x7c')][_0x3dd7('0x39')];_0x3787b8+=0x1){if(_0x95f6f0['joins'][_0x3787b8][_0x3dd7('0x43')]&&_[_0x3dd7('0x63')](_0x3e37c2,_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x43')])&&_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x7d')]&&_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x7e')]&&_0x95f6f0['joins'][_0x3787b8][_0x3dd7('0x8d')]){_0x466eb1[_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x43')]](_0x95f6f0['joins'][_0x3787b8][_0x3dd7('0x7e')],null,util[_0x3dd7('0x8e')](_0x3dd7('0x8f'),_0x95f6f0[_0x3dd7('0x73')],_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x7d')],_0x95f6f0['joins'][_0x3787b8]['foreignTable'],_0x95f6f0[_0x3dd7('0x7c')][_0x3787b8][_0x3dd7('0x8d')]));}}}if(_0x95f6f0[_0x3dd7('0x7f')]){_0x95f6f0['conditions']=JSON[_0x3dd7('0x80')](_0x95f6f0[_0x3dd7('0x7f')]);_0x466eb1['where'](_0x22ae12(_0x95f6f0['conditions'][_0x3dd7('0x68')]));}_0x1deea7=_0x466eb1[_0x3dd7('0x81')]();_0x466eb1[_0x3dd7('0x1e')](_0x4b2210);_0x466eb1['offset'](0x0);return;}})[_0x3dd7('0x25')](function(){if(_0x512a73[_0x3dd7('0x90')]===_0x3dd7('0x91')){return null;}var _0x1afaa5=_[_0x3dd7('0x42')](_0x512a73,{'name':_0x512a73[_0x3dd7('0x92')]||_0x512a73[_0x3dd7('0x2c')]||_0x95f6f0[_0x3dd7('0x2c')],'basename':_0x3da8ef,'savename':util[_0x3dd7('0x8e')](_0x3dd7('0x93'),_0x512a73[_0x3dd7('0x2c')]||_0x95f6f0[_0x3dd7('0x2c')],require(_0x3dd7('0x94'))[_0x3dd7('0x95')](0x4),_0x512a73[_0x3dd7('0x90')]||_0x3dd7('0x96')),'reportId':_0x95f6f0['id'],'reportType':_0x3dd7('0x97')});return db[_0x3dd7('0x98')][_0x3dd7('0x4e')](_0x1afaa5,{'raw':!![]});})[_0x3dd7('0x25')](function(_0x35345e){if(_0x95f6f0['table']===_0x3dd7('0x99')){_0x1deea7[_0x3dd7('0x3e')](_0x95f6f0[_0x3dd7('0x73')]+_0x3dd7('0x9a'),_0x512a73['startDate'],_0x512a73[_0x3dd7('0x9b')]);}else{_0x1deea7[_0x3dd7('0x3e')](_0x95f6f0['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x512a73[_0x3dd7('0x9c')],_0x512a73[_0x3dd7('0x9b')]);}if(_0x35345e){logger['info'](_0x3dd7('0x9d'),_0x1deea7[_0x3dd7('0x84')]());require(_0x3dd7('0x9e'))['fork'](path[_0x3dd7('0x88')](__dirname,'../../components/export/',_0x35345e[_0x3dd7('0x90')]),[_0x35345e['id'],_0x1deea7[_0x3dd7('0x84')](),path['join'](__dirname,_0x3dd7('0x9f'),_0x35345e[_0x3dd7('0xa0')]),_0x3da8ef]);return _0x35345e;}else{var _0x2ec6f9=squel[_0x3dd7('0x71')]();_0x2ec6f9[_0x3dd7('0x72')]('('+_0x1deea7[_0x3dd7('0x84')]()+')',_0x3dd7('0xa1'));_0x2ec6f9[_0x3dd7('0x69')](_0x3dd7('0xa2'),_0x3dd7('0x1f'));_0x1deea7['limit'](_0x512a73[_0x3dd7('0x1e')]||_0x4b2210);_0x1deea7[_0x3dd7('0x1c')](_0x512a73[_0x3dd7('0x1c')]||0x0);return dbH[_0x3dd7('0x85')][_0x3dd7('0x34')](_0x2ec6f9[_0x3dd7('0x84')](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]})[_0x3dd7('0x25')](function(_0x392ef1){if(!_0x392ef1[_0x3dd7('0x39')]){_0x5dbabd=0x0;}else{_0x5dbabd=_0x392ef1[0x0]['count']||0x0;}return dbH[_0x3dd7('0x85')][_0x3dd7('0x34')](_0x1deea7['toString'](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]});})[_0x3dd7('0x25')](function(_0x183e57){return{'rows':_0x183e57||[],'count':_0x5dbabd};});}});}exports[_0x3dd7('0xa3')]=function(_0x2be557,_0x29ba6f){return runReport(_0x2be557[_0x3dd7('0x4a')],_0x2be557[_0x3dd7('0x34')],_0x2be557[_0x3dd7('0x4c')])[_0x3dd7('0x25')](respondWithResult(_0x29ba6f,null))[_0x3dd7('0x48')](handleError(_0x29ba6f,null));};exports['runReport']=runReport;exports['query']=function(_0x10c8e7,_0x3cf25e){var _0xa2732f=0xa;var _0x59acd7=[_0x3dd7('0x88'),'left_join','right_join',_0x3dd7('0xa4')];var _0x36d9da={'SUM':_0x3dd7('0x58'),'COUNT':_0x3dd7('0x59'),'COUNT DISTINCT':_0x3dd7('0x5a'),'MAX':_0x3dd7('0x5b'),'MIN':_0x3dd7('0x89'),'AVG':_0x3dd7('0x5c'),'GROUP_CONCAT':_0x3dd7('0x5d'),'GROUP_CONCAT ASC':_0x3dd7('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x24f69d={'SEC_TO_TIME':_0x3dd7('0x60'),'DATE':'DATE(%s)','HOUR':_0x3dd7('0x61'),'ROUND':_0x3dd7('0x8a'),'UNIX_TIMESTAMP':_0x3dd7('0x62')};var _0x550432=function(_0x251466){return!_[_0x3dd7('0x63')](['IS\x20NULL',_0x3dd7('0x65'),_0x3dd7('0x8b'),_0x3dd7('0x8c')],_0x251466);};var _0x9b93e7=function(_0x26528c){if(!_0x26528c||!_0x26528c[_0x3dd7('0x66')][_0x3dd7('0x39')]){return'';}for(var _0x39eacd='(',_0x2bef10=0x0;_0x2bef10<_0x26528c[_0x3dd7('0x66')]['length'];_0x2bef10+=0x1){_0x2bef10>0x0&&(_0x39eacd+='\x20'+_0x26528c['operator']+'\x20');_0x39eacd+=_0x26528c['rules'][_0x2bef10][_0x3dd7('0x68')]?_0x9b93e7(_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x68')]):_0x26528c['rules'][_0x2bef10][_0x3dd7('0x69')]+'\x20'+_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x6a')]+(_0x550432(_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x6a')])?'\x20'+_0x26528c[_0x3dd7('0x66')][_0x2bef10][_0x3dd7('0x6b')]:'');}return _0x39eacd+')';};var _0x2d116a={'where':{'id':_0x10c8e7['params']['id']}},_0x2aea66,_0x579318,_0x1207ca,_0x3236f9,_0x372e4d;_0x2d116a=_[_0x3dd7('0x42')]({},_0x2d116a,_0x10c8e7[_0x3dd7('0x4c')]);return db['AnalyticCustomReport'][_0x3dd7('0x4d')](_0x2d116a)[_0x3dd7('0x25')](function(_0x44b3b7){if(_0x44b3b7){_0x2aea66=_0x44b3b7;return _0x44b3b7[_0x3dd7('0x6c')]();}return null;})['then'](function(_0x5ce1d7){if(_0x5ce1d7){if(!_0x5ce1d7['length']){throw new db[(_0x3dd7('0xa5'))][(_0x3dd7('0x6d'))](_0x3dd7('0x6e'),0x193);}_0x579318=_0x5ce1d7;return db[_0x3dd7('0x6f')][_0x3dd7('0x46')]({'raw':!![]});}return null;})['then'](function(_0xa92e3c){if(_0xa92e3c){_0x1207ca=_[_0x3dd7('0x70')](_0xa92e3c,'id');var _0x3bd821;var _0x3a3758=squel[_0x3dd7('0x71')]();_0x3a3758['from'](_0x2aea66['table']);for(var _0x292649=0x0;_0x292649<_0x579318['length'];_0x292649+=0x1){_0x3bd821=_0x579318[_0x292649][_0x3dd7('0x74')]?_0x1207ca[_0x579318[_0x292649][_0x3dd7('0x74')]]['metric']:_0x579318[_0x292649][_0x3dd7('0x69')];_0x3bd821=_0x579318[_0x292649][_0x3dd7('0x76')]?_[_0x3dd7('0x77')](_0x36d9da[_0x579318[_0x292649][_0x3dd7('0x76')]],'%s',_0x3bd821):_0x3bd821;_0x3bd821=_0x579318[_0x292649][_0x3dd7('0x8e')]?_['replace'](_0x24f69d[_0x579318[_0x292649][_0x3dd7('0x8e')]],'%s',_0x3bd821):_0x3bd821;if(_0x579318[_0x292649]['groupBy']){_0x3a3758[_0x3dd7('0x68')](_0x3bd821);}_0x579318[_0x292649][_0x3dd7('0x79')]&&_0x3a3758[_0x3dd7('0x3c')](_0x3bd821,_0x579318[_0x292649][_0x3dd7('0x79')]===_0x3dd7('0x7a')?![]:!![]);_0x3a3758[_0x3dd7('0x69')](_0x3bd821,_0x579318[_0x292649][_0x3dd7('0x7b')]||_0x3bd821);}if(_0x2aea66[_0x3dd7('0x7c')]){_0x2aea66[_0x3dd7('0x7c')]=JSON[_0x3dd7('0x80')](_0x2aea66[_0x3dd7('0x7c')]);for(var _0x311e9e=0x0;_0x311e9e<_0x2aea66[_0x3dd7('0x7c')][_0x3dd7('0x39')];_0x311e9e+=0x1){if(_0x2aea66['joins'][_0x311e9e][_0x3dd7('0x43')]&&_['includes'](_0x59acd7,_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x43')])&&_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x7d')]&&_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x7e')]&&_0x2aea66['joins'][_0x311e9e][_0x3dd7('0x8d')]){_0x3a3758[_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x43')]](_0x2aea66[_0x3dd7('0x7c')][_0x311e9e]['foreignTable'],null,util[_0x3dd7('0x8e')](_0x3dd7('0x8f'),_0x2aea66[_0x3dd7('0x73')],_0x2aea66['joins'][_0x311e9e][_0x3dd7('0x7d')],_0x2aea66[_0x3dd7('0x7c')][_0x311e9e][_0x3dd7('0x7e')],_0x2aea66[_0x3dd7('0x7c')][_0x311e9e]['foreignKey']));}}}if(_0x2aea66[_0x3dd7('0x7f')]){_0x2aea66[_0x3dd7('0x7f')]=JSON['parse'](_0x2aea66[_0x3dd7('0x7f')]);_0x3a3758[_0x3dd7('0x3e')](_0x9b93e7(_0x2aea66[_0x3dd7('0x7f')]['group']));}_0x372e4d=_0x3a3758[_0x3dd7('0x81')]();_0x3a3758[_0x3dd7('0x1e')](_0xa2732f);_0x3a3758[_0x3dd7('0x1c')](0x0);logger[_0x3dd7('0x82')](_0x3dd7('0x83'),_0x3a3758['toString']());return dbH[_0x3dd7('0x85')]['query'](_0x3a3758[_0x3dd7('0x84')](),{'type':dbH[_0x3dd7('0x85')][_0x3dd7('0x86')][_0x3dd7('0x87')]});}})[_0x3dd7('0x25')](function(){return{'sql':_0x372e4d[_0x3dd7('0x84')]()};})[_0x3dd7('0x25')](respondWithResult(_0x3cf25e,null))[_0x3dd7('0x48')](handleError(_0x3cf25e,null));}; \ No newline at end of file +var _0xaf2f=['then','get','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','findAll','rows','params','includeAll','include','find','catch','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','toString','SELECT','cross_join','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','AnalyticMetric','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','left_join','groupBy','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy'];(function(_0x5ad1ee,_0x49bdd2){var _0x2fcb07=function(_0x108aea){while(--_0x108aea){_0x5ad1ee['push'](_0x5ad1ee['shift']());}};_0x2fcb07(++_0x49bdd2);}(_0xaf2f,0x126));var _0xfaf2=function(_0x4b72b3,_0xb05c18){_0x4b72b3=_0x4b72b3-0x0;var _0x4bed2f=_0xaf2f[_0x4b72b3];return _0x4bed2f;};'use strict';var emlformat=require(_0xfaf2('0x0'));var rimraf=require(_0xfaf2('0x1'));var zipdir=require(_0xfaf2('0x2'));var jsonpatch=require(_0xfaf2('0x3'));var rp=require(_0xfaf2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfaf2('0x5'));var util=require('util');var path=require(_0xfaf2('0x6'));var sox=require(_0xfaf2('0x7'));var csv=require('to-csv');var ejs=require(_0xfaf2('0x8'));var fs=require('fs');var fs_extra=require(_0xfaf2('0x9'));var _=require(_0xfaf2('0xa'));var squel=require(_0xfaf2('0xb'));var crypto=require(_0xfaf2('0xc'));var jsforce=require(_0xfaf2('0xd'));var deskjs=require(_0xfaf2('0xe'));var toCsv=require(_0xfaf2('0xf'));var querystring=require(_0xfaf2('0x10'));var Papa=require(_0xfaf2('0x11'));var Redis=require(_0xfaf2('0x12'));var authService=require(_0xfaf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfaf2('0x14'));var hardwareService=require(_0xfaf2('0x15'));var logger=require('../../config/logger')(_0xfaf2('0x16'));var utils=require(_0xfaf2('0x17'));var config=require(_0xfaf2('0x18'));var licenseUtil=require(_0xfaf2('0x19'));var db=require(_0xfaf2('0x1a'))['db'];var dbH=require(_0xfaf2('0x1a'))[_0xfaf2('0x1b')];function respondWithStatusCode(_0x4cb9ef,_0x1a6acf){_0x1a6acf=_0x1a6acf||0xcc;return function(_0x532e74){if(_0x532e74){return _0x4cb9ef[_0xfaf2('0x1c')](_0x1a6acf);}return _0x4cb9ef['status'](_0x1a6acf)[_0xfaf2('0x1d')]();};}function respondWithResult(_0x5cddfc,_0x46f038){_0x46f038=_0x46f038||0xc8;return function(_0x36f083){if(_0x36f083){return _0x5cddfc[_0xfaf2('0x1e')](_0x46f038)['json'](_0x36f083);}};}function respondWithFilteredResult(_0x187a61,_0x126bfb){return function(_0x7aa8b2){if(_0x7aa8b2){var _0x32bbd8=typeof _0x126bfb[_0xfaf2('0x1f')]===_0xfaf2('0x20')&&typeof _0x126bfb[_0xfaf2('0x21')]===_0xfaf2('0x20');var _0x3b7f5e=_0x7aa8b2[_0xfaf2('0x22')];var _0x5991e9=_0x32bbd8?0x0:_0x126bfb[_0xfaf2('0x1f')];var _0x3564a0=_0x32bbd8?_0x7aa8b2['count']:_0x126bfb[_0xfaf2('0x1f')]+_0x126bfb[_0xfaf2('0x21')];var _0xda4911;if(_0x3564a0>=_0x3b7f5e){_0x3564a0=_0x3b7f5e;_0xda4911=0xc8;}else{_0xda4911=0xce;}_0x187a61[_0xfaf2('0x1e')](_0xda4911);return _0x187a61[_0xfaf2('0x23')](_0xfaf2('0x24'),_0x5991e9+'-'+_0x3564a0+'/'+_0x3b7f5e)[_0xfaf2('0x25')](_0x7aa8b2);}return null;};}function patchUpdates(_0x1f9480){return function(_0x5d4467){try{jsonpatch[_0xfaf2('0x26')](_0x5d4467,_0x1f9480,!![]);}catch(_0x14ff68){return BPromise[_0xfaf2('0x27')](_0x14ff68);}return _0x5d4467['save']();};}function saveUpdates(_0x30553c,_0x155bc1){return function(_0x3560a0){if(_0x3560a0){return _0x3560a0[_0xfaf2('0x28')](_0x30553c)['then'](function(_0x2eadcf){return _0x2eadcf;});}return null;};}function removeEntity(_0x19e933,_0x2c2370){return function(_0x1c7f27){if(_0x1c7f27){return _0x1c7f27[_0xfaf2('0x29')]()[_0xfaf2('0x2a')](function(){var _0x364b4f=_0x1c7f27[_0xfaf2('0x2b')]({'plain':!![]});var _0xbb1c0b=_0xfaf2('0x2c');return db[_0xfaf2('0x2d')][_0xfaf2('0x29')]({'where':{'type':_0xbb1c0b,'resourceId':_0x364b4f['id']}})['then'](function(){return _0x1c7f27;});})['then'](function(){_0x19e933[_0xfaf2('0x1e')](0xcc)[_0xfaf2('0x1d')]();});}};}function handleEntityNotFound(_0x548511,_0x15b711){return function(_0x5c0f08){if(!_0x5c0f08){_0x548511[_0xfaf2('0x1c')](0x194);}return _0x5c0f08;};}function handleError(_0xe3c01a,_0x26cafe){_0x26cafe=_0x26cafe||0x1f4;return function(_0x34e232){logger[_0xfaf2('0x2e')](_0x34e232[_0xfaf2('0x2f')]);if(_0x34e232[_0xfaf2('0x30')]){delete _0x34e232[_0xfaf2('0x30')];}_0xe3c01a[_0xfaf2('0x1e')](_0x26cafe)['send'](_0x34e232);};}exports[_0xfaf2('0x31')]=function(_0x1df04d,_0x2e726c){var _0x280219={},_0x4d35b5={},_0x5817b1={'count':0x0,'rows':[]};var _0x262d77=_[_0xfaf2('0x32')](db[_0xfaf2('0x33')][_0xfaf2('0x34')],function(_0x4d4553){return{'name':_0x4d4553[_0xfaf2('0x35')],'type':_0x4d4553[_0xfaf2('0x36')][_0xfaf2('0x37')]};});_0x4d35b5[_0xfaf2('0x38')]=_['map'](_0x262d77,_0xfaf2('0x30'));_0x4d35b5[_0xfaf2('0x39')]=_[_0xfaf2('0x3a')](_0x1df04d[_0xfaf2('0x39')]);_0x4d35b5['filters']=_[_0xfaf2('0x3b')](_0x4d35b5[_0xfaf2('0x38')],_0x4d35b5['query']);_0x280219[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x4d35b5['model'],qs[_0xfaf2('0x3d')](_0x1df04d[_0xfaf2('0x39')]['fields']));_0x280219[_0xfaf2('0x3c')]=_0x280219[_0xfaf2('0x3c')][_0xfaf2('0x3e')]?_0x280219[_0xfaf2('0x3c')]:_0x4d35b5['model'];if(!_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x3f')]('nolimit')){_0x280219[_0xfaf2('0x21')]=qs[_0xfaf2('0x21')](_0x1df04d['query'][_0xfaf2('0x21')]);_0x280219[_0xfaf2('0x1f')]=qs[_0xfaf2('0x1f')](_0x1df04d[_0xfaf2('0x39')]['offset']);}_0x280219[_0xfaf2('0x40')]=qs[_0xfaf2('0x41')](_0x1df04d[_0xfaf2('0x39')]['sort']);_0x280219['where']=qs[_0xfaf2('0x42')](_[_0xfaf2('0x43')](_0x1df04d[_0xfaf2('0x39')],_0x4d35b5[_0xfaf2('0x42')]),_0x262d77);if(_0x1df04d[_0xfaf2('0x39')]['filter']){_0x280219[_0xfaf2('0x44')]=_[_0xfaf2('0x45')](_0x280219[_0xfaf2('0x44')],{'$or':_[_0xfaf2('0x32')](_0x262d77,function(_0x4a860c){if(_0x4a860c['type']!=='VIRTUAL'){var _0x2b8d99={};_0x2b8d99[_0x4a860c['name']]={'$like':'%'+_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x46')]+'%'};return _0x2b8d99;}})});}_0x280219=_[_0xfaf2('0x45')]({},_0x280219,_0x1df04d[_0xfaf2('0x47')]);var _0x2af6b6={'where':_0x280219[_0xfaf2('0x44')]};return db[_0xfaf2('0x33')]['count'](_0x2af6b6)[_0xfaf2('0x2a')](function(_0x2ecf3d){_0x5817b1[_0xfaf2('0x22')]=_0x2ecf3d;if(_0x1df04d[_0xfaf2('0x39')]['includeAll']){_0x280219['include']=[{'all':!![]}];}return db[_0xfaf2('0x33')][_0xfaf2('0x48')](_0x280219);})['then'](function(_0x22284e){_0x5817b1[_0xfaf2('0x49')]=_0x22284e;return _0x5817b1;})['then'](respondWithFilteredResult(_0x2e726c,_0x280219))['catch'](handleError(_0x2e726c,null));};exports['show']=function(_0xe45a70,_0x539c3d){var _0x381bc0={'raw':![],'where':{'id':_0xe45a70[_0xfaf2('0x4a')]['id']}},_0x3d079f={};_0x3d079f[_0xfaf2('0x38')]=_[_0xfaf2('0x3a')](db[_0xfaf2('0x33')][_0xfaf2('0x34')]);_0x3d079f[_0xfaf2('0x39')]=_['keys'](_0xe45a70[_0xfaf2('0x39')]);_0x3d079f['filters']=_['intersection'](_0x3d079f[_0xfaf2('0x38')],_0x3d079f['query']);_0x381bc0[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x3d079f[_0xfaf2('0x38')],qs[_0xfaf2('0x3d')](_0xe45a70[_0xfaf2('0x39')]['fields']));_0x381bc0[_0xfaf2('0x3c')]=_0x381bc0['attributes'][_0xfaf2('0x3e')]?_0x381bc0[_0xfaf2('0x3c')]:_0x3d079f['model'];if(_0xe45a70[_0xfaf2('0x39')][_0xfaf2('0x4b')]){_0x381bc0[_0xfaf2('0x4c')]=[{'all':!![]}];}_0x381bc0=_[_0xfaf2('0x45')]({},_0x381bc0,_0xe45a70['options']);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x381bc0)[_0xfaf2('0x2a')](handleEntityNotFound(_0x539c3d,null))[_0xfaf2('0x2a')](respondWithResult(_0x539c3d,null))[_0xfaf2('0x4e')](handleError(_0x539c3d,null));};exports[_0xfaf2('0x4f')]=function(_0x3b1a95,_0x448afe){return db[_0xfaf2('0x33')][_0xfaf2('0x4f')](_0x3b1a95['body'],{})['then'](function(_0x4de5aa){var _0x559044=_0x3b1a95[_0xfaf2('0x50')]['get']({'plain':!![]});if(!_0x559044)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x559044[_0xfaf2('0x51')]===_0xfaf2('0x50')){var _0x4e2581=_0x4de5aa[_0xfaf2('0x2b')]({'plain':!![]});var _0x5a8ab4=_0xfaf2('0x52');return db[_0xfaf2('0x53')][_0xfaf2('0x4d')]({'where':{'name':_0x5a8ab4,'userProfileId':_0x559044[_0xfaf2('0x54')]},'raw':!![]})[_0xfaf2('0x2a')](function(_0x198c72){if(_0x198c72&&_0x198c72[_0xfaf2('0x55')]===0x0){return db[_0xfaf2('0x2d')][_0xfaf2('0x4f')]({'name':_0x4e2581[_0xfaf2('0x30')],'resourceId':_0x4e2581['id'],'type':'CustomReports','sectionId':_0x198c72['id']},{})['then'](function(){return _0x4de5aa;});}else{return _0x4de5aa;}})[_0xfaf2('0x4e')](function(_0x1d4d44){logger[_0xfaf2('0x2e')](_0xfaf2('0x56'),_0x1d4d44);throw _0x1d4d44;});}return _0x4de5aa;})['then'](respondWithResult(_0x448afe,0xc9))['catch'](handleError(_0x448afe,null));};exports[_0xfaf2('0x28')]=function(_0x28cf1f,_0x234e9f){if(_0x28cf1f['body']['id']){delete _0x28cf1f[_0xfaf2('0x57')]['id'];}return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x28cf1f['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x234e9f,null))[_0xfaf2('0x2a')](saveUpdates(_0x28cf1f[_0xfaf2('0x57')],null))[_0xfaf2('0x2a')](respondWithResult(_0x234e9f,null))[_0xfaf2('0x4e')](handleError(_0x234e9f,null));};exports['destroy']=function(_0x27aaf6,_0x17a331){return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x27aaf6['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x17a331,null))['then'](removeEntity(_0x17a331,null))[_0xfaf2('0x4e')](handleError(_0x17a331,null));};exports[_0xfaf2('0x58')]=function(_0x4b89d7,_0x1c2810){var _0x7e8f3f=0xa;var _0x47c0d7=[_0xfaf2('0x59'),'left_join',_0xfaf2('0x5a'),'cross_join'];var _0x30988f={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x3d3677={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':_0xfaf2('0x65')};var _0x15dec1=function(_0x43c0b9){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),_0xfaf2('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x43c0b9);};var _0x4a6b65=function(_0x298f86){if(!_0x298f86||!_0x298f86['rules'][_0xfaf2('0x3e')]){return'';}for(var _0x1ee1ae='(',_0x334ccb=0x0;_0x334ccb<_0x298f86[_0xfaf2('0x69')]['length'];_0x334ccb+=0x1){_0x334ccb>0x0&&(_0x1ee1ae+='\x20'+_0x298f86[_0xfaf2('0x6a')]+'\x20');_0x1ee1ae+=_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]?_0x4a6b65(_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]):_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6c')]+'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6d')]+(_0x15dec1(_0x298f86[_0xfaf2('0x69')][_0x334ccb]['condition'])?'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6e')]:'');}return _0x1ee1ae+')';};var _0x179c7c={'where':{'id':_0x4b89d7[_0xfaf2('0x4a')]['id']}},_0x418852,_0x53ec76,_0x55f417,_0x4781ad,_0x5c7673;_0x179c7c=_[_0xfaf2('0x45')]({},_0x179c7c,_0x4b89d7['options']);return db[_0xfaf2('0x33')]['find'](_0x179c7c)[_0xfaf2('0x2a')](function(_0x3b8e56){if(_0x3b8e56){_0x418852=_0x3b8e56;return _0x3b8e56['getFields']();}return null;})[_0xfaf2('0x2a')](function(_0x52b7c3){if(_0x52b7c3){if(!_0x52b7c3[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x53ec76=_0x52b7c3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x333305){if(_0x333305){_0x55f417=_[_0xfaf2('0x72')](_0x333305,'id');var _0x2c6013;var _0x4aec5a=squel[_0xfaf2('0x73')]();_0x4aec5a[_0xfaf2('0x74')](_0x418852[_0xfaf2('0x75')]);for(var _0x143a1f=0x0;_0x143a1f<_0x53ec76[_0xfaf2('0x3e')];_0x143a1f+=0x1){_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x76')]?_0x55f417[_0x53ec76[_0x143a1f][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x53ec76[_0x143a1f][_0xfaf2('0x6c')];_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x78')]?_[_0xfaf2('0x79')](_0x30988f[_0x53ec76[_0x143a1f]['function']],'%s',_0x2c6013):_0x2c6013;_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]?_['replace'](_0x3d3677[_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]],'%s',_0x2c6013):_0x2c6013;if(_0x53ec76[_0x143a1f]['groupBy']){_0x4aec5a[_0xfaf2('0x6b')](_0x2c6013);}_0x53ec76[_0x143a1f][_0xfaf2('0x7b')]&&_0x4aec5a[_0xfaf2('0x40')](_0x2c6013,_0x53ec76[_0x143a1f]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x4aec5a[_0xfaf2('0x6c')](_0x2c6013,_0x53ec76[_0x143a1f][_0xfaf2('0x7d')]||_0x2c6013);}if(_0x418852[_0xfaf2('0x7e')]){_0x418852[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x418852['joins']);for(var _0x2e0cec=0x0;_0x2e0cec<_0x418852[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x2e0cec+=0x1){if(_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['type']&&_[_0xfaf2('0x66')](_0x47c0d7,_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x36')])&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x80')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x81')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]){_0x4aec5a[_0x418852['joins'][_0x2e0cec][_0xfaf2('0x36')]](_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['foreignTable'],null,util[_0xfaf2('0x7a')]('%s.%s\x20=\x20%s.%s',_0x418852[_0xfaf2('0x75')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x80')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x81')],_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]));}}}if(_0x418852[_0xfaf2('0x83')]){_0x418852[_0xfaf2('0x83')]=JSON['parse'](_0x418852[_0xfaf2('0x83')]);_0x4aec5a[_0xfaf2('0x44')](_0x4a6b65(_0x418852['conditions'][_0xfaf2('0x6b')]));}_0x5c7673=_0x4aec5a[_0xfaf2('0x84')]();_0x4aec5a[_0xfaf2('0x21')](_0x7e8f3f);_0x4aec5a[_0xfaf2('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x4aec5a[_0xfaf2('0x85')]());return dbH['sequelize']['query'](_0x4aec5a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xfaf2('0x86')]});}})['then'](respondWithResult(_0x1c2810,null))[_0xfaf2('0x4e')](handleError(_0x1c2810,null));};function runReport(_0x40f693,_0x5c1dac,_0x52c1d9){var _0x370184=_0x5c1dac[_0xfaf2('0x30')];var _0x3bda03=0xa;var _0x8e5ccb=['join','left_join',_0xfaf2('0x5a'),_0xfaf2('0x87')];var _0x237198={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfaf2('0x5e'),'MIN':'MIN(%s)','AVG':_0xfaf2('0x88'),'GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x1b0f63={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24e83c=function(_0x3c6d41){return!_[_0xfaf2('0x66')](['IS\x20NULL',_0xfaf2('0x68'),_0xfaf2('0x8b'),_0xfaf2('0x8c')],_0x3c6d41);};var _0x443005=function(_0x8fb83c){if(!_0x8fb83c||!_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x305b54='(',_0x51dbed=0x0;_0x51dbed<_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x51dbed+=0x1){_0x51dbed>0x0&&(_0x305b54+='\x20'+_0x8fb83c[_0xfaf2('0x6a')]+'\x20');_0x305b54+=_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6b')]?_0x443005(_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['group']):_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6c')]+'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6d')]+(_0x24e83c(_0x8fb83c['rules'][_0x51dbed][_0xfaf2('0x6d')])?'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['value']:'');}return _0x305b54+')';};var _0x16c846={'where':{'id':_0x40f693['id']}},_0x4ba198,_0x659b1b,_0x3724a9,_0x274f5c,_0x4558c2;_0x16c846=_[_0xfaf2('0x45')]({},_0x16c846,_0x52c1d9);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x16c846)[_0xfaf2('0x2a')](function(_0x5f0c35){if(_0x5f0c35){_0x4ba198=_0x5f0c35;return _0x5f0c35[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0xa21aee){if(_0xa21aee){if(!_0xa21aee[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x659b1b=_0xa21aee;return db[_0xfaf2('0x8e')][_0xfaf2('0x48')]({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x4bbc0e){if(_0x4bbc0e){_0x3724a9=_[_0xfaf2('0x72')](_0x4bbc0e,'id');var _0x5a59af;var _0x50a4c0=squel['select']();_0x50a4c0[_0xfaf2('0x74')](_0x4ba198[_0xfaf2('0x75')]);for(var _0x2b64c3=0x0;_0x2b64c3<_0x659b1b[_0xfaf2('0x3e')];_0x2b64c3+=0x1){_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]?_0x3724a9[_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]]['metric']:_0x659b1b[_0x2b64c3]['field'];_0x5a59af=_0x659b1b[_0x2b64c3]['function']?_[_0xfaf2('0x79')](_0x237198[_0x659b1b[_0x2b64c3][_0xfaf2('0x78')]],'%s',_0x5a59af):_0x5a59af;_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x1b0f63[_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]],'%s',_0x5a59af):_0x5a59af;if(_0x659b1b[_0x2b64c3]['groupBy']){_0x50a4c0[_0xfaf2('0x6b')](_0x5a59af);}_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]&&_0x50a4c0[_0xfaf2('0x40')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]===_0xfaf2('0x7c')?![]:!![]);_0x50a4c0[_0xfaf2('0x6c')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7d')]||_0x5a59af);}if(_0x4ba198[_0xfaf2('0x7e')]){_0x4ba198[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x4ba198[_0xfaf2('0x7e')]);for(var _0x243692=0x0;_0x243692<_0x4ba198[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x243692+=0x1){if(_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]&&_[_0xfaf2('0x66')](_0x8e5ccb,_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')])&&_0x4ba198['joins'][_0x243692]['parentKey']&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')]&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]){_0x50a4c0[_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]](_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x4ba198['table'],_0x4ba198['joins'][_0x243692][_0xfaf2('0x80')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]));}}}if(_0x4ba198[_0xfaf2('0x83')]){_0x4ba198[_0xfaf2('0x83')]=JSON['parse'](_0x4ba198[_0xfaf2('0x83')]);_0x50a4c0[_0xfaf2('0x44')](_0x443005(_0x4ba198[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x4558c2=_0x50a4c0[_0xfaf2('0x84')]();_0x50a4c0['limit'](_0x3bda03);_0x50a4c0[_0xfaf2('0x1f')](0x0);return;}})[_0xfaf2('0x2a')](function(){if(_0x5c1dac[_0xfaf2('0x90')]===_0xfaf2('0x91')){return null;}var _0x9c3608=_[_0xfaf2('0x45')](_0x5c1dac,{'name':_0x5c1dac[_0xfaf2('0x92')]||_0x5c1dac[_0xfaf2('0x30')]||_0x4ba198[_0xfaf2('0x30')],'basename':_0x370184,'savename':util['format'](_0xfaf2('0x93'),_0x5c1dac['name']||_0x4ba198['name'],require(_0xfaf2('0x94'))[_0xfaf2('0x95')](0x4),_0x5c1dac[_0xfaf2('0x90')]||'csv'),'reportId':_0x4ba198['id'],'reportType':_0xfaf2('0x96')});return db[_0xfaf2('0x97')][_0xfaf2('0x4f')](_0x9c3608,{'raw':!![]});})['then'](function(_0x10b0ef){if(_0x4ba198[_0xfaf2('0x75')]==='cdr'){_0x4558c2[_0xfaf2('0x44')](_0x4ba198[_0xfaf2('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5c1dac[_0xfaf2('0x98')],_0x5c1dac[_0xfaf2('0x99')]);}else{_0x4558c2[_0xfaf2('0x44')](_0x4ba198['table']+_0xfaf2('0x9a'),_0x5c1dac['startDate'],_0x5c1dac['endDate']);}if(_0x10b0ef){logger[_0xfaf2('0x9b')]('Run\x20Query:',_0x4558c2['toString']());require(_0xfaf2('0x9c'))[_0xfaf2('0x9d')](path[_0xfaf2('0x59')](__dirname,'../../components/export/',_0x10b0ef[_0xfaf2('0x90')]),[_0x10b0ef['id'],_0x4558c2[_0xfaf2('0x85')](),path[_0xfaf2('0x59')](__dirname,_0xfaf2('0x9e'),_0x10b0ef['savename']),_0x370184]);return _0x10b0ef;}else{var _0x3fe47c=squel[_0xfaf2('0x73')]();_0x3fe47c[_0xfaf2('0x74')]('('+_0x4558c2[_0xfaf2('0x85')]()+')',_0xfaf2('0x9f'));_0x3fe47c[_0xfaf2('0x6c')](_0xfaf2('0xa0'),'count');_0x4558c2[_0xfaf2('0x21')](_0x5c1dac['limit']||_0x3bda03);_0x4558c2['offset'](_0x5c1dac[_0xfaf2('0x1f')]||0x0);return dbH[_0xfaf2('0xa1')]['query'](_0x3fe47c[_0xfaf2('0x85')](),{'type':dbH['sequelize'][_0xfaf2('0xa2')][_0xfaf2('0x86')]})[_0xfaf2('0x2a')](function(_0x29031a){if(!_0x29031a[_0xfaf2('0x3e')]){_0x274f5c=0x0;}else{_0x274f5c=_0x29031a[0x0][_0xfaf2('0x22')]||0x0;}return dbH['sequelize'][_0xfaf2('0x39')](_0x4558c2[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')][_0xfaf2('0x86')]});})[_0xfaf2('0x2a')](function(_0x453ab7){return{'rows':_0x453ab7||[],'count':_0x274f5c};});}});}exports[_0xfaf2('0xa3')]=function(_0x1d067a,_0x2a66e4){return runReport(_0x1d067a[_0xfaf2('0x4a')],_0x1d067a[_0xfaf2('0x39')],_0x1d067a[_0xfaf2('0x47')])[_0xfaf2('0x2a')](respondWithResult(_0x2a66e4,null))['catch'](handleError(_0x2a66e4,null));};exports[_0xfaf2('0xa4')]=runReport;exports[_0xfaf2('0x39')]=function(_0x44f585,_0x53b8b0){var _0x57cf1a=0xa;var _0x2a25a9=['join',_0xfaf2('0xa5'),_0xfaf2('0x5a'),'cross_join'];var _0x299f69={'SUM':'SUM(%s)','COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x164c28={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x512563=function(_0x31bd06){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),'IS\x20NOT\x20NULL',_0xfaf2('0x8b'),'IS\x20NOT\x20EMPTY'],_0x31bd06);};var _0x59484d=function(_0x52e7c8){if(!_0x52e7c8||!_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x405098='(',_0x3050d1=0x0;_0x3050d1<_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x3050d1+=0x1){_0x3050d1>0x0&&(_0x405098+='\x20'+_0x52e7c8[_0xfaf2('0x6a')]+'\x20');_0x405098+=_0x52e7c8[_0xfaf2('0x69')][_0x3050d1]['group']?_0x59484d(_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6b')]):_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6c')]+'\x20'+_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6d')]+(_0x512563(_0x52e7c8['rules'][_0x3050d1]['condition'])?'\x20'+_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6e')]:'');}return _0x405098+')';};var _0x2eda44={'where':{'id':_0x44f585[_0xfaf2('0x4a')]['id']}},_0x37a04c,_0x4868a7,_0x3bbb6a,_0x35bd7b,_0x7fbe67;_0x2eda44=_[_0xfaf2('0x45')]({},_0x2eda44,_0x44f585[_0xfaf2('0x47')]);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x2eda44)[_0xfaf2('0x2a')](function(_0x3ae28e){if(_0x3ae28e){_0x37a04c=_0x3ae28e;return _0x3ae28e[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0x5e54ef){if(_0x5e54ef){if(!_0x5e54ef[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))]['ValidationErrorItem'](_0xfaf2('0x71'),0x193);}_0x4868a7=_0x5e54ef;return db[_0xfaf2('0x8e')]['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x173782){if(_0x173782){_0x3bbb6a=_['keyBy'](_0x173782,'id');var _0x53bba4;var _0x48397c=squel[_0xfaf2('0x73')]();_0x48397c[_0xfaf2('0x74')](_0x37a04c['table']);for(var _0x3086bc=0x0;_0x3086bc<_0x4868a7['length'];_0x3086bc+=0x1){_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x76')]?_0x3bbb6a[_0x4868a7[_0x3086bc][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x4868a7[_0x3086bc][_0xfaf2('0x6c')];_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x78')]?_['replace'](_0x299f69[_0x4868a7[_0x3086bc][_0xfaf2('0x78')]],'%s',_0x53bba4):_0x53bba4;_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x164c28[_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]],'%s',_0x53bba4):_0x53bba4;if(_0x4868a7[_0x3086bc][_0xfaf2('0xa6')]){_0x48397c[_0xfaf2('0x6b')](_0x53bba4);}_0x4868a7[_0x3086bc]['orderBy']&&_0x48397c[_0xfaf2('0x40')](_0x53bba4,_0x4868a7[_0x3086bc]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x48397c[_0xfaf2('0x6c')](_0x53bba4,_0x4868a7[_0x3086bc][_0xfaf2('0x7d')]||_0x53bba4);}if(_0x37a04c[_0xfaf2('0x7e')]){_0x37a04c[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x7e')]);for(var _0x32779b=0x0;_0x32779b<_0x37a04c[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x32779b+=0x1){if(_0x37a04c['joins'][_0x32779b][_0xfaf2('0x36')]&&_['includes'](_0x2a25a9,_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')])&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]){_0x48397c[_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')]](_0x37a04c[_0xfaf2('0x7e')][_0x32779b]['foreignTable'],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x37a04c[_0xfaf2('0x75')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]));}}}if(_0x37a04c[_0xfaf2('0x83')]){_0x37a04c[_0xfaf2('0x83')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x83')]);_0x48397c[_0xfaf2('0x44')](_0x59484d(_0x37a04c[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x7fbe67=_0x48397c[_0xfaf2('0x84')]();_0x48397c['limit'](_0x57cf1a);_0x48397c['offset'](0x0);logger[_0xfaf2('0xa7')]('Limited\x20Query:',_0x48397c[_0xfaf2('0x85')]());return dbH[_0xfaf2('0xa1')][_0xfaf2('0x39')](_0x48397c[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')]['SELECT']});}})['then'](function(){return{'sql':_0x7fbe67[_0xfaf2('0x85')]()};})[_0xfaf2('0x2a')](respondWithResult(_0x53b8b0,null))[_0xfaf2('0x4e')](handleError(_0x53b8b0,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index d9ae339..f0296b3 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 _0x2b26=['path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xf7c71f,_0x14fcf2){var _0x2d0564=function(_0x2c565d){while(--_0x2c565d){_0xf7c71f['push'](_0xf7c71f['shift']());}};_0x2d0564(++_0x14fcf2);}(_0x2b26,0xbd));var _0x62b2=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2b26[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x62b2('0x0'));var util=require(_0x62b2('0x1'));var logger=require(_0x62b2('0x2'))(_0x62b2('0x3'));var moment=require('moment');var BPromise=require(_0x62b2('0x4'));var rp=require(_0x62b2('0x5'));var fs=require('fs');var path=require(_0x62b2('0x6'));var rimraf=require('rimraf');var config=require(_0x62b2('0x7'));var attributes=require(_0x62b2('0x8'));module[_0x62b2('0x9')]=function(_0x3c35f8,_0x16e9a0){return _0x3c35f8[_0x62b2('0xa')](_0x62b2('0xb'),attributes,{'tableName':_0x62b2('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebd8=['path','../../config/environment','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xebd8,0x164));var _0x8ebd=function(_0x566aff,_0x37fa7a){_0x566aff=_0x566aff-0x0;var _0x28ff10=_0xebd8[_0x566aff];return _0x28ff10;};'use strict';var _=require('lodash');var util=require(_0x8ebd('0x0'));var logger=require(_0x8ebd('0x1'))(_0x8ebd('0x2'));var moment=require('moment');var BPromise=require(_0x8ebd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ebd('0x4'));var rimraf=require('rimraf');var config=require(_0x8ebd('0x5'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x21f2f6,_0x41f227){return _0x21f2f6['define'](_0x8ebd('0x6'),attributes,{'tableName':_0x8ebd('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 648a2fc..a5f2b1e 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 _0x9ecd=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x9ecd,0x1cf));var _0xd9ec=function(_0x103841,_0x447d69){_0x103841=_0x103841-0x0;var _0x568b18=_0x9ecd[_0x103841];return _0x568b18;};'use strict';var _=require(_0xd9ec('0x0'));var util=require(_0xd9ec('0x1'));var moment=require(_0xd9ec('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ec('0x3'));var fs=require('fs');var Redis=require(_0xd9ec('0x4'));var db=require(_0xd9ec('0x5'))['db'];var utils=require(_0xd9ec('0x6'));var logger=require(_0xd9ec('0x7'))(_0xd9ec('0x8'));var config=require(_0xd9ec('0x9'));var jayson=require(_0xd9ec('0xa'));var client=jayson['client'][_0xd9ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ca1f4,_0x123c26,_0x1e825e){return new BPromise(function(_0x304089,_0xc06a60){return client[_0xd9ec('0xc')](_0x1ca1f4,_0x1e825e)[_0xd9ec('0xd')](function(_0x44e9c0){logger[_0xd9ec('0xe')](_0xd9ec('0xf'),_0x123c26,'request\x20sent');logger[_0xd9ec('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x123c26,_0xd9ec('0x11'),JSON[_0xd9ec('0x12')](_0x44e9c0));if(_0x44e9c0[_0xd9ec('0x13')]){if(_0x44e9c0['error'][_0xd9ec('0x14')]===0x1f4){logger[_0xd9ec('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x123c26,_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);return _0xc06a60(_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);}logger[_0xd9ec('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x123c26,_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);return _0x304089(_0x44e9c0[_0xd9ec('0x13')][_0xd9ec('0x15')]);}else{logger[_0xd9ec('0xe')](_0xd9ec('0xf'),_0x123c26,_0xd9ec('0x11'));_0x304089(_0x44e9c0[_0xd9ec('0x16')][_0xd9ec('0x15')]);}})[_0xd9ec('0x17')](function(_0x4a3d52){logger[_0xd9ec('0x13')](_0xd9ec('0xf'),_0x123c26,_0x4a3d52);_0xc06a60(_0x4a3d52);});});} \ No newline at end of file +var _0x6776=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x7a7e22,_0x5c8f17){var _0x57c703=function(_0x4268fb){while(--_0x4268fb){_0x7a7e22['push'](_0x7a7e22['shift']());}};_0x57c703(++_0x5c8f17);}(_0x6776,0xcc));var _0x6677=function(_0x5f49bc,_0x548555){_0x5f49bc=_0x5f49bc-0x0;var _0x44bbb9=_0x6776[_0x5f49bc];return _0x44bbb9;};'use strict';var _=require(_0x6677('0x0'));var util=require(_0x6677('0x1'));var moment=require(_0x6677('0x2'));var BPromise=require(_0x6677('0x3'));var rs=require(_0x6677('0x4'));var fs=require('fs');var Redis=require(_0x6677('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6677('0x6'));var logger=require(_0x6677('0x7'))(_0x6677('0x8'));var config=require('../../config/environment');var jayson=require(_0x6677('0x9'));var client=jayson[_0x6677('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20048f,_0xce23d6,_0x3d6ade){return new BPromise(function(_0x22ace7,_0x40766a){return client[_0x6677('0xb')](_0x20048f,_0x3d6ade)[_0x6677('0xc')](function(_0x3898a3){logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));logger[_0x6677('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xce23d6,_0x6677('0xf'),JSON[_0x6677('0x11')](_0x3898a3));if(_0x3898a3[_0x6677('0x12')]){if(_0x3898a3[_0x6677('0x12')][_0x6677('0x13')]===0x1f4){logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x40766a(_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);}logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x22ace7(_0x3898a3['error'][_0x6677('0x14')]);}else{logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));_0x22ace7(_0x3898a3[_0x6677('0x15')][_0x6677('0x14')]);}})[_0x6677('0x16')](function(_0x3c1a80){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xce23d6,_0x3c1a80);_0x40766a(_0x3c1a80);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 8dcd338..483552e 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 _0x9027=['isAuthenticated','index','/:id','show','get','/:id/preview','preview','run','/:id/query','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x268882,_0xb2de98){var _0x2d800d=function(_0x430b2d){while(--_0x430b2d){_0x268882['push'](_0x268882['shift']());}};_0x2d800d(++_0xb2de98);}(_0x9027,0x151));var _0x7902=function(_0x211783,_0x1437a4){_0x211783=_0x211783-0x0;var _0x5f29ed=_0x9027[_0x211783];return _0x5f29ed;};'use strict';var multer=require(_0x7902('0x0'));var util=require(_0x7902('0x1'));var path=require('path');var timeout=require(_0x7902('0x2'));var express=require('express');var router=express[_0x7902('0x3')]();var fs_extra=require(_0x7902('0x4'));var auth=require(_0x7902('0x5'));var interaction=require(_0x7902('0x6'));var config=require(_0x7902('0x7'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x7902('0x8')](),controller[_0x7902('0x9')]);router['get'](_0x7902('0xa'),auth[_0x7902('0x8')](),controller[_0x7902('0xb')]);router[_0x7902('0xc')](_0x7902('0xd'),auth[_0x7902('0x8')](),controller[_0x7902('0xe')]);router['get']('/:id/run',auth[_0x7902('0x8')](),controller[_0x7902('0xf')]);router[_0x7902('0xc')](_0x7902('0x10'),auth[_0x7902('0x8')](),controller['query']);router[_0x7902('0x11')]('/',auth[_0x7902('0x8')](),controller[_0x7902('0x12')]);router['put']('/:id',auth[_0x7902('0x8')](),controller[_0x7902('0x13')]);router[_0x7902('0x14')]('/:id',auth[_0x7902('0x8')](),controller[_0x7902('0x15')]);module[_0x7902('0x16')]=router; \ No newline at end of file +var _0x5086=['create','/:id','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','show','preview','run','query'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x5086,0x16d));var _0x6508=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5086[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6508('0x0'));var util=require('util');var path=require(_0x6508('0x1'));var timeout=require(_0x6508('0x2'));var express=require(_0x6508('0x3'));var router=express[_0x6508('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6508('0x5'));var interaction=require(_0x6508('0x6'));var config=require(_0x6508('0x7'));var controller=require(_0x6508('0x8'));router['get']('/',auth[_0x6508('0x9')](),controller['index']);router[_0x6508('0xa')]('/:id',auth[_0x6508('0x9')](),controller[_0x6508('0xb')]);router[_0x6508('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x6508('0xc')]);router[_0x6508('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0x6508('0xd')]);router[_0x6508('0xa')]('/:id/query',auth[_0x6508('0x9')](),controller[_0x6508('0xe')]);router['post']('/',auth[_0x6508('0x9')](),controller[_0x6508('0xf')]);router['put'](_0x6508('0x10'),auth[_0x6508('0x9')](),controller[_0x6508('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6508('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index ea02b39..dd784ab 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 _0xc4aa=['STRING','sequelize','exports'];(function(_0x57dde5,_0x45fe38){var _0x18d519=function(_0x1955bf){while(--_0x1955bf){_0x57dde5['push'](_0x57dde5['shift']());}};_0x18d519(++_0x45fe38);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2ff4a7,_0xe37347){_0x2ff4a7=_0x2ff4a7-0x0;var _0xc01c3f=_0x8ef6[_0x2ff4a7];return _0xc01c3f;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 8180fca..4aadc35 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 _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x125d23,_0x1ab0c4){var _0x13c0b5=function(_0x560da6){while(--_0x560da6){_0x125d23['push'](_0x125d23['shift']());}};_0x13c0b5(++_0x1ab0c4);}(_0x1967,0x173));var _0x7196=function(_0x4fe049,_0x52bedb){_0x4fe049=_0x4fe049-0x0;var _0x1946b5=_0x1967[_0x4fe049];return _0x1946b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file +var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x4819,0xcd));var _0x9481=function(_0x30505b,_0x3b6c06){_0x30505b=_0x30505b-0x0;var _0x4f7466=_0x4819[_0x30505b];return _0x4f7466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5e4e1c1..ba272ec 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 _0x2441=['define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x20d290,_0x40fc11){var _0x2bfa8f=function(_0x2498e0){while(--_0x2498e0){_0x20d290['push'](_0x20d290['shift']());}};_0x2bfa8f(++_0x40fc11);}(_0x2441,0x1dc));var _0x1244=function(_0x4173e8,_0x19a95f){_0x4173e8=_0x4173e8-0x0;var _0x44fd49=_0x2441[_0x4173e8];return _0x44fd49;};'use strict';var _=require('lodash');var util=require(_0x1244('0x0'));var logger=require(_0x1244('0x1'))('api');var moment=require(_0x1244('0x2'));var BPromise=require('bluebird');var rp=require(_0x1244('0x3'));var fs=require('fs');var path=require(_0x1244('0x4'));var rimraf=require(_0x1244('0x5'));var config=require(_0x1244('0x6'));var attributes=require('./analyticDefaultReport.attributes');module[_0x1244('0x7')]=function(_0x1c19a3,_0x46c71b){return _0x1c19a3[_0x1244('0x8')](_0x1244('0x9'),attributes,{'tableName':_0x1244('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d1d=['request-promise','rimraf','../../config/environment','define','analytics_default_reports','util','../../config/logger','moment','bluebird'];(function(_0x174c4d,_0x3771df){var _0x5a23c7=function(_0x5034c7){while(--_0x5034c7){_0x174c4d['push'](_0x174c4d['shift']());}};_0x5a23c7(++_0x3771df);}(_0x1d1d,0xcb));var _0xd1d1=function(_0x178015,_0x4bcd41){_0x178015=_0x178015-0x0;var _0x5ef3c5=_0x1d1d[_0x178015];return _0x5ef3c5;};'use strict';var _=require('lodash');var util=require(_0xd1d1('0x0'));var logger=require(_0xd1d1('0x1'))('api');var moment=require(_0xd1d1('0x2'));var BPromise=require(_0xd1d1('0x3'));var rp=require(_0xd1d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d1('0x5'));var config=require(_0xd1d1('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x1d1294,_0x1f256f){return _0x1d1294[_0xd1d1('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xd1d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index b081245..7dad965 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 _0xa9f2=['code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2e18a9,_0x2ae8c2){var _0x39d8d7=function(_0x4729ef){while(--_0x4729ef){_0x2e18a9['push'](_0x2e18a9['shift']());}};_0x39d8d7(++_0x2ae8c2);}(_0xa9f2,0x10c));var _0x2a9f=function(_0x5b2ae5,_0x1c24d9){_0x5b2ae5=_0x5b2ae5-0x0;var _0x5d5216=_0xa9f2[_0x5b2ae5];return _0x5d5216;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2a9f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a9f('0x1'));var db=require(_0x2a9f('0x2'))['db'];var utils=require(_0x2a9f('0x3'));var logger=require(_0x2a9f('0x4'))(_0x2a9f('0x5'));var config=require(_0x2a9f('0x6'));var jayson=require(_0x2a9f('0x7'));var client=jayson[_0x2a9f('0x8')][_0x2a9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24f399,_0xa555e3,_0x257602){return new BPromise(function(_0x518504,_0x5d1505){return client[_0x2a9f('0xa')](_0x24f399,_0x257602)[_0x2a9f('0xb')](function(_0x15253f){logger[_0x2a9f('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa555e3,'request\x20sent');logger[_0x2a9f('0xd')](_0x2a9f('0xe'),_0xa555e3,_0x2a9f('0xf'),JSON[_0x2a9f('0x10')](_0x15253f));if(_0x15253f['error']){if(_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x12')]===0x1f4){logger[_0x2a9f('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa555e3,_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x13')]);return _0x5d1505(_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xa555e3,_0x15253f[_0x2a9f('0x11')][_0x2a9f('0x13')]);return _0x518504(_0x15253f['error']['message']);}else{logger[_0x2a9f('0xc')](_0x2a9f('0x14'),_0xa555e3,_0x2a9f('0xf'));_0x518504(_0x15253f[_0x2a9f('0x15')][_0x2a9f('0x13')]);}})['catch'](function(_0x29c10b){logger[_0x2a9f('0x11')](_0x2a9f('0x14'),_0xa555e3,_0x29c10b);_0x5d1505(_0x29c10b);});});} \ No newline at end of file +var _0xa797=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2ff733,_0x5f2825){var _0x156deb=function(_0x1f684d){while(--_0x1f684d){_0x2ff733['push'](_0x2ff733['shift']());}};_0x156deb(++_0x5f2825);}(_0xa797,0x127));var _0x7a79=function(_0x3b36af,_0x3556e8){_0x3b36af=_0x3b36af-0x0;var _0x578b1c=_0xa797[_0x3b36af];return _0x578b1c;};'use strict';var _=require(_0x7a79('0x0'));var util=require(_0x7a79('0x1'));var moment=require(_0x7a79('0x2'));var BPromise=require(_0x7a79('0x3'));var rs=require(_0x7a79('0x4'));var fs=require('fs');var Redis=require(_0x7a79('0x5'));var db=require(_0x7a79('0x6'))['db'];var utils=require(_0x7a79('0x7'));var logger=require('../../config/logger')(_0x7a79('0x8'));var config=require(_0x7a79('0x9'));var jayson=require(_0x7a79('0xa'));var client=jayson['client'][_0x7a79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48e17a,_0x4d7f0e,_0x5cf034){return new BPromise(function(_0x3429ba,_0x25875b){return client[_0x7a79('0xc')](_0x48e17a,_0x5cf034)['then'](function(_0xcc9a99){logger[_0x7a79('0xd')](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));logger[_0x7a79('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4d7f0e,'request\x20sent',JSON['stringify'](_0xcc9a99));if(_0xcc9a99[_0x7a79('0x11')]){if(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x12')]===0x1f4){logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99['error']['message']);return _0x25875b(_0xcc9a99[_0x7a79('0x11')]['message']);}logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);return _0x3429ba(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);}else{logger['info'](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));_0x3429ba(_0xcc9a99[_0x7a79('0x14')][_0x7a79('0x13')]);}})[_0x7a79('0x15')](function(_0xd22eb3){logger[_0x7a79('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4d7f0e,_0xd22eb3);_0x25875b(_0xd22eb3);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a2124af..7572d30 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 _0x5c7b=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','preview','run','/:id/query','query','post'];(function(_0x4c34c6,_0x1240d6){var _0x2f0192=function(_0x1ea197){while(--_0x1ea197){_0x4c34c6['push'](_0x4c34c6['shift']());}};_0x2f0192(++_0x1240d6);}(_0x5c7b,0x9c));var _0xb5c7=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x5c7b[_0x1d24eb];return _0x1dc576;};'use strict';var multer=require('multer');var util=require(_0xb5c7('0x0'));var path=require(_0xb5c7('0x1'));var timeout=require(_0xb5c7('0x2'));var express=require(_0xb5c7('0x3'));var router=express[_0xb5c7('0x4')]();var fs_extra=require(_0xb5c7('0x5'));var auth=require(_0xb5c7('0x6'));var interaction=require(_0xb5c7('0x7'));var config=require(_0xb5c7('0x8'));var controller=require(_0xb5c7('0x9'));router[_0xb5c7('0xa')]('/',auth[_0xb5c7('0xb')](),controller['index']);router[_0xb5c7('0xa')](_0xb5c7('0xc'),auth['isAuthenticated'](),controller[_0xb5c7('0xd')]);router[_0xb5c7('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0xb5c7('0xe')]);router[_0xb5c7('0xa')]('/:id/run',auth[_0xb5c7('0xb')](),controller[_0xb5c7('0xf')]);router[_0xb5c7('0xa')](_0xb5c7('0x10'),auth['isAuthenticated'](),controller[_0xb5c7('0x11')]);router[_0xb5c7('0x12')]('/',auth[_0xb5c7('0xb')](),controller[_0xb5c7('0x13')]);router[_0xb5c7('0x14')](_0xb5c7('0xc'),auth['isAuthenticated'](),controller[_0xb5c7('0x15')]);router[_0xb5c7('0x16')](_0xb5c7('0xc'),auth[_0xb5c7('0xb')](),controller[_0xb5c7('0x17')]);module[_0xb5c7('0x18')]=router; \ No newline at end of file +var _0xfb5b=['destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put'];(function(_0x1bfd2d,_0x18fca5){var _0x7b1809=function(_0x59561f){while(--_0x59561f){_0x1bfd2d['push'](_0x1bfd2d['shift']());}};_0x7b1809(++_0x18fca5);}(_0xfb5b,0x89));var _0xbfb5=function(_0x4c6c3f,_0x54c1ee){_0x4c6c3f=_0x4c6c3f-0x0;var _0x3f0d7c=_0xfb5b[_0x4c6c3f];return _0x3f0d7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbfb5('0x0'));var timeout=require(_0xbfb5('0x1'));var express=require('express');var router=express[_0xbfb5('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbfb5('0x3'));var config=require(_0xbfb5('0x4'));var controller=require('./analyticDefaultReport.controller');router[_0xbfb5('0x5')]('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x7')]);router[_0xbfb5('0x5')](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x9')]);router[_0xbfb5('0x5')](_0xbfb5('0xa'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xb')]);router['get'](_0xbfb5('0xc'),auth[_0xbfb5('0x6')](),controller['run']);router[_0xbfb5('0x5')](_0xbfb5('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xe')]);router[_0xbfb5('0xf')](_0xbfb5('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 71e8c57..948df9b 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 _0x51d9=['xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv'];(function(_0x531ba8,_0x54f49b){var _0x5e9a15=function(_0x22534c){while(--_0x22534c){_0x531ba8['push'](_0x531ba8['shift']());}};_0x5e9a15(++_0x54f49b);}(_0x51d9,0x145));var _0x951d=function(_0x4632ea,_0x10082c){_0x4632ea=_0x4632ea-0x0;var _0x368f3c=_0x51d9[_0x4632ea];return _0x368f3c;};'use strict';var Sequelize=require(_0x951d('0x0'));var moment=require('moment');module[_0x951d('0x1')]={'name':{'type':Sequelize[_0x951d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x951d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x951d('0x3')](_0x951d('0x4'),'pdf',_0x951d('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x951d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x951d('0x6')]},'endDate':{'type':Sequelize[_0x951d('0x6')]},'status':{'type':Sequelize[_0x951d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x951d('0x7'),_0x951d('0x8')),'allowNull':![],'defaultValue':_0x951d('0x7')},'reportId':{'type':Sequelize[_0x951d('0x9')](0xb)[_0x951d('0xa')]},'reportType':{'type':Sequelize[_0x951d('0x2')]}}; \ No newline at end of file +var _0x80c6=['STRING','ENUM','xlsx','DATE','Loading','scheduled','manual','sequelize','moment','exports'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x80c6,0x151));var _0x680c=function(_0x32453a,_0x3ed27d){_0x32453a=_0x32453a-0x0;var _0x2182bb=_0x80c6[_0x32453a];return _0x2182bb;};'use strict';var Sequelize=require(_0x680c('0x0'));var moment=require(_0x680c('0x1'));module[_0x680c('0x2')]={'name':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x680c('0x4')]('csv','pdf',_0x680c('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x680c('0x6')]},'endDate':{'type':Sequelize[_0x680c('0x6')]},'status':{'type':Sequelize[_0x680c('0x3')],'defaultValue':_0x680c('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0x680c('0x8')),'allowNull':![],'defaultValue':_0x680c('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x680c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index e7a1d23..d36722a 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 _0xeba1=['role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','existsSync','join','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','output','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','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','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','fields','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x167307,_0x5a60ae){var _0x550140=function(_0x5b5009){while(--_0x5b5009){_0x167307['push'](_0x167307['shift']());}};_0x550140(++_0x5a60ae);}(_0xeba1,0x13c));var _0x1eba=function(_0x192ec3,_0x1d17ef){_0x192ec3=_0x192ec3-0x0;var _0x852295=_0xeba1[_0x192ec3];return _0x852295;};'use strict';var emlformat=require(_0x1eba('0x0'));var rimraf=require(_0x1eba('0x1'));var zipdir=require(_0x1eba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1eba('0x3'));var moment=require(_0x1eba('0x4'));var BPromise=require(_0x1eba('0x5'));var Mustache=require('mustache');var util=require(_0x1eba('0x6'));var path=require(_0x1eba('0x7'));var sox=require(_0x1eba('0x8'));var csv=require(_0x1eba('0x9'));var ejs=require(_0x1eba('0xa'));var fs=require('fs');var fs_extra=require(_0x1eba('0xb'));var _=require('lodash');var squel=require(_0x1eba('0xc'));var crypto=require(_0x1eba('0xd'));var jsforce=require(_0x1eba('0xe'));var deskjs=require(_0x1eba('0xf'));var toCsv=require(_0x1eba('0x9'));var querystring=require(_0x1eba('0x10'));var Papa=require('papaparse');var Redis=require(_0x1eba('0x11'));var authService=require(_0x1eba('0x12'));var qs=require(_0x1eba('0x13'));var as=require(_0x1eba('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1eba('0x15'))('api');var utils=require(_0x1eba('0x16'));var config=require(_0x1eba('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2934e9,_0x1437f2){_0x1437f2=_0x1437f2||0xcc;return function(_0x469216){if(_0x469216){return _0x2934e9[_0x1eba('0x18')](_0x1437f2);}return _0x2934e9['status'](_0x1437f2)[_0x1eba('0x19')]();};}function respondWithResult(_0x2bcd55,_0x5cedbe){_0x5cedbe=_0x5cedbe||0xc8;return function(_0x3af96c){if(_0x3af96c){return _0x2bcd55[_0x1eba('0x1a')](_0x5cedbe)['json'](_0x3af96c);}};}function respondWithFilteredResult(_0x31ab5b,_0x2200ae){return function(_0x13c100){if(_0x13c100){var _0x58252a=typeof _0x2200ae[_0x1eba('0x1b')]===_0x1eba('0x1c')&&typeof _0x2200ae['limit']===_0x1eba('0x1c');var _0x588525=_0x13c100[_0x1eba('0x1d')];var _0x45e6ce=_0x58252a?0x0:_0x2200ae[_0x1eba('0x1b')];var _0x41115c=_0x58252a?_0x13c100[_0x1eba('0x1d')]:_0x2200ae[_0x1eba('0x1b')]+_0x2200ae[_0x1eba('0x1e')];var _0x46b125;if(_0x41115c>=_0x588525){_0x41115c=_0x588525;_0x46b125=0xc8;}else{_0x46b125=0xce;}_0x31ab5b['status'](_0x46b125);return _0x31ab5b[_0x1eba('0x1f')](_0x1eba('0x20'),_0x45e6ce+'-'+_0x41115c+'/'+_0x588525)[_0x1eba('0x21')](_0x13c100);}return null;};}function patchUpdates(_0x463842){return function(_0x14132c){try{jsonpatch[_0x1eba('0x22')](_0x14132c,_0x463842,!![]);}catch(_0x4f5374){return BPromise[_0x1eba('0x23')](_0x4f5374);}return _0x14132c[_0x1eba('0x24')]();};}function saveUpdates(_0x544418,_0x3393d7){return function(_0x15ca86){if(_0x15ca86){return _0x15ca86['update'](_0x544418)[_0x1eba('0x25')](function(_0x157cce){return _0x157cce;});}return null;};}function removeEntity(_0x1a77d0,_0x132577){return function(_0x330bdf){if(_0x330bdf){return _0x330bdf[_0x1eba('0x26')]()['then'](function(){var _0x5d18bb=_0x330bdf['get']({'plain':!![]});var _0x1aaba1=_0x1eba('0x27');return db[_0x1eba('0x28')][_0x1eba('0x26')]({'where':{'type':_0x1aaba1,'resourceId':_0x5d18bb['id']}})[_0x1eba('0x25')](function(){return _0x330bdf;});})['then'](function(){_0x1a77d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ebc77,_0x12262b){return function(_0x1d393b){if(!_0x1d393b){_0x5ebc77[_0x1eba('0x18')](0x194);}return _0x1d393b;};}function handleError(_0x24459d,_0x27dfaa){_0x27dfaa=_0x27dfaa||0x1f4;return function(_0x2bd39f){logger[_0x1eba('0x29')](_0x2bd39f[_0x1eba('0x2a')]);if(_0x2bd39f[_0x1eba('0x2b')]){delete _0x2bd39f[_0x1eba('0x2b')];}_0x24459d[_0x1eba('0x1a')](_0x27dfaa)[_0x1eba('0x2c')](_0x2bd39f);};}exports[_0x1eba('0x2d')]=function(_0x3e452b,_0x3b9c9f){var _0x247aa2={},_0xdad81c={},_0x1a373d={'count':0x0,'rows':[]};var _0x43f06f=_[_0x1eba('0x2e')](db[_0x1eba('0x2f')]['rawAttributes'],function(_0x5b1608){return{'name':_0x5b1608[_0x1eba('0x30')],'type':_0x5b1608[_0x1eba('0x31')][_0x1eba('0x32')]};});_0xdad81c[_0x1eba('0x33')]=_[_0x1eba('0x2e')](_0x43f06f,_0x1eba('0x2b'));_0xdad81c[_0x1eba('0x34')]=_['keys'](_0x3e452b[_0x1eba('0x34')]);_0xdad81c[_0x1eba('0x35')]=_[_0x1eba('0x36')](_0xdad81c[_0x1eba('0x33')],_0xdad81c[_0x1eba('0x34')]);_0x247aa2['attributes']=_[_0x1eba('0x36')](_0xdad81c[_0x1eba('0x33')],qs['fields'](_0x3e452b[_0x1eba('0x34')]['fields']));_0x247aa2[_0x1eba('0x37')]=_0x247aa2['attributes']['length']?_0x247aa2[_0x1eba('0x37')]:_0xdad81c[_0x1eba('0x33')];if(!_0x3e452b['query'][_0x1eba('0x38')](_0x1eba('0x39'))){_0x247aa2['limit']=qs[_0x1eba('0x1e')](_0x3e452b[_0x1eba('0x34')][_0x1eba('0x1e')]);_0x247aa2[_0x1eba('0x1b')]=qs[_0x1eba('0x1b')](_0x3e452b[_0x1eba('0x34')]['offset']);}_0x247aa2[_0x1eba('0x3a')]=qs['sort'](_0x3e452b[_0x1eba('0x34')][_0x1eba('0x3b')]);_0x247aa2[_0x1eba('0x3c')]=qs[_0x1eba('0x35')](_[_0x1eba('0x3d')](_0x3e452b[_0x1eba('0x34')],_0xdad81c[_0x1eba('0x35')]),_0x43f06f);if(_0x3e452b['query'][_0x1eba('0x3e')]){_0x247aa2[_0x1eba('0x3c')]=_[_0x1eba('0x3f')](_0x247aa2[_0x1eba('0x3c')],{'$or':_[_0x1eba('0x2e')](_0x43f06f,function(_0x7d0860){if(_0x7d0860['type']!==_0x1eba('0x40')){var _0x1bf926={};_0x1bf926[_0x7d0860[_0x1eba('0x2b')]]={'$like':'%'+_0x3e452b[_0x1eba('0x34')][_0x1eba('0x3e')]+'%'};return _0x1bf926;}})});}_0x247aa2=_[_0x1eba('0x3f')]({},_0x247aa2,_0x3e452b[_0x1eba('0x41')]);var _0x11b32a={'where':_0x247aa2[_0x1eba('0x3c')]};return db[_0x1eba('0x2f')][_0x1eba('0x1d')](_0x11b32a)[_0x1eba('0x25')](function(_0x25c179){_0x1a373d[_0x1eba('0x1d')]=_0x25c179;if(_0x3e452b[_0x1eba('0x34')][_0x1eba('0x42')]){_0x247aa2[_0x1eba('0x43')]=[{'all':!![]}];}return db[_0x1eba('0x2f')][_0x1eba('0x44')](_0x247aa2);})[_0x1eba('0x25')](function(_0x1a35b2){_0x1a373d['rows']=_0x1a35b2;return _0x1a373d;})[_0x1eba('0x25')](respondWithFilteredResult(_0x3b9c9f,_0x247aa2))[_0x1eba('0x45')](handleError(_0x3b9c9f,null));};exports['show']=function(_0x1d8e05,_0x5abb60){var _0x284b0e={'raw':!![],'where':{'id':_0x1d8e05[_0x1eba('0x46')]['id']}},_0x2f1b75={};_0x2f1b75[_0x1eba('0x33')]=_[_0x1eba('0x47')](db[_0x1eba('0x2f')][_0x1eba('0x48')]);_0x2f1b75['query']=_['keys'](_0x1d8e05[_0x1eba('0x34')]);_0x2f1b75[_0x1eba('0x35')]=_['intersection'](_0x2f1b75[_0x1eba('0x33')],_0x2f1b75[_0x1eba('0x34')]);_0x284b0e['attributes']=_['intersection'](_0x2f1b75['model'],qs[_0x1eba('0x49')](_0x1d8e05['query']['fields']));_0x284b0e[_0x1eba('0x37')]=_0x284b0e['attributes'][_0x1eba('0x4a')]?_0x284b0e['attributes']:_0x2f1b75['model'];if(_0x1d8e05['query'][_0x1eba('0x42')]){_0x284b0e[_0x1eba('0x43')]=[{'all':!![]}];}_0x284b0e=_[_0x1eba('0x3f')]({},_0x284b0e,_0x1d8e05[_0x1eba('0x41')]);return db[_0x1eba('0x2f')][_0x1eba('0x4b')](_0x284b0e)[_0x1eba('0x25')](handleEntityNotFound(_0x5abb60,null))[_0x1eba('0x25')](respondWithResult(_0x5abb60,null))['catch'](handleError(_0x5abb60,null));};exports['create']=function(_0x53af7c,_0x429cb2){return db[_0x1eba('0x2f')][_0x1eba('0x4c')](_0x53af7c[_0x1eba('0x4d')],{})['then'](function(_0x35052c){var _0x1c461b=_0x53af7c['user'][_0x1eba('0x4e')]({'plain':!![]});if(!_0x1c461b)throw new Error(_0x1eba('0x4f'));if(_0x1c461b[_0x1eba('0x50')]===_0x1eba('0x51')){var _0x2de09a=_0x35052c[_0x1eba('0x4e')]({'plain':!![]});var _0x12ce50=_0x1eba('0x27');return db[_0x1eba('0x52')][_0x1eba('0x4b')]({'where':{'name':_0x12ce50,'userProfileId':_0x1c461b[_0x1eba('0x53')]},'raw':!![]})[_0x1eba('0x25')](function(_0x587917){if(_0x587917&&_0x587917[_0x1eba('0x54')]===0x0){return db[_0x1eba('0x28')][_0x1eba('0x4c')]({'name':_0x2de09a[_0x1eba('0x2b')],'resourceId':_0x2de09a['id'],'type':_0x587917['name'],'sectionId':_0x587917['id']},{})[_0x1eba('0x25')](function(){return _0x35052c;});}else{return _0x35052c;}})['catch'](function(_0x4ca822){logger[_0x1eba('0x29')](_0x1eba('0x55'),_0x4ca822);throw _0x4ca822;});}return _0x35052c;})[_0x1eba('0x25')](respondWithResult(_0x429cb2,0xc9))[_0x1eba('0x45')](handleError(_0x429cb2,null));};exports[_0x1eba('0x56')]=function(_0x5ccc7a,_0x5a6f70){if(_0x5ccc7a[_0x1eba('0x4d')]['id']){delete _0x5ccc7a[_0x1eba('0x4d')]['id'];}return db[_0x1eba('0x2f')][_0x1eba('0x4b')]({'where':{'id':_0x5ccc7a[_0x1eba('0x46')]['id']}})[_0x1eba('0x25')](handleEntityNotFound(_0x5a6f70,null))['then'](saveUpdates(_0x5ccc7a[_0x1eba('0x4d')],null))[_0x1eba('0x25')](respondWithResult(_0x5a6f70,null))[_0x1eba('0x45')](handleError(_0x5a6f70,null));};exports['destroy']=function(_0x3ecddd,_0x3d6d3d){return db[_0x1eba('0x2f')][_0x1eba('0x4b')]({'where':{'id':_0x3ecddd[_0x1eba('0x46')]['id']}})[_0x1eba('0x25')](handleEntityNotFound(_0x3d6d3d,null))[_0x1eba('0x25')](removeEntity(_0x3d6d3d,null))[_0x1eba('0x45')](handleError(_0x3d6d3d,null));};exports[_0x1eba('0x57')]=function(_0x3fca1b,_0x425ff1,_0x3b29b0){return db[_0x1eba('0x2f')][_0x1eba('0x4b')]({'where':{'id':_0x3fca1b[_0x1eba('0x46')]['id']},'attributes':[_0x1eba('0x2b'),_0x1eba('0x58'),'savename','output'],'raw':!![]})[_0x1eba('0x25')](handleEntityNotFound(_0x425ff1,null))[_0x1eba('0x25')](function(_0x45896d){if(_0x45896d){if(!fs[_0x1eba('0x59')](path[_0x1eba('0x5a')](config['root'],_0x1eba('0x5b'),_0x45896d[_0x1eba('0x5c')]))){throw new db[(_0x1eba('0x5d'))]['ValidationError'](_0x1eba('0x5e'));}if(_0x3fca1b[_0x1eba('0x34')][_0x1eba('0x5f')]){return _0x425ff1[_0x1eba('0x18')](0xc8);}return _0x425ff1[_0x1eba('0x57')](path['join'](config[_0x1eba('0x60')],_0x1eba('0x5b'),_0x45896d[_0x1eba('0x5c')]),util['format']('%s.%s',_0x45896d[_0x1eba('0x58')]||_0x45896d['name'],_0x45896d[_0x1eba('0x61')][_0x1eba('0x62')]()));}})[_0x1eba('0x45')](handleError(_0x425ff1,null));}; \ No newline at end of file +var _0xaee4=['save','get','ExtractedReports','UserProfileResource','destroy','then','name','index','map','AnalyticExtractedReport','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject'];(function(_0x308ca1,_0xf8eb57){var _0x1c589e=function(_0x1489b7){while(--_0x1489b7){_0x308ca1['push'](_0x308ca1['shift']());}};_0x1c589e(++_0xf8eb57);}(_0xaee4,0xf9));var _0x4aee=function(_0x4f869b,_0x457e62){_0x4f869b=_0x4f869b-0x0;var _0x456ff7=_0xaee4[_0x4f869b];return _0x456ff7;};'use strict';var emlformat=require(_0x4aee('0x0'));var rimraf=require(_0x4aee('0x1'));var zipdir=require(_0x4aee('0x2'));var jsonpatch=require(_0x4aee('0x3'));var rp=require(_0x4aee('0x4'));var moment=require(_0x4aee('0x5'));var BPromise=require(_0x4aee('0x6'));var Mustache=require('mustache');var util=require(_0x4aee('0x7'));var path=require(_0x4aee('0x8'));var sox=require(_0x4aee('0x9'));var csv=require(_0x4aee('0xa'));var ejs=require(_0x4aee('0xb'));var fs=require('fs');var fs_extra=require(_0x4aee('0xc'));var _=require('lodash');var squel=require(_0x4aee('0xd'));var crypto=require(_0x4aee('0xe'));var jsforce=require(_0x4aee('0xf'));var deskjs=require(_0x4aee('0x10'));var toCsv=require(_0x4aee('0xa'));var querystring=require('querystring');var Papa=require(_0x4aee('0x11'));var Redis=require(_0x4aee('0x12'));var authService=require(_0x4aee('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aee('0x14'));var logger=require(_0x4aee('0x15'))(_0x4aee('0x16'));var utils=require(_0x4aee('0x17'));var config=require(_0x4aee('0x18'));var licenseUtil=require(_0x4aee('0x19'));var db=require(_0x4aee('0x1a'))['db'];function respondWithStatusCode(_0x3b1c17,_0x291c95){_0x291c95=_0x291c95||0xcc;return function(_0x3585bd){if(_0x3585bd){return _0x3b1c17[_0x4aee('0x1b')](_0x291c95);}return _0x3b1c17[_0x4aee('0x1c')](_0x291c95)['end']();};}function respondWithResult(_0x3b9193,_0x20f621){_0x20f621=_0x20f621||0xc8;return function(_0x54cddf){if(_0x54cddf){return _0x3b9193[_0x4aee('0x1c')](_0x20f621)[_0x4aee('0x1d')](_0x54cddf);}};}function respondWithFilteredResult(_0x45b3cf,_0xfc48ed){return function(_0x5a45df){if(_0x5a45df){var _0x47c357=typeof _0xfc48ed[_0x4aee('0x1e')]==='undefined'&&typeof _0xfc48ed[_0x4aee('0x1f')]==='undefined';var _0x3d4028=_0x5a45df[_0x4aee('0x20')];var _0x44daf5=_0x47c357?0x0:_0xfc48ed[_0x4aee('0x1e')];var _0x1c35df=_0x47c357?_0x5a45df[_0x4aee('0x20')]:_0xfc48ed[_0x4aee('0x1e')]+_0xfc48ed[_0x4aee('0x1f')];var _0x3474d0;if(_0x1c35df>=_0x3d4028){_0x1c35df=_0x3d4028;_0x3474d0=0xc8;}else{_0x3474d0=0xce;}_0x45b3cf[_0x4aee('0x1c')](_0x3474d0);return _0x45b3cf['set'](_0x4aee('0x21'),_0x44daf5+'-'+_0x1c35df+'/'+_0x3d4028)[_0x4aee('0x1d')](_0x5a45df);}return null;};}function patchUpdates(_0xdeb0ba){return function(_0x54bb91){try{jsonpatch[_0x4aee('0x22')](_0x54bb91,_0xdeb0ba,!![]);}catch(_0x92666d){return BPromise[_0x4aee('0x23')](_0x92666d);}return _0x54bb91[_0x4aee('0x24')]();};}function saveUpdates(_0x200ea0,_0x39a659){return function(_0x1697d3){if(_0x1697d3){return _0x1697d3['update'](_0x200ea0)['then'](function(_0x247a72){return _0x247a72;});}return null;};}function removeEntity(_0x4f14af,_0xd2efc0){return function(_0x1fa8f9){if(_0x1fa8f9){return _0x1fa8f9['destroy']()['then'](function(){var _0x4f3c9b=_0x1fa8f9[_0x4aee('0x25')]({'plain':!![]});var _0xc7c083=_0x4aee('0x26');return db[_0x4aee('0x27')][_0x4aee('0x28')]({'where':{'type':_0xc7c083,'resourceId':_0x4f3c9b['id']}})['then'](function(){return _0x1fa8f9;});})[_0x4aee('0x29')](function(){_0x4f14af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dca55,_0x4fd286){return function(_0x19182f){if(!_0x19182f){_0x2dca55[_0x4aee('0x1b')](0x194);}return _0x19182f;};}function handleError(_0x47deab,_0xab9eb4){_0xab9eb4=_0xab9eb4||0x1f4;return function(_0x322bfa){logger['error'](_0x322bfa['stack']);if(_0x322bfa[_0x4aee('0x2a')]){delete _0x322bfa['name'];}_0x47deab[_0x4aee('0x1c')](_0xab9eb4)['send'](_0x322bfa);};}exports[_0x4aee('0x2b')]=function(_0x204b7e,_0x219a46){var _0x61efd1={},_0x263d98={},_0x562c0f={'count':0x0,'rows':[]};var _0x756ea8=_[_0x4aee('0x2c')](db[_0x4aee('0x2d')][_0x4aee('0x2e')],function(_0x348640){return{'name':_0x348640['fieldName'],'type':_0x348640['type'][_0x4aee('0x2f')]};});_0x263d98[_0x4aee('0x30')]=_[_0x4aee('0x2c')](_0x756ea8,_0x4aee('0x2a'));_0x263d98[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x204b7e[_0x4aee('0x31')]);_0x263d98['filters']=_['intersection'](_0x263d98[_0x4aee('0x30')],_0x263d98[_0x4aee('0x31')]);_0x61efd1[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x263d98[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x204b7e[_0x4aee('0x31')]['fields']));_0x61efd1[_0x4aee('0x33')]=_0x61efd1['attributes'][_0x4aee('0x36')]?_0x61efd1['attributes']:_0x263d98[_0x4aee('0x30')];if(!_0x204b7e['query'][_0x4aee('0x37')]('nolimit')){_0x61efd1[_0x4aee('0x1f')]=qs[_0x4aee('0x1f')](_0x204b7e['query'][_0x4aee('0x1f')]);_0x61efd1[_0x4aee('0x1e')]=qs[_0x4aee('0x1e')](_0x204b7e[_0x4aee('0x31')][_0x4aee('0x1e')]);}_0x61efd1[_0x4aee('0x38')]=qs['sort'](_0x204b7e['query']['sort']);_0x61efd1[_0x4aee('0x39')]=qs[_0x4aee('0x3a')](_[_0x4aee('0x3b')](_0x204b7e['query'],_0x263d98[_0x4aee('0x3a')]),_0x756ea8);if(_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]){_0x61efd1['where']=_[_0x4aee('0x3d')](_0x61efd1[_0x4aee('0x39')],{'$or':_['map'](_0x756ea8,function(_0x45e6ce){if(_0x45e6ce[_0x4aee('0x3e')]!==_0x4aee('0x3f')){var _0xdaf027={};_0xdaf027[_0x45e6ce[_0x4aee('0x2a')]]={'$like':'%'+_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]+'%'};return _0xdaf027;}})});}_0x61efd1=_['merge']({},_0x61efd1,_0x204b7e[_0x4aee('0x40')]);var _0x3823ba={'where':_0x61efd1[_0x4aee('0x39')]};return db['AnalyticExtractedReport'][_0x4aee('0x20')](_0x3823ba)['then'](function(_0x342888){_0x562c0f[_0x4aee('0x20')]=_0x342888;if(_0x204b7e['query']['includeAll']){_0x61efd1[_0x4aee('0x41')]=[{'all':!![]}];}return db[_0x4aee('0x2d')][_0x4aee('0x42')](_0x61efd1);})[_0x4aee('0x29')](function(_0x66ac7f){_0x562c0f[_0x4aee('0x43')]=_0x66ac7f;return _0x562c0f;})[_0x4aee('0x29')](respondWithFilteredResult(_0x219a46,_0x61efd1))[_0x4aee('0x44')](handleError(_0x219a46,null));};exports[_0x4aee('0x45')]=function(_0x30de25,_0x125507){var _0x352f3a={'raw':!![],'where':{'id':_0x30de25[_0x4aee('0x46')]['id']}},_0x5013c4={};_0x5013c4[_0x4aee('0x30')]=_[_0x4aee('0x32')](db['AnalyticExtractedReport'][_0x4aee('0x2e')]);_0x5013c4[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x30de25[_0x4aee('0x31')]);_0x5013c4[_0x4aee('0x3a')]=_['intersection'](_0x5013c4[_0x4aee('0x30')],_0x5013c4[_0x4aee('0x31')]);_0x352f3a[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x5013c4[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x30de25[_0x4aee('0x31')][_0x4aee('0x35')]));_0x352f3a[_0x4aee('0x33')]=_0x352f3a[_0x4aee('0x33')]['length']?_0x352f3a[_0x4aee('0x33')]:_0x5013c4[_0x4aee('0x30')];if(_0x30de25[_0x4aee('0x31')][_0x4aee('0x47')]){_0x352f3a[_0x4aee('0x41')]=[{'all':!![]}];}_0x352f3a=_[_0x4aee('0x3d')]({},_0x352f3a,_0x30de25[_0x4aee('0x40')]);return db[_0x4aee('0x2d')][_0x4aee('0x48')](_0x352f3a)[_0x4aee('0x29')](handleEntityNotFound(_0x125507,null))[_0x4aee('0x29')](respondWithResult(_0x125507,null))[_0x4aee('0x44')](handleError(_0x125507,null));};exports[_0x4aee('0x49')]=function(_0x4a0e1a,_0x441c33){return db[_0x4aee('0x2d')][_0x4aee('0x49')](_0x4a0e1a['body'],{})[_0x4aee('0x29')](function(_0x2df7bd){var _0x514e33=_0x4a0e1a[_0x4aee('0x4a')][_0x4aee('0x25')]({'plain':!![]});if(!_0x514e33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x514e33['role']===_0x4aee('0x4a')){var _0x4cd316=_0x2df7bd[_0x4aee('0x25')]({'plain':!![]});var _0x25069c='ExtractedReports';return db[_0x4aee('0x4b')][_0x4aee('0x48')]({'where':{'name':_0x25069c,'userProfileId':_0x514e33[_0x4aee('0x4c')]},'raw':!![]})[_0x4aee('0x29')](function(_0x231607){if(_0x231607&&_0x231607[_0x4aee('0x4d')]===0x0){return db[_0x4aee('0x27')][_0x4aee('0x49')]({'name':_0x4cd316['name'],'resourceId':_0x4cd316['id'],'type':_0x231607['name'],'sectionId':_0x231607['id']},{})[_0x4aee('0x29')](function(){return _0x2df7bd;});}else{return _0x2df7bd;}})[_0x4aee('0x44')](function(_0x423fac){logger[_0x4aee('0x4e')](_0x4aee('0x4f'),_0x423fac);throw _0x423fac;});}return _0x2df7bd;})[_0x4aee('0x29')](respondWithResult(_0x441c33,0xc9))[_0x4aee('0x44')](handleError(_0x441c33,null));};exports['update']=function(_0xf67ba6,_0x1d8bf7){if(_0xf67ba6['body']['id']){delete _0xf67ba6[_0x4aee('0x50')]['id'];}return db['AnalyticExtractedReport'][_0x4aee('0x48')]({'where':{'id':_0xf67ba6['params']['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x1d8bf7,null))['then'](saveUpdates(_0xf67ba6[_0x4aee('0x50')],null))[_0x4aee('0x29')](respondWithResult(_0x1d8bf7,null))[_0x4aee('0x44')](handleError(_0x1d8bf7,null));};exports[_0x4aee('0x28')]=function(_0x5178db,_0x2aece8){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x5178db[_0x4aee('0x46')]['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x2aece8,null))['then'](removeEntity(_0x2aece8,null))[_0x4aee('0x44')](handleError(_0x2aece8,null));};exports[_0x4aee('0x51')]=function(_0x4ab417,_0x1537bf,_0x679440){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x4ab417[_0x4aee('0x46')]['id']},'attributes':[_0x4aee('0x2a'),_0x4aee('0x52'),_0x4aee('0x53'),_0x4aee('0x54')],'raw':!![]})[_0x4aee('0x29')](handleEntityNotFound(_0x1537bf,null))[_0x4aee('0x29')](function(_0x7954b9){if(_0x7954b9){if(!fs[_0x4aee('0x55')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]))){throw new db['Sequelize'][(_0x4aee('0x59'))](_0x4aee('0x5a'));}if(_0x4ab417[_0x4aee('0x31')][_0x4aee('0x5b')]){return _0x1537bf[_0x4aee('0x1b')](0xc8);}return _0x1537bf[_0x4aee('0x51')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]),util[_0x4aee('0x5c')](_0x4aee('0x5d'),_0x7954b9[_0x4aee('0x52')]||_0x7954b9[_0x4aee('0x2a')],_0x7954b9[_0x4aee('0x54')][_0x4aee('0x5e')]()));}})[_0x4aee('0x44')](handleError(_0x1537bf,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 02ceccf..2fe92b3 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 _0xd049=['../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2789f0,_0x1bd4e9){var _0x58b8b2=function(_0x48cd16){while(--_0x48cd16){_0x2789f0['push'](_0x2789f0['shift']());}};_0x58b8b2(++_0x1bd4e9);}(_0xd049,0x172));var _0x9d04=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd049[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x9d04('0x0'));var util=require(_0x9d04('0x1'));var logger=require(_0x9d04('0x2'))(_0x9d04('0x3'));var moment=require(_0x9d04('0x4'));var BPromise=require(_0x9d04('0x5'));var rp=require(_0x9d04('0x6'));var fs=require('fs');var path=require(_0x9d04('0x7'));var rimraf=require('rimraf');var config=require(_0x9d04('0x8'));var attributes=require(_0x9d04('0x9'));module[_0x9d04('0xa')]=function(_0x346d3d,_0x50b4bb){return _0x346d3d[_0x9d04('0xb')](_0x9d04('0xc'),attributes,{'tableName':_0x9d04('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd5a=['path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18fc2d,_0x3d356a){var _0x409fc8=function(_0x432710){while(--_0x432710){_0x18fc2d['push'](_0x18fc2d['shift']());}};_0x409fc8(++_0x3d356a);}(_0xcd5a,0xa1));var _0xacd5=function(_0x16834b,_0x4c2cda){_0x16834b=_0x16834b-0x0;var _0x4c7aee=_0xcd5a[_0x16834b];return _0x4c7aee;};'use strict';var _=require(_0xacd5('0x0'));var util=require(_0xacd5('0x1'));var logger=require(_0xacd5('0x2'))(_0xacd5('0x3'));var moment=require(_0xacd5('0x4'));var BPromise=require(_0xacd5('0x5'));var rp=require(_0xacd5('0x6'));var fs=require('fs');var path=require(_0xacd5('0x7'));var rimraf=require(_0xacd5('0x8'));var config=require(_0xacd5('0x9'));var attributes=require('./analyticExtractedReport.attributes');module[_0xacd5('0xa')]=function(_0x106087,_0x313668){return _0x106087[_0xacd5('0xb')](_0xacd5('0xc'),attributes,{'tableName':_0xacd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 4d56d21..5383348 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 _0x4b39=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x8a1634,_0x755249){var _0x51d741=function(_0x2d65eb){while(--_0x2d65eb){_0x8a1634['push'](_0x8a1634['shift']());}};_0x51d741(++_0x755249);}(_0x4b39,0x133));var _0x94b3=function(_0x4503f6,_0x3babaf){_0x4503f6=_0x4503f6-0x0;var _0x2277d1=_0x4b39[_0x4503f6];return _0x2277d1;};'use strict';var _=require(_0x94b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x94b3('0x1'));var rs=require(_0x94b3('0x2'));var fs=require('fs');var Redis=require(_0x94b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x94b3('0x4'));var logger=require(_0x94b3('0x5'))(_0x94b3('0x6'));var config=require(_0x94b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94b3('0x8')][_0x94b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25daa0,_0x547e4d,_0x19a221){return new BPromise(function(_0x538ad5,_0x363a67){return client['request'](_0x25daa0,_0x19a221)[_0x94b3('0xa')](function(_0x4e6307){logger[_0x94b3('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x94b3('0xc'));logger['debug'](_0x94b3('0xd'),_0x547e4d,_0x94b3('0xc'),JSON[_0x94b3('0xe')](_0x4e6307));if(_0x4e6307['error']){if(_0x4e6307[_0x94b3('0xf')]['code']===0x1f4){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);return _0x363a67(_0x4e6307['error']['message']);}logger[_0x94b3('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x4e6307[_0x94b3('0xf')]['message']);return _0x538ad5(_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);}else{logger['info'](_0x94b3('0x10'),_0x547e4d,_0x94b3('0xc'));_0x538ad5(_0x4e6307['result'][_0x94b3('0x11')]);}})[_0x94b3('0x12')](function(_0x1896ec){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x1896ec);_0x363a67(_0x1896ec);});});} \ No newline at end of file +var _0x6f75=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x6f75,0x71));var _0x56f7=function(_0x3a4998,_0x5b8203){_0x3a4998=_0x3a4998-0x0;var _0x18e7df=_0x6f75[_0x3a4998];return _0x18e7df;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var moment=require(_0x56f7('0x2'));var BPromise=require(_0x56f7('0x3'));var rs=require(_0x56f7('0x4'));var fs=require('fs');var Redis=require(_0x56f7('0x5'));var db=require(_0x56f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x7'))(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137d14,_0xcc51b1,_0x4b5dcc){return new BPromise(function(_0x184bf7,_0x5155ff){return client['request'](_0x137d14,_0x4b5dcc)[_0x56f7('0xa')](function(_0x1e607c){logger[_0x56f7('0xb')](_0x56f7('0xc'),_0xcc51b1,_0x56f7('0xd'));logger[_0x56f7('0xe')](_0x56f7('0xf'),_0xcc51b1,_0x56f7('0xd'),JSON[_0x56f7('0x10')](_0x1e607c));if(_0x1e607c[_0x56f7('0x11')]){if(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x12')]===0x1f4){logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c['error'][_0x56f7('0x13')]);return _0x5155ff(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);return _0x184bf7(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x56f7('0xd'));_0x184bf7(_0x1e607c[_0x56f7('0x14')][_0x56f7('0x13')]);}})[_0x56f7('0x15')](function(_0x40fb77){logger[_0x56f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x40fb77);_0x5155ff(_0x40fb77);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index ec4e2f4..e6ce910 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 _0x09d1=['get','isAuthenticated','index','/:id','/:id/download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x57f743,_0x1f3944){var _0x29417d=function(_0x130711){while(--_0x130711){_0x57f743['push'](_0x57f743['shift']());}};_0x29417d(++_0x1f3944);}(_0x09d1,0x74));var _0x109d=function(_0x43e7c4,_0x2b0ef1){_0x43e7c4=_0x43e7c4-0x0;var _0x49ae54=_0x09d1[_0x43e7c4];return _0x49ae54;};'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[_0x109d('0x5')]();var fs_extra=require(_0x109d('0x6'));var auth=require(_0x109d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x109d('0x8'));var controller=require(_0x109d('0x9'));router[_0x109d('0xa')]('/',auth[_0x109d('0xb')](),controller[_0x109d('0xc')]);router['get'](_0x109d('0xd'),auth[_0x109d('0xb')](),controller['show']);router[_0x109d('0xa')](_0x109d('0xe'),auth[_0x109d('0xb')](),controller['download']);router[_0x109d('0xf')]('/',auth[_0x109d('0xb')](),controller[_0x109d('0x10')]);router[_0x109d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0x12')]);router[_0x109d('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x109d('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4606=['/:id/download','download','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x2bf755,_0x4b156b){var _0x2e1810=function(_0x77fbae){while(--_0x77fbae){_0x2bf755['push'](_0x2bf755['shift']());}};_0x2e1810(++_0x4b156b);}(_0x4606,0x1e4));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6460('0x0'));var util=require('util');var path=require(_0x6460('0x1'));var timeout=require(_0x6460('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6460('0x3'));var config=require(_0x6460('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x6460('0x5')](),controller[_0x6460('0x6')]);router[_0x6460('0x7')]('/:id',auth[_0x6460('0x5')](),controller[_0x6460('0x8')]);router[_0x6460('0x7')](_0x6460('0x9'),auth[_0x6460('0x5')](),controller[_0x6460('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6460('0xb')]);router[_0x6460('0xc')](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xe')]);router['delete'](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xf')]);module[_0x6460('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index c37fc7c..5760a9f 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 _0x569c=['TEXT','STRING','sequelize','exports'];(function(_0x240575,_0x491964){var _0x2d139d=function(_0x3c6296){while(--_0x3c6296){_0x240575['push'](_0x240575['shift']());}};_0x2d139d(++_0x491964);}(_0x569c,0x13e));var _0xc569=function(_0x4ff8e1,_0x29b296){_0x4ff8e1=_0x4ff8e1-0x0;var _0x3ba8d4=_0x569c[_0x4ff8e1];return _0x3ba8d4;};'use strict';var Sequelize=require(_0xc569('0x0'));module[_0xc569('0x1')]={'field':{'type':Sequelize[_0xc569('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xc569('0x3')]},'format':{'type':Sequelize[_0xc569('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc569('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4280=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x4280,0x136));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0428('0x0'));module['exports']={'field':{'type':Sequelize[_0x0428('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0428('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0428('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0428('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5d0b395..bd98ded 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 _0x94a4=['hasOwnProperty','order','sort','where','pick','filter','merge','type','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','bulkCreate','update','destroy','ids','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','then','sendStatus','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x3f19b3,_0x3f0849){var _0xd61898=function(_0x3ca685){while(--_0x3ca685){_0x3f19b3['push'](_0x3f19b3['shift']());}};_0xd61898(++_0x3f0849);}(_0x94a4,0x1a8));var _0x494a=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x94a4[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require(_0x494a('0x0'));var rimraf=require(_0x494a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x494a('0x2'));var Mustache=require(_0x494a('0x3'));var util=require('util');var path=require('path');var sox=require(_0x494a('0x4'));var csv=require(_0x494a('0x5'));var ejs=require(_0x494a('0x6'));var fs=require('fs');var fs_extra=require(_0x494a('0x7'));var _=require(_0x494a('0x8'));var squel=require(_0x494a('0x9'));var crypto=require(_0x494a('0xa'));var jsforce=require(_0x494a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x494a('0xc'));var Papa=require(_0x494a('0xd'));var Redis=require(_0x494a('0xe'));var authService=require(_0x494a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x494a('0x10'));var hardwareService=require(_0x494a('0x11'));var logger=require(_0x494a('0x12'))(_0x494a('0x13'));var utils=require(_0x494a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x494a('0x15'));var db=require(_0x494a('0x16'))['db'];function respondWithStatusCode(_0x1696f7,_0x3c1c98){_0x3c1c98=_0x3c1c98||0xcc;return function(_0x37c6be){if(_0x37c6be){return _0x1696f7['sendStatus'](_0x3c1c98);}return _0x1696f7[_0x494a('0x17')](_0x3c1c98)[_0x494a('0x18')]();};}function respondWithResult(_0x57ddf1,_0x576ab8){_0x576ab8=_0x576ab8||0xc8;return function(_0x7b02f7){if(_0x7b02f7){return _0x57ddf1[_0x494a('0x17')](_0x576ab8)[_0x494a('0x19')](_0x7b02f7);}};}function respondWithFilteredResult(_0x2fc8da,_0x2377d1){return function(_0x27c5d1){if(_0x27c5d1){var _0x386671=typeof _0x2377d1[_0x494a('0x1a')]===_0x494a('0x1b')&&typeof _0x2377d1['limit']==='undefined';var _0x52118d=_0x27c5d1['count'];var _0x10749a=_0x386671?0x0:_0x2377d1[_0x494a('0x1a')];var _0x37b995=_0x386671?_0x27c5d1[_0x494a('0x1c')]:_0x2377d1['offset']+_0x2377d1[_0x494a('0x1d')];var _0x2fe50e;if(_0x37b995>=_0x52118d){_0x37b995=_0x52118d;_0x2fe50e=0xc8;}else{_0x2fe50e=0xce;}_0x2fc8da[_0x494a('0x17')](_0x2fe50e);return _0x2fc8da[_0x494a('0x1e')]('Content-Range',_0x10749a+'-'+_0x37b995+'/'+_0x52118d)[_0x494a('0x19')](_0x27c5d1);}return null;};}function patchUpdates(_0x553a10){return function(_0x56fa61){try{jsonpatch[_0x494a('0x1f')](_0x56fa61,_0x553a10,!![]);}catch(_0x43094b){return BPromise[_0x494a('0x20')](_0x43094b);}return _0x56fa61['save']();};}function saveUpdates(_0x57ffd5,_0x44428c){return function(_0x3675e4){if(_0x3675e4){return _0x3675e4['update'](_0x57ffd5)['then'](function(_0x3cd9d9){return _0x3cd9d9;});}return null;};}function removeEntity(_0x466f72,_0x376f21){return function(_0x24e7fb){if(_0x24e7fb){return _0x24e7fb['destroy']()[_0x494a('0x21')](function(){_0x466f72[_0x494a('0x17')](0xcc)[_0x494a('0x18')]();});}};}function handleEntityNotFound(_0x5064cd,_0x3e0ddd){return function(_0x52ec5b){if(!_0x52ec5b){_0x5064cd[_0x494a('0x22')](0x194);}return _0x52ec5b;};}function handleError(_0x399bcd,_0x31270f){_0x31270f=_0x31270f||0x1f4;return function(_0x593efc){logger[_0x494a('0x23')](_0x593efc[_0x494a('0x24')]);if(_0x593efc[_0x494a('0x25')]){delete _0x593efc['name'];}_0x399bcd[_0x494a('0x17')](_0x31270f)[_0x494a('0x26')](_0x593efc);};}exports['index']=function(_0x4cb6d9,_0x15cf3a){var _0x180707={},_0x612f84={},_0x3999b5={'count':0x0,'rows':[]};var _0x44b8a6=_[_0x494a('0x27')](db['AnalyticFieldReport']['rawAttributes'],function(_0x233219){return{'name':_0x233219[_0x494a('0x28')],'type':_0x233219['type'][_0x494a('0x29')]};});_0x612f84[_0x494a('0x2a')]=_[_0x494a('0x27')](_0x44b8a6,_0x494a('0x25'));_0x612f84[_0x494a('0x2b')]=_[_0x494a('0x2c')](_0x4cb6d9['query']);_0x612f84[_0x494a('0x2d')]=_[_0x494a('0x2e')](_0x612f84[_0x494a('0x2a')],_0x612f84[_0x494a('0x2b')]);_0x180707[_0x494a('0x2f')]=_['intersection'](_0x612f84[_0x494a('0x2a')],qs[_0x494a('0x30')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x30')]));_0x180707[_0x494a('0x2f')]=_0x180707[_0x494a('0x2f')][_0x494a('0x31')]?_0x180707[_0x494a('0x2f')]:_0x612f84[_0x494a('0x2a')];if(!_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x32')]('nolimit')){_0x180707[_0x494a('0x1d')]=qs[_0x494a('0x1d')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x1d')]);_0x180707[_0x494a('0x1a')]=qs[_0x494a('0x1a')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x1a')]);}_0x180707[_0x494a('0x33')]=qs[_0x494a('0x34')](_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x34')]);_0x180707[_0x494a('0x35')]=qs[_0x494a('0x2d')](_[_0x494a('0x36')](_0x4cb6d9[_0x494a('0x2b')],_0x612f84['filters']),_0x44b8a6);if(_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x37')]){_0x180707[_0x494a('0x35')]=_[_0x494a('0x38')](_0x180707[_0x494a('0x35')],{'$or':_[_0x494a('0x27')](_0x44b8a6,function(_0x55ab20){if(_0x55ab20[_0x494a('0x39')]!=='VIRTUAL'){var _0x222390={};_0x222390[_0x55ab20[_0x494a('0x25')]]={'$like':'%'+_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x37')]+'%'};return _0x222390;}})});}_0x180707=_[_0x494a('0x38')]({},_0x180707,_0x4cb6d9[_0x494a('0x3a')]);var _0x3a13ed={'where':_0x180707[_0x494a('0x35')]};return db[_0x494a('0x3b')][_0x494a('0x1c')](_0x3a13ed)[_0x494a('0x21')](function(_0x59c216){_0x3999b5['count']=_0x59c216;if(_0x4cb6d9[_0x494a('0x2b')][_0x494a('0x3c')]){_0x180707[_0x494a('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x494a('0x3e')](_0x180707);})[_0x494a('0x21')](function(_0x881ba7){_0x3999b5[_0x494a('0x3f')]=_0x881ba7;return _0x3999b5;})[_0x494a('0x21')](respondWithFilteredResult(_0x15cf3a,_0x180707))['catch'](handleError(_0x15cf3a,null));};exports[_0x494a('0x40')]=function(_0x38354e,_0x355dbe){var _0x3b9c63={'raw':![],'where':{'id':_0x38354e[_0x494a('0x41')]['id']}},_0x4b8964={};_0x4b8964['model']=_[_0x494a('0x2c')](db['AnalyticFieldReport'][_0x494a('0x42')]);_0x4b8964[_0x494a('0x2b')]=_[_0x494a('0x2c')](_0x38354e['query']);_0x4b8964[_0x494a('0x2d')]=_['intersection'](_0x4b8964[_0x494a('0x2a')],_0x4b8964['query']);_0x3b9c63['attributes']=_[_0x494a('0x2e')](_0x4b8964[_0x494a('0x2a')],qs['fields'](_0x38354e[_0x494a('0x2b')][_0x494a('0x30')]));_0x3b9c63[_0x494a('0x2f')]=_0x3b9c63[_0x494a('0x2f')][_0x494a('0x31')]?_0x3b9c63[_0x494a('0x2f')]:_0x4b8964[_0x494a('0x2a')];if(_0x38354e[_0x494a('0x2b')][_0x494a('0x3c')]){_0x3b9c63['include']=[{'all':!![]}];}_0x3b9c63=_[_0x494a('0x38')]({},_0x3b9c63,_0x38354e[_0x494a('0x3a')]);return db['AnalyticFieldReport'][_0x494a('0x43')](_0x3b9c63)['then'](handleEntityNotFound(_0x355dbe,null))[_0x494a('0x21')](respondWithResult(_0x355dbe,null))[_0x494a('0x44')](handleError(_0x355dbe,null));};exports[_0x494a('0x45')]=function(_0x5d4fb6,_0x597e16){return db[_0x494a('0x3b')][_0x494a('0x45')](_0x5d4fb6[_0x494a('0x46')],{})[_0x494a('0x21')](respondWithResult(_0x597e16,0xc9))['catch'](handleError(_0x597e16,null));};exports['bulkCreate']=function(_0x4730f0,_0x53e936){return db['AnalyticFieldReport'][_0x494a('0x47')](_0x4730f0[_0x494a('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x53e936,0xc9))[_0x494a('0x44')](handleError(_0x53e936,null));};exports[_0x494a('0x48')]=function(_0x4c3b4e,_0x1b8575){if(_0x4c3b4e[_0x494a('0x46')]['id']){delete _0x4c3b4e['body']['id'];}return db[_0x494a('0x3b')][_0x494a('0x43')]({'where':{'id':_0x4c3b4e[_0x494a('0x41')]['id']}})[_0x494a('0x21')](handleEntityNotFound(_0x1b8575,null))[_0x494a('0x21')](saveUpdates(_0x4c3b4e[_0x494a('0x46')],null))[_0x494a('0x21')](respondWithResult(_0x1b8575,null))[_0x494a('0x44')](handleError(_0x1b8575,null));};exports[_0x494a('0x49')]=function(_0x525427,_0x1aa262){return db[_0x494a('0x3b')][_0x494a('0x43')]({'where':{'id':_0x525427[_0x494a('0x41')]['id']}})[_0x494a('0x21')](handleEntityNotFound(_0x1aa262,null))[_0x494a('0x21')](removeEntity(_0x1aa262,null))[_0x494a('0x44')](handleError(_0x1aa262,null));};exports['bulkDestroy']=function(_0x2b53f6,_0x363c4f){return db[_0x494a('0x3b')]['destroy']({'where':{'id':_0x2b53f6[_0x494a('0x2b')][_0x494a('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x494a('0x21')](respondWithResult(_0x363c4f,0xcc))[_0x494a('0x44')](handleError(_0x363c4f,null));};exports['addFields']=function(_0x290542,_0x868fcb,_0x2738b2){return db[_0x494a('0x4b')][_0x494a('0x4c')]({'where':{'id':_0x290542[_0x494a('0x41')]['id']}})[_0x494a('0x21')](handleEntityNotFound(_0x868fcb,null))['then'](function(_0x4fa0f5){if(_0x4fa0f5){return db['sequelize'][_0x494a('0x4d')](function(_0x54f423){return db[_0x494a('0x3b')][_0x494a('0x49')]({'where':{'CustomReportId':_0x290542[_0x494a('0x41')]['id']},'transaction':_0x54f423})[_0x494a('0x21')](function(_0x32370b){var _0x284b54=_[_0x494a('0x27')](_0x290542[_0x494a('0x46')],function(_0x4ded60){delete _0x4ded60['id'];_0x4ded60[_0x494a('0x4e')]=_0x290542[_0x494a('0x41')]['id'];return _0x4ded60;});return db[_0x494a('0x3b')][_0x494a('0x47')](_0x284b54,{'transaction':_0x54f423});});})['then'](function(){return db[_0x494a('0x3b')][_0x494a('0x3e')]({'where':{'CustomReportId':_0x290542['params']['id']}});});}})[_0x494a('0x21')](respondWithResult(_0x868fcb,null))[_0x494a('0x44')](handleError(_0x868fcb,null));}; \ No newline at end of file +var _0x50ea=['VIRTUAL','merge','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','count','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','where'];(function(_0x1d2e01,_0x30e8aa){var _0x36bc23=function(_0x59613c){while(--_0x59613c){_0x1d2e01['push'](_0x1d2e01['shift']());}};_0x36bc23(++_0x30e8aa);}(_0x50ea,0x1ca));var _0xa50e=function(_0xff7bd7,_0x1eef65){_0xff7bd7=_0xff7bd7-0x0;var _0x2b9786=_0x50ea[_0xff7bd7];return _0x2b9786;};'use strict';var emlformat=require(_0xa50e('0x0'));var rimraf=require(_0xa50e('0x1'));var zipdir=require(_0xa50e('0x2'));var jsonpatch=require(_0xa50e('0x3'));var rp=require(_0xa50e('0x4'));var moment=require(_0xa50e('0x5'));var BPromise=require(_0xa50e('0x6'));var Mustache=require(_0xa50e('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa50e('0x8'));var csv=require(_0xa50e('0x9'));var ejs=require(_0xa50e('0xa'));var fs=require('fs');var fs_extra=require(_0xa50e('0xb'));var _=require(_0xa50e('0xc'));var squel=require(_0xa50e('0xd'));var crypto=require(_0xa50e('0xe'));var jsforce=require(_0xa50e('0xf'));var deskjs=require(_0xa50e('0x10'));var toCsv=require(_0xa50e('0x9'));var querystring=require(_0xa50e('0x11'));var Papa=require(_0xa50e('0x12'));var Redis=require(_0xa50e('0x13'));var authService=require(_0xa50e('0x14'));var qs=require(_0xa50e('0x15'));var as=require(_0xa50e('0x16'));var hardwareService=require(_0xa50e('0x17'));var logger=require(_0xa50e('0x18'))(_0xa50e('0x19'));var utils=require(_0xa50e('0x1a'));var config=require(_0xa50e('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa50e('0x1c'))['db'];function respondWithStatusCode(_0x29c414,_0xc2d654){_0xc2d654=_0xc2d654||0xcc;return function(_0xf3d641){if(_0xf3d641){return _0x29c414[_0xa50e('0x1d')](_0xc2d654);}return _0x29c414[_0xa50e('0x1e')](_0xc2d654)['end']();};}function respondWithResult(_0x289b5b,_0x5650fb){_0x5650fb=_0x5650fb||0xc8;return function(_0x11e8d){if(_0x11e8d){return _0x289b5b['status'](_0x5650fb)[_0xa50e('0x1f')](_0x11e8d);}};}function respondWithFilteredResult(_0xcac5f0,_0x4f6d9b){return function(_0x2c9945){if(_0x2c9945){var _0x3627cc=typeof _0x4f6d9b[_0xa50e('0x20')]==='undefined'&&typeof _0x4f6d9b['limit']==='undefined';var _0x35edc4=_0x2c9945[_0xa50e('0x21')];var _0x48a610=_0x3627cc?0x0:_0x4f6d9b['offset'];var _0x2c25c3=_0x3627cc?_0x2c9945[_0xa50e('0x21')]:_0x4f6d9b[_0xa50e('0x20')]+_0x4f6d9b['limit'];var _0x343174;if(_0x2c25c3>=_0x35edc4){_0x2c25c3=_0x35edc4;_0x343174=0xc8;}else{_0x343174=0xce;}_0xcac5f0['status'](_0x343174);return _0xcac5f0['set'](_0xa50e('0x22'),_0x48a610+'-'+_0x2c25c3+'/'+_0x35edc4)[_0xa50e('0x1f')](_0x2c9945);}return null;};}function patchUpdates(_0x80ff38){return function(_0x481f36){try{jsonpatch[_0xa50e('0x23')](_0x481f36,_0x80ff38,!![]);}catch(_0x5b4d66){return BPromise[_0xa50e('0x24')](_0x5b4d66);}return _0x481f36[_0xa50e('0x25')]();};}function saveUpdates(_0x222115,_0x1753ae){return function(_0x3ecfa7){if(_0x3ecfa7){return _0x3ecfa7['update'](_0x222115)[_0xa50e('0x26')](function(_0xff0918){return _0xff0918;});}return null;};}function removeEntity(_0x37724f,_0x1369bc){return function(_0xbb3cc3){if(_0xbb3cc3){return _0xbb3cc3[_0xa50e('0x27')]()['then'](function(){_0x37724f['status'](0xcc)[_0xa50e('0x28')]();});}};}function handleEntityNotFound(_0x2cc0ac,_0xbb3463){return function(_0xbde460){if(!_0xbde460){_0x2cc0ac['sendStatus'](0x194);}return _0xbde460;};}function handleError(_0x22902c,_0x5adacc){_0x5adacc=_0x5adacc||0x1f4;return function(_0x1b10a2){logger['error'](_0x1b10a2[_0xa50e('0x29')]);if(_0x1b10a2[_0xa50e('0x2a')]){delete _0x1b10a2[_0xa50e('0x2a')];}_0x22902c['status'](_0x5adacc)[_0xa50e('0x2b')](_0x1b10a2);};}exports['index']=function(_0x79e5ab,_0x2c2299){var _0x48a530={},_0x419253={},_0x121682={'count':0x0,'rows':[]};var _0x5c4d4f=_['map'](db[_0xa50e('0x2c')][_0xa50e('0x2d')],function(_0x320ff8){return{'name':_0x320ff8[_0xa50e('0x2e')],'type':_0x320ff8[_0xa50e('0x2f')][_0xa50e('0x30')]};});_0x419253['model']=_[_0xa50e('0x31')](_0x5c4d4f,'name');_0x419253['query']=_[_0xa50e('0x32')](_0x79e5ab[_0xa50e('0x33')]);_0x419253['filters']=_[_0xa50e('0x34')](_0x419253[_0xa50e('0x35')],_0x419253[_0xa50e('0x33')]);_0x48a530[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x419253['model'],qs['fields'](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x37')]));_0x48a530['attributes']=_0x48a530['attributes'][_0xa50e('0x38')]?_0x48a530[_0xa50e('0x36')]:_0x419253[_0xa50e('0x35')];if(!_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x39')](_0xa50e('0x3a'))){_0x48a530[_0xa50e('0x3b')]=qs[_0xa50e('0x3b')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3b')]);_0x48a530[_0xa50e('0x20')]=qs[_0xa50e('0x20')](_0x79e5ab[_0xa50e('0x33')]['offset']);}_0x48a530['order']=qs[_0xa50e('0x3c')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3c')]);_0x48a530['where']=qs[_0xa50e('0x3d')](_[_0xa50e('0x3e')](_0x79e5ab['query'],_0x419253[_0xa50e('0x3d')]),_0x5c4d4f);if(_0x79e5ab['query']['filter']){_0x48a530[_0xa50e('0x3f')]=_['merge'](_0x48a530[_0xa50e('0x3f')],{'$or':_[_0xa50e('0x31')](_0x5c4d4f,function(_0xab6230){if(_0xab6230[_0xa50e('0x2f')]!==_0xa50e('0x40')){var _0x54e236={};_0x54e236[_0xab6230[_0xa50e('0x2a')]]={'$like':'%'+_0x79e5ab[_0xa50e('0x33')]['filter']+'%'};return _0x54e236;}})});}_0x48a530=_[_0xa50e('0x41')]({},_0x48a530,_0x79e5ab[_0xa50e('0x42')]);var _0x1894f6={'where':_0x48a530['where']};return db[_0xa50e('0x2c')][_0xa50e('0x21')](_0x1894f6)[_0xa50e('0x26')](function(_0x4dcd23){_0x121682['count']=_0x4dcd23;if(_0x79e5ab[_0xa50e('0x33')]['includeAll']){_0x48a530['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa50e('0x43')](_0x48a530);})[_0xa50e('0x26')](function(_0x46d0dd){_0x121682[_0xa50e('0x44')]=_0x46d0dd;return _0x121682;})[_0xa50e('0x26')](respondWithFilteredResult(_0x2c2299,_0x48a530))['catch'](handleError(_0x2c2299,null));};exports[_0xa50e('0x45')]=function(_0x293d26,_0x876dc3){var _0x3a7acc={'raw':![],'where':{'id':_0x293d26[_0xa50e('0x46')]['id']}},_0x69713a={};_0x69713a['model']=_[_0xa50e('0x32')](db['AnalyticFieldReport'][_0xa50e('0x2d')]);_0x69713a[_0xa50e('0x33')]=_['keys'](_0x293d26[_0xa50e('0x33')]);_0x69713a[_0xa50e('0x3d')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],_0x69713a['query']);_0x3a7acc[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],qs[_0xa50e('0x37')](_0x293d26[_0xa50e('0x33')]['fields']));_0x3a7acc[_0xa50e('0x36')]=_0x3a7acc[_0xa50e('0x36')][_0xa50e('0x38')]?_0x3a7acc[_0xa50e('0x36')]:_0x69713a[_0xa50e('0x35')];if(_0x293d26[_0xa50e('0x33')][_0xa50e('0x47')]){_0x3a7acc[_0xa50e('0x48')]=[{'all':!![]}];}_0x3a7acc=_['merge']({},_0x3a7acc,_0x293d26[_0xa50e('0x42')]);return db[_0xa50e('0x2c')][_0xa50e('0x49')](_0x3a7acc)[_0xa50e('0x26')](handleEntityNotFound(_0x876dc3,null))[_0xa50e('0x26')](respondWithResult(_0x876dc3,null))[_0xa50e('0x4a')](handleError(_0x876dc3,null));};exports[_0xa50e('0x4b')]=function(_0x3b9e63,_0x2a8054){return db[_0xa50e('0x2c')][_0xa50e('0x4b')](_0x3b9e63[_0xa50e('0x4c')],{})[_0xa50e('0x26')](respondWithResult(_0x2a8054,0xc9))[_0xa50e('0x4a')](handleError(_0x2a8054,null));};exports[_0xa50e('0x4d')]=function(_0x5a35f6,_0x2cf481){return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x5a35f6[_0xa50e('0x4c')],{'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x2cf481,0xc9))[_0xa50e('0x4a')](handleError(_0x2cf481,null));};exports[_0xa50e('0x4e')]=function(_0x189b54,_0x556438){if(_0x189b54[_0xa50e('0x4c')]['id']){delete _0x189b54[_0xa50e('0x4c')]['id'];}return db[_0xa50e('0x2c')][_0xa50e('0x49')]({'where':{'id':_0x189b54[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x556438,null))[_0xa50e('0x26')](saveUpdates(_0x189b54[_0xa50e('0x4c')],null))[_0xa50e('0x26')](respondWithResult(_0x556438,null))['catch'](handleError(_0x556438,null));};exports[_0xa50e('0x27')]=function(_0x29192a,_0x32c7bc){return db[_0xa50e('0x2c')]['find']({'where':{'id':_0x29192a[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x32c7bc,null))[_0xa50e('0x26')](removeEntity(_0x32c7bc,null))['catch'](handleError(_0x32c7bc,null));};exports[_0xa50e('0x4f')]=function(_0x14d619,_0x3f51cd){return db[_0xa50e('0x2c')]['destroy']({'where':{'id':_0x14d619['query'][_0xa50e('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x3f51cd,0xcc))[_0xa50e('0x4a')](handleError(_0x3f51cd,null));};exports[_0xa50e('0x51')]=function(_0x15c874,_0x490c58,_0x6f533c){return db[_0xa50e('0x52')][_0xa50e('0x53')]({'where':{'id':_0x15c874[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x490c58,null))[_0xa50e('0x26')](function(_0x243539){if(_0x243539){return db[_0xa50e('0x54')][_0xa50e('0x55')](function(_0x311c3e){return db[_0xa50e('0x2c')][_0xa50e('0x27')]({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']},'transaction':_0x311c3e})['then'](function(_0x35e11f){var _0x218760=_[_0xa50e('0x31')](_0x15c874[_0xa50e('0x4c')],function(_0x392682){delete _0x392682['id'];_0x392682[_0xa50e('0x56')]=_0x15c874['params']['id'];return _0x392682;});return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x218760,{'transaction':_0x311c3e});});})[_0xa50e('0x26')](function(){return db[_0xa50e('0x2c')]['findAll']({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']}});});}})['then'](respondWithResult(_0x490c58,null))['catch'](handleError(_0x490c58,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3dfde1d..bf4019f 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 _0x3045=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x580f59,_0x4ae4de){var _0x4095ba=function(_0x3ec1d3){while(--_0x3ec1d3){_0x580f59['push'](_0x580f59['shift']());}};_0x4095ba(++_0x4ae4de);}(_0x3045,0x1d2));var _0x5304=function(_0x56972f,_0x59e239){_0x56972f=_0x56972f-0x0;var _0x3c9258=_0x3045[_0x56972f];return _0x3c9258;};'use strict';var _=require(_0x5304('0x0'));var util=require(_0x5304('0x1'));var logger=require(_0x5304('0x2'))('api');var moment=require(_0x5304('0x3'));var BPromise=require(_0x5304('0x4'));var rp=require(_0x5304('0x5'));var fs=require('fs');var path=require(_0x5304('0x6'));var rimraf=require(_0x5304('0x7'));var config=require(_0x5304('0x8'));var attributes=require(_0x5304('0x9'));module[_0x5304('0xa')]=function(_0x31bea4,_0x1d3694){return _0x31bea4[_0x5304('0xb')](_0x5304('0xc'),attributes,{'tableName':_0x5304('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a1f=['analytics_report_fields','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x3f20d6,_0x3dd14c){var _0x3c8528=function(_0x3eb3f2){while(--_0x3eb3f2){_0x3f20d6['push'](_0x3f20d6['shift']());}};_0x3c8528(++_0x3dd14c);}(_0x5a1f,0x1e5));var _0xf5a1=function(_0x1a37e9,_0x506022){_0x1a37e9=_0x1a37e9-0x0;var _0x2dd1ad=_0x5a1f[_0x1a37e9];return _0x2dd1ad;};'use strict';var _=require(_0xf5a1('0x0'));var util=require(_0xf5a1('0x1'));var logger=require('../../config/logger')(_0xf5a1('0x2'));var moment=require(_0xf5a1('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a1('0x5'));var config=require(_0xf5a1('0x6'));var attributes=require(_0xf5a1('0x7'));module[_0xf5a1('0x8')]=function(_0x45c7c0,_0x1a63bf){return _0x45c7c0[_0xf5a1('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xf5a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index a28cfcb..3dadc4a 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 _0x34a4=['result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x32c8ed,_0x45fef2){var _0x580764=function(_0xeb440e){while(--_0xeb440e){_0x32c8ed['push'](_0x32c8ed['shift']());}};_0x580764(++_0x45fef2);}(_0x34a4,0x1ba));var _0x434a=function(_0x362ad7,_0x948800){_0x362ad7=_0x362ad7-0x0;var _0x54703b=_0x34a4[_0x362ad7];return _0x54703b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x434a('0x0'));var BPromise=require(_0x434a('0x1'));var rs=require(_0x434a('0x2'));var fs=require('fs');var Redis=require(_0x434a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x434a('0x4'));var logger=require(_0x434a('0x5'))('rpc');var config=require(_0x434a('0x6'));var jayson=require(_0x434a('0x7'));var client=jayson[_0x434a('0x8')][_0x434a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29fc6f,_0x505755,_0xd29c36){return new BPromise(function(_0x16d622,_0x12cace){return client['request'](_0x29fc6f,_0xd29c36)[_0x434a('0xa')](function(_0x1941a4){logger[_0x434a('0xb')](_0x434a('0xc'),_0x505755,'request\x20sent');logger[_0x434a('0xd')](_0x434a('0xe'),_0x505755,_0x434a('0xf'),JSON[_0x434a('0x10')](_0x1941a4));if(_0x1941a4[_0x434a('0x11')]){if(_0x1941a4[_0x434a('0x11')][_0x434a('0x12')]===0x1f4){logger[_0x434a('0x11')](_0x434a('0xc'),_0x505755,_0x1941a4[_0x434a('0x11')]['message']);return _0x12cace(_0x1941a4[_0x434a('0x11')][_0x434a('0x13')]);}logger[_0x434a('0x11')](_0x434a('0xc'),_0x505755,_0x1941a4[_0x434a('0x11')][_0x434a('0x13')]);return _0x16d622(_0x1941a4[_0x434a('0x11')]['message']);}else{logger[_0x434a('0xb')](_0x434a('0xc'),_0x505755,_0x434a('0xf'));_0x16d622(_0x1941a4[_0x434a('0x14')][_0x434a('0x13')]);}})['catch'](function(_0xa6e2bb){logger[_0x434a('0x11')](_0x434a('0xc'),_0x505755,_0xa6e2bb);_0x12cace(_0xa6e2bb);});});} \ No newline at end of file +var _0x8bba=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x2738d5,_0x2a6f42){var _0x5c92db=function(_0x4a50fe){while(--_0x4a50fe){_0x2738d5['push'](_0x2738d5['shift']());}};_0x5c92db(++_0x2a6f42);}(_0x8bba,0x18e));var _0xa8bb=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x8bba[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xa8bb('0x0'));var util=require(_0xa8bb('0x1'));var moment=require(_0xa8bb('0x2'));var BPromise=require(_0xa8bb('0x3'));var rs=require(_0xa8bb('0x4'));var fs=require('fs');var Redis=require(_0xa8bb('0x5'));var db=require(_0xa8bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa8bb('0x7'));var config=require(_0xa8bb('0x8'));var jayson=require(_0xa8bb('0x9'));var client=jayson['client'][_0xa8bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9fe735,_0x2bdae2,_0x3afeb4){return new BPromise(function(_0x3d3196,_0x520669){return client[_0xa8bb('0xb')](_0x9fe735,_0x3afeb4)['then'](function(_0x78ff08){logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));logger[_0xa8bb('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2bdae2,_0xa8bb('0xe'),JSON[_0xa8bb('0x10')](_0x78ff08));if(_0x78ff08['error']){if(_0x78ff08['error'][_0xa8bb('0x11')]===0x1f4){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x520669(_0x78ff08['error']['message']);}logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x3d3196(_0x78ff08['error'][_0xa8bb('0x13')]);}else{logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));_0x3d3196(_0x78ff08[_0xa8bb('0x14')]['message']);}})[_0xa8bb('0x15')](function(_0x5ba952){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x5ba952);_0x520669(_0x5ba952);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 946ca3e..fb22be2 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(_0x331604,_0x577eb3){var _0x45829d=function(_0x256517){while(--_0x256517){_0x331604['push'](_0x331604['shift']());}};_0x45829d(++_0x577eb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x139a94,_0x7a7ac2){var _0x4f259e=function(_0xdf86fe){while(--_0xdf86fe){_0x139a94['push'](_0x139a94['shift']());}};_0x4f259e(++_0x7a7ac2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 447d1dd..7b0b355 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 _0x23a3=['TEXT','STRING','name'];(function(_0x2f398d,_0x41c205){var _0x383fd5=function(_0x1cbc4b){while(--_0x1cbc4b){_0x2f398d['push'](_0x2f398d['shift']());}};_0x383fd5(++_0x41c205);}(_0x23a3,0x131));var _0x323a=function(_0x2fcaa3,_0x2ba904){_0x2fcaa3=_0x2fcaa3-0x0;var _0x8f4089=_0x23a3[_0x2fcaa3];return _0x8f4089;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x323a('0x0')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x323a('0x1')]},'description':{'type':Sequelize[_0x323a('0x2')]}}; \ No newline at end of file +var _0xa062=['TEXT','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa062,0x101));var _0x2a06=function(_0x3f75d7,_0x22bab8){_0x3f75d7=_0x3f75d7-0x0;var _0x26fb16=_0xa062[_0x3f75d7];return _0x26fb16;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'name':{'type':Sequelize[_0x2a06('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2a06('0x2')]},'metric':{'type':Sequelize[_0x2a06('0x3')]},'description':{'type':Sequelize[_0x2a06('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index c8e18a2..0ff2bab 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4f15ec,_0x5b25fd){var _0x1c1548=function(_0x580618){while(--_0x580618){_0x4f15ec['push'](_0x4f15ec['shift']());}};_0x1c1548(++_0x5b25fd);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x535963,_0x326515){_0x535963=_0x535963-0x0;var _0x3975f6=_0x7fbe[_0x535963];return _0x3975f6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file +var _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x6aa7,0x178));var _0x76aa=function(_0x2d3f23,_0x2bf9f7){_0x2d3f23=_0x2d3f23-0x0;var _0x244ced=_0x6aa7[_0x2d3f23];return _0x244ced;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index ca3ea5c..39590e9 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 _0xea31=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','analytics_metrics','lodash'];(function(_0x4d9820,_0x2c08f6){var _0x491cc2=function(_0x3cba49){while(--_0x3cba49){_0x4d9820['push'](_0x4d9820['shift']());}};_0x491cc2(++_0x2c08f6);}(_0xea31,0x6b));var _0x1ea3=function(_0x1e7e0f,_0x4f355){_0x1e7e0f=_0x1e7e0f-0x0;var _0x3ee999=_0xea31[_0x1e7e0f];return _0x3ee999;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var logger=require(_0x1ea3('0x1'))(_0x1ea3('0x2'));var moment=require(_0x1ea3('0x3'));var BPromise=require(_0x1ea3('0x4'));var rp=require(_0x1ea3('0x5'));var fs=require('fs');var path=require(_0x1ea3('0x6'));var rimraf=require(_0x1ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ea3('0x8'));module[_0x1ea3('0x9')]=function(_0x6810da,_0x27c695){return _0x6810da[_0x1ea3('0xa')]('AnalyticMetric',attributes,{'tableName':_0x1ea3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28b1=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./analyticMetric.attributes','AnalyticMetric','analytics_metrics'];(function(_0x1a4bc0,_0x31747f){var _0x3c11e6=function(_0x4e5af6){while(--_0x4e5af6){_0x1a4bc0['push'](_0x1a4bc0['shift']());}};_0x3c11e6(++_0x31747f);}(_0x28b1,0x1d6));var _0x128b=function(_0x49f42f,_0x4f3ce7){_0x49f42f=_0x49f42f-0x0;var _0x40368b=_0x28b1[_0x49f42f];return _0x40368b;};'use strict';var _=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var logger=require(_0x128b('0x2'))('api');var moment=require(_0x128b('0x3'));var BPromise=require(_0x128b('0x4'));var rp=require(_0x128b('0x5'));var fs=require('fs');var path=require(_0x128b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x128b('0x7'));module['exports']=function(_0x5c3ceb,_0x3699d5){return _0x5c3ceb['define'](_0x128b('0x8'),attributes,{'tableName':_0x128b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 931db8c..4f53eb6 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 _0x15af=['error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x1701e5,_0x7f9087){var _0x4ffbba=function(_0x40f73f){while(--_0x40f73f){_0x1701e5['push'](_0x1701e5['shift']());}};_0x4ffbba(++_0x7f9087);}(_0x15af,0xb9));var _0xf15a=function(_0x2d4661,_0x2da65c){_0x2d4661=_0x2d4661-0x0;var _0x42ed1e=_0x15af[_0x2d4661];return _0x42ed1e;};'use strict';var _=require('lodash');var util=require(_0xf15a('0x0'));var moment=require(_0xf15a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf15a('0x2'));var fs=require('fs');var Redis=require(_0xf15a('0x3'));var db=require(_0xf15a('0x4'))['db'];var utils=require(_0xf15a('0x5'));var logger=require(_0xf15a('0x6'))('rpc');var config=require(_0xf15a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf15a('0x8')][_0xf15a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x225fbe,_0x35777c,_0x38e403){return new BPromise(function(_0x138a68,_0x54ff2c){return client[_0xf15a('0xa')](_0x225fbe,_0x38e403)[_0xf15a('0xb')](function(_0x31ba28){logger[_0xf15a('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x35777c,_0xf15a('0xd'));logger['debug'](_0xf15a('0xe'),_0x35777c,_0xf15a('0xd'),JSON['stringify'](_0x31ba28));if(_0x31ba28[_0xf15a('0xf')]){if(_0x31ba28[_0xf15a('0xf')]['code']===0x1f4){logger[_0xf15a('0xf')](_0xf15a('0x10'),_0x35777c,_0x31ba28[_0xf15a('0xf')]['message']);return _0x54ff2c(_0x31ba28[_0xf15a('0xf')][_0xf15a('0x11')]);}logger[_0xf15a('0xf')](_0xf15a('0x10'),_0x35777c,_0x31ba28[_0xf15a('0xf')][_0xf15a('0x11')]);return _0x138a68(_0x31ba28[_0xf15a('0xf')][_0xf15a('0x11')]);}else{logger['info'](_0xf15a('0x10'),_0x35777c,_0xf15a('0xd'));_0x138a68(_0x31ba28[_0xf15a('0x12')][_0xf15a('0x11')]);}})[_0xf15a('0x13')](function(_0x2e200d){logger[_0xf15a('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x35777c,_0x2e200d);_0x54ff2c(_0x2e200d);});});} \ No newline at end of file +var _0x0c2c=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x52d39a,_0x242577){var _0x8344a=function(_0x1d197a){while(--_0x1d197a){_0x52d39a['push'](_0x52d39a['shift']());}};_0x8344a(++_0x242577);}(_0x0c2c,0x1bd));var _0xc0c2=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0c2c[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xc0c2('0x0'));var util=require('util');var moment=require(_0xc0c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0c2('0x2'));var fs=require('fs');var Redis=require(_0xc0c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0c2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0c2('0x5'));var jayson=require(_0xc0c2('0x6'));var client=jayson[_0xc0c2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497bc3,_0x558aeb,_0x19998b){return new BPromise(function(_0x5a4ab6,_0x4b59d5){return client[_0xc0c2('0x8')](_0x497bc3,_0x19998b)[_0xc0c2('0x9')](function(_0x26ed3f){logger[_0xc0c2('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x558aeb,_0xc0c2('0xb'));logger[_0xc0c2('0xc')](_0xc0c2('0xd'),_0x558aeb,_0xc0c2('0xb'),JSON[_0xc0c2('0xe')](_0x26ed3f));if(_0x26ed3f['error']){if(_0x26ed3f[_0xc0c2('0xf')]['code']===0x1f4){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x4b59d5(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x5a4ab6(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}else{logger[_0xc0c2('0xa')](_0xc0c2('0x10'),_0x558aeb,'request\x20sent');_0x5a4ab6(_0x26ed3f['result']['message']);}})[_0xc0c2('0x12')](function(_0x188e6c){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x188e6c);_0x4b59d5(_0x188e6c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0bc5310..0176ba5 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 _0xfd6e=['create','put','update','delete','destroy','exports','multer','path','express','Router','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x5a558e,_0x2c0473){var _0x44eb26=function(_0x1841b4){while(--_0x1841b4){_0x5a558e['push'](_0x5a558e['shift']());}};_0x44eb26(++_0x2c0473);}(_0xfd6e,0x16e));var _0xefd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfd6e[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xefd6('0x0'));var util=require('util');var path=require(_0xefd6('0x1'));var timeout=require('connect-timeout');var express=require(_0xefd6('0x2'));var router=express[_0xefd6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xefd6('0x4'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xefd6('0x5')](),controller[_0xefd6('0x6')]);router[_0xefd6('0x7')](_0xefd6('0x8'),auth[_0xefd6('0x5')](),controller['show']);router['post']('/',auth[_0xefd6('0x5')](),controller[_0xefd6('0x9')]);router[_0xefd6('0xa')]('/:id',auth[_0xefd6('0x5')](),controller[_0xefd6('0xb')]);router[_0xefd6('0xc')](_0xefd6('0x8'),auth['isAuthenticated'](),controller[_0xefd6('0xd')]);module[_0xefd6('0xe')]=router; \ No newline at end of file +var _0xec46=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x6d7446,_0x179e0e){var _0x6bf1a=function(_0x1b8eb9){while(--_0x1b8eb9){_0x6d7446['push'](_0x6d7446['shift']());}};_0x6bf1a(++_0x179e0e);}(_0xec46,0x19c));var _0x6ec4=function(_0x267d66,_0xe313d1){_0x267d66=_0x267d66-0x0;var _0x1742be=_0xec46[_0x267d66];return _0x1742be;};'use strict';var multer=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var path=require(_0x6ec4('0x2'));var timeout=require(_0x6ec4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ec4('0x4'));var auth=require(_0x6ec4('0x5'));var interaction=require(_0x6ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x6ec4('0x7'));router[_0x6ec4('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ec4('0x9')]);router['get'](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xc')]);router[_0x6ec4('0xd')]('/',auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xe')]);router[_0x6ec4('0xf')](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0x10')]);router[_0x6ec4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6ec4('0x12')]);module[_0x6ec4('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 96f89d0..a47d0ea 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 _0xf318=['exports','sequelize'];(function(_0x209547,_0x34e21d){var _0x2050c1=function(_0x57b26e){while(--_0x57b26e){_0x209547['push'](_0x209547['shift']());}};_0x2050c1(++_0x34e21d);}(_0xf318,0x89));var _0x8f31=function(_0x30de0f,_0x4decdb){_0x30de0f=_0x30de0f-0x0;var _0x5b1808=_0xf318[_0x30de0f];return _0x5b1808;};'use strict';var Sequelize=require(_0x8f31('0x0'));module[_0x8f31('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x1e69=['TEXT','exports'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x1e69,0x85));var _0x91e6=function(_0x2c6991,_0x4b5775){_0x2c6991=_0x2c6991-0x0;var _0x4de9fa=_0x1e69[_0x2c6991];return _0x4de9fa;};'use strict';var Sequelize=require('sequelize');module[_0x91e6('0x0')]={'tree':{'type':Sequelize[_0x91e6('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index db72356..29e583a 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 _0xc0da=['save','update','then','error','stack','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','name','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x4f129d,_0x326a68){var _0x11bf8e=function(_0x50af32){while(--_0x50af32){_0x4f129d['push'](_0x4f129d['shift']());}};_0x11bf8e(++_0x326a68);}(_0xc0da,0xc2));var _0xac0d=function(_0x2be66f,_0x3c4c29){_0x2be66f=_0x2be66f-0x0;var _0x403664=_0xc0da[_0x2be66f];return _0x403664;};'use strict';var emlformat=require(_0xac0d('0x0'));var rimraf=require(_0xac0d('0x1'));var zipdir=require(_0xac0d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac0d('0x3'));var moment=require(_0xac0d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac0d('0x5'));var util=require(_0xac0d('0x6'));var path=require(_0xac0d('0x7'));var sox=require(_0xac0d('0x8'));var csv=require(_0xac0d('0x9'));var ejs=require(_0xac0d('0xa'));var fs=require('fs');var fs_extra=require(_0xac0d('0xb'));var _=require(_0xac0d('0xc'));var squel=require(_0xac0d('0xd'));var crypto=require(_0xac0d('0xe'));var jsforce=require(_0xac0d('0xf'));var deskjs=require(_0xac0d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xac0d('0x11'));var Redis=require(_0xac0d('0x12'));var authService=require(_0xac0d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac0d('0x14'));var logger=require(_0xac0d('0x15'))('api');var utils=require(_0xac0d('0x16'));var config=require(_0xac0d('0x17'));var licenseUtil=require(_0xac0d('0x18'));var db=require(_0xac0d('0x19'))['db'];function respondWithStatusCode(_0x2fe7c0,_0x4a7cb1){_0x4a7cb1=_0x4a7cb1||0xcc;return function(_0x211014){if(_0x211014){return _0x2fe7c0[_0xac0d('0x1a')](_0x4a7cb1);}return _0x2fe7c0[_0xac0d('0x1b')](_0x4a7cb1)[_0xac0d('0x1c')]();};}function respondWithResult(_0x2fa189,_0x58a18d){_0x58a18d=_0x58a18d||0xc8;return function(_0xf139b9){if(_0xf139b9){return _0x2fa189[_0xac0d('0x1b')](_0x58a18d)[_0xac0d('0x1d')](_0xf139b9);}};}function respondWithFilteredResult(_0xfe21ec,_0x1309d){return function(_0x75cccf){if(_0x75cccf){var _0x46feb7=typeof _0x1309d['offset']===_0xac0d('0x1e')&&typeof _0x1309d[_0xac0d('0x1f')]===_0xac0d('0x1e');var _0x232bdb=_0x75cccf[_0xac0d('0x20')];var _0x4167b6=_0x46feb7?0x0:_0x1309d[_0xac0d('0x21')];var _0x220a01=_0x46feb7?_0x75cccf['count']:_0x1309d[_0xac0d('0x21')]+_0x1309d['limit'];var _0x534ce5;if(_0x220a01>=_0x232bdb){_0x220a01=_0x232bdb;_0x534ce5=0xc8;}else{_0x534ce5=0xce;}_0xfe21ec[_0xac0d('0x1b')](_0x534ce5);return _0xfe21ec['set'](_0xac0d('0x22'),_0x4167b6+'-'+_0x220a01+'/'+_0x232bdb)[_0xac0d('0x1d')](_0x75cccf);}return null;};}function patchUpdates(_0x4ec3d3){return function(_0x3a74b1){try{jsonpatch[_0xac0d('0x23')](_0x3a74b1,_0x4ec3d3,!![]);}catch(_0x34f30c){return BPromise[_0xac0d('0x24')](_0x34f30c);}return _0x3a74b1[_0xac0d('0x25')]();};}function saveUpdates(_0x4af6bc,_0x4ea36c){return function(_0x533986){if(_0x533986){return _0x533986[_0xac0d('0x26')](_0x4af6bc)[_0xac0d('0x27')](function(_0x56e5ed){return _0x56e5ed;});}return null;};}function removeEntity(_0x423400,_0x319f78){return function(_0x54314e){if(_0x54314e){return _0x54314e['destroy']()[_0xac0d('0x27')](function(){_0x423400['status'](0xcc)[_0xac0d('0x1c')]();});}};}function handleEntityNotFound(_0x581cd0,_0x5d8a33){return function(_0x34e311){if(!_0x34e311){_0x581cd0[_0xac0d('0x1a')](0x194);}return _0x34e311;};}function handleError(_0x5a1bbd,_0x449146){_0x449146=_0x449146||0x1f4;return function(_0x427421){logger[_0xac0d('0x28')](_0x427421[_0xac0d('0x29')]);if(_0x427421['name']){delete _0x427421['name'];}_0x5a1bbd[_0xac0d('0x1b')](_0x449146)[_0xac0d('0x2a')](_0x427421);};}exports[_0xac0d('0x2b')]=function(_0x2ad332,_0x162284){var _0xcc6426={},_0x5f4202={},_0x56022f={'count':0x0,'rows':[]};var _0x2c77e9=_[_0xac0d('0x2c')](db[_0xac0d('0x2d')][_0xac0d('0x2e')],function(_0x44b219){return{'name':_0x44b219[_0xac0d('0x2f')],'type':_0x44b219[_0xac0d('0x30')]['key']};});_0x5f4202[_0xac0d('0x31')]=_['map'](_0x2c77e9,_0xac0d('0x32'));_0x5f4202[_0xac0d('0x33')]=_[_0xac0d('0x34')](_0x2ad332[_0xac0d('0x33')]);_0x5f4202['filters']=_[_0xac0d('0x35')](_0x5f4202[_0xac0d('0x31')],_0x5f4202[_0xac0d('0x33')]);_0xcc6426['attributes']=_[_0xac0d('0x35')](_0x5f4202['model'],qs['fields'](_0x2ad332[_0xac0d('0x33')][_0xac0d('0x36')]));_0xcc6426['attributes']=_0xcc6426[_0xac0d('0x37')][_0xac0d('0x38')]?_0xcc6426[_0xac0d('0x37')]:_0x5f4202['model'];if(!_0x2ad332[_0xac0d('0x33')]['hasOwnProperty'](_0xac0d('0x39'))){_0xcc6426[_0xac0d('0x1f')]=qs[_0xac0d('0x1f')](_0x2ad332[_0xac0d('0x33')][_0xac0d('0x1f')]);_0xcc6426[_0xac0d('0x21')]=qs[_0xac0d('0x21')](_0x2ad332[_0xac0d('0x33')][_0xac0d('0x21')]);}_0xcc6426[_0xac0d('0x3a')]=qs[_0xac0d('0x3b')](_0x2ad332['query'][_0xac0d('0x3b')]);_0xcc6426['where']=qs[_0xac0d('0x3c')](_[_0xac0d('0x3d')](_0x2ad332[_0xac0d('0x33')],_0x5f4202['filters']),_0x2c77e9);if(_0x2ad332[_0xac0d('0x33')][_0xac0d('0x3e')]){_0xcc6426[_0xac0d('0x3f')]=_[_0xac0d('0x40')](_0xcc6426[_0xac0d('0x3f')],{'$or':_[_0xac0d('0x2c')](_0x2c77e9,function(_0x5e4de5){if(_0x5e4de5[_0xac0d('0x30')]!==_0xac0d('0x41')){var _0x269e53={};_0x269e53[_0x5e4de5[_0xac0d('0x32')]]={'$like':'%'+_0x2ad332['query']['filter']+'%'};return _0x269e53;}})});}_0xcc6426=_[_0xac0d('0x40')]({},_0xcc6426,_0x2ad332[_0xac0d('0x42')]);var _0x2f2425={'where':_0xcc6426[_0xac0d('0x3f')]};return db[_0xac0d('0x2d')]['count'](_0x2f2425)[_0xac0d('0x27')](function(_0x960e7a){_0x56022f[_0xac0d('0x20')]=_0x960e7a;if(_0x2ad332['query']['includeAll']){_0xcc6426[_0xac0d('0x43')]=[{'all':!![]}];}return db[_0xac0d('0x2d')][_0xac0d('0x44')](_0xcc6426);})[_0xac0d('0x27')](function(_0xcd5a9b){_0x56022f[_0xac0d('0x45')]=_0xcd5a9b;return _0x56022f;})[_0xac0d('0x27')](respondWithFilteredResult(_0x162284,_0xcc6426))[_0xac0d('0x46')](handleError(_0x162284,null));};exports[_0xac0d('0x47')]=function(_0x1b1f0b,_0x534367){var _0x3bc74f={'raw':!![],'where':{'id':_0x1b1f0b[_0xac0d('0x48')]['id']}},_0x157198={};_0x157198['model']=_[_0xac0d('0x34')](db[_0xac0d('0x2d')][_0xac0d('0x2e')]);_0x157198[_0xac0d('0x33')]=_[_0xac0d('0x34')](_0x1b1f0b[_0xac0d('0x33')]);_0x157198[_0xac0d('0x3c')]=_[_0xac0d('0x35')](_0x157198[_0xac0d('0x31')],_0x157198[_0xac0d('0x33')]);_0x3bc74f[_0xac0d('0x37')]=_[_0xac0d('0x35')](_0x157198[_0xac0d('0x31')],qs[_0xac0d('0x36')](_0x1b1f0b[_0xac0d('0x33')][_0xac0d('0x36')]));_0x3bc74f[_0xac0d('0x37')]=_0x3bc74f[_0xac0d('0x37')][_0xac0d('0x38')]?_0x3bc74f[_0xac0d('0x37')]:_0x157198[_0xac0d('0x31')];if(_0x1b1f0b[_0xac0d('0x33')]['includeAll']){_0x3bc74f[_0xac0d('0x43')]=[{'all':!![]}];}_0x3bc74f=_[_0xac0d('0x40')]({},_0x3bc74f,_0x1b1f0b['options']);return db['AnalyticTreeReport'][_0xac0d('0x49')](_0x3bc74f)[_0xac0d('0x27')](handleEntityNotFound(_0x534367,null))['then'](respondWithResult(_0x534367,null))[_0xac0d('0x46')](handleError(_0x534367,null));};exports[_0xac0d('0x4a')]=function(_0x24a84e,_0x476cab){return db[_0xac0d('0x2d')]['create'](_0x24a84e[_0xac0d('0x4b')],{})[_0xac0d('0x27')](respondWithResult(_0x476cab,0xc9))['catch'](handleError(_0x476cab,null));};exports['update']=function(_0x43ec6e,_0x3b8e90){if(_0x43ec6e['body']['id']){delete _0x43ec6e[_0xac0d('0x4b')]['id'];}return db[_0xac0d('0x2d')][_0xac0d('0x49')]({'where':{'id':_0x43ec6e[_0xac0d('0x48')]['id']}})[_0xac0d('0x27')](handleEntityNotFound(_0x3b8e90,null))['then'](saveUpdates(_0x43ec6e['body'],null))[_0xac0d('0x27')](respondWithResult(_0x3b8e90,null))[_0xac0d('0x46')](handleError(_0x3b8e90,null));};exports[_0xac0d('0x4c')]=function(_0x56acf6,_0x42eb7b){return db[_0xac0d('0x2d')]['find']({'where':{'id':_0x56acf6[_0xac0d('0x48')]['id']}})['then'](handleEntityNotFound(_0x42eb7b,null))[_0xac0d('0x27')](removeEntity(_0x42eb7b,null))[_0xac0d('0x46')](handleError(_0x42eb7b,null));}; \ No newline at end of file +var _0x11da=['api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','show','params','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger'];(function(_0x31d3b4,_0x138abc){var _0x43b94b=function(_0x50d9f3){while(--_0x50d9f3){_0x31d3b4['push'](_0x31d3b4['shift']());}};_0x43b94b(++_0x138abc);}(_0x11da,0x7f));var _0xa11d=function(_0x4f184d,_0x124bbe){_0x4f184d=_0x4f184d-0x0;var _0x5a1c06=_0x11da[_0x4f184d];return _0x5a1c06;};'use strict';var emlformat=require(_0xa11d('0x0'));var rimraf=require(_0xa11d('0x1'));var zipdir=require(_0xa11d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa11d('0x3'));var moment=require(_0xa11d('0x4'));var BPromise=require(_0xa11d('0x5'));var Mustache=require(_0xa11d('0x6'));var util=require(_0xa11d('0x7'));var path=require(_0xa11d('0x8'));var sox=require(_0xa11d('0x9'));var csv=require('to-csv');var ejs=require(_0xa11d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa11d('0xb'));var squel=require(_0xa11d('0xc'));var crypto=require(_0xa11d('0xd'));var jsforce=require(_0xa11d('0xe'));var deskjs=require(_0xa11d('0xf'));var toCsv=require(_0xa11d('0x10'));var querystring=require(_0xa11d('0x11'));var Papa=require(_0xa11d('0x12'));var Redis=require(_0xa11d('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa11d('0x14'))(_0xa11d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa11d('0x16'))['db'];function respondWithStatusCode(_0x285b6e,_0x4a2402){_0x4a2402=_0x4a2402||0xcc;return function(_0x16a908){if(_0x16a908){return _0x285b6e[_0xa11d('0x17')](_0x4a2402);}return _0x285b6e[_0xa11d('0x18')](_0x4a2402)[_0xa11d('0x19')]();};}function respondWithResult(_0x252844,_0x21543e){_0x21543e=_0x21543e||0xc8;return function(_0x602c0){if(_0x602c0){return _0x252844[_0xa11d('0x18')](_0x21543e)[_0xa11d('0x1a')](_0x602c0);}};}function respondWithFilteredResult(_0x578ba8,_0x4b342e){return function(_0x534641){if(_0x534641){var _0x5ea49e=typeof _0x4b342e[_0xa11d('0x1b')]===_0xa11d('0x1c')&&typeof _0x4b342e[_0xa11d('0x1d')]===_0xa11d('0x1c');var _0x13839c=_0x534641[_0xa11d('0x1e')];var _0x411533=_0x5ea49e?0x0:_0x4b342e[_0xa11d('0x1b')];var _0x1af580=_0x5ea49e?_0x534641[_0xa11d('0x1e')]:_0x4b342e['offset']+_0x4b342e[_0xa11d('0x1d')];var _0x251009;if(_0x1af580>=_0x13839c){_0x1af580=_0x13839c;_0x251009=0xc8;}else{_0x251009=0xce;}_0x578ba8[_0xa11d('0x18')](_0x251009);return _0x578ba8[_0xa11d('0x1f')](_0xa11d('0x20'),_0x411533+'-'+_0x1af580+'/'+_0x13839c)[_0xa11d('0x1a')](_0x534641);}return null;};}function patchUpdates(_0x4144aa){return function(_0x467b66){try{jsonpatch[_0xa11d('0x21')](_0x467b66,_0x4144aa,!![]);}catch(_0x3a09cd){return BPromise['reject'](_0x3a09cd);}return _0x467b66[_0xa11d('0x22')]();};}function saveUpdates(_0x18cba7,_0xd5cd7f){return function(_0x4798da){if(_0x4798da){return _0x4798da[_0xa11d('0x23')](_0x18cba7)[_0xa11d('0x24')](function(_0x34104e){return _0x34104e;});}return null;};}function removeEntity(_0x416271,_0x738dc8){return function(_0x4f44b2){if(_0x4f44b2){return _0x4f44b2[_0xa11d('0x25')]()[_0xa11d('0x24')](function(){_0x416271['status'](0xcc)[_0xa11d('0x19')]();});}};}function handleEntityNotFound(_0x3a8957,_0x54a883){return function(_0x22df71){if(!_0x22df71){_0x3a8957['sendStatus'](0x194);}return _0x22df71;};}function handleError(_0x2046b9,_0x255d11){_0x255d11=_0x255d11||0x1f4;return function(_0x1ff8c0){logger[_0xa11d('0x26')](_0x1ff8c0[_0xa11d('0x27')]);if(_0x1ff8c0['name']){delete _0x1ff8c0[_0xa11d('0x28')];}_0x2046b9[_0xa11d('0x18')](_0x255d11)[_0xa11d('0x29')](_0x1ff8c0);};}exports[_0xa11d('0x2a')]=function(_0x23ddd7,_0x438610){var _0x2e2735={},_0x30c712={},_0x38964a={'count':0x0,'rows':[]};var _0x2ea647=_[_0xa11d('0x2b')](db['AnalyticTreeReport'][_0xa11d('0x2c')],function(_0x44c43b){return{'name':_0x44c43b['fieldName'],'type':_0x44c43b[_0xa11d('0x2d')][_0xa11d('0x2e')]};});_0x30c712[_0xa11d('0x2f')]=_['map'](_0x2ea647,_0xa11d('0x28'));_0x30c712[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x23ddd7[_0xa11d('0x30')]);_0x30c712[_0xa11d('0x32')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],_0x30c712[_0xa11d('0x30')]);_0x2e2735[_0xa11d('0x34')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x23ddd7['query'][_0xa11d('0x35')]));_0x2e2735[_0xa11d('0x34')]=_0x2e2735[_0xa11d('0x34')][_0xa11d('0x36')]?_0x2e2735[_0xa11d('0x34')]:_0x30c712['model'];if(!_0x23ddd7['query'][_0xa11d('0x37')](_0xa11d('0x38'))){_0x2e2735[_0xa11d('0x1d')]=qs[_0xa11d('0x1d')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1d')]);_0x2e2735[_0xa11d('0x1b')]=qs[_0xa11d('0x1b')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1b')]);}_0x2e2735[_0xa11d('0x39')]=qs[_0xa11d('0x3a')](_0x23ddd7['query'][_0xa11d('0x3a')]);_0x2e2735[_0xa11d('0x3b')]=qs['filters'](_[_0xa11d('0x3c')](_0x23ddd7[_0xa11d('0x30')],_0x30c712[_0xa11d('0x32')]),_0x2ea647);if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]){_0x2e2735['where']=_[_0xa11d('0x3e')](_0x2e2735[_0xa11d('0x3b')],{'$or':_[_0xa11d('0x2b')](_0x2ea647,function(_0x38b769){if(_0x38b769[_0xa11d('0x2d')]!==_0xa11d('0x3f')){var _0x1f6f92={};_0x1f6f92[_0x38b769[_0xa11d('0x28')]]={'$like':'%'+_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]+'%'};return _0x1f6f92;}})});}_0x2e2735=_['merge']({},_0x2e2735,_0x23ddd7[_0xa11d('0x40')]);var _0xb118c2={'where':_0x2e2735[_0xa11d('0x3b')]};return db[_0xa11d('0x41')][_0xa11d('0x1e')](_0xb118c2)[_0xa11d('0x24')](function(_0x39a95b){_0x38964a[_0xa11d('0x1e')]=_0x39a95b;if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x42')]){_0x2e2735[_0xa11d('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa11d('0x44')](_0x2e2735);})[_0xa11d('0x24')](function(_0x50b96d){_0x38964a['rows']=_0x50b96d;return _0x38964a;})[_0xa11d('0x24')](respondWithFilteredResult(_0x438610,_0x2e2735))[_0xa11d('0x45')](handleError(_0x438610,null));};exports[_0xa11d('0x46')]=function(_0x3dbe5f,_0x15fbd5){var _0x518435={'raw':!![],'where':{'id':_0x3dbe5f[_0xa11d('0x47')]['id']}},_0x440d7e={};_0x440d7e[_0xa11d('0x2f')]=_[_0xa11d('0x31')](db[_0xa11d('0x41')]['rawAttributes']);_0x440d7e[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x3dbe5f[_0xa11d('0x30')]);_0x440d7e[_0xa11d('0x32')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],_0x440d7e[_0xa11d('0x30')]);_0x518435[_0xa11d('0x34')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x3dbe5f[_0xa11d('0x30')]['fields']));_0x518435['attributes']=_0x518435[_0xa11d('0x34')][_0xa11d('0x36')]?_0x518435['attributes']:_0x440d7e[_0xa11d('0x2f')];if(_0x3dbe5f[_0xa11d('0x30')][_0xa11d('0x42')]){_0x518435[_0xa11d('0x43')]=[{'all':!![]}];}_0x518435=_[_0xa11d('0x3e')]({},_0x518435,_0x3dbe5f[_0xa11d('0x40')]);return db[_0xa11d('0x41')][_0xa11d('0x48')](_0x518435)[_0xa11d('0x24')](handleEntityNotFound(_0x15fbd5,null))[_0xa11d('0x24')](respondWithResult(_0x15fbd5,null))[_0xa11d('0x45')](handleError(_0x15fbd5,null));};exports['create']=function(_0x1b759a,_0x33e4bd){return db[_0xa11d('0x41')]['create'](_0x1b759a[_0xa11d('0x49')],{})[_0xa11d('0x24')](respondWithResult(_0x33e4bd,0xc9))['catch'](handleError(_0x33e4bd,null));};exports[_0xa11d('0x23')]=function(_0x25b097,_0x33288c){if(_0x25b097[_0xa11d('0x49')]['id']){delete _0x25b097[_0xa11d('0x49')]['id'];}return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x25b097[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x33288c,null))[_0xa11d('0x24')](saveUpdates(_0x25b097[_0xa11d('0x49')],null))['then'](respondWithResult(_0x33288c,null))[_0xa11d('0x45')](handleError(_0x33288c,null));};exports[_0xa11d('0x25')]=function(_0x4137ff,_0x3eefac){return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x4137ff[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x3eefac,null))[_0xa11d('0x24')](removeEntity(_0x3eefac,null))[_0xa11d('0x45')](handleError(_0x3eefac,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index f2e7da0..818426c 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 _0x022e=['AnalyticTreeReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x470c7f,_0x27dd79){var _0x9c90e0=function(_0x1d6c18){while(--_0x1d6c18){_0x470c7f['push'](_0x470c7f['shift']());}};_0x9c90e0(++_0x27dd79);}(_0x022e,0x1d5));var _0xe022=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x022e[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0xe022('0x0'));var util=require(_0xe022('0x1'));var logger=require(_0xe022('0x2'))('api');var moment=require(_0xe022('0x3'));var BPromise=require(_0xe022('0x4'));var rp=require(_0xe022('0x5'));var fs=require('fs');var path=require(_0xe022('0x6'));var rimraf=require(_0xe022('0x7'));var config=require(_0xe022('0x8'));var attributes=require(_0xe022('0x9'));module[_0xe022('0xa')]=function(_0x4762d5,_0x32d1b3){return _0x4762d5[_0xe022('0xb')](_0xe022('0xc'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0617=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0x0617,0xcb));var _0x7061=function(_0x365d9a,_0x6b8d5f){_0x365d9a=_0x365d9a-0x0;var _0x54161d=_0x0617[_0x365d9a];return _0x54161d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7061('0x0'))(_0x7061('0x1'));var moment=require(_0x7061('0x2'));var BPromise=require(_0x7061('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7061('0x4'));var rimraf=require('rimraf');var config=require(_0x7061('0x5'));var attributes=require(_0x7061('0x6'));module[_0x7061('0x7')]=function(_0x55fe55,_0xe7c0de){return _0x55fe55[_0x7061('0x8')](_0x7061('0x9'),attributes,{'tableName':_0x7061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 4d80a06..d3c9ea4 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 _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(_0x4fc476,_0xb7cdfd){var _0x2de7d8=function(_0x5c4f8f){while(--_0x5c4f8f){_0x4fc476['push'](_0x4fc476['shift']());}};_0x2de7d8(++_0xb7cdfd);}(_0xadb5,0xad));var _0x5adb=function(_0x4aafde,_0x5739f4){_0x4aafde=_0x4aafde-0x0;var _0x165fd2=_0xadb5[_0x4aafde];return _0x165fd2;};'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 +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x49b30e,_0x30f431){var _0x4af321=function(_0x6c4fd9){while(--_0x6c4fd9){_0x49b30e['push'](_0x49b30e['shift']());}};_0x4af321(++_0x30f431);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 5d28d7c..480e2b4 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 _0x109e=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','post','create','/:id','destroy','exports'];(function(_0x57fe5e,_0xafce42){var _0x24ad53=function(_0x386892){while(--_0x386892){_0x57fe5e['push'](_0x57fe5e['shift']());}};_0x24ad53(++_0xafce42);}(_0x109e,0xc3));var _0xe109=function(_0x9eadf8,_0x5d2d9e){_0x9eadf8=_0x9eadf8-0x0;var _0x5ce5eb=_0x109e[_0x9eadf8];return _0x5ce5eb;};'use strict';var multer=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var path=require(_0xe109('0x2'));var timeout=require(_0xe109('0x3'));var express=require(_0xe109('0x4'));var router=express[_0xe109('0x5')]();var fs_extra=require(_0xe109('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe109('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xe109('0x8')]('/',auth[_0xe109('0x9')](),controller['index']);router[_0xe109('0x8')]('/:id',auth[_0xe109('0x9')](),controller['show']);router[_0xe109('0xa')]('/',auth[_0xe109('0x9')](),controller[_0xe109('0xb')]);router['put'](_0xe109('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe109('0xc'),auth[_0xe109('0x9')](),controller[_0xe109('0xd')]);module[_0xe109('0xe')]=router; \ No newline at end of file +var _0xdb59=['get','isAuthenticated','/:id','post','put','update','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xdb59,0xda));var _0x9db5=function(_0x44d3d7,_0x1c6356){_0x44d3d7=_0x44d3d7-0x0;var _0x1886c0=_0xdb59[_0x44d3d7];return _0x1886c0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9db5('0x0'));var express=require(_0x9db5('0x1'));var router=express['Router']();var fs_extra=require(_0x9db5('0x2'));var auth=require(_0x9db5('0x3'));var interaction=require(_0x9db5('0x4'));var config=require(_0x9db5('0x5'));var controller=require(_0x9db5('0x6'));router[_0x9db5('0x7')]('/',auth[_0x9db5('0x8')](),controller['index']);router[_0x9db5('0x7')](_0x9db5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9db5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9db5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9db5('0xc')]);router['delete'](_0x9db5('0x9'),auth[_0x9db5('0x8')](),controller[_0x9db5('0xd')]);module[_0x9db5('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 88ce3b9..bfea402 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 _0xe198=['sequelize','exports','STRING'];(function(_0x350814,_0x4a1eb6){var _0x4679e7=function(_0x894990){while(--_0x894990){_0x350814['push'](_0x350814['shift']());}};_0x4679e7(++_0x4a1eb6);}(_0xe198,0x6f));var _0x8e19=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe198[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x8e19('0x0'));module[_0x8e19('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8e19('0x2')]}}; \ No newline at end of file +var _0xff98=['exports','STRING'];(function(_0x386f0a,_0x3b084a){var _0x32ffa0=function(_0x4cdefd){while(--_0x4cdefd){_0x386f0a['push'](_0x386f0a['shift']());}};_0x32ffa0(++_0x3b084a);}(_0xff98,0x9c));var _0x8ff9=function(_0xdb5d5a,_0x5c857e){_0xdb5d5a=_0xdb5d5a-0x0;var _0x426c3b=_0xff98[_0xdb5d5a];return _0x426c3b;};'use strict';var Sequelize=require('sequelize');module[_0x8ff9('0x0')]={'name':{'type':Sequelize[_0x8ff9('0x1')]},'basename':{'type':Sequelize[_0x8ff9('0x1')]},'type':{'type':Sequelize[_0x8ff9('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 6364a14..acbceeb 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 _0xc875=['create','originalname','basename','file','filename','mimetype','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','Attachment','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','params','length','find','clone','omit','createdAt','body','updatedAt','update'];(function(_0xe30888,_0x12dcea){var _0x15dfaf=function(_0x39fb7f){while(--_0x39fb7f){_0xe30888['push'](_0xe30888['shift']());}};_0x15dfaf(++_0x12dcea);}(_0xc875,0x111));var _0x5c87=function(_0x5767a6,_0x3053cc){_0x5767a6=_0x5767a6-0x0;var _0x25edd8=_0xc875[_0x5767a6];return _0x25edd8;};'use strict';var emlformat=require(_0x5c87('0x0'));var rimraf=require(_0x5c87('0x1'));var zipdir=require(_0x5c87('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c87('0x3'));var moment=require('moment');var BPromise=require(_0x5c87('0x4'));var Mustache=require('mustache');var util=require(_0x5c87('0x5'));var path=require(_0x5c87('0x6'));var sox=require(_0x5c87('0x7'));var csv=require('to-csv');var ejs=require(_0x5c87('0x8'));var fs=require('fs');var fs_extra=require(_0x5c87('0x9'));var _=require(_0x5c87('0xa'));var squel=require(_0x5c87('0xb'));var crypto=require(_0x5c87('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5c87('0xd'));var querystring=require(_0x5c87('0xe'));var Papa=require(_0x5c87('0xf'));var Redis=require('ioredis');var authService=require(_0x5c87('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5c87('0x11'));var hardwareService=require(_0x5c87('0x12'));var logger=require(_0x5c87('0x13'))(_0x5c87('0x14'));var utils=require(_0x5c87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5c87('0x16'));var db=require(_0x5c87('0x17'))['db'];function respondWithStatusCode(_0x541e2c,_0x46d696){_0x46d696=_0x46d696||0xcc;return function(_0x1ec10b){if(_0x1ec10b){return _0x541e2c['sendStatus'](_0x46d696);}return _0x541e2c[_0x5c87('0x18')](_0x46d696)[_0x5c87('0x19')]();};}function respondWithResult(_0x2eb133,_0x5981ed){_0x5981ed=_0x5981ed||0xc8;return function(_0x2ad650){if(_0x2ad650){return _0x2eb133[_0x5c87('0x18')](_0x5981ed)[_0x5c87('0x1a')](_0x2ad650);}};}function respondWithFilteredResult(_0x58cda1,_0x498418){return function(_0x2f0782){if(_0x2f0782){var _0x4de004=typeof _0x498418[_0x5c87('0x1b')]===_0x5c87('0x1c')&&typeof _0x498418[_0x5c87('0x1d')]===_0x5c87('0x1c');var _0x419b1b=_0x2f0782[_0x5c87('0x1e')];var _0x2a2cee=_0x4de004?0x0:_0x498418[_0x5c87('0x1b')];var _0x4fcd85=_0x4de004?_0x2f0782[_0x5c87('0x1e')]:_0x498418[_0x5c87('0x1b')]+_0x498418[_0x5c87('0x1d')];var _0xf175f9;if(_0x4fcd85>=_0x419b1b){_0x4fcd85=_0x419b1b;_0xf175f9=0xc8;}else{_0xf175f9=0xce;}_0x58cda1[_0x5c87('0x18')](_0xf175f9);return _0x58cda1[_0x5c87('0x1f')](_0x5c87('0x20'),_0x2a2cee+'-'+_0x4fcd85+'/'+_0x419b1b)[_0x5c87('0x1a')](_0x2f0782);}return null;};}function patchUpdates(_0x3e6184){return function(_0xfc4ff0){try{jsonpatch[_0x5c87('0x21')](_0xfc4ff0,_0x3e6184,!![]);}catch(_0x2a72aa){return BPromise[_0x5c87('0x22')](_0x2a72aa);}return _0xfc4ff0[_0x5c87('0x23')]();};}function saveUpdates(_0x2bb028,_0x486a53){return function(_0x508eb4){if(_0x508eb4){return _0x508eb4['update'](_0x2bb028)[_0x5c87('0x24')](function(_0xec656){return _0xec656;});}return null;};}function removeEntity(_0x57892b,_0x2dcc76){return function(_0x5b40bf){if(_0x5b40bf){return _0x5b40bf[_0x5c87('0x25')]()[_0x5c87('0x24')](function(){_0x57892b[_0x5c87('0x18')](0xcc)[_0x5c87('0x19')]();});}};}function handleEntityNotFound(_0x133d2f,_0x56712e){return function(_0xa98e7e){if(!_0xa98e7e){_0x133d2f[_0x5c87('0x26')](0x194);}return _0xa98e7e;};}function handleError(_0x1b85f8,_0x38ea55){_0x38ea55=_0x38ea55||0x1f4;return function(_0x5338f9){logger[_0x5c87('0x27')](_0x5338f9[_0x5c87('0x28')]);if(_0x5338f9['name']){delete _0x5338f9[_0x5c87('0x29')];}_0x1b85f8[_0x5c87('0x18')](_0x38ea55)['send'](_0x5338f9);};}exports[_0x5c87('0x2a')]=function(_0x3f22b1,_0x303e6a){var _0x2efcf9={},_0x5acf1e={},_0x13dec4={'count':0x0,'rows':[]};var _0x19e3ed=_['map'](db[_0x5c87('0x2b')]['rawAttributes'],function(_0x4cbfb8){return{'name':_0x4cbfb8['fieldName'],'type':_0x4cbfb8[_0x5c87('0x2c')][_0x5c87('0x2d')]};});_0x5acf1e[_0x5c87('0x2e')]=_['map'](_0x19e3ed,'name');_0x5acf1e[_0x5c87('0x2f')]=_[_0x5c87('0x30')](_0x3f22b1[_0x5c87('0x2f')]);_0x5acf1e[_0x5c87('0x31')]=_['intersection'](_0x5acf1e['model'],_0x5acf1e[_0x5c87('0x2f')]);_0x2efcf9[_0x5c87('0x32')]=_[_0x5c87('0x33')](_0x5acf1e['model'],qs[_0x5c87('0x34')](_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x34')]));_0x2efcf9[_0x5c87('0x32')]=_0x2efcf9[_0x5c87('0x32')]['length']?_0x2efcf9[_0x5c87('0x32')]:_0x5acf1e[_0x5c87('0x2e')];if(!_0x3f22b1[_0x5c87('0x2f')]['hasOwnProperty']('nolimit')){_0x2efcf9['limit']=qs[_0x5c87('0x1d')](_0x3f22b1[_0x5c87('0x2f')]['limit']);_0x2efcf9['offset']=qs[_0x5c87('0x1b')](_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x1b')]);}_0x2efcf9[_0x5c87('0x35')]=qs[_0x5c87('0x36')](_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x36')]);_0x2efcf9[_0x5c87('0x37')]=qs[_0x5c87('0x31')](_[_0x5c87('0x38')](_0x3f22b1[_0x5c87('0x2f')],_0x5acf1e[_0x5c87('0x31')]),_0x19e3ed);if(_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x39')]){_0x2efcf9['where']=_[_0x5c87('0x3a')](_0x2efcf9['where'],{'$or':_[_0x5c87('0x3b')](_0x19e3ed,function(_0x3511ba){if(_0x3511ba[_0x5c87('0x2c')]!=='VIRTUAL'){var _0x26f0bd={};_0x26f0bd[_0x3511ba[_0x5c87('0x29')]]={'$like':'%'+_0x3f22b1[_0x5c87('0x2f')][_0x5c87('0x39')]+'%'};return _0x26f0bd;}})});}_0x2efcf9=_['merge']({},_0x2efcf9,_0x3f22b1[_0x5c87('0x3c')]);var _0xf09f7a={'where':_0x2efcf9[_0x5c87('0x37')]};return db[_0x5c87('0x2b')][_0x5c87('0x1e')](_0xf09f7a)['then'](function(_0x289f08){_0x13dec4['count']=_0x289f08;if(_0x3f22b1['query'][_0x5c87('0x3d')]){_0x2efcf9[_0x5c87('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x2efcf9);})[_0x5c87('0x24')](function(_0x1711b1){_0x13dec4[_0x5c87('0x3f')]=_0x1711b1;return _0x13dec4;})[_0x5c87('0x24')](respondWithFilteredResult(_0x303e6a,_0x2efcf9))[_0x5c87('0x40')](handleError(_0x303e6a,null));};exports[_0x5c87('0x41')]=function(_0x2bdde8,_0xe75ab5){var _0x381a03={'raw':!![],'where':{'id':_0x2bdde8[_0x5c87('0x42')]['id']}},_0x54dd73={};_0x54dd73['model']=_[_0x5c87('0x30')](db[_0x5c87('0x2b')]['rawAttributes']);_0x54dd73[_0x5c87('0x2f')]=_[_0x5c87('0x30')](_0x2bdde8[_0x5c87('0x2f')]);_0x54dd73[_0x5c87('0x31')]=_['intersection'](_0x54dd73[_0x5c87('0x2e')],_0x54dd73[_0x5c87('0x2f')]);_0x381a03[_0x5c87('0x32')]=_[_0x5c87('0x33')](_0x54dd73[_0x5c87('0x2e')],qs[_0x5c87('0x34')](_0x2bdde8['query'][_0x5c87('0x34')]));_0x381a03['attributes']=_0x381a03[_0x5c87('0x32')][_0x5c87('0x43')]?_0x381a03[_0x5c87('0x32')]:_0x54dd73[_0x5c87('0x2e')];if(_0x2bdde8[_0x5c87('0x2f')]['includeAll']){_0x381a03[_0x5c87('0x3e')]=[{'all':!![]}];}_0x381a03=_[_0x5c87('0x3a')]({},_0x381a03,_0x2bdde8[_0x5c87('0x3c')]);return db[_0x5c87('0x2b')][_0x5c87('0x44')](_0x381a03)['then'](handleEntityNotFound(_0xe75ab5,null))[_0x5c87('0x24')](respondWithResult(_0xe75ab5,null))['catch'](handleError(_0xe75ab5,null));};exports[_0x5c87('0x45')]=function(_0x45a453,_0x2608cd){var _0x5944aa={'where':{'id':_0x45a453[_0x5c87('0x42')]['id']}},_0x2d3a18={};_0x2d3a18[_0x5c87('0x2e')]=_[_0x5c87('0x30')](db[_0x5c87('0x2b')]['rawAttributes']);_0x5944aa[_0x5c87('0x32')]=_[_0x5c87('0x33')](_0x2d3a18[_0x5c87('0x2e')],qs[_0x5c87('0x34')](_0x45a453[_0x5c87('0x2f')][_0x5c87('0x34')]));_0x5944aa[_0x5c87('0x32')]=_0x5944aa[_0x5c87('0x32')][_0x5c87('0x43')]?_0x5944aa['attributes']:_0x2d3a18[_0x5c87('0x2e')];if(_0x45a453[_0x5c87('0x2f')]['includeAll']){_0x5944aa['include']=[{'all':!![]}];}_0x5944aa=_['merge']({},_0x5944aa,_0x45a453[_0x5c87('0x3c')]);return db['Attachment'][_0x5c87('0x44')](_0x5944aa)['then'](handleEntityNotFound(_0x2608cd,null))[_0x5c87('0x24')](function(_0x423de5){if(_0x423de5){var _0x4d497e=_0x423de5['get']({'plain':!![]});_0x4d497e=qs[_0x5c87('0x46')](_0x4d497e,['id',_0x5c87('0x47'),'updatedAt']);_0x45a453[_0x5c87('0x48')]=_[_0x5c87('0x46')](_0x45a453[_0x5c87('0x48')],['id','createdAt',_0x5c87('0x49')]);return db['Attachment']['create'](_['merge'](_0x4d497e,_0x45a453[_0x5c87('0x48')]),{'include':_0x45a453[_0x5c87('0x2f')][_0x5c87('0x3d')]?[{'all':!![]}]:undefined});}})[_0x5c87('0x24')](respondWithResult(_0x2608cd,0xc9))['catch'](handleError(_0x2608cd,null));};exports[_0x5c87('0x4a')]=function(_0x5efd92,_0x5ee97d){if(_0x5efd92[_0x5c87('0x48')]['id']){delete _0x5efd92[_0x5c87('0x48')]['id'];}return db[_0x5c87('0x2b')][_0x5c87('0x44')]({'where':{'id':_0x5efd92[_0x5c87('0x42')]['id']}})[_0x5c87('0x24')](handleEntityNotFound(_0x5ee97d,null))[_0x5c87('0x24')](saveUpdates(_0x5efd92[_0x5c87('0x48')],null))[_0x5c87('0x24')](respondWithResult(_0x5ee97d,null))[_0x5c87('0x40')](handleError(_0x5ee97d,null));};exports[_0x5c87('0x25')]=function(_0x4d4336,_0x1d867f){return db[_0x5c87('0x2b')][_0x5c87('0x44')]({'where':{'id':_0x4d4336[_0x5c87('0x42')]['id']}})[_0x5c87('0x24')](handleEntityNotFound(_0x1d867f,null))[_0x5c87('0x24')](removeEntity(_0x1d867f,null))['catch'](handleError(_0x1d867f,null));};exports[_0x5c87('0x4b')]=function(_0x5d2556,_0x5bb663,_0x433bce){_0x5d2556['body'][_0x5c87('0x29')]=_0x5d2556['file'][_0x5c87('0x4c')];_0x5d2556[_0x5c87('0x48')][_0x5c87('0x4d')]=_0x5d2556[_0x5c87('0x4e')][_0x5c87('0x4f')];_0x5d2556['body'][_0x5c87('0x2c')]=_0x5d2556[_0x5c87('0x4e')][_0x5c87('0x50')];return db[_0x5c87('0x2b')][_0x5c87('0x4b')](_0x5d2556[_0x5c87('0x48')])[_0x5c87('0x24')](respondWithResult(_0x5bb663,0xc9))[_0x5c87('0x40')](handleError(_0x5bb663,null));};exports['download']=function(_0x546fce,_0x5e3b20,_0x12cb24){return db[_0x5c87('0x2b')]['findOne']({'where':{'id':_0x546fce['params']['id']},'raw':!![]})[_0x5c87('0x24')](handleEntityNotFound(_0x5e3b20,null))[_0x5c87('0x24')](function(_0x2351a5){if(_0x2351a5){var _0x2d57b6=_0x2351a5[_0x5c87('0x51')]!==null;var _0xec0d02=path['join'](config[_0x5c87('0x52')],_0x5c87('0x53'));if(_0x2d57b6){_0xec0d02=path[_0x5c87('0x54')](_0xec0d02,_0x5c87('0x55'));}var _0x24b763=path['join'](_0xec0d02,_0x2351a5[_0x5c87('0x4d')]);return _0x5e3b20[_0x5c87('0x56')](_0x24b763);}})['catch'](handleError(_0x5e3b20,null));}; \ No newline at end of file +var _0x280b=['nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','clone','params','get','omit','body','createdAt','create','find','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','sendStatus','name','send','index','Attachment','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x3a428d,_0x4f6232){var _0x1fb723=function(_0x554a39){while(--_0x554a39){_0x3a428d['push'](_0x3a428d['shift']());}};_0x1fb723(++_0x4f6232);}(_0x280b,0x180));var _0xb280=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x280b[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xb280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb280('0x1'));var jsonpatch=require(_0xb280('0x2'));var rp=require(_0xb280('0x3'));var moment=require(_0xb280('0x4'));var BPromise=require(_0xb280('0x5'));var Mustache=require('mustache');var util=require(_0xb280('0x6'));var path=require(_0xb280('0x7'));var sox=require(_0xb280('0x8'));var csv=require(_0xb280('0x9'));var ejs=require(_0xb280('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb280('0xb'));var squel=require(_0xb280('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb280('0x9'));var querystring=require(_0xb280('0xd'));var Papa=require('papaparse');var Redis=require(_0xb280('0xe'));var authService=require(_0xb280('0xf'));var qs=require(_0xb280('0x10'));var as=require(_0xb280('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb280('0x12'))('api');var utils=require(_0xb280('0x13'));var config=require(_0xb280('0x14'));var licenseUtil=require(_0xb280('0x15'));var db=require(_0xb280('0x16'))['db'];function respondWithStatusCode(_0x28c187,_0x1f8e42){_0x1f8e42=_0x1f8e42||0xcc;return function(_0x275188){if(_0x275188){return _0x28c187['sendStatus'](_0x1f8e42);}return _0x28c187[_0xb280('0x17')](_0x1f8e42)[_0xb280('0x18')]();};}function respondWithResult(_0x348798,_0x30134a){_0x30134a=_0x30134a||0xc8;return function(_0x5597ad){if(_0x5597ad){return _0x348798[_0xb280('0x17')](_0x30134a)['json'](_0x5597ad);}};}function respondWithFilteredResult(_0x195575,_0x5e097c){return function(_0x29f14e){if(_0x29f14e){var _0x30f276=typeof _0x5e097c[_0xb280('0x19')]===_0xb280('0x1a')&&typeof _0x5e097c['limit']===_0xb280('0x1a');var _0x414adf=_0x29f14e[_0xb280('0x1b')];var _0x1aef67=_0x30f276?0x0:_0x5e097c[_0xb280('0x19')];var _0x253b5e=_0x30f276?_0x29f14e[_0xb280('0x1b')]:_0x5e097c[_0xb280('0x19')]+_0x5e097c[_0xb280('0x1c')];var _0xc9b5a1;if(_0x253b5e>=_0x414adf){_0x253b5e=_0x414adf;_0xc9b5a1=0xc8;}else{_0xc9b5a1=0xce;}_0x195575[_0xb280('0x17')](_0xc9b5a1);return _0x195575[_0xb280('0x1d')]('Content-Range',_0x1aef67+'-'+_0x253b5e+'/'+_0x414adf)[_0xb280('0x1e')](_0x29f14e);}return null;};}function patchUpdates(_0x38e20e){return function(_0x37e5c2){try{jsonpatch[_0xb280('0x1f')](_0x37e5c2,_0x38e20e,!![]);}catch(_0x10a24d){return BPromise[_0xb280('0x20')](_0x10a24d);}return _0x37e5c2['save']();};}function saveUpdates(_0x559a80,_0x3eabd9){return function(_0x47734c){if(_0x47734c){return _0x47734c[_0xb280('0x21')](_0x559a80)[_0xb280('0x22')](function(_0x25a56d){return _0x25a56d;});}return null;};}function removeEntity(_0x2eb5fe,_0x5e9eae){return function(_0x57b37c){if(_0x57b37c){return _0x57b37c[_0xb280('0x23')]()[_0xb280('0x22')](function(){_0x2eb5fe[_0xb280('0x17')](0xcc)[_0xb280('0x18')]();});}};}function handleEntityNotFound(_0x12ae73,_0x440f4b){return function(_0x44d03c){if(!_0x44d03c){_0x12ae73[_0xb280('0x24')](0x194);}return _0x44d03c;};}function handleError(_0x548676,_0x449bc9){_0x449bc9=_0x449bc9||0x1f4;return function(_0x45f937){logger['error'](_0x45f937['stack']);if(_0x45f937[_0xb280('0x25')]){delete _0x45f937[_0xb280('0x25')];}_0x548676[_0xb280('0x17')](_0x449bc9)[_0xb280('0x26')](_0x45f937);};}exports[_0xb280('0x27')]=function(_0x2ca5ef,_0xcb9ce8){var _0x27a475={},_0xb94030={},_0x440cf1={'count':0x0,'rows':[]};var _0x58b5c8=_['map'](db[_0xb280('0x28')]['rawAttributes'],function(_0x27274b){return{'name':_0x27274b['fieldName'],'type':_0x27274b[_0xb280('0x29')][_0xb280('0x2a')]};});_0xb94030['model']=_['map'](_0x58b5c8,_0xb280('0x25'));_0xb94030[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x2ca5ef[_0xb280('0x2b')]);_0xb94030[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0xb94030[_0xb280('0x2f')],_0xb94030[_0xb280('0x2b')]);_0x27a475[_0xb280('0x30')]=_['intersection'](_0xb94030['model'],qs[_0xb280('0x31')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x31')]));_0x27a475[_0xb280('0x30')]=_0x27a475[_0xb280('0x30')][_0xb280('0x32')]?_0x27a475[_0xb280('0x30')]:_0xb94030[_0xb280('0x2f')];if(!_0x2ca5ef['query']['hasOwnProperty'](_0xb280('0x33'))){_0x27a475[_0xb280('0x1c')]=qs['limit'](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x1c')]);_0x27a475['offset']=qs['offset'](_0x2ca5ef['query'][_0xb280('0x19')]);}_0x27a475[_0xb280('0x34')]=qs[_0xb280('0x35')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x35')]);_0x27a475[_0xb280('0x36')]=qs['filters'](_[_0xb280('0x37')](_0x2ca5ef['query'],_0xb94030[_0xb280('0x2d')]),_0x58b5c8);if(_0x2ca5ef['query'][_0xb280('0x38')]){_0x27a475[_0xb280('0x36')]=_[_0xb280('0x39')](_0x27a475[_0xb280('0x36')],{'$or':_[_0xb280('0x3a')](_0x58b5c8,function(_0x2787f8){if(_0x2787f8[_0xb280('0x29')]!==_0xb280('0x3b')){var _0xe6a22e={};_0xe6a22e[_0x2787f8[_0xb280('0x25')]]={'$like':'%'+_0x2ca5ef[_0xb280('0x2b')]['filter']+'%'};return _0xe6a22e;}})});}_0x27a475=_[_0xb280('0x39')]({},_0x27a475,_0x2ca5ef[_0xb280('0x3c')]);var _0x5cd98c={'where':_0x27a475[_0xb280('0x36')]};return db[_0xb280('0x28')][_0xb280('0x1b')](_0x5cd98c)[_0xb280('0x22')](function(_0x5bf59a){_0x440cf1[_0xb280('0x1b')]=_0x5bf59a;if(_0x2ca5ef['query'][_0xb280('0x3d')]){_0x27a475[_0xb280('0x3e')]=[{'all':!![]}];}return db[_0xb280('0x28')][_0xb280('0x3f')](_0x27a475);})[_0xb280('0x22')](function(_0x430921){_0x440cf1[_0xb280('0x40')]=_0x430921;return _0x440cf1;})[_0xb280('0x22')](respondWithFilteredResult(_0xcb9ce8,_0x27a475))[_0xb280('0x41')](handleError(_0xcb9ce8,null));};exports['show']=function(_0x5dd0cc,_0x2c7831){var _0x11d412={'raw':!![],'where':{'id':_0x5dd0cc['params']['id']}},_0x5b7501={};_0x5b7501[_0xb280('0x2f')]=_['keys'](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5b7501[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x5dd0cc[_0xb280('0x2b')]);_0x5b7501[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0x5b7501[_0xb280('0x2f')],_0x5b7501['query']);_0x11d412[_0xb280('0x30')]=_[_0xb280('0x2e')](_0x5b7501['model'],qs[_0xb280('0x31')](_0x5dd0cc['query'][_0xb280('0x31')]));_0x11d412[_0xb280('0x30')]=_0x11d412['attributes'][_0xb280('0x32')]?_0x11d412[_0xb280('0x30')]:_0x5b7501[_0xb280('0x2f')];if(_0x5dd0cc['query'][_0xb280('0x3d')]){_0x11d412[_0xb280('0x3e')]=[{'all':!![]}];}_0x11d412=_['merge']({},_0x11d412,_0x5dd0cc['options']);return db['Attachment']['find'](_0x11d412)[_0xb280('0x22')](handleEntityNotFound(_0x2c7831,null))[_0xb280('0x22')](respondWithResult(_0x2c7831,null))['catch'](handleError(_0x2c7831,null));};exports[_0xb280('0x43')]=function(_0xe4ff86,_0x25a7cc){var _0x5bd341={'where':{'id':_0xe4ff86[_0xb280('0x44')]['id']}},_0x80f81e={};_0x80f81e[_0xb280('0x2f')]=_[_0xb280('0x2c')](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5bd341['attributes']=_[_0xb280('0x2e')](_0x80f81e[_0xb280('0x2f')],qs[_0xb280('0x31')](_0xe4ff86[_0xb280('0x2b')][_0xb280('0x31')]));_0x5bd341[_0xb280('0x30')]=_0x5bd341[_0xb280('0x30')][_0xb280('0x32')]?_0x5bd341[_0xb280('0x30')]:_0x80f81e['model'];if(_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]){_0x5bd341[_0xb280('0x3e')]=[{'all':!![]}];}_0x5bd341=_[_0xb280('0x39')]({},_0x5bd341,_0xe4ff86['options']);return db[_0xb280('0x28')]['find'](_0x5bd341)[_0xb280('0x22')](handleEntityNotFound(_0x25a7cc,null))[_0xb280('0x22')](function(_0x845a9b){if(_0x845a9b){var _0x1085b6=_0x845a9b[_0xb280('0x45')]({'plain':!![]});_0x1085b6=qs[_0xb280('0x46')](_0x1085b6,['id','createdAt','updatedAt']);_0xe4ff86[_0xb280('0x47')]=_[_0xb280('0x46')](_0xe4ff86['body'],['id',_0xb280('0x48'),'updatedAt']);return db['Attachment'][_0xb280('0x49')](_[_0xb280('0x39')](_0x1085b6,_0xe4ff86[_0xb280('0x47')]),{'include':_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]?[{'all':!![]}]:undefined});}})[_0xb280('0x22')](respondWithResult(_0x25a7cc,0xc9))[_0xb280('0x41')](handleError(_0x25a7cc,null));};exports['update']=function(_0x7fdb22,_0x32468a){if(_0x7fdb22[_0xb280('0x47')]['id']){delete _0x7fdb22[_0xb280('0x47')]['id'];}return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x7fdb22[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x32468a,null))[_0xb280('0x22')](saveUpdates(_0x7fdb22['body'],null))[_0xb280('0x22')](respondWithResult(_0x32468a,null))['catch'](handleError(_0x32468a,null));};exports['destroy']=function(_0x3b1339,_0x55df54){return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x3b1339[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x55df54,null))['then'](removeEntity(_0x55df54,null))[_0xb280('0x41')](handleError(_0x55df54,null));};exports[_0xb280('0x49')]=function(_0x5d0dfd,_0x1485c0,_0x7baf2a){_0x5d0dfd[_0xb280('0x47')][_0xb280('0x25')]=_0x5d0dfd['file'][_0xb280('0x4b')];_0x5d0dfd[_0xb280('0x47')][_0xb280('0x4c')]=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4e')];_0x5d0dfd[_0xb280('0x47')]['type']=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4f')];return db[_0xb280('0x28')][_0xb280('0x49')](_0x5d0dfd[_0xb280('0x47')])[_0xb280('0x22')](respondWithResult(_0x1485c0,0xc9))[_0xb280('0x41')](handleError(_0x1485c0,null));};exports[_0xb280('0x50')]=function(_0x863481,_0x435675,_0x28f28c){return db[_0xb280('0x28')][_0xb280('0x51')]({'where':{'id':_0x863481[_0xb280('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x435675,null))[_0xb280('0x22')](function(_0x54f53b){if(_0x54f53b){var _0x9f5e75=_0x54f53b[_0xb280('0x52')]!==null;var _0x5b35de=path[_0xb280('0x53')](config[_0xb280('0x54')],_0xb280('0x55'));if(_0x9f5e75){_0x5b35de=path[_0xb280('0x53')](_0x5b35de,_0xb280('0x56'));}var _0xca1404=path[_0xb280('0x53')](_0x5b35de,_0x54f53b[_0xb280('0x4c')]);return _0x435675[_0xb280('0x50')](_0xca1404);}})[_0xb280('0x41')](handleError(_0x435675,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9424116..9ae68aa 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 _0x0835=['api','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger'];(function(_0x25b441,_0x2ee167){var _0x522f83=function(_0x586af2){while(--_0x586af2){_0x25b441['push'](_0x25b441['shift']());}};_0x522f83(++_0x2ee167);}(_0x0835,0x1eb));var _0x5083=function(_0x25da90,_0x2f9eef){_0x25da90=_0x25da90-0x0;var _0x278407=_0x0835[_0x25da90];return _0x278407;};'use strict';var _=require(_0x5083('0x0'));var util=require(_0x5083('0x1'));var logger=require(_0x5083('0x2'))(_0x5083('0x3'));var moment=require('moment');var BPromise=require(_0x5083('0x4'));var rp=require(_0x5083('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5083('0x6'));var config=require(_0x5083('0x7'));var attributes=require(_0x5083('0x8'));module[_0x5083('0x9')]=function(_0x2389e3,_0x243393){return _0x2389e3[_0x5083('0xa')](_0x5083('0xb'),attributes,{'tableName':_0x5083('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7611=['rimraf','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x3eb2f4,_0x51516a){var _0x59fb19=function(_0x1ed9d9){while(--_0x1ed9d9){_0x3eb2f4['push'](_0x3eb2f4['shift']());}};_0x59fb19(++_0x51516a);}(_0x7611,0xaf));var _0x1761=function(_0x925658,_0x35e35d){_0x925658=_0x925658-0x0;var _0x2b9837=_0x7611[_0x925658];return _0x2b9837;};'use strict';var _=require(_0x1761('0x0'));var util=require(_0x1761('0x1'));var logger=require(_0x1761('0x2'))(_0x1761('0x3'));var moment=require(_0x1761('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1761('0x5'));var config=require('../../config/environment');var attributes=require(_0x1761('0x6'));module[_0x1761('0x7')]=function(_0x95a1ed,_0x39d234){return _0x95a1ed[_0x1761('0x8')]('Attachment',attributes,{'tableName':_0x1761('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 981b9f8..13bf39c 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 _0xff96=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','catch','body','options','raw','CreateAttachment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xff96,0x179));var _0x6ff9=function(_0x5b360e,_0x494136){_0x5b360e=_0x5b360e-0x0;var _0x1bf752=_0xff96[_0x5b360e];return _0x1bf752;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var moment=require(_0x6ff9('0x2'));var BPromise=require(_0x6ff9('0x3'));var rs=require(_0x6ff9('0x4'));var fs=require('fs');var Redis=require(_0x6ff9('0x5'));var db=require(_0x6ff9('0x6'))['db'];var utils=require(_0x6ff9('0x7'));var logger=require(_0x6ff9('0x8'))(_0x6ff9('0x9'));var config=require(_0x6ff9('0xa'));var jayson=require(_0x6ff9('0xb'));var client=jayson['client'][_0x6ff9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5509ee,_0x502cf2,_0x4f982b){return new BPromise(function(_0x5d56f4,_0x2b1b7d){return client[_0x6ff9('0xd')](_0x5509ee,_0x4f982b)[_0x6ff9('0xe')](function(_0x1ce5a3){logger[_0x6ff9('0xf')]('Attachment,\x20%s,\x20%s',_0x502cf2,_0x6ff9('0x10'));logger[_0x6ff9('0x11')](_0x6ff9('0x12'),_0x502cf2,_0x6ff9('0x10'),JSON[_0x6ff9('0x13')](_0x1ce5a3));if(_0x1ce5a3[_0x6ff9('0x14')]){if(_0x1ce5a3[_0x6ff9('0x14')][_0x6ff9('0x15')]===0x1f4){logger[_0x6ff9('0x14')]('Attachment,\x20%s,\x20%s',_0x502cf2,_0x1ce5a3['error'][_0x6ff9('0x16')]);return _0x2b1b7d(_0x1ce5a3['error'][_0x6ff9('0x16')]);}logger[_0x6ff9('0x14')](_0x6ff9('0x17'),_0x502cf2,_0x1ce5a3['error']['message']);return _0x5d56f4(_0x1ce5a3[_0x6ff9('0x14')][_0x6ff9('0x16')]);}else{logger[_0x6ff9('0xf')](_0x6ff9('0x17'),_0x502cf2,'request\x20sent');_0x5d56f4(_0x1ce5a3['result'][_0x6ff9('0x16')]);}})[_0x6ff9('0x18')](function(_0x3d4268){logger[_0x6ff9('0x14')](_0x6ff9('0x17'),_0x502cf2,_0x3d4268);_0x2b1b7d(_0x3d4268);});});}exports['CreateAttachment']=function(_0xc00da6){var _0x4756be=this;return new Promise(function(_0xc7724f,_0x5b0a94){return db['Attachment']['create'](_0xc00da6[_0x6ff9('0x19')],{'raw':_0xc00da6[_0x6ff9('0x1a')]?_0xc00da6[_0x6ff9('0x1a')][_0x6ff9('0x1b')]===undefined?!![]:![]:!![]})[_0x6ff9('0xe')](function(_0x4e926e){logger[_0x6ff9('0xf')](_0x6ff9('0x1c'),_0xc00da6);logger[_0x6ff9('0x11')](_0x6ff9('0x1c'),_0xc00da6,JSON[_0x6ff9('0x13')](_0x4e926e));_0xc7724f(_0x4e926e);})[_0x6ff9('0x18')](function(_0x50f207){logger[_0x6ff9('0x14')](_0x6ff9('0x1c'),_0x50f207['message'],_0xc00da6);_0x5b0a94(_0x4756be[_0x6ff9('0x14')](0x1f4,_0x50f207[_0x6ff9('0x16')]));});});}; \ No newline at end of file +var _0x04d0=['../../mysqldb','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','moment','bluebird','randomstring','ioredis'];(function(_0x2f965f,_0x100aca){var _0x73f2b9=function(_0x25705d){while(--_0x25705d){_0x2f965f['push'](_0x2f965f['shift']());}};_0x73f2b9(++_0x100aca);}(_0x04d0,0x10a));var _0x004d=function(_0x27d1a1,_0x252378){_0x27d1a1=_0x27d1a1-0x0;var _0x1225ad=_0x04d0[_0x27d1a1];return _0x1225ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x004d('0x0'));var BPromise=require(_0x004d('0x1'));var rs=require(_0x004d('0x2'));var fs=require('fs');var Redis=require(_0x004d('0x3'));var db=require(_0x004d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x004d('0x5'));var config=require('../../config/environment');var jayson=require(_0x004d('0x6'));var client=jayson[_0x004d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36e8bd,_0x2da158,_0x4d0ae4){return new BPromise(function(_0x1f0efd,_0x58d4f5){return client[_0x004d('0x8')](_0x36e8bd,_0x4d0ae4)[_0x004d('0x9')](function(_0x2d9da5){logger['info'](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));logger['debug'](_0x004d('0xc'),_0x2da158,'request\x20sent',JSON[_0x004d('0xd')](_0x2d9da5));if(_0x2d9da5[_0x004d('0xe')]){if(_0x2d9da5['error'][_0x004d('0xf')]===0x1f4){logger['error'](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);return _0x58d4f5(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')]['message']);return _0x1f0efd(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}else{logger[_0x004d('0x11')](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));_0x1f0efd(_0x2d9da5[_0x004d('0x12')][_0x004d('0x10')]);}})[_0x004d('0x13')](function(_0x5b4f40){logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x5b4f40);_0x58d4f5(_0x5b4f40);});});}exports[_0x004d('0x14')]=function(_0x4b3912){var _0x1adf2a=this;return new Promise(function(_0x583196,_0x40de7e){return db[_0x004d('0x15')][_0x004d('0x16')](_0x4b3912[_0x004d('0x17')],{'raw':_0x4b3912['options']?_0x4b3912[_0x004d('0x18')][_0x004d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x31ac5c){logger[_0x004d('0x11')](_0x004d('0x14'),_0x4b3912);logger[_0x004d('0x1a')]('CreateAttachment',_0x4b3912,JSON[_0x004d('0xd')](_0x31ac5c));_0x583196(_0x31ac5c);})[_0x004d('0x13')](function(_0x2da052){logger[_0x004d('0xe')](_0x004d('0x14'),_0x2da052[_0x004d('0x10')],_0x4b3912);_0x40de7e(_0x1adf2a[_0x004d('0xe')](0x1f4,_0x2da052[_0x004d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index df50388..2b44543 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3d6a29,_0x37856f){var _0x10e16f=function(_0x4e05f2){while(--_0x4e05f2){_0x3d6a29['push'](_0x3d6a29['shift']());}};_0x10e16f(++_0x37856f);}(_0x2032,0xd9));var _0x2203=function(_0x411232,_0x338d2b){_0x411232=_0x411232-0x0;var _0x3bfcda=_0x2032[_0x411232];return _0x3bfcda;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x15ccd9,_0x51a714){var _0x1bd6f3=function(_0x17cc0d){while(--_0x17cc0d){_0x15ccd9['push'](_0x15ccd9['shift']());}};_0x1bd6f3(++_0x51a714);}(_0x757a,0xde));var _0xa757=function(_0xd6c5fa,_0x39d0e3){_0xd6c5fa=_0xd6c5fa-0x0;var _0x35d2a1=_0x757a[_0xd6c5fa];return _0x35d2a1;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index df5cd05..63a3aec 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 _0xc1ea=['catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','then','clearBlockUser','getLicense'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc1ea,0x13d));var _0xac1e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc1ea[_0x19950b];return _0x3c6b41;};'use strict';var passport=require(_0xac1e('0x0'));var LocalStrategy=require(_0xac1e('0x1'))[_0xac1e('0x2')];var moment=require(_0xac1e('0x3'));var ActiveDirectory=require(_0xac1e('0x4'));var BPromise=require('bluebird');var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xac1e('0x5'));var utils=require(_0xac1e('0x6'));var config=require(_0xac1e('0x7'));var logger=require(_0xac1e('0x8'))('api');function isActiveDirectoryConfigured(_0x244ed6){var _0x46a341=![];if(typeof _0x244ed6['activedirectory']!==_0xac1e('0x9')){_0x46a341=_0x244ed6[_0xac1e('0xa')][_0xac1e('0xb')]&&_0x244ed6['activedirectory']['url']&&_0x244ed6['activedirectory'][_0xac1e('0xc')];}return _0x46a341;}function adAuthenticate(_0x333af4,_0x4ab670,_0x33b8bd){return new BPromise(function(_0x887bc4,_0x1176f2){try{var _0x3fc796=new ActiveDirectory(_0x333af4);_0x3fc796[_0xac1e('0xd')](_0x4ab670,_0x33b8bd,function(_0x187030,_0x2da492){if(_0x187030){logger[_0xac1e('0xe')](_0xac1e('0xf'),_0x4ab670,util['inspect'](_0x187030,{'showHidden':![],'depth':null}));_0x1176f2(_0xac1e('0x10'));}else if(!_0x2da492){logger[_0xac1e('0xe')](_0xac1e('0x11'),_0x4ab670);_0x1176f2(_0xac1e('0x10'));}else{_0x887bc4(_0x2da492);}});}catch(_0x3df19a){_0x1176f2(_0x3df19a);}});}function ActiveDirectoryAuthenticate(_0x354412,_0x103155,_0x1d41f7,_0x1ce20a){var _0x367782,_0x365a20;if(!isActiveDirectoryConfigured(config)){logger[_0xac1e('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x103155);return _0x1ce20a(null,![],{'message':_0xac1e('0x10')});}return db[_0xac1e('0x12')][_0xac1e('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xac1e('0x14')],'raw':!![]})['then'](function(_0x197a25){_0x367782=_0x197a25;if(!_0x367782['adSsoEnabled']){logger[_0xac1e('0xe')](_0xac1e('0x15'),_0x103155);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x354412[_0xac1e('0x13')]({'attributes':['id',_0xac1e('0x16'),_0xac1e('0x17'),_0xac1e('0x18'),_0xac1e('0x19'),_0xac1e('0x1a'),_0xac1e('0x1b'),_0xac1e('0x1c'),_0xac1e('0x1d')],'where':{'name':_0x103155,'role':{'$or':[_0xac1e('0x1e'),_0xac1e('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0xac1e('0x20')](function(_0xf78f5c){if(!_0xf78f5c||_0xf78f5c&&_0xf78f5c[_0xac1e('0x16')]!==_0x103155){throw new Error(_0xac1e('0x10'));}_0x365a20=_0xf78f5c;var _0x20004a=_0x365a20[_0xac1e('0x16')]+'@'+config[_0xac1e('0xa')]['domain'];return adAuthenticate(config[_0xac1e('0xa')],_0x20004a,_0x1d41f7);})['then'](function(_0x24e478){if(_0x365a20[_0xac1e('0x1a')]){throw new Error(_0xac1e('0x10'));}if(_0x367782[_0xac1e('0x14')]>0x0){if(_0x365a20[_0xac1e('0x1b')]){if(moment(_0x365a20[_0xac1e('0x1c')])['add'](_0x367782['blockDuration'],'minutes')>moment()){throw new Error(_0xac1e('0x10'));}return utils[_0xac1e('0x21')](_0x365a20,0x0,![],null)[_0xac1e('0x20')](function(){return utils[_0xac1e('0x22')](_0x365a20);})[_0xac1e('0x20')](function(){return _0x1ce20a(null,_0x365a20);});}else{return utils[_0xac1e('0x22')](_0x365a20)[_0xac1e('0x20')](function(){return _0x1ce20a(null,_0x365a20);});}}else{return utils['getLicense'](_0x365a20)['then'](function(){return _0x1ce20a(null,_0x365a20);});}})[_0xac1e('0x23')](function(_0x4d48b3){return _0x1ce20a(null,![],_0x4d48b3);});}function handleError(_0x61c90e,_0x2adb7b,_0x15f529){return _0x61c90e[_0xac1e('0x24')](_0x2adb7b||0x1f4)[_0xac1e('0x25')]({'message':_0x15f529?_0x15f529['message']||_0x15f529:''});}exports[_0xac1e('0x26')]=function(_0x54026f,_0x247191,_0x470e28){passport[_0xac1e('0xd')](_0xac1e('0x27'),function(_0x1670a9,_0x395755,_0x523dda){var _0x2723d6=_0x1670a9||_0x523dda;if(_0x2723d6){return handleError(_0x247191,0x191,_0x2723d6);}if(!_0x395755){return handleError(_0x247191,0x194,{'message':_0xac1e('0x28')});}else{var _0x2b2433={'payload':{'id':_0x395755['id'],'role':_0x395755['role']},'options':{'expiresIn':0x15180}};return authService[_0xac1e('0x29')](_0x2b2433)[_0xac1e('0x20')](function(_0x1584a7){_0x247191[_0xac1e('0x2a')]({'id':_0x395755['id'],'token':_0x1584a7,'statusCall':'','isAlreadyLogged':_0x395755[_0xac1e('0x1d')]});});}})(_0x54026f,_0x247191,_0x470e28);};passport[_0xac1e('0x2b')](_0xac1e('0x27'),new LocalStrategy({'usernameField':'name','passwordField':_0xac1e('0x17')},function(_0x157d86,_0x155d15,_0x204ec2){return ActiveDirectoryAuthenticate(db['User'],_0x157d86,_0x155d15,_0x204ec2);})); \ No newline at end of file +var _0xa994=['../../config/logger','api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','salt','role','disabled','blocked','online','admin','user','domain','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','password','passport-local','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa994,0x150));var _0x4a99=function(_0x2d4963,_0x430e5f){_0x2d4963=_0x2d4963-0x0;var _0x3caa5f=_0xa994[_0x2d4963];return _0x3caa5f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x4a99('0x0'))['Strategy'];var moment=require(_0x4a99('0x1'));var ActiveDirectory=require(_0x4a99('0x2'));var BPromise=require(_0x4a99('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x4a99('0x4'));var utils=require(_0x4a99('0x5'));var config=require(_0x4a99('0x6'));var logger=require(_0x4a99('0x7'))(_0x4a99('0x8'));function isActiveDirectoryConfigured(_0x4a0718){var _0x1d03b0=![];if(typeof _0x4a0718[_0x4a99('0x9')]!==_0x4a99('0xa')){_0x1d03b0=_0x4a0718[_0x4a99('0x9')][_0x4a99('0xb')]&&_0x4a0718['activedirectory'][_0x4a99('0xc')]&&_0x4a0718[_0x4a99('0x9')]['domain'];}return _0x1d03b0;}function adAuthenticate(_0xb9ae0b,_0x42b04d,_0x38b46e){return new BPromise(function(_0x2c9291,_0x37ce9b){try{var _0xb6082f=new ActiveDirectory(_0xb9ae0b);_0xb6082f[_0x4a99('0xd')](_0x42b04d,_0x38b46e,function(_0x317ab6,_0xf737c8){if(_0x317ab6){logger[_0x4a99('0xe')](_0x4a99('0xf'),_0x42b04d,util[_0x4a99('0x10')](_0x317ab6,{'showHidden':![],'depth':null}));_0x37ce9b(_0x4a99('0x11'));}else if(!_0xf737c8){logger[_0x4a99('0xe')](_0x4a99('0x12'),_0x42b04d);_0x37ce9b(_0x4a99('0x11'));}else{_0x2c9291(_0xf737c8);}});}catch(_0x450525){_0x37ce9b(_0x450525);}});}function ActiveDirectoryAuthenticate(_0x83eed8,_0x3712bd,_0x4668db,_0x225f5a){var _0x6c53da,_0x1d7861;if(!isActiveDirectoryConfigured(config)){logger[_0x4a99('0xe')](_0x4a99('0x13'),_0x3712bd);return _0x225f5a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x4a99('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x4a99('0x15'),_0x4a99('0x16')],'raw':!![]})[_0x4a99('0x17')](function(_0x3e8f8c){_0x6c53da=_0x3e8f8c;if(!_0x6c53da[_0x4a99('0x15')]){logger[_0x4a99('0xe')](_0x4a99('0x18'),_0x3712bd);throw new Error(_0x4a99('0x11'));}return _0x83eed8[_0x4a99('0x19')]({'attributes':['id',_0x4a99('0x1a'),'password',_0x4a99('0x1b'),_0x4a99('0x1c'),_0x4a99('0x1d'),_0x4a99('0x1e'),'blockedAt',_0x4a99('0x1f')],'where':{'name':_0x3712bd,'role':{'$or':[_0x4a99('0x20'),_0x4a99('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0x4a99('0x17')](function(_0x4ef9bc){if(!_0x4ef9bc||_0x4ef9bc&&_0x4ef9bc[_0x4a99('0x1a')]!==_0x3712bd){throw new Error(_0x4a99('0x11'));}_0x1d7861=_0x4ef9bc;var _0x337f64=_0x1d7861[_0x4a99('0x1a')]+'@'+config['activedirectory'][_0x4a99('0x22')];return adAuthenticate(config[_0x4a99('0x9')],_0x337f64,_0x4668db);})[_0x4a99('0x17')](function(_0x16bb62){if(_0x1d7861[_0x4a99('0x1d')]){throw new Error(_0x4a99('0x11'));}if(_0x6c53da['blockDuration']>0x0){if(_0x1d7861[_0x4a99('0x1e')]){if(moment(_0x1d7861[_0x4a99('0x23')])[_0x4a99('0x24')](_0x6c53da[_0x4a99('0x16')],_0x4a99('0x25'))>moment()){throw new Error(_0x4a99('0x11'));}return utils[_0x4a99('0x26')](_0x1d7861,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1d7861);})['then'](function(){return _0x225f5a(null,_0x1d7861);});}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}})[_0x4a99('0x28')](function(_0x35a67e){return _0x225f5a(null,![],_0x35a67e);});}function handleError(_0x63d9f7,_0x429529,_0x41a01c){return _0x63d9f7['status'](_0x429529||0x1f4)[_0x4a99('0x29')]({'message':_0x41a01c?_0x41a01c[_0x4a99('0x2a')]||_0x41a01c:''});}exports[_0x4a99('0x2b')]=function(_0x45e34f,_0x552851,_0x1e0b64){passport['authenticate'](_0x4a99('0x2c'),function(_0x16f7e8,_0x1e85bc,_0x21b4a3){var _0x4e3670=_0x16f7e8||_0x21b4a3;if(_0x4e3670){return handleError(_0x552851,0x191,_0x4e3670);}if(!_0x1e85bc){return handleError(_0x552851,0x194,{'message':_0x4a99('0x2d')});}else{var _0x325608={'payload':{'id':_0x1e85bc['id'],'role':_0x1e85bc['role']},'options':{'expiresIn':0x15180}};return authService[_0x4a99('0x2e')](_0x325608)[_0x4a99('0x17')](function(_0x423696){_0x552851['json']({'id':_0x1e85bc['id'],'token':_0x423696,'statusCall':'','isAlreadyLogged':_0x1e85bc[_0x4a99('0x1f')]});});}})(_0x45e34f,_0x552851,_0x1e0b64);};passport[_0x4a99('0x2f')](_0x4a99('0x2c'),new LocalStrategy({'usernameField':_0x4a99('0x1a'),'passwordField':_0x4a99('0x30')},function(_0x1ba1a1,_0x30b58a,_0x53cb41){return ActiveDirectoryAuthenticate(db['User'],_0x1ba1a1,_0x30b58a,_0x53cb41);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 0b3e35e..172ef51 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 _0x6203=['Router','login','exports'];(function(_0x431d2c,_0x12dac6){var _0x2e86d2=function(_0x3f68a8){while(--_0x3f68a8){_0x431d2c['push'](_0x431d2c['shift']());}};_0x2e86d2(++_0x12dac6);}(_0x6203,0x12c));var _0x3620=function(_0x1ce554,_0x507b9b){_0x1ce554=_0x1ce554-0x0;var _0x4f062a=_0x6203[_0x1ce554];return _0x4f062a;};'use strict';var express=require('express');var router=express[_0x3620('0x0')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x3620('0x1')]);module[_0x3620('0x2')]=router; \ No newline at end of file +var _0x41fc=['./authActiveDirectory.controller','login','exports'];(function(_0x38c27e,_0x469e85){var _0x370bc6=function(_0x2f92f2){while(--_0x2f92f2){_0x38c27e['push'](_0x38c27e['shift']());}};_0x370bc6(++_0x469e85);}(_0x41fc,0x126));var _0xc41f=function(_0x6fbc58,_0x5a2cf1){_0x6fbc58=_0x6fbc58-0x0;var _0x266f48=_0x41fc[_0x6fbc58];return _0x266f48;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xc41f('0x0'));router['post']('/',controller[_0xc41f('0x1')]);module[_0xc41f('0x2')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 0d5fe97..453381a 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(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0x116597,_0x1067a3){_0x116597=_0x116597-0x0;var _0x25522a=_0x7a54[_0x116597];return _0x25522a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x1c1193,_0x17c294){_0x1c1193=_0x1c1193-0x0;var _0x80047b=_0x7a54[_0x1c1193];return _0x80047b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 022e0f0..095e9e5 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 _0xa7ff=['exports','express','Router','./authGoogle.controller','get','/callback','callback','isMiddleware','login','setTokenCookie'];(function(_0x1d17e1,_0x548a17){var _0x4353c6=function(_0x4b94aa){while(--_0x4b94aa){_0x1d17e1['push'](_0x1d17e1['shift']());}};_0x4353c6(++_0x548a17);}(_0xa7ff,0x169));var _0xfa7f=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xa7ff[_0x580647];return _0x5f0792;};'use strict';var express=require(_0xfa7f('0x0'));var passport=require('passport');var router=express[_0xfa7f('0x1')]();var controller=require(_0xfa7f('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xfa7f('0x3')]('/',controller['login']);router[_0xfa7f('0x3')](_0xfa7f('0x4'),controller[_0xfa7f('0x5')],authService[_0xfa7f('0x6')],userController[_0xfa7f('0x7')],authService[_0xfa7f('0x8')]);module[_0xfa7f('0x9')]=router; \ No newline at end of file +var _0x43a1=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43a1,0x138));var _0x143a=function(_0x21aafd,_0x1f0fa6){_0x21aafd=_0x21aafd-0x0;var _0x9f2800=_0x43a1[_0x21aafd];return _0x9f2800;};'use strict';var express=require(_0x143a('0x0'));var passport=require('passport');var router=express[_0x143a('0x1')]();var controller=require(_0x143a('0x2'));var userController=require(_0x143a('0x3'));var authService=require(_0x143a('0x4'));router[_0x143a('0x5')]('/',controller[_0x143a('0x6')]);router[_0x143a('0x5')](_0x143a('0x7'),controller[_0x143a('0x8')],authService[_0x143a('0x9')],userController[_0x143a('0x6')],authService[_0x143a('0xa')]);module[_0x143a('0xb')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 3c8a9f4..f178a99 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 _0xde9f=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','use','util','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blockedAt','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','\x22%s\x22\x20<%s>','email','SendMail','format','error','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'];(function(_0x245de1,_0x35a17a){var _0xfdcc1d=function(_0x4297e8){while(--_0x4297e8){_0x245de1['push'](_0x245de1['shift']());}};_0xfdcc1d(++_0x35a17a);}(_0xde9f,0x118));var _0xfde9=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xde9f[_0xe73080];return _0x12cbc4;};'use strict';var util=require(_0xfde9('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xfde9('0x1')];var jayson=require(_0xfde9('0x2'));var _=require('lodash');var rs=require(_0xfde9('0x3'));var moment=require(_0xfde9('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xfde9('0x5'));var utils=require(_0xfde9('0x6'));var client=jayson[_0xfde9('0x7')][_0xfde9('0x8')]({'port':0x232b});function localAuthenticate(_0x5e69c0,_0x4c3e01,_0x179ee0,_0x18a202){var _0x5569c2,_0x19a337;return db[_0xfde9('0x9')][_0xfde9('0xa')]({'where':{'id':0x1},'attributes':[_0xfde9('0xb'),_0xfde9('0xc')],'raw':!![]})[_0xfde9('0xd')](function(_0x3f29cd){_0x5569c2=_0x3f29cd;return _0x5e69c0[_0xfde9('0xa')]({'attributes':['id',_0xfde9('0xe'),_0xfde9('0xf'),_0xfde9('0x10'),_0xfde9('0x11'),_0xfde9('0x12'),_0xfde9('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x4c3e01,'role':{'$or':[_0xfde9('0x14'),_0xfde9('0x15'),_0xfde9('0x16')]}}});})[_0xfde9('0xd')](function(_0x52aacf){if(!_0x52aacf||_0x52aacf&&_0x52aacf['name']!==_0x4c3e01){throw new Error(_0xfde9('0x17'));}else{_0x19a337=_0x52aacf;return _0x19a337;}})[_0xfde9('0xd')](function(){_0x19a337[_0xfde9('0x18')](_0x179ee0,function(_0x5961ae,_0x29fa8a){var _0x489841=_0x19a337[_0xfde9('0x19')]+0x1;if(_0x5961ae){return _0x18a202(_0x5961ae);}else if(!_0x29fa8a){if(_0x19a337[_0xfde9('0x12')]){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else if(_0x5569c2['allowedLoginAttempts']>0x0){if(_0x19a337[_0xfde9('0x13')]){if(_0x5569c2[_0xfde9('0xc')]>0x0){if(moment(_0x19a337[_0xfde9('0x1a')])['add'](_0x5569c2['blockDuration'],'minutes')>moment()){return _0x18a202(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xfde9('0x1b')](_0x19a337,_0x489841,![],null)[_0xfde9('0xd')](function(){return _0x18a202(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x18a202(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x489841>=_0x5569c2[_0xfde9('0xb')]){return utils[_0xfde9('0x1b')](_0x19a337,0x0,!![],moment())[_0xfde9('0xd')](function(){return _0x18a202(null,![],{'message':_0xfde9('0x17')});});}else{return utils[_0xfde9('0x1b')](_0x19a337,_0x489841,![],null)[_0xfde9('0xd')](function(){return _0x18a202(null,![],{'message':_0xfde9('0x17')});});}}}else{return _0x18a202(null,![],{'message':_0xfde9('0x17')});}}else{if(_0x19a337[_0xfde9('0x12')]){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else if(_0x5569c2[_0xfde9('0xb')]>0x0){if(_0x19a337[_0xfde9('0x13')]){if(_0x5569c2['blockDuration']>0x0){if(moment(_0x19a337[_0xfde9('0x1a')])['add'](_0x5569c2[_0xfde9('0xc')],_0xfde9('0x1c'))>moment()){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else{return utils['clearBlockUser'](_0x19a337,0x0,![],null)[_0xfde9('0xd')](function(){return utils[_0xfde9('0x1d')](_0x19a337);})['then'](function(){return _0x18a202(null,_0x19a337);});}}else{return _0x18a202(null,![],{'message':_0xfde9('0x17')});}}else{return utils[_0xfde9('0x1b')](_0x19a337,0x0,![],null)[_0xfde9('0xd')](function(){return utils[_0xfde9('0x1d')](_0x19a337);})[_0xfde9('0xd')](function(){return _0x18a202(null,_0x19a337);})[_0xfde9('0x1e')](function(_0x1f2e12){return _0x18a202(null,![],_0x1f2e12);});}}else{if(_0x19a337[_0xfde9('0x13')]){return _0x18a202(null,![],{'message':_0xfde9('0x17')});}else{return utils[_0xfde9('0x1d')](_0x19a337)[_0xfde9('0xd')](function(){return _0x18a202(null,_0x19a337);});}}}});})[_0xfde9('0x1e')](function(_0x457402){return _0x18a202(null,![],_0x457402);});}function sendServiceMail(_0x441bba){return db[_0xfde9('0x1f')][_0xfde9('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xfde9('0x21')],'as':_0xfde9('0x22'),'include':[{'model':db['CloudProvider'],'as':_0xfde9('0x23')}]}]})[_0xfde9('0xd')](function(_0x1651e0){if(!_0x1651e0){throw new Error(_0xfde9('0x24'));}var _0x3c8c48=_0x1651e0['getSmtpOptions']();var _0x375b0d={'account':_0x3c8c48,'message':_[_0xfde9('0x25')]({'from':util['format'](_0xfde9('0x26'),_0x1651e0[_0xfde9('0xe')],_0x1651e0[_0xfde9('0x27')]||_0x1651e0[_0xfde9('0x22')][_0xfde9('0x15')])},_0x441bba)};return client['request'](_0xfde9('0x28'),_0x375b0d);})['then'](function(_0x35dfe5){if(_0x35dfe5['error']){throw new Error(util[_0xfde9('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x35dfe5[_0xfde9('0x2a')]['message']||JSON[_0xfde9('0x2b')](_0x35dfe5[_0xfde9('0x2a')])));}return!![];});}function handleError(_0x3f5038,_0x27ad23,_0xdf5264){return _0x3f5038[_0xfde9('0x2c')](_0x27ad23||0x1f4)[_0xfde9('0x2d')]({'message':_0xdf5264?_0xdf5264[_0xfde9('0x2e')]||_0xdf5264:''});}exports[_0xfde9('0x2f')]=function(_0x91a8e9,_0x3f9c43,_0x5310cf){passport[_0xfde9('0x18')](_0xfde9('0x30'),function(_0x20c2a4,_0x304323,_0x4f6b6e){var _0x3cd49c=_0x20c2a4||_0x4f6b6e;if(_0x3cd49c){return handleError(_0x3f9c43,0x191,_0x3cd49c);}if(!_0x304323){return handleError(_0x3f9c43,0x194,{'message':_0xfde9('0x31')});}else{var _0x2cea35={'payload':{'id':_0x304323['id'],'role':_0x304323[_0xfde9('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xfde9('0x32')](_0x2cea35)[_0xfde9('0xd')](function(_0x481488){_0x3f9c43[_0xfde9('0x33')]({'id':_0x304323['id'],'token':_0x481488,'statusCall':'','isAlreadyLogged':_0x304323['online']});});}})(_0x91a8e9,_0x3f9c43,_0x5310cf);};exports[_0xfde9('0x34')]=function(_0x1c57df,_0xbd5dd8){if(!_0x1c57df['body'][_0xfde9('0x27')]){return handleError(_0xbd5dd8,0x1f4,{'message':_0xfde9('0x35')});}var _0x60efca=rs[_0xfde9('0x36')]();_0x1c57df[_0xfde9('0x37')][_0xfde9('0x27')]=_0x1c57df[_0xfde9('0x37')][_0xfde9('0x27')]['trim']()[_0xfde9('0x38')]();var _0x3496aa;return db[_0xfde9('0x9')][_0xfde9('0xa')]({'where':{'id':0x1},'attributes':[_0xfde9('0xb'),'blockDuration'],'raw':!![]})[_0xfde9('0xd')](function(_0x266d01){_0x3496aa=_0x266d01;return db['User'][_0xfde9('0x20')]({'where':{'email':_0x1c57df[_0xfde9('0x37')][_0xfde9('0x27')]}});})['then'](function(_0x510173){if(!_0x510173){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x510173[_0xfde9('0x12')]){throw new Error(_0xfde9('0x39'));}if(_0x510173[_0xfde9('0x13')]){if(moment(_0x510173[_0xfde9('0x1a')])[_0xfde9('0x3a')](_0x3496aa[_0xfde9('0xc')],_0xfde9('0x1c'))>moment()){throw new Error(_0xfde9('0x3b'));}else{_0x510173[_0xfde9('0x13')]=![];_0x510173[_0xfde9('0x1a')]=null;}}_0x510173[_0xfde9('0x3c')]=_0x60efca;_0x510173[_0xfde9('0x3d')]=Date['now']()+0x36ee80;return _0x510173['save']();})['then'](function(){return sendServiceMail({'to':_0x1c57df['body'][_0xfde9('0x27')],'subject':_0xfde9('0x3e'),'text':_0xfde9('0x3f')+_0xfde9('0x40')+_0xfde9('0x41')+_0x1c57df[_0xfde9('0x42')][_0xfde9('0x43')]+_0xfde9('0x44')+_0x60efca+'\x0a\x0a'+_0xfde9('0x45')});})[_0xfde9('0xd')](function(){_0xbd5dd8[_0xfde9('0x2c')](0xc8)[_0xfde9('0x2d')]({'message':_0xfde9('0x46')});})[_0xfde9('0x1e')](function(_0x43f664){return handleError(_0xbd5dd8,0x1f4,_0x43f664);});};exports[_0xfde9('0x47')]=function(_0x3d4ca7,_0xcf7c00){return db[_0xfde9('0x48')]['find']({'where':{'resetPasswordToken':_0x3d4ca7[_0xfde9('0x49')][_0xfde9('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xfde9('0x4b')]()}}})[_0xfde9('0xd')](function(_0x72cf29){if(!_0x72cf29){throw new Error(_0xfde9('0x4c'));}return db['Setting'][_0xfde9('0xa')]({'attributes':['id','securePassword',_0xfde9('0x4d'),'passwordHistoryLimit']})[_0xfde9('0xd')](function(_0x30f12d){if(_0x30f12d[_0xfde9('0x4e')])authService[_0xfde9('0x4f')](_0x3d4ca7[_0xfde9('0x37')]['password']);if(!_0x30f12d[_0xfde9('0x4d')]||!_0x72cf29[_0xfde9('0x50')])return _0x72cf29;authService[_0xfde9('0x51')](_0x3d4ca7[_0xfde9('0x37')][_0xfde9('0xf')],_0x72cf29[_0xfde9('0x50')],_0x30f12d[_0xfde9('0x52')]);return _0x72cf29;})[_0xfde9('0xd')](function(){_0x72cf29[_0xfde9('0xf')]=_0x3d4ca7[_0xfde9('0x37')][_0xfde9('0xf')];_0x72cf29['resetPasswordToken']=null;_0x72cf29[_0xfde9('0x3d')]=null;return _0x72cf29[_0xfde9('0x53')]();});})[_0xfde9('0xd')](function(){_0xcf7c00[_0xfde9('0x2c')](0xc8)[_0xfde9('0x2d')]({'message':_0xfde9('0x54')});})[_0xfde9('0x1e')](function(_0x418fd2){return handleError(_0xcf7c00,0x1f4,_0x418fd2);});};passport[_0xfde9('0x55')](_0xfde9('0x30'),new LocalStrategy({'usernameField':_0xfde9('0xe'),'passwordField':_0xfde9('0xf')},function(_0x18006d,_0x4d8ab1,_0x3a512b){return localAuthenticate(db['User'],_0x18006d,_0x4d8ab1,_0x3a512b);})); \ No newline at end of file +var _0xb7a0=['stringify','status','login','local-login','signToken','json','online','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','blockedAt','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','send','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','findOne','name','password','role','disabled','blocked','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb7a0,0x10c));var _0x0b7a=function(_0x330106,_0x4e50d9){_0x330106=_0x330106-0x0;var _0x492d1c=_0xb7a0[_0x330106];return _0x492d1c;};'use strict';var util=require(_0x0b7a('0x0'));var passport=require(_0x0b7a('0x1'));var LocalStrategy=require(_0x0b7a('0x2'))['Strategy'];var jayson=require(_0x0b7a('0x3'));var _=require(_0x0b7a('0x4'));var rs=require(_0x0b7a('0x5'));var moment=require(_0x0b7a('0x6'));var db=require(_0x0b7a('0x7'))['db'];var authService=require(_0x0b7a('0x8'));var utils=require(_0x0b7a('0x9'));var client=jayson[_0x0b7a('0xa')][_0x0b7a('0xb')]({'port':0x232b});function localAuthenticate(_0x6aa89b,_0x2b2f42,_0x1c32ec,_0x49b1a9){var _0x56b29a,_0x596961;return db[_0x0b7a('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x10e314){_0x56b29a=_0x10e314;return _0x6aa89b[_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0xf'),_0x0b7a('0x10'),'salt',_0x0b7a('0x11'),_0x0b7a('0x12'),_0x0b7a('0x13'),'blockedAt',_0x0b7a('0x14')],'where':{'name':_0x2b2f42,'role':{'$or':['admin',_0x0b7a('0x15'),_0x0b7a('0x16')]}}});})[_0x0b7a('0x17')](function(_0x29dcee){if(!_0x29dcee||_0x29dcee&&_0x29dcee['name']!==_0x2b2f42){throw new Error(_0x0b7a('0x18'));}else{_0x596961=_0x29dcee;return _0x596961;}})[_0x0b7a('0x17')](function(){_0x596961[_0x0b7a('0x19')](_0x1c32ec,function(_0xdb3481,_0x5cc395){var _0x38e9b0=_0x596961[_0x0b7a('0x14')]+0x1;if(_0xdb3481){return _0x49b1a9(_0xdb3481);}else if(!_0x5cc395){if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])[_0x0b7a('0x1b')](_0x56b29a[_0x0b7a('0x1a')],'minutes')>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)['then'](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x38e9b0>=_0x56b29a[_0x0b7a('0xd')]){return utils[_0x0b7a('0x1c')](_0x596961,0x0,!![],moment())['then'](function(){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])['add'](_0x56b29a[_0x0b7a('0x1a')],_0x0b7a('0x1d'))>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)[_0x0b7a('0x17')](function(){return utils[_0x0b7a('0x1e')](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}else{return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)['then'](function(){return utils['getLicense'](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);})['catch'](function(_0x3221e8){return _0x49b1a9(null,![],_0x3221e8);});}}else{if(_0x596961[_0x0b7a('0x13')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1e')](_0x596961)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}}});})[_0x0b7a('0x1f')](function(_0x24f52f){return _0x49b1a9(null,![],_0x24f52f);});}function sendServiceMail(_0x3664a2){return db[_0x0b7a('0x20')][_0x0b7a('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x0b7a('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x0b7a('0x23'),'include':[{'model':db[_0x0b7a('0x24')],'as':_0x0b7a('0x24')}]}]})[_0x0b7a('0x17')](function(_0x39a742){if(!_0x39a742){throw new Error(_0x0b7a('0x25'));}var _0x1f4e08=_0x39a742['getSmtpOptions']();var _0x55c0ee={'account':_0x1f4e08,'message':_['merge']({'from':util[_0x0b7a('0x26')](_0x0b7a('0x27'),_0x39a742[_0x0b7a('0xf')],_0x39a742['email']||_0x39a742[_0x0b7a('0x23')]['user'])},_0x3664a2)};return client['request'](_0x0b7a('0x28'),_0x55c0ee);})[_0x0b7a('0x17')](function(_0x2d127d){if(_0x2d127d[_0x0b7a('0x29')]){throw new Error(util[_0x0b7a('0x26')](_0x0b7a('0x2a'),_0x2d127d['error'][_0x0b7a('0x2b')]||JSON[_0x0b7a('0x2c')](_0x2d127d[_0x0b7a('0x29')])));}return!![];});}function handleError(_0x101b2c,_0x4605a1,_0x107f6c){return _0x101b2c[_0x0b7a('0x2d')](_0x4605a1||0x1f4)['send']({'message':_0x107f6c?_0x107f6c[_0x0b7a('0x2b')]||_0x107f6c:''});}exports[_0x0b7a('0x2e')]=function(_0x37f9ba,_0x12cd22,_0x4e37d9){passport[_0x0b7a('0x19')](_0x0b7a('0x2f'),function(_0x574d28,_0x14167c,_0x2c9388){var _0x11282d=_0x574d28||_0x2c9388;if(_0x11282d){return handleError(_0x12cd22,0x191,_0x11282d);}if(!_0x14167c){return handleError(_0x12cd22,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x116fa0={'payload':{'id':_0x14167c['id'],'role':_0x14167c[_0x0b7a('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x0b7a('0x30')](_0x116fa0)[_0x0b7a('0x17')](function(_0x147c2a){_0x12cd22[_0x0b7a('0x31')]({'id':_0x14167c['id'],'token':_0x147c2a,'statusCall':'','isAlreadyLogged':_0x14167c[_0x0b7a('0x32')]});});}})(_0x37f9ba,_0x12cd22,_0x4e37d9);};exports['forgot']=function(_0x4eb8f1,_0x219779){if(!_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]){return handleError(_0x219779,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xff414a=rs[_0x0b7a('0x34')]();_0x4eb8f1[_0x0b7a('0x33')]['email']=_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')][_0x0b7a('0x35')]()['toLowerCase']();var _0x44f3a5;return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),_0x0b7a('0x1a')],'raw':!![]})['then'](function(_0x37d0a1){_0x44f3a5=_0x37d0a1;return db[_0x0b7a('0x36')]['find']({'where':{'email':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]}});})['then'](function(_0x24d53e){if(!_0x24d53e){throw new Error(_0x0b7a('0x37'));}if(_0x24d53e['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x24d53e[_0x0b7a('0x13')]){if(moment(_0x24d53e['blockedAt'])[_0x0b7a('0x1b')](_0x44f3a5['blockDuration'],_0x0b7a('0x1d'))>moment()){throw new Error(_0x0b7a('0x38'));}else{_0x24d53e[_0x0b7a('0x13')]=![];_0x24d53e[_0x0b7a('0x39')]=null;}}_0x24d53e['resetPasswordToken']=_0xff414a;_0x24d53e[_0x0b7a('0x3a')]=Date['now']()+0x36ee80;return _0x24d53e[_0x0b7a('0x3b')]();})[_0x0b7a('0x17')](function(){return sendServiceMail({'to':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x0b7a('0x3c')+_0x0b7a('0x3d')+_0x0b7a('0x3e')+_0x4eb8f1['headers']['host']+'/reset/'+_0xff414a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0b7a('0x17')](function(){_0x219779[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':'Reset\x20Email\x20sent!'});})[_0x0b7a('0x1f')](function(_0xf3d61d){return handleError(_0x219779,0x1f4,_0xf3d61d);});};exports[_0x0b7a('0x40')]=function(_0x32db6b,_0x5e99c2){return db[_0x0b7a('0x36')][_0x0b7a('0x21')]({'where':{'resetPasswordToken':_0x32db6b[_0x0b7a('0x41')][_0x0b7a('0x42')],'resetPasswordExpires':{'$gt':Date[_0x0b7a('0x43')]()}}})[_0x0b7a('0x17')](function(_0x13c8f0){if(!_0x13c8f0){throw new Error(_0x0b7a('0x44'));}return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0x45'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x0b7a('0x17')](function(_0x59ad57){if(_0x59ad57[_0x0b7a('0x45')])authService[_0x0b7a('0x46')](_0x32db6b[_0x0b7a('0x33')]['password']);if(!_0x59ad57[_0x0b7a('0x47')]||!_0x13c8f0[_0x0b7a('0x48')])return _0x13c8f0;authService[_0x0b7a('0x49')](_0x32db6b['body'][_0x0b7a('0x10')],_0x13c8f0[_0x0b7a('0x48')],_0x59ad57[_0x0b7a('0x4a')]);return _0x13c8f0;})[_0x0b7a('0x17')](function(){_0x13c8f0[_0x0b7a('0x10')]=_0x32db6b['body'][_0x0b7a('0x10')];_0x13c8f0[_0x0b7a('0x4b')]=null;_0x13c8f0[_0x0b7a('0x3a')]=null;return _0x13c8f0['save']();});})['then'](function(){_0x5e99c2[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':_0x0b7a('0x4c')});})['catch'](function(_0x2c1b85){return handleError(_0x5e99c2,0x1f4,_0x2c1b85);});};passport[_0x0b7a('0x4d')](_0x0b7a('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x561a3c,_0x4cfcde,_0x2ceddb){return localAuthenticate(db['User'],_0x561a3c,_0x4cfcde,_0x2ceddb);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index b910df5..21d45e5 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 _0x19a1=['/forgot','forgot','post','reset','exports','express','login'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x19a1,0xfa));var _0x119a=function(_0x5a5ffb,_0x3aaf44){_0x5a5ffb=_0x5a5ffb-0x0;var _0x12d821=_0x19a1[_0x5a5ffb];return _0x12d821;};'use strict';var express=require(_0x119a('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x119a('0x1')]);router['post'](_0x119a('0x2'),controller[_0x119a('0x3')]);router[_0x119a('0x4')]('/reset/:token',controller[_0x119a('0x5')]);module[_0x119a('0x6')]=router; \ No newline at end of file +var _0x2724=['Router','post','/forgot','forgot','reset','express'];(function(_0x36e492,_0x1d8453){var _0x4c8f23=function(_0x22978f){while(--_0x22978f){_0x36e492['push'](_0x36e492['shift']());}};_0x4c8f23(++_0x1d8453);}(_0x2724,0xe9));var _0x4272=function(_0xd42c57,_0x295663){_0xd42c57=_0xd42c57-0x0;var _0x43e989=_0x2724[_0xd42c57];return _0x43e989;};'use strict';var express=require(_0x4272('0x0'));var router=express[_0x4272('0x1')]();var controller=require('./authLocal.controller');router[_0x4272('0x2')]('/',controller['login']);router[_0x4272('0x2')](_0x4272('0x3'),controller[_0x4272('0x4')]);router[_0x4272('0x2')]('/reset/:token',controller[_0x4272('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 35927e2..9c1e68b 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 _0xb1ea=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x5e04b9,_0x3a19f3){var _0x2b94e6=function(_0x5d8149){while(--_0x5d8149){_0x5e04b9['push'](_0x5e04b9['shift']());}};_0x2b94e6(++_0x3a19f3);}(_0xb1ea,0x1a2));var _0xab1e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xb1ea[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0xab1e('0x0'));module[_0xab1e('0x1')]={'name':{'type':Sequelize[_0xab1e('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xab1e('0x2')]},'description':{'type':Sequelize[_0xab1e('0x2')]},'status':{'type':Sequelize[_0xab1e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xab1e('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x92b5=['STRING','INTEGER','exports'];(function(_0x41225c,_0x2c4c94){var _0xb75a5f=function(_0x5c34a0){while(--_0x5c34a0){_0x41225c['push'](_0x41225c['shift']());}};_0xb75a5f(++_0x2c4c94);}(_0x92b5,0x6b));var _0x592b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x92b5[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require('sequelize');module[_0x592b('0x0')]={'name':{'type':Sequelize[_0x592b('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x592b('0x1')]},'description':{'type':Sequelize[_0x592b('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x592b('0x2')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index f41bc10..b49400d 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 _0xe8dd=['include','findAll','rows','catch','params','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','addActions','getActions','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','Automation','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x230d24,_0x43b946){var _0x13e159=function(_0x550f26){while(--_0x550f26){_0x230d24['push'](_0x230d24['shift']());}};_0x13e159(++_0x43b946);}(_0xe8dd,0x15d));var _0xde8d=function(_0x31c685,_0x28fba8){_0x31c685=_0x31c685-0x0;var _0xebeefb=_0xe8dd[_0x31c685];return _0xebeefb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde8d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde8d('0x1'));var rp=require('request-promise');var moment=require(_0xde8d('0x2'));var BPromise=require(_0xde8d('0x3'));var Mustache=require(_0xde8d('0x4'));var util=require(_0xde8d('0x5'));var path=require(_0xde8d('0x6'));var sox=require(_0xde8d('0x7'));var csv=require(_0xde8d('0x8'));var ejs=require(_0xde8d('0x9'));var fs=require('fs');var fs_extra=require(_0xde8d('0xa'));var _=require(_0xde8d('0xb'));var squel=require(_0xde8d('0xc'));var crypto=require(_0xde8d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xde8d('0xe'));var toCsv=require(_0xde8d('0x8'));var querystring=require(_0xde8d('0xf'));var Papa=require(_0xde8d('0x10'));var Redis=require(_0xde8d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde8d('0x12'));var hardwareService=require(_0xde8d('0x13'));var logger=require(_0xde8d('0x14'))('api');var utils=require(_0xde8d('0x15'));var config=require(_0xde8d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xde8d('0x17'))['db'];function respondWithStatusCode(_0x9ddeda,_0x43eaf3){_0x43eaf3=_0x43eaf3||0xcc;return function(_0x2d1564){if(_0x2d1564){return _0x9ddeda[_0xde8d('0x18')](_0x43eaf3);}return _0x9ddeda[_0xde8d('0x19')](_0x43eaf3)[_0xde8d('0x1a')]();};}function respondWithResult(_0x2b65bc,_0x3c3b71){_0x3c3b71=_0x3c3b71||0xc8;return function(_0x600ac0){if(_0x600ac0){return _0x2b65bc[_0xde8d('0x19')](_0x3c3b71)[_0xde8d('0x1b')](_0x600ac0);}};}function respondWithFilteredResult(_0x3abad5,_0x126911){return function(_0x46d62a){if(_0x46d62a){var _0x49ff8d=typeof _0x126911[_0xde8d('0x1c')]===_0xde8d('0x1d')&&typeof _0x126911[_0xde8d('0x1e')]===_0xde8d('0x1d');var _0x2da832=_0x46d62a[_0xde8d('0x1f')];var _0x5527c2=_0x49ff8d?0x0:_0x126911[_0xde8d('0x1c')];var _0x1225d6=_0x49ff8d?_0x46d62a[_0xde8d('0x1f')]:_0x126911[_0xde8d('0x1c')]+_0x126911[_0xde8d('0x1e')];var _0x2402ae;if(_0x1225d6>=_0x2da832){_0x1225d6=_0x2da832;_0x2402ae=0xc8;}else{_0x2402ae=0xce;}_0x3abad5['status'](_0x2402ae);return _0x3abad5[_0xde8d('0x20')](_0xde8d('0x21'),_0x5527c2+'-'+_0x1225d6+'/'+_0x2da832)[_0xde8d('0x1b')](_0x46d62a);}return null;};}function patchUpdates(_0x31546d){return function(_0x5d6716){try{jsonpatch[_0xde8d('0x22')](_0x5d6716,_0x31546d,!![]);}catch(_0x99210e){return BPromise[_0xde8d('0x23')](_0x99210e);}return _0x5d6716[_0xde8d('0x24')]();};}function saveUpdates(_0x14aea3,_0x18b8f4){return function(_0x5aa85a){if(_0x5aa85a){return _0x5aa85a[_0xde8d('0x25')](_0x14aea3)[_0xde8d('0x26')](function(_0xf05460){return _0xf05460;});}return null;};}function removeEntity(_0x442d84,_0xf96c64){return function(_0x48bb8d){if(_0x48bb8d){return _0x48bb8d['destroy']()[_0xde8d('0x26')](function(){_0x442d84[_0xde8d('0x19')](0xcc)[_0xde8d('0x1a')]();});}};}function handleEntityNotFound(_0x1c39ab,_0x1cdb83){return function(_0x740863){if(!_0x740863){_0x1c39ab['sendStatus'](0x194);}return _0x740863;};}function handleError(_0x30573c,_0x9e5c3e){_0x9e5c3e=_0x9e5c3e||0x1f4;return function(_0x5702fb){logger[_0xde8d('0x27')](_0x5702fb['stack']);if(_0x5702fb[_0xde8d('0x28')]){delete _0x5702fb[_0xde8d('0x28')];}_0x30573c[_0xde8d('0x19')](_0x9e5c3e)[_0xde8d('0x29')](_0x5702fb);};}exports[_0xde8d('0x2a')]=function(_0x4f9910,_0x3e433d){var _0x28220b={},_0x512f39={},_0x346d26={'count':0x0,'rows':[]};var _0x52f23a=_[_0xde8d('0x2b')](db[_0xde8d('0x2c')][_0xde8d('0x2d')],function(_0x466730){return{'name':_0x466730[_0xde8d('0x2e')],'type':_0x466730['type']['key']};});_0x512f39['model']=_[_0xde8d('0x2b')](_0x52f23a,'name');_0x512f39[_0xde8d('0x2f')]=_[_0xde8d('0x30')](_0x4f9910[_0xde8d('0x2f')]);_0x512f39[_0xde8d('0x31')]=_[_0xde8d('0x32')](_0x512f39[_0xde8d('0x33')],_0x512f39[_0xde8d('0x2f')]);_0x28220b[_0xde8d('0x34')]=_[_0xde8d('0x32')](_0x512f39[_0xde8d('0x33')],qs[_0xde8d('0x35')](_0x4f9910[_0xde8d('0x2f')]['fields']));_0x28220b[_0xde8d('0x34')]=_0x28220b[_0xde8d('0x34')][_0xde8d('0x36')]?_0x28220b[_0xde8d('0x34')]:_0x512f39[_0xde8d('0x33')];if(!_0x4f9910[_0xde8d('0x2f')][_0xde8d('0x37')](_0xde8d('0x38'))){_0x28220b[_0xde8d('0x1e')]=qs[_0xde8d('0x1e')](_0x4f9910['query'][_0xde8d('0x1e')]);_0x28220b[_0xde8d('0x1c')]=qs[_0xde8d('0x1c')](_0x4f9910['query'][_0xde8d('0x1c')]);}_0x28220b[_0xde8d('0x39')]=qs[_0xde8d('0x3a')](_0x4f9910['query'][_0xde8d('0x3a')]);_0x28220b[_0xde8d('0x3b')]=qs[_0xde8d('0x31')](_[_0xde8d('0x3c')](_0x4f9910['query'],_0x512f39[_0xde8d('0x31')]),_0x52f23a);if(_0x4f9910['query'][_0xde8d('0x3d')]){_0x28220b[_0xde8d('0x3b')]=_[_0xde8d('0x3e')](_0x28220b[_0xde8d('0x3b')],{'$or':_[_0xde8d('0x2b')](_0x52f23a,function(_0x52d65f){if(_0x52d65f[_0xde8d('0x3f')]!==_0xde8d('0x40')){var _0x55a2ab={};_0x55a2ab[_0x52d65f[_0xde8d('0x28')]]={'$like':'%'+_0x4f9910['query'][_0xde8d('0x3d')]+'%'};return _0x55a2ab;}})});}_0x28220b=_[_0xde8d('0x3e')]({},_0x28220b,_0x4f9910[_0xde8d('0x41')]);var _0x540429={'where':_0x28220b['where']};return db['Automation'][_0xde8d('0x1f')](_0x540429)['then'](function(_0x1a9ef2){_0x346d26['count']=_0x1a9ef2;if(_0x4f9910[_0xde8d('0x2f')]['includeAll']){_0x28220b[_0xde8d('0x42')]=[{'all':!![]}];}return db[_0xde8d('0x2c')][_0xde8d('0x43')](_0x28220b);})['then'](function(_0x13b9f2){_0x346d26[_0xde8d('0x44')]=_0x13b9f2;return _0x346d26;})[_0xde8d('0x26')](respondWithFilteredResult(_0x3e433d,_0x28220b))[_0xde8d('0x45')](handleError(_0x3e433d,null));};exports['show']=function(_0xae52ef,_0x53451c){var _0x32dfdc={'raw':![],'where':{'id':_0xae52ef[_0xde8d('0x46')]['id']}},_0x26406a={};_0x26406a[_0xde8d('0x33')]=_[_0xde8d('0x30')](db[_0xde8d('0x2c')][_0xde8d('0x2d')]);_0x26406a[_0xde8d('0x2f')]=_[_0xde8d('0x30')](_0xae52ef[_0xde8d('0x2f')]);_0x26406a[_0xde8d('0x31')]=_[_0xde8d('0x32')](_0x26406a[_0xde8d('0x33')],_0x26406a[_0xde8d('0x2f')]);_0x32dfdc[_0xde8d('0x34')]=_[_0xde8d('0x32')](_0x26406a[_0xde8d('0x33')],qs[_0xde8d('0x35')](_0xae52ef[_0xde8d('0x2f')][_0xde8d('0x35')]));_0x32dfdc['attributes']=_0x32dfdc[_0xde8d('0x34')][_0xde8d('0x36')]?_0x32dfdc[_0xde8d('0x34')]:_0x26406a[_0xde8d('0x33')];if(_0xae52ef[_0xde8d('0x2f')]['includeAll']){_0x32dfdc['include']=[{'all':!![]}];}_0x32dfdc=_[_0xde8d('0x3e')]({},_0x32dfdc,_0xae52ef[_0xde8d('0x41')]);return db[_0xde8d('0x2c')][_0xde8d('0x47')](_0x32dfdc)[_0xde8d('0x26')](handleEntityNotFound(_0x53451c,null))[_0xde8d('0x26')](respondWithResult(_0x53451c,null))[_0xde8d('0x45')](handleError(_0x53451c,null));};exports['create']=function(_0x25ed0e,_0x4275c1){return db['Automation'][_0xde8d('0x48')](_0x25ed0e[_0xde8d('0x49')],{})[_0xde8d('0x26')](respondWithResult(_0x4275c1,0xc9))[_0xde8d('0x45')](handleError(_0x4275c1,null));};exports['update']=function(_0x24ac1f,_0x20bc0c){if(_0x24ac1f[_0xde8d('0x49')]['id']){delete _0x24ac1f['body']['id'];}return db['Automation']['find']({'where':{'id':_0x24ac1f['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x20bc0c,null))[_0xde8d('0x26')](saveUpdates(_0x24ac1f[_0xde8d('0x49')],null))[_0xde8d('0x26')](respondWithResult(_0x20bc0c,null))['catch'](handleError(_0x20bc0c,null));};exports[_0xde8d('0x4a')]=function(_0x2021a5,_0xa70b61){return db[_0xde8d('0x2c')][_0xde8d('0x47')]({'where':{'id':_0x2021a5['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0xa70b61,null))['then'](removeEntity(_0xa70b61,null))['catch'](handleError(_0xa70b61,null));};exports[_0xde8d('0x4b')]=function(_0x5e0f9c,_0x37544a,_0x4e89d7){return db[_0xde8d('0x4c')][_0xde8d('0x47')]({'where':{'id':_0x5e0f9c['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x37544a,null))[_0xde8d('0x26')](function(_0x16b7e6){if(_0x16b7e6){return _0x16b7e6[_0xde8d('0x4b')](_0x5e0f9c[_0xde8d('0x49')][_0xde8d('0x4d')],_[_0xde8d('0x4e')](_0x5e0f9c[_0xde8d('0x49')],[_0xde8d('0x4d'),'id'])||{});}})[_0xde8d('0x26')](respondWithResult(_0x37544a,null))[_0xde8d('0x45')](handleError(_0x37544a,null));};exports[_0xde8d('0x4f')]=function(_0x42109c,_0xc3de02,_0x1e3891){var _0x569895={};var _0x370cb1={};var _0x1fdc48;var _0x41c371;return db[_0xde8d('0x2c')][_0xde8d('0x50')]({'where':{'id':_0x42109c[_0xde8d('0x46')]['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0xc3de02,null))[_0xde8d('0x26')](function(_0x4f356f){if(_0x4f356f){_0x1fdc48=_0x4f356f;_0x370cb1[_0xde8d('0x33')]=_['keys'](db[_0xde8d('0x4c')][_0xde8d('0x2d')]);_0x370cb1[_0xde8d('0x2f')]=_['keys'](_0x42109c[_0xde8d('0x2f')]);_0x370cb1[_0xde8d('0x31')]=_['intersection'](_0x370cb1['model'],_0x370cb1[_0xde8d('0x2f')]);_0x569895[_0xde8d('0x34')]=_[_0xde8d('0x32')](_0x370cb1[_0xde8d('0x33')],qs['fields'](_0x42109c[_0xde8d('0x2f')][_0xde8d('0x35')]));_0x569895[_0xde8d('0x34')]=_0x569895[_0xde8d('0x34')][_0xde8d('0x36')]?_0x569895[_0xde8d('0x34')]:_0x370cb1[_0xde8d('0x33')];_0x569895[_0xde8d('0x39')]=qs[_0xde8d('0x3a')](_0x42109c[_0xde8d('0x2f')][_0xde8d('0x3a')]);_0x569895[_0xde8d('0x3b')]=qs[_0xde8d('0x31')](_[_0xde8d('0x3c')](_0x42109c['query'],_0x370cb1[_0xde8d('0x31')]));if(_0x42109c['query']['filter']){_0x569895[_0xde8d('0x3b')]=_[_0xde8d('0x3e')](_0x569895[_0xde8d('0x3b')],{'$or':_[_0xde8d('0x2b')](_0x569895['attributes'],function(_0x144d53){var _0x3fdecd={};_0x3fdecd[_0x144d53]={'$like':'%'+_0x42109c[_0xde8d('0x2f')][_0xde8d('0x3d')]+'%'};return _0x3fdecd;})});}_0x569895=_[_0xde8d('0x3e')]({},_0x569895,_0x42109c[_0xde8d('0x41')]);return _0x1fdc48[_0xde8d('0x4f')](_0x569895);}})['then'](function(_0x9a95ae){if(_0x9a95ae){_0x41c371=_0x9a95ae[_0xde8d('0x36')];if(!_0x42109c['query'][_0xde8d('0x37')]('nolimit')){_0x569895['limit']=qs[_0xde8d('0x1e')](_0x42109c[_0xde8d('0x2f')]['limit']);_0x569895[_0xde8d('0x1c')]=qs['offset'](_0x42109c[_0xde8d('0x2f')]['offset']);}return _0x1fdc48[_0xde8d('0x4f')](_0x569895);}})[_0xde8d('0x26')](function(_0x554962){if(_0x554962){return _0x554962?{'count':_0x41c371,'rows':_0x554962}:null;}})[_0xde8d('0x26')](respondWithResult(_0xc3de02,null))[_0xde8d('0x45')](handleError(_0xc3de02,null));};exports[_0xde8d('0x51')]=function(_0x365762,_0x5afa5d,_0x2f0e87){return db['Action']['find']({'where':{'id':_0x365762[_0xde8d('0x46')]['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x5afa5d,null))[_0xde8d('0x26')](function(_0x5d2efa){if(_0x5d2efa){return _0x5d2efa['addActions'](_0x365762[_0xde8d('0x49')][_0xde8d('0x4d')],_[_0xde8d('0x4e')](_0x365762['body'],[_0xde8d('0x4d'),'id'])||{});}})[_0xde8d('0x26')](respondWithResult(_0x5afa5d,null))['catch'](handleError(_0x5afa5d,null));};exports[_0xde8d('0x52')]=function(_0x1b7368,_0x2ee78e,_0x29388e){var _0xaed2c7={};var _0x25db87={};var _0x1b54bc;var _0x27e115;return db['Automation'][_0xde8d('0x50')]({'where':{'id':_0x1b7368['params']['id']}})[_0xde8d('0x26')](handleEntityNotFound(_0x2ee78e,null))[_0xde8d('0x26')](function(_0x386044){if(_0x386044){_0x1b54bc=_0x386044;_0x25db87[_0xde8d('0x33')]=_['keys'](db['Action']['rawAttributes']);_0x25db87[_0xde8d('0x2f')]=_[_0xde8d('0x30')](_0x1b7368[_0xde8d('0x2f')]);_0x25db87[_0xde8d('0x31')]=_[_0xde8d('0x32')](_0x25db87[_0xde8d('0x33')],_0x25db87[_0xde8d('0x2f')]);_0xaed2c7['attributes']=_[_0xde8d('0x32')](_0x25db87[_0xde8d('0x33')],qs[_0xde8d('0x35')](_0x1b7368['query']['fields']));_0xaed2c7[_0xde8d('0x34')]=_0xaed2c7['attributes']['length']?_0xaed2c7['attributes']:_0x25db87[_0xde8d('0x33')];_0xaed2c7[_0xde8d('0x39')]=qs['sort'](_0x1b7368['query'][_0xde8d('0x3a')]);_0xaed2c7['where']=qs['filters'](_[_0xde8d('0x3c')](_0x1b7368[_0xde8d('0x2f')],_0x25db87[_0xde8d('0x31')]));if(_0x1b7368['query']['filter']){_0xaed2c7[_0xde8d('0x3b')]=_['merge'](_0xaed2c7['where'],{'$or':_[_0xde8d('0x2b')](_0xaed2c7[_0xde8d('0x34')],function(_0x4caf72){var _0x39dc36={};_0x39dc36[_0x4caf72]={'$like':'%'+_0x1b7368['query']['filter']+'%'};return _0x39dc36;})});}_0xaed2c7=_[_0xde8d('0x3e')]({},_0xaed2c7,_0x1b7368['options']);return _0x1b54bc[_0xde8d('0x52')](_0xaed2c7);}})['then'](function(_0x34f44c){if(_0x34f44c){_0x27e115=_0x34f44c[_0xde8d('0x36')];if(!_0x1b7368[_0xde8d('0x2f')][_0xde8d('0x37')](_0xde8d('0x38'))){_0xaed2c7[_0xde8d('0x1e')]=qs[_0xde8d('0x1e')](_0x1b7368[_0xde8d('0x2f')][_0xde8d('0x1e')]);_0xaed2c7[_0xde8d('0x1c')]=qs['offset'](_0x1b7368[_0xde8d('0x2f')][_0xde8d('0x1c')]);}return _0x1b54bc[_0xde8d('0x52')](_0xaed2c7);}})[_0xde8d('0x26')](function(_0x31e72e){if(_0x31e72e){return _0x31e72e?{'count':_0x27e115,'rows':_0x31e72e}:null;}})[_0xde8d('0x26')](respondWithResult(_0x2ee78e,null))['catch'](handleError(_0x2ee78e,null));}; \ No newline at end of file +var _0x687f=['index','Automation','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','addConditions','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','save','update','then','destroy','stack','name','send'];(function(_0x2a3506,_0x4c72c2){var _0x268978=function(_0x365b64){while(--_0x365b64){_0x2a3506['push'](_0x2a3506['shift']());}};_0x268978(++_0x4c72c2);}(_0x687f,0x167));var _0xf687=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x687f[_0x3ba422];return _0x20b5dd;};'use strict';var emlformat=require(_0xf687('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf687('0x1'));var rp=require(_0xf687('0x2'));var moment=require(_0xf687('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf687('0x4'));var util=require(_0xf687('0x5'));var path=require(_0xf687('0x6'));var sox=require(_0xf687('0x7'));var csv=require(_0xf687('0x8'));var ejs=require(_0xf687('0x9'));var fs=require('fs');var fs_extra=require(_0xf687('0xa'));var _=require(_0xf687('0xb'));var squel=require(_0xf687('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf687('0x8'));var querystring=require(_0xf687('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf687('0xe'));var qs=require(_0xf687('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf687('0x10'))('api');var utils=require(_0xf687('0x11'));var config=require(_0xf687('0x12'));var licenseUtil=require(_0xf687('0x13'));var db=require(_0xf687('0x14'))['db'];function respondWithStatusCode(_0x3cbcfc,_0x20ed3b){_0x20ed3b=_0x20ed3b||0xcc;return function(_0x435085){if(_0x435085){return _0x3cbcfc[_0xf687('0x15')](_0x20ed3b);}return _0x3cbcfc['status'](_0x20ed3b)['end']();};}function respondWithResult(_0x2c3e63,_0x52ecce){_0x52ecce=_0x52ecce||0xc8;return function(_0x2c33c8){if(_0x2c33c8){return _0x2c3e63[_0xf687('0x16')](_0x52ecce)[_0xf687('0x17')](_0x2c33c8);}};}function respondWithFilteredResult(_0x199411,_0x3612d8){return function(_0x11428a){if(_0x11428a){var _0x2208f9=typeof _0x3612d8[_0xf687('0x18')]===_0xf687('0x19')&&typeof _0x3612d8['limit']===_0xf687('0x19');var _0x5baf08=_0x11428a[_0xf687('0x1a')];var _0x1ebc99=_0x2208f9?0x0:_0x3612d8['offset'];var _0x289f08=_0x2208f9?_0x11428a[_0xf687('0x1a')]:_0x3612d8[_0xf687('0x18')]+_0x3612d8['limit'];var _0x7fd230;if(_0x289f08>=_0x5baf08){_0x289f08=_0x5baf08;_0x7fd230=0xc8;}else{_0x7fd230=0xce;}_0x199411['status'](_0x7fd230);return _0x199411[_0xf687('0x1b')]('Content-Range',_0x1ebc99+'-'+_0x289f08+'/'+_0x5baf08)[_0xf687('0x17')](_0x11428a);}return null;};}function patchUpdates(_0x208a9a){return function(_0x334449){try{jsonpatch[_0xf687('0x1c')](_0x334449,_0x208a9a,!![]);}catch(_0x4bf07f){return BPromise['reject'](_0x4bf07f);}return _0x334449[_0xf687('0x1d')]();};}function saveUpdates(_0x23c0c0,_0x378ca5){return function(_0x493030){if(_0x493030){return _0x493030[_0xf687('0x1e')](_0x23c0c0)[_0xf687('0x1f')](function(_0x2d326c){return _0x2d326c;});}return null;};}function removeEntity(_0x1b2c4e,_0xa2054a){return function(_0x5dd8c2){if(_0x5dd8c2){return _0x5dd8c2[_0xf687('0x20')]()['then'](function(){_0x1b2c4e[_0xf687('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dfb30,_0x2a0ac8){return function(_0x2ce8d7){if(!_0x2ce8d7){_0x1dfb30[_0xf687('0x15')](0x194);}return _0x2ce8d7;};}function handleError(_0x3efcb4,_0x57b2e0){_0x57b2e0=_0x57b2e0||0x1f4;return function(_0x107bf5){logger['error'](_0x107bf5[_0xf687('0x21')]);if(_0x107bf5[_0xf687('0x22')]){delete _0x107bf5[_0xf687('0x22')];}_0x3efcb4[_0xf687('0x16')](_0x57b2e0)[_0xf687('0x23')](_0x107bf5);};}exports[_0xf687('0x24')]=function(_0x194969,_0x4c8b85){var _0x5ae822={},_0xa7796={},_0x115aac={'count':0x0,'rows':[]};var _0x4c27d3=_['map'](db[_0xf687('0x25')][_0xf687('0x26')],function(_0x1a570f){return{'name':_0x1a570f[_0xf687('0x27')],'type':_0x1a570f['type'][_0xf687('0x28')]};});_0xa7796[_0xf687('0x29')]=_[_0xf687('0x2a')](_0x4c27d3,_0xf687('0x22'));_0xa7796[_0xf687('0x2b')]=_[_0xf687('0x2c')](_0x194969[_0xf687('0x2b')]);_0xa7796['filters']=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],_0xa7796[_0xf687('0x2b')]);_0x5ae822[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],qs[_0xf687('0x2f')](_0x194969[_0xf687('0x2b')]['fields']));_0x5ae822[_0xf687('0x2e')]=_0x5ae822[_0xf687('0x2e')][_0xf687('0x30')]?_0x5ae822[_0xf687('0x2e')]:_0xa7796[_0xf687('0x29')];if(!_0x194969[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x5ae822['limit']=qs[_0xf687('0x33')](_0x194969[_0xf687('0x2b')][_0xf687('0x33')]);_0x5ae822[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x194969[_0xf687('0x2b')][_0xf687('0x18')]);}_0x5ae822[_0xf687('0x34')]=qs[_0xf687('0x35')](_0x194969['query'][_0xf687('0x35')]);_0x5ae822['where']=qs[_0xf687('0x36')](_['pick'](_0x194969[_0xf687('0x2b')],_0xa7796['filters']),_0x4c27d3);if(_0x194969[_0xf687('0x2b')][_0xf687('0x37')]){_0x5ae822[_0xf687('0x38')]=_[_0xf687('0x39')](_0x5ae822[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x4c27d3,function(_0x87d5ef){if(_0x87d5ef[_0xf687('0x3a')]!==_0xf687('0x3b')){var _0x14c6e6={};_0x14c6e6[_0x87d5ef[_0xf687('0x22')]]={'$like':'%'+_0x194969['query'][_0xf687('0x37')]+'%'};return _0x14c6e6;}})});}_0x5ae822=_[_0xf687('0x39')]({},_0x5ae822,_0x194969[_0xf687('0x3c')]);var _0x2ed544={'where':_0x5ae822[_0xf687('0x38')]};return db[_0xf687('0x25')][_0xf687('0x1a')](_0x2ed544)[_0xf687('0x1f')](function(_0x3c6769){_0x115aac['count']=_0x3c6769;if(_0x194969['query'][_0xf687('0x3d')]){_0x5ae822[_0xf687('0x3e')]=[{'all':!![]}];}return db[_0xf687('0x25')][_0xf687('0x3f')](_0x5ae822);})[_0xf687('0x1f')](function(_0x39f98c){_0x115aac['rows']=_0x39f98c;return _0x115aac;})['then'](respondWithFilteredResult(_0x4c8b85,_0x5ae822))['catch'](handleError(_0x4c8b85,null));};exports[_0xf687('0x40')]=function(_0x197489,_0xbfd120){var _0x481639={'raw':![],'where':{'id':_0x197489[_0xf687('0x41')]['id']}},_0x9a13ba={};_0x9a13ba['model']=_[_0xf687('0x2c')](db['Automation'][_0xf687('0x26')]);_0x9a13ba['query']=_[_0xf687('0x2c')](_0x197489['query']);_0x9a13ba[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x9a13ba[_0xf687('0x29')],_0x9a13ba[_0xf687('0x2b')]);_0x481639['attributes']=_[_0xf687('0x2d')](_0x9a13ba['model'],qs[_0xf687('0x2f')](_0x197489[_0xf687('0x2b')][_0xf687('0x2f')]));_0x481639['attributes']=_0x481639[_0xf687('0x2e')][_0xf687('0x30')]?_0x481639[_0xf687('0x2e')]:_0x9a13ba['model'];if(_0x197489[_0xf687('0x2b')]['includeAll']){_0x481639[_0xf687('0x3e')]=[{'all':!![]}];}_0x481639=_[_0xf687('0x39')]({},_0x481639,_0x197489[_0xf687('0x3c')]);return db[_0xf687('0x25')]['find'](_0x481639)['then'](handleEntityNotFound(_0xbfd120,null))[_0xf687('0x1f')](respondWithResult(_0xbfd120,null))[_0xf687('0x42')](handleError(_0xbfd120,null));};exports['create']=function(_0x3fcd53,_0x51c72e){return db['Automation'][_0xf687('0x43')](_0x3fcd53[_0xf687('0x44')],{})['then'](respondWithResult(_0x51c72e,0xc9))['catch'](handleError(_0x51c72e,null));};exports['update']=function(_0xe74dbb,_0x23beb9){if(_0xe74dbb[_0xf687('0x44')]['id']){delete _0xe74dbb[_0xf687('0x44')]['id'];}return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0xe74dbb[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x23beb9,null))[_0xf687('0x1f')](saveUpdates(_0xe74dbb[_0xf687('0x44')],null))[_0xf687('0x1f')](respondWithResult(_0x23beb9,null))[_0xf687('0x42')](handleError(_0x23beb9,null));};exports[_0xf687('0x20')]=function(_0x334ce5,_0x5c9020){return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0x334ce5[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5c9020,null))[_0xf687('0x1f')](removeEntity(_0x5c9020,null))[_0xf687('0x42')](handleError(_0x5c9020,null));};exports[_0xf687('0x46')]=function(_0x195eca,_0x495825,_0xe5ea9b){return db['Condition'][_0xf687('0x45')]({'where':{'id':_0x195eca[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x495825,null))[_0xf687('0x1f')](function(_0x488a89){if(_0x488a89){return _0x488a89[_0xf687('0x46')](_0x195eca[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x195eca[_0xf687('0x44')],['ids','id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x495825,null))[_0xf687('0x42')](handleError(_0x495825,null));};exports[_0xf687('0x49')]=function(_0x384fce,_0x1f9c87,_0x37b234){var _0x3dab11={};var _0x5151ed={};var _0xa04736;var _0x49d8bc;return db[_0xf687('0x25')][_0xf687('0x4a')]({'where':{'id':_0x384fce['params']['id']}})['then'](handleEntityNotFound(_0x1f9c87,null))[_0xf687('0x1f')](function(_0x5ed6e2){if(_0x5ed6e2){_0xa04736=_0x5ed6e2;_0x5151ed[_0xf687('0x29')]=_[_0xf687('0x2c')](db['Condition'][_0xf687('0x26')]);_0x5151ed[_0xf687('0x2b')]=_['keys'](_0x384fce[_0xf687('0x2b')]);_0x5151ed['filters']=_[_0xf687('0x2d')](_0x5151ed[_0xf687('0x29')],_0x5151ed[_0xf687('0x2b')]);_0x3dab11[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x5151ed['model'],qs[_0xf687('0x2f')](_0x384fce[_0xf687('0x2b')][_0xf687('0x2f')]));_0x3dab11[_0xf687('0x2e')]=_0x3dab11[_0xf687('0x2e')][_0xf687('0x30')]?_0x3dab11[_0xf687('0x2e')]:_0x5151ed['model'];_0x3dab11[_0xf687('0x34')]=qs['sort'](_0x384fce[_0xf687('0x2b')][_0xf687('0x35')]);_0x3dab11[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0x384fce['query'],_0x5151ed['filters']));if(_0x384fce[_0xf687('0x2b')][_0xf687('0x37')]){_0x3dab11[_0xf687('0x38')]=_[_0xf687('0x39')](_0x3dab11[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x3dab11[_0xf687('0x2e')],function(_0x44491b){var _0x204728={};_0x204728[_0x44491b]={'$like':'%'+_0x384fce[_0xf687('0x2b')]['filter']+'%'};return _0x204728;})});}_0x3dab11=_['merge']({},_0x3dab11,_0x384fce[_0xf687('0x3c')]);return _0xa04736[_0xf687('0x49')](_0x3dab11);}})[_0xf687('0x1f')](function(_0x20b53b){if(_0x20b53b){_0x49d8bc=_0x20b53b[_0xf687('0x30')];if(!_0x384fce['query'][_0xf687('0x31')](_0xf687('0x32'))){_0x3dab11[_0xf687('0x33')]=qs['limit'](_0x384fce[_0xf687('0x2b')][_0xf687('0x33')]);_0x3dab11[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x384fce['query']['offset']);}return _0xa04736[_0xf687('0x49')](_0x3dab11);}})['then'](function(_0x27080f){if(_0x27080f){return _0x27080f?{'count':_0x49d8bc,'rows':_0x27080f}:null;}})['then'](respondWithResult(_0x1f9c87,null))[_0xf687('0x42')](handleError(_0x1f9c87,null));};exports['addActions']=function(_0x5ba658,_0x310e79,_0x410be7){return db['Action'][_0xf687('0x45')]({'where':{'id':_0x5ba658[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x310e79,null))[_0xf687('0x1f')](function(_0x4ad68e){if(_0x4ad68e){return _0x4ad68e[_0xf687('0x4c')](_0x5ba658[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x5ba658[_0xf687('0x44')],[_0xf687('0x47'),'id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x310e79,null))[_0xf687('0x42')](handleError(_0x310e79,null));};exports['getActions']=function(_0xae8767,_0x5aac27,_0x2013c6){var _0x7d75f={};var _0x226f40={};var _0xee152b;var _0x3102fa;return db[_0xf687('0x25')]['findOne']({'where':{'id':_0xae8767[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5aac27,null))[_0xf687('0x1f')](function(_0x5cf5d0){if(_0x5cf5d0){_0xee152b=_0x5cf5d0;_0x226f40['model']=_[_0xf687('0x2c')](db[_0xf687('0x4d')][_0xf687('0x26')]);_0x226f40[_0xf687('0x2b')]=_['keys'](_0xae8767['query']);_0x226f40[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],_0x226f40['query']);_0x7d75f[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],qs[_0xf687('0x2f')](_0xae8767[_0xf687('0x2b')][_0xf687('0x2f')]));_0x7d75f['attributes']=_0x7d75f[_0xf687('0x2e')][_0xf687('0x30')]?_0x7d75f['attributes']:_0x226f40['model'];_0x7d75f[_0xf687('0x34')]=qs['sort'](_0xae8767['query']['sort']);_0x7d75f[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0xae8767[_0xf687('0x2b')],_0x226f40['filters']));if(_0xae8767[_0xf687('0x2b')]['filter']){_0x7d75f[_0xf687('0x38')]=_[_0xf687('0x39')](_0x7d75f[_0xf687('0x38')],{'$or':_['map'](_0x7d75f[_0xf687('0x2e')],function(_0x13f12c){var _0x1e5083={};_0x1e5083[_0x13f12c]={'$like':'%'+_0xae8767[_0xf687('0x2b')][_0xf687('0x37')]+'%'};return _0x1e5083;})});}_0x7d75f=_['merge']({},_0x7d75f,_0xae8767[_0xf687('0x3c')]);return _0xee152b[_0xf687('0x4e')](_0x7d75f);}})['then'](function(_0x5ba918){if(_0x5ba918){_0x3102fa=_0x5ba918[_0xf687('0x30')];if(!_0xae8767[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x7d75f['limit']=qs['limit'](_0xae8767[_0xf687('0x2b')][_0xf687('0x33')]);_0x7d75f[_0xf687('0x18')]=qs[_0xf687('0x18')](_0xae8767['query'][_0xf687('0x18')]);}return _0xee152b['getActions'](_0x7d75f);}})[_0xf687('0x1f')](function(_0x46e88a){if(_0x46e88a){return _0x46e88a?{'count':_0x3102fa,'rows':_0x46e88a}:null;}})[_0xf687('0x1f')](respondWithResult(_0x5aac27,null))[_0xf687('0x42')](handleError(_0x5aac27,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 815a104..3913064 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 _0x0763=['moment','bluebird','../../config/environment','exports','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x1913a5,_0x18c610){var _0x58b6af=function(_0xdb7927){while(--_0xdb7927){_0x1913a5['push'](_0x1913a5['shift']());}};_0x58b6af(++_0x18c610);}(_0x0763,0x15a));var _0x3076=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x0763[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x3076('0x0'));var util=require(_0x3076('0x1'));var logger=require(_0x3076('0x2'))(_0x3076('0x3'));var moment=require(_0x3076('0x4'));var BPromise=require(_0x3076('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3076('0x6'));var attributes=require('./automation.attributes');module[_0x3076('0x7')]=function(_0x54a25c,_0x136a1d){return _0x54a25c[_0x3076('0x8')]('Automation',attributes,{'tableName':_0x3076('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc38=['Automation','tools_automations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xdc38,0x92));var _0x8dc3=function(_0x35a097,_0x42c39f){_0x35a097=_0x35a097-0x0;var _0x5ebefc=_0xdc38[_0x35a097];return _0x5ebefc;};'use strict';var _=require('lodash');var util=require(_0x8dc3('0x0'));var logger=require(_0x8dc3('0x1'))(_0x8dc3('0x2'));var moment=require(_0x8dc3('0x3'));var BPromise=require(_0x8dc3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dc3('0x5'));var rimraf=require(_0x8dc3('0x6'));var config=require(_0x8dc3('0x7'));var attributes=require(_0x8dc3('0x8'));module['exports']=function(_0xaf7ad9,_0x3e832f){return _0xaf7ad9[_0x8dc3('0x9')](_0x8dc3('0xa'),attributes,{'tableName':_0x8dc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 761c3cf..7e05180 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 _0xcb9c=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0xd2d81,_0x8ffa71){var _0x226112=function(_0x1f250a){while(--_0x1f250a){_0xd2d81['push'](_0xd2d81['shift']());}};_0x226112(++_0x8ffa71);}(_0xcb9c,0x110));var _0xccb9=function(_0x95da03,_0x1b5bd4){_0x95da03=_0x95da03-0x0;var _0x331f15=_0xcb9c[_0x95da03];return _0x331f15;};'use strict';var _=require(_0xccb9('0x0'));var util=require(_0xccb9('0x1'));var moment=require(_0xccb9('0x2'));var BPromise=require(_0xccb9('0x3'));var rs=require(_0xccb9('0x4'));var fs=require('fs');var Redis=require(_0xccb9('0x5'));var db=require(_0xccb9('0x6'))['db'];var utils=require(_0xccb9('0x7'));var logger=require('../../config/logger')(_0xccb9('0x8'));var config=require(_0xccb9('0x9'));var jayson=require(_0xccb9('0xa'));var client=jayson['client'][_0xccb9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114fa3,_0x1d807e,_0x54e899){return new BPromise(function(_0x3dfe21,_0x378d39){return client[_0xccb9('0xc')](_0x114fa3,_0x54e899)[_0xccb9('0xd')](function(_0x47889f){logger[_0xccb9('0xe')](_0xccb9('0xf'),_0x1d807e,_0xccb9('0x10'));logger[_0xccb9('0x11')](_0xccb9('0x12'),_0x1d807e,'request\x20sent',JSON[_0xccb9('0x13')](_0x47889f));if(_0x47889f[_0xccb9('0x14')]){if(_0x47889f[_0xccb9('0x14')]['code']===0x1f4){logger[_0xccb9('0x14')](_0xccb9('0xf'),_0x1d807e,_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);return _0x378d39(_0x47889f['error'][_0xccb9('0x15')]);}logger[_0xccb9('0x14')](_0xccb9('0xf'),_0x1d807e,_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);return _0x3dfe21(_0x47889f[_0xccb9('0x14')][_0xccb9('0x15')]);}else{logger[_0xccb9('0xe')](_0xccb9('0xf'),_0x1d807e,'request\x20sent');_0x3dfe21(_0x47889f[_0xccb9('0x16')][_0xccb9('0x15')]);}})[_0xccb9('0x17')](function(_0x561ca6){logger['error'](_0xccb9('0xf'),_0x1d807e,_0x561ca6);_0x378d39(_0x561ca6);});});} \ No newline at end of file +var _0x5ba3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ba3,0x140));var _0x35ba=function(_0x73c797,_0x2817e6){_0x73c797=_0x73c797-0x0;var _0x28bd51=_0x5ba3[_0x73c797];return _0x28bd51;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index c4546a3..e32df0c 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 _0x10d8=['create','post','/:id/conditions','addConditions','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/actions','getActions'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x10d8,0xee));var _0x810d=function(_0x282bc0,_0x15ea2a){_0x282bc0=_0x282bc0-0x0;var _0x154fec=_0x10d8[_0x282bc0];return _0x154fec;};'use strict';var multer=require(_0x810d('0x0'));var util=require(_0x810d('0x1'));var path=require(_0x810d('0x2'));var timeout=require('connect-timeout');var express=require(_0x810d('0x3'));var router=express[_0x810d('0x4')]();var fs_extra=require(_0x810d('0x5'));var auth=require(_0x810d('0x6'));var interaction=require(_0x810d('0x7'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x810d('0x8')]('/',auth[_0x810d('0x9')](),controller[_0x810d('0xa')]);router[_0x810d('0x8')](_0x810d('0xb'),auth[_0x810d('0x9')](),controller[_0x810d('0xc')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller['getConditions']);router[_0x810d('0x8')](_0x810d('0xd'),auth[_0x810d('0x9')](),controller[_0x810d('0xe')]);router['post']('/',auth[_0x810d('0x9')](),controller[_0x810d('0xf')]);router[_0x810d('0x10')](_0x810d('0x11'),auth['isAuthenticated'](),controller[_0x810d('0x12')]);router['post']('/:id/actions',auth[_0x810d('0x9')](),controller['addActions']);router[_0x810d('0x13')](_0x810d('0xb'),auth['isAuthenticated'](),controller[_0x810d('0x14')]);router[_0x810d('0x15')](_0x810d('0xb'),auth[_0x810d('0x9')](),controller[_0x810d('0x16')]);module['exports']=router; \ No newline at end of file +var _0x21d1=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','delete','destroy','exports','multer','util','path'];(function(_0x4b5456,_0x42dfc1){var _0x2c103d=function(_0x143563){while(--_0x143563){_0x4b5456['push'](_0x4b5456['shift']());}};_0x2c103d(++_0x42dfc1);}(_0x21d1,0x1c9));var _0x121d=function(_0x41058e,_0xf056ef){_0x41058e=_0x41058e-0x0;var _0xebf413=_0x21d1[_0x41058e];return _0xebf413;};'use strict';var multer=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var path=require(_0x121d('0x2'));var timeout=require(_0x121d('0x3'));var express=require(_0x121d('0x4'));var router=express[_0x121d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x121d('0x6'));var config=require(_0x121d('0x7'));var controller=require(_0x121d('0x8'));router[_0x121d('0x9')]('/',auth[_0x121d('0xa')](),controller['index']);router[_0x121d('0x9')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0xc')]);router[_0x121d('0x9')](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0xe')]);router[_0x121d('0x9')](_0x121d('0xf'),auth['isAuthenticated'](),controller[_0x121d('0x10')]);router[_0x121d('0x11')]('/',auth[_0x121d('0xa')](),controller['create']);router['post'](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0x12')]);router['post']('/:id/actions',auth[_0x121d('0xa')](),controller['addActions']);router[_0x121d('0x13')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller['update']);router[_0x121d('0x14')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0x15')]);module[_0x121d('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 918f49f..f216426 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 _0xab64=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xab64,0xa0));var _0x4ab6=function(_0x417e85,_0x1bdf19){_0x417e85=_0x417e85-0x0;var _0x8f3539=_0xab64[_0x417e85];return _0x8f3539;};'use strict';var Sequelize=require(_0x4ab6('0x0'));module[_0x4ab6('0x1')]={'name':{'type':Sequelize[_0x4ab6('0x2')],'unique':_0x4ab6('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4ab6('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x4ab6('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4ab6('0x5')},'limitCalls':{'type':Sequelize[_0x4ab6('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4ab6('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4ab6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4ab6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0xc')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4ab6('0xd')},'dialTimezone':{'type':Sequelize[_0x4ab6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4ab6('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x4ab6('0xf')]('always',_0x4ab6('0x10'),_0x4ab6('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4ab6('0x12')],'defaultValue':0x0,'comment':_0x4ab6('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4ab6('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4ab6('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4ab6('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4ab6('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4ab6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4ab6('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4ab6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4ab6('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4ab6('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4ab6('0x6')](0x9)[_0x4ab6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4ab6('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4ab6('0x1b'),_0x4ab6('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x4ab6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x4ab6('0x6')](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4ab6('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4ab6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4ab6('0x6')](0x5)[_0x4ab6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4ab6('0x24')}}; \ No newline at end of file +var _0xb111=['#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence'];(function(_0x47d32d,_0x4ad6e4){var _0xfe59b5=function(_0x448cd5){while(--_0x448cd5){_0x47d32d['push'](_0x47d32d['shift']());}};_0xfe59b5(++_0x4ad6e4);}(_0xb111,0x149));var _0x1b11=function(_0x30a0c7,_0x2e8020){_0x30a0c7=_0x30a0c7-0x0;var _0x14a010=_0xb111[_0x30a0c7];return _0x14a010;};'use strict';var Sequelize=require('sequelize');module[_0x1b11('0x0')]={'name':{'type':Sequelize[_0x1b11('0x1')],'unique':_0x1b11('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x4')),'allowNull':![],'defaultValue':_0x1b11('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':_0x1b11('0x6')},'limitCalls':{'type':Sequelize[_0x1b11('0x7')](0x4)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1b11('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1b11('0x10')},'dialTimezone':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':_0x1b11('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x12'),_0x1b11('0x13'),_0x1b11('0x14')),'defaultValue':_0x1b11('0x12')},'dialAMDActive':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1b11('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1b11('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1b11('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1b11('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1b11('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1b11('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1b11('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x1d'),'ASC'),'defaultValue':_0x1b11('0x1d')},'dialPrefix':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b11('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 43bbb5d..ac709b6 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 _0x20a3=['getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','select','cm_contacts','cm_hopper_additional_phones','cmHopperId','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','status','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','merge','omit','createdAt','updatedAt','role','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','CmHopperHistory','CampaignId','findAll','rows','getHopperFinals','CmHopperFinal'];(function(_0x469b1a,_0x1b9cc3){var _0xbca5f5=function(_0x56f9b2){while(--_0x56f9b2){_0x469b1a['push'](_0x469b1a['shift']());}};_0xbca5f5(++_0x1b9cc3);}(_0x20a3,0x15b));var _0x320a=function(_0x3489af,_0x265469){_0x3489af=_0x3489af-0x0;var _0x3debc0=_0x20a3[_0x3489af];return _0x3debc0;};'use strict';var emlformat=require(_0x320a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x320a('0x1'));var jsonpatch=require(_0x320a('0x2'));var rp=require(_0x320a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x320a('0x4'));var path=require(_0x320a('0x5'));var sox=require(_0x320a('0x6'));var csv=require(_0x320a('0x7'));var ejs=require(_0x320a('0x8'));var fs=require('fs');var fs_extra=require(_0x320a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x320a('0xa'));var jsforce=require(_0x320a('0xb'));var deskjs=require(_0x320a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x320a('0xd'));var Redis=require('ioredis');var authService=require(_0x320a('0xe'));var qs=require(_0x320a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x320a('0x10'));var logger=require(_0x320a('0x11'))('api');var utils=require(_0x320a('0x12'));var config=require(_0x320a('0x13'));var licenseUtil=require(_0x320a('0x14'));var db=require(_0x320a('0x15'))['db'];function respondWithStatusCode(_0x570693,_0x3a6cb0){_0x3a6cb0=_0x3a6cb0||0xcc;return function(_0x42b8dc){if(_0x42b8dc){return _0x570693[_0x320a('0x16')](_0x3a6cb0);}return _0x570693['status'](_0x3a6cb0)[_0x320a('0x17')]();};}function respondWithResult(_0x35ec33,_0x4d1ab9){_0x4d1ab9=_0x4d1ab9||0xc8;return function(_0x1cbd26){if(_0x1cbd26){return _0x35ec33['status'](_0x4d1ab9)[_0x320a('0x18')](_0x1cbd26);}};}function respondWithFilteredResult(_0x2e8124,_0xfe4b71){return function(_0x44a628){if(_0x44a628){var _0x501cd2=typeof _0xfe4b71[_0x320a('0x19')]==='undefined'&&typeof _0xfe4b71['limit']===_0x320a('0x1a');var _0x59733d=_0x44a628[_0x320a('0x1b')];var _0x3a1911=_0x501cd2?0x0:_0xfe4b71[_0x320a('0x19')];var _0x45bb6b=_0x501cd2?_0x44a628[_0x320a('0x1b')]:_0xfe4b71['offset']+_0xfe4b71[_0x320a('0x1c')];var _0x147c7f;if(_0x45bb6b>=_0x59733d){_0x45bb6b=_0x59733d;_0x147c7f=0xc8;}else{_0x147c7f=0xce;}_0x2e8124['status'](_0x147c7f);return _0x2e8124[_0x320a('0x1d')](_0x320a('0x1e'),_0x3a1911+'-'+_0x45bb6b+'/'+_0x59733d)[_0x320a('0x18')](_0x44a628);}return null;};}function patchUpdates(_0x37b0ae){return function(_0x18514b){try{jsonpatch[_0x320a('0x1f')](_0x18514b,_0x37b0ae,!![]);}catch(_0x1471aa){return BPromise[_0x320a('0x20')](_0x1471aa);}return _0x18514b[_0x320a('0x21')]();};}function saveUpdates(_0x4e5c99,_0x9001c0){return function(_0x20f59d){if(_0x20f59d){return _0x20f59d[_0x320a('0x22')](_0x4e5c99)['then'](function(_0x3974bd){return _0x3974bd;});}return null;};}function removeEntity(_0x207748,_0x3981d5){return function(_0x17fd84){if(_0x17fd84){return _0x17fd84[_0x320a('0x23')]()[_0x320a('0x24')](function(){var _0x40af50=_0x17fd84[_0x320a('0x25')]({'plain':!![]});var _0x8b4862='IvrCampaigns';return db[_0x320a('0x26')][_0x320a('0x23')]({'where':{'type':_0x8b4862,'resourceId':_0x40af50['id']}})[_0x320a('0x24')](function(){return _0x17fd84;});})[_0x320a('0x24')](function(){_0x207748[_0x320a('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x536f35,_0x560173){return function(_0x8457e3){if(!_0x8457e3){_0x536f35[_0x320a('0x16')](0x194);}return _0x8457e3;};}function handleError(_0x225f02,_0x64bbda){_0x64bbda=_0x64bbda||0x1f4;return function(_0x213b4e){logger[_0x320a('0x28')](_0x213b4e[_0x320a('0x29')]);if(_0x213b4e['name']){delete _0x213b4e[_0x320a('0x2a')];}_0x225f02[_0x320a('0x27')](_0x64bbda)[_0x320a('0x2b')](_0x213b4e);};}exports[_0x320a('0x2c')]=function(_0x5dbdca,_0x5cd3cc){var _0x43fe81={},_0x33e764={},_0x13565f={'count':0x0,'rows':[]};var _0x4bfd3a=_[_0x320a('0x2d')](db[_0x320a('0x2e')][_0x320a('0x2f')],function(_0x16d2f6){return{'name':_0x16d2f6[_0x320a('0x30')],'type':_0x16d2f6[_0x320a('0x31')][_0x320a('0x32')]};});_0x33e764[_0x320a('0x33')]=_['map'](_0x4bfd3a,'name');_0x33e764[_0x320a('0x34')]=_[_0x320a('0x35')](_0x5dbdca[_0x320a('0x34')]);_0x33e764['filters']=_[_0x320a('0x36')](_0x33e764[_0x320a('0x33')],_0x33e764[_0x320a('0x34')]);_0x43fe81[_0x320a('0x37')]=_[_0x320a('0x36')](_0x33e764['model'],qs['fields'](_0x5dbdca['query'][_0x320a('0x38')]));_0x43fe81[_0x320a('0x37')]=_0x43fe81[_0x320a('0x37')][_0x320a('0x39')]?_0x43fe81[_0x320a('0x37')]:_0x33e764[_0x320a('0x33')];if(!_0x5dbdca[_0x320a('0x34')]['hasOwnProperty'](_0x320a('0x3a'))){_0x43fe81['limit']=qs[_0x320a('0x1c')](_0x5dbdca[_0x320a('0x34')][_0x320a('0x1c')]);_0x43fe81[_0x320a('0x19')]=qs['offset'](_0x5dbdca[_0x320a('0x34')][_0x320a('0x19')]);}_0x43fe81[_0x320a('0x3b')]=qs['sort'](_0x5dbdca[_0x320a('0x34')][_0x320a('0x3c')]);_0x43fe81[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x5dbdca[_0x320a('0x34')],_0x33e764[_0x320a('0x3e')]),_0x4bfd3a);if(_0x5dbdca[_0x320a('0x34')][_0x320a('0x40')]){_0x43fe81['where']=_['merge'](_0x43fe81['where'],{'$or':_['map'](_0x4bfd3a,function(_0x742cb3){if(_0x742cb3[_0x320a('0x31')]!==_0x320a('0x41')){var _0xe86caf={};_0xe86caf[_0x742cb3[_0x320a('0x2a')]]={'$like':'%'+_0x5dbdca[_0x320a('0x34')]['filter']+'%'};return _0xe86caf;}})});}_0x43fe81=_['merge']({},_0x43fe81,_0x5dbdca['options']);var _0x3e39af={'where':_0x43fe81[_0x320a('0x3d')]};return db[_0x320a('0x2e')][_0x320a('0x1b')](_0x3e39af)[_0x320a('0x24')](function(_0x1f9ce6){_0x13565f[_0x320a('0x1b')]=_0x1f9ce6;if(_0x5dbdca['query'][_0x320a('0x42')]){_0x43fe81[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x2e')]['findAll'](_0x43fe81);})[_0x320a('0x24')](function(_0x44dabf){_0x13565f['rows']=_0x44dabf;return _0x13565f;})['then'](respondWithFilteredResult(_0x5cd3cc,_0x43fe81))[_0x320a('0x44')](handleError(_0x5cd3cc,null));};exports[_0x320a('0x45')]=function(_0x25fb77,_0x581372){var _0x3a68de={'raw':![],'where':{'id':_0x25fb77[_0x320a('0x46')]['id']}},_0x139d4c={};_0x139d4c[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x2e')][_0x320a('0x2f')]);_0x139d4c[_0x320a('0x34')]=_[_0x320a('0x35')](_0x25fb77[_0x320a('0x34')]);_0x139d4c[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x139d4c[_0x320a('0x33')],_0x139d4c['query']);_0x3a68de[_0x320a('0x37')]=_[_0x320a('0x36')](_0x139d4c[_0x320a('0x33')],qs[_0x320a('0x38')](_0x25fb77[_0x320a('0x34')]['fields']));_0x3a68de[_0x320a('0x37')]=_0x3a68de[_0x320a('0x37')][_0x320a('0x39')]?_0x3a68de[_0x320a('0x37')]:_0x139d4c[_0x320a('0x33')];if(_0x25fb77['query'][_0x320a('0x42')]){_0x3a68de['include']=[{'all':!![]}];}_0x3a68de=_['merge']({},_0x3a68de,_0x25fb77[_0x320a('0x47')]);return db[_0x320a('0x2e')][_0x320a('0x48')](_0x3a68de)[_0x320a('0x24')](handleEntityNotFound(_0x581372,null))[_0x320a('0x24')](respondWithResult(_0x581372,null))[_0x320a('0x44')](handleError(_0x581372,null));};exports[_0x320a('0x49')]=function(_0x465d26,_0x236158){return db['Campaign'][_0x320a('0x49')](_0x465d26[_0x320a('0x4a')],{})[_0x320a('0x24')](function(_0x2010fc){var _0x4ed622=_0x465d26['user'][_0x320a('0x25')]({'plain':!![]});if(!_0x4ed622)throw new Error(_0x320a('0x4b'));if(_0x4ed622['role']===_0x320a('0x4c')){var _0x42afe0=_0x2010fc['get']({'plain':!![]});var _0x839c0d=_0x320a('0x4d');return db[_0x320a('0x4e')]['find']({'where':{'name':_0x839c0d,'userProfileId':_0x4ed622[_0x320a('0x4f')]},'raw':!![]})['then'](function(_0x2b927d){if(_0x2b927d&&_0x2b927d['autoAssociation']===0x0){return db[_0x320a('0x26')]['create']({'name':_0x42afe0['name'],'resourceId':_0x42afe0['id'],'type':_0x2b927d[_0x320a('0x2a')],'sectionId':_0x2b927d['id']},{})['then'](function(){return _0x2010fc;});}else{return _0x2010fc;}})[_0x320a('0x44')](function(_0x36c65e){logger[_0x320a('0x28')](_0x320a('0x50'),_0x36c65e);throw _0x36c65e;});}return _0x2010fc;})[_0x320a('0x24')](respondWithResult(_0x236158,0xc9))['catch'](handleError(_0x236158,null));};exports['clone']=function(_0x13cbca,_0x21d02f){var _0x4bb56b={'where':{'id':_0x13cbca['params']['id']}},_0x4deb6b={};_0x4deb6b['model']=_[_0x320a('0x35')](db[_0x320a('0x2e')][_0x320a('0x2f')]);_0x4bb56b[_0x320a('0x37')]=_[_0x320a('0x36')](_0x4deb6b[_0x320a('0x33')],qs[_0x320a('0x38')](_0x13cbca[_0x320a('0x34')][_0x320a('0x38')]));_0x4bb56b['attributes']=_0x4bb56b['attributes']['length']?_0x4bb56b[_0x320a('0x37')]:_0x4deb6b[_0x320a('0x33')];if(_0x13cbca['query'][_0x320a('0x42')]){_0x4bb56b[_0x320a('0x43')]=[{'all':!![]}];}_0x4bb56b=_[_0x320a('0x51')]({},_0x4bb56b,_0x13cbca[_0x320a('0x47')]);return db[_0x320a('0x2e')]['find'](_0x4bb56b)[_0x320a('0x24')](handleEntityNotFound(_0x21d02f,null))[_0x320a('0x24')](function(_0x208a56){if(_0x208a56){var _0x279227=_0x208a56[_0x320a('0x25')]({'plain':!![]});_0x279227=qs[_0x320a('0x52')](_0x279227,['id',_0x320a('0x53'),'updatedAt']);_0x13cbca[_0x320a('0x4a')]=_[_0x320a('0x52')](_0x13cbca['body'],['id',_0x320a('0x53'),_0x320a('0x54')]);return db[_0x320a('0x2e')][_0x320a('0x49')](_[_0x320a('0x51')](_0x279227,_0x13cbca[_0x320a('0x4a')]),{'include':_0x13cbca['query'][_0x320a('0x42')]?[{'all':!![]}]:undefined})[_0x320a('0x24')](function(_0x514b22){var _0x5cfbcd=_0x13cbca[_0x320a('0x4c')][_0x320a('0x25')]({'plain':!![]});if(!_0x5cfbcd)throw new Error(_0x320a('0x4b'));if(_0x5cfbcd[_0x320a('0x55')]==='user'){var _0x3e6119=_0x514b22[_0x320a('0x25')]({'plain':!![]});var _0x29b207=_0x320a('0x4d');return db['UserProfileSection'][_0x320a('0x48')]({'where':{'name':_0x29b207,'userProfileId':_0x5cfbcd[_0x320a('0x4f')]},'raw':!![]})['then'](function(_0x409961){if(_0x409961&&_0x409961[_0x320a('0x56')]===0x0){return db[_0x320a('0x26')]['create']({'name':_0x3e6119[_0x320a('0x2a')],'resourceId':_0x3e6119['id'],'type':_0x409961[_0x320a('0x2a')],'sectionId':_0x409961['id']},{})['then'](function(){return _0x514b22;});}else{return _0x514b22;}})[_0x320a('0x44')](function(_0x406e78){logger['error'](_0x320a('0x50'),_0x406e78);throw _0x406e78;});}return _0x514b22;});}})[_0x320a('0x24')](respondWithResult(_0x21d02f,0xc9))[_0x320a('0x44')](handleError(_0x21d02f,null));};exports[_0x320a('0x22')]=function(_0x30769c,_0x5c57da){if(_0x30769c[_0x320a('0x4a')]['id']){delete _0x30769c[_0x320a('0x4a')]['id'];}return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x30769c[_0x320a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c57da,null))[_0x320a('0x24')](saveUpdates(_0x30769c[_0x320a('0x4a')],null))[_0x320a('0x24')](respondWithResult(_0x5c57da,null))[_0x320a('0x44')](handleError(_0x5c57da,null));};exports[_0x320a('0x23')]=function(_0x16dd77,_0x37ba87){return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x16dd77[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x37ba87,null))[_0x320a('0x24')](removeEntity(_0x37ba87,null))[_0x320a('0x44')](handleError(_0x37ba87,null));};exports[_0x320a('0x57')]=function(_0x261eb8,_0x42aa05,_0x2373e1){var _0x50a700={'raw':!![],'where':{}};var _0x5618f3={};var _0x265204={'count':0x0,'rows':[]};return db['Campaign'][_0x320a('0x58')]({'where':{'id':_0x261eb8[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x42aa05,null))['then'](function(_0x51193d){if(_0x51193d){_0x5618f3[_0x320a('0x33')]=_['keys'](db[_0x320a('0x59')]['rawAttributes']);_0x5618f3[_0x320a('0x34')]=_[_0x320a('0x35')](_0x261eb8['query']);_0x5618f3[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x5618f3[_0x320a('0x33')],_0x5618f3['query']);_0x50a700[_0x320a('0x37')]=_['intersection'](_0x5618f3[_0x320a('0x33')],qs[_0x320a('0x38')](_0x261eb8[_0x320a('0x34')]['fields']));_0x50a700['attributes']=_0x50a700[_0x320a('0x37')][_0x320a('0x39')]?_0x50a700['attributes']:_0x5618f3['model'];if(!_0x261eb8[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x50a700[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x261eb8[_0x320a('0x34')][_0x320a('0x1c')]);_0x50a700[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x261eb8[_0x320a('0x34')][_0x320a('0x19')]);}_0x50a700[_0x320a('0x3b')]=qs['sort'](_0x261eb8[_0x320a('0x34')][_0x320a('0x3c')]);_0x50a700[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_['pick'](_0x261eb8[_0x320a('0x34')],_0x5618f3['filters']));_0x50a700[_0x320a('0x3d')]['CampaignId']=_0x51193d['id'];if(_0x261eb8['query'][_0x320a('0x40')]){_0x50a700[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x50a700[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x50a700[_0x320a('0x37')],function(_0xc30f24){var _0x2e1a4e={};_0x2e1a4e[_0xc30f24]={'$like':'%'+_0x261eb8[_0x320a('0x34')]['filter']+'%'};return _0x2e1a4e;})});}_0x50a700=_[_0x320a('0x51')]({},_0x50a700,_0x261eb8[_0x320a('0x47')]);return db['CmHopper']['count']({'where':_0x50a700[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x280235){_0x265204[_0x320a('0x1b')]=_0x280235;if(_0x261eb8[_0x320a('0x34')][_0x320a('0x42')]){_0x50a700['include']=[{'all':!![]}];}return db[_0x320a('0x59')]['findAll'](_0x50a700);})[_0x320a('0x24')](function(_0x120268){_0x265204['rows']=_0x120268;return _0x265204;});}})[_0x320a('0x24')](respondWithFilteredResult(_0x42aa05,_0x50a700))['catch'](handleError(_0x42aa05,null));};exports['getHopperHistories']=function(_0x1e4080,_0xdd2b5e,_0x155894){var _0x3b239d={'raw':!![],'where':{}};var _0x3f94={};var _0x19a2d6={'count':0x0,'rows':[]};return db[_0x320a('0x2e')][_0x320a('0x58')]({'where':{'id':_0x1e4080[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0xdd2b5e,null))[_0x320a('0x24')](function(_0x2b6471){if(_0x2b6471){_0x3f94[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x5b')][_0x320a('0x2f')]);_0x3f94[_0x320a('0x34')]=_['keys'](_0x1e4080[_0x320a('0x34')]);_0x3f94['filters']=_['intersection'](_0x3f94['model'],_0x3f94[_0x320a('0x34')]);_0x3b239d[_0x320a('0x37')]=_['intersection'](_0x3f94['model'],qs['fields'](_0x1e4080[_0x320a('0x34')][_0x320a('0x38')]));_0x3b239d[_0x320a('0x37')]=_0x3b239d[_0x320a('0x37')][_0x320a('0x39')]?_0x3b239d[_0x320a('0x37')]:_0x3f94[_0x320a('0x33')];if(!_0x1e4080[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x3b239d[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x1e4080[_0x320a('0x34')][_0x320a('0x1c')]);_0x3b239d[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x1e4080[_0x320a('0x34')][_0x320a('0x19')]);}_0x3b239d[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x1e4080[_0x320a('0x34')][_0x320a('0x3c')]);_0x3b239d[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x1e4080[_0x320a('0x34')],_0x3f94[_0x320a('0x3e')]));_0x3b239d[_0x320a('0x3d')][_0x320a('0x5c')]=_0x2b6471['id'];if(_0x1e4080[_0x320a('0x34')][_0x320a('0x40')]){_0x3b239d['where']=_[_0x320a('0x51')](_0x3b239d[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x3b239d[_0x320a('0x37')],function(_0x404c34){var _0x4383fb={};_0x4383fb[_0x404c34]={'$like':'%'+_0x1e4080[_0x320a('0x34')][_0x320a('0x40')]+'%'};return _0x4383fb;})});}_0x3b239d=_['merge']({},_0x3b239d,_0x1e4080[_0x320a('0x47')]);return db[_0x320a('0x5b')]['count']({'where':_0x3b239d[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x2bf93b){_0x19a2d6[_0x320a('0x1b')]=_0x2bf93b;if(_0x1e4080['query'][_0x320a('0x42')]){_0x3b239d[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x5b')][_0x320a('0x5d')](_0x3b239d);})[_0x320a('0x24')](function(_0x2635b9){_0x19a2d6[_0x320a('0x5e')]=_0x2635b9;return _0x19a2d6;});}})['then'](respondWithFilteredResult(_0xdd2b5e,_0x3b239d))[_0x320a('0x44')](handleError(_0xdd2b5e,null));};exports[_0x320a('0x5f')]=function(_0x4fcffc,_0x5237a0,_0x1cd5c1){var _0x4fdfe1={'raw':!![],'where':{}};var _0x2d1d00={};var _0x3506ed={'count':0x0,'rows':[]};return db[_0x320a('0x2e')]['findOne']({'where':{'id':_0x4fcffc[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x5237a0,null))[_0x320a('0x24')](function(_0xed6b90){if(_0xed6b90){_0x2d1d00[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x60')][_0x320a('0x2f')]);_0x2d1d00[_0x320a('0x34')]=_['keys'](_0x4fcffc[_0x320a('0x34')]);_0x2d1d00[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x2d1d00[_0x320a('0x33')],_0x2d1d00[_0x320a('0x34')]);_0x4fdfe1[_0x320a('0x37')]=_[_0x320a('0x36')](_0x2d1d00[_0x320a('0x33')],qs[_0x320a('0x38')](_0x4fcffc[_0x320a('0x34')][_0x320a('0x38')]));_0x4fdfe1[_0x320a('0x37')]=_0x4fdfe1['attributes'][_0x320a('0x39')]?_0x4fdfe1[_0x320a('0x37')]:_0x2d1d00[_0x320a('0x33')];if(!_0x4fcffc[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x4fdfe1[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x4fcffc[_0x320a('0x34')]['limit']);_0x4fdfe1['offset']=qs['offset'](_0x4fcffc['query']['offset']);}_0x4fdfe1[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x4fcffc[_0x320a('0x34')][_0x320a('0x3c')]);_0x4fdfe1[_0x320a('0x3d')]=qs['filters'](_[_0x320a('0x3f')](_0x4fcffc['query'],_0x2d1d00[_0x320a('0x3e')]));_0x4fdfe1[_0x320a('0x3d')]['CampaignId']=_0xed6b90['id'];if(_0x4fcffc['query'][_0x320a('0x40')]){_0x4fdfe1[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x4fdfe1[_0x320a('0x3d')],{'$or':_['map'](_0x4fdfe1[_0x320a('0x37')],function(_0x11bbf4){var _0x48fe4b={};_0x48fe4b[_0x11bbf4]={'$like':'%'+_0x4fcffc['query']['filter']+'%'};return _0x48fe4b;})});}_0x4fdfe1=_[_0x320a('0x51')]({},_0x4fdfe1,_0x4fcffc['options']);return db[_0x320a('0x60')][_0x320a('0x1b')]({'where':_0x4fdfe1[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x3e9574){_0x3506ed[_0x320a('0x1b')]=_0x3e9574;if(_0x4fcffc[_0x320a('0x34')][_0x320a('0x42')]){_0x4fdfe1[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x60')][_0x320a('0x5d')](_0x4fdfe1);})[_0x320a('0x24')](function(_0x3ebf0b){_0x3506ed['rows']=_0x3ebf0b;return _0x3506ed;});}})[_0x320a('0x24')](respondWithFilteredResult(_0x5237a0,_0x4fdfe1))[_0x320a('0x44')](handleError(_0x5237a0,null));};exports[_0x320a('0x61')]=function(_0x46be5a,_0x843a79,_0x503d22){var _0x257af5={'raw':!![],'where':{}};var _0x1e046b={};var _0x46e8d5={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x46be5a[_0x320a('0x46')]['id']}})['then'](handleEntityNotFound(_0x843a79,null))[_0x320a('0x24')](function(_0x2f67db){if(_0x2f67db){_0x1e046b[_0x320a('0x33')]=_['keys'](db[_0x320a('0x62')]['rawAttributes']);_0x1e046b[_0x320a('0x34')]=_[_0x320a('0x35')](_0x46be5a['query']);_0x1e046b[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x1e046b[_0x320a('0x33')],_0x1e046b['query']);_0x257af5[_0x320a('0x37')]=_['intersection'](_0x1e046b[_0x320a('0x33')],qs['fields'](_0x46be5a[_0x320a('0x34')][_0x320a('0x38')]));_0x257af5[_0x320a('0x37')]=_0x257af5[_0x320a('0x37')][_0x320a('0x39')]?_0x257af5[_0x320a('0x37')]:_0x1e046b[_0x320a('0x33')];if(!_0x46be5a[_0x320a('0x34')]['hasOwnProperty'](_0x320a('0x3a'))){_0x257af5[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x46be5a[_0x320a('0x34')]['limit']);_0x257af5[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x46be5a['query']['offset']);}_0x257af5[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x46be5a['query']['sort']);_0x257af5['where']=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x46be5a[_0x320a('0x34')],_0x1e046b[_0x320a('0x3e')]));_0x257af5[_0x320a('0x3d')][_0x320a('0x5c')]=_0x2f67db['id'];if(_0x46be5a[_0x320a('0x34')][_0x320a('0x40')]){_0x257af5[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x257af5[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x257af5[_0x320a('0x37')],function(_0x562138){var _0x4d5d46={};_0x4d5d46[_0x562138]={'$like':'%'+_0x46be5a['query']['filter']+'%'};return _0x4d5d46;})});}_0x257af5=_['merge']({},_0x257af5,_0x46be5a[_0x320a('0x47')]);return db['CmHopperBlack'][_0x320a('0x1b')]({'where':_0x257af5['where']})[_0x320a('0x24')](function(_0x466788){_0x46e8d5[_0x320a('0x1b')]=_0x466788;if(_0x46be5a[_0x320a('0x34')][_0x320a('0x42')]){_0x257af5[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x62')]['findAll'](_0x257af5);})['then'](function(_0x8a0ca6){_0x46e8d5[_0x320a('0x5e')]=_0x8a0ca6;return _0x46e8d5;});}})[_0x320a('0x24')](respondWithFilteredResult(_0x843a79,_0x257af5))[_0x320a('0x44')](handleError(_0x843a79,null));};exports['getLists']=function(_0x4b6c7a,_0xcc8225,_0x5cab1f){var _0x1c2293={};var _0x5b9f0e={};var _0x25a0e3;var _0x50e7e9;return db[_0x320a('0x2e')][_0x320a('0x58')]({'where':{'id':_0x4b6c7a['params']['id']}})[_0x320a('0x24')](handleEntityNotFound(_0xcc8225,null))[_0x320a('0x24')](function(_0x40b992){if(_0x40b992){_0x25a0e3=_0x40b992;_0x5b9f0e[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x63')][_0x320a('0x2f')]);_0x5b9f0e[_0x320a('0x34')]=_[_0x320a('0x35')](_0x4b6c7a[_0x320a('0x34')]);_0x5b9f0e[_0x320a('0x3e')]=_['intersection'](_0x5b9f0e[_0x320a('0x33')],_0x5b9f0e['query']);_0x1c2293[_0x320a('0x37')]=_[_0x320a('0x36')](_0x5b9f0e[_0x320a('0x33')],qs['fields'](_0x4b6c7a['query'][_0x320a('0x38')]));_0x1c2293[_0x320a('0x37')]=_0x1c2293[_0x320a('0x37')]['length']?_0x1c2293[_0x320a('0x37')]:_0x5b9f0e[_0x320a('0x33')];_0x1c2293['order']=qs[_0x320a('0x3c')](_0x4b6c7a['query'][_0x320a('0x3c')]);_0x1c2293[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x4b6c7a[_0x320a('0x34')],_0x5b9f0e[_0x320a('0x3e')]));if(_0x4b6c7a['query'][_0x320a('0x40')]){_0x1c2293[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x1c2293[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x1c2293['attributes'],function(_0x3bda28){var _0x36bf9f={};_0x36bf9f[_0x3bda28]={'$like':'%'+_0x4b6c7a['query'][_0x320a('0x40')]+'%'};return _0x36bf9f;})});}_0x1c2293=_[_0x320a('0x51')]({},_0x1c2293,_0x4b6c7a[_0x320a('0x47')]);return _0x25a0e3[_0x320a('0x64')](_0x1c2293);}})['then'](function(_0x242d3f){if(_0x242d3f){_0x50e7e9=_0x242d3f[_0x320a('0x39')];if(!_0x4b6c7a[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x1c2293['limit']=qs['limit'](_0x4b6c7a[_0x320a('0x34')]['limit']);_0x1c2293[_0x320a('0x19')]=qs['offset'](_0x4b6c7a['query']['offset']);}return _0x25a0e3[_0x320a('0x64')](_0x1c2293);}})[_0x320a('0x24')](function(_0x20286e){if(_0x20286e){return _0x20286e?{'count':_0x50e7e9,'rows':_0x20286e}:null;}})[_0x320a('0x24')](respondWithResult(_0xcc8225,null))[_0x320a('0x44')](handleError(_0xcc8225,null));};exports[_0x320a('0x65')]=function(_0x6569a1,_0x511f17,_0x48f016){var _0x3ed4de,_0x23e70e;var _0x29b021=[];var _0x4f262f=moment()['format'](_0x320a('0x66'));return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x6569a1[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x511f17,null))['then'](function(_0x431e4d){if(_0x431e4d){_0x23e70e=_0x431e4d;return _0x431e4d[_0x320a('0x65')](_0x6569a1[_0x320a('0x4a')]['ids'],_[_0x320a('0x52')](_0x6569a1['body'],[_0x320a('0x67'),'id'])||{});}return null;})['spread'](function(_0xf35daf){var _0x181627;var _0x218aa6;_0x3ed4de=_0xf35daf||[];var _0x1e8123=[];if(_0xf35daf){for(var _0x4ee444=0x0;_0x4ee444<_0xf35daf[_0x320a('0x39')];_0x4ee444+=0x1){var _0x3e2eba=_0xf35daf[_0x4ee444][_0x320a('0x25')]({'plain':!![]});_0x23e70e['dialCheckDuplicateType']=_0x6569a1['body'][_0x320a('0x68')]?_0x6569a1['body'][_0x320a('0x68')]:_0x23e70e[_0x320a('0x68')];switch(_0x23e70e['dialCheckDuplicateType']){case _0x320a('0x69'):_0x181627=squel[_0x320a('0x6a')]()[_0x320a('0x6b')](_0x320a('0x6c'))[_0x320a('0x6d')]([_0x320a('0x6e'),_0x320a('0x6f'),_0x320a('0x70'),_0x320a('0x71'),_0x320a('0x5c'),'createdAt','updatedAt'],squel['select']()[_0x320a('0x72')](_0x320a('0x6e'),'phone')[_0x320a('0x72')](_0x320a('0x73'),_0x320a('0x6f'))[_0x320a('0x72')]('id',_0x320a('0x70'))['field'](_0x3e2eba[_0x320a('0x74')]['toString'](),'ListId')[_0x320a('0x72')](_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')](),_0x320a('0x5c'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x53'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))['from']('cm_contacts')['where'](_0x320a('0x76'))['where'](_0x320a('0x77'),_0x3e2eba[_0x320a('0x74')][_0x320a('0x75')]())[_0x320a('0x3d')](_0x320a('0x78'))[_0x320a('0x3d')](_0x320a('0x79'),squel['select']()[_0x320a('0x72')](_0x320a('0x7a'))[_0x320a('0x7b')](_0x320a('0x7c'))[_0x320a('0x3d')](_0x320a('0x7d'),_0x6569a1['params']['id']['toString']()))[_0x320a('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x320a('0x72')](_0x320a('0x7e'))[_0x320a('0x7b')](_0x320a('0x6c'))['where'](_0x320a('0x7d'),_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')]())))[_0x320a('0x75')]();break;case _0x320a('0x7f'):_0x181627=squel[_0x320a('0x6a')]()[_0x320a('0x6b')](_0x320a('0x6c'))[_0x320a('0x6d')]([_0x320a('0x6e'),_0x320a('0x6f'),_0x320a('0x70'),_0x320a('0x71'),_0x320a('0x5c'),_0x320a('0x53'),'updatedAt'],squel[_0x320a('0x80')]()['field']('phone',_0x320a('0x6e'))['field']('NOW()',_0x320a('0x6f'))[_0x320a('0x72')]('id',_0x320a('0x70'))[_0x320a('0x72')](_0x3e2eba[_0x320a('0x74')]['toString'](),_0x320a('0x71'))[_0x320a('0x72')](_0x6569a1['params']['id'][_0x320a('0x75')](),_0x320a('0x5c'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27','createdAt')[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))['from']('cm_contacts')[_0x320a('0x3d')](_0x320a('0x76'))[_0x320a('0x3d')](_0x320a('0x77'),_0x3e2eba[_0x320a('0x74')]['toString']())[_0x320a('0x3d')](_0x320a('0x78'))['where'](_0x320a('0x79'),squel[_0x320a('0x80')]()[_0x320a('0x72')](_0x320a('0x7e'))['from'](_0x320a('0x6c'))[_0x320a('0x3d')](_0x320a('0x7d'),_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')]())))[_0x320a('0x75')]();break;default:_0x181627=squel[_0x320a('0x6a')]()[_0x320a('0x6b')](_0x320a('0x6c'))['fromQuery']([_0x320a('0x6e'),_0x320a('0x6f'),_0x320a('0x70'),_0x320a('0x71'),'CampaignId','createdAt',_0x320a('0x54')],squel['select']()[_0x320a('0x72')](_0x320a('0x6e'),_0x320a('0x6e'))['field']('NOW()','scheduledAt')[_0x320a('0x72')]('id',_0x320a('0x70'))['field'](_0x3e2eba[_0x320a('0x74')][_0x320a('0x75')](),_0x320a('0x71'))[_0x320a('0x72')](_0x6569a1['params']['id'][_0x320a('0x75')](),_0x320a('0x5c'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x53'))['field']('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))['from'](_0x320a('0x81'))[_0x320a('0x3d')]('deletedAt\x20IS\x20NULL')[_0x320a('0x3d')](_0x320a('0x77'),_0x3e2eba[_0x320a('0x74')][_0x320a('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x320a('0x75')]();}_0x218aa6=squel['insert']()['into'](_0x320a('0x82'))[_0x320a('0x6d')]([_0x320a('0x83'),_0x320a('0x6f'),'phone','OrderBy',_0x320a('0x53'),_0x320a('0x54')],squel[_0x320a('0x80')]()[_0x320a('0x72')]('h.id','id')['field'](_0x320a('0x73'),'scheduledAt')['field'](_0x320a('0x84'),_0x320a('0x6e'))[_0x320a('0x72')](_0x320a('0x85'),_0x320a('0x86'))[_0x320a('0x72')]('\x27'+_0x4f262f+'\x27',_0x320a('0x53'))['field']('\x27'+_0x4f262f+'\x27',_0x320a('0x54'))[_0x320a('0x7b')](_0x320a('0x87'),'ci')['join']('cm_hopper','h',_0x320a('0x88'))[_0x320a('0x3d')](_0x320a('0x89'),_0x3e2eba['CmListId'][_0x320a('0x75')]())[_0x320a('0x3d')](_0x320a('0x8a'),_0x6569a1[_0x320a('0x46')]['id'][_0x320a('0x75')]())['where']('h.createdAt\x20=\x20?',_0x4f262f))[_0x320a('0x75')]();_0x1e8123[_0x320a('0x8b')](db[_0x320a('0x8c')][_0x320a('0x34')](_0x181627));_0x29b021['push'](db[_0x320a('0x8c')]['query'](_0x218aa6));}return BPromise[_0x320a('0x8d')](_0x1e8123);}})[_0x320a('0x24')](function(){return BPromise[_0x320a('0x8d')](_0x29b021);})[_0x320a('0x24')](function(){return _0x3ed4de;})[_0x320a('0x24')](respondWithResult(_0x511f17,null))['catch'](handleError(_0x511f17,null));};exports[_0x320a('0x8e')]=function(_0x5d347e,_0x3c882c,_0x538b9f){return db[_0x320a('0x2e')]['find']({'where':{'id':_0x5d347e[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x3c882c,null))[_0x320a('0x24')](function(_0x9052d7){if(_0x9052d7){return _0x9052d7[_0x320a('0x8e')](_0x5d347e[_0x320a('0x34')]['ids']);}})[_0x320a('0x24')](function(_0x47e688){if(_0x47e688){return db[_0x320a('0x59')][_0x320a('0x23')]({'where':{'ListId':_0x5d347e['query'][_0x320a('0x67')],'CampaignId':_0x5d347e[_0x320a('0x46')]['id']}})[_0x320a('0x24')](function(){return _0x47e688;});}})[_0x320a('0x24')](respondWithStatusCode(_0x3c882c,null))['catch'](handleError(_0x3c882c,null));};exports[_0x320a('0x8f')]=function(_0x5521e6,_0x1a88cf,_0x3d0132){var _0xfd9dd3={};var _0x31ab9c={};var _0x2ff6a4;var _0x477761;return db['Campaign'][_0x320a('0x58')]({'where':{'id':_0x5521e6['params']['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x1a88cf,null))[_0x320a('0x24')](function(_0x33fb29){if(_0x33fb29){_0x2ff6a4=_0x33fb29;_0x31ab9c[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x63')][_0x320a('0x2f')]);_0x31ab9c[_0x320a('0x34')]=_[_0x320a('0x35')](_0x5521e6[_0x320a('0x34')]);_0x31ab9c[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x31ab9c[_0x320a('0x33')],_0x31ab9c[_0x320a('0x34')]);_0xfd9dd3[_0x320a('0x37')]=_['intersection'](_0x31ab9c[_0x320a('0x33')],qs[_0x320a('0x38')](_0x5521e6['query'][_0x320a('0x38')]));_0xfd9dd3[_0x320a('0x37')]=_0xfd9dd3[_0x320a('0x37')][_0x320a('0x39')]?_0xfd9dd3[_0x320a('0x37')]:_0x31ab9c[_0x320a('0x33')];_0xfd9dd3[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x5521e6[_0x320a('0x34')][_0x320a('0x3c')]);_0xfd9dd3[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x5521e6[_0x320a('0x34')],_0x31ab9c['filters']));if(_0x5521e6[_0x320a('0x34')][_0x320a('0x40')]){_0xfd9dd3[_0x320a('0x3d')]=_[_0x320a('0x51')](_0xfd9dd3[_0x320a('0x3d')],{'$or':_['map'](_0xfd9dd3['attributes'],function(_0x9bfa81){var _0x3b6af3={};_0x3b6af3[_0x9bfa81]={'$like':'%'+_0x5521e6['query'][_0x320a('0x40')]+'%'};return _0x3b6af3;})});}_0xfd9dd3=_[_0x320a('0x51')]({},_0xfd9dd3,_0x5521e6[_0x320a('0x47')]);return _0x2ff6a4[_0x320a('0x8f')](_0xfd9dd3);}})['then'](function(_0x365c1c){if(_0x365c1c){_0x477761=_0x365c1c[_0x320a('0x39')];if(!_0x5521e6[_0x320a('0x34')][_0x320a('0x5a')]('nolimit')){_0xfd9dd3[_0x320a('0x1c')]=qs['limit'](_0x5521e6[_0x320a('0x34')][_0x320a('0x1c')]);_0xfd9dd3['offset']=qs['offset'](_0x5521e6[_0x320a('0x34')]['offset']);}return _0x2ff6a4[_0x320a('0x8f')](_0xfd9dd3);}})[_0x320a('0x24')](function(_0x2c728c){if(_0x2c728c){return _0x2c728c?{'count':_0x477761,'rows':_0x2c728c}:null;}})[_0x320a('0x24')](respondWithResult(_0x1a88cf,null))[_0x320a('0x44')](handleError(_0x1a88cf,null));};exports[_0x320a('0x90')]=function(_0x10f737,_0x1c8ad2,_0xdc8083){var _0x3d8b57,_0x4122ba;var _0x1f7c92=[];var _0x16f2b1=moment()[_0x320a('0x91')](_0x320a('0x66'));return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x10f737['params']['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x1c8ad2,null))[_0x320a('0x24')](function(_0xa645e5){if(_0xa645e5){_0x4122ba=_0xa645e5;return _0xa645e5[_0x320a('0x90')](_0x10f737[_0x320a('0x4a')][_0x320a('0x67')],_[_0x320a('0x52')](_0x10f737[_0x320a('0x4a')],[_0x320a('0x67'),'id'])||{});}return null;})['spread'](function(_0x68d8b0){var _0x858b7a;var _0x56d4d1;_0x3d8b57=_0x68d8b0||[];var _0x125c95=[];if(_0x68d8b0){for(var _0x19964b=0x0;_0x19964b<_0x68d8b0[_0x320a('0x39')];_0x19964b+=0x1){var _0x4bc12a=_0x68d8b0[_0x19964b]['get']({'plain':!![]});_0x858b7a=squel[_0x320a('0x6a')]()['into'](_0x320a('0x92'))[_0x320a('0x6d')]([_0x320a('0x6e'),_0x320a('0x70'),_0x320a('0x71'),_0x320a('0x5c'),_0x320a('0x53'),'updatedAt'],squel[_0x320a('0x80')]()[_0x320a('0x72')](_0x320a('0x6e'),_0x320a('0x6e'))['field']('id',_0x320a('0x70'))[_0x320a('0x72')](_0x4bc12a[_0x320a('0x74')][_0x320a('0x75')](),_0x320a('0x71'))[_0x320a('0x72')](_0x10f737[_0x320a('0x46')]['id'][_0x320a('0x75')](),_0x320a('0x5c'))['field'](_0x320a('0x73'),_0x320a('0x53'))[_0x320a('0x72')]('NOW()','updatedAt')[_0x320a('0x7b')](_0x320a('0x81'))['where'](_0x320a('0x76'))[_0x320a('0x3d')]('ListId\x20=\x20?',_0x4bc12a[_0x320a('0x74')][_0x320a('0x75')]())[_0x320a('0x3d')](_0x320a('0x78')))[_0x320a('0x75')]();_0x125c95[_0x320a('0x8b')](db[_0x320a('0x8c')][_0x320a('0x34')](_0x858b7a));}return BPromise[_0x320a('0x8d')](_0x125c95);}})[_0x320a('0x24')](function(){return _0x3d8b57;})[_0x320a('0x24')](respondWithResult(_0x1c8ad2,null))[_0x320a('0x44')](handleError(_0x1c8ad2,null));};exports[_0x320a('0x93')]=function(_0x4b90c8,_0xb47771,_0x3fbb42){return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x4b90c8[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0xb47771,null))[_0x320a('0x24')](function(_0xea3af5){if(_0xea3af5){return _0xea3af5['removeBlackLists'](_0x4b90c8[_0x320a('0x34')][_0x320a('0x67')]);}})['then'](function(_0xb1141a){if(_0xb1141a){return db[_0x320a('0x62')][_0x320a('0x23')]({'where':{'ListId':_0x4b90c8[_0x320a('0x34')]['ids'],'CampaignId':_0x4b90c8['params']['id']}})['then'](function(){return _0xb1141a;});}})[_0x320a('0x24')](respondWithStatusCode(_0xb47771,null))[_0x320a('0x44')](handleError(_0xb47771,null));}; \ No newline at end of file +var _0xe773=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','NOW()','cm_contacts','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json'];(function(_0x2d5341,_0x590e15){var _0x3c87a5=function(_0x5ecdd5){while(--_0x5ecdd5){_0x2d5341['push'](_0x2d5341['shift']());}};_0x3c87a5(++_0x590e15);}(_0xe773,0x19a));var _0x3e77=function(_0x5b51dc,_0x4a4b33){_0x5b51dc=_0x5b51dc-0x0;var _0x315a48=_0xe773[_0x5b51dc];return _0x315a48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e77('0x0'));var zipdir=require(_0x3e77('0x1'));var jsonpatch=require(_0x3e77('0x2'));var rp=require('request-promise');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var Mustache=require(_0x3e77('0x5'));var util=require(_0x3e77('0x6'));var path=require(_0x3e77('0x7'));var sox=require('sox');var csv=require(_0x3e77('0x8'));var ejs=require(_0x3e77('0x9'));var fs=require('fs');var fs_extra=require(_0x3e77('0xa'));var _=require(_0x3e77('0xb'));var squel=require(_0x3e77('0xc'));var crypto=require(_0x3e77('0xd'));var jsforce=require(_0x3e77('0xe'));var deskjs=require(_0x3e77('0xf'));var toCsv=require(_0x3e77('0x8'));var querystring=require(_0x3e77('0x10'));var Papa=require(_0x3e77('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e77('0x12'));var as=require(_0x3e77('0x13'));var hardwareService=require(_0x3e77('0x14'));var logger=require(_0x3e77('0x15'))(_0x3e77('0x16'));var utils=require('../../config/utils');var config=require(_0x3e77('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aa8a5,_0x4a1d09){_0x4a1d09=_0x4a1d09||0xcc;return function(_0x5b0f11){if(_0x5b0f11){return _0x1aa8a5[_0x3e77('0x18')](_0x4a1d09);}return _0x1aa8a5[_0x3e77('0x19')](_0x4a1d09)[_0x3e77('0x1a')]();};}function respondWithResult(_0x53188b,_0xb9208c){_0xb9208c=_0xb9208c||0xc8;return function(_0x55610c){if(_0x55610c){return _0x53188b[_0x3e77('0x19')](_0xb9208c)[_0x3e77('0x1b')](_0x55610c);}};}function respondWithFilteredResult(_0x4a48c8,_0x3fc41f){return function(_0x11d14b){if(_0x11d14b){var _0x39ec03=typeof _0x3fc41f[_0x3e77('0x1c')]===_0x3e77('0x1d')&&typeof _0x3fc41f[_0x3e77('0x1e')]==='undefined';var _0x1c2260=_0x11d14b[_0x3e77('0x1f')];var _0x35d890=_0x39ec03?0x0:_0x3fc41f[_0x3e77('0x1c')];var _0x58b8ee=_0x39ec03?_0x11d14b['count']:_0x3fc41f[_0x3e77('0x1c')]+_0x3fc41f['limit'];var _0x1eb346;if(_0x58b8ee>=_0x1c2260){_0x58b8ee=_0x1c2260;_0x1eb346=0xc8;}else{_0x1eb346=0xce;}_0x4a48c8[_0x3e77('0x19')](_0x1eb346);return _0x4a48c8[_0x3e77('0x20')](_0x3e77('0x21'),_0x35d890+'-'+_0x58b8ee+'/'+_0x1c2260)[_0x3e77('0x1b')](_0x11d14b);}return null;};}function patchUpdates(_0x19c4e1){return function(_0x4b2101){try{jsonpatch[_0x3e77('0x22')](_0x4b2101,_0x19c4e1,!![]);}catch(_0x96b07){return BPromise[_0x3e77('0x23')](_0x96b07);}return _0x4b2101[_0x3e77('0x24')]();};}function saveUpdates(_0x2a384a,_0x289c3d){return function(_0x2e027a){if(_0x2e027a){return _0x2e027a[_0x3e77('0x25')](_0x2a384a)['then'](function(_0x45762f){return _0x45762f;});}return null;};}function removeEntity(_0x317f32,_0x3ef7cf){return function(_0x1b2ce6){if(_0x1b2ce6){return _0x1b2ce6['destroy']()[_0x3e77('0x26')](function(){var _0x320144=_0x1b2ce6[_0x3e77('0x27')]({'plain':!![]});var _0x1efc1a=_0x3e77('0x28');return db[_0x3e77('0x29')][_0x3e77('0x2a')]({'where':{'type':_0x1efc1a,'resourceId':_0x320144['id']}})[_0x3e77('0x26')](function(){return _0x1b2ce6;});})[_0x3e77('0x26')](function(){_0x317f32[_0x3e77('0x19')](0xcc)[_0x3e77('0x1a')]();});}};}function handleEntityNotFound(_0x472a9e,_0x5cfc73){return function(_0x30e81f){if(!_0x30e81f){_0x472a9e[_0x3e77('0x18')](0x194);}return _0x30e81f;};}function handleError(_0x4fc072,_0x581719){_0x581719=_0x581719||0x1f4;return function(_0x3c4f6a){logger[_0x3e77('0x2b')](_0x3c4f6a[_0x3e77('0x2c')]);if(_0x3c4f6a[_0x3e77('0x2d')]){delete _0x3c4f6a['name'];}_0x4fc072[_0x3e77('0x19')](_0x581719)['send'](_0x3c4f6a);};}exports[_0x3e77('0x2e')]=function(_0x3333f1,_0x27cce5){var _0x577599={},_0x513d5c={},_0x2e42a1={'count':0x0,'rows':[]};var _0x2276f4=_[_0x3e77('0x2f')](db[_0x3e77('0x30')][_0x3e77('0x31')],function(_0x7c3a3c){return{'name':_0x7c3a3c[_0x3e77('0x32')],'type':_0x7c3a3c['type'][_0x3e77('0x33')]};});_0x513d5c[_0x3e77('0x34')]=_['map'](_0x2276f4,_0x3e77('0x2d'));_0x513d5c[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3333f1['query']);_0x513d5c[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],_0x513d5c[_0x3e77('0x35')]);_0x577599[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],qs['fields'](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x577599[_0x3e77('0x39')]=_0x577599[_0x3e77('0x39')]['length']?_0x577599[_0x3e77('0x39')]:_0x513d5c[_0x3e77('0x34')];if(!_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x577599['limit']=qs[_0x3e77('0x1e')](_0x3333f1[_0x3e77('0x35')]['limit']);_0x577599[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x577599[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x577599[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3333f1['query'],_0x513d5c[_0x3e77('0x37')]),_0x2276f4);if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]){_0x577599['where']=_[_0x3e77('0x42')](_0x577599[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x2276f4,function(_0x18a3f5){if(_0x18a3f5[_0x3e77('0x43')]!==_0x3e77('0x44')){var _0x39894b={};_0x39894b[_0x18a3f5['name']]={'$like':'%'+_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x39894b;}})});}_0x577599=_[_0x3e77('0x42')]({},_0x577599,_0x3333f1[_0x3e77('0x45')]);var _0x288df3={'where':_0x577599[_0x3e77('0x3f')]};return db[_0x3e77('0x30')]['count'](_0x288df3)[_0x3e77('0x26')](function(_0x48396b){_0x2e42a1[_0x3e77('0x1f')]=_0x48396b;if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x46')]){_0x577599[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x30')]['findAll'](_0x577599);})[_0x3e77('0x26')](function(_0x58cfe4){_0x2e42a1[_0x3e77('0x48')]=_0x58cfe4;return _0x2e42a1;})[_0x3e77('0x26')](respondWithFilteredResult(_0x27cce5,_0x577599))[_0x3e77('0x49')](handleError(_0x27cce5,null));};exports[_0x3e77('0x4a')]=function(_0x155210,_0x3c59ae){var _0x4d6a9d={'raw':![],'where':{'id':_0x155210[_0x3e77('0x4b')]['id']}},_0x4d51cd={};_0x4d51cd[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x4d51cd[_0x3e77('0x35')]=_['keys'](_0x155210['query']);_0x4d51cd[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],_0x4d51cd[_0x3e77('0x35')]);_0x4d6a9d[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x155210[_0x3e77('0x35')]['fields']));_0x4d6a9d[_0x3e77('0x39')]=_0x4d6a9d[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x4d6a9d[_0x3e77('0x39')]:_0x4d51cd[_0x3e77('0x34')];if(_0x155210['query'][_0x3e77('0x46')]){_0x4d6a9d[_0x3e77('0x47')]=[{'all':!![]}];}_0x4d6a9d=_[_0x3e77('0x42')]({},_0x4d6a9d,_0x155210[_0x3e77('0x45')]);return db[_0x3e77('0x30')][_0x3e77('0x4d')](_0x4d6a9d)[_0x3e77('0x26')](handleEntityNotFound(_0x3c59ae,null))[_0x3e77('0x26')](respondWithResult(_0x3c59ae,null))[_0x3e77('0x49')](handleError(_0x3c59ae,null));};exports[_0x3e77('0x4e')]=function(_0x598971,_0x2e28f7){return db[_0x3e77('0x30')][_0x3e77('0x4e')](_0x598971[_0x3e77('0x4f')],{})['then'](function(_0x3022f6){var _0x36ba43=_0x598971[_0x3e77('0x50')]['get']({'plain':!![]});if(!_0x36ba43)throw new Error(_0x3e77('0x51'));if(_0x36ba43[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1b6046=_0x3022f6[_0x3e77('0x27')]({'plain':!![]});var _0x5ae2cd=_0x3e77('0x28');return db[_0x3e77('0x53')][_0x3e77('0x4d')]({'where':{'name':_0x5ae2cd,'userProfileId':_0x36ba43[_0x3e77('0x54')]},'raw':!![]})[_0x3e77('0x26')](function(_0x30c4ea){if(_0x30c4ea&&_0x30c4ea[_0x3e77('0x55')]===0x0){return db['UserProfileResource'][_0x3e77('0x4e')]({'name':_0x1b6046['name'],'resourceId':_0x1b6046['id'],'type':_0x30c4ea[_0x3e77('0x2d')],'sectionId':_0x30c4ea['id']},{})[_0x3e77('0x26')](function(){return _0x3022f6;});}else{return _0x3022f6;}})[_0x3e77('0x49')](function(_0x1e3c3a){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x1e3c3a);throw _0x1e3c3a;});}return _0x3022f6;})[_0x3e77('0x26')](respondWithResult(_0x2e28f7,0xc9))[_0x3e77('0x49')](handleError(_0x2e28f7,null));};exports[_0x3e77('0x57')]=function(_0x595879,_0x24346a){var _0x126d4c={'where':{'id':_0x595879[_0x3e77('0x4b')]['id']}},_0xe54e0={};_0xe54e0[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x126d4c[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xe54e0[_0x3e77('0x34')],qs['fields'](_0x595879[_0x3e77('0x35')]['fields']));_0x126d4c[_0x3e77('0x39')]=_0x126d4c['attributes'][_0x3e77('0x4c')]?_0x126d4c[_0x3e77('0x39')]:_0xe54e0[_0x3e77('0x34')];if(_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]){_0x126d4c[_0x3e77('0x47')]=[{'all':!![]}];}_0x126d4c=_[_0x3e77('0x42')]({},_0x126d4c,_0x595879['options']);return db['Campaign'][_0x3e77('0x4d')](_0x126d4c)['then'](handleEntityNotFound(_0x24346a,null))[_0x3e77('0x26')](function(_0x3e61bf){if(_0x3e61bf){var _0x512fda=_0x3e61bf[_0x3e77('0x27')]({'plain':!![]});_0x512fda=qs[_0x3e77('0x58')](_0x512fda,['id',_0x3e77('0x59'),_0x3e77('0x5a')]);_0x595879[_0x3e77('0x4f')]=_[_0x3e77('0x58')](_0x595879[_0x3e77('0x4f')],['id','createdAt',_0x3e77('0x5a')]);return db[_0x3e77('0x30')][_0x3e77('0x4e')](_[_0x3e77('0x42')](_0x512fda,_0x595879[_0x3e77('0x4f')]),{'include':_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x4de4c4){var _0x1ebdc6=_0x595879[_0x3e77('0x50')][_0x3e77('0x27')]({'plain':!![]});if(!_0x1ebdc6)throw new Error(_0x3e77('0x51'));if(_0x1ebdc6[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1890b5=_0x4de4c4['get']({'plain':!![]});var _0x26bd0c=_0x3e77('0x28');return db[_0x3e77('0x53')]['find']({'where':{'name':_0x26bd0c,'userProfileId':_0x1ebdc6['userProfileId']},'raw':!![]})[_0x3e77('0x26')](function(_0x532df3){if(_0x532df3&&_0x532df3['autoAssociation']===0x0){return db[_0x3e77('0x29')]['create']({'name':_0x1890b5[_0x3e77('0x2d')],'resourceId':_0x1890b5['id'],'type':_0x532df3[_0x3e77('0x2d')],'sectionId':_0x532df3['id']},{})[_0x3e77('0x26')](function(){return _0x4de4c4;});}else{return _0x4de4c4;}})[_0x3e77('0x49')](function(_0x58623b){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x58623b);throw _0x58623b;});}return _0x4de4c4;});}})[_0x3e77('0x26')](respondWithResult(_0x24346a,0xc9))['catch'](handleError(_0x24346a,null));};exports['update']=function(_0x293c2e,_0x2c4bc2){if(_0x293c2e[_0x3e77('0x4f')]['id']){delete _0x293c2e[_0x3e77('0x4f')]['id'];}return db[_0x3e77('0x30')]['find']({'where':{'id':_0x293c2e[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c4bc2,null))['then'](saveUpdates(_0x293c2e[_0x3e77('0x4f')],null))['then'](respondWithResult(_0x2c4bc2,null))['catch'](handleError(_0x2c4bc2,null));};exports['destroy']=function(_0x207da1,_0x18cedd){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x207da1[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18cedd,null))['then'](removeEntity(_0x18cedd,null))[_0x3e77('0x49')](handleError(_0x18cedd,null));};exports[_0x3e77('0x5b')]=function(_0x3c174a,_0x248266,_0x3d4973){var _0x117abc={'raw':!![],'where':{}};var _0x1647f5={};var _0xf4a464={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3c174a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x248266,null))[_0x3e77('0x26')](function(_0x110d3f){if(_0x110d3f){_0x1647f5[_0x3e77('0x34')]=_['keys'](db[_0x3e77('0x5c')][_0x3e77('0x31')]);_0x1647f5[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3c174a[_0x3e77('0x35')]);_0x1647f5[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],_0x1647f5[_0x3e77('0x35')]);_0x117abc[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x117abc['attributes']=_0x117abc[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x117abc[_0x3e77('0x39')]:_0x1647f5[_0x3e77('0x34')];if(!_0x3c174a['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x117abc[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3c174a[_0x3e77('0x35')]['limit']);_0x117abc['offset']=qs[_0x3e77('0x1c')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x117abc[_0x3e77('0x3d')]=qs['sort'](_0x3c174a[_0x3e77('0x35')]['sort']);_0x117abc[_0x3e77('0x3f')]=qs['filters'](_[_0x3e77('0x40')](_0x3c174a[_0x3e77('0x35')],_0x1647f5['filters']));_0x117abc[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x110d3f['id'];if(_0x3c174a['query'][_0x3e77('0x41')]){_0x117abc['where']=_['merge'](_0x117abc[_0x3e77('0x3f')],{'$or':_['map'](_0x117abc[_0x3e77('0x39')],function(_0x5e1400){var _0x5b6150={};_0x5b6150[_0x5e1400]={'$like':'%'+_0x3c174a[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x5b6150;})});}_0x117abc=_[_0x3e77('0x42')]({},_0x117abc,_0x3c174a[_0x3e77('0x45')]);return db[_0x3e77('0x5c')][_0x3e77('0x1f')]({'where':_0x117abc[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x10c9ef){_0xf4a464[_0x3e77('0x1f')]=_0x10c9ef;if(_0x3c174a[_0x3e77('0x35')][_0x3e77('0x46')]){_0x117abc[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x5c')][_0x3e77('0x5e')](_0x117abc);})[_0x3e77('0x26')](function(_0x24566a){_0xf4a464[_0x3e77('0x48')]=_0x24566a;return _0xf4a464;});}})['then'](respondWithFilteredResult(_0x248266,_0x117abc))[_0x3e77('0x49')](handleError(_0x248266,null));};exports[_0x3e77('0x5f')]=function(_0x74c95f,_0xa03927,_0x4206d0){var _0x5269f5={'raw':!![],'where':{}};var _0x26eb34={};var _0x15e0c5={'count':0x0,'rows':[]};return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x74c95f[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xa03927,null))[_0x3e77('0x26')](function(_0x41d433){if(_0x41d433){_0x26eb34[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmHopperHistory']['rawAttributes']);_0x26eb34[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x74c95f['query']);_0x26eb34[_0x3e77('0x37')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],_0x26eb34['query']);_0x5269f5[_0x3e77('0x39')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x5269f5[_0x3e77('0x39')]=_0x5269f5[_0x3e77('0x39')]['length']?_0x5269f5[_0x3e77('0x39')]:_0x26eb34['model'];if(!_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3b')]('nolimit')){_0x5269f5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x1e')]);_0x5269f5[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x74c95f[_0x3e77('0x35')]['offset']);}_0x5269f5[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x74c95f[_0x3e77('0x35')]['sort']);_0x5269f5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x74c95f[_0x3e77('0x35')],_0x26eb34[_0x3e77('0x37')]));_0x5269f5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x41d433['id'];if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x41')]){_0x5269f5[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x5269f5['where'],{'$or':_[_0x3e77('0x2f')](_0x5269f5['attributes'],function(_0x510cf6){var _0x1c1965={};_0x1c1965[_0x510cf6]={'$like':'%'+_0x74c95f['query'][_0x3e77('0x41')]+'%'};return _0x1c1965;})});}_0x5269f5=_['merge']({},_0x5269f5,_0x74c95f[_0x3e77('0x45')]);return db[_0x3e77('0x61')][_0x3e77('0x1f')]({'where':_0x5269f5[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x1b0f7c){_0x15e0c5[_0x3e77('0x1f')]=_0x1b0f7c;if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x46')]){_0x5269f5['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3e77('0x5e')](_0x5269f5);})['then'](function(_0x14a786){_0x15e0c5[_0x3e77('0x48')]=_0x14a786;return _0x15e0c5;});}})['then'](respondWithFilteredResult(_0xa03927,_0x5269f5))['catch'](handleError(_0xa03927,null));};exports[_0x3e77('0x62')]=function(_0x3fbea2,_0x578e79,_0x25aa11){var _0xfb07c5={'raw':!![],'where':{}};var _0x173c5d={};var _0x4ed6ed={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x3fbea2['params']['id']}})['then'](handleEntityNotFound(_0x578e79,null))[_0x3e77('0x26')](function(_0x284b55){if(_0x284b55){_0x173c5d[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x63')][_0x3e77('0x31')]);_0x173c5d[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3fbea2['query']);_0x173c5d[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],_0x173c5d[_0x3e77('0x35')]);_0xfb07c5[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3fbea2['query'][_0x3e77('0x3a')]));_0xfb07c5[_0x3e77('0x39')]=_0xfb07c5[_0x3e77('0x39')][_0x3e77('0x4c')]?_0xfb07c5[_0x3e77('0x39')]:_0x173c5d[_0x3e77('0x34')];if(!_0x3fbea2['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0xfb07c5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1e')]);_0xfb07c5[_0x3e77('0x1c')]=qs['offset'](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0xfb07c5['order']=qs['sort'](_0x3fbea2['query']['sort']);_0xfb07c5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3fbea2[_0x3e77('0x35')],_0x173c5d['filters']));_0xfb07c5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x284b55['id'];if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x41')]){_0xfb07c5['where']=_[_0x3e77('0x42')](_0xfb07c5[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0xfb07c5[_0x3e77('0x39')],function(_0x4443e7){var _0x2db50a={};_0x2db50a[_0x4443e7]={'$like':'%'+_0x3fbea2[_0x3e77('0x35')]['filter']+'%'};return _0x2db50a;})});}_0xfb07c5=_[_0x3e77('0x42')]({},_0xfb07c5,_0x3fbea2[_0x3e77('0x45')]);return db[_0x3e77('0x63')]['count']({'where':_0xfb07c5['where']})[_0x3e77('0x26')](function(_0x461587){_0x4ed6ed[_0x3e77('0x1f')]=_0x461587;if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x46')]){_0xfb07c5[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x63')]['findAll'](_0xfb07c5);})[_0x3e77('0x26')](function(_0x2d842f){_0x4ed6ed[_0x3e77('0x48')]=_0x2d842f;return _0x4ed6ed;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x578e79,_0xfb07c5))[_0x3e77('0x49')](handleError(_0x578e79,null));};exports[_0x3e77('0x64')]=function(_0x4f1814,_0x10e034,_0x149463){var _0x44b60f={'raw':!![],'where':{}};var _0x423886={};var _0x38d154={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x4f1814[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x10e034,null))[_0x3e77('0x26')](function(_0x50e433){if(_0x50e433){_0x423886[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x65')]['rawAttributes']);_0x423886[_0x3e77('0x35')]=_['keys'](_0x4f1814[_0x3e77('0x35')]);_0x423886[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],_0x423886[_0x3e77('0x35')]);_0x44b60f[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x4f1814['query'][_0x3e77('0x3a')]));_0x44b60f['attributes']=_0x44b60f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44b60f[_0x3e77('0x39')]:_0x423886[_0x3e77('0x34')];if(!_0x4f1814['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44b60f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x4f1814['query'][_0x3e77('0x1e')]);_0x44b60f[_0x3e77('0x1c')]=qs['offset'](_0x4f1814[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x44b60f['order']=qs[_0x3e77('0x3e')](_0x4f1814['query']['sort']);_0x44b60f['where']=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x4f1814[_0x3e77('0x35')],_0x423886[_0x3e77('0x37')]));_0x44b60f[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x50e433['id'];if(_0x4f1814['query'][_0x3e77('0x41')]){_0x44b60f['where']=_[_0x3e77('0x42')](_0x44b60f['where'],{'$or':_[_0x3e77('0x2f')](_0x44b60f[_0x3e77('0x39')],function(_0x1baf86){var _0x3564fd={};_0x3564fd[_0x1baf86]={'$like':'%'+_0x4f1814[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x3564fd;})});}_0x44b60f=_['merge']({},_0x44b60f,_0x4f1814['options']);return db[_0x3e77('0x65')][_0x3e77('0x1f')]({'where':_0x44b60f['where']})[_0x3e77('0x26')](function(_0x15ee01){_0x38d154[_0x3e77('0x1f')]=_0x15ee01;if(_0x4f1814[_0x3e77('0x35')]['includeAll']){_0x44b60f['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x3e77('0x5e')](_0x44b60f);})[_0x3e77('0x26')](function(_0x1c58fd){_0x38d154['rows']=_0x1c58fd;return _0x38d154;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x10e034,_0x44b60f))[_0x3e77('0x49')](handleError(_0x10e034,null));};exports[_0x3e77('0x66')]=function(_0x97a639,_0x2fdbc9,_0xa91b28){var _0x2def37={};var _0xd2cce2={};var _0x3ca480;var _0xad1adb;return db['Campaign'][_0x3e77('0x60')]({'where':{'id':_0x97a639[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x2fdbc9,null))[_0x3e77('0x26')](function(_0x159cc1){if(_0x159cc1){_0x3ca480=_0x159cc1;_0xd2cce2[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmList'][_0x3e77('0x31')]);_0xd2cce2[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x97a639[_0x3e77('0x35')]);_0xd2cce2[_0x3e77('0x37')]=_['intersection'](_0xd2cce2[_0x3e77('0x34')],_0xd2cce2[_0x3e77('0x35')]);_0x2def37[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xd2cce2['model'],qs[_0x3e77('0x3a')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x2def37[_0x3e77('0x39')]=_0x2def37['attributes'][_0x3e77('0x4c')]?_0x2def37[_0x3e77('0x39')]:_0xd2cce2[_0x3e77('0x34')];_0x2def37['order']=qs[_0x3e77('0x3e')](_0x97a639['query']['sort']);_0x2def37[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x97a639[_0x3e77('0x35')],_0xd2cce2[_0x3e77('0x37')]));if(_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]){_0x2def37[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x2def37[_0x3e77('0x3f')],{'$or':_['map'](_0x2def37[_0x3e77('0x39')],function(_0x554c5f){var _0x9a8dd3={};_0x9a8dd3[_0x554c5f]={'$like':'%'+_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x9a8dd3;})});}_0x2def37=_[_0x3e77('0x42')]({},_0x2def37,_0x97a639[_0x3e77('0x45')]);return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x58b9c0){if(_0x58b9c0){_0xad1adb=_0x58b9c0[_0x3e77('0x4c')];if(!_0x97a639[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x2def37[_0x3e77('0x1e')]=qs['limit'](_0x97a639['query'][_0x3e77('0x1e')]);_0x2def37[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x154844){if(_0x154844){return _0x154844?{'count':_0xad1adb,'rows':_0x154844}:null;}})[_0x3e77('0x26')](respondWithResult(_0x2fdbc9,null))[_0x3e77('0x49')](handleError(_0x2fdbc9,null));};exports[_0x3e77('0x67')]=function(_0x36d358,_0x10fd5b,_0x354ede){var _0x3a104e,_0x5a224c;var _0x25b353=[];var _0x40394f=moment()['format'](_0x3e77('0x68'));return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x36d358[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10fd5b,null))[_0x3e77('0x26')](function(_0x1aa56b){if(_0x1aa56b){_0x5a224c=_0x1aa56b;return _0x1aa56b[_0x3e77('0x67')](_0x36d358['body'][_0x3e77('0x69')],_['omit'](_0x36d358[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x2a621f){var _0x4cab54;var _0xd69c2d;_0x3a104e=_0x2a621f||[];var _0xbf12ac=[];if(_0x2a621f){for(var _0x80aa0e=0x0;_0x80aa0e<_0x2a621f['length'];_0x80aa0e+=0x1){var _0x3b18e9=_0x2a621f[_0x80aa0e][_0x3e77('0x27')]({'plain':!![]});_0x5a224c[_0x3e77('0x6b')]=_0x36d358['body'][_0x3e77('0x6b')]?_0x36d358[_0x3e77('0x4f')]['dialCheckDuplicateType']:_0x5a224c[_0x3e77('0x6b')];switch(_0x5a224c['dialCheckDuplicateType']){case'always':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field'](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()',_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27','createdAt')[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')]('cm_contacts')['where'](_0x3e77('0x79'))[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7c'))[_0x3e77('0x78')](_0x3e77('0x7d'))['where']('CampaignId\x20=\x20?',_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]()))[_0x3e77('0x3f')](_0x3e77('0x7e'),squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')](_0x3e77('0x6e'))[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())))[_0x3e77('0x77')]();break;case'onlyIfOpen':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))['fromQuery']([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),'ListId',_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()[_0x3e77('0x75')](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),_0x3e77('0x73'))[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')]('cm_hopper')[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id']['toString']())))[_0x3e77('0x77')]();break;default:_0x4cab54=squel[_0x3e77('0x6c')]()['into'](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field']('phone',_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()','scheduledAt')[_0x3e77('0x75')]('id','ContactId')[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')]['toString']())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();}_0xd69c2d=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')]('cm_hopper_additional_phones')[_0x3e77('0x6f')](['cmHopperId',_0x3e77('0x71'),_0x3e77('0x70'),'OrderBy',_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()['field']('h.id','id')[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))[_0x3e77('0x75')](_0x3e77('0x83'),_0x3e77('0x70'))[_0x3e77('0x75')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x84'),'ci')[_0x3e77('0x85')](_0x3e77('0x6e'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x3e77('0x86'),_0x3b18e9['CmListId'][_0x3e77('0x77')]())['where'](_0x3e77('0x87'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x88'),_0x40394f))[_0x3e77('0x77')]();_0xbf12ac[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x4cab54));_0x25b353[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0xd69c2d));}return BPromise[_0x3e77('0x8b')](_0xbf12ac);}})[_0x3e77('0x26')](function(){return BPromise['all'](_0x25b353);})[_0x3e77('0x26')](function(){return _0x3a104e;})['then'](respondWithResult(_0x10fd5b,null))[_0x3e77('0x49')](handleError(_0x10fd5b,null));};exports[_0x3e77('0x8c')]=function(_0x22c41a,_0xfbe6a0,_0x57dd35){return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xfbe6a0,null))['then'](function(_0xc34e57){if(_0xc34e57){return _0xc34e57[_0x3e77('0x8c')](_0x22c41a['query'][_0x3e77('0x69')]);}})[_0x3e77('0x26')](function(_0x5dd70c){if(_0x5dd70c){return db[_0x3e77('0x5c')][_0x3e77('0x2a')]({'where':{'ListId':_0x22c41a[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x5dd70c;});}})[_0x3e77('0x26')](respondWithStatusCode(_0xfbe6a0,null))[_0x3e77('0x49')](handleError(_0xfbe6a0,null));};exports[_0x3e77('0x8d')]=function(_0x33a8ac,_0x18a735,_0x4cdce9){var _0x44ab7f={};var _0x12e4ed={};var _0x4260bf;var _0x2f72a0;return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x33a8ac[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18a735,null))[_0x3e77('0x26')](function(_0xef7ec9){if(_0xef7ec9){_0x4260bf=_0xef7ec9;_0x12e4ed[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x8e')][_0x3e77('0x31')]);_0x12e4ed['query']=_['keys'](_0x33a8ac[_0x3e77('0x35')]);_0x12e4ed[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],_0x12e4ed[_0x3e77('0x35')]);_0x44ab7f['attributes']=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],qs['fields'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x44ab7f['attributes']=_0x44ab7f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44ab7f['attributes']:_0x12e4ed[_0x3e77('0x34')];_0x44ab7f[_0x3e77('0x3d')]=qs['sort'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x44ab7f[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x33a8ac[_0x3e77('0x35')],_0x12e4ed[_0x3e77('0x37')]));if(_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]){_0x44ab7f['where']=_[_0x3e77('0x42')](_0x44ab7f[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x44ab7f[_0x3e77('0x39')],function(_0x59b408){var _0x506a73={};_0x506a73[_0x59b408]={'$like':'%'+_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x506a73;})});}_0x44ab7f=_['merge']({},_0x44ab7f,_0x33a8ac[_0x3e77('0x45')]);return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})['then'](function(_0x4a56ea){if(_0x4a56ea){_0x2f72a0=_0x4a56ea[_0x3e77('0x4c')];if(!_0x33a8ac['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44ab7f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x33a8ac['query']['limit']);_0x44ab7f['offset']=qs[_0x3e77('0x1c')](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})[_0x3e77('0x26')](function(_0x3c88ec){if(_0x3c88ec){return _0x3c88ec?{'count':_0x2f72a0,'rows':_0x3c88ec}:null;}})['then'](respondWithResult(_0x18a735,null))[_0x3e77('0x49')](handleError(_0x18a735,null));};exports[_0x3e77('0x8f')]=function(_0x475079,_0x50c60e,_0x252d72){var _0x27b586,_0x4855cd;var _0x5ad1d7=[];var _0x4a6f7e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3e77('0x30')]['find']({'where':{'id':_0x475079[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x50c60e,null))[_0x3e77('0x26')](function(_0x524d1c){if(_0x524d1c){_0x4855cd=_0x524d1c;return _0x524d1c[_0x3e77('0x8f')](_0x475079[_0x3e77('0x4f')][_0x3e77('0x69')],_[_0x3e77('0x58')](_0x475079[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x5b1585){var _0x121e28;var _0x129c74;_0x27b586=_0x5b1585||[];var _0x7f34af=[];if(_0x5b1585){for(var _0x458b59=0x0;_0x458b59<_0x5b1585[_0x3e77('0x4c')];_0x458b59+=0x1){var _0x2f5f44=_0x5b1585[_0x458b59][_0x3e77('0x27')]({'plain':!![]});_0x121e28=squel['insert']()[_0x3e77('0x6d')](_0x3e77('0x90'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()[_0x3e77('0x75')]('phone',_0x3e77('0x70'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x2f5f44[_0x3e77('0x76')][_0x3e77('0x77')](),_0x3e77('0x73'))['field'](_0x475079['params']['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x59'))['field'](_0x3e77('0x81'),'updatedAt')['from'](_0x3e77('0x82'))[_0x3e77('0x3f')](_0x3e77('0x79'))['where'](_0x3e77('0x7a'),_0x2f5f44['CmListId'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();_0x7f34af['push'](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x121e28));}return BPromise['all'](_0x7f34af);}})[_0x3e77('0x26')](function(){return _0x27b586;})['then'](respondWithResult(_0x50c60e,null))['catch'](handleError(_0x50c60e,null));};exports[_0x3e77('0x91')]=function(_0x5f4d01,_0x5237f2,_0x56e17f){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x5237f2,null))[_0x3e77('0x26')](function(_0x3980db){if(_0x3980db){return _0x3980db[_0x3e77('0x91')](_0x5f4d01['query'][_0x3e77('0x69')]);}})['then'](function(_0x434ebb){if(_0x434ebb){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5f4d01[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x434ebb;});}})[_0x3e77('0x26')](respondWithStatusCode(_0x5237f2,null))[_0x3e77('0x49')](handleError(_0x5237f2,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index f503d92..7770169 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x7a54,0x106));var _0x47a5=function(_0x1148c4,_0x490d09){_0x1148c4=_0x1148c4-0x0;var _0x4abd1d=_0x7a54[_0x1148c4];return _0x4abd1d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 9b1e634..9036268 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 _0xb7fc=['include','map','model','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','findAll','options','attributes','limit'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x1cbecb,_0x505e33){_0x1cbecb=_0x1cbecb-0x0;var _0x4112c4=_0xb7fc[_0x1cbecb];return _0x4112c4;};'use strict';var _=require(_0xcb7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb7f('0x1'));var rs=require(_0xcb7f('0x2'));var fs=require('fs');var Redis=require(_0xcb7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb7f('0x4'))(_0xcb7f('0x5'));var config=require(_0xcb7f('0x6'));var jayson=require(_0xcb7f('0x7'));var client=jayson[_0xcb7f('0x8')][_0xcb7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5059ca,_0x226ba8,_0x31de8e){return new BPromise(function(_0x1f8ba3,_0x4dde1f){return client[_0xcb7f('0xa')](_0x5059ca,_0x31de8e)[_0xcb7f('0xb')](function(_0x4d8d72){logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,'request\x20sent');logger[_0xcb7f('0xe')](_0xcb7f('0xf'),_0x226ba8,_0xcb7f('0x10'),JSON[_0xcb7f('0x11')](_0x4d8d72));if(_0x4d8d72[_0xcb7f('0x12')]){if(_0x4d8d72['error']['code']===0x1f4){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x4dde1f(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x1f8ba3(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}else{logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,_0xcb7f('0x10'));_0x1f8ba3(_0x4d8d72[_0xcb7f('0x14')][_0xcb7f('0x13')]);}})[_0xcb7f('0x15')](function(_0x2c2799){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x2c2799);_0x4dde1f(_0x2c2799);});});}exports[_0xcb7f('0x16')]=function(_0x5d43b6){var _0x2430b3=this;return new Promise(function(_0x1d1d4c,_0x57274b){return db['Campaign'][_0xcb7f('0x17')]({'raw':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5d43b6['options']?_0x5d43b6[_0xcb7f('0x18')]['where']||null:null,'attributes':_0x5d43b6['options']?_0x5d43b6['options'][_0xcb7f('0x19')]||null:null,'limit':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6['options'][_0xcb7f('0x1a')]||null:null,'include':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')][_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x5d43b6[_0xcb7f('0x18')]['include'],function(_0x588a4b){return{'model':db[_0x588a4b[_0xcb7f('0x1d')]],'as':_0x588a4b['as'],'attributes':_0x588a4b[_0xcb7f('0x19')],'include':_0x588a4b[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x588a4b[_0xcb7f('0x1b')],function(_0x2a1a8c){return{'model':db[_0x2a1a8c['model']],'as':_0x2a1a8c['as'],'attributes':_0x2a1a8c[_0xcb7f('0x19')],'include':_0x2a1a8c[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x2a1a8c['include'],function(_0x30ecb7){return{'model':db[_0x30ecb7[_0xcb7f('0x1d')]],'as':_0x30ecb7['as'],'attributes':_0x30ecb7[_0xcb7f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8879a1){logger['info'](_0xcb7f('0x16'),_0x5d43b6);logger['debug'](_0xcb7f('0x16'),_0x5d43b6,JSON[_0xcb7f('0x11')](_0x8879a1));_0x1d1d4c(_0x8879a1);})['catch'](function(_0x597a82){logger['error'](_0xcb7f('0x16'),_0x597a82[_0xcb7f('0x13')],_0x5d43b6);_0x57274b(_0x2430b3['error'](0x1f4,_0x597a82[_0xcb7f('0x13')]));});});}; \ No newline at end of file +var _0x4ef1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash','util','bluebird'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0x4ef1,0xeb));var _0x14ef=function(_0x5a6dc5,_0x4a7a46){_0x5a6dc5=_0x5a6dc5-0x0;var _0x2b6dcd=_0x4ef1[_0x5a6dc5];return _0x2b6dcd;};'use strict';var _=require(_0x14ef('0x0'));var util=require(_0x14ef('0x1'));var moment=require('moment');var BPromise=require(_0x14ef('0x2'));var rs=require(_0x14ef('0x3'));var fs=require('fs');var Redis=require(_0x14ef('0x4'));var db=require(_0x14ef('0x5'))['db'];var utils=require(_0x14ef('0x6'));var logger=require(_0x14ef('0x7'))(_0x14ef('0x8'));var config=require(_0x14ef('0x9'));var jayson=require(_0x14ef('0xa'));var client=jayson[_0x14ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261fa2,_0x2dc335,_0x5b75ad){return new BPromise(function(_0x4175e7,_0x2ab217){return client[_0x14ef('0xc')](_0x261fa2,_0x5b75ad)[_0x14ef('0xd')](function(_0x17acc1){logger['info'](_0x14ef('0xe'),_0x2dc335,'request\x20sent');logger[_0x14ef('0xf')](_0x14ef('0x10'),_0x2dc335,_0x14ef('0x11'),JSON[_0x14ef('0x12')](_0x17acc1));if(_0x17acc1['error']){if(_0x17acc1['error'][_0x14ef('0x13')]===0x1f4){logger[_0x14ef('0x14')]('Campaign,\x20%s,\x20%s',_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x2ab217(_0x17acc1[_0x14ef('0x14')]['message']);}logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x4175e7(_0x17acc1['error'][_0x14ef('0x15')]);}else{logger[_0x14ef('0x16')](_0x14ef('0xe'),_0x2dc335,_0x14ef('0x11'));_0x4175e7(_0x17acc1['result'][_0x14ef('0x15')]);}})[_0x14ef('0x17')](function(_0x24556b){logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x24556b);_0x2ab217(_0x24556b);});});}exports[_0x14ef('0x18')]=function(_0x17f63a){var _0x1acc0a=this;return new Promise(function(_0x19b2cb,_0x3b5b23){return db[_0x14ef('0x19')][_0x14ef('0x1a')]({'raw':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1c')]||null:null,'attributes':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1d')]||null:null,'limit':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1e')]||null:null,'include':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')]['include']?_['map'](_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1f')],function(_0x37bb6f){return{'model':db[_0x37bb6f[_0x14ef('0x20')]],'as':_0x37bb6f['as'],'attributes':_0x37bb6f[_0x14ef('0x1d')],'include':_0x37bb6f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x37bb6f[_0x14ef('0x1f')],function(_0x45105f){return{'model':db[_0x45105f[_0x14ef('0x20')]],'as':_0x45105f['as'],'attributes':_0x45105f['attributes'],'include':_0x45105f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x45105f[_0x14ef('0x1f')],function(_0x21a176){return{'model':db[_0x21a176[_0x14ef('0x20')]],'as':_0x21a176['as'],'attributes':_0x21a176[_0x14ef('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa0178d){logger['info']('GetCampaign',_0x17f63a);logger[_0x14ef('0xf')](_0x14ef('0x18'),_0x17f63a,JSON[_0x14ef('0x12')](_0xa0178d));_0x19b2cb(_0xa0178d);})[_0x14ef('0x17')](function(_0x38f5e9){logger[_0x14ef('0x14')](_0x14ef('0x18'),_0x38f5e9[_0x14ef('0x15')],_0x17f63a);_0x3b5b23(_0x1acc0a['error'](0x1f4,_0x38f5e9[_0x14ef('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index cad6504..7dd31ea 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 _0x2c81=['removeLists','removeBlackLists','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','delete','destroy'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x2c81,0x1d1));var _0x12c8=function(_0x39390d,_0x32eb2a){_0x39390d=_0x39390d-0x0;var _0x55a311=_0x2c81[_0x39390d];return _0x55a311;};'use strict';var multer=require(_0x12c8('0x0'));var util=require(_0x12c8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x12c8('0x2'));var router=express['Router']();var fs_extra=require(_0x12c8('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x12c8('0x4'));var config=require(_0x12c8('0x5'));var controller=require(_0x12c8('0x6'));router['get']('/',auth[_0x12c8('0x7')](),controller[_0x12c8('0x8')]);router[_0x12c8('0x9')](_0x12c8('0xa'),auth[_0x12c8('0x7')](),controller[_0x12c8('0xb')]);router[_0x12c8('0x9')](_0x12c8('0xc'),auth[_0x12c8('0x7')](),controller[_0x12c8('0xd')]);router[_0x12c8('0x9')](_0x12c8('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x12c8('0x9')](_0x12c8('0xf'),auth[_0x12c8('0x7')](),controller['getHopperFinals']);router[_0x12c8('0x9')](_0x12c8('0x10'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x11')]);router['get'](_0x12c8('0x12'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x13')]);router[_0x12c8('0x9')](_0x12c8('0x14'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x15')]);router[_0x12c8('0x16')]('/',auth[_0x12c8('0x7')](),controller[_0x12c8('0x17')]);router[_0x12c8('0x16')](_0x12c8('0x18'),auth['isAuthenticated'](),controller['clone']);router[_0x12c8('0x16')]('/:id/lists',auth['isAuthenticated'](),controller[_0x12c8('0x19')]);router[_0x12c8('0x16')](_0x12c8('0x14'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1a')]);router[_0x12c8('0x1b')]('/:id',auth[_0x12c8('0x7')](),controller['update']);router[_0x12c8('0x1c')](_0x12c8('0xa'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1d')]);router[_0x12c8('0x1c')](_0x12c8('0x12'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1e')]);router[_0x12c8('0x1c')](_0x12c8('0x14'),auth[_0x12c8('0x7')](),controller[_0x12c8('0x1f')]);module[_0x12c8('0x20')]=router; \ No newline at end of file +var _0xfeff=['path','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x2c47d7,_0x42b567){var _0x41ca0b=function(_0x45e9ba){while(--_0x45e9ba){_0x2c47d7['push'](_0x2c47d7['shift']());}};_0x41ca0b(++_0x42b567);}(_0xfeff,0xe5));var _0xffef=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xfeff[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var path=require(_0xffef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xffef('0x3'));var interaction=require(_0xffef('0x4'));var config=require(_0xffef('0x5'));var controller=require(_0xffef('0x6'));router[_0xffef('0x7')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x9')]);router['get'](_0xffef('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xffef('0x7')](_0xffef('0xb'),auth['isAuthenticated'](),controller[_0xffef('0xc')]);router[_0xffef('0x7')](_0xffef('0xd'),auth['isAuthenticated'](),controller[_0xffef('0xe')]);router[_0xffef('0x7')](_0xffef('0xf'),auth[_0xffef('0x8')](),controller['getHopperFinals']);router['get'](_0xffef('0x10'),auth[_0xffef('0x8')](),controller[_0xffef('0x11')]);router['get'](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x13')]);router['get'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x15')]);router[_0xffef('0x16')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x17')]);router[_0xffef('0x16')](_0xffef('0x18'),auth[_0xffef('0x8')](),controller['clone']);router[_0xffef('0x16')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x19')]);router['post'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1a')]);router['put']('/:id',auth[_0xffef('0x8')](),controller[_0xffef('0x1b')]);router[_0xffef('0x1c')](_0xffef('0xa'),auth[_0xffef('0x8')](),controller[_0xffef('0x1d')]);router[_0xffef('0x1c')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x1e')]);router[_0xffef('0x1c')](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1f')]);module[_0xffef('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ba2f04f..0f12e20 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 _0x0a40=['exports','STRING','medium','VIRTUAL','key','sequelize'];(function(_0x3d6b07,_0x3054af){var _0x3657a1=function(_0x267a77){while(--_0x267a77){_0x3d6b07['push'](_0x3d6b07['shift']());}};_0x3657a1(++_0x3054af);}(_0x0a40,0x1e5));var _0x00a4=function(_0x224a21,_0x2a65e2){_0x224a21=_0x224a21-0x0;var _0xea2db1=_0x0a40[_0x224a21];return _0xea2db1;};'use strict';var Sequelize=require(_0x00a4('0x0'));module[_0x00a4('0x1')]={'key':{'type':Sequelize[_0x00a4('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x00a4('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x00a4('0x4')],'get':function(){return this['getDataValue'](_0x00a4('0x5'));}}}; \ No newline at end of file +var _0x9470=['exports','STRING','TEXT','getDataValue','key'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x9470,0x118));var _0x0947=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x9470[_0x3cb6dc];return _0x47ec89;};'use strict';var Sequelize=require('sequelize');module[_0x0947('0x0')]={'key':{'type':Sequelize[_0x0947('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x0947('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x0947('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0947('0x3')](_0x0947('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index c07726a..04020a0 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 _0x8d42=['order','sort','filter','merge','where','includeAll','include','findAll','rows','catch','show','params','options','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','apply','reject','save','destroy','then','get','CannedAnswers','sendStatus','stack','name','send','CannedAnswer','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit'];(function(_0x40f378,_0x4d39ec){var _0x2e42f6=function(_0x3c0996){while(--_0x3c0996){_0x40f378['push'](_0x40f378['shift']());}};_0x2e42f6(++_0x4d39ec);}(_0x8d42,0x184));var _0x28d4=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x8d42[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x28d4('0x0'));var rimraf=require(_0x28d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28d4('0x2'));var rp=require('request-promise');var moment=require(_0x28d4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x28d4('0x4'));var util=require(_0x28d4('0x5'));var path=require('path');var sox=require(_0x28d4('0x6'));var csv=require(_0x28d4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x28d4('0x8'));var _=require(_0x28d4('0x9'));var squel=require(_0x28d4('0xa'));var crypto=require(_0x28d4('0xb'));var jsforce=require(_0x28d4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28d4('0xd'));var Papa=require(_0x28d4('0xe'));var Redis=require(_0x28d4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x28d4('0x10'));var as=require(_0x28d4('0x11'));var hardwareService=require(_0x28d4('0x12'));var logger=require('../../config/logger')(_0x28d4('0x13'));var utils=require(_0x28d4('0x14'));var config=require(_0x28d4('0x15'));var licenseUtil=require(_0x28d4('0x16'));var db=require(_0x28d4('0x17'))['db'];function respondWithStatusCode(_0x58e7fe,_0x54ae29){_0x54ae29=_0x54ae29||0xcc;return function(_0x1a708c){if(_0x1a708c){return _0x58e7fe['sendStatus'](_0x54ae29);}return _0x58e7fe[_0x28d4('0x18')](_0x54ae29)[_0x28d4('0x19')]();};}function respondWithResult(_0x41ec1c,_0x6395aa){_0x6395aa=_0x6395aa||0xc8;return function(_0x17f9fd){if(_0x17f9fd){return _0x41ec1c[_0x28d4('0x18')](_0x6395aa)[_0x28d4('0x1a')](_0x17f9fd);}};}function respondWithFilteredResult(_0x45b8e5,_0x3a738b){return function(_0x4f386c){if(_0x4f386c){var _0x438eb6=typeof _0x3a738b['offset']==='undefined'&&typeof _0x3a738b[_0x28d4('0x1b')]===_0x28d4('0x1c');var _0x68a363=_0x4f386c[_0x28d4('0x1d')];var _0xe86166=_0x438eb6?0x0:_0x3a738b['offset'];var _0x16acac=_0x438eb6?_0x4f386c['count']:_0x3a738b[_0x28d4('0x1e')]+_0x3a738b['limit'];var _0x5b8c5e;if(_0x16acac>=_0x68a363){_0x16acac=_0x68a363;_0x5b8c5e=0xc8;}else{_0x5b8c5e=0xce;}_0x45b8e5[_0x28d4('0x18')](_0x5b8c5e);return _0x45b8e5['set']('Content-Range',_0xe86166+'-'+_0x16acac+'/'+_0x68a363)['json'](_0x4f386c);}return null;};}function patchUpdates(_0xb19687){return function(_0x51f11a){try{jsonpatch[_0x28d4('0x1f')](_0x51f11a,_0xb19687,!![]);}catch(_0x2368dc){return BPromise[_0x28d4('0x20')](_0x2368dc);}return _0x51f11a[_0x28d4('0x21')]();};}function saveUpdates(_0x46dd90,_0x125110){return function(_0x514748){if(_0x514748){return _0x514748['update'](_0x46dd90)['then'](function(_0x4c334f){return _0x4c334f;});}return null;};}function removeEntity(_0x2f2cf3,_0x41bce9){return function(_0x3d2c59){if(_0x3d2c59){return _0x3d2c59[_0x28d4('0x22')]()[_0x28d4('0x23')](function(){var _0x5a15a1=_0x3d2c59[_0x28d4('0x24')]({'plain':!![]});var _0x209c62=_0x28d4('0x25');return db['UserProfileResource'][_0x28d4('0x22')]({'where':{'type':_0x209c62,'resourceId':_0x5a15a1['id']}})[_0x28d4('0x23')](function(){return _0x3d2c59;});})[_0x28d4('0x23')](function(){_0x2f2cf3[_0x28d4('0x18')](0xcc)[_0x28d4('0x19')]();});}};}function handleEntityNotFound(_0x17986d,_0x56bb0c){return function(_0x539b9a){if(!_0x539b9a){_0x17986d[_0x28d4('0x26')](0x194);}return _0x539b9a;};}function handleError(_0x3a4786,_0x17ec21){_0x17ec21=_0x17ec21||0x1f4;return function(_0xf212a3){logger['error'](_0xf212a3[_0x28d4('0x27')]);if(_0xf212a3['name']){delete _0xf212a3[_0x28d4('0x28')];}_0x3a4786[_0x28d4('0x18')](_0x17ec21)[_0x28d4('0x29')](_0xf212a3);};}exports['index']=function(_0x91646f,_0xe14d9e){var _0x435814={},_0x53d12d={},_0xcb68a3={'count':0x0,'rows':[]};var _0xc51348=_['map'](db[_0x28d4('0x2a')][_0x28d4('0x2b')],function(_0x151702){return{'name':_0x151702[_0x28d4('0x2c')],'type':_0x151702[_0x28d4('0x2d')][_0x28d4('0x2e')]};});_0x53d12d['model']=_[_0x28d4('0x2f')](_0xc51348,_0x28d4('0x28'));_0x53d12d['query']=_[_0x28d4('0x30')](_0x91646f[_0x28d4('0x31')]);_0x53d12d[_0x28d4('0x32')]=_[_0x28d4('0x33')](_0x53d12d['model'],_0x53d12d[_0x28d4('0x31')]);_0x435814[_0x28d4('0x34')]=_[_0x28d4('0x33')](_0x53d12d[_0x28d4('0x35')],qs[_0x28d4('0x36')](_0x91646f['query'][_0x28d4('0x36')]));_0x435814[_0x28d4('0x34')]=_0x435814[_0x28d4('0x34')]['length']?_0x435814[_0x28d4('0x34')]:_0x53d12d[_0x28d4('0x35')];if(!_0x91646f['query'][_0x28d4('0x37')](_0x28d4('0x38'))){_0x435814[_0x28d4('0x1b')]=qs[_0x28d4('0x1b')](_0x91646f[_0x28d4('0x31')][_0x28d4('0x1b')]);_0x435814[_0x28d4('0x1e')]=qs[_0x28d4('0x1e')](_0x91646f[_0x28d4('0x31')][_0x28d4('0x1e')]);}_0x435814[_0x28d4('0x39')]=qs[_0x28d4('0x3a')](_0x91646f[_0x28d4('0x31')][_0x28d4('0x3a')]);_0x435814['where']=qs[_0x28d4('0x32')](_['pick'](_0x91646f[_0x28d4('0x31')],_0x53d12d['filters']),_0xc51348);if(_0x91646f[_0x28d4('0x31')][_0x28d4('0x3b')]){_0x435814['where']=_[_0x28d4('0x3c')](_0x435814[_0x28d4('0x3d')],{'$or':[{'key':{'$like':'%'+_0x91646f[_0x28d4('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x91646f[_0x28d4('0x31')]['filter']+'%'}}]});}_0x435814=_[_0x28d4('0x3c')]({},_0x435814,_0x91646f['options']);var _0x48f023={'where':_0x435814[_0x28d4('0x3d')]};return db[_0x28d4('0x2a')]['count'](_0x48f023)[_0x28d4('0x23')](function(_0x4785d4){_0xcb68a3['count']=_0x4785d4;if(_0x91646f[_0x28d4('0x31')][_0x28d4('0x3e')]){_0x435814[_0x28d4('0x3f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x28d4('0x40')](_0x435814);})[_0x28d4('0x23')](function(_0x5bec9e){_0xcb68a3[_0x28d4('0x41')]=_0x5bec9e;return _0xcb68a3;})[_0x28d4('0x23')](respondWithFilteredResult(_0xe14d9e,_0x435814))[_0x28d4('0x42')](handleError(_0xe14d9e,null));};exports[_0x28d4('0x43')]=function(_0xe7b043,_0x48c34a){var _0x32ad5a={'raw':!![],'where':{'id':_0xe7b043[_0x28d4('0x44')]['id']}},_0xba3f19={};_0xba3f19['model']=_['keys'](db[_0x28d4('0x2a')][_0x28d4('0x2b')]);_0xba3f19['query']=_['keys'](_0xe7b043[_0x28d4('0x31')]);_0xba3f19[_0x28d4('0x32')]=_[_0x28d4('0x33')](_0xba3f19[_0x28d4('0x35')],_0xba3f19[_0x28d4('0x31')]);_0x32ad5a[_0x28d4('0x34')]=_[_0x28d4('0x33')](_0xba3f19['model'],qs[_0x28d4('0x36')](_0xe7b043['query'][_0x28d4('0x36')]));_0x32ad5a[_0x28d4('0x34')]=_0x32ad5a['attributes']['length']?_0x32ad5a[_0x28d4('0x34')]:_0xba3f19[_0x28d4('0x35')];if(_0xe7b043[_0x28d4('0x31')]['includeAll']){_0x32ad5a[_0x28d4('0x3f')]=[{'all':!![]}];}_0x32ad5a=_[_0x28d4('0x3c')]({},_0x32ad5a,_0xe7b043[_0x28d4('0x45')]);return db[_0x28d4('0x2a')][_0x28d4('0x46')](_0x32ad5a)[_0x28d4('0x23')](handleEntityNotFound(_0x48c34a,null))[_0x28d4('0x23')](respondWithResult(_0x48c34a,null))['catch'](handleError(_0x48c34a,null));};exports[_0x28d4('0x47')]=function(_0x55789d,_0x5ec8da){if(_0x55789d[_0x28d4('0x48')]['id']){delete _0x55789d[_0x28d4('0x48')]['id'];}return db[_0x28d4('0x2a')]['find']({'where':{'id':_0x55789d[_0x28d4('0x44')]['id']}})[_0x28d4('0x23')](handleEntityNotFound(_0x5ec8da,null))[_0x28d4('0x23')](saveUpdates(_0x55789d['body'],null))[_0x28d4('0x23')](respondWithResult(_0x5ec8da,null))['catch'](handleError(_0x5ec8da,null));};exports[_0x28d4('0x22')]=function(_0x243d1b,_0x4653c6){return db[_0x28d4('0x2a')]['find']({'where':{'id':_0x243d1b[_0x28d4('0x44')]['id']}})[_0x28d4('0x23')](handleEntityNotFound(_0x4653c6,null))['then'](removeEntity(_0x4653c6,null))[_0x28d4('0x42')](handleError(_0x4653c6,null));};exports[_0x28d4('0x49')]=function(_0x124a91,_0x5b293f){var _0x4df358={'key':_0x124a91['body']['key']};if(_0x124a91[_0x28d4('0x48')]['MailAccountId']){_0x4df358[_0x28d4('0x4a')]=_0x124a91[_0x28d4('0x48')][_0x28d4('0x4a')];}else if(_0x124a91['body'][_0x28d4('0x4b')]){_0x4df358[_0x28d4('0x4b')]=_0x124a91[_0x28d4('0x48')][_0x28d4('0x4b')];}else if(_0x124a91[_0x28d4('0x48')]['OpenchannelAccountId']){_0x4df358[_0x28d4('0x4c')]=_0x124a91[_0x28d4('0x48')][_0x28d4('0x4c')];}else if(_0x124a91[_0x28d4('0x48')][_0x28d4('0x4d')]){_0x4df358[_0x28d4('0x4d')]=_0x124a91[_0x28d4('0x48')]['ChatWebsiteId'];}return db[_0x28d4('0x2a')][_0x28d4('0x46')]({'where':_0x4df358})['then'](function(_0x47ba35){if(_0x47ba35){throw new db[(_0x28d4('0x4e'))][(_0x28d4('0x4f'))](_0x28d4('0x50'));}return db[_0x28d4('0x2a')][_0x28d4('0x49')](_0x124a91[_0x28d4('0x48')]);})[_0x28d4('0x23')](function(_0x4ccdb3){var _0x518837=_0x124a91[_0x28d4('0x51')][_0x28d4('0x24')]({'plain':!![]});if(!_0x518837)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x518837[_0x28d4('0x52')]===_0x28d4('0x51')){var _0x177239=_0x4ccdb3[_0x28d4('0x24')]({'plain':!![]});return db[_0x28d4('0x53')][_0x28d4('0x46')]({'where':{'name':_0x28d4('0x25'),'userProfileId':_0x518837[_0x28d4('0x54')]},'raw':!![]})[_0x28d4('0x23')](function(_0x25e439){if(_0x25e439&&_0x25e439[_0x28d4('0x55')]===0x0){return db[_0x28d4('0x56')]['create']({'name':_0x177239[_0x28d4('0x28')],'resourceId':_0x177239['id'],'type':_0x25e439['name'],'sectionId':_0x25e439['id']},{})[_0x28d4('0x23')](function(){return _0x4ccdb3;});}else{return _0x4ccdb3;}})[_0x28d4('0x42')](function(_0x139dff){logger[_0x28d4('0x57')](_0x28d4('0x58'),_0x139dff);throw _0x139dff;});}return _0x4ccdb3;})[_0x28d4('0x23')](respondWithResult(_0x5b293f,0xc9))[_0x28d4('0x42')](handleError(_0x5b293f,null));}; \ No newline at end of file +var _0xca06=['key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','end','name','send','index','fieldName','type'];(function(_0x22a2b2,_0xa9f5b3){var _0x1ee264=function(_0x1ccc7f){while(--_0x1ccc7f){_0x22a2b2['push'](_0x22a2b2['shift']());}};_0x1ee264(++_0xa9f5b3);}(_0xca06,0x1d7));var _0x6ca0=function(_0xa0b91b,_0x2e2a5d){_0xa0b91b=_0xa0b91b-0x0;var _0x23196b=_0xca06[_0xa0b91b];return _0x23196b;};'use strict';var emlformat=require(_0x6ca0('0x0'));var rimraf=require(_0x6ca0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ca0('0x2'));var moment=require('moment');var BPromise=require(_0x6ca0('0x3'));var Mustache=require(_0x6ca0('0x4'));var util=require(_0x6ca0('0x5'));var path=require('path');var sox=require(_0x6ca0('0x6'));var csv=require('to-csv');var ejs=require(_0x6ca0('0x7'));var fs=require('fs');var fs_extra=require(_0x6ca0('0x8'));var _=require(_0x6ca0('0x9'));var squel=require(_0x6ca0('0xa'));var crypto=require(_0x6ca0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6ca0('0xc'));var toCsv=require(_0x6ca0('0xd'));var querystring=require(_0x6ca0('0xe'));var Papa=require(_0x6ca0('0xf'));var Redis=require(_0x6ca0('0x10'));var authService=require(_0x6ca0('0x11'));var qs=require(_0x6ca0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ca0('0x13'));var logger=require(_0x6ca0('0x14'))('api');var utils=require(_0x6ca0('0x15'));var config=require(_0x6ca0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca0('0x17'))['db'];function respondWithStatusCode(_0xc52007,_0x19b662){_0x19b662=_0x19b662||0xcc;return function(_0x1d4ff4){if(_0x1d4ff4){return _0xc52007[_0x6ca0('0x18')](_0x19b662);}return _0xc52007[_0x6ca0('0x19')](_0x19b662)['end']();};}function respondWithResult(_0x3a008f,_0x1a27eb){_0x1a27eb=_0x1a27eb||0xc8;return function(_0x59e607){if(_0x59e607){return _0x3a008f[_0x6ca0('0x19')](_0x1a27eb)[_0x6ca0('0x1a')](_0x59e607);}};}function respondWithFilteredResult(_0x57aa6a,_0xfb12cd){return function(_0x3b7926){if(_0x3b7926){var _0x450696=typeof _0xfb12cd['offset']===_0x6ca0('0x1b')&&typeof _0xfb12cd[_0x6ca0('0x1c')]==='undefined';var _0xd26cec=_0x3b7926['count'];var _0x1a1ded=_0x450696?0x0:_0xfb12cd[_0x6ca0('0x1d')];var _0x47a189=_0x450696?_0x3b7926[_0x6ca0('0x1e')]:_0xfb12cd[_0x6ca0('0x1d')]+_0xfb12cd['limit'];var _0x1c0d22;if(_0x47a189>=_0xd26cec){_0x47a189=_0xd26cec;_0x1c0d22=0xc8;}else{_0x1c0d22=0xce;}_0x57aa6a[_0x6ca0('0x19')](_0x1c0d22);return _0x57aa6a[_0x6ca0('0x1f')](_0x6ca0('0x20'),_0x1a1ded+'-'+_0x47a189+'/'+_0xd26cec)[_0x6ca0('0x1a')](_0x3b7926);}return null;};}function patchUpdates(_0x5e9d62){return function(_0x116a2c){try{jsonpatch['apply'](_0x116a2c,_0x5e9d62,!![]);}catch(_0x554c25){return BPromise[_0x6ca0('0x21')](_0x554c25);}return _0x116a2c['save']();};}function saveUpdates(_0x33126d,_0x5ebff6){return function(_0x5ba278){if(_0x5ba278){return _0x5ba278[_0x6ca0('0x22')](_0x33126d)[_0x6ca0('0x23')](function(_0x3601e3){return _0x3601e3;});}return null;};}function removeEntity(_0x128bc8,_0x357394){return function(_0x5098fd){if(_0x5098fd){return _0x5098fd[_0x6ca0('0x24')]()[_0x6ca0('0x23')](function(){var _0x26f0be=_0x5098fd[_0x6ca0('0x25')]({'plain':!![]});var _0x32e64b='CannedAnswers';return db[_0x6ca0('0x26')][_0x6ca0('0x24')]({'where':{'type':_0x32e64b,'resourceId':_0x26f0be['id']}})[_0x6ca0('0x23')](function(){return _0x5098fd;});})[_0x6ca0('0x23')](function(){_0x128bc8[_0x6ca0('0x19')](0xcc)[_0x6ca0('0x27')]();});}};}function handleEntityNotFound(_0xa198d8,_0x1d2258){return function(_0x2da691){if(!_0x2da691){_0xa198d8[_0x6ca0('0x18')](0x194);}return _0x2da691;};}function handleError(_0x1b54cd,_0x4e745f){_0x4e745f=_0x4e745f||0x1f4;return function(_0x2eae5e){logger['error'](_0x2eae5e['stack']);if(_0x2eae5e[_0x6ca0('0x28')]){delete _0x2eae5e['name'];}_0x1b54cd[_0x6ca0('0x19')](_0x4e745f)[_0x6ca0('0x29')](_0x2eae5e);};}exports[_0x6ca0('0x2a')]=function(_0x163369,_0x10c112){var _0x1bf32d={},_0x3dd149={},_0xd1db2={'count':0x0,'rows':[]};var _0x358047=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x14ae83){return{'name':_0x14ae83[_0x6ca0('0x2b')],'type':_0x14ae83[_0x6ca0('0x2c')][_0x6ca0('0x2d')]};});_0x3dd149[_0x6ca0('0x2e')]=_['map'](_0x358047,'name');_0x3dd149['query']=_[_0x6ca0('0x2f')](_0x163369['query']);_0x3dd149['filters']=_[_0x6ca0('0x30')](_0x3dd149[_0x6ca0('0x2e')],_0x3dd149[_0x6ca0('0x31')]);_0x1bf32d[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x3dd149['model'],qs['fields'](_0x163369['query'][_0x6ca0('0x33')]));_0x1bf32d[_0x6ca0('0x32')]=_0x1bf32d[_0x6ca0('0x32')][_0x6ca0('0x34')]?_0x1bf32d[_0x6ca0('0x32')]:_0x3dd149[_0x6ca0('0x2e')];if(!_0x163369['query'][_0x6ca0('0x35')](_0x6ca0('0x36'))){_0x1bf32d['limit']=qs[_0x6ca0('0x1c')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x1c')]);_0x1bf32d[_0x6ca0('0x1d')]=qs[_0x6ca0('0x1d')](_0x163369['query'][_0x6ca0('0x1d')]);}_0x1bf32d[_0x6ca0('0x37')]=qs[_0x6ca0('0x38')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x38')]);_0x1bf32d[_0x6ca0('0x39')]=qs[_0x6ca0('0x3a')](_[_0x6ca0('0x3b')](_0x163369[_0x6ca0('0x31')],_0x3dd149[_0x6ca0('0x3a')]),_0x358047);if(_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]){_0x1bf32d['where']=_[_0x6ca0('0x3d')](_0x1bf32d[_0x6ca0('0x39')],{'$or':[{'key':{'$like':'%'+_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]+'%'}},{'value':{'$like':'%'+_0x163369['query'][_0x6ca0('0x3c')]+'%'}}]});}_0x1bf32d=_[_0x6ca0('0x3d')]({},_0x1bf32d,_0x163369[_0x6ca0('0x3e')]);var _0x4dbeeb={'where':_0x1bf32d[_0x6ca0('0x39')]};return db[_0x6ca0('0x3f')]['count'](_0x4dbeeb)[_0x6ca0('0x23')](function(_0x405e79){_0xd1db2['count']=_0x405e79;if(_0x163369['query'][_0x6ca0('0x40')]){_0x1bf32d['include']=[{'all':!![]}];}return db[_0x6ca0('0x3f')][_0x6ca0('0x41')](_0x1bf32d);})['then'](function(_0xcc9c93){_0xd1db2[_0x6ca0('0x42')]=_0xcc9c93;return _0xd1db2;})[_0x6ca0('0x23')](respondWithFilteredResult(_0x10c112,_0x1bf32d))[_0x6ca0('0x43')](handleError(_0x10c112,null));};exports[_0x6ca0('0x44')]=function(_0x497f06,_0x5a59e4){var _0x48be61={'raw':!![],'where':{'id':_0x497f06[_0x6ca0('0x45')]['id']}},_0x1c02be={};_0x1c02be[_0x6ca0('0x2e')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1c02be['query']=_[_0x6ca0('0x2f')](_0x497f06[_0x6ca0('0x31')]);_0x1c02be['filters']=_['intersection'](_0x1c02be[_0x6ca0('0x2e')],_0x1c02be[_0x6ca0('0x31')]);_0x48be61[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x1c02be[_0x6ca0('0x2e')],qs[_0x6ca0('0x33')](_0x497f06[_0x6ca0('0x31')]['fields']));_0x48be61[_0x6ca0('0x32')]=_0x48be61[_0x6ca0('0x32')]['length']?_0x48be61['attributes']:_0x1c02be[_0x6ca0('0x2e')];if(_0x497f06['query']['includeAll']){_0x48be61[_0x6ca0('0x46')]=[{'all':!![]}];}_0x48be61=_[_0x6ca0('0x3d')]({},_0x48be61,_0x497f06['options']);return db[_0x6ca0('0x3f')][_0x6ca0('0x47')](_0x48be61)[_0x6ca0('0x23')](handleEntityNotFound(_0x5a59e4,null))[_0x6ca0('0x23')](respondWithResult(_0x5a59e4,null))[_0x6ca0('0x43')](handleError(_0x5a59e4,null));};exports[_0x6ca0('0x22')]=function(_0x9387d9,_0x50c096){if(_0x9387d9[_0x6ca0('0x48')]['id']){delete _0x9387d9[_0x6ca0('0x48')]['id'];}return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0x9387d9[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x50c096,null))['then'](saveUpdates(_0x9387d9[_0x6ca0('0x48')],null))[_0x6ca0('0x23')](respondWithResult(_0x50c096,null))[_0x6ca0('0x43')](handleError(_0x50c096,null));};exports[_0x6ca0('0x24')]=function(_0xe30141,_0x19264e){return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0xe30141[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x19264e,null))[_0x6ca0('0x23')](removeEntity(_0x19264e,null))['catch'](handleError(_0x19264e,null));};exports[_0x6ca0('0x49')]=function(_0x556224,_0x32e632){var _0x1577bf={'key':_0x556224['body']['key']};if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')]){_0x1577bf[_0x6ca0('0x4a')]=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4b')]){_0x1577bf[_0x6ca0('0x4b')]=_0x556224[_0x6ca0('0x48')]['SmsAccountId'];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4c')]){_0x1577bf[_0x6ca0('0x4c')]=_0x556224['body'][_0x6ca0('0x4c')];}else if(_0x556224['body'][_0x6ca0('0x4d')]){_0x1577bf['ChatWebsiteId']=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4d')];}return db['CannedAnswer'][_0x6ca0('0x47')]({'where':_0x1577bf})['then'](function(_0x2f7d2a){if(_0x2f7d2a){throw new db['Sequelize'][(_0x6ca0('0x4e'))](_0x6ca0('0x4f'));}return db[_0x6ca0('0x3f')][_0x6ca0('0x49')](_0x556224[_0x6ca0('0x48')]);})[_0x6ca0('0x23')](function(_0x254a26){var _0x5eaeac=_0x556224['user'][_0x6ca0('0x25')]({'plain':!![]});if(!_0x5eaeac)throw new Error(_0x6ca0('0x50'));if(_0x5eaeac[_0x6ca0('0x51')]===_0x6ca0('0x52')){var _0x247bbf=_0x254a26[_0x6ca0('0x25')]({'plain':!![]});return db[_0x6ca0('0x53')][_0x6ca0('0x47')]({'where':{'name':_0x6ca0('0x54'),'userProfileId':_0x5eaeac['userProfileId']},'raw':!![]})[_0x6ca0('0x23')](function(_0x43d2aa){if(_0x43d2aa&&_0x43d2aa['autoAssociation']===0x0){return db[_0x6ca0('0x26')][_0x6ca0('0x49')]({'name':_0x247bbf[_0x6ca0('0x28')],'resourceId':_0x247bbf['id'],'type':_0x43d2aa[_0x6ca0('0x28')],'sectionId':_0x43d2aa['id']},{})[_0x6ca0('0x23')](function(){return _0x254a26;});}else{return _0x254a26;}})['catch'](function(_0x4bfd60){logger['error'](_0x6ca0('0x55'),_0x4bfd60);throw _0x4bfd60;});}return _0x254a26;})[_0x6ca0('0x23')](respondWithResult(_0x32e632,0xc9))[_0x6ca0('0x43')](handleError(_0x32e632,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index c3de25a..65da8d3 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 _0x7653=['api','moment','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x7653,0x102));var _0x3765=function(_0x539ce1,_0x4a65eb){_0x539ce1=_0x539ce1-0x0;var _0x20be8e=_0x7653[_0x539ce1];return _0x20be8e;};'use strict';var _=require(_0x3765('0x0'));var util=require(_0x3765('0x1'));var logger=require('../../config/logger')(_0x3765('0x2'));var moment=require(_0x3765('0x3'));var BPromise=require('bluebird');var rp=require(_0x3765('0x4'));var fs=require('fs');var path=require(_0x3765('0x5'));var rimraf=require(_0x3765('0x6'));var config=require('../../config/environment');var attributes=require(_0x3765('0x7'));module[_0x3765('0x8')]=function(_0x627087,_0x35ff41){return _0x627087[_0x3765('0x9')](_0x3765('0xa'),attributes,{'tableName':_0x3765('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3765('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x81df=['api','moment','bluebird','request-promise','path','rimraf','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3554de,_0x1c1680){var _0x469d4b=function(_0x402f44){while(--_0x402f44){_0x3554de['push'](_0x3554de['shift']());}};_0x469d4b(++_0x1c1680);}(_0x81df,0xb3));var _0xf81d=function(_0x112e86,_0x2cc9b0){_0x112e86=_0x112e86-0x0;var _0xf6b5d9=_0x81df[_0x112e86];return _0xf6b5d9;};'use strict';var _=require(_0xf81d('0x0'));var util=require(_0xf81d('0x1'));var logger=require(_0xf81d('0x2'))(_0xf81d('0x3'));var moment=require(_0xf81d('0x4'));var BPromise=require(_0xf81d('0x5'));var rp=require(_0xf81d('0x6'));var fs=require('fs');var path=require(_0xf81d('0x7'));var rimraf=require(_0xf81d('0x8'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xf81d('0x9')]=function(_0x4678d9,_0x18a5a1){return _0x4678d9['define'](_0xf81d('0xa'),attributes,{'tableName':_0xf81d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf81d('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 85855c0..9e717d7 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(_0x1ac98e,_0x9466e1){var _0x4c074b=function(_0xc79b7){while(--_0xc79b7){_0x1ac98e['push'](_0x1ac98e['shift']());}};_0x4c074b(++_0x9466e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1bb67e,_0x4b021d){var _0x83a82e=function(_0x1e4bab){while(--_0x1e4bab){_0x1bb67e['push'](_0x1bb67e['shift']());}};_0x83a82e(++_0x4b021d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 121cce4..b030f78 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 _0x4dbf=['put','update','delete','multer','path','connect-timeout','fs-extra','../../config/environment','get','index','/:id','show','post','isAuthenticated','create'];(function(_0x8d6c7a,_0x2d4c3c){var _0x2c305a=function(_0x388014){while(--_0x388014){_0x8d6c7a['push'](_0x8d6c7a['shift']());}};_0x2c305a(++_0x2d4c3c);}(_0x4dbf,0xc6));var _0xf4db=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x4dbf[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0xf4db('0x0'));var util=require('util');var path=require(_0xf4db('0x1'));var timeout=require(_0xf4db('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf4db('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf4db('0x4'));var controller=require('./cannedAnswer.controller');router[_0xf4db('0x5')]('/',auth['isAuthenticated'](),controller[_0xf4db('0x6')]);router[_0xf4db('0x5')](_0xf4db('0x7'),auth['isAuthenticated'](),controller[_0xf4db('0x8')]);router[_0xf4db('0x9')]('/',auth[_0xf4db('0xa')](),controller[_0xf4db('0xb')]);router[_0xf4db('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xf4db('0xd')]);router[_0xf4db('0xe')]('/:id',auth[_0xf4db('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7531=['/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x7531,0x67));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1753('0x0'));var util=require('util');var path=require(_0x1753('0x1'));var timeout=require(_0x1753('0x2'));var express=require(_0x1753('0x3'));var router=express[_0x1753('0x4')]();var fs_extra=require(_0x1753('0x5'));var auth=require(_0x1753('0x6'));var interaction=require(_0x1753('0x7'));var config=require(_0x1753('0x8'));var controller=require('./cannedAnswer.controller');router[_0x1753('0x9')]('/',auth[_0x1753('0xa')](),controller['index']);router[_0x1753('0x9')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0xc')]);router[_0x1753('0xd')]('/',auth['isAuthenticated'](),controller[_0x1753('0xe')]);router[_0x1753('0xf')]('/:id',auth[_0x1753('0xa')](),controller[_0x1753('0x10')]);router[_0x1753('0x11')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 55a33ce..52dede7 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 _0x6a00=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x47583b,_0x422882){var _0x369034=function(_0x274f6f){while(--_0x274f6f){_0x47583b['push'](_0x47583b['shift']());}};_0x369034(++_0x422882);}(_0x6a00,0xc9));var _0x06a0=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6a00[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x06a0('0x0'));module[_0x06a0('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x06a0('0x2')},'clid':{'type':Sequelize[_0x06a0('0x3')]},'src':{'type':Sequelize[_0x06a0('0x3')]},'dst':{'type':Sequelize[_0x06a0('0x3')]},'dcontext':{'type':Sequelize[_0x06a0('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x06a0('0x3')]},'lastdata':{'type':Sequelize[_0x06a0('0x3')]},'duration':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x06a0('0x3')]},'amaflags':{'type':Sequelize[_0x06a0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x06a0('0x3')]},'uniqueid':{'type':Sequelize[_0x06a0('0x3')]},'linkedid':{'type':Sequelize[_0x06a0('0x3')]},'sequence':{'type':Sequelize[_0x06a0('0x3')]},'peeraccount':{'type':Sequelize[_0x06a0('0x3')]},'type':{'type':Sequelize[_0x06a0('0x3')]},'tag':{'type':Sequelize[_0x06a0('0x3')]}}; \ No newline at end of file +var _0x34e5=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x3fd6fd,_0x2ac441){var _0x3849f3=function(_0x19d13a){while(--_0x19d13a){_0x3fd6fd['push'](_0x3fd6fd['shift']());}};_0x3849f3(++_0x2ac441);}(_0x34e5,0x172));var _0x534e=function(_0x51d50a,_0x501b7e){_0x51d50a=_0x51d50a-0x0;var _0x46295a=_0x34e5[_0x51d50a];return _0x46295a;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x534e('0x1')},'clid':{'type':Sequelize[_0x534e('0x2')]},'src':{'type':Sequelize[_0x534e('0x2')]},'dst':{'type':Sequelize[_0x534e('0x2')]},'dcontext':{'type':Sequelize[_0x534e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x534e('0x2')]},'lastapp':{'type':Sequelize[_0x534e('0x2')]},'lastdata':{'type':Sequelize[_0x534e('0x2')]},'duration':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x534e('0x2')]},'amaflags':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x534e('0x2')]},'uniqueid':{'type':Sequelize[_0x534e('0x2')]},'linkedid':{'type':Sequelize[_0x534e('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x534e('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 36f77f1..169b49f 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 _0x8375=['attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','error','stack','name','send','map','Cdr','fieldName','type','model','query','keys'];(function(_0x46aaaa,_0x3af897){var _0x26d04e=function(_0x4373ba){while(--_0x4373ba){_0x46aaaa['push'](_0x46aaaa['shift']());}};_0x26d04e(++_0x3af897);}(_0x8375,0xa8));var _0x5837=function(_0x45a106,_0x40f99f){_0x45a106=_0x45a106-0x0;var _0x318090=_0x8375[_0x45a106];return _0x318090;};'use strict';var emlformat=require(_0x5837('0x0'));var rimraf=require(_0x5837('0x1'));var zipdir=require(_0x5837('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require(_0x5837('0x6'));var util=require(_0x5837('0x7'));var path=require(_0x5837('0x8'));var sox=require('sox');var csv=require(_0x5837('0x9'));var ejs=require(_0x5837('0xa'));var fs=require('fs');var fs_extra=require(_0x5837('0xb'));var _=require(_0x5837('0xc'));var squel=require(_0x5837('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x9'));var querystring=require('querystring');var Papa=require(_0x5837('0xf'));var Redis=require('ioredis');var authService=require(_0x5837('0x10'));var qs=require(_0x5837('0x11'));var as=require(_0x5837('0x12'));var hardwareService=require(_0x5837('0x13'));var logger=require(_0x5837('0x14'))(_0x5837('0x15'));var utils=require('../../config/utils');var config=require(_0x5837('0x16'));var licenseUtil=require(_0x5837('0x17'));var db=require(_0x5837('0x18'))['db'];function respondWithStatusCode(_0x10c1a1,_0x143210){_0x143210=_0x143210||0xcc;return function(_0x485366){if(_0x485366){return _0x10c1a1['sendStatus'](_0x143210);}return _0x10c1a1['status'](_0x143210)[_0x5837('0x19')]();};}function respondWithResult(_0x111dbf,_0x469903){_0x469903=_0x469903||0xc8;return function(_0xa5718d){if(_0xa5718d){return _0x111dbf[_0x5837('0x1a')](_0x469903)[_0x5837('0x1b')](_0xa5718d);}};}function respondWithFilteredResult(_0x206f02,_0x754f39){return function(_0x10d882){if(_0x10d882){var _0x59a378=typeof _0x754f39[_0x5837('0x1c')]===_0x5837('0x1d')&&typeof _0x754f39['limit']===_0x5837('0x1d');var _0x2297b4=_0x10d882[_0x5837('0x1e')];var _0x49279d=_0x59a378?0x0:_0x754f39['offset'];var _0x4bee08=_0x59a378?_0x10d882[_0x5837('0x1e')]:_0x754f39[_0x5837('0x1c')]+_0x754f39[_0x5837('0x1f')];var _0x58e7f7;if(_0x4bee08>=_0x2297b4){_0x4bee08=_0x2297b4;_0x58e7f7=0xc8;}else{_0x58e7f7=0xce;}_0x206f02[_0x5837('0x1a')](_0x58e7f7);return _0x206f02[_0x5837('0x20')](_0x5837('0x21'),_0x49279d+'-'+_0x4bee08+'/'+_0x2297b4)[_0x5837('0x1b')](_0x10d882);}return null;};}function patchUpdates(_0x5881ff){return function(_0x4908c2){try{jsonpatch['apply'](_0x4908c2,_0x5881ff,!![]);}catch(_0x3d352f){return BPromise['reject'](_0x3d352f);}return _0x4908c2[_0x5837('0x22')]();};}function saveUpdates(_0x2bd103,_0x32733a){return function(_0x3a7efe){if(_0x3a7efe){return _0x3a7efe['update'](_0x2bd103)['then'](function(_0x1b80db){return _0x1b80db;});}return null;};}function removeEntity(_0x2262b9,_0x406506){return function(_0x5e8089){if(_0x5e8089){return _0x5e8089[_0x5837('0x23')]()[_0x5837('0x24')](function(){_0x2262b9[_0x5837('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41f86a,_0x2646ed){return function(_0x39babd){if(!_0x39babd){_0x41f86a['sendStatus'](0x194);}return _0x39babd;};}function handleError(_0x57baed,_0x1d545c){_0x1d545c=_0x1d545c||0x1f4;return function(_0x15655e){logger[_0x5837('0x25')](_0x15655e[_0x5837('0x26')]);if(_0x15655e[_0x5837('0x27')]){delete _0x15655e[_0x5837('0x27')];}_0x57baed[_0x5837('0x1a')](_0x1d545c)[_0x5837('0x28')](_0x15655e);};}exports['index']=function(_0x2f0c8d,_0x13830f){var _0x3cbd3f={},_0x3918ee={},_0x1c9f32={'count':0x0,'rows':[]};var _0x228f1=_[_0x5837('0x29')](db[_0x5837('0x2a')]['rawAttributes'],function(_0x4f7502){return{'name':_0x4f7502[_0x5837('0x2b')],'type':_0x4f7502[_0x5837('0x2c')]['key']};});_0x3918ee[_0x5837('0x2d')]=_[_0x5837('0x29')](_0x228f1,'name');_0x3918ee[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x2f0c8d[_0x5837('0x2e')]);_0x3918ee['filters']=_['intersection'](_0x3918ee['model'],_0x3918ee[_0x5837('0x2e')]);_0x3cbd3f[_0x5837('0x30')]=_[_0x5837('0x31')](_0x3918ee[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x2f0c8d['query']['fields']));_0x3cbd3f[_0x5837('0x30')]=_0x3cbd3f[_0x5837('0x30')]['length']?_0x3cbd3f['attributes']:_0x3918ee[_0x5837('0x2d')];if(!_0x2f0c8d['query']['hasOwnProperty'](_0x5837('0x33'))){_0x3cbd3f[_0x5837('0x1f')]=qs['limit'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1f')]);_0x3cbd3f[_0x5837('0x1c')]=qs['offset'](_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x1c')]);}_0x3cbd3f[_0x5837('0x34')]=qs[_0x5837('0x35')](_0x2f0c8d[_0x5837('0x2e')]['sort']);_0x3cbd3f[_0x5837('0x36')]=qs['filters'](_['pick'](_0x2f0c8d[_0x5837('0x2e')],_0x3918ee[_0x5837('0x37')]),_0x228f1);if(_0x2f0c8d['query'][_0x5837('0x38')]){_0x3cbd3f[_0x5837('0x36')]=_[_0x5837('0x39')](_0x3cbd3f[_0x5837('0x36')],{'$or':_['map'](_0x228f1,function(_0x2ed688){if(_0x2ed688[_0x5837('0x2c')]!==_0x5837('0x3a')){var _0x5dcd18={};_0x5dcd18[_0x2ed688[_0x5837('0x27')]]={'$like':'%'+_0x2f0c8d[_0x5837('0x2e')][_0x5837('0x38')]+'%'};return _0x5dcd18;}})});}_0x3cbd3f=_[_0x5837('0x39')]({},_0x3cbd3f,_0x2f0c8d[_0x5837('0x3b')]);var _0x76f00d={'where':_0x3cbd3f[_0x5837('0x36')]};return db[_0x5837('0x2a')][_0x5837('0x1e')](_0x76f00d)[_0x5837('0x24')](function(_0x1a5e2d){_0x1c9f32[_0x5837('0x1e')]=_0x1a5e2d;if(_0x2f0c8d['query']['includeAll']){_0x3cbd3f[_0x5837('0x3c')]=[{'all':!![]}];}return db[_0x5837('0x2a')]['findAll'](_0x3cbd3f);})[_0x5837('0x24')](function(_0x1ae168){_0x1c9f32[_0x5837('0x3d')]=_0x1ae168;return _0x1c9f32;})['then'](respondWithFilteredResult(_0x13830f,_0x3cbd3f))[_0x5837('0x3e')](handleError(_0x13830f,null));};exports[_0x5837('0x3f')]=function(_0x1c81ed,_0x3acdf5){var _0x4643e3={'raw':!![],'where':{'id':_0x1c81ed[_0x5837('0x40')]['id']}},_0xd443be={};_0xd443be[_0x5837('0x2d')]=_[_0x5837('0x2f')](db['Cdr'][_0x5837('0x41')]);_0xd443be[_0x5837('0x2e')]=_[_0x5837('0x2f')](_0x1c81ed['query']);_0xd443be['filters']=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],_0xd443be[_0x5837('0x2e')]);_0x4643e3[_0x5837('0x30')]=_[_0x5837('0x31')](_0xd443be[_0x5837('0x2d')],qs[_0x5837('0x32')](_0x1c81ed[_0x5837('0x2e')][_0x5837('0x32')]));_0x4643e3[_0x5837('0x30')]=_0x4643e3[_0x5837('0x30')][_0x5837('0x42')]?_0x4643e3['attributes']:_0xd443be[_0x5837('0x2d')];if(_0x1c81ed['query'][_0x5837('0x43')]){_0x4643e3[_0x5837('0x3c')]=[{'all':!![]}];}_0x4643e3=_['merge']({},_0x4643e3,_0x1c81ed[_0x5837('0x3b')]);return db[_0x5837('0x2a')]['find'](_0x4643e3)[_0x5837('0x24')](handleEntityNotFound(_0x3acdf5,null))[_0x5837('0x24')](respondWithResult(_0x3acdf5,null))[_0x5837('0x3e')](handleError(_0x3acdf5,null));};exports[_0x5837('0x44')]=function(_0x54a23b,_0x55cf2b){return db[_0x5837('0x2a')][_0x5837('0x44')](_0x54a23b['body'],{})['then'](respondWithResult(_0x55cf2b,0xc9))['catch'](handleError(_0x55cf2b,null));};exports['update']=function(_0x38e987,_0x6423f2){if(_0x38e987[_0x5837('0x45')]['id']){delete _0x38e987['body']['id'];}return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x38e987[_0x5837('0x40')]['id']}})[_0x5837('0x24')](handleEntityNotFound(_0x6423f2,null))[_0x5837('0x24')](saveUpdates(_0x38e987[_0x5837('0x45')],null))[_0x5837('0x24')](respondWithResult(_0x6423f2,null))[_0x5837('0x3e')](handleError(_0x6423f2,null));};exports[_0x5837('0x23')]=function(_0x27f7b9,_0x38743a){return db['Cdr'][_0x5837('0x46')]({'where':{'id':_0x27f7b9[_0x5837('0x40')]['id']}})['then'](handleEntityNotFound(_0x38743a,null))[_0x5837('0x24')](removeEntity(_0x38743a,null))[_0x5837('0x3e')](handleError(_0x38743a,null));};exports[_0x5837('0x47')]=function(_0x397cd9,_0x38e75d){return db['Cdr'][_0x5837('0x47')]()[_0x5837('0x24')](respondWithResult(_0x38e75d,null))[_0x5837('0x3e')](handleError(_0x38e75d,null));}; \ No newline at end of file +var _0x4ab0=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','Cdr','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x58bb02,_0x1558dc){var _0xd6a0ad=function(_0x139f4a){while(--_0x139f4a){_0x58bb02['push'](_0x58bb02['shift']());}};_0xd6a0ad(++_0x1558dc);}(_0x4ab0,0xd5));var _0x04ab=function(_0x558eed,_0x4cd4f3){_0x558eed=_0x558eed-0x0;var _0xf8fb7=_0x4ab0[_0x558eed];return _0xf8fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['index']=function(_0x404eae,_0x30db64){var _0x2e069d={},_0x3c25fb={},_0x12385b={'count':0x0,'rows':[]};var _0x5596fc=_['map'](db[_0x04ab('0x29')][_0x04ab('0x2a')],function(_0x28e77b){return{'name':_0x28e77b[_0x04ab('0x2b')],'type':_0x28e77b[_0x04ab('0x2c')][_0x04ab('0x2d')]};});_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x5596fc,_0x04ab('0x27'));_0x3c25fb[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x404eae[_0x04ab('0x30')]);_0x3c25fb[_0x04ab('0x32')]=_['intersection'](_0x3c25fb[_0x04ab('0x2e')],_0x3c25fb[_0x04ab('0x30')]);_0x2e069d['attributes']=_[_0x04ab('0x33')](_0x3c25fb[_0x04ab('0x2e')],qs['fields'](_0x404eae[_0x04ab('0x30')][_0x04ab('0x34')]));_0x2e069d['attributes']=_0x2e069d[_0x04ab('0x35')][_0x04ab('0x36')]?_0x2e069d[_0x04ab('0x35')]:_0x3c25fb[_0x04ab('0x2e')];if(!_0x404eae[_0x04ab('0x30')][_0x04ab('0x37')]('nolimit')){_0x2e069d[_0x04ab('0x1c')]=qs[_0x04ab('0x1c')](_0x404eae[_0x04ab('0x30')]['limit']);_0x2e069d[_0x04ab('0x1a')]=qs['offset'](_0x404eae['query'][_0x04ab('0x1a')]);}_0x2e069d[_0x04ab('0x38')]=qs['sort'](_0x404eae[_0x04ab('0x30')]['sort']);_0x2e069d[_0x04ab('0x39')]=qs[_0x04ab('0x32')](_[_0x04ab('0x3a')](_0x404eae[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x32')]),_0x5596fc);if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3b')]){_0x2e069d[_0x04ab('0x39')]=_[_0x04ab('0x3c')](_0x2e069d[_0x04ab('0x39')],{'$or':_[_0x04ab('0x2f')](_0x5596fc,function(_0x3f145){if(_0x3f145['type']!==_0x04ab('0x3d')){var _0x14756a={};_0x14756a[_0x3f145['name']]={'$like':'%'+_0x404eae['query'][_0x04ab('0x3b')]+'%'};return _0x14756a;}})});}_0x2e069d=_[_0x04ab('0x3c')]({},_0x2e069d,_0x404eae[_0x04ab('0x3e')]);var _0x4327b9={'where':_0x2e069d['where']};return db[_0x04ab('0x29')][_0x04ab('0x1d')](_0x4327b9)[_0x04ab('0x23')](function(_0x244acf){_0x12385b['count']=_0x244acf;if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x2e069d[_0x04ab('0x40')]=[{'all':!![]}];}return db[_0x04ab('0x29')][_0x04ab('0x41')](_0x2e069d);})[_0x04ab('0x23')](function(_0x20b8cc){_0x12385b[_0x04ab('0x42')]=_0x20b8cc;return _0x12385b;})['then'](respondWithFilteredResult(_0x30db64,_0x2e069d))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x43')]=function(_0x4c8cb0,_0x8a93c2){var _0x46a7c5={'raw':!![],'where':{'id':_0x4c8cb0['params']['id']}},_0x3c27ee={};_0x3c27ee[_0x04ab('0x2e')]=_[_0x04ab('0x31')](db[_0x04ab('0x29')]['rawAttributes']);_0x3c27ee[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x4c8cb0[_0x04ab('0x30')]);_0x3c27ee[_0x04ab('0x32')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],_0x3c27ee[_0x04ab('0x30')]);_0x46a7c5[_0x04ab('0x35')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],qs['fields'](_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x34')]));_0x46a7c5[_0x04ab('0x35')]=_0x46a7c5[_0x04ab('0x35')][_0x04ab('0x36')]?_0x46a7c5[_0x04ab('0x35')]:_0x3c27ee['model'];if(_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x46a7c5[_0x04ab('0x40')]=[{'all':!![]}];}_0x46a7c5=_[_0x04ab('0x3c')]({},_0x46a7c5,_0x4c8cb0['options']);return db[_0x04ab('0x29')][_0x04ab('0x44')](_0x46a7c5)[_0x04ab('0x23')](handleEntityNotFound(_0x8a93c2,null))[_0x04ab('0x23')](respondWithResult(_0x8a93c2,null))[_0x04ab('0x45')](handleError(_0x8a93c2,null));};exports['create']=function(_0x326621,_0x15b995){return db['Cdr']['create'](_0x326621[_0x04ab('0x46')],{})[_0x04ab('0x23')](respondWithResult(_0x15b995,0xc9))[_0x04ab('0x45')](handleError(_0x15b995,null));};exports[_0x04ab('0x47')]=function(_0x1c4aa2,_0x3a9056){if(_0x1c4aa2[_0x04ab('0x46')]['id']){delete _0x1c4aa2['body']['id'];}return db[_0x04ab('0x29')][_0x04ab('0x44')]({'where':{'id':_0x1c4aa2[_0x04ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9056,null))[_0x04ab('0x23')](saveUpdates(_0x1c4aa2[_0x04ab('0x46')],null))['then'](respondWithResult(_0x3a9056,null))[_0x04ab('0x45')](handleError(_0x3a9056,null));};exports['destroy']=function(_0xc9db25,_0x4bc4f6){return db[_0x04ab('0x29')]['find']({'where':{'id':_0xc9db25['params']['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x4bc4f6,null))[_0x04ab('0x23')](removeEntity(_0x4bc4f6,null))[_0x04ab('0x45')](handleError(_0x4bc4f6,null));};exports['describe']=function(_0x53f63a,_0x5ed30e){return db[_0x04ab('0x29')][_0x04ab('0x49')]()['then'](respondWithResult(_0x5ed30e,null))[_0x04ab('0x45')](handleError(_0x5ed30e,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 8334c00..e2b0612 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(_0x22cd7c,_0x1d86fa){var _0x36096c=function(_0x1fbbcb){while(--_0x1fbbcb){_0x22cd7c['push'](_0x22cd7c['shift']());}};_0x36096c(++_0x1d86fa);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0x49856d,_0x1c47bc){var _0x19976d=function(_0x351f98){while(--_0x351f98){_0x49856d['push'](_0x49856d['shift']());}};_0x19976d(++_0x1c47bc);}(_0x7a54,0x106));var _0x47a5=function(_0x3ff227,_0x3a8351){_0x3ff227=_0x3ff227-0x0;var _0x3fae84=_0x7a54[_0x3ff227];return _0x3fae84;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index e7fac43..a41d34e 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 _0x31f6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird'];(function(_0x2a9b81,_0x5ea35d){var _0xc5f927=function(_0x49b4bc){while(--_0x49b4bc){_0x2a9b81['push'](_0x2a9b81['shift']());}};_0xc5f927(++_0x5ea35d);}(_0x31f6,0x102));var _0x631f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x31f6[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x631f('0x0'));var moment=require('moment');var BPromise=require(_0x631f('0x1'));var rs=require(_0x631f('0x2'));var fs=require('fs');var Redis=require(_0x631f('0x3'));var db=require(_0x631f('0x4'))['db'];var utils=require(_0x631f('0x5'));var logger=require(_0x631f('0x6'))(_0x631f('0x7'));var config=require(_0x631f('0x8'));var jayson=require(_0x631f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x152a64,_0x3d812a,_0x1742a7){return new BPromise(function(_0x2cf71e,_0x188cdc){return client[_0x631f('0xa')](_0x152a64,_0x1742a7)[_0x631f('0xb')](function(_0xe3048c){logger['info'](_0x631f('0xc'),_0x3d812a,_0x631f('0xd'));logger['debug'](_0x631f('0xe'),_0x3d812a,_0x631f('0xd'),JSON[_0x631f('0xf')](_0xe3048c));if(_0xe3048c['error']){if(_0xe3048c[_0x631f('0x10')][_0x631f('0x11')]===0x1f4){logger[_0x631f('0x10')](_0x631f('0xc'),_0x3d812a,_0xe3048c[_0x631f('0x10')][_0x631f('0x12')]);return _0x188cdc(_0xe3048c['error'][_0x631f('0x12')]);}logger[_0x631f('0x10')]('Cdr,\x20%s,\x20%s',_0x3d812a,_0xe3048c[_0x631f('0x10')][_0x631f('0x12')]);return _0x2cf71e(_0xe3048c['error'][_0x631f('0x12')]);}else{logger['info'](_0x631f('0xc'),_0x3d812a,_0x631f('0xd'));_0x2cf71e(_0xe3048c['result']['message']);}})[_0x631f('0x13')](function(_0x446108){logger[_0x631f('0x10')](_0x631f('0xc'),_0x3d812a,_0x446108);_0x188cdc(_0x446108);});});} \ No newline at end of file +var _0x1d5e=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5f3466,_0x15e4d3){var _0x21b9a6=function(_0x15a04b){while(--_0x15a04b){_0x5f3466['push'](_0x5f3466['shift']());}};_0x21b9a6(++_0x15e4d3);}(_0x1d5e,0x11b));var _0xe1d5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1d5e[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xe1d5('0x0'));var moment=require('moment');var BPromise=require(_0xe1d5('0x1'));var rs=require(_0xe1d5('0x2'));var fs=require('fs');var Redis=require(_0xe1d5('0x3'));var db=require(_0xe1d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe1d5('0x5'));var jayson=require(_0xe1d5('0x6'));var client=jayson[_0xe1d5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464db5,_0xe682c4,_0x436702){return new BPromise(function(_0x4bbf8f,_0xe8872b){return client[_0xe1d5('0x8')](_0x464db5,_0x436702)[_0xe1d5('0x9')](function(_0x1219c8){logger[_0xe1d5('0xa')]('Cdr,\x20%s,\x20%s',_0xe682c4,_0xe1d5('0xb'));logger[_0xe1d5('0xc')](_0xe1d5('0xd'),_0xe682c4,_0xe1d5('0xb'),JSON[_0xe1d5('0xe')](_0x1219c8));if(_0x1219c8[_0xe1d5('0xf')]){if(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x10')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0xe682c4,_0x1219c8[_0xe1d5('0xf')]['message']);return _0xe8872b(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);}logger['error'](_0xe1d5('0x12'),_0xe682c4,_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);return _0x4bbf8f(_0x1219c8['error'][_0xe1d5('0x11')]);}else{logger[_0xe1d5('0xa')](_0xe1d5('0x12'),_0xe682c4,'request\x20sent');_0x4bbf8f(_0x1219c8[_0xe1d5('0x13')][_0xe1d5('0x11')]);}})[_0xe1d5('0x14')](function(_0x354e4e){logger[_0xe1d5('0xf')](_0xe1d5('0x12'),_0xe682c4,_0x354e4e);_0xe8872b(_0x354e4e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 6e3fcfb..0d650bf 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x45bfbc,_0x1ff15e){var _0x407018=function(_0x22f0f0){while(--_0x22f0f0){_0x45bfbc['push'](_0x45bfbc['shift']());}};_0x407018(++_0x1ff15e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 7048ae9..d423ba9 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 _0x0a8c=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x1bb501,_0x3fedaf){var _0x502e3e=function(_0x3688ac){while(--_0x3688ac){_0x1bb501['push'](_0x1bb501['shift']());}};_0x502e3e(++_0x3fedaf);}(_0x0a8c,0x1aa));var _0xc0a8=function(_0x223655,_0x55480f){_0x223655=_0x223655-0x0;var _0x17b991=_0x0a8c[_0x223655];return _0x17b991;};'use strict';var Sequelize=require(_0xc0a8('0x0'));module[_0xc0a8('0x1')]={'priority':{'type':Sequelize[_0xc0a8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc0a8('0x3')],'allowNull':![],'defaultValue':_0xc0a8('0x4')},'appdata':{'type':Sequelize[_0xc0a8('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc0a8('0x3')],'defaultValue':_0xc0a8('0x6')}}; \ No newline at end of file +var _0x987f=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x127cfa,_0x1f028c){var _0x2a6dcb=function(_0x49af9c){while(--_0x49af9c){_0x127cfa['push'](_0x127cfa['shift']());}};_0x2a6dcb(++_0x1f028c);}(_0x987f,0xf9));var _0xf987=function(_0x2c1101,_0x1909d9){_0x2c1101=_0x2c1101-0x0;var _0x56f52f=_0x987f[_0x2c1101];return _0x56f52f;};'use strict';var Sequelize=require(_0xf987('0x0'));module[_0xf987('0x1')]={'priority':{'type':Sequelize[_0xf987('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf987('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf987('0x4')]()},'description':{'type':Sequelize[_0xf987('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf987('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index f609379..883b244 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 _0x81a4=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','show','params','model','keys','ChatApplication','filters','intersection','attributes','query','fields','length','includeAll','merge','options','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x32c33a,_0x143ab9){var _0x466b2e=function(_0x56211e){while(--_0x56211e){_0x32c33a['push'](_0x32c33a['shift']());}};_0x466b2e(++_0x143ab9);}(_0x81a4,0x1a6));var _0x481a=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0x81a4[_0x1ca9eb];return _0x2e284e;};'use strict';var emlformat=require(_0x481a('0x0'));var rimraf=require(_0x481a('0x1'));var zipdir=require(_0x481a('0x2'));var jsonpatch=require(_0x481a('0x3'));var rp=require('request-promise');var moment=require(_0x481a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x481a('0x5'));var util=require(_0x481a('0x6'));var path=require(_0x481a('0x7'));var sox=require('sox');var csv=require(_0x481a('0x8'));var ejs=require(_0x481a('0x9'));var fs=require('fs');var fs_extra=require(_0x481a('0xa'));var _=require(_0x481a('0xb'));var squel=require('squel');var crypto=require(_0x481a('0xc'));var jsforce=require(_0x481a('0xd'));var deskjs=require(_0x481a('0xe'));var toCsv=require(_0x481a('0x8'));var querystring=require(_0x481a('0xf'));var Papa=require(_0x481a('0x10'));var Redis=require('ioredis');var authService=require(_0x481a('0x11'));var qs=require(_0x481a('0x12'));var as=require(_0x481a('0x13'));var hardwareService=require(_0x481a('0x14'));var logger=require(_0x481a('0x15'))(_0x481a('0x16'));var utils=require(_0x481a('0x17'));var config=require(_0x481a('0x18'));var licenseUtil=require(_0x481a('0x19'));var db=require(_0x481a('0x1a'))['db'];function respondWithStatusCode(_0x507233,_0x5838af){_0x5838af=_0x5838af||0xcc;return function(_0x28a189){if(_0x28a189){return _0x507233[_0x481a('0x1b')](_0x5838af);}return _0x507233[_0x481a('0x1c')](_0x5838af)[_0x481a('0x1d')]();};}function respondWithResult(_0x44700a,_0x2e520b){_0x2e520b=_0x2e520b||0xc8;return function(_0x5637bd){if(_0x5637bd){return _0x44700a[_0x481a('0x1c')](_0x2e520b)['json'](_0x5637bd);}};}function respondWithFilteredResult(_0x238f3d,_0x1410c1){return function(_0x40f691){if(_0x40f691){var _0x507a5b=typeof _0x1410c1['offset']===_0x481a('0x1e')&&typeof _0x1410c1[_0x481a('0x1f')]===_0x481a('0x1e');var _0x152483=_0x40f691[_0x481a('0x20')];var _0x3186e3=_0x507a5b?0x0:_0x1410c1[_0x481a('0x21')];var _0x2e6d4e=_0x507a5b?_0x40f691[_0x481a('0x20')]:_0x1410c1[_0x481a('0x21')]+_0x1410c1['limit'];var _0x243883;if(_0x2e6d4e>=_0x152483){_0x2e6d4e=_0x152483;_0x243883=0xc8;}else{_0x243883=0xce;}_0x238f3d[_0x481a('0x1c')](_0x243883);return _0x238f3d[_0x481a('0x22')](_0x481a('0x23'),_0x3186e3+'-'+_0x2e6d4e+'/'+_0x152483)[_0x481a('0x24')](_0x40f691);}return null;};}function patchUpdates(_0x4a3a10){return function(_0x2e3549){try{jsonpatch[_0x481a('0x25')](_0x2e3549,_0x4a3a10,!![]);}catch(_0x248e88){return BPromise[_0x481a('0x26')](_0x248e88);}return _0x2e3549['save']();};}function saveUpdates(_0xce4b34,_0x1afd59){return function(_0x44673f){if(_0x44673f){return _0x44673f[_0x481a('0x27')](_0xce4b34)[_0x481a('0x28')](function(_0x17534e){return _0x17534e;});}return null;};}function removeEntity(_0x336ea1,_0x6a554b){return function(_0x56dc8f){if(_0x56dc8f){return _0x56dc8f[_0x481a('0x29')]()[_0x481a('0x28')](function(){_0x336ea1['status'](0xcc)[_0x481a('0x1d')]();});}};}function handleEntityNotFound(_0x4916fa,_0x1f7c7d){return function(_0x2ab2ed){if(!_0x2ab2ed){_0x4916fa[_0x481a('0x1b')](0x194);}return _0x2ab2ed;};}function handleError(_0xa86211,_0x542639){_0x542639=_0x542639||0x1f4;return function(_0x42acf4){logger[_0x481a('0x2a')](_0x42acf4[_0x481a('0x2b')]);if(_0x42acf4[_0x481a('0x2c')]){delete _0x42acf4[_0x481a('0x2c')];}_0xa86211[_0x481a('0x1c')](_0x542639)['send'](_0x42acf4);};}exports[_0x481a('0x2d')]=function(_0x33306a,_0xde418d){var _0x428e55={'raw':!![],'where':{'id':_0x33306a[_0x481a('0x2e')]['id']}},_0x4e9d26={};_0x4e9d26[_0x481a('0x2f')]=_[_0x481a('0x30')](db[_0x481a('0x31')]['rawAttributes']);_0x4e9d26['query']=_['keys'](_0x33306a['query']);_0x4e9d26[_0x481a('0x32')]=_[_0x481a('0x33')](_0x4e9d26[_0x481a('0x2f')],_0x4e9d26['query']);_0x428e55[_0x481a('0x34')]=_[_0x481a('0x33')](_0x4e9d26[_0x481a('0x2f')],qs['fields'](_0x33306a[_0x481a('0x35')][_0x481a('0x36')]));_0x428e55['attributes']=_0x428e55['attributes'][_0x481a('0x37')]?_0x428e55[_0x481a('0x34')]:_0x4e9d26[_0x481a('0x2f')];if(_0x33306a[_0x481a('0x35')][_0x481a('0x38')]){_0x428e55['include']=[{'all':!![]}];}_0x428e55=_[_0x481a('0x39')]({},_0x428e55,_0x33306a[_0x481a('0x3a')]);return db[_0x481a('0x31')][_0x481a('0x3b')](_0x428e55)['then'](handleEntityNotFound(_0xde418d,null))['then'](respondWithResult(_0xde418d,null))['catch'](handleError(_0xde418d,null));};exports[_0x481a('0x27')]=function(_0x95e744,_0x4ce97e){if(_0x95e744[_0x481a('0x3c')]['id']){delete _0x95e744[_0x481a('0x3c')]['id'];}return db['ChatApplication'][_0x481a('0x3b')]({'where':{'id':_0x95e744['params']['id']}})['then'](handleEntityNotFound(_0x4ce97e,null))['then'](saveUpdates(_0x95e744[_0x481a('0x3c')],null))['then'](respondWithResult(_0x4ce97e,null))[_0x481a('0x3d')](handleError(_0x4ce97e,null));};exports[_0x481a('0x29')]=function(_0x239955,_0x36b9ff){return db['ChatApplication'][_0x481a('0x3b')]({'where':{'id':_0x239955[_0x481a('0x2e')]['id']}})[_0x481a('0x28')](handleEntityNotFound(_0x36b9ff,null))[_0x481a('0x28')](removeEntity(_0x36b9ff,null))[_0x481a('0x3d')](handleError(_0x36b9ff,null));}; \ No newline at end of file +var _0x639a=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','undefined','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','include','merge','options','find','catch','update','body','ChatApplication'];(function(_0x15fcee,_0x5ca682){var _0x42c080=function(_0x4d1332){while(--_0x4d1332){_0x15fcee['push'](_0x15fcee['shift']());}};_0x42c080(++_0x5ca682);}(_0x639a,0xec));var _0xa639=function(_0x33ec4b,_0x30cdd9){_0x33ec4b=_0x33ec4b-0x0;var _0x48027a=_0x639a[_0x33ec4b];return _0x48027a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa639('0x0'));var zipdir=require(_0xa639('0x1'));var jsonpatch=require(_0xa639('0x2'));var rp=require(_0xa639('0x3'));var moment=require(_0xa639('0x4'));var BPromise=require(_0xa639('0x5'));var Mustache=require('mustache');var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require('to-csv');var ejs=require(_0xa639('0x9'));var fs=require('fs');var fs_extra=require(_0xa639('0xa'));var _=require(_0xa639('0xb'));var squel=require(_0xa639('0xc'));var crypto=require('crypto');var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require(_0xa639('0xf'));var querystring=require(_0xa639('0x10'));var Papa=require(_0xa639('0x11'));var Redis=require(_0xa639('0x12'));var authService=require(_0xa639('0x13'));var qs=require(_0xa639('0x14'));var as=require(_0xa639('0x15'));var hardwareService=require(_0xa639('0x16'));var logger=require(_0xa639('0x17'))(_0xa639('0x18'));var utils=require(_0xa639('0x19'));var config=require(_0xa639('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba862,_0x2bf30f){_0x2bf30f=_0x2bf30f||0xcc;return function(_0xbd7aec){if(_0xbd7aec){return _0x5ba862['sendStatus'](_0x2bf30f);}return _0x5ba862['status'](_0x2bf30f)[_0xa639('0x1b')]();};}function respondWithResult(_0x1bdc46,_0x4d4b66){_0x4d4b66=_0x4d4b66||0xc8;return function(_0x1df5dd){if(_0x1df5dd){return _0x1bdc46[_0xa639('0x1c')](_0x4d4b66)[_0xa639('0x1d')](_0x1df5dd);}};}function respondWithFilteredResult(_0x49e770,_0xb15138){return function(_0x24f1a9){if(_0x24f1a9){var _0x96a92f=typeof _0xb15138[_0xa639('0x1e')]===_0xa639('0x1f')&&typeof _0xb15138['limit']===_0xa639('0x1f');var _0x4c6311=_0x24f1a9[_0xa639('0x20')];var _0x2e23a9=_0x96a92f?0x0:_0xb15138[_0xa639('0x1e')];var _0x229545=_0x96a92f?_0x24f1a9[_0xa639('0x20')]:_0xb15138['offset']+_0xb15138['limit'];var _0x2a36df;if(_0x229545>=_0x4c6311){_0x229545=_0x4c6311;_0x2a36df=0xc8;}else{_0x2a36df=0xce;}_0x49e770[_0xa639('0x1c')](_0x2a36df);return _0x49e770[_0xa639('0x21')](_0xa639('0x22'),_0x2e23a9+'-'+_0x229545+'/'+_0x4c6311)[_0xa639('0x1d')](_0x24f1a9);}return null;};}function patchUpdates(_0x52500b){return function(_0x5a939f){try{jsonpatch[_0xa639('0x23')](_0x5a939f,_0x52500b,!![]);}catch(_0x5d732c){return BPromise['reject'](_0x5d732c);}return _0x5a939f['save']();};}function saveUpdates(_0x43f85f,_0x28a11c){return function(_0x13592d){if(_0x13592d){return _0x13592d['update'](_0x43f85f)[_0xa639('0x24')](function(_0x562d03){return _0x562d03;});}return null;};}function removeEntity(_0xe89eb9,_0x351a33){return function(_0x55189d){if(_0x55189d){return _0x55189d['destroy']()['then'](function(){_0xe89eb9[_0xa639('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42b5d8,_0x3d6e0c){return function(_0x237da8){if(!_0x237da8){_0x42b5d8[_0xa639('0x25')](0x194);}return _0x237da8;};}function handleError(_0x5ded72,_0x314e07){_0x314e07=_0x314e07||0x1f4;return function(_0x1a0d4e){logger[_0xa639('0x26')](_0x1a0d4e[_0xa639('0x27')]);if(_0x1a0d4e[_0xa639('0x28')]){delete _0x1a0d4e[_0xa639('0x28')];}_0x5ded72[_0xa639('0x1c')](_0x314e07)[_0xa639('0x29')](_0x1a0d4e);};}exports[_0xa639('0x2a')]=function(_0x3cda24,_0x4b7f2c){var _0x2d315f={'raw':!![],'where':{'id':_0x3cda24[_0xa639('0x2b')]['id']}},_0x38ff11={};_0x38ff11[_0xa639('0x2c')]=_[_0xa639('0x2d')](db['ChatApplication'][_0xa639('0x2e')]);_0x38ff11[_0xa639('0x2f')]=_['keys'](_0x3cda24[_0xa639('0x2f')]);_0x38ff11[_0xa639('0x30')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],_0x38ff11[_0xa639('0x2f')]);_0x2d315f[_0xa639('0x32')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],qs['fields'](_0x3cda24[_0xa639('0x2f')]['fields']));_0x2d315f[_0xa639('0x32')]=_0x2d315f[_0xa639('0x32')]['length']?_0x2d315f[_0xa639('0x32')]:_0x38ff11['model'];if(_0x3cda24[_0xa639('0x2f')]['includeAll']){_0x2d315f[_0xa639('0x33')]=[{'all':!![]}];}_0x2d315f=_[_0xa639('0x34')]({},_0x2d315f,_0x3cda24[_0xa639('0x35')]);return db['ChatApplication'][_0xa639('0x36')](_0x2d315f)[_0xa639('0x24')](handleEntityNotFound(_0x4b7f2c,null))[_0xa639('0x24')](respondWithResult(_0x4b7f2c,null))[_0xa639('0x37')](handleError(_0x4b7f2c,null));};exports[_0xa639('0x38')]=function(_0x2c69fa,_0xa34d5c){if(_0x2c69fa[_0xa639('0x39')]['id']){delete _0x2c69fa['body']['id'];}return db[_0xa639('0x3a')]['find']({'where':{'id':_0x2c69fa[_0xa639('0x2b')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0xa34d5c,null))['then'](saveUpdates(_0x2c69fa[_0xa639('0x39')],null))[_0xa639('0x24')](respondWithResult(_0xa34d5c,null))[_0xa639('0x37')](handleError(_0xa34d5c,null));};exports['destroy']=function(_0x4ce86c,_0x16d74d){return db[_0xa639('0x3a')]['find']({'where':{'id':_0x4ce86c['params']['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x16d74d,null))[_0xa639('0x24')](removeEntity(_0x16d74d,null))['catch'](handleError(_0x16d74d,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 8ccd63d..ff4fd32 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 _0xa2cf=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xa94872,_0x4ec3b0){var _0x597214=function(_0x18354d){while(--_0x18354d){_0xa94872['push'](_0xa94872['shift']());}};_0x597214(++_0x4ec3b0);}(_0xa2cf,0x15c));var _0xfa2c=function(_0x50800a,_0x217ed5){_0x50800a=_0x50800a-0x0;var _0x4639c8=_0xa2cf[_0x50800a];return _0x4639c8;};'use strict';var _=require(_0xfa2c('0x0'));var util=require(_0xfa2c('0x1'));var logger=require(_0xfa2c('0x2'))('api');var moment=require(_0xfa2c('0x3'));var BPromise=require(_0xfa2c('0x4'));var rp=require(_0xfa2c('0x5'));var fs=require('fs');var path=require(_0xfa2c('0x6'));var rimraf=require(_0xfa2c('0x7'));var config=require(_0xfa2c('0x8'));var attributes=require(_0xfa2c('0x9'));module[_0xfa2c('0xa')]=function(_0x5e8a1b,_0xe1ad7e){return _0x5e8a1b[_0xfa2c('0xb')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa2c('0xc'),'collate':_0xfa2c('0xd')});}; \ No newline at end of file +var _0xf0cc=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','api','request-promise','path'];(function(_0xb1f8d9,_0x595b62){var _0x1c72da=function(_0x511a0c){while(--_0x511a0c){_0xb1f8d9['push'](_0xb1f8d9['shift']());}};_0x1c72da(++_0x595b62);}(_0xf0cc,0xa7));var _0xcf0c=function(_0xe4bba1,_0x4cae3a){_0xe4bba1=_0xe4bba1-0x0;var _0x4a7fcf=_0xf0cc[_0xe4bba1];return _0x4a7fcf;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 1c00286..4691932 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 _0x12d6=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x12ca16,_0x281fd9){var _0x56fb78=function(_0x3479b2){while(--_0x3479b2){_0x12ca16['push'](_0x12ca16['shift']());}};_0x56fb78(++_0x281fd9);}(_0x12d6,0x16e));var _0x612d=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x12d6[_0x46361e];return _0x14e302;};'use strict';var _=require(_0x612d('0x0'));var util=require(_0x612d('0x1'));var moment=require(_0x612d('0x2'));var BPromise=require(_0x612d('0x3'));var rs=require(_0x612d('0x4'));var fs=require('fs');var Redis=require(_0x612d('0x5'));var db=require(_0x612d('0x6'))['db'];var utils=require(_0x612d('0x7'));var logger=require('../../config/logger')(_0x612d('0x8'));var config=require(_0x612d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x612d('0xa')][_0x612d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11f58a,_0x965f0b,_0x61c54c){return new BPromise(function(_0x391b79,_0x23f66e){return client['request'](_0x11f58a,_0x61c54c)[_0x612d('0xc')](function(_0x4d0874){logger[_0x612d('0xd')](_0x612d('0xe'),_0x965f0b,'request\x20sent');logger[_0x612d('0xf')](_0x612d('0x10'),_0x965f0b,_0x612d('0x11'),JSON[_0x612d('0x12')](_0x4d0874));if(_0x4d0874[_0x612d('0x13')]){if(_0x4d0874['error']['code']===0x1f4){logger[_0x612d('0x13')]('ChatApplication,\x20%s,\x20%s',_0x965f0b,_0x4d0874[_0x612d('0x13')][_0x612d('0x14')]);return _0x23f66e(_0x4d0874[_0x612d('0x13')]['message']);}logger[_0x612d('0x13')](_0x612d('0xe'),_0x965f0b,_0x4d0874[_0x612d('0x13')][_0x612d('0x14')]);return _0x391b79(_0x4d0874[_0x612d('0x13')]['message']);}else{logger['info'](_0x612d('0xe'),_0x965f0b,_0x612d('0x11'));_0x391b79(_0x4d0874[_0x612d('0x15')][_0x612d('0x14')]);}})[_0x612d('0x16')](function(_0x1f595d){logger[_0x612d('0x13')]('ChatApplication,\x20%s,\x20%s',_0x965f0b,_0x1f595d);_0x23f66e(_0x1f595d);});});} \ No newline at end of file +var _0x0541=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1f2314,_0x38e139){var _0x515db4=function(_0x41f99d){while(--_0x41f99d){_0x1f2314['push'](_0x1f2314['shift']());}};_0x515db4(++_0x38e139);}(_0x0541,0x155));var _0x1054=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x0541[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x1054('0x0'));var util=require(_0x1054('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1054('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1054('0x3'))['db'];var utils=require(_0x1054('0x4'));var logger=require(_0x1054('0x5'))(_0x1054('0x6'));var config=require(_0x1054('0x7'));var jayson=require(_0x1054('0x8'));var client=jayson[_0x1054('0x9')][_0x1054('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189527,_0x4dbedb,_0x4e478e){return new BPromise(function(_0x466374,_0x39217b){return client[_0x1054('0xb')](_0x189527,_0x4e478e)[_0x1054('0xc')](function(_0x26d170){logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));logger[_0x1054('0x10')](_0x1054('0x11'),_0x4dbedb,_0x1054('0xf'),JSON['stringify'](_0x26d170));if(_0x26d170['error']){if(_0x26d170[_0x1054('0x12')]['code']===0x1f4){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170['error'][_0x1054('0x13')]);return _0x39217b(_0x26d170[_0x1054('0x12')]['message']);}logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);return _0x466374(_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);}else{logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));_0x466374(_0x26d170['result'][_0x1054('0x13')]);}})[_0x1054('0x14')](function(_0x30dbe6){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x30dbe6);_0x39217b(_0x30dbe6);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index aae2e9b..3d9d525 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 _0x6e15=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','show','put','isAuthenticated','update','delete'];(function(_0x303deb,_0x48fb44){var _0x12dba5=function(_0x2ff8dd){while(--_0x2ff8dd){_0x303deb['push'](_0x303deb['shift']());}};_0x12dba5(++_0x48fb44);}(_0x6e15,0x1d6));var _0x56e1=function(_0x3d4674,_0x2734af){_0x3d4674=_0x3d4674-0x0;var _0x3a3070=_0x6e15[_0x3d4674];return _0x3a3070;};'use strict';var multer=require(_0x56e1('0x0'));var util=require('util');var path=require(_0x56e1('0x1'));var timeout=require(_0x56e1('0x2'));var express=require(_0x56e1('0x3'));var router=express[_0x56e1('0x4')]();var fs_extra=require(_0x56e1('0x5'));var auth=require(_0x56e1('0x6'));var interaction=require(_0x56e1('0x7'));var config=require(_0x56e1('0x8'));var controller=require(_0x56e1('0x9'));router['get'](_0x56e1('0xa'),auth['isAuthenticated'](),controller[_0x56e1('0xb')]);router[_0x56e1('0xc')](_0x56e1('0xa'),auth[_0x56e1('0xd')](),controller[_0x56e1('0xe')]);router[_0x56e1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x56e1('0x10')]);module[_0x56e1('0x11')]=router; \ No newline at end of file +var _0xfdf2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x29887d,_0x36d8e9){var _0xe5a96a=function(_0x845060){while(--_0x845060){_0x29887d['push'](_0x29887d['shift']());}};_0xe5a96a(++_0x36d8e9);}(_0xfdf2,0x1aa));var _0x2fdf=function(_0x3b194f,_0x4b5a3e){_0x3b194f=_0x3b194f-0x0;var _0x1dce17=_0xfdf2[_0x3b194f];return _0x1dce17;};'use strict';var multer=require('multer');var util=require(_0x2fdf('0x0'));var path=require(_0x2fdf('0x1'));var timeout=require(_0x2fdf('0x2'));var express=require(_0x2fdf('0x3'));var router=express[_0x2fdf('0x4')]();var fs_extra=require(_0x2fdf('0x5'));var auth=require(_0x2fdf('0x6'));var interaction=require(_0x2fdf('0x7'));var config=require(_0x2fdf('0x8'));var controller=require('./chatApplication.controller');router[_0x2fdf('0x9')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xb')]);router[_0x2fdf('0xc')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xd')]);router[_0x2fdf('0xe')](_0x2fdf('0xf'),auth[_0x2fdf('0xa')](),controller[_0x2fdf('0x10')]);module[_0x2fdf('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 6e25b26..7a49579 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 _0xc23e=['STRING','BOOLEAN','exports'];(function(_0x337216,_0x4184e2){var _0x113fdb=function(_0x34e656){while(--_0x34e656){_0x337216['push'](_0x337216['shift']());}};_0x113fdb(++_0x4184e2);}(_0xc23e,0x68));var _0xec23=function(_0x312e2d,_0x1e5162){_0x312e2d=_0x312e2d-0x0;var _0x3cfc1a=_0xc23e[_0x312e2d];return _0x3cfc1a;};'use strict';var Sequelize=require('sequelize');module[_0xec23('0x0')]={'name':{'type':Sequelize[_0xec23('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xec23('0x1')]},'write':{'type':Sequelize[_0xec23('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xafec=['STRING','BOOLEAN','exports'];(function(_0x1c5042,_0x1ff338){var _0x20aa36=function(_0x4f97e8){while(--_0x4f97e8){_0x1c5042['push'](_0x1c5042['shift']());}};_0x20aa36(++_0x1ff338);}(_0xafec,0x161));var _0xcafe=function(_0xf0abc0,_0x3d3cdc){_0xf0abc0=_0xf0abc0-0x0;var _0x29fd55=_0xafec[_0xf0abc0];return _0x29fd55;};'use strict';var Sequelize=require('sequelize');module[_0xcafe('0x0')]={'name':{'type':Sequelize[_0xcafe('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcafe('0x1')]},'write':{'type':Sequelize[_0xcafe('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 920866f..35f7caa 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 _0xc320=['findOne','User','order','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers'];(function(_0x6adc7e,_0x268c4d){var _0x46234a=function(_0x553cb5){while(--_0x553cb5){_0x6adc7e['push'](_0x6adc7e['shift']());}};_0x46234a(++_0x268c4d);}(_0xc320,0x12e));var _0x0c32=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xc320[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0x0c32('0x0'));var rimraf=require(_0x0c32('0x1'));var zipdir=require(_0x0c32('0x2'));var jsonpatch=require(_0x0c32('0x3'));var rp=require(_0x0c32('0x4'));var moment=require('moment');var BPromise=require(_0x0c32('0x5'));var Mustache=require('mustache');var util=require(_0x0c32('0x6'));var path=require(_0x0c32('0x7'));var sox=require(_0x0c32('0x8'));var csv=require(_0x0c32('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c32('0xa'));var _=require('lodash');var squel=require(_0x0c32('0xb'));var crypto=require('crypto');var jsforce=require(_0x0c32('0xc'));var deskjs=require(_0x0c32('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c32('0xe'));var Redis=require(_0x0c32('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c32('0x10'));var logger=require(_0x0c32('0x11'))(_0x0c32('0x12'));var utils=require(_0x0c32('0x13'));var config=require(_0x0c32('0x14'));var licenseUtil=require(_0x0c32('0x15'));var db=require(_0x0c32('0x16'))['db'];config[_0x0c32('0x17')]=_[_0x0c32('0x18')](config[_0x0c32('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c32('0x17')]));require(_0x0c32('0x19'))[_0x0c32('0x1a')](socket);function respondWithStatusCode(_0x17ce46,_0x1702b3){_0x1702b3=_0x1702b3||0xcc;return function(_0x4d784b){if(_0x4d784b){return _0x17ce46[_0x0c32('0x1b')](_0x1702b3);}return _0x17ce46[_0x0c32('0x1c')](_0x1702b3)[_0x0c32('0x1d')]();};}function respondWithResult(_0x489ce9,_0x454b4d){_0x454b4d=_0x454b4d||0xc8;return function(_0x455bc8){if(_0x455bc8){return _0x489ce9[_0x0c32('0x1c')](_0x454b4d)[_0x0c32('0x1e')](_0x455bc8);}};}function respondWithFilteredResult(_0x36385d,_0xb5a351){return function(_0x8109b3){if(_0x8109b3){var _0x2a33de=typeof _0xb5a351[_0x0c32('0x1f')]===_0x0c32('0x20')&&typeof _0xb5a351[_0x0c32('0x21')]===_0x0c32('0x20');var _0x5c5926=_0x8109b3[_0x0c32('0x22')];var _0x1ef731=_0x2a33de?0x0:_0xb5a351[_0x0c32('0x1f')];var _0x286846=_0x2a33de?_0x8109b3[_0x0c32('0x22')]:_0xb5a351[_0x0c32('0x1f')]+_0xb5a351[_0x0c32('0x21')];var _0x26cbcb;if(_0x286846>=_0x5c5926){_0x286846=_0x5c5926;_0x26cbcb=0xc8;}else{_0x26cbcb=0xce;}_0x36385d[_0x0c32('0x1c')](_0x26cbcb);return _0x36385d[_0x0c32('0x23')](_0x0c32('0x24'),_0x1ef731+'-'+_0x286846+'/'+_0x5c5926)[_0x0c32('0x1e')](_0x8109b3);}return null;};}function patchUpdates(_0x2f6d3f){return function(_0x767bcf){try{jsonpatch[_0x0c32('0x25')](_0x767bcf,_0x2f6d3f,!![]);}catch(_0x4487a2){return BPromise['reject'](_0x4487a2);}return _0x767bcf[_0x0c32('0x26')]();};}function saveUpdates(_0x754249,_0x4376f6){return function(_0x535e2e){if(_0x535e2e){return _0x535e2e[_0x0c32('0x27')](_0x754249)[_0x0c32('0x28')](function(_0x2b9fa5){return _0x2b9fa5;});}return null;};}function removeEntity(_0x5d3eb7,_0x3aa679){return function(_0x2b2997){if(_0x2b2997){return _0x2b2997[_0x0c32('0x29')]()['then'](function(){_0x5d3eb7['status'](0xcc)[_0x0c32('0x1d')]();});}};}function handleEntityNotFound(_0x518e93,_0x5dca0d){return function(_0x26aa15){if(!_0x26aa15){_0x518e93['sendStatus'](0x194);}return _0x26aa15;};}function handleError(_0x4206f7,_0x2acdcc){_0x2acdcc=_0x2acdcc||0x1f4;return function(_0x56bfe2){logger[_0x0c32('0x2a')](_0x56bfe2[_0x0c32('0x2b')]);if(_0x56bfe2['name']){delete _0x56bfe2[_0x0c32('0x2c')];}_0x4206f7[_0x0c32('0x1c')](_0x2acdcc)[_0x0c32('0x2d')](_0x56bfe2);};}exports[_0x0c32('0x2e')]=function(_0x22b29b,_0x2a9ff6){var _0x47f6d2={},_0x224b38={},_0x58f899={'count':0x0,'rows':[]};var _0x246801=_['map'](db[_0x0c32('0x2f')][_0x0c32('0x30')],function(_0x250307){return{'name':_0x250307[_0x0c32('0x31')],'type':_0x250307[_0x0c32('0x32')]['key']};});_0x224b38['model']=_[_0x0c32('0x33')](_0x246801,'name');_0x224b38[_0x0c32('0x34')]=_[_0x0c32('0x35')](_0x22b29b[_0x0c32('0x34')]);_0x224b38['filters']=_[_0x0c32('0x36')](_0x224b38[_0x0c32('0x37')],_0x224b38[_0x0c32('0x34')]);_0x47f6d2[_0x0c32('0x38')]=_['intersection'](_0x224b38[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0x22b29b[_0x0c32('0x34')][_0x0c32('0x39')]));_0x47f6d2[_0x0c32('0x38')]=_0x47f6d2['attributes'][_0x0c32('0x3a')]?_0x47f6d2[_0x0c32('0x38')]:_0x224b38[_0x0c32('0x37')];if(!_0x22b29b[_0x0c32('0x34')][_0x0c32('0x3b')](_0x0c32('0x3c'))){_0x47f6d2['limit']=qs[_0x0c32('0x21')](_0x22b29b[_0x0c32('0x34')]['limit']);_0x47f6d2[_0x0c32('0x1f')]=qs[_0x0c32('0x1f')](_0x22b29b[_0x0c32('0x34')][_0x0c32('0x1f')]);}_0x47f6d2['order']=qs[_0x0c32('0x3d')](_0x22b29b['query'][_0x0c32('0x3d')]);_0x47f6d2[_0x0c32('0x3e')]=qs['filters'](_[_0x0c32('0x3f')](_0x22b29b[_0x0c32('0x34')],_0x224b38[_0x0c32('0x40')]),_0x246801);if(_0x22b29b[_0x0c32('0x34')]['filter']){_0x47f6d2[_0x0c32('0x3e')]=_[_0x0c32('0x41')](_0x47f6d2[_0x0c32('0x3e')],{'$or':_[_0x0c32('0x33')](_0x246801,function(_0x2738c8){if(_0x2738c8[_0x0c32('0x32')]!==_0x0c32('0x42')){var _0x56b2d0={};_0x56b2d0[_0x2738c8[_0x0c32('0x2c')]]={'$like':'%'+_0x22b29b[_0x0c32('0x34')][_0x0c32('0x43')]+'%'};return _0x56b2d0;}})});}_0x47f6d2=_[_0x0c32('0x41')]({},_0x47f6d2,_0x22b29b[_0x0c32('0x44')]);var _0x317b1e={'where':_0x47f6d2['where']};return db['ChatGroup']['count'](_0x317b1e)[_0x0c32('0x28')](function(_0x595dff){_0x58f899[_0x0c32('0x22')]=_0x595dff;if(_0x22b29b[_0x0c32('0x34')][_0x0c32('0x45')]){_0x47f6d2[_0x0c32('0x46')]=[{'all':!![]}];}return db[_0x0c32('0x2f')][_0x0c32('0x47')](_0x47f6d2);})[_0x0c32('0x28')](function(_0x3e43a9){_0x58f899[_0x0c32('0x48')]=_0x3e43a9;return _0x58f899;})[_0x0c32('0x28')](respondWithFilteredResult(_0x2a9ff6,_0x47f6d2))[_0x0c32('0x49')](handleError(_0x2a9ff6,null));};exports[_0x0c32('0x4a')]=function(_0x2b9d47,_0x3a527c){var _0x276db1={'raw':!![],'where':{'id':_0x2b9d47[_0x0c32('0x4b')]['id']}},_0x381332={};_0x381332[_0x0c32('0x37')]=_[_0x0c32('0x35')](db[_0x0c32('0x2f')][_0x0c32('0x30')]);_0x381332[_0x0c32('0x34')]=_[_0x0c32('0x35')](_0x2b9d47[_0x0c32('0x34')]);_0x381332[_0x0c32('0x40')]=_[_0x0c32('0x36')](_0x381332[_0x0c32('0x37')],_0x381332['query']);_0x276db1[_0x0c32('0x38')]=_[_0x0c32('0x36')](_0x381332[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0x2b9d47['query'][_0x0c32('0x39')]));_0x276db1[_0x0c32('0x38')]=_0x276db1[_0x0c32('0x38')]['length']?_0x276db1[_0x0c32('0x38')]:_0x381332[_0x0c32('0x37')];if(_0x2b9d47['query'][_0x0c32('0x45')]){_0x276db1['include']=[{'all':!![]}];}_0x276db1=_['merge']({},_0x276db1,_0x2b9d47[_0x0c32('0x44')]);return db[_0x0c32('0x2f')]['find'](_0x276db1)[_0x0c32('0x28')](handleEntityNotFound(_0x3a527c,null))['then'](respondWithResult(_0x3a527c,null))[_0x0c32('0x49')](handleError(_0x3a527c,null));};exports[_0x0c32('0x4c')]=function(_0x5d02f0,_0x3e9ac8){return db[_0x0c32('0x2f')]['create'](_0x5d02f0[_0x0c32('0x4d')],{})[_0x0c32('0x28')](respondWithResult(_0x3e9ac8,0xc9))[_0x0c32('0x49')](handleError(_0x3e9ac8,null));};exports[_0x0c32('0x27')]=function(_0x478a48,_0x410b5e){if(_0x478a48['body']['id']){delete _0x478a48[_0x0c32('0x4d')]['id'];}return db[_0x0c32('0x2f')][_0x0c32('0x4e')]({'where':{'id':_0x478a48[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x410b5e,null))[_0x0c32('0x28')](saveUpdates(_0x478a48[_0x0c32('0x4d')],null))[_0x0c32('0x28')](respondWithResult(_0x410b5e,null))['catch'](handleError(_0x410b5e,null));};exports[_0x0c32('0x29')]=function(_0x179521,_0x12e0ff){return db[_0x0c32('0x2f')]['find']({'where':{'id':_0x179521[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x12e0ff,null))[_0x0c32('0x28')](removeEntity(_0x12e0ff,null))['catch'](handleError(_0x12e0ff,null));};exports['describe']=function(_0x3a94d8,_0x49cf03){return db[_0x0c32('0x2f')][_0x0c32('0x4f')]()['then'](respondWithResult(_0x49cf03,null))[_0x0c32('0x49')](handleError(_0x49cf03,null));};exports['getUnread']=function(_0x55f322,_0x4a695b,_0x4a709){return db[_0x0c32('0x50')][_0x0c32('0x22')]({'where':{'ChatGroupId':_0x55f322[_0x0c32('0x4b')]['id'],'ToId':_0x55f322[_0x0c32('0x51')]['id'],'read':![]}})['then'](function(_0x7bf34d){return{'id':_[_0x0c32('0x52')](_0x55f322['params']['id']),'count':_0x7bf34d};})[_0x0c32('0x28')](respondWithResult(_0x4a695b,null))[_0x0c32('0x49')](handleError(_0x4a695b,null));};exports['addMembers']=function(_0x46c6bb,_0x2adfb5,_0x4422b0){return db[_0x0c32('0x2f')][_0x0c32('0x4e')]({'where':{'id':_0x46c6bb[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x2adfb5,null))['then'](function(_0x5d323b){if(_0x5d323b){return _0x5d323b[_0x0c32('0x53')](_0x46c6bb['body'][_0x0c32('0x54')],_['omit'](_0x46c6bb['body'],[_0x0c32('0x54'),'id'])||{});}})[_0x0c32('0x28')](respondWithResult(_0x2adfb5,null))['catch'](handleError(_0x2adfb5,null));};exports[_0x0c32('0x55')]=function(_0xc88af4,_0x53a3b4,_0x18b8ea){var _0x11048b={};var _0x2797e4={};var _0x29b80f;var _0x4bacc5;return db[_0x0c32('0x2f')][_0x0c32('0x56')]({'where':{'id':_0xc88af4[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x53a3b4,null))[_0x0c32('0x28')](function(_0xd03317){if(_0xd03317){_0x29b80f=_0xd03317;_0x2797e4['model']=_['keys'](db[_0x0c32('0x57')]['rawAttributes']);_0x2797e4['query']=_[_0x0c32('0x35')](_0xc88af4['query']);_0x2797e4[_0x0c32('0x40')]=_[_0x0c32('0x36')](_0x2797e4['model'],_0x2797e4['query']);_0x11048b[_0x0c32('0x38')]=_[_0x0c32('0x36')](_0x2797e4[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0xc88af4[_0x0c32('0x34')][_0x0c32('0x39')]));_0x11048b[_0x0c32('0x38')]=_0x11048b[_0x0c32('0x38')]['length']?_0x11048b[_0x0c32('0x38')]:_0x2797e4[_0x0c32('0x37')];_0x11048b[_0x0c32('0x58')]=qs['sort'](_0xc88af4['query'][_0x0c32('0x3d')]);_0x11048b[_0x0c32('0x3e')]=qs[_0x0c32('0x40')](_[_0x0c32('0x3f')](_0xc88af4[_0x0c32('0x34')],_0x2797e4[_0x0c32('0x40')]));if(_0xc88af4[_0x0c32('0x34')]['filter']){_0x11048b[_0x0c32('0x3e')]=_[_0x0c32('0x41')](_0x11048b['where'],{'$or':_[_0x0c32('0x33')](_0x11048b[_0x0c32('0x38')],function(_0x3c69ed){var _0x43f3a6={};_0x43f3a6[_0x3c69ed]={'$like':'%'+_0xc88af4[_0x0c32('0x34')]['filter']+'%'};return _0x43f3a6;})});}_0x11048b=_['merge']({},_0x11048b,_0xc88af4[_0x0c32('0x44')]);return _0x29b80f[_0x0c32('0x55')](_0x11048b);}})['then'](function(_0x475ab4){if(_0x475ab4){_0x4bacc5=_0x475ab4[_0x0c32('0x3a')];if(!_0xc88af4['query'][_0x0c32('0x3b')](_0x0c32('0x3c'))){_0x11048b[_0x0c32('0x21')]=qs[_0x0c32('0x21')](_0xc88af4[_0x0c32('0x34')]['limit']);_0x11048b[_0x0c32('0x1f')]=qs[_0x0c32('0x1f')](_0xc88af4[_0x0c32('0x34')][_0x0c32('0x1f')]);}return _0x29b80f[_0x0c32('0x55')](_0x11048b);}})[_0x0c32('0x28')](function(_0x2decc7){if(_0x2decc7){return _0x2decc7?{'count':_0x4bacc5,'rows':_0x2decc7}:null;}})['then'](respondWithResult(_0x53a3b4,null))[_0x0c32('0x49')](handleError(_0x53a3b4,null));};exports['removeMembers']=function(_0x204089,_0x26f319,_0x7e51a6){return db['ChatGroup'][_0x0c32('0x4e')]({'where':{'id':_0x204089[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x26f319,null))[_0x0c32('0x28')](function(_0x100474){if(_0x100474){return _0x100474[_0x0c32('0x59')](_0x204089[_0x0c32('0x34')][_0x0c32('0x54')]);}})[_0x0c32('0x28')](respondWithStatusCode(_0x26f319,null))['catch'](handleError(_0x26f319,null));};exports[_0x0c32('0x5a')]=function(_0x16d7a7,_0x4d9560,_0x1aa3d9){if(_0x16d7a7[_0x0c32('0x4d')]['id']){delete _0x16d7a7[_0x0c32('0x4d')]['id'];}return db[_0x0c32('0x2f')]['find']({'where':{'id':_0x16d7a7[_0x0c32('0x4b')]['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x4d9560,null))[_0x0c32('0x28')](function(_0x141f6e){if(_0x141f6e){_0x16d7a7['body'][_0x0c32('0x5b')]=_0x141f6e['id'];return db['ChatInternalMessage'][_0x0c32('0x4c')](_0x16d7a7[_0x0c32('0x4d')]);}})[_0x0c32('0x28')](respondWithResult(_0x4d9560,null))[_0x0c32('0x49')](handleError(_0x4d9560,null));};exports[_0x0c32('0x5c')]=function(_0x1a3f55,_0x39e04e,_0x3f77ce){var _0x3cff58={};var _0x21b898={};var _0x57be18;var _0x2d1e26;return db[_0x0c32('0x2f')][_0x0c32('0x56')]({'where':{'id':_0x1a3f55['params']['id']}})[_0x0c32('0x28')](handleEntityNotFound(_0x39e04e,null))[_0x0c32('0x28')](function(_0x22a127){if(_0x22a127){_0x57be18=_0x22a127;_0x21b898[_0x0c32('0x37')]=_['keys'](db[_0x0c32('0x50')][_0x0c32('0x30')]);_0x21b898['query']=_['keys'](_0x1a3f55[_0x0c32('0x34')]);_0x21b898['filters']=_['intersection'](_0x21b898[_0x0c32('0x37')],_0x21b898[_0x0c32('0x34')]);_0x3cff58['attributes']=_[_0x0c32('0x36')](_0x21b898[_0x0c32('0x37')],qs[_0x0c32('0x39')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x39')]));_0x3cff58[_0x0c32('0x38')]=_0x3cff58[_0x0c32('0x38')][_0x0c32('0x3a')]?_0x3cff58[_0x0c32('0x38')]:_0x21b898[_0x0c32('0x37')];_0x3cff58['order']=qs[_0x0c32('0x3d')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x3d')]);_0x3cff58[_0x0c32('0x3e')]=qs['filters'](_[_0x0c32('0x3f')](_0x1a3f55[_0x0c32('0x34')],_0x21b898[_0x0c32('0x40')]));if(_0x1a3f55['query']['filter']){_0x3cff58['where']=_[_0x0c32('0x41')](_0x3cff58[_0x0c32('0x3e')],{'$or':_[_0x0c32('0x33')](_0x3cff58[_0x0c32('0x38')],function(_0x367cb5){var _0x4ed609={};_0x4ed609[_0x367cb5]={'$like':'%'+_0x1a3f55[_0x0c32('0x34')]['filter']+'%'};return _0x4ed609;})});}if(_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x5d')]){var _0x315207=_0x1a3f55['query']['$gte'][_0x0c32('0x5e')](',');var _0x317d9d={};_0x317d9d[_0x315207[0x0]]={'$gte':moment(_0x315207[0x1])[_0x0c32('0x5f')](_0x0c32('0x60'))};_0x3cff58[_0x0c32('0x3e')]=_['merge'](_0x3cff58['where'],_0x317d9d);}_0x3cff58=_['merge']({},_0x3cff58,_0x1a3f55[_0x0c32('0x44')]);return _0x57be18[_0x0c32('0x5c')](_0x3cff58);}})[_0x0c32('0x28')](function(_0x3304b1){if(_0x3304b1){_0x2d1e26=_0x3304b1['length'];if(!_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x3b')]('nolimit')){_0x3cff58[_0x0c32('0x21')]=qs[_0x0c32('0x21')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x21')]);_0x3cff58[_0x0c32('0x1f')]=qs[_0x0c32('0x1f')](_0x1a3f55[_0x0c32('0x34')][_0x0c32('0x1f')]);}return _0x57be18[_0x0c32('0x5c')](_0x3cff58);}})[_0x0c32('0x28')](function(_0x3dc57c){if(_0x3dc57c){return _0x3dc57c?{'count':_0x2d1e26,'rows':_0x3dc57c}:null;}})[_0x0c32('0x28')](respondWithResult(_0x39e04e,null))[_0x0c32('0x49')](handleError(_0x39e04e,null));}; \ No newline at end of file +var _0x793f=['jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','save','update','then','error','stack','name','send','ChatGroup','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','model','length','include','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto'];(function(_0x590861,_0x42c7f3){var _0x1d0a80=function(_0x42d3de){while(--_0x42d3de){_0x590861['push'](_0x590861['shift']());}};_0x1d0a80(++_0x42c7f3);}(_0x793f,0x15a));var _0xf793=function(_0x257c53,_0x2cddf8){_0x257c53=_0x257c53-0x0;var _0x6f5365=_0x793f[_0x257c53];return _0x6f5365;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf793('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf793('0x1'));var rp=require(_0xf793('0x2'));var moment=require('moment');var BPromise=require(_0xf793('0x3'));var Mustache=require('mustache');var util=require(_0xf793('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf793('0x5'));var ejs=require(_0xf793('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf793('0x7'));var squel=require(_0xf793('0x8'));var crypto=require(_0xf793('0x9'));var jsforce=require(_0xf793('0xa'));var deskjs=require(_0xf793('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf793('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf793('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf793('0xe'));var logger=require('../../config/logger')(_0xf793('0xf'));var utils=require('../../config/utils');var config=require(_0xf793('0x10'));var licenseUtil=require(_0xf793('0x11'));var db=require(_0xf793('0x12'))['db'];config['redis']=_['defaults'](config[_0xf793('0x13')],{'host':_0xf793('0x14'),'port':0x18eb});var socket=require(_0xf793('0x15'))(new Redis(config[_0xf793('0x13')]));require('./chatGroup.socket')[_0xf793('0x16')](socket);function respondWithStatusCode(_0x43859c,_0x24c62f){_0x24c62f=_0x24c62f||0xcc;return function(_0x23ba38){if(_0x23ba38){return _0x43859c[_0xf793('0x17')](_0x24c62f);}return _0x43859c['status'](_0x24c62f)[_0xf793('0x18')]();};}function respondWithResult(_0x583148,_0x114925){_0x114925=_0x114925||0xc8;return function(_0x4b8f58){if(_0x4b8f58){return _0x583148['status'](_0x114925)['json'](_0x4b8f58);}};}function respondWithFilteredResult(_0x19bc06,_0x54188a){return function(_0x22335a){if(_0x22335a){var _0x31d5e1=typeof _0x54188a[_0xf793('0x19')]===_0xf793('0x1a')&&typeof _0x54188a[_0xf793('0x1b')]==='undefined';var _0x3bc25b=_0x22335a[_0xf793('0x1c')];var _0x1ed3a2=_0x31d5e1?0x0:_0x54188a['offset'];var _0x536eda=_0x31d5e1?_0x22335a[_0xf793('0x1c')]:_0x54188a[_0xf793('0x19')]+_0x54188a[_0xf793('0x1b')];var _0x552fbb;if(_0x536eda>=_0x3bc25b){_0x536eda=_0x3bc25b;_0x552fbb=0xc8;}else{_0x552fbb=0xce;}_0x19bc06[_0xf793('0x1d')](_0x552fbb);return _0x19bc06['set'](_0xf793('0x1e'),_0x1ed3a2+'-'+_0x536eda+'/'+_0x3bc25b)[_0xf793('0x1f')](_0x22335a);}return null;};}function patchUpdates(_0x41cfc7){return function(_0x59cd26){try{jsonpatch['apply'](_0x59cd26,_0x41cfc7,!![]);}catch(_0x571c46){return BPromise['reject'](_0x571c46);}return _0x59cd26[_0xf793('0x20')]();};}function saveUpdates(_0x450e39,_0x4be66b){return function(_0x20210d){if(_0x20210d){return _0x20210d[_0xf793('0x21')](_0x450e39)['then'](function(_0x53dbd6){return _0x53dbd6;});}return null;};}function removeEntity(_0x682f1b,_0x2806f9){return function(_0x4d7193){if(_0x4d7193){return _0x4d7193['destroy']()[_0xf793('0x22')](function(){_0x682f1b[_0xf793('0x1d')](0xcc)[_0xf793('0x18')]();});}};}function handleEntityNotFound(_0x2658d6,_0x30808a){return function(_0x5a332b){if(!_0x5a332b){_0x2658d6[_0xf793('0x17')](0x194);}return _0x5a332b;};}function handleError(_0x2135f2,_0x23d344){_0x23d344=_0x23d344||0x1f4;return function(_0x221e3a){logger[_0xf793('0x23')](_0x221e3a[_0xf793('0x24')]);if(_0x221e3a['name']){delete _0x221e3a[_0xf793('0x25')];}_0x2135f2[_0xf793('0x1d')](_0x23d344)[_0xf793('0x26')](_0x221e3a);};}exports['index']=function(_0x1b0fec,_0x1f038f){var _0x5c5180={},_0x3dbc29={},_0xa5fd34={'count':0x0,'rows':[]};var _0x9698a0=_['map'](db[_0xf793('0x27')][_0xf793('0x28')],function(_0x4423cc){return{'name':_0x4423cc[_0xf793('0x29')],'type':_0x4423cc[_0xf793('0x2a')][_0xf793('0x2b')]};});_0x3dbc29['model']=_[_0xf793('0x2c')](_0x9698a0,_0xf793('0x25'));_0x3dbc29[_0xf793('0x2d')]=_[_0xf793('0x2e')](_0x1b0fec[_0xf793('0x2d')]);_0x3dbc29[_0xf793('0x2f')]=_['intersection'](_0x3dbc29['model'],_0x3dbc29[_0xf793('0x2d')]);_0x5c5180[_0xf793('0x30')]=_[_0xf793('0x31')](_0x3dbc29['model'],qs['fields'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x32')]));_0x5c5180[_0xf793('0x30')]=_0x5c5180[_0xf793('0x30')]['length']?_0x5c5180['attributes']:_0x3dbc29['model'];if(!_0x1b0fec[_0xf793('0x2d')]['hasOwnProperty'](_0xf793('0x33'))){_0x5c5180[_0xf793('0x1b')]=qs[_0xf793('0x1b')](_0x1b0fec['query'][_0xf793('0x1b')]);_0x5c5180[_0xf793('0x19')]=qs['offset'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x19')]);}_0x5c5180['order']=qs[_0xf793('0x34')](_0x1b0fec['query'][_0xf793('0x34')]);_0x5c5180[_0xf793('0x35')]=qs['filters'](_[_0xf793('0x36')](_0x1b0fec[_0xf793('0x2d')],_0x3dbc29[_0xf793('0x2f')]),_0x9698a0);if(_0x1b0fec['query'][_0xf793('0x37')]){_0x5c5180[_0xf793('0x35')]=_[_0xf793('0x38')](_0x5c5180[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0x9698a0,function(_0x2ac7e6){if(_0x2ac7e6['type']!==_0xf793('0x39')){var _0x2c558e={};_0x2c558e[_0x2ac7e6[_0xf793('0x25')]]={'$like':'%'+_0x1b0fec[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x2c558e;}})});}_0x5c5180=_[_0xf793('0x38')]({},_0x5c5180,_0x1b0fec[_0xf793('0x3a')]);var _0x44daf7={'where':_0x5c5180['where']};return db[_0xf793('0x27')][_0xf793('0x1c')](_0x44daf7)[_0xf793('0x22')](function(_0x4ae4b6){_0xa5fd34[_0xf793('0x1c')]=_0x4ae4b6;if(_0x1b0fec[_0xf793('0x2d')][_0xf793('0x3b')]){_0x5c5180['include']=[{'all':!![]}];}return db[_0xf793('0x27')]['findAll'](_0x5c5180);})[_0xf793('0x22')](function(_0x4ee1af){_0xa5fd34[_0xf793('0x3c')]=_0x4ee1af;return _0xa5fd34;})[_0xf793('0x22')](respondWithFilteredResult(_0x1f038f,_0x5c5180))['catch'](handleError(_0x1f038f,null));};exports[_0xf793('0x3d')]=function(_0x4a6f50,_0x29c5d5){var _0x5680de={'raw':!![],'where':{'id':_0x4a6f50[_0xf793('0x3e')]['id']}},_0x13a4e6={};_0x13a4e6[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x27')][_0xf793('0x28')]);_0x13a4e6[_0xf793('0x2d')]=_['keys'](_0x4a6f50['query']);_0x13a4e6['filters']=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],_0x13a4e6['query']);_0x5680de[_0xf793('0x30')]=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x4a6f50['query']['fields']));_0x5680de['attributes']=_0x5680de[_0xf793('0x30')][_0xf793('0x40')]?_0x5680de[_0xf793('0x30')]:_0x13a4e6[_0xf793('0x3f')];if(_0x4a6f50[_0xf793('0x2d')]['includeAll']){_0x5680de[_0xf793('0x41')]=[{'all':!![]}];}_0x5680de=_[_0xf793('0x38')]({},_0x5680de,_0x4a6f50[_0xf793('0x3a')]);return db[_0xf793('0x27')][_0xf793('0x42')](_0x5680de)['then'](handleEntityNotFound(_0x29c5d5,null))[_0xf793('0x22')](respondWithResult(_0x29c5d5,null))[_0xf793('0x43')](handleError(_0x29c5d5,null));};exports['create']=function(_0x57fe6d,_0x22ae8e){return db[_0xf793('0x27')][_0xf793('0x44')](_0x57fe6d[_0xf793('0x45')],{})[_0xf793('0x22')](respondWithResult(_0x22ae8e,0xc9))[_0xf793('0x43')](handleError(_0x22ae8e,null));};exports[_0xf793('0x21')]=function(_0x11be05,_0x279d9d){if(_0x11be05['body']['id']){delete _0x11be05[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x11be05[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x279d9d,null))[_0xf793('0x22')](saveUpdates(_0x11be05['body'],null))[_0xf793('0x22')](respondWithResult(_0x279d9d,null))[_0xf793('0x43')](handleError(_0x279d9d,null));};exports[_0xf793('0x46')]=function(_0x515caf,_0x2c408e){return db['ChatGroup'][_0xf793('0x42')]({'where':{'id':_0x515caf[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x2c408e,null))[_0xf793('0x22')](removeEntity(_0x2c408e,null))[_0xf793('0x43')](handleError(_0x2c408e,null));};exports[_0xf793('0x47')]=function(_0x316f20,_0x35e024){return db[_0xf793('0x27')]['describe']()[_0xf793('0x22')](respondWithResult(_0x35e024,null))[_0xf793('0x43')](handleError(_0x35e024,null));};exports[_0xf793('0x48')]=function(_0x5d9a42,_0x31aecf,_0x495379){return db[_0xf793('0x49')]['count']({'where':{'ChatGroupId':_0x5d9a42[_0xf793('0x3e')]['id'],'ToId':_0x5d9a42[_0xf793('0x4a')]['id'],'read':![]}})[_0xf793('0x22')](function(_0x5eb283){return{'id':_[_0xf793('0x4b')](_0x5d9a42[_0xf793('0x3e')]['id']),'count':_0x5eb283};})[_0xf793('0x22')](respondWithResult(_0x31aecf,null))[_0xf793('0x43')](handleError(_0x31aecf,null));};exports[_0xf793('0x4c')]=function(_0x101876,_0x333e54,_0x63b614){return db[_0xf793('0x27')]['find']({'where':{'id':_0x101876[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x333e54,null))[_0xf793('0x22')](function(_0x3d0e06){if(_0x3d0e06){return _0x3d0e06['addMembers'](_0x101876['body']['ids'],_[_0xf793('0x4d')](_0x101876['body'],[_0xf793('0x4e'),'id'])||{});}})[_0xf793('0x22')](respondWithResult(_0x333e54,null))[_0xf793('0x43')](handleError(_0x333e54,null));};exports[_0xf793('0x4f')]=function(_0x36a031,_0x4c5734,_0x43e446){var _0xeeacd9={};var _0x458774={};var _0x54de26;var _0x2c42f8;return db[_0xf793('0x27')][_0xf793('0x50')]({'where':{'id':_0x36a031[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x4c5734,null))[_0xf793('0x22')](function(_0x4585dd){if(_0x4585dd){_0x54de26=_0x4585dd;_0x458774[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x51')][_0xf793('0x28')]);_0x458774[_0xf793('0x2d')]=_['keys'](_0x36a031[_0xf793('0x2d')]);_0x458774[_0xf793('0x2f')]=_['intersection'](_0x458774['model'],_0x458774[_0xf793('0x2d')]);_0xeeacd9[_0xf793('0x30')]=_['intersection'](_0x458774[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x36a031[_0xf793('0x2d')]['fields']));_0xeeacd9['attributes']=_0xeeacd9[_0xf793('0x30')][_0xf793('0x40')]?_0xeeacd9[_0xf793('0x30')]:_0x458774[_0xf793('0x3f')];_0xeeacd9['order']=qs[_0xf793('0x34')](_0x36a031['query'][_0xf793('0x34')]);_0xeeacd9[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x36a031[_0xf793('0x2d')],_0x458774['filters']));if(_0x36a031[_0xf793('0x2d')]['filter']){_0xeeacd9['where']=_['merge'](_0xeeacd9[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0xeeacd9[_0xf793('0x30')],function(_0x1c7f76){var _0x50772c={};_0x50772c[_0x1c7f76]={'$like':'%'+_0x36a031[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x50772c;})});}_0xeeacd9=_[_0xf793('0x38')]({},_0xeeacd9,_0x36a031[_0xf793('0x3a')]);return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})[_0xf793('0x22')](function(_0x1266ed){if(_0x1266ed){_0x2c42f8=_0x1266ed[_0xf793('0x40')];if(!_0x36a031['query']['hasOwnProperty'](_0xf793('0x33'))){_0xeeacd9[_0xf793('0x1b')]=qs['limit'](_0x36a031[_0xf793('0x2d')][_0xf793('0x1b')]);_0xeeacd9[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x36a031[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})['then'](function(_0x1bc456){if(_0x1bc456){return _0x1bc456?{'count':_0x2c42f8,'rows':_0x1bc456}:null;}})[_0xf793('0x22')](respondWithResult(_0x4c5734,null))[_0xf793('0x43')](handleError(_0x4c5734,null));};exports[_0xf793('0x52')]=function(_0x2e9eb0,_0x2ccc6c,_0x28487b){return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2e9eb0[_0xf793('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2ccc6c,null))['then'](function(_0x54def8){if(_0x54def8){return _0x54def8[_0xf793('0x52')](_0x2e9eb0['query']['ids']);}})[_0xf793('0x22')](respondWithStatusCode(_0x2ccc6c,null))[_0xf793('0x43')](handleError(_0x2ccc6c,null));};exports[_0xf793('0x53')]=function(_0x2adce5,_0x30bcc1,_0x342eae){if(_0x2adce5['body']['id']){delete _0x2adce5[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2adce5[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x30bcc1,null))[_0xf793('0x22')](function(_0x2ce0b5){if(_0x2ce0b5){_0x2adce5[_0xf793('0x45')][_0xf793('0x54')]=_0x2ce0b5['id'];return db[_0xf793('0x49')][_0xf793('0x44')](_0x2adce5[_0xf793('0x45')]);}})['then'](respondWithResult(_0x30bcc1,null))[_0xf793('0x43')](handleError(_0x30bcc1,null));};exports[_0xf793('0x55')]=function(_0x43f3ad,_0x522715,_0x55e392){var _0x52fb76={};var _0x1ff0bf={};var _0x3022b1;var _0x3ba91e;return db['ChatGroup'][_0xf793('0x50')]({'where':{'id':_0x43f3ad[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x522715,null))['then'](function(_0xe40850){if(_0xe40850){_0x3022b1=_0xe40850;_0x1ff0bf[_0xf793('0x3f')]=_['keys'](db[_0xf793('0x49')][_0xf793('0x28')]);_0x1ff0bf['query']=_[_0xf793('0x2e')](_0x43f3ad[_0xf793('0x2d')]);_0x1ff0bf['filters']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],_0x1ff0bf[_0xf793('0x2d')]);_0x52fb76['attributes']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x32')]));_0x52fb76[_0xf793('0x30')]=_0x52fb76['attributes'][_0xf793('0x40')]?_0x52fb76[_0xf793('0x30')]:_0x1ff0bf[_0xf793('0x3f')];_0x52fb76['order']=qs[_0xf793('0x34')](_0x43f3ad[_0xf793('0x2d')]['sort']);_0x52fb76[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x43f3ad[_0xf793('0x2d')],_0x1ff0bf[_0xf793('0x2f')]));if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x37')]){_0x52fb76['where']=_[_0xf793('0x38')](_0x52fb76['where'],{'$or':_[_0xf793('0x2c')](_0x52fb76[_0xf793('0x30')],function(_0x111f8a){var _0x1b9193={};_0x1b9193[_0x111f8a]={'$like':'%'+_0x43f3ad[_0xf793('0x2d')]['filter']+'%'};return _0x1b9193;})});}if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')]){var _0x3d1608=_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')][_0xf793('0x57')](',');var _0x37a9da={};_0x37a9da[_0x3d1608[0x0]]={'$gte':moment(_0x3d1608[0x1])[_0xf793('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x52fb76[_0xf793('0x35')]=_[_0xf793('0x38')](_0x52fb76[_0xf793('0x35')],_0x37a9da);}_0x52fb76=_['merge']({},_0x52fb76,_0x43f3ad[_0xf793('0x3a')]);return _0x3022b1['getMessages'](_0x52fb76);}})[_0xf793('0x22')](function(_0x1cbc07){if(_0x1cbc07){_0x3ba91e=_0x1cbc07[_0xf793('0x40')];if(!_0x43f3ad[_0xf793('0x2d')]['hasOwnProperty']('nolimit')){_0x52fb76[_0xf793('0x1b')]=qs['limit'](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x1b')]);_0x52fb76[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x3022b1[_0xf793('0x55')](_0x52fb76);}})[_0xf793('0x22')](function(_0x506d0b){if(_0x506d0b){return _0x506d0b?{'count':_0x3ba91e,'rows':_0x506d0b}:null;}})[_0xf793('0x22')](respondWithResult(_0x522715,null))['catch'](handleError(_0x522715,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 09f7de0..5f8204e 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 _0xa8be=['remove','emit','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x4eb4df,_0x49715b){var _0x13bbed=function(_0x5e46c1){while(--_0x5e46c1){_0x4eb4df['push'](_0x4eb4df['shift']());}};_0x13bbed(++_0x49715b);}(_0xa8be,0x9b));var _0xea8b=function(_0x174cd4,_0x1f2196){_0x174cd4=_0x174cd4-0x0;var _0x48d5b6=_0xa8be[_0x174cd4];return _0x48d5b6;};'use strict';var EventEmitter=require(_0xea8b('0x0'));var ChatGroup=require(_0xea8b('0x1'))['db'][_0xea8b('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xea8b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea8b('0x4'),'afterDestroy':_0xea8b('0x5')};function emitEvent(_0x463f9f){return function(_0x3fba27,_0x1da649,_0x205514){ChatGroupEvents[_0xea8b('0x6')](_0x463f9f+':'+_0x3fba27['id'],_0x3fba27);ChatGroupEvents[_0xea8b('0x6')](_0x463f9f,_0x3fba27);_0x205514(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xea8b('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x6e12=['ChatGroup','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0x6e12,0x1d4));var _0x26e1=function(_0x13a14b,_0x52d0e0){_0x13a14b=_0x13a14b-0x0;var _0x6c505b=_0x6e12[_0x13a14b];return _0x6c505b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x26e1('0x0'))['db'][_0x26e1('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26e1('0x2'),'afterUpdate':_0x26e1('0x3'),'afterDestroy':_0x26e1('0x4')};function emitEvent(_0x2d8a27){return function(_0x2dba5a,_0x4aca8e,_0x5c985b){ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27+':'+_0x2dba5a['id'],_0x2dba5a);ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27,_0x2dba5a);_0x5c985b(null);};}for(var e in events){if(events[_0x26e1('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index c9d4345..3b6fb55 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 _0x40bc=['../../config/logger','moment','bluebird','request-promise','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x2257dc,_0x2c6f7b){var _0x440821=function(_0x1f67b6){while(--_0x1f67b6){_0x2257dc['push'](_0x2257dc['shift']());}};_0x440821(++_0x2c6f7b);}(_0x40bc,0xda));var _0xc40b=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x40bc[_0x1098db];return _0x14f090;};'use strict';var _=require(_0xc40b('0x0'));var util=require(_0xc40b('0x1'));var logger=require(_0xc40b('0x2'))('api');var moment=require(_0xc40b('0x3'));var BPromise=require(_0xc40b('0x4'));var rp=require(_0xc40b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xc40b('0x6')]=function(_0x3b9d4b,_0x19512f){return _0x3b9d4b[_0xc40b('0x7')](_0xc40b('0x8'),attributes,{'tableName':_0xc40b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb684=['api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','../../config/logger'];(function(_0x35588f,_0x43053e){var _0x5656e7=function(_0x473e4c){while(--_0x473e4c){_0x35588f['push'](_0x35588f['shift']());}};_0x5656e7(++_0x43053e);}(_0xb684,0x83));var _0x4b68=function(_0x553378,_0x1c2756){_0x553378=_0x553378-0x0;var _0x44caca=_0xb684[_0x553378];return _0x44caca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b68('0x0'))(_0x4b68('0x1'));var moment=require(_0x4b68('0x2'));var BPromise=require(_0x4b68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b68('0x4'));var rimraf=require(_0x4b68('0x5'));var config=require(_0x4b68('0x6'));var attributes=require(_0x4b68('0x7'));module[_0x4b68('0x8')]=function(_0x4d58b9,_0x1261d6){return _0x4d58b9['define'](_0x4b68('0x9'),attributes,{'tableName':_0x4b68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 492427a..52f4a07 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 _0x4f82=['ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','stringify','error','code'];(function(_0xd4352b,_0x5e12d3){var _0x3126a4=function(_0x3599f9){while(--_0x3599f9){_0xd4352b['push'](_0xd4352b['shift']());}};_0x3126a4(++_0x5e12d3);}(_0x4f82,0xbc));var _0x24f8=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x4f82[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x24f8('0x0'));var util=require(_0x24f8('0x1'));var moment=require('moment');var BPromise=require(_0x24f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x24f8('0x4'));var logger=require('../../config/logger')(_0x24f8('0x5'));var config=require(_0x24f8('0x6'));var jayson=require(_0x24f8('0x7'));var client=jayson[_0x24f8('0x8')]['http']({'port':0x232a});config[_0x24f8('0x9')]=_[_0x24f8('0xa')](config[_0x24f8('0x9')],{'host':_0x24f8('0xb'),'port':0x18eb});var socket=require(_0x24f8('0xc'))(new Redis(config[_0x24f8('0x9')]));require('./chatGroup.socket')[_0x24f8('0xd')](socket);function respondWithRpcPromise(_0x2b1417,_0x2d15f1,_0x302c5a){return new BPromise(function(_0x4eba51,_0x2b735e){return client['request'](_0x2b1417,_0x302c5a)['then'](function(_0x4b4e82){logger[_0x24f8('0xe')]('ChatGroup,\x20%s,\x20%s',_0x2d15f1,_0x24f8('0xf'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2d15f1,_0x24f8('0xf'),JSON[_0x24f8('0x10')](_0x4b4e82));if(_0x4b4e82[_0x24f8('0x11')]){if(_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x12')]===0x1f4){logger[_0x24f8('0x11')](_0x24f8('0x13'),_0x2d15f1,_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);return _0x2b735e(_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);}logger['error'](_0x24f8('0x13'),_0x2d15f1,_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);return _0x4eba51(_0x4b4e82[_0x24f8('0x11')][_0x24f8('0x14')]);}else{logger[_0x24f8('0xe')](_0x24f8('0x13'),_0x2d15f1,_0x24f8('0xf'));_0x4eba51(_0x4b4e82[_0x24f8('0x15')][_0x24f8('0x14')]);}})[_0x24f8('0x16')](function(_0x244af5){logger['error'](_0x24f8('0x13'),_0x2d15f1,_0x244af5);_0x2b735e(_0x244af5);});});} \ No newline at end of file +var _0xb56f=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xd76732,_0x5f4e32){var _0x342534=function(_0x10c3cb){while(--_0x10c3cb){_0xd76732['push'](_0xd76732['shift']());}};_0x342534(++_0x5f4e32);}(_0xb56f,0x113));var _0xfb56=function(_0x4aec74,_0xbecf13){_0x4aec74=_0x4aec74-0x0;var _0x19cf6d=_0xb56f[_0x4aec74];return _0x19cf6d;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var moment=require(_0xfb56('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb56('0x3'));var fs=require('fs');var Redis=require(_0xfb56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb56('0x5'));var logger=require(_0xfb56('0x6'))('rpc');var config=require(_0xfb56('0x7'));var jayson=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232a});config[_0xfb56('0xb')]=_[_0xfb56('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb56('0xd'))(new Redis(config[_0xfb56('0xb')]));require(_0xfb56('0xe'))[_0xfb56('0xf')](socket);function respondWithRpcPromise(_0x311b0e,_0x3a168f,_0x134442){return new BPromise(function(_0x5e49b3,_0x5db511){return client['request'](_0x311b0e,_0x134442)[_0xfb56('0x10')](function(_0x537d40){logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));logger[_0xfb56('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3a168f,_0xfb56('0x13'),JSON[_0xfb56('0x15')](_0x537d40));if(_0x537d40[_0xfb56('0x16')]){if(_0x537d40['error'][_0xfb56('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5db511(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}logger[_0xfb56('0x16')](_0xfb56('0x12'),_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5e49b3(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}else{logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));_0x5e49b3(_0x537d40[_0xfb56('0x19')][_0xfb56('0x18')]);}})[_0xfb56('0x1a')](function(_0x586436){logger['error'](_0xfb56('0x12'),_0x3a168f,_0x586436);_0x5db511(_0x586436);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 725b0e3..56bf1ac 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 _0x2451=['emit','removeListener','register','./chatGroup.events','save','remove','update'];(function(_0x220928,_0x5511a5){var _0x42f8fe=function(_0x2c7bec){while(--_0x2c7bec){_0x220928['push'](_0x220928['shift']());}};_0x42f8fe(++_0x5511a5);}(_0x2451,0x8f));var _0x1245=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x2451[_0x3cb3ca];return _0x214366;};'use strict';var ChatGroupEvents=require(_0x1245('0x0'));var events=[_0x1245('0x1'),_0x1245('0x2'),_0x1245('0x3')];function createListener(_0x20d3c1,_0x9eb573){return function(_0x55fc24){_0x9eb573[_0x1245('0x4')](_0x20d3c1,_0x55fc24);};}function removeListener(_0x38ab35,_0x45f412){return function(){ChatGroupEvents[_0x1245('0x5')](_0x38ab35,_0x45f412);};}exports[_0x1245('0x6')]=function(_0x1899ff){for(var _0x27a5a6=0x0,_0x5597b1=events['length'];_0x27a5a6<_0x5597b1;_0x27a5a6++){var _0x11b1b9=events[_0x27a5a6];var _0x596b38=createListener('chatGroup:'+_0x11b1b9,_0x1899ff);ChatGroupEvents['on'](_0x11b1b9,_0x596b38);}}; \ No newline at end of file +var _0x9f74=['register','length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x9f74,0x163));var _0x49f7=function(_0xa3ec8e,_0x35f872){_0xa3ec8e=_0xa3ec8e-0x0;var _0x388a9c=_0x9f74[_0xa3ec8e];return _0x388a9c;};'use strict';var ChatGroupEvents=require(_0x49f7('0x0'));var events=[_0x49f7('0x1'),_0x49f7('0x2'),'update'];function createListener(_0x3baaa0,_0x4f94d0){return function(_0x947981){_0x4f94d0[_0x49f7('0x3')](_0x3baaa0,_0x947981);};}function removeListener(_0x4f3a07,_0xb6f3d0){return function(){ChatGroupEvents[_0x49f7('0x4')](_0x4f3a07,_0xb6f3d0);};}exports[_0x49f7('0x5')]=function(_0x2b9c50){for(var _0x2f59de=0x0,_0xb97a18=events[_0x49f7('0x6')];_0x2f59de<_0xb97a18;_0x2f59de++){var _0x2e627d=events[_0x2f59de];var _0x592dbd=createListener(_0x49f7('0x7')+_0x2e627d,_0x2b9c50);ChatGroupEvents['on'](_0x2e627d,_0x592dbd);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index a171ec5..96f4f7a 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 _0xb951=['addMessage','put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','post','addMembers'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb951,0x7b));var _0x1b95=function(_0x225e86,_0x36d4c5){_0x225e86=_0x225e86-0x0;var _0x4d72c6=_0xb951[_0x225e86];return _0x4d72c6;};'use strict';var multer=require(_0x1b95('0x0'));var util=require(_0x1b95('0x1'));var path=require(_0x1b95('0x2'));var timeout=require(_0x1b95('0x3'));var express=require(_0x1b95('0x4'));var router=express[_0x1b95('0x5')]();var fs_extra=require(_0x1b95('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1b95('0x7'));var config=require(_0x1b95('0x8'));var controller=require(_0x1b95('0x9'));router[_0x1b95('0xa')]('/',auth[_0x1b95('0xb')](),controller['index']);router[_0x1b95('0xa')](_0x1b95('0xc'),auth['isAuthenticated'](),controller[_0x1b95('0xd')]);router[_0x1b95('0xa')](_0x1b95('0xe'),auth[_0x1b95('0xb')](),controller[_0x1b95('0xf')]);router[_0x1b95('0xa')](_0x1b95('0x10'),auth[_0x1b95('0xb')](),controller['getUnread']);router[_0x1b95('0xa')](_0x1b95('0x11'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x12')]);router[_0x1b95('0xa')](_0x1b95('0x13'),auth[_0x1b95('0xb')](),controller['getMessages']);router[_0x1b95('0x14')]('/',auth[_0x1b95('0xb')](),controller['create']);router[_0x1b95('0x14')](_0x1b95('0x11'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x15')]);router[_0x1b95('0x14')](_0x1b95('0x13'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x16')]);router[_0x1b95('0x17')](_0x1b95('0xe'),auth['isAuthenticated'](),controller[_0x1b95('0x18')]);router[_0x1b95('0x19')](_0x1b95('0xe'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x1a')]);router[_0x1b95('0x19')](_0x1b95('0x11'),auth[_0x1b95('0xb')](),controller[_0x1b95('0x1b')]);module[_0x1b95('0x1c')]=router; \ No newline at end of file +var _0xe02a=['get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','getMembers','getMessages','create','addMembers','post','addMessage','put','/:id','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x308351,_0x184653){var _0x2def07=function(_0x2a30a4){while(--_0x2a30a4){_0x308351['push'](_0x308351['shift']());}};_0x2def07(++_0x184653);}(_0xe02a,0x1dd));var _0xae02=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe02a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xae02('0x0'));var util=require(_0xae02('0x1'));var path=require(_0xae02('0x2'));var timeout=require('connect-timeout');var express=require(_0xae02('0x3'));var router=express[_0xae02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae02('0x5'));var interaction=require(_0xae02('0x6'));var config=require(_0xae02('0x7'));var controller=require(_0xae02('0x8'));router[_0xae02('0x9')]('/',auth[_0xae02('0xa')](),controller[_0xae02('0xb')]);router[_0xae02('0x9')](_0xae02('0xc'),auth['isAuthenticated'](),controller[_0xae02('0xd')]);router[_0xae02('0x9')]('/:id',auth[_0xae02('0xa')](),controller[_0xae02('0xe')]);router[_0xae02('0x9')](_0xae02('0xf'),auth['isAuthenticated'](),controller['getUnread']);router[_0xae02('0x9')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller[_0xae02('0x11')]);router[_0xae02('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae02('0x12')]);router['post']('/',auth[_0xae02('0xa')](),controller[_0xae02('0x13')]);router['post'](_0xae02('0x10'),auth['isAuthenticated'](),controller[_0xae02('0x14')]);router[_0xae02('0x15')]('/:id/messages',auth[_0xae02('0xa')](),controller[_0xae02('0x16')]);router[_0xae02('0x17')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller['update']);router[_0xae02('0x19')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller[_0xae02('0x1a')]);router[_0xae02('0x19')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index e47a239..4d8e48f 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 _0x9465=['DATE','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x21cb7f,_0x48cd16){var _0x5a079a=function(_0x569a4f){while(--_0x569a4f){_0x21cb7f['push'](_0x21cb7f['shift']());}};_0x5a079a(++_0x48cd16);}(_0x9465,0x88));var _0x5946=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x9465[_0x1b6563];return _0xdea7b8;};'use strict';var Sequelize=require(_0x5946('0x0'));module[_0x5946('0x1')]={'closed':{'type':Sequelize[_0x5946('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5946('0x3')]},'ratingType':{'type':Sequelize[_0x5946('0x4')](_0x5946('0x5'),_0x5946('0x6')),'defaultValue':_0x5946('0x5')},'ratingMessage':{'type':Sequelize[_0x5946('0x7')]},'pathTranscript':{'type':Sequelize[_0x5946('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x5946('0x8')]},'disposition':{'type':Sequelize[_0x5946('0x9')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5946('0x9')]},'note':{'type':Sequelize[_0x5946('0x9')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x5946('0x9')]},'osName':{'type':Sequelize[_0x5946('0x9')]},'osVersion':{'type':Sequelize[_0x5946('0x9')]},'deviceModel':{'type':Sequelize[_0x5946('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x5946('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x5946('0x9')]},'formData':{'type':Sequelize['TEXT'](_0x5946('0xa'))},'read1stAt':{'type':Sequelize[_0x5946('0x8')]},'lastMsgAt':{'type':Sequelize[_0x5946('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x5946('0x4')]('in',_0x5946('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5946('0x9')]},'customerPort':{'type':Sequelize[_0x5946('0x9')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x80f6=['TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x80f6,0x66));var _0x680f=function(_0x1f1a8e,_0x5f09d0){_0x1f1a8e=_0x1f1a8e-0x0;var _0x5b28a0=_0x80f6[_0x1f1a8e];return _0x5b28a0;};'use strict';var Sequelize=require(_0x680f('0x0'));module[_0x680f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x680f('0x2')]},'ratingType':{'type':Sequelize[_0x680f('0x3')](_0x680f('0x4'),_0x680f('0x5')),'defaultValue':_0x680f('0x4')},'ratingMessage':{'type':Sequelize[_0x680f('0x6')]},'pathTranscript':{'type':Sequelize[_0x680f('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x680f('0x7')]},'disposition':{'type':Sequelize[_0x680f('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x680f('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x680f('0x8')]},'browserVersion':{'type':Sequelize[_0x680f('0x8')]},'osName':{'type':Sequelize[_0x680f('0x8')]},'osVersion':{'type':Sequelize[_0x680f('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x680f('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x680f('0x6')]},'customerIp':{'type':Sequelize[_0x680f('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x680f('0x9'))},'read1stAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x680f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x680f('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x680f('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x680f('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f50c7d2..b8cc09c 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 _0xe8ac=['update','destroy','end','stack','name','send','body','contact','agent','interaction','account','index','map','rawAttributes','key','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','POST','email','follow','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','ContactId','format','agentIdentifier','website_alias','%s%d','agentAlias','agent_alias','fullname','System','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\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','filters','hasOwnProperty','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','order','includeAgent','push','alias','setTags','Tag','color','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','createdAt','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','undefined','limit','count','offset'];(function(_0x2fe81c,_0x47463a){var _0x120bf4=function(_0x2eb5f4){while(--_0x2eb5f4){_0x2fe81c['push'](_0x2fe81c['shift']());}};_0x120bf4(++_0x47463a);}(_0xe8ac,0x17f));var _0xce8a=function(_0x3dd8c7,_0x487c5c){_0x3dd8c7=_0x3dd8c7-0x0;var _0x4b7788=_0xe8ac[_0x3dd8c7];return _0x4b7788;};'use strict';var rimraf=require(_0xce8a('0x0'));var zipdir=require(_0xce8a('0x1'));var rp=require(_0xce8a('0x2'));var moment=require(_0xce8a('0x3'));var BPromise=require(_0xce8a('0x4'));var Mustache=require('mustache');var util=require(_0xce8a('0x5'));var path=require(_0xce8a('0x6'));var ejs=require(_0xce8a('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xce8a('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0xce8a('0x9'));var logger=require(_0xce8a('0xa'))(_0xce8a('0xb'));var config=require(_0xce8a('0xc'));var db=require(_0xce8a('0xd'))['db'];config[_0xce8a('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xce8a('0xf'))(new Redis(config['redis']));require(_0xce8a('0x10'))[_0xce8a('0x11')](socket);var jayson=require(_0xce8a('0x12'));var client=jayson[_0xce8a('0x13')][_0xce8a('0x14')]({'port':0x232b});var client9004=jayson[_0xce8a('0x13')][_0xce8a('0x14')]({'port':0x232c});function respondWithRpcPromise(_0xa26d3f,_0xbdfef3,_0x26af7a,_0x20592c){return new BPromise(function(_0x331ab0,_0x303f41){var _0x5ef494=_0x20592c||client;return _0x5ef494[_0xce8a('0x15')](_0xa26d3f,_0x26af7a)[_0xce8a('0x16')](function(_0x2f822e){logger[_0xce8a('0x17')](_0xce8a('0x18'),_0xbdfef3,_0xce8a('0x19'));logger[_0xce8a('0x1a')](_0xce8a('0x1b'),_0xbdfef3,_0xce8a('0x19'),JSON[_0xce8a('0x1c')](_0x2f822e));if(_0x2f822e[_0xce8a('0x1d')]){if(_0x2f822e['error'][_0xce8a('0x1e')]===0x1f4){logger[_0xce8a('0x1d')](_0xce8a('0x18'),_0xbdfef3,_0x2f822e[_0xce8a('0x1d')][_0xce8a('0x1f')]);return _0x303f41(_0x2f822e['error'][_0xce8a('0x1f')]);}logger[_0xce8a('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0xbdfef3,_0x2f822e['error'][_0xce8a('0x1f')]);return _0x331ab0(_0x2f822e[_0xce8a('0x1d')]['message']);}else{logger[_0xce8a('0x17')](_0xce8a('0x18'),_0xbdfef3,'request\x20sent');_0x331ab0(_0x2f822e[_0xce8a('0x20')][_0xce8a('0x1f')]);}})['catch'](function(_0x18f0e8){logger[_0xce8a('0x1d')](_0xce8a('0x18'),_0xbdfef3,_0x18f0e8);_0x303f41(_0x18f0e8);});});}function respondWithStatusCode(_0x1ec911,_0x24d533){_0x24d533=_0x24d533||0xcc;return function(_0x548c4a){if(_0x548c4a){return _0x1ec911['sendStatus'](_0x24d533);}return _0x1ec911[_0xce8a('0x21')](_0x24d533)['end']();};}function respondWithResult(_0x4dc282,_0x23bf72){_0x23bf72=_0x23bf72||0xc8;return function(_0x2859cf){if(_0x2859cf){return _0x4dc282['status'](_0x23bf72)[_0xce8a('0x22')](_0x2859cf);}};}function respondWithFilteredResult(_0x1c2bc9,_0x35156e){return function(_0x1fca40){if(_0x1fca40){var _0x1eebe3=typeof _0x35156e['offset']===_0xce8a('0x23')&&typeof _0x35156e[_0xce8a('0x24')]===_0xce8a('0x23');var _0x2cf954=_0x1fca40[_0xce8a('0x25')];var _0x55f759=_0x1eebe3?0x0:_0x35156e[_0xce8a('0x26')];var _0x567b9b=_0x1eebe3?_0x1fca40[_0xce8a('0x25')]:_0x35156e[_0xce8a('0x26')]+_0x35156e[_0xce8a('0x24')];var _0x2d419c;if(_0x567b9b>=_0x2cf954){_0x567b9b=_0x2cf954;_0x2d419c=0xc8;}else{_0x2d419c=0xce;}_0x1c2bc9['status'](_0x2d419c);return _0x1c2bc9['set']('Content-Range',_0x55f759+'-'+_0x567b9b+'/'+_0x2cf954)[_0xce8a('0x22')](_0x1fca40);}return null;};}function saveUpdates(_0x22b237){return function(_0xf724ea){if(_0xf724ea){return _0xf724ea[_0xce8a('0x27')](_0x22b237)[_0xce8a('0x16')](function(_0x42c8d2){return _0x42c8d2;});}return null;};}function removeEntity(_0x980eb5){return function(_0x219078){if(_0x219078){return _0x219078[_0xce8a('0x28')]()[_0xce8a('0x16')](function(){_0x980eb5[_0xce8a('0x21')](0xcc)[_0xce8a('0x29')]();});}};}function handleEntityNotFound(_0x51ed9f){return function(_0x4f0cd3){if(!_0x4f0cd3){_0x51ed9f['sendStatus'](0x194);}return _0x4f0cd3;};}function handleError(_0x57738f,_0x5b7398){_0x5b7398=_0x5b7398||0x1f4;return function(_0x463ed9){logger[_0xce8a('0x1d')](_0x463ed9[_0xce8a('0x2a')]);if(_0x463ed9['name']){delete _0x463ed9[_0xce8a('0x2b')];}_0x57738f['status'](_0x5b7398)[_0xce8a('0x2c')](_0x463ed9);};}function getMustacheRender(_0x3a91d9,_0x428272){return Mustache['render'](_0x3a91d9,_['merge'](_0x428272[_0xce8a('0x2d')],{'contact':_0x428272[_0xce8a('0x2e')],'message':_0x428272[_0xce8a('0x1f')],'agent':_0x428272[_0xce8a('0x2f')],'interaction':_0x428272[_0xce8a('0x30')],'account':_0x428272[_0xce8a('0x31')]}))||'';}exports[_0xce8a('0x32')]=function(_0x2348fa,_0x2044ee){var _0x2b6725={};var _0x3095aa=_[_0xce8a('0x33')](db['ChatInteraction'][_0xce8a('0x34')],function(_0x1be212){return{'name':_0x1be212['fieldName'],'type':_0x1be212['type'][_0xce8a('0x35')]};});_0x2b6725=qs[_0xce8a('0x36')](_0x3095aa,_0x2348fa);return interaction[_0xce8a('0x37')](_0xce8a('0x38'),_0x2348fa[_0xce8a('0x39')],_0x2348fa[_0xce8a('0x3a')],_0x2b6725,_0x3095aa)['then'](respondWithFilteredResult(_0x2044ee,_0x2b6725))['catch'](handleError(_0x2044ee,null));};exports[_0xce8a('0x3b')]=function(_0x1a2dbf,_0x284d2e){var _0x920dd0={'raw':![],'where':{'id':_0x1a2dbf[_0xce8a('0x3c')]['id']}},_0x1b0d62={};_0x1b0d62[_0xce8a('0x3d')]=_[_0xce8a('0x3e')](db[_0xce8a('0x3f')][_0xce8a('0x34')]);_0x1b0d62['query']=_[_0xce8a('0x3e')](_0x1a2dbf[_0xce8a('0x39')]);_0x1b0d62['filters']=_['intersection'](_0x1b0d62['model'],_0x1b0d62[_0xce8a('0x39')]);_0x920dd0[_0xce8a('0x40')]=_[_0xce8a('0x41')](_0x1b0d62[_0xce8a('0x3d')],qs[_0xce8a('0x42')](_0x1a2dbf['query']['fields']));_0x920dd0[_0xce8a('0x40')]=_0x920dd0[_0xce8a('0x40')][_0xce8a('0x43')]?_0x920dd0[_0xce8a('0x40')]:_0x1b0d62[_0xce8a('0x3d')];if(_0x1a2dbf[_0xce8a('0x39')][_0xce8a('0x44')]){_0x920dd0[_0xce8a('0x45')]=[{'all':!![]}];}_0x920dd0=_[_0xce8a('0x46')]({},_0x920dd0,_0x1a2dbf[_0xce8a('0x47')]);return db[_0xce8a('0x3f')][_0xce8a('0x48')](_0x920dd0)[_0xce8a('0x16')](handleEntityNotFound(_0x284d2e,null))[_0xce8a('0x16')](respondWithResult(_0x284d2e,null))[_0xce8a('0x49')](handleError(_0x284d2e,null));};exports['create']=function(_0x5716fa,_0x5665de){return db[_0xce8a('0x3f')][_0xce8a('0x4a')](_0x5716fa[_0xce8a('0x2d')],{})[_0xce8a('0x16')](respondWithResult(_0x5665de,0xc9))['catch'](handleError(_0x5665de,null));};exports[_0xce8a('0x27')]=function(_0x47c6b5,_0x4843e7){if(_0x47c6b5[_0xce8a('0x2d')]['id']){delete _0x47c6b5[_0xce8a('0x2d')]['id'];}return db[_0xce8a('0x3f')]['find']({'where':{'id':_0x47c6b5[_0xce8a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4843e7,null))[_0xce8a('0x16')](saveUpdates(_0x47c6b5['body'],null))[_0xce8a('0x16')](respondWithResult(_0x4843e7,null))[_0xce8a('0x49')](handleError(_0x4843e7,null));};exports['destroy']=function(_0x5745e4,_0x2f799c){return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x5745e4[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x2f799c,null))['then'](removeEntity(_0x2f799c,null))[_0xce8a('0x49')](handleError(_0x2f799c,null));};exports[_0xce8a('0x4b')]=function(_0x24868b,_0x19a79c){return db['ChatInteraction'][_0xce8a('0x4b')]()[_0xce8a('0x16')](respondWithResult(_0x19a79c,null))[_0xce8a('0x49')](handleError(_0x19a79c,null));};exports[_0xce8a('0x4c')]=function(_0x51763f,_0x4f7eaf){var _0x448f68=_0x51763f[_0xce8a('0x3c')]['id'];var _0x30e6c3;var _0x5d0f18;var _0x2f585b;return db['ChatInteraction'][_0xce8a('0x4d')]({'where':{'id':_0x448f68}})[_0xce8a('0x16')](function(_0x29c341){_0x30e6c3=_0x29c341;return db[_0xce8a('0x4e')][_0xce8a('0x4d')]({'where':{'id':_0x29c341['ChatWebsiteId']},'attributes':['id',_0xce8a('0x4f'),_0xce8a('0x50'),_0xce8a('0x51'),_0xce8a('0x52'),_0xce8a('0x53')],'raw':!![]});})[_0xce8a('0x16')](function(_0x3f7dd6){if(_0x3f7dd6&&_0x3f7dd6[_0xce8a('0x4f')]&&_0x3f7dd6[_0xce8a('0x50')]){_0x5d0f18=_0x3f7dd6;var _0x32e63={'interaction':{'id':_0x448f68},'agent':{'id':_0x51763f[_0xce8a('0x3a')]['id'],'name':_0x51763f['user']['name'],'fullname':_0x51763f['user']['fullname'],'email':_0x51763f['user']['email']},'contact':_0x51763f['body'][_0xce8a('0x2e')],'account':_0x51763f[_0xce8a('0x2d')][_0xce8a('0x31')]};var _0x306d9b={'rejectUnauthorized':![],'method':_0xce8a('0x54'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3f7dd6['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x51763f[_0xce8a('0x3a')][_0xce8a('0x55')]],'buttons':null,'topic':_0x5d0f18[_0xce8a('0x51')],'note':_['isNull'](_0x5d0f18[_0xce8a('0x52')])?null:getMustacheRender(_0x5d0f18['vidaooNote'],_0x32e63),'metadata':null},'redirect':_0xce8a('0x56'),'json':!![]};try{if(!_[_0xce8a('0x57')](_0x5d0f18['vidaooMetadata'])){var _0x144fbb=getMustacheRender(_0x5d0f18['vidaooMetadata'],_0x32e63);var _0x3d4053=JSON['parse'](_0x144fbb);_0x306d9b['body'][_0xce8a('0x58')]=_0x3d4053;}}catch(_0xb36072){throw new db[(_0xce8a('0x59'))][(_0xce8a('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x306d9b);}else{throw new db[(_0xce8a('0x59'))]['ValidationError'](_0xce8a('0x5b'));}})['then'](function(_0x171a38){_0x2f585b=_0x171a38;if(_0x2f585b['id']){var _0x345046={'body':_0x2f585b[_0xce8a('0x5c')],'ChatWebsiteId':_0x5d0f18['id'],'ChatInteractionId':_0x30e6c3['id'],'direction':_0xce8a('0x5d'),'UserId':_0x51763f['user']['id']};return db[_0xce8a('0x5e')][_0xce8a('0x4a')](_0x345046,{});}else{throw new db[(_0xce8a('0x59'))][(_0xce8a('0x5a'))](_0xce8a('0x5f'));}})[_0xce8a('0x16')](function(){return _0x30e6c3[_0xce8a('0x60')]({'vidaooSessionId':_0x2f585b['id']});})[_0xce8a('0x16')](respondWithResult(_0x4f7eaf,null))['catch'](handleError(_0x4f7eaf,null));};exports[_0xce8a('0x61')]=function(_0x28ce7f,_0x32071a){if(_0x28ce7f[_0xce8a('0x2d')]['id']){delete _0x28ce7f['body']['id'];}return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x28ce7f[_0xce8a('0x3c')]['id']},'include':[{'model':db[_0xce8a('0x62')],'as':'Contact'}]})[_0xce8a('0x16')](handleEntityNotFound(_0x32071a,null))['then'](saveUpdates(_0x28ce7f['body'],null))[_0xce8a('0x16')](respondWithResult(_0x32071a,null))['catch'](handleError(_0x32071a,null));};exports[_0xce8a('0x63')]=function(_0xdf54d3,_0x434a9b){if(_0xdf54d3[_0xce8a('0x2d')]['id']){delete _0xdf54d3[_0xce8a('0x2d')]['id'];}return db['ChatInteraction'][_0xce8a('0x48')]({'where':{'id':_0xdf54d3[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](function(_0x2ef8ae){if(!_0x2ef8ae){logger[_0xce8a('0x1d')](_0xce8a('0x64'),'abandon',0x194,_0xce8a('0x65'));_0x434a9b[_0xce8a('0x66')](0x194);}else{if(_0x2ef8ae[_0xce8a('0x67')]){throw new db[(_0xce8a('0x59'))][(_0xce8a('0x5a'))](_0xce8a('0x68'));}}return _0x2ef8ae;})[_0xce8a('0x16')](function(_0x439d46){if(_0x439d46){return _0x439d46['update']({'closed':_0xdf54d3[_0xce8a('0x2d')][_0xce8a('0x69')],'disposition':_0xdf54d3['body']['disposition']})[_0xce8a('0x16')](function(_0x4b52aa){return _0x4b52aa;});}})['then'](function(){return respondWithRpcPromise(_0xce8a('0x6a'),_0xce8a('0x63'),_0xdf54d3[_0xce8a('0x2d')],client9004);})[_0xce8a('0x16')](respondWithResult(_0x434a9b,null))['catch'](handleError(_0x434a9b,null));};exports[_0xce8a('0x6b')]=function(_0x46eeae,_0x12945a){_0x46eeae[_0xce8a('0x2d')][_0xce8a('0x2b')]=_0x46eeae['file'][_0xce8a('0x6c')];_0x46eeae[_0xce8a('0x2d')][_0xce8a('0x6d')]=_0x46eeae[_0xce8a('0x6e')][_0xce8a('0x6f')];_0x46eeae[_0xce8a('0x2d')]['type']=_0x46eeae[_0xce8a('0x6e')][_0xce8a('0x70')];return db[_0xce8a('0x71')][_0xce8a('0x4a')](_0x46eeae[_0xce8a('0x2d')])['then'](respondWithResult(_0x12945a,0xc9))[_0xce8a('0x49')](handleError(_0x12945a,null));};exports[_0xce8a('0x72')]=function(_0x540ce9,_0x45c224){return db['ChatInteraction'][_0xce8a('0x4d')]({'where':{'id':_0x540ce9['params']['id']},'raw':!![]})[_0xce8a('0x16')](handleEntityNotFound(_0x45c224,null))[_0xce8a('0x16')](function(_0x53e056){if(_0x53e056){if(_0x53e056['closed']){return _0x45c224[_0xce8a('0x21')](0x193)['json']({'status':0x193,'message':_0xce8a('0x73')});}return db[_0xce8a('0x71')][_0xce8a('0x4d')]({'where':{'id':_0x540ce9[_0xce8a('0x39')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x45c224,null));}})[_0xce8a('0x16')](function(_0x476fe1){if(_0x476fe1){var _0x2647f0=_0x476fe1[_0xce8a('0x74')]!==null;var _0x303c4b=path[_0xce8a('0x75')](config[_0xce8a('0x76')],_0xce8a('0x77'));if(_0x2647f0){_0x303c4b=path[_0xce8a('0x75')](_0x303c4b,_0xce8a('0x78'));}var _0x2ed522=path[_0xce8a('0x75')](_0x303c4b,_0x476fe1[_0xce8a('0x6d')]);return _0x45c224[_0xce8a('0x79')](_0x2ed522);}})[_0xce8a('0x49')](handleError(_0x45c224,null));};exports[_0xce8a('0x7a')]=function(_0x49fead,_0x3cd97f){var _0x52e827=null;var _0x59fd95=null;var _0x182f87=null;if(_0x49fead[_0xce8a('0x2d')]['id']){delete _0x49fead[_0xce8a('0x2d')]['id'];}if(_0x49fead[_0xce8a('0x2d')][_0xce8a('0x7b')]){_0x182f87=path[_0xce8a('0x75')](config[_0xce8a('0x76')],_0xce8a('0x7c'),util['format'](_0xce8a('0x7d'),Date[_0xce8a('0x7e')]()));_0x49fead['body'][_0xce8a('0x7f')]=_0x182f87;}return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x49fead['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0xce8a('0x80'),'include':[{'model':db[_0xce8a('0x81')],'as':_0xce8a('0x81')}]}]})['then'](handleEntityNotFound(_0x3cd97f,null))[_0xce8a('0x16')](saveUpdates(_0x49fead[_0xce8a('0x2d')],null))[_0xce8a('0x16')](function(_0x2bd406){if(_0x2bd406){_0x52e827=_0x2bd406;return db[_0xce8a('0x4e')][_0xce8a('0x48')]({'where':{'id':_0x52e827[_0xce8a('0x82')]}});}})['then'](function(_0x40b332){if(_0x40b332){_0x59fd95=_0x40b332;return db[_0xce8a('0x62')][_0xce8a('0x48')]({'where':{'id':_0x52e827[_0xce8a('0x83')]}});}})[_0xce8a('0x16')](function(_0x25aad1){if(_0x25aad1){if(_0x182f87){var _0x1f37e4=null;for(var _0x43de1e=0x1;_0x43de1e<_0x52e827[_0xce8a('0x80')][_0xce8a('0x43')];++_0x43de1e){_0x1f37e4=_0x52e827[_0xce8a('0x80')][_0x43de1e];var _0x21ee17=_0x1f37e4[_0xce8a('0x67')]?util[_0xce8a('0x84')]('%s%d',_0x59fd95['agentAlias'],_0x1f37e4[_0xce8a('0x67')]):'System';var _0x37cc54=_0x49fead[_0xce8a('0x2d')]['customer']||util[_0xce8a('0x84')]('%s%d','Visitor',_0x1f37e4[_0xce8a('0x83')]);switch(_0x59fd95[_0xce8a('0x85')]){case _0xce8a('0x86'):_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?util['format'](_0xce8a('0x87'),_0x59fd95[_0xce8a('0x88')],_0x1f37e4[_0xce8a('0x67')]):'System';break;case _0xce8a('0x89'):_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?_0x1f37e4['User']['alias']||_0x1f37e4[_0xce8a('0x81')][_0xce8a('0x8a')]:'System';break;case'agent_fullname':_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?_0x1f37e4[_0xce8a('0x81')]['fullname']:'System';break;default:_0x21ee17=_0x1f37e4[_0xce8a('0x67')]?util[_0xce8a('0x84')](_0xce8a('0x87'),_0x59fd95[_0xce8a('0x88')],_0x1f37e4[_0xce8a('0x67')]):_0xce8a('0x8b');}var _0x1695d0=util[_0xce8a('0x84')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1f37e4['createdAt'])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x1f37e4[_0xce8a('0x8c')]==='in'?_0x37cc54:_0x21ee17,_0x1f37e4[_0xce8a('0x2d')]);if(!_0x1f37e4[_0xce8a('0x8d')]){fs[_0xce8a('0x8e')](_0x182f87,_0x1695d0);}}return db['MailAccount'][_0xce8a('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0xce8a('0x8f')],'as':_0xce8a('0x90'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xce8a('0x91'),'raw':!![]}]}]});}}})[_0xce8a('0x16')](function(_0x283f52){if(!_0x283f52||!_0x283f52[_0xce8a('0x90')]||!_0x49fead[_0xce8a('0x2d')])return _0x52e827;var _0x4d097c=_0x283f52[_0xce8a('0x92')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x4d097c,'message':{'from':util['format'](_0xce8a('0x93'),_0x283f52[_0xce8a('0x2b')],_0x283f52[_0xce8a('0x55')]||_0x283f52[_0xce8a('0x90')][_0xce8a('0x3a')]),'to':_0x49fead[_0xce8a('0x2d')][_0xce8a('0x7b')],'subject':'Mail\x20Transcript','text':util[_0xce8a('0x84')](_0xce8a('0x94'),_0x49fead[_0xce8a('0x2d')][_0xce8a('0x7b')]),'attachments':[{'path':_0x182f87}]}})[_0xce8a('0x16')](function(){return _0x52e827;})[_0xce8a('0x49')](function(_0x4c27ca){logger[_0xce8a('0x1d')](_0x4c27ca);});})['then'](respondWithStatusCode(_0x3cd97f,0xc8))['catch'](handleError(_0x3cd97f,null));};exports['addMessage']=function(_0x4a8b43,_0x14ad30){return db[_0xce8a('0x5e')][_0xce8a('0x48')]({'where':{'id':_0x4a8b43[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x14ad30,null))[_0xce8a('0x16')](function(_0x5367c1){if(_0x5367c1){return _0x5367c1[_0xce8a('0x95')](_0x4a8b43[_0xce8a('0x2d')][_0xce8a('0x96')],_[_0xce8a('0x97')](_0x4a8b43[_0xce8a('0x2d')],[_0xce8a('0x96'),'id'])||{});}})[_0xce8a('0x16')](respondWithResult(_0x14ad30,null))['catch'](handleError(_0x14ad30,null));};exports[_0xce8a('0x98')]=function(_0x59eb86,_0x341062){var _0x3463f7={'raw':![],'where':{}};var _0x891358={};var _0x35f290={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xce8a('0x4d')]({'where':{'id':_0x59eb86[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x341062,null))[_0xce8a('0x16')](function(_0x5619a9){if(_0x5619a9){_0x891358[_0xce8a('0x3d')]=_[_0xce8a('0x3e')](db[_0xce8a('0x5e')][_0xce8a('0x34')]);_0x891358['query']=_['keys'](_0x59eb86[_0xce8a('0x39')]);_0x891358[_0xce8a('0x99')]=_[_0xce8a('0x41')](_0x891358[_0xce8a('0x3d')],_0x891358['query']);_0x3463f7[_0xce8a('0x40')]=_['intersection'](_0x891358[_0xce8a('0x3d')],qs[_0xce8a('0x42')](_0x59eb86[_0xce8a('0x39')]['fields']));_0x3463f7[_0xce8a('0x40')]=_0x3463f7[_0xce8a('0x40')][_0xce8a('0x43')]?_0x3463f7['attributes']:_0x891358[_0xce8a('0x3d')];if(!_0x59eb86['query'][_0xce8a('0x9a')](_0xce8a('0x9b'))){_0x3463f7['limit']=qs[_0xce8a('0x24')](_0x59eb86['query']['limit']);_0x3463f7['offset']=qs[_0xce8a('0x26')](_0x59eb86[_0xce8a('0x39')][_0xce8a('0x26')]);}_0x3463f7['order']=qs[_0xce8a('0x9c')](_0x59eb86[_0xce8a('0x39')]['sort']);_0x3463f7[_0xce8a('0x9d')]=qs[_0xce8a('0x99')](_[_0xce8a('0x9e')](_0x59eb86['query'],_0x891358[_0xce8a('0x99')]));_0x3463f7[_0xce8a('0x9d')][_0xce8a('0x9f')]=_0x5619a9['id'];if(_0x59eb86[_0xce8a('0x39')][_0xce8a('0xa0')]){_0x3463f7['where']=_[_0xce8a('0x46')](_0x3463f7['where'],{'$or':_['map'](_0x3463f7[_0xce8a('0x40')],function(_0x19d659){var _0x5ac5f4={};_0x5ac5f4[_0x19d659]={'$like':'%'+_0x59eb86['query'][_0xce8a('0xa0')]+'%'};return _0x5ac5f4;})});}if(_0x59eb86[_0xce8a('0x39')][_0xce8a('0xa1')]){var _0x57baaa=_0x59eb86[_0xce8a('0x39')][_0xce8a('0xa1')][_0xce8a('0xa2')](',');var _0x22752f={};_0x22752f[_0x57baaa[0x0]]={'$gte':moment(_0x57baaa[0x1])['format'](_0xce8a('0xa3'))};_0x3463f7[_0xce8a('0x9d')]=_[_0xce8a('0x46')](_0x3463f7[_0xce8a('0x9d')],_0x22752f);}_0x3463f7=_[_0xce8a('0x46')]({},_0x3463f7,_0x59eb86['options']);return db[_0xce8a('0x5e')][_0xce8a('0x25')]({'where':_0x3463f7[_0xce8a('0x9d')]})['then'](function(_0x11a96){_0x35f290[_0xce8a('0x25')]=_0x11a96;if(_0x59eb86[_0xce8a('0x39')][_0xce8a('0x44')]){_0x3463f7[_0xce8a('0x45')]=[{'all':!![]}];}return db['ChatMessage'][_0xce8a('0x37')](_0x3463f7);})[_0xce8a('0x16')](function(_0x1c3e74){_0x35f290[_0xce8a('0xa4')]=_0x1c3e74;return _0x35f290;});}})[_0xce8a('0x16')](respondWithFilteredResult(_0x341062,_0x3463f7))[_0xce8a('0x49')](handleError(_0x341062,null));};exports[_0xce8a('0xa5')]=function(_0x502111,_0x2c6b45){var _0x54597b={'where':{}},_0x11504f={},_0x5253e9={'count':0x0,'rows':[]};return db[_0xce8a('0x3f')][_0xce8a('0x4d')]({'where':{'id':_0x502111[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x2c6b45,null))['then'](function(_0x1bbc62){if(_0x1bbc62){_0x11504f[_0xce8a('0x3d')]=_[_0xce8a('0x3e')](db['ChatMessage'][_0xce8a('0x34')]);_0x11504f[_0xce8a('0x39')]=_['keys'](_0x502111[_0xce8a('0x39')]);_0x11504f[_0xce8a('0x99')]=_[_0xce8a('0x41')](_0x11504f[_0xce8a('0x3d')],_0x11504f['query']);_0x54597b[_0xce8a('0x40')]=_[_0xce8a('0x41')](_0x11504f[_0xce8a('0x3d')],qs[_0xce8a('0x42')](_0x502111[_0xce8a('0x39')][_0xce8a('0x42')]));_0x54597b['attributes']=_0x54597b['attributes'][_0xce8a('0x43')]?_0x54597b[_0xce8a('0x40')]:_0x11504f[_0xce8a('0x3d')];if(!_0x502111['query'][_0xce8a('0x9a')]('nolimit')){_0x54597b[_0xce8a('0x24')]=qs[_0xce8a('0x24')](_0x502111[_0xce8a('0x39')][_0xce8a('0x24')]);_0x54597b[_0xce8a('0x26')]=qs[_0xce8a('0x26')](_0x502111[_0xce8a('0x39')][_0xce8a('0x26')]);}_0x54597b[_0xce8a('0xa6')]=qs[_0xce8a('0x9c')](_0x502111[_0xce8a('0x39')][_0xce8a('0x9c')]);_0x54597b[_0xce8a('0x9d')]=qs[_0xce8a('0x99')](_['pick'](_0x502111[_0xce8a('0x39')],_0x11504f[_0xce8a('0x99')]));_0x54597b[_0xce8a('0x9d')]['ChatInteractionId']=_0x1bbc62['id'];if(_0x502111[_0xce8a('0x39')][_0xce8a('0xa0')]){_0x54597b[_0xce8a('0x9d')]=_[_0xce8a('0x46')](_0x54597b[_0xce8a('0x9d')],{'$or':_['map'](_0x54597b[_0xce8a('0x40')],function(_0x4dc83b){var _0x343cc4={};_0x343cc4[_0x4dc83b]={'$like':'%'+_0x502111[_0xce8a('0x39')][_0xce8a('0xa0')]+'%'};return _0x343cc4;})});}_0x54597b['where'][_0xce8a('0x8d')]=![];if(_0x502111[_0xce8a('0x39')]['id']){_0x54597b[_0xce8a('0x9d')]['id']={'$gt':_0x502111[_0xce8a('0x39')]['id']};}_0x54597b=_[_0xce8a('0x46')]({},_0x54597b,_0x502111[_0xce8a('0x47')]);return db[_0xce8a('0x5e')][_0xce8a('0x25')]({'where':_0x54597b[_0xce8a('0x9d')]})[_0xce8a('0x16')](function(_0x10f102){_0x5253e9[_0xce8a('0x25')]=_0x10f102;_0x54597b['include']=[];if(_0x502111[_0xce8a('0x39')][_0xce8a('0xa7')]){_0x54597b[_0xce8a('0x45')][_0xce8a('0xa8')]({'model':db[_0xce8a('0x81')],'as':'User','attributes':['id',_0xce8a('0x8a'),_0xce8a('0xa9')]});}if(_0x502111[_0xce8a('0x39')][_0xce8a('0x44')]){_0x54597b['include']=[{'all':!![]}];}return db[_0xce8a('0x5e')][_0xce8a('0x37')](_0x54597b);})[_0xce8a('0x16')](function(_0x2641d8){_0x5253e9['rows']=_0x2641d8;return _0x5253e9;});}})[_0xce8a('0x16')](respondWithFilteredResult(_0x2c6b45,_0x54597b))['catch'](handleError(_0x2c6b45,null));};exports['addTags']=function(_0x4900f5,_0x3976f7){return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x4900f5[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x3976f7,null))[_0xce8a('0x16')](function(_0x393b63){if(_0x393b63){return _0x393b63[_0xce8a('0xaa')](_0x4900f5[_0xce8a('0x2d')][_0xce8a('0x96')],_[_0xce8a('0x97')](_0x4900f5[_0xce8a('0x2d')],[_0xce8a('0x96'),'id'])||{})['spread'](function(){return db[_0xce8a('0xab')][_0xce8a('0x37')]({'attributes':['id',_0xce8a('0x2b'),_0xce8a('0xac')],'where':{'id':_0x4900f5[_0xce8a('0x2d')][_0xce8a('0x96')]}});})[_0xce8a('0x16')](function(_0x3e1021){socket['emit'](_0xce8a('0xad'),{'id':Number(_0x4900f5[_0xce8a('0x3c')]['id']),'tags':_0x3e1021||[]});return{'id':Number(_0x4900f5['params']['id']),'tags':_0x3e1021||[]};});}})[_0xce8a('0x16')](respondWithResult(_0x3976f7,null))['catch'](handleError(_0x3976f7,null));};exports['removeTags']=function(_0x3eceed,_0x95655c){return db[_0xce8a('0x3f')][_0xce8a('0x48')]({'where':{'id':_0x3eceed[_0xce8a('0x3c')]['id']}})[_0xce8a('0x16')](handleEntityNotFound(_0x95655c,null))[_0xce8a('0x16')](function(_0x155861){if(_0x155861){return _0x155861[_0xce8a('0xae')](_0x3eceed[_0xce8a('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x95655c,null))['catch'](handleError(_0x95655c,null));};exports['download']=function(_0x4b7b6e,_0x58a171){var _0x41b9b1=moment()[_0xce8a('0xaf')]()[_0xce8a('0xb0')]();var _0x5e1d22=path[_0xce8a('0x75')](config['root'],_0xce8a('0xb1'),_0xce8a('0xb2'),_0xce8a('0xb3'));var _0x185db5=path['join'](config['root'],'server',_0xce8a('0xb2'),_0xce8a('0xb4'));var _0x7d74da=path[_0xce8a('0x75')](_0x5e1d22,_0x41b9b1);var _0x5bcd0a=util[_0xce8a('0x84')](_0xce8a('0xb5'),_0x4b7b6e[_0xce8a('0x3c')]['id'],_0x41b9b1);var _0x2ebec7=path[_0xce8a('0x75')](_0x5e1d22,_0x5bcd0a);var _0x3aefd9=[];_0x3aefd9['push']({'model':db[_0xce8a('0x81')],'as':_0xce8a('0x81'),'attributes':['id',_0xce8a('0x8a')],'raw':!![]});_0x3aefd9[_0xce8a('0xa8')]({'model':db['CmContact'],'as':_0xce8a('0xb6'),'attributes':['id',_0xce8a('0xb7'),_0xce8a('0xb8')],'raw':!![]});if(_0x4b7b6e[_0xce8a('0x39')][_0xce8a('0xb4')]){_0x3aefd9[_0xce8a('0xa8')]({'model':db['Attachment'],'as':_0xce8a('0x71'),'raw':!![]});}var _0x59770e=[{'model':db[_0xce8a('0x5e')],'as':_0xce8a('0x80'),'attributes':['id',_0xce8a('0x2d'),_0xce8a('0xb9'),_0xce8a('0x8c'),_0xce8a('0x8d'),'read'],'include':_0x3aefd9}];_0x59770e[_0xce8a('0xa8')]({'model':db[_0xce8a('0x4e')],'as':_0xce8a('0xba'),'attributes':['id',_0xce8a('0x2b')]});_0x59770e[_0xce8a('0xa8')]({'model':db[_0xce8a('0x81')],'as':_0xce8a('0xbb'),'attributes':['id',_0xce8a('0x8a')]});return db[_0xce8a('0x3f')]['find']({'where':{'id':_0x4b7b6e[_0xce8a('0x3c')]['id']},'include':_0x59770e})[_0xce8a('0x16')](handleEntityNotFound(_0x58a171,null))[_0xce8a('0x16')](function(_0x2209e8){if(_0x2209e8){var _0x4efe54=_0x2209e8['get']({'plain':!![]});fs[_0xce8a('0xbc')](_0x7d74da);var _0x2d9f22={'channel':_0xce8a('0xbd'),'account':_0x4efe54[_0xce8a('0xba')][_0xce8a('0x2b')],'agent':_0x4efe54[_0xce8a('0xbb')]?_0x4efe54[_0xce8a('0xbb')][_0xce8a('0x8a')]:_0xce8a('0xbe'),'createdAt':moment(_0x4efe54[_0xce8a('0xb9')])['format'](_0xce8a('0xa3'))['toString'](),'closedAt':_0x4efe54[_0xce8a('0x69')]?moment(_0x4efe54[_0xce8a('0xbf')])[_0xce8a('0x84')](_0xce8a('0xa3'))[_0xce8a('0xb0')]():'','disposition':_0x4efe54[_0xce8a('0xc0')],'chatInfo':{'browser':_0x4efe54[_0xce8a('0xc1')],'os':_0x4efe54[_0xce8a('0xc2')],'referer':_0x4efe54[_0xce8a('0xc3')],'customerIp':_0x4efe54[_0xce8a('0xc4')],'customerPort':_0x4efe54['customerPort']?_0x4efe54[_0xce8a('0xc5')]:_0xce8a('0xbe')},'messages':_(_0x4efe54[_0xce8a('0x80')])[_0xce8a('0xc6')]()[_0xce8a('0xa0')]({'secret':![]})[_0xce8a('0x33')](function(_0x2f4a9c){if(_0x2f4a9c[_0xce8a('0x71')]){var _0x161f7f=path[_0xce8a('0x75')](_0x185db5,_0x2f4a9c[_0xce8a('0x71')]['basename']);if(fs[_0xce8a('0xc7')](_0x161f7f)){fs[_0xce8a('0xc8')](_0x161f7f)['pipe'](fs[_0xce8a('0xc9')](path[_0xce8a('0x75')](_0x7d74da,_0x2f4a9c[_0xce8a('0x71')]['basename'])));}}return{'date':moment(_0x2f4a9c[_0xce8a('0xb9')])[_0xce8a('0x84')](_0xce8a('0xa3'))['toString'](),'sender':_0x2f4a9c[_0xce8a('0x8c')]===_0xce8a('0x5d')?_0x2f4a9c['User']?_0x2f4a9c[_0xce8a('0x81')][_0xce8a('0x8a')]:_0xce8a('0x8b'):_0x2f4a9c[_0xce8a('0xb6')][_0xce8a('0xb7')]+(_0x2f4a9c[_0xce8a('0xb6')]['lastName']?'\x20'+_0x2f4a9c[_0xce8a('0xb6')][_0xce8a('0xb8')]:''),'body':_0x2f4a9c[_0xce8a('0x71')]?_0x2f4a9c['Attachment'][_0xce8a('0x6d')]:_0x2f4a9c[_0xce8a('0x2d')],'direction':_0x2f4a9c['direction']===_0xce8a('0x5d')?'A':'C','secret':_0x2f4a9c['secret'],'read':_0x2f4a9c[_0xce8a('0xca')],'attachment':_0x2f4a9c[_0xce8a('0x71')]};})[_0xce8a('0xcb')]()};return ejs[_0xce8a('0xcc')](path[_0xce8a('0x75')](config['root'],_0xce8a('0xb1'),_0xce8a('0xcd'),_0xce8a('0xce')),{'interaction':_0x2d9f22})[_0xce8a('0x16')](function(_0x4d7b40){var _0x3c2038=path['join'](_0x7d74da,'transcript-'+_0x4efe54['id']+'-'+_0x41b9b1+_0xce8a('0xcf'));var _0x50223a={'path':_0x3c2038,'channel':_0xce8a('0xbd'),'interactionId':_0x4efe54['id']};return pdf[_0xce8a('0xd0')](_0x4d7b40,_0x50223a);})[_0xce8a('0x16')](function(){return new Promise(function(_0xfb8d42,_0x147e9e){zipdir(_0x7d74da,{'saveTo':_0x2ebec7},function(_0x31428e,_0x5e9026){if(_0x31428e)return _0x147e9e(_0x31428e);return _0xfb8d42(_0x5e9026);});})[_0xce8a('0x16')](function(){return new BPromise(function(_0x5b5ed9,_0x1b3376){rimraf(_0x7d74da,function(_0x1354e5){if(_0x1354e5)_0x1b3376(_0x1354e5);return _0x5b5ed9();});});})[_0xce8a('0x16')](function(){return _0x58a171[_0xce8a('0x79')](_0x2ebec7,_0x5bcd0a,function(_0x126675){if(_0x126675){logger[_0xce8a('0x1d')](_0xce8a('0xd1'),_0x126675);}else{fs[_0xce8a('0xd2')](_0x2ebec7);}});});});}else{return _0x58a171[_0xce8a('0x66')](0xc8);}})[_0xce8a('0x49')](handleError(_0x58a171,null));}; \ No newline at end of file +var _0x1fc4=['sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','nolimit','order','sort','filters','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','hasOwnProperty','includeAgent','push','rows','addTags','setTags','omit','spread','Tag','color','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','direction','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','mustache','util','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','name','send','render','merge','body','contact','agent','account','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','includeAll','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','agentAlias','customer','Visitor','agentIdentifier','website_alias','%s%d','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0x1fc4,0x1ed));var _0x41fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1fc4[_0x501510];return _0x1e6ee5;};'use strict';var rimraf=require(_0x41fc('0x0'));var zipdir=require('zip-dir');var rp=require(_0x41fc('0x1'));var moment=require(_0x41fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x41fc('0x3'));var util=require(_0x41fc('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x41fc('0x5'));var qs=require(_0x41fc('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x41fc('0x7'))(_0x41fc('0x8'));var config=require(_0x41fc('0x9'));var db=require(_0x41fc('0xa'))['db'];config[_0x41fc('0xb')]=_[_0x41fc('0xc')](config['redis'],{'host':_0x41fc('0xd'),'port':0x18eb});var socket=require(_0x41fc('0xe'))(new Redis(config[_0x41fc('0xb')]));require('./chatInteraction.socket')[_0x41fc('0xf')](socket);var jayson=require(_0x41fc('0x10'));var client=jayson[_0x41fc('0x11')]['http']({'port':0x232b});var client9004=jayson[_0x41fc('0x11')][_0x41fc('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x57572a,_0x40774b,_0x55c2b7,_0x11773c){return new BPromise(function(_0x247247,_0x50bfbd){var _0x32385f=_0x11773c||client;return _0x32385f[_0x41fc('0x13')](_0x57572a,_0x55c2b7)[_0x41fc('0x14')](function(_0x24b132){logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));logger['debug'](_0x41fc('0x17'),_0x40774b,'request\x20sent',JSON['stringify'](_0x24b132));if(_0x24b132['error']){if(_0x24b132[_0x41fc('0x18')][_0x41fc('0x19')]===0x1f4){logger['error'](_0x41fc('0x15'),_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x50bfbd(_0x24b132[_0x41fc('0x18')]['message']);}logger[_0x41fc('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x247247(_0x24b132['error'][_0x41fc('0x1a')]);}else{logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));_0x247247(_0x24b132[_0x41fc('0x1b')][_0x41fc('0x1a')]);}})[_0x41fc('0x1c')](function(_0x1112c2){logger['error'](_0x41fc('0x15'),_0x40774b,_0x1112c2);_0x50bfbd(_0x1112c2);});});}function respondWithStatusCode(_0x4559ef,_0x2ea987){_0x2ea987=_0x2ea987||0xcc;return function(_0x4539d4){if(_0x4539d4){return _0x4559ef[_0x41fc('0x1d')](_0x2ea987);}return _0x4559ef[_0x41fc('0x1e')](_0x2ea987)[_0x41fc('0x1f')]();};}function respondWithResult(_0x119a13,_0x13c8d4){_0x13c8d4=_0x13c8d4||0xc8;return function(_0x27e716){if(_0x27e716){return _0x119a13[_0x41fc('0x1e')](_0x13c8d4)[_0x41fc('0x20')](_0x27e716);}};}function respondWithFilteredResult(_0x5e1811,_0x541d32){return function(_0x5dc5e6){if(_0x5dc5e6){var _0x13f10c=typeof _0x541d32[_0x41fc('0x21')]===_0x41fc('0x22')&&typeof _0x541d32[_0x41fc('0x23')]===_0x41fc('0x22');var _0x4a5bea=_0x5dc5e6[_0x41fc('0x24')];var _0x2bb7cd=_0x13f10c?0x0:_0x541d32['offset'];var _0x63be2=_0x13f10c?_0x5dc5e6[_0x41fc('0x24')]:_0x541d32[_0x41fc('0x21')]+_0x541d32[_0x41fc('0x23')];var _0x7e7e81;if(_0x63be2>=_0x4a5bea){_0x63be2=_0x4a5bea;_0x7e7e81=0xc8;}else{_0x7e7e81=0xce;}_0x5e1811['status'](_0x7e7e81);return _0x5e1811[_0x41fc('0x25')]('Content-Range',_0x2bb7cd+'-'+_0x63be2+'/'+_0x4a5bea)[_0x41fc('0x20')](_0x5dc5e6);}return null;};}function saveUpdates(_0x4256ea){return function(_0x4f6f88){if(_0x4f6f88){return _0x4f6f88['update'](_0x4256ea)[_0x41fc('0x14')](function(_0x127c62){return _0x127c62;});}return null;};}function removeEntity(_0x119145){return function(_0x599f36){if(_0x599f36){return _0x599f36[_0x41fc('0x26')]()[_0x41fc('0x14')](function(){_0x119145['status'](0xcc)[_0x41fc('0x1f')]();});}};}function handleEntityNotFound(_0x5d4660){return function(_0x3eccd9){if(!_0x3eccd9){_0x5d4660[_0x41fc('0x1d')](0x194);}return _0x3eccd9;};}function handleError(_0x5429f6,_0x17979c){_0x17979c=_0x17979c||0x1f4;return function(_0x39c588){logger['error'](_0x39c588['stack']);if(_0x39c588[_0x41fc('0x27')]){delete _0x39c588[_0x41fc('0x27')];}_0x5429f6[_0x41fc('0x1e')](_0x17979c)[_0x41fc('0x28')](_0x39c588);};}function getMustacheRender(_0x10e80a,_0x293f59){return Mustache[_0x41fc('0x29')](_0x10e80a,_[_0x41fc('0x2a')](_0x293f59[_0x41fc('0x2b')],{'contact':_0x293f59[_0x41fc('0x2c')],'message':_0x293f59['message'],'agent':_0x293f59[_0x41fc('0x2d')],'interaction':_0x293f59['interaction'],'account':_0x293f59[_0x41fc('0x2e')]}))||'';}exports[_0x41fc('0x2f')]=function(_0x3eca15,_0x138023){var _0x329a74={};var _0x3180fb=_[_0x41fc('0x30')](db['ChatInteraction'][_0x41fc('0x31')],function(_0x3c1a20){return{'name':_0x3c1a20[_0x41fc('0x32')],'type':_0x3c1a20[_0x41fc('0x33')][_0x41fc('0x34')]};});_0x329a74=qs[_0x41fc('0x35')](_0x3180fb,_0x3eca15);return interaction[_0x41fc('0x36')](_0x41fc('0x37'),_0x3eca15[_0x41fc('0x38')],_0x3eca15[_0x41fc('0x39')],_0x329a74,_0x3180fb)[_0x41fc('0x14')](respondWithFilteredResult(_0x138023,_0x329a74))[_0x41fc('0x1c')](handleError(_0x138023,null));};exports[_0x41fc('0x3a')]=function(_0x3c6d89,_0x46c5d0){var _0xd5e05b={'raw':![],'where':{'id':_0x3c6d89[_0x41fc('0x3b')]['id']}},_0x24e2b5={};_0x24e2b5[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x3e')][_0x41fc('0x31')]);_0x24e2b5[_0x41fc('0x38')]=_['keys'](_0x3c6d89[_0x41fc('0x38')]);_0x24e2b5['filters']=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],_0x24e2b5[_0x41fc('0x38')]);_0xd5e05b[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x41')]));_0xd5e05b[_0x41fc('0x40')]=_0xd5e05b[_0x41fc('0x40')][_0x41fc('0x42')]?_0xd5e05b[_0x41fc('0x40')]:_0x24e2b5[_0x41fc('0x3c')];if(_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x43')]){_0xd5e05b['include']=[{'all':!![]}];}_0xd5e05b=_[_0x41fc('0x2a')]({},_0xd5e05b,_0x3c6d89[_0x41fc('0x44')]);return db['ChatInteraction'][_0x41fc('0x45')](_0xd5e05b)[_0x41fc('0x14')](handleEntityNotFound(_0x46c5d0,null))[_0x41fc('0x14')](respondWithResult(_0x46c5d0,null))[_0x41fc('0x1c')](handleError(_0x46c5d0,null));};exports[_0x41fc('0x46')]=function(_0x5d5251,_0x26c961){return db['ChatInteraction'][_0x41fc('0x46')](_0x5d5251[_0x41fc('0x2b')],{})['then'](respondWithResult(_0x26c961,0xc9))[_0x41fc('0x1c')](handleError(_0x26c961,null));};exports[_0x41fc('0x47')]=function(_0x267cae,_0x396158){if(_0x267cae[_0x41fc('0x2b')]['id']){delete _0x267cae[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x267cae[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x396158,null))[_0x41fc('0x14')](saveUpdates(_0x267cae['body'],null))[_0x41fc('0x14')](respondWithResult(_0x396158,null))[_0x41fc('0x1c')](handleError(_0x396158,null));};exports['destroy']=function(_0xacd39f,_0x52509b){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0xacd39f[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x52509b,null))[_0x41fc('0x14')](removeEntity(_0x52509b,null))['catch'](handleError(_0x52509b,null));};exports[_0x41fc('0x48')]=function(_0x200068,_0x338acb){return db[_0x41fc('0x3e')][_0x41fc('0x48')]()[_0x41fc('0x14')](respondWithResult(_0x338acb,null))[_0x41fc('0x1c')](handleError(_0x338acb,null));};exports[_0x41fc('0x49')]=function(_0x2f6d7d,_0x5e3dcd){var _0x13294c=_0x2f6d7d['params']['id'];var _0x4a5810;var _0x1d78c6;var _0x505c60;return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x13294c}})['then'](function(_0x3743d2){_0x4a5810=_0x3743d2;return db[_0x41fc('0x4b')][_0x41fc('0x4a')]({'where':{'id':_0x3743d2[_0x41fc('0x4c')]},'attributes':['id',_0x41fc('0x4d'),_0x41fc('0x4e'),_0x41fc('0x4f'),_0x41fc('0x50'),_0x41fc('0x51')],'raw':!![]});})[_0x41fc('0x14')](function(_0x37ce77){if(_0x37ce77&&_0x37ce77['vidaooApiKey']&&_0x37ce77[_0x41fc('0x4e')]){_0x1d78c6=_0x37ce77;var _0xf64fa8={'interaction':{'id':_0x13294c},'agent':{'id':_0x2f6d7d[_0x41fc('0x39')]['id'],'name':_0x2f6d7d['user']['name'],'fullname':_0x2f6d7d[_0x41fc('0x39')][_0x41fc('0x52')],'email':_0x2f6d7d[_0x41fc('0x39')]['email']},'contact':_0x2f6d7d['body'][_0x41fc('0x2c')],'account':_0x2f6d7d[_0x41fc('0x2b')][_0x41fc('0x2e')]};var _0x35abac={'rejectUnauthorized':![],'method':_0x41fc('0x53'),'url':_0x41fc('0x54'),'headers':{'X-APIKEY':_0x37ce77[_0x41fc('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2f6d7d[_0x41fc('0x39')]['email']],'buttons':null,'topic':_0x1d78c6[_0x41fc('0x4f')],'note':_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x50')])?null:getMustacheRender(_0x1d78c6[_0x41fc('0x50')],_0xf64fa8),'metadata':null},'redirect':_0x41fc('0x56'),'json':!![]};try{if(!_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x51')])){var _0x54adbb=getMustacheRender(_0x1d78c6[_0x41fc('0x51')],_0xf64fa8);var _0x250ab2=JSON[_0x41fc('0x57')](_0x54adbb);_0x35abac[_0x41fc('0x2b')][_0x41fc('0x58')]=_0x250ab2;}}catch(_0x2dc50b){throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5b'));}return rp(_0x35abac);}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5c'));}})[_0x41fc('0x14')](function(_0x4046b9){_0x505c60=_0x4046b9;if(_0x505c60['id']){var _0x5c1f31={'body':_0x505c60[_0x41fc('0x5d')],'ChatWebsiteId':_0x1d78c6['id'],'ChatInteractionId':_0x4a5810['id'],'direction':'out','UserId':_0x2f6d7d['user']['id']};return db['ChatMessage']['create'](_0x5c1f31,{});}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5e'));}})['then'](function(){return _0x4a5810['updateAttributes']({'vidaooSessionId':_0x505c60['id']});})['then'](respondWithResult(_0x5e3dcd,null))[_0x41fc('0x1c')](handleError(_0x5e3dcd,null));};exports[_0x41fc('0x5f')]=function(_0x582077,_0x2e889d){if(_0x582077[_0x41fc('0x2b')]['id']){delete _0x582077['body']['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x582077['params']['id']},'include':[{'model':db['CmContact'],'as':_0x41fc('0x60')}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2e889d,null))[_0x41fc('0x14')](saveUpdates(_0x582077[_0x41fc('0x2b')],null))[_0x41fc('0x14')](respondWithResult(_0x2e889d,null))['catch'](handleError(_0x2e889d,null));};exports[_0x41fc('0x61')]=function(_0x430220,_0x5bd368){if(_0x430220[_0x41fc('0x2b')]['id']){delete _0x430220[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')]['find']({'where':{'id':_0x430220[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](function(_0x501a48){if(!_0x501a48){logger[_0x41fc('0x18')](_0x41fc('0x62'),_0x41fc('0x61'),0x194,_0x41fc('0x63'));_0x5bd368[_0x41fc('0x1d')](0x194);}else{if(_0x501a48[_0x41fc('0x64')]){throw new db['Sequelize']['ValidationError'](_0x41fc('0x65'));}}return _0x501a48;})[_0x41fc('0x14')](function(_0xa9454){if(_0xa9454){return _0xa9454['update']({'closed':_0x430220[_0x41fc('0x2b')]['closed'],'disposition':_0x430220[_0x41fc('0x2b')][_0x41fc('0x66')]})[_0x41fc('0x14')](function(_0x18e7d9){return _0x18e7d9;});}})['then'](function(){return respondWithRpcPromise(_0x41fc('0x67'),_0x41fc('0x61'),_0x430220[_0x41fc('0x2b')],client9004);})[_0x41fc('0x14')](respondWithResult(_0x5bd368,null))[_0x41fc('0x1c')](handleError(_0x5bd368,null));};exports[_0x41fc('0x68')]=function(_0x2f3b84,_0xc3ed0){_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x27')]=_0x2f3b84[_0x41fc('0x69')][_0x41fc('0x6a')];_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x6b')]=_0x2f3b84[_0x41fc('0x69')]['filename'];_0x2f3b84[_0x41fc('0x2b')]['type']=_0x2f3b84['file'][_0x41fc('0x6c')];return db[_0x41fc('0x6d')][_0x41fc('0x46')](_0x2f3b84[_0x41fc('0x2b')])['then'](respondWithResult(_0xc3ed0,0xc9))['catch'](handleError(_0xc3ed0,null));};exports[_0x41fc('0x6e')]=function(_0x43f567,_0x2ca377){return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43f567[_0x41fc('0x3b')]['id']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null))[_0x41fc('0x14')](function(_0x21ed99){if(_0x21ed99){if(_0x21ed99[_0x41fc('0x6f')]){return _0x2ca377['status'](0x193)[_0x41fc('0x20')]({'status':0x193,'message':_0x41fc('0x70')});}return db[_0x41fc('0x6d')][_0x41fc('0x4a')]({'where':{'id':_0x43f567['query']['attachId']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null));}})[_0x41fc('0x14')](function(_0x5d8d59){if(_0x5d8d59){var _0x4f4cb3=_0x5d8d59[_0x41fc('0x71')]!==null;var _0x3f3b7e=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x74'));if(_0x4f4cb3){_0x3f3b7e=path[_0x41fc('0x72')](_0x3f3b7e,_0x41fc('0x75'));}var _0xb5c435=path[_0x41fc('0x72')](_0x3f3b7e,_0x5d8d59[_0x41fc('0x6b')]);return _0x2ca377[_0x41fc('0x76')](_0xb5c435);}})[_0x41fc('0x1c')](handleError(_0x2ca377,null));};exports['close']=function(_0x280911,_0x2a8278){var _0x153f21=null;var _0x45cd04=null;var _0x3eb16f=null;if(_0x280911[_0x41fc('0x2b')]['id']){delete _0x280911[_0x41fc('0x2b')]['id'];}if(_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')]){_0x3eb16f=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x78'),util[_0x41fc('0x79')](_0x41fc('0x7a'),Date[_0x41fc('0x7b')]()));_0x280911[_0x41fc('0x2b')][_0x41fc('0x7c')]=_0x3eb16f;}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x280911[_0x41fc('0x3b')]['id']},'include':[{'model':db[_0x41fc('0x7d')],'as':_0x41fc('0x7e'),'include':[{'model':db[_0x41fc('0x7f')],'as':_0x41fc('0x7f')}]}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8278,null))[_0x41fc('0x14')](saveUpdates(_0x280911[_0x41fc('0x2b')],null))[_0x41fc('0x14')](function(_0x5239d5){if(_0x5239d5){_0x153f21=_0x5239d5;return db['ChatWebsite'][_0x41fc('0x45')]({'where':{'id':_0x153f21['ChatWebsiteId']}});}})[_0x41fc('0x14')](function(_0x244ecb){if(_0x244ecb){_0x45cd04=_0x244ecb;return db[_0x41fc('0x80')][_0x41fc('0x45')]({'where':{'id':_0x153f21[_0x41fc('0x81')]}});}})[_0x41fc('0x14')](function(_0x5acbc7){if(_0x5acbc7){if(_0x3eb16f){var _0x317625=null;for(var _0xd99007=0x1;_0xd99007<_0x153f21['Messages'][_0x41fc('0x42')];++_0xd99007){_0x317625=_0x153f21[_0x41fc('0x7e')][_0xd99007];var _0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')]('%s%d',_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):'System';var _0xf58b49=_0x280911[_0x41fc('0x2b')][_0x41fc('0x83')]||util['format']('%s%d',_0x41fc('0x84'),_0x317625['ContactId']);switch(_0x45cd04[_0x41fc('0x85')]){case _0x41fc('0x86'):_0x1d9947=_0x317625[_0x41fc('0x64')]?util['format'](_0x41fc('0x87'),_0x45cd04['agentAlias'],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');break;case'agent_alias':_0x1d9947=_0x317625[_0x41fc('0x64')]?_0x317625[_0x41fc('0x7f')][_0x41fc('0x89')]||_0x317625['User'][_0x41fc('0x52')]:'System';break;case _0x41fc('0x8a'):_0x1d9947=_0x317625['UserId']?_0x317625['User']['fullname']:_0x41fc('0x88');break;default:_0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')](_0x41fc('0x87'),_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');}var _0x4b5c37=util[_0x41fc('0x79')](_0x41fc('0x8b'),moment(_0x317625[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0x8d')),_0x317625['direction']==='in'?_0xf58b49:_0x1d9947,_0x317625[_0x41fc('0x2b')]);if(!_0x317625[_0x41fc('0x8e')]){fs[_0x41fc('0x8f')](_0x3eb16f,_0x4b5c37);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x41fc('0x90')],'as':_0x41fc('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x41fc('0x92'),'raw':!![]}]}]});}}})[_0x41fc('0x14')](function(_0x2f09ce){if(!_0x2f09ce||!_0x2f09ce['Smtp']||!_0x280911[_0x41fc('0x2b')])return _0x153f21;var _0x3058dc=_0x2f09ce[_0x41fc('0x93')]();return respondWithRpcPromise(_0x41fc('0x94'),_0x41fc('0x95'),{'account':_0x3058dc,'message':{'from':util[_0x41fc('0x79')](_0x41fc('0x96'),_0x2f09ce[_0x41fc('0x27')],_0x2f09ce[_0x41fc('0x97')]||_0x2f09ce['Smtp'][_0x41fc('0x39')]),'to':_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')],'subject':_0x41fc('0x98'),'text':util['format'](_0x41fc('0x99'),_0x280911['body'][_0x41fc('0x77')]),'attachments':[{'path':_0x3eb16f}]}})['then'](function(){return _0x153f21;})[_0x41fc('0x1c')](function(_0xe43fb9){logger[_0x41fc('0x18')](_0xe43fb9);});})[_0x41fc('0x14')](respondWithStatusCode(_0x2a8278,0xc8))[_0x41fc('0x1c')](handleError(_0x2a8278,null));};exports['addMessage']=function(_0x4a501d,_0x2a8b6b){return db[_0x41fc('0x7d')][_0x41fc('0x45')]({'where':{'id':_0x4a501d[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8b6b,null))[_0x41fc('0x14')](function(_0x368769){if(_0x368769){return _0x368769[_0x41fc('0x9a')](_0x4a501d[_0x41fc('0x2b')][_0x41fc('0x9b')],_['omit'](_0x4a501d[_0x41fc('0x2b')],[_0x41fc('0x9b'),'id'])||{});}})[_0x41fc('0x14')](respondWithResult(_0x2a8b6b,null))[_0x41fc('0x1c')](handleError(_0x2a8b6b,null));};exports['getMessages']=function(_0x28d988,_0x2306b1){var _0x499387={'raw':![],'where':{}};var _0x5c2fcc={};var _0x48c3ec={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')]['findOne']({'where':{'id':_0x28d988[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2306b1,null))[_0x41fc('0x14')](function(_0x1d0462){if(_0x1d0462){_0x5c2fcc[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x5c2fcc[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x28d988['query']);_0x5c2fcc['filters']=_[_0x41fc('0x3f')](_0x5c2fcc['model'],_0x5c2fcc['query']);_0x499387['attributes']=_[_0x41fc('0x3f')](_0x5c2fcc[_0x41fc('0x3c')],qs['fields'](_0x28d988[_0x41fc('0x38')][_0x41fc('0x41')]));_0x499387[_0x41fc('0x40')]=_0x499387[_0x41fc('0x40')]['length']?_0x499387[_0x41fc('0x40')]:_0x5c2fcc[_0x41fc('0x3c')];if(!_0x28d988['query']['hasOwnProperty'](_0x41fc('0x9c'))){_0x499387[_0x41fc('0x23')]=qs[_0x41fc('0x23')](_0x28d988[_0x41fc('0x38')]['limit']);_0x499387[_0x41fc('0x21')]=qs['offset'](_0x28d988['query'][_0x41fc('0x21')]);}_0x499387[_0x41fc('0x9d')]=qs[_0x41fc('0x9e')](_0x28d988['query'][_0x41fc('0x9e')]);_0x499387['where']=qs[_0x41fc('0x9f')](_[_0x41fc('0xa0')](_0x28d988[_0x41fc('0x38')],_0x5c2fcc[_0x41fc('0x9f')]));_0x499387['where'][_0x41fc('0xa1')]=_0x1d0462['id'];if(_0x28d988['query']['filter']){_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x499387[_0x41fc('0x40')],function(_0x5d153a){var _0x3766ea={};_0x3766ea[_0x5d153a]={'$like':'%'+_0x28d988[_0x41fc('0x38')][_0x41fc('0xa3')]+'%'};return _0x3766ea;})});}if(_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')]){var _0x12d710=_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')][_0x41fc('0xa5')](',');var _0x5784e5={};_0x5784e5[_0x12d710[0x0]]={'$gte':moment(_0x12d710[0x1])[_0x41fc('0x79')](_0x41fc('0xa6'))};_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],_0x5784e5);}_0x499387=_[_0x41fc('0x2a')]({},_0x499387,_0x28d988[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x499387[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x3508a5){_0x48c3ec['count']=_0x3508a5;if(_0x28d988[_0x41fc('0x38')][_0x41fc('0x43')]){_0x499387[_0x41fc('0xa7')]=[{'all':!![]}];}return db['ChatMessage'][_0x41fc('0x36')](_0x499387);})['then'](function(_0x24a09a){_0x48c3ec['rows']=_0x24a09a;return _0x48c3ec;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2306b1,_0x499387))[_0x41fc('0x1c')](handleError(_0x2306b1,null));};exports[_0x41fc('0xa8')]=function(_0x43fd16,_0x2999d4){var _0x12bb76={'where':{}},_0x53ddc0={},_0xfe031b={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43fd16[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2999d4,null))['then'](function(_0x52658f){if(_0x52658f){_0x53ddc0[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x53ddc0[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x43fd16[_0x41fc('0x38')]);_0x53ddc0['filters']=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],_0x53ddc0[_0x41fc('0x38')]);_0x12bb76[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x41')]));_0x12bb76[_0x41fc('0x40')]=_0x12bb76[_0x41fc('0x40')][_0x41fc('0x42')]?_0x12bb76[_0x41fc('0x40')]:_0x53ddc0[_0x41fc('0x3c')];if(!_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa9')]('nolimit')){_0x12bb76['limit']=qs[_0x41fc('0x23')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x23')]);_0x12bb76[_0x41fc('0x21')]=qs[_0x41fc('0x21')](_0x43fd16['query'][_0x41fc('0x21')]);}_0x12bb76['order']=qs[_0x41fc('0x9e')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x9e')]);_0x12bb76[_0x41fc('0xa2')]=qs['filters'](_['pick'](_0x43fd16[_0x41fc('0x38')],_0x53ddc0[_0x41fc('0x9f')]));_0x12bb76[_0x41fc('0xa2')][_0x41fc('0xa1')]=_0x52658f['id'];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa3')]){_0x12bb76[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x12bb76[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x12bb76['attributes'],function(_0x2db164){var _0x9c8f40={};_0x9c8f40[_0x2db164]={'$like':'%'+_0x43fd16[_0x41fc('0x38')]['filter']+'%'};return _0x9c8f40;})});}_0x12bb76[_0x41fc('0xa2')]['secret']=![];if(_0x43fd16[_0x41fc('0x38')]['id']){_0x12bb76[_0x41fc('0xa2')]['id']={'$gt':_0x43fd16[_0x41fc('0x38')]['id']};}_0x12bb76=_['merge']({},_0x12bb76,_0x43fd16[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x12bb76[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x1edbc8){_0xfe031b[_0x41fc('0x24')]=_0x1edbc8;_0x12bb76['include']=[];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xaa')]){_0x12bb76[_0x41fc('0xa7')][_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id',_0x41fc('0x52'),_0x41fc('0x89')]});}if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0x43')]){_0x12bb76[_0x41fc('0xa7')]=[{'all':!![]}];}return db[_0x41fc('0x7d')][_0x41fc('0x36')](_0x12bb76);})[_0x41fc('0x14')](function(_0x4870e8){_0xfe031b[_0x41fc('0xac')]=_0x4870e8;return _0xfe031b;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2999d4,_0x12bb76))[_0x41fc('0x1c')](handleError(_0x2999d4,null));};exports[_0x41fc('0xad')]=function(_0x18b8a4,_0xb4a7a3){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0x18b8a4['params']['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0xb4a7a3,null))['then'](function(_0x400ab6){if(_0x400ab6){return _0x400ab6[_0x41fc('0xae')](_0x18b8a4[_0x41fc('0x2b')][_0x41fc('0x9b')],_[_0x41fc('0xaf')](_0x18b8a4['body'],[_0x41fc('0x9b'),'id'])||{})[_0x41fc('0xb0')](function(){return db[_0x41fc('0xb1')]['findAll']({'attributes':['id',_0x41fc('0x27'),_0x41fc('0xb2')],'where':{'id':_0x18b8a4[_0x41fc('0x2b')]['ids']}});})[_0x41fc('0x14')](function(_0xf0330a){socket['emit'](_0x41fc('0xb3'),{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]});return{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]};});}})[_0x41fc('0x14')](respondWithResult(_0xb4a7a3,null))[_0x41fc('0x1c')](handleError(_0xb4a7a3,null));};exports[_0x41fc('0xb4')]=function(_0x1bdb9b,_0x12bf27){return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x1bdb9b[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x12bf27,null))['then'](function(_0x10df5b){if(_0x10df5b){return _0x10df5b[_0x41fc('0xb4')](_0x1bdb9b[_0x41fc('0x38')]['ids']);}})[_0x41fc('0x14')](respondWithStatusCode(_0x12bf27,null))[_0x41fc('0x1c')](handleError(_0x12bf27,null));};exports[_0x41fc('0x76')]=function(_0x5574e7,_0x5489d6){var _0x5d0428=moment()[_0x41fc('0xb5')]()['toString']();var _0x1a89fb=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),_0x41fc('0xb8'));var _0x7e95ef=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),'attachments');var _0x288038=path[_0x41fc('0x72')](_0x1a89fb,_0x5d0428);var _0x3a0ccb=util[_0x41fc('0x79')](_0x41fc('0xb9'),_0x5574e7['params']['id'],_0x5d0428);var _0x511650=path['join'](_0x1a89fb,_0x3a0ccb);var _0x3231ef=[];_0x3231ef[_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x3231ef[_0x41fc('0xab')]({'model':db[_0x41fc('0x80')],'as':_0x41fc('0x60'),'attributes':['id','firstName',_0x41fc('0xba')],'raw':!![]});if(_0x5574e7[_0x41fc('0x38')][_0x41fc('0xbb')]){_0x3231ef[_0x41fc('0xab')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x271260=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body','createdAt',_0x41fc('0xbc'),_0x41fc('0x8e'),_0x41fc('0xbd')],'include':_0x3231ef}];_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x4b')],'as':_0x41fc('0xbe'),'attributes':['id',_0x41fc('0x27')]});_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x7f')],'as':_0x41fc('0xbf'),'attributes':['id',_0x41fc('0x52')]});return db['ChatInteraction']['find']({'where':{'id':_0x5574e7[_0x41fc('0x3b')]['id']},'include':_0x271260})[_0x41fc('0x14')](handleEntityNotFound(_0x5489d6,null))[_0x41fc('0x14')](function(_0x4fc3d3){if(_0x4fc3d3){var _0x106fa2=_0x4fc3d3[_0x41fc('0xc0')]({'plain':!![]});fs[_0x41fc('0xc1')](_0x288038);var _0x61dfdb={'channel':_0x41fc('0xc2'),'account':_0x106fa2[_0x41fc('0xbe')][_0x41fc('0x27')],'agent':_0x106fa2[_0x41fc('0xbf')]?_0x106fa2[_0x41fc('0xbf')]['fullname']:_0x41fc('0xc3'),'createdAt':moment(_0x106fa2[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'closedAt':_0x106fa2[_0x41fc('0x6f')]?moment(_0x106fa2[_0x41fc('0xc5')])[_0x41fc('0x79')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x106fa2[_0x41fc('0x66')],'chatInfo':{'browser':_0x106fa2['browserName'],'os':_0x106fa2['osName'],'referer':_0x106fa2[_0x41fc('0xc6')],'customerIp':_0x106fa2[_0x41fc('0xc7')],'customerPort':_0x106fa2[_0x41fc('0xc8')]?_0x106fa2[_0x41fc('0xc8')]:'N.A.'},'messages':_(_0x106fa2[_0x41fc('0x7e')])[_0x41fc('0xc9')]()[_0x41fc('0xa3')]({'secret':![]})[_0x41fc('0x30')](function(_0x374c93){if(_0x374c93[_0x41fc('0x6d')]){var _0x5cf940=path[_0x41fc('0x72')](_0x7e95ef,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]);if(fs['existsSync'](_0x5cf940)){fs[_0x41fc('0xca')](_0x5cf940)[_0x41fc('0xcb')](fs['createWriteStream'](path[_0x41fc('0x72')](_0x288038,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')])));}}return{'date':moment(_0x374c93[_0x41fc('0x8c')])['format'](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'sender':_0x374c93['direction']===_0x41fc('0xcc')?_0x374c93['User']?_0x374c93[_0x41fc('0x7f')][_0x41fc('0x52')]:'System':_0x374c93[_0x41fc('0x60')][_0x41fc('0xcd')]+(_0x374c93['Contact']['lastName']?'\x20'+_0x374c93[_0x41fc('0x60')][_0x41fc('0xba')]:''),'body':_0x374c93[_0x41fc('0x6d')]?_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]:_0x374c93[_0x41fc('0x2b')],'direction':_0x374c93[_0x41fc('0xbc')]===_0x41fc('0xcc')?'A':'C','secret':_0x374c93[_0x41fc('0x8e')],'read':_0x374c93[_0x41fc('0xbd')],'attachment':_0x374c93[_0x41fc('0x6d')]};})[_0x41fc('0xce')]()};return ejs['renderFile'](path[_0x41fc('0x72')](config['root'],'server',_0x41fc('0xcf'),_0x41fc('0xd0')),{'interaction':_0x61dfdb})[_0x41fc('0x14')](function(_0x152607){var _0x6c976c=path['join'](_0x288038,_0x41fc('0xd1')+_0x106fa2['id']+'-'+_0x5d0428+_0x41fc('0xd2'));var _0x1debfc={'path':_0x6c976c,'channel':_0x41fc('0xc2'),'interactionId':_0x106fa2['id']};return pdf[_0x41fc('0xd3')](_0x152607,_0x1debfc);})['then'](function(){return new Promise(function(_0x335804,_0x46183a){zipdir(_0x288038,{'saveTo':_0x511650},function(_0x2497d3,_0x4f4538){if(_0x2497d3)return _0x46183a(_0x2497d3);return _0x335804(_0x4f4538);});})['then'](function(){return new BPromise(function(_0x1246de,_0xfaec57){rimraf(_0x288038,function(_0x5d7888){if(_0x5d7888)_0xfaec57(_0x5d7888);return _0x1246de();});});})['then'](function(){return _0x5489d6[_0x41fc('0x76')](_0x511650,_0x3a0ccb,function(_0x26a894){if(_0x26a894){logger[_0x41fc('0x18')](_0x41fc('0xd4'),_0x26a894);}else{fs[_0x41fc('0xd5')](_0x511650);}});});});}else{return _0x5489d6[_0x41fc('0x1d')](0xc8);}})[_0x41fc('0x1c')](handleError(_0x5489d6,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index c785d1a..77d7837 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 _0x69db=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69db,0x185));var _0xb69d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x69db[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xb69d('0x0'));var ChatInteraction=require(_0xb69d('0x1'))['db'][_0xb69d('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb69d('0x3')](0x0);var events={'afterCreate':_0xb69d('0x4'),'afterUpdate':_0xb69d('0x5'),'afterDestroy':_0xb69d('0x6')};function emitEvent(_0x1b1c22){return function(_0x5398b6,_0x280b4c,_0x9cd51b){_0x5398b6[_0xb69d('0x7')]({'attributes':['id'],'raw':!![]})[_0xb69d('0x8')](function(_0x486a07){_0x5398b6[_0xb69d('0x9')](_0xb69d('0xa'),_0x486a07[_0xb69d('0xb')](function(_0x1e70ac){return{'id':_0x1e70ac['id']};}));return ChatMessage[_0xb69d('0xc')]({'where':{'ChatInteractionId':_0x5398b6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb69d('0x8')](function(_0x2aad93){_0x5398b6[_0xb69d('0x9')](_0xb69d('0xd'),_0x2aad93[_0xb69d('0xe')]);ChatInteractionEvents[_0xb69d('0xf')](_0x1b1c22+':'+_0x5398b6['id'],_0x5398b6);ChatInteractionEvents[_0xb69d('0xf')](_0x1b1c22,_0x5398b6);_0x9cd51b(null);})[_0xb69d('0x10')](_0x9cd51b(null));};}for(var e in events){if(events[_0xb69d('0x11')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xb69d('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0xe714=['getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove'];(function(_0x313112,_0x4af4a4){var _0x422beb=function(_0x545c94){while(--_0x545c94){_0x313112['push'](_0x313112['shift']());}};_0x422beb(++_0x4af4a4);}(_0xe714,0xad));var _0x4e71=function(_0x1f9426,_0x4d0b55){_0x1f9426=_0x1f9426-0x0;var _0xd40e25=_0xe714[_0x1f9426];return _0xd40e25;};'use strict';var EventEmitter=require(_0x4e71('0x0'));var ChatInteraction=require(_0x4e71('0x1'))['db'][_0x4e71('0x2')];var ChatMessage=require(_0x4e71('0x1'))['db'][_0x4e71('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4e71('0x4')](0x0);var events={'afterCreate':_0x4e71('0x5'),'afterUpdate':'update','afterDestroy':_0x4e71('0x6')};function emitEvent(_0x4f297f){return function(_0x47d817,_0x3b0084,_0x232a3e){_0x47d817[_0x4e71('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x37bf78){_0x47d817[_0x4e71('0x8')](_0x4e71('0x9'),_0x37bf78['map'](function(_0x734cc){return{'id':_0x734cc['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x47d817['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4e71('0xa')](function(_0x5c2c9a){_0x47d817['setDataValue'](_0x4e71('0xb'),_0x5c2c9a[_0x4e71('0xc')]);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f+':'+_0x47d817['id'],_0x47d817);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f,_0x47d817);_0x232a3e(null);})[_0x4e71('0xe')](_0x232a3e(null));};}for(var e in events){if(events[_0x4e71('0xf')](e)){var event=events[e];ChatInteraction[_0x4e71('0x10')](e,emitEvent(event));}}module[_0x4e71('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index dbd2cf1..d71efb7 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 _0xbeb7=['utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x5376e2,_0x2d1ee2){var _0x117f76=function(_0x2bfb70){while(--_0x2bfb70){_0x5376e2['push'](_0x5376e2['shift']());}};_0x117f76(++_0x2d1ee2);}(_0xbeb7,0x153));var _0x7beb=function(_0x1adae4,_0x212915){_0x1adae4=_0x1adae4-0x0;var _0x163927=_0xbeb7[_0x1adae4];return _0x163927;};'use strict';var _=require('lodash');var util=require(_0x7beb('0x0'));var logger=require(_0x7beb('0x1'))('api');var moment=require(_0x7beb('0x2'));var BPromise=require(_0x7beb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7beb('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x7beb('0x5')]=function(_0x21a955,_0x56efdc){return _0x21a955['define'](_0x7beb('0x6'),attributes,{'tableName':_0x7beb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x419ce2,_0x4c3d04,_0x39c0cc){if(_0x419ce2[_0x7beb('0x8')](_0x7beb('0x9'))){_0x419ce2[_0x7beb('0xa')]=moment()[_0x7beb('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x39c0cc(null,_0x419ce2);}},'charset':'utf8mb4','collate':_0x7beb('0xc')});}; \ No newline at end of file +var _0x3e2c=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird'];(function(_0x19c967,_0x4d538e){var _0x386e76=function(_0x5678e8){while(--_0x5678e8){_0x19c967['push'](_0x19c967['shift']());}};_0x386e76(++_0x4d538e);}(_0x3e2c,0x1b6));var _0xc3e2=function(_0x23b7e4,_0x1c9417){_0x23b7e4=_0x23b7e4-0x0;var _0x40d91b=_0x3e2c[_0x23b7e4];return _0x40d91b;};'use strict';var _=require(_0xc3e2('0x0'));var util=require(_0xc3e2('0x1'));var logger=require(_0xc3e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e2('0x4'));var rimraf=require(_0xc3e2('0x5'));var config=require(_0xc3e2('0x6'));var attributes=require(_0xc3e2('0x7'));module[_0xc3e2('0x8')]=function(_0xfffadc,_0x3e4644){return _0xfffadc['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a095a,_0x37bff2,_0x4f87bc){if(_0x1a095a['changed'](_0xc3e2('0x9'))){_0x1a095a[_0xc3e2('0xa')]=moment()[_0xc3e2('0xb')](_0xc3e2('0xc'));}_0x4f87bc(null,_0x1a095a);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 56f6bf2..72fd8d1 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 _0x29d2=['register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x51318d,_0x61f162){var _0x47552d=function(_0x20ca74){while(--_0x20ca74){_0x51318d['push'](_0x51318d['shift']());}};_0x47552d(++_0x61f162);}(_0x29d2,0x17d));var _0x229d=function(_0x4d585d,_0x45fe07){_0x4d585d=_0x4d585d-0x0;var _0x371652=_0x29d2[_0x4d585d];return _0x371652;};'use strict';var _=require('lodash');var util=require(_0x229d('0x0'));var moment=require(_0x229d('0x1'));var BPromise=require('bluebird');var rs=require(_0x229d('0x2'));var fs=require('fs');var Redis=require(_0x229d('0x3'));var db=require(_0x229d('0x4'))['db'];var utils=require(_0x229d('0x5'));var logger=require(_0x229d('0x6'))(_0x229d('0x7'));var config=require(_0x229d('0x8'));var jayson=require(_0x229d('0x9'));var client=jayson[_0x229d('0xa')]['http']({'port':0x232a});config['redis']=_[_0x229d('0xb')](config[_0x229d('0xc')],{'host':_0x229d('0xd'),'port':0x18eb});var socket=require(_0x229d('0xe'))(new Redis(config[_0x229d('0xc')]));require('./chatInteraction.socket')[_0x229d('0xf')](socket);function respondWithRpcPromise(_0x444034,_0x594b58,_0x15dbba){return new BPromise(function(_0x1b3eb5,_0x41ba97){return client[_0x229d('0x10')](_0x444034,_0x15dbba)[_0x229d('0x11')](function(_0x358651){logger[_0x229d('0x12')](_0x229d('0x13'),_0x594b58,_0x229d('0x14'));logger[_0x229d('0x15')](_0x229d('0x16'),_0x594b58,_0x229d('0x14'),JSON['stringify'](_0x358651));if(_0x358651[_0x229d('0x17')]){if(_0x358651[_0x229d('0x17')][_0x229d('0x18')]===0x1f4){logger[_0x229d('0x17')](_0x229d('0x13'),_0x594b58,_0x358651[_0x229d('0x17')][_0x229d('0x19')]);return _0x41ba97(_0x358651['error'][_0x229d('0x19')]);}logger[_0x229d('0x17')](_0x229d('0x13'),_0x594b58,_0x358651[_0x229d('0x17')][_0x229d('0x19')]);return _0x1b3eb5(_0x358651[_0x229d('0x17')]['message']);}else{logger[_0x229d('0x12')](_0x229d('0x13'),_0x594b58,_0x229d('0x14'));_0x1b3eb5(_0x358651[_0x229d('0x1a')][_0x229d('0x19')]);}})[_0x229d('0x1b')](function(_0xf084e2){logger[_0x229d('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x594b58,_0xf084e2);_0x41ba97(_0xf084e2);});});}exports[_0x229d('0x1c')]=function(_0x1ed8a9){var _0x11b29e=this;return new Promise(function(_0x2dc5bf,_0x4c90e1){return db['ChatInteraction'][_0x229d('0x1d')](_0x1ed8a9[_0x229d('0x1e')],{'raw':_0x1ed8a9['options']?_0x1ed8a9['options'][_0x229d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ed8a9[_0x229d('0x20')]?_0x1ed8a9[_0x229d('0x20')][_0x229d('0x21')]||null:null,'attributes':_0x1ed8a9[_0x229d('0x20')]?_0x1ed8a9[_0x229d('0x20')][_0x229d('0x22')]||null:null,'limit':_0x1ed8a9[_0x229d('0x20')]?_0x1ed8a9[_0x229d('0x20')][_0x229d('0x23')]||null:null})[_0x229d('0x11')](function(_0x3e7cd2){logger[_0x229d('0x12')](_0x229d('0x1c'),_0x1ed8a9);logger[_0x229d('0x15')]('UpdateChatInteraction',_0x1ed8a9,JSON[_0x229d('0x24')](_0x3e7cd2));_0x2dc5bf(_0x3e7cd2);})[_0x229d('0x1b')](function(_0x13f1b1){logger[_0x229d('0x17')]('UpdateChatInteraction',_0x13f1b1[_0x229d('0x19')],_0x1ed8a9);_0x4c90e1(_0x11b29e[_0x229d('0x17')](0x1f4,_0x13f1b1[_0x229d('0x19')]));});});};exports[_0x229d('0x25')]=function(_0x4cc219){return new Promise(function(_0x35c56c,_0x4c3f38){return db['ChatInteraction'][_0x229d('0x26')]({'where':_0x4cc219['options']?_0x4cc219['options']['where']||null:null})[_0x229d('0x11')](function(_0x4ba141){if(_0x4ba141){return _0x4ba141[_0x229d('0x27')](_0x4cc219[_0x229d('0x1e')][_0x229d('0x28')],_[_0x229d('0x29')](_0x4cc219[_0x229d('0x1e')],['ids','id'])||{});}})[_0x229d('0x2a')](function(_0x47abe3){logger[_0x229d('0x12')](_0x229d('0x2b'),_0x4cc219);logger[_0x229d('0x15')]('AddTags',_0x4cc219,JSON[_0x229d('0x24')](_0x47abe3));_0x35c56c(_0x47abe3);})[_0x229d('0x1b')](function(_0x1cc8bc){logger[_0x229d('0x17')](_0x229d('0x2b'),_0x1cc8bc[_0x229d('0x19')],_0x4cc219);_0x4c3f38(_this[_0x229d('0x17')](0x1f4,_0x1cc8bc[_0x229d('0x19')]));});});}; \ No newline at end of file +var _0x9f0e=['defaults','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','then','debug','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis'];(function(_0x38709e,_0x674239){var _0x5b4fa3=function(_0x132443){while(--_0x132443){_0x38709e['push'](_0x38709e['shift']());}};_0x5b4fa3(++_0x674239);}(_0x9f0e,0x115));var _0xe9f0=function(_0x2fce43,_0x1d9626){_0x2fce43=_0x2fce43-0x0;var _0x537102=_0x9f0e[_0x2fce43];return _0x537102;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9f0('0x0'));var BPromise=require(_0xe9f0('0x1'));var rs=require(_0xe9f0('0x2'));var fs=require('fs');var Redis=require(_0xe9f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x4'));var logger=require('../../config/logger')(_0xe9f0('0x5'));var config=require('../../config/environment');var jayson=require(_0xe9f0('0x6'));var client=jayson[_0xe9f0('0x7')][_0xe9f0('0x8')]({'port':0x232a});config[_0xe9f0('0x9')]=_[_0xe9f0('0xa')](config[_0xe9f0('0x9')],{'host':_0xe9f0('0xb'),'port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))['register'](socket);function respondWithRpcPromise(_0x242147,_0x5ce997,_0x2c688d){return new BPromise(function(_0x25533b,_0x2cbd7d){return client['request'](_0x242147,_0x2c688d)['then'](function(_0x2f9d7b){logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,_0xe9f0('0x10'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5ce997,'request\x20sent',JSON['stringify'](_0x2f9d7b));if(_0x2f9d7b[_0xe9f0('0x11')]){if(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x12')]===0x1f4){logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x2cbd7d(_0x2f9d7b[_0xe9f0('0x11')]['message']);}logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x25533b(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x13')]);}else{logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,'request\x20sent');_0x25533b(_0x2f9d7b[_0xe9f0('0x14')][_0xe9f0('0x13')]);}})[_0xe9f0('0x15')](function(_0x43e3a8){logger[_0xe9f0('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x5ce997,_0x43e3a8);_0x2cbd7d(_0x43e3a8);});});}exports[_0xe9f0('0x16')]=function(_0xd7ecd0){var _0x4708d8=this;return new Promise(function(_0xa1df12,_0x347b0a){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0xd7ecd0[_0xe9f0('0x19')],{'raw':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null,'attributes':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0['options'][_0xe9f0('0x1d')]||null:null,'limit':_0xd7ecd0['options']?_0xd7ecd0['options'][_0xe9f0('0x1e')]||null:null})[_0xe9f0('0x1f')](function(_0x369677){logger[_0xe9f0('0xe')](_0xe9f0('0x16'),_0xd7ecd0);logger[_0xe9f0('0x20')]('UpdateChatInteraction',_0xd7ecd0,JSON[_0xe9f0('0x21')](_0x369677));_0xa1df12(_0x369677);})[_0xe9f0('0x15')](function(_0x26e661){logger[_0xe9f0('0x11')](_0xe9f0('0x16'),_0x26e661['message'],_0xd7ecd0);_0x347b0a(_0x4708d8['error'](0x1f4,_0x26e661[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x22')]=function(_0x17f797){return new Promise(function(_0x8ac026,_0x505f93){return db[_0xe9f0('0x17')][_0xe9f0('0x23')]({'where':_0x17f797[_0xe9f0('0x1a')]?_0x17f797[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0x1f')](function(_0x3014fa){if(_0x3014fa){return _0x3014fa[_0xe9f0('0x24')](_0x17f797[_0xe9f0('0x19')][_0xe9f0('0x25')],_[_0xe9f0('0x26')](_0x17f797[_0xe9f0('0x19')],[_0xe9f0('0x25'),'id'])||{});}})[_0xe9f0('0x27')](function(_0x5c9772){logger[_0xe9f0('0xe')](_0xe9f0('0x28'),_0x17f797);logger[_0xe9f0('0x20')](_0xe9f0('0x28'),_0x17f797,JSON['stringify'](_0x5c9772));_0x8ac026(_0x5c9772);})[_0xe9f0('0x15')](function(_0x582148){logger[_0xe9f0('0x11')](_0xe9f0('0x28'),_0x582148[_0xe9f0('0x13')],_0x17f797);_0x505f93(_this[_0xe9f0('0x11')](0x1f4,_0x582148['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 64b2c35..2711d69 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 _0xe39c=['./chatInteraction.events','save','remove','update','emit','removeListener','register','chatInteraction:'];(function(_0x2d79b0,_0x29c6e9){var _0x323161=function(_0x170ae4){while(--_0x170ae4){_0x2d79b0['push'](_0x2d79b0['shift']());}};_0x323161(++_0x29c6e9);}(_0xe39c,0x98));var _0xce39=function(_0x3c582f,_0x223d44){_0x3c582f=_0x3c582f-0x0;var _0x37ba55=_0xe39c[_0x3c582f];return _0x37ba55;};'use strict';var ChatInteractionEvents=require(_0xce39('0x0'));var events=[_0xce39('0x1'),_0xce39('0x2'),_0xce39('0x3')];function createListener(_0x328df2,_0x3ad6da){return function(_0x47ecce){_0x3ad6da[_0xce39('0x4')](_0x328df2,_0x47ecce);};}function removeListener(_0x24b05e,_0x1870d2){return function(){ChatInteractionEvents[_0xce39('0x5')](_0x24b05e,_0x1870d2);};}exports[_0xce39('0x6')]=function(_0x11591c){for(var _0x577a4f=0x0,_0x55cf3c=events['length'];_0x577a4f<_0x55cf3c;_0x577a4f++){var _0xaf6c32=events[_0x577a4f];var _0x2a299d=createListener(_0xce39('0x7')+_0xaf6c32,_0x11591c);ChatInteractionEvents['on'](_0xaf6c32,_0x2a299d);}}; \ No newline at end of file +var _0x6332=['remove','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x184ae4,_0x511d97){var _0x5bb118=function(_0x2af1c3){while(--_0x2af1c3){_0x184ae4['push'](_0x184ae4['shift']());}};_0x5bb118(++_0x511d97);}(_0x6332,0x133));var _0x2633=function(_0x88d014,_0x3daebb){_0x88d014=_0x88d014-0x0;var _0x373690=_0x6332[_0x88d014];return _0x373690;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x2633('0x0'),_0x2633('0x1'),'update'];function createListener(_0x1e1e15,_0x5b3fca){return function(_0x34a09c){_0x5b3fca[_0x2633('0x2')](_0x1e1e15,_0x34a09c);};}function removeListener(_0x1fe5c2,_0x5174b7){return function(){ChatInteractionEvents[_0x2633('0x3')](_0x1fe5c2,_0x5174b7);};}exports[_0x2633('0x4')]=function(_0x45a63a){for(var _0x58f938=0x0,_0x25f01f=events[_0x2633('0x5')];_0x58f938<_0x25f01f;_0x58f938++){var _0x59d641=events[_0x58f938];var _0x522213=createListener(_0x2633('0x6')+_0x59d641,_0x45a63a);ChatInteractionEvents['on'](_0x59d641,_0x522213);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 40852a9..8152993 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 _0x4758=['chat','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/close','close','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','post','create','/:id/vidaoo','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags'];(function(_0x38b7a5,_0x12ae0e){var _0x117680=function(_0x17e970){while(--_0x17e970){_0x38b7a5['push'](_0x38b7a5['shift']());}};_0x117680(++_0x12ae0e);}(_0x4758,0x12b));var _0x8475=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4758[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8475('0x0'));var util=require(_0x8475('0x1'));var path=require('path');var timeout=require(_0x8475('0x2'));var express=require(_0x8475('0x3'));var router=express[_0x8475('0x4')]();var fs_extra=require(_0x8475('0x5'));var auth=require(_0x8475('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8475('0x7'));var controller=require(_0x8475('0x8'));router[_0x8475('0x9')]('/',auth[_0x8475('0xa')](),controller[_0x8475('0xb')]);router['get'](_0x8475('0xc'),auth[_0x8475('0xa')](),controller[_0x8475('0xd')]);router[_0x8475('0x9')](_0x8475('0xe'),auth[_0x8475('0xf')](),controller[_0x8475('0x10')]);router['get'](_0x8475('0x11'),auth[_0x8475('0xf')](),controller[_0x8475('0x12')]);router['get'](_0x8475('0x13'),auth['isAuthenticated'](),controller[_0x8475('0x14')]);router[_0x8475('0x9')]('/:id/my_messages',auth[_0x8475('0xf')](),controller[_0x8475('0x15')]);router[_0x8475('0x9')](_0x8475('0x16'),auth[_0x8475('0xa')](),controller['download']);router[_0x8475('0x17')]('/',auth[_0x8475('0xa')](),controller[_0x8475('0x18')]);router[_0x8475('0x17')](_0x8475('0x19'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14b721,_0x36fa0e,_0x1a36ed){_0x1a36ed(null,path['join'](config[_0x8475('0x1a')],_0x8475('0x1b')));},'filename':function(_0x5a38b6,_0x408b98,_0x25333f){_0x25333f(null,util['format'](_0x8475('0x1c'),Date[_0x8475('0x1d')](),_0x408b98[_0x8475('0x1e')][_0x8475('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8475('0x17')](_0x8475('0x20'),upload[_0x8475('0x21')](_0x8475('0x22')),controller[_0x8475('0x23')]);router['post'](_0x8475('0x13'),auth[_0x8475('0xf')](),controller['addMessage']);router[_0x8475('0x17')](_0x8475('0x24'),auth[_0x8475('0xa')](),interaction['tracked'](_0x8475('0x25'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0x8475('0xe'),auth['isAuthenticated'](),interaction[_0x8475('0x26')](_0x8475('0x25'),_0x8475('0x27')),controller[_0x8475('0x28')]);router[_0x8475('0x29')](_0x8475('0x2a'),controller[_0x8475('0x2b')]);router[_0x8475('0x29')]('/:id/abandon',auth[_0x8475('0xf')](),controller['abandon']);router[_0x8475('0x29')](_0x8475('0x2c'),controller[_0x8475('0x2d')]);router[_0x8475('0x2e')](_0x8475('0xe'),auth[_0x8475('0xa')](),interaction['tracked'](_0x8475('0x25'),'chatinteraction:destroy'),controller['destroy']);router[_0x8475('0x2e')](_0x8475('0x24'),auth['isAuthenticated'](),controller['removeTags']);module[_0x8475('0x2f')]=router; \ No newline at end of file +var _0x8ce6=['/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','tracked','destroy','removeTags','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ce6,0xa0));var _0x68ce=function(_0x51bebf,_0x22aa21){_0x51bebf=_0x51bebf-0x0;var _0x95197d=_0x8ce6[_0x51bebf];return _0x95197d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x68ce('0x0'));var timeout=require(_0x68ce('0x1'));var express=require('express');var router=express[_0x68ce('0x2')]();var fs_extra=require(_0x68ce('0x3'));var auth=require(_0x68ce('0x4'));var interaction=require(_0x68ce('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x68ce('0x6')](),controller['index']);router['get'](_0x68ce('0x7'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x8')]);router[_0x68ce('0x9')](_0x68ce('0xa'),auth[_0x68ce('0xb')](),controller['show']);router['get'](_0x68ce('0xc'),auth[_0x68ce('0xb')](),controller[_0x68ce('0xd')]);router['get'](_0x68ce('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x68ce('0xf'),auth[_0x68ce('0xb')](),controller['getMyMessages']);router[_0x68ce('0x9')](_0x68ce('0x10'),auth[_0x68ce('0x6')](),controller['download']);router[_0x68ce('0x11')]('/',auth[_0x68ce('0x6')](),controller['create']);router[_0x68ce('0x11')](_0x68ce('0x12'),auth['isAuthenticated'](),controller[_0x68ce('0x13')]);var upload=multer({'storage':multer[_0x68ce('0x14')]({'destination':function(_0x44f36f,_0x4564f5,_0x38b1cf){_0x38b1cf(null,path[_0x68ce('0x15')](config[_0x68ce('0x16')],_0x68ce('0x17')));},'filename':function(_0x3852a9,_0x19b9e5,_0x3c589e){_0x3c589e(null,util[_0x68ce('0x18')](_0x68ce('0x19'),Date[_0x68ce('0x1a')](),_0x19b9e5[_0x68ce('0x1b')][_0x68ce('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x68ce('0x11')]('/:id/attachment_upload',upload[_0x68ce('0x1d')](_0x68ce('0x1e')),controller[_0x68ce('0x1f')]);router[_0x68ce('0x11')]('/:id/messages',auth[_0x68ce('0xb')](),controller[_0x68ce('0x20')]);router[_0x68ce('0x11')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),interaction['tracked'](_0x68ce('0x22'),_0x68ce('0x23')),controller[_0x68ce('0x24')]);router[_0x68ce('0x25')](_0x68ce('0xa'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x68ce('0x26')),controller[_0x68ce('0x27')]);router['put'](_0x68ce('0x28'),controller[_0x68ce('0x29')]);router['put'](_0x68ce('0x2a'),auth[_0x68ce('0xb')](),controller[_0x68ce('0x2b')]);router[_0x68ce('0x25')](_0x68ce('0x2c'),controller['close']);router[_0x68ce('0x2d')](_0x68ce('0xa'),auth[_0x68ce('0x6')](),interaction[_0x68ce('0x2e')](_0x68ce('0x22'),'chatinteraction:destroy'),controller[_0x68ce('0x2f')]);router[_0x68ce('0x2d')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x30')]);module[_0x68ce('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 842ac9c..56f33ec 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 _0x4968=['BOOLEAN','INTEGER','sequelize','exports'];(function(_0x19da4d,_0x260981){var _0xc71c77=function(_0x4edb82){while(--_0x4edb82){_0x19da4d['push'](_0x19da4d['shift']());}};_0xc71c77(++_0x260981);}(_0x4968,0xea));var _0x8496=function(_0x2a3316,_0xe22ce9){_0x2a3316=_0x2a3316-0x0;var _0xd2f9e4=_0x4968[_0x2a3316];return _0xd2f9e4;};'use strict';var Sequelize=require(_0x8496('0x0'));module[_0x8496('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8496('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8496('0x3')]}}; \ No newline at end of file +var _0x07a2=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x07a2,0x13d));var _0x207a=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0x07a2[_0x1e7ead];return _0x3912b2;};'use strict';var Sequelize=require('sequelize');module[_0x207a('0x0')]={'body':{'type':Sequelize[_0x207a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x207a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x207a('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 5994580..3b78a9e 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 _0x8ea6=['query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','get','messages','lastMessageAt','createdAt','lastMessage','format','User','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','send','index','ChatInternalMessage','fieldName','key','model','map','name'];(function(_0x1d1a11,_0x471250){var _0x122a3c=function(_0x31dee5){while(--_0x31dee5){_0x1d1a11['push'](_0x1d1a11['shift']());}};_0x122a3c(++_0x471250);}(_0x8ea6,0x11a));var _0x68ea=function(_0x2096aa,_0x5c595d){_0x2096aa=_0x2096aa-0x0;var _0x3fc62d=_0x8ea6[_0x2096aa];return _0x3fc62d;};'use strict';var emlformat=require(_0x68ea('0x0'));var rimraf=require(_0x68ea('0x1'));var zipdir=require(_0x68ea('0x2'));var jsonpatch=require(_0x68ea('0x3'));var rp=require(_0x68ea('0x4'));var moment=require(_0x68ea('0x5'));var BPromise=require(_0x68ea('0x6'));var Mustache=require(_0x68ea('0x7'));var util=require(_0x68ea('0x8'));var path=require('path');var sox=require(_0x68ea('0x9'));var csv=require(_0x68ea('0xa'));var ejs=require(_0x68ea('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ea('0xc'));var squel=require(_0x68ea('0xd'));var crypto=require(_0x68ea('0xe'));var jsforce=require(_0x68ea('0xf'));var deskjs=require(_0x68ea('0x10'));var toCsv=require(_0x68ea('0xa'));var querystring=require(_0x68ea('0x11'));var Papa=require(_0x68ea('0x12'));var Redis=require(_0x68ea('0x13'));var authService=require(_0x68ea('0x14'));var qs=require(_0x68ea('0x15'));var as=require(_0x68ea('0x16'));var hardwareService=require(_0x68ea('0x17'));var logger=require(_0x68ea('0x18'))(_0x68ea('0x19'));var utils=require(_0x68ea('0x1a'));var config=require(_0x68ea('0x1b'));var licenseUtil=require(_0x68ea('0x1c'));var db=require(_0x68ea('0x1d'))['db'];config['redis']=_['defaults'](config[_0x68ea('0x1e')],{'host':_0x68ea('0x1f'),'port':0x18eb});var socket=require(_0x68ea('0x20'))(new Redis(config[_0x68ea('0x1e')]));require(_0x68ea('0x21'))[_0x68ea('0x22')](socket);function respondWithStatusCode(_0x99e0c0,_0x3c41d1){_0x3c41d1=_0x3c41d1||0xcc;return function(_0x114533){if(_0x114533){return _0x99e0c0['sendStatus'](_0x3c41d1);}return _0x99e0c0[_0x68ea('0x23')](_0x3c41d1)['end']();};}function respondWithResult(_0xab966a,_0x343694){_0x343694=_0x343694||0xc8;return function(_0xdae5f8){if(_0xdae5f8){return _0xab966a[_0x68ea('0x23')](_0x343694)[_0x68ea('0x24')](_0xdae5f8);}};}function respondWithFilteredResult(_0x28819d,_0x251835){return function(_0x1c16a7){if(_0x1c16a7){var _0x4ad021=typeof _0x251835[_0x68ea('0x25')]===_0x68ea('0x26')&&typeof _0x251835['limit']===_0x68ea('0x26');var _0x2b66af=_0x1c16a7[_0x68ea('0x27')];var _0x2db301=_0x4ad021?0x0:_0x251835[_0x68ea('0x25')];var _0x2e54d3=_0x4ad021?_0x1c16a7['count']:_0x251835[_0x68ea('0x25')]+_0x251835[_0x68ea('0x28')];var _0x383c88;if(_0x2e54d3>=_0x2b66af){_0x2e54d3=_0x2b66af;_0x383c88=0xc8;}else{_0x383c88=0xce;}_0x28819d[_0x68ea('0x23')](_0x383c88);return _0x28819d[_0x68ea('0x29')](_0x68ea('0x2a'),_0x2db301+'-'+_0x2e54d3+'/'+_0x2b66af)['json'](_0x1c16a7);}return null;};}function patchUpdates(_0x2b9b86){return function(_0x364815){try{jsonpatch[_0x68ea('0x2b')](_0x364815,_0x2b9b86,!![]);}catch(_0x203c83){return BPromise[_0x68ea('0x2c')](_0x203c83);}return _0x364815[_0x68ea('0x2d')]();};}function saveUpdates(_0x2a8539,_0x25972a){return function(_0x5e76a8){if(_0x5e76a8){return _0x5e76a8[_0x68ea('0x2e')](_0x2a8539)[_0x68ea('0x2f')](function(_0x54f4b2){return _0x54f4b2;});}return null;};}function removeEntity(_0x228579,_0x505549){return function(_0x50e7f5){if(_0x50e7f5){return _0x50e7f5['destroy']()[_0x68ea('0x2f')](function(){_0x228579[_0x68ea('0x23')](0xcc)[_0x68ea('0x30')]();});}};}function handleEntityNotFound(_0x1af729,_0x53bcc8){return function(_0x2e778a){if(!_0x2e778a){_0x1af729[_0x68ea('0x31')](0x194);}return _0x2e778a;};}function handleError(_0x41f751,_0x45be7b){_0x45be7b=_0x45be7b||0x1f4;return function(_0x203ad4){logger[_0x68ea('0x32')](_0x203ad4[_0x68ea('0x33')]);if(_0x203ad4['name']){delete _0x203ad4['name'];}_0x41f751[_0x68ea('0x23')](_0x45be7b)[_0x68ea('0x34')](_0x203ad4);};}exports[_0x68ea('0x35')]=function(_0x2b58b7,_0x32b32f){var _0xb784b5={},_0xa97096={},_0x3207f1={'count':0x0,'rows':[]};var _0x554a62=_['map'](db[_0x68ea('0x36')]['rawAttributes'],function(_0x589d3d){return{'name':_0x589d3d[_0x68ea('0x37')],'type':_0x589d3d['type'][_0x68ea('0x38')]};});_0xa97096[_0x68ea('0x39')]=_[_0x68ea('0x3a')](_0x554a62,_0x68ea('0x3b'));_0xa97096[_0x68ea('0x3c')]=_[_0x68ea('0x3d')](_0x2b58b7[_0x68ea('0x3c')]);_0xa97096[_0x68ea('0x3e')]=_[_0x68ea('0x3f')](_0xa97096[_0x68ea('0x39')],_0xa97096[_0x68ea('0x3c')]);_0xb784b5[_0x68ea('0x40')]=_[_0x68ea('0x3f')](_0xa97096[_0x68ea('0x39')],qs[_0x68ea('0x41')](_0x2b58b7[_0x68ea('0x3c')]['fields']));_0xb784b5[_0x68ea('0x40')]=_0xb784b5[_0x68ea('0x40')][_0x68ea('0x42')]?_0xb784b5[_0x68ea('0x40')]:_0xa97096['model'];if(!_0x2b58b7['query']['hasOwnProperty'](_0x68ea('0x43'))){_0xb784b5[_0x68ea('0x28')]=qs[_0x68ea('0x28')](_0x2b58b7[_0x68ea('0x3c')]['limit']);_0xb784b5[_0x68ea('0x25')]=qs[_0x68ea('0x25')](_0x2b58b7[_0x68ea('0x3c')]['offset']);}_0xb784b5[_0x68ea('0x44')]=qs[_0x68ea('0x45')](_0x2b58b7['query'][_0x68ea('0x45')]);_0xb784b5[_0x68ea('0x46')]=qs[_0x68ea('0x3e')](_['pick'](_0x2b58b7[_0x68ea('0x3c')],_0xa97096['filters']),_0x554a62);if(_0x2b58b7[_0x68ea('0x3c')]['filter']){_0xb784b5[_0x68ea('0x46')]=_[_0x68ea('0x47')](_0xb784b5[_0x68ea('0x46')],{'$or':_['map'](_0x554a62,function(_0x3a4284){if(_0x3a4284[_0x68ea('0x48')]!==_0x68ea('0x49')){var _0x1b71f6={};_0x1b71f6[_0x3a4284['name']]={'$like':'%'+_0x2b58b7['query'][_0x68ea('0x4a')]+'%'};return _0x1b71f6;}})});}_0xb784b5=_[_0x68ea('0x47')]({},_0xb784b5,_0x2b58b7['options']);var _0x148b36={'where':_0xb784b5[_0x68ea('0x46')]};return db['ChatInternalMessage'][_0x68ea('0x27')](_0x148b36)['then'](function(_0x33de74){_0x3207f1[_0x68ea('0x27')]=_0x33de74;if(_0x2b58b7['query'][_0x68ea('0x4b')]){_0xb784b5[_0x68ea('0x4c')]=[{'all':!![]}];}return db[_0x68ea('0x36')][_0x68ea('0x4d')](_0xb784b5);})[_0x68ea('0x2f')](function(_0x25b266){_0x3207f1['rows']=_0x25b266;return _0x3207f1;})[_0x68ea('0x2f')](respondWithFilteredResult(_0x32b32f,_0xb784b5))[_0x68ea('0x4e')](handleError(_0x32b32f,null));};exports['show']=function(_0x1f8323,_0x17c32f){var _0xdd3bea={'raw':!![],'where':{'id':_0x1f8323[_0x68ea('0x4f')]['id']}},_0x17a7e3={};_0x17a7e3[_0x68ea('0x39')]=_[_0x68ea('0x3d')](db[_0x68ea('0x36')][_0x68ea('0x50')]);_0x17a7e3['query']=_[_0x68ea('0x3d')](_0x1f8323['query']);_0x17a7e3['filters']=_[_0x68ea('0x3f')](_0x17a7e3[_0x68ea('0x39')],_0x17a7e3['query']);_0xdd3bea[_0x68ea('0x40')]=_[_0x68ea('0x3f')](_0x17a7e3['model'],qs[_0x68ea('0x41')](_0x1f8323[_0x68ea('0x3c')][_0x68ea('0x41')]));_0xdd3bea[_0x68ea('0x40')]=_0xdd3bea[_0x68ea('0x40')][_0x68ea('0x42')]?_0xdd3bea[_0x68ea('0x40')]:_0x17a7e3['model'];if(_0x1f8323['query'][_0x68ea('0x4b')]){_0xdd3bea['include']=[{'all':!![]}];}_0xdd3bea=_['merge']({},_0xdd3bea,_0x1f8323['options']);return db[_0x68ea('0x36')][_0x68ea('0x51')](_0xdd3bea)[_0x68ea('0x2f')](handleEntityNotFound(_0x17c32f,null))[_0x68ea('0x2f')](respondWithResult(_0x17c32f,null))['catch'](handleError(_0x17c32f,null));};exports[_0x68ea('0x52')]=function(_0x84088a,_0x30d6da){return db[_0x68ea('0x36')]['create'](_0x84088a[_0x68ea('0x53')],{})['then'](respondWithResult(_0x30d6da,0xc9))[_0x68ea('0x4e')](handleError(_0x30d6da,null));};exports[_0x68ea('0x2e')]=function(_0x633241,_0x408daf){if(_0x633241['body']['id']){delete _0x633241[_0x68ea('0x53')]['id'];}return db['ChatInternalMessage'][_0x68ea('0x51')]({'where':{'id':_0x633241[_0x68ea('0x4f')]['id']}})[_0x68ea('0x2f')](handleEntityNotFound(_0x408daf,null))['then'](saveUpdates(_0x633241[_0x68ea('0x53')],null))['then'](respondWithResult(_0x408daf,null))[_0x68ea('0x4e')](handleError(_0x408daf,null));};exports['destroy']=function(_0x3f3123,_0x5eb16e){return db[_0x68ea('0x36')][_0x68ea('0x51')]({'where':{'id':_0x3f3123[_0x68ea('0x4f')]['id']}})[_0x68ea('0x2f')](handleEntityNotFound(_0x5eb16e,null))[_0x68ea('0x2f')](removeEntity(_0x5eb16e,null))['catch'](handleError(_0x5eb16e,null));};exports['describe']=function(_0x3312d4,_0x246ece){return db['ChatInternalMessage']['describe']()[_0x68ea('0x2f')](respondWithResult(_0x246ece,null))['catch'](handleError(_0x246ece,null));};function wrapUser(_0x5f4258){return function(_0x368da5){var _0xab1ca2=_0x5f4258[_0x68ea('0x54')]({'plain':!![]});_0xab1ca2[_0x68ea('0x55')]=[];if(_0x368da5){_0xab1ca2[_0x68ea('0x56')]=_0x368da5[_0x68ea('0x57')];_0xab1ca2[_0x68ea('0x58')]=_0x368da5;}else{_0xab1ca2[_0x68ea('0x56')]=moment(0x0)[_0x68ea('0x59')]('YYYY-MM-DD\x20HH:mm:ss');_0xab1ca2['lastMessage']={};}return _0xab1ca2;};}exports['getUsers']=function(_0xdb673a,_0x378d5b,_0x154032){var _0x59a648=[];return db[_0x68ea('0x5a')][_0x68ea('0x4d')]({'where':{'role':[_0x68ea('0x5b'),_0x68ea('0x5c'),_0x68ea('0x5d')]},'attributes':['id',_0x68ea('0x5e'),_0x68ea('0x3b'),_0x68ea('0x5f'),'userpic',_0x68ea('0x60'),_0x68ea('0x61'),_0x68ea('0x62'),_0x68ea('0x63'),'showWebBar'],'order':qs['sort'](_0x68ea('0x64')),'include':[{'model':db[_0x68ea('0x65')],'as':'VoiceQueues','attributes':['id','name',_0x68ea('0x48')],'through':{'attributes':[]}}]})[_0x68ea('0x2f')](function(_0x43d0ea){if(_0x43d0ea){var _0x4af248=_0xdb673a[_0x68ea('0x5d')][_0x68ea('0x54')]({'plain':!![]});if(!_0x4af248)throw new Error(_0x68ea('0x66'));if(_0x4af248[_0x68ea('0x5f')]===_0x68ea('0x5d')){return db[_0x68ea('0x67')]['find']({'where':{'name':_0x68ea('0x68'),'userProfileId':_0x4af248[_0x68ea('0x69')]},'raw':!![]})['then'](function(_0x167c1e){if(_0x167c1e){if(_0x167c1e['autoAssociation']===0x0){return db[_0x68ea('0x6a')][_0x68ea('0x4d')]({'where':{'sectionId':_0x167c1e['id']},'raw':!![]})[_0x68ea('0x2f')](function(_0x2fdea5){var _0x39375d=[];if(_[_0x68ea('0x6b')](_0x2fdea5)){_0x39375d=_['filter'](_0x43d0ea,function(_0x2a7fbd){if(_0x2a7fbd['role']!=='agent'){return _0x2a7fbd;}});return _0x39375d;}else{for(var _0x42aae8=0x0;_0x42aae8<_0x43d0ea['length'];_0x42aae8++){var _0x5d2e5a=_0x43d0ea[_0x42aae8];if(_0x5d2e5a[_0x68ea('0x5f')]==='agent'){var _0x5cad3b=_[_0x68ea('0x51')](_0x2fdea5,function(_0x42b072){return _0x42b072[_0x68ea('0x6c')]===_0x5d2e5a['id'];});if(_0x5cad3b)_0x39375d[_0x68ea('0x6d')](_0x5d2e5a);}else{_0x39375d[_0x68ea('0x6d')](_0x5d2e5a);}}return _0x39375d;}});}else{return _0x43d0ea;}}else{var _0x5286a2=_[_0x68ea('0x4a')](_0x43d0ea,function(_0x40e57b){if(_0x40e57b[_0x68ea('0x5f')]!==_0x68ea('0x5b')){return _0x40e57b;}});return _0x5286a2;}});}else{return _0x43d0ea;}}})[_0x68ea('0x2f')](function(_0x54de30){var _0x337d1b=[];if(_0x54de30){_0x59a648=_0x54de30;for(var _0x1b98d0=0x0;_0x1b98d0<_0x54de30[_0x68ea('0x42')];_0x1b98d0+=0x1){_0x59a648[_0x1b98d0][_0x68ea('0x55')]=[];_0x337d1b[_0x68ea('0x6d')](db[_0x68ea('0x36')][_0x68ea('0x51')]({'where':{'FromId':[_0xdb673a[_0x68ea('0x5d')]['id'],_0x54de30[_0x1b98d0]['id']],'ToId':[_0xdb673a[_0x68ea('0x5d')]['id'],_0x54de30[_0x1b98d0]['id']],'ChatGroupId':null},'attributes':['id',_0x68ea('0x57'),_0x68ea('0x6e'),_0x68ea('0x6f'),_0x68ea('0x70'),_0x68ea('0x53')],'order':qs[_0x68ea('0x45')](_0x68ea('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x68ea('0x2f')](wrapUser(_0x54de30[_0x1b98d0])));}return BPromise['all'](_0x337d1b);}return[];})[_0x68ea('0x2f')](function(_0x2dac15){return{'rows':_0x2dac15,'count':_0x2dac15[_0x68ea('0x42')]};})[_0x68ea('0x2f')](respondWithResult(_0x378d5b,null))['catch'](handleError(_0x378d5b,null));}; \ No newline at end of file +var _0x1f50=['intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','create','body','params','describe','createdAt','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','admin','user','fullname','role','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','messages','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x254974,_0x2c8a95){var _0x3e95f9=function(_0x128bef){while(--_0x128bef){_0x254974['push'](_0x254974['shift']());}};_0x3e95f9(++_0x2c8a95);}(_0x1f50,0x104));var _0x01f5=function(_0x5695a0,_0x3963d2){_0x5695a0=_0x5695a0-0x0;var _0x83dbf7=_0x1f50[_0x5695a0];return _0x83dbf7;};'use strict';var emlformat=require(_0x01f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01f5('0x1'));var jsonpatch=require(_0x01f5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x01f5('0x3'));var path=require(_0x01f5('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01f5('0x5'));var fs=require('fs');var fs_extra=require(_0x01f5('0x6'));var _=require(_0x01f5('0x7'));var squel=require(_0x01f5('0x8'));var crypto=require(_0x01f5('0x9'));var jsforce=require(_0x01f5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x01f5('0xb'));var querystring=require(_0x01f5('0xc'));var Papa=require(_0x01f5('0xd'));var Redis=require(_0x01f5('0xe'));var authService=require(_0x01f5('0xf'));var qs=require(_0x01f5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f5('0x11'))(_0x01f5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x01f5('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x01f5('0x14')](config['redis'],{'host':_0x01f5('0x15'),'port':0x18eb});var socket=require(_0x01f5('0x16'))(new Redis(config[_0x01f5('0x17')]));require('./chatInternalMessage.socket')[_0x01f5('0x18')](socket);function respondWithStatusCode(_0x1e3f1c,_0x4ecfff){_0x4ecfff=_0x4ecfff||0xcc;return function(_0x3ea4bd){if(_0x3ea4bd){return _0x1e3f1c[_0x01f5('0x19')](_0x4ecfff);}return _0x1e3f1c[_0x01f5('0x1a')](_0x4ecfff)[_0x01f5('0x1b')]();};}function respondWithResult(_0x38d41d,_0x190fda){_0x190fda=_0x190fda||0xc8;return function(_0x902895){if(_0x902895){return _0x38d41d[_0x01f5('0x1a')](_0x190fda)[_0x01f5('0x1c')](_0x902895);}};}function respondWithFilteredResult(_0x2a0be0,_0xa2abf9){return function(_0x125851){if(_0x125851){var _0x38c1b9=typeof _0xa2abf9[_0x01f5('0x1d')]===_0x01f5('0x1e')&&typeof _0xa2abf9[_0x01f5('0x1f')]===_0x01f5('0x1e');var _0x198eca=_0x125851[_0x01f5('0x20')];var _0x4de33e=_0x38c1b9?0x0:_0xa2abf9[_0x01f5('0x1d')];var _0x4dd194=_0x38c1b9?_0x125851[_0x01f5('0x20')]:_0xa2abf9['offset']+_0xa2abf9[_0x01f5('0x1f')];var _0x1eb156;if(_0x4dd194>=_0x198eca){_0x4dd194=_0x198eca;_0x1eb156=0xc8;}else{_0x1eb156=0xce;}_0x2a0be0[_0x01f5('0x1a')](_0x1eb156);return _0x2a0be0['set']('Content-Range',_0x4de33e+'-'+_0x4dd194+'/'+_0x198eca)[_0x01f5('0x1c')](_0x125851);}return null;};}function patchUpdates(_0x380a4c){return function(_0x10a040){try{jsonpatch['apply'](_0x10a040,_0x380a4c,!![]);}catch(_0x6f446b){return BPromise[_0x01f5('0x21')](_0x6f446b);}return _0x10a040[_0x01f5('0x22')]();};}function saveUpdates(_0x31478d,_0x5386c1){return function(_0x47e82b){if(_0x47e82b){return _0x47e82b[_0x01f5('0x23')](_0x31478d)[_0x01f5('0x24')](function(_0x3e904a){return _0x3e904a;});}return null;};}function removeEntity(_0x5ad70a,_0x45d595){return function(_0x22176e){if(_0x22176e){return _0x22176e[_0x01f5('0x25')]()[_0x01f5('0x24')](function(){_0x5ad70a[_0x01f5('0x1a')](0xcc)[_0x01f5('0x1b')]();});}};}function handleEntityNotFound(_0x323763,_0x3336bf){return function(_0x5b7f47){if(!_0x5b7f47){_0x323763[_0x01f5('0x19')](0x194);}return _0x5b7f47;};}function handleError(_0xd0d190,_0x5df797){_0x5df797=_0x5df797||0x1f4;return function(_0x2d3a87){logger[_0x01f5('0x26')](_0x2d3a87[_0x01f5('0x27')]);if(_0x2d3a87[_0x01f5('0x28')]){delete _0x2d3a87['name'];}_0xd0d190[_0x01f5('0x1a')](_0x5df797)['send'](_0x2d3a87);};}exports[_0x01f5('0x29')]=function(_0x54fbc3,_0x284f93){var _0x1970e9={},_0x4ff97b={},_0x204c6f={'count':0x0,'rows':[]};var _0x3fd842=_[_0x01f5('0x2a')](db[_0x01f5('0x2b')][_0x01f5('0x2c')],function(_0x1916bf){return{'name':_0x1916bf[_0x01f5('0x2d')],'type':_0x1916bf[_0x01f5('0x2e')][_0x01f5('0x2f')]};});_0x4ff97b[_0x01f5('0x30')]=_['map'](_0x3fd842,_0x01f5('0x28'));_0x4ff97b['query']=_['keys'](_0x54fbc3[_0x01f5('0x31')]);_0x4ff97b[_0x01f5('0x32')]=_['intersection'](_0x4ff97b[_0x01f5('0x30')],_0x4ff97b['query']);_0x1970e9[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x4ff97b[_0x01f5('0x30')],qs[_0x01f5('0x35')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x35')]));_0x1970e9[_0x01f5('0x33')]=_0x1970e9['attributes'][_0x01f5('0x36')]?_0x1970e9[_0x01f5('0x33')]:_0x4ff97b[_0x01f5('0x30')];if(!_0x54fbc3['query'][_0x01f5('0x37')]('nolimit')){_0x1970e9[_0x01f5('0x1f')]=qs[_0x01f5('0x1f')](_0x54fbc3[_0x01f5('0x31')]['limit']);_0x1970e9['offset']=qs[_0x01f5('0x1d')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x1d')]);}_0x1970e9[_0x01f5('0x38')]=qs[_0x01f5('0x39')](_0x54fbc3['query'][_0x01f5('0x39')]);_0x1970e9['where']=qs[_0x01f5('0x32')](_[_0x01f5('0x3a')](_0x54fbc3[_0x01f5('0x31')],_0x4ff97b[_0x01f5('0x32')]),_0x3fd842);if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]){_0x1970e9['where']=_[_0x01f5('0x3c')](_0x1970e9[_0x01f5('0x3d')],{'$or':_[_0x01f5('0x2a')](_0x3fd842,function(_0x323e94){if(_0x323e94[_0x01f5('0x2e')]!==_0x01f5('0x3e')){var _0x51405c={};_0x51405c[_0x323e94[_0x01f5('0x28')]]={'$like':'%'+_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]+'%'};return _0x51405c;}})});}_0x1970e9=_[_0x01f5('0x3c')]({},_0x1970e9,_0x54fbc3['options']);var _0x30f79={'where':_0x1970e9[_0x01f5('0x3d')]};return db[_0x01f5('0x2b')]['count'](_0x30f79)[_0x01f5('0x24')](function(_0xb04d96){_0x204c6f['count']=_0xb04d96;if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x1970e9[_0x01f5('0x40')]=[{'all':!![]}];}return db[_0x01f5('0x2b')]['findAll'](_0x1970e9);})['then'](function(_0x482850){_0x204c6f[_0x01f5('0x41')]=_0x482850;return _0x204c6f;})[_0x01f5('0x24')](respondWithFilteredResult(_0x284f93,_0x1970e9))[_0x01f5('0x42')](handleError(_0x284f93,null));};exports[_0x01f5('0x43')]=function(_0xc986f1,_0x3de016){var _0x3182d0={'raw':!![],'where':{'id':_0xc986f1['params']['id']}},_0x23109f={};_0x23109f[_0x01f5('0x30')]=_[_0x01f5('0x44')](db[_0x01f5('0x2b')][_0x01f5('0x2c')]);_0x23109f[_0x01f5('0x31')]=_[_0x01f5('0x44')](_0xc986f1['query']);_0x23109f['filters']=_[_0x01f5('0x34')](_0x23109f[_0x01f5('0x30')],_0x23109f['query']);_0x3182d0[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x23109f['model'],qs[_0x01f5('0x35')](_0xc986f1[_0x01f5('0x31')][_0x01f5('0x35')]));_0x3182d0['attributes']=_0x3182d0[_0x01f5('0x33')]['length']?_0x3182d0[_0x01f5('0x33')]:_0x23109f['model'];if(_0xc986f1[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x3182d0['include']=[{'all':!![]}];}_0x3182d0=_[_0x01f5('0x3c')]({},_0x3182d0,_0xc986f1[_0x01f5('0x45')]);return db[_0x01f5('0x2b')][_0x01f5('0x46')](_0x3182d0)['then'](handleEntityNotFound(_0x3de016,null))[_0x01f5('0x24')](respondWithResult(_0x3de016,null))[_0x01f5('0x42')](handleError(_0x3de016,null));};exports[_0x01f5('0x47')]=function(_0x11f81a,_0xc63c91){return db[_0x01f5('0x2b')][_0x01f5('0x47')](_0x11f81a[_0x01f5('0x48')],{})[_0x01f5('0x24')](respondWithResult(_0xc63c91,0xc9))[_0x01f5('0x42')](handleError(_0xc63c91,null));};exports['update']=function(_0xa90d74,_0x303cf1){if(_0xa90d74['body']['id']){delete _0xa90d74[_0x01f5('0x48')]['id'];}return db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'id':_0xa90d74[_0x01f5('0x49')]['id']}})['then'](handleEntityNotFound(_0x303cf1,null))[_0x01f5('0x24')](saveUpdates(_0xa90d74[_0x01f5('0x48')],null))['then'](respondWithResult(_0x303cf1,null))[_0x01f5('0x42')](handleError(_0x303cf1,null));};exports[_0x01f5('0x25')]=function(_0x20509a,_0x4c38af){return db[_0x01f5('0x2b')]['find']({'where':{'id':_0x20509a['params']['id']}})['then'](handleEntityNotFound(_0x4c38af,null))[_0x01f5('0x24')](removeEntity(_0x4c38af,null))[_0x01f5('0x42')](handleError(_0x4c38af,null));};exports['describe']=function(_0x29fd7d,_0x4f2a7f){return db[_0x01f5('0x2b')][_0x01f5('0x4a')]()[_0x01f5('0x24')](respondWithResult(_0x4f2a7f,null))[_0x01f5('0x42')](handleError(_0x4f2a7f,null));};function wrapUser(_0x2b288a){return function(_0x10261f){var _0x56dd0d=_0x2b288a['get']({'plain':!![]});_0x56dd0d['messages']=[];if(_0x10261f){_0x56dd0d['lastMessageAt']=_0x10261f[_0x01f5('0x4b')];_0x56dd0d['lastMessage']=_0x10261f;}else{_0x56dd0d[_0x01f5('0x4c')]=moment(0x0)['format'](_0x01f5('0x4d'));_0x56dd0d['lastMessage']={};}return _0x56dd0d;};}exports[_0x01f5('0x4e')]=function(_0x228537,_0x2e5dbb,_0xe964da){var _0xfc4e96=[];return db['User'][_0x01f5('0x4f')]({'where':{'role':['agent',_0x01f5('0x50'),_0x01f5('0x51')]},'attributes':['id',_0x01f5('0x52'),_0x01f5('0x28'),_0x01f5('0x53'),_0x01f5('0x54'),_0x01f5('0x55'),'online',_0x01f5('0x56'),'allowmessenger',_0x01f5('0x57')],'order':qs[_0x01f5('0x39')](_0x01f5('0x58')),'include':[{'model':db[_0x01f5('0x59')],'as':_0x01f5('0x5a'),'attributes':['id',_0x01f5('0x28'),'type'],'through':{'attributes':[]}}]})[_0x01f5('0x24')](function(_0x1e0940){if(_0x1e0940){var _0x1df495=_0x228537[_0x01f5('0x51')]['get']({'plain':!![]});if(!_0x1df495)throw new Error(_0x01f5('0x5b'));if(_0x1df495[_0x01f5('0x53')]===_0x01f5('0x51')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x1df495[_0x01f5('0x5c')]},'raw':!![]})[_0x01f5('0x24')](function(_0x5909ab){if(_0x5909ab){if(_0x5909ab[_0x01f5('0x5d')]===0x0){return db[_0x01f5('0x5e')]['findAll']({'where':{'sectionId':_0x5909ab['id']},'raw':!![]})[_0x01f5('0x24')](function(_0x38db76){var _0x1ccb05=[];if(_[_0x01f5('0x5f')](_0x38db76)){_0x1ccb05=_[_0x01f5('0x3b')](_0x1e0940,function(_0x34bed0){if(_0x34bed0[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x34bed0;}});return _0x1ccb05;}else{for(var _0x445ae7=0x0;_0x445ae7<_0x1e0940[_0x01f5('0x36')];_0x445ae7++){var _0x1eabaa=_0x1e0940[_0x445ae7];if(_0x1eabaa['role']===_0x01f5('0x60')){var _0x4b8610=_[_0x01f5('0x46')](_0x38db76,function(_0x509d65){return _0x509d65[_0x01f5('0x61')]===_0x1eabaa['id'];});if(_0x4b8610)_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}else{_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}}return _0x1ccb05;}});}else{return _0x1e0940;}}else{var _0x45cfe6=_[_0x01f5('0x3b')](_0x1e0940,function(_0x1073cc){if(_0x1073cc[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x1073cc;}});return _0x45cfe6;}});}else{return _0x1e0940;}}})[_0x01f5('0x24')](function(_0x268101){var _0x38473d=[];if(_0x268101){_0xfc4e96=_0x268101;for(var _0x2417af=0x0;_0x2417af<_0x268101[_0x01f5('0x36')];_0x2417af+=0x1){_0xfc4e96[_0x2417af][_0x01f5('0x63')]=[];_0x38473d[_0x01f5('0x62')](db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'FromId':[_0x228537[_0x01f5('0x51')]['id'],_0x268101[_0x2417af]['id']],'ToId':[_0x228537['user']['id'],_0x268101[_0x2417af]['id']],'ChatGroupId':null},'attributes':['id',_0x01f5('0x4b'),_0x01f5('0x64'),_0x01f5('0x65'),_0x01f5('0x66'),_0x01f5('0x48')],'order':qs[_0x01f5('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x268101[_0x2417af])));}return BPromise[_0x01f5('0x67')](_0x38473d);}return[];})['then'](function(_0xd4e087){return{'rows':_0xd4e087,'count':_0xd4e087['length']};})[_0x01f5('0x24')](respondWithResult(_0x2e5dbb,null))[_0x01f5('0x42')](handleError(_0x2e5dbb,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d2be053..fe38dd5 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 _0xd876=['emit','hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','remove'];(function(_0x84d9dd,_0x13db4b){var _0x58587b=function(_0x28937d){while(--_0x28937d){_0x84d9dd['push'](_0x84d9dd['shift']());}};_0x58587b(++_0x13db4b);}(_0xd876,0x11b));var _0x6d87=function(_0x235ea7,_0x58b6d7){_0x235ea7=_0x235ea7-0x0;var _0x367ab0=_0xd876[_0x235ea7];return _0x367ab0;};'use strict';var EventEmitter=require(_0x6d87('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x6d87('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6d87('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6d87('0x3')};function emitEvent(_0x103e0b){return function(_0x3d239a,_0x3e4359,_0x7df2e1){ChatInternalMessageEvents[_0x6d87('0x4')](_0x103e0b+':'+_0x3d239a['id'],_0x3d239a);ChatInternalMessageEvents[_0x6d87('0x4')](_0x103e0b,_0x3d239a);_0x7df2e1(null);};}for(var e in events){if(events[_0x6d87('0x5')](e)){var event=events[e];ChatInternalMessage[_0x6d87('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xb435=['emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x5c6f36,_0xbd2a45){var _0x19569f=function(_0xa98b75){while(--_0xa98b75){_0x5c6f36['push'](_0x5c6f36['shift']());}};_0x19569f(++_0xbd2a45);}(_0xb435,0x13e));var _0x5b43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb435[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x5b43('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x5b43('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5b43('0x2')](0x0);var events={'afterCreate':_0x5b43('0x3'),'afterUpdate':_0x5b43('0x4'),'afterDestroy':_0x5b43('0x5')};function emitEvent(_0x224c11){return function(_0x41afcd,_0x328b1d,_0x55c9b2){ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11+':'+_0x41afcd['id'],_0x41afcd);ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11,_0x41afcd);_0x55c9b2(null);};}for(var e in events){if(events[_0x5b43('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5b43('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index d94d038..cc62a9d 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 _0xcc94=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xcc94,0x84));var _0x4cc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcc94[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4cc9('0x0'));var util=require(_0x4cc9('0x1'));var logger=require(_0x4cc9('0x2'))('api');var moment=require(_0x4cc9('0x3'));var BPromise=require(_0x4cc9('0x4'));var rp=require(_0x4cc9('0x5'));var fs=require('fs');var path=require(_0x4cc9('0x6'));var rimraf=require(_0x4cc9('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x5c6db2,_0x13cfa1){return _0x5c6db2[_0x4cc9('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x4cc9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4cc9('0xa')});}; \ No newline at end of file +var _0x555b=['api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x555b,0xe1));var _0xb555=function(_0xbd499f,_0x315793){_0xbd499f=_0xbd499f-0x0;var _0x2d2d12=_0x555b[_0xbd499f];return _0x2d2d12;};'use strict';var _=require(_0xb555('0x0'));var util=require(_0xb555('0x1'));var logger=require(_0xb555('0x2'))(_0xb555('0x3'));var moment=require(_0xb555('0x4'));var BPromise=require(_0xb555('0x5'));var rp=require(_0xb555('0x6'));var fs=require('fs');var path=require(_0xb555('0x7'));var rimraf=require(_0xb555('0x8'));var config=require('../../config/environment');var attributes=require(_0xb555('0x9'));module[_0xb555('0xa')]=function(_0x4638b8,_0x131e43){return _0x4638b8[_0xb555('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 8eca7e8..15d2274 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 _0x08bb=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x3acb89,_0x2ca05e){var _0x4d38f2=function(_0x4cb6a9){while(--_0x4cb6a9){_0x3acb89['push'](_0x3acb89['shift']());}};_0x4d38f2(++_0x2ca05e);}(_0x08bb,0x177));var _0xb08b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x08bb[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xb08b('0x0'));var util=require(_0xb08b('0x1'));var moment=require('moment');var BPromise=require(_0xb08b('0x2'));var rs=require(_0xb08b('0x3'));var fs=require('fs');var Redis=require(_0xb08b('0x4'));var db=require(_0xb08b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb08b('0x6'))(_0xb08b('0x7'));var config=require(_0xb08b('0x8'));var jayson=require(_0xb08b('0x9'));var client=jayson[_0xb08b('0xa')][_0xb08b('0xb')]({'port':0x232a});config[_0xb08b('0xc')]=_['defaults'](config[_0xb08b('0xc')],{'host':_0xb08b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb08b('0xc')]));require(_0xb08b('0xe'))[_0xb08b('0xf')](socket);function respondWithRpcPromise(_0x4b7f9b,_0x4c3727,_0x3205f5){return new BPromise(function(_0x40b9cf,_0x5b41f2){return client['request'](_0x4b7f9b,_0x3205f5)[_0xb08b('0x10')](function(_0x53a4d2){logger[_0xb08b('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x4c3727,_0xb08b('0x12'));logger[_0xb08b('0x13')](_0xb08b('0x14'),_0x4c3727,_0xb08b('0x12'),JSON['stringify'](_0x53a4d2));if(_0x53a4d2[_0xb08b('0x15')]){if(_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x16')]===0x1f4){logger[_0xb08b('0x15')](_0xb08b('0x17'),_0x4c3727,_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x18')]);return _0x5b41f2(_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x18')]);}logger[_0xb08b('0x15')](_0xb08b('0x17'),_0x4c3727,_0x53a4d2[_0xb08b('0x15')][_0xb08b('0x18')]);return _0x40b9cf(_0x53a4d2['error'][_0xb08b('0x18')]);}else{logger[_0xb08b('0x11')](_0xb08b('0x17'),_0x4c3727,'request\x20sent');_0x40b9cf(_0x53a4d2[_0xb08b('0x19')][_0xb08b('0x18')]);}})[_0xb08b('0x1a')](function(_0x2f3625){logger['error'](_0xb08b('0x17'),_0x4c3727,_0x2f3625);_0x5b41f2(_0x2f3625);});});} \ No newline at end of file +var _0x7721=['client','http','localhost','redis','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xebb209,_0x5b286c){var _0x5f3a20=function(_0x49e974){while(--_0x49e974){_0xebb209['push'](_0xebb209['shift']());}};_0x5f3a20(++_0x5b286c);}(_0x7721,0x115));var _0x1772=function(_0x57c27c,_0x4496ac){_0x57c27c=_0x57c27c-0x0;var _0x2f356e=_0x7721[_0x57c27c];return _0x2f356e;};'use strict';var _=require(_0x1772('0x0'));var util=require(_0x1772('0x1'));var moment=require(_0x1772('0x2'));var BPromise=require(_0x1772('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1772('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1772('0x5'))(_0x1772('0x6'));var config=require(_0x1772('0x7'));var jayson=require(_0x1772('0x8'));var client=jayson[_0x1772('0x9')][_0x1772('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1772('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1772('0xc')]));require(_0x1772('0xd'))[_0x1772('0xe')](socket);function respondWithRpcPromise(_0xd6e82a,_0xd65598,_0x2b6e89){return new BPromise(function(_0x4630cc,_0x3ffa84){return client[_0x1772('0xf')](_0xd6e82a,_0x2b6e89)[_0x1772('0x10')](function(_0xfb07a8){logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,'request\x20sent');logger[_0x1772('0x13')](_0x1772('0x14'),_0xd65598,_0x1772('0x15'),JSON['stringify'](_0xfb07a8));if(_0xfb07a8[_0x1772('0x16')]){if(_0xfb07a8['error']['code']===0x1f4){logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x3ffa84(_0xfb07a8[_0x1772('0x16')]['message']);}logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x4630cc(_0xfb07a8['error'][_0x1772('0x17')]);}else{logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,_0x1772('0x15'));_0x4630cc(_0xfb07a8[_0x1772('0x18')]['message']);}})[_0x1772('0x19')](function(_0xd2fdd5){logger['error'](_0x1772('0x12'),_0xd65598,_0xd2fdd5);_0x3ffa84(_0xd2fdd5);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4e419f1..86b4808 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 _0xba00=['chatInternalMessage:','./chatInternalMessage.events','save','emit','removeListener','register','length'];(function(_0x22909b,_0x4a8a54){var _0x16b258=function(_0xd96eae){while(--_0xd96eae){_0x22909b['push'](_0x22909b['shift']());}};_0x16b258(++_0x4a8a54);}(_0xba00,0x1eb));var _0x0ba0=function(_0x58fda8,_0x247b57){_0x58fda8=_0x58fda8-0x0;var _0x3a9b61=_0xba00[_0x58fda8];return _0x3a9b61;};'use strict';var ChatInternalMessageEvents=require(_0x0ba0('0x0'));var events=[_0x0ba0('0x1'),'remove','update'];function createListener(_0x428bba,_0x2e32a2){return function(_0x597ed9){_0x2e32a2[_0x0ba0('0x2')](_0x428bba,_0x597ed9);};}function removeListener(_0x566090,_0x2378f4){return function(){ChatInternalMessageEvents[_0x0ba0('0x3')](_0x566090,_0x2378f4);};}exports[_0x0ba0('0x4')]=function(_0x4bffbc){for(var _0x4783a7=0x0,_0x425e2e=events[_0x0ba0('0x5')];_0x4783a7<_0x425e2e;_0x4783a7++){var _0x21e32e=events[_0x4783a7];var _0x4441f2=createListener(_0x0ba0('0x6')+_0x21e32e,_0x4bffbc);ChatInternalMessageEvents['on'](_0x21e32e,_0x4441f2);}}; \ No newline at end of file +var _0x2a91=['./chatInternalMessage.events','remove','update','removeListener'];(function(_0x5ee5ef,_0x2267eb){var _0x1e608d=function(_0x34cf1e){while(--_0x34cf1e){_0x5ee5ef['push'](_0x5ee5ef['shift']());}};_0x1e608d(++_0x2267eb);}(_0x2a91,0x1cc));var _0x12a9=function(_0x3a55a6,_0x4a8738){_0x3a55a6=_0x3a55a6-0x0;var _0xc40765=_0x2a91[_0x3a55a6];return _0xc40765;};'use strict';var ChatInternalMessageEvents=require(_0x12a9('0x0'));var events=['save',_0x12a9('0x1'),_0x12a9('0x2')];function createListener(_0x4c6841,_0x758e24){return function(_0xd4eb28){_0x758e24['emit'](_0x4c6841,_0xd4eb28);};}function removeListener(_0x334c06,_0xe010e){return function(){ChatInternalMessageEvents[_0x12a9('0x3')](_0x334c06,_0xe010e);};}exports['register']=function(_0x548905){for(var _0x3acb73=0x0,_0x4aa20e=events['length'];_0x3acb73<_0x4aa20e;_0x3acb73++){var _0xcb25=events[_0x3acb73];var _0x477274=createListener('chatInternalMessage:'+_0xcb25,_0x548905);ChatInternalMessageEvents['on'](_0xcb25,_0x477274);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index d6aceb2..1fbcaf9 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 _0x4cbe=['put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/users','post','create'];(function(_0x56d3a2,_0x5f191b){var _0x2c14d0=function(_0xb776e2){while(--_0xb776e2){_0x56d3a2['push'](_0x56d3a2['shift']());}};_0x2c14d0(++_0x5f191b);}(_0x4cbe,0x16e));var _0xe4cb=function(_0x5f22de,_0x4cd696){_0x5f22de=_0x5f22de-0x0;var _0x5c54a0=_0x4cbe[_0x5f22de];return _0x5c54a0;};'use strict';var multer=require(_0xe4cb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe4cb('0x1'));var router=express[_0xe4cb('0x2')]();var fs_extra=require(_0xe4cb('0x3'));var auth=require(_0xe4cb('0x4'));var interaction=require(_0xe4cb('0x5'));var config=require(_0xe4cb('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xe4cb('0x7')]('/',auth[_0xe4cb('0x8')](),controller[_0xe4cb('0x9')]);router[_0xe4cb('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xe4cb('0xa')]);router[_0xe4cb('0x7')](_0xe4cb('0xb'),auth[_0xe4cb('0x8')](),controller['getUsers']);router[_0xe4cb('0x7')]('/:id',auth[_0xe4cb('0x8')](),controller['show']);router[_0xe4cb('0xc')]('/',auth['isAuthenticated'](),controller[_0xe4cb('0xd')]);router[_0xe4cb('0xe')](_0xe4cb('0xf'),controller[_0xe4cb('0x10')]);router[_0xe4cb('0x11')](_0xe4cb('0xf'),auth[_0xe4cb('0x8')](),controller[_0xe4cb('0x12')]);module[_0xe4cb('0x13')]=router; \ No newline at end of file +var _0xbe58=['index','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0xbe58,0x90));var _0x8be5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xbe58[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x8be5('0x0'));var util=require(_0x8be5('0x1'));var path=require(_0x8be5('0x2'));var timeout=require('connect-timeout');var express=require(_0x8be5('0x3'));var router=express[_0x8be5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8be5('0x5'));var interaction=require(_0x8be5('0x6'));var config=require('../../config/environment');var controller=require(_0x8be5('0x7'));router[_0x8be5('0x8')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0xa')]);router['get']('/describe',auth[_0x8be5('0x9')](),controller[_0x8be5('0xb')]);router[_0x8be5('0x8')](_0x8be5('0xc'),auth['isAuthenticated'](),controller[_0x8be5('0xd')]);router[_0x8be5('0x8')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0xf')]);router[_0x8be5('0x10')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0x11')]);router[_0x8be5('0x12')](_0x8be5('0xe'),controller[_0x8be5('0x13')]);router[_0x8be5('0x14')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 087563a..b83517c 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 _0x80ed=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x1d489f,_0x4afab7){var _0x1d7643=function(_0x18b771){while(--_0x18b771){_0x1d489f['push'](_0x1d489f['shift']());}};_0x1d7643(++_0x4afab7);}(_0x80ed,0x11c));var _0xd80e=function(_0x28271b,_0x418cf3){_0x28271b=_0x28271b-0x0;var _0x3593bd=_0x80ed[_0x28271b];return _0x3593bd;};'use strict';var Sequelize=require(_0xd80e('0x0'));module['exports']={'body':{'type':Sequelize[_0xd80e('0x1')](_0xd80e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd80e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd80e('0x4')]('in',_0xd80e('0x5')),'defaultValue':_0xd80e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd80e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd80e('0x1')]}}; \ No newline at end of file +var _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x3a9b70,_0x3b362a){var _0x11d6b5=function(_0x87a9db){while(--_0x87a9db){_0x3a9b70['push'](_0x3a9b70['shift']());}};_0x11d6b5(++_0x3b362a);}(_0xfd6f,0x19d));var _0xffd6=function(_0x225d7e,_0x1e8eed){_0x225d7e=_0x225d7e-0x0;var _0x3924d4=_0xfd6f[_0x225d7e];return _0x3924d4;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index f3575b4..531e169 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 _0x7c0f=['index','ChatMessage','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','filters','find','create','body','describe','../../config/logger','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','email','rejectmessage','formData','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send'];(function(_0x111bab,_0x271498){var _0x5999fa=function(_0x9512f4){while(--_0x9512f4){_0x111bab['push'](_0x111bab['shift']());}};_0x5999fa(++_0x271498);}(_0x7c0f,0x1d3));var _0xf7c0=function(_0x1fb86c,_0x1889de){_0x1fb86c=_0x1fb86c-0x0;var _0x43e97f=_0x7c0f[_0x1fb86c];return _0x43e97f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7c0('0x0'));var zipdir=require(_0xf7c0('0x1'));var jsonpatch=require(_0xf7c0('0x2'));var rp=require('request-promise');var moment=require(_0xf7c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf7c0('0x4'));var util=require(_0xf7c0('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf7c0('0x6'));var ejs=require(_0xf7c0('0x7'));var fs=require('fs');var fs_extra=require(_0xf7c0('0x8'));var _=require('lodash');var squel=require(_0xf7c0('0x9'));var crypto=require(_0xf7c0('0xa'));var jsforce=require(_0xf7c0('0xb'));var deskjs=require(_0xf7c0('0xc'));var toCsv=require(_0xf7c0('0x6'));var querystring=require(_0xf7c0('0xd'));var Papa=require(_0xf7c0('0xe'));var Redis=require(_0xf7c0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7c0('0x10'));var hardwareService=require(_0xf7c0('0x11'));var logger=require('../../config/logger')(_0xf7c0('0x12'));var utils=require(_0xf7c0('0x13'));var config=require(_0xf7c0('0x14'));var licenseUtil=require(_0xf7c0('0x15'));var db=require('../../mysqldb')['db'];config[_0xf7c0('0x16')]=_[_0xf7c0('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf7c0('0x18'))(new Redis(config[_0xf7c0('0x16')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xf7c0('0x19'));var client=jayson[_0xf7c0('0x1a')][_0xf7c0('0x1b')]({'port':0x232c});var client9002=jayson[_0xf7c0('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34c681,_0x2f4577,_0x5c0c7b,_0x5e052b){return new BPromise(function(_0x10ff1e,_0x113555){var _0x45b790=_0x5e052b||client;return _0x45b790[_0xf7c0('0x1c')](_0x34c681,_0x5c0c7b)['then'](function(_0x1f8a45){logger[_0xf7c0('0x1d')](_0xf7c0('0x1e'),_0x2f4577,_0xf7c0('0x1f'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2f4577,_0xf7c0('0x1f'),JSON['stringify'](_0x1f8a45));if(_0x1f8a45['error']){if(_0x1f8a45[_0xf7c0('0x20')][_0xf7c0('0x21')]===0x1f4){logger['error'](_0xf7c0('0x1e'),_0x2f4577,_0x1f8a45[_0xf7c0('0x20')][_0xf7c0('0x22')]);return _0x113555(_0x1f8a45[_0xf7c0('0x20')]['message']);}logger[_0xf7c0('0x20')](_0xf7c0('0x1e'),_0x2f4577,_0x1f8a45['error'][_0xf7c0('0x22')]);return _0x10ff1e(_0x1f8a45['error'][_0xf7c0('0x22')]);}else{logger[_0xf7c0('0x1d')](_0xf7c0('0x1e'),_0x2f4577,_0xf7c0('0x1f'));_0x10ff1e(_0x1f8a45[_0xf7c0('0x23')][_0xf7c0('0x22')]);}})['catch'](function(_0x32b8fe){logger[_0xf7c0('0x20')]('ChatMessage,\x20%s,\x20%s',_0x2f4577,_0x32b8fe);_0x113555(_0x32b8fe);});});}function respondWithStatusCode(_0xb9eb96,_0x56787c){_0x56787c=_0x56787c||0xcc;return function(_0xb460e5){if(_0xb460e5){return _0xb9eb96[_0xf7c0('0x24')](_0x56787c);}return _0xb9eb96[_0xf7c0('0x25')](_0x56787c)[_0xf7c0('0x26')]();};}function respondWithResult(_0x7099d9,_0x33d56c){_0x33d56c=_0x33d56c||0xc8;return function(_0x27ba6f){if(_0x27ba6f){return _0x7099d9['status'](_0x33d56c)[_0xf7c0('0x27')](_0x27ba6f);}};}function respondWithFilteredResult(_0x181422,_0x573eea){return function(_0x18e392){if(_0x18e392){var _0x3bf426=typeof _0x573eea[_0xf7c0('0x28')]===_0xf7c0('0x29')&&typeof _0x573eea[_0xf7c0('0x2a')]===_0xf7c0('0x29');var _0x48ade2=_0x18e392['count'];var _0x5388b7=_0x3bf426?0x0:_0x573eea[_0xf7c0('0x28')];var _0x237ec7=_0x3bf426?_0x18e392[_0xf7c0('0x2b')]:_0x573eea[_0xf7c0('0x28')]+_0x573eea['limit'];var _0x593ff6;if(_0x237ec7>=_0x48ade2){_0x237ec7=_0x48ade2;_0x593ff6=0xc8;}else{_0x593ff6=0xce;}_0x181422[_0xf7c0('0x25')](_0x593ff6);return _0x181422[_0xf7c0('0x2c')]('Content-Range',_0x5388b7+'-'+_0x237ec7+'/'+_0x48ade2)['json'](_0x18e392);}return null;};}function patchUpdates(_0xd4bcc7){return function(_0x4be604){try{jsonpatch[_0xf7c0('0x2d')](_0x4be604,_0xd4bcc7,!![]);}catch(_0x2ccb7b){return BPromise[_0xf7c0('0x2e')](_0x2ccb7b);}return _0x4be604[_0xf7c0('0x2f')]();};}function saveUpdates(_0x29c641,_0x4fabf1){return function(_0x2b8864){if(_0x2b8864){return _0x2b8864[_0xf7c0('0x30')](_0x29c641)[_0xf7c0('0x31')](function(_0x62a976){return _0x62a976;});}return null;};}function removeEntity(_0x35f014,_0xd97313){return function(_0x3406d3){if(_0x3406d3){return _0x3406d3[_0xf7c0('0x32')]()['then'](function(){_0x35f014[_0xf7c0('0x25')](0xcc)[_0xf7c0('0x26')]();});}};}function handleEntityNotFound(_0x385e9d,_0x2ea24a){return function(_0x4cd118){if(!_0x4cd118){_0x385e9d[_0xf7c0('0x24')](0x194);}return _0x4cd118;};}function handleError(_0x518b63,_0x134ff1){_0x134ff1=_0x134ff1||0x1f4;return function(_0x4496ab){logger['error'](_0x4496ab['stack']);if(_0x4496ab[_0xf7c0('0x33')]){delete _0x4496ab['name'];}_0x518b63['status'](_0x134ff1)[_0xf7c0('0x34')](_0x4496ab);};}exports[_0xf7c0('0x35')]=function(_0x468a3d,_0x349918){var _0x420865={},_0x166cdc={},_0x2c049a={'count':0x0,'rows':[]};var _0x5e64f1=_['map'](db[_0xf7c0('0x36')][_0xf7c0('0x37')],function(_0x3b1f7c){return{'name':_0x3b1f7c[_0xf7c0('0x38')],'type':_0x3b1f7c[_0xf7c0('0x39')]['key']};});_0x166cdc[_0xf7c0('0x3a')]=_[_0xf7c0('0x3b')](_0x5e64f1,'name');_0x166cdc['query']=_[_0xf7c0('0x3c')](_0x468a3d[_0xf7c0('0x3d')]);_0x166cdc['filters']=_[_0xf7c0('0x3e')](_0x166cdc[_0xf7c0('0x3a')],_0x166cdc['query']);_0x420865[_0xf7c0('0x3f')]=_[_0xf7c0('0x3e')](_0x166cdc[_0xf7c0('0x3a')],qs[_0xf7c0('0x40')](_0x468a3d[_0xf7c0('0x3d')]['fields']));_0x420865[_0xf7c0('0x3f')]=_0x420865[_0xf7c0('0x3f')][_0xf7c0('0x41')]?_0x420865[_0xf7c0('0x3f')]:_0x166cdc[_0xf7c0('0x3a')];if(!_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x42')]('nolimit')){_0x420865[_0xf7c0('0x2a')]=qs[_0xf7c0('0x2a')](_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x2a')]);_0x420865[_0xf7c0('0x28')]=qs[_0xf7c0('0x28')](_0x468a3d['query']['offset']);}_0x420865[_0xf7c0('0x43')]=qs[_0xf7c0('0x44')](_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x44')]);_0x420865[_0xf7c0('0x45')]=qs['filters'](_[_0xf7c0('0x46')](_0x468a3d[_0xf7c0('0x3d')],_0x166cdc['filters']),_0x5e64f1);if(_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x47')]){_0x420865[_0xf7c0('0x45')]=_[_0xf7c0('0x48')](_0x420865[_0xf7c0('0x45')],{'$or':_['map'](_0x5e64f1,function(_0xa1d2f7){if(_0xa1d2f7[_0xf7c0('0x39')]!==_0xf7c0('0x49')){var _0x2db270={};_0x2db270[_0xa1d2f7['name']]={'$like':'%'+_0x468a3d[_0xf7c0('0x3d')][_0xf7c0('0x47')]+'%'};return _0x2db270;}})});}_0x420865=_[_0xf7c0('0x48')]({},_0x420865,_0x468a3d[_0xf7c0('0x4a')]);var _0x2cbdd0={'where':_0x420865[_0xf7c0('0x45')]};return db['ChatMessage'][_0xf7c0('0x2b')](_0x2cbdd0)[_0xf7c0('0x31')](function(_0x159447){_0x2c049a['count']=_0x159447;if(_0x468a3d['query']['includeAll']){_0x420865[_0xf7c0('0x4b')]=[{'all':!![]}];}return db[_0xf7c0('0x36')][_0xf7c0('0x4c')](_0x420865);})[_0xf7c0('0x31')](function(_0x5d08bf){_0x2c049a[_0xf7c0('0x4d')]=_0x5d08bf;return _0x2c049a;})[_0xf7c0('0x31')](respondWithFilteredResult(_0x349918,_0x420865))[_0xf7c0('0x4e')](handleError(_0x349918,null));};exports['show']=function(_0xb918de,_0x1fd66f){var _0x27860b={'raw':!![],'where':{'id':_0xb918de[_0xf7c0('0x4f')]['id']}},_0x52a124={};_0x52a124['model']=_[_0xf7c0('0x3c')](db[_0xf7c0('0x36')]['rawAttributes']);_0x52a124['query']=_[_0xf7c0('0x3c')](_0xb918de[_0xf7c0('0x3d')]);_0x52a124[_0xf7c0('0x50')]=_[_0xf7c0('0x3e')](_0x52a124[_0xf7c0('0x3a')],_0x52a124[_0xf7c0('0x3d')]);_0x27860b[_0xf7c0('0x3f')]=_[_0xf7c0('0x3e')](_0x52a124['model'],qs['fields'](_0xb918de[_0xf7c0('0x3d')]['fields']));_0x27860b[_0xf7c0('0x3f')]=_0x27860b[_0xf7c0('0x3f')][_0xf7c0('0x41')]?_0x27860b[_0xf7c0('0x3f')]:_0x52a124['model'];if(_0xb918de[_0xf7c0('0x3d')]['includeAll']){_0x27860b[_0xf7c0('0x4b')]=[{'all':!![]}];}_0x27860b=_['merge']({},_0x27860b,_0xb918de[_0xf7c0('0x4a')]);return db['ChatMessage'][_0xf7c0('0x51')](_0x27860b)[_0xf7c0('0x31')](handleEntityNotFound(_0x1fd66f,null))[_0xf7c0('0x31')](respondWithResult(_0x1fd66f,null))[_0xf7c0('0x4e')](handleError(_0x1fd66f,null));};exports[_0xf7c0('0x52')]=function(_0x59e018,_0x3da340){return db[_0xf7c0('0x36')]['create'](_0x59e018[_0xf7c0('0x53')],{})[_0xf7c0('0x31')](respondWithResult(_0x3da340,0xc9))[_0xf7c0('0x4e')](handleError(_0x3da340,null));};exports[_0xf7c0('0x30')]=function(_0x411164,_0x2d46da){if(_0x411164[_0xf7c0('0x53')]['id']){delete _0x411164[_0xf7c0('0x53')]['id'];}return db['ChatMessage'][_0xf7c0('0x51')]({'where':{'id':_0x411164['params']['id']}})['then'](handleEntityNotFound(_0x2d46da,null))[_0xf7c0('0x31')](saveUpdates(_0x411164[_0xf7c0('0x53')],null))['then'](respondWithResult(_0x2d46da,null))[_0xf7c0('0x4e')](handleError(_0x2d46da,null));};exports[_0xf7c0('0x32')]=function(_0x43237d,_0x216666){return db[_0xf7c0('0x36')][_0xf7c0('0x51')]({'where':{'id':_0x43237d[_0xf7c0('0x4f')]['id']}})[_0xf7c0('0x31')](handleEntityNotFound(_0x216666,null))[_0xf7c0('0x31')](removeEntity(_0x216666,null))[_0xf7c0('0x4e')](handleError(_0x216666,null));};exports[_0xf7c0('0x54')]=function(_0x23dfa0,_0x41c0aa){return db['ChatMessage'][_0xf7c0('0x54')]()[_0xf7c0('0x31')](respondWithResult(_0x41c0aa,null))[_0xf7c0('0x4e')](handleError(_0x41c0aa,null));};var interaction_log=require(_0xf7c0('0x55'))('chat-interactions');exports[_0xf7c0('0x56')]=function(_0x5c8735,_0x928707,_0x159bcc){var _0x598805={'agent':{},'channel':_0xf7c0('0x57')};if(_0x5c8735['body']['id']){delete _0x5c8735[_0xf7c0('0x53')]['id'];}_0x5c8735['body'][_0xf7c0('0x58')]=!![];_0x5c8735['body'][_0xf7c0('0x59')]=moment()[_0xf7c0('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c8735['body'][_0xf7c0('0x5b')]=_0x5c8735[_0xf7c0('0x53')][_0xf7c0('0x5b')]||_0x5c8735[_0xf7c0('0x5c')]['id'];_0x598805[_0xf7c0('0x5d')]['id']=_0x5c8735['body'][_0xf7c0('0x5b')];return db[_0xf7c0('0x36')][_0xf7c0('0x51')]({'where':{'id':_0x5c8735['params']['id'],'UserId':null}})[_0xf7c0('0x31')](handleEntityNotFound(_0x928707,null))[_0xf7c0('0x31')](saveUpdates(_0x5c8735['body'],null))[_0xf7c0('0x31')](function(_0x1e72d6){if(_0x1e72d6){_0x598805['message']=_0x1e72d6[_0xf7c0('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0xf7c0('0x51')]({'where':{'id':_0x1e72d6[_0xf7c0('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x928707,null))['then'](function(_0x542903){if(_0x542903){return _0x542903['update']({'UserId':_0x5c8735['body']['UserId'],'read1stAt':_[_0xf7c0('0x60')](_0x542903['read1stAt'])?moment()['format'](_0xf7c0('0x61')):undefined});}return null;})['then'](function(_0x494800){if(_0x494800){_0x598805['interaction']=_0x494800[_0xf7c0('0x5e')]({'plain':!![]});interaction_log[_0xf7c0('0x1d')](_0xf7c0('0x62'),_0x5c8735[_0xf7c0('0x5c')]['id'],_0x5c8735[_0xf7c0('0x5c')][_0xf7c0('0x33')],_0x5c8735[_0xf7c0('0x5c')][_0xf7c0('0x63')],_0x598805[_0xf7c0('0x64')]['id'],_0x5c8735[_0xf7c0('0x53')]?JSON['stringify'](_0x5c8735[_0xf7c0('0x53')]):_0xf7c0('0x65'));return respondWithRpcPromise(_0xf7c0('0x66'),'acceptMessage',_0x598805);}return null;})[_0xf7c0('0x31')](function(_0x1a0df7){var _0x44fb81=_0xf7c0('0x67')+_0x1a0df7[_0xf7c0('0x22')][_0xf7c0('0x68')];return db[_0xf7c0('0x69')][_0xf7c0('0x3d')](_0x44fb81,{'type':db[_0xf7c0('0x6a')][_0xf7c0('0x6b')][_0xf7c0('0x6c')],'raw':!![]})[_0xf7c0('0x31')](function(_0x20800e){return _0x20800e;});})[_0xf7c0('0x31')](function(_0x170174){if(_0x170174){_0x598805[_0xf7c0('0x22')][_0xf7c0('0x6d')]=_0x170174[0x0];if(!_0x5c8735[_0xf7c0('0x53')]['UserId'])return;return db[_0xf7c0('0x6e')][_0xf7c0('0x51')]({'where':{'id':_0x5c8735['body']['UserId'],'role':_0xf7c0('0x5d')},'attributes':['id',_0xf7c0('0x33'),'fullname','email',_0xf7c0('0x6f')],'raw':!![]});}return null;})['then'](function(_0x10645f){if(!_0x10645f)return null;_0x598805[_0xf7c0('0x22')][_0xf7c0('0x5d')]=_0x10645f;return _0x598805;})[_0xf7c0('0x31')](function(_0x4beb52){if(_0x4beb52){if(_0x5c8735['body'][_0xf7c0('0x70')]){_0x598805['message'][_0xf7c0('0x71')]=util[_0xf7c0('0x5a')](_0xf7c0('0x72'),_0x5c8735['user']['name']);_0x598805['message'][_0xf7c0('0x73')]=_0x598805['channel'];_0x598805[_0xf7c0('0x22')][_0xf7c0('0x74')]=_0x598805[_0xf7c0('0x73')];_0x598805[_0xf7c0('0x22')][_0xf7c0('0x75')]='accept';return respondWithRpcPromise(_0xf7c0('0x76'),_0xf7c0('0x76'),{'event':_0xf7c0('0x77'),'message':_[_0xf7c0('0x48')](_0x598805[_0xf7c0('0x22')],JSON[_0xf7c0('0x78')](_0x598805[_0xf7c0('0x64')]['formData']))},client9002)[_0xf7c0('0x31')](function(){return _0x598805;});}return _0x598805;}return null;})[_0xf7c0('0x31')](respondWithResult(_0x928707,null))[_0xf7c0('0x4e')](handleError(_0x928707,null));};var interaction_log=require(_0xf7c0('0x55'))(_0xf7c0('0x79'));exports[_0xf7c0('0x2e')]=function(_0x14cfac,_0x27655a,_0x32467a){var _0x4f4072={'agent':{},'channel':_0xf7c0('0x57')};if(_0x14cfac[_0xf7c0('0x53')]['id']){delete _0x14cfac['body']['id'];}_0x14cfac[_0xf7c0('0x53')]['UserId']=_0x14cfac[_0xf7c0('0x53')]['UserId']||_0x14cfac[_0xf7c0('0x5c')]['id'];_0x4f4072['agent']['id']=_0x14cfac[_0xf7c0('0x53')]['UserId'];return db['ChatMessage'][_0xf7c0('0x51')]({'where':{'id':_0x14cfac[_0xf7c0('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27655a,null))[_0xf7c0('0x31')](function(_0x36f230){if(_0x36f230){_0x4f4072[_0xf7c0('0x22')]=_0x36f230[_0xf7c0('0x5e')]({'plain':!![]});return db[_0xf7c0('0x7a')][_0xf7c0('0x51')]({'where':{'id':_0x36f230[_0xf7c0('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x27655a,null))[_0xf7c0('0x31')](function(_0x453588){if(_0x453588){_0x4f4072['interaction']=_0x453588[_0xf7c0('0x5e')]({'plain':!![]});interaction_log[_0xf7c0('0x1d')](_0xf7c0('0x7b'),_0x14cfac[_0xf7c0('0x5c')]['id'],_0x14cfac[_0xf7c0('0x5c')][_0xf7c0('0x33')],_0x14cfac[_0xf7c0('0x5c')][_0xf7c0('0x63')],_0x4f4072[_0xf7c0('0x64')]['id'],_0x14cfac[_0xf7c0('0x53')]?JSON['stringify'](_0x14cfac[_0xf7c0('0x53')]):_0xf7c0('0x65'));return respondWithRpcPromise(_0xf7c0('0x7c'),_0xf7c0('0x7d'),_0x4f4072);}return null;})[_0xf7c0('0x31')](function(_0x14bde2){var _0x3ec09d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14bde2[_0xf7c0('0x22')]['ContactId'];return db[_0xf7c0('0x69')]['query'](_0x3ec09d,{'type':db[_0xf7c0('0x6a')][_0xf7c0('0x6b')][_0xf7c0('0x6c')],'raw':!![]})[_0xf7c0('0x31')](function(_0x406cc3){return _0x406cc3;});})[_0xf7c0('0x31')](function(_0x2eac95){if(_0x2eac95){_0x4f4072[_0xf7c0('0x22')][_0xf7c0('0x6d')]=_0x2eac95[0x0];if(!_0x14cfac[_0xf7c0('0x53')]['UserId'])return;return db[_0xf7c0('0x6e')][_0xf7c0('0x51')]({'where':{'id':_0x14cfac['body'][_0xf7c0('0x5b')],'role':_0xf7c0('0x5d')},'attributes':['id',_0xf7c0('0x33'),_0xf7c0('0x7e'),_0xf7c0('0x7f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x180dc4){if(!_0x180dc4)return null;_0x4f4072[_0xf7c0('0x22')][_0xf7c0('0x5d')]=_0x180dc4;return _0x4f4072;})['then'](function(_0x5d08d8){if(_0x5d08d8){_0x5d08d8[_0xf7c0('0x22')]['interface']=util[_0xf7c0('0x5a')](_0xf7c0('0x72'),_0x14cfac[_0xf7c0('0x5c')][_0xf7c0('0x33')]);_0x5d08d8[_0xf7c0('0x22')][_0xf7c0('0x73')]=_0x4f4072[_0xf7c0('0x73')];_0x5d08d8[_0xf7c0('0x22')][_0xf7c0('0x74')]=_0x4f4072['channel'];_0x5d08d8[_0xf7c0('0x22')][_0xf7c0('0x75')]=_0xf7c0('0x2e');respondWithRpcPromise(_0xf7c0('0x76'),_0xf7c0('0x76'),{'event':_0xf7c0('0x80'),'message':_[_0xf7c0('0x48')](_0x4f4072[_0xf7c0('0x22')],JSON[_0xf7c0('0x78')](_0x4f4072[_0xf7c0('0x64')][_0xf7c0('0x81')]))},client9002);return _0x4f4072;}return null;})[_0xf7c0('0x31')](respondWithResult(_0x27655a,null))[_0xf7c0('0x4e')](handleError(_0x27655a,null));}; \ No newline at end of file +var _0x0bb7=['order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','params','ChatMessage','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','reject','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','fullname','internal','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x409afc,_0x1f3328){var _0x12f0ff=function(_0x2c7882){while(--_0x2c7882){_0x409afc['push'](_0x409afc['shift']());}};_0x12f0ff(++_0x1f3328);}(_0x0bb7,0x14c));var _0x70bb=function(_0x34cf01,_0x4b9987){_0x34cf01=_0x34cf01-0x0;var _0x24b81a=_0x0bb7[_0x34cf01];return _0x24b81a;};'use strict';var emlformat=require(_0x70bb('0x0'));var rimraf=require(_0x70bb('0x1'));var zipdir=require(_0x70bb('0x2'));var jsonpatch=require(_0x70bb('0x3'));var rp=require(_0x70bb('0x4'));var moment=require('moment');var BPromise=require(_0x70bb('0x5'));var Mustache=require('mustache');var util=require(_0x70bb('0x6'));var path=require(_0x70bb('0x7'));var sox=require('sox');var csv=require(_0x70bb('0x8'));var ejs=require(_0x70bb('0x9'));var fs=require('fs');var fs_extra=require(_0x70bb('0xa'));var _=require(_0x70bb('0xb'));var squel=require(_0x70bb('0xc'));var crypto=require(_0x70bb('0xd'));var jsforce=require(_0x70bb('0xe'));var deskjs=require(_0x70bb('0xf'));var toCsv=require(_0x70bb('0x8'));var querystring=require(_0x70bb('0x10'));var Papa=require(_0x70bb('0x11'));var Redis=require(_0x70bb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x70bb('0x13'));var as=require(_0x70bb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70bb('0x15'))('api');var utils=require(_0x70bb('0x16'));var config=require(_0x70bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x70bb('0x18'))['db'];config[_0x70bb('0x19')]=_[_0x70bb('0x1a')](config['redis'],{'host':_0x70bb('0x1b'),'port':0x18eb});var socket=require(_0x70bb('0x1c'))(new Redis(config[_0x70bb('0x19')]));require(_0x70bb('0x1d'))[_0x70bb('0x1e')](socket);var jayson=require(_0x70bb('0x1f'));var client=jayson[_0x70bb('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x70bb('0x20')][_0x70bb('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1e1c0c,_0x16fe3a,_0x5f044e,_0x1e319a){return new BPromise(function(_0x3d26f3,_0x3c6ad6){var _0x454cea=_0x1e319a||client;return _0x454cea[_0x70bb('0x22')](_0x1e1c0c,_0x5f044e)['then'](function(_0x281ca7){logger['info'](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');logger[_0x70bb('0x24')](_0x70bb('0x25'),_0x16fe3a,_0x70bb('0x26'),JSON[_0x70bb('0x27')](_0x281ca7));if(_0x281ca7[_0x70bb('0x28')]){if(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x29')]===0x1f4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3c6ad6(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3d26f3(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}else{logger[_0x70bb('0x2b')](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');_0x3d26f3(_0x281ca7[_0x70bb('0x2c')][_0x70bb('0x2a')]);}})[_0x70bb('0x2d')](function(_0x5d2cb4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x5d2cb4);_0x3c6ad6(_0x5d2cb4);});});}function respondWithStatusCode(_0x27a511,_0x225518){_0x225518=_0x225518||0xcc;return function(_0x167d5a){if(_0x167d5a){return _0x27a511[_0x70bb('0x2e')](_0x225518);}return _0x27a511['status'](_0x225518)[_0x70bb('0x2f')]();};}function respondWithResult(_0x43745f,_0x2cc13c){_0x2cc13c=_0x2cc13c||0xc8;return function(_0x40c0f7){if(_0x40c0f7){return _0x43745f[_0x70bb('0x30')](_0x2cc13c)['json'](_0x40c0f7);}};}function respondWithFilteredResult(_0x4c50bd,_0x415f10){return function(_0x3079e0){if(_0x3079e0){var _0x36c4c8=typeof _0x415f10[_0x70bb('0x31')]===_0x70bb('0x32')&&typeof _0x415f10[_0x70bb('0x33')]===_0x70bb('0x32');var _0x9600c8=_0x3079e0[_0x70bb('0x34')];var _0x2d87c1=_0x36c4c8?0x0:_0x415f10[_0x70bb('0x31')];var _0x1e4769=_0x36c4c8?_0x3079e0[_0x70bb('0x34')]:_0x415f10['offset']+_0x415f10[_0x70bb('0x33')];var _0x58532b;if(_0x1e4769>=_0x9600c8){_0x1e4769=_0x9600c8;_0x58532b=0xc8;}else{_0x58532b=0xce;}_0x4c50bd[_0x70bb('0x30')](_0x58532b);return _0x4c50bd[_0x70bb('0x35')](_0x70bb('0x36'),_0x2d87c1+'-'+_0x1e4769+'/'+_0x9600c8)[_0x70bb('0x37')](_0x3079e0);}return null;};}function patchUpdates(_0x43102d){return function(_0x3e990c){try{jsonpatch[_0x70bb('0x38')](_0x3e990c,_0x43102d,!![]);}catch(_0x501d56){return BPromise['reject'](_0x501d56);}return _0x3e990c[_0x70bb('0x39')]();};}function saveUpdates(_0x16669c,_0x29ca30){return function(_0x1554c8){if(_0x1554c8){return _0x1554c8[_0x70bb('0x3a')](_0x16669c)[_0x70bb('0x3b')](function(_0xb5dc32){return _0xb5dc32;});}return null;};}function removeEntity(_0x1e27e4,_0x39753e){return function(_0x165427){if(_0x165427){return _0x165427[_0x70bb('0x3c')]()['then'](function(){_0x1e27e4['status'](0xcc)[_0x70bb('0x2f')]();});}};}function handleEntityNotFound(_0x3299a6,_0x33d85e){return function(_0x41d561){if(!_0x41d561){_0x3299a6[_0x70bb('0x2e')](0x194);}return _0x41d561;};}function handleError(_0x358b05,_0x704ce5){_0x704ce5=_0x704ce5||0x1f4;return function(_0x58d741){logger['error'](_0x58d741[_0x70bb('0x3d')]);if(_0x58d741['name']){delete _0x58d741['name'];}_0x358b05['status'](_0x704ce5)[_0x70bb('0x3e')](_0x58d741);};}exports[_0x70bb('0x3f')]=function(_0x291be7,_0x4f2ad6){var _0x282162={},_0x4bd656={},_0x1ec123={'count':0x0,'rows':[]};var _0x7f445d=_['map'](db['ChatMessage'][_0x70bb('0x40')],function(_0x32c509){return{'name':_0x32c509['fieldName'],'type':_0x32c509[_0x70bb('0x41')][_0x70bb('0x42')]};});_0x4bd656[_0x70bb('0x43')]=_[_0x70bb('0x44')](_0x7f445d,_0x70bb('0x45'));_0x4bd656[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x291be7[_0x70bb('0x46')]);_0x4bd656[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],_0x4bd656['query']);_0x282162['attributes']=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x291be7['query'][_0x70bb('0x4a')]));_0x282162[_0x70bb('0x4b')]=_0x282162[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x282162['attributes']:_0x4bd656['model'];if(!_0x291be7[_0x70bb('0x46')][_0x70bb('0x4d')](_0x70bb('0x4e'))){_0x282162[_0x70bb('0x33')]=qs[_0x70bb('0x33')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x33')]);_0x282162['offset']=qs[_0x70bb('0x31')](_0x291be7['query'][_0x70bb('0x31')]);}_0x282162[_0x70bb('0x4f')]=qs[_0x70bb('0x50')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x50')]);_0x282162[_0x70bb('0x51')]=qs[_0x70bb('0x48')](_[_0x70bb('0x52')](_0x291be7['query'],_0x4bd656[_0x70bb('0x48')]),_0x7f445d);if(_0x291be7[_0x70bb('0x46')]['filter']){_0x282162[_0x70bb('0x51')]=_[_0x70bb('0x53')](_0x282162['where'],{'$or':_[_0x70bb('0x44')](_0x7f445d,function(_0x365fb4){if(_0x365fb4[_0x70bb('0x41')]!==_0x70bb('0x54')){var _0x559a3a={};_0x559a3a[_0x365fb4['name']]={'$like':'%'+_0x291be7[_0x70bb('0x46')][_0x70bb('0x55')]+'%'};return _0x559a3a;}})});}_0x282162=_['merge']({},_0x282162,_0x291be7[_0x70bb('0x56')]);var _0x37d2ab={'where':_0x282162[_0x70bb('0x51')]};return db['ChatMessage']['count'](_0x37d2ab)[_0x70bb('0x3b')](function(_0xe06b59){_0x1ec123[_0x70bb('0x34')]=_0xe06b59;if(_0x291be7['query']['includeAll']){_0x282162[_0x70bb('0x57')]=[{'all':!![]}];}return db['ChatMessage'][_0x70bb('0x58')](_0x282162);})[_0x70bb('0x3b')](function(_0x3540bd){_0x1ec123['rows']=_0x3540bd;return _0x1ec123;})[_0x70bb('0x3b')](respondWithFilteredResult(_0x4f2ad6,_0x282162))[_0x70bb('0x2d')](handleError(_0x4f2ad6,null));};exports['show']=function(_0x26f2f2,_0x3f4929){var _0x59d619={'raw':!![],'where':{'id':_0x26f2f2[_0x70bb('0x59')]['id']}},_0x11d815={};_0x11d815[_0x70bb('0x43')]=_[_0x70bb('0x47')](db[_0x70bb('0x5a')][_0x70bb('0x40')]);_0x11d815[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x26f2f2['query']);_0x11d815[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x11d815[_0x70bb('0x43')],_0x11d815[_0x70bb('0x46')]);_0x59d619[_0x70bb('0x4b')]=_['intersection'](_0x11d815[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x26f2f2[_0x70bb('0x46')]['fields']));_0x59d619['attributes']=_0x59d619[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x59d619[_0x70bb('0x4b')]:_0x11d815[_0x70bb('0x43')];if(_0x26f2f2[_0x70bb('0x46')]['includeAll']){_0x59d619[_0x70bb('0x57')]=[{'all':!![]}];}_0x59d619=_[_0x70bb('0x53')]({},_0x59d619,_0x26f2f2[_0x70bb('0x56')]);return db[_0x70bb('0x5a')][_0x70bb('0x5b')](_0x59d619)[_0x70bb('0x3b')](handleEntityNotFound(_0x3f4929,null))[_0x70bb('0x3b')](respondWithResult(_0x3f4929,null))['catch'](handleError(_0x3f4929,null));};exports['create']=function(_0x31f3c3,_0x30ee14){return db[_0x70bb('0x5a')][_0x70bb('0x5c')](_0x31f3c3[_0x70bb('0x5d')],{})[_0x70bb('0x3b')](respondWithResult(_0x30ee14,0xc9))[_0x70bb('0x2d')](handleError(_0x30ee14,null));};exports[_0x70bb('0x3a')]=function(_0x3f1b6c,_0x170e1a){if(_0x3f1b6c[_0x70bb('0x5d')]['id']){delete _0x3f1b6c[_0x70bb('0x5d')]['id'];}return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x3f1b6c[_0x70bb('0x59')]['id']}})[_0x70bb('0x3b')](handleEntityNotFound(_0x170e1a,null))['then'](saveUpdates(_0x3f1b6c[_0x70bb('0x5d')],null))[_0x70bb('0x3b')](respondWithResult(_0x170e1a,null))[_0x70bb('0x2d')](handleError(_0x170e1a,null));};exports['destroy']=function(_0x30d89d,_0x37a9f2){return db[_0x70bb('0x5a')]['find']({'where':{'id':_0x30d89d[_0x70bb('0x59')]['id']}})['then'](handleEntityNotFound(_0x37a9f2,null))[_0x70bb('0x3b')](removeEntity(_0x37a9f2,null))[_0x70bb('0x2d')](handleError(_0x37a9f2,null));};exports['describe']=function(_0x21f2cd,_0x31a43f){return db[_0x70bb('0x5a')][_0x70bb('0x5e')]()[_0x70bb('0x3b')](respondWithResult(_0x31a43f,null))[_0x70bb('0x2d')](handleError(_0x31a43f,null));};var interaction_log=require('../../config/logger')(_0x70bb('0x5f'));exports[_0x70bb('0x60')]=function(_0x522c58,_0x7d50ce,_0x55891c){var _0x10594a={'agent':{},'channel':_0x70bb('0x61')};if(_0x522c58[_0x70bb('0x5d')]['id']){delete _0x522c58[_0x70bb('0x5d')]['id'];}_0x522c58['body'][_0x70bb('0x62')]=!![];_0x522c58[_0x70bb('0x5d')][_0x70bb('0x63')]=moment()['format'](_0x70bb('0x64'));_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x522c58[_0x70bb('0x66')]['id'];_0x10594a[_0x70bb('0x67')]['id']=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7d50ce,null))[_0x70bb('0x3b')](saveUpdates(_0x522c58[_0x70bb('0x5d')],null))['then'](function(_0x12e70d){if(_0x12e70d){_0x10594a[_0x70bb('0x2a')]=_0x12e70d['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x12e70d['ChatInteractionId']}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x7d50ce,null))['then'](function(_0x221aaa){if(_0x221aaa){return _0x221aaa[_0x70bb('0x3a')]({'UserId':_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')],'read1stAt':_[_0x70bb('0x68')](_0x221aaa['read1stAt'])?moment()[_0x70bb('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1c616c){if(_0x1c616c){_0x10594a[_0x70bb('0x6a')]=_0x1c616c['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x522c58[_0x70bb('0x66')]['id'],_0x522c58[_0x70bb('0x66')]['name'],_0x522c58[_0x70bb('0x66')][_0x70bb('0x6b')],_0x10594a[_0x70bb('0x6a')]['id'],_0x522c58['body']?JSON[_0x70bb('0x27')](_0x522c58['body']):_0x70bb('0x6c'));return respondWithRpcPromise(_0x70bb('0x6d'),_0x70bb('0x6e'),_0x10594a);}return null;})[_0x70bb('0x3b')](function(_0x5bf286){var _0x20c56a=_0x70bb('0x6f')+_0x5bf286[_0x70bb('0x2a')][_0x70bb('0x70')];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x20c56a,{'type':db['Sequelize']['QueryTypes'][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x4fbba7){return _0x4fbba7;});})['then'](function(_0x318e30){if(_0x318e30){_0x10594a[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x318e30[0x0];if(!_0x522c58[_0x70bb('0x5d')]['UserId'])return;return db[_0x70bb('0x74')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),'fullname',_0x70bb('0x75'),'internal'],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x42bb8a){if(!_0x42bb8a)return null;_0x10594a['message']['agent']=_0x42bb8a;return _0x10594a;})[_0x70bb('0x3b')](function(_0x57029e){if(_0x57029e){if(_0x522c58['body']['manual']){_0x10594a['message'][_0x70bb('0x76')]=util[_0x70bb('0x69')](_0x70bb('0x77'),_0x522c58[_0x70bb('0x66')][_0x70bb('0x45')]);_0x10594a['message']['channel']=_0x10594a[_0x70bb('0x78')];_0x10594a[_0x70bb('0x2a')]['motionChannel']=_0x10594a['channel'];_0x10594a[_0x70bb('0x2a')][_0x70bb('0x79')]='accept';return respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x7b'),'message':_[_0x70bb('0x53')](_0x10594a[_0x70bb('0x2a')],JSON['parse'](_0x10594a[_0x70bb('0x6a')][_0x70bb('0x7c')]))},client9002)['then'](function(){return _0x10594a;});}return _0x10594a;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x7d50ce,null))[_0x70bb('0x2d')](handleError(_0x7d50ce,null));};var interaction_log=require(_0x70bb('0x15'))(_0x70bb('0x5f'));exports[_0x70bb('0x7d')]=function(_0x5777a0,_0x58f136,_0x352986){var _0x52916d={'agent':{},'channel':_0x70bb('0x61')};if(_0x5777a0[_0x70bb('0x5d')]['id']){delete _0x5777a0['body']['id'];}_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x5777a0['user']['id'];_0x52916d[_0x70bb('0x67')]['id']=_0x5777a0['body']['UserId'];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x5777a0[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x3c67fd){if(_0x3c67fd){_0x52916d[_0x70bb('0x2a')]=_0x3c67fd[_0x70bb('0x7e')]({'plain':!![]});return db['ChatInteraction'][_0x70bb('0x5b')]({'where':{'id':_0x3c67fd[_0x70bb('0x7f')]}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x1aa14f){if(_0x1aa14f){_0x52916d['interaction']=_0x1aa14f[_0x70bb('0x7e')]({'plain':!![]});interaction_log[_0x70bb('0x2b')](_0x70bb('0x80'),_0x5777a0['user']['id'],_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')],_0x5777a0[_0x70bb('0x66')]['role'],_0x52916d[_0x70bb('0x6a')]['id'],_0x5777a0[_0x70bb('0x5d')]?JSON[_0x70bb('0x27')](_0x5777a0[_0x70bb('0x5d')]):'null');return respondWithRpcPromise(_0x70bb('0x81'),_0x70bb('0x82'),_0x52916d);}return null;})[_0x70bb('0x3b')](function(_0x3334a8){var _0x449c9c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3334a8[_0x70bb('0x2a')]['ContactId'];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x449c9c,{'type':db[_0x70bb('0x83')][_0x70bb('0x84')][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x3a161c){return _0x3a161c;});})[_0x70bb('0x3b')](function(_0x182186){if(_0x182186){_0x52916d[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x182186[0x0];if(!_0x5777a0['body'][_0x70bb('0x65')])return;return db[_0x70bb('0x74')]['find']({'where':{'id':_0x5777a0[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),_0x70bb('0x85'),_0x70bb('0x75'),_0x70bb('0x86')],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x110b42){if(!_0x110b42)return null;_0x52916d[_0x70bb('0x2a')][_0x70bb('0x67')]=_0x110b42;return _0x52916d;})[_0x70bb('0x3b')](function(_0x537598){if(_0x537598){_0x537598[_0x70bb('0x2a')][_0x70bb('0x76')]=util['format'](_0x70bb('0x77'),_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')]);_0x537598[_0x70bb('0x2a')][_0x70bb('0x78')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x87')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x79')]=_0x70bb('0x7d');respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x88'),'message':_[_0x70bb('0x53')](_0x52916d[_0x70bb('0x2a')],JSON['parse'](_0x52916d[_0x70bb('0x6a')]['formData']))},client9002);return _0x52916d;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x58f136,null))[_0x70bb('0x2d')](handleError(_0x58f136,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index f1dfce9..5021504 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 _0xf5df=['save','remove','emit','hook','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x358d5b,_0x34d08a){var _0x30b7a0=function(_0x4f6865){while(--_0x4f6865){_0x358d5b['push'](_0x358d5b['shift']());}};_0x30b7a0(++_0x34d08a);}(_0xf5df,0x154));var _0xff5d=function(_0x3b5feb,_0x1b8b43){_0x3b5feb=_0x3b5feb-0x0;var _0x1fbbfd=_0xf5df[_0x3b5feb];return _0x1fbbfd;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xff5d('0x0'))['db'][_0xff5d('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xff5d('0x2')](0x0);var events={'afterCreate':_0xff5d('0x3'),'afterUpdate':'update','afterDestroy':_0xff5d('0x4')};function emitEvent(_0x3f9113){return function(_0x4f6a7a,_0x2daf31,_0x3cd38f){ChatMessageEvents[_0xff5d('0x5')](_0x3f9113+':'+_0x4f6a7a['id'],_0x4f6a7a);ChatMessageEvents[_0xff5d('0x5')](_0x3f9113,_0x4f6a7a);_0x3cd38f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xff5d('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x73e6=['../../mysqldb','ChatMessage','remove','emit','hasOwnProperty'];(function(_0x5440ba,_0xf350cc){var _0x54e377=function(_0x26c67a){while(--_0x26c67a){_0x5440ba['push'](_0x5440ba['shift']());}};_0x54e377(++_0xf350cc);}(_0x73e6,0x11d));var _0x673e=function(_0x5dcce1,_0x5c8a64){_0x5dcce1=_0x5dcce1-0x0;var _0x554d28=_0x73e6[_0x5dcce1];return _0x554d28;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x673e('0x0'))['db'][_0x673e('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x673e('0x2')};function emitEvent(_0x2d503b){return function(_0x1f992f,_0x4749fc,_0x2e2bd1){ChatMessageEvents[_0x673e('0x3')](_0x2d503b+':'+_0x1f992f['id'],_0x1f992f);ChatMessageEvents[_0x673e('0x3')](_0x2d503b,_0x1f992f);_0x2e2bd1(null);};}for(var e in events){if(events[_0x673e('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 84ee3e1..d9a6e26 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 _0x9c70=['bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','createdAt','catch','error','lodash','util','../../config/logger','api'];(function(_0x3e2896,_0x1da662){var _0x4817fe=function(_0x5b12e2){while(--_0x5b12e2){_0x3e2896['push'](_0x3e2896['shift']());}};_0x4817fe(++_0x1da662);}(_0x9c70,0xd4));var _0x09c7=function(_0x5c9008,_0x4bb3a6){_0x5c9008=_0x5c9008-0x0;var _0x31a5e0=_0x9c70[_0x5c9008];return _0x31a5e0;};'use strict';var _=require(_0x09c7('0x0'));var util=require(_0x09c7('0x1'));var logger=require(_0x09c7('0x2'))(_0x09c7('0x3'));var moment=require('moment');var BPromise=require(_0x09c7('0x4'));var rp=require(_0x09c7('0x5'));var fs=require('fs');var path=require(_0x09c7('0x6'));var rimraf=require(_0x09c7('0x7'));var config=require(_0x09c7('0x8'));var attributes=require(_0x09c7('0x9'));module['exports']=function(_0x11fb6f,_0x57a7cc){return _0x11fb6f['define'](_0x09c7('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x09c7('0xb'),'fields':[_0x09c7('0xc')],'type':_0x09c7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x366a03,_0x22c8a,_0x235407){var _0x206886=_0x11fb6f[_0x09c7('0xe')];var _0x499942=_0x366a03[_0x09c7('0xf')]({'plain':!![]});if(_0x499942[_0x09c7('0x10')][_0x09c7('0x11')]()==='in'||_0x499942[_0x09c7('0x10')][_0x09c7('0x11')]()===_0x09c7('0x12')&&!_0x499942[_0x09c7('0x13')]&&!_[_0x09c7('0x14')](_0x499942[_0x09c7('0x15')])){_0x206886[_0x09c7('0x16')]['findOne']({'where':{'id':_0x499942[_0x09c7('0x17')]}})['then'](function(_0x4742ea){if(_0x4742ea){_0x4742ea['update']({'lastMsgAt':_0x499942[_0x09c7('0x18')],'lastMsgDirection':_0x499942[_0x09c7('0x10')][_0x09c7('0x11')]()});}})[_0x09c7('0x19')](function(_0x99ea01){console[_0x09c7('0x1a')](_0x99ea01);});}_0x235407();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe697=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','findOne','ChatInteractionId','update','createdAt','catch'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe697,0x1cf));var _0x7e69=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xe697[_0x5447aa];return _0xb21e53;};'use strict';var _=require('lodash');var util=require(_0x7e69('0x0'));var logger=require(_0x7e69('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7e69('0x2'));var rp=require(_0x7e69('0x3'));var fs=require('fs');var path=require(_0x7e69('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x56dca7,_0x5c893a){return _0x56dca7[_0x7e69('0x5')]('ChatMessage',attributes,{'tableName':_0x7e69('0x6'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x7e69('0x7')],'type':_0x7e69('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x210b71,_0x564857,_0xf9f2fa){var _0x13f5ea=_0x56dca7[_0x7e69('0x9')];var _0x288df0=_0x210b71[_0x7e69('0xa')]({'plain':!![]});if(_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='in'||_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='out'&&!_0x288df0[_0x7e69('0xd')]&&!_[_0x7e69('0xe')](_0x288df0['UserId'])){_0x13f5ea['ChatInteraction'][_0x7e69('0xf')]({'where':{'id':_0x288df0[_0x7e69('0x10')]}})['then'](function(_0x4be24c){if(_0x4be24c){_0x4be24c[_0x7e69('0x11')]({'lastMsgAt':_0x288df0[_0x7e69('0x12')],'lastMsgDirection':_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()});}})[_0x7e69('0x13')](function(_0x40ef2a){console[_0x7e69('0x14')](_0x40ef2a);});}_0xf9f2fa();}},'charset':_0x7e69('0x15'),'collate':_0x7e69('0x16')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 3b4810f..ed9c315 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 _0xfea2=['request','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','then','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xfea2,0x156));var _0x2fea=function(_0x2300c7,_0x255f74){_0x2300c7=_0x2300c7-0x0;var _0x23f720=_0xfea2[_0x2300c7];return _0x23f720;};'use strict';var _=require(_0x2fea('0x0'));var util=require(_0x2fea('0x1'));var moment=require(_0x2fea('0x2'));var BPromise=require('bluebird');var rs=require(_0x2fea('0x3'));var fs=require('fs');var Redis=require(_0x2fea('0x4'));var db=require(_0x2fea('0x5'))['db'];var utils=require(_0x2fea('0x6'));var logger=require(_0x2fea('0x7'))(_0x2fea('0x8'));var config=require(_0x2fea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2fea('0xa')][_0x2fea('0xb')]({'port':0x232a});config['redis']=_[_0x2fea('0xc')](config[_0x2fea('0xd')],{'host':_0x2fea('0xe'),'port':0x18eb});var socket=require(_0x2fea('0xf'))(new Redis(config[_0x2fea('0xd')]));require(_0x2fea('0x10'))[_0x2fea('0x11')](socket);function respondWithRpcPromise(_0x23a4db,_0x5d0200,_0x2a3fd9){return new BPromise(function(_0x33b252,_0x51a364){return client[_0x2fea('0x12')](_0x23a4db,_0x2a3fd9)['then'](function(_0x409ac7){logger[_0x2fea('0x13')](_0x2fea('0x14'),_0x5d0200,'request\x20sent');logger['debug'](_0x2fea('0x15'),_0x5d0200,_0x2fea('0x16'),JSON[_0x2fea('0x17')](_0x409ac7));if(_0x409ac7[_0x2fea('0x18')]){if(_0x409ac7[_0x2fea('0x18')][_0x2fea('0x19')]===0x1f4){logger['error'](_0x2fea('0x14'),_0x5d0200,_0x409ac7[_0x2fea('0x18')][_0x2fea('0x1a')]);return _0x51a364(_0x409ac7['error'][_0x2fea('0x1a')]);}logger[_0x2fea('0x18')](_0x2fea('0x14'),_0x5d0200,_0x409ac7[_0x2fea('0x18')][_0x2fea('0x1a')]);return _0x33b252(_0x409ac7[_0x2fea('0x18')][_0x2fea('0x1a')]);}else{logger[_0x2fea('0x13')](_0x2fea('0x14'),_0x5d0200,_0x2fea('0x16'));_0x33b252(_0x409ac7[_0x2fea('0x1b')][_0x2fea('0x1a')]);}})[_0x2fea('0x1c')](function(_0x215ce9){logger[_0x2fea('0x18')]('ChatMessage,\x20%s,\x20%s',_0x5d0200,_0x215ce9);_0x51a364(_0x215ce9);});});}exports[_0x2fea('0x1d')]=function(_0x5d48ee){var _0x59de1e=this;return new Promise(function(_0x534feb,_0x4fa5ce){return db[_0x2fea('0x1e')]['create'](_0x5d48ee[_0x2fea('0x1f')],{'raw':_0x5d48ee[_0x2fea('0x20')]?_0x5d48ee[_0x2fea('0x20')][_0x2fea('0x21')]===undefined?!![]:![]:!![]})[_0x2fea('0x22')](function(_0x245ec8){logger['info'](_0x2fea('0x1d'),_0x5d48ee);logger[_0x2fea('0x23')](_0x2fea('0x1d'),_0x5d48ee,JSON[_0x2fea('0x17')](_0x245ec8));_0x534feb(_0x245ec8);})[_0x2fea('0x1c')](function(_0x3cfe7b){logger[_0x2fea('0x18')](_0x2fea('0x1d'),_0x3cfe7b[_0x2fea('0x1a')],_0x5d48ee);_0x4fa5ce(_0x59de1e[_0x2fea('0x18')](0x1f4,_0x3cfe7b[_0x2fea('0x1a')]));});});}; \ No newline at end of file +var _0xb4c9=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','stringify','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xb4c9,0xbf));var _0x9b4c=function(_0x43a88c,_0x452929){_0x43a88c=_0x43a88c-0x0;var _0x5f267f=_0xb4c9[_0x43a88c];return _0x5f267f;};'use strict';var _=require('lodash');var util=require(_0x9b4c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9b4c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b4c('0x2'));var logger=require(_0x9b4c('0x3'))(_0x9b4c('0x4'));var config=require(_0x9b4c('0x5'));var jayson=require(_0x9b4c('0x6'));var client=jayson[_0x9b4c('0x7')][_0x9b4c('0x8')]({'port':0x232a});config[_0x9b4c('0x9')]=_[_0x9b4c('0xa')](config[_0x9b4c('0x9')],{'host':_0x9b4c('0xb'),'port':0x18eb});var socket=require(_0x9b4c('0xc'))(new Redis(config[_0x9b4c('0x9')]));require('./chatMessage.socket')[_0x9b4c('0xd')](socket);function respondWithRpcPromise(_0x300a7a,_0x23210b,_0x315437){return new BPromise(function(_0x46e6f5,_0xe7b36d){return client[_0x9b4c('0xe')](_0x300a7a,_0x315437)[_0x9b4c('0xf')](function(_0xb27041){logger[_0x9b4c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'));logger[_0x9b4c('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'),JSON['stringify'](_0xb27041));if(_0xb27041[_0x9b4c('0x13')]){if(_0xb27041['error'][_0x9b4c('0x14')]===0x1f4){logger[_0x9b4c('0x13')](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')][_0x9b4c('0x16')]);return _0xe7b36d(_0xb27041[_0x9b4c('0x13')]['message']);}logger['error'](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')]['message']);return _0x46e6f5(_0xb27041['error'][_0x9b4c('0x16')]);}else{logger['info'](_0x9b4c('0x15'),_0x23210b,_0x9b4c('0x11'));_0x46e6f5(_0xb27041[_0x9b4c('0x17')][_0x9b4c('0x16')]);}})[_0x9b4c('0x18')](function(_0x3c797d){logger[_0x9b4c('0x13')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x3c797d);_0xe7b36d(_0x3c797d);});});}exports['CreateChatMessage']=function(_0xd03081){var _0x27ee27=this;return new Promise(function(_0x2916c9,_0x1cbf69){return db[_0x9b4c('0x19')][_0x9b4c('0x1a')](_0xd03081[_0x9b4c('0x1b')],{'raw':_0xd03081['options']?_0xd03081[_0x9b4c('0x1c')][_0x9b4c('0x1d')]===undefined?!![]:![]:!![]})[_0x9b4c('0xf')](function(_0x34f82c){logger[_0x9b4c('0x10')](_0x9b4c('0x1e'),_0xd03081);logger[_0x9b4c('0x12')]('CreateChatMessage',_0xd03081,JSON[_0x9b4c('0x1f')](_0x34f82c));_0x2916c9(_0x34f82c);})[_0x9b4c('0x18')](function(_0x53c6a3){logger[_0x9b4c('0x13')](_0x9b4c('0x1e'),_0x53c6a3[_0x9b4c('0x16')],_0xd03081);_0x1cbf69(_0x27ee27['error'](0x1f4,_0x53c6a3[_0x9b4c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index e323497..69faa2d 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 _0xe132=['remove','update','length','chatMessage:','./chatMessage.events'];(function(_0x1c07e4,_0x15188d){var _0x3b9942=function(_0x1a7dca){while(--_0x1a7dca){_0x1c07e4['push'](_0x1c07e4['shift']());}};_0x3b9942(++_0x15188d);}(_0xe132,0x162));var _0x2e13=function(_0x529364,_0xd4d4c7){_0x529364=_0x529364-0x0;var _0x1eefdf=_0xe132[_0x529364];return _0x1eefdf;};'use strict';var ChatMessageEvents=require(_0x2e13('0x0'));var events=['save',_0x2e13('0x1'),_0x2e13('0x2')];function createListener(_0x21dfef,_0x2c2bdd){return function(_0x2a5250){_0x2c2bdd['emit'](_0x21dfef,_0x2a5250);};}function removeListener(_0x1ae6a9,_0x3f01fe){return function(){ChatMessageEvents['removeListener'](_0x1ae6a9,_0x3f01fe);};}exports['register']=function(_0x260dc1){for(var _0x2f9d00=0x0,_0x1c670b=events[_0x2e13('0x3')];_0x2f9d00<_0x1c670b;_0x2f9d00++){var _0x3be5dc=events[_0x2f9d00];var _0x2d9487=createListener(_0x2e13('0x4')+_0x3be5dc,_0x260dc1);ChatMessageEvents['on'](_0x3be5dc,_0x2d9487);}}; \ No newline at end of file +var _0x7c09=['save','remove','emit','removeListener','length','chatMessage:'];(function(_0x39ec63,_0x346199){var _0x5802e1=function(_0x286585){while(--_0x286585){_0x39ec63['push'](_0x39ec63['shift']());}};_0x5802e1(++_0x346199);}(_0x7c09,0x102));var _0x97c0=function(_0x4f39ad,_0x1cd3be){_0x4f39ad=_0x4f39ad-0x0;var _0x6da4ff=_0x7c09[_0x4f39ad];return _0x6da4ff;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){ChatMessageEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);ChatMessageEvents['on'](_0x2c19fa,_0x109bc8);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6667439..1c2c249 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 _0x380f=['create','put','update','/:id/accept','accept','reject','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','tracked','chatmessage:create'];(function(_0x3005bb,_0xe9520d){var _0x2f866b=function(_0x10c253){while(--_0x10c253){_0x3005bb['push'](_0x3005bb['shift']());}};_0x2f866b(++_0xe9520d);}(_0x380f,0xae));var _0xf380=function(_0x26f975,_0x9473ed){_0x26f975=_0x26f975-0x0;var _0x3680e0=_0x380f[_0x26f975];return _0x3680e0;};'use strict';var multer=require(_0xf380('0x0'));var util=require('util');var path=require(_0xf380('0x1'));var timeout=require(_0xf380('0x2'));var express=require(_0xf380('0x3'));var router=express[_0xf380('0x4')]();var fs_extra=require(_0xf380('0x5'));var auth=require(_0xf380('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf380('0x7'));var controller=require('./chatMessage.controller');router[_0xf380('0x8')]('/',auth[_0xf380('0x9')](),controller[_0xf380('0xa')]);router[_0xf380('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf380('0x8')](_0xf380('0xb'),auth[_0xf380('0x9')](),controller[_0xf380('0xc')]);router['post']('/',auth[_0xf380('0x9')](),interaction[_0xf380('0xd')]('chat',_0xf380('0xe')),controller[_0xf380('0xf')]);router[_0xf380('0x10')](_0xf380('0xb'),controller[_0xf380('0x11')]);router[_0xf380('0x10')](_0xf380('0x12'),auth[_0xf380('0x9')](),controller[_0xf380('0x13')]);router[_0xf380('0x10')]('/:id/reject',auth[_0xf380('0x9')](),controller[_0xf380('0x14')]);router['delete'](_0xf380('0xb'),auth[_0xf380('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xecd9=['./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject','reject','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x154b29,_0x4aab17){var _0x48b5c6=function(_0x3ac71a){while(--_0x3ac71a){_0x154b29['push'](_0x154b29['shift']());}};_0x48b5c6(++_0x4aab17);}(_0xecd9,0x162));var _0x9ecd=function(_0x24143b,_0x536f6d){_0x24143b=_0x24143b-0x0;var _0x324c9a=_0xecd9[_0x24143b];return _0x324c9a;};'use strict';var multer=require(_0x9ecd('0x0'));var util=require(_0x9ecd('0x1'));var path=require(_0x9ecd('0x2'));var timeout=require(_0x9ecd('0x3'));var express=require(_0x9ecd('0x4'));var router=express[_0x9ecd('0x5')]();var fs_extra=require(_0x9ecd('0x6'));var auth=require(_0x9ecd('0x7'));var interaction=require(_0x9ecd('0x8'));var config=require(_0x9ecd('0x9'));var controller=require(_0x9ecd('0xa'));router[_0x9ecd('0xb')]('/',auth[_0x9ecd('0xc')](),controller['index']);router['get'](_0x9ecd('0xd'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xe')]);router[_0x9ecd('0xb')]('/:id',auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xf')]);router[_0x9ecd('0x10')]('/',auth[_0x9ecd('0xc')](),interaction[_0x9ecd('0x11')](_0x9ecd('0x12'),_0x9ecd('0x13')),controller[_0x9ecd('0x14')]);router[_0x9ecd('0x15')]('/:id',controller[_0x9ecd('0x16')]);router['put']('/:id/accept',auth[_0x9ecd('0xc')](),controller['accept']);router[_0x9ecd('0x15')](_0x9ecd('0x17'),auth['isAuthenticated'](),controller[_0x9ecd('0x18')]);router['delete'](_0x9ecd('0x19'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0x1a')]);module[_0x9ecd('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 4755c8c..da45158 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x4d685a,_0x5422c2){var _0x4c80ea=function(_0x293780){while(--_0x293780){_0x4d685a['push'](_0x4d685a['shift']());}};_0x4c80ea(++_0x5422c2);}(_0xdb28,0x106));var _0x8db2=function(_0x287a33,_0x3d170d){_0x287a33=_0x287a33-0x0;var _0xa6e1cc=_0xdb28[_0x287a33];return _0xa6e1cc;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x596cc0,_0x4e1a74){var _0x37dc4f=function(_0x47a0dd){while(--_0x47a0dd){_0x596cc0['push'](_0x596cc0['shift']());}};_0x37dc4f(++_0x4e1a74);}(_0xb10b,0x12a));var _0xbb10=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0xb10b[_0x11d684];return _0x78a301;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7e56e74..1fbe08e 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x3facbf,_0xd5bd98){var _0x53ab80=function(_0x21572d){while(--_0x21572d){_0x3facbf['push'](_0x3facbf['shift']());}};_0x53ab80(++_0xd5bd98);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x4cf785,_0x3158dc){_0x4cf785=_0x4cf785-0x0;var _0x2c8d9c=_0x7a54[_0x4cf785];return _0x2c8d9c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index ab28c0b..f24f1c6 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 _0x34be=['exports','../../mysqldb','emit','hasOwnProperty'];(function(_0x4c8be7,_0x2d1f9f){var _0x13b337=function(_0x5e9292){while(--_0x5e9292){_0x4c8be7['push'](_0x4c8be7['shift']());}};_0x13b337(++_0x2d1f9f);}(_0x34be,0x139));var _0xe34b=function(_0x55daf2,_0x1b48de){_0x55daf2=_0x55daf2-0x0;var _0x1c8500=_0x34be[_0x55daf2];return _0x1c8500;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xe34b('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5359be){return function(_0x83c7c,_0x3e57f7,_0x4ce5f2){ChatOfflineMessageEvents[_0xe34b('0x1')](_0x5359be+':'+_0x83c7c['id'],_0x83c7c);ChatOfflineMessageEvents['emit'](_0x5359be,_0x83c7c);_0x4ce5f2(null);};}for(var e in events){if(events[_0xe34b('0x2')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0xe34b('0x3')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xf02c=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x2bfe2d,_0x694d7f){var _0x489188=function(_0x56b625){while(--_0x56b625){_0x2bfe2d['push'](_0x2bfe2d['shift']());}};_0x489188(++_0x694d7f);}(_0xf02c,0x92));var _0xcf02=function(_0xb48270,_0x536ef3){_0xb48270=_0xb48270-0x0;var _0x457510=_0xf02c[_0xb48270];return _0x457510;};'use strict';var EventEmitter=require(_0xcf02('0x0'));var ChatOfflineMessage=require(_0xcf02('0x1'))['db'][_0xcf02('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcf02('0x3')](0x0);var events={'afterCreate':_0xcf02('0x4'),'afterUpdate':_0xcf02('0x5'),'afterDestroy':_0xcf02('0x6')};function emitEvent(_0x378e8b){return function(_0x3abde3,_0x354198,_0x3e8829){ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b+':'+_0x3abde3['id'],_0x3abde3);ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b,_0x3abde3);_0x3e8829(null);};}for(var e in events){if(events[_0xcf02('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xcf02('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index d1f438d..cd6f30c 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 _0x4438=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x4438,0x9a));var _0x8443=function(_0x931e6b,_0x96f9a6){_0x931e6b=_0x931e6b-0x0;var _0x599365=_0x4438[_0x931e6b];return _0x599365;};'use strict';var attributes=require(_0x8443('0x0'));module[_0x8443('0x1')]=function(_0x400337){return _0x400337[_0x8443('0x2')](_0x8443('0x3'),attributes,{'tableName':_0x8443('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8443('0x5'),'collate':_0x8443('0x6')});}; \ No newline at end of file +var _0x7506=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x37044b,_0x1351f1){var _0x7c82f2=function(_0x4d6504){while(--_0x4d6504){_0x37044b['push'](_0x37044b['shift']());}};_0x7c82f2(++_0x1351f1);}(_0x7506,0x184));var _0x6750=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x7506[_0x341e0f];return _0x59555a;};'use strict';var attributes=require(_0x6750('0x0'));module[_0x6750('0x1')]=function(_0x25f152){return _0x25f152[_0x6750('0x2')](_0x6750('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6750('0x4'),'collate':_0x6750('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 9c9a58e..1566149 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 _0x74d6=['../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ioredis','../../config/utils','../../config/logger'];(function(_0x58fa2b,_0x3ab810){var _0x109ba0=function(_0x272205){while(--_0x272205){_0x58fa2b['push'](_0x58fa2b['shift']());}};_0x109ba0(++_0x3ab810);}(_0x74d6,0xeb));var _0x674d=function(_0x3d30a7,_0x27127d){_0x3d30a7=_0x3d30a7-0x0;var _0x4d433e=_0x74d6[_0x3d30a7];return _0x4d433e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x674d('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x674d('0x1'));var logger=require(_0x674d('0x2'))('rpc');var config=require(_0x674d('0x3'));var jayson=require(_0x674d('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b4ae0,_0x343348,_0x5061b7){return new BPromise(function(_0x4d37f7,_0x58c3ec){return client[_0x674d('0x5')](_0x4b4ae0,_0x5061b7)[_0x674d('0x6')](function(_0x175908){logger[_0x674d('0x7')](_0x674d('0x8'),_0x343348,'request\x20sent');logger['debug'](_0x674d('0x9'),_0x343348,'request\x20sent',JSON[_0x674d('0xa')](_0x175908));if(_0x175908['error']){if(_0x175908[_0x674d('0xb')][_0x674d('0xc')]===0x1f4){logger[_0x674d('0xb')](_0x674d('0x8'),_0x343348,_0x175908[_0x674d('0xb')][_0x674d('0xd')]);return _0x58c3ec(_0x175908[_0x674d('0xb')]['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x343348,_0x175908[_0x674d('0xb')][_0x674d('0xd')]);return _0x4d37f7(_0x175908['error'][_0x674d('0xd')]);}else{logger[_0x674d('0x7')]('ChatOfflineMessage,\x20%s,\x20%s',_0x343348,_0x674d('0xe'));_0x4d37f7(_0x175908[_0x674d('0xf')][_0x674d('0xd')]);}})[_0x674d('0x10')](function(_0x21a369){logger[_0x674d('0xb')](_0x674d('0x8'),_0x343348,_0x21a369);_0x58c3ec(_0x21a369);});});} \ No newline at end of file +var _0x2809=['../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x36ded5,_0x4351bd){var _0x582ca6=function(_0x538838){while(--_0x538838){_0x36ded5['push'](_0x36ded5['shift']());}};_0x582ca6(++_0x4351bd);}(_0x2809,0x190));var _0x9280=function(_0x9aad68,_0x45377){_0x9aad68=_0x9aad68-0x0;var _0x281340=_0x2809[_0x9aad68];return _0x281340;};'use strict';var _=require(_0x9280('0x0'));var util=require(_0x9280('0x1'));var moment=require(_0x9280('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9280('0x3'));var db=require(_0x9280('0x4'))['db'];var utils=require(_0x9280('0x5'));var logger=require(_0x9280('0x6'))(_0x9280('0x7'));var config=require(_0x9280('0x8'));var jayson=require(_0x9280('0x9'));var client=jayson[_0x9280('0xa')][_0x9280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188f08,_0x22c1ac,_0x2d2345){return new BPromise(function(_0x5af08e,_0x86f0bc){return client[_0x9280('0xc')](_0x188f08,_0x2d2345)[_0x9280('0xd')](function(_0x45dd4e){logger[_0x9280('0xe')](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));logger[_0x9280('0x11')](_0x9280('0x12'),_0x22c1ac,_0x9280('0x10'),JSON[_0x9280('0x13')](_0x45dd4e));if(_0x45dd4e[_0x9280('0x14')]){if(_0x45dd4e[_0x9280('0x14')]['code']===0x1f4){logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x86f0bc(_0x45dd4e[_0x9280('0x14')]['message']);}logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x5af08e(_0x45dd4e[_0x9280('0x14')][_0x9280('0x15')]);}else{logger['info'](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));_0x5af08e(_0x45dd4e[_0x9280('0x16')][_0x9280('0x15')]);}})[_0x9280('0x17')](function(_0x1cb4cd){logger['error'](_0x9280('0xf'),_0x22c1ac,_0x1cb4cd);_0x86f0bc(_0x1cb4cd);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 179a28b..b64e104 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 _0x6f21=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','put','destroy','exports','util','connect-timeout'];(function(_0x22b06a,_0x50da1f){var _0x46e0ac=function(_0xcff734){while(--_0xcff734){_0x22b06a['push'](_0x22b06a['shift']());}};_0x46e0ac(++_0x50da1f);}(_0x6f21,0xfa));var _0x16f2=function(_0x517db2,_0x22e5f6){_0x517db2=_0x517db2-0x0;var _0x636271=_0x6f21[_0x517db2];return _0x636271;};'use strict';var multer=require('multer');var util=require(_0x16f2('0x0'));var path=require('path');var timeout=require(_0x16f2('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x16f2('0x2'));var interaction=require(_0x16f2('0x3'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0x16f2('0x4')]('/',auth[_0x16f2('0x5')](),controller['index']);router[_0x16f2('0x4')]('/describe',auth[_0x16f2('0x5')](),controller[_0x16f2('0x6')]);router[_0x16f2('0x4')](_0x16f2('0x7'),auth[_0x16f2('0x5')](),controller[_0x16f2('0x8')]);router['post']('/',auth[_0x16f2('0x5')](),controller['create']);router[_0x16f2('0x9')](_0x16f2('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x16f2('0x7'),auth[_0x16f2('0x5')](),controller[_0x16f2('0xa')]);module[_0x16f2('0xb')]=router; \ No newline at end of file +var _0x14c4=['isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x207aa7,_0x191d10){var _0x2617b4=function(_0x4e70e7){while(--_0x4e70e7){_0x207aa7['push'](_0x207aa7['shift']());}};_0x2617b4(++_0x191d10);}(_0x14c4,0x9d));var _0x414c=function(_0x1c0e91,_0xd8625e){_0x1c0e91=_0x1c0e91-0x0;var _0x34322c=_0x14c4[_0x1c0e91];return _0x34322c;};'use strict';var multer=require(_0x414c('0x0'));var util=require(_0x414c('0x1'));var path=require(_0x414c('0x2'));var timeout=require('connect-timeout');var express=require(_0x414c('0x3'));var router=express[_0x414c('0x4')]();var fs_extra=require(_0x414c('0x5'));var auth=require(_0x414c('0x6'));var interaction=require(_0x414c('0x7'));var config=require(_0x414c('0x8'));var controller=require(_0x414c('0x9'));router[_0x414c('0xa')]('/',auth[_0x414c('0xb')](),controller[_0x414c('0xc')]);router[_0x414c('0xa')](_0x414c('0xd'),auth[_0x414c('0xb')](),controller[_0x414c('0xe')]);router[_0x414c('0xa')](_0x414c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x414c('0x10')]('/',auth[_0x414c('0xb')](),controller['create']);router[_0x414c('0x11')](_0x414c('0xf'),auth[_0x414c('0xb')](),controller['update']);router[_0x414c('0x12')](_0x414c('0xf'),auth['isAuthenticated'](),controller[_0x414c('0x13')]);module[_0x414c('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c0bda41..dc3e059 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 _0x2616=['sequelize','exports','mouseOver'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2616,0xcf));var _0x6261=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x2616[_0x54b283];return _0x2462b3;};'use strict';var Sequelize=require(_0x6261('0x0'));module[_0x6261('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6261('0x2'),'timeout'),'defaultValue':_0x6261('0x2')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x870e=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x3f6cc0,_0x432b00){var _0xfc7086=function(_0x34f4af){while(--_0x34f4af){_0x3f6cc0['push'](_0x3f6cc0['shift']());}};_0xfc7086(++_0x432b00);}(_0x870e,0x17a));var _0xe870=function(_0x5d3f47,_0x1bce6f){_0x5d3f47=_0x5d3f47-0x0;var _0x3628e7=_0x870e[_0x5d3f47];return _0x3628e7;};'use strict';var Sequelize=require(_0xe870('0x0'));module[_0xe870('0x1')]={'name':{'type':Sequelize[_0xe870('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe870('0x3'),_0xe870('0x4')),'defaultValue':_0xe870('0x3')},'selector':{'type':Sequelize[_0xe870('0x2')]},'timeout':{'type':Sequelize[_0xe870('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 4a594f7..faa1079 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 _0xeea0=['error','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','undefined','count','limit','status','Content-Range','json','apply','reject','then','destroy','end'];(function(_0x4bd124,_0x49e42e){var _0xc072b8=function(_0x3a2331){while(--_0x3a2331){_0x4bd124['push'](_0x4bd124['shift']());}};_0xc072b8(++_0x49e42e);}(_0xeea0,0x91));var _0x0eea=function(_0x46ccc7,_0x3af10f){_0x46ccc7=_0x46ccc7-0x0;var _0x12cf2b=_0xeea0[_0x46ccc7];return _0x12cf2b;};'use strict';var emlformat=require(_0x0eea('0x0'));var rimraf=require(_0x0eea('0x1'));var zipdir=require(_0x0eea('0x2'));var jsonpatch=require(_0x0eea('0x3'));var rp=require(_0x0eea('0x4'));var moment=require('moment');var BPromise=require(_0x0eea('0x5'));var Mustache=require(_0x0eea('0x6'));var util=require(_0x0eea('0x7'));var path=require(_0x0eea('0x8'));var sox=require(_0x0eea('0x9'));var csv=require(_0x0eea('0xa'));var ejs=require(_0x0eea('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eea('0xc'));var squel=require(_0x0eea('0xd'));var crypto=require(_0x0eea('0xe'));var jsforce=require(_0x0eea('0xf'));var deskjs=require(_0x0eea('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0eea('0x11'));var Papa=require(_0x0eea('0x12'));var Redis=require(_0x0eea('0x13'));var authService=require(_0x0eea('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0eea('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0eea('0x16'));var config=require(_0x0eea('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0eea('0x18'))['db'];function respondWithStatusCode(_0x560d03,_0xd28ad5){_0xd28ad5=_0xd28ad5||0xcc;return function(_0x5e99b7){if(_0x5e99b7){return _0x560d03[_0x0eea('0x19')](_0xd28ad5);}return _0x560d03['status'](_0xd28ad5)['end']();};}function respondWithResult(_0xd9993f,_0xdf39bd){_0xdf39bd=_0xdf39bd||0xc8;return function(_0x5f2d5c){if(_0x5f2d5c){return _0xd9993f['status'](_0xdf39bd)['json'](_0x5f2d5c);}};}function respondWithFilteredResult(_0x174f0c,_0x1f5fbc){return function(_0x2aa745){if(_0x2aa745){var _0x2255ed=typeof _0x1f5fbc[_0x0eea('0x1a')]===_0x0eea('0x1b')&&typeof _0x1f5fbc['limit']===_0x0eea('0x1b');var _0x3a26cb=_0x2aa745[_0x0eea('0x1c')];var _0x108416=_0x2255ed?0x0:_0x1f5fbc['offset'];var _0x2c05e8=_0x2255ed?_0x2aa745[_0x0eea('0x1c')]:_0x1f5fbc[_0x0eea('0x1a')]+_0x1f5fbc[_0x0eea('0x1d')];var _0x515af2;if(_0x2c05e8>=_0x3a26cb){_0x2c05e8=_0x3a26cb;_0x515af2=0xc8;}else{_0x515af2=0xce;}_0x174f0c[_0x0eea('0x1e')](_0x515af2);return _0x174f0c['set'](_0x0eea('0x1f'),_0x108416+'-'+_0x2c05e8+'/'+_0x3a26cb)[_0x0eea('0x20')](_0x2aa745);}return null;};}function patchUpdates(_0x57f7ec){return function(_0x36e670){try{jsonpatch[_0x0eea('0x21')](_0x36e670,_0x57f7ec,!![]);}catch(_0x277e48){return BPromise[_0x0eea('0x22')](_0x277e48);}return _0x36e670['save']();};}function saveUpdates(_0x36fe84,_0x578576){return function(_0x3b1856){if(_0x3b1856){return _0x3b1856['update'](_0x36fe84)[_0x0eea('0x23')](function(_0xb9cf20){return _0xb9cf20;});}return null;};}function removeEntity(_0x2e2a7b,_0x5af003){return function(_0x4fd7f7){if(_0x4fd7f7){return _0x4fd7f7[_0x0eea('0x24')]()[_0x0eea('0x23')](function(){_0x2e2a7b[_0x0eea('0x1e')](0xcc)[_0x0eea('0x25')]();});}};}function handleEntityNotFound(_0x527ce6,_0x5f79c5){return function(_0x364bb8){if(!_0x364bb8){_0x527ce6[_0x0eea('0x19')](0x194);}return _0x364bb8;};}function handleError(_0x14e831,_0x124058){_0x124058=_0x124058||0x1f4;return function(_0x22db32){logger[_0x0eea('0x26')](_0x22db32[_0x0eea('0x27')]);if(_0x22db32[_0x0eea('0x28')]){delete _0x22db32[_0x0eea('0x28')];}_0x14e831[_0x0eea('0x1e')](_0x124058)[_0x0eea('0x29')](_0x22db32);};}exports[_0x0eea('0x2a')]=function(_0xb30d46,_0x134ead){var _0x15269c={'raw':!![],'where':{'id':_0xb30d46['params']['id']}},_0x1c8d8d={};_0x1c8d8d[_0x0eea('0x2b')]=_[_0x0eea('0x2c')](db[_0x0eea('0x2d')][_0x0eea('0x2e')]);_0x1c8d8d[_0x0eea('0x2f')]=_[_0x0eea('0x2c')](_0xb30d46[_0x0eea('0x2f')]);_0x1c8d8d[_0x0eea('0x30')]=_['intersection'](_0x1c8d8d['model'],_0x1c8d8d[_0x0eea('0x2f')]);_0x15269c[_0x0eea('0x31')]=_[_0x0eea('0x32')](_0x1c8d8d[_0x0eea('0x2b')],qs[_0x0eea('0x33')](_0xb30d46['query']['fields']));_0x15269c['attributes']=_0x15269c[_0x0eea('0x31')]['length']?_0x15269c[_0x0eea('0x31')]:_0x1c8d8d['model'];if(_0xb30d46['query'][_0x0eea('0x34')]){_0x15269c[_0x0eea('0x35')]=[{'all':!![]}];}_0x15269c=_[_0x0eea('0x36')]({},_0x15269c,_0xb30d46[_0x0eea('0x37')]);return db['ChatProactiveAction'][_0x0eea('0x38')](_0x15269c)[_0x0eea('0x23')](handleEntityNotFound(_0x134ead,null))[_0x0eea('0x23')](respondWithResult(_0x134ead,null))[_0x0eea('0x39')](handleError(_0x134ead,null));};exports[_0x0eea('0x3a')]=function(_0x288b06,_0x300876){return db[_0x0eea('0x2d')][_0x0eea('0x3a')](_0x288b06[_0x0eea('0x3b')],{})['then'](respondWithResult(_0x300876,0xc9))['catch'](handleError(_0x300876,null));};exports['update']=function(_0xc7d3ed,_0x1a2dd4){if(_0xc7d3ed[_0x0eea('0x3b')]['id']){delete _0xc7d3ed[_0x0eea('0x3b')]['id'];}return db[_0x0eea('0x2d')]['find']({'where':{'id':_0xc7d3ed[_0x0eea('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1a2dd4,null))[_0x0eea('0x23')](saveUpdates(_0xc7d3ed['body'],null))['then'](respondWithResult(_0x1a2dd4,null))[_0x0eea('0x39')](handleError(_0x1a2dd4,null));};exports[_0x0eea('0x24')]=function(_0x18fa0a,_0x46d777){return db[_0x0eea('0x2d')][_0x0eea('0x38')]({'where':{'id':_0x18fa0a[_0x0eea('0x3c')]['id']}})['then'](handleEntityNotFound(_0x46d777,null))[_0x0eea('0x23')](removeEntity(_0x46d777,null))[_0x0eea('0x39')](handleError(_0x46d777,null));}; \ No newline at end of file +var _0x1c88=['filters','model','attributes','intersection','fields','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1c88,0x1a9));var _0x81c8=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x1c88[_0x52e68e];return _0x3211a4;};'use strict';var emlformat=require(_0x81c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81c8('0x1'));var jsonpatch=require(_0x81c8('0x2'));var rp=require(_0x81c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81c8('0x4'));var util=require(_0x81c8('0x5'));var path=require(_0x81c8('0x6'));var sox=require(_0x81c8('0x7'));var csv=require(_0x81c8('0x8'));var ejs=require(_0x81c8('0x9'));var fs=require('fs');var fs_extra=require(_0x81c8('0xa'));var _=require(_0x81c8('0xb'));var squel=require(_0x81c8('0xc'));var crypto=require(_0x81c8('0xd'));var jsforce=require(_0x81c8('0xe'));var deskjs=require(_0x81c8('0xf'));var toCsv=require(_0x81c8('0x8'));var querystring=require('querystring');var Papa=require(_0x81c8('0x10'));var Redis=require(_0x81c8('0x11'));var authService=require(_0x81c8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81c8('0x13'));var logger=require(_0x81c8('0x14'))(_0x81c8('0x15'));var utils=require('../../config/utils');var config=require(_0x81c8('0x16'));var licenseUtil=require(_0x81c8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40061f,_0x1d0a15){_0x1d0a15=_0x1d0a15||0xcc;return function(_0x1d71f3){if(_0x1d71f3){return _0x40061f[_0x81c8('0x18')](_0x1d0a15);}return _0x40061f['status'](_0x1d0a15)[_0x81c8('0x19')]();};}function respondWithResult(_0x28b41f,_0x147d9e){_0x147d9e=_0x147d9e||0xc8;return function(_0x5e9a80){if(_0x5e9a80){return _0x28b41f[_0x81c8('0x1a')](_0x147d9e)[_0x81c8('0x1b')](_0x5e9a80);}};}function respondWithFilteredResult(_0x136cde,_0x55d438){return function(_0x10732c){if(_0x10732c){var _0x43a548=typeof _0x55d438[_0x81c8('0x1c')]===_0x81c8('0x1d')&&typeof _0x55d438[_0x81c8('0x1e')]==='undefined';var _0x3f7bf3=_0x10732c[_0x81c8('0x1f')];var _0x573a83=_0x43a548?0x0:_0x55d438[_0x81c8('0x1c')];var _0x1b74d1=_0x43a548?_0x10732c[_0x81c8('0x1f')]:_0x55d438[_0x81c8('0x1c')]+_0x55d438[_0x81c8('0x1e')];var _0x330ef2;if(_0x1b74d1>=_0x3f7bf3){_0x1b74d1=_0x3f7bf3;_0x330ef2=0xc8;}else{_0x330ef2=0xce;}_0x136cde[_0x81c8('0x1a')](_0x330ef2);return _0x136cde[_0x81c8('0x20')](_0x81c8('0x21'),_0x573a83+'-'+_0x1b74d1+'/'+_0x3f7bf3)['json'](_0x10732c);}return null;};}function patchUpdates(_0x2af7b6){return function(_0x5662c7){try{jsonpatch['apply'](_0x5662c7,_0x2af7b6,!![]);}catch(_0x5821d4){return BPromise['reject'](_0x5821d4);}return _0x5662c7[_0x81c8('0x22')]();};}function saveUpdates(_0x513d85,_0x147382){return function(_0x42fb26){if(_0x42fb26){return _0x42fb26[_0x81c8('0x23')](_0x513d85)[_0x81c8('0x24')](function(_0xcccbc){return _0xcccbc;});}return null;};}function removeEntity(_0x32c98a,_0x43d9f2){return function(_0x24674b){if(_0x24674b){return _0x24674b[_0x81c8('0x25')]()[_0x81c8('0x24')](function(){_0x32c98a[_0x81c8('0x1a')](0xcc)[_0x81c8('0x19')]();});}};}function handleEntityNotFound(_0x490d58,_0x52ff11){return function(_0xb71afc){if(!_0xb71afc){_0x490d58[_0x81c8('0x18')](0x194);}return _0xb71afc;};}function handleError(_0x3f06e7,_0x2174f2){_0x2174f2=_0x2174f2||0x1f4;return function(_0x5ac31d){logger[_0x81c8('0x26')](_0x5ac31d['stack']);if(_0x5ac31d[_0x81c8('0x27')]){delete _0x5ac31d[_0x81c8('0x27')];}_0x3f06e7[_0x81c8('0x1a')](_0x2174f2)[_0x81c8('0x28')](_0x5ac31d);};}exports[_0x81c8('0x29')]=function(_0x3ac0e4,_0xbe3e16){var _0xd4514={'raw':!![],'where':{'id':_0x3ac0e4[_0x81c8('0x2a')]['id']}},_0x5a2929={};_0x5a2929['model']=_[_0x81c8('0x2b')](db[_0x81c8('0x2c')][_0x81c8('0x2d')]);_0x5a2929[_0x81c8('0x2e')]=_[_0x81c8('0x2b')](_0x3ac0e4[_0x81c8('0x2e')]);_0x5a2929[_0x81c8('0x2f')]=_['intersection'](_0x5a2929[_0x81c8('0x30')],_0x5a2929['query']);_0xd4514[_0x81c8('0x31')]=_[_0x81c8('0x32')](_0x5a2929[_0x81c8('0x30')],qs['fields'](_0x3ac0e4[_0x81c8('0x2e')][_0x81c8('0x33')]));_0xd4514['attributes']=_0xd4514[_0x81c8('0x31')]['length']?_0xd4514[_0x81c8('0x31')]:_0x5a2929['model'];if(_0x3ac0e4[_0x81c8('0x2e')]['includeAll']){_0xd4514[_0x81c8('0x34')]=[{'all':!![]}];}_0xd4514=_[_0x81c8('0x35')]({},_0xd4514,_0x3ac0e4[_0x81c8('0x36')]);return db[_0x81c8('0x2c')][_0x81c8('0x37')](_0xd4514)[_0x81c8('0x24')](handleEntityNotFound(_0xbe3e16,null))[_0x81c8('0x24')](respondWithResult(_0xbe3e16,null))[_0x81c8('0x38')](handleError(_0xbe3e16,null));};exports['create']=function(_0x21584b,_0x599751){return db[_0x81c8('0x2c')][_0x81c8('0x39')](_0x21584b[_0x81c8('0x3a')],{})[_0x81c8('0x24')](respondWithResult(_0x599751,0xc9))[_0x81c8('0x38')](handleError(_0x599751,null));};exports['update']=function(_0x3b6eda,_0x5f5c42){if(_0x3b6eda[_0x81c8('0x3a')]['id']){delete _0x3b6eda[_0x81c8('0x3a')]['id'];}return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x3b6eda[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x5f5c42,null))['then'](saveUpdates(_0x3b6eda[_0x81c8('0x3a')],null))[_0x81c8('0x24')](respondWithResult(_0x5f5c42,null))[_0x81c8('0x38')](handleError(_0x5f5c42,null));};exports[_0x81c8('0x25')]=function(_0x2e27ad,_0x1cd895){return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x2e27ad[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x1cd895,null))['then'](removeEntity(_0x1cd895,null))[_0x81c8('0x38')](handleError(_0x1cd895,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c160328..b3aa3f1 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 _0x9430=['path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0xf77a53,_0x22522b){var _0x1fb79b=function(_0x7e2283){while(--_0x7e2283){_0xf77a53['push'](_0xf77a53['shift']());}};_0x1fb79b(++_0x22522b);}(_0x9430,0xe3));var _0x0943=function(_0x300afe,_0x55a3fc){_0x300afe=_0x300afe-0x0;var _0x1d6cb6=_0x9430[_0x300afe];return _0x1d6cb6;};'use strict';var _=require(_0x0943('0x0'));var util=require('util');var logger=require(_0x0943('0x1'))(_0x0943('0x2'));var moment=require(_0x0943('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0943('0x4'));var rimraf=require(_0x0943('0x5'));var config=require(_0x0943('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x0943('0x7')]=function(_0x331337,_0x1d146b){return _0x331337[_0x0943('0x8')](_0x0943('0x9'),attributes,{'tableName':_0x0943('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8b6=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe8b6,0x98));var _0x6e8b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe8b6[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6e8b('0x0'));var util=require('util');var logger=require(_0x6e8b('0x1'))(_0x6e8b('0x2'));var moment=require(_0x6e8b('0x3'));var BPromise=require(_0x6e8b('0x4'));var rp=require(_0x6e8b('0x5'));var fs=require('fs');var path=require(_0x6e8b('0x6'));var rimraf=require(_0x6e8b('0x7'));var config=require(_0x6e8b('0x8'));var attributes=require(_0x6e8b('0x9'));module[_0x6e8b('0xa')]=function(_0x59ec43,_0x2bce18){return _0x59ec43[_0x6e8b('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x6e8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index d33420b..a2147bf 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 _0x8671=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x2ef9c3,_0x3c1f07){var _0x816f73=function(_0x12e513){while(--_0x12e513){_0x2ef9c3['push'](_0x2ef9c3['shift']());}};_0x816f73(++_0x3c1f07);}(_0x8671,0x131));var _0x1867=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x8671[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x1867('0x0'));var util=require(_0x1867('0x1'));var moment=require(_0x1867('0x2'));var BPromise=require(_0x1867('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1867('0x4'));var db=require(_0x1867('0x5'))['db'];var utils=require(_0x1867('0x6'));var logger=require(_0x1867('0x7'))(_0x1867('0x8'));var config=require('../../config/environment');var jayson=require(_0x1867('0x9'));var client=jayson[_0x1867('0xa')][_0x1867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc3a57e,_0x37925f,_0x4f2842){return new BPromise(function(_0x126339,_0x3c9566){return client[_0x1867('0xc')](_0xc3a57e,_0x4f2842)[_0x1867('0xd')](function(_0x23e026){logger[_0x1867('0xe')](_0x1867('0xf'),_0x37925f,_0x1867('0x10'));logger['debug'](_0x1867('0x11'),_0x37925f,'request\x20sent',JSON['stringify'](_0x23e026));if(_0x23e026[_0x1867('0x12')]){if(_0x23e026['error'][_0x1867('0x13')]===0x1f4){logger[_0x1867('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x37925f,_0x23e026['error']['message']);return _0x3c9566(_0x23e026[_0x1867('0x12')][_0x1867('0x14')]);}logger[_0x1867('0x12')](_0x1867('0xf'),_0x37925f,_0x23e026[_0x1867('0x12')][_0x1867('0x14')]);return _0x126339(_0x23e026[_0x1867('0x12')][_0x1867('0x14')]);}else{logger['info'](_0x1867('0xf'),_0x37925f,_0x1867('0x10'));_0x126339(_0x23e026[_0x1867('0x15')][_0x1867('0x14')]);}})[_0x1867('0x16')](function(_0x2b8849){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x37925f,_0x2b8849);_0x3c9566(_0x2b8849);});});} \ No newline at end of file +var _0xc3d1=['moment','bluebird','randomstring','ioredis','rpc','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x329e45,_0x2a09db){var _0x25c632=function(_0x257b65){while(--_0x257b65){_0x329e45['push'](_0x329e45['shift']());}};_0x25c632(++_0x2a09db);}(_0xc3d1,0xbd));var _0x1c3d=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0xc3d1[_0x57746e];return _0x5caeaa;};'use strict';var _=require(_0x1c3d('0x0'));var util=require('util');var moment=require(_0x1c3d('0x1'));var BPromise=require(_0x1c3d('0x2'));var rs=require(_0x1c3d('0x3'));var fs=require('fs');var Redis=require(_0x1c3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c3d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c3d('0x6')][_0x1c3d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c0d41,_0x4fbabd,_0x19440e){return new BPromise(function(_0x598dd1,_0x31041f){return client[_0x1c3d('0x8')](_0x3c0d41,_0x19440e)[_0x1c3d('0x9')](function(_0x498c38){logger['info'](_0x1c3d('0xa'),_0x4fbabd,'request\x20sent');logger[_0x1c3d('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4fbabd,'request\x20sent',JSON[_0x1c3d('0xc')](_0x498c38));if(_0x498c38[_0x1c3d('0xd')]){if(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xe')]===0x1f4){logger[_0x1c3d('0xd')](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x31041f(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xf')]);}logger['error'](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x598dd1(_0x498c38['error'][_0x1c3d('0xf')]);}else{logger['info'](_0x1c3d('0xa'),_0x4fbabd,_0x1c3d('0x10'));_0x598dd1(_0x498c38[_0x1c3d('0x11')][_0x1c3d('0xf')]);}})[_0x1c3d('0x12')](function(_0x3ce38e){logger[_0x1c3d('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fbabd,_0x3ce38e);_0x31041f(_0x3ce38e);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 7d8747e..76e830b 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 _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x164f82,_0xcf43b1){var _0x28e375=function(_0x2a920e){while(--_0x2a920e){_0x164f82['push'](_0x164f82['shift']());}};_0x28e375(++_0xcf43b1);}(_0x53ec,0x192));var _0xc53e=function(_0x2f8512,_0x271ada){_0x2f8512=_0x2f8512-0x0;var _0x53374e=_0x53ec[_0x2f8512];return _0x53374e;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x1b8f36,_0x5ce399){var _0x4ff650=function(_0xc87da0){while(--_0xc87da0){_0x1b8f36['push'](_0x1b8f36['shift']());}};_0x4ff650(++_0x5ce399);}(_0x33c5,0xe6));var _0x533c=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x33c5[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 9a359e4..ff388d2 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 _0xb90b=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x553c2a,_0x592c23){var _0x37988b=function(_0x5ccdf1){while(--_0x5ccdf1){_0x553c2a['push'](_0x553c2a['shift']());}};_0x37988b(++_0x592c23);}(_0xb90b,0x11c));var _0xbb90=function(_0xd19698,_0x369612){_0xd19698=_0xd19698-0x0;var _0x5950e7=_0xb90b[_0xd19698];return _0x5950e7;};'use strict';var Sequelize=require(_0xbb90('0x0'));module[_0xbb90('0x1')]={'name':{'type':Sequelize[_0xbb90('0x2')],'unique':_0xbb90('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbb90('0x2')]},'timeout':{'type':Sequelize[_0xbb90('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbb90('0x5')](_0xbb90('0x6'),_0xbb90('0x7'),_0xbb90('0x8'))}}; \ No newline at end of file +var _0xb970=['STRING','name','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xb970,0x99));var _0x0b97=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xb970[_0x454018];return _0x24697d;};'use strict';var Sequelize=require('sequelize');module[_0x0b97('0x0')]={'name':{'type':Sequelize[_0x0b97('0x1')],'unique':_0x0b97('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0b97('0x1')]},'timeout':{'type':Sequelize[_0x0b97('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b97('0x4')]('rrmemory',_0x0b97('0x5'),_0x0b97('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 3f2a632..dabeb90 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 _0xadfa=['status','json','limit','undefined','count','offset','set','Content-Range','update','then','ChatQueues','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','describe','getMembers','UserChatQueue','order','sort','ChatQueueId','filter','findAll','User','findAndCountAll','agent','updatedAt','createdAt','SIP','chatPause','getTeams','Team','pick','hasOwnProperty','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','all','union','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','isArray','getAgents','findOne','nolimit','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','socket.io-emitter','register','end'];(function(_0x483545,_0x37b37a){var _0xde7c23=function(_0x1fb7b0){while(--_0x1fb7b0){_0x483545['push'](_0x483545['shift']());}};_0xde7c23(++_0x37b37a);}(_0xadfa,0x1cd));var _0xaadf=function(_0x1bf303,_0x94963){_0x1bf303=_0x1bf303-0x0;var _0x41af3b=_0xadfa[_0x1bf303];return _0x41af3b;};'use strict';var BPromise=require(_0xaadf('0x0'));var util=require('util');var _=require(_0xaadf('0x1'));var squel=require('squel');var Redis=require(_0xaadf('0x2'));var qs=require(_0xaadf('0x3'));var logger=require(_0xaadf('0x4'))('api');var config=require(_0xaadf('0x5'));var db=require(_0xaadf('0x6'))['db'];config['redis']=_[_0xaadf('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaadf('0x8'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xaadf('0x9')](socket);function respondWithStatusCode(_0x404085,_0x4afddc){_0x4afddc=_0x4afddc||0xcc;return function(_0x6abf62){if(_0x6abf62){return _0x404085['sendStatus'](_0x4afddc);}return _0x404085['status'](_0x4afddc)[_0xaadf('0xa')]();};}function respondWithResult(_0x2eb09e,_0x1965a9){_0x1965a9=_0x1965a9||0xc8;return function(_0x5952e2){if(_0x5952e2){return _0x2eb09e[_0xaadf('0xb')](_0x1965a9)[_0xaadf('0xc')](_0x5952e2);}};}function respondWithFilteredResult(_0x325521,_0x5a2c3a){return function(_0x3ef6de){if(_0x3ef6de){var _0x66fd74=typeof _0x5a2c3a['offset']==='undefined'&&typeof _0x5a2c3a[_0xaadf('0xd')]===_0xaadf('0xe');var _0x4a6ee1=_0x3ef6de[_0xaadf('0xf')];var _0x2fd0cc=_0x66fd74?0x0:_0x5a2c3a[_0xaadf('0x10')];var _0x23c153=_0x66fd74?_0x3ef6de[_0xaadf('0xf')]:_0x5a2c3a[_0xaadf('0x10')]+_0x5a2c3a[_0xaadf('0xd')];var _0x55dbae;if(_0x23c153>=_0x4a6ee1){_0x23c153=_0x4a6ee1;_0x55dbae=0xc8;}else{_0x55dbae=0xce;}_0x325521[_0xaadf('0xb')](_0x55dbae);return _0x325521[_0xaadf('0x11')](_0xaadf('0x12'),_0x2fd0cc+'-'+_0x23c153+'/'+_0x4a6ee1)[_0xaadf('0xc')](_0x3ef6de);}return null;};}function saveUpdates(_0x5e9505){return function(_0xb3485d){if(_0xb3485d){return _0xb3485d[_0xaadf('0x13')](_0x5e9505)[_0xaadf('0x14')](function(_0x11ec48){return _0x11ec48;});}return null;};}function removeEntity(_0x22676d){return function(_0x26f3bb){if(_0x26f3bb){return _0x26f3bb['destroy']()[_0xaadf('0x14')](function(){var _0x5de3b9=_0x26f3bb['get']({'plain':!![]});var _0x492a99=_0xaadf('0x15');return db[_0xaadf('0x16')][_0xaadf('0x17')]({'where':{'type':_0x492a99,'resourceId':_0x5de3b9['id']}})[_0xaadf('0x14')](function(){return _0x26f3bb;});})['then'](function(){_0x22676d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x325bc1){return function(_0x4532c3){if(!_0x4532c3){_0x325bc1[_0xaadf('0x18')](0x194);}return _0x4532c3;};}function handleError(_0x262e37,_0x198f94){_0x198f94=_0x198f94||0x1f4;return function(_0x1ab57a){logger['error'](_0x1ab57a[_0xaadf('0x19')]);if(_0x1ab57a[_0xaadf('0x1a')]){delete _0x1ab57a[_0xaadf('0x1a')];}_0x262e37[_0xaadf('0xb')](_0x198f94)[_0xaadf('0x1b')](_0x1ab57a);};}exports[_0xaadf('0x1c')]=function(_0x31f6dc,_0x5b712d){var _0xc83fc={};var _0xdede13={'count':0x0,'rows':[]};var _0x54a2bf=_[_0xaadf('0x1d')](db[_0xaadf('0x1e')][_0xaadf('0x1f')],function(_0x5df83a){return{'name':_0x5df83a[_0xaadf('0x20')],'type':_0x5df83a[_0xaadf('0x21')][_0xaadf('0x22')]};});_0xc83fc=qs[_0xaadf('0x23')](_0x54a2bf,_0x31f6dc);var _0x6aaf6e={'where':_0xc83fc[_0xaadf('0x24')]};return db[_0xaadf('0x1e')][_0xaadf('0xf')](_0x6aaf6e)[_0xaadf('0x14')](function(_0x25e594){_0xdede13[_0xaadf('0xf')]=_0x25e594;_0xc83fc[_0xaadf('0x25')]=qs['include'](_0x31f6dc[_0xaadf('0x26')]);return db[_0xaadf('0x1e')]['findAll'](_0xc83fc);})[_0xaadf('0x14')](function(_0x208b8d){_0xdede13[_0xaadf('0x27')]=_0x208b8d;return _0xdede13;})[_0xaadf('0x14')](respondWithFilteredResult(_0x5b712d,_0xc83fc))['catch'](handleError(_0x5b712d,null));};exports['show']=function(_0xa414c9,_0x52aa58){var _0x3f444e={'raw':!![],'where':{'id':_0xa414c9[_0xaadf('0x28')]['id']}},_0x4bbf60={};_0x4bbf60[_0xaadf('0x29')]=_['keys'](db['ChatQueue'][_0xaadf('0x1f')]);_0x4bbf60[_0xaadf('0x26')]=_[_0xaadf('0x2a')](_0xa414c9[_0xaadf('0x26')]);_0x4bbf60[_0xaadf('0x2b')]=_[_0xaadf('0x2c')](_0x4bbf60[_0xaadf('0x29')],_0x4bbf60['query']);_0x3f444e[_0xaadf('0x2d')]=_[_0xaadf('0x2c')](_0x4bbf60[_0xaadf('0x29')],qs[_0xaadf('0x2e')](_0xa414c9[_0xaadf('0x26')][_0xaadf('0x2e')]));_0x3f444e[_0xaadf('0x2d')]=_0x3f444e[_0xaadf('0x2d')][_0xaadf('0x2f')]?_0x3f444e[_0xaadf('0x2d')]:_0x4bbf60[_0xaadf('0x29')];if(_0xa414c9[_0xaadf('0x26')][_0xaadf('0x30')]){_0x3f444e[_0xaadf('0x25')]=[{'all':!![]}];}_0x3f444e=_[_0xaadf('0x31')]({},_0x3f444e,_0xa414c9[_0xaadf('0x32')]);return db['ChatQueue'][_0xaadf('0x33')](_0x3f444e)[_0xaadf('0x14')](handleEntityNotFound(_0x52aa58,null))[_0xaadf('0x14')](respondWithResult(_0x52aa58,null))[_0xaadf('0x34')](handleError(_0x52aa58,null));};exports[_0xaadf('0x35')]=function(_0x31b448,_0x19709e){return db[_0xaadf('0x1e')]['create'](_0x31b448[_0xaadf('0x36')],{})[_0xaadf('0x14')](function(_0x2b00da){var _0x40aa05=_0x31b448[_0xaadf('0x37')][_0xaadf('0x38')]({'plain':!![]});if(!_0x40aa05)throw new Error(_0xaadf('0x39'));if(_0x40aa05[_0xaadf('0x3a')]===_0xaadf('0x37')){var _0x5e0003=_0x2b00da['get']({'plain':!![]});var _0x3d1e84=_0xaadf('0x15');return db[_0xaadf('0x3b')][_0xaadf('0x33')]({'where':{'name':_0x3d1e84,'userProfileId':_0x40aa05[_0xaadf('0x3c')]},'raw':!![]})[_0xaadf('0x14')](function(_0x3fcd6a){if(_0x3fcd6a&&_0x3fcd6a['autoAssociation']===0x0){return db[_0xaadf('0x16')][_0xaadf('0x35')]({'name':_0x5e0003[_0xaadf('0x1a')],'resourceId':_0x5e0003['id'],'type':_0x3fcd6a[_0xaadf('0x1a')],'sectionId':_0x3fcd6a['id']},{})[_0xaadf('0x14')](function(){return _0x2b00da;});}else{return _0x2b00da;}})[_0xaadf('0x34')](function(_0x10585a){logger[_0xaadf('0x3d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10585a);throw _0x10585a;});}return _0x2b00da;})[_0xaadf('0x14')](respondWithResult(_0x19709e,0xc9))[_0xaadf('0x34')](handleError(_0x19709e,null));};exports[_0xaadf('0x13')]=function(_0x154c83,_0x201b22){if(_0x154c83[_0xaadf('0x36')]['id']){delete _0x154c83[_0xaadf('0x36')]['id'];}return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0x154c83[_0xaadf('0x28')]['id']}})['then'](handleEntityNotFound(_0x201b22,null))[_0xaadf('0x14')](saveUpdates(_0x154c83[_0xaadf('0x36')],null))[_0xaadf('0x14')](respondWithResult(_0x201b22,null))[_0xaadf('0x34')](handleError(_0x201b22,null));};exports['destroy']=function(_0x138e68,_0x4f0b78){return db['ChatQueue']['find']({'where':{'id':_0x138e68[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x4f0b78,null))['then'](removeEntity(_0x4f0b78,null))[_0xaadf('0x34')](handleError(_0x4f0b78,null));};exports[_0xaadf('0x3e')]=function(_0x2b0ae8,_0x2d672c){return db[_0xaadf('0x1e')][_0xaadf('0x3e')]()[_0xaadf('0x14')](respondWithResult(_0x2d672c,null))[_0xaadf('0x34')](handleError(_0x2d672c,null));};exports[_0xaadf('0x3f')]=function(_0x1a2419,_0x17219a){var _0x34811b={'raw':!![],'where':{}},_0x353e0f={},_0x49b5fe;return db[_0xaadf('0x1e')]['findOne']({'where':{'id':_0x1a2419[_0xaadf('0x28')]['id']}})['then'](handleEntityNotFound(_0x17219a,null))['then'](function(_0x2d970c){if(_0x2d970c){_0x49b5fe=_0x2d970c[_0xaadf('0x38')]({'plain':!![]});_0x353e0f[_0xaadf('0x29')]=_[_0xaadf('0x2a')](db[_0xaadf('0x40')][_0xaadf('0x1f')]);_0x353e0f[_0xaadf('0x26')]=_['keys'](_0x1a2419['query']);_0x353e0f[_0xaadf('0x2b')]=_[_0xaadf('0x2c')](_0x353e0f[_0xaadf('0x29')],_0x353e0f[_0xaadf('0x26')]);_0x34811b['attributes']=_[_0xaadf('0x2c')](_0x353e0f[_0xaadf('0x29')],qs['fields'](_0x1a2419[_0xaadf('0x26')][_0xaadf('0x2e')]));_0x34811b[_0xaadf('0x2d')]=_0x34811b[_0xaadf('0x2d')]['length']?_0x34811b[_0xaadf('0x2d')]:_0x353e0f[_0xaadf('0x29')];if(!_0x1a2419[_0xaadf('0x26')]['hasOwnProperty']('nolimit')){_0x34811b[_0xaadf('0xd')]=qs[_0xaadf('0xd')](_0x1a2419['query']['limit']);_0x34811b['offset']=qs[_0xaadf('0x10')](_0x1a2419[_0xaadf('0x26')]['offset']);}_0x34811b[_0xaadf('0x41')]=qs[_0xaadf('0x42')](_0x1a2419[_0xaadf('0x26')]['sort']);_0x34811b[_0xaadf('0x24')]=qs['filters'](_['pick'](_0x1a2419[_0xaadf('0x26')],_0x353e0f[_0xaadf('0x2b')]));_0x34811b['where'][_0xaadf('0x43')]=_0x2d970c['id'];if(_0x1a2419[_0xaadf('0x26')][_0xaadf('0x44')]){_0x34811b['where']=_[_0xaadf('0x31')](_0x34811b[_0xaadf('0x24')],{'$or':_[_0xaadf('0x1d')](_0x34811b['attributes'],function(_0x2d4cf0){var _0x5cd68a={};_0x5cd68a[_0x2d4cf0]={'$like':'%'+_0x1a2419[_0xaadf('0x26')]['filter']+'%'};return _0x5cd68a;})});}_0x34811b=_[_0xaadf('0x31')]({},_0x34811b,_0x1a2419[_0xaadf('0x32')]);return db['UserChatQueue'][_0xaadf('0x45')](_0x34811b);}})[_0xaadf('0x14')](function(_0x52e2d9){if(_0x52e2d9){return db[_0xaadf('0x46')][_0xaadf('0x47')]({'where':{'id':_[_0xaadf('0x1d')](_0x52e2d9,'UserId'),'role':_0xaadf('0x48')},'attributes':['id',_0xaadf('0x1a'),'chatPause',_0xaadf('0x49'),_0xaadf('0x4a')]});}})[_0xaadf('0x14')](function(_0x83f3db){if(_0x83f3db){return{'count':_0x83f3db[_0xaadf('0xf')],'rows':_[_0xaadf('0x1d')](_0x83f3db[_0xaadf('0x27')],function(_0x54afb0){return{'membername':_0x54afb0['name'],'UserId':_0x54afb0['id'],'queue_name':_0x49b5fe['name'],'ChatQueueId':_0x49b5fe['id'],'interface':util['format']('%s/%s',_0xaadf('0x4b'),_0x54afb0[_0xaadf('0x1a')]),'penalty':0x0,'paused':_0x54afb0[_0xaadf('0x4c')],'createdAt':_0x54afb0[_0xaadf('0x4a')],'updatedAt':_0x54afb0[_0xaadf('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x17219a,_0x34811b))['catch'](handleError(_0x17219a,null));};exports[_0xaadf('0x4d')]=function(_0x42f55c,_0x124db0){var _0x3814dc={};var _0x1da2a9={};var _0x53fd76;var _0x1d88ef;return db['ChatQueue']['findOne']({'where':{'id':_0x42f55c[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x124db0,null))[_0xaadf('0x14')](function(_0x26184d){if(_0x26184d){_0x53fd76=_0x26184d;_0x1da2a9['model']=_[_0xaadf('0x2a')](db[_0xaadf('0x4e')][_0xaadf('0x1f')]);_0x1da2a9[_0xaadf('0x26')]=_[_0xaadf('0x2a')](_0x42f55c['query']);_0x1da2a9[_0xaadf('0x2b')]=_['intersection'](_0x1da2a9[_0xaadf('0x29')],_0x1da2a9[_0xaadf('0x26')]);_0x3814dc['attributes']=_[_0xaadf('0x2c')](_0x1da2a9['model'],qs[_0xaadf('0x2e')](_0x42f55c['query'][_0xaadf('0x2e')]));_0x3814dc[_0xaadf('0x2d')]=_0x3814dc[_0xaadf('0x2d')][_0xaadf('0x2f')]?_0x3814dc['attributes']:_0x1da2a9[_0xaadf('0x29')];_0x3814dc[_0xaadf('0x41')]=qs['sort'](_0x42f55c['query'][_0xaadf('0x42')]);_0x3814dc[_0xaadf('0x24')]=qs['filters'](_[_0xaadf('0x4f')](_0x42f55c[_0xaadf('0x26')],_0x1da2a9['filters']));if(_0x42f55c['query'][_0xaadf('0x44')]){_0x3814dc[_0xaadf('0x24')]=_[_0xaadf('0x31')](_0x3814dc['where'],{'$or':_[_0xaadf('0x1d')](_0x3814dc['attributes'],function(_0x58c24c){var _0x1e4107={};_0x1e4107[_0x58c24c]={'$like':'%'+_0x42f55c[_0xaadf('0x26')]['filter']+'%'};return _0x1e4107;})});}_0x3814dc=_['merge']({},_0x3814dc,_0x42f55c[_0xaadf('0x32')]);return _0x53fd76['getTeams'](_0x3814dc);}})['then'](function(_0x3f8b8f){if(_0x3f8b8f){_0x1d88ef=_0x3f8b8f[_0xaadf('0x2f')];if(!_0x42f55c[_0xaadf('0x26')][_0xaadf('0x50')]('nolimit')){_0x3814dc[_0xaadf('0xd')]=qs['limit'](_0x42f55c[_0xaadf('0x26')][_0xaadf('0xd')]);_0x3814dc['offset']=qs[_0xaadf('0x10')](_0x42f55c[_0xaadf('0x26')]['offset']);}return _0x53fd76[_0xaadf('0x4d')](_0x3814dc);}})['then'](function(_0xf13376){if(_0xf13376){return _0xf13376?{'count':_0x1d88ef,'rows':_0xf13376}:null;}})[_0xaadf('0x14')](respondWithResult(_0x124db0,null))[_0xaadf('0x34')](handleError(_0x124db0,null));};exports['addTeams']=function(_0x6c8976,_0x2d8b95){var _0x1c4970=_0x6c8976[_0xaadf('0x36')][_0xaadf('0x51')];return db[_0xaadf('0x4e')]['findAll']({'where':{'id':_0x1c4970},'attributes':['id'],'include':[{'model':db[_0xaadf('0x46')],'as':_0xaadf('0x52'),'attributes':['id',_0xaadf('0x1a'),_0xaadf('0x53'),_0xaadf('0x54'),_0xaadf('0x55')],'raw':!![]}]})['then'](function(_0x335ac5){if(_0x335ac5){var _0x5e343e=_[_0xaadf('0x56')](_0x335ac5,function(_0x321f89){var _0x29d138=_0x321f89[_0xaadf('0x38')]({'plain':!![]});return _0x29d138[_0xaadf('0x52')];});return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0x6c8976[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](function(_0x1be2cd){return db[_0xaadf('0x57')][_0xaadf('0x58')](function(_0x37ee55){return _0x1be2cd[_0xaadf('0x59')](_0x1c4970,{'transaction':_0x37ee55})['then'](function(){return BPromise['each'](_0x5e343e,function(_0x2b26df){return db[_0xaadf('0x40')][_0xaadf('0x5a')]({'where':{'UserId':_0x2b26df['id'],'ChatQueueId':_0x6c8976[_0xaadf('0x28')]['id']},'transaction':_0x37ee55});});})[_0xaadf('0x14')](function(){_0x5e343e['forEach'](function(_0x5bed3b){socket[_0xaadf('0x5b')](_0xaadf('0x5c'),{'UserId':_0x5bed3b['id'],'ChatQueueId':_0x1be2cd['id']});});});});});}})[_0xaadf('0x14')](respondWithStatusCode(_0x2d8b95,null))[_0xaadf('0x34')](handleError(_0x2d8b95,null));};exports[_0xaadf('0x5d')]=function(_0x5a9fd4,_0x3ccbc4){return db[_0xaadf('0x4e')][_0xaadf('0x45')]({'where':{'id':_0x5a9fd4[_0xaadf('0x26')][_0xaadf('0x51')]},'attributes':['id'],'include':[{'model':db[_0xaadf('0x46')],'as':_0xaadf('0x52'),'attributes':['id'],'raw':!![]}]})[_0xaadf('0x14')](handleEntityNotFound(_0x3ccbc4,null))[_0xaadf('0x14')](function(_0x2a332a){var _0x59d95b=_[_0xaadf('0x1d')](_0x2a332a,'id');var _0xb28c2c=[];var _0xc321ec=[];var _0x1679c4=squel[_0xaadf('0x5e')]();_0x1679c4['field'](_0xaadf('0x5f'))[_0xaadf('0x60')](_0xaadf('0x61'),'tq')[_0xaadf('0x62')]('user_has_teams','ut',_0xaadf('0x63'))[_0xaadf('0x24')](_0xaadf('0x64'),_0x5a9fd4[_0xaadf('0x28')]['id']);for(var _0x25863b=0x0;_0x25863b<_0x2a332a[_0xaadf('0x2f')];_0x25863b+=0x1){let _0x48bbb6=_0x2a332a[_0x25863b];for(var _0x3be26e=0x0;_0x3be26e<_0x48bbb6[_0xaadf('0x52')][_0xaadf('0x2f')];_0x3be26e+=0x1){let _0x2809aa=_0x48bbb6[_0xaadf('0x52')][_0x3be26e];var _0x4dd86d=_0x1679c4['clone']();_0x4dd86d['where'](_0xaadf('0x65'),_0x2809aa['id']);_0xc321ec['push'](db[_0xaadf('0x57')][_0xaadf('0x26')](_0x4dd86d[_0xaadf('0x66')](),{'type':db[_0xaadf('0x57')][_0xaadf('0x67')][_0xaadf('0x68')]})[_0xaadf('0x14')](function(_0x1f1efb){if(_0x1f1efb['length']===0x1){return _0x2809aa['id'];}else{var _0x7bee47=_['every'](_['map'](_0x1f1efb,'TeamId'),function(_0x3087b9){return _['includes'](_0x59d95b,_0x3087b9);});if(_0x7bee47){return _0x2809aa['id'];}}}));}}return BPromise[_0xaadf('0x69')](_0xc321ec)['then'](function(_0x2b00e5){_0xb28c2c=_(_0xb28c2c)[_0xaadf('0x6a')](_0x2b00e5)[_0xaadf('0x6b')]()[_0xaadf('0x6c')]();return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0x5a9fd4['params']['id']}})['then'](function(_0x18c545){return db[_0xaadf('0x57')]['transaction'](function(_0x381402){return _0x18c545['removeTeams'](_0x5a9fd4[_0xaadf('0x26')][_0xaadf('0x51')],{'transaction':_0x381402})[_0xaadf('0x14')](function(){if(!_['isEmpty'](_0xb28c2c)){return _0x18c545[_0xaadf('0x6d')](_0xb28c2c,{'transaction':_0x381402});}})['then'](function(){_0xb28c2c[_0xaadf('0x6e')](function(_0x49043e){socket[_0xaadf('0x5b')](_0xaadf('0x6f'),{'UserId':_0x49043e,'ChatQueueId':_0x18c545['id']});});});});});});})[_0xaadf('0x14')](respondWithStatusCode(_0x3ccbc4,null))['catch'](handleError(_0x3ccbc4,null));};exports[_0xaadf('0x70')]=function(_0xbaf086,_0x49b93c){return db[_0xaadf('0x1e')][_0xaadf('0x33')]({'where':{'id':_0xbaf086['params']['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x49b93c,null))[_0xaadf('0x14')](function(_0x4ced53){if(_0x4ced53){return _0x4ced53['addAgents'](_0xbaf086['body'][_0xaadf('0x51')],_[_0xaadf('0x71')](_0xbaf086[_0xaadf('0x36')],['ids','id'])||{})['spread'](function(_0xd418a3){for(var _0x43b93d=0x0;_0x43b93d<_0xbaf086[_0xaadf('0x36')][_0xaadf('0x51')]['length'];_0x43b93d+=0x1){socket[_0xaadf('0x5b')](_0xaadf('0x5c'),{'UserId':Number(_0xbaf086['body']['ids'][_0x43b93d]),'ChatQueueId':Number(_0xbaf086[_0xaadf('0x28')]['id'])});}return _0xd418a3;});}})[_0xaadf('0x14')](respondWithResult(_0x49b93c,null))[_0xaadf('0x34')](handleError(_0x49b93c,null));};exports['removeAgents']=function(_0x2c9c23,_0x26043c){return db['ChatQueue'][_0xaadf('0x33')]({'where':{'id':_0x2c9c23[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0x26043c,null))['then'](function(_0x5eeb76){if(_0x5eeb76){return _0x5eeb76[_0xaadf('0x6d')](_0x2c9c23['query'][_0xaadf('0x51')])['then'](function(){if(_[_0xaadf('0x72')](_0x2c9c23[_0xaadf('0x26')]['ids'])){for(var _0x455fd3=0x0;_0x455fd3<_0x2c9c23[_0xaadf('0x26')]['ids'][_0xaadf('0x2f')];_0x455fd3+=0x1){socket[_0xaadf('0x5b')]('userChatQueue:remove',{'UserId':Number(_0x2c9c23['query'][_0xaadf('0x51')][_0x455fd3]),'ChatQueueId':Number(_0x2c9c23[_0xaadf('0x28')]['id'])});}}else{socket[_0xaadf('0x5b')](_0xaadf('0x6f'),{'UserId':Number(_0x2c9c23['query']['ids']),'ChatQueueId':Number(_0x2c9c23[_0xaadf('0x28')]['id'])});}});}})[_0xaadf('0x14')](respondWithStatusCode(_0x26043c,null))['catch'](handleError(_0x26043c,null));};exports[_0xaadf('0x73')]=function(_0x3eba4a,_0xf4245c){var _0x4020e6={};var _0x46ae03={};var _0x1b16bc;var _0x4dcddb;return db[_0xaadf('0x1e')][_0xaadf('0x74')]({'where':{'id':_0x3eba4a[_0xaadf('0x28')]['id']}})[_0xaadf('0x14')](handleEntityNotFound(_0xf4245c,null))['then'](function(_0x17a49b){if(_0x17a49b){_0x1b16bc=_0x17a49b;_0x46ae03[_0xaadf('0x29')]=_[_0xaadf('0x2a')](db[_0xaadf('0x46')][_0xaadf('0x1f')]);_0x46ae03[_0xaadf('0x26')]=_[_0xaadf('0x2a')](_0x3eba4a[_0xaadf('0x26')]);_0x46ae03[_0xaadf('0x2b')]=_[_0xaadf('0x2c')](_0x46ae03[_0xaadf('0x29')],_0x46ae03['query']);_0x4020e6[_0xaadf('0x2d')]=_[_0xaadf('0x2c')](_0x46ae03[_0xaadf('0x29')],qs[_0xaadf('0x2e')](_0x3eba4a[_0xaadf('0x26')]['fields']));_0x4020e6[_0xaadf('0x2d')]=_0x4020e6[_0xaadf('0x2d')]['length']?_0x4020e6[_0xaadf('0x2d')]:_0x46ae03[_0xaadf('0x29')];_0x4020e6[_0xaadf('0x41')]=qs[_0xaadf('0x42')](_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x42')]);_0x4020e6[_0xaadf('0x24')]=qs[_0xaadf('0x2b')](_[_0xaadf('0x4f')](_0x3eba4a[_0xaadf('0x26')],_0x46ae03[_0xaadf('0x2b')]));if(_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x44')]){_0x4020e6[_0xaadf('0x24')]=_[_0xaadf('0x31')](_0x4020e6[_0xaadf('0x24')],{'$or':_['map'](_0x4020e6['attributes'],function(_0x5f2d02){var _0x20a5df={};_0x20a5df[_0x5f2d02]={'$like':'%'+_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x44')]+'%'};return _0x20a5df;})});}_0x4020e6=_['merge']({},_0x4020e6,_0x3eba4a[_0xaadf('0x32')]);return _0x1b16bc[_0xaadf('0x73')](_0x4020e6);}})[_0xaadf('0x14')](function(_0x3b6512){if(_0x3b6512){_0x4dcddb=_0x3b6512[_0xaadf('0x2f')];if(!_0x3eba4a[_0xaadf('0x26')][_0xaadf('0x50')](_0xaadf('0x75'))){_0x4020e6[_0xaadf('0xd')]=qs[_0xaadf('0xd')](_0x3eba4a[_0xaadf('0x26')][_0xaadf('0xd')]);_0x4020e6[_0xaadf('0x10')]=qs[_0xaadf('0x10')](_0x3eba4a['query']['offset']);}return _0x1b16bc[_0xaadf('0x73')](_0x4020e6);}})[_0xaadf('0x14')](function(_0x490686){if(_0x490686){return _0x490686?{'count':_0x4dcddb,'rows':_0x490686}:null;}})[_0xaadf('0x14')](respondWithResult(_0xf4245c,null))[_0xaadf('0x34')](handleError(_0xf4245c,null));}; \ No newline at end of file +var _0xa02d=['value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','order','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','limit','set','update','then','get','ChatQueues','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','ChatQueue','key','getOptions','where','query','findAll','rows','catch','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','merge','options','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId'];(function(_0x273cb0,_0xc7b288){var _0x50241a=function(_0x49b206){while(--_0x49b206){_0x273cb0['push'](_0x273cb0['shift']());}};_0x50241a(++_0xc7b288);}(_0xa02d,0x161));var _0xda02=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xa02d[_0x3f993e];return _0x39c135;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xda02('0x0'));var squel=require(_0xda02('0x1'));var Redis=require(_0xda02('0x2'));var qs=require(_0xda02('0x3'));var logger=require(_0xda02('0x4'))(_0xda02('0x5'));var config=require(_0xda02('0x6'));var db=require('../../mysqldb')['db'];config[_0xda02('0x7')]=_[_0xda02('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xda02('0x9'))(new Redis(config[_0xda02('0x7')]));require('./chatQueue.socket')[_0xda02('0xa')](socket);function respondWithStatusCode(_0x458752,_0x49de04){_0x49de04=_0x49de04||0xcc;return function(_0x3119d9){if(_0x3119d9){return _0x458752['sendStatus'](_0x49de04);}return _0x458752['status'](_0x49de04)[_0xda02('0xb')]();};}function respondWithResult(_0x4618a9,_0x353b43){_0x353b43=_0x353b43||0xc8;return function(_0x1ea9e0){if(_0x1ea9e0){return _0x4618a9[_0xda02('0xc')](_0x353b43)[_0xda02('0xd')](_0x1ea9e0);}};}function respondWithFilteredResult(_0x371a6e,_0x3c8b07){return function(_0x48c3d0){if(_0x48c3d0){var _0x40a1aa=typeof _0x3c8b07[_0xda02('0xe')]===_0xda02('0xf')&&typeof _0x3c8b07['limit']===_0xda02('0xf');var _0x2510ef=_0x48c3d0['count'];var _0x3eb5a9=_0x40a1aa?0x0:_0x3c8b07['offset'];var _0x1b01de=_0x40a1aa?_0x48c3d0[_0xda02('0x10')]:_0x3c8b07['offset']+_0x3c8b07[_0xda02('0x11')];var _0x29a5a9;if(_0x1b01de>=_0x2510ef){_0x1b01de=_0x2510ef;_0x29a5a9=0xc8;}else{_0x29a5a9=0xce;}_0x371a6e[_0xda02('0xc')](_0x29a5a9);return _0x371a6e[_0xda02('0x12')]('Content-Range',_0x3eb5a9+'-'+_0x1b01de+'/'+_0x2510ef)[_0xda02('0xd')](_0x48c3d0);}return null;};}function saveUpdates(_0x5ef94e){return function(_0x14ab6a){if(_0x14ab6a){return _0x14ab6a[_0xda02('0x13')](_0x5ef94e)[_0xda02('0x14')](function(_0x478720){return _0x478720;});}return null;};}function removeEntity(_0x2bc895){return function(_0x530c7d){if(_0x530c7d){return _0x530c7d['destroy']()['then'](function(){var _0x3b2553=_0x530c7d[_0xda02('0x15')]({'plain':!![]});var _0x527973=_0xda02('0x16');return db[_0xda02('0x17')][_0xda02('0x18')]({'where':{'type':_0x527973,'resourceId':_0x3b2553['id']}})['then'](function(){return _0x530c7d;});})[_0xda02('0x14')](function(){_0x2bc895[_0xda02('0xc')](0xcc)[_0xda02('0xb')]();});}};}function handleEntityNotFound(_0x48604d){return function(_0x5f19c2){if(!_0x5f19c2){_0x48604d[_0xda02('0x19')](0x194);}return _0x5f19c2;};}function handleError(_0xd3b7ce,_0x511a6f){_0x511a6f=_0x511a6f||0x1f4;return function(_0x1df5e4){logger[_0xda02('0x1a')](_0x1df5e4[_0xda02('0x1b')]);if(_0x1df5e4['name']){delete _0x1df5e4[_0xda02('0x1c')];}_0xd3b7ce['status'](_0x511a6f)['send'](_0x1df5e4);};}exports[_0xda02('0x1d')]=function(_0x10998b,_0x67aa73){var _0x13057d={};var _0x21c71d={'count':0x0,'rows':[]};var _0x526df5=_[_0xda02('0x1e')](db[_0xda02('0x1f')]['rawAttributes'],function(_0x4ecae6){return{'name':_0x4ecae6['fieldName'],'type':_0x4ecae6['type'][_0xda02('0x20')]};});_0x13057d=qs[_0xda02('0x21')](_0x526df5,_0x10998b);var _0xec0f63={'where':_0x13057d[_0xda02('0x22')]};return db[_0xda02('0x1f')][_0xda02('0x10')](_0xec0f63)[_0xda02('0x14')](function(_0x39d496){_0x21c71d[_0xda02('0x10')]=_0x39d496;_0x13057d['include']=qs['include'](_0x10998b[_0xda02('0x23')]);return db[_0xda02('0x1f')][_0xda02('0x24')](_0x13057d);})[_0xda02('0x14')](function(_0x2b1115){_0x21c71d[_0xda02('0x25')]=_0x2b1115;return _0x21c71d;})[_0xda02('0x14')](respondWithFilteredResult(_0x67aa73,_0x13057d))[_0xda02('0x26')](handleError(_0x67aa73,null));};exports[_0xda02('0x27')]=function(_0x2b45a5,_0x1cb4a2){var _0x1d79a8={'raw':!![],'where':{'id':_0x2b45a5['params']['id']}},_0x278cc9={};_0x278cc9[_0xda02('0x28')]=_[_0xda02('0x29')](db[_0xda02('0x1f')][_0xda02('0x2a')]);_0x278cc9[_0xda02('0x23')]=_[_0xda02('0x29')](_0x2b45a5[_0xda02('0x23')]);_0x278cc9[_0xda02('0x2b')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],_0x278cc9['query']);_0x1d79a8[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x2b45a5[_0xda02('0x23')][_0xda02('0x2e')]));_0x1d79a8[_0xda02('0x2d')]=_0x1d79a8['attributes'][_0xda02('0x2f')]?_0x1d79a8[_0xda02('0x2d')]:_0x278cc9[_0xda02('0x28')];if(_0x2b45a5[_0xda02('0x23')]['includeAll']){_0x1d79a8[_0xda02('0x30')]=[{'all':!![]}];}_0x1d79a8=_['merge']({},_0x1d79a8,_0x2b45a5['options']);return db['ChatQueue'][_0xda02('0x31')](_0x1d79a8)[_0xda02('0x14')](handleEntityNotFound(_0x1cb4a2,null))[_0xda02('0x14')](respondWithResult(_0x1cb4a2,null))[_0xda02('0x26')](handleError(_0x1cb4a2,null));};exports[_0xda02('0x32')]=function(_0x3fbc98,_0x14023c){return db[_0xda02('0x1f')][_0xda02('0x32')](_0x3fbc98[_0xda02('0x33')],{})[_0xda02('0x14')](function(_0x1ab94c){var _0x4e5a8e=_0x3fbc98[_0xda02('0x34')][_0xda02('0x15')]({'plain':!![]});if(!_0x4e5a8e)throw new Error(_0xda02('0x35'));if(_0x4e5a8e[_0xda02('0x36')]===_0xda02('0x34')){var _0x30c9c4=_0x1ab94c[_0xda02('0x15')]({'plain':!![]});var _0x34a1bb='ChatQueues';return db[_0xda02('0x37')][_0xda02('0x31')]({'where':{'name':_0x34a1bb,'userProfileId':_0x4e5a8e['userProfileId']},'raw':!![]})[_0xda02('0x14')](function(_0xdf9b1a){if(_0xdf9b1a&&_0xdf9b1a[_0xda02('0x38')]===0x0){return db[_0xda02('0x17')][_0xda02('0x32')]({'name':_0x30c9c4[_0xda02('0x1c')],'resourceId':_0x30c9c4['id'],'type':_0xdf9b1a['name'],'sectionId':_0xdf9b1a['id']},{})[_0xda02('0x14')](function(){return _0x1ab94c;});}else{return _0x1ab94c;}})[_0xda02('0x26')](function(_0x1aab09){logger[_0xda02('0x1a')](_0xda02('0x39'),_0x1aab09);throw _0x1aab09;});}return _0x1ab94c;})[_0xda02('0x14')](respondWithResult(_0x14023c,0xc9))[_0xda02('0x26')](handleError(_0x14023c,null));};exports[_0xda02('0x13')]=function(_0x434293,_0x35456c){if(_0x434293[_0xda02('0x33')]['id']){delete _0x434293[_0xda02('0x33')]['id'];}return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x434293[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x35456c,null))[_0xda02('0x14')](saveUpdates(_0x434293['body'],null))[_0xda02('0x14')](respondWithResult(_0x35456c,null))[_0xda02('0x26')](handleError(_0x35456c,null));};exports['destroy']=function(_0x3b7935,_0x2ae886){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x3b7935[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x2ae886,null))[_0xda02('0x14')](removeEntity(_0x2ae886,null))[_0xda02('0x26')](handleError(_0x2ae886,null));};exports[_0xda02('0x3b')]=function(_0x53810e,_0x39faac){return db[_0xda02('0x1f')][_0xda02('0x3b')]()['then'](respondWithResult(_0x39faac,null))[_0xda02('0x26')](handleError(_0x39faac,null));};exports['getMembers']=function(_0x5ddd0f,_0x3a449a){var _0x231136={'raw':!![],'where':{}},_0x40b4e1={},_0x5ea3c8;return db['ChatQueue'][_0xda02('0x3c')]({'where':{'id':_0x5ddd0f[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x3a449a,null))[_0xda02('0x14')](function(_0x58fd37){if(_0x58fd37){_0x5ea3c8=_0x58fd37[_0xda02('0x15')]({'plain':!![]});_0x40b4e1[_0xda02('0x28')]=_['keys'](db['UserChatQueue'][_0xda02('0x2a')]);_0x40b4e1[_0xda02('0x23')]=_[_0xda02('0x29')](_0x5ddd0f[_0xda02('0x23')]);_0x40b4e1[_0xda02('0x2b')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],_0x40b4e1[_0xda02('0x23')]);_0x231136[_0xda02('0x2d')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x5ddd0f[_0xda02('0x23')]['fields']));_0x231136[_0xda02('0x2d')]=_0x231136['attributes'][_0xda02('0x2f')]?_0x231136['attributes']:_0x40b4e1[_0xda02('0x28')];if(!_0x5ddd0f[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x231136['limit']=qs['limit'](_0x5ddd0f[_0xda02('0x23')][_0xda02('0x11')]);_0x231136[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x5ddd0f[_0xda02('0x23')][_0xda02('0xe')]);}_0x231136['order']=qs[_0xda02('0x3f')](_0x5ddd0f[_0xda02('0x23')]['sort']);_0x231136[_0xda02('0x22')]=qs['filters'](_[_0xda02('0x40')](_0x5ddd0f[_0xda02('0x23')],_0x40b4e1[_0xda02('0x2b')]));_0x231136[_0xda02('0x22')][_0xda02('0x41')]=_0x58fd37['id'];if(_0x5ddd0f[_0xda02('0x23')][_0xda02('0x42')]){_0x231136['where']=_[_0xda02('0x43')](_0x231136[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x231136[_0xda02('0x2d')],function(_0x268e65){var _0x18f866={};_0x18f866[_0x268e65]={'$like':'%'+_0x5ddd0f[_0xda02('0x23')]['filter']+'%'};return _0x18f866;})});}_0x231136=_['merge']({},_0x231136,_0x5ddd0f[_0xda02('0x44')]);return db[_0xda02('0x45')][_0xda02('0x24')](_0x231136);}})[_0xda02('0x14')](function(_0x24f08f){if(_0x24f08f){return db[_0xda02('0x46')][_0xda02('0x47')]({'where':{'id':_[_0xda02('0x1e')](_0x24f08f,'UserId'),'role':_0xda02('0x48')},'attributes':['id',_0xda02('0x1c'),_0xda02('0x49'),_0xda02('0x4a'),_0xda02('0x4b')]});}})[_0xda02('0x14')](function(_0x2efd5e){if(_0x2efd5e){return{'count':_0x2efd5e['count'],'rows':_[_0xda02('0x1e')](_0x2efd5e[_0xda02('0x25')],function(_0x849382){return{'membername':_0x849382[_0xda02('0x1c')],'UserId':_0x849382['id'],'queue_name':_0x5ea3c8[_0xda02('0x1c')],'ChatQueueId':_0x5ea3c8['id'],'interface':util[_0xda02('0x4c')](_0xda02('0x4d'),_0xda02('0x4e'),_0x849382[_0xda02('0x1c')]),'penalty':0x0,'paused':_0x849382['chatPause'],'createdAt':_0x849382[_0xda02('0x4b')],'updatedAt':_0x849382[_0xda02('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a449a,_0x231136))['catch'](handleError(_0x3a449a,null));};exports[_0xda02('0x4f')]=function(_0x214b23,_0x106487){var _0x286018={};var _0x5100dc={};var _0x4462f5;var _0x11adda;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x214b23[_0xda02('0x3a')]['id']}})['then'](handleEntityNotFound(_0x106487,null))[_0xda02('0x14')](function(_0x16f917){if(_0x16f917){_0x4462f5=_0x16f917;_0x5100dc[_0xda02('0x28')]=_['keys'](db['Team'][_0xda02('0x2a')]);_0x5100dc['query']=_[_0xda02('0x29')](_0x214b23['query']);_0x5100dc['filters']=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],_0x5100dc[_0xda02('0x23')]);_0x286018[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x214b23[_0xda02('0x23')]['fields']));_0x286018[_0xda02('0x2d')]=_0x286018[_0xda02('0x2d')][_0xda02('0x2f')]?_0x286018['attributes']:_0x5100dc[_0xda02('0x28')];_0x286018['order']=qs['sort'](_0x214b23['query'][_0xda02('0x3f')]);_0x286018[_0xda02('0x22')]=qs[_0xda02('0x2b')](_['pick'](_0x214b23[_0xda02('0x23')],_0x5100dc[_0xda02('0x2b')]));if(_0x214b23['query'][_0xda02('0x42')]){_0x286018[_0xda02('0x22')]=_[_0xda02('0x43')](_0x286018[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x286018[_0xda02('0x2d')],function(_0x22bc78){var _0x5b3c85={};_0x5b3c85[_0x22bc78]={'$like':'%'+_0x214b23[_0xda02('0x23')][_0xda02('0x42')]+'%'};return _0x5b3c85;})});}_0x286018=_[_0xda02('0x43')]({},_0x286018,_0x214b23[_0xda02('0x44')]);return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x14e7e4){if(_0x14e7e4){_0x11adda=_0x14e7e4[_0xda02('0x2f')];if(!_0x214b23[_0xda02('0x23')][_0xda02('0x3d')]('nolimit')){_0x286018[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x214b23[_0xda02('0x23')][_0xda02('0x11')]);_0x286018[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x214b23['query']['offset']);}return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x1c255e){if(_0x1c255e){return _0x1c255e?{'count':_0x11adda,'rows':_0x1c255e}:null;}})['then'](respondWithResult(_0x106487,null))['catch'](handleError(_0x106487,null));};exports[_0xda02('0x50')]=function(_0x5be91c,_0x135144){var _0x15ec45=_0x5be91c['body'][_0xda02('0x51')];return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x15ec45},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id','name',_0xda02('0x54'),'voicePause','interface'],'raw':!![]}]})[_0xda02('0x14')](function(_0x3c91a8){if(_0x3c91a8){var _0x390836=_['flatMap'](_0x3c91a8,function(_0x555d24){var _0x321fa7=_0x555d24[_0xda02('0x15')]({'plain':!![]});return _0x321fa7[_0xda02('0x53')];});return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x5be91c[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x331ed5){return db[_0xda02('0x55')][_0xda02('0x56')](function(_0x428d1b){return _0x331ed5['addTeams'](_0x15ec45,{'transaction':_0x428d1b})[_0xda02('0x14')](function(){return BPromise['each'](_0x390836,function(_0x4755de){return db['UserChatQueue'][_0xda02('0x57')]({'where':{'UserId':_0x4755de['id'],'ChatQueueId':_0x5be91c['params']['id']},'transaction':_0x428d1b});});})[_0xda02('0x14')](function(){_0x390836[_0xda02('0x58')](function(_0x1ab5b5){socket['emit'](_0xda02('0x59'),{'UserId':_0x1ab5b5['id'],'ChatQueueId':_0x331ed5['id']});});});});});}})['then'](respondWithStatusCode(_0x135144,null))[_0xda02('0x26')](handleError(_0x135144,null));};exports['removeTeams']=function(_0x57a443,_0x7e8e70){return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x57a443[_0xda02('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id'],'raw':!![]}]})[_0xda02('0x14')](handleEntityNotFound(_0x7e8e70,null))[_0xda02('0x14')](function(_0x5e75a2){var _0x4f887a=_[_0xda02('0x1e')](_0x5e75a2,'id');var _0x731a2e=[];var _0x3dd3ed=[];var _0x2f0661=squel[_0xda02('0x5a')]();_0x2f0661['field'](_0xda02('0x5b'))['from'](_0xda02('0x5c'),'tq')[_0xda02('0x5d')](_0xda02('0x5e'),'ut',_0xda02('0x5f'))[_0xda02('0x22')](_0xda02('0x60'),_0x57a443[_0xda02('0x3a')]['id']);for(var _0x33f177=0x0;_0x33f177<_0x5e75a2['length'];_0x33f177+=0x1){let _0x54535d=_0x5e75a2[_0x33f177];for(var _0xfe746c=0x0;_0xfe746c<_0x54535d[_0xda02('0x53')][_0xda02('0x2f')];_0xfe746c+=0x1){let _0x38f2bc=_0x54535d['Agents'][_0xfe746c];var _0x61022d=_0x2f0661[_0xda02('0x61')]();_0x61022d[_0xda02('0x22')](_0xda02('0x62'),_0x38f2bc['id']);_0x3dd3ed[_0xda02('0x63')](db[_0xda02('0x55')][_0xda02('0x23')](_0x61022d['toString'](),{'type':db[_0xda02('0x55')][_0xda02('0x64')]['SELECT']})[_0xda02('0x14')](function(_0x113249){if(_0x113249[_0xda02('0x2f')]===0x1){return _0x38f2bc['id'];}else{var _0x3adaa6=_[_0xda02('0x65')](_[_0xda02('0x1e')](_0x113249,_0xda02('0x66')),function(_0x209fb9){return _['includes'](_0x4f887a,_0x209fb9);});if(_0x3adaa6){return _0x38f2bc['id'];}}}));}}return BPromise['all'](_0x3dd3ed)[_0xda02('0x14')](function(_0x22af9d){_0x731a2e=_(_0x731a2e)['union'](_0x22af9d)['compact']()[_0xda02('0x67')]();return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x57a443[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x216ffb){return db['sequelize']['transaction'](function(_0x433699){return _0x216ffb[_0xda02('0x68')](_0x57a443[_0xda02('0x23')]['ids'],{'transaction':_0x433699})[_0xda02('0x14')](function(){if(!_[_0xda02('0x69')](_0x731a2e)){return _0x216ffb[_0xda02('0x6a')](_0x731a2e,{'transaction':_0x433699});}})[_0xda02('0x14')](function(){_0x731a2e[_0xda02('0x58')](function(_0x37ddd7){socket[_0xda02('0x6b')](_0xda02('0x6c'),{'UserId':_0x37ddd7,'ChatQueueId':_0x216ffb['id']});});});});});});})['then'](respondWithStatusCode(_0x7e8e70,null))[_0xda02('0x26')](handleError(_0x7e8e70,null));};exports['addAgents']=function(_0x4cdedd,_0x1ac8d1){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x4cdedd[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x1ac8d1,null))['then'](function(_0x2c5b2f){if(_0x2c5b2f){return _0x2c5b2f[_0xda02('0x6d')](_0x4cdedd[_0xda02('0x33')]['ids'],_[_0xda02('0x6e')](_0x4cdedd['body'],['ids','id'])||{})['spread'](function(_0x3e428e){for(var _0x104703=0x0;_0x104703<_0x4cdedd['body'][_0xda02('0x51')][_0xda02('0x2f')];_0x104703+=0x1){socket[_0xda02('0x6b')](_0xda02('0x59'),{'UserId':Number(_0x4cdedd[_0xda02('0x33')]['ids'][_0x104703]),'ChatQueueId':Number(_0x4cdedd[_0xda02('0x3a')]['id'])});}return _0x3e428e;});}})[_0xda02('0x14')](respondWithResult(_0x1ac8d1,null))[_0xda02('0x26')](handleError(_0x1ac8d1,null));};exports['removeAgents']=function(_0x46a107,_0x512b0e){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x46a107[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x512b0e,null))[_0xda02('0x14')](function(_0x420b41){if(_0x420b41){return _0x420b41[_0xda02('0x6a')](_0x46a107[_0xda02('0x23')][_0xda02('0x51')])[_0xda02('0x14')](function(){if(_[_0xda02('0x6f')](_0x46a107['query'][_0xda02('0x51')])){for(var _0x30495f=0x0;_0x30495f<_0x46a107[_0xda02('0x23')][_0xda02('0x51')][_0xda02('0x2f')];_0x30495f+=0x1){socket[_0xda02('0x6b')]('userChatQueue:remove',{'UserId':Number(_0x46a107['query'][_0xda02('0x51')][_0x30495f]),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x46a107[_0xda02('0x23')]['ids']),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}});}})[_0xda02('0x14')](respondWithStatusCode(_0x512b0e,null))['catch'](handleError(_0x512b0e,null));};exports[_0xda02('0x70')]=function(_0x3b9efb,_0x4d08b0){var _0x59fedc={};var _0x472670={};var _0x48da1b;var _0x2a8650;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x3b9efb[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x4d08b0,null))[_0xda02('0x14')](function(_0x531949){if(_0x531949){_0x48da1b=_0x531949;_0x472670[_0xda02('0x28')]=_[_0xda02('0x29')](db['User'][_0xda02('0x2a')]);_0x472670[_0xda02('0x23')]=_[_0xda02('0x29')](_0x3b9efb[_0xda02('0x23')]);_0x472670['filters']=_['intersection'](_0x472670[_0xda02('0x28')],_0x472670[_0xda02('0x23')]);_0x59fedc[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x472670[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x3b9efb[_0xda02('0x23')]['fields']));_0x59fedc[_0xda02('0x2d')]=_0x59fedc[_0xda02('0x2d')][_0xda02('0x2f')]?_0x59fedc[_0xda02('0x2d')]:_0x472670[_0xda02('0x28')];_0x59fedc[_0xda02('0x71')]=qs[_0xda02('0x3f')](_0x3b9efb[_0xda02('0x23')]['sort']);_0x59fedc[_0xda02('0x22')]=qs[_0xda02('0x2b')](_[_0xda02('0x40')](_0x3b9efb['query'],_0x472670[_0xda02('0x2b')]));if(_0x3b9efb[_0xda02('0x23')]['filter']){_0x59fedc['where']=_[_0xda02('0x43')](_0x59fedc[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x59fedc['attributes'],function(_0x280276){var _0xd2c136={};_0xd2c136[_0x280276]={'$like':'%'+_0x3b9efb[_0xda02('0x23')]['filter']+'%'};return _0xd2c136;})});}_0x59fedc=_['merge']({},_0x59fedc,_0x3b9efb['options']);return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2ed8ea){if(_0x2ed8ea){_0x2a8650=_0x2ed8ea[_0xda02('0x2f')];if(!_0x3b9efb[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x59fedc[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x3b9efb[_0xda02('0x23')][_0xda02('0x11')]);_0x59fedc[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x3b9efb[_0xda02('0x23')][_0xda02('0xe')]);}return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2f0ce4){if(_0x2f0ce4){return _0x2f0ce4?{'count':_0x2a8650,'rows':_0x2f0ce4}:null;}})['then'](respondWithResult(_0x4d08b0,null))[_0xda02('0x26')](handleError(_0x4d08b0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index a34ace6..dcac9d3 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 _0x3ea0=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x5d8ca7,_0x3cbe6c){var _0x24218a=function(_0x7e742c){while(--_0x7e742c){_0x5d8ca7['push'](_0x5d8ca7['shift']());}};_0x24218a(++_0x3cbe6c);}(_0x3ea0,0xf4));var _0x03ea=function(_0x3dc264,_0x209b9c){_0x3dc264=_0x3dc264-0x0;var _0x1b4bad=_0x3ea0[_0x3dc264];return _0x1b4bad;};'use strict';var EventEmitter=require(_0x03ea('0x0'));var ChatQueue=require(_0x03ea('0x1'))['db'][_0x03ea('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x03ea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x03ea('0x4')};function emitEvent(_0x201c0f){return function(_0x55e26b,_0x2e2a75,_0x5db044){ChatQueueEvents[_0x03ea('0x5')](_0x201c0f+':'+_0x55e26b['id'],_0x55e26b);ChatQueueEvents['emit'](_0x201c0f,_0x55e26b);_0x5db044(null);};}for(var e in events){if(events[_0x03ea('0x6')](e)){var event=events[e];ChatQueue[_0x03ea('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x8bad=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x4e66b2,_0x1d0c56){var _0x265d82=function(_0x17cdcb){while(--_0x17cdcb){_0x4e66b2['push'](_0x4e66b2['shift']());}};_0x265d82(++_0x1d0c56);}(_0x8bad,0x124));var _0xd8ba=function(_0x53400c,_0x25337d){_0x53400c=_0x53400c-0x0;var _0x259fe5=_0x8bad[_0x53400c];return _0x259fe5;};'use strict';var EventEmitter=require(_0xd8ba('0x0'));var ChatQueue=require(_0xd8ba('0x1'))['db'][_0xd8ba('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd8ba('0x3')](0x0);var events={'afterCreate':_0xd8ba('0x4'),'afterUpdate':_0xd8ba('0x5'),'afterDestroy':_0xd8ba('0x6')};function emitEvent(_0x385e50){return function(_0x42969b,_0x55d8d5,_0x224bb6){ChatQueueEvents[_0xd8ba('0x7')](_0x385e50+':'+_0x42969b['id'],_0x42969b);ChatQueueEvents[_0xd8ba('0x7')](_0x385e50,_0x42969b);_0x224bb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd8ba('0x8')](e,emitEvent(event));}}module[_0xd8ba('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f13e85e..6889fc2 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 _0xaf73=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','request-promise','path'];(function(_0xdf90c0,_0x16e899){var _0x52b20e=function(_0x320dec){while(--_0x320dec){_0xdf90c0['push'](_0xdf90c0['shift']());}};_0x52b20e(++_0x16e899);}(_0xaf73,0xa3));var _0x3af7=function(_0x454f96,_0x1801b5){_0x454f96=_0x454f96-0x0;var _0x21b928=_0xaf73[_0x454f96];return _0x21b928;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var logger=require('../../config/logger')(_0x3af7('0x2'));var moment=require(_0x3af7('0x3'));var BPromise=require('bluebird');var rp=require(_0x3af7('0x4'));var fs=require('fs');var path=require(_0x3af7('0x5'));var rimraf=require(_0x3af7('0x6'));var config=require(_0x3af7('0x7'));var attributes=require(_0x3af7('0x8'));module[_0x3af7('0x9')]=function(_0x21423b,_0x148409){return _0x21423b[_0x3af7('0xa')](_0x3af7('0xb'),attributes,{'tableName':_0x3af7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f86=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x8ffa8e,_0x56f5c6){var _0x9d972a=function(_0x2cdced){while(--_0x2cdced){_0x8ffa8e['push'](_0x8ffa8e['shift']());}};_0x9d972a(++_0x56f5c6);}(_0x1f86,0xbc));var _0x61f8=function(_0x19cfe5,_0x4d1bcf){_0x19cfe5=_0x19cfe5-0x0;var _0x15b837=_0x1f86[_0x19cfe5];return _0x15b837;};'use strict';var _=require(_0x61f8('0x0'));var util=require(_0x61f8('0x1'));var logger=require(_0x61f8('0x2'))(_0x61f8('0x3'));var moment=require(_0x61f8('0x4'));var BPromise=require(_0x61f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f8('0x6'));var rimraf=require(_0x61f8('0x7'));var config=require(_0x61f8('0x8'));var attributes=require(_0x61f8('0x9'));module[_0x61f8('0xa')]=function(_0x36e52f,_0x2df5b2){return _0x36e52f[_0x61f8('0xb')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 4fe39b4..795e1fb 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 _0x49db=['where','attributes','limit','include','map','model','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','raw'];(function(_0x2ecc84,_0x28111d){var _0x3afb11=function(_0x474064){while(--_0x474064){_0x2ecc84['push'](_0x2ecc84['shift']());}};_0x3afb11(++_0x28111d);}(_0x49db,0xc5));var _0xb49d=function(_0x556fa0,_0x4e4a90){_0x556fa0=_0x556fa0-0x0;var _0x4b2cf7=_0x49db[_0x556fa0];return _0x4b2cf7;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var moment=require(_0xb49d('0x2'));var BPromise=require(_0xb49d('0x3'));var rs=require(_0xb49d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb49d('0x5'))['db'];var utils=require(_0xb49d('0x6'));var logger=require(_0xb49d('0x7'))('rpc');var config=require(_0xb49d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb49d('0x9')]({'port':0x232a});config[_0xb49d('0xa')]=_[_0xb49d('0xb')](config['redis'],{'host':_0xb49d('0xc'),'port':0x18eb});var socket=require(_0xb49d('0xd'))(new Redis(config[_0xb49d('0xa')]));require(_0xb49d('0xe'))[_0xb49d('0xf')](socket);function respondWithRpcPromise(_0x66c2be,_0x54f285,_0x5106c9){return new BPromise(function(_0x3f21e3,_0x3422e0){return client[_0xb49d('0x10')](_0x66c2be,_0x5106c9)[_0xb49d('0x11')](function(_0x2c9c16){logger[_0xb49d('0x12')](_0xb49d('0x13'),_0x54f285,_0xb49d('0x14'));logger[_0xb49d('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x54f285,_0xb49d('0x14'),JSON[_0xb49d('0x16')](_0x2c9c16));if(_0x2c9c16[_0xb49d('0x17')]){if(_0x2c9c16[_0xb49d('0x17')]['code']===0x1f4){logger[_0xb49d('0x17')](_0xb49d('0x13'),_0x54f285,_0x2c9c16['error'][_0xb49d('0x18')]);return _0x3422e0(_0x2c9c16[_0xb49d('0x17')][_0xb49d('0x18')]);}logger[_0xb49d('0x17')](_0xb49d('0x13'),_0x54f285,_0x2c9c16[_0xb49d('0x17')][_0xb49d('0x18')]);return _0x3f21e3(_0x2c9c16['error'][_0xb49d('0x18')]);}else{logger[_0xb49d('0x12')](_0xb49d('0x13'),_0x54f285,_0xb49d('0x14'));_0x3f21e3(_0x2c9c16['result']['message']);}})[_0xb49d('0x19')](function(_0xa65038){logger[_0xb49d('0x17')](_0xb49d('0x13'),_0x54f285,_0xa65038);_0x3422e0(_0xa65038);});});}exports[_0xb49d('0x1a')]=function(_0x510f22){var _0x18547b=this;return new Promise(function(_0x47626f,_0x3bf7a2){return db[_0xb49d('0x1b')][_0xb49d('0x1c')]({'raw':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x1e')]===undefined?!![]:![]:!![],'where':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x1f')]||null:null,'attributes':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x20')]||null:null,'limit':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x21')]||null:null,'include':_0x510f22[_0xb49d('0x1d')]?_0x510f22[_0xb49d('0x1d')][_0xb49d('0x22')]?_[_0xb49d('0x23')](_0x510f22[_0xb49d('0x1d')]['include'],function(_0x227305){return{'model':db[_0x227305['model']],'as':_0x227305['as'],'attributes':_0x227305[_0xb49d('0x20')],'include':_0x227305[_0xb49d('0x22')]?_['map'](_0x227305[_0xb49d('0x22')],function(_0x1cd841){return{'model':db[_0x1cd841[_0xb49d('0x24')]],'as':_0x1cd841['as'],'attributes':_0x1cd841[_0xb49d('0x20')],'include':_0x1cd841[_0xb49d('0x22')]?_[_0xb49d('0x23')](_0x1cd841['include'],function(_0x3930fe){return{'model':db[_0x3930fe[_0xb49d('0x24')]],'as':_0x3930fe['as'],'attributes':_0x3930fe[_0xb49d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb49d('0x11')](function(_0x420e63){logger[_0xb49d('0x12')](_0xb49d('0x1a'),_0x510f22);logger['debug'](_0xb49d('0x1a'),_0x510f22,JSON['stringify'](_0x420e63));_0x47626f(_0x420e63);})[_0xb49d('0x19')](function(_0x2fbcfa){logger[_0xb49d('0x17')](_0xb49d('0x1a'),_0x2fbcfa[_0xb49d('0x18')],_0x510f22);_0x3bf7a2(_0x18547b[_0xb49d('0x17')](0x1f4,_0x2fbcfa[_0xb49d('0x18')]));});});};exports['ShowChatQueue']=function(_0x3802c8){var _0x463852=this;return new Promise(function(_0xf0da2b,_0x5e0f70){return db['ChatQueue'][_0xb49d('0x25')]({'raw':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8[_0xb49d('0x1d')][_0xb49d('0x1e')]===undefined?!![]:![]:!![],'where':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8[_0xb49d('0x1d')][_0xb49d('0x1f')]||null:null,'attributes':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8['options']['attributes']||null:null,'include':_0x3802c8[_0xb49d('0x1d')]?_0x3802c8['options']['include']?_['map'](_0x3802c8[_0xb49d('0x1d')][_0xb49d('0x22')],function(_0x3964ec){return{'model':db[_0x3964ec[_0xb49d('0x24')]],'as':_0x3964ec['as'],'attributes':_0x3964ec[_0xb49d('0x20')],'include':_0x3964ec[_0xb49d('0x22')]?_['map'](_0x3964ec[_0xb49d('0x22')],function(_0x15c53f){return{'model':db[_0x15c53f['model']],'as':_0x15c53f['as'],'attributes':_0x15c53f[_0xb49d('0x20')],'include':_0x15c53f[_0xb49d('0x22')]?_[_0xb49d('0x23')](_0x15c53f['include'],function(_0x47e9ec){return{'model':db[_0x47e9ec[_0xb49d('0x24')]],'as':_0x47e9ec['as'],'attributes':_0x47e9ec[_0xb49d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45f497){logger['info']('ShowChatQueue',_0x3802c8);logger['debug']('ShowChatQueue',_0x3802c8,JSON[_0xb49d('0x16')](_0x45f497));_0xf0da2b(_0x45f497);})[_0xb49d('0x19')](function(_0x47150a){logger[_0xb49d('0x17')]('ShowChatQueue',_0x47150a['message'],_0x3802c8);_0x5e0f70(_0x463852[_0xb49d('0x17')](0x1f4,_0x47150a[_0xb49d('0x18')]));});});}; \ No newline at end of file +var _0x7035=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetChatQueue','catch','ShowChatQueue','lodash'];(function(_0x5f4ab1,_0x1cbb88){var _0x5e553d=function(_0x35ff48){while(--_0x35ff48){_0x5f4ab1['push'](_0x5f4ab1['shift']());}};_0x5e553d(++_0x1cbb88);}(_0x7035,0x15e));var _0x5703=function(_0x3aa92c,_0x3a10a0){_0x3aa92c=_0x3aa92c-0x0;var _0x2b1300=_0x7035[_0x3aa92c];return _0x2b1300;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var moment=require(_0x5703('0x1'));var BPromise=require(_0x5703('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5703('0x3'));var db=require(_0x5703('0x4'))['db'];var utils=require(_0x5703('0x5'));var logger=require(_0x5703('0x6'))(_0x5703('0x7'));var config=require('../../config/environment');var jayson=require(_0x5703('0x8'));var client=jayson[_0x5703('0x9')]['http']({'port':0x232a});config[_0x5703('0xa')]=_[_0x5703('0xb')](config[_0x5703('0xa')],{'host':_0x5703('0xc'),'port':0x18eb});var socket=require(_0x5703('0xd'))(new Redis(config[_0x5703('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x169e83,_0x5775d8,_0x4f1db7){return new BPromise(function(_0x5c36a5,_0x522449){return client[_0x5703('0xe')](_0x169e83,_0x4f1db7)[_0x5703('0xf')](function(_0xfcbc9e){logger['info'](_0x5703('0x10'),_0x5775d8,'request\x20sent');logger[_0x5703('0x11')](_0x5703('0x12'),_0x5775d8,_0x5703('0x13'),JSON[_0x5703('0x14')](_0xfcbc9e));if(_0xfcbc9e[_0x5703('0x15')]){if(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x16')]===0x1f4){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x522449(_0xfcbc9e['error'][_0x5703('0x17')]);}logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x5c36a5(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);}else{logger[_0x5703('0x18')](_0x5703('0x10'),_0x5775d8,'request\x20sent');_0x5c36a5(_0xfcbc9e[_0x5703('0x19')][_0x5703('0x17')]);}})['catch'](function(_0x579097){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0x579097);_0x522449(_0x579097);});});}exports['GetChatQueue']=function(_0x240cb8){var _0x59e065=this;return new Promise(function(_0x43cdbf,_0x33d30a){return db[_0x5703('0x1a')][_0x5703('0x1b')]({'raw':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x240cb8['options']?_0x240cb8['options'][_0x5703('0x1e')]||null:null,'attributes':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x1f')]||null:null,'limit':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x20')]||null:null,'include':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')]['include']?_['map'](_0x240cb8['options'][_0x5703('0x21')],function(_0x495db2){return{'model':db[_0x495db2[_0x5703('0x22')]],'as':_0x495db2['as'],'attributes':_0x495db2[_0x5703('0x1f')],'include':_0x495db2[_0x5703('0x21')]?_[_0x5703('0x23')](_0x495db2[_0x5703('0x21')],function(_0x57964d){return{'model':db[_0x57964d[_0x5703('0x22')]],'as':_0x57964d['as'],'attributes':_0x57964d['attributes'],'include':_0x57964d[_0x5703('0x21')]?_[_0x5703('0x23')](_0x57964d[_0x5703('0x21')],function(_0x4b23ed){return{'model':db[_0x4b23ed[_0x5703('0x22')]],'as':_0x4b23ed['as'],'attributes':_0x4b23ed[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bd1f7){logger[_0x5703('0x18')](_0x5703('0x24'),_0x240cb8);logger[_0x5703('0x11')]('GetChatQueue',_0x240cb8,JSON['stringify'](_0x3bd1f7));_0x43cdbf(_0x3bd1f7);})[_0x5703('0x25')](function(_0x28a460){logger[_0x5703('0x15')](_0x5703('0x24'),_0x28a460[_0x5703('0x17')],_0x240cb8);_0x33d30a(_0x59e065[_0x5703('0x15')](0x1f4,_0x28a460[_0x5703('0x17')]));});});};exports[_0x5703('0x26')]=function(_0x3508e8){var _0x2fb0c0=this;return new Promise(function(_0x2af3c3,_0x3fadcc){return db[_0x5703('0x1a')]['find']({'raw':_0x3508e8['options']?_0x3508e8['options'][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')][_0x5703('0x1e')]||null:null,'attributes':_0x3508e8[_0x5703('0x1c')]?_0x3508e8['options'][_0x5703('0x1f')]||null:null,'include':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')]['include']?_[_0x5703('0x23')](_0x3508e8[_0x5703('0x1c')][_0x5703('0x21')],function(_0x2eab10){return{'model':db[_0x2eab10['model']],'as':_0x2eab10['as'],'attributes':_0x2eab10[_0x5703('0x1f')],'include':_0x2eab10[_0x5703('0x21')]?_['map'](_0x2eab10[_0x5703('0x21')],function(_0x1f08ba){return{'model':db[_0x1f08ba[_0x5703('0x22')]],'as':_0x1f08ba['as'],'attributes':_0x1f08ba['attributes'],'include':_0x1f08ba[_0x5703('0x21')]?_['map'](_0x1f08ba[_0x5703('0x21')],function(_0x319aa6){return{'model':db[_0x319aa6[_0x5703('0x22')]],'as':_0x319aa6['as'],'attributes':_0x319aa6[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x495a7c){logger[_0x5703('0x18')](_0x5703('0x26'),_0x3508e8);logger[_0x5703('0x11')](_0x5703('0x26'),_0x3508e8,JSON[_0x5703('0x14')](_0x495a7c));_0x2af3c3(_0x495a7c);})['catch'](function(_0x5c0ae3){logger[_0x5703('0x15')](_0x5703('0x26'),_0x5c0ae3[_0x5703('0x17')],_0x3508e8);_0x3fadcc(_0x2fb0c0[_0x5703('0x15')](0x1f4,_0x5c0ae3[_0x5703('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 6d305c2..ad7e3ab 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 _0x668b=['./chatQueue.events','save','update','removeListener','length'];(function(_0x11a92b,_0x15b34c){var _0x1e82f1=function(_0xb2e02d){while(--_0xb2e02d){_0x11a92b['push'](_0x11a92b['shift']());}};_0x1e82f1(++_0x15b34c);}(_0x668b,0x140));var _0xb668=function(_0xa2b098,_0x461a08){_0xa2b098=_0xa2b098-0x0;var _0x29502e=_0x668b[_0xa2b098];return _0x29502e;};'use strict';var ChatQueueEvents=require(_0xb668('0x0'));var events=[_0xb668('0x1'),'remove',_0xb668('0x2')];function createListener(_0x2c30c1,_0x49a53b){return function(_0x336ba4){_0x49a53b['emit'](_0x2c30c1,_0x336ba4);};}function removeListener(_0x2fab11,_0x4092a6){return function(){ChatQueueEvents[_0xb668('0x3')](_0x2fab11,_0x4092a6);};}exports['register']=function(_0x9b99a8){for(var _0x296fa9=0x0,_0x3be92e=events[_0xb668('0x4')];_0x296fa9<_0x3be92e;_0x296fa9++){var _0x20b749=events[_0x296fa9];var _0x3f01bc=createListener('chatQueue:'+_0x20b749,_0x9b99a8);ChatQueueEvents['on'](_0x20b749,_0x3f01bc);}}; \ No newline at end of file +var _0xb458=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x5e6c25,_0x29046e){var _0x8d0c63=function(_0x509bff){while(--_0x509bff){_0x5e6c25['push'](_0x5e6c25['shift']());}};_0x8d0c63(++_0x29046e);}(_0xb458,0x103));var _0x8b45=function(_0x1024ca,_0x2562fe){_0x1024ca=_0x1024ca-0x0;var _0x390f5c=_0xb458[_0x1024ca];return _0x390f5c;};'use strict';var ChatQueueEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatQueueEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatQueue:'+_0x3a8ccb,_0x5cc2d5);ChatQueueEvents['on'](_0x3a8ccb,_0x32342f);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index ca7f30c..dd6c5ec 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x1a9443,_0x2284ef){_0x1a9443=_0x1a9443-0x0;var _0x10135b=_0x3e74[_0x1a9443];return _0x10135b;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x455a9c,_0x4235c6){var _0x112350=function(_0x5a044d){while(--_0x5a044d){_0x455a9c['push'](_0x455a9c['shift']());}};_0x112350(++_0x4235c6);}(_0x814b,0x1a2));var _0xb814=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x814b[_0x263f9d];return _0x4c4efa;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index d6c9dfe..2aeefab 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 _0x7f90=['sequelize','STRING','DATE'];(function(_0x24ef90,_0x5d3d10){var _0x5cdded=function(_0x198fbf){while(--_0x198fbf){_0x24ef90['push'](_0x24ef90['shift']());}};_0x5cdded(++_0x5d3d10);}(_0x7f90,0x1c5));var _0x07f9=function(_0x7ed9e9,_0x35fb5d){_0x7ed9e9=_0x7ed9e9-0x0;var _0x383437=_0x7f90[_0x7ed9e9];return _0x383437;};'use strict';var moment=require('moment');var Sequelize=require(_0x07f9('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x07f9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x07f9('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x07f9('0x2')]},'reason':{'type':Sequelize[_0x07f9('0x1')]}}; \ No newline at end of file +var _0x20da=['exports','STRING','DATE','moment','sequelize'];(function(_0x2add1c,_0x50f7c7){var _0x304af0=function(_0x324103){while(--_0x324103){_0x2add1c['push'](_0x2add1c['shift']());}};_0x304af0(++_0x50f7c7);}(_0x20da,0xcb));var _0xa20d=function(_0x58deaf,_0x4d4bde){_0x58deaf=_0x58deaf-0x0;var _0x23ee59=_0x20da[_0x58deaf];return _0x23ee59;};'use strict';var moment=require(_0xa20d('0x0'));var Sequelize=require(_0xa20d('0x1'));module[_0xa20d('0x2')]={'uniqueid':{'type':Sequelize[_0xa20d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa20d('0x4')]},'leaveAt':{'type':Sequelize[_0xa20d('0x4')]},'acceptAt':{'type':Sequelize[_0xa20d('0x4')]},'exitAt':{'type':Sequelize[_0xa20d('0x4')]},'reason':{'type':Sequelize[_0xa20d('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 66dce1a..2947fad 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 _0x9bd9=['ChatQueueReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','error','name','index'];(function(_0x23ebcf,_0x732dee){var _0x1f3f3f=function(_0x1f7abf){while(--_0x1f7abf){_0x23ebcf['push'](_0x23ebcf['shift']());}};_0x1f3f3f(++_0x732dee);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x4a2b3c,_0xc69f59){_0x4a2b3c=_0x4a2b3c-0x0;var _0x4b081b=_0x9bd9[_0x4a2b3c];return _0x4b081b;};'use strict';var emlformat=require(_0x99bd('0x0'));var rimraf=require(_0x99bd('0x1'));var zipdir=require(_0x99bd('0x2'));var jsonpatch=require(_0x99bd('0x3'));var rp=require(_0x99bd('0x4'));var moment=require(_0x99bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x99bd('0x6'));var util=require('util');var path=require(_0x99bd('0x7'));var sox=require(_0x99bd('0x8'));var csv=require('to-csv');var ejs=require(_0x99bd('0x9'));var fs=require('fs');var fs_extra=require(_0x99bd('0xa'));var _=require(_0x99bd('0xb'));var squel=require(_0x99bd('0xc'));var crypto=require(_0x99bd('0xd'));var jsforce=require(_0x99bd('0xe'));var deskjs=require(_0x99bd('0xf'));var toCsv=require(_0x99bd('0x10'));var querystring=require(_0x99bd('0x11'));var Papa=require(_0x99bd('0x12'));var Redis=require(_0x99bd('0x13'));var authService=require(_0x99bd('0x14'));var qs=require(_0x99bd('0x15'));var as=require(_0x99bd('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99bd('0x17'))('api');var utils=require(_0x99bd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x99bd('0x19'));var db=require(_0x99bd('0x1a'))['db'];function respondWithStatusCode(_0x4a8bd9,_0x22237c){_0x22237c=_0x22237c||0xcc;return function(_0x500cd2){if(_0x500cd2){return _0x4a8bd9[_0x99bd('0x1b')](_0x22237c);}return _0x4a8bd9['status'](_0x22237c)[_0x99bd('0x1c')]();};}function respondWithResult(_0x401299,_0x141159){_0x141159=_0x141159||0xc8;return function(_0x4a9770){if(_0x4a9770){return _0x401299[_0x99bd('0x1d')](_0x141159)[_0x99bd('0x1e')](_0x4a9770);}};}function respondWithFilteredResult(_0x2d918a,_0x42b619){return function(_0x65a2e5){if(_0x65a2e5){var _0x491d9=typeof _0x42b619[_0x99bd('0x1f')]===_0x99bd('0x20')&&typeof _0x42b619[_0x99bd('0x21')]==='undefined';var _0x378079=_0x65a2e5[_0x99bd('0x22')];var _0x2fe078=_0x491d9?0x0:_0x42b619['offset'];var _0x4b98fc=_0x491d9?_0x65a2e5[_0x99bd('0x22')]:_0x42b619[_0x99bd('0x1f')]+_0x42b619[_0x99bd('0x21')];var _0xfa6227;if(_0x4b98fc>=_0x378079){_0x4b98fc=_0x378079;_0xfa6227=0xc8;}else{_0xfa6227=0xce;}_0x2d918a[_0x99bd('0x1d')](_0xfa6227);return _0x2d918a['set'](_0x99bd('0x23'),_0x2fe078+'-'+_0x4b98fc+'/'+_0x378079)['json'](_0x65a2e5);}return null;};}function patchUpdates(_0x10f2fb){return function(_0x3085df){try{jsonpatch[_0x99bd('0x24')](_0x3085df,_0x10f2fb,!![]);}catch(_0x1d937b){return BPromise[_0x99bd('0x25')](_0x1d937b);}return _0x3085df['save']();};}function saveUpdates(_0x27c551,_0x229322){return function(_0x3e339c){if(_0x3e339c){return _0x3e339c['update'](_0x27c551)[_0x99bd('0x26')](function(_0x5e6081){return _0x5e6081;});}return null;};}function removeEntity(_0x4d3ebb,_0x1c5b82){return function(_0xfdc455){if(_0xfdc455){return _0xfdc455['destroy']()[_0x99bd('0x26')](function(){_0x4d3ebb[_0x99bd('0x1d')](0xcc)[_0x99bd('0x1c')]();});}};}function handleEntityNotFound(_0x3f7bf4,_0x51ff34){return function(_0x12daac){if(!_0x12daac){_0x3f7bf4['sendStatus'](0x194);}return _0x12daac;};}function handleError(_0x550b7f,_0x10d5cd){_0x10d5cd=_0x10d5cd||0x1f4;return function(_0x5ebeeb){logger[_0x99bd('0x27')](_0x5ebeeb['stack']);if(_0x5ebeeb[_0x99bd('0x28')]){delete _0x5ebeeb[_0x99bd('0x28')];}_0x550b7f['status'](_0x10d5cd)['send'](_0x5ebeeb);};}exports[_0x99bd('0x29')]=function(_0x1af1e6,_0x1eabb9){var _0x5903aa={},_0x957d48={},_0x1d0642={'count':0x0,'rows':[]};var _0x2250d8=_['map'](db[_0x99bd('0x2a')][_0x99bd('0x2b')],function(_0x4c5493){return{'name':_0x4c5493[_0x99bd('0x2c')],'type':_0x4c5493[_0x99bd('0x2d')][_0x99bd('0x2e')]};});_0x957d48[_0x99bd('0x2f')]=_['map'](_0x2250d8,_0x99bd('0x28'));_0x957d48[_0x99bd('0x30')]=_['keys'](_0x1af1e6[_0x99bd('0x30')]);_0x957d48['filters']=_['intersection'](_0x957d48['model'],_0x957d48[_0x99bd('0x30')]);_0x5903aa[_0x99bd('0x31')]=_[_0x99bd('0x32')](_0x957d48[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x33')]));_0x5903aa[_0x99bd('0x31')]=_0x5903aa[_0x99bd('0x31')][_0x99bd('0x34')]?_0x5903aa['attributes']:_0x957d48[_0x99bd('0x2f')];if(!_0x1af1e6['query'][_0x99bd('0x35')]('nolimit')){_0x5903aa['limit']=qs['limit'](_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x21')]);_0x5903aa[_0x99bd('0x1f')]=qs[_0x99bd('0x1f')](_0x1af1e6['query'][_0x99bd('0x1f')]);}_0x5903aa[_0x99bd('0x36')]=qs[_0x99bd('0x37')](_0x1af1e6[_0x99bd('0x30')]['sort']);_0x5903aa[_0x99bd('0x38')]=qs[_0x99bd('0x39')](_[_0x99bd('0x3a')](_0x1af1e6[_0x99bd('0x30')],_0x957d48['filters']),_0x2250d8);if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]){_0x5903aa[_0x99bd('0x38')]=_[_0x99bd('0x3c')](_0x5903aa['where'],{'$or':_[_0x99bd('0x3d')](_0x2250d8,function(_0x3d2b0f){if(_0x3d2b0f[_0x99bd('0x2d')]!==_0x99bd('0x3e')){var _0x7e29ec={};_0x7e29ec[_0x3d2b0f[_0x99bd('0x28')]]={'$like':'%'+_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x3b')]+'%'};return _0x7e29ec;}})});}_0x5903aa=_[_0x99bd('0x3c')]({},_0x5903aa,_0x1af1e6[_0x99bd('0x3f')]);var _0x2fcf71={'where':_0x5903aa[_0x99bd('0x38')]};return db[_0x99bd('0x2a')]['count'](_0x2fcf71)[_0x99bd('0x26')](function(_0x1ecdd6){_0x1d0642[_0x99bd('0x22')]=_0x1ecdd6;if(_0x1af1e6[_0x99bd('0x30')][_0x99bd('0x40')]){_0x5903aa[_0x99bd('0x41')]=[{'all':!![]}];}return db[_0x99bd('0x2a')][_0x99bd('0x42')](_0x5903aa);})[_0x99bd('0x26')](function(_0x7e84b1){_0x1d0642[_0x99bd('0x43')]=_0x7e84b1;return _0x1d0642;})[_0x99bd('0x26')](respondWithFilteredResult(_0x1eabb9,_0x5903aa))[_0x99bd('0x44')](handleError(_0x1eabb9,null));};exports[_0x99bd('0x45')]=function(_0xb0ffe5,_0x2d91be){var _0x369fb5={'raw':!![],'where':{'id':_0xb0ffe5[_0x99bd('0x46')]['id']}},_0x5a4a96={};_0x5a4a96[_0x99bd('0x2f')]=_[_0x99bd('0x47')](db[_0x99bd('0x2a')][_0x99bd('0x2b')]);_0x5a4a96[_0x99bd('0x30')]=_[_0x99bd('0x47')](_0xb0ffe5[_0x99bd('0x30')]);_0x5a4a96['filters']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],_0x5a4a96[_0x99bd('0x30')]);_0x369fb5['attributes']=_[_0x99bd('0x32')](_0x5a4a96[_0x99bd('0x2f')],qs[_0x99bd('0x33')](_0xb0ffe5['query'][_0x99bd('0x33')]));_0x369fb5['attributes']=_0x369fb5['attributes']['length']?_0x369fb5[_0x99bd('0x31')]:_0x5a4a96[_0x99bd('0x2f')];if(_0xb0ffe5[_0x99bd('0x30')]['includeAll']){_0x369fb5[_0x99bd('0x41')]=[{'all':!![]}];}_0x369fb5=_[_0x99bd('0x3c')]({},_0x369fb5,_0xb0ffe5[_0x99bd('0x3f')]);return db['ChatQueueReport'][_0x99bd('0x48')](_0x369fb5)[_0x99bd('0x26')](handleEntityNotFound(_0x2d91be,null))['then'](respondWithResult(_0x2d91be,null))['catch'](handleError(_0x2d91be,null));};exports[_0x99bd('0x49')]=function(_0x1d7ec0,_0x3487c6){return db['ChatQueueReport']['create'](_0x1d7ec0[_0x99bd('0x4a')],{})[_0x99bd('0x26')](respondWithResult(_0x3487c6,0xc9))[_0x99bd('0x44')](handleError(_0x3487c6,null));};exports['update']=function(_0x3fa8e1,_0x4e71b3){if(_0x3fa8e1[_0x99bd('0x4a')]['id']){delete _0x3fa8e1[_0x99bd('0x4a')]['id'];}return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x3fa8e1[_0x99bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x4e71b3,null))[_0x99bd('0x26')](saveUpdates(_0x3fa8e1['body'],null))[_0x99bd('0x26')](respondWithResult(_0x4e71b3,null))[_0x99bd('0x44')](handleError(_0x4e71b3,null));};exports[_0x99bd('0x4b')]=function(_0x1912ac,_0x2100c7){return db[_0x99bd('0x2a')][_0x99bd('0x48')]({'where':{'id':_0x1912ac['params']['id']}})['then'](handleEntityNotFound(_0x2100c7,null))[_0x99bd('0x26')](removeEntity(_0x2100c7,null))[_0x99bd('0x44')](handleError(_0x2100c7,null));};exports[_0x99bd('0x4c')]=function(_0x2f0fb7,_0x25c67d){return db[_0x99bd('0x2a')][_0x99bd('0x4c')]()['then'](respondWithResult(_0x25c67d,null))['catch'](handleError(_0x25c67d,null));}; \ No newline at end of file +var _0xbccd=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','ChatQueueReport','findAll','params','keys','length','find','create','catch','body','describe'];(function(_0x444af1,_0x117b28){var _0x3f137f=function(_0x4a8d06){while(--_0x4a8d06){_0x444af1['push'](_0x444af1['shift']());}};_0x3f137f(++_0x117b28);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xbccd[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xdbcc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdbcc('0x1'));var rp=require(_0xdbcc('0x2'));var moment=require(_0xdbcc('0x3'));var BPromise=require(_0xdbcc('0x4'));var Mustache=require(_0xdbcc('0x5'));var util=require(_0xdbcc('0x6'));var path=require('path');var sox=require(_0xdbcc('0x7'));var csv=require(_0xdbcc('0x8'));var ejs=require(_0xdbcc('0x9'));var fs=require('fs');var fs_extra=require(_0xdbcc('0xa'));var _=require(_0xdbcc('0xb'));var squel=require(_0xdbcc('0xc'));var crypto=require(_0xdbcc('0xd'));var jsforce=require(_0xdbcc('0xe'));var deskjs=require(_0xdbcc('0xf'));var toCsv=require(_0xdbcc('0x8'));var querystring=require(_0xdbcc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbcc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdbcc('0x12'));var hardwareService=require(_0xdbcc('0x13'));var logger=require(_0xdbcc('0x14'))(_0xdbcc('0x15'));var utils=require(_0xdbcc('0x16'));var config=require(_0xdbcc('0x17'));var licenseUtil=require(_0xdbcc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fbd02,_0x4c8384){_0x4c8384=_0x4c8384||0xcc;return function(_0x52b3bf){if(_0x52b3bf){return _0x2fbd02['sendStatus'](_0x4c8384);}return _0x2fbd02[_0xdbcc('0x19')](_0x4c8384)[_0xdbcc('0x1a')]();};}function respondWithResult(_0x290b93,_0xa799eb){_0xa799eb=_0xa799eb||0xc8;return function(_0x381f22){if(_0x381f22){return _0x290b93[_0xdbcc('0x19')](_0xa799eb)[_0xdbcc('0x1b')](_0x381f22);}};}function respondWithFilteredResult(_0x4649d2,_0x5c53a1){return function(_0x5688ce){if(_0x5688ce){var _0x2b189a=typeof _0x5c53a1[_0xdbcc('0x1c')]===_0xdbcc('0x1d')&&typeof _0x5c53a1[_0xdbcc('0x1e')]===_0xdbcc('0x1d');var _0x2df00c=_0x5688ce[_0xdbcc('0x1f')];var _0x3bfeb0=_0x2b189a?0x0:_0x5c53a1[_0xdbcc('0x1c')];var _0x3d9bda=_0x2b189a?_0x5688ce[_0xdbcc('0x1f')]:_0x5c53a1[_0xdbcc('0x1c')]+_0x5c53a1[_0xdbcc('0x1e')];var _0x4dd404;if(_0x3d9bda>=_0x2df00c){_0x3d9bda=_0x2df00c;_0x4dd404=0xc8;}else{_0x4dd404=0xce;}_0x4649d2['status'](_0x4dd404);return _0x4649d2[_0xdbcc('0x20')](_0xdbcc('0x21'),_0x3bfeb0+'-'+_0x3d9bda+'/'+_0x2df00c)['json'](_0x5688ce);}return null;};}function patchUpdates(_0x447f70){return function(_0x47990b){try{jsonpatch[_0xdbcc('0x22')](_0x47990b,_0x447f70,!![]);}catch(_0x500ec4){return BPromise['reject'](_0x500ec4);}return _0x47990b[_0xdbcc('0x23')]();};}function saveUpdates(_0x3c321f,_0x40d7d0){return function(_0x6eee38){if(_0x6eee38){return _0x6eee38[_0xdbcc('0x24')](_0x3c321f)[_0xdbcc('0x25')](function(_0x2d797a){return _0x2d797a;});}return null;};}function removeEntity(_0x18d47f,_0x591962){return function(_0x343523){if(_0x343523){return _0x343523['destroy']()[_0xdbcc('0x25')](function(){_0x18d47f[_0xdbcc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d76d,_0xb2a8b4){return function(_0x2df594){if(!_0x2df594){_0x18d76d['sendStatus'](0x194);}return _0x2df594;};}function handleError(_0x50e23c,_0xbe9ba3){_0xbe9ba3=_0xbe9ba3||0x1f4;return function(_0x17e223){logger[_0xdbcc('0x26')](_0x17e223['stack']);if(_0x17e223[_0xdbcc('0x27')]){delete _0x17e223[_0xdbcc('0x27')];}_0x50e23c['status'](_0xbe9ba3)[_0xdbcc('0x28')](_0x17e223);};}exports[_0xdbcc('0x29')]=function(_0x26cf3a,_0x59b175){var _0x31412c={},_0x548047={},_0x1b4425={'count':0x0,'rows':[]};var _0x57d722=_[_0xdbcc('0x2a')](db['ChatQueueReport'][_0xdbcc('0x2b')],function(_0x38b9ac){return{'name':_0x38b9ac[_0xdbcc('0x2c')],'type':_0x38b9ac[_0xdbcc('0x2d')][_0xdbcc('0x2e')]};});_0x548047[_0xdbcc('0x2f')]=_[_0xdbcc('0x2a')](_0x57d722,'name');_0x548047[_0xdbcc('0x30')]=_['keys'](_0x26cf3a[_0xdbcc('0x30')]);_0x548047['filters']=_['intersection'](_0x548047[_0xdbcc('0x2f')],_0x548047[_0xdbcc('0x30')]);_0x31412c['attributes']=_[_0xdbcc('0x31')](_0x548047['model'],qs[_0xdbcc('0x32')](_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x32')]));_0x31412c[_0xdbcc('0x33')]=_0x31412c[_0xdbcc('0x33')]['length']?_0x31412c[_0xdbcc('0x33')]:_0x548047[_0xdbcc('0x2f')];if(!_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x34')]('nolimit')){_0x31412c['limit']=qs[_0xdbcc('0x1e')](_0x26cf3a['query']['limit']);_0x31412c[_0xdbcc('0x1c')]=qs[_0xdbcc('0x1c')](_0x26cf3a[_0xdbcc('0x30')]['offset']);}_0x31412c['order']=qs[_0xdbcc('0x35')](_0x26cf3a[_0xdbcc('0x30')]['sort']);_0x31412c['where']=qs[_0xdbcc('0x36')](_[_0xdbcc('0x37')](_0x26cf3a[_0xdbcc('0x30')],_0x548047[_0xdbcc('0x36')]),_0x57d722);if(_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]){_0x31412c[_0xdbcc('0x39')]=_['merge'](_0x31412c[_0xdbcc('0x39')],{'$or':_['map'](_0x57d722,function(_0x2826d5){if(_0x2826d5[_0xdbcc('0x2d')]!=='VIRTUAL'){var _0xfc5684={};_0xfc5684[_0x2826d5[_0xdbcc('0x27')]]={'$like':'%'+_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]+'%'};return _0xfc5684;}})});}_0x31412c=_[_0xdbcc('0x3a')]({},_0x31412c,_0x26cf3a[_0xdbcc('0x3b')]);var _0x193651={'where':_0x31412c[_0xdbcc('0x39')]};return db['ChatQueueReport'][_0xdbcc('0x1f')](_0x193651)[_0xdbcc('0x25')](function(_0x298e63){_0x1b4425[_0xdbcc('0x1f')]=_0x298e63;if(_0x26cf3a['query'][_0xdbcc('0x3c')]){_0x31412c[_0xdbcc('0x3d')]=[{'all':!![]}];}return db[_0xdbcc('0x3e')][_0xdbcc('0x3f')](_0x31412c);})[_0xdbcc('0x25')](function(_0x24b4d5){_0x1b4425['rows']=_0x24b4d5;return _0x1b4425;})[_0xdbcc('0x25')](respondWithFilteredResult(_0x59b175,_0x31412c))['catch'](handleError(_0x59b175,null));};exports['show']=function(_0x3d4371,_0x3de65f){var _0x1c1ea8={'raw':!![],'where':{'id':_0x3d4371[_0xdbcc('0x40')]['id']}},_0x5c32db={};_0x5c32db['model']=_[_0xdbcc('0x41')](db[_0xdbcc('0x3e')][_0xdbcc('0x2b')]);_0x5c32db['query']=_[_0xdbcc('0x41')](_0x3d4371[_0xdbcc('0x30')]);_0x5c32db[_0xdbcc('0x36')]=_['intersection'](_0x5c32db[_0xdbcc('0x2f')],_0x5c32db[_0xdbcc('0x30')]);_0x1c1ea8['attributes']=_[_0xdbcc('0x31')](_0x5c32db[_0xdbcc('0x2f')],qs[_0xdbcc('0x32')](_0x3d4371['query'][_0xdbcc('0x32')]));_0x1c1ea8[_0xdbcc('0x33')]=_0x1c1ea8[_0xdbcc('0x33')][_0xdbcc('0x42')]?_0x1c1ea8['attributes']:_0x5c32db[_0xdbcc('0x2f')];if(_0x3d4371[_0xdbcc('0x30')]['includeAll']){_0x1c1ea8[_0xdbcc('0x3d')]=[{'all':!![]}];}_0x1c1ea8=_[_0xdbcc('0x3a')]({},_0x1c1ea8,_0x3d4371[_0xdbcc('0x3b')]);return db['ChatQueueReport'][_0xdbcc('0x43')](_0x1c1ea8)[_0xdbcc('0x25')](handleEntityNotFound(_0x3de65f,null))[_0xdbcc('0x25')](respondWithResult(_0x3de65f,null))['catch'](handleError(_0x3de65f,null));};exports[_0xdbcc('0x44')]=function(_0x301f00,_0x2b2172){return db[_0xdbcc('0x3e')]['create'](_0x301f00['body'],{})[_0xdbcc('0x25')](respondWithResult(_0x2b2172,0xc9))[_0xdbcc('0x45')](handleError(_0x2b2172,null));};exports[_0xdbcc('0x24')]=function(_0x5da133,_0x16f783){if(_0x5da133[_0xdbcc('0x46')]['id']){delete _0x5da133[_0xdbcc('0x46')]['id'];}return db[_0xdbcc('0x3e')]['find']({'where':{'id':_0x5da133[_0xdbcc('0x40')]['id']}})[_0xdbcc('0x25')](handleEntityNotFound(_0x16f783,null))[_0xdbcc('0x25')](saveUpdates(_0x5da133[_0xdbcc('0x46')],null))[_0xdbcc('0x25')](respondWithResult(_0x16f783,null))[_0xdbcc('0x45')](handleError(_0x16f783,null));};exports['destroy']=function(_0x534063,_0x1470e9){return db['ChatQueueReport'][_0xdbcc('0x43')]({'where':{'id':_0x534063['params']['id']}})['then'](handleEntityNotFound(_0x1470e9,null))[_0xdbcc('0x25')](removeEntity(_0x1470e9,null))['catch'](handleError(_0x1470e9,null));};exports[_0xdbcc('0x47')]=function(_0xe005aa,_0x5e2656){return db[_0xdbcc('0x3e')][_0xdbcc('0x47')]()['then'](respondWithResult(_0x5e2656,null))[_0xdbcc('0x45')](handleError(_0x5e2656,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 98198dc..2977911 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0xc471d2,_0x26ab16){var _0x334c68=function(_0x2deae4){while(--_0x2deae4){_0xc471d2['push'](_0xc471d2['shift']());}};_0x334c68(++_0x26ab16);}(_0xe706,0xa3));var _0x6e70=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0xe706[_0x3747ae];return _0x339035;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x31f5b0,_0x3ceb60){var _0x25dfd3=function(_0x4f81da){while(--_0x4f81da){_0x31f5b0['push'](_0x31f5b0['shift']());}};_0x25dfd3(++_0x3ceb60);}(_0xe706,0xa3));var _0x6e70=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0xe706[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 68ed440..db24446 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 _0x502a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','limit','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x502a,0x1df));var _0xa502=function(_0xb0b376,_0x4bc0a3){_0xb0b376=_0xb0b376-0x0;var _0xe274=_0x502a[_0xb0b376];return _0xe274;};'use strict';var _=require('lodash');var util=require(_0xa502('0x0'));var moment=require(_0xa502('0x1'));var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require(_0xa502('0x4'));var db=require(_0xa502('0x5'))['db'];var utils=require(_0xa502('0x6'));var logger=require(_0xa502('0x7'))(_0xa502('0x8'));var config=require(_0xa502('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa502('0xa')][_0xa502('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39df41,_0x1e5600,_0x2e102b){return new BPromise(function(_0x5f463a,_0x2a70f3){return client['request'](_0x39df41,_0x2e102b)[_0xa502('0xc')](function(_0x305a4b){logger['info'](_0xa502('0xd'),_0x1e5600,_0xa502('0xe'));logger[_0xa502('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1e5600,'request\x20sent',JSON[_0xa502('0x10')](_0x305a4b));if(_0x305a4b[_0xa502('0x11')]){if(_0x305a4b[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1e5600,_0x305a4b['error'][_0xa502('0x13')]);return _0x2a70f3(_0x305a4b[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')](_0xa502('0xd'),_0x1e5600,_0x305a4b[_0xa502('0x11')]['message']);return _0x5f463a(_0x305a4b['error'][_0xa502('0x13')]);}else{logger[_0xa502('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x1e5600,_0xa502('0xe'));_0x5f463a(_0x305a4b['result'][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x2e37f8){logger[_0xa502('0x11')](_0xa502('0xd'),_0x1e5600,_0x2e37f8);_0x2a70f3(_0x2e37f8);});});}exports[_0xa502('0x16')]=function(_0x69ac3b){var _0x3b7719=this;return new Promise(function(_0x377739,_0xe4fe73){return db[_0xa502('0x17')][_0xa502('0x18')](_0x69ac3b[_0xa502('0x19')],{'raw':_0x69ac3b[_0xa502('0x1a')]?_0x69ac3b['options']['raw']===undefined?!![]:![]:!![]})[_0xa502('0xc')](function(_0x2d9060){logger['info'](_0xa502('0x16'),_0x69ac3b);logger['debug'](_0xa502('0x16'),_0x69ac3b,JSON[_0xa502('0x10')](_0x2d9060));_0x377739(_0x2d9060);})[_0xa502('0x15')](function(_0x3459e4){logger[_0xa502('0x11')]('CreateChatQueueReport',_0x3459e4[_0xa502('0x13')],_0x69ac3b);_0xe4fe73(_0x3b7719['error'](0x1f4,_0x3459e4[_0xa502('0x13')]));});});};exports[_0xa502('0x1b')]=function(_0x3492c6){var _0x2819e1=this;return new Promise(function(_0x9c55fb,_0x405ae0){return db[_0xa502('0x17')][_0xa502('0x1c')](_0x3492c6[_0xa502('0x19')],{'raw':_0x3492c6['options']?_0x3492c6[_0xa502('0x1a')][_0xa502('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3492c6['options']?_0x3492c6[_0xa502('0x1a')][_0xa502('0x1e')]||null:null,'attributes':_0x3492c6['options']?_0x3492c6[_0xa502('0x1a')]['attributes']||null:null,'limit':_0x3492c6[_0xa502('0x1a')]?_0x3492c6[_0xa502('0x1a')][_0xa502('0x1f')]||null:null})['then'](function(_0x577861){logger['info']('UpdateChatQueueReport',_0x3492c6);logger['debug']('UpdateChatQueueReport',_0x3492c6,JSON['stringify'](_0x577861));_0x9c55fb(_0x577861);})[_0xa502('0x15')](function(_0x13c432){logger[_0xa502('0x11')](_0xa502('0x1b'),_0x13c432['message'],_0x3492c6);_0x405ae0(_0x2819e1[_0xa502('0x11')](0x1f4,_0x13c432[_0xa502('0x13')]));});});}; \ No newline at end of file +var _0xdc91=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x581feb,_0x475a85){var _0x29fe1a=function(_0x34b44d){while(--_0x34b44d){_0x581feb['push'](_0x581feb['shift']());}};_0x29fe1a(++_0x475a85);}(_0xdc91,0x10c));var _0x1dc9=function(_0x2da629,_0x1b1f12){_0x2da629=_0x2da629-0x0;var _0x34b6f7=_0xdc91[_0x2da629];return _0x34b6f7;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require(_0x1dc9('0x2'));var BPromise=require(_0x1dc9('0x3'));var rs=require(_0x1dc9('0x4'));var fs=require('fs');var Redis=require(_0x1dc9('0x5'));var db=require(_0x1dc9('0x6'))['db'];var utils=require(_0x1dc9('0x7'));var logger=require(_0x1dc9('0x8'))(_0x1dc9('0x9'));var config=require(_0x1dc9('0xa'));var jayson=require(_0x1dc9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x358946,_0x3323f,_0x598916){return new BPromise(function(_0x549f73,_0xf6e540){return client[_0x1dc9('0xc')](_0x358946,_0x598916)[_0x1dc9('0xd')](function(_0x3c074b){logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));logger[_0x1dc9('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3323f,_0x1dc9('0x10'),JSON[_0x1dc9('0x12')](_0x3c074b));if(_0x3c074b[_0x1dc9('0x13')]){if(_0x3c074b['error'][_0x1dc9('0x14')]===0x1f4){logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')][_0x1dc9('0x15')]);return _0xf6e540(_0x3c074b['error'][_0x1dc9('0x15')]);}logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')]['message']);return _0x549f73(_0x3c074b['error'][_0x1dc9('0x15')]);}else{logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));_0x549f73(_0x3c074b[_0x1dc9('0x16')][_0x1dc9('0x15')]);}})[_0x1dc9('0x17')](function(_0x30f908){logger[_0x1dc9('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x3323f,_0x30f908);_0xf6e540(_0x30f908);});});}exports[_0x1dc9('0x18')]=function(_0x460bae){var _0x4b7123=this;return new Promise(function(_0x230148,_0x5553d6){return db[_0x1dc9('0x19')]['create'](_0x460bae['body'],{'raw':_0x460bae[_0x1dc9('0x1a')]?_0x460bae['options'][_0x1dc9('0x1b')]===undefined?!![]:![]:!![]})[_0x1dc9('0xd')](function(_0x197e1c){logger[_0x1dc9('0xe')](_0x1dc9('0x18'),_0x460bae);logger[_0x1dc9('0x11')]('CreateChatQueueReport',_0x460bae,JSON['stringify'](_0x197e1c));_0x230148(_0x197e1c);})[_0x1dc9('0x17')](function(_0x586886){logger[_0x1dc9('0x13')](_0x1dc9('0x18'),_0x586886[_0x1dc9('0x15')],_0x460bae);_0x5553d6(_0x4b7123[_0x1dc9('0x13')](0x1f4,_0x586886[_0x1dc9('0x15')]));});});};exports[_0x1dc9('0x1c')]=function(_0x27011a){var _0x1a2dd4=this;return new Promise(function(_0x5babc9,_0x2159c7){return db[_0x1dc9('0x19')][_0x1dc9('0x1d')](_0x27011a[_0x1dc9('0x1e')],{'raw':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1f')]||null:null,'attributes':_0x27011a['options']?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x20')]||null:null,'limit':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x21')]||null:null})['then'](function(_0x2a6893){logger[_0x1dc9('0xe')]('UpdateChatQueueReport',_0x27011a);logger[_0x1dc9('0x11')](_0x1dc9('0x1c'),_0x27011a,JSON['stringify'](_0x2a6893));_0x5babc9(_0x2a6893);})[_0x1dc9('0x17')](function(_0x3d4a94){logger[_0x1dc9('0x13')](_0x1dc9('0x1c'),_0x3d4a94[_0x1dc9('0x15')],_0x27011a);_0x2159c7(_0x1a2dd4['error'](0x1f4,_0x3d4a94[_0x1dc9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 20fbc9e..ac145e3 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 _0x735f=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x556f1f,_0x2897d){var _0x3ade22=function(_0x1c8284){while(--_0x1c8284){_0x556f1f['push'](_0x556f1f['shift']());}};_0x3ade22(++_0x2897d);}(_0x735f,0x179));var _0xf735=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x735f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf735('0x0'));var util=require(_0xf735('0x1'));var path=require(_0xf735('0x2'));var timeout=require(_0xf735('0x3'));var express=require(_0xf735('0x4'));var router=express[_0xf735('0x5')]();var fs_extra=require(_0xf735('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf735('0x7'));var config=require(_0xf735('0x8'));var controller=require(_0xf735('0x9'));router[_0xf735('0xa')]('/',auth[_0xf735('0xb')](),controller[_0xf735('0xc')]);router[_0xf735('0xa')](_0xf735('0xd'),auth[_0xf735('0xb')](),controller[_0xf735('0xe')]);router[_0xf735('0xa')](_0xf735('0xf'),auth[_0xf735('0xb')](),controller[_0xf735('0x10')]);router[_0xf735('0x11')]('/',auth[_0xf735('0xb')](),controller[_0xf735('0x12')]);router[_0xf735('0x13')](_0xf735('0xf'),auth[_0xf735('0xb')](),controller[_0xf735('0x14')]);router[_0xf735('0x15')](_0xf735('0xf'),auth['isAuthenticated'](),controller[_0xf735('0x16')]);module[_0xf735('0x17')]=router; \ No newline at end of file +var _0x56da=['delete','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x562bc8,_0x1b1c19){var _0x2a37d3=function(_0x180ba9){while(--_0x180ba9){_0x562bc8['push'](_0x562bc8['shift']());}};_0x2a37d3(++_0x1b1c19);}(_0x56da,0x1e1));var _0xa56d=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x56da[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require('multer');var util=require(_0xa56d('0x0'));var path=require('path');var timeout=require(_0xa56d('0x1'));var express=require(_0xa56d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa56d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa56d('0x4'));var controller=require(_0xa56d('0x5'));router[_0xa56d('0x6')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0x8')]);router[_0xa56d('0x6')]('/describe',auth[_0xa56d('0x7')](),controller['describe']);router[_0xa56d('0x6')]('/:id',auth[_0xa56d('0x7')](),controller[_0xa56d('0x9')]);router[_0xa56d('0xa')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0xb')]);router[_0xa56d('0xc')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller[_0xa56d('0xe')]);router[_0xa56d('0xf')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 6e8cb4f..0fcd93d 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(_0x2933d1,_0x34a4e5){var _0x45134e=function(_0x341d04){while(--_0x341d04){_0x2933d1['push'](_0x2933d1['shift']());}};_0x45134e(++_0x34a4e5);}(_0x70e0,0x17b));var _0x070e=function(_0xe5708b,_0x45df1c){_0xe5708b=_0xe5708b-0x0;var _0x41bad8=_0x70e0[_0xe5708b];return _0x41bad8;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4918c6,_0x5cc45a){var _0x585f66=function(_0xfacd7f){while(--_0xfacd7f){_0x4918c6['push'](_0x4918c6['shift']());}};_0x585f66(++_0x5cc45a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xf3cd[_0x434783];return _0x13efcf;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index a6df224..608bf99 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 _0x6d38=['fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','limit','count','offset','json','apply','reject','save','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ChatTransferReport','rows','show','params','includeAll','include','find','catch','create','body','update','describe','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x4f3f94,_0x386c38){var _0xbb95d5=function(_0x15cba5){while(--_0x15cba5){_0x4f3f94['push'](_0x4f3f94['shift']());}};_0xbb95d5(++_0x386c38);}(_0x6d38,0xc4));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x86d3('0x0'));var rp=require('request-promise');var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var Mustache=require(_0x86d3('0x3'));var util=require('util');var path=require(_0x86d3('0x4'));var sox=require(_0x86d3('0x5'));var csv=require(_0x86d3('0x6'));var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require('lodash');var squel=require(_0x86d3('0x9'));var crypto=require(_0x86d3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x86d3('0xc'));var Papa=require(_0x86d3('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x86d3('0xe'));var hardwareService=require(_0x86d3('0xf'));var logger=require('../../config/logger')(_0x86d3('0x10'));var utils=require(_0x86d3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x86d3('0x12'));var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0xbcf7b4,_0xc3c0a5){_0xc3c0a5=_0xc3c0a5||0xcc;return function(_0x1c37f1){if(_0x1c37f1){return _0xbcf7b4['sendStatus'](_0xc3c0a5);}return _0xbcf7b4[_0x86d3('0x14')](_0xc3c0a5)[_0x86d3('0x15')]();};}function respondWithResult(_0x563f0b,_0x2983e2){_0x2983e2=_0x2983e2||0xc8;return function(_0x20ee25){if(_0x20ee25){return _0x563f0b[_0x86d3('0x14')](_0x2983e2)['json'](_0x20ee25);}};}function respondWithFilteredResult(_0x488c57,_0x58f969){return function(_0x361ac8){if(_0x361ac8){var _0x47814a=typeof _0x58f969['offset']==='undefined'&&typeof _0x58f969[_0x86d3('0x16')]==='undefined';var _0x495cd6=_0x361ac8[_0x86d3('0x17')];var _0x1c75d=_0x47814a?0x0:_0x58f969[_0x86d3('0x18')];var _0x12e428=_0x47814a?_0x361ac8['count']:_0x58f969[_0x86d3('0x18')]+_0x58f969['limit'];var _0x1d622f;if(_0x12e428>=_0x495cd6){_0x12e428=_0x495cd6;_0x1d622f=0xc8;}else{_0x1d622f=0xce;}_0x488c57['status'](_0x1d622f);return _0x488c57['set']('Content-Range',_0x1c75d+'-'+_0x12e428+'/'+_0x495cd6)[_0x86d3('0x19')](_0x361ac8);}return null;};}function patchUpdates(_0x202497){return function(_0x3d18a6){try{jsonpatch[_0x86d3('0x1a')](_0x3d18a6,_0x202497,!![]);}catch(_0x525360){return BPromise[_0x86d3('0x1b')](_0x525360);}return _0x3d18a6[_0x86d3('0x1c')]();};}function saveUpdates(_0x268fff,_0x5f41af){return function(_0x1c68c9){if(_0x1c68c9){return _0x1c68c9['update'](_0x268fff)[_0x86d3('0x1d')](function(_0x12b7f2){return _0x12b7f2;});}return null;};}function removeEntity(_0x2988fd,_0x3fd4a6){return function(_0x3864c0){if(_0x3864c0){return _0x3864c0[_0x86d3('0x1e')]()[_0x86d3('0x1d')](function(){_0x2988fd[_0x86d3('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb0a5d7,_0x17d02b){return function(_0x1a700d){if(!_0x1a700d){_0xb0a5d7[_0x86d3('0x1f')](0x194);}return _0x1a700d;};}function handleError(_0x42741c,_0x40c2b9){_0x40c2b9=_0x40c2b9||0x1f4;return function(_0x16d5aa){logger[_0x86d3('0x20')](_0x16d5aa['stack']);if(_0x16d5aa['name']){delete _0x16d5aa[_0x86d3('0x21')];}_0x42741c[_0x86d3('0x14')](_0x40c2b9)['send'](_0x16d5aa);};}exports[_0x86d3('0x22')]=function(_0x355dd1,_0x10e170){var _0xfd4e95={},_0x22c288={},_0xc2b227={'count':0x0,'rows':[]};var _0x22d52f=_[_0x86d3('0x23')](db['ChatTransferReport'][_0x86d3('0x24')],function(_0x5686db){return{'name':_0x5686db[_0x86d3('0x25')],'type':_0x5686db[_0x86d3('0x26')][_0x86d3('0x27')]};});_0x22c288[_0x86d3('0x28')]=_[_0x86d3('0x23')](_0x22d52f,_0x86d3('0x21'));_0x22c288[_0x86d3('0x29')]=_[_0x86d3('0x2a')](_0x355dd1['query']);_0x22c288[_0x86d3('0x2b')]=_[_0x86d3('0x2c')](_0x22c288[_0x86d3('0x28')],_0x22c288[_0x86d3('0x29')]);_0xfd4e95[_0x86d3('0x2d')]=_['intersection'](_0x22c288['model'],qs[_0x86d3('0x2e')](_0x355dd1['query']['fields']));_0xfd4e95[_0x86d3('0x2d')]=_0xfd4e95['attributes'][_0x86d3('0x2f')]?_0xfd4e95['attributes']:_0x22c288['model'];if(!_0x355dd1['query'][_0x86d3('0x30')](_0x86d3('0x31'))){_0xfd4e95[_0x86d3('0x16')]=qs[_0x86d3('0x16')](_0x355dd1[_0x86d3('0x29')][_0x86d3('0x16')]);_0xfd4e95['offset']=qs[_0x86d3('0x18')](_0x355dd1['query'][_0x86d3('0x18')]);}_0xfd4e95['order']=qs[_0x86d3('0x32')](_0x355dd1[_0x86d3('0x29')][_0x86d3('0x32')]);_0xfd4e95[_0x86d3('0x33')]=qs[_0x86d3('0x2b')](_[_0x86d3('0x34')](_0x355dd1['query'],_0x22c288[_0x86d3('0x2b')]),_0x22d52f);if(_0x355dd1[_0x86d3('0x29')][_0x86d3('0x35')]){_0xfd4e95['where']=_[_0x86d3('0x36')](_0xfd4e95[_0x86d3('0x33')],{'$or':_[_0x86d3('0x23')](_0x22d52f,function(_0x3f4365){if(_0x3f4365['type']!=='VIRTUAL'){var _0x43fff6={};_0x43fff6[_0x3f4365['name']]={'$like':'%'+_0x355dd1[_0x86d3('0x29')][_0x86d3('0x35')]+'%'};return _0x43fff6;}})});}_0xfd4e95=_[_0x86d3('0x36')]({},_0xfd4e95,_0x355dd1[_0x86d3('0x37')]);var _0x3db251={'where':_0xfd4e95[_0x86d3('0x33')]};return db[_0x86d3('0x38')][_0x86d3('0x17')](_0x3db251)[_0x86d3('0x1d')](function(_0x1baef4){_0xc2b227[_0x86d3('0x17')]=_0x1baef4;if(_0x355dd1[_0x86d3('0x29')]['includeAll']){_0xfd4e95['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0xfd4e95);})[_0x86d3('0x1d')](function(_0x4a148e){_0xc2b227[_0x86d3('0x39')]=_0x4a148e;return _0xc2b227;})[_0x86d3('0x1d')](respondWithFilteredResult(_0x10e170,_0xfd4e95))['catch'](handleError(_0x10e170,null));};exports[_0x86d3('0x3a')]=function(_0x20b48a,_0x46c557){var _0x32b7a0={'raw':!![],'where':{'id':_0x20b48a[_0x86d3('0x3b')]['id']}},_0x1993ab={};_0x1993ab[_0x86d3('0x28')]=_[_0x86d3('0x2a')](db[_0x86d3('0x38')][_0x86d3('0x24')]);_0x1993ab[_0x86d3('0x29')]=_[_0x86d3('0x2a')](_0x20b48a[_0x86d3('0x29')]);_0x1993ab[_0x86d3('0x2b')]=_['intersection'](_0x1993ab['model'],_0x1993ab[_0x86d3('0x29')]);_0x32b7a0[_0x86d3('0x2d')]=_[_0x86d3('0x2c')](_0x1993ab['model'],qs['fields'](_0x20b48a['query'][_0x86d3('0x2e')]));_0x32b7a0[_0x86d3('0x2d')]=_0x32b7a0[_0x86d3('0x2d')]['length']?_0x32b7a0['attributes']:_0x1993ab[_0x86d3('0x28')];if(_0x20b48a['query'][_0x86d3('0x3c')]){_0x32b7a0[_0x86d3('0x3d')]=[{'all':!![]}];}_0x32b7a0=_['merge']({},_0x32b7a0,_0x20b48a[_0x86d3('0x37')]);return db[_0x86d3('0x38')][_0x86d3('0x3e')](_0x32b7a0)[_0x86d3('0x1d')](handleEntityNotFound(_0x46c557,null))[_0x86d3('0x1d')](respondWithResult(_0x46c557,null))[_0x86d3('0x3f')](handleError(_0x46c557,null));};exports[_0x86d3('0x40')]=function(_0x231a46,_0x2ee6a6){return db[_0x86d3('0x38')][_0x86d3('0x40')](_0x231a46[_0x86d3('0x41')],{})['then'](respondWithResult(_0x2ee6a6,0xc9))[_0x86d3('0x3f')](handleError(_0x2ee6a6,null));};exports[_0x86d3('0x42')]=function(_0x50987d,_0x2d9b4d){if(_0x50987d[_0x86d3('0x41')]['id']){delete _0x50987d['body']['id'];}return db[_0x86d3('0x38')][_0x86d3('0x3e')]({'where':{'id':_0x50987d['params']['id']}})[_0x86d3('0x1d')](handleEntityNotFound(_0x2d9b4d,null))['then'](saveUpdates(_0x50987d[_0x86d3('0x41')],null))[_0x86d3('0x1d')](respondWithResult(_0x2d9b4d,null))[_0x86d3('0x3f')](handleError(_0x2d9b4d,null));};exports[_0x86d3('0x1e')]=function(_0x9c3996,_0x58864e){return db['ChatTransferReport']['find']({'where':{'id':_0x9c3996[_0x86d3('0x3b')]['id']}})[_0x86d3('0x1d')](handleEntityNotFound(_0x58864e,null))[_0x86d3('0x1d')](removeEntity(_0x58864e,null))['catch'](handleError(_0x58864e,null));};exports['describe']=function(_0x1b7f13,_0xdadb50){return db[_0x86d3('0x38')][_0x86d3('0x43')]()[_0x86d3('0x1d')](respondWithResult(_0xdadb50,null))['catch'](handleError(_0xdadb50,null));}; \ No newline at end of file +var _0x0a3b=['util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','includeAll','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3ae3fe,_0x2f1ea3){var _0xf25a7f=function(_0x51c3cc){while(--_0x51c3cc){_0x3ae3fe['push'](_0x3ae3fe['shift']());}};_0xf25a7f(++_0x2f1ea3);}(_0x0a3b,0xdc));var _0xb0a3=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x0a3b[_0x43b06b];return _0x2c555b;};'use strict';var emlformat=require(_0xb0a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0a3('0x1'));var jsonpatch=require(_0xb0a3('0x2'));var rp=require(_0xb0a3('0x3'));var moment=require(_0xb0a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb0a3('0x5'));var path=require('path');var sox=require(_0xb0a3('0x6'));var csv=require(_0xb0a3('0x7'));var ejs=require(_0xb0a3('0x8'));var fs=require('fs');var fs_extra=require(_0xb0a3('0x9'));var _=require(_0xb0a3('0xa'));var squel=require('squel');var crypto=require(_0xb0a3('0xb'));var jsforce=require(_0xb0a3('0xc'));var deskjs=require(_0xb0a3('0xd'));var toCsv=require(_0xb0a3('0x7'));var querystring=require(_0xb0a3('0xe'));var Papa=require(_0xb0a3('0xf'));var Redis=require(_0xb0a3('0x10'));var authService=require(_0xb0a3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb0a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0a3('0x13'))(_0xb0a3('0x14'));var utils=require(_0xb0a3('0x15'));var config=require(_0xb0a3('0x16'));var licenseUtil=require(_0xb0a3('0x17'));var db=require(_0xb0a3('0x18'))['db'];function respondWithStatusCode(_0xd7d198,_0x35cbde){_0x35cbde=_0x35cbde||0xcc;return function(_0x537270){if(_0x537270){return _0xd7d198[_0xb0a3('0x19')](_0x35cbde);}return _0xd7d198['status'](_0x35cbde)[_0xb0a3('0x1a')]();};}function respondWithResult(_0x30b411,_0x1afb35){_0x1afb35=_0x1afb35||0xc8;return function(_0x5857df){if(_0x5857df){return _0x30b411[_0xb0a3('0x1b')](_0x1afb35)[_0xb0a3('0x1c')](_0x5857df);}};}function respondWithFilteredResult(_0x4280b9,_0x393752){return function(_0x3eb554){if(_0x3eb554){var _0x17f04f=typeof _0x393752[_0xb0a3('0x1d')]===_0xb0a3('0x1e')&&typeof _0x393752['limit']===_0xb0a3('0x1e');var _0x10d5de=_0x3eb554['count'];var _0x5d76ca=_0x17f04f?0x0:_0x393752['offset'];var _0x59d0ad=_0x17f04f?_0x3eb554[_0xb0a3('0x1f')]:_0x393752[_0xb0a3('0x1d')]+_0x393752['limit'];var _0x211c1d;if(_0x59d0ad>=_0x10d5de){_0x59d0ad=_0x10d5de;_0x211c1d=0xc8;}else{_0x211c1d=0xce;}_0x4280b9[_0xb0a3('0x1b')](_0x211c1d);return _0x4280b9[_0xb0a3('0x20')]('Content-Range',_0x5d76ca+'-'+_0x59d0ad+'/'+_0x10d5de)['json'](_0x3eb554);}return null;};}function patchUpdates(_0x5b1d72){return function(_0x3db119){try{jsonpatch[_0xb0a3('0x21')](_0x3db119,_0x5b1d72,!![]);}catch(_0x76acfc){return BPromise[_0xb0a3('0x22')](_0x76acfc);}return _0x3db119['save']();};}function saveUpdates(_0x399d33,_0x3403c4){return function(_0x40ca0f){if(_0x40ca0f){return _0x40ca0f[_0xb0a3('0x23')](_0x399d33)[_0xb0a3('0x24')](function(_0x522d49){return _0x522d49;});}return null;};}function removeEntity(_0x8c48d5,_0x26fbdf){return function(_0x56a1ba){if(_0x56a1ba){return _0x56a1ba[_0xb0a3('0x25')]()[_0xb0a3('0x24')](function(){_0x8c48d5['status'](0xcc)[_0xb0a3('0x1a')]();});}};}function handleEntityNotFound(_0xdd5a77,_0x5f47f6){return function(_0x209034){if(!_0x209034){_0xdd5a77[_0xb0a3('0x19')](0x194);}return _0x209034;};}function handleError(_0x1791cc,_0x4b08ab){_0x4b08ab=_0x4b08ab||0x1f4;return function(_0x2507aa){logger[_0xb0a3('0x26')](_0x2507aa['stack']);if(_0x2507aa[_0xb0a3('0x27')]){delete _0x2507aa[_0xb0a3('0x27')];}_0x1791cc['status'](_0x4b08ab)[_0xb0a3('0x28')](_0x2507aa);};}exports[_0xb0a3('0x29')]=function(_0x49a7d8,_0x3d2321){var _0x41fb72={},_0xc29a1b={},_0x4f17b1={'count':0x0,'rows':[]};var _0x967090=_[_0xb0a3('0x2a')](db[_0xb0a3('0x2b')][_0xb0a3('0x2c')],function(_0xd79238){return{'name':_0xd79238[_0xb0a3('0x2d')],'type':_0xd79238[_0xb0a3('0x2e')][_0xb0a3('0x2f')]};});_0xc29a1b[_0xb0a3('0x30')]=_[_0xb0a3('0x2a')](_0x967090,_0xb0a3('0x27'));_0xc29a1b['query']=_[_0xb0a3('0x31')](_0x49a7d8['query']);_0xc29a1b[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0xc29a1b[_0xb0a3('0x30')],_0xc29a1b[_0xb0a3('0x34')]);_0x41fb72['attributes']=_['intersection'](_0xc29a1b[_0xb0a3('0x30')],qs[_0xb0a3('0x35')](_0x49a7d8[_0xb0a3('0x34')]['fields']));_0x41fb72[_0xb0a3('0x36')]=_0x41fb72['attributes'][_0xb0a3('0x37')]?_0x41fb72['attributes']:_0xc29a1b['model'];if(!_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x38')](_0xb0a3('0x39'))){_0x41fb72[_0xb0a3('0x3a')]=qs[_0xb0a3('0x3a')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3a')]);_0x41fb72['offset']=qs[_0xb0a3('0x1d')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x1d')]);}_0x41fb72[_0xb0a3('0x3b')]=qs[_0xb0a3('0x3c')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3c')]);_0x41fb72[_0xb0a3('0x3d')]=qs['filters'](_['pick'](_0x49a7d8[_0xb0a3('0x34')],_0xc29a1b[_0xb0a3('0x32')]),_0x967090);if(_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3e')]){_0x41fb72[_0xb0a3('0x3d')]=_[_0xb0a3('0x3f')](_0x41fb72[_0xb0a3('0x3d')],{'$or':_[_0xb0a3('0x2a')](_0x967090,function(_0xaf9027){if(_0xaf9027[_0xb0a3('0x2e')]!==_0xb0a3('0x40')){var _0x36ecf9={};_0x36ecf9[_0xaf9027['name']]={'$like':'%'+_0x49a7d8[_0xb0a3('0x34')]['filter']+'%'};return _0x36ecf9;}})});}_0x41fb72=_['merge']({},_0x41fb72,_0x49a7d8['options']);var _0xc092c9={'where':_0x41fb72['where']};return db['ChatTransferReport'][_0xb0a3('0x1f')](_0xc092c9)[_0xb0a3('0x24')](function(_0x4aca30){_0x4f17b1[_0xb0a3('0x1f')]=_0x4aca30;if(_0x49a7d8['query']['includeAll']){_0x41fb72[_0xb0a3('0x41')]=[{'all':!![]}];}return db[_0xb0a3('0x2b')][_0xb0a3('0x42')](_0x41fb72);})[_0xb0a3('0x24')](function(_0xf98837){_0x4f17b1[_0xb0a3('0x43')]=_0xf98837;return _0x4f17b1;})[_0xb0a3('0x24')](respondWithFilteredResult(_0x3d2321,_0x41fb72))[_0xb0a3('0x44')](handleError(_0x3d2321,null));};exports['show']=function(_0x32e9d9,_0x88ae47){var _0xc5cd32={'raw':!![],'where':{'id':_0x32e9d9['params']['id']}},_0x5a1ed2={};_0x5a1ed2[_0xb0a3('0x30')]=_[_0xb0a3('0x31')](db[_0xb0a3('0x2b')]['rawAttributes']);_0x5a1ed2['query']=_[_0xb0a3('0x31')](_0x32e9d9[_0xb0a3('0x34')]);_0x5a1ed2[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0x5a1ed2[_0xb0a3('0x30')],_0x5a1ed2[_0xb0a3('0x34')]);_0xc5cd32[_0xb0a3('0x36')]=_[_0xb0a3('0x33')](_0x5a1ed2['model'],qs[_0xb0a3('0x35')](_0x32e9d9[_0xb0a3('0x34')][_0xb0a3('0x35')]));_0xc5cd32[_0xb0a3('0x36')]=_0xc5cd32['attributes'][_0xb0a3('0x37')]?_0xc5cd32[_0xb0a3('0x36')]:_0x5a1ed2[_0xb0a3('0x30')];if(_0x32e9d9['query'][_0xb0a3('0x45')]){_0xc5cd32[_0xb0a3('0x41')]=[{'all':!![]}];}_0xc5cd32=_[_0xb0a3('0x3f')]({},_0xc5cd32,_0x32e9d9['options']);return db['ChatTransferReport'][_0xb0a3('0x46')](_0xc5cd32)['then'](handleEntityNotFound(_0x88ae47,null))['then'](respondWithResult(_0x88ae47,null))[_0xb0a3('0x44')](handleError(_0x88ae47,null));};exports[_0xb0a3('0x47')]=function(_0x47117e,_0x59d274){return db[_0xb0a3('0x2b')][_0xb0a3('0x47')](_0x47117e['body'],{})[_0xb0a3('0x24')](respondWithResult(_0x59d274,0xc9))[_0xb0a3('0x44')](handleError(_0x59d274,null));};exports[_0xb0a3('0x23')]=function(_0x260c7b,_0x57c294){if(_0x260c7b[_0xb0a3('0x48')]['id']){delete _0x260c7b['body']['id'];}return db[_0xb0a3('0x2b')][_0xb0a3('0x46')]({'where':{'id':_0x260c7b[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x57c294,null))[_0xb0a3('0x24')](saveUpdates(_0x260c7b[_0xb0a3('0x48')],null))[_0xb0a3('0x24')](respondWithResult(_0x57c294,null))[_0xb0a3('0x44')](handleError(_0x57c294,null));};exports[_0xb0a3('0x25')]=function(_0x3e3b85,_0x252da1){return db[_0xb0a3('0x2b')]['find']({'where':{'id':_0x3e3b85[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x252da1,null))['then'](removeEntity(_0x252da1,null))['catch'](handleError(_0x252da1,null));};exports[_0xb0a3('0x4a')]=function(_0xa14bcb,_0x1037f6){return db[_0xb0a3('0x2b')][_0xb0a3('0x4a')]()[_0xb0a3('0x24')](respondWithResult(_0x1037f6,null))['catch'](handleError(_0x1037f6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index e843b7d..fbf3360 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 _0x6ec1=['request-promise','path','../../config/environment','define','ChatTransferReport','uniqueid','../../config/logger','bluebird'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0x6ec1,0xfe));var _0x16ec=function(_0x2570c2,_0x1ba88f){_0x2570c2=_0x2570c2-0x0;var _0x2629df=_0x6ec1[_0x2570c2];return _0x2629df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x16ec('0x0'))('api');var moment=require('moment');var BPromise=require(_0x16ec('0x1'));var rp=require(_0x16ec('0x2'));var fs=require('fs');var path=require(_0x16ec('0x3'));var rimraf=require('rimraf');var config=require(_0x16ec('0x4'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x32deda,_0x23ed73){return _0x32deda[_0x16ec('0x5')](_0x16ec('0x6'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x16ec('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0a6a=['report_chat_transfer','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0xf7b425,_0x4e8416){var _0x2a16ba=function(_0x3a600b){while(--_0x3a600b){_0xf7b425['push'](_0xf7b425['shift']());}};_0x2a16ba(++_0x4e8416);}(_0x0a6a,0x6f));var _0xa0a6=function(_0x4ba105,_0xf97073){_0x4ba105=_0x4ba105-0x0;var _0x5eee7b=_0x0a6a[_0x4ba105];return _0x5eee7b;};'use strict';var _=require(_0xa0a6('0x0'));var util=require('util');var logger=require(_0xa0a6('0x1'))('api');var moment=require(_0xa0a6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0a6('0x3'));var rimraf=require(_0xa0a6('0x4'));var config=require(_0xa0a6('0x5'));var attributes=require(_0xa0a6('0x6'));module[_0xa0a6('0x7')]=function(_0x5dfde9,_0x57e1d0){return _0x5dfde9[_0xa0a6('0x8')](_0xa0a6('0x9'),attributes,{'tableName':_0xa0a6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index e361fd0..2527155 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 _0x0e00=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x15e0eb,_0x114383){var _0x180016=function(_0x495281){while(--_0x495281){_0x15e0eb['push'](_0x15e0eb['shift']());}};_0x180016(++_0x114383);}(_0x0e00,0x104));var _0x00e0=function(_0x3b189d,_0x1c25e0){_0x3b189d=_0x3b189d-0x0;var _0x382792=_0x0e00[_0x3b189d];return _0x382792;};'use strict';var _=require(_0x00e0('0x0'));var util=require(_0x00e0('0x1'));var moment=require(_0x00e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x00e0('0x3'));var fs=require('fs');var Redis=require(_0x00e0('0x4'));var db=require(_0x00e0('0x5'))['db'];var utils=require(_0x00e0('0x6'));var logger=require(_0x00e0('0x7'))(_0x00e0('0x8'));var config=require(_0x00e0('0x9'));var jayson=require(_0x00e0('0xa'));var client=jayson[_0x00e0('0xb')][_0x00e0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x172c36,_0x1c5ff4,_0x245fe7){return new BPromise(function(_0x48edf6,_0x433c11){return client[_0x00e0('0xd')](_0x172c36,_0x245fe7)[_0x00e0('0xe')](function(_0x2de7cb){logger[_0x00e0('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x1c5ff4,_0x00e0('0x10'));logger['debug'](_0x00e0('0x11'),_0x1c5ff4,_0x00e0('0x10'),JSON['stringify'](_0x2de7cb));if(_0x2de7cb[_0x00e0('0x12')]){if(_0x2de7cb[_0x00e0('0x12')][_0x00e0('0x13')]===0x1f4){logger[_0x00e0('0x12')](_0x00e0('0x14'),_0x1c5ff4,_0x2de7cb[_0x00e0('0x12')][_0x00e0('0x15')]);return _0x433c11(_0x2de7cb[_0x00e0('0x12')][_0x00e0('0x15')]);}logger[_0x00e0('0x12')](_0x00e0('0x14'),_0x1c5ff4,_0x2de7cb['error']['message']);return _0x48edf6(_0x2de7cb[_0x00e0('0x12')]['message']);}else{logger[_0x00e0('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x1c5ff4,'request\x20sent');_0x48edf6(_0x2de7cb[_0x00e0('0x16')]['message']);}})[_0x00e0('0x17')](function(_0x255d49){logger[_0x00e0('0x12')](_0x00e0('0x14'),_0x1c5ff4,_0x255d49);_0x433c11(_0x255d49);});});} \ No newline at end of file +var _0x2afd=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2afd,0xbc));var _0xd2af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2afd[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xd2af('0x0'));var moment=require(_0xd2af('0x1'));var BPromise=require(_0xd2af('0x2'));var rs=require(_0xd2af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2af('0x5'))(_0xd2af('0x6'));var config=require(_0xd2af('0x7'));var jayson=require(_0xd2af('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2dd3,_0x4102e6,_0x3cae3b){return new BPromise(function(_0x5295a2,_0x17fe9e){return client[_0xd2af('0x9')](_0x4a2dd3,_0x3cae3b)[_0xd2af('0xa')](function(_0x54dbad){logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,'request\x20sent');logger[_0xd2af('0xd')](_0xd2af('0xe'),_0x4102e6,_0xd2af('0xf'),JSON[_0xd2af('0x10')](_0x54dbad));if(_0x54dbad[_0xd2af('0x11')]){if(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x12')]===0x1f4){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x17fe9e(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);}logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x5295a2(_0x54dbad['error'][_0xd2af('0x13')]);}else{logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,_0xd2af('0xf'));_0x5295a2(_0x54dbad[_0xd2af('0x14')][_0xd2af('0x13')]);}})[_0xd2af('0x15')](function(_0x1024c9){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x1024c9);_0x17fe9e(_0x1024c9);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 77260c4..12ab079 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 _0x7672=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x5509a8,_0x1a8b93){var _0x5383b1=function(_0x14cde3){while(--_0x14cde3){_0x5509a8['push'](_0x5509a8['shift']());}};_0x5383b1(++_0x1a8b93);}(_0x7672,0x1d9));var _0x2767=function(_0x47fe76,_0x1f9f51){_0x47fe76=_0x47fe76-0x0;var _0x1ee838=_0x7672[_0x47fe76];return _0x1ee838;};'use strict';var multer=require(_0x2767('0x0'));var util=require(_0x2767('0x1'));var path=require(_0x2767('0x2'));var timeout=require(_0x2767('0x3'));var express=require(_0x2767('0x4'));var router=express[_0x2767('0x5')]();var fs_extra=require(_0x2767('0x6'));var auth=require(_0x2767('0x7'));var interaction=require(_0x2767('0x8'));var config=require(_0x2767('0x9'));var controller=require(_0x2767('0xa'));router[_0x2767('0xb')]('/',auth[_0x2767('0xc')](),controller[_0x2767('0xd')]);router[_0x2767('0xb')](_0x2767('0xe'),auth[_0x2767('0xc')](),controller[_0x2767('0xf')]);router[_0x2767('0xb')](_0x2767('0x10'),auth[_0x2767('0xc')](),controller[_0x2767('0x11')]);router[_0x2767('0x12')]('/',auth[_0x2767('0xc')](),controller['create']);router[_0x2767('0x13')](_0x2767('0x10'),auth[_0x2767('0xc')](),controller[_0x2767('0x14')]);router[_0x2767('0x15')](_0x2767('0x10'),auth[_0x2767('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3987=['index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x3840a0,_0x1c2617){var _0x441d3f=function(_0x5ec5d3){while(--_0x5ec5d3){_0x3840a0['push'](_0x3840a0['shift']());}};_0x441d3f(++_0x1c2617);}(_0x3987,0xb3));var _0x7398=function(_0x486a06,_0x46d2dd){_0x486a06=_0x486a06-0x0;var _0x88198c=_0x3987[_0x486a06];return _0x88198c;};'use strict';var multer=require(_0x7398('0x0'));var util=require(_0x7398('0x1'));var path=require(_0x7398('0x2'));var timeout=require(_0x7398('0x3'));var express=require(_0x7398('0x4'));var router=express[_0x7398('0x5')]();var fs_extra=require(_0x7398('0x6'));var auth=require(_0x7398('0x7'));var interaction=require(_0x7398('0x8'));var config=require(_0x7398('0x9'));var controller=require(_0x7398('0xa'));router[_0x7398('0xb')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0xd')]);router[_0x7398('0xb')]('/describe',auth[_0x7398('0xc')](),controller[_0x7398('0xe')]);router[_0x7398('0xb')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x10')]);router[_0x7398('0x11')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0x12')]);router[_0x7398('0x13')](_0x7398('0xf'),auth['isAuthenticated'](),controller[_0x7398('0x14')]);router[_0x7398('0x15')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x16')]);module[_0x7398('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 6c65806..dea571f 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 _0x64d4=['Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','input','text','email','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x64d4,0x156));var _0x464d=function(_0x1130a1,_0x3a0aea){_0x1130a1=_0x1130a1-0x0;var _0x167055=_0x64d4[_0x1130a1];return _0x167055;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x464d('0x0'));module[_0x464d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x464d('0x2')},'description':{'type':Sequelize[_0x464d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x464d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x4')},'customerAlias':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x464d('0x9')](_0x464d('0xa'),_0x464d('0xb')),'defaultValue':_0x464d('0xa')},'header_online':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xc')},'start_chat_button':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xd')},'offline_chat_button':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xe')},'header_offline':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xf')},'download_transcript':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x464d('0x11')]},'closingQuestion':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x13')},'noteTitle':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x15')},'closingMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x16')},'closingMessageButton':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xe')},'skipMessageButton':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x17')},'conditionAgreement':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x18')},'ratingType':{'type':Sequelize[_0x464d('0x9')]('star','thumb'),'defaultValue':_0x464d('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x464d('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x464d('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0x464d('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x464d('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x464d('0x1c'),'type':_0x464d('0x1c')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x464d('0x1d')](_0x464d('0x1e'))?JSON[_0x464d('0x1f')](this['getDataValue'](_0x464d('0x1e'))):{};},'set':function(_0x548aac){return this[_0x464d('0x20')](_0x464d('0x1e'),JSON['stringify'](_0x548aac));}},'offlineForm':{'type':Sequelize[_0x464d('0x11')],'defaultValue':function(){return JSON[_0x464d('0x21')]({'items':[{'type':'input','props':{'title':_0x464d('0x1c'),'helpText':''},'config':{'required':!![],'placeholder':_0x464d('0x1c'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x464d('0x22')},'props':{'title':_0x464d('0x22'),'helpText':_0x464d('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x464d('0x24'))?JSON[_0x464d('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x5642a2){return this[_0x464d('0x20')](_0x464d('0x24'),JSON['stringify'](_0x5642a2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x464d('0x25')]();}},'autoclose':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x464d('0x3')]},'forwardOffline':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x464d('0x3')]},'waitingTitle':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x26')},'waitingMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x27')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x28')},'offlineMessageBody':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x17')},'sendUnmanaged':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x464d('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x464d('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x464d('0x2a');}},'notificationSound':{'type':Sequelize[_0x464d('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x464d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x464d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x464d('0x2c')},'messagesAlignment':{'type':Sequelize[_0x464d('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x464d('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x464d('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x464d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x464d('0x3')],'defaultValue':_0x464d('0x2e')},'systemAvatar':{'type':Sequelize[_0x464d('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x464d('0x7')],'comment':_0x464d('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1f8807){if(!_0x1f8807)this[_0x464d('0x20')](_0x464d('0x30'),null);this[_0x464d('0x20')]('mandatoryDisposition',_0x1f8807);}},'vidaooEscalation':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x464d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x464d('0x3')],'allowNull':![],'defaultValue':_0x464d('0x31')},'vidaooNote':{'type':Sequelize[_0x464d('0x3')],'defaultValue':function(){return _0x464d('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x464d('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x464d('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x464d('0x11')]}}; \ No newline at end of file +var _0xa8d3=['squared','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Skip','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xa8d3,0x15b));var _0x3a8d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa8d3[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x3a8d('0x0'));var rs=require(_0x3a8d('0x1'));module[_0x3a8d('0x2')]={'name':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'unique':_0x3a8d('0x4')},'description':{'type':Sequelize[_0x3a8d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x5')},'mapKeyOffline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x5')},'key':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3a8d('0x3')]},'animation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0xc'),_0x3a8d('0xd')),'defaultValue':_0x3a8d('0xc')},'header_online':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0xe')},'download_transcript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3a8d('0x10')]},'closingQuestion':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x13')},'closingMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0x14'),_0x3a8d('0x15')),'defaultValue':_0x3a8d('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'variable':null,'config':{'placeholder':_0x3a8d('0x18'),'type':_0x3a8d('0x19'),'required':!![]},'props':{'title':_0x3a8d('0x18'),'helpText':''}},{'type':_0x3a8d('0x17'),'props':{'title':_0x3a8d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3a8d('0x1a')]('onlineForm')?JSON[_0x3a8d('0x1b')](this['getDataValue'](_0x3a8d('0x1c'))):{};},'set':function(_0xaf5085){return this[_0x3a8d('0x1d')](_0x3a8d('0x1c'),JSON[_0x3a8d('0x16')](_0xaf5085));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x3a8d('0x1e')},'props':{'title':_0x3a8d('0x1e'),'helpText':_0x3a8d('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x3a8d('0x1a')](_0x3a8d('0x20'))?JSON['parse'](this[_0x3a8d('0x1a')](_0x3a8d('0x20'))):{};},'set':function(_0x474cbe){return this['setDataValue']('offlineForm',JSON['stringify'](_0x474cbe));}},'token':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3a8d('0x3')]},'waitingTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x21')},'waitingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x22')},'offlineMessageBody':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x23')},'sendUnmanaged':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x24')},'enableCustomerAttachment':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3a8d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':function(){return _0x3a8d('0x25');}},'notificationSound':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x27')},'defaultTitle':{'type':Sequelize[_0x3a8d('0x3')]},'customerAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x29')},'systemAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a8d('0x9')],'comment':_0x3a8d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'comment':_0x3a8d('0x2b'),'set':function(_0xd6615d){if(!_0xd6615d)this[_0x3a8d('0x1d')](_0x3a8d('0x2c'),null);this[_0x3a8d('0x1d')]('mandatoryDisposition',_0xd6615d);}},'vidaooEscalation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3a8d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3a8d('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 9f27535..c450796 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 _0x4a86=['json','limit','undefined','count','offset','set','Content-Range','update','get','UserProfileResource','destroy','stack','name','send','Command','getSnippet','timezone','format','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Intervals','all','some','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','%s\x20%s','unknown','model','device','vendor','%s\x20%s\x20%s','type','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','rows','show','params','mandatoryDispositionPause','includeAll','find','create','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ChatWebsiteId','Disposition','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','pick','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','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','List','Contacts','DESC','ChatApplication','Applications','Interval','spread','account','list','applications','orderBy','priority','asc','contact','headers','threadId','ChatInteraction','externalUrl','interaction','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','files','offline-chat','openNewInteraction','transaction','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','getInteractions','Contact','fullname','internal','color','tag','virtual','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','remote','x-real-ip','referer','replace','render','alignment','verticalAlignment','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','util','path','ejs','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/environment','../../errors/api','handleError','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4a86,0x10f));var _0x64a8=function(_0x1f1db2,_0x230a06){_0x1f1db2=_0x1f1db2-0x0;var _0x1380ee=_0x4a86[_0x1f1db2];return _0x1380ee;};'use strict';var Mustache=require('mustache');var util=require(_0x64a8('0x0'));var path=require(_0x64a8('0x1'));var ejs=require(_0x64a8('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x64a8('0x3'));var htmlToText=require(_0x64a8('0x4'));var Redis=require(_0x64a8('0x5'));var jayson=require(_0x64a8('0x6'));var url=require(_0x64a8('0x7'));var qs=require(_0x64a8('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x64a8('0x9'));var APIOutOfIntervalError=require(_0x64a8('0xa'))['APIOutOfIntervalError'];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0x64a8('0xa'))[_0x64a8('0xb')];var db=require('../../mysqldb')['db'];config[_0x64a8('0xc')]=_[_0x64a8('0xd')](config[_0x64a8('0xc')],{'host':_0x64a8('0xe'),'port':0x18eb});var socket=require(_0x64a8('0xf'))(new Redis(config[_0x64a8('0xc')]));require(_0x64a8('0x10'))[_0x64a8('0x11')](socket);var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x64a8('0x12')][_0x64a8('0x13')]({'port':0x232a});var client9003=jayson[_0x64a8('0x12')][_0x64a8('0x13')]({'port':0x232b});var client9001=jayson['client'][_0x64a8('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x3ab915,_0x41b76a,_0x1c67af,_0x192b87){return new Promise(function(_0xa98fc4,_0xf9638a){var _0x850efb=_0x192b87||client;return _0x850efb['request'](_0x3ab915,_0x1c67af)[_0x64a8('0x14')](function(_0x5cd03f){logger[_0x64a8('0x15')](_0x64a8('0x16'),_0x41b76a,_0x64a8('0x17'));logger[_0x64a8('0x18')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x41b76a,_0x64a8('0x17'),JSON[_0x64a8('0x19')](_0x5cd03f));if(_0x5cd03f[_0x64a8('0x1a')]){if(_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1b')]===0x1f4){logger[_0x64a8('0x1a')](_0x64a8('0x16'),_0x41b76a,_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);return _0xf9638a(_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);}logger['error'](_0x64a8('0x16'),_0x41b76a,_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);return _0xa98fc4(_0x5cd03f[_0x64a8('0x1a')][_0x64a8('0x1c')]);}else{logger[_0x64a8('0x15')](_0x64a8('0x16'),_0x41b76a,_0x64a8('0x17'));_0xa98fc4(_0x5cd03f[_0x64a8('0x1d')]['message']);}})[_0x64a8('0x1e')](function(_0x36d669){logger[_0x64a8('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x41b76a,_0x36d669);_0xf9638a(_0x36d669);});});}function respondWithStatusCode(_0x47648d,_0x548789){_0x548789=_0x548789||0xcc;return function(_0x55ced0){if(_0x55ced0){return _0x47648d[_0x64a8('0x1f')](_0x548789);}return _0x47648d[_0x64a8('0x20')](_0x548789)[_0x64a8('0x21')]();};}function respondWithResult(_0x29d2dc,_0x5935ba){_0x5935ba=_0x5935ba||0xc8;return function(_0x19cffa){if(_0x19cffa){return _0x29d2dc[_0x64a8('0x20')](_0x5935ba)[_0x64a8('0x22')](_0x19cffa);}};}function respondWithFilteredResult(_0x4516ec,_0xe1cb89){return function(_0x38cac9){if(_0x38cac9){var _0x4ebe6d=typeof _0xe1cb89['offset']==='undefined'&&typeof _0xe1cb89[_0x64a8('0x23')]===_0x64a8('0x24');var _0x3dcc98=_0x38cac9[_0x64a8('0x25')];var _0x33aac5=_0x4ebe6d?0x0:_0xe1cb89[_0x64a8('0x26')];var _0x3fdefc=_0x4ebe6d?_0x38cac9['count']:_0xe1cb89[_0x64a8('0x26')]+_0xe1cb89[_0x64a8('0x23')];var _0x27c992;if(_0x3fdefc>=_0x3dcc98){_0x3fdefc=_0x3dcc98;_0x27c992=0xc8;}else{_0x27c992=0xce;}_0x4516ec[_0x64a8('0x20')](_0x27c992);return _0x4516ec[_0x64a8('0x27')](_0x64a8('0x28'),_0x33aac5+'-'+_0x3fdefc+'/'+_0x3dcc98)[_0x64a8('0x22')](_0x38cac9);}return null;};}function saveUpdates(_0x175462){return function(_0x253d4c){if(_0x253d4c){return _0x253d4c[_0x64a8('0x29')](_0x175462)[_0x64a8('0x14')](function(_0x565e28){return _0x565e28;});}return null;};}function removeEntity(_0x2ea0ff){return function(_0x351be7){if(_0x351be7){return _0x351be7['destroy']()[_0x64a8('0x14')](function(){var _0x4ecd6a=_0x351be7[_0x64a8('0x2a')]({'plain':!![]});var _0x36edb1='ChatWebsites';return db[_0x64a8('0x2b')][_0x64a8('0x2c')]({'where':{'type':_0x36edb1,'resourceId':_0x4ecd6a['id']}})['then'](function(){return _0x351be7;});})[_0x64a8('0x14')](function(){_0x2ea0ff[_0x64a8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41fe64){return function(_0x49efd5){if(!_0x49efd5){_0x41fe64[_0x64a8('0x1f')](0x194);}return _0x49efd5;};}function handleError(_0x325078,_0x561817){_0x561817=_0x561817||0x1f4;return function(_0x174773){logger[_0x64a8('0x1a')](_0x174773[_0x64a8('0x2d')]);if(_0x174773[_0x64a8('0x2e')]){delete _0x174773['name'];}_0x325078[_0x64a8('0x20')](_0x561817)[_0x64a8('0x2f')](_0x174773);};}function iftimePromise(_0xf5d27f,_0x362e41){return respondWithRpcPromise(_0x64a8('0x30'),_0x64a8('0x31'),{'command':_0x362e41[_0x64a8('0x32')]?util[_0x64a8('0x33')]('iftime\x20%s,%s',_0xf5d27f[_0x64a8('0x34')],_0x362e41['timezone']):util[_0x64a8('0x33')](_0x64a8('0x35'),_0xf5d27f[_0x64a8('0x34')])},client9002)[_0x64a8('0x14')](function(_0x1e05cb){var _0x58bdd0=_0x1e05cb&&_0x1e05cb[_0x64a8('0x36')](_0x64a8('0x37'))>=0x0?!![]:![];logger[_0x64a8('0x15')](_0x64a8('0x38'),_0x362e41['id'],_0xf5d27f['id'],_0xf5d27f[_0x64a8('0x34')],_0x58bdd0?'ONLINE':_0x64a8('0x39'),_0x362e41[_0x64a8('0x32')]?_0x362e41['timezone']:_0x64a8('0x3a'));return _0x58bdd0;})[_0x64a8('0x1e')](function(_0x2d7547){logger[_0x64a8('0x1a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x362e41['id'],_0xf5d27f['id'],_0xf5d27f[_0x64a8('0x34')],util[_0x64a8('0x3b')](_0x2d7547,{'showHidden':![],'depth':null}),_0x362e41[_0x64a8('0x32')]?_0x362e41['timezone']:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0x4a147c){var _0x3a83fa=_['map'](_0x4a147c['Interval'][_0x64a8('0x3c')],function(_0x20a0bd){var _0x3a5fc3=_0x20a0bd[_0x64a8('0x2a')]({'plain':!![]});return iftimePromise(_0x3a5fc3,_0x4a147c);});return Promise[_0x64a8('0x3d')](_0x3a83fa)[_0x64a8('0x14')](function(_0x17fb3d){return _[_0x64a8('0x3e')](_0x17fb3d);});}function createInteractionObject(_0x10e028,_0x3d06b3,_0x53877b,_0x267a01){var _0x140734=require(_0x64a8('0x3f'));var _0x2699ee=new _0x140734();var _0x1c84a4=_0x2699ee[_0x64a8('0x40')](_0x53877b[_0x64a8('0x41')])['getResult']();var _0x1c964f=_0x3d06b3[_0x64a8('0x42')];if(_0x53877b[_0x64a8('0x43')]){_0x1c964f=_0x53877b[_0x64a8('0x43')];}else if(_0x53877b[_0x64a8('0x44')]){_0x1c964f=_[_0x64a8('0x45')](_0x53877b[_0x64a8('0x44')][_0x64a8('0x46')](','));}return{'ContactId':_0x267a01['id'],'ChatWebsiteId':_0x10e028,'from':(_0x267a01[_0x64a8('0x47')]||'')+'\x20'+(_0x267a01['lastName']||''),'customerIp':_0x1c964f,'customerPort':_0x53877b[_0x64a8('0x48')]?_0x53877b[_0x64a8('0x48')]:null,'referer':_0x3d06b3['referer'],'browserName':_0x1c84a4['browser']['name']&&_0x1c84a4[_0x64a8('0x49')][_0x64a8('0x4a')]?util['format'](_0x64a8('0x4b'),_0x1c84a4[_0x64a8('0x49')][_0x64a8('0x2e')],_0x1c84a4['browser'][_0x64a8('0x4a')]):_0x64a8('0x4c'),'browserVersion':_0x1c84a4[_0x64a8('0x49')][_0x64a8('0x4a')]||_0x64a8('0x4c'),'osName':util['format']('%s\x20%s',_0x1c84a4['os']['name'],_0x1c84a4['os'][_0x64a8('0x4a')]),'osVersion':_0x1c84a4['os'][_0x64a8('0x4a')],'deviceModel':_0x1c84a4['device'][_0x64a8('0x4d')]&&_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x4f')]?util[_0x64a8('0x33')](_0x64a8('0x50'),_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x4d')],_0x1c84a4['device']['vendor'],_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x51')]):null,'deviceVendor':_0x1c84a4['device'][_0x64a8('0x4f')],'deviceType':_0x1c84a4[_0x64a8('0x4e')][_0x64a8('0x51')],'formData':JSON[_0x64a8('0x19')](_0x3d06b3)};}exports[_0x64a8('0x52')]=function(_0x16d212,_0x2f8827){var _0x10e1ea={'include':[{'model':db[_0x64a8('0x53')],'as':'mandatoryDispositionPause'}]},_0x5e402c={},_0x4348cc={'count':0x0,'rows':[]};var _0x276ac5=_[_0x64a8('0x54')](db[_0x64a8('0x55')][_0x64a8('0x56')],function(_0x4e8c29){return{'name':_0x4e8c29[_0x64a8('0x57')],'type':_0x4e8c29['type'][_0x64a8('0x58')]};});_0x5e402c[_0x64a8('0x4d')]=_['map'](_0x276ac5,_0x64a8('0x2e'));_0x5e402c['query']=_[_0x64a8('0x59')](_0x16d212['query']);_0x5e402c[_0x64a8('0x5a')]=_['intersection'](_0x5e402c[_0x64a8('0x4d')],_0x5e402c[_0x64a8('0x5b')]);_0x10e1ea[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x5e402c[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x16d212[_0x64a8('0x5b')]['fields']));_0x10e1ea[_0x64a8('0x5c')]=_0x10e1ea[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x10e1ea['attributes']:_0x5e402c[_0x64a8('0x4d')];if(!_0x16d212[_0x64a8('0x5b')][_0x64a8('0x60')](_0x64a8('0x61'))){_0x10e1ea[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x16d212[_0x64a8('0x5b')][_0x64a8('0x23')]);_0x10e1ea[_0x64a8('0x26')]=qs['offset'](_0x16d212[_0x64a8('0x5b')][_0x64a8('0x26')]);}_0x10e1ea[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x16d212['query']['sort']);_0x10e1ea[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_['pick'](_0x16d212['query'],_0x5e402c['filters']),_0x276ac5);if(_0x16d212['query'][_0x64a8('0x65')]){_0x10e1ea[_0x64a8('0x64')]=_['merge'](_0x10e1ea[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x276ac5,function(_0x2cfd31){if(_0x2cfd31['type']!==_0x64a8('0x66')){var _0x4b7b50={};_0x4b7b50[_0x2cfd31[_0x64a8('0x2e')]]={'$like':'%'+_0x16d212['query'][_0x64a8('0x65')]+'%'};return _0x4b7b50;}})});}_0x10e1ea=_[_0x64a8('0x67')]({},_0x10e1ea,_0x16d212[_0x64a8('0x68')]);var _0x54c794={'where':_0x10e1ea[_0x64a8('0x64')]};return db['ChatWebsite'][_0x64a8('0x25')](_0x54c794)[_0x64a8('0x14')](function(_0x1149fa){_0x4348cc[_0x64a8('0x25')]=_0x1149fa;if(_0x16d212[_0x64a8('0x5b')]['includeAll']){_0x10e1ea[_0x64a8('0x69')]=[{'all':!![]}];}return db[_0x64a8('0x55')]['findAll'](_0x10e1ea);})[_0x64a8('0x14')](function(_0xc015ad){_0x4348cc[_0x64a8('0x6a')]=_0xc015ad;return _0x4348cc;})[_0x64a8('0x14')](respondWithFilteredResult(_0x2f8827,_0x10e1ea))[_0x64a8('0x1e')](handleError(_0x2f8827,null));};exports[_0x64a8('0x6b')]=function(_0x319a0c,_0x439932){var _0x50f8d5={'raw':![],'where':{'id':_0x319a0c[_0x64a8('0x6c')]['id']},'include':[{'model':db[_0x64a8('0x53')],'as':_0x64a8('0x6d')}]},_0x255381={};_0x255381['model']=_[_0x64a8('0x59')](db['ChatWebsite'][_0x64a8('0x56')]);_0x255381['query']=_[_0x64a8('0x59')](_0x319a0c[_0x64a8('0x5b')]);_0x255381[_0x64a8('0x5a')]=_['intersection'](_0x255381[_0x64a8('0x4d')],_0x255381[_0x64a8('0x5b')]);_0x50f8d5['attributes']=_[_0x64a8('0x5d')](_0x255381['model'],qs[_0x64a8('0x5e')](_0x319a0c['query']['fields']));_0x50f8d5[_0x64a8('0x5c')]=_0x50f8d5['attributes'][_0x64a8('0x5f')]?_0x50f8d5[_0x64a8('0x5c')]:_0x255381['model'];if(_0x319a0c[_0x64a8('0x5b')][_0x64a8('0x6e')]){_0x50f8d5[_0x64a8('0x69')]=[{'all':!![]}];}_0x50f8d5=_['merge']({},_0x50f8d5,_0x319a0c[_0x64a8('0x68')]);return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x50f8d5)['then'](handleEntityNotFound(_0x439932,null))[_0x64a8('0x14')](respondWithResult(_0x439932,null))[_0x64a8('0x1e')](handleError(_0x439932,null));};exports[_0x64a8('0x70')]=function(_0x5c8001,_0x256275){return db[_0x64a8('0x55')][_0x64a8('0x70')](_0x5c8001['body'],{})[_0x64a8('0x14')](function(_0x469161){var _0xe3c90a=_0x5c8001[_0x64a8('0x71')][_0x64a8('0x2a')]({'plain':!![]});if(!_0xe3c90a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe3c90a['role']===_0x64a8('0x71')){var _0x3f4ce7=_0x469161['get']({'plain':!![]});var _0x47679f=_0x64a8('0x72');return db[_0x64a8('0x73')][_0x64a8('0x6f')]({'where':{'name':_0x47679f,'userProfileId':_0xe3c90a[_0x64a8('0x74')]},'raw':!![]})[_0x64a8('0x14')](function(_0x8f9530){if(_0x8f9530&&_0x8f9530[_0x64a8('0x75')]===0x0){return db['UserProfileResource'][_0x64a8('0x70')]({'name':_0x3f4ce7[_0x64a8('0x2e')],'resourceId':_0x3f4ce7['id'],'type':_0x8f9530[_0x64a8('0x2e')],'sectionId':_0x8f9530['id']},{})[_0x64a8('0x14')](function(){return _0x469161;});}else{return _0x469161;}})['catch'](function(_0x28d660){logger[_0x64a8('0x1a')](_0x64a8('0x76'),_0x28d660);throw _0x28d660;});}return _0x469161;})[_0x64a8('0x14')](respondWithResult(_0x256275,0xc9))[_0x64a8('0x1e')](handleError(_0x256275,null));};exports[_0x64a8('0x29')]=function(_0x216e93,_0x94f2db){if(_0x216e93[_0x64a8('0x77')]['id']){delete _0x216e93['body']['id'];}return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x216e93[_0x64a8('0x6c')]['id']},'include':[{'model':db[_0x64a8('0x53')],'as':_0x64a8('0x6d')}]})[_0x64a8('0x14')](handleEntityNotFound(_0x94f2db,null))['then'](saveUpdates(_0x216e93[_0x64a8('0x77')],null))[_0x64a8('0x14')](respondWithResult(_0x94f2db,null))[_0x64a8('0x1e')](handleError(_0x94f2db,null));};exports['destroy']=function(_0x25f851,_0x3dc7c4){return db['ChatWebsite'][_0x64a8('0x6f')]({'where':{'id':_0x25f851[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3dc7c4,null))[_0x64a8('0x14')](removeEntity(_0x3dc7c4,null))[_0x64a8('0x1e')](handleError(_0x3dc7c4,null));};exports[_0x64a8('0x78')]=function(_0x302ee4,_0x2d5ba5){return db[_0x64a8('0x55')][_0x64a8('0x78')]()['then'](respondWithResult(_0x2d5ba5,null))[_0x64a8('0x1e')](handleError(_0x2d5ba5,null));};exports['addDisposition']=function(_0x161772,_0x2edffb){if(_0x161772['body']['id']){delete _0x161772[_0x64a8('0x77')]['id'];}return db['ChatWebsite'][_0x64a8('0x6f')]({'where':{'id':_0x161772['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x2edffb,null))[_0x64a8('0x14')](function(_0x2e1bf5){if(_0x2e1bf5){_0x161772['body'][_0x64a8('0x79')]=_0x2e1bf5['id'];return db[_0x64a8('0x7a')][_0x64a8('0x70')](_0x161772[_0x64a8('0x77')]);}})[_0x64a8('0x14')](respondWithResult(_0x2edffb,null))['catch'](handleError(_0x2edffb,null));};exports['getDispositions']=function(_0x199085,_0x2f27c7){var _0x1f2038={'raw':![],'where':{}};var _0x1ff1f2={};var _0x11c16d={'count':0x0,'rows':[]};return db[_0x64a8('0x55')][_0x64a8('0x7b')]({'where':{'id':_0x199085[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2f27c7,null))[_0x64a8('0x14')](function(_0x2f623f){if(_0x2f623f){_0x1ff1f2[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db[_0x64a8('0x7a')][_0x64a8('0x56')]);_0x1ff1f2[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x199085[_0x64a8('0x5b')]);_0x1ff1f2[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x1ff1f2['model'],_0x1ff1f2['query']);_0x1f2038[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x1ff1f2[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x199085['query'][_0x64a8('0x5e')]));_0x1f2038[_0x64a8('0x5c')]=_0x1f2038['attributes'][_0x64a8('0x5f')]?_0x1f2038[_0x64a8('0x5c')]:_0x1ff1f2[_0x64a8('0x4d')];if(!_0x199085[_0x64a8('0x5b')][_0x64a8('0x60')](_0x64a8('0x61'))){_0x1f2038[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x199085['query']['limit']);_0x1f2038['offset']=qs['offset'](_0x199085['query'][_0x64a8('0x26')]);}_0x1f2038[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x199085[_0x64a8('0x5b')]['sort']);_0x1f2038[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_['pick'](_0x199085[_0x64a8('0x5b')],_0x1ff1f2[_0x64a8('0x5a')]));_0x1f2038[_0x64a8('0x64')][_0x64a8('0x79')]=_0x2f623f['id'];if(_0x199085[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x1f2038[_0x64a8('0x64')]=_['merge'](_0x1f2038[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x1f2038['attributes'],function(_0x1174a2){var _0x55a823={};_0x55a823[_0x1174a2]={'$like':'%'+_0x199085[_0x64a8('0x5b')][_0x64a8('0x65')]+'%'};return _0x55a823;})});}_0x1f2038=_['merge']({},_0x1f2038,_0x199085[_0x64a8('0x68')]);return db['Disposition']['count']({'where':_0x1f2038['where']})[_0x64a8('0x14')](function(_0x56635c){_0x11c16d[_0x64a8('0x25')]=_0x56635c;if(_0x199085[_0x64a8('0x5b')]['includeAll']){_0x1f2038[_0x64a8('0x69')]=[{'all':!![]}];}return db['Disposition'][_0x64a8('0x7c')](_0x1f2038);})[_0x64a8('0x14')](function(_0x327638){_0x11c16d[_0x64a8('0x6a')]=_0x327638;return _0x11c16d;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x2f27c7,_0x1f2038))['catch'](handleError(_0x2f27c7,null));};exports[_0x64a8('0x7d')]=function(_0x1ae802,_0x2f6afb){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x1ae802['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x2f6afb,null))[_0x64a8('0x14')](function(_0x8abc27){if(_0x8abc27){return _0x8abc27[_0x64a8('0x7d')](_0x1ae802[_0x64a8('0x5b')]['ids']);}})[_0x64a8('0x14')](respondWithStatusCode(_0x2f6afb,null))[_0x64a8('0x1e')](handleError(_0x2f6afb,null));};exports[_0x64a8('0x7e')]=function(_0xf69de,_0x5565e4){if(_0xf69de[_0x64a8('0x77')]['id']){delete _0xf69de[_0x64a8('0x77')]['id'];}return db[_0x64a8('0x55')]['find']({'where':{'id':_0xf69de[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x5565e4,null))[_0x64a8('0x14')](function(_0x2dd8ef){if(_0x2dd8ef){_0xf69de[_0x64a8('0x77')][_0x64a8('0x79')]=_0x2dd8ef['id'];return db[_0x64a8('0x7f')][_0x64a8('0x70')](_0xf69de['body']);}})[_0x64a8('0x14')](respondWithResult(_0x5565e4,null))['catch'](handleError(_0x5565e4,null));};exports['getAnswers']=function(_0x3efff5,_0x264b00){var _0x22e28c={'raw':![],'where':{}};var _0x34f957={};var _0x35d2f3={'count':0x0,'rows':[]};return db[_0x64a8('0x55')][_0x64a8('0x7b')]({'where':{'id':_0x3efff5[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x264b00,null))['then'](function(_0x712ce6){if(_0x712ce6){_0x34f957[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db[_0x64a8('0x7f')][_0x64a8('0x56')]);_0x34f957['query']=_['keys'](_0x3efff5[_0x64a8('0x5b')]);_0x34f957[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x34f957[_0x64a8('0x4d')],_0x34f957[_0x64a8('0x5b')]);_0x22e28c['attributes']=_['intersection'](_0x34f957[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x3efff5[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x22e28c[_0x64a8('0x5c')]=_0x22e28c[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x22e28c[_0x64a8('0x5c')]:_0x34f957[_0x64a8('0x4d')];if(!_0x3efff5[_0x64a8('0x5b')]['hasOwnProperty']('nolimit')){_0x22e28c[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x3efff5[_0x64a8('0x5b')][_0x64a8('0x23')]);_0x22e28c[_0x64a8('0x26')]=qs['offset'](_0x3efff5[_0x64a8('0x5b')]['offset']);}_0x22e28c['order']=qs[_0x64a8('0x63')](_0x3efff5[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x22e28c[_0x64a8('0x64')]=qs['filters'](_[_0x64a8('0x80')](_0x3efff5[_0x64a8('0x5b')],_0x34f957['filters']));_0x22e28c[_0x64a8('0x64')][_0x64a8('0x79')]=_0x712ce6['id'];if(_0x3efff5['query'][_0x64a8('0x65')]){_0x22e28c[_0x64a8('0x64')]=_[_0x64a8('0x67')](_0x22e28c['where'],{'$or':_['map'](_0x22e28c['attributes'],function(_0x250c12){var _0x2cfa77={};_0x2cfa77[_0x250c12]={'$like':'%'+_0x3efff5[_0x64a8('0x5b')]['filter']+'%'};return _0x2cfa77;})});}_0x22e28c=_[_0x64a8('0x67')]({},_0x22e28c,_0x3efff5[_0x64a8('0x68')]);return db['CannedAnswer'][_0x64a8('0x25')]({'where':_0x22e28c['where']})['then'](function(_0x5e4b7a){_0x35d2f3[_0x64a8('0x25')]=_0x5e4b7a;if(_0x3efff5[_0x64a8('0x5b')]['includeAll']){_0x22e28c[_0x64a8('0x69')]=[{'all':!![]}];}return db['CannedAnswer'][_0x64a8('0x7c')](_0x22e28c);})[_0x64a8('0x14')](function(_0x750e4){_0x35d2f3['rows']=_0x750e4;return _0x35d2f3;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x264b00,_0x22e28c))['catch'](handleError(_0x264b00,null));};exports[_0x64a8('0x81')]=function(_0x3eaf89,_0x588226){return db['ChatWebsite']['find']({'where':{'id':_0x3eaf89[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x588226,null))['then'](function(_0x589ec8){if(_0x589ec8){return _0x589ec8[_0x64a8('0x81')](_0x3eaf89['query']['ids']);}})['then'](respondWithStatusCode(_0x588226,null))['catch'](handleError(_0x588226,null));};exports[_0x64a8('0x82')]=function(_0x7122c8,_0x339320){_0x7122c8[_0x64a8('0x77')][_0x64a8('0x83')]=_0x7122c8['file'][_0x64a8('0x84')];return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x7122c8[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x339320,null))[_0x64a8('0x14')](saveUpdates(_0x7122c8[_0x64a8('0x77')],null))['then'](respondWithResult(_0x339320,null))[_0x64a8('0x1e')](handleError(_0x339320,null));};exports[_0x64a8('0x85')]=function(_0x58e4d8,_0x8b37b3){_0x58e4d8['body'][_0x64a8('0x86')]=_0x58e4d8['file']['filename'];return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x58e4d8[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x8b37b3,null))[_0x64a8('0x14')](saveUpdates(_0x58e4d8[_0x64a8('0x77')],null))[_0x64a8('0x14')](respondWithResult(_0x8b37b3,null))[_0x64a8('0x1e')](handleError(_0x8b37b3,null));};exports['addCustomerAvatar']=function(_0x48b463,_0x714e16){_0x48b463[_0x64a8('0x77')][_0x64a8('0x87')]=_0x48b463[_0x64a8('0x88')]['filename'];return db[_0x64a8('0x55')]['find']({'where':{'id':_0x48b463[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x714e16,null))[_0x64a8('0x14')](saveUpdates(_0x48b463['body'],null))['then'](respondWithResult(_0x714e16,null))[_0x64a8('0x1e')](handleError(_0x714e16,null));};exports[_0x64a8('0x89')]=function(_0x593000,_0x2a3ee8){_0x593000['body'][_0x64a8('0x8a')]=_0x593000[_0x64a8('0x88')]['filename'];return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x593000['params']['id']}})['then'](handleEntityNotFound(_0x2a3ee8,null))[_0x64a8('0x14')](saveUpdates(_0x593000[_0x64a8('0x77')],null))[_0x64a8('0x14')](respondWithResult(_0x2a3ee8,null))[_0x64a8('0x1e')](handleError(_0x2a3ee8,null));};exports[_0x64a8('0x8b')]=function(_0x30fffc,_0x2cb94b){var _0x398e3a=path['join'](config['root'],_0x64a8('0x8c'));var _0x3ce0b9={'where':{'id':_0x30fffc['params']['id']},'attributes':['id',_0x64a8('0x83')],'raw':!![]};var _0x40c93c=![];return require('../../config/license/util')[_0x64a8('0x8d')]()[_0x64a8('0x14')](function(_0x225249){if(_0x225249){_0x40c93c=_0x225249['custom'];}})['then'](function(){return db[_0x64a8('0x55')]['find'](_0x3ce0b9);})[_0x64a8('0x14')](handleEntityNotFound(_0x2cb94b,null))['then'](function(_0xb3a810){if(_0xb3a810){if(!_[_0x64a8('0x8e')](_0xb3a810[_0x64a8('0x83')])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x92'),_0xb3a810['sitepic']))&&_0x40c93c){_0x398e3a=path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x92'),_0xb3a810['sitepic']);}}return _0x2cb94b[_0x64a8('0x93')](_0x398e3a);}})[_0x64a8('0x1e')](handleError(_0x2cb94b,null));};exports[_0x64a8('0x94')]=function(_0x36ed54,_0xc0b83e){var _0x57b53a=path[_0x64a8('0x90')](config['root'],_0x64a8('0x95'));var _0x505063={'where':{'id':_0x36ed54[_0x64a8('0x6c')]['id']},'attributes':['id',_0x64a8('0x86')],'raw':!![]};return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x505063)['then'](handleEntityNotFound(_0xc0b83e,null))['then'](function(_0x936fd8){if(_0x936fd8){if(!_['isNil'](_0x936fd8['agentAvatar'])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config['root'],_0x64a8('0x96'),_0x936fd8[_0x64a8('0x86')]))){_0x57b53a=path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x96'),_0x936fd8[_0x64a8('0x86')]);}}return _0xc0b83e[_0x64a8('0x93')](_0x57b53a);}})['catch'](handleError(_0xc0b83e,null));};exports[_0x64a8('0x97')]=function(_0x242391,_0x512abe){var _0x23c665=path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/customer_avatar.png');var _0x111b9a={'where':{'id':_0x242391[_0x64a8('0x6c')]['id']},'attributes':['id',_0x64a8('0x87'),_0x64a8('0x98')],'raw':!![]};return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x111b9a)['then'](handleEntityNotFound(_0x512abe,null))[_0x64a8('0x14')](function(_0x20f018){if(_0x20f018){if(!_[_0x64a8('0x8e')](_0x20f018[_0x64a8('0x87')])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/',_0x20f018[_0x64a8('0x87')]))&&_0x20f018[_0x64a8('0x98')]){_0x23c665=path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/',_0x20f018[_0x64a8('0x87')]);}}return _0x512abe[_0x64a8('0x93')](_0x23c665);}})[_0x64a8('0x1e')](handleError(_0x512abe,null));};exports[_0x64a8('0x99')]=function(_0x4be150,_0x1226d7){var _0x27244d=path[_0x64a8('0x90')](config[_0x64a8('0x91')],'server/files/images/avatars/system_avatar.png');var _0x2e9b65={'where':{'id':_0x4be150[_0x64a8('0x6c')]['id']},'attributes':['id',_0x64a8('0x8a')],'raw':!![]};return db[_0x64a8('0x55')][_0x64a8('0x6f')](_0x2e9b65)[_0x64a8('0x14')](handleEntityNotFound(_0x1226d7,null))['then'](function(_0x2a6180){if(_0x2a6180){if(!_[_0x64a8('0x8e')](_0x2a6180[_0x64a8('0x8a')])){if(fs[_0x64a8('0x8f')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x96'),_0x2a6180[_0x64a8('0x8a')]))){_0x27244d=path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x96'),_0x2a6180[_0x64a8('0x8a')]);}}return _0x1226d7['download'](_0x27244d);}})[_0x64a8('0x1e')](handleError(_0x1226d7,null));};exports[_0x64a8('0x9a')]=function(_0x1f0b97,_0x2a61d6){var _0x284a8f={'body':_0x1f0b97[_0x64a8('0x77')],'channel':_0x64a8('0x9b')};var _0x2e23d0=[];var _0x2d666f=[];var _0x13829={};var _0xcb177=![];return db[_0x64a8('0x9c')][_0x64a8('0x78')]()['then'](function(_0x37f0dc){if(!_0x37f0dc){throw new db[(_0x64a8('0x9d'))]['ValidationError'](_0x64a8('0x9e'));}_0x2e23d0=_[_0x64a8('0x9f')](_[_0x64a8('0x59')](_0x37f0dc),[_0x64a8('0xa0'),_0x64a8('0xa1')]);_0x2d666f=_[_0x64a8('0x9f')](_[_0x64a8('0x59')](_0x37f0dc),[_0x64a8('0xa0'),_0x64a8('0xa1'),_0x64a8('0xa2'),_0x64a8('0xa3')]);if(_0x1f0b97[_0x64a8('0x77')]['id']){delete _0x1f0b97[_0x64a8('0x77')]['id'];}if(_[_0x64a8('0x8e')](_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')])){throw new db[(_0x64a8('0x9d'))]['ValidationError'](_0x64a8('0xa5'));}if(_[_0x64a8('0x8e')](_0x1f0b97[_0x64a8('0x77')][_0x64a8('0x77')])||_0x1f0b97[_0x64a8('0x77')][_0x64a8('0x77')]===''){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xa7'));}if(_[_0x64a8('0x8e')](_0x1f0b97['body'][_0x64a8('0xa8')])){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xa9')+_0x2d666f);}if(!_[_0x64a8('0xaa')](_0x2d666f,_0x1f0b97[_0x64a8('0x77')]['mapKey'])){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xab')+_0x2d666f);}_0x13829[_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa8')]]=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')];})[_0x64a8('0x14')](function(){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x1f0b97[_0x64a8('0x6c')]['id']},'include':[{'model':db['CmList'],'as':_0x64a8('0xac'),'include':[{'model':db[_0x64a8('0x9c')],'as':_0x64a8('0xad'),'where':_0x13829,'limit':0x1,'order':[[_0x64a8('0xa1'),_0x64a8('0xae')]]}]},{'model':db[_0x64a8('0xaf')],'as':_0x64a8('0xb0')},{'model':db['Interval'],'as':_0x64a8('0xb1'),'include':[{'model':db[_0x64a8('0xb1')],'as':_0x64a8('0x3c'),'attributes':['id',_0x64a8('0x34')],'raw':!![]}]}]});})[_0x64a8('0x14')](function(_0x56a317){if(!_0x56a317)throw new APINotFoundError(util[_0x64a8('0x33')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x1f0b97[_0x64a8('0x6c')]['id']));if(!_0x56a317[_0x64a8('0xb1')]||!_0x56a317[_0x64a8('0xb1')][_0x64a8('0x3c')])return[_0x56a317,!![]];return[_0x56a317,checkWebsiteIntervals(_0x56a317)];})[_0x64a8('0xb2')](function(_0xea996f,_0x18c3c0){if(!_0x18c3c0)throw new APIOutOfIntervalError();if(!_0xea996f[_0x64a8('0xac')])return;_0x284a8f[_0x64a8('0xb3')]=_0xea996f;_0x284a8f[_0x64a8('0xb4')]=_0xea996f[_0x64a8('0xac')];_0x284a8f[_0x64a8('0xb5')]=_[_0x64a8('0xb6')](_0xea996f[_0x64a8('0xb0')],[_0x64a8('0xb7')],[_0x64a8('0xb8')]);if(_0x284a8f['account'][_0x64a8('0xb0')]){delete _0x284a8f['account'][_0x64a8('0xb0')];}if(_0x284a8f['account'][_0x64a8('0xac')]&&_0x284a8f[_0x64a8('0xb3')][_0x64a8('0xac')]['Contacts']['length']){return _0x284a8f[_0x64a8('0xb3')][_0x64a8('0xac')][_0x64a8('0xad')][0x0];}var _0x2e2f77=_[_0x64a8('0xd')](_0x1f0b97['body'],{'firstName':_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')],'ListId':_0xea996f[_0x64a8('0xa3')]});_0x2e2f77[_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa8')]]=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xa4')];return db['CmContact']['create'](_0x2e2f77,{'fields':_0x2e23d0,'raw':!![]});})[_0x64a8('0x14')](function(_0x2a380e){_0x284a8f[_0x64a8('0xb9')]=_0x2a380e;var _0x1b3362=createInteractionObject(_0x1f0b97['params']['id'],_0x1f0b97['body'],_0x1f0b97[_0x64a8('0xba')],_0x2a380e);var _0x346a50={'ChatWebsiteId':_0x1f0b97['params']['id'],'closed':![]};if(_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbb')]){_0x346a50[_0x64a8('0xbb')]=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbb')];return db[_0x64a8('0xbc')][_0x64a8('0x6f')]({'where':_0x346a50})[_0x64a8('0x14')](function(_0x10a507){if(_0x10a507){_0xcb177=!![];return _0x10a507;}_0x1b3362[_0x64a8('0xbb')]=_0x1f0b97['body'][_0x64a8('0xbb')];_0x1b3362[_0x64a8('0xbd')]=_0x1f0b97[_0x64a8('0x77')]['externalUrl'];return db[_0x64a8('0xbc')][_0x64a8('0x70')](_0x1b3362);});}_0x346a50['ContactId']=_0x2a380e['id'];if(_0x1f0b97['body'][_0x64a8('0xbe')]&&_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbe')]['id']){_0x346a50['id']=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xbe')]['id'];return db[_0x64a8('0xbc')][_0x64a8('0x6f')]({'where':_0x346a50})[_0x64a8('0x14')](function(_0x47bf79){if(_0x47bf79){_0xcb177=!![];return _0x47bf79;}return db[_0x64a8('0xbc')]['create'](_0x1b3362);});}return db['ChatInteraction'][_0x64a8('0x70')](_0x1b3362);})[_0x64a8('0x14')](function(_0x2a644e){if(!_0xcb177)return _0x2a644e;var _0x2a8d8b={'from':(_0x284a8f[_0x64a8('0xb9')][_0x64a8('0x47')]||'')+'\x20'+(_0x284a8f[_0x64a8('0xb9')][_0x64a8('0xbf')]||'')};if(_0x1f0b97[_0x64a8('0x77')]['threadId']&&_0x1f0b97['body'][_0x64a8('0xc0')]&&_0x1f0b97['body'][_0x64a8('0xbb')]!=_0x1f0b97[_0x64a8('0x77')]['messageId']){_0x2a8d8b['threadId']=_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xc0')];}return _0x2a644e[_0x64a8('0x29')](_0x2a8d8b);})[_0x64a8('0x14')](function(_0x5965c8){_0x284a8f[_0x64a8('0xbe')]=_0x5965c8['get']({'plain':!![]});_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xc1')]=!_0xcb177;if(_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xc1')]){if(_0x284a8f[_0x64a8('0xb3')][_0x64a8('0xc2')]){_0x284a8f[_0x64a8('0xb5')]['push']({'id':0x0,'priority':_0x284a8f['applications'][_0x64a8('0x5f')]+0x1,'app':_0x64a8('0xc3'),'appdata':_0x64a8('0xc4'),'interval':_0x64a8('0xc5')});}}return db[_0x64a8('0xc6')][_0x64a8('0x70')]({'body':_0x1f0b97[_0x64a8('0x77')][_0x64a8('0x77')],'ChatWebsiteId':_0x1f0b97[_0x64a8('0x6c')]['id'],'ChatInteractionId':_0x5965c8['id'],'direction':'in','ContactId':_0x284a8f[_0x64a8('0xb9')]['id'],'AttachmentId':_0x1f0b97[_0x64a8('0x77')][_0x64a8('0xc7')]});})[_0x64a8('0x14')](function(_0x316a6e){_0x284a8f[_0x64a8('0x1c')]=_0x316a6e;if(!_0x284a8f['interaction'][_0x64a8('0xc8')]){return;}return db[_0x64a8('0xc9')][_0x64a8('0x6f')]({'attributes':['id',_0x64a8('0x2e')],'where':{'id':_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xc8')]}});})[_0x64a8('0x14')](function(_0x4dc487){if(_0x4dc487){_0x284a8f[_0x64a8('0xb5')]['unshift']({'id':0x0,'priority':0x0,'app':_0x64a8('0xca'),'appdata':_0x4dc487[_0x64a8('0x2e')]+','+(_0x284a8f['account'][_0x64a8('0xcb')]||0xa),'interval':_0x64a8('0xc5')});_0x284a8f[_0x64a8('0xcc')]=!![];}if(!_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xcd')]){return;}return db[_0x64a8('0xce')][_0x64a8('0x6f')]({'attributes':['id','name'],'where':{'id':_0x284a8f[_0x64a8('0xbe')][_0x64a8('0xcd')]}});})[_0x64a8('0x14')](function(_0x3e8b2e){if(_0x3e8b2e){_0x284a8f[_0x64a8('0xb5')][_0x64a8('0xcf')]({'id':0x0,'priority':0x1,'app':_0x64a8('0xd0'),'appdata':_0x3e8b2e[_0x64a8('0x2e')]+','+(_0x284a8f[_0x64a8('0xb3')][_0x64a8('0xd1')]||0x12c),'interval':_0x64a8('0xc5')});}return respondWithRpcPromise(_0x64a8('0xd2'),_0x64a8('0xd3'),_0x284a8f);})['then'](function(_0x430f6a){respondWithRpcPromise(_0x64a8('0xd4'),'EventManager',{'event':_0x64a8('0x9a'),'message':_0x430f6a},client9002);return _0x430f6a;})[_0x64a8('0x14')](respondWithResult(_0x2a61d6,null))[_0x64a8('0x1e')](APIHandleError(_0x2a61d6));};exports[_0x64a8('0xd5')]=function(_0xb783da,_0x18c24c){var _0x525331,_0x41f566,_0x4560df;var _0x5f2093=[];var _0x1a026c={};var _0xb41b65=_0xb783da['files']||[];var _0x4cc7a6=[];var _0xd3fb7a;return db[_0x64a8('0x9c')][_0x64a8('0x78')]()[_0x64a8('0x14')](function(_0x1e154b){if(!_0x1e154b){throw new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0x9e'));}_0x5f2093=_['difference'](_[_0x64a8('0x59')](_0x1e154b),[_0x64a8('0xa0'),'updatedAt',_0x64a8('0xa2'),_0x64a8('0xa3')]);if(_0xb783da[_0x64a8('0x77')]['id']){delete _0xb783da[_0x64a8('0x77')]['id'];}if(_['isNil'](_0xb783da[_0x64a8('0x77')][_0x64a8('0xa4')])){throw _0x18c24c['status'](0x1f4)[_0x64a8('0x2f')](new db['Sequelize'][(_0x64a8('0xa6'))](_0x64a8('0xa5')));}if(_[_0x64a8('0x8e')](_0xb783da[_0x64a8('0x77')][_0x64a8('0x77')])||_0xb783da['body'][_0x64a8('0x77')]===''){throw _0x18c24c['status'](0x1f4)[_0x64a8('0x2f')](new db['Sequelize']['ValidationError'](_0x64a8('0xa7')));}if(_[_0x64a8('0x8e')](_0xb783da[_0x64a8('0x77')][_0x64a8('0xd6')])){throw _0x18c24c[_0x64a8('0x20')](0x1f4)['send'](new db[(_0x64a8('0x9d'))][(_0x64a8('0xa6'))](_0x64a8('0xd7')+_0x5f2093));}if(!_[_0x64a8('0xaa')](_0x5f2093,_0xb783da[_0x64a8('0x77')][_0x64a8('0xd6')])){throw _0x18c24c[_0x64a8('0x20')](0x1f4)['send'](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5f2093));}_0x1a026c[_0xb783da[_0x64a8('0x77')]['mapKeyOffline']]=_0xb783da['body'][_0x64a8('0xa4')];})['then'](function(){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0xb783da[_0x64a8('0x6c')]['id']},'include':[{'model':db[_0x64a8('0xd8')],'as':_0x64a8('0xac')},{'model':db[_0x64a8('0xd9')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x18c24c,null))[_0x64a8('0x14')](function(_0x3524cb){if(_0x3524cb&&_0x3524cb[_0x64a8('0xac')]){_0x41f566=_0x3524cb;var _0x49b9d8=_['defaults'](_0xb783da['body'],{'firstName':_0xb783da['body'][_0x64a8('0xa4')],'phone':_0xb783da[_0x64a8('0x77')][_0x64a8('0xa4')],'ListId':_0x3524cb['ListId']});_0x49b9d8[_0xb783da[_0x64a8('0x77')]['mapKeyOffline']]=_0xb783da[_0x64a8('0x77')][_0x64a8('0xa4')];return db[_0x64a8('0x9c')]['findOrCreate']({'where':_0x1a026c,'defaults':_0x49b9d8});}})[_0x64a8('0xb2')](function(_0x31cf3b){if(_0x31cf3b){_0x4560df=_0x31cf3b;var _0x43dc08=fs[_0x64a8('0xda')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0xdb')),_0x64a8('0xdc'));var _0x31ad45=ejs['render'](_0x43dc08,{'body':_[_0x64a8('0xdd')](_0xb783da[_0x64a8('0x77')][_0x64a8('0x77')]),'bodyTitle':_0x41f566[_0x64a8('0xde')]});return db[_0x64a8('0xdf')][_0x64a8('0x70')]({'body':_0x31ad45,'plainBody':htmlToText[_0x64a8('0xe0')](_0x31ad45),'ContactId':_0x31cf3b['id'],'ChatWebsiteId':_0x41f566['id']});}})[_0x64a8('0x14')](function(_0x5504bd){_0xd3fb7a=_0x5504bd;if(_0xb41b65['length']){var _0x442e46=_0xb41b65[_0x64a8('0x54')](function(_0x14985b){return{'name':_0x14985b['originalname'],'basename':_0x14985b[_0x64a8('0x84')],'type':_0x14985b[_0x64a8('0xe1')],'ChatOfflineMessageId':_0x5504bd['id']};});_0x4cc7a6=_0x442e46[_0x64a8('0x54')](_0x1bd6e5=>{var _0x36bb2f={'filename':_0x1bd6e5[_0x64a8('0x2e')],'path':path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0xe2'),_0x64a8('0xe3'),'attachments',_0x64a8('0xe4'),_0x1bd6e5['basename'])};return _0x36bb2f;});if(!_0x41f566[_0x64a8('0xe5')]){return db['sequelize'][_0x64a8('0xe6')](function(_0x2ec538){return db['Attachment'][_0x64a8('0xe7')](_0x442e46,{'transaction':_0x2ec538});});}}})[_0x64a8('0x14')](function(){if(_0xd3fb7a){_0x525331=_0xd3fb7a;return db[_0x64a8('0xd9')][_0x64a8('0x7b')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x64a8('0xe8'),'raw':!![],'include':[{'model':db[_0x64a8('0xe9')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x64a8('0x14')](function(_0x359b3b){if(_0x359b3b&&_0x359b3b[_0x64a8('0xe8')]&&_0x41f566[_0x64a8('0xea')]&&_0x41f566[_0x64a8('0xeb')]){var _0x56227e=_0x359b3b['getSmtpOptions']();return respondWithRpcPromise(_0x64a8('0xec'),_0x64a8('0xed'),{'account':_0x56227e,'message':{'from':util[_0x64a8('0x33')](_0x64a8('0xee'),_0x359b3b[_0x64a8('0x2e')],_0x359b3b[_0x64a8('0xef')]||_0x359b3b[_0x64a8('0xe8')]['user']),'to':_0x41f566[_0x64a8('0xeb')],'subject':_0x41f566[_0x64a8('0xf0')],'html':_0x525331['body'],'attachments':_0x4cc7a6}},client9003)['then'](function(){return _0x525331;})[_0x64a8('0x1e')](function(_0x4570ff){logger[_0x64a8('0x1a')](_0x4570ff);});}})[_0x64a8('0x14')](function(){if(_0x41f566&&_0x41f566[_0x64a8('0xe5')]&&_0x41f566[_0x64a8('0xf1')]){var _0x4549c0=[];if(_0xb41b65[_0x64a8('0x5f')]){_0x4549c0=_0xb41b65[_0x64a8('0x54')](function(_0x31bdfa){return{'name':_0x31bdfa[_0x64a8('0xf2')],'basename':_0x31bdfa[_0x64a8('0x84')],'type':_0x31bdfa[_0x64a8('0xe1')],'ChatOfflineMessageId':_0xd3fb7a['id']};});}var _0x25fc7b;if(!_[_0x64a8('0x8e')](_0x41f566[_0x64a8('0xf3')])){var _0x1bb522=_[_0x64a8('0x54')](_0xb783da['body'],function(_0x4ae209){return _0x4ae209;});var _0x3b454f=_['toPairsIn'](_0x1bb522)[0x0];var _0x535c14=_[_0x64a8('0xf4')](_0x3b454f,function(_0x4a837c){return _0x4a837c;});_0x25fc7b=_0x535c14[0x1][_0x41f566['subjectOffline']];}var _0x3bec3c={'from':_0x4560df[_0x64a8('0xef')],'firstName':_0x4560df['firstName'],'lastName':_0x4560df['lastName'],'mapKey':'email','message':{'from':_0x4560df[_0x64a8('0xef')],'to':_0x41f566[_0x64a8('0xd9')][_0x64a8('0xef')],'cc':'','subject':_[_0x64a8('0x8e')](_0x25fc7b)?_0x41f566[_0x64a8('0xf0')]:_0x25fc7b,'messageId':'','sentAt':new Date(),'attach':_0x4549c0[_0x64a8('0x5f')],'attachments':_0x4549c0,'originChannel':_0x64a8('0xf5'),'ChatWebsiteId':_0x41f566['id'],'ChatOfflineMessageId':_0x525331['id'],'originTo':_0x41f566[_0x64a8('0xd9')][_0x64a8('0xef')]},'body':_0x525331[_0x64a8('0x77')]};var _0xd87551={'account':{'id':_0x41f566['MailAccountId']},'body':_0x3bec3c,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x64a8('0xf6'),_0x64a8('0xf7'),_0xd87551,client9001)['then'](function(){return _0x525331;})['catch'](function(_0x4c8413){logger[_0x64a8('0x1a')](_0x4c8413);});}return;})[_0x64a8('0x14')](function(){if(_0x525331){return _0x525331;}})[_0x64a8('0x14')](respondWithResult(_0x18c24c,null))[_0x64a8('0x1e')](function(){for(var _0x267b76 of _0xb41b65){var _0x3a71f2=path[_0x64a8('0x90')](config['root'],_0x64a8('0xe2'),'files',_0x64a8('0xf8'),_0x64a8('0xe4'),_0x267b76[_0x64a8('0x84')]);fs_extra[_0x64a8('0xf9')](_0x3a71f2)[_0x64a8('0x1e')](function(_0x117dd4){logger[_0x64a8('0x1a')](_0x64a8('0xfa'),_0x3a71f2,_0x117dd4);});}});};exports['addInteraction']=function(_0x261d85,_0x6ee599){return db[_0x64a8('0xbc')][_0x64a8('0x6f')]({'where':{'id':_0x261d85[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x6ee599,null))[_0x64a8('0x14')](function(_0x3301d0){if(_0x3301d0){return _0x3301d0[_0x64a8('0xfb')](_0x261d85[_0x64a8('0x77')][_0x64a8('0xfc')],_['omit'](_0x261d85[_0x64a8('0x77')],['ids','id'])||{});}})['then'](respondWithResult(_0x6ee599,null))[_0x64a8('0x1e')](handleError(_0x6ee599,null));};exports[_0x64a8('0xfd')]=function(_0x287600,_0x40b582){var _0x246745={'raw':![],'where':{}};var _0x1c778a={};var _0x20a0c2={'count':0x0,'rows':[]};return db[_0x64a8('0x55')]['findOne']({'where':{'id':_0x287600['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x40b582,null))[_0x64a8('0x14')](function(_0x1237e8){if(_0x1237e8){_0x1c778a[_0x64a8('0x4d')]=_['keys'](db[_0x64a8('0xbc')][_0x64a8('0x56')]);_0x1c778a[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x287600[_0x64a8('0x5b')]);_0x1c778a['filters']=_[_0x64a8('0x5d')](_0x1c778a[_0x64a8('0x4d')],_0x1c778a['query']);_0x246745['attributes']=_[_0x64a8('0x5d')](_0x1c778a[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x287600['query']['fields']));_0x246745[_0x64a8('0x5c')]=_0x246745[_0x64a8('0x5c')]['length']?_0x246745[_0x64a8('0x5c')]:_0x1c778a[_0x64a8('0x4d')];if(!_0x287600[_0x64a8('0x5b')][_0x64a8('0x60')]('nolimit')){_0x246745[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x287600['query'][_0x64a8('0x23')]);_0x246745['offset']=qs['offset'](_0x287600['query'][_0x64a8('0x26')]);}_0x246745[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x287600[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x246745[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_[_0x64a8('0x80')](_0x287600[_0x64a8('0x5b')],_0x1c778a[_0x64a8('0x5a')]));_0x246745[_0x64a8('0x64')][_0x64a8('0x79')]=_0x1237e8['id'];if(_0x287600[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x246745[_0x64a8('0x64')]=_[_0x64a8('0x67')](_0x246745['where'],{'$or':_[_0x64a8('0x54')](_0x246745[_0x64a8('0x5c')],function(_0x47ebaf){var _0x320e48={};_0x320e48[_0x47ebaf]={'$like':'%'+_0x287600[_0x64a8('0x5b')][_0x64a8('0x65')]+'%'};return _0x320e48;})});}_0x246745=_[_0x64a8('0x67')]({},_0x246745,_0x287600[_0x64a8('0x68')]);return db[_0x64a8('0xbc')][_0x64a8('0x25')]({'where':_0x246745['where']})['then'](function(_0x4a51dd){_0x20a0c2[_0x64a8('0x25')]=_0x4a51dd;if(_0x287600[_0x64a8('0x5b')][_0x64a8('0x6e')]){_0x246745[_0x64a8('0x69')]=[{'model':db[_0x64a8('0x9c')],'as':_0x64a8('0xfe'),'required':![]},{'model':db[_0x64a8('0xc9')],'as':'Owner','attributes':[_0x64a8('0x2e'),_0x64a8('0xff'),_0x64a8('0x100')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x64a8('0x2e'),_0x64a8('0x101')],'where':_0x287600['query'][_0x64a8('0x102')]?{'id':_0x287600[_0x64a8('0x5b')]['tag']}:undefined,'required':_0x287600[_0x64a8('0x5b')][_0x64a8('0x102')]?!![]:![]}];}return db[_0x64a8('0xbc')][_0x64a8('0x7c')](_0x246745);})[_0x64a8('0x14')](function(_0x1a4fa7){_0x20a0c2['rows']=_0x1a4fa7;return _0x20a0c2;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x40b582,_0x246745))[_0x64a8('0x1e')](handleError(_0x40b582,null));};exports[_0x64a8('0x31')]=function(_0x55fb35,_0x4e73f7){var _0x438e01=0x0;var _0x1b2866=0x0;var _0x2a7017=![];var _0x18bf0b;var _0x480af3;return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x55fb35['params']['id']},'include':[{'model':db['Interval'],'as':_0x64a8('0xb1'),'include':[{'model':db[_0x64a8('0xb1')],'as':'Intervals','attributes':['id',_0x64a8('0x34')]}]}]})[_0x64a8('0x14')](handleEntityNotFound(_0x4e73f7,null))[_0x64a8('0x14')](function(_0x55fac6){if(_0x55fac6){_0x18bf0b=_0x55fac6;return _0x55fac6['getProactiveActions']({'raw':!![]});}})[_0x64a8('0x14')](function(_0x3fa940){if(_0x18bf0b){if(_0x3fa940){_0x480af3=_0x3fa940;}}return require('../../config/license/util')[_0x64a8('0x8d')]();})[_0x64a8('0x14')](function(_0x621352){if(_0x621352){_0x1b2866=_0x621352[_0x64a8('0x103')];_0x2a7017=_0x621352[_0x64a8('0x104')];}})['then'](function(){return db[_0x64a8('0xbc')][_0x64a8('0x25')]({'where':{'closed':![]}});})[_0x64a8('0x14')](function(_0x217ad3){_0x438e01=_0x217ad3;if(_0x1b2866&&_0x217ad3>_0x1b2866){return db[_0x64a8('0x105')][_0x64a8('0x7b')]({'where':{'id':0x1}})[_0x64a8('0x14')](function(_0xe962db){if(_0xe962db){_0xe962db[_0x64a8('0x106')](_0x64a8('0x107'));}});}})[_0x64a8('0x14')](function(){if(!_0x18bf0b[_0x64a8('0xb1')]||!_0x18bf0b[_0x64a8('0xb1')][_0x64a8('0x3c')])return!![];return checkWebsiteIntervals(_0x18bf0b);})[_0x64a8('0x14')](function(_0x93dab){var _0x448829=fs[_0x64a8('0xda')](path[_0x64a8('0x90')](config[_0x64a8('0x91')],_0x64a8('0x108')),_0x64a8('0xdc'));var _0x37a6b2=new url[(_0x64a8('0x109'))](_0x18bf0b[_0x64a8('0x10a')])[_0x64a8('0x10b')];var _0x5754f9=_0x64a8('0x10c');var _0x556297=![];var _0xc20cb9={'chatVersion':_0x5754f9,'chatWebsiteAddressOrigin':_0x37a6b2,'remote':_0x18bf0b[_0x64a8('0x10d')],'query':querystring[_0x64a8('0x19')](_['merge'](_0x18bf0b[_0x64a8('0x2a')]({'plain':!![]}),{'customerIp':_0x55fb35[_0x64a8('0xba')][_0x64a8('0x44')]||_0x55fb35[_0x64a8('0xba')][_0x64a8('0x10e')]||_0x55fb35['connection']['remoteAddress']||_0x55fb35['ip'],'referer':_0x55fb35[_0x64a8('0xba')][_0x64a8('0x10f')],'openedInteractions':_0x438e01,'maxInteractions':_0x1b2866,'virtual':_0x2a7017[_0x64a8('0x103')],'online':_0x93dab,'custom':_0x2a7017}))[_0x64a8('0x110')](/'/g,'\x5c\x27')};_0x4e73f7[_0x64a8('0x2f')](ejs[_0x64a8('0x111')](Mustache[_0x64a8('0x111')](_0x448829,_0xc20cb9),{'proactiveActions':_0x480af3,'alignment':_0x18bf0b[_0x64a8('0x112')],'verticalAlignment':_0x18bf0b[_0x64a8('0x113')],'div_color':_0x18bf0b[_0x64a8('0x101')],'labelText':_0x18bf0b['labelText'],'text_color':_0x18bf0b[_0x64a8('0x114')],'text_button_color':_0x18bf0b[_0x64a8('0x115')],'button_color':_0x18bf0b['color_button'],'background_color':_0x18bf0b[_0x64a8('0x116')],'hideWhenOffline':_0x18bf0b[_0x64a8('0x117')],'intervalId':_0x18bf0b[_0x64a8('0x118')],'isDevelopment':_0x556297,'chatVersion':_0x5754f9}));})['catch'](handleError(_0x4e73f7,null));};exports[_0x64a8('0x119')]=function(_0x433170,_0x141c3a){var _0x2e90ca=_0x433170[_0x64a8('0x6c')]['id'];var _0x190cb5=_0x433170['body'];var _0x5239c9=0xc8;var _0x14c223=null;return db[_0x64a8('0x11a')][_0x64a8('0xe6')]({'isolationLevel':db[_0x64a8('0x11a')]['Transaction'][_0x64a8('0x11b')][_0x64a8('0x11c')]},function(_0x3c914d){return db[_0x64a8('0x55')][_0x64a8('0x7b')]({'where':{'id':_0x2e90ca},'transaction':_0x3c914d})['then'](function(_0x16d6b1){if(_0x16d6b1){return db[_0x64a8('0xaf')][_0x64a8('0x2c')]({'where':{'ChatWebsiteId':_0x2e90ca},'transaction':_0x3c914d})[_0x64a8('0x14')](function(){var _0x59520d=_[_0x64a8('0x54')](_0x190cb5,function(_0x8410c){_0x8410c[_0x64a8('0x79')]=_0x2e90ca;return _0x8410c;});return db[_0x64a8('0xaf')][_0x64a8('0xe7')](_0x59520d,{'transaction':_0x3c914d});});}else{_0x5239c9=0x194;_0x14c223=[];}});})[_0x64a8('0x14')](function(){if(_0x5239c9!==0x194){return db[_0x64a8('0xaf')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x2e90ca},'order':_0x64a8('0xb7')})[_0x64a8('0x14')](function(_0x313236){_0x14c223=_0x313236;});}})[_0x64a8('0x1e')](function(_0x3197d8){_0x5239c9=0x1f4;logger[_0x64a8('0x1a')](_0x3197d8[_0x64a8('0x2d')]);if(_0x3197d8[_0x64a8('0x2e')]){delete _0x3197d8[_0x64a8('0x2e')];}_0x14c223=_0x3197d8;})[_0x64a8('0x11d')](function(){if(_0x14c223===null){_0x141c3a[_0x64a8('0x1f')](_0x5239c9);}else{if(_0x5239c9===0x1f4){_0x141c3a['status'](_0x5239c9)[_0x64a8('0x2f')](_0x14c223);}else{_0x141c3a['status'](_0x5239c9)['json'](_0x14c223);}}});};exports[_0x64a8('0x11e')]=function(_0x533cd9,_0x3820fa){var _0x1d1541={};var _0x3c21a5={};var _0x41a368;var _0x68b6c6;return db[_0x64a8('0x55')]['findOne']({'where':{'id':_0x533cd9['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x3820fa,null))[_0x64a8('0x14')](function(_0x3984b7){if(_0x3984b7){_0x41a368=_0x3984b7;_0x3c21a5[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db['ChatApplication'][_0x64a8('0x56')]);_0x3c21a5[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x533cd9['query']);_0x3c21a5['filters']=_[_0x64a8('0x5d')](_0x3c21a5[_0x64a8('0x4d')],_0x3c21a5[_0x64a8('0x5b')]);_0x1d1541[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x3c21a5['model'],qs[_0x64a8('0x5e')](_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x1d1541[_0x64a8('0x5c')]=_0x1d1541[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x1d1541[_0x64a8('0x5c')]:_0x3c21a5['model'];_0x1d1541[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x1d1541[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_[_0x64a8('0x80')](_0x533cd9[_0x64a8('0x5b')],_0x3c21a5['filters']));if(_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x1d1541[_0x64a8('0x64')]=_['merge'](_0x1d1541[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x1d1541[_0x64a8('0x5c')],function(_0x575d26){var _0x4f9318={};_0x4f9318[_0x575d26]={'$like':'%'+_0x533cd9['query'][_0x64a8('0x65')]+'%'};return _0x4f9318;})});}_0x1d1541=_['merge']({},_0x1d1541,_0x533cd9['options']);return _0x41a368['getApplications'](_0x1d1541);}})['then'](function(_0x1e333e){if(_0x1e333e){_0x68b6c6=_0x1e333e[_0x64a8('0x5f')];if(!_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x60')]('nolimit')){_0x1d1541[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x533cd9['query'][_0x64a8('0x23')]);_0x1d1541[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x533cd9[_0x64a8('0x5b')][_0x64a8('0x26')]);}return _0x41a368[_0x64a8('0x11e')](_0x1d1541);}})[_0x64a8('0x14')](function(_0x396a59){if(_0x396a59){return _0x396a59?{'count':_0x68b6c6,'rows':_0x396a59}:null;}})[_0x64a8('0x14')](respondWithResult(_0x3820fa,null))['catch'](handleError(_0x3820fa,null));};exports[_0x64a8('0x11f')]=function(_0x1c11a5,_0x13b667){return db[_0x64a8('0x120')][_0x64a8('0x6f')]({'where':{'id':_0x1c11a5['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x13b667,null))['then'](function(_0xb4c885){if(_0xb4c885){return _0xb4c885[_0x64a8('0x11f')](_0x1c11a5['body'][_0x64a8('0xfc')],_['omit'](_0x1c11a5[_0x64a8('0x77')],['ids','id'])||{});}})['then'](respondWithResult(_0x13b667,null))[_0x64a8('0x1e')](handleError(_0x13b667,null));};exports['getProactiveActions']=function(_0x494779,_0x2641db){var _0x57f251={};var _0x1e5e91={};var _0x1b788f;var _0x17a7db;return db['ChatWebsite'][_0x64a8('0x7b')]({'where':{'id':_0x494779[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x2641db,null))[_0x64a8('0x14')](function(_0x3581d5){if(_0x3581d5){_0x1b788f=_0x3581d5;_0x1e5e91[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db[_0x64a8('0x121')]['rawAttributes']);_0x1e5e91[_0x64a8('0x5b')]=_['keys'](_0x494779[_0x64a8('0x5b')]);_0x1e5e91[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x1e5e91[_0x64a8('0x4d')],_0x1e5e91[_0x64a8('0x5b')]);_0x57f251[_0x64a8('0x5c')]=_['intersection'](_0x1e5e91[_0x64a8('0x4d')],qs[_0x64a8('0x5e')](_0x494779[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x57f251[_0x64a8('0x5c')]=_0x57f251[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x57f251['attributes']:_0x1e5e91['model'];_0x57f251[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x494779[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x57f251[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_[_0x64a8('0x80')](_0x494779[_0x64a8('0x5b')],_0x1e5e91[_0x64a8('0x5a')]));if(_0x494779[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x57f251['where']=_[_0x64a8('0x67')](_0x57f251['where'],{'$or':_[_0x64a8('0x54')](_0x57f251['attributes'],function(_0x5d2c9a){var _0x122e7d={};_0x122e7d[_0x5d2c9a]={'$like':'%'+_0x494779['query'][_0x64a8('0x65')]+'%'};return _0x122e7d;})});}_0x57f251=_[_0x64a8('0x67')]({},_0x57f251,_0x494779[_0x64a8('0x68')]);return _0x1b788f[_0x64a8('0x122')](_0x57f251);}})[_0x64a8('0x14')](function(_0x22ec09){if(_0x22ec09){_0x17a7db=_0x22ec09[_0x64a8('0x5f')];if(!_0x494779[_0x64a8('0x5b')][_0x64a8('0x60')]('nolimit')){_0x57f251[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x494779[_0x64a8('0x5b')][_0x64a8('0x23')]);_0x57f251[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x494779['query'][_0x64a8('0x26')]);}return _0x1b788f[_0x64a8('0x122')](_0x57f251);}})['then'](function(_0x1e7630){if(_0x1e7630){return _0x1e7630?{'count':_0x17a7db,'rows':_0x1e7630}:null;}})['then'](respondWithResult(_0x2641db,null))['catch'](handleError(_0x2641db,null));};exports[_0x64a8('0x123')]=function(_0xcb46b0,_0x5f25b5){var _0x1019fd=_0xcb46b0[_0x64a8('0x5b')][_0x64a8('0x124')]===_0x64a8('0x125')?_0x64a8('0x126'):'onlineForm';return db[_0x64a8('0x55')]['find']({'attributes':['id',_0x1019fd],'where':{'id':_0xcb46b0[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x5f25b5,null))[_0x64a8('0x14')](function(_0x3fbed4){if(_0x3fbed4){var _0x2d92cb=_0x3fbed4[_0x1019fd];var _0x9b8a24=_0x2d92cb&&_0x2d92cb['items']?_0x2d92cb[_0x64a8('0x127')]:[];_0x5f25b5[_0x64a8('0x2f')]({'fromKey':_['isNil'](_0x2d92cb[_0x64a8('0x128')])?undefined:_0x2d92cb[_0x64a8('0x128')],'count':_0x9b8a24[_0x64a8('0x5f')],'rows':_0x9b8a24});}})['catch'](handleError(_0x5f25b5,null));};exports[_0x64a8('0x129')]=function(_0x445686,_0x35e000){var _0x3bcd8d={'raw':![],'where':{}};var _0x185296={};var _0x1ccb30={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x64a8('0x7b')]({'where':{'id':_0x445686[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x35e000,null))[_0x64a8('0x14')](function(_0x39639b){if(_0x39639b){_0x185296[_0x64a8('0x4d')]=_[_0x64a8('0x59')](db['ChatOfflineMessage'][_0x64a8('0x56')]);_0x185296[_0x64a8('0x5b')]=_['keys'](_0x445686[_0x64a8('0x5b')]);_0x185296[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x185296[_0x64a8('0x4d')],_0x185296[_0x64a8('0x5b')]);_0x3bcd8d[_0x64a8('0x5c')]=_[_0x64a8('0x5d')](_0x185296[_0x64a8('0x4d')],qs['fields'](_0x445686[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x3bcd8d[_0x64a8('0x5c')]=_0x3bcd8d[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x3bcd8d[_0x64a8('0x5c')]:_0x185296[_0x64a8('0x4d')];if(!_0x445686[_0x64a8('0x5b')]['hasOwnProperty'](_0x64a8('0x61'))){_0x3bcd8d[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x445686[_0x64a8('0x5b')]['limit']);_0x3bcd8d[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x445686['query'][_0x64a8('0x26')]);}_0x3bcd8d[_0x64a8('0x62')]=qs[_0x64a8('0x63')](_0x445686[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x3bcd8d[_0x64a8('0x64')]=qs[_0x64a8('0x5a')](_['pick'](_0x445686[_0x64a8('0x5b')],_0x185296[_0x64a8('0x5a')]));_0x3bcd8d[_0x64a8('0x64')]['ChatWebsiteId']=_0x39639b['id'];if(_0x445686[_0x64a8('0x5b')][_0x64a8('0x65')]){_0x3bcd8d['where']=_[_0x64a8('0x67')](_0x3bcd8d['where'],{'$or':_['map'](_0x3bcd8d[_0x64a8('0x5c')],function(_0x324e39){var _0x52b2e5={};_0x52b2e5[_0x324e39]={'$like':'%'+_0x445686['query'][_0x64a8('0x65')]+'%'};return _0x52b2e5;})});}_0x3bcd8d=_[_0x64a8('0x67')]({},_0x3bcd8d,_0x445686['options']);return db['ChatOfflineMessage'][_0x64a8('0x25')]({'where':_0x3bcd8d[_0x64a8('0x64')]})[_0x64a8('0x14')](function(_0x6122c8){_0x1ccb30[_0x64a8('0x25')]=_0x6122c8;if(_0x445686[_0x64a8('0x5b')][_0x64a8('0x6e')]){_0x3bcd8d[_0x64a8('0x69')]=[{'all':!![]}];}else{_0x3bcd8d[_0x64a8('0x69')]=[{'model':db[_0x64a8('0x9c')],'as':'Contact','required':![]},{'model':db[_0x64a8('0x12a')],'as':'Attachments','required':![]}];}return db[_0x64a8('0xdf')]['findAll'](_0x3bcd8d);})[_0x64a8('0x14')](function(_0x2d4cba){_0x1ccb30[_0x64a8('0x6a')]=_0x2d4cba;return _0x1ccb30;});}})[_0x64a8('0x14')](respondWithFilteredResult(_0x35e000,_0x3bcd8d))['catch'](handleError(_0x35e000,null));};exports[_0x64a8('0x12b')]=function(_0x53722a,_0xe62f9c){return db[_0x64a8('0x55')]['find']({'where':{'id':_0x53722a[_0x64a8('0x6c')]['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0xe62f9c,null))['then'](function(_0x355948){if(_0x355948){return _0x355948[_0x64a8('0x12b')](_0x53722a['body']['ids'],_['omit'](_0x53722a[_0x64a8('0x77')],[_0x64a8('0xfc'),'id'])||{})[_0x64a8('0xb2')](function(_0x5706a4){for(var _0x4e4c0c=0x0;_0x4e4c0c<_0x53722a[_0x64a8('0x77')][_0x64a8('0xfc')]['length'];_0x4e4c0c+=0x1){socket[_0x64a8('0x12c')](_0x64a8('0x12d'),{'UserId':Number(_0x53722a[_0x64a8('0x77')]['ids'][_0x4e4c0c]),'ChatWebsiteId':Number(_0x53722a[_0x64a8('0x6c')]['id'])});}return _0x5706a4;});}})['then'](respondWithResult(_0xe62f9c,null))['catch'](handleError(_0xe62f9c,null));};exports[_0x64a8('0x12e')]=function(_0x4e5897,_0x356b00){return db[_0x64a8('0x55')][_0x64a8('0x6f')]({'where':{'id':_0x4e5897['params']['id']}})[_0x64a8('0x14')](handleEntityNotFound(_0x356b00,null))[_0x64a8('0x14')](function(_0x5a2af3){if(_0x5a2af3){return _0x5a2af3[_0x64a8('0x12e')](_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')])[_0x64a8('0x14')](function(){if(_['isArray'](_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')])){for(var _0x51641=0x0;_0x51641<_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')]['length'];_0x51641+=0x1){socket[_0x64a8('0x12c')](_0x64a8('0x12f'),{'UserId':Number(_0x4e5897[_0x64a8('0x5b')][_0x64a8('0xfc')][_0x51641]),'ChatWebsiteId':Number(_0x4e5897[_0x64a8('0x6c')]['id'])});}}else{socket['emit'](_0x64a8('0x12f'),{'UserId':Number(_0x4e5897[_0x64a8('0x5b')]['ids']),'ChatWebsiteId':Number(_0x4e5897[_0x64a8('0x6c')]['id'])});}});}})[_0x64a8('0x14')](respondWithStatusCode(_0x356b00,null))[_0x64a8('0x1e')](handleError(_0x356b00,null));};exports[_0x64a8('0x130')]=function(_0x23d4dc,_0x3a9b78){var _0x4c957a={};var _0x255240={};var _0x5ade7c;var _0x10df4e;return db[_0x64a8('0x55')]['findOne']({'where':{'id':_0x23d4dc[_0x64a8('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3a9b78,null))[_0x64a8('0x14')](function(_0x5d54c0){if(_0x5d54c0){_0x5ade7c=_0x5d54c0;_0x255240[_0x64a8('0x4d')]=_['keys'](db[_0x64a8('0xc9')][_0x64a8('0x56')]);_0x255240[_0x64a8('0x5b')]=_[_0x64a8('0x59')](_0x23d4dc[_0x64a8('0x5b')]);_0x255240[_0x64a8('0x5a')]=_[_0x64a8('0x5d')](_0x255240['model'],_0x255240[_0x64a8('0x5b')]);_0x4c957a[_0x64a8('0x5c')]=_['intersection'](_0x255240['model'],qs[_0x64a8('0x5e')](_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x5e')]));_0x4c957a[_0x64a8('0x5c')]=_0x4c957a[_0x64a8('0x5c')][_0x64a8('0x5f')]?_0x4c957a[_0x64a8('0x5c')]:_0x255240[_0x64a8('0x4d')];_0x4c957a[_0x64a8('0x62')]=qs['sort'](_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x63')]);_0x4c957a['where']=qs['filters'](_['pick'](_0x23d4dc['query'],_0x255240[_0x64a8('0x5a')]));if(_0x23d4dc[_0x64a8('0x5b')]['filter']){_0x4c957a['where']=_['merge'](_0x4c957a[_0x64a8('0x64')],{'$or':_[_0x64a8('0x54')](_0x4c957a[_0x64a8('0x5c')],function(_0x3c5d4d){var _0x10cb41={};_0x10cb41[_0x3c5d4d]={'$like':'%'+_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x65')]+'%'};return _0x10cb41;})});}_0x4c957a=_[_0x64a8('0x67')]({},_0x4c957a,_0x23d4dc[_0x64a8('0x68')]);return _0x5ade7c[_0x64a8('0x130')](_0x4c957a);}})[_0x64a8('0x14')](function(_0x580830){if(_0x580830){_0x10df4e=_0x580830['length'];if(!_0x23d4dc[_0x64a8('0x5b')]['hasOwnProperty'](_0x64a8('0x61'))){_0x4c957a[_0x64a8('0x23')]=qs[_0x64a8('0x23')](_0x23d4dc[_0x64a8('0x5b')]['limit']);_0x4c957a[_0x64a8('0x26')]=qs[_0x64a8('0x26')](_0x23d4dc[_0x64a8('0x5b')][_0x64a8('0x26')]);}return _0x5ade7c[_0x64a8('0x130')](_0x4c957a);}})[_0x64a8('0x14')](function(_0x4e5862){if(_0x4e5862){return _0x4e5862?{'count':_0x10df4e,'rows':_0x4e5862}:null;}})[_0x64a8('0x14')](respondWithResult(_0x3a9b78,null))[_0x64a8('0x1e')](handleError(_0x3a9b78,null));}; \ No newline at end of file +var _0x9944=['notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','x-real-ip','connection','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','Command','getSnippet','timezone','format','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','all','some','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','fieldName','key','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','ChatWebsite','includeAll','include','findAll','rows','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','headers','threadId','ChatInteraction','externalUrl','interaction','contact','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount'];(function(_0x32b9c5,_0x1c165d){var _0x589f31=function(_0x2e2ddf){while(--_0x2e2ddf){_0x32b9c5['push'](_0x32b9c5['shift']());}};_0x589f31(++_0x1c165d);}(_0x9944,0x16e));var _0x4994=function(_0xae32a4,_0x4d8d00){_0xae32a4=_0xae32a4-0x0;var _0x43d4f7=_0x9944[_0xae32a4];return _0x43d4f7;};'use strict';var Mustache=require(_0x4994('0x0'));var util=require('util');var path=require(_0x4994('0x1'));var ejs=require(_0x4994('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4994('0x3'));var querystring=require(_0x4994('0x4'));var htmlToText=require(_0x4994('0x5'));var Redis=require('ioredis');var jayson=require(_0x4994('0x6'));var url=require(_0x4994('0x7'));var qs=require(_0x4994('0x8'));var logger=require(_0x4994('0x9'))(_0x4994('0xa'));var config=require(_0x4994('0xb'));var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APINotFoundError=require(_0x4994('0xc'))['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0x4994('0xd')];var db=require(_0x4994('0xe'))['db'];config[_0x4994('0xf')]=_[_0x4994('0x10')](config[_0x4994('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x4994('0x11'))(new Redis(config[_0x4994('0xf')]));require(_0x4994('0x12'))[_0x4994('0x13')](socket);var client=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232c});var client9002=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232a});var client9003=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232b});var client9001=jayson[_0x4994('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x26b9fe,_0x5ea1ec,_0x4ad064,_0x1436e1){return new Promise(function(_0x4ae812,_0x36724e){var _0x16e75b=_0x1436e1||client;return _0x16e75b[_0x4994('0x16')](_0x26b9fe,_0x4ad064)[_0x4994('0x17')](function(_0x211cb0){logger[_0x4994('0x18')](_0x4994('0x19'),_0x5ea1ec,_0x4994('0x1a'));logger[_0x4994('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'),JSON[_0x4994('0x1c')](_0x211cb0));if(_0x211cb0[_0x4994('0x1d')]){if(_0x211cb0['error']['code']===0x1f4){logger['error'](_0x4994('0x19'),_0x5ea1ec,_0x211cb0['error'][_0x4994('0x1e')]);return _0x36724e(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);return _0x4ae812(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}else{logger[_0x4994('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'));_0x4ae812(_0x211cb0[_0x4994('0x1f')][_0x4994('0x1e')]);}})[_0x4994('0x20')](function(_0x6f2734){logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x6f2734);_0x36724e(_0x6f2734);});});}function respondWithStatusCode(_0x5d872c,_0x336b14){_0x336b14=_0x336b14||0xcc;return function(_0x31d249){if(_0x31d249){return _0x5d872c[_0x4994('0x21')](_0x336b14);}return _0x5d872c[_0x4994('0x22')](_0x336b14)[_0x4994('0x23')]();};}function respondWithResult(_0x521c10,_0xf0890){_0xf0890=_0xf0890||0xc8;return function(_0x250472){if(_0x250472){return _0x521c10[_0x4994('0x22')](_0xf0890)['json'](_0x250472);}};}function respondWithFilteredResult(_0x158fe8,_0x2ae073){return function(_0x1cd7c3){if(_0x1cd7c3){var _0x1b3826=typeof _0x2ae073[_0x4994('0x24')]===_0x4994('0x25')&&typeof _0x2ae073[_0x4994('0x26')]===_0x4994('0x25');var _0x279aab=_0x1cd7c3[_0x4994('0x27')];var _0x5d0492=_0x1b3826?0x0:_0x2ae073[_0x4994('0x24')];var _0x22b525=_0x1b3826?_0x1cd7c3[_0x4994('0x27')]:_0x2ae073[_0x4994('0x24')]+_0x2ae073[_0x4994('0x26')];var _0x5c8195;if(_0x22b525>=_0x279aab){_0x22b525=_0x279aab;_0x5c8195=0xc8;}else{_0x5c8195=0xce;}_0x158fe8['status'](_0x5c8195);return _0x158fe8[_0x4994('0x28')](_0x4994('0x29'),_0x5d0492+'-'+_0x22b525+'/'+_0x279aab)[_0x4994('0x2a')](_0x1cd7c3);}return null;};}function saveUpdates(_0x408a03){return function(_0x252ac8){if(_0x252ac8){return _0x252ac8[_0x4994('0x2b')](_0x408a03)['then'](function(_0x5d4f80){return _0x5d4f80;});}return null;};}function removeEntity(_0x1ec75a){return function(_0x30a7eb){if(_0x30a7eb){return _0x30a7eb[_0x4994('0x2c')]()[_0x4994('0x17')](function(){var _0x1ac13a=_0x30a7eb[_0x4994('0x2d')]({'plain':!![]});var _0x1e90ea=_0x4994('0x2e');return db[_0x4994('0x2f')]['destroy']({'where':{'type':_0x1e90ea,'resourceId':_0x1ac13a['id']}})[_0x4994('0x17')](function(){return _0x30a7eb;});})[_0x4994('0x17')](function(){_0x1ec75a[_0x4994('0x22')](0xcc)[_0x4994('0x23')]();});}};}function handleEntityNotFound(_0x513cd3){return function(_0x2b40a6){if(!_0x2b40a6){_0x513cd3['sendStatus'](0x194);}return _0x2b40a6;};}function handleError(_0x3431d2,_0x918041){_0x918041=_0x918041||0x1f4;return function(_0x357543){logger[_0x4994('0x1d')](_0x357543['stack']);if(_0x357543[_0x4994('0x30')]){delete _0x357543[_0x4994('0x30')];}_0x3431d2[_0x4994('0x22')](_0x918041)['send'](_0x357543);};}function iftimePromise(_0x59f43d,_0x478e6b){return respondWithRpcPromise(_0x4994('0x31'),_0x4994('0x32'),{'command':_0x478e6b[_0x4994('0x33')]?util[_0x4994('0x34')]('iftime\x20%s,%s',_0x59f43d['interval'],_0x478e6b[_0x4994('0x33')]):util[_0x4994('0x34')](_0x4994('0x35'),_0x59f43d['interval'])},client9002)[_0x4994('0x17')](function(_0x507f7b){var _0x198b64=_0x507f7b&&_0x507f7b[_0x4994('0x36')]('true')>=0x0?!![]:![];logger[_0x4994('0x18')](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],_0x198b64?_0x4994('0x39'):_0x4994('0x3a'),_0x478e6b[_0x4994('0x33')]?_0x478e6b[_0x4994('0x33')]:_0x4994('0x3b'));return _0x198b64;})[_0x4994('0x20')](function(_0x1ccad7){logger['error'](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],util[_0x4994('0x3c')](_0x1ccad7,{'showHidden':![],'depth':null}),_0x478e6b['timezone']?_0x478e6b['timezone']:_0x4994('0x3b'));return![];});}function checkWebsiteIntervals(_0x5182b0){var _0x52f334=_[_0x4994('0x3d')](_0x5182b0[_0x4994('0x3e')]['Intervals'],function(_0x1e8a2d){var _0x1bb36a=_0x1e8a2d[_0x4994('0x2d')]({'plain':!![]});return iftimePromise(_0x1bb36a,_0x5182b0);});return Promise[_0x4994('0x3f')](_0x52f334)[_0x4994('0x17')](function(_0x222d61){return _[_0x4994('0x40')](_0x222d61);});}function createInteractionObject(_0x11766c,_0x342876,_0x40ac64,_0x154a53){var _0x215dff=require(_0x4994('0x41'));var _0x1ae37d=new _0x215dff();var _0x298932=_0x1ae37d[_0x4994('0x42')](_0x40ac64['user-agent'])[_0x4994('0x43')]();var _0x24e263=_0x342876[_0x4994('0x44')];if(_0x40ac64[_0x4994('0x45')]){_0x24e263=_0x40ac64[_0x4994('0x45')];}else if(_0x40ac64[_0x4994('0x46')]){_0x24e263=_[_0x4994('0x47')](_0x40ac64[_0x4994('0x46')][_0x4994('0x48')](','));}return{'ContactId':_0x154a53['id'],'ChatWebsiteId':_0x11766c,'from':(_0x154a53[_0x4994('0x49')]||'')+'\x20'+(_0x154a53['lastName']||''),'customerIp':_0x24e263,'customerPort':_0x40ac64[_0x4994('0x4a')]?_0x40ac64['x-real-port']:null,'referer':_0x342876[_0x4994('0x4b')],'browserName':_0x298932['browser'][_0x4994('0x30')]&&_0x298932[_0x4994('0x4c')][_0x4994('0x4d')]?util['format'](_0x4994('0x4e'),_0x298932['browser']['name'],_0x298932['browser'][_0x4994('0x4d')]):_0x4994('0x4f'),'browserVersion':_0x298932['browser']['version']||_0x4994('0x4f'),'osName':util[_0x4994('0x34')](_0x4994('0x4e'),_0x298932['os'][_0x4994('0x30')],_0x298932['os']['version']),'osVersion':_0x298932['os'][_0x4994('0x4d')],'deviceModel':_0x298932[_0x4994('0x50')][_0x4994('0x51')]&&_0x298932['device'][_0x4994('0x52')]?util[_0x4994('0x34')](_0x4994('0x53'),_0x298932['device'][_0x4994('0x51')],_0x298932[_0x4994('0x50')][_0x4994('0x52')],_0x298932[_0x4994('0x50')][_0x4994('0x54')]):null,'deviceVendor':_0x298932[_0x4994('0x50')][_0x4994('0x52')],'deviceType':_0x298932['device'][_0x4994('0x54')],'formData':JSON[_0x4994('0x1c')](_0x342876)};}exports[_0x4994('0x55')]=function(_0x3da4f4,_0x7cd695){var _0x23d2f0={'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x39193d={},_0x2db1b2={'count':0x0,'rows':[]};var _0x115d7d=_[_0x4994('0x3d')](db['ChatWebsite']['rawAttributes'],function(_0x54cfe3){return{'name':_0x54cfe3[_0x4994('0x58')],'type':_0x54cfe3['type'][_0x4994('0x59')]};});_0x39193d[_0x4994('0x51')]=_['map'](_0x115d7d,'name');_0x39193d[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3da4f4['query']);_0x39193d[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x39193d[_0x4994('0x51')],_0x39193d['query']);_0x23d2f0['attributes']=_['intersection'](_0x39193d['model'],qs[_0x4994('0x5e')](_0x3da4f4['query'][_0x4994('0x5e')]));_0x23d2f0[_0x4994('0x5f')]=_0x23d2f0[_0x4994('0x5f')][_0x4994('0x60')]?_0x23d2f0[_0x4994('0x5f')]:_0x39193d['model'];if(!_0x3da4f4[_0x4994('0x5a')]['hasOwnProperty']('nolimit')){_0x23d2f0[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3da4f4['query'][_0x4994('0x26')]);_0x23d2f0[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3da4f4[_0x4994('0x5a')][_0x4994('0x24')]);}_0x23d2f0[_0x4994('0x61')]=qs['sort'](_0x3da4f4['query'][_0x4994('0x62')]);_0x23d2f0[_0x4994('0x63')]=qs['filters'](_['pick'](_0x3da4f4['query'],_0x39193d[_0x4994('0x5c')]),_0x115d7d);if(_0x3da4f4['query'][_0x4994('0x64')]){_0x23d2f0[_0x4994('0x63')]=_[_0x4994('0x65')](_0x23d2f0['where'],{'$or':_[_0x4994('0x3d')](_0x115d7d,function(_0x3d18e1){if(_0x3d18e1['type']!=='VIRTUAL'){var _0xb5845d={};_0xb5845d[_0x3d18e1[_0x4994('0x30')]]={'$like':'%'+_0x3da4f4[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0xb5845d;}})});}_0x23d2f0=_[_0x4994('0x65')]({},_0x23d2f0,_0x3da4f4['options']);var _0x4ebba7={'where':_0x23d2f0['where']};return db[_0x4994('0x66')][_0x4994('0x27')](_0x4ebba7)[_0x4994('0x17')](function(_0x20e102){_0x2db1b2[_0x4994('0x27')]=_0x20e102;if(_0x3da4f4['query'][_0x4994('0x67')]){_0x23d2f0[_0x4994('0x68')]=[{'all':!![]}];}return db['ChatWebsite'][_0x4994('0x69')](_0x23d2f0);})['then'](function(_0x191699){_0x2db1b2[_0x4994('0x6a')]=_0x191699;return _0x2db1b2;})[_0x4994('0x17')](respondWithFilteredResult(_0x7cd695,_0x23d2f0))['catch'](handleError(_0x7cd695,null));};exports['show']=function(_0x52d8e4,_0x3105db){var _0x59c7a4={'raw':![],'where':{'id':_0x52d8e4[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x2361e5={};_0x2361e5[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x66')][_0x4994('0x6c')]);_0x2361e5[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x52d8e4[_0x4994('0x5a')]);_0x2361e5[_0x4994('0x5c')]=_['intersection'](_0x2361e5['model'],_0x2361e5[_0x4994('0x5a')]);_0x59c7a4[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2361e5[_0x4994('0x51')],qs['fields'](_0x52d8e4[_0x4994('0x5a')][_0x4994('0x5e')]));_0x59c7a4[_0x4994('0x5f')]=_0x59c7a4[_0x4994('0x5f')][_0x4994('0x60')]?_0x59c7a4[_0x4994('0x5f')]:_0x2361e5[_0x4994('0x51')];if(_0x52d8e4['query'][_0x4994('0x67')]){_0x59c7a4['include']=[{'all':!![]}];}_0x59c7a4=_[_0x4994('0x65')]({},_0x59c7a4,_0x52d8e4['options']);return db['ChatWebsite']['find'](_0x59c7a4)[_0x4994('0x17')](handleEntityNotFound(_0x3105db,null))[_0x4994('0x17')](respondWithResult(_0x3105db,null))[_0x4994('0x20')](handleError(_0x3105db,null));};exports[_0x4994('0x6d')]=function(_0x473d68,_0x2279f6){return db[_0x4994('0x66')][_0x4994('0x6d')](_0x473d68[_0x4994('0x6e')],{})[_0x4994('0x17')](function(_0x4b9095){var _0x24eaff=_0x473d68[_0x4994('0x6f')][_0x4994('0x2d')]({'plain':!![]});if(!_0x24eaff)throw new Error(_0x4994('0x70'));if(_0x24eaff[_0x4994('0x71')]===_0x4994('0x6f')){var _0x55b8c4=_0x4b9095[_0x4994('0x2d')]({'plain':!![]});var _0x21b622=_0x4994('0x2e');return db[_0x4994('0x72')]['find']({'where':{'name':_0x21b622,'userProfileId':_0x24eaff['userProfileId']},'raw':!![]})[_0x4994('0x17')](function(_0x3362c7){if(_0x3362c7&&_0x3362c7[_0x4994('0x73')]===0x0){return db[_0x4994('0x2f')][_0x4994('0x6d')]({'name':_0x55b8c4[_0x4994('0x30')],'resourceId':_0x55b8c4['id'],'type':_0x3362c7['name'],'sectionId':_0x3362c7['id']},{})[_0x4994('0x17')](function(){return _0x4b9095;});}else{return _0x4b9095;}})[_0x4994('0x20')](function(_0xd8762f){logger[_0x4994('0x1d')](_0x4994('0x74'),_0xd8762f);throw _0xd8762f;});}return _0x4b9095;})[_0x4994('0x17')](respondWithResult(_0x2279f6,0xc9))[_0x4994('0x20')](handleError(_0x2279f6,null));};exports['update']=function(_0x40b194,_0xad7d04){if(_0x40b194[_0x4994('0x6e')]['id']){delete _0x40b194[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x40b194['params']['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]})[_0x4994('0x17')](handleEntityNotFound(_0xad7d04,null))[_0x4994('0x17')](saveUpdates(_0x40b194[_0x4994('0x6e')],null))['then'](respondWithResult(_0xad7d04,null))[_0x4994('0x20')](handleError(_0xad7d04,null));};exports[_0x4994('0x2c')]=function(_0x471a01,_0x401046){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x471a01[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x401046,null))[_0x4994('0x17')](removeEntity(_0x401046,null))[_0x4994('0x20')](handleError(_0x401046,null));};exports[_0x4994('0x76')]=function(_0xd66338,_0x308030){return db['ChatWebsite'][_0x4994('0x76')]()[_0x4994('0x17')](respondWithResult(_0x308030,null))[_0x4994('0x20')](handleError(_0x308030,null));};exports['addDisposition']=function(_0x4399a9,_0x5d4e70){if(_0x4399a9[_0x4994('0x6e')]['id']){delete _0x4399a9[_0x4994('0x6e')]['id'];}return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x4399a9[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x5d4e70,null))[_0x4994('0x17')](function(_0x3a8261){if(_0x3a8261){_0x4399a9['body'][_0x4994('0x77')]=_0x3a8261['id'];return db[_0x4994('0x78')][_0x4994('0x6d')](_0x4399a9[_0x4994('0x6e')]);}})['then'](respondWithResult(_0x5d4e70,null))[_0x4994('0x20')](handleError(_0x5d4e70,null));};exports[_0x4994('0x79')]=function(_0x3761c0,_0x22aa0f){var _0x2c9884={'raw':![],'where':{}};var _0x5ef0c0={};var _0x1363b7={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3761c0['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x22aa0f,null))[_0x4994('0x17')](function(_0x414f94){if(_0x414f94){_0x5ef0c0[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x78')][_0x4994('0x6c')]);_0x5ef0c0[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3761c0['query']);_0x5ef0c0[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5ef0c0['model'],_0x5ef0c0[_0x4994('0x5a')]);_0x2c9884[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x5ef0c0[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x3761c0[_0x4994('0x5a')]['fields']));_0x2c9884[_0x4994('0x5f')]=_0x2c9884['attributes'][_0x4994('0x60')]?_0x2c9884[_0x4994('0x5f')]:_0x5ef0c0[_0x4994('0x51')];if(!_0x3761c0[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x2c9884[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3761c0[_0x4994('0x5a')][_0x4994('0x26')]);_0x2c9884[_0x4994('0x24')]=qs['offset'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x24')]);}_0x2c9884[_0x4994('0x61')]=qs['sort'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x62')]);_0x2c9884[_0x4994('0x63')]=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3761c0['query'],_0x5ef0c0[_0x4994('0x5c')]));_0x2c9884['where'][_0x4994('0x77')]=_0x414f94['id'];if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x64')]){_0x2c9884[_0x4994('0x63')]=_['merge'](_0x2c9884[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x2c9884[_0x4994('0x5f')],function(_0x588162){var _0x277f76={};_0x277f76[_0x588162]={'$like':'%'+_0x3761c0[_0x4994('0x5a')]['filter']+'%'};return _0x277f76;})});}_0x2c9884=_[_0x4994('0x65')]({},_0x2c9884,_0x3761c0[_0x4994('0x7e')]);return db[_0x4994('0x78')][_0x4994('0x27')]({'where':_0x2c9884[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x42095c){_0x1363b7['count']=_0x42095c;if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x67')]){_0x2c9884[_0x4994('0x68')]=[{'all':!![]}];}return db['Disposition'][_0x4994('0x69')](_0x2c9884);})[_0x4994('0x17')](function(_0x43551b){_0x1363b7['rows']=_0x43551b;return _0x1363b7;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x22aa0f,_0x2c9884))[_0x4994('0x20')](handleError(_0x22aa0f,null));};exports[_0x4994('0x7f')]=function(_0x36108f,_0x327513){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x36108f[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x327513,null))[_0x4994('0x17')](function(_0x1c22f4){if(_0x1c22f4){return _0x1c22f4[_0x4994('0x7f')](_0x36108f[_0x4994('0x5a')][_0x4994('0x80')]);}})[_0x4994('0x17')](respondWithStatusCode(_0x327513,null))[_0x4994('0x20')](handleError(_0x327513,null));};exports[_0x4994('0x81')]=function(_0x171a61,_0x3f69f0){if(_0x171a61[_0x4994('0x6e')]['id']){delete _0x171a61[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')]['find']({'where':{'id':_0x171a61[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3f69f0,null))[_0x4994('0x17')](function(_0x1eb162){if(_0x1eb162){_0x171a61[_0x4994('0x6e')][_0x4994('0x77')]=_0x1eb162['id'];return db[_0x4994('0x82')][_0x4994('0x6d')](_0x171a61[_0x4994('0x6e')]);}})[_0x4994('0x17')](respondWithResult(_0x3f69f0,null))['catch'](handleError(_0x3f69f0,null));};exports[_0x4994('0x83')]=function(_0x42cdd6,_0x4fb9ef){var _0x10cffe={'raw':![],'where':{}};var _0x2cd432={};var _0x5e3285={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x42cdd6[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4fb9ef,null))[_0x4994('0x17')](function(_0x1366e3){if(_0x1366e3){_0x2cd432[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x82')][_0x4994('0x6c')]);_0x2cd432['query']=_[_0x4994('0x5b')](_0x42cdd6[_0x4994('0x5a')]);_0x2cd432['filters']=_['intersection'](_0x2cd432[_0x4994('0x51')],_0x2cd432['query']);_0x10cffe[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2cd432['model'],qs[_0x4994('0x5e')](_0x42cdd6[_0x4994('0x5a')]['fields']));_0x10cffe['attributes']=_0x10cffe['attributes'][_0x4994('0x60')]?_0x10cffe['attributes']:_0x2cd432[_0x4994('0x51')];if(!_0x42cdd6[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x10cffe[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x26')]);_0x10cffe['offset']=qs[_0x4994('0x24')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x24')]);}_0x10cffe[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x62')]);_0x10cffe[_0x4994('0x63')]=qs[_0x4994('0x5c')](_['pick'](_0x42cdd6['query'],_0x2cd432['filters']));_0x10cffe[_0x4994('0x63')][_0x4994('0x77')]=_0x1366e3['id'];if(_0x42cdd6[_0x4994('0x5a')]['filter']){_0x10cffe['where']=_[_0x4994('0x65')](_0x10cffe[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x10cffe['attributes'],function(_0x3a9a79){var _0x3deb9d={};_0x3deb9d[_0x3a9a79]={'$like':'%'+_0x42cdd6[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x3deb9d;})});}_0x10cffe=_['merge']({},_0x10cffe,_0x42cdd6[_0x4994('0x7e')]);return db[_0x4994('0x82')][_0x4994('0x27')]({'where':_0x10cffe[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x9329b7){_0x5e3285[_0x4994('0x27')]=_0x9329b7;if(_0x42cdd6[_0x4994('0x5a')][_0x4994('0x67')]){_0x10cffe[_0x4994('0x68')]=[{'all':!![]}];}return db[_0x4994('0x82')][_0x4994('0x69')](_0x10cffe);})[_0x4994('0x17')](function(_0x5cea1b){_0x5e3285[_0x4994('0x6a')]=_0x5cea1b;return _0x5e3285;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x4fb9ef,_0x10cffe))[_0x4994('0x20')](handleError(_0x4fb9ef,null));};exports[_0x4994('0x84')]=function(_0xd9865,_0x7269f9){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xd9865[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x7269f9,null))[_0x4994('0x17')](function(_0x5ef3b7){if(_0x5ef3b7){return _0x5ef3b7['removeAnswers'](_0xd9865['query']['ids']);}})[_0x4994('0x17')](respondWithStatusCode(_0x7269f9,null))[_0x4994('0x20')](handleError(_0x7269f9,null));};exports[_0x4994('0x85')]=function(_0x73a51c,_0xef88f4){_0x73a51c[_0x4994('0x6e')][_0x4994('0x86')]=_0x73a51c[_0x4994('0x87')][_0x4994('0x88')];return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x73a51c[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0xef88f4,null))[_0x4994('0x17')](saveUpdates(_0x73a51c[_0x4994('0x6e')],null))[_0x4994('0x17')](respondWithResult(_0xef88f4,null))['catch'](handleError(_0xef88f4,null));};exports[_0x4994('0x89')]=function(_0x2c672d,_0x49a131){_0x2c672d[_0x4994('0x6e')]['agentAvatar']=_0x2c672d[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x2c672d['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x49a131,null))['then'](saveUpdates(_0x2c672d['body'],null))[_0x4994('0x17')](respondWithResult(_0x49a131,null))[_0x4994('0x20')](handleError(_0x49a131,null));};exports['addCustomerAvatar']=function(_0xb62458,_0x3ae9f5){_0xb62458['body'][_0x4994('0x8a')]=_0xb62458[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xb62458['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3ae9f5,null))[_0x4994('0x17')](saveUpdates(_0xb62458[_0x4994('0x6e')],null))['then'](respondWithResult(_0x3ae9f5,null))['catch'](handleError(_0x3ae9f5,null));};exports[_0x4994('0x8b')]=function(_0x4efb77,_0x561e7d){_0x4efb77[_0x4994('0x6e')][_0x4994('0x8c')]=_0x4efb77[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')]['find']({'where':{'id':_0x4efb77[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x561e7d,null))['then'](saveUpdates(_0x4efb77['body'],null))['then'](respondWithResult(_0x561e7d,null))[_0x4994('0x20')](handleError(_0x561e7d,null));};exports[_0x4994('0x8d')]=function(_0x454649,_0x102206){var _0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x90'));var _0xd61309={'where':{'id':_0x454649[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x86')],'raw':!![]};var _0xa0eb0=![];return require(_0x4994('0x91'))[_0x4994('0x92')]()[_0x4994('0x17')](function(_0x5460b9){if(_0x5460b9){_0xa0eb0=_0x5460b9[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0x66')]['find'](_0xd61309);})['then'](handleEntityNotFound(_0x102206,null))[_0x4994('0x17')](function(_0x52233b){if(_0x52233b){if(!_[_0x4994('0x94')](_0x52233b['sitepic'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b['sitepic']))&&_0xa0eb0){_0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b[_0x4994('0x86')]);}}return _0x102206[_0x4994('0x97')](_0x32792f);}})[_0x4994('0x20')](handleError(_0x102206,null));};exports['getAvatar']=function(_0x1669d0,_0x158bb8){var _0x3d7f3b=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x98'));var _0x33974e={'where':{'id':_0x1669d0[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x99')],'raw':!![]};return db[_0x4994('0x66')][_0x4994('0x75')](_0x33974e)[_0x4994('0x17')](handleEntityNotFound(_0x158bb8,null))['then'](function(_0x40c2b5){if(_0x40c2b5){if(!_[_0x4994('0x94')](_0x40c2b5[_0x4994('0x99')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]))){_0x3d7f3b=path['join'](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]);}}return _0x158bb8['download'](_0x3d7f3b);}})['catch'](handleError(_0x158bb8,null));};exports['getCustomerAvatar']=function(_0x2a7dfa,_0x13d3ba){var _0x819237=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9b'));var _0x45f61a={'where':{'id':_0x2a7dfa[_0x4994('0x6b')]['id']},'attributes':['id','customerAvatar',_0x4994('0x9c')],'raw':!![]};return db['ChatWebsite'][_0x4994('0x75')](_0x45f61a)[_0x4994('0x17')](handleEntityNotFound(_0x13d3ba,null))['then'](function(_0x24b6b8){if(_0x24b6b8){if(!_[_0x4994('0x94')](_0x24b6b8['customerAvatar'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]))&&_0x24b6b8[_0x4994('0x9c')]){_0x819237=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]);}}return _0x13d3ba['download'](_0x819237);}})[_0x4994('0x20')](handleError(_0x13d3ba,null));};exports[_0x4994('0x9d')]=function(_0x4eeb52,_0x232253){var _0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9e'));var _0x1af2fc={'where':{'id':_0x4eeb52['params']['id']},'attributes':['id',_0x4994('0x8c')],'raw':!![]};return db[_0x4994('0x66')]['find'](_0x1af2fc)['then'](handleEntityNotFound(_0x232253,null))[_0x4994('0x17')](function(_0x22c959){if(_0x22c959){if(!_[_0x4994('0x94')](_0x22c959[_0x4994('0x8c')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]))){_0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]);}}return _0x232253[_0x4994('0x97')](_0x216999);}})['catch'](handleError(_0x232253,null));};exports[_0x4994('0x9f')]=function(_0x152624,_0x24c7fd){var _0x234026={'body':_0x152624[_0x4994('0x6e')],'channel':_0x4994('0xa0')};var _0x4a50f9=[];var _0x406d9e=[];var _0x11cb69={};var _0x57de26=![];return db['CmContact'][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x3a21cb){if(!_0x3a21cb){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x4a50f9=_['difference'](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5')]);_0x406d9e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5'),_0x4994('0xa7'),_0x4994('0xa8')]);if(_0x152624[_0x4994('0x6e')]['id']){delete _0x152624['body']['id'];}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['from'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory');}if(_[_0x4994('0x94')](_0x152624['body'][_0x4994('0x6e')])||_0x152624[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['mapKey'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa9')+_0x406d9e);}if(!_[_0x4994('0xaa')](_0x406d9e,_0x152624[_0x4994('0x6e')][_0x4994('0xab')])){throw new db[(_0x4994('0xa1'))]['ValidationError'](_0x4994('0xac')+_0x406d9e);}_0x11cb69[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x152624[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0xae')],'as':_0x4994('0xaf'),'include':[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xb1'),'where':_0x11cb69,'limit':0x1,'order':[[_0x4994('0xa5'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x4994('0xb2')},{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id',_0x4994('0x38')],'raw':!![]}]}]});})[_0x4994('0x17')](function(_0x582557){if(!_0x582557)throw new APINotFoundError(util['format'](_0x4994('0xb4'),_0x152624[_0x4994('0x6b')]['id']));if(!_0x582557[_0x4994('0x3e')]||!_0x582557[_0x4994('0x3e')][_0x4994('0xb3')])return[_0x582557,!![]];return[_0x582557,checkWebsiteIntervals(_0x582557)];})[_0x4994('0xb5')](function(_0x30217c,_0x46a59e){if(!_0x46a59e)throw new APIOutOfIntervalError();if(!_0x30217c[_0x4994('0xaf')])return;_0x234026[_0x4994('0xb6')]=_0x30217c;_0x234026[_0x4994('0xb7')]=_0x30217c[_0x4994('0xaf')];_0x234026[_0x4994('0xb8')]=_[_0x4994('0xb9')](_0x30217c[_0x4994('0xb2')],[_0x4994('0xba')],[_0x4994('0xbb')]);if(_0x234026[_0x4994('0xb6')]['Applications']){delete _0x234026['account'][_0x4994('0xb2')];}if(_0x234026[_0x4994('0xb6')][_0x4994('0xaf')]&&_0x234026['account'][_0x4994('0xaf')][_0x4994('0xb1')][_0x4994('0x60')]){return _0x234026[_0x4994('0xb6')][_0x4994('0xaf')][_0x4994('0xb1')][0x0];}var _0x5ac49=_[_0x4994('0x10')](_0x152624[_0x4994('0x6e')],{'firstName':_0x152624[_0x4994('0x6e')][_0x4994('0xad')],'ListId':_0x30217c[_0x4994('0xa8')]});_0x5ac49[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624['body'][_0x4994('0xad')];return db[_0x4994('0xb0')]['create'](_0x5ac49,{'fields':_0x4a50f9,'raw':!![]});})['then'](function(_0x4b6843){_0x234026['contact']=_0x4b6843;var _0x33e30b=createInteractionObject(_0x152624[_0x4994('0x6b')]['id'],_0x152624[_0x4994('0x6e')],_0x152624[_0x4994('0xbc')],_0x4b6843);var _0x18ea85={'ChatWebsiteId':_0x152624[_0x4994('0x6b')]['id'],'closed':![]};if(_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]){_0x18ea85['threadId']=_0x152624[_0x4994('0x6e')][_0x4994('0xbd')];return db[_0x4994('0xbe')]['find']({'where':_0x18ea85})[_0x4994('0x17')](function(_0x3b8d03){if(_0x3b8d03){_0x57de26=!![];return _0x3b8d03;}_0x33e30b[_0x4994('0xbd')]=_0x152624['body']['threadId'];_0x33e30b[_0x4994('0xbf')]=_0x152624[_0x4994('0x6e')][_0x4994('0xbf')];return db[_0x4994('0xbe')]['create'](_0x33e30b);});}_0x18ea85['ContactId']=_0x4b6843['id'];if(_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]['id']){_0x18ea85['id']=_0x152624['body'][_0x4994('0xc0')]['id'];return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':_0x18ea85})['then'](function(_0x29c20e){if(_0x29c20e){_0x57de26=!![];return _0x29c20e;}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);});}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);})['then'](function(_0x9c5e94){if(!_0x57de26)return _0x9c5e94;var _0x9905a={'from':(_0x234026[_0x4994('0xc1')][_0x4994('0x49')]||'')+'\x20'+(_0x234026[_0x4994('0xc1')][_0x4994('0xc2')]||'')};if(_0x152624['body']['threadId']&&_0x152624[_0x4994('0x6e')][_0x4994('0xc3')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]!=_0x152624[_0x4994('0x6e')]['messageId']){_0x9905a[_0x4994('0xbd')]=_0x152624['body'][_0x4994('0xc3')];}return _0x9c5e94[_0x4994('0x2b')](_0x9905a);})['then'](function(_0x580168){_0x234026[_0x4994('0xc0')]=_0x580168['get']({'plain':!![]});_0x234026[_0x4994('0xc0')][_0x4994('0xc4')]=!_0x57de26;if(_0x234026[_0x4994('0xc0')]['created']){if(_0x234026[_0x4994('0xb6')][_0x4994('0xc5')]){_0x234026[_0x4994('0xb8')]['push']({'id':0x0,'priority':_0x234026[_0x4994('0xb8')][_0x4994('0x60')]+0x1,'app':_0x4994('0xc6'),'appdata':_0x4994('0xc7'),'interval':_0x4994('0xc8')});}}return db[_0x4994('0xc9')][_0x4994('0x6d')]({'body':_0x152624[_0x4994('0x6e')][_0x4994('0x6e')],'ChatWebsiteId':_0x152624['params']['id'],'ChatInteractionId':_0x580168['id'],'direction':'in','ContactId':_0x234026[_0x4994('0xc1')]['id'],'AttachmentId':_0x152624[_0x4994('0x6e')]['AttachmentId']});})[_0x4994('0x17')](function(_0x4314fd){_0x234026[_0x4994('0x1e')]=_0x4314fd;if(!_0x234026[_0x4994('0xc0')]['UserId']){return;}return db['User'][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026[_0x4994('0xc0')][_0x4994('0xca')]}});})[_0x4994('0x17')](function(_0x242040){if(_0x242040){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x0,'app':_0x4994('0xcc'),'appdata':_0x242040['name']+','+(_0x234026['account'][_0x4994('0xcd')]||0xa),'interval':_0x4994('0xc8')});_0x234026[_0x4994('0xce')]=!![];}if(!_0x234026[_0x4994('0xc0')][_0x4994('0xcf')]){return;}return db[_0x4994('0xd0')][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026['interaction']['queueId']}});})['then'](function(_0x464283){if(_0x464283){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x1,'app':_0x4994('0xd1'),'appdata':_0x464283[_0x4994('0x30')]+','+(_0x234026[_0x4994('0xb6')][_0x4994('0xd2')]||0x12c),'interval':_0x4994('0xc8')});}return respondWithRpcPromise(_0x4994('0xd3'),'startRouting',_0x234026);})['then'](function(_0x363cfc){respondWithRpcPromise(_0x4994('0xd4'),_0x4994('0xd4'),{'event':_0x4994('0x9f'),'message':_0x363cfc},client9002);return _0x363cfc;})['then'](respondWithResult(_0x24c7fd,null))[_0x4994('0x20')](APIHandleError(_0x24c7fd));};exports['offline']=function(_0x1bcdc6,_0x4010a8){var _0x46f75a,_0x1070a8,_0xf51fc6;var _0x7b727e=[];var _0x21bf56={};var _0x456615=_0x1bcdc6[_0x4994('0xd5')]||[];var _0x54de8c=[];var _0x4b9438;return db[_0x4994('0xb0')][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x4ac490){if(!_0x4ac490){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x7b727e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x4ac490),[_0x4994('0xa4'),_0x4994('0xa5'),'CompanyId',_0x4994('0xa8')]);if(_0x1bcdc6[_0x4994('0x6e')]['id']){delete _0x1bcdc6[_0x4994('0x6e')]['id'];}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory'));}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')])||_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db['Sequelize'][(_0x4994('0xa2'))](_0x4994('0xd7')));}if(_[_0x4994('0x94')](_0x1bcdc6['body']['mapKeyOffline'])){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xd8')+_0x7b727e));}if(!_[_0x4994('0xaa')](_0x7b727e,_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7b727e));}_0x21bf56[_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x1bcdc6[_0x4994('0x6b')]['id']},'include':[{'model':db['CmList'],'as':_0x4994('0xaf')},{'model':db[_0x4994('0xda')],'as':_0x4994('0xda')}]});})[_0x4994('0x17')](handleEntityNotFound(_0x4010a8,null))[_0x4994('0x17')](function(_0x51ec8f){if(_0x51ec8f&&_0x51ec8f[_0x4994('0xaf')]){_0x1070a8=_0x51ec8f;var _0x56d3b3=_[_0x4994('0x10')](_0x1bcdc6[_0x4994('0x6e')],{'firstName':_0x1bcdc6[_0x4994('0x6e')]['from'],'phone':_0x1bcdc6[_0x4994('0x6e')]['from'],'ListId':_0x51ec8f['ListId']});_0x56d3b3[_0x1bcdc6['body'][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];return db['CmContact']['findOrCreate']({'where':_0x21bf56,'defaults':_0x56d3b3});}})[_0x4994('0xb5')](function(_0x514f4e){if(_0x514f4e){_0xf51fc6=_0x514f4e;var _0x227f82=fs['readFileSync'](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0xdb')),_0x4994('0xdc'));var _0x313165=ejs['render'](_0x227f82,{'body':_[_0x4994('0xdd')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]),'bodyTitle':_0x1070a8[_0x4994('0xde')]});return db[_0x4994('0xdf')][_0x4994('0x6d')]({'body':_0x313165,'plainBody':htmlToText[_0x4994('0xe0')](_0x313165),'ContactId':_0x514f4e['id'],'ChatWebsiteId':_0x1070a8['id']});}})[_0x4994('0x17')](function(_0x59826d){_0x4b9438=_0x59826d;if(_0x456615[_0x4994('0x60')]){var _0x67fd48=_0x456615[_0x4994('0x3d')](function(_0x56e915){return{'name':_0x56e915[_0x4994('0xe1')],'basename':_0x56e915[_0x4994('0x88')],'type':_0x56e915[_0x4994('0xe2')],'ChatOfflineMessageId':_0x59826d['id']};});_0x54de8c=_0x67fd48[_0x4994('0x3d')](_0x346308=>{var _0x271606={'filename':_0x346308[_0x4994('0x30')],'path':path['join'](config[_0x4994('0x8f')],_0x4994('0xe3'),_0x4994('0xd5'),_0x4994('0xe4'),_0x4994('0xe5'),_0x346308[_0x4994('0xe6')])};return _0x271606;});if(!_0x1070a8[_0x4994('0xe7')]){return db['sequelize'][_0x4994('0xe8')](function(_0x1bcef1){return db[_0x4994('0xe9')][_0x4994('0xea')](_0x67fd48,{'transaction':_0x1bcef1});});}}})[_0x4994('0x17')](function(){if(_0x4b9438){_0x46f75a=_0x4b9438;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4994('0xeb'),'raw':!![],'include':[{'model':db[_0x4994('0xec')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x293707){if(_0x293707&&_0x293707['Smtp']&&_0x1070a8[_0x4994('0xed')]&&_0x1070a8[_0x4994('0xee')]){var _0xd6cd54=_0x293707['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x4994('0xef'),{'account':_0xd6cd54,'message':{'from':util[_0x4994('0x34')](_0x4994('0xf0'),_0x293707[_0x4994('0x30')],_0x293707[_0x4994('0xf1')]||_0x293707[_0x4994('0xeb')]['user']),'to':_0x1070a8[_0x4994('0xee')],'subject':_0x1070a8['offlineMessageSubject'],'html':_0x46f75a['body'],'attachments':_0x54de8c}},client9003)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0xae376c){logger[_0x4994('0x1d')](_0xae376c);});}})[_0x4994('0x17')](function(){if(_0x1070a8&&_0x1070a8[_0x4994('0xe7')]&&_0x1070a8[_0x4994('0xf2')]){var _0x480db3=[];if(_0x456615[_0x4994('0x60')]){_0x480db3=_0x456615[_0x4994('0x3d')](function(_0x208970){return{'name':_0x208970[_0x4994('0xe1')],'basename':_0x208970[_0x4994('0x88')],'type':_0x208970[_0x4994('0xe2')],'ChatOfflineMessageId':_0x4b9438['id']};});}var _0x5b12a4;if(!_['isNil'](_0x1070a8[_0x4994('0xf3')])){var _0x39c3ce=_['map'](_0x1bcdc6['body'],function(_0x51d051){return _0x51d051;});var _0x20535e=_[_0x4994('0xf4')](_0x39c3ce)[0x0];var _0x49be37=_['mapValues'](_0x20535e,function(_0x1b2ba6){return _0x1b2ba6;});_0x5b12a4=_0x49be37[0x1][_0x1070a8['subjectOffline']];}var _0x5489a0={'from':_0xf51fc6[_0x4994('0xf1')],'firstName':_0xf51fc6[_0x4994('0x49')],'lastName':_0xf51fc6['lastName'],'mapKey':_0x4994('0xf1'),'message':{'from':_0xf51fc6[_0x4994('0xf1')],'to':_0x1070a8[_0x4994('0xda')][_0x4994('0xf1')],'cc':'','subject':_['isNil'](_0x5b12a4)?_0x1070a8[_0x4994('0xf5')]:_0x5b12a4,'messageId':'','sentAt':new Date(),'attach':_0x480db3[_0x4994('0x60')],'attachments':_0x480db3,'originChannel':_0x4994('0xf6'),'ChatWebsiteId':_0x1070a8['id'],'ChatOfflineMessageId':_0x46f75a['id'],'originTo':_0x1070a8['MailAccount'][_0x4994('0xf1')]},'body':_0x46f75a[_0x4994('0x6e')]};var _0x45b368={'account':{'id':_0x1070a8['MailAccountId']},'body':_0x5489a0,'log':_0x4994('0xf7')};return respondWithRpcPromise('NotifyMailAccount',_0x4994('0xf8'),_0x45b368,client9001)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0x49ebac){logger[_0x4994('0x1d')](_0x49ebac);});}return;})[_0x4994('0x17')](function(){if(_0x46f75a){return _0x46f75a;}})[_0x4994('0x17')](respondWithResult(_0x4010a8,null))['catch'](function(){for(var _0x1aa86e of _0x456615){var _0x1889af=path[_0x4994('0x8e')](config[_0x4994('0x8f')],'server','files',_0x4994('0xe4'),_0x4994('0xe5'),_0x1aa86e[_0x4994('0x88')]);fs_extra[_0x4994('0xf9')](_0x1889af)[_0x4994('0x20')](function(_0x265381){logger['error'](_0x4994('0xfa'),_0x1889af,_0x265381);});}});};exports['addInteraction']=function(_0x53d026,_0x247e6e){return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':{'id':_0x53d026[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x247e6e,null))[_0x4994('0x17')](function(_0x3cf36b){if(_0x3cf36b){return _0x3cf36b[_0x4994('0xfb')](_0x53d026[_0x4994('0x6e')][_0x4994('0x80')],_[_0x4994('0xfc')](_0x53d026[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x247e6e,null))['catch'](handleError(_0x247e6e,null));};exports[_0x4994('0xfd')]=function(_0x3cdc05,_0x331858){var _0x90f17a={'raw':![],'where':{}};var _0x15c927={};var _0x2b4216={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3cdc05[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x331858,null))[_0x4994('0x17')](function(_0x4a0d24){if(_0x4a0d24){_0x15c927[_0x4994('0x51')]=_['keys'](db[_0x4994('0xbe')]['rawAttributes']);_0x15c927[_0x4994('0x5a')]=_['keys'](_0x3cdc05[_0x4994('0x5a')]);_0x15c927[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x15c927[_0x4994('0x51')],_0x15c927[_0x4994('0x5a')]);_0x90f17a['attributes']=_['intersection'](_0x15c927['model'],qs[_0x4994('0x5e')](_0x3cdc05[_0x4994('0x5a')]['fields']));_0x90f17a['attributes']=_0x90f17a[_0x4994('0x5f')][_0x4994('0x60')]?_0x90f17a['attributes']:_0x15c927[_0x4994('0x51')];if(!_0x3cdc05[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x90f17a['limit']=qs[_0x4994('0x26')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x26')]);_0x90f17a[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x24')]);}_0x90f17a[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x3cdc05['query']['sort']);_0x90f17a['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3cdc05[_0x4994('0x5a')],_0x15c927[_0x4994('0x5c')]));_0x90f17a[_0x4994('0x63')][_0x4994('0x77')]=_0x4a0d24['id'];if(_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]){_0x90f17a[_0x4994('0x63')]=_[_0x4994('0x65')](_0x90f17a['where'],{'$or':_[_0x4994('0x3d')](_0x90f17a['attributes'],function(_0x322f25){var _0x299331={};_0x299331[_0x322f25]={'$like':'%'+_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x299331;})});}_0x90f17a=_[_0x4994('0x65')]({},_0x90f17a,_0x3cdc05['options']);return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':_0x90f17a[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x45b3f0){_0x2b4216['count']=_0x45b3f0;if(_0x3cdc05['query'][_0x4994('0x67')]){_0x90f17a[_0x4994('0x68')]=[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xff')],'as':_0x4994('0x100'),'attributes':[_0x4994('0x30'),_0x4994('0x101'),_0x4994('0x102')],'required':![]},{'model':db[_0x4994('0x103')],'as':_0x4994('0x104'),'attributes':['id','name',_0x4994('0x105')],'where':_0x3cdc05[_0x4994('0x5a')][_0x4994('0x106')]?{'id':_0x3cdc05['query'][_0x4994('0x106')]}:undefined,'required':_0x3cdc05[_0x4994('0x5a')]['tag']?!![]:![]}];}return db[_0x4994('0xbe')][_0x4994('0x69')](_0x90f17a);})['then'](function(_0x1ee117){_0x2b4216[_0x4994('0x6a')]=_0x1ee117;return _0x2b4216;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x331858,_0x90f17a))[_0x4994('0x20')](handleError(_0x331858,null));};exports[_0x4994('0x32')]=function(_0x17ef96,_0x245b89){var _0xba8540=0x0;var _0x311f1b=0x0;var _0x3eda07=![];var _0xeb5422;var _0x4b379a;return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x17ef96['params']['id']},'include':[{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x245b89,null))['then'](function(_0x1a3fe7){if(_0x1a3fe7){_0xeb5422=_0x1a3fe7;return _0x1a3fe7[_0x4994('0x107')]({'raw':!![]});}})[_0x4994('0x17')](function(_0x28de10){if(_0xeb5422){if(_0x28de10){_0x4b379a=_0x28de10;}}return require('../../config/license/util')['getLicense']();})[_0x4994('0x17')](function(_0x368a6e){if(_0x368a6e){_0x311f1b=_0x368a6e['virtual'];_0x3eda07=_0x368a6e[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':{'closed':![]}});})[_0x4994('0x17')](function(_0x43043e){_0xba8540=_0x43043e;if(_0x311f1b&&_0x43043e>_0x311f1b){return db[_0x4994('0x108')]['findOne']({'where':{'id':0x1}})[_0x4994('0x17')](function(_0x241a6e){if(_0x241a6e){_0x241a6e[_0x4994('0x109')](_0x4994('0x10a'));}});}})[_0x4994('0x17')](function(){if(!_0xeb5422['Interval']||!_0xeb5422['Interval'][_0x4994('0xb3')])return!![];return checkWebsiteIntervals(_0xeb5422);})[_0x4994('0x17')](function(_0x1fe81a){var _0x41bd91=fs[_0x4994('0x10b')](path[_0x4994('0x8e')](config['root'],_0x4994('0x10c')),'utf8');var _0x249ffb=new url[(_0x4994('0x10d'))](_0xeb5422[_0x4994('0x10e')])[_0x4994('0x10f')];var _0x40a50f=_0x4994('0x110');var _0x3bd881=![];var _0x374109={'chatVersion':_0x40a50f,'chatWebsiteAddressOrigin':_0x249ffb,'remote':_0xeb5422['remote'],'query':querystring[_0x4994('0x1c')](_[_0x4994('0x65')](_0xeb5422['get']({'plain':!![]}),{'customerIp':_0x17ef96['headers'][_0x4994('0x46')]||_0x17ef96[_0x4994('0xbc')][_0x4994('0x111')]||_0x17ef96[_0x4994('0x112')]['remoteAddress']||_0x17ef96['ip'],'referer':_0x17ef96['headers'][_0x4994('0x4b')],'openedInteractions':_0xba8540,'maxInteractions':_0x311f1b,'virtual':_0x3eda07[_0x4994('0x113')],'online':_0x1fe81a,'custom':_0x3eda07}))[_0x4994('0x114')](/'/g,'\x5c\x27')};_0x245b89[_0x4994('0xd6')](ejs[_0x4994('0x115')](Mustache[_0x4994('0x115')](_0x41bd91,_0x374109),{'proactiveActions':_0x4b379a,'alignment':_0xeb5422[_0x4994('0x116')],'verticalAlignment':_0xeb5422[_0x4994('0x117')],'div_color':_0xeb5422[_0x4994('0x105')],'labelText':_0xeb5422[_0x4994('0x118')],'text_color':_0xeb5422[_0x4994('0x119')],'text_button_color':_0xeb5422[_0x4994('0x11a')],'button_color':_0xeb5422['color_button'],'background_color':_0xeb5422[_0x4994('0x11b')],'hideWhenOffline':_0xeb5422[_0x4994('0x11c')],'intervalId':_0xeb5422[_0x4994('0x11d')],'isDevelopment':_0x3bd881,'chatVersion':_0x40a50f}));})[_0x4994('0x20')](handleError(_0x245b89,null));};exports[_0x4994('0x11e')]=function(_0x2c2b5d,_0x247cd7){var _0x1a6855=_0x2c2b5d[_0x4994('0x6b')]['id'];var _0x4c5e74=_0x2c2b5d['body'];var _0x2dfe8d=0xc8;var _0x51e398=null;return db['sequelize'][_0x4994('0xe8')]({'isolationLevel':db['sequelize'][_0x4994('0x11f')][_0x4994('0x120')][_0x4994('0x121')]},function(_0x183239){return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1a6855},'transaction':_0x183239})['then'](function(_0x49473b){if(_0x49473b){return db[_0x4994('0x122')][_0x4994('0x2c')]({'where':{'ChatWebsiteId':_0x1a6855},'transaction':_0x183239})[_0x4994('0x17')](function(){var _0x5e3bfe=_[_0x4994('0x3d')](_0x4c5e74,function(_0x298a08){_0x298a08['ChatWebsiteId']=_0x1a6855;return _0x298a08;});return db[_0x4994('0x122')]['bulkCreate'](_0x5e3bfe,{'transaction':_0x183239});});}else{_0x2dfe8d=0x194;_0x51e398=[];}});})[_0x4994('0x17')](function(){if(_0x2dfe8d!==0x194){return db[_0x4994('0x122')][_0x4994('0x123')]({'where':{'ChatWebsiteId':_0x1a6855},'order':_0x4994('0xba')})[_0x4994('0x17')](function(_0xade7c6){_0x51e398=_0xade7c6;});}})[_0x4994('0x20')](function(_0x346138){_0x2dfe8d=0x1f4;logger[_0x4994('0x1d')](_0x346138[_0x4994('0x124')]);if(_0x346138['name']){delete _0x346138[_0x4994('0x30')];}_0x51e398=_0x346138;})[_0x4994('0x125')](function(){if(_0x51e398===null){_0x247cd7[_0x4994('0x21')](_0x2dfe8d);}else{if(_0x2dfe8d===0x1f4){_0x247cd7['status'](_0x2dfe8d)[_0x4994('0xd6')](_0x51e398);}else{_0x247cd7[_0x4994('0x22')](_0x2dfe8d)['json'](_0x51e398);}}});};exports[_0x4994('0x126')]=function(_0xd6fdbe,_0x1b47d1){var _0x166666={};var _0x40beb2={};var _0x1fd62d;var _0x219cf3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0xd6fdbe['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x1b47d1,null))[_0x4994('0x17')](function(_0x48ea62){if(_0x48ea62){_0x1fd62d=_0x48ea62;_0x40beb2[_0x4994('0x51')]=_[_0x4994('0x5b')](db['ChatApplication']['rawAttributes']);_0x40beb2['query']=_[_0x4994('0x5b')](_0xd6fdbe[_0x4994('0x5a')]);_0x40beb2[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x40beb2['model'],_0x40beb2[_0x4994('0x5a')]);_0x166666[_0x4994('0x5f')]=_['intersection'](_0x40beb2[_0x4994('0x51')],qs[_0x4994('0x5e')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x5e')]));_0x166666['attributes']=_0x166666[_0x4994('0x5f')][_0x4994('0x60')]?_0x166666[_0x4994('0x5f')]:_0x40beb2[_0x4994('0x51')];_0x166666['order']=qs[_0x4994('0x62')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x62')]);_0x166666['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0xd6fdbe[_0x4994('0x5a')],_0x40beb2[_0x4994('0x5c')]));if(_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x64')]){_0x166666[_0x4994('0x63')]=_['merge'](_0x166666[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x166666['attributes'],function(_0x32d8b2){var _0x12b6ce={};_0x12b6ce[_0x32d8b2]={'$like':'%'+_0xd6fdbe['query'][_0x4994('0x64')]+'%'};return _0x12b6ce;})});}_0x166666=_['merge']({},_0x166666,_0xd6fdbe['options']);return _0x1fd62d['getApplications'](_0x166666);}})['then'](function(_0x4529e7){if(_0x4529e7){_0x219cf3=_0x4529e7[_0x4994('0x60')];if(!_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x166666['limit']=qs['limit'](_0xd6fdbe[_0x4994('0x5a')]['limit']);_0x166666[_0x4994('0x24')]=qs[_0x4994('0x24')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x1fd62d[_0x4994('0x126')](_0x166666);}})[_0x4994('0x17')](function(_0x157d34){if(_0x157d34){return _0x157d34?{'count':_0x219cf3,'rows':_0x157d34}:null;}})[_0x4994('0x17')](respondWithResult(_0x1b47d1,null))[_0x4994('0x20')](handleError(_0x1b47d1,null));};exports['addProactiveActions']=function(_0x491582,_0x2063ab){return db['chatProactiveAction'][_0x4994('0x75')]({'where':{'id':_0x491582[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2063ab,null))[_0x4994('0x17')](function(_0x359ac6){if(_0x359ac6){return _0x359ac6['addProactiveActions'](_0x491582[_0x4994('0x6e')]['ids'],_[_0x4994('0xfc')](_0x491582[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x2063ab,null))[_0x4994('0x20')](handleError(_0x2063ab,null));};exports['getProactiveActions']=function(_0x141d27,_0x2e76fd){var _0x30ba11={};var _0x5e6293={};var _0x9124fa;var _0x3dfee3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x141d27[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2e76fd,null))[_0x4994('0x17')](function(_0x5ba198){if(_0x5ba198){_0x9124fa=_0x5ba198;_0x5e6293[_0x4994('0x51')]=_['keys'](db[_0x4994('0x127')][_0x4994('0x6c')]);_0x5e6293[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x141d27[_0x4994('0x5a')]);_0x5e6293[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5e6293[_0x4994('0x51')],_0x5e6293[_0x4994('0x5a')]);_0x30ba11[_0x4994('0x5f')]=_['intersection'](_0x5e6293[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x141d27[_0x4994('0x5a')][_0x4994('0x5e')]));_0x30ba11[_0x4994('0x5f')]=_0x30ba11[_0x4994('0x5f')][_0x4994('0x60')]?_0x30ba11['attributes']:_0x5e6293[_0x4994('0x51')];_0x30ba11['order']=qs[_0x4994('0x62')](_0x141d27['query'][_0x4994('0x62')]);_0x30ba11['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x141d27[_0x4994('0x5a')],_0x5e6293['filters']));if(_0x141d27[_0x4994('0x5a')]['filter']){_0x30ba11[_0x4994('0x63')]=_[_0x4994('0x65')](_0x30ba11[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x30ba11[_0x4994('0x5f')],function(_0x3be37f){var _0x1c1a31={};_0x1c1a31[_0x3be37f]={'$like':'%'+_0x141d27[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x1c1a31;})});}_0x30ba11=_[_0x4994('0x65')]({},_0x30ba11,_0x141d27[_0x4994('0x7e')]);return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x5999a2){if(_0x5999a2){_0x3dfee3=_0x5999a2[_0x4994('0x60')];if(!_0x141d27[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x30ba11[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x141d27[_0x4994('0x5a')]['limit']);_0x30ba11['offset']=qs[_0x4994('0x24')](_0x141d27[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x4cb8fe){if(_0x4cb8fe){return _0x4cb8fe?{'count':_0x3dfee3,'rows':_0x4cb8fe}:null;}})[_0x4994('0x17')](respondWithResult(_0x2e76fd,null))[_0x4994('0x20')](handleError(_0x2e76fd,null));};exports[_0x4994('0x128')]=function(_0x51cc49,_0x30e418){var _0x50031b=_0x51cc49[_0x4994('0x5a')]['online']==='false'?_0x4994('0x129'):_0x4994('0x12a');return db['ChatWebsite'][_0x4994('0x75')]({'attributes':['id',_0x50031b],'where':{'id':_0x51cc49[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x30e418,null))[_0x4994('0x17')](function(_0x5214f5){if(_0x5214f5){var _0x57a913=_0x5214f5[_0x50031b];var _0x4fefe2=_0x57a913&&_0x57a913[_0x4994('0x12b')]?_0x57a913[_0x4994('0x12b')]:[];_0x30e418[_0x4994('0xd6')]({'fromKey':_[_0x4994('0x94')](_0x57a913[_0x4994('0x12c')])?undefined:_0x57a913['fromKey'],'count':_0x4fefe2[_0x4994('0x60')],'rows':_0x4fefe2});}})[_0x4994('0x20')](handleError(_0x30e418,null));};exports[_0x4994('0x12d')]=function(_0x50d7e8,_0x1cabb2){var _0x58de8d={'raw':![],'where':{}};var _0x20bb8c={};var _0x966f40={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x50d7e8[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x1cabb2,null))[_0x4994('0x17')](function(_0x12c190){if(_0x12c190){_0x20bb8c[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0xdf')]['rawAttributes']);_0x20bb8c[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x50d7e8[_0x4994('0x5a')]);_0x20bb8c['filters']=_['intersection'](_0x20bb8c[_0x4994('0x51')],_0x20bb8c[_0x4994('0x5a')]);_0x58de8d[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x20bb8c[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x5e')]));_0x58de8d['attributes']=_0x58de8d[_0x4994('0x5f')]['length']?_0x58de8d[_0x4994('0x5f')]:_0x20bb8c['model'];if(!_0x50d7e8[_0x4994('0x5a')][_0x4994('0x7b')]('nolimit')){_0x58de8d['limit']=qs['limit'](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x26')]);_0x58de8d[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x50d7e8['query'][_0x4994('0x24')]);}_0x58de8d[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x62')]);_0x58de8d[_0x4994('0x63')]=qs['filters'](_['pick'](_0x50d7e8[_0x4994('0x5a')],_0x20bb8c[_0x4994('0x5c')]));_0x58de8d['where'][_0x4994('0x77')]=_0x12c190['id'];if(_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]){_0x58de8d['where']=_[_0x4994('0x65')](_0x58de8d[_0x4994('0x63')],{'$or':_['map'](_0x58de8d[_0x4994('0x5f')],function(_0x5e6af8){var _0x4779c9={};_0x4779c9[_0x5e6af8]={'$like':'%'+_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4779c9;})});}_0x58de8d=_[_0x4994('0x65')]({},_0x58de8d,_0x50d7e8[_0x4994('0x7e')]);return db['ChatOfflineMessage'][_0x4994('0x27')]({'where':_0x58de8d[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x2598d6){_0x966f40['count']=_0x2598d6;if(_0x50d7e8['query'][_0x4994('0x67')]){_0x58de8d['include']=[{'all':!![]}];}else{_0x58de8d[_0x4994('0x68')]=[{'model':db['CmContact'],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xe9')],'as':'Attachments','required':![]}];}return db[_0x4994('0xdf')]['findAll'](_0x58de8d);})['then'](function(_0x14236c){_0x966f40[_0x4994('0x6a')]=_0x14236c;return _0x966f40;});}})['then'](respondWithFilteredResult(_0x1cabb2,_0x58de8d))[_0x4994('0x20')](handleError(_0x1cabb2,null));};exports['addAgents']=function(_0x4a5bd5,_0x30b6ac){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x4a5bd5['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x30b6ac,null))[_0x4994('0x17')](function(_0x20fa8c){if(_0x20fa8c){return _0x20fa8c['addAgents'](_0x4a5bd5['body'][_0x4994('0x80')],_[_0x4994('0xfc')](_0x4a5bd5[_0x4994('0x6e')],[_0x4994('0x80'),'id'])||{})[_0x4994('0xb5')](function(_0x16b323){for(var _0x29fce8=0x0;_0x29fce8<_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x4994('0x60')];_0x29fce8+=0x1){socket['emit'](_0x4994('0x12e'),{'UserId':Number(_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x29fce8]),'ChatWebsiteId':Number(_0x4a5bd5[_0x4994('0x6b')]['id'])});}return _0x16b323;});}})[_0x4994('0x17')](respondWithResult(_0x30b6ac,null))[_0x4994('0x20')](handleError(_0x30b6ac,null));};exports[_0x4994('0x12f')]=function(_0x383552,_0xa392e3){return db['ChatWebsite']['find']({'where':{'id':_0x383552['params']['id']}})['then'](handleEntityNotFound(_0xa392e3,null))['then'](function(_0x4cf294){if(_0x4cf294){return _0x4cf294[_0x4994('0x12f')](_0x383552[_0x4994('0x5a')][_0x4994('0x80')])[_0x4994('0x17')](function(){if(_['isArray'](_0x383552['query'][_0x4994('0x80')])){for(var _0x5586e2=0x0;_0x5586e2<_0x383552['query']['ids'][_0x4994('0x60')];_0x5586e2+=0x1){socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')]['ids'][_0x5586e2]),'ChatWebsiteId':Number(_0x383552[_0x4994('0x6b')]['id'])});}}else{socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')][_0x4994('0x80')]),'ChatWebsiteId':Number(_0x383552['params']['id'])});}});}})[_0x4994('0x17')](respondWithStatusCode(_0xa392e3,null))[_0x4994('0x20')](handleError(_0xa392e3,null));};exports[_0x4994('0x132')]=function(_0x1f2c6d,_0x4f5787){var _0x406daa={};var _0x1b3be3={};var _0x3a7177;var _0x430009;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1f2c6d[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4f5787,null))[_0x4994('0x17')](function(_0x4a8bd6){if(_0x4a8bd6){_0x3a7177=_0x4a8bd6;_0x1b3be3['model']=_['keys'](db[_0x4994('0xff')][_0x4994('0x6c')]);_0x1b3be3[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x1f2c6d[_0x4994('0x5a')]);_0x1b3be3[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],_0x1b3be3[_0x4994('0x5a')]);_0x406daa[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],qs['fields'](_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x5e')]));_0x406daa['attributes']=_0x406daa[_0x4994('0x5f')][_0x4994('0x60')]?_0x406daa[_0x4994('0x5f')]:_0x1b3be3['model'];_0x406daa[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x1f2c6d[_0x4994('0x5a')]['sort']);_0x406daa[_0x4994('0x63')]=qs['filters'](_['pick'](_0x1f2c6d[_0x4994('0x5a')],_0x1b3be3[_0x4994('0x5c')]));if(_0x1f2c6d['query'][_0x4994('0x64')]){_0x406daa[_0x4994('0x63')]=_[_0x4994('0x65')](_0x406daa[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x406daa[_0x4994('0x5f')],function(_0xa448){var _0x4dc10b={};_0x4dc10b[_0xa448]={'$like':'%'+_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4dc10b;})});}_0x406daa=_[_0x4994('0x65')]({},_0x406daa,_0x1f2c6d[_0x4994('0x7e')]);return _0x3a7177['getAgents'](_0x406daa);}})['then'](function(_0x1d48fc){if(_0x1d48fc){_0x430009=_0x1d48fc[_0x4994('0x60')];if(!_0x1f2c6d['query'][_0x4994('0x7b')](_0x4994('0x7c'))){_0x406daa[_0x4994('0x26')]=qs['limit'](_0x1f2c6d[_0x4994('0x5a')]['limit']);_0x406daa['offset']=qs['offset'](_0x1f2c6d['query'][_0x4994('0x24')]);}return _0x3a7177[_0x4994('0x132')](_0x406daa);}})[_0x4994('0x17')](function(_0x582c7a){if(_0x582c7a){return _0x582c7a?{'count':_0x430009,'rows':_0x582c7a}:null;}})[_0x4994('0x17')](respondWithResult(_0x4f5787,null))[_0x4994('0x20')](handleError(_0x4f5787,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index fbbc3c9..b82d80f 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 _0xb90d=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xb90d,0x17a));var _0xdb90=function(_0x27e86e,_0x49d030){_0x27e86e=_0x27e86e-0x0;var _0x57d83e=_0xb90d[_0x27e86e];return _0x57d83e;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xdb90('0x0'))['db'][_0xdb90('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdb90('0x2')](0x0);var events={'afterCreate':_0xdb90('0x3'),'afterUpdate':_0xdb90('0x4'),'afterDestroy':_0xdb90('0x5')};function emitEvent(_0x4a9a1f){return function(_0x3db22e,_0x12db41,_0x1b7d75){ChatWebsiteEvents['emit'](_0x4a9a1f+':'+_0x3db22e['id'],_0x3db22e);ChatWebsiteEvents['emit'](_0x4a9a1f,_0x3db22e);_0x1b7d75(null);};}for(var e in events){if(events[_0xdb90('0x6')](e)){var event=events[e];ChatWebsite[_0xdb90('0x7')](e,emitEvent(event));}}module[_0xdb90('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0xd246=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0xd0d541,_0x4cf939){var _0x488821=function(_0x5e01e3){while(--_0x5e01e3){_0xd0d541['push'](_0xd0d541['shift']());}};_0x488821(++_0x4cf939);}(_0xd246,0xf5));var _0x6d24=function(_0x4eeca4,_0x5901c9){_0x4eeca4=_0x4eeca4-0x0;var _0x430031=_0xd246[_0x4eeca4];return _0x430031;};'use strict';var EventEmitter=require(_0x6d24('0x0'));var ChatWebsite=require(_0x6d24('0x1'))['db'][_0x6d24('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6d24('0x3')](0x0);var events={'afterCreate':_0x6d24('0x4'),'afterUpdate':_0x6d24('0x5'),'afterDestroy':_0x6d24('0x6')};function emitEvent(_0x51c18f){return function(_0x4e76e1,_0xfa68f3,_0x58e7fc){ChatWebsiteEvents[_0x6d24('0x7')](_0x51c18f+':'+_0x4e76e1['id'],_0x4e76e1);ChatWebsiteEvents['emit'](_0x51c18f,_0x4e76e1);_0x58e7fc(null);};}for(var e in events){if(events[_0x6d24('0x8')](e)){var event=events[e];ChatWebsite[_0x6d24('0x9')](e,emitEvent(event));}}module[_0x6d24('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index bef4379..fbdd643 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 _0x95bc=['path','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','../../config/logger','api','bluebird','request-promise'];(function(_0x1fdd3e,_0x22735b){var _0x2da065=function(_0x45f972){while(--_0x45f972){_0x1fdd3e['push'](_0x1fdd3e['shift']());}};_0x2da065(++_0x22735b);}(_0x95bc,0x11e));var _0xc95b=function(_0x4276cc,_0x33756c){_0x4276cc=_0x4276cc-0x0;var _0x215fa9=_0x95bc[_0x4276cc];return _0x215fa9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc95b('0x0'))(_0xc95b('0x1'));var moment=require('moment');var BPromise=require(_0xc95b('0x2'));var rp=require(_0xc95b('0x3'));var fs=require('fs');var path=require(_0xc95b('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc95b('0x5'));module[_0xc95b('0x6')]=function(_0x16b34b,_0x47de34){return _0x16b34b[_0xc95b('0x7')](_0xc95b('0x8'),attributes,{'tableName':_0xc95b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d1=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5747b7,_0x365173){var _0x5219a1=function(_0x26325a){while(--_0x26325a){_0x5747b7['push'](_0x5747b7['shift']());}};_0x5219a1(++_0x365173);}(_0xa2d1,0x6f));var _0x1a2d=function(_0x55eb57,_0x1011e2){_0x55eb57=_0x55eb57-0x0;var _0x55ca29=_0xa2d1[_0x55eb57];return _0x55ca29;};'use strict';var _=require(_0x1a2d('0x0'));var util=require(_0x1a2d('0x1'));var logger=require(_0x1a2d('0x2'))(_0x1a2d('0x3'));var moment=require(_0x1a2d('0x4'));var BPromise=require(_0x1a2d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a2d('0x6'));var config=require(_0x1a2d('0x7'));var attributes=require(_0x1a2d('0x8'));module[_0x1a2d('0x9')]=function(_0x45f868,_0x449eb6){return _0x45f868[_0x1a2d('0xa')](_0x1a2d('0xb'),attributes,{'tableName':_0x1a2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 4725f4a..7cc5690 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 _0x0e90=['../../config/environment','client','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','info','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','rpc'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0x0e90,0x79));var _0x00e9=function(_0x3ea66c,_0x18b856){_0x3ea66c=_0x3ea66c-0x0;var _0x5b6f11=_0x0e90[_0x3ea66c];return _0x5b6f11;};'use strict';var _=require(_0x00e9('0x0'));var util=require(_0x00e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x00e9('0x2'));var fs=require('fs');var Redis=require(_0x00e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x00e9('0x4'));var config=require(_0x00e9('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x00e9('0x6')]['http']({'port':0x232a});config[_0x00e9('0x7')]=_['defaults'](config[_0x00e9('0x7')],{'host':_0x00e9('0x8'),'port':0x18eb});var socket=require(_0x00e9('0x9'))(new Redis(config[_0x00e9('0x7')]));require(_0x00e9('0xa'))[_0x00e9('0xb')](socket);function respondWithRpcPromise(_0x2ebfed,_0x16580f,_0xbd2a3b){return new BPromise(function(_0x521ff9,_0x38b403){return client[_0x00e9('0xc')](_0x2ebfed,_0xbd2a3b)['then'](function(_0x2f026c){logger[_0x00e9('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x16580f,_0x00e9('0xe'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x16580f,_0x00e9('0xe'),JSON[_0x00e9('0xf')](_0x2f026c));if(_0x2f026c['error']){if(_0x2f026c[_0x00e9('0x10')][_0x00e9('0x11')]===0x1f4){logger['error'](_0x00e9('0x12'),_0x16580f,_0x2f026c[_0x00e9('0x10')][_0x00e9('0x13')]);return _0x38b403(_0x2f026c[_0x00e9('0x10')][_0x00e9('0x13')]);}logger[_0x00e9('0x10')](_0x00e9('0x12'),_0x16580f,_0x2f026c[_0x00e9('0x10')]['message']);return _0x521ff9(_0x2f026c[_0x00e9('0x10')]['message']);}else{logger[_0x00e9('0xd')](_0x00e9('0x12'),_0x16580f,_0x00e9('0xe'));_0x521ff9(_0x2f026c[_0x00e9('0x14')]['message']);}})['catch'](function(_0x4911ab){logger[_0x00e9('0x10')](_0x00e9('0x12'),_0x16580f,_0x4911ab);_0x38b403(_0x4911ab);});});} \ No newline at end of file +var _0xf381=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result'];(function(_0x608efe,_0x4516e6){var _0x18f678=function(_0x4b3c7c){while(--_0x4b3c7c){_0x608efe['push'](_0x608efe['shift']());}};_0x18f678(++_0x4516e6);}(_0xf381,0x160));var _0x1f38=function(_0x5078d7,_0x1ff80a){_0x5078d7=_0x5078d7-0x0;var _0x143fee=_0xf381[_0x5078d7];return _0x143fee;};'use strict';var _=require(_0x1f38('0x0'));var util=require(_0x1f38('0x1'));var moment=require(_0x1f38('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f38('0x3'));var fs=require('fs');var Redis=require(_0x1f38('0x4'));var db=require(_0x1f38('0x5'))['db'];var utils=require(_0x1f38('0x6'));var logger=require('../../config/logger')(_0x1f38('0x7'));var config=require(_0x1f38('0x8'));var jayson=require(_0x1f38('0x9'));var client=jayson[_0x1f38('0xa')][_0x1f38('0xb')]({'port':0x232a});config[_0x1f38('0xc')]=_[_0x1f38('0xd')](config[_0x1f38('0xc')],{'host':_0x1f38('0xe'),'port':0x18eb});var socket=require(_0x1f38('0xf'))(new Redis(config[_0x1f38('0xc')]));require(_0x1f38('0x10'))['register'](socket);function respondWithRpcPromise(_0x27995c,_0x374302,_0x5e94da){return new BPromise(function(_0x44364c,_0x18b8f0){return client[_0x1f38('0x11')](_0x27995c,_0x5e94da)[_0x1f38('0x12')](function(_0x3e1cf8){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'),JSON['stringify'](_0x3e1cf8));if(_0x3e1cf8[_0x1f38('0x14')]){if(_0x3e1cf8['error'][_0x1f38('0x15')]===0x1f4){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x3e1cf8[_0x1f38('0x14')]['message']);return _0x18b8f0(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}logger[_0x1f38('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);return _0x44364c(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}else{logger[_0x1f38('0x18')](_0x1f38('0x16'),_0x374302,'request\x20sent');_0x44364c(_0x3e1cf8[_0x1f38('0x19')]['message']);}})[_0x1f38('0x1a')](function(_0x13babe){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x13babe);_0x18b8f0(_0x13babe);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 2da6c8b..d49fded 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 _0x4a40=['update','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x4a40,0xc4));var _0x04a4=function(_0x51f09a,_0x21607f){_0x51f09a=_0x51f09a-0x0;var _0x23aabf=_0x4a40[_0x51f09a];return _0x23aabf;};'use strict';var ChatWebsiteEvents=require(_0x04a4('0x0'));var events=['save',_0x04a4('0x1'),_0x04a4('0x2')];function createListener(_0x2c51fc,_0x68934e){return function(_0x9e22a2){_0x68934e['emit'](_0x2c51fc,_0x9e22a2);};}function removeListener(_0x3966cf,_0x77c490){return function(){ChatWebsiteEvents['removeListener'](_0x3966cf,_0x77c490);};}exports[_0x04a4('0x3')]=function(_0x480027){for(var _0x4f93f2=0x0,_0x143112=events[_0x04a4('0x4')];_0x4f93f2<_0x143112;_0x4f93f2++){var _0x388062=events[_0x4f93f2];var _0x444866=createListener(_0x04a4('0x5')+_0x388062,_0x480027);ChatWebsiteEvents['on'](_0x388062,_0x444866);}}; \ No newline at end of file +var _0x5839=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x2b9d5c,_0x173518){var _0x37bb93=function(_0x5515cd){while(--_0x5515cd){_0x2b9d5c['push'](_0x2b9d5c['shift']());}};_0x37bb93(++_0x173518);}(_0x5839,0x158));var _0x9583=function(_0x480957,_0x2632b7){_0x480957=_0x480957-0x0;var _0x5101d3=_0x5839[_0x480957];return _0x5101d3;};'use strict';var ChatWebsiteEvents=require(_0x9583('0x0'));var events=[_0x9583('0x1'),_0x9583('0x2'),_0x9583('0x3')];function createListener(_0x1973a3,_0x2dcfb9){return function(_0x3652ee){_0x2dcfb9[_0x9583('0x4')](_0x1973a3,_0x3652ee);};}function removeListener(_0x2a8679,_0xf89270){return function(){ChatWebsiteEvents[_0x9583('0x5')](_0x2a8679,_0xf89270);};}exports[_0x9583('0x6')]=function(_0x32bed7){for(var _0xf16798=0x0,_0x2d2d76=events[_0x9583('0x7')];_0xf16798<_0x2d2d76;_0xf16798++){var _0x1e2720=events[_0xf16798];var _0x57e550=createListener(_0x9583('0x8')+_0x1e2720,_0x32bed7);ChatWebsiteEvents['on'](_0x1e2720,_0x57e550);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index f12314a..538c2a7 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 _0xacc1=['diskStorage','join','root','%s-%s','originalname','file','addLogo','server/files/images/avatars/','format','single','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','replace','extname','/:id/interactions','addInteraction','addAgents','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers'];(function(_0xc75e69,_0x19ac94){var _0x447f25=function(_0x25125c){while(--_0x25125c){_0xc75e69['push'](_0xc75e69['shift']());}};_0x447f25(++_0x19ac94);}(_0xacc1,0x1f4));var _0x1acc=function(_0x1e2e3b,_0x5d37c0){_0x1e2e3b=_0x1e2e3b-0x0;var _0x21bae3=_0xacc1[_0x1e2e3b];return _0x21bae3;};'use strict';var multer=require('multer');var util=require(_0x1acc('0x0'));var path=require(_0x1acc('0x1'));var timeout=require(_0x1acc('0x2'));var express=require(_0x1acc('0x3'));var router=express[_0x1acc('0x4')]();var fs_extra=require(_0x1acc('0x5'));var auth=require(_0x1acc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x1acc('0x7')](),controller[_0x1acc('0x8')]);router[_0x1acc('0x9')](_0x1acc('0xa'),auth[_0x1acc('0x7')](),controller[_0x1acc('0xb')]);router[_0x1acc('0x9')]('/:id',auth[_0x1acc('0x7')](),controller[_0x1acc('0xc')]);router[_0x1acc('0x9')](_0x1acc('0xd'),auth[_0x1acc('0x7')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1acc('0xe')]);router[_0x1acc('0x9')]('/:id/logo',controller[_0x1acc('0xf')]);router['get'](_0x1acc('0x10'),controller[_0x1acc('0x11')]);router[_0x1acc('0x9')](_0x1acc('0x12'),controller[_0x1acc('0x13')]);router['get'](_0x1acc('0x14'),controller[_0x1acc('0x15')]);router[_0x1acc('0x9')]('/:id/interactions',auth[_0x1acc('0x7')](),controller[_0x1acc('0x16')]);router[_0x1acc('0x9')]('/:id/snippet',controller[_0x1acc('0x17')]);router[_0x1acc('0x9')](_0x1acc('0x18'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x19')]);router[_0x1acc('0x9')](_0x1acc('0x1a'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x1b')]);router['get'](_0x1acc('0x1c'),controller['getFields']);router['get'](_0x1acc('0x1d'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x1e')]);router['get'](_0x1acc('0x1f'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x20')]);router['post']('/',auth[_0x1acc('0x7')](),controller['create']);router[_0x1acc('0x21')](_0x1acc('0xd'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x22')]);router[_0x1acc('0x21')](_0x1acc('0x23'),auth[_0x1acc('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x43a860,_0x5b8378,_0x626f1d){_0x626f1d(null,path[_0x1acc('0x25')](config[_0x1acc('0x26')],'server/files/images/logos/'));},'filename':function(_0x385efc,_0x40fcab,_0x6c4826){_0x6c4826(null,util['format'](_0x1acc('0x27'),Date['now'](),_0x40fcab[_0x1acc('0x28')]));}})});router[_0x1acc('0x21')]('/:id/logo',upload['single'](_0x1acc('0x29')),controller[_0x1acc('0x2a')]);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x5c4f03,_0x412efa,_0x16fb3f){_0x16fb3f(null,path[_0x1acc('0x25')](config['root'],_0x1acc('0x2b')));},'filename':function(_0x147e4a,_0x355609,_0x2aa899){_0x2aa899(null,util[_0x1acc('0x2c')](_0x1acc('0x27'),Date['now'](),_0x355609[_0x1acc('0x28')]));}})});router[_0x1acc('0x21')](_0x1acc('0x10'),upload[_0x1acc('0x2d')](_0x1acc('0x29')),controller[_0x1acc('0x2e')]);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x29b211,_0x18a6d8,_0x308b38){_0x308b38(null,path[_0x1acc('0x25')](config['root'],_0x1acc('0x2b')));},'filename':function(_0x500259,_0x588bc4,_0x3a1596){_0x3a1596(null,util[_0x1acc('0x2c')]('%s-%s',Date[_0x1acc('0x2f')](),_0x588bc4[_0x1acc('0x28')]));}})});router[_0x1acc('0x21')](_0x1acc('0x12'),upload['single'](_0x1acc('0x29')),controller[_0x1acc('0x30')]);var upload=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x252d97,_0xf82be6,_0x3ba9a8){_0x3ba9a8(null,path['join'](config['root'],_0x1acc('0x2b')));},'filename':function(_0x3c5902,_0x41e8b0,_0xa1c640){_0xa1c640(null,util[_0x1acc('0x2c')]('%s-%s',Date[_0x1acc('0x2f')](),_0x41e8b0['originalname']));}})});router[_0x1acc('0x21')]('/:id/system_avatar',upload['single']('file'),controller[_0x1acc('0x31')]);router[_0x1acc('0x21')](_0x1acc('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x1acc('0x24')]({'destination':function(_0x36e9fb,_0x2e0898,_0x3d4cdf){const _0x3aef3f=path[_0x1acc('0x25')](config[_0x1acc('0x26')],_0x1acc('0x33'),_0x1acc('0x34'),_0x1acc('0x35'));fs_extra['ensureDir'](_0x3aef3f,function(){_0x3d4cdf(null,_0x3aef3f);});},'filename':function(_0x525c5f,_0x2789a8,_0x16f204){const _0x1853f3=_0x2789a8[_0x1acc('0x28')][_0x1acc('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x31829b=path[_0x1acc('0x37')](_0x1853f3);const _0x566c28=Date['now']()+'-'+_0x1853f3[_0x1acc('0x36')](_0x31829b,'')+_0x31829b;_0x16f204(null,_0x566c28);}})});router[_0x1acc('0x21')]('/:id/offline',offlineUploadMulter['any'](),controller['offline']);router[_0x1acc('0x21')](_0x1acc('0x38'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x39')]);router['post'](_0x1acc('0x18'),auth[_0x1acc('0x7')](),controller['addApplications']);router[_0x1acc('0x21')](_0x1acc('0x1a'),auth[_0x1acc('0x7')](),controller['addProactiveActions']);router[_0x1acc('0x21')](_0x1acc('0x1f'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x3a')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1acc('0x3b')]);router[_0x1acc('0x3c')](_0x1acc('0x3d'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x3e')]);router[_0x1acc('0x3c')](_0x1acc('0xd'),auth['isAuthenticated'](),controller[_0x1acc('0x3f')]);router[_0x1acc('0x3c')](_0x1acc('0x23'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x40')]);router['delete'](_0x1acc('0x1f'),auth[_0x1acc('0x7')](),controller[_0x1acc('0x41')]);module[_0x1acc('0x42')]=router; \ No newline at end of file +var _0xb1f8=['originalname','/:id/logo','single','file','addLogo','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now'];(function(_0x5c0dd9,_0x543e97){var _0x51b27e=function(_0x188c6d){while(--_0x188c6d){_0x5c0dd9['push'](_0x5c0dd9['shift']());}};_0x51b27e(++_0x543e97);}(_0xb1f8,0xb2));var _0x8b1f=function(_0x33fa50,_0x281caa){_0x33fa50=_0x33fa50-0x0;var _0x52d1c3=_0xb1f8[_0x33fa50];return _0x52d1c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b1f('0x0'));var timeout=require(_0x8b1f('0x1'));var express=require(_0x8b1f('0x2'));var router=express[_0x8b1f('0x3')]();var fs_extra=require(_0x8b1f('0x4'));var auth=require(_0x8b1f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b1f('0x6'));var controller=require('./chatWebsite.controller');router[_0x8b1f('0x7')]('/',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x9')]);router[_0x8b1f('0x7')](_0x8b1f('0xa'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xb')]);router['get']('/:id',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xc')]);router['get'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xe')]);router[_0x8b1f('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8b1f('0xf')]);router[_0x8b1f('0x7')]('/:id/logo',controller[_0x8b1f('0x10')]);router[_0x8b1f('0x7')](_0x8b1f('0x11'),controller[_0x8b1f('0x12')]);router[_0x8b1f('0x7')](_0x8b1f('0x13'),controller[_0x8b1f('0x14')]);router[_0x8b1f('0x7')]('/:id/system_avatar',controller[_0x8b1f('0x15')]);router[_0x8b1f('0x7')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x17')]);router[_0x8b1f('0x7')](_0x8b1f('0x18'),controller['getSnippet']);router[_0x8b1f('0x7')](_0x8b1f('0x19'),auth[_0x8b1f('0x8')](),controller['getApplications']);router[_0x8b1f('0x7')](_0x8b1f('0x1a'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1b')]);router[_0x8b1f('0x7')](_0x8b1f('0x1c'),controller[_0x8b1f('0x1d')]);router[_0x8b1f('0x7')](_0x8b1f('0x1e'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1f')]);router[_0x8b1f('0x7')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x21')]);router[_0x8b1f('0x22')]('/',auth[_0x8b1f('0x8')](),controller['create']);router['post'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x23')]);router[_0x8b1f('0x22')](_0x8b1f('0x24'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x25')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5955cc,_0x44625f,_0x18336d){_0x18336d(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x28')));},'filename':function(_0x5f233a,_0x252929,_0x2d1c9e){_0x2d1c9e(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x252929[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x2d'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x30')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x27fca4,_0x485bba,_0x5cd42c){_0x5cd42c(null,path[_0x8b1f('0x27')](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x18f0d2,_0x1e6262,_0x2850f1){_0x2850f1(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x1e6262[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x11'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x33')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0xf73504,_0x6713d,_0x308cbc){_0x308cbc(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x32')));},'filename':function(_0x6afd48,_0x26525b,_0x1f2ff5){_0x1f2ff5(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date['now'](),_0x26525b[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x13'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x34')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5062ca,_0x35a282,_0x5e99e2){_0x5e99e2(null,path['join'](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x22eb34,_0x52b4bb,_0x4be9e9){_0x4be9e9(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x52b4bb[_0x8b1f('0x2c')]));}})});router[_0x8b1f('0x22')](_0x8b1f('0x35'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x36')]);router['post'](_0x8b1f('0x37'),controller[_0x8b1f('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x183942,_0x13cc19,_0x10f4e1){const _0x5ab45c=path[_0x8b1f('0x27')](config['root'],'server/files','attachments',_0x8b1f('0x39'));fs_extra[_0x8b1f('0x3a')](_0x5ab45c,function(){_0x10f4e1(null,_0x5ab45c);});},'filename':function(_0x2eda1c,_0x52f758,_0x84b58b){const _0x4a2fe4=_0x52f758[_0x8b1f('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5bfdb2=path['extname'](_0x4a2fe4);const _0xcfd715=Date[_0x8b1f('0x2b')]()+'-'+_0x4a2fe4[_0x8b1f('0x3b')](_0x5bfdb2,'')+_0x5bfdb2;_0x84b58b(null,_0xcfd715);}})});router[_0x8b1f('0x22')](_0x8b1f('0x3c'),offlineUploadMulter[_0x8b1f('0x3d')](),controller[_0x8b1f('0x3e')]);router[_0x8b1f('0x22')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x3f')]);router[_0x8b1f('0x22')]('/:id/applications',auth[_0x8b1f('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x40')]);router[_0x8b1f('0x22')](_0x8b1f('0x20'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x41')]);router[_0x8b1f('0x42')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x44')]);router[_0x8b1f('0x45')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x46')]);router[_0x8b1f('0x45')](_0x8b1f('0xd'),auth['isAuthenticated'](),controller[_0x8b1f('0x47')]);router[_0x8b1f('0x45')](_0x8b1f('0x24'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8b1f('0x45')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x48')]);module[_0x8b1f('0x49')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index fa53fab..edd1cb5 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 _0xbf44=['app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','exports','beaver-logger/server','express','../components/auth/service','Router','env'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbf44,0xd7));var _0x4bf4=function(_0x5ab39b,_0x346b1b){_0x5ab39b=_0x5ab39b-0x0;var _0x3150e2=_0xbf44[_0x5ab39b];return _0x3150e2;};var beaverLogger=require(_0x4bf4('0x0'));var express=require(_0x4bf4('0x1'));var auth=require(_0x4bf4('0x2'));var config=require('../config/environment');var router=express[_0x4bf4('0x3')]();var isProduction=config[_0x4bf4('0x4')]==='production'||![];function clientSideLogs(_0x135d2a,_0x19b229,_0x3c0d3f){var _0x4bd87d=_0x135d2a[_0x4bf4('0x5')]['get'](_0x4bf4('0x6'));if(!_0x4bd87d){throw new Error(_0x4bf4('0x7'));}return beaverLogger[_0x4bf4('0x8')]({'uri':'/client-logs','logger':_0x4bd87d,'enableCors':!isProduction})(_0x135d2a,_0x19b229,_0x3c0d3f);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x4bf4('0x9')]=router; \ No newline at end of file +var _0x57b3=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','../components/auth/service','Router'];(function(_0x125da9,_0x559df9){var _0x1426b4=function(_0x5492b8){while(--_0x5492b8){_0x125da9['push'](_0x125da9['shift']());}};_0x1426b4(++_0x559df9);}(_0x57b3,0x72));var _0x357b=function(_0x5e9b88,_0x320778){_0x5e9b88=_0x5e9b88-0x0;var _0x471af0=_0x57b3[_0x5e9b88];return _0x471af0;};var beaverLogger=require(_0x357b('0x0'));var express=require('express');var auth=require(_0x357b('0x1'));var config=require('../config/environment');var router=express[_0x357b('0x2')]();var isProduction=config[_0x357b('0x3')]===_0x357b('0x4')||![];function clientSideLogs(_0x39a277,_0x10dccf,_0x5aed32){var _0x5d69bd=_0x39a277[_0x357b('0x5')][_0x357b('0x6')](_0x357b('0x7'));if(!_0x5d69bd){throw new Error(_0x357b('0x8'));}return beaverLogger[_0x357b('0x9')]({'uri':_0x357b('0xa'),'logger':_0x5d69bd,'enableCors':!isProduction})(_0x39a277,_0x10dccf,_0x5aed32);}router[_0x357b('0xb')](auth[_0x357b('0xc')](),clientSideLogs);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 8387e7e..09c2b25 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 _0x0dd8=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x469c7c,_0x4a54c6){var _0x4b8ffa=function(_0x2bff74){while(--_0x2bff74){_0x469c7c['push'](_0x469c7c['shift']());}};_0x4b8ffa(++_0x4a54c6);}(_0x0dd8,0xef));var _0x80dd=function(_0x3c53fe,_0xad83fb){_0x3c53fe=_0x3c53fe-0x0;var _0x1bef0d=_0x0dd8[_0x3c53fe];return _0x1bef0d;};'use strict';var Sequelize=require('sequelize');module[_0x80dd('0x0')]={'name':{'type':Sequelize[_0x80dd('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x80dd('0x2')](_0x80dd('0x3'),_0x80dd('0x4'),_0x80dd('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x80dd('0x6'),_0x80dd('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x80dd('0x8')},'data2':{'type':Sequelize[_0x80dd('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x80dd('0x1')],'comment':_0x80dd('0x9')},'data4':{'type':Sequelize[_0x80dd('0x1')],'comment':_0x80dd('0xa')},'data5':{'type':Sequelize[_0x80dd('0xb')],'comment':_0x80dd('0xc')},'data6':{'type':Sequelize[_0x80dd('0xb')],'comment':_0x80dd('0xd')},'data7':{'type':Sequelize[_0x80dd('0xb')],'comment':_0x80dd('0xe')}}; \ No newline at end of file +var _0xe6ca=['Google','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x5a04ac,_0x2b8b74){var _0x2406d9=function(_0x3e4237){while(--_0x3e4237){_0x5a04ac['push'](_0x5a04ac['shift']());}};_0x2406d9(++_0x2b8b74);}(_0xe6ca,0xd8));var _0xae6c=function(_0xe69ec7,_0x44d820){_0xe69ec7=_0xe69ec7-0x0;var _0x164d47=_0xe6ca[_0xe69ec7];return _0x164d47;};'use strict';var Sequelize=require(_0xae6c('0x0'));module[_0xae6c('0x1')]={'name':{'type':Sequelize[_0xae6c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xae6c('0x3')](_0xae6c('0x4'),_0xae6c('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xae6c('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x7')},'data3':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x8')},'data4':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xa')},'data6':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xae6c('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index f1a7689..e472413 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 _0x34f0=['Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','findAll','rows','MicrosoftAzure','decryptString','data3','catch','params','length','include','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','error','get','parse','from','state','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message'];(function(_0x17df57,_0x3be05b){var _0x4b58d8=function(_0x2338cd){while(--_0x2338cd){_0x17df57['push'](_0x17df57['shift']());}};_0x4b58d8(++_0x3be05b);}(_0x34f0,0x11c));var _0x034f=function(_0x281a8a,_0x50c6e8){_0x281a8a=_0x281a8a-0x0;var _0xfc2be8=_0x34f0[_0x281a8a];return _0xfc2be8;};'use strict';var _=require('lodash');var Redis=require(_0x034f('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0x034f('0x1'));var logger=require(_0x034f('0x2'))(_0x034f('0x3'));var db=require(_0x034f('0x4'))['db'];var oauth=require(_0x034f('0x5'));config[_0x034f('0x6')]=_['defaults'](config[_0x034f('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x034f('0x6')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x52c438,_0x3c32b9){_0x3c32b9=_0x3c32b9||0xcc;return function(_0x542476){if(_0x542476){return _0x52c438[_0x034f('0x7')](_0x3c32b9);}return _0x52c438[_0x034f('0x8')](_0x3c32b9)['end']();};}function respondWithResult(_0x2934ea,_0x868d41){_0x868d41=_0x868d41||0xc8;return function(_0x4eb486){if(_0x4eb486){return _0x2934ea[_0x034f('0x8')](_0x868d41)[_0x034f('0x9')](_0x4eb486);}};}function respondWithFilteredResult(_0x3a713a,_0x29d1b7){return function(_0x141531){if(_0x141531){var _0x1e2f9b=typeof _0x29d1b7[_0x034f('0xa')]===_0x034f('0xb')&&typeof _0x29d1b7[_0x034f('0xc')]===_0x034f('0xb');var _0x23fb5c=_0x141531[_0x034f('0xd')];var _0x9a577e=_0x1e2f9b?0x0:_0x29d1b7[_0x034f('0xa')];var _0x41e1b0=_0x1e2f9b?_0x141531[_0x034f('0xd')]:_0x29d1b7[_0x034f('0xa')]+_0x29d1b7[_0x034f('0xc')];var _0x33866f;if(_0x41e1b0>=_0x23fb5c){_0x41e1b0=_0x23fb5c;_0x33866f=0xc8;}else{_0x33866f=0xce;}_0x3a713a[_0x034f('0x8')](_0x33866f);return _0x3a713a[_0x034f('0xe')](_0x034f('0xf'),_0x9a577e+'-'+_0x41e1b0+'/'+_0x23fb5c)[_0x034f('0x9')](_0x141531);}return null;};}function saveUpdates(_0x50f5d6){return function(_0x4f40d1){if(_0x4f40d1){return _0x4f40d1[_0x034f('0x10')](_0x50f5d6)[_0x034f('0x11')](function(_0xfce2b7){return _0xfce2b7;});}return null;};}function removeEntity(_0x5c2087){return function(_0x112221){if(_0x112221){return _0x112221['destroy']()['then'](function(){_0x5c2087[_0x034f('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ebc4){return function(_0x137ccc){if(!_0x137ccc){_0x45ebc4['sendStatus'](0x194);}return _0x137ccc;};}function handleError(_0x1c995a,_0x5df401){_0x5df401=_0x5df401||0x1f4;return function(_0x20b951){logger['error'](_0x20b951[_0x034f('0x12')]);if(_0x20b951[_0x034f('0x13')]){delete _0x20b951[_0x034f('0x13')];}_0x1c995a[_0x034f('0x8')](_0x5df401)[_0x034f('0x14')](_0x20b951);};}function maskClientSecret(_0x528600){return _[_0x034f('0x15')](_0x528600[_0x034f('0x16')](0x0,0x3),0x14,'*');}exports[_0x034f('0x17')]=function(_0x55f24c,_0xc24eeb){var _0x5712db={},_0x52887a={},_0x86868={'count':0x0,'rows':[]};var _0x5e5c5b=_[_0x034f('0x18')](db[_0x034f('0x19')][_0x034f('0x1a')],function(_0x464aab){return{'name':_0x464aab[_0x034f('0x1b')],'type':_0x464aab[_0x034f('0x1c')][_0x034f('0x1d')]};});_0x52887a[_0x034f('0x1e')]=_['map'](_0x5e5c5b,_0x034f('0x13'));_0x52887a[_0x034f('0x1f')]=_['keys'](_0x55f24c[_0x034f('0x1f')]);_0x52887a[_0x034f('0x20')]=_['intersection'](_0x52887a[_0x034f('0x1e')],_0x52887a[_0x034f('0x1f')]);_0x5712db[_0x034f('0x21')]=_[_0x034f('0x22')](_0x52887a[_0x034f('0x1e')],qs[_0x034f('0x23')](_0x55f24c['query'][_0x034f('0x23')]));_0x5712db[_0x034f('0x21')]=_0x5712db[_0x034f('0x21')]['length']?_0x5712db[_0x034f('0x21')]:_0x52887a[_0x034f('0x1e')];if(!_0x55f24c[_0x034f('0x1f')][_0x034f('0x24')]('nolimit')){_0x5712db[_0x034f('0xc')]=qs['limit'](_0x55f24c['query'][_0x034f('0xc')]);_0x5712db[_0x034f('0xa')]=qs[_0x034f('0xa')](_0x55f24c[_0x034f('0x1f')][_0x034f('0xa')]);}_0x5712db[_0x034f('0x25')]=qs[_0x034f('0x26')](_0x55f24c['query'][_0x034f('0x26')]);_0x5712db['where']=qs['filters'](_[_0x034f('0x27')](_0x55f24c[_0x034f('0x1f')],_0x52887a['filters']),_0x5e5c5b);if(_0x55f24c[_0x034f('0x1f')]['filter']){_0x5712db['where']=_[_0x034f('0x28')](_0x5712db[_0x034f('0x29')],{'$or':_[_0x034f('0x18')](_0x5e5c5b,function(_0x207388){if(_0x207388[_0x034f('0x1c')]!==_0x034f('0x2a')){var _0x2a049d={};_0x2a049d[_0x207388[_0x034f('0x13')]]={'$like':'%'+_0x55f24c[_0x034f('0x1f')][_0x034f('0x2b')]+'%'};return _0x2a049d;}})});}_0x5712db=_[_0x034f('0x28')]({},_0x5712db,_0x55f24c['options']);var _0x43a66a={'where':_0x5712db[_0x034f('0x29')]};return db['CloudProvider'][_0x034f('0xd')](_0x43a66a)[_0x034f('0x11')](function(_0x53227c){_0x86868[_0x034f('0xd')]=_0x53227c;if(_0x55f24c[_0x034f('0x1f')][_0x034f('0x2c')]){_0x5712db['include']=[{'all':!![]}];}return db['CloudProvider'][_0x034f('0x2d')](_0x5712db);})['then'](function(_0x37a960){_0x86868[_0x034f('0x2e')]=_[_0x034f('0x18')](_0x37a960,function(_0x5d339c){if(_0x5d339c['service']===_0x034f('0x2f')){var _0xe2474e=encryptor[_0x034f('0x30')](_0x5d339c[_0x034f('0x31')]);_0x5d339c[_0x034f('0x31')]=maskClientSecret(_0xe2474e);}return _0x5d339c;});return _0x86868;})[_0x034f('0x11')](respondWithFilteredResult(_0xc24eeb,_0x5712db))[_0x034f('0x32')](handleError(_0xc24eeb,null));};exports['show']=function(_0x4a1278,_0x408fde){var _0x553ba6={'raw':!![],'where':{'id':_0x4a1278[_0x034f('0x33')]['id']}},_0x59c598={};_0x59c598[_0x034f('0x1e')]=_['keys'](db[_0x034f('0x19')][_0x034f('0x1a')]);_0x59c598[_0x034f('0x1f')]=_['keys'](_0x4a1278[_0x034f('0x1f')]);_0x59c598[_0x034f('0x20')]=_['intersection'](_0x59c598[_0x034f('0x1e')],_0x59c598[_0x034f('0x1f')]);_0x553ba6[_0x034f('0x21')]=_[_0x034f('0x22')](_0x59c598[_0x034f('0x1e')],qs['fields'](_0x4a1278[_0x034f('0x1f')][_0x034f('0x23')]));_0x553ba6['attributes']=_0x553ba6[_0x034f('0x21')][_0x034f('0x34')]?_0x553ba6[_0x034f('0x21')]:_0x59c598[_0x034f('0x1e')];if(_0x4a1278['query'][_0x034f('0x2c')]){_0x553ba6[_0x034f('0x35')]=[{'all':!![]}];}_0x553ba6=_['merge']({},_0x553ba6,_0x4a1278[_0x034f('0x36')]);return db[_0x034f('0x19')][_0x034f('0x37')](_0x553ba6)[_0x034f('0x11')](handleEntityNotFound(_0x408fde,null))[_0x034f('0x11')](function(_0xc5dac1){if(_0xc5dac1[_0x034f('0x38')]==='MicrosoftAzure'){var _0x298540=encryptor[_0x034f('0x30')](_0xc5dac1[_0x034f('0x31')]);_0xc5dac1['data3']=maskClientSecret(_0x298540);}return _0xc5dac1;})['then'](respondWithResult(_0x408fde,null))[_0x034f('0x32')](handleError(_0x408fde,null));};exports[_0x034f('0x39')]=function(_0x2203c5,_0x10f78a){if(!_0x2203c5[_0x034f('0x3a')][_0x034f('0x13')])throw new Error(_0x034f('0x3b'));if(!_0x2203c5['body'][_0x034f('0x38')])throw new Error(_0x034f('0x3c'));var _0x4a05f7=db[_0x034f('0x19')]['rawAttributes'][_0x034f('0x38')]['values'];if(!_0x4a05f7[_0x034f('0x3d')](_0x2203c5['body'][_0x034f('0x38')]))throw new Error(_0x034f('0x3e')+_0x4a05f7[_0x034f('0x3f')](',\x20'));if(_0x2203c5['body']['service']===_0x034f('0x2f')&&_0x2203c5[_0x034f('0x3a')][_0x034f('0x31')]){_0x2203c5[_0x034f('0x3a')][_0x034f('0x31')]=encryptor[_0x034f('0x40')](_0x2203c5[_0x034f('0x3a')]['data3']);}return db[_0x034f('0x19')][_0x034f('0x39')](_0x2203c5[_0x034f('0x3a')],{})[_0x034f('0x11')](respondWithResult(_0x10f78a,0xc9))['catch'](handleError(_0x10f78a,null));};exports[_0x034f('0x10')]=function(_0x1a3375,_0x3d31b6){if(_0x1a3375[_0x034f('0x3a')]['id']){delete _0x1a3375[_0x034f('0x3a')]['id'];}return db[_0x034f('0x19')][_0x034f('0x37')]({'where':{'id':_0x1a3375[_0x034f('0x33')]['id']}})[_0x034f('0x11')](handleEntityNotFound(_0x3d31b6,null))['then'](function(_0x4a4c76){if(_0x4a4c76[_0x034f('0x38')]===_0x034f('0x2f')&&_0x1a3375[_0x034f('0x3a')][_0x034f('0x31')]){_0x1a3375[_0x034f('0x3a')][_0x034f('0x31')]=encryptor['encryptString'](_0x1a3375[_0x034f('0x3a')]['data3']);}return _0x4a4c76;})['then'](saveUpdates(_0x1a3375[_0x034f('0x3a')],null))['then'](respondWithResult(_0x3d31b6,null))[_0x034f('0x32')](handleError(_0x3d31b6,null));};exports[_0x034f('0x41')]=function(_0x3b374b,_0x32ecd3){return db[_0x034f('0x19')]['find']({'where':{'id':_0x3b374b[_0x034f('0x33')]['id']}})[_0x034f('0x11')](handleEntityNotFound(_0x32ecd3,null))[_0x034f('0x11')](removeEntity(_0x32ecd3,null))[_0x034f('0x32')](handleError(_0x32ecd3,null));};exports[_0x034f('0x42')]=function(_0x119d6a,_0x2ad1c3){return db['CloudProvider'][_0x034f('0x43')]({'where':{'id':_0x119d6a[_0x034f('0x33')]['id']},'raw':!![]})['then'](function(_0x3c5beb){if(!_0x3c5beb)return _0x2ad1c3[_0x034f('0x7')](0x194);return{'url':oauth[_0x034f('0x44')](_0x3c5beb,_0x119d6a[_0x034f('0x45')]['id'])};})['then'](respondWithResult(_0x2ad1c3,null))[_0x034f('0x32')](handleError(_0x2ad1c3,null));};exports['oauth2MicrosoftCallback']=function(_0x392124,_0x42dcd7){var _0x118763=_0x392124[_0x034f('0x3a')];var _0x40edb8;var _0x3bd282;if(_0x118763[_0x034f('0x46')])throw _0x118763;redis[_0x034f('0x47')](_0x118763['state'])['then'](function(_0x209131){if(!_0x209131)throw new Error('Invalid\x20state\x20parameter');_0x40edb8=JSON[_0x034f('0x48')](_0x209131);var _0x5b5ef0=Buffer[_0x034f('0x49')](_0x118763[_0x034f('0x4a')],'base64')[_0x034f('0x4b')](_0x034f('0x4c'));_0x3bd282=JSON[_0x034f('0x48')](_0x5b5ef0);if(!oauth[_0x034f('0x4d')](_0x118763[_0x034f('0x4e')],_0x40edb8[_0x034f('0x4f')]))throw new Error(_0x034f('0x50'));redis[_0x034f('0x51')](_0x118763[_0x034f('0x4a')]);return oauth[_0x034f('0x52')](_0x118763[_0x034f('0x53')],_0x40edb8);})['then'](function(_0x292ddc){_0x40edb8[_0x034f('0x54')]=_0x292ddc[_0x034f('0x55')];_0x40edb8[_0x034f('0x56')]=_0x292ddc[_0x034f('0x57')];return db[_0x034f('0x19')]['update']({'data5':_0x40edb8[_0x034f('0x54')],'data6':_0x40edb8[_0x034f('0x56')]},{'where':{'id':_0x40edb8['id']}});})[_0x034f('0x11')](function(){oauth['startRefreshInterval'](_0x40edb8);socket[_0x034f('0x58')]('microsoftAuthorization:success',{'id':_0x3bd282['id']});return;})[_0x034f('0x11')](respondWithStatusCode(_0x42dcd7,null))[_0x034f('0x32')](function(_0x59549f){if(_0x3bd282){socket[_0x034f('0x58')](_0x034f('0x59'),{'id':_0x3bd282['id']});}if(!_0x40edb8){logger[_0x034f('0x46')](_0x034f('0x5a'),_0x59549f);return _0x42dcd7['status'](0x1f4)['send'](_0x59549f[_0x034f('0x5b')]);}logger[_0x034f('0x46')](_0x034f('0x5c'),_0x40edb8['id'],JSON[_0x034f('0x5d')](_0x59549f));});}; \ No newline at end of file +var _0xdc27=['json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','slice','index','map','CloudProvider','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','where','filter','merge','VIRTUAL','options','includeAll','rows','MicrosoftAzure','data3','show','include','service','catch','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','params','findOne','generateMicrosoftAuthorizationUrl','get','Invalid\x20state\x20parameter','from','state','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xdc27,0x1b4));var _0x7dc2=function(_0x363d9c,_0x40fd02){_0x363d9c=_0x363d9c-0x0;var _0x1d1c0c=_0xdc27[_0x363d9c];return _0x1d1c0c;};'use strict';var _=require(_0x7dc2('0x0'));var Redis=require(_0x7dc2('0x1'));var qs=require(_0x7dc2('0x2'));var encryptor=require(_0x7dc2('0x3'));var config=require(_0x7dc2('0x4'));var logger=require(_0x7dc2('0x5'))(_0x7dc2('0x6'));var db=require(_0x7dc2('0x7'))['db'];var oauth=require(_0x7dc2('0x8'));config[_0x7dc2('0x9')]=_[_0x7dc2('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7dc2('0xb'))(new Redis(config[_0x7dc2('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5b059b,_0xcb6be8){_0xcb6be8=_0xcb6be8||0xcc;return function(_0x1de6ae){if(_0x1de6ae){return _0x5b059b['sendStatus'](_0xcb6be8);}return _0x5b059b[_0x7dc2('0xc')](_0xcb6be8)[_0x7dc2('0xd')]();};}function respondWithResult(_0x1d83fb,_0x52c651){_0x52c651=_0x52c651||0xc8;return function(_0x2d7ed7){if(_0x2d7ed7){return _0x1d83fb[_0x7dc2('0xc')](_0x52c651)[_0x7dc2('0xe')](_0x2d7ed7);}};}function respondWithFilteredResult(_0x3c3017,_0xc7df69){return function(_0x4072c9){if(_0x4072c9){var _0x48da8f=typeof _0xc7df69[_0x7dc2('0xf')]===_0x7dc2('0x10')&&typeof _0xc7df69[_0x7dc2('0x11')]===_0x7dc2('0x10');var _0xc9d90f=_0x4072c9[_0x7dc2('0x12')];var _0x46d2b6=_0x48da8f?0x0:_0xc7df69[_0x7dc2('0xf')];var _0x55e544=_0x48da8f?_0x4072c9[_0x7dc2('0x12')]:_0xc7df69[_0x7dc2('0xf')]+_0xc7df69[_0x7dc2('0x11')];var _0x1f8580;if(_0x55e544>=_0xc9d90f){_0x55e544=_0xc9d90f;_0x1f8580=0xc8;}else{_0x1f8580=0xce;}_0x3c3017['status'](_0x1f8580);return _0x3c3017[_0x7dc2('0x13')](_0x7dc2('0x14'),_0x46d2b6+'-'+_0x55e544+'/'+_0xc9d90f)[_0x7dc2('0xe')](_0x4072c9);}return null;};}function saveUpdates(_0x2ccbc3){return function(_0x2f1731){if(_0x2f1731){return _0x2f1731[_0x7dc2('0x15')](_0x2ccbc3)[_0x7dc2('0x16')](function(_0x189f03){return _0x189f03;});}return null;};}function removeEntity(_0x591839){return function(_0x5075fe){if(_0x5075fe){return _0x5075fe[_0x7dc2('0x17')]()[_0x7dc2('0x16')](function(){_0x591839[_0x7dc2('0xc')](0xcc)[_0x7dc2('0xd')]();});}};}function handleEntityNotFound(_0x5a0478){return function(_0x51c448){if(!_0x51c448){_0x5a0478[_0x7dc2('0x18')](0x194);}return _0x51c448;};}function handleError(_0x2ceed4,_0x43a113){_0x43a113=_0x43a113||0x1f4;return function(_0x4ef7c9){logger[_0x7dc2('0x19')](_0x4ef7c9['stack']);if(_0x4ef7c9[_0x7dc2('0x1a')]){delete _0x4ef7c9[_0x7dc2('0x1a')];}_0x2ceed4[_0x7dc2('0xc')](_0x43a113)[_0x7dc2('0x1b')](_0x4ef7c9);};}function maskClientSecret(_0x357de6){return _['padEnd'](_0x357de6[_0x7dc2('0x1c')](0x0,0x3),0x14,'*');}exports[_0x7dc2('0x1d')]=function(_0x4bdf77,_0x4809e8){var _0x2c3294={},_0x27703d={},_0x2d7b90={'count':0x0,'rows':[]};var _0x35c6a9=_[_0x7dc2('0x1e')](db[_0x7dc2('0x1f')][_0x7dc2('0x20')],function(_0x37d774){return{'name':_0x37d774['fieldName'],'type':_0x37d774[_0x7dc2('0x21')][_0x7dc2('0x22')]};});_0x27703d['model']=_[_0x7dc2('0x1e')](_0x35c6a9,_0x7dc2('0x1a'));_0x27703d[_0x7dc2('0x23')]=_[_0x7dc2('0x24')](_0x4bdf77['query']);_0x27703d[_0x7dc2('0x25')]=_['intersection'](_0x27703d[_0x7dc2('0x26')],_0x27703d[_0x7dc2('0x23')]);_0x2c3294[_0x7dc2('0x27')]=_[_0x7dc2('0x28')](_0x27703d[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x4bdf77[_0x7dc2('0x23')]['fields']));_0x2c3294[_0x7dc2('0x27')]=_0x2c3294[_0x7dc2('0x27')]['length']?_0x2c3294['attributes']:_0x27703d['model'];if(!_0x4bdf77[_0x7dc2('0x23')]['hasOwnProperty'](_0x7dc2('0x2a'))){_0x2c3294['limit']=qs[_0x7dc2('0x11')](_0x4bdf77[_0x7dc2('0x23')]['limit']);_0x2c3294[_0x7dc2('0xf')]=qs[_0x7dc2('0xf')](_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0xf')]);}_0x2c3294['order']=qs['sort'](_0x4bdf77['query']['sort']);_0x2c3294[_0x7dc2('0x2b')]=qs[_0x7dc2('0x25')](_['pick'](_0x4bdf77[_0x7dc2('0x23')],_0x27703d['filters']),_0x35c6a9);if(_0x4bdf77['query'][_0x7dc2('0x2c')]){_0x2c3294['where']=_[_0x7dc2('0x2d')](_0x2c3294[_0x7dc2('0x2b')],{'$or':_[_0x7dc2('0x1e')](_0x35c6a9,function(_0x5cf428){if(_0x5cf428[_0x7dc2('0x21')]!==_0x7dc2('0x2e')){var _0x533177={};_0x533177[_0x5cf428[_0x7dc2('0x1a')]]={'$like':'%'+_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x2c')]+'%'};return _0x533177;}})});}_0x2c3294=_['merge']({},_0x2c3294,_0x4bdf77[_0x7dc2('0x2f')]);var _0x411125={'where':_0x2c3294[_0x7dc2('0x2b')]};return db[_0x7dc2('0x1f')][_0x7dc2('0x12')](_0x411125)[_0x7dc2('0x16')](function(_0x49d9b9){_0x2d7b90[_0x7dc2('0x12')]=_0x49d9b9;if(_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x30')]){_0x2c3294['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x2c3294);})[_0x7dc2('0x16')](function(_0x1498f6){_0x2d7b90[_0x7dc2('0x31')]=_[_0x7dc2('0x1e')](_0x1498f6,function(_0xda1e8e){if(_0xda1e8e['service']===_0x7dc2('0x32')){var _0xcb1ee1=encryptor['decryptString'](_0xda1e8e['data3']);_0xda1e8e[_0x7dc2('0x33')]=maskClientSecret(_0xcb1ee1);}return _0xda1e8e;});return _0x2d7b90;})[_0x7dc2('0x16')](respondWithFilteredResult(_0x4809e8,_0x2c3294))['catch'](handleError(_0x4809e8,null));};exports[_0x7dc2('0x34')]=function(_0x5ebdb4,_0x3628c7){var _0x4d0ed3={'raw':!![],'where':{'id':_0x5ebdb4['params']['id']}},_0x1f8b88={};_0x1f8b88['model']=_[_0x7dc2('0x24')](db['CloudProvider']['rawAttributes']);_0x1f8b88[_0x7dc2('0x23')]=_['keys'](_0x5ebdb4[_0x7dc2('0x23')]);_0x1f8b88['filters']=_[_0x7dc2('0x28')](_0x1f8b88[_0x7dc2('0x26')],_0x1f8b88[_0x7dc2('0x23')]);_0x4d0ed3[_0x7dc2('0x27')]=_['intersection'](_0x1f8b88[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x5ebdb4[_0x7dc2('0x23')][_0x7dc2('0x29')]));_0x4d0ed3['attributes']=_0x4d0ed3[_0x7dc2('0x27')]['length']?_0x4d0ed3[_0x7dc2('0x27')]:_0x1f8b88['model'];if(_0x5ebdb4['query'][_0x7dc2('0x30')]){_0x4d0ed3[_0x7dc2('0x35')]=[{'all':!![]}];}_0x4d0ed3=_[_0x7dc2('0x2d')]({},_0x4d0ed3,_0x5ebdb4[_0x7dc2('0x2f')]);return db[_0x7dc2('0x1f')]['find'](_0x4d0ed3)[_0x7dc2('0x16')](handleEntityNotFound(_0x3628c7,null))['then'](function(_0x4e1a00){if(_0x4e1a00[_0x7dc2('0x36')]===_0x7dc2('0x32')){var _0x59b8ab=encryptor['decryptString'](_0x4e1a00[_0x7dc2('0x33')]);_0x4e1a00[_0x7dc2('0x33')]=maskClientSecret(_0x59b8ab);}return _0x4e1a00;})[_0x7dc2('0x16')](respondWithResult(_0x3628c7,null))[_0x7dc2('0x37')](handleError(_0x3628c7,null));};exports[_0x7dc2('0x38')]=function(_0x1a49e5,_0x49bcfc){if(!_0x1a49e5['body'][_0x7dc2('0x1a')])throw new Error(_0x7dc2('0x39'));if(!_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5903e4=db[_0x7dc2('0x1f')][_0x7dc2('0x20')][_0x7dc2('0x36')][_0x7dc2('0x3b')];if(!_0x5903e4[_0x7dc2('0x3c')](_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]))throw new Error(_0x7dc2('0x3d')+_0x5903e4[_0x7dc2('0x3e')](',\x20'));if(_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]===_0x7dc2('0x32')&&_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1a49e5[_0x7dc2('0x3a')]['data3']);}return db[_0x7dc2('0x1f')][_0x7dc2('0x38')](_0x1a49e5[_0x7dc2('0x3a')],{})['then'](respondWithResult(_0x49bcfc,0xc9))['catch'](handleError(_0x49bcfc,null));};exports['update']=function(_0x1f2159,_0x505282){if(_0x1f2159['body']['id']){delete _0x1f2159[_0x7dc2('0x3a')]['id'];}return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x1f2159[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x505282,null))[_0x7dc2('0x16')](function(_0x22e619){if(_0x22e619[_0x7dc2('0x36')]==='MicrosoftAzure'&&_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1f2159[_0x7dc2('0x3a')]['data3']);}return _0x22e619;})[_0x7dc2('0x16')](saveUpdates(_0x1f2159[_0x7dc2('0x3a')],null))['then'](respondWithResult(_0x505282,null))['catch'](handleError(_0x505282,null));};exports[_0x7dc2('0x17')]=function(_0x181e7d,_0x415913){return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x181e7d[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x415913,null))['then'](removeEntity(_0x415913,null))[_0x7dc2('0x37')](handleError(_0x415913,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2e360e,_0x3ff018){return db[_0x7dc2('0x1f')][_0x7dc2('0x42')]({'where':{'id':_0x2e360e[_0x7dc2('0x41')]['id']},'raw':!![]})[_0x7dc2('0x16')](function(_0x32a48a){if(!_0x32a48a)return _0x3ff018['sendStatus'](0x194);return{'url':oauth[_0x7dc2('0x43')](_0x32a48a,_0x2e360e['user']['id'])};})['then'](respondWithResult(_0x3ff018,null))[_0x7dc2('0x37')](handleError(_0x3ff018,null));};exports['oauth2MicrosoftCallback']=function(_0x3c8fa8,_0x4998b4){var _0x389826=_0x3c8fa8[_0x7dc2('0x3a')];var _0x2311db;var _0x5ba59b;if(_0x389826[_0x7dc2('0x19')])throw _0x389826;redis[_0x7dc2('0x44')](_0x389826['state'])[_0x7dc2('0x16')](function(_0x1a060e){if(!_0x1a060e)throw new Error(_0x7dc2('0x45'));_0x2311db=JSON['parse'](_0x1a060e);var _0x932c35=Buffer[_0x7dc2('0x46')](_0x389826[_0x7dc2('0x47')],_0x7dc2('0x48'))[_0x7dc2('0x49')]('ascii');_0x5ba59b=JSON[_0x7dc2('0x4a')](_0x932c35);if(!oauth[_0x7dc2('0x4b')](_0x389826[_0x7dc2('0x4c')],_0x2311db[_0x7dc2('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x389826['state']);return oauth[_0x7dc2('0x4e')](_0x389826[_0x7dc2('0x4f')],_0x2311db);})['then'](function(_0x329803){_0x2311db[_0x7dc2('0x50')]=_0x329803[_0x7dc2('0x51')];_0x2311db[_0x7dc2('0x52')]=_0x329803[_0x7dc2('0x53')];return db[_0x7dc2('0x1f')][_0x7dc2('0x15')]({'data5':_0x2311db[_0x7dc2('0x50')],'data6':_0x2311db[_0x7dc2('0x52')]},{'where':{'id':_0x2311db['id']}});})[_0x7dc2('0x16')](function(){oauth[_0x7dc2('0x54')](_0x2311db);socket[_0x7dc2('0x55')](_0x7dc2('0x56'),{'id':_0x5ba59b['id']});return;})[_0x7dc2('0x16')](respondWithStatusCode(_0x4998b4,null))[_0x7dc2('0x37')](function(_0x57d050){if(_0x5ba59b){socket[_0x7dc2('0x55')](_0x7dc2('0x57'),{'id':_0x5ba59b['id']});}if(!_0x2311db){logger[_0x7dc2('0x19')](_0x7dc2('0x58'),_0x57d050);return _0x4998b4['status'](0x1f4)[_0x7dc2('0x1b')](_0x57d050['message']);}logger[_0x7dc2('0x19')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x2311db['id'],JSON[_0x7dc2('0x59')](_0x57d050));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 4b5628d..a6d5e7e 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 _0x2cd9=['moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x5430e3,_0x2a5302){var _0x9b1f0c=function(_0x100a5a){while(--_0x100a5a){_0x5430e3['push'](_0x5430e3['shift']());}};_0x9b1f0c(++_0x2a5302);}(_0x2cd9,0xd8));var _0x92cd=function(_0x446f12,_0x259fb6){_0x446f12=_0x446f12-0x0;var _0xeb88bd=_0x2cd9[_0x446f12];return _0xeb88bd;};'use strict';var _=require(_0x92cd('0x0'));var util=require(_0x92cd('0x1'));var logger=require(_0x92cd('0x2'))(_0x92cd('0x3'));var moment=require(_0x92cd('0x4'));var BPromise=require('bluebird');var rp=require(_0x92cd('0x5'));var fs=require('fs');var path=require(_0x92cd('0x6'));var rimraf=require(_0x92cd('0x7'));var config=require(_0x92cd('0x8'));var attributes=require(_0x92cd('0x9'));module[_0x92cd('0xa')]=function(_0x45470a,_0x15b3c6){return _0x45470a['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa061=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','util','../../config/logger','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa061,0x194));var _0x1a06=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0xa061[_0x1e8f35];return _0x446c13;};'use strict';var _=require('lodash');var util=require(_0x1a06('0x0'));var logger=require(_0x1a06('0x1'))(_0x1a06('0x2'));var moment=require(_0x1a06('0x3'));var BPromise=require(_0x1a06('0x4'));var rp=require(_0x1a06('0x5'));var fs=require('fs');var path=require(_0x1a06('0x6'));var rimraf=require(_0x1a06('0x7'));var config=require(_0x1a06('0x8'));var attributes=require(_0x1a06('0x9'));module['exports']=function(_0x6cd83c,_0xe07b0){return _0x6cd83c[_0x1a06('0xa')](_0x1a06('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 213aa28..75de99b 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 _0x320f=['nonce','login','oauth2Claims','oauth2/','set','stringify','decode','payload','iss','issuer','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','POST','{TENANT_ID}','access_token','refresh_token','update','data5','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','map','type','Dynamics365','push','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','from','base64','randomBytes','toString','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state'];(function(_0x5d7b60,_0x22ba91){var _0x477343=function(_0x23382f){while(--_0x23382f){_0x5d7b60['push'](_0x5d7b60['shift']());}};_0x477343(++_0x22ba91);}(_0x320f,0xbb));var _0xf320=function(_0x23a0f4,_0x3b89d6){_0x23a0f4=_0x23a0f4-0x0;var _0x3c8691=_0x320f[_0x23a0f4];return _0x3c8691;};'use strict';var _=require('lodash');var crypto=require(_0xf320('0x0'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xf320('0x1'));var util=require(_0xf320('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xf320('0x3'))(_0xf320('0x4'));var schedule=require(_0xf320('0x5'));var db=require(_0xf320('0x6'))['db'];config[_0xf320('0x7')]=_[_0xf320('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xf320('0x7')]);var MICROSOFT_AUTH_URL=_0xf320('0x9');var AZURE_AUTH_SCOPES={'Outlook365':[_0xf320('0xa'),_0xf320('0xb'),_0xf320('0xc'),_0xf320('0xd'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xf320('0xe')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5797c3){var _0x513eb4=_[_0xf320('0xf')](AZURE_AUTH_SCOPES[_0x5797c3[_0xf320('0x10')]]);if(_0x5797c3[_0xf320('0x10')]===_0xf320('0x11'))_0x513eb4[_0xf320('0x12')](_0x5797c3[_0xf320('0x13')]+_0xf320('0x14'));return _0x513eb4['join']('\x20');}function getAccessTokenScope(_0x3a9e19){if(_0x3a9e19[_0xf320('0x10')]===_0xf320('0x15'))return _0xf320('0x16');if(_0x3a9e19[_0xf320('0x10')]===_0xf320('0x11'))return _0x3a9e19['data7']+_0xf320('0x14');}function generateMicrosoftAuthorizationUrl(_0xb5753,_0x382c50){var _0x2a8db9=MICROSOFT_AUTH_URL[_0xf320('0x17')]('{TENANT_ID}',_0xb5753[_0xf320('0x18')]);var _0x1f4089=['code','id_token'];var _0x130063=Buffer[_0xf320('0x19')](JSON['stringify']({'id':_0x382c50}))['toString'](_0xf320('0x1a'));var _0x3118b1=crypto[_0xf320('0x1b')](0x10)[_0xf320('0x1c')]('hex');var _0x5b2813=getAuthorizationScopes(_0xb5753);var _0x526340=[{'key':_0xf320('0x1d'),'value':_0xb5753[_0xf320('0x1e')]},{'key':_0xf320('0x1f'),'value':encodeURIComponent(_0x1f4089['join']('\x20'))},{'key':_0xf320('0x20'),'value':_0xb5753[_0xf320('0x21')]},{'key':_0xf320('0x22'),'value':_0xf320('0x23')},{'key':_0xf320('0x24'),'value':encodeURIComponent(_0x5b2813)},{'key':_0xf320('0x25'),'value':_0x130063},{'key':_0xf320('0x26'),'value':_0x3118b1},{'key':'prompt','value':_0xf320('0x27')}];var _0x1e5dee=_0x2a8db9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xf320('0xf')](_0x526340,function(_0x17cf00){return _0x17cf00['key']+'='+_0x17cf00['value'];})['join']('&');_0xb5753[_0xf320('0x28')]={'issuer':_0x2a8db9[_0xf320('0x17')](_0xf320('0x29'),''),'audience':_0xb5753[_0xf320('0x1e')],'state':_0x130063,'nonce':_0x3118b1};redis[_0xf320('0x2a')](_0x130063,JSON[_0xf320('0x2b')](_0xb5753));return _0x1e5dee;}function isValidIdToken(_0x5e56c5,_0xa9b966){try{var _0xd83955=jwt[_0xf320('0x2c')](_0x5e56c5,{'complete':!![]});var _0x513d41=_0xd83955[_0xf320('0x2d')];if(_0x513d41[_0xf320('0x2e')]!==_0xa9b966[_0xf320('0x2f')])return![];if(_0x513d41['aud']!==_0xa9b966[_0xf320('0x30')])return![];if(_0x513d41['nonce']!==_0xa9b966['nonce'])return![];if(moment()[_0xf320('0x31')](moment[_0xf320('0x32')](_0x513d41[_0xf320('0x33')])))return![];return!![];}catch(_0x51b8d5){throw _0x51b8d5;}}function refreshOauth2MicrosoftAccessToken(_0xf3360d){return Promise[_0xf320('0x34')]()[_0xf320('0x35')](function(){if(_0xf3360d[_0xf320('0x36')])return _0xf3360d;return db[_0xf320('0x37')][_0xf320('0x38')]({'where':{'id':_0xf3360d['id']},'raw':!![]});})[_0xf320('0x35')](function(_0xbf5a67){var _0x52a85b={'grant_type':'refresh_token','refresh_token':_0xbf5a67[_0xf320('0x39')],'scope':getAccessTokenScope(_0xbf5a67),'redirect_uri':_0xbf5a67['data4'],'client_id':_0xbf5a67['data1'],'client_secret':encryptor['decryptString'](_0xbf5a67[_0xf320('0x36')])};var _0x5efb35={'method':_0xf320('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf320('0x17')](_0xf320('0x3b'),_0xbf5a67[_0xf320('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x52a85b,'json':!![]};return rp(_0x5efb35);})[_0xf320('0x35')](function(_0xffb4fb){_0xf3360d['data5']=_0xffb4fb[_0xf320('0x3c')];_0xf3360d[_0xf320('0x39')]=_0xffb4fb[_0xf320('0x3d')];return db[_0xf320('0x37')][_0xf320('0x3e')]({'data5':_0xf3360d[_0xf320('0x3f')],'data6':_0xf3360d['data6']},{'where':{'id':_0xf3360d['id']}});})[_0xf320('0x35')](function(){return _0xf3360d;})[_0xf320('0x40')](function(_0x6bb002){logger['error'](_0xf320('0x41'),_0xf3360d['id'],_0x6bb002);});}function getOauth2MicrosoftAccessToken(_0x344cfc,_0x3d169f){var _0x3c58cd={'grant_type':_0xf320('0x42'),'code':_0x344cfc,'scope':getAccessTokenScope(_0x3d169f),'redirect_uri':_0x3d169f[_0xf320('0x21')],'client_id':_0x3d169f[_0xf320('0x1e')],'client_secret':encryptor[_0xf320('0x43')](_0x3d169f['data3'])};var _0x573519={'method':_0xf320('0x3a'),'uri':MICROSOFT_AUTH_URL[_0xf320('0x17')](_0xf320('0x3b'),_0x3d169f[_0xf320('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3c58cd,'json':!![]};return rp(_0x573519);}function startRefreshInterval(_0x16b25c){var _0x5191bd=schedule[_0xf320('0x44')];if(_0x5191bd[_0x16b25c['id']])clearInterval(_0x5191bd[_0x16b25c['id']]);_0x5191bd[_0x16b25c['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xf320('0x45')](this,{'id':_0x16b25c['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xf320('0x44')]=_0x5191bd;}function startAllRefreshIntervals(){return db[_0xf320('0x37')][_0xf320('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xf320('0x35')](function(_0x244636){var _0x5c2b40=_0x244636[_0xf320('0xf')](function(_0x4052cc){return refreshOauth2MicrosoftAccessToken(_0x4052cc)[_0xf320('0x35')](function(_0x1720f6){startRefreshInterval(_0x1720f6);});});return Promise['all'](_0x5c2b40);})['catch'](function(_0x5a744c){var _0x28df0f=_0x5a744c?util[_0xf320('0x47')](_0x5a744c,{'showHidden':![],'depth':null}):'';logger[_0xf320('0x48')](_0xf320('0x49'),_0x28df0f);});}module[_0xf320('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xf65b=['https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','code','id_token','from','toString','base64','randomBytes','hex','response_type','data4','form_post','scope','state','nonce','login','oauth2Claims','oauth2/','data1','set','stringify','payload','issuer','aud','audience','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','POST','{TENANT_ID}','data5','access_token','update','error','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join'];(function(_0x3d3c35,_0x4957eb){var _0x1ae732=function(_0x487c49){while(--_0x487c49){_0x3d3c35['push'](_0x3d3c35['shift']());}};_0x1ae732(++_0x4957eb);}(_0xf65b,0x78));var _0xbf65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf65b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbf65('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xbf65('0x1'));var Redis=require(_0xbf65('0x2'));var rp=require(_0xbf65('0x3'));var util=require('util');var encryptor=require(_0xbf65('0x4'));var config=require(_0xbf65('0x5'));var logger=require(_0xbf65('0x6'))('api');var schedule=require(_0xbf65('0x7'));var db=require(_0xbf65('0x8'))['db'];config[_0xbf65('0x9')]=_['defaults'](config[_0xbf65('0x9')],{'host':_0xbf65('0xa'),'port':0x18eb});var redis=new Redis(config[_0xbf65('0x9')]);var MICROSOFT_AUTH_URL=_0xbf65('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbf65('0xc'),_0xbf65('0xd'),_0xbf65('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xbf65('0xf'),_0xbf65('0x10')],'Dynamics365':[_0xbf65('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbf65('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xbf65('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3938bc){var _0x2ddf0d=_[_0xbf65('0x13')](AZURE_AUTH_SCOPES[_0x3938bc[_0xbf65('0x14')]]);if(_0x3938bc[_0xbf65('0x14')]===_0xbf65('0x15'))_0x2ddf0d[_0xbf65('0x16')](_0x3938bc[_0xbf65('0x17')]+_0xbf65('0x18'));return _0x2ddf0d[_0xbf65('0x19')]('\x20');}function getAccessTokenScope(_0x62780d){if(_0x62780d['type']==='Outlook365')return _0xbf65('0x1a');if(_0x62780d[_0xbf65('0x14')]==='Dynamics365')return _0x62780d[_0xbf65('0x17')]+_0xbf65('0x18');}function generateMicrosoftAuthorizationUrl(_0x4eeb47,_0xa03291){var _0x5c3441=MICROSOFT_AUTH_URL[_0xbf65('0x1b')]('{TENANT_ID}',_0x4eeb47[_0xbf65('0x1c')]);var _0x4b3a87=[_0xbf65('0x1d'),_0xbf65('0x1e')];var _0x3146e7=Buffer[_0xbf65('0x1f')](JSON['stringify']({'id':_0xa03291}))[_0xbf65('0x20')](_0xbf65('0x21'));var _0x40f866=crypto[_0xbf65('0x22')](0x10)[_0xbf65('0x20')](_0xbf65('0x23'));var _0x3f8cc7=getAuthorizationScopes(_0x4eeb47);var _0x32382f=[{'key':'client_id','value':_0x4eeb47['data1']},{'key':_0xbf65('0x24'),'value':encodeURIComponent(_0x4b3a87[_0xbf65('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x4eeb47[_0xbf65('0x25')]},{'key':'response_mode','value':_0xbf65('0x26')},{'key':_0xbf65('0x27'),'value':encodeURIComponent(_0x3f8cc7)},{'key':_0xbf65('0x28'),'value':_0x3146e7},{'key':_0xbf65('0x29'),'value':_0x40f866},{'key':'prompt','value':_0xbf65('0x2a')}];var _0x247cca=_0x5c3441+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbf65('0x13')](_0x32382f,function(_0x15e705){return _0x15e705['key']+'='+_0x15e705['value'];})['join']('&');_0x4eeb47[_0xbf65('0x2b')]={'issuer':_0x5c3441[_0xbf65('0x1b')](_0xbf65('0x2c'),''),'audience':_0x4eeb47[_0xbf65('0x2d')],'state':_0x3146e7,'nonce':_0x40f866};redis[_0xbf65('0x2e')](_0x3146e7,JSON[_0xbf65('0x2f')](_0x4eeb47));return _0x247cca;}function isValidIdToken(_0x48177c,_0x5da0d5){try{var _0x5e05b9=jwt['decode'](_0x48177c,{'complete':!![]});var _0x3847bf=_0x5e05b9[_0xbf65('0x30')];if(_0x3847bf['iss']!==_0x5da0d5[_0xbf65('0x31')])return![];if(_0x3847bf[_0xbf65('0x32')]!==_0x5da0d5[_0xbf65('0x33')])return![];if(_0x3847bf[_0xbf65('0x29')]!==_0x5da0d5['nonce'])return![];if(moment()['isAfter'](moment[_0xbf65('0x34')](_0x3847bf[_0xbf65('0x35')])))return![];return!![];}catch(_0x1d2aed){throw _0x1d2aed;}}function refreshOauth2MicrosoftAccessToken(_0x52a09c){return Promise['resolve']()[_0xbf65('0x36')](function(){if(_0x52a09c[_0xbf65('0x37')])return _0x52a09c;return db[_0xbf65('0x38')][_0xbf65('0x39')]({'where':{'id':_0x52a09c['id']},'raw':!![]});})['then'](function(_0x35ab4d){var _0x1f958a={'grant_type':_0xbf65('0x3a'),'refresh_token':_0x35ab4d[_0xbf65('0x3b')],'scope':getAccessTokenScope(_0x35ab4d),'redirect_uri':_0x35ab4d[_0xbf65('0x25')],'client_id':_0x35ab4d[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x35ab4d[_0xbf65('0x37')])};var _0x46d0d6={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x35ab4d['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f958a,'json':!![]};return rp(_0x46d0d6);})['then'](function(_0xef712a){_0x52a09c[_0xbf65('0x3e')]=_0xef712a[_0xbf65('0x3f')];_0x52a09c[_0xbf65('0x3b')]=_0xef712a[_0xbf65('0x3a')];return db[_0xbf65('0x38')][_0xbf65('0x40')]({'data5':_0x52a09c[_0xbf65('0x3e')],'data6':_0x52a09c['data6']},{'where':{'id':_0x52a09c['id']}});})['then'](function(){return _0x52a09c;})['catch'](function(_0x2ecd4e){logger[_0xbf65('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x52a09c['id'],_0x2ecd4e);});}function getOauth2MicrosoftAccessToken(_0x99bc59,_0x4abf68){var _0x4d712d={'grant_type':'authorization_code','code':_0x99bc59,'scope':getAccessTokenScope(_0x4abf68),'redirect_uri':_0x4abf68[_0xbf65('0x25')],'client_id':_0x4abf68[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x4abf68['data3'])};var _0x577871={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x4abf68[_0xbf65('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d712d,'json':!![]};return rp(_0x577871);}function startRefreshInterval(_0x2941be){var _0x3f01eb=schedule[_0xbf65('0x42')];if(_0x3f01eb[_0x2941be['id']])clearInterval(_0x3f01eb[_0x2941be['id']]);_0x3f01eb[_0x2941be['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbf65('0x43')](this,{'id':_0x2941be['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3f01eb;}function startAllRefreshIntervals(){return db[_0xbf65('0x38')][_0xbf65('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xae8d45){var _0x4ffaf0=_0xae8d45['map'](function(_0x4351a8){return refreshOauth2MicrosoftAccessToken(_0x4351a8)[_0xbf65('0x36')](function(_0x1f3126){startRefreshInterval(_0x1f3126);});});return Promise[_0xbf65('0x45')](_0x4ffaf0);})['catch'](function(_0x22625b){var _0x47a76f=_0x22625b?util[_0xbf65('0x46')](_0x22625b,{'showHidden':![],'depth':null}):'';logger[_0xbf65('0x41')](_0xbf65('0x47'),_0x47a76f);});}module[_0xbf65('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 7ba21c2..1c5966d 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 _0x9e63=['../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x9e63,0x65));var _0x39e6=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x9e63[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var moment=require(_0x39e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e6('0x3'));var fs=require('fs');var Redis=require(_0x39e6('0x4'));var db=require(_0x39e6('0x5'))['db'];var utils=require(_0x39e6('0x6'));var logger=require(_0x39e6('0x7'))(_0x39e6('0x8'));var config=require(_0x39e6('0x9'));var jayson=require(_0x39e6('0xa'));var client=jayson['client'][_0x39e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c2224,_0x3f2fa2,_0x554392){return new BPromise(function(_0x21938f,_0xddc291){return client['request'](_0x3c2224,_0x554392)[_0x39e6('0xc')](function(_0x4ee158){logger['info'](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));logger[_0x39e6('0xf')](_0x39e6('0x10'),_0x3f2fa2,_0x39e6('0xe'),JSON['stringify'](_0x4ee158));if(_0x4ee158['error']){if(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x12')]===0x1f4){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158[_0x39e6('0x11')]['message']);return _0xddc291(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158['error']['message']);return _0x21938f(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}else{logger[_0x39e6('0x14')](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));_0x21938f(_0x4ee158['result'][_0x39e6('0x13')]);}})[_0x39e6('0x15')](function(_0x32ad13){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x32ad13);_0xddc291(_0x32ad13);});});} \ No newline at end of file +var _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd05a,0x143));var _0xad05=function(_0x4433f9,_0xa9dd70){_0x4433f9=_0x4433f9-0x0;var _0x1bc092=_0xd05a[_0x4433f9];return _0x1bc092;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 11bac21..3885a40 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x427cb6,_0x55b1af){var _0x30472e=function(_0x411958){while(--_0x411958){_0x427cb6['push'](_0x427cb6['shift']());}};_0x30472e(++_0x55b1af);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x3c03e6,_0x2a7f15){_0x3c03e6=_0x3c03e6-0x0;var _0xf6c0e7=_0x7a54[_0x3c03e6];return _0xf6c0e7;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 54afeb5..9ae73f9 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 _0xc2b0=['STRING','sequelize','name'];(function(_0x5822c6,_0x11d122){var _0x330d31=function(_0x223289){while(--_0x223289){_0x5822c6['push'](_0x5822c6['shift']());}};_0x330d31(++_0x11d122);}(_0xc2b0,0x13c));var _0x0c2b=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0xc2b0[_0x134192];return _0x3cd080;};'use strict';var Sequelize=require(_0x0c2b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0c2b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0c2b('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x0c2b('0x2')]},'phone':{'type':Sequelize[_0x0c2b('0x2')]},'fax':{'type':Sequelize[_0x0c2b('0x2')]},'type':{'type':Sequelize[_0x0c2b('0x2')]},'street':{'type':Sequelize[_0x0c2b('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0c2b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0c2b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x0c2b('0x2')]},'sPostalCode':{'type':Sequelize[_0x0c2b('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x0c2b('0x2')]},'description':{'type':Sequelize[_0x0c2b('0x2')]}}; \ No newline at end of file +var _0x47b4=['STRING','name','sequelize'];(function(_0x47c88e,_0x404a49){var _0x301c8c=function(_0x4abf34){while(--_0x4abf34){_0x47c88e['push'](_0x47c88e['shift']());}};_0x301c8c(++_0x404a49);}(_0x47b4,0x1e2));var _0x447b=function(_0x22f215,_0x1e877c){_0x22f215=_0x22f215-0x0;var _0x3971a5=_0x47b4[_0x22f215];return _0x3971a5;};'use strict';var Sequelize=require(_0x447b('0x0'));module['exports']={'name':{'type':Sequelize[_0x447b('0x1')],'unique':_0x447b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x447b('0x1')]},'website':{'type':Sequelize[_0x447b('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x447b('0x1')]},'type':{'type':Sequelize[_0x447b('0x1')]},'street':{'type':Sequelize[_0x447b('0x1')]},'postalCode':{'type':Sequelize[_0x447b('0x1')]},'city':{'type':Sequelize[_0x447b('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x447b('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x447b('0x1')]},'sCity':{'type':Sequelize[_0x447b('0x1')]},'sCountry':{'type':Sequelize[_0x447b('0x1')]},'description':{'type':Sequelize[_0x447b('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 04bb2fe..2ba454f 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 _0x7ca0=['then','destroy','Companies','error','name','send','index','CmCompany','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','describe','addContacts','CmContact','ids','omit','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x7ca0,0x18d));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07ca('0x0'));var zipdir=require(_0x07ca('0x1'));var jsonpatch=require(_0x07ca('0x2'));var rp=require(_0x07ca('0x3'));var moment=require(_0x07ca('0x4'));var BPromise=require(_0x07ca('0x5'));var Mustache=require('mustache');var util=require(_0x07ca('0x6'));var path=require(_0x07ca('0x7'));var sox=require(_0x07ca('0x8'));var csv=require(_0x07ca('0x9'));var ejs=require(_0x07ca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x07ca('0xb'));var squel=require(_0x07ca('0xc'));var crypto=require(_0x07ca('0xd'));var jsforce=require(_0x07ca('0xe'));var deskjs=require(_0x07ca('0xf'));var toCsv=require('to-csv');var querystring=require(_0x07ca('0x10'));var Papa=require(_0x07ca('0x11'));var Redis=require(_0x07ca('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x07ca('0x13'));var as=require(_0x07ca('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x07ca('0x15'));var utils=require(_0x07ca('0x16'));var config=require(_0x07ca('0x17'));var licenseUtil=require(_0x07ca('0x18'));var db=require(_0x07ca('0x19'))['db'];function respondWithStatusCode(_0x1c8928,_0x328652){_0x328652=_0x328652||0xcc;return function(_0x571746){if(_0x571746){return _0x1c8928['sendStatus'](_0x328652);}return _0x1c8928['status'](_0x328652)[_0x07ca('0x1a')]();};}function respondWithResult(_0x5b4768,_0x5b607f){_0x5b607f=_0x5b607f||0xc8;return function(_0x1c2311){if(_0x1c2311){return _0x5b4768[_0x07ca('0x1b')](_0x5b607f)[_0x07ca('0x1c')](_0x1c2311);}};}function respondWithFilteredResult(_0x362486,_0x1a6149){return function(_0x5acb7b){if(_0x5acb7b){var _0x35d737=typeof _0x1a6149[_0x07ca('0x1d')]===_0x07ca('0x1e')&&typeof _0x1a6149[_0x07ca('0x1f')]===_0x07ca('0x1e');var _0x50e0fa=_0x5acb7b[_0x07ca('0x20')];var _0x57c9c3=_0x35d737?0x0:_0x1a6149['offset'];var _0x5bab6e=_0x35d737?_0x5acb7b[_0x07ca('0x20')]:_0x1a6149[_0x07ca('0x1d')]+_0x1a6149[_0x07ca('0x1f')];var _0x3afd5a;if(_0x5bab6e>=_0x50e0fa){_0x5bab6e=_0x50e0fa;_0x3afd5a=0xc8;}else{_0x3afd5a=0xce;}_0x362486['status'](_0x3afd5a);return _0x362486[_0x07ca('0x21')](_0x07ca('0x22'),_0x57c9c3+'-'+_0x5bab6e+'/'+_0x50e0fa)[_0x07ca('0x1c')](_0x5acb7b);}return null;};}function patchUpdates(_0x22a512){return function(_0x126203){try{jsonpatch[_0x07ca('0x23')](_0x126203,_0x22a512,!![]);}catch(_0x3acf56){return BPromise[_0x07ca('0x24')](_0x3acf56);}return _0x126203['save']();};}function saveUpdates(_0x5a84df,_0x54a48b){return function(_0x2a0013){if(_0x2a0013){return _0x2a0013[_0x07ca('0x25')](_0x5a84df)[_0x07ca('0x26')](function(_0x1e8330){return _0x1e8330;});}return null;};}function removeEntity(_0x3227bb,_0x498eba){return function(_0x3b1bf4){if(_0x3b1bf4){return _0x3b1bf4[_0x07ca('0x27')]()[_0x07ca('0x26')](function(){var _0x31a7cf=_0x3b1bf4['get']({'plain':!![]});var _0x288914=_0x07ca('0x28');return db['UserProfileResource'][_0x07ca('0x27')]({'where':{'type':_0x288914,'resourceId':_0x31a7cf['id']}})[_0x07ca('0x26')](function(){return _0x3b1bf4;});})[_0x07ca('0x26')](function(){_0x3227bb[_0x07ca('0x1b')](0xcc)[_0x07ca('0x1a')]();});}};}function handleEntityNotFound(_0x314ca4,_0xd31b6){return function(_0x44726a){if(!_0x44726a){_0x314ca4['sendStatus'](0x194);}return _0x44726a;};}function handleError(_0x3721f4,_0x5ef15b){_0x5ef15b=_0x5ef15b||0x1f4;return function(_0x395da3){logger[_0x07ca('0x29')](_0x395da3['stack']);if(_0x395da3['name']){delete _0x395da3[_0x07ca('0x2a')];}_0x3721f4[_0x07ca('0x1b')](_0x5ef15b)[_0x07ca('0x2b')](_0x395da3);};}exports[_0x07ca('0x2c')]=function(_0x4ca33c,_0xe47ced){var _0xe859b9={},_0x48f3f0={},_0x3caacd={'count':0x0,'rows':[]};return db[_0x07ca('0x2d')]['describe']()[_0x07ca('0x26')](function(_0xc94936){_0x48f3f0['model']=_['keys'](_0xc94936);_0x48f3f0[_0x07ca('0x2e')]=_['keys'](_0x4ca33c[_0x07ca('0x2e')]);_0x48f3f0[_0x07ca('0x2f')]=_['intersection'](_0x48f3f0[_0x07ca('0x30')],_0x48f3f0[_0x07ca('0x2e')]);_0xe859b9[_0x07ca('0x31')]=_[_0x07ca('0x32')](_0x48f3f0[_0x07ca('0x30')],qs['fields'](_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x33')]));_0xe859b9['attributes']=_0xe859b9['attributes'][_0x07ca('0x34')]?_0xe859b9[_0x07ca('0x31')]:_0x48f3f0[_0x07ca('0x30')];if(!_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x35')](_0x07ca('0x36'))){_0xe859b9[_0x07ca('0x1f')]=qs[_0x07ca('0x1f')](_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x1f')]);_0xe859b9[_0x07ca('0x1d')]=qs[_0x07ca('0x1d')](_0x4ca33c['query'][_0x07ca('0x1d')]);}_0xe859b9[_0x07ca('0x37')]=qs[_0x07ca('0x38')](_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x38')]);_0xe859b9[_0x07ca('0x39')]=qs[_0x07ca('0x2f')](_[_0x07ca('0x3a')](_0x4ca33c[_0x07ca('0x2e')],_0x48f3f0[_0x07ca('0x2f')]),_0xc94936);if(_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x3b')]){_0xe859b9[_0x07ca('0x39')]=_[_0x07ca('0x3c')](_0xe859b9[_0x07ca('0x39')],{'$or':_[_0x07ca('0x3d')](_0xe859b9[_0x07ca('0x31')],function(_0x43c922){var _0x2a0b5a={};_0x2a0b5a[_0x43c922]={'$like':'%'+_0x4ca33c[_0x07ca('0x2e')]['filter']+'%'};return _0x2a0b5a;})});}_0xe859b9=_[_0x07ca('0x3c')]({},_0xe859b9,_0x4ca33c[_0x07ca('0x3e')]);var _0x134331={'where':_0xe859b9['where']};return db[_0x07ca('0x2d')][_0x07ca('0x20')](_0x134331)[_0x07ca('0x26')](function(_0x254f63){_0x3caacd['count']=_0x254f63;if(_0x4ca33c[_0x07ca('0x2e')][_0x07ca('0x3f')]){_0xe859b9[_0x07ca('0x40')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0xe859b9);})[_0x07ca('0x26')](function(_0x5a5217){_0x3caacd[_0x07ca('0x41')]=_0x5a5217;return _0x3caacd;})[_0x07ca('0x26')](respondWithFilteredResult(_0xe47ced,_0xe859b9))[_0x07ca('0x42')](handleError(_0xe47ced,null));})[_0x07ca('0x42')](handleError(_0xe47ced,null));};exports[_0x07ca('0x43')]=function(_0x3e10f4,_0x191c29){var _0x2e90d6={'raw':![],'where':{'id':_0x3e10f4[_0x07ca('0x44')]['id']}},_0x3d7c34={};_0x3d7c34[_0x07ca('0x30')]=_[_0x07ca('0x45')](db['CmCompany'][_0x07ca('0x46')]);_0x3d7c34[_0x07ca('0x2e')]=_[_0x07ca('0x45')](_0x3e10f4[_0x07ca('0x2e')]);_0x3d7c34[_0x07ca('0x2f')]=_[_0x07ca('0x32')](_0x3d7c34[_0x07ca('0x30')],_0x3d7c34[_0x07ca('0x2e')]);_0x2e90d6['attributes']=_['intersection'](_0x3d7c34[_0x07ca('0x30')],qs[_0x07ca('0x33')](_0x3e10f4[_0x07ca('0x2e')][_0x07ca('0x33')]));_0x2e90d6[_0x07ca('0x31')]=_0x2e90d6['attributes'][_0x07ca('0x34')]?_0x2e90d6[_0x07ca('0x31')]:_0x3d7c34[_0x07ca('0x30')];if(_0x3e10f4['query']['includeAll']){_0x2e90d6[_0x07ca('0x40')]=[{'all':!![]}];}_0x2e90d6=_[_0x07ca('0x3c')]({},_0x2e90d6,_0x3e10f4[_0x07ca('0x3e')]);return db[_0x07ca('0x2d')][_0x07ca('0x47')](_0x2e90d6)[_0x07ca('0x26')](handleEntityNotFound(_0x191c29,null))[_0x07ca('0x26')](respondWithResult(_0x191c29,null))['catch'](handleError(_0x191c29,null));};exports[_0x07ca('0x48')]=function(_0x3f60d1,_0x1fccfa){return db[_0x07ca('0x2d')][_0x07ca('0x48')](_0x3f60d1[_0x07ca('0x49')],{})[_0x07ca('0x26')](function(_0x5de764){var _0x33b88c=_0x3f60d1[_0x07ca('0x4a')][_0x07ca('0x4b')]({'plain':!![]});if(!_0x33b88c)throw new Error(_0x07ca('0x4c'));if(_0x33b88c[_0x07ca('0x4d')]===_0x07ca('0x4a')){var _0xdb7cd0=_0x5de764[_0x07ca('0x4b')]({'plain':!![]});var _0xfc3128=_0x07ca('0x28');return db['UserProfileSection'][_0x07ca('0x47')]({'where':{'name':_0xfc3128,'userProfileId':_0x33b88c[_0x07ca('0x4e')]},'raw':!![]})[_0x07ca('0x26')](function(_0x5baecd){if(_0x5baecd&&_0x5baecd[_0x07ca('0x4f')]===0x0){return db[_0x07ca('0x50')][_0x07ca('0x48')]({'name':_0xdb7cd0['name'],'resourceId':_0xdb7cd0['id'],'type':_0x5baecd[_0x07ca('0x2a')],'sectionId':_0x5baecd['id']},{})['then'](function(){return _0x5de764;});}else{return _0x5de764;}})[_0x07ca('0x42')](function(_0x1a27f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a27f6);throw _0x1a27f6;});}return _0x5de764;})['then'](respondWithResult(_0x1fccfa,0xc9))[_0x07ca('0x42')](handleError(_0x1fccfa,null));};exports['update']=function(_0x106942,_0x4b2900){if(_0x106942['body']['id']){delete _0x106942[_0x07ca('0x49')]['id'];}return db[_0x07ca('0x2d')][_0x07ca('0x47')]({'where':{'id':_0x106942[_0x07ca('0x44')]['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x4b2900,null))[_0x07ca('0x26')](saveUpdates(_0x106942[_0x07ca('0x49')],null))[_0x07ca('0x26')](respondWithResult(_0x4b2900,null))[_0x07ca('0x42')](handleError(_0x4b2900,null));};exports[_0x07ca('0x27')]=function(_0x52111f,_0x4bc1a9){return db[_0x07ca('0x2d')][_0x07ca('0x47')]({'where':{'id':_0x52111f['params']['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x4bc1a9,null))['then'](removeEntity(_0x4bc1a9,null))[_0x07ca('0x42')](handleError(_0x4bc1a9,null));};exports[_0x07ca('0x51')]=function(_0x1729f0,_0x161de3){return db[_0x07ca('0x2d')]['describe']()[_0x07ca('0x26')](respondWithResult(_0x161de3,null))[_0x07ca('0x42')](handleError(_0x161de3,null));};exports[_0x07ca('0x52')]=function(_0x341840,_0x42e33d,_0x128772){return db[_0x07ca('0x53')][_0x07ca('0x47')]({'where':{'id':_0x341840[_0x07ca('0x44')]['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x42e33d,null))['then'](function(_0x1d5dc6){if(_0x1d5dc6){return _0x1d5dc6[_0x07ca('0x52')](_0x341840['body'][_0x07ca('0x54')],_[_0x07ca('0x55')](_0x341840['body'],[_0x07ca('0x54'),'id'])||{});}})[_0x07ca('0x26')](respondWithResult(_0x42e33d,null))['catch'](handleError(_0x42e33d,null));};exports['getContacts']=function(_0x497520,_0x3a8808,_0x40a5fc){var _0x457d77={};var _0x484909={};var _0x13f980;var _0x4e6678;return db['CmCompany']['findOne']({'where':{'id':_0x497520[_0x07ca('0x44')]['id']}})[_0x07ca('0x26')](handleEntityNotFound(_0x3a8808,null))[_0x07ca('0x26')](function(_0x6496e5){if(_0x6496e5){_0x13f980=_0x6496e5;_0x484909['model']=_[_0x07ca('0x45')](db[_0x07ca('0x53')][_0x07ca('0x46')]);_0x484909['query']=_[_0x07ca('0x45')](_0x497520[_0x07ca('0x2e')]);_0x484909['filters']=_[_0x07ca('0x32')](_0x484909['model'],_0x484909[_0x07ca('0x2e')]);_0x457d77[_0x07ca('0x31')]=_[_0x07ca('0x32')](_0x484909[_0x07ca('0x30')],qs[_0x07ca('0x33')](_0x497520[_0x07ca('0x2e')][_0x07ca('0x33')]));_0x457d77[_0x07ca('0x31')]=_0x457d77['attributes'][_0x07ca('0x34')]?_0x457d77[_0x07ca('0x31')]:_0x484909[_0x07ca('0x30')];_0x457d77['order']=qs[_0x07ca('0x38')](_0x497520['query'][_0x07ca('0x38')]);_0x457d77[_0x07ca('0x39')]=qs[_0x07ca('0x2f')](_[_0x07ca('0x3a')](_0x497520[_0x07ca('0x2e')],_0x484909[_0x07ca('0x2f')]));if(_0x497520[_0x07ca('0x2e')][_0x07ca('0x3b')]){_0x457d77[_0x07ca('0x39')]=_[_0x07ca('0x3c')](_0x457d77[_0x07ca('0x39')],{'$or':_[_0x07ca('0x3d')](_0x457d77[_0x07ca('0x31')],function(_0x2ad9f9){var _0x1e53c1={};_0x1e53c1[_0x2ad9f9]={'$like':'%'+_0x497520[_0x07ca('0x2e')]['filter']+'%'};return _0x1e53c1;})});}_0x457d77=_[_0x07ca('0x3c')]({},_0x457d77,_0x497520[_0x07ca('0x3e')]);return _0x13f980[_0x07ca('0x56')](_0x457d77);}})['then'](function(_0x4948ff){if(_0x4948ff){_0x4e6678=_0x4948ff[_0x07ca('0x34')];if(!_0x497520['query'][_0x07ca('0x35')](_0x07ca('0x36'))){_0x457d77[_0x07ca('0x1f')]=qs['limit'](_0x497520[_0x07ca('0x2e')][_0x07ca('0x1f')]);_0x457d77[_0x07ca('0x1d')]=qs['offset'](_0x497520[_0x07ca('0x2e')]['offset']);}return _0x13f980[_0x07ca('0x56')](_0x457d77);}})[_0x07ca('0x26')](function(_0x59cbed){if(_0x59cbed){return _0x59cbed?{'count':_0x4e6678,'rows':_0x59cbed}:null;}})[_0x07ca('0x26')](respondWithResult(_0x3a8808,null))[_0x07ca('0x42')](handleError(_0x3a8808,null));}; \ No newline at end of file +var _0xb835=['query','intersection','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Companies','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmCompany','model','keys'];(function(_0xabfe60,_0x2c61fe){var _0x3aa022=function(_0xcb4e81){while(--_0xcb4e81){_0xabfe60['push'](_0xabfe60['shift']());}};_0x3aa022(++_0x2c61fe);}(_0xb835,0xd3));var _0x5b83=function(_0x5bb1f2,_0x18a496){_0x5bb1f2=_0x5bb1f2-0x0;var _0xc894b5=_0xb835[_0x5bb1f2];return _0xc894b5;};'use strict';var emlformat=require(_0x5b83('0x0'));var rimraf=require(_0x5b83('0x1'));var zipdir=require(_0x5b83('0x2'));var jsonpatch=require(_0x5b83('0x3'));var rp=require('request-promise');var moment=require(_0x5b83('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b83('0x5'));var util=require(_0x5b83('0x6'));var path=require(_0x5b83('0x7'));var sox=require('sox');var csv=require(_0x5b83('0x8'));var ejs=require(_0x5b83('0x9'));var fs=require('fs');var fs_extra=require(_0x5b83('0xa'));var _=require(_0x5b83('0xb'));var squel=require(_0x5b83('0xc'));var crypto=require(_0x5b83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b83('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b83('0xf'));var Papa=require(_0x5b83('0x10'));var Redis=require(_0x5b83('0x11'));var authService=require(_0x5b83('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5b83('0x13'));var hardwareService=require(_0x5b83('0x14'));var logger=require('../../config/logger')(_0x5b83('0x15'));var utils=require(_0x5b83('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5b83('0x17'));var db=require(_0x5b83('0x18'))['db'];function respondWithStatusCode(_0x3fdbcc,_0x1405d0){_0x1405d0=_0x1405d0||0xcc;return function(_0x2832d9){if(_0x2832d9){return _0x3fdbcc['sendStatus'](_0x1405d0);}return _0x3fdbcc[_0x5b83('0x19')](_0x1405d0)['end']();};}function respondWithResult(_0x3a457e,_0x3ef26e){_0x3ef26e=_0x3ef26e||0xc8;return function(_0x15009c){if(_0x15009c){return _0x3a457e[_0x5b83('0x19')](_0x3ef26e)[_0x5b83('0x1a')](_0x15009c);}};}function respondWithFilteredResult(_0x425721,_0x16690f){return function(_0x5d3905){if(_0x5d3905){var _0x3bc03b=typeof _0x16690f[_0x5b83('0x1b')]==='undefined'&&typeof _0x16690f[_0x5b83('0x1c')]===_0x5b83('0x1d');var _0x4f71c5=_0x5d3905[_0x5b83('0x1e')];var _0x1fc455=_0x3bc03b?0x0:_0x16690f[_0x5b83('0x1b')];var _0x38d642=_0x3bc03b?_0x5d3905[_0x5b83('0x1e')]:_0x16690f[_0x5b83('0x1b')]+_0x16690f['limit'];var _0x2ffbe2;if(_0x38d642>=_0x4f71c5){_0x38d642=_0x4f71c5;_0x2ffbe2=0xc8;}else{_0x2ffbe2=0xce;}_0x425721['status'](_0x2ffbe2);return _0x425721[_0x5b83('0x1f')](_0x5b83('0x20'),_0x1fc455+'-'+_0x38d642+'/'+_0x4f71c5)['json'](_0x5d3905);}return null;};}function patchUpdates(_0x419ea9){return function(_0x404190){try{jsonpatch[_0x5b83('0x21')](_0x404190,_0x419ea9,!![]);}catch(_0x544920){return BPromise[_0x5b83('0x22')](_0x544920);}return _0x404190[_0x5b83('0x23')]();};}function saveUpdates(_0x208da5,_0x5b3214){return function(_0x20c599){if(_0x20c599){return _0x20c599[_0x5b83('0x24')](_0x208da5)[_0x5b83('0x25')](function(_0x2517e0){return _0x2517e0;});}return null;};}function removeEntity(_0x106c8d,_0x18fa83){return function(_0x5425f2){if(_0x5425f2){return _0x5425f2[_0x5b83('0x26')]()['then'](function(){var _0x247b01=_0x5425f2['get']({'plain':!![]});var _0x5c1f70='Companies';return db[_0x5b83('0x27')]['destroy']({'where':{'type':_0x5c1f70,'resourceId':_0x247b01['id']}})[_0x5b83('0x25')](function(){return _0x5425f2;});})[_0x5b83('0x25')](function(){_0x106c8d[_0x5b83('0x19')](0xcc)[_0x5b83('0x28')]();});}};}function handleEntityNotFound(_0x2123d2,_0x1049e2){return function(_0x366b91){if(!_0x366b91){_0x2123d2[_0x5b83('0x29')](0x194);}return _0x366b91;};}function handleError(_0x5c4ed0,_0x50d8bf){_0x50d8bf=_0x50d8bf||0x1f4;return function(_0xfb5327){logger[_0x5b83('0x2a')](_0xfb5327[_0x5b83('0x2b')]);if(_0xfb5327[_0x5b83('0x2c')]){delete _0xfb5327[_0x5b83('0x2c')];}_0x5c4ed0['status'](_0x50d8bf)[_0x5b83('0x2d')](_0xfb5327);};}exports[_0x5b83('0x2e')]=function(_0xadf965,_0x30beba){var _0x31ce6f={},_0x4d6c34={},_0x12623b={'count':0x0,'rows':[]};return db[_0x5b83('0x2f')]['describe']()[_0x5b83('0x25')](function(_0x22c5be){_0x4d6c34[_0x5b83('0x30')]=_[_0x5b83('0x31')](_0x22c5be);_0x4d6c34[_0x5b83('0x32')]=_[_0x5b83('0x31')](_0xadf965[_0x5b83('0x32')]);_0x4d6c34['filters']=_[_0x5b83('0x33')](_0x4d6c34[_0x5b83('0x30')],_0x4d6c34[_0x5b83('0x32')]);_0x31ce6f[_0x5b83('0x34')]=_[_0x5b83('0x33')](_0x4d6c34['model'],qs['fields'](_0xadf965[_0x5b83('0x32')]['fields']));_0x31ce6f[_0x5b83('0x34')]=_0x31ce6f[_0x5b83('0x34')]['length']?_0x31ce6f['attributes']:_0x4d6c34['model'];if(!_0xadf965[_0x5b83('0x32')][_0x5b83('0x35')](_0x5b83('0x36'))){_0x31ce6f[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1c')]);_0x31ce6f['offset']=qs[_0x5b83('0x1b')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1b')]);}_0x31ce6f['order']=qs[_0x5b83('0x37')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x37')]);_0x31ce6f['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0xadf965[_0x5b83('0x32')],_0x4d6c34[_0x5b83('0x38')]),_0x22c5be);if(_0xadf965[_0x5b83('0x32')][_0x5b83('0x3a')]){_0x31ce6f[_0x5b83('0x3b')]=_[_0x5b83('0x3c')](_0x31ce6f['where'],{'$or':_[_0x5b83('0x3d')](_0x31ce6f[_0x5b83('0x34')],function(_0x308ce6){var _0x1dd83d={};_0x1dd83d[_0x308ce6]={'$like':'%'+_0xadf965['query']['filter']+'%'};return _0x1dd83d;})});}_0x31ce6f=_[_0x5b83('0x3c')]({},_0x31ce6f,_0xadf965[_0x5b83('0x3e')]);var _0x592931={'where':_0x31ce6f['where']};return db[_0x5b83('0x2f')][_0x5b83('0x1e')](_0x592931)[_0x5b83('0x25')](function(_0x96b606){_0x12623b['count']=_0x96b606;if(_0xadf965['query'][_0x5b83('0x3f')]){_0x31ce6f[_0x5b83('0x40')]=[{'all':!![]}];}return db[_0x5b83('0x2f')]['findAll'](_0x31ce6f);})[_0x5b83('0x25')](function(_0x3d3591){_0x12623b[_0x5b83('0x41')]=_0x3d3591;return _0x12623b;})[_0x5b83('0x25')](respondWithFilteredResult(_0x30beba,_0x31ce6f))[_0x5b83('0x42')](handleError(_0x30beba,null));})[_0x5b83('0x42')](handleError(_0x30beba,null));};exports[_0x5b83('0x43')]=function(_0xec61fe,_0x5260bc){var _0x300311={'raw':![],'where':{'id':_0xec61fe[_0x5b83('0x44')]['id']}},_0x196ad1={};_0x196ad1[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x2f')][_0x5b83('0x45')]);_0x196ad1['query']=_[_0x5b83('0x31')](_0xec61fe[_0x5b83('0x32')]);_0x196ad1[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],_0x196ad1[_0x5b83('0x32')]);_0x300311['attributes']=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],qs['fields'](_0xec61fe['query'][_0x5b83('0x46')]));_0x300311[_0x5b83('0x34')]=_0x300311[_0x5b83('0x34')][_0x5b83('0x47')]?_0x300311[_0x5b83('0x34')]:_0x196ad1[_0x5b83('0x30')];if(_0xec61fe[_0x5b83('0x32')][_0x5b83('0x3f')]){_0x300311['include']=[{'all':!![]}];}_0x300311=_[_0x5b83('0x3c')]({},_0x300311,_0xec61fe[_0x5b83('0x3e')]);return db[_0x5b83('0x2f')][_0x5b83('0x48')](_0x300311)['then'](handleEntityNotFound(_0x5260bc,null))[_0x5b83('0x25')](respondWithResult(_0x5260bc,null))[_0x5b83('0x42')](handleError(_0x5260bc,null));};exports['create']=function(_0x277042,_0x465cf1){return db[_0x5b83('0x2f')][_0x5b83('0x49')](_0x277042[_0x5b83('0x4a')],{})[_0x5b83('0x25')](function(_0x72fdfc){var _0x41b23e=_0x277042[_0x5b83('0x4b')]['get']({'plain':!![]});if(!_0x41b23e)throw new Error(_0x5b83('0x4c'));if(_0x41b23e['role']===_0x5b83('0x4b')){var _0x1819e6=_0x72fdfc[_0x5b83('0x4d')]({'plain':!![]});var _0x2239c5=_0x5b83('0x4e');return db[_0x5b83('0x4f')]['find']({'where':{'name':_0x2239c5,'userProfileId':_0x41b23e['userProfileId']},'raw':!![]})[_0x5b83('0x25')](function(_0x53b65f){if(_0x53b65f&&_0x53b65f['autoAssociation']===0x0){return db[_0x5b83('0x27')][_0x5b83('0x49')]({'name':_0x1819e6[_0x5b83('0x2c')],'resourceId':_0x1819e6['id'],'type':_0x53b65f[_0x5b83('0x2c')],'sectionId':_0x53b65f['id']},{})[_0x5b83('0x25')](function(){return _0x72fdfc;});}else{return _0x72fdfc;}})[_0x5b83('0x42')](function(_0x20c6cb){logger['error'](_0x5b83('0x50'),_0x20c6cb);throw _0x20c6cb;});}return _0x72fdfc;})[_0x5b83('0x25')](respondWithResult(_0x465cf1,0xc9))['catch'](handleError(_0x465cf1,null));};exports['update']=function(_0x551269,_0x50a3ad){if(_0x551269[_0x5b83('0x4a')]['id']){delete _0x551269[_0x5b83('0x4a')]['id'];}return db[_0x5b83('0x2f')]['find']({'where':{'id':_0x551269[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x50a3ad,null))['then'](saveUpdates(_0x551269['body'],null))[_0x5b83('0x25')](respondWithResult(_0x50a3ad,null))[_0x5b83('0x42')](handleError(_0x50a3ad,null));};exports['destroy']=function(_0x4c49b5,_0x5d26d6){return db['CmCompany'][_0x5b83('0x48')]({'where':{'id':_0x4c49b5[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d26d6,null))[_0x5b83('0x25')](removeEntity(_0x5d26d6,null))[_0x5b83('0x42')](handleError(_0x5d26d6,null));};exports['describe']=function(_0x138b3c,_0x3d9be8){return db[_0x5b83('0x2f')][_0x5b83('0x51')]()[_0x5b83('0x25')](respondWithResult(_0x3d9be8,null))[_0x5b83('0x42')](handleError(_0x3d9be8,null));};exports[_0x5b83('0x52')]=function(_0x49851f,_0x3aaa97,_0x5e307f){return db[_0x5b83('0x53')][_0x5b83('0x48')]({'where':{'id':_0x49851f[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x3aaa97,null))[_0x5b83('0x25')](function(_0x42a687){if(_0x42a687){return _0x42a687[_0x5b83('0x52')](_0x49851f['body'][_0x5b83('0x54')],_['omit'](_0x49851f[_0x5b83('0x4a')],[_0x5b83('0x54'),'id'])||{});}})[_0x5b83('0x25')](respondWithResult(_0x3aaa97,null))['catch'](handleError(_0x3aaa97,null));};exports[_0x5b83('0x55')]=function(_0x509753,_0x4d6736,_0x5afaab){var _0x10ee37={};var _0x5437f2={};var _0x5a2873;var _0x47d28c;return db['CmCompany'][_0x5b83('0x56')]({'where':{'id':_0x509753[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x4d6736,null))[_0x5b83('0x25')](function(_0x55e5b7){if(_0x55e5b7){_0x5a2873=_0x55e5b7;_0x5437f2[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x53')]['rawAttributes']);_0x5437f2[_0x5b83('0x32')]=_['keys'](_0x509753[_0x5b83('0x32')]);_0x5437f2[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],_0x5437f2['query']);_0x10ee37['attributes']=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],qs['fields'](_0x509753[_0x5b83('0x32')]['fields']));_0x10ee37['attributes']=_0x10ee37[_0x5b83('0x34')][_0x5b83('0x47')]?_0x10ee37['attributes']:_0x5437f2[_0x5b83('0x30')];_0x10ee37['order']=qs[_0x5b83('0x37')](_0x509753[_0x5b83('0x32')][_0x5b83('0x37')]);_0x10ee37['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0x509753[_0x5b83('0x32')],_0x5437f2[_0x5b83('0x38')]));if(_0x509753['query'][_0x5b83('0x3a')]){_0x10ee37['where']=_[_0x5b83('0x3c')](_0x10ee37[_0x5b83('0x3b')],{'$or':_[_0x5b83('0x3d')](_0x10ee37['attributes'],function(_0x75c334){var _0x54381f={};_0x54381f[_0x75c334]={'$like':'%'+_0x509753[_0x5b83('0x32')][_0x5b83('0x3a')]+'%'};return _0x54381f;})});}_0x10ee37=_[_0x5b83('0x3c')]({},_0x10ee37,_0x509753['options']);return _0x5a2873[_0x5b83('0x55')](_0x10ee37);}})[_0x5b83('0x25')](function(_0x33d296){if(_0x33d296){_0x47d28c=_0x33d296[_0x5b83('0x47')];if(!_0x509753[_0x5b83('0x32')][_0x5b83('0x35')]('nolimit')){_0x10ee37[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0x509753['query'][_0x5b83('0x1c')]);_0x10ee37[_0x5b83('0x1b')]=qs[_0x5b83('0x1b')](_0x509753['query'][_0x5b83('0x1b')]);}return _0x5a2873['getContacts'](_0x10ee37);}})[_0x5b83('0x25')](function(_0x258dda){if(_0x258dda){return _0x258dda?{'count':_0x47d28c,'rows':_0x258dda}:null;}})[_0x5b83('0x25')](respondWithResult(_0x4d6736,null))[_0x5b83('0x42')](handleError(_0x4d6736,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 05e05fa..64f3016 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 _0x883c=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','cm_companies','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x883c,0x133));var _0xc883=function(_0x21c48a,_0x262750){_0x21c48a=_0x21c48a-0x0;var _0x7b019=_0x883c[_0x21c48a];return _0x7b019;};'use strict';var _=require(_0xc883('0x0'));var util=require(_0xc883('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc883('0x2'));var BPromise=require(_0xc883('0x3'));var rp=require(_0xc883('0x4'));var fs=require('fs');var path=require(_0xc883('0x5'));var rimraf=require(_0xc883('0x6'));var config=require(_0xc883('0x7'));var attributes=require(_0xc883('0x8'));module[_0xc883('0x9')]=function(_0xa959e3,_0x8e327e){return _0xa959e3['define']('CmCompany',attributes,{'tableName':_0xc883('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6c6=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0xd94707,_0x3cacec){var _0x273bf8=function(_0x2b36d8){while(--_0x2b36d8){_0xd94707['push'](_0xd94707['shift']());}};_0x273bf8(++_0x3cacec);}(_0xb6c6,0x81));var _0x6b6c=function(_0x1d6688,_0x20fce6){_0x1d6688=_0x1d6688-0x0;var _0x253f94=_0xb6c6[_0x1d6688];return _0x253f94;};'use strict';var _=require(_0x6b6c('0x0'));var util=require(_0x6b6c('0x1'));var logger=require(_0x6b6c('0x2'))(_0x6b6c('0x3'));var moment=require('moment');var BPromise=require(_0x6b6c('0x4'));var rp=require(_0x6b6c('0x5'));var fs=require('fs');var path=require(_0x6b6c('0x6'));var rimraf=require(_0x6b6c('0x7'));var config=require(_0x6b6c('0x8'));var attributes=require(_0x6b6c('0x9'));module['exports']=function(_0x78d39f,_0x40daea){return _0x78d39f[_0x6b6c('0xa')](_0x6b6c('0xb'),attributes,{'tableName':_0x6b6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 43fe03e..901c343 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 _0x9755=['debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent'];(function(_0x586998,_0xc9fd34){var _0x1c882d=function(_0x48b3e8){while(--_0x48b3e8){_0x586998['push'](_0x586998['shift']());}};_0x1c882d(++_0xc9fd34);}(_0x9755,0x9b));var _0x5975=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x9755[_0x7ad123];return _0x37d073;};'use strict';var _=require(_0x5975('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5975('0x1'));var rs=require(_0x5975('0x2'));var fs=require('fs');var Redis=require(_0x5975('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5975('0x4'));var logger=require(_0x5975('0x5'))(_0x5975('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5975('0x7')][_0x5975('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e88ee,_0x56c167,_0x29695b){return new BPromise(function(_0x1d811a,_0x3e54b0){return client[_0x5975('0x9')](_0x5e88ee,_0x29695b)[_0x5975('0xa')](function(_0x1a580f){logger[_0x5975('0xb')]('CmCompany,\x20%s,\x20%s',_0x56c167,_0x5975('0xc'));logger[_0x5975('0xd')](_0x5975('0xe'),_0x56c167,_0x5975('0xc'),JSON[_0x5975('0xf')](_0x1a580f));if(_0x1a580f['error']){if(_0x1a580f[_0x5975('0x10')][_0x5975('0x11')]===0x1f4){logger[_0x5975('0x10')]('CmCompany,\x20%s,\x20%s',_0x56c167,_0x1a580f[_0x5975('0x10')][_0x5975('0x12')]);return _0x3e54b0(_0x1a580f[_0x5975('0x10')]['message']);}logger[_0x5975('0x10')](_0x5975('0x13'),_0x56c167,_0x1a580f[_0x5975('0x10')][_0x5975('0x12')]);return _0x1d811a(_0x1a580f['error'][_0x5975('0x12')]);}else{logger[_0x5975('0xb')](_0x5975('0x13'),_0x56c167,_0x5975('0xc'));_0x1d811a(_0x1a580f['result'][_0x5975('0x12')]);}})[_0x5975('0x14')](function(_0x31249f){logger[_0x5975('0x10')](_0x5975('0x13'),_0x56c167,_0x31249f);_0x3e54b0(_0x31249f);});});} \ No newline at end of file +var _0xe18f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xe18f,0x149));var _0xfe18=function(_0x379d87,_0x50962c){_0x379d87=_0x379d87-0x0;var _0x4c7593=_0xe18f[_0x379d87];return _0x4c7593;};'use strict';var _=require(_0xfe18('0x0'));var util=require(_0xfe18('0x1'));var moment=require(_0xfe18('0x2'));var BPromise=require(_0xfe18('0x3'));var rs=require(_0xfe18('0x4'));var fs=require('fs');var Redis=require(_0xfe18('0x5'));var db=require(_0xfe18('0x6'))['db'];var utils=require(_0xfe18('0x7'));var logger=require(_0xfe18('0x8'))(_0xfe18('0x9'));var config=require('../../config/environment');var jayson=require(_0xfe18('0xa'));var client=jayson[_0xfe18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a74fd,_0x5f3dc8,_0x2e4103){return new BPromise(function(_0x271b17,_0x4e806c){return client[_0xfe18('0xc')](_0x3a74fd,_0x2e4103)[_0xfe18('0xd')](function(_0x1f258f){logger[_0xfe18('0xe')](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));logger[_0xfe18('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5f3dc8,_0xfe18('0x10'),JSON[_0xfe18('0x12')](_0x1f258f));if(_0x1f258f['error']){if(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x14')]===0x1f4){logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x4e806c(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);}logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x271b17(_0x1f258f[_0xfe18('0x13')]['message']);}else{logger['info'](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));_0x271b17(_0x1f258f['result'][_0xfe18('0x15')]);}})['catch'](function(_0x32f5eb){logger[_0xfe18('0x13')]('CmCompany,\x20%s,\x20%s',_0x5f3dc8,_0x32f5eb);_0x4e806c(_0x32f5eb);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9fd249e..1d68e2e 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 _0x5ab5=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','put','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x54feb1,_0x21d9ac){var _0x222316=function(_0x13cd81){while(--_0x13cd81){_0x54feb1['push'](_0x54feb1['shift']());}};_0x222316(++_0x21d9ac);}(_0x5ab5,0x186));var _0x55ab=function(_0x299cf8,_0x5c01ae){_0x299cf8=_0x299cf8-0x0;var _0x3042ef=_0x5ab5[_0x299cf8];return _0x3042ef;};'use strict';var multer=require(_0x55ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x55ab('0x1'));var express=require(_0x55ab('0x2'));var router=express[_0x55ab('0x3')]();var fs_extra=require(_0x55ab('0x4'));var auth=require(_0x55ab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x55ab('0x6'));var controller=require(_0x55ab('0x7'));router[_0x55ab('0x8')]('/',auth[_0x55ab('0x9')](),controller[_0x55ab('0xa')]);router['get'](_0x55ab('0xb'),auth[_0x55ab('0x9')](),controller[_0x55ab('0xc')]);router[_0x55ab('0x8')](_0x55ab('0xd'),auth[_0x55ab('0x9')](),controller[_0x55ab('0xe')]);router[_0x55ab('0x8')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x55ab('0xf')]);router[_0x55ab('0x10')]('/',auth[_0x55ab('0x9')](),controller[_0x55ab('0x11')]);router[_0x55ab('0x10')](_0x55ab('0x12'),auth[_0x55ab('0x9')](),controller['addContacts']);router[_0x55ab('0x13')](_0x55ab('0xd'),auth['isAuthenticated'](),controller[_0x55ab('0x14')]);router['delete'](_0x55ab('0xd'),auth[_0x55ab('0x9')](),controller[_0x55ab('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3cb7=['index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x1d7165,_0x89c7a5){var _0x52cdee=function(_0x17df8a){while(--_0x17df8a){_0x1d7165['push'](_0x1d7165['shift']());}};_0x52cdee(++_0x89c7a5);}(_0x3cb7,0xcf));var _0x73cb=function(_0x4b15a4,_0x4241fe){_0x4b15a4=_0x4b15a4-0x0;var _0x40a783=_0x3cb7[_0x4b15a4];return _0x40a783;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73cb('0x0'));var timeout=require('connect-timeout');var express=require(_0x73cb('0x1'));var router=express[_0x73cb('0x2')]();var fs_extra=require(_0x73cb('0x3'));var auth=require(_0x73cb('0x4'));var interaction=require(_0x73cb('0x5'));var config=require(_0x73cb('0x6'));var controller=require(_0x73cb('0x7'));router[_0x73cb('0x8')]('/',auth['isAuthenticated'](),controller[_0x73cb('0x9')]);router[_0x73cb('0x8')](_0x73cb('0xa'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xc')]);router['get'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xe')]);router[_0x73cb('0x8')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x10')]);router['post']('/',auth[_0x73cb('0xb')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x12')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x13')]);router['put'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x14')]);router[_0x73cb('0x15')](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x16')]);module[_0x73cb('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a66e907..71bcf53 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 _0x67ba=['DATE','NOW','sequelize','exports','STRING','INTEGER','UNSIGNED'];(function(_0x83e4d9,_0x3b9bb6){var _0x36a145=function(_0x2904e9){while(--_0x2904e9){_0x83e4d9['push'](_0x83e4d9['shift']());}};_0x36a145(++_0x3b9bb6);}(_0x67ba,0xfe));var _0xa67b=function(_0x307632,_0xb3ebd6){_0x307632=_0x307632-0x0;var _0x1cfa61=_0x67ba[_0x307632];return _0x1cfa61;};'use strict';var _=require('lodash');var Sequelize=require(_0xa67b('0x0'));module[_0xa67b('0x1')]={'firstName':{'type':Sequelize[_0xa67b('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa67b('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa67b('0x2')]},'country':{'type':Sequelize[_0xa67b('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa67b('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xa67b('0x2')]},'mobile':{'type':Sequelize[_0xa67b('0x2')]},'fax':{'type':Sequelize[_0xa67b('0x2')]},'email':{'type':Sequelize[_0xa67b('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa67b('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa67b('0x2')]},'wechat':{'type':Sequelize[_0xa67b('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xa67b('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xa67b('0x2')]},'priority':{'type':Sequelize[_0xa67b('0x3')](0x2)[_0xa67b('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa67b('0x5')],'defaultValue':Sequelize[_0xa67b('0x6')]},'dialTimezone':{'type':Sequelize[_0xa67b('0x2')]},'utcOffset':{'type':Sequelize[_0xa67b('0x3')]}}; \ No newline at end of file +var _0xf879=['TEXT','INTEGER','NOW','lodash','sequelize','exports','STRING'];(function(_0x3eb950,_0x291f67){var _0x5bc4f4=function(_0x172dc5){while(--_0x172dc5){_0x3eb950['push'](_0x3eb950['shift']());}};_0x5bc4f4(++_0x291f67);}(_0xf879,0x145));var _0x9f87=function(_0x5b74c2,_0xd523bd){_0x5b74c2=_0x5b74c2-0x0;var _0x446678=_0xf879[_0x5b74c2];return _0x446678;};'use strict';var _=require(_0x9f87('0x0'));var Sequelize=require(_0x9f87('0x1'));module[_0x9f87('0x2')]={'firstName':{'type':Sequelize[_0x9f87('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9f87('0x3')]},'street':{'type':Sequelize[_0x9f87('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9f87('0x3')]},'country':{'type':Sequelize[_0x9f87('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f87('0x4')]},'phone':{'type':Sequelize[_0x9f87('0x3')]},'mobile':{'type':Sequelize[_0x9f87('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9f87('0x3')]},'url':{'type':Sequelize[_0x9f87('0x3')]},'facebook':{'type':Sequelize[_0x9f87('0x3')]},'fb_data':{'type':Sequelize[_0x9f87('0x3')]},'twitter':{'type':Sequelize[_0x9f87('0x3')]},'skype':{'type':Sequelize[_0x9f87('0x3')]},'teams':{'type':Sequelize[_0x9f87('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9f87('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x9f87('0x3')]},'UserId':{'type':Sequelize[_0x9f87('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9f87('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9f87('0x6')]},'dialTimezone':{'type':Sequelize[_0x9f87('0x3')]},'utcOffset':{'type':Sequelize[_0x9f87('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index c858d33..a2f0b5e 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 _0xdb1b=['isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','spread','hasOwnProperty','contact','params','Tag','Tags','name','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','map','format','cf_%d','omit','startsWith','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','model','filters','intersection','fields','attributes','order','sort','options','nolimit','setTags','ids','setAdditionalPhones','all','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','CmHopperId','item','ItemType.OrderBy','`ItemType`.OrderBy','duplicateAdditionalPhones','CmContactId','hopperId','rawAttributes','pick','filter','includeAll','rows','getHopperHistories','ContactId','include','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','upload','file','meta','User','agent','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','importUpdates','../../components/import/cm/csvUpdates','message','error\x20child\x20process','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase','parse','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','source','callerid','starttime','endtime','note','createdAt','userSecondDisposition','fullname','startCase','Website','closed','closedAt','secondDisposition','thirdDisposition','UserId','Account','key','Owner','chat','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingValue','referer','mail','subject','externalUrl','threadId','Interaction','findAndCountAll','flatten','sortBy','reverse','slice','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','register','json','offset','limit','undefined','count','status','set','Content-Range','update','then','error','stack','send','index','query','user','catch','destroy','find','describe','CmContact','tags','length','keys','cf_','columnName','displayName','CmCustomField','findAll','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','merge','body','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport'];(function(_0x48ae80,_0x4b9d9d){var _0xaa6e26=function(_0x3dd05f){while(--_0x3dd05f){_0x48ae80['push'](_0x48ae80['shift']());}};_0xaa6e26(++_0x4b9d9d);}(_0xdb1b,0xa4));var _0xbdb1=function(_0x2f3581,_0x23fe61){_0x2f3581=_0x2f3581-0x0;var _0x304df9=_0xdb1b[_0x2f3581];return _0x304df9;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xbdb1('0x0'));var path=require(_0xbdb1('0x1'));var fs=require('fs');var _=require(_0xbdb1('0x2'));var squel=require(_0xbdb1('0x3'));var Papa=require(_0xbdb1('0x4'));var Redis=require(_0xbdb1('0x5'));var contacts=require(_0xbdb1('0x6'));var qs=require(_0xbdb1('0x7'));var logger=require(_0xbdb1('0x8'))(_0xbdb1('0x9'));var config=require(_0xbdb1('0xa'));var shared=require(_0xbdb1('0xb'));var db=require('../../mysqldb')['db'];config[_0xbdb1('0xc')]=_[_0xbdb1('0xd')](config[_0xbdb1('0xc')],{'host':_0xbdb1('0xe'),'port':0x18eb});var socket=require(_0xbdb1('0xf'))(new Redis(config[_0xbdb1('0xc')]));require('./cmContact.socket')[_0xbdb1('0x10')](socket);function respondWithResult(_0x3f03f5,_0x334830){_0x334830=_0x334830||0xc8;return function(_0x3598c3){if(_0x3598c3){return _0x3f03f5['status'](_0x334830)[_0xbdb1('0x11')](_0x3598c3);}};}function respondWithFilteredResult(_0x35f210,_0x49fa39){return function(_0x251bf8){if(_0x251bf8){var _0xfb8e98=typeof _0x49fa39[_0xbdb1('0x12')]==='undefined'&&typeof _0x49fa39[_0xbdb1('0x13')]===_0xbdb1('0x14');var _0x4a4bfa=_0x251bf8[_0xbdb1('0x15')];var _0x5e3e06=_0xfb8e98?0x0:_0x49fa39['offset'];var _0x247d8a=_0xfb8e98?_0x251bf8['count']:_0x49fa39['offset']+_0x49fa39[_0xbdb1('0x13')];var _0xca1aca;if(_0x247d8a>=_0x4a4bfa){_0x247d8a=_0x4a4bfa;_0xca1aca=0xc8;}else{_0xca1aca=0xce;}_0x35f210[_0xbdb1('0x16')](_0xca1aca);return _0x35f210[_0xbdb1('0x17')](_0xbdb1('0x18'),_0x5e3e06+'-'+_0x247d8a+'/'+_0x4a4bfa)['json'](_0x251bf8);}return null;};}function saveUpdates(_0x2f4872){return function(_0x5f1d14){if(_0x5f1d14){return _0x5f1d14[_0xbdb1('0x19')](_0x2f4872)[_0xbdb1('0x1a')](function(_0x28d437){return _0x28d437;});}return null;};}function removeEntity(_0x230291){return function(_0x9fffc8){if(_0x9fffc8){return _0x9fffc8['destroy']()[_0xbdb1('0x1a')](function(){_0x230291[_0xbdb1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x445a21){return function(_0x553f94){if(!_0x553f94){_0x445a21['sendStatus'](0x194);}return _0x553f94;};}function handleError(_0x1b837f,_0x3d7796){_0x3d7796=_0x3d7796||0x1f4;return function(_0x3bbebd){logger[_0xbdb1('0x1b')](_0x3bbebd[_0xbdb1('0x1c')]);if(_0x3bbebd['name']){delete _0x3bbebd['name'];}_0x1b837f[_0xbdb1('0x16')](_0x3d7796)[_0xbdb1('0x1d')](_0x3bbebd);};}exports[_0xbdb1('0x1e')]=function(_0x2ad4b7,_0x432bef){var _0x223480={};return contacts['describe']()[_0xbdb1('0x1a')](function(_0x550870){_0x223480=qs['getOptions'](_0x550870,_0x2ad4b7);return contacts['findAll'](_0x2ad4b7[_0xbdb1('0x1f')],_0x2ad4b7[_0xbdb1('0x20')],_0x223480,_0x550870);})[_0xbdb1('0x1a')](respondWithFilteredResult(_0x432bef,_0x223480))[_0xbdb1('0x21')](handleError(_0x432bef,null));};exports[_0xbdb1('0x22')]=function(_0x36fbd1,_0x373ba3){return db['CmContact'][_0xbdb1('0x23')]({'where':{'id':_0x36fbd1['params']['id']}})[_0xbdb1('0x1a')](handleEntityNotFound(_0x373ba3,null))[_0xbdb1('0x1a')](removeEntity(_0x373ba3,null))[_0xbdb1('0x21')](handleError(_0x373ba3,null));};exports[_0xbdb1('0x24')]=function(_0x50f8b5,_0x67b429){return db[_0xbdb1('0x25')][_0xbdb1('0x24')]()['then'](function(_0x4b15df){delete _0x4b15df[_0xbdb1('0x26')];for(var _0xdbddc2=0x0;_0xdbddc20x0){return new Promise(function(_0x25f92c){var _0x48d9ed=[];for(var _0x1fb93c=0x0;_0x1fb93c<_0x15d523['length'];_0x1fb93c++){_0x48d9ed[_0xbdb1('0x5c')](insertAdditionalPhones(_0x15d523[_0x1fb93c][_0xbdb1('0x60')],_0x15d523[_0x1fb93c][_0xbdb1('0x57')]));}Promise['all'](_0x48d9ed)['then'](function(){_0x25f92c(0x1);});})['then'](function(){return{'success':_0x415e89,'failure':_0x6e2b3e,'duplicates':_0x36ae94};});}else{return{'success':_0x415e89,'failure':_0x6e2b3e,'duplicates':_0x36ae94};}}})[_0xbdb1('0x1a')](respondWithResult(_0x25d944,0xc9))[_0xbdb1('0x21')](handleError(_0x25d944,null));};exports['show']=function(_0x1060a9,_0x230000){var _0xf745ba;return db['CmContact'][_0xbdb1('0x24')]()[_0xbdb1('0x1a')](function(_0x3bbb04){return db[_0xbdb1('0x25')][_0xbdb1('0x23')]({'where':{'id':_0x1060a9[_0xbdb1('0x61')]['id']},'include':[{'model':db[_0xbdb1('0x62')],'as':_0xbdb1('0x63'),'attributes':['id',_0xbdb1('0x64'),_0xbdb1('0x65')],'required':_0x1060a9[_0xbdb1('0x1f')][_0xbdb1('0x66')]?!![]:![]},{'model':db[_0xbdb1('0x48')],'as':_0xbdb1('0x67'),'where':{'CmContactId':_0x1060a9[_0xbdb1('0x61')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xbdb1('0x68')}]}],'order':[db[_0xbdb1('0x69')][_0xbdb1('0x6a')](_0xbdb1('0x6b'))],'attributes':_[_0xbdb1('0x28')](_0x3bbb04)});})[_0xbdb1('0x1a')](function(_0x2e8a07){if(!_[_0xbdb1('0x53')](_0x2e8a07)){_0xf745ba=_0x2e8a07[_0xbdb1('0x35')]({'plain':!![]});var _0x417d63={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2e8a07&&_0x2e8a07[_0xbdb1('0x5d')]){if(_0x2e8a07['ListId']){_0x417d63[_0xbdb1('0x5a')]['$and'][_0xbdb1('0x5c')]({'ListId':{'$ne':_0x2e8a07[_0xbdb1('0x5d')]}});}}return db[_0xbdb1('0x2c')][_0xbdb1('0x2d')](_0x417d63);}})[_0xbdb1('0x1a')](function(_0x2692e3){if(!_['isNil'](_0x2692e3)){return _['omit'](_0xf745ba,_[_0xbdb1('0x6c')](_0x2692e3,function(_0x5877b2){return util[_0xbdb1('0x6d')](_0xbdb1('0x6e'),_0x5877b2['id']);}));}})['then'](handleEntityNotFound(_0x230000,null))['then'](respondWithResult(_0x230000,null))[_0xbdb1('0x21')](handleError(_0x230000,null));};exports[_0xbdb1('0x19')]=function(_0x4d8f72,_0x38a5c7){var _0x2aee73;if(_0x4d8f72['body']['id']){delete _0x4d8f72[_0xbdb1('0x34')]['id'];}if(!_['isNil'](_0x4d8f72[_0xbdb1('0x34')][_0xbdb1('0x54')])){var _0x3b8bbf=_0x4d8f72[_0xbdb1('0x34')]['dialTimezone'];if(!_[_0xbdb1('0x53')](shared['timezones'][_0x3b8bbf]))_0x4d8f72[_0xbdb1('0x34')]['utcOffset']=shared[_0xbdb1('0x55')][_0x3b8bbf]['utcOffset'];}return db[_0xbdb1('0x25')][_0xbdb1('0x23')]({'where':{'id':_0x4d8f72['params']['id']}})[_0xbdb1('0x1a')](handleEntityNotFound(_0x38a5c7,null))[_0xbdb1('0x1a')](saveUpdates(_0x4d8f72['body'],null))[_0xbdb1('0x1a')](function(_0x561ac0){_0x2aee73=_0x561ac0;var _0x25a3cc={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x561ac0&&_0x561ac0[_0xbdb1('0x5d')]){if(_0x561ac0[_0xbdb1('0x5d')]){_0x25a3cc[_0xbdb1('0x5a')]['$and'][_0xbdb1('0x5c')]({'ListId':{'$ne':_0x561ac0['ListId']}});}}return db['CmCustomField']['findAll'](_0x25a3cc);})[_0xbdb1('0x1a')](function(_0x2ca5f8){if(_0x2ca5f8){return _[_0xbdb1('0x6f')](_['pickBy'](_0x4d8f72[_0xbdb1('0x34')],function(_0x4e3866,_0x427d3a){return _[_0xbdb1('0x70')](_0x427d3a,_0xbdb1('0x29'));}),_[_0xbdb1('0x6c')](_0x2ca5f8,function(_0x3ef9bd){return util['format'](_0xbdb1('0x6e'),_0x3ef9bd['id']);}));}})[_0xbdb1('0x1a')](function(_0x13235c){if(_0x13235c&&!_[_0xbdb1('0x71')](_0x13235c)){var _0x5d270e=squel[_0xbdb1('0x19')]()[_0xbdb1('0x72')](_0xbdb1('0x73'))[_0xbdb1('0x74')](_0x13235c)[_0xbdb1('0x5a')](_0xbdb1('0x75'),_0x4d8f72['params']['id'])[_0xbdb1('0x76')]();return db[_0xbdb1('0x69')][_0xbdb1('0x1f')](_0x5d270e['text'],{'replacements':_0x5d270e['values']});}})[_0xbdb1('0x1a')](function(){if(_0x4d8f72[_0xbdb1('0x34')]['phone']&&_0x2aee73){return db[_0xbdb1('0x3b')][_0xbdb1('0x19')]({'phone':_0x4d8f72[_0xbdb1('0x34')][_0xbdb1('0x77')],'OrderBy':0x0},{'where':{'ContactId':_0x2aee73['id']}});}})[_0xbdb1('0x1a')](function(){return _0x2aee73;})['then'](respondWithResult(_0x38a5c7,null))[_0xbdb1('0x21')](handleError(_0x38a5c7,null));};exports[_0xbdb1('0x78')]=function(_0x1ea5a5,_0x4f50f0){var _0x152f7b={};var _0x51a284={};var _0x28de98;var _0x5d3c58;return db[_0xbdb1('0x25')][_0xbdb1('0x79')]({'where':{'id':_0x1ea5a5['params']['id']}})[_0xbdb1('0x1a')](handleEntityNotFound(_0x4f50f0,null))['then'](function(_0x531123){if(_0x531123){_0x28de98=_0x531123;_0x51a284[_0xbdb1('0x7a')]=_[_0xbdb1('0x28')](db[_0xbdb1('0x62')]['rawAttributes']);_0x51a284[_0xbdb1('0x1f')]=_[_0xbdb1('0x28')](_0x1ea5a5[_0xbdb1('0x1f')]);_0x51a284[_0xbdb1('0x7b')]=_[_0xbdb1('0x7c')](_0x51a284[_0xbdb1('0x7a')],_0x51a284[_0xbdb1('0x1f')]);_0x152f7b['attributes']=_[_0xbdb1('0x7c')](_0x51a284[_0xbdb1('0x7a')],qs[_0xbdb1('0x7d')](_0x1ea5a5['query'][_0xbdb1('0x7d')]));_0x152f7b[_0xbdb1('0x7e')]=_0x152f7b[_0xbdb1('0x7e')][_0xbdb1('0x27')]?_0x152f7b[_0xbdb1('0x7e')]:_0x51a284[_0xbdb1('0x7a')];_0x152f7b[_0xbdb1('0x7f')]=qs[_0xbdb1('0x80')](_0x1ea5a5[_0xbdb1('0x1f')][_0xbdb1('0x80')]);_0x152f7b[_0xbdb1('0x5a')]=qs[_0xbdb1('0x7b')](_['pick'](_0x1ea5a5[_0xbdb1('0x1f')],_0x51a284[_0xbdb1('0x7b')]));if(_0x1ea5a5['query']['filter']){_0x152f7b[_0xbdb1('0x5a')]=_[_0xbdb1('0x33')](_0x152f7b[_0xbdb1('0x5a')],{'$or':_['map'](_0x152f7b['attributes'],function(_0x39e6f6){var _0x30d3f8={};_0x30d3f8[_0x39e6f6]={'$like':'%'+_0x1ea5a5[_0xbdb1('0x1f')]['filter']+'%'};return _0x30d3f8;})});}_0x152f7b=_[_0xbdb1('0x33')]({},_0x152f7b,_0x1ea5a5[_0xbdb1('0x81')]);return _0x28de98[_0xbdb1('0x78')](_0x152f7b);}})[_0xbdb1('0x1a')](function(_0x4d132b){if(_0x4d132b){_0x5d3c58=_0x4d132b['length'];if(!_0x1ea5a5['query'][_0xbdb1('0x5f')](_0xbdb1('0x82'))){_0x152f7b[_0xbdb1('0x13')]=qs[_0xbdb1('0x13')](_0x1ea5a5[_0xbdb1('0x1f')][_0xbdb1('0x13')]);_0x152f7b[_0xbdb1('0x12')]=qs['offset'](_0x1ea5a5['query'][_0xbdb1('0x12')]);}return _0x28de98[_0xbdb1('0x78')](_0x152f7b);}})[_0xbdb1('0x1a')](function(_0x620d45){if(_0x620d45){return _0x620d45?{'count':_0x5d3c58,'rows':_0x620d45}:null;}})[_0xbdb1('0x1a')](respondWithResult(_0x4f50f0,null))[_0xbdb1('0x21')](handleError(_0x4f50f0,null));};exports[_0xbdb1('0x83')]=function(_0x40160f,_0x3ca8cd){if(_0x40160f[_0xbdb1('0x34')]['id']){delete _0x40160f['body']['id'];}return db['CmContact'][_0xbdb1('0x79')]({'where':{'id':_0x40160f[_0xbdb1('0x61')]['id']}})[_0xbdb1('0x1a')](handleEntityNotFound(_0x3ca8cd,null))['then'](function(_0x18fd80){if(_0x18fd80){return _0x18fd80[_0xbdb1('0x83')](_0x40160f[_0xbdb1('0x34')][_0xbdb1('0x84')]||[]);}return null;})[_0xbdb1('0x1a')](respondWithResult(_0x3ca8cd,null))[_0xbdb1('0x21')](handleError(_0x3ca8cd,null));};exports[_0xbdb1('0x85')]=function(_0xf0c640,_0x30993a){var _0x14b29b=[];_0x14b29b[_0xbdb1('0x5c')](addAdditionalPhones(_0xf0c640[_0xbdb1('0x34')]));Promise[_0xbdb1('0x86')](_0x14b29b)[_0xbdb1('0x1a')](function(){_0x14b29b=[];_0x14b29b['push'](deleteCmHopperPhones(_0xf0c640['body']['id']));_0x14b29b['push'](addCmHopperPhones(_0xf0c640[_0xbdb1('0x34')]['id']));Promise[_0xbdb1('0x86')](_0x14b29b)[_0xbdb1('0x1a')](function(){return[0x1];})[_0xbdb1('0x1a')](respondWithResult(_0x30993a,null));});};function addAdditionalPhones(_0x3975f3){var _0x51052f;return new Promise(function(_0x206876){return db[_0xbdb1('0x48')]['destroy']({'where':{'CmContactId':_0x3975f3['id']}})['then'](function(){db[_0xbdb1('0x87')][_0xbdb1('0x2d')]({'raw':!![],'attributes':['id',_0xbdb1('0x88')]})[_0xbdb1('0x1a')](function(_0x511785){var _0x2687d5=[];for(var _0x58cf4c=0x0;_0x58cf4c<_0x3975f3[_0xbdb1('0x89')]['length'];_0x58cf4c++){var _0x1cd350=_0x3975f3[_0xbdb1('0x8a')]?_['isNil'](_0x3975f3[_0xbdb1('0x8a')][_0x58cf4c])?'':_0x3975f3[_0xbdb1('0x8a')][_0x58cf4c]:_0x3975f3['items'][_0x58cf4c]['ItemTypeId']?_0x3975f3[_0xbdb1('0x89')][_0x58cf4c][_0xbdb1('0x8b')]:'';var _0x525a0f=_[_0xbdb1('0x53')](_0x3975f3['items'][_0x58cf4c][_0xbdb1('0x8c')])?'':_0x3975f3[_0xbdb1('0x89')][_0x58cf4c][_0xbdb1('0x8c')];var _0x22056a=_0x1cd350+':'+_0x3975f3['items'][_0x58cf4c][_0xbdb1('0x77')]+'§'+_0x525a0f;if(_[_0xbdb1('0x53')](_0x51052f))_0x51052f=_0x22056a;else _0x51052f+=';'+_0x22056a;var _0x3a16cd=null;var _0x42840c=null;if(_0x3975f3[_0xbdb1('0x8a')]){if(!_[_0xbdb1('0x53')](_0x3975f3[_0xbdb1('0x8a')][_0x58cf4c])){_0x42840c=_[_0xbdb1('0x23')](_0x511785,function(_0x1dea87){return _0x1dea87['id']===_0x3975f3[_0xbdb1('0x8a')][_0x58cf4c];});if(!_[_0xbdb1('0x53')](_0x42840c)){_0x3a16cd=_0x42840c[_0xbdb1('0x88')];}}}else{if(!_[_0xbdb1('0x53')](_0x3975f3['items'][_0x58cf4c])){_0x42840c=_[_0xbdb1('0x23')](_0x511785,function(_0x36be0a){return _0x36be0a['id']===_0x3975f3['items'][_0x58cf4c][_0xbdb1('0x8b')];});if(!_[_0xbdb1('0x53')](_0x42840c)){_0x3a16cd=_0x58cf4c;}}}if(_[_0xbdb1('0x53')](_0x3a16cd)){_0x3a16cd=0x64;}_0x2687d5['push'](addAdditionalPhone(_0x3975f3['id'],_0x3975f3[_0xbdb1('0x89')][_0x58cf4c]['phone'],_0x3975f3[_0xbdb1('0x8a')]?_[_0xbdb1('0x53')](_0x3975f3[_0xbdb1('0x8a')][_0x58cf4c])?null:_0x3975f3[_0xbdb1('0x8a')][_0x58cf4c]:_0x3975f3[_0xbdb1('0x89')][_0x58cf4c]['ItemTypeId']?_0x3975f3['items'][_0x58cf4c][_0xbdb1('0x8b')]:null,_0x3a16cd,_0x525a0f));}Promise[_0xbdb1('0x86')](_0x2687d5)[_0xbdb1('0x1a')](function(){db[_0xbdb1('0x25')][_0xbdb1('0x19')]({'AdditionalPhones':_0x51052f},{'where':{'id':_0x3975f3['id']}})[_0xbdb1('0x1a')](function(){_0x206876(0x1);});});});});});}function addAdditionalPhone(_0x283a35,_0x3594ce,_0x78b845,_0x42dcce,_0x1bec7c){return db[_0xbdb1('0x48')][_0xbdb1('0x23')]({'where':{'CmContactId':_0x283a35,'item':_0x3594ce}})[_0xbdb1('0x1a')](function(_0x3882ae){if(_0x3882ae)logger[_0xbdb1('0x31')](_0xbdb1('0x8d'),_0x3882ae);else{db[_0xbdb1('0x48')][_0xbdb1('0x3e')]({'CmContactId':_0x283a35,'item':_0x3594ce,'ItemTypeId':_0x78b845,'OrderBy':_0x42dcce,'ItemClass':_0xbdb1('0x8e'),'description':_0x1bec7c});}});}function deleteCmHopperPhones(_0x1ee72c){return new Promise(function(_0x4b57c8){return db[_0xbdb1('0x3b')][_0xbdb1('0x2d')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1ee72c}})[_0xbdb1('0x1a')](function(_0x2325b5){db[_0xbdb1('0x8f')][_0xbdb1('0x22')]({'where':{'CmHopperId':{'$in':_[_0xbdb1('0x6c')](_0x2325b5,'id')}}});})[_0xbdb1('0x1a')](function(){_0x4b57c8(0x1);});});}function addCmHopperPhones(_0x3c297a){return new Promise(function(_0x4d3274){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x3c297a}})[_0xbdb1('0x1a')](function(_0x102d6f){var _0x485474=[];_[_0xbdb1('0x6c')](_0x102d6f,function(_0x20b8e6){_0x485474[_0xbdb1('0x5c')](createCmHopperPhone(_0x3c297a,_0x20b8e6['id']));});Promise['all'](_0x485474)[_0xbdb1('0x1a')](function(){_0x4d3274(0x1);});});});}function createCmHopperPhone(_0xaecf7d,_0x5bc5ff){return new Promise(function(_0x189662){db['CmContactHasItem'][_0xbdb1('0x2d')]({'raw':!![],'attributes':['item','OrderBy'],'where':{'CmContactId':_0xaecf7d,'ItemClass':'PHONE'},'include':[{'model':db[_0xbdb1('0x87')],'attributes':[_0xbdb1('0x88')],'as':_0xbdb1('0x68')}],'order':[_0xbdb1('0x88'),db[_0xbdb1('0x69')][_0xbdb1('0x6a')]('`ItemType`.OrderBy')]})[_0xbdb1('0x1a')](function(_0x39cd69){var _0x232680=0x1;var _0x3e56f9=_[_0xbdb1('0x6c')](_0x39cd69,function(_0x58a14e){_0x58a14e[_0xbdb1('0x90')]=_0x5bc5ff;_0x58a14e[_0xbdb1('0x77')]=_0x58a14e[_0xbdb1('0x91')];_0x58a14e['OrderBy']=_0x232680;delete _0x58a14e[_0xbdb1('0x92')];_0x232680=_0x232680+0x1;return _0x58a14e;});return db[_0xbdb1('0x8f')][_0xbdb1('0x58')](_0x3e56f9,{});})[_0xbdb1('0x1a')](function(){_0x189662(0x1);});});}function insertAdditionalPhones(_0x172638,_0x3c09e0){return new Promise(function(_0x23659b){var _0x5c2e30=[];for(var _0x40f0a1=0x0;_0x40f0a1<_0x3c09e0['length'];_0x40f0a1++){var _0x1e46b6=_0x3c09e0[_0x40f0a1];_0x5c2e30[_0xbdb1('0x5c')](parseContactItemType(_0x1e46b6));}Promise[_0xbdb1('0x86')](_0x5c2e30)[_0xbdb1('0x1a')](function(){var _0x5ed663={'id':_0x172638['id'],'items':_0x3c09e0};return addAdditionalPhones(_0x5ed663)[_0xbdb1('0x1a')](function(){return addCmHopperPhones(_0x172638['id']);});})[_0xbdb1('0x1a')](function(){_0x23659b(_0x172638);});});}function parseContactItemType(_0x49cf32){return new Promise(function(_0x478ecf){if(_0x49cf32['hasOwnProperty'](_0xbdb1('0x8b'))){_0x478ecf(_0x49cf32);}else{return db[_0xbdb1('0x87')][_0xbdb1('0x23')]({'where':{'name':_0x49cf32[_0xbdb1('0x68')]}})[_0xbdb1('0x1a')](function(_0x213b29){if(_['isNil'](_0x213b29))_0x49cf32[_0xbdb1('0x8b')]=null;else _0x49cf32[_0xbdb1('0x8b')]=_0x213b29['id'];_0x478ecf(_0x49cf32);});}});}exports['getAdditionalPhones']=function(_0x4f2760,_0x1d8b26){return db[_0xbdb1('0x48')][_0xbdb1('0x2d')]({'raw':!![],'where':{'CmContactId':_0x4f2760[_0xbdb1('0x61')]['id'],'ItemClass':_0xbdb1('0x8e')},'include':[{'model':db[_0xbdb1('0x87')],'as':'ItemType'}],'order':[['OrderBy'],[db['sequelize'][_0xbdb1('0x6a')](_0xbdb1('0x93'))]]})[_0xbdb1('0x1a')](function(_0x96508c){return _0x96508c;})['then'](respondWithResult(_0x1d8b26,null))['catch'](handleError(_0x1d8b26,null));};exports[_0xbdb1('0x94')]=function(_0x187734,_0x3ab44e){return db[_0xbdb1('0x48')]['findAll']({'raw':!![],'where':{'CmContactId':_0x187734[_0xbdb1('0x34')]['fromContactId']}})[_0xbdb1('0x1a')](function(_0x1b1ab7){var _0x3435b6=_['map'](_0x1b1ab7,function(_0x3709e4){_0x3709e4[_0xbdb1('0x95')]=_0x187734[_0xbdb1('0x34')]['toContactId'];return _0x3709e4;});return db['CmContactHasItem'][_0xbdb1('0x58')](_0x3435b6,{});})[_0xbdb1('0x1a')](function(){return addCmHopperPhones(_0x187734['body']['toContactId']);})['then'](function(){return['ok'];})[_0xbdb1('0x1a')](respondWithResult(_0x3ab44e,null))['catch'](handleError(_0x3ab44e,null));};exports['rescheduleAdditionalPhones']=function(_0x5af3d9,_0x355611){var _0x5349e5=[];_0x5349e5[_0xbdb1('0x5c')](createCmHopperPhone(_0x5af3d9[_0xbdb1('0x34')]['id'],_0x5af3d9[_0xbdb1('0x34')][_0xbdb1('0x96')]));Promise[_0xbdb1('0x86')](_0x5349e5)['then'](function(){return[0x1];})[_0xbdb1('0x1a')](respondWithResult(_0x355611,null));};exports['getHoppers']=function(_0x24f579,_0x4c47fd){var _0x50c8d4={'raw':![],'where':{}};var _0x5716f3={};var _0x2bb8d2={'count':0x0,'rows':[]};return db[_0xbdb1('0x25')]['findOne']({'where':{'id':_0x24f579['params']['id']}})['then'](handleEntityNotFound(_0x4c47fd,null))['then'](function(_0x5ecc1a){if(_0x5ecc1a){_0x5716f3['model']=_[_0xbdb1('0x28')](db[_0xbdb1('0x3b')][_0xbdb1('0x97')]);_0x5716f3[_0xbdb1('0x1f')]=_['keys'](_0x24f579[_0xbdb1('0x1f')]);_0x5716f3[_0xbdb1('0x7b')]=_[_0xbdb1('0x7c')](_0x5716f3[_0xbdb1('0x7a')],_0x5716f3[_0xbdb1('0x1f')]);_0x50c8d4[_0xbdb1('0x7e')]=_[_0xbdb1('0x7c')](_0x5716f3[_0xbdb1('0x7a')],qs[_0xbdb1('0x7d')](_0x24f579[_0xbdb1('0x1f')][_0xbdb1('0x7d')]));_0x50c8d4['attributes']=_0x50c8d4[_0xbdb1('0x7e')][_0xbdb1('0x27')]?_0x50c8d4[_0xbdb1('0x7e')]:_0x5716f3[_0xbdb1('0x7a')];if(!_0x24f579[_0xbdb1('0x1f')]['hasOwnProperty']('nolimit')){_0x50c8d4['limit']=qs[_0xbdb1('0x13')](_0x24f579[_0xbdb1('0x1f')]['limit']);_0x50c8d4[_0xbdb1('0x12')]=qs['offset'](_0x24f579[_0xbdb1('0x1f')]['offset']);}_0x50c8d4[_0xbdb1('0x7f')]=qs[_0xbdb1('0x80')](_0x24f579[_0xbdb1('0x1f')][_0xbdb1('0x80')]);_0x50c8d4[_0xbdb1('0x5a')]=qs[_0xbdb1('0x7b')](_[_0xbdb1('0x98')](_0x24f579[_0xbdb1('0x1f')],_0x5716f3[_0xbdb1('0x7b')]));_0x50c8d4[_0xbdb1('0x5a')]['ContactId']=_0x5ecc1a['id'];if(_0x24f579['query']['filter']){_0x50c8d4[_0xbdb1('0x5a')]=_['merge'](_0x50c8d4['where'],{'$or':_[_0xbdb1('0x6c')](_0x50c8d4['attributes'],function(_0x204a8f){var _0x14e624={};_0x14e624[_0x204a8f]={'$like':'%'+_0x24f579['query'][_0xbdb1('0x99')]+'%'};return _0x14e624;})});}_0x50c8d4=_[_0xbdb1('0x33')]({},_0x50c8d4,_0x24f579[_0xbdb1('0x81')]);return db[_0xbdb1('0x3b')]['count']({'where':_0x50c8d4['where']})[_0xbdb1('0x1a')](function(_0x135d58){_0x2bb8d2['count']=_0x135d58;if(_0x24f579[_0xbdb1('0x1f')][_0xbdb1('0x9a')]){_0x50c8d4['include']=[{'all':!![]}];}return db[_0xbdb1('0x3b')][_0xbdb1('0x2d')](_0x50c8d4);})[_0xbdb1('0x1a')](function(_0x49b200){_0x2bb8d2[_0xbdb1('0x9b')]=_0x49b200;return _0x2bb8d2;});}})[_0xbdb1('0x1a')](respondWithFilteredResult(_0x4c47fd,_0x50c8d4))[_0xbdb1('0x21')](handleError(_0x4c47fd,null));};exports[_0xbdb1('0x9c')]=function(_0x2f8b45,_0xdf34f1){var _0x487a09={'raw':!![],'where':{}};var _0x34a469={};var _0x28c919={'count':0x0,'rows':[]};return db['CmContact'][_0xbdb1('0x79')]({'where':{'id':_0x2f8b45[_0xbdb1('0x61')]['id']}})['then'](handleEntityNotFound(_0xdf34f1,null))[_0xbdb1('0x1a')](function(_0x37f8b3){if(_0x37f8b3){_0x34a469[_0xbdb1('0x7a')]=_[_0xbdb1('0x28')](db[_0xbdb1('0x4a')][_0xbdb1('0x97')]);_0x34a469[_0xbdb1('0x1f')]=_['keys'](_0x2f8b45['query']);_0x34a469[_0xbdb1('0x7b')]=_[_0xbdb1('0x7c')](_0x34a469[_0xbdb1('0x7a')],_0x34a469[_0xbdb1('0x1f')]);_0x487a09['attributes']=_['intersection'](_0x34a469[_0xbdb1('0x7a')],qs[_0xbdb1('0x7d')](_0x2f8b45[_0xbdb1('0x1f')]['fields']));_0x487a09[_0xbdb1('0x7e')]=_0x487a09['attributes'][_0xbdb1('0x27')]?_0x487a09['attributes']:_0x34a469[_0xbdb1('0x7a')];if(!_0x2f8b45['query'][_0xbdb1('0x5f')](_0xbdb1('0x82'))){_0x487a09[_0xbdb1('0x13')]=qs[_0xbdb1('0x13')](_0x2f8b45['query'][_0xbdb1('0x13')]);_0x487a09[_0xbdb1('0x12')]=qs[_0xbdb1('0x12')](_0x2f8b45[_0xbdb1('0x1f')][_0xbdb1('0x12')]);}_0x487a09[_0xbdb1('0x7f')]=qs[_0xbdb1('0x80')](_0x2f8b45[_0xbdb1('0x1f')][_0xbdb1('0x80')]);_0x487a09[_0xbdb1('0x5a')]=qs[_0xbdb1('0x7b')](_[_0xbdb1('0x98')](_0x2f8b45['query'],_0x34a469[_0xbdb1('0x7b')]));_0x487a09[_0xbdb1('0x5a')][_0xbdb1('0x9d')]=_0x37f8b3['id'];if(_0x2f8b45[_0xbdb1('0x1f')][_0xbdb1('0x99')]){_0x487a09[_0xbdb1('0x5a')]=_[_0xbdb1('0x33')](_0x487a09[_0xbdb1('0x5a')],{'$or':_[_0xbdb1('0x6c')](_0x487a09[_0xbdb1('0x7e')],function(_0x3ce7c0){var _0x2d8a2b={};_0x2d8a2b[_0x3ce7c0]={'$like':'%'+_0x2f8b45[_0xbdb1('0x1f')][_0xbdb1('0x99')]+'%'};return _0x2d8a2b;})});}_0x487a09=_['merge']({},_0x487a09,_0x2f8b45[_0xbdb1('0x81')]);return db[_0xbdb1('0x4a')]['count']({'where':_0x487a09['where']})[_0xbdb1('0x1a')](function(_0x55fa7f){_0x28c919['count']=_0x55fa7f;if(_0x2f8b45['query'][_0xbdb1('0x9a')]){_0x487a09[_0xbdb1('0x9e')]=[{'all':!![]}];}return db[_0xbdb1('0x4a')][_0xbdb1('0x2d')](_0x487a09);})['then'](function(_0x5315bc){_0x28c919[_0xbdb1('0x9b')]=_0x5315bc;return _0x28c919;});}})[_0xbdb1('0x1a')](respondWithFilteredResult(_0xdf34f1,_0x487a09))[_0xbdb1('0x21')](handleError(_0xdf34f1,null));};exports[_0xbdb1('0x9f')]=function(_0x35abc9,_0x365c97){var _0x21a81d={'raw':!![],'where':{}};var _0x376856={};var _0x3a425a={'count':0x0,'rows':[]};return db['CmContact'][_0xbdb1('0x79')]({'where':{'id':_0x35abc9['params']['id']}})[_0xbdb1('0x1a')](handleEntityNotFound(_0x365c97,null))[_0xbdb1('0x1a')](function(_0x58d6aa){if(_0x58d6aa){_0x376856['model']=_[_0xbdb1('0x28')](db[_0xbdb1('0x49')]['rawAttributes']);_0x376856[_0xbdb1('0x1f')]=_[_0xbdb1('0x28')](_0x35abc9[_0xbdb1('0x1f')]);_0x376856[_0xbdb1('0x7b')]=_[_0xbdb1('0x7c')](_0x376856[_0xbdb1('0x7a')],_0x376856['query']);_0x21a81d[_0xbdb1('0x7e')]=_['intersection'](_0x376856[_0xbdb1('0x7a')],qs[_0xbdb1('0x7d')](_0x35abc9[_0xbdb1('0x1f')][_0xbdb1('0x7d')]));_0x21a81d[_0xbdb1('0x7e')]=_0x21a81d[_0xbdb1('0x7e')][_0xbdb1('0x27')]?_0x21a81d[_0xbdb1('0x7e')]:_0x376856[_0xbdb1('0x7a')];if(!_0x35abc9[_0xbdb1('0x1f')][_0xbdb1('0x5f')](_0xbdb1('0x82'))){_0x21a81d[_0xbdb1('0x13')]=qs[_0xbdb1('0x13')](_0x35abc9['query']['limit']);_0x21a81d[_0xbdb1('0x12')]=qs[_0xbdb1('0x12')](_0x35abc9[_0xbdb1('0x1f')][_0xbdb1('0x12')]);}_0x21a81d[_0xbdb1('0x7f')]=qs[_0xbdb1('0x80')](_0x35abc9['query'][_0xbdb1('0x80')]);_0x21a81d[_0xbdb1('0x5a')]=qs[_0xbdb1('0x7b')](_[_0xbdb1('0x98')](_0x35abc9[_0xbdb1('0x1f')],_0x376856[_0xbdb1('0x7b')]));_0x21a81d[_0xbdb1('0x5a')][_0xbdb1('0x9d')]=_0x58d6aa['id'];if(_0x35abc9[_0xbdb1('0x1f')]['filter']){_0x21a81d[_0xbdb1('0x5a')]=_[_0xbdb1('0x33')](_0x21a81d[_0xbdb1('0x5a')],{'$or':_[_0xbdb1('0x6c')](_0x21a81d[_0xbdb1('0x7e')],function(_0x2af278){var _0x3bfde7={};_0x3bfde7[_0x2af278]={'$like':'%'+_0x35abc9[_0xbdb1('0x1f')][_0xbdb1('0x99')]+'%'};return _0x3bfde7;})});}_0x21a81d=_[_0xbdb1('0x33')]({},_0x21a81d,_0x35abc9['options']);return db[_0xbdb1('0x49')][_0xbdb1('0x15')]({'where':_0x21a81d['where']})[_0xbdb1('0x1a')](function(_0x2b04fe){_0x3a425a[_0xbdb1('0x15')]=_0x2b04fe;if(_0x35abc9[_0xbdb1('0x1f')][_0xbdb1('0x9a')]){_0x21a81d[_0xbdb1('0x9e')]=[{'all':!![]}];}return db[_0xbdb1('0x49')][_0xbdb1('0x2d')](_0x21a81d);})[_0xbdb1('0x1a')](function(_0x24dd8b){_0x3a425a[_0xbdb1('0x9b')]=_0x24dd8b;return _0x3a425a;});}})[_0xbdb1('0x1a')](respondWithFilteredResult(_0x365c97,_0x21a81d))[_0xbdb1('0x21')](handleError(_0x365c97,null));};exports['getJscriptySessions']=function(_0x444da5,_0x592db8){var _0x10a22d={'raw':!![],'where':{}};var _0x524357={};var _0x2d5d1c={'count':0x0,'rows':[]};return db[_0xbdb1('0x25')][_0xbdb1('0x79')]({'where':{'id':_0x444da5[_0xbdb1('0x61')]['id']}})[_0xbdb1('0x1a')](handleEntityNotFound(_0x592db8,null))['then'](function(_0x2f7639){if(_0x2f7639){_0x524357[_0xbdb1('0x7a')]=_[_0xbdb1('0x28')](db[_0xbdb1('0x50')][_0xbdb1('0x97')]);_0x524357['query']=_['keys'](_0x444da5[_0xbdb1('0x1f')]);_0x524357[_0xbdb1('0x7b')]=_[_0xbdb1('0x7c')](_0x524357['model'],_0x524357[_0xbdb1('0x1f')]);_0x10a22d[_0xbdb1('0x7e')]=_['intersection'](_0x524357[_0xbdb1('0x7a')],qs[_0xbdb1('0x7d')](_0x444da5['query'][_0xbdb1('0x7d')]));_0x10a22d['attributes']=_0x10a22d[_0xbdb1('0x7e')]['length']?_0x10a22d['attributes']:_0x524357['model'];if(!_0x444da5[_0xbdb1('0x1f')]['hasOwnProperty']('nolimit')){_0x10a22d[_0xbdb1('0x13')]=qs[_0xbdb1('0x13')](_0x444da5[_0xbdb1('0x1f')][_0xbdb1('0x13')]);_0x10a22d[_0xbdb1('0x12')]=qs[_0xbdb1('0x12')](_0x444da5[_0xbdb1('0x1f')][_0xbdb1('0x12')]);}_0x10a22d[_0xbdb1('0x7f')]=qs[_0xbdb1('0x80')](_0x444da5[_0xbdb1('0x1f')][_0xbdb1('0x80')]);_0x10a22d[_0xbdb1('0x5a')]=qs[_0xbdb1('0x7b')](_['pick'](_0x444da5[_0xbdb1('0x1f')],_0x524357[_0xbdb1('0x7b')]));_0x10a22d['where'][_0xbdb1('0x9d')]=_0x2f7639['id'];if(_0x444da5['query'][_0xbdb1('0x99')]){_0x10a22d[_0xbdb1('0x5a')]=_[_0xbdb1('0x33')](_0x10a22d[_0xbdb1('0x5a')],{'$or':_['map'](_0x10a22d[_0xbdb1('0x7e')],function(_0x276e81){var _0x332cab={};_0x332cab[_0x276e81]={'$like':'%'+_0x444da5[_0xbdb1('0x1f')][_0xbdb1('0x99')]+'%'};return _0x332cab;})});}_0x10a22d=_[_0xbdb1('0x33')]({},_0x10a22d,_0x444da5[_0xbdb1('0x81')]);return db[_0xbdb1('0x50')][_0xbdb1('0x15')]({'where':_0x10a22d[_0xbdb1('0x5a')]})[_0xbdb1('0x1a')](function(_0x59d5bd){_0x2d5d1c[_0xbdb1('0x15')]=_0x59d5bd;if(_0x444da5[_0xbdb1('0x1f')][_0xbdb1('0x9a')]){_0x10a22d[_0xbdb1('0x9e')]=[{'all':!![]}];}return db[_0xbdb1('0x50')]['findAll'](_0x10a22d);})[_0xbdb1('0x1a')](function(_0x24f512){_0x2d5d1c[_0xbdb1('0x9b')]=_0x24f512;return _0x2d5d1c;});}})['then'](respondWithFilteredResult(_0x592db8,_0x10a22d))['catch'](handleError(_0x592db8,null));};exports[_0xbdb1('0xa0')]=function(_0x44b592,_0x2dd96e){try{if(!_0x44b592['body'][_0xbdb1('0x5d')]){throw new Error(_0xbdb1('0xa1'));}if(!_0x44b592['body'][_0xbdb1('0xa2')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x44b592[_0xbdb1('0x34')][_0xbdb1('0xa3')]){throw new Error(_0xbdb1('0xa4'));}if(!_0x44b592['body'][_0xbdb1('0xa5')]){throw new Error(_0xbdb1('0xa6'));}var _0x19ae11=_0x44b592[_0xbdb1('0x34')][_0xbdb1('0xa2')][_0xbdb1('0xa7')](',');var _0x15e66c=_0x44b592[_0xbdb1('0x34')]['binding_values']['split'](',');if(!_0x19ae11[_0xbdb1('0x27')]||!_0x15e66c[_0xbdb1('0x27')]||_0x19ae11['length']!==_0x15e66c[_0xbdb1('0x27')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x44b592[_0xbdb1('0x34')][_0xbdb1('0x7d')]=_[_0xbdb1('0xa8')](_0x19ae11,_0x15e66c);if(!_0x44b592[_0xbdb1('0x34')]['fields'][_0xbdb1('0x77')]){throw new Error(_0xbdb1('0xa9'));}if(!_0x44b592[_0xbdb1('0x34')][_0xbdb1('0x7d')][_0xbdb1('0xaa')]){throw new Error(_0xbdb1('0xab'));}var _0xb01703=path[_0xbdb1('0x38')](config[_0xbdb1('0xac')],_0xbdb1('0xad'),_0x44b592['file'][_0xbdb1('0xae')]);fs[_0xbdb1('0xaf')](_0xb01703,parseInt(_0xbdb1('0xb0'),0x8));var _0x2f9a28=require(_0xbdb1('0xb1'))[_0xbdb1('0xb2')](path[_0xbdb1('0x38')](__dirname,_0xbdb1('0xb3')),[_0xb01703,_0x44b592['body']['binding_keys'],_0x44b592['body']['binding_values'],_0x44b592[_0xbdb1('0x34')][_0xbdb1('0x5d')],_0x44b592[_0xbdb1('0x34')][_0xbdb1('0xb4')],_0x44b592[_0xbdb1('0x34')][_0xbdb1('0x59')],_0x44b592[_0xbdb1('0x34')]['socket_timestamp']]);return _0x2dd96e['status'](0xc8)['json']({'message':'File\x20uploaded\x20correctly!','pid':_0x2f9a28[_0xbdb1('0xb5')]});}catch(_0x8faa96){return _0x2dd96e[_0xbdb1('0x16')](0x1f4)[_0xbdb1('0x1d')](_0x8faa96);}};exports[_0xbdb1('0xb6')]=function(_0x1acfee,_0x768cc9){var _0x17e8a0=fs['createReadStream'](_0x1acfee[_0xbdb1('0xb7')][_0xbdb1('0x1')]);Papa['parse'](_0x17e8a0,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x2432bd){return _0x768cc9[_0xbdb1('0x16')](0xc8)[_0xbdb1('0x11')]({'file':_0x1acfee[_0xbdb1('0xb7')],'fields':_0x2432bd[_0xbdb1('0xb8')][_0xbdb1('0x7d')]});}});};exports['import']=function(_0xdd757,_0x400e52){return db[_0xbdb1('0xb9')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xbdb1('0xba')}})[_0xbdb1('0x1a')](function(_0x32bdfc){var _0x209a09=![];if(!_0xdd757[_0xbdb1('0x34')][_0xbdb1('0x5d')]){throw new Error(_0xbdb1('0xa1'));}if(!_0xdd757[_0xbdb1('0x34')][_0xbdb1('0xbb')]['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0xdd757[_0xbdb1('0x34')]['binding'][_0xbdb1('0xaa')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0xdd757[_0xbdb1('0x34')][_0xbdb1('0xa5')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x25468a=require('child_process')[_0xbdb1('0xb2')](path[_0xbdb1('0x38')](__dirname,_0xbdb1('0xbc')),[_0xdd757['params']['id'],JSON[_0xbdb1('0xbd')](_0xdd757[_0xbdb1('0x34')]),JSON[_0xbdb1('0xbd')](_0x32bdfc)]);_0x25468a['on']('message',function(){_0x209a09=!![];return _0x400e52['status'](0xc8)[_0xbdb1('0x11')]({'message':_0xbdb1('0xbe'),'pid':_0x25468a['pid']});});_0x25468a['on'](_0xbdb1('0xbf'),function(_0x5ebff9){if(_0x5ebff9&&!_0x209a09){return _0x400e52[_0xbdb1('0x16')](0x1f4)[_0xbdb1('0x11')]({'message':'error\x20child\x20process','pid':_0x25468a[_0xbdb1('0xb5')]});}});})['catch'](handleError(_0x400e52,null));};exports[_0xbdb1('0xc0')]=function(_0xc529b,_0x2a8382){return db['User'][_0xbdb1('0x2d')]({'raw':!![],'attributes':['id'],'where':{'role':_0xbdb1('0xba')}})[_0xbdb1('0x1a')](function(_0x428f99){var _0x1d8a8a=![];if(!_0xc529b[_0xbdb1('0x34')][_0xbdb1('0x5d')]){throw new Error('No\x20ListId\x20specified');}if(!_0xc529b[_0xbdb1('0x34')][_0xbdb1('0xbb')]['phone']){throw new Error(_0xbdb1('0xa9'));}if(!_0xc529b[_0xbdb1('0x34')][_0xbdb1('0xbb')][_0xbdb1('0xaa')]){throw new Error(_0xbdb1('0xab'));}if(!_0xc529b[_0xbdb1('0x34')]['socket_timestamp']){throw new Error(_0xbdb1('0xa6'));}var _0x48bd4c=require(_0xbdb1('0xb1'))[_0xbdb1('0xb2')](path[_0xbdb1('0x38')](__dirname,_0xbdb1('0xc1')),[_0xc529b[_0xbdb1('0x61')]['id'],JSON['stringify'](_0xc529b[_0xbdb1('0x34')]),JSON[_0xbdb1('0xbd')](_0x428f99)]);_0x48bd4c['on'](_0xbdb1('0xc2'),function(){_0x1d8a8a=!![];return _0x2a8382[_0xbdb1('0x16')](0xc8)[_0xbdb1('0x11')]({'message':_0xbdb1('0xbe'),'pid':_0x48bd4c[_0xbdb1('0xb5')]});});_0x48bd4c['on'](_0xbdb1('0xbf'),function(_0x2a1f87){if(_0x2a1f87&&!_0x1d8a8a){return _0x2a8382[_0xbdb1('0x16')](0x1f4)[_0xbdb1('0x11')]({'message':_0xbdb1('0xc3'),'pid':_0x48bd4c['pid']});}});})['catch'](handleError(_0x2a8382,null));};exports['getJourney']=function(_0x49ace0,_0x562a2e){var _0x399079=['mail','chat',_0xbdb1('0xc4'),_0xbdb1('0xc5'),_0xbdb1('0xc6'),_0xbdb1('0xc7'),_0xbdb1('0xc8')];var _0x2098f8={'offset':0x0,'order':qs[_0xbdb1('0x80')](_0xbdb1('0xc9'))},_0x583010={'count':0x0,'rows':[]};Promise[_0xbdb1('0xca')]()['then'](function(){if(_0x49ace0[_0xbdb1('0x1f')]['channel']){if(!_[_0xbdb1('0xcb')](_0x399079,_0x49ace0[_0xbdb1('0x1f')][_0xbdb1('0xcc')][_0xbdb1('0xcd')]())){throw new Error('Invalid\x20channel');}_0x399079=[_0x49ace0['query']['channel'][_0xbdb1('0xcd')]()];}if(_0x49ace0[_0xbdb1('0x1f')]['range']){try{var _0x542746=JSON[_0xbdb1('0xce')](_0x49ace0['query'][_0xbdb1('0xcf')]);if(!moment(_0x542746[_0xbdb1('0x3a')])[_0xbdb1('0xd0')]()){throw new Error(_0xbdb1('0xd1'));}if(!moment(_0x542746['to'])['isValid']()){throw new Error(_0xbdb1('0xd2'));}}catch(_0x3d1443){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x49ace0['query'][_0xbdb1('0x5f')](_0xbdb1('0x82'))){_0x2098f8[_0xbdb1('0x13')]=qs[_0xbdb1('0x13')](_0x49ace0[_0xbdb1('0x1f')]['limit']||0xa);_0x2098f8['offset']=qs[_0xbdb1('0x12')](_0x49ace0['query'][_0xbdb1('0x12')]);}var _0x4b4aab=_0x399079[_0xbdb1('0x6c')](function(_0x3ec5f2){if(_0x3ec5f2===_0xbdb1('0xc8')){var _0x2e0de4={'attributes':['id','uniqueid',_0xbdb1('0x2f'),_0xbdb1('0xd3'),'destination',_0xbdb1('0xd4'),_0xbdb1('0xd5'),_0xbdb1('0xd6'),'duration',_0xbdb1('0xd7'),_0xbdb1('0xd8'),'userDisposition',_0xbdb1('0xd9'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x49ace0[_0xbdb1('0x61')]['id']},'include':[{'model':db[_0xbdb1('0xb9')],'as':_0xbdb1('0xb9'),'attributes':['id',_0xbdb1('0x64'),_0xbdb1('0xda'),'alias']}],'order':[['createdAt','DESC']]};if(_0x49ace0[_0xbdb1('0x1f')][_0xbdb1('0xcf')]){_0x2e0de4['where'][_0xbdb1('0xd8')]={'$gte':_0x542746[_0xbdb1('0x3a')],'$lte':_0x542746['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x2e0de4)[_0xbdb1('0x1a')](function(_0x5f38db){_0x583010['count']+=_0x5f38db[_0xbdb1('0x15')];return _[_0xbdb1('0x6c')](_0x5f38db[_0xbdb1('0x9b')],function(_0x4d435d){var _0x4f842=_0x4d435d[_0xbdb1('0x35')]({'plain':!![]});_0x4f842[_0xbdb1('0xcc')]=_0x3ec5f2;if(_0x4f842[_0xbdb1('0xb9')]){_0x4f842[_0xbdb1('0xb9')]={'id':_0x4f842['User']['id'],'name':_0x4f842[_0xbdb1('0xb9')][_0xbdb1('0x64')],'fullname':_0x4f842[_0xbdb1('0xb9')]['fullname'],'alias':_0x4f842[_0xbdb1('0xb9')]['alias']};}return _0x4f842;});});}else{var _0x2e7c10=_[_0xbdb1('0xdb')](_0x3ec5f2)+(_0x3ec5f2==='chat'?_0xbdb1('0xdc'):'Account');var _0x2de67e={'attributes':['id',_0xbdb1('0xdd'),_0xbdb1('0xde'),_0xbdb1('0xd8'),'note','disposition',_0xbdb1('0xdf'),_0xbdb1('0xe0'),_0xbdb1('0xe1'),_0x2e7c10+'Id'],'where':{'ContactId':_0x49ace0[_0xbdb1('0x61')]['id']},'include':[{'model':db[_0x2e7c10],'as':_0xbdb1('0xe2'),'attributes':['id','name',_0xbdb1('0xe3')]},{'model':db[_0xbdb1('0xb9')],'as':_0xbdb1('0xe4'),'attributes':['id',_0xbdb1('0x64'),_0xbdb1('0xda')]},{'model':db[_0xbdb1('0x62')],'as':_0xbdb1('0x63'),'attributes':['id','name',_0xbdb1('0x65')],'through':{'attributes':[]}}],'order':[['createdAt','DESC']]};if(_0x49ace0[_0xbdb1('0x1f')]['range']){_0x2de67e[_0xbdb1('0x5a')][_0xbdb1('0xd8')]={'$gte':_0x542746['from'],'$lte':_0x542746['to']};}switch(_0x3ec5f2){case _0xbdb1('0xe5'):_0x2de67e[_0xbdb1('0x7e')][_0xbdb1('0x5c')](_0xbdb1('0xe6'),_0xbdb1('0xe7'),_0xbdb1('0xe8'),_0xbdb1('0xe9'),'osName',_0xbdb1('0xea'),'ratingType',_0xbdb1('0xeb'),_0xbdb1('0xec'));break;case _0xbdb1('0xed'):_0x2de67e['attributes']['push'](_0xbdb1('0xee'),'substatus');break;case _0xbdb1('0xc5'):_0x2de67e[_0xbdb1('0x7e')]['push'](_0xbdb1('0xef'),_0xbdb1('0xf0'));break;}return db[_[_0xbdb1('0xdb')](_0x3ec5f2)+_0xbdb1('0xf1')][_0xbdb1('0xf2')](_0x2de67e)[_0xbdb1('0x1a')](function(_0x58ba6d){_0x583010[_0xbdb1('0x15')]+=_0x58ba6d['count'];return _['map'](_0x58ba6d[_0xbdb1('0x9b')],function(_0x4b21cf){var _0x175450=_0x4b21cf[_0xbdb1('0x35')]({'plain':!![]});_0x175450[_0xbdb1('0xcc')]=_0x3ec5f2;if(_0x175450[_0xbdb1('0xe4')]){_0x175450[_0xbdb1('0xe4')]={'id':_0x175450[_0xbdb1('0xe4')]['id'],'name':_0x175450[_0xbdb1('0xe4')][_0xbdb1('0x64')],'fullname':_0x175450[_0xbdb1('0xe4')]['fullname']};}return _0x175450;});});}});return Promise['all'](_0x4b4aab);})[_0xbdb1('0x1a')](function(_0x3b5a28){return _(_0x3b5a28)[_0xbdb1('0xf3')]()[_0xbdb1('0xf4')](_0xbdb1('0xd8'))[_0xbdb1('0xf5')]()['value']();})[_0xbdb1('0x1a')](function(_0x2eda2e){_0x583010['rows']=_0x2098f8[_0xbdb1('0x13')]?_0x2eda2e[_0xbdb1('0xf6')](_0x2098f8[_0xbdb1('0x12')],_0x2098f8['offset']+_0x2098f8[_0xbdb1('0x13')]):_0x2eda2e;return _0x583010;})[_0xbdb1('0x1a')](respondWithFilteredResult(_0x562a2e,_0x2098f8))[_0xbdb1('0x21')](handleError(_0x562a2e,null));}; \ No newline at end of file +var _0xfae9=['../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','sendStatus','name','index','describe','getOptions','query','then','catch','destroy','CmContact','find','params','tags','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','length','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','$or','push','where','ListId','spread','hasOwnProperty','contact','all','show','Tag','Tags','tag','ContactItemType','sequelize','literal','Phones.OrderBy','$and','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','sort','pick','filter','options','nolimit','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','ItemType','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','bulkCreate','getAdditionalPhones','PHONE','duplicateAdditionalPhones','fromContactId','toContactId','hopperId','getHoppers','order','ContactId','includeAll','include','rows','getHopperFinals','CmHopperFinal','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','filename','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','file','meta','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','type','source','destination','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','key','Owner','browserName','deviceModel','ratingMessage','ratingType','mail','substatus','Interaction','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x281633,_0xa6166a){var _0x4de759=function(_0x400a42){while(--_0x400a42){_0x281633['push'](_0x281633['shift']());}};_0x4de759(++_0xa6166a);}(_0xfae9,0xeb));var _0x9fae=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0xfae9[_0x395155];return _0x179767;};'use strict';var moment=require(_0x9fae('0x0'));var BPromise=require(_0x9fae('0x1'));var util=require(_0x9fae('0x2'));var path=require(_0x9fae('0x3'));var fs=require('fs');var _=require(_0x9fae('0x4'));var squel=require(_0x9fae('0x5'));var Papa=require('papaparse');var Redis=require(_0x9fae('0x6'));var contacts=require(_0x9fae('0x7'));var qs=require(_0x9fae('0x8'));var logger=require(_0x9fae('0x9'))(_0x9fae('0xa'));var config=require(_0x9fae('0xb'));var shared=require(_0x9fae('0xc'));var db=require(_0x9fae('0xd'))['db'];config[_0x9fae('0xe')]=_[_0x9fae('0xf')](config[_0x9fae('0xe')],{'host':_0x9fae('0x10'),'port':0x18eb});var socket=require(_0x9fae('0x11'))(new Redis(config['redis']));require(_0x9fae('0x12'))[_0x9fae('0x13')](socket);function respondWithResult(_0x22947b,_0x2c337a){_0x2c337a=_0x2c337a||0xc8;return function(_0x2b8882){if(_0x2b8882){return _0x22947b[_0x9fae('0x14')](_0x2c337a)[_0x9fae('0x15')](_0x2b8882);}};}function respondWithFilteredResult(_0x31cfb1,_0x3b2fa3){return function(_0x50552d){if(_0x50552d){var _0x28c31d=typeof _0x3b2fa3[_0x9fae('0x16')]==='undefined'&&typeof _0x3b2fa3[_0x9fae('0x17')]===_0x9fae('0x18');var _0x23b245=_0x50552d[_0x9fae('0x19')];var _0x3618cf=_0x28c31d?0x0:_0x3b2fa3[_0x9fae('0x16')];var _0x3e81a3=_0x28c31d?_0x50552d[_0x9fae('0x19')]:_0x3b2fa3[_0x9fae('0x16')]+_0x3b2fa3[_0x9fae('0x17')];var _0x3e674a;if(_0x3e81a3>=_0x23b245){_0x3e81a3=_0x23b245;_0x3e674a=0xc8;}else{_0x3e674a=0xce;}_0x31cfb1[_0x9fae('0x14')](_0x3e674a);return _0x31cfb1[_0x9fae('0x1a')](_0x9fae('0x1b'),_0x3618cf+'-'+_0x3e81a3+'/'+_0x23b245)[_0x9fae('0x15')](_0x50552d);}return null;};}function saveUpdates(_0x3fb876){return function(_0x1619b9){if(_0x1619b9){return _0x1619b9[_0x9fae('0x1c')](_0x3fb876)['then'](function(_0x3ff865){return _0x3ff865;});}return null;};}function removeEntity(_0x4ccd7d){return function(_0x34c609){if(_0x34c609){return _0x34c609['destroy']()['then'](function(){_0x4ccd7d[_0x9fae('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x311f9a){return function(_0x5ab55a){if(!_0x5ab55a){_0x311f9a[_0x9fae('0x1d')](0x194);}return _0x5ab55a;};}function handleError(_0x12e57f,_0x5b52d4){_0x5b52d4=_0x5b52d4||0x1f4;return function(_0x5160ba){logger['error'](_0x5160ba['stack']);if(_0x5160ba[_0x9fae('0x1e')]){delete _0x5160ba['name'];}_0x12e57f[_0x9fae('0x14')](_0x5b52d4)['send'](_0x5160ba);};}exports[_0x9fae('0x1f')]=function(_0x33166a,_0x1a88ea){var _0x202c81={};return contacts[_0x9fae('0x20')]()['then'](function(_0xf4959c){_0x202c81=qs[_0x9fae('0x21')](_0xf4959c,_0x33166a);return contacts['findAll'](_0x33166a[_0x9fae('0x22')],_0x33166a['user'],_0x202c81,_0xf4959c);})[_0x9fae('0x23')](respondWithFilteredResult(_0x1a88ea,_0x202c81))[_0x9fae('0x24')](handleError(_0x1a88ea,null));};exports[_0x9fae('0x25')]=function(_0x24ff75,_0x2c7e89){return db[_0x9fae('0x26')][_0x9fae('0x27')]({'where':{'id':_0x24ff75[_0x9fae('0x28')]['id']}})['then'](handleEntityNotFound(_0x2c7e89,null))[_0x9fae('0x23')](removeEntity(_0x2c7e89,null))[_0x9fae('0x24')](handleError(_0x2c7e89,null));};exports[_0x9fae('0x20')]=function(_0x973157,_0x3278ab){return db[_0x9fae('0x26')][_0x9fae('0x20')]()[_0x9fae('0x23')](function(_0x426716){delete _0x426716[_0x9fae('0x29')];for(var _0x11bcd7=0x0;_0x11bcd70x0){return new Promise(function(_0x1e9e41){var _0x2cd158=[];for(var _0x58cb9a=0x0;_0x58cb9a<_0x1f9e24[_0x9fae('0x32')];_0x58cb9a++){_0x2cd158[_0x9fae('0x60')](insertAdditionalPhones(_0x1f9e24[_0x58cb9a][_0x9fae('0x65')],_0x1f9e24[_0x58cb9a]['additionalPhones']));}Promise[_0x9fae('0x66')](_0x2cd158)[_0x9fae('0x23')](function(){_0x1e9e41(0x1);});})[_0x9fae('0x23')](function(){return{'success':_0x268612,'failure':_0x5797f9,'duplicates':_0x4013fe};});}else{return{'success':_0x268612,'failure':_0x5797f9,'duplicates':_0x4013fe};}}})['then'](respondWithResult(_0x37a7d9,0xc9))[_0x9fae('0x24')](handleError(_0x37a7d9,null));};exports[_0x9fae('0x67')]=function(_0x164041,_0x14c699){var _0x1b2601;return db[_0x9fae('0x26')]['describe']()[_0x9fae('0x23')](function(_0x261ef4){return db['CmContact'][_0x9fae('0x27')]({'where':{'id':_0x164041[_0x9fae('0x28')]['id']},'include':[{'model':db[_0x9fae('0x68')],'as':_0x9fae('0x69'),'attributes':['id','name','color'],'required':_0x164041[_0x9fae('0x22')][_0x9fae('0x6a')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x164041[_0x9fae('0x28')]['id']},'required':![],'include':[{'model':db[_0x9fae('0x6b')],'as':'ItemType'}]}],'order':[db[_0x9fae('0x6c')][_0x9fae('0x6d')](_0x9fae('0x6e'))],'attributes':_[_0x9fae('0x2a')](_0x261ef4)});})['then'](function(_0x2487e1){if(!_[_0x9fae('0x58')](_0x2487e1)){_0x1b2601=_0x2487e1[_0x9fae('0x3b')]({'plain':!![]});var _0x36ac89={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2487e1&&_0x2487e1[_0x9fae('0x62')]){if(_0x2487e1[_0x9fae('0x62')]){_0x36ac89[_0x9fae('0x61')][_0x9fae('0x6f')][_0x9fae('0x60')]({'ListId':{'$ne':_0x2487e1[_0x9fae('0x62')]}});}}return db['CmCustomField'][_0x9fae('0x31')](_0x36ac89);}})[_0x9fae('0x23')](function(_0x57caab){if(!_['isNil'](_0x57caab)){return _['omit'](_0x1b2601,_[_0x9fae('0x70')](_0x57caab,function(_0x592ed2){return util[_0x9fae('0x71')](_0x9fae('0x72'),_0x592ed2['id']);}));}})[_0x9fae('0x23')](handleEntityNotFound(_0x14c699,null))[_0x9fae('0x23')](respondWithResult(_0x14c699,null))['catch'](handleError(_0x14c699,null));};exports[_0x9fae('0x1c')]=function(_0x1a3982,_0x38cbb9){var _0x2300f9;if(_0x1a3982[_0x9fae('0x39')]['id']){delete _0x1a3982['body']['id'];}if(!_['isNil'](_0x1a3982[_0x9fae('0x39')][_0x9fae('0x59')])){var _0x2a63cb=_0x1a3982[_0x9fae('0x39')][_0x9fae('0x59')];if(!_[_0x9fae('0x58')](shared['timezones'][_0x2a63cb]))_0x1a3982[_0x9fae('0x39')]['utcOffset']=shared[_0x9fae('0x5a')][_0x2a63cb][_0x9fae('0x5b')];}return db['CmContact'][_0x9fae('0x27')]({'where':{'id':_0x1a3982[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x38cbb9,null))[_0x9fae('0x23')](saveUpdates(_0x1a3982[_0x9fae('0x39')],null))[_0x9fae('0x23')](function(_0x37623e){_0x2300f9=_0x37623e;var _0xda02d1={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x37623e&&_0x37623e[_0x9fae('0x62')]){if(_0x37623e[_0x9fae('0x62')]){_0xda02d1[_0x9fae('0x61')]['$and'][_0x9fae('0x60')]({'ListId':{'$ne':_0x37623e[_0x9fae('0x62')]}});}}return db[_0x9fae('0x30')][_0x9fae('0x31')](_0xda02d1);})[_0x9fae('0x23')](function(_0x147883){if(_0x147883){return _[_0x9fae('0x73')](_[_0x9fae('0x74')](_0x1a3982['body'],function(_0x4a5918,_0x2ee4a6){return _[_0x9fae('0x2b')](_0x2ee4a6,_0x9fae('0x2c'));}),_[_0x9fae('0x70')](_0x147883,function(_0x297511){return util[_0x9fae('0x71')]('cf_%d',_0x297511['id']);}));}})['then'](function(_0x44db75){if(_0x44db75&&!_[_0x9fae('0x75')](_0x44db75)){var _0x191a83=squel[_0x9fae('0x1c')]()[_0x9fae('0x76')](_0x9fae('0x77'))[_0x9fae('0x78')](_0x44db75)[_0x9fae('0x61')](_0x9fae('0x79'),_0x1a3982[_0x9fae('0x28')]['id'])['toParam']();return db[_0x9fae('0x6c')]['query'](_0x191a83[_0x9fae('0x7a')],{'replacements':_0x191a83[_0x9fae('0x34')]});}})[_0x9fae('0x23')](function(){if(_0x1a3982['body']['phone']&&_0x2300f9){return db[_0x9fae('0x3f')][_0x9fae('0x1c')]({'phone':_0x1a3982['body'][_0x9fae('0x7b')],'OrderBy':0x0},{'where':{'ContactId':_0x2300f9['id']}});}})[_0x9fae('0x23')](function(){return _0x2300f9;})[_0x9fae('0x23')](respondWithResult(_0x38cbb9,null))[_0x9fae('0x24')](handleError(_0x38cbb9,null));};exports[_0x9fae('0x7c')]=function(_0x5f4ff6,_0x33c474){var _0x164ca1={};var _0xe18bde={};var _0x118621;var _0x10db4f;return db['CmContact'][_0x9fae('0x7d')]({'where':{'id':_0x5f4ff6[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x33c474,null))['then'](function(_0x5d9a6c){if(_0x5d9a6c){_0x118621=_0x5d9a6c;_0xe18bde[_0x9fae('0x7e')]=_[_0x9fae('0x2a')](db['Tag'][_0x9fae('0x7f')]);_0xe18bde['query']=_[_0x9fae('0x2a')](_0x5f4ff6[_0x9fae('0x22')]);_0xe18bde[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0xe18bde[_0x9fae('0x7e')],_0xe18bde[_0x9fae('0x22')]);_0x164ca1[_0x9fae('0x82')]=_[_0x9fae('0x81')](_0xe18bde[_0x9fae('0x7e')],qs['fields'](_0x5f4ff6['query'][_0x9fae('0x83')]));_0x164ca1[_0x9fae('0x82')]=_0x164ca1[_0x9fae('0x82')][_0x9fae('0x32')]?_0x164ca1[_0x9fae('0x82')]:_0xe18bde[_0x9fae('0x7e')];_0x164ca1['order']=qs[_0x9fae('0x84')](_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x84')]);_0x164ca1[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_[_0x9fae('0x85')](_0x5f4ff6[_0x9fae('0x22')],_0xe18bde['filters']));if(_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x86')]){_0x164ca1['where']=_['merge'](_0x164ca1['where'],{'$or':_[_0x9fae('0x70')](_0x164ca1[_0x9fae('0x82')],function(_0xfce9c3){var _0x1d6a05={};_0x1d6a05[_0xfce9c3]={'$like':'%'+_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x86')]+'%'};return _0x1d6a05;})});}_0x164ca1=_[_0x9fae('0x38')]({},_0x164ca1,_0x5f4ff6[_0x9fae('0x87')]);return _0x118621[_0x9fae('0x7c')](_0x164ca1);}})[_0x9fae('0x23')](function(_0x2cf629){if(_0x2cf629){_0x10db4f=_0x2cf629[_0x9fae('0x32')];if(!_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x164ca1[_0x9fae('0x17')]=qs[_0x9fae('0x17')](_0x5f4ff6[_0x9fae('0x22')]['limit']);_0x164ca1['offset']=qs[_0x9fae('0x16')](_0x5f4ff6[_0x9fae('0x22')][_0x9fae('0x16')]);}return _0x118621[_0x9fae('0x7c')](_0x164ca1);}})[_0x9fae('0x23')](function(_0x4bc414){if(_0x4bc414){return _0x4bc414?{'count':_0x10db4f,'rows':_0x4bc414}:null;}})[_0x9fae('0x23')](respondWithResult(_0x33c474,null))[_0x9fae('0x24')](handleError(_0x33c474,null));};exports[_0x9fae('0x89')]=function(_0x4a65a3,_0x305765){if(_0x4a65a3[_0x9fae('0x39')]['id']){delete _0x4a65a3[_0x9fae('0x39')]['id'];}return db[_0x9fae('0x26')][_0x9fae('0x7d')]({'where':{'id':_0x4a65a3[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x305765,null))[_0x9fae('0x23')](function(_0x5c66da){if(_0x5c66da){return _0x5c66da[_0x9fae('0x89')](_0x4a65a3[_0x9fae('0x39')][_0x9fae('0x8a')]||[]);}return null;})[_0x9fae('0x23')](respondWithResult(_0x305765,null))['catch'](handleError(_0x305765,null));};exports['setAdditionalPhones']=function(_0x4fdc85,_0x3ffbc0){var _0x3b1eb0=[];_0x3b1eb0[_0x9fae('0x60')](addAdditionalPhones(_0x4fdc85[_0x9fae('0x39')]));Promise[_0x9fae('0x66')](_0x3b1eb0)[_0x9fae('0x23')](function(){_0x3b1eb0=[];_0x3b1eb0[_0x9fae('0x60')](deleteCmHopperPhones(_0x4fdc85[_0x9fae('0x39')]['id']));_0x3b1eb0[_0x9fae('0x60')](addCmHopperPhones(_0x4fdc85[_0x9fae('0x39')]['id']));Promise[_0x9fae('0x66')](_0x3b1eb0)['then'](function(){return[0x1];})[_0x9fae('0x23')](respondWithResult(_0x3ffbc0,null));});};function addAdditionalPhones(_0x227b0d){var _0x7ae82e;return new Promise(function(_0x588de4){return db[_0x9fae('0x4c')][_0x9fae('0x25')]({'where':{'CmContactId':_0x227b0d['id']}})[_0x9fae('0x23')](function(){db[_0x9fae('0x6b')][_0x9fae('0x31')]({'raw':!![],'attributes':['id',_0x9fae('0x8b')]})['then'](function(_0x2cc3df){var _0x2b1181=[];for(var _0x4046bd=0x0;_0x4046bd<_0x227b0d[_0x9fae('0x8c')]['length'];_0x4046bd++){var _0x4c29b6=_0x227b0d[_0x9fae('0x8d')]?_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8d')][_0x4046bd])?'':_0x227b0d['item_types'][_0x4046bd]:_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]?_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]:'';var _0x7eb5c3=_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8f')])?'':_0x227b0d['items'][_0x4046bd][_0x9fae('0x8f')];var _0x5b0024=_0x4c29b6+':'+_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x7b')]+'§'+_0x7eb5c3;if(_[_0x9fae('0x58')](_0x7ae82e))_0x7ae82e=_0x5b0024;else _0x7ae82e+=';'+_0x5b0024;var _0x3ef87d=null;var _0x4eff42=null;if(_0x227b0d[_0x9fae('0x8d')]){if(!_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8d')][_0x4046bd])){_0x4eff42=_[_0x9fae('0x27')](_0x2cc3df,function(_0x13984e){return _0x13984e['id']===_0x227b0d[_0x9fae('0x8d')][_0x4046bd];});if(!_['isNil'](_0x4eff42)){_0x3ef87d=_0x4eff42[_0x9fae('0x8b')];}}}else{if(!_['isNil'](_0x227b0d[_0x9fae('0x8c')][_0x4046bd])){_0x4eff42=_[_0x9fae('0x27')](_0x2cc3df,function(_0x34a204){return _0x34a204['id']===_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')];});if(!_[_0x9fae('0x58')](_0x4eff42)){_0x3ef87d=_0x4046bd;}}}if(_[_0x9fae('0x58')](_0x3ef87d)){_0x3ef87d=0x64;}_0x2b1181['push'](addAdditionalPhone(_0x227b0d['id'],_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x7b')],_0x227b0d[_0x9fae('0x8d')]?_[_0x9fae('0x58')](_0x227b0d[_0x9fae('0x8d')][_0x4046bd])?null:_0x227b0d[_0x9fae('0x8d')][_0x4046bd]:_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]?_0x227b0d[_0x9fae('0x8c')][_0x4046bd][_0x9fae('0x8e')]:null,_0x3ef87d,_0x7eb5c3));}Promise[_0x9fae('0x66')](_0x2b1181)[_0x9fae('0x23')](function(){db[_0x9fae('0x26')][_0x9fae('0x1c')]({'AdditionalPhones':_0x7ae82e},{'where':{'id':_0x227b0d['id']}})[_0x9fae('0x23')](function(){_0x588de4(0x1);});});});});});}function addAdditionalPhone(_0x52b5c6,_0x4480a7,_0x5ad240,_0x4252b5,_0x2b5073){return db[_0x9fae('0x4c')][_0x9fae('0x27')]({'where':{'CmContactId':_0x52b5c6,'item':_0x4480a7}})[_0x9fae('0x23')](function(_0x559249){if(_0x559249)logger[_0x9fae('0x35')](_0x9fae('0x90'),_0x559249);else{db[_0x9fae('0x4c')][_0x9fae('0x42')]({'CmContactId':_0x52b5c6,'item':_0x4480a7,'ItemTypeId':_0x5ad240,'OrderBy':_0x4252b5,'ItemClass':'PHONE','description':_0x2b5073});}});}function deleteCmHopperPhones(_0x629e0a){return new Promise(function(_0x13c0b4){return db[_0x9fae('0x3f')][_0x9fae('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x629e0a}})[_0x9fae('0x23')](function(_0x4e7acf){db[_0x9fae('0x91')][_0x9fae('0x25')]({'where':{'CmHopperId':{'$in':_[_0x9fae('0x70')](_0x4e7acf,'id')}}});})['then'](function(){_0x13c0b4(0x1);});});}function addCmHopperPhones(_0x37c9ec){return new Promise(function(_0x4868be){return db['CmHopper'][_0x9fae('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x37c9ec}})[_0x9fae('0x23')](function(_0x4c0a72){var _0x42a7a8=[];_[_0x9fae('0x70')](_0x4c0a72,function(_0x332c7a){_0x42a7a8['push'](createCmHopperPhone(_0x37c9ec,_0x332c7a['id']));});Promise[_0x9fae('0x66')](_0x42a7a8)[_0x9fae('0x23')](function(){_0x4868be(0x1);});});});}function createCmHopperPhone(_0x42be53,_0x1a86d3){return new Promise(function(_0x499468){db[_0x9fae('0x4c')]['findAll']({'raw':!![],'attributes':['item','OrderBy'],'where':{'CmContactId':_0x42be53,'ItemClass':'PHONE'},'include':[{'model':db[_0x9fae('0x6b')],'attributes':['OrderBy'],'as':_0x9fae('0x92')}],'order':[_0x9fae('0x8b'),db[_0x9fae('0x6c')]['literal'](_0x9fae('0x93'))]})[_0x9fae('0x23')](function(_0x22df3f){var _0xea3284=0x1;var _0x41353a=_[_0x9fae('0x70')](_0x22df3f,function(_0x552d21){_0x552d21[_0x9fae('0x94')]=_0x1a86d3;_0x552d21[_0x9fae('0x7b')]=_0x552d21[_0x9fae('0x95')];_0x552d21[_0x9fae('0x8b')]=_0xea3284;delete _0x552d21[_0x9fae('0x96')];_0xea3284=_0xea3284+0x1;return _0x552d21;});return db[_0x9fae('0x91')][_0x9fae('0x97')](_0x41353a,{});})['then'](function(){_0x499468(0x1);});});}function insertAdditionalPhones(_0x8e70e3,_0x21b7d0){return new Promise(function(_0x557d6a){var _0x3542a9=[];for(var _0x55f7a9=0x0;_0x55f7a9<_0x21b7d0[_0x9fae('0x32')];_0x55f7a9++){var _0x1b86e1=_0x21b7d0[_0x55f7a9];_0x3542a9[_0x9fae('0x60')](parseContactItemType(_0x1b86e1));}Promise[_0x9fae('0x66')](_0x3542a9)[_0x9fae('0x23')](function(){var _0x38e09c={'id':_0x8e70e3['id'],'items':_0x21b7d0};return addAdditionalPhones(_0x38e09c)[_0x9fae('0x23')](function(){return addCmHopperPhones(_0x8e70e3['id']);});})['then'](function(){_0x557d6a(_0x8e70e3);});});}function parseContactItemType(_0x745792){return new Promise(function(_0xc8ebd4){if(_0x745792['hasOwnProperty']('ItemTypeId')){_0xc8ebd4(_0x745792);}else{return db['ContactItemType']['find']({'where':{'name':_0x745792[_0x9fae('0x92')]}})[_0x9fae('0x23')](function(_0x5c31f0){if(_[_0x9fae('0x58')](_0x5c31f0))_0x745792[_0x9fae('0x8e')]=null;else _0x745792[_0x9fae('0x8e')]=_0x5c31f0['id'];_0xc8ebd4(_0x745792);});}});}exports[_0x9fae('0x98')]=function(_0x2e8779,_0x4952e6){return db[_0x9fae('0x4c')][_0x9fae('0x31')]({'raw':!![],'where':{'CmContactId':_0x2e8779[_0x9fae('0x28')]['id'],'ItemClass':_0x9fae('0x99')},'include':[{'model':db[_0x9fae('0x6b')],'as':_0x9fae('0x92')}],'order':[['OrderBy'],[db[_0x9fae('0x6c')][_0x9fae('0x6d')](_0x9fae('0x93'))]]})['then'](function(_0x6fbd23){return _0x6fbd23;})[_0x9fae('0x23')](respondWithResult(_0x4952e6,null))[_0x9fae('0x24')](handleError(_0x4952e6,null));};exports[_0x9fae('0x9a')]=function(_0x4fce3b,_0x401da0){return db[_0x9fae('0x4c')]['findAll']({'raw':!![],'where':{'CmContactId':_0x4fce3b[_0x9fae('0x39')][_0x9fae('0x9b')]}})[_0x9fae('0x23')](function(_0x373cdc){var _0x508f85=_['map'](_0x373cdc,function(_0xbf31c3){_0xbf31c3['CmContactId']=_0x4fce3b[_0x9fae('0x39')][_0x9fae('0x9c')];return _0xbf31c3;});return db[_0x9fae('0x4c')][_0x9fae('0x97')](_0x508f85,{});})['then'](function(){return addCmHopperPhones(_0x4fce3b[_0x9fae('0x39')][_0x9fae('0x9c')]);})[_0x9fae('0x23')](function(){return['ok'];})[_0x9fae('0x23')](respondWithResult(_0x401da0,null))[_0x9fae('0x24')](handleError(_0x401da0,null));};exports['rescheduleAdditionalPhones']=function(_0x536aff,_0x51ffcd){var _0x23545f=[];_0x23545f['push'](createCmHopperPhone(_0x536aff[_0x9fae('0x39')]['id'],_0x536aff[_0x9fae('0x39')][_0x9fae('0x9d')]));Promise['all'](_0x23545f)['then'](function(){return[0x1];})['then'](respondWithResult(_0x51ffcd,null));};exports[_0x9fae('0x9e')]=function(_0x33a431,_0x4f31ea){var _0x493485={'raw':![],'where':{}};var _0x28a126={};var _0x314e07={'count':0x0,'rows':[]};return db[_0x9fae('0x26')][_0x9fae('0x7d')]({'where':{'id':_0x33a431['params']['id']}})['then'](handleEntityNotFound(_0x4f31ea,null))['then'](function(_0x590919){if(_0x590919){_0x28a126[_0x9fae('0x7e')]=_['keys'](db['CmHopper']['rawAttributes']);_0x28a126[_0x9fae('0x22')]=_['keys'](_0x33a431[_0x9fae('0x22')]);_0x28a126[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x28a126[_0x9fae('0x7e')],_0x28a126[_0x9fae('0x22')]);_0x493485['attributes']=_[_0x9fae('0x81')](_0x28a126['model'],qs[_0x9fae('0x83')](_0x33a431[_0x9fae('0x22')]['fields']));_0x493485[_0x9fae('0x82')]=_0x493485[_0x9fae('0x82')][_0x9fae('0x32')]?_0x493485[_0x9fae('0x82')]:_0x28a126[_0x9fae('0x7e')];if(!_0x33a431[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x493485[_0x9fae('0x17')]=qs[_0x9fae('0x17')](_0x33a431[_0x9fae('0x22')][_0x9fae('0x17')]);_0x493485[_0x9fae('0x16')]=qs[_0x9fae('0x16')](_0x33a431[_0x9fae('0x22')][_0x9fae('0x16')]);}_0x493485[_0x9fae('0x9f')]=qs['sort'](_0x33a431[_0x9fae('0x22')][_0x9fae('0x84')]);_0x493485[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_['pick'](_0x33a431[_0x9fae('0x22')],_0x28a126['filters']));_0x493485[_0x9fae('0x61')][_0x9fae('0xa0')]=_0x590919['id'];if(_0x33a431[_0x9fae('0x22')][_0x9fae('0x86')]){_0x493485[_0x9fae('0x61')]=_[_0x9fae('0x38')](_0x493485[_0x9fae('0x61')],{'$or':_[_0x9fae('0x70')](_0x493485['attributes'],function(_0x19512b){var _0xf71d87={};_0xf71d87[_0x19512b]={'$like':'%'+_0x33a431[_0x9fae('0x22')][_0x9fae('0x86')]+'%'};return _0xf71d87;})});}_0x493485=_[_0x9fae('0x38')]({},_0x493485,_0x33a431[_0x9fae('0x87')]);return db[_0x9fae('0x3f')][_0x9fae('0x19')]({'where':_0x493485['where']})[_0x9fae('0x23')](function(_0x5ee212){_0x314e07['count']=_0x5ee212;if(_0x33a431[_0x9fae('0x22')][_0x9fae('0xa1')]){_0x493485[_0x9fae('0xa2')]=[{'all':!![]}];}return db[_0x9fae('0x3f')][_0x9fae('0x31')](_0x493485);})[_0x9fae('0x23')](function(_0x10e87c){_0x314e07[_0x9fae('0xa3')]=_0x10e87c;return _0x314e07;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x4f31ea,_0x493485))[_0x9fae('0x24')](handleError(_0x4f31ea,null));};exports['getHopperHistories']=function(_0x272f39,_0x6a0b54){var _0x3a6feb={'raw':!![],'where':{}};var _0x3f01e0={};var _0x5e376e={'count':0x0,'rows':[]};return db[_0x9fae('0x26')][_0x9fae('0x7d')]({'where':{'id':_0x272f39[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x6a0b54,null))[_0x9fae('0x23')](function(_0x214651){if(_0x214651){_0x3f01e0[_0x9fae('0x7e')]=_[_0x9fae('0x2a')](db[_0x9fae('0x4d')][_0x9fae('0x7f')]);_0x3f01e0[_0x9fae('0x22')]=_[_0x9fae('0x2a')](_0x272f39[_0x9fae('0x22')]);_0x3f01e0[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x3f01e0[_0x9fae('0x7e')],_0x3f01e0[_0x9fae('0x22')]);_0x3a6feb['attributes']=_[_0x9fae('0x81')](_0x3f01e0[_0x9fae('0x7e')],qs[_0x9fae('0x83')](_0x272f39[_0x9fae('0x22')][_0x9fae('0x83')]));_0x3a6feb[_0x9fae('0x82')]=_0x3a6feb[_0x9fae('0x82')][_0x9fae('0x32')]?_0x3a6feb[_0x9fae('0x82')]:_0x3f01e0[_0x9fae('0x7e')];if(!_0x272f39[_0x9fae('0x22')][_0x9fae('0x64')]('nolimit')){_0x3a6feb[_0x9fae('0x17')]=qs[_0x9fae('0x17')](_0x272f39[_0x9fae('0x22')][_0x9fae('0x17')]);_0x3a6feb[_0x9fae('0x16')]=qs[_0x9fae('0x16')](_0x272f39[_0x9fae('0x22')]['offset']);}_0x3a6feb[_0x9fae('0x9f')]=qs[_0x9fae('0x84')](_0x272f39[_0x9fae('0x22')][_0x9fae('0x84')]);_0x3a6feb[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_['pick'](_0x272f39[_0x9fae('0x22')],_0x3f01e0[_0x9fae('0x80')]));_0x3a6feb['where'][_0x9fae('0xa0')]=_0x214651['id'];if(_0x272f39['query']['filter']){_0x3a6feb[_0x9fae('0x61')]=_[_0x9fae('0x38')](_0x3a6feb['where'],{'$or':_['map'](_0x3a6feb[_0x9fae('0x82')],function(_0x3bd1ee){var _0x2142b2={};_0x2142b2[_0x3bd1ee]={'$like':'%'+_0x272f39['query'][_0x9fae('0x86')]+'%'};return _0x2142b2;})});}_0x3a6feb=_[_0x9fae('0x38')]({},_0x3a6feb,_0x272f39['options']);return db[_0x9fae('0x4d')][_0x9fae('0x19')]({'where':_0x3a6feb['where']})['then'](function(_0x369a1f){_0x5e376e[_0x9fae('0x19')]=_0x369a1f;if(_0x272f39[_0x9fae('0x22')][_0x9fae('0xa1')]){_0x3a6feb[_0x9fae('0xa2')]=[{'all':!![]}];}return db[_0x9fae('0x4d')][_0x9fae('0x31')](_0x3a6feb);})[_0x9fae('0x23')](function(_0x943352){_0x5e376e['rows']=_0x943352;return _0x5e376e;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x6a0b54,_0x3a6feb))[_0x9fae('0x24')](handleError(_0x6a0b54,null));};exports[_0x9fae('0xa4')]=function(_0x456265,_0x4cd831){var _0x272bbc={'raw':!![],'where':{}};var _0x3f606d={};var _0x199a24={'count':0x0,'rows':[]};return db['CmContact'][_0x9fae('0x7d')]({'where':{'id':_0x456265[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x4cd831,null))[_0x9fae('0x23')](function(_0x5be014){if(_0x5be014){_0x3f606d['model']=_[_0x9fae('0x2a')](db['CmHopperFinal'][_0x9fae('0x7f')]);_0x3f606d[_0x9fae('0x22')]=_[_0x9fae('0x2a')](_0x456265[_0x9fae('0x22')]);_0x3f606d[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x3f606d[_0x9fae('0x7e')],_0x3f606d[_0x9fae('0x22')]);_0x272bbc[_0x9fae('0x82')]=_[_0x9fae('0x81')](_0x3f606d[_0x9fae('0x7e')],qs[_0x9fae('0x83')](_0x456265[_0x9fae('0x22')][_0x9fae('0x83')]));_0x272bbc[_0x9fae('0x82')]=_0x272bbc[_0x9fae('0x82')][_0x9fae('0x32')]?_0x272bbc[_0x9fae('0x82')]:_0x3f606d['model'];if(!_0x456265['query'][_0x9fae('0x64')](_0x9fae('0x88'))){_0x272bbc[_0x9fae('0x17')]=qs['limit'](_0x456265[_0x9fae('0x22')][_0x9fae('0x17')]);_0x272bbc['offset']=qs[_0x9fae('0x16')](_0x456265['query'][_0x9fae('0x16')]);}_0x272bbc[_0x9fae('0x9f')]=qs[_0x9fae('0x84')](_0x456265[_0x9fae('0x22')]['sort']);_0x272bbc['where']=qs['filters'](_[_0x9fae('0x85')](_0x456265['query'],_0x3f606d['filters']));_0x272bbc[_0x9fae('0x61')][_0x9fae('0xa0')]=_0x5be014['id'];if(_0x456265[_0x9fae('0x22')][_0x9fae('0x86')]){_0x272bbc[_0x9fae('0x61')]=_[_0x9fae('0x38')](_0x272bbc['where'],{'$or':_[_0x9fae('0x70')](_0x272bbc[_0x9fae('0x82')],function(_0x537869){var _0x33ba15={};_0x33ba15[_0x537869]={'$like':'%'+_0x456265[_0x9fae('0x22')][_0x9fae('0x86')]+'%'};return _0x33ba15;})});}_0x272bbc=_[_0x9fae('0x38')]({},_0x272bbc,_0x456265[_0x9fae('0x87')]);return db[_0x9fae('0xa5')][_0x9fae('0x19')]({'where':_0x272bbc['where']})[_0x9fae('0x23')](function(_0x5f4c4a){_0x199a24[_0x9fae('0x19')]=_0x5f4c4a;if(_0x456265['query']['includeAll']){_0x272bbc[_0x9fae('0xa2')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9fae('0x31')](_0x272bbc);})[_0x9fae('0x23')](function(_0x17fa9e){_0x199a24[_0x9fae('0xa3')]=_0x17fa9e;return _0x199a24;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x4cd831,_0x272bbc))[_0x9fae('0x24')](handleError(_0x4cd831,null));};exports['getJscriptySessions']=function(_0x498597,_0x432b60){var _0x213afc={'raw':!![],'where':{}};var _0x36a200={};var _0x231180={'count':0x0,'rows':[]};return db[_0x9fae('0x26')]['findOne']({'where':{'id':_0x498597[_0x9fae('0x28')]['id']}})[_0x9fae('0x23')](handleEntityNotFound(_0x432b60,null))[_0x9fae('0x23')](function(_0x1fb2bd){if(_0x1fb2bd){_0x36a200[_0x9fae('0x7e')]=_[_0x9fae('0x2a')](db[_0x9fae('0x54')]['rawAttributes']);_0x36a200[_0x9fae('0x22')]=_[_0x9fae('0x2a')](_0x498597[_0x9fae('0x22')]);_0x36a200[_0x9fae('0x80')]=_[_0x9fae('0x81')](_0x36a200[_0x9fae('0x7e')],_0x36a200[_0x9fae('0x22')]);_0x213afc['attributes']=_[_0x9fae('0x81')](_0x36a200[_0x9fae('0x7e')],qs['fields'](_0x498597[_0x9fae('0x22')][_0x9fae('0x83')]));_0x213afc[_0x9fae('0x82')]=_0x213afc['attributes']['length']?_0x213afc['attributes']:_0x36a200['model'];if(!_0x498597[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x213afc[_0x9fae('0x17')]=qs['limit'](_0x498597['query']['limit']);_0x213afc['offset']=qs[_0x9fae('0x16')](_0x498597[_0x9fae('0x22')]['offset']);}_0x213afc[_0x9fae('0x9f')]=qs[_0x9fae('0x84')](_0x498597['query'][_0x9fae('0x84')]);_0x213afc[_0x9fae('0x61')]=qs[_0x9fae('0x80')](_[_0x9fae('0x85')](_0x498597[_0x9fae('0x22')],_0x36a200['filters']));_0x213afc[_0x9fae('0x61')][_0x9fae('0xa0')]=_0x1fb2bd['id'];if(_0x498597[_0x9fae('0x22')]['filter']){_0x213afc[_0x9fae('0x61')]=_['merge'](_0x213afc[_0x9fae('0x61')],{'$or':_[_0x9fae('0x70')](_0x213afc[_0x9fae('0x82')],function(_0x20059d){var _0x233e94={};_0x233e94[_0x20059d]={'$like':'%'+_0x498597[_0x9fae('0x22')]['filter']+'%'};return _0x233e94;})});}_0x213afc=_[_0x9fae('0x38')]({},_0x213afc,_0x498597[_0x9fae('0x87')]);return db[_0x9fae('0x54')][_0x9fae('0x19')]({'where':_0x213afc[_0x9fae('0x61')]})[_0x9fae('0x23')](function(_0x182af1){_0x231180[_0x9fae('0x19')]=_0x182af1;if(_0x498597['query']['includeAll']){_0x213afc['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x213afc);})[_0x9fae('0x23')](function(_0x50ae74){_0x231180[_0x9fae('0xa3')]=_0x50ae74;return _0x231180;});}})[_0x9fae('0x23')](respondWithFilteredResult(_0x432b60,_0x213afc))[_0x9fae('0x24')](handleError(_0x432b60,null));};exports['uploadCsv']=function(_0x47bf46,_0xfef74){try{if(!_0x47bf46['body'][_0x9fae('0x62')]){throw new Error(_0x9fae('0xa6'));}if(!_0x47bf46['body'][_0x9fae('0xa7')]){throw new Error(_0x9fae('0xa8'));}if(!_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa9')]){throw new Error(_0x9fae('0xaa'));}if(!_0x47bf46['body'][_0x9fae('0xab')]){throw new Error(_0x9fae('0xac'));}var _0x26eb4d=_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa7')][_0x9fae('0xad')](',');var _0x438356=_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa9')][_0x9fae('0xad')](',');if(!_0x26eb4d['length']||!_0x438356[_0x9fae('0x32')]||_0x26eb4d[_0x9fae('0x32')]!==_0x438356['length']){throw new Error(_0x9fae('0xae'));}_0x47bf46[_0x9fae('0x39')]['fields']=_[_0x9fae('0xaf')](_0x26eb4d,_0x438356);if(!_0x47bf46[_0x9fae('0x39')]['fields'][_0x9fae('0x7b')]){throw new Error(_0x9fae('0xb0'));}if(!_0x47bf46['body'][_0x9fae('0x83')][_0x9fae('0xb1')]){throw new Error(_0x9fae('0xb2'));}var _0xa2dee9=path[_0x9fae('0x3d')](config['root'],'server/files/tmp',_0x47bf46['file'][_0x9fae('0xb3')]);fs['chmodSync'](_0xa2dee9,parseInt(_0x9fae('0xb4'),0x8));var _0x3a3f89=require(_0x9fae('0xb5'))[_0x9fae('0xb6')](path['join'](__dirname,_0x9fae('0xb7')),[_0xa2dee9,_0x47bf46[_0x9fae('0x39')][_0x9fae('0xa7')],_0x47bf46[_0x9fae('0x39')]['binding_values'],_0x47bf46[_0x9fae('0x39')][_0x9fae('0x62')],_0x47bf46['body']['CompanyId'],_0x47bf46[_0x9fae('0x39')][_0x9fae('0x5e')],_0x47bf46[_0x9fae('0x39')]['socket_timestamp']]);return _0xfef74[_0x9fae('0x14')](0xc8)[_0x9fae('0x15')]({'message':_0x9fae('0xb8'),'pid':_0x3a3f89[_0x9fae('0xb9')]});}catch(_0x461245){return _0xfef74[_0x9fae('0x14')](0x1f4)[_0x9fae('0xba')](_0x461245);}};exports[_0x9fae('0xbb')]=function(_0x313449,_0x55eb98){var _0x75d419=fs[_0x9fae('0xbc')](_0x313449['file'][_0x9fae('0x3')]);Papa['parse'](_0x75d419,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4213fe){return _0x55eb98[_0x9fae('0x14')](0xc8)['json']({'file':_0x313449[_0x9fae('0xbd')],'fields':_0x4213fe[_0x9fae('0xbe')][_0x9fae('0x83')]});}});};exports['import']=function(_0x5d57e1,_0xe05edb){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9fae('0xbf')}})[_0x9fae('0x23')](function(_0x50f351){var _0x428caf=![];if(!_0x5d57e1[_0x9fae('0x39')][_0x9fae('0x62')]){throw new Error(_0x9fae('0xa6'));}if(!_0x5d57e1['body'][_0x9fae('0xc0')][_0x9fae('0x7b')]){throw new Error(_0x9fae('0xb0'));}if(!_0x5d57e1[_0x9fae('0x39')][_0x9fae('0xc0')][_0x9fae('0xb1')]){throw new Error(_0x9fae('0xb2'));}if(!_0x5d57e1[_0x9fae('0x39')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x231e68=require(_0x9fae('0xb5'))['fork'](path[_0x9fae('0x3d')](__dirname,_0x9fae('0xc1')),[_0x5d57e1['params']['id'],JSON[_0x9fae('0xc2')](_0x5d57e1[_0x9fae('0x39')]),JSON[_0x9fae('0xc2')](_0x50f351)]);_0x231e68['on'](_0x9fae('0xc3'),function(){_0x428caf=!![];return _0xe05edb[_0x9fae('0x14')](0xc8)['json']({'message':_0x9fae('0xc4'),'pid':_0x231e68[_0x9fae('0xb9')]});});_0x231e68['on'](_0x9fae('0xc5'),function(_0x4355f3){if(_0x4355f3&&!_0x428caf){return _0xe05edb[_0x9fae('0x14')](0x1f4)[_0x9fae('0x15')]({'message':_0x9fae('0xc6'),'pid':_0x231e68[_0x9fae('0xb9')]});}});})['catch'](handleError(_0xe05edb,null));};exports[_0x9fae('0xc7')]=function(_0x5cae74,_0xd0f0b0){return db[_0x9fae('0xc8')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x9fae('0xbf')}})[_0x9fae('0x23')](function(_0x2552ff){var _0x3f6afa=![];if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0x62')]){throw new Error(_0x9fae('0xa6'));}if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0xc0')][_0x9fae('0x7b')]){throw new Error(_0x9fae('0xb0'));}if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0xc0')][_0x9fae('0xb1')]){throw new Error(_0x9fae('0xb2'));}if(!_0x5cae74[_0x9fae('0x39')][_0x9fae('0xab')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x33c1de=require(_0x9fae('0xb5'))['fork'](path['join'](__dirname,_0x9fae('0xc9')),[_0x5cae74[_0x9fae('0x28')]['id'],JSON[_0x9fae('0xc2')](_0x5cae74[_0x9fae('0x39')]),JSON['stringify'](_0x2552ff)]);_0x33c1de['on'](_0x9fae('0xc3'),function(){_0x3f6afa=!![];return _0xd0f0b0['status'](0xc8)[_0x9fae('0x15')]({'message':_0x9fae('0xc4'),'pid':_0x33c1de['pid']});});_0x33c1de['on'](_0x9fae('0xc5'),function(_0x349556){if(_0x349556&&!_0x3f6afa){return _0xd0f0b0['status'](0x1f4)[_0x9fae('0x15')]({'message':'error\x20child\x20process','pid':_0x33c1de[_0x9fae('0xb9')]});}});})[_0x9fae('0x24')](handleError(_0xd0f0b0,null));};exports[_0x9fae('0xca')]=function(_0x793481,_0x3e7baa){var _0x5457bc=['mail',_0x9fae('0xcb'),'sms',_0x9fae('0xcc'),_0x9fae('0xcd'),_0x9fae('0xce'),_0x9fae('0xcf')];var _0x390b17={'offset':0x0,'order':qs[_0x9fae('0x84')](_0x9fae('0xd0'))},_0x5ec9f6={'count':0x0,'rows':[]};Promise[_0x9fae('0xd1')]()[_0x9fae('0x23')](function(){if(_0x793481['query'][_0x9fae('0xd2')]){if(!_['includes'](_0x5457bc,_0x793481[_0x9fae('0x22')][_0x9fae('0xd2')][_0x9fae('0xd3')]())){throw new Error(_0x9fae('0xd4'));}_0x5457bc=[_0x793481[_0x9fae('0x22')][_0x9fae('0xd2')][_0x9fae('0xd3')]()];}if(_0x793481[_0x9fae('0x22')][_0x9fae('0xd5')]){try{var _0x27d1a1=JSON[_0x9fae('0xd6')](_0x793481['query'][_0x9fae('0xd5')]);if(!moment(_0x27d1a1[_0x9fae('0x3a')])[_0x9fae('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x27d1a1['to'])[_0x9fae('0xd7')]()){throw new Error(_0x9fae('0xd8'));}}catch(_0x58d155){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x793481[_0x9fae('0x22')][_0x9fae('0x64')](_0x9fae('0x88'))){_0x390b17[_0x9fae('0x17')]=qs['limit'](_0x793481[_0x9fae('0x22')]['limit']||0xa);_0x390b17[_0x9fae('0x16')]=qs[_0x9fae('0x16')](_0x793481[_0x9fae('0x22')][_0x9fae('0x16')]);}var _0x27276b=_0x5457bc[_0x9fae('0x70')](function(_0xf736fe){if(_0xf736fe===_0x9fae('0xcf')){var _0x5daf0e={'attributes':['id','uniqueid',_0x9fae('0xd9'),_0x9fae('0xda'),_0x9fae('0xdb'),'callerid',_0x9fae('0xdc'),'endtime',_0x9fae('0xdd'),_0x9fae('0xde'),_0x9fae('0xdf'),_0x9fae('0xe0'),_0x9fae('0xe1'),_0x9fae('0xe2'),'UserId'],'where':{'ContactId':_0x793481[_0x9fae('0x28')]['id']},'include':[{'model':db[_0x9fae('0xc8')],'as':_0x9fae('0xc8'),'attributes':['id',_0x9fae('0x1e'),_0x9fae('0xe3'),_0x9fae('0xe4')]}],'order':[[_0x9fae('0xdf'),_0x9fae('0xe5')]]};if(_0x793481[_0x9fae('0x22')]['range']){_0x5daf0e[_0x9fae('0x61')][_0x9fae('0xdf')]={'$gte':_0x27d1a1['from'],'$lte':_0x27d1a1['to']};}return db[_0x9fae('0x4f')][_0x9fae('0xe6')](_0x5daf0e)['then'](function(_0x2e78de){_0x5ec9f6[_0x9fae('0x19')]+=_0x2e78de[_0x9fae('0x19')];return _[_0x9fae('0x70')](_0x2e78de['rows'],function(_0x5314e7){var _0x30a4a7=_0x5314e7[_0x9fae('0x3b')]({'plain':!![]});_0x30a4a7['channel']=_0xf736fe;if(_0x30a4a7['User']){_0x30a4a7[_0x9fae('0xc8')]={'id':_0x30a4a7[_0x9fae('0xc8')]['id'],'name':_0x30a4a7[_0x9fae('0xc8')][_0x9fae('0x1e')],'fullname':_0x30a4a7[_0x9fae('0xc8')]['fullname'],'alias':_0x30a4a7[_0x9fae('0xc8')]['alias']};}return _0x30a4a7;});});}else{var _0x196623=_[_0x9fae('0xe7')](_0xf736fe)+(_0xf736fe===_0x9fae('0xcb')?_0x9fae('0xe8'):_0x9fae('0xe9'));var _0x5400fd={'attributes':['id','closed',_0x9fae('0xea'),_0x9fae('0xdf'),'note','disposition','secondDisposition','thirdDisposition','UserId',_0x196623+'Id'],'where':{'ContactId':_0x793481[_0x9fae('0x28')]['id']},'include':[{'model':db[_0x196623],'as':'Account','attributes':['id',_0x9fae('0x1e'),_0x9fae('0xeb')]},{'model':db[_0x9fae('0xc8')],'as':_0x9fae('0xec'),'attributes':['id',_0x9fae('0x1e'),_0x9fae('0xe3')]},{'model':db[_0x9fae('0x68')],'as':_0x9fae('0x69'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[[_0x9fae('0xdf'),_0x9fae('0xe5')]]};if(_0x793481[_0x9fae('0x22')][_0x9fae('0xd5')]){_0x5400fd[_0x9fae('0x61')][_0x9fae('0xdf')]={'$gte':_0x27d1a1[_0x9fae('0x3a')],'$lte':_0x27d1a1['to']};}switch(_0xf736fe){case _0x9fae('0xcb'):_0x5400fd[_0x9fae('0x82')][_0x9fae('0x60')](_0x9fae('0xed'),'customerIp','customerPort',_0x9fae('0xee'),'osName',_0x9fae('0xef'),_0x9fae('0xf0'),'ratingValue','referer');break;case _0x9fae('0xf1'):_0x5400fd[_0x9fae('0x82')][_0x9fae('0x60')]('subject',_0x9fae('0xf2'));break;case _0x9fae('0xcc'):_0x5400fd[_0x9fae('0x82')][_0x9fae('0x60')]('externalUrl','threadId');break;}return db[_[_0x9fae('0xe7')](_0xf736fe)+_0x9fae('0xf3')]['findAndCountAll'](_0x5400fd)[_0x9fae('0x23')](function(_0x47fae6){_0x5ec9f6[_0x9fae('0x19')]+=_0x47fae6[_0x9fae('0x19')];return _[_0x9fae('0x70')](_0x47fae6[_0x9fae('0xa3')],function(_0x30f5b7){var _0x606257=_0x30f5b7[_0x9fae('0x3b')]({'plain':!![]});_0x606257[_0x9fae('0xd2')]=_0xf736fe;if(_0x606257['Owner']){_0x606257[_0x9fae('0xec')]={'id':_0x606257[_0x9fae('0xec')]['id'],'name':_0x606257[_0x9fae('0xec')]['name'],'fullname':_0x606257[_0x9fae('0xec')]['fullname']};}return _0x606257;});});}});return Promise['all'](_0x27276b);})[_0x9fae('0x23')](function(_0x54ba98){return _(_0x54ba98)[_0x9fae('0xf4')]()[_0x9fae('0xf5')](_0x9fae('0xdf'))['reverse']()['value']();})[_0x9fae('0x23')](function(_0x4b473f){_0x5ec9f6['rows']=_0x390b17[_0x9fae('0x17')]?_0x4b473f[_0x9fae('0xf6')](_0x390b17['offset'],_0x390b17[_0x9fae('0x16')]+_0x390b17[_0x9fae('0x17')]):_0x4b473f;return _0x5ec9f6;})[_0x9fae('0x23')](respondWithFilteredResult(_0x3e7baa,_0x390b17))[_0x9fae('0x24')](handleError(_0x3e7baa,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 6d9deff..1e93be6 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 _0x915e=['update','remove','emit','hasOwnProperty','hook','events','setMaxListeners','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x915e,0xa5));var _0xe915=function(_0x121783,_0x60c3f7){_0x121783=_0x121783-0x0;var _0x4b78cb=_0x915e[_0x121783];return _0x4b78cb;};'use strict';var EventEmitter=require(_0xe915('0x0'));var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe915('0x1')](0x0);var events={'afterCreate':_0xe915('0x2'),'afterUpdate':_0xe915('0x3'),'afterDestroy':_0xe915('0x4')};function emitEvent(_0xc6f1a9){return function(_0x2e59e5,_0x4946a1,_0x1737a0){CmContactEvents['emit'](_0xc6f1a9+':'+_0x2e59e5['id'],_0x2e59e5);CmContactEvents[_0xe915('0x5')](_0xc6f1a9,_0x2e59e5);_0x1737a0(null);};}for(var e in events){if(events[_0xe915('0x6')](e)){var event=events[e];CmContact[_0xe915('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x9236=['events','CmContact','save','update','remove','emit','hasOwnProperty'];(function(_0x114e7b,_0x5de855){var _0x43fc32=function(_0xc4d3b6){while(--_0xc4d3b6){_0x114e7b['push'](_0x114e7b['shift']());}};_0x43fc32(++_0x5de855);}(_0x9236,0x126));var _0x6923=function(_0x8ca2d4,_0x3ed67c){_0x8ca2d4=_0x8ca2d4-0x0;var _0x158585=_0x9236[_0x8ca2d4];return _0x158585;};'use strict';var EventEmitter=require(_0x6923('0x0'));var CmContact=require('../../mysqldb')['db'][_0x6923('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6923('0x2'),'afterUpdate':_0x6923('0x3'),'afterDestroy':_0x6923('0x4')};function emitEvent(_0xdb808d){return function(_0x426f8e,_0x329613,_0x109d63){CmContactEvents[_0x6923('0x5')](_0xdb808d+':'+_0x426f8e['id'],_0x426f8e);CmContactEvents[_0x6923('0x5')](_0xdb808d,_0x426f8e);_0x109d63(null);};}for(var e in events){if(events[_0x6923('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 7858966..189c393 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 _0x8a24=['cmContact,\x20%s,\x20%s','findAll','always','message','List\x20not\x20found','CampaignId','info','[CmContact][afterDestroy][Error]','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmContact','cm_contacts','fti_cm_contacts','firstName','lastName','phone','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','inspect','Campaign','timezones','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','outbound','CmList','length','dialCheckDuplicateType','onlyIfOpen','BlackLists','CmHopperBlack'];(function(_0x2ce623,_0x194212){var _0x1c0808=function(_0x1b827a){while(--_0x1b827a){_0x2ce623['push'](_0x2ce623['shift']());}};_0x1c0808(++_0x194212);}(_0x8a24,0x94));var _0x48a2=function(_0x57e20e,_0x522409){_0x57e20e=_0x57e20e-0x0;var _0x3867b3=_0x8a24[_0x57e20e];return _0x3867b3;};'use strict';var _=require('lodash');var util=require(_0x48a2('0x0'));var logger=require(_0x48a2('0x1'))('api');var moment=require(_0x48a2('0x2'));var BPromise=require(_0x48a2('0x3'));var rp=require(_0x48a2('0x4'));var fs=require('fs');var path=require(_0x48a2('0x5'));var rimraf=require('rimraf');var config=require(_0x48a2('0x6'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');module[_0x48a2('0x7')]=function(_0x49bb5b,_0x57e566){return _0x49bb5b[_0x48a2('0x8')](_0x48a2('0x9'),attributes,{'tableName':_0x48a2('0xa'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x48a2('0xb'),'fields':[_0x48a2('0xc'),_0x48a2('0xd'),_0x48a2('0xe'),_0x48a2('0xf'),_0x48a2('0x10'),'email'],'type':_0x48a2('0x11')}],'timestamps':!![],'charset':_0x48a2('0x12'),'collate':_0x48a2('0x13'),'hooks':{'afterCreate':function(_0x45bc3d,_0x553c8d,_0x2d1f67){var _0x968148=_0x49bb5b[_0x48a2('0x14')];var _0x2e62bc=_0x45bc3d[_0x48a2('0x15')]({'plain':!![]});function _0x607c50(){return function(_0x25f6ad){logger['error'](_0x48a2('0x16'),_0x48a2('0x17'),util['inspect'](_0x25f6ad,{'showHidden':![],'depth':null}));};}function _0x1ba680(_0x437760,_0x31a6d9){var _0x2a0094=_0x31a6d9[_0x48a2('0x18')]?_0x31a6d9[_0x48a2('0x18')]:moment()[_0x48a2('0x19')](_0x48a2('0x1a'));return new BPromise(function(_0x232581,_0x153848){if(_['isNil'](_0x31a6d9[_0x48a2('0x1b')])){_0x232581({'ret':_0x2a0094});}else{_0x968148[_0x48a2('0x1c')][_0x48a2('0x1d')]({'where':{'id':_0x437760['id']}})[_0x48a2('0x1e')](function(_0x5f030a){if(!_[_0x48a2('0x1f')](_0x5f030a)){var _0x444952=_0x5f030a['dialTimezone'];if(!_['isNil'](_0x444952)){var _0x208d86=shared['timezones'];var _0x358b96=_0x208d86[_0x444952];var _0x3858c7=_0x208d86[_0x31a6d9['dialTimezone']];if(!_[_0x48a2('0x1f')](_0x358b96)&&!_['isNil'](_0x3858c7)){var _0x43e8df=_0x358b96[_0x48a2('0x20')]-_0x3858c7[_0x48a2('0x20')];_0x2a0094=_0x31a6d9[_0x48a2('0x18')]?_0x31a6d9[_0x48a2('0x18')]:moment();var _0x2f7dc3=moment(_0x2a0094)[_0x48a2('0x21')](_0x43e8df,_0x48a2('0x22'));_0x232581({'ret':_0x2f7dc3[_0x48a2('0x19')](_0x48a2('0x1a'))});}else _0x232581({'ret':_0x2a0094});}else _0x232581({'ret':_0x2a0094});}else{_0x232581({'ret':_0x2a0094});}});}});return 0xa;}var _0x3c851b=function(_0x5a2d57){return new BPromise(function(_0x1a1f1e,_0x4b4a71){_0x1ba680(_0x5a2d57,_0x2e62bc)[_0x48a2('0x1e')](function(_0xb1b95a){_0x2e62bc[_0x48a2('0x18')]=_0xb1b95a['ret'];_0x968148[_0x48a2('0x23')][_0x48a2('0x1d')]({'where':{'phone':_0x2e62bc['phone'],'VoiceQueueId':_0x5a2d57['id']}})[_0x48a2('0x1e')](function(_0x5a5b12){if(!_['isNil'](_0x5a5b12)){throw new Error(_0x48a2('0x24')+_0x2e62bc['phone']+_0x48a2('0x25')+_0x5a2d57['id']);}return _0x968148[_0x48a2('0x23')][_0x48a2('0x26')]({'phone':_0x2e62bc['phone'],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc[_0x48a2('0x27')],'priority':_0x2e62bc[_0x48a2('0x28')]?_0x2e62bc[_0x48a2('0x28')]:0x2,'scheduledat':_0x2e62bc[_0x48a2('0x18')]?_0x2e62bc[_0x48a2('0x18')]:moment()[_0x48a2('0x19')](_0x48a2('0x1a')),'callback':_0x2e62bc[_0x48a2('0x29')]?!![]:![],'callbackuniqueid':_0x2e62bc[_0x48a2('0x29')]?_0x2e62bc[_0x48a2('0x29')]:undefined,'callbackat':_0x2e62bc[_0x48a2('0x29')]?moment()[_0x48a2('0x19')](_0x48a2('0x1a')):undefined,'VoiceQueueId':_0x5a2d57['id']});})[_0x48a2('0x2a')](function(_0x2ddf4d){_0x4b4a71(_0x2ddf4d);});});});};var _0x4f6a2a=function(_0x19f187){return new BPromise(function(_0x2d7286,_0x3ffa55){_0x1ba680(_0x19f187,_0x2e62bc)[_0x48a2('0x1e')](function(_0x399a2d){_0x2e62bc['scheduledat']=_0x399a2d['ret'];_0x968148[_0x48a2('0x23')][_0x48a2('0x1d')]({'where':{'phone':_0x2e62bc[_0x48a2('0xe')],'VoiceQueueId':_0x19f187['id']}})[_0x48a2('0x1e')](function(_0xe70172){if(!_[_0x48a2('0x1f')](_0xe70172)){throw new Error(_0x48a2('0x24')+_0x2e62bc[_0x48a2('0xe')]+_0x48a2('0x2b')+_0x19f187['id']);}return _0x968148[_0x48a2('0x2c')][_0x48a2('0x1d')]({'where':{'calleridnum':_0x2e62bc[_0x48a2('0xe')],'VoiceQueueId':_0x19f187['id']}});})['then'](function(_0x484c3d){if(!_['isNil'](_0x484c3d)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2e62bc[_0x48a2('0xe')]+_0x48a2('0x2d')+_0x19f187['id']);}return _0x968148['CmHopper'][_0x48a2('0x26')]({'phone':_0x2e62bc[_0x48a2('0xe')],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc['ListId'],'priority':_0x2e62bc['priority']?_0x2e62bc[_0x48a2('0x28')]:0x2,'scheduledat':_0x2e62bc[_0x48a2('0x18')]?_0x2e62bc[_0x48a2('0x18')]:moment()[_0x48a2('0x19')](_0x48a2('0x1a')),'callback':_0x2e62bc[_0x48a2('0x29')]?!![]:![],'callbackuniqueid':_0x2e62bc[_0x48a2('0x29')]?_0x2e62bc[_0x48a2('0x29')]:undefined,'callbackat':_0x2e62bc[_0x48a2('0x29')]?moment()[_0x48a2('0x19')](_0x48a2('0x1a')):undefined,'VoiceQueueId':_0x19f187['id']});})[_0x48a2('0x2a')](function(_0x41500d){_0x3ffa55(_0x41500d);});});});};function _0x14acaa(){return function(_0x27c75e){logger[_0x48a2('0x2e')]('cmContact',_0x48a2('0x17'),util[_0x48a2('0x2f')](_0x27c75e,{'showHidden':![],'depth':null}));};}function _0x19510a(_0x5d4447,_0x50c5ef){var _0x4ddc6e=_0x50c5ef['scheduledat']?_0x50c5ef[_0x48a2('0x18')]:moment()[_0x48a2('0x19')](_0x48a2('0x1a'));return new BPromise(function(_0x47e3c7,_0x390c2a){if(_[_0x48a2('0x1f')](_0x50c5ef[_0x48a2('0x1b')])){_0x47e3c7({'ret':_0x4ddc6e});}else{_0x968148[_0x48a2('0x30')][_0x48a2('0x1d')]({'where':{'id':_0x5d4447['id']}})[_0x48a2('0x1e')](function(_0x4ee787){if(!_[_0x48a2('0x1f')](_0x4ee787)){var _0xd3dc98=_0x4ee787[_0x48a2('0x1b')];if(!_[_0x48a2('0x1f')](_0xd3dc98)){var _0x3f4cfc=shared[_0x48a2('0x31')];var _0x15e1d3=_0x3f4cfc[_0xd3dc98];var _0x122b71=_0x3f4cfc[_0x50c5ef[_0x48a2('0x1b')]];if(!_[_0x48a2('0x1f')](_0x15e1d3)&&!_[_0x48a2('0x1f')](_0x122b71)){var _0x3a31b4=_0x15e1d3['utcOffset']-_0x122b71[_0x48a2('0x20')];_0x4ddc6e=_0x50c5ef[_0x48a2('0x18')]?_0x50c5ef[_0x48a2('0x18')]:moment();var _0x4a1fc7=moment(_0x4ddc6e)[_0x48a2('0x21')](_0x3a31b4,'minutes');_0x47e3c7({'ret':_0x4a1fc7[_0x48a2('0x19')](_0x48a2('0x1a'))});}else _0x47e3c7({'ret':_0x4ddc6e});}else _0x47e3c7({'ret':_0x4ddc6e});}else{_0x47e3c7({'ret':_0x4ddc6e});}});}});return 0xa;}var _0x235df0=function(_0x2b6427){return new BPromise(function(_0x5ba6fc,_0x45ca03){_0x19510a(_0x2b6427,_0x2e62bc)[_0x48a2('0x1e')](function(_0x6ce183){_0x2e62bc[_0x48a2('0x18')]=_0x6ce183['ret'];_0x968148[_0x48a2('0x23')][_0x48a2('0x1d')]({'where':{'phone':_0x2e62bc[_0x48a2('0xe')],'CampaignId':_0x2b6427['id']}})['then'](function(_0x5281e6){if(!_[_0x48a2('0x1f')](_0x5281e6)){throw new Error(_0x48a2('0x24')+_0x2e62bc[_0x48a2('0xe')]+_0x48a2('0x32')+_0x2b6427['id']);}return _0x968148[_0x48a2('0x23')][_0x48a2('0x26')]({'phone':_0x2e62bc[_0x48a2('0xe')],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc[_0x48a2('0x27')],'priority':_0x2e62bc[_0x48a2('0x28')]?_0x2e62bc[_0x48a2('0x28')]:0x2,'scheduledat':_0x2e62bc['scheduledat']?_0x2e62bc['scheduledat']:moment()[_0x48a2('0x19')](_0x48a2('0x1a')),'callback':_0x2e62bc[_0x48a2('0x29')]?!![]:![],'callbackuniqueid':_0x2e62bc[_0x48a2('0x29')]?_0x2e62bc[_0x48a2('0x29')]:undefined,'callbackat':_0x2e62bc[_0x48a2('0x29')]?moment()[_0x48a2('0x19')](_0x48a2('0x1a')):undefined,'CampaignId':_0x2b6427['id']});})[_0x48a2('0x2a')](function(_0x3d64b5){_0x45ca03(_0x3d64b5);});});});};var _0x418d78=function(_0x47bb2d){return new BPromise(function(_0x1e6cf4,_0x2ac2bc){_0x19510a(_0x47bb2d,_0x2e62bc)['then'](function(_0x2fce93){_0x2e62bc[_0x48a2('0x18')]=_0x2fce93[_0x48a2('0x33')];_0x968148[_0x48a2('0x23')][_0x48a2('0x1d')]({'where':{'phone':_0x2e62bc['phone'],'CampaignId':_0x47bb2d['id']}})[_0x48a2('0x1e')](function(_0x2617ac){if(!_[_0x48a2('0x1f')](_0x2617ac)){throw new Error(_0x48a2('0x24')+_0x2e62bc['phone']+_0x48a2('0x34')+_0x47bb2d['id']);}return _0x968148[_0x48a2('0x2c')]['findOne']({'where':{'calleridnum':_0x2e62bc[_0x48a2('0xe')],'CampaignId':_0x47bb2d['id']}});})['then'](function(_0x434a77){if(!_[_0x48a2('0x1f')](_0x434a77)){throw new Error(_0x48a2('0x35')+_0x2e62bc['phone']+_0x48a2('0x36')+_0x47bb2d['id']);}return _0x968148['CmHopper']['create']({'phone':_0x2e62bc['phone'],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc[_0x48a2('0x27')],'priority':_0x2e62bc[_0x48a2('0x28')]?_0x2e62bc[_0x48a2('0x28')]:0x2,'scheduledat':_0x2e62bc[_0x48a2('0x18')]?_0x2e62bc[_0x48a2('0x18')]:moment()[_0x48a2('0x19')](_0x48a2('0x1a')),'callback':_0x2e62bc[_0x48a2('0x29')]?!![]:![],'callbackuniqueid':_0x2e62bc[_0x48a2('0x29')]?_0x2e62bc[_0x48a2('0x29')]:undefined,'callbackat':_0x2e62bc[_0x48a2('0x29')]?moment()[_0x48a2('0x19')](_0x48a2('0x1a')):undefined,'CampaignId':_0x47bb2d['id']});})[_0x48a2('0x2a')](function(_0x3d3a02){_0x2ac2bc(_0x3d3a02);});});});};if(_0x2e62bc['ListId']){_0x968148[_0x48a2('0x1c')]['findAll']({'where':{'type':_0x48a2('0x37')},'attributes':['id','dialCheckDuplicateType',_0x48a2('0x1b')],'include':[{'model':_0x968148[_0x48a2('0x38')],'as':'Lists','where':{'id':_0x2e62bc[_0x48a2('0x27')]}}]})[_0x48a2('0x1e')](function(_0x167fc9){if(_0x167fc9){var _0x4d4b2c=[];for(var _0x305516=0x0,_0x32df02;_0x305516<_0x167fc9[_0x48a2('0x39')];_0x305516+=0x1){_0x32df02=_0x167fc9[_0x305516][_0x48a2('0x15')]({'plain':!![]});switch(_0x32df02[_0x48a2('0x3a')]){case'always':_0x4f6a2a(_0x32df02)['catch'](_0x607c50());break;case _0x48a2('0x3b'):_0x3c851b(_0x32df02)['catch'](_0x607c50());break;default:_0x19510a(_0x32df02,_0x2e62bc)['then'](function(_0x215573){_0x2e62bc[_0x48a2('0x18')]=_0x215573[_0x48a2('0x33')];_0x968148[_0x48a2('0x23')]['create']({'phone':_0x2e62bc[_0x48a2('0xe')],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc[_0x48a2('0x27')],'scheduledat':_0x2e62bc['scheduledat']?_0x2e62bc['scheduledat']:moment()[_0x48a2('0x19')](_0x48a2('0x1a')),'priority':_0x2e62bc[_0x48a2('0x28')]?_0x2e62bc['priority']:0x2,'callback':_0x2e62bc[_0x48a2('0x29')]?!![]:![],'callbackuniqueid':_0x2e62bc[_0x48a2('0x29')]?_0x2e62bc[_0x48a2('0x29')]:undefined,'callbackat':_0x2e62bc[_0x48a2('0x29')]?moment()[_0x48a2('0x19')](_0x48a2('0x1a')):undefined,'VoiceQueueId':_0x32df02['id']})['catch'](_0x607c50());});}}}})['then'](function(){return _0x968148[_0x48a2('0x1c')]['findAll']({'where':{'type':_0x48a2('0x37')},'attributes':['id'],'include':[{'model':_0x968148[_0x48a2('0x38')],'as':_0x48a2('0x3c'),'where':{'id':_0x2e62bc[_0x48a2('0x27')]}}]})[_0x48a2('0x1e')](function(_0x55e410){if(_0x55e410){var _0x15493a=[];for(var _0x5997e9=0x0,_0x2bea91;_0x5997e9<_0x55e410[_0x48a2('0x39')];_0x5997e9+=0x1){_0x2bea91=_0x55e410[_0x5997e9][_0x48a2('0x15')]({'plain':!![]});_0x968148[_0x48a2('0x3d')][_0x48a2('0x26')]({'phone':_0x2e62bc[_0x48a2('0xe')],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc[_0x48a2('0x27')],'VoiceQueueId':_0x2bea91['id']})[_0x48a2('0x2a')](function(_0x50dd5e){logger[_0x48a2('0x2e')](_0x48a2('0x3e'),'afterCreate',_0x50dd5e['message']);});}}});})[_0x48a2('0x1e')](function(){return _0x968148[_0x48a2('0x30')][_0x48a2('0x3f')]({'attributes':['id',_0x48a2('0x3a'),'dialTimezone'],'include':[{'model':_0x968148[_0x48a2('0x38')],'as':'Lists','where':{'id':_0x2e62bc['ListId']}}]})['then'](function(_0x29fdd5){if(_0x29fdd5){var _0x512c7b=[];for(var _0x56790f=0x0,_0x3b2ffc;_0x56790f<_0x29fdd5['length'];_0x56790f+=0x1){_0x3b2ffc=_0x29fdd5[_0x56790f][_0x48a2('0x15')]({'plain':!![]});switch(_0x3b2ffc[_0x48a2('0x3a')]){case _0x48a2('0x40'):_0x418d78(_0x3b2ffc)['catch'](_0x14acaa());break;case _0x48a2('0x3b'):_0x235df0(_0x3b2ffc)[_0x48a2('0x2a')](_0x14acaa());break;default:_0x968148[_0x48a2('0x23')][_0x48a2('0x26')]({'phone':_0x2e62bc[_0x48a2('0xe')],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc['ListId'],'scheduledat':_0x2e62bc[_0x48a2('0x18')]?_0x2e62bc[_0x48a2('0x18')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2e62bc[_0x48a2('0x28')]?_0x2e62bc['priority']:0x2,'callback':_0x2e62bc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2e62bc[_0x48a2('0x29')]?_0x2e62bc[_0x48a2('0x29')]:undefined,'callbackat':_0x2e62bc[_0x48a2('0x29')]?moment()[_0x48a2('0x19')](_0x48a2('0x1a')):undefined,'CampaignId':_0x3b2ffc['id']})['catch'](_0x14acaa());}}}});})[_0x48a2('0x1e')](function(){return _0x968148[_0x48a2('0x30')][_0x48a2('0x3f')]({'attributes':['id'],'include':[{'model':_0x968148[_0x48a2('0x38')],'as':_0x48a2('0x3c'),'where':{'id':_0x2e62bc[_0x48a2('0x27')]}}]})[_0x48a2('0x1e')](function(_0x5e4fbb){if(_0x5e4fbb){var _0x5d0c04=[];for(var _0x2c4c3f=0x0,_0x4f1fcd;_0x2c4c3f<_0x5e4fbb[_0x48a2('0x39')];_0x2c4c3f+=0x1){_0x4f1fcd=_0x5e4fbb[_0x2c4c3f][_0x48a2('0x15')]({'plain':!![]});_0x968148[_0x48a2('0x3d')][_0x48a2('0x26')]({'phone':_0x2e62bc[_0x48a2('0xe')],'ContactId':_0x2e62bc['id'],'ListId':_0x2e62bc[_0x48a2('0x27')],'CampaignId':_0x4f1fcd['id']})[_0x48a2('0x2a')](function(_0x3722d7){logger[_0x48a2('0x2e')](_0x48a2('0x3e'),_0x48a2('0x17'),_0x3722d7[_0x48a2('0x41')]);});}}});})['then'](function(){_0x2d1f67();})[_0x48a2('0x2a')](function(_0x463ab0){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x463ab0[_0x48a2('0x41')]);_0x2d1f67(_0x463ab0);});}else{_0x2d1f67(new Error(_0x48a2('0x42')));}},'afterDestroy':function(_0x347ab3,_0x2eb872,_0x2e8a55){var _0x4cab6c=_0x49bb5b[_0x48a2('0x14')];var _0x25b652=_0x347ab3[_0x48a2('0x15')]({'plain':!![]});return _0x4cab6c[_0x48a2('0x23')][_0x48a2('0x3f')]({'raw':!![],'where':{'ListId':_0x25b652[_0x48a2('0x27')],'ContactId':_0x25b652['id']}})[_0x48a2('0x1e')](function(_0xefc0c7){if(!_['isEmpty'](_0xefc0c7)){var _0x98ac40=[];for(var _0x2bb1ce=0x0;_0x2bb1ce<_0xefc0c7[_0x48a2('0x39')];_0x2bb1ce+=0x1){var _0x38bd38=_0x4cab6c[_0x48a2('0x23')]['destroy']({'where':{'ListId':_0xefc0c7[_0x2bb1ce][_0x48a2('0x27')],'ContactId':_0xefc0c7[_0x2bb1ce]['ContactId'],'VoiceQueueId':_0xefc0c7[_0x2bb1ce]['VoiceQueueId'],'CampaignId':_0xefc0c7[_0x2bb1ce][_0x48a2('0x43')]}});_0x98ac40['push'](_0x38bd38);}return BPromise['all'](_0x98ac40);}})['then'](function(_0x247618){logger[_0x48a2('0x44')]('[CmContact][afterDestroy][Succesfull]',util[_0x48a2('0x2f')](_0x247618,{'showHidden':![],'depth':null}));_0x2e8a55();})['catch'](function(_0x370d35){logger[_0x48a2('0x2e')](_0x48a2('0x45'),util[_0x48a2('0x2f')](_0x370d35,{'showHidden':![],'depth':null}));_0x2e8a55(_0x370d35);});}}});}; \ No newline at end of file +var _0xfce5=['../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','fti_cm_contacts','lastName','phone','email','utf8mb4','utf8mb4_unicode_ci','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','findOne','then','isNil','timezones','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','afterCreate','Campaign','utcOffset','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','Lists','length','get','dialCheckDuplicateType','onlyIfOpen','VoiceQueue','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','always','message','List\x20not\x20found','models','destroy','ContactId','VoiceQueueId','all','[CmContact][afterDestroy][Succesfull]','util','moment','path','rimraf'];(function(_0x4dd768,_0xf94a07){var _0x347432=function(_0x2190c7){while(--_0x2190c7){_0x4dd768['push'](_0x4dd768['shift']());}};_0x347432(++_0xf94a07);}(_0xfce5,0x108));var _0x5fce=function(_0x5c3993,_0x5b9b11){_0x5c3993=_0x5c3993-0x0;var _0x5144ab=_0xfce5[_0x5c3993];return _0x5144ab;};'use strict';var _=require('lodash');var util=require(_0x5fce('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5fce('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fce('0x2'));var rimraf=require(_0x5fce('0x3'));var config=require(_0x5fce('0x4'));var shared=require('../../config/environment/shared');var attributes=require(_0x5fce('0x5'));module[_0x5fce('0x6')]=function(_0x475a74,_0x3dadc5){return _0x475a74[_0x5fce('0x7')](_0x5fce('0x8'),attributes,{'tableName':_0x5fce('0x9'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x5fce('0xa'),'fields':['firstName',_0x5fce('0xb'),_0x5fce('0xc'),'mobile','fax',_0x5fce('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x5fce('0xe'),'collate':_0x5fce('0xf'),'hooks':{'afterCreate':function(_0x4e2c1c,_0x156ca7,_0x288251){var _0x53e4d5=_0x475a74['models'];var _0x51541a=_0x4e2c1c['get']({'plain':!![]});function _0x3a7034(){return function(_0x356ad6){logger[_0x5fce('0x10')](_0x5fce('0x11'),'afterCreate',util[_0x5fce('0x12')](_0x356ad6,{'showHidden':![],'depth':null}));};}function _0x2ce068(_0x59d292,_0x333a56){var _0x5d9d53=_0x333a56[_0x5fce('0x13')]?_0x333a56[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15'));return new BPromise(function(_0xa35af8,_0x5d04b9){if(_['isNil'](_0x333a56[_0x5fce('0x16')])){_0xa35af8({'ret':_0x5d9d53});}else{_0x53e4d5['VoiceQueue'][_0x5fce('0x17')]({'where':{'id':_0x59d292['id']}})[_0x5fce('0x18')](function(_0x41df41){if(!_[_0x5fce('0x19')](_0x41df41)){var _0x567e56=_0x41df41[_0x5fce('0x16')];if(!_[_0x5fce('0x19')](_0x567e56)){var _0x2aa605=shared[_0x5fce('0x1a')];var _0xda0ffd=_0x2aa605[_0x567e56];var _0x561247=_0x2aa605[_0x333a56[_0x5fce('0x16')]];if(!_[_0x5fce('0x19')](_0xda0ffd)&&!_[_0x5fce('0x19')](_0x561247)){var _0xb70543=_0xda0ffd['utcOffset']-_0x561247['utcOffset'];_0x5d9d53=_0x333a56[_0x5fce('0x13')]?_0x333a56[_0x5fce('0x13')]:moment();var _0x55074d=moment(_0x5d9d53)[_0x5fce('0x1b')](_0xb70543,_0x5fce('0x1c'));_0xa35af8({'ret':_0x55074d[_0x5fce('0x14')](_0x5fce('0x15'))});}else _0xa35af8({'ret':_0x5d9d53});}else _0xa35af8({'ret':_0x5d9d53});}else{_0xa35af8({'ret':_0x5d9d53});}});}});return 0xa;}var _0x16908a=function(_0x4f1580){return new BPromise(function(_0x37e9d1,_0x4faa9b){_0x2ce068(_0x4f1580,_0x51541a)[_0x5fce('0x18')](function(_0x5e3390){_0x51541a[_0x5fce('0x13')]=_0x5e3390[_0x5fce('0x1d')];_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x17')]({'where':{'phone':_0x51541a[_0x5fce('0xc')],'VoiceQueueId':_0x4f1580['id']}})['then'](function(_0x2b96cc){if(!_[_0x5fce('0x19')](_0x2b96cc)){throw new Error(_0x5fce('0x1f')+_0x51541a['phone']+_0x5fce('0x20')+_0x4f1580['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a['priority']?_0x51541a[_0x5fce('0x23')]:0x2,'scheduledat':_0x51541a['scheduledat']?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a['callbackUniqueid']?_0x51541a[_0x5fce('0x24')]:undefined,'callbackat':_0x51541a['callbackUniqueid']?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'VoiceQueueId':_0x4f1580['id']});})[_0x5fce('0x25')](function(_0x2790ca){_0x4faa9b(_0x2790ca);});});});};var _0x441454=function(_0x227e80){return new BPromise(function(_0x4a54c3,_0x1700af){_0x2ce068(_0x227e80,_0x51541a)[_0x5fce('0x18')](function(_0xee9469){_0x51541a[_0x5fce('0x13')]=_0xee9469[_0x5fce('0x1d')];_0x53e4d5[_0x5fce('0x1e')]['findOne']({'where':{'phone':_0x51541a['phone'],'VoiceQueueId':_0x227e80['id']}})[_0x5fce('0x18')](function(_0x23b126){if(!_[_0x5fce('0x19')](_0x23b126)){throw new Error(_0x5fce('0x1f')+_0x51541a['phone']+_0x5fce('0x26')+_0x227e80['id']);}return _0x53e4d5['CmHopperFinal'][_0x5fce('0x17')]({'where':{'calleridnum':_0x51541a[_0x5fce('0xc')],'VoiceQueueId':_0x227e80['id']}});})[_0x5fce('0x18')](function(_0x1708fd){if(!_['isNil'](_0x1708fd)){throw new Error(_0x5fce('0x27')+_0x51541a[_0x5fce('0xc')]+_0x5fce('0x28')+_0x227e80['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a['phone'],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a[_0x5fce('0x23')]:0x2,'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a['callbackUniqueid']:undefined,'callbackat':_0x51541a[_0x5fce('0x24')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x227e80['id']});})[_0x5fce('0x25')](function(_0x400032){_0x1700af(_0x400032);});});});};function _0x276e9e(){return function(_0x5e8ddb){logger[_0x5fce('0x10')](_0x5fce('0x11'),_0x5fce('0x29'),util[_0x5fce('0x12')](_0x5e8ddb,{'showHidden':![],'depth':null}));};}function _0x20f101(_0x3273a3,_0x18c447){var _0x468a4f=_0x18c447['scheduledat']?_0x18c447['scheduledat']:moment()[_0x5fce('0x14')](_0x5fce('0x15'));return new BPromise(function(_0x1a09d8,_0x40c1d3){if(_['isNil'](_0x18c447[_0x5fce('0x16')])){_0x1a09d8({'ret':_0x468a4f});}else{_0x53e4d5[_0x5fce('0x2a')]['findOne']({'where':{'id':_0x3273a3['id']}})[_0x5fce('0x18')](function(_0x2d898c){if(!_[_0x5fce('0x19')](_0x2d898c)){var _0xc4612f=_0x2d898c[_0x5fce('0x16')];if(!_[_0x5fce('0x19')](_0xc4612f)){var _0x546699=shared[_0x5fce('0x1a')];var _0x5788c9=_0x546699[_0xc4612f];var _0xcd995=_0x546699[_0x18c447[_0x5fce('0x16')]];if(!_['isNil'](_0x5788c9)&&!_['isNil'](_0xcd995)){var _0xfebc16=_0x5788c9[_0x5fce('0x2b')]-_0xcd995[_0x5fce('0x2b')];_0x468a4f=_0x18c447[_0x5fce('0x13')]?_0x18c447[_0x5fce('0x13')]:moment();var _0x112b28=moment(_0x468a4f)['add'](_0xfebc16,'minutes');_0x1a09d8({'ret':_0x112b28[_0x5fce('0x14')](_0x5fce('0x15'))});}else _0x1a09d8({'ret':_0x468a4f});}else _0x1a09d8({'ret':_0x468a4f});}else{_0x1a09d8({'ret':_0x468a4f});}});}});return 0xa;}var _0x552b65=function(_0x5e8200){return new BPromise(function(_0x51e2c5,_0x2322c7){_0x20f101(_0x5e8200,_0x51541a)[_0x5fce('0x18')](function(_0x300b18){_0x51541a['scheduledat']=_0x300b18['ret'];_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x17')]({'where':{'phone':_0x51541a['phone'],'CampaignId':_0x5e8200['id']}})[_0x5fce('0x18')](function(_0x3fd4ed){if(!_['isNil'](_0x3fd4ed)){throw new Error(_0x5fce('0x1f')+_0x51541a[_0x5fce('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x5e8200['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a[_0x5fce('0x23')]:0x2,'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a[_0x5fce('0x24')]:undefined,'callbackat':_0x51541a['callbackUniqueid']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x5e8200['id']});})[_0x5fce('0x25')](function(_0x2189fc){_0x2322c7(_0x2189fc);});});});};var _0x18d59e=function(_0x23afe0){return new BPromise(function(_0x22f7bf,_0x1ec5da){_0x20f101(_0x23afe0,_0x51541a)[_0x5fce('0x18')](function(_0x2ff77f){_0x51541a[_0x5fce('0x13')]=_0x2ff77f['ret'];_0x53e4d5[_0x5fce('0x1e')]['findOne']({'where':{'phone':_0x51541a[_0x5fce('0xc')],'CampaignId':_0x23afe0['id']}})[_0x5fce('0x18')](function(_0x550f0b){if(!_[_0x5fce('0x19')](_0x550f0b)){throw new Error(_0x5fce('0x1f')+_0x51541a[_0x5fce('0xc')]+_0x5fce('0x2c')+_0x23afe0['id']);}return _0x53e4d5['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x51541a[_0x5fce('0xc')],'CampaignId':_0x23afe0['id']}});})[_0x5fce('0x18')](function(_0x3076f6){if(!_['isNil'](_0x3076f6)){throw new Error(_0x5fce('0x27')+_0x51541a[_0x5fce('0xc')]+_0x5fce('0x2d')+_0x23afe0['id']);}return _0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'priority':_0x51541a['priority']?_0x51541a['priority']:0x2,'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a['callbackUniqueid']:undefined,'callbackat':_0x51541a[_0x5fce('0x24')]?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'CampaignId':_0x23afe0['id']});})[_0x5fce('0x25')](function(_0x5b9ef6){_0x1ec5da(_0x5b9ef6);});});});};if(_0x51541a[_0x5fce('0x22')]){_0x53e4d5['VoiceQueue'][_0x5fce('0x2e')]({'where':{'type':_0x5fce('0x2f')},'attributes':['id','dialCheckDuplicateType',_0x5fce('0x16')],'include':[{'model':_0x53e4d5['CmList'],'as':_0x5fce('0x30'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x7dc84e){if(_0x7dc84e){var _0x1cd408=[];for(var _0x3f131f=0x0,_0x85a8c4;_0x3f131f<_0x7dc84e[_0x5fce('0x31')];_0x3f131f+=0x1){_0x85a8c4=_0x7dc84e[_0x3f131f][_0x5fce('0x32')]({'plain':!![]});switch(_0x85a8c4[_0x5fce('0x33')]){case'always':_0x441454(_0x85a8c4)[_0x5fce('0x25')](_0x3a7034());break;case _0x5fce('0x34'):_0x16908a(_0x85a8c4)[_0x5fce('0x25')](_0x3a7034());break;default:_0x20f101(_0x85a8c4,_0x51541a)[_0x5fce('0x18')](function(_0x1fc7d8){_0x51541a[_0x5fce('0x13')]=_0x1fc7d8[_0x5fce('0x1d')];_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a['ListId'],'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()['format'](_0x5fce('0x15')),'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a['priority']:0x2,'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a['callbackUniqueid']?_0x51541a['callbackUniqueid']:undefined,'callbackat':_0x51541a['callbackUniqueid']?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'VoiceQueueId':_0x85a8c4['id']})[_0x5fce('0x25')](_0x3a7034());});}}}})[_0x5fce('0x18')](function(){return _0x53e4d5[_0x5fce('0x35')][_0x5fce('0x2e')]({'where':{'type':_0x5fce('0x2f')},'attributes':['id'],'include':[{'model':_0x53e4d5[_0x5fce('0x36')],'as':_0x5fce('0x37'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x551366){if(_0x551366){var _0x3b3a77=[];for(var _0x5e55e4=0x0,_0x541fd6;_0x5e55e4<_0x551366['length'];_0x5e55e4+=0x1){_0x541fd6=_0x551366[_0x5e55e4][_0x5fce('0x32')]({'plain':!![]});_0x53e4d5[_0x5fce('0x38')][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a['ListId'],'VoiceQueueId':_0x541fd6['id']})['catch'](function(_0x39d70e){logger[_0x5fce('0x10')](_0x5fce('0x39'),_0x5fce('0x29'),_0x39d70e['message']);});}}});})[_0x5fce('0x18')](function(){return _0x53e4d5['Campaign'][_0x5fce('0x2e')]({'attributes':['id',_0x5fce('0x33'),'dialTimezone'],'include':[{'model':_0x53e4d5[_0x5fce('0x36')],'as':_0x5fce('0x30'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x3c0816){if(_0x3c0816){var _0x22f4b8=[];for(var _0xc295c4=0x0,_0x2e0cbb;_0xc295c4<_0x3c0816[_0x5fce('0x31')];_0xc295c4+=0x1){_0x2e0cbb=_0x3c0816[_0xc295c4][_0x5fce('0x32')]({'plain':!![]});switch(_0x2e0cbb[_0x5fce('0x33')]){case _0x5fce('0x3a'):_0x18d59e(_0x2e0cbb)[_0x5fce('0x25')](_0x276e9e());break;case _0x5fce('0x34'):_0x552b65(_0x2e0cbb)['catch'](_0x276e9e());break;default:_0x53e4d5[_0x5fce('0x1e')][_0x5fce('0x21')]({'phone':_0x51541a['phone'],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'scheduledat':_0x51541a[_0x5fce('0x13')]?_0x51541a[_0x5fce('0x13')]:moment()[_0x5fce('0x14')](_0x5fce('0x15')),'priority':_0x51541a[_0x5fce('0x23')]?_0x51541a[_0x5fce('0x23')]:0x2,'callback':_0x51541a[_0x5fce('0x24')]?!![]:![],'callbackuniqueid':_0x51541a[_0x5fce('0x24')]?_0x51541a[_0x5fce('0x24')]:undefined,'callbackat':_0x51541a[_0x5fce('0x24')]?moment()[_0x5fce('0x14')](_0x5fce('0x15')):undefined,'CampaignId':_0x2e0cbb['id']})[_0x5fce('0x25')](_0x276e9e());}}}});})[_0x5fce('0x18')](function(){return _0x53e4d5[_0x5fce('0x2a')][_0x5fce('0x2e')]({'attributes':['id'],'include':[{'model':_0x53e4d5['CmList'],'as':_0x5fce('0x37'),'where':{'id':_0x51541a[_0x5fce('0x22')]}}]})[_0x5fce('0x18')](function(_0x30082c){if(_0x30082c){var _0x506ea2=[];for(var _0xc33420=0x0,_0x21ca2e;_0xc33420<_0x30082c[_0x5fce('0x31')];_0xc33420+=0x1){_0x21ca2e=_0x30082c[_0xc33420][_0x5fce('0x32')]({'plain':!![]});_0x53e4d5['CmHopperBlack'][_0x5fce('0x21')]({'phone':_0x51541a[_0x5fce('0xc')],'ContactId':_0x51541a['id'],'ListId':_0x51541a[_0x5fce('0x22')],'CampaignId':_0x21ca2e['id']})[_0x5fce('0x25')](function(_0x511216){logger[_0x5fce('0x10')](_0x5fce('0x39'),_0x5fce('0x29'),_0x511216[_0x5fce('0x3b')]);});}}});})[_0x5fce('0x18')](function(){_0x288251();})['catch'](function(_0x20c426){logger[_0x5fce('0x10')](_0x5fce('0x39'),_0x5fce('0x29'),_0x20c426[_0x5fce('0x3b')]);_0x288251(_0x20c426);});}else{_0x288251(new Error(_0x5fce('0x3c')));}},'afterDestroy':function(_0x1a0af5,_0x5b4aa0,_0x3e51f8){var _0x48b1a3=_0x475a74[_0x5fce('0x3d')];var _0x5cd9ff=_0x1a0af5[_0x5fce('0x32')]({'plain':!![]});return _0x48b1a3[_0x5fce('0x1e')][_0x5fce('0x2e')]({'raw':!![],'where':{'ListId':_0x5cd9ff[_0x5fce('0x22')],'ContactId':_0x5cd9ff['id']}})[_0x5fce('0x18')](function(_0x1dc1d0){if(!_['isEmpty'](_0x1dc1d0)){var _0x5e1c89=[];for(var _0x55edcf=0x0;_0x55edcf<_0x1dc1d0[_0x5fce('0x31')];_0x55edcf+=0x1){var _0x288e40=_0x48b1a3[_0x5fce('0x1e')][_0x5fce('0x3e')]({'where':{'ListId':_0x1dc1d0[_0x55edcf][_0x5fce('0x22')],'ContactId':_0x1dc1d0[_0x55edcf][_0x5fce('0x3f')],'VoiceQueueId':_0x1dc1d0[_0x55edcf][_0x5fce('0x40')],'CampaignId':_0x1dc1d0[_0x55edcf]['CampaignId']}});_0x5e1c89['push'](_0x288e40);}return BPromise[_0x5fce('0x41')](_0x5e1c89);}})['then'](function(_0x4882dd){logger['info'](_0x5fce('0x42'),util['inspect'](_0x4882dd,{'showHidden':![],'depth':null}));_0x3e51f8();})['catch'](function(_0x4aa445){logger[_0x5fce('0x10')]('[CmContact][afterDestroy][Error]',util[_0x5fce('0x12')](_0x4aa445,{'showHidden':![],'depth':null}));_0x3e51f8(_0x4aa445);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index fcdf9f7..f3f9310 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x5eeeab,_0x1825bc){var _0x140369=function(_0x654669){while(--_0x654669){_0x5eeeab['push'](_0x5eeeab['shift']());}};_0x140369(++_0x1825bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 bf663af..5b27dd1 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 _0xb6b1=['STRING','sequelize','INTEGER'];(function(_0x4089b7,_0x3b4874){var _0x1ad26c=function(_0x2d8a33){while(--_0x2d8a33){_0x4089b7['push'](_0x4089b7['shift']());}};_0x1ad26c(++_0x3b4874);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0xb6b1[_0x1deb72];return _0x18bbdf;};'use strict';var Sequelize=require(_0x1b6b('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x1b6b('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x1b6b('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x1b6b('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x1b6b('0x1')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x5ed2=['sequelize','INTEGER','STRING','PHONE'];(function(_0x5e5ad9,_0x2bd9fe){var _0x236667=function(_0x529468){while(--_0x529468){_0x5e5ad9['push'](_0x5e5ad9['shift']());}};_0x236667(++_0x2bd9fe);}(_0x5ed2,0x114));var _0x25ed=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x5ed2[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x25ed('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x25ed('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x25ed('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x25ed('0x2')],'defaultValue':_0x25ed('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0x25ed('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index cd85b24..a502c56 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 _0x0fcb=['filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','query','keys'];(function(_0x3f1fb4,_0x1ada00){var _0x225401=function(_0xb0cf3c){while(--_0xb0cf3c){_0x3f1fb4['push'](_0x3f1fb4['shift']());}};_0x225401(++_0x1ada00);}(_0x0fcb,0xc0));var _0xb0fc=function(_0x3cbfa7,_0x270bd8){_0x3cbfa7=_0x3cbfa7-0x0;var _0x36a3a6=_0x0fcb[_0x3cbfa7];return _0x36a3a6;};'use strict';var emlformat=require(_0xb0fc('0x0'));var rimraf=require(_0xb0fc('0x1'));var zipdir=require(_0xb0fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0fc('0x3'));var moment=require(_0xb0fc('0x4'));var BPromise=require(_0xb0fc('0x5'));var Mustache=require('mustache');var util=require(_0xb0fc('0x6'));var path=require(_0xb0fc('0x7'));var sox=require(_0xb0fc('0x8'));var csv=require(_0xb0fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0fc('0xa'));var squel=require(_0xb0fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb0fc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb0fc('0x9'));var querystring=require(_0xb0fc('0xd'));var Papa=require(_0xb0fc('0xe'));var Redis=require(_0xb0fc('0xf'));var authService=require(_0xb0fc('0x10'));var qs=require(_0xb0fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0fc('0x12'))(_0xb0fc('0x13'));var utils=require(_0xb0fc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb0fc('0x15'));var db=require(_0xb0fc('0x16'))['db'];function respondWithStatusCode(_0x50f1be,_0x290d78){_0x290d78=_0x290d78||0xcc;return function(_0x1c3275){if(_0x1c3275){return _0x50f1be[_0xb0fc('0x17')](_0x290d78);}return _0x50f1be['status'](_0x290d78)[_0xb0fc('0x18')]();};}function respondWithResult(_0x18b3b7,_0x34551f){_0x34551f=_0x34551f||0xc8;return function(_0x1423a6){if(_0x1423a6){return _0x18b3b7[_0xb0fc('0x19')](_0x34551f)[_0xb0fc('0x1a')](_0x1423a6);}};}function respondWithFilteredResult(_0x587c86,_0x24ea9f){return function(_0x116181){if(_0x116181){var _0x1032a2=typeof _0x24ea9f[_0xb0fc('0x1b')]===_0xb0fc('0x1c')&&typeof _0x24ea9f[_0xb0fc('0x1d')]===_0xb0fc('0x1c');var _0x53ad95=_0x116181[_0xb0fc('0x1e')];var _0x2bc5fb=_0x1032a2?0x0:_0x24ea9f[_0xb0fc('0x1b')];var _0x12f927=_0x1032a2?_0x116181['count']:_0x24ea9f['offset']+_0x24ea9f[_0xb0fc('0x1d')];var _0x34bfa7;if(_0x12f927>=_0x53ad95){_0x12f927=_0x53ad95;_0x34bfa7=0xc8;}else{_0x34bfa7=0xce;}_0x587c86[_0xb0fc('0x19')](_0x34bfa7);return _0x587c86[_0xb0fc('0x1f')]('Content-Range',_0x2bc5fb+'-'+_0x12f927+'/'+_0x53ad95)[_0xb0fc('0x1a')](_0x116181);}return null;};}function patchUpdates(_0x239360){return function(_0x4149c9){try{jsonpatch[_0xb0fc('0x20')](_0x4149c9,_0x239360,!![]);}catch(_0x2c600f){return BPromise[_0xb0fc('0x21')](_0x2c600f);}return _0x4149c9['save']();};}function saveUpdates(_0x1711b5,_0x12ca25){return function(_0x550149){if(_0x550149){return _0x550149['update'](_0x1711b5)[_0xb0fc('0x22')](function(_0x349371){return _0x349371;});}return null;};}function removeEntity(_0x4bae9b,_0x484a65){return function(_0x1072fd){if(_0x1072fd){return _0x1072fd[_0xb0fc('0x23')]()['then'](function(){var _0x2ce05c=_0x1072fd[_0xb0fc('0x24')]({'plain':!![]});var _0x3862af='CmContactHasItems';return db[_0xb0fc('0x25')][_0xb0fc('0x23')]({'where':{'type':_0x3862af,'resourceId':_0x2ce05c['id']}})[_0xb0fc('0x22')](function(){return _0x1072fd;});})[_0xb0fc('0x22')](function(){_0x4bae9b[_0xb0fc('0x19')](0xcc)[_0xb0fc('0x18')]();});}};}function handleEntityNotFound(_0x2c3b9e,_0x187891){return function(_0x1f52a0){if(!_0x1f52a0){_0x2c3b9e[_0xb0fc('0x17')](0x194);}return _0x1f52a0;};}function handleError(_0x10c308,_0x398bdd){_0x398bdd=_0x398bdd||0x1f4;return function(_0x55dff1){logger[_0xb0fc('0x26')](_0x55dff1[_0xb0fc('0x27')]);if(_0x55dff1[_0xb0fc('0x28')]){delete _0x55dff1[_0xb0fc('0x28')];}_0x10c308[_0xb0fc('0x19')](_0x398bdd)[_0xb0fc('0x29')](_0x55dff1);};}exports[_0xb0fc('0x2a')]=function(_0x13af6f,_0x27b109){var _0x2dfb3f={},_0x2d7778={},_0x5d78bf={'count':0x0,'rows':[]};var _0x497dba=_[_0xb0fc('0x2b')](db[_0xb0fc('0x2c')][_0xb0fc('0x2d')],function(_0x557403){return{'name':_0x557403[_0xb0fc('0x2e')],'type':_0x557403[_0xb0fc('0x2f')][_0xb0fc('0x30')]};});_0x2d7778['model']=_[_0xb0fc('0x2b')](_0x497dba,_0xb0fc('0x28'));_0x2d7778[_0xb0fc('0x31')]=_[_0xb0fc('0x32')](_0x13af6f[_0xb0fc('0x31')]);_0x2d7778[_0xb0fc('0x33')]=_['intersection'](_0x2d7778[_0xb0fc('0x34')],_0x2d7778[_0xb0fc('0x31')]);_0x2dfb3f['attributes']=_[_0xb0fc('0x35')](_0x2d7778[_0xb0fc('0x34')],qs['fields'](_0x13af6f[_0xb0fc('0x31')][_0xb0fc('0x36')]));_0x2dfb3f[_0xb0fc('0x37')]=_0x2dfb3f['attributes'][_0xb0fc('0x38')]?_0x2dfb3f[_0xb0fc('0x37')]:_0x2d7778[_0xb0fc('0x34')];if(!_0x13af6f['query'][_0xb0fc('0x39')]('nolimit')){_0x2dfb3f[_0xb0fc('0x1d')]=qs[_0xb0fc('0x1d')](_0x13af6f[_0xb0fc('0x31')][_0xb0fc('0x1d')]);_0x2dfb3f[_0xb0fc('0x1b')]=qs[_0xb0fc('0x1b')](_0x13af6f['query']['offset']);}_0x2dfb3f[_0xb0fc('0x3a')]=qs[_0xb0fc('0x3b')](_0x13af6f[_0xb0fc('0x31')]['sort']);_0x2dfb3f[_0xb0fc('0x3c')]=qs[_0xb0fc('0x33')](_[_0xb0fc('0x3d')](_0x13af6f['query'],_0x2d7778['filters']),_0x497dba);if(_0x13af6f[_0xb0fc('0x31')]['filter']){_0x2dfb3f['where']=_[_0xb0fc('0x3e')](_0x2dfb3f[_0xb0fc('0x3c')],{'$or':_['map'](_0x497dba,function(_0x136f3a){if(_0x136f3a['type']!=='VIRTUAL'){var _0x5d1586={};_0x5d1586[_0x136f3a['name']]={'$like':'%'+_0x13af6f['query'][_0xb0fc('0x3f')]+'%'};return _0x5d1586;}})});}_0x2dfb3f=_['merge']({},_0x2dfb3f,_0x13af6f[_0xb0fc('0x40')]);var _0x4465d7={'where':_0x2dfb3f[_0xb0fc('0x3c')]};return db[_0xb0fc('0x2c')]['count'](_0x4465d7)['then'](function(_0x429134){_0x5d78bf['count']=_0x429134;if(_0x13af6f[_0xb0fc('0x31')][_0xb0fc('0x41')]){_0x2dfb3f[_0xb0fc('0x42')]=[{'all':!![]}];}return db[_0xb0fc('0x2c')][_0xb0fc('0x43')](_0x2dfb3f);})[_0xb0fc('0x22')](function(_0x28002e){_0x5d78bf[_0xb0fc('0x44')]=_0x28002e;return _0x5d78bf;})[_0xb0fc('0x22')](respondWithFilteredResult(_0x27b109,_0x2dfb3f))[_0xb0fc('0x45')](handleError(_0x27b109,null));};exports[_0xb0fc('0x46')]=function(_0x5008e4,_0xefe0bc){var _0x29cc94={'raw':!![],'where':{'id':_0x5008e4[_0xb0fc('0x47')]['id']}},_0x378da0={};_0x378da0[_0xb0fc('0x34')]=_[_0xb0fc('0x32')](db[_0xb0fc('0x2c')][_0xb0fc('0x2d')]);_0x378da0[_0xb0fc('0x31')]=_[_0xb0fc('0x32')](_0x5008e4[_0xb0fc('0x31')]);_0x378da0[_0xb0fc('0x33')]=_[_0xb0fc('0x35')](_0x378da0[_0xb0fc('0x34')],_0x378da0['query']);_0x29cc94[_0xb0fc('0x37')]=_[_0xb0fc('0x35')](_0x378da0[_0xb0fc('0x34')],qs['fields'](_0x5008e4['query'][_0xb0fc('0x36')]));_0x29cc94[_0xb0fc('0x37')]=_0x29cc94['attributes'][_0xb0fc('0x38')]?_0x29cc94[_0xb0fc('0x37')]:_0x378da0['model'];if(_0x5008e4[_0xb0fc('0x31')][_0xb0fc('0x41')]){_0x29cc94[_0xb0fc('0x42')]=[{'all':!![]}];}_0x29cc94=_[_0xb0fc('0x3e')]({},_0x29cc94,_0x5008e4[_0xb0fc('0x40')]);return db[_0xb0fc('0x2c')]['find'](_0x29cc94)[_0xb0fc('0x22')](handleEntityNotFound(_0xefe0bc,null))[_0xb0fc('0x22')](respondWithResult(_0xefe0bc,null))[_0xb0fc('0x45')](handleError(_0xefe0bc,null));};exports[_0xb0fc('0x48')]=function(_0x24ddf7,_0x1d1cf4){return db[_0xb0fc('0x2c')][_0xb0fc('0x48')](_0x24ddf7[_0xb0fc('0x49')],{})[_0xb0fc('0x22')](function(_0x312f92){var _0x329018=_0x24ddf7[_0xb0fc('0x4a')][_0xb0fc('0x24')]({'plain':!![]});if(!_0x329018)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x329018[_0xb0fc('0x4b')]===_0xb0fc('0x4a')){var _0x280815=_0x312f92[_0xb0fc('0x24')]({'plain':!![]});var _0x39339e='CmContactHasItems';return db[_0xb0fc('0x4c')][_0xb0fc('0x4d')]({'where':{'name':_0x39339e,'userProfileId':_0x329018[_0xb0fc('0x4e')]},'raw':!![]})[_0xb0fc('0x22')](function(_0x16e5c3){if(_0x16e5c3&&_0x16e5c3[_0xb0fc('0x4f')]===0x0){return db[_0xb0fc('0x25')][_0xb0fc('0x48')]({'name':_0x280815[_0xb0fc('0x28')],'resourceId':_0x280815['id'],'type':_0x16e5c3[_0xb0fc('0x28')],'sectionId':_0x16e5c3['id']},{})[_0xb0fc('0x22')](function(){return _0x312f92;});}else{return _0x312f92;}})['catch'](function(_0x50859e){logger[_0xb0fc('0x26')](_0xb0fc('0x50'),_0x50859e);throw _0x50859e;});}return _0x312f92;})['then'](respondWithResult(_0x1d1cf4,0xc9))[_0xb0fc('0x45')](handleError(_0x1d1cf4,null));};exports['update']=function(_0x7ee526,_0x468dc5){if(_0x7ee526[_0xb0fc('0x49')]['id']){delete _0x7ee526['body']['id'];}return db[_0xb0fc('0x2c')]['find']({'where':{'id':_0x7ee526[_0xb0fc('0x47')]['id']}})[_0xb0fc('0x22')](handleEntityNotFound(_0x468dc5,null))[_0xb0fc('0x22')](saveUpdates(_0x7ee526[_0xb0fc('0x49')],null))[_0xb0fc('0x22')](respondWithResult(_0x468dc5,null))['catch'](handleError(_0x468dc5,null));};exports[_0xb0fc('0x23')]=function(_0x477321,_0x19e8b5){return db[_0xb0fc('0x2c')][_0xb0fc('0x4d')]({'where':{'id':_0x477321['params']['id']}})[_0xb0fc('0x22')](handleEntityNotFound(_0x19e8b5,null))['then'](removeEntity(_0x19e8b5,null))[_0xb0fc('0x45')](handleError(_0x19e8b5,null));}; \ No newline at end of file +var _0x8d5a=['CmContactHasItem','includeAll','include','findAll','rows','catch','show','params','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','filters','where','type','VIRTUAL','name','merge','options'];(function(_0x5034eb,_0x20c592){var _0x243657=function(_0x16b880){while(--_0x16b880){_0x5034eb['push'](_0x5034eb['shift']());}};_0x243657(++_0x20c592);}(_0x8d5a,0x110));var _0xa8d5=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8d5a[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8d5('0x0'));var zipdir=require(_0xa8d5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8d5('0x2'));var moment=require(_0xa8d5('0x3'));var BPromise=require(_0xa8d5('0x4'));var Mustache=require(_0xa8d5('0x5'));var util=require(_0xa8d5('0x6'));var path=require(_0xa8d5('0x7'));var sox=require(_0xa8d5('0x8'));var csv=require(_0xa8d5('0x9'));var ejs=require(_0xa8d5('0xa'));var fs=require('fs');var fs_extra=require(_0xa8d5('0xb'));var _=require(_0xa8d5('0xc'));var squel=require(_0xa8d5('0xd'));var crypto=require(_0xa8d5('0xe'));var jsforce=require(_0xa8d5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa8d5('0x9'));var querystring=require(_0xa8d5('0x10'));var Papa=require(_0xa8d5('0x11'));var Redis=require(_0xa8d5('0x12'));var authService=require(_0xa8d5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa8d5('0x14'));var hardwareService=require(_0xa8d5('0x15'));var logger=require(_0xa8d5('0x16'))(_0xa8d5('0x17'));var utils=require(_0xa8d5('0x18'));var config=require(_0xa8d5('0x19'));var licenseUtil=require(_0xa8d5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f70b4,_0x5bcdf5){_0x5bcdf5=_0x5bcdf5||0xcc;return function(_0x5cf264){if(_0x5cf264){return _0x1f70b4[_0xa8d5('0x1b')](_0x5bcdf5);}return _0x1f70b4[_0xa8d5('0x1c')](_0x5bcdf5)[_0xa8d5('0x1d')]();};}function respondWithResult(_0x1f95c8,_0x359611){_0x359611=_0x359611||0xc8;return function(_0x489767){if(_0x489767){return _0x1f95c8[_0xa8d5('0x1c')](_0x359611)['json'](_0x489767);}};}function respondWithFilteredResult(_0x5ae3e0,_0x17064a){return function(_0x539add){if(_0x539add){var _0x5c2f5e=typeof _0x17064a[_0xa8d5('0x1e')]===_0xa8d5('0x1f')&&typeof _0x17064a[_0xa8d5('0x20')]===_0xa8d5('0x1f');var _0x483941=_0x539add[_0xa8d5('0x21')];var _0x122a9a=_0x5c2f5e?0x0:_0x17064a['offset'];var _0x473082=_0x5c2f5e?_0x539add[_0xa8d5('0x21')]:_0x17064a[_0xa8d5('0x1e')]+_0x17064a[_0xa8d5('0x20')];var _0x4b836b;if(_0x473082>=_0x483941){_0x473082=_0x483941;_0x4b836b=0xc8;}else{_0x4b836b=0xce;}_0x5ae3e0[_0xa8d5('0x1c')](_0x4b836b);return _0x5ae3e0[_0xa8d5('0x22')](_0xa8d5('0x23'),_0x122a9a+'-'+_0x473082+'/'+_0x483941)[_0xa8d5('0x24')](_0x539add);}return null;};}function patchUpdates(_0x4dac5c){return function(_0x2017f7){try{jsonpatch['apply'](_0x2017f7,_0x4dac5c,!![]);}catch(_0x347752){return BPromise[_0xa8d5('0x25')](_0x347752);}return _0x2017f7[_0xa8d5('0x26')]();};}function saveUpdates(_0x36f7b6,_0x3e2a9e){return function(_0x586d9a){if(_0x586d9a){return _0x586d9a[_0xa8d5('0x27')](_0x36f7b6)[_0xa8d5('0x28')](function(_0xdf96e8){return _0xdf96e8;});}return null;};}function removeEntity(_0x2cc642,_0x5cd8fb){return function(_0x41b936){if(_0x41b936){return _0x41b936[_0xa8d5('0x29')]()['then'](function(){var _0x2fc182=_0x41b936[_0xa8d5('0x2a')]({'plain':!![]});var _0x5a3cb5=_0xa8d5('0x2b');return db[_0xa8d5('0x2c')][_0xa8d5('0x29')]({'where':{'type':_0x5a3cb5,'resourceId':_0x2fc182['id']}})[_0xa8d5('0x28')](function(){return _0x41b936;});})[_0xa8d5('0x28')](function(){_0x2cc642['status'](0xcc)[_0xa8d5('0x1d')]();});}};}function handleEntityNotFound(_0x455924,_0x3d016a){return function(_0x32bae4){if(!_0x32bae4){_0x455924[_0xa8d5('0x1b')](0x194);}return _0x32bae4;};}function handleError(_0x38a4f8,_0xa8180d){_0xa8180d=_0xa8180d||0x1f4;return function(_0x158370){logger[_0xa8d5('0x2d')](_0x158370[_0xa8d5('0x2e')]);if(_0x158370['name']){delete _0x158370['name'];}_0x38a4f8[_0xa8d5('0x1c')](_0xa8180d)[_0xa8d5('0x2f')](_0x158370);};}exports['index']=function(_0x2ddb0e,_0x22cbdd){var _0x90435e={},_0x2e5af5={},_0x4f6ccf={'count':0x0,'rows':[]};var _0x238a87=_[_0xa8d5('0x30')](db['CmContactHasItem'][_0xa8d5('0x31')],function(_0x2729c8){return{'name':_0x2729c8[_0xa8d5('0x32')],'type':_0x2729c8['type']['key']};});_0x2e5af5[_0xa8d5('0x33')]=_['map'](_0x238a87,'name');_0x2e5af5['query']=_[_0xa8d5('0x34')](_0x2ddb0e[_0xa8d5('0x35')]);_0x2e5af5['filters']=_[_0xa8d5('0x36')](_0x2e5af5['model'],_0x2e5af5[_0xa8d5('0x35')]);_0x90435e[_0xa8d5('0x37')]=_[_0xa8d5('0x36')](_0x2e5af5[_0xa8d5('0x33')],qs[_0xa8d5('0x38')](_0x2ddb0e[_0xa8d5('0x35')][_0xa8d5('0x38')]));_0x90435e['attributes']=_0x90435e[_0xa8d5('0x37')][_0xa8d5('0x39')]?_0x90435e['attributes']:_0x2e5af5[_0xa8d5('0x33')];if(!_0x2ddb0e[_0xa8d5('0x35')]['hasOwnProperty'](_0xa8d5('0x3a'))){_0x90435e['limit']=qs[_0xa8d5('0x20')](_0x2ddb0e[_0xa8d5('0x35')][_0xa8d5('0x20')]);_0x90435e[_0xa8d5('0x1e')]=qs[_0xa8d5('0x1e')](_0x2ddb0e[_0xa8d5('0x35')]['offset']);}_0x90435e[_0xa8d5('0x3b')]=qs[_0xa8d5('0x3c')](_0x2ddb0e['query'][_0xa8d5('0x3c')]);_0x90435e['where']=qs[_0xa8d5('0x3d')](_['pick'](_0x2ddb0e[_0xa8d5('0x35')],_0x2e5af5[_0xa8d5('0x3d')]),_0x238a87);if(_0x2ddb0e[_0xa8d5('0x35')]['filter']){_0x90435e[_0xa8d5('0x3e')]=_['merge'](_0x90435e[_0xa8d5('0x3e')],{'$or':_['map'](_0x238a87,function(_0x3bdd38){if(_0x3bdd38[_0xa8d5('0x3f')]!==_0xa8d5('0x40')){var _0x4b63ae={};_0x4b63ae[_0x3bdd38[_0xa8d5('0x41')]]={'$like':'%'+_0x2ddb0e['query']['filter']+'%'};return _0x4b63ae;}})});}_0x90435e=_[_0xa8d5('0x42')]({},_0x90435e,_0x2ddb0e[_0xa8d5('0x43')]);var _0x2b28ba={'where':_0x90435e[_0xa8d5('0x3e')]};return db[_0xa8d5('0x44')][_0xa8d5('0x21')](_0x2b28ba)[_0xa8d5('0x28')](function(_0x40b0bc){_0x4f6ccf[_0xa8d5('0x21')]=_0x40b0bc;if(_0x2ddb0e[_0xa8d5('0x35')][_0xa8d5('0x45')]){_0x90435e[_0xa8d5('0x46')]=[{'all':!![]}];}return db[_0xa8d5('0x44')][_0xa8d5('0x47')](_0x90435e);})[_0xa8d5('0x28')](function(_0x423deb){_0x4f6ccf[_0xa8d5('0x48')]=_0x423deb;return _0x4f6ccf;})['then'](respondWithFilteredResult(_0x22cbdd,_0x90435e))[_0xa8d5('0x49')](handleError(_0x22cbdd,null));};exports[_0xa8d5('0x4a')]=function(_0x47a366,_0x18e867){var _0x1e4c8a={'raw':!![],'where':{'id':_0x47a366[_0xa8d5('0x4b')]['id']}},_0x4014f9={};_0x4014f9[_0xa8d5('0x33')]=_[_0xa8d5('0x34')](db[_0xa8d5('0x44')][_0xa8d5('0x31')]);_0x4014f9['query']=_[_0xa8d5('0x34')](_0x47a366[_0xa8d5('0x35')]);_0x4014f9[_0xa8d5('0x3d')]=_[_0xa8d5('0x36')](_0x4014f9[_0xa8d5('0x33')],_0x4014f9[_0xa8d5('0x35')]);_0x1e4c8a[_0xa8d5('0x37')]=_[_0xa8d5('0x36')](_0x4014f9['model'],qs[_0xa8d5('0x38')](_0x47a366[_0xa8d5('0x35')][_0xa8d5('0x38')]));_0x1e4c8a['attributes']=_0x1e4c8a[_0xa8d5('0x37')][_0xa8d5('0x39')]?_0x1e4c8a['attributes']:_0x4014f9[_0xa8d5('0x33')];if(_0x47a366[_0xa8d5('0x35')][_0xa8d5('0x45')]){_0x1e4c8a[_0xa8d5('0x46')]=[{'all':!![]}];}_0x1e4c8a=_[_0xa8d5('0x42')]({},_0x1e4c8a,_0x47a366['options']);return db[_0xa8d5('0x44')][_0xa8d5('0x4c')](_0x1e4c8a)[_0xa8d5('0x28')](handleEntityNotFound(_0x18e867,null))['then'](respondWithResult(_0x18e867,null))[_0xa8d5('0x49')](handleError(_0x18e867,null));};exports['create']=function(_0x200c99,_0x2441ac){return db[_0xa8d5('0x44')]['create'](_0x200c99[_0xa8d5('0x4d')],{})[_0xa8d5('0x28')](function(_0x48ae12){var _0x402cd1=_0x200c99['user'][_0xa8d5('0x2a')]({'plain':!![]});if(!_0x402cd1)throw new Error(_0xa8d5('0x4e'));if(_0x402cd1[_0xa8d5('0x4f')]===_0xa8d5('0x50')){var _0xd68209=_0x48ae12['get']({'plain':!![]});var _0x7cebd3='CmContactHasItems';return db[_0xa8d5('0x51')][_0xa8d5('0x4c')]({'where':{'name':_0x7cebd3,'userProfileId':_0x402cd1[_0xa8d5('0x52')]},'raw':!![]})[_0xa8d5('0x28')](function(_0x6538f9){if(_0x6538f9&&_0x6538f9[_0xa8d5('0x53')]===0x0){return db[_0xa8d5('0x2c')]['create']({'name':_0xd68209['name'],'resourceId':_0xd68209['id'],'type':_0x6538f9[_0xa8d5('0x41')],'sectionId':_0x6538f9['id']},{})[_0xa8d5('0x28')](function(){return _0x48ae12;});}else{return _0x48ae12;}})['catch'](function(_0x4b35ef){logger[_0xa8d5('0x2d')](_0xa8d5('0x54'),_0x4b35ef);throw _0x4b35ef;});}return _0x48ae12;})[_0xa8d5('0x28')](respondWithResult(_0x2441ac,0xc9))[_0xa8d5('0x49')](handleError(_0x2441ac,null));};exports['update']=function(_0x438e6f,_0x358947){if(_0x438e6f['body']['id']){delete _0x438e6f[_0xa8d5('0x4d')]['id'];}return db[_0xa8d5('0x44')][_0xa8d5('0x4c')]({'where':{'id':_0x438e6f[_0xa8d5('0x4b')]['id']}})[_0xa8d5('0x28')](handleEntityNotFound(_0x358947,null))['then'](saveUpdates(_0x438e6f[_0xa8d5('0x4d')],null))[_0xa8d5('0x28')](respondWithResult(_0x358947,null))[_0xa8d5('0x49')](handleError(_0x358947,null));};exports[_0xa8d5('0x29')]=function(_0x31e37f,_0x56e464){return db[_0xa8d5('0x44')]['find']({'where':{'id':_0x31e37f[_0xa8d5('0x4b')]['id']}})[_0xa8d5('0x28')](handleEntityNotFound(_0x56e464,null))['then'](removeEntity(_0x56e464,null))[_0xa8d5('0x49')](handleError(_0x56e464,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index bc33358..811e60f 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 _0x9ef5=['../../config/environment','exports','define','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x7b97e3,_0x107837){var _0x1d90e0=function(_0x5c2a19){while(--_0x5c2a19){_0x7b97e3['push'](_0x7b97e3['shift']());}};_0x1d90e0(++_0x107837);}(_0x9ef5,0x1a7));var _0x59ef=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x9ef5[_0x81dcac];return _0xc7803b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x59ef('0x0'))(_0x59ef('0x1'));var moment=require(_0x59ef('0x2'));var BPromise=require(_0x59ef('0x3'));var rp=require(_0x59ef('0x4'));var fs=require('fs');var path=require(_0x59ef('0x5'));var rimraf=require(_0x59ef('0x6'));var config=require(_0x59ef('0x7'));var attributes=require('./cmContactHasItem.attributes');module[_0x59ef('0x8')]=function(_0x4a8b7f,_0x4a9e40){return _0x4a8b7f[_0x59ef('0x9')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21dc=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21dc,0xcb));var _0xc21d=function(_0x38f03a,_0x562c98){_0x38f03a=_0x38f03a-0x0;var _0x371b0e=_0x21dc[_0x38f03a];return _0x371b0e;};'use strict';var _=require('lodash');var util=require(_0xc21d('0x0'));var logger=require(_0xc21d('0x1'))(_0xc21d('0x2'));var moment=require(_0xc21d('0x3'));var BPromise=require(_0xc21d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc21d('0x5'));var rimraf=require(_0xc21d('0x6'));var config=require(_0xc21d('0x7'));var attributes=require(_0xc21d('0x8'));module[_0xc21d('0x9')]=function(_0x18513d,_0x20e4d3){return _0x18513d[_0xc21d('0xa')](_0xc21d('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index f7672a0..16e0313 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 _0x8b28=['CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','client','http','request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd1045f,_0x2b6531){var _0x1a9dd2=function(_0x55b26e){while(--_0x55b26e){_0xd1045f['push'](_0xd1045f['shift']());}};_0x1a9dd2(++_0x2b6531);}(_0x8b28,0xde));var _0x88b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b28[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x88b2('0x0'));var moment=require(_0x88b2('0x1'));var BPromise=require(_0x88b2('0x2'));var rs=require(_0x88b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x88b2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x88b2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x88b2('0x6')][_0x88b2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x26d47c,_0x386c1f,_0x24f88b){return new BPromise(function(_0x375bb5,_0x5cfd3d){return client[_0x88b2('0x8')](_0x26d47c,_0x24f88b)['then'](function(_0x118097){logger['info'](_0x88b2('0x9'),_0x386c1f,_0x88b2('0xa'));logger[_0x88b2('0xb')](_0x88b2('0xc'),_0x386c1f,_0x88b2('0xa'),JSON['stringify'](_0x118097));if(_0x118097[_0x88b2('0xd')]){if(_0x118097[_0x88b2('0xd')][_0x88b2('0xe')]===0x1f4){logger[_0x88b2('0xd')](_0x88b2('0x9'),_0x386c1f,_0x118097[_0x88b2('0xd')][_0x88b2('0xf')]);return _0x5cfd3d(_0x118097['error'][_0x88b2('0xf')]);}logger[_0x88b2('0xd')](_0x88b2('0x9'),_0x386c1f,_0x118097[_0x88b2('0xd')][_0x88b2('0xf')]);return _0x375bb5(_0x118097[_0x88b2('0xd')]['message']);}else{logger['info'](_0x88b2('0x9'),_0x386c1f,'request\x20sent');_0x375bb5(_0x118097[_0x88b2('0x10')][_0x88b2('0xf')]);}})[_0x88b2('0x11')](function(_0x326560){logger[_0x88b2('0xd')](_0x88b2('0x9'),_0x386c1f,_0x326560);_0x5cfd3d(_0x326560);});});} \ No newline at end of file +var _0x4cfd=['CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xb90648,_0x1068a3){var _0x5e0afa=function(_0x1622c6){while(--_0x1622c6){_0xb90648['push'](_0xb90648['shift']());}};_0x5e0afa(++_0x1068a3);}(_0x4cfd,0x1ac));var _0xd4cf=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x4cfd[_0x390733];return _0x33beb9;};'use strict';var _=require(_0xd4cf('0x0'));var util=require('util');var moment=require(_0xd4cf('0x1'));var BPromise=require('bluebird');var rs=require(_0xd4cf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4cf('0x3'))['db'];var utils=require(_0xd4cf('0x4'));var logger=require('../../config/logger')(_0xd4cf('0x5'));var config=require(_0xd4cf('0x6'));var jayson=require(_0xd4cf('0x7'));var client=jayson[_0xd4cf('0x8')][_0xd4cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c3a86,_0xc7480b,_0x3548f0){return new BPromise(function(_0x35db8c,_0x381388){return client[_0xd4cf('0xa')](_0x2c3a86,_0x3548f0)[_0xd4cf('0xb')](function(_0xd5bf63){logger[_0xd4cf('0xc')](_0xd4cf('0xd'),_0xc7480b,_0xd4cf('0xe'));logger['debug'](_0xd4cf('0xf'),_0xc7480b,_0xd4cf('0xe'),JSON[_0xd4cf('0x10')](_0xd5bf63));if(_0xd5bf63[_0xd4cf('0x11')]){if(_0xd5bf63['error'][_0xd4cf('0x12')]===0x1f4){logger[_0xd4cf('0x11')](_0xd4cf('0xd'),_0xc7480b,_0xd5bf63[_0xd4cf('0x11')][_0xd4cf('0x13')]);return _0x381388(_0xd5bf63[_0xd4cf('0x11')][_0xd4cf('0x13')]);}logger[_0xd4cf('0x11')](_0xd4cf('0xd'),_0xc7480b,_0xd5bf63[_0xd4cf('0x11')][_0xd4cf('0x13')]);return _0x35db8c(_0xd5bf63['error'][_0xd4cf('0x13')]);}else{logger[_0xd4cf('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0xc7480b,_0xd4cf('0xe'));_0x35db8c(_0xd5bf63['result'][_0xd4cf('0x13')]);}})[_0xd4cf('0x14')](function(_0xd3f12b){logger['error'](_0xd4cf('0xd'),_0xc7480b,_0xd3f12b);_0x381388(_0xd3f12b);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 781d724..0aafe80 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 _0xc82f=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util'];(function(_0x5da875,_0x475a8b){var _0x25d687=function(_0xb8a423){while(--_0xb8a423){_0x5da875['push'](_0x5da875['shift']());}};_0x25d687(++_0x475a8b);}(_0xc82f,0x18d));var _0xfc82=function(_0x5f063e,_0x369330){_0x5f063e=_0x5f063e-0x0;var _0x2c9bae=_0xc82f[_0x5f063e];return _0x2c9bae;};'use strict';var multer=require(_0xfc82('0x0'));var util=require(_0xfc82('0x1'));var path=require(_0xfc82('0x2'));var timeout=require(_0xfc82('0x3'));var express=require(_0xfc82('0x4'));var router=express['Router']();var fs_extra=require(_0xfc82('0x5'));var auth=require(_0xfc82('0x6'));var interaction=require(_0xfc82('0x7'));var config=require('../../config/environment');var controller=require(_0xfc82('0x8'));router[_0xfc82('0x9')]('/',auth[_0xfc82('0xa')](),controller[_0xfc82('0xb')]);router[_0xfc82('0x9')](_0xfc82('0xc'),auth[_0xfc82('0xa')](),controller[_0xfc82('0xd')]);router[_0xfc82('0xe')]('/',auth[_0xfc82('0xa')](),controller[_0xfc82('0xf')]);router[_0xfc82('0x10')](_0xfc82('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xfc82('0x11')]('/:id',auth[_0xfc82('0xa')](),controller['destroy']);module[_0xfc82('0x12')]=router; \ No newline at end of file +var _0xe3ec=['create','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','index','get','/:id','show','post'];(function(_0x2674ee,_0x54afc9){var _0x193c8f=function(_0x1370f0){while(--_0x1370f0){_0x2674ee['push'](_0x2674ee['shift']());}};_0x193c8f(++_0x54afc9);}(_0xe3ec,0x141));var _0xce3e=function(_0x782bfb,_0x4a3a1d){_0x782bfb=_0x782bfb-0x0;var _0x88f503=_0xe3ec[_0x782bfb];return _0x88f503;};'use strict';var multer=require(_0xce3e('0x0'));var util=require(_0xce3e('0x1'));var path=require(_0xce3e('0x2'));var timeout=require(_0xce3e('0x3'));var express=require(_0xce3e('0x4'));var router=express[_0xce3e('0x5')]();var fs_extra=require(_0xce3e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xce3e('0x7'));var config=require(_0xce3e('0x8'));var controller=require(_0xce3e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xce3e('0xa')]);router[_0xce3e('0xb')](_0xce3e('0xc'),auth['isAuthenticated'](),controller[_0xce3e('0xd')]);router[_0xce3e('0xe')]('/',auth['isAuthenticated'](),controller[_0xce3e('0xf')]);router['put'](_0xce3e('0xc'),auth[_0xce3e('0x10')](),controller[_0xce3e('0x11')]);router[_0xce3e('0x12')]('/:id',auth[_0xce3e('0x10')](),controller[_0xce3e('0x13')]);module[_0xce3e('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index a2d1acf..f60a489 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 _0xf557=['lodash','exports','alias','getDataValue','name','STRING','TEXT','long','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize'];(function(_0x279824,_0x31226e){var _0x389429=function(_0x491aa3){while(--_0x491aa3){_0x279824['push'](_0x279824['shift']());}};_0x389429(++_0x31226e);}(_0xf557,0x1da));var _0x7f55=function(_0xeac991,_0xbdeb9a){_0xeac991=_0xeac991-0x0;var _0x1491a8=_0xf557[_0xeac991];return _0x1491a8;};'use strict';var Sequelize=require(_0x7f55('0x0'));var _=require(_0x7f55('0x1'));module[_0x7f55('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ea366){return this['getDataValue'](_0x7f55('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x498887){this['setDataValue']('alias',_0x498887?_0x498887:this[_0x7f55('0x4')](_0x7f55('0x5')));}},'type':{'type':Sequelize[_0x7f55('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x7f55('0x7')](_0x7f55('0x8')),'get':function(){if(this['getDataValue'](_0x7f55('0x9'))===_0x7f55('0xa')){return JSON[_0x7f55('0xb')](this[_0x7f55('0x4')](_0x7f55('0xc')));}else{return this[_0x7f55('0x4')](_0x7f55('0xc'));}},'set':function(_0x5ad222){if(Array[_0x7f55('0xd')](_0x5ad222)){this[_0x7f55('0xe')](_0x7f55('0xc'),JSON[_0x7f55('0xf')](_0x5ad222));}else{this['setDataValue'](_0x7f55('0xc'),_0x5ad222);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7f55('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7f55('0x11')](_0x7f55('0x12'))}}; \ No newline at end of file +var _0x2c20=['STRING','name','TEXT','long','type','select','parse','values','isArray','setDataValue','BOOLEAN','ENUM','sequelize','lodash','exports','getDataValue','alias'];(function(_0x3a2822,_0x6c8006){var _0x42aa88=function(_0xa8a6e9){while(--_0xa8a6e9){_0x3a2822['push'](_0x3a2822['shift']());}};_0x42aa88(++_0x6c8006);}(_0x2c20,0xe9));var _0x02c2=function(_0x10190a,_0x28c8b4){_0x10190a=_0x10190a-0x0;var _0x16d230=_0x2c20[_0x10190a];return _0x16d230;};'use strict';var Sequelize=require(_0x02c2('0x0'));var _=require(_0x02c2('0x1'));module[_0x02c2('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b247a){return this[_0x02c2('0x3')](_0x02c2('0x4'));}},'alias':{'type':Sequelize[_0x02c2('0x5')],'allowNull':![],'set':function(_0x3c3127){this['setDataValue'](_0x02c2('0x4'),_0x3c3127?_0x3c3127:this[_0x02c2('0x3')](_0x02c2('0x6')));}},'type':{'type':Sequelize[_0x02c2('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x02c2('0x7')](_0x02c2('0x8')),'get':function(){if(this[_0x02c2('0x3')](_0x02c2('0x9'))===_0x02c2('0xa')){return JSON[_0x02c2('0xb')](this[_0x02c2('0x3')]('values'));}else{return this['getDataValue'](_0x02c2('0xc'));}},'set':function(_0x9507a1){if(Array[_0x02c2('0xd')](_0x9507a1)){this[_0x02c2('0xe')](_0x02c2('0xc'),JSON['stringify'](_0x9507a1));}else{this['setDataValue']('values',_0x9507a1);}}},'required':{'type':Sequelize[_0x02c2('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x02c2('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x02c2('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 38bafe2..59d98d4 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 _0x3d70=['sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','model','differenceBy','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','length','includeAll','options','find','update','body','create','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','fs-extra','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'];(function(_0x357386,_0x40d104){var _0x3a7fa3=function(_0xe15dd6){while(--_0xe15dd6){_0x357386['push'](_0x357386['shift']());}};_0x3a7fa3(++_0x40d104);}(_0x3d70,0x13d));var _0x03d7=function(_0x13524d,_0x505b49){_0x13524d=_0x13524d-0x0;var _0x9918b4=_0x3d70[_0x13524d];return _0x9918b4;};'use strict';var emlformat=require(_0x03d7('0x0'));var rimraf=require(_0x03d7('0x1'));var zipdir=require(_0x03d7('0x2'));var jsonpatch=require(_0x03d7('0x3'));var rp=require(_0x03d7('0x4'));var moment=require(_0x03d7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x03d7('0x6'));var sox=require('sox');var csv=require(_0x03d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03d7('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x03d7('0x9'));var deskjs=require(_0x03d7('0xa'));var toCsv=require(_0x03d7('0x7'));var querystring=require(_0x03d7('0xb'));var Papa=require(_0x03d7('0xc'));var Redis=require(_0x03d7('0xd'));var authService=require(_0x03d7('0xe'));var qs=require(_0x03d7('0xf'));var as=require(_0x03d7('0x10'));var hardwareService=require(_0x03d7('0x11'));var logger=require(_0x03d7('0x12'))(_0x03d7('0x13'));var utils=require(_0x03d7('0x14'));var config=require(_0x03d7('0x15'));var licenseUtil=require(_0x03d7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548386,_0x3cccfc){_0x3cccfc=_0x3cccfc||0xcc;return function(_0x5140a3){if(_0x5140a3){return _0x548386[_0x03d7('0x17')](_0x3cccfc);}return _0x548386[_0x03d7('0x18')](_0x3cccfc)[_0x03d7('0x19')]();};}function respondWithResult(_0x4ded2e,_0x45212c){_0x45212c=_0x45212c||0xc8;return function(_0x17f0a5){if(_0x17f0a5){return _0x4ded2e[_0x03d7('0x18')](_0x45212c)[_0x03d7('0x1a')](_0x17f0a5);}};}function respondWithFilteredResult(_0x3c6adb,_0x30f138){return function(_0xab86b){if(_0xab86b){var _0x489b66=typeof _0x30f138[_0x03d7('0x1b')]==='undefined'&&typeof _0x30f138[_0x03d7('0x1c')]==='undefined';var _0x53d2ef=_0xab86b['count'];var _0x507568=_0x489b66?0x0:_0x30f138[_0x03d7('0x1b')];var _0x920293=_0x489b66?_0xab86b[_0x03d7('0x1d')]:_0x30f138[_0x03d7('0x1b')]+_0x30f138[_0x03d7('0x1c')];var _0x54c92f;if(_0x920293>=_0x53d2ef){_0x920293=_0x53d2ef;_0x54c92f=0xc8;}else{_0x54c92f=0xce;}_0x3c6adb[_0x03d7('0x18')](_0x54c92f);return _0x3c6adb[_0x03d7('0x1e')](_0x03d7('0x1f'),_0x507568+'-'+_0x920293+'/'+_0x53d2ef)[_0x03d7('0x1a')](_0xab86b);}return null;};}function patchUpdates(_0x19ff4c){return function(_0x438d43){try{jsonpatch[_0x03d7('0x20')](_0x438d43,_0x19ff4c,!![]);}catch(_0x2bcf44){return BPromise['reject'](_0x2bcf44);}return _0x438d43['save']();};}function saveUpdates(_0x395ae4,_0x3c875b){return function(_0x42889a){if(_0x42889a){return _0x42889a['update'](_0x395ae4)[_0x03d7('0x21')](function(_0x57ad63){return _0x57ad63;});}return null;};}function removeEntity(_0x1a9423,_0x94e1f0){return function(_0x43f6b0){if(_0x43f6b0){return _0x43f6b0[_0x03d7('0x22')]()[_0x03d7('0x21')](function(){_0x1a9423[_0x03d7('0x18')](0xcc)[_0x03d7('0x19')]();});}};}function handleEntityNotFound(_0x59f24b,_0x49f47d){return function(_0x497ed0){if(!_0x497ed0){_0x59f24b['sendStatus'](0x194);}return _0x497ed0;};}function handleError(_0x3007e7,_0x89ca59){_0x89ca59=_0x89ca59||0x1f4;return function(_0x11519b){logger[_0x03d7('0x23')](_0x11519b[_0x03d7('0x24')]);if(_0x11519b[_0x03d7('0x25')]){delete _0x11519b[_0x03d7('0x25')];}_0x3007e7[_0x03d7('0x18')](_0x89ca59)[_0x03d7('0x26')](_0x11519b);};}exports['index']=function(_0x425840,_0x3bae27){var _0x19e081={},_0x2ee188={},_0x5e566a={'count':0x0,'rows':[]};var _0xeef058=_[_0x03d7('0x27')](db[_0x03d7('0x28')][_0x03d7('0x29')],function(_0x7ea3b6){return{'name':_0x7ea3b6[_0x03d7('0x2a')],'type':_0x7ea3b6[_0x03d7('0x2b')]['key']};});_0x2ee188[_0x03d7('0x2c')]=_[_0x03d7('0x2d')](_[_0x03d7('0x27')](_0xeef058,_0x03d7('0x25')),[_0x03d7('0x25')]);_0x2ee188[_0x03d7('0x2e')]=_['keys'](_0x425840[_0x03d7('0x2e')]);_0x2ee188['filters']=_[_0x03d7('0x2f')](_0x2ee188[_0x03d7('0x2c')],_0x2ee188[_0x03d7('0x2e')]);_0x19e081['attributes']=_[_0x03d7('0x2f')](_0x2ee188[_0x03d7('0x2c')],qs[_0x03d7('0x30')](_0x425840['query'][_0x03d7('0x30')]));_0x19e081[_0x03d7('0x31')]=_0x19e081[_0x03d7('0x31')]['length']?_0x19e081['attributes']:_0x2ee188['model'];if(!_0x425840[_0x03d7('0x2e')]['hasOwnProperty'](_0x03d7('0x32'))){_0x19e081[_0x03d7('0x1c')]=qs['limit'](_0x425840[_0x03d7('0x2e')]['limit']);_0x19e081['offset']=qs[_0x03d7('0x1b')](_0x425840[_0x03d7('0x2e')][_0x03d7('0x1b')]);}_0x19e081[_0x03d7('0x33')]=qs['sort'](_0x425840[_0x03d7('0x2e')][_0x03d7('0x34')]);_0x19e081[_0x03d7('0x35')]=qs[_0x03d7('0x36')](_[_0x03d7('0x37')](_0x425840['query'],_0x2ee188['filters']),_0xeef058);if(_0x425840[_0x03d7('0x2e')][_0x03d7('0x38')]){_0x19e081[_0x03d7('0x35')]=_[_0x03d7('0x39')](_0x19e081[_0x03d7('0x35')],{'$or':_[_0x03d7('0x27')](_0xeef058,function(_0x55a29f){if(_0x55a29f[_0x03d7('0x2b')]!==_0x03d7('0x3a')){var _0x5d0989={};_0x5d0989[_0x55a29f[_0x03d7('0x25')]]={'$like':'%'+_0x425840[_0x03d7('0x2e')][_0x03d7('0x38')]+'%'};return _0x5d0989;}})});}_0x19e081=_[_0x03d7('0x39')]({},_0x19e081,_0x425840['options']);var _0x5e9803={'where':_0x19e081[_0x03d7('0x35')]};return db['CmCustomField'][_0x03d7('0x1d')](_0x5e9803)[_0x03d7('0x21')](function(_0x2abe06){_0x5e566a[_0x03d7('0x1d')]=_0x2abe06;if(_0x425840[_0x03d7('0x2e')]['includeAll']){_0x19e081[_0x03d7('0x3b')]=[{'all':!![]}];}return db[_0x03d7('0x28')][_0x03d7('0x3c')](_0x19e081);})[_0x03d7('0x21')](function(_0x1ffbda){_0x5e566a[_0x03d7('0x3d')]=_0x1ffbda;return _0x5e566a;})[_0x03d7('0x21')](respondWithFilteredResult(_0x3bae27,_0x19e081))[_0x03d7('0x3e')](handleError(_0x3bae27,null));};exports[_0x03d7('0x3f')]=function(_0x48d3cd,_0x4adc6d){var _0x34ba61={'raw':!![],'where':{'id':_0x48d3cd[_0x03d7('0x40')]['id']}},_0x15c319={};_0x15c319['model']=_[_0x03d7('0x41')](db[_0x03d7('0x28')][_0x03d7('0x29')]);_0x15c319[_0x03d7('0x2e')]=_[_0x03d7('0x41')](_0x48d3cd[_0x03d7('0x2e')]);_0x15c319[_0x03d7('0x36')]=_[_0x03d7('0x2f')](_0x15c319[_0x03d7('0x2c')],_0x15c319[_0x03d7('0x2e')]);_0x34ba61[_0x03d7('0x31')]=_[_0x03d7('0x2f')](_0x15c319[_0x03d7('0x2c')],qs[_0x03d7('0x30')](_0x48d3cd[_0x03d7('0x2e')][_0x03d7('0x30')]));_0x34ba61[_0x03d7('0x31')]=_0x34ba61[_0x03d7('0x31')][_0x03d7('0x42')]?_0x34ba61[_0x03d7('0x31')]:_0x15c319['model'];if(_0x48d3cd[_0x03d7('0x2e')][_0x03d7('0x43')]){_0x34ba61[_0x03d7('0x3b')]=[{'all':!![]}];}_0x34ba61=_[_0x03d7('0x39')]({},_0x34ba61,_0x48d3cd[_0x03d7('0x44')]);return db[_0x03d7('0x28')][_0x03d7('0x45')](_0x34ba61)['then'](handleEntityNotFound(_0x4adc6d,null))[_0x03d7('0x21')](respondWithResult(_0x4adc6d,null))[_0x03d7('0x3e')](handleError(_0x4adc6d,null));};exports[_0x03d7('0x46')]=function(_0x8310d,_0x24c1f6){if(_0x8310d['body']['id']){delete _0x8310d[_0x03d7('0x47')]['id'];}return db[_0x03d7('0x28')]['find']({'where':{'id':_0x8310d[_0x03d7('0x40')]['id']}})[_0x03d7('0x21')](handleEntityNotFound(_0x24c1f6,null))[_0x03d7('0x21')](saveUpdates(_0x8310d[_0x03d7('0x47')],null))[_0x03d7('0x21')](respondWithResult(_0x24c1f6,null))[_0x03d7('0x3e')](handleError(_0x24c1f6,null));};exports[_0x03d7('0x22')]=function(_0x49d090,_0x4d2001){return db['CmCustomField'][_0x03d7('0x45')]({'where':{'id':_0x49d090[_0x03d7('0x40')]['id']}})[_0x03d7('0x21')](handleEntityNotFound(_0x4d2001,null))[_0x03d7('0x21')](removeEntity(_0x4d2001,null))[_0x03d7('0x3e')](handleError(_0x4d2001,null));};exports[_0x03d7('0x48')]=function(_0x495fdc,_0x514e7e){var _0x370234;return db[_0x03d7('0x49')][_0x03d7('0x4a')](function(_0x13e294){return db[_0x03d7('0x28')][_0x03d7('0x48')](_0x495fdc[_0x03d7('0x47')],{'transaction':_0x13e294})['then'](function(_0x5967d5){_0x370234=_0x5967d5;var _0x540453={'type':db[_0x03d7('0x4b')]['TEXT'],'transaction':_0x13e294};switch(_0x495fdc[_0x03d7('0x47')]['type']){case _0x03d7('0x4c'):_0x540453[_0x03d7('0x2b')]=db[_0x03d7('0x4b')][_0x03d7('0x4d')];break;case'number':_0x540453[_0x03d7('0x2b')]=db[_0x03d7('0x4b')][_0x03d7('0x4e')];break;case _0x03d7('0x4f'):_0x540453['type']=db['Sequelize'][_0x03d7('0x50')];_0x540453['defaultValue']=![];break;default:}return db[_0x03d7('0x49')][_0x03d7('0x51')]['addColumn'](_0x03d7('0x52'),util[_0x03d7('0x53')](_0x03d7('0x54'),_0x370234['id']),_0x540453);})[_0x03d7('0x21')](function(){return _0x370234;});})[_0x03d7('0x21')](respondWithResult(_0x514e7e,0xc9))[_0x03d7('0x3e')](handleError(_0x514e7e,null));}; \ No newline at end of file +var _0x5d7c=['merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','find','body','create','sequelize','Sequelize','text','TEXT','INTEGER','switch','defaultValue','addColumn','cm_contacts','cf_%d','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where'];(function(_0x86337d,_0x2b57c3){var _0x22b2c6=function(_0x180d16){while(--_0x180d16){_0x86337d['push'](_0x86337d['shift']());}};_0x22b2c6(++_0x2b57c3);}(_0x5d7c,0x165));var _0xc5d7=function(_0x2b31aa,_0x12f196){_0x2b31aa=_0x2b31aa-0x0;var _0x3ca177=_0x5d7c[_0x2b31aa];return _0x3ca177;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc5d7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc5d7('0x1'));var BPromise=require(_0xc5d7('0x2'));var Mustache=require(_0xc5d7('0x3'));var util=require(_0xc5d7('0x4'));var path=require(_0xc5d7('0x5'));var sox=require('sox');var csv=require(_0xc5d7('0x6'));var ejs=require(_0xc5d7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc5d7('0x8'));var squel=require(_0xc5d7('0x9'));var crypto=require(_0xc5d7('0xa'));var jsforce=require(_0xc5d7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc5d7('0x6'));var querystring=require(_0xc5d7('0xc'));var Papa=require(_0xc5d7('0xd'));var Redis=require(_0xc5d7('0xe'));var authService=require(_0xc5d7('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc5d7('0x10'));var hardwareService=require(_0xc5d7('0x11'));var logger=require(_0xc5d7('0x12'))(_0xc5d7('0x13'));var utils=require(_0xc5d7('0x14'));var config=require(_0xc5d7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5d7('0x16'))['db'];function respondWithStatusCode(_0x342494,_0x395956){_0x395956=_0x395956||0xcc;return function(_0x42c751){if(_0x42c751){return _0x342494[_0xc5d7('0x17')](_0x395956);}return _0x342494['status'](_0x395956)[_0xc5d7('0x18')]();};}function respondWithResult(_0x5e2036,_0x2a2a7a){_0x2a2a7a=_0x2a2a7a||0xc8;return function(_0x1c5168){if(_0x1c5168){return _0x5e2036[_0xc5d7('0x19')](_0x2a2a7a)[_0xc5d7('0x1a')](_0x1c5168);}};}function respondWithFilteredResult(_0x3113a6,_0x16eeb3){return function(_0x1ebff6){if(_0x1ebff6){var _0x804fc7=typeof _0x16eeb3['offset']===_0xc5d7('0x1b')&&typeof _0x16eeb3[_0xc5d7('0x1c')]===_0xc5d7('0x1b');var _0x569463=_0x1ebff6[_0xc5d7('0x1d')];var _0x37c35d=_0x804fc7?0x0:_0x16eeb3[_0xc5d7('0x1e')];var _0x340052=_0x804fc7?_0x1ebff6[_0xc5d7('0x1d')]:_0x16eeb3[_0xc5d7('0x1e')]+_0x16eeb3['limit'];var _0x15a61a;if(_0x340052>=_0x569463){_0x340052=_0x569463;_0x15a61a=0xc8;}else{_0x15a61a=0xce;}_0x3113a6[_0xc5d7('0x19')](_0x15a61a);return _0x3113a6[_0xc5d7('0x1f')](_0xc5d7('0x20'),_0x37c35d+'-'+_0x340052+'/'+_0x569463)[_0xc5d7('0x1a')](_0x1ebff6);}return null;};}function patchUpdates(_0x155a85){return function(_0x57c3af){try{jsonpatch['apply'](_0x57c3af,_0x155a85,!![]);}catch(_0x33e15e){return BPromise[_0xc5d7('0x21')](_0x33e15e);}return _0x57c3af[_0xc5d7('0x22')]();};}function saveUpdates(_0x2ce496,_0x3b248c){return function(_0x524f3c){if(_0x524f3c){return _0x524f3c[_0xc5d7('0x23')](_0x2ce496)[_0xc5d7('0x24')](function(_0x11a2de){return _0x11a2de;});}return null;};}function removeEntity(_0x55aa5c,_0x1f2563){return function(_0x870a8e){if(_0x870a8e){return _0x870a8e[_0xc5d7('0x25')]()['then'](function(){_0x55aa5c[_0xc5d7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37743e,_0x4bd0fb){return function(_0x4410f0){if(!_0x4410f0){_0x37743e[_0xc5d7('0x17')](0x194);}return _0x4410f0;};}function handleError(_0x40a843,_0x39c656){_0x39c656=_0x39c656||0x1f4;return function(_0x13faca){logger[_0xc5d7('0x26')](_0x13faca[_0xc5d7('0x27')]);if(_0x13faca[_0xc5d7('0x28')]){delete _0x13faca[_0xc5d7('0x28')];}_0x40a843[_0xc5d7('0x19')](_0x39c656)[_0xc5d7('0x29')](_0x13faca);};}exports[_0xc5d7('0x2a')]=function(_0x17ec8a,_0x54e1a7){var _0x199949={},_0x489349={},_0x2e70ef={'count':0x0,'rows':[]};var _0x1b237f=_[_0xc5d7('0x2b')](db[_0xc5d7('0x2c')][_0xc5d7('0x2d')],function(_0x4d8c20){return{'name':_0x4d8c20[_0xc5d7('0x2e')],'type':_0x4d8c20[_0xc5d7('0x2f')][_0xc5d7('0x30')]};});_0x489349[_0xc5d7('0x31')]=_[_0xc5d7('0x32')](_[_0xc5d7('0x2b')](_0x1b237f,_0xc5d7('0x28')),['name']);_0x489349[_0xc5d7('0x33')]=_[_0xc5d7('0x34')](_0x17ec8a['query']);_0x489349[_0xc5d7('0x35')]=_[_0xc5d7('0x36')](_0x489349[_0xc5d7('0x31')],_0x489349[_0xc5d7('0x33')]);_0x199949[_0xc5d7('0x37')]=_[_0xc5d7('0x36')](_0x489349['model'],qs[_0xc5d7('0x38')](_0x17ec8a['query']['fields']));_0x199949[_0xc5d7('0x37')]=_0x199949[_0xc5d7('0x37')][_0xc5d7('0x39')]?_0x199949['attributes']:_0x489349[_0xc5d7('0x31')];if(!_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x3a')]('nolimit')){_0x199949['limit']=qs[_0xc5d7('0x1c')](_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x1c')]);_0x199949[_0xc5d7('0x1e')]=qs[_0xc5d7('0x1e')](_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x1e')]);}_0x199949['order']=qs['sort'](_0x17ec8a['query'][_0xc5d7('0x3b')]);_0x199949['where']=qs[_0xc5d7('0x35')](_[_0xc5d7('0x3c')](_0x17ec8a['query'],_0x489349['filters']),_0x1b237f);if(_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x3d')]){_0x199949[_0xc5d7('0x3e')]=_[_0xc5d7('0x3f')](_0x199949[_0xc5d7('0x3e')],{'$or':_[_0xc5d7('0x2b')](_0x1b237f,function(_0x1c70f3){if(_0x1c70f3[_0xc5d7('0x2f')]!==_0xc5d7('0x40')){var _0x70a2f4={};_0x70a2f4[_0x1c70f3[_0xc5d7('0x28')]]={'$like':'%'+_0x17ec8a[_0xc5d7('0x33')][_0xc5d7('0x3d')]+'%'};return _0x70a2f4;}})});}_0x199949=_['merge']({},_0x199949,_0x17ec8a['options']);var _0x1d5b2c={'where':_0x199949['where']};return db[_0xc5d7('0x2c')][_0xc5d7('0x1d')](_0x1d5b2c)[_0xc5d7('0x24')](function(_0x348523){_0x2e70ef[_0xc5d7('0x1d')]=_0x348523;if(_0x17ec8a['query'][_0xc5d7('0x41')]){_0x199949['include']=[{'all':!![]}];}return db[_0xc5d7('0x2c')][_0xc5d7('0x42')](_0x199949);})[_0xc5d7('0x24')](function(_0x5c3bc6){_0x2e70ef[_0xc5d7('0x43')]=_0x5c3bc6;return _0x2e70ef;})[_0xc5d7('0x24')](respondWithFilteredResult(_0x54e1a7,_0x199949))[_0xc5d7('0x44')](handleError(_0x54e1a7,null));};exports[_0xc5d7('0x45')]=function(_0x52b11e,_0x4ae0a1){var _0x5271c4={'raw':!![],'where':{'id':_0x52b11e[_0xc5d7('0x46')]['id']}},_0x51f907={};_0x51f907['model']=_[_0xc5d7('0x34')](db[_0xc5d7('0x2c')][_0xc5d7('0x2d')]);_0x51f907['query']=_[_0xc5d7('0x34')](_0x52b11e['query']);_0x51f907[_0xc5d7('0x35')]=_['intersection'](_0x51f907[_0xc5d7('0x31')],_0x51f907[_0xc5d7('0x33')]);_0x5271c4['attributes']=_[_0xc5d7('0x36')](_0x51f907[_0xc5d7('0x31')],qs[_0xc5d7('0x38')](_0x52b11e[_0xc5d7('0x33')][_0xc5d7('0x38')]));_0x5271c4[_0xc5d7('0x37')]=_0x5271c4[_0xc5d7('0x37')][_0xc5d7('0x39')]?_0x5271c4[_0xc5d7('0x37')]:_0x51f907[_0xc5d7('0x31')];if(_0x52b11e[_0xc5d7('0x33')][_0xc5d7('0x41')]){_0x5271c4['include']=[{'all':!![]}];}_0x5271c4=_[_0xc5d7('0x3f')]({},_0x5271c4,_0x52b11e['options']);return db[_0xc5d7('0x2c')][_0xc5d7('0x47')](_0x5271c4)[_0xc5d7('0x24')](handleEntityNotFound(_0x4ae0a1,null))[_0xc5d7('0x24')](respondWithResult(_0x4ae0a1,null))[_0xc5d7('0x44')](handleError(_0x4ae0a1,null));};exports[_0xc5d7('0x23')]=function(_0x4692d8,_0x435c91){if(_0x4692d8['body']['id']){delete _0x4692d8[_0xc5d7('0x48')]['id'];}return db['CmCustomField'][_0xc5d7('0x47')]({'where':{'id':_0x4692d8['params']['id']}})[_0xc5d7('0x24')](handleEntityNotFound(_0x435c91,null))[_0xc5d7('0x24')](saveUpdates(_0x4692d8['body'],null))['then'](respondWithResult(_0x435c91,null))['catch'](handleError(_0x435c91,null));};exports['destroy']=function(_0x15ff35,_0x30e000){return db['CmCustomField']['find']({'where':{'id':_0x15ff35[_0xc5d7('0x46')]['id']}})[_0xc5d7('0x24')](handleEntityNotFound(_0x30e000,null))[_0xc5d7('0x24')](removeEntity(_0x30e000,null))[_0xc5d7('0x44')](handleError(_0x30e000,null));};exports[_0xc5d7('0x49')]=function(_0x2f507a,_0x11727b){var _0x4c1b4d;return db[_0xc5d7('0x4a')]['transaction'](function(_0x5a941b){return db[_0xc5d7('0x2c')]['create'](_0x2f507a['body'],{'transaction':_0x5a941b})[_0xc5d7('0x24')](function(_0x34cf95){_0x4c1b4d=_0x34cf95;var _0x2b06d={'type':db[_0xc5d7('0x4b')]['TEXT'],'transaction':_0x5a941b};switch(_0x2f507a[_0xc5d7('0x48')][_0xc5d7('0x2f')]){case _0xc5d7('0x4c'):_0x2b06d['type']=db[_0xc5d7('0x4b')][_0xc5d7('0x4d')];break;case'number':_0x2b06d[_0xc5d7('0x2f')]=db[_0xc5d7('0x4b')][_0xc5d7('0x4e')];break;case _0xc5d7('0x4f'):_0x2b06d[_0xc5d7('0x2f')]=db[_0xc5d7('0x4b')]['BOOLEAN'];_0x2b06d[_0xc5d7('0x50')]=![];break;default:}return db[_0xc5d7('0x4a')]['queryInterface'][_0xc5d7('0x51')](_0xc5d7('0x52'),util['format'](_0xc5d7('0x53'),_0x4c1b4d['id']),_0x2b06d);})['then'](function(){return _0x4c1b4d;});})[_0xc5d7('0x24')](respondWithResult(_0x11727b,0xc9))[_0xc5d7('0x44')](handleError(_0x11727b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0872744..14d2370 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 _0x8fd9=['exports','define','lodash','moment','request-promise','path','../../config/environment','./cmCustomField.attributes'];(function(_0x2b5d10,_0x36fc32){var _0x346eb3=function(_0x435f5e){while(--_0x435f5e){_0x2b5d10['push'](_0x2b5d10['shift']());}};_0x346eb3(++_0x36fc32);}(_0x8fd9,0x92));var _0x98fd=function(_0x1deba7,_0x30f270){_0x1deba7=_0x1deba7-0x0;var _0x2dcc31=_0x8fd9[_0x1deba7];return _0x2dcc31;};'use strict';var _=require(_0x98fd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x98fd('0x1'));var BPromise=require('bluebird');var rp=require(_0x98fd('0x2'));var fs=require('fs');var path=require(_0x98fd('0x3'));var rimraf=require('rimraf');var config=require(_0x98fd('0x4'));var attributes=require(_0x98fd('0x5'));module[_0x98fd('0x6')]=function(_0x1f12ae,_0x5ce58f){return _0x1f12ae[_0x98fd('0x7')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7629=['exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x59e446,_0x573a49){var _0x3ec609=function(_0x1ce15c){while(--_0x1ce15c){_0x59e446['push'](_0x59e446['shift']());}};_0x3ec609(++_0x573a49);}(_0x7629,0xdb));var _0x9762=function(_0x1cc684,_0x2c42b1){_0x1cc684=_0x1cc684-0x0;var _0xbbdf77=_0x7629[_0x1cc684];return _0xbbdf77;};'use strict';var _=require(_0x9762('0x0'));var util=require(_0x9762('0x1'));var logger=require(_0x9762('0x2'))(_0x9762('0x3'));var moment=require(_0x9762('0x4'));var BPromise=require(_0x9762('0x5'));var rp=require(_0x9762('0x6'));var fs=require('fs');var path=require(_0x9762('0x7'));var rimraf=require('rimraf');var config=require(_0x9762('0x8'));var attributes=require('./cmCustomField.attributes');module[_0x9762('0x9')]=function(_0x1cdf98,_0x16228b){return _0x1cdf98[_0x9762('0xa')]('CmCustomField',attributes,{'tableName':_0x9762('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 47327ee..5ea4290 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 _0xc235=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc235,0x184));var _0x5c23=function(_0x1d0cf3,_0x1080ff){_0x1d0cf3=_0x1d0cf3-0x0;var _0x53463a=_0xc235[_0x1d0cf3];return _0x53463a;};'use strict';var _=require(_0x5c23('0x0'));var util=require(_0x5c23('0x1'));var moment=require(_0x5c23('0x2'));var BPromise=require(_0x5c23('0x3'));var rs=require(_0x5c23('0x4'));var fs=require('fs');var Redis=require(_0x5c23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c23('0x6'));var logger=require(_0x5c23('0x7'))(_0x5c23('0x8'));var config=require(_0x5c23('0x9'));var jayson=require(_0x5c23('0xa'));var client=jayson['client'][_0x5c23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4483ec,_0x14b33f,_0x301efa){return new BPromise(function(_0x58bfad,_0x4efc4c){return client[_0x5c23('0xc')](_0x4483ec,_0x301efa)[_0x5c23('0xd')](function(_0x287643){logger[_0x5c23('0xe')](_0x5c23('0xf'),_0x14b33f,_0x5c23('0x10'));logger[_0x5c23('0x11')](_0x5c23('0x12'),_0x14b33f,'request\x20sent',JSON[_0x5c23('0x13')](_0x287643));if(_0x287643[_0x5c23('0x14')]){if(_0x287643['error'][_0x5c23('0x15')]===0x1f4){logger[_0x5c23('0x14')]('CmCustomField,\x20%s,\x20%s',_0x14b33f,_0x287643[_0x5c23('0x14')]['message']);return _0x4efc4c(_0x287643[_0x5c23('0x14')][_0x5c23('0x16')]);}logger[_0x5c23('0x14')](_0x5c23('0xf'),_0x14b33f,_0x287643['error']['message']);return _0x58bfad(_0x287643['error']['message']);}else{logger[_0x5c23('0xe')](_0x5c23('0xf'),_0x14b33f,_0x5c23('0x10'));_0x58bfad(_0x287643['result'][_0x5c23('0x16')]);}})[_0x5c23('0x17')](function(_0x39b0a5){logger['error'](_0x5c23('0xf'),_0x14b33f,_0x39b0a5);_0x4efc4c(_0x39b0a5);});});} \ No newline at end of file +var _0xcfdc=['error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x365038,_0x579866){var _0xbb31e6=function(_0x5a2b13){while(--_0x5a2b13){_0x365038['push'](_0x365038['shift']());}};_0xbb31e6(++_0x579866);}(_0xcfdc,0x86));var _0xccfd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcfdc[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xccfd('0x0'));var util=require(_0xccfd('0x1'));var moment=require(_0xccfd('0x2'));var BPromise=require(_0xccfd('0x3'));var rs=require(_0xccfd('0x4'));var fs=require('fs');var Redis=require(_0xccfd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xccfd('0x6'));var logger=require(_0xccfd('0x7'))(_0xccfd('0x8'));var config=require(_0xccfd('0x9'));var jayson=require(_0xccfd('0xa'));var client=jayson[_0xccfd('0xb')][_0xccfd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5077ca,_0x547c5c,_0x180e4e){return new BPromise(function(_0x3f9b8b,_0x1846a3){return client[_0xccfd('0xd')](_0x5077ca,_0x180e4e)['then'](function(_0x1396ee){logger[_0xccfd('0xe')](_0xccfd('0xf'),_0x547c5c,_0xccfd('0x10'));logger[_0xccfd('0x11')](_0xccfd('0x12'),_0x547c5c,'request\x20sent',JSON[_0xccfd('0x13')](_0x1396ee));if(_0x1396ee[_0xccfd('0x14')]){if(_0x1396ee['error']['code']===0x1f4){logger[_0xccfd('0x14')](_0xccfd('0xf'),_0x547c5c,_0x1396ee[_0xccfd('0x14')]['message']);return _0x1846a3(_0x1396ee[_0xccfd('0x14')][_0xccfd('0x15')]);}logger[_0xccfd('0x14')](_0xccfd('0xf'),_0x547c5c,_0x1396ee[_0xccfd('0x14')][_0xccfd('0x15')]);return _0x3f9b8b(_0x1396ee[_0xccfd('0x14')]['message']);}else{logger[_0xccfd('0xe')](_0xccfd('0xf'),_0x547c5c,_0xccfd('0x10'));_0x3f9b8b(_0x1396ee['result'][_0xccfd('0x15')]);}})['catch'](function(_0x638612){logger['error'](_0xccfd('0xf'),_0x547c5c,_0x638612);_0x1846a3(_0x638612);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index dcdab2c..95fcf6b 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 _0xa1aa=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x4d0527,_0x216351){var _0x4ad853=function(_0x5f4268){while(--_0x5f4268){_0x4d0527['push'](_0x4d0527['shift']());}};_0x4ad853(++_0x216351);}(_0xa1aa,0x88));var _0xaa1a=function(_0x45309c,_0x309714){_0x45309c=_0x45309c-0x0;var _0x228809=_0xa1aa[_0x45309c];return _0x228809;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaa1a('0x0'));var timeout=require(_0xaa1a('0x1'));var express=require(_0xaa1a('0x2'));var router=express[_0xaa1a('0x3')]();var fs_extra=require(_0xaa1a('0x4'));var auth=require(_0xaa1a('0x5'));var interaction=require(_0xaa1a('0x6'));var config=require('../../config/environment');var controller=require(_0xaa1a('0x7'));router[_0xaa1a('0x8')]('/',auth['isAuthenticated'](),controller[_0xaa1a('0x9')]);router[_0xaa1a('0x8')](_0xaa1a('0xa'),auth[_0xaa1a('0xb')](),controller[_0xaa1a('0xc')]);router[_0xaa1a('0xd')]('/',auth[_0xaa1a('0xb')](),controller[_0xaa1a('0xe')]);router[_0xaa1a('0xf')]('/:id',auth[_0xaa1a('0xb')](),controller['update']);router[_0xaa1a('0x10')](_0xaa1a('0xa'),auth[_0xaa1a('0xb')](),controller[_0xaa1a('0x11')]);module[_0xaa1a('0x12')]=router; \ No newline at end of file +var _0x1115=['post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x432d96,_0x3a7c6f){var _0x34ef66=function(_0x79e63c){while(--_0x79e63c){_0x432d96['push'](_0x432d96['shift']());}};_0x34ef66(++_0x3a7c6f);}(_0x1115,0x1b6));var _0x5111=function(_0x40ba0a,_0x38cd5e){_0x40ba0a=_0x40ba0a-0x0;var _0x17c58e=_0x1115[_0x40ba0a];return _0x17c58e;};'use strict';var multer=require('multer');var util=require(_0x5111('0x0'));var path=require(_0x5111('0x1'));var timeout=require(_0x5111('0x2'));var express=require(_0x5111('0x3'));var router=express[_0x5111('0x4')]();var fs_extra=require(_0x5111('0x5'));var auth=require(_0x5111('0x6'));var interaction=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x5111('0x9')](),controller[_0x5111('0xa')]);router['get'](_0x5111('0xb'),auth[_0x5111('0x9')](),controller['show']);router[_0x5111('0xc')]('/',auth['isAuthenticated'](),controller[_0x5111('0xd')]);router[_0x5111('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5111('0xf')]);router['delete'](_0x5111('0xb'),auth['isAuthenticated'](),controller[_0x5111('0x10')]);module[_0x5111('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b4b8976..02d7231 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 _0xb3de=['DATE','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xb3de,0x1d8));var _0xeb3d=function(_0x49223c,_0x48325d){_0x49223c=_0x49223c-0x0;var _0x2f04cb=_0xb3de[_0x49223c];return _0x2f04cb;};'use strict';var moment=require(_0xeb3d('0x0'));var Sequelize=require(_0xeb3d('0x1'));module[_0xeb3d('0x2')]={'phone':{'type':Sequelize[_0xeb3d('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xeb3d('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xeb3d('0x5')](_0xeb3d('0x6'))},'countbusyretry':{'type':Sequelize[_0xeb3d('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xeb3d('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xeb3d('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xeb3d('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xeb3d('0x8')]},'priority':{'type':Sequelize[_0xeb3d('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xeb3d('0x7')],'unique':_0xeb3d('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xeb3d('0x9')},'UserId':{'type':Sequelize[_0xeb3d('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xeb3d('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xeb3d('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xeb3d('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xeb3d('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xeb3d('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xeb3d('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x51ab=['exports','STRING','DATE','format','INTEGER','UNSIGNED','BOOLEAN','contactListQueue','sequelize'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x51ab,0xfb));var _0xb51a=function(_0x44825f,_0x1f4ce2){_0x44825f=_0x44825f-0x0;var _0x1c1f10=_0x51ab[_0x44825f];return _0x1c1f10;};'use strict';var moment=require('moment');var Sequelize=require(_0xb51a('0x0'));module[_0xb51a('0x1')]={'phone':{'type':Sequelize[_0xb51a('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb51a('0x3')],'defaultValue':moment()[_0xb51a('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb51a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb51a('0x3')]},'priority':{'type':Sequelize[_0xb51a('0x5')](0x2)[_0xb51a('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb51a('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb51a('0x5')],'unique':_0xb51a('0x8')},'ListId':{'type':Sequelize[_0xb51a('0x5')],'unique':_0xb51a('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xb51a('0x5')],'unique':_0xb51a('0x8')},'CampaignId':{'type':Sequelize[_0xb51a('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb51a('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb51a('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb51a('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb51a('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 84f0f5e..6c7102f 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 _0xa7e6=['fieldName','type','key','model','map','query','keys','filters','intersection','concat','$and','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','merge','options','find','create','body','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','name','dataValues','createdAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','hopperIds','priority','ASC','scheduledAt','DESC','literal','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','Queue','dialActive','getPreviewRecall','transaction','findOne','CmList','getOpenContacts','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','push','utcOffset','getTimezone','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','json','offset','undefined','limit','count','set','update','then','sendStatus','stack','index','CmHopper','rawAttributes'];(function(_0x3b114d,_0x29350f){var _0x119b3c=function(_0x1842b5){while(--_0x1842b5){_0x3b114d['push'](_0x3b114d['shift']());}};_0x119b3c(++_0x29350f);}(_0xa7e6,0x74));var _0x6a7e=function(_0x6fd276,_0x32ca86){_0x6fd276=_0x6fd276-0x0;var _0x870689=_0xa7e6[_0x6fd276];return _0x870689;};'use strict';var moment=require(_0x6a7e('0x0'));var _=require(_0x6a7e('0x1'));var qs=require(_0x6a7e('0x2'));var logger=require(_0x6a7e('0x3'))(_0x6a7e('0x4'));var shared=require(_0x6a7e('0x5'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x3ccca2,_0x8787b5){_0x8787b5=_0x8787b5||0xc8;return function(_0x1ea310){if(_0x1ea310){return _0x3ccca2[_0x6a7e('0x6')](_0x8787b5)[_0x6a7e('0x7')](_0x1ea310);}};}function respondWithFilteredResult(_0x599006,_0x79df6f){return function(_0x16249d){if(_0x16249d){var _0x37165d=typeof _0x79df6f[_0x6a7e('0x8')]===_0x6a7e('0x9')&&typeof _0x79df6f[_0x6a7e('0xa')]===_0x6a7e('0x9');var _0x403962=_0x16249d[_0x6a7e('0xb')];var _0x5f4ff2=_0x37165d?0x0:_0x79df6f['offset'];var _0x557627=_0x37165d?_0x16249d['count']:_0x79df6f[_0x6a7e('0x8')]+_0x79df6f[_0x6a7e('0xa')];var _0x292822;if(_0x557627>=_0x403962){_0x557627=_0x403962;_0x292822=0xc8;}else{_0x292822=0xce;}_0x599006[_0x6a7e('0x6')](_0x292822);return _0x599006[_0x6a7e('0xc')]('Content-Range',_0x5f4ff2+'-'+_0x557627+'/'+_0x403962)[_0x6a7e('0x7')](_0x16249d);}return null;};}function saveUpdates(_0x4754ef,_0x5c0c74){return function(_0x50dcc1){if(_0x50dcc1){return _0x50dcc1[_0x6a7e('0xd')](_0x4754ef)[_0x6a7e('0xe')](function(_0x1ac6da){return _0x1ac6da;});}return null;};}function handleEntityNotFound(_0x374763,_0x4faca9){return function(_0x3137bc){if(!_0x3137bc){_0x374763[_0x6a7e('0xf')](0x194);}return _0x3137bc;};}function handleError(_0x306b83,_0x4576fe){_0x4576fe=_0x4576fe||0x1f4;return function(_0x465566){logger['error'](_0x465566[_0x6a7e('0x10')]);if(_0x465566['name']){delete _0x465566['name'];}_0x306b83[_0x6a7e('0x6')](_0x4576fe)['send'](_0x465566);};}exports[_0x6a7e('0x11')]=function(_0x195761,_0x470197){var _0x470d49={},_0x20e90a={},_0x53abe9={'count':0x0,'rows':[]};var _0x4c3763=_['map'](db[_0x6a7e('0x12')][_0x6a7e('0x13')],function(_0x327565){return{'name':_0x327565[_0x6a7e('0x14')],'type':_0x327565[_0x6a7e('0x15')][_0x6a7e('0x16')]};});_0x20e90a[_0x6a7e('0x17')]=_[_0x6a7e('0x18')](_0x4c3763,'name');_0x20e90a[_0x6a7e('0x19')]=_[_0x6a7e('0x1a')](_0x195761['query']);_0x20e90a[_0x6a7e('0x1b')]=_[_0x6a7e('0x1c')](_0x20e90a[_0x6a7e('0x17')],_0x20e90a['query']);_0x20e90a[_0x6a7e('0x1b')]=_[_0x6a7e('0x1d')](_0x20e90a['filters'],[_0x6a7e('0x1e'),'$or',_0x6a7e('0x1f'),_0x6a7e('0x20'),'$lt',_0x6a7e('0x21'),_0x6a7e('0x22'),_0x6a7e('0x23'),_0x6a7e('0x24'),_0x6a7e('0x25'),_0x6a7e('0x26'),'$in',_0x6a7e('0x27'),_0x6a7e('0x28'),_0x6a7e('0x29'),_0x6a7e('0x2a'),_0x6a7e('0x2b'),'$like','$overlap',_0x6a7e('0x2c'),_0x6a7e('0x2d'),_0x6a7e('0x2e')]);_0x470d49['attributes']=_[_0x6a7e('0x1c')](_0x20e90a['model'],qs[_0x6a7e('0x2f')](_0x195761['query']['fields']));_0x470d49[_0x6a7e('0x30')]=_0x470d49['attributes'][_0x6a7e('0x31')]?_0x470d49['attributes']:_0x20e90a['model'];if(!_0x195761[_0x6a7e('0x19')][_0x6a7e('0x32')](_0x6a7e('0x33'))){_0x470d49[_0x6a7e('0xa')]=qs[_0x6a7e('0xa')](_0x195761[_0x6a7e('0x19')][_0x6a7e('0xa')]);_0x470d49[_0x6a7e('0x8')]=qs[_0x6a7e('0x8')](_0x195761[_0x6a7e('0x19')][_0x6a7e('0x8')]);}_0x470d49[_0x6a7e('0x34')]=qs['sort'](_0x195761[_0x6a7e('0x19')][_0x6a7e('0x35')]);_0x470d49[_0x6a7e('0x36')]=qs['filters'](_[_0x6a7e('0x37')](_0x195761[_0x6a7e('0x19')],_0x20e90a[_0x6a7e('0x1b')]),_0x4c3763);if(_0x195761[_0x6a7e('0x19')][_0x6a7e('0x38')]){_0x470d49[_0x6a7e('0x36')]=_['merge'](_0x470d49['where'],{'$or':_[_0x6a7e('0x18')](_0x4c3763,function(_0x5d3789){if(_0x5d3789[_0x6a7e('0x15')]!==_0x6a7e('0x39')){var _0x5e30cd={};_0x5e30cd[_0x5d3789['name']]={'$like':'%'+_0x195761['query'][_0x6a7e('0x38')]+'%'};return _0x5e30cd;}})});}_0x470d49=_['merge']({},_0x470d49,_0x195761['options']);var _0x512430={'where':_0x470d49['where']};return db[_0x6a7e('0x12')]['count'](_0x512430)[_0x6a7e('0xe')](function(_0x39d544){_0x53abe9[_0x6a7e('0xb')]=_0x39d544;if(_0x195761[_0x6a7e('0x19')][_0x6a7e('0x3a')]){_0x470d49['include']=[{'all':!![]}];}return db[_0x6a7e('0x12')][_0x6a7e('0x3b')](_0x470d49);})['then'](function(_0x3d146f){_0x53abe9[_0x6a7e('0x3c')]=_0x3d146f;return _0x53abe9;})['then'](respondWithFilteredResult(_0x470197,_0x470d49))[_0x6a7e('0x3d')](handleError(_0x470197,null));};exports[_0x6a7e('0x3e')]=function(_0x34b0ef,_0x920c54){var _0x2827f7={'raw':!![],'where':{'id':_0x34b0ef[_0x6a7e('0x3f')]['id']}},_0x28a62e={};_0x28a62e[_0x6a7e('0x17')]=_[_0x6a7e('0x1a')](db[_0x6a7e('0x12')][_0x6a7e('0x13')]);_0x28a62e['query']=_['keys'](_0x34b0ef[_0x6a7e('0x19')]);_0x28a62e[_0x6a7e('0x1b')]=_['intersection'](_0x28a62e[_0x6a7e('0x17')],_0x28a62e[_0x6a7e('0x19')]);_0x2827f7[_0x6a7e('0x30')]=_[_0x6a7e('0x1c')](_0x28a62e[_0x6a7e('0x17')],qs[_0x6a7e('0x2f')](_0x34b0ef[_0x6a7e('0x19')][_0x6a7e('0x2f')]));_0x2827f7[_0x6a7e('0x30')]=_0x2827f7[_0x6a7e('0x30')][_0x6a7e('0x31')]?_0x2827f7[_0x6a7e('0x30')]:_0x28a62e[_0x6a7e('0x17')];if(_0x34b0ef[_0x6a7e('0x19')]['includeAll']){_0x2827f7['include']=[{'all':!![]}];}_0x2827f7=_[_0x6a7e('0x40')]({},_0x2827f7,_0x34b0ef[_0x6a7e('0x41')]);return db[_0x6a7e('0x12')][_0x6a7e('0x42')](_0x2827f7)[_0x6a7e('0xe')](handleEntityNotFound(_0x920c54,null))[_0x6a7e('0xe')](respondWithResult(_0x920c54,null))[_0x6a7e('0x3d')](handleError(_0x920c54,null));};exports[_0x6a7e('0x43')]=function(_0x5cdd48,_0x380e24){return db['CmHopper'][_0x6a7e('0x43')](_0x5cdd48[_0x6a7e('0x44')],{})[_0x6a7e('0xe')](respondWithResult(_0x380e24,0xc9))[_0x6a7e('0x3d')](handleError(_0x380e24,null));};exports['update']=function(_0x248189,_0xc7f6b9){if(_0x248189[_0x6a7e('0x44')]['id']){delete _0x248189['body']['id'];}return db[_0x6a7e('0x12')]['find']({'where':{'id':_0x248189[_0x6a7e('0x3f')]['id']}})[_0x6a7e('0xe')](handleEntityNotFound(_0xc7f6b9,null))[_0x6a7e('0xe')](saveUpdates(_0x248189[_0x6a7e('0x44')],null))['then'](respondWithResult(_0xc7f6b9,null))[_0x6a7e('0x3d')](handleError(_0xc7f6b9,null));};exports[_0x6a7e('0x45')]=function(_0x188ab5,_0x3991bc){return db['CmHopper'][_0x6a7e('0x45')]()['then'](respondWithResult(_0x3991bc,null))[_0x6a7e('0x3d')](handleError(_0x3991bc,null));};exports[_0x6a7e('0x46')]=function(_0x25c2bb,_0x4a7465){var _0xd3252d;var _0x58f58b=_0x25c2bb[_0x6a7e('0x3f')]['id'];return db['CmHopper'][_0x6a7e('0x42')]({'where':{'id':_0x25c2bb[_0x6a7e('0x3f')]['id']}})[_0x6a7e('0xe')](handleEntityNotFound(_0x4a7465,null))[_0x6a7e('0xe')](function(_0x2f2874){if(_0x2f2874){return _0x2f2874[_0x6a7e('0x46')]()['then'](function(_0x3d4395){return _0x3d4395;});}})[_0x6a7e('0xe')](function(_0x27c1e9){_0xd3252d=_0x27c1e9;if(_0x27c1e9){if(_0x27c1e9[_0x6a7e('0x47')]||_0x27c1e9['CampaignId']){return db[_0x27c1e9['VoiceQueueId']?_0x6a7e('0x48'):_0x6a7e('0x49')][_0x6a7e('0x42')]({'where':{'id':_0x27c1e9[_0x6a7e('0x47')]?_0x27c1e9[_0x6a7e('0x47')]:_0x27c1e9['CampaignId']},'attributes':['id',_0x6a7e('0x4a')],'raw':!![]});}}})[_0x6a7e('0xe')](function(_0xe1b38e){var _0x367b8b={};if(_0xe1b38e){_['merge'](_0x367b8b,_['omit'](_0xd3252d[_0x6a7e('0x4b')],[_0x6a7e('0x4c'),'updatedAt','id']));_0x367b8b[_0x6a7e('0x4d')]=0x15;_0x367b8b[_0x6a7e('0x4e')]=_0x6a7e('0x4f');_0x367b8b[_0x6a7e('0x50')]=_0xe1b38e[_0x6a7e('0x4a')];_0x367b8b[_0x6a7e('0x51')]=_0x25c2bb[_0x6a7e('0x52')][_0x6a7e('0x4a')];_0x367b8b['UserId']=_0x25c2bb[_0x6a7e('0x52')]['id'];_0x367b8b[_0x6a7e('0x4f')]=!![];_0x367b8b[_0x6a7e('0x53')]=moment()[_0x6a7e('0x54')](_0x6a7e('0x55'));_0x367b8b['calleridnum']=_0xd3252d[_0x6a7e('0x56')];_0x367b8b[_0x6a7e('0x57')]=_0xd3252d[_0x6a7e('0x47')]?_0x6a7e('0x58'):_0x6a7e('0x59');return db['CmContact'][_0x6a7e('0x42')]({'where':{'id':_0x367b8b[_0x6a7e('0x5a')]},'attributes':[_0x6a7e('0x5b'),_0x6a7e('0x5c')]})['then'](function(_0x2a0592){if(!_[_0x6a7e('0x5d')](_0x4a7465)&&!_[_0x6a7e('0x5d')](_0x2a0592[_0x6a7e('0x5b')])){_0x367b8b[_0x6a7e('0x5e')]=_0x2a0592[_0x6a7e('0x5b')];if(!_['isNil'](_0x2a0592[_0x6a7e('0x5c')])){_0x367b8b[_0x6a7e('0x5e')]+='\x20'+_0x2a0592[_0x6a7e('0x5c')];}}})[_0x6a7e('0x5f')](function(){return db[_0x6a7e('0x60')]['create'](_0x367b8b);});}})[_0x6a7e('0xe')](function(_0x61a72){return db[_0x6a7e('0x61')][_0x6a7e('0x46')]({'where':{'CmHopperId':_0x58f58b}});})['then'](function(){return _0x4a7465[_0x6a7e('0x6')](0xcc)['end']();})['catch'](handleError(_0x4a7465,null));};exports['getPreview']=function(_0x368ffb,_0x3374c7){var _0x5dc96c=[];return db[_0x6a7e('0x62')][_0x6a7e('0x45')]()[_0x6a7e('0xe')](function(_0x512d15){_0x5dc96c=_[_0x6a7e('0x1a')](_0x512d15);return _0x368ffb[_0x6a7e('0x52')][_0x6a7e('0x63')]({'where':{'type':_0x6a7e('0x64'),'dialActive':!![],'dialMethod':_0x6a7e('0x65')},'attributes':['id',_0x6a7e('0x66'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x6a7e('0xe')](function(_0x1f76ea){if(_0x1f76ea&&_0x1f76ea[_0x6a7e('0x31')]){return db['sequelize']['transaction'](function(_0x13e653){var _0x231dd1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6a7e('0x54')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x1f76ea,'id')},'$or':[{'UserId':null},{'UserId':_0x368ffb[_0x6a7e('0x52')]['id']}]};var _0x2ea436={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1f76ea)[_0x6a7e('0x38')]([_0x6a7e('0x67'),0x0])[_0x6a7e('0x18')]('id')[_0x6a7e('0x68')]()},'$or':[{'UserId':null},{'UserId':_0x368ffb[_0x6a7e('0x52')]['id']}]};var _0x450dd7={'$or':[_0x231dd1,_0x2ea436]};var _0x4cee5f=[];if(_0x368ffb[_0x6a7e('0x44')]['direction']&&_0x368ffb[_0x6a7e('0x44')]['direction']==='prev'){if(!_['isEmpty'](_0x368ffb[_0x6a7e('0x44')]['hopperIds'])){_0x450dd7['id']={'$in':_0x368ffb[_0x6a7e('0x44')][_0x6a7e('0x69')]};}_0x4cee5f=[[_0x6a7e('0x6a'),_0x6a7e('0x6b')],[_0x6a7e('0x6c'),_0x1f76ea[0x0][_0x6a7e('0x66')]===_0x6a7e('0x6b')?_0x6a7e('0x6d'):_0x6a7e('0x6b')],db['sequelize'][_0x6a7e('0x6e')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x6a7e('0x6d')]];}else{if(!_['isEmpty'](_0x368ffb['body'][_0x6a7e('0x69')])){_0x450dd7['id']={'$notIn':_0x368ffb[_0x6a7e('0x44')][_0x6a7e('0x69')]};}_0x4cee5f=[[_0x6a7e('0x6a'),_0x6a7e('0x6d')],[_0x6a7e('0x6c'),_0x1f76ea[0x0][_0x6a7e('0x66')]],db[_0x6a7e('0x6f')]['literal'](_0x6a7e('0x70')),['id','ASC']];}return db[_0x6a7e('0x12')]['findOne']({'attributes':['id',_0x6a7e('0x71'),_0x6a7e('0x56'),_0x6a7e('0x72')],'where':_0x450dd7,'order':_0x4cee5f,'transaction':_0x13e653,'lock':_0x13e653[_0x6a7e('0x73')][_0x6a7e('0x74')],'include':[{'model':db[_0x6a7e('0x62')],'as':_0x6a7e('0x75'),'attributes':_0x5dc96c,'include':[{'model':db[_0x6a7e('0x76')],'as':_0x6a7e('0x77'),'attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x6a7e('0x4a')]},{'model':db[_0x6a7e('0x48')],'as':_0x6a7e('0x78'),'attributes':['id',_0x6a7e('0x4a'),_0x6a7e('0x79')]}]})[_0x6a7e('0xe')](function(_0x272095){if(_0x272095){return _0x272095[_0x6a7e('0xd')]({'UserId':_0x368ffb[_0x6a7e('0x52')]['id']},{'transaction':_0x13e653});}});});}})[_0x6a7e('0xe')](handleEntityNotFound(_0x3374c7,null))['then'](respondWithResult(_0x3374c7,null))[_0x6a7e('0x3d')](handleError(_0x3374c7,null));};exports[_0x6a7e('0x7a')]=function(_0x209e33,_0x441118,_0x1e278b){var _0x51bc53=[];var _0x1d4a2d=_0x209e33[_0x6a7e('0x3f')]['id'];var _0x5bf64a=_0x209e33[_0x6a7e('0x52')]['id'];return db[_0x6a7e('0x62')][_0x6a7e('0x45')]()['then'](function(_0x42f01c){_0x51bc53=_[_0x6a7e('0x1a')](_0x42f01c);return db[_0x6a7e('0x6f')][_0x6a7e('0x7b')](function(_0x2e8c01){const _0x4ee7e5={'id':_0x1d4a2d};return db['CmHopper'][_0x6a7e('0x7c')]({'attributes':['id',_0x6a7e('0x71'),_0x6a7e('0x72')],'where':_0x4ee7e5,'transaction':_0x2e8c01,'lock':_0x2e8c01[_0x6a7e('0x73')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x6a7e('0x75'),'attributes':_0x51bc53,'include':[{'model':db['CmCompany'],'as':_0x6a7e('0x77'),'attributes':['id',_0x6a7e('0x4a')]}]},{'model':db[_0x6a7e('0x7d')],'as':'List','attributes':['id',_0x6a7e('0x4a')]},{'model':db[_0x6a7e('0x48')],'as':_0x6a7e('0x78'),'attributes':['id',_0x6a7e('0x4a'),_0x6a7e('0x79')]}]})['then'](function(_0x3cc9d9){if(_0x3cc9d9){return _0x3cc9d9['update']({'UserId':_0x5bf64a},{'transaction':_0x2e8c01});}});});})[_0x6a7e('0xe')](handleEntityNotFound(_0x441118,null))[_0x6a7e('0xe')](respondWithResult(_0x441118,null))[_0x6a7e('0x3d')](handleError(_0x441118,null));};exports[_0x6a7e('0x7e')]=function(_0x4ece6e,_0xd1b6ed){return _0x4ece6e[_0x6a7e('0x52')][_0x6a7e('0x63')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x6a7e('0xe')](function(_0xcf4ba4){if(_0xcf4ba4&&_0xcf4ba4[_0x6a7e('0x31')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6a7e('0x55'))},'VoiceQueueId':{'$in':_[_0x6a7e('0x18')](_0xcf4ba4,'id')},'$or':[{'UserId':null},{'UserId':_0x4ece6e[_0x6a7e('0x52')]['id']}]}});}return 0x0;})[_0x6a7e('0xe')](function(_0x412db8){if(!_[_0x6a7e('0x5d')](_0x412db8)&&_[_0x6a7e('0x7f')](_0x412db8)){return _0xd1b6ed[_0x6a7e('0x6')](0xc8)[_0x6a7e('0x7')]({'contacts':_0x412db8});}else{logger[_0x6a7e('0x80')](_0x6a7e('0x81'),'getOpenContacts',0x194,_0x6a7e('0x82'));_0xd1b6ed[_0x6a7e('0xf')](0x194);}})[_0x6a7e('0x3d')](handleError(_0xd1b6ed,null));};exports[_0x6a7e('0x83')]=function(_0x33c930,_0x540998){var _0x340e63=shared['timezones'];var _0x42aac=[];_['map'](_0x340e63,function(_0x2f7e23){_0x42aac[_0x6a7e('0x84')]({'id':_0x2f7e23[_0x6a7e('0x4a')],'name':_0x2f7e23[_0x6a7e('0x4a')],'utcOffset':_0x2f7e23[_0x6a7e('0x85')]});});return _0x540998[_0x6a7e('0x6')](0xc8)['json']({'tz':_0x42aac});};exports[_0x6a7e('0x86')]=function(_0x2ac6f,_0x4ee0de){var _0x481c8b=shared[_0x6a7e('0x87')];var _0x37fd3e={};if(!_[_0x6a7e('0x5d')](_0x481c8b[_0x2ac6f[_0x6a7e('0x44')]['id']]))_0x37fd3e=_0x481c8b[_0x2ac6f['body']['id']];return _0x4ee0de[_0x6a7e('0x6')](0xc8)['json'](_0x37fd3e);}; \ No newline at end of file +var _0xcca7=['CmCompany','Company','List','Queue','dialActive','getPreviewRecall','transaction','LOCK','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','utcOffset','timezones','moment','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','sendStatus','error','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','filters','concat','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contains','$any','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','name','filter','then','includeAll','include','findAll','rows','show','params','options','catch','create','body','update','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','createdAt','updatedAt','campaign','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','value','direction','prev','isEmpty','hopperIds','priority','ASC','dialOrderByScheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','findOne','scheduledat','recallme','UPDATE','Contact'];(function(_0x73e4cf,_0x2a8375){var _0x1e1bf8=function(_0xca0967){while(--_0xca0967){_0x73e4cf['push'](_0x73e4cf['shift']());}};_0x1e1bf8(++_0x2a8375);}(_0xcca7,0x1aa));var _0x7cca=function(_0x472716,_0x478fc7){_0x472716=_0x472716-0x0;var _0x885636=_0xcca7[_0x472716];return _0x885636;};'use strict';var moment=require(_0x7cca('0x0'));var _=require(_0x7cca('0x1'));var qs=require(_0x7cca('0x2'));var logger=require(_0x7cca('0x3'))('api');var shared=require('../../config/environment');var db=require(_0x7cca('0x4'))['db'];function respondWithResult(_0x533b00,_0x3b86a4){_0x3b86a4=_0x3b86a4||0xc8;return function(_0x9523f7){if(_0x9523f7){return _0x533b00[_0x7cca('0x5')](_0x3b86a4)[_0x7cca('0x6')](_0x9523f7);}};}function respondWithFilteredResult(_0x1c6c95,_0xe70805){return function(_0x5aec51){if(_0x5aec51){var _0x508f29=typeof _0xe70805[_0x7cca('0x7')]===_0x7cca('0x8')&&typeof _0xe70805[_0x7cca('0x9')]===_0x7cca('0x8');var _0x18bac4=_0x5aec51[_0x7cca('0xa')];var _0x20ffa9=_0x508f29?0x0:_0xe70805[_0x7cca('0x7')];var _0x27323a=_0x508f29?_0x5aec51[_0x7cca('0xa')]:_0xe70805['offset']+_0xe70805[_0x7cca('0x9')];var _0x464911;if(_0x27323a>=_0x18bac4){_0x27323a=_0x18bac4;_0x464911=0xc8;}else{_0x464911=0xce;}_0x1c6c95[_0x7cca('0x5')](_0x464911);return _0x1c6c95[_0x7cca('0xb')](_0x7cca('0xc'),_0x20ffa9+'-'+_0x27323a+'/'+_0x18bac4)['json'](_0x5aec51);}return null;};}function saveUpdates(_0x2a14cc,_0x41e0a2){return function(_0x2854c7){if(_0x2854c7){return _0x2854c7['update'](_0x2a14cc)['then'](function(_0x8ea157){return _0x8ea157;});}return null;};}function handleEntityNotFound(_0x20c1b2,_0x27d671){return function(_0x847cce){if(!_0x847cce){_0x20c1b2[_0x7cca('0xd')](0x194);}return _0x847cce;};}function handleError(_0x3d3141,_0x45143d){_0x45143d=_0x45143d||0x1f4;return function(_0x5a357d){logger[_0x7cca('0xe')](_0x5a357d['stack']);if(_0x5a357d['name']){delete _0x5a357d['name'];}_0x3d3141[_0x7cca('0x5')](_0x45143d)[_0x7cca('0xf')](_0x5a357d);};}exports[_0x7cca('0x10')]=function(_0x33db6b,_0x44294b){var _0x5e7c42={},_0xb35e1d={},_0x4fba9e={'count':0x0,'rows':[]};var _0x5d47f8=_['map'](db[_0x7cca('0x11')][_0x7cca('0x12')],function(_0x2beb6c){return{'name':_0x2beb6c[_0x7cca('0x13')],'type':_0x2beb6c[_0x7cca('0x14')][_0x7cca('0x15')]};});_0xb35e1d[_0x7cca('0x16')]=_[_0x7cca('0x17')](_0x5d47f8,'name');_0xb35e1d[_0x7cca('0x18')]=_[_0x7cca('0x19')](_0x33db6b[_0x7cca('0x18')]);_0xb35e1d[_0x7cca('0x1a')]=_['intersection'](_0xb35e1d[_0x7cca('0x16')],_0xb35e1d[_0x7cca('0x18')]);_0xb35e1d[_0x7cca('0x1a')]=_[_0x7cca('0x1b')](_0xb35e1d[_0x7cca('0x1a')],[_0x7cca('0x1c'),_0x7cca('0x1d'),_0x7cca('0x1e'),'$gte',_0x7cca('0x1f'),_0x7cca('0x20'),_0x7cca('0x21'),_0x7cca('0x22'),_0x7cca('0x23'),_0x7cca('0x24'),_0x7cca('0x25'),_0x7cca('0x26'),'$notIn',_0x7cca('0x27'),'$notLike',_0x7cca('0x28'),_0x7cca('0x29'),'$like',_0x7cca('0x2a'),_0x7cca('0x2b'),'$contained',_0x7cca('0x2c')]);_0x5e7c42[_0x7cca('0x2d')]=_[_0x7cca('0x2e')](_0xb35e1d['model'],qs['fields'](_0x33db6b[_0x7cca('0x18')][_0x7cca('0x2f')]));_0x5e7c42[_0x7cca('0x2d')]=_0x5e7c42[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x5e7c42[_0x7cca('0x2d')]:_0xb35e1d[_0x7cca('0x16')];if(!_0x33db6b['query']['hasOwnProperty'](_0x7cca('0x31'))){_0x5e7c42[_0x7cca('0x9')]=qs[_0x7cca('0x9')](_0x33db6b['query'][_0x7cca('0x9')]);_0x5e7c42['offset']=qs[_0x7cca('0x7')](_0x33db6b[_0x7cca('0x18')][_0x7cca('0x7')]);}_0x5e7c42[_0x7cca('0x32')]=qs['sort'](_0x33db6b[_0x7cca('0x18')][_0x7cca('0x33')]);_0x5e7c42[_0x7cca('0x34')]=qs['filters'](_['pick'](_0x33db6b['query'],_0xb35e1d[_0x7cca('0x1a')]),_0x5d47f8);if(_0x33db6b[_0x7cca('0x18')]['filter']){_0x5e7c42[_0x7cca('0x34')]=_[_0x7cca('0x35')](_0x5e7c42[_0x7cca('0x34')],{'$or':_[_0x7cca('0x17')](_0x5d47f8,function(_0xc10d78){if(_0xc10d78[_0x7cca('0x14')]!==_0x7cca('0x36')){var _0x56b9e0={};_0x56b9e0[_0xc10d78[_0x7cca('0x37')]]={'$like':'%'+_0x33db6b[_0x7cca('0x18')][_0x7cca('0x38')]+'%'};return _0x56b9e0;}})});}_0x5e7c42=_[_0x7cca('0x35')]({},_0x5e7c42,_0x33db6b['options']);var _0x213e4f={'where':_0x5e7c42[_0x7cca('0x34')]};return db[_0x7cca('0x11')]['count'](_0x213e4f)[_0x7cca('0x39')](function(_0x4bc7a7){_0x4fba9e[_0x7cca('0xa')]=_0x4bc7a7;if(_0x33db6b[_0x7cca('0x18')][_0x7cca('0x3a')]){_0x5e7c42[_0x7cca('0x3b')]=[{'all':!![]}];}return db[_0x7cca('0x11')][_0x7cca('0x3c')](_0x5e7c42);})[_0x7cca('0x39')](function(_0x3b5aa3){_0x4fba9e[_0x7cca('0x3d')]=_0x3b5aa3;return _0x4fba9e;})['then'](respondWithFilteredResult(_0x44294b,_0x5e7c42))['catch'](handleError(_0x44294b,null));};exports[_0x7cca('0x3e')]=function(_0x3365b6,_0x5cb715){var _0x48d87f={'raw':!![],'where':{'id':_0x3365b6[_0x7cca('0x3f')]['id']}},_0x3c6d1d={};_0x3c6d1d[_0x7cca('0x16')]=_[_0x7cca('0x19')](db[_0x7cca('0x11')]['rawAttributes']);_0x3c6d1d[_0x7cca('0x18')]=_['keys'](_0x3365b6['query']);_0x3c6d1d[_0x7cca('0x1a')]=_[_0x7cca('0x2e')](_0x3c6d1d['model'],_0x3c6d1d[_0x7cca('0x18')]);_0x48d87f['attributes']=_[_0x7cca('0x2e')](_0x3c6d1d[_0x7cca('0x16')],qs[_0x7cca('0x2f')](_0x3365b6['query'][_0x7cca('0x2f')]));_0x48d87f[_0x7cca('0x2d')]=_0x48d87f[_0x7cca('0x2d')][_0x7cca('0x30')]?_0x48d87f['attributes']:_0x3c6d1d[_0x7cca('0x16')];if(_0x3365b6[_0x7cca('0x18')][_0x7cca('0x3a')]){_0x48d87f[_0x7cca('0x3b')]=[{'all':!![]}];}_0x48d87f=_[_0x7cca('0x35')]({},_0x48d87f,_0x3365b6[_0x7cca('0x40')]);return db['CmHopper']['find'](_0x48d87f)['then'](handleEntityNotFound(_0x5cb715,null))['then'](respondWithResult(_0x5cb715,null))[_0x7cca('0x41')](handleError(_0x5cb715,null));};exports['create']=function(_0x51e564,_0x272828){return db[_0x7cca('0x11')][_0x7cca('0x42')](_0x51e564[_0x7cca('0x43')],{})[_0x7cca('0x39')](respondWithResult(_0x272828,0xc9))['catch'](handleError(_0x272828,null));};exports[_0x7cca('0x44')]=function(_0x345182,_0xba19aa){if(_0x345182[_0x7cca('0x43')]['id']){delete _0x345182[_0x7cca('0x43')]['id'];}return db[_0x7cca('0x11')][_0x7cca('0x45')]({'where':{'id':_0x345182[_0x7cca('0x3f')]['id']}})[_0x7cca('0x39')](handleEntityNotFound(_0xba19aa,null))[_0x7cca('0x39')](saveUpdates(_0x345182[_0x7cca('0x43')],null))['then'](respondWithResult(_0xba19aa,null))['catch'](handleError(_0xba19aa,null));};exports[_0x7cca('0x46')]=function(_0x5913eb,_0x40eb40){return db[_0x7cca('0x11')][_0x7cca('0x46')]()[_0x7cca('0x39')](respondWithResult(_0x40eb40,null))[_0x7cca('0x41')](handleError(_0x40eb40,null));};exports[_0x7cca('0x47')]=function(_0x184b56,_0xe0059e){var _0x1bb80b;var _0x3eb069=_0x184b56['params']['id'];return db[_0x7cca('0x11')][_0x7cca('0x45')]({'where':{'id':_0x184b56[_0x7cca('0x3f')]['id']}})[_0x7cca('0x39')](handleEntityNotFound(_0xe0059e,null))[_0x7cca('0x39')](function(_0x41b932){if(_0x41b932){return _0x41b932[_0x7cca('0x47')]()[_0x7cca('0x39')](function(_0x218114){return _0x218114;});}})[_0x7cca('0x39')](function(_0x3a0ce8){_0x1bb80b=_0x3a0ce8;if(_0x3a0ce8){if(_0x3a0ce8[_0x7cca('0x48')]||_0x3a0ce8[_0x7cca('0x49')]){return db[_0x3a0ce8[_0x7cca('0x48')]?_0x7cca('0x4a'):_0x7cca('0x4b')][_0x7cca('0x45')]({'where':{'id':_0x3a0ce8[_0x7cca('0x48')]?_0x3a0ce8[_0x7cca('0x48')]:_0x3a0ce8[_0x7cca('0x49')]},'attributes':['id',_0x7cca('0x37')],'raw':!![]});}}})[_0x7cca('0x39')](function(_0xc72da3){var _0x2a6f61={};if(_0xc72da3){_[_0x7cca('0x35')](_0x2a6f61,_[_0x7cca('0x4c')](_0x1bb80b['dataValues'],[_0x7cca('0x4d'),_0x7cca('0x4e'),'id']));_0x2a6f61['state']=0x15;_0x2a6f61['statedesc']='deleted';_0x2a6f61[_0x7cca('0x4f')]=_0xc72da3[_0x7cca('0x37')];_0x2a6f61['membername']=_0x184b56[_0x7cca('0x50')][_0x7cca('0x37')];_0x2a6f61['UserId']=_0x184b56[_0x7cca('0x50')]['id'];_0x2a6f61['deleted']=!![];_0x2a6f61[_0x7cca('0x51')]=moment()[_0x7cca('0x52')](_0x7cca('0x53'));_0x2a6f61[_0x7cca('0x54')]=_0x1bb80b[_0x7cca('0x55')];_0x2a6f61[_0x7cca('0x56')]=_0x1bb80b[_0x7cca('0x48')]?_0x7cca('0x57'):_0x7cca('0x58');return db[_0x7cca('0x59')][_0x7cca('0x45')]({'where':{'id':_0x2a6f61[_0x7cca('0x5a')]},'attributes':[_0x7cca('0x5b'),'lastName']})[_0x7cca('0x39')](function(_0x51e215){if(!_[_0x7cca('0x5c')](_0xe0059e)&&!_['isNil'](_0x51e215[_0x7cca('0x5b')])){_0x2a6f61[_0x7cca('0x5d')]=_0x51e215[_0x7cca('0x5b')];if(!_['isNil'](_0x51e215[_0x7cca('0x5e')])){_0x2a6f61[_0x7cca('0x5d')]+='\x20'+_0x51e215[_0x7cca('0x5e')];}}})[_0x7cca('0x5f')](function(){return db[_0x7cca('0x60')]['create'](_0x2a6f61);});}})['then'](function(_0x341d92){return db[_0x7cca('0x61')][_0x7cca('0x47')]({'where':{'CmHopperId':_0x3eb069}});})[_0x7cca('0x39')](function(){return _0xe0059e[_0x7cca('0x5')](0xcc)[_0x7cca('0x62')]();})[_0x7cca('0x41')](handleError(_0xe0059e,null));};exports[_0x7cca('0x63')]=function(_0x3327b1,_0x35eca7){var _0x2d5853=[];return db[_0x7cca('0x59')][_0x7cca('0x46')]()['then'](function(_0x23cfb5){_0x2d5853=_[_0x7cca('0x19')](_0x23cfb5);return _0x3327b1['user'][_0x7cca('0x64')]({'where':{'type':_0x7cca('0x65'),'dialActive':!![],'dialMethod':_0x7cca('0x66')},'attributes':['id','dialOrderByScheduledAt',_0x7cca('0x67')],'raw':!![]});})[_0x7cca('0x39')](function(_0x14efae){if(_0x14efae&&_0x14efae[_0x7cca('0x30')]){return db[_0x7cca('0x68')]['transaction'](function(_0x24901f){var _0x464484={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7cca('0x52')](_0x7cca('0x53'))},'VoiceQueueId':{'$in':_['map'](_0x14efae,'id')},'$or':[{'UserId':null},{'UserId':_0x3327b1[_0x7cca('0x50')]['id']}]};var _0x46e741={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x14efae)['filter']([_0x7cca('0x67'),0x0])['map']('id')[_0x7cca('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x3327b1['user']['id']}]};var _0x38d055={'$or':[_0x464484,_0x46e741]};var _0x3aa651=[];if(_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6a')]&&_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6a')]===_0x7cca('0x6b')){if(!_[_0x7cca('0x6c')](_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')])){_0x38d055['id']={'$in':_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')]};}_0x3aa651=[[_0x7cca('0x6e'),_0x7cca('0x6f')],['scheduledAt',_0x14efae[0x0][_0x7cca('0x70')]===_0x7cca('0x6f')?_0x7cca('0x71'):'ASC'],db[_0x7cca('0x68')]['literal'](_0x7cca('0x72')),['id',_0x7cca('0x71')]];}else{if(!_[_0x7cca('0x6c')](_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')])){_0x38d055['id']={'$notIn':_0x3327b1[_0x7cca('0x43')][_0x7cca('0x6d')]};}_0x3aa651=[[_0x7cca('0x6e'),_0x7cca('0x71')],[_0x7cca('0x73'),_0x14efae[0x0][_0x7cca('0x70')]],db[_0x7cca('0x68')][_0x7cca('0x74')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x7cca('0x6f')]];}return db['CmHopper'][_0x7cca('0x75')]({'attributes':['id',_0x7cca('0x76'),_0x7cca('0x55'),_0x7cca('0x77')],'where':_0x38d055,'order':_0x3aa651,'transaction':_0x24901f,'lock':_0x24901f['LOCK'][_0x7cca('0x78')],'include':[{'model':db[_0x7cca('0x59')],'as':_0x7cca('0x79'),'attributes':_0x2d5853,'include':[{'model':db[_0x7cca('0x7a')],'as':_0x7cca('0x7b'),'attributes':['id',_0x7cca('0x37')]}]},{'model':db['CmList'],'as':_0x7cca('0x7c'),'attributes':['id',_0x7cca('0x37')]},{'model':db[_0x7cca('0x4a')],'as':_0x7cca('0x7d'),'attributes':['id',_0x7cca('0x37'),_0x7cca('0x7e')]}]})[_0x7cca('0x39')](function(_0x1bd752){if(_0x1bd752){return _0x1bd752[_0x7cca('0x44')]({'UserId':_0x3327b1['user']['id']},{'transaction':_0x24901f});}});});}})[_0x7cca('0x39')](handleEntityNotFound(_0x35eca7,null))[_0x7cca('0x39')](respondWithResult(_0x35eca7,null))['catch'](handleError(_0x35eca7,null));};exports[_0x7cca('0x7f')]=function(_0x5b4ca5,_0x569866,_0x24e643){var _0x313cd1=[];var _0x27e79c=_0x5b4ca5[_0x7cca('0x3f')]['id'];var _0x2af32b=_0x5b4ca5[_0x7cca('0x50')]['id'];return db[_0x7cca('0x59')][_0x7cca('0x46')]()[_0x7cca('0x39')](function(_0x5dd0f3){_0x313cd1=_[_0x7cca('0x19')](_0x5dd0f3);return db[_0x7cca('0x68')][_0x7cca('0x80')](function(_0x294484){const _0x37deae={'id':_0x27e79c};return db[_0x7cca('0x11')][_0x7cca('0x75')]({'attributes':['id',_0x7cca('0x76'),'recallme'],'where':_0x37deae,'transaction':_0x294484,'lock':_0x294484[_0x7cca('0x81')][_0x7cca('0x78')],'include':[{'model':db[_0x7cca('0x59')],'as':'Contact','attributes':_0x313cd1,'include':[{'model':db[_0x7cca('0x7a')],'as':_0x7cca('0x7b'),'attributes':['id',_0x7cca('0x37')]}]},{'model':db[_0x7cca('0x82')],'as':'List','attributes':['id',_0x7cca('0x37')]},{'model':db[_0x7cca('0x4a')],'as':_0x7cca('0x7d'),'attributes':['id',_0x7cca('0x37'),_0x7cca('0x7e')]}]})[_0x7cca('0x39')](function(_0x2f4c3a){if(_0x2f4c3a){return _0x2f4c3a['update']({'UserId':_0x2af32b},{'transaction':_0x294484});}});});})[_0x7cca('0x39')](handleEntityNotFound(_0x569866,null))[_0x7cca('0x39')](respondWithResult(_0x569866,null))[_0x7cca('0x41')](handleError(_0x569866,null));};exports[_0x7cca('0x83')]=function(_0x151a0d,_0x5afecc){return _0x151a0d[_0x7cca('0x50')][_0x7cca('0x64')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7cca('0x66')},'attributes':['id'],'raw':!![]})[_0x7cca('0x39')](function(_0x5d23d5){if(_0x5d23d5&&_0x5d23d5[_0x7cca('0x30')]){return db[_0x7cca('0x11')][_0x7cca('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x7cca('0x52')](_0x7cca('0x53'))},'VoiceQueueId':{'$in':_[_0x7cca('0x17')](_0x5d23d5,'id')},'$or':[{'UserId':null},{'UserId':_0x151a0d[_0x7cca('0x50')]['id']}]}});}return 0x0;})[_0x7cca('0x39')](function(_0x961bfa){if(!_[_0x7cca('0x5c')](_0x961bfa)&&_[_0x7cca('0x84')](_0x961bfa)){return _0x5afecc[_0x7cca('0x5')](0xc8)['json']({'contacts':_0x961bfa});}else{logger[_0x7cca('0xe')](_0x7cca('0x85'),_0x7cca('0x83'),0x194,_0x7cca('0x86'));_0x5afecc[_0x7cca('0xd')](0x194);}})[_0x7cca('0x41')](handleError(_0x5afecc,null));};exports['getTimezones']=function(_0x12d6b3,_0x3ea186){var _0x330821=shared['timezones'];var _0x3863ac=[];_[_0x7cca('0x17')](_0x330821,function(_0x1a7f1c){_0x3863ac['push']({'id':_0x1a7f1c[_0x7cca('0x37')],'name':_0x1a7f1c['name'],'utcOffset':_0x1a7f1c[_0x7cca('0x87')]});});return _0x3ea186[_0x7cca('0x5')](0xc8)[_0x7cca('0x6')]({'tz':_0x3863ac});};exports['getTimezone']=function(_0x1502f7,_0x4a1eb7){var _0x519123=shared[_0x7cca('0x88')];var _0x3f696d={};if(!_['isNil'](_0x519123[_0x1502f7[_0x7cca('0x43')]['id']]))_0x3f696d=_0x519123[_0x1502f7[_0x7cca('0x43')]['id']];return _0x4a1eb7[_0x7cca('0x5')](0xc8)['json'](_0x3f696d);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 836705a..94f1fdc 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 _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x90b1,0x1bb));var _0x190b=function(_0x1374f1,_0x19f66f){_0x1374f1=_0x1374f1-0x0;var _0x3f109d=_0x90b1[_0x1374f1];return _0x3f109d;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['request-promise','rimraf','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x4ba38f,_0x26227b){var _0x390e5a=function(_0x2cd7c2){while(--_0x2cd7c2){_0x4ba38f['push'](_0x4ba38f['shift']());}};_0x390e5a(++_0x26227b);}(_0x2eb2,0x19f));var _0x22eb=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x2eb2[_0x481bf7];return _0x461787;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[{'name':_0x22eb('0xb'),'fields':[_0x22eb('0xb')]},{'name':_0x22eb('0xc'),'fields':[_0x22eb('0xc')]},{'name':_0x22eb('0xd'),'fields':[_0x22eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 9d885e5..bb7392e 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 _0x8dd1=['GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','CountReScheduled','GetContactRecallMe','order','GetCmHopperPreview','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','List','lodash','util','moment','../../mysqldb','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','map','include','model','then','info','stringify','catch','error','message','ShowCmHopper','debug','CreateCmHopper','create','body','update','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','LOCK','UPDATE','Contact','User','name','voicePause','length','UserId','push','all'];(function(_0x13d183,_0x4ea26a){var _0x4cf208=function(_0x29e956){while(--_0x29e956){_0x13d183['push'](_0x13d183['shift']());}};_0x4cf208(++_0x4ea26a);}(_0x8dd1,0x1e5));var _0x18dd=function(_0x13a4bf,_0x56cb27){_0x13a4bf=_0x13a4bf-0x0;var _0x2933d6=_0x8dd1[_0x13a4bf];return _0x2933d6;};'use strict';var _=require(_0x18dd('0x0'));var util=require(_0x18dd('0x1'));var moment=require(_0x18dd('0x2'));var BPromise=require('bluebird');var db=require(_0x18dd('0x3'))['db'];var logger=require('../../config/logger')(_0x18dd('0x4'));exports[_0x18dd('0x5')]=function(_0x1bccbf){var _0x1726fa=this;return new Promise(function(_0x4c99bf,_0x1093fe){return db[_0x18dd('0x6')][_0x18dd('0x7')]({'raw':_0x1bccbf[_0x18dd('0x8')]?_0x1bccbf[_0x18dd('0x8')][_0x18dd('0x9')]===undefined?!![]:![]:!![],'where':_0x1bccbf[_0x18dd('0x8')]?_0x1bccbf['options'][_0x18dd('0xa')]||null:null,'attributes':_0x1bccbf['options']?_0x1bccbf[_0x18dd('0x8')][_0x18dd('0xb')]||null:null,'limit':_0x1bccbf[_0x18dd('0x8')]?_0x1bccbf[_0x18dd('0x8')][_0x18dd('0xc')]||null:null,'include':_0x1bccbf[_0x18dd('0x8')]?_0x1bccbf[_0x18dd('0x8')]['include']?_[_0x18dd('0xd')](_0x1bccbf[_0x18dd('0x8')][_0x18dd('0xe')],function(_0x390c69){return{'model':db[_0x390c69[_0x18dd('0xf')]],'as':_0x390c69['as'],'attributes':_0x390c69['attributes'],'include':_0x390c69[_0x18dd('0xe')]?_[_0x18dd('0xd')](_0x390c69[_0x18dd('0xe')],function(_0x1b0a98){return{'model':db[_0x1b0a98[_0x18dd('0xf')]],'as':_0x1b0a98['as'],'attributes':_0x1b0a98[_0x18dd('0xb')],'include':_0x1b0a98[_0x18dd('0xe')]?_[_0x18dd('0xd')](_0x1b0a98[_0x18dd('0xe')],function(_0x492b90){return{'model':db[_0x492b90[_0x18dd('0xf')]],'as':_0x492b90['as'],'attributes':_0x492b90[_0x18dd('0xb')]};}):[]};}):[]};}):[]:[]})[_0x18dd('0x10')](function(_0x52ace0){logger[_0x18dd('0x11')](_0x18dd('0x5'),_0x1bccbf);logger['debug'](_0x18dd('0x5'),_0x1bccbf,JSON[_0x18dd('0x12')](_0x52ace0));_0x4c99bf(_0x52ace0);})[_0x18dd('0x13')](function(_0x3fd247){logger[_0x18dd('0x14')]('GetCmHopper',_0x3fd247['message'],_0x1bccbf);_0x1093fe(_0x1726fa[_0x18dd('0x14')](0x1f4,_0x3fd247[_0x18dd('0x15')]));});});};exports[_0x18dd('0x16')]=function(_0x1ee3ce){var _0x2f7875=this;return new Promise(function(_0x63a095,_0x382fef){return db[_0x18dd('0x6')]['find']({'raw':_0x1ee3ce[_0x18dd('0x8')]?_0x1ee3ce[_0x18dd('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x1ee3ce[_0x18dd('0x8')]?_0x1ee3ce['options'][_0x18dd('0xa')]||null:null,'attributes':_0x1ee3ce[_0x18dd('0x8')]?_0x1ee3ce[_0x18dd('0x8')]['attributes']||null:null,'include':_0x1ee3ce[_0x18dd('0x8')]?_0x1ee3ce['options'][_0x18dd('0xe')]?_[_0x18dd('0xd')](_0x1ee3ce['options'][_0x18dd('0xe')],function(_0x46e628){return{'model':db[_0x46e628[_0x18dd('0xf')]],'as':_0x46e628['as'],'attributes':_0x46e628[_0x18dd('0xb')],'include':_0x46e628[_0x18dd('0xe')]?_[_0x18dd('0xd')](_0x46e628[_0x18dd('0xe')],function(_0x2fe101){return{'model':db[_0x2fe101[_0x18dd('0xf')]],'as':_0x2fe101['as'],'attributes':_0x2fe101[_0x18dd('0xb')],'include':_0x2fe101[_0x18dd('0xe')]?_[_0x18dd('0xd')](_0x2fe101[_0x18dd('0xe')],function(_0x95207c){return{'model':db[_0x95207c[_0x18dd('0xf')]],'as':_0x95207c['as'],'attributes':_0x95207c['attributes']};}):[]};}):[]};}):[]:[]})[_0x18dd('0x10')](function(_0x5b4516){logger['info'](_0x18dd('0x16'),_0x1ee3ce);logger[_0x18dd('0x17')]('ShowCmHopper',_0x1ee3ce,JSON[_0x18dd('0x12')](_0x5b4516));_0x63a095(_0x5b4516);})[_0x18dd('0x13')](function(_0x3998e8){logger[_0x18dd('0x14')](_0x18dd('0x16'),_0x3998e8['message'],_0x1ee3ce);_0x382fef(_0x2f7875[_0x18dd('0x14')](0x1f4,_0x3998e8[_0x18dd('0x15')]));});});};exports[_0x18dd('0x18')]=function(_0xb059d8){var _0x2435a2=this;return new Promise(function(_0x4ec73f,_0x2268e8){return db[_0x18dd('0x6')][_0x18dd('0x19')](_0xb059d8[_0x18dd('0x1a')],{'raw':_0xb059d8[_0x18dd('0x8')]?_0xb059d8[_0x18dd('0x8')]['raw']===undefined?!![]:![]:!![]})[_0x18dd('0x10')](function(_0x5f3fa2){logger[_0x18dd('0x11')]('CreateCmHopper',_0xb059d8);logger[_0x18dd('0x17')]('CreateCmHopper',_0xb059d8,JSON[_0x18dd('0x12')](_0x5f3fa2));_0x4ec73f(_0x5f3fa2);})['catch'](function(_0x3a50f2){logger[_0x18dd('0x14')]('CreateCmHopper',_0x3a50f2['message'],_0xb059d8);_0x2268e8(_0x2435a2['error'](0x1f4,_0x3a50f2[_0x18dd('0x15')]));});});};exports['UpdateCmHopper']=function(_0x42ea97){var _0x555ef8=this;return new Promise(function(_0x4233f1,_0x261dae){return db[_0x18dd('0x6')][_0x18dd('0x1b')](_0x42ea97[_0x18dd('0x1a')],{'raw':_0x42ea97[_0x18dd('0x8')]?_0x42ea97[_0x18dd('0x8')][_0x18dd('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42ea97[_0x18dd('0x8')]?_0x42ea97[_0x18dd('0x8')]['where']||null:null,'attributes':_0x42ea97['options']?_0x42ea97[_0x18dd('0x8')][_0x18dd('0xb')]||null:null,'limit':_0x42ea97['options']?_0x42ea97[_0x18dd('0x8')][_0x18dd('0xc')]||null:null})[_0x18dd('0x10')](function(_0xb0046c){logger['info'](_0x18dd('0x1c'),_0x42ea97);logger['info'](_0x18dd('0x1d'),JSON['stringify'](_0x42ea97['options']['where']),_0x42ea97[_0x18dd('0x1a')][_0x18dd('0x1e')]);logger[_0x18dd('0x17')](_0x18dd('0x1c'),_0x42ea97,JSON[_0x18dd('0x12')](_0xb0046c));_0x4233f1(_0xb0046c);})[_0x18dd('0x13')](function(_0x1293a0){logger[_0x18dd('0x14')](_0x18dd('0x1c'),_0x1293a0['message'],_0x42ea97);_0x261dae(_0x555ef8[_0x18dd('0x14')](0x1f4,_0x1293a0[_0x18dd('0x15')]));});});};exports[_0x18dd('0x1f')]=function(_0x373d9){var _0x505df7=this;return new Promise(function(_0x3dca15,_0x2becd6){return db[_0x18dd('0x6')][_0x18dd('0x20')]({'where':_0x373d9['options']?_0x373d9[_0x18dd('0x8')][_0x18dd('0xa')]||null:null})[_0x18dd('0x10')](function(_0x2611a8){logger[_0x18dd('0x11')]('DestroyCmHopper',_0x373d9);logger[_0x18dd('0x17')](_0x18dd('0x1f'),_0x373d9,JSON['stringify'](_0x2611a8));_0x3dca15(_0x2611a8);})['catch'](function(_0x1d7f93){logger[_0x18dd('0x14')](_0x18dd('0x1f'),_0x1d7f93[_0x18dd('0x15')],_0x373d9);_0x2becd6(_0x505df7[_0x18dd('0x14')](0x1f4,_0x1d7f93[_0x18dd('0x15')]));});});};exports[_0x18dd('0x21')]=function(_0x16dc79){var _0x3920ca=this;return new Promise(function(_0x35fcd4,_0x46d32f){return db[_0x18dd('0x22')][_0x18dd('0x23')]()[_0x18dd('0x10')](function(_0x4f0ece){return db[_0x18dd('0x24')]['transaction'](function(_0x4bc960){return db[_0x18dd('0x6')]['findAll']({'where':_0x16dc79[_0x18dd('0x8')]?_0x16dc79[_0x18dd('0x8')][_0x18dd('0xa')]||null:null,'attributes':_0x16dc79[_0x18dd('0x8')]?_0x16dc79['options']['attributes']||null:null,'limit':_0x16dc79[_0x18dd('0x8')]?_0x16dc79[_0x18dd('0x8')][_0x18dd('0xc')]||null:null,'order':_0x16dc79[_0x18dd('0x8')]?_0x16dc79['options']['order']||null:null,'transaction':_0x4bc960,'lock':_0x4bc960[_0x18dd('0x25')][_0x18dd('0x26')],'include':[{'model':db[_0x18dd('0x22')],'as':_0x18dd('0x27'),'attributes':_['keys'](_0x4f0ece)},{'model':db[_0x18dd('0x28')],'as':'Agent','attributes':['id',_0x18dd('0x29'),_0x18dd('0x2a')]}]})['then'](function(_0x40971c){var _0x587246=[];var _0xc71eef=[];for(var _0x4930de=0x0;_0x4930de<_0x40971c[_0x18dd('0x2b')];_0x4930de+=0x1){var _0x34e59b=_0x40971c[_0x4930de][_0x18dd('0x2c')];if(_0x34e59b===null){_0x587246[_0x18dd('0x2d')](_0x40971c[_0x4930de][_0x18dd('0x1b')](_0x16dc79['body'],{'transaction':_0x4bc960}));}else if(!_0xc71eef['includes'](_0x34e59b)){_0xc71eef[_0x18dd('0x2d')](_0x34e59b);_0x587246[_0x18dd('0x2d')](_0x40971c[_0x4930de][_0x18dd('0x1b')](_0x16dc79[_0x18dd('0x1a')],{'transaction':_0x4bc960}));}}return BPromise[_0x18dd('0x2e')](_0x587246);});})[_0x18dd('0x10')](function(_0x45ca1b){logger['info'](_0x18dd('0x21'),_0x16dc79);if(_0x45ca1b['length']>0x0){logger[_0x18dd('0x11')](_0x18dd('0x2f'),_0x45ca1b[0x0][_0x18dd('0x30')]['id'],_0x45ca1b[0x0][_0x18dd('0x30')]['ContactId'],_0x45ca1b[0x0]['dataValues'][_0x18dd('0x1e')]);}logger[_0x18dd('0x17')](_0x18dd('0x21'),_0x16dc79,JSON[_0x18dd('0x12')](_0x45ca1b));_0x35fcd4(_0x45ca1b);})[_0x18dd('0x13')](function(_0x1d20ca){logger[_0x18dd('0x14')](_0x18dd('0x21'),_0x1d20ca[_0x18dd('0x15')],_0x16dc79);_0x46d32f(_0x3920ca['error'](0x1f4,_0x1d20ca[_0x18dd('0x15')]));});});});};exports[_0x18dd('0x31')]=function(_0x1e86ca){var _0xfef52=this;return new Promise(function(_0x1afc67,_0xb5cf84){return db[_0x18dd('0x24')][_0x18dd('0x32')](function(_0x64098f){return db[_0x18dd('0x33')][_0x18dd('0x19')](_0x1e86ca['body'],{'raw':_0x1e86ca[_0x18dd('0x8')]?_0x1e86ca[_0x18dd('0x8')][_0x18dd('0x9')]===undefined?!![]:![]:!![],'transaction':_0x64098f})['then'](function(){logger[_0x18dd('0x11')](_0x18dd('0x34'),JSON['stringify'](_0x1e86ca['options'][_0x18dd('0xa')]),_0x1e86ca[_0x18dd('0x8')][_0x18dd('0xa')][_0x18dd('0x1e')]);return db[_0x18dd('0x6')][_0x18dd('0x20')]({'where':_0x1e86ca[_0x18dd('0x8')]?_0x1e86ca[_0x18dd('0x8')][_0x18dd('0xa')]||null:null,'transaction':_0x64098f});});})[_0x18dd('0x10')](function(_0x2e3413){logger['info']('MoveContactManagedDialer',_0x1e86ca);logger['debug'](_0x18dd('0x31'),_0x1e86ca,JSON['stringify'](_0x2e3413));_0x1afc67(_0x2e3413);})['catch'](function(_0x3a0db1){logger[_0x18dd('0x14')](_0x18dd('0x31'),_0x3a0db1[_0x18dd('0x15')],_0x1e86ca);_0xb5cf84(_0xfef52['error'](0x1f4,_0x3a0db1['message']));});});};exports['CountReScheduled']=function(_0x56e65e){var _0x1d8a4c=this;return new Promise(function(_0x36f8e3,_0x51965c){return db['CmHopper'][_0x18dd('0x7')]({'raw':_0x56e65e[_0x18dd('0x8')]?_0x56e65e['options'][_0x18dd('0x9')]===undefined?!![]:![]:!![],'where':_0x56e65e['options']?_0x56e65e[_0x18dd('0x8')][_0x18dd('0xa')]||null:null,'attributes':[[db[_0x18dd('0x24')]['fn'](_0x18dd('0x35'),db['sequelize']['fn']('IF',db[_0x18dd('0x24')][_0x18dd('0x36')](_0x18dd('0x37')+util[_0x18dd('0x38')](_0x18dd('0x39'),moment()[_0x18dd('0x38')](_0x18dd('0x3a')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x18dd('0x10')](function(_0x681ec3){logger[_0x18dd('0x11')](_0x18dd('0x3b'),_0x56e65e);logger[_0x18dd('0x17')](_0x18dd('0x3b'),_0x56e65e,JSON[_0x18dd('0x12')](_0x681ec3));_0x36f8e3(_0x681ec3);})[_0x18dd('0x13')](function(_0x4749a5){logger[_0x18dd('0x14')](_0x18dd('0x3b'),_0x4749a5[_0x18dd('0x15')],_0x56e65e);_0x51965c(_0x1d8a4c[_0x18dd('0x14')](0x1f4,_0x4749a5[_0x18dd('0x15')]));});});};exports[_0x18dd('0x3c')]=function(_0x1eadae){var _0x551f44=this;return new Promise(function(_0x40eb5f,_0xebcf7b){return db[_0x18dd('0x22')][_0x18dd('0x23')]()[_0x18dd('0x10')](function(){return db[_0x18dd('0x24')][_0x18dd('0x32')](function(_0x501565){return db['CmHopper'][_0x18dd('0x7')]({'where':_0x1eadae[_0x18dd('0x8')]?_0x1eadae[_0x18dd('0x8')]['where']||null:null,'attributes':_0x1eadae['options']?_0x1eadae[_0x18dd('0x8')]['attributes']||null:null,'limit':0x1,'order':_0x1eadae[_0x18dd('0x8')]?_0x1eadae[_0x18dd('0x8')][_0x18dd('0x3d')]||null:null,'group':db[_0x18dd('0x6')]['UserId'],'transaction':_0x501565,'lock':_0x501565[_0x18dd('0x25')][_0x18dd('0x26')],'include':_0x1eadae['options']?_0x1eadae[_0x18dd('0x8')]['include']?_[_0x18dd('0xd')](_0x1eadae['options'][_0x18dd('0xe')],function(_0x339345){return{'model':db[_0x339345[_0x18dd('0xf')]],'as':_0x339345['as'],'attributes':_0x339345[_0x18dd('0xb')],'include':_0x339345[_0x18dd('0xe')]?_[_0x18dd('0xd')](_0x339345[_0x18dd('0xe')],function(_0x376370){return{'model':db[_0x376370[_0x18dd('0xf')]],'as':_0x376370['as'],'attributes':_0x376370[_0x18dd('0xb')],'include':_0x376370['include']?_[_0x18dd('0xd')](_0x376370[_0x18dd('0xe')],function(_0x59092d){return{'model':db[_0x59092d['model']],'as':_0x59092d['as'],'attributes':_0x59092d[_0x18dd('0xb')]};}):[]};}):[]};}):[]:[]})[_0x18dd('0x10')](function(_0x453788){var _0x2bb2c7=[];for(var _0x2abe6b=0x0;_0x2abe6b<_0x453788['length'];_0x2abe6b+=0x1){_0x2bb2c7[_0x18dd('0x2d')](_0x453788[_0x2abe6b][_0x18dd('0x1b')](_0x1eadae[_0x18dd('0x1a')],{'transaction':_0x501565}));}return BPromise['all'](_0x2bb2c7);});})['then'](function(_0x10956f){logger['info'](_0x18dd('0x3c'),_0x1eadae);logger[_0x18dd('0x17')](_0x18dd('0x3c'),_0x1eadae,JSON[_0x18dd('0x12')](_0x10956f));_0x40eb5f(_0x10956f);})['catch'](function(_0x5c9ec6){logger[_0x18dd('0x14')](_0x18dd('0x3c'),_0x5c9ec6[_0x18dd('0x15')],_0x1eadae);_0xebcf7b(_0x551f44[_0x18dd('0x14')](0x1f4,_0x5c9ec6[_0x18dd('0x15')]));});});});};exports[_0x18dd('0x3e')]=function(_0x5d09e4){var _0x2cc333=this;return new Promise(function(_0x5b9631,_0x3844c2){db[_0x18dd('0x22')]['describe']()[_0x18dd('0x10')](function(_0x51e015){return db[_0x18dd('0x6')][_0x18dd('0x7')]({'raw':_0x5d09e4[_0x18dd('0x8')]?_0x5d09e4['options'][_0x18dd('0x9')]===undefined?!![]:![]:!![],'where':_0x5d09e4[_0x18dd('0x8')]?_0x5d09e4[_0x18dd('0x8')][_0x18dd('0xa')]||null:null,'attributes':_0x5d09e4['options']?_0x5d09e4[_0x18dd('0x8')][_0x18dd('0xb')]||null:null,'limit':_0x5d09e4[_0x18dd('0x8')]?_0x5d09e4['options'][_0x18dd('0xc')]||null:null,'include':_0x5d09e4[_0x18dd('0x8')]?_0x5d09e4[_0x18dd('0x8')]['include']?_[_0x18dd('0xd')](_0x5d09e4['options'][_0x18dd('0xe')],function(_0x1bbb99){return{'model':db[_0x1bbb99[_0x18dd('0xf')]],'as':_0x1bbb99['as'],'attributes':_0x1bbb99['as']===_0x18dd('0x27')?_['keys'](_0x51e015):_0x1bbb99['attributes'],'include':_0x1bbb99['include']?_[_0x18dd('0xd')](_0x1bbb99[_0x18dd('0xe')],function(_0x5cf1a3){return{'model':db[_0x5cf1a3[_0x18dd('0xf')]],'as':_0x5cf1a3['as'],'attributes':_0x5cf1a3[_0x18dd('0xb')],'include':_0x5cf1a3[_0x18dd('0xe')]?_[_0x18dd('0xd')](_0x5cf1a3[_0x18dd('0xe')],function(_0x5cf8e0){return{'model':db[_0x5cf8e0[_0x18dd('0xf')]],'as':_0x5cf8e0['as'],'attributes':_0x5cf8e0[_0x18dd('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4228e4){logger[_0x18dd('0x11')](_0x18dd('0x5'),_0x5d09e4);logger['debug'](_0x18dd('0x5'),_0x5d09e4,JSON[_0x18dd('0x12')](_0x4228e4));_0x5b9631(_0x4228e4);})['catch'](function(_0x566906){logger[_0x18dd('0x14')]('GetCmHopper',_0x566906[_0x18dd('0x15')],_0x5d09e4);_0x3844c2(_0x2cc333[_0x18dd('0x14')](0x1f4,_0x566906['message']));});});});};exports[_0x18dd('0x3f')]=function(_0x3afce5){var _0x264d46=this;return new Promise(function(_0x34548d,_0x306431){return db[_0x18dd('0x22')][_0x18dd('0x40')]({'raw':!![],'where':{'phone':_0x3afce5[_0x18dd('0x8')][_0x18dd('0xa')]['phone']},'attributes':['id',_0x18dd('0x41')],'order':[['id',_0x18dd('0x42')]]})[_0x18dd('0x10')](function(_0x11a309){logger[_0x18dd('0x11')](_0x18dd('0x43'),_0x3afce5);logger[_0x18dd('0x17')](_0x18dd('0x43'),_0x3afce5,JSON['stringify'](_0x11a309));_0x34548d(_0x11a309);})[_0x18dd('0x13')](function(_0x4d24a2){logger[_0x18dd('0x14')](_0x18dd('0x43'),_0x4d24a2[_0x18dd('0x15')],_0x3afce5);_0x306431(_0x264d46[_0x18dd('0x14')](0x1f4,_0x4d24a2['message']));});});};exports[_0x18dd('0x44')]=function(_0x346ab1){var _0x38be85=this;return new Promise(function(_0x1cec56,_0x1dedab){return db[_0x18dd('0x24')]['transaction'](function(_0x11cd73){var _0x27fb1d=_0x346ab1[_0x18dd('0x8')]&&_0x346ab1[_0x18dd('0x8')][_0x18dd('0xa')]?_0x346ab1[_0x18dd('0x8')]['where']:{};return db[_0x18dd('0x6')]['update'](_0x346ab1['body'],{'where':_0x27fb1d,'transaction':_0x11cd73})[_0x18dd('0x10')](function(_0x4d8d71){logger[_0x18dd('0x11')](_0x18dd('0x44'),_0x346ab1);logger[_0x18dd('0x17')]('ResetActiveCalls',_0x346ab1,JSON[_0x18dd('0x12')](_0x4d8d71));_0x1cec56(_0x4d8d71);})[_0x18dd('0x13')](function(_0x2faf4b){logger[_0x18dd('0x14')](_0x18dd('0x44'),_0x2faf4b['message'],_0x346ab1);_0x1dedab(_0x38be85[_0x18dd('0x14')](0x1f4,_0x2faf4b['message']));});});});};exports[_0x18dd('0x45')]=function(_0x1acc52){var _0x21d9d3=this;var _0x58f124=_0x1acc52[_0x18dd('0x1a')]['where']['voiceQueueIds'];var _0x53b041=_0x1acc52[_0x18dd('0x1a')][_0x18dd('0xa')]['interval'];var _0x11af1f=_0x1acc52[_0x18dd('0x1a')][_0x18dd('0xa')][_0x18dd('0x46')];return new Promise(function(_0x2b9aa8,_0x55983b){return db[_0x18dd('0x6')]['findAll']({'where':{'voiceQueueId':{'$in':_0x58f124},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x18dd('0x24')][_0x18dd('0x36')](_0x18dd('0x47')+_0x53b041+_0x18dd('0x48')),'$gt':db[_0x18dd('0x24')][_0x18dd('0x36')](_0x18dd('0x49'))}},'UserId':{'$in':_0x11af1f}},'include':[{'model':db[_0x18dd('0x22')],'as':_0x18dd('0x27')},{'model':db[_0x18dd('0x28')],'as':_0x18dd('0x4a'),'attributes':['id',_0x18dd('0x29'),_0x18dd('0x2a')]},{'model':db['CmList'],'as':_0x18dd('0x4b')}]})[_0x18dd('0x10')](function(_0x1c2e6a){if(_0x1c2e6a[_0x18dd('0x2b')]>0x0){return db['sequelize'][_0x18dd('0x32')](function(_0x52d24f){return db[_0x18dd('0x6')][_0x18dd('0x1b')]({'recallmeNotifiedDate':db[_0x18dd('0x24')][_0x18dd('0x36')]('NOW()')},{'where':{'id':{'$in':_[_0x18dd('0xd')](_0x1c2e6a,'id')}},'transaction':_0x52d24f})[_0x18dd('0x10')](function(){_0x2b9aa8(_0x1c2e6a);})[_0x18dd('0x13')](function(_0x3f13f3){logger[_0x18dd('0x14')]('CmHopperHandlePreviewRecallNotifications',_0x3f13f3[_0x18dd('0x15')],_0x1acc52);_0x55983b(_0x21d9d3['error'](0x1f4,_0x3f13f3[_0x18dd('0x15')]));});})[_0x18dd('0x13')](function(_0x23c118){logger[_0x18dd('0x14')](_0x18dd('0x45'),_0x23c118[_0x18dd('0x15')],_0x1acc52);_0x55983b(_0x21d9d3[_0x18dd('0x14')](0x1f4,_0x23c118[_0x18dd('0x15')]));});}else{_0x2b9aa8(_0x1c2e6a);}});});}; \ No newline at end of file +var _0x1ffb=['all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','transaction','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','limit','Contact','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','User','Agent','CmList','List','util','moment','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','options','raw','where','include','map','model','attributes','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','findAll','order','LOCK','UPDATE','keys','name','length','UserId','includes','push'];(function(_0x28b02a,_0x4bda86){var _0x1212ca=function(_0xe40143){while(--_0xe40143){_0x28b02a['push'](_0x28b02a['shift']());}};_0x1212ca(++_0x4bda86);}(_0x1ffb,0x14a));var _0xb1ff=function(_0x5e051a,_0x404ac5){_0x5e051a=_0x5e051a-0x0;var _0x185390=_0x1ffb[_0x5e051a];return _0x185390;};'use strict';var _=require('lodash');var util=require(_0xb1ff('0x0'));var moment=require(_0xb1ff('0x1'));var BPromise=require('bluebird');var db=require(_0xb1ff('0x2'))['db'];var logger=require(_0xb1ff('0x3'))('rpc');exports[_0xb1ff('0x4')]=function(_0x21a61d){var _0x34b55e=this;return new Promise(function(_0xccac3f,_0x27bab7){return db[_0xb1ff('0x5')]['findAll']({'raw':_0x21a61d[_0xb1ff('0x6')]?_0x21a61d['options'][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'where':_0x21a61d[_0xb1ff('0x6')]?_0x21a61d['options'][_0xb1ff('0x8')]||null:null,'attributes':_0x21a61d['options']?_0x21a61d[_0xb1ff('0x6')]['attributes']||null:null,'limit':_0x21a61d[_0xb1ff('0x6')]?_0x21a61d[_0xb1ff('0x6')]['limit']||null:null,'include':_0x21a61d['options']?_0x21a61d[_0xb1ff('0x6')][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x21a61d['options']['include'],function(_0x3397e6){return{'model':db[_0x3397e6[_0xb1ff('0xb')]],'as':_0x3397e6['as'],'attributes':_0x3397e6[_0xb1ff('0xc')],'include':_0x3397e6[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x3397e6[_0xb1ff('0x9')],function(_0x157811){return{'model':db[_0x157811[_0xb1ff('0xb')]],'as':_0x157811['as'],'attributes':_0x157811[_0xb1ff('0xc')],'include':_0x157811[_0xb1ff('0x9')]?_['map'](_0x157811[_0xb1ff('0x9')],function(_0x22d730){return{'model':db[_0x22d730[_0xb1ff('0xb')]],'as':_0x22d730['as'],'attributes':_0x22d730[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x3ca40f){logger[_0xb1ff('0xe')](_0xb1ff('0x4'),_0x21a61d);logger[_0xb1ff('0xf')](_0xb1ff('0x4'),_0x21a61d,JSON[_0xb1ff('0x10')](_0x3ca40f));_0xccac3f(_0x3ca40f);})[_0xb1ff('0x11')](function(_0x13819e){logger[_0xb1ff('0x12')](_0xb1ff('0x4'),_0x13819e['message'],_0x21a61d);_0x27bab7(_0x34b55e['error'](0x1f4,_0x13819e[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x14')]=function(_0x594d39){var _0x317360=this;return new Promise(function(_0x3af390,_0x2e2162){return db[_0xb1ff('0x5')][_0xb1ff('0x15')]({'raw':_0x594d39[_0xb1ff('0x6')]?_0x594d39[_0xb1ff('0x6')]['raw']===undefined?!![]:![]:!![],'where':_0x594d39[_0xb1ff('0x6')]?_0x594d39[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x594d39[_0xb1ff('0x6')]?_0x594d39[_0xb1ff('0x6')][_0xb1ff('0xc')]||null:null,'include':_0x594d39[_0xb1ff('0x6')]?_0x594d39['options'][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x594d39['options'][_0xb1ff('0x9')],function(_0x3a3238){return{'model':db[_0x3a3238['model']],'as':_0x3a3238['as'],'attributes':_0x3a3238['attributes'],'include':_0x3a3238[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x3a3238[_0xb1ff('0x9')],function(_0x457276){return{'model':db[_0x457276[_0xb1ff('0xb')]],'as':_0x457276['as'],'attributes':_0x457276[_0xb1ff('0xc')],'include':_0x457276[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x457276['include'],function(_0x171d2f){return{'model':db[_0x171d2f['model']],'as':_0x171d2f['as'],'attributes':_0x171d2f[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x159a1d){logger['info'](_0xb1ff('0x14'),_0x594d39);logger[_0xb1ff('0xf')](_0xb1ff('0x14'),_0x594d39,JSON['stringify'](_0x159a1d));_0x3af390(_0x159a1d);})[_0xb1ff('0x11')](function(_0x46bcb1){logger[_0xb1ff('0x12')](_0xb1ff('0x14'),_0x46bcb1[_0xb1ff('0x13')],_0x594d39);_0x2e2162(_0x317360[_0xb1ff('0x12')](0x1f4,_0x46bcb1['message']));});});};exports[_0xb1ff('0x16')]=function(_0x829ace){var _0x9fa1d9=this;return new Promise(function(_0x84a8fe,_0x52daeb){return db[_0xb1ff('0x5')][_0xb1ff('0x17')](_0x829ace['body'],{'raw':_0x829ace[_0xb1ff('0x6')]?_0x829ace[_0xb1ff('0x6')][_0xb1ff('0x7')]===undefined?!![]:![]:!![]})[_0xb1ff('0xd')](function(_0xb95cb3){logger[_0xb1ff('0xe')]('CreateCmHopper',_0x829ace);logger[_0xb1ff('0xf')](_0xb1ff('0x16'),_0x829ace,JSON[_0xb1ff('0x10')](_0xb95cb3));_0x84a8fe(_0xb95cb3);})[_0xb1ff('0x11')](function(_0x38627a){logger[_0xb1ff('0x12')]('CreateCmHopper',_0x38627a[_0xb1ff('0x13')],_0x829ace);_0x52daeb(_0x9fa1d9['error'](0x1f4,_0x38627a[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x18')]=function(_0x1d88db){var _0x2004f4=this;return new Promise(function(_0x2128e1,_0x452a83){return db[_0xb1ff('0x5')][_0xb1ff('0x19')](_0x1d88db[_0xb1ff('0x1a')],{'raw':_0x1d88db[_0xb1ff('0x6')]?_0x1d88db[_0xb1ff('0x6')][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d88db[_0xb1ff('0x6')]?_0x1d88db[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x1d88db['options']?_0x1d88db[_0xb1ff('0x6')][_0xb1ff('0xc')]||null:null,'limit':_0x1d88db[_0xb1ff('0x6')]?_0x1d88db[_0xb1ff('0x6')]['limit']||null:null})[_0xb1ff('0xd')](function(_0x3d98ad){logger['info'](_0xb1ff('0x18'),_0x1d88db);logger['info'](_0xb1ff('0x1b'),JSON[_0xb1ff('0x10')](_0x1d88db['options'][_0xb1ff('0x8')]),_0x1d88db[_0xb1ff('0x1a')][_0xb1ff('0x1c')]);logger[_0xb1ff('0xf')](_0xb1ff('0x18'),_0x1d88db,JSON[_0xb1ff('0x10')](_0x3d98ad));_0x2128e1(_0x3d98ad);})[_0xb1ff('0x11')](function(_0x254f08){logger['error'](_0xb1ff('0x18'),_0x254f08['message'],_0x1d88db);_0x452a83(_0x2004f4[_0xb1ff('0x12')](0x1f4,_0x254f08['message']));});});};exports[_0xb1ff('0x1d')]=function(_0x105012){var _0x35cc7e=this;return new Promise(function(_0x55e0e3,_0x5d9283){return db[_0xb1ff('0x5')][_0xb1ff('0x1e')]({'where':_0x105012[_0xb1ff('0x6')]?_0x105012[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null})['then'](function(_0x1cb5b6){logger[_0xb1ff('0xe')]('DestroyCmHopper',_0x105012);logger[_0xb1ff('0xf')](_0xb1ff('0x1d'),_0x105012,JSON[_0xb1ff('0x10')](_0x1cb5b6));_0x55e0e3(_0x1cb5b6);})[_0xb1ff('0x11')](function(_0x969d98){logger[_0xb1ff('0x12')](_0xb1ff('0x1d'),_0x969d98['message'],_0x105012);_0x5d9283(_0x35cc7e[_0xb1ff('0x12')](0x1f4,_0x969d98[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x1f')]=function(_0x76c286){var _0x12d76c=this;return new Promise(function(_0x548ee4,_0x8ed3cf){return db[_0xb1ff('0x20')][_0xb1ff('0x21')]()[_0xb1ff('0xd')](function(_0x2f8f3a){return db[_0xb1ff('0x22')]['transaction'](function(_0x4f0b31){return db[_0xb1ff('0x5')][_0xb1ff('0x23')]({'where':_0x76c286[_0xb1ff('0x6')]?_0x76c286[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x76c286[_0xb1ff('0x6')]?_0x76c286['options'][_0xb1ff('0xc')]||null:null,'limit':_0x76c286[_0xb1ff('0x6')]?_0x76c286['options']['limit']||null:null,'order':_0x76c286['options']?_0x76c286[_0xb1ff('0x6')][_0xb1ff('0x24')]||null:null,'transaction':_0x4f0b31,'lock':_0x4f0b31[_0xb1ff('0x25')][_0xb1ff('0x26')],'include':[{'model':db[_0xb1ff('0x20')],'as':'Contact','attributes':_[_0xb1ff('0x27')](_0x2f8f3a)},{'model':db['User'],'as':'Agent','attributes':['id',_0xb1ff('0x28'),'voicePause']}]})[_0xb1ff('0xd')](function(_0x1bf07b){var _0x18e9f5=[];var _0x176cbb=[];for(var _0x4fa4fa=0x0;_0x4fa4fa<_0x1bf07b[_0xb1ff('0x29')];_0x4fa4fa+=0x1){var _0x4f8cba=_0x1bf07b[_0x4fa4fa][_0xb1ff('0x2a')];if(_0x4f8cba===null){_0x18e9f5['push'](_0x1bf07b[_0x4fa4fa][_0xb1ff('0x19')](_0x76c286[_0xb1ff('0x1a')],{'transaction':_0x4f0b31}));}else if(!_0x176cbb[_0xb1ff('0x2b')](_0x4f8cba)){_0x176cbb[_0xb1ff('0x2c')](_0x4f8cba);_0x18e9f5[_0xb1ff('0x2c')](_0x1bf07b[_0x4fa4fa][_0xb1ff('0x19')](_0x76c286[_0xb1ff('0x1a')],{'transaction':_0x4f0b31}));}}return BPromise[_0xb1ff('0x2d')](_0x18e9f5);});})[_0xb1ff('0xd')](function(_0x30f532){logger['info'](_0xb1ff('0x1f'),_0x76c286);if(_0x30f532['length']>0x0){logger[_0xb1ff('0xe')](_0xb1ff('0x2e'),_0x30f532[0x0][_0xb1ff('0x2f')]['id'],_0x30f532[0x0][_0xb1ff('0x2f')]['ContactId'],_0x30f532[0x0][_0xb1ff('0x2f')][_0xb1ff('0x1c')]);}logger[_0xb1ff('0xf')]('GetContactDialer',_0x76c286,JSON[_0xb1ff('0x10')](_0x30f532));_0x548ee4(_0x30f532);})['catch'](function(_0x27b7ae){logger['error'](_0xb1ff('0x1f'),_0x27b7ae['message'],_0x76c286);_0x8ed3cf(_0x12d76c[_0xb1ff('0x12')](0x1f4,_0x27b7ae[_0xb1ff('0x13')]));});});});};exports[_0xb1ff('0x30')]=function(_0x2d4d1f){var _0x2e515c=this;return new Promise(function(_0x3fbe51,_0x407a4a){return db['sequelize'][_0xb1ff('0x31')](function(_0x3d4c3e){return db[_0xb1ff('0x32')][_0xb1ff('0x17')](_0x2d4d1f[_0xb1ff('0x1a')],{'raw':_0x2d4d1f[_0xb1ff('0x6')]?_0x2d4d1f['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x3d4c3e})['then'](function(){logger[_0xb1ff('0xe')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xb1ff('0x10')](_0x2d4d1f[_0xb1ff('0x6')][_0xb1ff('0x8')]),_0x2d4d1f['options'][_0xb1ff('0x8')][_0xb1ff('0x1c')]);return db[_0xb1ff('0x5')][_0xb1ff('0x1e')]({'where':_0x2d4d1f[_0xb1ff('0x6')]?_0x2d4d1f[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'transaction':_0x3d4c3e});});})[_0xb1ff('0xd')](function(_0x343fa8){logger[_0xb1ff('0xe')](_0xb1ff('0x30'),_0x2d4d1f);logger[_0xb1ff('0xf')](_0xb1ff('0x30'),_0x2d4d1f,JSON[_0xb1ff('0x10')](_0x343fa8));_0x3fbe51(_0x343fa8);})['catch'](function(_0x5de4cb){logger['error'](_0xb1ff('0x30'),_0x5de4cb[_0xb1ff('0x13')],_0x2d4d1f);_0x407a4a(_0x2e515c[_0xb1ff('0x12')](0x1f4,_0x5de4cb[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x33')]=function(_0x3c4356){var _0x4cc127=this;return new Promise(function(_0x456efb,_0x67b432){return db[_0xb1ff('0x5')][_0xb1ff('0x23')]({'raw':_0x3c4356['options']?_0x3c4356['options'][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'where':_0x3c4356[_0xb1ff('0x6')]?_0x3c4356[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb1ff('0x34'),db[_0xb1ff('0x22')]['fn']('IF',db[_0xb1ff('0x22')][_0xb1ff('0x35')](_0xb1ff('0x36')+util['format']('\x22%s\x22',moment()[_0xb1ff('0x37')](_0xb1ff('0x38')))+_0xb1ff('0x39')))),_0xb1ff('0x3a')]]})[_0xb1ff('0xd')](function(_0x4006e6){logger[_0xb1ff('0xe')](_0xb1ff('0x33'),_0x3c4356);logger[_0xb1ff('0xf')](_0xb1ff('0x33'),_0x3c4356,JSON[_0xb1ff('0x10')](_0x4006e6));_0x456efb(_0x4006e6);})[_0xb1ff('0x11')](function(_0xeef28a){logger[_0xb1ff('0x12')](_0xb1ff('0x33'),_0xeef28a[_0xb1ff('0x13')],_0x3c4356);_0x67b432(_0x4cc127[_0xb1ff('0x12')](0x1f4,_0xeef28a[_0xb1ff('0x13')]));});});};exports[_0xb1ff('0x3b')]=function(_0x1b2cb3){var _0x9ed144=this;return new Promise(function(_0x22cf26,_0x1e7e40){return db[_0xb1ff('0x20')][_0xb1ff('0x21')]()[_0xb1ff('0xd')](function(){return db[_0xb1ff('0x22')]['transaction'](function(_0x177026){return db[_0xb1ff('0x5')][_0xb1ff('0x23')]({'where':_0x1b2cb3[_0xb1ff('0x6')]?_0x1b2cb3[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x1b2cb3['options']?_0x1b2cb3[_0xb1ff('0x6')][_0xb1ff('0xc')]||null:null,'limit':0x1,'order':_0x1b2cb3[_0xb1ff('0x6')]?_0x1b2cb3['options']['order']||null:null,'group':db['CmHopper'][_0xb1ff('0x2a')],'transaction':_0x177026,'lock':_0x177026['LOCK'][_0xb1ff('0x26')],'include':_0x1b2cb3[_0xb1ff('0x6')]?_0x1b2cb3[_0xb1ff('0x6')][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x1b2cb3[_0xb1ff('0x6')]['include'],function(_0x49830c){return{'model':db[_0x49830c[_0xb1ff('0xb')]],'as':_0x49830c['as'],'attributes':_0x49830c[_0xb1ff('0xc')],'include':_0x49830c[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x49830c[_0xb1ff('0x9')],function(_0x542c04){return{'model':db[_0x542c04[_0xb1ff('0xb')]],'as':_0x542c04['as'],'attributes':_0x542c04[_0xb1ff('0xc')],'include':_0x542c04[_0xb1ff('0x9')]?_['map'](_0x542c04[_0xb1ff('0x9')],function(_0x1140cf){return{'model':db[_0x1140cf['model']],'as':_0x1140cf['as'],'attributes':_0x1140cf[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x416d46){var _0x16c910=[];for(var _0x475661=0x0;_0x475661<_0x416d46[_0xb1ff('0x29')];_0x475661+=0x1){_0x16c910[_0xb1ff('0x2c')](_0x416d46[_0x475661][_0xb1ff('0x19')](_0x1b2cb3[_0xb1ff('0x1a')],{'transaction':_0x177026}));}return BPromise[_0xb1ff('0x2d')](_0x16c910);});})[_0xb1ff('0xd')](function(_0x23c034){logger['info']('GetContactRecallMe',_0x1b2cb3);logger[_0xb1ff('0xf')](_0xb1ff('0x3b'),_0x1b2cb3,JSON['stringify'](_0x23c034));_0x22cf26(_0x23c034);})[_0xb1ff('0x11')](function(_0x6a88f0){logger[_0xb1ff('0x12')]('GetContactRecallMe',_0x6a88f0[_0xb1ff('0x13')],_0x1b2cb3);_0x1e7e40(_0x9ed144[_0xb1ff('0x12')](0x1f4,_0x6a88f0[_0xb1ff('0x13')]));});});});};exports[_0xb1ff('0x3c')]=function(_0x416299){var _0x3800e4=this;return new Promise(function(_0x1b757f,_0xb409cb){db[_0xb1ff('0x20')][_0xb1ff('0x21')]()[_0xb1ff('0xd')](function(_0x2736bb){return db['CmHopper']['findAll']({'raw':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x7')]===undefined?!![]:![]:!![],'where':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x8')]||null:null,'attributes':_0x416299[_0xb1ff('0x6')]?_0x416299['options'][_0xb1ff('0xc')]||null:null,'limit':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x3d')]||null:null,'include':_0x416299[_0xb1ff('0x6')]?_0x416299[_0xb1ff('0x6')][_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x416299['options'][_0xb1ff('0x9')],function(_0x5b6465){return{'model':db[_0x5b6465[_0xb1ff('0xb')]],'as':_0x5b6465['as'],'attributes':_0x5b6465['as']===_0xb1ff('0x3e')?_[_0xb1ff('0x27')](_0x2736bb):_0x5b6465['attributes'],'include':_0x5b6465[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x5b6465['include'],function(_0x1ff770){return{'model':db[_0x1ff770[_0xb1ff('0xb')]],'as':_0x1ff770['as'],'attributes':_0x1ff770['attributes'],'include':_0x1ff770[_0xb1ff('0x9')]?_[_0xb1ff('0xa')](_0x1ff770[_0xb1ff('0x9')],function(_0x55660f){return{'model':db[_0x55660f['model']],'as':_0x55660f['as'],'attributes':_0x55660f[_0xb1ff('0xc')]};}):[]};}):[]};}):[]:[]})[_0xb1ff('0xd')](function(_0x362443){logger[_0xb1ff('0xe')](_0xb1ff('0x4'),_0x416299);logger[_0xb1ff('0xf')]('GetCmHopper',_0x416299,JSON[_0xb1ff('0x10')](_0x362443));_0x1b757f(_0x362443);})[_0xb1ff('0x11')](function(_0x9754ec){logger[_0xb1ff('0x12')](_0xb1ff('0x4'),_0x9754ec[_0xb1ff('0x13')],_0x416299);_0xb409cb(_0x3800e4['error'](0x1f4,_0x9754ec[_0xb1ff('0x13')]));});});});};exports['GetContactByPhone']=function(_0x48ad62){var _0x5a9b5d=this;return new Promise(function(_0x1b8fda,_0x5efe0e){return db[_0xb1ff('0x20')]['findOne']({'raw':!![],'where':{'phone':_0x48ad62[_0xb1ff('0x6')][_0xb1ff('0x8')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0xb1ff('0x3f')]]})[_0xb1ff('0xd')](function(_0x3415f3){logger[_0xb1ff('0xe')](_0xb1ff('0x40'),_0x48ad62);logger['debug']('getContactByPhone',_0x48ad62,JSON[_0xb1ff('0x10')](_0x3415f3));_0x1b8fda(_0x3415f3);})[_0xb1ff('0x11')](function(_0x539a2c){logger[_0xb1ff('0x12')](_0xb1ff('0x40'),_0x539a2c[_0xb1ff('0x13')],_0x48ad62);_0x5efe0e(_0x5a9b5d['error'](0x1f4,_0x539a2c['message']));});});};exports[_0xb1ff('0x41')]=function(_0x11cb70){var _0x28574a=this;return new Promise(function(_0x5c2d71,_0x12f4ac){return db[_0xb1ff('0x22')][_0xb1ff('0x31')](function(_0x1957d){var _0x5a7fa6=_0x11cb70[_0xb1ff('0x6')]&&_0x11cb70['options'][_0xb1ff('0x8')]?_0x11cb70[_0xb1ff('0x6')][_0xb1ff('0x8')]:{};return db[_0xb1ff('0x5')][_0xb1ff('0x19')](_0x11cb70[_0xb1ff('0x1a')],{'where':_0x5a7fa6,'transaction':_0x1957d})['then'](function(_0x5d2501){logger['info'](_0xb1ff('0x41'),_0x11cb70);logger[_0xb1ff('0xf')](_0xb1ff('0x41'),_0x11cb70,JSON[_0xb1ff('0x10')](_0x5d2501));_0x5c2d71(_0x5d2501);})[_0xb1ff('0x11')](function(_0x4c1fbf){logger['error'](_0xb1ff('0x41'),_0x4c1fbf[_0xb1ff('0x13')],_0x11cb70);_0x12f4ac(_0x28574a[_0xb1ff('0x12')](0x1f4,_0x4c1fbf['message']));});});});};exports[_0xb1ff('0x42')]=function(_0xfd0f0e){var _0x6652da=this;var _0x2d4a3b=_0xfd0f0e['body'][_0xb1ff('0x8')][_0xb1ff('0x43')];var _0x1e4d1c=_0xfd0f0e[_0xb1ff('0x1a')]['where']['interval'];var _0x1daac7=_0xfd0f0e['body'][_0xb1ff('0x8')][_0xb1ff('0x44')];return new Promise(function(_0x197d38,_0x275468){return db[_0xb1ff('0x5')]['findAll']({'where':{'voiceQueueId':{'$in':_0x2d4a3b},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xb1ff('0x22')]['literal'](_0xb1ff('0x45')+_0x1e4d1c+'\x20MINUTE'),'$gt':db[_0xb1ff('0x22')][_0xb1ff('0x35')](_0xb1ff('0x46'))}},'UserId':{'$in':_0x1daac7}},'include':[{'model':db[_0xb1ff('0x20')],'as':_0xb1ff('0x3e')},{'model':db[_0xb1ff('0x47')],'as':_0xb1ff('0x48'),'attributes':['id',_0xb1ff('0x28'),'voicePause']},{'model':db[_0xb1ff('0x49')],'as':_0xb1ff('0x4a')}]})[_0xb1ff('0xd')](function(_0xd0fd70){if(_0xd0fd70['length']>0x0){return db[_0xb1ff('0x22')][_0xb1ff('0x31')](function(_0x5e300f){return db[_0xb1ff('0x5')][_0xb1ff('0x19')]({'recallmeNotifiedDate':db['sequelize'][_0xb1ff('0x35')](_0xb1ff('0x46'))},{'where':{'id':{'$in':_['map'](_0xd0fd70,'id')}},'transaction':_0x5e300f})['then'](function(){_0x197d38(_0xd0fd70);})[_0xb1ff('0x11')](function(_0x43f9e5){logger[_0xb1ff('0x12')](_0xb1ff('0x42'),_0x43f9e5['message'],_0xfd0f0e);_0x275468(_0x6652da[_0xb1ff('0x12')](0x1f4,_0x43f9e5[_0xb1ff('0x13')]));});})[_0xb1ff('0x11')](function(_0x3a0c08){logger[_0xb1ff('0x12')](_0xb1ff('0x42'),_0x3a0c08[_0xb1ff('0x13')],_0xfd0f0e);_0x275468(_0x6652da[_0xb1ff('0x12')](0x1f4,_0x3a0c08[_0xb1ff('0x13')]));});}else{_0x197d38(_0xd0fd70);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 2622cc2..70f9f26 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 _0xb42c=['describe','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','update','delete','destroy','Router','./cmHopper.controller','isAuthenticated','index','get','/describe'];(function(_0x2f8d07,_0xb712c8){var _0x444a96=function(_0x33168d){while(--_0x33168d){_0x2f8d07['push'](_0x2f8d07['shift']());}};_0x444a96(++_0xb712c8);}(_0xb42c,0x6d));var _0xcb42=function(_0x11cc79,_0x1970e8){_0x11cc79=_0x11cc79-0x0;var _0x4f591b=_0xb42c[_0x11cc79];return _0x4f591b;};'use strict';var express=require('express');var router=express[_0xcb42('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xcb42('0x1'));router['get']('/',auth[_0xcb42('0x2')](),controller[_0xcb42('0x3')]);router[_0xcb42('0x4')](_0xcb42('0x5'),auth[_0xcb42('0x2')](),controller[_0xcb42('0x6')]);router[_0xcb42('0x4')]('/opencontacts',auth[_0xcb42('0x2')](),controller[_0xcb42('0x7')]);router[_0xcb42('0x4')](_0xcb42('0x8'),auth[_0xcb42('0x2')](),controller[_0xcb42('0x9')]);router[_0xcb42('0x4')](_0xcb42('0xa'),auth['isAuthenticated'](),controller[_0xcb42('0xb')]);router[_0xcb42('0x4')](_0xcb42('0xc'),auth[_0xcb42('0x2')](),controller[_0xcb42('0xd')]);router[_0xcb42('0xe')]('/',auth['isAuthenticated'](),controller[_0xcb42('0xf')]);router['post'](_0xcb42('0x10'),auth[_0xcb42('0x2')](),controller[_0xcb42('0x11')]);router['post'](_0xcb42('0x12'),auth[_0xcb42('0x2')](),controller['getTimezone']);router[_0xcb42('0x13')](_0xcb42('0xa'),auth['isAuthenticated'](),controller[_0xcb42('0x14')]);router[_0xcb42('0x15')](_0xcb42('0xa'),auth[_0xcb42('0x2')](),controller[_0xcb42('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe7ee=['update','delete','destroy','exports','express','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','getOpenContacts','/timezones','getTimezones','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','put','/:id'];(function(_0x3126b6,_0x450061){var _0x116531=function(_0x4db330){while(--_0x4db330){_0x3126b6['push'](_0x3126b6['shift']());}};_0x116531(++_0x450061);}(_0xe7ee,0x19c));var _0xee7e=function(_0x3ad60e,_0xbc948){_0x3ad60e=_0x3ad60e-0x0;var _0x23dddb=_0xe7ee[_0x3ad60e];return _0x23dddb;};'use strict';var express=require(_0xee7e('0x0'));var router=express['Router']();var auth=require(_0xee7e('0x1'));var controller=require(_0xee7e('0x2'));router['get']('/',auth[_0xee7e('0x3')](),controller[_0xee7e('0x4')]);router[_0xee7e('0x5')](_0xee7e('0x6'),auth['isAuthenticated'](),controller[_0xee7e('0x7')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller[_0xee7e('0x8')]);router[_0xee7e('0x5')](_0xee7e('0x9'),auth[_0xee7e('0x3')](),controller[_0xee7e('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xee7e('0x5')](_0xee7e('0xb'),auth['isAuthenticated'](),controller[_0xee7e('0xc')]);router[_0xee7e('0xd')]('/',auth['isAuthenticated'](),controller[_0xee7e('0xe')]);router[_0xee7e('0xd')](_0xee7e('0xf'),auth[_0xee7e('0x3')](),controller[_0xee7e('0x10')]);router[_0xee7e('0xd')](_0xee7e('0x11'),auth[_0xee7e('0x3')](),controller['getTimezone']);router[_0xee7e('0x12')](_0xee7e('0x13'),auth['isAuthenticated'](),controller[_0xee7e('0x14')]);router[_0xee7e('0x15')]('/:id',auth[_0xee7e('0x3')](),controller[_0xee7e('0x16')]);module[_0xee7e('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index c3e56b6..4d0751e 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 _0x8566=['moment','sequelize','exports','INTEGER','STRING','DATE','format'];(function(_0x39b4c5,_0x51f394){var _0x2f1ad1=function(_0x49d2fa){while(--_0x49d2fa){_0x39b4c5['push'](_0x39b4c5['shift']());}};_0x2f1ad1(++_0x51f394);}(_0x8566,0x1a4));var _0x6856=function(_0x162aaa,_0xbc3555){_0x162aaa=_0x162aaa-0x0;var _0x1e3225=_0x8566[_0x162aaa];return _0x1e3225;};'use strict';var moment=require(_0x6856('0x0'));var Sequelize=require(_0x6856('0x1'));module[_0x6856('0x2')]={'CmHopperId':{'type':Sequelize[_0x6856('0x3')]},'phone':{'type':Sequelize[_0x6856('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x6856('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x6856('0x5')],'defaultValue':moment()[_0x6856('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6856('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6856('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6856('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6856('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6856('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6856('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb2c1=['INTEGER','STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0xb2c1,0x184));var _0x1b2c=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xb2c1[_0x44c768];return _0x55daf5;};'use strict';var moment=require(_0x1b2c('0x0'));var Sequelize=require(_0x1b2c('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x1b2c('0x2')]},'phone':{'type':Sequelize[_0x1b2c('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x1b2c('0x4')](_0x1b2c('0x5'))},'countbusyretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1b2c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index a28f7b4..27e47aa 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 _0x568a=['send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperAdditionalPhone','include','rows','catch','show','params','length','includeAll','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','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','stack','name'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x568a,0x79));var _0xa568=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x568a[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa568('0x0'));var zipdir=require(_0xa568('0x1'));var jsonpatch=require(_0xa568('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa568('0x3'));var Mustache=require(_0xa568('0x4'));var util=require(_0xa568('0x5'));var path=require(_0xa568('0x6'));var sox=require(_0xa568('0x7'));var csv=require(_0xa568('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa568('0x9'));var squel=require(_0xa568('0xa'));var crypto=require('crypto');var jsforce=require(_0xa568('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa568('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xa568('0xd'));var as=require(_0xa568('0xe'));var hardwareService=require(_0xa568('0xf'));var logger=require(_0xa568('0x10'))(_0xa568('0x11'));var utils=require('../../config/utils');var config=require(_0xa568('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118341,_0x3d1b77){_0x3d1b77=_0x3d1b77||0xcc;return function(_0x5640a7){if(_0x5640a7){return _0x118341[_0xa568('0x13')](_0x3d1b77);}return _0x118341[_0xa568('0x14')](_0x3d1b77)[_0xa568('0x15')]();};}function respondWithResult(_0x3c877f,_0x31f488){_0x31f488=_0x31f488||0xc8;return function(_0x10a085){if(_0x10a085){return _0x3c877f[_0xa568('0x14')](_0x31f488)[_0xa568('0x16')](_0x10a085);}};}function respondWithFilteredResult(_0x5e83a5,_0xfb3473){return function(_0x3bd849){if(_0x3bd849){var _0x278be6=typeof _0xfb3473[_0xa568('0x17')]==='undefined'&&typeof _0xfb3473['limit']==='undefined';var _0x4389c5=_0x3bd849[_0xa568('0x18')];var _0x335d13=_0x278be6?0x0:_0xfb3473[_0xa568('0x17')];var _0x1ed64f=_0x278be6?_0x3bd849[_0xa568('0x18')]:_0xfb3473[_0xa568('0x17')]+_0xfb3473[_0xa568('0x19')];var _0x4591df;if(_0x1ed64f>=_0x4389c5){_0x1ed64f=_0x4389c5;_0x4591df=0xc8;}else{_0x4591df=0xce;}_0x5e83a5[_0xa568('0x14')](_0x4591df);return _0x5e83a5[_0xa568('0x1a')](_0xa568('0x1b'),_0x335d13+'-'+_0x1ed64f+'/'+_0x4389c5)['json'](_0x3bd849);}return null;};}function patchUpdates(_0x1e4f31){return function(_0x49a7a3){try{jsonpatch[_0xa568('0x1c')](_0x49a7a3,_0x1e4f31,!![]);}catch(_0xf9fe7b){return BPromise[_0xa568('0x1d')](_0xf9fe7b);}return _0x49a7a3[_0xa568('0x1e')]();};}function saveUpdates(_0x372f32,_0x1dde6d){return function(_0x33f486){if(_0x33f486){return _0x33f486[_0xa568('0x1f')](_0x372f32)[_0xa568('0x20')](function(_0x5f0cf0){return _0x5f0cf0;});}return null;};}function removeEntity(_0x313d46,_0x2cbe4e){return function(_0x78a633){if(_0x78a633){return _0x78a633[_0xa568('0x21')]()[_0xa568('0x20')](function(){var _0x33459d=_0x78a633['get']({'plain':!![]});var _0x5a06b2=_0xa568('0x22');return db[_0xa568('0x23')]['destroy']({'where':{'type':_0x5a06b2,'resourceId':_0x33459d['id']}})[_0xa568('0x20')](function(){return _0x78a633;});})[_0xa568('0x20')](function(){_0x313d46[_0xa568('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1590,_0xb5cb5e){return function(_0x248bbc){if(!_0x248bbc){_0x5e1590['sendStatus'](0x194);}return _0x248bbc;};}function handleError(_0x57938d,_0x3f014f){_0x3f014f=_0x3f014f||0x1f4;return function(_0xd3062b){logger[_0xa568('0x24')](_0xd3062b[_0xa568('0x25')]);if(_0xd3062b[_0xa568('0x26')]){delete _0xd3062b[_0xa568('0x26')];}_0x57938d[_0xa568('0x14')](_0x3f014f)[_0xa568('0x27')](_0xd3062b);};}exports[_0xa568('0x28')]=function(_0x261c8,_0x1e8340){var _0x2dc7ce={},_0x3b7210={},_0x53ae9c={'count':0x0,'rows':[]};var _0x3bde50=_[_0xa568('0x29')](db['CmHopperAdditionalPhone'][_0xa568('0x2a')],function(_0x57409c){return{'name':_0x57409c[_0xa568('0x2b')],'type':_0x57409c[_0xa568('0x2c')][_0xa568('0x2d')]};});_0x3b7210['model']=_['map'](_0x3bde50,_0xa568('0x26'));_0x3b7210['query']=_[_0xa568('0x2e')](_0x261c8['query']);_0x3b7210[_0xa568('0x2f')]=_[_0xa568('0x30')](_0x3b7210[_0xa568('0x31')],_0x3b7210[_0xa568('0x32')]);_0x2dc7ce[_0xa568('0x33')]=_[_0xa568('0x30')](_0x3b7210[_0xa568('0x31')],qs[_0xa568('0x34')](_0x261c8[_0xa568('0x32')][_0xa568('0x34')]));_0x2dc7ce[_0xa568('0x33')]=_0x2dc7ce[_0xa568('0x33')]['length']?_0x2dc7ce[_0xa568('0x33')]:_0x3b7210['model'];if(!_0x261c8[_0xa568('0x32')]['hasOwnProperty']('nolimit')){_0x2dc7ce[_0xa568('0x19')]=qs[_0xa568('0x19')](_0x261c8[_0xa568('0x32')]['limit']);_0x2dc7ce['offset']=qs[_0xa568('0x17')](_0x261c8[_0xa568('0x32')][_0xa568('0x17')]);}_0x2dc7ce[_0xa568('0x35')]=qs[_0xa568('0x36')](_0x261c8[_0xa568('0x32')][_0xa568('0x36')]);_0x2dc7ce[_0xa568('0x37')]=qs[_0xa568('0x2f')](_[_0xa568('0x38')](_0x261c8[_0xa568('0x32')],_0x3b7210['filters']),_0x3bde50);if(_0x261c8[_0xa568('0x32')]['filter']){_0x2dc7ce[_0xa568('0x37')]=_[_0xa568('0x39')](_0x2dc7ce['where'],{'$or':_[_0xa568('0x29')](_0x3bde50,function(_0x16ddfc){if(_0x16ddfc['type']!==_0xa568('0x3a')){var _0x536bd3={};_0x536bd3[_0x16ddfc[_0xa568('0x26')]]={'$like':'%'+_0x261c8['query'][_0xa568('0x3b')]+'%'};return _0x536bd3;}})});}_0x2dc7ce=_['merge']({},_0x2dc7ce,_0x261c8[_0xa568('0x3c')]);var _0x4711bd={'where':_0x2dc7ce[_0xa568('0x37')]};return db[_0xa568('0x3d')]['count'](_0x4711bd)[_0xa568('0x20')](function(_0x1278b0){_0x53ae9c[_0xa568('0x18')]=_0x1278b0;if(_0x261c8[_0xa568('0x32')]['includeAll']){_0x2dc7ce[_0xa568('0x3e')]=[{'all':!![]}];}return db[_0xa568('0x3d')]['findAll'](_0x2dc7ce);})[_0xa568('0x20')](function(_0x1e3afe){_0x53ae9c[_0xa568('0x3f')]=_0x1e3afe;return _0x53ae9c;})[_0xa568('0x20')](respondWithFilteredResult(_0x1e8340,_0x2dc7ce))[_0xa568('0x40')](handleError(_0x1e8340,null));};exports[_0xa568('0x41')]=function(_0x434a9a,_0x16740a){var _0xfed043={'raw':!![],'where':{'id':_0x434a9a[_0xa568('0x42')]['id']}},_0x353b0b={};_0x353b0b['model']=_[_0xa568('0x2e')](db[_0xa568('0x3d')][_0xa568('0x2a')]);_0x353b0b[_0xa568('0x32')]=_[_0xa568('0x2e')](_0x434a9a[_0xa568('0x32')]);_0x353b0b[_0xa568('0x2f')]=_[_0xa568('0x30')](_0x353b0b['model'],_0x353b0b[_0xa568('0x32')]);_0xfed043[_0xa568('0x33')]=_[_0xa568('0x30')](_0x353b0b[_0xa568('0x31')],qs[_0xa568('0x34')](_0x434a9a['query'][_0xa568('0x34')]));_0xfed043[_0xa568('0x33')]=_0xfed043[_0xa568('0x33')][_0xa568('0x43')]?_0xfed043['attributes']:_0x353b0b[_0xa568('0x31')];if(_0x434a9a['query'][_0xa568('0x44')]){_0xfed043['include']=[{'all':!![]}];}_0xfed043=_[_0xa568('0x39')]({},_0xfed043,_0x434a9a[_0xa568('0x3c')]);return db['CmHopperAdditionalPhone'][_0xa568('0x45')](_0xfed043)[_0xa568('0x20')](handleEntityNotFound(_0x16740a,null))['then'](respondWithResult(_0x16740a,null))['catch'](handleError(_0x16740a,null));};exports[_0xa568('0x46')]=function(_0x196b54,_0x8d6634){return db['CmHopperAdditionalPhone'][_0xa568('0x46')](_0x196b54[_0xa568('0x47')],{})[_0xa568('0x20')](function(_0x24b2cc){var _0xb3e396=_0x196b54[_0xa568('0x48')][_0xa568('0x49')]({'plain':!![]});if(!_0xb3e396)throw new Error(_0xa568('0x4a'));if(_0xb3e396[_0xa568('0x4b')]===_0xa568('0x48')){var _0x10a656=_0x24b2cc[_0xa568('0x49')]({'plain':!![]});var _0x413ee7=_0xa568('0x22');return db[_0xa568('0x4c')]['find']({'where':{'name':_0x413ee7,'userProfileId':_0xb3e396[_0xa568('0x4d')]},'raw':!![]})[_0xa568('0x20')](function(_0x31186f){if(_0x31186f&&_0x31186f[_0xa568('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x10a656['name'],'resourceId':_0x10a656['id'],'type':_0x31186f[_0xa568('0x26')],'sectionId':_0x31186f['id']},{})['then'](function(){return _0x24b2cc;});}else{return _0x24b2cc;}})['catch'](function(_0x21c718){logger[_0xa568('0x24')](_0xa568('0x4f'),_0x21c718);throw _0x21c718;});}return _0x24b2cc;})[_0xa568('0x20')](respondWithResult(_0x8d6634,0xc9))['catch'](handleError(_0x8d6634,null));};exports[_0xa568('0x1f')]=function(_0x18c9a5,_0x4d7623){if(_0x18c9a5[_0xa568('0x47')]['id']){delete _0x18c9a5[_0xa568('0x47')]['id'];}return db['CmHopperAdditionalPhone'][_0xa568('0x45')]({'where':{'id':_0x18c9a5['params']['id']}})[_0xa568('0x20')](handleEntityNotFound(_0x4d7623,null))[_0xa568('0x20')](saveUpdates(_0x18c9a5[_0xa568('0x47')],null))[_0xa568('0x20')](respondWithResult(_0x4d7623,null))[_0xa568('0x40')](handleError(_0x4d7623,null));};exports[_0xa568('0x21')]=function(_0x1d8336,_0x23ca89){return db['CmHopperAdditionalPhone'][_0xa568('0x45')]({'where':{'id':_0x1d8336[_0xa568('0x42')]['id']}})[_0xa568('0x20')](handleEntityNotFound(_0x23ca89,null))['then'](removeEntity(_0x23ca89,null))[_0xa568('0x40')](handleError(_0x23ca89,null));}; \ No newline at end of file +var _0xab58=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','reject','save','destroy','then','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','CmHopperAdditionalPhone','findAll','params','length','includeAll','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2b9d4d,_0x54b7c0){var _0x1b04ee=function(_0x408d1f){while(--_0x408d1f){_0x2b9d4d['push'](_0x2b9d4d['shift']());}};_0x1b04ee(++_0x54b7c0);}(_0xab58,0x133));var _0x8ab5=function(_0x318b00,_0xddcc1a){_0x318b00=_0x318b00-0x0;var _0x2deae5=_0xab58[_0x318b00];return _0x2deae5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ab5('0x0'));var zipdir=require(_0x8ab5('0x1'));var jsonpatch=require(_0x8ab5('0x2'));var rp=require('request-promise');var moment=require(_0x8ab5('0x3'));var BPromise=require(_0x8ab5('0x4'));var Mustache=require(_0x8ab5('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8ab5('0x6'));var csv=require(_0x8ab5('0x7'));var ejs=require(_0x8ab5('0x8'));var fs=require('fs');var fs_extra=require(_0x8ab5('0x9'));var _=require(_0x8ab5('0xa'));var squel=require(_0x8ab5('0xb'));var crypto=require(_0x8ab5('0xc'));var jsforce=require(_0x8ab5('0xd'));var deskjs=require(_0x8ab5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ab5('0xf'));var Redis=require(_0x8ab5('0x10'));var authService=require(_0x8ab5('0x11'));var qs=require(_0x8ab5('0x12'));var as=require(_0x8ab5('0x13'));var hardwareService=require(_0x8ab5('0x14'));var logger=require(_0x8ab5('0x15'))('api');var utils=require(_0x8ab5('0x16'));var config=require(_0x8ab5('0x17'));var licenseUtil=require(_0x8ab5('0x18'));var db=require(_0x8ab5('0x19'))['db'];function respondWithStatusCode(_0x43680b,_0x4c2e9c){_0x4c2e9c=_0x4c2e9c||0xcc;return function(_0x50679a){if(_0x50679a){return _0x43680b[_0x8ab5('0x1a')](_0x4c2e9c);}return _0x43680b['status'](_0x4c2e9c)['end']();};}function respondWithResult(_0x5ac153,_0x3a09a0){_0x3a09a0=_0x3a09a0||0xc8;return function(_0x7fc6f9){if(_0x7fc6f9){return _0x5ac153['status'](_0x3a09a0)[_0x8ab5('0x1b')](_0x7fc6f9);}};}function respondWithFilteredResult(_0x429afc,_0x260068){return function(_0x4770d5){if(_0x4770d5){var _0x4b01e3=typeof _0x260068[_0x8ab5('0x1c')]===_0x8ab5('0x1d')&&typeof _0x260068[_0x8ab5('0x1e')]===_0x8ab5('0x1d');var _0x1c934c=_0x4770d5['count'];var _0x3d3299=_0x4b01e3?0x0:_0x260068['offset'];var _0x471f1b=_0x4b01e3?_0x4770d5[_0x8ab5('0x1f')]:_0x260068[_0x8ab5('0x1c')]+_0x260068[_0x8ab5('0x1e')];var _0x347c72;if(_0x471f1b>=_0x1c934c){_0x471f1b=_0x1c934c;_0x347c72=0xc8;}else{_0x347c72=0xce;}_0x429afc[_0x8ab5('0x20')](_0x347c72);return _0x429afc['set']('Content-Range',_0x3d3299+'-'+_0x471f1b+'/'+_0x1c934c)[_0x8ab5('0x1b')](_0x4770d5);}return null;};}function patchUpdates(_0x3ad500){return function(_0x3e802b){try{jsonpatch['apply'](_0x3e802b,_0x3ad500,!![]);}catch(_0x3e9990){return BPromise[_0x8ab5('0x21')](_0x3e9990);}return _0x3e802b[_0x8ab5('0x22')]();};}function saveUpdates(_0x2671f3,_0x505fcb){return function(_0x554c14){if(_0x554c14){return _0x554c14['update'](_0x2671f3)['then'](function(_0x397c20){return _0x397c20;});}return null;};}function removeEntity(_0x4a547b,_0x307fe4){return function(_0x36f4b9){if(_0x36f4b9){return _0x36f4b9[_0x8ab5('0x23')]()[_0x8ab5('0x24')](function(){var _0x15fbfa=_0x36f4b9[_0x8ab5('0x25')]({'plain':!![]});var _0x16e911=_0x8ab5('0x26');return db[_0x8ab5('0x27')][_0x8ab5('0x23')]({'where':{'type':_0x16e911,'resourceId':_0x15fbfa['id']}})['then'](function(){return _0x36f4b9;});})[_0x8ab5('0x24')](function(){_0x4a547b[_0x8ab5('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1d11,_0x4c2b0a){return function(_0x2de530){if(!_0x2de530){_0x2d1d11[_0x8ab5('0x1a')](0x194);}return _0x2de530;};}function handleError(_0xb4e09,_0x457b69){_0x457b69=_0x457b69||0x1f4;return function(_0x10034d){logger[_0x8ab5('0x28')](_0x10034d[_0x8ab5('0x29')]);if(_0x10034d['name']){delete _0x10034d[_0x8ab5('0x2a')];}_0xb4e09[_0x8ab5('0x20')](_0x457b69)[_0x8ab5('0x2b')](_0x10034d);};}exports[_0x8ab5('0x2c')]=function(_0x174f16,_0x3c5cf8){var _0x491984={},_0xaaa20e={},_0x3f48e5={'count':0x0,'rows':[]};var _0x1c2b75=_[_0x8ab5('0x2d')](db['CmHopperAdditionalPhone'][_0x8ab5('0x2e')],function(_0x5316d7){return{'name':_0x5316d7[_0x8ab5('0x2f')],'type':_0x5316d7[_0x8ab5('0x30')][_0x8ab5('0x31')]};});_0xaaa20e['model']=_[_0x8ab5('0x2d')](_0x1c2b75,_0x8ab5('0x2a'));_0xaaa20e[_0x8ab5('0x32')]=_[_0x8ab5('0x33')](_0x174f16[_0x8ab5('0x32')]);_0xaaa20e[_0x8ab5('0x34')]=_[_0x8ab5('0x35')](_0xaaa20e[_0x8ab5('0x36')],_0xaaa20e[_0x8ab5('0x32')]);_0x491984['attributes']=_[_0x8ab5('0x35')](_0xaaa20e[_0x8ab5('0x36')],qs[_0x8ab5('0x37')](_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x37')]));_0x491984[_0x8ab5('0x38')]=_0x491984['attributes']['length']?_0x491984[_0x8ab5('0x38')]:_0xaaa20e['model'];if(!_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x39')](_0x8ab5('0x3a'))){_0x491984['limit']=qs[_0x8ab5('0x1e')](_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x1e')]);_0x491984[_0x8ab5('0x1c')]=qs['offset'](_0x174f16['query'][_0x8ab5('0x1c')]);}_0x491984[_0x8ab5('0x3b')]=qs[_0x8ab5('0x3c')](_0x174f16['query'][_0x8ab5('0x3c')]);_0x491984['where']=qs['filters'](_[_0x8ab5('0x3d')](_0x174f16['query'],_0xaaa20e['filters']),_0x1c2b75);if(_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x3e')]){_0x491984['where']=_[_0x8ab5('0x3f')](_0x491984['where'],{'$or':_[_0x8ab5('0x2d')](_0x1c2b75,function(_0x170c98){if(_0x170c98[_0x8ab5('0x30')]!=='VIRTUAL'){var _0x50d235={};_0x50d235[_0x170c98[_0x8ab5('0x2a')]]={'$like':'%'+_0x174f16[_0x8ab5('0x32')][_0x8ab5('0x3e')]+'%'};return _0x50d235;}})});}_0x491984=_[_0x8ab5('0x3f')]({},_0x491984,_0x174f16[_0x8ab5('0x40')]);var _0x2f5d19={'where':_0x491984[_0x8ab5('0x41')]};return db[_0x8ab5('0x42')][_0x8ab5('0x1f')](_0x2f5d19)['then'](function(_0x341162){_0x3f48e5[_0x8ab5('0x1f')]=_0x341162;if(_0x174f16[_0x8ab5('0x32')]['includeAll']){_0x491984['include']=[{'all':!![]}];}return db[_0x8ab5('0x42')][_0x8ab5('0x43')](_0x491984);})['then'](function(_0x2a0e82){_0x3f48e5['rows']=_0x2a0e82;return _0x3f48e5;})[_0x8ab5('0x24')](respondWithFilteredResult(_0x3c5cf8,_0x491984))['catch'](handleError(_0x3c5cf8,null));};exports['show']=function(_0x1cb282,_0x250de5){var _0x3650e7={'raw':!![],'where':{'id':_0x1cb282[_0x8ab5('0x44')]['id']}},_0x5a1fc3={};_0x5a1fc3[_0x8ab5('0x36')]=_[_0x8ab5('0x33')](db[_0x8ab5('0x42')][_0x8ab5('0x2e')]);_0x5a1fc3['query']=_[_0x8ab5('0x33')](_0x1cb282[_0x8ab5('0x32')]);_0x5a1fc3[_0x8ab5('0x34')]=_['intersection'](_0x5a1fc3[_0x8ab5('0x36')],_0x5a1fc3[_0x8ab5('0x32')]);_0x3650e7[_0x8ab5('0x38')]=_[_0x8ab5('0x35')](_0x5a1fc3[_0x8ab5('0x36')],qs[_0x8ab5('0x37')](_0x1cb282[_0x8ab5('0x32')]['fields']));_0x3650e7['attributes']=_0x3650e7[_0x8ab5('0x38')][_0x8ab5('0x45')]?_0x3650e7[_0x8ab5('0x38')]:_0x5a1fc3[_0x8ab5('0x36')];if(_0x1cb282[_0x8ab5('0x32')][_0x8ab5('0x46')]){_0x3650e7[_0x8ab5('0x47')]=[{'all':!![]}];}_0x3650e7=_[_0x8ab5('0x3f')]({},_0x3650e7,_0x1cb282['options']);return db[_0x8ab5('0x42')][_0x8ab5('0x48')](_0x3650e7)[_0x8ab5('0x24')](handleEntityNotFound(_0x250de5,null))['then'](respondWithResult(_0x250de5,null))[_0x8ab5('0x49')](handleError(_0x250de5,null));};exports['create']=function(_0x2b2347,_0x393705){return db[_0x8ab5('0x42')][_0x8ab5('0x4a')](_0x2b2347['body'],{})[_0x8ab5('0x24')](function(_0x253beb){var _0x5f07e0=_0x2b2347['user'][_0x8ab5('0x25')]({'plain':!![]});if(!_0x5f07e0)throw new Error(_0x8ab5('0x4b'));if(_0x5f07e0['role']===_0x8ab5('0x4c')){var _0x2e9bdf=_0x253beb[_0x8ab5('0x25')]({'plain':!![]});var _0x268878=_0x8ab5('0x26');return db['UserProfileSection'][_0x8ab5('0x48')]({'where':{'name':_0x268878,'userProfileId':_0x5f07e0['userProfileId']},'raw':!![]})[_0x8ab5('0x24')](function(_0x2226ae){if(_0x2226ae&&_0x2226ae['autoAssociation']===0x0){return db[_0x8ab5('0x27')][_0x8ab5('0x4a')]({'name':_0x2e9bdf[_0x8ab5('0x2a')],'resourceId':_0x2e9bdf['id'],'type':_0x2226ae[_0x8ab5('0x2a')],'sectionId':_0x2226ae['id']},{})[_0x8ab5('0x24')](function(){return _0x253beb;});}else{return _0x253beb;}})[_0x8ab5('0x49')](function(_0x2b3ac8){logger[_0x8ab5('0x28')](_0x8ab5('0x4d'),_0x2b3ac8);throw _0x2b3ac8;});}return _0x253beb;})[_0x8ab5('0x24')](respondWithResult(_0x393705,0xc9))[_0x8ab5('0x49')](handleError(_0x393705,null));};exports[_0x8ab5('0x4e')]=function(_0x56fabd,_0x5ad6f6){if(_0x56fabd[_0x8ab5('0x4f')]['id']){delete _0x56fabd['body']['id'];}return db[_0x8ab5('0x42')][_0x8ab5('0x48')]({'where':{'id':_0x56fabd['params']['id']}})[_0x8ab5('0x24')](handleEntityNotFound(_0x5ad6f6,null))[_0x8ab5('0x24')](saveUpdates(_0x56fabd['body'],null))[_0x8ab5('0x24')](respondWithResult(_0x5ad6f6,null))['catch'](handleError(_0x5ad6f6,null));};exports[_0x8ab5('0x23')]=function(_0x1d4ea0,_0x33d3ec){return db['CmHopperAdditionalPhone'][_0x8ab5('0x48')]({'where':{'id':_0x1d4ea0[_0x8ab5('0x44')]['id']}})[_0x8ab5('0x24')](handleEntityNotFound(_0x33d3ec,null))[_0x8ab5('0x24')](removeEntity(_0x33d3ec,null))[_0x8ab5('0x49')](handleError(_0x33d3ec,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 4762834..a3badf2 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 _0xaa2c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash'];(function(_0x49052b,_0x3ba709){var _0x48c045=function(_0x41ac38){while(--_0x41ac38){_0x49052b['push'](_0x49052b['shift']());}};_0x48c045(++_0x3ba709);}(_0xaa2c,0x1a3));var _0xcaa2=function(_0x1921b8,_0x205eec){_0x1921b8=_0x1921b8-0x0;var _0x367833=_0xaa2c[_0x1921b8];return _0x367833;};'use strict';var _=require(_0xcaa2('0x0'));var util=require(_0xcaa2('0x1'));var logger=require(_0xcaa2('0x2'))(_0xcaa2('0x3'));var moment=require(_0xcaa2('0x4'));var BPromise=require(_0xcaa2('0x5'));var rp=require(_0xcaa2('0x6'));var fs=require('fs');var path=require(_0xcaa2('0x7'));var rimraf=require('rimraf');var config=require(_0xcaa2('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module['exports']=function(_0x4128d7,_0x2258d6){return _0x4128d7[_0xcaa2('0x9')](_0xcaa2('0xa'),attributes,{'tableName':_0xcaa2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x159f=['request-promise','path','../../config/environment','./cmHopperAdditionalPhone.attributes','cm_hopper_additional_phones','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3f1f66,_0x18227a){var _0x323fd1=function(_0x173bde){while(--_0x173bde){_0x3f1f66['push'](_0x3f1f66['shift']());}};_0x323fd1(++_0x18227a);}(_0x159f,0x10d));var _0xf159=function(_0x250793,_0x1797b2){_0x250793=_0x250793-0x0;var _0x43228d=_0x159f[_0x250793];return _0x43228d;};'use strict';var _=require(_0xf159('0x0'));var util=require(_0xf159('0x1'));var logger=require(_0xf159('0x2'))(_0xf159('0x3'));var moment=require(_0xf159('0x4'));var BPromise=require(_0xf159('0x5'));var rp=require(_0xf159('0x6'));var fs=require('fs');var path=require(_0xf159('0x7'));var rimraf=require('rimraf');var config=require(_0xf159('0x8'));var attributes=require(_0xf159('0x9'));module['exports']=function(_0x36a09a,_0x18ec74){return _0x36a09a['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0xf159('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index c4e3718..1b162b9 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 _0xf6c7=['request\x20sent','debug','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','findOne','body','ContactId','VoiceQueueId','CampaignId','then','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','ASC','countmachineretry','entity','SwapAdditionalPhones','waitTime','CmHopperAdditionalPhone','isNil','scheduledat','add','minutes','updatedAt','phone','createdAt','sequelize','activateAdditionalPhone','CmHopper','field','IncrementPreviewCounters','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperAdditionalPhone,\x20%s,\x20%s'];(function(_0x3dc8d1,_0x3933a7){var _0x297bbe=function(_0x448994){while(--_0x448994){_0x3dc8d1['push'](_0x3dc8d1['shift']());}};_0x297bbe(++_0x3933a7);}(_0xf6c7,0x17b));var _0x7f6c=function(_0x4d389c,_0x376e7d){_0x4d389c=_0x4d389c-0x0;var _0xe62f3c=_0xf6c7[_0x4d389c];return _0xe62f3c;};'use strict';var _=require(_0x7f6c('0x0'));var util=require(_0x7f6c('0x1'));var moment=require('moment');var BPromise=require(_0x7f6c('0x2'));var rs=require(_0x7f6c('0x3'));var fs=require('fs');var Redis=require(_0x7f6c('0x4'));var db=require(_0x7f6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f6c('0x6'))('rpc');var config=require(_0x7f6c('0x7'));var jayson=require(_0x7f6c('0x8'));var client=jayson[_0x7f6c('0x9')][_0x7f6c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3305d8,_0x4fb947,_0x26f333){return new BPromise(function(_0x39db11,_0x76e979){return client[_0x7f6c('0xb')](_0x3305d8,_0x26f333)['then'](function(_0x5c85b2){logger['info'](_0x7f6c('0xc'),_0x4fb947,_0x7f6c('0xd'));logger[_0x7f6c('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x4fb947,_0x7f6c('0xd'),JSON[_0x7f6c('0xf')](_0x5c85b2));if(_0x5c85b2[_0x7f6c('0x10')]){if(_0x5c85b2[_0x7f6c('0x10')][_0x7f6c('0x11')]===0x1f4){logger['error'](_0x7f6c('0xc'),_0x4fb947,_0x5c85b2['error'][_0x7f6c('0x12')]);return _0x76e979(_0x5c85b2[_0x7f6c('0x10')]['message']);}logger[_0x7f6c('0x10')](_0x7f6c('0xc'),_0x4fb947,_0x5c85b2['error'][_0x7f6c('0x12')]);return _0x39db11(_0x5c85b2[_0x7f6c('0x10')][_0x7f6c('0x12')]);}else{logger[_0x7f6c('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4fb947,_0x7f6c('0xd'));_0x39db11(_0x5c85b2[_0x7f6c('0x14')]['message']);}})[_0x7f6c('0x15')](function(_0x4e1664){logger[_0x7f6c('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4fb947,_0x4e1664);_0x76e979(_0x4e1664);});});}exports[_0x7f6c('0x16')]=function(_0x497336){var _0x180ea6=this;return new Promise(function(_0x10ccab,_0x4dc1d7){return db['CmHopper'][_0x7f6c('0x17')]({'raw':!![],'where':{'ContactId':_0x497336[_0x7f6c('0x18')][_0x7f6c('0x19')],'ListId':_0x497336[_0x7f6c('0x18')]['ListId'],'VoiceQueueId':_0x497336[_0x7f6c('0x18')][_0x7f6c('0x1a')]===undefined?null:_0x497336[_0x7f6c('0x18')][_0x7f6c('0x1a')],'CampaignId':_0x497336[_0x7f6c('0x18')][_0x7f6c('0x1b')]===undefined?null:_0x497336['body'][_0x7f6c('0x1b')]}})[_0x7f6c('0x1c')](function(_0x5be451){if(_0x5be451!=null){return db['CmHopperAdditionalPhone'][_0x7f6c('0x17')]({'raw':!![],'where':{'CmHopperId':_0x5be451['id'],'OrderBy':{'$gt':_0x5be451['OrderBy']}},'order':[[_0x7f6c('0x1d'),'ASC']]})[_0x7f6c('0x1c')](function(_0x418167){var _0x1c7bd9=0x0;if(_0x418167){if(_0x418167[_0x7f6c('0x1e')]+_0x418167[_0x7f6c('0x1f')]+_0x418167[_0x7f6c('0x20')]+_0x418167[_0x7f6c('0x21')]+_0x418167[_0x7f6c('0x22')]+_0x418167[_0x7f6c('0x23')]+_0x418167['countmachineretry']+_0x418167[_0x7f6c('0x24')]<_0x497336['entity'][_0x7f6c('0x25')])_0x1c7bd9=0x1;_0x10ccab({'additional':_0x1c7bd9});}else{return db['CmHopperAdditionalPhone'][_0x7f6c('0x17')]({'raw':!![],'where':{'CmHopperId':_0x5be451['id']},'order':[[_0x7f6c('0x1d'),_0x7f6c('0x26')]]})[_0x7f6c('0x1c')](function(_0x54c605){var _0x1aafdf=0x0;if(_0x54c605){if(_0x54c605[_0x7f6c('0x1e')]+_0x54c605[_0x7f6c('0x1f')]+_0x54c605[_0x7f6c('0x20')]+_0x54c605['countnosuchnumberretry']+_0x54c605[_0x7f6c('0x22')]+_0x54c605[_0x7f6c('0x23')]+_0x54c605[_0x7f6c('0x27')]+_0x54c605[_0x7f6c('0x24')]<_0x497336[_0x7f6c('0x28')][_0x7f6c('0x25')])_0x1aafdf=0x1;_0x10ccab({'additional':_0x1aafdf});}else{_0x10ccab({'additional':0x0});}})[_0x7f6c('0x15')](function(_0x403587){logger[_0x7f6c('0x10')](_0x7f6c('0x16'),_0x403587[_0x7f6c('0x12')]);_0x4dc1d7(_0x180ea6[_0x7f6c('0x10')](0x1f4,_0x403587[_0x7f6c('0x12')]));});}})[_0x7f6c('0x15')](function(_0x34ff3c){logger[_0x7f6c('0x10')](_0x7f6c('0x16'),_0x34ff3c[_0x7f6c('0x12')]);_0x4dc1d7(_0x180ea6[_0x7f6c('0x10')](0x1f4,_0x34ff3c[_0x7f6c('0x12')]));});}else _0x10ccab({'additional':0x0});});});};exports[_0x7f6c('0x29')]=function(_0x2c1fb8){var _0x456a53=this;return new Promise(function(_0x14274b,_0x10966d){return db['CmHopper'][_0x7f6c('0x17')]({'raw':!![],'where':{'ContactId':_0x2c1fb8['body'][_0x7f6c('0x19')],'ListId':_0x2c1fb8[_0x7f6c('0x18')]['ListId'],'VoiceQueueId':_0x2c1fb8[_0x7f6c('0x18')]['VoiceQueueId']===undefined?null:_0x2c1fb8['body']['VoiceQueueId'],'CampaignId':_0x2c1fb8[_0x7f6c('0x18')][_0x7f6c('0x1b')]===undefined?null:_0x2c1fb8[_0x7f6c('0x18')][_0x7f6c('0x1b')]}})['then'](function(_0x3445eb){if(_0x3445eb!=null){return db['CmHopperAdditionalPhone'][_0x7f6c('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3445eb['id'],'OrderBy':{'$gte':_0x3445eb['OrderBy']}},'order':[[_0x7f6c('0x1d'),_0x7f6c('0x26')]]})[_0x7f6c('0x1c')](function(_0x35aa80){if(_0x35aa80)return activateAdditionalPhone(_0x3445eb,_0x2c1fb8[_0x7f6c('0x18')],_0x35aa80,_0x2c1fb8['duration'],_0x2c1fb8[_0x7f6c('0x2a')])['then'](function(_0x2bf878){_0x14274b(_0x2bf878);});else{return db[_0x7f6c('0x2b')][_0x7f6c('0x17')]({'raw':!![],'where':{'CmHopperId':_0x3445eb['id']},'order':[[_0x7f6c('0x1d'),_0x7f6c('0x26')]]})[_0x7f6c('0x1c')](function(_0x11fbae){if(_0x11fbae)return activateAdditionalPhone(_0x3445eb,_0x2c1fb8['body'],_0x11fbae,_0x2c1fb8['duration'],_0x2c1fb8[_0x7f6c('0x2a')])[_0x7f6c('0x1c')](function(_0x4495fa){_0x14274b(_0x4495fa);});else{_0x14274b({'id':_0x3445eb['id'],'phone':''});}})[_0x7f6c('0x15')](function(_0xe910d4){logger['error'](_0x7f6c('0x16'),_0xe910d4['message']);_0x10966d(_0x456a53[_0x7f6c('0x10')](0x1f4,_0xe910d4[_0x7f6c('0x12')]));});}})[_0x7f6c('0x15')](function(_0x43d299){logger['error'](_0x7f6c('0x16'),_0x43d299['message']);_0x10966d(_0x456a53[_0x7f6c('0x10')](0x1f4,_0x43d299[_0x7f6c('0x12')]));});}else _0x14274b(0x1);});});};function activateAdditionalPhone(_0x1de6a2,_0x4000fb,_0x3b347b,_0x2d0f5a,_0x5ec002){return new Promise(function(_0x56fbc5,_0x2c135f){var _0x10ad51;if(_[_0x7f6c('0x2c')](_0x3b347b[_0x7f6c('0x2d')])){_0x3b347b['scheduledat']=moment();}if(moment()>moment(_0x3b347b[_0x7f6c('0x2d')])){_0x10ad51=moment()[_0x7f6c('0x2e')](_0x5ec002||0x3,'minutes');}else{if(_0x3b347b[_0x7f6c('0x1d')]==0x0){_0x10ad51=moment(_0x3b347b[_0x7f6c('0x2d')]);}else{_0x10ad51=moment()[_0x7f6c('0x2e')](_0x5ec002||0x3,_0x7f6c('0x2f'));}}if(_['isNil'](_0x10ad51)){_0x10ad51=moment()[_0x7f6c('0x2e')](_0x5ec002||0x3,'minutes');}var _0x32f567={'phone':_0x1de6a2['phone'],'active':0x0,'OrderBy':_[_0x7f6c('0x2c')](_0x1de6a2['OrderBy'])?0x0:_0x1de6a2[_0x7f6c('0x1d')],'scheduledat':moment()['add'](_0x2d0f5a||0x1,_0x7f6c('0x2f')),'countbusyretry':_0x4000fb[_0x7f6c('0x1e')],'countcongestionretry':_0x4000fb[_0x7f6c('0x1f')],'countnoanswerretry':_0x4000fb[_0x7f6c('0x20')],'countnosuchnumberretry':_0x4000fb[_0x7f6c('0x21')],'countdropretry':_0x4000fb[_0x7f6c('0x22')],'countabandonedretry':_0x4000fb['countabandonedretry'],'countmachineretry':_0x4000fb[_0x7f6c('0x27')],'countagentrejectretry':_0x4000fb[_0x7f6c('0x24')],'createdAt':_0x4000fb['createdAt'],'updatedAt':_0x4000fb[_0x7f6c('0x30')]};var _0x8f8b5={'CmHopperId':_0x1de6a2['id'],'phone':_0x3b347b[_0x7f6c('0x31')],'active':0x0,'OrderBy':_[_0x7f6c('0x2c')](_0x3b347b['OrderBy'])?0x0:_0x3b347b['OrderBy'],'scheduledat':_0x10ad51,'countbusyretry':_0x3b347b[_0x7f6c('0x1e')],'countcongestionretry':_0x3b347b[_0x7f6c('0x1f')],'countnoanswerretry':_0x3b347b[_0x7f6c('0x20')],'countnosuchnumberretry':_0x3b347b[_0x7f6c('0x21')],'countdropretry':_0x3b347b['countdropretry'],'countabandonedretry':_0x3b347b[_0x7f6c('0x23')],'countmachineretry':_0x3b347b['countmachineretry'],'countagentrejectretry':_0x3b347b[_0x7f6c('0x24')],'createdAt':_0x3b347b[_0x7f6c('0x32')],'updatedAt':_0x3b347b[_0x7f6c('0x30')]};return db[_0x7f6c('0x33')]['transaction'](function(_0x598acd){return db['CmHopperAdditionalPhone']['update'](_0x32f567,{'where':{'id':_0x3b347b['id']}},{'transaction':_0x598acd})[_0x7f6c('0x1c')](function(){return db['CmHopper']['update'](_0x8f8b5,{'where':{'id':_0x1de6a2['id']}},{'transaction':_0x598acd});});})[_0x7f6c('0x1c')](function(_0x349626){_0x56fbc5({'id':_0x1de6a2['id'],'phone':_0x3b347b['phone']});})[_0x7f6c('0x15')](function(_0x5c2427){logger[_0x7f6c('0x10')](_0x7f6c('0x34'),_0x5c2427[_0x7f6c('0x12')]);_0x2c135f({'error':_0x5c2427[_0x7f6c('0x12')]});});});}exports['IncrementPreviewCounters']=function(_0x51dfad){var _0xbd5328=this;return new Promise(function(_0xfad4b9,_0x826445){return db[_0x7f6c('0x35')]['update'](_0x51dfad['body'][_0x7f6c('0x36')],{'where':{'id':_0x51dfad[_0x7f6c('0x18')]['id']}})[_0x7f6c('0x1c')](function(_0x3d0d9f){_0xfad4b9(_0x3d0d9f);})[_0x7f6c('0x15')](function(_0x547958){logger[_0x7f6c('0x10')](_0x7f6c('0x37'),_0x547958[_0x7f6c('0x12')]);_0x826445(_0xbd5328[_0x7f6c('0x10')](0x1f4,_0x547958[_0x7f6c('0x12')]));});});}; \ No newline at end of file +var _0x56b5=['request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countnosuchnumberretry','countdropretry','entity','findOne','countcongestionretry','countnoanswerretry','countmachineretry','catch','waitTime','duration','isNil','scheduledat','add','minutes','phone','countbusyretry','countabandonedretry','countagentrejectretry','createdAt','updatedAt','transaction','update','activateAdditionalPhone','field','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xc8b6ff,_0xe4f956){var _0x1b09e4=function(_0x2c3ef7){while(--_0x2c3ef7){_0xc8b6ff['push'](_0xc8b6ff['shift']());}};_0x1b09e4(++_0xe4f956);}(_0x56b5,0x65));var _0x556b=function(_0x2080da,_0x4930df){_0x2080da=_0x2080da-0x0;var _0x2cd2bd=_0x56b5[_0x2080da];return _0x2cd2bd;};'use strict';var _=require(_0x556b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x556b('0x1'));var fs=require('fs');var Redis=require(_0x556b('0x2'));var db=require(_0x556b('0x3'))['db'];var utils=require(_0x556b('0x4'));var logger=require(_0x556b('0x5'))(_0x556b('0x6'));var config=require(_0x556b('0x7'));var jayson=require(_0x556b('0x8'));var client=jayson[_0x556b('0x9')][_0x556b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b80c1,_0x523d2b,_0x44e87c){return new BPromise(function(_0x17e77e,_0x9265d5){return client[_0x556b('0xb')](_0x3b80c1,_0x44e87c)['then'](function(_0x5ba566){logger[_0x556b('0xc')](_0x556b('0xd'),_0x523d2b,'request\x20sent');logger[_0x556b('0xe')](_0x556b('0xf'),_0x523d2b,_0x556b('0x10'),JSON['stringify'](_0x5ba566));if(_0x5ba566[_0x556b('0x11')]){if(_0x5ba566[_0x556b('0x11')][_0x556b('0x12')]===0x1f4){logger[_0x556b('0x11')](_0x556b('0xd'),_0x523d2b,_0x5ba566[_0x556b('0x11')][_0x556b('0x13')]);return _0x9265d5(_0x5ba566[_0x556b('0x11')][_0x556b('0x13')]);}logger[_0x556b('0x11')](_0x556b('0xd'),_0x523d2b,_0x5ba566[_0x556b('0x11')][_0x556b('0x13')]);return _0x17e77e(_0x5ba566['error'][_0x556b('0x13')]);}else{logger[_0x556b('0xc')](_0x556b('0xd'),_0x523d2b,_0x556b('0x10'));_0x17e77e(_0x5ba566[_0x556b('0x14')][_0x556b('0x13')]);}})['catch'](function(_0x5e68b5){logger[_0x556b('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x523d2b,_0x5e68b5);_0x9265d5(_0x5e68b5);});});}exports[_0x556b('0x15')]=function(_0xa5557){var _0x1ef509=this;return new Promise(function(_0x2ad756,_0x5603fa){return db[_0x556b('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0xa5557[_0x556b('0x17')][_0x556b('0x18')],'ListId':_0xa5557[_0x556b('0x17')][_0x556b('0x19')],'VoiceQueueId':_0xa5557[_0x556b('0x17')]['VoiceQueueId']===undefined?null:_0xa5557['body'][_0x556b('0x1a')],'CampaignId':_0xa5557[_0x556b('0x17')][_0x556b('0x1b')]===undefined?null:_0xa5557[_0x556b('0x17')]['CampaignId']}})[_0x556b('0x1c')](function(_0xb9c454){if(_0xb9c454!=null){return db[_0x556b('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xb9c454['id'],'OrderBy':{'$gt':_0xb9c454[_0x556b('0x1e')]}},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0x29644e){var _0x53843a=0x0;if(_0x29644e){if(_0x29644e['countbusyretry']+_0x29644e['countcongestionretry']+_0x29644e['countnoanswerretry']+_0x29644e[_0x556b('0x20')]+_0x29644e[_0x556b('0x21')]+_0x29644e['countabandonedretry']+_0x29644e['countmachineretry']+_0x29644e['countagentrejectretry']<_0xa5557[_0x556b('0x22')]['dialGlobalMaxRetry'])_0x53843a=0x1;_0x2ad756({'additional':_0x53843a});}else{return db['CmHopperAdditionalPhone'][_0x556b('0x23')]({'raw':!![],'where':{'CmHopperId':_0xb9c454['id']},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0x1b9138){var _0x2ddbfc=0x0;if(_0x1b9138){if(_0x1b9138['countbusyretry']+_0x1b9138[_0x556b('0x24')]+_0x1b9138[_0x556b('0x25')]+_0x1b9138[_0x556b('0x20')]+_0x1b9138['countdropretry']+_0x1b9138['countabandonedretry']+_0x1b9138[_0x556b('0x26')]+_0x1b9138['countagentrejectretry']<_0xa5557[_0x556b('0x22')]['dialGlobalMaxRetry'])_0x2ddbfc=0x1;_0x2ad756({'additional':_0x2ddbfc});}else{_0x2ad756({'additional':0x0});}})[_0x556b('0x27')](function(_0x5f42db){logger[_0x556b('0x11')](_0x556b('0x15'),_0x5f42db[_0x556b('0x13')]);_0x5603fa(_0x1ef509[_0x556b('0x11')](0x1f4,_0x5f42db['message']));});}})[_0x556b('0x27')](function(_0x54317b){logger['error'](_0x556b('0x15'),_0x54317b[_0x556b('0x13')]);_0x5603fa(_0x1ef509[_0x556b('0x11')](0x1f4,_0x54317b['message']));});}else _0x2ad756({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x5baa13){var _0x37ea46=this;return new Promise(function(_0x340e23,_0x3d34f3){return db[_0x556b('0x16')][_0x556b('0x23')]({'raw':!![],'where':{'ContactId':_0x5baa13['body'][_0x556b('0x18')],'ListId':_0x5baa13[_0x556b('0x17')][_0x556b('0x19')],'VoiceQueueId':_0x5baa13[_0x556b('0x17')][_0x556b('0x1a')]===undefined?null:_0x5baa13['body'][_0x556b('0x1a')],'CampaignId':_0x5baa13[_0x556b('0x17')][_0x556b('0x1b')]===undefined?null:_0x5baa13[_0x556b('0x17')]['CampaignId']}})['then'](function(_0x4e7124){if(_0x4e7124!=null){return db['CmHopperAdditionalPhone'][_0x556b('0x23')]({'raw':!![],'where':{'CmHopperId':_0x4e7124['id'],'OrderBy':{'$gte':_0x4e7124[_0x556b('0x1e')]}},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0xcd13ba){if(_0xcd13ba)return activateAdditionalPhone(_0x4e7124,_0x5baa13[_0x556b('0x17')],_0xcd13ba,_0x5baa13['duration'],_0x5baa13[_0x556b('0x28')])[_0x556b('0x1c')](function(_0x237d84){_0x340e23(_0x237d84);});else{return db['CmHopperAdditionalPhone'][_0x556b('0x23')]({'raw':!![],'where':{'CmHopperId':_0x4e7124['id']},'order':[[_0x556b('0x1e'),_0x556b('0x1f')]]})[_0x556b('0x1c')](function(_0x422b3d){if(_0x422b3d)return activateAdditionalPhone(_0x4e7124,_0x5baa13[_0x556b('0x17')],_0x422b3d,_0x5baa13[_0x556b('0x29')],_0x5baa13['waitTime'])[_0x556b('0x1c')](function(_0x1a1900){_0x340e23(_0x1a1900);});else{_0x340e23({'id':_0x4e7124['id'],'phone':''});}})[_0x556b('0x27')](function(_0x3a50d1){logger[_0x556b('0x11')]('VerifyAdditionalPhones',_0x3a50d1['message']);_0x3d34f3(_0x37ea46[_0x556b('0x11')](0x1f4,_0x3a50d1[_0x556b('0x13')]));});}})[_0x556b('0x27')](function(_0x1d630b){logger['error']('VerifyAdditionalPhones',_0x1d630b[_0x556b('0x13')]);_0x3d34f3(_0x37ea46[_0x556b('0x11')](0x1f4,_0x1d630b[_0x556b('0x13')]));});}else _0x340e23(0x1);});});};function activateAdditionalPhone(_0x4a4af8,_0x5c6ae5,_0x572237,_0x385cb2,_0x245b22){return new Promise(function(_0x3f073c,_0x56fa1d){var _0x13c86d;if(_[_0x556b('0x2a')](_0x572237[_0x556b('0x2b')])){_0x572237[_0x556b('0x2b')]=moment();}if(moment()>moment(_0x572237['scheduledat'])){_0x13c86d=moment()[_0x556b('0x2c')](_0x245b22||0x3,'minutes');}else{if(_0x572237[_0x556b('0x1e')]==0x0){_0x13c86d=moment(_0x572237[_0x556b('0x2b')]);}else{_0x13c86d=moment()[_0x556b('0x2c')](_0x245b22||0x3,_0x556b('0x2d'));}}if(_[_0x556b('0x2a')](_0x13c86d)){_0x13c86d=moment()[_0x556b('0x2c')](_0x245b22||0x3,_0x556b('0x2d'));}var _0x392d08={'phone':_0x4a4af8[_0x556b('0x2e')],'active':0x0,'OrderBy':_[_0x556b('0x2a')](_0x4a4af8['OrderBy'])?0x0:_0x4a4af8[_0x556b('0x1e')],'scheduledat':moment()[_0x556b('0x2c')](_0x385cb2||0x1,_0x556b('0x2d')),'countbusyretry':_0x5c6ae5[_0x556b('0x2f')],'countcongestionretry':_0x5c6ae5[_0x556b('0x24')],'countnoanswerretry':_0x5c6ae5[_0x556b('0x25')],'countnosuchnumberretry':_0x5c6ae5['countnosuchnumberretry'],'countdropretry':_0x5c6ae5['countdropretry'],'countabandonedretry':_0x5c6ae5[_0x556b('0x30')],'countmachineretry':_0x5c6ae5[_0x556b('0x26')],'countagentrejectretry':_0x5c6ae5[_0x556b('0x31')],'createdAt':_0x5c6ae5[_0x556b('0x32')],'updatedAt':_0x5c6ae5[_0x556b('0x33')]};var _0x587457={'CmHopperId':_0x4a4af8['id'],'phone':_0x572237[_0x556b('0x2e')],'active':0x0,'OrderBy':_[_0x556b('0x2a')](_0x572237[_0x556b('0x1e')])?0x0:_0x572237[_0x556b('0x1e')],'scheduledat':_0x13c86d,'countbusyretry':_0x572237[_0x556b('0x2f')],'countcongestionretry':_0x572237[_0x556b('0x24')],'countnoanswerretry':_0x572237[_0x556b('0x25')],'countnosuchnumberretry':_0x572237['countnosuchnumberretry'],'countdropretry':_0x572237[_0x556b('0x21')],'countabandonedretry':_0x572237[_0x556b('0x30')],'countmachineretry':_0x572237[_0x556b('0x26')],'countagentrejectretry':_0x572237[_0x556b('0x31')],'createdAt':_0x572237[_0x556b('0x32')],'updatedAt':_0x572237[_0x556b('0x33')]};return db['sequelize'][_0x556b('0x34')](function(_0x5c8e1e){return db['CmHopperAdditionalPhone'][_0x556b('0x35')](_0x392d08,{'where':{'id':_0x572237['id']}},{'transaction':_0x5c8e1e})[_0x556b('0x1c')](function(){return db[_0x556b('0x16')][_0x556b('0x35')](_0x587457,{'where':{'id':_0x4a4af8['id']}},{'transaction':_0x5c8e1e});});})[_0x556b('0x1c')](function(_0x2c97c5){_0x3f073c({'id':_0x4a4af8['id'],'phone':_0x572237[_0x556b('0x2e')]});})[_0x556b('0x27')](function(_0x5d8105){logger[_0x556b('0x11')](_0x556b('0x36'),_0x5d8105[_0x556b('0x13')]);_0x56fa1d({'error':_0x5d8105[_0x556b('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x13e139){var _0x45c64d=this;return new Promise(function(_0x192965,_0x552b1c){return db[_0x556b('0x16')][_0x556b('0x35')](_0x13e139[_0x556b('0x17')][_0x556b('0x37')],{'where':{'id':_0x13e139[_0x556b('0x17')]['id']}})['then'](function(_0x17e920){_0x192965(_0x17e920);})[_0x556b('0x27')](function(_0x56a7bc){logger['error']('IncrementPreviewCounters',_0x56a7bc[_0x556b('0x13')]);_0x552b1c(_0x45c64d['error'](0x1f4,_0x56a7bc[_0x556b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 2a47f93..d3eb4e4 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 _0x97f5=['/:id','show','post','create','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index'];(function(_0x5c66b0,_0x95d04a){var _0x50b53a=function(_0x1aa27b){while(--_0x1aa27b){_0x5c66b0['push'](_0x5c66b0['shift']());}};_0x50b53a(++_0x95d04a);}(_0x97f5,0x72));var _0x597f=function(_0x3dddac,_0x3c4ad1){_0x3dddac=_0x3dddac-0x0;var _0x164497=_0x97f5[_0x3dddac];return _0x164497;};'use strict';var multer=require(_0x597f('0x0'));var util=require(_0x597f('0x1'));var path=require(_0x597f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x597f('0x3')]();var fs_extra=require(_0x597f('0x4'));var auth=require(_0x597f('0x5'));var interaction=require(_0x597f('0x6'));var config=require(_0x597f('0x7'));var controller=require(_0x597f('0x8'));router[_0x597f('0x9')]('/',auth[_0x597f('0xa')](),controller[_0x597f('0xb')]);router['get'](_0x597f('0xc'),auth[_0x597f('0xa')](),controller[_0x597f('0xd')]);router[_0x597f('0xe')]('/',auth[_0x597f('0xa')](),controller[_0x597f('0xf')]);router['put'](_0x597f('0xc'),auth[_0x597f('0xa')](),controller[_0x597f('0x10')]);router['delete']('/:id',auth[_0x597f('0xa')](),controller['destroy']);module[_0x597f('0x11')]=router; \ No newline at end of file +var _0x9fa9=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','index','get','/:id','isAuthenticated','post','create','put','update','destroy','exports','util','path'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x9fa9,0xb2));var _0x99fa=function(_0x591cc6,_0x1e5305){_0x591cc6=_0x591cc6-0x0;var _0x41bd60=_0x9fa9[_0x591cc6];return _0x41bd60;};'use strict';var multer=require('multer');var util=require(_0x99fa('0x0'));var path=require(_0x99fa('0x1'));var timeout=require('connect-timeout');var express=require(_0x99fa('0x2'));var router=express['Router']();var fs_extra=require(_0x99fa('0x3'));var auth=require(_0x99fa('0x4'));var interaction=require(_0x99fa('0x5'));var config=require(_0x99fa('0x6'));var controller=require(_0x99fa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x99fa('0x8')]);router[_0x99fa('0x9')](_0x99fa('0xa'),auth[_0x99fa('0xb')](),controller['show']);router[_0x99fa('0xc')]('/',auth[_0x99fa('0xb')](),controller[_0x99fa('0xd')]);router[_0x99fa('0xe')](_0x99fa('0xa'),auth[_0x99fa('0xb')](),controller[_0x99fa('0xf')]);router['delete'](_0x99fa('0xa'),auth['isAuthenticated'](),controller[_0x99fa('0x10')]);module[_0x99fa('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 5283a41..e5b58c0 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 _0x4d61=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x54d2bd,_0x57c539){var _0x34f0d4=function(_0x2e8bba){while(--_0x2e8bba){_0x54d2bd['push'](_0x54d2bd['shift']());}};_0x34f0d4(++_0x57c539);}(_0x4d61,0x147));var _0x14d6=function(_0x1fb7d1,_0x108781){_0x1fb7d1=_0x1fb7d1-0x0;var _0x2480d8=_0x4d61[_0x1fb7d1];return _0x2480d8;};'use strict';var moment=require(_0x14d6('0x0'));var Sequelize=require(_0x14d6('0x1'));module[_0x14d6('0x2')]={'phone':{'type':Sequelize[_0x14d6('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x14d6('0x4')],'unique':_0x14d6('0x5')},'ListId':{'type':Sequelize[_0x14d6('0x4')],'unique':_0x14d6('0x5')},'VoiceQueueId':{'type':Sequelize[_0x14d6('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x8251=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x2b03cb,_0x21dcad){var _0x32bb4a=function(_0x46e4f7){while(--_0x46e4f7){_0x2b03cb['push'](_0x2b03cb['shift']());}};_0x32bb4a(++_0x21dcad);}(_0x8251,0x1cf));var _0x1825=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8251[_0x199572];return _0x13cfa3;};'use strict';var moment=require(_0x1825('0x0'));var Sequelize=require(_0x1825('0x1'));module[_0x1825('0x2')]={'phone':{'type':Sequelize[_0x1825('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1825('0x4')],'unique':_0x1825('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1825('0x5')},'VoiceQueueId':{'type':Sequelize[_0x1825('0x4')],'unique':_0x1825('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 6daecb0..b7d075a 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 _0xca6b=['rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','fields','find','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','CmHopperBlack'];(function(_0x4a1b99,_0x17ccfa){var _0x9a1761=function(_0x21a954){while(--_0x21a954){_0x4a1b99['push'](_0x4a1b99['shift']());}};_0x9a1761(++_0x17ccfa);}(_0xca6b,0x66));var _0xbca6=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xca6b[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0xbca6('0x0'));var rimraf=require(_0xbca6('0x1'));var zipdir=require(_0xbca6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbca6('0x3'));var moment=require(_0xbca6('0x4'));var BPromise=require(_0xbca6('0x5'));var Mustache=require(_0xbca6('0x6'));var util=require('util');var path=require(_0xbca6('0x7'));var sox=require(_0xbca6('0x8'));var csv=require(_0xbca6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbca6('0xa'));var _=require(_0xbca6('0xb'));var squel=require('squel');var crypto=require(_0xbca6('0xc'));var jsforce=require(_0xbca6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbca6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbca6('0xe'));var qs=require(_0xbca6('0xf'));var as=require(_0xbca6('0x10'));var hardwareService=require(_0xbca6('0x11'));var logger=require('../../config/logger')(_0xbca6('0x12'));var utils=require('../../config/utils');var config=require(_0xbca6('0x13'));var licenseUtil=require(_0xbca6('0x14'));var db=require(_0xbca6('0x15'))['db'];function respondWithStatusCode(_0x2ed079,_0x3eb721){_0x3eb721=_0x3eb721||0xcc;return function(_0x3c902a){if(_0x3c902a){return _0x2ed079['sendStatus'](_0x3eb721);}return _0x2ed079[_0xbca6('0x16')](_0x3eb721)[_0xbca6('0x17')]();};}function respondWithResult(_0x136e78,_0x4e39c4){_0x4e39c4=_0x4e39c4||0xc8;return function(_0x64d476){if(_0x64d476){return _0x136e78[_0xbca6('0x16')](_0x4e39c4)[_0xbca6('0x18')](_0x64d476);}};}function respondWithFilteredResult(_0x1280cd,_0x39097a){return function(_0x1b57bf){if(_0x1b57bf){var _0x3dcd19=typeof _0x39097a[_0xbca6('0x19')]===_0xbca6('0x1a')&&typeof _0x39097a['limit']===_0xbca6('0x1a');var _0x24702a=_0x1b57bf[_0xbca6('0x1b')];var _0x2f8195=_0x3dcd19?0x0:_0x39097a['offset'];var _0x49f389=_0x3dcd19?_0x1b57bf['count']:_0x39097a[_0xbca6('0x19')]+_0x39097a[_0xbca6('0x1c')];var _0x212dc4;if(_0x49f389>=_0x24702a){_0x49f389=_0x24702a;_0x212dc4=0xc8;}else{_0x212dc4=0xce;}_0x1280cd[_0xbca6('0x16')](_0x212dc4);return _0x1280cd[_0xbca6('0x1d')]('Content-Range',_0x2f8195+'-'+_0x49f389+'/'+_0x24702a)['json'](_0x1b57bf);}return null;};}function patchUpdates(_0x4484bd){return function(_0x189afb){try{jsonpatch[_0xbca6('0x1e')](_0x189afb,_0x4484bd,!![]);}catch(_0x500c7d){return BPromise[_0xbca6('0x1f')](_0x500c7d);}return _0x189afb['save']();};}function saveUpdates(_0x3ac760,_0x475a69){return function(_0x584afa){if(_0x584afa){return _0x584afa[_0xbca6('0x20')](_0x3ac760)[_0xbca6('0x21')](function(_0x102e94){return _0x102e94;});}return null;};}function removeEntity(_0x161340,_0xf2d54f){return function(_0x26484c){if(_0x26484c){return _0x26484c[_0xbca6('0x22')]()[_0xbca6('0x21')](function(){_0x161340[_0xbca6('0x16')](0xcc)[_0xbca6('0x17')]();});}};}function handleEntityNotFound(_0x3e300d,_0x1e8304){return function(_0x17ab1c){if(!_0x17ab1c){_0x3e300d[_0xbca6('0x23')](0x194);}return _0x17ab1c;};}function handleError(_0xe17339,_0x33bb79){_0x33bb79=_0x33bb79||0x1f4;return function(_0x317977){logger[_0xbca6('0x24')](_0x317977['stack']);if(_0x317977[_0xbca6('0x25')]){delete _0x317977[_0xbca6('0x25')];}_0xe17339[_0xbca6('0x16')](_0x33bb79)[_0xbca6('0x26')](_0x317977);};}exports[_0xbca6('0x27')]=function(_0x20bcc0,_0x1c4cf0){var _0x2600e1={},_0x5f024d={},_0x1c12d0={'count':0x0,'rows':[]};var _0x10d646=_[_0xbca6('0x28')](db[_0xbca6('0x29')][_0xbca6('0x2a')],function(_0x266449){return{'name':_0x266449[_0xbca6('0x2b')],'type':_0x266449[_0xbca6('0x2c')][_0xbca6('0x2d')]};});_0x5f024d[_0xbca6('0x2e')]=_[_0xbca6('0x28')](_0x10d646,_0xbca6('0x25'));_0x5f024d['query']=_[_0xbca6('0x2f')](_0x20bcc0[_0xbca6('0x30')]);_0x5f024d['filters']=_[_0xbca6('0x31')](_0x5f024d['model'],_0x5f024d['query']);_0x2600e1['attributes']=_['intersection'](_0x5f024d[_0xbca6('0x2e')],qs['fields'](_0x20bcc0[_0xbca6('0x30')]['fields']));_0x2600e1[_0xbca6('0x32')]=_0x2600e1[_0xbca6('0x32')][_0xbca6('0x33')]?_0x2600e1[_0xbca6('0x32')]:_0x5f024d[_0xbca6('0x2e')];if(!_0x20bcc0[_0xbca6('0x30')][_0xbca6('0x34')]('nolimit')){_0x2600e1[_0xbca6('0x1c')]=qs[_0xbca6('0x1c')](_0x20bcc0['query']['limit']);_0x2600e1[_0xbca6('0x19')]=qs['offset'](_0x20bcc0[_0xbca6('0x30')][_0xbca6('0x19')]);}_0x2600e1[_0xbca6('0x35')]=qs[_0xbca6('0x36')](_0x20bcc0[_0xbca6('0x30')][_0xbca6('0x36')]);_0x2600e1['where']=qs[_0xbca6('0x37')](_[_0xbca6('0x38')](_0x20bcc0[_0xbca6('0x30')],_0x5f024d[_0xbca6('0x37')]),_0x10d646);if(_0x20bcc0[_0xbca6('0x30')]['filter']){_0x2600e1[_0xbca6('0x39')]=_['merge'](_0x2600e1[_0xbca6('0x39')],{'$or':_[_0xbca6('0x28')](_0x10d646,function(_0x3f49c2){if(_0x3f49c2['type']!==_0xbca6('0x3a')){var _0x3b0e2c={};_0x3b0e2c[_0x3f49c2[_0xbca6('0x25')]]={'$like':'%'+_0x20bcc0[_0xbca6('0x30')][_0xbca6('0x3b')]+'%'};return _0x3b0e2c;}})});}_0x2600e1=_[_0xbca6('0x3c')]({},_0x2600e1,_0x20bcc0[_0xbca6('0x3d')]);var _0x2d0527={'where':_0x2600e1['where']};return db[_0xbca6('0x29')]['count'](_0x2d0527)['then'](function(_0x118521){_0x1c12d0[_0xbca6('0x1b')]=_0x118521;if(_0x20bcc0[_0xbca6('0x30')][_0xbca6('0x3e')]){_0x2600e1[_0xbca6('0x3f')]=[{'all':!![]}];}return db[_0xbca6('0x29')][_0xbca6('0x40')](_0x2600e1);})[_0xbca6('0x21')](function(_0x345f6f){_0x1c12d0[_0xbca6('0x41')]=_0x345f6f;return _0x1c12d0;})[_0xbca6('0x21')](respondWithFilteredResult(_0x1c4cf0,_0x2600e1))['catch'](handleError(_0x1c4cf0,null));};exports['show']=function(_0x979db9,_0x273eab){var _0x3c28d5={'raw':!![],'where':{'id':_0x979db9[_0xbca6('0x42')]['id']}},_0x5db28a={};_0x5db28a['model']=_[_0xbca6('0x2f')](db['CmHopperBlack'][_0xbca6('0x2a')]);_0x5db28a['query']=_[_0xbca6('0x2f')](_0x979db9[_0xbca6('0x30')]);_0x5db28a[_0xbca6('0x37')]=_[_0xbca6('0x31')](_0x5db28a['model'],_0x5db28a[_0xbca6('0x30')]);_0x3c28d5[_0xbca6('0x32')]=_['intersection'](_0x5db28a[_0xbca6('0x2e')],qs[_0xbca6('0x43')](_0x979db9[_0xbca6('0x30')]['fields']));_0x3c28d5[_0xbca6('0x32')]=_0x3c28d5[_0xbca6('0x32')][_0xbca6('0x33')]?_0x3c28d5[_0xbca6('0x32')]:_0x5db28a[_0xbca6('0x2e')];if(_0x979db9[_0xbca6('0x30')]['includeAll']){_0x3c28d5[_0xbca6('0x3f')]=[{'all':!![]}];}_0x3c28d5=_[_0xbca6('0x3c')]({},_0x3c28d5,_0x979db9['options']);return db['CmHopperBlack'][_0xbca6('0x44')](_0x3c28d5)['then'](handleEntityNotFound(_0x273eab,null))[_0xbca6('0x21')](respondWithResult(_0x273eab,null))['catch'](handleError(_0x273eab,null));};exports[_0xbca6('0x20')]=function(_0x558c13,_0x5222cf){if(_0x558c13[_0xbca6('0x45')]['id']){delete _0x558c13['body']['id'];}return db[_0xbca6('0x29')][_0xbca6('0x44')]({'where':{'id':_0x558c13[_0xbca6('0x42')]['id']}})['then'](handleEntityNotFound(_0x5222cf,null))['then'](saveUpdates(_0x558c13[_0xbca6('0x45')],null))['then'](respondWithResult(_0x5222cf,null))['catch'](handleError(_0x5222cf,null));};exports[_0xbca6('0x22')]=function(_0x4d4129,_0x565c4c){return db['CmHopperBlack']['find']({'where':{'id':_0x4d4129[_0xbca6('0x42')]['id']}})[_0xbca6('0x21')](handleEntityNotFound(_0x565c4c,null))[_0xbca6('0x21')](removeEntity(_0x565c4c,null))[_0xbca6('0x46')](handleError(_0x565c4c,null));};exports[_0xbca6('0x47')]=function(_0x27fa9b,_0x5ea320){return db[_0xbca6('0x29')][_0xbca6('0x47')]()['then'](respondWithResult(_0x5ea320,null))[_0xbca6('0x46')](handleError(_0x5ea320,null));}; \ No newline at end of file +var _0x1015=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','json','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperBlack','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','includeAll','include','findAll','rows','catch','keys','options','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x226138,_0x5d1862){var _0x4b669e=function(_0x4c6877){while(--_0x4c6877){_0x226138['push'](_0x226138['shift']());}};_0x4b669e(++_0x5d1862);}(_0x1015,0x85));var _0x5101=function(_0x4a0e3b,_0x56c1d7){_0x4a0e3b=_0x4a0e3b-0x0;var _0x3a6ac2=_0x1015[_0x4a0e3b];return _0x3a6ac2;};'use strict';var emlformat=require(_0x5101('0x0'));var rimraf=require(_0x5101('0x1'));var zipdir=require(_0x5101('0x2'));var jsonpatch=require(_0x5101('0x3'));var rp=require(_0x5101('0x4'));var moment=require(_0x5101('0x5'));var BPromise=require(_0x5101('0x6'));var Mustache=require(_0x5101('0x7'));var util=require(_0x5101('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x5101('0x9'));var ejs=require(_0x5101('0xa'));var fs=require('fs');var fs_extra=require(_0x5101('0xb'));var _=require(_0x5101('0xc'));var squel=require(_0x5101('0xd'));var crypto=require(_0x5101('0xe'));var jsforce=require(_0x5101('0xf'));var deskjs=require(_0x5101('0x10'));var toCsv=require(_0x5101('0x9'));var querystring=require(_0x5101('0x11'));var Papa=require(_0x5101('0x12'));var Redis=require(_0x5101('0x13'));var authService=require(_0x5101('0x14'));var qs=require(_0x5101('0x15'));var as=require(_0x5101('0x16'));var hardwareService=require(_0x5101('0x17'));var logger=require('../../config/logger')(_0x5101('0x18'));var utils=require(_0x5101('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5101('0x1a'))['db'];function respondWithStatusCode(_0x17f530,_0x40b0ab){_0x40b0ab=_0x40b0ab||0xcc;return function(_0x1ad1b1){if(_0x1ad1b1){return _0x17f530[_0x5101('0x1b')](_0x40b0ab);}return _0x17f530[_0x5101('0x1c')](_0x40b0ab)[_0x5101('0x1d')]();};}function respondWithResult(_0x14d26e,_0x3d1e35){_0x3d1e35=_0x3d1e35||0xc8;return function(_0xf514ea){if(_0xf514ea){return _0x14d26e['status'](_0x3d1e35)['json'](_0xf514ea);}};}function respondWithFilteredResult(_0x23681b,_0x599925){return function(_0x262b76){if(_0x262b76){var _0x28cc4f=typeof _0x599925[_0x5101('0x1e')]==='undefined'&&typeof _0x599925[_0x5101('0x1f')]==='undefined';var _0x42ce56=_0x262b76[_0x5101('0x20')];var _0x589b0e=_0x28cc4f?0x0:_0x599925[_0x5101('0x1e')];var _0x12ec12=_0x28cc4f?_0x262b76[_0x5101('0x20')]:_0x599925[_0x5101('0x1e')]+_0x599925[_0x5101('0x1f')];var _0x581432;if(_0x12ec12>=_0x42ce56){_0x12ec12=_0x42ce56;_0x581432=0xc8;}else{_0x581432=0xce;}_0x23681b[_0x5101('0x1c')](_0x581432);return _0x23681b['set']('Content-Range',_0x589b0e+'-'+_0x12ec12+'/'+_0x42ce56)[_0x5101('0x21')](_0x262b76);}return null;};}function patchUpdates(_0x557528){return function(_0x14d12f){try{jsonpatch['apply'](_0x14d12f,_0x557528,!![]);}catch(_0x5be082){return BPromise[_0x5101('0x22')](_0x5be082);}return _0x14d12f[_0x5101('0x23')]();};}function saveUpdates(_0x11579f,_0x15547e){return function(_0x10bd17){if(_0x10bd17){return _0x10bd17[_0x5101('0x24')](_0x11579f)[_0x5101('0x25')](function(_0x9bae2b){return _0x9bae2b;});}return null;};}function removeEntity(_0x3fa8af,_0x1e6ddc){return function(_0xa61c3e){if(_0xa61c3e){return _0xa61c3e[_0x5101('0x26')]()[_0x5101('0x25')](function(){_0x3fa8af['status'](0xcc)[_0x5101('0x1d')]();});}};}function handleEntityNotFound(_0x5131c0,_0xf27f5){return function(_0xbce4dc){if(!_0xbce4dc){_0x5131c0[_0x5101('0x1b')](0x194);}return _0xbce4dc;};}function handleError(_0x13b956,_0x14a5df){_0x14a5df=_0x14a5df||0x1f4;return function(_0x598b89){logger[_0x5101('0x27')](_0x598b89[_0x5101('0x28')]);if(_0x598b89[_0x5101('0x29')]){delete _0x598b89[_0x5101('0x29')];}_0x13b956['status'](_0x14a5df)[_0x5101('0x2a')](_0x598b89);};}exports['index']=function(_0x504769,_0x5649f6){var _0x504591={},_0x3a64fa={},_0x1543ad={'count':0x0,'rows':[]};var _0x43ec47=_[_0x5101('0x2b')](db[_0x5101('0x2c')][_0x5101('0x2d')],function(_0x26595c){return{'name':_0x26595c['fieldName'],'type':_0x26595c[_0x5101('0x2e')][_0x5101('0x2f')]};});_0x3a64fa[_0x5101('0x30')]=_[_0x5101('0x2b')](_0x43ec47,_0x5101('0x29'));_0x3a64fa[_0x5101('0x31')]=_['keys'](_0x504769[_0x5101('0x31')]);_0x3a64fa[_0x5101('0x32')]=_[_0x5101('0x33')](_0x3a64fa['model'],_0x3a64fa['query']);_0x504591[_0x5101('0x34')]=_[_0x5101('0x33')](_0x3a64fa[_0x5101('0x30')],qs[_0x5101('0x35')](_0x504769['query'][_0x5101('0x35')]));_0x504591[_0x5101('0x34')]=_0x504591[_0x5101('0x34')][_0x5101('0x36')]?_0x504591[_0x5101('0x34')]:_0x3a64fa['model'];if(!_0x504769['query'][_0x5101('0x37')](_0x5101('0x38'))){_0x504591[_0x5101('0x1f')]=qs['limit'](_0x504769[_0x5101('0x31')][_0x5101('0x1f')]);_0x504591['offset']=qs['offset'](_0x504769[_0x5101('0x31')]['offset']);}_0x504591[_0x5101('0x39')]=qs[_0x5101('0x3a')](_0x504769[_0x5101('0x31')][_0x5101('0x3a')]);_0x504591['where']=qs[_0x5101('0x32')](_['pick'](_0x504769[_0x5101('0x31')],_0x3a64fa[_0x5101('0x32')]),_0x43ec47);if(_0x504769['query'][_0x5101('0x3b')]){_0x504591['where']=_[_0x5101('0x3c')](_0x504591[_0x5101('0x3d')],{'$or':_[_0x5101('0x2b')](_0x43ec47,function(_0x210d4d){if(_0x210d4d[_0x5101('0x2e')]!=='VIRTUAL'){var _0x38acf4={};_0x38acf4[_0x210d4d[_0x5101('0x29')]]={'$like':'%'+_0x504769[_0x5101('0x31')][_0x5101('0x3b')]+'%'};return _0x38acf4;}})});}_0x504591=_[_0x5101('0x3c')]({},_0x504591,_0x504769['options']);var _0x4ca72c={'where':_0x504591['where']};return db[_0x5101('0x2c')][_0x5101('0x20')](_0x4ca72c)['then'](function(_0x3dd75b){_0x1543ad['count']=_0x3dd75b;if(_0x504769[_0x5101('0x31')][_0x5101('0x3e')]){_0x504591[_0x5101('0x3f')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5101('0x40')](_0x504591);})[_0x5101('0x25')](function(_0x1addeb){_0x1543ad[_0x5101('0x41')]=_0x1addeb;return _0x1543ad;})[_0x5101('0x25')](respondWithFilteredResult(_0x5649f6,_0x504591))[_0x5101('0x42')](handleError(_0x5649f6,null));};exports['show']=function(_0x4e5fa3,_0x53a3ad){var _0x4c61d5={'raw':!![],'where':{'id':_0x4e5fa3['params']['id']}},_0x43a105={};_0x43a105['model']=_['keys'](db[_0x5101('0x2c')][_0x5101('0x2d')]);_0x43a105[_0x5101('0x31')]=_[_0x5101('0x43')](_0x4e5fa3['query']);_0x43a105['filters']=_[_0x5101('0x33')](_0x43a105['model'],_0x43a105[_0x5101('0x31')]);_0x4c61d5[_0x5101('0x34')]=_['intersection'](_0x43a105[_0x5101('0x30')],qs[_0x5101('0x35')](_0x4e5fa3[_0x5101('0x31')][_0x5101('0x35')]));_0x4c61d5[_0x5101('0x34')]=_0x4c61d5[_0x5101('0x34')][_0x5101('0x36')]?_0x4c61d5['attributes']:_0x43a105[_0x5101('0x30')];if(_0x4e5fa3['query'][_0x5101('0x3e')]){_0x4c61d5[_0x5101('0x3f')]=[{'all':!![]}];}_0x4c61d5=_[_0x5101('0x3c')]({},_0x4c61d5,_0x4e5fa3[_0x5101('0x44')]);return db[_0x5101('0x2c')][_0x5101('0x45')](_0x4c61d5)[_0x5101('0x25')](handleEntityNotFound(_0x53a3ad,null))[_0x5101('0x25')](respondWithResult(_0x53a3ad,null))[_0x5101('0x42')](handleError(_0x53a3ad,null));};exports[_0x5101('0x24')]=function(_0x3a5067,_0x515de4){if(_0x3a5067[_0x5101('0x46')]['id']){delete _0x3a5067['body']['id'];}return db[_0x5101('0x2c')][_0x5101('0x45')]({'where':{'id':_0x3a5067[_0x5101('0x47')]['id']}})[_0x5101('0x25')](handleEntityNotFound(_0x515de4,null))[_0x5101('0x25')](saveUpdates(_0x3a5067[_0x5101('0x46')],null))[_0x5101('0x25')](respondWithResult(_0x515de4,null))[_0x5101('0x42')](handleError(_0x515de4,null));};exports[_0x5101('0x26')]=function(_0x4a477c,_0x419de9){return db[_0x5101('0x2c')]['find']({'where':{'id':_0x4a477c['params']['id']}})[_0x5101('0x25')](handleEntityNotFound(_0x419de9,null))[_0x5101('0x25')](removeEntity(_0x419de9,null))[_0x5101('0x42')](handleError(_0x419de9,null));};exports[_0x5101('0x48')]=function(_0x31e8a4,_0x2e684d){return db[_0x5101('0x2c')][_0x5101('0x48')]()['then'](respondWithResult(_0x2e684d,null))['catch'](handleError(_0x2e684d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ec2639a..4ce30dc 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 _0x8b7f=['CmHopperBlack','cm_hopper_black','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x8b7f,0x1ca));var _0xf8b7=function(_0x46b69a,_0x54db48){_0x46b69a=_0x46b69a-0x0;var _0x27bd7a=_0x8b7f[_0x46b69a];return _0x27bd7a;};'use strict';var _=require('lodash');var util=require(_0xf8b7('0x0'));var logger=require('../../config/logger')(_0xf8b7('0x1'));var moment=require(_0xf8b7('0x2'));var BPromise=require(_0xf8b7('0x3'));var rp=require(_0xf8b7('0x4'));var fs=require('fs');var path=require(_0xf8b7('0x5'));var rimraf=require(_0xf8b7('0x6'));var config=require(_0xf8b7('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xf8b7('0x8')]=function(_0x5d0e33,_0xd3aa14){return _0x5d0e33[_0xf8b7('0x9')](_0xf8b7('0xa'),attributes,{'tableName':_0xf8b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a12=['CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0a12,0x1ba));var _0x20a1=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x0a12[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x20a1('0x0'));var util=require('util');var logger=require(_0x20a1('0x1'))(_0x20a1('0x2'));var moment=require('moment');var BPromise=require(_0x20a1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20a1('0x4'));var config=require(_0x20a1('0x5'));var attributes=require(_0x20a1('0x6'));module[_0x20a1('0x7')]=function(_0x55f18b,_0x198733){return _0x55f18b[_0x20a1('0x8')](_0x20a1('0x9'),attributes,{'tableName':_0x20a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 613b9d9..c17ee99 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 _0x6240=['lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','CmHopperBlack,\x20%s,\x20%s','message','info','catch','GetCmHopperBlack','findAll','options','include','attributes','map','model','CmHopperBlack','body','where','limit','UpdateCmHopperBlack','stringify','DestroyCmHopperBlack','destroy'];(function(_0x5bc39f,_0x327549){var _0x3a04c5=function(_0x702ef5){while(--_0x702ef5){_0x5bc39f['push'](_0x5bc39f['shift']());}};_0x3a04c5(++_0x327549);}(_0x6240,0x15e));var _0x0624=function(_0x50ad6a,_0x36c2ba){_0x50ad6a=_0x50ad6a-0x0;var _0x4ae816=_0x6240[_0x50ad6a];return _0x4ae816;};'use strict';var _=require(_0x0624('0x0'));var util=require('util');var moment=require(_0x0624('0x1'));var BPromise=require('bluebird');var rs=require(_0x0624('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0624('0x3'))['db'];var utils=require(_0x0624('0x4'));var logger=require(_0x0624('0x5'))(_0x0624('0x6'));var config=require(_0x0624('0x7'));var jayson=require(_0x0624('0x8'));var client=jayson[_0x0624('0x9')][_0x0624('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c2de5,_0x262e93,_0x1af085){return new BPromise(function(_0x3d0b35,_0x55547d){return client['request'](_0x5c2de5,_0x1af085)[_0x0624('0xb')](function(_0x24ca17){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x262e93,_0x0624('0xc'));logger[_0x0624('0xd')](_0x0624('0xe'),_0x262e93,'request\x20sent',JSON['stringify'](_0x24ca17));if(_0x24ca17[_0x0624('0xf')]){if(_0x24ca17[_0x0624('0xf')]['code']===0x1f4){logger[_0x0624('0xf')](_0x0624('0x10'),_0x262e93,_0x24ca17[_0x0624('0xf')][_0x0624('0x11')]);return _0x55547d(_0x24ca17['error'][_0x0624('0x11')]);}logger['error'](_0x0624('0x10'),_0x262e93,_0x24ca17[_0x0624('0xf')]['message']);return _0x3d0b35(_0x24ca17[_0x0624('0xf')][_0x0624('0x11')]);}else{logger[_0x0624('0x12')](_0x0624('0x10'),_0x262e93,_0x0624('0xc'));_0x3d0b35(_0x24ca17['result'][_0x0624('0x11')]);}})[_0x0624('0x13')](function(_0x156133){logger[_0x0624('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x262e93,_0x156133);_0x55547d(_0x156133);});});}exports[_0x0624('0x14')]=function(_0x33d24d){var _0x1a2f95=this;return new Promise(function(_0xc7666a,_0x54c674){return db['CmHopperBlack'][_0x0624('0x15')]({'raw':_0x33d24d[_0x0624('0x16')]?_0x33d24d[_0x0624('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x33d24d[_0x0624('0x16')]?_0x33d24d[_0x0624('0x16')]['where']||null:null,'attributes':_0x33d24d[_0x0624('0x16')]?_0x33d24d[_0x0624('0x16')]['attributes']||null:null,'limit':_0x33d24d[_0x0624('0x16')]?_0x33d24d['options']['limit']||null:null,'include':_0x33d24d['options']?_0x33d24d[_0x0624('0x16')][_0x0624('0x17')]?_['map'](_0x33d24d[_0x0624('0x16')][_0x0624('0x17')],function(_0x342c88){return{'model':db[_0x342c88['model']],'as':_0x342c88['as'],'attributes':_0x342c88[_0x0624('0x18')],'include':_0x342c88[_0x0624('0x17')]?_[_0x0624('0x19')](_0x342c88['include'],function(_0x35134b){return{'model':db[_0x35134b[_0x0624('0x1a')]],'as':_0x35134b['as'],'attributes':_0x35134b[_0x0624('0x18')],'include':_0x35134b['include']?_[_0x0624('0x19')](_0x35134b['include'],function(_0x4f5e57){return{'model':db[_0x4f5e57[_0x0624('0x1a')]],'as':_0x4f5e57['as'],'attributes':_0x4f5e57[_0x0624('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0624('0xb')](function(_0x3d1bc3){logger['info'](_0x0624('0x14'),_0x33d24d);logger[_0x0624('0xd')]('GetCmHopperBlack',_0x33d24d,JSON['stringify'](_0x3d1bc3));_0xc7666a(_0x3d1bc3);})[_0x0624('0x13')](function(_0x4b28de){logger[_0x0624('0xf')](_0x0624('0x14'),_0x4b28de[_0x0624('0x11')],_0x33d24d);_0x54c674(_0x1a2f95[_0x0624('0xf')](0x1f4,_0x4b28de[_0x0624('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x5c2937){var _0x574e2f=this;return new Promise(function(_0x22578c,_0x52b0ec){return db[_0x0624('0x1b')]['update'](_0x5c2937[_0x0624('0x1c')],{'raw':_0x5c2937['options']?_0x5c2937[_0x0624('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c2937[_0x0624('0x16')]?_0x5c2937[_0x0624('0x16')][_0x0624('0x1d')]||null:null,'attributes':_0x5c2937[_0x0624('0x16')]?_0x5c2937[_0x0624('0x16')][_0x0624('0x18')]||null:null,'limit':_0x5c2937[_0x0624('0x16')]?_0x5c2937['options'][_0x0624('0x1e')]||null:null})[_0x0624('0xb')](function(_0x57525b){logger[_0x0624('0x12')](_0x0624('0x1f'),_0x5c2937);logger[_0x0624('0xd')](_0x0624('0x1f'),_0x5c2937,JSON[_0x0624('0x20')](_0x57525b));_0x22578c(_0x57525b);})['catch'](function(_0xdec99a){logger['error'](_0x0624('0x1f'),_0xdec99a[_0x0624('0x11')],_0x5c2937);_0x52b0ec(_0x574e2f[_0x0624('0xf')](0x1f4,_0xdec99a[_0x0624('0x11')]));});});};exports[_0x0624('0x21')]=function(_0x48c722){var _0x8d1261=this;return new Promise(function(_0x57be0b,_0x277512){return db['CmHopperBlack'][_0x0624('0x22')]({'where':_0x48c722[_0x0624('0x16')]?_0x48c722[_0x0624('0x16')][_0x0624('0x1d')]||null:null})['then'](function(_0x8426a0){logger['info'](_0x0624('0x21'),_0x48c722);logger['debug'](_0x0624('0x21'),_0x48c722,JSON['stringify'](_0x8426a0));_0x57be0b(_0x8426a0);})['catch'](function(_0x388f76){logger[_0x0624('0xf')](_0x0624('0x21'),_0x388f76['message'],_0x48c722);_0x277512(_0x8d1261['error'](0x1f4,_0x388f76[_0x0624('0x11')]));});});}; \ No newline at end of file +var _0x3ffa=['request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','limit','include','model','attributes','map','update','UpdateCmHopperBlack','destroy','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0x3ffa,0x10b));var _0xa3ff=function(_0x2b351f,_0x469470){_0x2b351f=_0x2b351f-0x0;var _0x5e060a=_0x3ffa[_0x2b351f];return _0x5e060a;};'use strict';var _=require(_0xa3ff('0x0'));var util=require(_0xa3ff('0x1'));var moment=require(_0xa3ff('0x2'));var BPromise=require(_0xa3ff('0x3'));var rs=require(_0xa3ff('0x4'));var fs=require('fs');var Redis=require(_0xa3ff('0x5'));var db=require(_0xa3ff('0x6'))['db'];var utils=require(_0xa3ff('0x7'));var logger=require(_0xa3ff('0x8'))(_0xa3ff('0x9'));var config=require(_0xa3ff('0xa'));var jayson=require(_0xa3ff('0xb'));var client=jayson[_0xa3ff('0xc')][_0xa3ff('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x719596,_0x310dde,_0x51cc54){return new BPromise(function(_0x4c4a7a,_0x3200a9){return client[_0xa3ff('0xe')](_0x719596,_0x51cc54)[_0xa3ff('0xf')](function(_0x45e24b){logger[_0xa3ff('0x10')](_0xa3ff('0x11'),_0x310dde,'request\x20sent');logger[_0xa3ff('0x12')](_0xa3ff('0x13'),_0x310dde,_0xa3ff('0x14'),JSON[_0xa3ff('0x15')](_0x45e24b));if(_0x45e24b[_0xa3ff('0x16')]){if(_0x45e24b['error'][_0xa3ff('0x17')]===0x1f4){logger[_0xa3ff('0x16')](_0xa3ff('0x11'),_0x310dde,_0x45e24b[_0xa3ff('0x16')]['message']);return _0x3200a9(_0x45e24b[_0xa3ff('0x16')][_0xa3ff('0x18')]);}logger[_0xa3ff('0x16')](_0xa3ff('0x11'),_0x310dde,_0x45e24b['error'][_0xa3ff('0x18')]);return _0x4c4a7a(_0x45e24b['error']['message']);}else{logger[_0xa3ff('0x10')](_0xa3ff('0x11'),_0x310dde,_0xa3ff('0x14'));_0x4c4a7a(_0x45e24b[_0xa3ff('0x19')][_0xa3ff('0x18')]);}})[_0xa3ff('0x1a')](function(_0xb55733){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x310dde,_0xb55733);_0x3200a9(_0xb55733);});});}exports[_0xa3ff('0x1b')]=function(_0x6df4d5){var _0x3fac37=this;return new Promise(function(_0x780677,_0x249975){return db[_0xa3ff('0x1c')]['findAll']({'raw':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x1e')]===undefined?!![]:![]:!![],'where':_0x6df4d5['options']?_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x1f')]||null:null,'attributes':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5['options']['attributes']||null:null,'limit':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x20')]||null:null,'include':_0x6df4d5[_0xa3ff('0x1d')]?_0x6df4d5['options'][_0xa3ff('0x21')]?_['map'](_0x6df4d5[_0xa3ff('0x1d')][_0xa3ff('0x21')],function(_0x4f83a4){return{'model':db[_0x4f83a4[_0xa3ff('0x22')]],'as':_0x4f83a4['as'],'attributes':_0x4f83a4[_0xa3ff('0x23')],'include':_0x4f83a4[_0xa3ff('0x21')]?_[_0xa3ff('0x24')](_0x4f83a4[_0xa3ff('0x21')],function(_0x2aa3b3){return{'model':db[_0x2aa3b3[_0xa3ff('0x22')]],'as':_0x2aa3b3['as'],'attributes':_0x2aa3b3[_0xa3ff('0x23')],'include':_0x2aa3b3[_0xa3ff('0x21')]?_[_0xa3ff('0x24')](_0x2aa3b3['include'],function(_0x4d4875){return{'model':db[_0x4d4875[_0xa3ff('0x22')]],'as':_0x4d4875['as'],'attributes':_0x4d4875[_0xa3ff('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa3ff('0xf')](function(_0x363f53){logger[_0xa3ff('0x10')]('GetCmHopperBlack',_0x6df4d5);logger[_0xa3ff('0x12')](_0xa3ff('0x1b'),_0x6df4d5,JSON[_0xa3ff('0x15')](_0x363f53));_0x780677(_0x363f53);})[_0xa3ff('0x1a')](function(_0x536ae3){logger['error'](_0xa3ff('0x1b'),_0x536ae3[_0xa3ff('0x18')],_0x6df4d5);_0x249975(_0x3fac37[_0xa3ff('0x16')](0x1f4,_0x536ae3[_0xa3ff('0x18')]));});});};exports['UpdateCmHopperBlack']=function(_0x1ad897){var _0x5e480b=this;return new Promise(function(_0x23f79d,_0xc24d25){return db['CmHopperBlack'][_0xa3ff('0x25')](_0x1ad897['body'],{'raw':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')]['where']||null:null,'attributes':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')]['attributes']||null:null,'limit':_0x1ad897[_0xa3ff('0x1d')]?_0x1ad897[_0xa3ff('0x1d')][_0xa3ff('0x20')]||null:null})[_0xa3ff('0xf')](function(_0x1352c1){logger[_0xa3ff('0x10')](_0xa3ff('0x26'),_0x1ad897);logger[_0xa3ff('0x12')]('UpdateCmHopperBlack',_0x1ad897,JSON[_0xa3ff('0x15')](_0x1352c1));_0x23f79d(_0x1352c1);})['catch'](function(_0x157ad5){logger['error'](_0xa3ff('0x26'),_0x157ad5[_0xa3ff('0x18')],_0x1ad897);_0xc24d25(_0x5e480b[_0xa3ff('0x16')](0x1f4,_0x157ad5[_0xa3ff('0x18')]));});});};exports['DestroyCmHopperBlack']=function(_0x988ad8){var _0x5edc93=this;return new Promise(function(_0x452ad8,_0x4547e3){return db[_0xa3ff('0x1c')][_0xa3ff('0x27')]({'where':_0x988ad8[_0xa3ff('0x1d')]?_0x988ad8[_0xa3ff('0x1d')]['where']||null:null})[_0xa3ff('0xf')](function(_0x4dc431){logger[_0xa3ff('0x10')](_0xa3ff('0x28'),_0x988ad8);logger[_0xa3ff('0x12')](_0xa3ff('0x28'),_0x988ad8,JSON['stringify'](_0x4dc431));_0x452ad8(_0x4dc431);})[_0xa3ff('0x1a')](function(_0xf99fa0){logger[_0xa3ff('0x16')]('DestroyCmHopperBlack',_0xf99fa0[_0xa3ff('0x18')],_0x988ad8);_0x4547e3(_0x5edc93[_0xa3ff('0x16')](0x1f4,_0xf99fa0['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 463fd7b..969e764 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 _0x1623=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0xc19b03,_0xb08695){var _0xb45327=function(_0x187980){while(--_0x187980){_0xc19b03['push'](_0xc19b03['shift']());}};_0xb45327(++_0xb08695);}(_0x1623,0xab));var _0x3162=function(_0xb69143,_0x48c99e){_0xb69143=_0xb69143-0x0;var _0x551232=_0x1623[_0xb69143];return _0x551232;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3162('0xf')]);router[_0x3162('0x10')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x11')]);module[_0x3162('0x12')]=router; \ No newline at end of file +var _0xc1c6=['../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x57aa39,_0x5b7dd9){var _0x1d9f2e=function(_0xda8d8a){while(--_0xda8d8a){_0x57aa39['push'](_0x57aa39['shift']());}};_0x1d9f2e(++_0x5b7dd9);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x224d50,_0x5eb929){_0x224d50=_0x224d50-0x0;var _0x559b7e=_0xc1c6[_0x224d50];return _0x559b7e;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x6c1c('0x4'));var auth=require(_0x6c1c('0x5'));var interaction=require(_0x6c1c('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x6c1c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c1c('0x8')]);router['get'](_0x6c1c('0x9'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xb')]);router[_0x6c1c('0x7')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xc')]);router['put'](_0x6c1c('0xd'),auth[_0x6c1c('0xa')](),controller[_0x6c1c('0xe')]);router[_0x6c1c('0xf')]('/:id',auth[_0x6c1c('0xa')](),controller[_0x6c1c('0x10')]);module[_0x6c1c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index e3624f3..21b6d7c 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 _0xa432=['getDataValue','diff','BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa432,0xdc));var _0x2a43=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa432[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x2a43('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x2a43('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2a43('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2a43('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x2a43('0x2')]},'originatecalleridname':{'type':Sequelize[_0x2a43('0x2')]},'calleridnum':{'type':Sequelize[_0x2a43('0x2')]},'calleridname':{'type':Sequelize[_0x2a43('0x2')]},'starttime':{'type':Sequelize[_0x2a43('0x3')]},'responsetime':{'type':Sequelize[_0x2a43('0x3')]},'answertime':{'type':Sequelize[_0x2a43('0x3')]},'droptime':{'type':Sequelize[_0x2a43('0x3')]},'endtime':{'type':Sequelize[_0x2a43('0x3')]},'ringtime':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2a43('0x2')]},'campaign':{'type':Sequelize[_0x2a43('0x2')]},'campaigntype':{'type':Sequelize[_0x2a43('0x2')]},'membername':{'type':Sequelize[_0x2a43('0x2')]},'reason':{'type':Sequelize[_0x2a43('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2a43('0x2')]},'thirdDisposition':{'type':Sequelize[_0x2a43('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x35c95f){var _0x1ed2ea=this[_0x2a43('0x4')]('endtime');if(_0x1ed2ea&&_0x35c95f){this['setDataValue']('followuptime',moment(_0x35c95f)[_0x2a43('0x5')](moment(_0x1ed2ea),'seconds'));}}},'amd':{'type':Sequelize[_0x2a43('0x6')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2a43('0x6')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x2a43('0x6')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x2a43('0x6')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x2a43('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2a43('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x2a43('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2a43('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc4ca=['endtime','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue'];(function(_0x4eca38,_0x4b5c37){var _0x5f0dbb=function(_0x66d8ff){while(--_0x66d8ff){_0x4eca38['push'](_0x4eca38['shift']());}};_0x5f0dbb(++_0x4b5c37);}(_0xc4ca,0x191));var _0xac4c=function(_0x4fb240,_0x476ddc){_0x4fb240=_0x4fb240-0x0;var _0x29177e=_0xc4ca[_0x4fb240];return _0x29177e;};'use strict';var Sequelize=require(_0xac4c('0x0'));var moment=require(_0xac4c('0x1'));module['exports']={'state':{'type':Sequelize[_0xac4c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xac4c('0x3')]},'scheduledat':{'type':Sequelize[_0xac4c('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xac4c('0x3')]},'originatecalleridname':{'type':Sequelize[_0xac4c('0x3')]},'calleridnum':{'type':Sequelize[_0xac4c('0x3')]},'calleridname':{'type':Sequelize[_0xac4c('0x3')]},'starttime':{'type':Sequelize[_0xac4c('0x4')]},'responsetime':{'type':Sequelize[_0xac4c('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xac4c('0x4')]},'endtime':{'type':Sequelize[_0xac4c('0x4')]},'ringtime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xac4c('0x3')]},'campaigntype':{'type':Sequelize[_0xac4c('0x3')]},'membername':{'type':Sequelize[_0xac4c('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xac4c('0x3')]},'secondDisposition':{'type':Sequelize[_0xac4c('0x3')]},'thirdDisposition':{'type':Sequelize[_0xac4c('0x3')]},'dispositionat':{'type':Sequelize[_0xac4c('0x4')],'set':function(_0x43478a){var _0x58e215=this[_0xac4c('0x5')](_0xac4c('0x6'));if(_0x58e215&&_0x43478a){this['setDataValue'](_0xac4c('0x7'),moment(_0x43478a)[_0xac4c('0x8')](moment(_0x58e215),_0xac4c('0x9')));}}},'amd':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xac4c('0x4')]},'callback':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xac4c('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xac4c('0x4')]},'recallme':{'type':Sequelize[_0xac4c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xac4c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index a82aead..1df8851 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 _0x814b=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x814b,0x1a2));var _0xb814=function(_0x460666,_0x24bfa0){_0x460666=_0x460666-0x0;var _0x555cbf=_0x814b[_0x460666];return _0x555cbf;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['CmHopperFinal'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['describe']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')]()[_0xb814('0x28')](respondWithResult(_0x55234d,null))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x4096d4,_0x2cc806){if(_0x4096d4[_0xb814('0x49')][_0xb814('0x4a')]){delete _0x4096d4[_0xb814('0x49')]['uniqueid'];}return db['CmHopperFinal'][_0xb814('0x47')]({'where':{'uniqueid':_0x4096d4[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x28')](saveUpdates(_0x4096d4[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x2cc806,null))[_0xb814('0x45')](handleError(_0x2cc806,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26fd0b,_0x388324,_0xf27a6e){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x26fd0b['params']['id']},'attributes':[[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),_0xb814('0x4d')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x4f')))),'noAnswerContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),'busyContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x51')))),'congestionContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x53')))),_0xb814('0x54')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x55')))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb814('0x57')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x388324,null))[_0xb814('0x28')](respondWithResult(_0x388324,null))[_0xb814('0x45')](handleError(_0x388324,null));};exports[_0xb814('0x5a')]=function(_0x2e5f99,_0x113350,_0x46014f){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'CampaignId':_0x2e5f99[_0xb814('0x46')]['id']},'attributes':[[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),'noSuchContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xb814('0x5b')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),_0xb814('0x5c')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x51')))),_0xb814('0x5d')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x53')))),'dropContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x5e')))),_0xb814('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x113350,null))['then'](respondWithResult(_0x113350,null))[_0xb814('0x45')](handleError(_0x113350,null));};exports[_0xb814('0x5f')]=function(_0xee204,_0x5aabbe,_0x30f717){return db[_0xb814('0x60')][_0xb814('0x47')]({'where':{'id':_0xee204[_0xb814('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aabbe,null))['then'](function(_0x28eaf8){var _0x295488;if(_0x28eaf8){_0x295488=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))[_0xb814('0x64')]([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),_0xb814('0x69'),_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('ANY_VALUE(calleridnum)',_0xb814('0x65'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x66'))[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))[_0xb814('0x6d')](_0xb814('0x70'),_0xb814('0x69'))[_0xb814('0x6d')]('NOW()','createdAt')[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6b'))[_0xb814('0x71')]('cm_hopper_final')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())['where']('state\x20=\x20?',_0xee204[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('phone')[_0xb814('0x71')]('cm_hopper')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]()))['where'](_0xb814('0x74'),squel['select']()[_0xb814('0x6d')](_0xb814('0x75'))['from']('cm_hopper_final')[_0xb814('0x3b')](_0xb814('0x76'),_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x77')))[_0xb814('0x78')](_0xb814('0x67')))[_0xb814('0x72')]();return db[_0xb814('0x4b')]['query'](_0x295488);}return[];})['then'](respondWithResult(_0x5aabbe,null))['catch'](handleError(_0x5aabbe,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x52b6da,_0x45a202,_0x75a33){return db[_0xb814('0x79')]['find']({'where':{'id':_0x52b6da[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45a202,null))[_0xb814('0x28')](function(_0x26ce5b){var _0x161658;if(_0x26ce5b){_0x161658=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))['fromQuery']([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),'CampaignId',_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x7a'),'phone')['field'](_0xb814('0x6e'),'scheduledAt')[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))['field'](_0xb814('0x7b'),_0xb814('0x7c'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6a'))[_0xb814('0x6d')](_0xb814('0x6e'),'updatedAt')['from'](_0xb814('0x7d'))['where']('CampaignId\x20=\x20?',_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x20?',_0x52b6da[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x65'))['from'](_0xb814('0x63'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da['params']['id'][_0xb814('0x72')]()))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x75'))[_0xb814('0x71')](_0xb814('0x7d'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x204'))['group'](_0xb814('0x67')))['toString']();return db[_0xb814('0x4b')][_0xb814('0x33')](_0x161658);}return[];})[_0xb814('0x28')](respondWithResult(_0x45a202,null))[_0xb814('0x45')](handleError(_0x45a202,null));};exports[_0xb814('0x7f')]=function(_0x2f1674,_0xf0610f,_0x5db5d0){return db['CmHopper'][_0xb814('0x80')]({'where':{'VoiceQueueId':_0x2f1674['body'][_0xb814('0x69')],'CampaignId':_0x2f1674[_0xb814('0x49')][_0xb814('0x7c')],'ContactId':_0x2f1674['body'][_0xb814('0x67')]}})[_0xb814('0x28')](handleEntityNotFound(_0xf0610f,null))[_0xb814('0x28')](function(_0x38c6da){if(_0x38c6da){return _0x38c6da;}return null;})[_0xb814('0x28')](respondWithResult(_0xf0610f,null))['catch'](handleError(_0xf0610f,null));}; \ No newline at end of file +var _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x326f,0xd1));var _0xf326=function(_0x222cbf,_0x24d885){_0x222cbf=_0x222cbf-0x0;var _0x2c5d2b=_0x326f[_0x222cbf];return _0x2c5d2b;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 8e02404..87b2f51 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 _0x7b33=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','calleridnum','uniqueid','lodash','util'];(function(_0x5dc277,_0x28347e){var _0x3fbf3f=function(_0x47027f){while(--_0x47027f){_0x5dc277['push'](_0x5dc277['shift']());}};_0x3fbf3f(++_0x28347e);}(_0x7b33,0x8e));var _0x37b3=function(_0x751b24,_0x44ab4c){_0x751b24=_0x751b24-0x0;var _0x208d2b=_0x7b33[_0x751b24];return _0x208d2b;};'use strict';var _=require(_0x37b3('0x0'));var util=require(_0x37b3('0x1'));var logger=require('../../config/logger')(_0x37b3('0x2'));var moment=require(_0x37b3('0x3'));var BPromise=require('bluebird');var rp=require(_0x37b3('0x4'));var fs=require('fs');var path=require(_0x37b3('0x5'));var rimraf=require(_0x37b3('0x6'));var config=require(_0x37b3('0x7'));var attributes=require(_0x37b3('0x8'));module['exports']=function(_0x2b2f58,_0x2a2d1f){return _0x2b2f58['define'](_0x37b3('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x37b3('0xa'),'fields':['calleridnum']},{'name':_0x37b3('0xb'),'fields':[_0x37b3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf4cd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api'];(function(_0x7e1ec6,_0x1e70fa){var _0x1c9749=function(_0x1e16e0){while(--_0x1e16e0){_0x7e1ec6['push'](_0x7e1ec6['shift']());}};_0x1c9749(++_0x1e70fa);}(_0xf4cd,0x1a1));var _0xdf4c=function(_0x18a606,_0x39deed){_0x18a606=_0x18a606-0x0;var _0x49f9ac=_0xf4cd[_0x18a606];return _0x49f9ac;};'use strict';var _=require(_0xdf4c('0x0'));var util=require('util');var logger=require(_0xdf4c('0x1'))(_0xdf4c('0x2'));var moment=require(_0xdf4c('0x3'));var BPromise=require(_0xdf4c('0x4'));var rp=require(_0xdf4c('0x5'));var fs=require('fs');var path=require(_0xdf4c('0x6'));var rimraf=require(_0xdf4c('0x7'));var config=require(_0xdf4c('0x8'));var attributes=require(_0xdf4c('0x9'));module['exports']=function(_0x2de759,_0x115519){return _0x2de759['define'](_0xdf4c('0xa'),attributes,{'tableName':_0xdf4c('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xdf4c('0xc')]},{'name':_0xdf4c('0xd'),'fields':[_0xdf4c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index a89c2f0..610d457 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(_0x196d3b,_0x2b500e){var _0x3f06b2=function(_0x3423c3){while(--_0x3423c3){_0x196d3b['push'](_0x196d3b['shift']());}};_0x3f06b2(++_0x2b500e);}(_0xb10b,0x12a));var _0xbb10=function(_0x54cd98,_0x3029e6){_0x54cd98=_0x54cd98-0x0;var _0x4abd09=_0xb10b[_0x54cd98];return _0x4abd09;};'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(_0x131ea1,_0x3fac12){var _0x3ef31f=function(_0x2dd564){while(--_0x2dd564){_0x131ea1['push'](_0x131ea1['shift']());}};_0x3ef31f(++_0x3fac12);}(_0xb10b,0x12a));var _0xbb10=function(_0x1811e0,_0x487da0){_0x1811e0=_0x1811e0-0x0;var _0x3ce439=_0xb10b[_0x1811e0];return _0x3ce439;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 9960bed..c39bba2 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 _0xf347=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xf347,0xef));var _0x7f34=function(_0x455826,_0x457e50){_0x455826=_0x455826-0x0;var _0x630016=_0xf347[_0x455826];return _0x630016;};'use strict';var multer=require(_0x7f34('0x0'));var util=require('util');var path=require(_0x7f34('0x1'));var timeout=require(_0x7f34('0x2'));var express=require('express');var router=express[_0x7f34('0x3')]();var fs_extra=require(_0x7f34('0x4'));var auth=require(_0x7f34('0x5'));var interaction=require(_0x7f34('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x7f34('0x7')]('/',auth[_0x7f34('0x8')](),controller['index']);router[_0x7f34('0x7')](_0x7f34('0x9'),auth[_0x7f34('0x8')](),controller[_0x7f34('0xa')]);router[_0x7f34('0x7')](_0x7f34('0xb'),auth['isAuthenticated'](),controller[_0x7f34('0xc')]);router[_0x7f34('0x7')](_0x7f34('0xd'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x7f34('0x7')]('/campaign/countAttributes/:id',auth[_0x7f34('0x8')](),controller[_0x7f34('0xe')]);router[_0x7f34('0xf')](_0x7f34('0x10'),auth['isAuthenticated'](),controller[_0x7f34('0x11')]);router[_0x7f34('0xf')](_0x7f34('0x12'),auth[_0x7f34('0x8')](),controller[_0x7f34('0x13')]);router[_0x7f34('0xf')](_0x7f34('0x14'),auth[_0x7f34('0x8')](),controller[_0x7f34('0x15')]);router[_0x7f34('0x16')]('/:id',auth[_0x7f34('0x8')](),controller[_0x7f34('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6817=['/voice/campaign/moveContacts/:id','/checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','post'];(function(_0x33399a,_0x2b1154){var _0x18058e=function(_0x37c10d){while(--_0x37c10d){_0x33399a['push'](_0x33399a['shift']());}};_0x18058e(++_0x2b1154);}(_0x6817,0xf8));var _0x7681=function(_0x5ce887,_0x126d78){_0x5ce887=_0x5ce887-0x0;var _0x58ecb4=_0x6817[_0x5ce887];return _0x58ecb4;};'use strict';var multer=require(_0x7681('0x0'));var util=require(_0x7681('0x1'));var path=require(_0x7681('0x2'));var timeout=require(_0x7681('0x3'));var express=require(_0x7681('0x4'));var router=express[_0x7681('0x5')]();var fs_extra=require(_0x7681('0x6'));var auth=require(_0x7681('0x7'));var interaction=require(_0x7681('0x8'));var config=require(_0x7681('0x9'));var controller=require(_0x7681('0xa'));router[_0x7681('0xb')]('/',auth[_0x7681('0xc')](),controller[_0x7681('0xd')]);router['get'](_0x7681('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x7681('0xb')](_0x7681('0xf'),auth['isAuthenticated'](),controller[_0x7681('0x10')]);router[_0x7681('0xb')]('/voice/queue/countAttributes/:id',auth[_0x7681('0xc')](),controller[_0x7681('0x11')]);router[_0x7681('0xb')](_0x7681('0x12'),auth['isAuthenticated'](),controller[_0x7681('0x13')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x7681('0xc')](),controller[_0x7681('0x14')]);router[_0x7681('0x15')](_0x7681('0x16'),auth[_0x7681('0xc')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x7681('0x15')](_0x7681('0x17'),auth['isAuthenticated'](),controller['checkContactHopper']);router[_0x7681('0x18')](_0x7681('0xf'),auth[_0x7681('0xc')](),controller[_0x7681('0x19')]);module[_0x7681('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 7c37399..fe2c2cc 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 _0x9684=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2b97d4,_0x3aeeb1){var _0x5c98bf=function(_0x86b48e){while(--_0x86b48e){_0x2b97d4['push'](_0x2b97d4['shift']());}};_0x5c98bf(++_0x3aeeb1);}(_0x9684,0x1bb));var _0x4968=function(_0x535c2a,_0x4d14a2){_0x535c2a=_0x535c2a-0x0;var _0x1e7836=_0x9684[_0x535c2a];return _0x1e7836;};'use strict';var Sequelize=require(_0x4968('0x0'));module[_0x4968('0x1')]={'state':{'type':Sequelize[_0x4968('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4968('0x3')]},'scheduledat':{'type':Sequelize[_0x4968('0x4')]},'countbusyretry':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4968('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x4968('0x3')]},'calleridnum':{'type':Sequelize[_0x4968('0x3')]},'calleridname':{'type':Sequelize[_0x4968('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x4968('0x4')]},'answertime':{'type':Sequelize[_0x4968('0x4')]},'droptime':{'type':Sequelize[_0x4968('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4968('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x4968('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4968('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4968('0x4')]},'recallme':{'type':Sequelize[_0x4968('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x4968('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4968('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7764=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x1a7a70,_0x915c8a){var _0x3c191b=function(_0x7ca397){while(--_0x7ca397){_0x1a7a70['push'](_0x1a7a70['shift']());}};_0x3c191b(++_0x915c8a);}(_0x7764,0x120));var _0x4776=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0x7764[_0x55ef8b];return _0x359c84;};'use strict';var Sequelize=require(_0x4776('0x0'));module[_0x4776('0x1')]={'state':{'type':Sequelize[_0x4776('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4776('0x3')]},'scheduledat':{'type':Sequelize[_0x4776('0x4')]},'countbusyretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4776('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x4776('0x3')]},'originatecalleridname':{'type':Sequelize[_0x4776('0x3')]},'calleridnum':{'type':Sequelize[_0x4776('0x3')]},'calleridname':{'type':Sequelize[_0x4776('0x3')]},'starttime':{'type':Sequelize[_0x4776('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4776('0x4')]},'droptime':{'type':Sequelize[_0x4776('0x4')]},'endtime':{'type':Sequelize[_0x4776('0x4')]},'ringtime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4776('0x3')]},'campaigntype':{'type':Sequelize[_0x4776('0x3')]},'membername':{'type':Sequelize[_0x4776('0x3')]},'reason':{'type':Sequelize[_0x4776('0x3')]},'amd':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4776('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4776('0x4')]},'recallme':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x4776('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4776('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4776('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 80e53af..6d8ccb2 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 _0x0805=['describe','uniqueid','eml-format','rimraf','zip-dir','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','CmHopperHistory','includeAll','include','rows','catch','params','find','create','body'];(function(_0x265ab5,_0x494f68){var _0x4936de=function(_0x3b95ac){while(--_0x3b95ac){_0x265ab5['push'](_0x265ab5['shift']());}};_0x4936de(++_0x494f68);}(_0x0805,0x98));var _0x5080=function(_0x4cecc4,_0x4a0424){_0x4cecc4=_0x4cecc4-0x0;var _0xff2392=_0x0805[_0x4cecc4];return _0xff2392;};'use strict';var emlformat=require(_0x5080('0x0'));var rimraf=require(_0x5080('0x1'));var zipdir=require(_0x5080('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5080('0x3'));var BPromise=require(_0x5080('0x4'));var Mustache=require('mustache');var util=require(_0x5080('0x5'));var path=require(_0x5080('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5080('0x7'));var fs=require('fs');var fs_extra=require(_0x5080('0x8'));var _=require(_0x5080('0x9'));var squel=require(_0x5080('0xa'));var crypto=require(_0x5080('0xb'));var jsforce=require(_0x5080('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5080('0xd'));var querystring=require('querystring');var Papa=require(_0x5080('0xe'));var Redis=require(_0x5080('0xf'));var authService=require(_0x5080('0x10'));var qs=require(_0x5080('0x11'));var as=require(_0x5080('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5080('0x13'));var licenseUtil=require(_0x5080('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x815121,_0x4f2d49){_0x4f2d49=_0x4f2d49||0xcc;return function(_0x16aac2){if(_0x16aac2){return _0x815121[_0x5080('0x15')](_0x4f2d49);}return _0x815121['status'](_0x4f2d49)[_0x5080('0x16')]();};}function respondWithResult(_0x2ea65a,_0x226ec5){_0x226ec5=_0x226ec5||0xc8;return function(_0x6c5073){if(_0x6c5073){return _0x2ea65a[_0x5080('0x17')](_0x226ec5)[_0x5080('0x18')](_0x6c5073);}};}function respondWithFilteredResult(_0xfc7630,_0x35b3bd){return function(_0x474bdb){if(_0x474bdb){var _0x5cddcc=typeof _0x35b3bd[_0x5080('0x19')]===_0x5080('0x1a')&&typeof _0x35b3bd[_0x5080('0x1b')]===_0x5080('0x1a');var _0x5d7a1b=_0x474bdb['count'];var _0x38ffdf=_0x5cddcc?0x0:_0x35b3bd[_0x5080('0x19')];var _0x4b8fc3=_0x5cddcc?_0x474bdb[_0x5080('0x1c')]:_0x35b3bd[_0x5080('0x19')]+_0x35b3bd['limit'];var _0x25cf5d;if(_0x4b8fc3>=_0x5d7a1b){_0x4b8fc3=_0x5d7a1b;_0x25cf5d=0xc8;}else{_0x25cf5d=0xce;}_0xfc7630[_0x5080('0x17')](_0x25cf5d);return _0xfc7630[_0x5080('0x1d')](_0x5080('0x1e'),_0x38ffdf+'-'+_0x4b8fc3+'/'+_0x5d7a1b)[_0x5080('0x18')](_0x474bdb);}return null;};}function patchUpdates(_0x2c0cd7){return function(_0x49b73f){try{jsonpatch[_0x5080('0x1f')](_0x49b73f,_0x2c0cd7,!![]);}catch(_0x467de7){return BPromise['reject'](_0x467de7);}return _0x49b73f[_0x5080('0x20')]();};}function saveUpdates(_0x36f7ae,_0x54bc98){return function(_0x1f72ba){if(_0x1f72ba){return _0x1f72ba[_0x5080('0x21')](_0x36f7ae)[_0x5080('0x22')](function(_0x3b55a3){return _0x3b55a3;});}return null;};}function removeEntity(_0x4ec124,_0x3984f5){return function(_0xae36){if(_0xae36){return _0xae36[_0x5080('0x23')]()[_0x5080('0x22')](function(){_0x4ec124[_0x5080('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x539d86,_0x3ee202){return function(_0x5cfe4f){if(!_0x5cfe4f){_0x539d86[_0x5080('0x15')](0x194);}return _0x5cfe4f;};}function handleError(_0x137dc5,_0x20cf8a){_0x20cf8a=_0x20cf8a||0x1f4;return function(_0x2514a3){logger[_0x5080('0x24')](_0x2514a3[_0x5080('0x25')]);if(_0x2514a3[_0x5080('0x26')]){delete _0x2514a3[_0x5080('0x26')];}_0x137dc5[_0x5080('0x17')](_0x20cf8a)[_0x5080('0x27')](_0x2514a3);};}exports[_0x5080('0x28')]=function(_0x700eff,_0x3d0ab1){var _0x28430c={},_0x252168={},_0x1a7725={'count':0x0,'rows':[]};var _0x56bfcf=_[_0x5080('0x29')](db['CmHopperHistory'][_0x5080('0x2a')],function(_0xf1d987){return{'name':_0xf1d987[_0x5080('0x2b')],'type':_0xf1d987[_0x5080('0x2c')][_0x5080('0x2d')]};});_0x252168['model']=_[_0x5080('0x29')](_0x56bfcf,_0x5080('0x26'));_0x252168['query']=_[_0x5080('0x2e')](_0x700eff[_0x5080('0x2f')]);_0x252168['filters']=_[_0x5080('0x30')](_0x252168[_0x5080('0x31')],_0x252168[_0x5080('0x2f')]);_0x28430c[_0x5080('0x32')]=_[_0x5080('0x30')](_0x252168['model'],qs[_0x5080('0x33')](_0x700eff[_0x5080('0x2f')][_0x5080('0x33')]));_0x28430c[_0x5080('0x32')]=_0x28430c[_0x5080('0x32')][_0x5080('0x34')]?_0x28430c[_0x5080('0x32')]:_0x252168[_0x5080('0x31')];if(!_0x700eff[_0x5080('0x2f')][_0x5080('0x35')](_0x5080('0x36'))){_0x28430c[_0x5080('0x1b')]=qs[_0x5080('0x1b')](_0x700eff['query'][_0x5080('0x1b')]);_0x28430c[_0x5080('0x19')]=qs[_0x5080('0x19')](_0x700eff[_0x5080('0x2f')][_0x5080('0x19')]);}_0x28430c[_0x5080('0x37')]=qs[_0x5080('0x38')](_0x700eff[_0x5080('0x2f')][_0x5080('0x38')]);_0x28430c['where']=qs[_0x5080('0x39')](_[_0x5080('0x3a')](_0x700eff[_0x5080('0x2f')],_0x252168[_0x5080('0x39')]),_0x56bfcf);if(_0x700eff[_0x5080('0x2f')][_0x5080('0x3b')]){_0x28430c[_0x5080('0x3c')]=_[_0x5080('0x3d')](_0x28430c[_0x5080('0x3c')],{'$or':_[_0x5080('0x29')](_0x56bfcf,function(_0x39630c){if(_0x39630c[_0x5080('0x2c')]!==_0x5080('0x3e')){var _0x5af142={};_0x5af142[_0x39630c['name']]={'$like':'%'+_0x700eff[_0x5080('0x2f')][_0x5080('0x3b')]+'%'};return _0x5af142;}})});}_0x28430c=_['merge']({},_0x28430c,_0x700eff[_0x5080('0x3f')]);var _0x59c2b7={'where':_0x28430c[_0x5080('0x3c')]};return db[_0x5080('0x40')]['count'](_0x59c2b7)[_0x5080('0x22')](function(_0x11bb68){_0x1a7725[_0x5080('0x1c')]=_0x11bb68;if(_0x700eff[_0x5080('0x2f')][_0x5080('0x41')]){_0x28430c[_0x5080('0x42')]=[{'all':!![]}];}return db[_0x5080('0x40')]['findAll'](_0x28430c);})[_0x5080('0x22')](function(_0xfe7afc){_0x1a7725[_0x5080('0x43')]=_0xfe7afc;return _0x1a7725;})[_0x5080('0x22')](respondWithFilteredResult(_0x3d0ab1,_0x28430c))[_0x5080('0x44')](handleError(_0x3d0ab1,null));};exports['show']=function(_0x129418,_0x457924){var _0x475f18={'raw':!![],'where':{'id':_0x129418[_0x5080('0x45')]['id']}},_0x379b25={};_0x379b25[_0x5080('0x31')]=_[_0x5080('0x2e')](db[_0x5080('0x40')]['rawAttributes']);_0x379b25[_0x5080('0x2f')]=_[_0x5080('0x2e')](_0x129418[_0x5080('0x2f')]);_0x379b25[_0x5080('0x39')]=_['intersection'](_0x379b25[_0x5080('0x31')],_0x379b25[_0x5080('0x2f')]);_0x475f18[_0x5080('0x32')]=_[_0x5080('0x30')](_0x379b25[_0x5080('0x31')],qs[_0x5080('0x33')](_0x129418[_0x5080('0x2f')][_0x5080('0x33')]));_0x475f18['attributes']=_0x475f18[_0x5080('0x32')]['length']?_0x475f18['attributes']:_0x379b25[_0x5080('0x31')];if(_0x129418[_0x5080('0x2f')][_0x5080('0x41')]){_0x475f18[_0x5080('0x42')]=[{'all':!![]}];}_0x475f18=_[_0x5080('0x3d')]({},_0x475f18,_0x129418['options']);return db[_0x5080('0x40')][_0x5080('0x46')](_0x475f18)['then'](handleEntityNotFound(_0x457924,null))[_0x5080('0x22')](respondWithResult(_0x457924,null))[_0x5080('0x44')](handleError(_0x457924,null));};exports[_0x5080('0x47')]=function(_0x195778,_0x5c7986){return db[_0x5080('0x40')][_0x5080('0x47')](_0x195778[_0x5080('0x48')],{})[_0x5080('0x22')](respondWithResult(_0x5c7986,0xc9))[_0x5080('0x44')](handleError(_0x5c7986,null));};exports['describe']=function(_0xfad1e5,_0x5ca48f){return db[_0x5080('0x40')][_0x5080('0x49')]()[_0x5080('0x22')](respondWithResult(_0x5ca48f,null))['catch'](handleError(_0x5ca48f,null));};exports['update']=function(_0x4871fb,_0x41f9aa){if(_0x4871fb[_0x5080('0x48')][_0x5080('0x4a')]){delete _0x4871fb[_0x5080('0x48')][_0x5080('0x4a')];}return db[_0x5080('0x40')][_0x5080('0x46')]({'where':{'uniqueid':_0x4871fb[_0x5080('0x45')]['id']}})[_0x5080('0x22')](handleEntityNotFound(_0x41f9aa,null))[_0x5080('0x22')](saveUpdates(_0x4871fb['body'],null))[_0x5080('0x22')](respondWithResult(_0x41f9aa,null))[_0x5080('0x44')](handleError(_0x41f9aa,null));}; \ No newline at end of file +var _0x432b=['../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','map','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','CmHopperHistory','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x432b,0x79));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb432('0x0'));var rimraf=require(_0xb432('0x1'));var zipdir=require(_0xb432('0x2'));var jsonpatch=require(_0xb432('0x3'));var rp=require(_0xb432('0x4'));var moment=require('moment');var BPromise=require(_0xb432('0x5'));var Mustache=require(_0xb432('0x6'));var util=require('util');var path=require(_0xb432('0x7'));var sox=require('sox');var csv=require(_0xb432('0x8'));var ejs=require(_0xb432('0x9'));var fs=require('fs');var fs_extra=require(_0xb432('0xa'));var _=require(_0xb432('0xb'));var squel=require(_0xb432('0xc'));var crypto=require('crypto');var jsforce=require(_0xb432('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb432('0x8'));var querystring=require(_0xb432('0xe'));var Papa=require(_0xb432('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb432('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb432('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb432('0x12'));var config=require(_0xb432('0x13'));var licenseUtil=require(_0xb432('0x14'));var db=require(_0xb432('0x15'))['db'];function respondWithStatusCode(_0x5b9cbe,_0x57968f){_0x57968f=_0x57968f||0xcc;return function(_0x1429f6){if(_0x1429f6){return _0x5b9cbe[_0xb432('0x16')](_0x57968f);}return _0x5b9cbe[_0xb432('0x17')](_0x57968f)['end']();};}function respondWithResult(_0x30c5ee,_0x5d2317){_0x5d2317=_0x5d2317||0xc8;return function(_0x282fc4){if(_0x282fc4){return _0x30c5ee['status'](_0x5d2317)['json'](_0x282fc4);}};}function respondWithFilteredResult(_0x14a79d,_0x26c387){return function(_0x130c14){if(_0x130c14){var _0x161d25=typeof _0x26c387[_0xb432('0x18')]==='undefined'&&typeof _0x26c387[_0xb432('0x19')]==='undefined';var _0x5c3211=_0x130c14[_0xb432('0x1a')];var _0x1a95e5=_0x161d25?0x0:_0x26c387[_0xb432('0x18')];var _0x20e66b=_0x161d25?_0x130c14[_0xb432('0x1a')]:_0x26c387['offset']+_0x26c387[_0xb432('0x19')];var _0x459e7f;if(_0x20e66b>=_0x5c3211){_0x20e66b=_0x5c3211;_0x459e7f=0xc8;}else{_0x459e7f=0xce;}_0x14a79d['status'](_0x459e7f);return _0x14a79d[_0xb432('0x1b')](_0xb432('0x1c'),_0x1a95e5+'-'+_0x20e66b+'/'+_0x5c3211)[_0xb432('0x1d')](_0x130c14);}return null;};}function patchUpdates(_0x246616){return function(_0x48b27a){try{jsonpatch[_0xb432('0x1e')](_0x48b27a,_0x246616,!![]);}catch(_0xe8dec1){return BPromise[_0xb432('0x1f')](_0xe8dec1);}return _0x48b27a['save']();};}function saveUpdates(_0x2d5f98,_0x4bf182){return function(_0x14e890){if(_0x14e890){return _0x14e890[_0xb432('0x20')](_0x2d5f98)[_0xb432('0x21')](function(_0x5b8b7d){return _0x5b8b7d;});}return null;};}function removeEntity(_0x3f5170,_0x4e34c6){return function(_0x5ee0ea){if(_0x5ee0ea){return _0x5ee0ea['destroy']()[_0xb432('0x21')](function(){_0x3f5170[_0xb432('0x17')](0xcc)[_0xb432('0x22')]();});}};}function handleEntityNotFound(_0x229251,_0x33db25){return function(_0x4a8be1){if(!_0x4a8be1){_0x229251[_0xb432('0x16')](0x194);}return _0x4a8be1;};}function handleError(_0xefaf49,_0xf6cc9f){_0xf6cc9f=_0xf6cc9f||0x1f4;return function(_0x4ba06e){logger[_0xb432('0x23')](_0x4ba06e[_0xb432('0x24')]);if(_0x4ba06e[_0xb432('0x25')]){delete _0x4ba06e[_0xb432('0x25')];}_0xefaf49[_0xb432('0x17')](_0xf6cc9f)[_0xb432('0x26')](_0x4ba06e);};}exports['index']=function(_0x4f73a6,_0x2f1b37){var _0xd0a0a5={},_0x15fbae={},_0x319e03={'count':0x0,'rows':[]};var _0x56b1a9=_[_0xb432('0x27')](db['CmHopperHistory'][_0xb432('0x28')],function(_0x4b8a75){return{'name':_0x4b8a75['fieldName'],'type':_0x4b8a75[_0xb432('0x29')]['key']};});_0x15fbae['model']=_['map'](_0x56b1a9,_0xb432('0x25'));_0x15fbae[_0xb432('0x2a')]=_['keys'](_0x4f73a6[_0xb432('0x2a')]);_0x15fbae[_0xb432('0x2b')]=_[_0xb432('0x2c')](_0x15fbae[_0xb432('0x2d')],_0x15fbae[_0xb432('0x2a')]);_0xd0a0a5[_0xb432('0x2e')]=_['intersection'](_0x15fbae[_0xb432('0x2d')],qs['fields'](_0x4f73a6[_0xb432('0x2a')][_0xb432('0x2f')]));_0xd0a0a5[_0xb432('0x2e')]=_0xd0a0a5[_0xb432('0x2e')][_0xb432('0x30')]?_0xd0a0a5[_0xb432('0x2e')]:_0x15fbae[_0xb432('0x2d')];if(!_0x4f73a6[_0xb432('0x2a')][_0xb432('0x31')](_0xb432('0x32'))){_0xd0a0a5['limit']=qs[_0xb432('0x19')](_0x4f73a6['query'][_0xb432('0x19')]);_0xd0a0a5[_0xb432('0x18')]=qs[_0xb432('0x18')](_0x4f73a6[_0xb432('0x2a')][_0xb432('0x18')]);}_0xd0a0a5[_0xb432('0x33')]=qs['sort'](_0x4f73a6['query'][_0xb432('0x34')]);_0xd0a0a5['where']=qs[_0xb432('0x2b')](_['pick'](_0x4f73a6[_0xb432('0x2a')],_0x15fbae[_0xb432('0x2b')]),_0x56b1a9);if(_0x4f73a6[_0xb432('0x2a')][_0xb432('0x35')]){_0xd0a0a5[_0xb432('0x36')]=_[_0xb432('0x37')](_0xd0a0a5[_0xb432('0x36')],{'$or':_[_0xb432('0x27')](_0x56b1a9,function(_0x1f25ff){if(_0x1f25ff[_0xb432('0x29')]!==_0xb432('0x38')){var _0x17164b={};_0x17164b[_0x1f25ff[_0xb432('0x25')]]={'$like':'%'+_0x4f73a6[_0xb432('0x2a')][_0xb432('0x35')]+'%'};return _0x17164b;}})});}_0xd0a0a5=_[_0xb432('0x37')]({},_0xd0a0a5,_0x4f73a6['options']);var _0x269087={'where':_0xd0a0a5['where']};return db[_0xb432('0x39')][_0xb432('0x1a')](_0x269087)['then'](function(_0x549952){_0x319e03[_0xb432('0x1a')]=_0x549952;if(_0x4f73a6[_0xb432('0x2a')][_0xb432('0x3a')]){_0xd0a0a5[_0xb432('0x3b')]=[{'all':!![]}];}return db[_0xb432('0x39')][_0xb432('0x3c')](_0xd0a0a5);})[_0xb432('0x21')](function(_0x2b02f9){_0x319e03[_0xb432('0x3d')]=_0x2b02f9;return _0x319e03;})[_0xb432('0x21')](respondWithFilteredResult(_0x2f1b37,_0xd0a0a5))[_0xb432('0x3e')](handleError(_0x2f1b37,null));};exports[_0xb432('0x3f')]=function(_0x10f810,_0x55748a){var _0x381af8={'raw':!![],'where':{'id':_0x10f810[_0xb432('0x40')]['id']}},_0x53fa49={};_0x53fa49[_0xb432('0x2d')]=_[_0xb432('0x41')](db['CmHopperHistory'][_0xb432('0x28')]);_0x53fa49[_0xb432('0x2a')]=_[_0xb432('0x41')](_0x10f810[_0xb432('0x2a')]);_0x53fa49['filters']=_[_0xb432('0x2c')](_0x53fa49[_0xb432('0x2d')],_0x53fa49[_0xb432('0x2a')]);_0x381af8[_0xb432('0x2e')]=_[_0xb432('0x2c')](_0x53fa49[_0xb432('0x2d')],qs['fields'](_0x10f810[_0xb432('0x2a')][_0xb432('0x2f')]));_0x381af8[_0xb432('0x2e')]=_0x381af8['attributes']['length']?_0x381af8['attributes']:_0x53fa49[_0xb432('0x2d')];if(_0x10f810['query'][_0xb432('0x3a')]){_0x381af8['include']=[{'all':!![]}];}_0x381af8=_[_0xb432('0x37')]({},_0x381af8,_0x10f810['options']);return db[_0xb432('0x39')][_0xb432('0x42')](_0x381af8)[_0xb432('0x21')](handleEntityNotFound(_0x55748a,null))[_0xb432('0x21')](respondWithResult(_0x55748a,null))[_0xb432('0x3e')](handleError(_0x55748a,null));};exports[_0xb432('0x43')]=function(_0x4b4a2d,_0x291672){return db[_0xb432('0x39')][_0xb432('0x43')](_0x4b4a2d[_0xb432('0x44')],{})['then'](respondWithResult(_0x291672,0xc9))[_0xb432('0x3e')](handleError(_0x291672,null));};exports[_0xb432('0x45')]=function(_0xfc8f62,_0x2cd477){return db[_0xb432('0x39')][_0xb432('0x45')]()['then'](respondWithResult(_0x2cd477,null))[_0xb432('0x3e')](handleError(_0x2cd477,null));};exports[_0xb432('0x20')]=function(_0x262315,_0x3281bc){if(_0x262315[_0xb432('0x44')][_0xb432('0x46')]){delete _0x262315[_0xb432('0x44')]['uniqueid'];}return db['CmHopperHistory'][_0xb432('0x42')]({'where':{'uniqueid':_0x262315[_0xb432('0x40')]['id']}})[_0xb432('0x21')](handleEntityNotFound(_0x3281bc,null))[_0xb432('0x21')](saveUpdates(_0x262315[_0xb432('0x44')],null))[_0xb432('0x21')](respondWithResult(_0x3281bc,null))[_0xb432('0x3e')](handleError(_0x3281bc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index e2c99b7..99e04db 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 _0x17a7=['endtime','uniqueid','api','moment','bluebird','request-promise','rimraf','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x17a7,0xc2));var _0x717a=function(_0x5bb65c,_0x3f9f19){_0x5bb65c=_0x5bb65c-0x0;var _0x14a28c=_0x17a7[_0x5bb65c];return _0x14a28c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x717a('0x0'));var moment=require(_0x717a('0x1'));var BPromise=require(_0x717a('0x2'));var rp=require(_0x717a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x717a('0x4'));var config=require('../../config/environment');var attributes=require(_0x717a('0x5'));module[_0x717a('0x6')]=function(_0x4dd8c3,_0x232539){return _0x4dd8c3[_0x717a('0x7')](_0x717a('0x8'),attributes,{'tableName':_0x717a('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x717a('0xa')]},{'name':'uniqueid','fields':[_0x717a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5c8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','CmHopperHistory','cm_hopper_history','endtime','../../config/logger','api'];(function(_0x316f61,_0x1f2c5c){var _0x42acbc=function(_0x21c5b2){while(--_0x21c5b2){_0x316f61['push'](_0x316f61['shift']());}};_0x42acbc(++_0x1f2c5c);}(_0xd5c8,0x166));var _0x8d5c=function(_0x10b434,_0x521745){_0x10b434=_0x10b434-0x0;var _0x31050b=_0xd5c8[_0x10b434];return _0x31050b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8d5c('0x0'))(_0x8d5c('0x1'));var moment=require(_0x8d5c('0x2'));var BPromise=require(_0x8d5c('0x3'));var rp=require(_0x8d5c('0x4'));var fs=require('fs');var path=require(_0x8d5c('0x5'));var rimraf=require(_0x8d5c('0x6'));var config=require(_0x8d5c('0x7'));var attributes=require(_0x8d5c('0x8'));module['exports']=function(_0xd72ba3,_0x5d3fff){return _0xd72ba3['define'](_0x8d5c('0x9'),attributes,{'tableName':_0x8d5c('0xa'),'paranoid':![],'indexes':[{'name':_0x8d5c('0xb'),'fields':[_0x8d5c('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 034812b..35630f3 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 _0xf2fa=['`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundReCallsDay','then','GetCampaignHopperHistory','name','col','ivrAnswerCallsDay','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','body','options','raw','findAll','sequelize','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','CmHopperHistory','where','campaign'];(function(_0x435e01,_0x14049a){var _0x531373=function(_0x4786ad){while(--_0x4786ad){_0x435e01['push'](_0x435e01['shift']());}};_0x531373(++_0x14049a);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xaf2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaf2f('0x1'));var rs=require(_0xaf2f('0x2'));var fs=require('fs');var Redis=require(_0xaf2f('0x3'));var db=require(_0xaf2f('0x4'))['db'];var utils=require(_0xaf2f('0x5'));var logger=require(_0xaf2f('0x6'))(_0xaf2f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45e164,_0x2dfba7,_0x1c3cfa){return new BPromise(function(_0x312d3b,_0x2b65f2){return client['request'](_0x45e164,_0x1c3cfa)['then'](function(_0x50c838){logger[_0xaf2f('0x9')](_0xaf2f('0xa'),_0x2dfba7,_0xaf2f('0xb'));logger[_0xaf2f('0xc')](_0xaf2f('0xd'),_0x2dfba7,_0xaf2f('0xb'),JSON[_0xaf2f('0xe')](_0x50c838));if(_0x50c838[_0xaf2f('0xf')]){if(_0x50c838['error'][_0xaf2f('0x10')]===0x1f4){logger[_0xaf2f('0xf')](_0xaf2f('0xa'),_0x2dfba7,_0x50c838['error']['message']);return _0x2b65f2(_0x50c838['error'][_0xaf2f('0x11')]);}logger[_0xaf2f('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x2dfba7,_0x50c838[_0xaf2f('0xf')][_0xaf2f('0x11')]);return _0x312d3b(_0x50c838['error'][_0xaf2f('0x11')]);}else{logger['info'](_0xaf2f('0xa'),_0x2dfba7,_0xaf2f('0xb'));_0x312d3b(_0x50c838[_0xaf2f('0x12')][_0xaf2f('0x11')]);}})[_0xaf2f('0x13')](function(_0x32e829){logger[_0xaf2f('0xf')](_0xaf2f('0xa'),_0x2dfba7,_0x32e829);_0x2b65f2(_0x32e829);});});}exports[_0xaf2f('0x14')]=function(_0x244435){var _0x4d2db7=this;return new Promise(function(_0x1a2d28,_0x3376bb){return db['CmHopperHistory']['create'](_0x244435[_0xaf2f('0x15')],{'raw':_0x244435[_0xaf2f('0x16')]?_0x244435['options'][_0xaf2f('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2dbd9b){logger['info'](_0xaf2f('0x14'),_0x244435);logger[_0xaf2f('0xc')]('CreateCmHopperHistory',_0x244435,JSON[_0xaf2f('0xe')](_0x2dbd9b));_0x1a2d28(_0x2dbd9b);})[_0xaf2f('0x13')](function(_0x359dc2){logger[_0xaf2f('0xf')](_0xaf2f('0x14'),_0x359dc2[_0xaf2f('0x11')],_0x244435);_0x3376bb(_0x4d2db7[_0xaf2f('0xf')](0x1f4,_0x359dc2[_0xaf2f('0x11')]));});});};exports['AvgHandleTime']=function(_0x5f199d){var _0x22e94c=this;return new Promise(function(_0x7fd44e,_0x17de64){return db['CmHopperHistory'][_0xaf2f('0x18')]({'raw':_0x5f199d[_0xaf2f('0x16')]?_0x5f199d[_0xaf2f('0x16')][_0xaf2f('0x17')]===undefined?!![]:![]:!![],'where':_0x5f199d[_0xaf2f('0x16')]?_0x5f199d[_0xaf2f('0x16')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xaf2f('0x19')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')]('`state`\x20=\x204,\x201,\x20null'))),_0xaf2f('0x1c')],[db[_0xaf2f('0x19')]['fn']('COUNT',db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')]['literal'](_0xaf2f('0x1d')))),_0xaf2f('0x1e')],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db['sequelize']['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xaf2f('0x19')]['fn']('AVG',db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')](_0xaf2f('0x1f')))),_0xaf2f('0x20')],[db['sequelize']['fn'](_0xaf2f('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0xaf2f('0x1b')](_0xaf2f('0x22')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x103fd5){logger[_0xaf2f('0x9')](_0xaf2f('0x23'),_0x5f199d);logger[_0xaf2f('0xc')](_0xaf2f('0x23'),_0x5f199d,JSON['stringify'](_0x103fd5));_0x7fd44e(_0x103fd5);})[_0xaf2f('0x13')](function(_0x5144aa){logger[_0xaf2f('0xf')](_0xaf2f('0x23'),_0x5144aa[_0xaf2f('0x11')],_0x5f199d);_0x17de64(_0x22e94c[_0xaf2f('0xf')](0x1f4,_0x5144aa[_0xaf2f('0x11')]));});});};exports[_0xaf2f('0x24')]=function(_0xfc9e67){var _0x41393b=this;return new Promise(function(_0x4c66ad,_0x5db64e){return db[_0xaf2f('0x25')]['findAll']({'raw':_0xfc9e67[_0xaf2f('0x16')]?_0xfc9e67['options'][_0xaf2f('0x17')]===undefined?!![]:![]:!![],'where':_0xfc9e67[_0xaf2f('0x16')]?_0xfc9e67['options'][_0xaf2f('0x26')]||null:null,'attributes':[[_0xaf2f('0x27'),'name'],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db['sequelize']['fn']('IF',db[_0xaf2f('0x19')]['literal'](_0xaf2f('0x28')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')]['literal'](_0xaf2f('0x29')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')](_0xaf2f('0x2a')))),_0xaf2f('0x2b')],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db['sequelize']['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')](_0xaf2f('0x2c')))),_0xaf2f('0x2d')],[db[_0xaf2f('0x19')]['fn']('COUNT',db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')](_0xaf2f('0x2e')))),_0xaf2f('0x2f')],[db['sequelize']['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db['sequelize'][_0xaf2f('0x1b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xaf2f('0x30')],[db[_0xaf2f('0x19')]['fn']('COUNT',db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')](_0xaf2f('0x31')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0xaf2f('0x32')],[db['sequelize']['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db['sequelize'][_0xaf2f('0x1b')](_0xaf2f('0x33')))),_0xaf2f('0x34')],[db['sequelize']['fn']('COUNT',db[_0xaf2f('0x19')]['fn']('IF',db['sequelize'][_0xaf2f('0x1b')](_0xaf2f('0x35')))),'outboundOriginateFailureCallsDay'],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db['sequelize']['literal'](_0xaf2f('0x36')))),_0xaf2f('0x37')],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')][_0xaf2f('0x1b')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db[_0xaf2f('0x19')]['fn']('IF',db[_0xaf2f('0x19')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xaf2f('0x38')]],'group':[_0xaf2f('0x27')]})[_0xaf2f('0x39')](function(_0x3f0491){logger[_0xaf2f('0x9')](_0xaf2f('0x24'),_0xfc9e67);logger[_0xaf2f('0xc')](_0xaf2f('0x24'),_0xfc9e67,JSON[_0xaf2f('0xe')](_0x3f0491));_0x4c66ad(_0x3f0491);})[_0xaf2f('0x13')](function(_0x24432a){logger[_0xaf2f('0xf')](_0xaf2f('0x24'),_0x24432a['message'],_0xfc9e67);_0x5db64e(_0x41393b[_0xaf2f('0xf')](0x1f4,_0x24432a[_0xaf2f('0x11')]));});});};exports[_0xaf2f('0x3a')]=function(_0x5f1195){var _0x547a7d=this;return new Promise(function(_0x33aaaf,_0x190f9a){return db['CmHopperHistory'][_0xaf2f('0x18')]({'raw':_0x5f1195['options']?_0x5f1195[_0xaf2f('0x16')][_0xaf2f('0x17')]===undefined?!![]:![]:!![],'where':_0x5f1195[_0xaf2f('0x16')]?_0x5f1195[_0xaf2f('0x16')][_0xaf2f('0x26')]||null:null,'attributes':[[_0xaf2f('0x27'),_0xaf2f('0x3b')],[db['sequelize']['fn'](_0xaf2f('0x1a'),db['sequelize'][_0xaf2f('0x3c')]('id')),'ivrTotalCallsDays'],[db[_0xaf2f('0x19')]['fn'](_0xaf2f('0x1a'),db['sequelize']['fn']('IF',db['sequelize'][_0xaf2f('0x1b')](_0xaf2f('0x2a')))),_0xaf2f('0x3d')]],'group':[_0xaf2f('0x27')]})[_0xaf2f('0x39')](function(_0x3d2b58){logger[_0xaf2f('0x9')]('GetCampaignHopperHistory',_0x5f1195);logger['debug'](_0xaf2f('0x3a'),_0x5f1195,JSON['stringify'](_0x3d2b58));_0x33aaaf(_0x3d2b58);})[_0xaf2f('0x13')](function(_0x36bbb1){logger[_0xaf2f('0xf')](_0xaf2f('0x3a'),_0x36bbb1[_0xaf2f('0x11')],_0x5f1195);_0x190f9a(_0x547a7d[_0xaf2f('0xf')](0x1f4,_0x36bbb1[_0xaf2f('0x11')]));});});}; \ No newline at end of file +var _0x3c31=['GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','GetCampaignHopperHistory','CmHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','create','body','options','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime'];(function(_0x5f22cb,_0x4fda24){var _0x17430e=function(_0x351d09){while(--_0x351d09){_0x5f22cb['push'](_0x5f22cb['shift']());}};_0x17430e(++_0x4fda24);}(_0x3c31,0xb1));var _0x13c3=function(_0x89e1e6,_0xb7eaf8){_0x89e1e6=_0x89e1e6-0x0;var _0x3d9e56=_0x3c31[_0x89e1e6];return _0x3d9e56;};'use strict';var _=require(_0x13c3('0x0'));var util=require(_0x13c3('0x1'));var moment=require(_0x13c3('0x2'));var BPromise=require(_0x13c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c3('0x4'));var db=require(_0x13c3('0x5'))['db'];var utils=require(_0x13c3('0x6'));var logger=require(_0x13c3('0x7'))(_0x13c3('0x8'));var config=require(_0x13c3('0x9'));var jayson=require(_0x13c3('0xa'));var client=jayson[_0x13c3('0xb')][_0x13c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c217d,_0x367bba,_0x21a72c){return new BPromise(function(_0x4802e1,_0xaf7a8d){return client[_0x13c3('0xd')](_0x3c217d,_0x21a72c)[_0x13c3('0xe')](function(_0x2a9a20){logger['info'](_0x13c3('0xf'),_0x367bba,'request\x20sent');logger[_0x13c3('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x367bba,_0x13c3('0x11'),JSON[_0x13c3('0x12')](_0x2a9a20));if(_0x2a9a20[_0x13c3('0x13')]){if(_0x2a9a20[_0x13c3('0x13')][_0x13c3('0x14')]===0x1f4){logger[_0x13c3('0x13')](_0x13c3('0xf'),_0x367bba,_0x2a9a20['error'][_0x13c3('0x15')]);return _0xaf7a8d(_0x2a9a20['error'][_0x13c3('0x15')]);}logger[_0x13c3('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x367bba,_0x2a9a20[_0x13c3('0x13')][_0x13c3('0x15')]);return _0x4802e1(_0x2a9a20[_0x13c3('0x13')]['message']);}else{logger[_0x13c3('0x16')]('CmHopperHistory,\x20%s,\x20%s',_0x367bba,_0x13c3('0x11'));_0x4802e1(_0x2a9a20[_0x13c3('0x17')][_0x13c3('0x15')]);}})[_0x13c3('0x18')](function(_0x5cdcc3){logger['error'](_0x13c3('0xf'),_0x367bba,_0x5cdcc3);_0xaf7a8d(_0x5cdcc3);});});}exports[_0x13c3('0x19')]=function(_0x215fb7){var _0x45abbe=this;return new Promise(function(_0x29ba55,_0xcb7624){return db['CmHopperHistory'][_0x13c3('0x1a')](_0x215fb7[_0x13c3('0x1b')],{'raw':_0x215fb7[_0x13c3('0x1c')]?_0x215fb7[_0x13c3('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ad708){logger[_0x13c3('0x16')](_0x13c3('0x19'),_0x215fb7);logger[_0x13c3('0x10')](_0x13c3('0x19'),_0x215fb7,JSON[_0x13c3('0x12')](_0x5ad708));_0x29ba55(_0x5ad708);})[_0x13c3('0x18')](function(_0x4a68ec){logger[_0x13c3('0x13')](_0x13c3('0x19'),_0x4a68ec[_0x13c3('0x15')],_0x215fb7);_0xcb7624(_0x45abbe[_0x13c3('0x13')](0x1f4,_0x4a68ec[_0x13c3('0x15')]));});});};exports[_0x13c3('0x1d')]=function(_0x3e8151){var _0xc8a1ca=this;return new Promise(function(_0x4faeaa,_0x5d57e3){return db['CmHopperHistory'][_0x13c3('0x1e')]({'raw':_0x3e8151[_0x13c3('0x1c')]?_0x3e8151[_0x13c3('0x1c')][_0x13c3('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e8151[_0x13c3('0x1c')]?_0x3e8151['options'][_0x13c3('0x20')]||null:null,'attributes':[[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')][_0x13c3('0x22')]('id')),_0x13c3('0x23')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x26')))),_0x13c3('0x27')],[db['sequelize']['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')]('`state`\x20=\x2010,\x201,\x20null'))),_0x13c3('0x28')],[db['sequelize']['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x29')))),_0x13c3('0x2a')],[db[_0x13c3('0x21')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x2b')))),_0x13c3('0x2c')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x2d'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x2e')))),_0x13c3('0x2f')]]})['then'](function(_0x26fbe4){logger[_0x13c3('0x16')](_0x13c3('0x1d'),_0x3e8151);logger[_0x13c3('0x10')](_0x13c3('0x1d'),_0x3e8151,JSON[_0x13c3('0x12')](_0x26fbe4));_0x4faeaa(_0x26fbe4);})[_0x13c3('0x18')](function(_0x17c3c3){logger[_0x13c3('0x13')](_0x13c3('0x1d'),_0x17c3c3[_0x13c3('0x15')],_0x3e8151);_0x5d57e3(_0xc8a1ca['error'](0x1f4,_0x17c3c3[_0x13c3('0x15')]));});});};exports[_0x13c3('0x30')]=function(_0x11dc4a){var _0x55f561=this;return new Promise(function(_0x3f7800,_0x344bf8){return db['CmHopperHistory'][_0x13c3('0x1e')]({'raw':_0x11dc4a[_0x13c3('0x1c')]?_0x11dc4a[_0x13c3('0x1c')][_0x13c3('0x1f')]===undefined?!![]:![]:!![],'where':_0x11dc4a[_0x13c3('0x1c')]?_0x11dc4a[_0x13c3('0x1c')]['where']||null:null,'attributes':[[_0x13c3('0x31'),_0x13c3('0x32')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x33')))),_0x13c3('0x34')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x35')))),_0x13c3('0x36')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x26')))),_0x13c3('0x37')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x38')))),_0x13c3('0x39')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x3a')))),_0x13c3('0x3b')],[db['sequelize']['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x3c')))),_0x13c3('0x3d')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize']['literal'](_0x13c3('0x3e')))),_0x13c3('0x3f')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')]['literal'](_0x13c3('0x40')))),_0x13c3('0x41')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x42')))),'outboundRejectCallsDay'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db['sequelize'][_0x13c3('0x25')](_0x13c3('0x43')))),_0x13c3('0x44')],[db[_0x13c3('0x21')]['fn']('COUNT',db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x45')))),_0x13c3('0x46')],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db['sequelize']['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':['campaign']})[_0x13c3('0xe')](function(_0x14785e){logger[_0x13c3('0x16')](_0x13c3('0x30'),_0x11dc4a);logger[_0x13c3('0x10')]('GetVoiceQueueHopperHistory',_0x11dc4a,JSON[_0x13c3('0x12')](_0x14785e));_0x3f7800(_0x14785e);})[_0x13c3('0x18')](function(_0x35d24d){logger[_0x13c3('0x13')]('GetVoiceQueueHopperHistory',_0x35d24d['message'],_0x11dc4a);_0x344bf8(_0x55f561[_0x13c3('0x13')](0x1f4,_0x35d24d[_0x13c3('0x15')]));});});};exports[_0x13c3('0x47')]=function(_0x1a9ffa){var _0x2d7ee2=this;return new Promise(function(_0x4eaddf,_0x17453a){return db[_0x13c3('0x48')]['findAll']({'raw':_0x1a9ffa[_0x13c3('0x1c')]?_0x1a9ffa[_0x13c3('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1a9ffa[_0x13c3('0x1c')]?_0x1a9ffa[_0x13c3('0x1c')][_0x13c3('0x20')]||null:null,'attributes':[['campaign','name'],[db[_0x13c3('0x21')]['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')][_0x13c3('0x22')]('id')),_0x13c3('0x49')],[db['sequelize']['fn'](_0x13c3('0x24'),db[_0x13c3('0x21')]['fn']('IF',db[_0x13c3('0x21')][_0x13c3('0x25')](_0x13c3('0x26')))),_0x13c3('0x4a')]],'group':[_0x13c3('0x31')]})['then'](function(_0x10b90a){logger[_0x13c3('0x16')](_0x13c3('0x47'),_0x1a9ffa);logger[_0x13c3('0x10')](_0x13c3('0x47'),_0x1a9ffa,JSON[_0x13c3('0x12')](_0x10b90a));_0x4eaddf(_0x10b90a);})['catch'](function(_0x57d5f3){logger[_0x13c3('0x13')](_0x13c3('0x47'),_0x57d5f3[_0x13c3('0x15')],_0x1a9ffa);_0x17453a(_0x2d7ee2['error'](0x1f4,_0x57d5f3[_0x13c3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 97a1d8e..2b84649 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 _0x8879=['get','isAuthenticated','index','describe','/:id','show','create','put','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','./cmHopperHistory.controller'];(function(_0x6b1715,_0xe53657){var _0x566def=function(_0x3708fd){while(--_0x3708fd){_0x6b1715['push'](_0x6b1715['shift']());}};_0x566def(++_0xe53657);}(_0x8879,0xca));var _0x9887=function(_0x537f4e,_0x495869){_0x537f4e=_0x537f4e-0x0;var _0x34700e=_0x8879[_0x537f4e];return _0x34700e;};'use strict';var multer=require(_0x9887('0x0'));var util=require(_0x9887('0x1'));var path=require('path');var timeout=require(_0x9887('0x2'));var express=require('express');var router=express[_0x9887('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9887('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9887('0x5'));router[_0x9887('0x6')]('/',auth[_0x9887('0x7')](),controller[_0x9887('0x8')]);router[_0x9887('0x6')]('/describe',auth[_0x9887('0x7')](),controller[_0x9887('0x9')]);router[_0x9887('0x6')](_0x9887('0xa'),auth[_0x9887('0x7')](),controller[_0x9887('0xb')]);router['post']('/',auth[_0x9887('0x7')](),controller[_0x9887('0xc')]);router[_0x9887('0xd')](_0x9887('0xa'),auth[_0x9887('0x7')](),controller[_0x9887('0xe')]);module[_0x9887('0xf')]=router; \ No newline at end of file +var _0x494f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','multer','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x494f,0x108));var _0xf494=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x494f[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xf494('0x0'));var util=require(_0xf494('0x1'));var path=require(_0xf494('0x2'));var timeout=require(_0xf494('0x3'));var express=require(_0xf494('0x4'));var router=express[_0xf494('0x5')]();var fs_extra=require(_0xf494('0x6'));var auth=require(_0xf494('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xf494('0x8'));var controller=require(_0xf494('0x9'));router[_0xf494('0xa')]('/',auth['isAuthenticated'](),controller[_0xf494('0xb')]);router[_0xf494('0xa')]('/describe',auth[_0xf494('0xc')](),controller[_0xf494('0xd')]);router[_0xf494('0xa')]('/:id',auth[_0xf494('0xc')](),controller['show']);router[_0xf494('0xe')]('/',auth[_0xf494('0xc')](),controller[_0xf494('0xf')]);router[_0xf494('0x10')](_0xf494('0x11'),auth[_0xf494('0xc')](),controller[_0xf494('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index f00c806..6f2e726 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 _0x5183=['sequelize','exports','STRING'];(function(_0x43ed38,_0x507af1){var _0x181497=function(_0x153d8e){while(--_0x153d8e){_0x43ed38['push'](_0x43ed38['shift']());}};_0x181497(++_0x507af1);}(_0x5183,0x13e));var _0x3518=function(_0x1c02db,_0x388eb7){_0x1c02db=_0x1c02db-0x0;var _0x539c3e=_0x5183[_0x1c02db];return _0x539c3e;};'use strict';var Sequelize=require(_0x3518('0x0'));module[_0x3518('0x1')]={'name':{'type':Sequelize[_0x3518('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x3518('0x2')]}}; \ No newline at end of file +var _0xa3e6=['sequelize','STRING'];(function(_0x2b7868,_0x44616c){var _0x3e7ce4=function(_0x1eb9ab){while(--_0x1eb9ab){_0x2b7868['push'](_0x2b7868['shift']());}};_0x3e7ce4(++_0x44616c);}(_0xa3e6,0xbe));var _0x6a3e=function(_0xe97677,_0x238e15){_0xe97677=_0xe97677-0x0;var _0x1eca0d=_0xa3e6[_0xe97677];return _0x1eca0d;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a3e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6a3e('0x1')]},'dialPrefix':{'type':Sequelize[_0x6a3e('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 3538107..8052ed5 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 _0x0cc7=['stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','omit','ids','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','nolimit','raw','getContactsCsv','ContactItemType','CmCustomField','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','description','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','addCustomField','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','then','error'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x0cc7,0x77));var _0x70cc=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x0cc7[_0xd09668];return _0x68726;};'use strict';var emlformat=require(_0x70cc('0x0'));var rimraf=require(_0x70cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70cc('0x2'));var rp=require(_0x70cc('0x3'));var moment=require(_0x70cc('0x4'));var BPromise=require(_0x70cc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x70cc('0x6'));var sox=require(_0x70cc('0x7'));var csv=require(_0x70cc('0x8'));var ejs=require(_0x70cc('0x9'));var fs=require('fs');var fs_extra=require(_0x70cc('0xa'));var _=require(_0x70cc('0xb'));var squel=require('squel');var crypto=require(_0x70cc('0xc'));var jsforce=require(_0x70cc('0xd'));var deskjs=require(_0x70cc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x70cc('0xf'));var Papa=require('papaparse');var Redis=require(_0x70cc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x70cc('0x11'));var as=require(_0x70cc('0x12'));var hardwareService=require(_0x70cc('0x13'));var logger=require('../../config/logger')(_0x70cc('0x14'));var utils=require(_0x70cc('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x70cc('0x16'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x70cc('0x17')]=_[_0x70cc('0x18')](config[_0x70cc('0x17')],{'host':_0x70cc('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x70cc('0x1a'))[_0x70cc('0x1b')](socket);function respondWithStatusCode(_0x131eda,_0x41a0c5){_0x41a0c5=_0x41a0c5||0xcc;return function(_0x49a111){if(_0x49a111){return _0x131eda[_0x70cc('0x1c')](_0x41a0c5);}return _0x131eda[_0x70cc('0x1d')](_0x41a0c5)[_0x70cc('0x1e')]();};}function respondWithResult(_0x21d153,_0x1d6c00){_0x1d6c00=_0x1d6c00||0xc8;return function(_0x55cb56){if(_0x55cb56){return _0x21d153[_0x70cc('0x1d')](_0x1d6c00)[_0x70cc('0x1f')](_0x55cb56);}};}function respondWithFilteredResult(_0x1e9658,_0x13c467){return function(_0x251ea4){if(_0x251ea4){var _0x2763cd=typeof _0x13c467[_0x70cc('0x20')]==='undefined'&&typeof _0x13c467['limit']===_0x70cc('0x21');var _0x577b21=_0x251ea4[_0x70cc('0x22')];var _0x10a456=_0x2763cd?0x0:_0x13c467[_0x70cc('0x20')];var _0x456c6a=_0x2763cd?_0x251ea4['count']:_0x13c467[_0x70cc('0x20')]+_0x13c467['limit'];var _0x2dcb26;if(_0x456c6a>=_0x577b21){_0x456c6a=_0x577b21;_0x2dcb26=0xc8;}else{_0x2dcb26=0xce;}_0x1e9658[_0x70cc('0x1d')](_0x2dcb26);return _0x1e9658[_0x70cc('0x23')](_0x70cc('0x24'),_0x10a456+'-'+_0x456c6a+'/'+_0x577b21)['json'](_0x251ea4);}return null;};}function patchUpdates(_0x53a1a4){return function(_0x2e7688){try{jsonpatch[_0x70cc('0x25')](_0x2e7688,_0x53a1a4,!![]);}catch(_0x172e42){return BPromise[_0x70cc('0x26')](_0x172e42);}return _0x2e7688['save']();};}function saveUpdates(_0x4674ee,_0x25e82d){return function(_0x1cd1e2){if(_0x1cd1e2){return _0x1cd1e2[_0x70cc('0x27')](_0x4674ee)['then'](function(_0x5eb6fe){return _0x5eb6fe;});}return null;};}function removeEntity(_0xce9728,_0x2e5992){return function(_0x58df78){if(_0x58df78){return _0x58df78[_0x70cc('0x28')]()['then'](function(){var _0x1a7cd1=_0x58df78[_0x70cc('0x29')]({'plain':!![]});var _0x25fba3='Lists';return db[_0x70cc('0x2a')]['destroy']({'where':{'type':_0x25fba3,'resourceId':_0x1a7cd1['id']}})[_0x70cc('0x2b')](function(){return _0x58df78;});})['then'](function(){_0xce9728[_0x70cc('0x1d')](0xcc)[_0x70cc('0x1e')]();});}};}function handleEntityNotFound(_0xf2195b,_0x14e1ec){return function(_0x4bc0cc){if(!_0x4bc0cc){_0xf2195b[_0x70cc('0x1c')](0x194);}return _0x4bc0cc;};}function handleError(_0x3d4cb1,_0xc238b4){_0xc238b4=_0xc238b4||0x1f4;return function(_0x16acf6){logger[_0x70cc('0x2c')](_0x16acf6[_0x70cc('0x2d')]);if(_0x16acf6[_0x70cc('0x2e')]){delete _0x16acf6[_0x70cc('0x2e')];}_0x3d4cb1[_0x70cc('0x1d')](_0xc238b4)[_0x70cc('0x2f')](_0x16acf6);};}exports[_0x70cc('0x30')]=function(_0x1eab05,_0x2316ad){var _0x401b71={},_0x528d3e={},_0x38eefc={'count':0x0,'rows':[]};var _0x3c7645=_[_0x70cc('0x31')](db[_0x70cc('0x32')][_0x70cc('0x33')],function(_0x1bea24){return{'name':_0x1bea24[_0x70cc('0x34')],'type':_0x1bea24[_0x70cc('0x35')][_0x70cc('0x36')]};});_0x528d3e[_0x70cc('0x37')]=_[_0x70cc('0x31')](_0x3c7645,_0x70cc('0x2e'));_0x528d3e[_0x70cc('0x38')]=_[_0x70cc('0x39')](_0x1eab05[_0x70cc('0x38')]);_0x528d3e[_0x70cc('0x3a')]=_[_0x70cc('0x3b')](_0x528d3e[_0x70cc('0x37')],_0x528d3e[_0x70cc('0x38')]);_0x401b71[_0x70cc('0x3c')]=_['intersection'](_0x528d3e['model'],qs[_0x70cc('0x3d')](_0x1eab05[_0x70cc('0x38')]['fields']));_0x401b71[_0x70cc('0x3c')]=_0x401b71[_0x70cc('0x3c')]['length']?_0x401b71[_0x70cc('0x3c')]:_0x528d3e[_0x70cc('0x37')];if(!_0x1eab05['query']['hasOwnProperty']('nolimit')){_0x401b71[_0x70cc('0x3e')]=qs['limit'](_0x1eab05[_0x70cc('0x38')]['limit']);_0x401b71[_0x70cc('0x20')]=qs[_0x70cc('0x20')](_0x1eab05[_0x70cc('0x38')][_0x70cc('0x20')]);}_0x401b71[_0x70cc('0x3f')]=qs[_0x70cc('0x40')](_0x1eab05[_0x70cc('0x38')][_0x70cc('0x40')]);_0x401b71[_0x70cc('0x41')]=qs[_0x70cc('0x3a')](_[_0x70cc('0x42')](_0x1eab05['query'],_0x528d3e[_0x70cc('0x3a')]),_0x3c7645);if(_0x1eab05[_0x70cc('0x38')][_0x70cc('0x43')]){_0x401b71[_0x70cc('0x41')]=_[_0x70cc('0x44')](_0x401b71[_0x70cc('0x41')],{'$or':_['map'](_0x3c7645,function(_0x2f0d8e){if(_0x2f0d8e['type']!=='VIRTUAL'){var _0xd13195={};_0xd13195[_0x2f0d8e[_0x70cc('0x2e')]]={'$like':'%'+_0x1eab05[_0x70cc('0x38')][_0x70cc('0x43')]+'%'};return _0xd13195;}})});}_0x401b71=_[_0x70cc('0x44')]({},_0x401b71,_0x1eab05[_0x70cc('0x45')]);var _0x333a8a={'where':_0x401b71[_0x70cc('0x41')]};return db[_0x70cc('0x32')][_0x70cc('0x22')](_0x333a8a)['then'](function(_0x109be1){_0x38eefc['count']=_0x109be1;if(_0x1eab05[_0x70cc('0x38')][_0x70cc('0x46')]){_0x401b71['include']=[{'all':!![]}];}return db[_0x70cc('0x32')][_0x70cc('0x47')](_0x401b71);})[_0x70cc('0x2b')](function(_0x152e10){_0x38eefc[_0x70cc('0x48')]=_0x152e10;return _0x38eefc;})[_0x70cc('0x2b')](respondWithFilteredResult(_0x2316ad,_0x401b71))['catch'](handleError(_0x2316ad,null));};exports[_0x70cc('0x49')]=function(_0x377f85,_0x2b9661){var _0x179185={'raw':![],'where':{'id':_0x377f85[_0x70cc('0x4a')]['id']}},_0x4cbd0c={};_0x4cbd0c['model']=_['keys'](db[_0x70cc('0x32')][_0x70cc('0x33')]);_0x4cbd0c[_0x70cc('0x38')]=_[_0x70cc('0x39')](_0x377f85[_0x70cc('0x38')]);_0x4cbd0c['filters']=_[_0x70cc('0x3b')](_0x4cbd0c[_0x70cc('0x37')],_0x4cbd0c[_0x70cc('0x38')]);_0x179185[_0x70cc('0x3c')]=_[_0x70cc('0x3b')](_0x4cbd0c[_0x70cc('0x37')],qs[_0x70cc('0x3d')](_0x377f85['query'][_0x70cc('0x3d')]));_0x179185[_0x70cc('0x3c')]=_0x179185['attributes'][_0x70cc('0x4b')]?_0x179185[_0x70cc('0x3c')]:_0x4cbd0c[_0x70cc('0x37')];if(_0x377f85[_0x70cc('0x38')][_0x70cc('0x46')]){_0x179185[_0x70cc('0x4c')]=[{'all':!![]}];}_0x179185=_[_0x70cc('0x44')]({},_0x179185,_0x377f85[_0x70cc('0x45')]);return db['CmList'][_0x70cc('0x4d')](_0x179185)[_0x70cc('0x2b')](handleEntityNotFound(_0x2b9661,null))[_0x70cc('0x2b')](respondWithResult(_0x2b9661,null))['catch'](handleError(_0x2b9661,null));};exports[_0x70cc('0x4e')]=function(_0x1897c0,_0x529af9){return db[_0x70cc('0x32')][_0x70cc('0x4e')](_0x1897c0[_0x70cc('0x4f')],{})['then'](function(_0x4e41a4){var _0x4e1d74=_0x1897c0[_0x70cc('0x50')]['get']({'plain':!![]});if(!_0x4e1d74)throw new Error(_0x70cc('0x51'));if(_0x4e1d74['role']===_0x70cc('0x50')){var _0x51a233=_0x4e41a4[_0x70cc('0x29')]({'plain':!![]});var _0x914305=_0x70cc('0x52');return db[_0x70cc('0x53')]['find']({'where':{'name':_0x914305,'userProfileId':_0x4e1d74[_0x70cc('0x54')]},'raw':!![]})[_0x70cc('0x2b')](function(_0x5d6000){if(_0x5d6000&&_0x5d6000[_0x70cc('0x55')]===0x0){return db[_0x70cc('0x2a')][_0x70cc('0x4e')]({'name':_0x51a233[_0x70cc('0x2e')],'resourceId':_0x51a233['id'],'type':_0x5d6000[_0x70cc('0x2e')],'sectionId':_0x5d6000['id']},{})[_0x70cc('0x2b')](function(){return _0x4e41a4;});}else{return _0x4e41a4;}})[_0x70cc('0x56')](function(_0x4cf8a7){logger['error'](_0x70cc('0x57'),_0x4cf8a7);throw _0x4cf8a7;});}return _0x4e41a4;})['then'](respondWithResult(_0x529af9,0xc9))[_0x70cc('0x56')](handleError(_0x529af9,null));};exports[_0x70cc('0x27')]=function(_0x13f048,_0x1c8648){if(_0x13f048[_0x70cc('0x4f')]['id']){delete _0x13f048[_0x70cc('0x4f')]['id'];}return db[_0x70cc('0x32')][_0x70cc('0x4d')]({'where':{'id':_0x13f048[_0x70cc('0x4a')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x1c8648,null))[_0x70cc('0x2b')](saveUpdates(_0x13f048[_0x70cc('0x4f')],null))[_0x70cc('0x2b')](respondWithResult(_0x1c8648,null))[_0x70cc('0x56')](handleError(_0x1c8648,null));};exports[_0x70cc('0x28')]=function(_0x1968a7,_0x360eb3){return db[_0x70cc('0x32')][_0x70cc('0x4d')]({'where':{'id':_0x1968a7[_0x70cc('0x4a')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x360eb3,null))[_0x70cc('0x2b')](removeEntity(_0x360eb3,null))[_0x70cc('0x56')](handleError(_0x360eb3,null));};exports[_0x70cc('0x58')]=function(_0x359257,_0x304063){return db[_0x70cc('0x32')][_0x70cc('0x58')]()[_0x70cc('0x2b')](respondWithResult(_0x304063,null))[_0x70cc('0x56')](handleError(_0x304063,null));};exports[_0x70cc('0x59')]=function(_0x47a681,_0x53598e,_0x5594c5){if(_0x47a681['body']['id']){delete _0x47a681[_0x70cc('0x4f')]['id'];}return db['CmList'][_0x70cc('0x4d')]({'where':{'id':_0x47a681[_0x70cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53598e,null))[_0x70cc('0x2b')](function(_0x17cde0){if(_0x17cde0){_0x47a681[_0x70cc('0x4f')][_0x70cc('0x5a')]=_0x17cde0['id'];return db['Disposition']['create'](_0x47a681[_0x70cc('0x4f')]);}})[_0x70cc('0x2b')](respondWithResult(_0x53598e,null))['catch'](handleError(_0x53598e,null));};exports[_0x70cc('0x5b')]=function(_0x1a1040,_0x32cb3d,_0xa89fbb){var _0x4b5bb0={'raw':![],'where':{}};var _0x248037={};var _0x300327={'count':0x0,'rows':[]};return db[_0x70cc('0x32')][_0x70cc('0x5c')]({'where':{'id':_0x1a1040[_0x70cc('0x4a')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x32cb3d,null))[_0x70cc('0x2b')](function(_0x445441){if(_0x445441){_0x248037[_0x70cc('0x37')]=_[_0x70cc('0x39')](db[_0x70cc('0x5d')][_0x70cc('0x33')]);_0x248037[_0x70cc('0x38')]=_[_0x70cc('0x39')](_0x1a1040[_0x70cc('0x38')]);_0x248037[_0x70cc('0x3a')]=_[_0x70cc('0x3b')](_0x248037[_0x70cc('0x37')],_0x248037['query']);_0x4b5bb0[_0x70cc('0x3c')]=_[_0x70cc('0x3b')](_0x248037['model'],qs[_0x70cc('0x3d')](_0x1a1040[_0x70cc('0x38')][_0x70cc('0x3d')]));_0x4b5bb0[_0x70cc('0x3c')]=_0x4b5bb0[_0x70cc('0x3c')][_0x70cc('0x4b')]?_0x4b5bb0[_0x70cc('0x3c')]:_0x248037['model'];if(!_0x1a1040['query'][_0x70cc('0x5e')]('nolimit')){_0x4b5bb0['limit']=qs['limit'](_0x1a1040[_0x70cc('0x38')][_0x70cc('0x3e')]);_0x4b5bb0[_0x70cc('0x20')]=qs[_0x70cc('0x20')](_0x1a1040[_0x70cc('0x38')][_0x70cc('0x20')]);}_0x4b5bb0['order']=qs[_0x70cc('0x40')](_0x1a1040[_0x70cc('0x38')]['sort']);_0x4b5bb0[_0x70cc('0x41')]=qs[_0x70cc('0x3a')](_[_0x70cc('0x42')](_0x1a1040[_0x70cc('0x38')],_0x248037[_0x70cc('0x3a')]));_0x4b5bb0['where'][_0x70cc('0x5a')]=_0x445441['id'];if(_0x1a1040[_0x70cc('0x38')][_0x70cc('0x43')]){_0x4b5bb0[_0x70cc('0x41')]=_[_0x70cc('0x44')](_0x4b5bb0[_0x70cc('0x41')],{'$or':_[_0x70cc('0x31')](_0x4b5bb0[_0x70cc('0x3c')],function(_0xa6a3a8){var _0x4bdb68={};_0x4bdb68[_0xa6a3a8]={'$like':'%'+_0x1a1040[_0x70cc('0x38')][_0x70cc('0x43')]+'%'};return _0x4bdb68;})});}_0x4b5bb0=_['merge']({},_0x4b5bb0,_0x1a1040['options']);return db[_0x70cc('0x5d')][_0x70cc('0x22')]({'where':_0x4b5bb0[_0x70cc('0x41')]})[_0x70cc('0x2b')](function(_0x2c4c83){_0x300327['count']=_0x2c4c83;if(_0x1a1040[_0x70cc('0x38')][_0x70cc('0x46')]){_0x4b5bb0[_0x70cc('0x4c')]=[{'all':!![]}];}return db[_0x70cc('0x5d')]['findAll'](_0x4b5bb0);})['then'](function(_0x502040){_0x300327[_0x70cc('0x48')]=_0x502040;return _0x300327;});}})[_0x70cc('0x2b')](respondWithFilteredResult(_0x32cb3d,_0x4b5bb0))[_0x70cc('0x56')](handleError(_0x32cb3d,null));};exports['removeDispositions']=function(_0x36088c,_0x289c1b,_0x356cbe){return db[_0x70cc('0x32')][_0x70cc('0x4d')]({'where':{'id':_0x36088c[_0x70cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x289c1b,null))['then'](function(_0x482653){if(_0x482653){return _0x482653[_0x70cc('0x5f')](_0x36088c[_0x70cc('0x38')]['ids']);}})[_0x70cc('0x2b')](respondWithStatusCode(_0x289c1b,null))[_0x70cc('0x56')](handleError(_0x289c1b,null));};exports[_0x70cc('0x60')]=function(_0x3c5563,_0x326f2a,_0x264d0b){return db[_0x70cc('0x32')][_0x70cc('0x4d')]({'where':{'id':_0x3c5563['params']['id']}})['then'](handleEntityNotFound(_0x326f2a,null))['then'](function(_0x13e384){if(_0x13e384){var _0x5f56f0=[];var _0x2967e1={'success':[],'errors':[]};return db[_0x70cc('0x61')][_0x70cc('0x58')]()['then'](function(_0x39a15d){if(_0x3c5563[_0x70cc('0x4f')][_0x70cc('0x62')]&&_[_0x70cc('0x63')](_0x3c5563['body'][_0x70cc('0x62')])){if(_0x3c5563[_0x70cc('0x4f')]['tags'][_0x70cc('0x4b')]){_0x3c5563['body'][_0x70cc('0x62')]=_0x3c5563[_0x70cc('0x4f')][_0x70cc('0x62')][_0x70cc('0x64')](';')+';';}else{_0x3c5563['body'][_0x70cc('0x62')]=null;}}else{_0x3c5563[_0x70cc('0x4f')][_0x70cc('0x62')]=null;}if(_0x3c5563[_0x70cc('0x4f')]&&_['isArray'](_0x3c5563[_0x70cc('0x4f')])){for(var _0x341c09=0x0;_0x341c09<_0x3c5563[_0x70cc('0x4f')]['length'];_0x341c09+=0x1){_0x3c5563['body'][_0x341c09][_0x70cc('0x5a')]=_0x3c5563[_0x70cc('0x4a')]['id'];_0x5f56f0[_0x70cc('0x65')](_0x3c5563[_0x70cc('0x4f')][_0x341c09]);}return BPromise[_0x70cc('0x66')](_0x5f56f0,function(_0x158942){return db[_0x70cc('0x61')][_0x70cc('0x4e')](_[_0x70cc('0x67')](_0x158942,[_0x70cc('0x68'),'id'])||{},{'fields':_[_0x70cc('0x39')](_0x39a15d),'raw':!![]})[_0x70cc('0x2b')](function(_0x1e66cd){_0x2967e1['success'][_0x70cc('0x65')](_0x1e66cd['dataValues']);})[_0x70cc('0x56')](function(_0x319846){_0x2967e1[_0x70cc('0x69')][_0x70cc('0x65')]({'data':_0x158942,'error':_0x319846[_0x70cc('0x6a')]});});})['then'](function(_0x2e0058){return _0x2967e1;})[_0x70cc('0x56')](function(_0x38dfaa){return _0x38dfaa;});}else{_0x326f2a['status'](0x190)['json']({'message':_0x70cc('0x6b')});}});}})[_0x70cc('0x2b')](respondWithResult(_0x326f2a,null))[_0x70cc('0x56')](handleError(_0x326f2a,null));};exports[_0x70cc('0x6c')]=function(_0x332e36,_0x36acd7,_0x511c23){var _0x3aef96;return db[_0x70cc('0x32')]['find']({'where':{'id':_0x332e36[_0x70cc('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x70cc('0x6d')}]})['then'](handleEntityNotFound(_0x36acd7,null))[_0x70cc('0x2b')](function(_0x4ea9ae){if(_0x4ea9ae){_0x3aef96=_0x4ea9ae;return db[_0x70cc('0x61')][_0x70cc('0x33')];}})[_0x70cc('0x2b')](function(_0x4eeac2){if(_0x4eeac2){var _0x568f19={};var _0x5e75ab={};_0x5e75ab['model']=_[_0x70cc('0x6e')](_[_0x70cc('0x39')](_0x4eeac2),_[_0x70cc('0x31')](_0x3aef96[_0x70cc('0x6d')],function(_0x5c9a20){return util[_0x70cc('0x6f')](_0x70cc('0x70'),_0x5c9a20['id']);}));_0x5e75ab['query']=_['keys'](_0x332e36['query']);_0x5e75ab['filters']=_[_0x70cc('0x3b')](_0x5e75ab[_0x70cc('0x37')],_0x5e75ab['query']);_0x568f19[_0x70cc('0x3c')]=_[_0x70cc('0x3b')](_0x5e75ab[_0x70cc('0x37')],qs[_0x70cc('0x3d')](_0x332e36['query'][_0x70cc('0x3d')]));_0x568f19[_0x70cc('0x3c')]=_0x568f19[_0x70cc('0x3c')][_0x70cc('0x4b')]?_0x568f19[_0x70cc('0x3c')]:_0x5e75ab[_0x70cc('0x37')];if(!_0x332e36[_0x70cc('0x38')][_0x70cc('0x5e')](_0x70cc('0x71'))){_0x568f19[_0x70cc('0x3e')]=qs['limit'](_0x332e36[_0x70cc('0x38')][_0x70cc('0x3e')]);_0x568f19['offset']=qs[_0x70cc('0x20')](_0x332e36[_0x70cc('0x38')][_0x70cc('0x20')]);}_0x568f19[_0x70cc('0x3f')]=qs[_0x70cc('0x40')](_0x332e36['query'][_0x70cc('0x40')]);_0x568f19[_0x70cc('0x41')]=qs[_0x70cc('0x3a')](_['pick'](_0x332e36[_0x70cc('0x38')],_0x5e75ab[_0x70cc('0x3a')]));_0x568f19[_0x70cc('0x72')]=!![];if(_0x332e36[_0x70cc('0x38')][_0x70cc('0x43')]){_0x568f19[_0x70cc('0x41')]=_['merge'](_0x568f19[_0x70cc('0x41')],{'$or':_[_0x70cc('0x31')](_0x568f19[_0x70cc('0x3c')],function(_0x484bbd){var _0x3b3bb3={};_0x3b3bb3[_0x484bbd]={'$like':'%'+_0x332e36[_0x70cc('0x38')][_0x70cc('0x43')]+'%'};return _0x3b3bb3;})});}_0x568f19=_[_0x70cc('0x44')]({},_0x568f19,_0x332e36[_0x70cc('0x45')]);return _0x3aef96[_0x70cc('0x6c')](_0x568f19);}})[_0x70cc('0x2b')](respondWithResult(_0x36acd7,null))[_0x70cc('0x56')](handleError(_0x36acd7,null));};exports[_0x70cc('0x73')]=function(_0x431f8d,_0x21b463,_0x1c519f){var _0xd4eaa7;var _0x59ef06;var _0x43ef04;var _0x1eada0=_0x431f8d[_0x70cc('0x4a')]['id'];csv_results=[];return db[_0x70cc('0x74')][_0x70cc('0x47')]({'attributes':['id',_0x70cc('0x2e')],'raw':!![],'order':['OrderBy']})[_0x70cc('0x2b')](function(_0xf11d14){_0xd4eaa7=_0xf11d14;var _0x223664=_[_0x70cc('0x39')](db[_0x70cc('0x61')][_0x70cc('0x33')]);return db[_0x70cc('0x75')][_0x70cc('0x47')]({'raw':!![],'attributes':['id',_0x70cc('0x76')]})[_0x70cc('0x2b')](function(_0x449b21){_0x59ef06=_0x449b21;var _0x5d9bfb=squel[_0x70cc('0x77')]()[_0x70cc('0x3d')](_0x223664)[_0x70cc('0x78')](_0x70cc('0x79'),'c')['where'](_0x70cc('0x7a'),_0x1eada0)[_0x70cc('0x41')](_0x70cc('0x7b'))[_0x70cc('0x7c')]();for(var _0x58c422=0x0;_0x58c422<_0x59ef06['length'];_0x58c422++){_0x5d9bfb[_0x70cc('0x7d')](_0x70cc('0x7e')+_0x59ef06[_0x58c422]['id'],_0x70cc('0x7f')+_0x59ef06[_0x58c422][_0x70cc('0x76')]);}for(var _0x58c422=0x0;_0x58c422<_0xd4eaa7[_0x70cc('0x4b')];_0x58c422++){_0x5d9bfb[_0x70cc('0x7d')](squel['select']()[_0x70cc('0x7d')](_0x70cc('0x80'))[_0x70cc('0x78')](_0x70cc('0x81'))[_0x70cc('0x41')]('ItemTypeId\x20=\x20?',_0xd4eaa7[_0x58c422]['id'])[_0x70cc('0x41')](_0x70cc('0x82')),'additionalPhone_'+_0xd4eaa7[_0x58c422][_0x70cc('0x2e')]);_0x5d9bfb[_0x70cc('0x7d')](squel['select']()[_0x70cc('0x7d')](_0x70cc('0x83'))['from'](_0x70cc('0x81'))['where']('ItemTypeId\x20=\x20?',_0xd4eaa7[_0x58c422]['id'])[_0x70cc('0x41')]('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0xd4eaa7[_0x58c422][_0x70cc('0x2e')]);}var _0x1e16f7=[];_0x1e16f7['push'](_0x5d9bfb[_0x70cc('0x84')]());BPromise[_0x70cc('0x66')](_0x1e16f7,handleQuery)[_0x70cc('0x2b')](function(_0x38aecc){handleQuery(_0x5d9bfb['toString']());var _0x5744a4=csv_results[0x0];if(!_[_0x70cc('0x85')](_0x5744a4)){var _0x536c25=toCsv(_0x5744a4);var _0x598d37=Date[_0x70cc('0x86')]();fs[_0x70cc('0x87')](util['format'](_0x70cc('0x88'),_0x1eada0,_0x598d37),_0x536c25);_0x21b463[_0x70cc('0x89')](_0x70cc('0x8a'),_0x70cc('0x8b')+util[_0x70cc('0x6f')](_0x70cc('0x8c'),_0x1eada0,_0x598d37));_0x21b463[_0x70cc('0x89')](_0x70cc('0x8d'),'text/csv');return _0x21b463['download'](util[_0x70cc('0x6f')](_0x70cc('0x88'),_0x1eada0,_0x598d37));}else{return _0x21b463[_0x70cc('0x1c')](0xcc);}});});});};exports[_0x70cc('0x8e')]=function(_0x272c98,_0x1dcd02,_0xdb1ca8){var _0x27901d;delete _0x272c98['body']['id'];return db['CmList'][_0x70cc('0x5c')]({'where':{'id':_0x272c98[_0x70cc('0x4a')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x1dcd02,null))['then'](function(_0x4cb9fb){if(_0x4cb9fb){return db[_0x70cc('0x8f')][_0x70cc('0x90')](function(_0x3cda0f){return db[_0x70cc('0x75')][_0x70cc('0x4e')](_0x272c98[_0x70cc('0x4f')],{'transaction':_0x3cda0f})[_0x70cc('0x2b')](function(_0x5f3916){_0x27901d=_0x5f3916;return _0x4cb9fb['addCustomFields'](_0x5f3916,{'transaction':_0x3cda0f});})[_0x70cc('0x2b')](function(){var _0x41962d={'type':db[_0x70cc('0x91')][_0x70cc('0x92')],'transaction':_0x3cda0f};switch(_0x272c98[_0x70cc('0x4f')][_0x70cc('0x35')]){case'text':_0x41962d[_0x70cc('0x35')]=db[_0x70cc('0x91')][_0x70cc('0x92')];break;case _0x70cc('0x93'):_0x41962d[_0x70cc('0x35')]=db[_0x70cc('0x91')][_0x70cc('0x94')];break;case _0x70cc('0x95'):_0x41962d[_0x70cc('0x35')]=db[_0x70cc('0x91')]['BOOLEAN'];_0x41962d[_0x70cc('0x96')]=![];break;default:}return db[_0x70cc('0x8f')][_0x70cc('0x97')]['addColumn'](_0x70cc('0x79'),util[_0x70cc('0x6f')](_0x70cc('0x98'),_0x27901d['id']),_0x41962d);})[_0x70cc('0x2b')](function(){return _0x27901d;});});}})[_0x70cc('0x2b')](respondWithResult(_0x1dcd02,null))[_0x70cc('0x56')](handleError(_0x1dcd02,null));};exports[_0x70cc('0x99')]=function(_0x24657b,_0x5c9e1a,_0x1043ac){var _0x2a5d2a={};var _0xad2605={};var _0x3e7160;var _0x482bce;return db['CmList'][_0x70cc('0x5c')]({'where':{'id':_0x24657b['params']['id']}})['then'](handleEntityNotFound(_0x5c9e1a,null))[_0x70cc('0x2b')](function(_0x5d3b29){if(_0x5d3b29){_0x3e7160=_0x5d3b29;_0xad2605[_0x70cc('0x37')]=_[_0x70cc('0x39')](db[_0x70cc('0x75')][_0x70cc('0x33')]);_0xad2605[_0x70cc('0x38')]=_[_0x70cc('0x39')](_0x24657b[_0x70cc('0x38')]);_0xad2605[_0x70cc('0x3a')]=_[_0x70cc('0x3b')](_0xad2605[_0x70cc('0x37')],_0xad2605[_0x70cc('0x38')]);_0x2a5d2a[_0x70cc('0x3c')]=_[_0x70cc('0x3b')](_0xad2605[_0x70cc('0x37')],qs[_0x70cc('0x3d')](_0x24657b[_0x70cc('0x38')][_0x70cc('0x3d')]));_0x2a5d2a[_0x70cc('0x3c')]=_0x2a5d2a[_0x70cc('0x3c')][_0x70cc('0x4b')]?_0x2a5d2a['attributes']:_0xad2605[_0x70cc('0x37')];_0x2a5d2a['order']=qs[_0x70cc('0x40')](_0x24657b['query'][_0x70cc('0x40')]);_0x2a5d2a['where']=qs['filters'](_['pick'](_0x24657b[_0x70cc('0x38')],_0xad2605['filters']));_0x2a5d2a[_0x70cc('0x41')]=_[_0x70cc('0x44')](_0x2a5d2a[_0x70cc('0x41')],{'$or':[{'ListId':_0x5d3b29['id']},{'ListId':null}]});if(_0x24657b[_0x70cc('0x38')][_0x70cc('0x43')]){_0x2a5d2a['where']=_['merge'](_0x2a5d2a['where'],{'$or':_[_0x70cc('0x31')](_0x2a5d2a['attributes'],function(_0x12c429){var _0xbfc14={};_0xbfc14[_0x12c429]={'$like':'%'+_0x24657b[_0x70cc('0x38')]['filter']+'%'};return _0xbfc14;})});}_0x2a5d2a=_[_0x70cc('0x44')]({},_0x2a5d2a,_0x24657b['options']);return db['CmCustomField'][_0x70cc('0x9a')](_0x2a5d2a);}})[_0x70cc('0x2b')](respondWithResult(_0x5c9e1a,null))[_0x70cc('0x56')](handleError(_0x5c9e1a,null));};exports['getGlobalCustomFields']=function(_0x1c7f36,_0x579e07){return db['CmCustomField'][_0x70cc('0x9a')]({'where':{'ListId':null}})[_0x70cc('0x2b')](handleEntityNotFound(_0x579e07,null))['then'](function(_0x45d3e4){return _0x45d3e4;})[_0x70cc('0x2b')](respondWithResult(_0x579e07,null))[_0x70cc('0x56')](handleError(_0x579e07,null));};exports[_0x70cc('0x9b')]=function(_0x3366cd,_0x5e570b,_0x1e36b7){return db[_0x70cc('0x32')][_0x70cc('0x4d')]({'where':{'id':_0x3366cd[_0x70cc('0x4a')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x5e570b,null))[_0x70cc('0x2b')](function(_0x2efae0){if(_0x2efae0){return _0x2efae0[_0x70cc('0x9b')](_0x3366cd[_0x70cc('0x4f')][_0x70cc('0x68')],_[_0x70cc('0x67')](_0x3366cd[_0x70cc('0x4f')],[_0x70cc('0x68'),'id'])||{})[_0x70cc('0x9c')](function(_0x657a83){for(var _0x3dc094=0x0;_0x3dc094<_0x3366cd['body'][_0x70cc('0x68')][_0x70cc('0x4b')];_0x3dc094+=0x1){socket[_0x70cc('0x9d')](_0x70cc('0x9e'),{'UserId':Number(_0x3366cd[_0x70cc('0x4f')][_0x70cc('0x68')][_0x3dc094]),'CmListId':Number(_0x3366cd[_0x70cc('0x4a')]['id'])});}return _0x657a83;});}})['then'](respondWithResult(_0x5e570b,null))[_0x70cc('0x56')](handleError(_0x5e570b,null));};exports[_0x70cc('0x9f')]=function(_0x4800e0,_0x5674c2,_0x347a89){return db[_0x70cc('0x32')]['find']({'where':{'id':_0x4800e0['params']['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x5674c2,null))['then'](function(_0x3bf8c9){if(_0x3bf8c9){return _0x3bf8c9[_0x70cc('0x9f')](_0x4800e0['query'][_0x70cc('0x68')])[_0x70cc('0x2b')](function(){if(_[_0x70cc('0x63')](_0x4800e0[_0x70cc('0x38')][_0x70cc('0x68')])){for(var _0x39acc2=0x0;_0x39acc2<_0x4800e0[_0x70cc('0x38')]['ids'][_0x70cc('0x4b')];_0x39acc2+=0x1){socket['emit'](_0x70cc('0xa0'),{'UserId':Number(_0x4800e0[_0x70cc('0x38')][_0x70cc('0x68')][_0x39acc2]),'CmListId':Number(_0x4800e0[_0x70cc('0x4a')]['id'])});}}else{socket[_0x70cc('0x9d')](_0x70cc('0xa0'),{'UserId':Number(_0x4800e0[_0x70cc('0x38')][_0x70cc('0x68')]),'CmListId':Number(_0x4800e0[_0x70cc('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5674c2,null))[_0x70cc('0x56')](handleError(_0x5674c2,null));};exports[_0x70cc('0xa1')]=function(_0xa18228,_0x516731,_0xabde91){var _0x43a5b2={};var _0x15c6d2={};var _0xdd81fb;var _0xc64deb;return db[_0x70cc('0x32')][_0x70cc('0x5c')]({'where':{'id':_0xa18228[_0x70cc('0x4a')]['id']}})[_0x70cc('0x2b')](handleEntityNotFound(_0x516731,null))[_0x70cc('0x2b')](function(_0x4be4c4){if(_0x4be4c4){_0xdd81fb=_0x4be4c4;_0x15c6d2[_0x70cc('0x37')]=_[_0x70cc('0x39')](db[_0x70cc('0xa2')][_0x70cc('0x33')]);_0x15c6d2[_0x70cc('0x38')]=_['keys'](_0xa18228[_0x70cc('0x38')]);_0x15c6d2[_0x70cc('0x3a')]=_[_0x70cc('0x3b')](_0x15c6d2[_0x70cc('0x37')],_0x15c6d2[_0x70cc('0x38')]);_0x43a5b2[_0x70cc('0x3c')]=_[_0x70cc('0x3b')](_0x15c6d2['model'],qs[_0x70cc('0x3d')](_0xa18228[_0x70cc('0x38')]['fields']));_0x43a5b2[_0x70cc('0x3c')]=_0x43a5b2[_0x70cc('0x3c')][_0x70cc('0x4b')]?_0x43a5b2[_0x70cc('0x3c')]:_0x15c6d2[_0x70cc('0x37')];_0x43a5b2[_0x70cc('0x3f')]=qs[_0x70cc('0x40')](_0xa18228[_0x70cc('0x38')][_0x70cc('0x40')]);_0x43a5b2[_0x70cc('0x41')]=qs[_0x70cc('0x3a')](_[_0x70cc('0x42')](_0xa18228[_0x70cc('0x38')],_0x15c6d2[_0x70cc('0x3a')]));if(_0xa18228[_0x70cc('0x38')][_0x70cc('0x43')]){_0x43a5b2[_0x70cc('0x41')]=_[_0x70cc('0x44')](_0x43a5b2[_0x70cc('0x41')],{'$or':_[_0x70cc('0x31')](_0x43a5b2[_0x70cc('0x3c')],function(_0x86e28){var _0x35ef3d={};_0x35ef3d[_0x86e28]={'$like':'%'+_0xa18228[_0x70cc('0x38')][_0x70cc('0x43')]+'%'};return _0x35ef3d;})});}_0x43a5b2=_[_0x70cc('0x44')]({},_0x43a5b2,_0xa18228[_0x70cc('0x45')]);return _0xdd81fb[_0x70cc('0xa1')](_0x43a5b2);}})[_0x70cc('0x2b')](function(_0x242795){if(_0x242795){_0xc64deb=_0x242795[_0x70cc('0x4b')];if(!_0xa18228[_0x70cc('0x38')][_0x70cc('0x5e')](_0x70cc('0x71'))){_0x43a5b2[_0x70cc('0x3e')]=qs[_0x70cc('0x3e')](_0xa18228[_0x70cc('0x38')][_0x70cc('0x3e')]);_0x43a5b2['offset']=qs[_0x70cc('0x20')](_0xa18228[_0x70cc('0x38')][_0x70cc('0x20')]);}return _0xdd81fb[_0x70cc('0xa1')](_0x43a5b2);}})[_0x70cc('0x2b')](function(_0x555a2e){if(_0x555a2e){return _0x555a2e?{'count':_0xc64deb,'rows':_0x555a2e}:null;}})[_0x70cc('0x2b')](respondWithResult(_0x516731,null))[_0x70cc('0x56')](handleError(_0x516731,null));};function handleQuery(_0x358090){logger[_0x70cc('0xa3')](_0x358090);return db[_0x70cc('0x8f')][_0x70cc('0x38')](_0x358090)[_0x70cc('0x9c')](function(_0x549934){csv_results[_0x70cc('0x65')](_0x549934);})[_0x70cc('0x56')](function(_0x45f208){logger[_0x70cc('0x2c')](_0x45f208['message']);});} \ No newline at end of file +var _0x275d=['omit','ids','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','getContactsCsv','ContactItemType','findAll','OrderBy','alias','select','from','c.deletedAt\x20is\x20null','field','c.cf_','item','CmContactId\x20=\x20c.id','description','cm_contact_has_items','ItemTypeId\x20=\x20?','toString','each','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','User','getAgents','info','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','stack','name','send','index','CmList','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','sort','filter','removeDispositions','addContacts','CmContact','tags','isArray','join','push'];(function(_0x161ab6,_0x51ee5c){var _0x437d12=function(_0x38002d){while(--_0x38002d){_0x161ab6['push'](_0x161ab6['shift']());}};_0x437d12(++_0x51ee5c);}(_0x275d,0x185));var _0xd275=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0x275d[_0x57474e];return _0xfaae8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd275('0x0'));var rp=require(_0xd275('0x1'));var moment=require(_0xd275('0x2'));var BPromise=require(_0xd275('0x3'));var Mustache=require('mustache');var util=require(_0xd275('0x4'));var path=require(_0xd275('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd275('0x6'));var squel=require(_0xd275('0x7'));var crypto=require(_0xd275('0x8'));var jsforce=require(_0xd275('0x9'));var deskjs=require(_0xd275('0xa'));var toCsv=require(_0xd275('0xb'));var querystring=require(_0xd275('0xc'));var Papa=require('papaparse');var Redis=require(_0xd275('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd275('0xe'));var hardwareService=require(_0xd275('0xf'));var logger=require(_0xd275('0x10'))(_0xd275('0x11'));var utils=require(_0xd275('0x12'));var config=require(_0xd275('0x13'));var licenseUtil=require(_0xd275('0x14'));var db=require(_0xd275('0x15'))['db'];var csv_results;config[_0xd275('0x16')]=_['defaults'](config[_0xd275('0x16')],{'host':_0xd275('0x17'),'port':0x18eb});var socket=require(_0xd275('0x18'))(new Redis(config[_0xd275('0x16')]));require('./cmList.socket')[_0xd275('0x19')](socket);function respondWithStatusCode(_0x13064b,_0x38915a){_0x38915a=_0x38915a||0xcc;return function(_0x47b809){if(_0x47b809){return _0x13064b[_0xd275('0x1a')](_0x38915a);}return _0x13064b['status'](_0x38915a)[_0xd275('0x1b')]();};}function respondWithResult(_0x19e02c,_0x47db15){_0x47db15=_0x47db15||0xc8;return function(_0x87fb25){if(_0x87fb25){return _0x19e02c[_0xd275('0x1c')](_0x47db15)[_0xd275('0x1d')](_0x87fb25);}};}function respondWithFilteredResult(_0x4e33a1,_0x4a385b){return function(_0x21da11){if(_0x21da11){var _0x1bacb8=typeof _0x4a385b[_0xd275('0x1e')]===_0xd275('0x1f')&&typeof _0x4a385b[_0xd275('0x20')]===_0xd275('0x1f');var _0x1ecd6b=_0x21da11[_0xd275('0x21')];var _0x5dc440=_0x1bacb8?0x0:_0x4a385b[_0xd275('0x1e')];var _0x509be3=_0x1bacb8?_0x21da11['count']:_0x4a385b[_0xd275('0x1e')]+_0x4a385b[_0xd275('0x20')];var _0x4cc752;if(_0x509be3>=_0x1ecd6b){_0x509be3=_0x1ecd6b;_0x4cc752=0xc8;}else{_0x4cc752=0xce;}_0x4e33a1[_0xd275('0x1c')](_0x4cc752);return _0x4e33a1[_0xd275('0x22')](_0xd275('0x23'),_0x5dc440+'-'+_0x509be3+'/'+_0x1ecd6b)[_0xd275('0x1d')](_0x21da11);}return null;};}function patchUpdates(_0x5df8a){return function(_0x5c73ed){try{jsonpatch[_0xd275('0x24')](_0x5c73ed,_0x5df8a,!![]);}catch(_0x86aef7){return BPromise[_0xd275('0x25')](_0x86aef7);}return _0x5c73ed[_0xd275('0x26')]();};}function saveUpdates(_0x23bf82,_0x5d1377){return function(_0x35c352){if(_0x35c352){return _0x35c352[_0xd275('0x27')](_0x23bf82)[_0xd275('0x28')](function(_0xca7b3){return _0xca7b3;});}return null;};}function removeEntity(_0x255f62,_0x1b59b4){return function(_0x18567f){if(_0x18567f){return _0x18567f['destroy']()[_0xd275('0x28')](function(){var _0x4c2897=_0x18567f[_0xd275('0x29')]({'plain':!![]});var _0xa00b6d=_0xd275('0x2a');return db[_0xd275('0x2b')][_0xd275('0x2c')]({'where':{'type':_0xa00b6d,'resourceId':_0x4c2897['id']}})['then'](function(){return _0x18567f;});})[_0xd275('0x28')](function(){_0x255f62[_0xd275('0x1c')](0xcc)[_0xd275('0x1b')]();});}};}function handleEntityNotFound(_0x4987c2,_0x5d1eb1){return function(_0x346c06){if(!_0x346c06){_0x4987c2[_0xd275('0x1a')](0x194);}return _0x346c06;};}function handleError(_0x56a8d9,_0x5668f7){_0x5668f7=_0x5668f7||0x1f4;return function(_0x21ed31){logger['error'](_0x21ed31[_0xd275('0x2d')]);if(_0x21ed31[_0xd275('0x2e')]){delete _0x21ed31[_0xd275('0x2e')];}_0x56a8d9[_0xd275('0x1c')](_0x5668f7)[_0xd275('0x2f')](_0x21ed31);};}exports[_0xd275('0x30')]=function(_0x4d6c3c,_0x670d4e){var _0x4e51b1={},_0x3d1362={},_0x289453={'count':0x0,'rows':[]};var _0x308dc0=_['map'](db[_0xd275('0x31')][_0xd275('0x32')],function(_0x8fd940){return{'name':_0x8fd940[_0xd275('0x33')],'type':_0x8fd940['type'][_0xd275('0x34')]};});_0x3d1362[_0xd275('0x35')]=_[_0xd275('0x36')](_0x308dc0,_0xd275('0x2e'));_0x3d1362[_0xd275('0x37')]=_['keys'](_0x4d6c3c[_0xd275('0x37')]);_0x3d1362[_0xd275('0x38')]=_[_0xd275('0x39')](_0x3d1362['model'],_0x3d1362[_0xd275('0x37')]);_0x4e51b1['attributes']=_[_0xd275('0x39')](_0x3d1362[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x4d6c3c['query']['fields']));_0x4e51b1[_0xd275('0x3b')]=_0x4e51b1[_0xd275('0x3b')][_0xd275('0x3c')]?_0x4e51b1['attributes']:_0x3d1362['model'];if(!_0x4d6c3c[_0xd275('0x37')]['hasOwnProperty'](_0xd275('0x3d'))){_0x4e51b1[_0xd275('0x20')]=qs[_0xd275('0x20')](_0x4d6c3c['query'][_0xd275('0x20')]);_0x4e51b1['offset']=qs[_0xd275('0x1e')](_0x4d6c3c[_0xd275('0x37')][_0xd275('0x1e')]);}_0x4e51b1[_0xd275('0x3e')]=qs['sort'](_0x4d6c3c[_0xd275('0x37')]['sort']);_0x4e51b1[_0xd275('0x3f')]=qs['filters'](_[_0xd275('0x40')](_0x4d6c3c['query'],_0x3d1362[_0xd275('0x38')]),_0x308dc0);if(_0x4d6c3c['query']['filter']){_0x4e51b1['where']=_[_0xd275('0x41')](_0x4e51b1[_0xd275('0x3f')],{'$or':_[_0xd275('0x36')](_0x308dc0,function(_0xae99f7){if(_0xae99f7[_0xd275('0x42')]!==_0xd275('0x43')){var _0x45c69c={};_0x45c69c[_0xae99f7['name']]={'$like':'%'+_0x4d6c3c[_0xd275('0x37')]['filter']+'%'};return _0x45c69c;}})});}_0x4e51b1=_[_0xd275('0x41')]({},_0x4e51b1,_0x4d6c3c[_0xd275('0x44')]);var _0x261c41={'where':_0x4e51b1[_0xd275('0x3f')]};return db['CmList'][_0xd275('0x21')](_0x261c41)[_0xd275('0x28')](function(_0x426fee){_0x289453[_0xd275('0x21')]=_0x426fee;if(_0x4d6c3c[_0xd275('0x37')][_0xd275('0x45')]){_0x4e51b1[_0xd275('0x46')]=[{'all':!![]}];}return db[_0xd275('0x31')]['findAll'](_0x4e51b1);})[_0xd275('0x28')](function(_0x460701){_0x289453[_0xd275('0x47')]=_0x460701;return _0x289453;})[_0xd275('0x28')](respondWithFilteredResult(_0x670d4e,_0x4e51b1))[_0xd275('0x48')](handleError(_0x670d4e,null));};exports[_0xd275('0x49')]=function(_0x38bd68,_0x477fd8){var _0x1e70cf={'raw':![],'where':{'id':_0x38bd68[_0xd275('0x4a')]['id']}},_0x4de4be={};_0x4de4be[_0xd275('0x35')]=_[_0xd275('0x4b')](db[_0xd275('0x31')][_0xd275('0x32')]);_0x4de4be[_0xd275('0x37')]=_[_0xd275('0x4b')](_0x38bd68[_0xd275('0x37')]);_0x4de4be[_0xd275('0x38')]=_[_0xd275('0x39')](_0x4de4be[_0xd275('0x35')],_0x4de4be['query']);_0x1e70cf[_0xd275('0x3b')]=_[_0xd275('0x39')](_0x4de4be[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x38bd68[_0xd275('0x37')][_0xd275('0x3a')]));_0x1e70cf[_0xd275('0x3b')]=_0x1e70cf[_0xd275('0x3b')][_0xd275('0x3c')]?_0x1e70cf['attributes']:_0x4de4be[_0xd275('0x35')];if(_0x38bd68['query'][_0xd275('0x45')]){_0x1e70cf['include']=[{'all':!![]}];}_0x1e70cf=_[_0xd275('0x41')]({},_0x1e70cf,_0x38bd68[_0xd275('0x44')]);return db[_0xd275('0x31')][_0xd275('0x4c')](_0x1e70cf)[_0xd275('0x28')](handleEntityNotFound(_0x477fd8,null))[_0xd275('0x28')](respondWithResult(_0x477fd8,null))[_0xd275('0x48')](handleError(_0x477fd8,null));};exports[_0xd275('0x4d')]=function(_0x33d1ee,_0x5f4042){return db[_0xd275('0x31')][_0xd275('0x4d')](_0x33d1ee[_0xd275('0x4e')],{})['then'](function(_0x49d26f){var _0x55085b=_0x33d1ee[_0xd275('0x4f')][_0xd275('0x29')]({'plain':!![]});if(!_0x55085b)throw new Error(_0xd275('0x50'));if(_0x55085b['role']===_0xd275('0x4f')){var _0x3bb6fe=_0x49d26f[_0xd275('0x29')]({'plain':!![]});var _0x118702='Lists';return db['UserProfileSection'][_0xd275('0x4c')]({'where':{'name':_0x118702,'userProfileId':_0x55085b[_0xd275('0x51')]},'raw':!![]})[_0xd275('0x28')](function(_0x9c37bf){if(_0x9c37bf&&_0x9c37bf[_0xd275('0x52')]===0x0){return db[_0xd275('0x2b')][_0xd275('0x4d')]({'name':_0x3bb6fe[_0xd275('0x2e')],'resourceId':_0x3bb6fe['id'],'type':_0x9c37bf[_0xd275('0x2e')],'sectionId':_0x9c37bf['id']},{})[_0xd275('0x28')](function(){return _0x49d26f;});}else{return _0x49d26f;}})[_0xd275('0x48')](function(_0x1c176f){logger[_0xd275('0x53')](_0xd275('0x54'),_0x1c176f);throw _0x1c176f;});}return _0x49d26f;})[_0xd275('0x28')](respondWithResult(_0x5f4042,0xc9))[_0xd275('0x48')](handleError(_0x5f4042,null));};exports[_0xd275('0x27')]=function(_0x43ac5e,_0x3ed22b){if(_0x43ac5e[_0xd275('0x4e')]['id']){delete _0x43ac5e[_0xd275('0x4e')]['id'];}return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x43ac5e[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x3ed22b,null))[_0xd275('0x28')](saveUpdates(_0x43ac5e[_0xd275('0x4e')],null))['then'](respondWithResult(_0x3ed22b,null))[_0xd275('0x48')](handleError(_0x3ed22b,null));};exports[_0xd275('0x2c')]=function(_0x47cb9f,_0x3d755d){return db['CmList'][_0xd275('0x4c')]({'where':{'id':_0x47cb9f['params']['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x3d755d,null))[_0xd275('0x28')](removeEntity(_0x3d755d,null))['catch'](handleError(_0x3d755d,null));};exports[_0xd275('0x55')]=function(_0x10e19b,_0x4d8d68){return db[_0xd275('0x31')][_0xd275('0x55')]()[_0xd275('0x28')](respondWithResult(_0x4d8d68,null))['catch'](handleError(_0x4d8d68,null));};exports[_0xd275('0x56')]=function(_0x12c9e3,_0x10f4aa,_0x22b216){if(_0x12c9e3[_0xd275('0x4e')]['id']){delete _0x12c9e3[_0xd275('0x4e')]['id'];}return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x12c9e3[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x10f4aa,null))[_0xd275('0x28')](function(_0x5e5298){if(_0x5e5298){_0x12c9e3[_0xd275('0x4e')][_0xd275('0x57')]=_0x5e5298['id'];return db[_0xd275('0x58')][_0xd275('0x4d')](_0x12c9e3['body']);}})['then'](respondWithResult(_0x10f4aa,null))['catch'](handleError(_0x10f4aa,null));};exports[_0xd275('0x59')]=function(_0x3c0d7b,_0x4c6eda,_0x2026af){var _0x5bd2ff={'raw':![],'where':{}};var _0x999ad7={};var _0x1cf50f={'count':0x0,'rows':[]};return db[_0xd275('0x31')][_0xd275('0x5a')]({'where':{'id':_0x3c0d7b[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x4c6eda,null))['then'](function(_0x98a95a){if(_0x98a95a){_0x999ad7[_0xd275('0x35')]=_[_0xd275('0x4b')](db['Disposition'][_0xd275('0x32')]);_0x999ad7[_0xd275('0x37')]=_['keys'](_0x3c0d7b['query']);_0x999ad7[_0xd275('0x38')]=_[_0xd275('0x39')](_0x999ad7[_0xd275('0x35')],_0x999ad7[_0xd275('0x37')]);_0x5bd2ff['attributes']=_['intersection'](_0x999ad7[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x3c0d7b[_0xd275('0x37')]['fields']));_0x5bd2ff[_0xd275('0x3b')]=_0x5bd2ff[_0xd275('0x3b')][_0xd275('0x3c')]?_0x5bd2ff[_0xd275('0x3b')]:_0x999ad7[_0xd275('0x35')];if(!_0x3c0d7b[_0xd275('0x37')]['hasOwnProperty'](_0xd275('0x3d'))){_0x5bd2ff[_0xd275('0x20')]=qs[_0xd275('0x20')](_0x3c0d7b[_0xd275('0x37')][_0xd275('0x20')]);_0x5bd2ff[_0xd275('0x1e')]=qs[_0xd275('0x1e')](_0x3c0d7b['query']['offset']);}_0x5bd2ff[_0xd275('0x3e')]=qs[_0xd275('0x5b')](_0x3c0d7b[_0xd275('0x37')][_0xd275('0x5b')]);_0x5bd2ff[_0xd275('0x3f')]=qs['filters'](_['pick'](_0x3c0d7b[_0xd275('0x37')],_0x999ad7[_0xd275('0x38')]));_0x5bd2ff[_0xd275('0x3f')][_0xd275('0x57')]=_0x98a95a['id'];if(_0x3c0d7b[_0xd275('0x37')][_0xd275('0x5c')]){_0x5bd2ff['where']=_['merge'](_0x5bd2ff['where'],{'$or':_[_0xd275('0x36')](_0x5bd2ff[_0xd275('0x3b')],function(_0x4c7111){var _0x1da2e3={};_0x1da2e3[_0x4c7111]={'$like':'%'+_0x3c0d7b[_0xd275('0x37')][_0xd275('0x5c')]+'%'};return _0x1da2e3;})});}_0x5bd2ff=_[_0xd275('0x41')]({},_0x5bd2ff,_0x3c0d7b['options']);return db['Disposition'][_0xd275('0x21')]({'where':_0x5bd2ff[_0xd275('0x3f')]})['then'](function(_0x5cf361){_0x1cf50f['count']=_0x5cf361;if(_0x3c0d7b[_0xd275('0x37')][_0xd275('0x45')]){_0x5bd2ff[_0xd275('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x5bd2ff);})['then'](function(_0x2f94d3){_0x1cf50f[_0xd275('0x47')]=_0x2f94d3;return _0x1cf50f;});}})['then'](respondWithFilteredResult(_0x4c6eda,_0x5bd2ff))[_0xd275('0x48')](handleError(_0x4c6eda,null));};exports[_0xd275('0x5d')]=function(_0x1269cd,_0x178978,_0x2f0b55){return db[_0xd275('0x31')]['find']({'where':{'id':_0x1269cd[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x178978,null))[_0xd275('0x28')](function(_0x7d12cd){if(_0x7d12cd){return _0x7d12cd[_0xd275('0x5d')](_0x1269cd[_0xd275('0x37')]['ids']);}})[_0xd275('0x28')](respondWithStatusCode(_0x178978,null))[_0xd275('0x48')](handleError(_0x178978,null));};exports[_0xd275('0x5e')]=function(_0x37aa71,_0xa086ad,_0x47da51){return db['CmList'][_0xd275('0x4c')]({'where':{'id':_0x37aa71['params']['id']}})[_0xd275('0x28')](handleEntityNotFound(_0xa086ad,null))['then'](function(_0x5a20dc){if(_0x5a20dc){var _0x9e6757=[];var _0x4c906c={'success':[],'errors':[]};return db[_0xd275('0x5f')][_0xd275('0x55')]()['then'](function(_0x259d2e){if(_0x37aa71['body'][_0xd275('0x60')]&&_[_0xd275('0x61')](_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')])){if(_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')]['length']){_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')]=_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')][_0xd275('0x62')](';')+';';}else{_0x37aa71['body']['tags']=null;}}else{_0x37aa71[_0xd275('0x4e')][_0xd275('0x60')]=null;}if(_0x37aa71['body']&&_[_0xd275('0x61')](_0x37aa71[_0xd275('0x4e')])){for(var _0xd91259=0x0;_0xd91259<_0x37aa71[_0xd275('0x4e')][_0xd275('0x3c')];_0xd91259+=0x1){_0x37aa71[_0xd275('0x4e')][_0xd91259][_0xd275('0x57')]=_0x37aa71[_0xd275('0x4a')]['id'];_0x9e6757[_0xd275('0x63')](_0x37aa71[_0xd275('0x4e')][_0xd91259]);}return BPromise['each'](_0x9e6757,function(_0x6e6119){return db['CmContact'][_0xd275('0x4d')](_[_0xd275('0x64')](_0x6e6119,[_0xd275('0x65'),'id'])||{},{'fields':_[_0xd275('0x4b')](_0x259d2e),'raw':!![]})[_0xd275('0x28')](function(_0x1455af){_0x4c906c['success']['push'](_0x1455af[_0xd275('0x66')]);})[_0xd275('0x48')](function(_0x16d2f8){_0x4c906c[_0xd275('0x67')][_0xd275('0x63')]({'data':_0x6e6119,'error':_0x16d2f8[_0xd275('0x68')]});});})['then'](function(_0x9092ec){return _0x4c906c;})[_0xd275('0x48')](function(_0x2a9e73){return _0x2a9e73;});}else{_0xa086ad['status'](0x190)[_0xd275('0x1d')]({'message':_0xd275('0x69')});}});}})[_0xd275('0x28')](respondWithResult(_0xa086ad,null))['catch'](handleError(_0xa086ad,null));};exports[_0xd275('0x6a')]=function(_0x1c0937,_0x28adc9,_0x509800){var _0xc5f321;return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x1c0937[_0xd275('0x4a')]['id']},'include':[{'model':db[_0xd275('0x6b')],'as':_0xd275('0x6c')}]})[_0xd275('0x28')](handleEntityNotFound(_0x28adc9,null))['then'](function(_0x446c7a){if(_0x446c7a){_0xc5f321=_0x446c7a;return db[_0xd275('0x5f')][_0xd275('0x32')];}})['then'](function(_0x2bdf97){if(_0x2bdf97){var _0x10e12f={};var _0x206d92={};_0x206d92[_0xd275('0x35')]=_[_0xd275('0x6d')](_[_0xd275('0x4b')](_0x2bdf97),_[_0xd275('0x36')](_0xc5f321[_0xd275('0x6c')],function(_0x2dd7df){return util[_0xd275('0x6e')](_0xd275('0x6f'),_0x2dd7df['id']);}));_0x206d92['query']=_[_0xd275('0x4b')](_0x1c0937[_0xd275('0x37')]);_0x206d92[_0xd275('0x38')]=_[_0xd275('0x39')](_0x206d92[_0xd275('0x35')],_0x206d92[_0xd275('0x37')]);_0x10e12f[_0xd275('0x3b')]=_[_0xd275('0x39')](_0x206d92[_0xd275('0x35')],qs[_0xd275('0x3a')](_0x1c0937[_0xd275('0x37')][_0xd275('0x3a')]));_0x10e12f[_0xd275('0x3b')]=_0x10e12f[_0xd275('0x3b')]['length']?_0x10e12f['attributes']:_0x206d92[_0xd275('0x35')];if(!_0x1c0937[_0xd275('0x37')][_0xd275('0x70')]('nolimit')){_0x10e12f[_0xd275('0x20')]=qs[_0xd275('0x20')](_0x1c0937['query'][_0xd275('0x20')]);_0x10e12f['offset']=qs[_0xd275('0x1e')](_0x1c0937[_0xd275('0x37')][_0xd275('0x1e')]);}_0x10e12f[_0xd275('0x3e')]=qs['sort'](_0x1c0937['query']['sort']);_0x10e12f['where']=qs['filters'](_[_0xd275('0x40')](_0x1c0937['query'],_0x206d92[_0xd275('0x38')]));_0x10e12f[_0xd275('0x71')]=!![];if(_0x1c0937[_0xd275('0x37')]['filter']){_0x10e12f[_0xd275('0x3f')]=_[_0xd275('0x41')](_0x10e12f[_0xd275('0x3f')],{'$or':_[_0xd275('0x36')](_0x10e12f['attributes'],function(_0x58087e){var _0x14e436={};_0x14e436[_0x58087e]={'$like':'%'+_0x1c0937[_0xd275('0x37')]['filter']+'%'};return _0x14e436;})});}_0x10e12f=_[_0xd275('0x41')]({},_0x10e12f,_0x1c0937[_0xd275('0x44')]);return _0xc5f321[_0xd275('0x6a')](_0x10e12f);}})[_0xd275('0x28')](respondWithResult(_0x28adc9,null))[_0xd275('0x48')](handleError(_0x28adc9,null));};exports[_0xd275('0x72')]=function(_0x5cf7e0,_0x28c85b,_0x454a87){var _0x4b9b0f;var _0x16daf8;var _0x808d29;var _0x510f65=_0x5cf7e0[_0xd275('0x4a')]['id'];csv_results=[];return db[_0xd275('0x73')][_0xd275('0x74')]({'attributes':['id','name'],'raw':!![],'order':[_0xd275('0x75')]})[_0xd275('0x28')](function(_0x533c37){_0x4b9b0f=_0x533c37;var _0x14b46b=_[_0xd275('0x4b')](db[_0xd275('0x5f')][_0xd275('0x32')]);return db['CmCustomField']['findAll']({'raw':!![],'attributes':['id',_0xd275('0x76')]})[_0xd275('0x28')](function(_0x1753b8){_0x16daf8=_0x1753b8;var _0x1f25b4=squel[_0xd275('0x77')]()[_0xd275('0x3a')](_0x14b46b)[_0xd275('0x78')]('cm_contacts','c')[_0xd275('0x3f')]('c.ListId\x20=\x20?',_0x510f65)['where'](_0xd275('0x79'))['distinct']();for(var _0x2f6da4=0x0;_0x2f6da4<_0x16daf8['length'];_0x2f6da4++){_0x1f25b4[_0xd275('0x7a')](_0xd275('0x7b')+_0x16daf8[_0x2f6da4]['id'],'customField_'+_0x16daf8[_0x2f6da4]['alias']);}for(var _0x2f6da4=0x0;_0x2f6da4<_0x4b9b0f[_0xd275('0x3c')];_0x2f6da4++){_0x1f25b4[_0xd275('0x7a')](squel['select']()[_0xd275('0x7a')](_0xd275('0x7c'))[_0xd275('0x78')]('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x4b9b0f[_0x2f6da4]['id'])[_0xd275('0x3f')](_0xd275('0x7d')),'additionalPhone_'+_0x4b9b0f[_0x2f6da4][_0xd275('0x2e')]);_0x1f25b4[_0xd275('0x7a')](squel['select']()['field'](_0xd275('0x7e'))[_0xd275('0x78')](_0xd275('0x7f'))['where'](_0xd275('0x80'),_0x4b9b0f[_0x2f6da4]['id'])[_0xd275('0x3f')](_0xd275('0x7d')),'description_additionalPhone_'+_0x4b9b0f[_0x2f6da4]['name']);}var _0x27fb77=[];_0x27fb77[_0xd275('0x63')](_0x1f25b4[_0xd275('0x81')]());BPromise[_0xd275('0x82')](_0x27fb77,handleQuery)[_0xd275('0x28')](function(_0x45e3cc){handleQuery(_0x1f25b4[_0xd275('0x81')]());var _0x401271=csv_results[0x0];if(!_[_0xd275('0x83')](_0x401271)){var _0x582b06=toCsv(_0x401271);var _0x317631=Date['now']();fs[_0xd275('0x84')](util['format']('/tmp/list_%d_%s.csv',_0x510f65,_0x317631),_0x582b06);_0x28c85b[_0xd275('0x85')](_0xd275('0x86'),_0xd275('0x87')+util[_0xd275('0x6e')](_0xd275('0x88'),_0x510f65,_0x317631));_0x28c85b['setHeader']('Content-type',_0xd275('0x89'));return _0x28c85b[_0xd275('0x8a')](util[_0xd275('0x6e')](_0xd275('0x8b'),_0x510f65,_0x317631));}else{return _0x28c85b[_0xd275('0x1a')](0xcc);}});});});};exports[_0xd275('0x8c')]=function(_0x41ad12,_0x3513c0,_0x4e6f3b){var _0x5db81e;delete _0x41ad12[_0xd275('0x4e')]['id'];return db[_0xd275('0x31')][_0xd275('0x5a')]({'where':{'id':_0x41ad12['params']['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x3513c0,null))[_0xd275('0x28')](function(_0xfcaf4d){if(_0xfcaf4d){return db[_0xd275('0x8d')]['transaction'](function(_0x34722b){return db[_0xd275('0x6b')][_0xd275('0x4d')](_0x41ad12[_0xd275('0x4e')],{'transaction':_0x34722b})[_0xd275('0x28')](function(_0x40c499){_0x5db81e=_0x40c499;return _0xfcaf4d['addCustomFields'](_0x40c499,{'transaction':_0x34722b});})[_0xd275('0x28')](function(){var _0x2c692e={'type':db[_0xd275('0x8e')][_0xd275('0x8f')],'transaction':_0x34722b};switch(_0x41ad12['body'][_0xd275('0x42')]){case _0xd275('0x90'):_0x2c692e[_0xd275('0x42')]=db[_0xd275('0x8e')]['TEXT'];break;case _0xd275('0x91'):_0x2c692e['type']=db[_0xd275('0x8e')][_0xd275('0x92')];break;case _0xd275('0x93'):_0x2c692e[_0xd275('0x42')]=db[_0xd275('0x8e')][_0xd275('0x94')];_0x2c692e[_0xd275('0x95')]=![];break;default:}return db[_0xd275('0x8d')]['queryInterface'][_0xd275('0x96')](_0xd275('0x97'),util[_0xd275('0x6e')](_0xd275('0x98'),_0x5db81e['id']),_0x2c692e);})[_0xd275('0x28')](function(){return _0x5db81e;});});}})[_0xd275('0x28')](respondWithResult(_0x3513c0,null))[_0xd275('0x48')](handleError(_0x3513c0,null));};exports[_0xd275('0x99')]=function(_0xeb128,_0x467b50,_0x5b3038){var _0x253163={};var _0xf76f97={};var _0x486218;var _0x1f183e;return db[_0xd275('0x31')][_0xd275('0x5a')]({'where':{'id':_0xeb128[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x467b50,null))[_0xd275('0x28')](function(_0x5f32ff){if(_0x5f32ff){_0x486218=_0x5f32ff;_0xf76f97['model']=_[_0xd275('0x4b')](db['CmCustomField'][_0xd275('0x32')]);_0xf76f97[_0xd275('0x37')]=_[_0xd275('0x4b')](_0xeb128[_0xd275('0x37')]);_0xf76f97[_0xd275('0x38')]=_['intersection'](_0xf76f97[_0xd275('0x35')],_0xf76f97[_0xd275('0x37')]);_0x253163['attributes']=_[_0xd275('0x39')](_0xf76f97['model'],qs['fields'](_0xeb128[_0xd275('0x37')][_0xd275('0x3a')]));_0x253163[_0xd275('0x3b')]=_0x253163[_0xd275('0x3b')][_0xd275('0x3c')]?_0x253163['attributes']:_0xf76f97['model'];_0x253163[_0xd275('0x3e')]=qs[_0xd275('0x5b')](_0xeb128[_0xd275('0x37')][_0xd275('0x5b')]);_0x253163[_0xd275('0x3f')]=qs[_0xd275('0x38')](_[_0xd275('0x40')](_0xeb128[_0xd275('0x37')],_0xf76f97[_0xd275('0x38')]));_0x253163['where']=_[_0xd275('0x41')](_0x253163['where'],{'$or':[{'ListId':_0x5f32ff['id']},{'ListId':null}]});if(_0xeb128[_0xd275('0x37')][_0xd275('0x5c')]){_0x253163[_0xd275('0x3f')]=_[_0xd275('0x41')](_0x253163[_0xd275('0x3f')],{'$or':_['map'](_0x253163['attributes'],function(_0x5b514c){var _0x55af74={};_0x55af74[_0x5b514c]={'$like':'%'+_0xeb128[_0xd275('0x37')][_0xd275('0x5c')]+'%'};return _0x55af74;})});}_0x253163=_[_0xd275('0x41')]({},_0x253163,_0xeb128[_0xd275('0x44')]);return db[_0xd275('0x6b')][_0xd275('0x9a')](_0x253163);}})[_0xd275('0x28')](respondWithResult(_0x467b50,null))[_0xd275('0x48')](handleError(_0x467b50,null));};exports['getGlobalCustomFields']=function(_0x27ebab,_0x4c54c2){return db[_0xd275('0x6b')]['findAndCountAll']({'where':{'ListId':null}})[_0xd275('0x28')](handleEntityNotFound(_0x4c54c2,null))[_0xd275('0x28')](function(_0x2b1704){return _0x2b1704;})['then'](respondWithResult(_0x4c54c2,null))['catch'](handleError(_0x4c54c2,null));};exports[_0xd275('0x9b')]=function(_0x3ec558,_0x47f3e0,_0x23dd2b){return db[_0xd275('0x31')][_0xd275('0x4c')]({'where':{'id':_0x3ec558[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x47f3e0,null))['then'](function(_0x200260){if(_0x200260){return _0x200260[_0xd275('0x9b')](_0x3ec558[_0xd275('0x4e')][_0xd275('0x65')],_['omit'](_0x3ec558[_0xd275('0x4e')],[_0xd275('0x65'),'id'])||{})[_0xd275('0x9c')](function(_0x455c4d){for(var _0x254c6c=0x0;_0x254c6c<_0x3ec558['body'][_0xd275('0x65')][_0xd275('0x3c')];_0x254c6c+=0x1){socket[_0xd275('0x9d')]('userCmList:save',{'UserId':Number(_0x3ec558['body'][_0xd275('0x65')][_0x254c6c]),'CmListId':Number(_0x3ec558[_0xd275('0x4a')]['id'])});}return _0x455c4d;});}})['then'](respondWithResult(_0x47f3e0,null))['catch'](handleError(_0x47f3e0,null));};exports[_0xd275('0x9e')]=function(_0x5c5536,_0x167f78,_0x58de2f){return db[_0xd275('0x31')]['find']({'where':{'id':_0x5c5536[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x167f78,null))['then'](function(_0x4ee759){if(_0x4ee759){return _0x4ee759['removeAgents'](_0x5c5536[_0xd275('0x37')][_0xd275('0x65')])['then'](function(){if(_[_0xd275('0x61')](_0x5c5536['query']['ids'])){for(var _0x5f4ea7=0x0;_0x5f4ea7<_0x5c5536[_0xd275('0x37')][_0xd275('0x65')][_0xd275('0x3c')];_0x5f4ea7+=0x1){socket[_0xd275('0x9d')]('userCmList:remove',{'UserId':Number(_0x5c5536['query'][_0xd275('0x65')][_0x5f4ea7]),'CmListId':Number(_0x5c5536[_0xd275('0x4a')]['id'])});}}else{socket[_0xd275('0x9d')](_0xd275('0x9f'),{'UserId':Number(_0x5c5536[_0xd275('0x37')][_0xd275('0x65')]),'CmListId':Number(_0x5c5536[_0xd275('0x4a')]['id'])});}});}})[_0xd275('0x28')](respondWithStatusCode(_0x167f78,null))[_0xd275('0x48')](handleError(_0x167f78,null));};exports['getAgents']=function(_0x47b6df,_0x564bbf,_0x195d75){var _0x5e98b3={};var _0x58650e={};var _0x4aab3b;var _0x3f08eb;return db['CmList']['findOne']({'where':{'id':_0x47b6df[_0xd275('0x4a')]['id']}})[_0xd275('0x28')](handleEntityNotFound(_0x564bbf,null))['then'](function(_0x2f68b3){if(_0x2f68b3){_0x4aab3b=_0x2f68b3;_0x58650e[_0xd275('0x35')]=_[_0xd275('0x4b')](db[_0xd275('0xa0')][_0xd275('0x32')]);_0x58650e[_0xd275('0x37')]=_[_0xd275('0x4b')](_0x47b6df['query']);_0x58650e[_0xd275('0x38')]=_[_0xd275('0x39')](_0x58650e[_0xd275('0x35')],_0x58650e['query']);_0x5e98b3['attributes']=_[_0xd275('0x39')](_0x58650e['model'],qs['fields'](_0x47b6df[_0xd275('0x37')][_0xd275('0x3a')]));_0x5e98b3[_0xd275('0x3b')]=_0x5e98b3[_0xd275('0x3b')][_0xd275('0x3c')]?_0x5e98b3['attributes']:_0x58650e['model'];_0x5e98b3[_0xd275('0x3e')]=qs[_0xd275('0x5b')](_0x47b6df[_0xd275('0x37')]['sort']);_0x5e98b3[_0xd275('0x3f')]=qs[_0xd275('0x38')](_[_0xd275('0x40')](_0x47b6df[_0xd275('0x37')],_0x58650e['filters']));if(_0x47b6df[_0xd275('0x37')][_0xd275('0x5c')]){_0x5e98b3['where']=_[_0xd275('0x41')](_0x5e98b3[_0xd275('0x3f')],{'$or':_[_0xd275('0x36')](_0x5e98b3[_0xd275('0x3b')],function(_0x30aec3){var _0xd2a737={};_0xd2a737[_0x30aec3]={'$like':'%'+_0x47b6df['query']['filter']+'%'};return _0xd2a737;})});}_0x5e98b3=_['merge']({},_0x5e98b3,_0x47b6df['options']);return _0x4aab3b[_0xd275('0xa1')](_0x5e98b3);}})[_0xd275('0x28')](function(_0x31583b){if(_0x31583b){_0x3f08eb=_0x31583b[_0xd275('0x3c')];if(!_0x47b6df[_0xd275('0x37')][_0xd275('0x70')]('nolimit')){_0x5e98b3['limit']=qs['limit'](_0x47b6df['query'][_0xd275('0x20')]);_0x5e98b3[_0xd275('0x1e')]=qs[_0xd275('0x1e')](_0x47b6df[_0xd275('0x37')][_0xd275('0x1e')]);}return _0x4aab3b['getAgents'](_0x5e98b3);}})[_0xd275('0x28')](function(_0x107f78){if(_0x107f78){return _0x107f78?{'count':_0x3f08eb,'rows':_0x107f78}:null;}})[_0xd275('0x28')](respondWithResult(_0x564bbf,null))[_0xd275('0x48')](handleError(_0x564bbf,null));};function handleQuery(_0x2042c3){logger[_0xd275('0xa2')](_0x2042c3);return db[_0xd275('0x8d')][_0xd275('0x37')](_0x2042c3)[_0xd275('0x9c')](function(_0xa7933){csv_results[_0xd275('0x63')](_0xa7933);})[_0xd275('0x48')](function(_0x33641d){logger[_0xd275('0x53')](_0x33641d[_0xd275('0x68')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3334c74..bda38b1 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x3f4e75,_0x9c9f0e){var _0x6153c=function(_0x4cfcc4){while(--_0x4cfcc4){_0x3f4e75['push'](_0x3f4e75['shift']());}};_0x6153c(++_0x9c9f0e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe14b,0x93));var _0xbe14=function(_0xf3c31f,_0x1b1bd8){_0xf3c31f=_0xf3c31f-0x0;var _0x2ae42a=_0xe14b[_0xf3c31f];return _0x2ae42a;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index fbb0ed9..baa1c1a 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 _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists'];(function(_0x5c75fd,_0x321838){var _0x44f10d=function(_0x15f690){while(--_0x15f690){_0x5c75fd['push'](_0x5c75fd['shift']());}};_0x44f10d(++_0x321838);}(_0x2dae,0xc3));var _0xe2da=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0x2dae[_0x28f1de];return _0x5b5dad;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));module[_0xe2da('0x9')]=function(_0x523c60,_0x3e3e25){return _0x523c60[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList','cm_lists','lodash'];(function(_0x13572e,_0x4821a5){var _0x36ad78=function(_0x2860e9){while(--_0x2860e9){_0x13572e['push'](_0x13572e['shift']());}};_0x36ad78(++_0x4821a5);}(_0xda55,0x6d));var _0x5da5=function(_0x5d3e97,_0x17d8dd){_0x5d3e97=_0x5d3e97-0x0;var _0x3a8dbe=_0xda55[_0x5d3e97];return _0x3a8dbe;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index e48175c..00fd25d 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 _0x69dc=['debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x21a35d,_0x3e1b90){var _0x4afcb6=function(_0x51d83a){while(--_0x51d83a){_0x21a35d['push'](_0x21a35d['shift']());}};_0x4afcb6(++_0x3e1b90);}(_0x69dc,0xd8));var _0xc69d=function(_0x24e711,_0x1cdef3){_0x24e711=_0x24e711-0x0;var _0x276794=_0x69dc[_0x24e711];return _0x276794;};'use strict';var _=require(_0xc69d('0x0'));var util=require('util');var moment=require(_0xc69d('0x1'));var BPromise=require(_0xc69d('0x2'));var rs=require(_0xc69d('0x3'));var fs=require('fs');var Redis=require(_0xc69d('0x4'));var db=require(_0xc69d('0x5'))['db'];var utils=require(_0xc69d('0x6'));var logger=require(_0xc69d('0x7'))('rpc');var config=require(_0xc69d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc69d('0x9')]({'port':0x232a});config[_0xc69d('0xa')]=_[_0xc69d('0xb')](config[_0xc69d('0xa')],{'host':_0xc69d('0xc'),'port':0x18eb});var socket=require(_0xc69d('0xd'))(new Redis(config['redis']));require('./cmList.socket')[_0xc69d('0xe')](socket);function respondWithRpcPromise(_0x1d3053,_0x1a068d,_0x156afd){return new BPromise(function(_0x212dbb,_0xb0746){return client[_0xc69d('0xf')](_0x1d3053,_0x156afd)[_0xc69d('0x10')](function(_0x5165cd){logger[_0xc69d('0x11')]('CmList,\x20%s,\x20%s',_0x1a068d,'request\x20sent');logger[_0xc69d('0x12')](_0xc69d('0x13'),_0x1a068d,'request\x20sent',JSON[_0xc69d('0x14')](_0x5165cd));if(_0x5165cd[_0xc69d('0x15')]){if(_0x5165cd[_0xc69d('0x15')]['code']===0x1f4){logger[_0xc69d('0x15')](_0xc69d('0x16'),_0x1a068d,_0x5165cd[_0xc69d('0x15')][_0xc69d('0x17')]);return _0xb0746(_0x5165cd[_0xc69d('0x15')][_0xc69d('0x17')]);}logger['error'](_0xc69d('0x16'),_0x1a068d,_0x5165cd[_0xc69d('0x15')][_0xc69d('0x17')]);return _0x212dbb(_0x5165cd[_0xc69d('0x15')][_0xc69d('0x17')]);}else{logger[_0xc69d('0x11')]('CmList,\x20%s,\x20%s',_0x1a068d,_0xc69d('0x18'));_0x212dbb(_0x5165cd['result'][_0xc69d('0x17')]);}})[_0xc69d('0x19')](function(_0x2a29fe){logger[_0xc69d('0x15')]('CmList,\x20%s,\x20%s',_0x1a068d,_0x2a29fe);_0xb0746(_0x2a29fe);});});} \ No newline at end of file +var _0x3dbf=['message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55c09a,_0x4f2c79){var _0x3fb09b=function(_0x3c6dd7){while(--_0x3c6dd7){_0x55c09a['push'](_0x55c09a['shift']());}};_0x3fb09b(++_0x4f2c79);}(_0x3dbf,0x198));var _0xf3db=function(_0xe3c783,_0xd6615f){_0xe3c783=_0xe3c783-0x0;var _0x7b9de4=_0x3dbf[_0xe3c783];return _0x7b9de4;};'use strict';var _=require(_0xf3db('0x0'));var util=require('util');var moment=require(_0xf3db('0x1'));var BPromise=require(_0xf3db('0x2'));var rs=require(_0xf3db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3db('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf3db('0x5'))('rpc');var config=require(_0xf3db('0x6'));var jayson=require(_0xf3db('0x7'));var client=jayson[_0xf3db('0x8')][_0xf3db('0x9')]({'port':0x232a});config[_0xf3db('0xa')]=_[_0xf3db('0xb')](config[_0xf3db('0xa')],{'host':_0xf3db('0xc'),'port':0x18eb});var socket=require(_0xf3db('0xd'))(new Redis(config[_0xf3db('0xa')]));require(_0xf3db('0xe'))[_0xf3db('0xf')](socket);function respondWithRpcPromise(_0x4ca75c,_0x30da21,_0x2f292d){return new BPromise(function(_0x48d625,_0x1d5b7c){return client['request'](_0x4ca75c,_0x2f292d)[_0xf3db('0x10')](function(_0x285e52){logger['info'](_0xf3db('0x11'),_0x30da21,_0xf3db('0x12'));logger[_0xf3db('0x13')](_0xf3db('0x14'),_0x30da21,'request\x20sent',JSON[_0xf3db('0x15')](_0x285e52));if(_0x285e52['error']){if(_0x285e52[_0xf3db('0x16')][_0xf3db('0x17')]===0x1f4){logger[_0xf3db('0x16')]('CmList,\x20%s,\x20%s',_0x30da21,_0x285e52['error'][_0xf3db('0x18')]);return _0x1d5b7c(_0x285e52[_0xf3db('0x16')]['message']);}logger[_0xf3db('0x16')]('CmList,\x20%s,\x20%s',_0x30da21,_0x285e52['error'][_0xf3db('0x18')]);return _0x48d625(_0x285e52[_0xf3db('0x16')]['message']);}else{logger['info'](_0xf3db('0x11'),_0x30da21,_0xf3db('0x12'));_0x48d625(_0x285e52[_0xf3db('0x19')][_0xf3db('0x18')]);}})[_0xf3db('0x1a')](function(_0x42c742){logger['error'](_0xf3db('0x11'),_0x30da21,_0x42c742);_0x1d5b7c(_0x42c742);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 901a8c8..bf4aeee 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 _0xd5b4=['removeListener','register','length','cmList:','remove','update','emit'];(function(_0x29679c,_0x4c65e9){var _0x27f4b7=function(_0x5a1820){while(--_0x5a1820){_0x29679c['push'](_0x29679c['shift']());}};_0x27f4b7(++_0x4c65e9);}(_0xd5b4,0x193));var _0x4d5b=function(_0x303257,_0x3f8fdf){_0x303257=_0x303257-0x0;var _0x5f28c1=_0xd5b4[_0x303257];return _0x5f28c1;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x4d5b('0x0'),_0x4d5b('0x1')];function createListener(_0x56d125,_0x2d75d9){return function(_0x2eb538){_0x2d75d9[_0x4d5b('0x2')](_0x56d125,_0x2eb538);};}function removeListener(_0x45ff4e,_0x1997fd){return function(){CmListEvents[_0x4d5b('0x3')](_0x45ff4e,_0x1997fd);};}exports[_0x4d5b('0x4')]=function(_0x4db4c6){for(var _0x464820=0x0,_0x41d1d=events[_0x4d5b('0x5')];_0x464820<_0x41d1d;_0x464820++){var _0x5f5d6e=events[_0x464820];var _0x260f08=createListener(_0x4d5b('0x6')+_0x5f5d6e,_0x4db4c6);CmListEvents['on'](_0x5f5d6e,_0x260f08);}}; \ No newline at end of file +var _0x4283=['removeListener','length','cmList:','save','remove','update'];(function(_0x193394,_0x77e174){var _0x576e1b=function(_0x2f71b5){while(--_0x2f71b5){_0x193394['push'](_0x193394['shift']());}};_0x576e1b(++_0x77e174);}(_0x4283,0x177));var _0x3428=function(_0x49408b,_0x2335a1){_0x49408b=_0x49408b-0x0;var _0xee64ae=_0x4283[_0x49408b];return _0xee64ae;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x3428('0x0'),_0x3428('0x1'),_0x3428('0x2')];function createListener(_0x41df5c,_0x3aa7a1){return function(_0x5364a4){_0x3aa7a1['emit'](_0x41df5c,_0x5364a4);};}function removeListener(_0x1a160b,_0x1ed205){return function(){CmListEvents[_0x3428('0x3')](_0x1a160b,_0x1ed205);};}exports['register']=function(_0x2e7864){for(var _0x169dfc=0x0,_0x14738a=events[_0x3428('0x4')];_0x169dfc<_0x14738a;_0x169dfc++){var _0x2410b0=events[_0x169dfc];var _0xd9de15=createListener(_0x3428('0x5')+_0x2410b0,_0x2e7864);CmListEvents['on'](_0x2410b0,_0xd9de15);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index dcef3f2..4e8bf35 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 _0xb541=['/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','describe','get','/global_fields','getGlobalCustomFields','show'];(function(_0x5ac099,_0x36ff39){var _0x51d1c2=function(_0x24625a){while(--_0x24625a){_0x5ac099['push'](_0x5ac099['shift']());}};_0x51d1c2(++_0x36ff39);}(_0xb541,0x19d));var _0x1b54=function(_0x26e756,_0xfcbd56){_0x26e756=_0x26e756-0x0;var _0x55b6cf=_0xb541[_0x26e756];return _0x55b6cf;};'use strict';var multer=require(_0x1b54('0x0'));var util=require(_0x1b54('0x1'));var path=require(_0x1b54('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b54('0x3')]();var fs_extra=require(_0x1b54('0x4'));var auth=require(_0x1b54('0x5'));var interaction=require(_0x1b54('0x6'));var config=require(_0x1b54('0x7'));var controller=require(_0x1b54('0x8'));router['get']('/',auth[_0x1b54('0x9')](),controller[_0x1b54('0xa')]);router['get']('/describe',auth[_0x1b54('0x9')](),controller[_0x1b54('0xb')]);router[_0x1b54('0xc')](_0x1b54('0xd'),auth[_0x1b54('0x9')](),controller[_0x1b54('0xe')]);router[_0x1b54('0xc')]('/:id',auth[_0x1b54('0x9')](),controller[_0x1b54('0xf')]);router[_0x1b54('0xc')](_0x1b54('0x10'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x11')]);router[_0x1b54('0xc')](_0x1b54('0x12'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x13')]);router[_0x1b54('0xc')](_0x1b54('0x14'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x15')]);router[_0x1b54('0xc')](_0x1b54('0x16'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x17')]);router['get']('/:id/users',auth[_0x1b54('0x9')](),controller[_0x1b54('0x18')]);router[_0x1b54('0x19')]('/',auth[_0x1b54('0x9')](),controller[_0x1b54('0x1a')]);router[_0x1b54('0x19')]('/:id/dispositions',auth[_0x1b54('0x9')](),controller[_0x1b54('0x1b')]);router['post'](_0x1b54('0x12'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x1c')]);router['post'](_0x1b54('0x16'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x1d')]);router['post'](_0x1b54('0x1e'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x1f')]);router[_0x1b54('0x20')](_0x1b54('0x21'),auth['isAuthenticated'](),controller[_0x1b54('0x22')]);router[_0x1b54('0x23')](_0x1b54('0x21'),auth[_0x1b54('0x9')](),controller['destroy']);router[_0x1b54('0x23')](_0x1b54('0x10'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x24')]);router[_0x1b54('0x23')](_0x1b54('0x1e'),auth[_0x1b54('0x9')](),controller[_0x1b54('0x25')]);module[_0x1b54('0x26')]=router; \ No newline at end of file +var _0x5a8c=['addAgents','update','delete','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField'];(function(_0x94cd4d,_0x96a926){var _0x49b562=function(_0x27ccc2){while(--_0x27ccc2){_0x94cd4d['push'](_0x94cd4d['shift']());}};_0x49b562(++_0x96a926);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x37708e,_0x385531){_0x37708e=_0x37708e-0x0;var _0x2bdf8c=_0x5a8c[_0x37708e];return _0x2bdf8c;};'use strict';var multer=require(_0xc5a8('0x0'));var util=require(_0xc5a8('0x1'));var path=require('path');var timeout=require(_0xc5a8('0x2'));var express=require(_0xc5a8('0x3'));var router=express[_0xc5a8('0x4')]();var fs_extra=require(_0xc5a8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc5a8('0x6'));var config=require(_0xc5a8('0x7'));var controller=require('./cmList.controller');router[_0xc5a8('0x8')]('/',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0xa')]);router[_0xc5a8('0x8')](_0xc5a8('0xb'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0xc')]);router[_0xc5a8('0x8')](_0xc5a8('0xd'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0xe')]);router['get'](_0xc5a8('0xf'),auth['isAuthenticated'](),controller[_0xc5a8('0x10')]);router[_0xc5a8('0x8')](_0xc5a8('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xc5a8('0x8')](_0xc5a8('0x12'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x13')]);router[_0xc5a8('0x8')]('/:id/contacts/csv',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x14')]);router[_0xc5a8('0x8')](_0xc5a8('0x15'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x16')]);router[_0xc5a8('0x8')](_0xc5a8('0x17'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x18')]);router[_0xc5a8('0x19')]('/',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1a')]);router[_0xc5a8('0x19')](_0xc5a8('0x11'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1b')]);router[_0xc5a8('0x19')]('/:id/contacts',auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1c')]);router[_0xc5a8('0x19')](_0xc5a8('0x15'),auth['isAuthenticated'](),controller[_0xc5a8('0x1d')]);router['post'](_0xc5a8('0x17'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x1e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc5a8('0x1f')]);router[_0xc5a8('0x20')](_0xc5a8('0xf'),auth[_0xc5a8('0x9')](),controller['destroy']);router[_0xc5a8('0x20')](_0xc5a8('0x11'),auth[_0xc5a8('0x9')](),controller[_0xc5a8('0x21')]);router['delete'](_0xc5a8('0x17'),auth['isAuthenticated'](),controller[_0xc5a8('0x22')]);module[_0xc5a8('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index fea9ab0..05d2d6b 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 _0xb7cc=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x44bff9,_0x2c9721){var _0x48a92b=function(_0x398b65){while(--_0x398b65){_0x44bff9['push'](_0x44bff9['shift']());}};_0x48a92b(++_0x2c9721);}(_0xb7cc,0x1da));var _0xcb7c=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xb7cc[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require(_0xcb7c('0x0'));module[_0xcb7c('0x1')]={'name':{'type':Sequelize[_0xcb7c('0x2')],'get':function(_0x17e098){return this[_0xcb7c('0x3')](_0xcb7c('0x4'));}},'field':{'type':Sequelize[_0xcb7c('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0xcb7c('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0xcb7c('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0xd219=['exports','getDataValue','field','sequelize'];(function(_0x452be5,_0x1101ee){var _0x13bda4=function(_0x39c135){while(--_0x39c135){_0x452be5['push'](_0x452be5['shift']());}};_0x13bda4(++_0x1101ee);}(_0xd219,0x167));var _0x9d21=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xd219[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x9d21('0x0'));module[_0x9d21('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x6b4d56){return this[_0x9d21('0x2')](_0x9d21('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index eb9e246..3a62144 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x1ec8ae,_0x19e89f){var _0x1a25b1=function(_0x10907f){while(--_0x10907f){_0x1ec8ae['push'](_0x1ec8ae['shift']());}};_0x1a25b1(++_0x19e89f);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x164894,_0x41c7f7){var _0x4c2739=function(_0x35e22b){while(--_0x35e22b){_0x164894['push'](_0x164894['shift']());}};_0x4c2739(++_0x41c7f7);}(_0x7a54,0x106));var _0x47a5=function(_0x33bd0f,_0x2cf197){_0x33bd0f=_0x33bd0f-0x0;var _0x581ffc=_0x7a54[_0x33bd0f];return _0x581ffc;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 3b461e2..67235f3 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 _0x8071=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util'];(function(_0x4e3594,_0x21bfa9){var _0x4fd0bf=function(_0x1c4a73){while(--_0x1c4a73){_0x4e3594['push'](_0x4e3594['shift']());}};_0x4fd0bf(++_0x21bfa9);}(_0x8071,0xf5));var _0x1807=function(_0x50a845,_0x1d43f9){_0x50a845=_0x50a845-0x0;var _0x4e5731=_0x8071[_0x50a845];return _0x4e5731;};'use strict';var _=require(_0x1807('0x0'));var util=require(_0x1807('0x1'));var logger=require(_0x1807('0x2'))('api');var moment=require(_0x1807('0x3'));var BPromise=require(_0x1807('0x4'));var rp=require(_0x1807('0x5'));var fs=require('fs');var path=require(_0x1807('0x6'));var rimraf=require('rimraf');var config=require(_0x1807('0x7'));var attributes=require(_0x1807('0x8'));module[_0x1807('0x9')]=function(_0x2a1775,_0x1b14d7){return _0x2a1775[_0x1807('0xa')](_0x1807('0xb'),attributes,{'tableName':_0x1807('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7338=['Condition','tools_conditions','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x7338,0x115));var _0x8733=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x7338[_0x3740fe];return _0x55492b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8733('0x0'))(_0x8733('0x1'));var moment=require('moment');var BPromise=require(_0x8733('0x2'));var rp=require(_0x8733('0x3'));var fs=require('fs');var path=require(_0x8733('0x4'));var rimraf=require(_0x8733('0x5'));var config=require(_0x8733('0x6'));var attributes=require(_0x8733('0x7'));module[_0x8733('0x8')]=function(_0xada5d7,_0x10c893){return _0xada5d7['define'](_0x8733('0x9'),attributes,{'tableName':_0x8733('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index df24ea2..9300d99 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 _0x4dfa=['../../config/logger','../../config/environment','jayson/promise','http','request','request\x20sent','debug','error','Condition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x181360,_0x3561a4){var _0x8dc0be=function(_0x3588a2){while(--_0x3588a2){_0x181360['push'](_0x181360['shift']());}};_0x8dc0be(++_0x3561a4);}(_0x4dfa,0x8a));var _0xa4df=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4dfa[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xa4df('0x0'));var util=require(_0xa4df('0x1'));var moment=require(_0xa4df('0x2'));var BPromise=require('bluebird');var rs=require(_0xa4df('0x3'));var fs=require('fs');var Redis=require(_0xa4df('0x4'));var db=require(_0xa4df('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4df('0x6'))('rpc');var config=require(_0xa4df('0x7'));var jayson=require(_0xa4df('0x8'));var client=jayson['client'][_0xa4df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14b8d3,_0x1c4c1e,_0x56d0e6){return new BPromise(function(_0x53e9e8,_0x4701eb){return client[_0xa4df('0xa')](_0x14b8d3,_0x56d0e6)['then'](function(_0x2a1b6a){logger['info']('Condition,\x20%s,\x20%s',_0x1c4c1e,_0xa4df('0xb'));logger[_0xa4df('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0x1c4c1e,'request\x20sent',JSON['stringify'](_0x2a1b6a));if(_0x2a1b6a[_0xa4df('0xd')]){if(_0x2a1b6a[_0xa4df('0xd')]['code']===0x1f4){logger[_0xa4df('0xd')](_0xa4df('0xe'),_0x1c4c1e,_0x2a1b6a[_0xa4df('0xd')][_0xa4df('0xf')]);return _0x4701eb(_0x2a1b6a['error'][_0xa4df('0xf')]);}logger['error']('Condition,\x20%s,\x20%s',_0x1c4c1e,_0x2a1b6a[_0xa4df('0xd')][_0xa4df('0xf')]);return _0x53e9e8(_0x2a1b6a['error'][_0xa4df('0xf')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x1c4c1e,'request\x20sent');_0x53e9e8(_0x2a1b6a[_0xa4df('0x10')]['message']);}})[_0xa4df('0x11')](function(_0x117fcd){logger[_0xa4df('0xd')](_0xa4df('0xe'),_0x1c4c1e,_0x117fcd);_0x4701eb(_0x117fcd);});});} \ No newline at end of file +var _0x6a6d=['moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x58f0a2,_0x4a5b7e){var _0x1ed5ee=function(_0x3e4435){while(--_0x3e4435){_0x58f0a2['push'](_0x58f0a2['shift']());}};_0x1ed5ee(++_0x4a5b7e);}(_0x6a6d,0xdb));var _0xd6a6=function(_0x1ae20a,_0x385fb7){_0x1ae20a=_0x1ae20a-0x0;var _0x2f98bc=_0x6a6d[_0x1ae20a];return _0x2f98bc;};'use strict';var _=require(_0xd6a6('0x0'));var util=require('util');var moment=require(_0xd6a6('0x1'));var BPromise=require(_0xd6a6('0x2'));var rs=require(_0xd6a6('0x3'));var fs=require('fs');var Redis=require(_0xd6a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd6a6('0x5'));var config=require('../../config/environment');var jayson=require(_0xd6a6('0x6'));var client=jayson[_0xd6a6('0x7')][_0xd6a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdc95b7,_0x348ee0,_0x248f31){return new BPromise(function(_0x4025df,_0x2f4888){return client[_0xd6a6('0x9')](_0xdc95b7,_0x248f31)[_0xd6a6('0xa')](function(_0x332524){logger[_0xd6a6('0xb')](_0xd6a6('0xc'),_0x348ee0,_0xd6a6('0xd'));logger[_0xd6a6('0xe')](_0xd6a6('0xf'),_0x348ee0,_0xd6a6('0xd'),JSON[_0xd6a6('0x10')](_0x332524));if(_0x332524[_0xd6a6('0x11')]){if(_0x332524['error'][_0xd6a6('0x12')]===0x1f4){logger[_0xd6a6('0x11')]('Condition,\x20%s,\x20%s',_0x348ee0,_0x332524['error'][_0xd6a6('0x13')]);return _0x2f4888(_0x332524[_0xd6a6('0x11')][_0xd6a6('0x13')]);}logger[_0xd6a6('0x11')](_0xd6a6('0xc'),_0x348ee0,_0x332524['error'][_0xd6a6('0x13')]);return _0x4025df(_0x332524[_0xd6a6('0x11')][_0xd6a6('0x13')]);}else{logger[_0xd6a6('0xb')](_0xd6a6('0xc'),_0x348ee0,_0xd6a6('0xd'));_0x4025df(_0x332524['result'][_0xd6a6('0x13')]);}})['catch'](function(_0x2370fe){logger[_0xd6a6('0x11')]('Condition,\x20%s,\x20%s',_0x348ee0,_0x2370fe);_0x2f4888(_0x2370fe);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 1bafa55..a511619 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 _0x78e3=['update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated'];(function(_0x385a54,_0x101576){var _0x3c6faa=function(_0x5cf441){while(--_0x5cf441){_0x385a54['push'](_0x385a54['shift']());}};_0x3c6faa(++_0x101576);}(_0x78e3,0x1ca));var _0x378e=function(_0x304325,_0x659883){_0x304325=_0x304325-0x0;var _0x253be4=_0x78e3[_0x304325];return _0x253be4;};'use strict';var multer=require(_0x378e('0x0'));var util=require(_0x378e('0x1'));var path=require(_0x378e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x378e('0x3'));var auth=require(_0x378e('0x4'));var interaction=require(_0x378e('0x5'));var config=require('../../config/environment');var controller=require(_0x378e('0x6'));router[_0x378e('0x7')](_0x378e('0x8'),auth[_0x378e('0x9')](),controller[_0x378e('0xa')]);router[_0x378e('0xb')]('/:id',auth[_0x378e('0x9')](),controller['destroy']);module[_0x378e('0xc')]=router; \ No newline at end of file +var _0x0bbd=['/:id','update','delete','destroy','multer','util','path','fs-extra','../../config/environment','put'];(function(_0x4dec22,_0x3baa9b){var _0x13f1e6=function(_0x39374d){while(--_0x39374d){_0x4dec22['push'](_0x4dec22['shift']());}};_0x13f1e6(++_0x3baa9b);}(_0x0bbd,0xea));var _0xd0bb=function(_0x3fb7a1,_0x365d08){_0x3fb7a1=_0x3fb7a1-0x0;var _0x117022=_0x0bbd[_0x3fb7a1];return _0x117022;};'use strict';var multer=require(_0xd0bb('0x0'));var util=require(_0xd0bb('0x1'));var path=require(_0xd0bb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd0bb('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd0bb('0x4'));var controller=require('./condition.controller');router[_0xd0bb('0x5')](_0xd0bb('0x6'),auth['isAuthenticated'](),controller[_0xd0bb('0x7')]);router[_0xd0bb('0x8')](_0xd0bb('0x6'),auth['isAuthenticated'](),controller[_0xd0bb('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 8654d18..e36a0e3 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 _0x50e1=['exports','STRING','name','INTEGER','sequelize'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x50e1,0xe0));var _0x150e=function(_0x3ecd93,_0x58c5d5){_0x3ecd93=_0x3ecd93-0x0;var _0x1b9154=_0x50e1[_0x3ecd93];return _0x1b9154;};'use strict';var Sequelize=require(_0x150e('0x0'));module[_0x150e('0x1')]={'name':{'type':Sequelize[_0x150e('0x2')],'allowNull':![],'unique':_0x150e('0x3')},'OrderBy':{'type':Sequelize[_0x150e('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x150e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xb873=['exports','STRING','INTEGER','sequelize'];(function(_0x3b8680,_0x5a3670){var _0x5f5bb5=function(_0x15f1eb){while(--_0x15f1eb){_0x3b8680['push'](_0x3b8680['shift']());}};_0x5f5bb5(++_0x5a3670);}(_0xb873,0x133));var _0x3b87=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xb873[_0x1fc122];return _0xa2cb13;};'use strict';var Sequelize=require(_0x3b87('0x0'));module[_0x3b87('0x1')]={'name':{'type':Sequelize[_0x3b87('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x3b87('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index c498c0f..aa2dbc4 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 _0xab40=['error','stack','name','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','ContactItemType','count','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','update','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','then','get','UserProfileResource','destroy'];(function(_0x18b3e1,_0x4f9f6c){var _0x2644d0=function(_0x3fc6f3){while(--_0x3fc6f3){_0x18b3e1['push'](_0x18b3e1['shift']());}};_0x2644d0(++_0x4f9f6c);}(_0xab40,0xcd));var _0x0ab4=function(_0x328a7b,_0x482828){_0x328a7b=_0x328a7b-0x0;var _0x11d46f=_0xab40[_0x328a7b];return _0x11d46f;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x249dc3,_0x45e6fd){_0x45e6fd=_0x45e6fd||0xcc;return function(_0x1e7555){if(_0x1e7555){return _0x249dc3[_0x0ab4('0x15')](_0x45e6fd);}return _0x249dc3[_0x0ab4('0x16')](_0x45e6fd)[_0x0ab4('0x17')]();};}function respondWithResult(_0x112162,_0x2cc644){_0x2cc644=_0x2cc644||0xc8;return function(_0x3cb1df){if(_0x3cb1df){return _0x112162[_0x0ab4('0x16')](_0x2cc644)[_0x0ab4('0x18')](_0x3cb1df);}};}function respondWithFilteredResult(_0x36d246,_0x293e20){return function(_0x45fad1){if(_0x45fad1){var _0x2a83a8=typeof _0x293e20[_0x0ab4('0x19')]===_0x0ab4('0x1a')&&typeof _0x293e20[_0x0ab4('0x1b')]==='undefined';var _0x5000d4=_0x45fad1['count'];var _0x17422f=_0x2a83a8?0x0:_0x293e20[_0x0ab4('0x19')];var _0x2f50d2=_0x2a83a8?_0x45fad1['count']:_0x293e20[_0x0ab4('0x19')]+_0x293e20[_0x0ab4('0x1b')];var _0x212ebd;if(_0x2f50d2>=_0x5000d4){_0x2f50d2=_0x5000d4;_0x212ebd=0xc8;}else{_0x212ebd=0xce;}_0x36d246[_0x0ab4('0x16')](_0x212ebd);return _0x36d246['set']('Content-Range',_0x17422f+'-'+_0x2f50d2+'/'+_0x5000d4)[_0x0ab4('0x18')](_0x45fad1);}return null;};}function patchUpdates(_0x5b1ed5){return function(_0x2b0e29){try{jsonpatch[_0x0ab4('0x1c')](_0x2b0e29,_0x5b1ed5,!![]);}catch(_0x5bb1d0){return BPromise[_0x0ab4('0x1d')](_0x5bb1d0);}return _0x2b0e29[_0x0ab4('0x1e')]();};}function saveUpdates(_0x2c55b3,_0x1d5c14){return function(_0x12d06d){if(_0x12d06d){return _0x12d06d['update'](_0x2c55b3)['then'](function(_0x24b929){return _0x24b929;});}return null;};}function removeEntity(_0x14087f,_0x392afe){return function(_0x13c882){if(_0x13c882){return _0x13c882['destroy']()[_0x0ab4('0x1f')](function(){var _0x3caa9d=_0x13c882[_0x0ab4('0x20')]({'plain':!![]});var _0x4ea9aa='ContactItemTypes';return db[_0x0ab4('0x21')][_0x0ab4('0x22')]({'where':{'type':_0x4ea9aa,'resourceId':_0x3caa9d['id']}})[_0x0ab4('0x1f')](function(){return _0x13c882;});})['then'](function(){_0x14087f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19ecc6,_0x5ba3a2){return function(_0x3bf844){if(!_0x3bf844){_0x19ecc6[_0x0ab4('0x15')](0x194);}return _0x3bf844;};}function handleError(_0x4f1aeb,_0x4bd747){_0x4bd747=_0x4bd747||0x1f4;return function(_0x4d0cc1){logger[_0x0ab4('0x23')](_0x4d0cc1[_0x0ab4('0x24')]);if(_0x4d0cc1[_0x0ab4('0x25')]){delete _0x4d0cc1[_0x0ab4('0x25')];}_0x4f1aeb[_0x0ab4('0x16')](_0x4bd747)['send'](_0x4d0cc1);};}exports['index']=function(_0x580d56,_0x2e7a97){var _0x2b66d5={},_0x155d96={},_0x182bbe={'count':0x0,'rows':[]};var _0x46eda7=_['map'](db['ContactItemType'][_0x0ab4('0x26')],function(_0xe6682){return{'name':_0xe6682[_0x0ab4('0x27')],'type':_0xe6682['type']['key']};});_0x155d96[_0x0ab4('0x28')]=_['map'](_0x46eda7,_0x0ab4('0x25'));_0x155d96[_0x0ab4('0x29')]=_[_0x0ab4('0x2a')](_0x580d56[_0x0ab4('0x29')]);_0x155d96[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x155d96['model'],_0x155d96[_0x0ab4('0x29')]);_0x2b66d5[_0x0ab4('0x2d')]=_[_0x0ab4('0x2c')](_0x155d96[_0x0ab4('0x28')],qs['fields'](_0x580d56['query'][_0x0ab4('0x2e')]));_0x2b66d5[_0x0ab4('0x2d')]=_0x2b66d5[_0x0ab4('0x2d')]['length']?_0x2b66d5['attributes']:_0x155d96['model'];if(!_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x2f')](_0x0ab4('0x30'))){_0x2b66d5['limit']=qs['limit'](_0x580d56['query'][_0x0ab4('0x1b')]);_0x2b66d5[_0x0ab4('0x19')]=qs[_0x0ab4('0x19')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x19')]);}_0x2b66d5[_0x0ab4('0x31')]=qs[_0x0ab4('0x32')](_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x32')]);_0x2b66d5[_0x0ab4('0x33')]=qs['filters'](_[_0x0ab4('0x34')](_0x580d56[_0x0ab4('0x29')],_0x155d96[_0x0ab4('0x2b')]),_0x46eda7);if(_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]){_0x2b66d5[_0x0ab4('0x33')]=_[_0x0ab4('0x36')](_0x2b66d5[_0x0ab4('0x33')],{'$or':_[_0x0ab4('0x37')](_0x46eda7,function(_0x3774ca){if(_0x3774ca[_0x0ab4('0x38')]!==_0x0ab4('0x39')){var _0x4a05c4={};_0x4a05c4[_0x3774ca[_0x0ab4('0x25')]]={'$like':'%'+_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x35')]+'%'};return _0x4a05c4;}})});}_0x2b66d5=_[_0x0ab4('0x36')]({},_0x2b66d5,_0x580d56['options']);var _0x42bece={'where':_0x2b66d5['where']};return db[_0x0ab4('0x3a')][_0x0ab4('0x3b')](_0x42bece)[_0x0ab4('0x1f')](function(_0x245021){_0x182bbe[_0x0ab4('0x3b')]=_0x245021;if(_0x580d56[_0x0ab4('0x29')]['includeAll']){_0x2b66d5[_0x0ab4('0x3c')]=[{'all':!![]}];}return db[_0x0ab4('0x3a')][_0x0ab4('0x3d')](_0x2b66d5);})['then'](function(_0x395e0b){_0x182bbe[_0x0ab4('0x3e')]=_0x395e0b;return _0x182bbe;})[_0x0ab4('0x1f')](respondWithFilteredResult(_0x2e7a97,_0x2b66d5))[_0x0ab4('0x3f')](handleError(_0x2e7a97,null));};exports[_0x0ab4('0x40')]=function(_0x5aa047,_0x5d70eb){var _0x498845={'raw':!![],'where':{'id':_0x5aa047[_0x0ab4('0x41')]['id']}},_0x2f54dd={};_0x2f54dd['model']=_[_0x0ab4('0x2a')](db['ContactItemType'][_0x0ab4('0x26')]);_0x2f54dd['query']=_[_0x0ab4('0x2a')](_0x5aa047[_0x0ab4('0x29')]);_0x2f54dd[_0x0ab4('0x2b')]=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],_0x2f54dd[_0x0ab4('0x29')]);_0x498845['attributes']=_[_0x0ab4('0x2c')](_0x2f54dd[_0x0ab4('0x28')],qs[_0x0ab4('0x2e')](_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x2e')]));_0x498845[_0x0ab4('0x2d')]=_0x498845['attributes'][_0x0ab4('0x42')]?_0x498845['attributes']:_0x2f54dd[_0x0ab4('0x28')];if(_0x5aa047[_0x0ab4('0x29')][_0x0ab4('0x43')]){_0x498845['include']=[{'all':!![]}];}_0x498845=_[_0x0ab4('0x36')]({},_0x498845,_0x5aa047[_0x0ab4('0x44')]);return db[_0x0ab4('0x3a')][_0x0ab4('0x45')](_0x498845)[_0x0ab4('0x1f')](handleEntityNotFound(_0x5d70eb,null))[_0x0ab4('0x1f')](respondWithResult(_0x5d70eb,null))['catch'](handleError(_0x5d70eb,null));};exports[_0x0ab4('0x46')]=function(_0xdcc118,_0x302894){return db[_0x0ab4('0x3a')][_0x0ab4('0x46')](_0xdcc118[_0x0ab4('0x47')],{})[_0x0ab4('0x1f')](function(_0x356bc9){var _0x22402e=_0xdcc118[_0x0ab4('0x48')][_0x0ab4('0x20')]({'plain':!![]});if(!_0x22402e)throw new Error(_0x0ab4('0x49'));if(_0x22402e[_0x0ab4('0x4a')]==='user'){var _0x2c3a0a=_0x356bc9[_0x0ab4('0x20')]({'plain':!![]});var _0x5800cc=_0x0ab4('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x5800cc,'userProfileId':_0x22402e[_0x0ab4('0x4c')]},'raw':!![]})[_0x0ab4('0x1f')](function(_0x156e22){if(_0x156e22&&_0x156e22['autoAssociation']===0x0){return db[_0x0ab4('0x21')][_0x0ab4('0x46')]({'name':_0x2c3a0a[_0x0ab4('0x25')],'resourceId':_0x2c3a0a['id'],'type':_0x156e22[_0x0ab4('0x25')],'sectionId':_0x156e22['id']},{})[_0x0ab4('0x1f')](function(){return _0x356bc9;});}else{return _0x356bc9;}})[_0x0ab4('0x3f')](function(_0x1eea3b){logger['error'](_0x0ab4('0x4d'),_0x1eea3b);throw _0x1eea3b;});}return _0x356bc9;})['then'](respondWithResult(_0x302894,0xc9))[_0x0ab4('0x3f')](handleError(_0x302894,null));};exports['update']=function(_0x2597f2,_0x5550ff){if(_0x2597f2['body']['id']){delete _0x2597f2[_0x0ab4('0x47')]['id'];}return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2597f2[_0x0ab4('0x41')]['id']}})['then'](handleEntityNotFound(_0x5550ff,null))[_0x0ab4('0x1f')](saveUpdates(_0x2597f2[_0x0ab4('0x47')],null))[_0x0ab4('0x1f')](respondWithResult(_0x5550ff,null))[_0x0ab4('0x3f')](handleError(_0x5550ff,null));};exports[_0x0ab4('0x22')]=function(_0x2354fa,_0x134437){return db[_0x0ab4('0x3a')][_0x0ab4('0x45')]({'where':{'id':_0x2354fa[_0x0ab4('0x41')]['id']}})[_0x0ab4('0x1f')](handleEntityNotFound(_0x134437,null))[_0x0ab4('0x1f')](db[_0x0ab4('0x4e')][_0x0ab4('0x4f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2354fa[_0x0ab4('0x41')]['id']}}))[_0x0ab4('0x1f')](removeEntity(_0x134437,null))[_0x0ab4('0x3f')](handleError(_0x134437,null));}; \ No newline at end of file +var _0xb016=['findAll','rows','show','keys','length','catch','create','role','user','UserProfileSection','find','userProfileId','autoAssociation','error','update','body','params','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ContactItemTypes','UserProfileResource','end','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xb016,0x159));var _0x6b01=function(_0x15f1cb,_0x2f9f9f){_0x15f1cb=_0x15f1cb-0x0;var _0xfd8bb4=_0xb016[_0x15f1cb];return _0xfd8bb4;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){var _0x2ae85e=_0x399808[_0x6b01('0x23')]({'plain':!![]});var _0x2456e9=_0x6b01('0x24');return db[_0x6b01('0x25')][_0x6b01('0x22')]({'where':{'type':_0x2456e9,'resourceId':_0x2ae85e['id']}})[_0x6b01('0x21')](function(){return _0x399808;});})[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x26')]();});}};}function handleEntityNotFound(_0x55ca4b,_0x33d95d){return function(_0x220efb){if(!_0x220efb){_0x55ca4b[_0x6b01('0x15')](0x194);}return _0x220efb;};}function handleError(_0x21f165,_0x68491){_0x68491=_0x68491||0x1f4;return function(_0x528cbd){logger['error'](_0x528cbd[_0x6b01('0x27')]);if(_0x528cbd[_0x6b01('0x28')]){delete _0x528cbd[_0x6b01('0x28')];}_0x21f165[_0x6b01('0x16')](_0x68491)[_0x6b01('0x29')](_0x528cbd);};}exports[_0x6b01('0x2a')]=function(_0x542ca0,_0x39f193){var _0x5482a8={},_0x3942d7={},_0x4e7e32={'count':0x0,'rows':[]};var _0x6920cf=_[_0x6b01('0x2b')](db[_0x6b01('0x2c')][_0x6b01('0x2d')],function(_0x3c8009){return{'name':_0x3c8009['fieldName'],'type':_0x3c8009[_0x6b01('0x2e')][_0x6b01('0x2f')]};});_0x3942d7[_0x6b01('0x30')]=_['map'](_0x6920cf,'name');_0x3942d7[_0x6b01('0x31')]=_['keys'](_0x542ca0[_0x6b01('0x31')]);_0x3942d7[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0x3942d7['model'],_0x3942d7[_0x6b01('0x31')]);_0x5482a8[_0x6b01('0x34')]=_[_0x6b01('0x33')](_0x3942d7['model'],qs[_0x6b01('0x35')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x35')]));_0x5482a8[_0x6b01('0x34')]=_0x5482a8[_0x6b01('0x34')]['length']?_0x5482a8[_0x6b01('0x34')]:_0x3942d7[_0x6b01('0x30')];if(!_0x542ca0[_0x6b01('0x31')][_0x6b01('0x36')](_0x6b01('0x37'))){_0x5482a8[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x542ca0[_0x6b01('0x31')]['limit']);_0x5482a8[_0x6b01('0x18')]=qs['offset'](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x18')]);}_0x5482a8[_0x6b01('0x38')]=qs[_0x6b01('0x39')](_0x542ca0[_0x6b01('0x31')][_0x6b01('0x39')]);_0x5482a8[_0x6b01('0x3a')]=qs['filters'](_[_0x6b01('0x3b')](_0x542ca0[_0x6b01('0x31')],_0x3942d7[_0x6b01('0x32')]),_0x6920cf);if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]){_0x5482a8[_0x6b01('0x3a')]=_[_0x6b01('0x3d')](_0x5482a8[_0x6b01('0x3a')],{'$or':_['map'](_0x6920cf,function(_0x2c42c3){if(_0x2c42c3['type']!==_0x6b01('0x3e')){var _0x422c38={};_0x422c38[_0x2c42c3['name']]={'$like':'%'+_0x542ca0[_0x6b01('0x31')][_0x6b01('0x3c')]+'%'};return _0x422c38;}})});}_0x5482a8=_[_0x6b01('0x3d')]({},_0x5482a8,_0x542ca0[_0x6b01('0x3f')]);var _0x2d4125={'where':_0x5482a8[_0x6b01('0x3a')]};return db[_0x6b01('0x2c')][_0x6b01('0x1b')](_0x2d4125)[_0x6b01('0x21')](function(_0x17f335){_0x4e7e32['count']=_0x17f335;if(_0x542ca0[_0x6b01('0x31')][_0x6b01('0x40')]){_0x5482a8['include']=[{'all':!![]}];}return db['ContactItemType'][_0x6b01('0x41')](_0x5482a8);})[_0x6b01('0x21')](function(_0x558ec1){_0x4e7e32[_0x6b01('0x42')]=_0x558ec1;return _0x4e7e32;})[_0x6b01('0x21')](respondWithFilteredResult(_0x39f193,_0x5482a8))['catch'](handleError(_0x39f193,null));};exports[_0x6b01('0x43')]=function(_0x5e6f28,_0x2ab117){var _0x1c6eba={'raw':!![],'where':{'id':_0x5e6f28['params']['id']}},_0xf52992={};_0xf52992[_0x6b01('0x30')]=_[_0x6b01('0x44')](db['ContactItemType']['rawAttributes']);_0xf52992['query']=_[_0x6b01('0x44')](_0x5e6f28[_0x6b01('0x31')]);_0xf52992[_0x6b01('0x32')]=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],_0xf52992[_0x6b01('0x31')]);_0x1c6eba['attributes']=_[_0x6b01('0x33')](_0xf52992[_0x6b01('0x30')],qs[_0x6b01('0x35')](_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x35')]));_0x1c6eba[_0x6b01('0x34')]=_0x1c6eba['attributes'][_0x6b01('0x45')]?_0x1c6eba['attributes']:_0xf52992['model'];if(_0x5e6f28[_0x6b01('0x31')][_0x6b01('0x40')]){_0x1c6eba['include']=[{'all':!![]}];}_0x1c6eba=_[_0x6b01('0x3d')]({},_0x1c6eba,_0x5e6f28[_0x6b01('0x3f')]);return db[_0x6b01('0x2c')]['find'](_0x1c6eba)['then'](handleEntityNotFound(_0x2ab117,null))['then'](respondWithResult(_0x2ab117,null))[_0x6b01('0x46')](handleError(_0x2ab117,null));};exports[_0x6b01('0x47')]=function(_0x518d94,_0x34cef6){return db['ContactItemType']['create'](_0x518d94['body'],{})[_0x6b01('0x21')](function(_0x45288a){var _0x4baef8=_0x518d94['user'][_0x6b01('0x23')]({'plain':!![]});if(!_0x4baef8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4baef8[_0x6b01('0x48')]===_0x6b01('0x49')){var _0x32d446=_0x45288a[_0x6b01('0x23')]({'plain':!![]});var _0x13f6d7='ContactItemTypes';return db[_0x6b01('0x4a')][_0x6b01('0x4b')]({'where':{'name':_0x13f6d7,'userProfileId':_0x4baef8[_0x6b01('0x4c')]},'raw':!![]})['then'](function(_0x3884e){if(_0x3884e&&_0x3884e[_0x6b01('0x4d')]===0x0){return db['UserProfileResource'][_0x6b01('0x47')]({'name':_0x32d446[_0x6b01('0x28')],'resourceId':_0x32d446['id'],'type':_0x3884e[_0x6b01('0x28')],'sectionId':_0x3884e['id']},{})[_0x6b01('0x21')](function(){return _0x45288a;});}else{return _0x45288a;}})['catch'](function(_0x5d46e7){logger[_0x6b01('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d46e7);throw _0x5d46e7;});}return _0x45288a;})['then'](respondWithResult(_0x34cef6,0xc9))[_0x6b01('0x46')](handleError(_0x34cef6,null));};exports[_0x6b01('0x4f')]=function(_0x5b5c0c,_0x2bf4b5){if(_0x5b5c0c[_0x6b01('0x50')]['id']){delete _0x5b5c0c['body']['id'];}return db[_0x6b01('0x2c')][_0x6b01('0x4b')]({'where':{'id':_0x5b5c0c[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x2bf4b5,null))[_0x6b01('0x21')](saveUpdates(_0x5b5c0c['body'],null))[_0x6b01('0x21')](respondWithResult(_0x2bf4b5,null))['catch'](handleError(_0x2bf4b5,null));};exports[_0x6b01('0x22')]=function(_0x331815,_0x415fdd){return db['ContactItemType'][_0x6b01('0x4b')]({'where':{'id':_0x331815[_0x6b01('0x51')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x415fdd,null))[_0x6b01('0x21')](db['CmContactHasItem'][_0x6b01('0x4f')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x331815[_0x6b01('0x51')]['id']}}))[_0x6b01('0x21')](removeEntity(_0x415fdd,null))['catch'](handleError(_0x415fdd,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index f94162a..410bcad 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 _0x2ba9=['bluebird','request-promise','rimraf','../../config/environment','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment'];(function(_0x1d7075,_0x206f0e){var _0x125ae0=function(_0x258492){while(--_0x258492){_0x1d7075['push'](_0x1d7075['shift']());}};_0x125ae0(++_0x206f0e);}(_0x2ba9,0x1db));var _0x92ba=function(_0x4197c1,_0x22aae6){_0x4197c1=_0x4197c1-0x0;var _0xb3ea0d=_0x2ba9[_0x4197c1];return _0xb3ea0d;};'use strict';var _=require(_0x92ba('0x0'));var util=require(_0x92ba('0x1'));var logger=require(_0x92ba('0x2'))(_0x92ba('0x3'));var moment=require(_0x92ba('0x4'));var BPromise=require(_0x92ba('0x5'));var rp=require(_0x92ba('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92ba('0x7'));var config=require(_0x92ba('0x8'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x4096c9,_0x25814c){return _0x4096c9[_0x92ba('0x9')](_0x92ba('0xa'),attributes,{'tableName':_0x92ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e8b=['exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x3f3ad1,_0x30e382){var _0x56e3e7=function(_0x542a53){while(--_0x542a53){_0x3f3ad1['push'](_0x3f3ad1['shift']());}};_0x56e3e7(++_0x30e382);}(_0x0e8b,0x1f2));var _0xb0e8=function(_0x1da84f,_0x2e8fb1){_0x1da84f=_0x1da84f-0x0;var _0x28d11e=_0x0e8b[_0x1da84f];return _0x28d11e;};'use strict';var _=require('lodash');var util=require(_0xb0e8('0x0'));var logger=require(_0xb0e8('0x1'))(_0xb0e8('0x2'));var moment=require('moment');var BPromise=require(_0xb0e8('0x3'));var rp=require(_0xb0e8('0x4'));var fs=require('fs');var path=require(_0xb0e8('0x5'));var rimraf=require(_0xb0e8('0x6'));var config=require(_0xb0e8('0x7'));var attributes=require(_0xb0e8('0x8'));module[_0xb0e8('0x9')]=function(_0x4bea2d,_0x504aa4){return _0x4bea2d[_0xb0e8('0xa')](_0xb0e8('0xb'),attributes,{'tableName':_0xb0e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index d171acd..b3c4ff6 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 _0x1d3a=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ContactItemType,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result'];(function(_0x4d03d6,_0x438a06){var _0x22752e=function(_0x1b2894){while(--_0x1b2894){_0x4d03d6['push'](_0x4d03d6['shift']());}};_0x22752e(++_0x438a06);}(_0x1d3a,0xa2));var _0xa1d3=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x1d3a[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xa1d3('0x0'));var util=require(_0xa1d3('0x1'));var moment=require(_0xa1d3('0x2'));var BPromise=require(_0xa1d3('0x3'));var rs=require(_0xa1d3('0x4'));var fs=require('fs');var Redis=require(_0xa1d3('0x5'));var db=require(_0xa1d3('0x6'))['db'];var utils=require(_0xa1d3('0x7'));var logger=require(_0xa1d3('0x8'))(_0xa1d3('0x9'));var config=require(_0xa1d3('0xa'));var jayson=require(_0xa1d3('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29195b,_0x32d5b4,_0x59ac6c){return new BPromise(function(_0x534c61,_0x26c928){return client['request'](_0x29195b,_0x59ac6c)[_0xa1d3('0xc')](function(_0x3e385c){logger[_0xa1d3('0xd')](_0xa1d3('0xe'),_0x32d5b4,'request\x20sent');logger[_0xa1d3('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x32d5b4,'request\x20sent',JSON[_0xa1d3('0x10')](_0x3e385c));if(_0x3e385c[_0xa1d3('0x11')]){if(_0x3e385c[_0xa1d3('0x11')][_0xa1d3('0x12')]===0x1f4){logger['error'](_0xa1d3('0xe'),_0x32d5b4,_0x3e385c[_0xa1d3('0x11')][_0xa1d3('0x13')]);return _0x26c928(_0x3e385c[_0xa1d3('0x11')][_0xa1d3('0x13')]);}logger[_0xa1d3('0x11')](_0xa1d3('0xe'),_0x32d5b4,_0x3e385c['error'][_0xa1d3('0x13')]);return _0x534c61(_0x3e385c[_0xa1d3('0x11')][_0xa1d3('0x13')]);}else{logger[_0xa1d3('0xd')](_0xa1d3('0xe'),_0x32d5b4,_0xa1d3('0x14'));_0x534c61(_0x3e385c[_0xa1d3('0x15')][_0xa1d3('0x13')]);}})[_0xa1d3('0x16')](function(_0x3a9f2a){logger[_0xa1d3('0x11')]('ContactItemType,\x20%s,\x20%s',_0x32d5b4,_0x3a9f2a);_0x26c928(_0x3a9f2a);});});} \ No newline at end of file +var _0xfaec=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ContactItemType,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util'];(function(_0x12fe27,_0x47e1c4){var _0x1749cb=function(_0x4cd481){while(--_0x4cd481){_0x12fe27['push'](_0x12fe27['shift']());}};_0x1749cb(++_0x47e1c4);}(_0xfaec,0x139));var _0xcfae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfaec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcfae('0x0'));var util=require(_0xcfae('0x1'));var moment=require(_0xcfae('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfae('0x3'));var fs=require('fs');var Redis=require(_0xcfae('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcfae('0x5'))(_0xcfae('0x6'));var config=require(_0xcfae('0x7'));var jayson=require(_0xcfae('0x8'));var client=jayson[_0xcfae('0x9')][_0xcfae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x345e43,_0x32bbb9,_0x333162){return new BPromise(function(_0x56a4c6,_0x2ea7e9){return client[_0xcfae('0xb')](_0x345e43,_0x333162)[_0xcfae('0xc')](function(_0x2eea0e){logger['info'](_0xcfae('0xd'),_0x32bbb9,_0xcfae('0xe'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x32bbb9,_0xcfae('0xe'),JSON['stringify'](_0x2eea0e));if(_0x2eea0e[_0xcfae('0xf')]){if(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x10')]===0x1f4){logger[_0xcfae('0xf')]('ContactItemType,\x20%s,\x20%s',_0x32bbb9,_0x2eea0e[_0xcfae('0xf')]['message']);return _0x2ea7e9(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x11')]);}logger['error'](_0xcfae('0xd'),_0x32bbb9,_0x2eea0e['error'][_0xcfae('0x11')]);return _0x56a4c6(_0x2eea0e[_0xcfae('0xf')][_0xcfae('0x11')]);}else{logger[_0xcfae('0x12')]('ContactItemType,\x20%s,\x20%s',_0x32bbb9,'request\x20sent');_0x56a4c6(_0x2eea0e[_0xcfae('0x13')][_0xcfae('0x11')]);}})[_0xcfae('0x14')](function(_0x463351){logger[_0xcfae('0xf')](_0xcfae('0xd'),_0x32bbb9,_0x463351);_0x2ea7e9(_0x463351);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 0da15aa..b4fd030 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 _0xf9de=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','/:id','show','post','create','put'];(function(_0xa03c5,_0x4ef050){var _0x977cb4=function(_0x111acc){while(--_0x111acc){_0xa03c5['push'](_0xa03c5['shift']());}};_0x977cb4(++_0x4ef050);}(_0xf9de,0x12f));var _0xef9d=function(_0x1b3c8a,_0x303d8f){_0x1b3c8a=_0x1b3c8a-0x0;var _0x5ebd13=_0xf9de[_0x1b3c8a];return _0x5ebd13;};'use strict';var multer=require(_0xef9d('0x0'));var util=require(_0xef9d('0x1'));var path=require(_0xef9d('0x2'));var timeout=require(_0xef9d('0x3'));var express=require(_0xef9d('0x4'));var router=express[_0xef9d('0x5')]();var fs_extra=require(_0xef9d('0x6'));var auth=require(_0xef9d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xef9d('0x8'));var controller=require(_0xef9d('0x9'));router[_0xef9d('0xa')]('/',auth[_0xef9d('0xb')](),controller['index']);router[_0xef9d('0xa')](_0xef9d('0xc'),auth[_0xef9d('0xb')](),controller[_0xef9d('0xd')]);router[_0xef9d('0xe')]('/',auth[_0xef9d('0xb')](),controller[_0xef9d('0xf')]);router[_0xef9d('0x10')]('/:id',auth[_0xef9d('0xb')](),controller[_0xef9d('0x11')]);router['delete'](_0xef9d('0xc'),auth[_0xef9d('0xb')](),controller[_0xef9d('0x12')]);module[_0xef9d('0x13')]=router; \ No newline at end of file +var _0x1550=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x74895e,_0x298c35){var _0x40bc2a=function(_0x558c6d){while(--_0x558c6d){_0x74895e['push'](_0x74895e['shift']());}};_0x40bc2a(++_0x298c35);}(_0x1550,0x1b8));var _0x0155=function(_0x41992f,_0x39f0c6){_0x41992f=_0x41992f-0x0;var _0xc92d25=_0x1550[_0x41992f];return _0xc92d25;};'use strict';var multer=require('multer');var util=require(_0x0155('0x0'));var path=require('path');var timeout=require(_0x0155('0x1'));var express=require(_0x0155('0x2'));var router=express[_0x0155('0x3')]();var fs_extra=require(_0x0155('0x4'));var auth=require(_0x0155('0x5'));var interaction=require(_0x0155('0x6'));var config=require('../../config/environment');var controller=require(_0x0155('0x7'));router[_0x0155('0x8')]('/',auth[_0x0155('0x9')](),controller[_0x0155('0xa')]);router[_0x0155('0x8')](_0x0155('0xb'),auth[_0x0155('0x9')](),controller[_0x0155('0xc')]);router[_0x0155('0xd')]('/',auth[_0x0155('0x9')](),controller['create']);router[_0x0155('0xe')](_0x0155('0xb'),auth['isAuthenticated'](),controller[_0x0155('0xf')]);router[_0x0155('0x10')](_0x0155('0xb'),auth[_0x0155('0x9')](),controller[_0x0155('0x11')]);module[_0x0155('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 2fe3b20..4c7830f 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 _0x2032=['name','exports','STRING'];(function(_0x13320a,_0x5cef3f){var _0x1b4ce7=function(_0xd16015){while(--_0xd16015){_0x13320a['push'](_0x13320a['shift']());}};_0x1b4ce7(++_0x5cef3f);}(_0x2032,0xd9));var _0x2203=function(_0x1ab766,_0xcf84ed){_0x1ab766=_0x1ab766-0x0;var _0x1152e7=_0x2032[_0x1ab766];return _0x1152e7;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b20e659..dce952f 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 _0xd19c=['type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','role','CustomDashboards','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Dashboard','fieldName'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd19c,0x1cf));var _0xcd19=function(_0x225776,_0x249f77){_0x225776=_0x225776-0x0;var _0x7d5cef=_0xd19c[_0x225776];return _0x7d5cef;};'use strict';var emlformat=require(_0xcd19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd19('0x1'));var jsonpatch=require(_0xcd19('0x2'));var rp=require(_0xcd19('0x3'));var moment=require(_0xcd19('0x4'));var BPromise=require(_0xcd19('0x5'));var Mustache=require(_0xcd19('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcd19('0x7'));var crypto=require(_0xcd19('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xcd19('0x9'));var toCsv=require(_0xcd19('0xa'));var querystring=require(_0xcd19('0xb'));var Papa=require(_0xcd19('0xc'));var Redis=require('ioredis');var authService=require(_0xcd19('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcd19('0xe'));var hardwareService=require(_0xcd19('0xf'));var logger=require(_0xcd19('0x10'))(_0xcd19('0x11'));var utils=require(_0xcd19('0x12'));var config=require(_0xcd19('0x13'));var licenseUtil=require(_0xcd19('0x14'));var db=require(_0xcd19('0x15'))['db'];config[_0xcd19('0x16')]=_['defaults'](config['redis'],{'host':_0xcd19('0x17'),'port':0x18eb});var socket=require(_0xcd19('0x18'))(new Redis(config['redis']));require('./dashboard.socket')[_0xcd19('0x19')](socket);function respondWithStatusCode(_0x24af97,_0x47e479){_0x47e479=_0x47e479||0xcc;return function(_0x58820f){if(_0x58820f){return _0x24af97[_0xcd19('0x1a')](_0x47e479);}return _0x24af97[_0xcd19('0x1b')](_0x47e479)[_0xcd19('0x1c')]();};}function respondWithResult(_0x18a13d,_0x181d84){_0x181d84=_0x181d84||0xc8;return function(_0x1f64d6){if(_0x1f64d6){return _0x18a13d[_0xcd19('0x1b')](_0x181d84)[_0xcd19('0x1d')](_0x1f64d6);}};}function respondWithFilteredResult(_0x274017,_0xde20be){return function(_0x5149d6){if(_0x5149d6){var _0x4fee5d=typeof _0xde20be[_0xcd19('0x1e')]===_0xcd19('0x1f')&&typeof _0xde20be['limit']===_0xcd19('0x1f');var _0x346d10=_0x5149d6[_0xcd19('0x20')];var _0x139781=_0x4fee5d?0x0:_0xde20be[_0xcd19('0x1e')];var _0x2a27ad=_0x4fee5d?_0x5149d6[_0xcd19('0x20')]:_0xde20be[_0xcd19('0x1e')]+_0xde20be['limit'];var _0x3f2e70;if(_0x2a27ad>=_0x346d10){_0x2a27ad=_0x346d10;_0x3f2e70=0xc8;}else{_0x3f2e70=0xce;}_0x274017[_0xcd19('0x1b')](_0x3f2e70);return _0x274017[_0xcd19('0x21')](_0xcd19('0x22'),_0x139781+'-'+_0x2a27ad+'/'+_0x346d10)[_0xcd19('0x1d')](_0x5149d6);}return null;};}function patchUpdates(_0xe800ca){return function(_0x336848){try{jsonpatch['apply'](_0x336848,_0xe800ca,!![]);}catch(_0x177d47){return BPromise[_0xcd19('0x23')](_0x177d47);}return _0x336848[_0xcd19('0x24')]();};}function saveUpdates(_0x133724,_0x26ad1a){return function(_0x45bec8){if(_0x45bec8){return _0x45bec8['update'](_0x133724)[_0xcd19('0x25')](function(_0x4a2ecb){return _0x4a2ecb;});}return null;};}function removeEntity(_0x253bb3,_0x258792){return function(_0x44e5ed){if(_0x44e5ed){return _0x44e5ed[_0xcd19('0x26')]()[_0xcd19('0x25')](function(){var _0x43cd6b=_0x44e5ed[_0xcd19('0x27')]({'plain':!![]});var _0x541172='CustomDashboards';return db[_0xcd19('0x28')][_0xcd19('0x26')]({'where':{'type':_0x541172,'resourceId':_0x43cd6b['id']}})[_0xcd19('0x25')](function(){return _0x44e5ed;});})[_0xcd19('0x25')](function(){_0x253bb3[_0xcd19('0x1b')](0xcc)[_0xcd19('0x1c')]();});}};}function handleEntityNotFound(_0x1c8eba,_0x438f50){return function(_0x86ae42){if(!_0x86ae42){_0x1c8eba[_0xcd19('0x1a')](0x194);}return _0x86ae42;};}function handleError(_0xb9b456,_0x223d70){_0x223d70=_0x223d70||0x1f4;return function(_0x483302){logger[_0xcd19('0x29')](_0x483302[_0xcd19('0x2a')]);if(_0x483302['name']){delete _0x483302[_0xcd19('0x2b')];}_0xb9b456[_0xcd19('0x1b')](_0x223d70)[_0xcd19('0x2c')](_0x483302);};}exports[_0xcd19('0x2d')]=function(_0x54a05b,_0x2ebecc){var _0x5a9c61={},_0x5cfed4={},_0x106f8e={'count':0x0,'rows':[]};var _0x5aaf93=_[_0xcd19('0x2e')](db[_0xcd19('0x2f')]['rawAttributes'],function(_0x213c1d){return{'name':_0x213c1d[_0xcd19('0x30')],'type':_0x213c1d[_0xcd19('0x31')]['key']};});_0x5cfed4['model']=_[_0xcd19('0x2e')](_0x5aaf93,'name');_0x5cfed4['query']=_[_0xcd19('0x32')](_0x54a05b[_0xcd19('0x33')]);_0x5cfed4[_0xcd19('0x34')]=_[_0xcd19('0x35')](_0x5cfed4[_0xcd19('0x36')],_0x5cfed4[_0xcd19('0x33')]);_0x5a9c61[_0xcd19('0x37')]=_[_0xcd19('0x35')](_0x5cfed4['model'],qs[_0xcd19('0x38')](_0x54a05b[_0xcd19('0x33')][_0xcd19('0x38')]));_0x5a9c61['attributes']=_0x5a9c61[_0xcd19('0x37')]['length']?_0x5a9c61[_0xcd19('0x37')]:_0x5cfed4['model'];if(!_0x54a05b[_0xcd19('0x33')][_0xcd19('0x39')](_0xcd19('0x3a'))){_0x5a9c61[_0xcd19('0x3b')]=qs['limit'](_0x54a05b[_0xcd19('0x33')][_0xcd19('0x3b')]);_0x5a9c61[_0xcd19('0x1e')]=qs[_0xcd19('0x1e')](_0x54a05b[_0xcd19('0x33')][_0xcd19('0x1e')]);}_0x5a9c61[_0xcd19('0x3c')]=qs[_0xcd19('0x3d')](_0x54a05b['query'][_0xcd19('0x3d')]);_0x5a9c61[_0xcd19('0x3e')]=qs['filters'](_[_0xcd19('0x3f')](_0x54a05b[_0xcd19('0x33')],_0x5cfed4[_0xcd19('0x34')]),_0x5aaf93);if(_0x54a05b[_0xcd19('0x33')][_0xcd19('0x40')]){_0x5a9c61['where']=_['merge'](_0x5a9c61['where'],{'$or':_[_0xcd19('0x2e')](_0x5aaf93,function(_0x533ec5){if(_0x533ec5[_0xcd19('0x31')]!=='VIRTUAL'){var _0x5a097d={};_0x5a097d[_0x533ec5[_0xcd19('0x2b')]]={'$like':'%'+_0x54a05b['query'][_0xcd19('0x40')]+'%'};return _0x5a097d;}})});}_0x5a9c61=_[_0xcd19('0x41')]({},_0x5a9c61,_0x54a05b[_0xcd19('0x42')]);var _0x1b5116={'where':_0x5a9c61[_0xcd19('0x3e')]};return db[_0xcd19('0x2f')][_0xcd19('0x20')](_0x1b5116)[_0xcd19('0x25')](function(_0x50af3b){_0x106f8e[_0xcd19('0x20')]=_0x50af3b;if(_0x54a05b['query'][_0xcd19('0x43')]){_0x5a9c61[_0xcd19('0x44')]=[{'all':!![]}];}return db['Dashboard'][_0xcd19('0x45')](_0x5a9c61);})[_0xcd19('0x25')](function(_0x16135a){_0x106f8e['rows']=_0x16135a;return _0x106f8e;})[_0xcd19('0x25')](respondWithFilteredResult(_0x2ebecc,_0x5a9c61))[_0xcd19('0x46')](handleError(_0x2ebecc,null));};exports[_0xcd19('0x47')]=function(_0x119c4d,_0x5277ac){var _0x1d8534={'raw':![],'where':{'id':_0x119c4d[_0xcd19('0x48')]['id']}},_0x137a11={};_0x137a11[_0xcd19('0x36')]=_['keys'](db[_0xcd19('0x2f')][_0xcd19('0x49')]);_0x137a11[_0xcd19('0x33')]=_[_0xcd19('0x32')](_0x119c4d[_0xcd19('0x33')]);_0x137a11[_0xcd19('0x34')]=_[_0xcd19('0x35')](_0x137a11['model'],_0x137a11[_0xcd19('0x33')]);_0x1d8534[_0xcd19('0x37')]=_[_0xcd19('0x35')](_0x137a11[_0xcd19('0x36')],qs['fields'](_0x119c4d['query'][_0xcd19('0x38')]));_0x1d8534[_0xcd19('0x37')]=_0x1d8534['attributes'][_0xcd19('0x4a')]?_0x1d8534[_0xcd19('0x37')]:_0x137a11[_0xcd19('0x36')];if(_0x119c4d[_0xcd19('0x33')]['includeAll']){_0x1d8534[_0xcd19('0x44')]=[{'all':!![]}];}_0x1d8534=_[_0xcd19('0x41')]({},_0x1d8534,_0x119c4d[_0xcd19('0x42')]);return db[_0xcd19('0x2f')][_0xcd19('0x4b')](_0x1d8534)[_0xcd19('0x25')](handleEntityNotFound(_0x5277ac,null))[_0xcd19('0x25')](respondWithResult(_0x5277ac,null))[_0xcd19('0x46')](handleError(_0x5277ac,null));};exports[_0xcd19('0x4c')]=function(_0x94d8d1,_0x1c4d85){return db[_0xcd19('0x2f')]['create'](_0x94d8d1[_0xcd19('0x4d')],{})[_0xcd19('0x25')](function(_0x5efe6f){var _0x224ef7=_0x94d8d1['user'][_0xcd19('0x27')]({'plain':!![]});if(!_0x224ef7)throw new Error(_0xcd19('0x4e'));if(_0x224ef7['role']===_0xcd19('0x4f')){var _0x3aa4fe=_0x5efe6f[_0xcd19('0x27')]({'plain':!![]});var _0x411555='CustomDashboards';return db['UserProfileSection'][_0xcd19('0x4b')]({'where':{'name':_0x411555,'userProfileId':_0x224ef7[_0xcd19('0x50')]},'raw':!![]})[_0xcd19('0x25')](function(_0x597569){if(_0x597569&&_0x597569[_0xcd19('0x51')]===0x0){return db[_0xcd19('0x28')][_0xcd19('0x4c')]({'name':_0x3aa4fe['name'],'resourceId':_0x3aa4fe['id'],'type':_0x597569[_0xcd19('0x2b')],'sectionId':_0x597569['id']},{})['then'](function(){return _0x5efe6f;});}else{return _0x5efe6f;}})[_0xcd19('0x46')](function(_0x3e7a81){logger[_0xcd19('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e7a81);throw _0x3e7a81;});}return _0x5efe6f;})[_0xcd19('0x25')](respondWithResult(_0x1c4d85,0xc9))[_0xcd19('0x46')](handleError(_0x1c4d85,null));};exports[_0xcd19('0x52')]=function(_0x461287,_0x3a8f35){var _0x1375af={'where':{'id':_0x461287[_0xcd19('0x48')]['id']}},_0x3c062f={};_0x3c062f[_0xcd19('0x36')]=_[_0xcd19('0x32')](db[_0xcd19('0x2f')]['rawAttributes']);_0x1375af[_0xcd19('0x37')]=_['intersection'](_0x3c062f['model'],qs[_0xcd19('0x38')](_0x461287[_0xcd19('0x33')][_0xcd19('0x38')]));_0x1375af[_0xcd19('0x37')]=_0x1375af[_0xcd19('0x37')][_0xcd19('0x4a')]?_0x1375af[_0xcd19('0x37')]:_0x3c062f[_0xcd19('0x36')];if(_0x461287[_0xcd19('0x33')][_0xcd19('0x43')]){_0x1375af[_0xcd19('0x44')]=[{'all':!![]}];}_0x1375af=_[_0xcd19('0x41')]({},_0x1375af,_0x461287[_0xcd19('0x42')]);return db['Dashboard'][_0xcd19('0x4b')](_0x1375af)[_0xcd19('0x25')](handleEntityNotFound(_0x3a8f35,null))[_0xcd19('0x25')](function(_0x321b29){if(_0x321b29){var _0x26dd9b=_0x321b29[_0xcd19('0x27')]({'plain':!![]});_0x26dd9b=qs[_0xcd19('0x53')](_0x26dd9b,['id',_0xcd19('0x54'),_0xcd19('0x55')]);_0x461287[_0xcd19('0x4d')]=_['omit'](_0x461287[_0xcd19('0x4d')],['id',_0xcd19('0x54'),'updatedAt']);return db['Dashboard'][_0xcd19('0x4c')](_[_0xcd19('0x41')](_0x26dd9b,_0x461287[_0xcd19('0x4d')]),{'include':_0x461287[_0xcd19('0x33')][_0xcd19('0x43')]?[{'all':!![]}]:undefined})[_0xcd19('0x25')](function(_0x494b12){var _0x1aaedb=_0x461287[_0xcd19('0x4f')]['get']({'plain':!![]});if(!_0x1aaedb)throw new Error(_0xcd19('0x4e'));if(_0x1aaedb[_0xcd19('0x56')]===_0xcd19('0x4f')){var _0x2b350e=_0x494b12['get']({'plain':!![]});var _0x9d8a26=_0xcd19('0x57');return db['UserProfileSection']['find']({'where':{'name':_0x9d8a26,'userProfileId':_0x1aaedb[_0xcd19('0x50')]},'raw':!![]})[_0xcd19('0x25')](function(_0x1129ae){if(_0x1129ae&&_0x1129ae[_0xcd19('0x51')]===0x0){return db['UserProfileResource'][_0xcd19('0x4c')]({'name':_0x2b350e[_0xcd19('0x2b')],'resourceId':_0x2b350e['id'],'type':_0x1129ae[_0xcd19('0x2b')],'sectionId':_0x1129ae['id']},{})['then'](function(){return _0x494b12;});}else{return _0x494b12;}})[_0xcd19('0x46')](function(_0x3f264b){logger[_0xcd19('0x29')](_0xcd19('0x58'),_0x3f264b);throw _0x3f264b;});}return _0x494b12;});}})[_0xcd19('0x25')](respondWithResult(_0x3a8f35,0xc9))[_0xcd19('0x46')](handleError(_0x3a8f35,null));};exports['update']=function(_0x24708f,_0xf69337){if(_0x24708f[_0xcd19('0x4d')]['id']){delete _0x24708f[_0xcd19('0x4d')]['id'];}return db[_0xcd19('0x2f')][_0xcd19('0x4b')]({'where':{'id':_0x24708f[_0xcd19('0x48')]['id']}})['then'](handleEntityNotFound(_0xf69337,null))['then'](saveUpdates(_0x24708f['body'],null))[_0xcd19('0x25')](respondWithResult(_0xf69337,null))[_0xcd19('0x46')](handleError(_0xf69337,null));};exports[_0xcd19('0x26')]=function(_0x384703,_0x147bd3){return db[_0xcd19('0x2f')][_0xcd19('0x4b')]({'where':{'id':_0x384703['params']['id']}})[_0xcd19('0x25')](handleEntityNotFound(_0x147bd3,null))[_0xcd19('0x25')](removeEntity(_0x147bd3,null))[_0xcd19('0x46')](handleError(_0x147bd3,null));};function widgetAttributes(_0x5a9493){try{switch(_0x5a9493[_0xcd19('0x31')]){case _0xcd19('0x59'):return[{'name':_0xcd19('0x5a'),'value':_0x5a9493['attrUrl']||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493['attrs'][0x0]?_0x5a9493[_0xcd19('0x5b')][0x0][_0xcd19('0x5c')]:undefined)||'https://'}];case _0xcd19('0x5d'):return[{'name':'attrPath','value':_0x5a9493[_0xcd19('0x5e')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493['attrs'][0x0]?_0x5a9493[_0xcd19('0x5b')][0x0]['value']:undefined)||''}];case _0xcd19('0x5f'):return[{'name':_0xcd19('0x60'),'value':_0x5a9493['attrHourFormat']||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x0]?_0x5a9493[_0xcd19('0x5b')][0x0][_0xcd19('0x5c')]:undefined)||_0xcd19('0x61')},{'name':_0xcd19('0x62'),'value':_0x5a9493[_0xcd19('0x62')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x1]?_0x5a9493[_0xcd19('0x5b')][0x1][_0xcd19('0x5c')]:undefined)||_0xcd19('0x63')},{'name':'attrFontSize','value':_0x5a9493['attrFontSize']||(_0x5a9493['attrs']&&_0x5a9493['attrs'][0x2]?_0x5a9493['attrs'][0x2][_0xcd19('0x5c')]:undefined)||0xc}];case _0xcd19('0x64'):return[{'name':_0xcd19('0x65'),'value':_0x5a9493[_0xcd19('0x65')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x0]?_0x5a9493[_0xcd19('0x5b')][0x0][_0xcd19('0x5c')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x5a9493[_0xcd19('0x66')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x1]?_0x5a9493[_0xcd19('0x5b')][0x1][_0xcd19('0x5c')]:undefined)||[]},{'name':_0xcd19('0x67'),'value':_0x5a9493[_0xcd19('0x67')]||(_0x5a9493['attrs']&&_0x5a9493['attrs'][0x2]?_0x5a9493['attrs'][0x2]['value']:undefined)||0x14},{'name':_0xcd19('0x68'),'value':_0x5a9493[_0xcd19('0x68')]||(_0x5a9493['attrs']&&_0x5a9493[_0xcd19('0x5b')][0x3]?_0x5a9493['attrs'][0x3][_0xcd19('0x5c')]:undefined)||_0xcd19('0x69')},{'name':_0xcd19('0x6a'),'value':_0x5a9493[_0xcd19('0x6a')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x4]?_0x5a9493[_0xcd19('0x5b')][0x4]['value']:undefined)||''},{'name':_0xcd19('0x6b'),'value':_0x5a9493[_0xcd19('0x6b')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x5]?_0x5a9493[_0xcd19('0x5b')][0x5][_0xcd19('0x5c')]:undefined)||''},{'name':_0xcd19('0x6c'),'value':_0x5a9493['attrSmsAccounts']||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x6]?_0x5a9493['attrs'][0x6][_0xcd19('0x5c')]:undefined)||''},{'name':_0xcd19('0x6d'),'value':_0x5a9493[_0xcd19('0x6d')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x7]?_0x5a9493[_0xcd19('0x5b')][0x7][_0xcd19('0x5c')]:undefined)||''},{'name':_0xcd19('0x6e'),'value':_0x5a9493[_0xcd19('0x6e')]||(_0x5a9493['attrs']&&_0x5a9493[_0xcd19('0x5b')][0x8]?_0x5a9493['attrs'][0x8]['value']:undefined)||''},{'name':_0xcd19('0x6f'),'value':_0x5a9493[_0xcd19('0x6f')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x9]?_0x5a9493[_0xcd19('0x5b')][0x9][_0xcd19('0x5c')]:undefined)||''}];case _0xcd19('0x70'):case _0xcd19('0x71'):return[{'name':_0xcd19('0x72'),'value':_0x5a9493[_0xcd19('0x72')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x0]?_0x5a9493[_0xcd19('0x5b')][0x0][_0xcd19('0x5c')]:undefined)||_0xcd19('0x73')},{'name':_0xcd19('0x74'),'value':_0x5a9493[_0xcd19('0x74')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x1]?_0x5a9493[_0xcd19('0x5b')][0x1][_0xcd19('0x5c')]:undefined)||null},{'name':_0xcd19('0x75'),'value':_0x5a9493['attrSerie3']||(_0x5a9493['attrs']&&_0x5a9493[_0xcd19('0x5b')][0x2]?_0x5a9493[_0xcd19('0x5b')][0x2][_0xcd19('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5a9493[_0xcd19('0x66')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493['attrs'][0x3]?_0x5a9493[_0xcd19('0x5b')][0x3][_0xcd19('0x5c')]:undefined)||[]},{'name':'attrChannel','value':_0x5a9493[_0xcd19('0x68')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x4]?_0x5a9493[_0xcd19('0x5b')][0x4][_0xcd19('0x5c')]:undefined)||_0xcd19('0x69')},{'name':_0xcd19('0x6a'),'value':_0x5a9493[_0xcd19('0x6a')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x5]?_0x5a9493[_0xcd19('0x5b')][0x5]['value']:undefined)||''},{'name':_0xcd19('0x6b'),'value':_0x5a9493[_0xcd19('0x6b')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x6]?_0x5a9493[_0xcd19('0x5b')][0x6][_0xcd19('0x5c')]:undefined)||''},{'name':_0xcd19('0x6c'),'value':_0x5a9493['attrSmsAccounts']||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493['attrs'][0x7]?_0x5a9493[_0xcd19('0x5b')][0x7][_0xcd19('0x5c')]:undefined)||''},{'name':_0xcd19('0x6d'),'value':_0x5a9493[_0xcd19('0x6d')]||(_0x5a9493['attrs']&&_0x5a9493[_0xcd19('0x5b')][0x8]?_0x5a9493['attrs'][0x8]['value']:undefined)||''},{'name':_0xcd19('0x6e'),'value':_0x5a9493['attrWhatsappAccounts']||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493['attrs'][0x9]?_0x5a9493[_0xcd19('0x5b')][0x9][_0xcd19('0x5c')]:undefined)||''},{'name':_0xcd19('0x6f'),'value':_0x5a9493[_0xcd19('0x6f')]||(_0x5a9493['attrs']&&_0x5a9493[_0xcd19('0x5b')][0xa]?_0x5a9493['attrs'][0xa][_0xcd19('0x5c')]:undefined)||''}];case'web-report':return[{'name':_0xcd19('0x76'),'type':_0x5a9493[_0xcd19('0x77')]||(_0x5a9493['attrs']&&_0x5a9493[_0xcd19('0x5b')][0x0]?_0x5a9493[_0xcd19('0x5b')][0x0][_0xcd19('0x31')]:undefined)||null,'value':_0x5a9493['attrReport']||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x0]?_0x5a9493[_0xcd19('0x5b')][0x0][_0xcd19('0x5c')]:undefined)||null},{'name':_0xcd19('0x78'),'value':_0x5a9493[_0xcd19('0x78')]||(_0x5a9493[_0xcd19('0x5b')]&&_0x5a9493[_0xcd19('0x5b')][0x1]?_0x5a9493['attrs'][0x1][_0xcd19('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x2e5939){logger['error'](_0xcd19('0x79'),JSON[_0xcd19('0x7a')](_0x2e5939));return[];}}exports[_0xcd19('0x7b')]=function(_0x16ecee,_0x1a0c08,_0x4385f8){if(_0x16ecee[_0xcd19('0x4d')]['id']){delete _0x16ecee[_0xcd19('0x4d')]['id'];}return db['Dashboard'][_0xcd19('0x4b')]({'where':{'id':_0x16ecee[_0xcd19('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a0c08,null))[_0xcd19('0x25')](function(_0xfed47){if(_0xfed47){_0x16ecee[_0xcd19('0x4d')][_0xcd19('0x7c')]=_0xfed47['id'];_0x16ecee['body'][_0xcd19('0x5b')]=widgetAttributes(_0x16ecee['body']);return db[_0xcd19('0x7d')][_0xcd19('0x4c')](_0x16ecee[_0xcd19('0x4d')]);}})[_0xcd19('0x25')](respondWithResult(_0x1a0c08,null))[_0xcd19('0x46')](handleError(_0x1a0c08,null));};exports[_0xcd19('0x7e')]=function(_0x5e55c8,_0x5de2e1,_0x92010d){var _0x100add={};var _0x5af1ff={};var _0x29d5f6;var _0x459148;return db[_0xcd19('0x2f')][_0xcd19('0x7f')]({'where':{'id':_0x5e55c8[_0xcd19('0x48')]['id']}})['then'](handleEntityNotFound(_0x5de2e1,null))[_0xcd19('0x25')](function(_0x43de5a){if(_0x43de5a){_0x29d5f6=_0x43de5a;_0x5af1ff[_0xcd19('0x36')]=_['keys'](db[_0xcd19('0x7d')][_0xcd19('0x49')]);_0x5af1ff[_0xcd19('0x33')]=_[_0xcd19('0x32')](_0x5e55c8[_0xcd19('0x33')]);_0x5af1ff[_0xcd19('0x34')]=_[_0xcd19('0x35')](_0x5af1ff[_0xcd19('0x36')],_0x5af1ff[_0xcd19('0x33')]);_0x100add['attributes']=_[_0xcd19('0x35')](_0x5af1ff['model'],qs[_0xcd19('0x38')](_0x5e55c8['query']['fields']));_0x100add[_0xcd19('0x37')]=_0x100add['attributes'][_0xcd19('0x4a')]?_0x100add[_0xcd19('0x37')]:_0x5af1ff[_0xcd19('0x36')];_0x100add['order']=qs[_0xcd19('0x3d')](_0x5e55c8['query'][_0xcd19('0x3d')]);_0x100add[_0xcd19('0x3e')]=qs[_0xcd19('0x34')](_[_0xcd19('0x3f')](_0x5e55c8[_0xcd19('0x33')],_0x5af1ff[_0xcd19('0x34')]));if(_0x5e55c8[_0xcd19('0x33')][_0xcd19('0x40')]){_0x100add[_0xcd19('0x3e')]=_[_0xcd19('0x41')](_0x100add[_0xcd19('0x3e')],{'$or':_['map'](_0x100add['attributes'],function(_0x43a370){var _0x47e70b={};_0x47e70b[_0x43a370]={'$like':'%'+_0x5e55c8[_0xcd19('0x33')][_0xcd19('0x40')]+'%'};return _0x47e70b;})});}_0x100add=_[_0xcd19('0x41')]({},_0x100add,_0x5e55c8['options']);return _0x29d5f6[_0xcd19('0x7e')](_0x100add);}})['then'](function(_0x2809f3){if(_0x2809f3){_0x459148=_0x2809f3['length'];if(!_0x5e55c8['query'][_0xcd19('0x39')](_0xcd19('0x3a'))){_0x100add[_0xcd19('0x3b')]=qs[_0xcd19('0x3b')](_0x5e55c8[_0xcd19('0x33')][_0xcd19('0x3b')]);_0x100add['offset']=qs[_0xcd19('0x1e')](_0x5e55c8['query']['offset']);}return _0x29d5f6['getItems'](_0x100add);}})['then'](function(_0x46ac5e){if(_0x46ac5e){return _0x46ac5e?{'count':_0x459148,'rows':_0x46ac5e}:null;}})['then'](respondWithResult(_0x5de2e1,null))['catch'](handleError(_0x5de2e1,null));}; \ No newline at end of file +var _0x73d3=['filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','find','role','userProfileId','autoAssociation','UserProfileResource','create','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','get','CustomDashboards','error','stack','name','send','index','map','Dashboard','fieldName','type','key','model','query','keys'];(function(_0x6b05b7,_0x3a4392){var _0x3af625=function(_0x5e5cc3){while(--_0x5e5cc3){_0x6b05b7['push'](_0x6b05b7['shift']());}};_0x3af625(++_0x3a4392);}(_0x73d3,0x145));var _0x373d=function(_0xa62c01,_0x489575){_0xa62c01=_0xa62c01-0x0;var _0x4eb9da=_0x73d3[_0xa62c01];return _0x4eb9da;};'use strict';var emlformat=require(_0x373d('0x0'));var rimraf=require(_0x373d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x373d('0x2'));var moment=require(_0x373d('0x3'));var BPromise=require(_0x373d('0x4'));var Mustache=require(_0x373d('0x5'));var util=require(_0x373d('0x6'));var path=require(_0x373d('0x7'));var sox=require('sox');var csv=require(_0x373d('0x8'));var ejs=require(_0x373d('0x9'));var fs=require('fs');var fs_extra=require(_0x373d('0xa'));var _=require(_0x373d('0xb'));var squel=require(_0x373d('0xc'));var crypto=require('crypto');var jsforce=require(_0x373d('0xd'));var deskjs=require(_0x373d('0xe'));var toCsv=require(_0x373d('0x8'));var querystring=require(_0x373d('0xf'));var Papa=require(_0x373d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x373d('0x11'));var as=require(_0x373d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x373d('0x13'));var utils=require(_0x373d('0x14'));var config=require(_0x373d('0x15'));var licenseUtil=require(_0x373d('0x16'));var db=require(_0x373d('0x17'))['db'];config[_0x373d('0x18')]=_[_0x373d('0x19')](config['redis'],{'host':_0x373d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x373d('0x18')]));require(_0x373d('0x1b'))['register'](socket);function respondWithStatusCode(_0x26cb2b,_0x436c9b){_0x436c9b=_0x436c9b||0xcc;return function(_0x493990){if(_0x493990){return _0x26cb2b[_0x373d('0x1c')](_0x436c9b);}return _0x26cb2b[_0x373d('0x1d')](_0x436c9b)[_0x373d('0x1e')]();};}function respondWithResult(_0x291f62,_0x1aaf69){_0x1aaf69=_0x1aaf69||0xc8;return function(_0x367345){if(_0x367345){return _0x291f62[_0x373d('0x1d')](_0x1aaf69)[_0x373d('0x1f')](_0x367345);}};}function respondWithFilteredResult(_0x48038b,_0x4b439b){return function(_0x3dbad5){if(_0x3dbad5){var _0x28afc6=typeof _0x4b439b[_0x373d('0x20')]==='undefined'&&typeof _0x4b439b[_0x373d('0x21')]===_0x373d('0x22');var _0x57c129=_0x3dbad5[_0x373d('0x23')];var _0x2a0876=_0x28afc6?0x0:_0x4b439b[_0x373d('0x20')];var _0x125497=_0x28afc6?_0x3dbad5[_0x373d('0x23')]:_0x4b439b['offset']+_0x4b439b[_0x373d('0x21')];var _0x591cbe;if(_0x125497>=_0x57c129){_0x125497=_0x57c129;_0x591cbe=0xc8;}else{_0x591cbe=0xce;}_0x48038b[_0x373d('0x1d')](_0x591cbe);return _0x48038b[_0x373d('0x24')](_0x373d('0x25'),_0x2a0876+'-'+_0x125497+'/'+_0x57c129)[_0x373d('0x1f')](_0x3dbad5);}return null;};}function patchUpdates(_0x85551a){return function(_0xc7bd66){try{jsonpatch[_0x373d('0x26')](_0xc7bd66,_0x85551a,!![]);}catch(_0x1800a7){return BPromise['reject'](_0x1800a7);}return _0xc7bd66[_0x373d('0x27')]();};}function saveUpdates(_0x10ebd6,_0x48324e){return function(_0x55d3f8){if(_0x55d3f8){return _0x55d3f8['update'](_0x10ebd6)[_0x373d('0x28')](function(_0x5413b9){return _0x5413b9;});}return null;};}function removeEntity(_0x326fae,_0x24531f){return function(_0x3f24d7){if(_0x3f24d7){return _0x3f24d7['destroy']()[_0x373d('0x28')](function(){var _0x19f17c=_0x3f24d7[_0x373d('0x29')]({'plain':!![]});var _0x145229=_0x373d('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x145229,'resourceId':_0x19f17c['id']}})[_0x373d('0x28')](function(){return _0x3f24d7;});})[_0x373d('0x28')](function(){_0x326fae['status'](0xcc)[_0x373d('0x1e')]();});}};}function handleEntityNotFound(_0x533d36,_0x6d5939){return function(_0x44e9e1){if(!_0x44e9e1){_0x533d36[_0x373d('0x1c')](0x194);}return _0x44e9e1;};}function handleError(_0x1d0af7,_0x278dc1){_0x278dc1=_0x278dc1||0x1f4;return function(_0x320160){logger[_0x373d('0x2b')](_0x320160[_0x373d('0x2c')]);if(_0x320160['name']){delete _0x320160[_0x373d('0x2d')];}_0x1d0af7['status'](_0x278dc1)[_0x373d('0x2e')](_0x320160);};}exports[_0x373d('0x2f')]=function(_0x93f5a4,_0x48ef5f){var _0x5df5a8={},_0x3592c3={},_0xceb5f={'count':0x0,'rows':[]};var _0x391955=_[_0x373d('0x30')](db[_0x373d('0x31')]['rawAttributes'],function(_0x3746c2){return{'name':_0x3746c2[_0x373d('0x32')],'type':_0x3746c2[_0x373d('0x33')][_0x373d('0x34')]};});_0x3592c3[_0x373d('0x35')]=_[_0x373d('0x30')](_0x391955,_0x373d('0x2d'));_0x3592c3[_0x373d('0x36')]=_[_0x373d('0x37')](_0x93f5a4['query']);_0x3592c3[_0x373d('0x38')]=_['intersection'](_0x3592c3[_0x373d('0x35')],_0x3592c3['query']);_0x5df5a8[_0x373d('0x39')]=_['intersection'](_0x3592c3[_0x373d('0x35')],qs[_0x373d('0x3a')](_0x93f5a4[_0x373d('0x36')]['fields']));_0x5df5a8['attributes']=_0x5df5a8[_0x373d('0x39')][_0x373d('0x3b')]?_0x5df5a8[_0x373d('0x39')]:_0x3592c3[_0x373d('0x35')];if(!_0x93f5a4['query'][_0x373d('0x3c')](_0x373d('0x3d'))){_0x5df5a8['limit']=qs[_0x373d('0x21')](_0x93f5a4[_0x373d('0x36')][_0x373d('0x21')]);_0x5df5a8[_0x373d('0x20')]=qs[_0x373d('0x20')](_0x93f5a4[_0x373d('0x36')]['offset']);}_0x5df5a8[_0x373d('0x3e')]=qs[_0x373d('0x3f')](_0x93f5a4[_0x373d('0x36')][_0x373d('0x3f')]);_0x5df5a8[_0x373d('0x40')]=qs[_0x373d('0x38')](_[_0x373d('0x41')](_0x93f5a4[_0x373d('0x36')],_0x3592c3['filters']),_0x391955);if(_0x93f5a4[_0x373d('0x36')][_0x373d('0x42')]){_0x5df5a8['where']=_[_0x373d('0x43')](_0x5df5a8[_0x373d('0x40')],{'$or':_['map'](_0x391955,function(_0x2ff54b){if(_0x2ff54b[_0x373d('0x33')]!==_0x373d('0x44')){var _0x1ffa3f={};_0x1ffa3f[_0x2ff54b[_0x373d('0x2d')]]={'$like':'%'+_0x93f5a4[_0x373d('0x36')][_0x373d('0x42')]+'%'};return _0x1ffa3f;}})});}_0x5df5a8=_['merge']({},_0x5df5a8,_0x93f5a4[_0x373d('0x45')]);var _0xf79cf7={'where':_0x5df5a8[_0x373d('0x40')]};return db[_0x373d('0x31')][_0x373d('0x23')](_0xf79cf7)[_0x373d('0x28')](function(_0x34ee9d){_0xceb5f[_0x373d('0x23')]=_0x34ee9d;if(_0x93f5a4[_0x373d('0x36')][_0x373d('0x46')]){_0x5df5a8[_0x373d('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x373d('0x48')](_0x5df5a8);})[_0x373d('0x28')](function(_0x57977d){_0xceb5f[_0x373d('0x49')]=_0x57977d;return _0xceb5f;})['then'](respondWithFilteredResult(_0x48ef5f,_0x5df5a8))[_0x373d('0x4a')](handleError(_0x48ef5f,null));};exports['show']=function(_0x4a3831,_0x271a40){var _0x2ff6c6={'raw':![],'where':{'id':_0x4a3831[_0x373d('0x4b')]['id']}},_0x26a69b={};_0x26a69b[_0x373d('0x35')]=_[_0x373d('0x37')](db[_0x373d('0x31')][_0x373d('0x4c')]);_0x26a69b['query']=_['keys'](_0x4a3831[_0x373d('0x36')]);_0x26a69b['filters']=_[_0x373d('0x4d')](_0x26a69b['model'],_0x26a69b[_0x373d('0x36')]);_0x2ff6c6['attributes']=_[_0x373d('0x4d')](_0x26a69b[_0x373d('0x35')],qs['fields'](_0x4a3831[_0x373d('0x36')]['fields']));_0x2ff6c6[_0x373d('0x39')]=_0x2ff6c6[_0x373d('0x39')][_0x373d('0x3b')]?_0x2ff6c6[_0x373d('0x39')]:_0x26a69b[_0x373d('0x35')];if(_0x4a3831[_0x373d('0x36')][_0x373d('0x46')]){_0x2ff6c6[_0x373d('0x47')]=[{'all':!![]}];}_0x2ff6c6=_['merge']({},_0x2ff6c6,_0x4a3831[_0x373d('0x45')]);return db['Dashboard'][_0x373d('0x4e')](_0x2ff6c6)[_0x373d('0x28')](handleEntityNotFound(_0x271a40,null))[_0x373d('0x28')](respondWithResult(_0x271a40,null))[_0x373d('0x4a')](handleError(_0x271a40,null));};exports['create']=function(_0x55a620,_0x1575b2){return db[_0x373d('0x31')]['create'](_0x55a620['body'],{})[_0x373d('0x28')](function(_0x4f3b6e){var _0x138069=_0x55a620['user'][_0x373d('0x29')]({'plain':!![]});if(!_0x138069)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x138069[_0x373d('0x4f')]==='user'){var _0x3c7f32=_0x4f3b6e[_0x373d('0x29')]({'plain':!![]});var _0x1c569a='CustomDashboards';return db['UserProfileSection'][_0x373d('0x4e')]({'where':{'name':_0x1c569a,'userProfileId':_0x138069[_0x373d('0x50')]},'raw':!![]})[_0x373d('0x28')](function(_0x4c519c){if(_0x4c519c&&_0x4c519c[_0x373d('0x51')]===0x0){return db[_0x373d('0x52')][_0x373d('0x53')]({'name':_0x3c7f32[_0x373d('0x2d')],'resourceId':_0x3c7f32['id'],'type':_0x4c519c['name'],'sectionId':_0x4c519c['id']},{})[_0x373d('0x28')](function(){return _0x4f3b6e;});}else{return _0x4f3b6e;}})[_0x373d('0x4a')](function(_0x1ae97e){logger[_0x373d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ae97e);throw _0x1ae97e;});}return _0x4f3b6e;})[_0x373d('0x28')](respondWithResult(_0x1575b2,0xc9))[_0x373d('0x4a')](handleError(_0x1575b2,null));};exports['clone']=function(_0x4125fd,_0x38d5c1){var _0x221be8={'where':{'id':_0x4125fd[_0x373d('0x4b')]['id']}},_0x2e7847={};_0x2e7847['model']=_[_0x373d('0x37')](db[_0x373d('0x31')][_0x373d('0x4c')]);_0x221be8[_0x373d('0x39')]=_['intersection'](_0x2e7847[_0x373d('0x35')],qs['fields'](_0x4125fd[_0x373d('0x36')]['fields']));_0x221be8[_0x373d('0x39')]=_0x221be8['attributes'][_0x373d('0x3b')]?_0x221be8[_0x373d('0x39')]:_0x2e7847[_0x373d('0x35')];if(_0x4125fd[_0x373d('0x36')][_0x373d('0x46')]){_0x221be8[_0x373d('0x47')]=[{'all':!![]}];}_0x221be8=_[_0x373d('0x43')]({},_0x221be8,_0x4125fd[_0x373d('0x45')]);return db[_0x373d('0x31')][_0x373d('0x4e')](_0x221be8)[_0x373d('0x28')](handleEntityNotFound(_0x38d5c1,null))[_0x373d('0x28')](function(_0x17f4c0){if(_0x17f4c0){var _0x3738e2=_0x17f4c0[_0x373d('0x29')]({'plain':!![]});_0x3738e2=qs[_0x373d('0x54')](_0x3738e2,['id','createdAt',_0x373d('0x55')]);_0x4125fd[_0x373d('0x56')]=_[_0x373d('0x54')](_0x4125fd['body'],['id',_0x373d('0x57'),_0x373d('0x55')]);return db[_0x373d('0x31')]['create'](_[_0x373d('0x43')](_0x3738e2,_0x4125fd[_0x373d('0x56')]),{'include':_0x4125fd['query'][_0x373d('0x46')]?[{'all':!![]}]:undefined})[_0x373d('0x28')](function(_0x17727a){var _0x20f5b9=_0x4125fd['user'][_0x373d('0x29')]({'plain':!![]});if(!_0x20f5b9)throw new Error(_0x373d('0x58'));if(_0x20f5b9[_0x373d('0x4f')]==='user'){var _0x347655=_0x17727a['get']({'plain':!![]});var _0x3e98b0=_0x373d('0x2a');return db['UserProfileSection'][_0x373d('0x4e')]({'where':{'name':_0x3e98b0,'userProfileId':_0x20f5b9[_0x373d('0x50')]},'raw':!![]})[_0x373d('0x28')](function(_0xbddc12){if(_0xbddc12&&_0xbddc12[_0x373d('0x51')]===0x0){return db[_0x373d('0x52')][_0x373d('0x53')]({'name':_0x347655['name'],'resourceId':_0x347655['id'],'type':_0xbddc12[_0x373d('0x2d')],'sectionId':_0xbddc12['id']},{})[_0x373d('0x28')](function(){return _0x17727a;});}else{return _0x17727a;}})[_0x373d('0x4a')](function(_0x5ae3db){logger[_0x373d('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ae3db);throw _0x5ae3db;});}return _0x17727a;});}})[_0x373d('0x28')](respondWithResult(_0x38d5c1,0xc9))[_0x373d('0x4a')](handleError(_0x38d5c1,null));};exports[_0x373d('0x59')]=function(_0x255912,_0x1e54ba){if(_0x255912[_0x373d('0x56')]['id']){delete _0x255912[_0x373d('0x56')]['id'];}return db[_0x373d('0x31')][_0x373d('0x4e')]({'where':{'id':_0x255912[_0x373d('0x4b')]['id']}})[_0x373d('0x28')](handleEntityNotFound(_0x1e54ba,null))[_0x373d('0x28')](saveUpdates(_0x255912[_0x373d('0x56')],null))[_0x373d('0x28')](respondWithResult(_0x1e54ba,null))[_0x373d('0x4a')](handleError(_0x1e54ba,null));};exports['destroy']=function(_0x3e100b,_0x24208e){return db[_0x373d('0x31')][_0x373d('0x4e')]({'where':{'id':_0x3e100b['params']['id']}})[_0x373d('0x28')](handleEntityNotFound(_0x24208e,null))[_0x373d('0x28')](removeEntity(_0x24208e,null))[_0x373d('0x4a')](handleError(_0x24208e,null));};function widgetAttributes(_0x38c837){try{switch(_0x38c837[_0x373d('0x33')]){case _0x373d('0x5a'):return[{'name':'attrUrl','value':_0x38c837[_0x373d('0x5b')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||'https://'}];case _0x373d('0x5e'):return[{'name':'attrPath','value':_0x38c837[_0x373d('0x5f')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||''}];case'clock':return[{'name':_0x373d('0x60'),'value':_0x38c837['attrHourFormat']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||_0x373d('0x61')},{'name':_0x373d('0x62'),'value':_0x38c837[_0x373d('0x62')]||(_0x38c837['attrs']&&_0x38c837[_0x373d('0x5c')][0x1]?_0x38c837['attrs'][0x1][_0x373d('0x5d')]:undefined)||_0x373d('0x63')},{'name':_0x373d('0x64'),'value':_0x38c837[_0x373d('0x64')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x2]?_0x38c837[_0x373d('0x5c')][0x2][_0x373d('0x5d')]:undefined)||0xc}];case _0x373d('0x65'):return[{'name':_0x373d('0x66'),'value':_0x38c837['attrMetric']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837[_0x373d('0x5c')][0x0][_0x373d('0x5d')]:undefined)||_0x373d('0x67')},{'name':'attrVoiceQueues','value':_0x38c837[_0x373d('0x68')]||(_0x38c837['attrs']&&_0x38c837[_0x373d('0x5c')][0x1]?_0x38c837[_0x373d('0x5c')][0x1][_0x373d('0x5d')]:undefined)||[]},{'name':_0x373d('0x64'),'value':_0x38c837['attrFontSize']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x2]?_0x38c837[_0x373d('0x5c')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x38c837[_0x373d('0x69')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x3]?_0x38c837[_0x373d('0x5c')][0x3][_0x373d('0x5d')]:undefined)||'voice'},{'name':_0x373d('0x6a'),'value':_0x38c837[_0x373d('0x6a')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x4]?_0x38c837['attrs'][0x4]['value']:undefined)||''},{'name':_0x373d('0x6b'),'value':_0x38c837[_0x373d('0x6b')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x5]?_0x38c837[_0x373d('0x5c')][0x5][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6c'),'value':_0x38c837['attrSmsAccounts']||(_0x38c837['attrs']&&_0x38c837[_0x373d('0x5c')][0x6]?_0x38c837[_0x373d('0x5c')][0x6]['value']:undefined)||''},{'name':_0x373d('0x6d'),'value':_0x38c837[_0x373d('0x6d')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x7]?_0x38c837[_0x373d('0x5c')][0x7]['value']:undefined)||''},{'name':_0x373d('0x6e'),'value':_0x38c837[_0x373d('0x6e')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x8]?_0x38c837[_0x373d('0x5c')][0x8][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6f'),'value':_0x38c837[_0x373d('0x6f')]||(_0x38c837['attrs']&&_0x38c837['attrs'][0x9]?_0x38c837[_0x373d('0x5c')][0x9][_0x373d('0x5d')]:undefined)||''}];case _0x373d('0x70'):case _0x373d('0x71'):return[{'name':'attrSerie1','value':_0x38c837[_0x373d('0x72')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837['attrs'][0x0][_0x373d('0x5d')]:undefined)||_0x373d('0x67')},{'name':_0x373d('0x73'),'value':_0x38c837[_0x373d('0x73')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x1]?_0x38c837[_0x373d('0x5c')][0x1][_0x373d('0x5d')]:undefined)||null},{'name':_0x373d('0x74'),'value':_0x38c837[_0x373d('0x74')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x2]?_0x38c837[_0x373d('0x5c')][0x2][_0x373d('0x5d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x38c837['attrVoiceQueues']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x3]?_0x38c837[_0x373d('0x5c')][0x3][_0x373d('0x5d')]:undefined)||[]},{'name':_0x373d('0x69'),'value':_0x38c837['attrChannel']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x4]?_0x38c837[_0x373d('0x5c')][0x4]['value']:undefined)||_0x373d('0x75')},{'name':_0x373d('0x6a'),'value':_0x38c837['attrEmailAccounts']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x5]?_0x38c837[_0x373d('0x5c')][0x5][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6b'),'value':_0x38c837[_0x373d('0x6b')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x6]?_0x38c837[_0x373d('0x5c')][0x6][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6c'),'value':_0x38c837['attrSmsAccounts']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x7]?_0x38c837[_0x373d('0x5c')][0x7]['value']:undefined)||''},{'name':_0x373d('0x6d'),'value':_0x38c837[_0x373d('0x6d')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x8]?_0x38c837[_0x373d('0x5c')][0x8]['value']:undefined)||''},{'name':_0x373d('0x6e'),'value':_0x38c837[_0x373d('0x6e')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x9]?_0x38c837[_0x373d('0x5c')][0x9][_0x373d('0x5d')]:undefined)||''},{'name':_0x373d('0x6f'),'value':_0x38c837['attrChatWebsites']||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0xa]?_0x38c837[_0x373d('0x5c')][0xa][_0x373d('0x5d')]:undefined)||''}];case _0x373d('0x76'):return[{'name':_0x373d('0x77'),'type':_0x38c837[_0x373d('0x78')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837['attrs'][0x0]?_0x38c837[_0x373d('0x5c')][0x0][_0x373d('0x33')]:undefined)||null,'value':_0x38c837[_0x373d('0x77')]||(_0x38c837[_0x373d('0x5c')]&&_0x38c837[_0x373d('0x5c')][0x0]?_0x38c837[_0x373d('0x5c')][0x0]['value']:undefined)||null},{'name':_0x373d('0x79'),'value':_0x38c837[_0x373d('0x79')]||(_0x38c837['attrs']&&_0x38c837['attrs'][0x1]?_0x38c837['attrs'][0x1][_0x373d('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x1ba5d0){logger[_0x373d('0x2b')](_0x373d('0x7a'),JSON['stringify'](_0x1ba5d0));return[];}}exports['addItem']=function(_0x2f1857,_0x426b7c,_0xa57685){if(_0x2f1857[_0x373d('0x56')]['id']){delete _0x2f1857[_0x373d('0x56')]['id'];}return db[_0x373d('0x31')][_0x373d('0x4e')]({'where':{'id':_0x2f1857[_0x373d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426b7c,null))[_0x373d('0x28')](function(_0x4e6ecc){if(_0x4e6ecc){_0x2f1857[_0x373d('0x56')][_0x373d('0x7b')]=_0x4e6ecc['id'];_0x2f1857[_0x373d('0x56')][_0x373d('0x5c')]=widgetAttributes(_0x2f1857[_0x373d('0x56')]);return db[_0x373d('0x7c')][_0x373d('0x53')](_0x2f1857[_0x373d('0x56')]);}})[_0x373d('0x28')](respondWithResult(_0x426b7c,null))['catch'](handleError(_0x426b7c,null));};exports[_0x373d('0x7d')]=function(_0x199056,_0x4466b5,_0x382aba){var _0x5e1b24={};var _0x4570d6={};var _0x36045f;var _0x253f45;return db[_0x373d('0x31')][_0x373d('0x7e')]({'where':{'id':_0x199056[_0x373d('0x4b')]['id']}})[_0x373d('0x28')](handleEntityNotFound(_0x4466b5,null))[_0x373d('0x28')](function(_0x13a366){if(_0x13a366){_0x36045f=_0x13a366;_0x4570d6[_0x373d('0x35')]=_[_0x373d('0x37')](db[_0x373d('0x7c')][_0x373d('0x4c')]);_0x4570d6['query']=_[_0x373d('0x37')](_0x199056[_0x373d('0x36')]);_0x4570d6[_0x373d('0x38')]=_[_0x373d('0x4d')](_0x4570d6[_0x373d('0x35')],_0x4570d6[_0x373d('0x36')]);_0x5e1b24['attributes']=_[_0x373d('0x4d')](_0x4570d6['model'],qs[_0x373d('0x3a')](_0x199056[_0x373d('0x36')][_0x373d('0x3a')]));_0x5e1b24[_0x373d('0x39')]=_0x5e1b24['attributes'][_0x373d('0x3b')]?_0x5e1b24['attributes']:_0x4570d6['model'];_0x5e1b24[_0x373d('0x3e')]=qs[_0x373d('0x3f')](_0x199056[_0x373d('0x36')][_0x373d('0x3f')]);_0x5e1b24[_0x373d('0x40')]=qs[_0x373d('0x38')](_['pick'](_0x199056[_0x373d('0x36')],_0x4570d6[_0x373d('0x38')]));if(_0x199056['query'][_0x373d('0x42')]){_0x5e1b24['where']=_[_0x373d('0x43')](_0x5e1b24[_0x373d('0x40')],{'$or':_['map'](_0x5e1b24[_0x373d('0x39')],function(_0xce4e91){var _0x5c8307={};_0x5c8307[_0xce4e91]={'$like':'%'+_0x199056[_0x373d('0x36')][_0x373d('0x42')]+'%'};return _0x5c8307;})});}_0x5e1b24=_['merge']({},_0x5e1b24,_0x199056['options']);return _0x36045f[_0x373d('0x7d')](_0x5e1b24);}})[_0x373d('0x28')](function(_0x13b2e7){if(_0x13b2e7){_0x253f45=_0x13b2e7[_0x373d('0x3b')];if(!_0x199056[_0x373d('0x36')][_0x373d('0x3c')](_0x373d('0x3d'))){_0x5e1b24['limit']=qs[_0x373d('0x21')](_0x199056['query'][_0x373d('0x21')]);_0x5e1b24['offset']=qs[_0x373d('0x20')](_0x199056[_0x373d('0x36')][_0x373d('0x20')]);}return _0x36045f['getItems'](_0x5e1b24);}})[_0x373d('0x28')](function(_0x288282){if(_0x288282){return _0x288282?{'count':_0x253f45,'rows':_0x288282}:null;}})[_0x373d('0x28')](respondWithResult(_0x4466b5,null))[_0x373d('0x4a')](handleError(_0x4466b5,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 922928b..4ac7ada 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 _0x7007=['emit','hasOwnProperty','hook','events','remove'];(function(_0x247eb1,_0x601184){var _0x49dbb5=function(_0x25258f){while(--_0x25258f){_0x247eb1['push'](_0x247eb1['shift']());}};_0x49dbb5(++_0x601184);}(_0x7007,0xbc));var _0x7700=function(_0x5bf4f5,_0x26bb4b){_0x5bf4f5=_0x5bf4f5-0x0;var _0x23db84=_0x7007[_0x5bf4f5];return _0x23db84;};'use strict';var EventEmitter=require(_0x7700('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7700('0x1')};function emitEvent(_0x33a038){return function(_0x4692f3,_0x373001,_0x493720){DashboardEvents[_0x7700('0x2')](_0x33a038+':'+_0x4692f3['id'],_0x4692f3);DashboardEvents['emit'](_0x33a038,_0x4692f3);_0x493720(null);};}for(var e in events){if(events[_0x7700('0x3')](e)){var event=events[e];Dashboard[_0x7700('0x4')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x2a65=['hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','update','remove','emit'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0x2a65,0x135));var _0x52a6=function(_0x58a0bb,_0x3464b8){_0x58a0bb=_0x58a0bb-0x0;var _0x1f1146=_0x2a65[_0x58a0bb];return _0x1f1146;};'use strict';var EventEmitter=require(_0x52a6('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x52a6('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x52a6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x52a6('0x3'),'afterDestroy':_0x52a6('0x4')};function emitEvent(_0x3abbd7){return function(_0x17f8d7,_0x435e94,_0x35f7fa){DashboardEvents[_0x52a6('0x5')](_0x3abbd7+':'+_0x17f8d7['id'],_0x17f8d7);DashboardEvents['emit'](_0x3abbd7,_0x17f8d7);_0x35f7fa(null);};}for(var e in events){if(events[_0x52a6('0x6')](e)){var event=events[e];Dashboard[_0x52a6('0x7')](e,emitEvent(event));}}module[_0x52a6('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5e4997f..026e43a 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 _0x96ee=['define','Dashboard','util','../../config/logger','path','./dashboard.attributes','exports'];(function(_0x1dc172,_0x220b62){var _0x4444f2=function(_0x461d8f){while(--_0x461d8f){_0x1dc172['push'](_0x1dc172['shift']());}};_0x4444f2(++_0x220b62);}(_0x96ee,0x72));var _0xe96e=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x96ee[_0x20c9b2];return _0x2c6030;};'use strict';var _=require('lodash');var util=require(_0xe96e('0x0'));var logger=require(_0xe96e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe96e('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe96e('0x3'));module[_0xe96e('0x4')]=function(_0x55c4fc,_0x32225c){return _0x55c4fc[_0xe96e('0x5')](_0xe96e('0x6'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf06f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards'];(function(_0x20b85e,_0x50d027){var _0x35ebc6=function(_0x2d7199){while(--_0x2d7199){_0x20b85e['push'](_0x20b85e['shift']());}};_0x35ebc6(++_0x50d027);}(_0xf06f,0x15f));var _0xff06=function(_0x42647b,_0x2b6c5e){_0x42647b=_0x42647b-0x0;var _0x141af4=_0xf06f[_0x42647b];return _0x141af4;};'use strict';var _=require(_0xff06('0x0'));var util=require(_0xff06('0x1'));var logger=require(_0xff06('0x2'))(_0xff06('0x3'));var moment=require(_0xff06('0x4'));var BPromise=require('bluebird');var rp=require(_0xff06('0x5'));var fs=require('fs');var path=require(_0xff06('0x6'));var rimraf=require(_0xff06('0x7'));var config=require('../../config/environment');var attributes=require(_0xff06('0x8'));module[_0xff06('0x9')]=function(_0x5a114c,_0x5d25bb){return _0x5a114c[_0xff06('0xa')](_0xff06('0xb'),attributes,{'tableName':_0xff06('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 58177bf..5027836 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 _0x5424=['debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Dashboard,\x20%s,\x20%s','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','register','request','info','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5424,0x78));var _0x4542=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x5424[_0x45bf86];return _0x1f02b7;};'use strict';var _=require('lodash');var util=require(_0x4542('0x0'));var moment=require(_0x4542('0x1'));var BPromise=require(_0x4542('0x2'));var rs=require(_0x4542('0x3'));var fs=require('fs');var Redis=require(_0x4542('0x4'));var db=require(_0x4542('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4542('0x6'))(_0x4542('0x7'));var config=require(_0x4542('0x8'));var jayson=require(_0x4542('0x9'));var client=jayson[_0x4542('0xa')][_0x4542('0xb')]({'port':0x232a});config[_0x4542('0xc')]=_[_0x4542('0xd')](config['redis'],{'host':_0x4542('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4542('0xc')]));require(_0x4542('0xf'))[_0x4542('0x10')](socket);function respondWithRpcPromise(_0x7ab7d6,_0x419a3a,_0xaf999c){return new BPromise(function(_0x2cca4f,_0x948c87){return client[_0x4542('0x11')](_0x7ab7d6,_0xaf999c)['then'](function(_0x4cad41){logger[_0x4542('0x12')]('Dashboard,\x20%s,\x20%s',_0x419a3a,_0x4542('0x13'));logger[_0x4542('0x14')](_0x4542('0x15'),_0x419a3a,_0x4542('0x13'),JSON[_0x4542('0x16')](_0x4cad41));if(_0x4cad41[_0x4542('0x17')]){if(_0x4cad41[_0x4542('0x17')]['code']===0x1f4){logger[_0x4542('0x17')]('Dashboard,\x20%s,\x20%s',_0x419a3a,_0x4cad41[_0x4542('0x17')][_0x4542('0x18')]);return _0x948c87(_0x4cad41[_0x4542('0x17')]['message']);}logger[_0x4542('0x17')]('Dashboard,\x20%s,\x20%s',_0x419a3a,_0x4cad41[_0x4542('0x17')][_0x4542('0x18')]);return _0x2cca4f(_0x4cad41['error']['message']);}else{logger[_0x4542('0x12')]('Dashboard,\x20%s,\x20%s',_0x419a3a,'request\x20sent');_0x2cca4f(_0x4cad41[_0x4542('0x19')][_0x4542('0x18')]);}})[_0x4542('0x1a')](function(_0x4140fc){logger[_0x4542('0x17')](_0x4542('0x1b'),_0x419a3a,_0x4140fc);_0x948c87(_0x4140fc);});});} \ No newline at end of file +var _0xede4=['moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2af53e,_0x2222e5){var _0x4ed385=function(_0x4a393c){while(--_0x4a393c){_0x2af53e['push'](_0x2af53e['shift']());}};_0x4ed385(++_0x2222e5);}(_0xede4,0x193));var _0x4ede=function(_0x174b5e,_0x32b4c0){_0x174b5e=_0x174b5e-0x0;var _0x3d511f=_0xede4[_0x174b5e];return _0x3d511f;};'use strict';var _=require(_0x4ede('0x0'));var util=require(_0x4ede('0x1'));var moment=require(_0x4ede('0x2'));var BPromise=require(_0x4ede('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4ede('0x4'));var logger=require(_0x4ede('0x5'))(_0x4ede('0x6'));var config=require(_0x4ede('0x7'));var jayson=require(_0x4ede('0x8'));var client=jayson[_0x4ede('0x9')]['http']({'port':0x232a});config[_0x4ede('0xa')]=_[_0x4ede('0xb')](config[_0x4ede('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ede('0xc'))(new Redis(config[_0x4ede('0xa')]));require(_0x4ede('0xd'))[_0x4ede('0xe')](socket);function respondWithRpcPromise(_0x987e32,_0x212758,_0x427f20){return new BPromise(function(_0x20348a,_0x422e88){return client[_0x4ede('0xf')](_0x987e32,_0x427f20)['then'](function(_0x18688a){logger[_0x4ede('0x10')](_0x4ede('0x11'),_0x212758,_0x4ede('0x12'));logger[_0x4ede('0x13')](_0x4ede('0x14'),_0x212758,_0x4ede('0x12'),JSON[_0x4ede('0x15')](_0x18688a));if(_0x18688a[_0x4ede('0x16')]){if(_0x18688a['error'][_0x4ede('0x17')]===0x1f4){logger[_0x4ede('0x16')](_0x4ede('0x11'),_0x212758,_0x18688a[_0x4ede('0x16')][_0x4ede('0x18')]);return _0x422e88(_0x18688a['error']['message']);}logger[_0x4ede('0x16')]('Dashboard,\x20%s,\x20%s',_0x212758,_0x18688a[_0x4ede('0x16')]['message']);return _0x20348a(_0x18688a[_0x4ede('0x16')]['message']);}else{logger['info'](_0x4ede('0x11'),_0x212758,_0x4ede('0x12'));_0x20348a(_0x18688a[_0x4ede('0x19')]['message']);}})[_0x4ede('0x1a')](function(_0x4e77f2){logger['error'](_0x4ede('0x11'),_0x212758,_0x4e77f2);_0x422e88(_0x4e77f2);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6916183..f84c778 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 _0xd7f4=['remove','emit','register','dashboard:','./dashboard.events','save'];(function(_0x267096,_0x549583){var _0x4c4847=function(_0x5a56f5){while(--_0x5a56f5){_0x267096['push'](_0x267096['shift']());}};_0x4c4847(++_0x549583);}(_0xd7f4,0x1ea));var _0x4d7f=function(_0x47dd86,_0x681d25){_0x47dd86=_0x47dd86-0x0;var _0x4f3685=_0xd7f4[_0x47dd86];return _0x4f3685;};'use strict';var DashboardEvents=require(_0x4d7f('0x0'));var events=[_0x4d7f('0x1'),_0x4d7f('0x2'),'update'];function createListener(_0xf60550,_0x37badd){return function(_0x7ff314){_0x37badd[_0x4d7f('0x3')](_0xf60550,_0x7ff314);};}function removeListener(_0xd9bffe,_0x293336){return function(){DashboardEvents['removeListener'](_0xd9bffe,_0x293336);};}exports[_0x4d7f('0x4')]=function(_0x5a0ffa){for(var _0x514613=0x0,_0x997b18=events['length'];_0x514613<_0x997b18;_0x514613++){var _0x25ca95=events[_0x514613];var _0x3e9504=createListener(_0x4d7f('0x5')+_0x25ca95,_0x5a0ffa);DashboardEvents['on'](_0x25ca95,_0x3e9504);}}; \ No newline at end of file +var _0x5ba5=['./dashboard.events','save','remove','removeListener','register','length','dashboard:'];(function(_0x1ad07b,_0x551d55){var _0x2c447f=function(_0x43340b){while(--_0x43340b){_0x1ad07b['push'](_0x1ad07b['shift']());}};_0x2c447f(++_0x551d55);}(_0x5ba5,0x157));var _0x55ba=function(_0x4bf793,_0x404922){_0x4bf793=_0x4bf793-0x0;var _0x55a44b=_0x5ba5[_0x4bf793];return _0x55a44b;};'use strict';var DashboardEvents=require(_0x55ba('0x0'));var events=[_0x55ba('0x1'),_0x55ba('0x2'),'update'];function createListener(_0x344b42,_0x432a17){return function(_0x15cf48){_0x432a17['emit'](_0x344b42,_0x15cf48);};}function removeListener(_0x54734c,_0x2edc34){return function(){DashboardEvents[_0x55ba('0x3')](_0x54734c,_0x2edc34);};}exports[_0x55ba('0x4')]=function(_0x5a3bf5){for(var _0x40739f=0x0,_0x3367d9=events[_0x55ba('0x5')];_0x40739f<_0x3367d9;_0x40739f++){var _0x171c89=events[_0x40739f];var _0x250b14=createListener(_0x55ba('0x6')+_0x171c89,_0x5a3bf5);DashboardEvents['on'](_0x171c89,_0x250b14);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 25d606a..ebf0ce5 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 _0x623b=['/:id','show','/:id/items','getItems','create','/:id/clone','addItem','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index'];(function(_0x4e5c1a,_0x432f8d){var _0x33d762=function(_0x6c6d46){while(--_0x6c6d46){_0x4e5c1a['push'](_0x4e5c1a['shift']());}};_0x33d762(++_0x432f8d);}(_0x623b,0x135));var _0xb623=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x623b[_0x486f4a];return _0x135d99;};'use strict';var multer=require(_0xb623('0x0'));var util=require(_0xb623('0x1'));var path=require(_0xb623('0x2'));var timeout=require(_0xb623('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb623('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb623('0x5'));var config=require(_0xb623('0x6'));var controller=require(_0xb623('0x7'));router[_0xb623('0x8')]('/',auth[_0xb623('0x9')](),controller[_0xb623('0xa')]);router[_0xb623('0x8')](_0xb623('0xb'),auth[_0xb623('0x9')](),controller[_0xb623('0xc')]);router[_0xb623('0x8')](_0xb623('0xd'),auth[_0xb623('0x9')](),controller[_0xb623('0xe')]);router['post']('/',auth[_0xb623('0x9')](),controller[_0xb623('0xf')]);router['post'](_0xb623('0x10'),auth[_0xb623('0x9')](),controller['clone']);router['post'](_0xb623('0xd'),auth[_0xb623('0x9')](),controller[_0xb623('0x11')]);router['put'](_0xb623('0xb'),auth[_0xb623('0x9')](),controller[_0xb623('0x12')]);router[_0xb623('0x13')](_0xb623('0xb'),auth[_0xb623('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x21dc=['/:id','show','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get'];(function(_0x4b9c4f,_0x45ce1){var _0x39d40c=function(_0x3c9607){while(--_0x3c9607){_0x4b9c4f['push'](_0x4b9c4f['shift']());}};_0x39d40c(++_0x45ce1);}(_0x21dc,0xbd));var _0xc21d=function(_0xe192f0,_0x235766){_0xe192f0=_0xe192f0-0x0;var _0x1a4696=_0x21dc[_0xe192f0];return _0x1a4696;};'use strict';var multer=require('multer');var util=require(_0xc21d('0x0'));var path=require('path');var timeout=require(_0xc21d('0x1'));var express=require(_0xc21d('0x2'));var router=express[_0xc21d('0x3')]();var fs_extra=require(_0xc21d('0x4'));var auth=require(_0xc21d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc21d('0x6'));var controller=require(_0xc21d('0x7'));router['get']('/',auth[_0xc21d('0x8')](),controller[_0xc21d('0x9')]);router[_0xc21d('0xa')](_0xc21d('0xb'),auth[_0xc21d('0x8')](),controller[_0xc21d('0xc')]);router['get']('/:id/items',auth[_0xc21d('0x8')](),controller[_0xc21d('0xd')]);router[_0xc21d('0xe')]('/',auth[_0xc21d('0x8')](),controller[_0xc21d('0xf')]);router[_0xc21d('0xe')](_0xc21d('0x10'),auth[_0xc21d('0x8')](),controller[_0xc21d('0x11')]);router['post'](_0xc21d('0x12'),auth['isAuthenticated'](),controller[_0xc21d('0x13')]);router[_0xc21d('0x14')](_0xc21d('0xb'),auth[_0xc21d('0x8')](),controller[_0xc21d('0x15')]);router[_0xc21d('0x16')](_0xc21d('0xb'),auth[_0xc21d('0x8')](),controller[_0xc21d('0x17')]);module[_0xc21d('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 3ee260f..1e431c7 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 _0x9536=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x29f1bc,_0x54a5c3){var _0x480d3a=function(_0x34abca){while(--_0x34abca){_0x29f1bc['push'](_0x29f1bc['shift']());}};_0x480d3a(++_0x54a5c3);}(_0x9536,0x179));var _0x6953=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x9536[_0x136a0d];return _0x212ea5;};'use strict';var Sequelize=require(_0x6953('0x0'));var squel=require(_0x6953('0x1'));var _=require(_0x6953('0x2'));module[_0x6953('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6953('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x6953('0x5')),'get':function(){try{return JSON[_0x6953('0x6')](this[_0x6953('0x7')](_0x6953('0x8')));}catch(_0x2f3cc3){return[];}},'set':function(_0x494ac2){try{this[_0x6953('0x9')](_0x6953('0x8'),JSON[_0x6953('0xa')](_0x494ac2));}catch(_0x3e1aff){this[_0x6953('0x9')]('attrs',JSON[_0x6953('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6953('0xb')]},'background':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6953('0x4')]},'titleFontSize':{'type':Sequelize[_0x6953('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0xd8fb=['exports','long','parse','attrs','setDataValue','stringify','INTEGER','#ffffff','STRING','sequelize','squel','lodash'];(function(_0x1adc9f,_0x4f767f){var _0x4a790f=function(_0x2b6524){while(--_0x2b6524){_0x1adc9f['push'](_0x1adc9f['shift']());}};_0x4a790f(++_0x4f767f);}(_0xd8fb,0x99));var _0xbd8f=function(_0xb50ead,_0x23d694){_0xb50ead=_0xb50ead-0x0;var _0x3edac0=_0xd8fb[_0xb50ead];return _0x3edac0;};'use strict';var Sequelize=require(_0xbd8f('0x0'));var squel=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));module[_0xbd8f('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xbd8f('0x4')),'get':function(){try{return JSON[_0xbd8f('0x5')](this['getDataValue'](_0xbd8f('0x6')));}catch(_0x2343bf){return[];}},'set':function(_0x5543b2){try{this[_0xbd8f('0x7')]('attrs',JSON[_0xbd8f('0x8')](_0x5543b2));}catch(_0x578499){this[_0xbd8f('0x7')](_0xbd8f('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xbd8f('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xbd8f('0x9')]},'col':{'type':Sequelize[_0xbd8f('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbd8f('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xbd8f('0xb')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xbd8f('0x9')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 545b620..0fb669e 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 _0x446c=['fields','length','includeAll','include','merge','options','catch','DashboardItem','type','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrEmailAccounts','web-report','attrReport','widgetAttributes:\x20%s','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','keys','query','filters','intersection','attributes'];(function(_0x1851e1,_0x2e5eb9){var _0xe07d74=function(_0x5a15db){while(--_0x5a15db){_0x1851e1['push'](_0x1851e1['shift']());}};_0xe07d74(++_0x2e5eb9);}(_0x446c,0x156));var _0xc446=function(_0x3be7ff,_0x12e714){_0x3be7ff=_0x3be7ff-0x0;var _0x186721=_0x446c[_0x3be7ff];return _0x186721;};'use strict';var emlformat=require(_0xc446('0x0'));var rimraf=require(_0xc446('0x1'));var zipdir=require(_0xc446('0x2'));var jsonpatch=require(_0xc446('0x3'));var rp=require('request-promise');var moment=require(_0xc446('0x4'));var BPromise=require(_0xc446('0x5'));var Mustache=require(_0xc446('0x6'));var util=require('util');var path=require(_0xc446('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc446('0x8'));var fs=require('fs');var fs_extra=require(_0xc446('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc446('0xa'));var jsforce=require(_0xc446('0xb'));var deskjs=require(_0xc446('0xc'));var toCsv=require(_0xc446('0xd'));var querystring=require(_0xc446('0xe'));var Papa=require('papaparse');var Redis=require(_0xc446('0xf'));var authService=require(_0xc446('0x10'));var qs=require(_0xc446('0x11'));var as=require(_0xc446('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc446('0x13'))(_0xc446('0x14'));var utils=require(_0xc446('0x15'));var config=require(_0xc446('0x16'));var licenseUtil=require(_0xc446('0x17'));var db=require(_0xc446('0x18'))['db'];config[_0xc446('0x19')]=_[_0xc446('0x1a')](config[_0xc446('0x19')],{'host':_0xc446('0x1b'),'port':0x18eb});var socket=require(_0xc446('0x1c'))(new Redis(config[_0xc446('0x19')]));require(_0xc446('0x1d'))[_0xc446('0x1e')](socket);function respondWithStatusCode(_0x21d8e4,_0x20afd7){_0x20afd7=_0x20afd7||0xcc;return function(_0x7229de){if(_0x7229de){return _0x21d8e4[_0xc446('0x1f')](_0x20afd7);}return _0x21d8e4[_0xc446('0x20')](_0x20afd7)['end']();};}function respondWithResult(_0x3ba115,_0x2f90bc){_0x2f90bc=_0x2f90bc||0xc8;return function(_0x412678){if(_0x412678){return _0x3ba115[_0xc446('0x20')](_0x2f90bc)[_0xc446('0x21')](_0x412678);}};}function respondWithFilteredResult(_0x274040,_0x146be5){return function(_0x30038f){if(_0x30038f){var _0x16f337=typeof _0x146be5[_0xc446('0x22')]==='undefined'&&typeof _0x146be5[_0xc446('0x23')]===_0xc446('0x24');var _0x5cd0c1=_0x30038f[_0xc446('0x25')];var _0x16b806=_0x16f337?0x0:_0x146be5[_0xc446('0x22')];var _0x434c94=_0x16f337?_0x30038f[_0xc446('0x25')]:_0x146be5[_0xc446('0x22')]+_0x146be5[_0xc446('0x23')];var _0xc18765;if(_0x434c94>=_0x5cd0c1){_0x434c94=_0x5cd0c1;_0xc18765=0xc8;}else{_0xc18765=0xce;}_0x274040[_0xc446('0x20')](_0xc18765);return _0x274040[_0xc446('0x26')]('Content-Range',_0x16b806+'-'+_0x434c94+'/'+_0x5cd0c1)[_0xc446('0x21')](_0x30038f);}return null;};}function patchUpdates(_0x1ea08b){return function(_0x21dc0e){try{jsonpatch[_0xc446('0x27')](_0x21dc0e,_0x1ea08b,!![]);}catch(_0x3596f4){return BPromise[_0xc446('0x28')](_0x3596f4);}return _0x21dc0e[_0xc446('0x29')]();};}function saveUpdates(_0x1b785a,_0x380fd6){return function(_0x189ee7){if(_0x189ee7){return _0x189ee7[_0xc446('0x2a')](_0x1b785a)[_0xc446('0x2b')](function(_0x25f58d){return _0x25f58d;});}return null;};}function removeEntity(_0x438410,_0x16133b){return function(_0x1d1585){if(_0x1d1585){return _0x1d1585[_0xc446('0x2c')]()['then'](function(){_0x438410[_0xc446('0x20')](0xcc)[_0xc446('0x2d')]();});}};}function handleEntityNotFound(_0x3b0adf,_0x2e5d8d){return function(_0x215cd6){if(!_0x215cd6){_0x3b0adf[_0xc446('0x1f')](0x194);}return _0x215cd6;};}function handleError(_0x5d5aa8,_0x4d62d9){_0x4d62d9=_0x4d62d9||0x1f4;return function(_0x37532c){logger[_0xc446('0x2e')](_0x37532c[_0xc446('0x2f')]);if(_0x37532c[_0xc446('0x30')]){delete _0x37532c['name'];}_0x5d5aa8[_0xc446('0x20')](_0x4d62d9)[_0xc446('0x31')](_0x37532c);};}exports[_0xc446('0x32')]=function(_0x16be29,_0x1bd4e6){var _0x225603={'raw':![],'where':{'id':_0x16be29[_0xc446('0x33')]['id']}},_0x39302a={};_0x39302a[_0xc446('0x34')]=_[_0xc446('0x35')](db['DashboardItem']['rawAttributes']);_0x39302a['query']=_[_0xc446('0x35')](_0x16be29[_0xc446('0x36')]);_0x39302a[_0xc446('0x37')]=_[_0xc446('0x38')](_0x39302a[_0xc446('0x34')],_0x39302a[_0xc446('0x36')]);_0x225603[_0xc446('0x39')]=_['intersection'](_0x39302a[_0xc446('0x34')],qs[_0xc446('0x3a')](_0x16be29[_0xc446('0x36')][_0xc446('0x3a')]));_0x225603[_0xc446('0x39')]=_0x225603['attributes'][_0xc446('0x3b')]?_0x225603[_0xc446('0x39')]:_0x39302a[_0xc446('0x34')];if(_0x16be29[_0xc446('0x36')][_0xc446('0x3c')]){_0x225603[_0xc446('0x3d')]=[{'all':!![]}];}_0x225603=_[_0xc446('0x3e')]({},_0x225603,_0x16be29[_0xc446('0x3f')]);return db['DashboardItem']['find'](_0x225603)[_0xc446('0x2b')](handleEntityNotFound(_0x1bd4e6,null))[_0xc446('0x2b')](respondWithResult(_0x1bd4e6,null))[_0xc446('0x40')](handleError(_0x1bd4e6,null));};exports['destroy']=function(_0x2b4dae,_0x446c5f){return db[_0xc446('0x41')]['find']({'where':{'id':_0x2b4dae['params']['id']}})['then'](handleEntityNotFound(_0x446c5f,null))[_0xc446('0x2b')](removeEntity(_0x446c5f,null))['catch'](handleError(_0x446c5f,null));};function widgetAttributes(_0x8b1c5b){try{switch(_0x8b1c5b[_0xc446('0x42')]){case'iframe':return[{'name':_0xc446('0x43'),'value':_0x8b1c5b[_0xc446('0x43')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x0]?_0x8b1c5b['attrs'][0x0][_0xc446('0x45')]:undefined)||_0xc446('0x46')}];case'custom':return[{'name':_0xc446('0x47'),'value':_0x8b1c5b[_0xc446('0x47')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x0]?_0x8b1c5b[_0xc446('0x44')][0x0]['value']:undefined)||''}];case _0xc446('0x48'):return[{'name':_0xc446('0x49'),'value':_0x8b1c5b[_0xc446('0x49')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x0]?_0x8b1c5b['attrs'][0x0][_0xc446('0x45')]:undefined)||_0xc446('0x4a')},{'name':_0xc446('0x4b'),'value':_0x8b1c5b[_0xc446('0x4b')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b['attrs'][0x1]?_0x8b1c5b[_0xc446('0x44')][0x1]['value']:undefined)||_0xc446('0x4c')},{'name':_0xc446('0x4d'),'value':_0x8b1c5b['attrFontSize']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x2]?_0x8b1c5b[_0xc446('0x44')][0x2][_0xc446('0x45')]:undefined)||0xc}];case _0xc446('0x4e'):return[{'name':_0xc446('0x4f'),'value':_0x8b1c5b['attrMetric']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x0]?_0x8b1c5b[_0xc446('0x44')][0x0]['value']:undefined)||_0xc446('0x50')},{'name':_0xc446('0x51'),'value':_0x8b1c5b[_0xc446('0x51')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x1]?_0x8b1c5b[_0xc446('0x44')][0x1][_0xc446('0x45')]:undefined)||[]},{'name':_0xc446('0x4d'),'value':_0x8b1c5b[_0xc446('0x4d')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x2]?_0x8b1c5b[_0xc446('0x44')][0x2][_0xc446('0x45')]:undefined)||0x14},{'name':_0xc446('0x52'),'value':_0x8b1c5b[_0xc446('0x52')]||(_0x8b1c5b['attrs']&&_0x8b1c5b['attrs'][0x3]?_0x8b1c5b[_0xc446('0x44')][0x3][_0xc446('0x45')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x8b1c5b['attrEmailAccounts']||(_0x8b1c5b['attrs']&&_0x8b1c5b[_0xc446('0x44')][0x4]?_0x8b1c5b[_0xc446('0x44')][0x4][_0xc446('0x45')]:undefined)||''},{'name':_0xc446('0x53'),'value':_0x8b1c5b[_0xc446('0x53')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x5]?_0x8b1c5b[_0xc446('0x44')][0x5][_0xc446('0x45')]:undefined)||''},{'name':_0xc446('0x54'),'value':_0x8b1c5b['attrSmsAccounts']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x6]?_0x8b1c5b[_0xc446('0x44')][0x6]['value']:undefined)||''},{'name':_0xc446('0x55'),'value':_0x8b1c5b['attrOpenchannelAccounts']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x7]?_0x8b1c5b[_0xc446('0x44')][0x7][_0xc446('0x45')]:undefined)||''},{'name':_0xc446('0x56'),'value':_0x8b1c5b['attrWhatsappAccounts']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b['attrs'][0x8]?_0x8b1c5b[_0xc446('0x44')][0x8]['value']:undefined)||''},{'name':_0xc446('0x57'),'value':_0x8b1c5b['attrChatWebsites']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x9]?_0x8b1c5b['attrs'][0x9]['value']:undefined)||''}];case _0xc446('0x58'):case'pie-chart':return[{'name':_0xc446('0x59'),'value':_0x8b1c5b[_0xc446('0x59')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x0]?_0x8b1c5b[_0xc446('0x44')][0x0][_0xc446('0x45')]:undefined)||_0xc446('0x50')},{'name':'attrSerie2','value':_0x8b1c5b[_0xc446('0x5a')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x1]?_0x8b1c5b[_0xc446('0x44')][0x1][_0xc446('0x45')]:undefined)||null},{'name':_0xc446('0x5b'),'value':_0x8b1c5b[_0xc446('0x5b')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x2]?_0x8b1c5b[_0xc446('0x44')][0x2][_0xc446('0x45')]:undefined)||null},{'name':_0xc446('0x51'),'value':_0x8b1c5b['attrVoiceQueues']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x3]?_0x8b1c5b[_0xc446('0x44')][0x3][_0xc446('0x45')]:undefined)||[]},{'name':'attrChannel','value':_0x8b1c5b['attrChannel']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b['attrs'][0x4]?_0x8b1c5b[_0xc446('0x44')][0x4][_0xc446('0x45')]:undefined)||_0xc446('0x5c')},{'name':'attrEmailAccounts','value':_0x8b1c5b[_0xc446('0x5d')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x5]?_0x8b1c5b['attrs'][0x5]['value']:undefined)||''},{'name':_0xc446('0x53'),'value':_0x8b1c5b[_0xc446('0x53')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x6]?_0x8b1c5b[_0xc446('0x44')][0x6][_0xc446('0x45')]:undefined)||''},{'name':_0xc446('0x54'),'value':_0x8b1c5b[_0xc446('0x54')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x7]?_0x8b1c5b[_0xc446('0x44')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x8b1c5b['attrOpenchannelAccounts']||(_0x8b1c5b['attrs']&&_0x8b1c5b['attrs'][0x8]?_0x8b1c5b[_0xc446('0x44')][0x8][_0xc446('0x45')]:undefined)||''},{'name':_0xc446('0x56'),'value':_0x8b1c5b[_0xc446('0x56')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b['attrs'][0x9]?_0x8b1c5b[_0xc446('0x44')][0x9]['value']:undefined)||''},{'name':_0xc446('0x57'),'value':_0x8b1c5b[_0xc446('0x57')]||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b['attrs'][0xa]?_0x8b1c5b[_0xc446('0x44')][0xa]['value']:undefined)||''}];case _0xc446('0x5e'):return[{'name':_0xc446('0x5f'),'type':_0x8b1c5b['reportType']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x0]?_0x8b1c5b[_0xc446('0x44')][0x0][_0xc446('0x42')]:undefined)||null,'value':_0x8b1c5b['attrReport']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x0]?_0x8b1c5b[_0xc446('0x44')][0x0][_0xc446('0x45')]:undefined)||null},{'name':'attrRefresh','value':_0x8b1c5b['attrRefresh']||(_0x8b1c5b[_0xc446('0x44')]&&_0x8b1c5b[_0xc446('0x44')][0x1]?_0x8b1c5b[_0xc446('0x44')][0x1][_0xc446('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x18412d){logger[_0xc446('0x2e')](_0xc446('0x60'),JSON['stringify'](_0x18412d));return[];}}exports[_0xc446('0x61')]=function(_0x221671,_0x39f96f){if(_0x221671['body']){_0x221671['body']['attrs']=widgetAttributes(_0x221671['body']);}return db['DashboardItem'][_0xc446('0x61')](_0x221671['body'],{})[_0xc446('0x2b')](respondWithResult(_0x39f96f,0xc9))[_0xc446('0x40')](handleError(_0x39f96f,null));};exports[_0xc446('0x2a')]=function(_0x908141,_0x187dd9){if(_0x908141[_0xc446('0x62')]['id']){delete _0x908141[_0xc446('0x62')]['id'];}_0x908141[_0xc446('0x62')][_0xc446('0x44')]=widgetAttributes(_0x908141[_0xc446('0x62')]);return db['DashboardItem'][_0xc446('0x63')]({'where':{'id':_0x908141[_0xc446('0x33')]['id']}})[_0xc446('0x2b')](handleEntityNotFound(_0x187dd9,null))[_0xc446('0x2b')](saveUpdates(_0x908141['body'],null))[_0xc446('0x2b')](respondWithResult(_0x187dd9,null))[_0xc446('0x40')](handleError(_0x187dd9,null));}; \ No newline at end of file +var _0xf8af=['https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','create','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','error','stack','send','show','params','model','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','type','attrUrl','attrs'];(function(_0x1f58ff,_0x22a9d1){var _0x14785a=function(_0x487d29){while(--_0x487d29){_0x1f58ff['push'](_0x1f58ff['shift']());}};_0x14785a(++_0x22a9d1);}(_0xf8af,0x8b));var _0xff8a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf8af[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var jsonpatch=require(_0xff8a('0x2'));var rp=require(_0xff8a('0x3'));var moment=require(_0xff8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff8a('0x5'));var util=require(_0xff8a('0x6'));var path=require(_0xff8a('0x7'));var sox=require(_0xff8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8a('0x9'));var _=require('lodash');var squel=require(_0xff8a('0xa'));var crypto=require(_0xff8a('0xb'));var jsforce=require(_0xff8a('0xc'));var deskjs=require(_0xff8a('0xd'));var toCsv=require(_0xff8a('0xe'));var querystring=require(_0xff8a('0xf'));var Papa=require(_0xff8a('0x10'));var Redis=require(_0xff8a('0x11'));var authService=require(_0xff8a('0x12'));var qs=require(_0xff8a('0x13'));var as=require(_0xff8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8a('0x15'))(_0xff8a('0x16'));var utils=require(_0xff8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff8a('0x18'));var db=require(_0xff8a('0x19'))['db'];config[_0xff8a('0x1a')]=_[_0xff8a('0x1b')](config[_0xff8a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff8a('0x1c'))(new Redis(config[_0xff8a('0x1a')]));require(_0xff8a('0x1d'))[_0xff8a('0x1e')](socket);function respondWithStatusCode(_0x5d793b,_0x5a17f8){_0x5a17f8=_0x5a17f8||0xcc;return function(_0x559371){if(_0x559371){return _0x5d793b['sendStatus'](_0x5a17f8);}return _0x5d793b[_0xff8a('0x1f')](_0x5a17f8)['end']();};}function respondWithResult(_0x279441,_0x2917a7){_0x2917a7=_0x2917a7||0xc8;return function(_0x4e98b0){if(_0x4e98b0){return _0x279441[_0xff8a('0x1f')](_0x2917a7)['json'](_0x4e98b0);}};}function respondWithFilteredResult(_0x5ed382,_0x392f43){return function(_0x68524a){if(_0x68524a){var _0x124cb9=typeof _0x392f43['offset']===_0xff8a('0x20')&&typeof _0x392f43['limit']===_0xff8a('0x20');var _0x4bb5ec=_0x68524a[_0xff8a('0x21')];var _0x1b4272=_0x124cb9?0x0:_0x392f43[_0xff8a('0x22')];var _0xdb1027=_0x124cb9?_0x68524a[_0xff8a('0x21')]:_0x392f43[_0xff8a('0x22')]+_0x392f43[_0xff8a('0x23')];var _0x1ba1f1;if(_0xdb1027>=_0x4bb5ec){_0xdb1027=_0x4bb5ec;_0x1ba1f1=0xc8;}else{_0x1ba1f1=0xce;}_0x5ed382[_0xff8a('0x1f')](_0x1ba1f1);return _0x5ed382[_0xff8a('0x24')](_0xff8a('0x25'),_0x1b4272+'-'+_0xdb1027+'/'+_0x4bb5ec)[_0xff8a('0x26')](_0x68524a);}return null;};}function patchUpdates(_0x3bb4ac){return function(_0x1d9a9b){try{jsonpatch[_0xff8a('0x27')](_0x1d9a9b,_0x3bb4ac,!![]);}catch(_0x5e7897){return BPromise[_0xff8a('0x28')](_0x5e7897);}return _0x1d9a9b[_0xff8a('0x29')]();};}function saveUpdates(_0x2d6d8f,_0x303050){return function(_0x518d33){if(_0x518d33){return _0x518d33[_0xff8a('0x2a')](_0x2d6d8f)['then'](function(_0x1c9ecc){return _0x1c9ecc;});}return null;};}function removeEntity(_0x3f03ce,_0x2c67c2){return function(_0x3fdce3){if(_0x3fdce3){return _0x3fdce3[_0xff8a('0x2b')]()['then'](function(){_0x3f03ce[_0xff8a('0x1f')](0xcc)[_0xff8a('0x2c')]();});}};}function handleEntityNotFound(_0x3063b1,_0x5153f6){return function(_0x2458a0){if(!_0x2458a0){_0x3063b1[_0xff8a('0x2d')](0x194);}return _0x2458a0;};}function handleError(_0x30c36f,_0x2d69d2){_0x2d69d2=_0x2d69d2||0x1f4;return function(_0x38188f){logger[_0xff8a('0x2e')](_0x38188f[_0xff8a('0x2f')]);if(_0x38188f['name']){delete _0x38188f['name'];}_0x30c36f[_0xff8a('0x1f')](_0x2d69d2)[_0xff8a('0x30')](_0x38188f);};}exports[_0xff8a('0x31')]=function(_0x279347,_0x430cbd){var _0x184254={'raw':![],'where':{'id':_0x279347[_0xff8a('0x32')]['id']}},_0x50cb0f={};_0x50cb0f[_0xff8a('0x33')]=_['keys'](db[_0xff8a('0x34')][_0xff8a('0x35')]);_0x50cb0f[_0xff8a('0x36')]=_['keys'](_0x279347[_0xff8a('0x36')]);_0x50cb0f[_0xff8a('0x37')]=_['intersection'](_0x50cb0f[_0xff8a('0x33')],_0x50cb0f[_0xff8a('0x36')]);_0x184254[_0xff8a('0x38')]=_[_0xff8a('0x39')](_0x50cb0f[_0xff8a('0x33')],qs[_0xff8a('0x3a')](_0x279347[_0xff8a('0x36')][_0xff8a('0x3a')]));_0x184254[_0xff8a('0x38')]=_0x184254['attributes'][_0xff8a('0x3b')]?_0x184254[_0xff8a('0x38')]:_0x50cb0f['model'];if(_0x279347[_0xff8a('0x36')][_0xff8a('0x3c')]){_0x184254[_0xff8a('0x3d')]=[{'all':!![]}];}_0x184254=_[_0xff8a('0x3e')]({},_0x184254,_0x279347[_0xff8a('0x3f')]);return db[_0xff8a('0x34')][_0xff8a('0x40')](_0x184254)[_0xff8a('0x41')](handleEntityNotFound(_0x430cbd,null))[_0xff8a('0x41')](respondWithResult(_0x430cbd,null))['catch'](handleError(_0x430cbd,null));};exports['destroy']=function(_0x15a96b,_0x3f58a4){return db['DashboardItem'][_0xff8a('0x40')]({'where':{'id':_0x15a96b[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f58a4,null))['then'](removeEntity(_0x3f58a4,null))['catch'](handleError(_0x3f58a4,null));};function widgetAttributes(_0x2fd75f){try{switch(_0x2fd75f[_0xff8a('0x42')]){case'iframe':return[{'name':_0xff8a('0x43'),'value':_0x2fd75f[_0xff8a('0x43')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['value']:undefined)||_0xff8a('0x45')}];case _0xff8a('0x46'):return[{'name':'attrPath','value':_0x2fd75f[_0xff8a('0x47')]||(_0x2fd75f['attrs']&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x49'):return[{'name':_0xff8a('0x4a'),'value':_0x2fd75f[_0xff8a('0x4a')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x4b')},{'name':_0xff8a('0x4c'),'value':_0x2fd75f[_0xff8a('0x4c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||_0xff8a('0x4d')},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0xc}];case _0xff8a('0x4f'):return[{'name':_0xff8a('0x50'),'value':_0x2fd75f['attrMetric']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||[]},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0x14},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3][_0xff8a('0x48')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f[_0xff8a('0x57')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f[_0xff8a('0x44')][0x8][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x5a'):case _0xff8a('0x5b'):return[{'name':'attrSerie1','value':_0x2fd75f[_0xff8a('0x5c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x5d'),'value':_0x2fd75f[_0xff8a('0x5d')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x5e'),'value':_0x2fd75f[_0xff8a('0x5e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3]['value']:undefined)||[]},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4][_0xff8a('0x48')]:undefined)||_0xff8a('0x5f')},{'name':_0xff8a('0x54'),'value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f['attrOpenchannelAccounts']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f['attrs'][0x8]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9]['value']:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0xa]?_0x2fd75f['attrs'][0xa][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x60'):return[{'name':_0xff8a('0x61'),'type':_0x2fd75f[_0xff8a('0x62')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['type']:undefined)||null,'value':_0x2fd75f[_0xff8a('0x61')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x63'),'value':_0x2fd75f[_0xff8a('0x63')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5acf87){logger[_0xff8a('0x2e')](_0xff8a('0x64'),JSON['stringify'](_0x5acf87));return[];}}exports['create']=function(_0x40e4ee,_0x4ddc06){if(_0x40e4ee[_0xff8a('0x65')]){_0x40e4ee[_0xff8a('0x65')][_0xff8a('0x44')]=widgetAttributes(_0x40e4ee[_0xff8a('0x65')]);}return db[_0xff8a('0x34')][_0xff8a('0x66')](_0x40e4ee[_0xff8a('0x65')],{})[_0xff8a('0x41')](respondWithResult(_0x4ddc06,0xc9))[_0xff8a('0x67')](handleError(_0x4ddc06,null));};exports[_0xff8a('0x2a')]=function(_0x182026,_0x48d8e7){if(_0x182026[_0xff8a('0x65')]['id']){delete _0x182026[_0xff8a('0x65')]['id'];}_0x182026[_0xff8a('0x65')]['attrs']=widgetAttributes(_0x182026[_0xff8a('0x65')]);return db[_0xff8a('0x34')]['find']({'where':{'id':_0x182026[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x48d8e7,null))[_0xff8a('0x41')](saveUpdates(_0x182026[_0xff8a('0x65')],null))[_0xff8a('0x41')](respondWithResult(_0x48d8e7,null))[_0xff8a('0x67')](handleError(_0x48d8e7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 2028a5f..5a71409 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 _0xeed2=['update','emit','hasOwnProperty','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x5271b6,_0x3b72d9){var _0x56f864=function(_0x93ae1d){while(--_0x93ae1d){_0x5271b6['push'](_0x5271b6['shift']());}};_0x56f864(++_0x3b72d9);}(_0xeed2,0xf3));var _0x2eed=function(_0x3eb305,_0x2b215c){_0x3eb305=_0x3eb305-0x0;var _0x5178b6=_0xeed2[_0x3eb305];return _0x5178b6;};'use strict';var EventEmitter=require(_0x2eed('0x0'));var DashboardItem=require(_0x2eed('0x1'))['db'][_0x2eed('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x2eed('0x3')](0x0);var events={'afterCreate':_0x2eed('0x4'),'afterUpdate':_0x2eed('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd5ab3b){return function(_0x408315,_0x45a78d,_0x38df5a){DashboardItemEvents['emit'](_0xd5ab3b+':'+_0x408315['id'],_0x408315);DashboardItemEvents[_0x2eed('0x6')](_0xd5ab3b,_0x408315);_0x38df5a(null);};}for(var e in events){if(events[_0x2eed('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x4198=['DashboardItem','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x12e2b6,_0x456d4a){var _0x402ea3=function(_0x3898e1){while(--_0x3898e1){_0x12e2b6['push'](_0x12e2b6['shift']());}};_0x402ea3(++_0x456d4a);}(_0x4198,0x174));var _0x8419=function(_0x4de142,_0x1e77e7){_0x4de142=_0x4de142-0x0;var _0x568b8e=_0x4198[_0x4de142];return _0x568b8e;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x8419('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x8419('0x1')](0x0);var events={'afterCreate':_0x8419('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3fbf4d){return function(_0xbb8734,_0x41bb91,_0x51d59c){DashboardItemEvents[_0x8419('0x3')](_0x3fbf4d+':'+_0xbb8734['id'],_0xbb8734);DashboardItemEvents[_0x8419('0x3')](_0x3fbf4d,_0xbb8734);_0x51d59c(null);};}for(var e in events){if(events[_0x8419('0x4')](e)){var event=events[e];DashboardItem[_0x8419('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index ac27ba8..3abf95e 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 _0x435a=['bluebird','request-promise','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items'];(function(_0x3126ac,_0x48ce78){var _0xe22cc8=function(_0x5bdef5){while(--_0x5bdef5){_0x3126ac['push'](_0x3126ac['shift']());}};_0xe22cc8(++_0x48ce78);}(_0x435a,0x13b));var _0xa435=function(_0x3d829d,_0x5af899){_0x3d829d=_0x3d829d-0x0;var _0x318701=_0x435a[_0x3d829d];return _0x318701;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa435('0x0'));var rp=require(_0xa435('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa435('0x2'));module[_0xa435('0x3')]=function(_0x1a8386,_0xc88a73){return _0x1a8386[_0xa435('0x4')](_0xa435('0x5'),attributes,{'tableName':_0xa435('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffcc=['DashboardItem','util','api','moment','rimraf','./dashboardItem.attributes','define'];(function(_0x4a6462,_0x61b1b5){var _0x122407=function(_0x42618b){while(--_0x42618b){_0x4a6462['push'](_0x4a6462['shift']());}};_0x122407(++_0x61b1b5);}(_0xffcc,0x112));var _0xcffc=function(_0x5c87bf,_0x4c8df5){_0x5c87bf=_0x5c87bf-0x0;var _0x19644a=_0xffcc[_0x5c87bf];return _0x19644a;};'use strict';var _=require('lodash');var util=require(_0xcffc('0x0'));var logger=require('../../config/logger')(_0xcffc('0x1'));var moment=require(_0xcffc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcffc('0x3'));var config=require('../../config/environment');var attributes=require(_0xcffc('0x4'));module['exports']=function(_0x3e3133,_0x4563a2){return _0x3e3133[_0xcffc('0x5')](_0xcffc('0x6'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index eb4c978..8bea492 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 _0x99f6=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s'];(function(_0x4862d1,_0x534614){var _0x38332f=function(_0x7d066e){while(--_0x7d066e){_0x4862d1['push'](_0x4862d1['shift']());}};_0x38332f(++_0x534614);}(_0x99f6,0x1b8));var _0x699f=function(_0x4ce7b7,_0x9b9ba1){_0x4ce7b7=_0x4ce7b7-0x0;var _0x44591f=_0x99f6[_0x4ce7b7];return _0x44591f;};'use strict';var _=require(_0x699f('0x0'));var util=require(_0x699f('0x1'));var moment=require(_0x699f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x699f('0x3'))['db'];var utils=require(_0x699f('0x4'));var logger=require('../../config/logger')(_0x699f('0x5'));var config=require('../../config/environment');var jayson=require(_0x699f('0x6'));var client=jayson[_0x699f('0x7')][_0x699f('0x8')]({'port':0x232a});config[_0x699f('0x9')]=_['defaults'](config['redis'],{'host':_0x699f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x699f('0xb'))[_0x699f('0xc')](socket);function respondWithRpcPromise(_0x52990d,_0xe254a6,_0x5177c0){return new BPromise(function(_0xc214cb,_0x3f8117){return client[_0x699f('0xd')](_0x52990d,_0x5177c0)['then'](function(_0x5d1189){logger[_0x699f('0xe')](_0x699f('0xf'),_0xe254a6,_0x699f('0x10'));logger[_0x699f('0x11')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0xe254a6,_0x699f('0x10'),JSON[_0x699f('0x12')](_0x5d1189));if(_0x5d1189[_0x699f('0x13')]){if(_0x5d1189[_0x699f('0x13')][_0x699f('0x14')]===0x1f4){logger[_0x699f('0x13')]('DashboardItem,\x20%s,\x20%s',_0xe254a6,_0x5d1189['error'][_0x699f('0x15')]);return _0x3f8117(_0x5d1189[_0x699f('0x13')][_0x699f('0x15')]);}logger['error'](_0x699f('0xf'),_0xe254a6,_0x5d1189[_0x699f('0x13')][_0x699f('0x15')]);return _0xc214cb(_0x5d1189[_0x699f('0x13')][_0x699f('0x15')]);}else{logger[_0x699f('0xe')](_0x699f('0xf'),_0xe254a6,_0x699f('0x10'));_0xc214cb(_0x5d1189[_0x699f('0x16')][_0x699f('0x15')]);}})[_0x699f('0x17')](function(_0x4d23dc){logger[_0x699f('0x13')](_0x699f('0xf'),_0xe254a6,_0x4d23dc);_0x3f8117(_0x4d23dc);});});} \ No newline at end of file +var _0x3696=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x24faf8,_0x38f806){var _0x2914cc=function(_0x12bf09){while(--_0x12bf09){_0x24faf8['push'](_0x24faf8['shift']());}};_0x2914cc(++_0x38f806);}(_0x3696,0x191));var _0x6369=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x3696[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x6369('0x0'));var util=require(_0x6369('0x1'));var moment=require(_0x6369('0x2'));var BPromise=require(_0x6369('0x3'));var rs=require(_0x6369('0x4'));var fs=require('fs');var Redis=require(_0x6369('0x5'));var db=require(_0x6369('0x6'))['db'];var utils=require(_0x6369('0x7'));var logger=require('../../config/logger')(_0x6369('0x8'));var config=require(_0x6369('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6369('0xa')]['http']({'port':0x232a});config[_0x6369('0xb')]=_[_0x6369('0xc')](config[_0x6369('0xb')],{'host':_0x6369('0xd'),'port':0x18eb});var socket=require(_0x6369('0xe'))(new Redis(config[_0x6369('0xb')]));require(_0x6369('0xf'))[_0x6369('0x10')](socket);function respondWithRpcPromise(_0x29e22d,_0x314768,_0x1bfb74){return new BPromise(function(_0x1b21df,_0x2cb71e){return client[_0x6369('0x11')](_0x29e22d,_0x1bfb74)[_0x6369('0x12')](function(_0x777749){logger['info'](_0x6369('0x13'),_0x314768,_0x6369('0x14'));logger[_0x6369('0x15')](_0x6369('0x16'),_0x314768,_0x6369('0x14'),JSON[_0x6369('0x17')](_0x777749));if(_0x777749[_0x6369('0x18')]){if(_0x777749[_0x6369('0x18')]['code']===0x1f4){logger[_0x6369('0x18')](_0x6369('0x13'),_0x314768,_0x777749[_0x6369('0x18')]['message']);return _0x2cb71e(_0x777749['error'][_0x6369('0x19')]);}logger['error'](_0x6369('0x13'),_0x314768,_0x777749[_0x6369('0x18')][_0x6369('0x19')]);return _0x1b21df(_0x777749[_0x6369('0x18')][_0x6369('0x19')]);}else{logger[_0x6369('0x1a')](_0x6369('0x13'),_0x314768,'request\x20sent');_0x1b21df(_0x777749[_0x6369('0x1b')][_0x6369('0x19')]);}})[_0x6369('0x1c')](function(_0x52a668){logger[_0x6369('0x18')]('DashboardItem,\x20%s,\x20%s',_0x314768,_0x52a668);_0x2cb71e(_0x52a668);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index d3f364a..0f9e183 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 _0xe130=['emit','removeListener','register','length','dashboardItem:','remove'];(function(_0x299157,_0x12cca6){var _0x225ba0=function(_0x1ab76c){while(--_0x1ab76c){_0x299157['push'](_0x299157['shift']());}};_0x225ba0(++_0x12cca6);}(_0xe130,0x113));var _0x0e13=function(_0x517578,_0x453afc){_0x517578=_0x517578-0x0;var _0x1b3a20=_0xe130[_0x517578];return _0x1b3a20;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0x0e13('0x0'),'update'];function createListener(_0x2d4446,_0xc6371e){return function(_0xf5d65e){_0xc6371e[_0x0e13('0x1')](_0x2d4446,_0xf5d65e);};}function removeListener(_0x292f6b,_0x63840e){return function(){DashboardItemEvents[_0x0e13('0x2')](_0x292f6b,_0x63840e);};}exports[_0x0e13('0x3')]=function(_0x50ffaf){for(var _0x25dffe=0x0,_0x21a8fd=events[_0x0e13('0x4')];_0x25dffe<_0x21a8fd;_0x25dffe++){var _0x51eeac=events[_0x25dffe];var _0x5a5ded=createListener(_0x0e13('0x5')+_0x51eeac,_0x50ffaf);DashboardItemEvents['on'](_0x51eeac,_0x5a5ded);}}; \ No newline at end of file +var _0xf83d=['save','update','emit','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x4efd72,_0xf82337){var _0x17e3eb=function(_0x6f1155){while(--_0x6f1155){_0x4efd72['push'](_0x4efd72['shift']());}};_0x17e3eb(++_0xf82337);}(_0xf83d,0x15d));var _0xdf83=function(_0x257574,_0x572286){_0x257574=_0x257574-0x0;var _0x25623a=_0xf83d[_0x257574];return _0x25623a;};'use strict';var DashboardItemEvents=require(_0xdf83('0x0'));var events=[_0xdf83('0x1'),'remove',_0xdf83('0x2')];function createListener(_0x279f47,_0x22f1b4){return function(_0x41c0ff){_0x22f1b4[_0xdf83('0x3')](_0x279f47,_0x41c0ff);};}function removeListener(_0x41b863,_0xde7aa3){return function(){DashboardItemEvents['removeListener'](_0x41b863,_0xde7aa3);};}exports[_0xdf83('0x4')]=function(_0x39c1bf){for(var _0x3abc30=0x0,_0x3af310=events[_0xdf83('0x5')];_0x3abc30<_0x3af310;_0x3abc30++){var _0x287355=events[_0x3abc30];var _0x57b19e=createListener(_0xdf83('0x6')+_0x287355,_0x39c1bf);DashboardItemEvents['on'](_0x287355,_0x57b19e);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index acd3b33..f1d5f24 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 _0x682d=['update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../config/environment','./dashboardItem.controller','isAuthenticated','post','create','put'];(function(_0x491197,_0x3cee6a){var _0x57051d=function(_0x3f51bb){while(--_0x3f51bb){_0x491197['push'](_0x491197['shift']());}};_0x57051d(++_0x3cee6a);}(_0x682d,0x1b5));var _0xd682=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x682d[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xd682('0x0'));var util=require('util');var path=require(_0xd682('0x1'));var timeout=require(_0xd682('0x2'));var express=require('express');var router=express[_0xd682('0x3')]();var fs_extra=require(_0xd682('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd682('0x5'));var controller=require(_0xd682('0x6'));router['get']('/:id',auth[_0xd682('0x7')](),controller['show']);router[_0xd682('0x8')]('/',auth[_0xd682('0x7')](),controller[_0xd682('0x9')]);router[_0xd682('0xa')]('/:id',auth[_0xd682('0x7')](),controller[_0xd682('0xb')]);router['delete']('/:id',auth[_0xd682('0x7')](),controller[_0xd682('0xc')]);module[_0xd682('0xd')]=router; \ No newline at end of file +var _0x496b=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','post','isAuthenticated','create','put','update','destroy','multer','util'];(function(_0x5a2162,_0x5a90a3){var _0x4561a7=function(_0x11849e){while(--_0x11849e){_0x5a2162['push'](_0x5a2162['shift']());}};_0x4561a7(++_0x5a90a3);}(_0x496b,0x16e));var _0xb496=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x496b[_0x2283dc];return _0x16db90;};'use strict';var multer=require(_0xb496('0x0'));var util=require(_0xb496('0x1'));var path=require(_0xb496('0x2'));var timeout=require(_0xb496('0x3'));var express=require(_0xb496('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb496('0x5'));var interaction=require(_0xb496('0x6'));var config=require(_0xb496('0x7'));var controller=require('./dashboardItem.controller');router['get'](_0xb496('0x8'),auth['isAuthenticated'](),controller[_0xb496('0x9')]);router[_0xb496('0xa')]('/',auth[_0xb496('0xb')](),controller[_0xb496('0xc')]);router[_0xb496('0xd')](_0xb496('0x8'),auth['isAuthenticated'](),controller[_0xb496('0xe')]);router['delete'](_0xb496('0x8'),auth[_0xb496('0xb')](),controller[_0xb496('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 20d6426..31e5dd6 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 _0xbdb1=['second','third','exports','STRING','ENUM','first'];(function(_0x437d59,_0x5a52ac){var _0x32e950=function(_0x4ad939){while(--_0x4ad939){_0x437d59['push'](_0x437d59['shift']());}};_0x32e950(++_0x5a52ac);}(_0xbdb1,0x13a));var _0x1bdb=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0xbdb1[_0x4907de];return _0x482054;};'use strict';var Sequelize=require('sequelize');module[_0x1bdb('0x0')]={'name':{'type':Sequelize[_0x1bdb('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x1bdb('0x2')](_0x1bdb('0x3'),_0x1bdb('0x4'),_0x1bdb('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x1bdb('0x1')]}}; \ No newline at end of file +var _0xae67=['STRING','first','sequelize','exports'];(function(_0x2605bd,_0x101e00){var _0x20c9ba=function(_0x24b0c7){while(--_0x24b0c7){_0x2605bd['push'](_0x2605bd['shift']());}};_0x20c9ba(++_0x101e00);}(_0xae67,0x82));var _0x7ae6=function(_0x30e11a,_0x1f5e33){_0x30e11a=_0x30e11a-0x0;var _0x1ccd24=_0xae67[_0x30e11a];return _0x1ccd24;};'use strict';var Sequelize=require(_0x7ae6('0x0'));module[_0x7ae6('0x1')]={'name':{'type':Sequelize[_0x7ae6('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first','second','third'),'allowNull':![],'defaultValue':_0x7ae6('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ca6c36b..77029ed 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 _0x38e7=['index','map','Disposition','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','Dispositions','UserProfileResource','error','stack','name'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x38e7,0x124));var _0x738e=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x38e7[_0x1af05b];return _0x5be7cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x738e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x738e('0x1'));var rp=require(_0x738e('0x2'));var moment=require(_0x738e('0x3'));var BPromise=require(_0x738e('0x4'));var Mustache=require(_0x738e('0x5'));var util=require(_0x738e('0x6'));var path=require(_0x738e('0x7'));var sox=require('sox');var csv=require(_0x738e('0x8'));var ejs=require(_0x738e('0x9'));var fs=require('fs');var fs_extra=require(_0x738e('0xa'));var _=require(_0x738e('0xb'));var squel=require(_0x738e('0xc'));var crypto=require(_0x738e('0xd'));var jsforce=require(_0x738e('0xe'));var deskjs=require(_0x738e('0xf'));var toCsv=require(_0x738e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x738e('0x10'));var authService=require(_0x738e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x738e('0x12'));var hardwareService=require(_0x738e('0x13'));var logger=require(_0x738e('0x14'))(_0x738e('0x15'));var utils=require(_0x738e('0x16'));var config=require(_0x738e('0x17'));var licenseUtil=require(_0x738e('0x18'));var db=require(_0x738e('0x19'))['db'];function respondWithStatusCode(_0xebda88,_0x1324b8){_0x1324b8=_0x1324b8||0xcc;return function(_0x32f0a2){if(_0x32f0a2){return _0xebda88['sendStatus'](_0x1324b8);}return _0xebda88['status'](_0x1324b8)[_0x738e('0x1a')]();};}function respondWithResult(_0x1f0490,_0x5dcdd9){_0x5dcdd9=_0x5dcdd9||0xc8;return function(_0x209485){if(_0x209485){return _0x1f0490[_0x738e('0x1b')](_0x5dcdd9)[_0x738e('0x1c')](_0x209485);}};}function respondWithFilteredResult(_0x42a029,_0x3eb12b){return function(_0x487f6a){if(_0x487f6a){var _0x5907f8=typeof _0x3eb12b[_0x738e('0x1d')]===_0x738e('0x1e')&&typeof _0x3eb12b['limit']==='undefined';var _0x55b0c8=_0x487f6a[_0x738e('0x1f')];var _0x480f5c=_0x5907f8?0x0:_0x3eb12b['offset'];var _0x4d99cc=_0x5907f8?_0x487f6a[_0x738e('0x1f')]:_0x3eb12b[_0x738e('0x1d')]+_0x3eb12b[_0x738e('0x20')];var _0x5a7903;if(_0x4d99cc>=_0x55b0c8){_0x4d99cc=_0x55b0c8;_0x5a7903=0xc8;}else{_0x5a7903=0xce;}_0x42a029['status'](_0x5a7903);return _0x42a029['set'](_0x738e('0x21'),_0x480f5c+'-'+_0x4d99cc+'/'+_0x55b0c8)[_0x738e('0x1c')](_0x487f6a);}return null;};}function patchUpdates(_0x3dbaca){return function(_0x5352ab){try{jsonpatch[_0x738e('0x22')](_0x5352ab,_0x3dbaca,!![]);}catch(_0x554d00){return BPromise[_0x738e('0x23')](_0x554d00);}return _0x5352ab[_0x738e('0x24')]();};}function saveUpdates(_0xb51078,_0x25f9d4){return function(_0x483b97){if(_0x483b97){return _0x483b97['update'](_0xb51078)[_0x738e('0x25')](function(_0x106d6e){return _0x106d6e;});}return null;};}function removeEntity(_0x312493,_0x444410){return function(_0x3c5b02){if(_0x3c5b02){return _0x3c5b02[_0x738e('0x26')]()[_0x738e('0x25')](function(){var _0x1379ec=_0x3c5b02['get']({'plain':!![]});var _0x2c3303=_0x738e('0x27');return db[_0x738e('0x28')][_0x738e('0x26')]({'where':{'type':_0x2c3303,'resourceId':_0x1379ec['id']}})[_0x738e('0x25')](function(){return _0x3c5b02;});})['then'](function(){_0x312493[_0x738e('0x1b')](0xcc)[_0x738e('0x1a')]();});}};}function handleEntityNotFound(_0x2e8895,_0x18dc51){return function(_0x1ee175){if(!_0x1ee175){_0x2e8895['sendStatus'](0x194);}return _0x1ee175;};}function handleError(_0x1b9881,_0x5dc9ce){_0x5dc9ce=_0x5dc9ce||0x1f4;return function(_0x2d77b0){logger[_0x738e('0x29')](_0x2d77b0[_0x738e('0x2a')]);if(_0x2d77b0[_0x738e('0x2b')]){delete _0x2d77b0['name'];}_0x1b9881[_0x738e('0x1b')](_0x5dc9ce)['send'](_0x2d77b0);};}exports[_0x738e('0x2c')]=function(_0x992321,_0x94851){var _0x454034={},_0x4170ea={},_0x1483f4={'count':0x0,'rows':[]};var _0x26f75e=_[_0x738e('0x2d')](db[_0x738e('0x2e')][_0x738e('0x2f')],function(_0x5c17ca){return{'name':_0x5c17ca[_0x738e('0x30')],'type':_0x5c17ca[_0x738e('0x31')]['key']};});_0x4170ea[_0x738e('0x32')]=_['map'](_0x26f75e,_0x738e('0x2b'));_0x4170ea[_0x738e('0x33')]=_[_0x738e('0x34')](_0x992321[_0x738e('0x33')]);_0x4170ea[_0x738e('0x35')]=_[_0x738e('0x36')](_0x4170ea[_0x738e('0x32')],_0x4170ea[_0x738e('0x33')]);_0x454034['attributes']=_[_0x738e('0x36')](_0x4170ea['model'],qs['fields'](_0x992321['query'][_0x738e('0x37')]));_0x454034[_0x738e('0x38')]=_0x454034[_0x738e('0x38')][_0x738e('0x39')]?_0x454034[_0x738e('0x38')]:_0x4170ea[_0x738e('0x32')];if(!_0x992321[_0x738e('0x33')][_0x738e('0x3a')](_0x738e('0x3b'))){_0x454034[_0x738e('0x20')]=qs[_0x738e('0x20')](_0x992321[_0x738e('0x33')]['limit']);_0x454034[_0x738e('0x1d')]=qs['offset'](_0x992321['query'][_0x738e('0x1d')]);}_0x454034['order']=qs[_0x738e('0x3c')](_0x992321['query']['sort']);_0x454034[_0x738e('0x3d')]=qs[_0x738e('0x35')](_[_0x738e('0x3e')](_0x992321[_0x738e('0x33')],_0x4170ea[_0x738e('0x35')]),_0x26f75e);if(_0x992321[_0x738e('0x33')][_0x738e('0x3f')]){_0x454034[_0x738e('0x3d')]=_['merge'](_0x454034[_0x738e('0x3d')],{'$or':_[_0x738e('0x2d')](_0x26f75e,function(_0x174b83){if(_0x174b83[_0x738e('0x31')]!=='VIRTUAL'){var _0x3eff26={};_0x3eff26[_0x174b83[_0x738e('0x2b')]]={'$like':'%'+_0x992321[_0x738e('0x33')][_0x738e('0x3f')]+'%'};return _0x3eff26;}})});}_0x454034=_[_0x738e('0x40')]({},_0x454034,_0x992321[_0x738e('0x41')]);var _0x122289={'where':_0x454034[_0x738e('0x3d')]};return db['Disposition'][_0x738e('0x1f')](_0x122289)[_0x738e('0x25')](function(_0x3203b3){_0x1483f4[_0x738e('0x1f')]=_0x3203b3;if(_0x992321[_0x738e('0x33')][_0x738e('0x42')]){_0x454034[_0x738e('0x43')]=[{'all':!![]}];}return db[_0x738e('0x2e')][_0x738e('0x44')](_0x454034);})['then'](function(_0x555c4a){_0x1483f4[_0x738e('0x45')]=_0x555c4a;return _0x1483f4;})[_0x738e('0x25')](respondWithFilteredResult(_0x94851,_0x454034))['catch'](handleError(_0x94851,null));};exports[_0x738e('0x46')]=function(_0x30cb31,_0x1f369b){var _0x5e854a={'raw':!![],'where':{'id':_0x30cb31[_0x738e('0x47')]['id']}},_0x15a253={};_0x15a253[_0x738e('0x32')]=_[_0x738e('0x34')](db[_0x738e('0x2e')][_0x738e('0x2f')]);_0x15a253['query']=_['keys'](_0x30cb31['query']);_0x15a253[_0x738e('0x35')]=_[_0x738e('0x36')](_0x15a253[_0x738e('0x32')],_0x15a253['query']);_0x5e854a['attributes']=_[_0x738e('0x36')](_0x15a253[_0x738e('0x32')],qs[_0x738e('0x37')](_0x30cb31[_0x738e('0x33')]['fields']));_0x5e854a['attributes']=_0x5e854a[_0x738e('0x38')][_0x738e('0x39')]?_0x5e854a['attributes']:_0x15a253[_0x738e('0x32')];if(_0x30cb31[_0x738e('0x33')]['includeAll']){_0x5e854a['include']=[{'all':!![]}];}_0x5e854a=_[_0x738e('0x40')]({},_0x5e854a,_0x30cb31[_0x738e('0x41')]);return db[_0x738e('0x2e')][_0x738e('0x48')](_0x5e854a)[_0x738e('0x25')](handleEntityNotFound(_0x1f369b,null))[_0x738e('0x25')](respondWithResult(_0x1f369b,null))['catch'](handleError(_0x1f369b,null));};exports[_0x738e('0x49')]=function(_0x1f8ddf,_0x2495f4){return db[_0x738e('0x2e')][_0x738e('0x49')](_0x1f8ddf[_0x738e('0x4a')],{})[_0x738e('0x25')](function(_0x409489){var _0x3ceef8=_0x1f8ddf['user'][_0x738e('0x4b')]({'plain':!![]});if(!_0x3ceef8)throw new Error(_0x738e('0x4c'));if(_0x3ceef8[_0x738e('0x4d')]===_0x738e('0x4e')){var _0xb9536e=_0x409489[_0x738e('0x4b')]({'plain':!![]});var _0x27d413='Dispositions';return db[_0x738e('0x4f')][_0x738e('0x48')]({'where':{'name':_0x27d413,'userProfileId':_0x3ceef8[_0x738e('0x50')]},'raw':!![]})[_0x738e('0x25')](function(_0x40ec96){if(_0x40ec96&&_0x40ec96['autoAssociation']===0x0){return db['UserProfileResource'][_0x738e('0x49')]({'name':_0xb9536e[_0x738e('0x2b')],'resourceId':_0xb9536e['id'],'type':_0x40ec96[_0x738e('0x2b')],'sectionId':_0x40ec96['id']},{})[_0x738e('0x25')](function(){return _0x409489;});}else{return _0x409489;}})[_0x738e('0x51')](function(_0x2f00fb){logger[_0x738e('0x29')](_0x738e('0x52'),_0x2f00fb);throw _0x2f00fb;});}return _0x409489;})[_0x738e('0x25')](respondWithResult(_0x2495f4,0xc9))['catch'](handleError(_0x2495f4,null));};exports[_0x738e('0x53')]=function(_0x2acada,_0x5c7b01){if(_0x2acada[_0x738e('0x4a')]['id']){delete _0x2acada[_0x738e('0x4a')]['id'];}return db['Disposition']['find']({'where':{'id':_0x2acada[_0x738e('0x47')]['id']}})[_0x738e('0x25')](handleEntityNotFound(_0x5c7b01,null))[_0x738e('0x25')](saveUpdates(_0x2acada[_0x738e('0x4a')],null))[_0x738e('0x25')](respondWithResult(_0x5c7b01,null))[_0x738e('0x51')](handleError(_0x5c7b01,null));};exports[_0x738e('0x26')]=function(_0x27fed4,_0x4999ef){return db[_0x738e('0x2e')][_0x738e('0x48')]({'where':{'id':_0x27fed4[_0x738e('0x47')]['id']}})['then'](handleEntityNotFound(_0x4999ef,null))[_0x738e('0x25')](removeEntity(_0x4999ef,null))[_0x738e('0x51')](handleError(_0x4999ef,null));}; \ No newline at end of file +var _0xef27=['stack','name','send','index','map','Disposition','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','Dispositions','UserProfileResource','end','error'];(function(_0x814238,_0x3ccddc){var _0x593b88=function(_0x333899){while(--_0x333899){_0x814238['push'](_0x814238['shift']());}};_0x593b88(++_0x3ccddc);}(_0xef27,0x1c2));var _0x7ef2=function(_0x30116d,_0x5664cc){_0x30116d=_0x30116d-0x0;var _0x2ff8ab=_0xef27[_0x30116d];return _0x2ff8ab;};'use strict';var emlformat=require(_0x7ef2('0x0'));var rimraf=require(_0x7ef2('0x1'));var zipdir=require(_0x7ef2('0x2'));var jsonpatch=require(_0x7ef2('0x3'));var rp=require('request-promise');var moment=require(_0x7ef2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7ef2('0x5'));var sox=require(_0x7ef2('0x6'));var csv=require(_0x7ef2('0x7'));var ejs=require(_0x7ef2('0x8'));var fs=require('fs');var fs_extra=require(_0x7ef2('0x9'));var _=require(_0x7ef2('0xa'));var squel=require(_0x7ef2('0xb'));var crypto=require(_0x7ef2('0xc'));var jsforce=require(_0x7ef2('0xd'));var deskjs=require(_0x7ef2('0xe'));var toCsv=require(_0x7ef2('0x7'));var querystring=require(_0x7ef2('0xf'));var Papa=require(_0x7ef2('0x10'));var Redis=require(_0x7ef2('0x11'));var authService=require(_0x7ef2('0x12'));var qs=require(_0x7ef2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ef2('0x14'));var logger=require('../../config/logger')(_0x7ef2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ef2('0x16'));var db=require(_0x7ef2('0x17'))['db'];function respondWithStatusCode(_0x57834d,_0x3c54a3){_0x3c54a3=_0x3c54a3||0xcc;return function(_0x1b7cf9){if(_0x1b7cf9){return _0x57834d[_0x7ef2('0x18')](_0x3c54a3);}return _0x57834d[_0x7ef2('0x19')](_0x3c54a3)['end']();};}function respondWithResult(_0x368bc9,_0x466e74){_0x466e74=_0x466e74||0xc8;return function(_0x439040){if(_0x439040){return _0x368bc9['status'](_0x466e74)[_0x7ef2('0x1a')](_0x439040);}};}function respondWithFilteredResult(_0x30b964,_0x164bad){return function(_0x5ddb45){if(_0x5ddb45){var _0x341383=typeof _0x164bad[_0x7ef2('0x1b')]===_0x7ef2('0x1c')&&typeof _0x164bad[_0x7ef2('0x1d')]===_0x7ef2('0x1c');var _0x43aa51=_0x5ddb45[_0x7ef2('0x1e')];var _0x3922b0=_0x341383?0x0:_0x164bad['offset'];var _0xee83dd=_0x341383?_0x5ddb45[_0x7ef2('0x1e')]:_0x164bad[_0x7ef2('0x1b')]+_0x164bad[_0x7ef2('0x1d')];var _0x1cce54;if(_0xee83dd>=_0x43aa51){_0xee83dd=_0x43aa51;_0x1cce54=0xc8;}else{_0x1cce54=0xce;}_0x30b964['status'](_0x1cce54);return _0x30b964[_0x7ef2('0x1f')](_0x7ef2('0x20'),_0x3922b0+'-'+_0xee83dd+'/'+_0x43aa51)[_0x7ef2('0x1a')](_0x5ddb45);}return null;};}function patchUpdates(_0x3a6ebb){return function(_0x3ed622){try{jsonpatch['apply'](_0x3ed622,_0x3a6ebb,!![]);}catch(_0x425349){return BPromise[_0x7ef2('0x21')](_0x425349);}return _0x3ed622['save']();};}function saveUpdates(_0x2ca77c,_0x436eb9){return function(_0x49767c){if(_0x49767c){return _0x49767c[_0x7ef2('0x22')](_0x2ca77c)['then'](function(_0x20b07f){return _0x20b07f;});}return null;};}function removeEntity(_0x3f06d1,_0x1b29d5){return function(_0x9c12d){if(_0x9c12d){return _0x9c12d[_0x7ef2('0x23')]()[_0x7ef2('0x24')](function(){var _0x5c3484=_0x9c12d[_0x7ef2('0x25')]({'plain':!![]});var _0x30c3b0=_0x7ef2('0x26');return db[_0x7ef2('0x27')][_0x7ef2('0x23')]({'where':{'type':_0x30c3b0,'resourceId':_0x5c3484['id']}})[_0x7ef2('0x24')](function(){return _0x9c12d;});})[_0x7ef2('0x24')](function(){_0x3f06d1['status'](0xcc)[_0x7ef2('0x28')]();});}};}function handleEntityNotFound(_0x4fd1a5,_0x4f94fa){return function(_0x5af018){if(!_0x5af018){_0x4fd1a5['sendStatus'](0x194);}return _0x5af018;};}function handleError(_0x3fe75b,_0x12e72a){_0x12e72a=_0x12e72a||0x1f4;return function(_0x3823b7){logger[_0x7ef2('0x29')](_0x3823b7[_0x7ef2('0x2a')]);if(_0x3823b7['name']){delete _0x3823b7[_0x7ef2('0x2b')];}_0x3fe75b['status'](_0x12e72a)[_0x7ef2('0x2c')](_0x3823b7);};}exports[_0x7ef2('0x2d')]=function(_0x35f20e,_0x508504){var _0x49293e={},_0x492845={},_0x3f7c25={'count':0x0,'rows':[]};var _0x5725fb=_[_0x7ef2('0x2e')](db[_0x7ef2('0x2f')]['rawAttributes'],function(_0x2e3327){return{'name':_0x2e3327[_0x7ef2('0x30')],'type':_0x2e3327[_0x7ef2('0x31')]['key']};});_0x492845[_0x7ef2('0x32')]=_[_0x7ef2('0x2e')](_0x5725fb,_0x7ef2('0x2b'));_0x492845[_0x7ef2('0x33')]=_[_0x7ef2('0x34')](_0x35f20e[_0x7ef2('0x33')]);_0x492845['filters']=_['intersection'](_0x492845['model'],_0x492845[_0x7ef2('0x33')]);_0x49293e[_0x7ef2('0x35')]=_[_0x7ef2('0x36')](_0x492845[_0x7ef2('0x32')],qs[_0x7ef2('0x37')](_0x35f20e[_0x7ef2('0x33')]['fields']));_0x49293e[_0x7ef2('0x35')]=_0x49293e[_0x7ef2('0x35')][_0x7ef2('0x38')]?_0x49293e[_0x7ef2('0x35')]:_0x492845['model'];if(!_0x35f20e['query'][_0x7ef2('0x39')](_0x7ef2('0x3a'))){_0x49293e[_0x7ef2('0x1d')]=qs[_0x7ef2('0x1d')](_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x1d')]);_0x49293e[_0x7ef2('0x1b')]=qs[_0x7ef2('0x1b')](_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x1b')]);}_0x49293e[_0x7ef2('0x3b')]=qs['sort'](_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x3c')]);_0x49293e[_0x7ef2('0x3d')]=qs[_0x7ef2('0x3e')](_['pick'](_0x35f20e[_0x7ef2('0x33')],_0x492845['filters']),_0x5725fb);if(_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x3f')]){_0x49293e[_0x7ef2('0x3d')]=_[_0x7ef2('0x40')](_0x49293e['where'],{'$or':_['map'](_0x5725fb,function(_0x1eb737){if(_0x1eb737[_0x7ef2('0x31')]!==_0x7ef2('0x41')){var _0x108ee4={};_0x108ee4[_0x1eb737[_0x7ef2('0x2b')]]={'$like':'%'+_0x35f20e['query'][_0x7ef2('0x3f')]+'%'};return _0x108ee4;}})});}_0x49293e=_[_0x7ef2('0x40')]({},_0x49293e,_0x35f20e[_0x7ef2('0x42')]);var _0x32607e={'where':_0x49293e['where']};return db['Disposition']['count'](_0x32607e)[_0x7ef2('0x24')](function(_0x181f58){_0x3f7c25[_0x7ef2('0x1e')]=_0x181f58;if(_0x35f20e[_0x7ef2('0x33')][_0x7ef2('0x43')]){_0x49293e[_0x7ef2('0x44')]=[{'all':!![]}];}return db[_0x7ef2('0x2f')][_0x7ef2('0x45')](_0x49293e);})[_0x7ef2('0x24')](function(_0x517259){_0x3f7c25['rows']=_0x517259;return _0x3f7c25;})[_0x7ef2('0x24')](respondWithFilteredResult(_0x508504,_0x49293e))[_0x7ef2('0x46')](handleError(_0x508504,null));};exports['show']=function(_0x2b8e34,_0x1de60f){var _0x3fdfac={'raw':!![],'where':{'id':_0x2b8e34[_0x7ef2('0x47')]['id']}},_0x11803f={};_0x11803f[_0x7ef2('0x32')]=_['keys'](db[_0x7ef2('0x2f')][_0x7ef2('0x48')]);_0x11803f[_0x7ef2('0x33')]=_['keys'](_0x2b8e34['query']);_0x11803f['filters']=_[_0x7ef2('0x36')](_0x11803f[_0x7ef2('0x32')],_0x11803f[_0x7ef2('0x33')]);_0x3fdfac[_0x7ef2('0x35')]=_[_0x7ef2('0x36')](_0x11803f['model'],qs['fields'](_0x2b8e34[_0x7ef2('0x33')][_0x7ef2('0x37')]));_0x3fdfac[_0x7ef2('0x35')]=_0x3fdfac[_0x7ef2('0x35')][_0x7ef2('0x38')]?_0x3fdfac[_0x7ef2('0x35')]:_0x11803f[_0x7ef2('0x32')];if(_0x2b8e34[_0x7ef2('0x33')][_0x7ef2('0x43')]){_0x3fdfac['include']=[{'all':!![]}];}_0x3fdfac=_[_0x7ef2('0x40')]({},_0x3fdfac,_0x2b8e34['options']);return db[_0x7ef2('0x2f')][_0x7ef2('0x49')](_0x3fdfac)['then'](handleEntityNotFound(_0x1de60f,null))['then'](respondWithResult(_0x1de60f,null))[_0x7ef2('0x46')](handleError(_0x1de60f,null));};exports[_0x7ef2('0x4a')]=function(_0x24dd20,_0x368d93){return db['Disposition'][_0x7ef2('0x4a')](_0x24dd20[_0x7ef2('0x4b')],{})[_0x7ef2('0x24')](function(_0xbba2af){var _0x5e5876=_0x24dd20[_0x7ef2('0x4c')][_0x7ef2('0x25')]({'plain':!![]});if(!_0x5e5876)throw new Error(_0x7ef2('0x4d'));if(_0x5e5876[_0x7ef2('0x4e')]===_0x7ef2('0x4c')){var _0x4bd329=_0xbba2af['get']({'plain':!![]});var _0x9cecfd='Dispositions';return db[_0x7ef2('0x4f')][_0x7ef2('0x49')]({'where':{'name':_0x9cecfd,'userProfileId':_0x5e5876[_0x7ef2('0x50')]},'raw':!![]})[_0x7ef2('0x24')](function(_0x38eb7a){if(_0x38eb7a&&_0x38eb7a['autoAssociation']===0x0){return db[_0x7ef2('0x27')][_0x7ef2('0x4a')]({'name':_0x4bd329[_0x7ef2('0x2b')],'resourceId':_0x4bd329['id'],'type':_0x38eb7a[_0x7ef2('0x2b')],'sectionId':_0x38eb7a['id']},{})['then'](function(){return _0xbba2af;});}else{return _0xbba2af;}})['catch'](function(_0x226a5f){logger[_0x7ef2('0x29')](_0x7ef2('0x51'),_0x226a5f);throw _0x226a5f;});}return _0xbba2af;})['then'](respondWithResult(_0x368d93,0xc9))[_0x7ef2('0x46')](handleError(_0x368d93,null));};exports[_0x7ef2('0x22')]=function(_0x46ca7f,_0x4c4844){if(_0x46ca7f['body']['id']){delete _0x46ca7f['body']['id'];}return db[_0x7ef2('0x2f')][_0x7ef2('0x49')]({'where':{'id':_0x46ca7f['params']['id']}})['then'](handleEntityNotFound(_0x4c4844,null))['then'](saveUpdates(_0x46ca7f[_0x7ef2('0x4b')],null))[_0x7ef2('0x24')](respondWithResult(_0x4c4844,null))[_0x7ef2('0x46')](handleError(_0x4c4844,null));};exports[_0x7ef2('0x23')]=function(_0x1d7878,_0x40bd73){return db['Disposition'][_0x7ef2('0x49')]({'where':{'id':_0x1d7878['params']['id']}})[_0x7ef2('0x24')](handleEntityNotFound(_0x40bd73,null))[_0x7ef2('0x24')](removeEntity(_0x40bd73,null))[_0x7ef2('0x46')](handleError(_0x40bd73,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index c12d5e7..2118e08 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 _0xd667=['tools_dispositions','name_voice','name','ListId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','api','moment','request-promise','rimraf','../../config/environment','./disposition.attributes'];(function(_0x351739,_0x43fd1a){var _0x50b5c8=function(_0x3925b4){while(--_0x3925b4){_0x351739['push'](_0x351739['shift']());}};_0x50b5c8(++_0x43fd1a);}(_0xd667,0x139));var _0x7d66=function(_0x57f474,_0x45e30a){_0x57f474=_0x57f474-0x0;var _0x59be97=_0xd667[_0x57f474];return _0x59be97;};'use strict';var _=require(_0x7d66('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d66('0x1'));var moment=require(_0x7d66('0x2'));var BPromise=require('bluebird');var rp=require(_0x7d66('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d66('0x4'));var config=require(_0x7d66('0x5'));var attributes=require(_0x7d66('0x6'));module['exports']=function(_0x5bde78,_0x548059){return _0x5bde78['define']('Disposition',attributes,{'tableName':_0x7d66('0x7'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x7d66('0x8'),'fields':[_0x7d66('0x9'),_0x7d66('0xa')]},{'unique':!![],'name':'name_chat','fields':[_0x7d66('0x9'),'ChatWebsiteId']},{'unique':!![],'name':_0x7d66('0xb'),'fields':[_0x7d66('0x9'),_0x7d66('0xc')]},{'unique':!![],'name':_0x7d66('0xd'),'fields':[_0x7d66('0x9'),_0x7d66('0xe')]},{'unique':!![],'name':_0x7d66('0xf'),'fields':['name',_0x7d66('0x10')]},{'unique':!![],'name':_0x7d66('0x11'),'fields':[_0x7d66('0x9'),_0x7d66('0x12')]},{'unique':!![],'name':_0x7d66('0x13'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xac26=['name_mail','MailAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','ListId','name','ChatWebsiteId'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xac26,0xee));var _0x6ac2=function(_0x3dba9c,_0x21bc46){_0x3dba9c=_0x3dba9c-0x0;var _0x363cec=_0xac26[_0x3dba9c];return _0x363cec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ac2('0x0'))(_0x6ac2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ac2('0x2'));var fs=require('fs');var path=require(_0x6ac2('0x3'));var rimraf=require(_0x6ac2('0x4'));var config=require(_0x6ac2('0x5'));var attributes=require(_0x6ac2('0x6'));module['exports']=function(_0x4d6ccd,_0xc385ca){return _0x4d6ccd[_0x6ac2('0x7')](_0x6ac2('0x8'),attributes,{'tableName':_0x6ac2('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6ac2('0xa'),'fields':['name',_0x6ac2('0xb')]},{'unique':!![],'name':'name_chat','fields':[_0x6ac2('0xc'),_0x6ac2('0xd')]},{'unique':!![],'name':_0x6ac2('0xe'),'fields':[_0x6ac2('0xc'),_0x6ac2('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0x6ac2('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x6ac2('0x10'),'fields':[_0x6ac2('0xc'),'FaxAccountId']},{'unique':!![],'name':_0x6ac2('0x11'),'fields':[_0x6ac2('0xc'),_0x6ac2('0x12')]},{'unique':!![],'name':_0x6ac2('0x13'),'fields':[_0x6ac2('0xc'),_0x6ac2('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 016ed00..3e2099c 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(_0x1bcd69,_0x5e13b6){var _0x2adb06=function(_0x3c2ae3){while(--_0x3c2ae3){_0x1bcd69['push'](_0x1bcd69['shift']());}};_0x2adb06(++_0x5e13b6);}(_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 +var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4a9124,_0x47cdaf){var _0x1635fa=function(_0x20a1a7){while(--_0x20a1a7){_0x4a9124['push'](_0x4a9124['shift']());}};_0x1635fa(++_0x47cdaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index e45ae3d..7321056 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 _0x998d=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create'];(function(_0x35fc20,_0xb434a){var _0x263507=function(_0x920963){while(--_0x920963){_0x35fc20['push'](_0x35fc20['shift']());}};_0x263507(++_0xb434a);}(_0x998d,0x148));var _0xd998=function(_0x10a2fb,_0x3e096d){_0x10a2fb=_0x10a2fb-0x0;var _0x2a5b50=_0x998d[_0x10a2fb];return _0x2a5b50;};'use strict';var multer=require(_0xd998('0x0'));var util=require(_0xd998('0x1'));var path=require(_0xd998('0x2'));var timeout=require(_0xd998('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd998('0x4'));var auth=require(_0xd998('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd998('0x6'));var controller=require(_0xd998('0x7'));router[_0xd998('0x8')]('/',auth[_0xd998('0x9')](),controller[_0xd998('0xa')]);router[_0xd998('0x8')]('/:id',auth[_0xd998('0x9')](),controller[_0xd998('0xb')]);router[_0xd998('0xc')]('/',auth['isAuthenticated'](),controller[_0xd998('0xd')]);router['put']('/:id',auth[_0xd998('0x9')](),controller[_0xd998('0xe')]);router[_0xd998('0xf')](_0xd998('0x10'),auth[_0xd998('0x9')](),controller[_0xd998('0x11')]);module[_0xd998('0x12')]=router; \ No newline at end of file +var _0xf1cd=['./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x57aac5,_0xc483dc){var _0x5c5f48=function(_0x267f9f){while(--_0x267f9f){_0x57aac5['push'](_0x57aac5['shift']());}};_0x5c5f48(++_0xc483dc);}(_0xf1cd,0x13e));var _0xdf1c=function(_0x33f5b8,_0x597611){_0x33f5b8=_0x33f5b8-0x0;var _0x3f9f5d=_0xf1cd[_0x33f5b8];return _0x3f9f5d;};'use strict';var multer=require('multer');var util=require(_0xdf1c('0x0'));var path=require('path');var timeout=require(_0xdf1c('0x1'));var express=require(_0xdf1c('0x2'));var router=express[_0xdf1c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf1c('0x4'));var interaction=require(_0xdf1c('0x5'));var config=require('../../config/environment');var controller=require(_0xdf1c('0x6'));router[_0xdf1c('0x7')]('/',auth[_0xdf1c('0x8')](),controller[_0xdf1c('0x9')]);router[_0xdf1c('0x7')](_0xdf1c('0xa'),auth['isAuthenticated'](),controller[_0xdf1c('0xb')]);router[_0xdf1c('0xc')]('/',auth[_0xdf1c('0x8')](),controller[_0xdf1c('0xd')]);router['put']('/:id',auth[_0xdf1c('0x8')](),controller[_0xdf1c('0xe')]);router[_0xdf1c('0xf')](_0xdf1c('0xa'),auth[_0xdf1c('0x8')](),controller[_0xdf1c('0x10')]);module[_0xdf1c('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 972865d..b5bb2e0 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 _0x4c60=['4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','localstationid','ENUM','2400'];(function(_0x9b9a89,_0x148994){var _0x22572f=function(_0x37e849){while(--_0x37e849){_0x9b9a89['push'](_0x9b9a89['shift']());}};_0x22572f(++_0x148994);}(_0x4c60,0xc1));var _0x04c6=function(_0x13e0e5,_0x139120){_0x13e0e5=_0x13e0e5-0x0;var _0x1e4ec1=_0x4c60[_0x13e0e5];return _0x1e4ec1;};'use strict';var Sequelize=require(_0x04c6('0x0'));module[_0x04c6('0x1')]={'name':{'type':Sequelize[_0x04c6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x04c6('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x04c6('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x04c6('0x4')},'minrate':{'type':Sequelize[_0x04c6('0x5')](_0x04c6('0x6'),_0x04c6('0x7'),_0x04c6('0x8'),_0x04c6('0x9'),_0x04c6('0xa'),'14400'),'defaultValue':_0x04c6('0x7')},'maxrate':{'type':Sequelize[_0x04c6('0x5')](_0x04c6('0x6'),_0x04c6('0x7'),'7200','9600','12000',_0x04c6('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x04c6('0x2')],'defaultValue':_0x04c6('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x04c6('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x04c6('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x04c6('0x5')](_0x04c6('0xe'),'IAX',_0x04c6('0xf'),_0x04c6('0x10')),'defaultValue':_0x04c6('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x04c6('0x11')],'defaultValue':function(){return _0x04c6('0x12');}},'notificationSound':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x04c6('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x04c6('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x04c6('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x04c6('0x13')],'defaultValue':![],'comment':_0x04c6('0x15'),'set':function(_0xfb4db5){if(!_0xfb4db5)this[_0x04c6('0x16')](_0x04c6('0x17'),null);this['setDataValue'](_0x04c6('0x18'),_0xfb4db5);}}}; \ No newline at end of file +var _0x25fa=['setDataValue','sequelize','STRING','yes','localstationid','2400','4800','7200','9600','12000','14400','ENUM','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x264a62,_0x25f772){var _0x101811=function(_0x1a3031){while(--_0x1a3031){_0x264a62['push'](_0x264a62['shift']());}};_0x101811(++_0x25f772);}(_0x25fa,0x109));var _0xa25f=function(_0x426ef0,_0x56c5a1){_0x426ef0=_0x426ef0-0x0;var _0x2f2bfd=_0x25fa[_0x426ef0];return _0x2f2bfd;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa25f('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xa25f('0x2'),'no'),'defaultValue':_0xa25f('0x2')},'headerinfo':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xa25f('0x3')},'minrate':{'type':Sequelize['ENUM'](_0xa25f('0x4'),_0xa25f('0x5'),_0xa25f('0x6'),_0xa25f('0x7'),_0xa25f('0x8'),_0xa25f('0x9')),'defaultValue':_0xa25f('0x5')},'maxrate':{'type':Sequelize[_0xa25f('0xa')](_0xa25f('0x4'),'4800',_0xa25f('0x6'),_0xa25f('0x7'),'12000',_0xa25f('0x9')),'defaultValue':_0xa25f('0x9')},'modem':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':_0xa25f('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa25f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xa25f('0xd'),_0xa25f('0xe'),'DADHI',_0xa25f('0xf')),'defaultValue':_0xa25f('0xd')},'key':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa25f('0x10')],'defaultValue':function(){return _0xa25f('0x11');}},'notificationSound':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa25f('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xa25f('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![],'comment':_0xa25f('0x14'),'set':function(_0x18705c){if(!_0x18705c)this[_0xa25f('0x15')]('mandatoryDispositionPauseId',null);this[_0xa25f('0x15')]('mandatoryDisposition',_0x18705c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 36e9b87..08a80b5 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 _0xcc53=['Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','minrate','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','key','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','format','fax','List\x20not\x20found','user','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','FaxAccounts','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','findAll','rows','show','params','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','FaxAccountId','Disposition','findOne','length','filter','ids','addAnswer','CannedAnswer','getAnswers','include','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','description'];(function(_0x146dc8,_0x481f69){var _0x48f74a=function(_0x2cee47){while(--_0x2cee47){_0x146dc8['push'](_0x146dc8['shift']());}};_0x48f74a(++_0x481f69);}(_0xcc53,0x102));var _0x3cc5=function(_0x245700,_0x902ce9){_0x245700=_0x245700-0x0;var _0x5f871f=_0xcc53[_0x245700];return _0x5f871f;};'use strict';var emlformat=require(_0x3cc5('0x0'));var rimraf=require(_0x3cc5('0x1'));var zipdir=require(_0x3cc5('0x2'));var jsonpatch=require(_0x3cc5('0x3'));var rp=require(_0x3cc5('0x4'));var moment=require(_0x3cc5('0x5'));var BPromise=require(_0x3cc5('0x6'));var Mustache=require(_0x3cc5('0x7'));var util=require(_0x3cc5('0x8'));var path=require(_0x3cc5('0x9'));var sox=require(_0x3cc5('0xa'));var csv=require('to-csv');var ejs=require(_0x3cc5('0xb'));var fs=require('fs');var fs_extra=require(_0x3cc5('0xc'));var _=require(_0x3cc5('0xd'));var squel=require('squel');var crypto=require(_0x3cc5('0xe'));var jsforce=require(_0x3cc5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3cc5('0x10'));var querystring=require(_0x3cc5('0x11'));var Papa=require(_0x3cc5('0x12'));var Redis=require(_0x3cc5('0x13'));var authService=require(_0x3cc5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3cc5('0x15'));var hardwareService=require(_0x3cc5('0x16'));var logger=require(_0x3cc5('0x17'))('api');var utils=require(_0x3cc5('0x18'));var config=require(_0x3cc5('0x19'));var licenseUtil=require(_0x3cc5('0x1a'));var db=require(_0x3cc5('0x1b'))['db'];config[_0x3cc5('0x1c')]=_['defaults'](config[_0x3cc5('0x1c')],{'host':_0x3cc5('0x1d'),'port':0x18eb});var socket=require(_0x3cc5('0x1e'))(new Redis(config[_0x3cc5('0x1c')]));require('./faxAccount.socket')[_0x3cc5('0x1f')](socket);var jayson=require(_0x3cc5('0x20'));var client=jayson[_0x3cc5('0x21')][_0x3cc5('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x3cc5('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x33a041,_0x2fa5bc,_0x45609b,_0x1472e0){return new BPromise(function(_0x2f1b6a,_0x8d589d){var _0x2f8981=_0x1472e0||client;return _0x2f8981[_0x3cc5('0x23')](_0x33a041,_0x45609b)['then'](function(_0x15e6d8){logger[_0x3cc5('0x24')](_0x3cc5('0x25'),_0x2fa5bc,_0x3cc5('0x26'));logger[_0x3cc5('0x27')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2fa5bc,'request\x20sent',JSON[_0x3cc5('0x28')](_0x15e6d8));if(_0x15e6d8['error']){if(_0x15e6d8[_0x3cc5('0x29')][_0x3cc5('0x2a')]===0x1f4){logger[_0x3cc5('0x29')](_0x3cc5('0x25'),_0x2fa5bc,_0x15e6d8[_0x3cc5('0x29')]['message']);return _0x8d589d(_0x15e6d8[_0x3cc5('0x29')][_0x3cc5('0x2b')]);}logger[_0x3cc5('0x29')]('FaxAccount,\x20%s,\x20%s',_0x2fa5bc,_0x15e6d8[_0x3cc5('0x29')][_0x3cc5('0x2b')]);return _0x2f1b6a(_0x15e6d8[_0x3cc5('0x29')]['message']);}else{logger['info'](_0x3cc5('0x25'),_0x2fa5bc,_0x3cc5('0x26'));_0x2f1b6a(_0x15e6d8[_0x3cc5('0x2c')][_0x3cc5('0x2b')]);}})[_0x3cc5('0x2d')](function(_0x2b7054){logger['error'](_0x3cc5('0x25'),_0x2fa5bc,_0x2b7054);_0x8d589d(_0x2b7054);});});}function respondWithStatusCode(_0x40e476,_0x5d83fd){_0x5d83fd=_0x5d83fd||0xcc;return function(_0x2d76bd){if(_0x2d76bd){return _0x40e476['sendStatus'](_0x5d83fd);}return _0x40e476[_0x3cc5('0x2e')](_0x5d83fd)['end']();};}function respondWithResult(_0xac6b0c,_0x3774b6){_0x3774b6=_0x3774b6||0xc8;return function(_0x424007){if(_0x424007){return _0xac6b0c['status'](_0x3774b6)[_0x3cc5('0x2f')](_0x424007);}};}function respondWithFilteredResult(_0x3e95d9,_0x1ad0e3){return function(_0x547373){if(_0x547373){var _0x50eae1=typeof _0x1ad0e3['offset']===_0x3cc5('0x30')&&typeof _0x1ad0e3[_0x3cc5('0x31')]==='undefined';var _0xde04cd=_0x547373[_0x3cc5('0x32')];var _0x3117d6=_0x50eae1?0x0:_0x1ad0e3[_0x3cc5('0x33')];var _0x28f9cd=_0x50eae1?_0x547373[_0x3cc5('0x32')]:_0x1ad0e3['offset']+_0x1ad0e3[_0x3cc5('0x31')];var _0x201996;if(_0x28f9cd>=_0xde04cd){_0x28f9cd=_0xde04cd;_0x201996=0xc8;}else{_0x201996=0xce;}_0x3e95d9[_0x3cc5('0x2e')](_0x201996);return _0x3e95d9[_0x3cc5('0x34')](_0x3cc5('0x35'),_0x3117d6+'-'+_0x28f9cd+'/'+_0xde04cd)[_0x3cc5('0x2f')](_0x547373);}return null;};}function patchUpdates(_0x549036){return function(_0x225dd3){try{jsonpatch[_0x3cc5('0x36')](_0x225dd3,_0x549036,!![]);}catch(_0x15be0f){return BPromise[_0x3cc5('0x37')](_0x15be0f);}return _0x225dd3[_0x3cc5('0x38')]();};}function saveUpdates(_0x3f22a4,_0x48b42f){return function(_0x54679c){if(_0x54679c){return _0x54679c[_0x3cc5('0x39')](_0x3f22a4)[_0x3cc5('0x3a')](function(_0x12e70c){return _0x12e70c;});}return null;};}function removeEntity(_0x35e496,_0x3ba961){return function(_0x2dfc0f){if(_0x2dfc0f){return _0x2dfc0f['destroy']()['then'](function(){var _0x5b2e7a=_0x2dfc0f[_0x3cc5('0x3b')]({'plain':!![]});var _0xa3f6ec=_0x3cc5('0x3c');return db['UserProfileResource']['destroy']({'where':{'type':_0xa3f6ec,'resourceId':_0x5b2e7a['id']}})[_0x3cc5('0x3a')](function(){return _0x2dfc0f;});})[_0x3cc5('0x3a')](function(){_0x35e496['status'](0xcc)[_0x3cc5('0x3d')]();});}};}function handleEntityNotFound(_0x2f81cc,_0x232cc1){return function(_0x4e563c){if(!_0x4e563c){_0x2f81cc[_0x3cc5('0x3e')](0x194);}return _0x4e563c;};}function handleError(_0x790c41,_0x4380a5){_0x4380a5=_0x4380a5||0x1f4;return function(_0x41fb47){logger['error'](_0x41fb47[_0x3cc5('0x3f')]);if(_0x41fb47[_0x3cc5('0x40')]){delete _0x41fb47[_0x3cc5('0x40')];}_0x790c41[_0x3cc5('0x2e')](_0x4380a5)[_0x3cc5('0x41')](_0x41fb47);};}exports[_0x3cc5('0x42')]=function(_0x9688ea,_0x197978){var _0x3626da={'include':[{'model':db[_0x3cc5('0x43')],'as':_0x3cc5('0x44')}]},_0x3b4c38={},_0x2c5e58={'count':0x0,'rows':[]};var _0x4812e2=_[_0x3cc5('0x45')](db[_0x3cc5('0x46')][_0x3cc5('0x47')],function(_0x61bbc2){return{'name':_0x61bbc2[_0x3cc5('0x48')],'type':_0x61bbc2[_0x3cc5('0x49')]['key']};});_0x3b4c38[_0x3cc5('0x4a')]=_[_0x3cc5('0x45')](_0x4812e2,_0x3cc5('0x40'));_0x3b4c38['query']=_[_0x3cc5('0x4b')](_0x9688ea['query']);_0x3b4c38[_0x3cc5('0x4c')]=_[_0x3cc5('0x4d')](_0x3b4c38['model'],_0x3b4c38[_0x3cc5('0x4e')]);_0x3626da[_0x3cc5('0x4f')]=_[_0x3cc5('0x4d')](_0x3b4c38[_0x3cc5('0x4a')],qs[_0x3cc5('0x50')](_0x9688ea[_0x3cc5('0x4e')][_0x3cc5('0x50')]));_0x3626da[_0x3cc5('0x4f')]=_0x3626da[_0x3cc5('0x4f')]['length']?_0x3626da[_0x3cc5('0x4f')]:_0x3b4c38[_0x3cc5('0x4a')];if(!_0x9688ea[_0x3cc5('0x4e')][_0x3cc5('0x51')](_0x3cc5('0x52'))){_0x3626da['limit']=qs[_0x3cc5('0x31')](_0x9688ea[_0x3cc5('0x4e')][_0x3cc5('0x31')]);_0x3626da[_0x3cc5('0x33')]=qs[_0x3cc5('0x33')](_0x9688ea[_0x3cc5('0x4e')]['offset']);}_0x3626da[_0x3cc5('0x53')]=qs[_0x3cc5('0x54')](_0x9688ea[_0x3cc5('0x4e')][_0x3cc5('0x54')]);_0x3626da[_0x3cc5('0x55')]=qs[_0x3cc5('0x4c')](_[_0x3cc5('0x56')](_0x9688ea[_0x3cc5('0x4e')],_0x3b4c38[_0x3cc5('0x4c')]),_0x4812e2);if(_0x9688ea[_0x3cc5('0x4e')]['filter']){_0x3626da['where']=_['merge'](_0x3626da['where'],{'$or':_[_0x3cc5('0x45')](_0x4812e2,function(_0x3110d4){if(_0x3110d4[_0x3cc5('0x49')]!=='VIRTUAL'){var _0x2d1177={};_0x2d1177[_0x3110d4[_0x3cc5('0x40')]]={'$like':'%'+_0x9688ea[_0x3cc5('0x4e')]['filter']+'%'};return _0x2d1177;}})});}_0x3626da=_[_0x3cc5('0x57')]({},_0x3626da,_0x9688ea['options']);var _0x391b53={'where':_0x3626da[_0x3cc5('0x55')]};return db['FaxAccount'][_0x3cc5('0x32')](_0x391b53)[_0x3cc5('0x3a')](function(_0x453311){_0x2c5e58[_0x3cc5('0x32')]=_0x453311;if(_0x9688ea[_0x3cc5('0x4e')][_0x3cc5('0x58')]){_0x3626da['include']=[{'all':!![]}];}return db[_0x3cc5('0x46')][_0x3cc5('0x59')](_0x3626da);})[_0x3cc5('0x3a')](function(_0x21073d){_0x2c5e58[_0x3cc5('0x5a')]=_0x21073d;return _0x2c5e58;})['then'](respondWithFilteredResult(_0x197978,_0x3626da))[_0x3cc5('0x2d')](handleError(_0x197978,null));};exports[_0x3cc5('0x5b')]=function(_0x51d61a,_0x2f20f6){var _0x3e9f11={'raw':![],'where':{'id':_0x51d61a[_0x3cc5('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x154de3={};_0x154de3[_0x3cc5('0x4a')]=_[_0x3cc5('0x4b')](db[_0x3cc5('0x46')][_0x3cc5('0x47')]);_0x154de3['query']=_[_0x3cc5('0x4b')](_0x51d61a[_0x3cc5('0x4e')]);_0x154de3[_0x3cc5('0x4c')]=_[_0x3cc5('0x4d')](_0x154de3['model'],_0x154de3[_0x3cc5('0x4e')]);_0x3e9f11[_0x3cc5('0x4f')]=_[_0x3cc5('0x4d')](_0x154de3[_0x3cc5('0x4a')],qs[_0x3cc5('0x50')](_0x51d61a[_0x3cc5('0x4e')][_0x3cc5('0x50')]));_0x3e9f11['attributes']=_0x3e9f11[_0x3cc5('0x4f')]['length']?_0x3e9f11[_0x3cc5('0x4f')]:_0x154de3[_0x3cc5('0x4a')];if(_0x51d61a[_0x3cc5('0x4e')][_0x3cc5('0x58')]){_0x3e9f11['include']=[{'all':!![]}];}_0x3e9f11=_[_0x3cc5('0x57')]({},_0x3e9f11,_0x51d61a[_0x3cc5('0x5d')]);return db[_0x3cc5('0x46')]['find'](_0x3e9f11)[_0x3cc5('0x3a')](handleEntityNotFound(_0x2f20f6,null))[_0x3cc5('0x3a')](respondWithResult(_0x2f20f6,null))[_0x3cc5('0x2d')](handleError(_0x2f20f6,null));};exports['create']=function(_0x5ee538,_0x585808){return db['FaxAccount'][_0x3cc5('0x5e')](_0x5ee538[_0x3cc5('0x5f')],{})[_0x3cc5('0x3a')](function(_0x51e80a){var _0x47f8a7=_0x5ee538['user'][_0x3cc5('0x3b')]({'plain':!![]});if(!_0x47f8a7)throw new Error(_0x3cc5('0x60'));if(_0x47f8a7[_0x3cc5('0x61')]==='user'){var _0x134dfb=_0x51e80a['get']({'plain':!![]});var _0x57653e='FaxAccounts';return db['UserProfileSection'][_0x3cc5('0x62')]({'where':{'name':_0x57653e,'userProfileId':_0x47f8a7['userProfileId']},'raw':!![]})['then'](function(_0x247466){if(_0x247466&&_0x247466[_0x3cc5('0x63')]===0x0){return db[_0x3cc5('0x64')]['create']({'name':_0x134dfb['name'],'resourceId':_0x134dfb['id'],'type':_0x247466[_0x3cc5('0x40')],'sectionId':_0x247466['id']},{})[_0x3cc5('0x3a')](function(){return _0x51e80a;});}else{return _0x51e80a;}})[_0x3cc5('0x2d')](function(_0x5c2abe){logger['error'](_0x3cc5('0x65'),_0x5c2abe);throw _0x5c2abe;});}return _0x51e80a;})['then'](respondWithResult(_0x585808,0xc9))[_0x3cc5('0x2d')](handleError(_0x585808,null));};exports[_0x3cc5('0x39')]=function(_0x57988b,_0x525a67){if(_0x57988b[_0x3cc5('0x5f')]['id']){delete _0x57988b[_0x3cc5('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x57988b[_0x3cc5('0x5c')]['id']},'include':[{'model':db[_0x3cc5('0x43')],'as':_0x3cc5('0x44')}]})[_0x3cc5('0x3a')](handleEntityNotFound(_0x525a67,null))[_0x3cc5('0x3a')](saveUpdates(_0x57988b['body'],null))[_0x3cc5('0x3a')](respondWithResult(_0x525a67,null))['catch'](handleError(_0x525a67,null));};exports[_0x3cc5('0x66')]=function(_0x1e3b8f,_0x2690bb){return db[_0x3cc5('0x46')][_0x3cc5('0x62')]({'where':{'id':_0x1e3b8f[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x2690bb,null))['then'](removeEntity(_0x2690bb,null))['catch'](handleError(_0x2690bb,null));};exports[_0x3cc5('0x67')]=function(_0x9b8df0,_0x18d96d){return db[_0x3cc5('0x46')][_0x3cc5('0x67')]()[_0x3cc5('0x3a')](respondWithResult(_0x18d96d,null))[_0x3cc5('0x2d')](handleError(_0x18d96d,null));};exports[_0x3cc5('0x68')]=function(_0x394698,_0x5eb01b,_0x38679b){if(_0x394698[_0x3cc5('0x5f')]['id']){delete _0x394698[_0x3cc5('0x5f')]['id'];}return db['FaxAccount'][_0x3cc5('0x62')]({'where':{'id':_0x394698['params']['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x5eb01b,null))[_0x3cc5('0x3a')](function(_0xe15a8b){if(_0xe15a8b){_0x394698[_0x3cc5('0x5f')][_0x3cc5('0x69')]=_0xe15a8b['id'];return db[_0x3cc5('0x6a')][_0x3cc5('0x5e')](_0x394698[_0x3cc5('0x5f')]);}})[_0x3cc5('0x3a')](respondWithResult(_0x5eb01b,null))[_0x3cc5('0x2d')](handleError(_0x5eb01b,null));};exports['getDispositions']=function(_0x1d2e46,_0x5c82a6,_0x5a06a2){var _0x33e637={'raw':![],'where':{}};var _0x4bdee7={};var _0x4396f3={'count':0x0,'rows':[]};return db[_0x3cc5('0x46')][_0x3cc5('0x6b')]({'where':{'id':_0x1d2e46[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x5c82a6,null))[_0x3cc5('0x3a')](function(_0x3499b1){if(_0x3499b1){_0x4bdee7[_0x3cc5('0x4a')]=_[_0x3cc5('0x4b')](db[_0x3cc5('0x6a')][_0x3cc5('0x47')]);_0x4bdee7[_0x3cc5('0x4e')]=_['keys'](_0x1d2e46[_0x3cc5('0x4e')]);_0x4bdee7[_0x3cc5('0x4c')]=_['intersection'](_0x4bdee7['model'],_0x4bdee7['query']);_0x33e637[_0x3cc5('0x4f')]=_['intersection'](_0x4bdee7[_0x3cc5('0x4a')],qs[_0x3cc5('0x50')](_0x1d2e46[_0x3cc5('0x4e')][_0x3cc5('0x50')]));_0x33e637[_0x3cc5('0x4f')]=_0x33e637[_0x3cc5('0x4f')][_0x3cc5('0x6c')]?_0x33e637[_0x3cc5('0x4f')]:_0x4bdee7[_0x3cc5('0x4a')];if(!_0x1d2e46['query'][_0x3cc5('0x51')]('nolimit')){_0x33e637[_0x3cc5('0x31')]=qs[_0x3cc5('0x31')](_0x1d2e46[_0x3cc5('0x4e')]['limit']);_0x33e637[_0x3cc5('0x33')]=qs[_0x3cc5('0x33')](_0x1d2e46[_0x3cc5('0x4e')]['offset']);}_0x33e637[_0x3cc5('0x53')]=qs[_0x3cc5('0x54')](_0x1d2e46[_0x3cc5('0x4e')][_0x3cc5('0x54')]);_0x33e637[_0x3cc5('0x55')]=qs[_0x3cc5('0x4c')](_['pick'](_0x1d2e46[_0x3cc5('0x4e')],_0x4bdee7[_0x3cc5('0x4c')]));_0x33e637[_0x3cc5('0x55')][_0x3cc5('0x69')]=_0x3499b1['id'];if(_0x1d2e46[_0x3cc5('0x4e')][_0x3cc5('0x6d')]){_0x33e637[_0x3cc5('0x55')]=_[_0x3cc5('0x57')](_0x33e637[_0x3cc5('0x55')],{'$or':_[_0x3cc5('0x45')](_0x33e637[_0x3cc5('0x4f')],function(_0xdf38c1){var _0x1ffaaa={};_0x1ffaaa[_0xdf38c1]={'$like':'%'+_0x1d2e46[_0x3cc5('0x4e')][_0x3cc5('0x6d')]+'%'};return _0x1ffaaa;})});}_0x33e637=_[_0x3cc5('0x57')]({},_0x33e637,_0x1d2e46[_0x3cc5('0x5d')]);return db[_0x3cc5('0x6a')][_0x3cc5('0x32')]({'where':_0x33e637['where']})[_0x3cc5('0x3a')](function(_0x2f83f1){_0x4396f3[_0x3cc5('0x32')]=_0x2f83f1;if(_0x1d2e46['query']['includeAll']){_0x33e637['include']=[{'all':!![]}];}return db[_0x3cc5('0x6a')][_0x3cc5('0x59')](_0x33e637);})[_0x3cc5('0x3a')](function(_0x8598aa){_0x4396f3[_0x3cc5('0x5a')]=_0x8598aa;return _0x4396f3;});}})[_0x3cc5('0x3a')](respondWithFilteredResult(_0x5c82a6,_0x33e637))[_0x3cc5('0x2d')](handleError(_0x5c82a6,null));};exports['removeDispositions']=function(_0x537c25,_0x50ddaa,_0x92e1ed){return db[_0x3cc5('0x46')][_0x3cc5('0x62')]({'where':{'id':_0x537c25['params']['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x50ddaa,null))['then'](function(_0xdfad1c){if(_0xdfad1c){return _0xdfad1c['removeDispositions'](_0x537c25[_0x3cc5('0x4e')][_0x3cc5('0x6e')]);}})[_0x3cc5('0x3a')](respondWithStatusCode(_0x50ddaa,null))[_0x3cc5('0x2d')](handleError(_0x50ddaa,null));};exports[_0x3cc5('0x6f')]=function(_0xd805f,_0x528896,_0x493a35){if(_0xd805f['body']['id']){delete _0xd805f[_0x3cc5('0x5f')]['id'];}return db[_0x3cc5('0x46')][_0x3cc5('0x62')]({'where':{'id':_0xd805f[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x528896,null))[_0x3cc5('0x3a')](function(_0x28dac3){if(_0x28dac3){_0xd805f['body'][_0x3cc5('0x69')]=_0x28dac3['id'];return db[_0x3cc5('0x70')][_0x3cc5('0x5e')](_0xd805f['body']);}})[_0x3cc5('0x3a')](respondWithResult(_0x528896,null))['catch'](handleError(_0x528896,null));};exports[_0x3cc5('0x71')]=function(_0xd5e678,_0x52c5f2,_0x24cff7){var _0x50eddc={'raw':![],'where':{}};var _0x1b6fcb={};var _0x2645bb={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3cc5('0x6b')]({'where':{'id':_0xd5e678[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x52c5f2,null))['then'](function(_0x396df6){if(_0x396df6){_0x1b6fcb[_0x3cc5('0x4a')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1b6fcb[_0x3cc5('0x4e')]=_[_0x3cc5('0x4b')](_0xd5e678[_0x3cc5('0x4e')]);_0x1b6fcb[_0x3cc5('0x4c')]=_[_0x3cc5('0x4d')](_0x1b6fcb[_0x3cc5('0x4a')],_0x1b6fcb[_0x3cc5('0x4e')]);_0x50eddc[_0x3cc5('0x4f')]=_[_0x3cc5('0x4d')](_0x1b6fcb[_0x3cc5('0x4a')],qs[_0x3cc5('0x50')](_0xd5e678[_0x3cc5('0x4e')]['fields']));_0x50eddc[_0x3cc5('0x4f')]=_0x50eddc[_0x3cc5('0x4f')][_0x3cc5('0x6c')]?_0x50eddc[_0x3cc5('0x4f')]:_0x1b6fcb['model'];if(!_0xd5e678[_0x3cc5('0x4e')]['hasOwnProperty'](_0x3cc5('0x52'))){_0x50eddc[_0x3cc5('0x31')]=qs[_0x3cc5('0x31')](_0xd5e678[_0x3cc5('0x4e')][_0x3cc5('0x31')]);_0x50eddc[_0x3cc5('0x33')]=qs['offset'](_0xd5e678['query'][_0x3cc5('0x33')]);}_0x50eddc[_0x3cc5('0x53')]=qs[_0x3cc5('0x54')](_0xd5e678[_0x3cc5('0x4e')][_0x3cc5('0x54')]);_0x50eddc['where']=qs[_0x3cc5('0x4c')](_['pick'](_0xd5e678[_0x3cc5('0x4e')],_0x1b6fcb[_0x3cc5('0x4c')]));_0x50eddc[_0x3cc5('0x55')]['FaxAccountId']=_0x396df6['id'];if(_0xd5e678[_0x3cc5('0x4e')][_0x3cc5('0x6d')]){_0x50eddc[_0x3cc5('0x55')]=_[_0x3cc5('0x57')](_0x50eddc[_0x3cc5('0x55')],{'$or':_[_0x3cc5('0x45')](_0x50eddc[_0x3cc5('0x4f')],function(_0x59d055){var _0x55fa40={};_0x55fa40[_0x59d055]={'$like':'%'+_0xd5e678[_0x3cc5('0x4e')][_0x3cc5('0x6d')]+'%'};return _0x55fa40;})});}_0x50eddc=_[_0x3cc5('0x57')]({},_0x50eddc,_0xd5e678[_0x3cc5('0x5d')]);return db[_0x3cc5('0x70')][_0x3cc5('0x32')]({'where':_0x50eddc['where']})['then'](function(_0x1e49a5){_0x2645bb[_0x3cc5('0x32')]=_0x1e49a5;if(_0xd5e678[_0x3cc5('0x4e')][_0x3cc5('0x58')]){_0x50eddc[_0x3cc5('0x72')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x50eddc);})['then'](function(_0x48994b){_0x2645bb['rows']=_0x48994b;return _0x2645bb;});}})['then'](respondWithFilteredResult(_0x52c5f2,_0x50eddc))[_0x3cc5('0x2d')](handleError(_0x52c5f2,null));};exports[_0x3cc5('0x73')]=function(_0x33f30b,_0x5c1272,_0x5b63db){return db[_0x3cc5('0x46')][_0x3cc5('0x62')]({'where':{'id':_0x33f30b[_0x3cc5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5c1272,null))[_0x3cc5('0x3a')](function(_0x10c910){if(_0x10c910){return _0x10c910[_0x3cc5('0x73')](_0x33f30b[_0x3cc5('0x4e')][_0x3cc5('0x6e')]);}})['then'](respondWithStatusCode(_0x5c1272,null))['catch'](handleError(_0x5c1272,null));};exports['addInteraction']=function(_0xf9a322,_0x381ad6,_0xea817c){return db[_0x3cc5('0x74')][_0x3cc5('0x62')]({'where':{'id':_0xf9a322[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x381ad6,null))[_0x3cc5('0x3a')](function(_0x3684af){if(_0x3684af){return _0x3684af[_0x3cc5('0x75')](_0xf9a322[_0x3cc5('0x5f')][_0x3cc5('0x6e')],_[_0x3cc5('0x76')](_0xf9a322['body'],[_0x3cc5('0x6e'),'id'])||{});}})[_0x3cc5('0x3a')](respondWithResult(_0x381ad6,null))[_0x3cc5('0x2d')](handleError(_0x381ad6,null));};exports[_0x3cc5('0x77')]=function(_0x16c12e,_0x397b00,_0x1bd1b3){var _0x91978b={'raw':![],'where':{}};var _0x340f5f={};var _0x4f075d={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3cc5('0x6b')]({'where':{'id':_0x16c12e[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x397b00,null))[_0x3cc5('0x3a')](function(_0x456df2){if(_0x456df2){_0x340f5f[_0x3cc5('0x4a')]=_[_0x3cc5('0x4b')](db['FaxInteraction'][_0x3cc5('0x47')]);_0x340f5f[_0x3cc5('0x4e')]=_[_0x3cc5('0x4b')](_0x16c12e['query']);_0x340f5f[_0x3cc5('0x4c')]=_['intersection'](_0x340f5f[_0x3cc5('0x4a')],_0x340f5f[_0x3cc5('0x4e')]);_0x91978b[_0x3cc5('0x4f')]=_[_0x3cc5('0x4d')](_0x340f5f[_0x3cc5('0x4a')],qs[_0x3cc5('0x50')](_0x16c12e[_0x3cc5('0x4e')][_0x3cc5('0x50')]));_0x91978b[_0x3cc5('0x4f')]=_0x91978b[_0x3cc5('0x4f')][_0x3cc5('0x6c')]?_0x91978b[_0x3cc5('0x4f')]:_0x340f5f['model'];if(!_0x16c12e[_0x3cc5('0x4e')]['hasOwnProperty'](_0x3cc5('0x52'))){_0x91978b[_0x3cc5('0x31')]=qs[_0x3cc5('0x31')](_0x16c12e['query']['limit']);_0x91978b[_0x3cc5('0x33')]=qs[_0x3cc5('0x33')](_0x16c12e[_0x3cc5('0x4e')][_0x3cc5('0x33')]);}_0x91978b[_0x3cc5('0x53')]=qs[_0x3cc5('0x54')](_0x16c12e[_0x3cc5('0x4e')]['sort']);_0x91978b[_0x3cc5('0x55')]=qs['filters'](_[_0x3cc5('0x56')](_0x16c12e[_0x3cc5('0x4e')],_0x340f5f[_0x3cc5('0x4c')]));_0x91978b[_0x3cc5('0x55')][_0x3cc5('0x69')]=_0x456df2['id'];if(_0x16c12e[_0x3cc5('0x4e')][_0x3cc5('0x6d')]){_0x91978b[_0x3cc5('0x55')]=_[_0x3cc5('0x57')](_0x91978b[_0x3cc5('0x55')],{'$or':_[_0x3cc5('0x45')](_0x91978b[_0x3cc5('0x4f')],function(_0x4e9915){var _0xe2a434={};_0xe2a434[_0x4e9915]={'$like':'%'+_0x16c12e[_0x3cc5('0x4e')][_0x3cc5('0x6d')]+'%'};return _0xe2a434;})});}_0x91978b=_['merge']({},_0x91978b,_0x16c12e[_0x3cc5('0x5d')]);return db[_0x3cc5('0x74')][_0x3cc5('0x32')]({'where':_0x91978b['where']})['then'](function(_0x4bb39c){_0x4f075d['count']=_0x4bb39c;if(_0x16c12e[_0x3cc5('0x4e')]['includeAll']){_0x91978b['include']=[{'model':db[_0x3cc5('0x78')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x3cc5('0x79'),'attributes':[_0x3cc5('0x40'),_0x3cc5('0x7a'),_0x3cc5('0x7b')],'required':![]},{'model':db[_0x3cc5('0x7c')],'as':_0x3cc5('0x7d'),'attributes':['id',_0x3cc5('0x40'),_0x3cc5('0x7e')],'where':_0x16c12e[_0x3cc5('0x4e')][_0x3cc5('0x7f')]?{'id':_0x16c12e['query'][_0x3cc5('0x7f')]}:undefined,'required':_0x16c12e[_0x3cc5('0x4e')][_0x3cc5('0x7f')]?!![]:![]}];}return db[_0x3cc5('0x74')][_0x3cc5('0x59')](_0x91978b);})[_0x3cc5('0x3a')](function(_0x14ce25){_0x4f075d['rows']=_0x14ce25;return _0x4f075d;});}})['then'](respondWithFilteredResult(_0x397b00,_0x91978b))['catch'](handleError(_0x397b00,null));};exports[_0x3cc5('0x80')]=function(_0x29af60,_0x265188){var _0x4dc734=_0x29af60['params']['id'];var _0x34ad3e=_0x29af60['body'];var _0x7b7ee2=0xc8;var _0x505518=null;return db[_0x3cc5('0x81')][_0x3cc5('0x82')]({'isolationLevel':db[_0x3cc5('0x81')][_0x3cc5('0x83')][_0x3cc5('0x84')][_0x3cc5('0x85')]},function(_0x359ba2){return db[_0x3cc5('0x46')]['findOne']({'where':{'id':_0x4dc734},'transaction':_0x359ba2})[_0x3cc5('0x3a')](function(_0x15d2d0){if(_0x15d2d0){return db[_0x3cc5('0x86')][_0x3cc5('0x66')]({'where':{'FaxAccountId':_0x4dc734},'transaction':_0x359ba2})[_0x3cc5('0x3a')](function(){var _0x356a5b=_[_0x3cc5('0x45')](_0x34ad3e,function(_0x45c873){_0x45c873[_0x3cc5('0x69')]=_0x4dc734;return _0x45c873;});return db['FaxApplication'][_0x3cc5('0x87')](_0x356a5b,{'transaction':_0x359ba2});});}else{_0x7b7ee2=0x194;_0x505518=[];}});})[_0x3cc5('0x3a')](function(){if(_0x7b7ee2!==0x194){return db[_0x3cc5('0x86')][_0x3cc5('0x88')]({'where':{'FaxAccountId':_0x4dc734},'order':_0x3cc5('0x89')})[_0x3cc5('0x3a')](function(_0x16f507){_0x505518=_0x16f507;});}})[_0x3cc5('0x2d')](function(_0x38f906){_0x7b7ee2=0x1f4;logger[_0x3cc5('0x29')](_0x38f906[_0x3cc5('0x3f')]);if(_0x38f906['name']){delete _0x38f906['name'];}_0x505518=_0x38f906;})['finally'](function(){if(_0x505518===null){_0x265188[_0x3cc5('0x3e')](_0x7b7ee2);}else{if(_0x7b7ee2===0x1f4){_0x265188[_0x3cc5('0x2e')](_0x7b7ee2)[_0x3cc5('0x41')](_0x505518);}else{_0x265188[_0x3cc5('0x2e')](_0x7b7ee2)['json'](_0x505518);}}});};exports[_0x3cc5('0x8a')]=function(_0x156717,_0x138a3f,_0x381ccf){var _0x3558c9={};var _0x2b98fb={};var _0xe69eaa;var _0x10c55a;return db['FaxAccount']['findOne']({'where':{'id':_0x156717[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x138a3f,null))[_0x3cc5('0x3a')](function(_0x339386){if(_0x339386){_0xe69eaa=_0x339386;_0x2b98fb[_0x3cc5('0x4a')]=_[_0x3cc5('0x4b')](db[_0x3cc5('0x86')][_0x3cc5('0x47')]);_0x2b98fb[_0x3cc5('0x4e')]=_['keys'](_0x156717['query']);_0x2b98fb[_0x3cc5('0x4c')]=_[_0x3cc5('0x4d')](_0x2b98fb[_0x3cc5('0x4a')],_0x2b98fb['query']);_0x3558c9['attributes']=_[_0x3cc5('0x4d')](_0x2b98fb[_0x3cc5('0x4a')],qs['fields'](_0x156717[_0x3cc5('0x4e')][_0x3cc5('0x50')]));_0x3558c9['attributes']=_0x3558c9[_0x3cc5('0x4f')]['length']?_0x3558c9[_0x3cc5('0x4f')]:_0x2b98fb[_0x3cc5('0x4a')];_0x3558c9[_0x3cc5('0x53')]=qs[_0x3cc5('0x54')](_0x156717[_0x3cc5('0x4e')]['sort']);_0x3558c9[_0x3cc5('0x55')]=qs[_0x3cc5('0x4c')](_[_0x3cc5('0x56')](_0x156717[_0x3cc5('0x4e')],_0x2b98fb[_0x3cc5('0x4c')]));if(_0x156717[_0x3cc5('0x4e')]['filter']){_0x3558c9[_0x3cc5('0x55')]=_[_0x3cc5('0x57')](_0x3558c9['where'],{'$or':_['map'](_0x3558c9[_0x3cc5('0x4f')],function(_0x38456c){var _0x194d09={};_0x194d09[_0x38456c]={'$like':'%'+_0x156717[_0x3cc5('0x4e')]['filter']+'%'};return _0x194d09;})});}_0x3558c9=_['merge']({},_0x3558c9,_0x156717[_0x3cc5('0x5d')]);return _0xe69eaa[_0x3cc5('0x8a')](_0x3558c9);}})[_0x3cc5('0x3a')](function(_0x5d10bf){if(_0x5d10bf){_0x10c55a=_0x5d10bf[_0x3cc5('0x6c')];if(!_0x156717[_0x3cc5('0x4e')][_0x3cc5('0x51')](_0x3cc5('0x52'))){_0x3558c9[_0x3cc5('0x31')]=qs[_0x3cc5('0x31')](_0x156717['query'][_0x3cc5('0x31')]);_0x3558c9[_0x3cc5('0x33')]=qs[_0x3cc5('0x33')](_0x156717[_0x3cc5('0x4e')][_0x3cc5('0x33')]);}return _0xe69eaa['getApplications'](_0x3558c9);}})[_0x3cc5('0x3a')](function(_0x168cc3){if(_0x168cc3){return _0x168cc3?{'count':_0x10c55a,'rows':_0x168cc3}:null;}})[_0x3cc5('0x3a')](respondWithResult(_0x138a3f,null))[_0x3cc5('0x2d')](handleError(_0x138a3f,null));};function Extension(_0x5c0722,_0x2f815e,_0x13d043,_0x138d24){this[_0x3cc5('0x8b')]=_0x3cc5('0x8c');this[_0x3cc5('0x8d')]=_0x5c0722['localstationid'];this[_0x3cc5('0x8e')]=_0x138d24;this['type']='system';this[_0x3cc5('0x8f')]=_0x3cc5('0x90');this[_0x3cc5('0x69')]=_0x5c0722['id'];this[_0x3cc5('0x89')]=_0x2f815e;this['appdata']=_0x13d043;}function createExtensionsReciveFax(_0x2f1601){var _0x165178=0x1;var _0x575700=[];_0x575700[_0x3cc5('0x91')](new Extension(_0x2f1601,_0x165178,'',_0x3cc5('0x92')));_0x165178+=0x1;_0x575700['push'](new Extension(_0x2f1601,_0x165178,_0x3cc5('0x93'),_0x3cc5('0x94')));_0x165178+=0x1;for(var _0x3addac in _0x2f1601){if(_0x2f1601[_0x3cc5('0x51')](_0x3addac)&&(_0x3addac===_0x3cc5('0x95')||_0x3addac===_0x3cc5('0x96')||_0x3addac===_0x3cc5('0x97')||_0x3addac==='faxdetect'||_0x3addac===_0x3cc5('0x98')||_0x3addac===_0x3cc5('0x99')||_0x3addac===_0x3cc5('0x9a')||_0x3addac==='modem'||_0x3addac==='t38timeout')){_0x575700[_0x3cc5('0x91')](new Extension(_0x2f1601,_0x165178,_0x3cc5('0x9b')+_0x3addac+')='+_0x2f1601[_0x3addac],_0x3cc5('0x94')));_0x165178+=0x1;}}_0x575700[_0x3cc5('0x91')](new Extension(_0x2f1601,_0x165178,'6','Wait'));_0x165178+=0x1;_0x575700['push'](new Extension(_0x2f1601,_0x165178,_0x3cc5('0x9c'),_0x3cc5('0x9d')));_0x165178=0x0;return _0x575700;}exports[_0x3cc5('0x9e')]=function(_0x29729f,_0x3b7f7b,_0x750c55){var _0x32fbbb;return db[_0x3cc5('0x81')][_0x3cc5('0x82')](function(_0x1ebce5){return db[_0x3cc5('0x46')][_0x3cc5('0x5e')](_0x29729f['body'],{'transaction':_0x1ebce5})[_0x3cc5('0x3a')](function(_0x5169a4){_0x32fbbb=_0x5169a4['get']({'plain':!![]});return db[_0x3cc5('0x9f')][_0x3cc5('0x87')](createExtensionsReciveFax(_0x32fbbb),{'transaction':_0x1ebce5});});})['then'](function(){return _0x32fbbb;})[_0x3cc5('0x3a')](respondWithResult(_0x3b7f7b,null))[_0x3cc5('0x2d')](handleError(_0x3b7f7b,null));};exports['updateAccountApplications']=function(_0x3036ca,_0x12a3d9,_0x1b491f){var _0x3f7c98;return db[_0x3cc5('0x81')][_0x3cc5('0x82')](function(_0x213cf1){return db[_0x3cc5('0x46')]['update'](_0x3036ca['body'],{'where':{'id':_0x3036ca[_0x3cc5('0x5f')]['id']},'transaction':_0x213cf1})[_0x3cc5('0x3a')](function(_0x5af877){return db[_0x3cc5('0x9f')][_0x3cc5('0x66')]({'where':{'FaxAccountId':_0x3036ca[_0x3cc5('0x5f')]['id']},'transaction':_0x213cf1})[_0x3cc5('0x3a')](function(_0x1b0224){return db[_0x3cc5('0x9f')][_0x3cc5('0x87')](createExtensionsReciveFax(_[_0x3cc5('0x76')](_0x3036ca[_0x3cc5('0x5f')],[_0x3cc5('0xa0'),_0x3cc5('0xa1'),_0x3cc5('0xa2'),_0x3cc5('0xa3'),_0x3cc5('0xa4'),'ListId'])),{'transaction':_0x213cf1});});});})[_0x3cc5('0x3a')](function(){return db[_0x3cc5('0x46')][_0x3cc5('0xa5')](_0x3036ca['body']['id']);})[_0x3cc5('0x3a')](respondWithResult(_0x12a3d9,null))['catch'](handleError(_0x12a3d9,null));};exports[_0x3cc5('0xa6')]=function(_0x439fbd,_0x3139b4,_0x974d6d){var _0xb58160={'raw':!![],'where':{}};var _0x368249={};var _0x16d5a9={'count':0x0,'rows':[]};return db[_0x3cc5('0x46')][_0x3cc5('0x6b')]({'where':{'id':_0x439fbd[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x3139b4,null))[_0x3cc5('0x3a')](function(_0xeb769c){if(_0xeb769c){_0x368249[_0x3cc5('0x4a')]=_[_0x3cc5('0x4b')](db[_0x3cc5('0xa7')][_0x3cc5('0x47')]);_0x368249['query']=_[_0x3cc5('0x4b')](_0x439fbd[_0x3cc5('0x4e')]);_0x368249[_0x3cc5('0x4c')]=_[_0x3cc5('0x4d')](_0x368249[_0x3cc5('0x4a')],_0x368249[_0x3cc5('0x4e')]);_0xb58160[_0x3cc5('0x4f')]=_[_0x3cc5('0x4d')](_0x368249[_0x3cc5('0x4a')],qs[_0x3cc5('0x50')](_0x439fbd[_0x3cc5('0x4e')][_0x3cc5('0x50')]));_0xb58160[_0x3cc5('0x4f')]=_0xb58160[_0x3cc5('0x4f')]['length']?_0xb58160['attributes']:_0x368249[_0x3cc5('0x4a')];if(!_0x439fbd[_0x3cc5('0x4e')][_0x3cc5('0x51')](_0x3cc5('0x52'))){_0xb58160[_0x3cc5('0x31')]=qs[_0x3cc5('0x31')](_0x439fbd[_0x3cc5('0x4e')][_0x3cc5('0x31')]);_0xb58160[_0x3cc5('0x33')]=qs['offset'](_0x439fbd['query'][_0x3cc5('0x33')]);}_0xb58160[_0x3cc5('0x53')]=qs[_0x3cc5('0x54')](_0x439fbd[_0x3cc5('0x4e')][_0x3cc5('0x54')]);_0xb58160[_0x3cc5('0x55')]=qs[_0x3cc5('0x4c')](_['pick'](_0x439fbd['query'],_0x368249[_0x3cc5('0x4c')]));_0xb58160[_0x3cc5('0x55')][_0x3cc5('0x69')]=_0xeb769c['id'];if(_0x439fbd[_0x3cc5('0x4e')]['filter']){_0xb58160[_0x3cc5('0x55')]=_[_0x3cc5('0x57')](_0xb58160[_0x3cc5('0x55')],{'$or':_['map'](_0xb58160[_0x3cc5('0x4f')],function(_0x459e3c){var _0x2ca865={};_0x2ca865[_0x459e3c]={'$like':'%'+_0x439fbd[_0x3cc5('0x4e')][_0x3cc5('0x6d')]+'%'};return _0x2ca865;})});}if(_0x439fbd['query'][_0x3cc5('0xa8')]){var _0x1529ac=_0x439fbd[_0x3cc5('0x4e')][_0x3cc5('0xa8')][_0x3cc5('0xa9')](',');var _0x405fc3={};_0x405fc3[_0x1529ac[0x0]]={'$gte':moment(_0x1529ac[0x1])['format'](_0x3cc5('0xaa'))};_0xb58160[_0x3cc5('0x55')]=_[_0x3cc5('0x57')](_0xb58160[_0x3cc5('0x55')],_0x405fc3);}_0xb58160=_['merge']({},_0xb58160,_0x439fbd[_0x3cc5('0x5d')]);return db['FaxMessage'][_0x3cc5('0x32')]({'where':_0xb58160[_0x3cc5('0x55')]})[_0x3cc5('0x3a')](function(_0x3b56ca){_0x16d5a9[_0x3cc5('0x32')]=_0x3b56ca;if(_0x439fbd[_0x3cc5('0x4e')][_0x3cc5('0x58')]){_0xb58160[_0x3cc5('0x72')]=[{'all':!![]}];}return db[_0x3cc5('0xa7')][_0x3cc5('0x59')](_0xb58160);})[_0x3cc5('0x3a')](function(_0x20ccbf){_0x16d5a9[_0x3cc5('0x5a')]=_0x20ccbf;return _0x16d5a9;});}})[_0x3cc5('0x3a')](respondWithFilteredResult(_0x3139b4,_0xb58160))[_0x3cc5('0x2d')](handleError(_0x3139b4,null));};exports[_0x3cc5('0x41')]=function(_0xa2a809,_0x599f8e,_0x25e0db){var _0x122bbe,_0x2932bf={},_0x4d2ef8;if(_0xa2a809[_0x3cc5('0x5f')]['to']){_0x4d2ef8=_0xa2a809[_0x3cc5('0x5f')]['to'][0x0];}return db[_0x3cc5('0x46')]['find']({'where':{'id':_0xa2a809[_0x3cc5('0x5c')]['id']},'include':[{'model':db[_0x3cc5('0xab')],'as':_0x3cc5('0xac'),'include':[{'model':db['CmContact'],'as':_0x3cc5('0xad'),'where':{'fax':_0x4d2ef8},'limit':0x1,'order':[[_0x3cc5('0xa3'),_0x3cc5('0xae')]]}]}]})[_0x3cc5('0x3a')](handleEntityNotFound(_0x599f8e,null))[_0x3cc5('0x3a')](function(_0xff3e05){_0x122bbe=_0xff3e05;if(_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')]&&_0xa2a809['body'][_0x3cc5('0xaf')]['length']){for(var _0x31271d=0x0;_0x31271d<_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][_0x3cc5('0x6c')];_0x31271d+=0x1){_0xa2a809['body'][_0x3cc5('0xaf')][_0x31271d]={'filename':_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][_0x31271d][_0x3cc5('0x40')],'id':_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][_0x31271d]['id'],'path':path['join'](config[_0x3cc5('0xb0')],_0x3cc5('0xb1'),_0xa2a809['body']['attachments'][_0x31271d]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x3cc5('0xb2'),{'FaxAccountId':_[_0x3cc5('0xb3')](_0xa2a809['params']['id'])?undefined:_0xa2a809[_0x3cc5('0x5c')]['id'],'path':_['isNil'](_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][0x0][_0x3cc5('0x9')])?undefined:_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][0x0][_0x3cc5('0x9')],'fax':_[_0x3cc5('0xb3')](_0xa2a809[_0x3cc5('0x5f')]['to'][0x0])?undefined:_0xa2a809[_0x3cc5('0x5f')]['to'][0x0]},client9002);})['then'](function(){if(_0x122bbe){if(_[_0x3cc5('0xb3')](_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xb4')])){_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xb4')]=util[_0x3cc5('0xb5')]('\x22%s\x22\x20<%s>',_0x122bbe['name'],_0x122bbe[_0x3cc5('0xb6')]);}if(_0x122bbe[_0x3cc5('0xac')]){if(_0x122bbe['List'][_0x3cc5('0xad')][_0x3cc5('0x6c')]){return _0x122bbe['List'][_0x3cc5('0xad')][0x0];}else{return db['CmContact'][_0x3cc5('0x5e')](_['defaults'](_0xa2a809[_0x3cc5('0x5f')],{'firstName':_0xa2a809[_0x3cc5('0x5f')]['to'][0x0],'phone':_0xa2a809[_0x3cc5('0x5f')]['to'][0x0],'fax':_0xa2a809[_0x3cc5('0x5f')]['to'][0x0],'ListId':_0x122bbe['ListId']}));}}else{throw new Error(_0x3cc5('0xb7'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x3cc5('0x3a')](function(_0x28edcb){if(_0x28edcb){return db[_0x3cc5('0x74')][_0x3cc5('0x62')]({'where':{'ContactId':_0x28edcb['id'],'closed':![],'FaxAccountId':_0x122bbe['id']}})[_0x3cc5('0x3a')](function(_0x260560){if(_0x260560){return[_0x260560,![]];}return db[_0x3cc5('0x74')][_0x3cc5('0x5e')]({'UserId':_0xa2a809[_0x3cc5('0xb8')]['id'],'ContactId':_0x28edcb['id'],'FaxAccountId':_0x122bbe['id'],'fax':_0xa2a809['body']['to'][0x0],'firstMsgDirection':_0x3cc5('0xb9'),'Messages':[_[_0x3cc5('0x57')](_0xa2a809[_0x3cc5('0x5f')],{'read':![],'body':_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][0x0][_0x3cc5('0xba')],'FaxAccountId':_0x122bbe['id'],'UserId':_0xa2a809[_0x3cc5('0xb8')]['id'],'ContactId':_0x28edcb['id'],'AttachmentId':_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][0x0]['id']})]},{'include':[{'model':db[_0x3cc5('0xa7')],'as':_0x3cc5('0xbb')}]})[_0x3cc5('0x3a')](function(_0x2eec5f){return[_0x2eec5f,!![]];});});}else{throw new Error(_0x3cc5('0xbc'));}})[_0x3cc5('0xbd')](function(_0x4f5876,_0x47b6c9){if(_0x47b6c9){return _0x4f5876;}return db[_0x3cc5('0xa7')]['create']({'direction':'out','read':![],'body':_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][0x0][_0x3cc5('0xba')],'FaxAccountId':_0x122bbe['id'],'FaxInteractionId':_0x4f5876['id'],'UserId':_0xa2a809['user']['id'],'ContactId':_0x4f5876[_0x3cc5('0xbe')],'AttachmentId':_0xa2a809['body']['attachments'][0x0]['id']})['then'](function(_0x2d9413){_0x4f5876[_0x3cc5('0xbf')][_0x3cc5('0xbb')]=[];_0x4f5876[_0x3cc5('0xbf')][_0x3cc5('0xbb')][_0x3cc5('0x91')](_0x2d9413['dataValues']);return _0x4f5876;});})['then'](function(_0x57f7b9){respondWithRpcPromise(_0x3cc5('0xc0'),'SendFax',{'FaxAccountId':_[_0x3cc5('0xb3')](_0xa2a809['params']['id'])?undefined:_0xa2a809['params']['id'],'path':_[_0x3cc5('0xb3')](_0xa2a809['body'][_0x3cc5('0xaf')][0x0][_0x3cc5('0x9')])?undefined:_0xa2a809[_0x3cc5('0x5f')][_0x3cc5('0xaf')][0x0][_0x3cc5('0x9')],'fax':_[_0x3cc5('0xb3')](_0xa2a809['body']['to'][0x0])?undefined:_0xa2a809[_0x3cc5('0x5f')]['to'][0x0],'AttachmentId':_0xa2a809[_0x3cc5('0x5f')]['attachments'][0x0]['id']},client9002)['then'](function(_0x437ac2){logger[_0x3cc5('0x24')](_0x3cc5('0xc1'),_0x437ac2);})['catch'](function(_0x5c24fc){logger[_0x3cc5('0x24')](_0x3cc5('0xc1'),_0x5c24fc);});return _0x57f7b9;})['then'](respondWithResult(_0x599f8e,null))[_0x3cc5('0x2d')](handleError(_0x599f8e,null));};exports['addAgents']=function(_0x445f53,_0x3ec271,_0x3a3f0b){return db[_0x3cc5('0x46')]['find']({'where':{'id':_0x445f53[_0x3cc5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3ec271,null))[_0x3cc5('0x3a')](function(_0x117b2c){if(_0x117b2c){return _0x117b2c['addAgents'](_0x445f53[_0x3cc5('0x5f')][_0x3cc5('0x6e')],_[_0x3cc5('0x76')](_0x445f53['body'],[_0x3cc5('0x6e'),'id'])||{})[_0x3cc5('0xbd')](function(_0x48a2c2){for(var _0x329745=0x0;_0x329745<_0x445f53[_0x3cc5('0x5f')][_0x3cc5('0x6e')][_0x3cc5('0x6c')];_0x329745+=0x1){socket[_0x3cc5('0xc2')](_0x3cc5('0xc3'),{'UserId':Number(_0x445f53[_0x3cc5('0x5f')]['ids'][_0x329745]),'FaxAccountId':Number(_0x445f53[_0x3cc5('0x5c')]['id'])});}return _0x48a2c2;});}})['then'](respondWithResult(_0x3ec271,null))[_0x3cc5('0x2d')](handleError(_0x3ec271,null));};exports[_0x3cc5('0xc4')]=function(_0x405517,_0x53e6c5,_0x3f8ba3){return db[_0x3cc5('0x46')][_0x3cc5('0x62')]({'where':{'id':_0x405517[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x53e6c5,null))['then'](function(_0x15c719){if(_0x15c719){return _0x15c719[_0x3cc5('0xc4')](_0x405517[_0x3cc5('0x4e')]['ids'])[_0x3cc5('0x3a')](function(){if(_[_0x3cc5('0xc5')](_0x405517[_0x3cc5('0x4e')][_0x3cc5('0x6e')])){for(var _0xf984f9=0x0;_0xf984f9<_0x405517[_0x3cc5('0x4e')][_0x3cc5('0x6e')][_0x3cc5('0x6c')];_0xf984f9+=0x1){socket['emit'](_0x3cc5('0xc6'),{'UserId':Number(_0x405517[_0x3cc5('0x4e')][_0x3cc5('0x6e')][_0xf984f9]),'FaxAccountId':Number(_0x405517['params']['id'])});}}else{socket['emit'](_0x3cc5('0xc6'),{'UserId':Number(_0x405517[_0x3cc5('0x4e')][_0x3cc5('0x6e')]),'FaxAccountId':Number(_0x405517[_0x3cc5('0x5c')]['id'])});}});}})[_0x3cc5('0x3a')](respondWithStatusCode(_0x53e6c5,null))['catch'](handleError(_0x53e6c5,null));};exports[_0x3cc5('0xc7')]=function(_0x5ca62e,_0x3ffbe2,_0xa611b){var _0x28bbe5={};var _0x99644e={};var _0x61cb7a;var _0x3c937d;return db[_0x3cc5('0x46')]['findOne']({'where':{'id':_0x5ca62e[_0x3cc5('0x5c')]['id']}})[_0x3cc5('0x3a')](handleEntityNotFound(_0x3ffbe2,null))[_0x3cc5('0x3a')](function(_0x3c9134){if(_0x3c9134){_0x61cb7a=_0x3c9134;_0x99644e[_0x3cc5('0x4a')]=_[_0x3cc5('0x4b')](db[_0x3cc5('0xc8')][_0x3cc5('0x47')]);_0x99644e[_0x3cc5('0x4e')]=_[_0x3cc5('0x4b')](_0x5ca62e[_0x3cc5('0x4e')]);_0x99644e[_0x3cc5('0x4c')]=_[_0x3cc5('0x4d')](_0x99644e[_0x3cc5('0x4a')],_0x99644e[_0x3cc5('0x4e')]);_0x28bbe5[_0x3cc5('0x4f')]=_[_0x3cc5('0x4d')](_0x99644e[_0x3cc5('0x4a')],qs[_0x3cc5('0x50')](_0x5ca62e[_0x3cc5('0x4e')]['fields']));_0x28bbe5[_0x3cc5('0x4f')]=_0x28bbe5[_0x3cc5('0x4f')][_0x3cc5('0x6c')]?_0x28bbe5[_0x3cc5('0x4f')]:_0x99644e[_0x3cc5('0x4a')];_0x28bbe5[_0x3cc5('0x53')]=qs[_0x3cc5('0x54')](_0x5ca62e[_0x3cc5('0x4e')][_0x3cc5('0x54')]);_0x28bbe5[_0x3cc5('0x55')]=qs[_0x3cc5('0x4c')](_[_0x3cc5('0x56')](_0x5ca62e[_0x3cc5('0x4e')],_0x99644e[_0x3cc5('0x4c')]));if(_0x5ca62e[_0x3cc5('0x4e')][_0x3cc5('0x6d')]){_0x28bbe5['where']=_['merge'](_0x28bbe5['where'],{'$or':_[_0x3cc5('0x45')](_0x28bbe5[_0x3cc5('0x4f')],function(_0x341b46){var _0xf4cc69={};_0xf4cc69[_0x341b46]={'$like':'%'+_0x5ca62e[_0x3cc5('0x4e')]['filter']+'%'};return _0xf4cc69;})});}_0x28bbe5=_[_0x3cc5('0x57')]({},_0x28bbe5,_0x5ca62e[_0x3cc5('0x5d')]);return _0x61cb7a['getAgents'](_0x28bbe5);}})[_0x3cc5('0x3a')](function(_0x55e3a4){if(_0x55e3a4){_0x3c937d=_0x55e3a4[_0x3cc5('0x6c')];if(!_0x5ca62e[_0x3cc5('0x4e')][_0x3cc5('0x51')](_0x3cc5('0x52'))){_0x28bbe5['limit']=qs['limit'](_0x5ca62e['query'][_0x3cc5('0x31')]);_0x28bbe5[_0x3cc5('0x33')]=qs[_0x3cc5('0x33')](_0x5ca62e[_0x3cc5('0x4e')][_0x3cc5('0x33')]);}return _0x61cb7a[_0x3cc5('0xc7')](_0x28bbe5);}})[_0x3cc5('0x3a')](function(_0x1e64bd){if(_0x1e64bd){return _0x1e64bd?{'count':_0x3c937d,'rows':_0x1e64bd}:null;}})[_0x3cc5('0x3a')](respondWithResult(_0x3ffbe2,null))['catch'](handleError(_0x3ffbe2,null));}; \ No newline at end of file +var _0xf018=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','send','getApplications','from-voip-provider','exten','app','system','description','appdata','Answer','CDR(type)=inbound-fax','ecm','localstationid','gateway','maxrate','minrate','modem','t38timeout','FAXOPT(','push','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','http','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll'];(function(_0x5a1d07,_0x5550f2){var _0x5f0be1=function(_0x354b9d){while(--_0x354b9d){_0x5a1d07['push'](_0x5a1d07['shift']());}};_0x5f0be1(++_0x5550f2);}(_0xf018,0x132));var _0x8f01=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf018[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x8f01('0x0'));var rimraf=require(_0x8f01('0x1'));var zipdir=require(_0x8f01('0x2'));var jsonpatch=require(_0x8f01('0x3'));var rp=require(_0x8f01('0x4'));var moment=require(_0x8f01('0x5'));var BPromise=require(_0x8f01('0x6'));var Mustache=require(_0x8f01('0x7'));var util=require(_0x8f01('0x8'));var path=require(_0x8f01('0x9'));var sox=require('sox');var csv=require(_0x8f01('0xa'));var ejs=require(_0x8f01('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8f01('0xc'));var jsforce=require(_0x8f01('0xd'));var deskjs=require(_0x8f01('0xe'));var toCsv=require(_0x8f01('0xa'));var querystring=require('querystring');var Papa=require(_0x8f01('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8f01('0x10'));var as=require(_0x8f01('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8f01('0x12'));var config=require(_0x8f01('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f01('0x14'))['db'];config[_0x8f01('0x15')]=_['defaults'](config[_0x8f01('0x15')],{'host':_0x8f01('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8f01('0x15')]));require('./faxAccount.socket')[_0x8f01('0x17')](socket);var jayson=require(_0x8f01('0x18'));var client=jayson['client'][_0x8f01('0x19')]({'port':0x232c});var client9002=jayson[_0x8f01('0x1a')][_0x8f01('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x534506,_0x14ae96,_0x224737,_0x290bed){return new BPromise(function(_0x4f111f,_0x22d5e7){var _0x4b3f9f=_0x290bed||client;return _0x4b3f9f[_0x8f01('0x1b')](_0x534506,_0x224737)[_0x8f01('0x1c')](function(_0x568f4d){logger['info'](_0x8f01('0x1d'),_0x14ae96,_0x8f01('0x1e'));logger[_0x8f01('0x1f')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x14ae96,_0x8f01('0x1e'),JSON[_0x8f01('0x20')](_0x568f4d));if(_0x568f4d[_0x8f01('0x21')]){if(_0x568f4d['error'][_0x8f01('0x22')]===0x1f4){logger[_0x8f01('0x21')](_0x8f01('0x1d'),_0x14ae96,_0x568f4d[_0x8f01('0x21')][_0x8f01('0x23')]);return _0x22d5e7(_0x568f4d['error'][_0x8f01('0x23')]);}logger[_0x8f01('0x21')](_0x8f01('0x1d'),_0x14ae96,_0x568f4d[_0x8f01('0x21')][_0x8f01('0x23')]);return _0x4f111f(_0x568f4d[_0x8f01('0x21')][_0x8f01('0x23')]);}else{logger[_0x8f01('0x24')](_0x8f01('0x1d'),_0x14ae96,_0x8f01('0x1e'));_0x4f111f(_0x568f4d['result'][_0x8f01('0x23')]);}})['catch'](function(_0x4d21a){logger[_0x8f01('0x21')](_0x8f01('0x1d'),_0x14ae96,_0x4d21a);_0x22d5e7(_0x4d21a);});});}function respondWithStatusCode(_0x1b4c23,_0x4b4bd1){_0x4b4bd1=_0x4b4bd1||0xcc;return function(_0x5b80a4){if(_0x5b80a4){return _0x1b4c23[_0x8f01('0x25')](_0x4b4bd1);}return _0x1b4c23[_0x8f01('0x26')](_0x4b4bd1)['end']();};}function respondWithResult(_0x6f80db,_0x5a7deb){_0x5a7deb=_0x5a7deb||0xc8;return function(_0x5bc347){if(_0x5bc347){return _0x6f80db[_0x8f01('0x26')](_0x5a7deb)[_0x8f01('0x27')](_0x5bc347);}};}function respondWithFilteredResult(_0x2b2513,_0x350a4c){return function(_0x2e0db6){if(_0x2e0db6){var _0x56b8fe=typeof _0x350a4c[_0x8f01('0x28')]===_0x8f01('0x29')&&typeof _0x350a4c[_0x8f01('0x2a')]==='undefined';var _0x2d2d21=_0x2e0db6[_0x8f01('0x2b')];var _0xecda61=_0x56b8fe?0x0:_0x350a4c[_0x8f01('0x28')];var _0x2e3ded=_0x56b8fe?_0x2e0db6[_0x8f01('0x2b')]:_0x350a4c[_0x8f01('0x28')]+_0x350a4c[_0x8f01('0x2a')];var _0xebfd4e;if(_0x2e3ded>=_0x2d2d21){_0x2e3ded=_0x2d2d21;_0xebfd4e=0xc8;}else{_0xebfd4e=0xce;}_0x2b2513[_0x8f01('0x26')](_0xebfd4e);return _0x2b2513[_0x8f01('0x2c')](_0x8f01('0x2d'),_0xecda61+'-'+_0x2e3ded+'/'+_0x2d2d21)[_0x8f01('0x27')](_0x2e0db6);}return null;};}function patchUpdates(_0x51d82f){return function(_0x3aad41){try{jsonpatch[_0x8f01('0x2e')](_0x3aad41,_0x51d82f,!![]);}catch(_0x37966a){return BPromise[_0x8f01('0x2f')](_0x37966a);}return _0x3aad41[_0x8f01('0x30')]();};}function saveUpdates(_0x4441a8,_0x1d4c13){return function(_0xb7212a){if(_0xb7212a){return _0xb7212a[_0x8f01('0x31')](_0x4441a8)[_0x8f01('0x1c')](function(_0x4aa740){return _0x4aa740;});}return null;};}function removeEntity(_0x4eb297,_0x741154){return function(_0x415017){if(_0x415017){return _0x415017[_0x8f01('0x32')]()['then'](function(){var _0x5c3035=_0x415017[_0x8f01('0x33')]({'plain':!![]});var _0x3c47da=_0x8f01('0x34');return db[_0x8f01('0x35')][_0x8f01('0x32')]({'where':{'type':_0x3c47da,'resourceId':_0x5c3035['id']}})[_0x8f01('0x1c')](function(){return _0x415017;});})['then'](function(){_0x4eb297[_0x8f01('0x26')](0xcc)[_0x8f01('0x36')]();});}};}function handleEntityNotFound(_0x5b31de,_0x5f5108){return function(_0x4e33bf){if(!_0x4e33bf){_0x5b31de[_0x8f01('0x25')](0x194);}return _0x4e33bf;};}function handleError(_0x31f2ff,_0x29601d){_0x29601d=_0x29601d||0x1f4;return function(_0x392081){logger[_0x8f01('0x21')](_0x392081[_0x8f01('0x37')]);if(_0x392081['name']){delete _0x392081[_0x8f01('0x38')];}_0x31f2ff[_0x8f01('0x26')](_0x29601d)['send'](_0x392081);};}exports[_0x8f01('0x39')]=function(_0x4eefeb,_0x16e824){var _0x5790ec={'include':[{'model':db[_0x8f01('0x3a')],'as':_0x8f01('0x3b')}]},_0x593807={},_0xb75395={'count':0x0,'rows':[]};var _0x4190b4=_[_0x8f01('0x3c')](db[_0x8f01('0x3d')][_0x8f01('0x3e')],function(_0x288a32){return{'name':_0x288a32[_0x8f01('0x3f')],'type':_0x288a32[_0x8f01('0x40')][_0x8f01('0x41')]};});_0x593807[_0x8f01('0x42')]=_[_0x8f01('0x3c')](_0x4190b4,_0x8f01('0x38'));_0x593807[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x4eefeb[_0x8f01('0x43')]);_0x593807[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x593807[_0x8f01('0x42')],_0x593807[_0x8f01('0x43')]);_0x5790ec[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x593807[_0x8f01('0x42')],qs['fields'](_0x4eefeb['query'][_0x8f01('0x48')]));_0x5790ec[_0x8f01('0x47')]=_0x5790ec[_0x8f01('0x47')][_0x8f01('0x49')]?_0x5790ec['attributes']:_0x593807['model'];if(!_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x5790ec[_0x8f01('0x2a')]=qs[_0x8f01('0x2a')](_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x2a')]);_0x5790ec[_0x8f01('0x28')]=qs['offset'](_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x28')]);}_0x5790ec[_0x8f01('0x4c')]=qs[_0x8f01('0x4d')](_0x4eefeb[_0x8f01('0x43')]['sort']);_0x5790ec[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x4eefeb[_0x8f01('0x43')],_0x593807['filters']),_0x4190b4);if(_0x4eefeb[_0x8f01('0x43')]['filter']){_0x5790ec[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x5790ec[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0x4190b4,function(_0x518532){if(_0x518532[_0x8f01('0x40')]!==_0x8f01('0x51')){var _0xc7ca82={};_0xc7ca82[_0x518532[_0x8f01('0x38')]]={'$like':'%'+_0x4eefeb[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0xc7ca82;}})});}_0x5790ec=_[_0x8f01('0x50')]({},_0x5790ec,_0x4eefeb[_0x8f01('0x53')]);var _0xdf3309={'where':_0x5790ec[_0x8f01('0x4e')]};return db[_0x8f01('0x3d')][_0x8f01('0x2b')](_0xdf3309)[_0x8f01('0x1c')](function(_0x1440be){_0xb75395['count']=_0x1440be;if(_0x4eefeb[_0x8f01('0x43')]['includeAll']){_0x5790ec[_0x8f01('0x54')]=[{'all':!![]}];}return db['FaxAccount'][_0x8f01('0x55')](_0x5790ec);})['then'](function(_0x2cb3d1){_0xb75395[_0x8f01('0x56')]=_0x2cb3d1;return _0xb75395;})[_0x8f01('0x1c')](respondWithFilteredResult(_0x16e824,_0x5790ec))[_0x8f01('0x57')](handleError(_0x16e824,null));};exports['show']=function(_0x5bfb4d,_0xa923f5){var _0x173f30={'raw':![],'where':{'id':_0x5bfb4d[_0x8f01('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8f01('0x3b')}]},_0x28d5d3={};_0x28d5d3[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0x3d')][_0x8f01('0x3e')]);_0x28d5d3[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x5bfb4d[_0x8f01('0x43')]);_0x28d5d3[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x28d5d3['model'],_0x28d5d3[_0x8f01('0x43')]);_0x173f30[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x28d5d3[_0x8f01('0x42')],qs['fields'](_0x5bfb4d[_0x8f01('0x43')][_0x8f01('0x48')]));_0x173f30[_0x8f01('0x47')]=_0x173f30[_0x8f01('0x47')][_0x8f01('0x49')]?_0x173f30[_0x8f01('0x47')]:_0x28d5d3[_0x8f01('0x42')];if(_0x5bfb4d[_0x8f01('0x43')][_0x8f01('0x59')]){_0x173f30[_0x8f01('0x54')]=[{'all':!![]}];}_0x173f30=_[_0x8f01('0x50')]({},_0x173f30,_0x5bfb4d[_0x8f01('0x53')]);return db[_0x8f01('0x3d')][_0x8f01('0x5a')](_0x173f30)[_0x8f01('0x1c')](handleEntityNotFound(_0xa923f5,null))['then'](respondWithResult(_0xa923f5,null))[_0x8f01('0x57')](handleError(_0xa923f5,null));};exports['create']=function(_0x408244,_0x5f1c56){return db['FaxAccount'][_0x8f01('0x5b')](_0x408244['body'],{})[_0x8f01('0x1c')](function(_0x2c3708){var _0x2eaed8=_0x408244[_0x8f01('0x5c')]['get']({'plain':!![]});if(!_0x2eaed8)throw new Error(_0x8f01('0x5d'));if(_0x2eaed8[_0x8f01('0x5e')]===_0x8f01('0x5c')){var _0x3b5840=_0x2c3708['get']({'plain':!![]});var _0x5f280c=_0x8f01('0x34');return db[_0x8f01('0x5f')][_0x8f01('0x5a')]({'where':{'name':_0x5f280c,'userProfileId':_0x2eaed8[_0x8f01('0x60')]},'raw':!![]})[_0x8f01('0x1c')](function(_0xadf6cd){if(_0xadf6cd&&_0xadf6cd[_0x8f01('0x61')]===0x0){return db[_0x8f01('0x35')][_0x8f01('0x5b')]({'name':_0x3b5840[_0x8f01('0x38')],'resourceId':_0x3b5840['id'],'type':_0xadf6cd['name'],'sectionId':_0xadf6cd['id']},{})[_0x8f01('0x1c')](function(){return _0x2c3708;});}else{return _0x2c3708;}})[_0x8f01('0x57')](function(_0x167dd5){logger[_0x8f01('0x21')](_0x8f01('0x62'),_0x167dd5);throw _0x167dd5;});}return _0x2c3708;})['then'](respondWithResult(_0x5f1c56,0xc9))[_0x8f01('0x57')](handleError(_0x5f1c56,null));};exports[_0x8f01('0x31')]=function(_0x90ce3c,_0x45ee71){if(_0x90ce3c[_0x8f01('0x63')]['id']){delete _0x90ce3c[_0x8f01('0x63')]['id'];}return db[_0x8f01('0x3d')]['find']({'where':{'id':_0x90ce3c['params']['id']},'include':[{'model':db[_0x8f01('0x3a')],'as':_0x8f01('0x3b')}]})['then'](handleEntityNotFound(_0x45ee71,null))['then'](saveUpdates(_0x90ce3c['body'],null))[_0x8f01('0x1c')](respondWithResult(_0x45ee71,null))['catch'](handleError(_0x45ee71,null));};exports[_0x8f01('0x32')]=function(_0x103abf,_0xae0753){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x103abf[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0xae0753,null))['then'](removeEntity(_0xae0753,null))['catch'](handleError(_0xae0753,null));};exports[_0x8f01('0x64')]=function(_0x2eb3a9,_0x19e25b){return db[_0x8f01('0x3d')][_0x8f01('0x64')]()[_0x8f01('0x1c')](respondWithResult(_0x19e25b,null))[_0x8f01('0x57')](handleError(_0x19e25b,null));};exports[_0x8f01('0x65')]=function(_0x5988bd,_0x2ea3ad,_0x156a46){if(_0x5988bd[_0x8f01('0x63')]['id']){delete _0x5988bd[_0x8f01('0x63')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x5988bd['params']['id']}})['then'](handleEntityNotFound(_0x2ea3ad,null))[_0x8f01('0x1c')](function(_0x8e6a82){if(_0x8e6a82){_0x5988bd[_0x8f01('0x63')][_0x8f01('0x66')]=_0x8e6a82['id'];return db[_0x8f01('0x67')][_0x8f01('0x5b')](_0x5988bd['body']);}})[_0x8f01('0x1c')](respondWithResult(_0x2ea3ad,null))[_0x8f01('0x57')](handleError(_0x2ea3ad,null));};exports[_0x8f01('0x68')]=function(_0x1b2864,_0x43906c,_0x2506b5){var _0x3cb342={'raw':![],'where':{}};var _0x81ce2f={};var _0x1ddc0e={'count':0x0,'rows':[]};return db[_0x8f01('0x3d')][_0x8f01('0x69')]({'where':{'id':_0x1b2864[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x43906c,null))['then'](function(_0x450ce0){if(_0x450ce0){_0x81ce2f[_0x8f01('0x42')]=_[_0x8f01('0x44')](db['Disposition'][_0x8f01('0x3e')]);_0x81ce2f['query']=_['keys'](_0x1b2864['query']);_0x81ce2f[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x81ce2f['model'],_0x81ce2f[_0x8f01('0x43')]);_0x3cb342[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x81ce2f[_0x8f01('0x42')],qs['fields'](_0x1b2864['query'][_0x8f01('0x48')]));_0x3cb342['attributes']=_0x3cb342[_0x8f01('0x47')][_0x8f01('0x49')]?_0x3cb342[_0x8f01('0x47')]:_0x81ce2f[_0x8f01('0x42')];if(!_0x1b2864[_0x8f01('0x43')][_0x8f01('0x4a')]('nolimit')){_0x3cb342[_0x8f01('0x2a')]=qs['limit'](_0x1b2864['query'][_0x8f01('0x2a')]);_0x3cb342[_0x8f01('0x28')]=qs[_0x8f01('0x28')](_0x1b2864[_0x8f01('0x43')][_0x8f01('0x28')]);}_0x3cb342[_0x8f01('0x4c')]=qs[_0x8f01('0x4d')](_0x1b2864[_0x8f01('0x43')]['sort']);_0x3cb342['where']=qs['filters'](_[_0x8f01('0x4f')](_0x1b2864[_0x8f01('0x43')],_0x81ce2f['filters']));_0x3cb342['where'][_0x8f01('0x66')]=_0x450ce0['id'];if(_0x1b2864[_0x8f01('0x43')][_0x8f01('0x52')]){_0x3cb342[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x3cb342['where'],{'$or':_[_0x8f01('0x3c')](_0x3cb342[_0x8f01('0x47')],function(_0x349cda){var _0x57afbe={};_0x57afbe[_0x349cda]={'$like':'%'+_0x1b2864['query'][_0x8f01('0x52')]+'%'};return _0x57afbe;})});}_0x3cb342=_[_0x8f01('0x50')]({},_0x3cb342,_0x1b2864[_0x8f01('0x53')]);return db[_0x8f01('0x67')][_0x8f01('0x2b')]({'where':_0x3cb342[_0x8f01('0x4e')]})['then'](function(_0x59f2ec){_0x1ddc0e[_0x8f01('0x2b')]=_0x59f2ec;if(_0x1b2864[_0x8f01('0x43')][_0x8f01('0x59')]){_0x3cb342[_0x8f01('0x54')]=[{'all':!![]}];}return db[_0x8f01('0x67')][_0x8f01('0x55')](_0x3cb342);})['then'](function(_0xb340d8){_0x1ddc0e[_0x8f01('0x56')]=_0xb340d8;return _0x1ddc0e;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x43906c,_0x3cb342))[_0x8f01('0x57')](handleError(_0x43906c,null));};exports['removeDispositions']=function(_0x5f1f5e,_0x1c4a8b,_0x1d1e5e){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x5f1f5e[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x1c4a8b,null))['then'](function(_0x85c7bf){if(_0x85c7bf){return _0x85c7bf[_0x8f01('0x6a')](_0x5f1f5e['query'][_0x8f01('0x6b')]);}})[_0x8f01('0x1c')](respondWithStatusCode(_0x1c4a8b,null))['catch'](handleError(_0x1c4a8b,null));};exports[_0x8f01('0x6c')]=function(_0x4c0523,_0x4aefca,_0x4120f9){if(_0x4c0523[_0x8f01('0x63')]['id']){delete _0x4c0523[_0x8f01('0x63')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4c0523[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x4aefca,null))[_0x8f01('0x1c')](function(_0x5c17e0){if(_0x5c17e0){_0x4c0523['body'][_0x8f01('0x66')]=_0x5c17e0['id'];return db[_0x8f01('0x6d')]['create'](_0x4c0523[_0x8f01('0x63')]);}})[_0x8f01('0x1c')](respondWithResult(_0x4aefca,null))[_0x8f01('0x57')](handleError(_0x4aefca,null));};exports[_0x8f01('0x6e')]=function(_0x10cdd6,_0x1ebc0c,_0x4dd784){var _0x14001d={'raw':![],'where':{}};var _0x441072={};var _0x5c1224={'count':0x0,'rows':[]};return db[_0x8f01('0x3d')][_0x8f01('0x69')]({'where':{'id':_0x10cdd6[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x1ebc0c,null))[_0x8f01('0x1c')](function(_0x353168){if(_0x353168){_0x441072[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0x6d')][_0x8f01('0x3e')]);_0x441072['query']=_[_0x8f01('0x44')](_0x10cdd6[_0x8f01('0x43')]);_0x441072[_0x8f01('0x45')]=_['intersection'](_0x441072[_0x8f01('0x42')],_0x441072[_0x8f01('0x43')]);_0x14001d[_0x8f01('0x47')]=_['intersection'](_0x441072[_0x8f01('0x42')],qs[_0x8f01('0x48')](_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x48')]));_0x14001d[_0x8f01('0x47')]=_0x14001d[_0x8f01('0x47')][_0x8f01('0x49')]?_0x14001d[_0x8f01('0x47')]:_0x441072[_0x8f01('0x42')];if(!_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x14001d[_0x8f01('0x2a')]=qs[_0x8f01('0x2a')](_0x10cdd6[_0x8f01('0x43')]['limit']);_0x14001d['offset']=qs['offset'](_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x28')]);}_0x14001d['order']=qs[_0x8f01('0x4d')](_0x10cdd6['query'][_0x8f01('0x4d')]);_0x14001d[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x10cdd6[_0x8f01('0x43')],_0x441072[_0x8f01('0x45')]));_0x14001d[_0x8f01('0x4e')][_0x8f01('0x66')]=_0x353168['id'];if(_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x52')]){_0x14001d[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x14001d[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0x14001d[_0x8f01('0x47')],function(_0x4e1e40){var _0x2c3900={};_0x2c3900[_0x4e1e40]={'$like':'%'+_0x10cdd6[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x2c3900;})});}_0x14001d=_[_0x8f01('0x50')]({},_0x14001d,_0x10cdd6[_0x8f01('0x53')]);return db[_0x8f01('0x6d')][_0x8f01('0x2b')]({'where':_0x14001d[_0x8f01('0x4e')]})[_0x8f01('0x1c')](function(_0x494ee0){_0x5c1224['count']=_0x494ee0;if(_0x10cdd6['query'][_0x8f01('0x59')]){_0x14001d['include']=[{'all':!![]}];}return db[_0x8f01('0x6d')][_0x8f01('0x55')](_0x14001d);})[_0x8f01('0x1c')](function(_0x389958){_0x5c1224[_0x8f01('0x56')]=_0x389958;return _0x5c1224;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x1ebc0c,_0x14001d))['catch'](handleError(_0x1ebc0c,null));};exports[_0x8f01('0x6f')]=function(_0x351ad1,_0x27d280,_0x1c8ebb){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x351ad1[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x27d280,null))[_0x8f01('0x1c')](function(_0x412c94){if(_0x412c94){return _0x412c94['removeAnswers'](_0x351ad1[_0x8f01('0x43')][_0x8f01('0x6b')]);}})[_0x8f01('0x1c')](respondWithStatusCode(_0x27d280,null))['catch'](handleError(_0x27d280,null));};exports[_0x8f01('0x70')]=function(_0x51f65e,_0x3c9632,_0x18e020){return db[_0x8f01('0x71')]['find']({'where':{'id':_0x51f65e[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c9632,null))[_0x8f01('0x1c')](function(_0x3083bf){if(_0x3083bf){return _0x3083bf[_0x8f01('0x70')](_0x51f65e[_0x8f01('0x63')][_0x8f01('0x6b')],_[_0x8f01('0x72')](_0x51f65e[_0x8f01('0x63')],[_0x8f01('0x6b'),'id'])||{});}})[_0x8f01('0x1c')](respondWithResult(_0x3c9632,null))[_0x8f01('0x57')](handleError(_0x3c9632,null));};exports[_0x8f01('0x73')]=function(_0x5a2f6d,_0x5db13c,_0x135423){var _0x30c297={'raw':![],'where':{}};var _0x240eff={};var _0x4c24f4={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5a2f6d[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x5db13c,null))[_0x8f01('0x1c')](function(_0x1ca5cb){if(_0x1ca5cb){_0x240eff[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0x71')][_0x8f01('0x3e')]);_0x240eff[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x5a2f6d['query']);_0x240eff[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x240eff[_0x8f01('0x42')],_0x240eff['query']);_0x30c297[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x240eff[_0x8f01('0x42')],qs['fields'](_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x48')]));_0x30c297['attributes']=_0x30c297['attributes'][_0x8f01('0x49')]?_0x30c297['attributes']:_0x240eff['model'];if(!_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x30c297[_0x8f01('0x2a')]=qs[_0x8f01('0x2a')](_0x5a2f6d['query'][_0x8f01('0x2a')]);_0x30c297[_0x8f01('0x28')]=qs[_0x8f01('0x28')](_0x5a2f6d[_0x8f01('0x43')]['offset']);}_0x30c297['order']=qs[_0x8f01('0x4d')](_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x4d')]);_0x30c297[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x5a2f6d[_0x8f01('0x43')],_0x240eff[_0x8f01('0x45')]));_0x30c297[_0x8f01('0x4e')][_0x8f01('0x66')]=_0x1ca5cb['id'];if(_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x52')]){_0x30c297[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x30c297[_0x8f01('0x4e')],{'$or':_['map'](_0x30c297['attributes'],function(_0x2ff753){var _0x508bc8={};_0x508bc8[_0x2ff753]={'$like':'%'+_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x508bc8;})});}_0x30c297=_[_0x8f01('0x50')]({},_0x30c297,_0x5a2f6d[_0x8f01('0x53')]);return db[_0x8f01('0x71')]['count']({'where':_0x30c297[_0x8f01('0x4e')]})[_0x8f01('0x1c')](function(_0x369ba6){_0x4c24f4[_0x8f01('0x2b')]=_0x369ba6;if(_0x5a2f6d['query'][_0x8f01('0x59')]){_0x30c297[_0x8f01('0x54')]=[{'model':db[_0x8f01('0x74')],'as':_0x8f01('0x75'),'required':![]},{'model':db[_0x8f01('0x76')],'as':_0x8f01('0x77'),'attributes':[_0x8f01('0x38'),_0x8f01('0x78'),_0x8f01('0x79')],'required':![]},{'model':db[_0x8f01('0x7a')],'as':_0x8f01('0x7b'),'attributes':['id',_0x8f01('0x38'),_0x8f01('0x7c')],'where':_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x7d')]?{'id':_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x7d')]}:undefined,'required':_0x5a2f6d[_0x8f01('0x43')][_0x8f01('0x7d')]?!![]:![]}];}return db[_0x8f01('0x71')][_0x8f01('0x55')](_0x30c297);})[_0x8f01('0x1c')](function(_0x7cce0b){_0x4c24f4['rows']=_0x7cce0b;return _0x4c24f4;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x5db13c,_0x30c297))[_0x8f01('0x57')](handleError(_0x5db13c,null));};exports['addApplications']=function(_0x43ee59,_0x557c3c){var _0x4c733c=_0x43ee59[_0x8f01('0x58')]['id'];var _0x5b624c=_0x43ee59['body'];var _0x77f7ec=0xc8;var _0x2aa6d4=null;return db[_0x8f01('0x7e')][_0x8f01('0x7f')]({'isolationLevel':db[_0x8f01('0x7e')][_0x8f01('0x80')][_0x8f01('0x81')][_0x8f01('0x82')]},function(_0x208e4b){return db[_0x8f01('0x3d')]['findOne']({'where':{'id':_0x4c733c},'transaction':_0x208e4b})[_0x8f01('0x1c')](function(_0x3708d0){if(_0x3708d0){return db['FaxApplication'][_0x8f01('0x32')]({'where':{'FaxAccountId':_0x4c733c},'transaction':_0x208e4b})['then'](function(){var _0x56b658=_[_0x8f01('0x3c')](_0x5b624c,function(_0x3ffe86){_0x3ffe86[_0x8f01('0x66')]=_0x4c733c;return _0x3ffe86;});return db[_0x8f01('0x83')][_0x8f01('0x84')](_0x56b658,{'transaction':_0x208e4b});});}else{_0x77f7ec=0x194;_0x2aa6d4=[];}});})[_0x8f01('0x1c')](function(){if(_0x77f7ec!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x4c733c},'order':_0x8f01('0x85')})[_0x8f01('0x1c')](function(_0x17b12b){_0x2aa6d4=_0x17b12b;});}})['catch'](function(_0x4aa540){_0x77f7ec=0x1f4;logger[_0x8f01('0x21')](_0x4aa540[_0x8f01('0x37')]);if(_0x4aa540[_0x8f01('0x38')]){delete _0x4aa540['name'];}_0x2aa6d4=_0x4aa540;})['finally'](function(){if(_0x2aa6d4===null){_0x557c3c[_0x8f01('0x25')](_0x77f7ec);}else{if(_0x77f7ec===0x1f4){_0x557c3c[_0x8f01('0x26')](_0x77f7ec)[_0x8f01('0x86')](_0x2aa6d4);}else{_0x557c3c[_0x8f01('0x26')](_0x77f7ec)[_0x8f01('0x27')](_0x2aa6d4);}}});};exports['getApplications']=function(_0xd010c5,_0x55aa83,_0x41b1c0){var _0xd1aaab={};var _0x5124ce={};var _0x15859c;var _0x5f3e9a;return db['FaxAccount'][_0x8f01('0x69')]({'where':{'id':_0xd010c5[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x55aa83,null))[_0x8f01('0x1c')](function(_0xc0ff86){if(_0xc0ff86){_0x15859c=_0xc0ff86;_0x5124ce['model']=_['keys'](db[_0x8f01('0x83')][_0x8f01('0x3e')]);_0x5124ce[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0xd010c5[_0x8f01('0x43')]);_0x5124ce[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x5124ce['model'],_0x5124ce[_0x8f01('0x43')]);_0xd1aaab[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x5124ce[_0x8f01('0x42')],qs[_0x8f01('0x48')](_0xd010c5['query'][_0x8f01('0x48')]));_0xd1aaab[_0x8f01('0x47')]=_0xd1aaab[_0x8f01('0x47')][_0x8f01('0x49')]?_0xd1aaab[_0x8f01('0x47')]:_0x5124ce['model'];_0xd1aaab['order']=qs[_0x8f01('0x4d')](_0xd010c5[_0x8f01('0x43')][_0x8f01('0x4d')]);_0xd1aaab[_0x8f01('0x4e')]=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0xd010c5[_0x8f01('0x43')],_0x5124ce[_0x8f01('0x45')]));if(_0xd010c5[_0x8f01('0x43')][_0x8f01('0x52')]){_0xd1aaab[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0xd1aaab[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0xd1aaab['attributes'],function(_0x49ab84){var _0x5e2cbb={};_0x5e2cbb[_0x49ab84]={'$like':'%'+_0xd010c5[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x5e2cbb;})});}_0xd1aaab=_[_0x8f01('0x50')]({},_0xd1aaab,_0xd010c5[_0x8f01('0x53')]);return _0x15859c['getApplications'](_0xd1aaab);}})[_0x8f01('0x1c')](function(_0x2f0cfa){if(_0x2f0cfa){_0x5f3e9a=_0x2f0cfa[_0x8f01('0x49')];if(!_0xd010c5[_0x8f01('0x43')]['hasOwnProperty']('nolimit')){_0xd1aaab['limit']=qs['limit'](_0xd010c5[_0x8f01('0x43')][_0x8f01('0x2a')]);_0xd1aaab['offset']=qs[_0x8f01('0x28')](_0xd010c5[_0x8f01('0x43')][_0x8f01('0x28')]);}return _0x15859c[_0x8f01('0x87')](_0xd1aaab);}})[_0x8f01('0x1c')](function(_0x115356){if(_0x115356){return _0x115356?{'count':_0x5f3e9a,'rows':_0x115356}:null;}})[_0x8f01('0x1c')](respondWithResult(_0x55aa83,null))[_0x8f01('0x57')](handleError(_0x55aa83,null));};function Extension(_0x31cc84,_0x14d863,_0x2e0204,_0x14c453){this['context']=_0x8f01('0x88');this[_0x8f01('0x89')]=_0x31cc84['localstationid'];this[_0x8f01('0x8a')]=_0x14c453;this[_0x8f01('0x40')]=_0x8f01('0x8b');this[_0x8f01('0x8c')]='Fax\x20Extension';this[_0x8f01('0x66')]=_0x31cc84['id'];this[_0x8f01('0x85')]=_0x14d863;this[_0x8f01('0x8d')]=_0x2e0204;}function createExtensionsReciveFax(_0x52e2f5){var _0x5af03d=0x1;var _0x3070bf=[];_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,'',_0x8f01('0x8e')));_0x5af03d+=0x1;_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,_0x8f01('0x8f'),'Set'));_0x5af03d+=0x1;for(var _0x551d91 in _0x52e2f5){if(_0x52e2f5[_0x8f01('0x4a')](_0x551d91)&&(_0x551d91===_0x8f01('0x90')||_0x551d91===_0x8f01('0x91')||_0x551d91===_0x8f01('0x92')||_0x551d91==='faxdetect'||_0x551d91==='headerinfo'||_0x551d91===_0x8f01('0x93')||_0x551d91===_0x8f01('0x94')||_0x551d91===_0x8f01('0x95')||_0x551d91===_0x8f01('0x96'))){_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,_0x8f01('0x97')+_0x551d91+')='+_0x52e2f5[_0x551d91],'Set'));_0x5af03d+=0x1;}}_0x3070bf[_0x8f01('0x98')](new Extension(_0x52e2f5,_0x5af03d,'6',_0x8f01('0x99')));_0x5af03d+=0x1;_0x3070bf['push'](new Extension(_0x52e2f5,_0x5af03d,_0x8f01('0x9a'),_0x8f01('0x9b')));_0x5af03d=0x0;return _0x3070bf;}exports[_0x8f01('0x9c')]=function(_0x5864bb,_0x2f9890,_0x394f42){var _0xf8e211;return db[_0x8f01('0x7e')][_0x8f01('0x7f')](function(_0x41a283){return db[_0x8f01('0x3d')][_0x8f01('0x5b')](_0x5864bb[_0x8f01('0x63')],{'transaction':_0x41a283})[_0x8f01('0x1c')](function(_0x1de2fc){_0xf8e211=_0x1de2fc[_0x8f01('0x33')]({'plain':!![]});return db[_0x8f01('0x9d')][_0x8f01('0x84')](createExtensionsReciveFax(_0xf8e211),{'transaction':_0x41a283});});})[_0x8f01('0x1c')](function(){return _0xf8e211;})[_0x8f01('0x1c')](respondWithResult(_0x2f9890,null))[_0x8f01('0x57')](handleError(_0x2f9890,null));};exports[_0x8f01('0x9e')]=function(_0xddfdd4,_0x36d602,_0x379f49){var _0x4756a0;return db[_0x8f01('0x7e')][_0x8f01('0x7f')](function(_0x51937f){return db[_0x8f01('0x3d')][_0x8f01('0x31')](_0xddfdd4['body'],{'where':{'id':_0xddfdd4['body']['id']},'transaction':_0x51937f})[_0x8f01('0x1c')](function(_0x565cb9){return db['VoiceExtension'][_0x8f01('0x32')]({'where':{'FaxAccountId':_0xddfdd4[_0x8f01('0x63')]['id']},'transaction':_0x51937f})[_0x8f01('0x1c')](function(_0x47496e){return db['VoiceExtension'][_0x8f01('0x84')](createExtensionsReciveFax(_['omit'](_0xddfdd4[_0x8f01('0x63')],[_0x8f01('0x9f'),_0x8f01('0x41'),_0x8f01('0xa0'),_0x8f01('0xa1'),'TrunkId',_0x8f01('0xa2')])),{'transaction':_0x51937f});});});})['then'](function(){return db[_0x8f01('0x3d')]['findById'](_0xddfdd4[_0x8f01('0x63')]['id']);})[_0x8f01('0x1c')](respondWithResult(_0x36d602,null))[_0x8f01('0x57')](handleError(_0x36d602,null));};exports[_0x8f01('0xa3')]=function(_0x492613,_0x33dd4b,_0x4e8dbc){var _0xd99a58={'raw':!![],'where':{}};var _0x587e19={};var _0x4ef8da={'count':0x0,'rows':[]};return db[_0x8f01('0x3d')]['findOne']({'where':{'id':_0x492613[_0x8f01('0x58')]['id']}})['then'](handleEntityNotFound(_0x33dd4b,null))[_0x8f01('0x1c')](function(_0x38b259){if(_0x38b259){_0x587e19[_0x8f01('0x42')]=_[_0x8f01('0x44')](db[_0x8f01('0xa4')]['rawAttributes']);_0x587e19[_0x8f01('0x43')]=_[_0x8f01('0x44')](_0x492613['query']);_0x587e19['filters']=_[_0x8f01('0x46')](_0x587e19[_0x8f01('0x42')],_0x587e19[_0x8f01('0x43')]);_0xd99a58[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x587e19[_0x8f01('0x42')],qs[_0x8f01('0x48')](_0x492613[_0x8f01('0x43')]['fields']));_0xd99a58[_0x8f01('0x47')]=_0xd99a58['attributes']['length']?_0xd99a58[_0x8f01('0x47')]:_0x587e19[_0x8f01('0x42')];if(!_0x492613[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0xd99a58['limit']=qs[_0x8f01('0x2a')](_0x492613[_0x8f01('0x43')][_0x8f01('0x2a')]);_0xd99a58['offset']=qs[_0x8f01('0x28')](_0x492613['query']['offset']);}_0xd99a58['order']=qs['sort'](_0x492613['query'][_0x8f01('0x4d')]);_0xd99a58['where']=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x492613[_0x8f01('0x43')],_0x587e19['filters']));_0xd99a58[_0x8f01('0x4e')][_0x8f01('0x66')]=_0x38b259['id'];if(_0x492613[_0x8f01('0x43')]['filter']){_0xd99a58[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0xd99a58[_0x8f01('0x4e')],{'$or':_[_0x8f01('0x3c')](_0xd99a58['attributes'],function(_0x12c75f){var _0x76e33f={};_0x76e33f[_0x12c75f]={'$like':'%'+_0x492613['query'][_0x8f01('0x52')]+'%'};return _0x76e33f;})});}if(_0x492613[_0x8f01('0x43')][_0x8f01('0xa5')]){var _0x56d212=_0x492613[_0x8f01('0x43')][_0x8f01('0xa5')][_0x8f01('0xa6')](',');var _0x19f75f={};_0x19f75f[_0x56d212[0x0]]={'$gte':moment(_0x56d212[0x1])[_0x8f01('0xa7')](_0x8f01('0xa8'))};_0xd99a58['where']=_['merge'](_0xd99a58[_0x8f01('0x4e')],_0x19f75f);}_0xd99a58=_[_0x8f01('0x50')]({},_0xd99a58,_0x492613['options']);return db[_0x8f01('0xa4')][_0x8f01('0x2b')]({'where':_0xd99a58[_0x8f01('0x4e')]})[_0x8f01('0x1c')](function(_0x3a260a){_0x4ef8da[_0x8f01('0x2b')]=_0x3a260a;if(_0x492613[_0x8f01('0x43')][_0x8f01('0x59')]){_0xd99a58[_0x8f01('0x54')]=[{'all':!![]}];}return db[_0x8f01('0xa4')]['findAll'](_0xd99a58);})[_0x8f01('0x1c')](function(_0x128e1e){_0x4ef8da[_0x8f01('0x56')]=_0x128e1e;return _0x4ef8da;});}})[_0x8f01('0x1c')](respondWithFilteredResult(_0x33dd4b,_0xd99a58))[_0x8f01('0x57')](handleError(_0x33dd4b,null));};exports['send']=function(_0x3349df,_0x55f59e,_0x38b9dc){var _0x2163c6,_0x31c59b={},_0x298739;if(_0x3349df[_0x8f01('0x63')]['to']){_0x298739=_0x3349df[_0x8f01('0x63')]['to'][0x0];}return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x3349df[_0x8f01('0x58')]['id']},'include':[{'model':db[_0x8f01('0xa9')],'as':_0x8f01('0xaa'),'include':[{'model':db['CmContact'],'as':_0x8f01('0xab'),'where':{'fax':_0x298739},'limit':0x1,'order':[['updatedAt',_0x8f01('0xac')]]}]}]})['then'](handleEntityNotFound(_0x55f59e,null))[_0x8f01('0x1c')](function(_0x49bf0d){_0x2163c6=_0x49bf0d;if(_0x3349df[_0x8f01('0x63')]['attachments']&&_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')]['length']){for(var _0x380423=0x0;_0x380423<_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][_0x8f01('0x49')];_0x380423+=0x1){_0x3349df[_0x8f01('0x63')]['attachments'][_0x380423]={'filename':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][_0x380423]['name'],'id':_0x3349df[_0x8f01('0x63')]['attachments'][_0x380423]['id'],'path':path[_0x8f01('0xae')](config['root'],_0x8f01('0xaf'),_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][_0x380423][_0x8f01('0xb0')])};}}return respondWithRpcPromise(_0x8f01('0xb1'),_0x8f01('0xb1'),{'FaxAccountId':_[_0x8f01('0xb2')](_0x3349df['params']['id'])?undefined:_0x3349df[_0x8f01('0x58')]['id'],'path':_[_0x8f01('0xb2')](_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0][_0x8f01('0x9')])?undefined:_0x3349df[_0x8f01('0x63')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x3349df[_0x8f01('0x63')]['to'][0x0])?undefined:_0x3349df[_0x8f01('0x63')]['to'][0x0]},client9002);})[_0x8f01('0x1c')](function(){if(_0x2163c6){if(_['isNil'](_0x3349df['body']['from'])){_0x3349df[_0x8f01('0x63')][_0x8f01('0xb3')]=util[_0x8f01('0xa7')](_0x8f01('0xb4'),_0x2163c6['name'],_0x2163c6[_0x8f01('0xb5')]);}if(_0x2163c6['List']){if(_0x2163c6[_0x8f01('0xaa')][_0x8f01('0xab')]['length']){return _0x2163c6['List'][_0x8f01('0xab')][0x0];}else{return db[_0x8f01('0x74')]['create'](_[_0x8f01('0xb6')](_0x3349df[_0x8f01('0x63')],{'firstName':_0x3349df[_0x8f01('0x63')]['to'][0x0],'phone':_0x3349df['body']['to'][0x0],'fax':_0x3349df[_0x8f01('0x63')]['to'][0x0],'ListId':_0x2163c6[_0x8f01('0xa2')]}));}}else{throw new Error(_0x8f01('0xb7'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x8f01('0x1c')](function(_0x577d2d){if(_0x577d2d){return db['FaxInteraction']['find']({'where':{'ContactId':_0x577d2d['id'],'closed':![],'FaxAccountId':_0x2163c6['id']}})[_0x8f01('0x1c')](function(_0x320784){if(_0x320784){return[_0x320784,![]];}return db[_0x8f01('0x71')][_0x8f01('0x5b')]({'UserId':_0x3349df[_0x8f01('0x5c')]['id'],'ContactId':_0x577d2d['id'],'FaxAccountId':_0x2163c6['id'],'fax':_0x3349df[_0x8f01('0x63')]['to'][0x0],'firstMsgDirection':_0x8f01('0xb8'),'Messages':[_[_0x8f01('0x50')](_0x3349df[_0x8f01('0x63')],{'read':![],'body':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0][_0x8f01('0xb9')],'FaxAccountId':_0x2163c6['id'],'UserId':_0x3349df[_0x8f01('0x5c')]['id'],'ContactId':_0x577d2d['id'],'AttachmentId':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x8f01('0xba')}]})['then'](function(_0x5699dd){return[_0x5699dd,!![]];});});}else{throw new Error(_0x8f01('0xbb'));}})[_0x8f01('0xbc')](function(_0x2abdbf,_0x197229){if(_0x197229){return _0x2abdbf;}return db[_0x8f01('0xa4')][_0x8f01('0x5b')]({'direction':_0x8f01('0xb8'),'read':![],'body':_0x3349df['body'][_0x8f01('0xad')][0x0][_0x8f01('0xb9')],'FaxAccountId':_0x2163c6['id'],'FaxInteractionId':_0x2abdbf['id'],'UserId':_0x3349df[_0x8f01('0x5c')]['id'],'ContactId':_0x2abdbf['ContactId'],'AttachmentId':_0x3349df['body'][_0x8f01('0xad')][0x0]['id']})[_0x8f01('0x1c')](function(_0x181f25){_0x2abdbf['dataValues'][_0x8f01('0xba')]=[];_0x2abdbf[_0x8f01('0xbd')][_0x8f01('0xba')][_0x8f01('0x98')](_0x181f25[_0x8f01('0xbd')]);return _0x2abdbf;});})[_0x8f01('0x1c')](function(_0x14215b){respondWithRpcPromise(_0x8f01('0xbe'),'SendFax',{'FaxAccountId':_[_0x8f01('0xb2')](_0x3349df[_0x8f01('0x58')]['id'])?undefined:_0x3349df[_0x8f01('0x58')]['id'],'path':_[_0x8f01('0xb2')](_0x3349df['body'][_0x8f01('0xad')][0x0][_0x8f01('0x9')])?undefined:_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0][_0x8f01('0x9')],'fax':_[_0x8f01('0xb2')](_0x3349df['body']['to'][0x0])?undefined:_0x3349df[_0x8f01('0x63')]['to'][0x0],'AttachmentId':_0x3349df[_0x8f01('0x63')][_0x8f01('0xad')][0x0]['id']},client9002)[_0x8f01('0x1c')](function(_0x42a274){logger[_0x8f01('0x24')]('SendFaxRpc,\x20%s',_0x42a274);})[_0x8f01('0x57')](function(_0x5c2cff){logger[_0x8f01('0x24')](_0x8f01('0xbf'),_0x5c2cff);});return _0x14215b;})[_0x8f01('0x1c')](respondWithResult(_0x55f59e,null))[_0x8f01('0x57')](handleError(_0x55f59e,null));};exports[_0x8f01('0xc0')]=function(_0x40c5dc,_0x235d09,_0xece595){return db['FaxAccount'][_0x8f01('0x5a')]({'where':{'id':_0x40c5dc['params']['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x235d09,null))[_0x8f01('0x1c')](function(_0x2c138b){if(_0x2c138b){return _0x2c138b[_0x8f01('0xc0')](_0x40c5dc[_0x8f01('0x63')][_0x8f01('0x6b')],_[_0x8f01('0x72')](_0x40c5dc[_0x8f01('0x63')],[_0x8f01('0x6b'),'id'])||{})[_0x8f01('0xbc')](function(_0x8ae6d3){for(var _0x23aa33=0x0;_0x23aa33<_0x40c5dc[_0x8f01('0x63')]['ids'][_0x8f01('0x49')];_0x23aa33+=0x1){socket[_0x8f01('0xc1')](_0x8f01('0xc2'),{'UserId':Number(_0x40c5dc[_0x8f01('0x63')]['ids'][_0x23aa33]),'FaxAccountId':Number(_0x40c5dc[_0x8f01('0x58')]['id'])});}return _0x8ae6d3;});}})['then'](respondWithResult(_0x235d09,null))[_0x8f01('0x57')](handleError(_0x235d09,null));};exports[_0x8f01('0xc3')]=function(_0x2d3933,_0x39cb7e,_0xc18d14){return db[_0x8f01('0x3d')][_0x8f01('0x5a')]({'where':{'id':_0x2d3933[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x39cb7e,null))[_0x8f01('0x1c')](function(_0x1a1346){if(_0x1a1346){return _0x1a1346[_0x8f01('0xc3')](_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')])['then'](function(){if(_['isArray'](_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')])){for(var _0x1204e7=0x0;_0x1204e7<_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')][_0x8f01('0x49')];_0x1204e7+=0x1){socket[_0x8f01('0xc1')](_0x8f01('0xc4'),{'UserId':Number(_0x2d3933[_0x8f01('0x43')]['ids'][_0x1204e7]),'FaxAccountId':Number(_0x2d3933['params']['id'])});}}else{socket[_0x8f01('0xc1')](_0x8f01('0xc4'),{'UserId':Number(_0x2d3933[_0x8f01('0x43')][_0x8f01('0x6b')]),'FaxAccountId':Number(_0x2d3933['params']['id'])});}});}})[_0x8f01('0x1c')](respondWithStatusCode(_0x39cb7e,null))[_0x8f01('0x57')](handleError(_0x39cb7e,null));};exports['getAgents']=function(_0x849599,_0x58060a,_0x4bf43c){var _0x192b38={};var _0x1eb3e3={};var _0x3be5f7;var _0x378a65;return db[_0x8f01('0x3d')][_0x8f01('0x69')]({'where':{'id':_0x849599[_0x8f01('0x58')]['id']}})[_0x8f01('0x1c')](handleEntityNotFound(_0x58060a,null))[_0x8f01('0x1c')](function(_0x22f0c3){if(_0x22f0c3){_0x3be5f7=_0x22f0c3;_0x1eb3e3[_0x8f01('0x42')]=_[_0x8f01('0x44')](db['User'][_0x8f01('0x3e')]);_0x1eb3e3['query']=_['keys'](_0x849599[_0x8f01('0x43')]);_0x1eb3e3[_0x8f01('0x45')]=_[_0x8f01('0x46')](_0x1eb3e3[_0x8f01('0x42')],_0x1eb3e3[_0x8f01('0x43')]);_0x192b38[_0x8f01('0x47')]=_[_0x8f01('0x46')](_0x1eb3e3[_0x8f01('0x42')],qs['fields'](_0x849599[_0x8f01('0x43')][_0x8f01('0x48')]));_0x192b38['attributes']=_0x192b38['attributes'][_0x8f01('0x49')]?_0x192b38['attributes']:_0x1eb3e3[_0x8f01('0x42')];_0x192b38[_0x8f01('0x4c')]=qs[_0x8f01('0x4d')](_0x849599[_0x8f01('0x43')][_0x8f01('0x4d')]);_0x192b38['where']=qs[_0x8f01('0x45')](_[_0x8f01('0x4f')](_0x849599[_0x8f01('0x43')],_0x1eb3e3[_0x8f01('0x45')]));if(_0x849599[_0x8f01('0x43')][_0x8f01('0x52')]){_0x192b38[_0x8f01('0x4e')]=_[_0x8f01('0x50')](_0x192b38['where'],{'$or':_[_0x8f01('0x3c')](_0x192b38[_0x8f01('0x47')],function(_0x508de3){var _0x414f80={};_0x414f80[_0x508de3]={'$like':'%'+_0x849599[_0x8f01('0x43')][_0x8f01('0x52')]+'%'};return _0x414f80;})});}_0x192b38=_[_0x8f01('0x50')]({},_0x192b38,_0x849599[_0x8f01('0x53')]);return _0x3be5f7[_0x8f01('0xc5')](_0x192b38);}})[_0x8f01('0x1c')](function(_0x57cce4){if(_0x57cce4){_0x378a65=_0x57cce4[_0x8f01('0x49')];if(!_0x849599[_0x8f01('0x43')][_0x8f01('0x4a')](_0x8f01('0x4b'))){_0x192b38['limit']=qs[_0x8f01('0x2a')](_0x849599['query'][_0x8f01('0x2a')]);_0x192b38['offset']=qs[_0x8f01('0x28')](_0x849599[_0x8f01('0x43')][_0x8f01('0x28')]);}return _0x3be5f7[_0x8f01('0xc5')](_0x192b38);}})[_0x8f01('0x1c')](function(_0x1e26ff){if(_0x1e26ff){return _0x1e26ff?{'count':_0x378a65,'rows':_0x1e26ff}:null;}})[_0x8f01('0x1c')](respondWithResult(_0x58060a,null))[_0x8f01('0x57')](handleError(_0x58060a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 08b8d8c..730a86a 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 _0x1b31=['remove','emit','exports','events','FaxAccount'];(function(_0x4f2c56,_0xf7c9a7){var _0x45d8b9=function(_0x354aaa){while(--_0x354aaa){_0x4f2c56['push'](_0x4f2c56['shift']());}};_0x45d8b9(++_0xf7c9a7);}(_0x1b31,0x8f));var _0x11b3=function(_0x3af2c4,_0x4c13ef){_0x3af2c4=_0x3af2c4-0x0;var _0x131495=_0x1b31[_0x3af2c4];return _0x131495;};'use strict';var EventEmitter=require(_0x11b3('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x11b3('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x11b3('0x2')};function emitEvent(_0xee2438){return function(_0x1cbea8,_0x170791,_0xcd793e){FaxAccountEvents[_0x11b3('0x3')](_0xee2438+':'+_0x1cbea8['id'],_0x1cbea8);FaxAccountEvents['emit'](_0xee2438,_0x1cbea8);_0xcd793e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x11b3('0x4')]=FaxAccountEvents; \ No newline at end of file +var _0x7dd1=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x16a344,_0x43dc6c){var _0x24f848=function(_0x23c39a){while(--_0x23c39a){_0x16a344['push'](_0x16a344['shift']());}};_0x24f848(++_0x43dc6c);}(_0x7dd1,0x169));var _0x17dd=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x7dd1[_0x13b8f3];return _0x1a6d06;};'use strict';var EventEmitter=require(_0x17dd('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x17dd('0x1')](0x0);var events={'afterCreate':_0x17dd('0x2'),'afterUpdate':_0x17dd('0x3'),'afterDestroy':_0x17dd('0x4')};function emitEvent(_0x2377db){return function(_0x37b575,_0x575802,_0x553579){FaxAccountEvents[_0x17dd('0x5')](_0x2377db+':'+_0x37b575['id'],_0x37b575);FaxAccountEvents['emit'](_0x2377db,_0x37b575);_0x553579(null);};}for(var e in events){if(events[_0x17dd('0x6')](e)){var event=events[e];FaxAccount[_0x17dd('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index d73d452..d3d0afe 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 _0x0059=['FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0x0059,0x10c));var _0x9005=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x0059[_0x3e21f4];return _0x40fc49;};'use strict';var _=require(_0x9005('0x0'));var util=require(_0x9005('0x1'));var logger=require(_0x9005('0x2'))(_0x9005('0x3'));var moment=require(_0x9005('0x4'));var BPromise=require(_0x9005('0x5'));var rp=require(_0x9005('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9005('0x7'));var config=require(_0x9005('0x8'));var attributes=require(_0x9005('0x9'));module[_0x9005('0xa')]=function(_0x48d20b,_0x3b58b0){return _0x48d20b[_0x9005('0xb')](_0x9005('0xc'),attributes,{'tableName':_0x9005('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6073=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x6073,0x1ec));var _0x3607=function(_0x4fd9e6,_0x21a10d){_0x4fd9e6=_0x4fd9e6-0x0;var _0x1937a7=_0x6073[_0x4fd9e6];return _0x1937a7;};'use strict';var _=require(_0x3607('0x0'));var util=require(_0x3607('0x1'));var logger=require(_0x3607('0x2'))(_0x3607('0x3'));var moment=require(_0x3607('0x4'));var BPromise=require(_0x3607('0x5'));var rp=require(_0x3607('0x6'));var fs=require('fs');var path=require(_0x3607('0x7'));var rimraf=require('rimraf');var config=require(_0x3607('0x8'));var attributes=require(_0x3607('0x9'));module['exports']=function(_0x43d22d,_0x46b07b){return _0x43d22d[_0x3607('0xa')](_0x3607('0xb'),attributes,{'tableName':_0x3607('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index b6d48f5..19309f4 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 _0x0d37=['created','ContactId','AttachmentId','interaction','User','unshift','name','waitForTheAssignedAgent','queueId','FaxQueue','waitForTheAssignedQueue','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','debug','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','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','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','asc','length','CmContact','create','contact','FaxInteraction','Contact\x20not\x20found','*,*,*,*'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0d37,0xc9));var _0x70d3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0d37[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x70d3('0x0'));var util=require('util');var moment=require(_0x70d3('0x1'));var BPromise=require(_0x70d3('0x2'));var rs=require(_0x70d3('0x3'));var fs=require('fs');var Redis=require(_0x70d3('0x4'));var db=require(_0x70d3('0x5'))['db'];var utils=require(_0x70d3('0x6'));var logger=require('../../config/logger')(_0x70d3('0x7'));var config=require(_0x70d3('0x8'));var jayson=require(_0x70d3('0x9'));var client=jayson[_0x70d3('0xa')][_0x70d3('0xb')]({'port':0x232c});config[_0x70d3('0xc')]=_[_0x70d3('0xd')](config[_0x70d3('0xc')],{'host':_0x70d3('0xe'),'port':0x18eb});var socket=require(_0x70d3('0xf'))(new Redis(config[_0x70d3('0xc')]));require(_0x70d3('0x10'))[_0x70d3('0x11')](socket);function respondWithRpcPromise(_0x2c6710,_0x36b3b6,_0xdd5b43){return new BPromise(function(_0x18dc5b,_0xc1f73c){return client[_0x70d3('0x12')](_0x2c6710,_0xdd5b43)[_0x70d3('0x13')](function(_0x5eb9d0){logger[_0x70d3('0x14')](_0x70d3('0x15'),_0x36b3b6,'request\x20sent');logger['debug'](_0x70d3('0x16'),_0x36b3b6,'request\x20sent',JSON[_0x70d3('0x17')](_0x5eb9d0));if(_0x5eb9d0['error']){if(_0x5eb9d0[_0x70d3('0x18')][_0x70d3('0x19')]===0x1f4){logger['error'](_0x70d3('0x15'),_0x36b3b6,_0x5eb9d0[_0x70d3('0x18')]['message']);return _0xc1f73c(_0x5eb9d0['error'][_0x70d3('0x1a')]);}logger[_0x70d3('0x18')](_0x70d3('0x15'),_0x36b3b6,_0x5eb9d0[_0x70d3('0x18')][_0x70d3('0x1a')]);return _0x18dc5b(_0x5eb9d0[_0x70d3('0x18')][_0x70d3('0x1a')]);}else{logger[_0x70d3('0x14')](_0x70d3('0x15'),_0x36b3b6,_0x70d3('0x1b'));_0x18dc5b(_0x5eb9d0['result'][_0x70d3('0x1a')]);}})[_0x70d3('0x1c')](function(_0x60b817){logger[_0x70d3('0x18')]('FaxAccount,\x20%s,\x20%s',_0x36b3b6,_0x60b817);_0xc1f73c(_0x60b817);});});}exports[_0x70d3('0x1d')]=function(_0x3fc04d){var _0x5062fc=this;return new Promise(function(_0x156024,_0x2af603){return db[_0x70d3('0x1e')][_0x70d3('0x1f')]({'raw':_0x3fc04d[_0x70d3('0x20')]?_0x3fc04d[_0x70d3('0x20')][_0x70d3('0x21')]===undefined?!![]:![]:!![],'where':_0x3fc04d[_0x70d3('0x20')]?_0x3fc04d['options'][_0x70d3('0x22')]||null:null,'attributes':_0x3fc04d[_0x70d3('0x20')]?_0x3fc04d[_0x70d3('0x20')][_0x70d3('0x23')]||null:null,'limit':_0x3fc04d[_0x70d3('0x20')]?_0x3fc04d[_0x70d3('0x20')]['limit']||null:null,'include':_0x3fc04d[_0x70d3('0x20')]?_0x3fc04d[_0x70d3('0x20')][_0x70d3('0x24')]?_[_0x70d3('0x25')](_0x3fc04d[_0x70d3('0x20')][_0x70d3('0x24')],function(_0x30e2c3){return{'model':db[_0x30e2c3[_0x70d3('0x26')]],'as':_0x30e2c3['as'],'attributes':_0x30e2c3['attributes'],'include':_0x30e2c3[_0x70d3('0x24')]?_[_0x70d3('0x25')](_0x30e2c3[_0x70d3('0x24')],function(_0x39c26d){return{'model':db[_0x39c26d[_0x70d3('0x26')]],'as':_0x39c26d['as'],'attributes':_0x39c26d[_0x70d3('0x23')],'include':_0x39c26d[_0x70d3('0x24')]?_['map'](_0x39c26d['include'],function(_0xdb4644){return{'model':db[_0xdb4644[_0x70d3('0x26')]],'as':_0xdb4644['as'],'attributes':_0xdb4644[_0x70d3('0x23')]};}):[]};}):[]};}):[]:[]})[_0x70d3('0x13')](function(_0x4de122){logger[_0x70d3('0x14')](_0x70d3('0x1d'),_0x3fc04d);logger[_0x70d3('0x27')](_0x70d3('0x1d'),_0x3fc04d,JSON[_0x70d3('0x17')](_0x4de122));_0x156024(_0x4de122);})['catch'](function(_0x25d56c){logger['error'](_0x70d3('0x1d'),_0x25d56c[_0x70d3('0x1a')],_0x3fc04d);_0x2af603(_0x5062fc[_0x70d3('0x18')](0x1f4,_0x25d56c[_0x70d3('0x1a')]));});});};exports[_0x70d3('0x28')]=function(_0x122687,_0x4c5341,_0x5f1de2){var _0x375b5f=this;return new Promise(function(_0x3c02e7,_0x3e2836){var _0x57cb35={'body':_0x122687[_0x70d3('0x29')],'channel':_0x70d3('0x2a')};var _0x173f5b=[];var _0x55adec=[];var _0x1504d8={};return db['CmContact'][_0x70d3('0x2b')]()['then'](function(_0x5a4628){if(!_0x5a4628){throw new db[(_0x70d3('0x2c'))][(_0x70d3('0x2d'))](_0x70d3('0x2e'));}_0x173f5b=_[_0x70d3('0x2f')](_[_0x70d3('0x30')](_0x5a4628),[_0x70d3('0x31'),_0x70d3('0x32')]);_0x55adec=_[_0x70d3('0x2f')](_[_0x70d3('0x30')](_0x5a4628),[_0x70d3('0x31'),_0x70d3('0x32'),_0x70d3('0x33'),_0x70d3('0x34')]);if(_0x122687['body']['id']){delete _0x122687[_0x70d3('0x29')]['id'];}if(_[_0x70d3('0x35')](_0x122687[_0x70d3('0x29')][_0x70d3('0x36')])){throw new db['Sequelize'][(_0x70d3('0x2d'))](_0x70d3('0x37'));}if(_[_0x70d3('0x35')](_0x122687['body']['body'])||_0x122687[_0x70d3('0x29')][_0x70d3('0x29')]===''){throw new db[(_0x70d3('0x2c'))][(_0x70d3('0x2d'))](_0x70d3('0x38'));}if(_['isNil'](_0x122687['body'][_0x70d3('0x39')])){throw new db[(_0x70d3('0x2c'))]['ValidationError'](_0x70d3('0x3a')+_0x55adec);}if(!_[_0x70d3('0x3b')](_0x55adec,_0x122687['body'][_0x70d3('0x39')])){throw new db[(_0x70d3('0x2c'))][(_0x70d3('0x2d'))](_0x70d3('0x3c')+_0x55adec);}_0x1504d8[_0x122687[_0x70d3('0x29')][_0x70d3('0x39')]]=_0x122687[_0x70d3('0x29')][_0x70d3('0x36')];})[_0x70d3('0x13')](function(){return db[_0x70d3('0x1e')][_0x70d3('0x3d')]({'where':{'id':_0x122687[_0x70d3('0x3e')]['id']},'include':[{'model':db[_0x70d3('0x3f')],'as':_0x70d3('0x40'),'include':[{'model':db['CmContact'],'as':_0x70d3('0x41'),'where':_0x1504d8,'limit':0x1,'order':[[_0x70d3('0x32'),_0x70d3('0x42')]]}]},{'model':db[_0x70d3('0x43')],'as':_0x70d3('0x44')}]});})[_0x70d3('0x13')](function(_0x15b28b){if(_0x15b28b&&_0x15b28b[_0x70d3('0x40')]){var _0xbc63b1=_0x15b28b[_0x70d3('0x45')]({'plain':!![]});_0x57cb35['account']=_0xbc63b1;_0x57cb35[_0x70d3('0x46')]=_0xbc63b1['Applications'];_0x57cb35[_0x70d3('0x47')]=_0xbc63b1['List'];_0x57cb35[_0x70d3('0x46')]=_[_0x70d3('0x48')](_0x57cb35[_0x70d3('0x46')],['priority'],[_0x70d3('0x49')]);if(_0x57cb35[_0x70d3('0x3e')]['Applications']){delete _0x57cb35[_0x70d3('0x3e')][_0x70d3('0x44')];}if(_0x57cb35[_0x70d3('0x3e')][_0x70d3('0x40')]&&_0x57cb35[_0x70d3('0x3e')][_0x70d3('0x40')][_0x70d3('0x41')][_0x70d3('0x4a')]){return _0x57cb35[_0x70d3('0x3e')]['List'][_0x70d3('0x41')][0x0];}var _0x5946ff=_[_0x70d3('0xd')](_0x122687['body'],{'firstName':_0x122687['body']['from'],'ListId':_0xbc63b1[_0x70d3('0x34')]});_0x5946ff[_0x122687[_0x70d3('0x29')][_0x70d3('0x39')]]=_0x122687['body'][_0x70d3('0x36')];return db[_0x70d3('0x4b')][_0x70d3('0x4c')](_0x5946ff,{'fields':_0x173f5b,'raw':!![]});}})[_0x70d3('0x13')](function(_0x1ecd6e){_0x57cb35[_0x70d3('0x4d')]=_0x1ecd6e;if(_0x1ecd6e){var _0x521c2f={'ContactId':_0x1ecd6e['id'],'FaxAccountId':_0x122687['account']['id'],'fax':_0x1ecd6e[_0x70d3('0x2a')]};return db[_0x70d3('0x4e')]['find']({'where':{'ContactId':_0x1ecd6e['id'],'closed':![],'FaxAccountId':_0x122687['account']['id']}})[_0x70d3('0x13')](function(_0x1941d6){if(_0x1941d6){return[_0x1941d6,![]];}return db[_0x70d3('0x4e')][_0x70d3('0x4c')](_0x521c2f)['then'](function(_0x4af17f){return[_0x4af17f,!![]];});});}else{throw new Error(_0x70d3('0x4f'));}})['spread'](function(_0x2927e1,_0x59620f){var _0x5959fe=_0x2927e1[_0x70d3('0x45')]({'plain':!![]});if(_0x59620f){if(_0x57cb35[_0x70d3('0x3e')]['autoclose']){_0x57cb35[_0x70d3('0x46')]['push']({'id':0x0,'priority':_0x57cb35[_0x70d3('0x46')][_0x70d3('0x4a')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x70d3('0x50')});}_0x5959fe['created']=!![];}else{_0x5959fe[_0x70d3('0x51')]=![];}_0x57cb35['interaction']=_0x5959fe;return db['FaxMessage'][_0x70d3('0x4c')]({'body':_0x122687['body'][_0x70d3('0x29')],'FaxAccountId':_0x122687['account']['id'],'FaxInteractionId':_0x2927e1['id'],'direction':'in','ContactId':_0x2927e1[_0x70d3('0x52')],'AttachmentId':_0x122687[_0x70d3('0x29')][_0x70d3('0x53')]});})[_0x70d3('0x13')](function(_0x25d886){_0x57cb35['message']=_0x25d886;if(!_0x57cb35[_0x70d3('0x54')]['UserId'])return;return db[_0x70d3('0x55')][_0x70d3('0x3d')]({'attributes':['id','name'],'where':{'id':_0x57cb35['interaction']['UserId']}});})['then'](function(_0x153809){if(_0x153809){_0x57cb35[_0x70d3('0x46')][_0x70d3('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x153809[_0x70d3('0x57')]+','+(_0x57cb35[_0x70d3('0x3e')][_0x70d3('0x58')]||0xa),'interval':_0x70d3('0x50')});}if(!_0x57cb35[_0x70d3('0x54')][_0x70d3('0x59')])return;return db[_0x70d3('0x5a')][_0x70d3('0x3d')]({'attributes':['id',_0x70d3('0x57')],'where':{'id':_0x57cb35['interaction']['queueId']}});})['then'](function(_0x421b75){if(_0x421b75){_0x57cb35[_0x70d3('0x46')][_0x70d3('0x56')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x421b75['name']+','+(_0x57cb35['account'][_0x70d3('0x5b')]||0x12c),'interval':_0x70d3('0x50')});}return respondWithRpcPromise(_0x70d3('0x5c'),_0x70d3('0x5d'),_0x57cb35);})[_0x70d3('0x13')](function(_0x37c3d7){_0x3c02e7(_0x37c3d7);})[_0x70d3('0x1c')](function(_0x2ecf3e){_0x3e2836(_0x375b5f['error'](0x1f4,_0x2ecf3e[_0x70d3('0x1a')]));});});}; \ No newline at end of file +var _0x68d4=['push','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','include','model','debug','stringify','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','find','CmList','List','DESC','FaxApplication','Applications','get','applications','list','priority','asc','account','Contacts','length','create','contact','FaxInteraction','autoclose'];(function(_0x1f2161,_0x485b11){var _0xa9ea62=function(_0x41dad7){while(--_0x41dad7){_0x1f2161['push'](_0x1f2161['shift']());}};_0xa9ea62(++_0x485b11);}(_0x68d4,0x1c9));var _0x468d=function(_0x35e7f5,_0x505458){_0x35e7f5=_0x35e7f5-0x0;var _0x21327e=_0x68d4[_0x35e7f5];return _0x21327e;};'use strict';var _=require(_0x468d('0x0'));var util=require('util');var moment=require(_0x468d('0x1'));var BPromise=require('bluebird');var rs=require(_0x468d('0x2'));var fs=require('fs');var Redis=require(_0x468d('0x3'));var db=require(_0x468d('0x4'))['db'];var utils=require(_0x468d('0x5'));var logger=require(_0x468d('0x6'))('rpc');var config=require(_0x468d('0x7'));var jayson=require(_0x468d('0x8'));var client=jayson[_0x468d('0x9')][_0x468d('0xa')]({'port':0x232c});config['redis']=_[_0x468d('0xb')](config[_0x468d('0xc')],{'host':_0x468d('0xd'),'port':0x18eb});var socket=require(_0x468d('0xe'))(new Redis(config[_0x468d('0xc')]));require(_0x468d('0xf'))[_0x468d('0x10')](socket);function respondWithRpcPromise(_0x3333fa,_0x1e9f63,_0x511d12){return new BPromise(function(_0x2f0154,_0x333cdd){return client[_0x468d('0x11')](_0x3333fa,_0x511d12)[_0x468d('0x12')](function(_0x4eed77){logger[_0x468d('0x13')]('FaxAccount,\x20%s,\x20%s',_0x1e9f63,_0x468d('0x14'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1e9f63,_0x468d('0x14'),JSON['stringify'](_0x4eed77));if(_0x4eed77[_0x468d('0x15')]){if(_0x4eed77['error'][_0x468d('0x16')]===0x1f4){logger[_0x468d('0x15')](_0x468d('0x17'),_0x1e9f63,_0x4eed77[_0x468d('0x15')][_0x468d('0x18')]);return _0x333cdd(_0x4eed77['error']['message']);}logger['error'](_0x468d('0x17'),_0x1e9f63,_0x4eed77[_0x468d('0x15')][_0x468d('0x18')]);return _0x2f0154(_0x4eed77['error'][_0x468d('0x18')]);}else{logger[_0x468d('0x13')](_0x468d('0x17'),_0x1e9f63,_0x468d('0x14'));_0x2f0154(_0x4eed77['result'][_0x468d('0x18')]);}})[_0x468d('0x19')](function(_0x1f30ce){logger[_0x468d('0x15')](_0x468d('0x17'),_0x1e9f63,_0x1f30ce);_0x333cdd(_0x1f30ce);});});}exports[_0x468d('0x1a')]=function(_0x2cdaed){var _0x2f9341=this;return new Promise(function(_0x886ca2,_0x5fd863){return db[_0x468d('0x1b')][_0x468d('0x1c')]({'raw':_0x2cdaed['options']?_0x2cdaed[_0x468d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed['options'][_0x468d('0x1e')]||null:null,'attributes':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed[_0x468d('0x1d')][_0x468d('0x1f')]||null:null,'limit':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed['options']['limit']||null:null,'include':_0x2cdaed[_0x468d('0x1d')]?_0x2cdaed['options'][_0x468d('0x20')]?_['map'](_0x2cdaed[_0x468d('0x1d')]['include'],function(_0x3e74e8){return{'model':db[_0x3e74e8[_0x468d('0x21')]],'as':_0x3e74e8['as'],'attributes':_0x3e74e8[_0x468d('0x1f')],'include':_0x3e74e8[_0x468d('0x20')]?_['map'](_0x3e74e8[_0x468d('0x20')],function(_0x40e7ab){return{'model':db[_0x40e7ab['model']],'as':_0x40e7ab['as'],'attributes':_0x40e7ab[_0x468d('0x1f')],'include':_0x40e7ab['include']?_['map'](_0x40e7ab[_0x468d('0x20')],function(_0xab7d86){return{'model':db[_0xab7d86[_0x468d('0x21')]],'as':_0xab7d86['as'],'attributes':_0xab7d86[_0x468d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x468d('0x12')](function(_0x1d137c){logger[_0x468d('0x13')](_0x468d('0x1a'),_0x2cdaed);logger[_0x468d('0x22')](_0x468d('0x1a'),_0x2cdaed,JSON[_0x468d('0x23')](_0x1d137c));_0x886ca2(_0x1d137c);})[_0x468d('0x19')](function(_0x36dffc){logger[_0x468d('0x15')](_0x468d('0x1a'),_0x36dffc[_0x468d('0x18')],_0x2cdaed);_0x5fd863(_0x2f9341[_0x468d('0x15')](0x1f4,_0x36dffc[_0x468d('0x18')]));});});};exports['NotifyFaxAccount']=function(_0xa33333,_0x380be5,_0x53e942){var _0xef3f7=this;return new Promise(function(_0x671b4a,_0x5f2fae){var _0x3ac648={'body':_0xa33333['body'],'channel':_0x468d('0x24')};var _0x167928=[];var _0x19b00e=[];var _0x1e69c5={};return db[_0x468d('0x25')][_0x468d('0x26')]()[_0x468d('0x12')](function(_0x3a161b){if(!_0x3a161b){throw new db[(_0x468d('0x27'))][(_0x468d('0x28'))]('no\x20available\x20attributes');}_0x167928=_[_0x468d('0x29')](_[_0x468d('0x2a')](_0x3a161b),[_0x468d('0x2b'),_0x468d('0x2c')]);_0x19b00e=_[_0x468d('0x29')](_[_0x468d('0x2a')](_0x3a161b),[_0x468d('0x2b'),_0x468d('0x2c'),'CompanyId',_0x468d('0x2d')]);if(_0xa33333[_0x468d('0x2e')]['id']){delete _0xa33333[_0x468d('0x2e')]['id'];}if(_[_0x468d('0x2f')](_0xa33333['body'][_0x468d('0x30')])){throw new db[(_0x468d('0x27'))][(_0x468d('0x28'))](_0x468d('0x31'));}if(_[_0x468d('0x2f')](_0xa33333[_0x468d('0x2e')][_0x468d('0x2e')])||_0xa33333[_0x468d('0x2e')]['body']===''){throw new db[(_0x468d('0x27'))]['ValidationError'](_0x468d('0x32'));}if(_['isNil'](_0xa33333[_0x468d('0x2e')][_0x468d('0x33')])){throw new db['Sequelize'][(_0x468d('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19b00e);}if(!_[_0x468d('0x34')](_0x19b00e,_0xa33333['body']['mapKey'])){throw new db[(_0x468d('0x27'))][(_0x468d('0x28'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19b00e);}_0x1e69c5[_0xa33333['body'][_0x468d('0x33')]]=_0xa33333['body'][_0x468d('0x30')];})[_0x468d('0x12')](function(){return db[_0x468d('0x1b')][_0x468d('0x35')]({'where':{'id':_0xa33333['account']['id']},'include':[{'model':db[_0x468d('0x36')],'as':_0x468d('0x37'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1e69c5,'limit':0x1,'order':[[_0x468d('0x2c'),_0x468d('0x38')]]}]},{'model':db[_0x468d('0x39')],'as':_0x468d('0x3a')}]});})[_0x468d('0x12')](function(_0x21a2d4){if(_0x21a2d4&&_0x21a2d4[_0x468d('0x37')]){var _0x46b689=_0x21a2d4[_0x468d('0x3b')]({'plain':!![]});_0x3ac648['account']=_0x46b689;_0x3ac648[_0x468d('0x3c')]=_0x46b689[_0x468d('0x3a')];_0x3ac648[_0x468d('0x3d')]=_0x46b689['List'];_0x3ac648[_0x468d('0x3c')]=_['orderBy'](_0x3ac648['applications'],[_0x468d('0x3e')],[_0x468d('0x3f')]);if(_0x3ac648[_0x468d('0x40')][_0x468d('0x3a')]){delete _0x3ac648[_0x468d('0x40')][_0x468d('0x3a')];}if(_0x3ac648[_0x468d('0x40')][_0x468d('0x37')]&&_0x3ac648['account'][_0x468d('0x37')][_0x468d('0x41')][_0x468d('0x42')]){return _0x3ac648[_0x468d('0x40')]['List'][_0x468d('0x41')][0x0];}var _0x3e9044=_[_0x468d('0xb')](_0xa33333[_0x468d('0x2e')],{'firstName':_0xa33333[_0x468d('0x2e')][_0x468d('0x30')],'ListId':_0x46b689[_0x468d('0x2d')]});_0x3e9044[_0xa33333[_0x468d('0x2e')][_0x468d('0x33')]]=_0xa33333[_0x468d('0x2e')][_0x468d('0x30')];return db['CmContact'][_0x468d('0x43')](_0x3e9044,{'fields':_0x167928,'raw':!![]});}})[_0x468d('0x12')](function(_0x5af039){_0x3ac648[_0x468d('0x44')]=_0x5af039;if(_0x5af039){var _0x130a3a={'ContactId':_0x5af039['id'],'FaxAccountId':_0xa33333[_0x468d('0x40')]['id'],'fax':_0x5af039['fax']};return db['FaxInteraction'][_0x468d('0x35')]({'where':{'ContactId':_0x5af039['id'],'closed':![],'FaxAccountId':_0xa33333[_0x468d('0x40')]['id']}})[_0x468d('0x12')](function(_0x1ff7ad){if(_0x1ff7ad){return[_0x1ff7ad,![]];}return db[_0x468d('0x45')][_0x468d('0x43')](_0x130a3a)[_0x468d('0x12')](function(_0x5ced9a){return[_0x5ced9a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x318ab0,_0x1c7741){var _0x52b39f=_0x318ab0[_0x468d('0x3b')]({'plain':!![]});if(_0x1c7741){if(_0x3ac648['account'][_0x468d('0x46')]){_0x3ac648[_0x468d('0x3c')][_0x468d('0x47')]({'id':0x0,'priority':_0x3ac648[_0x468d('0x3c')][_0x468d('0x42')]+0x1,'app':'close','appdata':_0x468d('0x48'),'interval':_0x468d('0x49')});}_0x52b39f[_0x468d('0x4a')]=!![];}else{_0x52b39f['created']=![];}_0x3ac648[_0x468d('0x4b')]=_0x52b39f;return db[_0x468d('0x4c')]['create']({'body':_0xa33333[_0x468d('0x2e')]['body'],'FaxAccountId':_0xa33333[_0x468d('0x40')]['id'],'FaxInteractionId':_0x318ab0['id'],'direction':'in','ContactId':_0x318ab0['ContactId'],'AttachmentId':_0xa33333['body'][_0x468d('0x4d')]});})[_0x468d('0x12')](function(_0x288b4e){_0x3ac648[_0x468d('0x18')]=_0x288b4e;if(!_0x3ac648[_0x468d('0x4b')][_0x468d('0x4e')])return;return db[_0x468d('0x4f')][_0x468d('0x35')]({'attributes':['id',_0x468d('0x50')],'where':{'id':_0x3ac648[_0x468d('0x4b')][_0x468d('0x4e')]}});})['then'](function(_0x189934){if(_0x189934){_0x3ac648[_0x468d('0x3c')][_0x468d('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x189934[_0x468d('0x50')]+','+(_0x3ac648[_0x468d('0x40')][_0x468d('0x52')]||0xa),'interval':_0x468d('0x49')});}if(!_0x3ac648[_0x468d('0x4b')][_0x468d('0x53')])return;return db[_0x468d('0x54')][_0x468d('0x35')]({'attributes':['id',_0x468d('0x50')],'where':{'id':_0x3ac648[_0x468d('0x4b')][_0x468d('0x53')]}});})[_0x468d('0x12')](function(_0x388115){if(_0x388115){_0x3ac648['applications'][_0x468d('0x51')]({'id':0x0,'priority':0x1,'app':_0x468d('0x55'),'appdata':_0x388115['name']+','+(_0x3ac648['account'][_0x468d('0x56')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x468d('0x57'),_0x3ac648);})[_0x468d('0x12')](function(_0x365815){_0x671b4a(_0x365815);})[_0x468d('0x19')](function(_0x152029){_0x5f2fae(_0xef3f7[_0x468d('0x15')](0x1f4,_0x152029[_0x468d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 39dbc06..6a5d9d0 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 _0x1649=['length','faxAccount:','./faxAccount.events','remove','update','register'];(function(_0x2e135a,_0x341b79){var _0x3d308f=function(_0x4e8f8c){while(--_0x4e8f8c){_0x2e135a['push'](_0x2e135a['shift']());}};_0x3d308f(++_0x341b79);}(_0x1649,0x7a));var _0x9164=function(_0x4f85a2,_0xd9bfb1){_0x4f85a2=_0x4f85a2-0x0;var _0x62e21b=_0x1649[_0x4f85a2];return _0x62e21b;};'use strict';var FaxAccountEvents=require(_0x9164('0x0'));var events=['save',_0x9164('0x1'),_0x9164('0x2')];function createListener(_0x248638,_0x8724c2){return function(_0x5ccce9){_0x8724c2['emit'](_0x248638,_0x5ccce9);};}function removeListener(_0x367774,_0xbac62e){return function(){FaxAccountEvents['removeListener'](_0x367774,_0xbac62e);};}exports[_0x9164('0x3')]=function(_0x24b570){for(var _0x18c0c3=0x0,_0xdba2a9=events[_0x9164('0x4')];_0x18c0c3<_0xdba2a9;_0x18c0c3++){var _0x25b7cb=events[_0x18c0c3];var _0x4290b3=createListener(_0x9164('0x5')+_0x25b7cb,_0x24b570);FaxAccountEvents['on'](_0x25b7cb,_0x4290b3);}}; \ No newline at end of file +var _0x23b2=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x50d1bf,_0x4fab8c){var _0x7d22b7=function(_0x17309d){while(--_0x17309d){_0x50d1bf['push'](_0x50d1bf['shift']());}};_0x7d22b7(++_0x4fab8c);}(_0x23b2,0x159));var _0x223b=function(_0x179142,_0x32596d){_0x179142=_0x179142-0x0;var _0x124a1f=_0x23b2[_0x179142];return _0x124a1f;};'use strict';var FaxAccountEvents=require(_0x223b('0x0'));var events=[_0x223b('0x1'),_0x223b('0x2'),_0x223b('0x3')];function createListener(_0x40633e,_0x443f16){return function(_0x27a38f){_0x443f16[_0x223b('0x4')](_0x40633e,_0x27a38f);};}function removeListener(_0x3c6d7c,_0x540685){return function(){FaxAccountEvents[_0x223b('0x5')](_0x3c6d7c,_0x540685);};}exports[_0x223b('0x6')]=function(_0x45b89c){for(var _0x238215=0x0,_0x2a64eb=events[_0x223b('0x7')];_0x238215<_0x2a64eb;_0x238215++){var _0x3c7afc=events[_0x238215];var _0x4351df=createListener(_0x223b('0x8')+_0x3c7afc,_0x45b89c);FaxAccountEvents['on'](_0x3c7afc,_0x4351df);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 5d47711..904747a 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 _0x4146=['/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','/:id','update','delete','destroy','removeDispositions','removeAgents','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getAnswers','/:id/interactions'];(function(_0x2a081b,_0x32183f){var _0x32e550=function(_0x2e33a6){while(--_0x2e33a6){_0x2a081b['push'](_0x2a081b['shift']());}};_0x32e550(++_0x32183f);}(_0x4146,0xb5));var _0x6414=function(_0x14707d,_0x5e3eca){_0x14707d=_0x14707d-0x0;var _0x3e1b4b=_0x4146[_0x14707d];return _0x3e1b4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6414('0x0'));var timeout=require(_0x6414('0x1'));var express=require(_0x6414('0x2'));var router=express['Router']();var fs_extra=require(_0x6414('0x3'));var auth=require(_0x6414('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x6414('0x5')]('/',auth[_0x6414('0x6')](),controller[_0x6414('0x7')]);router[_0x6414('0x5')](_0x6414('0x8'),auth['isAuthenticated'](),controller[_0x6414('0x9')]);router['get']('/:id',auth[_0x6414('0x6')](),controller[_0x6414('0xa')]);router[_0x6414('0x5')](_0x6414('0xb'),auth[_0x6414('0x6')](),controller['getDispositions']);router[_0x6414('0x5')]('/:id/canned_answers',auth[_0x6414('0x6')](),controller[_0x6414('0xc')]);router[_0x6414('0x5')](_0x6414('0xd'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x6414('0x5')](_0x6414('0xe'),auth[_0x6414('0x6')](),controller[_0x6414('0xf')]);router[_0x6414('0x5')](_0x6414('0x10'),auth[_0x6414('0x6')](),controller[_0x6414('0x11')]);router['get'](_0x6414('0x12'),auth[_0x6414('0x6')](),controller['getAgents']);router[_0x6414('0x13')]('/',auth[_0x6414('0x6')](),controller[_0x6414('0x14')]);router[_0x6414('0x13')](_0x6414('0xb'),auth[_0x6414('0x6')](),controller[_0x6414('0x15')]);router[_0x6414('0x13')](_0x6414('0x16'),auth[_0x6414('0x6')](),controller[_0x6414('0x17')]);router['post'](_0x6414('0xd'),auth[_0x6414('0x6')](),controller[_0x6414('0x18')]);router['post'](_0x6414('0xe'),auth[_0x6414('0x6')](),controller[_0x6414('0x19')]);router[_0x6414('0x13')](_0x6414('0x1a'),auth['isAuthenticated'](),controller[_0x6414('0x1b')]);router[_0x6414('0x13')](_0x6414('0x1c'),auth['isAuthenticated'](),controller[_0x6414('0x1d')]);router[_0x6414('0x13')](_0x6414('0x1e'),auth[_0x6414('0x6')](),controller[_0x6414('0x1f')]);router[_0x6414('0x13')](_0x6414('0x12'),auth['isAuthenticated'](),controller[_0x6414('0x20')]);router['put'](_0x6414('0x21'),auth[_0x6414('0x6')](),controller[_0x6414('0x22')]);router[_0x6414('0x23')](_0x6414('0x21'),auth[_0x6414('0x6')](),controller[_0x6414('0x24')]);router[_0x6414('0x23')](_0x6414('0xb'),auth[_0x6414('0x6')](),controller[_0x6414('0x25')]);router[_0x6414('0x23')](_0x6414('0x16'),auth[_0x6414('0x6')](),controller['removeAnswers']);router[_0x6414('0x23')]('/:id/users',auth[_0x6414('0x6')](),controller[_0x6414('0x26')]);module['exports']=router; \ No newline at end of file +var _0xa46a=['/:id/send','send','/:id/users','addAgents','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post','create','addDisposition','addAnswer','/:id/interactions','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications'];(function(_0x279f8c,_0x5544d2){var _0x34a987=function(_0x35cb9c){while(--_0x35cb9c){_0x279f8c['push'](_0x279f8c['shift']());}};_0x34a987(++_0x5544d2);}(_0xa46a,0x97));var _0xaa46=function(_0x474f02,_0x44c5af){_0x474f02=_0x474f02-0x0;var _0x47321d=_0xa46a[_0x474f02];return _0x47321d;};'use strict';var multer=require(_0xaa46('0x0'));var util=require(_0xaa46('0x1'));var path=require(_0xaa46('0x2'));var timeout=require(_0xaa46('0x3'));var express=require(_0xaa46('0x4'));var router=express[_0xaa46('0x5')]();var fs_extra=require(_0xaa46('0x6'));var auth=require(_0xaa46('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaa46('0x8'));var controller=require(_0xaa46('0x9'));router[_0xaa46('0xa')]('/',auth[_0xaa46('0xb')](),controller['index']);router[_0xaa46('0xa')](_0xaa46('0xc'),auth['isAuthenticated'](),controller[_0xaa46('0xd')]);router['get'](_0xaa46('0xe'),auth[_0xaa46('0xb')](),controller[_0xaa46('0xf')]);router['get'](_0xaa46('0x10'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x11')]);router['get'](_0xaa46('0x12'),auth['isAuthenticated'](),controller[_0xaa46('0x13')]);router[_0xaa46('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xaa46('0x14')]);router[_0xaa46('0xa')](_0xaa46('0x15'),auth['isAuthenticated'](),controller[_0xaa46('0x16')]);router[_0xaa46('0xa')](_0xaa46('0x17'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x18')]);router[_0xaa46('0xa')]('/:id/users',auth[_0xaa46('0xb')](),controller[_0xaa46('0x19')]);router[_0xaa46('0x1a')]('/',auth['isAuthenticated'](),controller[_0xaa46('0x1b')]);router['post'](_0xaa46('0x10'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x1c')]);router[_0xaa46('0x1a')](_0xaa46('0x12'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x1d')]);router[_0xaa46('0x1a')](_0xaa46('0x1e'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x1f')]);router[_0xaa46('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller[_0xaa46('0x20')]);router['post'](_0xaa46('0x21'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x22')]);router[_0xaa46('0x1a')](_0xaa46('0x23'),auth['isAuthenticated'](),controller[_0xaa46('0x24')]);router['post'](_0xaa46('0x25'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x26')]);router[_0xaa46('0x1a')](_0xaa46('0x27'),auth['isAuthenticated'](),controller[_0xaa46('0x28')]);router['put'](_0xaa46('0xe'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x29')]);router[_0xaa46('0x2a')](_0xaa46('0xe'),auth[_0xaa46('0xb')](),controller[_0xaa46('0x2b')]);router['delete'](_0xaa46('0x10'),auth[_0xaa46('0xb')](),controller['removeDispositions']);router[_0xaa46('0x2a')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xaa46('0x2c')]);router[_0xaa46('0x2a')](_0xaa46('0x27'),auth['isAuthenticated'](),controller[_0xaa46('0x2d')]);module[_0xaa46('0x2e')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c729fd2..b69e4ee 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 _0x91ab=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x407de8,_0x339323){var _0x479375=function(_0xff0cb5){while(--_0xff0cb5){_0x407de8['push'](_0x407de8['shift']());}};_0x479375(++_0x339323);}(_0x91ab,0x83));var _0xb91a=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x91ab[_0x2555d0];return _0x3bb486;};'use strict';var Sequelize=require(_0xb91a('0x0'));module[_0xb91a('0x1')]={'priority':{'type':Sequelize[_0xb91a('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb91a('0x3')],'allowNull':![],'defaultValue':_0xb91a('0x4')},'appdata':{'type':Sequelize[_0xb91a('0x5')]()},'description':{'type':Sequelize[_0xb91a('0x3')]},'interval':{'type':Sequelize[_0xb91a('0x3')],'defaultValue':_0xb91a('0x6')}}; \ No newline at end of file +var _0x2753=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x33d87f,_0x5a16c9){var _0x4900fc=function(_0x26ea35){while(--_0x26ea35){_0x33d87f['push'](_0x33d87f['shift']());}};_0x4900fc(++_0x5a16c9);}(_0x2753,0x1cc));var _0x3275=function(_0x49f37e,_0x4d9211){_0x49f37e=_0x49f37e-0x0;var _0x3c30e6=_0x2753[_0x49f37e];return _0x3c30e6;};'use strict';var Sequelize=require(_0x3275('0x0'));module[_0x3275('0x1')]={'priority':{'type':Sequelize[_0x3275('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3275('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3275('0x4')],'defaultValue':_0x3275('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index dc0e5c7..1c997fe 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 _0x6011=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','name','send','index','map','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','FaxApplication','then','catch','params','includeAll','include','create','body','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel'];(function(_0x493d93,_0x345b6f){var _0x57d6f3=function(_0x19aa40){while(--_0x19aa40){_0x493d93['push'](_0x493d93['shift']());}};_0x57d6f3(++_0x345b6f);}(_0x6011,0x81));var _0x1601=function(_0x32059f,_0x26df54){_0x32059f=_0x32059f-0x0;var _0x549716=_0x6011[_0x32059f];return _0x549716;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1601('0x0'));var rp=require(_0x1601('0x1'));var moment=require(_0x1601('0x2'));var BPromise=require(_0x1601('0x3'));var Mustache=require(_0x1601('0x4'));var util=require(_0x1601('0x5'));var path=require('path');var sox=require(_0x1601('0x6'));var csv=require(_0x1601('0x7'));var ejs=require(_0x1601('0x8'));var fs=require('fs');var fs_extra=require(_0x1601('0x9'));var _=require('lodash');var squel=require(_0x1601('0xa'));var crypto=require(_0x1601('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1601('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1601('0xd'));var Papa=require(_0x1601('0xe'));var Redis=require('ioredis');var authService=require(_0x1601('0xf'));var qs=require(_0x1601('0x10'));var as=require(_0x1601('0x11'));var hardwareService=require(_0x1601('0x12'));var logger=require(_0x1601('0x13'))(_0x1601('0x14'));var utils=require(_0x1601('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1601('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36449d,_0x5e55c7){_0x5e55c7=_0x5e55c7||0xcc;return function(_0x231142){if(_0x231142){return _0x36449d[_0x1601('0x17')](_0x5e55c7);}return _0x36449d[_0x1601('0x18')](_0x5e55c7)[_0x1601('0x19')]();};}function respondWithResult(_0x32ece3,_0x376212){_0x376212=_0x376212||0xc8;return function(_0x4ea42d){if(_0x4ea42d){return _0x32ece3['status'](_0x376212)[_0x1601('0x1a')](_0x4ea42d);}};}function respondWithFilteredResult(_0x29baf2,_0x2b0221){return function(_0x551e95){if(_0x551e95){var _0x23d8d7=typeof _0x2b0221['offset']===_0x1601('0x1b')&&typeof _0x2b0221[_0x1601('0x1c')]===_0x1601('0x1b');var _0x1d1d8d=_0x551e95[_0x1601('0x1d')];var _0x154938=_0x23d8d7?0x0:_0x2b0221[_0x1601('0x1e')];var _0x80516c=_0x23d8d7?_0x551e95[_0x1601('0x1d')]:_0x2b0221[_0x1601('0x1e')]+_0x2b0221[_0x1601('0x1c')];var _0x1c44b6;if(_0x80516c>=_0x1d1d8d){_0x80516c=_0x1d1d8d;_0x1c44b6=0xc8;}else{_0x1c44b6=0xce;}_0x29baf2[_0x1601('0x18')](_0x1c44b6);return _0x29baf2['set'](_0x1601('0x1f'),_0x154938+'-'+_0x80516c+'/'+_0x1d1d8d)[_0x1601('0x1a')](_0x551e95);}return null;};}function patchUpdates(_0x312d18){return function(_0x57f92a){try{jsonpatch[_0x1601('0x20')](_0x57f92a,_0x312d18,!![]);}catch(_0x2a977a){return BPromise['reject'](_0x2a977a);}return _0x57f92a[_0x1601('0x21')]();};}function saveUpdates(_0x54bf16,_0x31350b){return function(_0x4515cc){if(_0x4515cc){return _0x4515cc[_0x1601('0x22')](_0x54bf16)['then'](function(_0x46ce14){return _0x46ce14;});}return null;};}function removeEntity(_0x2283c7,_0x5f4e06){return function(_0x23d607){if(_0x23d607){return _0x23d607[_0x1601('0x23')]()['then'](function(){_0x2283c7[_0x1601('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x565875,_0x3b982d){return function(_0x5f02a2){if(!_0x5f02a2){_0x565875['sendStatus'](0x194);}return _0x5f02a2;};}function handleError(_0x3cfd7e,_0x55bc03){_0x55bc03=_0x55bc03||0x1f4;return function(_0x51e85c){logger[_0x1601('0x24')](_0x51e85c['stack']);if(_0x51e85c[_0x1601('0x25')]){delete _0x51e85c[_0x1601('0x25')];}_0x3cfd7e['status'](_0x55bc03)[_0x1601('0x26')](_0x51e85c);};}exports[_0x1601('0x27')]=function(_0x5843e2,_0xcbcd2e){var _0x368835={},_0x89c09a={},_0x29b39d={'count':0x0,'rows':[]};var _0x34d255=_[_0x1601('0x28')](db['FaxApplication'][_0x1601('0x29')],function(_0x4e889f){return{'name':_0x4e889f['fieldName'],'type':_0x4e889f['type'][_0x1601('0x2a')]};});_0x89c09a['model']=_[_0x1601('0x28')](_0x34d255,_0x1601('0x25'));_0x89c09a[_0x1601('0x2b')]=_[_0x1601('0x2c')](_0x5843e2[_0x1601('0x2b')]);_0x89c09a[_0x1601('0x2d')]=_[_0x1601('0x2e')](_0x89c09a['model'],_0x89c09a['query']);_0x368835[_0x1601('0x2f')]=_[_0x1601('0x2e')](_0x89c09a[_0x1601('0x30')],qs[_0x1601('0x31')](_0x5843e2[_0x1601('0x2b')]['fields']));_0x368835[_0x1601('0x2f')]=_0x368835['attributes'][_0x1601('0x32')]?_0x368835[_0x1601('0x2f')]:_0x89c09a[_0x1601('0x30')];if(!_0x5843e2[_0x1601('0x2b')][_0x1601('0x33')](_0x1601('0x34'))){_0x368835['limit']=qs[_0x1601('0x1c')](_0x5843e2[_0x1601('0x2b')][_0x1601('0x1c')]);_0x368835['offset']=qs['offset'](_0x5843e2[_0x1601('0x2b')][_0x1601('0x1e')]);}_0x368835[_0x1601('0x35')]=qs[_0x1601('0x36')](_0x5843e2['query'][_0x1601('0x36')]);_0x368835['where']=qs[_0x1601('0x2d')](_[_0x1601('0x37')](_0x5843e2[_0x1601('0x2b')],_0x89c09a[_0x1601('0x2d')]),_0x34d255);if(_0x5843e2[_0x1601('0x2b')][_0x1601('0x38')]){_0x368835['where']=_[_0x1601('0x39')](_0x368835['where'],{'$or':_['map'](_0x34d255,function(_0x4c2181){if(_0x4c2181[_0x1601('0x3a')]!==_0x1601('0x3b')){var _0x25b855={};_0x25b855[_0x4c2181[_0x1601('0x25')]]={'$like':'%'+_0x5843e2['query']['filter']+'%'};return _0x25b855;}})});}_0x368835=_[_0x1601('0x39')]({},_0x368835,_0x5843e2[_0x1601('0x3c')]);var _0x39aeb={'where':_0x368835['where']};return db[_0x1601('0x3d')][_0x1601('0x1d')](_0x39aeb)[_0x1601('0x3e')](function(_0x45b003){_0x29b39d[_0x1601('0x1d')]=_0x45b003;if(_0x5843e2[_0x1601('0x2b')]['includeAll']){_0x368835['include']=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x368835);})[_0x1601('0x3e')](function(_0x46da80){_0x29b39d['rows']=_0x46da80;return _0x29b39d;})[_0x1601('0x3e')](respondWithFilteredResult(_0xcbcd2e,_0x368835))[_0x1601('0x3f')](handleError(_0xcbcd2e,null));};exports['show']=function(_0x571aef,_0x1bbb98){var _0x466711={'raw':!![],'where':{'id':_0x571aef[_0x1601('0x40')]['id']}},_0xd3ab58={};_0xd3ab58[_0x1601('0x30')]=_[_0x1601('0x2c')](db[_0x1601('0x3d')][_0x1601('0x29')]);_0xd3ab58[_0x1601('0x2b')]=_['keys'](_0x571aef[_0x1601('0x2b')]);_0xd3ab58[_0x1601('0x2d')]=_[_0x1601('0x2e')](_0xd3ab58[_0x1601('0x30')],_0xd3ab58[_0x1601('0x2b')]);_0x466711[_0x1601('0x2f')]=_['intersection'](_0xd3ab58[_0x1601('0x30')],qs[_0x1601('0x31')](_0x571aef[_0x1601('0x2b')][_0x1601('0x31')]));_0x466711['attributes']=_0x466711[_0x1601('0x2f')][_0x1601('0x32')]?_0x466711[_0x1601('0x2f')]:_0xd3ab58[_0x1601('0x30')];if(_0x571aef[_0x1601('0x2b')][_0x1601('0x41')]){_0x466711[_0x1601('0x42')]=[{'all':!![]}];}_0x466711=_['merge']({},_0x466711,_0x571aef[_0x1601('0x3c')]);return db[_0x1601('0x3d')]['find'](_0x466711)[_0x1601('0x3e')](handleEntityNotFound(_0x1bbb98,null))[_0x1601('0x3e')](respondWithResult(_0x1bbb98,null))[_0x1601('0x3f')](handleError(_0x1bbb98,null));};exports[_0x1601('0x43')]=function(_0x6c82e3,_0x4160b6){return db[_0x1601('0x3d')]['create'](_0x6c82e3[_0x1601('0x44')],{})[_0x1601('0x3e')](respondWithResult(_0x4160b6,0xc9))[_0x1601('0x3f')](handleError(_0x4160b6,null));};exports['update']=function(_0x56cb45,_0x503c80){if(_0x56cb45[_0x1601('0x44')]['id']){delete _0x56cb45[_0x1601('0x44')]['id'];}return db[_0x1601('0x3d')][_0x1601('0x45')]({'where':{'id':_0x56cb45[_0x1601('0x40')]['id']}})[_0x1601('0x3e')](handleEntityNotFound(_0x503c80,null))[_0x1601('0x3e')](saveUpdates(_0x56cb45['body'],null))[_0x1601('0x3e')](respondWithResult(_0x503c80,null))[_0x1601('0x3f')](handleError(_0x503c80,null));};exports[_0x1601('0x23')]=function(_0x1caeab,_0x4f0a28){return db[_0x1601('0x3d')][_0x1601('0x45')]({'where':{'id':_0x1caeab[_0x1601('0x40')]['id']}})['then'](handleEntityNotFound(_0x4f0a28,null))[_0x1601('0x3e')](removeEntity(_0x4f0a28,null))[_0x1601('0x3f')](handleError(_0x4f0a28,null));}; \ No newline at end of file +var _0x4912=['apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','FaxApplication','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range'];(function(_0x9f2672,_0x577c3b){var _0x40ee3e=function(_0x2731a7){while(--_0x2731a7){_0x9f2672['push'](_0x9f2672['shift']());}};_0x40ee3e(++_0x577c3b);}(_0x4912,0x1b0));var _0x2491=function(_0xf4daeb,_0x3b375e){_0xf4daeb=_0xf4daeb-0x0;var _0x44d0ee=_0x4912[_0xf4daeb];return _0x44d0ee;};'use strict';var emlformat=require(_0x2491('0x0'));var rimraf=require(_0x2491('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2491('0x2'));var rp=require(_0x2491('0x3'));var moment=require(_0x2491('0x4'));var BPromise=require(_0x2491('0x5'));var Mustache=require(_0x2491('0x6'));var util=require('util');var path=require(_0x2491('0x7'));var sox=require(_0x2491('0x8'));var csv=require(_0x2491('0x9'));var ejs=require(_0x2491('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2491('0xb'));var squel=require(_0x2491('0xc'));var crypto=require(_0x2491('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2491('0xe'));var toCsv=require(_0x2491('0x9'));var querystring=require(_0x2491('0xf'));var Papa=require(_0x2491('0x10'));var Redis=require(_0x2491('0x11'));var authService=require(_0x2491('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2491('0x13'));var logger=require(_0x2491('0x14'))(_0x2491('0x15'));var utils=require(_0x2491('0x16'));var config=require(_0x2491('0x17'));var licenseUtil=require(_0x2491('0x18'));var db=require(_0x2491('0x19'))['db'];function respondWithStatusCode(_0x51c1d8,_0x1a1bc6){_0x1a1bc6=_0x1a1bc6||0xcc;return function(_0x561380){if(_0x561380){return _0x51c1d8[_0x2491('0x1a')](_0x1a1bc6);}return _0x51c1d8[_0x2491('0x1b')](_0x1a1bc6)[_0x2491('0x1c')]();};}function respondWithResult(_0x413f09,_0x4cc996){_0x4cc996=_0x4cc996||0xc8;return function(_0x5b439f){if(_0x5b439f){return _0x413f09[_0x2491('0x1b')](_0x4cc996)[_0x2491('0x1d')](_0x5b439f);}};}function respondWithFilteredResult(_0x22b121,_0x58db34){return function(_0x3e507d){if(_0x3e507d){var _0x562289=typeof _0x58db34['offset']==='undefined'&&typeof _0x58db34[_0x2491('0x1e')]===_0x2491('0x1f');var _0xda3b49=_0x3e507d[_0x2491('0x20')];var _0x32c661=_0x562289?0x0:_0x58db34['offset'];var _0x1dbc93=_0x562289?_0x3e507d[_0x2491('0x20')]:_0x58db34[_0x2491('0x21')]+_0x58db34['limit'];var _0x433e62;if(_0x1dbc93>=_0xda3b49){_0x1dbc93=_0xda3b49;_0x433e62=0xc8;}else{_0x433e62=0xce;}_0x22b121['status'](_0x433e62);return _0x22b121[_0x2491('0x22')](_0x2491('0x23'),_0x32c661+'-'+_0x1dbc93+'/'+_0xda3b49)[_0x2491('0x1d')](_0x3e507d);}return null;};}function patchUpdates(_0x507121){return function(_0x129c39){try{jsonpatch[_0x2491('0x24')](_0x129c39,_0x507121,!![]);}catch(_0x4a6ede){return BPromise[_0x2491('0x25')](_0x4a6ede);}return _0x129c39[_0x2491('0x26')]();};}function saveUpdates(_0x54b6b2,_0x388785){return function(_0x4d8914){if(_0x4d8914){return _0x4d8914[_0x2491('0x27')](_0x54b6b2)['then'](function(_0x3f20df){return _0x3f20df;});}return null;};}function removeEntity(_0x5523e4,_0x54804d){return function(_0x3cd79e){if(_0x3cd79e){return _0x3cd79e[_0x2491('0x28')]()[_0x2491('0x29')](function(){_0x5523e4[_0x2491('0x1b')](0xcc)[_0x2491('0x1c')]();});}};}function handleEntityNotFound(_0x226429,_0x21b82f){return function(_0x1c405f){if(!_0x1c405f){_0x226429[_0x2491('0x1a')](0x194);}return _0x1c405f;};}function handleError(_0x595495,_0x2fdd3a){_0x2fdd3a=_0x2fdd3a||0x1f4;return function(_0x3f24ea){logger[_0x2491('0x2a')](_0x3f24ea[_0x2491('0x2b')]);if(_0x3f24ea[_0x2491('0x2c')]){delete _0x3f24ea[_0x2491('0x2c')];}_0x595495[_0x2491('0x1b')](_0x2fdd3a)[_0x2491('0x2d')](_0x3f24ea);};}exports['index']=function(_0x206b7e,_0x58d2cd){var _0x1d5356={},_0x36d245={},_0x51b054={'count':0x0,'rows':[]};var _0x889ab6=_[_0x2491('0x2e')](db['FaxApplication'][_0x2491('0x2f')],function(_0x50f51c){return{'name':_0x50f51c[_0x2491('0x30')],'type':_0x50f51c['type'][_0x2491('0x31')]};});_0x36d245[_0x2491('0x32')]=_[_0x2491('0x2e')](_0x889ab6,'name');_0x36d245['query']=_['keys'](_0x206b7e[_0x2491('0x33')]);_0x36d245[_0x2491('0x34')]=_[_0x2491('0x35')](_0x36d245[_0x2491('0x32')],_0x36d245[_0x2491('0x33')]);_0x1d5356['attributes']=_[_0x2491('0x35')](_0x36d245[_0x2491('0x32')],qs[_0x2491('0x36')](_0x206b7e['query'][_0x2491('0x36')]));_0x1d5356['attributes']=_0x1d5356[_0x2491('0x37')][_0x2491('0x38')]?_0x1d5356['attributes']:_0x36d245[_0x2491('0x32')];if(!_0x206b7e[_0x2491('0x33')][_0x2491('0x39')](_0x2491('0x3a'))){_0x1d5356[_0x2491('0x1e')]=qs['limit'](_0x206b7e['query'][_0x2491('0x1e')]);_0x1d5356[_0x2491('0x21')]=qs[_0x2491('0x21')](_0x206b7e[_0x2491('0x33')][_0x2491('0x21')]);}_0x1d5356[_0x2491('0x3b')]=qs['sort'](_0x206b7e[_0x2491('0x33')][_0x2491('0x3c')]);_0x1d5356[_0x2491('0x3d')]=qs[_0x2491('0x34')](_['pick'](_0x206b7e[_0x2491('0x33')],_0x36d245[_0x2491('0x34')]),_0x889ab6);if(_0x206b7e[_0x2491('0x33')][_0x2491('0x3e')]){_0x1d5356['where']=_[_0x2491('0x3f')](_0x1d5356[_0x2491('0x3d')],{'$or':_[_0x2491('0x2e')](_0x889ab6,function(_0x54f517){if(_0x54f517[_0x2491('0x40')]!==_0x2491('0x41')){var _0x581e61={};_0x581e61[_0x54f517[_0x2491('0x2c')]]={'$like':'%'+_0x206b7e['query'][_0x2491('0x3e')]+'%'};return _0x581e61;}})});}_0x1d5356=_[_0x2491('0x3f')]({},_0x1d5356,_0x206b7e[_0x2491('0x42')]);var _0x319f6c={'where':_0x1d5356[_0x2491('0x3d')]};return db[_0x2491('0x43')][_0x2491('0x20')](_0x319f6c)[_0x2491('0x29')](function(_0x40fb48){_0x51b054[_0x2491('0x20')]=_0x40fb48;if(_0x206b7e['query'][_0x2491('0x44')]){_0x1d5356[_0x2491('0x45')]=[{'all':!![]}];}return db[_0x2491('0x43')][_0x2491('0x46')](_0x1d5356);})[_0x2491('0x29')](function(_0x455349){_0x51b054['rows']=_0x455349;return _0x51b054;})[_0x2491('0x29')](respondWithFilteredResult(_0x58d2cd,_0x1d5356))[_0x2491('0x47')](handleError(_0x58d2cd,null));};exports[_0x2491('0x48')]=function(_0x118521,_0x3fddef){var _0x3db251={'raw':!![],'where':{'id':_0x118521[_0x2491('0x49')]['id']}},_0x339b50={};_0x339b50['model']=_['keys'](db[_0x2491('0x43')][_0x2491('0x2f')]);_0x339b50[_0x2491('0x33')]=_[_0x2491('0x4a')](_0x118521[_0x2491('0x33')]);_0x339b50[_0x2491('0x34')]=_['intersection'](_0x339b50[_0x2491('0x32')],_0x339b50[_0x2491('0x33')]);_0x3db251[_0x2491('0x37')]=_['intersection'](_0x339b50['model'],qs[_0x2491('0x36')](_0x118521[_0x2491('0x33')]['fields']));_0x3db251['attributes']=_0x3db251['attributes'][_0x2491('0x38')]?_0x3db251['attributes']:_0x339b50[_0x2491('0x32')];if(_0x118521[_0x2491('0x33')]['includeAll']){_0x3db251[_0x2491('0x45')]=[{'all':!![]}];}_0x3db251=_[_0x2491('0x3f')]({},_0x3db251,_0x118521[_0x2491('0x42')]);return db[_0x2491('0x43')][_0x2491('0x4b')](_0x3db251)[_0x2491('0x29')](handleEntityNotFound(_0x3fddef,null))[_0x2491('0x29')](respondWithResult(_0x3fddef,null))[_0x2491('0x47')](handleError(_0x3fddef,null));};exports[_0x2491('0x4c')]=function(_0x866698,_0x24223a){return db[_0x2491('0x43')][_0x2491('0x4c')](_0x866698['body'],{})[_0x2491('0x29')](respondWithResult(_0x24223a,0xc9))[_0x2491('0x47')](handleError(_0x24223a,null));};exports['update']=function(_0x559158,_0x1fd238){if(_0x559158[_0x2491('0x4d')]['id']){delete _0x559158[_0x2491('0x4d')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x559158[_0x2491('0x49')]['id']}})[_0x2491('0x29')](handleEntityNotFound(_0x1fd238,null))[_0x2491('0x29')](saveUpdates(_0x559158[_0x2491('0x4d')],null))[_0x2491('0x29')](respondWithResult(_0x1fd238,null))[_0x2491('0x47')](handleError(_0x1fd238,null));};exports['destroy']=function(_0x563848,_0xd65a17){return db['FaxApplication'][_0x2491('0x4b')]({'where':{'id':_0x563848['params']['id']}})['then'](handleEntityNotFound(_0xd65a17,null))[_0x2491('0x29')](removeEntity(_0xd65a17,null))[_0x2491('0x47')](handleError(_0xd65a17,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 384b1ae..b1cd3b8 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 _0xf340=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x73914f,_0x2100e5){var _0x4234a=function(_0x586531){while(--_0x586531){_0x73914f['push'](_0x73914f['shift']());}};_0x4234a(++_0x2100e5);}(_0xf340,0xbd));var _0x0f34=function(_0x6cc0dd,_0x214f7d){_0x6cc0dd=_0x6cc0dd-0x0;var _0x3133a9=_0xf340[_0x6cc0dd];return _0x3133a9;};'use strict';var _=require(_0x0f34('0x0'));var util=require(_0x0f34('0x1'));var logger=require(_0x0f34('0x2'))(_0x0f34('0x3'));var moment=require('moment');var BPromise=require(_0x0f34('0x4'));var rp=require(_0x0f34('0x5'));var fs=require('fs');var path=require(_0x0f34('0x6'));var rimraf=require(_0x0f34('0x7'));var config=require(_0x0f34('0x8'));var attributes=require(_0x0f34('0x9'));module[_0x0f34('0xa')]=function(_0x21f076,_0x206630){return _0x21f076[_0x0f34('0xb')](_0x0f34('0xc'),attributes,{'tableName':_0x0f34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0f34('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x277b=['path','rimraf','../../config/environment','./faxApplication.attributes','define','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x277b,0x14c));var _0xb277=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x277b[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xb277('0x0'));var util=require(_0xb277('0x1'));var logger=require(_0xb277('0x2'))(_0xb277('0x3'));var moment=require(_0xb277('0x4'));var BPromise=require(_0xb277('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb277('0x6'));var rimraf=require(_0xb277('0x7'));var config=require(_0xb277('0x8'));var attributes=require(_0xb277('0x9'));module['exports']=function(_0x1fd702,_0x95ff2e){return _0x1fd702[_0xb277('0xa')]('FaxApplication',attributes,{'tableName':_0xb277('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb277('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 29f7ac7..7c88ef3 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 _0x06cb=['request\x20sent','stringify','error','message','UpdateFaxApplication','FaxApplication','body','options','raw','limit','then','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5d78e7,_0x5e0d00){var _0x13175b=function(_0x40e7bc){while(--_0x40e7bc){_0x5d78e7['push'](_0x5d78e7['shift']());}};_0x13175b(++_0x5e0d00);}(_0x06cb,0x1c6));var _0xb06c=function(_0x470b74,_0x44eb5a){_0x470b74=_0x470b74-0x0;var _0x4e7680=_0x06cb[_0x470b74];return _0x4e7680;};'use strict';var _=require(_0xb06c('0x0'));var util=require(_0xb06c('0x1'));var moment=require(_0xb06c('0x2'));var BPromise=require(_0xb06c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb06c('0x4'))['db'];var utils=require(_0xb06c('0x5'));var logger=require(_0xb06c('0x6'))(_0xb06c('0x7'));var config=require(_0xb06c('0x8'));var jayson=require(_0xb06c('0x9'));var client=jayson['client'][_0xb06c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4625b3,_0x323616,_0x33510e){return new BPromise(function(_0x61724,_0x36bffa){return client['request'](_0x4625b3,_0x33510e)['then'](function(_0x3a2106){logger[_0xb06c('0xb')](_0xb06c('0xc'),_0x323616,'request\x20sent');logger['debug'](_0xb06c('0xd'),_0x323616,_0xb06c('0xe'),JSON[_0xb06c('0xf')](_0x3a2106));if(_0x3a2106[_0xb06c('0x10')]){if(_0x3a2106['error']['code']===0x1f4){logger['error'](_0xb06c('0xc'),_0x323616,_0x3a2106['error'][_0xb06c('0x11')]);return _0x36bffa(_0x3a2106[_0xb06c('0x10')][_0xb06c('0x11')]);}logger['error'](_0xb06c('0xc'),_0x323616,_0x3a2106['error'][_0xb06c('0x11')]);return _0x61724(_0x3a2106[_0xb06c('0x10')][_0xb06c('0x11')]);}else{logger['info'](_0xb06c('0xc'),_0x323616,_0xb06c('0xe'));_0x61724(_0x3a2106['result'][_0xb06c('0x11')]);}})['catch'](function(_0x21a607){logger[_0xb06c('0x10')]('FaxApplication,\x20%s,\x20%s',_0x323616,_0x21a607);_0x36bffa(_0x21a607);});});}exports[_0xb06c('0x12')]=function(_0x2ec642){var _0x376452=this;return new Promise(function(_0x498562,_0x17e6d8){return db[_0xb06c('0x13')]['update'](_0x2ec642[_0xb06c('0x14')],{'raw':_0x2ec642['options']?_0x2ec642[_0xb06c('0x15')][_0xb06c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ec642[_0xb06c('0x15')]?_0x2ec642[_0xb06c('0x15')]['where']||null:null,'attributes':_0x2ec642[_0xb06c('0x15')]?_0x2ec642[_0xb06c('0x15')]['attributes']||null:null,'limit':_0x2ec642[_0xb06c('0x15')]?_0x2ec642[_0xb06c('0x15')][_0xb06c('0x17')]||null:null})[_0xb06c('0x18')](function(_0x1fb358){logger[_0xb06c('0xb')]('UpdateFaxApplication',_0x2ec642);logger[_0xb06c('0x19')](_0xb06c('0x12'),_0x2ec642,JSON[_0xb06c('0xf')](_0x1fb358));_0x498562(_0x1fb358);})['catch'](function(_0x3d4c01){logger['error'](_0xb06c('0x12'),_0x3d4c01[_0xb06c('0x11')],_0x2ec642);_0x17e6d8(_0x376452[_0xb06c('0x10')](0x1f4,_0x3d4c01[_0xb06c('0x11')]));});});}; \ No newline at end of file +var _0xdd01=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','update','options','where','limit','util'];(function(_0x10ccb1,_0x5b1272){var _0x584b22=function(_0x220e75){while(--_0x220e75){_0x10ccb1['push'](_0x10ccb1['shift']());}};_0x584b22(++_0x5b1272);}(_0xdd01,0x137));var _0x1dd0=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xdd01[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require(_0x1dd0('0x0'));var moment=require(_0x1dd0('0x1'));var BPromise=require(_0x1dd0('0x2'));var rs=require(_0x1dd0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dd0('0x4'))['db'];var utils=require(_0x1dd0('0x5'));var logger=require(_0x1dd0('0x6'))(_0x1dd0('0x7'));var config=require(_0x1dd0('0x8'));var jayson=require(_0x1dd0('0x9'));var client=jayson[_0x1dd0('0xa')][_0x1dd0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2563c4,_0x4b3c05,_0x1a966a){return new BPromise(function(_0x39f093,_0x2c5d72){return client[_0x1dd0('0xc')](_0x2563c4,_0x1a966a)[_0x1dd0('0xd')](function(_0x31cf3f){logger[_0x1dd0('0xe')]('FaxApplication,\x20%s,\x20%s',_0x4b3c05,'request\x20sent');logger[_0x1dd0('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x4b3c05,_0x1dd0('0x10'),JSON['stringify'](_0x31cf3f));if(_0x31cf3f[_0x1dd0('0x11')]){if(_0x31cf3f['error']['code']===0x1f4){logger[_0x1dd0('0x11')](_0x1dd0('0x12'),_0x4b3c05,_0x31cf3f[_0x1dd0('0x11')][_0x1dd0('0x13')]);return _0x2c5d72(_0x31cf3f[_0x1dd0('0x11')]['message']);}logger[_0x1dd0('0x11')]('FaxApplication,\x20%s,\x20%s',_0x4b3c05,_0x31cf3f[_0x1dd0('0x11')][_0x1dd0('0x13')]);return _0x39f093(_0x31cf3f['error']['message']);}else{logger[_0x1dd0('0xe')](_0x1dd0('0x12'),_0x4b3c05,'request\x20sent');_0x39f093(_0x31cf3f['result'][_0x1dd0('0x13')]);}})[_0x1dd0('0x14')](function(_0x34effa){logger['error'](_0x1dd0('0x12'),_0x4b3c05,_0x34effa);_0x2c5d72(_0x34effa);});});}exports[_0x1dd0('0x15')]=function(_0x3af115){var _0x56519d=this;return new Promise(function(_0x4cf173,_0x3e9d65){return db['FaxApplication'][_0x1dd0('0x16')](_0x3af115['body'],{'raw':_0x3af115[_0x1dd0('0x17')]?_0x3af115[_0x1dd0('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3af115[_0x1dd0('0x17')]?_0x3af115[_0x1dd0('0x17')][_0x1dd0('0x18')]||null:null,'attributes':_0x3af115[_0x1dd0('0x17')]?_0x3af115[_0x1dd0('0x17')]['attributes']||null:null,'limit':_0x3af115[_0x1dd0('0x17')]?_0x3af115['options'][_0x1dd0('0x19')]||null:null})[_0x1dd0('0xd')](function(_0x1ab76e){logger[_0x1dd0('0xe')]('UpdateFaxApplication',_0x3af115);logger[_0x1dd0('0xf')](_0x1dd0('0x15'),_0x3af115,JSON['stringify'](_0x1ab76e));_0x4cf173(_0x1ab76e);})['catch'](function(_0x381bd0){logger[_0x1dd0('0x11')](_0x1dd0('0x15'),_0x381bd0[_0x1dd0('0x13')],_0x3af115);_0x3e9d65(_0x56519d[_0x1dd0('0x11')](0x1f4,_0x381bd0[_0x1dd0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index bc781df..e418fdc 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 _0xf7b4=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','connect-timeout'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0xf7b4,0x152));var _0x4f7b=function(_0x542174,_0xf4190){_0x542174=_0x542174-0x0;var _0x3b4c31=_0xf7b4[_0x542174];return _0x3b4c31;};'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('0xc')]('/',auth[_0x4f7b('0x8')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xa'),auth['isAuthenticated'](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xdd4f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','express'];(function(_0x5d6f28,_0x5b1876){var _0xa996ea=function(_0x5580e0){while(--_0x5580e0){_0x5d6f28['push'](_0x5d6f28['shift']());}};_0xa996ea(++_0x5b1876);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x4e3e10,_0x464b3d){_0x4e3e10=_0x4e3e10-0x0;var _0x20f4a1=_0xdd4f[_0x4e3e10];return _0x20f4a1;};'use strict';var multer=require(_0xfdd4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd4('0x1'));var router=express[_0xfdd4('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfdd4('0x3'));var interaction=require(_0xfdd4('0x4'));var config=require(_0xfdd4('0x5'));var controller=require('./faxApplication.controller');router[_0xfdd4('0x6')]('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0x8')]);router[_0xfdd4('0x6')](_0xfdd4('0x9'),auth['isAuthenticated'](),controller[_0xfdd4('0xa')]);router['post']('/',auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xb')]);router[_0xfdd4('0xc')]('/:id',auth[_0xfdd4('0x7')](),controller['update']);router[_0xfdd4('0xd')](_0xfdd4('0x9'),auth[_0xfdd4('0x7')](),controller[_0xfdd4('0xe')]);module[_0xfdd4('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 20b85e2..683df93 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 _0x4b17=['STRING','ENUM','out','DATE','INTEGER','sequelize','BOOLEAN'];(function(_0x2374b1,_0x2e969c){var _0x54166a=function(_0x1b3825){while(--_0x1b3825){_0x2374b1['push'](_0x2374b1['shift']());}};_0x54166a(++_0x2e969c);}(_0x4b17,0x10f));var _0x74b1=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0x4b17[_0x380a3f];return _0x2b4eca;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'closed':{'type':Sequelize[_0x74b1('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x74b1('0x2')]},'secondDisposition':{'type':Sequelize[_0x74b1('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x74b1('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x74b1('0x3')]('in',_0x74b1('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x74b1('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x74b1('0x3')]('in',_0x74b1('0x4')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x74b1('0x6')]}}; \ No newline at end of file +var _0x1a37=['STRING','out','ENUM','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x5800f9,_0x63925){var _0x101515=function(_0x5ba8a7){while(--_0x5ba8a7){_0x5800f9['push'](_0x5800f9['shift']());}};_0x101515(++_0x63925);}(_0x1a37,0xb4));var _0x71a3=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1a37[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'closed':{'type':Sequelize[_0x71a3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x71a3('0x3')]},'disposition':{'type':Sequelize[_0x71a3('0x4')]},'secondDisposition':{'type':Sequelize[_0x71a3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x71a3('0x4')]},'note':{'type':Sequelize[_0x71a3('0x4')]},'read1stAt':{'type':Sequelize[_0x71a3('0x3')]},'fax':{'type':Sequelize[_0x71a3('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x71a3('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x71a3('0x6')]('in',_0x71a3('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x71a3('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 33b66e1..192c6a5 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 _0xa555=['localhost','redis','./faxInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','end','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','user','catch','show','params','keys','query','filters','intersection','model','attributes','fields','includeAll','include','options','find','create','body','describe','addMessage','ids','omit','FaxMessage','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb'];(function(_0x1a7f0d,_0xb4acc6){var _0x52a780=function(_0x3a24c7){while(--_0x3a24c7){_0x1a7f0d['push'](_0x1a7f0d['shift']());}};_0x52a780(++_0xb4acc6);}(_0xa555,0x1a1));var _0x5a55=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa555[_0x501510];return _0x1e6ee5;};'use strict';var rimraf=require(_0x5a55('0x0'));var zipdir=require(_0x5a55('0x1'));var moment=require(_0x5a55('0x2'));var BPromise=require('bluebird');var util=require(_0x5a55('0x3'));var path=require(_0x5a55('0x4'));var fs=require('fs');var _=require(_0x5a55('0x5'));var Redis=require('ioredis');var interaction=require(_0x5a55('0x6'));var qs=require(_0x5a55('0x7'));var logger=require('../../config/logger')(_0x5a55('0x8'));var config=require(_0x5a55('0x9'));var db=require(_0x5a55('0xa'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5a55('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a55('0xc')]));require(_0x5a55('0xd'))[_0x5a55('0xe')](socket);function respondWithStatusCode(_0x3f8512,_0x5ceb84){_0x5ceb84=_0x5ceb84||0xcc;return function(_0x3aa8a6){if(_0x3aa8a6){return _0x3f8512[_0x5a55('0xf')](_0x5ceb84);}return _0x3f8512[_0x5a55('0x10')](_0x5ceb84)['end']();};}function respondWithResult(_0x67f1c8,_0x32cfd3){_0x32cfd3=_0x32cfd3||0xc8;return function(_0xd4cc19){if(_0xd4cc19){return _0x67f1c8[_0x5a55('0x10')](_0x32cfd3)[_0x5a55('0x11')](_0xd4cc19);}};}function respondWithFilteredResult(_0x1c59d1,_0x1145d6){return function(_0x19f122){if(_0x19f122){var _0x4c3d24=typeof _0x1145d6[_0x5a55('0x12')]===_0x5a55('0x13')&&typeof _0x1145d6[_0x5a55('0x14')]===_0x5a55('0x13');var _0x24bb71=_0x19f122[_0x5a55('0x15')];var _0x26340f=_0x4c3d24?0x0:_0x1145d6[_0x5a55('0x12')];var _0x2840a5=_0x4c3d24?_0x19f122[_0x5a55('0x15')]:_0x1145d6[_0x5a55('0x12')]+_0x1145d6[_0x5a55('0x14')];var _0x55044e;if(_0x2840a5>=_0x24bb71){_0x2840a5=_0x24bb71;_0x55044e=0xc8;}else{_0x55044e=0xce;}_0x1c59d1[_0x5a55('0x10')](_0x55044e);return _0x1c59d1[_0x5a55('0x16')](_0x5a55('0x17'),_0x26340f+'-'+_0x2840a5+'/'+_0x24bb71)['json'](_0x19f122);}return null;};}function saveUpdates(_0x44b7f1){return function(_0x23894e){if(_0x23894e){return _0x23894e[_0x5a55('0x18')](_0x44b7f1)['then'](function(_0x580204){return _0x580204;});}return null;};}function removeEntity(_0x2ac709){return function(_0x2731a8){if(_0x2731a8){return _0x2731a8[_0x5a55('0x19')]()[_0x5a55('0x1a')](function(){_0x2ac709[_0x5a55('0x10')](0xcc)[_0x5a55('0x1b')]();});}};}function handleEntityNotFound(_0x46fc4d){return function(_0x5a2016){if(!_0x5a2016){_0x46fc4d['sendStatus'](0x194);}return _0x5a2016;};}function handleError(_0x17df30,_0x2d8c12){_0x2d8c12=_0x2d8c12||0x1f4;return function(_0x2ea072){logger['error'](_0x2ea072[_0x5a55('0x1c')]);if(_0x2ea072[_0x5a55('0x1d')]){delete _0x2ea072[_0x5a55('0x1d')];}_0x17df30[_0x5a55('0x10')](_0x2d8c12)[_0x5a55('0x1e')](_0x2ea072);};}exports[_0x5a55('0x1f')]=function(_0x144929,_0x130958){var _0x36fd33={};var _0x55838e=_[_0x5a55('0x20')](db[_0x5a55('0x21')][_0x5a55('0x22')],function(_0x3f41a0){return{'name':_0x3f41a0[_0x5a55('0x23')],'type':_0x3f41a0[_0x5a55('0x24')][_0x5a55('0x25')]};});_0x36fd33=qs[_0x5a55('0x26')](_0x55838e,_0x144929);return interaction[_0x5a55('0x27')](_0x5a55('0x28'),_0x144929['query'],_0x144929[_0x5a55('0x29')],_0x36fd33,_0x55838e)[_0x5a55('0x1a')](respondWithFilteredResult(_0x130958,_0x36fd33))[_0x5a55('0x2a')](handleError(_0x130958,null));};exports[_0x5a55('0x2b')]=function(_0x18d1f4,_0x9edf42){var _0x985bf={'raw':![],'where':{'id':_0x18d1f4[_0x5a55('0x2c')]['id']}},_0x5f31b6={};_0x5f31b6['model']=_[_0x5a55('0x2d')](db[_0x5a55('0x21')][_0x5a55('0x22')]);_0x5f31b6[_0x5a55('0x2e')]=_[_0x5a55('0x2d')](_0x18d1f4[_0x5a55('0x2e')]);_0x5f31b6[_0x5a55('0x2f')]=_[_0x5a55('0x30')](_0x5f31b6[_0x5a55('0x31')],_0x5f31b6[_0x5a55('0x2e')]);_0x985bf[_0x5a55('0x32')]=_[_0x5a55('0x30')](_0x5f31b6[_0x5a55('0x31')],qs[_0x5a55('0x33')](_0x18d1f4[_0x5a55('0x2e')][_0x5a55('0x33')]));_0x985bf[_0x5a55('0x32')]=_0x985bf['attributes']['length']?_0x985bf[_0x5a55('0x32')]:_0x5f31b6[_0x5a55('0x31')];if(_0x18d1f4[_0x5a55('0x2e')][_0x5a55('0x34')]){_0x985bf[_0x5a55('0x35')]=[{'all':!![]}];}_0x985bf=_['merge']({},_0x985bf,_0x18d1f4[_0x5a55('0x36')]);return db['FaxInteraction'][_0x5a55('0x37')](_0x985bf)[_0x5a55('0x1a')](handleEntityNotFound(_0x9edf42,null))[_0x5a55('0x1a')](respondWithResult(_0x9edf42,null))['catch'](handleError(_0x9edf42,null));};exports[_0x5a55('0x38')]=function(_0x4e2087,_0x3ab0bc){return db[_0x5a55('0x21')][_0x5a55('0x38')](_0x4e2087['body'],{})[_0x5a55('0x1a')](respondWithResult(_0x3ab0bc,0xc9))[_0x5a55('0x2a')](handleError(_0x3ab0bc,null));};exports[_0x5a55('0x18')]=function(_0x557804,_0x31f3b8){if(_0x557804[_0x5a55('0x39')]['id']){delete _0x557804['body']['id'];}return db[_0x5a55('0x21')]['find']({'where':{'id':_0x557804[_0x5a55('0x2c')]['id']}})[_0x5a55('0x1a')](handleEntityNotFound(_0x31f3b8,null))[_0x5a55('0x1a')](saveUpdates(_0x557804[_0x5a55('0x39')],null))[_0x5a55('0x1a')](respondWithResult(_0x31f3b8,null))['catch'](handleError(_0x31f3b8,null));};exports[_0x5a55('0x19')]=function(_0x11513d,_0x45a1de){return db[_0x5a55('0x21')][_0x5a55('0x37')]({'where':{'id':_0x11513d['params']['id']}})['then'](handleEntityNotFound(_0x45a1de,null))[_0x5a55('0x1a')](removeEntity(_0x45a1de,null))['catch'](handleError(_0x45a1de,null));};exports[_0x5a55('0x3a')]=function(_0x3aeaaf,_0x4d46fc){return db[_0x5a55('0x21')][_0x5a55('0x3a')]()[_0x5a55('0x1a')](respondWithResult(_0x4d46fc,null))[_0x5a55('0x2a')](handleError(_0x4d46fc,null));};exports[_0x5a55('0x3b')]=function(_0x1ae505,_0x24b4ea){return db['FaxMessage'][_0x5a55('0x37')]({'where':{'id':_0x1ae505[_0x5a55('0x2c')]['id']}})['then'](handleEntityNotFound(_0x24b4ea,null))[_0x5a55('0x1a')](function(_0x2748f9){if(_0x2748f9){return _0x2748f9['addMessage'](_0x1ae505[_0x5a55('0x39')][_0x5a55('0x3c')],_[_0x5a55('0x3d')](_0x1ae505[_0x5a55('0x39')],[_0x5a55('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x24b4ea,null))[_0x5a55('0x2a')](handleError(_0x24b4ea,null));};exports['getMessages']=function(_0x2fe660,_0x15deb9){var _0x35aeb={'raw':![],'where':{}};var _0x17dc57={};var _0x1b66fd={'count':0x0,'rows':[]};return db[_0x5a55('0x21')]['findOne']({'where':{'id':_0x2fe660[_0x5a55('0x2c')]['id']}})[_0x5a55('0x1a')](handleEntityNotFound(_0x15deb9,null))[_0x5a55('0x1a')](function(_0x257369){if(_0x257369){_0x17dc57['model']=_['keys'](db[_0x5a55('0x3e')][_0x5a55('0x22')]);_0x17dc57[_0x5a55('0x2e')]=_[_0x5a55('0x2d')](_0x2fe660[_0x5a55('0x2e')]);_0x17dc57[_0x5a55('0x2f')]=_[_0x5a55('0x30')](_0x17dc57[_0x5a55('0x31')],_0x17dc57[_0x5a55('0x2e')]);_0x35aeb[_0x5a55('0x32')]=_['intersection'](_0x17dc57[_0x5a55('0x31')],qs[_0x5a55('0x33')](_0x2fe660['query'][_0x5a55('0x33')]));_0x35aeb[_0x5a55('0x32')]=_0x35aeb[_0x5a55('0x32')]['length']?_0x35aeb['attributes']:_0x17dc57[_0x5a55('0x31')];if(!_0x2fe660[_0x5a55('0x2e')][_0x5a55('0x3f')](_0x5a55('0x40'))){_0x35aeb[_0x5a55('0x14')]=qs[_0x5a55('0x14')](_0x2fe660[_0x5a55('0x2e')][_0x5a55('0x14')]);_0x35aeb[_0x5a55('0x12')]=qs['offset'](_0x2fe660[_0x5a55('0x2e')][_0x5a55('0x12')]);}_0x35aeb[_0x5a55('0x41')]=qs[_0x5a55('0x42')](_0x2fe660[_0x5a55('0x2e')][_0x5a55('0x42')]);_0x35aeb[_0x5a55('0x43')]=qs[_0x5a55('0x2f')](_[_0x5a55('0x44')](_0x2fe660[_0x5a55('0x2e')],_0x17dc57['filters']));_0x35aeb[_0x5a55('0x43')][_0x5a55('0x45')]=_0x257369['id'];if(_0x2fe660[_0x5a55('0x2e')][_0x5a55('0x46')]){_0x35aeb[_0x5a55('0x43')]=_[_0x5a55('0x47')](_0x35aeb[_0x5a55('0x43')],{'$or':_[_0x5a55('0x20')](_0x35aeb[_0x5a55('0x32')],function(_0x1fa75a){var _0x3479ed={};_0x3479ed[_0x1fa75a]={'$like':'%'+_0x2fe660['query']['filter']+'%'};return _0x3479ed;})});}if(_0x2fe660[_0x5a55('0x2e')]['$gte']){var _0x256609=_0x2fe660['query'][_0x5a55('0x48')][_0x5a55('0x49')](',');var _0x33cf12={};_0x33cf12[_0x256609[0x0]]={'$gte':moment(_0x256609[0x1])['format'](_0x5a55('0x4a'))};_0x35aeb[_0x5a55('0x43')]=_[_0x5a55('0x47')](_0x35aeb['where'],_0x33cf12);}_0x35aeb=_[_0x5a55('0x47')]({},_0x35aeb,_0x2fe660[_0x5a55('0x36')]);return db[_0x5a55('0x3e')]['count']({'where':_0x35aeb[_0x5a55('0x43')]})[_0x5a55('0x1a')](function(_0x39f8c0){_0x1b66fd[_0x5a55('0x15')]=_0x39f8c0;if(_0x2fe660[_0x5a55('0x2e')][_0x5a55('0x34')]){_0x35aeb['include']=[{'all':!![]}];}return db[_0x5a55('0x3e')][_0x5a55('0x27')](_0x35aeb);})[_0x5a55('0x1a')](function(_0x3e875d){_0x1b66fd[_0x5a55('0x4b')]=_0x3e875d;return _0x1b66fd;});}})[_0x5a55('0x1a')](respondWithFilteredResult(_0x15deb9,_0x35aeb))['catch'](handleError(_0x15deb9,null));};exports[_0x5a55('0x4c')]=function(_0x12c26e,_0x1684dd){return db[_0x5a55('0x21')][_0x5a55('0x37')]({'where':{'id':_0x12c26e[_0x5a55('0x2c')]['id']}})[_0x5a55('0x1a')](handleEntityNotFound(_0x1684dd,null))[_0x5a55('0x1a')](function(_0x1d7a97){if(_0x1d7a97){return _0x1d7a97[_0x5a55('0x4d')](_0x12c26e['body'][_0x5a55('0x3c')],_[_0x5a55('0x3d')](_0x12c26e[_0x5a55('0x39')],[_0x5a55('0x3c'),'id'])||{})[_0x5a55('0x4e')](function(){return db['Tag']['findAll']({'attributes':['id',_0x5a55('0x1d'),_0x5a55('0x4f')],'where':{'id':_0x12c26e[_0x5a55('0x39')][_0x5a55('0x3c')]}});})[_0x5a55('0x1a')](function(_0x7f3355){socket[_0x5a55('0x50')](_0x5a55('0x51'),{'id':Number(_0x12c26e[_0x5a55('0x2c')]['id']),'tags':_0x7f3355||[]});return{'id':Number(_0x12c26e[_0x5a55('0x2c')]['id']),'tags':_0x7f3355||[]};});}})['then'](respondWithResult(_0x1684dd,null))['catch'](handleError(_0x1684dd,null));};exports[_0x5a55('0x52')]=function(_0x3ea074,_0x5eb0e7){return db[_0x5a55('0x21')][_0x5a55('0x37')]({'where':{'id':_0x3ea074[_0x5a55('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5eb0e7,null))[_0x5a55('0x1a')](function(_0xf165fb){if(_0xf165fb){return _0xf165fb['removeTags'](_0x3ea074[_0x5a55('0x2e')][_0x5a55('0x3c')]);}})[_0x5a55('0x1a')](respondWithStatusCode(_0x5eb0e7,null))['catch'](handleError(_0x5eb0e7,null));};exports[_0x5a55('0x53')]=function(_0x2fa3ee,_0x2ef71d){var _0x4e75de=moment()[_0x5a55('0x54')]()[_0x5a55('0x55')]();var _0x4d306d=path[_0x5a55('0x56')](config[_0x5a55('0x57')],_0x5a55('0x58'),_0x5a55('0x59'),_0x5a55('0x5a'));var _0x483d42=path[_0x5a55('0x56')](config[_0x5a55('0x57')],_0x5a55('0x58'),_0x5a55('0x59'),_0x5a55('0x5b'));var _0x13c754=path['join'](_0x4d306d,_0x4e75de);var _0x14ecc1=util[_0x5a55('0x5c')](_0x5a55('0x5d'),_0x2fa3ee[_0x5a55('0x2c')]['id'],_0x4e75de);var _0x69f0c6=path[_0x5a55('0x56')](_0x4d306d,_0x14ecc1);var _0x3f5c17=[];_0x3f5c17[_0x5a55('0x5e')]({'model':db[_0x5a55('0x5f')],'as':'Attachment','raw':!![]});var _0x166f36=[{'model':db[_0x5a55('0x3e')],'as':'Messages','attributes':['id',_0x5a55('0x39'),_0x5a55('0x60')],'include':_0x3f5c17}];return db[_0x5a55('0x21')][_0x5a55('0x37')]({'where':{'id':_0x2fa3ee[_0x5a55('0x2c')]['id']},'include':_0x166f36})[_0x5a55('0x1a')](handleEntityNotFound(_0x2ef71d,null))[_0x5a55('0x1a')](function(_0x4ed7a8){if(_0x4ed7a8&&_0x4ed7a8[_0x5a55('0x61')]){var _0x5c338f=_0x4ed7a8[_0x5a55('0x62')]({'plain':!![]});fs[_0x5a55('0x63')](_0x13c754);for(var _0x2e76f3=0x0;_0x2e76f3<_0x5c338f[_0x5a55('0x61')]['length'];_0x2e76f3++){var _0x450c48=_0x5c338f[_0x5a55('0x61')][_0x2e76f3][_0x5a55('0x5f')];if(_0x450c48){var _0x34fc76=path[_0x5a55('0x56')](_0x483d42,_0x450c48[_0x5a55('0x64')]);if(fs['existsSync'](_0x34fc76)){fs[_0x5a55('0x65')](_0x34fc76)[_0x5a55('0x66')](fs[_0x5a55('0x67')](path[_0x5a55('0x56')](_0x13c754,_0x450c48[_0x5a55('0x64')])));}}}return BPromise['resolve']()[_0x5a55('0x1a')](function(){return new BPromise(function(_0x330568,_0x1678e1){zipdir(_0x13c754,{'saveTo':_0x69f0c6},function(_0x55ce82,_0x346fc0){if(_0x55ce82)return _0x1678e1(_0x55ce82);return _0x330568(_0x346fc0);});})[_0x5a55('0x1a')](function(){return new BPromise(function(_0x493db4,_0x1619b7){rimraf(_0x13c754,function(_0x4392f4){if(_0x4392f4)_0x1619b7(_0x4392f4);return _0x493db4();});});})[_0x5a55('0x1a')](function(){return _0x2ef71d[_0x5a55('0x53')](_0x69f0c6,_0x14ecc1,function(_0x2c671a){if(_0x2c671a){console[_0x5a55('0x68')](_0x5a55('0x69'),_0x2c671a);}else{fs[_0x5a55('0x6a')](_0x69f0c6);}});});});}else{return _0x2ef71d[_0x5a55('0xf')](0xc8);}})['catch'](handleError(_0x2ef71d,null));}; \ No newline at end of file +var _0x6faf=['findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','options','findAll','rows','setTags','spread','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','basename','resolve','log','err','rimraf','moment','bluebird','util','path','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','status','end','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','sendStatus','stack','name','send','index','map','FaxInteraction','rawAttributes','type','key','getOptions','user','catch','show','keys','query','intersection','attributes','model','fields','length','includeAll','include','merge','create','body','find','params','addMessage','FaxMessage','ids','omit','getMessages'];(function(_0x7176cf,_0x2e4612){var _0x24f754=function(_0x33e969){while(--_0x33e969){_0x7176cf['push'](_0x7176cf['shift']());}};_0x24f754(++_0x2e4612);}(_0x6faf,0x7e));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var rimraf=require(_0xf6fa('0x0'));var zipdir=require('zip-dir');var moment=require(_0xf6fa('0x1'));var BPromise=require(_0xf6fa('0x2'));var util=require(_0xf6fa('0x3'));var path=require(_0xf6fa('0x4'));var fs=require('fs');var _=require(_0xf6fa('0x5'));var Redis=require(_0xf6fa('0x6'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xf6fa('0x7'));var config=require(_0xf6fa('0x8'));var db=require(_0xf6fa('0x9'))['db'];config[_0xf6fa('0xa')]=_[_0xf6fa('0xb')](config[_0xf6fa('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6fa('0xc'))(new Redis(config[_0xf6fa('0xa')]));require(_0xf6fa('0xd'))[_0xf6fa('0xe')](socket);function respondWithStatusCode(_0x2aae41,_0x33beb0){_0x33beb0=_0x33beb0||0xcc;return function(_0x5372bf){if(_0x5372bf){return _0x2aae41['sendStatus'](_0x33beb0);}return _0x2aae41[_0xf6fa('0xf')](_0x33beb0)[_0xf6fa('0x10')]();};}function respondWithResult(_0x43d0f8,_0x37b1a5){_0x37b1a5=_0x37b1a5||0xc8;return function(_0x5a5c20){if(_0x5a5c20){return _0x43d0f8[_0xf6fa('0xf')](_0x37b1a5)[_0xf6fa('0x11')](_0x5a5c20);}};}function respondWithFilteredResult(_0x331b1e,_0x19ba5f){return function(_0x5227e8){if(_0x5227e8){var _0xed0a48=typeof _0x19ba5f['offset']===_0xf6fa('0x12')&&typeof _0x19ba5f[_0xf6fa('0x13')]===_0xf6fa('0x12');var _0x3b22e7=_0x5227e8['count'];var _0x50c152=_0xed0a48?0x0:_0x19ba5f[_0xf6fa('0x14')];var _0x5ae532=_0xed0a48?_0x5227e8[_0xf6fa('0x15')]:_0x19ba5f[_0xf6fa('0x14')]+_0x19ba5f[_0xf6fa('0x13')];var _0x3ff311;if(_0x5ae532>=_0x3b22e7){_0x5ae532=_0x3b22e7;_0x3ff311=0xc8;}else{_0x3ff311=0xce;}_0x331b1e[_0xf6fa('0xf')](_0x3ff311);return _0x331b1e[_0xf6fa('0x16')](_0xf6fa('0x17'),_0x50c152+'-'+_0x5ae532+'/'+_0x3b22e7)[_0xf6fa('0x11')](_0x5227e8);}return null;};}function saveUpdates(_0x302ddb){return function(_0x1a991d){if(_0x1a991d){return _0x1a991d[_0xf6fa('0x18')](_0x302ddb)[_0xf6fa('0x19')](function(_0x18a66e){return _0x18a66e;});}return null;};}function removeEntity(_0x4dfff6){return function(_0x4cd671){if(_0x4cd671){return _0x4cd671[_0xf6fa('0x1a')]()[_0xf6fa('0x19')](function(){_0x4dfff6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd4b709){return function(_0x1a89e3){if(!_0x1a89e3){_0xd4b709[_0xf6fa('0x1b')](0x194);}return _0x1a89e3;};}function handleError(_0x6d467a,_0x526c84){_0x526c84=_0x526c84||0x1f4;return function(_0x1feb42){logger['error'](_0x1feb42[_0xf6fa('0x1c')]);if(_0x1feb42[_0xf6fa('0x1d')]){delete _0x1feb42['name'];}_0x6d467a[_0xf6fa('0xf')](_0x526c84)[_0xf6fa('0x1e')](_0x1feb42);};}exports[_0xf6fa('0x1f')]=function(_0x1f0104,_0x1e9c04){var _0x393f4f={};var _0xb9e259=_[_0xf6fa('0x20')](db[_0xf6fa('0x21')][_0xf6fa('0x22')],function(_0x5b3079){return{'name':_0x5b3079['fieldName'],'type':_0x5b3079[_0xf6fa('0x23')][_0xf6fa('0x24')]};});_0x393f4f=qs[_0xf6fa('0x25')](_0xb9e259,_0x1f0104);return interaction['findAll']('fax',_0x1f0104['query'],_0x1f0104[_0xf6fa('0x26')],_0x393f4f,_0xb9e259)[_0xf6fa('0x19')](respondWithFilteredResult(_0x1e9c04,_0x393f4f))[_0xf6fa('0x27')](handleError(_0x1e9c04,null));};exports[_0xf6fa('0x28')]=function(_0x3ae162,_0x389a1f){var _0x275f70={'raw':![],'where':{'id':_0x3ae162['params']['id']}},_0x182584={};_0x182584['model']=_[_0xf6fa('0x29')](db[_0xf6fa('0x21')][_0xf6fa('0x22')]);_0x182584[_0xf6fa('0x2a')]=_['keys'](_0x3ae162[_0xf6fa('0x2a')]);_0x182584['filters']=_[_0xf6fa('0x2b')](_0x182584['model'],_0x182584[_0xf6fa('0x2a')]);_0x275f70[_0xf6fa('0x2c')]=_[_0xf6fa('0x2b')](_0x182584[_0xf6fa('0x2d')],qs['fields'](_0x3ae162[_0xf6fa('0x2a')][_0xf6fa('0x2e')]));_0x275f70['attributes']=_0x275f70[_0xf6fa('0x2c')][_0xf6fa('0x2f')]?_0x275f70[_0xf6fa('0x2c')]:_0x182584['model'];if(_0x3ae162['query'][_0xf6fa('0x30')]){_0x275f70[_0xf6fa('0x31')]=[{'all':!![]}];}_0x275f70=_[_0xf6fa('0x32')]({},_0x275f70,_0x3ae162['options']);return db[_0xf6fa('0x21')]['find'](_0x275f70)[_0xf6fa('0x19')](handleEntityNotFound(_0x389a1f,null))[_0xf6fa('0x19')](respondWithResult(_0x389a1f,null))['catch'](handleError(_0x389a1f,null));};exports[_0xf6fa('0x33')]=function(_0x373d5b,_0x23898f){return db[_0xf6fa('0x21')][_0xf6fa('0x33')](_0x373d5b[_0xf6fa('0x34')],{})[_0xf6fa('0x19')](respondWithResult(_0x23898f,0xc9))[_0xf6fa('0x27')](handleError(_0x23898f,null));};exports[_0xf6fa('0x18')]=function(_0x29290d,_0x14fa9f){if(_0x29290d[_0xf6fa('0x34')]['id']){delete _0x29290d[_0xf6fa('0x34')]['id'];}return db[_0xf6fa('0x21')][_0xf6fa('0x35')]({'where':{'id':_0x29290d['params']['id']}})['then'](handleEntityNotFound(_0x14fa9f,null))[_0xf6fa('0x19')](saveUpdates(_0x29290d[_0xf6fa('0x34')],null))['then'](respondWithResult(_0x14fa9f,null))[_0xf6fa('0x27')](handleError(_0x14fa9f,null));};exports[_0xf6fa('0x1a')]=function(_0x57c9c2,_0x186214){return db['FaxInteraction'][_0xf6fa('0x35')]({'where':{'id':_0x57c9c2[_0xf6fa('0x36')]['id']}})[_0xf6fa('0x19')](handleEntityNotFound(_0x186214,null))[_0xf6fa('0x19')](removeEntity(_0x186214,null))[_0xf6fa('0x27')](handleError(_0x186214,null));};exports['describe']=function(_0x2a05ee,_0x46ba51){return db[_0xf6fa('0x21')]['describe']()[_0xf6fa('0x19')](respondWithResult(_0x46ba51,null))['catch'](handleError(_0x46ba51,null));};exports[_0xf6fa('0x37')]=function(_0x353370,_0x3357b1){return db[_0xf6fa('0x38')][_0xf6fa('0x35')]({'where':{'id':_0x353370[_0xf6fa('0x36')]['id']}})[_0xf6fa('0x19')](handleEntityNotFound(_0x3357b1,null))[_0xf6fa('0x19')](function(_0x333391){if(_0x333391){return _0x333391[_0xf6fa('0x37')](_0x353370[_0xf6fa('0x34')][_0xf6fa('0x39')],_[_0xf6fa('0x3a')](_0x353370['body'],[_0xf6fa('0x39'),'id'])||{});}})[_0xf6fa('0x19')](respondWithResult(_0x3357b1,null))['catch'](handleError(_0x3357b1,null));};exports[_0xf6fa('0x3b')]=function(_0x5147e5,_0x55c398){var _0x1536a3={'raw':![],'where':{}};var _0x3b832b={};var _0x54efc8={'count':0x0,'rows':[]};return db[_0xf6fa('0x21')][_0xf6fa('0x3c')]({'where':{'id':_0x5147e5[_0xf6fa('0x36')]['id']}})[_0xf6fa('0x19')](handleEntityNotFound(_0x55c398,null))[_0xf6fa('0x19')](function(_0x3537f3){if(_0x3537f3){_0x3b832b[_0xf6fa('0x2d')]=_[_0xf6fa('0x29')](db[_0xf6fa('0x38')]['rawAttributes']);_0x3b832b[_0xf6fa('0x2a')]=_['keys'](_0x5147e5[_0xf6fa('0x2a')]);_0x3b832b[_0xf6fa('0x3d')]=_['intersection'](_0x3b832b[_0xf6fa('0x2d')],_0x3b832b[_0xf6fa('0x2a')]);_0x1536a3['attributes']=_['intersection'](_0x3b832b['model'],qs['fields'](_0x5147e5[_0xf6fa('0x2a')]['fields']));_0x1536a3[_0xf6fa('0x2c')]=_0x1536a3[_0xf6fa('0x2c')][_0xf6fa('0x2f')]?_0x1536a3[_0xf6fa('0x2c')]:_0x3b832b[_0xf6fa('0x2d')];if(!_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x3e')](_0xf6fa('0x3f'))){_0x1536a3['limit']=qs[_0xf6fa('0x13')](_0x5147e5[_0xf6fa('0x2a')]['limit']);_0x1536a3[_0xf6fa('0x14')]=qs['offset'](_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x14')]);}_0x1536a3[_0xf6fa('0x40')]=qs[_0xf6fa('0x41')](_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x41')]);_0x1536a3[_0xf6fa('0x42')]=qs['filters'](_[_0xf6fa('0x43')](_0x5147e5[_0xf6fa('0x2a')],_0x3b832b['filters']));_0x1536a3['where'][_0xf6fa('0x44')]=_0x3537f3['id'];if(_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x45')]){_0x1536a3[_0xf6fa('0x42')]=_[_0xf6fa('0x32')](_0x1536a3['where'],{'$or':_[_0xf6fa('0x20')](_0x1536a3[_0xf6fa('0x2c')],function(_0x109af3){var _0x4c743e={};_0x4c743e[_0x109af3]={'$like':'%'+_0x5147e5['query'][_0xf6fa('0x45')]+'%'};return _0x4c743e;})});}if(_0x5147e5[_0xf6fa('0x2a')]['$gte']){var _0x33a643=_0x5147e5[_0xf6fa('0x2a')]['$gte']['split'](',');var _0x320e27={};_0x320e27[_0x33a643[0x0]]={'$gte':moment(_0x33a643[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1536a3[_0xf6fa('0x42')]=_[_0xf6fa('0x32')](_0x1536a3[_0xf6fa('0x42')],_0x320e27);}_0x1536a3=_['merge']({},_0x1536a3,_0x5147e5[_0xf6fa('0x46')]);return db['FaxMessage']['count']({'where':_0x1536a3[_0xf6fa('0x42')]})[_0xf6fa('0x19')](function(_0x4d20bb){_0x54efc8[_0xf6fa('0x15')]=_0x4d20bb;if(_0x5147e5[_0xf6fa('0x2a')][_0xf6fa('0x30')]){_0x1536a3[_0xf6fa('0x31')]=[{'all':!![]}];}return db[_0xf6fa('0x38')][_0xf6fa('0x47')](_0x1536a3);})[_0xf6fa('0x19')](function(_0x10b6b7){_0x54efc8[_0xf6fa('0x48')]=_0x10b6b7;return _0x54efc8;});}})[_0xf6fa('0x19')](respondWithFilteredResult(_0x55c398,_0x1536a3))[_0xf6fa('0x27')](handleError(_0x55c398,null));};exports['addTags']=function(_0x5b7052,_0x370d36){return db[_0xf6fa('0x21')][_0xf6fa('0x35')]({'where':{'id':_0x5b7052[_0xf6fa('0x36')]['id']}})['then'](handleEntityNotFound(_0x370d36,null))[_0xf6fa('0x19')](function(_0x13d34f){if(_0x13d34f){return _0x13d34f[_0xf6fa('0x49')](_0x5b7052[_0xf6fa('0x34')]['ids'],_[_0xf6fa('0x3a')](_0x5b7052[_0xf6fa('0x34')],['ids','id'])||{})[_0xf6fa('0x4a')](function(){return db['Tag']['findAll']({'attributes':['id',_0xf6fa('0x1d'),'color'],'where':{'id':_0x5b7052['body'][_0xf6fa('0x39')]}});})[_0xf6fa('0x19')](function(_0x268cd3){socket['emit']('faxInteractionTags:save',{'id':Number(_0x5b7052['params']['id']),'tags':_0x268cd3||[]});return{'id':Number(_0x5b7052['params']['id']),'tags':_0x268cd3||[]};});}})[_0xf6fa('0x19')](respondWithResult(_0x370d36,null))['catch'](handleError(_0x370d36,null));};exports[_0xf6fa('0x4b')]=function(_0x517737,_0x46da80){return db['FaxInteraction'][_0xf6fa('0x35')]({'where':{'id':_0x517737[_0xf6fa('0x36')]['id']}})['then'](handleEntityNotFound(_0x46da80,null))[_0xf6fa('0x19')](function(_0x5c502b){if(_0x5c502b){return _0x5c502b[_0xf6fa('0x4b')](_0x517737['query'][_0xf6fa('0x39')]);}})[_0xf6fa('0x19')](respondWithStatusCode(_0x46da80,null))[_0xf6fa('0x27')](handleError(_0x46da80,null));};exports[_0xf6fa('0x4c')]=function(_0x5e225b,_0x38dd93){var _0x4357fc=moment()[_0xf6fa('0x4d')]()['toString']();var _0x34147e=path[_0xf6fa('0x4e')](config['root'],_0xf6fa('0x4f'),_0xf6fa('0x50'),_0xf6fa('0x51'));var _0x3e24b2=path[_0xf6fa('0x4e')](config[_0xf6fa('0x52')],'server',_0xf6fa('0x50'),_0xf6fa('0x53'));var _0x1e06c9=path[_0xf6fa('0x4e')](_0x34147e,_0x4357fc);var _0x540280=util['format'](_0xf6fa('0x54'),_0x5e225b[_0xf6fa('0x36')]['id'],_0x4357fc);var _0xa50e66=path[_0xf6fa('0x4e')](_0x34147e,_0x540280);var _0x21ac5f=[];_0x21ac5f[_0xf6fa('0x55')]({'model':db[_0xf6fa('0x56')],'as':_0xf6fa('0x56'),'raw':!![]});var _0x380534=[{'model':db[_0xf6fa('0x38')],'as':_0xf6fa('0x57'),'attributes':['id',_0xf6fa('0x34'),_0xf6fa('0x58')],'include':_0x21ac5f}];return db['FaxInteraction'][_0xf6fa('0x35')]({'where':{'id':_0x5e225b[_0xf6fa('0x36')]['id']},'include':_0x380534})[_0xf6fa('0x19')](handleEntityNotFound(_0x38dd93,null))[_0xf6fa('0x19')](function(_0x128cbe){if(_0x128cbe&&_0x128cbe[_0xf6fa('0x57')]){var _0x51c838=_0x128cbe['get']({'plain':!![]});fs['mkdirSync'](_0x1e06c9);for(var _0x451898=0x0;_0x451898<_0x51c838[_0xf6fa('0x57')]['length'];_0x451898++){var _0x317510=_0x51c838['Messages'][_0x451898][_0xf6fa('0x56')];if(_0x317510){var _0x471347=path[_0xf6fa('0x4e')](_0x3e24b2,_0x317510['basename']);if(fs['existsSync'](_0x471347)){fs['createReadStream'](_0x471347)['pipe'](fs['createWriteStream'](path[_0xf6fa('0x4e')](_0x1e06c9,_0x317510[_0xf6fa('0x59')])));}}}return BPromise[_0xf6fa('0x5a')]()[_0xf6fa('0x19')](function(){return new BPromise(function(_0x377a82,_0x577576){zipdir(_0x1e06c9,{'saveTo':_0xa50e66},function(_0x5e7062,_0x1b908a){if(_0x5e7062)return _0x577576(_0x5e7062);return _0x377a82(_0x1b908a);});})['then'](function(){return new BPromise(function(_0x14b532,_0x3f30c2){rimraf(_0x1e06c9,function(_0x1e2ba6){if(_0x1e2ba6)_0x3f30c2(_0x1e2ba6);return _0x14b532();});});})[_0xf6fa('0x19')](function(){return _0x38dd93['download'](_0xa50e66,_0x540280,function(_0x223bf2){if(_0x223bf2){console[_0xf6fa('0x5b')](_0xf6fa('0x5c'),_0x223bf2);}else{fs['unlinkSync'](_0xa50e66);}});});});}else{return _0x38dd93[_0xf6fa('0x1b')](0xc8);}})[_0xf6fa('0x27')](handleError(_0x38dd93,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index f75dfd2..acca270 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 _0x502e=['then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map'];(function(_0x47361f,_0x3d25f4){var _0x231a00=function(_0x30f45f){while(--_0x30f45f){_0x47361f['push'](_0x47361f['shift']());}};_0x231a00(++_0x3d25f4);}(_0x502e,0x79));var _0xe502=function(_0x9fd1be,_0x168c55){_0x9fd1be=_0x9fd1be-0x0;var _0x5b2c8b=_0x502e[_0x9fd1be];return _0x5b2c8b;};'use strict';var EventEmitter=require(_0xe502('0x0'));var FaxInteraction=require(_0xe502('0x1'))['db'][_0xe502('0x2')];var FaxMessage=require(_0xe502('0x1'))['db'][_0xe502('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe502('0x4')](0x0);var events={'afterCreate':_0xe502('0x5'),'afterUpdate':_0xe502('0x6'),'afterDestroy':_0xe502('0x7')};function emitEvent(_0x519bb3){return function(_0x579f34,_0x5ea6e5,_0x4c740c){_0x579f34[_0xe502('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x47bc14){_0x579f34[_0xe502('0x9')](_0xe502('0xa'),_0x47bc14[_0xe502('0xb')](function(_0x617381){return{'id':_0x617381['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x579f34['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe502('0xc')](function(_0x5cafe0){_0x579f34[_0xe502('0x9')](_0xe502('0xd'),_0x5cafe0[_0xe502('0xe')]);FaxInteractionEvents[_0xe502('0xf')](_0x519bb3+':'+_0x579f34['id'],_0x579f34);FaxInteractionEvents[_0xe502('0xf')](_0x519bb3,_0x579f34);_0x4c740c(null);})[_0xe502('0x10')](_0x4c740c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xe502('0x11')](e,emitEvent(event));}}module[_0xe502('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0xaf8d=['hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','update','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty'];(function(_0x4bb7ca,_0x31ce9e){var _0xb3b203=function(_0x524b04){while(--_0x524b04){_0x4bb7ca['push'](_0x4bb7ca['shift']());}};_0xb3b203(++_0x31ce9e);}(_0xaf8d,0x1f1));var _0xdaf8=function(_0xcd363e,_0x33a5f7){_0xcd363e=_0xcd363e-0x0;var _0x4f4f25=_0xaf8d[_0xcd363e];return _0x4f4f25;};'use strict';var EventEmitter=require(_0xdaf8('0x0'));var FaxInteraction=require(_0xdaf8('0x1'))['db'][_0xdaf8('0x2')];var FaxMessage=require(_0xdaf8('0x1'))['db'][_0xdaf8('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdaf8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x175d26){return function(_0x405672,_0x79a498,_0x1378f4){_0x405672['getUsers']({'attributes':['id'],'raw':!![]})[_0xdaf8('0x5')](function(_0x208d10){_0x405672[_0xdaf8('0x6')](_0xdaf8('0x7'),_0x208d10[_0xdaf8('0x8')](function(_0x5377ae){return{'id':_0x5377ae['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x405672['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x277892){_0x405672[_0xdaf8('0x6')](_0xdaf8('0x9'),_0x277892[_0xdaf8('0xa')]);FaxInteractionEvents[_0xdaf8('0xb')](_0x175d26+':'+_0x405672['id'],_0x405672);FaxInteractionEvents[_0xdaf8('0xb')](_0x175d26,_0x405672);_0x1378f4(null);})['catch'](_0x1378f4(null));};}for(var e in events){if(events[_0xdaf8('0xc')](e)){var event=events[e];FaxInteraction[_0xdaf8('0xd')](e,emitEvent(event));}}module[_0xdaf8('0xe')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index a14d104..3896c96 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 _0x278b=['bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x13a7d0,_0xe26397){var _0x441364=function(_0x4248f4){while(--_0x4248f4){_0x13a7d0['push'](_0x13a7d0['shift']());}};_0x441364(++_0xe26397);}(_0x278b,0xec));var _0xb278=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0x278b[_0x3f88bc];return _0x4df1c4;};'use strict';var _=require('lodash');var util=require(_0xb278('0x0'));var logger=require(_0xb278('0x1'))(_0xb278('0x2'));var moment=require(_0xb278('0x3'));var BPromise=require(_0xb278('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb278('0x5'));var rimraf=require(_0xb278('0x6'));var config=require(_0xb278('0x7'));var attributes=require(_0xb278('0x8'));module['exports']=function(_0x22455c,_0x189349){return _0x22455c[_0xb278('0x9')]('FaxInteraction',attributes,{'tableName':_0xb278('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a3a92,_0x4352ad,_0x386ed5){if(_0x3a3a92[_0xb278('0xb')](_0xb278('0xc'))){_0x3a3a92[_0xb278('0xd')]=moment()[_0xb278('0xe')](_0xb278('0xf'));}_0x386ed5(null,_0x3a3a92);}}});}; \ No newline at end of file +var _0xcaf1=['closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x3a8db5,_0x31cff7){var _0x2c03cd=function(_0x47dba0){while(--_0x47dba0){_0x3a8db5['push'](_0x3a8db5['shift']());}};_0x2c03cd(++_0x31cff7);}(_0xcaf1,0x82));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1caf('0x0'));var logger=require(_0x1caf('0x1'))(_0x1caf('0x2'));var moment=require(_0x1caf('0x3'));var BPromise=require(_0x1caf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1caf('0x5'));var config=require(_0x1caf('0x6'));var attributes=require(_0x1caf('0x7'));module[_0x1caf('0x8')]=function(_0xc3dbee,_0x1684e1){return _0xc3dbee[_0x1caf('0x9')](_0x1caf('0xa'),attributes,{'tableName':_0x1caf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f7728,_0x1c58f9,_0x59deee){if(_0x4f7728[_0x1caf('0xc')](_0x1caf('0xd'))){_0x4f7728[_0x1caf('0xe')]=moment()['format'](_0x1caf('0xf'));}_0x59deee(null,_0x4f7728);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index c224fe3..ce7a97d 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 _0x8c5a=['update','body','options','raw','where','attributes','limit','debug','stringify','catch','AddTagsToFaxInteraction','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateFaxInteraction','FaxInteraction'];(function(_0x596778,_0x33dbb1){var _0x34e022=function(_0x4f71d0){while(--_0x4f71d0){_0x596778['push'](_0x596778['shift']());}};_0x34e022(++_0x33dbb1);}(_0x8c5a,0x126));var _0xa8c5=function(_0x3c14a1,_0x5a6937){_0x3c14a1=_0x3c14a1-0x0;var _0x1122a7=_0x8c5a[_0x3c14a1];return _0x1122a7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa8c5('0x0'));var BPromise=require(_0xa8c5('0x1'));var rs=require(_0xa8c5('0x2'));var fs=require('fs');var Redis=require(_0xa8c5('0x3'));var db=require(_0xa8c5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8c5('0x5'))(_0xa8c5('0x6'));var config=require(_0xa8c5('0x7'));var jayson=require(_0xa8c5('0x8'));var client=jayson[_0xa8c5('0x9')]['http']({'port':0x232a});config[_0xa8c5('0xa')]=_['defaults'](config['redis'],{'host':_0xa8c5('0xb'),'port':0x18eb});var socket=require(_0xa8c5('0xc'))(new Redis(config[_0xa8c5('0xa')]));require(_0xa8c5('0xd'))[_0xa8c5('0xe')](socket);function respondWithRpcPromise(_0x377ce2,_0x351155,_0x3b8ba3){return new BPromise(function(_0x2de38e,_0x3bd34e){return client[_0xa8c5('0xf')](_0x377ce2,_0x3b8ba3)[_0xa8c5('0x10')](function(_0x153443){logger[_0xa8c5('0x11')](_0xa8c5('0x12'),_0x351155,_0xa8c5('0x13'));logger['debug'](_0xa8c5('0x14'),_0x351155,_0xa8c5('0x13'),JSON['stringify'](_0x153443));if(_0x153443[_0xa8c5('0x15')]){if(_0x153443[_0xa8c5('0x15')][_0xa8c5('0x16')]===0x1f4){logger['error'](_0xa8c5('0x12'),_0x351155,_0x153443[_0xa8c5('0x15')][_0xa8c5('0x17')]);return _0x3bd34e(_0x153443[_0xa8c5('0x15')][_0xa8c5('0x17')]);}logger[_0xa8c5('0x15')](_0xa8c5('0x12'),_0x351155,_0x153443[_0xa8c5('0x15')][_0xa8c5('0x17')]);return _0x2de38e(_0x153443[_0xa8c5('0x15')][_0xa8c5('0x17')]);}else{logger[_0xa8c5('0x11')](_0xa8c5('0x12'),_0x351155,_0xa8c5('0x13'));_0x2de38e(_0x153443['result'][_0xa8c5('0x17')]);}})['catch'](function(_0x1503f6){logger['error'](_0xa8c5('0x12'),_0x351155,_0x1503f6);_0x3bd34e(_0x1503f6);});});}exports[_0xa8c5('0x18')]=function(_0x307bf8){var _0x4d1eb7=this;return new Promise(function(_0x285f1b,_0x530448){return db[_0xa8c5('0x19')][_0xa8c5('0x1a')](_0x307bf8[_0xa8c5('0x1b')],{'raw':_0x307bf8[_0xa8c5('0x1c')]?_0x307bf8['options'][_0xa8c5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x307bf8[_0xa8c5('0x1c')]?_0x307bf8[_0xa8c5('0x1c')][_0xa8c5('0x1e')]||null:null,'attributes':_0x307bf8[_0xa8c5('0x1c')]?_0x307bf8[_0xa8c5('0x1c')][_0xa8c5('0x1f')]||null:null,'limit':_0x307bf8['options']?_0x307bf8[_0xa8c5('0x1c')][_0xa8c5('0x20')]||null:null})[_0xa8c5('0x10')](function(_0x39b693){logger[_0xa8c5('0x11')](_0xa8c5('0x18'),_0x307bf8);logger[_0xa8c5('0x21')](_0xa8c5('0x18'),_0x307bf8,JSON[_0xa8c5('0x22')](_0x39b693));_0x285f1b(_0x39b693);})[_0xa8c5('0x23')](function(_0x583517){logger['error'](_0xa8c5('0x18'),_0x583517['message'],_0x307bf8);_0x530448(_0x4d1eb7[_0xa8c5('0x15')](0x1f4,_0x583517['message']));});});};exports[_0xa8c5('0x24')]=function(_0x3dc011){return new Promise(function(_0x37a149,_0x37587e){return db[_0xa8c5('0x19')]['find']({'where':_0x3dc011['options']?_0x3dc011['options']['where']||null:null})[_0xa8c5('0x10')](function(_0x249316){if(_0x249316){return _0x249316['addTags'](_0x3dc011['body'][_0xa8c5('0x25')],_[_0xa8c5('0x26')](_0x3dc011[_0xa8c5('0x1b')],[_0xa8c5('0x25'),'id'])||{});}})['spread'](function(_0x13e595){logger[_0xa8c5('0x11')](_0xa8c5('0x27'),_0x3dc011);logger['debug'](_0xa8c5('0x27'),_0x3dc011,JSON[_0xa8c5('0x22')](_0x13e595));_0x37a149(_0x13e595);})['catch'](function(_0x2f3290){logger[_0xa8c5('0x15')](_0xa8c5('0x27'),_0x2f3290[_0xa8c5('0x17')],_0x3dc011);_0x37587e(_this['error'](0x1f4,_0x2f3290['message']));});});}; \ No newline at end of file +var _0x6913=['stringify','error','code','message','result','UpdateFaxInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','FaxInteraction','find','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x2a97fa,_0x1eef81){var _0x5e3dc3=function(_0x1542e6){while(--_0x1542e6){_0x2a97fa['push'](_0x2a97fa['shift']());}};_0x5e3dc3(++_0x1eef81);}(_0x6913,0x115));var _0x3691=function(_0x3851ca,_0x5d276b){_0x3851ca=_0x3851ca-0x0;var _0x381f36=_0x6913[_0x3851ca];return _0x381f36;};'use strict';var _=require(_0x3691('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3691('0x1'));var rs=require(_0x3691('0x2'));var fs=require('fs');var Redis=require(_0x3691('0x3'));var db=require(_0x3691('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3691('0x5'))(_0x3691('0x6'));var config=require(_0x3691('0x7'));var jayson=require(_0x3691('0x8'));var client=jayson[_0x3691('0x9')][_0x3691('0xa')]({'port':0x232a});config['redis']=_[_0x3691('0xb')](config[_0x3691('0xc')],{'host':_0x3691('0xd'),'port':0x18eb});var socket=require(_0x3691('0xe'))(new Redis(config['redis']));require(_0x3691('0xf'))[_0x3691('0x10')](socket);function respondWithRpcPromise(_0x82e06f,_0x4df9a4,_0x422e14){return new BPromise(function(_0x16b610,_0x51301d){return client[_0x3691('0x11')](_0x82e06f,_0x422e14)[_0x3691('0x12')](function(_0x1a588f){logger[_0x3691('0x13')](_0x3691('0x14'),_0x4df9a4,_0x3691('0x15'));logger[_0x3691('0x16')](_0x3691('0x17'),_0x4df9a4,_0x3691('0x15'),JSON[_0x3691('0x18')](_0x1a588f));if(_0x1a588f['error']){if(_0x1a588f[_0x3691('0x19')][_0x3691('0x1a')]===0x1f4){logger[_0x3691('0x19')](_0x3691('0x14'),_0x4df9a4,_0x1a588f[_0x3691('0x19')][_0x3691('0x1b')]);return _0x51301d(_0x1a588f[_0x3691('0x19')][_0x3691('0x1b')]);}logger[_0x3691('0x19')](_0x3691('0x14'),_0x4df9a4,_0x1a588f[_0x3691('0x19')][_0x3691('0x1b')]);return _0x16b610(_0x1a588f['error'][_0x3691('0x1b')]);}else{logger['info'](_0x3691('0x14'),_0x4df9a4,'request\x20sent');_0x16b610(_0x1a588f[_0x3691('0x1c')][_0x3691('0x1b')]);}})['catch'](function(_0x499ed7){logger[_0x3691('0x19')](_0x3691('0x14'),_0x4df9a4,_0x499ed7);_0x51301d(_0x499ed7);});});}exports[_0x3691('0x1d')]=function(_0x42caa7){var _0x521546=this;return new Promise(function(_0x456835,_0x3dacbc){return db['FaxInteraction']['update'](_0x42caa7[_0x3691('0x1e')],{'raw':_0x42caa7[_0x3691('0x1f')]?_0x42caa7[_0x3691('0x1f')][_0x3691('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42caa7[_0x3691('0x1f')]?_0x42caa7[_0x3691('0x1f')][_0x3691('0x21')]||null:null,'attributes':_0x42caa7['options']?_0x42caa7[_0x3691('0x1f')][_0x3691('0x22')]||null:null,'limit':_0x42caa7[_0x3691('0x1f')]?_0x42caa7['options'][_0x3691('0x23')]||null:null})['then'](function(_0x43151f){logger['info'](_0x3691('0x1d'),_0x42caa7);logger[_0x3691('0x16')](_0x3691('0x1d'),_0x42caa7,JSON[_0x3691('0x18')](_0x43151f));_0x456835(_0x43151f);})[_0x3691('0x24')](function(_0x300301){logger[_0x3691('0x19')](_0x3691('0x1d'),_0x300301[_0x3691('0x1b')],_0x42caa7);_0x3dacbc(_0x521546[_0x3691('0x19')](0x1f4,_0x300301[_0x3691('0x1b')]));});});};exports[_0x3691('0x25')]=function(_0x48a633){return new Promise(function(_0x285b87,_0x4bbab8){return db[_0x3691('0x26')][_0x3691('0x27')]({'where':_0x48a633['options']?_0x48a633[_0x3691('0x1f')][_0x3691('0x21')]||null:null})[_0x3691('0x12')](function(_0x5cfae7){if(_0x5cfae7){return _0x5cfae7['addTags'](_0x48a633[_0x3691('0x1e')][_0x3691('0x28')],_['omit'](_0x48a633[_0x3691('0x1e')],[_0x3691('0x28'),'id'])||{});}})[_0x3691('0x29')](function(_0x45f642){logger['info'](_0x3691('0x2a'),_0x48a633);logger[_0x3691('0x16')](_0x3691('0x2a'),_0x48a633,JSON[_0x3691('0x18')](_0x45f642));_0x285b87(_0x45f642);})[_0x3691('0x24')](function(_0x253ad1){logger[_0x3691('0x19')](_0x3691('0x2a'),_0x253ad1[_0x3691('0x1b')],_0x48a633);_0x4bbab8(_this[_0x3691('0x19')](0x1f4,_0x253ad1[_0x3691('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 036acb0..3317249 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 _0x7005=['faxInteraction:','./faxInteraction.events','save','remove','emit','removeListener','register'];(function(_0x337dd9,_0x54e3f3){var _0x20f4fc=function(_0x4230de){while(--_0x4230de){_0x337dd9['push'](_0x337dd9['shift']());}};_0x20f4fc(++_0x54e3f3);}(_0x7005,0x71));var _0x5700=function(_0x5218ce,_0x17ac96){_0x5218ce=_0x5218ce-0x0;var _0x428fe3=_0x7005[_0x5218ce];return _0x428fe3;};'use strict';var FaxInteractionEvents=require(_0x5700('0x0'));var events=[_0x5700('0x1'),_0x5700('0x2'),'update'];function createListener(_0x222e7d,_0x28dcee){return function(_0x1e2d92){_0x28dcee[_0x5700('0x3')](_0x222e7d,_0x1e2d92);};}function removeListener(_0x545464,_0x4fd02b){return function(){FaxInteractionEvents[_0x5700('0x4')](_0x545464,_0x4fd02b);};}exports[_0x5700('0x5')]=function(_0x1c6a95){for(var _0x3730ec=0x0,_0x400c9a=events['length'];_0x3730ec<_0x400c9a;_0x3730ec++){var _0x59cf01=events[_0x3730ec];var _0x45e241=createListener(_0x5700('0x6')+_0x59cf01,_0x1c6a95);FaxInteractionEvents['on'](_0x59cf01,_0x45e241);}}; \ No newline at end of file +var _0xc653=['length','faxInteraction:','save','remove','update','emit','removeListener','register'];(function(_0xda6d69,_0x541077){var _0x46c35a=function(_0x31e08c){while(--_0x31e08c){_0xda6d69['push'](_0xda6d69['shift']());}};_0x46c35a(++_0x541077);}(_0xc653,0x122));var _0x3c65=function(_0x3b0491,_0x23f524){_0x3b0491=_0x3b0491-0x0;var _0x3ee467=_0xc653[_0x3b0491];return _0x3ee467;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x3c65('0x0'),_0x3c65('0x1'),_0x3c65('0x2')];function createListener(_0x156606,_0x58fb8d){return function(_0x145994){_0x58fb8d[_0x3c65('0x3')](_0x156606,_0x145994);};}function removeListener(_0x89b45b,_0x3f9bac){return function(){FaxInteractionEvents[_0x3c65('0x4')](_0x89b45b,_0x3f9bac);};}exports[_0x3c65('0x5')]=function(_0x2817b2){for(var _0x98850b=0x0,_0x169b6b=events[_0x3c65('0x6')];_0x98850b<_0x169b6b;_0x98850b++){var _0x58c713=events[_0x98850b];var _0x5c586b=createListener(_0x3c65('0x7')+_0x58c713,_0x2817b2);FaxInteractionEvents['on'](_0x58c713,_0x5c586b);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e8044dd..265ed76 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 _0x1311=['faxinteraction:addtags','addTags','put','/:id','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','fax'];(function(_0x72cb50,_0x33ba23){var _0x32c397=function(_0x46a302){while(--_0x46a302){_0x72cb50['push'](_0x72cb50['shift']());}};_0x32c397(++_0x33ba23);}(_0x1311,0x1c4));var _0x1131=function(_0x32ced6,_0x2b8aa7){_0x32ced6=_0x32ced6-0x0;var _0x38e47d=_0x1311[_0x32ced6];return _0x38e47d;};'use strict';var multer=require(_0x1131('0x0'));var util=require(_0x1131('0x1'));var path=require(_0x1131('0x2'));var timeout=require(_0x1131('0x3'));var express=require(_0x1131('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1131('0x5'));var interaction=require(_0x1131('0x6'));var config=require(_0x1131('0x7'));var controller=require(_0x1131('0x8'));router[_0x1131('0x9')]('/',auth[_0x1131('0xa')](),controller[_0x1131('0xb')]);router[_0x1131('0x9')](_0x1131('0xc'),auth[_0x1131('0xa')](),controller['describe']);router[_0x1131('0x9')]('/:id',auth[_0x1131('0xa')](),controller[_0x1131('0xd')]);router[_0x1131('0x9')](_0x1131('0xe'),auth['isAuthenticated'](),controller[_0x1131('0xf')]);router[_0x1131('0x9')](_0x1131('0x10'),auth[_0x1131('0xa')](),controller[_0x1131('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1131('0x12')]);router[_0x1131('0x13')](_0x1131('0xe'),auth[_0x1131('0xa')](),controller[_0x1131('0x14')]);router['post'](_0x1131('0x15'),auth[_0x1131('0xa')](),interaction[_0x1131('0x16')](_0x1131('0x17'),_0x1131('0x18')),controller[_0x1131('0x19')]);router[_0x1131('0x1a')](_0x1131('0x1b'),auth[_0x1131('0xa')](),interaction[_0x1131('0x16')]('fax',_0x1131('0x1c')),controller[_0x1131('0x1d')]);router[_0x1131('0x1e')](_0x1131('0x1b'),auth[_0x1131('0xa')](),interaction[_0x1131('0x16')](_0x1131('0x17'),_0x1131('0x1f')),controller[_0x1131('0x20')]);router[_0x1131('0x1e')](_0x1131('0x15'),auth[_0x1131('0xa')](),controller['removeTags']);module[_0x1131('0x21')]=router; \ No newline at end of file +var _0xe497=['create','post','/:id/messages','/:id/tags','tracked','addTags','faxinteraction:update','delete','fax','faxinteraction:destroy','removeTags','exports','path','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/download'];(function(_0x1b56c4,_0xa25322){var _0x75308d=function(_0x72b72a){while(--_0x72b72a){_0x1b56c4['push'](_0x1b56c4['shift']());}};_0x75308d(++_0xa25322);}(_0xe497,0xfe));var _0x7e49=function(_0x5b9424,_0x5a1ac4){_0x5b9424=_0x5b9424-0x0;var _0xee1dd4=_0xe497[_0x5b9424];return _0xee1dd4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e49('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7e49('0x1'));var interaction=require(_0x7e49('0x2'));var config=require('../../config/environment');var controller=require(_0x7e49('0x3'));router[_0x7e49('0x4')]('/',auth[_0x7e49('0x5')](),controller[_0x7e49('0x6')]);router['get'](_0x7e49('0x7'),auth[_0x7e49('0x5')](),controller['describe']);router[_0x7e49('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x7e49('0x8')]);router['get']('/:id/messages',auth[_0x7e49('0x5')](),controller['getMessages']);router[_0x7e49('0x4')](_0x7e49('0x9'),auth[_0x7e49('0x5')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x7e49('0xa')]);router[_0x7e49('0xb')](_0x7e49('0xc'),auth[_0x7e49('0x5')](),controller['addMessage']);router[_0x7e49('0xb')](_0x7e49('0xd'),auth[_0x7e49('0x5')](),interaction[_0x7e49('0xe')]('fax','faxinteraction:addtags'),controller[_0x7e49('0xf')]);router['put']('/:id',auth[_0x7e49('0x5')](),interaction[_0x7e49('0xe')]('fax',_0x7e49('0x10')),controller['update']);router[_0x7e49('0x11')]('/:id',auth[_0x7e49('0x5')](),interaction[_0x7e49('0xe')](_0x7e49('0x12'),_0x7e49('0x13')),controller['destroy']);router[_0x7e49('0x11')](_0x7e49('0xd'),auth[_0x7e49('0x5')](),controller[_0x7e49('0x14')]);module[_0x7e49('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 2c80778..a1c7fa4 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 _0xb43b=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1cdabe,_0x286194){var _0x3dcc9c=function(_0x5aa9c7){while(--_0x5aa9c7){_0x1cdabe['push'](_0x1cdabe['shift']());}};_0x3dcc9c(++_0x286194);}(_0xb43b,0xbf));var _0xbb43=function(_0x1df8a1,_0x130780){_0x1df8a1=_0x1df8a1-0x0;var _0x22e4f0=_0xb43b[_0x1df8a1];return _0x22e4f0;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb43('0x1')](_0xbb43('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbb43('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbb43('0x4')]('in',_0xbb43('0x5')),'defaultValue':_0xbb43('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xbb43('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xbb43('0x6')]}}; \ No newline at end of file +var _0x1782=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x14b767,_0x577e84){var _0x22267a=function(_0xa87ebc){while(--_0xa87ebc){_0x14b767['push'](_0x14b767['shift']());}};_0x22267a(++_0x577e84);}(_0x1782,0x13e));var _0x2178=function(_0x196013,_0x4dfcbf){_0x196013=_0x196013-0x0;var _0x151db6=_0x1782[_0x196013];return _0x151db6;};'use strict';var Sequelize=require(_0x2178('0x0'));module['exports']={'body':{'type':Sequelize[_0x2178('0x1')](_0x2178('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2178('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2178('0x4')]('in',_0x2178('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x2178('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2178('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 49092cf..5cdd564 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 _0xd9fc=['interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','fax','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','files','attachments','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','limit','offset','set','apply','reject','update','destroy','end','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','length','find','body','params','describe','../../config/logger','accept','read','readAt','format','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x590d2d,_0x253b9c){var _0xb040c2=function(_0x2d93cc){while(--_0x2d93cc){_0x590d2d['push'](_0x590d2d['shift']());}};_0xb040c2(++_0x253b9c);}(_0xd9fc,0x150));var _0xcd9f=function(_0x4d8529,_0x438fbc){_0x4d8529=_0x4d8529-0x0;var _0x4b5e97=_0xd9fc[_0x4d8529];return _0x4b5e97;};'use strict';var emlformat=require(_0xcd9f('0x0'));var rimraf=require(_0xcd9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcd9f('0x2'));var BPromise=require(_0xcd9f('0x3'));var Mustache=require(_0xcd9f('0x4'));var util=require('util');var path=require(_0xcd9f('0x5'));var sox=require(_0xcd9f('0x6'));var csv=require(_0xcd9f('0x7'));var ejs=require(_0xcd9f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd9f('0x9'));var squel=require('squel');var crypto=require(_0xcd9f('0xa'));var jsforce=require(_0xcd9f('0xb'));var deskjs=require(_0xcd9f('0xc'));var toCsv=require(_0xcd9f('0x7'));var querystring=require(_0xcd9f('0xd'));var Papa=require(_0xcd9f('0xe'));var Redis=require(_0xcd9f('0xf'));var authService=require(_0xcd9f('0x10'));var qs=require(_0xcd9f('0x11'));var as=require(_0xcd9f('0x12'));var hardwareService=require(_0xcd9f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xcd9f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcd9f('0x15'));var db=require(_0xcd9f('0x16'))['db'];config[_0xcd9f('0x17')]=_[_0xcd9f('0x18')](config['redis'],{'host':_0xcd9f('0x19'),'port':0x18eb});var socket=require(_0xcd9f('0x1a'))(new Redis(config[_0xcd9f('0x17')]));require(_0xcd9f('0x1b'))['register'](socket);var jayson=require(_0xcd9f('0x1c'));var client=jayson[_0xcd9f('0x1d')][_0xcd9f('0x1e')]({'port':0x232c});var client9002=jayson[_0xcd9f('0x1d')][_0xcd9f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3d798b,_0x84b0db,_0x4f547e,_0x511527){return new BPromise(function(_0x176027,_0x45ef9d){var _0x117ed4=_0x511527||client;return _0x117ed4[_0xcd9f('0x1f')](_0x3d798b,_0x4f547e)[_0xcd9f('0x20')](function(_0x34f416){logger[_0xcd9f('0x21')](_0xcd9f('0x22'),_0x84b0db,_0xcd9f('0x23'));logger[_0xcd9f('0x24')](_0xcd9f('0x25'),_0x84b0db,_0xcd9f('0x23'),JSON[_0xcd9f('0x26')](_0x34f416));if(_0x34f416[_0xcd9f('0x27')]){if(_0x34f416[_0xcd9f('0x27')][_0xcd9f('0x28')]===0x1f4){logger['error'](_0xcd9f('0x22'),_0x84b0db,_0x34f416['error'][_0xcd9f('0x29')]);return _0x45ef9d(_0x34f416['error']['message']);}logger[_0xcd9f('0x27')](_0xcd9f('0x22'),_0x84b0db,_0x34f416['error'][_0xcd9f('0x29')]);return _0x176027(_0x34f416['error']['message']);}else{logger[_0xcd9f('0x21')]('FaxMessage,\x20%s,\x20%s',_0x84b0db,_0xcd9f('0x23'));_0x176027(_0x34f416['result'][_0xcd9f('0x29')]);}})['catch'](function(_0x3be96c){logger['error'](_0xcd9f('0x22'),_0x84b0db,_0x3be96c);_0x45ef9d(_0x3be96c);});});}function respondWithStatusCode(_0x341703,_0x2b5ca2){_0x2b5ca2=_0x2b5ca2||0xcc;return function(_0x301445){if(_0x301445){return _0x341703[_0xcd9f('0x2a')](_0x2b5ca2);}return _0x341703[_0xcd9f('0x2b')](_0x2b5ca2)['end']();};}function respondWithResult(_0x618a32,_0x5e4fde){_0x5e4fde=_0x5e4fde||0xc8;return function(_0x35fdec){if(_0x35fdec){return _0x618a32[_0xcd9f('0x2b')](_0x5e4fde)[_0xcd9f('0x2c')](_0x35fdec);}};}function respondWithFilteredResult(_0x2bd3d8,_0x372b4e){return function(_0x3a8d2e){if(_0x3a8d2e){var _0x159133=typeof _0x372b4e['offset']==='undefined'&&typeof _0x372b4e[_0xcd9f('0x2d')]==='undefined';var _0x2e889c=_0x3a8d2e['count'];var _0x5a9629=_0x159133?0x0:_0x372b4e[_0xcd9f('0x2e')];var _0x161ccc=_0x159133?_0x3a8d2e['count']:_0x372b4e[_0xcd9f('0x2e')]+_0x372b4e[_0xcd9f('0x2d')];var _0x1e3971;if(_0x161ccc>=_0x2e889c){_0x161ccc=_0x2e889c;_0x1e3971=0xc8;}else{_0x1e3971=0xce;}_0x2bd3d8['status'](_0x1e3971);return _0x2bd3d8[_0xcd9f('0x2f')]('Content-Range',_0x5a9629+'-'+_0x161ccc+'/'+_0x2e889c)[_0xcd9f('0x2c')](_0x3a8d2e);}return null;};}function patchUpdates(_0x287438){return function(_0x18b10c){try{jsonpatch[_0xcd9f('0x30')](_0x18b10c,_0x287438,!![]);}catch(_0x1b9be6){return BPromise[_0xcd9f('0x31')](_0x1b9be6);}return _0x18b10c['save']();};}function saveUpdates(_0x536bd6,_0x5eb315){return function(_0x4b5006){if(_0x4b5006){return _0x4b5006[_0xcd9f('0x32')](_0x536bd6)[_0xcd9f('0x20')](function(_0x26c7b5){return _0x26c7b5;});}return null;};}function removeEntity(_0x5ac20e,_0x535ace){return function(_0x4ba402){if(_0x4ba402){return _0x4ba402[_0xcd9f('0x33')]()[_0xcd9f('0x20')](function(){_0x5ac20e[_0xcd9f('0x2b')](0xcc)[_0xcd9f('0x34')]();});}};}function handleEntityNotFound(_0x1b31b3,_0x2c4908){return function(_0x12f013){if(!_0x12f013){_0x1b31b3[_0xcd9f('0x2a')](0x194);}return _0x12f013;};}function handleError(_0x45a2ba,_0x5e434f){_0x5e434f=_0x5e434f||0x1f4;return function(_0x5e8be9){logger[_0xcd9f('0x27')](_0x5e8be9[_0xcd9f('0x35')]);if(_0x5e8be9['name']){delete _0x5e8be9[_0xcd9f('0x36')];}_0x45a2ba[_0xcd9f('0x2b')](_0x5e434f)['send'](_0x5e8be9);};}exports[_0xcd9f('0x37')]=function(_0x511d5c,_0x23585c){var _0x277a5a={},_0x2820e6={},_0x292406={'count':0x0,'rows':[]};var _0x42516c=_[_0xcd9f('0x38')](db[_0xcd9f('0x39')][_0xcd9f('0x3a')],function(_0x331682){return{'name':_0x331682[_0xcd9f('0x3b')],'type':_0x331682[_0xcd9f('0x3c')][_0xcd9f('0x3d')]};});_0x2820e6[_0xcd9f('0x3e')]=_[_0xcd9f('0x38')](_0x42516c,_0xcd9f('0x36'));_0x2820e6['query']=_[_0xcd9f('0x3f')](_0x511d5c[_0xcd9f('0x40')]);_0x2820e6[_0xcd9f('0x41')]=_[_0xcd9f('0x42')](_0x2820e6[_0xcd9f('0x3e')],_0x2820e6[_0xcd9f('0x40')]);_0x277a5a['attributes']=_[_0xcd9f('0x42')](_0x2820e6[_0xcd9f('0x3e')],qs[_0xcd9f('0x43')](_0x511d5c['query']['fields']));_0x277a5a[_0xcd9f('0x44')]=_0x277a5a[_0xcd9f('0x44')]['length']?_0x277a5a[_0xcd9f('0x44')]:_0x2820e6[_0xcd9f('0x3e')];if(!_0x511d5c[_0xcd9f('0x40')][_0xcd9f('0x45')]('nolimit')){_0x277a5a[_0xcd9f('0x2d')]=qs[_0xcd9f('0x2d')](_0x511d5c[_0xcd9f('0x40')][_0xcd9f('0x2d')]);_0x277a5a[_0xcd9f('0x2e')]=qs[_0xcd9f('0x2e')](_0x511d5c['query'][_0xcd9f('0x2e')]);}_0x277a5a[_0xcd9f('0x46')]=qs[_0xcd9f('0x47')](_0x511d5c[_0xcd9f('0x40')][_0xcd9f('0x47')]);_0x277a5a[_0xcd9f('0x48')]=qs[_0xcd9f('0x41')](_[_0xcd9f('0x49')](_0x511d5c[_0xcd9f('0x40')],_0x2820e6[_0xcd9f('0x41')]),_0x42516c);if(_0x511d5c['query'][_0xcd9f('0x4a')]){_0x277a5a[_0xcd9f('0x48')]=_[_0xcd9f('0x4b')](_0x277a5a[_0xcd9f('0x48')],{'$or':_['map'](_0x42516c,function(_0x4877de){if(_0x4877de[_0xcd9f('0x3c')]!==_0xcd9f('0x4c')){var _0x31ba97={};_0x31ba97[_0x4877de[_0xcd9f('0x36')]]={'$like':'%'+_0x511d5c[_0xcd9f('0x40')][_0xcd9f('0x4a')]+'%'};return _0x31ba97;}})});}_0x277a5a=_[_0xcd9f('0x4b')]({},_0x277a5a,_0x511d5c[_0xcd9f('0x4d')]);var _0x41682={'where':_0x277a5a[_0xcd9f('0x48')]};return db['FaxMessage'][_0xcd9f('0x4e')](_0x41682)[_0xcd9f('0x20')](function(_0x4377a4){_0x292406[_0xcd9f('0x4e')]=_0x4377a4;if(_0x511d5c['query'][_0xcd9f('0x4f')]){_0x277a5a[_0xcd9f('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0xcd9f('0x51')](_0x277a5a);})['then'](function(_0xbe49cf){_0x292406[_0xcd9f('0x52')]=_0xbe49cf;return _0x292406;})[_0xcd9f('0x20')](respondWithFilteredResult(_0x23585c,_0x277a5a))[_0xcd9f('0x53')](handleError(_0x23585c,null));};exports[_0xcd9f('0x54')]=function(_0x24aa07,_0x570215){var _0x536e0d={'raw':!![],'where':{'id':_0x24aa07['params']['id']}},_0xed0efc={};_0xed0efc[_0xcd9f('0x3e')]=_['keys'](db[_0xcd9f('0x39')][_0xcd9f('0x3a')]);_0xed0efc[_0xcd9f('0x40')]=_[_0xcd9f('0x3f')](_0x24aa07[_0xcd9f('0x40')]);_0xed0efc[_0xcd9f('0x41')]=_[_0xcd9f('0x42')](_0xed0efc[_0xcd9f('0x3e')],_0xed0efc['query']);_0x536e0d[_0xcd9f('0x44')]=_[_0xcd9f('0x42')](_0xed0efc[_0xcd9f('0x3e')],qs[_0xcd9f('0x43')](_0x24aa07['query'][_0xcd9f('0x43')]));_0x536e0d[_0xcd9f('0x44')]=_0x536e0d[_0xcd9f('0x44')][_0xcd9f('0x55')]?_0x536e0d['attributes']:_0xed0efc[_0xcd9f('0x3e')];if(_0x24aa07[_0xcd9f('0x40')][_0xcd9f('0x4f')]){_0x536e0d['include']=[{'all':!![]}];}_0x536e0d=_[_0xcd9f('0x4b')]({},_0x536e0d,_0x24aa07[_0xcd9f('0x4d')]);return db['FaxMessage'][_0xcd9f('0x56')](_0x536e0d)[_0xcd9f('0x20')](handleEntityNotFound(_0x570215,null))[_0xcd9f('0x20')](respondWithResult(_0x570215,null))[_0xcd9f('0x53')](handleError(_0x570215,null));};exports['update']=function(_0x4f2f4e,_0x4071f2){if(_0x4f2f4e[_0xcd9f('0x57')]['id']){delete _0x4f2f4e[_0xcd9f('0x57')]['id'];}return db['FaxMessage'][_0xcd9f('0x56')]({'where':{'id':_0x4f2f4e[_0xcd9f('0x58')]['id']}})[_0xcd9f('0x20')](handleEntityNotFound(_0x4071f2,null))[_0xcd9f('0x20')](saveUpdates(_0x4f2f4e['body'],null))[_0xcd9f('0x20')](respondWithResult(_0x4071f2,null))[_0xcd9f('0x53')](handleError(_0x4071f2,null));};exports[_0xcd9f('0x33')]=function(_0x37c480,_0x585b5a){return db[_0xcd9f('0x39')]['find']({'where':{'id':_0x37c480[_0xcd9f('0x58')]['id']}})[_0xcd9f('0x20')](handleEntityNotFound(_0x585b5a,null))[_0xcd9f('0x20')](removeEntity(_0x585b5a,null))[_0xcd9f('0x53')](handleError(_0x585b5a,null));};exports['describe']=function(_0x4efccb,_0xf28ca7){return db[_0xcd9f('0x39')][_0xcd9f('0x59')]()['then'](respondWithResult(_0xf28ca7,null))[_0xcd9f('0x53')](handleError(_0xf28ca7,null));};var interaction_log=require(_0xcd9f('0x5a'))('fax-interactions');exports[_0xcd9f('0x5b')]=function(_0x1f1894,_0x4ff633,_0x430a14){var _0x3101ac={'agent':{},'channel':'fax'};if(_0x1f1894['body']['id']){delete _0x1f1894['body']['id'];}_0x1f1894[_0xcd9f('0x57')][_0xcd9f('0x5c')]=!![];_0x1f1894[_0xcd9f('0x57')][_0xcd9f('0x5d')]=moment()[_0xcd9f('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f1894[_0xcd9f('0x57')][_0xcd9f('0x5f')]=_0x1f1894[_0xcd9f('0x57')][_0xcd9f('0x5f')]||_0x1f1894[_0xcd9f('0x60')]['id'];_0x3101ac['agent']['id']=_0x1f1894[_0xcd9f('0x57')][_0xcd9f('0x5f')];return db[_0xcd9f('0x39')][_0xcd9f('0x56')]({'where':{'id':_0x1f1894[_0xcd9f('0x58')]['id'],'UserId':null}})[_0xcd9f('0x20')](handleEntityNotFound(_0x4ff633,null))['then'](saveUpdates(_0x1f1894[_0xcd9f('0x57')],null))['then'](function(_0x1871ab){if(_0x1871ab){_0x3101ac[_0xcd9f('0x29')]=_0x1871ab['get']({'plain':!![]});return db[_0xcd9f('0x61')][_0xcd9f('0x56')]({'where':{'id':_0x1871ab[_0xcd9f('0x62')]}});}return null;})[_0xcd9f('0x20')](handleEntityNotFound(_0x4ff633,null))[_0xcd9f('0x20')](function(_0x32df13){if(_0x32df13){return _0x32df13[_0xcd9f('0x32')]({'UserId':_0x1f1894[_0xcd9f('0x57')][_0xcd9f('0x5f')],'read1stAt':_[_0xcd9f('0x63')](_0x32df13[_0xcd9f('0x64')])?moment()[_0xcd9f('0x5e')](_0xcd9f('0x65')):undefined});}return null;})['then'](function(_0x17c3f4){if(_0x17c3f4){_0x3101ac[_0xcd9f('0x66')]=_0x17c3f4['get']({'plain':!![]});interaction_log[_0xcd9f('0x21')](_0xcd9f('0x67'),_0x1f1894[_0xcd9f('0x60')]['id'],_0x1f1894[_0xcd9f('0x60')][_0xcd9f('0x36')],_0x1f1894[_0xcd9f('0x60')][_0xcd9f('0x68')],_0x3101ac[_0xcd9f('0x66')]['id'],_0x1f1894[_0xcd9f('0x57')]?JSON[_0xcd9f('0x26')](_0x1f1894[_0xcd9f('0x57')]):_0xcd9f('0x69'));return respondWithRpcPromise(_0xcd9f('0x6a'),_0xcd9f('0x6b'),_0x3101ac);}return null;})[_0xcd9f('0x20')](function(_0x1c0a97){var _0x32345d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1c0a97[_0xcd9f('0x29')][_0xcd9f('0x6c')];return db[_0xcd9f('0x6d')][_0xcd9f('0x40')](_0x32345d,{'type':db[_0xcd9f('0x6e')][_0xcd9f('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x2180d6){return _0x2180d6;});})[_0xcd9f('0x20')](function(_0x12d12e){if(_0x12d12e){_0x3101ac[_0xcd9f('0x29')][_0xcd9f('0x70')]=_0x12d12e[0x0];if(!_0x1f1894[_0xcd9f('0x57')]['UserId'])return;return db[_0xcd9f('0x71')]['find']({'where':{'id':_0x1f1894['body'][_0xcd9f('0x5f')],'role':_0xcd9f('0x72')},'attributes':['id',_0xcd9f('0x36'),_0xcd9f('0x73'),_0xcd9f('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x25e787){if(!_0x25e787)return null;_0x3101ac[_0xcd9f('0x29')]['agent']=_0x25e787;return _0x3101ac;})['then'](function(_0x1fe52f){if(_0x1fe52f){if(_0x1f1894[_0xcd9f('0x57')][_0xcd9f('0x75')]){_0x3101ac[_0xcd9f('0x29')]['interface']=util[_0xcd9f('0x5e')](_0xcd9f('0x76'),_0x1f1894[_0xcd9f('0x60')][_0xcd9f('0x36')]);_0x3101ac[_0xcd9f('0x29')][_0xcd9f('0x77')]=_0x3101ac['channel'];_0x3101ac[_0xcd9f('0x29')][_0xcd9f('0x78')]=_0x3101ac[_0xcd9f('0x77')];_0x3101ac['message'][_0xcd9f('0x79')]=_0xcd9f('0x5b');return respondWithRpcPromise(_0xcd9f('0x7a'),'EventManager',{'event':_0xcd9f('0x7b'),'message':_0x3101ac[_0xcd9f('0x29')]},client9002)[_0xcd9f('0x20')](function(){return _0x3101ac;});}return _0x3101ac;}return null;})[_0xcd9f('0x20')](respondWithResult(_0x4ff633,null))[_0xcd9f('0x53')](handleError(_0x4ff633,null));};var interaction_log=require(_0xcd9f('0x5a'))(_0xcd9f('0x7c'));exports[_0xcd9f('0x31')]=function(_0x4c5a19,_0x511563,_0x196ae0){var _0x275e66={'agent':{},'channel':_0xcd9f('0x7d')};if(_0x4c5a19[_0xcd9f('0x57')]['id']){delete _0x4c5a19[_0xcd9f('0x57')]['id'];}_0x4c5a19[_0xcd9f('0x57')][_0xcd9f('0x5f')]=_0x4c5a19[_0xcd9f('0x57')][_0xcd9f('0x5f')]||_0x4c5a19[_0xcd9f('0x60')]['id'];_0x275e66['agent']['id']=_0x4c5a19[_0xcd9f('0x57')][_0xcd9f('0x5f')];return db[_0xcd9f('0x39')][_0xcd9f('0x56')]({'where':{'id':_0x4c5a19[_0xcd9f('0x58')]['id'],'UserId':null}})[_0xcd9f('0x20')](handleEntityNotFound(_0x511563,null))[_0xcd9f('0x20')](function(_0x779305){if(_0x779305){_0x275e66[_0xcd9f('0x29')]=_0x779305[_0xcd9f('0x7e')]({'plain':!![]});return db[_0xcd9f('0x61')][_0xcd9f('0x56')]({'where':{'id':_0x779305[_0xcd9f('0x62')]}});}return null;})[_0xcd9f('0x20')](handleEntityNotFound(_0x511563,null))[_0xcd9f('0x20')](function(_0x209a29){if(_0x209a29){_0x275e66['interaction']=_0x209a29[_0xcd9f('0x7e')]({'plain':!![]});interaction_log[_0xcd9f('0x21')](_0xcd9f('0x7f'),_0x4c5a19[_0xcd9f('0x60')]['id'],_0x4c5a19[_0xcd9f('0x60')]['name'],_0x4c5a19[_0xcd9f('0x60')][_0xcd9f('0x68')],_0x275e66[_0xcd9f('0x66')]['id'],_0x4c5a19[_0xcd9f('0x57')]?JSON['stringify'](_0x4c5a19[_0xcd9f('0x57')]):_0xcd9f('0x69'));return respondWithRpcPromise(_0xcd9f('0x80'),'rejectMessage',_0x275e66);}return null;})[_0xcd9f('0x20')](function(_0x1b6632){var _0x46fc62=_0xcd9f('0x81')+_0x1b6632[_0xcd9f('0x29')][_0xcd9f('0x6c')];return db[_0xcd9f('0x6d')][_0xcd9f('0x40')](_0x46fc62,{'type':db[_0xcd9f('0x6e')][_0xcd9f('0x6f')]['SELECT'],'raw':!![]})[_0xcd9f('0x20')](function(_0x195867){return _0x195867;});})['then'](function(_0x2e5dbf){if(_0x2e5dbf){_0x275e66['message'][_0xcd9f('0x70')]=_0x2e5dbf[0x0];if(!_0x4c5a19['body'][_0xcd9f('0x5f')])return;return db[_0xcd9f('0x71')][_0xcd9f('0x56')]({'where':{'id':_0x4c5a19[_0xcd9f('0x57')]['UserId'],'role':_0xcd9f('0x72')},'attributes':['id',_0xcd9f('0x36'),_0xcd9f('0x73'),_0xcd9f('0x74'),_0xcd9f('0x82')],'raw':!![]});}return null;})[_0xcd9f('0x20')](function(_0x4ddd74){if(!_0x4ddd74)return null;_0x275e66[_0xcd9f('0x29')][_0xcd9f('0x72')]=_0x4ddd74;return _0x275e66;})[_0xcd9f('0x20')](function(_0x3b5646){if(_0x3b5646){_0x3b5646[_0xcd9f('0x29')][_0xcd9f('0x83')]=util[_0xcd9f('0x5e')](_0xcd9f('0x76'),_0x4c5a19[_0xcd9f('0x60')]['name']);_0x3b5646[_0xcd9f('0x29')]['channel']=_0x275e66['channel'];_0x3b5646[_0xcd9f('0x29')][_0xcd9f('0x78')]=_0x275e66['channel'];_0x3b5646['message'][_0xcd9f('0x79')]=_0xcd9f('0x31');respondWithRpcPromise(_0xcd9f('0x7a'),_0xcd9f('0x7a'),{'event':_0xcd9f('0x84'),'message':_0x3b5646[_0xcd9f('0x29')]},client9002);return _0x275e66;}return null;})[_0xcd9f('0x20')](respondWithResult(_0x511563,null))['catch'](handleError(_0x511563,null));};exports[_0xcd9f('0x85')]=function(_0x291559,_0xf00bc2){var _0x20aa07;return db[_0xcd9f('0x39')]['create'](_0x291559[_0xcd9f('0x57')],{})['then'](function(_0x3c6842){_0x20aa07=_0x3c6842;return db[_0xcd9f('0x86')][_0xcd9f('0x87')]({'where':{'id':_0x20aa07['ContactId']}});})[_0xcd9f('0x20')](function(_0x4df5ac){if(_['isNil'](_0x4df5ac)){return;}else{_0x20aa07[_0xcd9f('0x7d')]=_0x4df5ac['fax'];return db[_0xcd9f('0x88')][_0xcd9f('0x87')]({'where':{'id':_0x20aa07[_0xcd9f('0x89')]}});}})[_0xcd9f('0x20')](function(_0xaf65dd){return respondWithRpcPromise(_0xcd9f('0x8a'),_0xcd9f('0x8a'),{'FaxAccountId':_['isNil'](_0x291559['body'])?undefined:_0x291559[_0xcd9f('0x57')][_0xcd9f('0x8b')],'path':_['isNil'](_0xaf65dd)?undefined:util[_0xcd9f('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0xaf65dd[_0xcd9f('0x8c')]),'fax':_[_0xcd9f('0x63')](_0x20aa07['fax'])?undefined:_0x20aa07['fax'],'AttachmentId':_0x20aa07[_0xcd9f('0x89')]},client9002);})[_0xcd9f('0x20')](respondWithResult(_0xf00bc2,0xc9))[_0xcd9f('0x53')](handleError(_0xf00bc2,null));};exports[_0xcd9f('0x8d')]=function(_0x345d63,_0x574b11){var _0x3fc7dc=path[_0xcd9f('0x8e')](config['root'],_0xcd9f('0x8f'),_0xcd9f('0x90'),_0xcd9f('0x91'));return db[_0xcd9f('0x39')][_0xcd9f('0x56')]({'where':{'id':_0x345d63['params']['id']},'include':[{'model':db[_0xcd9f('0x88')],'as':_0xcd9f('0x88')}]})[_0xcd9f('0x20')](handleEntityNotFound(_0x574b11,null))['then'](function(_0x2e20cd){if(_0x2e20cd){return _0x574b11[_0xcd9f('0x8d')](path['join'](_0x3fc7dc,_0x2e20cd[_0xcd9f('0x88')][_0xcd9f('0x8c')]));}})['catch'](handleError(_0x574b11,null));}; \ No newline at end of file +var _0xda62=['files','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','length','find','body','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server'];(function(_0x3dca00,_0x26156f){var _0x2cf74c=function(_0x65d84){while(--_0x65d84){_0x3dca00['push'](_0x3dca00['shift']());}};_0x2cf74c(++_0x26156f);}(_0xda62,0x90));var _0x2da6=function(_0x455b25,_0x5adb17){_0x455b25=_0x455b25-0x0;var _0x434f68=_0xda62[_0x455b25];return _0x434f68;};'use strict';var emlformat=require(_0x2da6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2da6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2da6('0x2'));var moment=require(_0x2da6('0x3'));var BPromise=require(_0x2da6('0x4'));var Mustache=require(_0x2da6('0x5'));var util=require(_0x2da6('0x6'));var path=require('path');var sox=require(_0x2da6('0x7'));var csv=require(_0x2da6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2da6('0x9'));var squel=require(_0x2da6('0xa'));var crypto=require(_0x2da6('0xb'));var jsforce=require(_0x2da6('0xc'));var deskjs=require(_0x2da6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2da6('0xe'));var Redis=require('ioredis');var authService=require(_0x2da6('0xf'));var qs=require(_0x2da6('0x10'));var as=require(_0x2da6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2da6('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2da6('0x13'));var licenseUtil=require(_0x2da6('0x14'));var db=require('../../mysqldb')['db'];config[_0x2da6('0x15')]=_[_0x2da6('0x16')](config[_0x2da6('0x15')],{'host':_0x2da6('0x17'),'port':0x18eb});var socket=require(_0x2da6('0x18'))(new Redis(config[_0x2da6('0x15')]));require(_0x2da6('0x19'))['register'](socket);var jayson=require(_0x2da6('0x1a'));var client=jayson['client'][_0x2da6('0x1b')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bfe25,_0x38380c,_0x2cedde,_0x349a3b){return new BPromise(function(_0xb25b0e,_0x5e7deb){var _0xd3b7f8=_0x349a3b||client;return _0xd3b7f8[_0x2da6('0x1c')](_0x1bfe25,_0x2cedde)[_0x2da6('0x1d')](function(_0x5bdf2f){logger[_0x2da6('0x1e')](_0x2da6('0x1f'),_0x38380c,'request\x20sent');logger[_0x2da6('0x20')](_0x2da6('0x21'),_0x38380c,_0x2da6('0x22'),JSON[_0x2da6('0x23')](_0x5bdf2f));if(_0x5bdf2f['error']){if(_0x5bdf2f['error'][_0x2da6('0x24')]===0x1f4){logger[_0x2da6('0x25')](_0x2da6('0x1f'),_0x38380c,_0x5bdf2f['error'][_0x2da6('0x26')]);return _0x5e7deb(_0x5bdf2f[_0x2da6('0x25')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x38380c,_0x5bdf2f['error']['message']);return _0xb25b0e(_0x5bdf2f['error'][_0x2da6('0x26')]);}else{logger[_0x2da6('0x1e')](_0x2da6('0x1f'),_0x38380c,_0x2da6('0x22'));_0xb25b0e(_0x5bdf2f[_0x2da6('0x27')]['message']);}})['catch'](function(_0x142d9f){logger['error'](_0x2da6('0x1f'),_0x38380c,_0x142d9f);_0x5e7deb(_0x142d9f);});});}function respondWithStatusCode(_0x570217,_0x57bf21){_0x57bf21=_0x57bf21||0xcc;return function(_0x1121e5){if(_0x1121e5){return _0x570217[_0x2da6('0x28')](_0x57bf21);}return _0x570217[_0x2da6('0x29')](_0x57bf21)[_0x2da6('0x2a')]();};}function respondWithResult(_0x559a64,_0x1de508){_0x1de508=_0x1de508||0xc8;return function(_0x598501){if(_0x598501){return _0x559a64['status'](_0x1de508)[_0x2da6('0x2b')](_0x598501);}};}function respondWithFilteredResult(_0x204e02,_0x2ae68a){return function(_0x20effe){if(_0x20effe){var _0x25c0dc=typeof _0x2ae68a[_0x2da6('0x2c')]===_0x2da6('0x2d')&&typeof _0x2ae68a[_0x2da6('0x2e')]===_0x2da6('0x2d');var _0x3cdc91=_0x20effe[_0x2da6('0x2f')];var _0x43cf1e=_0x25c0dc?0x0:_0x2ae68a[_0x2da6('0x2c')];var _0x2ebec7=_0x25c0dc?_0x20effe[_0x2da6('0x2f')]:_0x2ae68a[_0x2da6('0x2c')]+_0x2ae68a[_0x2da6('0x2e')];var _0x356408;if(_0x2ebec7>=_0x3cdc91){_0x2ebec7=_0x3cdc91;_0x356408=0xc8;}else{_0x356408=0xce;}_0x204e02[_0x2da6('0x29')](_0x356408);return _0x204e02[_0x2da6('0x30')](_0x2da6('0x31'),_0x43cf1e+'-'+_0x2ebec7+'/'+_0x3cdc91)[_0x2da6('0x2b')](_0x20effe);}return null;};}function patchUpdates(_0x25c933){return function(_0x23b2b5){try{jsonpatch[_0x2da6('0x32')](_0x23b2b5,_0x25c933,!![]);}catch(_0x775ebd){return BPromise[_0x2da6('0x33')](_0x775ebd);}return _0x23b2b5[_0x2da6('0x34')]();};}function saveUpdates(_0x298aca,_0x4673d4){return function(_0x4ca758){if(_0x4ca758){return _0x4ca758[_0x2da6('0x35')](_0x298aca)['then'](function(_0x2e7e12){return _0x2e7e12;});}return null;};}function removeEntity(_0x314f44,_0x267dcf){return function(_0x19c3c4){if(_0x19c3c4){return _0x19c3c4[_0x2da6('0x36')]()['then'](function(){_0x314f44['status'](0xcc)[_0x2da6('0x2a')]();});}};}function handleEntityNotFound(_0x730d55,_0x4af054){return function(_0x57b09e){if(!_0x57b09e){_0x730d55[_0x2da6('0x28')](0x194);}return _0x57b09e;};}function handleError(_0x460487,_0x18900a){_0x18900a=_0x18900a||0x1f4;return function(_0x55dfa4){logger[_0x2da6('0x25')](_0x55dfa4['stack']);if(_0x55dfa4[_0x2da6('0x37')]){delete _0x55dfa4[_0x2da6('0x37')];}_0x460487[_0x2da6('0x29')](_0x18900a)[_0x2da6('0x38')](_0x55dfa4);};}exports[_0x2da6('0x39')]=function(_0x3a71ab,_0x3c7203){var _0x3675b2={},_0x2d34e1={},_0x30a9a1={'count':0x0,'rows':[]};var _0x544862=_[_0x2da6('0x3a')](db[_0x2da6('0x3b')][_0x2da6('0x3c')],function(_0x213363){return{'name':_0x213363[_0x2da6('0x3d')],'type':_0x213363[_0x2da6('0x3e')]['key']};});_0x2d34e1[_0x2da6('0x3f')]=_[_0x2da6('0x3a')](_0x544862,_0x2da6('0x37'));_0x2d34e1['query']=_['keys'](_0x3a71ab[_0x2da6('0x40')]);_0x2d34e1[_0x2da6('0x41')]=_[_0x2da6('0x42')](_0x2d34e1[_0x2da6('0x3f')],_0x2d34e1[_0x2da6('0x40')]);_0x3675b2['attributes']=_[_0x2da6('0x42')](_0x2d34e1[_0x2da6('0x3f')],qs[_0x2da6('0x43')](_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x43')]));_0x3675b2[_0x2da6('0x44')]=_0x3675b2[_0x2da6('0x44')]['length']?_0x3675b2[_0x2da6('0x44')]:_0x2d34e1[_0x2da6('0x3f')];if(!_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x45')]('nolimit')){_0x3675b2['limit']=qs[_0x2da6('0x2e')](_0x3a71ab['query'][_0x2da6('0x2e')]);_0x3675b2[_0x2da6('0x2c')]=qs[_0x2da6('0x2c')](_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x2c')]);}_0x3675b2['order']=qs['sort'](_0x3a71ab['query'][_0x2da6('0x46')]);_0x3675b2[_0x2da6('0x47')]=qs[_0x2da6('0x41')](_[_0x2da6('0x48')](_0x3a71ab[_0x2da6('0x40')],_0x2d34e1[_0x2da6('0x41')]),_0x544862);if(_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x49')]){_0x3675b2[_0x2da6('0x47')]=_[_0x2da6('0x4a')](_0x3675b2[_0x2da6('0x47')],{'$or':_[_0x2da6('0x3a')](_0x544862,function(_0x2e6ab8){if(_0x2e6ab8[_0x2da6('0x3e')]!=='VIRTUAL'){var _0x4fbfda={};_0x4fbfda[_0x2e6ab8['name']]={'$like':'%'+_0x3a71ab[_0x2da6('0x40')][_0x2da6('0x49')]+'%'};return _0x4fbfda;}})});}_0x3675b2=_['merge']({},_0x3675b2,_0x3a71ab[_0x2da6('0x4b')]);var _0x501bd8={'where':_0x3675b2[_0x2da6('0x47')]};return db[_0x2da6('0x3b')][_0x2da6('0x2f')](_0x501bd8)[_0x2da6('0x1d')](function(_0x102f37){_0x30a9a1[_0x2da6('0x2f')]=_0x102f37;if(_0x3a71ab['query'][_0x2da6('0x4c')]){_0x3675b2[_0x2da6('0x4d')]=[{'all':!![]}];}return db[_0x2da6('0x3b')][_0x2da6('0x4e')](_0x3675b2);})[_0x2da6('0x1d')](function(_0x1081e7){_0x30a9a1[_0x2da6('0x4f')]=_0x1081e7;return _0x30a9a1;})['then'](respondWithFilteredResult(_0x3c7203,_0x3675b2))[_0x2da6('0x50')](handleError(_0x3c7203,null));};exports[_0x2da6('0x51')]=function(_0xf9a8a8,_0x1a4de9){var _0x122757={'raw':!![],'where':{'id':_0xf9a8a8['params']['id']}},_0xb73e0={};_0xb73e0['model']=_['keys'](db[_0x2da6('0x3b')][_0x2da6('0x3c')]);_0xb73e0[_0x2da6('0x40')]=_[_0x2da6('0x52')](_0xf9a8a8[_0x2da6('0x40')]);_0xb73e0[_0x2da6('0x41')]=_[_0x2da6('0x42')](_0xb73e0[_0x2da6('0x3f')],_0xb73e0[_0x2da6('0x40')]);_0x122757[_0x2da6('0x44')]=_[_0x2da6('0x42')](_0xb73e0[_0x2da6('0x3f')],qs[_0x2da6('0x43')](_0xf9a8a8[_0x2da6('0x40')]['fields']));_0x122757['attributes']=_0x122757[_0x2da6('0x44')][_0x2da6('0x53')]?_0x122757['attributes']:_0xb73e0['model'];if(_0xf9a8a8[_0x2da6('0x40')]['includeAll']){_0x122757[_0x2da6('0x4d')]=[{'all':!![]}];}_0x122757=_[_0x2da6('0x4a')]({},_0x122757,_0xf9a8a8[_0x2da6('0x4b')]);return db[_0x2da6('0x3b')][_0x2da6('0x54')](_0x122757)[_0x2da6('0x1d')](handleEntityNotFound(_0x1a4de9,null))[_0x2da6('0x1d')](respondWithResult(_0x1a4de9,null))['catch'](handleError(_0x1a4de9,null));};exports['update']=function(_0x447b5b,_0x5c0e84){if(_0x447b5b[_0x2da6('0x55')]['id']){delete _0x447b5b[_0x2da6('0x55')]['id'];}return db[_0x2da6('0x3b')][_0x2da6('0x54')]({'where':{'id':_0x447b5b['params']['id']}})['then'](handleEntityNotFound(_0x5c0e84,null))['then'](saveUpdates(_0x447b5b['body'],null))[_0x2da6('0x1d')](respondWithResult(_0x5c0e84,null))['catch'](handleError(_0x5c0e84,null));};exports[_0x2da6('0x36')]=function(_0xf221cc,_0x2f5725){return db[_0x2da6('0x3b')][_0x2da6('0x54')]({'where':{'id':_0xf221cc['params']['id']}})[_0x2da6('0x1d')](handleEntityNotFound(_0x2f5725,null))[_0x2da6('0x1d')](removeEntity(_0x2f5725,null))[_0x2da6('0x50')](handleError(_0x2f5725,null));};exports['describe']=function(_0xe67e53,_0x1dacae){return db[_0x2da6('0x3b')][_0x2da6('0x56')]()[_0x2da6('0x1d')](respondWithResult(_0x1dacae,null))[_0x2da6('0x50')](handleError(_0x1dacae,null));};var interaction_log=require('../../config/logger')(_0x2da6('0x57'));exports[_0x2da6('0x58')]=function(_0x4b188a,_0x1e453c,_0x413e14){var _0x26cabd={'agent':{},'channel':_0x2da6('0x59')};if(_0x4b188a[_0x2da6('0x55')]['id']){delete _0x4b188a[_0x2da6('0x55')]['id'];}_0x4b188a['body']['read']=!![];_0x4b188a['body'][_0x2da6('0x5a')]=moment()[_0x2da6('0x5b')](_0x2da6('0x5c'));_0x4b188a['body'][_0x2da6('0x5d')]=_0x4b188a[_0x2da6('0x55')][_0x2da6('0x5d')]||_0x4b188a[_0x2da6('0x5e')]['id'];_0x26cabd[_0x2da6('0x5f')]['id']=_0x4b188a[_0x2da6('0x55')]['UserId'];return db[_0x2da6('0x3b')]['find']({'where':{'id':_0x4b188a['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1e453c,null))['then'](saveUpdates(_0x4b188a[_0x2da6('0x55')],null))[_0x2da6('0x1d')](function(_0x5a41a7){if(_0x5a41a7){_0x26cabd[_0x2da6('0x26')]=_0x5a41a7[_0x2da6('0x60')]({'plain':!![]});return db['FaxInteraction'][_0x2da6('0x54')]({'where':{'id':_0x5a41a7['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1e453c,null))[_0x2da6('0x1d')](function(_0x38b517){if(_0x38b517){return _0x38b517[_0x2da6('0x35')]({'UserId':_0x4b188a[_0x2da6('0x55')]['UserId'],'read1stAt':_[_0x2da6('0x61')](_0x38b517[_0x2da6('0x62')])?moment()[_0x2da6('0x5b')](_0x2da6('0x5c')):undefined});}return null;})[_0x2da6('0x1d')](function(_0x1eb2c3){if(_0x1eb2c3){_0x26cabd[_0x2da6('0x63')]=_0x1eb2c3[_0x2da6('0x60')]({'plain':!![]});interaction_log[_0x2da6('0x1e')](_0x2da6('0x64'),_0x4b188a[_0x2da6('0x5e')]['id'],_0x4b188a[_0x2da6('0x5e')]['name'],_0x4b188a[_0x2da6('0x5e')][_0x2da6('0x65')],_0x26cabd[_0x2da6('0x63')]['id'],_0x4b188a[_0x2da6('0x55')]?JSON['stringify'](_0x4b188a[_0x2da6('0x55')]):_0x2da6('0x66'));return respondWithRpcPromise('AcceptMessage',_0x2da6('0x67'),_0x26cabd);}return null;})[_0x2da6('0x1d')](function(_0x510546){var _0x54eb26=_0x2da6('0x68')+_0x510546[_0x2da6('0x26')][_0x2da6('0x69')];return db[_0x2da6('0x6a')][_0x2da6('0x40')](_0x54eb26,{'type':db[_0x2da6('0x6b')][_0x2da6('0x6c')][_0x2da6('0x6d')],'raw':!![]})[_0x2da6('0x1d')](function(_0x1e13e6){return _0x1e13e6;});})[_0x2da6('0x1d')](function(_0x594095){if(_0x594095){_0x26cabd['message'][_0x2da6('0x6e')]=_0x594095[0x0];if(!_0x4b188a[_0x2da6('0x55')][_0x2da6('0x5d')])return;return db['User']['find']({'where':{'id':_0x4b188a[_0x2da6('0x55')][_0x2da6('0x5d')],'role':_0x2da6('0x5f')},'attributes':['id',_0x2da6('0x37'),_0x2da6('0x6f'),_0x2da6('0x70'),_0x2da6('0x71')],'raw':!![]});}return null;})[_0x2da6('0x1d')](function(_0x227158){if(!_0x227158)return null;_0x26cabd[_0x2da6('0x26')][_0x2da6('0x5f')]=_0x227158;return _0x26cabd;})[_0x2da6('0x1d')](function(_0x2c1381){if(_0x2c1381){if(_0x4b188a[_0x2da6('0x55')]['manual']){_0x26cabd['message'][_0x2da6('0x72')]=util[_0x2da6('0x5b')](_0x2da6('0x73'),_0x4b188a['user'][_0x2da6('0x37')]);_0x26cabd[_0x2da6('0x26')][_0x2da6('0x74')]=_0x26cabd['channel'];_0x26cabd['message'][_0x2da6('0x75')]=_0x26cabd[_0x2da6('0x74')];_0x26cabd['message'][_0x2da6('0x76')]='accept';return respondWithRpcPromise('EventManager',_0x2da6('0x77'),{'event':_0x2da6('0x78'),'message':_0x26cabd['message']},client9002)[_0x2da6('0x1d')](function(){return _0x26cabd;});}return _0x26cabd;}return null;})['then'](respondWithResult(_0x1e453c,null))[_0x2da6('0x50')](handleError(_0x1e453c,null));};var interaction_log=require(_0x2da6('0x12'))('fax-interactions');exports[_0x2da6('0x33')]=function(_0x1e1629,_0xc9c5ac,_0x14e792){var _0x5ed0a7={'agent':{},'channel':_0x2da6('0x59')};if(_0x1e1629[_0x2da6('0x55')]['id']){delete _0x1e1629[_0x2da6('0x55')]['id'];}_0x1e1629['body']['UserId']=_0x1e1629['body'][_0x2da6('0x5d')]||_0x1e1629['user']['id'];_0x5ed0a7[_0x2da6('0x5f')]['id']=_0x1e1629['body'][_0x2da6('0x5d')];return db['FaxMessage']['find']({'where':{'id':_0x1e1629['params']['id'],'UserId':null}})[_0x2da6('0x1d')](handleEntityNotFound(_0xc9c5ac,null))[_0x2da6('0x1d')](function(_0x498ae0){if(_0x498ae0){_0x5ed0a7[_0x2da6('0x26')]=_0x498ae0[_0x2da6('0x60')]({'plain':!![]});return db[_0x2da6('0x79')][_0x2da6('0x54')]({'where':{'id':_0x498ae0[_0x2da6('0x7a')]}});}return null;})[_0x2da6('0x1d')](handleEntityNotFound(_0xc9c5ac,null))['then'](function(_0x26f815){if(_0x26f815){_0x5ed0a7[_0x2da6('0x63')]=_0x26f815['get']({'plain':!![]});interaction_log[_0x2da6('0x1e')](_0x2da6('0x7b'),_0x1e1629['user']['id'],_0x1e1629['user']['name'],_0x1e1629[_0x2da6('0x5e')][_0x2da6('0x65')],_0x5ed0a7[_0x2da6('0x63')]['id'],_0x1e1629[_0x2da6('0x55')]?JSON[_0x2da6('0x23')](_0x1e1629[_0x2da6('0x55')]):_0x2da6('0x66'));return respondWithRpcPromise('RejectMessage',_0x2da6('0x7c'),_0x5ed0a7);}return null;})[_0x2da6('0x1d')](function(_0x49aa8e){var _0x53cb58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49aa8e[_0x2da6('0x26')][_0x2da6('0x69')];return db[_0x2da6('0x6a')][_0x2da6('0x40')](_0x53cb58,{'type':db[_0x2da6('0x6b')][_0x2da6('0x6c')][_0x2da6('0x6d')],'raw':!![]})[_0x2da6('0x1d')](function(_0x3f6b4e){return _0x3f6b4e;});})['then'](function(_0x22c881){if(_0x22c881){_0x5ed0a7[_0x2da6('0x26')][_0x2da6('0x6e')]=_0x22c881[0x0];if(!_0x1e1629[_0x2da6('0x55')][_0x2da6('0x5d')])return;return db[_0x2da6('0x7d')][_0x2da6('0x54')]({'where':{'id':_0x1e1629[_0x2da6('0x55')][_0x2da6('0x5d')],'role':_0x2da6('0x5f')},'attributes':['id','name','fullname',_0x2da6('0x70'),'internal'],'raw':!![]});}return null;})[_0x2da6('0x1d')](function(_0x24f11a){if(!_0x24f11a)return null;_0x5ed0a7['message'][_0x2da6('0x5f')]=_0x24f11a;return _0x5ed0a7;})[_0x2da6('0x1d')](function(_0xa65227){if(_0xa65227){_0xa65227[_0x2da6('0x26')][_0x2da6('0x72')]=util[_0x2da6('0x5b')](_0x2da6('0x73'),_0x1e1629[_0x2da6('0x5e')][_0x2da6('0x37')]);_0xa65227['message'][_0x2da6('0x74')]=_0x5ed0a7[_0x2da6('0x74')];_0xa65227[_0x2da6('0x26')]['motionChannel']=_0x5ed0a7['channel'];_0xa65227[_0x2da6('0x26')]['event']='reject';respondWithRpcPromise(_0x2da6('0x77'),_0x2da6('0x77'),{'event':_0x2da6('0x7e'),'message':_0xa65227['message']},client9002);return _0x5ed0a7;}return null;})[_0x2da6('0x1d')](respondWithResult(_0xc9c5ac,null))[_0x2da6('0x50')](handleError(_0xc9c5ac,null));};exports['create']=function(_0x156e65,_0x2a7565){var _0x18762d;return db[_0x2da6('0x3b')][_0x2da6('0x7f')](_0x156e65[_0x2da6('0x55')],{})[_0x2da6('0x1d')](function(_0x2fcd1e){_0x18762d=_0x2fcd1e;return db[_0x2da6('0x80')][_0x2da6('0x81')]({'where':{'id':_0x18762d['ContactId']}});})[_0x2da6('0x1d')](function(_0x381259){if(_[_0x2da6('0x61')](_0x381259)){return;}else{_0x18762d[_0x2da6('0x59')]=_0x381259[_0x2da6('0x59')];return db[_0x2da6('0x82')]['findOne']({'where':{'id':_0x18762d[_0x2da6('0x83')]}});}})[_0x2da6('0x1d')](function(_0x269e84){return respondWithRpcPromise(_0x2da6('0x84'),_0x2da6('0x84'),{'FaxAccountId':_[_0x2da6('0x61')](_0x156e65['body'])?undefined:_0x156e65[_0x2da6('0x55')][_0x2da6('0x85')],'path':_[_0x2da6('0x61')](_0x269e84)?undefined:util[_0x2da6('0x5b')](_0x2da6('0x86'),_0x269e84[_0x2da6('0x87')]),'fax':_[_0x2da6('0x61')](_0x18762d['fax'])?undefined:_0x18762d[_0x2da6('0x59')],'AttachmentId':_0x18762d['AttachmentId']},client9002);})[_0x2da6('0x1d')](respondWithResult(_0x2a7565,0xc9))[_0x2da6('0x50')](handleError(_0x2a7565,null));};exports[_0x2da6('0x88')]=function(_0xdbf515,_0x55b3d2){var _0x248c4f=path[_0x2da6('0x89')](config[_0x2da6('0x8a')],_0x2da6('0x8b'),_0x2da6('0x8c'),'attachments');return db['FaxMessage'][_0x2da6('0x54')]({'where':{'id':_0xdbf515[_0x2da6('0x8d')]['id']},'include':[{'model':db[_0x2da6('0x82')],'as':_0x2da6('0x82')}]})[_0x2da6('0x1d')](handleEntityNotFound(_0x55b3d2,null))[_0x2da6('0x1d')](function(_0x41e8ca){if(_0x41e8ca){return _0x55b3d2[_0x2da6('0x88')](path[_0x2da6('0x89')](_0x248c4f,_0x41e8ca[_0x2da6('0x82')][_0x2da6('0x87')]));}})[_0x2da6('0x50')](handleError(_0x55b3d2,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index f0086dc..26d9190 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 _0x7d37=['FaxMessage','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3e384b,_0x59a016){var _0x33d8ff=function(_0x1674b8){while(--_0x1674b8){_0x3e384b['push'](_0x3e384b['shift']());}};_0x33d8ff(++_0x59a016);}(_0x7d37,0x1db));var _0x77d3=function(_0x453c53,_0x88c188){_0x453c53=_0x453c53-0x0;var _0x4e9de7=_0x7d37[_0x453c53];return _0x4e9de7;};'use strict';var EventEmitter=require(_0x77d3('0x0'));var FaxMessage=require(_0x77d3('0x1'))['db'][_0x77d3('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x77d3('0x3'),'afterUpdate':_0x77d3('0x4'),'afterDestroy':_0x77d3('0x5')};function emitEvent(_0x52c909){return function(_0x293f20,_0x2ae533,_0x59773d){FaxMessageEvents[_0x77d3('0x6')](_0x52c909+':'+_0x293f20['id'],_0x293f20);FaxMessageEvents['emit'](_0x52c909,_0x293f20);_0x59773d(null);};}for(var e in events){if(events[_0x77d3('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x77d3('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x5581=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','FaxMessage'];(function(_0x559ba4,_0x117831){var _0x2467a5=function(_0x2e05b5){while(--_0x2e05b5){_0x559ba4['push'](_0x559ba4['shift']());}};_0x2467a5(++_0x117831);}(_0x5581,0x115));var _0x1558=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x5581[_0xbf8ebe];return _0x1e25e8;};'use strict';var EventEmitter=require(_0x1558('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x1558('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1558('0x2')](0x0);var events={'afterCreate':_0x1558('0x3'),'afterUpdate':_0x1558('0x4'),'afterDestroy':_0x1558('0x5')};function emitEvent(_0x325c21){return function(_0x48c6fa,_0x113434,_0xa09e11){FaxMessageEvents['emit'](_0x325c21+':'+_0x48c6fa['id'],_0x48c6fa);FaxMessageEvents[_0x1558('0x6')](_0x325c21,_0x48c6fa);_0xa09e11(null);};}for(var e in events){if(events[_0x1558('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1558('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 3ce07f6..b3270e1 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 _0xf873=['body','models','get','toLowerCase','direction','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise','define','FaxMessage','fax_messages','fti_fax_messages'];(function(_0x545fe3,_0x3b191f){var _0x480702=function(_0x21c970){while(--_0x21c970){_0x545fe3['push'](_0x545fe3['shift']());}};_0x480702(++_0x3b191f);}(_0xf873,0x92));var _0x3f87=function(_0xcf5188,_0xeb7f72){_0xcf5188=_0xcf5188-0x0;var _0x550766=_0xf873[_0xcf5188];return _0x550766;};'use strict';var _=require(_0x3f87('0x0'));var util=require(_0x3f87('0x1'));var logger=require('../../config/logger')(_0x3f87('0x2'));var moment=require(_0x3f87('0x3'));var BPromise=require(_0x3f87('0x4'));var rp=require(_0x3f87('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module['exports']=function(_0x28d1fd,_0x5ad8a3){return _0x28d1fd[_0x3f87('0x6')](_0x3f87('0x7'),attributes,{'tableName':_0x3f87('0x8'),'paranoid':![],'indexes':[{'name':_0x3f87('0x9'),'fields':[_0x3f87('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c9d75,_0x48b80d,_0x1137c7){var _0x6592fe=_0x28d1fd[_0x3f87('0xb')];var _0x2aff7f=_0x2c9d75[_0x3f87('0xc')]({'plain':!![]});if(_0x2aff7f['direction'][_0x3f87('0xd')]()==='in'||_0x2aff7f[_0x3f87('0xe')][_0x3f87('0xd')]()===_0x3f87('0xf')&&!_0x2aff7f[_0x3f87('0x10')]&&!_[_0x3f87('0x11')](_0x2aff7f[_0x3f87('0x12')])){_0x6592fe[_0x3f87('0x13')]['findOne']({'where':{'id':_0x2aff7f[_0x3f87('0x14')]}})['then'](function(_0x1657fa){if(_0x1657fa){_0x1657fa[_0x3f87('0x15')]({'lastMsgAt':_0x2aff7f[_0x3f87('0x16')],'lastMsgDirection':_0x2aff7f[_0x3f87('0xe')]['toLowerCase']()});}})[_0x3f87('0x17')](function(_0x493da1){console[_0x3f87('0x18')](_0x493da1);});}_0x1137c7();}},'charset':_0x3f87('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xbe7b=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxMessage','body','FULLTEXT','models','direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xbe7b,0x1e2));var _0xbbe7=function(_0x26ef14,_0x54606f){_0x26ef14=_0x26ef14-0x0;var _0x209847=_0xbe7b[_0x26ef14];return _0x209847;};'use strict';var _=require(_0xbbe7('0x0'));var util=require(_0xbbe7('0x1'));var logger=require(_0xbbe7('0x2'))(_0xbbe7('0x3'));var moment=require(_0xbbe7('0x4'));var BPromise=require(_0xbbe7('0x5'));var rp=require(_0xbbe7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbe7('0x7'));var config=require(_0xbbe7('0x8'));var attributes=require('./faxMessage.attributes');module[_0xbbe7('0x9')]=function(_0x42828c,_0x529691){return _0x42828c[_0xbbe7('0xa')](_0xbbe7('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xbbe7('0xc')],'type':_0xbbe7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f52a0,_0x16bafd,_0x29da2c){var _0x3aa9bb=_0x42828c[_0xbbe7('0xe')];var _0x3a208e=_0x1f52a0['get']({'plain':!![]});if(_0x3a208e[_0xbbe7('0xf')][_0xbbe7('0x10')]()==='in'||_0x3a208e['direction'][_0xbbe7('0x10')]()==='out'&&!_0x3a208e['secret']&&!_[_0xbbe7('0x11')](_0x3a208e[_0xbbe7('0x12')])){_0x3aa9bb[_0xbbe7('0x13')][_0xbbe7('0x14')]({'where':{'id':_0x3a208e[_0xbbe7('0x15')]}})[_0xbbe7('0x16')](function(_0x563668){if(_0x563668){_0x563668[_0xbbe7('0x17')]({'lastMsgAt':_0x3a208e['createdAt'],'lastMsgDirection':_0x3a208e['direction'][_0xbbe7('0x10')]()});}})[_0xbbe7('0x18')](function(_0x29818b){console[_0xbbe7('0x19')](_0x29818b);});}_0x29da2c();}},'charset':_0xbbe7('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index db47bf9..cb8ef09 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 _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x425d,0x1e0));var _0xd425=function(_0x58bf72,_0x270672){_0x58bf72=_0x58bf72-0x0;var _0x5ac3aa=_0x425d[_0x58bf72];return _0x5ac3aa;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});config[_0xd425('0xc')]=_[_0xd425('0xd')](config['redis'],{'host':_0xd425('0xe'),'port':0x18eb});var socket=require(_0xd425('0xf'))(new Redis(config[_0xd425('0xc')]));require(_0xd425('0x10'))[_0xd425('0x11')](socket);function respondWithRpcPromise(_0x2beb20,_0x30111e,_0x1969ba){return new BPromise(function(_0x3a7a01,_0x35a7f4){return client[_0xd425('0x12')](_0x2beb20,_0x1969ba)[_0xd425('0x13')](function(_0x26f6d2){logger[_0xd425('0x14')](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));logger[_0xd425('0x17')](_0xd425('0x18'),_0x30111e,_0xd425('0x16'),JSON[_0xd425('0x19')](_0x26f6d2));if(_0x26f6d2['error']){if(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1b')]===0x1f4){logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x35a7f4(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x3a7a01(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}else{logger['info'](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));_0x3a7a01(_0x26f6d2[_0xd425('0x1d')][_0xd425('0x1c')]);}})['catch'](function(_0x58a0c1){logger['error']('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x58a0c1);_0x35a7f4(_0x58a0c1);});});}exports[_0xd425('0x1e')]=function(_0xb92870){var _0x3c98db=this;return new Promise(function(_0x5e797a,_0x355af0){return db[_0xd425('0x1f')]['create'](_0xb92870[_0xd425('0x20')],{'raw':_0xb92870[_0xd425('0x21')]?_0xb92870[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![]})[_0xd425('0x13')](function(_0xb240c4){logger[_0xd425('0x14')](_0xd425('0x1e'),_0xb92870);logger[_0xd425('0x17')](_0xd425('0x1e'),_0xb92870,JSON[_0xd425('0x19')](_0xb240c4));_0x5e797a(_0xb240c4);})[_0xd425('0x23')](function(_0x47f44a){logger[_0xd425('0x1a')](_0xd425('0x1e'),_0x47f44a[_0xd425('0x1c')],_0xb92870);_0x355af0(_0x3c98db[_0xd425('0x1a')](0x1f4,_0x47f44a[_0xd425('0x1c')]));});});};exports[_0xd425('0x24')]=function(_0x3c3402){var _0x577e4b=this;return new Promise(function(_0x12f951,_0x177de2){return db[_0xd425('0x1f')]['update'](_0x3c3402[_0xd425('0x20')],{'raw':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x25')]||null:null,'attributes':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x26')]||null:null,'limit':_0x3c3402['options']?_0x3c3402[_0xd425('0x21')][_0xd425('0x27')]||null:null})[_0xd425('0x13')](function(_0x3695dd){logger[_0xd425('0x14')](_0xd425('0x24'),_0x3c3402);logger[_0xd425('0x17')](_0xd425('0x24'),_0x3c3402,JSON[_0xd425('0x19')](_0x3695dd));_0x12f951(_0x3695dd);})[_0xd425('0x23')](function(_0x3583b0){logger['error'](_0xd425('0x24'),_0x3583b0[_0xd425('0x1c')],_0x3c3402);_0x177de2(_0x577e4b[_0xd425('0x1a')](0x1f4,_0x3583b0[_0xd425('0x1c')]));});});}; \ No newline at end of file +var _0xbd50=['request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','options','raw','then','UpdateFaxMessage','FaxMessage','update','body','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','./faxMessage.socket','register'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xbd50,0x196));var _0x0bd5=function(_0x1a422a,_0x3468fd){_0x1a422a=_0x1a422a-0x0;var _0x4dcab4=_0xbd50[_0x1a422a];return _0x4dcab4;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});config[_0x0bd5('0xa')]=_[_0x0bd5('0xb')](config[_0x0bd5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd5('0xa')]));require(_0x0bd5('0xc'))[_0x0bd5('0xd')](socket);function respondWithRpcPromise(_0x5f5a0c,_0xa98f54,_0x2fa7d1){return new BPromise(function(_0x519bc6,_0x210f45){return client[_0x0bd5('0xe')](_0x5f5a0c,_0x2fa7d1)['then'](function(_0x1ce7dd){logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,'request\x20sent');logger[_0x0bd5('0x11')](_0x0bd5('0x12'),_0xa98f54,_0x0bd5('0x13'),JSON[_0x0bd5('0x14')](_0x1ce7dd));if(_0x1ce7dd[_0x0bd5('0x15')]){if(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x16')]===0x1f4){logger[_0x0bd5('0x15')]('FaxMessage,\x20%s,\x20%s',_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);return _0x210f45(_0x1ce7dd['error'][_0x0bd5('0x17')]);}logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')]['message']);return _0x519bc6(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);}else{logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,_0x0bd5('0x13'));_0x519bc6(_0x1ce7dd[_0x0bd5('0x18')][_0x0bd5('0x17')]);}})[_0x0bd5('0x19')](function(_0x29fa4c){logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x29fa4c);_0x210f45(_0x29fa4c);});});}exports[_0x0bd5('0x1a')]=function(_0x4008bd){var _0x2dc1e5=this;return new Promise(function(_0x527c37,_0x5ba943){return db['FaxMessage']['create'](_0x4008bd['body'],{'raw':_0x4008bd[_0x0bd5('0x1b')]?_0x4008bd[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![]})[_0x0bd5('0x1d')](function(_0x6ee1a8){logger['info'](_0x0bd5('0x1a'),_0x4008bd);logger[_0x0bd5('0x11')](_0x0bd5('0x1a'),_0x4008bd,JSON['stringify'](_0x6ee1a8));_0x527c37(_0x6ee1a8);})[_0x0bd5('0x19')](function(_0x4a8787){logger['error'](_0x0bd5('0x1a'),_0x4a8787[_0x0bd5('0x17')],_0x4008bd);_0x5ba943(_0x2dc1e5[_0x0bd5('0x15')](0x1f4,_0x4a8787['message']));});});};exports[_0x0bd5('0x1e')]=function(_0x5eab3e){var _0x456e87=this;return new Promise(function(_0x3ffb08,_0x18cec3){return db[_0x0bd5('0x1f')][_0x0bd5('0x20')](_0x5eab3e[_0x0bd5('0x21')],{'raw':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x22')]||null:null,'attributes':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['attributes']||null:null,'limit':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['limit']||null:null})[_0x0bd5('0x1d')](function(_0x8eccc9){logger['info'](_0x0bd5('0x1e'),_0x5eab3e);logger[_0x0bd5('0x11')](_0x0bd5('0x1e'),_0x5eab3e,JSON[_0x0bd5('0x14')](_0x8eccc9));_0x3ffb08(_0x8eccc9);})['catch'](function(_0x440e69){logger[_0x0bd5('0x15')](_0x0bd5('0x1e'),_0x440e69[_0x0bd5('0x17')],_0x5eab3e);_0x18cec3(_0x456e87[_0x0bd5('0x15')](0x1f4,_0x440e69[_0x0bd5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 5fff965..7bf6ce3 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 _0xf967=['save','remove','update','register','faxMessage:','./faxMessage.events'];(function(_0x4331f8,_0xe06640){var _0x44a1a5=function(_0x2c5e92){while(--_0x2c5e92){_0x4331f8['push'](_0x4331f8['shift']());}};_0x44a1a5(++_0xe06640);}(_0xf967,0x119));var _0x7f96=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf967[_0x4b369d];return _0x571a98;};'use strict';var FaxMessageEvents=require(_0x7f96('0x0'));var events=[_0x7f96('0x1'),_0x7f96('0x2'),_0x7f96('0x3')];function createListener(_0x208148,_0x2aa9a0){return function(_0xb24a74){_0x2aa9a0['emit'](_0x208148,_0xb24a74);};}function removeListener(_0x14459d,_0x34b65){return function(){FaxMessageEvents['removeListener'](_0x14459d,_0x34b65);};}exports[_0x7f96('0x4')]=function(_0xdb3f99){for(var _0x48a183=0x0,_0x25b2ba=events['length'];_0x48a183<_0x25b2ba;_0x48a183++){var _0x19d975=events[_0x48a183];var _0x166a8a=createListener(_0x7f96('0x5')+_0x19d975,_0xdb3f99);FaxMessageEvents['on'](_0x19d975,_0x166a8a);}}; \ No newline at end of file +var _0x0098=['length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x4a9941,_0x476e36){var _0x48923c=function(_0x2e2f34){while(--_0x2e2f34){_0x4a9941['push'](_0x4a9941['shift']());}};_0x48923c(++_0x476e36);}(_0x0098,0x185));var _0x8009=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x0098[_0x5d2803];return _0xdcad2c;};'use strict';var FaxMessageEvents=require(_0x8009('0x0'));var events=[_0x8009('0x1'),_0x8009('0x2'),_0x8009('0x3')];function createListener(_0x4b2b3b,_0x573acd){return function(_0x3cfb2c){_0x573acd[_0x8009('0x4')](_0x4b2b3b,_0x3cfb2c);};}function removeListener(_0x12c472,_0x42dad1){return function(){FaxMessageEvents[_0x8009('0x5')](_0x12c472,_0x42dad1);};}exports[_0x8009('0x6')]=function(_0x4cd92f){for(var _0xe6d126=0x0,_0x363295=events[_0x8009('0x7')];_0xe6d126<_0x363295;_0xe6d126++){var _0x426ef5=events[_0xe6d126];var _0x42acac=createListener(_0x8009('0x8')+_0x426ef5,_0x4cd92f);FaxMessageEvents['on'](_0x426ef5,_0x42acac);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 573fc71..e48a32a 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 _0x7072=['/:id/download','download','post','tracked','fax','faxmessage:create','create','put','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xe48598,_0x2eca40){var _0x200b0e=function(_0x5dc47b){while(--_0x5dc47b){_0xe48598['push'](_0xe48598['shift']());}};_0x200b0e(++_0x2eca40);}(_0x7072,0x138));var _0x2707=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x7072[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2707('0x5'));var config=require('../../config/environment');var controller=require(_0x2707('0x6'));router[_0x2707('0x7')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0x7')](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0x7')](_0x2707('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2707('0x7')](_0x2707('0xd'),auth[_0x2707('0x8')](),controller[_0x2707('0xe')]);router[_0x2707('0xf')]('/',auth[_0x2707('0x8')](),interaction[_0x2707('0x10')](_0x2707('0x11'),_0x2707('0x12')),controller[_0x2707('0x13')]);router[_0x2707('0x14')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['update']);router[_0x2707('0x14')]('/:id/accept',auth[_0x2707('0x8')](),controller[_0x2707('0x15')]);router[_0x2707('0x14')](_0x2707('0x16'),auth[_0x2707('0x8')](),controller['reject']);router[_0x2707('0x17')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['destroy']);module[_0x2707('0x18')]=router; \ No newline at end of file +var _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','faxmessage:create'];(function(_0x305486,_0x24acd4){var _0xa04940=function(_0x29e866){while(--_0x29e866){_0x305486['push'](_0x305486['shift']());}};_0xa04940(++_0x24acd4);}(_0x1be1,0x192));var _0x11be=function(_0x1f68c7,_0x46a99c){_0x1f68c7=_0x1f68c7-0x0;var _0x5b2217=_0x1be1[_0x1f68c7];return _0x5b2217;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('fax',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index dcdefd7..3db2fe0 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 _0x1d91=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x579b79,_0x5b57b2){var _0x41e899=function(_0x2c8b7){while(--_0x2c8b7){_0x579b79['push'](_0x579b79['shift']());}};_0x41e899(++_0x5b57b2);}(_0x1d91,0x150));var _0x11d9=function(_0x29aa8f,_0x3c9ade){_0x29aa8f=_0x29aa8f-0x0;var _0x4f94cb=_0x1d91[_0x29aa8f];return _0x4f94cb;};'use strict';var Sequelize=require(_0x11d9('0x0'));module[_0x11d9('0x1')]={'name':{'type':Sequelize[_0x11d9('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x11d9('0x2')]},'timeout':{'type':Sequelize[_0x11d9('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x11d9('0x4')](_0x11d9('0x5'),'beepall',_0x11d9('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x11d9('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb89f=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x356596,_0x1a1a8c){var _0x231fa9=function(_0x2b0a09){while(--_0x2b0a09){_0x356596['push'](_0x356596['shift']());}};_0x231fa9(++_0x1a1a8c);}(_0xb89f,0x16a));var _0xfb89=function(_0x460276,_0x150705){_0x460276=_0x460276-0x0;var _0x354a2c=_0xb89f[_0x460276];return _0x354a2c;};'use strict';var Sequelize=require(_0xfb89('0x0'));module[_0xfb89('0x1')]={'name':{'type':Sequelize[_0xfb89('0x2')],'unique':_0xfb89('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfb89('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb89('0x5')](_0xfb89('0x6'),_0xfb89('0x7'),_0xfb89('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xfb89('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 941aa01..0b0cea6 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 _0xc838=['create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','describe','findOne','UserFaxQueue','nolimit','order','sort','pick','FaxQueueId','merge','filter','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','User','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','then','FaxQueues','UserProfileResource','name','index','map','FaxQueue','rawAttributes','fieldName','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','options','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x58d00e,_0x5e6616){var _0xa85df7=function(_0x2f5e3b){while(--_0x2f5e3b){_0x58d00e['push'](_0x58d00e['shift']());}};_0xa85df7(++_0x5e6616);}(_0xc838,0xbd));var _0x8c83=function(_0x451651,_0x43a896){_0x451651=_0x451651-0x0;var _0x2f49af=_0xc838[_0x451651];return _0x2f49af;};'use strict';var BPromise=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var _=require(_0x8c83('0x2'));var squel=require(_0x8c83('0x3'));var Redis=require(_0x8c83('0x4'));var qs=require(_0x8c83('0x5'));var logger=require(_0x8c83('0x6'))(_0x8c83('0x7'));var config=require(_0x8c83('0x8'));var db=require(_0x8c83('0x9'))['db'];config[_0x8c83('0xa')]=_[_0x8c83('0xb')](config[_0x8c83('0xa')],{'host':_0x8c83('0xc'),'port':0x18eb});var socket=require(_0x8c83('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x8c83('0xe')](socket);function respondWithStatusCode(_0x4c2f04,_0x389c28){_0x389c28=_0x389c28||0xcc;return function(_0x3e7a8f){if(_0x3e7a8f){return _0x4c2f04[_0x8c83('0xf')](_0x389c28);}return _0x4c2f04[_0x8c83('0x10')](_0x389c28)[_0x8c83('0x11')]();};}function respondWithResult(_0x21442e,_0x2e547f){_0x2e547f=_0x2e547f||0xc8;return function(_0x105a36){if(_0x105a36){return _0x21442e[_0x8c83('0x10')](_0x2e547f)[_0x8c83('0x12')](_0x105a36);}};}function respondWithFilteredResult(_0x2fb6e5,_0x599205){return function(_0x1fc0b1){if(_0x1fc0b1){var _0x506562=typeof _0x599205['offset']===_0x8c83('0x13')&&typeof _0x599205['limit']===_0x8c83('0x13');var _0x113c7b=_0x1fc0b1[_0x8c83('0x14')];var _0x45d86c=_0x506562?0x0:_0x599205[_0x8c83('0x15')];var _0x1aaac5=_0x506562?_0x1fc0b1[_0x8c83('0x14')]:_0x599205[_0x8c83('0x15')]+_0x599205[_0x8c83('0x16')];var _0xf2dee0;if(_0x1aaac5>=_0x113c7b){_0x1aaac5=_0x113c7b;_0xf2dee0=0xc8;}else{_0xf2dee0=0xce;}_0x2fb6e5['status'](_0xf2dee0);return _0x2fb6e5[_0x8c83('0x17')](_0x8c83('0x18'),_0x45d86c+'-'+_0x1aaac5+'/'+_0x113c7b)['json'](_0x1fc0b1);}return null;};}function saveUpdates(_0x593c97){return function(_0x40bc0d){if(_0x40bc0d){return _0x40bc0d['update'](_0x593c97)[_0x8c83('0x19')](function(_0x535962){return _0x535962;});}return null;};}function removeEntity(_0x47d076){return function(_0x3f4b38){if(_0x3f4b38){return _0x3f4b38['destroy']()[_0x8c83('0x19')](function(){var _0x8899b3=_0x3f4b38['get']({'plain':!![]});var _0x5a2a69=_0x8c83('0x1a');return db[_0x8c83('0x1b')]['destroy']({'where':{'type':_0x5a2a69,'resourceId':_0x8899b3['id']}})[_0x8c83('0x19')](function(){return _0x3f4b38;});})[_0x8c83('0x19')](function(){_0x47d076['status'](0xcc)[_0x8c83('0x11')]();});}};}function handleEntityNotFound(_0x4cde38){return function(_0x34fdab){if(!_0x34fdab){_0x4cde38[_0x8c83('0xf')](0x194);}return _0x34fdab;};}function handleError(_0x17937e,_0xf7b089){_0xf7b089=_0xf7b089||0x1f4;return function(_0x9e56){logger['error'](_0x9e56['stack']);if(_0x9e56[_0x8c83('0x1c')]){delete _0x9e56[_0x8c83('0x1c')];}_0x17937e['status'](_0xf7b089)['send'](_0x9e56);};}exports[_0x8c83('0x1d')]=function(_0xce3514,_0x27aefd){var _0x5034e1={};var _0x1bd922={'count':0x0,'rows':[]};var _0x4f7088=_[_0x8c83('0x1e')](db[_0x8c83('0x1f')][_0x8c83('0x20')],function(_0x1180e1){return{'name':_0x1180e1[_0x8c83('0x21')],'type':_0x1180e1['type']['key']};});_0x5034e1=qs['getOptions'](_0x4f7088,_0xce3514);var _0x41d7be={'where':_0x5034e1[_0x8c83('0x22')]};return db['FaxQueue'][_0x8c83('0x14')](_0x41d7be)[_0x8c83('0x19')](function(_0x142201){_0x1bd922['count']=_0x142201;_0x5034e1['include']=qs[_0x8c83('0x23')](_0xce3514['query']);return db[_0x8c83('0x1f')][_0x8c83('0x24')](_0x5034e1);})[_0x8c83('0x19')](function(_0x178056){_0x1bd922[_0x8c83('0x25')]=_0x178056;return _0x1bd922;})[_0x8c83('0x19')](respondWithFilteredResult(_0x27aefd,_0x5034e1))['catch'](handleError(_0x27aefd,null));};exports[_0x8c83('0x26')]=function(_0x5587db,_0x4c9bca){var _0x6ca25b={'raw':!![],'where':{'id':_0x5587db[_0x8c83('0x27')]['id']}},_0x242d5b={};_0x242d5b[_0x8c83('0x28')]=_[_0x8c83('0x29')](db[_0x8c83('0x1f')][_0x8c83('0x20')]);_0x242d5b['query']=_[_0x8c83('0x29')](_0x5587db[_0x8c83('0x2a')]);_0x242d5b[_0x8c83('0x2b')]=_['intersection'](_0x242d5b[_0x8c83('0x28')],_0x242d5b[_0x8c83('0x2a')]);_0x6ca25b['attributes']=_[_0x8c83('0x2c')](_0x242d5b[_0x8c83('0x28')],qs[_0x8c83('0x2d')](_0x5587db[_0x8c83('0x2a')][_0x8c83('0x2d')]));_0x6ca25b[_0x8c83('0x2e')]=_0x6ca25b[_0x8c83('0x2e')][_0x8c83('0x2f')]?_0x6ca25b[_0x8c83('0x2e')]:_0x242d5b[_0x8c83('0x28')];if(_0x5587db[_0x8c83('0x2a')][_0x8c83('0x30')]){_0x6ca25b['include']=[{'all':!![]}];}_0x6ca25b=_['merge']({},_0x6ca25b,_0x5587db[_0x8c83('0x31')]);return db[_0x8c83('0x1f')][_0x8c83('0x32')](_0x6ca25b)[_0x8c83('0x19')](handleEntityNotFound(_0x4c9bca,null))[_0x8c83('0x19')](respondWithResult(_0x4c9bca,null))['catch'](handleError(_0x4c9bca,null));};exports['create']=function(_0x3a200c,_0x4347d6){return db[_0x8c83('0x1f')]['create'](_0x3a200c['body'],{})['then'](function(_0x4cde01){var _0x259bca=_0x3a200c[_0x8c83('0x33')][_0x8c83('0x34')]({'plain':!![]});if(!_0x259bca)throw new Error(_0x8c83('0x35'));if(_0x259bca[_0x8c83('0x36')]===_0x8c83('0x33')){var _0x1e9867=_0x4cde01[_0x8c83('0x34')]({'plain':!![]});var _0x4da901='FaxQueues';return db[_0x8c83('0x37')][_0x8c83('0x32')]({'where':{'name':_0x4da901,'userProfileId':_0x259bca[_0x8c83('0x38')]},'raw':!![]})['then'](function(_0x2bab6d){if(_0x2bab6d&&_0x2bab6d['autoAssociation']===0x0){return db[_0x8c83('0x1b')][_0x8c83('0x39')]({'name':_0x1e9867['name'],'resourceId':_0x1e9867['id'],'type':_0x2bab6d[_0x8c83('0x1c')],'sectionId':_0x2bab6d['id']},{})['then'](function(){return _0x4cde01;});}else{return _0x4cde01;}})['catch'](function(_0x5dfc16){logger[_0x8c83('0x3a')](_0x8c83('0x3b'),_0x5dfc16);throw _0x5dfc16;});}return _0x4cde01;})[_0x8c83('0x19')](respondWithResult(_0x4347d6,0xc9))[_0x8c83('0x3c')](handleError(_0x4347d6,null));};exports[_0x8c83('0x3d')]=function(_0x3883de,_0x3a6c98){if(_0x3883de['body']['id']){delete _0x3883de['body']['id'];}return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x3883de[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x3a6c98,null))[_0x8c83('0x19')](saveUpdates(_0x3883de[_0x8c83('0x3e')],null))[_0x8c83('0x19')](respondWithResult(_0x3a6c98,null))['catch'](handleError(_0x3a6c98,null));};exports['destroy']=function(_0x2a4c6c,_0x1f1a10){return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x2a4c6c[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x1f1a10,null))[_0x8c83('0x19')](removeEntity(_0x1f1a10,null))[_0x8c83('0x3c')](handleError(_0x1f1a10,null));};exports[_0x8c83('0x3f')]=function(_0x1c5033,_0x50ef1e){return db['FaxQueue'][_0x8c83('0x3f')]()[_0x8c83('0x19')](respondWithResult(_0x50ef1e,null))[_0x8c83('0x3c')](handleError(_0x50ef1e,null));};exports['getMembers']=function(_0x37d89c,_0x19ff09){var _0x28d8b0={'raw':!![],'where':{}},_0x53c8f3={},_0x5338fd;return db['FaxQueue'][_0x8c83('0x40')]({'where':{'id':_0x37d89c['params']['id']}})['then'](handleEntityNotFound(_0x19ff09,null))[_0x8c83('0x19')](function(_0x4f2aea){if(_0x4f2aea){_0x5338fd=_0x4f2aea[_0x8c83('0x34')]({'plain':!![]});_0x53c8f3[_0x8c83('0x28')]=_[_0x8c83('0x29')](db[_0x8c83('0x41')]['rawAttributes']);_0x53c8f3['query']=_[_0x8c83('0x29')](_0x37d89c[_0x8c83('0x2a')]);_0x53c8f3[_0x8c83('0x2b')]=_['intersection'](_0x53c8f3[_0x8c83('0x28')],_0x53c8f3['query']);_0x28d8b0[_0x8c83('0x2e')]=_[_0x8c83('0x2c')](_0x53c8f3[_0x8c83('0x28')],qs[_0x8c83('0x2d')](_0x37d89c['query'][_0x8c83('0x2d')]));_0x28d8b0['attributes']=_0x28d8b0['attributes'][_0x8c83('0x2f')]?_0x28d8b0[_0x8c83('0x2e')]:_0x53c8f3[_0x8c83('0x28')];if(!_0x37d89c[_0x8c83('0x2a')]['hasOwnProperty'](_0x8c83('0x42'))){_0x28d8b0[_0x8c83('0x16')]=qs[_0x8c83('0x16')](_0x37d89c[_0x8c83('0x2a')][_0x8c83('0x16')]);_0x28d8b0[_0x8c83('0x15')]=qs[_0x8c83('0x15')](_0x37d89c[_0x8c83('0x2a')]['offset']);}_0x28d8b0[_0x8c83('0x43')]=qs['sort'](_0x37d89c[_0x8c83('0x2a')][_0x8c83('0x44')]);_0x28d8b0['where']=qs['filters'](_[_0x8c83('0x45')](_0x37d89c[_0x8c83('0x2a')],_0x53c8f3['filters']));_0x28d8b0['where'][_0x8c83('0x46')]=_0x4f2aea['id'];if(_0x37d89c[_0x8c83('0x2a')]['filter']){_0x28d8b0[_0x8c83('0x22')]=_[_0x8c83('0x47')](_0x28d8b0[_0x8c83('0x22')],{'$or':_['map'](_0x28d8b0[_0x8c83('0x2e')],function(_0x1f7d36){var _0x10a783={};_0x10a783[_0x1f7d36]={'$like':'%'+_0x37d89c['query'][_0x8c83('0x48')]+'%'};return _0x10a783;})});}_0x28d8b0=_[_0x8c83('0x47')]({},_0x28d8b0,_0x37d89c[_0x8c83('0x31')]);return db[_0x8c83('0x41')][_0x8c83('0x24')](_0x28d8b0);}})[_0x8c83('0x19')](function(_0x57a463){if(_0x57a463){return db['User'][_0x8c83('0x49')]({'where':{'id':_[_0x8c83('0x1e')](_0x57a463,_0x8c83('0x4a')),'role':_0x8c83('0x4b')},'attributes':['id',_0x8c83('0x1c'),_0x8c83('0x4c'),_0x8c83('0x4d'),_0x8c83('0x4e')]});}})[_0x8c83('0x19')](function(_0x480bf4){if(_0x480bf4){return{'count':_0x480bf4['count'],'rows':_[_0x8c83('0x1e')](_0x480bf4[_0x8c83('0x25')],function(_0x30ff01){return{'membername':_0x30ff01[_0x8c83('0x1c')],'UserId':_0x30ff01['id'],'queue_name':_0x5338fd[_0x8c83('0x1c')],'FaxQueueId':_0x5338fd['id'],'interface':util[_0x8c83('0x4f')](_0x8c83('0x50'),_0x8c83('0x51'),_0x30ff01[_0x8c83('0x1c')]),'penalty':0x0,'paused':_0x30ff01[_0x8c83('0x4c')],'createdAt':_0x30ff01['createdAt'],'updatedAt':_0x30ff01[_0x8c83('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8c83('0x19')](respondWithFilteredResult(_0x19ff09,_0x28d8b0))[_0x8c83('0x3c')](handleError(_0x19ff09,null));};exports[_0x8c83('0x52')]=function(_0x2c9865,_0xe7401b){var _0x1573bc={};var _0x31130c={};var _0x2f0a57;var _0x724ecf;return db['FaxQueue'][_0x8c83('0x40')]({'where':{'id':_0x2c9865['params']['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0xe7401b,null))[_0x8c83('0x19')](function(_0x3cc45c){if(_0x3cc45c){_0x2f0a57=_0x3cc45c;_0x31130c['model']=_[_0x8c83('0x29')](db[_0x8c83('0x53')]['rawAttributes']);_0x31130c['query']=_['keys'](_0x2c9865[_0x8c83('0x2a')]);_0x31130c['filters']=_[_0x8c83('0x2c')](_0x31130c[_0x8c83('0x28')],_0x31130c['query']);_0x1573bc['attributes']=_['intersection'](_0x31130c[_0x8c83('0x28')],qs[_0x8c83('0x2d')](_0x2c9865['query']['fields']));_0x1573bc[_0x8c83('0x2e')]=_0x1573bc[_0x8c83('0x2e')]['length']?_0x1573bc[_0x8c83('0x2e')]:_0x31130c[_0x8c83('0x28')];_0x1573bc[_0x8c83('0x43')]=qs['sort'](_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x44')]);_0x1573bc[_0x8c83('0x22')]=qs['filters'](_[_0x8c83('0x45')](_0x2c9865['query'],_0x31130c[_0x8c83('0x2b')]));if(_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x48')]){_0x1573bc[_0x8c83('0x22')]=_['merge'](_0x1573bc['where'],{'$or':_[_0x8c83('0x1e')](_0x1573bc[_0x8c83('0x2e')],function(_0x4169b9){var _0x54ba39={};_0x54ba39[_0x4169b9]={'$like':'%'+_0x2c9865[_0x8c83('0x2a')]['filter']+'%'};return _0x54ba39;})});}_0x1573bc=_[_0x8c83('0x47')]({},_0x1573bc,_0x2c9865[_0x8c83('0x31')]);return _0x2f0a57[_0x8c83('0x52')](_0x1573bc);}})[_0x8c83('0x19')](function(_0x3fbbb4){if(_0x3fbbb4){_0x724ecf=_0x3fbbb4['length'];if(!_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x54')](_0x8c83('0x42'))){_0x1573bc['limit']=qs['limit'](_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x16')]);_0x1573bc['offset']=qs[_0x8c83('0x15')](_0x2c9865['query'][_0x8c83('0x15')]);}return _0x2f0a57[_0x8c83('0x52')](_0x1573bc);}})[_0x8c83('0x19')](function(_0x1f7b9f){if(_0x1f7b9f){return _0x1f7b9f?{'count':_0x724ecf,'rows':_0x1f7b9f}:null;}})['then'](respondWithResult(_0xe7401b,null))['catch'](handleError(_0xe7401b,null));};exports[_0x8c83('0x55')]=function(_0x479a92,_0x28f1cb){var _0x4aae54=_0x479a92['body'][_0x8c83('0x56')];return db[_0x8c83('0x53')]['findAll']({'where':{'id':_0x4aae54},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8c83('0x57'),'attributes':['id',_0x8c83('0x1c'),'online',_0x8c83('0x58'),_0x8c83('0x59')],'raw':!![]}]})[_0x8c83('0x19')](function(_0x27c855){if(_0x27c855){var _0x1e6417=_[_0x8c83('0x5a')](_0x27c855,function(_0x4236f8){var _0x1bdafe=_0x4236f8[_0x8c83('0x34')]({'plain':!![]});return _0x1bdafe[_0x8c83('0x57')];});return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x479a92[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](function(_0x28c917){return db[_0x8c83('0x5b')][_0x8c83('0x5c')](function(_0x556d0a){return _0x28c917[_0x8c83('0x55')](_0x4aae54,{'transaction':_0x556d0a})['then'](function(){return BPromise[_0x8c83('0x5d')](_0x1e6417,function(_0x4c2822){return db[_0x8c83('0x41')][_0x8c83('0x5e')]({'where':{'UserId':_0x4c2822['id'],'FaxQueueId':_0x479a92[_0x8c83('0x27')]['id']},'transaction':_0x556d0a});});})[_0x8c83('0x19')](function(){_0x1e6417[_0x8c83('0x5f')](function(_0x292a0d){socket['emit'](_0x8c83('0x60'),{'UserId':_0x292a0d['id'],'FaxQueueId':_0x28c917['id']});});});});});}})[_0x8c83('0x19')](respondWithStatusCode(_0x28f1cb,null))['catch'](handleError(_0x28f1cb,null));};exports[_0x8c83('0x61')]=function(_0x38cf08,_0x4a8ab1){return db[_0x8c83('0x53')][_0x8c83('0x24')]({'where':{'id':_0x38cf08[_0x8c83('0x2a')][_0x8c83('0x56')]},'attributes':['id'],'include':[{'model':db[_0x8c83('0x62')],'as':_0x8c83('0x57'),'attributes':['id'],'raw':!![]}]})[_0x8c83('0x19')](handleEntityNotFound(_0x4a8ab1,null))['then'](function(_0x3cda43){var _0x33b38d=_[_0x8c83('0x1e')](_0x3cda43,'id');var _0x386b95=[];var _0x3b2b03=[];var _0x1f90fb=squel['select']();_0x1f90fb['field'](_0x8c83('0x63'))[_0x8c83('0x64')](_0x8c83('0x65'),'tq')[_0x8c83('0x66')]('user_has_teams','ut',_0x8c83('0x67'))['where']('FaxQueueId\x20=\x20?',_0x38cf08[_0x8c83('0x27')]['id']);for(var _0x1dc42e=0x0;_0x1dc42e<_0x3cda43[_0x8c83('0x2f')];_0x1dc42e+=0x1){let _0x254957=_0x3cda43[_0x1dc42e];for(var _0x3a2037=0x0;_0x3a2037<_0x254957['Agents'][_0x8c83('0x2f')];_0x3a2037+=0x1){let _0x1201e8=_0x254957['Agents'][_0x3a2037];var _0x5b8aa3=_0x1f90fb[_0x8c83('0x68')]();_0x5b8aa3[_0x8c83('0x22')]('ut.UserId\x20=\x20?',_0x1201e8['id']);_0x3b2b03[_0x8c83('0x69')](db['sequelize'][_0x8c83('0x2a')](_0x5b8aa3[_0x8c83('0x6a')](),{'type':db['sequelize'][_0x8c83('0x6b')][_0x8c83('0x6c')]})['then'](function(_0x303100){if(_0x303100[_0x8c83('0x2f')]===0x1){return _0x1201e8['id'];}else{var _0x114126=_[_0x8c83('0x6d')](_[_0x8c83('0x1e')](_0x303100,'TeamId'),function(_0x4c62ff){return _[_0x8c83('0x6e')](_0x33b38d,_0x4c62ff);});if(_0x114126){return _0x1201e8['id'];}}}));}}return BPromise[_0x8c83('0x6f')](_0x3b2b03)[_0x8c83('0x19')](function(_0x5135fb){_0x386b95=_(_0x386b95)['union'](_0x5135fb)[_0x8c83('0x70')]()[_0x8c83('0x71')]();return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x38cf08['params']['id']}})[_0x8c83('0x19')](function(_0x3cad90){return db[_0x8c83('0x5b')][_0x8c83('0x5c')](function(_0x201c2f){return _0x3cad90['removeTeams'](_0x38cf08['query'][_0x8c83('0x56')],{'transaction':_0x201c2f})[_0x8c83('0x19')](function(){if(!_[_0x8c83('0x72')](_0x386b95)){return _0x3cad90[_0x8c83('0x73')](_0x386b95,{'transaction':_0x201c2f});}})[_0x8c83('0x19')](function(){_0x386b95[_0x8c83('0x5f')](function(_0xe71a0f){socket[_0x8c83('0x74')]('userFaxQueue:remove',{'UserId':_0xe71a0f,'FaxQueueId':_0x3cad90['id']});});});});});});})[_0x8c83('0x19')](respondWithStatusCode(_0x4a8ab1,null))['catch'](handleError(_0x4a8ab1,null));};exports[_0x8c83('0x75')]=function(_0x29c52b,_0x3dbb17){return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x29c52b[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x3dbb17,null))[_0x8c83('0x19')](function(_0x58f7e5){if(_0x58f7e5){return _0x58f7e5[_0x8c83('0x75')](_0x29c52b[_0x8c83('0x3e')][_0x8c83('0x56')],_[_0x8c83('0x76')](_0x29c52b[_0x8c83('0x3e')],[_0x8c83('0x56'),'id'])||{})[_0x8c83('0x77')](function(_0x40c6db){for(var _0x1c095a=0x0;_0x1c095a<_0x29c52b[_0x8c83('0x3e')][_0x8c83('0x56')][_0x8c83('0x2f')];_0x1c095a+=0x1){socket[_0x8c83('0x74')]('userFaxQueue:save',{'UserId':Number(_0x29c52b[_0x8c83('0x3e')][_0x8c83('0x56')][_0x1c095a]),'FaxQueueId':Number(_0x29c52b[_0x8c83('0x27')]['id'])});}return _0x40c6db;});}})[_0x8c83('0x19')](respondWithResult(_0x3dbb17,null))[_0x8c83('0x3c')](handleError(_0x3dbb17,null));};exports[_0x8c83('0x73')]=function(_0x21aa78,_0x24ee37){return db[_0x8c83('0x1f')]['find']({'where':{'id':_0x21aa78['params']['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x24ee37,null))['then'](function(_0x2e7176){if(_0x2e7176){return _0x2e7176[_0x8c83('0x73')](_0x21aa78[_0x8c83('0x2a')][_0x8c83('0x56')])[_0x8c83('0x19')](function(){if(_[_0x8c83('0x78')](_0x21aa78[_0x8c83('0x2a')]['ids'])){for(var _0x55c54b=0x0;_0x55c54b<_0x21aa78[_0x8c83('0x2a')]['ids'][_0x8c83('0x2f')];_0x55c54b+=0x1){socket[_0x8c83('0x74')](_0x8c83('0x79'),{'UserId':Number(_0x21aa78[_0x8c83('0x2a')][_0x8c83('0x56')][_0x55c54b]),'FaxQueueId':Number(_0x21aa78['params']['id'])});}}else{socket[_0x8c83('0x74')](_0x8c83('0x79'),{'UserId':Number(_0x21aa78['query']['ids']),'FaxQueueId':Number(_0x21aa78[_0x8c83('0x27')]['id'])});}});}})[_0x8c83('0x19')](respondWithStatusCode(_0x24ee37,null))['catch'](handleError(_0x24ee37,null));};exports['getAgents']=function(_0x261d38,_0x3ddbfe){var _0x51bd82={};var _0x55be5b={};var _0x4e62bb;var _0x1d3e22;return db[_0x8c83('0x1f')][_0x8c83('0x40')]({'where':{'id':_0x261d38['params']['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x3ddbfe,null))['then'](function(_0x105b62){if(_0x105b62){_0x4e62bb=_0x105b62;_0x55be5b[_0x8c83('0x28')]=_[_0x8c83('0x29')](db[_0x8c83('0x62')][_0x8c83('0x20')]);_0x55be5b[_0x8c83('0x2a')]=_['keys'](_0x261d38[_0x8c83('0x2a')]);_0x55be5b[_0x8c83('0x2b')]=_[_0x8c83('0x2c')](_0x55be5b[_0x8c83('0x28')],_0x55be5b[_0x8c83('0x2a')]);_0x51bd82[_0x8c83('0x2e')]=_[_0x8c83('0x2c')](_0x55be5b['model'],qs['fields'](_0x261d38[_0x8c83('0x2a')][_0x8c83('0x2d')]));_0x51bd82[_0x8c83('0x2e')]=_0x51bd82['attributes'][_0x8c83('0x2f')]?_0x51bd82[_0x8c83('0x2e')]:_0x55be5b[_0x8c83('0x28')];_0x51bd82[_0x8c83('0x43')]=qs[_0x8c83('0x44')](_0x261d38[_0x8c83('0x2a')][_0x8c83('0x44')]);_0x51bd82[_0x8c83('0x22')]=qs['filters'](_['pick'](_0x261d38['query'],_0x55be5b[_0x8c83('0x2b')]));if(_0x261d38['query'][_0x8c83('0x48')]){_0x51bd82[_0x8c83('0x22')]=_[_0x8c83('0x47')](_0x51bd82[_0x8c83('0x22')],{'$or':_[_0x8c83('0x1e')](_0x51bd82['attributes'],function(_0x5975fa){var _0x53c770={};_0x53c770[_0x5975fa]={'$like':'%'+_0x261d38[_0x8c83('0x2a')][_0x8c83('0x48')]+'%'};return _0x53c770;})});}_0x51bd82=_['merge']({},_0x51bd82,_0x261d38[_0x8c83('0x31')]);return _0x4e62bb['getAgents'](_0x51bd82);}})[_0x8c83('0x19')](function(_0x4dd494){if(_0x4dd494){_0x1d3e22=_0x4dd494['length'];if(!_0x261d38[_0x8c83('0x2a')][_0x8c83('0x54')](_0x8c83('0x42'))){_0x51bd82[_0x8c83('0x16')]=qs[_0x8c83('0x16')](_0x261d38['query'][_0x8c83('0x16')]);_0x51bd82[_0x8c83('0x15')]=qs[_0x8c83('0x15')](_0x261d38[_0x8c83('0x2a')][_0x8c83('0x15')]);}return _0x4e62bb[_0x8c83('0x7a')](_0x51bd82);}})[_0x8c83('0x19')](function(_0x1f0379){if(_0x1f0379){return _0x1f0379?{'count':_0x1d3e22,'rows':_0x1f0379}:null;}})[_0x8c83('0x19')](respondWithResult(_0x3ddbfe,null))['catch'](handleError(_0x3ddbfe,null));}; \ No newline at end of file +var _0x9541=['body','describe','getMembers','findOne','UserFaxQueue','nolimit','limit','order','sort','filters','pick','FaxQueueId','filter','User','createdAt','format','%s/%s','SIP','faxPause','updatedAt','getTeams','Team','length','hasOwnProperty','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','emit','userFaxQueue:save','select','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','all','union','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','send','index','map','FaxQueue','rawAttributes','type','key','where','include','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x9541,0xb3));var _0x1954=function(_0x2229cf,_0x29dcc4){_0x2229cf=_0x2229cf-0x0;var _0x4c92f0=_0x9541[_0x2229cf];return _0x4c92f0;};'use strict';var BPromise=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var _=require(_0x1954('0x2'));var squel=require(_0x1954('0x3'));var Redis=require(_0x1954('0x4'));var qs=require(_0x1954('0x5'));var logger=require(_0x1954('0x6'))(_0x1954('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1954('0x8')]=_[_0x1954('0x9')](config['redis'],{'host':_0x1954('0xa'),'port':0x18eb});var socket=require(_0x1954('0xb'))(new Redis(config[_0x1954('0x8')]));require(_0x1954('0xc'))[_0x1954('0xd')](socket);function respondWithStatusCode(_0xa7a784,_0x5d95b1){_0x5d95b1=_0x5d95b1||0xcc;return function(_0x22752d){if(_0x22752d){return _0xa7a784[_0x1954('0xe')](_0x5d95b1);}return _0xa7a784[_0x1954('0xf')](_0x5d95b1)[_0x1954('0x10')]();};}function respondWithResult(_0x40bbfb,_0x1733f8){_0x1733f8=_0x1733f8||0xc8;return function(_0x2f711d){if(_0x2f711d){return _0x40bbfb[_0x1954('0xf')](_0x1733f8)['json'](_0x2f711d);}};}function respondWithFilteredResult(_0x39e5fe,_0x2e1fb4){return function(_0x51a041){if(_0x51a041){var _0x267cfc=typeof _0x2e1fb4['offset']===_0x1954('0x11')&&typeof _0x2e1fb4['limit']==='undefined';var _0x5bfd52=_0x51a041[_0x1954('0x12')];var _0x1b33cb=_0x267cfc?0x0:_0x2e1fb4[_0x1954('0x13')];var _0x520dc7=_0x267cfc?_0x51a041[_0x1954('0x12')]:_0x2e1fb4['offset']+_0x2e1fb4['limit'];var _0xaeb0e3;if(_0x520dc7>=_0x5bfd52){_0x520dc7=_0x5bfd52;_0xaeb0e3=0xc8;}else{_0xaeb0e3=0xce;}_0x39e5fe[_0x1954('0xf')](_0xaeb0e3);return _0x39e5fe[_0x1954('0x14')](_0x1954('0x15'),_0x1b33cb+'-'+_0x520dc7+'/'+_0x5bfd52)[_0x1954('0x16')](_0x51a041);}return null;};}function saveUpdates(_0x37f4fc){return function(_0x166641){if(_0x166641){return _0x166641[_0x1954('0x17')](_0x37f4fc)[_0x1954('0x18')](function(_0xb9c2cd){return _0xb9c2cd;});}return null;};}function removeEntity(_0xc8cb0b){return function(_0x3da757){if(_0x3da757){return _0x3da757[_0x1954('0x19')]()[_0x1954('0x18')](function(){var _0x1db9f1=_0x3da757[_0x1954('0x1a')]({'plain':!![]});var _0x286ff1=_0x1954('0x1b');return db[_0x1954('0x1c')][_0x1954('0x19')]({'where':{'type':_0x286ff1,'resourceId':_0x1db9f1['id']}})['then'](function(){return _0x3da757;});})[_0x1954('0x18')](function(){_0xc8cb0b[_0x1954('0xf')](0xcc)[_0x1954('0x10')]();});}};}function handleEntityNotFound(_0x4455be){return function(_0x193f8f){if(!_0x193f8f){_0x4455be['sendStatus'](0x194);}return _0x193f8f;};}function handleError(_0x61107d,_0x15dd0b){_0x15dd0b=_0x15dd0b||0x1f4;return function(_0x5ea2c3){logger[_0x1954('0x1d')](_0x5ea2c3[_0x1954('0x1e')]);if(_0x5ea2c3['name']){delete _0x5ea2c3['name'];}_0x61107d[_0x1954('0xf')](_0x15dd0b)[_0x1954('0x1f')](_0x5ea2c3);};}exports[_0x1954('0x20')]=function(_0x406699,_0x5c1b19){var _0x21f395={};var _0x26484f={'count':0x0,'rows':[]};var _0x27dc66=_[_0x1954('0x21')](db[_0x1954('0x22')][_0x1954('0x23')],function(_0x46fdc1){return{'name':_0x46fdc1['fieldName'],'type':_0x46fdc1[_0x1954('0x24')][_0x1954('0x25')]};});_0x21f395=qs['getOptions'](_0x27dc66,_0x406699);var _0x14e94e={'where':_0x21f395[_0x1954('0x26')]};return db[_0x1954('0x22')][_0x1954('0x12')](_0x14e94e)[_0x1954('0x18')](function(_0x251386){_0x26484f[_0x1954('0x12')]=_0x251386;_0x21f395[_0x1954('0x27')]=qs[_0x1954('0x27')](_0x406699[_0x1954('0x28')]);return db[_0x1954('0x22')][_0x1954('0x29')](_0x21f395);})[_0x1954('0x18')](function(_0x22509c){_0x26484f[_0x1954('0x2a')]=_0x22509c;return _0x26484f;})[_0x1954('0x18')](respondWithFilteredResult(_0x5c1b19,_0x21f395))[_0x1954('0x2b')](handleError(_0x5c1b19,null));};exports[_0x1954('0x2c')]=function(_0x109312,_0x24032d){var _0x1bcf3a={'raw':!![],'where':{'id':_0x109312[_0x1954('0x2d')]['id']}},_0x2fe88d={};_0x2fe88d[_0x1954('0x2e')]=_['keys'](db['FaxQueue'][_0x1954('0x23')]);_0x2fe88d['query']=_[_0x1954('0x2f')](_0x109312[_0x1954('0x28')]);_0x2fe88d['filters']=_[_0x1954('0x30')](_0x2fe88d[_0x1954('0x2e')],_0x2fe88d['query']);_0x1bcf3a['attributes']=_[_0x1954('0x30')](_0x2fe88d[_0x1954('0x2e')],qs[_0x1954('0x31')](_0x109312[_0x1954('0x28')][_0x1954('0x31')]));_0x1bcf3a[_0x1954('0x32')]=_0x1bcf3a[_0x1954('0x32')]['length']?_0x1bcf3a['attributes']:_0x2fe88d[_0x1954('0x2e')];if(_0x109312[_0x1954('0x28')][_0x1954('0x33')]){_0x1bcf3a[_0x1954('0x27')]=[{'all':!![]}];}_0x1bcf3a=_[_0x1954('0x34')]({},_0x1bcf3a,_0x109312[_0x1954('0x35')]);return db['FaxQueue'][_0x1954('0x36')](_0x1bcf3a)[_0x1954('0x18')](handleEntityNotFound(_0x24032d,null))['then'](respondWithResult(_0x24032d,null))[_0x1954('0x2b')](handleError(_0x24032d,null));};exports[_0x1954('0x37')]=function(_0x524eeb,_0x580990){return db[_0x1954('0x22')][_0x1954('0x37')](_0x524eeb['body'],{})[_0x1954('0x18')](function(_0x341681){var _0x13725c=_0x524eeb[_0x1954('0x38')]['get']({'plain':!![]});if(!_0x13725c)throw new Error(_0x1954('0x39'));if(_0x13725c['role']===_0x1954('0x38')){var _0x3c3e3f=_0x341681[_0x1954('0x1a')]({'plain':!![]});var _0x57812c=_0x1954('0x1b');return db[_0x1954('0x3a')][_0x1954('0x36')]({'where':{'name':_0x57812c,'userProfileId':_0x13725c[_0x1954('0x3b')]},'raw':!![]})[_0x1954('0x18')](function(_0x517492){if(_0x517492&&_0x517492[_0x1954('0x3c')]===0x0){return db['UserProfileResource'][_0x1954('0x37')]({'name':_0x3c3e3f['name'],'resourceId':_0x3c3e3f['id'],'type':_0x517492[_0x1954('0x3d')],'sectionId':_0x517492['id']},{})[_0x1954('0x18')](function(){return _0x341681;});}else{return _0x341681;}})[_0x1954('0x2b')](function(_0x4334f9){logger['error'](_0x1954('0x3e'),_0x4334f9);throw _0x4334f9;});}return _0x341681;})['then'](respondWithResult(_0x580990,0xc9))[_0x1954('0x2b')](handleError(_0x580990,null));};exports[_0x1954('0x17')]=function(_0x59c4cb,_0x1dede8){if(_0x59c4cb[_0x1954('0x3f')]['id']){delete _0x59c4cb[_0x1954('0x3f')]['id'];}return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x59c4cb[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x1dede8,null))[_0x1954('0x18')](saveUpdates(_0x59c4cb[_0x1954('0x3f')],null))['then'](respondWithResult(_0x1dede8,null))['catch'](handleError(_0x1dede8,null));};exports['destroy']=function(_0x259a45,_0x55f465){return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x259a45[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x55f465,null))[_0x1954('0x18')](removeEntity(_0x55f465,null))[_0x1954('0x2b')](handleError(_0x55f465,null));};exports[_0x1954('0x40')]=function(_0x439862,_0x15243c){return db['FaxQueue']['describe']()[_0x1954('0x18')](respondWithResult(_0x15243c,null))['catch'](handleError(_0x15243c,null));};exports[_0x1954('0x41')]=function(_0x4e0359,_0x109b3e){var _0x8aeb7={'raw':!![],'where':{}},_0x231c42={},_0x3ab299;return db[_0x1954('0x22')][_0x1954('0x42')]({'where':{'id':_0x4e0359[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x109b3e,null))[_0x1954('0x18')](function(_0x2dd24d){if(_0x2dd24d){_0x3ab299=_0x2dd24d['get']({'plain':!![]});_0x231c42[_0x1954('0x2e')]=_[_0x1954('0x2f')](db[_0x1954('0x43')][_0x1954('0x23')]);_0x231c42['query']=_[_0x1954('0x2f')](_0x4e0359[_0x1954('0x28')]);_0x231c42['filters']=_[_0x1954('0x30')](_0x231c42['model'],_0x231c42[_0x1954('0x28')]);_0x8aeb7[_0x1954('0x32')]=_[_0x1954('0x30')](_0x231c42[_0x1954('0x2e')],qs[_0x1954('0x31')](_0x4e0359[_0x1954('0x28')][_0x1954('0x31')]));_0x8aeb7['attributes']=_0x8aeb7[_0x1954('0x32')]['length']?_0x8aeb7[_0x1954('0x32')]:_0x231c42[_0x1954('0x2e')];if(!_0x4e0359[_0x1954('0x28')]['hasOwnProperty'](_0x1954('0x44'))){_0x8aeb7[_0x1954('0x45')]=qs[_0x1954('0x45')](_0x4e0359[_0x1954('0x28')][_0x1954('0x45')]);_0x8aeb7['offset']=qs[_0x1954('0x13')](_0x4e0359[_0x1954('0x28')][_0x1954('0x13')]);}_0x8aeb7[_0x1954('0x46')]=qs[_0x1954('0x47')](_0x4e0359['query'][_0x1954('0x47')]);_0x8aeb7[_0x1954('0x26')]=qs[_0x1954('0x48')](_[_0x1954('0x49')](_0x4e0359[_0x1954('0x28')],_0x231c42[_0x1954('0x48')]));_0x8aeb7[_0x1954('0x26')][_0x1954('0x4a')]=_0x2dd24d['id'];if(_0x4e0359[_0x1954('0x28')]['filter']){_0x8aeb7[_0x1954('0x26')]=_[_0x1954('0x34')](_0x8aeb7[_0x1954('0x26')],{'$or':_[_0x1954('0x21')](_0x8aeb7[_0x1954('0x32')],function(_0x2e2943){var _0x1fa09b={};_0x1fa09b[_0x2e2943]={'$like':'%'+_0x4e0359[_0x1954('0x28')][_0x1954('0x4b')]+'%'};return _0x1fa09b;})});}_0x8aeb7=_[_0x1954('0x34')]({},_0x8aeb7,_0x4e0359[_0x1954('0x35')]);return db[_0x1954('0x43')][_0x1954('0x29')](_0x8aeb7);}})[_0x1954('0x18')](function(_0x1ad607){if(_0x1ad607){return db[_0x1954('0x4c')]['findAndCountAll']({'where':{'id':_['map'](_0x1ad607,'UserId'),'role':'agent'},'attributes':['id',_0x1954('0x3d'),'faxPause','updatedAt',_0x1954('0x4d')]});}})[_0x1954('0x18')](function(_0x989a6d){if(_0x989a6d){return{'count':_0x989a6d[_0x1954('0x12')],'rows':_[_0x1954('0x21')](_0x989a6d['rows'],function(_0x4a900c){return{'membername':_0x4a900c[_0x1954('0x3d')],'UserId':_0x4a900c['id'],'queue_name':_0x3ab299[_0x1954('0x3d')],'FaxQueueId':_0x3ab299['id'],'interface':util[_0x1954('0x4e')](_0x1954('0x4f'),_0x1954('0x50'),_0x4a900c[_0x1954('0x3d')]),'penalty':0x0,'paused':_0x4a900c[_0x1954('0x51')],'createdAt':_0x4a900c[_0x1954('0x4d')],'updatedAt':_0x4a900c[_0x1954('0x52')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x109b3e,_0x8aeb7))[_0x1954('0x2b')](handleError(_0x109b3e,null));};exports[_0x1954('0x53')]=function(_0xae43df,_0x4e6a10){var _0x2480d2={};var _0x28bca8={};var _0x2d0777;var _0x4ad813;return db[_0x1954('0x22')]['findOne']({'where':{'id':_0xae43df[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x4e6a10,null))[_0x1954('0x18')](function(_0xb7601d){if(_0xb7601d){_0x2d0777=_0xb7601d;_0x28bca8[_0x1954('0x2e')]=_[_0x1954('0x2f')](db[_0x1954('0x54')][_0x1954('0x23')]);_0x28bca8[_0x1954('0x28')]=_['keys'](_0xae43df[_0x1954('0x28')]);_0x28bca8[_0x1954('0x48')]=_['intersection'](_0x28bca8[_0x1954('0x2e')],_0x28bca8[_0x1954('0x28')]);_0x2480d2[_0x1954('0x32')]=_[_0x1954('0x30')](_0x28bca8['model'],qs[_0x1954('0x31')](_0xae43df[_0x1954('0x28')][_0x1954('0x31')]));_0x2480d2[_0x1954('0x32')]=_0x2480d2[_0x1954('0x32')][_0x1954('0x55')]?_0x2480d2[_0x1954('0x32')]:_0x28bca8[_0x1954('0x2e')];_0x2480d2['order']=qs['sort'](_0xae43df[_0x1954('0x28')]['sort']);_0x2480d2[_0x1954('0x26')]=qs['filters'](_[_0x1954('0x49')](_0xae43df[_0x1954('0x28')],_0x28bca8[_0x1954('0x48')]));if(_0xae43df['query'][_0x1954('0x4b')]){_0x2480d2[_0x1954('0x26')]=_[_0x1954('0x34')](_0x2480d2['where'],{'$or':_['map'](_0x2480d2[_0x1954('0x32')],function(_0x30b981){var _0x466758={};_0x466758[_0x30b981]={'$like':'%'+_0xae43df[_0x1954('0x28')]['filter']+'%'};return _0x466758;})});}_0x2480d2=_[_0x1954('0x34')]({},_0x2480d2,_0xae43df['options']);return _0x2d0777['getTeams'](_0x2480d2);}})['then'](function(_0x3b7520){if(_0x3b7520){_0x4ad813=_0x3b7520[_0x1954('0x55')];if(!_0xae43df[_0x1954('0x28')][_0x1954('0x56')]('nolimit')){_0x2480d2[_0x1954('0x45')]=qs[_0x1954('0x45')](_0xae43df['query'][_0x1954('0x45')]);_0x2480d2[_0x1954('0x13')]=qs[_0x1954('0x13')](_0xae43df[_0x1954('0x28')][_0x1954('0x13')]);}return _0x2d0777['getTeams'](_0x2480d2);}})[_0x1954('0x18')](function(_0x22f6d3){if(_0x22f6d3){return _0x22f6d3?{'count':_0x4ad813,'rows':_0x22f6d3}:null;}})['then'](respondWithResult(_0x4e6a10,null))['catch'](handleError(_0x4e6a10,null));};exports[_0x1954('0x57')]=function(_0x3d2f01,_0x565769){var _0x126ca6=_0x3d2f01[_0x1954('0x3f')][_0x1954('0x58')];return db['Team'][_0x1954('0x29')]({'where':{'id':_0x126ca6},'attributes':['id'],'include':[{'model':db[_0x1954('0x4c')],'as':_0x1954('0x59'),'attributes':['id',_0x1954('0x3d'),_0x1954('0x5a'),_0x1954('0x5b'),'interface'],'raw':!![]}]})[_0x1954('0x18')](function(_0x1bfc1d){if(_0x1bfc1d){var _0x38ef05=_[_0x1954('0x5c')](_0x1bfc1d,function(_0x23c24f){var _0x3ad0d9=_0x23c24f[_0x1954('0x1a')]({'plain':!![]});return _0x3ad0d9[_0x1954('0x59')];});return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x3d2f01[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](function(_0x1e8879){return db[_0x1954('0x5d')][_0x1954('0x5e')](function(_0x3479ef){return _0x1e8879['addTeams'](_0x126ca6,{'transaction':_0x3479ef})['then'](function(){return BPromise[_0x1954('0x5f')](_0x38ef05,function(_0x183efe){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x183efe['id'],'FaxQueueId':_0x3d2f01[_0x1954('0x2d')]['id']},'transaction':_0x3479ef});});})[_0x1954('0x18')](function(){_0x38ef05['forEach'](function(_0xa82f38){socket[_0x1954('0x60')](_0x1954('0x61'),{'UserId':_0xa82f38['id'],'FaxQueueId':_0x1e8879['id']});});});});});}})['then'](respondWithStatusCode(_0x565769,null))['catch'](handleError(_0x565769,null));};exports['removeTeams']=function(_0x5c206f,_0x364c64){return db[_0x1954('0x54')][_0x1954('0x29')]({'where':{'id':_0x5c206f[_0x1954('0x28')][_0x1954('0x58')]},'attributes':['id'],'include':[{'model':db[_0x1954('0x4c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1954('0x18')](handleEntityNotFound(_0x364c64,null))[_0x1954('0x18')](function(_0x38a188){var _0x2d04a0=_['map'](_0x38a188,'id');var _0x16c259=[];var _0x28c0a2=[];var _0x1a7cc7=squel[_0x1954('0x62')]();_0x1a7cc7[_0x1954('0x63')]('tq.TeamId')['from'](_0x1954('0x64'),'tq')[_0x1954('0x65')](_0x1954('0x66'),'ut',_0x1954('0x67'))[_0x1954('0x26')](_0x1954('0x68'),_0x5c206f[_0x1954('0x2d')]['id']);for(var _0x2b1453=0x0;_0x2b1453<_0x38a188[_0x1954('0x55')];_0x2b1453+=0x1){let _0x18553e=_0x38a188[_0x2b1453];for(var _0x2bd8ba=0x0;_0x2bd8ba<_0x18553e[_0x1954('0x59')][_0x1954('0x55')];_0x2bd8ba+=0x1){let _0x3985f5=_0x18553e[_0x1954('0x59')][_0x2bd8ba];var _0x340738=_0x1a7cc7[_0x1954('0x69')]();_0x340738[_0x1954('0x26')](_0x1954('0x6a'),_0x3985f5['id']);_0x28c0a2[_0x1954('0x6b')](db[_0x1954('0x5d')][_0x1954('0x28')](_0x340738[_0x1954('0x6c')](),{'type':db[_0x1954('0x5d')]['QueryTypes']['SELECT']})[_0x1954('0x18')](function(_0x2ac068){if(_0x2ac068['length']===0x1){return _0x3985f5['id'];}else{var _0x38cf87=_[_0x1954('0x6d')](_['map'](_0x2ac068,'TeamId'),function(_0x4ade20){return _['includes'](_0x2d04a0,_0x4ade20);});if(_0x38cf87){return _0x3985f5['id'];}}}));}}return BPromise[_0x1954('0x6e')](_0x28c0a2)[_0x1954('0x18')](function(_0x95a2fb){_0x16c259=_(_0x16c259)[_0x1954('0x6f')](_0x95a2fb)['compact']()['value']();return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x5c206f['params']['id']}})[_0x1954('0x18')](function(_0x25c2f5){return db[_0x1954('0x5d')][_0x1954('0x5e')](function(_0x15be76){return _0x25c2f5[_0x1954('0x70')](_0x5c206f[_0x1954('0x28')][_0x1954('0x58')],{'transaction':_0x15be76})['then'](function(){if(!_[_0x1954('0x71')](_0x16c259)){return _0x25c2f5['removeAgents'](_0x16c259,{'transaction':_0x15be76});}})[_0x1954('0x18')](function(){_0x16c259['forEach'](function(_0x174104){socket['emit'](_0x1954('0x72'),{'UserId':_0x174104,'FaxQueueId':_0x25c2f5['id']});});});});});});})['then'](respondWithStatusCode(_0x364c64,null))[_0x1954('0x2b')](handleError(_0x364c64,null));};exports['addAgents']=function(_0x5161ff,_0x15c502){return db['FaxQueue'][_0x1954('0x36')]({'where':{'id':_0x5161ff['params']['id']}})['then'](handleEntityNotFound(_0x15c502,null))[_0x1954('0x18')](function(_0x456d83){if(_0x456d83){return _0x456d83[_0x1954('0x73')](_0x5161ff[_0x1954('0x3f')][_0x1954('0x58')],_[_0x1954('0x74')](_0x5161ff[_0x1954('0x3f')],['ids','id'])||{})[_0x1954('0x75')](function(_0xf82bfb){for(var _0x16ab2b=0x0;_0x16ab2b<_0x5161ff[_0x1954('0x3f')][_0x1954('0x58')][_0x1954('0x55')];_0x16ab2b+=0x1){socket[_0x1954('0x60')](_0x1954('0x61'),{'UserId':Number(_0x5161ff['body'][_0x1954('0x58')][_0x16ab2b]),'FaxQueueId':Number(_0x5161ff[_0x1954('0x2d')]['id'])});}return _0xf82bfb;});}})['then'](respondWithResult(_0x15c502,null))[_0x1954('0x2b')](handleError(_0x15c502,null));};exports[_0x1954('0x76')]=function(_0x284a27,_0x4b9697){return db[_0x1954('0x22')][_0x1954('0x36')]({'where':{'id':_0x284a27[_0x1954('0x2d')]['id']}})[_0x1954('0x18')](handleEntityNotFound(_0x4b9697,null))['then'](function(_0x19f88c){if(_0x19f88c){return _0x19f88c[_0x1954('0x76')](_0x284a27[_0x1954('0x28')][_0x1954('0x58')])['then'](function(){if(_[_0x1954('0x77')](_0x284a27['query'][_0x1954('0x58')])){for(var _0x17b9e1=0x0;_0x17b9e1<_0x284a27[_0x1954('0x28')]['ids'][_0x1954('0x55')];_0x17b9e1+=0x1){socket[_0x1954('0x60')]('userFaxQueue:remove',{'UserId':Number(_0x284a27[_0x1954('0x28')][_0x1954('0x58')][_0x17b9e1]),'FaxQueueId':Number(_0x284a27[_0x1954('0x2d')]['id'])});}}else{socket[_0x1954('0x60')](_0x1954('0x72'),{'UserId':Number(_0x284a27['query']['ids']),'FaxQueueId':Number(_0x284a27[_0x1954('0x2d')]['id'])});}});}})[_0x1954('0x18')](respondWithStatusCode(_0x4b9697,null))[_0x1954('0x2b')](handleError(_0x4b9697,null));};exports[_0x1954('0x78')]=function(_0x51503f,_0x2d4258){var _0x4a2752={};var _0x9f2f79={};var _0x36ae1b;var _0x44e09e;return db['FaxQueue'][_0x1954('0x42')]({'where':{'id':_0x51503f[_0x1954('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2d4258,null))[_0x1954('0x18')](function(_0x14418b){if(_0x14418b){_0x36ae1b=_0x14418b;_0x9f2f79[_0x1954('0x2e')]=_[_0x1954('0x2f')](db[_0x1954('0x4c')][_0x1954('0x23')]);_0x9f2f79[_0x1954('0x28')]=_[_0x1954('0x2f')](_0x51503f[_0x1954('0x28')]);_0x9f2f79['filters']=_[_0x1954('0x30')](_0x9f2f79[_0x1954('0x2e')],_0x9f2f79[_0x1954('0x28')]);_0x4a2752[_0x1954('0x32')]=_[_0x1954('0x30')](_0x9f2f79[_0x1954('0x2e')],qs[_0x1954('0x31')](_0x51503f[_0x1954('0x28')][_0x1954('0x31')]));_0x4a2752['attributes']=_0x4a2752[_0x1954('0x32')][_0x1954('0x55')]?_0x4a2752[_0x1954('0x32')]:_0x9f2f79[_0x1954('0x2e')];_0x4a2752['order']=qs[_0x1954('0x47')](_0x51503f['query'][_0x1954('0x47')]);_0x4a2752[_0x1954('0x26')]=qs[_0x1954('0x48')](_[_0x1954('0x49')](_0x51503f[_0x1954('0x28')],_0x9f2f79[_0x1954('0x48')]));if(_0x51503f['query']['filter']){_0x4a2752[_0x1954('0x26')]=_[_0x1954('0x34')](_0x4a2752[_0x1954('0x26')],{'$or':_[_0x1954('0x21')](_0x4a2752['attributes'],function(_0x8a2d29){var _0x155d00={};_0x155d00[_0x8a2d29]={'$like':'%'+_0x51503f[_0x1954('0x28')]['filter']+'%'};return _0x155d00;})});}_0x4a2752=_[_0x1954('0x34')]({},_0x4a2752,_0x51503f[_0x1954('0x35')]);return _0x36ae1b[_0x1954('0x78')](_0x4a2752);}})['then'](function(_0x2e88f5){if(_0x2e88f5){_0x44e09e=_0x2e88f5['length'];if(!_0x51503f['query']['hasOwnProperty'](_0x1954('0x44'))){_0x4a2752[_0x1954('0x45')]=qs['limit'](_0x51503f[_0x1954('0x28')][_0x1954('0x45')]);_0x4a2752[_0x1954('0x13')]=qs[_0x1954('0x13')](_0x51503f[_0x1954('0x28')]['offset']);}return _0x36ae1b['getAgents'](_0x4a2752);}})[_0x1954('0x18')](function(_0x5990a1){if(_0x5990a1){return _0x5990a1?{'count':_0x44e09e,'rows':_0x5990a1}:null;}})[_0x1954('0x18')](respondWithResult(_0x2d4258,null))[_0x1954('0x2b')](handleError(_0x2d4258,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 991b3db..d19e08c 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 _0x0948=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','save','update'];(function(_0x498745,_0x377c24){var _0x471c0b=function(_0x13a979){while(--_0x13a979){_0x498745['push'](_0x498745['shift']());}};_0x471c0b(++_0x377c24);}(_0x0948,0x1eb));var _0x8094=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x0948[_0x386525];return _0x14d015;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x8094('0x0'))['db'][_0x8094('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8094('0x2'),'afterUpdate':_0x8094('0x3'),'afterDestroy':_0x8094('0x4')};function emitEvent(_0x2fa75b){return function(_0x214d2b,_0xc13ef7,_0x2495a7){FaxQueueEvents['emit'](_0x2fa75b+':'+_0x214d2b['id'],_0x214d2b);FaxQueueEvents[_0x8094('0x5')](_0x2fa75b,_0x214d2b);_0x2495a7(null);};}for(var e in events){if(events[_0x8094('0x6')](e)){var event=events[e];FaxQueue[_0x8094('0x7')](e,emitEvent(event));}}module[_0x8094('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x4a68=['../../mysqldb','FaxQueue','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x5238e0,_0x136900){var _0x29db3f=function(_0x4b724f){while(--_0x4b724f){_0x5238e0['push'](_0x5238e0['shift']());}};_0x29db3f(++_0x136900);}(_0x4a68,0x138));var _0x84a6=function(_0x24d916,_0x1c3c78){_0x24d916=_0x24d916-0x0;var _0x56a31f=_0x4a68[_0x24d916];return _0x56a31f;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x84a6('0x0'))['db'][_0x84a6('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84a6('0x2'),'afterUpdate':_0x84a6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x130c54){return function(_0x31c20a,_0x201b85,_0x2cec2d){FaxQueueEvents[_0x84a6('0x4')](_0x130c54+':'+_0x31c20a['id'],_0x31c20a);FaxQueueEvents[_0x84a6('0x4')](_0x130c54,_0x31c20a);_0x2cec2d(null);};}for(var e in events){if(events[_0x84a6('0x5')](e)){var event=events[e];FaxQueue[_0x84a6('0x6')](e,emitEvent(event));}}module[_0x84a6('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 85c356b..3c9d3a8 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 _0x5a32=['util','api','bluebird','path','rimraf','exports','FaxQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a32,0xc4));var _0x25a3=function(_0x928c8,_0x54f145){_0x928c8=_0x928c8-0x0;var _0x29c44e=_0x5a32[_0x928c8];return _0x29c44e;};'use strict';var _=require('lodash');var util=require(_0x25a3('0x0'));var logger=require('../../config/logger')(_0x25a3('0x1'));var moment=require('moment');var BPromise=require(_0x25a3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25a3('0x3'));var rimraf=require(_0x25a3('0x4'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x25a3('0x5')]=function(_0x351a53,_0x1b749b){return _0x351a53['define'](_0x25a3('0x6'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x51a7=['exports','define','fax_queues','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x33df9d,_0x2adf1e){var _0x4d8653=function(_0x6d3b1c){while(--_0x6d3b1c){_0x33df9d['push'](_0x33df9d['shift']());}};_0x4d8653(++_0x2adf1e);}(_0x51a7,0xf3));var _0x751a=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x51a7[_0x425716];return _0x2d39af;};'use strict';var _=require(_0x751a('0x0'));var util=require(_0x751a('0x1'));var logger=require(_0x751a('0x2'))('api');var moment=require(_0x751a('0x3'));var BPromise=require(_0x751a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x751a('0x5'));var config=require(_0x751a('0x6'));var attributes=require('./faxQueue.attributes');module[_0x751a('0x7')]=function(_0x414112,_0xfe209b){return _0x414112[_0x751a('0x8')]('FaxQueue',attributes,{'tableName':_0x751a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 762e7e6..686a6a2 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 _0x2bac=['options','where','include','model','attributes','map','then','GetFaxQueue','ShowFaxQueue','find','raw','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxQueue.socket','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll'];(function(_0x5b6744,_0x49c9c2){var _0x43d97a=function(_0x55633e){while(--_0x55633e){_0x5b6744['push'](_0x5b6744['shift']());}};_0x43d97a(++_0x49c9c2);}(_0x2bac,0x1d4));var _0xc2ba=function(_0x297818,_0x5f4d36){_0x297818=_0x297818-0x0;var _0x469ee3=_0x2bac[_0x297818];return _0x469ee3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc2ba('0x0'));var BPromise=require(_0xc2ba('0x1'));var rs=require(_0xc2ba('0x2'));var fs=require('fs');var Redis=require(_0xc2ba('0x3'));var db=require(_0xc2ba('0x4'))['db'];var utils=require(_0xc2ba('0x5'));var logger=require(_0xc2ba('0x6'))(_0xc2ba('0x7'));var config=require(_0xc2ba('0x8'));var jayson=require(_0xc2ba('0x9'));var client=jayson[_0xc2ba('0xa')]['http']({'port':0x232a});config[_0xc2ba('0xb')]=_['defaults'](config[_0xc2ba('0xb')],{'host':_0xc2ba('0xc'),'port':0x18eb});var socket=require(_0xc2ba('0xd'))(new Redis(config[_0xc2ba('0xb')]));require(_0xc2ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x5dbbc8,_0x315327,_0x444081){return new BPromise(function(_0x5f37fb,_0x3d933a){return client['request'](_0x5dbbc8,_0x444081)['then'](function(_0x46a9e9){logger['info'](_0xc2ba('0xf'),_0x315327,_0xc2ba('0x10'));logger[_0xc2ba('0x11')](_0xc2ba('0x12'),_0x315327,_0xc2ba('0x10'),JSON[_0xc2ba('0x13')](_0x46a9e9));if(_0x46a9e9[_0xc2ba('0x14')]){if(_0x46a9e9[_0xc2ba('0x14')][_0xc2ba('0x15')]===0x1f4){logger[_0xc2ba('0x14')](_0xc2ba('0xf'),_0x315327,_0x46a9e9[_0xc2ba('0x14')][_0xc2ba('0x16')]);return _0x3d933a(_0x46a9e9['error'][_0xc2ba('0x16')]);}logger[_0xc2ba('0x14')](_0xc2ba('0xf'),_0x315327,_0x46a9e9[_0xc2ba('0x14')][_0xc2ba('0x16')]);return _0x5f37fb(_0x46a9e9['error'][_0xc2ba('0x16')]);}else{logger[_0xc2ba('0x17')](_0xc2ba('0xf'),_0x315327,_0xc2ba('0x10'));_0x5f37fb(_0x46a9e9[_0xc2ba('0x18')][_0xc2ba('0x16')]);}})['catch'](function(_0x3f8bdf){logger['error'](_0xc2ba('0xf'),_0x315327,_0x3f8bdf);_0x3d933a(_0x3f8bdf);});});}exports['GetFaxQueue']=function(_0x18e776){var _0x5540bb=this;return new Promise(function(_0x30534a,_0x31e168){return db['FaxQueue'][_0xc2ba('0x19')]({'raw':_0x18e776[_0xc2ba('0x1a')]?_0x18e776[_0xc2ba('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x18e776['options']?_0x18e776[_0xc2ba('0x1a')][_0xc2ba('0x1b')]||null:null,'attributes':_0x18e776['options']?_0x18e776[_0xc2ba('0x1a')]['attributes']||null:null,'limit':_0x18e776['options']?_0x18e776[_0xc2ba('0x1a')]['limit']||null:null,'include':_0x18e776['options']?_0x18e776[_0xc2ba('0x1a')]['include']?_['map'](_0x18e776[_0xc2ba('0x1a')][_0xc2ba('0x1c')],function(_0x2de2c0){return{'model':db[_0x2de2c0[_0xc2ba('0x1d')]],'as':_0x2de2c0['as'],'attributes':_0x2de2c0['attributes'],'include':_0x2de2c0[_0xc2ba('0x1c')]?_['map'](_0x2de2c0[_0xc2ba('0x1c')],function(_0x237a87){return{'model':db[_0x237a87[_0xc2ba('0x1d')]],'as':_0x237a87['as'],'attributes':_0x237a87[_0xc2ba('0x1e')],'include':_0x237a87[_0xc2ba('0x1c')]?_[_0xc2ba('0x1f')](_0x237a87[_0xc2ba('0x1c')],function(_0x5472ff){return{'model':db[_0x5472ff[_0xc2ba('0x1d')]],'as':_0x5472ff['as'],'attributes':_0x5472ff[_0xc2ba('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc2ba('0x20')](function(_0x2407d0){logger[_0xc2ba('0x17')](_0xc2ba('0x21'),_0x18e776);logger[_0xc2ba('0x11')](_0xc2ba('0x21'),_0x18e776,JSON[_0xc2ba('0x13')](_0x2407d0));_0x30534a(_0x2407d0);})['catch'](function(_0x26eae2){logger[_0xc2ba('0x14')](_0xc2ba('0x21'),_0x26eae2[_0xc2ba('0x16')],_0x18e776);_0x31e168(_0x5540bb[_0xc2ba('0x14')](0x1f4,_0x26eae2[_0xc2ba('0x16')]));});});};exports[_0xc2ba('0x22')]=function(_0x29bf8a){var _0x5704ea=this;return new Promise(function(_0xc97d8d,_0xc3bcdf){return db['FaxQueue'][_0xc2ba('0x23')]({'raw':_0x29bf8a['options']?_0x29bf8a[_0xc2ba('0x1a')][_0xc2ba('0x24')]===undefined?!![]:![]:!![],'where':_0x29bf8a[_0xc2ba('0x1a')]?_0x29bf8a[_0xc2ba('0x1a')][_0xc2ba('0x1b')]||null:null,'attributes':_0x29bf8a['options']?_0x29bf8a[_0xc2ba('0x1a')][_0xc2ba('0x1e')]||null:null,'include':_0x29bf8a['options']?_0x29bf8a[_0xc2ba('0x1a')][_0xc2ba('0x1c')]?_[_0xc2ba('0x1f')](_0x29bf8a['options'][_0xc2ba('0x1c')],function(_0x2a02a9){return{'model':db[_0x2a02a9[_0xc2ba('0x1d')]],'as':_0x2a02a9['as'],'attributes':_0x2a02a9['attributes'],'include':_0x2a02a9['include']?_[_0xc2ba('0x1f')](_0x2a02a9[_0xc2ba('0x1c')],function(_0x111320){return{'model':db[_0x111320[_0xc2ba('0x1d')]],'as':_0x111320['as'],'attributes':_0x111320['attributes'],'include':_0x111320[_0xc2ba('0x1c')]?_['map'](_0x111320['include'],function(_0xdbd3d3){return{'model':db[_0xdbd3d3['model']],'as':_0xdbd3d3['as'],'attributes':_0xdbd3d3[_0xc2ba('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc2ba('0x20')](function(_0x2c7602){logger[_0xc2ba('0x17')](_0xc2ba('0x22'),_0x29bf8a);logger[_0xc2ba('0x11')]('ShowFaxQueue',_0x29bf8a,JSON[_0xc2ba('0x13')](_0x2c7602));_0xc97d8d(_0x2c7602);})[_0xc2ba('0x25')](function(_0x367c26){logger[_0xc2ba('0x14')](_0xc2ba('0x22'),_0x367c26[_0xc2ba('0x16')],_0x29bf8a);_0xc3bcdf(_0x5704ea['error'](0x1f4,_0x367c26['message']));});});}; \ No newline at end of file +var _0xba5e=['rpc','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x151231,_0x308fd9){var _0x5c0366=function(_0x5d0ccc){while(--_0x5d0ccc){_0x151231['push'](_0x151231['shift']());}};_0x5c0366(++_0x308fd9);}(_0xba5e,0xe9));var _0xeba5=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xba5e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xeba5('0x0'));var util=require(_0xeba5('0x1'));var moment=require('moment');var BPromise=require(_0xeba5('0x2'));var rs=require(_0xeba5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeba5('0x4'))['db'];var utils=require(_0xeba5('0x5'));var logger=require(_0xeba5('0x6'))(_0xeba5('0x7'));var config=require('../../config/environment');var jayson=require(_0xeba5('0x8'));var client=jayson[_0xeba5('0x9')][_0xeba5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeba5('0xb')],{'host':_0xeba5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeba5('0xb')]));require(_0xeba5('0xd'))[_0xeba5('0xe')](socket);function respondWithRpcPromise(_0x4872c7,_0x1f9ec1,_0x3e4481){return new BPromise(function(_0x433f3c,_0x3cd671){return client[_0xeba5('0xf')](_0x4872c7,_0x3e4481)['then'](function(_0x1ddbf9){logger[_0xeba5('0x10')](_0xeba5('0x11'),_0x1f9ec1,_0xeba5('0x12'));logger[_0xeba5('0x13')](_0xeba5('0x14'),_0x1f9ec1,_0xeba5('0x12'),JSON[_0xeba5('0x15')](_0x1ddbf9));if(_0x1ddbf9['error']){if(_0x1ddbf9[_0xeba5('0x16')][_0xeba5('0x17')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x1f9ec1,_0x1ddbf9['error'][_0xeba5('0x18')]);return _0x3cd671(_0x1ddbf9[_0xeba5('0x16')][_0xeba5('0x18')]);}logger[_0xeba5('0x16')](_0xeba5('0x11'),_0x1f9ec1,_0x1ddbf9['error']['message']);return _0x433f3c(_0x1ddbf9[_0xeba5('0x16')]['message']);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x1f9ec1,_0xeba5('0x12'));_0x433f3c(_0x1ddbf9[_0xeba5('0x19')]['message']);}})[_0xeba5('0x1a')](function(_0x2de4f7){logger[_0xeba5('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1f9ec1,_0x2de4f7);_0x3cd671(_0x2de4f7);});});}exports[_0xeba5('0x1b')]=function(_0x1cab08){var _0x73e6ef=this;return new Promise(function(_0x356ff9,_0x533e6c){return db[_0xeba5('0x1c')]['findAll']({'raw':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cab08['options']?_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x1f')]||null:null,'attributes':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x20')]||null:null,'limit':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08['options'][_0xeba5('0x21')]||null:null,'include':_0x1cab08[_0xeba5('0x1d')]?_0x1cab08['options'][_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x1cab08[_0xeba5('0x1d')][_0xeba5('0x22')],function(_0x44d836){return{'model':db[_0x44d836[_0xeba5('0x24')]],'as':_0x44d836['as'],'attributes':_0x44d836[_0xeba5('0x20')],'include':_0x44d836[_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x44d836[_0xeba5('0x22')],function(_0x53a5dd){return{'model':db[_0x53a5dd[_0xeba5('0x24')]],'as':_0x53a5dd['as'],'attributes':_0x53a5dd['attributes'],'include':_0x53a5dd[_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x53a5dd['include'],function(_0x31ad43){return{'model':db[_0x31ad43[_0xeba5('0x24')]],'as':_0x31ad43['as'],'attributes':_0x31ad43[_0xeba5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10cb73){logger[_0xeba5('0x10')]('GetFaxQueue',_0x1cab08);logger[_0xeba5('0x13')]('GetFaxQueue',_0x1cab08,JSON[_0xeba5('0x15')](_0x10cb73));_0x356ff9(_0x10cb73);})['catch'](function(_0x1fe1f5){logger['error'](_0xeba5('0x1b'),_0x1fe1f5[_0xeba5('0x18')],_0x1cab08);_0x533e6c(_0x73e6ef[_0xeba5('0x16')](0x1f4,_0x1fe1f5[_0xeba5('0x18')]));});});};exports[_0xeba5('0x25')]=function(_0x3138e6){var _0x5e7830=this;return new Promise(function(_0x5ec67d,_0x3c6c76){return db[_0xeba5('0x1c')][_0xeba5('0x26')]({'raw':_0x3138e6[_0xeba5('0x1d')]?_0x3138e6[_0xeba5('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3138e6['options']?_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x1f')]||null:null,'attributes':_0x3138e6[_0xeba5('0x1d')]?_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x20')]||null:null,'include':_0x3138e6[_0xeba5('0x1d')]?_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x3138e6[_0xeba5('0x1d')][_0xeba5('0x22')],function(_0x1b414a){return{'model':db[_0x1b414a[_0xeba5('0x24')]],'as':_0x1b414a['as'],'attributes':_0x1b414a[_0xeba5('0x20')],'include':_0x1b414a[_0xeba5('0x22')]?_[_0xeba5('0x23')](_0x1b414a['include'],function(_0x3c627a){return{'model':db[_0x3c627a[_0xeba5('0x24')]],'as':_0x3c627a['as'],'attributes':_0x3c627a[_0xeba5('0x20')],'include':_0x3c627a['include']?_[_0xeba5('0x23')](_0x3c627a['include'],function(_0x7b0810){return{'model':db[_0x7b0810[_0xeba5('0x24')]],'as':_0x7b0810['as'],'attributes':_0x7b0810[_0xeba5('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeba5('0x27')](function(_0x1ab68e){logger[_0xeba5('0x10')](_0xeba5('0x25'),_0x3138e6);logger[_0xeba5('0x13')](_0xeba5('0x25'),_0x3138e6,JSON[_0xeba5('0x15')](_0x1ab68e));_0x5ec67d(_0x1ab68e);})[_0xeba5('0x1a')](function(_0x1a6c4e){logger[_0xeba5('0x16')](_0xeba5('0x25'),_0x1a6c4e[_0xeba5('0x18')],_0x3138e6);_0x3c6c76(_0x5e7830[_0xeba5('0x16')](0x1f4,_0x1a6c4e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index a845db5..bfa577d 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 _0x1220=['emit','length','./faxQueue.events','save'];(function(_0x2b3513,_0x3b62d4){var _0x1486cd=function(_0x1902fc){while(--_0x1902fc){_0x2b3513['push'](_0x2b3513['shift']());}};_0x1486cd(++_0x3b62d4);}(_0x1220,0x8a));var _0x0122=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x1220[_0x422905];return _0x33dc6c;};'use strict';var FaxQueueEvents=require(_0x0122('0x0'));var events=[_0x0122('0x1'),'remove','update'];function createListener(_0x4842aa,_0x1b23e6){return function(_0xebad2b){_0x1b23e6[_0x0122('0x2')](_0x4842aa,_0xebad2b);};}function removeListener(_0x400a17,_0x2876f4){return function(){FaxQueueEvents['removeListener'](_0x400a17,_0x2876f4);};}exports['register']=function(_0x300dfe){for(var _0x33bd09=0x0,_0x8b4dca=events[_0x0122('0x3')];_0x33bd09<_0x8b4dca;_0x33bd09++){var _0x5b72e5=events[_0x33bd09];var _0x38e810=createListener('faxQueue:'+_0x5b72e5,_0x300dfe);FaxQueueEvents['on'](_0x5b72e5,_0x38e810);}}; \ No newline at end of file +var _0x20e7=['update','emit','removeListener','length','./faxQueue.events','save'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x20e7,0x178));var _0x720e=function(_0x3a283b,_0x5ea077){_0x3a283b=_0x3a283b-0x0;var _0x3ac2ee=_0x20e7[_0x3a283b];return _0x3ac2ee;};'use strict';var FaxQueueEvents=require(_0x720e('0x0'));var events=[_0x720e('0x1'),'remove',_0x720e('0x2')];function createListener(_0x991cc6,_0x51dc24){return function(_0x3eb3ba){_0x51dc24[_0x720e('0x3')](_0x991cc6,_0x3eb3ba);};}function removeListener(_0x254ee3,_0x1cee97){return function(){FaxQueueEvents[_0x720e('0x4')](_0x254ee3,_0x1cee97);};}exports['register']=function(_0x14ff38){for(var _0x2b2c47=0x0,_0xf9e10c=events[_0x720e('0x5')];_0x2b2c47<_0xf9e10c;_0x2b2c47++){var _0x1a5c02=events[_0x2b2c47];var _0x15355f=createListener('faxQueue:'+_0x1a5c02,_0x14ff38);FaxQueueEvents['on'](_0x1a5c02,_0x15355f);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 03cdc9e..aae576e 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 _0x9f37=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','getTeams','getAgents','post','/:id/teams','addTeams','/:id/users','put','update','delete','removeTeams','removeAgents'];(function(_0x4beb19,_0x3b6afe){var _0x3b2cbe=function(_0x5c00b){while(--_0x5c00b){_0x4beb19['push'](_0x4beb19['shift']());}};_0x3b2cbe(++_0x3b6afe);}(_0x9f37,0xd1));var _0x79f3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9f37[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var path=require('path');var timeout=require(_0x79f3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x79f3('0x3'));var auth=require(_0x79f3('0x4'));var interaction=require(_0x79f3('0x5'));var config=require('../../config/environment');var controller=require(_0x79f3('0x6'));router[_0x79f3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x79f3('0x7')](_0x79f3('0x8'),auth[_0x79f3('0x9')](),controller[_0x79f3('0xa')]);router['get'](_0x79f3('0xb'),auth[_0x79f3('0x9')](),controller['show']);router[_0x79f3('0x7')](_0x79f3('0xc'),auth[_0x79f3('0x9')](),controller[_0x79f3('0xd')]);router[_0x79f3('0x7')]('/:id/teams',auth[_0x79f3('0x9')](),controller[_0x79f3('0xe')]);router['get']('/:id/users',auth[_0x79f3('0x9')](),controller[_0x79f3('0xf')]);router[_0x79f3('0x10')]('/',auth[_0x79f3('0x9')](),controller['create']);router[_0x79f3('0x10')](_0x79f3('0x11'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x12')]);router[_0x79f3('0x10')](_0x79f3('0x13'),auth['isAuthenticated'](),controller['addAgents']);router[_0x79f3('0x14')](_0x79f3('0xb'),auth['isAuthenticated'](),controller[_0x79f3('0x15')]);router[_0x79f3('0x16')](_0x79f3('0xb'),auth[_0x79f3('0x9')](),controller['destroy']);router[_0x79f3('0x16')](_0x79f3('0x11'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x17')]);router[_0x79f3('0x16')](_0x79f3('0x13'),auth[_0x79f3('0x9')](),controller[_0x79f3('0x18')]);module[_0x79f3('0x19')]=router; \ No newline at end of file +var _0x5e0e=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x147982,_0xfa2350){var _0x17b5fa=function(_0x1e9570){while(--_0x1e9570){_0x147982['push'](_0x147982['shift']());}};_0x17b5fa(++_0xfa2350);}(_0x5e0e,0x89));var _0xe5e0=function(_0x3f9ec3,_0x3dfd37){_0x3f9ec3=_0x3f9ec3-0x0;var _0xe85b13=_0x5e0e[_0x3f9ec3];return _0xe85b13;};'use strict';var multer=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var path=require('path');var timeout=require(_0xe5e0('0x2'));var express=require(_0xe5e0('0x3'));var router=express[_0xe5e0('0x4')]();var fs_extra=require(_0xe5e0('0x5'));var auth=require(_0xe5e0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e0('0x7'));var controller=require('./faxQueue.controller');router[_0xe5e0('0x8')]('/',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xa')]);router[_0xe5e0('0x8')](_0xe5e0('0xb'),auth[_0xe5e0('0x9')](),controller['describe']);router[_0xe5e0('0x8')](_0xe5e0('0xc'),auth['isAuthenticated'](),controller[_0xe5e0('0xd')]);router[_0xe5e0('0x8')](_0xe5e0('0xe'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xf')]);router[_0xe5e0('0x8')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x11')]);router[_0xe5e0('0x8')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe5e0('0x14')]);router[_0xe5e0('0x15')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller['addTeams']);router[_0xe5e0('0x15')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x16')]);router[_0xe5e0('0x17')](_0xe5e0('0xc'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x18')]);router[_0xe5e0('0x19')]('/:id',auth[_0xe5e0('0x9')](),controller['destroy']);router[_0xe5e0('0x19')]('/:id/teams',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x1a')]);router['delete'](_0xe5e0('0x12'),auth['isAuthenticated'](),controller[_0xe5e0('0x1b')]);module[_0xe5e0('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index a7248aa..b89f362 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 _0x015d=['DATE','STRING','moment','sequelize'];(function(_0x21b4af,_0x42ab0a){var _0x20a8f6=function(_0x2ac494){while(--_0x2ac494){_0x21b4af['push'](_0x21b4af['shift']());}};_0x20a8f6(++_0x42ab0a);}(_0x015d,0xd2));var _0xd015=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x015d[_0xbf8ebe];return _0x1e25e8;};'use strict';var moment=require(_0xd015('0x0'));var Sequelize=require(_0xd015('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd015('0x2')]},'leaveAt':{'type':Sequelize[_0xd015('0x2')]},'acceptAt':{'type':Sequelize[_0xd015('0x2')]},'exitAt':{'type':Sequelize[_0xd015('0x2')]},'reason':{'type':Sequelize[_0xd015('0x3')]}}; \ No newline at end of file +var _0xa3ab=['sequelize','exports','STRING','DATE','moment'];(function(_0x1689c3,_0x38dc2d){var _0x1e9df6=function(_0x1741d1){while(--_0x1741d1){_0x1689c3['push'](_0x1689c3['shift']());}};_0x1e9df6(++_0x38dc2d);}(_0xa3ab,0x103));var _0xba3a=function(_0xd16c3b,_0x126e40){_0xd16c3b=_0xd16c3b-0x0;var _0x155f00=_0xa3ab[_0xd16c3b];return _0x155f00;};'use strict';var moment=require(_0xba3a('0x0'));var Sequelize=require(_0xba3a('0x1'));module[_0xba3a('0x2')]={'uniqueid':{'type':Sequelize[_0xba3a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xba3a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xba3a('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba3a('0x4')]},'reason':{'type':Sequelize[_0xba3a('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 261b513..47189cf 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 _0x1f38=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','end','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','keys','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x4525cb,_0x4239f6){var _0x486554=function(_0x2d06a0){while(--_0x2d06a0){_0x4525cb['push'](_0x4525cb['shift']());}};_0x486554(++_0x4239f6);}(_0x1f38,0xd7));var _0x81f3=function(_0x2715b5,_0xdc645f){_0x2715b5=_0x2715b5-0x0;var _0x114369=_0x1f38[_0x2715b5];return _0x114369;};'use strict';var emlformat=require(_0x81f3('0x0'));var rimraf=require(_0x81f3('0x1'));var zipdir=require(_0x81f3('0x2'));var jsonpatch=require(_0x81f3('0x3'));var rp=require(_0x81f3('0x4'));var moment=require(_0x81f3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x81f3('0x6'));var util=require(_0x81f3('0x7'));var path=require(_0x81f3('0x8'));var sox=require(_0x81f3('0x9'));var csv=require(_0x81f3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x81f3('0xb'));var _=require(_0x81f3('0xc'));var squel=require(_0x81f3('0xd'));var crypto=require(_0x81f3('0xe'));var jsforce=require(_0x81f3('0xf'));var deskjs=require(_0x81f3('0x10'));var toCsv=require(_0x81f3('0xa'));var querystring=require(_0x81f3('0x11'));var Papa=require(_0x81f3('0x12'));var Redis=require(_0x81f3('0x13'));var authService=require(_0x81f3('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x81f3('0x15'));var hardwareService=require(_0x81f3('0x16'));var logger=require(_0x81f3('0x17'))(_0x81f3('0x18'));var utils=require(_0x81f3('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x81f3('0x1a'))['db'];function respondWithStatusCode(_0x3ca3e8,_0x28a6ee){_0x28a6ee=_0x28a6ee||0xcc;return function(_0x422140){if(_0x422140){return _0x3ca3e8[_0x81f3('0x1b')](_0x28a6ee);}return _0x3ca3e8[_0x81f3('0x1c')](_0x28a6ee)['end']();};}function respondWithResult(_0x169119,_0x79b7b){_0x79b7b=_0x79b7b||0xc8;return function(_0x469b84){if(_0x469b84){return _0x169119['status'](_0x79b7b)[_0x81f3('0x1d')](_0x469b84);}};}function respondWithFilteredResult(_0x44c4e9,_0x3f177b){return function(_0x3a444c){if(_0x3a444c){var _0x19c5f1=typeof _0x3f177b[_0x81f3('0x1e')]===_0x81f3('0x1f')&&typeof _0x3f177b[_0x81f3('0x20')]===_0x81f3('0x1f');var _0x2fbf4e=_0x3a444c[_0x81f3('0x21')];var _0x48f4a2=_0x19c5f1?0x0:_0x3f177b[_0x81f3('0x1e')];var _0x336d5c=_0x19c5f1?_0x3a444c[_0x81f3('0x21')]:_0x3f177b[_0x81f3('0x1e')]+_0x3f177b[_0x81f3('0x20')];var _0x49181a;if(_0x336d5c>=_0x2fbf4e){_0x336d5c=_0x2fbf4e;_0x49181a=0xc8;}else{_0x49181a=0xce;}_0x44c4e9[_0x81f3('0x1c')](_0x49181a);return _0x44c4e9[_0x81f3('0x22')]('Content-Range',_0x48f4a2+'-'+_0x336d5c+'/'+_0x2fbf4e)[_0x81f3('0x1d')](_0x3a444c);}return null;};}function patchUpdates(_0x5a5ca2){return function(_0x3ddc0d){try{jsonpatch[_0x81f3('0x23')](_0x3ddc0d,_0x5a5ca2,!![]);}catch(_0x473da7){return BPromise['reject'](_0x473da7);}return _0x3ddc0d['save']();};}function saveUpdates(_0x105fe6,_0x3fdc9f){return function(_0x4aaeff){if(_0x4aaeff){return _0x4aaeff[_0x81f3('0x24')](_0x105fe6)[_0x81f3('0x25')](function(_0x4f6dee){return _0x4f6dee;});}return null;};}function removeEntity(_0x3f22a4,_0x1ced46){return function(_0x1acee8){if(_0x1acee8){return _0x1acee8[_0x81f3('0x26')]()[_0x81f3('0x25')](function(){_0x3f22a4[_0x81f3('0x1c')](0xcc)[_0x81f3('0x27')]();});}};}function handleEntityNotFound(_0x521c6d,_0x1c7302){return function(_0x572cdb){if(!_0x572cdb){_0x521c6d['sendStatus'](0x194);}return _0x572cdb;};}function handleError(_0x33c276,_0x76e8d){_0x76e8d=_0x76e8d||0x1f4;return function(_0x5a94a0){logger[_0x81f3('0x28')](_0x5a94a0['stack']);if(_0x5a94a0[_0x81f3('0x29')]){delete _0x5a94a0[_0x81f3('0x29')];}_0x33c276['status'](_0x76e8d)[_0x81f3('0x2a')](_0x5a94a0);};}exports[_0x81f3('0x2b')]=function(_0x46025a,_0x38b939){var _0x37ed34={},_0x2cc9b2={},_0x25ef3e={'count':0x0,'rows':[]};var _0x560adf=_[_0x81f3('0x2c')](db[_0x81f3('0x2d')][_0x81f3('0x2e')],function(_0x15441a){return{'name':_0x15441a[_0x81f3('0x2f')],'type':_0x15441a[_0x81f3('0x30')]['key']};});_0x2cc9b2[_0x81f3('0x31')]=_['map'](_0x560adf,'name');_0x2cc9b2[_0x81f3('0x32')]=_['keys'](_0x46025a[_0x81f3('0x32')]);_0x2cc9b2[_0x81f3('0x33')]=_[_0x81f3('0x34')](_0x2cc9b2[_0x81f3('0x31')],_0x2cc9b2[_0x81f3('0x32')]);_0x37ed34[_0x81f3('0x35')]=_[_0x81f3('0x34')](_0x2cc9b2[_0x81f3('0x31')],qs[_0x81f3('0x36')](_0x46025a[_0x81f3('0x32')][_0x81f3('0x36')]));_0x37ed34[_0x81f3('0x35')]=_0x37ed34[_0x81f3('0x35')][_0x81f3('0x37')]?_0x37ed34['attributes']:_0x2cc9b2[_0x81f3('0x31')];if(!_0x46025a[_0x81f3('0x32')]['hasOwnProperty'](_0x81f3('0x38'))){_0x37ed34[_0x81f3('0x20')]=qs[_0x81f3('0x20')](_0x46025a[_0x81f3('0x32')]['limit']);_0x37ed34[_0x81f3('0x1e')]=qs[_0x81f3('0x1e')](_0x46025a[_0x81f3('0x32')][_0x81f3('0x1e')]);}_0x37ed34[_0x81f3('0x39')]=qs['sort'](_0x46025a[_0x81f3('0x32')]['sort']);_0x37ed34[_0x81f3('0x3a')]=qs[_0x81f3('0x33')](_[_0x81f3('0x3b')](_0x46025a[_0x81f3('0x32')],_0x2cc9b2['filters']),_0x560adf);if(_0x46025a['query'][_0x81f3('0x3c')]){_0x37ed34['where']=_['merge'](_0x37ed34[_0x81f3('0x3a')],{'$or':_[_0x81f3('0x2c')](_0x560adf,function(_0x395d6a){if(_0x395d6a[_0x81f3('0x30')]!==_0x81f3('0x3d')){var _0x574046={};_0x574046[_0x395d6a[_0x81f3('0x29')]]={'$like':'%'+_0x46025a['query']['filter']+'%'};return _0x574046;}})});}_0x37ed34=_[_0x81f3('0x3e')]({},_0x37ed34,_0x46025a[_0x81f3('0x3f')]);var _0x1ad0c5={'where':_0x37ed34['where']};return db[_0x81f3('0x2d')][_0x81f3('0x21')](_0x1ad0c5)[_0x81f3('0x25')](function(_0x196f71){_0x25ef3e[_0x81f3('0x21')]=_0x196f71;if(_0x46025a[_0x81f3('0x32')][_0x81f3('0x40')]){_0x37ed34[_0x81f3('0x41')]=[{'all':!![]}];}return db[_0x81f3('0x2d')][_0x81f3('0x42')](_0x37ed34);})[_0x81f3('0x25')](function(_0x3aa573){_0x25ef3e['rows']=_0x3aa573;return _0x25ef3e;})[_0x81f3('0x25')](respondWithFilteredResult(_0x38b939,_0x37ed34))[_0x81f3('0x43')](handleError(_0x38b939,null));};exports[_0x81f3('0x44')]=function(_0xc4c1d8,_0x406dde){var _0x33a1a8={'raw':!![],'where':{'id':_0xc4c1d8['params']['id']}},_0x26903a={};_0x26903a[_0x81f3('0x31')]=_[_0x81f3('0x45')](db[_0x81f3('0x2d')][_0x81f3('0x2e')]);_0x26903a[_0x81f3('0x32')]=_[_0x81f3('0x45')](_0xc4c1d8[_0x81f3('0x32')]);_0x26903a[_0x81f3('0x33')]=_[_0x81f3('0x34')](_0x26903a[_0x81f3('0x31')],_0x26903a[_0x81f3('0x32')]);_0x33a1a8[_0x81f3('0x35')]=_[_0x81f3('0x34')](_0x26903a['model'],qs[_0x81f3('0x36')](_0xc4c1d8[_0x81f3('0x32')][_0x81f3('0x36')]));_0x33a1a8[_0x81f3('0x35')]=_0x33a1a8[_0x81f3('0x35')][_0x81f3('0x37')]?_0x33a1a8[_0x81f3('0x35')]:_0x26903a['model'];if(_0xc4c1d8[_0x81f3('0x32')][_0x81f3('0x40')]){_0x33a1a8['include']=[{'all':!![]}];}_0x33a1a8=_[_0x81f3('0x3e')]({},_0x33a1a8,_0xc4c1d8[_0x81f3('0x3f')]);return db[_0x81f3('0x2d')]['find'](_0x33a1a8)[_0x81f3('0x25')](handleEntityNotFound(_0x406dde,null))[_0x81f3('0x25')](respondWithResult(_0x406dde,null))[_0x81f3('0x43')](handleError(_0x406dde,null));};exports[_0x81f3('0x46')]=function(_0x34792b,_0x53944a){return db[_0x81f3('0x2d')]['create'](_0x34792b['body'],{})['then'](respondWithResult(_0x53944a,0xc9))[_0x81f3('0x43')](handleError(_0x53944a,null));};exports[_0x81f3('0x24')]=function(_0x53caf9,_0x2cd316){if(_0x53caf9['body']['id']){delete _0x53caf9[_0x81f3('0x47')]['id'];}return db['FaxQueueReport'][_0x81f3('0x48')]({'where':{'id':_0x53caf9['params']['id']}})[_0x81f3('0x25')](handleEntityNotFound(_0x2cd316,null))[_0x81f3('0x25')](saveUpdates(_0x53caf9[_0x81f3('0x47')],null))['then'](respondWithResult(_0x2cd316,null))[_0x81f3('0x43')](handleError(_0x2cd316,null));};exports[_0x81f3('0x26')]=function(_0x4d2db9,_0x45682d){return db[_0x81f3('0x2d')]['find']({'where':{'id':_0x4d2db9[_0x81f3('0x49')]['id']}})[_0x81f3('0x25')](handleEntityNotFound(_0x45682d,null))[_0x81f3('0x25')](removeEntity(_0x45682d,null))[_0x81f3('0x43')](handleError(_0x45682d,null));};exports[_0x81f3('0x4a')]=function(_0x3be28d,_0xaf51a3){return db['FaxQueueReport']['describe']()[_0x81f3('0x25')](respondWithResult(_0xaf51a3,null))[_0x81f3('0x43')](handleError(_0xaf51a3,null));}; \ No newline at end of file +var _0x6ae0=['FaxQueueReport','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','count','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','status','send','index','map'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6ae0,0x192));var _0x06ae=function(_0x22fc91,_0x3bbbce){_0x22fc91=_0x22fc91-0x0;var _0x483790=_0x6ae0[_0x22fc91];return _0x483790;};'use strict';var emlformat=require(_0x06ae('0x0'));var rimraf=require(_0x06ae('0x1'));var zipdir=require(_0x06ae('0x2'));var jsonpatch=require(_0x06ae('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x06ae('0x4'));var Mustache=require('mustache');var util=require(_0x06ae('0x5'));var path=require('path');var sox=require(_0x06ae('0x6'));var csv=require(_0x06ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06ae('0x8'));var _=require('lodash');var squel=require(_0x06ae('0x9'));var crypto=require(_0x06ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x06ae('0xb'));var toCsv=require(_0x06ae('0x7'));var querystring=require(_0x06ae('0xc'));var Papa=require(_0x06ae('0xd'));var Redis=require(_0x06ae('0xe'));var authService=require(_0x06ae('0xf'));var qs=require(_0x06ae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ae('0x11'));var logger=require(_0x06ae('0x12'))(_0x06ae('0x13'));var utils=require(_0x06ae('0x14'));var config=require(_0x06ae('0x15'));var licenseUtil=require(_0x06ae('0x16'));var db=require(_0x06ae('0x17'))['db'];function respondWithStatusCode(_0x4eb845,_0x5cd65f){_0x5cd65f=_0x5cd65f||0xcc;return function(_0x55ec89){if(_0x55ec89){return _0x4eb845[_0x06ae('0x18')](_0x5cd65f);}return _0x4eb845['status'](_0x5cd65f)[_0x06ae('0x19')]();};}function respondWithResult(_0xa858d2,_0x46dab3){_0x46dab3=_0x46dab3||0xc8;return function(_0x279e03){if(_0x279e03){return _0xa858d2['status'](_0x46dab3)['json'](_0x279e03);}};}function respondWithFilteredResult(_0x3f6ce2,_0x5f44a2){return function(_0x1c8fd7){if(_0x1c8fd7){var _0xf59273=typeof _0x5f44a2[_0x06ae('0x1a')]==='undefined'&&typeof _0x5f44a2['limit']==='undefined';var _0xf869c6=_0x1c8fd7[_0x06ae('0x1b')];var _0x35eab4=_0xf59273?0x0:_0x5f44a2[_0x06ae('0x1a')];var _0x1a8e35=_0xf59273?_0x1c8fd7[_0x06ae('0x1b')]:_0x5f44a2[_0x06ae('0x1a')]+_0x5f44a2['limit'];var _0x490cd0;if(_0x1a8e35>=_0xf869c6){_0x1a8e35=_0xf869c6;_0x490cd0=0xc8;}else{_0x490cd0=0xce;}_0x3f6ce2['status'](_0x490cd0);return _0x3f6ce2['set'](_0x06ae('0x1c'),_0x35eab4+'-'+_0x1a8e35+'/'+_0xf869c6)[_0x06ae('0x1d')](_0x1c8fd7);}return null;};}function patchUpdates(_0x5c65b6){return function(_0xd42b1c){try{jsonpatch[_0x06ae('0x1e')](_0xd42b1c,_0x5c65b6,!![]);}catch(_0x467156){return BPromise[_0x06ae('0x1f')](_0x467156);}return _0xd42b1c['save']();};}function saveUpdates(_0xfa1c6f,_0x54b8c7){return function(_0x14b374){if(_0x14b374){return _0x14b374[_0x06ae('0x20')](_0xfa1c6f)['then'](function(_0x32c535){return _0x32c535;});}return null;};}function removeEntity(_0x264785,_0x2c4480){return function(_0x512753){if(_0x512753){return _0x512753[_0x06ae('0x21')]()[_0x06ae('0x22')](function(){_0x264785['status'](0xcc)[_0x06ae('0x19')]();});}};}function handleEntityNotFound(_0xf6075b,_0x40f522){return function(_0x4f69f2){if(!_0x4f69f2){_0xf6075b[_0x06ae('0x18')](0x194);}return _0x4f69f2;};}function handleError(_0x47c5ca,_0x104db1){_0x104db1=_0x104db1||0x1f4;return function(_0x24410a){logger[_0x06ae('0x23')](_0x24410a[_0x06ae('0x24')]);if(_0x24410a['name']){delete _0x24410a[_0x06ae('0x25')];}_0x47c5ca[_0x06ae('0x26')](_0x104db1)[_0x06ae('0x27')](_0x24410a);};}exports[_0x06ae('0x28')]=function(_0x49f0b6,_0xfd320a){var _0x5ca32b={},_0x1baff9={},_0xa6c16b={'count':0x0,'rows':[]};var _0x11b569=_[_0x06ae('0x29')](db[_0x06ae('0x2a')]['rawAttributes'],function(_0x2a1d3a){return{'name':_0x2a1d3a[_0x06ae('0x2b')],'type':_0x2a1d3a['type'][_0x06ae('0x2c')]};});_0x1baff9['model']=_[_0x06ae('0x29')](_0x11b569,'name');_0x1baff9[_0x06ae('0x2d')]=_[_0x06ae('0x2e')](_0x49f0b6[_0x06ae('0x2d')]);_0x1baff9['filters']=_[_0x06ae('0x2f')](_0x1baff9['model'],_0x1baff9['query']);_0x5ca32b['attributes']=_[_0x06ae('0x2f')](_0x1baff9[_0x06ae('0x30')],qs['fields'](_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x31')]));_0x5ca32b['attributes']=_0x5ca32b[_0x06ae('0x32')][_0x06ae('0x33')]?_0x5ca32b['attributes']:_0x1baff9['model'];if(!_0x49f0b6['query'][_0x06ae('0x34')](_0x06ae('0x35'))){_0x5ca32b[_0x06ae('0x36')]=qs['limit'](_0x49f0b6['query'][_0x06ae('0x36')]);_0x5ca32b['offset']=qs['offset'](_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x1a')]);}_0x5ca32b[_0x06ae('0x37')]=qs[_0x06ae('0x38')](_0x49f0b6['query'][_0x06ae('0x38')]);_0x5ca32b[_0x06ae('0x39')]=qs[_0x06ae('0x3a')](_[_0x06ae('0x3b')](_0x49f0b6[_0x06ae('0x2d')],_0x1baff9[_0x06ae('0x3a')]),_0x11b569);if(_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x3c')]){_0x5ca32b[_0x06ae('0x39')]=_[_0x06ae('0x3d')](_0x5ca32b[_0x06ae('0x39')],{'$or':_[_0x06ae('0x29')](_0x11b569,function(_0xa2e675){if(_0xa2e675['type']!==_0x06ae('0x3e')){var _0x1fa92a={};_0x1fa92a[_0xa2e675[_0x06ae('0x25')]]={'$like':'%'+_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x3c')]+'%'};return _0x1fa92a;}})});}_0x5ca32b=_['merge']({},_0x5ca32b,_0x49f0b6[_0x06ae('0x3f')]);var _0x53a793={'where':_0x5ca32b[_0x06ae('0x39')]};return db[_0x06ae('0x2a')][_0x06ae('0x1b')](_0x53a793)[_0x06ae('0x22')](function(_0x2bc483){_0xa6c16b['count']=_0x2bc483;if(_0x49f0b6[_0x06ae('0x2d')][_0x06ae('0x40')]){_0x5ca32b[_0x06ae('0x41')]=[{'all':!![]}];}return db[_0x06ae('0x2a')][_0x06ae('0x42')](_0x5ca32b);})['then'](function(_0x187397){_0xa6c16b['rows']=_0x187397;return _0xa6c16b;})[_0x06ae('0x22')](respondWithFilteredResult(_0xfd320a,_0x5ca32b))[_0x06ae('0x43')](handleError(_0xfd320a,null));};exports[_0x06ae('0x44')]=function(_0x3662b1,_0x131341){var _0x4e9c3e={'raw':!![],'where':{'id':_0x3662b1[_0x06ae('0x45')]['id']}},_0x3d982a={};_0x3d982a['model']=_[_0x06ae('0x2e')](db[_0x06ae('0x2a')]['rawAttributes']);_0x3d982a[_0x06ae('0x2d')]=_['keys'](_0x3662b1['query']);_0x3d982a['filters']=_[_0x06ae('0x2f')](_0x3d982a[_0x06ae('0x30')],_0x3d982a[_0x06ae('0x2d')]);_0x4e9c3e[_0x06ae('0x32')]=_[_0x06ae('0x2f')](_0x3d982a[_0x06ae('0x30')],qs[_0x06ae('0x31')](_0x3662b1[_0x06ae('0x2d')]['fields']));_0x4e9c3e[_0x06ae('0x32')]=_0x4e9c3e[_0x06ae('0x32')][_0x06ae('0x33')]?_0x4e9c3e[_0x06ae('0x32')]:_0x3d982a['model'];if(_0x3662b1[_0x06ae('0x2d')][_0x06ae('0x40')]){_0x4e9c3e[_0x06ae('0x41')]=[{'all':!![]}];}_0x4e9c3e=_[_0x06ae('0x3d')]({},_0x4e9c3e,_0x3662b1[_0x06ae('0x3f')]);return db[_0x06ae('0x2a')][_0x06ae('0x46')](_0x4e9c3e)[_0x06ae('0x22')](handleEntityNotFound(_0x131341,null))[_0x06ae('0x22')](respondWithResult(_0x131341,null))[_0x06ae('0x43')](handleError(_0x131341,null));};exports[_0x06ae('0x47')]=function(_0x444dbb,_0x3ccbb5){return db[_0x06ae('0x2a')][_0x06ae('0x47')](_0x444dbb[_0x06ae('0x48')],{})[_0x06ae('0x22')](respondWithResult(_0x3ccbb5,0xc9))[_0x06ae('0x43')](handleError(_0x3ccbb5,null));};exports[_0x06ae('0x20')]=function(_0x509969,_0xa2b743){if(_0x509969[_0x06ae('0x48')]['id']){delete _0x509969[_0x06ae('0x48')]['id'];}return db[_0x06ae('0x2a')][_0x06ae('0x46')]({'where':{'id':_0x509969[_0x06ae('0x45')]['id']}})[_0x06ae('0x22')](handleEntityNotFound(_0xa2b743,null))[_0x06ae('0x22')](saveUpdates(_0x509969['body'],null))[_0x06ae('0x22')](respondWithResult(_0xa2b743,null))[_0x06ae('0x43')](handleError(_0xa2b743,null));};exports[_0x06ae('0x21')]=function(_0x262fea,_0x563eaa){return db['FaxQueueReport'][_0x06ae('0x46')]({'where':{'id':_0x262fea[_0x06ae('0x45')]['id']}})[_0x06ae('0x22')](handleEntityNotFound(_0x563eaa,null))[_0x06ae('0x22')](removeEntity(_0x563eaa,null))[_0x06ae('0x43')](handleError(_0x563eaa,null));};exports['describe']=function(_0x42ac0e,_0x43bca9){return db[_0x06ae('0x2a')][_0x06ae('0x49')]()['then'](respondWithResult(_0x43bca9,null))[_0x06ae('0x43')](handleError(_0x43bca9,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 2ad2a00..9e9ef66 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x814b,0x1a2));var _0xb814=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0x814b[_0x13b330];return _0x1f666c;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x7476bd,_0x139b91){var _0x2cab00=function(_0x42c5e3){while(--_0x42c5e3){_0x7476bd['push'](_0x7476bd['shift']());}};_0x2cab00(++_0x139b91);}(_0x4975,0x86));var _0x5497=function(_0x1eb84a,_0xa63b61){_0x1eb84a=_0x1eb84a-0x0;var _0x1fdb44=_0x4975[_0x1eb84a];return _0x1fdb44;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 74608c7..64460fc 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 _0x20de=['../../config/utils','rpc','../../config/environment','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxQueueReport','create','options','raw','CreateFaxQueueReport','update','body','attributes','limit','UpdateFaxQueueReport','util','moment','bluebird','../../mysqldb'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0x20de,0xe4));var _0xe20d=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x20de[_0x4792c8];return _0x35edb1;};'use strict';var _=require('lodash');var util=require(_0xe20d('0x0'));var moment=require(_0xe20d('0x1'));var BPromise=require(_0xe20d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe20d('0x3'))['db'];var utils=require(_0xe20d('0x4'));var logger=require('../../config/logger')(_0xe20d('0x5'));var config=require(_0xe20d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe20d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e9e1a,_0x3a39d1,_0x26b97c){return new BPromise(function(_0x1adf49,_0x22336a){return client['request'](_0x4e9e1a,_0x26b97c)[_0xe20d('0x8')](function(_0x2e4875){logger[_0xe20d('0x9')](_0xe20d('0xa'),_0x3a39d1,_0xe20d('0xb'));logger[_0xe20d('0xc')](_0xe20d('0xd'),_0x3a39d1,'request\x20sent',JSON[_0xe20d('0xe')](_0x2e4875));if(_0x2e4875[_0xe20d('0xf')]){if(_0x2e4875['error'][_0xe20d('0x10')]===0x1f4){logger[_0xe20d('0xf')](_0xe20d('0xa'),_0x3a39d1,_0x2e4875[_0xe20d('0xf')][_0xe20d('0x11')]);return _0x22336a(_0x2e4875['error'][_0xe20d('0x11')]);}logger['error'](_0xe20d('0xa'),_0x3a39d1,_0x2e4875['error']['message']);return _0x1adf49(_0x2e4875[_0xe20d('0xf')]['message']);}else{logger[_0xe20d('0x9')](_0xe20d('0xa'),_0x3a39d1,_0xe20d('0xb'));_0x1adf49(_0x2e4875['result'][_0xe20d('0x11')]);}})[_0xe20d('0x12')](function(_0x8b7c8b){logger[_0xe20d('0xf')](_0xe20d('0xa'),_0x3a39d1,_0x8b7c8b);_0x22336a(_0x8b7c8b);});});}exports['CreateFaxQueueReport']=function(_0x6c42a0){var _0x271414=this;return new Promise(function(_0x847ed4,_0x2e5ce5){return db[_0xe20d('0x13')][_0xe20d('0x14')](_0x6c42a0['body'],{'raw':_0x6c42a0[_0xe20d('0x15')]?_0x6c42a0['options'][_0xe20d('0x16')]===undefined?!![]:![]:!![]})[_0xe20d('0x8')](function(_0x36e5f7){logger[_0xe20d('0x9')](_0xe20d('0x17'),_0x6c42a0);logger[_0xe20d('0xc')](_0xe20d('0x17'),_0x6c42a0,JSON['stringify'](_0x36e5f7));_0x847ed4(_0x36e5f7);})[_0xe20d('0x12')](function(_0x4fe433){logger[_0xe20d('0xf')](_0xe20d('0x17'),_0x4fe433['message'],_0x6c42a0);_0x2e5ce5(_0x271414[_0xe20d('0xf')](0x1f4,_0x4fe433[_0xe20d('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x181f9a){var _0x21e7cb=this;return new Promise(function(_0x503c84,_0x37add3){return db[_0xe20d('0x13')][_0xe20d('0x18')](_0x181f9a[_0xe20d('0x19')],{'raw':_0x181f9a[_0xe20d('0x15')]?_0x181f9a['options'][_0xe20d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x181f9a['options']?_0x181f9a[_0xe20d('0x15')]['where']||null:null,'attributes':_0x181f9a['options']?_0x181f9a[_0xe20d('0x15')][_0xe20d('0x1a')]||null:null,'limit':_0x181f9a[_0xe20d('0x15')]?_0x181f9a[_0xe20d('0x15')][_0xe20d('0x1b')]||null:null})[_0xe20d('0x8')](function(_0x132f1e){logger[_0xe20d('0x9')]('UpdateFaxQueueReport',_0x181f9a);logger['debug']('UpdateFaxQueueReport',_0x181f9a,JSON['stringify'](_0x132f1e));_0x503c84(_0x132f1e);})[_0xe20d('0x12')](function(_0x320d68){logger[_0xe20d('0xf')](_0xe20d('0x1c'),_0x320d68[_0xe20d('0x11')],_0x181f9a);_0x37add3(_0x21e7cb[_0xe20d('0xf')](0x1f4,_0x320d68[_0xe20d('0x11')]));});});}; \ No newline at end of file +var _0xe32f=['CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','debug','stringify','where','limit','UpdateFaxQueueReport','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch'];(function(_0x8c06b4,_0x222d26){var _0x21b7f9=function(_0x2ba6c0){while(--_0x2ba6c0){_0x8c06b4['push'](_0x8c06b4['shift']());}};_0x21b7f9(++_0x222d26);}(_0xe32f,0x8b));var _0xfe32=function(_0x318162,_0x476694){_0x318162=_0x318162-0x0;var _0x43f1d7=_0xe32f[_0x318162];return _0x43f1d7;};'use strict';var _=require('lodash');var util=require(_0xfe32('0x0'));var moment=require(_0xfe32('0x1'));var BPromise=require(_0xfe32('0x2'));var rs=require(_0xfe32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfe32('0x4'));var logger=require(_0xfe32('0x5'))(_0xfe32('0x6'));var config=require(_0xfe32('0x7'));var jayson=require(_0xfe32('0x8'));var client=jayson[_0xfe32('0x9')][_0xfe32('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d6431,_0xaf0be0,_0x32954a){return new BPromise(function(_0xabf0f0,_0x432902){return client['request'](_0x1d6431,_0x32954a)[_0xfe32('0xb')](function(_0x39ff6c){logger[_0xfe32('0xc')](_0xfe32('0xd'),_0xaf0be0,'request\x20sent');logger['debug'](_0xfe32('0xe'),_0xaf0be0,'request\x20sent',JSON['stringify'](_0x39ff6c));if(_0x39ff6c[_0xfe32('0xf')]){if(_0x39ff6c[_0xfe32('0xf')][_0xfe32('0x10')]===0x1f4){logger[_0xfe32('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0xaf0be0,_0x39ff6c['error'][_0xfe32('0x11')]);return _0x432902(_0x39ff6c['error'][_0xfe32('0x11')]);}logger[_0xfe32('0xf')](_0xfe32('0xd'),_0xaf0be0,_0x39ff6c[_0xfe32('0xf')]['message']);return _0xabf0f0(_0x39ff6c[_0xfe32('0xf')][_0xfe32('0x11')]);}else{logger[_0xfe32('0xc')](_0xfe32('0xd'),_0xaf0be0,_0xfe32('0x12'));_0xabf0f0(_0x39ff6c[_0xfe32('0x13')]['message']);}})[_0xfe32('0x14')](function(_0x19ff60){logger[_0xfe32('0xf')](_0xfe32('0xd'),_0xaf0be0,_0x19ff60);_0x432902(_0x19ff60);});});}exports[_0xfe32('0x15')]=function(_0xe9a7ae){var _0x719d64=this;return new Promise(function(_0x2c3559,_0x56f155){return db[_0xfe32('0x16')][_0xfe32('0x17')](_0xe9a7ae[_0xfe32('0x18')],{'raw':_0xe9a7ae[_0xfe32('0x19')]?_0xe9a7ae[_0xfe32('0x19')][_0xfe32('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4658fd){logger[_0xfe32('0xc')](_0xfe32('0x15'),_0xe9a7ae);logger[_0xfe32('0x1b')]('CreateFaxQueueReport',_0xe9a7ae,JSON[_0xfe32('0x1c')](_0x4658fd));_0x2c3559(_0x4658fd);})[_0xfe32('0x14')](function(_0x1178c7){logger['error'](_0xfe32('0x15'),_0x1178c7[_0xfe32('0x11')],_0xe9a7ae);_0x56f155(_0x719d64[_0xfe32('0xf')](0x1f4,_0x1178c7['message']));});});};exports['UpdateFaxQueueReport']=function(_0x548caa){var _0x4a1387=this;return new Promise(function(_0x2fa497,_0x13520b){return db[_0xfe32('0x16')]['update'](_0x548caa[_0xfe32('0x18')],{'raw':_0x548caa[_0xfe32('0x19')]?_0x548caa['options'][_0xfe32('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548caa[_0xfe32('0x19')]?_0x548caa[_0xfe32('0x19')][_0xfe32('0x1d')]||null:null,'attributes':_0x548caa[_0xfe32('0x19')]?_0x548caa['options']['attributes']||null:null,'limit':_0x548caa[_0xfe32('0x19')]?_0x548caa[_0xfe32('0x19')][_0xfe32('0x1e')]||null:null})[_0xfe32('0xb')](function(_0x99ddca){logger['info'](_0xfe32('0x1f'),_0x548caa);logger[_0xfe32('0x1b')](_0xfe32('0x1f'),_0x548caa,JSON[_0xfe32('0x1c')](_0x99ddca));_0x2fa497(_0x99ddca);})[_0xfe32('0x14')](function(_0x4ae7e6){logger['error'](_0xfe32('0x1f'),_0x4ae7e6[_0xfe32('0x11')],_0x548caa);_0x13520b(_0x4a1387[_0xfe32('0xf')](0x1f4,_0x4ae7e6[_0xfe32('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 98ed1a9..0d77f8b 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 _0x9660=['../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9660,0x151));var _0x0966=function(_0x202517,_0x47ada9){_0x202517=_0x202517-0x0;var _0x72463a=_0x9660[_0x202517];return _0x72463a;};'use strict';var multer=require(_0x0966('0x0'));var util=require('util');var path=require(_0x0966('0x1'));var timeout=require(_0x0966('0x2'));var express=require(_0x0966('0x3'));var router=express[_0x0966('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0966('0x5'));var interaction=require(_0x0966('0x6'));var config=require('../../config/environment');var controller=require(_0x0966('0x7'));router[_0x0966('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0966('0x8')]('/describe',auth[_0x0966('0x9')](),controller[_0x0966('0xa')]);router[_0x0966('0x8')](_0x0966('0xb'),auth['isAuthenticated'](),controller[_0x0966('0xc')]);router[_0x0966('0xd')]('/',auth[_0x0966('0x9')](),controller['create']);router[_0x0966('0xe')](_0x0966('0xb'),auth[_0x0966('0x9')](),controller[_0x0966('0xf')]);router[_0x0966('0x10')](_0x0966('0xb'),auth['isAuthenticated'](),controller[_0x0966('0x11')]);module[_0x0966('0x12')]=router; \ No newline at end of file +var _0xacf9=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','describe','/:id','post','isAuthenticated','create'];(function(_0x455161,_0x520f10){var _0x3e7c03=function(_0xb17908){while(--_0xb17908){_0x455161['push'](_0x455161['shift']());}};_0x3e7c03(++_0x520f10);}(_0xacf9,0x1d3));var _0x9acf=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xacf9[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0x9acf('0x0'));var util=require(_0x9acf('0x1'));var path=require(_0x9acf('0x2'));var timeout=require(_0x9acf('0x3'));var express=require('express');var router=express[_0x9acf('0x4')]();var fs_extra=require(_0x9acf('0x5'));var auth=require(_0x9acf('0x6'));var interaction=require(_0x9acf('0x7'));var config=require(_0x9acf('0x8'));var controller=require(_0x9acf('0x9'));router[_0x9acf('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9acf('0xa')](_0x9acf('0xb'),auth['isAuthenticated'](),controller[_0x9acf('0xc')]);router[_0x9acf('0xa')](_0x9acf('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9acf('0xe')]('/',auth[_0x9acf('0xf')](),controller[_0x9acf('0x10')]);router[_0x9acf('0x11')](_0x9acf('0xd'),auth[_0x9acf('0xf')](),controller[_0x9acf('0x12')]);router[_0x9acf('0x13')](_0x9acf('0xd'),auth[_0x9acf('0xf')](),controller[_0x9acf('0x14')]);module[_0x9acf('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 70e7d5c..fe23d54 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3eec67,_0x5c7161){_0x3eec67=_0x3eec67-0x0;var _0x5262b3=_0xb43b[_0x3eec67];return _0x5262b3;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4778eb,_0x20712d){var _0xdbb30d=function(_0x4d4309){while(--_0x4d4309){_0x4778eb['push'](_0x4778eb['shift']());}};_0xdbb30d(++_0x20712d);}(_0x70e0,0x17b));var _0x070e=function(_0x254397,_0x27e2b6){_0x254397=_0x254397-0x0;var _0x30b96e=_0x70e0[_0x254397];return _0x30b96e;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index df8a70f..8f65856 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 _0x0c63=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x49331a,_0x2a2d11){var _0x413a11=function(_0xddc5e4){while(--_0xddc5e4){_0x49331a['push'](_0x49331a['shift']());}};_0x413a11(++_0x2a2d11);}(_0x0c63,0x114));var _0x30c6=function(_0x499d6a,_0x322be5){_0x499d6a=_0x499d6a-0x0;var _0x5778fa=_0x0c63[_0x499d6a];return _0x5778fa;};'use strict';var emlformat=require(_0x30c6('0x0'));var rimraf=require(_0x30c6('0x1'));var zipdir=require(_0x30c6('0x2'));var jsonpatch=require(_0x30c6('0x3'));var rp=require(_0x30c6('0x4'));var moment=require(_0x30c6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x30c6('0x6'));var path=require(_0x30c6('0x7'));var sox=require('sox');var csv=require(_0x30c6('0x8'));var ejs=require(_0x30c6('0x9'));var fs=require('fs');var fs_extra=require(_0x30c6('0xa'));var _=require('lodash');var squel=require(_0x30c6('0xb'));var crypto=require(_0x30c6('0xc'));var jsforce=require(_0x30c6('0xd'));var deskjs=require(_0x30c6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x30c6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x30c6('0x10'));var qs=require(_0x30c6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x30c6('0x12'));var logger=require(_0x30c6('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x30c6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x30c6('0x15'))['db'];function respondWithStatusCode(_0x3821db,_0x2fc5e9){_0x2fc5e9=_0x2fc5e9||0xcc;return function(_0x5857c0){if(_0x5857c0){return _0x3821db[_0x30c6('0x16')](_0x2fc5e9);}return _0x3821db[_0x30c6('0x17')](_0x2fc5e9)[_0x30c6('0x18')]();};}function respondWithResult(_0x1c939b,_0xe8b264){_0xe8b264=_0xe8b264||0xc8;return function(_0x24605a){if(_0x24605a){return _0x1c939b[_0x30c6('0x17')](_0xe8b264)[_0x30c6('0x19')](_0x24605a);}};}function respondWithFilteredResult(_0x418286,_0xdb87de){return function(_0x19b3e9){if(_0x19b3e9){var _0x45b994=typeof _0xdb87de[_0x30c6('0x1a')]===_0x30c6('0x1b')&&typeof _0xdb87de[_0x30c6('0x1c')]===_0x30c6('0x1b');var _0x55811d=_0x19b3e9[_0x30c6('0x1d')];var _0x44d229=_0x45b994?0x0:_0xdb87de[_0x30c6('0x1a')];var _0x46abd4=_0x45b994?_0x19b3e9[_0x30c6('0x1d')]:_0xdb87de[_0x30c6('0x1a')]+_0xdb87de[_0x30c6('0x1c')];var _0x49d0c8;if(_0x46abd4>=_0x55811d){_0x46abd4=_0x55811d;_0x49d0c8=0xc8;}else{_0x49d0c8=0xce;}_0x418286[_0x30c6('0x17')](_0x49d0c8);return _0x418286[_0x30c6('0x1e')](_0x30c6('0x1f'),_0x44d229+'-'+_0x46abd4+'/'+_0x55811d)[_0x30c6('0x19')](_0x19b3e9);}return null;};}function patchUpdates(_0x12569a){return function(_0x325aa6){try{jsonpatch[_0x30c6('0x20')](_0x325aa6,_0x12569a,!![]);}catch(_0x550263){return BPromise['reject'](_0x550263);}return _0x325aa6[_0x30c6('0x21')]();};}function saveUpdates(_0xb4737b,_0x292d98){return function(_0x42d954){if(_0x42d954){return _0x42d954[_0x30c6('0x22')](_0xb4737b)['then'](function(_0x2432a3){return _0x2432a3;});}return null;};}function removeEntity(_0x53484f,_0x62ef2c){return function(_0xac3c6b){if(_0xac3c6b){return _0xac3c6b[_0x30c6('0x23')]()[_0x30c6('0x24')](function(){_0x53484f[_0x30c6('0x17')](0xcc)[_0x30c6('0x18')]();});}};}function handleEntityNotFound(_0x514f19,_0x85bf76){return function(_0x3fec9a){if(!_0x3fec9a){_0x514f19[_0x30c6('0x16')](0x194);}return _0x3fec9a;};}function handleError(_0x764a85,_0x40d63e){_0x40d63e=_0x40d63e||0x1f4;return function(_0x18f82b){logger[_0x30c6('0x25')](_0x18f82b[_0x30c6('0x26')]);if(_0x18f82b['name']){delete _0x18f82b['name'];}_0x764a85[_0x30c6('0x17')](_0x40d63e)[_0x30c6('0x27')](_0x18f82b);};}exports[_0x30c6('0x28')]=function(_0x4deb07,_0x6fc48e){var _0x353198={},_0x1b560c={},_0x45f687={'count':0x0,'rows':[]};var _0x4ac08f=_[_0x30c6('0x29')](db[_0x30c6('0x2a')][_0x30c6('0x2b')],function(_0x5d7086){return{'name':_0x5d7086[_0x30c6('0x2c')],'type':_0x5d7086[_0x30c6('0x2d')]['key']};});_0x1b560c[_0x30c6('0x2e')]=_[_0x30c6('0x29')](_0x4ac08f,_0x30c6('0x2f'));_0x1b560c[_0x30c6('0x30')]=_['keys'](_0x4deb07[_0x30c6('0x30')]);_0x1b560c[_0x30c6('0x31')]=_[_0x30c6('0x32')](_0x1b560c[_0x30c6('0x2e')],_0x1b560c[_0x30c6('0x30')]);_0x353198['attributes']=_[_0x30c6('0x32')](_0x1b560c['model'],qs['fields'](_0x4deb07['query'][_0x30c6('0x33')]));_0x353198[_0x30c6('0x34')]=_0x353198['attributes'][_0x30c6('0x35')]?_0x353198['attributes']:_0x1b560c[_0x30c6('0x2e')];if(!_0x4deb07[_0x30c6('0x30')][_0x30c6('0x36')](_0x30c6('0x37'))){_0x353198[_0x30c6('0x1c')]=qs[_0x30c6('0x1c')](_0x4deb07[_0x30c6('0x30')][_0x30c6('0x1c')]);_0x353198[_0x30c6('0x1a')]=qs['offset'](_0x4deb07[_0x30c6('0x30')][_0x30c6('0x1a')]);}_0x353198['order']=qs[_0x30c6('0x38')](_0x4deb07[_0x30c6('0x30')][_0x30c6('0x38')]);_0x353198[_0x30c6('0x39')]=qs[_0x30c6('0x31')](_['pick'](_0x4deb07[_0x30c6('0x30')],_0x1b560c[_0x30c6('0x31')]),_0x4ac08f);if(_0x4deb07[_0x30c6('0x30')][_0x30c6('0x3a')]){_0x353198[_0x30c6('0x39')]=_[_0x30c6('0x3b')](_0x353198[_0x30c6('0x39')],{'$or':_[_0x30c6('0x29')](_0x4ac08f,function(_0x502d73){if(_0x502d73[_0x30c6('0x2d')]!==_0x30c6('0x3c')){var _0x3a9742={};_0x3a9742[_0x502d73['name']]={'$like':'%'+_0x4deb07[_0x30c6('0x30')][_0x30c6('0x3a')]+'%'};return _0x3a9742;}})});}_0x353198=_[_0x30c6('0x3b')]({},_0x353198,_0x4deb07[_0x30c6('0x3d')]);var _0x524afc={'where':_0x353198[_0x30c6('0x39')]};return db[_0x30c6('0x2a')][_0x30c6('0x1d')](_0x524afc)[_0x30c6('0x24')](function(_0x285966){_0x45f687[_0x30c6('0x1d')]=_0x285966;if(_0x4deb07[_0x30c6('0x30')][_0x30c6('0x3e')]){_0x353198[_0x30c6('0x3f')]=[{'all':!![]}];}return db[_0x30c6('0x2a')]['findAll'](_0x353198);})[_0x30c6('0x24')](function(_0xd6e6f0){_0x45f687['rows']=_0xd6e6f0;return _0x45f687;})[_0x30c6('0x24')](respondWithFilteredResult(_0x6fc48e,_0x353198))[_0x30c6('0x40')](handleError(_0x6fc48e,null));};exports[_0x30c6('0x41')]=function(_0x3e8626,_0x3fd9e){var _0x5181e7={'raw':!![],'where':{'id':_0x3e8626[_0x30c6('0x42')]['id']}},_0x43fe90={};_0x43fe90['model']=_[_0x30c6('0x43')](db[_0x30c6('0x2a')][_0x30c6('0x2b')]);_0x43fe90['query']=_[_0x30c6('0x43')](_0x3e8626[_0x30c6('0x30')]);_0x43fe90[_0x30c6('0x31')]=_['intersection'](_0x43fe90['model'],_0x43fe90['query']);_0x5181e7[_0x30c6('0x34')]=_[_0x30c6('0x32')](_0x43fe90['model'],qs['fields'](_0x3e8626['query'][_0x30c6('0x33')]));_0x5181e7[_0x30c6('0x34')]=_0x5181e7[_0x30c6('0x34')][_0x30c6('0x35')]?_0x5181e7[_0x30c6('0x34')]:_0x43fe90[_0x30c6('0x2e')];if(_0x3e8626['query'][_0x30c6('0x3e')]){_0x5181e7['include']=[{'all':!![]}];}_0x5181e7=_[_0x30c6('0x3b')]({},_0x5181e7,_0x3e8626['options']);return db['FaxTransferReport'][_0x30c6('0x44')](_0x5181e7)['then'](handleEntityNotFound(_0x3fd9e,null))[_0x30c6('0x24')](respondWithResult(_0x3fd9e,null))[_0x30c6('0x40')](handleError(_0x3fd9e,null));};exports[_0x30c6('0x45')]=function(_0x4bcf5a,_0xb46747){return db[_0x30c6('0x2a')][_0x30c6('0x45')](_0x4bcf5a[_0x30c6('0x46')],{})[_0x30c6('0x24')](respondWithResult(_0xb46747,0xc9))['catch'](handleError(_0xb46747,null));};exports[_0x30c6('0x22')]=function(_0x5cd2c6,_0x563073){if(_0x5cd2c6[_0x30c6('0x46')]['id']){delete _0x5cd2c6['body']['id'];}return db[_0x30c6('0x2a')][_0x30c6('0x44')]({'where':{'id':_0x5cd2c6[_0x30c6('0x42')]['id']}})[_0x30c6('0x24')](handleEntityNotFound(_0x563073,null))[_0x30c6('0x24')](saveUpdates(_0x5cd2c6[_0x30c6('0x46')],null))[_0x30c6('0x24')](respondWithResult(_0x563073,null))[_0x30c6('0x40')](handleError(_0x563073,null));};exports[_0x30c6('0x23')]=function(_0xb029d7,_0x1cda8c){return db[_0x30c6('0x2a')][_0x30c6('0x44')]({'where':{'id':_0xb029d7[_0x30c6('0x42')]['id']}})[_0x30c6('0x24')](handleEntityNotFound(_0x1cda8c,null))[_0x30c6('0x24')](removeEntity(_0x1cda8c,null))['catch'](handleError(_0x1cda8c,null));};exports[_0x30c6('0x47')]=function(_0x3a40bd,_0x779d0b){return db[_0x30c6('0x2a')][_0x30c6('0x47')]()['then'](respondWithResult(_0x779d0b,null))[_0x30c6('0x40')](handleError(_0x779d0b,null));}; \ No newline at end of file +var _0x0c80=['filters','attributes','intersection','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','create','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','name','map','FaxTransferReport','type','key','model','query','keys'];(function(_0x3d6fae,_0x2e77cf){var _0x268a15=function(_0x354493){while(--_0x354493){_0x3d6fae['push'](_0x3d6fae['shift']());}};_0x268a15(++_0x2e77cf);}(_0x0c80,0x1b5));var _0x00c8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x0c80[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x00c8('0x0'));var rimraf=require(_0x00c8('0x1'));var zipdir=require(_0x00c8('0x2'));var jsonpatch=require(_0x00c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x00c8('0x4'));var Mustache=require('mustache');var util=require(_0x00c8('0x5'));var path=require(_0x00c8('0x6'));var sox=require(_0x00c8('0x7'));var csv=require(_0x00c8('0x8'));var ejs=require(_0x00c8('0x9'));var fs=require('fs');var fs_extra=require(_0x00c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x00c8('0xb'));var jsforce=require(_0x00c8('0xc'));var deskjs=require(_0x00c8('0xd'));var toCsv=require(_0x00c8('0x8'));var querystring=require('querystring');var Papa=require(_0x00c8('0xe'));var Redis=require('ioredis');var authService=require(_0x00c8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x00c8('0x10'));var hardwareService=require(_0x00c8('0x11'));var logger=require(_0x00c8('0x12'))('api');var utils=require(_0x00c8('0x13'));var config=require(_0x00c8('0x14'));var licenseUtil=require(_0x00c8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39378f,_0x594313){_0x594313=_0x594313||0xcc;return function(_0x22bcf9){if(_0x22bcf9){return _0x39378f[_0x00c8('0x16')](_0x594313);}return _0x39378f[_0x00c8('0x17')](_0x594313)[_0x00c8('0x18')]();};}function respondWithResult(_0x52da9a,_0x49df23){_0x49df23=_0x49df23||0xc8;return function(_0x50dcb2){if(_0x50dcb2){return _0x52da9a[_0x00c8('0x17')](_0x49df23)['json'](_0x50dcb2);}};}function respondWithFilteredResult(_0x3f6317,_0x4d8daf){return function(_0x40779f){if(_0x40779f){var _0x1144be=typeof _0x4d8daf[_0x00c8('0x19')]===_0x00c8('0x1a')&&typeof _0x4d8daf['limit']===_0x00c8('0x1a');var _0x93a147=_0x40779f[_0x00c8('0x1b')];var _0x53233d=_0x1144be?0x0:_0x4d8daf[_0x00c8('0x19')];var _0xd339fe=_0x1144be?_0x40779f['count']:_0x4d8daf[_0x00c8('0x19')]+_0x4d8daf[_0x00c8('0x1c')];var _0x1bd45c;if(_0xd339fe>=_0x93a147){_0xd339fe=_0x93a147;_0x1bd45c=0xc8;}else{_0x1bd45c=0xce;}_0x3f6317[_0x00c8('0x17')](_0x1bd45c);return _0x3f6317[_0x00c8('0x1d')](_0x00c8('0x1e'),_0x53233d+'-'+_0xd339fe+'/'+_0x93a147)[_0x00c8('0x1f')](_0x40779f);}return null;};}function patchUpdates(_0x19db3a){return function(_0x21a190){try{jsonpatch[_0x00c8('0x20')](_0x21a190,_0x19db3a,!![]);}catch(_0x3b5cfc){return BPromise[_0x00c8('0x21')](_0x3b5cfc);}return _0x21a190[_0x00c8('0x22')]();};}function saveUpdates(_0x43a1c9,_0x1d6bfe){return function(_0x146ad8){if(_0x146ad8){return _0x146ad8[_0x00c8('0x23')](_0x43a1c9)['then'](function(_0x4e36b2){return _0x4e36b2;});}return null;};}function removeEntity(_0x3af5b6,_0x2f08cf){return function(_0x1d73f1){if(_0x1d73f1){return _0x1d73f1[_0x00c8('0x24')]()[_0x00c8('0x25')](function(){_0x3af5b6[_0x00c8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x359b33,_0x877c78){return function(_0x56cd7d){if(!_0x56cd7d){_0x359b33[_0x00c8('0x16')](0x194);}return _0x56cd7d;};}function handleError(_0x12e409,_0x547214){_0x547214=_0x547214||0x1f4;return function(_0x5468bc){logger['error'](_0x5468bc['stack']);if(_0x5468bc[_0x00c8('0x26')]){delete _0x5468bc['name'];}_0x12e409[_0x00c8('0x17')](_0x547214)['send'](_0x5468bc);};}exports['index']=function(_0x41f728,_0x36642e){var _0x4250a4={},_0x14792b={},_0x4e1c21={'count':0x0,'rows':[]};var _0x4d23ff=_[_0x00c8('0x27')](db[_0x00c8('0x28')]['rawAttributes'],function(_0x4ac6c7){return{'name':_0x4ac6c7['fieldName'],'type':_0x4ac6c7[_0x00c8('0x29')][_0x00c8('0x2a')]};});_0x14792b[_0x00c8('0x2b')]=_[_0x00c8('0x27')](_0x4d23ff,_0x00c8('0x26'));_0x14792b[_0x00c8('0x2c')]=_[_0x00c8('0x2d')](_0x41f728[_0x00c8('0x2c')]);_0x14792b[_0x00c8('0x2e')]=_['intersection'](_0x14792b[_0x00c8('0x2b')],_0x14792b['query']);_0x4250a4[_0x00c8('0x2f')]=_[_0x00c8('0x30')](_0x14792b[_0x00c8('0x2b')],qs['fields'](_0x41f728[_0x00c8('0x2c')]['fields']));_0x4250a4[_0x00c8('0x2f')]=_0x4250a4[_0x00c8('0x2f')]['length']?_0x4250a4[_0x00c8('0x2f')]:_0x14792b[_0x00c8('0x2b')];if(!_0x41f728[_0x00c8('0x2c')][_0x00c8('0x31')]('nolimit')){_0x4250a4[_0x00c8('0x1c')]=qs['limit'](_0x41f728['query'][_0x00c8('0x1c')]);_0x4250a4['offset']=qs[_0x00c8('0x19')](_0x41f728[_0x00c8('0x2c')]['offset']);}_0x4250a4[_0x00c8('0x32')]=qs[_0x00c8('0x33')](_0x41f728[_0x00c8('0x2c')][_0x00c8('0x33')]);_0x4250a4['where']=qs[_0x00c8('0x2e')](_['pick'](_0x41f728[_0x00c8('0x2c')],_0x14792b[_0x00c8('0x2e')]),_0x4d23ff);if(_0x41f728['query']['filter']){_0x4250a4[_0x00c8('0x34')]=_[_0x00c8('0x35')](_0x4250a4[_0x00c8('0x34')],{'$or':_['map'](_0x4d23ff,function(_0x52a4c6){if(_0x52a4c6[_0x00c8('0x29')]!==_0x00c8('0x36')){var _0x3700ab={};_0x3700ab[_0x52a4c6['name']]={'$like':'%'+_0x41f728[_0x00c8('0x2c')]['filter']+'%'};return _0x3700ab;}})});}_0x4250a4=_[_0x00c8('0x35')]({},_0x4250a4,_0x41f728[_0x00c8('0x37')]);var _0xa38f3b={'where':_0x4250a4[_0x00c8('0x34')]};return db[_0x00c8('0x28')]['count'](_0xa38f3b)[_0x00c8('0x25')](function(_0x24c9d0){_0x4e1c21[_0x00c8('0x1b')]=_0x24c9d0;if(_0x41f728['query'][_0x00c8('0x38')]){_0x4250a4[_0x00c8('0x39')]=[{'all':!![]}];}return db[_0x00c8('0x28')][_0x00c8('0x3a')](_0x4250a4);})[_0x00c8('0x25')](function(_0x5214b5){_0x4e1c21[_0x00c8('0x3b')]=_0x5214b5;return _0x4e1c21;})[_0x00c8('0x25')](respondWithFilteredResult(_0x36642e,_0x4250a4))[_0x00c8('0x3c')](handleError(_0x36642e,null));};exports[_0x00c8('0x3d')]=function(_0x4b6cee,_0x515828){var _0x318ff3={'raw':!![],'where':{'id':_0x4b6cee[_0x00c8('0x3e')]['id']}},_0x232df2={};_0x232df2['model']=_[_0x00c8('0x2d')](db[_0x00c8('0x28')]['rawAttributes']);_0x232df2[_0x00c8('0x2c')]=_[_0x00c8('0x2d')](_0x4b6cee['query']);_0x232df2[_0x00c8('0x2e')]=_['intersection'](_0x232df2[_0x00c8('0x2b')],_0x232df2[_0x00c8('0x2c')]);_0x318ff3[_0x00c8('0x2f')]=_[_0x00c8('0x30')](_0x232df2[_0x00c8('0x2b')],qs['fields'](_0x4b6cee[_0x00c8('0x2c')][_0x00c8('0x3f')]));_0x318ff3[_0x00c8('0x2f')]=_0x318ff3[_0x00c8('0x2f')][_0x00c8('0x40')]?_0x318ff3[_0x00c8('0x2f')]:_0x232df2[_0x00c8('0x2b')];if(_0x4b6cee[_0x00c8('0x2c')][_0x00c8('0x38')]){_0x318ff3[_0x00c8('0x39')]=[{'all':!![]}];}_0x318ff3=_[_0x00c8('0x35')]({},_0x318ff3,_0x4b6cee[_0x00c8('0x37')]);return db[_0x00c8('0x28')]['find'](_0x318ff3)[_0x00c8('0x25')](handleEntityNotFound(_0x515828,null))[_0x00c8('0x25')](respondWithResult(_0x515828,null))[_0x00c8('0x3c')](handleError(_0x515828,null));};exports[_0x00c8('0x41')]=function(_0x1ee4d5,_0x178590){return db[_0x00c8('0x28')][_0x00c8('0x41')](_0x1ee4d5['body'],{})[_0x00c8('0x25')](respondWithResult(_0x178590,0xc9))[_0x00c8('0x3c')](handleError(_0x178590,null));};exports[_0x00c8('0x23')]=function(_0x3c115c,_0x5dbbf5){if(_0x3c115c['body']['id']){delete _0x3c115c['body']['id'];}return db[_0x00c8('0x28')][_0x00c8('0x42')]({'where':{'id':_0x3c115c['params']['id']}})[_0x00c8('0x25')](handleEntityNotFound(_0x5dbbf5,null))['then'](saveUpdates(_0x3c115c[_0x00c8('0x43')],null))[_0x00c8('0x25')](respondWithResult(_0x5dbbf5,null))[_0x00c8('0x3c')](handleError(_0x5dbbf5,null));};exports[_0x00c8('0x24')]=function(_0x456480,_0x40391c){return db[_0x00c8('0x28')][_0x00c8('0x42')]({'where':{'id':_0x456480[_0x00c8('0x3e')]['id']}})[_0x00c8('0x25')](handleEntityNotFound(_0x40391c,null))[_0x00c8('0x25')](removeEntity(_0x40391c,null))[_0x00c8('0x3c')](handleError(_0x40391c,null));};exports[_0x00c8('0x44')]=function(_0x145dc7,_0x15f005){return db['FaxTransferReport'][_0x00c8('0x44')]()[_0x00c8('0x25')](respondWithResult(_0x15f005,null))[_0x00c8('0x3c')](handleError(_0x15f005,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 2ea8b55..a805cd2 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 _0xd547=['moment','bluebird','request-promise','path','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x36e913,_0x5620a4){var _0x3d52b0=function(_0x13456a){while(--_0x13456a){_0x36e913['push'](_0x36e913['shift']());}};_0x3d52b0(++_0x5620a4);}(_0xd547,0x1a9));var _0x7d54=function(_0x18a81a,_0x4fc65b){_0x18a81a=_0x18a81a-0x0;var _0x114027=_0xd547[_0x18a81a];return _0x114027;};'use strict';var _=require(_0x7d54('0x0'));var util=require(_0x7d54('0x1'));var logger=require(_0x7d54('0x2'))(_0x7d54('0x3'));var moment=require(_0x7d54('0x4'));var BPromise=require(_0x7d54('0x5'));var rp=require(_0x7d54('0x6'));var fs=require('fs');var path=require(_0x7d54('0x7'));var rimraf=require(_0x7d54('0x8'));var config=require('../../config/environment');var attributes=require(_0x7d54('0x9'));module[_0x7d54('0xa')]=function(_0x28d24a,_0x128523){return _0x28d24a['define'](_0x7d54('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x7d54('0xc'),'fields':[_0x7d54('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x737b=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x144009,_0x43c8e7){var _0x1b275c=function(_0x59f9bd){while(--_0x59f9bd){_0x144009['push'](_0x144009['shift']());}};_0x1b275c(++_0x43c8e7);}(_0x737b,0x16c));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb737('0x0'));var util=require(_0xb737('0x1'));var logger=require('../../config/logger')(_0xb737('0x2'));var moment=require(_0xb737('0x3'));var BPromise=require(_0xb737('0x4'));var rp=require(_0xb737('0x5'));var fs=require('fs');var path=require(_0xb737('0x6'));var rimraf=require(_0xb737('0x7'));var config=require(_0xb737('0x8'));var attributes=require(_0xb737('0x9'));module[_0xb737('0xa')]=function(_0x3a718e,_0x1c1cf4){return _0x3a718e[_0xb737('0xb')](_0xb737('0xc'),attributes,{'tableName':_0xb737('0xd'),'paranoid':![],'indexes':[{'name':_0xb737('0xe'),'fields':[_0xb737('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index c9794d8..6f98ba9 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 _0x8e9f=['jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x8e9f,0x1c6));var _0xf8e9=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x8e9f[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0xf8e9('0x0'));var util=require(_0xf8e9('0x1'));var moment=require(_0xf8e9('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8e9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e9('0x5'))(_0xf8e9('0x6'));var config=require(_0xf8e9('0x7'));var jayson=require(_0xf8e9('0x8'));var client=jayson[_0xf8e9('0x9')][_0xf8e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d98e5,_0xbc89de,_0x303e7c){return new BPromise(function(_0x150bf4,_0x5e19bd){return client[_0xf8e9('0xb')](_0x3d98e5,_0x303e7c)['then'](function(_0x43a784){logger['info'](_0xf8e9('0xc'),_0xbc89de,_0xf8e9('0xd'));logger['debug'](_0xf8e9('0xe'),_0xbc89de,_0xf8e9('0xd'),JSON[_0xf8e9('0xf')](_0x43a784));if(_0x43a784[_0xf8e9('0x10')]){if(_0x43a784[_0xf8e9('0x10')][_0xf8e9('0x11')]===0x1f4){logger[_0xf8e9('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0xbc89de,_0x43a784[_0xf8e9('0x10')][_0xf8e9('0x12')]);return _0x5e19bd(_0x43a784[_0xf8e9('0x10')][_0xf8e9('0x12')]);}logger[_0xf8e9('0x10')](_0xf8e9('0xc'),_0xbc89de,_0x43a784['error'][_0xf8e9('0x12')]);return _0x150bf4(_0x43a784[_0xf8e9('0x10')][_0xf8e9('0x12')]);}else{logger[_0xf8e9('0x13')](_0xf8e9('0xc'),_0xbc89de,'request\x20sent');_0x150bf4(_0x43a784[_0xf8e9('0x14')][_0xf8e9('0x12')]);}})[_0xf8e9('0x15')](function(_0x31e261){logger['error'](_0xf8e9('0xc'),_0xbc89de,_0x31e261);_0x5e19bd(_0x31e261);});});} \ No newline at end of file +var _0xbfc2=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a15ce,_0x5f0345){var _0x57cd6b=function(_0xa66edf){while(--_0xa66edf){_0x3a15ce['push'](_0x3a15ce['shift']());}};_0x57cd6b(++_0x5f0345);}(_0xbfc2,0xed));var _0x2bfc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xbfc2[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x2bfc('0x0'));var util=require(_0x2bfc('0x1'));var moment=require(_0x2bfc('0x2'));var BPromise=require(_0x2bfc('0x3'));var rs=require(_0x2bfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2bfc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2bfc('0x6')][_0x2bfc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19d2f1,_0x2b07ff,_0x353ffc){return new BPromise(function(_0x35c066,_0x25c8e9){return client[_0x2bfc('0x8')](_0x19d2f1,_0x353ffc)[_0x2bfc('0x9')](function(_0x2c0662){logger['info'](_0x2bfc('0xa'),_0x2b07ff,_0x2bfc('0xb'));logger[_0x2bfc('0xc')](_0x2bfc('0xd'),_0x2b07ff,_0x2bfc('0xb'),JSON[_0x2bfc('0xe')](_0x2c0662));if(_0x2c0662['error']){if(_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x10')]===0x1f4){logger[_0x2bfc('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2b07ff,_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x11')]);return _0x25c8e9(_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x11')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2b07ff,_0x2c0662[_0x2bfc('0xf')]['message']);return _0x35c066(_0x2c0662[_0x2bfc('0xf')][_0x2bfc('0x11')]);}else{logger[_0x2bfc('0x12')](_0x2bfc('0xa'),_0x2b07ff,_0x2bfc('0xb'));_0x35c066(_0x2c0662[_0x2bfc('0x13')][_0x2bfc('0x11')]);}})[_0x2bfc('0x14')](function(_0x51a1c8){logger[_0x2bfc('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2b07ff,_0x51a1c8);_0x25c8e9(_0x51a1c8);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 70d15ee..517963f 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 _0x2d91=['isAuthenticated','show','post','put','update','destroy','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/describe','describe','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2d91,0xa6));var _0x12d9=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x2d91[_0x1e3c16];return _0x47a0c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x12d9('0x0'));var timeout=require(_0x12d9('0x1'));var express=require('express');var router=express[_0x12d9('0x2')]();var fs_extra=require(_0x12d9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x12d9('0x4'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x12d9('0x5')]('/',auth['isAuthenticated'](),controller[_0x12d9('0x6')]);router['get'](_0x12d9('0x7'),auth['isAuthenticated'](),controller[_0x12d9('0x8')]);router[_0x12d9('0x5')](_0x12d9('0x9'),auth[_0x12d9('0xa')](),controller[_0x12d9('0xb')]);router[_0x12d9('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x12d9('0xd')](_0x12d9('0x9'),auth['isAuthenticated'](),controller[_0x12d9('0xe')]);router['delete']('/:id',auth[_0x12d9('0xa')](),controller[_0x12d9('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4e43=['/:id','show','create','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x31bab2,_0x107288){var _0x242e5b=function(_0x85b342){while(--_0x85b342){_0x31bab2['push'](_0x31bab2['shift']());}};_0x242e5b(++_0x107288);}(_0x4e43,0x149));var _0x34e4=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0x4e43[_0x3f22e8];return _0x368a7e;};'use strict';var multer=require('multer');var util=require(_0x34e4('0x0'));var path=require(_0x34e4('0x1'));var timeout=require(_0x34e4('0x2'));var express=require(_0x34e4('0x3'));var router=express[_0x34e4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34e4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x34e4('0x6'));var controller=require(_0x34e4('0x7'));router[_0x34e4('0x8')]('/',auth[_0x34e4('0x9')](),controller[_0x34e4('0xa')]);router[_0x34e4('0x8')](_0x34e4('0xb'),auth[_0x34e4('0x9')](),controller[_0x34e4('0xc')]);router[_0x34e4('0x8')](_0x34e4('0xd'),auth[_0x34e4('0x9')](),controller[_0x34e4('0xe')]);router['post']('/',auth[_0x34e4('0x9')](),controller[_0x34e4('0xf')]);router['put'](_0x34e4('0xd'),auth[_0x34e4('0x9')](),controller['update']);router[_0x34e4('0x10')](_0x34e4('0xd'),auth[_0x34e4('0x9')](),controller[_0x34e4('0x11')]);module[_0x34e4('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a22a017..d2c5456 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 _0xa5c8=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x4bd42a,_0x550d78){var _0x2ea4e2=function(_0x5ab6b8){while(--_0x5ab6b8){_0x4bd42a['push'](_0x4bd42a['shift']());}};_0x2ea4e2(++_0x550d78);}(_0xa5c8,0x10d));var _0x8a5c=function(_0x5809e8,_0xf4f104){_0x5809e8=_0x5809e8-0x0;var _0x230453=_0xa5c8[_0x5809e8];return _0x230453;};'use strict';var multer=require(_0x8a5c('0x0'));var util=require(_0x8a5c('0x1'));var path=require(_0x8a5c('0x2'));var timeout=require(_0x8a5c('0x3'));var express=require(_0x8a5c('0x4'));var router=express['Router']();var fs_extra=require(_0x8a5c('0x5'));var auth=require(_0x8a5c('0x6'));var interaction=require(_0x8a5c('0x7'));var config=require(_0x8a5c('0x8'));var controller=require('./intDeskAccount.controller');router[_0x8a5c('0x9')]('/',auth[_0x8a5c('0xa')](),controller[_0x8a5c('0xb')]);router[_0x8a5c('0x9')](_0x8a5c('0xc'),auth[_0x8a5c('0xa')](),controller[_0x8a5c('0xd')]);router[_0x8a5c('0x9')](_0x8a5c('0xe'),auth[_0x8a5c('0xa')](),controller[_0x8a5c('0xf')]);router['get'](_0x8a5c('0x10'),auth[_0x8a5c('0xa')](),controller[_0x8a5c('0x11')]);router[_0x8a5c('0x12')]('/',auth['isAuthenticated'](),controller[_0x8a5c('0x13')]);router[_0x8a5c('0x12')](_0x8a5c('0xe'),auth[_0x8a5c('0xa')](),controller['addConfiguration']);router[_0x8a5c('0x14')](_0x8a5c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8a5c('0x15')]('/:id',auth[_0x8a5c('0xa')](),controller[_0x8a5c('0x16')]);module[_0x8a5c('0x17')]=router; \ No newline at end of file +var _0x43fe=['destroy','exports','multer','path','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x186188,_0x329ead){var _0x4d70e6=function(_0x4e71b9){while(--_0x4e71b9){_0x186188['push'](_0x186188['shift']());}};_0x4d70e6(++_0x329ead);}(_0x43fe,0x9c));var _0xe43f=function(_0x4aa2c8,_0x44a256){_0x4aa2c8=_0x4aa2c8-0x0;var _0xf2893e=_0x43fe[_0x4aa2c8];return _0xf2893e;};'use strict';var multer=require(_0xe43f('0x0'));var util=require('util');var path=require(_0xe43f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe43f('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe43f('0x3'));var config=require(_0xe43f('0x4'));var controller=require(_0xe43f('0x5'));router[_0xe43f('0x6')]('/',auth[_0xe43f('0x7')](),controller[_0xe43f('0x8')]);router[_0xe43f('0x6')](_0xe43f('0x9'),auth[_0xe43f('0x7')](),controller['show']);router['get'](_0xe43f('0xa'),auth[_0xe43f('0x7')](),controller[_0xe43f('0xb')]);router[_0xe43f('0x6')](_0xe43f('0xc'),auth[_0xe43f('0x7')](),controller[_0xe43f('0xd')]);router[_0xe43f('0xe')]('/',auth[_0xe43f('0x7')](),controller[_0xe43f('0xf')]);router['post']('/:id/configurations',auth[_0xe43f('0x7')](),controller[_0xe43f('0x10')]);router[_0xe43f('0x11')]('/:id',auth[_0xe43f('0x7')](),controller[_0xe43f('0x12')]);router[_0xe43f('0x13')](_0xe43f('0x9'),auth[_0xe43f('0x7')](),controller[_0xe43f('0x14')]);module[_0xe43f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index fa1e242..669cf54 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 _0x7a2c=['ENUM','integrationTab','newTab','sequelize','STRING','basic'];(function(_0x57494e,_0x2c4d3d){var _0x4099da=function(_0x38c521){while(--_0x38c521){_0x57494e['push'](_0x57494e['shift']());}};_0x4099da(++_0x2c4d3d);}(_0x7a2c,0x1c5));var _0xc7a2=function(_0x5d5227,_0xb556e){_0x5d5227=_0x5d5227-0x0;var _0x334724=_0x7a2c[_0x5d5227];return _0x334724;};'use strict';var Sequelize=require(_0xc7a2('0x0'));module['exports']={'name':{'type':Sequelize[_0xc7a2('0x1')]},'description':{'type':Sequelize[_0xc7a2('0x1')]},'username':{'type':Sequelize[_0xc7a2('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xc7a2('0x2')),'defaultValue':_0xc7a2('0x2')},'password':{'type':Sequelize[_0xc7a2('0x1')]},'consumerKey':{'type':Sequelize[_0xc7a2('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc7a2('0x1')]},'tokenSecret':{'type':Sequelize[_0xc7a2('0x1')]},'serverUrl':{'type':Sequelize[_0xc7a2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc7a2('0x3')](_0xc7a2('0x4'),_0xc7a2('0x5')),'defaultValue':_0xc7a2('0x4')}}; \ No newline at end of file +var _0x3cbf=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0xe2a016,_0x493eef){var _0x5aece2=function(_0x4926eb){while(--_0x4926eb){_0xe2a016['push'](_0xe2a016['shift']());}};_0x5aece2(++_0x493eef);}(_0x3cbf,0x163));var _0xf3cb=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x3cbf[_0x14a862];return _0x245eb5;};'use strict';var Sequelize=require(_0xf3cb('0x0'));module[_0xf3cb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf3cb('0x2')]},'username':{'type':Sequelize[_0xf3cb('0x2')]},'remoteUri':{'type':Sequelize[_0xf3cb('0x2')]},'authType':{'type':Sequelize[_0xf3cb('0x3')](_0xf3cb('0x4')),'defaultValue':_0xf3cb('0x4')},'password':{'type':Sequelize[_0xf3cb('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xf3cb('0x2')]},'tokenSecret':{'type':Sequelize[_0xf3cb('0x2')]},'serverUrl':{'type':Sequelize[_0xf3cb('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf3cb('0x5'),_0xf3cb('0x6')),'defaultValue':_0xf3cb('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1051fd4..3a7acc7 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 _0x57dc=['statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','show','params','include','catch','create','body','find','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','priority','remoteUri','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','headers','%s:%s','password','toString','base64','concat','_embedded','active','label','test'];(function(_0x4fbd10,_0x131d69){var _0x63e2f9=function(_0x4dd05e){while(--_0x4dd05e){_0x4fbd10['push'](_0x4fbd10['shift']());}};_0x63e2f9(++_0x131d69);}(_0x57dc,0x1c5));var _0xc57d=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x57dc[_0x1ae4a9];return _0x54d0b0;};'use strict';var emlformat=require(_0xc57d('0x0'));var rimraf=require(_0xc57d('0x1'));var zipdir=require(_0xc57d('0x2'));var jsonpatch=require(_0xc57d('0x3'));var rp=require('request-promise');var moment=require(_0xc57d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc57d('0x5'));var util=require(_0xc57d('0x6'));var path=require(_0xc57d('0x7'));var sox=require(_0xc57d('0x8'));var csv=require(_0xc57d('0x9'));var ejs=require(_0xc57d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc57d('0xb'));var squel=require('squel');var crypto=require(_0xc57d('0xc'));var jsforce=require(_0xc57d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc57d('0x9'));var querystring=require(_0xc57d('0xe'));var Papa=require('papaparse');var Redis=require(_0xc57d('0xf'));var authService=require(_0xc57d('0x10'));var qs=require(_0xc57d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc57d('0x12'));var logger=require('../../config/logger')(_0xc57d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc57d('0x14'));var db=require(_0xc57d('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x201bc4,_0x467918){_0x467918=_0x467918||0xcc;return function(_0x194f34){if(_0x194f34){return _0x201bc4['sendStatus'](_0x467918);}return _0x201bc4[_0xc57d('0x16')](_0x467918)[_0xc57d('0x17')]();};}function respondWithResult(_0x1da4df,_0x1d6ca1){_0x1d6ca1=_0x1d6ca1||0xc8;return function(_0x3eb98e){if(_0x3eb98e){return _0x1da4df[_0xc57d('0x16')](_0x1d6ca1)[_0xc57d('0x18')](_0x3eb98e);}};}function respondWithFilteredResult(_0x454a49,_0x432cfe){return function(_0xdb4bd9){if(_0xdb4bd9){var _0x3751f3=typeof _0x432cfe[_0xc57d('0x19')]===_0xc57d('0x1a')&&typeof _0x432cfe[_0xc57d('0x1b')]==='undefined';var _0x3d06cf=_0xdb4bd9[_0xc57d('0x1c')];var _0x52df81=_0x3751f3?0x0:_0x432cfe['offset'];var _0x29e2a9=_0x3751f3?_0xdb4bd9[_0xc57d('0x1c')]:_0x432cfe[_0xc57d('0x19')]+_0x432cfe[_0xc57d('0x1b')];var _0x213a53;if(_0x29e2a9>=_0x3d06cf){_0x29e2a9=_0x3d06cf;_0x213a53=0xc8;}else{_0x213a53=0xce;}_0x454a49[_0xc57d('0x16')](_0x213a53);return _0x454a49[_0xc57d('0x1d')](_0xc57d('0x1e'),_0x52df81+'-'+_0x29e2a9+'/'+_0x3d06cf)[_0xc57d('0x18')](_0xdb4bd9);}return null;};}function patchUpdates(_0x26ce24){return function(_0x1b16af){try{jsonpatch[_0xc57d('0x1f')](_0x1b16af,_0x26ce24,!![]);}catch(_0x132b8b){return BPromise[_0xc57d('0x20')](_0x132b8b);}return _0x1b16af[_0xc57d('0x21')]();};}function saveUpdates(_0x5076fe,_0x29d687){return function(_0x18a813){if(_0x18a813){return _0x18a813[_0xc57d('0x22')](_0x5076fe)[_0xc57d('0x23')](function(_0x54bf89){return _0x54bf89;});}return null;};}function removeEntity(_0x1a4b9f,_0x2e1648){return function(_0x106127){if(_0x106127){return _0x106127[_0xc57d('0x24')]()[_0xc57d('0x23')](function(){_0x1a4b9f[_0xc57d('0x16')](0xcc)[_0xc57d('0x17')]();});}};}function handleEntityNotFound(_0x1dd4d4,_0x133f67){return function(_0x12dee3){if(!_0x12dee3){_0x1dd4d4[_0xc57d('0x25')](0x194);}return _0x12dee3;};}function handleError(_0x4b3342,_0x2f549e){_0x2f549e=_0x2f549e||0x1f4;return function(_0x4a93c9){logger['error'](_0x4a93c9[_0xc57d('0x26')]);if(_0x4a93c9[_0xc57d('0x27')]){delete _0x4a93c9[_0xc57d('0x27')];}_0x4b3342[_0xc57d('0x16')](_0x2f549e)[_0xc57d('0x28')](_0x4a93c9);};}exports[_0xc57d('0x29')]=function(_0x4d4bc8,_0x114ddc){var _0x478b94={},_0x33cab6={},_0x1a2c49={'count':0x0,'rows':[]};var _0x392f23=_[_0xc57d('0x2a')](db[_0xc57d('0x2b')][_0xc57d('0x2c')],function(_0x85a494){return{'name':_0x85a494[_0xc57d('0x2d')],'type':_0x85a494['type']['key']};});_0x33cab6[_0xc57d('0x2e')]=_[_0xc57d('0x2a')](_0x392f23,'name');_0x33cab6[_0xc57d('0x2f')]=_[_0xc57d('0x30')](_0x4d4bc8[_0xc57d('0x2f')]);_0x33cab6[_0xc57d('0x31')]=_['intersection'](_0x33cab6[_0xc57d('0x2e')],_0x33cab6[_0xc57d('0x2f')]);_0x478b94[_0xc57d('0x32')]=_[_0xc57d('0x33')](_0x33cab6[_0xc57d('0x2e')],qs[_0xc57d('0x34')](_0x4d4bc8[_0xc57d('0x2f')][_0xc57d('0x34')]));_0x478b94[_0xc57d('0x32')]=_0x478b94['attributes'][_0xc57d('0x35')]?_0x478b94['attributes']:_0x33cab6[_0xc57d('0x2e')];if(!_0x4d4bc8['query']['hasOwnProperty'](_0xc57d('0x36'))){_0x478b94[_0xc57d('0x1b')]=qs[_0xc57d('0x1b')](_0x4d4bc8[_0xc57d('0x2f')][_0xc57d('0x1b')]);_0x478b94[_0xc57d('0x19')]=qs['offset'](_0x4d4bc8['query'][_0xc57d('0x19')]);}_0x478b94[_0xc57d('0x37')]=qs[_0xc57d('0x38')](_0x4d4bc8[_0xc57d('0x2f')]['sort']);_0x478b94['where']=qs['filters'](_[_0xc57d('0x39')](_0x4d4bc8[_0xc57d('0x2f')],_0x33cab6[_0xc57d('0x31')]),_0x392f23);if(_0x4d4bc8[_0xc57d('0x2f')][_0xc57d('0x3a')]){_0x478b94[_0xc57d('0x3b')]=_[_0xc57d('0x3c')](_0x478b94[_0xc57d('0x3b')],{'$or':_[_0xc57d('0x2a')](_0x392f23,function(_0x32f1e8){if(_0x32f1e8[_0xc57d('0x3d')]!=='VIRTUAL'){var _0x2d8880={};_0x2d8880[_0x32f1e8[_0xc57d('0x27')]]={'$like':'%'+_0x4d4bc8[_0xc57d('0x2f')][_0xc57d('0x3a')]+'%'};return _0x2d8880;}})});}_0x478b94=_[_0xc57d('0x3c')]({},_0x478b94,_0x4d4bc8[_0xc57d('0x3e')]);var _0x5dab1f={'where':_0x478b94['where']};return db[_0xc57d('0x2b')][_0xc57d('0x1c')](_0x5dab1f)[_0xc57d('0x23')](function(_0x340726){_0x1a2c49[_0xc57d('0x1c')]=_0x340726;if(_0x4d4bc8[_0xc57d('0x2f')][_0xc57d('0x3f')]){_0x478b94['include']=[{'all':!![]}];}return db['DeskAccount'][_0xc57d('0x40')](_0x478b94);})[_0xc57d('0x23')](function(_0x1de33c){_0x1a2c49['rows']=_0x1de33c;return _0x1a2c49;})[_0xc57d('0x23')](respondWithFilteredResult(_0x114ddc,_0x478b94))['catch'](handleError(_0x114ddc,null));};exports[_0xc57d('0x41')]=function(_0x21b091,_0x3ecd58){var _0x1a901b={'raw':![],'where':{'id':_0x21b091[_0xc57d('0x42')]['id']}},_0x56a125={};_0x56a125[_0xc57d('0x2e')]=_[_0xc57d('0x30')](db[_0xc57d('0x2b')][_0xc57d('0x2c')]);_0x56a125['query']=_[_0xc57d('0x30')](_0x21b091[_0xc57d('0x2f')]);_0x56a125[_0xc57d('0x31')]=_['intersection'](_0x56a125[_0xc57d('0x2e')],_0x56a125['query']);_0x1a901b[_0xc57d('0x32')]=_[_0xc57d('0x33')](_0x56a125['model'],qs[_0xc57d('0x34')](_0x21b091[_0xc57d('0x2f')][_0xc57d('0x34')]));_0x1a901b['attributes']=_0x1a901b['attributes']['length']?_0x1a901b[_0xc57d('0x32')]:_0x56a125['model'];if(_0x21b091[_0xc57d('0x2f')]['includeAll']){_0x1a901b[_0xc57d('0x43')]=[{'all':!![]}];}_0x1a901b=_['merge']({},_0x1a901b,_0x21b091['options']);return db[_0xc57d('0x2b')]['find'](_0x1a901b)[_0xc57d('0x23')](handleEntityNotFound(_0x3ecd58,null))[_0xc57d('0x23')](respondWithResult(_0x3ecd58,null))[_0xc57d('0x44')](handleError(_0x3ecd58,null));};exports[_0xc57d('0x45')]=function(_0x3f2eef,_0x48eed8){return db['DeskAccount'][_0xc57d('0x45')](_0x3f2eef[_0xc57d('0x46')],{})[_0xc57d('0x23')](respondWithResult(_0x48eed8,0xc9))[_0xc57d('0x44')](handleError(_0x48eed8,null));};exports[_0xc57d('0x22')]=function(_0x1d8ff9,_0x4d6717){if(_0x1d8ff9['body']['id']){delete _0x1d8ff9[_0xc57d('0x46')]['id'];}return db[_0xc57d('0x2b')]['find']({'where':{'id':_0x1d8ff9[_0xc57d('0x42')]['id']}})[_0xc57d('0x23')](handleEntityNotFound(_0x4d6717,null))['then'](saveUpdates(_0x1d8ff9[_0xc57d('0x46')],null))['then'](respondWithResult(_0x4d6717,null))[_0xc57d('0x44')](handleError(_0x4d6717,null));};exports[_0xc57d('0x24')]=function(_0xab960b,_0x456549){return db['DeskAccount'][_0xc57d('0x47')]({'where':{'id':_0xab960b[_0xc57d('0x42')]['id']}})['then'](handleEntityNotFound(_0x456549,null))['then'](removeEntity(_0x456549,null))[_0xc57d('0x44')](handleError(_0x456549,null));};exports[_0xc57d('0x48')]=function(_0x33f79b,_0x272ea7,_0x5c214d){var _0x4dea25={};var _0x39366b={};var _0x102c32;var _0x44324c;return db[_0xc57d('0x2b')][_0xc57d('0x49')]({'where':{'id':_0x33f79b['params']['id']}})[_0xc57d('0x23')](handleEntityNotFound(_0x272ea7,null))[_0xc57d('0x23')](function(_0x48d087){if(_0x48d087){_0x102c32=_0x48d087;_0x39366b['model']=_['keys'](db['DeskConfiguration'][_0xc57d('0x2c')]);_0x39366b[_0xc57d('0x2f')]=_[_0xc57d('0x30')](_0x33f79b['query']);_0x39366b['filters']=_['intersection'](_0x39366b[_0xc57d('0x2e')],_0x39366b['query']);_0x4dea25[_0xc57d('0x32')]=_[_0xc57d('0x33')](_0x39366b[_0xc57d('0x2e')],qs[_0xc57d('0x34')](_0x33f79b[_0xc57d('0x2f')]['fields']));_0x4dea25[_0xc57d('0x32')]=_0x4dea25[_0xc57d('0x32')][_0xc57d('0x35')]?_0x4dea25[_0xc57d('0x32')]:_0x39366b['model'];_0x4dea25[_0xc57d('0x37')]=qs[_0xc57d('0x38')](_0x33f79b[_0xc57d('0x2f')][_0xc57d('0x38')]);_0x4dea25[_0xc57d('0x3b')]=qs[_0xc57d('0x31')](_['pick'](_0x33f79b[_0xc57d('0x2f')],_0x39366b[_0xc57d('0x31')]));if(_0x33f79b[_0xc57d('0x2f')][_0xc57d('0x3a')]){_0x4dea25[_0xc57d('0x3b')]=_[_0xc57d('0x3c')](_0x4dea25[_0xc57d('0x3b')],{'$or':_[_0xc57d('0x2a')](_0x4dea25[_0xc57d('0x32')],function(_0xd6c670){var _0x52da83={};_0x52da83[_0xd6c670]={'$like':'%'+_0x33f79b[_0xc57d('0x2f')]['filter']+'%'};return _0x52da83;})});}_0x4dea25=_[_0xc57d('0x3c')]({},_0x4dea25,_0x33f79b[_0xc57d('0x3e')]);return _0x102c32[_0xc57d('0x48')](_0x4dea25);}})[_0xc57d('0x23')](function(_0x1a3651){if(_0x1a3651){_0x44324c=_0x1a3651['length'];if(!_0x33f79b[_0xc57d('0x2f')][_0xc57d('0x4a')]('nolimit')){_0x4dea25[_0xc57d('0x1b')]=qs[_0xc57d('0x1b')](_0x33f79b[_0xc57d('0x2f')][_0xc57d('0x1b')]);_0x4dea25[_0xc57d('0x19')]=qs[_0xc57d('0x19')](_0x33f79b['query'][_0xc57d('0x19')]);}return _0x102c32[_0xc57d('0x48')](_0x4dea25);}})[_0xc57d('0x23')](function(_0x1a6e4f){if(_0x1a6e4f){return _0x1a6e4f?{'count':_0x44324c,'rows':_0x1a6e4f}:null;}})[_0xc57d('0x23')](respondWithResult(_0x272ea7,null))[_0xc57d('0x44')](handleError(_0x272ea7,null));};exports[_0xc57d('0x4b')]=function(_0x18cdcf,_0x5c190f,_0x5339aa){if(_0x18cdcf['body']['id']){delete _0x18cdcf[_0xc57d('0x46')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x18cdcf[_0xc57d('0x42')]['id']}})[_0xc57d('0x23')](handleEntityNotFound(_0x5c190f,null))[_0xc57d('0x23')](function(_0x11c6cd){if(_0x11c6cd){_0x18cdcf['body'][_0xc57d('0x4c')]=_0x11c6cd['id'];_0x18cdcf[_0xc57d('0x46')][_0xc57d('0x4d')]=integrations[_0xc57d('0x4e')](_0x18cdcf['body'][_0xc57d('0x4f')],_0x18cdcf['body'][_0xc57d('0x3d')]);_0x18cdcf[_0xc57d('0x46')][_0xc57d('0x50')]=integrations[_0xc57d('0x51')](_0x18cdcf['body'][_0xc57d('0x4f')],_0x18cdcf[_0xc57d('0x46')][_0xc57d('0x3d')]);return db[_0xc57d('0x52')][_0xc57d('0x45')](_0x18cdcf[_0xc57d('0x46')],{'include':[{'model':db[_0xc57d('0x53')],'as':_0xc57d('0x4d')},{'model':db[_0xc57d('0x53')],'as':_0xc57d('0x50')}]});}return null;})[_0xc57d('0x23')](respondWithResult(_0x5c190f,null))[_0xc57d('0x44')](handleError(_0x5c190f,null));};exports['getFields']=function(_0xde150a,_0x58ff6f,_0x52b476){var _0x35dc40=[{'name':_0xc57d('0x54'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xa026ef='';return db['DeskAccount'][_0xc57d('0x49')]({'where':{'id':_0xde150a[_0xc57d('0x42')]['id']},'attributes':['id',_0xc57d('0x55'),'authType',_0xc57d('0x56'),'password',_0xc57d('0x57'),_0xc57d('0x58'),_0xc57d('0x59'),_0xc57d('0x5a')]})[_0xc57d('0x23')](handleEntityNotFound(_0x58ff6f,null))[_0xc57d('0x23')](function(_0x1e9162){if(_0x1e9162){_0xa026ef=_0x1e9162[_0xc57d('0x55')];var _0x345d17=_0xa026ef['slice'](-0x1);if(_0x345d17==='/'){_0xa026ef=_0xa026ef[_0xc57d('0x5b')](0x0,_0xa026ef[_0xc57d('0x5c')](_0x345d17));}var _0x50449b={'method':'GET','uri':util[_0xc57d('0x5d')](_0xc57d('0x5e'),_0xa026ef),'headers':{'Content-Type':_0xc57d('0x5f'),'Accept':'application/json'},'json':!![]};if(_0x1e9162[_0xc57d('0x60')]==='basic'){_0x50449b[_0xc57d('0x61')]['Authorization']=util[_0xc57d('0x5d')]('Basic\x20%s',new Buffer(util[_0xc57d('0x5d')](_0xc57d('0x62'),_0x1e9162[_0xc57d('0x56')],_0x1e9162[_0xc57d('0x63')]))[_0xc57d('0x64')](_0xc57d('0x65')));}return rp(_0x50449b)[_0xc57d('0x23')](function(_0x37c85b){return _0x35dc40[_0xc57d('0x66')](_[_0xc57d('0x2a')](_0x37c85b[_0xc57d('0x67')]['entries'],function(_0x5d3ec3){return{'id':_0x5d3ec3[_0xc57d('0x27')],'name':_0x5d3ec3['name'],'type':_0x5d3ec3[_0xc57d('0x3d')],'active':_0x5d3ec3[_0xc57d('0x68')],'label':_0x5d3ec3[_0xc57d('0x69')],'custom':!![]};}));});}})[_0xc57d('0x23')](function(_0x2daf64){return{'count':_0x2daf64[_0xc57d('0x35')],'rows':_0x2daf64};})[_0xc57d('0x23')](respondWithResult(_0x58ff6f,null))[_0xc57d('0x44')](function(_0x1cf2bc){var _0x545135=_0xde150a[_0xc57d('0x2f')][_0xc57d('0x6a')]?0x1f4:_0x1cf2bc[_0xc57d('0x6b')]||0x1f4;logger[_0xc57d('0x6c')](_0xc57d('0x6d'),_0xc57d('0x6e'),_0x545135,JSON['stringify'](_0x1cf2bc));delete _0x1cf2bc[_0xc57d('0x27')];if(_0x545135===0x191){_0x545135=0x190;}_0x58ff6f[_0xc57d('0x16')](_0x545135)[_0xc57d('0x28')](_0xde150a[_0xc57d('0x2f')]['test']?{'message':_0xc57d('0x6f'),'statusCode':_0x1cf2bc[_0xc57d('0x6b')]}:_0x1cf2bc);});}; \ No newline at end of file +var _0x714f=['Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','toString','concat','entries','active','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','map','DeskAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','options','includeAll','include','findAll','show','params','rawAttributes','catch','create','body','update','find','destroy','getConfigurations','findOne','DeskConfiguration','filter','addConfiguration'];(function(_0x3ab88b,_0x5f53d6){var _0x5f4f78=function(_0x20636b){while(--_0x20636b){_0x3ab88b['push'](_0x3ab88b['shift']());}};_0x5f4f78(++_0x5f53d6);}(_0x714f,0x8e));var _0xf714=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0x714f[_0x3227c1];return _0x31fd48;};'use strict';var emlformat=require(_0xf714('0x0'));var rimraf=require(_0xf714('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf714('0x2'));var rp=require(_0xf714('0x3'));var moment=require(_0xf714('0x4'));var BPromise=require(_0xf714('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf714('0x6'));var csv=require(_0xf714('0x7'));var ejs=require(_0xf714('0x8'));var fs=require('fs');var fs_extra=require(_0xf714('0x9'));var _=require(_0xf714('0xa'));var squel=require('squel');var crypto=require(_0xf714('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf714('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf714('0xd'));var Papa=require(_0xf714('0xe'));var Redis=require(_0xf714('0xf'));var authService=require(_0xf714('0x10'));var qs=require(_0xf714('0x11'));var as=require(_0xf714('0x12'));var hardwareService=require(_0xf714('0x13'));var logger=require('../../config/logger')(_0xf714('0x14'));var utils=require(_0xf714('0x15'));var config=require(_0xf714('0x16'));var licenseUtil=require(_0xf714('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x268eb3,_0x15296){_0x15296=_0x15296||0xcc;return function(_0x8e2718){if(_0x8e2718){return _0x268eb3['sendStatus'](_0x15296);}return _0x268eb3[_0xf714('0x18')](_0x15296)[_0xf714('0x19')]();};}function respondWithResult(_0x532fc8,_0x26146a){_0x26146a=_0x26146a||0xc8;return function(_0x383abe){if(_0x383abe){return _0x532fc8['status'](_0x26146a)[_0xf714('0x1a')](_0x383abe);}};}function respondWithFilteredResult(_0x358005,_0x1eca32){return function(_0x19a186){if(_0x19a186){var _0x17bdbd=typeof _0x1eca32[_0xf714('0x1b')]===_0xf714('0x1c')&&typeof _0x1eca32['limit']==='undefined';var _0x32c6d5=_0x19a186['count'];var _0x1fd8bc=_0x17bdbd?0x0:_0x1eca32[_0xf714('0x1b')];var _0x4ff76d=_0x17bdbd?_0x19a186[_0xf714('0x1d')]:_0x1eca32[_0xf714('0x1b')]+_0x1eca32['limit'];var _0x2f44bb;if(_0x4ff76d>=_0x32c6d5){_0x4ff76d=_0x32c6d5;_0x2f44bb=0xc8;}else{_0x2f44bb=0xce;}_0x358005[_0xf714('0x18')](_0x2f44bb);return _0x358005['set'](_0xf714('0x1e'),_0x1fd8bc+'-'+_0x4ff76d+'/'+_0x32c6d5)[_0xf714('0x1a')](_0x19a186);}return null;};}function patchUpdates(_0x36694e){return function(_0x2b5142){try{jsonpatch[_0xf714('0x1f')](_0x2b5142,_0x36694e,!![]);}catch(_0x4af83f){return BPromise[_0xf714('0x20')](_0x4af83f);}return _0x2b5142[_0xf714('0x21')]();};}function saveUpdates(_0x224208,_0x419a9e){return function(_0x1bddc6){if(_0x1bddc6){return _0x1bddc6['update'](_0x224208)[_0xf714('0x22')](function(_0x125a1d){return _0x125a1d;});}return null;};}function removeEntity(_0x15d238,_0x5af086){return function(_0x12d8ca){if(_0x12d8ca){return _0x12d8ca['destroy']()[_0xf714('0x22')](function(){_0x15d238[_0xf714('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b580c,_0x723b9d){return function(_0x2b223c){if(!_0x2b223c){_0x3b580c[_0xf714('0x23')](0x194);}return _0x2b223c;};}function handleError(_0x40c4bb,_0xb7361f){_0xb7361f=_0xb7361f||0x1f4;return function(_0x4d5719){logger['error'](_0x4d5719[_0xf714('0x24')]);if(_0x4d5719['name']){delete _0x4d5719[_0xf714('0x25')];}_0x40c4bb[_0xf714('0x18')](_0xb7361f)[_0xf714('0x26')](_0x4d5719);};}exports[_0xf714('0x27')]=function(_0x2fc894,_0x46976c){var _0x4bff93={},_0xf0ab72={},_0x41633a={'count':0x0,'rows':[]};var _0x27fc3a=_[_0xf714('0x28')](db[_0xf714('0x29')]['rawAttributes'],function(_0x3f4aa8){return{'name':_0x3f4aa8[_0xf714('0x2a')],'type':_0x3f4aa8[_0xf714('0x2b')]['key']};});_0xf0ab72[_0xf714('0x2c')]=_[_0xf714('0x28')](_0x27fc3a,_0xf714('0x25'));_0xf0ab72[_0xf714('0x2d')]=_[_0xf714('0x2e')](_0x2fc894['query']);_0xf0ab72[_0xf714('0x2f')]=_[_0xf714('0x30')](_0xf0ab72[_0xf714('0x2c')],_0xf0ab72[_0xf714('0x2d')]);_0x4bff93[_0xf714('0x31')]=_[_0xf714('0x30')](_0xf0ab72[_0xf714('0x2c')],qs[_0xf714('0x32')](_0x2fc894[_0xf714('0x2d')]['fields']));_0x4bff93[_0xf714('0x31')]=_0x4bff93[_0xf714('0x31')][_0xf714('0x33')]?_0x4bff93[_0xf714('0x31')]:_0xf0ab72['model'];if(!_0x2fc894[_0xf714('0x2d')][_0xf714('0x34')](_0xf714('0x35'))){_0x4bff93[_0xf714('0x36')]=qs['limit'](_0x2fc894['query'][_0xf714('0x36')]);_0x4bff93[_0xf714('0x1b')]=qs[_0xf714('0x1b')](_0x2fc894[_0xf714('0x2d')][_0xf714('0x1b')]);}_0x4bff93[_0xf714('0x37')]=qs[_0xf714('0x38')](_0x2fc894[_0xf714('0x2d')][_0xf714('0x38')]);_0x4bff93[_0xf714('0x39')]=qs[_0xf714('0x2f')](_[_0xf714('0x3a')](_0x2fc894[_0xf714('0x2d')],_0xf0ab72[_0xf714('0x2f')]),_0x27fc3a);if(_0x2fc894['query']['filter']){_0x4bff93['where']=_[_0xf714('0x3b')](_0x4bff93[_0xf714('0x39')],{'$or':_[_0xf714('0x28')](_0x27fc3a,function(_0x5e998d){if(_0x5e998d[_0xf714('0x2b')]!=='VIRTUAL'){var _0x545e01={};_0x545e01[_0x5e998d[_0xf714('0x25')]]={'$like':'%'+_0x2fc894[_0xf714('0x2d')]['filter']+'%'};return _0x545e01;}})});}_0x4bff93=_[_0xf714('0x3b')]({},_0x4bff93,_0x2fc894[_0xf714('0x3c')]);var _0x44bfa6={'where':_0x4bff93[_0xf714('0x39')]};return db['DeskAccount'][_0xf714('0x1d')](_0x44bfa6)[_0xf714('0x22')](function(_0x3d9193){_0x41633a['count']=_0x3d9193;if(_0x2fc894['query'][_0xf714('0x3d')]){_0x4bff93[_0xf714('0x3e')]=[{'all':!![]}];}return db[_0xf714('0x29')][_0xf714('0x3f')](_0x4bff93);})[_0xf714('0x22')](function(_0x4dbdfd){_0x41633a['rows']=_0x4dbdfd;return _0x41633a;})['then'](respondWithFilteredResult(_0x46976c,_0x4bff93))['catch'](handleError(_0x46976c,null));};exports[_0xf714('0x40')]=function(_0x11e8c9,_0x37085b){var _0x1bb042={'raw':![],'where':{'id':_0x11e8c9[_0xf714('0x41')]['id']}},_0x229a72={};_0x229a72['model']=_[_0xf714('0x2e')](db['DeskAccount'][_0xf714('0x42')]);_0x229a72[_0xf714('0x2d')]=_['keys'](_0x11e8c9[_0xf714('0x2d')]);_0x229a72[_0xf714('0x2f')]=_[_0xf714('0x30')](_0x229a72[_0xf714('0x2c')],_0x229a72['query']);_0x1bb042[_0xf714('0x31')]=_[_0xf714('0x30')](_0x229a72[_0xf714('0x2c')],qs[_0xf714('0x32')](_0x11e8c9[_0xf714('0x2d')][_0xf714('0x32')]));_0x1bb042[_0xf714('0x31')]=_0x1bb042['attributes'][_0xf714('0x33')]?_0x1bb042['attributes']:_0x229a72[_0xf714('0x2c')];if(_0x11e8c9[_0xf714('0x2d')]['includeAll']){_0x1bb042[_0xf714('0x3e')]=[{'all':!![]}];}_0x1bb042=_[_0xf714('0x3b')]({},_0x1bb042,_0x11e8c9['options']);return db['DeskAccount']['find'](_0x1bb042)[_0xf714('0x22')](handleEntityNotFound(_0x37085b,null))['then'](respondWithResult(_0x37085b,null))[_0xf714('0x43')](handleError(_0x37085b,null));};exports[_0xf714('0x44')]=function(_0x534763,_0xbd65b8){return db['DeskAccount'][_0xf714('0x44')](_0x534763[_0xf714('0x45')],{})['then'](respondWithResult(_0xbd65b8,0xc9))[_0xf714('0x43')](handleError(_0xbd65b8,null));};exports[_0xf714('0x46')]=function(_0x38e0b1,_0x185004){if(_0x38e0b1[_0xf714('0x45')]['id']){delete _0x38e0b1[_0xf714('0x45')]['id'];}return db[_0xf714('0x29')][_0xf714('0x47')]({'where':{'id':_0x38e0b1['params']['id']}})[_0xf714('0x22')](handleEntityNotFound(_0x185004,null))[_0xf714('0x22')](saveUpdates(_0x38e0b1['body'],null))[_0xf714('0x22')](respondWithResult(_0x185004,null))[_0xf714('0x43')](handleError(_0x185004,null));};exports[_0xf714('0x48')]=function(_0x56a222,_0x5a6d16){return db[_0xf714('0x29')][_0xf714('0x47')]({'where':{'id':_0x56a222[_0xf714('0x41')]['id']}})[_0xf714('0x22')](handleEntityNotFound(_0x5a6d16,null))[_0xf714('0x22')](removeEntity(_0x5a6d16,null))[_0xf714('0x43')](handleError(_0x5a6d16,null));};exports[_0xf714('0x49')]=function(_0x3ded37,_0x194d5d,_0x350685){var _0x38895e={};var _0x23aede={};var _0x89d21d;var _0x2464d0;return db[_0xf714('0x29')][_0xf714('0x4a')]({'where':{'id':_0x3ded37[_0xf714('0x41')]['id']}})['then'](handleEntityNotFound(_0x194d5d,null))[_0xf714('0x22')](function(_0x2d37b3){if(_0x2d37b3){_0x89d21d=_0x2d37b3;_0x23aede[_0xf714('0x2c')]=_[_0xf714('0x2e')](db[_0xf714('0x4b')][_0xf714('0x42')]);_0x23aede[_0xf714('0x2d')]=_['keys'](_0x3ded37[_0xf714('0x2d')]);_0x23aede[_0xf714('0x2f')]=_[_0xf714('0x30')](_0x23aede['model'],_0x23aede['query']);_0x38895e[_0xf714('0x31')]=_['intersection'](_0x23aede['model'],qs['fields'](_0x3ded37[_0xf714('0x2d')][_0xf714('0x32')]));_0x38895e[_0xf714('0x31')]=_0x38895e[_0xf714('0x31')]['length']?_0x38895e['attributes']:_0x23aede[_0xf714('0x2c')];_0x38895e[_0xf714('0x37')]=qs['sort'](_0x3ded37[_0xf714('0x2d')][_0xf714('0x38')]);_0x38895e[_0xf714('0x39')]=qs[_0xf714('0x2f')](_[_0xf714('0x3a')](_0x3ded37[_0xf714('0x2d')],_0x23aede['filters']));if(_0x3ded37[_0xf714('0x2d')][_0xf714('0x4c')]){_0x38895e[_0xf714('0x39')]=_['merge'](_0x38895e[_0xf714('0x39')],{'$or':_[_0xf714('0x28')](_0x38895e[_0xf714('0x31')],function(_0x235749){var _0x532558={};_0x532558[_0x235749]={'$like':'%'+_0x3ded37['query'][_0xf714('0x4c')]+'%'};return _0x532558;})});}_0x38895e=_[_0xf714('0x3b')]({},_0x38895e,_0x3ded37[_0xf714('0x3c')]);return _0x89d21d[_0xf714('0x49')](_0x38895e);}})[_0xf714('0x22')](function(_0x23b480){if(_0x23b480){_0x2464d0=_0x23b480[_0xf714('0x33')];if(!_0x3ded37['query']['hasOwnProperty'](_0xf714('0x35'))){_0x38895e[_0xf714('0x36')]=qs[_0xf714('0x36')](_0x3ded37[_0xf714('0x2d')][_0xf714('0x36')]);_0x38895e[_0xf714('0x1b')]=qs[_0xf714('0x1b')](_0x3ded37[_0xf714('0x2d')][_0xf714('0x1b')]);}return _0x89d21d[_0xf714('0x49')](_0x38895e);}})[_0xf714('0x22')](function(_0x871e52){if(_0x871e52){return _0x871e52?{'count':_0x2464d0,'rows':_0x871e52}:null;}})[_0xf714('0x22')](respondWithResult(_0x194d5d,null))[_0xf714('0x43')](handleError(_0x194d5d,null));};exports[_0xf714('0x4d')]=function(_0x3f3d2c,_0x3b8b7c,_0x157fd9){if(_0x3f3d2c[_0xf714('0x45')]['id']){delete _0x3f3d2c[_0xf714('0x45')]['id'];}return db['DeskAccount'][_0xf714('0x4a')]({'where':{'id':_0x3f3d2c['params']['id']}})['then'](handleEntityNotFound(_0x3b8b7c,null))[_0xf714('0x22')](function(_0x16cb1a){if(_0x16cb1a){_0x3f3d2c[_0xf714('0x45')]['AccountId']=_0x16cb1a['id'];_0x3f3d2c[_0xf714('0x45')][_0xf714('0x4e')]=integrations[_0xf714('0x4f')](_0x3f3d2c[_0xf714('0x45')][_0xf714('0x50')],_0x3f3d2c['body'][_0xf714('0x2b')]);_0x3f3d2c[_0xf714('0x45')][_0xf714('0x51')]=integrations[_0xf714('0x52')](_0x3f3d2c[_0xf714('0x45')][_0xf714('0x50')],_0x3f3d2c[_0xf714('0x45')]['type']);return db[_0xf714('0x4b')][_0xf714('0x44')](_0x3f3d2c[_0xf714('0x45')],{'include':[{'model':db['DeskField'],'as':_0xf714('0x4e')},{'model':db[_0xf714('0x53')],'as':_0xf714('0x51')}]});}return null;})[_0xf714('0x22')](respondWithResult(_0x3b8b7c,null))['catch'](handleError(_0x3b8b7c,null));};exports[_0xf714('0x54')]=function(_0xd8f3,_0x5aed71,_0x7ed5f){var _0x42c571=[{'name':_0xf714('0x55'),'label':_0xf714('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x295e3b='';return db['DeskAccount']['findOne']({'where':{'id':_0xd8f3[_0xf714('0x41')]['id']},'attributes':['id',_0xf714('0x56'),_0xf714('0x57'),'username',_0xf714('0x58'),_0xf714('0x59'),_0xf714('0x5a'),'token',_0xf714('0x5b')]})[_0xf714('0x22')](handleEntityNotFound(_0x5aed71,null))[_0xf714('0x22')](function(_0x54cbe8){if(_0x54cbe8){_0x295e3b=_0x54cbe8[_0xf714('0x56')];var _0x4ac45e=_0x295e3b[_0xf714('0x5c')](-0x1);if(_0x4ac45e==='/'){_0x295e3b=_0x295e3b[_0xf714('0x5d')](0x0,_0x295e3b[_0xf714('0x5e')](_0x4ac45e));}var _0x199fc9={'method':'GET','uri':util[_0xf714('0x5f')](_0xf714('0x60'),_0x295e3b),'headers':{'Content-Type':_0xf714('0x61'),'Accept':_0xf714('0x61')},'json':!![]};if(_0x54cbe8[_0xf714('0x57')]===_0xf714('0x62')){_0x199fc9[_0xf714('0x63')]['Authorization']=util['format'](_0xf714('0x64'),new Buffer(util[_0xf714('0x5f')]('%s:%s',_0x54cbe8['username'],_0x54cbe8['password']))[_0xf714('0x65')]('base64'));}return rp(_0x199fc9)[_0xf714('0x22')](function(_0x36097f){return _0x42c571[_0xf714('0x66')](_[_0xf714('0x28')](_0x36097f['_embedded'][_0xf714('0x67')],function(_0x53aab4){return{'id':_0x53aab4[_0xf714('0x25')],'name':_0x53aab4[_0xf714('0x25')],'type':_0x53aab4['type'],'active':_0x53aab4[_0xf714('0x68')],'label':_0x53aab4['label'],'custom':!![]};}));});}})[_0xf714('0x22')](function(_0x1e6edc){return{'count':_0x1e6edc[_0xf714('0x33')],'rows':_0x1e6edc};})[_0xf714('0x22')](respondWithResult(_0x5aed71,null))[_0xf714('0x43')](function(_0x107c70){var _0x3afc44=_0xd8f3[_0xf714('0x2d')][_0xf714('0x69')]?0x1f4:_0x107c70['statusCode']||0x1f4;logger[_0xf714('0x6a')](_0xf714('0x6b'),_0xf714('0x54'),_0x3afc44,JSON[_0xf714('0x6c')](_0x107c70));delete _0x107c70[_0xf714('0x25')];if(_0x3afc44===0x191){_0x3afc44=0x190;}_0x5aed71['status'](_0x3afc44)[_0xf714('0x26')](_0xd8f3[_0xf714('0x2d')][_0xf714('0x69')]?{'message':_0xf714('0x6d'),'statusCode':_0x107c70['statusCode']}:_0x107c70);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 6ab6297..632386d 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 _0x54fd=['lodash','api','moment','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount'];(function(_0x32a884,_0x183853){var _0x242f9b=function(_0x556c63){while(--_0x556c63){_0x32a884['push'](_0x32a884['shift']());}};_0x242f9b(++_0x183853);}(_0x54fd,0x129));var _0xd54f=function(_0x2372ea,_0x53ac11){_0x2372ea=_0x2372ea-0x0;var _0x323cf0=_0x54fd[_0x2372ea];return _0x323cf0;};'use strict';var _=require(_0xd54f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd54f('0x1'));var moment=require(_0xd54f('0x2'));var BPromise=require('bluebird');var rp=require(_0xd54f('0x3'));var fs=require('fs');var path=require(_0xd54f('0x4'));var rimraf=require(_0xd54f('0x5'));var config=require('../../config/environment');var attributes=require(_0xd54f('0x6'));var integrations=require(_0xd54f('0x7'));module[_0xd54f('0x8')]=function(_0x7e3bfe,_0x4a1b71){return _0x7e3bfe[_0xd54f('0x9')](_0xd54f('0xa'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc026=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0xc026,0x110));var _0x6c02=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xc026[_0x2bfe52];return _0x1cf649;};'use strict';var _=require(_0x6c02('0x0'));var util=require(_0x6c02('0x1'));var logger=require(_0x6c02('0x2'))(_0x6c02('0x3'));var moment=require(_0x6c02('0x4'));var BPromise=require(_0x6c02('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c02('0x6'));var rimraf=require(_0x6c02('0x7'));var config=require(_0x6c02('0x8'));var attributes=require(_0x6c02('0x9'));var integrations=require(_0x6c02('0xa'));module[_0x6c02('0xb')]=function(_0x5933b7,_0x13bf4d){return _0x5933b7[_0x6c02('0xc')]('DeskAccount',attributes,{'tableName':_0x6c02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 381c0a9..13336ab 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 _0x845e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','map','include','model','ShowDeskAccount','find','util','moment'];(function(_0x46ba47,_0x4852b2){var _0x1aad10=function(_0x278f57){while(--_0x278f57){_0x46ba47['push'](_0x46ba47['shift']());}};_0x1aad10(++_0x4852b2);}(_0x845e,0x64));var _0xe845=function(_0x1dd6f1,_0x4ab826){_0x1dd6f1=_0x1dd6f1-0x0;var _0x4bb8d0=_0x845e[_0x1dd6f1];return _0x4bb8d0;};'use strict';var _=require('lodash');var util=require(_0xe845('0x0'));var moment=require(_0xe845('0x1'));var BPromise=require(_0xe845('0x2'));var rs=require(_0xe845('0x3'));var fs=require('fs');var Redis=require(_0xe845('0x4'));var db=require(_0xe845('0x5'))['db'];var utils=require(_0xe845('0x6'));var logger=require('../../config/logger')(_0xe845('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe845('0x8')][_0xe845('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40d4f7,_0x32e9cc,_0x305165){return new BPromise(function(_0x2454d9,_0xbd83bd){return client[_0xe845('0xa')](_0x40d4f7,_0x305165)[_0xe845('0xb')](function(_0x566c7a){logger[_0xe845('0xc')](_0xe845('0xd'),_0x32e9cc,_0xe845('0xe'));logger[_0xe845('0xf')](_0xe845('0x10'),_0x32e9cc,'request\x20sent',JSON[_0xe845('0x11')](_0x566c7a));if(_0x566c7a[_0xe845('0x12')]){if(_0x566c7a['error'][_0xe845('0x13')]===0x1f4){logger['error'](_0xe845('0xd'),_0x32e9cc,_0x566c7a[_0xe845('0x12')][_0xe845('0x14')]);return _0xbd83bd(_0x566c7a[_0xe845('0x12')][_0xe845('0x14')]);}logger[_0xe845('0x12')](_0xe845('0xd'),_0x32e9cc,_0x566c7a[_0xe845('0x12')]['message']);return _0x2454d9(_0x566c7a[_0xe845('0x12')][_0xe845('0x14')]);}else{logger[_0xe845('0xc')](_0xe845('0xd'),_0x32e9cc,_0xe845('0xe'));_0x2454d9(_0x566c7a['result'][_0xe845('0x14')]);}})[_0xe845('0x15')](function(_0x13c0ac){logger[_0xe845('0x12')](_0xe845('0xd'),_0x32e9cc,_0x13c0ac);_0xbd83bd(_0x13c0ac);});});}exports[_0xe845('0x16')]=function(_0x31e922){var _0x205f0c=this;return new Promise(function(_0x1efa6c,_0x267b67){return db[_0xe845('0x17')][_0xe845('0x18')]({'raw':_0x31e922[_0xe845('0x19')]?_0x31e922[_0xe845('0x19')][_0xe845('0x1a')]===undefined?!![]:![]:!![],'where':_0x31e922[_0xe845('0x19')]?_0x31e922[_0xe845('0x19')][_0xe845('0x1b')]||null:null,'attributes':_0x31e922[_0xe845('0x19')]?_0x31e922['options'][_0xe845('0x1c')]||null:null,'limit':_0x31e922[_0xe845('0x19')]?_0x31e922[_0xe845('0x19')]['limit']||null:null,'include':_0x31e922[_0xe845('0x19')]?_0x31e922[_0xe845('0x19')]['include']?_[_0xe845('0x1d')](_0x31e922[_0xe845('0x19')][_0xe845('0x1e')],function(_0x4dc28b){return{'model':db[_0x4dc28b[_0xe845('0x1f')]],'as':_0x4dc28b['as'],'attributes':_0x4dc28b[_0xe845('0x1c')],'include':_0x4dc28b[_0xe845('0x1e')]?_[_0xe845('0x1d')](_0x4dc28b['include'],function(_0xc4511d){return{'model':db[_0xc4511d['model']],'as':_0xc4511d['as'],'attributes':_0xc4511d[_0xe845('0x1c')],'include':_0xc4511d[_0xe845('0x1e')]?_['map'](_0xc4511d[_0xe845('0x1e')],function(_0x606f08){return{'model':db[_0x606f08[_0xe845('0x1f')]],'as':_0x606f08['as'],'attributes':_0x606f08[_0xe845('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe845('0xb')](function(_0x174643){logger[_0xe845('0xc')]('GetDeskAccount',_0x31e922);logger[_0xe845('0xf')](_0xe845('0x16'),_0x31e922,JSON[_0xe845('0x11')](_0x174643));_0x1efa6c(_0x174643);})[_0xe845('0x15')](function(_0x1d0669){logger[_0xe845('0x12')](_0xe845('0x16'),_0x1d0669[_0xe845('0x14')],_0x31e922);_0x267b67(_0x205f0c['error'](0x1f4,_0x1d0669['message']));});});};exports[_0xe845('0x20')]=function(_0x42578e){var _0x4f72df=this;return new Promise(function(_0x3c9140,_0x1f4ee3){return db['DeskAccount'][_0xe845('0x21')]({'raw':_0x42578e['options']?_0x42578e[_0xe845('0x19')][_0xe845('0x1a')]===undefined?!![]:![]:!![],'where':_0x42578e[_0xe845('0x19')]?_0x42578e[_0xe845('0x19')][_0xe845('0x1b')]||null:null,'attributes':_0x42578e[_0xe845('0x19')]?_0x42578e['options'][_0xe845('0x1c')]||null:null,'include':_0x42578e[_0xe845('0x19')]?_0x42578e[_0xe845('0x19')][_0xe845('0x1e')]?_[_0xe845('0x1d')](_0x42578e[_0xe845('0x19')][_0xe845('0x1e')],function(_0x26f5ee){return{'model':db[_0x26f5ee['model']],'as':_0x26f5ee['as'],'attributes':_0x26f5ee[_0xe845('0x1c')],'include':_0x26f5ee['include']?_[_0xe845('0x1d')](_0x26f5ee[_0xe845('0x1e')],function(_0x4e7f5c){return{'model':db[_0x4e7f5c[_0xe845('0x1f')]],'as':_0x4e7f5c['as'],'attributes':_0x4e7f5c[_0xe845('0x1c')],'include':_0x4e7f5c['include']?_[_0xe845('0x1d')](_0x4e7f5c['include'],function(_0x9c7408){return{'model':db[_0x9c7408[_0xe845('0x1f')]],'as':_0x9c7408['as'],'attributes':_0x9c7408['attributes']};}):[]};}):[]};}):[]:[]})[_0xe845('0xb')](function(_0xcece03){logger['info']('ShowDeskAccount',_0x42578e);logger[_0xe845('0xf')](_0xe845('0x20'),_0x42578e,JSON[_0xe845('0x11')](_0xcece03));_0x3c9140(_0xcece03);})['catch'](function(_0x4b26ee){logger['error'](_0xe845('0x20'),_0x4b26ee[_0xe845('0x14')],_0x42578e);_0x1f4ee3(_0x4f72df['error'](0x1f4,_0x4b26ee['message']));});});}; \ No newline at end of file +var _0xb1b6=['GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','stringify','ShowDeskAccount','find','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x60878f,_0x1166d3){var _0x1fbefb=function(_0x375d8c){while(--_0x375d8c){_0x60878f['push'](_0x60878f['shift']());}};_0x1fbefb(++_0x1166d3);}(_0xb1b6,0x181));var _0x6b1b=function(_0x5dc44c,_0x42ab15){_0x5dc44c=_0x5dc44c-0x0;var _0x36381f=_0xb1b6[_0x5dc44c];return _0x36381f;};'use strict';var _=require(_0x6b1b('0x0'));var util=require(_0x6b1b('0x1'));var moment=require(_0x6b1b('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b1b('0x3'));var fs=require('fs');var Redis=require(_0x6b1b('0x4'));var db=require(_0x6b1b('0x5'))['db'];var utils=require(_0x6b1b('0x6'));var logger=require('../../config/logger')(_0x6b1b('0x7'));var config=require(_0x6b1b('0x8'));var jayson=require(_0x6b1b('0x9'));var client=jayson[_0x6b1b('0xa')][_0x6b1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd0894d,_0x413cdb,_0x50f27c){return new BPromise(function(_0x12dc05,_0x459600){return client[_0x6b1b('0xc')](_0xd0894d,_0x50f27c)[_0x6b1b('0xd')](function(_0x3925ce){logger[_0x6b1b('0xe')](_0x6b1b('0xf'),_0x413cdb,_0x6b1b('0x10'));logger[_0x6b1b('0x11')](_0x6b1b('0x12'),_0x413cdb,_0x6b1b('0x10'),JSON['stringify'](_0x3925ce));if(_0x3925ce[_0x6b1b('0x13')]){if(_0x3925ce[_0x6b1b('0x13')]['code']===0x1f4){logger[_0x6b1b('0x13')]('DeskAccount,\x20%s,\x20%s',_0x413cdb,_0x3925ce[_0x6b1b('0x13')]['message']);return _0x459600(_0x3925ce[_0x6b1b('0x13')][_0x6b1b('0x14')]);}logger[_0x6b1b('0x13')](_0x6b1b('0xf'),_0x413cdb,_0x3925ce['error'][_0x6b1b('0x14')]);return _0x12dc05(_0x3925ce[_0x6b1b('0x13')]['message']);}else{logger['info'](_0x6b1b('0xf'),_0x413cdb,_0x6b1b('0x10'));_0x12dc05(_0x3925ce[_0x6b1b('0x15')][_0x6b1b('0x14')]);}})['catch'](function(_0x26cc09){logger[_0x6b1b('0x13')](_0x6b1b('0xf'),_0x413cdb,_0x26cc09);_0x459600(_0x26cc09);});});}exports[_0x6b1b('0x16')]=function(_0x136302){var _0x44e751=this;return new Promise(function(_0x52e86c,_0x9c1f0f){return db[_0x6b1b('0x17')][_0x6b1b('0x18')]({'raw':_0x136302['options']?_0x136302['options']['raw']===undefined?!![]:![]:!![],'where':_0x136302[_0x6b1b('0x19')]?_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1a')]||null:null,'attributes':_0x136302[_0x6b1b('0x19')]?_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1b')]||null:null,'limit':_0x136302['options']?_0x136302['options'][_0x6b1b('0x1c')]||null:null,'include':_0x136302[_0x6b1b('0x19')]?_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x136302[_0x6b1b('0x19')][_0x6b1b('0x1d')],function(_0x1b5ec2){return{'model':db[_0x1b5ec2[_0x6b1b('0x1f')]],'as':_0x1b5ec2['as'],'attributes':_0x1b5ec2[_0x6b1b('0x1b')],'include':_0x1b5ec2[_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x1b5ec2[_0x6b1b('0x1d')],function(_0x442d24){return{'model':db[_0x442d24[_0x6b1b('0x1f')]],'as':_0x442d24['as'],'attributes':_0x442d24[_0x6b1b('0x1b')],'include':_0x442d24[_0x6b1b('0x1d')]?_['map'](_0x442d24[_0x6b1b('0x1d')],function(_0x2c1cf2){return{'model':db[_0x2c1cf2[_0x6b1b('0x1f')]],'as':_0x2c1cf2['as'],'attributes':_0x2c1cf2[_0x6b1b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47824a){logger[_0x6b1b('0xe')](_0x6b1b('0x16'),_0x136302);logger[_0x6b1b('0x11')](_0x6b1b('0x16'),_0x136302,JSON[_0x6b1b('0x20')](_0x47824a));_0x52e86c(_0x47824a);})['catch'](function(_0x593db9){logger[_0x6b1b('0x13')](_0x6b1b('0x16'),_0x593db9[_0x6b1b('0x14')],_0x136302);_0x9c1f0f(_0x44e751[_0x6b1b('0x13')](0x1f4,_0x593db9[_0x6b1b('0x14')]));});});};exports[_0x6b1b('0x21')]=function(_0x1a3908){var _0x45d20b=this;return new Promise(function(_0x582218,_0x11e0ec){return db[_0x6b1b('0x17')][_0x6b1b('0x22')]({'raw':_0x1a3908[_0x6b1b('0x19')]?_0x1a3908['options'][_0x6b1b('0x23')]===undefined?!![]:![]:!![],'where':_0x1a3908['options']?_0x1a3908[_0x6b1b('0x19')][_0x6b1b('0x1a')]||null:null,'attributes':_0x1a3908['options']?_0x1a3908[_0x6b1b('0x19')][_0x6b1b('0x1b')]||null:null,'include':_0x1a3908[_0x6b1b('0x19')]?_0x1a3908[_0x6b1b('0x19')][_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x1a3908[_0x6b1b('0x19')]['include'],function(_0x2db0be){return{'model':db[_0x2db0be[_0x6b1b('0x1f')]],'as':_0x2db0be['as'],'attributes':_0x2db0be[_0x6b1b('0x1b')],'include':_0x2db0be[_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x2db0be[_0x6b1b('0x1d')],function(_0x9d238b){return{'model':db[_0x9d238b[_0x6b1b('0x1f')]],'as':_0x9d238b['as'],'attributes':_0x9d238b[_0x6b1b('0x1b')],'include':_0x9d238b[_0x6b1b('0x1d')]?_[_0x6b1b('0x1e')](_0x9d238b['include'],function(_0x2d076b){return{'model':db[_0x2d076b[_0x6b1b('0x1f')]],'as':_0x2d076b['as'],'attributes':_0x2d076b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b1b('0xd')](function(_0x44afe6){logger[_0x6b1b('0xe')]('ShowDeskAccount',_0x1a3908);logger[_0x6b1b('0x11')](_0x6b1b('0x21'),_0x1a3908,JSON['stringify'](_0x44afe6));_0x582218(_0x44afe6);})[_0x6b1b('0x24')](function(_0x1441bf){logger['error']('ShowDeskAccount',_0x1441bf[_0x6b1b('0x14')],_0x1a3908);_0x11e0ec(_0x45d20b[_0x6b1b('0x13')](0x1f4,_0x1441bf[_0x6b1b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 921219b..3f156d1 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x295bad,_0xe95240){var _0x56bb3d=function(_0x572a36){while(--_0x572a36){_0x295bad['push'](_0x295bad['shift']());}};_0x56bb3d(++_0xe95240);}(_0xedd9,0xfc));var _0x9edd=function(_0x39c302,_0x452cd1){_0x39c302=_0x39c302-0x0;var _0x53f444=_0xedd9[_0x39c302];return _0x53f444;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x5b9674,_0x854b9b){var _0x5d99b5=function(_0x1fbba6){while(--_0x1fbba6){_0x5b9674['push'](_0x5b9674['shift']());}};_0x5d99b5(++_0x854b9b);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a19f6,_0x4a081f){_0x1a19f6=_0x1a19f6-0x0;var _0x539b1d=_0xedd9[_0x1a19f6];return _0x539b1d;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index fe44ef6..7b1e08a 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 _0x3e81=['sequelize'];(function(_0x16c4df,_0x41b5ca){var _0x4ccd2f=function(_0x43e715){while(--_0x43e715){_0x16c4df['push'](_0x16c4df['shift']());}};_0x4ccd2f(++_0x41b5ca);}(_0x3e81,0x126));var _0x13e8=function(_0x47c418,_0x1e3182){_0x47c418=_0x47c418-0x0;var _0x83159=_0x3e81[_0x47c418];return _0x83159;};'use strict';var Sequelize=require(_0x13e8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x58b0=['exports','STRING','sequelize'];(function(_0x55bf78,_0x8d7da1){var _0x484e78=function(_0x80446b){while(--_0x80446b){_0x55bf78['push'](_0x55bf78['shift']());}};_0x484e78(++_0x8d7da1);}(_0x58b0,0x1b2));var _0x058b=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x58b0[_0x365e54];return _0x13317a;};'use strict';var Sequelize=require(_0x058b('0x0'));module[_0x058b('0x1')]={'name':{'type':Sequelize[_0x058b('0x2')]},'description':{'type':Sequelize[_0x058b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 801b800..bb87974 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 _0xd583=['options','then','includeAll','include','DeskConfiguration','findAll','rows','catch','show','params','find','create','body','destroy','getFields','findOne','DeskField','getSubjects','nolimit','getDescriptions','getTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd583,0x10f));var _0x3d58=function(_0x493720,_0x2e7724){_0x493720=_0x493720-0x0;var _0x3cfc8e=_0xd583[_0x493720];return _0x3cfc8e;};'use strict';var emlformat=require(_0x3d58('0x0'));var rimraf=require(_0x3d58('0x1'));var zipdir=require(_0x3d58('0x2'));var jsonpatch=require(_0x3d58('0x3'));var rp=require(_0x3d58('0x4'));var moment=require(_0x3d58('0x5'));var BPromise=require(_0x3d58('0x6'));var Mustache=require(_0x3d58('0x7'));var util=require(_0x3d58('0x8'));var path=require(_0x3d58('0x9'));var sox=require('sox');var csv=require(_0x3d58('0xa'));var ejs=require(_0x3d58('0xb'));var fs=require('fs');var fs_extra=require(_0x3d58('0xc'));var _=require(_0x3d58('0xd'));var squel=require('squel');var crypto=require(_0x3d58('0xe'));var jsforce=require(_0x3d58('0xf'));var deskjs=require(_0x3d58('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3d58('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d58('0x12'));var hardwareService=require(_0x3d58('0x13'));var logger=require(_0x3d58('0x14'))(_0x3d58('0x15'));var utils=require('../../config/utils');var config=require(_0x3d58('0x16'));var licenseUtil=require(_0x3d58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27a264,_0x2299c0){_0x2299c0=_0x2299c0||0xcc;return function(_0x4f1114){if(_0x4f1114){return _0x27a264[_0x3d58('0x18')](_0x2299c0);}return _0x27a264[_0x3d58('0x19')](_0x2299c0)[_0x3d58('0x1a')]();};}function respondWithResult(_0x5060b7,_0x825062){_0x825062=_0x825062||0xc8;return function(_0x196b1d){if(_0x196b1d){return _0x5060b7['status'](_0x825062)[_0x3d58('0x1b')](_0x196b1d);}};}function respondWithFilteredResult(_0x1b6045,_0x39a7a8){return function(_0x2195ae){if(_0x2195ae){var _0x204a22=typeof _0x39a7a8['offset']===_0x3d58('0x1c')&&typeof _0x39a7a8[_0x3d58('0x1d')]==='undefined';var _0x458b95=_0x2195ae[_0x3d58('0x1e')];var _0x473e0f=_0x204a22?0x0:_0x39a7a8[_0x3d58('0x1f')];var _0x2d16ee=_0x204a22?_0x2195ae[_0x3d58('0x1e')]:_0x39a7a8[_0x3d58('0x1f')]+_0x39a7a8[_0x3d58('0x1d')];var _0xade50b;if(_0x2d16ee>=_0x458b95){_0x2d16ee=_0x458b95;_0xade50b=0xc8;}else{_0xade50b=0xce;}_0x1b6045[_0x3d58('0x19')](_0xade50b);return _0x1b6045[_0x3d58('0x20')](_0x3d58('0x21'),_0x473e0f+'-'+_0x2d16ee+'/'+_0x458b95)[_0x3d58('0x1b')](_0x2195ae);}return null;};}function patchUpdates(_0xb605b0){return function(_0x287a83){try{jsonpatch['apply'](_0x287a83,_0xb605b0,!![]);}catch(_0x5cfd5a){return BPromise['reject'](_0x5cfd5a);}return _0x287a83[_0x3d58('0x22')]();};}function saveUpdates(_0xecfa89,_0x3f7e7b){return function(_0x1c54ff){if(_0x1c54ff){return _0x1c54ff[_0x3d58('0x23')](_0xecfa89)['then'](function(_0x3598cf){return _0x3598cf;});}return null;};}function removeEntity(_0x286732,_0x3c886c){return function(_0x5ecb81){if(_0x5ecb81){return _0x5ecb81['destroy']()['then'](function(){_0x286732[_0x3d58('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3c13,_0x3fe470){return function(_0x26b75c){if(!_0x26b75c){_0x2c3c13['sendStatus'](0x194);}return _0x26b75c;};}function handleError(_0x21160f,_0x3d9506){_0x3d9506=_0x3d9506||0x1f4;return function(_0x26d63e){logger[_0x3d58('0x24')](_0x26d63e[_0x3d58('0x25')]);if(_0x26d63e[_0x3d58('0x26')]){delete _0x26d63e['name'];}_0x21160f['status'](_0x3d9506)[_0x3d58('0x27')](_0x26d63e);};}exports[_0x3d58('0x28')]=function(_0x3569e0,_0x1b37e7){var _0x4f933c={},_0x3cb915={},_0xbac466={'count':0x0,'rows':[]};var _0x34affd=_['map'](db['DeskConfiguration'][_0x3d58('0x29')],function(_0x205d1f){return{'name':_0x205d1f['fieldName'],'type':_0x205d1f[_0x3d58('0x2a')][_0x3d58('0x2b')]};});_0x3cb915['model']=_[_0x3d58('0x2c')](_0x34affd,_0x3d58('0x26'));_0x3cb915[_0x3d58('0x2d')]=_[_0x3d58('0x2e')](_0x3569e0[_0x3d58('0x2d')]);_0x3cb915[_0x3d58('0x2f')]=_[_0x3d58('0x30')](_0x3cb915[_0x3d58('0x31')],_0x3cb915[_0x3d58('0x2d')]);_0x4f933c[_0x3d58('0x32')]=_[_0x3d58('0x30')](_0x3cb915[_0x3d58('0x31')],qs[_0x3d58('0x33')](_0x3569e0['query'][_0x3d58('0x33')]));_0x4f933c['attributes']=_0x4f933c[_0x3d58('0x32')][_0x3d58('0x34')]?_0x4f933c[_0x3d58('0x32')]:_0x3cb915[_0x3d58('0x31')];if(!_0x3569e0['query'][_0x3d58('0x35')]('nolimit')){_0x4f933c[_0x3d58('0x1d')]=qs[_0x3d58('0x1d')](_0x3569e0[_0x3d58('0x2d')]['limit']);_0x4f933c[_0x3d58('0x1f')]=qs[_0x3d58('0x1f')](_0x3569e0[_0x3d58('0x2d')]['offset']);}_0x4f933c[_0x3d58('0x36')]=qs['sort'](_0x3569e0[_0x3d58('0x2d')][_0x3d58('0x37')]);_0x4f933c['where']=qs[_0x3d58('0x2f')](_[_0x3d58('0x38')](_0x3569e0['query'],_0x3cb915[_0x3d58('0x2f')]),_0x34affd);if(_0x3569e0[_0x3d58('0x2d')][_0x3d58('0x39')]){_0x4f933c[_0x3d58('0x3a')]=_['merge'](_0x4f933c[_0x3d58('0x3a')],{'$or':_[_0x3d58('0x2c')](_0x34affd,function(_0x1e9096){if(_0x1e9096[_0x3d58('0x2a')]!==_0x3d58('0x3b')){var _0x50bc1a={};_0x50bc1a[_0x1e9096[_0x3d58('0x26')]]={'$like':'%'+_0x3569e0['query'][_0x3d58('0x39')]+'%'};return _0x50bc1a;}})});}_0x4f933c=_[_0x3d58('0x3c')]({},_0x4f933c,_0x3569e0[_0x3d58('0x3d')]);var _0x209bcc={'where':_0x4f933c[_0x3d58('0x3a')]};return db['DeskConfiguration'][_0x3d58('0x1e')](_0x209bcc)[_0x3d58('0x3e')](function(_0x256c05){_0xbac466[_0x3d58('0x1e')]=_0x256c05;if(_0x3569e0[_0x3d58('0x2d')][_0x3d58('0x3f')]){_0x4f933c[_0x3d58('0x40')]=[{'all':!![]}];}return db[_0x3d58('0x41')][_0x3d58('0x42')](_0x4f933c);})['then'](function(_0x15cd48){_0xbac466[_0x3d58('0x43')]=_0x15cd48;return _0xbac466;})[_0x3d58('0x3e')](respondWithFilteredResult(_0x1b37e7,_0x4f933c))[_0x3d58('0x44')](handleError(_0x1b37e7,null));};exports[_0x3d58('0x45')]=function(_0x218ddd,_0x3f2138){var _0xc463d={'raw':![],'where':{'id':_0x218ddd[_0x3d58('0x46')]['id']}},_0x52a099={};_0x52a099[_0x3d58('0x31')]=_[_0x3d58('0x2e')](db[_0x3d58('0x41')][_0x3d58('0x29')]);_0x52a099[_0x3d58('0x2d')]=_[_0x3d58('0x2e')](_0x218ddd[_0x3d58('0x2d')]);_0x52a099[_0x3d58('0x2f')]=_[_0x3d58('0x30')](_0x52a099[_0x3d58('0x31')],_0x52a099['query']);_0xc463d[_0x3d58('0x32')]=_[_0x3d58('0x30')](_0x52a099[_0x3d58('0x31')],qs[_0x3d58('0x33')](_0x218ddd['query'][_0x3d58('0x33')]));_0xc463d[_0x3d58('0x32')]=_0xc463d['attributes'][_0x3d58('0x34')]?_0xc463d['attributes']:_0x52a099[_0x3d58('0x31')];if(_0x218ddd[_0x3d58('0x2d')][_0x3d58('0x3f')]){_0xc463d[_0x3d58('0x40')]=[{'all':!![]}];}_0xc463d=_[_0x3d58('0x3c')]({},_0xc463d,_0x218ddd[_0x3d58('0x3d')]);return db[_0x3d58('0x41')][_0x3d58('0x47')](_0xc463d)['then'](handleEntityNotFound(_0x3f2138,null))['then'](respondWithResult(_0x3f2138,null))['catch'](handleError(_0x3f2138,null));};exports[_0x3d58('0x48')]=function(_0x3d9b39,_0x266534){return db[_0x3d58('0x41')][_0x3d58('0x48')](_0x3d9b39[_0x3d58('0x49')],{})['then'](respondWithResult(_0x266534,0xc9))[_0x3d58('0x44')](handleError(_0x266534,null));};exports[_0x3d58('0x23')]=function(_0x5f55ef,_0x83d4f0){if(_0x5f55ef['body']['id']){delete _0x5f55ef[_0x3d58('0x49')]['id'];}return db[_0x3d58('0x41')][_0x3d58('0x47')]({'where':{'id':_0x5f55ef[_0x3d58('0x46')]['id']}})[_0x3d58('0x3e')](handleEntityNotFound(_0x83d4f0,null))[_0x3d58('0x3e')](saveUpdates(_0x5f55ef[_0x3d58('0x49')],null))[_0x3d58('0x3e')](respondWithResult(_0x83d4f0,null))[_0x3d58('0x44')](handleError(_0x83d4f0,null));};exports[_0x3d58('0x4a')]=function(_0x8f18dc,_0x3024a9){return db[_0x3d58('0x41')][_0x3d58('0x47')]({'where':{'id':_0x8f18dc['params']['id']}})['then'](handleEntityNotFound(_0x3024a9,null))[_0x3d58('0x3e')](removeEntity(_0x3024a9,null))['catch'](handleError(_0x3024a9,null));};exports[_0x3d58('0x4b')]=function(_0x299e8c,_0x38407d,_0x3b9f23){var _0x583974={};var _0x5bc534={};var _0x501ae3;var _0x30bcb6;return db[_0x3d58('0x41')][_0x3d58('0x4c')]({'where':{'id':_0x299e8c[_0x3d58('0x46')]['id']}})[_0x3d58('0x3e')](handleEntityNotFound(_0x38407d,null))[_0x3d58('0x3e')](function(_0xde374e){if(_0xde374e){_0x501ae3=_0xde374e;_0x5bc534[_0x3d58('0x31')]=_['keys'](db[_0x3d58('0x4d')][_0x3d58('0x29')]);_0x5bc534['query']=_[_0x3d58('0x2e')](_0x299e8c[_0x3d58('0x2d')]);_0x5bc534[_0x3d58('0x2f')]=_[_0x3d58('0x30')](_0x5bc534['model'],_0x5bc534[_0x3d58('0x2d')]);_0x583974[_0x3d58('0x32')]=_[_0x3d58('0x30')](_0x5bc534[_0x3d58('0x31')],qs[_0x3d58('0x33')](_0x299e8c[_0x3d58('0x2d')][_0x3d58('0x33')]));_0x583974['attributes']=_0x583974[_0x3d58('0x32')]['length']?_0x583974[_0x3d58('0x32')]:_0x5bc534[_0x3d58('0x31')];_0x583974[_0x3d58('0x36')]=qs[_0x3d58('0x37')](_0x299e8c[_0x3d58('0x2d')]['sort']);_0x583974[_0x3d58('0x3a')]=qs[_0x3d58('0x2f')](_[_0x3d58('0x38')](_0x299e8c[_0x3d58('0x2d')],_0x5bc534['filters']));if(_0x299e8c['query'][_0x3d58('0x39')]){_0x583974[_0x3d58('0x3a')]=_[_0x3d58('0x3c')](_0x583974[_0x3d58('0x3a')],{'$or':_[_0x3d58('0x2c')](_0x583974['attributes'],function(_0x2fb2fd){var _0xea4f84={};_0xea4f84[_0x2fb2fd]={'$like':'%'+_0x299e8c[_0x3d58('0x2d')][_0x3d58('0x39')]+'%'};return _0xea4f84;})});}_0x583974=_[_0x3d58('0x3c')]({},_0x583974,_0x299e8c[_0x3d58('0x3d')]);return _0x501ae3[_0x3d58('0x4b')](_0x583974);}})[_0x3d58('0x3e')](function(_0x21ce93){if(_0x21ce93){_0x30bcb6=_0x21ce93[_0x3d58('0x34')];if(!_0x299e8c['query'][_0x3d58('0x35')]('nolimit')){_0x583974[_0x3d58('0x1d')]=qs[_0x3d58('0x1d')](_0x299e8c[_0x3d58('0x2d')][_0x3d58('0x1d')]);_0x583974['offset']=qs['offset'](_0x299e8c[_0x3d58('0x2d')][_0x3d58('0x1f')]);}return _0x501ae3[_0x3d58('0x4b')](_0x583974);}})[_0x3d58('0x3e')](function(_0x3cef0f){if(_0x3cef0f){return _0x3cef0f?{'count':_0x30bcb6,'rows':_0x3cef0f}:null;}})[_0x3d58('0x3e')](respondWithResult(_0x38407d,null))[_0x3d58('0x44')](handleError(_0x38407d,null));};exports[_0x3d58('0x4e')]=function(_0x41a762,_0x1fb282,_0x2b86c4){var _0x107d86={};var _0xa51f60={};var _0x12bc7a;var _0x50f793;return db[_0x3d58('0x41')][_0x3d58('0x4c')]({'where':{'id':_0x41a762['params']['id']}})[_0x3d58('0x3e')](handleEntityNotFound(_0x1fb282,null))['then'](function(_0x57313c){if(_0x57313c){_0x12bc7a=_0x57313c;_0xa51f60[_0x3d58('0x31')]=_['keys'](db[_0x3d58('0x4d')][_0x3d58('0x29')]);_0xa51f60[_0x3d58('0x2d')]=_[_0x3d58('0x2e')](_0x41a762['query']);_0xa51f60['filters']=_[_0x3d58('0x30')](_0xa51f60[_0x3d58('0x31')],_0xa51f60[_0x3d58('0x2d')]);_0x107d86[_0x3d58('0x32')]=_[_0x3d58('0x30')](_0xa51f60[_0x3d58('0x31')],qs[_0x3d58('0x33')](_0x41a762[_0x3d58('0x2d')][_0x3d58('0x33')]));_0x107d86[_0x3d58('0x32')]=_0x107d86['attributes'][_0x3d58('0x34')]?_0x107d86[_0x3d58('0x32')]:_0xa51f60[_0x3d58('0x31')];_0x107d86[_0x3d58('0x36')]=qs[_0x3d58('0x37')](_0x41a762[_0x3d58('0x2d')][_0x3d58('0x37')]);_0x107d86[_0x3d58('0x3a')]=qs[_0x3d58('0x2f')](_[_0x3d58('0x38')](_0x41a762[_0x3d58('0x2d')],_0xa51f60['filters']));if(_0x41a762[_0x3d58('0x2d')][_0x3d58('0x39')]){_0x107d86['where']=_[_0x3d58('0x3c')](_0x107d86[_0x3d58('0x3a')],{'$or':_[_0x3d58('0x2c')](_0x107d86[_0x3d58('0x32')],function(_0x24259b){var _0x42ee91={};_0x42ee91[_0x24259b]={'$like':'%'+_0x41a762['query'][_0x3d58('0x39')]+'%'};return _0x42ee91;})});}_0x107d86=_[_0x3d58('0x3c')]({},_0x107d86,_0x41a762[_0x3d58('0x3d')]);return _0x12bc7a[_0x3d58('0x4e')](_0x107d86);}})[_0x3d58('0x3e')](function(_0x1ffe8c){if(_0x1ffe8c){_0x50f793=_0x1ffe8c[_0x3d58('0x34')];if(!_0x41a762[_0x3d58('0x2d')][_0x3d58('0x35')](_0x3d58('0x4f'))){_0x107d86[_0x3d58('0x1d')]=qs[_0x3d58('0x1d')](_0x41a762[_0x3d58('0x2d')][_0x3d58('0x1d')]);_0x107d86[_0x3d58('0x1f')]=qs[_0x3d58('0x1f')](_0x41a762[_0x3d58('0x2d')]['offset']);}return _0x12bc7a[_0x3d58('0x4e')](_0x107d86);}})[_0x3d58('0x3e')](function(_0x117cd2){if(_0x117cd2){return _0x117cd2?{'count':_0x50f793,'rows':_0x117cd2}:null;}})[_0x3d58('0x3e')](respondWithResult(_0x1fb282,null))[_0x3d58('0x44')](handleError(_0x1fb282,null));};exports[_0x3d58('0x50')]=function(_0x48b8b4,_0x14eb6f,_0x2f089d){var _0x1c0230={};var _0x226324={};var _0x1c30d2;var _0x3821c5;return db[_0x3d58('0x41')][_0x3d58('0x4c')]({'where':{'id':_0x48b8b4[_0x3d58('0x46')]['id']}})['then'](handleEntityNotFound(_0x14eb6f,null))[_0x3d58('0x3e')](function(_0x50dae4){if(_0x50dae4){_0x1c30d2=_0x50dae4;_0x226324['model']=_[_0x3d58('0x2e')](db['DeskField'][_0x3d58('0x29')]);_0x226324[_0x3d58('0x2d')]=_[_0x3d58('0x2e')](_0x48b8b4[_0x3d58('0x2d')]);_0x226324[_0x3d58('0x2f')]=_[_0x3d58('0x30')](_0x226324[_0x3d58('0x31')],_0x226324[_0x3d58('0x2d')]);_0x1c0230[_0x3d58('0x32')]=_[_0x3d58('0x30')](_0x226324['model'],qs[_0x3d58('0x33')](_0x48b8b4[_0x3d58('0x2d')][_0x3d58('0x33')]));_0x1c0230[_0x3d58('0x32')]=_0x1c0230[_0x3d58('0x32')][_0x3d58('0x34')]?_0x1c0230['attributes']:_0x226324[_0x3d58('0x31')];_0x1c0230[_0x3d58('0x36')]=qs[_0x3d58('0x37')](_0x48b8b4[_0x3d58('0x2d')][_0x3d58('0x37')]);_0x1c0230[_0x3d58('0x3a')]=qs['filters'](_[_0x3d58('0x38')](_0x48b8b4[_0x3d58('0x2d')],_0x226324['filters']));if(_0x48b8b4['query'][_0x3d58('0x39')]){_0x1c0230[_0x3d58('0x3a')]=_[_0x3d58('0x3c')](_0x1c0230[_0x3d58('0x3a')],{'$or':_[_0x3d58('0x2c')](_0x1c0230[_0x3d58('0x32')],function(_0x103f44){var _0xbc25c2={};_0xbc25c2[_0x103f44]={'$like':'%'+_0x48b8b4[_0x3d58('0x2d')][_0x3d58('0x39')]+'%'};return _0xbc25c2;})});}_0x1c0230=_['merge']({},_0x1c0230,_0x48b8b4['options']);return _0x1c30d2[_0x3d58('0x50')](_0x1c0230);}})[_0x3d58('0x3e')](function(_0x27c374){if(_0x27c374){_0x3821c5=_0x27c374[_0x3d58('0x34')];if(!_0x48b8b4[_0x3d58('0x2d')][_0x3d58('0x35')](_0x3d58('0x4f'))){_0x1c0230['limit']=qs[_0x3d58('0x1d')](_0x48b8b4['query']['limit']);_0x1c0230[_0x3d58('0x1f')]=qs['offset'](_0x48b8b4[_0x3d58('0x2d')][_0x3d58('0x1f')]);}return _0x1c30d2['getDescriptions'](_0x1c0230);}})[_0x3d58('0x3e')](function(_0x969cd8){if(_0x969cd8){return _0x969cd8?{'count':_0x3821c5,'rows':_0x969cd8}:null;}})[_0x3d58('0x3e')](respondWithResult(_0x14eb6f,null))[_0x3d58('0x44')](handleError(_0x14eb6f,null));};exports[_0x3d58('0x51')]=function(_0x16b728,_0x3a4686,_0x5cf3fc){var _0x3a958d={};var _0x2fe001={};var _0x2af7b4;var _0x684b53;return db[_0x3d58('0x41')][_0x3d58('0x4c')]({'where':{'id':_0x16b728[_0x3d58('0x46')]['id']}})[_0x3d58('0x3e')](handleEntityNotFound(_0x3a4686,null))['then'](function(_0x1d4059){if(_0x1d4059){_0x2af7b4=_0x1d4059;_0x2fe001[_0x3d58('0x31')]=_[_0x3d58('0x2e')](db['Tag'][_0x3d58('0x29')]);_0x2fe001['query']=_['keys'](_0x16b728[_0x3d58('0x2d')]);_0x2fe001[_0x3d58('0x2f')]=_[_0x3d58('0x30')](_0x2fe001[_0x3d58('0x31')],_0x2fe001[_0x3d58('0x2d')]);_0x3a958d['attributes']=_[_0x3d58('0x30')](_0x2fe001[_0x3d58('0x31')],qs[_0x3d58('0x33')](_0x16b728[_0x3d58('0x2d')][_0x3d58('0x33')]));_0x3a958d[_0x3d58('0x32')]=_0x3a958d[_0x3d58('0x32')][_0x3d58('0x34')]?_0x3a958d[_0x3d58('0x32')]:_0x2fe001[_0x3d58('0x31')];_0x3a958d[_0x3d58('0x36')]=qs['sort'](_0x16b728[_0x3d58('0x2d')][_0x3d58('0x37')]);_0x3a958d[_0x3d58('0x3a')]=qs['filters'](_['pick'](_0x16b728['query'],_0x2fe001[_0x3d58('0x2f')]));if(_0x16b728[_0x3d58('0x2d')]['filter']){_0x3a958d[_0x3d58('0x3a')]=_['merge'](_0x3a958d['where'],{'$or':_['map'](_0x3a958d[_0x3d58('0x32')],function(_0x3946bb){var _0x5cb6f6={};_0x5cb6f6[_0x3946bb]={'$like':'%'+_0x16b728[_0x3d58('0x2d')][_0x3d58('0x39')]+'%'};return _0x5cb6f6;})});}_0x3a958d=_[_0x3d58('0x3c')]({},_0x3a958d,_0x16b728[_0x3d58('0x3d')]);return _0x2af7b4['getTags'](_0x3a958d);}})[_0x3d58('0x3e')](function(_0x26132c){if(_0x26132c){_0x684b53=_0x26132c['length'];if(!_0x16b728[_0x3d58('0x2d')][_0x3d58('0x35')](_0x3d58('0x4f'))){_0x3a958d[_0x3d58('0x1d')]=qs[_0x3d58('0x1d')](_0x16b728[_0x3d58('0x2d')][_0x3d58('0x1d')]);_0x3a958d['offset']=qs[_0x3d58('0x1f')](_0x16b728[_0x3d58('0x2d')]['offset']);}return _0x2af7b4[_0x3d58('0x51')](_0x3a958d);}})['then'](function(_0x2f453a){if(_0x2f453a){return _0x2f453a?{'count':_0x684b53,'rows':_0x2f453a}:null;}})[_0x3d58('0x3e')](respondWithResult(_0x3a4686,null))['catch'](handleError(_0x3a4686,null));};exports['setTags']=function(_0x350a6d,_0x32ca94,_0x435b8c){if(_0x350a6d['body']['id']){delete _0x350a6d['body']['id'];}return db[_0x3d58('0x41')][_0x3d58('0x4c')]({'where':{'id':_0x350a6d[_0x3d58('0x46')]['id']}})[_0x3d58('0x3e')](handleEntityNotFound(_0x32ca94,null))[_0x3d58('0x3e')](function(_0x455c53){if(_0x455c53){return _0x455c53['setTags'](_0x350a6d[_0x3d58('0x49')][_0x3d58('0x52')]||[]);}return null;})[_0x3d58('0x3e')](respondWithResult(_0x32ca94,null))[_0x3d58('0x44')](handleError(_0x32ca94,null));}; \ No newline at end of file +var _0xd401=['getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','DeskConfiguration','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','include','find','create','body','catch','update','getFields','findOne','DeskField','rawAttributes','getSubjects','getDescriptions'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xd401,0xfc));var _0x1d40=function(_0x49a4b5,_0x420d0c){_0x49a4b5=_0x49a4b5-0x0;var _0x343547=_0xd401[_0x49a4b5];return _0x343547;};'use strict';var emlformat=require(_0x1d40('0x0'));var rimraf=require(_0x1d40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d40('0x2'));var rp=require(_0x1d40('0x3'));var moment=require(_0x1d40('0x4'));var BPromise=require(_0x1d40('0x5'));var Mustache=require(_0x1d40('0x6'));var util=require('util');var path=require(_0x1d40('0x7'));var sox=require(_0x1d40('0x8'));var csv=require('to-csv');var ejs=require(_0x1d40('0x9'));var fs=require('fs');var fs_extra=require(_0x1d40('0xa'));var _=require(_0x1d40('0xb'));var squel=require(_0x1d40('0xc'));var crypto=require(_0x1d40('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1d40('0xe'));var querystring=require('querystring');var Papa=require(_0x1d40('0xf'));var Redis=require(_0x1d40('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1d40('0x11'));var as=require(_0x1d40('0x12'));var hardwareService=require(_0x1d40('0x13'));var logger=require(_0x1d40('0x14'))('api');var utils=require(_0x1d40('0x15'));var config=require(_0x1d40('0x16'));var licenseUtil=require(_0x1d40('0x17'));var db=require(_0x1d40('0x18'))['db'];function respondWithStatusCode(_0x26d1ad,_0x4baf52){_0x4baf52=_0x4baf52||0xcc;return function(_0x41672e){if(_0x41672e){return _0x26d1ad[_0x1d40('0x19')](_0x4baf52);}return _0x26d1ad['status'](_0x4baf52)['end']();};}function respondWithResult(_0x39ff86,_0x2ee31f){_0x2ee31f=_0x2ee31f||0xc8;return function(_0x1f926f){if(_0x1f926f){return _0x39ff86[_0x1d40('0x1a')](_0x2ee31f)[_0x1d40('0x1b')](_0x1f926f);}};}function respondWithFilteredResult(_0x5bdc54,_0x4a36d0){return function(_0x366986){if(_0x366986){var _0x12c1cc=typeof _0x4a36d0['offset']==='undefined'&&typeof _0x4a36d0['limit']===_0x1d40('0x1c');var _0x7d7215=_0x366986['count'];var _0x474755=_0x12c1cc?0x0:_0x4a36d0[_0x1d40('0x1d')];var _0x3dc45b=_0x12c1cc?_0x366986[_0x1d40('0x1e')]:_0x4a36d0['offset']+_0x4a36d0[_0x1d40('0x1f')];var _0x333a4b;if(_0x3dc45b>=_0x7d7215){_0x3dc45b=_0x7d7215;_0x333a4b=0xc8;}else{_0x333a4b=0xce;}_0x5bdc54[_0x1d40('0x1a')](_0x333a4b);return _0x5bdc54[_0x1d40('0x20')](_0x1d40('0x21'),_0x474755+'-'+_0x3dc45b+'/'+_0x7d7215)[_0x1d40('0x1b')](_0x366986);}return null;};}function patchUpdates(_0x4140fd){return function(_0x4c7484){try{jsonpatch[_0x1d40('0x22')](_0x4c7484,_0x4140fd,!![]);}catch(_0x4c4719){return BPromise[_0x1d40('0x23')](_0x4c4719);}return _0x4c7484[_0x1d40('0x24')]();};}function saveUpdates(_0x370e6f,_0x28c3cc){return function(_0x2da749){if(_0x2da749){return _0x2da749['update'](_0x370e6f)[_0x1d40('0x25')](function(_0x1c352a){return _0x1c352a;});}return null;};}function removeEntity(_0x47771f,_0x168c23){return function(_0x5b9cd8){if(_0x5b9cd8){return _0x5b9cd8[_0x1d40('0x26')]()[_0x1d40('0x25')](function(){_0x47771f[_0x1d40('0x1a')](0xcc)[_0x1d40('0x27')]();});}};}function handleEntityNotFound(_0x68f044,_0x44653e){return function(_0x4cf65e){if(!_0x4cf65e){_0x68f044['sendStatus'](0x194);}return _0x4cf65e;};}function handleError(_0x2ffc50,_0x1d44b9){_0x1d44b9=_0x1d44b9||0x1f4;return function(_0xcd6402){logger[_0x1d40('0x28')](_0xcd6402[_0x1d40('0x29')]);if(_0xcd6402[_0x1d40('0x2a')]){delete _0xcd6402['name'];}_0x2ffc50[_0x1d40('0x1a')](_0x1d44b9)['send'](_0xcd6402);};}exports[_0x1d40('0x2b')]=function(_0x54fd58,_0xf39503){var _0xa4ea2d={},_0x479c35={},_0x367d02={'count':0x0,'rows':[]};var _0x201fc2=_[_0x1d40('0x2c')](db[_0x1d40('0x2d')]['rawAttributes'],function(_0x348e9c){return{'name':_0x348e9c['fieldName'],'type':_0x348e9c[_0x1d40('0x2e')]['key']};});_0x479c35[_0x1d40('0x2f')]=_[_0x1d40('0x2c')](_0x201fc2,_0x1d40('0x2a'));_0x479c35[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x54fd58[_0x1d40('0x30')]);_0x479c35[_0x1d40('0x32')]=_[_0x1d40('0x33')](_0x479c35[_0x1d40('0x2f')],_0x479c35['query']);_0xa4ea2d[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x479c35[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x54fd58[_0x1d40('0x30')][_0x1d40('0x35')]));_0xa4ea2d[_0x1d40('0x34')]=_0xa4ea2d[_0x1d40('0x34')][_0x1d40('0x36')]?_0xa4ea2d[_0x1d40('0x34')]:_0x479c35[_0x1d40('0x2f')];if(!_0x54fd58[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xa4ea2d[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x54fd58[_0x1d40('0x30')][_0x1d40('0x1f')]);_0xa4ea2d[_0x1d40('0x1d')]=qs[_0x1d40('0x1d')](_0x54fd58[_0x1d40('0x30')]['offset']);}_0xa4ea2d[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x54fd58[_0x1d40('0x30')][_0x1d40('0x3a')]);_0xa4ea2d[_0x1d40('0x3b')]=qs[_0x1d40('0x32')](_[_0x1d40('0x3c')](_0x54fd58['query'],_0x479c35[_0x1d40('0x32')]),_0x201fc2);if(_0x54fd58[_0x1d40('0x30')][_0x1d40('0x3d')]){_0xa4ea2d['where']=_[_0x1d40('0x3e')](_0xa4ea2d[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0x201fc2,function(_0x44cef7){if(_0x44cef7[_0x1d40('0x2e')]!==_0x1d40('0x3f')){var _0xba0314={};_0xba0314[_0x44cef7[_0x1d40('0x2a')]]={'$like':'%'+_0x54fd58[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0xba0314;}})});}_0xa4ea2d=_[_0x1d40('0x3e')]({},_0xa4ea2d,_0x54fd58[_0x1d40('0x40')]);var _0x4deea9={'where':_0xa4ea2d[_0x1d40('0x3b')]};return db[_0x1d40('0x2d')]['count'](_0x4deea9)['then'](function(_0x5ea2bc){_0x367d02[_0x1d40('0x1e')]=_0x5ea2bc;if(_0x54fd58['query']['includeAll']){_0xa4ea2d['include']=[{'all':!![]}];}return db[_0x1d40('0x2d')][_0x1d40('0x41')](_0xa4ea2d);})['then'](function(_0x3ef9d1){_0x367d02['rows']=_0x3ef9d1;return _0x367d02;})[_0x1d40('0x25')](respondWithFilteredResult(_0xf39503,_0xa4ea2d))['catch'](handleError(_0xf39503,null));};exports[_0x1d40('0x42')]=function(_0x2a5b37,_0x478e4d){var _0x4dea01={'raw':![],'where':{'id':_0x2a5b37[_0x1d40('0x43')]['id']}},_0x492730={};_0x492730['model']=_[_0x1d40('0x31')](db[_0x1d40('0x2d')]['rawAttributes']);_0x492730[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x2a5b37[_0x1d40('0x30')]);_0x492730[_0x1d40('0x32')]=_['intersection'](_0x492730[_0x1d40('0x2f')],_0x492730[_0x1d40('0x30')]);_0x4dea01[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x492730[_0x1d40('0x2f')],qs['fields'](_0x2a5b37['query'][_0x1d40('0x35')]));_0x4dea01['attributes']=_0x4dea01['attributes'][_0x1d40('0x36')]?_0x4dea01[_0x1d40('0x34')]:_0x492730['model'];if(_0x2a5b37[_0x1d40('0x30')]['includeAll']){_0x4dea01[_0x1d40('0x44')]=[{'all':!![]}];}_0x4dea01=_[_0x1d40('0x3e')]({},_0x4dea01,_0x2a5b37['options']);return db[_0x1d40('0x2d')][_0x1d40('0x45')](_0x4dea01)['then'](handleEntityNotFound(_0x478e4d,null))[_0x1d40('0x25')](respondWithResult(_0x478e4d,null))['catch'](handleError(_0x478e4d,null));};exports[_0x1d40('0x46')]=function(_0x5da169,_0x1b8a43){return db[_0x1d40('0x2d')][_0x1d40('0x46')](_0x5da169[_0x1d40('0x47')],{})['then'](respondWithResult(_0x1b8a43,0xc9))[_0x1d40('0x48')](handleError(_0x1b8a43,null));};exports[_0x1d40('0x49')]=function(_0x5a2b5c,_0x1a4a0a){if(_0x5a2b5c[_0x1d40('0x47')]['id']){delete _0x5a2b5c[_0x1d40('0x47')]['id'];}return db[_0x1d40('0x2d')][_0x1d40('0x45')]({'where':{'id':_0x5a2b5c[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x1a4a0a,null))[_0x1d40('0x25')](saveUpdates(_0x5a2b5c[_0x1d40('0x47')],null))[_0x1d40('0x25')](respondWithResult(_0x1a4a0a,null))[_0x1d40('0x48')](handleError(_0x1a4a0a,null));};exports['destroy']=function(_0x288a76,_0x1921d0){return db['DeskConfiguration'][_0x1d40('0x45')]({'where':{'id':_0x288a76[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x1921d0,null))[_0x1d40('0x25')](removeEntity(_0x1921d0,null))[_0x1d40('0x48')](handleError(_0x1921d0,null));};exports[_0x1d40('0x4a')]=function(_0x819d64,_0x553f28,_0x3b3450){var _0xf4fb24={};var _0x1146b7={};var _0xb0e22e;var _0x2d1881;return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0x819d64[_0x1d40('0x43')]['id']}})['then'](handleEntityNotFound(_0x553f28,null))[_0x1d40('0x25')](function(_0x4719ec){if(_0x4719ec){_0xb0e22e=_0x4719ec;_0x1146b7[_0x1d40('0x2f')]=_[_0x1d40('0x31')](db[_0x1d40('0x4c')][_0x1d40('0x4d')]);_0x1146b7[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x819d64[_0x1d40('0x30')]);_0x1146b7[_0x1d40('0x32')]=_[_0x1d40('0x33')](_0x1146b7[_0x1d40('0x2f')],_0x1146b7[_0x1d40('0x30')]);_0xf4fb24['attributes']=_[_0x1d40('0x33')](_0x1146b7[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x819d64['query'][_0x1d40('0x35')]));_0xf4fb24[_0x1d40('0x34')]=_0xf4fb24[_0x1d40('0x34')][_0x1d40('0x36')]?_0xf4fb24[_0x1d40('0x34')]:_0x1146b7['model'];_0xf4fb24[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x819d64[_0x1d40('0x30')][_0x1d40('0x3a')]);_0xf4fb24[_0x1d40('0x3b')]=qs[_0x1d40('0x32')](_[_0x1d40('0x3c')](_0x819d64[_0x1d40('0x30')],_0x1146b7[_0x1d40('0x32')]));if(_0x819d64[_0x1d40('0x30')][_0x1d40('0x3d')]){_0xf4fb24[_0x1d40('0x3b')]=_[_0x1d40('0x3e')](_0xf4fb24[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0xf4fb24[_0x1d40('0x34')],function(_0x4df967){var _0x5d532e={};_0x5d532e[_0x4df967]={'$like':'%'+_0x819d64['query'][_0x1d40('0x3d')]+'%'};return _0x5d532e;})});}_0xf4fb24=_['merge']({},_0xf4fb24,_0x819d64[_0x1d40('0x40')]);return _0xb0e22e[_0x1d40('0x4a')](_0xf4fb24);}})[_0x1d40('0x25')](function(_0x5d3b77){if(_0x5d3b77){_0x2d1881=_0x5d3b77[_0x1d40('0x36')];if(!_0x819d64[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xf4fb24[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x819d64['query'][_0x1d40('0x1f')]);_0xf4fb24['offset']=qs[_0x1d40('0x1d')](_0x819d64[_0x1d40('0x30')]['offset']);}return _0xb0e22e[_0x1d40('0x4a')](_0xf4fb24);}})[_0x1d40('0x25')](function(_0x14fdc9){if(_0x14fdc9){return _0x14fdc9?{'count':_0x2d1881,'rows':_0x14fdc9}:null;}})[_0x1d40('0x25')](respondWithResult(_0x553f28,null))[_0x1d40('0x48')](handleError(_0x553f28,null));};exports[_0x1d40('0x4e')]=function(_0x36606a,_0x2b6225,_0x11cbe7){var _0x47a8e9={};var _0x3d7728={};var _0x3f2b96;var _0x497bd7;return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0x36606a[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x2b6225,null))[_0x1d40('0x25')](function(_0x56eb9a){if(_0x56eb9a){_0x3f2b96=_0x56eb9a;_0x3d7728[_0x1d40('0x2f')]=_['keys'](db['DeskField'][_0x1d40('0x4d')]);_0x3d7728[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x36606a['query']);_0x3d7728[_0x1d40('0x32')]=_[_0x1d40('0x33')](_0x3d7728[_0x1d40('0x2f')],_0x3d7728[_0x1d40('0x30')]);_0x47a8e9[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x3d7728[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x36606a[_0x1d40('0x30')][_0x1d40('0x35')]));_0x47a8e9[_0x1d40('0x34')]=_0x47a8e9[_0x1d40('0x34')][_0x1d40('0x36')]?_0x47a8e9[_0x1d40('0x34')]:_0x3d7728[_0x1d40('0x2f')];_0x47a8e9[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x36606a['query']['sort']);_0x47a8e9[_0x1d40('0x3b')]=qs['filters'](_[_0x1d40('0x3c')](_0x36606a[_0x1d40('0x30')],_0x3d7728[_0x1d40('0x32')]));if(_0x36606a[_0x1d40('0x30')][_0x1d40('0x3d')]){_0x47a8e9['where']=_[_0x1d40('0x3e')](_0x47a8e9[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0x47a8e9[_0x1d40('0x34')],function(_0x3994f7){var _0x2ba72b={};_0x2ba72b[_0x3994f7]={'$like':'%'+_0x36606a[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0x2ba72b;})});}_0x47a8e9=_[_0x1d40('0x3e')]({},_0x47a8e9,_0x36606a[_0x1d40('0x40')]);return _0x3f2b96[_0x1d40('0x4e')](_0x47a8e9);}})[_0x1d40('0x25')](function(_0x36e4f8){if(_0x36e4f8){_0x497bd7=_0x36e4f8[_0x1d40('0x36')];if(!_0x36606a[_0x1d40('0x30')][_0x1d40('0x37')]('nolimit')){_0x47a8e9[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x36606a[_0x1d40('0x30')][_0x1d40('0x1f')]);_0x47a8e9[_0x1d40('0x1d')]=qs[_0x1d40('0x1d')](_0x36606a[_0x1d40('0x30')][_0x1d40('0x1d')]);}return _0x3f2b96['getSubjects'](_0x47a8e9);}})['then'](function(_0x554b9b){if(_0x554b9b){return _0x554b9b?{'count':_0x497bd7,'rows':_0x554b9b}:null;}})[_0x1d40('0x25')](respondWithResult(_0x2b6225,null))[_0x1d40('0x48')](handleError(_0x2b6225,null));};exports[_0x1d40('0x4f')]=function(_0x411728,_0x38d9f1,_0x5c1370){var _0xa287f9={};var _0x764934={};var _0x17c361;var _0x3c0ae3;return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0x411728['params']['id']}})['then'](handleEntityNotFound(_0x38d9f1,null))[_0x1d40('0x25')](function(_0x210fe0){if(_0x210fe0){_0x17c361=_0x210fe0;_0x764934['model']=_[_0x1d40('0x31')](db[_0x1d40('0x4c')][_0x1d40('0x4d')]);_0x764934[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x411728[_0x1d40('0x30')]);_0x764934['filters']=_[_0x1d40('0x33')](_0x764934[_0x1d40('0x2f')],_0x764934['query']);_0xa287f9['attributes']=_['intersection'](_0x764934[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x411728[_0x1d40('0x30')]['fields']));_0xa287f9[_0x1d40('0x34')]=_0xa287f9[_0x1d40('0x34')][_0x1d40('0x36')]?_0xa287f9['attributes']:_0x764934[_0x1d40('0x2f')];_0xa287f9[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x411728[_0x1d40('0x30')]['sort']);_0xa287f9[_0x1d40('0x3b')]=qs['filters'](_[_0x1d40('0x3c')](_0x411728[_0x1d40('0x30')],_0x764934[_0x1d40('0x32')]));if(_0x411728[_0x1d40('0x30')][_0x1d40('0x3d')]){_0xa287f9[_0x1d40('0x3b')]=_[_0x1d40('0x3e')](_0xa287f9[_0x1d40('0x3b')],{'$or':_['map'](_0xa287f9[_0x1d40('0x34')],function(_0x38aa96){var _0x25d66b={};_0x25d66b[_0x38aa96]={'$like':'%'+_0x411728[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0x25d66b;})});}_0xa287f9=_[_0x1d40('0x3e')]({},_0xa287f9,_0x411728[_0x1d40('0x40')]);return _0x17c361[_0x1d40('0x4f')](_0xa287f9);}})[_0x1d40('0x25')](function(_0x275d27){if(_0x275d27){_0x3c0ae3=_0x275d27[_0x1d40('0x36')];if(!_0x411728[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xa287f9[_0x1d40('0x1f')]=qs[_0x1d40('0x1f')](_0x411728['query'][_0x1d40('0x1f')]);_0xa287f9[_0x1d40('0x1d')]=qs[_0x1d40('0x1d')](_0x411728['query'][_0x1d40('0x1d')]);}return _0x17c361[_0x1d40('0x4f')](_0xa287f9);}})['then'](function(_0x559efe){if(_0x559efe){return _0x559efe?{'count':_0x3c0ae3,'rows':_0x559efe}:null;}})[_0x1d40('0x25')](respondWithResult(_0x38d9f1,null))[_0x1d40('0x48')](handleError(_0x38d9f1,null));};exports[_0x1d40('0x50')]=function(_0x5047c5,_0x182365,_0x22a464){var _0xbebc7={};var _0x23c691={};var _0x5099d9;var _0x591970;return db['DeskConfiguration'][_0x1d40('0x4b')]({'where':{'id':_0x5047c5[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x182365,null))[_0x1d40('0x25')](function(_0x39bf3a){if(_0x39bf3a){_0x5099d9=_0x39bf3a;_0x23c691['model']=_[_0x1d40('0x31')](db['Tag'][_0x1d40('0x4d')]);_0x23c691[_0x1d40('0x30')]=_[_0x1d40('0x31')](_0x5047c5[_0x1d40('0x30')]);_0x23c691['filters']=_[_0x1d40('0x33')](_0x23c691['model'],_0x23c691['query']);_0xbebc7[_0x1d40('0x34')]=_[_0x1d40('0x33')](_0x23c691[_0x1d40('0x2f')],qs[_0x1d40('0x35')](_0x5047c5[_0x1d40('0x30')][_0x1d40('0x35')]));_0xbebc7[_0x1d40('0x34')]=_0xbebc7[_0x1d40('0x34')]['length']?_0xbebc7[_0x1d40('0x34')]:_0x23c691[_0x1d40('0x2f')];_0xbebc7[_0x1d40('0x39')]=qs[_0x1d40('0x3a')](_0x5047c5[_0x1d40('0x30')][_0x1d40('0x3a')]);_0xbebc7[_0x1d40('0x3b')]=qs['filters'](_[_0x1d40('0x3c')](_0x5047c5[_0x1d40('0x30')],_0x23c691['filters']));if(_0x5047c5['query'][_0x1d40('0x3d')]){_0xbebc7[_0x1d40('0x3b')]=_[_0x1d40('0x3e')](_0xbebc7[_0x1d40('0x3b')],{'$or':_[_0x1d40('0x2c')](_0xbebc7[_0x1d40('0x34')],function(_0x57fbe2){var _0x50b70a={};_0x50b70a[_0x57fbe2]={'$like':'%'+_0x5047c5[_0x1d40('0x30')][_0x1d40('0x3d')]+'%'};return _0x50b70a;})});}_0xbebc7=_[_0x1d40('0x3e')]({},_0xbebc7,_0x5047c5['options']);return _0x5099d9['getTags'](_0xbebc7);}})['then'](function(_0x27ad0c){if(_0x27ad0c){_0x591970=_0x27ad0c['length'];if(!_0x5047c5[_0x1d40('0x30')][_0x1d40('0x37')](_0x1d40('0x38'))){_0xbebc7[_0x1d40('0x1f')]=qs['limit'](_0x5047c5['query'][_0x1d40('0x1f')]);_0xbebc7[_0x1d40('0x1d')]=qs['offset'](_0x5047c5[_0x1d40('0x30')]['offset']);}return _0x5099d9[_0x1d40('0x50')](_0xbebc7);}})['then'](function(_0x1f5b44){if(_0x1f5b44){return _0x1f5b44?{'count':_0x591970,'rows':_0x1f5b44}:null;}})['then'](respondWithResult(_0x182365,null))['catch'](handleError(_0x182365,null));};exports[_0x1d40('0x51')]=function(_0xf76369,_0x39bac1,_0xa9fe1c){if(_0xf76369[_0x1d40('0x47')]['id']){delete _0xf76369[_0x1d40('0x47')]['id'];}return db[_0x1d40('0x2d')][_0x1d40('0x4b')]({'where':{'id':_0xf76369[_0x1d40('0x43')]['id']}})[_0x1d40('0x25')](handleEntityNotFound(_0x39bac1,null))[_0x1d40('0x25')](function(_0x53a16c){if(_0x53a16c){return _0x53a16c['setTags'](_0xf76369['body'][_0x1d40('0x52')]||[]);}return null;})[_0x1d40('0x25')](respondWithResult(_0x39bac1,null))['catch'](handleError(_0x39bac1,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index b79807b..3c5afd3 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 _0xcf78=['define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x577e10,_0x40fe30){var _0x3a3e65=function(_0x57e467){while(--_0x57e467){_0x577e10['push'](_0x577e10['shift']());}};_0x3a3e65(++_0x40fe30);}(_0xcf78,0x13b));var _0x8cf7=function(_0x438d45,_0x10cbb0){_0x438d45=_0x438d45-0x0;var _0x583fa0=_0xcf78[_0x438d45];return _0x583fa0;};'use strict';var _=require(_0x8cf7('0x0'));var util=require('util');var logger=require(_0x8cf7('0x1'))(_0x8cf7('0x2'));var moment=require(_0x8cf7('0x3'));var BPromise=require('bluebird');var rp=require(_0x8cf7('0x4'));var fs=require('fs');var path=require(_0x8cf7('0x5'));var rimraf=require(_0x8cf7('0x6'));var config=require(_0x8cf7('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0x8cf7('0x8')]=function(_0x527791,_0x3f67e4){return _0x527791[_0x8cf7('0x9')](_0x8cf7('0xa'),attributes,{'tableName':_0x8cf7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa396=['define','DeskConfiguration','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x4198cc,_0x386df1){var _0x345d5d=function(_0x2f609f){while(--_0x2f609f){_0x4198cc['push'](_0x4198cc['shift']());}};_0x345d5d(++_0x386df1);}(_0xa396,0xaa));var _0x6a39=function(_0xd26b88,_0x492521){_0xd26b88=_0xd26b88-0x0;var _0x21e5f0=_0xa396[_0xd26b88];return _0x21e5f0;};'use strict';var _=require(_0x6a39('0x0'));var util=require(_0x6a39('0x1'));var logger=require('../../config/logger')(_0x6a39('0x2'));var moment=require(_0x6a39('0x3'));var BPromise=require('bluebird');var rp=require(_0x6a39('0x4'));var fs=require('fs');var path=require(_0x6a39('0x5'));var rimraf=require(_0x6a39('0x6'));var config=require(_0x6a39('0x7'));var attributes=require(_0x6a39('0x8'));module[_0x6a39('0x9')]=function(_0x1cd04b,_0x44279c){return _0x1cd04b[_0x6a39('0xa')](_0x6a39('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index d30dc37..07ddf0d 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 _0xdbc6=['client','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4833d3,_0x4cd31b){var _0x271ec3=function(_0x4f7fc0){while(--_0x4f7fc0){_0x4833d3['push'](_0x4833d3['shift']());}};_0x271ec3(++_0x4cd31b);}(_0xdbc6,0x13b));var _0x6dbc=function(_0x269c2d,_0x53df50){_0x269c2d=_0x269c2d-0x0;var _0x6c1bce=_0xdbc6[_0x269c2d];return _0x6c1bce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6dbc('0x0'));var BPromise=require('bluebird');var rs=require(_0x6dbc('0x1'));var fs=require('fs');var Redis=require(_0x6dbc('0x2'));var db=require(_0x6dbc('0x3'))['db'];var utils=require(_0x6dbc('0x4'));var logger=require(_0x6dbc('0x5'))(_0x6dbc('0x6'));var config=require('../../config/environment');var jayson=require(_0x6dbc('0x7'));var client=jayson[_0x6dbc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbfd1f,_0x18da4b,_0x24849e){return new BPromise(function(_0x2f028f,_0x3231d8){return client['request'](_0xbfd1f,_0x24849e)[_0x6dbc('0x9')](function(_0x3c57b4){logger['info'](_0x6dbc('0xa'),_0x18da4b,_0x6dbc('0xb'));logger['debug'](_0x6dbc('0xc'),_0x18da4b,_0x6dbc('0xb'),JSON[_0x6dbc('0xd')](_0x3c57b4));if(_0x3c57b4[_0x6dbc('0xe')]){if(_0x3c57b4[_0x6dbc('0xe')]['code']===0x1f4){logger['error'](_0x6dbc('0xa'),_0x18da4b,_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);return _0x3231d8(_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);}logger[_0x6dbc('0xe')](_0x6dbc('0xa'),_0x18da4b,_0x3c57b4[_0x6dbc('0xe')][_0x6dbc('0xf')]);return _0x2f028f(_0x3c57b4['error'][_0x6dbc('0xf')]);}else{logger[_0x6dbc('0x10')](_0x6dbc('0xa'),_0x18da4b,_0x6dbc('0xb'));_0x2f028f(_0x3c57b4[_0x6dbc('0x11')][_0x6dbc('0xf')]);}})[_0x6dbc('0x12')](function(_0x1ee71a){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x18da4b,_0x1ee71a);_0x3231d8(_0x1ee71a);});});} \ No newline at end of file +var _0xa321=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x4f9f37,_0x1c2b67){var _0x370c88=function(_0x37641b){while(--_0x37641b){_0x4f9f37['push'](_0x4f9f37['shift']());}};_0x370c88(++_0x1c2b67);}(_0xa321,0x9d));var _0x1a32=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa321[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4859d6,_0x13b4d2,_0x1fa204){return new BPromise(function(_0xdfa9fe,_0x3f4723){return client[_0x1a32('0x9')](_0x4859d6,_0x1fa204)['then'](function(_0x343faf){logger[_0x1a32('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x13b4d2,_0x1a32('0xb'));logger[_0x1a32('0xc')](_0x1a32('0xd'),_0x13b4d2,_0x1a32('0xb'),JSON[_0x1a32('0xe')](_0x343faf));if(_0x343faf[_0x1a32('0xf')]){if(_0x343faf['error'][_0x1a32('0x10')]===0x1f4){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0x3f4723(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x343faf['error'][_0x1a32('0x12')]);return _0xdfa9fe(_0x343faf[_0x1a32('0xf')][_0x1a32('0x12')]);}else{logger[_0x1a32('0xa')](_0x1a32('0x11'),_0x13b4d2,_0x1a32('0xb'));_0xdfa9fe(_0x343faf['result'][_0x1a32('0x12')]);}})[_0x1a32('0x13')](function(_0x47bb8e){logger[_0x1a32('0xf')](_0x1a32('0x11'),_0x13b4d2,_0x47bb8e);_0x3f4723(_0x47bb8e);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6e699d7..d24e933 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 _0x4295=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x4295,0x147));var _0x5429=function(_0x6f5598,_0xabeb74){_0x6f5598=_0x6f5598-0x0;var _0x1e1325=_0x4295[_0x6f5598];return _0x1e1325;};'use strict';var multer=require('multer');var util=require(_0x5429('0x0'));var path=require(_0x5429('0x1'));var timeout=require('connect-timeout');var express=require(_0x5429('0x2'));var router=express[_0x5429('0x3')]();var fs_extra=require(_0x5429('0x4'));var auth=require(_0x5429('0x5'));var interaction=require(_0x5429('0x6'));var config=require('../../config/environment');var controller=require(_0x5429('0x7'));router[_0x5429('0x8')]('/',auth[_0x5429('0x9')](),controller[_0x5429('0xa')]);router[_0x5429('0x8')](_0x5429('0xb'),auth[_0x5429('0x9')](),controller[_0x5429('0xc')]);router[_0x5429('0xd')]('/',auth[_0x5429('0x9')](),controller['create']);router[_0x5429('0xe')](_0x5429('0xb'),auth[_0x5429('0x9')](),controller[_0x5429('0xf')]);router[_0x5429('0x10')](_0x5429('0xb'),auth['isAuthenticated'](),controller[_0x5429('0x11')]);module[_0x5429('0x12')]=router; \ No newline at end of file +var _0xf55d=['show','post','create','update','delete','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0xf55d,0x14b));var _0xdf55=function(_0x3199dc,_0xdd7b46){_0x3199dc=_0x3199dc-0x0;var _0x3f2b4a=_0xf55d[_0x3199dc];return _0x3f2b4a;};'use strict';var multer=require(_0xdf55('0x0'));var util=require(_0xdf55('0x1'));var path=require(_0xdf55('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf55('0x3'));var router=express[_0xdf55('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdf55('0x5'));var interaction=require(_0xdf55('0x6'));var config=require(_0xdf55('0x7'));var controller=require(_0xdf55('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xdf55('0x9')]('/:id',auth[_0xdf55('0xa')](),controller[_0xdf55('0xb')]);router[_0xdf55('0xc')]('/',auth[_0xdf55('0xa')](),controller[_0xdf55('0xd')]);router['put']('/:id',auth[_0xdf55('0xa')](),controller[_0xdf55('0xe')]);router[_0xdf55('0xf')](_0xdf55('0x10'),auth[_0xdf55('0xa')](),controller[_0xdf55('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index c252628..701bdf8 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 _0xf63a=['customVariable','keyValue','picklist','STRING','BOOLEAN','ENUM','string','variable'];(function(_0x2bcd82,_0x427da9){var _0x39216c=function(_0x5128ad){while(--_0x5128ad){_0x2bcd82['push'](_0x2bcd82['shift']());}};_0x39216c(++_0x427da9);}(_0xf63a,0x8d));var _0xaf63=function(_0x4a2689,_0x314a16){_0x4a2689=_0x4a2689-0x0;var _0x463450=_0xf63a[_0x4a2689];return _0x463450;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xaf63('0x0')](_0xaf63('0x1'),_0xaf63('0x2'),_0xaf63('0x3'),_0xaf63('0x4'),_0xaf63('0x5')),'defaultValue':_0xaf63('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaf63('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xaf63('0x1'),_0xaf63('0x2'),_0xaf63('0x3'))},'keyContent':{'type':Sequelize[_0xaf63('0x6')]},'idField':{'type':Sequelize[_0xaf63('0x6')]},'nameField':{'type':Sequelize[_0xaf63('0x6')]},'customField':{'type':Sequelize[_0xaf63('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaf63('0x6')]}}; \ No newline at end of file +var _0xa07f=['variable','customVariable','keyValue','picklist','STRING','ENUM','sequelize','exports','string'];(function(_0x4cd4ca,_0x3c3623){var _0x2acb49=function(_0x381159){while(--_0x381159){_0x4cd4ca['push'](_0x4cd4ca['shift']());}};_0x2acb49(++_0x3c3623);}(_0xa07f,0x72));var _0xfa07=function(_0xaf88dc,_0x528f86){_0xaf88dc=_0xaf88dc-0x0;var _0x45e0a9=_0xa07f[_0xaf88dc];return _0x45e0a9;};'use strict';var Sequelize=require(_0xfa07('0x0'));module[_0xfa07('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfa07('0x2'),_0xfa07('0x3'),_0xfa07('0x4'),_0xfa07('0x5'),_0xfa07('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfa07('0x7')]},'key':{'type':Sequelize[_0xfa07('0x7')]},'keyType':{'type':Sequelize[_0xfa07('0x8')](_0xfa07('0x2'),_0xfa07('0x3'),_0xfa07('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfa07('0x7')]},'nameField':{'type':Sequelize[_0xfa07('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index d7745ba..51221b6 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 _0xca84=['type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','DeskField','rawAttributes','fieldName'];(function(_0xa02398,_0x1875b6){var _0x522b73=function(_0x391efc){while(--_0x391efc){_0xa02398['push'](_0xa02398['shift']());}};_0x522b73(++_0x1875b6);}(_0xca84,0xf5));var _0x4ca8=function(_0x5f28e3,_0x27a373){_0x5f28e3=_0x5f28e3-0x0;var _0x1529af=_0xca84[_0x5f28e3];return _0x1529af;};'use strict';var emlformat=require(_0x4ca8('0x0'));var rimraf=require(_0x4ca8('0x1'));var zipdir=require(_0x4ca8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ca8('0x3'));var moment=require(_0x4ca8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4ca8('0x5'));var util=require(_0x4ca8('0x6'));var path=require(_0x4ca8('0x7'));var sox=require(_0x4ca8('0x8'));var csv=require(_0x4ca8('0x9'));var ejs=require(_0x4ca8('0xa'));var fs=require('fs');var fs_extra=require(_0x4ca8('0xb'));var _=require(_0x4ca8('0xc'));var squel=require(_0x4ca8('0xd'));var crypto=require(_0x4ca8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4ca8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4ca8('0x10'));var Papa=require('papaparse');var Redis=require(_0x4ca8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ca8('0x12'));var as=require(_0x4ca8('0x13'));var hardwareService=require(_0x4ca8('0x14'));var logger=require(_0x4ca8('0x15'))(_0x4ca8('0x16'));var utils=require(_0x4ca8('0x17'));var config=require(_0x4ca8('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d58bf,_0x49f39e){_0x49f39e=_0x49f39e||0xcc;return function(_0x309286){if(_0x309286){return _0x4d58bf['sendStatus'](_0x49f39e);}return _0x4d58bf[_0x4ca8('0x19')](_0x49f39e)[_0x4ca8('0x1a')]();};}function respondWithResult(_0x522db3,_0x564518){_0x564518=_0x564518||0xc8;return function(_0xaf215e){if(_0xaf215e){return _0x522db3[_0x4ca8('0x19')](_0x564518)[_0x4ca8('0x1b')](_0xaf215e);}};}function respondWithFilteredResult(_0x770b5b,_0x379d8c){return function(_0x64c350){if(_0x64c350){var _0x342481=typeof _0x379d8c[_0x4ca8('0x1c')]===_0x4ca8('0x1d')&&typeof _0x379d8c[_0x4ca8('0x1e')]===_0x4ca8('0x1d');var _0x316b80=_0x64c350['count'];var _0xedd3=_0x342481?0x0:_0x379d8c[_0x4ca8('0x1c')];var _0x59e85b=_0x342481?_0x64c350[_0x4ca8('0x1f')]:_0x379d8c[_0x4ca8('0x1c')]+_0x379d8c['limit'];var _0x23b57a;if(_0x59e85b>=_0x316b80){_0x59e85b=_0x316b80;_0x23b57a=0xc8;}else{_0x23b57a=0xce;}_0x770b5b[_0x4ca8('0x19')](_0x23b57a);return _0x770b5b['set'](_0x4ca8('0x20'),_0xedd3+'-'+_0x59e85b+'/'+_0x316b80)['json'](_0x64c350);}return null;};}function patchUpdates(_0x2764e4){return function(_0x2e8cb8){try{jsonpatch[_0x4ca8('0x21')](_0x2e8cb8,_0x2764e4,!![]);}catch(_0x838ff0){return BPromise[_0x4ca8('0x22')](_0x838ff0);}return _0x2e8cb8['save']();};}function saveUpdates(_0x273a4d,_0xf50050){return function(_0x354072){if(_0x354072){return _0x354072[_0x4ca8('0x23')](_0x273a4d)[_0x4ca8('0x24')](function(_0x4d090a){return _0x4d090a;});}return null;};}function removeEntity(_0x30b731,_0x3691e2){return function(_0x398ed4){if(_0x398ed4){return _0x398ed4[_0x4ca8('0x25')]()[_0x4ca8('0x24')](function(){_0x30b731['status'](0xcc)[_0x4ca8('0x1a')]();});}};}function handleEntityNotFound(_0x297341,_0xbe9bd4){return function(_0x5c150c){if(!_0x5c150c){_0x297341[_0x4ca8('0x26')](0x194);}return _0x5c150c;};}function handleError(_0x22f857,_0x8443c6){_0x8443c6=_0x8443c6||0x1f4;return function(_0x1f2231){logger['error'](_0x1f2231[_0x4ca8('0x27')]);if(_0x1f2231[_0x4ca8('0x28')]){delete _0x1f2231['name'];}_0x22f857[_0x4ca8('0x19')](_0x8443c6)[_0x4ca8('0x29')](_0x1f2231);};}exports[_0x4ca8('0x2a')]=function(_0x2735d1,_0x1eb599){var _0x5f1ce5={},_0xab2501={},_0x418c30={'count':0x0,'rows':[]};var _0x4d28a9=_[_0x4ca8('0x2b')](db[_0x4ca8('0x2c')][_0x4ca8('0x2d')],function(_0xe96d6c){return{'name':_0xe96d6c[_0x4ca8('0x2e')],'type':_0xe96d6c[_0x4ca8('0x2f')][_0x4ca8('0x30')]};});_0xab2501['model']=_[_0x4ca8('0x2b')](_0x4d28a9,_0x4ca8('0x28'));_0xab2501[_0x4ca8('0x31')]=_[_0x4ca8('0x32')](_0x2735d1[_0x4ca8('0x31')]);_0xab2501[_0x4ca8('0x33')]=_['intersection'](_0xab2501[_0x4ca8('0x34')],_0xab2501['query']);_0x5f1ce5[_0x4ca8('0x35')]=_[_0x4ca8('0x36')](_0xab2501[_0x4ca8('0x34')],qs[_0x4ca8('0x37')](_0x2735d1['query']['fields']));_0x5f1ce5[_0x4ca8('0x35')]=_0x5f1ce5['attributes'][_0x4ca8('0x38')]?_0x5f1ce5[_0x4ca8('0x35')]:_0xab2501[_0x4ca8('0x34')];if(!_0x2735d1[_0x4ca8('0x31')][_0x4ca8('0x39')](_0x4ca8('0x3a'))){_0x5f1ce5[_0x4ca8('0x1e')]=qs[_0x4ca8('0x1e')](_0x2735d1['query']['limit']);_0x5f1ce5['offset']=qs['offset'](_0x2735d1[_0x4ca8('0x31')]['offset']);}_0x5f1ce5[_0x4ca8('0x3b')]=qs[_0x4ca8('0x3c')](_0x2735d1[_0x4ca8('0x31')][_0x4ca8('0x3c')]);_0x5f1ce5[_0x4ca8('0x3d')]=qs[_0x4ca8('0x33')](_['pick'](_0x2735d1[_0x4ca8('0x31')],_0xab2501[_0x4ca8('0x33')]),_0x4d28a9);if(_0x2735d1[_0x4ca8('0x31')]['filter']){_0x5f1ce5[_0x4ca8('0x3d')]=_[_0x4ca8('0x3e')](_0x5f1ce5[_0x4ca8('0x3d')],{'$or':_[_0x4ca8('0x2b')](_0x4d28a9,function(_0x52bbc){if(_0x52bbc[_0x4ca8('0x2f')]!==_0x4ca8('0x3f')){var _0x2fd55a={};_0x2fd55a[_0x52bbc[_0x4ca8('0x28')]]={'$like':'%'+_0x2735d1[_0x4ca8('0x31')]['filter']+'%'};return _0x2fd55a;}})});}_0x5f1ce5=_[_0x4ca8('0x3e')]({},_0x5f1ce5,_0x2735d1['options']);var _0x516453={'where':_0x5f1ce5[_0x4ca8('0x3d')]};return db[_0x4ca8('0x2c')][_0x4ca8('0x1f')](_0x516453)[_0x4ca8('0x24')](function(_0x184845){_0x418c30['count']=_0x184845;if(_0x2735d1[_0x4ca8('0x31')][_0x4ca8('0x40')]){_0x5f1ce5['include']=[{'all':!![]}];}return db[_0x4ca8('0x2c')][_0x4ca8('0x41')](_0x5f1ce5);})[_0x4ca8('0x24')](function(_0xeaf988){_0x418c30[_0x4ca8('0x42')]=_0xeaf988;return _0x418c30;})[_0x4ca8('0x24')](respondWithFilteredResult(_0x1eb599,_0x5f1ce5))[_0x4ca8('0x43')](handleError(_0x1eb599,null));};exports['show']=function(_0x447df4,_0x2be5b5){var _0x4937f4={'raw':!![],'where':{'id':_0x447df4[_0x4ca8('0x44')]['id']}},_0x346fa1={};_0x346fa1[_0x4ca8('0x34')]=_[_0x4ca8('0x32')](db[_0x4ca8('0x2c')][_0x4ca8('0x2d')]);_0x346fa1['query']=_[_0x4ca8('0x32')](_0x447df4['query']);_0x346fa1[_0x4ca8('0x33')]=_['intersection'](_0x346fa1[_0x4ca8('0x34')],_0x346fa1[_0x4ca8('0x31')]);_0x4937f4[_0x4ca8('0x35')]=_['intersection'](_0x346fa1[_0x4ca8('0x34')],qs[_0x4ca8('0x37')](_0x447df4[_0x4ca8('0x31')][_0x4ca8('0x37')]));_0x4937f4[_0x4ca8('0x35')]=_0x4937f4[_0x4ca8('0x35')][_0x4ca8('0x38')]?_0x4937f4[_0x4ca8('0x35')]:_0x346fa1[_0x4ca8('0x34')];if(_0x447df4[_0x4ca8('0x31')][_0x4ca8('0x40')]){_0x4937f4[_0x4ca8('0x45')]=[{'all':!![]}];}_0x4937f4=_[_0x4ca8('0x3e')]({},_0x4937f4,_0x447df4['options']);return db['DeskField'][_0x4ca8('0x46')](_0x4937f4)['then'](handleEntityNotFound(_0x2be5b5,null))[_0x4ca8('0x24')](respondWithResult(_0x2be5b5,null))['catch'](handleError(_0x2be5b5,null));};exports[_0x4ca8('0x47')]=function(_0x31957f,_0x38df23){return db[_0x4ca8('0x2c')][_0x4ca8('0x47')](_0x31957f[_0x4ca8('0x48')],{})[_0x4ca8('0x24')](respondWithResult(_0x38df23,0xc9))[_0x4ca8('0x43')](handleError(_0x38df23,null));};exports[_0x4ca8('0x23')]=function(_0x4d71e4,_0x362329){if(_0x4d71e4[_0x4ca8('0x48')]['id']){delete _0x4d71e4['body']['id'];}return db[_0x4ca8('0x2c')][_0x4ca8('0x46')]({'where':{'id':_0x4d71e4[_0x4ca8('0x44')]['id']}})[_0x4ca8('0x24')](handleEntityNotFound(_0x362329,null))[_0x4ca8('0x24')](saveUpdates(_0x4d71e4[_0x4ca8('0x48')],null))[_0x4ca8('0x24')](respondWithResult(_0x362329,null))[_0x4ca8('0x43')](handleError(_0x362329,null));};exports[_0x4ca8('0x25')]=function(_0x1528c3,_0x2c6d71){return db[_0x4ca8('0x2c')][_0x4ca8('0x46')]({'where':{'id':_0x1528c3['params']['id']}})[_0x4ca8('0x24')](handleEntityNotFound(_0x2c6d71,null))[_0x4ca8('0x24')](removeEntity(_0x2c6d71,null))[_0x4ca8('0x43')](handleError(_0x2c6d71,null));}; \ No newline at end of file +var _0x29e8=['includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','update','then','destroy','name','send','index','map','DeskField','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options'];(function(_0x5e08be,_0x9bf344){var _0x4db79e=function(_0x3b8cc3){while(--_0x3b8cc3){_0x5e08be['push'](_0x5e08be['shift']());}};_0x4db79e(++_0x9bf344);}(_0x29e8,0x116));var _0x829e=function(_0x2c07a6,_0x311e8d){_0x2c07a6=_0x2c07a6-0x0;var _0x34e485=_0x29e8[_0x2c07a6];return _0x34e485;};'use strict';var emlformat=require(_0x829e('0x0'));var rimraf=require(_0x829e('0x1'));var zipdir=require(_0x829e('0x2'));var jsonpatch=require(_0x829e('0x3'));var rp=require('request-promise');var moment=require(_0x829e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x829e('0x5'));var util=require(_0x829e('0x6'));var path=require(_0x829e('0x7'));var sox=require(_0x829e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x829e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x829e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x829e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x829e('0xc'));var Redis=require(_0x829e('0xd'));var authService=require(_0x829e('0xe'));var qs=require(_0x829e('0xf'));var as=require(_0x829e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x829e('0x11'))(_0x829e('0x12'));var utils=require(_0x829e('0x13'));var config=require(_0x829e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x829e('0x15'))['db'];function respondWithStatusCode(_0x74950b,_0x3a1697){_0x3a1697=_0x3a1697||0xcc;return function(_0x5b4107){if(_0x5b4107){return _0x74950b[_0x829e('0x16')](_0x3a1697);}return _0x74950b[_0x829e('0x17')](_0x3a1697)[_0x829e('0x18')]();};}function respondWithResult(_0x1f81bb,_0x2f7c64){_0x2f7c64=_0x2f7c64||0xc8;return function(_0x2162a8){if(_0x2162a8){return _0x1f81bb['status'](_0x2f7c64)[_0x829e('0x19')](_0x2162a8);}};}function respondWithFilteredResult(_0xc48685,_0x4b6de9){return function(_0x599f8b){if(_0x599f8b){var _0x39fd66=typeof _0x4b6de9[_0x829e('0x1a')]===_0x829e('0x1b')&&typeof _0x4b6de9['limit']==='undefined';var _0x8bdd5f=_0x599f8b['count'];var _0x2a7f8d=_0x39fd66?0x0:_0x4b6de9[_0x829e('0x1a')];var _0x5d43a0=_0x39fd66?_0x599f8b[_0x829e('0x1c')]:_0x4b6de9[_0x829e('0x1a')]+_0x4b6de9[_0x829e('0x1d')];var _0x22f012;if(_0x5d43a0>=_0x8bdd5f){_0x5d43a0=_0x8bdd5f;_0x22f012=0xc8;}else{_0x22f012=0xce;}_0xc48685['status'](_0x22f012);return _0xc48685['set']('Content-Range',_0x2a7f8d+'-'+_0x5d43a0+'/'+_0x8bdd5f)[_0x829e('0x19')](_0x599f8b);}return null;};}function patchUpdates(_0x44196d){return function(_0x370d2c){try{jsonpatch['apply'](_0x370d2c,_0x44196d,!![]);}catch(_0x5605dd){return BPromise['reject'](_0x5605dd);}return _0x370d2c['save']();};}function saveUpdates(_0x1fc75f,_0x30f9ca){return function(_0x4b5711){if(_0x4b5711){return _0x4b5711[_0x829e('0x1e')](_0x1fc75f)[_0x829e('0x1f')](function(_0x244b66){return _0x244b66;});}return null;};}function removeEntity(_0x5e264b,_0x1efdba){return function(_0x4e1082){if(_0x4e1082){return _0x4e1082[_0x829e('0x20')]()[_0x829e('0x1f')](function(){_0x5e264b[_0x829e('0x17')](0xcc)[_0x829e('0x18')]();});}};}function handleEntityNotFound(_0x37a6c1,_0x13adf6){return function(_0x108f15){if(!_0x108f15){_0x37a6c1[_0x829e('0x16')](0x194);}return _0x108f15;};}function handleError(_0xbe9590,_0x497128){_0x497128=_0x497128||0x1f4;return function(_0xfc8699){logger['error'](_0xfc8699['stack']);if(_0xfc8699[_0x829e('0x21')]){delete _0xfc8699[_0x829e('0x21')];}_0xbe9590[_0x829e('0x17')](_0x497128)[_0x829e('0x22')](_0xfc8699);};}exports[_0x829e('0x23')]=function(_0xffd177,_0x22572b){var _0x357f28={},_0x55c0e5={},_0x257e5a={'count':0x0,'rows':[]};var _0x3c23b6=_[_0x829e('0x24')](db[_0x829e('0x25')][_0x829e('0x26')],function(_0xa0c589){return{'name':_0xa0c589[_0x829e('0x27')],'type':_0xa0c589['type'][_0x829e('0x28')]};});_0x55c0e5[_0x829e('0x29')]=_['map'](_0x3c23b6,_0x829e('0x21'));_0x55c0e5['query']=_[_0x829e('0x2a')](_0xffd177['query']);_0x55c0e5['filters']=_[_0x829e('0x2b')](_0x55c0e5[_0x829e('0x29')],_0x55c0e5[_0x829e('0x2c')]);_0x357f28[_0x829e('0x2d')]=_[_0x829e('0x2b')](_0x55c0e5[_0x829e('0x29')],qs[_0x829e('0x2e')](_0xffd177[_0x829e('0x2c')][_0x829e('0x2e')]));_0x357f28[_0x829e('0x2d')]=_0x357f28[_0x829e('0x2d')][_0x829e('0x2f')]?_0x357f28['attributes']:_0x55c0e5[_0x829e('0x29')];if(!_0xffd177['query'][_0x829e('0x30')](_0x829e('0x31'))){_0x357f28[_0x829e('0x1d')]=qs[_0x829e('0x1d')](_0xffd177[_0x829e('0x2c')][_0x829e('0x1d')]);_0x357f28[_0x829e('0x1a')]=qs[_0x829e('0x1a')](_0xffd177[_0x829e('0x2c')][_0x829e('0x1a')]);}_0x357f28[_0x829e('0x32')]=qs[_0x829e('0x33')](_0xffd177[_0x829e('0x2c')][_0x829e('0x33')]);_0x357f28[_0x829e('0x34')]=qs['filters'](_['pick'](_0xffd177['query'],_0x55c0e5[_0x829e('0x35')]),_0x3c23b6);if(_0xffd177['query']['filter']){_0x357f28[_0x829e('0x34')]=_[_0x829e('0x36')](_0x357f28[_0x829e('0x34')],{'$or':_[_0x829e('0x24')](_0x3c23b6,function(_0x7c8f1b){if(_0x7c8f1b['type']!==_0x829e('0x37')){var _0x4ac416={};_0x4ac416[_0x7c8f1b[_0x829e('0x21')]]={'$like':'%'+_0xffd177[_0x829e('0x2c')]['filter']+'%'};return _0x4ac416;}})});}_0x357f28=_[_0x829e('0x36')]({},_0x357f28,_0xffd177[_0x829e('0x38')]);var _0x273dcb={'where':_0x357f28[_0x829e('0x34')]};return db[_0x829e('0x25')][_0x829e('0x1c')](_0x273dcb)[_0x829e('0x1f')](function(_0x397dec){_0x257e5a[_0x829e('0x1c')]=_0x397dec;if(_0xffd177[_0x829e('0x2c')][_0x829e('0x39')]){_0x357f28[_0x829e('0x3a')]=[{'all':!![]}];}return db[_0x829e('0x25')][_0x829e('0x3b')](_0x357f28);})[_0x829e('0x1f')](function(_0x132a2e){_0x257e5a[_0x829e('0x3c')]=_0x132a2e;return _0x257e5a;})[_0x829e('0x1f')](respondWithFilteredResult(_0x22572b,_0x357f28))[_0x829e('0x3d')](handleError(_0x22572b,null));};exports[_0x829e('0x3e')]=function(_0x118e0a,_0x50c4de){var _0x2997b9={'raw':!![],'where':{'id':_0x118e0a[_0x829e('0x3f')]['id']}},_0x37acd7={};_0x37acd7['model']=_[_0x829e('0x2a')](db[_0x829e('0x25')][_0x829e('0x26')]);_0x37acd7[_0x829e('0x2c')]=_[_0x829e('0x2a')](_0x118e0a[_0x829e('0x2c')]);_0x37acd7['filters']=_['intersection'](_0x37acd7[_0x829e('0x29')],_0x37acd7[_0x829e('0x2c')]);_0x2997b9[_0x829e('0x2d')]=_[_0x829e('0x2b')](_0x37acd7[_0x829e('0x29')],qs['fields'](_0x118e0a[_0x829e('0x2c')]['fields']));_0x2997b9['attributes']=_0x2997b9['attributes'][_0x829e('0x2f')]?_0x2997b9[_0x829e('0x2d')]:_0x37acd7[_0x829e('0x29')];if(_0x118e0a['query']['includeAll']){_0x2997b9[_0x829e('0x3a')]=[{'all':!![]}];}_0x2997b9=_['merge']({},_0x2997b9,_0x118e0a['options']);return db[_0x829e('0x25')][_0x829e('0x40')](_0x2997b9)[_0x829e('0x1f')](handleEntityNotFound(_0x50c4de,null))['then'](respondWithResult(_0x50c4de,null))[_0x829e('0x3d')](handleError(_0x50c4de,null));};exports[_0x829e('0x41')]=function(_0x55f2d5,_0x218fc3){return db[_0x829e('0x25')][_0x829e('0x41')](_0x55f2d5['body'],{})['then'](respondWithResult(_0x218fc3,0xc9))[_0x829e('0x3d')](handleError(_0x218fc3,null));};exports[_0x829e('0x1e')]=function(_0x38f8bf,_0x3f4655){if(_0x38f8bf[_0x829e('0x42')]['id']){delete _0x38f8bf[_0x829e('0x42')]['id'];}return db[_0x829e('0x25')][_0x829e('0x40')]({'where':{'id':_0x38f8bf[_0x829e('0x3f')]['id']}})[_0x829e('0x1f')](handleEntityNotFound(_0x3f4655,null))[_0x829e('0x1f')](saveUpdates(_0x38f8bf[_0x829e('0x42')],null))[_0x829e('0x1f')](respondWithResult(_0x3f4655,null))[_0x829e('0x3d')](handleError(_0x3f4655,null));};exports['destroy']=function(_0xbff9cc,_0x128f3a){return db[_0x829e('0x25')][_0x829e('0x40')]({'where':{'id':_0xbff9cc['params']['id']}})[_0x829e('0x1f')](handleEntityNotFound(_0x128f3a,null))['then'](removeEntity(_0x128f3a,null))['catch'](handleError(_0x128f3a,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9335aaa..7a46b86 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 _0x9d2b=['int_desk_fields','desk_unique_index','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField'];(function(_0x23c2c3,_0x27ecc8){var _0x41e09f=function(_0x5e6873){while(--_0x5e6873){_0x23c2c3['push'](_0x23c2c3['shift']());}};_0x41e09f(++_0x27ecc8);}(_0x9d2b,0x1a6));var _0xb9d2=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x9d2b[_0x1a4a06];return _0x49ec08;};'use strict';var _=require('lodash');var util=require(_0xb9d2('0x0'));var logger=require(_0xb9d2('0x1'))(_0xb9d2('0x2'));var moment=require(_0xb9d2('0x3'));var BPromise=require(_0xb9d2('0x4'));var rp=require(_0xb9d2('0x5'));var fs=require('fs');var path=require(_0xb9d2('0x6'));var rimraf=require(_0xb9d2('0x7'));var config=require(_0xb9d2('0x8'));var attributes=require(_0xb9d2('0x9'));module[_0xb9d2('0xa')]=function(_0x11db2d,_0x2c6ac1){return _0x11db2d['define'](_0xb9d2('0xb'),attributes,{'tableName':_0xb9d2('0xc'),'paranoid':![],'indexes':[{'name':_0xb9d2('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbde=['path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','api','moment','request-promise'];(function(_0x310428,_0xec9879){var _0x56c99d=function(_0x5f070a){while(--_0x5f070a){_0x310428['push'](_0x310428['shift']());}};_0x56c99d(++_0xec9879);}(_0xfbde,0x172));var _0xefbd=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xfbde[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xefbd('0x0'));var util=require(_0xefbd('0x1'));var logger=require('../../config/logger')(_0xefbd('0x2'));var moment=require(_0xefbd('0x3'));var BPromise=require('bluebird');var rp=require(_0xefbd('0x4'));var fs=require('fs');var path=require(_0xefbd('0x5'));var rimraf=require(_0xefbd('0x6'));var config=require(_0xefbd('0x7'));var attributes=require(_0xefbd('0x8'));module['exports']=function(_0x43742f,_0x70a370){return _0x43742f[_0xefbd('0x9')](_0xefbd('0xa'),attributes,{'tableName':_0xefbd('0xb'),'paranoid':![],'indexes':[{'name':_0xefbd('0xc'),'fields':[_0xefbd('0xd'),_0xefbd('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 94bf9b1..bc72921 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 _0x5d40=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3bdd14,_0x1c2221){var _0x1ad937=function(_0x557499){while(--_0x557499){_0x3bdd14['push'](_0x3bdd14['shift']());}};_0x1ad937(++_0x1c2221);}(_0x5d40,0x1bd));var _0x05d4=function(_0x1e0686,_0x3d21ed){_0x1e0686=_0x1e0686-0x0;var _0x4d8f1a=_0x5d40[_0x1e0686];return _0x4d8f1a;};'use strict';var _=require('lodash');var util=require(_0x05d4('0x0'));var moment=require(_0x05d4('0x1'));var BPromise=require(_0x05d4('0x2'));var rs=require(_0x05d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05d4('0x4'))['db'];var utils=require(_0x05d4('0x5'));var logger=require(_0x05d4('0x6'))(_0x05d4('0x7'));var config=require(_0x05d4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x05d4('0x9')][_0x05d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b70b0,_0x2b9c2f,_0x7dd211){return new BPromise(function(_0x1b2d9a,_0x155014){return client[_0x05d4('0xb')](_0x4b70b0,_0x7dd211)[_0x05d4('0xc')](function(_0xa1f996){logger[_0x05d4('0xd')](_0x05d4('0xe'),_0x2b9c2f,_0x05d4('0xf'));logger[_0x05d4('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2b9c2f,_0x05d4('0xf'),JSON[_0x05d4('0x11')](_0xa1f996));if(_0xa1f996[_0x05d4('0x12')]){if(_0xa1f996[_0x05d4('0x12')][_0x05d4('0x13')]===0x1f4){logger['error'](_0x05d4('0xe'),_0x2b9c2f,_0xa1f996[_0x05d4('0x12')]['message']);return _0x155014(_0xa1f996[_0x05d4('0x12')]['message']);}logger['error'](_0x05d4('0xe'),_0x2b9c2f,_0xa1f996[_0x05d4('0x12')][_0x05d4('0x14')]);return _0x1b2d9a(_0xa1f996[_0x05d4('0x12')][_0x05d4('0x14')]);}else{logger[_0x05d4('0xd')]('DeskField,\x20%s,\x20%s',_0x2b9c2f,_0x05d4('0xf'));_0x1b2d9a(_0xa1f996['result']['message']);}})[_0x05d4('0x15')](function(_0x44ed3d){logger['error']('DeskField,\x20%s,\x20%s',_0x2b9c2f,_0x44ed3d);_0x155014(_0x44ed3d);});});} \ No newline at end of file +var _0xb9e7=['then','info','DeskField,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x24c489,_0x448537){var _0x3a711d=function(_0x4ec0ed){while(--_0x4ec0ed){_0x24c489['push'](_0x24c489['shift']());}};_0x3a711d(++_0x448537);}(_0xb9e7,0x135));var _0x7b9e=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0xb9e7[_0x24cc72];return _0xd49f1e;};'use strict';var _=require(_0x7b9e('0x0'));var util=require(_0x7b9e('0x1'));var moment=require(_0x7b9e('0x2'));var BPromise=require(_0x7b9e('0x3'));var rs=require(_0x7b9e('0x4'));var fs=require('fs');var Redis=require(_0x7b9e('0x5'));var db=require(_0x7b9e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b9e('0x7'))('rpc');var config=require(_0x7b9e('0x8'));var jayson=require(_0x7b9e('0x9'));var client=jayson[_0x7b9e('0xa')][_0x7b9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x986f1,_0x4ce734,_0x1c5925){return new BPromise(function(_0xcd94e1,_0x248bbd){return client[_0x7b9e('0xc')](_0x986f1,_0x1c5925)[_0x7b9e('0xd')](function(_0x387f8f){logger[_0x7b9e('0xe')](_0x7b9e('0xf'),_0x4ce734,'request\x20sent');logger[_0x7b9e('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4ce734,'request\x20sent',JSON['stringify'](_0x387f8f));if(_0x387f8f[_0x7b9e('0x11')]){if(_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x12')]===0x1f4){logger[_0x7b9e('0x11')]('DeskField,\x20%s,\x20%s',_0x4ce734,_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x13')]);return _0x248bbd(_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x13')]);}logger[_0x7b9e('0x11')]('DeskField,\x20%s,\x20%s',_0x4ce734,_0x387f8f['error'][_0x7b9e('0x13')]);return _0xcd94e1(_0x387f8f[_0x7b9e('0x11')][_0x7b9e('0x13')]);}else{logger[_0x7b9e('0xe')](_0x7b9e('0xf'),_0x4ce734,_0x7b9e('0x14'));_0xcd94e1(_0x387f8f[_0x7b9e('0x15')][_0x7b9e('0x13')]);}})[_0x7b9e('0x16')](function(_0x49a734){logger['error'](_0x7b9e('0xf'),_0x4ce734,_0x49a734);_0x248bbd(_0x49a734);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index cf6df82..9613896 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 _0x1dce=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','exports','multer'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x1dce,0x1f3));var _0xe1dc=function(_0x41b2bb,_0x4324e3){_0x41b2bb=_0x41b2bb-0x0;var _0x7e369b=_0x1dce[_0x41b2bb];return _0x7e369b;};'use strict';var multer=require(_0xe1dc('0x0'));var util=require('util');var path=require(_0xe1dc('0x1'));var timeout=require(_0xe1dc('0x2'));var express=require(_0xe1dc('0x3'));var router=express['Router']();var fs_extra=require(_0xe1dc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe1dc('0x5'));var controller=require('./intDynamics365Account.controller');router[_0xe1dc('0x6')]('/',auth[_0xe1dc('0x7')](),controller[_0xe1dc('0x8')]);router['get'](_0xe1dc('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xe1dc('0x6')](_0xe1dc('0xa'),auth[_0xe1dc('0x7')](),controller[_0xe1dc('0xb')]);router['get'](_0xe1dc('0xc'),auth['isAuthenticated'](),controller[_0xe1dc('0xd')]);router['post']('/',auth[_0xe1dc('0x7')](),controller[_0xe1dc('0xe')]);router['post'](_0xe1dc('0xa'),auth[_0xe1dc('0x7')](),controller[_0xe1dc('0xf')]);router[_0xe1dc('0x10')](_0xe1dc('0x9'),auth['isAuthenticated'](),controller[_0xe1dc('0x11')]);router[_0xe1dc('0x12')]('/:id',auth[_0xe1dc('0x7')](),controller['destroy']);module[_0xe1dc('0x13')]=router; \ No newline at end of file +var _0x4471=['show','getConfigurations','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated'];(function(_0x28f097,_0x169f73){var _0x3a21b8=function(_0x5b3273){while(--_0x5b3273){_0x28f097['push'](_0x28f097['shift']());}};_0x3a21b8(++_0x169f73);}(_0x4471,0x1d4));var _0x1447=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x4471[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x1447('0x0'));var path=require(_0x1447('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1447('0x2')]();var fs_extra=require(_0x1447('0x3'));var auth=require(_0x1447('0x4'));var interaction=require(_0x1447('0x5'));var config=require(_0x1447('0x6'));var controller=require(_0x1447('0x7'));router[_0x1447('0x8')]('/',auth['isAuthenticated'](),controller[_0x1447('0x9')]);router[_0x1447('0x8')](_0x1447('0xa'),auth[_0x1447('0xb')](),controller[_0x1447('0xc')]);router['get']('/:id/configurations',auth[_0x1447('0xb')](),controller[_0x1447('0xd')]);router['get']('/:id/fields',auth[_0x1447('0xb')](),controller[_0x1447('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1447('0xf')]);router[_0x1447('0x10')](_0x1447('0x11'),auth[_0x1447('0xb')](),controller[_0x1447('0x12')]);router[_0x1447('0x13')](_0x1447('0xa'),auth[_0x1447('0xb')](),controller[_0x1447('0x14')]);router[_0x1447('0x15')](_0x1447('0xa'),auth[_0x1447('0xb')](),controller[_0x1447('0x16')]);module[_0x1447('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f273a75..c561377 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 _0xf360=['STRING','BOOLEAN','sequelize','exports'];(function(_0x719cfb,_0x28037c){var _0x6ec12f=function(_0x6cd353){while(--_0x6cd353){_0x719cfb['push'](_0x719cfb['shift']());}};_0x6ec12f(++_0x28037c);}(_0xf360,0x9e));var _0x0f36=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf360[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x0f36('0x0'));module[_0x0f36('0x1')]={'name':{'type':Sequelize[_0x0f36('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0f36('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x0f36('0x2')]},'clientId':{'type':Sequelize[_0x0f36('0x2')]},'clientSecret':{'type':Sequelize[_0x0f36('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0f36('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0f36('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe260=['BOOLEAN','sequelize','STRING'];(function(_0x1603ac,_0x3b5bce){var _0x482c04=function(_0x111c37){while(--_0x111c37){_0x1603ac['push'](_0x1603ac['shift']());}};_0x482c04(++_0x3b5bce);}(_0xe260,0x94));var _0x0e26=function(_0xe80f2a,_0x1d256a){_0xe80f2a=_0xe80f2a-0x0;var _0x5a9664=_0xe260[_0xe80f2a];return _0x5a9664;};'use strict';var Sequelize=require(_0x0e26('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e26('0x1')]},'username':{'type':Sequelize[_0x0e26('0x1')]},'password':{'type':Sequelize[_0x0e26('0x1')]},'remoteUri':{'type':Sequelize[_0x0e26('0x1')]},'tenantId':{'type':Sequelize[_0x0e26('0x1')]},'clientId':{'type':Sequelize[_0x0e26('0x1')]},'clientSecret':{'type':Sequelize[_0x0e26('0x1')]},'serverUrl':{'type':Sequelize[_0x0e26('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0e26('0x1')]},'modernAuthentication':{'type':Sequelize[_0x0e26('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5892160..e1cab44 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 _0xc17d=['createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','ticketnumber','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','CloudProvider','data5','modernAuthentication','https://login.microsoftonline.com/','tenantId','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','OptionSet','Options','Value','UserLocalizedLabel','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','../../config/logger','api','../../components/integrations/configuration','status','json','offset','undefined','limit','set','Content-Range','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','count','includeAll','include','show','params','length','find','create','body','catch','getConfigurations','findOne','filter','hasOwnProperty','addConfiguration','Subjects','Descriptions','getDescriptions','channel','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','directioncode','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon'];(function(_0x4a3be0,_0xfd3c52){var _0x7bc703=function(_0x145992){while(--_0x145992){_0x4a3be0['push'](_0x4a3be0['shift']());}};_0x7bc703(++_0xfd3c52);}(_0xc17d,0x10a));var _0xdc17=function(_0xdd46e8,_0x1b3b76){_0xdd46e8=_0xdd46e8-0x0;var _0x2283c5=_0xc17d[_0xdd46e8];return _0x2283c5;};'use strict';var rp=require('request-promise');var util=require(_0xdc17('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xdc17('0x1'))(_0xdc17('0x2'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdc17('0x3'));function respondWithResult(_0x26bed3,_0x50feb3){_0x50feb3=_0x50feb3||0xc8;return function(_0x633a63){if(_0x633a63){return _0x26bed3[_0xdc17('0x4')](_0x50feb3)[_0xdc17('0x5')](_0x633a63);}};}function respondWithFilteredResult(_0x2801c5,_0x24a550){return function(_0x5b2ffa){if(_0x5b2ffa){var _0x59f959=typeof _0x24a550[_0xdc17('0x6')]===_0xdc17('0x7')&&typeof _0x24a550[_0xdc17('0x8')]===_0xdc17('0x7');var _0x3b85d8=_0x5b2ffa['count'];var _0x521455=_0x59f959?0x0:_0x24a550[_0xdc17('0x6')];var _0x5a1145=_0x59f959?_0x5b2ffa['count']:_0x24a550[_0xdc17('0x6')]+_0x24a550['limit'];var _0x193e2a;if(_0x5a1145>=_0x3b85d8){_0x5a1145=_0x3b85d8;_0x193e2a=0xc8;}else{_0x193e2a=0xce;}_0x2801c5[_0xdc17('0x4')](_0x193e2a);return _0x2801c5[_0xdc17('0x9')](_0xdc17('0xa'),_0x521455+'-'+_0x5a1145+'/'+_0x3b85d8)[_0xdc17('0x5')](_0x5b2ffa);}return null;};}function saveUpdates(_0x1aa520){return function(_0x316bc4){if(_0x316bc4){return _0x316bc4[_0xdc17('0xb')](_0x1aa520)['then'](function(_0x37e344){return _0x37e344;});}return null;};}function removeEntity(_0x470f20){return function(_0x366981){if(_0x366981){return _0x366981[_0xdc17('0xc')]()[_0xdc17('0xd')](function(){_0x470f20['status'](0xcc)[_0xdc17('0xe')]();});}};}function handleEntityNotFound(_0x2a5ba9){return function(_0x1996c8){if(!_0x1996c8){_0x2a5ba9[_0xdc17('0xf')](0x194);}return _0x1996c8;};}function handleError(_0x233cef,_0x1a36f7){_0x1a36f7=_0x1a36f7||0x1f4;return function(_0x49e552){logger[_0xdc17('0x10')](_0x49e552[_0xdc17('0x11')]);if(_0x49e552[_0xdc17('0x12')]){delete _0x49e552[_0xdc17('0x12')];}_0x233cef[_0xdc17('0x4')](_0x1a36f7)[_0xdc17('0x13')](_0x49e552);};}exports[_0xdc17('0x14')]=function(_0x312785,_0x244837){var _0x384035={},_0x1d9e66={},_0x2d1b17={'count':0x0,'rows':[]};var _0x5b4acb=_[_0xdc17('0x15')](db[_0xdc17('0x16')][_0xdc17('0x17')],function(_0x4326b4){return{'name':_0x4326b4[_0xdc17('0x18')],'type':_0x4326b4[_0xdc17('0x19')]['key']};});_0x1d9e66['model']=_['map'](_0x5b4acb,_0xdc17('0x12'));_0x1d9e66[_0xdc17('0x1a')]=_[_0xdc17('0x1b')](_0x312785[_0xdc17('0x1a')]);_0x1d9e66[_0xdc17('0x1c')]=_[_0xdc17('0x1d')](_0x1d9e66['model'],_0x1d9e66[_0xdc17('0x1a')]);_0x384035[_0xdc17('0x1e')]=_[_0xdc17('0x1d')](_0x1d9e66[_0xdc17('0x1f')],qs[_0xdc17('0x20')](_0x312785[_0xdc17('0x1a')]['fields']));_0x384035[_0xdc17('0x1e')]=_0x384035[_0xdc17('0x1e')]['length']?_0x384035[_0xdc17('0x1e')]:_0x1d9e66[_0xdc17('0x1f')];if(!_0x312785[_0xdc17('0x1a')]['hasOwnProperty'](_0xdc17('0x21'))){_0x384035[_0xdc17('0x8')]=qs[_0xdc17('0x8')](_0x312785[_0xdc17('0x1a')][_0xdc17('0x8')]);_0x384035[_0xdc17('0x6')]=qs['offset'](_0x312785[_0xdc17('0x1a')][_0xdc17('0x6')]);}_0x384035[_0xdc17('0x22')]=qs['sort'](_0x312785[_0xdc17('0x1a')][_0xdc17('0x23')]);_0x384035['where']=qs[_0xdc17('0x1c')](_[_0xdc17('0x24')](_0x312785['query'],_0x1d9e66[_0xdc17('0x1c')]),_0x5b4acb);if(_0x312785[_0xdc17('0x1a')]['filter']){_0x384035[_0xdc17('0x25')]=_[_0xdc17('0x26')](_0x384035[_0xdc17('0x25')],{'$or':_[_0xdc17('0x15')](_0x5b4acb,function(_0x42ceb0){if(_0x42ceb0[_0xdc17('0x19')]!==_0xdc17('0x27')){var _0x28ab7a={};_0x28ab7a[_0x42ceb0[_0xdc17('0x12')]]={'$like':'%'+_0x312785[_0xdc17('0x1a')]['filter']+'%'};return _0x28ab7a;}})});}_0x384035=_[_0xdc17('0x26')]({},_0x384035,_0x312785[_0xdc17('0x28')]);var _0x1039da={'where':_0x384035[_0xdc17('0x25')]};return db['Dynamics365Account'][_0xdc17('0x29')](_0x1039da)[_0xdc17('0xd')](function(_0xa657d2){_0x2d1b17[_0xdc17('0x29')]=_0xa657d2;if(_0x312785['query'][_0xdc17('0x2a')]){_0x384035[_0xdc17('0x2b')]=[{'all':!![]}];}return db[_0xdc17('0x16')]['findAll'](_0x384035);})[_0xdc17('0xd')](function(_0x569d9a){_0x2d1b17['rows']=_0x569d9a;return _0x2d1b17;})['then'](respondWithFilteredResult(_0x244837,_0x384035))['catch'](handleError(_0x244837,null));};exports[_0xdc17('0x2c')]=function(_0x4f2edc,_0xa376c){var _0x5dcc22={'raw':![],'where':{'id':_0x4f2edc[_0xdc17('0x2d')]['id']}},_0x525310={};_0x525310[_0xdc17('0x1f')]=_[_0xdc17('0x1b')](db[_0xdc17('0x16')][_0xdc17('0x17')]);_0x525310[_0xdc17('0x1a')]=_[_0xdc17('0x1b')](_0x4f2edc[_0xdc17('0x1a')]);_0x525310[_0xdc17('0x1c')]=_[_0xdc17('0x1d')](_0x525310[_0xdc17('0x1f')],_0x525310['query']);_0x5dcc22['attributes']=_[_0xdc17('0x1d')](_0x525310[_0xdc17('0x1f')],qs[_0xdc17('0x20')](_0x4f2edc[_0xdc17('0x1a')]['fields']));_0x5dcc22['attributes']=_0x5dcc22['attributes'][_0xdc17('0x2e')]?_0x5dcc22['attributes']:_0x525310[_0xdc17('0x1f')];if(_0x4f2edc[_0xdc17('0x1a')]['includeAll']){_0x5dcc22[_0xdc17('0x2b')]=[{'all':!![]}];}_0x5dcc22=_[_0xdc17('0x26')]({},_0x5dcc22,_0x4f2edc[_0xdc17('0x28')]);return db[_0xdc17('0x16')][_0xdc17('0x2f')](_0x5dcc22)['then'](handleEntityNotFound(_0xa376c,null))[_0xdc17('0xd')](respondWithResult(_0xa376c,null))['catch'](handleError(_0xa376c,null));};exports[_0xdc17('0x30')]=function(_0x118a5c,_0x387826){return db['Dynamics365Account']['create'](_0x118a5c[_0xdc17('0x31')],{})['then'](respondWithResult(_0x387826,0xc9))[_0xdc17('0x32')](handleError(_0x387826,null));};exports[_0xdc17('0xb')]=function(_0x2f6768,_0x1405a6){if(_0x2f6768['body']['id']){delete _0x2f6768[_0xdc17('0x31')]['id'];}return db[_0xdc17('0x16')][_0xdc17('0x2f')]({'where':{'id':_0x2f6768[_0xdc17('0x2d')]['id']}})[_0xdc17('0xd')](handleEntityNotFound(_0x1405a6,null))[_0xdc17('0xd')](saveUpdates(_0x2f6768[_0xdc17('0x31')],null))[_0xdc17('0xd')](respondWithResult(_0x1405a6,null))['catch'](handleError(_0x1405a6,null));};exports[_0xdc17('0xc')]=function(_0xc4c135,_0x333b95){return db[_0xdc17('0x16')][_0xdc17('0x2f')]({'where':{'id':_0xc4c135['params']['id']}})[_0xdc17('0xd')](handleEntityNotFound(_0x333b95,null))[_0xdc17('0xd')](removeEntity(_0x333b95,null))[_0xdc17('0x32')](handleError(_0x333b95,null));};exports[_0xdc17('0x33')]=function(_0x27c76b,_0x32d409){var _0x58ca5c={};var _0x2fa049={};var _0x228728;var _0x142db6;return db['Dynamics365Account'][_0xdc17('0x34')]({'where':{'id':_0x27c76b[_0xdc17('0x2d')]['id']}})[_0xdc17('0xd')](handleEntityNotFound(_0x32d409,null))['then'](function(_0x46a0f6){if(_0x46a0f6){_0x228728=_0x46a0f6;_0x2fa049[_0xdc17('0x1f')]=_['keys'](db['Dynamics365Configuration'][_0xdc17('0x17')]);_0x2fa049[_0xdc17('0x1a')]=_[_0xdc17('0x1b')](_0x27c76b['query']);_0x2fa049['filters']=_[_0xdc17('0x1d')](_0x2fa049[_0xdc17('0x1f')],_0x2fa049[_0xdc17('0x1a')]);_0x58ca5c[_0xdc17('0x1e')]=_[_0xdc17('0x1d')](_0x2fa049[_0xdc17('0x1f')],qs[_0xdc17('0x20')](_0x27c76b['query'][_0xdc17('0x20')]));_0x58ca5c[_0xdc17('0x1e')]=_0x58ca5c['attributes'][_0xdc17('0x2e')]?_0x58ca5c[_0xdc17('0x1e')]:_0x2fa049[_0xdc17('0x1f')];_0x58ca5c[_0xdc17('0x22')]=qs[_0xdc17('0x23')](_0x27c76b[_0xdc17('0x1a')][_0xdc17('0x23')]);_0x58ca5c[_0xdc17('0x25')]=qs[_0xdc17('0x1c')](_[_0xdc17('0x24')](_0x27c76b[_0xdc17('0x1a')],_0x2fa049['filters']));if(_0x27c76b[_0xdc17('0x1a')][_0xdc17('0x35')]){_0x58ca5c['where']=_[_0xdc17('0x26')](_0x58ca5c['where'],{'$or':_[_0xdc17('0x15')](_0x58ca5c['attributes'],function(_0x1f8594){var _0x12921f={};_0x12921f[_0x1f8594]={'$like':'%'+_0x27c76b[_0xdc17('0x1a')][_0xdc17('0x35')]+'%'};return _0x12921f;})});}_0x58ca5c=_[_0xdc17('0x26')]({},_0x58ca5c,_0x27c76b[_0xdc17('0x28')]);return _0x228728[_0xdc17('0x33')](_0x58ca5c);}})[_0xdc17('0xd')](function(_0x296af5){if(_0x296af5){_0x142db6=_0x296af5['length'];if(!_0x27c76b['query'][_0xdc17('0x36')](_0xdc17('0x21'))){_0x58ca5c[_0xdc17('0x8')]=qs['limit'](_0x27c76b['query'][_0xdc17('0x8')]);_0x58ca5c[_0xdc17('0x6')]=qs[_0xdc17('0x6')](_0x27c76b[_0xdc17('0x1a')][_0xdc17('0x6')]);}return _0x228728[_0xdc17('0x33')](_0x58ca5c);}})['then'](function(_0x2e8862){if(_0x2e8862){return _0x2e8862?{'count':_0x142db6,'rows':_0x2e8862}:null;}})[_0xdc17('0xd')](respondWithResult(_0x32d409,null))[_0xdc17('0x32')](handleError(_0x32d409,null));};exports[_0xdc17('0x37')]=function(_0x5c5972,_0x2fd3dd){if(_0x5c5972[_0xdc17('0x31')]['id']){delete _0x5c5972[_0xdc17('0x31')]['id'];}return db['Dynamics365Account'][_0xdc17('0x34')]({'where':{'id':_0x5c5972[_0xdc17('0x2d')]['id']}})[_0xdc17('0xd')](handleEntityNotFound(_0x2fd3dd,null))[_0xdc17('0xd')](function(_0x1090b4){if(_0x1090b4){_0x5c5972['body']['AccountId']=_0x1090b4['id'];_0x5c5972[_0xdc17('0x31')][_0xdc17('0x38')]=integrations['getSubjects'](_0x5c5972['body']['channel'],_0x5c5972['body'][_0xdc17('0x19')]);_0x5c5972[_0xdc17('0x31')][_0xdc17('0x39')]=integrations[_0xdc17('0x3a')](_0x5c5972['body'][_0xdc17('0x3b')],_0x5c5972['body'][_0xdc17('0x19')]);return db[_0xdc17('0x3c')]['create'](_0x5c5972[_0xdc17('0x31')],{'include':[{'model':db[_0xdc17('0x3d')],'as':_0xdc17('0x38')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xdc17('0xd')](respondWithResult(_0x2fd3dd,null))[_0xdc17('0x32')](handleError(_0x2fd3dd,null));};function sanitizeRemoteUri(_0x473890){var _0x374a81=_0x473890[_0xdc17('0x3e')](-0x1);if(_0x374a81==='/')return _0x473890[_0xdc17('0x3f')](0x0,_0x473890[_0xdc17('0x40')](_0x374a81));return _0x473890;}function getWebApiUrl(_0x135107){return util[_0xdc17('0x41')](_0xdc17('0x42'),_0x135107);}exports[_0xdc17('0x43')]=function(_0x39dc04,_0x1e07e6){var _0x5b1664=_0x39dc04[_0xdc17('0x1a')]['ticketType'];var _0x17515a=_0x5b1664===_0xdc17('0x44')?_0xdc17('0x45'):_0xdc17('0x46');var _0x22c9ca='';var _0x567175='';var _0x28e0a3='';var _0x5bf168='';var _0x3f9cf3='';var _0x1c1a57='';var _0x283ab4='';var _0xc6b92d='';var _0x1b844c=['title',_0xdc17('0x47'),_0xdc17('0x48'),'ownerid',_0xdc17('0x49'),_0xdc17('0x4a'),_0xdc17('0x4b'),'regardingobjectid',_0xdc17('0x4c'),'phonecall_activity_parties'];var _0xfb12f4=['accountidname',_0xdc17('0x4d'),_0xdc17('0x4e'),'billedserviceunits',_0xdc17('0x4f'),_0xdc17('0x50'),_0xdc17('0x51'),'contractidname',_0xdc17('0x52'),_0xdc17('0x53'),'createdbyname',_0xdc17('0x54'),_0xdc17('0x55'),_0xdc17('0x56'),_0xdc17('0x57'),'customeridname',_0xdc17('0x58'),_0xdc17('0x59'),_0xdc17('0x5a'),'entitlementidname','entityimage_timestamp','entityimage_url',_0xdc17('0x5b'),_0xdc17('0x5c'),_0xdc17('0x5d'),_0xdc17('0x5e'),_0xdc17('0x5f'),'influencescore',_0xdc17('0x60'),_0xdc17('0x61'),_0xdc17('0x62'),_0xdc17('0x63'),_0xdc17('0x64'),'modifiedbyname',_0xdc17('0x65'),_0xdc17('0x66'),'modifiedonbehalfbyname',_0xdc17('0x67'),_0xdc17('0x68'),'msdyn_iotalertname',_0xdc17('0x69'),_0xdc17('0x6a'),_0xdc17('0x6b'),_0xdc17('0x6c'),_0xdc17('0x6d'),'owneridyominame','parentcaseidname',_0xdc17('0x6e'),_0xdc17('0x6f'),'prioritycodename',_0xdc17('0x70'),_0xdc17('0x71'),_0xdc17('0x72'),_0xdc17('0x73'),_0xdc17('0x74'),_0xdc17('0x75'),_0xdc17('0x76'),_0xdc17('0x77'),_0xdc17('0x78'),_0xdc17('0x79'),_0xdc17('0x7a'),'statecode',_0xdc17('0x7b'),'subjectidname',_0xdc17('0x7c'),'timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode',_0xdc17('0x7d')];var _0x2544c9=_0x1b844c[_0xdc17('0x7e')](_0xfb12f4);return db[_0xdc17('0x16')]['findOne']({'where':{'id':_0x39dc04[_0xdc17('0x2d')]['id']},'attributes':['id',_0xdc17('0x7f'),_0xdc17('0x80'),_0xdc17('0x81'),'tenantId',_0xdc17('0x82'),_0xdc17('0x83'),'modernAuthentication'],'include':[{'model':db[_0xdc17('0x84')],'as':_0xdc17('0x84'),'attributes':['id',_0xdc17('0x85'),'data7']}]})[_0xdc17('0xd')](handleEntityNotFound(_0x1e07e6,null))[_0xdc17('0xd')](function(_0x40690a){if(_0x40690a){if(_0x40690a[_0xdc17('0x86')]){_0x40690a['access_token']=_0x40690a[_0xdc17('0x84')][_0xdc17('0x85')];_0xc6b92d=sanitizeRemoteUri(_0x40690a[_0xdc17('0x84')]['data7']);_0x283ab4=getWebApiUrl(_0xc6b92d);return _0x40690a;}_0xc6b92d=sanitizeRemoteUri(_0x40690a['remoteUri']);_0x283ab4=getWebApiUrl(_0xc6b92d);var _0x847853={'method':'POST','uri':_0xdc17('0x87')+_0x40690a[_0xdc17('0x88')]+_0xdc17('0x89'),'form':{'client_id':_0x40690a[_0xdc17('0x82')],'resource':_0xc6b92d,'username':_0x40690a[_0xdc17('0x7f')],'password':_0x40690a[_0xdc17('0x80')],'grant_type':_0xdc17('0x80'),'client_secret':_0x40690a[_0xdc17('0x83')]},'json':!![]};return rp(_0x847853);}})['then'](function(_0x5c0a35){_0x1c1a57=_0x5c0a35['access_token'];var _0xed22cf={'method':'GET','uri':encodeURI(_0x283ab4+_0xdc17('0x8a')+_0x17515a+'\x27'),'headers':{'Authorization':_0xdc17('0x8b')+_0x1c1a57,'If-None-Match':null,'OData-Version':_0xdc17('0x8c')},'json':!![]};return rp(_0xed22cf);})[_0xdc17('0xd')](function(_0x2a7666){var _0x2e6730=_0x2a7666['value'][0x0];var _0x5cdab0=_0x2e6730[_0xdc17('0x8d')];var _0x3da541={'method':_0xdc17('0x8e'),'uri':_0x283ab4+_0xdc17('0x8f')+_0x5cdab0+_0xdc17('0x90'),'headers':{'Authorization':_0xdc17('0x8b')+_0x1c1a57,'If-None-Match':null,'OData-Version':_0xdc17('0x8c')},'json':!![]};return rp(_0x3da541);})['then'](function(_0x29f00d){_0x22c9ca=_0x29f00d;_0x567175=_0x22c9ca[_0xdc17('0x91')];_0x567175=_[_0xdc17('0x92')](_0x567175,function(_0x2196a1){return!_0x2544c9['includes'](_0x2196a1[_0xdc17('0x93')]);});var _0x5298ae=[];var _0x4eb777=[];_0x567175[_0xdc17('0x94')](function(_0xacb0cf){if(_0xacb0cf[_0xdc17('0x95')]){var _0x1af7d2=_0xacb0cf[_0xdc17('0x95')]['substring'](_0xacb0cf[_0xdc17('0x95')][_0xdc17('0x40')]('.')+0x1);if(_0x1af7d2===_0xdc17('0x96')){_0x5298ae[_0xdc17('0x97')](getSelectList(_0x283ab4,_0x5b1664,_0x4eb777,_0x22c9ca[_0xdc17('0x8d')],_0xacb0cf[_0xdc17('0x8d')],_0x1c1a57));}}});return Promise['all'](_0x5298ae);})[_0xdc17('0xd')](function(_0x243c29){_0x28e0a3=_0x243c29[0x0];var _0x2939c7=[];var _0x1bb52d=[];_0x567175[_0xdc17('0x94')](function(_0x2ad6af){if(!_[_0xdc17('0x98')](_0x2ad6af[_0xdc17('0x95')])){var _0x48301a=_0x2ad6af['@odata.type'][_0xdc17('0x3f')](_0x2ad6af[_0xdc17('0x95')][_0xdc17('0x40')]('.')+0x1);if(_0x48301a===_0xdc17('0x99')){_0x2939c7[_0xdc17('0x97')](getBooleanList(_0x283ab4,_0x5b1664,_0x1bb52d,_0x22c9ca[_0xdc17('0x8d')],_0x2ad6af[_0xdc17('0x8d')],_0x1c1a57));}}});return Promise['all'](_0x2939c7);})[_0xdc17('0xd')](function(_0x1366fc){_0x5bf168=_0x1366fc[0x0];var _0x24dff6=[];var _0x546f0d=[];_0x567175['forEach'](function(_0x496dfc){if(_0x496dfc['@odata.type']){var _0x5e9c00=_0x496dfc['@odata.type'][_0xdc17('0x3f')](_0x496dfc[_0xdc17('0x95')][_0xdc17('0x40')]('.')+0x1);if(_0x5e9c00===_0xdc17('0x9a')||_0x5e9c00===_0xdc17('0x9b')||_0x5e9c00===_0xdc17('0x9c')||_0x5e9c00==='IntegerAttributeMetadata'||_0x5e9c00===_0xdc17('0x9d')||_0x5e9c00===_0xdc17('0x9e')||_0x5e9c00==='StatusAttributeMetadata'||_0x5e9c00==='EntityNameAttributeMetadata'||_0x5e9c00===_0xdc17('0x9f')||_0x5e9c00===_0xdc17('0xa0')){_0x24dff6[_0xdc17('0x97')](getInputList(_0x283ab4,_0x5b1664,_0x5e9c00,_0x546f0d,_0x22c9ca[_0xdc17('0x8d')],_0x496dfc[_0xdc17('0x8d')],_0x1c1a57));}}});return Promise['all'](_0x24dff6);})['then'](function(_0x2b2863){_0x3f9cf3=_0x2b2863[0x0];var _0x528358=_0x28e0a3[_0xdc17('0x7e')](_0x5bf168)[_0xdc17('0x7e')](_0x3f9cf3);var _0x56fd2b={'count':_0x528358[_0xdc17('0x2e')],'rows':_0x528358};return _0x56fd2b;})[_0xdc17('0xd')](respondWithResult(_0x1e07e6,null))['catch'](function(_0x1fd180){var _0x54d8a6=_0x39dc04['query'][_0xdc17('0xa1')]?0x1f4:_0x1fd180[_0xdc17('0xa2')]||0x1f4;logger['error'](_0x1fd180[_0xdc17('0x11')]);delete _0x1fd180[_0xdc17('0x12')];if(_0x54d8a6===0x191){_0x54d8a6=0x190;}_0x1e07e6['status'](_0x54d8a6)[_0xdc17('0x13')](_0x39dc04[_0xdc17('0x1a')][_0xdc17('0xa1')]?{'message':_0xdc17('0xa3'),'statusCode':_0x1fd180[_0xdc17('0xa2')]}:_0x1fd180);});};function getSelectList(_0x1982f8,_0x33d864,_0x41c3d2,_0x3e4a0f,_0x447a79,_0x3b4cb7){var _0x2c5df0={'method':_0xdc17('0x8e'),'uri':_0x1982f8+_0xdc17('0x8f')+_0x3e4a0f+_0xdc17('0xa4')+_0x447a79+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x3b4cb7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2c5df0)[_0xdc17('0xd')](function(_0x18566c){var _0x261838=[];var _0x4e47c8=_0x18566c[_0xdc17('0xa5')][_0xdc17('0xa6')];_0x4e47c8[_0xdc17('0x94')](function(_0x1a4472){_0x261838['push']({'name':_0x1a4472['Label']['UserLocalizedLabel']['Label'],'value':String(_0x1a4472[_0xdc17('0xa7')])});});var _0x1033ba={'id':_0x33d864+'_'+_0x18566c[_0xdc17('0x93')],'name':_0x18566c['DisplayName'][_0xdc17('0xa8')][_0xdc17('0xa9')],'custom':![],'options':_0x261838};_0x41c3d2[_0xdc17('0x97')](_0x1033ba);return _0x41c3d2;});}function getBooleanList(_0x196432,_0x48a8c1,_0x289727,_0x4938e6,_0x1bbb48,_0x2483b7){var _0x2cdd21={'method':'GET','uri':_0x196432+_0xdc17('0x8f')+_0x4938e6+_0xdc17('0xa4')+_0x1bbb48+_0xdc17('0xaa'),'headers':{'Authorization':_0xdc17('0x8b')+_0x2483b7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2cdd21)['then'](function(_0x5d5413){var _0x4a7a94=[];_0x4a7a94[_0xdc17('0x97')]({'name':_0x5d5413[_0xdc17('0xa5')][_0xdc17('0xab')]['Label'][_0xdc17('0xa8')][_0xdc17('0xa9')],'value':_0xdc17('0xac')},{'name':_0x5d5413[_0xdc17('0xa5')]['FalseOption'][_0xdc17('0xa9')][_0xdc17('0xa8')][_0xdc17('0xa9')],'value':'false'});var _0x4984c1={'id':_0x48a8c1+'_'+_0x5d5413['LogicalName'],'name':_0x5d5413[_0xdc17('0xad')][_0xdc17('0xa8')][_0xdc17('0xa9')],'custom':![],'options':_0x4a7a94};_0x289727['push'](_0x4984c1);return _0x289727;});}function getInputList(_0x4854a9,_0x352c10,_0x3e0fd8,_0x1f26fb,_0xe870e5,_0x21f48d,_0x5cb98e){var _0x272859={'method':_0xdc17('0x8e'),'uri':_0x4854a9+_0xdc17('0x8f')+_0xe870e5+_0xdc17('0xa4')+_0x21f48d+_0xdc17('0xae')+_0x3e0fd8+_0xdc17('0xaf'),'headers':{'Authorization':_0xdc17('0x8b')+_0x5cb98e,'If-None-Match':null,'OData-Version':_0xdc17('0x8c')},'json':!![]};return rp(_0x272859)[_0xdc17('0xd')](function(_0x5667fe){var _0x45acb1={'id':_0x352c10+'_'+_0x5667fe[_0xdc17('0x93')],'name':_0x5667fe[_0xdc17('0xad')][_0xdc17('0xa8')]?_0x5667fe[_0xdc17('0xad')][_0xdc17('0xa8')][_0xdc17('0xa9')]:_0x5667fe[_0xdc17('0x93')],'custom':![],'options':[]};_0x1f26fb[_0xdc17('0x97')](_0x45acb1);return _0x1f26fb;});} \ No newline at end of file +var _0x557d=['4.0','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../mysqldb','../../components/integrations/configuration','status','offset','limit','count','set','Content-Range','json','update','then','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','fields','length','model','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','format','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','overriddencreatedon','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','tenantId','clientSecret','modernAuthentication','CloudProvider','data5','data7','remoteUri','/oauth2/token','clientId','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','EntityDefinitions(','Attributes','remove','forEach','@odata.type','substring','MetadataId','all','isNil','BooleanAttributeMetadata','push','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)'];(function(_0x4fd994,_0x199a8a){var _0x5034ec=function(_0x43e6e0){while(--_0x43e6e0){_0x4fd994['push'](_0x4fd994['shift']());}};_0x5034ec(++_0x199a8a);}(_0x557d,0xcb));var _0xd557=function(_0x1ca28e,_0x85fc2e){_0x1ca28e=_0x1ca28e-0x0;var _0x568605=_0x557d[_0x1ca28e];return _0x568605;};'use strict';var rp=require(_0xd557('0x0'));var util=require(_0xd557('0x1'));var _=require(_0xd557('0x2'));var qs=require(_0xd557('0x3'));var logger=require('../../config/logger')('api');var db=require(_0xd557('0x4'))['db'];var integrations=require(_0xd557('0x5'));function respondWithResult(_0x49f9e8,_0x5f19d7){_0x5f19d7=_0x5f19d7||0xc8;return function(_0x479940){if(_0x479940){return _0x49f9e8[_0xd557('0x6')](_0x5f19d7)['json'](_0x479940);}};}function respondWithFilteredResult(_0x477de0,_0x2d3ccd){return function(_0x21173d){if(_0x21173d){var _0x559202=typeof _0x2d3ccd[_0xd557('0x7')]==='undefined'&&typeof _0x2d3ccd[_0xd557('0x8')]==='undefined';var _0x4c7cb8=_0x21173d[_0xd557('0x9')];var _0x380e15=_0x559202?0x0:_0x2d3ccd[_0xd557('0x7')];var _0x4626eb=_0x559202?_0x21173d[_0xd557('0x9')]:_0x2d3ccd[_0xd557('0x7')]+_0x2d3ccd['limit'];var _0x11e6a5;if(_0x4626eb>=_0x4c7cb8){_0x4626eb=_0x4c7cb8;_0x11e6a5=0xc8;}else{_0x11e6a5=0xce;}_0x477de0[_0xd557('0x6')](_0x11e6a5);return _0x477de0[_0xd557('0xa')](_0xd557('0xb'),_0x380e15+'-'+_0x4626eb+'/'+_0x4c7cb8)[_0xd557('0xc')](_0x21173d);}return null;};}function saveUpdates(_0x2ee82a){return function(_0x1cf73c){if(_0x1cf73c){return _0x1cf73c[_0xd557('0xd')](_0x2ee82a)[_0xd557('0xe')](function(_0x413e84){return _0x413e84;});}return null;};}function removeEntity(_0x48c933){return function(_0x3704db){if(_0x3704db){return _0x3704db[_0xd557('0xf')]()[_0xd557('0xe')](function(){_0x48c933[_0xd557('0x6')](0xcc)[_0xd557('0x10')]();});}};}function handleEntityNotFound(_0x438be0){return function(_0x208348){if(!_0x208348){_0x438be0[_0xd557('0x11')](0x194);}return _0x208348;};}function handleError(_0x1277b7,_0x28d212){_0x28d212=_0x28d212||0x1f4;return function(_0x38e628){logger[_0xd557('0x12')](_0x38e628[_0xd557('0x13')]);if(_0x38e628['name']){delete _0x38e628[_0xd557('0x14')];}_0x1277b7[_0xd557('0x6')](_0x28d212)[_0xd557('0x15')](_0x38e628);};}exports[_0xd557('0x16')]=function(_0x16d941,_0x4c7978){var _0xf2ff6a={},_0x4ecf3b={},_0x789481={'count':0x0,'rows':[]};var _0x5aa7d5=_['map'](db[_0xd557('0x17')][_0xd557('0x18')],function(_0x2335f3){return{'name':_0x2335f3[_0xd557('0x19')],'type':_0x2335f3['type'][_0xd557('0x1a')]};});_0x4ecf3b['model']=_[_0xd557('0x1b')](_0x5aa7d5,'name');_0x4ecf3b['query']=_[_0xd557('0x1c')](_0x16d941['query']);_0x4ecf3b[_0xd557('0x1d')]=_[_0xd557('0x1e')](_0x4ecf3b['model'],_0x4ecf3b[_0xd557('0x1f')]);_0xf2ff6a[_0xd557('0x20')]=_['intersection'](_0x4ecf3b['model'],qs[_0xd557('0x21')](_0x16d941[_0xd557('0x1f')]['fields']));_0xf2ff6a[_0xd557('0x20')]=_0xf2ff6a['attributes'][_0xd557('0x22')]?_0xf2ff6a[_0xd557('0x20')]:_0x4ecf3b[_0xd557('0x23')];if(!_0x16d941[_0xd557('0x1f')]['hasOwnProperty'](_0xd557('0x24'))){_0xf2ff6a['limit']=qs['limit'](_0x16d941[_0xd557('0x1f')][_0xd557('0x8')]);_0xf2ff6a[_0xd557('0x7')]=qs[_0xd557('0x7')](_0x16d941[_0xd557('0x1f')][_0xd557('0x7')]);}_0xf2ff6a[_0xd557('0x25')]=qs[_0xd557('0x26')](_0x16d941['query']['sort']);_0xf2ff6a['where']=qs[_0xd557('0x1d')](_['pick'](_0x16d941[_0xd557('0x1f')],_0x4ecf3b['filters']),_0x5aa7d5);if(_0x16d941[_0xd557('0x1f')][_0xd557('0x27')]){_0xf2ff6a[_0xd557('0x28')]=_[_0xd557('0x29')](_0xf2ff6a[_0xd557('0x28')],{'$or':_['map'](_0x5aa7d5,function(_0x5e490e){if(_0x5e490e[_0xd557('0x2a')]!==_0xd557('0x2b')){var _0x52644a={};_0x52644a[_0x5e490e[_0xd557('0x14')]]={'$like':'%'+_0x16d941[_0xd557('0x1f')][_0xd557('0x27')]+'%'};return _0x52644a;}})});}_0xf2ff6a=_[_0xd557('0x29')]({},_0xf2ff6a,_0x16d941[_0xd557('0x2c')]);var _0x33dcb1={'where':_0xf2ff6a[_0xd557('0x28')]};return db[_0xd557('0x17')]['count'](_0x33dcb1)['then'](function(_0xb2b6b2){_0x789481[_0xd557('0x9')]=_0xb2b6b2;if(_0x16d941['query'][_0xd557('0x2d')]){_0xf2ff6a[_0xd557('0x2e')]=[{'all':!![]}];}return db[_0xd557('0x17')][_0xd557('0x2f')](_0xf2ff6a);})[_0xd557('0xe')](function(_0x3507a6){_0x789481[_0xd557('0x30')]=_0x3507a6;return _0x789481;})[_0xd557('0xe')](respondWithFilteredResult(_0x4c7978,_0xf2ff6a))[_0xd557('0x31')](handleError(_0x4c7978,null));};exports[_0xd557('0x32')]=function(_0x25615c,_0x4d5dfd){var _0x1233ba={'raw':![],'where':{'id':_0x25615c[_0xd557('0x33')]['id']}},_0x3ce461={};_0x3ce461[_0xd557('0x23')]=_['keys'](db[_0xd557('0x17')][_0xd557('0x18')]);_0x3ce461[_0xd557('0x1f')]=_[_0xd557('0x1c')](_0x25615c[_0xd557('0x1f')]);_0x3ce461[_0xd557('0x1d')]=_[_0xd557('0x1e')](_0x3ce461[_0xd557('0x23')],_0x3ce461[_0xd557('0x1f')]);_0x1233ba[_0xd557('0x20')]=_['intersection'](_0x3ce461[_0xd557('0x23')],qs[_0xd557('0x21')](_0x25615c[_0xd557('0x1f')][_0xd557('0x21')]));_0x1233ba[_0xd557('0x20')]=_0x1233ba['attributes']['length']?_0x1233ba[_0xd557('0x20')]:_0x3ce461[_0xd557('0x23')];if(_0x25615c['query']['includeAll']){_0x1233ba[_0xd557('0x2e')]=[{'all':!![]}];}_0x1233ba=_[_0xd557('0x29')]({},_0x1233ba,_0x25615c[_0xd557('0x2c')]);return db[_0xd557('0x17')]['find'](_0x1233ba)[_0xd557('0xe')](handleEntityNotFound(_0x4d5dfd,null))[_0xd557('0xe')](respondWithResult(_0x4d5dfd,null))[_0xd557('0x31')](handleError(_0x4d5dfd,null));};exports[_0xd557('0x34')]=function(_0x4fcf12,_0x5bf23a){return db[_0xd557('0x17')][_0xd557('0x34')](_0x4fcf12['body'],{})[_0xd557('0xe')](respondWithResult(_0x5bf23a,0xc9))[_0xd557('0x31')](handleError(_0x5bf23a,null));};exports[_0xd557('0xd')]=function(_0x10d26b,_0x4c28a8){if(_0x10d26b['body']['id']){delete _0x10d26b['body']['id'];}return db[_0xd557('0x17')]['find']({'where':{'id':_0x10d26b['params']['id']}})[_0xd557('0xe')](handleEntityNotFound(_0x4c28a8,null))['then'](saveUpdates(_0x10d26b[_0xd557('0x35')],null))[_0xd557('0xe')](respondWithResult(_0x4c28a8,null))[_0xd557('0x31')](handleError(_0x4c28a8,null));};exports[_0xd557('0xf')]=function(_0x4b511a,_0x1b3096){return db[_0xd557('0x17')][_0xd557('0x36')]({'where':{'id':_0x4b511a[_0xd557('0x33')]['id']}})['then'](handleEntityNotFound(_0x1b3096,null))['then'](removeEntity(_0x1b3096,null))[_0xd557('0x31')](handleError(_0x1b3096,null));};exports[_0xd557('0x37')]=function(_0x4061c2,_0x3b42ae){var _0x674a50={};var _0x5de964={};var _0xd995b2;var _0xf97915;return db[_0xd557('0x17')][_0xd557('0x38')]({'where':{'id':_0x4061c2['params']['id']}})[_0xd557('0xe')](handleEntityNotFound(_0x3b42ae,null))['then'](function(_0x21bbe0){if(_0x21bbe0){_0xd995b2=_0x21bbe0;_0x5de964[_0xd557('0x23')]=_['keys'](db[_0xd557('0x39')]['rawAttributes']);_0x5de964[_0xd557('0x1f')]=_[_0xd557('0x1c')](_0x4061c2[_0xd557('0x1f')]);_0x5de964[_0xd557('0x1d')]=_[_0xd557('0x1e')](_0x5de964[_0xd557('0x23')],_0x5de964['query']);_0x674a50[_0xd557('0x20')]=_[_0xd557('0x1e')](_0x5de964[_0xd557('0x23')],qs[_0xd557('0x21')](_0x4061c2[_0xd557('0x1f')][_0xd557('0x21')]));_0x674a50['attributes']=_0x674a50['attributes'][_0xd557('0x22')]?_0x674a50[_0xd557('0x20')]:_0x5de964[_0xd557('0x23')];_0x674a50[_0xd557('0x25')]=qs['sort'](_0x4061c2[_0xd557('0x1f')]['sort']);_0x674a50[_0xd557('0x28')]=qs[_0xd557('0x1d')](_[_0xd557('0x3a')](_0x4061c2[_0xd557('0x1f')],_0x5de964[_0xd557('0x1d')]));if(_0x4061c2[_0xd557('0x1f')][_0xd557('0x27')]){_0x674a50[_0xd557('0x28')]=_[_0xd557('0x29')](_0x674a50[_0xd557('0x28')],{'$or':_[_0xd557('0x1b')](_0x674a50['attributes'],function(_0x3cba6f){var _0x3b20fd={};_0x3b20fd[_0x3cba6f]={'$like':'%'+_0x4061c2['query']['filter']+'%'};return _0x3b20fd;})});}_0x674a50=_[_0xd557('0x29')]({},_0x674a50,_0x4061c2[_0xd557('0x2c')]);return _0xd995b2[_0xd557('0x37')](_0x674a50);}})[_0xd557('0xe')](function(_0x533ba1){if(_0x533ba1){_0xf97915=_0x533ba1[_0xd557('0x22')];if(!_0x4061c2[_0xd557('0x1f')]['hasOwnProperty'](_0xd557('0x24'))){_0x674a50[_0xd557('0x8')]=qs[_0xd557('0x8')](_0x4061c2[_0xd557('0x1f')][_0xd557('0x8')]);_0x674a50['offset']=qs[_0xd557('0x7')](_0x4061c2['query']['offset']);}return _0xd995b2['getConfigurations'](_0x674a50);}})[_0xd557('0xe')](function(_0x56397f){if(_0x56397f){return _0x56397f?{'count':_0xf97915,'rows':_0x56397f}:null;}})[_0xd557('0xe')](respondWithResult(_0x3b42ae,null))[_0xd557('0x31')](handleError(_0x3b42ae,null));};exports[_0xd557('0x3b')]=function(_0x2cd8d6,_0x189e6f){if(_0x2cd8d6[_0xd557('0x35')]['id']){delete _0x2cd8d6['body']['id'];}return db['Dynamics365Account'][_0xd557('0x38')]({'where':{'id':_0x2cd8d6[_0xd557('0x33')]['id']}})[_0xd557('0xe')](handleEntityNotFound(_0x189e6f,null))['then'](function(_0x3f7533){if(_0x3f7533){_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3c')]=_0x3f7533['id'];_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3d')]=integrations[_0xd557('0x3e')](_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3f')],_0x2cd8d6['body'][_0xd557('0x2a')]);_0x2cd8d6['body'][_0xd557('0x40')]=integrations[_0xd557('0x41')](_0x2cd8d6[_0xd557('0x35')][_0xd557('0x3f')],_0x2cd8d6['body'][_0xd557('0x2a')]);return db[_0xd557('0x39')][_0xd557('0x34')](_0x2cd8d6['body'],{'include':[{'model':db[_0xd557('0x42')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0xd557('0x40')}]});}return null;})['then'](respondWithResult(_0x189e6f,null))[_0xd557('0x31')](handleError(_0x189e6f,null));};function sanitizeRemoteUri(_0x5bc33c){var _0x824afd=_0x5bc33c[_0xd557('0x43')](-0x1);if(_0x824afd==='/')return _0x5bc33c['substring'](0x0,_0x5bc33c[_0xd557('0x44')](_0x824afd));return _0x5bc33c;}function getWebApiUrl(_0x2617fb){return util[_0xd557('0x45')]('%s/api/data/v9.0/',_0x2617fb);}exports[_0xd557('0x46')]=function(_0x5f2916,_0x1c4062){var _0x1ef38f=_0x5f2916[_0xd557('0x1f')][_0xd557('0x47')];var _0x42b7ec=_0x1ef38f===_0xd557('0x48')?'Incident':_0xd557('0x49');var _0xd1521='';var _0x107a48='';var _0x45afa1='';var _0x19dfe6='';var _0x58e05b='';var _0xfbaae6='';var _0x4b3253='';var _0x57772e='';var _0x4c8e06=[_0xd557('0x4a'),'description',_0xd557('0x4b'),_0xd557('0x4c'),_0xd557('0x4d'),'subject',_0xd557('0x4e'),_0xd557('0x4f'),_0xd557('0x50'),_0xd557('0x51')];var _0x1ea207=[_0xd557('0x52'),_0xd557('0x53'),_0xd557('0x54'),_0xd557('0x55'),_0xd557('0x56'),_0xd557('0x57'),'contractdetailidname',_0xd557('0x58'),_0xd557('0x59'),_0xd557('0x5a'),_0xd557('0x5b'),_0xd557('0x5c'),_0xd557('0x5d'),_0xd557('0x5e'),_0xd557('0x5f'),_0xd557('0x60'),_0xd557('0x61'),_0xd557('0x62'),_0xd557('0x63'),_0xd557('0x64'),_0xd557('0x65'),_0xd557('0x66'),_0xd557('0x67'),_0xd557('0x68'),_0xd557('0x69'),_0xd557('0x6a'),_0xd557('0x6b'),'influencescore',_0xd557('0x6c'),_0xd557('0x6d'),_0xd557('0x6e'),_0xd557('0x6f'),'modifiedbyexternalpartyyominame',_0xd557('0x70'),_0xd557('0x71'),_0xd557('0x72'),'modifiedonbehalfbyname',_0xd557('0x73'),_0xd557('0x74'),_0xd557('0x75'),'numberofchildincidents','onholdtime',_0xd557('0x76'),'owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname',_0xd557('0x77'),_0xd557('0x78'),_0xd557('0x79'),_0xd557('0x7a'),'resolveby',_0xd557('0x7b'),'responseby',_0xd557('0x7c'),_0xd557('0x7d'),'sentimentvalue',_0xd557('0x7e'),_0xd557('0x7f'),_0xd557('0x80'),_0xd557('0x81'),'statuscode',_0xd557('0x82'),_0xd557('0x83'),_0xd557('0x84'),_0xd557('0x85'),_0xd557('0x86'),_0xd557('0x87'),_0xd557('0x88')];var _0x64de7d=_0x4c8e06[_0xd557('0x89')](_0x1ea207);return db['Dynamics365Account']['findOne']({'where':{'id':_0x5f2916[_0xd557('0x33')]['id']},'attributes':['id','username',_0xd557('0x8a'),'remoteUri',_0xd557('0x8b'),'clientId',_0xd557('0x8c'),_0xd557('0x8d')],'include':[{'model':db[_0xd557('0x8e')],'as':'CloudProvider','attributes':['id',_0xd557('0x8f'),_0xd557('0x90')]}]})[_0xd557('0xe')](handleEntityNotFound(_0x1c4062,null))[_0xd557('0xe')](function(_0x3437e2){if(_0x3437e2){if(_0x3437e2[_0xd557('0x8d')]){_0x3437e2['access_token']=_0x3437e2['CloudProvider'][_0xd557('0x8f')];_0x57772e=sanitizeRemoteUri(_0x3437e2[_0xd557('0x8e')][_0xd557('0x90')]);_0x4b3253=getWebApiUrl(_0x57772e);return _0x3437e2;}_0x57772e=sanitizeRemoteUri(_0x3437e2[_0xd557('0x91')]);_0x4b3253=getWebApiUrl(_0x57772e);var _0x3cd61f={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x3437e2[_0xd557('0x8b')]+_0xd557('0x92'),'form':{'client_id':_0x3437e2[_0xd557('0x93')],'resource':_0x57772e,'username':_0x3437e2[_0xd557('0x94')],'password':_0x3437e2[_0xd557('0x8a')],'grant_type':_0xd557('0x8a'),'client_secret':_0x3437e2[_0xd557('0x8c')]},'json':!![]};return rp(_0x3cd61f);}})[_0xd557('0xe')](function(_0x4a5812){_0xfbaae6=_0x4a5812[_0xd557('0x95')];var _0x43a9da={'method':_0xd557('0x96'),'uri':encodeURI(_0x4b3253+_0xd557('0x97')+_0x42b7ec+'\x27'),'headers':{'Authorization':_0xd557('0x98')+_0xfbaae6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x43a9da);})[_0xd557('0xe')](function(_0x50efd8){var _0x210d5b=_0x50efd8[_0xd557('0x99')][0x0];var _0x9f8602=_0x210d5b['MetadataId'];var _0x35db48={'method':_0xd557('0x96'),'uri':_0x4b3253+_0xd557('0x9a')+_0x9f8602+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xd557('0x98')+_0xfbaae6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x35db48);})[_0xd557('0xe')](function(_0x3c6d9d){_0xd1521=_0x3c6d9d;_0x107a48=_0xd1521[_0xd557('0x9b')];_0x107a48=_[_0xd557('0x9c')](_0x107a48,function(_0x3d43b3){return!_0x64de7d['includes'](_0x3d43b3['LogicalName']);});var _0x219414=[];var _0x5bafc0=[];_0x107a48[_0xd557('0x9d')](function(_0x30776f){if(_0x30776f[_0xd557('0x9e')]){var _0x2d595c=_0x30776f[_0xd557('0x9e')][_0xd557('0x9f')](_0x30776f[_0xd557('0x9e')][_0xd557('0x44')]('.')+0x1);if(_0x2d595c==='PicklistAttributeMetadata'){_0x219414['push'](getSelectList(_0x4b3253,_0x1ef38f,_0x5bafc0,_0xd1521[_0xd557('0xa0')],_0x30776f[_0xd557('0xa0')],_0xfbaae6));}}});return Promise[_0xd557('0xa1')](_0x219414);})[_0xd557('0xe')](function(_0x3e4cc6){_0x45afa1=_0x3e4cc6[0x0];var _0x235f67=[];var _0x5ef37c=[];_0x107a48[_0xd557('0x9d')](function(_0x529297){if(!_[_0xd557('0xa2')](_0x529297['@odata.type'])){var _0x12899c=_0x529297[_0xd557('0x9e')][_0xd557('0x9f')](_0x529297['@odata.type'][_0xd557('0x44')]('.')+0x1);if(_0x12899c===_0xd557('0xa3')){_0x235f67[_0xd557('0xa4')](getBooleanList(_0x4b3253,_0x1ef38f,_0x5ef37c,_0xd1521[_0xd557('0xa0')],_0x529297['MetadataId'],_0xfbaae6));}}});return Promise['all'](_0x235f67);})[_0xd557('0xe')](function(_0x490b2c){_0x19dfe6=_0x490b2c[0x0];var _0x26edf2=[];var _0x153ecf=[];_0x107a48[_0xd557('0x9d')](function(_0x3bc725){if(_0x3bc725[_0xd557('0x9e')]){var _0x247041=_0x3bc725[_0xd557('0x9e')][_0xd557('0x9f')](_0x3bc725[_0xd557('0x9e')][_0xd557('0x44')]('.')+0x1);if(_0x247041==='StringAttributeMetadata'||_0x247041===_0xd557('0xa5')||_0x247041==='BigIntAttributeMetadata'||_0x247041===_0xd557('0xa6')||_0x247041===_0xd557('0xa7')||_0x247041===_0xd557('0xa8')||_0x247041===_0xd557('0xa9')||_0x247041===_0xd557('0xaa')||_0x247041===_0xd557('0xab')||_0x247041===_0xd557('0xac')){_0x26edf2[_0xd557('0xa4')](getInputList(_0x4b3253,_0x1ef38f,_0x247041,_0x153ecf,_0xd1521[_0xd557('0xa0')],_0x3bc725['MetadataId'],_0xfbaae6));}}});return Promise[_0xd557('0xa1')](_0x26edf2);})[_0xd557('0xe')](function(_0x151f68){_0x58e05b=_0x151f68[0x0];var _0x448546=_0x45afa1[_0xd557('0x89')](_0x19dfe6)['concat'](_0x58e05b);var _0x25ab87={'count':_0x448546[_0xd557('0x22')],'rows':_0x448546};return _0x25ab87;})[_0xd557('0xe')](respondWithResult(_0x1c4062,null))[_0xd557('0x31')](function(_0x195df5){var _0x152c00=_0x5f2916[_0xd557('0x1f')][_0xd557('0xad')]?0x1f4:_0x195df5['statusCode']||0x1f4;logger[_0xd557('0x12')](_0x195df5[_0xd557('0x13')]);delete _0x195df5[_0xd557('0x14')];if(_0x152c00===0x191){_0x152c00=0x190;}_0x1c4062[_0xd557('0x6')](_0x152c00)['send'](_0x5f2916[_0xd557('0x1f')][_0xd557('0xad')]?{'message':_0xd557('0xae'),'statusCode':_0x195df5['statusCode']}:_0x195df5);});};function getSelectList(_0x1b5d68,_0x3773cd,_0x5063c9,_0x1e245d,_0x279a1b,_0x18f9a6){var _0x2e2df2={'method':'GET','uri':_0x1b5d68+'EntityDefinitions('+_0x1e245d+_0xd557('0xaf')+_0x279a1b+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xd557('0xb0'),'headers':{'Authorization':_0xd557('0x98')+_0x18f9a6,'If-None-Match':null,'OData-Version':_0xd557('0xb1')},'json':!![]};return rp(_0x2e2df2)[_0xd557('0xe')](function(_0x3599fa){var _0x2f62a2=[];var _0x4bcd93=_0x3599fa['OptionSet'][_0xd557('0xb2')];_0x4bcd93[_0xd557('0x9d')](function(_0x2e09af){_0x2f62a2[_0xd557('0xa4')]({'name':_0x2e09af[_0xd557('0xb3')][_0xd557('0xb4')]['Label'],'value':String(_0x2e09af[_0xd557('0xb5')])});});var _0x574d9d={'id':_0x3773cd+'_'+_0x3599fa[_0xd557('0xb6')],'name':_0x3599fa[_0xd557('0xb7')]['UserLocalizedLabel'][_0xd557('0xb3')],'custom':![],'options':_0x2f62a2};_0x5063c9[_0xd557('0xa4')](_0x574d9d);return _0x5063c9;});}function getBooleanList(_0x4a6a9e,_0x1a7606,_0xa2a1c5,_0x54f77f,_0x23d659,_0x2832e8){var _0x58d578={'method':_0xd557('0x96'),'uri':_0x4a6a9e+_0xd557('0x9a')+_0x54f77f+_0xd557('0xaf')+_0x23d659+_0xd557('0xb8'),'headers':{'Authorization':_0xd557('0x98')+_0x2832e8,'If-None-Match':null,'OData-Version':_0xd557('0xb1')},'json':!![]};return rp(_0x58d578)[_0xd557('0xe')](function(_0xfcd3ca){var _0x506544=[];_0x506544[_0xd557('0xa4')]({'name':_0xfcd3ca[_0xd557('0xb9')][_0xd557('0xba')][_0xd557('0xb3')]['UserLocalizedLabel'][_0xd557('0xb3')],'value':'true'},{'name':_0xfcd3ca[_0xd557('0xb9')][_0xd557('0xbb')][_0xd557('0xb3')][_0xd557('0xb4')][_0xd557('0xb3')],'value':'false'});var _0x5e7856={'id':_0x1a7606+'_'+_0xfcd3ca[_0xd557('0xb6')],'name':_0xfcd3ca[_0xd557('0xb7')]['UserLocalizedLabel'][_0xd557('0xb3')],'custom':![],'options':_0x506544};_0xa2a1c5[_0xd557('0xa4')](_0x5e7856);return _0xa2a1c5;});}function getInputList(_0x5e50dd,_0x7b62e9,_0x1f7049,_0x3feb3b,_0x25e835,_0x56a65e,_0x795ab5){var _0x17985c={'method':_0xd557('0x96'),'uri':_0x5e50dd+_0xd557('0x9a')+_0x25e835+_0xd557('0xaf')+_0x56a65e+_0xd557('0xbc')+_0x1f7049+_0xd557('0xbd'),'headers':{'Authorization':_0xd557('0x98')+_0x795ab5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x17985c)['then'](function(_0x3f4696){var _0x5609a3={'id':_0x7b62e9+'_'+_0x3f4696[_0xd557('0xb6')],'name':_0x3f4696[_0xd557('0xb7')][_0xd557('0xb4')]?_0x3f4696[_0xd557('0xb7')]['UserLocalizedLabel'][_0xd557('0xb3')]:_0x3f4696['LogicalName'],'custom':![],'options':[]};_0x3feb3b[_0xd557('0xa4')](_0x5609a3);return _0x3feb3b;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index f31537c..e833c1b 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x4bfbe8,_0x4b5f04){var _0xd853b9=function(_0x4908a1){while(--_0x4908a1){_0x4bfbe8['push'](_0x4bfbe8['shift']());}};_0xd853b9(++_0x4b5f04);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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 +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x1fb7d6,_0x124bd4){var _0x28d711=function(_0x2c84fa){while(--_0x2c84fa){_0x1fb7d6['push'](_0x1fb7d6['shift']());}};_0x28d711(++_0x124bd4);}(_0x757a,0xde));var _0xa757=function(_0x217773,_0x2c18a9){_0x217773=_0x217773-0x0;var _0x1ccfa5=_0x757a[_0x217773];return _0x1ccfa5;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 988475a..4975534 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 _0x94d2=['then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','info','GetDynamics365Account','stringify','find','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x1c9f90,_0x538898){var _0x2e0c4c=function(_0x458786){while(--_0x458786){_0x1c9f90['push'](_0x1c9f90['shift']());}};_0x2e0c4c(++_0x538898);}(_0x94d2,0x1e0));var _0x294d=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0x94d2[_0x383dbb];return _0x6e8bde;};'use strict';var _=require(_0x294d('0x0'));var util=require(_0x294d('0x1'));var moment=require(_0x294d('0x2'));var BPromise=require(_0x294d('0x3'));var rs=require(_0x294d('0x4'));var fs=require('fs');var Redis=require(_0x294d('0x5'));var db=require(_0x294d('0x6'))['db'];var utils=require(_0x294d('0x7'));var logger=require(_0x294d('0x8'))('rpc');var config=require(_0x294d('0x9'));var jayson=require(_0x294d('0xa'));var client=jayson[_0x294d('0xb')][_0x294d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40a465,_0x557e9f,_0x595119){return new BPromise(function(_0x29dc16,_0x37538f){return client[_0x294d('0xd')](_0x40a465,_0x595119)[_0x294d('0xe')](function(_0x5ab517){logger['info'](_0x294d('0xf'),_0x557e9f,_0x294d('0x10'));logger[_0x294d('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x557e9f,_0x294d('0x10'),JSON['stringify'](_0x5ab517));if(_0x5ab517[_0x294d('0x12')]){if(_0x5ab517['error'][_0x294d('0x13')]===0x1f4){logger[_0x294d('0x12')](_0x294d('0xf'),_0x557e9f,_0x5ab517[_0x294d('0x12')][_0x294d('0x14')]);return _0x37538f(_0x5ab517['error'][_0x294d('0x14')]);}logger[_0x294d('0x12')](_0x294d('0xf'),_0x557e9f,_0x5ab517[_0x294d('0x12')][_0x294d('0x14')]);return _0x29dc16(_0x5ab517[_0x294d('0x12')][_0x294d('0x14')]);}else{logger['info'](_0x294d('0xf'),_0x557e9f,_0x294d('0x10'));_0x29dc16(_0x5ab517[_0x294d('0x15')][_0x294d('0x14')]);}})[_0x294d('0x16')](function(_0x161d38){logger[_0x294d('0x12')](_0x294d('0xf'),_0x557e9f,_0x161d38);_0x37538f(_0x161d38);});});}exports['GetDynamics365Account']=function(_0x4aa08c){var _0x1af130=this;return new Promise(function(_0x4638e8,_0x311e41){return db[_0x294d('0x17')][_0x294d('0x18')]({'raw':_0x4aa08c[_0x294d('0x19')]?_0x4aa08c[_0x294d('0x19')][_0x294d('0x1a')]===undefined?!![]:![]:!![],'where':_0x4aa08c[_0x294d('0x19')]?_0x4aa08c['options'][_0x294d('0x1b')]||null:null,'attributes':_0x4aa08c[_0x294d('0x19')]?_0x4aa08c['options']['attributes']||null:null,'limit':_0x4aa08c[_0x294d('0x19')]?_0x4aa08c[_0x294d('0x19')][_0x294d('0x1c')]||null:null,'include':_0x4aa08c[_0x294d('0x19')]?_0x4aa08c[_0x294d('0x19')][_0x294d('0x1d')]?_[_0x294d('0x1e')](_0x4aa08c['options'][_0x294d('0x1d')],function(_0x53329d){return{'model':db[_0x53329d[_0x294d('0x1f')]],'as':_0x53329d['as'],'attributes':_0x53329d[_0x294d('0x20')],'include':_0x53329d['include']?_[_0x294d('0x1e')](_0x53329d['include'],function(_0x54eaf3){return{'model':db[_0x54eaf3[_0x294d('0x1f')]],'as':_0x54eaf3['as'],'attributes':_0x54eaf3[_0x294d('0x20')],'include':_0x54eaf3[_0x294d('0x1d')]?_[_0x294d('0x1e')](_0x54eaf3[_0x294d('0x1d')],function(_0x5051c1){return{'model':db[_0x5051c1[_0x294d('0x1f')]],'as':_0x5051c1['as'],'attributes':_0x5051c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x294d('0xe')](function(_0x3de70f){logger[_0x294d('0x21')]('GetDynamics365Account',_0x4aa08c);logger[_0x294d('0x11')](_0x294d('0x22'),_0x4aa08c,JSON[_0x294d('0x23')](_0x3de70f));_0x4638e8(_0x3de70f);})[_0x294d('0x16')](function(_0x2fd558){logger['error'](_0x294d('0x22'),_0x2fd558[_0x294d('0x14')],_0x4aa08c);_0x311e41(_0x1af130[_0x294d('0x12')](0x1f4,_0x2fd558[_0x294d('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x59d74b){var _0x4b80e8=this;return new Promise(function(_0x454cbb,_0x281a29){return db['Dynamics365Account'][_0x294d('0x24')]({'raw':_0x59d74b['options']?_0x59d74b['options'][_0x294d('0x1a')]===undefined?!![]:![]:!![],'where':_0x59d74b[_0x294d('0x19')]?_0x59d74b[_0x294d('0x19')]['where']||null:null,'attributes':_0x59d74b[_0x294d('0x19')]?_0x59d74b['options'][_0x294d('0x20')]||null:null,'include':_0x59d74b[_0x294d('0x19')]?_0x59d74b['options'][_0x294d('0x1d')]?_['map'](_0x59d74b['options']['include'],function(_0x3e0284){return{'model':db[_0x3e0284['model']],'as':_0x3e0284['as'],'attributes':_0x3e0284[_0x294d('0x20')],'include':_0x3e0284[_0x294d('0x1d')]?_[_0x294d('0x1e')](_0x3e0284['include'],function(_0xa41758){return{'model':db[_0xa41758['model']],'as':_0xa41758['as'],'attributes':_0xa41758['attributes'],'include':_0xa41758[_0x294d('0x1d')]?_[_0x294d('0x1e')](_0xa41758['include'],function(_0x14ec02){return{'model':db[_0x14ec02[_0x294d('0x1f')]],'as':_0x14ec02['as'],'attributes':_0x14ec02[_0x294d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x349f30){logger[_0x294d('0x21')](_0x294d('0x25'),_0x59d74b);logger[_0x294d('0x11')](_0x294d('0x25'),_0x59d74b,JSON[_0x294d('0x23')](_0x349f30));_0x454cbb(_0x349f30);})[_0x294d('0x16')](function(_0x149764){logger[_0x294d('0x12')]('ShowDynamics365Account',_0x149764[_0x294d('0x14')],_0x59d74b);_0x281a29(_0x4b80e8[_0x294d('0x12')](0x1f4,_0x149764[_0x294d('0x14')]));});});}; \ No newline at end of file +var _0x1721=['Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','GetDynamics365Account','Dynamics365Account','options','where','attributes','limit','include','map','model','find','raw','then','ShowDynamics365Account','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','info','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1721,0x1d6));var _0x1172=function(_0x39c4b0,_0x2f6bd6){_0x39c4b0=_0x39c4b0-0x0;var _0x5c244f=_0x1721[_0x39c4b0];return _0x5c244f;};'use strict';var _=require(_0x1172('0x0'));var util=require(_0x1172('0x1'));var moment=require(_0x1172('0x2'));var BPromise=require(_0x1172('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1172('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1172('0x5'));var config=require(_0x1172('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1172('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29e206,_0x226faa,_0x5b6171){return new BPromise(function(_0x2d2cd6,_0x3a7821){return client['request'](_0x29e206,_0x5b6171)['then'](function(_0x5cd243){logger[_0x1172('0x8')]('Dynamics365Account,\x20%s,\x20%s',_0x226faa,'request\x20sent');logger[_0x1172('0x9')](_0x1172('0xa'),_0x226faa,_0x1172('0xb'),JSON[_0x1172('0xc')](_0x5cd243));if(_0x5cd243['error']){if(_0x5cd243[_0x1172('0xd')][_0x1172('0xe')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x226faa,_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);return _0x3a7821(_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);}logger['error'](_0x1172('0x10'),_0x226faa,_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);return _0x2d2cd6(_0x5cd243[_0x1172('0xd')][_0x1172('0xf')]);}else{logger[_0x1172('0x8')](_0x1172('0x10'),_0x226faa,'request\x20sent');_0x2d2cd6(_0x5cd243[_0x1172('0x11')]['message']);}})[_0x1172('0x12')](function(_0x50ae42){logger[_0x1172('0xd')](_0x1172('0x10'),_0x226faa,_0x50ae42);_0x3a7821(_0x50ae42);});});}exports[_0x1172('0x13')]=function(_0x576514){var _0x514984=this;return new Promise(function(_0x1a490b,_0x1f56b2){return db[_0x1172('0x14')]['findAll']({'raw':_0x576514[_0x1172('0x15')]?_0x576514[_0x1172('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x576514[_0x1172('0x15')]?_0x576514[_0x1172('0x15')][_0x1172('0x16')]||null:null,'attributes':_0x576514['options']?_0x576514[_0x1172('0x15')][_0x1172('0x17')]||null:null,'limit':_0x576514[_0x1172('0x15')]?_0x576514['options'][_0x1172('0x18')]||null:null,'include':_0x576514['options']?_0x576514[_0x1172('0x15')][_0x1172('0x19')]?_[_0x1172('0x1a')](_0x576514[_0x1172('0x15')][_0x1172('0x19')],function(_0x58ca50){return{'model':db[_0x58ca50['model']],'as':_0x58ca50['as'],'attributes':_0x58ca50['attributes'],'include':_0x58ca50[_0x1172('0x19')]?_[_0x1172('0x1a')](_0x58ca50['include'],function(_0x399821){return{'model':db[_0x399821[_0x1172('0x1b')]],'as':_0x399821['as'],'attributes':_0x399821[_0x1172('0x17')],'include':_0x399821[_0x1172('0x19')]?_[_0x1172('0x1a')](_0x399821[_0x1172('0x19')],function(_0x58e8fb){return{'model':db[_0x58e8fb['model']],'as':_0x58e8fb['as'],'attributes':_0x58e8fb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5aa4ef){logger[_0x1172('0x8')]('GetDynamics365Account',_0x576514);logger['debug'](_0x1172('0x13'),_0x576514,JSON['stringify'](_0x5aa4ef));_0x1a490b(_0x5aa4ef);})['catch'](function(_0x380913){logger[_0x1172('0xd')](_0x1172('0x13'),_0x380913[_0x1172('0xf')],_0x576514);_0x1f56b2(_0x514984[_0x1172('0xd')](0x1f4,_0x380913[_0x1172('0xf')]));});});};exports['ShowDynamics365Account']=function(_0xc5cba8){var _0x95df26=this;return new Promise(function(_0x56fd5e,_0x2ac1c6){return db[_0x1172('0x14')][_0x1172('0x1c')]({'raw':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8[_0x1172('0x15')][_0x1172('0x1d')]===undefined?!![]:![]:!![],'where':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8['options']['where']||null:null,'attributes':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8[_0x1172('0x15')][_0x1172('0x17')]||null:null,'include':_0xc5cba8[_0x1172('0x15')]?_0xc5cba8[_0x1172('0x15')]['include']?_['map'](_0xc5cba8[_0x1172('0x15')][_0x1172('0x19')],function(_0x13c047){return{'model':db[_0x13c047[_0x1172('0x1b')]],'as':_0x13c047['as'],'attributes':_0x13c047[_0x1172('0x17')],'include':_0x13c047[_0x1172('0x19')]?_['map'](_0x13c047[_0x1172('0x19')],function(_0x52b7cf){return{'model':db[_0x52b7cf[_0x1172('0x1b')]],'as':_0x52b7cf['as'],'attributes':_0x52b7cf['attributes'],'include':_0x52b7cf[_0x1172('0x19')]?_[_0x1172('0x1a')](_0x52b7cf[_0x1172('0x19')],function(_0xe4dcba){return{'model':db[_0xe4dcba['model']],'as':_0xe4dcba['as'],'attributes':_0xe4dcba[_0x1172('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1172('0x1e')](function(_0x840d6f){logger[_0x1172('0x8')](_0x1172('0x1f'),_0xc5cba8);logger[_0x1172('0x9')]('ShowDynamics365Account',_0xc5cba8,JSON[_0x1172('0xc')](_0x840d6f));_0x56fd5e(_0x840d6f);})['catch'](function(_0x37ccca){logger['error']('ShowDynamics365Account',_0x37ccca[_0x1172('0xf')],_0xc5cba8);_0x2ac1c6(_0x95df26['error'](0x1f4,_0x37ccca[_0x1172('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c9e5fbd..eb704ff 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 _0x3eae=['../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x13bea0,_0x210a0c){var _0x3f12df=function(_0x11ef1c){while(--_0x11ef1c){_0x13bea0['push'](_0x13bea0['shift']());}};_0x3f12df(++_0x210a0c);}(_0x3eae,0x126));var _0xe3ea=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x3eae[_0x385c76];return _0x5c8367;};'use strict';var multer=require(_0xe3ea('0x0'));var util=require(_0xe3ea('0x1'));var path=require(_0xe3ea('0x2'));var timeout=require(_0xe3ea('0x3'));var express=require('express');var router=express[_0xe3ea('0x4')]();var fs_extra=require(_0xe3ea('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe3ea('0x6'));var config=require(_0xe3ea('0x7'));var controller=require(_0xe3ea('0x8'));router['get']('/',auth[_0xe3ea('0x9')](),controller[_0xe3ea('0xa')]);router[_0xe3ea('0xb')](_0xe3ea('0xc'),auth[_0xe3ea('0x9')](),controller[_0xe3ea('0xd')]);router['get'](_0xe3ea('0xe'),auth[_0xe3ea('0x9')](),controller['getFields']);router[_0xe3ea('0xb')](_0xe3ea('0xf'),auth[_0xe3ea('0x9')](),controller[_0xe3ea('0x10')]);router[_0xe3ea('0xb')]('/:id/descriptions',auth[_0xe3ea('0x9')](),controller[_0xe3ea('0x11')]);router[_0xe3ea('0x12')]('/',auth['isAuthenticated'](),controller[_0xe3ea('0x13')]);router[_0xe3ea('0x14')](_0xe3ea('0xc'),auth[_0xe3ea('0x9')](),controller[_0xe3ea('0x15')]);router[_0xe3ea('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xe3ea('0x17')]);module[_0xe3ea('0x18')]=router; \ No newline at end of file +var _0x3192=['update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','getDescriptions','create'];(function(_0x5a3f74,_0x132c3e){var _0x2e18d1=function(_0x344564){while(--_0x344564){_0x5a3f74['push'](_0x5a3f74['shift']());}};_0x2e18d1(++_0x132c3e);}(_0x3192,0x147));var _0x2319=function(_0x5333af,_0x4a7b92){_0x5333af=_0x5333af-0x0;var _0x1ba535=_0x3192[_0x5333af];return _0x1ba535;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2319('0x0'));var timeout=require(_0x2319('0x1'));var express=require(_0x2319('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2319('0x3'));var interaction=require(_0x2319('0x4'));var config=require(_0x2319('0x5'));var controller=require(_0x2319('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2319('0x7')](_0x2319('0x8'),auth['isAuthenticated'](),controller[_0x2319('0x9')]);router[_0x2319('0x7')](_0x2319('0xa'),auth[_0x2319('0xb')](),controller[_0x2319('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x2319('0x7')]('/:id/descriptions',auth[_0x2319('0xb')](),controller[_0x2319('0xd')]);router['post']('/',auth[_0x2319('0xb')](),controller[_0x2319('0xe')]);router['put'](_0x2319('0x8'),auth[_0x2319('0xb')](),controller[_0x2319('0xf')]);router[_0x2319('0x10')](_0x2319('0x8'),auth[_0x2319('0xb')](),controller[_0x2319('0x11')]);module[_0x2319('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index e8e5e4d..9de0ce5 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 _0x0ee3=['BOOLEAN','exports','STRING','ENUM','contact','nothing'];(function(_0xf89ad3,_0x4a4a05){var _0x324449=function(_0xe7bab5){while(--_0xe7bab5){_0xf89ad3['push'](_0xf89ad3['shift']());}};_0x324449(++_0x4a4a05);}(_0x0ee3,0x187));var _0x30ee=function(_0x4f4f3d,_0x2cc448){_0x4f4f3d=_0x4f4f3d-0x0;var _0x4ac4a3=_0x0ee3[_0x4f4f3d];return _0x4ac4a3;};'use strict';var Sequelize=require('sequelize');module[_0x30ee('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x30ee('0x1')]},'ticketType':{'type':Sequelize['ENUM']('incident','phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x30ee('0x2')](_0x30ee('0x3'),_0x30ee('0x4')),'defaultValue':_0x30ee('0x3'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x30ee('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x30ee('0x5')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9f2e=['exports','ENUM','incident','phonecall','contact','STRING','BOOLEAN','sequelize'];(function(_0x160cf3,_0x5e117b){var _0x321aeb=function(_0x598952){while(--_0x598952){_0x160cf3['push'](_0x160cf3['shift']());}};_0x321aeb(++_0x5e117b);}(_0x9f2e,0x7f));var _0xe9f2=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9f2e[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0xe9f2('0x0'));module[_0xe9f2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xe9f2('0x2')](_0xe9f2('0x3'),_0xe9f2('0x4')),'defaultValue':_0xe9f2('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0xe9f2('0x5'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xe9f2('0x6')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xe9f2('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 61d27d6..a9a6d1c 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 _0xb691=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','update','params','findOne','Dynamics365Field','intersection','getFields','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xb691,0x194));var _0x1b69=function(_0x279368,_0x41c002){_0x279368=_0x279368-0x0;var _0x40b6d0=_0xb691[_0x279368];return _0x40b6d0;};'use strict';var emlformat=require(_0x1b69('0x0'));var rimraf=require(_0x1b69('0x1'));var zipdir=require(_0x1b69('0x2'));var jsonpatch=require(_0x1b69('0x3'));var rp=require(_0x1b69('0x4'));var moment=require(_0x1b69('0x5'));var BPromise=require(_0x1b69('0x6'));var Mustache=require(_0x1b69('0x7'));var util=require(_0x1b69('0x8'));var path=require(_0x1b69('0x9'));var sox=require('sox');var csv=require(_0x1b69('0xa'));var ejs=require(_0x1b69('0xb'));var fs=require('fs');var fs_extra=require(_0x1b69('0xc'));var _=require(_0x1b69('0xd'));var squel=require(_0x1b69('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1b69('0xf'));var Papa=require(_0x1b69('0x10'));var Redis=require(_0x1b69('0x11'));var authService=require(_0x1b69('0x12'));var qs=require(_0x1b69('0x13'));var as=require(_0x1b69('0x14'));var hardwareService=require(_0x1b69('0x15'));var logger=require(_0x1b69('0x16'))(_0x1b69('0x17'));var utils=require(_0x1b69('0x18'));var config=require(_0x1b69('0x19'));var licenseUtil=require(_0x1b69('0x1a'));var db=require(_0x1b69('0x1b'))['db'];function respondWithStatusCode(_0x37f8af,_0x2b8a69){_0x2b8a69=_0x2b8a69||0xcc;return function(_0x3657a9){if(_0x3657a9){return _0x37f8af[_0x1b69('0x1c')](_0x2b8a69);}return _0x37f8af[_0x1b69('0x1d')](_0x2b8a69)[_0x1b69('0x1e')]();};}function respondWithResult(_0x4c36bb,_0x50dbd4){_0x50dbd4=_0x50dbd4||0xc8;return function(_0x2b604a){if(_0x2b604a){return _0x4c36bb[_0x1b69('0x1d')](_0x50dbd4)[_0x1b69('0x1f')](_0x2b604a);}};}function respondWithFilteredResult(_0x136fc2,_0x1aef28){return function(_0x48ea01){if(_0x48ea01){var _0x419df2=typeof _0x1aef28[_0x1b69('0x20')]===_0x1b69('0x21')&&typeof _0x1aef28['limit']===_0x1b69('0x21');var _0x31765b=_0x48ea01[_0x1b69('0x22')];var _0x10a3d5=_0x419df2?0x0:_0x1aef28[_0x1b69('0x20')];var _0x3d9b24=_0x419df2?_0x48ea01[_0x1b69('0x22')]:_0x1aef28[_0x1b69('0x20')]+_0x1aef28[_0x1b69('0x23')];var _0x40bfcd;if(_0x3d9b24>=_0x31765b){_0x3d9b24=_0x31765b;_0x40bfcd=0xc8;}else{_0x40bfcd=0xce;}_0x136fc2['status'](_0x40bfcd);return _0x136fc2[_0x1b69('0x24')](_0x1b69('0x25'),_0x10a3d5+'-'+_0x3d9b24+'/'+_0x31765b)[_0x1b69('0x1f')](_0x48ea01);}return null;};}function patchUpdates(_0x312f2e){return function(_0x3a8285){try{jsonpatch[_0x1b69('0x26')](_0x3a8285,_0x312f2e,!![]);}catch(_0xbb03b5){return BPromise[_0x1b69('0x27')](_0xbb03b5);}return _0x3a8285['save']();};}function saveUpdates(_0xb5f353,_0x58adea){return function(_0x6e0d7f){if(_0x6e0d7f){return _0x6e0d7f['update'](_0xb5f353)[_0x1b69('0x28')](function(_0x19e5b9){return _0x19e5b9;});}return null;};}function removeEntity(_0x40123e,_0x374c49){return function(_0x3a3d49){if(_0x3a3d49){return _0x3a3d49[_0x1b69('0x29')]()['then'](function(){_0x40123e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c3983,_0x33dc6e){return function(_0x2c784b){if(!_0x2c784b){_0x5c3983[_0x1b69('0x1c')](0x194);}return _0x2c784b;};}function handleError(_0x3439a0,_0x7ab2ec){_0x7ab2ec=_0x7ab2ec||0x1f4;return function(_0x3dc7ba){logger[_0x1b69('0x2a')](_0x3dc7ba[_0x1b69('0x2b')]);if(_0x3dc7ba[_0x1b69('0x2c')]){delete _0x3dc7ba[_0x1b69('0x2c')];}_0x3439a0[_0x1b69('0x1d')](_0x7ab2ec)[_0x1b69('0x2d')](_0x3dc7ba);};}exports[_0x1b69('0x2e')]=function(_0x188313,_0x4c40a4){var _0x51d8c3={},_0x20cde0={},_0x1bca9e={'count':0x0,'rows':[]};var _0xe98989=_[_0x1b69('0x2f')](db[_0x1b69('0x30')]['rawAttributes'],function(_0x3dc5ce){return{'name':_0x3dc5ce['fieldName'],'type':_0x3dc5ce['type'][_0x1b69('0x31')]};});_0x20cde0[_0x1b69('0x32')]=_[_0x1b69('0x2f')](_0xe98989,_0x1b69('0x2c'));_0x20cde0[_0x1b69('0x33')]=_[_0x1b69('0x34')](_0x188313[_0x1b69('0x33')]);_0x20cde0[_0x1b69('0x35')]=_['intersection'](_0x20cde0['model'],_0x20cde0[_0x1b69('0x33')]);_0x51d8c3[_0x1b69('0x36')]=_['intersection'](_0x20cde0[_0x1b69('0x32')],qs[_0x1b69('0x37')](_0x188313[_0x1b69('0x33')][_0x1b69('0x37')]));_0x51d8c3[_0x1b69('0x36')]=_0x51d8c3[_0x1b69('0x36')]['length']?_0x51d8c3[_0x1b69('0x36')]:_0x20cde0[_0x1b69('0x32')];if(!_0x188313[_0x1b69('0x33')][_0x1b69('0x38')]('nolimit')){_0x51d8c3[_0x1b69('0x23')]=qs[_0x1b69('0x23')](_0x188313[_0x1b69('0x33')][_0x1b69('0x23')]);_0x51d8c3[_0x1b69('0x20')]=qs[_0x1b69('0x20')](_0x188313['query']['offset']);}_0x51d8c3[_0x1b69('0x39')]=qs[_0x1b69('0x3a')](_0x188313[_0x1b69('0x33')][_0x1b69('0x3a')]);_0x51d8c3['where']=qs[_0x1b69('0x35')](_[_0x1b69('0x3b')](_0x188313[_0x1b69('0x33')],_0x20cde0['filters']),_0xe98989);if(_0x188313[_0x1b69('0x33')][_0x1b69('0x3c')]){_0x51d8c3[_0x1b69('0x3d')]=_[_0x1b69('0x3e')](_0x51d8c3[_0x1b69('0x3d')],{'$or':_[_0x1b69('0x2f')](_0xe98989,function(_0x2dba2d){if(_0x2dba2d[_0x1b69('0x3f')]!==_0x1b69('0x40')){var _0x5cef8f={};_0x5cef8f[_0x2dba2d['name']]={'$like':'%'+_0x188313[_0x1b69('0x33')][_0x1b69('0x3c')]+'%'};return _0x5cef8f;}})});}_0x51d8c3=_['merge']({},_0x51d8c3,_0x188313[_0x1b69('0x41')]);var _0x42a90c={'where':_0x51d8c3[_0x1b69('0x3d')]};return db[_0x1b69('0x30')][_0x1b69('0x22')](_0x42a90c)[_0x1b69('0x28')](function(_0x4d6bde){_0x1bca9e[_0x1b69('0x22')]=_0x4d6bde;if(_0x188313['query'][_0x1b69('0x42')]){_0x51d8c3[_0x1b69('0x43')]=[{'all':!![]}];}return db[_0x1b69('0x30')][_0x1b69('0x44')](_0x51d8c3);})[_0x1b69('0x28')](function(_0x48949b){_0x1bca9e[_0x1b69('0x45')]=_0x48949b;return _0x1bca9e;})[_0x1b69('0x28')](respondWithFilteredResult(_0x4c40a4,_0x51d8c3))[_0x1b69('0x46')](handleError(_0x4c40a4,null));};exports[_0x1b69('0x47')]=function(_0x5b9b67,_0x59f480){var _0x463f38={'raw':![],'where':{'id':_0x5b9b67['params']['id']}},_0x422285={};_0x422285[_0x1b69('0x32')]=_[_0x1b69('0x34')](db[_0x1b69('0x30')][_0x1b69('0x48')]);_0x422285[_0x1b69('0x33')]=_[_0x1b69('0x34')](_0x5b9b67['query']);_0x422285[_0x1b69('0x35')]=_['intersection'](_0x422285[_0x1b69('0x32')],_0x422285[_0x1b69('0x33')]);_0x463f38['attributes']=_['intersection'](_0x422285[_0x1b69('0x32')],qs[_0x1b69('0x37')](_0x5b9b67['query'][_0x1b69('0x37')]));_0x463f38[_0x1b69('0x36')]=_0x463f38[_0x1b69('0x36')][_0x1b69('0x49')]?_0x463f38['attributes']:_0x422285[_0x1b69('0x32')];if(_0x5b9b67[_0x1b69('0x33')][_0x1b69('0x42')]){_0x463f38[_0x1b69('0x43')]=[{'all':!![]}];}_0x463f38=_[_0x1b69('0x3e')]({},_0x463f38,_0x5b9b67[_0x1b69('0x41')]);return db['Dynamics365Configuration'][_0x1b69('0x4a')](_0x463f38)[_0x1b69('0x28')](handleEntityNotFound(_0x59f480,null))[_0x1b69('0x28')](respondWithResult(_0x59f480,null))['catch'](handleError(_0x59f480,null));};exports[_0x1b69('0x4b')]=function(_0x3e9a6b,_0x928911){return db[_0x1b69('0x30')]['create'](_0x3e9a6b[_0x1b69('0x4c')],{})['then'](respondWithResult(_0x928911,0xc9))[_0x1b69('0x46')](handleError(_0x928911,null));};exports[_0x1b69('0x4d')]=function(_0x5bfc4d,_0x3e580f){if(_0x5bfc4d[_0x1b69('0x4c')]['id']){delete _0x5bfc4d[_0x1b69('0x4c')]['id'];}return db[_0x1b69('0x30')][_0x1b69('0x4a')]({'where':{'id':_0x5bfc4d[_0x1b69('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e580f,null))[_0x1b69('0x28')](saveUpdates(_0x5bfc4d[_0x1b69('0x4c')],null))[_0x1b69('0x28')](respondWithResult(_0x3e580f,null))[_0x1b69('0x46')](handleError(_0x3e580f,null));};exports[_0x1b69('0x29')]=function(_0x1bfe1e,_0x25e987){return db[_0x1b69('0x30')][_0x1b69('0x4a')]({'where':{'id':_0x1bfe1e['params']['id']}})[_0x1b69('0x28')](handleEntityNotFound(_0x25e987,null))[_0x1b69('0x28')](removeEntity(_0x25e987,null))[_0x1b69('0x46')](handleError(_0x25e987,null));};exports['getFields']=function(_0x47271e,_0x135b00,_0x4b65a1){var _0x523a9a={};var _0x282c00={};var _0x590e17;var _0x20a9ff;return db[_0x1b69('0x30')][_0x1b69('0x4f')]({'where':{'id':_0x47271e[_0x1b69('0x4e')]['id']}})['then'](handleEntityNotFound(_0x135b00,null))[_0x1b69('0x28')](function(_0x528ff5){if(_0x528ff5){_0x590e17=_0x528ff5;_0x282c00['model']=_[_0x1b69('0x34')](db[_0x1b69('0x50')][_0x1b69('0x48')]);_0x282c00['query']=_['keys'](_0x47271e['query']);_0x282c00[_0x1b69('0x35')]=_[_0x1b69('0x51')](_0x282c00[_0x1b69('0x32')],_0x282c00[_0x1b69('0x33')]);_0x523a9a[_0x1b69('0x36')]=_['intersection'](_0x282c00[_0x1b69('0x32')],qs[_0x1b69('0x37')](_0x47271e[_0x1b69('0x33')]['fields']));_0x523a9a[_0x1b69('0x36')]=_0x523a9a[_0x1b69('0x36')][_0x1b69('0x49')]?_0x523a9a[_0x1b69('0x36')]:_0x282c00[_0x1b69('0x32')];_0x523a9a[_0x1b69('0x39')]=qs[_0x1b69('0x3a')](_0x47271e['query'][_0x1b69('0x3a')]);_0x523a9a[_0x1b69('0x3d')]=qs[_0x1b69('0x35')](_['pick'](_0x47271e[_0x1b69('0x33')],_0x282c00['filters']));if(_0x47271e[_0x1b69('0x33')]['filter']){_0x523a9a[_0x1b69('0x3d')]=_[_0x1b69('0x3e')](_0x523a9a[_0x1b69('0x3d')],{'$or':_[_0x1b69('0x2f')](_0x523a9a[_0x1b69('0x36')],function(_0x478903){var _0x110408={};_0x110408[_0x478903]={'$like':'%'+_0x47271e[_0x1b69('0x33')][_0x1b69('0x3c')]+'%'};return _0x110408;})});}_0x523a9a=_['merge']({},_0x523a9a,_0x47271e[_0x1b69('0x41')]);return _0x590e17[_0x1b69('0x52')](_0x523a9a);}})[_0x1b69('0x28')](function(_0x46cc41){if(_0x46cc41){_0x20a9ff=_0x46cc41[_0x1b69('0x49')];if(!_0x47271e[_0x1b69('0x33')][_0x1b69('0x38')]('nolimit')){_0x523a9a[_0x1b69('0x23')]=qs['limit'](_0x47271e[_0x1b69('0x33')][_0x1b69('0x23')]);_0x523a9a[_0x1b69('0x20')]=qs[_0x1b69('0x20')](_0x47271e[_0x1b69('0x33')][_0x1b69('0x20')]);}return _0x590e17['getFields'](_0x523a9a);}})[_0x1b69('0x28')](function(_0x1096f4){if(_0x1096f4){return _0x1096f4?{'count':_0x20a9ff,'rows':_0x1096f4}:null;}})[_0x1b69('0x28')](respondWithResult(_0x135b00,null))[_0x1b69('0x46')](handleError(_0x135b00,null));};exports[_0x1b69('0x53')]=function(_0x3b1065,_0xe874a8,_0x529ff3){var _0x123062={};var _0x175ddd={};var _0x47d400;var _0x444f25;return db[_0x1b69('0x30')][_0x1b69('0x4f')]({'where':{'id':_0x3b1065[_0x1b69('0x4e')]['id']}})['then'](handleEntityNotFound(_0xe874a8,null))[_0x1b69('0x28')](function(_0x4d115b){if(_0x4d115b){_0x47d400=_0x4d115b;_0x175ddd[_0x1b69('0x32')]=_['keys'](db['Dynamics365Field'][_0x1b69('0x48')]);_0x175ddd['query']=_[_0x1b69('0x34')](_0x3b1065['query']);_0x175ddd[_0x1b69('0x35')]=_['intersection'](_0x175ddd[_0x1b69('0x32')],_0x175ddd[_0x1b69('0x33')]);_0x123062[_0x1b69('0x36')]=_[_0x1b69('0x51')](_0x175ddd[_0x1b69('0x32')],qs[_0x1b69('0x37')](_0x3b1065[_0x1b69('0x33')][_0x1b69('0x37')]));_0x123062['attributes']=_0x123062[_0x1b69('0x36')][_0x1b69('0x49')]?_0x123062[_0x1b69('0x36')]:_0x175ddd[_0x1b69('0x32')];_0x123062[_0x1b69('0x39')]=qs[_0x1b69('0x3a')](_0x3b1065[_0x1b69('0x33')][_0x1b69('0x3a')]);_0x123062[_0x1b69('0x3d')]=qs[_0x1b69('0x35')](_[_0x1b69('0x3b')](_0x3b1065[_0x1b69('0x33')],_0x175ddd[_0x1b69('0x35')]));if(_0x3b1065['query']['filter']){_0x123062[_0x1b69('0x3d')]=_[_0x1b69('0x3e')](_0x123062[_0x1b69('0x3d')],{'$or':_[_0x1b69('0x2f')](_0x123062[_0x1b69('0x36')],function(_0x5bd598){var _0x49ac0e={};_0x49ac0e[_0x5bd598]={'$like':'%'+_0x3b1065[_0x1b69('0x33')][_0x1b69('0x3c')]+'%'};return _0x49ac0e;})});}_0x123062=_[_0x1b69('0x3e')]({},_0x123062,_0x3b1065[_0x1b69('0x41')]);return _0x47d400[_0x1b69('0x53')](_0x123062);}})[_0x1b69('0x28')](function(_0x37c234){if(_0x37c234){_0x444f25=_0x37c234[_0x1b69('0x49')];if(!_0x3b1065[_0x1b69('0x33')][_0x1b69('0x38')](_0x1b69('0x54'))){_0x123062[_0x1b69('0x23')]=qs['limit'](_0x3b1065[_0x1b69('0x33')][_0x1b69('0x23')]);_0x123062[_0x1b69('0x20')]=qs[_0x1b69('0x20')](_0x3b1065[_0x1b69('0x33')][_0x1b69('0x20')]);}return _0x47d400[_0x1b69('0x53')](_0x123062);}})['then'](function(_0x1d13d9){if(_0x1d13d9){return _0x1d13d9?{'count':_0x444f25,'rows':_0x1d13d9}:null;}})[_0x1b69('0x28')](respondWithResult(_0xe874a8,null))[_0x1b69('0x46')](handleError(_0xe874a8,null));};exports[_0x1b69('0x55')]=function(_0x1c3589,_0x51d50f,_0x24d572){var _0x20428e={};var _0x44e042={};var _0x49d3fa;var _0x333cae;return db['Dynamics365Configuration'][_0x1b69('0x4f')]({'where':{'id':_0x1c3589[_0x1b69('0x4e')]['id']}})[_0x1b69('0x28')](handleEntityNotFound(_0x51d50f,null))['then'](function(_0xccca71){if(_0xccca71){_0x49d3fa=_0xccca71;_0x44e042[_0x1b69('0x32')]=_[_0x1b69('0x34')](db[_0x1b69('0x50')][_0x1b69('0x48')]);_0x44e042[_0x1b69('0x33')]=_[_0x1b69('0x34')](_0x1c3589[_0x1b69('0x33')]);_0x44e042[_0x1b69('0x35')]=_[_0x1b69('0x51')](_0x44e042[_0x1b69('0x32')],_0x44e042[_0x1b69('0x33')]);_0x20428e['attributes']=_['intersection'](_0x44e042['model'],qs['fields'](_0x1c3589[_0x1b69('0x33')]['fields']));_0x20428e['attributes']=_0x20428e[_0x1b69('0x36')]['length']?_0x20428e[_0x1b69('0x36')]:_0x44e042[_0x1b69('0x32')];_0x20428e[_0x1b69('0x39')]=qs[_0x1b69('0x3a')](_0x1c3589[_0x1b69('0x33')][_0x1b69('0x3a')]);_0x20428e[_0x1b69('0x3d')]=qs[_0x1b69('0x35')](_[_0x1b69('0x3b')](_0x1c3589[_0x1b69('0x33')],_0x44e042[_0x1b69('0x35')]));if(_0x1c3589[_0x1b69('0x33')][_0x1b69('0x3c')]){_0x20428e[_0x1b69('0x3d')]=_[_0x1b69('0x3e')](_0x20428e[_0x1b69('0x3d')],{'$or':_[_0x1b69('0x2f')](_0x20428e[_0x1b69('0x36')],function(_0x15c6c1){var _0x1bb34f={};_0x1bb34f[_0x15c6c1]={'$like':'%'+_0x1c3589['query'][_0x1b69('0x3c')]+'%'};return _0x1bb34f;})});}_0x20428e=_['merge']({},_0x20428e,_0x1c3589[_0x1b69('0x41')]);return _0x49d3fa[_0x1b69('0x55')](_0x20428e);}})[_0x1b69('0x28')](function(_0x1ad20f){if(_0x1ad20f){_0x333cae=_0x1ad20f[_0x1b69('0x49')];if(!_0x1c3589[_0x1b69('0x33')][_0x1b69('0x38')](_0x1b69('0x54'))){_0x20428e[_0x1b69('0x23')]=qs[_0x1b69('0x23')](_0x1c3589['query'][_0x1b69('0x23')]);_0x20428e['offset']=qs[_0x1b69('0x20')](_0x1c3589[_0x1b69('0x33')][_0x1b69('0x20')]);}return _0x49d3fa[_0x1b69('0x55')](_0x20428e);}})[_0x1b69('0x28')](function(_0x54f760){if(_0x54f760){return _0x54f760?{'count':_0x333cae,'rows':_0x54f760}:null;}})['then'](respondWithResult(_0x51d50f,null))[_0x1b69('0x46')](handleError(_0x51d50f,null));}; \ No newline at end of file +var _0xd02d=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','body','find','Dynamics365Field','getFields','getSubjects','findOne','order','nolimit','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0xd02d,0xd7));var _0xdd02=function(_0x49408d,_0x590809){_0x49408d=_0x49408d-0x0;var _0x3555f3=_0xd02d[_0x49408d];return _0x3555f3;};'use strict';var emlformat=require(_0xdd02('0x0'));var rimraf=require(_0xdd02('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd02('0x2'));var moment=require(_0xdd02('0x3'));var BPromise=require(_0xdd02('0x4'));var Mustache=require(_0xdd02('0x5'));var util=require('util');var path=require(_0xdd02('0x6'));var sox=require(_0xdd02('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd02('0x8'));var _=require(_0xdd02('0x9'));var squel=require(_0xdd02('0xa'));var crypto=require(_0xdd02('0xb'));var jsforce=require(_0xdd02('0xc'));var deskjs=require(_0xdd02('0xd'));var toCsv=require(_0xdd02('0xe'));var querystring=require('querystring');var Papa=require(_0xdd02('0xf'));var Redis=require(_0xdd02('0x10'));var authService=require(_0xdd02('0x11'));var qs=require(_0xdd02('0x12'));var as=require(_0xdd02('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd02('0x14'))(_0xdd02('0x15'));var utils=require('../../config/utils');var config=require(_0xdd02('0x16'));var licenseUtil=require(_0xdd02('0x17'));var db=require(_0xdd02('0x18'))['db'];function respondWithStatusCode(_0x13ff2b,_0x12fd6d){_0x12fd6d=_0x12fd6d||0xcc;return function(_0x36694b){if(_0x36694b){return _0x13ff2b[_0xdd02('0x19')](_0x12fd6d);}return _0x13ff2b[_0xdd02('0x1a')](_0x12fd6d)['end']();};}function respondWithResult(_0x1d2600,_0x25fa0c){_0x25fa0c=_0x25fa0c||0xc8;return function(_0x50f2a7){if(_0x50f2a7){return _0x1d2600['status'](_0x25fa0c)[_0xdd02('0x1b')](_0x50f2a7);}};}function respondWithFilteredResult(_0x47ad62,_0x4057db){return function(_0x49ae7a){if(_0x49ae7a){var _0x17fd67=typeof _0x4057db[_0xdd02('0x1c')]===_0xdd02('0x1d')&&typeof _0x4057db[_0xdd02('0x1e')]===_0xdd02('0x1d');var _0x6b03b3=_0x49ae7a[_0xdd02('0x1f')];var _0x13fed1=_0x17fd67?0x0:_0x4057db[_0xdd02('0x1c')];var _0x1ec9d8=_0x17fd67?_0x49ae7a['count']:_0x4057db[_0xdd02('0x1c')]+_0x4057db[_0xdd02('0x1e')];var _0x1c78a8;if(_0x1ec9d8>=_0x6b03b3){_0x1ec9d8=_0x6b03b3;_0x1c78a8=0xc8;}else{_0x1c78a8=0xce;}_0x47ad62['status'](_0x1c78a8);return _0x47ad62[_0xdd02('0x20')](_0xdd02('0x21'),_0x13fed1+'-'+_0x1ec9d8+'/'+_0x6b03b3)[_0xdd02('0x1b')](_0x49ae7a);}return null;};}function patchUpdates(_0x18e5aa){return function(_0x6639ec){try{jsonpatch[_0xdd02('0x22')](_0x6639ec,_0x18e5aa,!![]);}catch(_0x584699){return BPromise[_0xdd02('0x23')](_0x584699);}return _0x6639ec[_0xdd02('0x24')]();};}function saveUpdates(_0x23499b,_0x3a56d1){return function(_0x798ff1){if(_0x798ff1){return _0x798ff1[_0xdd02('0x25')](_0x23499b)[_0xdd02('0x26')](function(_0xa70783){return _0xa70783;});}return null;};}function removeEntity(_0x104687,_0x24e41d){return function(_0x2b83cd){if(_0x2b83cd){return _0x2b83cd[_0xdd02('0x27')]()[_0xdd02('0x26')](function(){_0x104687[_0xdd02('0x1a')](0xcc)[_0xdd02('0x28')]();});}};}function handleEntityNotFound(_0x28a203,_0x30bfe3){return function(_0x52d1f2){if(!_0x52d1f2){_0x28a203[_0xdd02('0x19')](0x194);}return _0x52d1f2;};}function handleError(_0x59d1fb,_0x7af219){_0x7af219=_0x7af219||0x1f4;return function(_0x536333){logger[_0xdd02('0x29')](_0x536333['stack']);if(_0x536333[_0xdd02('0x2a')]){delete _0x536333['name'];}_0x59d1fb[_0xdd02('0x1a')](_0x7af219)['send'](_0x536333);};}exports[_0xdd02('0x2b')]=function(_0x3b530d,_0x445d09){var _0x979357={},_0x5e8b8c={},_0x2588a9={'count':0x0,'rows':[]};var _0x465594=_[_0xdd02('0x2c')](db[_0xdd02('0x2d')][_0xdd02('0x2e')],function(_0x50ff23){return{'name':_0x50ff23[_0xdd02('0x2f')],'type':_0x50ff23[_0xdd02('0x30')][_0xdd02('0x31')]};});_0x5e8b8c[_0xdd02('0x32')]=_[_0xdd02('0x2c')](_0x465594,'name');_0x5e8b8c[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0x3b530d[_0xdd02('0x33')]);_0x5e8b8c['filters']=_['intersection'](_0x5e8b8c[_0xdd02('0x32')],_0x5e8b8c[_0xdd02('0x33')]);_0x979357['attributes']=_[_0xdd02('0x35')](_0x5e8b8c['model'],qs[_0xdd02('0x36')](_0x3b530d[_0xdd02('0x33')][_0xdd02('0x36')]));_0x979357['attributes']=_0x979357['attributes'][_0xdd02('0x37')]?_0x979357[_0xdd02('0x38')]:_0x5e8b8c[_0xdd02('0x32')];if(!_0x3b530d[_0xdd02('0x33')][_0xdd02('0x39')]('nolimit')){_0x979357[_0xdd02('0x1e')]=qs['limit'](_0x3b530d[_0xdd02('0x33')][_0xdd02('0x1e')]);_0x979357[_0xdd02('0x1c')]=qs[_0xdd02('0x1c')](_0x3b530d['query'][_0xdd02('0x1c')]);}_0x979357['order']=qs[_0xdd02('0x3a')](_0x3b530d[_0xdd02('0x33')][_0xdd02('0x3a')]);_0x979357['where']=qs[_0xdd02('0x3b')](_[_0xdd02('0x3c')](_0x3b530d[_0xdd02('0x33')],_0x5e8b8c[_0xdd02('0x3b')]),_0x465594);if(_0x3b530d[_0xdd02('0x33')][_0xdd02('0x3d')]){_0x979357[_0xdd02('0x3e')]=_[_0xdd02('0x3f')](_0x979357['where'],{'$or':_[_0xdd02('0x2c')](_0x465594,function(_0x1f0e9d){if(_0x1f0e9d[_0xdd02('0x30')]!==_0xdd02('0x40')){var _0x3b3c80={};_0x3b3c80[_0x1f0e9d[_0xdd02('0x2a')]]={'$like':'%'+_0x3b530d[_0xdd02('0x33')]['filter']+'%'};return _0x3b3c80;}})});}_0x979357=_[_0xdd02('0x3f')]({},_0x979357,_0x3b530d[_0xdd02('0x41')]);var _0x4966ec={'where':_0x979357[_0xdd02('0x3e')]};return db[_0xdd02('0x2d')][_0xdd02('0x1f')](_0x4966ec)[_0xdd02('0x26')](function(_0x3d21da){_0x2588a9[_0xdd02('0x1f')]=_0x3d21da;if(_0x3b530d['query'][_0xdd02('0x42')]){_0x979357['include']=[{'all':!![]}];}return db[_0xdd02('0x2d')][_0xdd02('0x43')](_0x979357);})[_0xdd02('0x26')](function(_0xa56b6e){_0x2588a9['rows']=_0xa56b6e;return _0x2588a9;})[_0xdd02('0x26')](respondWithFilteredResult(_0x445d09,_0x979357))[_0xdd02('0x44')](handleError(_0x445d09,null));};exports[_0xdd02('0x45')]=function(_0x4065fb,_0x14c927){var _0x9d94ae={'raw':![],'where':{'id':_0x4065fb[_0xdd02('0x46')]['id']}},_0x45e4f9={};_0x45e4f9[_0xdd02('0x32')]=_[_0xdd02('0x34')](db[_0xdd02('0x2d')][_0xdd02('0x2e')]);_0x45e4f9[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0x4065fb[_0xdd02('0x33')]);_0x45e4f9[_0xdd02('0x3b')]=_[_0xdd02('0x35')](_0x45e4f9[_0xdd02('0x32')],_0x45e4f9['query']);_0x9d94ae[_0xdd02('0x38')]=_['intersection'](_0x45e4f9[_0xdd02('0x32')],qs[_0xdd02('0x36')](_0x4065fb[_0xdd02('0x33')][_0xdd02('0x36')]));_0x9d94ae['attributes']=_0x9d94ae['attributes'][_0xdd02('0x37')]?_0x9d94ae[_0xdd02('0x38')]:_0x45e4f9[_0xdd02('0x32')];if(_0x4065fb[_0xdd02('0x33')][_0xdd02('0x42')]){_0x9d94ae['include']=[{'all':!![]}];}_0x9d94ae=_[_0xdd02('0x3f')]({},_0x9d94ae,_0x4065fb[_0xdd02('0x41')]);return db['Dynamics365Configuration']['find'](_0x9d94ae)[_0xdd02('0x26')](handleEntityNotFound(_0x14c927,null))[_0xdd02('0x26')](respondWithResult(_0x14c927,null))[_0xdd02('0x44')](handleError(_0x14c927,null));};exports['create']=function(_0x5f47df,_0x4e4f33){return db['Dynamics365Configuration']['create'](_0x5f47df[_0xdd02('0x47')],{})['then'](respondWithResult(_0x4e4f33,0xc9))[_0xdd02('0x44')](handleError(_0x4e4f33,null));};exports[_0xdd02('0x25')]=function(_0x12f4fc,_0x48f4e0){if(_0x12f4fc['body']['id']){delete _0x12f4fc[_0xdd02('0x47')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x12f4fc['params']['id']}})[_0xdd02('0x26')](handleEntityNotFound(_0x48f4e0,null))[_0xdd02('0x26')](saveUpdates(_0x12f4fc[_0xdd02('0x47')],null))['then'](respondWithResult(_0x48f4e0,null))[_0xdd02('0x44')](handleError(_0x48f4e0,null));};exports[_0xdd02('0x27')]=function(_0x4a2fb0,_0x32a83d){return db['Dynamics365Configuration'][_0xdd02('0x48')]({'where':{'id':_0x4a2fb0[_0xdd02('0x46')]['id']}})['then'](handleEntityNotFound(_0x32a83d,null))['then'](removeEntity(_0x32a83d,null))['catch'](handleError(_0x32a83d,null));};exports['getFields']=function(_0xc8c17b,_0x5bf617,_0x560415){var _0x5ced47={};var _0xf6a385={};var _0x2b521a;var _0x33e58d;return db[_0xdd02('0x2d')]['findOne']({'where':{'id':_0xc8c17b['params']['id']}})[_0xdd02('0x26')](handleEntityNotFound(_0x5bf617,null))[_0xdd02('0x26')](function(_0x4a318d){if(_0x4a318d){_0x2b521a=_0x4a318d;_0xf6a385[_0xdd02('0x32')]=_[_0xdd02('0x34')](db[_0xdd02('0x49')][_0xdd02('0x2e')]);_0xf6a385[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0xc8c17b['query']);_0xf6a385[_0xdd02('0x3b')]=_['intersection'](_0xf6a385[_0xdd02('0x32')],_0xf6a385[_0xdd02('0x33')]);_0x5ced47['attributes']=_['intersection'](_0xf6a385['model'],qs[_0xdd02('0x36')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x36')]));_0x5ced47['attributes']=_0x5ced47[_0xdd02('0x38')][_0xdd02('0x37')]?_0x5ced47[_0xdd02('0x38')]:_0xf6a385['model'];_0x5ced47['order']=qs[_0xdd02('0x3a')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x3a')]);_0x5ced47['where']=qs[_0xdd02('0x3b')](_[_0xdd02('0x3c')](_0xc8c17b[_0xdd02('0x33')],_0xf6a385[_0xdd02('0x3b')]));if(_0xc8c17b['query'][_0xdd02('0x3d')]){_0x5ced47[_0xdd02('0x3e')]=_[_0xdd02('0x3f')](_0x5ced47[_0xdd02('0x3e')],{'$or':_[_0xdd02('0x2c')](_0x5ced47[_0xdd02('0x38')],function(_0x585f58){var _0x21deab={};_0x21deab[_0x585f58]={'$like':'%'+_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x3d')]+'%'};return _0x21deab;})});}_0x5ced47=_[_0xdd02('0x3f')]({},_0x5ced47,_0xc8c17b[_0xdd02('0x41')]);return _0x2b521a[_0xdd02('0x4a')](_0x5ced47);}})[_0xdd02('0x26')](function(_0x37df32){if(_0x37df32){_0x33e58d=_0x37df32[_0xdd02('0x37')];if(!_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x39')]('nolimit')){_0x5ced47[_0xdd02('0x1e')]=qs[_0xdd02('0x1e')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x1e')]);_0x5ced47[_0xdd02('0x1c')]=qs[_0xdd02('0x1c')](_0xc8c17b[_0xdd02('0x33')][_0xdd02('0x1c')]);}return _0x2b521a[_0xdd02('0x4a')](_0x5ced47);}})[_0xdd02('0x26')](function(_0x2486db){if(_0x2486db){return _0x2486db?{'count':_0x33e58d,'rows':_0x2486db}:null;}})[_0xdd02('0x26')](respondWithResult(_0x5bf617,null))['catch'](handleError(_0x5bf617,null));};exports[_0xdd02('0x4b')]=function(_0xedea6f,_0xca429a,_0x12c467){var _0x55a78e={};var _0x2aed89={};var _0x3f5509;var _0x4c4639;return db[_0xdd02('0x2d')][_0xdd02('0x4c')]({'where':{'id':_0xedea6f['params']['id']}})['then'](handleEntityNotFound(_0xca429a,null))[_0xdd02('0x26')](function(_0x49e72e){if(_0x49e72e){_0x3f5509=_0x49e72e;_0x2aed89['model']=_['keys'](db['Dynamics365Field'][_0xdd02('0x2e')]);_0x2aed89[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0xedea6f[_0xdd02('0x33')]);_0x2aed89['filters']=_[_0xdd02('0x35')](_0x2aed89['model'],_0x2aed89[_0xdd02('0x33')]);_0x55a78e[_0xdd02('0x38')]=_[_0xdd02('0x35')](_0x2aed89[_0xdd02('0x32')],qs[_0xdd02('0x36')](_0xedea6f[_0xdd02('0x33')][_0xdd02('0x36')]));_0x55a78e[_0xdd02('0x38')]=_0x55a78e['attributes']['length']?_0x55a78e[_0xdd02('0x38')]:_0x2aed89[_0xdd02('0x32')];_0x55a78e[_0xdd02('0x4d')]=qs[_0xdd02('0x3a')](_0xedea6f['query'][_0xdd02('0x3a')]);_0x55a78e[_0xdd02('0x3e')]=qs[_0xdd02('0x3b')](_[_0xdd02('0x3c')](_0xedea6f[_0xdd02('0x33')],_0x2aed89['filters']));if(_0xedea6f['query'][_0xdd02('0x3d')]){_0x55a78e[_0xdd02('0x3e')]=_['merge'](_0x55a78e[_0xdd02('0x3e')],{'$or':_['map'](_0x55a78e[_0xdd02('0x38')],function(_0x218eb6){var _0x3196d2={};_0x3196d2[_0x218eb6]={'$like':'%'+_0xedea6f[_0xdd02('0x33')][_0xdd02('0x3d')]+'%'};return _0x3196d2;})});}_0x55a78e=_[_0xdd02('0x3f')]({},_0x55a78e,_0xedea6f[_0xdd02('0x41')]);return _0x3f5509[_0xdd02('0x4b')](_0x55a78e);}})[_0xdd02('0x26')](function(_0x3ee776){if(_0x3ee776){_0x4c4639=_0x3ee776[_0xdd02('0x37')];if(!_0xedea6f[_0xdd02('0x33')][_0xdd02('0x39')](_0xdd02('0x4e'))){_0x55a78e[_0xdd02('0x1e')]=qs['limit'](_0xedea6f['query'][_0xdd02('0x1e')]);_0x55a78e['offset']=qs[_0xdd02('0x1c')](_0xedea6f[_0xdd02('0x33')]['offset']);}return _0x3f5509[_0xdd02('0x4b')](_0x55a78e);}})[_0xdd02('0x26')](function(_0x2b3fc7){if(_0x2b3fc7){return _0x2b3fc7?{'count':_0x4c4639,'rows':_0x2b3fc7}:null;}})[_0xdd02('0x26')](respondWithResult(_0xca429a,null))['catch'](handleError(_0xca429a,null));};exports[_0xdd02('0x4f')]=function(_0x8432b9,_0x3289e1,_0x3682ed){var _0x216ce1={};var _0x3d7914={};var _0x48eebd;var _0x9e0d2c;return db[_0xdd02('0x2d')][_0xdd02('0x4c')]({'where':{'id':_0x8432b9['params']['id']}})['then'](handleEntityNotFound(_0x3289e1,null))[_0xdd02('0x26')](function(_0x1b45cc){if(_0x1b45cc){_0x48eebd=_0x1b45cc;_0x3d7914[_0xdd02('0x32')]=_[_0xdd02('0x34')](db[_0xdd02('0x49')]['rawAttributes']);_0x3d7914[_0xdd02('0x33')]=_[_0xdd02('0x34')](_0x8432b9[_0xdd02('0x33')]);_0x3d7914[_0xdd02('0x3b')]=_[_0xdd02('0x35')](_0x3d7914[_0xdd02('0x32')],_0x3d7914[_0xdd02('0x33')]);_0x216ce1[_0xdd02('0x38')]=_[_0xdd02('0x35')](_0x3d7914['model'],qs[_0xdd02('0x36')](_0x8432b9[_0xdd02('0x33')][_0xdd02('0x36')]));_0x216ce1[_0xdd02('0x38')]=_0x216ce1[_0xdd02('0x38')][_0xdd02('0x37')]?_0x216ce1[_0xdd02('0x38')]:_0x3d7914[_0xdd02('0x32')];_0x216ce1['order']=qs[_0xdd02('0x3a')](_0x8432b9['query'][_0xdd02('0x3a')]);_0x216ce1[_0xdd02('0x3e')]=qs['filters'](_[_0xdd02('0x3c')](_0x8432b9[_0xdd02('0x33')],_0x3d7914['filters']));if(_0x8432b9[_0xdd02('0x33')][_0xdd02('0x3d')]){_0x216ce1['where']=_[_0xdd02('0x3f')](_0x216ce1['where'],{'$or':_[_0xdd02('0x2c')](_0x216ce1[_0xdd02('0x38')],function(_0x92dd49){var _0x3abb14={};_0x3abb14[_0x92dd49]={'$like':'%'+_0x8432b9[_0xdd02('0x33')][_0xdd02('0x3d')]+'%'};return _0x3abb14;})});}_0x216ce1=_[_0xdd02('0x3f')]({},_0x216ce1,_0x8432b9[_0xdd02('0x41')]);return _0x48eebd[_0xdd02('0x4f')](_0x216ce1);}})['then'](function(_0x54925a){if(_0x54925a){_0x9e0d2c=_0x54925a[_0xdd02('0x37')];if(!_0x8432b9['query'][_0xdd02('0x39')](_0xdd02('0x4e'))){_0x216ce1[_0xdd02('0x1e')]=qs[_0xdd02('0x1e')](_0x8432b9['query']['limit']);_0x216ce1['offset']=qs[_0xdd02('0x1c')](_0x8432b9[_0xdd02('0x33')][_0xdd02('0x1c')]);}return _0x48eebd[_0xdd02('0x4f')](_0x216ce1);}})[_0xdd02('0x26')](function(_0x39221e){if(_0x39221e){return _0x39221e?{'count':_0x9e0d2c,'rows':_0x39221e}:null;}})[_0xdd02('0x26')](respondWithResult(_0x3289e1,null))[_0xdd02('0x44')](handleError(_0x3289e1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 01e9adf..062ff5b 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 _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2e9064,_0x425f57){var _0x148b4c=function(_0x376416){while(--_0x376416){_0x2e9064['push'](_0x2e9064['shift']());}};_0x148b4c(++_0x425f57);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x22fd93,_0x32074f){_0x22fd93=_0x22fd93-0x0;var _0x1d3bee=_0xd6d6[_0x22fd93];return _0x1d3bee;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'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(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe14d,0x1ee));var _0xde14=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xe14d[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Dynamics365Configuration',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index f7f9340..6aa5ac3 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 _0xe694=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x28c66d,_0x31a698){var _0x1869d1=function(_0x38eac9){while(--_0x38eac9){_0x28c66d['push'](_0x28c66d['shift']());}};_0x1869d1(++_0x31a698);}(_0xe694,0x94));var _0x4e69=function(_0x48a509,_0x30df45){_0x48a509=_0x48a509-0x0;var _0x4155e9=_0xe694[_0x48a509];return _0x4155e9;};'use strict';var _=require(_0x4e69('0x0'));var util=require('util');var moment=require(_0x4e69('0x1'));var BPromise=require(_0x4e69('0x2'));var rs=require(_0x4e69('0x3'));var fs=require('fs');var Redis=require(_0x4e69('0x4'));var db=require(_0x4e69('0x5'))['db'];var utils=require(_0x4e69('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4e69('0x7'));var jayson=require(_0x4e69('0x8'));var client=jayson[_0x4e69('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d1bda,_0x1b4659,_0xe9cfcc){return new BPromise(function(_0x153bce,_0x2ee902){return client[_0x4e69('0xa')](_0x1d1bda,_0xe9cfcc)[_0x4e69('0xb')](function(_0x3b3eb1){logger[_0x4e69('0xc')](_0x4e69('0xd'),_0x1b4659,_0x4e69('0xe'));logger[_0x4e69('0xf')](_0x4e69('0x10'),_0x1b4659,_0x4e69('0xe'),JSON[_0x4e69('0x11')](_0x3b3eb1));if(_0x3b3eb1['error']){if(_0x3b3eb1[_0x4e69('0x12')][_0x4e69('0x13')]===0x1f4){logger[_0x4e69('0x12')](_0x4e69('0xd'),_0x1b4659,_0x3b3eb1[_0x4e69('0x12')]['message']);return _0x2ee902(_0x3b3eb1[_0x4e69('0x12')][_0x4e69('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x1b4659,_0x3b3eb1[_0x4e69('0x12')][_0x4e69('0x14')]);return _0x153bce(_0x3b3eb1[_0x4e69('0x12')]['message']);}else{logger[_0x4e69('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b4659,_0x4e69('0xe'));_0x153bce(_0x3b3eb1[_0x4e69('0x15')][_0x4e69('0x14')]);}})[_0x4e69('0x16')](function(_0x1065a1){logger[_0x4e69('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1b4659,_0x1065a1);_0x2ee902(_0x1065a1);});});} \ No newline at end of file +var _0xe098=['rpc','../../config/environment','http','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger'];(function(_0x2ff99a,_0x4a864a){var _0x21caed=function(_0x3cf15e){while(--_0x3cf15e){_0x2ff99a['push'](_0x2ff99a['shift']());}};_0x21caed(++_0x4a864a);}(_0xe098,0x19c));var _0x8e09=function(_0x162507,_0x5bbb09){_0x162507=_0x162507-0x0;var _0x5b0da6=_0xe098[_0x162507];return _0x5b0da6;};'use strict';var _=require(_0x8e09('0x0'));var util=require(_0x8e09('0x1'));var moment=require(_0x8e09('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e09('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e09('0x4'));var logger=require(_0x8e09('0x5'))(_0x8e09('0x6'));var config=require(_0x8e09('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8e09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd9f20f,_0x5a0605,_0x5f69ba){return new BPromise(function(_0x22f42d,_0x20eb35){return client[_0x8e09('0x9')](_0xd9f20f,_0x5f69ba)[_0x8e09('0xa')](function(_0x41bb74){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x5a0605,_0x8e09('0xb'));logger[_0x8e09('0xc')](_0x8e09('0xd'),_0x5a0605,_0x8e09('0xb'),JSON[_0x8e09('0xe')](_0x41bb74));if(_0x41bb74[_0x8e09('0xf')]){if(_0x41bb74[_0x8e09('0xf')][_0x8e09('0x10')]===0x1f4){logger[_0x8e09('0xf')](_0x8e09('0x11'),_0x5a0605,_0x41bb74['error']['message']);return _0x20eb35(_0x41bb74[_0x8e09('0xf')][_0x8e09('0x12')]);}logger[_0x8e09('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5a0605,_0x41bb74[_0x8e09('0xf')][_0x8e09('0x12')]);return _0x22f42d(_0x41bb74[_0x8e09('0xf')][_0x8e09('0x12')]);}else{logger[_0x8e09('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5a0605,_0x8e09('0xb'));_0x22f42d(_0x41bb74[_0x8e09('0x14')][_0x8e09('0x12')]);}})[_0x8e09('0x15')](function(_0x2805a5){logger[_0x8e09('0xf')](_0x8e09('0x11'),_0x5a0605,_0x2805a5);_0x20eb35(_0x2805a5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 88557bf..4bae5b6 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 _0x56ab=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','create','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x56ab,0x165));var _0xb56a=function(_0x46b514,_0x46e5e6){_0x46b514=_0x46b514-0x0;var _0x4e8a59=_0x56ab[_0x46b514];return _0x4e8a59;};'use strict';var multer=require(_0xb56a('0x0'));var util=require(_0xb56a('0x1'));var path=require('path');var timeout=require(_0xb56a('0x2'));var express=require(_0xb56a('0x3'));var router=express[_0xb56a('0x4')]();var fs_extra=require(_0xb56a('0x5'));var auth=require(_0xb56a('0x6'));var interaction=require(_0xb56a('0x7'));var config=require(_0xb56a('0x8'));var controller=require(_0xb56a('0x9'));router['get']('/',auth[_0xb56a('0xa')](),controller[_0xb56a('0xb')]);router[_0xb56a('0xc')](_0xb56a('0xd'),auth[_0xb56a('0xa')](),controller[_0xb56a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb56a('0xf')]);router['put'](_0xb56a('0xd'),auth[_0xb56a('0xa')](),controller[_0xb56a('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb56a('0x11')]);module[_0xb56a('0x12')]=router; \ No newline at end of file +var _0x98fd=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','show','isAuthenticated','create'];(function(_0x477445,_0x5f37f1){var _0x1fd940=function(_0x5c70f8){while(--_0x5c70f8){_0x477445['push'](_0x477445['shift']());}};_0x1fd940(++_0x5f37f1);}(_0x98fd,0x195));var _0xd98f=function(_0xd0cd0b,_0x490956){_0xd0cd0b=_0xd0cd0b-0x0;var _0x59cced=_0x98fd[_0xd0cd0b];return _0x59cced;};'use strict';var multer=require(_0xd98f('0x0'));var util=require(_0xd98f('0x1'));var path=require(_0xd98f('0x2'));var timeout=require(_0xd98f('0x3'));var express=require(_0xd98f('0x4'));var router=express[_0xd98f('0x5')]();var fs_extra=require(_0xd98f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd98f('0x7'));var config=require(_0xd98f('0x8'));var controller=require(_0xd98f('0x9'));router[_0xd98f('0xa')]('/',auth['isAuthenticated'](),controller[_0xd98f('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd98f('0xc')]);router['post']('/',auth[_0xd98f('0xd')](),controller[_0xd98f('0xe')]);router[_0xd98f('0xf')](_0xd98f('0x10'),auth[_0xd98f('0xd')](),controller[_0xd98f('0x11')]);router['delete'](_0xd98f('0x10'),auth[_0xd98f('0xd')](),controller[_0xd98f('0x12')]);module[_0xd98f('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index db517fb..35cbc2c 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 _0x69fc=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x40cabc,_0x5d68b5){var _0x2ac19e=function(_0x190c57){while(--_0x190c57){_0x40cabc['push'](_0x40cabc['shift']());}};_0x2ac19e(++_0x5d68b5);}(_0x69fc,0xbe));var _0xc69f=function(_0xbc35a6,_0x4d9550){_0xbc35a6=_0xbc35a6-0x0;var _0x46b9c6=_0x69fc[_0xbc35a6];return _0x46b9c6;};'use strict';var Sequelize=require(_0xc69f('0x0'));module['exports']={'type':{'type':Sequelize[_0xc69f('0x1')](_0xc69f('0x2'),_0xc69f('0x3'),_0xc69f('0x4'),_0xc69f('0x5'),'picklist'),'defaultValue':_0xc69f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc69f('0x6')]},'keyType':{'type':Sequelize[_0xc69f('0x1')](_0xc69f('0x2'),_0xc69f('0x3'),_0xc69f('0x4'))},'keyContent':{'type':Sequelize[_0xc69f('0x6')]},'idField':{'type':Sequelize[_0xc69f('0x6')]},'nameField':{'type':Sequelize[_0xc69f('0x6')]},'customField':{'type':Sequelize[_0xc69f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc69f('0x6')]}}; \ No newline at end of file +var _0x9956=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5f5b60,_0x5b4610){var _0x4fe877=function(_0x480711){while(--_0x480711){_0x5f5b60['push'](_0x5f5b60['shift']());}};_0x4fe877(++_0x5b4610);}(_0x9956,0x1da));var _0x6995=function(_0x41221f,_0x352450){_0x41221f=_0x41221f-0x0;var _0x30d476=_0x9956[_0x41221f];return _0x30d476;};'use strict';var Sequelize=require(_0x6995('0x0'));module[_0x6995('0x1')]={'type':{'type':Sequelize[_0x6995('0x2')](_0x6995('0x3'),_0x6995('0x4'),_0x6995('0x5'),_0x6995('0x6'),'picklist'),'defaultValue':_0x6995('0x3')},'content':{'type':Sequelize[_0x6995('0x7')]},'key':{'type':Sequelize[_0x6995('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6995('0x4'),_0x6995('0x5'))},'keyContent':{'type':Sequelize[_0x6995('0x7')]},'idField':{'type':Sequelize[_0x6995('0x7')]},'nameField':{'type':Sequelize[_0x6995('0x7')]},'customField':{'type':Sequelize[_0x6995('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6995('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 8b0c32b..e68fcfd 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 _0xab65=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','reject','save','then','destroy','end','stack','name','map','Dynamics365Field','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','rawAttributes','intersection','create','body','find','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2f7d42,_0x5d7e00){var _0x52a70c=function(_0x2de1ec){while(--_0x2de1ec){_0x2f7d42['push'](_0x2f7d42['shift']());}};_0x52a70c(++_0x5d7e00);}(_0xab65,0x1ce));var _0x5ab6=function(_0x542ce5,_0x2dd3b8){_0x542ce5=_0x542ce5-0x0;var _0x4ec1c7=_0xab65[_0x542ce5];return _0x4ec1c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ab6('0x0'));var zipdir=require(_0x5ab6('0x1'));var jsonpatch=require(_0x5ab6('0x2'));var rp=require('request-promise');var moment=require(_0x5ab6('0x3'));var BPromise=require(_0x5ab6('0x4'));var Mustache=require(_0x5ab6('0x5'));var util=require('util');var path=require(_0x5ab6('0x6'));var sox=require(_0x5ab6('0x7'));var csv=require('to-csv');var ejs=require(_0x5ab6('0x8'));var fs=require('fs');var fs_extra=require(_0x5ab6('0x9'));var _=require(_0x5ab6('0xa'));var squel=require('squel');var crypto=require(_0x5ab6('0xb'));var jsforce=require(_0x5ab6('0xc'));var deskjs=require(_0x5ab6('0xd'));var toCsv=require(_0x5ab6('0xe'));var querystring=require(_0x5ab6('0xf'));var Papa=require(_0x5ab6('0x10'));var Redis=require(_0x5ab6('0x11'));var authService=require(_0x5ab6('0x12'));var qs=require(_0x5ab6('0x13'));var as=require(_0x5ab6('0x14'));var hardwareService=require(_0x5ab6('0x15'));var logger=require(_0x5ab6('0x16'))(_0x5ab6('0x17'));var utils=require(_0x5ab6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5ab6('0x19'));var db=require(_0x5ab6('0x1a'))['db'];function respondWithStatusCode(_0x2d6f52,_0x5de17a){_0x5de17a=_0x5de17a||0xcc;return function(_0x3df03a){if(_0x3df03a){return _0x2d6f52[_0x5ab6('0x1b')](_0x5de17a);}return _0x2d6f52['status'](_0x5de17a)['end']();};}function respondWithResult(_0x56f72b,_0x160dd1){_0x160dd1=_0x160dd1||0xc8;return function(_0x3cb9e9){if(_0x3cb9e9){return _0x56f72b[_0x5ab6('0x1c')](_0x160dd1)['json'](_0x3cb9e9);}};}function respondWithFilteredResult(_0x274863,_0x42dc60){return function(_0x4f6a2e){if(_0x4f6a2e){var _0x380299=typeof _0x42dc60[_0x5ab6('0x1d')]===_0x5ab6('0x1e')&&typeof _0x42dc60[_0x5ab6('0x1f')]==='undefined';var _0x4915d1=_0x4f6a2e[_0x5ab6('0x20')];var _0xea571c=_0x380299?0x0:_0x42dc60[_0x5ab6('0x1d')];var _0x568aa4=_0x380299?_0x4f6a2e[_0x5ab6('0x20')]:_0x42dc60['offset']+_0x42dc60[_0x5ab6('0x1f')];var _0x31c598;if(_0x568aa4>=_0x4915d1){_0x568aa4=_0x4915d1;_0x31c598=0xc8;}else{_0x31c598=0xce;}_0x274863[_0x5ab6('0x1c')](_0x31c598);return _0x274863[_0x5ab6('0x21')]('Content-Range',_0xea571c+'-'+_0x568aa4+'/'+_0x4915d1)['json'](_0x4f6a2e);}return null;};}function patchUpdates(_0x58edca){return function(_0x8907b5){try{jsonpatch['apply'](_0x8907b5,_0x58edca,!![]);}catch(_0x4fda12){return BPromise[_0x5ab6('0x22')](_0x4fda12);}return _0x8907b5[_0x5ab6('0x23')]();};}function saveUpdates(_0x43724c,_0x304304){return function(_0x2932e2){if(_0x2932e2){return _0x2932e2['update'](_0x43724c)[_0x5ab6('0x24')](function(_0x1e9ffb){return _0x1e9ffb;});}return null;};}function removeEntity(_0x118290,_0x37b562){return function(_0x15fab4){if(_0x15fab4){return _0x15fab4[_0x5ab6('0x25')]()[_0x5ab6('0x24')](function(){_0x118290[_0x5ab6('0x1c')](0xcc)[_0x5ab6('0x26')]();});}};}function handleEntityNotFound(_0x1c4fc2,_0xd86274){return function(_0x1d3bd6){if(!_0x1d3bd6){_0x1c4fc2[_0x5ab6('0x1b')](0x194);}return _0x1d3bd6;};}function handleError(_0x1dd426,_0x2bbcb7){_0x2bbcb7=_0x2bbcb7||0x1f4;return function(_0x436867){logger['error'](_0x436867[_0x5ab6('0x27')]);if(_0x436867[_0x5ab6('0x28')]){delete _0x436867[_0x5ab6('0x28')];}_0x1dd426[_0x5ab6('0x1c')](_0x2bbcb7)['send'](_0x436867);};}exports['index']=function(_0x32972c,_0x48112e){var _0x3487ef={},_0x4da46e={},_0x3f674b={'count':0x0,'rows':[]};var _0x84f736=_[_0x5ab6('0x29')](db[_0x5ab6('0x2a')]['rawAttributes'],function(_0x557be4){return{'name':_0x557be4[_0x5ab6('0x2b')],'type':_0x557be4[_0x5ab6('0x2c')][_0x5ab6('0x2d')]};});_0x4da46e[_0x5ab6('0x2e')]=_['map'](_0x84f736,_0x5ab6('0x28'));_0x4da46e[_0x5ab6('0x2f')]=_[_0x5ab6('0x30')](_0x32972c[_0x5ab6('0x2f')]);_0x4da46e[_0x5ab6('0x31')]=_['intersection'](_0x4da46e['model'],_0x4da46e[_0x5ab6('0x2f')]);_0x3487ef[_0x5ab6('0x32')]=_['intersection'](_0x4da46e[_0x5ab6('0x2e')],qs[_0x5ab6('0x33')](_0x32972c[_0x5ab6('0x2f')][_0x5ab6('0x33')]));_0x3487ef[_0x5ab6('0x32')]=_0x3487ef[_0x5ab6('0x32')]['length']?_0x3487ef[_0x5ab6('0x32')]:_0x4da46e['model'];if(!_0x32972c[_0x5ab6('0x2f')]['hasOwnProperty'](_0x5ab6('0x34'))){_0x3487ef[_0x5ab6('0x1f')]=qs[_0x5ab6('0x1f')](_0x32972c[_0x5ab6('0x2f')][_0x5ab6('0x1f')]);_0x3487ef[_0x5ab6('0x1d')]=qs[_0x5ab6('0x1d')](_0x32972c[_0x5ab6('0x2f')][_0x5ab6('0x1d')]);}_0x3487ef['order']=qs[_0x5ab6('0x35')](_0x32972c['query'][_0x5ab6('0x35')]);_0x3487ef[_0x5ab6('0x36')]=qs[_0x5ab6('0x31')](_[_0x5ab6('0x37')](_0x32972c[_0x5ab6('0x2f')],_0x4da46e[_0x5ab6('0x31')]),_0x84f736);if(_0x32972c[_0x5ab6('0x2f')][_0x5ab6('0x38')]){_0x3487ef[_0x5ab6('0x36')]=_[_0x5ab6('0x39')](_0x3487ef['where'],{'$or':_[_0x5ab6('0x29')](_0x84f736,function(_0x593b27){if(_0x593b27[_0x5ab6('0x2c')]!==_0x5ab6('0x3a')){var _0x23bb82={};_0x23bb82[_0x593b27['name']]={'$like':'%'+_0x32972c[_0x5ab6('0x2f')][_0x5ab6('0x38')]+'%'};return _0x23bb82;}})});}_0x3487ef=_[_0x5ab6('0x39')]({},_0x3487ef,_0x32972c['options']);var _0x4bd6ac={'where':_0x3487ef[_0x5ab6('0x36')]};return db[_0x5ab6('0x2a')][_0x5ab6('0x20')](_0x4bd6ac)[_0x5ab6('0x24')](function(_0x4a72be){_0x3f674b[_0x5ab6('0x20')]=_0x4a72be;if(_0x32972c[_0x5ab6('0x2f')][_0x5ab6('0x3b')]){_0x3487ef[_0x5ab6('0x3c')]=[{'all':!![]}];}return db[_0x5ab6('0x2a')]['findAll'](_0x3487ef);})[_0x5ab6('0x24')](function(_0x3daa7d){_0x3f674b[_0x5ab6('0x3d')]=_0x3daa7d;return _0x3f674b;})[_0x5ab6('0x24')](respondWithFilteredResult(_0x48112e,_0x3487ef))[_0x5ab6('0x3e')](handleError(_0x48112e,null));};exports['show']=function(_0x3d9a76,_0x4f26dd){var _0x1336bf={'raw':!![],'where':{'id':_0x3d9a76['params']['id']}},_0x254460={};_0x254460['model']=_[_0x5ab6('0x30')](db[_0x5ab6('0x2a')][_0x5ab6('0x3f')]);_0x254460[_0x5ab6('0x2f')]=_[_0x5ab6('0x30')](_0x3d9a76['query']);_0x254460[_0x5ab6('0x31')]=_[_0x5ab6('0x40')](_0x254460[_0x5ab6('0x2e')],_0x254460['query']);_0x1336bf[_0x5ab6('0x32')]=_[_0x5ab6('0x40')](_0x254460['model'],qs[_0x5ab6('0x33')](_0x3d9a76[_0x5ab6('0x2f')][_0x5ab6('0x33')]));_0x1336bf[_0x5ab6('0x32')]=_0x1336bf[_0x5ab6('0x32')]['length']?_0x1336bf[_0x5ab6('0x32')]:_0x254460[_0x5ab6('0x2e')];if(_0x3d9a76[_0x5ab6('0x2f')]['includeAll']){_0x1336bf[_0x5ab6('0x3c')]=[{'all':!![]}];}_0x1336bf=_[_0x5ab6('0x39')]({},_0x1336bf,_0x3d9a76['options']);return db[_0x5ab6('0x2a')]['find'](_0x1336bf)[_0x5ab6('0x24')](handleEntityNotFound(_0x4f26dd,null))[_0x5ab6('0x24')](respondWithResult(_0x4f26dd,null))['catch'](handleError(_0x4f26dd,null));};exports[_0x5ab6('0x41')]=function(_0x1313e1,_0x2b4ff9){return db['Dynamics365Field'][_0x5ab6('0x41')](_0x1313e1[_0x5ab6('0x42')],{})[_0x5ab6('0x24')](respondWithResult(_0x2b4ff9,0xc9))[_0x5ab6('0x3e')](handleError(_0x2b4ff9,null));};exports['update']=function(_0x2659ce,_0x2f952a){if(_0x2659ce['body']['id']){delete _0x2659ce[_0x5ab6('0x42')]['id'];}return db[_0x5ab6('0x2a')]['find']({'where':{'id':_0x2659ce['params']['id']}})[_0x5ab6('0x24')](handleEntityNotFound(_0x2f952a,null))['then'](saveUpdates(_0x2659ce[_0x5ab6('0x42')],null))[_0x5ab6('0x24')](respondWithResult(_0x2f952a,null))[_0x5ab6('0x3e')](handleError(_0x2f952a,null));};exports[_0x5ab6('0x25')]=function(_0x4106e4,_0x593ee8){return db[_0x5ab6('0x2a')][_0x5ab6('0x43')]({'where':{'id':_0x4106e4[_0x5ab6('0x44')]['id']}})[_0x5ab6('0x24')](handleEntityNotFound(_0x593ee8,null))[_0x5ab6('0x24')](removeEntity(_0x593ee8,null))[_0x5ab6('0x3e')](handleError(_0x593ee8,null));}; \ No newline at end of file +var _0xad5a=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Field','fieldName','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','fields','include','find','create','body','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x5460cd,_0x312955){var _0x40ce3e=function(_0x25b5a2){while(--_0x25b5a2){_0x5460cd['push'](_0x5460cd['shift']());}};_0x40ce3e(++_0x312955);}(_0xad5a,0x122));var _0xaad5=function(_0xb5e5d0,_0x1b2010){_0xb5e5d0=_0xb5e5d0-0x0;var _0x464715=_0xad5a[_0xb5e5d0];return _0x464715;};'use strict';var emlformat=require(_0xaad5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaad5('0x1'));var jsonpatch=require(_0xaad5('0x2'));var rp=require('request-promise');var moment=require(_0xaad5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaad5('0x4'));var path=require(_0xaad5('0x5'));var sox=require(_0xaad5('0x6'));var csv=require(_0xaad5('0x7'));var ejs=require(_0xaad5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaad5('0x9'));var crypto=require(_0xaad5('0xa'));var jsforce=require(_0xaad5('0xb'));var deskjs=require(_0xaad5('0xc'));var toCsv=require(_0xaad5('0x7'));var querystring=require(_0xaad5('0xd'));var Papa=require(_0xaad5('0xe'));var Redis=require(_0xaad5('0xf'));var authService=require(_0xaad5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaad5('0x11'));var hardwareService=require(_0xaad5('0x12'));var logger=require(_0xaad5('0x13'))('api');var utils=require(_0xaad5('0x14'));var config=require(_0xaad5('0x15'));var licenseUtil=require(_0xaad5('0x16'));var db=require(_0xaad5('0x17'))['db'];function respondWithStatusCode(_0x165096,_0x5d1dc1){_0x5d1dc1=_0x5d1dc1||0xcc;return function(_0x131c29){if(_0x131c29){return _0x165096[_0xaad5('0x18')](_0x5d1dc1);}return _0x165096[_0xaad5('0x19')](_0x5d1dc1)[_0xaad5('0x1a')]();};}function respondWithResult(_0xe80902,_0x10c666){_0x10c666=_0x10c666||0xc8;return function(_0x1e289f){if(_0x1e289f){return _0xe80902[_0xaad5('0x19')](_0x10c666)['json'](_0x1e289f);}};}function respondWithFilteredResult(_0x165345,_0x10aa9c){return function(_0x1defbf){if(_0x1defbf){var _0xdb8215=typeof _0x10aa9c[_0xaad5('0x1b')]===_0xaad5('0x1c')&&typeof _0x10aa9c[_0xaad5('0x1d')]===_0xaad5('0x1c');var _0x4a3482=_0x1defbf['count'];var _0x3f43ea=_0xdb8215?0x0:_0x10aa9c[_0xaad5('0x1b')];var _0x5c1772=_0xdb8215?_0x1defbf[_0xaad5('0x1e')]:_0x10aa9c[_0xaad5('0x1b')]+_0x10aa9c['limit'];var _0x31da8c;if(_0x5c1772>=_0x4a3482){_0x5c1772=_0x4a3482;_0x31da8c=0xc8;}else{_0x31da8c=0xce;}_0x165345[_0xaad5('0x19')](_0x31da8c);return _0x165345[_0xaad5('0x1f')](_0xaad5('0x20'),_0x3f43ea+'-'+_0x5c1772+'/'+_0x4a3482)[_0xaad5('0x21')](_0x1defbf);}return null;};}function patchUpdates(_0x5dc97b){return function(_0x4a81b8){try{jsonpatch[_0xaad5('0x22')](_0x4a81b8,_0x5dc97b,!![]);}catch(_0x427380){return BPromise[_0xaad5('0x23')](_0x427380);}return _0x4a81b8[_0xaad5('0x24')]();};}function saveUpdates(_0x9129e0,_0x422320){return function(_0x3bbac4){if(_0x3bbac4){return _0x3bbac4[_0xaad5('0x25')](_0x9129e0)[_0xaad5('0x26')](function(_0x3f3672){return _0x3f3672;});}return null;};}function removeEntity(_0x4750da,_0x180279){return function(_0x372772){if(_0x372772){return _0x372772[_0xaad5('0x27')]()[_0xaad5('0x26')](function(){_0x4750da[_0xaad5('0x19')](0xcc)[_0xaad5('0x1a')]();});}};}function handleEntityNotFound(_0x38624b,_0x1b4eca){return function(_0x104529){if(!_0x104529){_0x38624b[_0xaad5('0x18')](0x194);}return _0x104529;};}function handleError(_0x11b8eb,_0x2f10eb){_0x2f10eb=_0x2f10eb||0x1f4;return function(_0x3f10e7){logger[_0xaad5('0x28')](_0x3f10e7[_0xaad5('0x29')]);if(_0x3f10e7['name']){delete _0x3f10e7[_0xaad5('0x2a')];}_0x11b8eb[_0xaad5('0x19')](_0x2f10eb)[_0xaad5('0x2b')](_0x3f10e7);};}exports[_0xaad5('0x2c')]=function(_0x4237a5,_0x1d937f){var _0x4ba2ec={},_0x18e8b8={},_0x2b8e3c={'count':0x0,'rows':[]};var _0x44e46f=_['map'](db[_0xaad5('0x2d')]['rawAttributes'],function(_0xe3be49){return{'name':_0xe3be49[_0xaad5('0x2e')],'type':_0xe3be49[_0xaad5('0x2f')][_0xaad5('0x30')]};});_0x18e8b8[_0xaad5('0x31')]=_[_0xaad5('0x32')](_0x44e46f,_0xaad5('0x2a'));_0x18e8b8[_0xaad5('0x33')]=_[_0xaad5('0x34')](_0x4237a5[_0xaad5('0x33')]);_0x18e8b8['filters']=_[_0xaad5('0x35')](_0x18e8b8['model'],_0x18e8b8[_0xaad5('0x33')]);_0x4ba2ec[_0xaad5('0x36')]=_[_0xaad5('0x35')](_0x18e8b8[_0xaad5('0x31')],qs['fields'](_0x4237a5['query']['fields']));_0x4ba2ec[_0xaad5('0x36')]=_0x4ba2ec[_0xaad5('0x36')][_0xaad5('0x37')]?_0x4ba2ec[_0xaad5('0x36')]:_0x18e8b8[_0xaad5('0x31')];if(!_0x4237a5[_0xaad5('0x33')][_0xaad5('0x38')](_0xaad5('0x39'))){_0x4ba2ec[_0xaad5('0x1d')]=qs[_0xaad5('0x1d')](_0x4237a5['query'][_0xaad5('0x1d')]);_0x4ba2ec[_0xaad5('0x1b')]=qs[_0xaad5('0x1b')](_0x4237a5['query'][_0xaad5('0x1b')]);}_0x4ba2ec['order']=qs[_0xaad5('0x3a')](_0x4237a5['query']['sort']);_0x4ba2ec[_0xaad5('0x3b')]=qs[_0xaad5('0x3c')](_[_0xaad5('0x3d')](_0x4237a5[_0xaad5('0x33')],_0x18e8b8[_0xaad5('0x3c')]),_0x44e46f);if(_0x4237a5[_0xaad5('0x33')]['filter']){_0x4ba2ec[_0xaad5('0x3b')]=_[_0xaad5('0x3e')](_0x4ba2ec[_0xaad5('0x3b')],{'$or':_[_0xaad5('0x32')](_0x44e46f,function(_0x19dba4){if(_0x19dba4['type']!==_0xaad5('0x3f')){var _0x393a31={};_0x393a31[_0x19dba4[_0xaad5('0x2a')]]={'$like':'%'+_0x4237a5[_0xaad5('0x33')][_0xaad5('0x40')]+'%'};return _0x393a31;}})});}_0x4ba2ec=_[_0xaad5('0x3e')]({},_0x4ba2ec,_0x4237a5[_0xaad5('0x41')]);var _0x23144b={'where':_0x4ba2ec['where']};return db[_0xaad5('0x2d')][_0xaad5('0x1e')](_0x23144b)[_0xaad5('0x26')](function(_0x502077){_0x2b8e3c[_0xaad5('0x1e')]=_0x502077;if(_0x4237a5[_0xaad5('0x33')][_0xaad5('0x42')]){_0x4ba2ec['include']=[{'all':!![]}];}return db[_0xaad5('0x2d')]['findAll'](_0x4ba2ec);})[_0xaad5('0x26')](function(_0x2f442c){_0x2b8e3c[_0xaad5('0x43')]=_0x2f442c;return _0x2b8e3c;})[_0xaad5('0x26')](respondWithFilteredResult(_0x1d937f,_0x4ba2ec))[_0xaad5('0x44')](handleError(_0x1d937f,null));};exports[_0xaad5('0x45')]=function(_0x264b8c,_0x326f3d){var _0x27c5b5={'raw':!![],'where':{'id':_0x264b8c[_0xaad5('0x46')]['id']}},_0x4f8107={};_0x4f8107[_0xaad5('0x31')]=_[_0xaad5('0x34')](db[_0xaad5('0x2d')][_0xaad5('0x47')]);_0x4f8107['query']=_[_0xaad5('0x34')](_0x264b8c[_0xaad5('0x33')]);_0x4f8107['filters']=_[_0xaad5('0x35')](_0x4f8107[_0xaad5('0x31')],_0x4f8107[_0xaad5('0x33')]);_0x27c5b5[_0xaad5('0x36')]=_[_0xaad5('0x35')](_0x4f8107[_0xaad5('0x31')],qs[_0xaad5('0x48')](_0x264b8c[_0xaad5('0x33')][_0xaad5('0x48')]));_0x27c5b5[_0xaad5('0x36')]=_0x27c5b5[_0xaad5('0x36')][_0xaad5('0x37')]?_0x27c5b5['attributes']:_0x4f8107[_0xaad5('0x31')];if(_0x264b8c[_0xaad5('0x33')][_0xaad5('0x42')]){_0x27c5b5[_0xaad5('0x49')]=[{'all':!![]}];}_0x27c5b5=_[_0xaad5('0x3e')]({},_0x27c5b5,_0x264b8c[_0xaad5('0x41')]);return db[_0xaad5('0x2d')][_0xaad5('0x4a')](_0x27c5b5)[_0xaad5('0x26')](handleEntityNotFound(_0x326f3d,null))['then'](respondWithResult(_0x326f3d,null))[_0xaad5('0x44')](handleError(_0x326f3d,null));};exports[_0xaad5('0x4b')]=function(_0x454d15,_0x5aa1e0){return db[_0xaad5('0x2d')][_0xaad5('0x4b')](_0x454d15[_0xaad5('0x4c')],{})[_0xaad5('0x26')](respondWithResult(_0x5aa1e0,0xc9))[_0xaad5('0x44')](handleError(_0x5aa1e0,null));};exports[_0xaad5('0x25')]=function(_0x41eb9e,_0x2b539b){if(_0x41eb9e[_0xaad5('0x4c')]['id']){delete _0x41eb9e[_0xaad5('0x4c')]['id'];}return db['Dynamics365Field'][_0xaad5('0x4a')]({'where':{'id':_0x41eb9e['params']['id']}})[_0xaad5('0x26')](handleEntityNotFound(_0x2b539b,null))[_0xaad5('0x26')](saveUpdates(_0x41eb9e[_0xaad5('0x4c')],null))[_0xaad5('0x26')](respondWithResult(_0x2b539b,null))['catch'](handleError(_0x2b539b,null));};exports[_0xaad5('0x27')]=function(_0xea6023,_0x12fc75){return db[_0xaad5('0x2d')][_0xaad5('0x4a')]({'where':{'id':_0xea6023[_0xaad5('0x46')]['id']}})[_0xaad5('0x26')](handleEntityNotFound(_0x12fc75,null))['then'](removeEntity(_0x12fc75,null))[_0xaad5('0x44')](handleError(_0x12fc75,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a449d74..b67af2f 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 _0x1bb6=['lodash','util','../../config/logger','api','bluebird','rimraf','./intDynamics365Field.attributes','exports','define','dynamics365_unique_index','idField','FieldId'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x1bb6,0x1b0));var _0x61bb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1bb6[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x61bb('0x0'));var util=require(_0x61bb('0x1'));var logger=require(_0x61bb('0x2'))(_0x61bb('0x3'));var moment=require('moment');var BPromise=require(_0x61bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x61bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x61bb('0x6'));module[_0x61bb('0x7')]=function(_0x41c4ec,_0x2104c1){return _0x41c4ec[_0x61bb('0x8')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x61bb('0x9'),'fields':[_0x61bb('0xa'),_0x61bb('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9522=['path','rimraf','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','bluebird','request-promise'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9522,0x13b));var _0x2952=function(_0xb2c2b4,_0x4800b2){_0xb2c2b4=_0xb2c2b4-0x0;var _0x362374=_0x9522[_0xb2c2b4];return _0x362374;};'use strict';var _=require(_0x2952('0x0'));var util=require(_0x2952('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2952('0x2'));var rp=require(_0x2952('0x3'));var fs=require('fs');var path=require(_0x2952('0x4'));var rimraf=require(_0x2952('0x5'));var config=require('../../config/environment');var attributes=require(_0x2952('0x6'));module['exports']=function(_0x2f2cd8,_0x62acb4){return _0x2f2cd8['define'](_0x2952('0x7'),attributes,{'tableName':_0x2952('0x8'),'paranoid':![],'indexes':[{'name':_0x2952('0x9'),'fields':['idField',_0x2952('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 1f8249f..769bce6 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 _0xf04a=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x380a7e,_0x1cd918){var _0x44c66f=function(_0xcad6f3){while(--_0xcad6f3){_0x380a7e['push'](_0x380a7e['shift']());}};_0x44c66f(++_0x1cd918);}(_0xf04a,0xb2));var _0xaf04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf04a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaf04('0x0'));var util=require(_0xaf04('0x1'));var moment=require(_0xaf04('0x2'));var BPromise=require(_0xaf04('0x3'));var rs=require(_0xaf04('0x4'));var fs=require('fs');var Redis=require(_0xaf04('0x5'));var db=require(_0xaf04('0x6'))['db'];var utils=require(_0xaf04('0x7'));var logger=require(_0xaf04('0x8'))('rpc');var config=require(_0xaf04('0x9'));var jayson=require(_0xaf04('0xa'));var client=jayson[_0xaf04('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0371,_0x5d6f5d,_0x574826){return new BPromise(function(_0xa42834,_0x113f5e){return client[_0xaf04('0xc')](_0x1f0371,_0x574826)[_0xaf04('0xd')](function(_0x15ad0b){logger[_0xaf04('0xe')](_0xaf04('0xf'),_0x5d6f5d,_0xaf04('0x10'));logger['debug'](_0xaf04('0x11'),_0x5d6f5d,_0xaf04('0x10'),JSON['stringify'](_0x15ad0b));if(_0x15ad0b[_0xaf04('0x12')]){if(_0x15ad0b['error'][_0xaf04('0x13')]===0x1f4){logger[_0xaf04('0x12')](_0xaf04('0xf'),_0x5d6f5d,_0x15ad0b[_0xaf04('0x12')][_0xaf04('0x14')]);return _0x113f5e(_0x15ad0b[_0xaf04('0x12')][_0xaf04('0x14')]);}logger[_0xaf04('0x12')](_0xaf04('0xf'),_0x5d6f5d,_0x15ad0b[_0xaf04('0x12')]['message']);return _0xa42834(_0x15ad0b[_0xaf04('0x12')][_0xaf04('0x14')]);}else{logger[_0xaf04('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x5d6f5d,'request\x20sent');_0xa42834(_0x15ad0b[_0xaf04('0x15')][_0xaf04('0x14')]);}})['catch'](function(_0x34b015){logger['error'](_0xaf04('0xf'),_0x5d6f5d,_0x34b015);_0x113f5e(_0x34b015);});});} \ No newline at end of file +var _0x7881=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4b651d,_0x282dc1){var _0x290343=function(_0x48e2d6){while(--_0x48e2d6){_0x4b651d['push'](_0x4b651d['shift']());}};_0x290343(++_0x282dc1);}(_0x7881,0x19f));var _0x1788=function(_0x420fe5,_0x2016e0){_0x420fe5=_0x420fe5-0x0;var _0x4ddabb=_0x7881[_0x420fe5];return _0x4ddabb;};'use strict';var _=require(_0x1788('0x0'));var util=require(_0x1788('0x1'));var moment=require(_0x1788('0x2'));var BPromise=require('bluebird');var rs=require(_0x1788('0x3'));var fs=require('fs');var Redis=require(_0x1788('0x4'));var db=require(_0x1788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1788('0x6'))(_0x1788('0x7'));var config=require(_0x1788('0x8'));var jayson=require(_0x1788('0x9'));var client=jayson[_0x1788('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x391a3c,_0x1d80ca,_0x28c78b){return new BPromise(function(_0x22381f,_0x9c8f43){return client['request'](_0x391a3c,_0x28c78b)['then'](function(_0x3af904){logger[_0x1788('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x1d80ca,_0x1788('0xc'));logger['debug'](_0x1788('0xd'),_0x1d80ca,'request\x20sent',JSON[_0x1788('0xe')](_0x3af904));if(_0x3af904['error']){if(_0x3af904[_0x1788('0xf')][_0x1788('0x10')]===0x1f4){logger[_0x1788('0xf')](_0x1788('0x11'),_0x1d80ca,_0x3af904['error'][_0x1788('0x12')]);return _0x9c8f43(_0x3af904[_0x1788('0xf')][_0x1788('0x12')]);}logger[_0x1788('0xf')](_0x1788('0x11'),_0x1d80ca,_0x3af904[_0x1788('0xf')]['message']);return _0x22381f(_0x3af904['error'][_0x1788('0x12')]);}else{logger[_0x1788('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x1d80ca,_0x1788('0xc'));_0x22381f(_0x3af904['result'][_0x1788('0x12')]);}})[_0x1788('0x13')](function(_0x680aae){logger[_0x1788('0xf')](_0x1788('0x11'),_0x1d80ca,_0x680aae);_0x9c8f43(_0x680aae);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 4f472fc..aa6ce8e 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 _0x77f4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path'];(function(_0x165545,_0x319611){var _0x21c922=function(_0x1e5777){while(--_0x1e5777){_0x165545['push'](_0x165545['shift']());}};_0x21c922(++_0x319611);}(_0x77f4,0xd5));var _0x477f=function(_0x5afa59,_0x505bd7){_0x5afa59=_0x5afa59-0x0;var _0x5db28b=_0x77f4[_0x5afa59];return _0x5db28b;};'use strict';var multer=require(_0x477f('0x0'));var util=require(_0x477f('0x1'));var path=require(_0x477f('0x2'));var timeout=require(_0x477f('0x3'));var express=require(_0x477f('0x4'));var router=express[_0x477f('0x5')]();var fs_extra=require(_0x477f('0x6'));var auth=require(_0x477f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x477f('0x8'));router[_0x477f('0x9')]('/',auth[_0x477f('0xa')](),controller[_0x477f('0xb')]);router[_0x477f('0x9')](_0x477f('0xc'),auth[_0x477f('0xa')](),controller[_0x477f('0xd')]);router['get'](_0x477f('0xe'),auth[_0x477f('0xa')](),controller[_0x477f('0xf')]);router[_0x477f('0x9')](_0x477f('0x10'),auth[_0x477f('0xa')](),controller[_0x477f('0x11')]);router[_0x477f('0x12')]('/',auth[_0x477f('0xa')](),controller[_0x477f('0x13')]);router[_0x477f('0x12')](_0x477f('0xe'),auth[_0x477f('0xa')](),controller[_0x477f('0x14')]);router[_0x477f('0x15')](_0x477f('0xc'),auth[_0x477f('0xa')](),controller[_0x477f('0x16')]);router[_0x477f('0x17')]('/:id',auth[_0x477f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1970=['index','get','isAuthenticated','show','/:id/configurations','post','create','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller'];(function(_0x20c45d,_0x24b44b){var _0x3d5f2f=function(_0x2c35cd){while(--_0x2c35cd){_0x20c45d['push'](_0x20c45d['shift']());}};_0x3d5f2f(++_0x24b44b);}(_0x1970,0x107));var _0x0197=function(_0x1dc7ff,_0x3fdbe9){_0x1dc7ff=_0x1dc7ff-0x0;var _0x26a672=_0x1970[_0x1dc7ff];return _0x26a672;};'use strict';var multer=require(_0x0197('0x0'));var util=require(_0x0197('0x1'));var path=require('path');var timeout=require(_0x0197('0x2'));var express=require(_0x0197('0x3'));var router=express['Router']();var fs_extra=require(_0x0197('0x4'));var auth=require(_0x0197('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0197('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0197('0x7')]);router[_0x0197('0x8')]('/:id',auth[_0x0197('0x9')](),controller[_0x0197('0xa')]);router[_0x0197('0x8')](_0x0197('0xb'),auth[_0x0197('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x0197('0xc')]('/',auth[_0x0197('0x9')](),controller[_0x0197('0xd')]);router[_0x0197('0xc')](_0x0197('0xb'),auth[_0x0197('0x9')](),controller[_0x0197('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0197('0xf')]('/:id',auth[_0x0197('0x9')](),controller[_0x0197('0x10')]);module[_0x0197('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 559d0cd..a732ce7 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 _0xffd6=['exports','STRING','username','sequelize'];(function(_0xe53cb0,_0xd1b120){var _0x2b0c0d=function(_0x308b44){while(--_0x308b44){_0xe53cb0['push'](_0xe53cb0['shift']());}};_0x2b0c0d(++_0xd1b120);}(_0xffd6,0x97));var _0x6ffd=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0xffd6[_0x1c0991];return _0x5034de;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf2e3=['STRING','username','remoteUri','sequelize'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xf2e3[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x3f2e('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f2e('0x1')]},'description':{'type':Sequelize[_0x3f2e('0x1')]},'username':{'type':Sequelize[_0x3f2e('0x1')],'unique':_0x3f2e('0x2')},'apiKey':{'type':Sequelize[_0x3f2e('0x1')]},'remoteUri':{'type':Sequelize[_0x3f2e('0x1')],'unique':_0x3f2e('0x3')},'serverUrl':{'type':Sequelize[_0x3f2e('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index d91b251..f34cc5f 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 _0x93ed=['requester','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','FreshdeskAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','show','length','find','catch','create','body','getConfigurations','params','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x93ed,0xfe));var _0xd93e=function(_0x2e19c6,_0x271b24){_0x2e19c6=_0x2e19c6-0x0;var _0x2150e4=_0x93ed[_0x2e19c6];return _0x2150e4;};'use strict';var emlformat=require(_0xd93e('0x0'));var rimraf=require(_0xd93e('0x1'));var zipdir=require(_0xd93e('0x2'));var jsonpatch=require(_0xd93e('0x3'));var rp=require(_0xd93e('0x4'));var moment=require('moment');var BPromise=require(_0xd93e('0x5'));var Mustache=require('mustache');var util=require(_0xd93e('0x6'));var path=require(_0xd93e('0x7'));var sox=require('sox');var csv=require(_0xd93e('0x8'));var ejs=require(_0xd93e('0x9'));var fs=require('fs');var fs_extra=require(_0xd93e('0xa'));var _=require(_0xd93e('0xb'));var squel=require(_0xd93e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd93e('0xd'));var toCsv=require(_0xd93e('0x8'));var querystring=require(_0xd93e('0xe'));var Papa=require(_0xd93e('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd93e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd93e('0x11'));var logger=require(_0xd93e('0x12'))(_0xd93e('0x13'));var utils=require(_0xd93e('0x14'));var config=require(_0xd93e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd93e('0x16'))['db'];var integrations=require(_0xd93e('0x17'));function respondWithStatusCode(_0x444b08,_0x2e4284){_0x2e4284=_0x2e4284||0xcc;return function(_0x2032c7){if(_0x2032c7){return _0x444b08['sendStatus'](_0x2e4284);}return _0x444b08['status'](_0x2e4284)['end']();};}function respondWithResult(_0x567589,_0x1e1ef4){_0x1e1ef4=_0x1e1ef4||0xc8;return function(_0x42eea7){if(_0x42eea7){return _0x567589[_0xd93e('0x18')](_0x1e1ef4)['json'](_0x42eea7);}};}function respondWithFilteredResult(_0xc53b90,_0x490bc0){return function(_0x1826b8){if(_0x1826b8){var _0x164238=typeof _0x490bc0[_0xd93e('0x19')]===_0xd93e('0x1a')&&typeof _0x490bc0[_0xd93e('0x1b')]===_0xd93e('0x1a');var _0x433ced=_0x1826b8['count'];var _0x50c196=_0x164238?0x0:_0x490bc0['offset'];var _0x2e9fff=_0x164238?_0x1826b8[_0xd93e('0x1c')]:_0x490bc0[_0xd93e('0x19')]+_0x490bc0['limit'];var _0x4c1d3a;if(_0x2e9fff>=_0x433ced){_0x2e9fff=_0x433ced;_0x4c1d3a=0xc8;}else{_0x4c1d3a=0xce;}_0xc53b90[_0xd93e('0x18')](_0x4c1d3a);return _0xc53b90[_0xd93e('0x1d')](_0xd93e('0x1e'),_0x50c196+'-'+_0x2e9fff+'/'+_0x433ced)[_0xd93e('0x1f')](_0x1826b8);}return null;};}function patchUpdates(_0x5bc3f9){return function(_0x23b151){try{jsonpatch[_0xd93e('0x20')](_0x23b151,_0x5bc3f9,!![]);}catch(_0x336e14){return BPromise[_0xd93e('0x21')](_0x336e14);}return _0x23b151[_0xd93e('0x22')]();};}function saveUpdates(_0x4909c1,_0x52376d){return function(_0x287e01){if(_0x287e01){return _0x287e01[_0xd93e('0x23')](_0x4909c1)[_0xd93e('0x24')](function(_0xe5553f){return _0xe5553f;});}return null;};}function removeEntity(_0xd74297,_0x128e72){return function(_0xa0bcbe){if(_0xa0bcbe){return _0xa0bcbe[_0xd93e('0x25')]()[_0xd93e('0x24')](function(){_0xd74297[_0xd93e('0x18')](0xcc)[_0xd93e('0x26')]();});}};}function handleEntityNotFound(_0x538a3e,_0xf6c667){return function(_0x50eec4){if(!_0x50eec4){_0x538a3e['sendStatus'](0x194);}return _0x50eec4;};}function handleError(_0x1b2f60,_0x2175ad){_0x2175ad=_0x2175ad||0x1f4;return function(_0x5aaa9a){logger[_0xd93e('0x27')](_0x5aaa9a[_0xd93e('0x28')]);if(_0x5aaa9a[_0xd93e('0x29')]){delete _0x5aaa9a['name'];}_0x1b2f60[_0xd93e('0x18')](_0x2175ad)[_0xd93e('0x2a')](_0x5aaa9a);};}exports['index']=function(_0x2bff6e,_0x131a9c){var _0x49dae={},_0x41c479={},_0x4e4895={'count':0x0,'rows':[]};var _0x519ee8=_['map'](db[_0xd93e('0x2b')][_0xd93e('0x2c')],function(_0x23c1b4){return{'name':_0x23c1b4[_0xd93e('0x2d')],'type':_0x23c1b4[_0xd93e('0x2e')][_0xd93e('0x2f')]};});_0x41c479['model']=_[_0xd93e('0x30')](_0x519ee8,'name');_0x41c479[_0xd93e('0x31')]=_[_0xd93e('0x32')](_0x2bff6e[_0xd93e('0x31')]);_0x41c479[_0xd93e('0x33')]=_[_0xd93e('0x34')](_0x41c479['model'],_0x41c479['query']);_0x49dae['attributes']=_['intersection'](_0x41c479['model'],qs[_0xd93e('0x35')](_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x35')]));_0x49dae['attributes']=_0x49dae[_0xd93e('0x36')]['length']?_0x49dae['attributes']:_0x41c479[_0xd93e('0x37')];if(!_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x38')](_0xd93e('0x39'))){_0x49dae['limit']=qs['limit'](_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x1b')]);_0x49dae[_0xd93e('0x19')]=qs['offset'](_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x19')]);}_0x49dae['order']=qs['sort'](_0x2bff6e['query'][_0xd93e('0x3a')]);_0x49dae[_0xd93e('0x3b')]=qs[_0xd93e('0x33')](_[_0xd93e('0x3c')](_0x2bff6e[_0xd93e('0x31')],_0x41c479[_0xd93e('0x33')]),_0x519ee8);if(_0x2bff6e[_0xd93e('0x31')]['filter']){_0x49dae[_0xd93e('0x3b')]=_['merge'](_0x49dae[_0xd93e('0x3b')],{'$or':_['map'](_0x519ee8,function(_0x35423f){if(_0x35423f[_0xd93e('0x2e')]!=='VIRTUAL'){var _0x341010={};_0x341010[_0x35423f[_0xd93e('0x29')]]={'$like':'%'+_0x2bff6e['query'][_0xd93e('0x3d')]+'%'};return _0x341010;}})});}_0x49dae=_[_0xd93e('0x3e')]({},_0x49dae,_0x2bff6e[_0xd93e('0x3f')]);var _0x5090bb={'where':_0x49dae['where']};return db['FreshdeskAccount'][_0xd93e('0x1c')](_0x5090bb)[_0xd93e('0x24')](function(_0x17a368){_0x4e4895[_0xd93e('0x1c')]=_0x17a368;if(_0x2bff6e[_0xd93e('0x31')][_0xd93e('0x40')]){_0x49dae[_0xd93e('0x41')]=[{'all':!![]}];}return db[_0xd93e('0x2b')]['findAll'](_0x49dae);})[_0xd93e('0x24')](function(_0x5eeee6){_0x4e4895[_0xd93e('0x42')]=_0x5eeee6;return _0x4e4895;})[_0xd93e('0x24')](respondWithFilteredResult(_0x131a9c,_0x49dae))['catch'](handleError(_0x131a9c,null));};exports[_0xd93e('0x43')]=function(_0x3d490d,_0x11d951){var _0x20c463={'raw':![],'where':{'id':_0x3d490d['params']['id']}},_0x2204c3={};_0x2204c3[_0xd93e('0x37')]=_[_0xd93e('0x32')](db[_0xd93e('0x2b')]['rawAttributes']);_0x2204c3[_0xd93e('0x31')]=_['keys'](_0x3d490d['query']);_0x2204c3[_0xd93e('0x33')]=_[_0xd93e('0x34')](_0x2204c3[_0xd93e('0x37')],_0x2204c3['query']);_0x20c463['attributes']=_[_0xd93e('0x34')](_0x2204c3[_0xd93e('0x37')],qs[_0xd93e('0x35')](_0x3d490d[_0xd93e('0x31')]['fields']));_0x20c463['attributes']=_0x20c463[_0xd93e('0x36')][_0xd93e('0x44')]?_0x20c463[_0xd93e('0x36')]:_0x2204c3[_0xd93e('0x37')];if(_0x3d490d[_0xd93e('0x31')][_0xd93e('0x40')]){_0x20c463[_0xd93e('0x41')]=[{'all':!![]}];}_0x20c463=_[_0xd93e('0x3e')]({},_0x20c463,_0x3d490d[_0xd93e('0x3f')]);return db[_0xd93e('0x2b')][_0xd93e('0x45')](_0x20c463)[_0xd93e('0x24')](handleEntityNotFound(_0x11d951,null))[_0xd93e('0x24')](respondWithResult(_0x11d951,null))[_0xd93e('0x46')](handleError(_0x11d951,null));};exports[_0xd93e('0x47')]=function(_0x1624da,_0x543de8){return db[_0xd93e('0x2b')][_0xd93e('0x47')](_0x1624da[_0xd93e('0x48')],{})[_0xd93e('0x24')](respondWithResult(_0x543de8,0xc9))['catch'](handleError(_0x543de8,null));};exports[_0xd93e('0x23')]=function(_0x57ba4f,_0x467b02){if(_0x57ba4f[_0xd93e('0x48')]['id']){delete _0x57ba4f[_0xd93e('0x48')]['id'];}return db[_0xd93e('0x2b')][_0xd93e('0x45')]({'where':{'id':_0x57ba4f['params']['id']}})[_0xd93e('0x24')](handleEntityNotFound(_0x467b02,null))[_0xd93e('0x24')](saveUpdates(_0x57ba4f[_0xd93e('0x48')],null))[_0xd93e('0x24')](respondWithResult(_0x467b02,null))[_0xd93e('0x46')](handleError(_0x467b02,null));};exports['destroy']=function(_0x1d552d,_0xef2705){return db[_0xd93e('0x2b')][_0xd93e('0x45')]({'where':{'id':_0x1d552d['params']['id']}})['then'](handleEntityNotFound(_0xef2705,null))[_0xd93e('0x24')](removeEntity(_0xef2705,null))[_0xd93e('0x46')](handleError(_0xef2705,null));};exports[_0xd93e('0x49')]=function(_0x2e2eed,_0x3d197d,_0x1cc130){var _0x1fa006={};var _0x15f2c1={};var _0x56be38;var _0x4c6eaa;return db[_0xd93e('0x2b')]['findOne']({'where':{'id':_0x2e2eed[_0xd93e('0x4a')]['id']}})[_0xd93e('0x24')](handleEntityNotFound(_0x3d197d,null))[_0xd93e('0x24')](function(_0x2025c9){if(_0x2025c9){_0x56be38=_0x2025c9;_0x15f2c1[_0xd93e('0x37')]=_['keys'](db[_0xd93e('0x4b')]['rawAttributes']);_0x15f2c1[_0xd93e('0x31')]=_[_0xd93e('0x32')](_0x2e2eed[_0xd93e('0x31')]);_0x15f2c1['filters']=_[_0xd93e('0x34')](_0x15f2c1['model'],_0x15f2c1['query']);_0x1fa006[_0xd93e('0x36')]=_[_0xd93e('0x34')](_0x15f2c1[_0xd93e('0x37')],qs[_0xd93e('0x35')](_0x2e2eed[_0xd93e('0x31')]['fields']));_0x1fa006['attributes']=_0x1fa006['attributes']['length']?_0x1fa006[_0xd93e('0x36')]:_0x15f2c1[_0xd93e('0x37')];_0x1fa006['order']=qs[_0xd93e('0x3a')](_0x2e2eed['query'][_0xd93e('0x3a')]);_0x1fa006[_0xd93e('0x3b')]=qs[_0xd93e('0x33')](_[_0xd93e('0x3c')](_0x2e2eed[_0xd93e('0x31')],_0x15f2c1[_0xd93e('0x33')]));if(_0x2e2eed[_0xd93e('0x31')][_0xd93e('0x3d')]){_0x1fa006['where']=_[_0xd93e('0x3e')](_0x1fa006[_0xd93e('0x3b')],{'$or':_[_0xd93e('0x30')](_0x1fa006[_0xd93e('0x36')],function(_0x3278c9){var _0x4b3c5c={};_0x4b3c5c[_0x3278c9]={'$like':'%'+_0x2e2eed[_0xd93e('0x31')][_0xd93e('0x3d')]+'%'};return _0x4b3c5c;})});}_0x1fa006=_[_0xd93e('0x3e')]({},_0x1fa006,_0x2e2eed[_0xd93e('0x3f')]);return _0x56be38['getConfigurations'](_0x1fa006);}})['then'](function(_0x1efb3f){if(_0x1efb3f){_0x4c6eaa=_0x1efb3f[_0xd93e('0x44')];if(!_0x2e2eed[_0xd93e('0x31')][_0xd93e('0x38')](_0xd93e('0x39'))){_0x1fa006[_0xd93e('0x1b')]=qs[_0xd93e('0x1b')](_0x2e2eed['query'][_0xd93e('0x1b')]);_0x1fa006[_0xd93e('0x19')]=qs['offset'](_0x2e2eed[_0xd93e('0x31')]['offset']);}return _0x56be38[_0xd93e('0x49')](_0x1fa006);}})[_0xd93e('0x24')](function(_0x336bc6){if(_0x336bc6){return _0x336bc6?{'count':_0x4c6eaa,'rows':_0x336bc6}:null;}})[_0xd93e('0x24')](respondWithResult(_0x3d197d,null))['catch'](handleError(_0x3d197d,null));};exports[_0xd93e('0x4c')]=function(_0x2e228a,_0x4d701d,_0xc5d319){if(_0x2e228a['body']['id']){delete _0x2e228a[_0xd93e('0x48')]['id'];}return db[_0xd93e('0x2b')][_0xd93e('0x4d')]({'where':{'id':_0x2e228a['params']['id']}})['then'](handleEntityNotFound(_0x4d701d,null))[_0xd93e('0x24')](function(_0x5214e8){if(_0x5214e8){_0x2e228a[_0xd93e('0x48')][_0xd93e('0x4e')]=_0x5214e8['id'];_0x2e228a['body'][_0xd93e('0x4f')]=integrations[_0xd93e('0x50')](_0x2e228a[_0xd93e('0x48')][_0xd93e('0x51')],_0x2e228a['body'][_0xd93e('0x2e')]);_0x2e228a[_0xd93e('0x48')][_0xd93e('0x52')]=integrations['getDescriptions'](_0x2e228a[_0xd93e('0x48')]['channel'],_0x2e228a[_0xd93e('0x48')][_0xd93e('0x2e')]);return db[_0xd93e('0x4b')]['create'](_0x2e228a[_0xd93e('0x48')],{'include':[{'model':db[_0xd93e('0x53')],'as':_0xd93e('0x4f')},{'model':db[_0xd93e('0x53')],'as':_0xd93e('0x52')}]});}return null;})[_0xd93e('0x24')](respondWithResult(_0x4d701d,null))[_0xd93e('0x46')](handleError(_0x4d701d,null));};exports[_0xd93e('0x54')]=function(_0x24de38,_0x12f2ad,_0x27e5c4){var _0x5ecaad='';return db[_0xd93e('0x2b')][_0xd93e('0x4d')]({'where':{'id':_0x24de38[_0xd93e('0x4a')]['id']},'attributes':['id',_0xd93e('0x55'),_0xd93e('0x56')]})['then'](handleEntityNotFound(_0x12f2ad,null))[_0xd93e('0x24')](function(_0xdc1751){if(_0xdc1751){_0x5ecaad=_0xdc1751[_0xd93e('0x55')];var _0x20d88b=_0x5ecaad['slice'](-0x1);if(_0x20d88b==='/'){_0x5ecaad=_0x5ecaad[_0xd93e('0x57')](0x0,_0x5ecaad[_0xd93e('0x58')](_0x20d88b));}return rp({'method':_0xd93e('0x59'),'uri':util['format'](_0xd93e('0x5a'),_0x5ecaad,_0xd93e('0x5b')),'headers':{'Authorization':util[_0xd93e('0x5c')](_0xd93e('0x5d'),new Buffer(util[_0xd93e('0x5c')](_0xd93e('0x5e'),_0xdc1751[_0xd93e('0x56')]))[_0xd93e('0x5f')](_0xd93e('0x60')))},'json':!![]});}})['then'](function(_0xda7ecc){if(_0xda7ecc){var _0x5a6eea=[_0xd93e('0x61'),_0xd93e('0x62'),_0xd93e('0x63'),_0xd93e('0x64'),_0xd93e('0x18'),_0xd93e('0x65'),_0xd93e('0x66'),_0xd93e('0x67'),_0xd93e('0x68'),_0xd93e('0x66'),'company'];_[_0xd93e('0x69')](_0xda7ecc,function(_0x3b6512){return _0x5a6eea[_0xd93e('0x6a')](_0x3b6512['name'])||!_0x3b6512[_0xd93e('0x6b')]&&_0x3b6512[_0xd93e('0x2e')]!==_0xd93e('0x6c')&&_0x3b6512[_0xd93e('0x2e')]!==_0xd93e('0x6d');});return{'count':_0xda7ecc[_0xd93e('0x44')],'rows':_[_0xd93e('0x30')](_0xda7ecc,function(_0x5c1581){return{'id':_0x5c1581[_0xd93e('0x29')],'name':_0x5c1581[_0xd93e('0x6e')],'custom':!_0x5c1581[_0xd93e('0x6b')],'options':_0x5c1581[_0xd93e('0x6f')]?_['map'](_0x5c1581['choices'],function(_0x18add0){return{'name':_[_0xd93e('0x70')](_0x18add0),'value':_0x18add0};}):[]};})};}})[_0xd93e('0x24')](respondWithResult(_0x12f2ad,null))[_0xd93e('0x46')](function(_0x54ce9a){var _0x45c0ac=_0x24de38['query'][_0xd93e('0x71')]?0x1f4:_0x54ce9a[_0xd93e('0x72')]||0x1f4;logger[_0xd93e('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xd93e('0x54'),_0x45c0ac,JSON[_0xd93e('0x73')](_0x54ce9a));delete _0x54ce9a['name'];if(_0x45c0ac===0x191){_0x45c0ac=0x190;}_0x12f2ad[_0xd93e('0x18')](_0x45c0ac)[_0xd93e('0x2a')](_0x24de38[_0xd93e('0x31')][_0xd93e('0x71')]?{'message':_0xd93e('0x74'),'statusCode':_0x54ce9a[_0xd93e('0x72')]}:_0x54ce9a);});}; \ No newline at end of file +var _0xb677=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','api/v2/ticket_fields','%s:X','requester','subject','agent','priority','group','source','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','end','error','name','FreshdeskAccount','fieldName','type','key','model'];(function(_0x5e92ae,_0x15f7ea){var _0x13cb1d=function(_0x392bd9){while(--_0x392bd9){_0x5e92ae['push'](_0x5e92ae['shift']());}};_0x13cb1d(++_0x15f7ea);}(_0xb677,0x119));var _0x7b67=function(_0x23546c,_0x192572){_0x23546c=_0x23546c-0x0;var _0x35612b=_0xb677[_0x23546c];return _0x35612b;};'use strict';var emlformat=require(_0x7b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b67('0x1'));var jsonpatch=require(_0x7b67('0x2'));var rp=require(_0x7b67('0x3'));var moment=require(_0x7b67('0x4'));var BPromise=require(_0x7b67('0x5'));var Mustache=require(_0x7b67('0x6'));var util=require(_0x7b67('0x7'));var path=require(_0x7b67('0x8'));var sox=require('sox');var csv=require(_0x7b67('0x9'));var ejs=require(_0x7b67('0xa'));var fs=require('fs');var fs_extra=require(_0x7b67('0xb'));var _=require(_0x7b67('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7b67('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b67('0xf'));var authService=require(_0x7b67('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b67('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b67('0x12'))(_0x7b67('0x13'));var utils=require(_0x7b67('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7b67('0x15'));function respondWithStatusCode(_0x454df4,_0x1e17fc){_0x1e17fc=_0x1e17fc||0xcc;return function(_0x963f60){if(_0x963f60){return _0x454df4[_0x7b67('0x16')](_0x1e17fc);}return _0x454df4[_0x7b67('0x17')](_0x1e17fc)['end']();};}function respondWithResult(_0x37eb7a,_0x473d10){_0x473d10=_0x473d10||0xc8;return function(_0x233388){if(_0x233388){return _0x37eb7a[_0x7b67('0x17')](_0x473d10)[_0x7b67('0x18')](_0x233388);}};}function respondWithFilteredResult(_0x309f1c,_0x1861d1){return function(_0xf99987){if(_0xf99987){var _0x52c21b=typeof _0x1861d1[_0x7b67('0x19')]===_0x7b67('0x1a')&&typeof _0x1861d1[_0x7b67('0x1b')]===_0x7b67('0x1a');var _0x241f1d=_0xf99987[_0x7b67('0x1c')];var _0x59fd3d=_0x52c21b?0x0:_0x1861d1[_0x7b67('0x19')];var _0x348f28=_0x52c21b?_0xf99987[_0x7b67('0x1c')]:_0x1861d1[_0x7b67('0x19')]+_0x1861d1[_0x7b67('0x1b')];var _0x4095e7;if(_0x348f28>=_0x241f1d){_0x348f28=_0x241f1d;_0x4095e7=0xc8;}else{_0x4095e7=0xce;}_0x309f1c[_0x7b67('0x17')](_0x4095e7);return _0x309f1c[_0x7b67('0x1d')](_0x7b67('0x1e'),_0x59fd3d+'-'+_0x348f28+'/'+_0x241f1d)[_0x7b67('0x18')](_0xf99987);}return null;};}function patchUpdates(_0x5ddb36){return function(_0x125924){try{jsonpatch[_0x7b67('0x1f')](_0x125924,_0x5ddb36,!![]);}catch(_0x55cab1){return BPromise['reject'](_0x55cab1);}return _0x125924['save']();};}function saveUpdates(_0x48944a,_0x44b951){return function(_0xeabc5c){if(_0xeabc5c){return _0xeabc5c[_0x7b67('0x20')](_0x48944a)[_0x7b67('0x21')](function(_0x2c3f11){return _0x2c3f11;});}return null;};}function removeEntity(_0x56b952,_0x3b4fea){return function(_0x12d848){if(_0x12d848){return _0x12d848[_0x7b67('0x22')]()[_0x7b67('0x21')](function(){_0x56b952[_0x7b67('0x17')](0xcc)[_0x7b67('0x23')]();});}};}function handleEntityNotFound(_0x2b6da7,_0x50e71c){return function(_0x463c41){if(!_0x463c41){_0x2b6da7['sendStatus'](0x194);}return _0x463c41;};}function handleError(_0x45da6b,_0x2f1e62){_0x2f1e62=_0x2f1e62||0x1f4;return function(_0x250fb0){logger[_0x7b67('0x24')](_0x250fb0['stack']);if(_0x250fb0[_0x7b67('0x25')]){delete _0x250fb0[_0x7b67('0x25')];}_0x45da6b[_0x7b67('0x17')](_0x2f1e62)['send'](_0x250fb0);};}exports['index']=function(_0x5ac43f,_0x8649ec){var _0x4bd8b7={},_0x5ee006={},_0x2cd200={'count':0x0,'rows':[]};var _0x3de320=_['map'](db[_0x7b67('0x26')]['rawAttributes'],function(_0x4815ab){return{'name':_0x4815ab[_0x7b67('0x27')],'type':_0x4815ab[_0x7b67('0x28')][_0x7b67('0x29')]};});_0x5ee006[_0x7b67('0x2a')]=_[_0x7b67('0x2b')](_0x3de320,_0x7b67('0x25'));_0x5ee006[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x5ac43f[_0x7b67('0x2c')]);_0x5ee006[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x5ee006[_0x7b67('0x2a')],_0x5ee006[_0x7b67('0x2c')]);_0x4bd8b7[_0x7b67('0x30')]=_[_0x7b67('0x2f')](_0x5ee006[_0x7b67('0x2a')],qs[_0x7b67('0x31')](_0x5ac43f['query'][_0x7b67('0x31')]));_0x4bd8b7[_0x7b67('0x30')]=_0x4bd8b7['attributes'][_0x7b67('0x32')]?_0x4bd8b7[_0x7b67('0x30')]:_0x5ee006[_0x7b67('0x2a')];if(!_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x33')](_0x7b67('0x34'))){_0x4bd8b7[_0x7b67('0x1b')]=qs[_0x7b67('0x1b')](_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x1b')]);_0x4bd8b7[_0x7b67('0x19')]=qs[_0x7b67('0x19')](_0x5ac43f[_0x7b67('0x2c')]['offset']);}_0x4bd8b7[_0x7b67('0x35')]=qs[_0x7b67('0x36')](_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x36')]);_0x4bd8b7['where']=qs[_0x7b67('0x2e')](_[_0x7b67('0x37')](_0x5ac43f[_0x7b67('0x2c')],_0x5ee006[_0x7b67('0x2e')]),_0x3de320);if(_0x5ac43f[_0x7b67('0x2c')]['filter']){_0x4bd8b7[_0x7b67('0x38')]=_[_0x7b67('0x39')](_0x4bd8b7[_0x7b67('0x38')],{'$or':_[_0x7b67('0x2b')](_0x3de320,function(_0x2f82ac){if(_0x2f82ac[_0x7b67('0x28')]!==_0x7b67('0x3a')){var _0x254eec={};_0x254eec[_0x2f82ac[_0x7b67('0x25')]]={'$like':'%'+_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x3b')]+'%'};return _0x254eec;}})});}_0x4bd8b7=_[_0x7b67('0x39')]({},_0x4bd8b7,_0x5ac43f[_0x7b67('0x3c')]);var _0x2ef44e={'where':_0x4bd8b7[_0x7b67('0x38')]};return db['FreshdeskAccount'][_0x7b67('0x1c')](_0x2ef44e)[_0x7b67('0x21')](function(_0x1d19c8){_0x2cd200[_0x7b67('0x1c')]=_0x1d19c8;if(_0x5ac43f[_0x7b67('0x2c')][_0x7b67('0x3d')]){_0x4bd8b7['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7b67('0x3e')](_0x4bd8b7);})[_0x7b67('0x21')](function(_0x571ac9){_0x2cd200['rows']=_0x571ac9;return _0x2cd200;})[_0x7b67('0x21')](respondWithFilteredResult(_0x8649ec,_0x4bd8b7))[_0x7b67('0x3f')](handleError(_0x8649ec,null));};exports[_0x7b67('0x40')]=function(_0x30da75,_0x3e6f37){var _0x46629b={'raw':![],'where':{'id':_0x30da75[_0x7b67('0x41')]['id']}},_0x4f39df={};_0x4f39df[_0x7b67('0x2a')]=_[_0x7b67('0x2d')](db[_0x7b67('0x26')]['rawAttributes']);_0x4f39df[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x30da75[_0x7b67('0x2c')]);_0x4f39df['filters']=_['intersection'](_0x4f39df[_0x7b67('0x2a')],_0x4f39df['query']);_0x46629b[_0x7b67('0x30')]=_['intersection'](_0x4f39df['model'],qs[_0x7b67('0x31')](_0x30da75['query'][_0x7b67('0x31')]));_0x46629b['attributes']=_0x46629b[_0x7b67('0x30')][_0x7b67('0x32')]?_0x46629b['attributes']:_0x4f39df[_0x7b67('0x2a')];if(_0x30da75[_0x7b67('0x2c')][_0x7b67('0x3d')]){_0x46629b[_0x7b67('0x42')]=[{'all':!![]}];}_0x46629b=_[_0x7b67('0x39')]({},_0x46629b,_0x30da75[_0x7b67('0x3c')]);return db[_0x7b67('0x26')][_0x7b67('0x43')](_0x46629b)[_0x7b67('0x21')](handleEntityNotFound(_0x3e6f37,null))[_0x7b67('0x21')](respondWithResult(_0x3e6f37,null))[_0x7b67('0x3f')](handleError(_0x3e6f37,null));};exports[_0x7b67('0x44')]=function(_0x3dd431,_0x3e7b0f){return db['FreshdeskAccount'][_0x7b67('0x44')](_0x3dd431[_0x7b67('0x45')],{})['then'](respondWithResult(_0x3e7b0f,0xc9))[_0x7b67('0x3f')](handleError(_0x3e7b0f,null));};exports['update']=function(_0x1c80e9,_0x3ae6d5){if(_0x1c80e9[_0x7b67('0x45')]['id']){delete _0x1c80e9[_0x7b67('0x45')]['id'];}return db['FreshdeskAccount'][_0x7b67('0x43')]({'where':{'id':_0x1c80e9[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x3ae6d5,null))['then'](saveUpdates(_0x1c80e9['body'],null))[_0x7b67('0x21')](respondWithResult(_0x3ae6d5,null))[_0x7b67('0x3f')](handleError(_0x3ae6d5,null));};exports['destroy']=function(_0x501088,_0x3d35c3){return db[_0x7b67('0x26')][_0x7b67('0x43')]({'where':{'id':_0x501088[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x3d35c3,null))['then'](removeEntity(_0x3d35c3,null))[_0x7b67('0x3f')](handleError(_0x3d35c3,null));};exports[_0x7b67('0x46')]=function(_0x3689e4,_0x439551,_0x5a6b5d){var _0x1a2b81={};var _0x5465db={};var _0x3510b6;var _0x1ea2b5;return db[_0x7b67('0x26')][_0x7b67('0x47')]({'where':{'id':_0x3689e4[_0x7b67('0x41')]['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x439551,null))[_0x7b67('0x21')](function(_0x2023da){if(_0x2023da){_0x3510b6=_0x2023da;_0x5465db['model']=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x5465db[_0x7b67('0x2c')]=_[_0x7b67('0x2d')](_0x3689e4[_0x7b67('0x2c')]);_0x5465db[_0x7b67('0x2e')]=_[_0x7b67('0x2f')](_0x5465db['model'],_0x5465db[_0x7b67('0x2c')]);_0x1a2b81['attributes']=_[_0x7b67('0x2f')](_0x5465db[_0x7b67('0x2a')],qs[_0x7b67('0x31')](_0x3689e4[_0x7b67('0x2c')][_0x7b67('0x31')]));_0x1a2b81['attributes']=_0x1a2b81[_0x7b67('0x30')][_0x7b67('0x32')]?_0x1a2b81[_0x7b67('0x30')]:_0x5465db[_0x7b67('0x2a')];_0x1a2b81['order']=qs[_0x7b67('0x36')](_0x3689e4[_0x7b67('0x2c')]['sort']);_0x1a2b81[_0x7b67('0x38')]=qs[_0x7b67('0x2e')](_[_0x7b67('0x37')](_0x3689e4['query'],_0x5465db[_0x7b67('0x2e')]));if(_0x3689e4[_0x7b67('0x2c')]['filter']){_0x1a2b81['where']=_[_0x7b67('0x39')](_0x1a2b81[_0x7b67('0x38')],{'$or':_[_0x7b67('0x2b')](_0x1a2b81['attributes'],function(_0x1048e9){var _0x1767f9={};_0x1767f9[_0x1048e9]={'$like':'%'+_0x3689e4[_0x7b67('0x2c')]['filter']+'%'};return _0x1767f9;})});}_0x1a2b81=_[_0x7b67('0x39')]({},_0x1a2b81,_0x3689e4[_0x7b67('0x3c')]);return _0x3510b6['getConfigurations'](_0x1a2b81);}})['then'](function(_0x4f9267){if(_0x4f9267){_0x1ea2b5=_0x4f9267[_0x7b67('0x32')];if(!_0x3689e4[_0x7b67('0x2c')][_0x7b67('0x33')]('nolimit')){_0x1a2b81['limit']=qs[_0x7b67('0x1b')](_0x3689e4['query'][_0x7b67('0x1b')]);_0x1a2b81[_0x7b67('0x19')]=qs[_0x7b67('0x19')](_0x3689e4['query'][_0x7b67('0x19')]);}return _0x3510b6[_0x7b67('0x46')](_0x1a2b81);}})[_0x7b67('0x21')](function(_0x44d54b){if(_0x44d54b){return _0x44d54b?{'count':_0x1ea2b5,'rows':_0x44d54b}:null;}})[_0x7b67('0x21')](respondWithResult(_0x439551,null))[_0x7b67('0x3f')](handleError(_0x439551,null));};exports[_0x7b67('0x48')]=function(_0x7c9f96,_0x1e4b7a,_0x16dd22){if(_0x7c9f96['body']['id']){delete _0x7c9f96[_0x7b67('0x45')]['id'];}return db[_0x7b67('0x26')]['findOne']({'where':{'id':_0x7c9f96['params']['id']}})[_0x7b67('0x21')](handleEntityNotFound(_0x1e4b7a,null))['then'](function(_0x5115bc){if(_0x5115bc){_0x7c9f96[_0x7b67('0x45')]['AccountId']=_0x5115bc['id'];_0x7c9f96['body'][_0x7b67('0x49')]=integrations['getSubjects'](_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x4a')],_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x28')]);_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x4b')]=integrations['getDescriptions'](_0x7c9f96['body']['channel'],_0x7c9f96[_0x7b67('0x45')][_0x7b67('0x28')]);return db[_0x7b67('0x4c')][_0x7b67('0x44')](_0x7c9f96['body'],{'include':[{'model':db[_0x7b67('0x4d')],'as':_0x7b67('0x49')},{'model':db[_0x7b67('0x4d')],'as':_0x7b67('0x4b')}]});}return null;})[_0x7b67('0x21')](respondWithResult(_0x1e4b7a,null))[_0x7b67('0x3f')](handleError(_0x1e4b7a,null));};exports[_0x7b67('0x4e')]=function(_0x2c83e7,_0x498b04,_0x3b7d30){var _0xd8ced3='';return db['FreshdeskAccount'][_0x7b67('0x47')]({'where':{'id':_0x2c83e7[_0x7b67('0x41')]['id']},'attributes':['id',_0x7b67('0x4f'),_0x7b67('0x50')]})[_0x7b67('0x21')](handleEntityNotFound(_0x498b04,null))['then'](function(_0x1cdecd){if(_0x1cdecd){_0xd8ced3=_0x1cdecd['remoteUri'];var _0x2cbab9=_0xd8ced3[_0x7b67('0x51')](-0x1);if(_0x2cbab9==='/'){_0xd8ced3=_0xd8ced3['substring'](0x0,_0xd8ced3[_0x7b67('0x52')](_0x2cbab9));}return rp({'method':_0x7b67('0x53'),'uri':util[_0x7b67('0x54')]('%s/%s',_0xd8ced3,_0x7b67('0x55')),'headers':{'Authorization':util[_0x7b67('0x54')]('Basic\x20%s',new Buffer(util[_0x7b67('0x54')](_0x7b67('0x56'),_0x1cdecd['apiKey']))['toString']('base64'))},'json':!![]});}})[_0x7b67('0x21')](function(_0x3293a1){if(_0x3293a1){var _0xa13bd9=[_0x7b67('0x57'),_0x7b67('0x58'),_0x7b67('0x59'),'description','status',_0x7b67('0x5a'),_0x7b67('0x5b'),_0x7b67('0x5c'),'ticket_type','group',_0x7b67('0x5d')];_[_0x7b67('0x5e')](_0x3293a1,function(_0x510b1f){return _0xa13bd9[_0x7b67('0x5f')](_0x510b1f[_0x7b67('0x25')])||!_0x510b1f[_0x7b67('0x60')]&&_0x510b1f['type']!==_0x7b67('0x61')&&_0x510b1f[_0x7b67('0x28')]!==_0x7b67('0x62');});return{'count':_0x3293a1[_0x7b67('0x32')],'rows':_[_0x7b67('0x2b')](_0x3293a1,function(_0xc6314f){return{'id':_0xc6314f[_0x7b67('0x25')],'name':_0xc6314f[_0x7b67('0x63')],'custom':!_0xc6314f[_0x7b67('0x60')],'options':_0xc6314f[_0x7b67('0x64')]?_['map'](_0xc6314f['choices'],function(_0x225000){return{'name':_[_0x7b67('0x65')](_0x225000),'value':_0x225000};}):[]};})};}})[_0x7b67('0x21')](respondWithResult(_0x498b04,null))['catch'](function(_0x2a9bcd){var _0x33f21b=_0x2c83e7['query'][_0x7b67('0x66')]?0x1f4:_0x2a9bcd[_0x7b67('0x67')]||0x1f4;logger[_0x7b67('0x24')](_0x7b67('0x68'),_0x7b67('0x4e'),_0x33f21b,JSON[_0x7b67('0x69')](_0x2a9bcd));delete _0x2a9bcd[_0x7b67('0x25')];if(_0x33f21b===0x191){_0x33f21b=0x190;}_0x498b04['status'](_0x33f21b)[_0x7b67('0x6a')](_0x2c83e7['query']['test']?{'message':_0x7b67('0x6b'),'statusCode':_0x2a9bcd[_0x7b67('0x67')]}:_0x2a9bcd);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a455c4a..35b7bea 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 _0xd11b=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ac563,_0x53621e){var _0x3e855f=function(_0xd0d3fb){while(--_0xd0d3fb){_0x3ac563['push'](_0x3ac563['shift']());}};_0x3e855f(++_0x53621e);}(_0xd11b,0x1cd));var _0xbd11=function(_0x350fe1,_0x53971c){_0x350fe1=_0x350fe1-0x0;var _0x8b53d6=_0xd11b[_0x350fe1];return _0x8b53d6;};'use strict';var _=require(_0xbd11('0x0'));var util=require(_0xbd11('0x1'));var logger=require(_0xbd11('0x2'))(_0xbd11('0x3'));var moment=require(_0xbd11('0x4'));var BPromise=require(_0xbd11('0x5'));var rp=require(_0xbd11('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbd11('0x7'));var attributes=require(_0xbd11('0x8'));var integrations=require(_0xbd11('0x9'));module[_0xbd11('0xa')]=function(_0x2d5c4f,_0x7c93bb){return _0x2d5c4f[_0xbd11('0xb')]('FreshdeskAccount',attributes,{'tableName':_0xbd11('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ff3=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','request-promise'];(function(_0xf7941b,_0x1e022f){var _0xfabcd8=function(_0x12f654){while(--_0x12f654){_0xf7941b['push'](_0xf7941b['shift']());}};_0xfabcd8(++_0x1e022f);}(_0x3ff3,0x104));var _0x33ff=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3ff3[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x33ff('0x0'));var logger=require(_0x33ff('0x1'))('api');var moment=require(_0x33ff('0x2'));var BPromise=require('bluebird');var rp=require(_0x33ff('0x3'));var fs=require('fs');var path=require(_0x33ff('0x4'));var rimraf=require(_0x33ff('0x5'));var config=require(_0x33ff('0x6'));var attributes=require(_0x33ff('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x33ff('0x8')]=function(_0x162970,_0x19cc80){return _0x162970[_0x33ff('0x9')](_0x33ff('0xa'),attributes,{'tableName':_0x33ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index c955c4a..3518292 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 _0x133b=['code','message','result','FreshdeskAccount','options','raw','where','attributes','limit','map','include','model','GetFreshdeskAccount','catch','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1d8edc,_0x3dc8c8){var _0x10d35f=function(_0x24dabd){while(--_0x24dabd){_0x1d8edc['push'](_0x1d8edc['shift']());}};_0x10d35f(++_0x3dc8c8);}(_0x133b,0x7c));var _0xb133=function(_0x45f441,_0x35b586){_0x45f441=_0x45f441-0x0;var _0x5d24e0=_0x133b[_0x45f441];return _0x5d24e0;};'use strict';var _=require('lodash');var util=require(_0xb133('0x0'));var moment=require(_0xb133('0x1'));var BPromise=require(_0xb133('0x2'));var rs=require(_0xb133('0x3'));var fs=require('fs');var Redis=require(_0xb133('0x4'));var db=require(_0xb133('0x5'))['db'];var utils=require(_0xb133('0x6'));var logger=require('../../config/logger')(_0xb133('0x7'));var config=require(_0xb133('0x8'));var jayson=require(_0xb133('0x9'));var client=jayson['client'][_0xb133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a4a23,_0x293381,_0x3f0d97){return new BPromise(function(_0x1b811f,_0x385af1){return client[_0xb133('0xb')](_0x2a4a23,_0x3f0d97)[_0xb133('0xc')](function(_0x1aab25){logger[_0xb133('0xd')](_0xb133('0xe'),_0x293381,_0xb133('0xf'));logger[_0xb133('0x10')](_0xb133('0x11'),_0x293381,_0xb133('0xf'),JSON[_0xb133('0x12')](_0x1aab25));if(_0x1aab25['error']){if(_0x1aab25[_0xb133('0x13')][_0xb133('0x14')]===0x1f4){logger[_0xb133('0x13')](_0xb133('0xe'),_0x293381,_0x1aab25[_0xb133('0x13')][_0xb133('0x15')]);return _0x385af1(_0x1aab25[_0xb133('0x13')]['message']);}logger[_0xb133('0x13')](_0xb133('0xe'),_0x293381,_0x1aab25['error']['message']);return _0x1b811f(_0x1aab25['error'][_0xb133('0x15')]);}else{logger[_0xb133('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x293381,_0xb133('0xf'));_0x1b811f(_0x1aab25[_0xb133('0x16')][_0xb133('0x15')]);}})['catch'](function(_0x5a46d1){logger[_0xb133('0x13')](_0xb133('0xe'),_0x293381,_0x5a46d1);_0x385af1(_0x5a46d1);});});}exports['GetFreshdeskAccount']=function(_0x239eeb){var _0x163168=this;return new Promise(function(_0x109eee,_0x18b76a){return db[_0xb133('0x17')]['findAll']({'raw':_0x239eeb[_0xb133('0x18')]?_0x239eeb[_0xb133('0x18')][_0xb133('0x19')]===undefined?!![]:![]:!![],'where':_0x239eeb['options']?_0x239eeb[_0xb133('0x18')][_0xb133('0x1a')]||null:null,'attributes':_0x239eeb['options']?_0x239eeb[_0xb133('0x18')][_0xb133('0x1b')]||null:null,'limit':_0x239eeb[_0xb133('0x18')]?_0x239eeb[_0xb133('0x18')][_0xb133('0x1c')]||null:null,'include':_0x239eeb['options']?_0x239eeb[_0xb133('0x18')]['include']?_[_0xb133('0x1d')](_0x239eeb['options'][_0xb133('0x1e')],function(_0x41342b){return{'model':db[_0x41342b[_0xb133('0x1f')]],'as':_0x41342b['as'],'attributes':_0x41342b[_0xb133('0x1b')],'include':_0x41342b[_0xb133('0x1e')]?_['map'](_0x41342b[_0xb133('0x1e')],function(_0x1ffed5){return{'model':db[_0x1ffed5['model']],'as':_0x1ffed5['as'],'attributes':_0x1ffed5['attributes'],'include':_0x1ffed5['include']?_[_0xb133('0x1d')](_0x1ffed5['include'],function(_0x1a7ff6){return{'model':db[_0x1a7ff6['model']],'as':_0x1a7ff6['as'],'attributes':_0x1a7ff6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a3541){logger['info'](_0xb133('0x20'),_0x239eeb);logger['debug'](_0xb133('0x20'),_0x239eeb,JSON[_0xb133('0x12')](_0x1a3541));_0x109eee(_0x1a3541);})[_0xb133('0x21')](function(_0x58c758){logger[_0xb133('0x13')](_0xb133('0x20'),_0x58c758['message'],_0x239eeb);_0x18b76a(_0x163168['error'](0x1f4,_0x58c758[_0xb133('0x15')]));});});};exports[_0xb133('0x22')]=function(_0x1fbc6d){var _0x3d41b8=this;return new Promise(function(_0x2c0d45,_0x32a4c1){return db[_0xb133('0x17')][_0xb133('0x23')]({'raw':_0x1fbc6d[_0xb133('0x18')]?_0x1fbc6d[_0xb133('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1fbc6d[_0xb133('0x18')]?_0x1fbc6d[_0xb133('0x18')][_0xb133('0x1a')]||null:null,'attributes':_0x1fbc6d[_0xb133('0x18')]?_0x1fbc6d[_0xb133('0x18')][_0xb133('0x1b')]||null:null,'include':_0x1fbc6d[_0xb133('0x18')]?_0x1fbc6d[_0xb133('0x18')][_0xb133('0x1e')]?_[_0xb133('0x1d')](_0x1fbc6d[_0xb133('0x18')][_0xb133('0x1e')],function(_0x27fa85){return{'model':db[_0x27fa85[_0xb133('0x1f')]],'as':_0x27fa85['as'],'attributes':_0x27fa85[_0xb133('0x1b')],'include':_0x27fa85[_0xb133('0x1e')]?_[_0xb133('0x1d')](_0x27fa85[_0xb133('0x1e')],function(_0x47f922){return{'model':db[_0x47f922[_0xb133('0x1f')]],'as':_0x47f922['as'],'attributes':_0x47f922[_0xb133('0x1b')],'include':_0x47f922[_0xb133('0x1e')]?_['map'](_0x47f922[_0xb133('0x1e')],function(_0x3f1ab9){return{'model':db[_0x3f1ab9[_0xb133('0x1f')]],'as':_0x3f1ab9['as'],'attributes':_0x3f1ab9[_0xb133('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb133('0xc')](function(_0x942278){logger[_0xb133('0xd')](_0xb133('0x22'),_0x1fbc6d);logger[_0xb133('0x10')]('ShowFreshdeskAccount',_0x1fbc6d,JSON['stringify'](_0x942278));_0x2c0d45(_0x942278);})[_0xb133('0x21')](function(_0x56ac36){logger['error'](_0xb133('0x22'),_0x56ac36[_0xb133('0x15')],_0x1fbc6d);_0x32a4c1(_0x3d41b8[_0xb133('0x13')](0x1f4,_0x56ac36[_0xb133('0x15')]));});});}; \ No newline at end of file +var _0xef1e=['request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','raw','options','where','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x107fcd,_0x525873){var _0x4254bd=function(_0x3fbe38){while(--_0x3fbe38){_0x107fcd['push'](_0x107fcd['shift']());}};_0x4254bd(++_0x525873);}(_0xef1e,0x14e));var _0xeef1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xef1e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xeef1('0x0'));var util=require(_0xeef1('0x1'));var moment=require(_0xeef1('0x2'));var BPromise=require(_0xeef1('0x3'));var rs=require(_0xeef1('0x4'));var fs=require('fs');var Redis=require(_0xeef1('0x5'));var db=require(_0xeef1('0x6'))['db'];var utils=require(_0xeef1('0x7'));var logger=require(_0xeef1('0x8'))(_0xeef1('0x9'));var config=require(_0xeef1('0xa'));var jayson=require(_0xeef1('0xb'));var client=jayson[_0xeef1('0xc')][_0xeef1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x27a8fa,_0x405c90,_0x404e9e){return new BPromise(function(_0x566b41,_0xc089cc){return client[_0xeef1('0xe')](_0x27a8fa,_0x404e9e)['then'](function(_0x19a293){logger[_0xeef1('0xf')](_0xeef1('0x10'),_0x405c90,_0xeef1('0x11'));logger['debug'](_0xeef1('0x12'),_0x405c90,_0xeef1('0x11'),JSON[_0xeef1('0x13')](_0x19a293));if(_0x19a293['error']){if(_0x19a293['error'][_0xeef1('0x14')]===0x1f4){logger[_0xeef1('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x405c90,_0x19a293['error'][_0xeef1('0x16')]);return _0xc089cc(_0x19a293['error'][_0xeef1('0x16')]);}logger[_0xeef1('0x15')](_0xeef1('0x10'),_0x405c90,_0x19a293['error'][_0xeef1('0x16')]);return _0x566b41(_0x19a293[_0xeef1('0x15')][_0xeef1('0x16')]);}else{logger[_0xeef1('0xf')](_0xeef1('0x10'),_0x405c90,'request\x20sent');_0x566b41(_0x19a293['result'][_0xeef1('0x16')]);}})[_0xeef1('0x17')](function(_0x5e6c02){logger['error'](_0xeef1('0x10'),_0x405c90,_0x5e6c02);_0xc089cc(_0x5e6c02);});});}exports[_0xeef1('0x18')]=function(_0x37ed94){var _0x5df668=this;return new Promise(function(_0x2ac2e6,_0x4f801f){return db[_0xeef1('0x19')][_0xeef1('0x1a')]({'raw':_0x37ed94['options']?_0x37ed94['options'][_0xeef1('0x1b')]===undefined?!![]:![]:!![],'where':_0x37ed94[_0xeef1('0x1c')]?_0x37ed94[_0xeef1('0x1c')][_0xeef1('0x1d')]||null:null,'attributes':_0x37ed94[_0xeef1('0x1c')]?_0x37ed94[_0xeef1('0x1c')][_0xeef1('0x1e')]||null:null,'limit':_0x37ed94['options']?_0x37ed94[_0xeef1('0x1c')][_0xeef1('0x1f')]||null:null,'include':_0x37ed94['options']?_0x37ed94['options'][_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x37ed94[_0xeef1('0x1c')]['include'],function(_0x422dcf){return{'model':db[_0x422dcf['model']],'as':_0x422dcf['as'],'attributes':_0x422dcf['attributes'],'include':_0x422dcf['include']?_[_0xeef1('0x21')](_0x422dcf[_0xeef1('0x20')],function(_0x7845cc){return{'model':db[_0x7845cc[_0xeef1('0x22')]],'as':_0x7845cc['as'],'attributes':_0x7845cc[_0xeef1('0x1e')],'include':_0x7845cc[_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x7845cc[_0xeef1('0x20')],function(_0x1bbf2a){return{'model':db[_0x1bbf2a[_0xeef1('0x22')]],'as':_0x1bbf2a['as'],'attributes':_0x1bbf2a[_0xeef1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xee70ca){logger[_0xeef1('0xf')](_0xeef1('0x18'),_0x37ed94);logger[_0xeef1('0x23')](_0xeef1('0x18'),_0x37ed94,JSON[_0xeef1('0x13')](_0xee70ca));_0x2ac2e6(_0xee70ca);})['catch'](function(_0x3b4ec7){logger[_0xeef1('0x15')](_0xeef1('0x18'),_0x3b4ec7['message'],_0x37ed94);_0x4f801f(_0x5df668[_0xeef1('0x15')](0x1f4,_0x3b4ec7[_0xeef1('0x16')]));});});};exports[_0xeef1('0x24')]=function(_0x33ccb3){var _0x252845=this;return new Promise(function(_0x33eec5,_0x3aa7b8){return db[_0xeef1('0x19')][_0xeef1('0x25')]({'raw':_0x33ccb3[_0xeef1('0x1c')]?_0x33ccb3[_0xeef1('0x1c')][_0xeef1('0x1b')]===undefined?!![]:![]:!![],'where':_0x33ccb3['options']?_0x33ccb3[_0xeef1('0x1c')]['where']||null:null,'attributes':_0x33ccb3[_0xeef1('0x1c')]?_0x33ccb3[_0xeef1('0x1c')][_0xeef1('0x1e')]||null:null,'include':_0x33ccb3[_0xeef1('0x1c')]?_0x33ccb3['options'][_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x33ccb3[_0xeef1('0x1c')][_0xeef1('0x20')],function(_0x59d1ef){return{'model':db[_0x59d1ef[_0xeef1('0x22')]],'as':_0x59d1ef['as'],'attributes':_0x59d1ef[_0xeef1('0x1e')],'include':_0x59d1ef[_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x59d1ef[_0xeef1('0x20')],function(_0x525413){return{'model':db[_0x525413['model']],'as':_0x525413['as'],'attributes':_0x525413[_0xeef1('0x1e')],'include':_0x525413[_0xeef1('0x20')]?_[_0xeef1('0x21')](_0x525413[_0xeef1('0x20')],function(_0x32e864){return{'model':db[_0x32e864[_0xeef1('0x22')]],'as':_0x32e864['as'],'attributes':_0x32e864[_0xeef1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xeef1('0x26')](function(_0x349b8f){logger[_0xeef1('0xf')]('ShowFreshdeskAccount',_0x33ccb3);logger[_0xeef1('0x23')](_0xeef1('0x24'),_0x33ccb3,JSON[_0xeef1('0x13')](_0x349b8f));_0x33eec5(_0x349b8f);})[_0xeef1('0x17')](function(_0x1d9b4b){logger['error'](_0xeef1('0x24'),_0x1d9b4b[_0xeef1('0x16')],_0x33ccb3);_0x3aa7b8(_0x252845[_0xeef1('0x15')](0x1f4,_0x1d9b4b['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 5583a69..d9371bf 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 _0x4927=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/tags','post','create','setTags','put','/:id','update','delete','destroy','exports'];(function(_0x40b6f9,_0x505c1c){var _0x124607=function(_0x4c298b){while(--_0x4c298b){_0x40b6f9['push'](_0x40b6f9['shift']());}};_0x124607(++_0x505c1c);}(_0x4927,0xc8));var _0x7492=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4927[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x7492('0x0'));var util=require(_0x7492('0x1'));var path=require('path');var timeout=require(_0x7492('0x2'));var express=require(_0x7492('0x3'));var router=express[_0x7492('0x4')]();var fs_extra=require(_0x7492('0x5'));var auth=require(_0x7492('0x6'));var interaction=require(_0x7492('0x7'));var config=require('../../config/environment');var controller=require(_0x7492('0x8'));router[_0x7492('0x9')]('/',auth[_0x7492('0xa')](),controller[_0x7492('0xb')]);router['get']('/:id',auth[_0x7492('0xa')](),controller[_0x7492('0xc')]);router[_0x7492('0x9')](_0x7492('0xd'),auth[_0x7492('0xa')](),controller[_0x7492('0xe')]);router[_0x7492('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x7492('0x9')]('/:id/descriptions',auth[_0x7492('0xa')](),controller['getDescriptions']);router['get'](_0x7492('0xf'),auth['isAuthenticated'](),controller['getTags']);router[_0x7492('0x10')]('/',auth['isAuthenticated'](),controller[_0x7492('0x11')]);router['post'](_0x7492('0xf'),auth[_0x7492('0xa')](),controller[_0x7492('0x12')]);router[_0x7492('0x13')](_0x7492('0x14'),auth[_0x7492('0xa')](),controller[_0x7492('0x15')]);router[_0x7492('0x16')](_0x7492('0x14'),auth[_0x7492('0xa')](),controller[_0x7492('0x17')]);module[_0x7492('0x18')]=router; \ No newline at end of file +var _0x7f76=['get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','/:id','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2734fd,_0x5ba469){var _0x3170d2=function(_0xd1d36f){while(--_0xd1d36f){_0x2734fd['push'](_0x2734fd['shift']());}};_0x3170d2(++_0x5ba469);}(_0x7f76,0x117));var _0x67f7=function(_0x4f274f,_0x16a70c){_0x4f274f=_0x4f274f-0x0;var _0x18345b=_0x7f76[_0x4f274f];return _0x18345b;};'use strict';var multer=require('multer');var util=require(_0x67f7('0x0'));var path=require(_0x67f7('0x1'));var timeout=require(_0x67f7('0x2'));var express=require(_0x67f7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x67f7('0x4'));var interaction=require(_0x67f7('0x5'));var config=require(_0x67f7('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x67f7('0x7')]('/',auth['isAuthenticated'](),controller[_0x67f7('0x8')]);router['get']('/:id',auth[_0x67f7('0x9')](),controller[_0x67f7('0xa')]);router[_0x67f7('0x7')](_0x67f7('0xb'),auth[_0x67f7('0x9')](),controller[_0x67f7('0xc')]);router[_0x67f7('0x7')](_0x67f7('0xd'),auth[_0x67f7('0x9')](),controller['getSubjects']);router[_0x67f7('0x7')](_0x67f7('0xe'),auth[_0x67f7('0x9')](),controller[_0x67f7('0xf')]);router[_0x67f7('0x7')](_0x67f7('0x10'),auth[_0x67f7('0x9')](),controller[_0x67f7('0x11')]);router[_0x67f7('0x12')]('/',auth['isAuthenticated'](),controller[_0x67f7('0x13')]);router[_0x67f7('0x12')]('/:id/tags',auth[_0x67f7('0x9')](),controller[_0x67f7('0x14')]);router[_0x67f7('0x15')](_0x67f7('0x16'),auth[_0x67f7('0x9')](),controller[_0x67f7('0x17')]);router['delete'](_0x67f7('0x16'),auth[_0x67f7('0x9')](),controller[_0x67f7('0x18')]);module[_0x67f7('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index d01ee27..5422b93 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 _0x5c2f=['STRING','sequelize','exports'];(function(_0x27ecd0,_0x2cae63){var _0xd17f0f=function(_0x3e02e5){while(--_0x3e02e5){_0x27ecd0['push'](_0x27ecd0['shift']());}};_0xd17f0f(++_0x2cae63);}(_0x5c2f,0x19f));var _0xf5c2=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x5c2f[_0xe09d0];return _0x44ad05;};'use strict';var Sequelize=require(_0xf5c2('0x0'));module[_0xf5c2('0x1')]={'name':{'type':Sequelize[_0xf5c2('0x2')]},'description':{'type':Sequelize[_0xf5c2('0x2')]}}; \ No newline at end of file +var _0x6fa4=['sequelize','exports','STRING'];(function(_0x16d3e0,_0x187953){var _0x57f150=function(_0x5081cc){while(--_0x5081cc){_0x16d3e0['push'](_0x16d3e0['shift']());}};_0x57f150(++_0x187953);}(_0x6fa4,0xf3));var _0x46fa=function(_0x3b2f74,_0x2b843c){_0x3b2f74=_0x3b2f74-0x0;var _0x134bd8=_0x6fa4[_0x3b2f74];return _0x134bd8;};'use strict';var Sequelize=require(_0x46fa('0x0'));module[_0x46fa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x46fa('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e54168c..ea844f0 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 _0xddba=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','find','body','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5acc60,_0x43255e){var _0x3828ff=function(_0x21af7d){while(--_0x21af7d){_0x5acc60['push'](_0x5acc60['shift']());}};_0x3828ff(++_0x43255e);}(_0xddba,0xfa));var _0xaddb=function(_0x28d37a,_0x3884c7){_0x28d37a=_0x28d37a-0x0;var _0x46e5fe=_0xddba[_0x28d37a];return _0x46e5fe;};'use strict';var emlformat=require(_0xaddb('0x0'));var rimraf=require(_0xaddb('0x1'));var zipdir=require(_0xaddb('0x2'));var jsonpatch=require(_0xaddb('0x3'));var rp=require(_0xaddb('0x4'));var moment=require('moment');var BPromise=require(_0xaddb('0x5'));var Mustache=require(_0xaddb('0x6'));var util=require(_0xaddb('0x7'));var path=require(_0xaddb('0x8'));var sox=require(_0xaddb('0x9'));var csv=require(_0xaddb('0xa'));var ejs=require(_0xaddb('0xb'));var fs=require('fs');var fs_extra=require(_0xaddb('0xc'));var _=require(_0xaddb('0xd'));var squel=require(_0xaddb('0xe'));var crypto=require(_0xaddb('0xf'));var jsforce=require(_0xaddb('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xaddb('0xa'));var querystring=require(_0xaddb('0x11'));var Papa=require(_0xaddb('0x12'));var Redis=require(_0xaddb('0x13'));var authService=require(_0xaddb('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaddb('0x15'))(_0xaddb('0x16'));var utils=require(_0xaddb('0x17'));var config=require(_0xaddb('0x18'));var licenseUtil=require(_0xaddb('0x19'));var db=require(_0xaddb('0x1a'))['db'];function respondWithStatusCode(_0x45b18f,_0x253392){_0x253392=_0x253392||0xcc;return function(_0x3b849d){if(_0x3b849d){return _0x45b18f[_0xaddb('0x1b')](_0x253392);}return _0x45b18f[_0xaddb('0x1c')](_0x253392)[_0xaddb('0x1d')]();};}function respondWithResult(_0x466c63,_0x515084){_0x515084=_0x515084||0xc8;return function(_0x2b38c4){if(_0x2b38c4){return _0x466c63[_0xaddb('0x1c')](_0x515084)['json'](_0x2b38c4);}};}function respondWithFilteredResult(_0x14b3ef,_0x511d9e){return function(_0x4da53d){if(_0x4da53d){var _0x3e3254=typeof _0x511d9e[_0xaddb('0x1e')]==='undefined'&&typeof _0x511d9e['limit']===_0xaddb('0x1f');var _0x2b18a0=_0x4da53d[_0xaddb('0x20')];var _0x26a647=_0x3e3254?0x0:_0x511d9e[_0xaddb('0x1e')];var _0x54484c=_0x3e3254?_0x4da53d[_0xaddb('0x20')]:_0x511d9e[_0xaddb('0x1e')]+_0x511d9e[_0xaddb('0x21')];var _0x4ac325;if(_0x54484c>=_0x2b18a0){_0x54484c=_0x2b18a0;_0x4ac325=0xc8;}else{_0x4ac325=0xce;}_0x14b3ef['status'](_0x4ac325);return _0x14b3ef[_0xaddb('0x22')](_0xaddb('0x23'),_0x26a647+'-'+_0x54484c+'/'+_0x2b18a0)[_0xaddb('0x24')](_0x4da53d);}return null;};}function patchUpdates(_0x4b22cd){return function(_0x4e3e6a){try{jsonpatch[_0xaddb('0x25')](_0x4e3e6a,_0x4b22cd,!![]);}catch(_0x4cce43){return BPromise[_0xaddb('0x26')](_0x4cce43);}return _0x4e3e6a[_0xaddb('0x27')]();};}function saveUpdates(_0x6b874e,_0x32d5d8){return function(_0x13182a){if(_0x13182a){return _0x13182a[_0xaddb('0x28')](_0x6b874e)[_0xaddb('0x29')](function(_0x56610b){return _0x56610b;});}return null;};}function removeEntity(_0x14bbd9,_0x116940){return function(_0x4ee6fc){if(_0x4ee6fc){return _0x4ee6fc[_0xaddb('0x2a')]()[_0xaddb('0x29')](function(){_0x14bbd9[_0xaddb('0x1c')](0xcc)[_0xaddb('0x1d')]();});}};}function handleEntityNotFound(_0xf145a2,_0x25c968){return function(_0x43cd57){if(!_0x43cd57){_0xf145a2[_0xaddb('0x1b')](0x194);}return _0x43cd57;};}function handleError(_0x1c2f89,_0x24dd96){_0x24dd96=_0x24dd96||0x1f4;return function(_0x2a591a){logger[_0xaddb('0x2b')](_0x2a591a[_0xaddb('0x2c')]);if(_0x2a591a[_0xaddb('0x2d')]){delete _0x2a591a[_0xaddb('0x2d')];}_0x1c2f89[_0xaddb('0x1c')](_0x24dd96)[_0xaddb('0x2e')](_0x2a591a);};}exports[_0xaddb('0x2f')]=function(_0x541122,_0x299cc5){var _0x2cf7ed={},_0x329f06={},_0x43ff0c={'count':0x0,'rows':[]};var _0x235e75=_['map'](db[_0xaddb('0x30')][_0xaddb('0x31')],function(_0x1081f4){return{'name':_0x1081f4['fieldName'],'type':_0x1081f4[_0xaddb('0x32')][_0xaddb('0x33')]};});_0x329f06['model']=_[_0xaddb('0x34')](_0x235e75,_0xaddb('0x2d'));_0x329f06[_0xaddb('0x35')]=_[_0xaddb('0x36')](_0x541122[_0xaddb('0x35')]);_0x329f06[_0xaddb('0x37')]=_[_0xaddb('0x38')](_0x329f06[_0xaddb('0x39')],_0x329f06[_0xaddb('0x35')]);_0x2cf7ed[_0xaddb('0x3a')]=_[_0xaddb('0x38')](_0x329f06[_0xaddb('0x39')],qs[_0xaddb('0x3b')](_0x541122[_0xaddb('0x35')][_0xaddb('0x3b')]));_0x2cf7ed[_0xaddb('0x3a')]=_0x2cf7ed[_0xaddb('0x3a')]['length']?_0x2cf7ed[_0xaddb('0x3a')]:_0x329f06['model'];if(!_0x541122[_0xaddb('0x35')][_0xaddb('0x3c')]('nolimit')){_0x2cf7ed[_0xaddb('0x21')]=qs[_0xaddb('0x21')](_0x541122[_0xaddb('0x35')]['limit']);_0x2cf7ed[_0xaddb('0x1e')]=qs[_0xaddb('0x1e')](_0x541122[_0xaddb('0x35')][_0xaddb('0x1e')]);}_0x2cf7ed[_0xaddb('0x3d')]=qs[_0xaddb('0x3e')](_0x541122[_0xaddb('0x35')][_0xaddb('0x3e')]);_0x2cf7ed[_0xaddb('0x3f')]=qs['filters'](_[_0xaddb('0x40')](_0x541122['query'],_0x329f06['filters']),_0x235e75);if(_0x541122['query'][_0xaddb('0x41')]){_0x2cf7ed['where']=_[_0xaddb('0x42')](_0x2cf7ed[_0xaddb('0x3f')],{'$or':_[_0xaddb('0x34')](_0x235e75,function(_0x20d65a){if(_0x20d65a[_0xaddb('0x32')]!==_0xaddb('0x43')){var _0x1e9bb9={};_0x1e9bb9[_0x20d65a[_0xaddb('0x2d')]]={'$like':'%'+_0x541122[_0xaddb('0x35')][_0xaddb('0x41')]+'%'};return _0x1e9bb9;}})});}_0x2cf7ed=_[_0xaddb('0x42')]({},_0x2cf7ed,_0x541122[_0xaddb('0x44')]);var _0x2ffa23={'where':_0x2cf7ed[_0xaddb('0x3f')]};return db[_0xaddb('0x30')][_0xaddb('0x20')](_0x2ffa23)[_0xaddb('0x29')](function(_0x3c03a5){_0x43ff0c[_0xaddb('0x20')]=_0x3c03a5;if(_0x541122[_0xaddb('0x35')][_0xaddb('0x45')]){_0x2cf7ed['include']=[{'all':!![]}];}return db[_0xaddb('0x30')]['findAll'](_0x2cf7ed);})[_0xaddb('0x29')](function(_0x456c53){_0x43ff0c[_0xaddb('0x46')]=_0x456c53;return _0x43ff0c;})[_0xaddb('0x29')](respondWithFilteredResult(_0x299cc5,_0x2cf7ed))[_0xaddb('0x47')](handleError(_0x299cc5,null));};exports[_0xaddb('0x48')]=function(_0x5ccc95,_0x344719){var _0x538421={'raw':![],'where':{'id':_0x5ccc95[_0xaddb('0x49')]['id']}},_0x4dd790={};_0x4dd790[_0xaddb('0x39')]=_[_0xaddb('0x36')](db[_0xaddb('0x30')][_0xaddb('0x31')]);_0x4dd790[_0xaddb('0x35')]=_[_0xaddb('0x36')](_0x5ccc95[_0xaddb('0x35')]);_0x4dd790[_0xaddb('0x37')]=_['intersection'](_0x4dd790[_0xaddb('0x39')],_0x4dd790['query']);_0x538421[_0xaddb('0x3a')]=_[_0xaddb('0x38')](_0x4dd790[_0xaddb('0x39')],qs[_0xaddb('0x3b')](_0x5ccc95[_0xaddb('0x35')][_0xaddb('0x3b')]));_0x538421[_0xaddb('0x3a')]=_0x538421['attributes'][_0xaddb('0x4a')]?_0x538421[_0xaddb('0x3a')]:_0x4dd790[_0xaddb('0x39')];if(_0x5ccc95[_0xaddb('0x35')][_0xaddb('0x45')]){_0x538421[_0xaddb('0x4b')]=[{'all':!![]}];}_0x538421=_[_0xaddb('0x42')]({},_0x538421,_0x5ccc95[_0xaddb('0x44')]);return db[_0xaddb('0x30')][_0xaddb('0x4c')](_0x538421)['then'](handleEntityNotFound(_0x344719,null))[_0xaddb('0x29')](respondWithResult(_0x344719,null))['catch'](handleError(_0x344719,null));};exports['create']=function(_0x3bca4f,_0x2b983a){return db[_0xaddb('0x30')]['create'](_0x3bca4f['body'],{})[_0xaddb('0x29')](respondWithResult(_0x2b983a,0xc9))['catch'](handleError(_0x2b983a,null));};exports[_0xaddb('0x28')]=function(_0x1fc680,_0x5aa857){if(_0x1fc680[_0xaddb('0x4d')]['id']){delete _0x1fc680[_0xaddb('0x4d')]['id'];}return db[_0xaddb('0x30')][_0xaddb('0x4c')]({'where':{'id':_0x1fc680[_0xaddb('0x49')]['id']}})['then'](handleEntityNotFound(_0x5aa857,null))[_0xaddb('0x29')](saveUpdates(_0x1fc680[_0xaddb('0x4d')],null))[_0xaddb('0x29')](respondWithResult(_0x5aa857,null))[_0xaddb('0x47')](handleError(_0x5aa857,null));};exports[_0xaddb('0x2a')]=function(_0x107f06,_0x2d3f91){return db['FreshdeskConfiguration'][_0xaddb('0x4c')]({'where':{'id':_0x107f06[_0xaddb('0x49')]['id']}})[_0xaddb('0x29')](handleEntityNotFound(_0x2d3f91,null))['then'](removeEntity(_0x2d3f91,null))[_0xaddb('0x47')](handleError(_0x2d3f91,null));};exports[_0xaddb('0x4e')]=function(_0x4043e8,_0x502146,_0x589326){var _0x21e5e0={};var _0x264dfb={};var _0x52675a;var _0x187312;return db[_0xaddb('0x30')][_0xaddb('0x4f')]({'where':{'id':_0x4043e8[_0xaddb('0x49')]['id']}})[_0xaddb('0x29')](handleEntityNotFound(_0x502146,null))['then'](function(_0x92c493){if(_0x92c493){_0x52675a=_0x92c493;_0x264dfb['model']=_[_0xaddb('0x36')](db[_0xaddb('0x50')][_0xaddb('0x31')]);_0x264dfb[_0xaddb('0x35')]=_['keys'](_0x4043e8['query']);_0x264dfb[_0xaddb('0x37')]=_[_0xaddb('0x38')](_0x264dfb[_0xaddb('0x39')],_0x264dfb['query']);_0x21e5e0[_0xaddb('0x3a')]=_[_0xaddb('0x38')](_0x264dfb[_0xaddb('0x39')],qs[_0xaddb('0x3b')](_0x4043e8[_0xaddb('0x35')][_0xaddb('0x3b')]));_0x21e5e0['attributes']=_0x21e5e0[_0xaddb('0x3a')][_0xaddb('0x4a')]?_0x21e5e0[_0xaddb('0x3a')]:_0x264dfb[_0xaddb('0x39')];_0x21e5e0[_0xaddb('0x3d')]=qs['sort'](_0x4043e8[_0xaddb('0x35')][_0xaddb('0x3e')]);_0x21e5e0[_0xaddb('0x3f')]=qs[_0xaddb('0x37')](_[_0xaddb('0x40')](_0x4043e8[_0xaddb('0x35')],_0x264dfb[_0xaddb('0x37')]));if(_0x4043e8[_0xaddb('0x35')][_0xaddb('0x41')]){_0x21e5e0[_0xaddb('0x3f')]=_[_0xaddb('0x42')](_0x21e5e0['where'],{'$or':_['map'](_0x21e5e0[_0xaddb('0x3a')],function(_0x12218a){var _0x5210ae={};_0x5210ae[_0x12218a]={'$like':'%'+_0x4043e8['query']['filter']+'%'};return _0x5210ae;})});}_0x21e5e0=_[_0xaddb('0x42')]({},_0x21e5e0,_0x4043e8[_0xaddb('0x44')]);return _0x52675a[_0xaddb('0x4e')](_0x21e5e0);}})['then'](function(_0x407735){if(_0x407735){_0x187312=_0x407735[_0xaddb('0x4a')];if(!_0x4043e8[_0xaddb('0x35')][_0xaddb('0x3c')](_0xaddb('0x51'))){_0x21e5e0[_0xaddb('0x21')]=qs[_0xaddb('0x21')](_0x4043e8[_0xaddb('0x35')][_0xaddb('0x21')]);_0x21e5e0[_0xaddb('0x1e')]=qs['offset'](_0x4043e8[_0xaddb('0x35')][_0xaddb('0x1e')]);}return _0x52675a[_0xaddb('0x4e')](_0x21e5e0);}})[_0xaddb('0x29')](function(_0x678296){if(_0x678296){return _0x678296?{'count':_0x187312,'rows':_0x678296}:null;}})[_0xaddb('0x29')](respondWithResult(_0x502146,null))[_0xaddb('0x47')](handleError(_0x502146,null));};exports[_0xaddb('0x52')]=function(_0x3f1a4b,_0x55b600,_0x4fa2fc){var _0x10763c={};var _0x414d49={};var _0xcaa9b0;var _0x46eed5;return db[_0xaddb('0x30')][_0xaddb('0x4f')]({'where':{'id':_0x3f1a4b[_0xaddb('0x49')]['id']}})[_0xaddb('0x29')](handleEntityNotFound(_0x55b600,null))['then'](function(_0x2f4ce9){if(_0x2f4ce9){_0xcaa9b0=_0x2f4ce9;_0x414d49[_0xaddb('0x39')]=_['keys'](db[_0xaddb('0x50')][_0xaddb('0x31')]);_0x414d49[_0xaddb('0x35')]=_[_0xaddb('0x36')](_0x3f1a4b[_0xaddb('0x35')]);_0x414d49[_0xaddb('0x37')]=_[_0xaddb('0x38')](_0x414d49[_0xaddb('0x39')],_0x414d49[_0xaddb('0x35')]);_0x10763c[_0xaddb('0x3a')]=_['intersection'](_0x414d49[_0xaddb('0x39')],qs[_0xaddb('0x3b')](_0x3f1a4b['query'][_0xaddb('0x3b')]));_0x10763c[_0xaddb('0x3a')]=_0x10763c[_0xaddb('0x3a')][_0xaddb('0x4a')]?_0x10763c[_0xaddb('0x3a')]:_0x414d49['model'];_0x10763c[_0xaddb('0x3d')]=qs[_0xaddb('0x3e')](_0x3f1a4b[_0xaddb('0x35')]['sort']);_0x10763c[_0xaddb('0x3f')]=qs[_0xaddb('0x37')](_[_0xaddb('0x40')](_0x3f1a4b[_0xaddb('0x35')],_0x414d49[_0xaddb('0x37')]));if(_0x3f1a4b[_0xaddb('0x35')]['filter']){_0x10763c[_0xaddb('0x3f')]=_['merge'](_0x10763c[_0xaddb('0x3f')],{'$or':_[_0xaddb('0x34')](_0x10763c[_0xaddb('0x3a')],function(_0x72e533){var _0x4cffd5={};_0x4cffd5[_0x72e533]={'$like':'%'+_0x3f1a4b[_0xaddb('0x35')][_0xaddb('0x41')]+'%'};return _0x4cffd5;})});}_0x10763c=_[_0xaddb('0x42')]({},_0x10763c,_0x3f1a4b[_0xaddb('0x44')]);return _0xcaa9b0[_0xaddb('0x52')](_0x10763c);}})[_0xaddb('0x29')](function(_0x3c54d6){if(_0x3c54d6){_0x46eed5=_0x3c54d6[_0xaddb('0x4a')];if(!_0x3f1a4b['query'][_0xaddb('0x3c')](_0xaddb('0x51'))){_0x10763c[_0xaddb('0x21')]=qs[_0xaddb('0x21')](_0x3f1a4b[_0xaddb('0x35')][_0xaddb('0x21')]);_0x10763c[_0xaddb('0x1e')]=qs[_0xaddb('0x1e')](_0x3f1a4b[_0xaddb('0x35')][_0xaddb('0x1e')]);}return _0xcaa9b0['getSubjects'](_0x10763c);}})[_0xaddb('0x29')](function(_0x50970f){if(_0x50970f){return _0x50970f?{'count':_0x46eed5,'rows':_0x50970f}:null;}})[_0xaddb('0x29')](respondWithResult(_0x55b600,null))[_0xaddb('0x47')](handleError(_0x55b600,null));};exports[_0xaddb('0x53')]=function(_0x1dfead,_0x3ec965,_0x52bc6c){var _0x3573b1={};var _0x35c6b8={};var _0x472b6d;var _0x5a6345;return db[_0xaddb('0x30')][_0xaddb('0x4f')]({'where':{'id':_0x1dfead[_0xaddb('0x49')]['id']}})[_0xaddb('0x29')](handleEntityNotFound(_0x3ec965,null))[_0xaddb('0x29')](function(_0x566010){if(_0x566010){_0x472b6d=_0x566010;_0x35c6b8[_0xaddb('0x39')]=_[_0xaddb('0x36')](db[_0xaddb('0x50')][_0xaddb('0x31')]);_0x35c6b8[_0xaddb('0x35')]=_[_0xaddb('0x36')](_0x1dfead[_0xaddb('0x35')]);_0x35c6b8[_0xaddb('0x37')]=_['intersection'](_0x35c6b8[_0xaddb('0x39')],_0x35c6b8[_0xaddb('0x35')]);_0x3573b1['attributes']=_['intersection'](_0x35c6b8['model'],qs[_0xaddb('0x3b')](_0x1dfead[_0xaddb('0x35')][_0xaddb('0x3b')]));_0x3573b1[_0xaddb('0x3a')]=_0x3573b1[_0xaddb('0x3a')][_0xaddb('0x4a')]?_0x3573b1[_0xaddb('0x3a')]:_0x35c6b8['model'];_0x3573b1[_0xaddb('0x3d')]=qs[_0xaddb('0x3e')](_0x1dfead[_0xaddb('0x35')][_0xaddb('0x3e')]);_0x3573b1[_0xaddb('0x3f')]=qs[_0xaddb('0x37')](_['pick'](_0x1dfead[_0xaddb('0x35')],_0x35c6b8[_0xaddb('0x37')]));if(_0x1dfead[_0xaddb('0x35')]['filter']){_0x3573b1[_0xaddb('0x3f')]=_[_0xaddb('0x42')](_0x3573b1[_0xaddb('0x3f')],{'$or':_['map'](_0x3573b1[_0xaddb('0x3a')],function(_0x567ed3){var _0x54face={};_0x54face[_0x567ed3]={'$like':'%'+_0x1dfead['query'][_0xaddb('0x41')]+'%'};return _0x54face;})});}_0x3573b1=_['merge']({},_0x3573b1,_0x1dfead[_0xaddb('0x44')]);return _0x472b6d['getDescriptions'](_0x3573b1);}})['then'](function(_0x3f5213){if(_0x3f5213){_0x5a6345=_0x3f5213[_0xaddb('0x4a')];if(!_0x1dfead['query'][_0xaddb('0x3c')](_0xaddb('0x51'))){_0x3573b1[_0xaddb('0x21')]=qs[_0xaddb('0x21')](_0x1dfead[_0xaddb('0x35')][_0xaddb('0x21')]);_0x3573b1[_0xaddb('0x1e')]=qs['offset'](_0x1dfead[_0xaddb('0x35')][_0xaddb('0x1e')]);}return _0x472b6d[_0xaddb('0x53')](_0x3573b1);}})[_0xaddb('0x29')](function(_0x1b9ac8){if(_0x1b9ac8){return _0x1b9ac8?{'count':_0x5a6345,'rows':_0x1b9ac8}:null;}})[_0xaddb('0x29')](respondWithResult(_0x3ec965,null))[_0xaddb('0x47')](handleError(_0x3ec965,null));};exports['getTags']=function(_0xbe8a27,_0x441418,_0x5ab840){var _0x2f295={};var _0x3f0e24={};var _0x58c2f6;var _0x22220d;return db['FreshdeskConfiguration'][_0xaddb('0x4f')]({'where':{'id':_0xbe8a27[_0xaddb('0x49')]['id']}})['then'](handleEntityNotFound(_0x441418,null))[_0xaddb('0x29')](function(_0x5c2f72){if(_0x5c2f72){_0x58c2f6=_0x5c2f72;_0x3f0e24[_0xaddb('0x39')]=_[_0xaddb('0x36')](db[_0xaddb('0x54')][_0xaddb('0x31')]);_0x3f0e24[_0xaddb('0x35')]=_[_0xaddb('0x36')](_0xbe8a27[_0xaddb('0x35')]);_0x3f0e24[_0xaddb('0x37')]=_['intersection'](_0x3f0e24['model'],_0x3f0e24['query']);_0x2f295[_0xaddb('0x3a')]=_[_0xaddb('0x38')](_0x3f0e24[_0xaddb('0x39')],qs['fields'](_0xbe8a27[_0xaddb('0x35')][_0xaddb('0x3b')]));_0x2f295[_0xaddb('0x3a')]=_0x2f295[_0xaddb('0x3a')][_0xaddb('0x4a')]?_0x2f295['attributes']:_0x3f0e24[_0xaddb('0x39')];_0x2f295[_0xaddb('0x3d')]=qs[_0xaddb('0x3e')](_0xbe8a27['query'][_0xaddb('0x3e')]);_0x2f295[_0xaddb('0x3f')]=qs[_0xaddb('0x37')](_[_0xaddb('0x40')](_0xbe8a27[_0xaddb('0x35')],_0x3f0e24[_0xaddb('0x37')]));if(_0xbe8a27[_0xaddb('0x35')][_0xaddb('0x41')]){_0x2f295[_0xaddb('0x3f')]=_[_0xaddb('0x42')](_0x2f295[_0xaddb('0x3f')],{'$or':_[_0xaddb('0x34')](_0x2f295[_0xaddb('0x3a')],function(_0x45cf95){var _0x299b6b={};_0x299b6b[_0x45cf95]={'$like':'%'+_0xbe8a27[_0xaddb('0x35')][_0xaddb('0x41')]+'%'};return _0x299b6b;})});}_0x2f295=_[_0xaddb('0x42')]({},_0x2f295,_0xbe8a27[_0xaddb('0x44')]);return _0x58c2f6[_0xaddb('0x55')](_0x2f295);}})[_0xaddb('0x29')](function(_0x383703){if(_0x383703){_0x22220d=_0x383703[_0xaddb('0x4a')];if(!_0xbe8a27['query'][_0xaddb('0x3c')](_0xaddb('0x51'))){_0x2f295[_0xaddb('0x21')]=qs[_0xaddb('0x21')](_0xbe8a27[_0xaddb('0x35')][_0xaddb('0x21')]);_0x2f295[_0xaddb('0x1e')]=qs[_0xaddb('0x1e')](_0xbe8a27['query'][_0xaddb('0x1e')]);}return _0x58c2f6[_0xaddb('0x55')](_0x2f295);}})[_0xaddb('0x29')](function(_0x449019){if(_0x449019){return _0x449019?{'count':_0x22220d,'rows':_0x449019}:null;}})[_0xaddb('0x29')](respondWithResult(_0x441418,null))[_0xaddb('0x47')](handleError(_0x441418,null));};exports[_0xaddb('0x56')]=function(_0x33cdf4,_0x8b6899,_0x3c5f97){if(_0x33cdf4[_0xaddb('0x4d')]['id']){delete _0x33cdf4['body']['id'];}return db[_0xaddb('0x30')]['findOne']({'where':{'id':_0x33cdf4[_0xaddb('0x49')]['id']}})['then'](handleEntityNotFound(_0x8b6899,null))[_0xaddb('0x29')](function(_0x4526d7){if(_0x4526d7){return _0x4526d7[_0xaddb('0x56')](_0x33cdf4[_0xaddb('0x4d')]['ids']||[]);}return null;})['then'](respondWithResult(_0x8b6899,null))['catch'](handleError(_0x8b6899,null));}; \ No newline at end of file +var _0x7a3c=['apply','reject','save','update','then','error','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','name','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','create','body','catch','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x7a3c,0x1e4));var _0xc7a3=function(_0x10a940,_0x2dbfbd){_0x10a940=_0x10a940-0x0;var _0x1959da=_0x7a3c[_0x10a940];return _0x1959da;};'use strict';var emlformat=require(_0xc7a3('0x0'));var rimraf=require(_0xc7a3('0x1'));var zipdir=require(_0xc7a3('0x2'));var jsonpatch=require(_0xc7a3('0x3'));var rp=require('request-promise');var moment=require(_0xc7a3('0x4'));var BPromise=require(_0xc7a3('0x5'));var Mustache=require(_0xc7a3('0x6'));var util=require(_0xc7a3('0x7'));var path=require(_0xc7a3('0x8'));var sox=require(_0xc7a3('0x9'));var csv=require('to-csv');var ejs=require(_0xc7a3('0xa'));var fs=require('fs');var fs_extra=require(_0xc7a3('0xb'));var _=require(_0xc7a3('0xc'));var squel=require(_0xc7a3('0xd'));var crypto=require(_0xc7a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc7a3('0xf'));var querystring=require(_0xc7a3('0x10'));var Papa=require(_0xc7a3('0x11'));var Redis=require(_0xc7a3('0x12'));var authService=require(_0xc7a3('0x13'));var qs=require(_0xc7a3('0x14'));var as=require(_0xc7a3('0x15'));var hardwareService=require(_0xc7a3('0x16'));var logger=require('../../config/logger')(_0xc7a3('0x17'));var utils=require(_0xc7a3('0x18'));var config=require(_0xc7a3('0x19'));var licenseUtil=require(_0xc7a3('0x1a'));var db=require(_0xc7a3('0x1b'))['db'];function respondWithStatusCode(_0x358430,_0x4dac71){_0x4dac71=_0x4dac71||0xcc;return function(_0x1c0ffb){if(_0x1c0ffb){return _0x358430[_0xc7a3('0x1c')](_0x4dac71);}return _0x358430['status'](_0x4dac71)[_0xc7a3('0x1d')]();};}function respondWithResult(_0x2b53b4,_0xc4b62c){_0xc4b62c=_0xc4b62c||0xc8;return function(_0x1c1882){if(_0x1c1882){return _0x2b53b4[_0xc7a3('0x1e')](_0xc4b62c)[_0xc7a3('0x1f')](_0x1c1882);}};}function respondWithFilteredResult(_0x51b455,_0x1538e2){return function(_0x3306ce){if(_0x3306ce){var _0x68ef06=typeof _0x1538e2['offset']===_0xc7a3('0x20')&&typeof _0x1538e2[_0xc7a3('0x21')]===_0xc7a3('0x20');var _0x5d090a=_0x3306ce['count'];var _0x502895=_0x68ef06?0x0:_0x1538e2[_0xc7a3('0x22')];var _0x3acae4=_0x68ef06?_0x3306ce[_0xc7a3('0x23')]:_0x1538e2[_0xc7a3('0x22')]+_0x1538e2[_0xc7a3('0x21')];var _0x5c1a92;if(_0x3acae4>=_0x5d090a){_0x3acae4=_0x5d090a;_0x5c1a92=0xc8;}else{_0x5c1a92=0xce;}_0x51b455['status'](_0x5c1a92);return _0x51b455[_0xc7a3('0x24')](_0xc7a3('0x25'),_0x502895+'-'+_0x3acae4+'/'+_0x5d090a)[_0xc7a3('0x1f')](_0x3306ce);}return null;};}function patchUpdates(_0x214ba2){return function(_0x730769){try{jsonpatch[_0xc7a3('0x26')](_0x730769,_0x214ba2,!![]);}catch(_0x262ef9){return BPromise[_0xc7a3('0x27')](_0x262ef9);}return _0x730769[_0xc7a3('0x28')]();};}function saveUpdates(_0x48c6a2,_0x5718a8){return function(_0x36a846){if(_0x36a846){return _0x36a846[_0xc7a3('0x29')](_0x48c6a2)[_0xc7a3('0x2a')](function(_0x3b3ea0){return _0x3b3ea0;});}return null;};}function removeEntity(_0x235c59,_0x2f4112){return function(_0xc0b5c){if(_0xc0b5c){return _0xc0b5c['destroy']()['then'](function(){_0x235c59[_0xc7a3('0x1e')](0xcc)[_0xc7a3('0x1d')]();});}};}function handleEntityNotFound(_0x5d1c2a,_0x1dd1a3){return function(_0x22a713){if(!_0x22a713){_0x5d1c2a['sendStatus'](0x194);}return _0x22a713;};}function handleError(_0x264617,_0x3cb92f){_0x3cb92f=_0x3cb92f||0x1f4;return function(_0x49a27a){logger[_0xc7a3('0x2b')](_0x49a27a['stack']);if(_0x49a27a['name']){delete _0x49a27a['name'];}_0x264617[_0xc7a3('0x1e')](_0x3cb92f)[_0xc7a3('0x2c')](_0x49a27a);};}exports[_0xc7a3('0x2d')]=function(_0x508dcc,_0xb99941){var _0x3b40f4={},_0x3ddb18={},_0x1dbfc7={'count':0x0,'rows':[]};var _0x1622df=_[_0xc7a3('0x2e')](db[_0xc7a3('0x2f')][_0xc7a3('0x30')],function(_0x4cf586){return{'name':_0x4cf586[_0xc7a3('0x31')],'type':_0x4cf586[_0xc7a3('0x32')][_0xc7a3('0x33')]};});_0x3ddb18['model']=_[_0xc7a3('0x2e')](_0x1622df,_0xc7a3('0x34'));_0x3ddb18['query']=_[_0xc7a3('0x35')](_0x508dcc['query']);_0x3ddb18[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x3ddb18[_0xc7a3('0x38')],_0x3ddb18['query']);_0x3b40f4[_0xc7a3('0x39')]=_[_0xc7a3('0x37')](_0x3ddb18[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x3b40f4[_0xc7a3('0x39')]=_0x3b40f4[_0xc7a3('0x39')][_0xc7a3('0x3c')]?_0x3b40f4[_0xc7a3('0x39')]:_0x3ddb18[_0xc7a3('0x38')];if(!_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x3d')](_0xc7a3('0x3e'))){_0x3b40f4[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x21')]);_0x3b40f4[_0xc7a3('0x22')]=qs['offset'](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x22')]);}_0x3b40f4[_0xc7a3('0x3f')]=qs[_0xc7a3('0x40')](_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0x3b40f4[_0xc7a3('0x41')]=qs['filters'](_[_0xc7a3('0x42')](_0x508dcc['query'],_0x3ddb18['filters']),_0x1622df);if(_0x508dcc[_0xc7a3('0x3b')]['filter']){_0x3b40f4[_0xc7a3('0x41')]=_['merge'](_0x3b40f4[_0xc7a3('0x41')],{'$or':_['map'](_0x1622df,function(_0x101866){if(_0x101866['type']!==_0xc7a3('0x43')){var _0x5e41e3={};_0x5e41e3[_0x101866['name']]={'$like':'%'+_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x5e41e3;}})});}_0x3b40f4=_[_0xc7a3('0x45')]({},_0x3b40f4,_0x508dcc[_0xc7a3('0x46')]);var _0x4f0e24={'where':_0x3b40f4[_0xc7a3('0x41')]};return db[_0xc7a3('0x2f')][_0xc7a3('0x23')](_0x4f0e24)[_0xc7a3('0x2a')](function(_0x1b34eb){_0x1dbfc7[_0xc7a3('0x23')]=_0x1b34eb;if(_0x508dcc[_0xc7a3('0x3b')][_0xc7a3('0x47')]){_0x3b40f4[_0xc7a3('0x48')]=[{'all':!![]}];}return db[_0xc7a3('0x2f')][_0xc7a3('0x49')](_0x3b40f4);})['then'](function(_0x11f7d7){_0x1dbfc7[_0xc7a3('0x4a')]=_0x11f7d7;return _0x1dbfc7;})[_0xc7a3('0x2a')](respondWithFilteredResult(_0xb99941,_0x3b40f4))['catch'](handleError(_0xb99941,null));};exports['show']=function(_0x2113d5,_0x12329e){var _0x55c750={'raw':![],'where':{'id':_0x2113d5[_0xc7a3('0x4b')]['id']}},_0x1159ac={};_0x1159ac[_0xc7a3('0x38')]=_['keys'](db[_0xc7a3('0x2f')][_0xc7a3('0x30')]);_0x1159ac[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x2113d5['query']);_0x1159ac['filters']=_['intersection'](_0x1159ac[_0xc7a3('0x38')],_0x1159ac['query']);_0x55c750['attributes']=_['intersection'](_0x1159ac[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x2113d5[_0xc7a3('0x3b')]['fields']));_0x55c750['attributes']=_0x55c750['attributes'][_0xc7a3('0x3c')]?_0x55c750[_0xc7a3('0x39')]:_0x1159ac[_0xc7a3('0x38')];if(_0x2113d5[_0xc7a3('0x3b')][_0xc7a3('0x47')]){_0x55c750[_0xc7a3('0x48')]=[{'all':!![]}];}_0x55c750=_[_0xc7a3('0x45')]({},_0x55c750,_0x2113d5[_0xc7a3('0x46')]);return db[_0xc7a3('0x2f')][_0xc7a3('0x4c')](_0x55c750)[_0xc7a3('0x2a')](handleEntityNotFound(_0x12329e,null))[_0xc7a3('0x2a')](respondWithResult(_0x12329e,null))['catch'](handleError(_0x12329e,null));};exports[_0xc7a3('0x4d')]=function(_0x8f1ba9,_0x30cfd7){return db[_0xc7a3('0x2f')][_0xc7a3('0x4d')](_0x8f1ba9['body'],{})['then'](respondWithResult(_0x30cfd7,0xc9))['catch'](handleError(_0x30cfd7,null));};exports[_0xc7a3('0x29')]=function(_0x136202,_0x270119){if(_0x136202['body']['id']){delete _0x136202[_0xc7a3('0x4e')]['id'];}return db['FreshdeskConfiguration'][_0xc7a3('0x4c')]({'where':{'id':_0x136202[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x270119,null))[_0xc7a3('0x2a')](saveUpdates(_0x136202[_0xc7a3('0x4e')],null))[_0xc7a3('0x2a')](respondWithResult(_0x270119,null))[_0xc7a3('0x4f')](handleError(_0x270119,null));};exports['destroy']=function(_0x52cb18,_0x4ec5f1){return db[_0xc7a3('0x2f')]['find']({'where':{'id':_0x52cb18[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x4ec5f1,null))[_0xc7a3('0x2a')](removeEntity(_0x4ec5f1,null))[_0xc7a3('0x4f')](handleError(_0x4ec5f1,null));};exports[_0xc7a3('0x50')]=function(_0x10f572,_0x50f4b7,_0x39a5e8){var _0xd7db3d={};var _0x1cdefc={};var _0x3c3755;var _0x6a0ff;return db[_0xc7a3('0x2f')][_0xc7a3('0x51')]({'where':{'id':_0x10f572['params']['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x50f4b7,null))[_0xc7a3('0x2a')](function(_0x521186){if(_0x521186){_0x3c3755=_0x521186;_0x1cdefc[_0xc7a3('0x38')]=_[_0xc7a3('0x35')](db[_0xc7a3('0x52')]['rawAttributes']);_0x1cdefc[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x10f572[_0xc7a3('0x3b')]);_0x1cdefc[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x1cdefc['model'],_0x1cdefc[_0xc7a3('0x3b')]);_0xd7db3d[_0xc7a3('0x39')]=_['intersection'](_0x1cdefc['model'],qs[_0xc7a3('0x3a')](_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0xd7db3d[_0xc7a3('0x39')]=_0xd7db3d[_0xc7a3('0x39')][_0xc7a3('0x3c')]?_0xd7db3d['attributes']:_0x1cdefc['model'];_0xd7db3d[_0xc7a3('0x3f')]=qs[_0xc7a3('0x40')](_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0xd7db3d[_0xc7a3('0x41')]=qs[_0xc7a3('0x36')](_[_0xc7a3('0x42')](_0x10f572[_0xc7a3('0x3b')],_0x1cdefc[_0xc7a3('0x36')]));if(_0x10f572[_0xc7a3('0x3b')]['filter']){_0xd7db3d[_0xc7a3('0x41')]=_[_0xc7a3('0x45')](_0xd7db3d['where'],{'$or':_['map'](_0xd7db3d[_0xc7a3('0x39')],function(_0x40f468){var _0x1ff4c6={};_0x1ff4c6[_0x40f468]={'$like':'%'+_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x1ff4c6;})});}_0xd7db3d=_[_0xc7a3('0x45')]({},_0xd7db3d,_0x10f572[_0xc7a3('0x46')]);return _0x3c3755[_0xc7a3('0x50')](_0xd7db3d);}})[_0xc7a3('0x2a')](function(_0x40102d){if(_0x40102d){_0x6a0ff=_0x40102d['length'];if(!_0x10f572[_0xc7a3('0x3b')]['hasOwnProperty']('nolimit')){_0xd7db3d[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x10f572[_0xc7a3('0x3b')]['limit']);_0xd7db3d[_0xc7a3('0x22')]=qs['offset'](_0x10f572[_0xc7a3('0x3b')][_0xc7a3('0x22')]);}return _0x3c3755[_0xc7a3('0x50')](_0xd7db3d);}})['then'](function(_0x56e349){if(_0x56e349){return _0x56e349?{'count':_0x6a0ff,'rows':_0x56e349}:null;}})[_0xc7a3('0x2a')](respondWithResult(_0x50f4b7,null))[_0xc7a3('0x4f')](handleError(_0x50f4b7,null));};exports[_0xc7a3('0x53')]=function(_0x2b9d2c,_0x4b838d,_0x69bc48){var _0x344b16={};var _0x1b16f5={};var _0x1f791e;var _0x2d3365;return db[_0xc7a3('0x2f')][_0xc7a3('0x51')]({'where':{'id':_0x2b9d2c[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x4b838d,null))[_0xc7a3('0x2a')](function(_0x667a1f){if(_0x667a1f){_0x1f791e=_0x667a1f;_0x1b16f5['model']=_[_0xc7a3('0x35')](db[_0xc7a3('0x52')]['rawAttributes']);_0x1b16f5[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x2b9d2c['query']);_0x1b16f5[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x1b16f5[_0xc7a3('0x38')],_0x1b16f5[_0xc7a3('0x3b')]);_0x344b16[_0xc7a3('0x39')]=_[_0xc7a3('0x37')](_0x1b16f5[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x2b9d2c[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x344b16[_0xc7a3('0x39')]=_0x344b16[_0xc7a3('0x39')][_0xc7a3('0x3c')]?_0x344b16[_0xc7a3('0x39')]:_0x1b16f5[_0xc7a3('0x38')];_0x344b16[_0xc7a3('0x3f')]=qs[_0xc7a3('0x40')](_0x2b9d2c['query'][_0xc7a3('0x40')]);_0x344b16[_0xc7a3('0x41')]=qs[_0xc7a3('0x36')](_[_0xc7a3('0x42')](_0x2b9d2c[_0xc7a3('0x3b')],_0x1b16f5[_0xc7a3('0x36')]));if(_0x2b9d2c[_0xc7a3('0x3b')][_0xc7a3('0x44')]){_0x344b16[_0xc7a3('0x41')]=_[_0xc7a3('0x45')](_0x344b16[_0xc7a3('0x41')],{'$or':_[_0xc7a3('0x2e')](_0x344b16['attributes'],function(_0x4b9810){var _0x1ec80c={};_0x1ec80c[_0x4b9810]={'$like':'%'+_0x2b9d2c['query'][_0xc7a3('0x44')]+'%'};return _0x1ec80c;})});}_0x344b16=_[_0xc7a3('0x45')]({},_0x344b16,_0x2b9d2c[_0xc7a3('0x46')]);return _0x1f791e['getSubjects'](_0x344b16);}})[_0xc7a3('0x2a')](function(_0x108adf){if(_0x108adf){_0x2d3365=_0x108adf[_0xc7a3('0x3c')];if(!_0x2b9d2c[_0xc7a3('0x3b')][_0xc7a3('0x3d')](_0xc7a3('0x3e'))){_0x344b16[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x2b9d2c[_0xc7a3('0x3b')]['limit']);_0x344b16['offset']=qs[_0xc7a3('0x22')](_0x2b9d2c['query'][_0xc7a3('0x22')]);}return _0x1f791e[_0xc7a3('0x53')](_0x344b16);}})['then'](function(_0x552bfe){if(_0x552bfe){return _0x552bfe?{'count':_0x2d3365,'rows':_0x552bfe}:null;}})['then'](respondWithResult(_0x4b838d,null))[_0xc7a3('0x4f')](handleError(_0x4b838d,null));};exports[_0xc7a3('0x54')]=function(_0x480384,_0x3c4351,_0x38d7dd){var _0x422d69={};var _0x2863e3={};var _0x253044;var _0x11fa47;return db[_0xc7a3('0x2f')]['findOne']({'where':{'id':_0x480384[_0xc7a3('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c4351,null))[_0xc7a3('0x2a')](function(_0xf23184){if(_0xf23184){_0x253044=_0xf23184;_0x2863e3[_0xc7a3('0x38')]=_[_0xc7a3('0x35')](db[_0xc7a3('0x52')][_0xc7a3('0x30')]);_0x2863e3[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x480384['query']);_0x2863e3[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x2863e3[_0xc7a3('0x38')],_0x2863e3[_0xc7a3('0x3b')]);_0x422d69[_0xc7a3('0x39')]=_['intersection'](_0x2863e3[_0xc7a3('0x38')],qs[_0xc7a3('0x3a')](_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x422d69['attributes']=_0x422d69['attributes'][_0xc7a3('0x3c')]?_0x422d69['attributes']:_0x2863e3[_0xc7a3('0x38')];_0x422d69['order']=qs[_0xc7a3('0x40')](_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0x422d69[_0xc7a3('0x41')]=qs[_0xc7a3('0x36')](_[_0xc7a3('0x42')](_0x480384[_0xc7a3('0x3b')],_0x2863e3[_0xc7a3('0x36')]));if(_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x44')]){_0x422d69['where']=_[_0xc7a3('0x45')](_0x422d69[_0xc7a3('0x41')],{'$or':_[_0xc7a3('0x2e')](_0x422d69['attributes'],function(_0x24241f){var _0x40b832={};_0x40b832[_0x24241f]={'$like':'%'+_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x40b832;})});}_0x422d69=_['merge']({},_0x422d69,_0x480384[_0xc7a3('0x46')]);return _0x253044[_0xc7a3('0x54')](_0x422d69);}})[_0xc7a3('0x2a')](function(_0x4313e6){if(_0x4313e6){_0x11fa47=_0x4313e6[_0xc7a3('0x3c')];if(!_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x3d')]('nolimit')){_0x422d69[_0xc7a3('0x21')]=qs[_0xc7a3('0x21')](_0x480384[_0xc7a3('0x3b')][_0xc7a3('0x21')]);_0x422d69[_0xc7a3('0x22')]=qs['offset'](_0x480384['query']['offset']);}return _0x253044[_0xc7a3('0x54')](_0x422d69);}})[_0xc7a3('0x2a')](function(_0x4afabb){if(_0x4afabb){return _0x4afabb?{'count':_0x11fa47,'rows':_0x4afabb}:null;}})[_0xc7a3('0x2a')](respondWithResult(_0x3c4351,null))[_0xc7a3('0x4f')](handleError(_0x3c4351,null));};exports[_0xc7a3('0x55')]=function(_0x1b322b,_0x56fd31,_0x27d741){var _0x1563ee={};var _0x8a29ab={};var _0x3a8003;var _0x37e29f;return db['FreshdeskConfiguration'][_0xc7a3('0x51')]({'where':{'id':_0x1b322b[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x56fd31,null))[_0xc7a3('0x2a')](function(_0x5d4f16){if(_0x5d4f16){_0x3a8003=_0x5d4f16;_0x8a29ab['model']=_['keys'](db['Tag'][_0xc7a3('0x30')]);_0x8a29ab[_0xc7a3('0x3b')]=_[_0xc7a3('0x35')](_0x1b322b[_0xc7a3('0x3b')]);_0x8a29ab[_0xc7a3('0x36')]=_[_0xc7a3('0x37')](_0x8a29ab['model'],_0x8a29ab[_0xc7a3('0x3b')]);_0x1563ee['attributes']=_[_0xc7a3('0x37')](_0x8a29ab[_0xc7a3('0x38')],qs['fields'](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x3a')]));_0x1563ee['attributes']=_0x1563ee['attributes']['length']?_0x1563ee[_0xc7a3('0x39')]:_0x8a29ab[_0xc7a3('0x38')];_0x1563ee['order']=qs[_0xc7a3('0x40')](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x40')]);_0x1563ee['where']=qs['filters'](_['pick'](_0x1b322b['query'],_0x8a29ab[_0xc7a3('0x36')]));if(_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x44')]){_0x1563ee[_0xc7a3('0x41')]=_[_0xc7a3('0x45')](_0x1563ee[_0xc7a3('0x41')],{'$or':_[_0xc7a3('0x2e')](_0x1563ee[_0xc7a3('0x39')],function(_0x3129b6){var _0x405d30={};_0x405d30[_0x3129b6]={'$like':'%'+_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x44')]+'%'};return _0x405d30;})});}_0x1563ee=_[_0xc7a3('0x45')]({},_0x1563ee,_0x1b322b[_0xc7a3('0x46')]);return _0x3a8003['getTags'](_0x1563ee);}})[_0xc7a3('0x2a')](function(_0x1011db){if(_0x1011db){_0x37e29f=_0x1011db['length'];if(!_0x1b322b['query']['hasOwnProperty'](_0xc7a3('0x3e'))){_0x1563ee['limit']=qs[_0xc7a3('0x21')](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x21')]);_0x1563ee[_0xc7a3('0x22')]=qs[_0xc7a3('0x22')](_0x1b322b[_0xc7a3('0x3b')][_0xc7a3('0x22')]);}return _0x3a8003[_0xc7a3('0x55')](_0x1563ee);}})[_0xc7a3('0x2a')](function(_0x4470c4){if(_0x4470c4){return _0x4470c4?{'count':_0x37e29f,'rows':_0x4470c4}:null;}})[_0xc7a3('0x2a')](respondWithResult(_0x56fd31,null))['catch'](handleError(_0x56fd31,null));};exports['setTags']=function(_0x1723b2,_0x1cbd4a,_0x4b149a){if(_0x1723b2[_0xc7a3('0x4e')]['id']){delete _0x1723b2[_0xc7a3('0x4e')]['id'];}return db[_0xc7a3('0x2f')][_0xc7a3('0x51')]({'where':{'id':_0x1723b2[_0xc7a3('0x4b')]['id']}})[_0xc7a3('0x2a')](handleEntityNotFound(_0x1cbd4a,null))[_0xc7a3('0x2a')](function(_0x223d75){if(_0x223d75){return _0x223d75[_0xc7a3('0x56')](_0x1723b2['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x1cbd4a,null))['catch'](handleError(_0x1cbd4a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index b93f64a..3555336 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 _0x1f81=['bluebird','rimraf','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x320649,_0x3fd9d6){var _0x1602b5=function(_0x588e27){while(--_0x588e27){_0x320649['push'](_0x320649['shift']());}};_0x1602b5(++_0x3fd9d6);}(_0x1f81,0x1b4));var _0x11f8=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x1f81[_0x80d733];return _0x435868;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var logger=require(_0x11f8('0x2'))(_0x11f8('0x3'));var moment=require('moment');var BPromise=require(_0x11f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11f8('0x5'));var config=require(_0x11f8('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x53f540,_0x3e89a1){return _0x53f540[_0x11f8('0x7')](_0x11f8('0x8'),attributes,{'tableName':_0x11f8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7009=['int_freshdesk_configurations','util','../../config/logger','moment','bluebird','request-promise','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x7009,0x64));var _0x9700=function(_0x53a9cb,_0x1d7a73){_0x53a9cb=_0x53a9cb-0x0;var _0x4fc163=_0x7009[_0x53a9cb];return _0x4fc163;};'use strict';var _=require('lodash');var util=require(_0x9700('0x0'));var logger=require(_0x9700('0x1'))('api');var moment=require(_0x9700('0x2'));var BPromise=require(_0x9700('0x3'));var rp=require(_0x9700('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9700('0x5'));var config=require('../../config/environment');var attributes=require(_0x9700('0x6'));module[_0x9700('0x7')]=function(_0x2f16b3,_0x5f448e){return _0x2f16b3[_0x9700('0x8')](_0x9700('0x9'),attributes,{'tableName':_0x9700('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index e32cf78..c0ec7be 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 _0x5e1e=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash'];(function(_0x1bba6c,_0x1f94cf){var _0x415735=function(_0x3ef30d){while(--_0x3ef30d){_0x1bba6c['push'](_0x1bba6c['shift']());}};_0x415735(++_0x1f94cf);}(_0x5e1e,0x11d));var _0xe5e1=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x5e1e[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xe5e1('0x0'));var util=require(_0xe5e1('0x1'));var moment=require(_0xe5e1('0x2'));var BPromise=require(_0xe5e1('0x3'));var rs=require(_0xe5e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5e1('0x6'))(_0xe5e1('0x7'));var config=require(_0xe5e1('0x8'));var jayson=require(_0xe5e1('0x9'));var client=jayson[_0xe5e1('0xa')][_0xe5e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44cb46,_0x21d989,_0x2e447c){return new BPromise(function(_0x57bef3,_0x760e76){return client[_0xe5e1('0xc')](_0x44cb46,_0x2e447c)[_0xe5e1('0xd')](function(_0x1e87cf){logger[_0xe5e1('0xe')](_0xe5e1('0xf'),_0x21d989,'request\x20sent');logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x21d989,_0xe5e1('0x10'),JSON[_0xe5e1('0x11')](_0x1e87cf));if(_0x1e87cf['error']){if(_0x1e87cf[_0xe5e1('0x12')]['code']===0x1f4){logger[_0xe5e1('0x12')](_0xe5e1('0xf'),_0x21d989,_0x1e87cf[_0xe5e1('0x12')][_0xe5e1('0x13')]);return _0x760e76(_0x1e87cf['error'][_0xe5e1('0x13')]);}logger[_0xe5e1('0x12')](_0xe5e1('0xf'),_0x21d989,_0x1e87cf['error'][_0xe5e1('0x13')]);return _0x57bef3(_0x1e87cf[_0xe5e1('0x12')][_0xe5e1('0x13')]);}else{logger['info'](_0xe5e1('0xf'),_0x21d989,_0xe5e1('0x10'));_0x57bef3(_0x1e87cf[_0xe5e1('0x14')][_0xe5e1('0x13')]);}})[_0xe5e1('0x15')](function(_0x1e7635){logger[_0xe5e1('0x12')](_0xe5e1('0xf'),_0x21d989,_0x1e7635);_0x760e76(_0x1e7635);});});} \ No newline at end of file +var _0x22f5=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22f5,0x134));var _0x522f=function(_0x4040d3,_0x5624c8){_0x4040d3=_0x4040d3-0x0;var _0x3d2d2d=_0x22f5[_0x4040d3];return _0x3d2d2d;};'use strict';var _=require(_0x522f('0x0'));var util=require(_0x522f('0x1'));var moment=require(_0x522f('0x2'));var BPromise=require('bluebird');var rs=require(_0x522f('0x3'));var fs=require('fs');var Redis=require(_0x522f('0x4'));var db=require(_0x522f('0x5'))['db'];var utils=require(_0x522f('0x6'));var logger=require(_0x522f('0x7'))(_0x522f('0x8'));var config=require('../../config/environment');var jayson=require(_0x522f('0x9'));var client=jayson[_0x522f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229f0e,_0x2b2407,_0x32bed2){return new BPromise(function(_0x390dfc,_0x29f24d){return client[_0x522f('0xb')](_0x229f0e,_0x32bed2)[_0x522f('0xc')](function(_0x4ff064){logger[_0x522f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b2407,'request\x20sent');logger['debug'](_0x522f('0xe'),_0x2b2407,'request\x20sent',JSON[_0x522f('0xf')](_0x4ff064));if(_0x4ff064['error']){if(_0x4ff064[_0x522f('0x10')][_0x522f('0x11')]===0x1f4){logger[_0x522f('0x10')](_0x522f('0x12'),_0x2b2407,_0x4ff064['error'][_0x522f('0x13')]);return _0x29f24d(_0x4ff064[_0x522f('0x10')][_0x522f('0x13')]);}logger[_0x522f('0x10')](_0x522f('0x12'),_0x2b2407,_0x4ff064['error'][_0x522f('0x13')]);return _0x390dfc(_0x4ff064[_0x522f('0x10')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2b2407,_0x522f('0x14'));_0x390dfc(_0x4ff064[_0x522f('0x15')]['message']);}})[_0x522f('0x16')](function(_0x3bc52c){logger['error'](_0x522f('0x12'),_0x2b2407,_0x3bc52c);_0x29f24d(_0x3bc52c);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3cba7ed..242e754 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 _0xd82c=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0xd82c,0x1c2));var _0xcd82=function(_0x430166,_0x31530a){_0x430166=_0x430166-0x0;var _0x16fde5=_0xd82c[_0x430166];return _0x16fde5;};'use strict';var multer=require(_0xcd82('0x0'));var util=require(_0xcd82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcd82('0x2'));var router=express[_0xcd82('0x3')]();var fs_extra=require(_0xcd82('0x4'));var auth=require(_0xcd82('0x5'));var interaction=require(_0xcd82('0x6'));var config=require(_0xcd82('0x7'));var controller=require(_0xcd82('0x8'));router['get']('/',auth[_0xcd82('0x9')](),controller[_0xcd82('0xa')]);router[_0xcd82('0xb')]('/:id',auth[_0xcd82('0x9')](),controller[_0xcd82('0xc')]);router[_0xcd82('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcd82('0xe')](_0xcd82('0xf'),auth[_0xcd82('0x9')](),controller[_0xcd82('0x10')]);router[_0xcd82('0x11')](_0xcd82('0xf'),auth[_0xcd82('0x9')](),controller[_0xcd82('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9e7a=['Router','fs-extra','./intFreshdeskField.controller','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x374b7f,_0x419e36){var _0x20f2a4=function(_0x5bc66f){while(--_0x5bc66f){_0x374b7f['push'](_0x374b7f['shift']());}};_0x20f2a4(++_0x419e36);}(_0x9e7a,0xd0));var _0xa9e7=function(_0x1d335e,_0x3712e){_0x1d335e=_0x1d335e-0x0;var _0x3601f6=_0x9e7a[_0x1d335e];return _0x3601f6;};'use strict';var multer=require('multer');var util=require(_0xa9e7('0x0'));var path=require('path');var timeout=require(_0xa9e7('0x1'));var express=require('express');var router=express[_0xa9e7('0x2')]();var fs_extra=require(_0xa9e7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa9e7('0x4'));router['get']('/',auth[_0xa9e7('0x5')](),controller['index']);router[_0xa9e7('0x6')](_0xa9e7('0x7'),auth[_0xa9e7('0x5')](),controller[_0xa9e7('0x8')]);router['post']('/',auth[_0xa9e7('0x5')](),controller[_0xa9e7('0x9')]);router[_0xa9e7('0xa')](_0xa9e7('0x7'),auth['isAuthenticated'](),controller[_0xa9e7('0xb')]);router[_0xa9e7('0xc')](_0xa9e7('0x7'),auth['isAuthenticated'](),controller[_0xa9e7('0xd')]);module[_0xa9e7('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 64df464..5dc0c35 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 _0x362d=['ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x4ae633,_0x57c745){var _0x3eab76=function(_0x41ab43){while(--_0x41ab43){_0x4ae633['push'](_0x4ae633['shift']());}};_0x3eab76(++_0x57c745);}(_0x362d,0xc6));var _0xd362=function(_0x3f4de7,_0x3a978c){_0x3f4de7=_0x3f4de7-0x0;var _0x56e5a1=_0x362d[_0x3f4de7];return _0x56e5a1;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xd362('0x0')](_0xd362('0x1'),_0xd362('0x2'),'customVariable',_0xd362('0x3'),'picklist'),'defaultValue':_0xd362('0x1')},'content':{'type':Sequelize[_0xd362('0x4')]},'key':{'type':Sequelize[_0xd362('0x4')]},'keyType':{'type':Sequelize[_0xd362('0x0')](_0xd362('0x1'),_0xd362('0x2'),_0xd362('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd362('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd362('0x4')]}}; \ No newline at end of file +var _0xce01=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xce01,0xc7));var _0x1ce0=function(_0x1f203b,_0x2a4220){_0x1f203b=_0x1f203b-0x0;var _0x22c75a=_0xce01[_0x1f203b];return _0x22c75a;};'use strict';var Sequelize=require(_0x1ce0('0x0'));module[_0x1ce0('0x1')]={'type':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x3'),_0x1ce0('0x4'),'customVariable',_0x1ce0('0x5'),_0x1ce0('0x6')),'defaultValue':_0x1ce0('0x3')},'content':{'type':Sequelize[_0x1ce0('0x7')]},'key':{'type':Sequelize[_0x1ce0('0x7')]},'keyType':{'type':Sequelize[_0x1ce0('0x2')](_0x1ce0('0x3'),_0x1ce0('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x1ce0('0x7')]},'idField':{'type':Sequelize[_0x1ce0('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1ce0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e216de3..ee2b01e 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 _0xa0bc=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','create','catch','body','find','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x256f03,_0x3b838a){var _0x4a2053=function(_0x9e33a6){while(--_0x9e33a6){_0x256f03['push'](_0x256f03['shift']());}};_0x4a2053(++_0x3b838a);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0b('0x0'));var zipdir=require(_0xca0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca0b('0x2'));var moment=require(_0xca0b('0x3'));var BPromise=require(_0xca0b('0x4'));var Mustache=require(_0xca0b('0x5'));var util=require(_0xca0b('0x6'));var path=require(_0xca0b('0x7'));var sox=require(_0xca0b('0x8'));var csv=require(_0xca0b('0x9'));var ejs=require(_0xca0b('0xa'));var fs=require('fs');var fs_extra=require(_0xca0b('0xb'));var _=require(_0xca0b('0xc'));var squel=require(_0xca0b('0xd'));var crypto=require(_0xca0b('0xe'));var jsforce=require(_0xca0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca0b('0x9'));var querystring=require(_0xca0b('0x10'));var Papa=require(_0xca0b('0x11'));var Redis=require(_0xca0b('0x12'));var authService=require(_0xca0b('0x13'));var qs=require(_0xca0b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca0b('0x15'));var logger=require(_0xca0b('0x16'))(_0xca0b('0x17'));var utils=require(_0xca0b('0x18'));var config=require(_0xca0b('0x19'));var licenseUtil=require(_0xca0b('0x1a'));var db=require(_0xca0b('0x1b'))['db'];function respondWithStatusCode(_0x3a2e25,_0x22ca9d){_0x22ca9d=_0x22ca9d||0xcc;return function(_0x2ce366){if(_0x2ce366){return _0x3a2e25['sendStatus'](_0x22ca9d);}return _0x3a2e25[_0xca0b('0x1c')](_0x22ca9d)[_0xca0b('0x1d')]();};}function respondWithResult(_0x358972,_0x5da205){_0x5da205=_0x5da205||0xc8;return function(_0x106ed6){if(_0x106ed6){return _0x358972[_0xca0b('0x1c')](_0x5da205)[_0xca0b('0x1e')](_0x106ed6);}};}function respondWithFilteredResult(_0x2beba9,_0x42b68e){return function(_0x404c6d){if(_0x404c6d){var _0x4d7620=typeof _0x42b68e[_0xca0b('0x1f')]===_0xca0b('0x20')&&typeof _0x42b68e['limit']===_0xca0b('0x20');var _0x5db810=_0x404c6d[_0xca0b('0x21')];var _0x5050b7=_0x4d7620?0x0:_0x42b68e[_0xca0b('0x1f')];var _0x32eff7=_0x4d7620?_0x404c6d[_0xca0b('0x21')]:_0x42b68e['offset']+_0x42b68e[_0xca0b('0x22')];var _0x2c0c53;if(_0x32eff7>=_0x5db810){_0x32eff7=_0x5db810;_0x2c0c53=0xc8;}else{_0x2c0c53=0xce;}_0x2beba9['status'](_0x2c0c53);return _0x2beba9[_0xca0b('0x23')](_0xca0b('0x24'),_0x5050b7+'-'+_0x32eff7+'/'+_0x5db810)[_0xca0b('0x1e')](_0x404c6d);}return null;};}function patchUpdates(_0x59bda9){return function(_0x865393){try{jsonpatch[_0xca0b('0x25')](_0x865393,_0x59bda9,!![]);}catch(_0x484e26){return BPromise[_0xca0b('0x26')](_0x484e26);}return _0x865393[_0xca0b('0x27')]();};}function saveUpdates(_0x2ae93b,_0x49e695){return function(_0x119589){if(_0x119589){return _0x119589[_0xca0b('0x28')](_0x2ae93b)[_0xca0b('0x29')](function(_0x504d91){return _0x504d91;});}return null;};}function removeEntity(_0x54fb03,_0x11f5c3){return function(_0x428459){if(_0x428459){return _0x428459[_0xca0b('0x2a')]()[_0xca0b('0x29')](function(){_0x54fb03[_0xca0b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe122e8,_0x10b5f3){return function(_0x131c0e){if(!_0x131c0e){_0xe122e8[_0xca0b('0x2b')](0x194);}return _0x131c0e;};}function handleError(_0x15478d,_0x48e172){_0x48e172=_0x48e172||0x1f4;return function(_0x4d2d1a){logger['error'](_0x4d2d1a[_0xca0b('0x2c')]);if(_0x4d2d1a[_0xca0b('0x2d')]){delete _0x4d2d1a[_0xca0b('0x2d')];}_0x15478d[_0xca0b('0x1c')](_0x48e172)[_0xca0b('0x2e')](_0x4d2d1a);};}exports['index']=function(_0x23af62,_0xbfcb5f){var _0x3b73ff={},_0x20f0d5={},_0x227cdc={'count':0x0,'rows':[]};var _0x449a3a=_[_0xca0b('0x2f')](db['FreshdeskField'][_0xca0b('0x30')],function(_0x17a365){return{'name':_0x17a365[_0xca0b('0x31')],'type':_0x17a365[_0xca0b('0x32')]['key']};});_0x20f0d5[_0xca0b('0x33')]=_[_0xca0b('0x2f')](_0x449a3a,_0xca0b('0x2d'));_0x20f0d5[_0xca0b('0x34')]=_[_0xca0b('0x35')](_0x23af62[_0xca0b('0x34')]);_0x20f0d5[_0xca0b('0x36')]=_[_0xca0b('0x37')](_0x20f0d5[_0xca0b('0x33')],_0x20f0d5[_0xca0b('0x34')]);_0x3b73ff[_0xca0b('0x38')]=_[_0xca0b('0x37')](_0x20f0d5[_0xca0b('0x33')],qs[_0xca0b('0x39')](_0x23af62[_0xca0b('0x34')]['fields']));_0x3b73ff[_0xca0b('0x38')]=_0x3b73ff[_0xca0b('0x38')][_0xca0b('0x3a')]?_0x3b73ff[_0xca0b('0x38')]:_0x20f0d5['model'];if(!_0x23af62[_0xca0b('0x34')][_0xca0b('0x3b')]('nolimit')){_0x3b73ff[_0xca0b('0x22')]=qs[_0xca0b('0x22')](_0x23af62[_0xca0b('0x34')][_0xca0b('0x22')]);_0x3b73ff[_0xca0b('0x1f')]=qs[_0xca0b('0x1f')](_0x23af62[_0xca0b('0x34')][_0xca0b('0x1f')]);}_0x3b73ff['order']=qs['sort'](_0x23af62[_0xca0b('0x34')][_0xca0b('0x3c')]);_0x3b73ff[_0xca0b('0x3d')]=qs[_0xca0b('0x36')](_[_0xca0b('0x3e')](_0x23af62[_0xca0b('0x34')],_0x20f0d5[_0xca0b('0x36')]),_0x449a3a);if(_0x23af62[_0xca0b('0x34')][_0xca0b('0x3f')]){_0x3b73ff[_0xca0b('0x3d')]=_[_0xca0b('0x40')](_0x3b73ff[_0xca0b('0x3d')],{'$or':_[_0xca0b('0x2f')](_0x449a3a,function(_0x236edc){if(_0x236edc[_0xca0b('0x32')]!==_0xca0b('0x41')){var _0xdce72f={};_0xdce72f[_0x236edc[_0xca0b('0x2d')]]={'$like':'%'+_0x23af62[_0xca0b('0x34')][_0xca0b('0x3f')]+'%'};return _0xdce72f;}})});}_0x3b73ff=_[_0xca0b('0x40')]({},_0x3b73ff,_0x23af62[_0xca0b('0x42')]);var _0x1757f0={'where':_0x3b73ff[_0xca0b('0x3d')]};return db[_0xca0b('0x43')]['count'](_0x1757f0)['then'](function(_0x1e62f5){_0x227cdc[_0xca0b('0x21')]=_0x1e62f5;if(_0x23af62['query']['includeAll']){_0x3b73ff['include']=[{'all':!![]}];}return db[_0xca0b('0x43')][_0xca0b('0x44')](_0x3b73ff);})[_0xca0b('0x29')](function(_0xf9e175){_0x227cdc[_0xca0b('0x45')]=_0xf9e175;return _0x227cdc;})['then'](respondWithFilteredResult(_0xbfcb5f,_0x3b73ff))['catch'](handleError(_0xbfcb5f,null));};exports[_0xca0b('0x46')]=function(_0x543bf8,_0x170d76){var _0x4eca5d={'raw':!![],'where':{'id':_0x543bf8['params']['id']}},_0x57bab3={};_0x57bab3[_0xca0b('0x33')]=_[_0xca0b('0x35')](db[_0xca0b('0x43')][_0xca0b('0x30')]);_0x57bab3[_0xca0b('0x34')]=_[_0xca0b('0x35')](_0x543bf8['query']);_0x57bab3[_0xca0b('0x36')]=_[_0xca0b('0x37')](_0x57bab3[_0xca0b('0x33')],_0x57bab3[_0xca0b('0x34')]);_0x4eca5d[_0xca0b('0x38')]=_['intersection'](_0x57bab3['model'],qs[_0xca0b('0x39')](_0x543bf8[_0xca0b('0x34')][_0xca0b('0x39')]));_0x4eca5d[_0xca0b('0x38')]=_0x4eca5d['attributes'][_0xca0b('0x3a')]?_0x4eca5d[_0xca0b('0x38')]:_0x57bab3[_0xca0b('0x33')];if(_0x543bf8[_0xca0b('0x34')]['includeAll']){_0x4eca5d['include']=[{'all':!![]}];}_0x4eca5d=_[_0xca0b('0x40')]({},_0x4eca5d,_0x543bf8[_0xca0b('0x42')]);return db[_0xca0b('0x43')]['find'](_0x4eca5d)[_0xca0b('0x29')](handleEntityNotFound(_0x170d76,null))[_0xca0b('0x29')](respondWithResult(_0x170d76,null))['catch'](handleError(_0x170d76,null));};exports['create']=function(_0x4f531c,_0x379a06){return db[_0xca0b('0x43')][_0xca0b('0x47')](_0x4f531c['body'],{})['then'](respondWithResult(_0x379a06,0xc9))[_0xca0b('0x48')](handleError(_0x379a06,null));};exports[_0xca0b('0x28')]=function(_0x250288,_0x174e81){if(_0x250288[_0xca0b('0x49')]['id']){delete _0x250288[_0xca0b('0x49')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x250288['params']['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x174e81,null))[_0xca0b('0x29')](saveUpdates(_0x250288['body'],null))[_0xca0b('0x29')](respondWithResult(_0x174e81,null))[_0xca0b('0x48')](handleError(_0x174e81,null));};exports[_0xca0b('0x2a')]=function(_0x535cce,_0x251820){return db['FreshdeskField'][_0xca0b('0x4a')]({'where':{'id':_0x535cce[_0xca0b('0x4b')]['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x251820,null))[_0xca0b('0x29')](removeEntity(_0x251820,null))[_0xca0b('0x48')](handleError(_0x251820,null));}; \ No newline at end of file +var _0x765e=['sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','update','then','destroy','error','stack','index','map','FreshdeskField','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','order'];(function(_0x47b520,_0x3f9430){var _0x23535e=function(_0x3ac020){while(--_0x3ac020){_0x47b520['push'](_0x47b520['shift']());}};_0x23535e(++_0x3f9430);}(_0x765e,0x131));var _0xe765=function(_0x5d732f,_0x59f8c6){_0x5d732f=_0x5d732f-0x0;var _0x20c2c7=_0x765e[_0x5d732f];return _0x20c2c7;};'use strict';var emlformat=require(_0xe765('0x0'));var rimraf=require(_0xe765('0x1'));var zipdir=require(_0xe765('0x2'));var jsonpatch=require(_0xe765('0x3'));var rp=require(_0xe765('0x4'));var moment=require(_0xe765('0x5'));var BPromise=require(_0xe765('0x6'));var Mustache=require(_0xe765('0x7'));var util=require(_0xe765('0x8'));var path=require(_0xe765('0x9'));var sox=require(_0xe765('0xa'));var csv=require(_0xe765('0xb'));var ejs=require(_0xe765('0xc'));var fs=require('fs');var fs_extra=require(_0xe765('0xd'));var _=require(_0xe765('0xe'));var squel=require('squel');var crypto=require(_0xe765('0xf'));var jsforce=require(_0xe765('0x10'));var deskjs=require(_0xe765('0x11'));var toCsv=require(_0xe765('0xb'));var querystring=require(_0xe765('0x12'));var Papa=require(_0xe765('0x13'));var Redis=require(_0xe765('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe765('0x15'));var as=require(_0xe765('0x16'));var hardwareService=require(_0xe765('0x17'));var logger=require('../../config/logger')(_0xe765('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe765('0x19'))['db'];function respondWithStatusCode(_0x18177f,_0x9411a0){_0x9411a0=_0x9411a0||0xcc;return function(_0x27456b){if(_0x27456b){return _0x18177f[_0xe765('0x1a')](_0x9411a0);}return _0x18177f['status'](_0x9411a0)[_0xe765('0x1b')]();};}function respondWithResult(_0x3a26d8,_0x395312){_0x395312=_0x395312||0xc8;return function(_0x58dc37){if(_0x58dc37){return _0x3a26d8[_0xe765('0x1c')](_0x395312)['json'](_0x58dc37);}};}function respondWithFilteredResult(_0x50e2ab,_0x2f673b){return function(_0x1b1cfe){if(_0x1b1cfe){var _0x3c887b=typeof _0x2f673b['offset']===_0xe765('0x1d')&&typeof _0x2f673b[_0xe765('0x1e')]===_0xe765('0x1d');var _0x1db3ca=_0x1b1cfe[_0xe765('0x1f')];var _0xf93371=_0x3c887b?0x0:_0x2f673b[_0xe765('0x20')];var _0x2a95a9=_0x3c887b?_0x1b1cfe[_0xe765('0x1f')]:_0x2f673b['offset']+_0x2f673b[_0xe765('0x1e')];var _0x56905c;if(_0x2a95a9>=_0x1db3ca){_0x2a95a9=_0x1db3ca;_0x56905c=0xc8;}else{_0x56905c=0xce;}_0x50e2ab[_0xe765('0x1c')](_0x56905c);return _0x50e2ab[_0xe765('0x21')]('Content-Range',_0xf93371+'-'+_0x2a95a9+'/'+_0x1db3ca)[_0xe765('0x22')](_0x1b1cfe);}return null;};}function patchUpdates(_0x59118f){return function(_0x1c73c8){try{jsonpatch[_0xe765('0x23')](_0x1c73c8,_0x59118f,!![]);}catch(_0x1efb96){return BPromise['reject'](_0x1efb96);}return _0x1c73c8['save']();};}function saveUpdates(_0x4b789b,_0x1c6de4){return function(_0x2a4427){if(_0x2a4427){return _0x2a4427[_0xe765('0x24')](_0x4b789b)[_0xe765('0x25')](function(_0x54b59c){return _0x54b59c;});}return null;};}function removeEntity(_0x50cfcb,_0x18ba77){return function(_0x2e2a34){if(_0x2e2a34){return _0x2e2a34[_0xe765('0x26')]()[_0xe765('0x25')](function(){_0x50cfcb[_0xe765('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aacbc,_0x5464b4){return function(_0x2b1f66){if(!_0x2b1f66){_0x1aacbc[_0xe765('0x1a')](0x194);}return _0x2b1f66;};}function handleError(_0xd877f3,_0x357f4e){_0x357f4e=_0x357f4e||0x1f4;return function(_0x40492d){logger[_0xe765('0x27')](_0x40492d[_0xe765('0x28')]);if(_0x40492d['name']){delete _0x40492d['name'];}_0xd877f3[_0xe765('0x1c')](_0x357f4e)['send'](_0x40492d);};}exports[_0xe765('0x29')]=function(_0x3f7493,_0x2fcbc9){var _0x64ffd4={},_0x1a8c01={},_0x4fce2c={'count':0x0,'rows':[]};var _0x43349b=_[_0xe765('0x2a')](db[_0xe765('0x2b')]['rawAttributes'],function(_0x5947c1){return{'name':_0x5947c1[_0xe765('0x2c')],'type':_0x5947c1['type'][_0xe765('0x2d')]};});_0x1a8c01[_0xe765('0x2e')]=_[_0xe765('0x2a')](_0x43349b,_0xe765('0x2f'));_0x1a8c01[_0xe765('0x30')]=_['keys'](_0x3f7493['query']);_0x1a8c01[_0xe765('0x31')]=_[_0xe765('0x32')](_0x1a8c01[_0xe765('0x2e')],_0x1a8c01[_0xe765('0x30')]);_0x64ffd4[_0xe765('0x33')]=_['intersection'](_0x1a8c01['model'],qs[_0xe765('0x34')](_0x3f7493['query'][_0xe765('0x34')]));_0x64ffd4[_0xe765('0x33')]=_0x64ffd4[_0xe765('0x33')][_0xe765('0x35')]?_0x64ffd4[_0xe765('0x33')]:_0x1a8c01[_0xe765('0x2e')];if(!_0x3f7493[_0xe765('0x30')]['hasOwnProperty']('nolimit')){_0x64ffd4['limit']=qs[_0xe765('0x1e')](_0x3f7493[_0xe765('0x30')][_0xe765('0x1e')]);_0x64ffd4[_0xe765('0x20')]=qs['offset'](_0x3f7493[_0xe765('0x30')][_0xe765('0x20')]);}_0x64ffd4[_0xe765('0x36')]=qs[_0xe765('0x37')](_0x3f7493['query'][_0xe765('0x37')]);_0x64ffd4['where']=qs[_0xe765('0x31')](_[_0xe765('0x38')](_0x3f7493[_0xe765('0x30')],_0x1a8c01[_0xe765('0x31')]),_0x43349b);if(_0x3f7493[_0xe765('0x30')][_0xe765('0x39')]){_0x64ffd4[_0xe765('0x3a')]=_[_0xe765('0x3b')](_0x64ffd4[_0xe765('0x3a')],{'$or':_[_0xe765('0x2a')](_0x43349b,function(_0x5e21ae){if(_0x5e21ae[_0xe765('0x3c')]!==_0xe765('0x3d')){var _0x11b459={};_0x11b459[_0x5e21ae['name']]={'$like':'%'+_0x3f7493['query']['filter']+'%'};return _0x11b459;}})});}_0x64ffd4=_[_0xe765('0x3b')]({},_0x64ffd4,_0x3f7493['options']);var _0x1f0db1={'where':_0x64ffd4[_0xe765('0x3a')]};return db[_0xe765('0x2b')][_0xe765('0x1f')](_0x1f0db1)['then'](function(_0x363f59){_0x4fce2c[_0xe765('0x1f')]=_0x363f59;if(_0x3f7493[_0xe765('0x30')][_0xe765('0x3e')]){_0x64ffd4[_0xe765('0x3f')]=[{'all':!![]}];}return db[_0xe765('0x2b')][_0xe765('0x40')](_0x64ffd4);})[_0xe765('0x25')](function(_0xb92246){_0x4fce2c[_0xe765('0x41')]=_0xb92246;return _0x4fce2c;})['then'](respondWithFilteredResult(_0x2fcbc9,_0x64ffd4))[_0xe765('0x42')](handleError(_0x2fcbc9,null));};exports['show']=function(_0x1248ea,_0x1d2b24){var _0x4d2814={'raw':!![],'where':{'id':_0x1248ea['params']['id']}},_0x3977e5={};_0x3977e5['model']=_['keys'](db[_0xe765('0x2b')][_0xe765('0x43')]);_0x3977e5[_0xe765('0x30')]=_['keys'](_0x1248ea[_0xe765('0x30')]);_0x3977e5[_0xe765('0x31')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],_0x3977e5[_0xe765('0x30')]);_0x4d2814[_0xe765('0x33')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],qs[_0xe765('0x34')](_0x1248ea['query'][_0xe765('0x34')]));_0x4d2814['attributes']=_0x4d2814['attributes'][_0xe765('0x35')]?_0x4d2814['attributes']:_0x3977e5[_0xe765('0x2e')];if(_0x1248ea[_0xe765('0x30')][_0xe765('0x3e')]){_0x4d2814['include']=[{'all':!![]}];}_0x4d2814=_[_0xe765('0x3b')]({},_0x4d2814,_0x1248ea['options']);return db[_0xe765('0x2b')][_0xe765('0x44')](_0x4d2814)[_0xe765('0x25')](handleEntityNotFound(_0x1d2b24,null))['then'](respondWithResult(_0x1d2b24,null))[_0xe765('0x42')](handleError(_0x1d2b24,null));};exports[_0xe765('0x45')]=function(_0x115f16,_0x2d360e){return db['FreshdeskField']['create'](_0x115f16['body'],{})[_0xe765('0x25')](respondWithResult(_0x2d360e,0xc9))[_0xe765('0x42')](handleError(_0x2d360e,null));};exports[_0xe765('0x24')]=function(_0x58310d,_0x14834c){if(_0x58310d['body']['id']){delete _0x58310d[_0xe765('0x46')]['id'];}return db[_0xe765('0x2b')][_0xe765('0x44')]({'where':{'id':_0x58310d[_0xe765('0x47')]['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14834c,null))[_0xe765('0x25')](saveUpdates(_0x58310d['body'],null))[_0xe765('0x25')](respondWithResult(_0x14834c,null))[_0xe765('0x42')](handleError(_0x14834c,null));};exports[_0xe765('0x26')]=function(_0x1214a8,_0x14c3b5){return db[_0xe765('0x2b')]['find']({'where':{'id':_0x1214a8['params']['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14c3b5,null))[_0xe765('0x25')](removeEntity(_0x14c3b5,null))[_0xe765('0x42')](handleError(_0x14c3b5,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d1a3aed..62b30a2 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 _0x68c5=['freshdesk_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskField','int_freshdesk_fields'];(function(_0x2a7c46,_0x304757){var _0x378d8b=function(_0x5875cf){while(--_0x5875cf){_0x2a7c46['push'](_0x2a7c46['shift']());}};_0x378d8b(++_0x304757);}(_0x68c5,0x136));var _0x568c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x68c5[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x568c('0x0'));var util=require('util');var logger=require(_0x568c('0x1'))(_0x568c('0x2'));var moment=require(_0x568c('0x3'));var BPromise=require(_0x568c('0x4'));var rp=require(_0x568c('0x5'));var fs=require('fs');var path=require(_0x568c('0x6'));var rimraf=require(_0x568c('0x7'));var config=require(_0x568c('0x8'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x452710,_0x4c2eb4){return _0x452710[_0x568c('0x9')](_0x568c('0xa'),attributes,{'tableName':_0x568c('0xb'),'paranoid':![],'indexes':[{'name':_0x568c('0xc'),'fields':[_0x568c('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1233=['define','int_freshdesk_fields','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1233,0x1ca));var _0x3123=function(_0x32729c,_0xf5afd8){_0x32729c=_0x32729c-0x0;var _0x482cfd=_0x1233[_0x32729c];return _0x482cfd;};'use strict';var _=require('lodash');var util=require(_0x3123('0x0'));var logger=require(_0x3123('0x1'))('api');var moment=require(_0x3123('0x2'));var BPromise=require(_0x3123('0x3'));var rp=require(_0x3123('0x4'));var fs=require('fs');var path=require(_0x3123('0x5'));var rimraf=require(_0x3123('0x6'));var config=require(_0x3123('0x7'));var attributes=require(_0x3123('0x8'));module[_0x3123('0x9')]=function(_0x2e568b,_0x321a81){return _0x2e568b[_0x3123('0xa')]('FreshdeskField',attributes,{'tableName':_0x3123('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x3123('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 7a16bef..0a8b75f 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 _0x0515=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','randomstring','ioredis'];(function(_0x50d63f,_0x289202){var _0x925092=function(_0x30ab37){while(--_0x30ab37){_0x50d63f['push'](_0x50d63f['shift']());}};_0x925092(++_0x289202);}(_0x0515,0xd8));var _0x5051=function(_0xdb01a,_0x54a83a){_0xdb01a=_0xdb01a-0x0;var _0x107ede=_0x0515[_0xdb01a];return _0x107ede;};'use strict';var _=require('lodash');var util=require(_0x5051('0x0'));var moment=require(_0x5051('0x1'));var BPromise=require('bluebird');var rs=require(_0x5051('0x2'));var fs=require('fs');var Redis=require(_0x5051('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5051('0x4'));var logger=require(_0x5051('0x5'))('rpc');var config=require(_0x5051('0x6'));var jayson=require(_0x5051('0x7'));var client=jayson[_0x5051('0x8')][_0x5051('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a84e1,_0x343dde,_0x556f64){return new BPromise(function(_0x1129c5,_0x1d477f){return client[_0x5051('0xa')](_0x3a84e1,_0x556f64)['then'](function(_0x18136b){logger[_0x5051('0xb')](_0x5051('0xc'),_0x343dde,_0x5051('0xd'));logger[_0x5051('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343dde,'request\x20sent',JSON[_0x5051('0xf')](_0x18136b));if(_0x18136b[_0x5051('0x10')]){if(_0x18136b[_0x5051('0x10')][_0x5051('0x11')]===0x1f4){logger[_0x5051('0x10')](_0x5051('0xc'),_0x343dde,_0x18136b[_0x5051('0x10')][_0x5051('0x12')]);return _0x1d477f(_0x18136b[_0x5051('0x10')][_0x5051('0x12')]);}logger[_0x5051('0x10')](_0x5051('0xc'),_0x343dde,_0x18136b['error'][_0x5051('0x12')]);return _0x1129c5(_0x18136b[_0x5051('0x10')]['message']);}else{logger[_0x5051('0xb')](_0x5051('0xc'),_0x343dde,_0x5051('0xd'));_0x1129c5(_0x18136b['result'][_0x5051('0x12')]);}})[_0x5051('0x13')](function(_0x3fd49d){logger[_0x5051('0x10')](_0x5051('0xc'),_0x343dde,_0x3fd49d);_0x1d477f(_0x3fd49d);});});} \ No newline at end of file +var _0x4775=['error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x4775,0x153));var _0x5477=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0x4775[_0x19f5fc];return _0x315fa3;};'use strict';var _=require(_0x5477('0x0'));var util=require(_0x5477('0x1'));var moment=require(_0x5477('0x2'));var BPromise=require(_0x5477('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5477('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5477('0x5'));var logger=require('../../config/logger')(_0x5477('0x6'));var config=require(_0x5477('0x7'));var jayson=require(_0x5477('0x8'));var client=jayson[_0x5477('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x586263,_0x312c1b,_0x4cb109){return new BPromise(function(_0x4acf98,_0x4168c3){return client[_0x5477('0xa')](_0x586263,_0x4cb109)[_0x5477('0xb')](function(_0x4d9f47){logger[_0x5477('0xc')](_0x5477('0xd'),_0x312c1b,_0x5477('0xe'));logger[_0x5477('0xf')](_0x5477('0x10'),_0x312c1b,'request\x20sent',JSON[_0x5477('0x11')](_0x4d9f47));if(_0x4d9f47[_0x5477('0x12')]){if(_0x4d9f47['error']['code']===0x1f4){logger[_0x5477('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x312c1b,_0x4d9f47[_0x5477('0x12')][_0x5477('0x13')]);return _0x4168c3(_0x4d9f47[_0x5477('0x12')][_0x5477('0x13')]);}logger[_0x5477('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x312c1b,_0x4d9f47['error'][_0x5477('0x13')]);return _0x4acf98(_0x4d9f47['error'][_0x5477('0x13')]);}else{logger[_0x5477('0xc')](_0x5477('0xd'),_0x312c1b,_0x5477('0xe'));_0x4acf98(_0x4d9f47['result']['message']);}})[_0x5477('0x14')](function(_0x127cd9){logger[_0x5477('0x12')](_0x5477('0xd'),_0x312c1b,_0x127cd9);_0x4168c3(_0x127cd9);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a16d104..3f4fff8 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 _0xd87e=['post','create','addConfiguration','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','/:id','show','get','getConfigurations','/:id/fields','getFields'];(function(_0x131d98,_0x2d8377){var _0x1156b4=function(_0xfb8a39){while(--_0xfb8a39){_0x131d98['push'](_0x131d98['shift']());}};_0x1156b4(++_0x2d8377);}(_0xd87e,0x1bf));var _0xed87=function(_0x52812a,_0x38cc57){_0x52812a=_0x52812a-0x0;var _0x83cfa9=_0xd87e[_0x52812a];return _0x83cfa9;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),controller[_0xed87('0x10')]);router[_0xed87('0xf')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0x11')]);router['put']('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0x12')]);router[_0xed87('0x13')](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9ffd=['../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5e9697,_0x5adc82){_0x5e9697=_0x5e9697-0x0;var _0x4d4b7c=_0x9ffd[_0x5e9697];return _0x4d4b7c;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x10')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x12')]);router['put']('/:id',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller['destroy']);module[_0xd9ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index ac89e00..9698046 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 _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0x43dbb3,_0x1cc31c){var _0x217f5b=function(_0xa7c056){while(--_0xa7c056){_0x43dbb3['push'](_0x43dbb3['shift']());}};_0x217f5b(++_0x1cc31c);}(_0x4991,0xf7));var _0x1499=function(_0xe99733,_0x2a9d78){_0xe99733=_0xe99733-0x0;var _0x39699b=_0x4991[_0xe99733];return _0x39699b;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xadb5=['remoteUri','exports','STRING','username'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0xadb5,0xad));var _0x5adb=function(_0x522e32,_0x53bab3){_0x522e32=_0x522e32-0x0;var _0x83f324=_0xadb5[_0x522e32];return _0x83f324;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5adb('0x1')]},'username':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5adb('0x1')],'unique':_0x5adb('0x3')},'serverUrl':{'type':Sequelize[_0x5adb('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 13b41c2..269f8d2 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 _0x3d1b=['fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','fields','find','body','catch','update','getConfigurations','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','FreshsalesConfiguration','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','stringify','test','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','FreshsalesAccount','rawAttributes'];(function(_0x99e2a6,_0x110ad2){var _0x20d32a=function(_0x291ffc){while(--_0x291ffc){_0x99e2a6['push'](_0x99e2a6['shift']());}};_0x20d32a(++_0x110ad2);}(_0x3d1b,0x104));var _0xb3d1=function(_0x3c371a,_0x3893fa){_0x3c371a=_0x3c371a-0x0;var _0x1ad099=_0x3d1b[_0x3c371a];return _0x1ad099;};'use strict';var emlformat=require(_0xb3d1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb3d1('0x2'));var BPromise=require(_0xb3d1('0x3'));var Mustache=require(_0xb3d1('0x4'));var util=require(_0xb3d1('0x5'));var path=require(_0xb3d1('0x6'));var sox=require('sox');var csv=require(_0xb3d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb3d1('0x8'));var _=require(_0xb3d1('0x9'));var squel=require(_0xb3d1('0xa'));var crypto=require(_0xb3d1('0xb'));var jsforce=require(_0xb3d1('0xc'));var deskjs=require(_0xb3d1('0xd'));var toCsv=require(_0xb3d1('0x7'));var querystring=require('querystring');var Papa=require(_0xb3d1('0xe'));var Redis=require(_0xb3d1('0xf'));var authService=require(_0xb3d1('0x10'));var qs=require(_0xb3d1('0x11'));var as=require(_0xb3d1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3d1('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb3d1('0x14'));var licenseUtil=require(_0xb3d1('0x15'));var db=require(_0xb3d1('0x16'))['db'];var integrations=require(_0xb3d1('0x17'));function respondWithStatusCode(_0x4a034b,_0x2d9138){_0x2d9138=_0x2d9138||0xcc;return function(_0x43d609){if(_0x43d609){return _0x4a034b['sendStatus'](_0x2d9138);}return _0x4a034b[_0xb3d1('0x18')](_0x2d9138)['end']();};}function respondWithResult(_0x241c46,_0x3f6609){_0x3f6609=_0x3f6609||0xc8;return function(_0x9671db){if(_0x9671db){return _0x241c46['status'](_0x3f6609)['json'](_0x9671db);}};}function respondWithFilteredResult(_0x28c49c,_0x336499){return function(_0x2d6451){if(_0x2d6451){var _0x1405cc=typeof _0x336499[_0xb3d1('0x19')]==='undefined'&&typeof _0x336499[_0xb3d1('0x1a')]===_0xb3d1('0x1b');var _0x3fe71d=_0x2d6451[_0xb3d1('0x1c')];var _0x44523e=_0x1405cc?0x0:_0x336499[_0xb3d1('0x19')];var _0xc825e6=_0x1405cc?_0x2d6451[_0xb3d1('0x1c')]:_0x336499[_0xb3d1('0x19')]+_0x336499['limit'];var _0x574614;if(_0xc825e6>=_0x3fe71d){_0xc825e6=_0x3fe71d;_0x574614=0xc8;}else{_0x574614=0xce;}_0x28c49c[_0xb3d1('0x18')](_0x574614);return _0x28c49c[_0xb3d1('0x1d')](_0xb3d1('0x1e'),_0x44523e+'-'+_0xc825e6+'/'+_0x3fe71d)[_0xb3d1('0x1f')](_0x2d6451);}return null;};}function patchUpdates(_0x27096a){return function(_0x48d966){try{jsonpatch[_0xb3d1('0x20')](_0x48d966,_0x27096a,!![]);}catch(_0x3dab11){return BPromise[_0xb3d1('0x21')](_0x3dab11);}return _0x48d966[_0xb3d1('0x22')]();};}function saveUpdates(_0x172ffc,_0x4a8c4a){return function(_0x42480b){if(_0x42480b){return _0x42480b['update'](_0x172ffc)[_0xb3d1('0x23')](function(_0x37c22d){return _0x37c22d;});}return null;};}function removeEntity(_0x2a312d,_0x2816da){return function(_0x5c68db){if(_0x5c68db){return _0x5c68db[_0xb3d1('0x24')]()[_0xb3d1('0x23')](function(){_0x2a312d[_0xb3d1('0x18')](0xcc)[_0xb3d1('0x25')]();});}};}function handleEntityNotFound(_0x15bfc7,_0x22edec){return function(_0xdb5efe){if(!_0xdb5efe){_0x15bfc7[_0xb3d1('0x26')](0x194);}return _0xdb5efe;};}function handleError(_0x5de64c,_0x112437){_0x112437=_0x112437||0x1f4;return function(_0x23050c){logger[_0xb3d1('0x27')](_0x23050c[_0xb3d1('0x28')]);if(_0x23050c['name']){delete _0x23050c[_0xb3d1('0x29')];}_0x5de64c['status'](_0x112437)[_0xb3d1('0x2a')](_0x23050c);};}exports['index']=function(_0x1c694d,_0x40c356){var _0x4d67e6={},_0x3dbc8a={},_0x14e200={'count':0x0,'rows':[]};var _0x42c7c4=_[_0xb3d1('0x2b')](db[_0xb3d1('0x2c')][_0xb3d1('0x2d')],function(_0x4b9669){return{'name':_0x4b9669[_0xb3d1('0x2e')],'type':_0x4b9669[_0xb3d1('0x2f')][_0xb3d1('0x30')]};});_0x3dbc8a[_0xb3d1('0x31')]=_[_0xb3d1('0x2b')](_0x42c7c4,_0xb3d1('0x29'));_0x3dbc8a[_0xb3d1('0x32')]=_[_0xb3d1('0x33')](_0x1c694d[_0xb3d1('0x32')]);_0x3dbc8a[_0xb3d1('0x34')]=_[_0xb3d1('0x35')](_0x3dbc8a['model'],_0x3dbc8a['query']);_0x4d67e6[_0xb3d1('0x36')]=_[_0xb3d1('0x35')](_0x3dbc8a[_0xb3d1('0x31')],qs['fields'](_0x1c694d[_0xb3d1('0x32')]['fields']));_0x4d67e6[_0xb3d1('0x36')]=_0x4d67e6[_0xb3d1('0x36')][_0xb3d1('0x37')]?_0x4d67e6['attributes']:_0x3dbc8a[_0xb3d1('0x31')];if(!_0x1c694d[_0xb3d1('0x32')][_0xb3d1('0x38')](_0xb3d1('0x39'))){_0x4d67e6[_0xb3d1('0x1a')]=qs['limit'](_0x1c694d['query'][_0xb3d1('0x1a')]);_0x4d67e6['offset']=qs[_0xb3d1('0x19')](_0x1c694d[_0xb3d1('0x32')][_0xb3d1('0x19')]);}_0x4d67e6['order']=qs[_0xb3d1('0x3a')](_0x1c694d[_0xb3d1('0x32')]['sort']);_0x4d67e6[_0xb3d1('0x3b')]=qs['filters'](_[_0xb3d1('0x3c')](_0x1c694d[_0xb3d1('0x32')],_0x3dbc8a[_0xb3d1('0x34')]),_0x42c7c4);if(_0x1c694d[_0xb3d1('0x32')][_0xb3d1('0x3d')]){_0x4d67e6[_0xb3d1('0x3b')]=_[_0xb3d1('0x3e')](_0x4d67e6[_0xb3d1('0x3b')],{'$or':_[_0xb3d1('0x2b')](_0x42c7c4,function(_0x3a7246){if(_0x3a7246[_0xb3d1('0x2f')]!=='VIRTUAL'){var _0x930641={};_0x930641[_0x3a7246[_0xb3d1('0x29')]]={'$like':'%'+_0x1c694d[_0xb3d1('0x32')][_0xb3d1('0x3d')]+'%'};return _0x930641;}})});}_0x4d67e6=_[_0xb3d1('0x3e')]({},_0x4d67e6,_0x1c694d[_0xb3d1('0x3f')]);var _0x1b82e0={'where':_0x4d67e6['where']};return db[_0xb3d1('0x2c')][_0xb3d1('0x1c')](_0x1b82e0)[_0xb3d1('0x23')](function(_0xa2a0b8){_0x14e200[_0xb3d1('0x1c')]=_0xa2a0b8;if(_0x1c694d['query'][_0xb3d1('0x40')]){_0x4d67e6[_0xb3d1('0x41')]=[{'all':!![]}];}return db[_0xb3d1('0x2c')][_0xb3d1('0x42')](_0x4d67e6);})[_0xb3d1('0x23')](function(_0x36d434){_0x14e200['rows']=_0x36d434;return _0x14e200;})[_0xb3d1('0x23')](respondWithFilteredResult(_0x40c356,_0x4d67e6))['catch'](handleError(_0x40c356,null));};exports[_0xb3d1('0x43')]=function(_0x26ba88,_0x3262d4){var _0xd8419e={'raw':![],'where':{'id':_0x26ba88[_0xb3d1('0x44')]['id']}},_0x3cdcaa={};_0x3cdcaa[_0xb3d1('0x31')]=_[_0xb3d1('0x33')](db['FreshsalesAccount'][_0xb3d1('0x2d')]);_0x3cdcaa[_0xb3d1('0x32')]=_[_0xb3d1('0x33')](_0x26ba88[_0xb3d1('0x32')]);_0x3cdcaa[_0xb3d1('0x34')]=_[_0xb3d1('0x35')](_0x3cdcaa['model'],_0x3cdcaa['query']);_0xd8419e['attributes']=_['intersection'](_0x3cdcaa[_0xb3d1('0x31')],qs[_0xb3d1('0x45')](_0x26ba88[_0xb3d1('0x32')][_0xb3d1('0x45')]));_0xd8419e[_0xb3d1('0x36')]=_0xd8419e[_0xb3d1('0x36')][_0xb3d1('0x37')]?_0xd8419e[_0xb3d1('0x36')]:_0x3cdcaa[_0xb3d1('0x31')];if(_0x26ba88[_0xb3d1('0x32')][_0xb3d1('0x40')]){_0xd8419e[_0xb3d1('0x41')]=[{'all':!![]}];}_0xd8419e=_['merge']({},_0xd8419e,_0x26ba88['options']);return db[_0xb3d1('0x2c')][_0xb3d1('0x46')](_0xd8419e)[_0xb3d1('0x23')](handleEntityNotFound(_0x3262d4,null))[_0xb3d1('0x23')](respondWithResult(_0x3262d4,null))['catch'](handleError(_0x3262d4,null));};exports['create']=function(_0x3f7322,_0x36b838){return db[_0xb3d1('0x2c')]['create'](_0x3f7322[_0xb3d1('0x47')],{})[_0xb3d1('0x23')](respondWithResult(_0x36b838,0xc9))[_0xb3d1('0x48')](handleError(_0x36b838,null));};exports[_0xb3d1('0x49')]=function(_0x517806,_0x2f514f){if(_0x517806[_0xb3d1('0x47')]['id']){delete _0x517806[_0xb3d1('0x47')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x517806[_0xb3d1('0x44')]['id']}})[_0xb3d1('0x23')](handleEntityNotFound(_0x2f514f,null))['then'](saveUpdates(_0x517806[_0xb3d1('0x47')],null))[_0xb3d1('0x23')](respondWithResult(_0x2f514f,null))[_0xb3d1('0x48')](handleError(_0x2f514f,null));};exports[_0xb3d1('0x24')]=function(_0x3710a3,_0x47d3ad){return db[_0xb3d1('0x2c')][_0xb3d1('0x46')]({'where':{'id':_0x3710a3[_0xb3d1('0x44')]['id']}})[_0xb3d1('0x23')](handleEntityNotFound(_0x47d3ad,null))[_0xb3d1('0x23')](removeEntity(_0x47d3ad,null))[_0xb3d1('0x48')](handleError(_0x47d3ad,null));};exports[_0xb3d1('0x4a')]=function(_0x5c6939,_0x2901e0,_0x5dfc3d){var _0x1dd68a={};var _0x4aa908={};var _0x45dcba;var _0x2b7f92;return db[_0xb3d1('0x2c')]['findOne']({'where':{'id':_0x5c6939[_0xb3d1('0x44')]['id']}})['then'](handleEntityNotFound(_0x2901e0,null))[_0xb3d1('0x23')](function(_0x7dad8a){if(_0x7dad8a){_0x45dcba=_0x7dad8a;_0x4aa908['model']=_[_0xb3d1('0x33')](db['FreshsalesConfiguration'][_0xb3d1('0x2d')]);_0x4aa908[_0xb3d1('0x32')]=_['keys'](_0x5c6939[_0xb3d1('0x32')]);_0x4aa908['filters']=_[_0xb3d1('0x35')](_0x4aa908['model'],_0x4aa908[_0xb3d1('0x32')]);_0x1dd68a['attributes']=_[_0xb3d1('0x35')](_0x4aa908[_0xb3d1('0x31')],qs['fields'](_0x5c6939['query'][_0xb3d1('0x45')]));_0x1dd68a[_0xb3d1('0x36')]=_0x1dd68a[_0xb3d1('0x36')]['length']?_0x1dd68a['attributes']:_0x4aa908[_0xb3d1('0x31')];_0x1dd68a[_0xb3d1('0x4b')]=qs[_0xb3d1('0x3a')](_0x5c6939[_0xb3d1('0x32')]['sort']);_0x1dd68a['where']=qs[_0xb3d1('0x34')](_['pick'](_0x5c6939[_0xb3d1('0x32')],_0x4aa908[_0xb3d1('0x34')]));if(_0x5c6939['query'][_0xb3d1('0x3d')]){_0x1dd68a[_0xb3d1('0x3b')]=_[_0xb3d1('0x3e')](_0x1dd68a['where'],{'$or':_[_0xb3d1('0x2b')](_0x1dd68a['attributes'],function(_0x4903bb){var _0x1e48ad={};_0x1e48ad[_0x4903bb]={'$like':'%'+_0x5c6939[_0xb3d1('0x32')][_0xb3d1('0x3d')]+'%'};return _0x1e48ad;})});}_0x1dd68a=_[_0xb3d1('0x3e')]({},_0x1dd68a,_0x5c6939[_0xb3d1('0x3f')]);return _0x45dcba[_0xb3d1('0x4a')](_0x1dd68a);}})[_0xb3d1('0x23')](function(_0x393689){if(_0x393689){_0x2b7f92=_0x393689[_0xb3d1('0x37')];if(!_0x5c6939['query'][_0xb3d1('0x38')](_0xb3d1('0x39'))){_0x1dd68a['limit']=qs['limit'](_0x5c6939['query']['limit']);_0x1dd68a[_0xb3d1('0x19')]=qs[_0xb3d1('0x19')](_0x5c6939['query'][_0xb3d1('0x19')]);}return _0x45dcba[_0xb3d1('0x4a')](_0x1dd68a);}})['then'](function(_0x854847){if(_0x854847){return _0x854847?{'count':_0x2b7f92,'rows':_0x854847}:null;}})[_0xb3d1('0x23')](respondWithResult(_0x2901e0,null))[_0xb3d1('0x48')](handleError(_0x2901e0,null));};exports[_0xb3d1('0x4c')]=function(_0x4584de,_0x3d840e,_0xe0400c){if(_0x4584de[_0xb3d1('0x47')]['id']){delete _0x4584de['body']['id'];}return db[_0xb3d1('0x2c')][_0xb3d1('0x4d')]({'where':{'id':_0x4584de['params']['id']}})[_0xb3d1('0x23')](handleEntityNotFound(_0x3d840e,null))[_0xb3d1('0x23')](function(_0x179efc){if(_0x179efc){_0x4584de['body'][_0xb3d1('0x4e')]=_0x179efc['id'];_0x4584de[_0xb3d1('0x47')][_0xb3d1('0x4f')]=integrations[_0xb3d1('0x50')](_0x4584de[_0xb3d1('0x47')]['channel'],_0x4584de['body'][_0xb3d1('0x2f')]);_0x4584de['body']['Descriptions']=integrations['getDescriptions'](_0x4584de[_0xb3d1('0x47')][_0xb3d1('0x51')],_0x4584de[_0xb3d1('0x47')][_0xb3d1('0x2f')]);return db[_0xb3d1('0x52')]['create'](_0x4584de[_0xb3d1('0x47')],{'include':[{'model':db[_0xb3d1('0x53')],'as':_0xb3d1('0x4f')},{'model':db[_0xb3d1('0x53')],'as':_0xb3d1('0x54')}]});}return null;})[_0xb3d1('0x23')](respondWithResult(_0x3d840e,null))[_0xb3d1('0x48')](handleError(_0x3d840e,null));};exports[_0xb3d1('0x55')]=function(_0x5e9625,_0x3448b0,_0x502cfe){var _0x217212='';var _0x97b4d8='';return db[_0xb3d1('0x2c')][_0xb3d1('0x4d')]({'where':{'id':_0x5e9625[_0xb3d1('0x44')]['id']},'attributes':['id',_0xb3d1('0x56'),_0xb3d1('0x57'),_0xb3d1('0x58')]})[_0xb3d1('0x23')](handleEntityNotFound(_0x3448b0,null))['then'](function(_0x4832dc){if(_0x4832dc){_0x97b4d8=_0x4832dc[_0xb3d1('0x56')];_0x217212=_0x4832dc['remoteUri'];var _0x5b4f38=_0x4832dc[_0xb3d1('0x57')][_0xb3d1('0x59')](-0x1);if(_0x5b4f38==='/'){_0x217212=_0x217212[_0xb3d1('0x5a')](0x0,_0x217212[_0xb3d1('0x5b')](_0x5b4f38));}return rp({'method':_0xb3d1('0x5c'),'uri':util[_0xb3d1('0x5d')](_0xb3d1('0x5e'),_0x217212,'/api/selector/owners'),'headers':{'Authorization':_0xb3d1('0x5f')+_0x4832dc['apiKey']},'json':!![]});}})['then'](function(_0x175942){if(_0x175942){var _0x222f96=_0x175942[_0xb3d1('0x60')];var _0x577a42=![];var _0x25089c=null;for(_0x25089c=0x0;_0x25089c<_0x222f96[_0xb3d1('0x37')];_0x25089c++){if(_0x222f96[_0x25089c][_0xb3d1('0x61')]===_0x97b4d8){_0x577a42=!![];}}if(_0x577a42){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb3d1('0x62')});}}})[_0xb3d1('0x23')](respondWithResult(_0x3448b0,null))[_0xb3d1('0x48')](function(_0x26cb8f){var _0x23da80=_0x5e9625[_0xb3d1('0x32')]['test']?0x1f4:_0x26cb8f[_0xb3d1('0x63')]||0x1f4;logger[_0xb3d1('0x27')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x23da80,JSON[_0xb3d1('0x64')](_0x26cb8f));delete _0x26cb8f['name'];if(_0x23da80===0x191){_0x23da80=0x190;}_0x3448b0[_0xb3d1('0x18')](_0x23da80)[_0xb3d1('0x2a')](_0x5e9625[_0xb3d1('0x32')][_0xb3d1('0x65')]?{'message':'Wrong\x20credentials','statusCode':_0x26cb8f['statusCode']}:_0x26cb8f);});}; \ No newline at end of file +var _0x19b0=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','findOne','getConfigurations','AccountId','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x19b0,0xbf));var _0x019b=function(_0x489038,_0x54b469){_0x489038=_0x489038-0x0;var _0x4bd286=_0x19b0[_0x489038];return _0x4bd286;};'use strict';var emlformat=require(_0x019b('0x0'));var rimraf=require(_0x019b('0x1'));var zipdir=require(_0x019b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x019b('0x3'));var moment=require(_0x019b('0x4'));var BPromise=require(_0x019b('0x5'));var Mustache=require(_0x019b('0x6'));var util=require(_0x019b('0x7'));var path=require(_0x019b('0x8'));var sox=require(_0x019b('0x9'));var csv=require(_0x019b('0xa'));var ejs=require(_0x019b('0xb'));var fs=require('fs');var fs_extra=require(_0x019b('0xc'));var _=require(_0x019b('0xd'));var squel=require(_0x019b('0xe'));var crypto=require('crypto');var jsforce=require(_0x019b('0xf'));var deskjs=require(_0x019b('0x10'));var toCsv=require(_0x019b('0xa'));var querystring=require(_0x019b('0x11'));var Papa=require(_0x019b('0x12'));var Redis=require(_0x019b('0x13'));var authService=require(_0x019b('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x019b('0x15'));var logger=require(_0x019b('0x16'))(_0x019b('0x17'));var utils=require(_0x019b('0x18'));var config=require(_0x019b('0x19'));var licenseUtil=require(_0x019b('0x1a'));var db=require(_0x019b('0x1b'))['db'];var integrations=require(_0x019b('0x1c'));function respondWithStatusCode(_0x20c48e,_0x1c8396){_0x1c8396=_0x1c8396||0xcc;return function(_0x207579){if(_0x207579){return _0x20c48e[_0x019b('0x1d')](_0x1c8396);}return _0x20c48e[_0x019b('0x1e')](_0x1c8396)['end']();};}function respondWithResult(_0xfdf48e,_0x41054e){_0x41054e=_0x41054e||0xc8;return function(_0x5556a6){if(_0x5556a6){return _0xfdf48e[_0x019b('0x1e')](_0x41054e)['json'](_0x5556a6);}};}function respondWithFilteredResult(_0x2303c5,_0xa37b96){return function(_0x468cdd){if(_0x468cdd){var _0x21a529=typeof _0xa37b96[_0x019b('0x1f')]==='undefined'&&typeof _0xa37b96[_0x019b('0x20')]==='undefined';var _0x1613de=_0x468cdd['count'];var _0x40a500=_0x21a529?0x0:_0xa37b96[_0x019b('0x1f')];var _0x20aff8=_0x21a529?_0x468cdd[_0x019b('0x21')]:_0xa37b96[_0x019b('0x1f')]+_0xa37b96['limit'];var _0x54f8d1;if(_0x20aff8>=_0x1613de){_0x20aff8=_0x1613de;_0x54f8d1=0xc8;}else{_0x54f8d1=0xce;}_0x2303c5[_0x019b('0x1e')](_0x54f8d1);return _0x2303c5[_0x019b('0x22')](_0x019b('0x23'),_0x40a500+'-'+_0x20aff8+'/'+_0x1613de)['json'](_0x468cdd);}return null;};}function patchUpdates(_0x7f927a){return function(_0x293746){try{jsonpatch['apply'](_0x293746,_0x7f927a,!![]);}catch(_0x7b709d){return BPromise[_0x019b('0x24')](_0x7b709d);}return _0x293746[_0x019b('0x25')]();};}function saveUpdates(_0x26da45,_0x448b1d){return function(_0x33baba){if(_0x33baba){return _0x33baba[_0x019b('0x26')](_0x26da45)[_0x019b('0x27')](function(_0x2fc096){return _0x2fc096;});}return null;};}function removeEntity(_0xdbcda1,_0x4e02c8){return function(_0x1c74bb){if(_0x1c74bb){return _0x1c74bb[_0x019b('0x28')]()[_0x019b('0x27')](function(){_0xdbcda1[_0x019b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3be02d,_0x15f85b){return function(_0x4ca51e){if(!_0x4ca51e){_0x3be02d[_0x019b('0x1d')](0x194);}return _0x4ca51e;};}function handleError(_0x4c23e1,_0x1129a4){_0x1129a4=_0x1129a4||0x1f4;return function(_0xf628ae){logger[_0x019b('0x29')](_0xf628ae[_0x019b('0x2a')]);if(_0xf628ae[_0x019b('0x2b')]){delete _0xf628ae[_0x019b('0x2b')];}_0x4c23e1['status'](_0x1129a4)[_0x019b('0x2c')](_0xf628ae);};}exports[_0x019b('0x2d')]=function(_0x214dcc,_0x37957d){var _0x477339={},_0x40cdfe={},_0x3608a9={'count':0x0,'rows':[]};var _0x2ff2bc=_[_0x019b('0x2e')](db[_0x019b('0x2f')][_0x019b('0x30')],function(_0x3e97f6){return{'name':_0x3e97f6[_0x019b('0x31')],'type':_0x3e97f6[_0x019b('0x32')][_0x019b('0x33')]};});_0x40cdfe[_0x019b('0x34')]=_[_0x019b('0x2e')](_0x2ff2bc,_0x019b('0x2b'));_0x40cdfe[_0x019b('0x35')]=_[_0x019b('0x36')](_0x214dcc[_0x019b('0x35')]);_0x40cdfe['filters']=_[_0x019b('0x37')](_0x40cdfe['model'],_0x40cdfe[_0x019b('0x35')]);_0x477339[_0x019b('0x38')]=_[_0x019b('0x37')](_0x40cdfe[_0x019b('0x34')],qs[_0x019b('0x39')](_0x214dcc['query'][_0x019b('0x39')]));_0x477339[_0x019b('0x38')]=_0x477339[_0x019b('0x38')]['length']?_0x477339[_0x019b('0x38')]:_0x40cdfe[_0x019b('0x34')];if(!_0x214dcc[_0x019b('0x35')][_0x019b('0x3a')](_0x019b('0x3b'))){_0x477339[_0x019b('0x20')]=qs[_0x019b('0x20')](_0x214dcc[_0x019b('0x35')]['limit']);_0x477339['offset']=qs[_0x019b('0x1f')](_0x214dcc[_0x019b('0x35')][_0x019b('0x1f')]);}_0x477339['order']=qs[_0x019b('0x3c')](_0x214dcc['query'][_0x019b('0x3c')]);_0x477339[_0x019b('0x3d')]=qs[_0x019b('0x3e')](_[_0x019b('0x3f')](_0x214dcc[_0x019b('0x35')],_0x40cdfe[_0x019b('0x3e')]),_0x2ff2bc);if(_0x214dcc['query'][_0x019b('0x40')]){_0x477339[_0x019b('0x3d')]=_['merge'](_0x477339['where'],{'$or':_[_0x019b('0x2e')](_0x2ff2bc,function(_0x545762){if(_0x545762['type']!=='VIRTUAL'){var _0x19c1c5={};_0x19c1c5[_0x545762[_0x019b('0x2b')]]={'$like':'%'+_0x214dcc['query']['filter']+'%'};return _0x19c1c5;}})});}_0x477339=_[_0x019b('0x41')]({},_0x477339,_0x214dcc[_0x019b('0x42')]);var _0x25f0a8={'where':_0x477339[_0x019b('0x3d')]};return db[_0x019b('0x2f')][_0x019b('0x21')](_0x25f0a8)['then'](function(_0x4cde42){_0x3608a9[_0x019b('0x21')]=_0x4cde42;if(_0x214dcc[_0x019b('0x35')][_0x019b('0x43')]){_0x477339['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0x019b('0x44')](_0x477339);})[_0x019b('0x27')](function(_0x494055){_0x3608a9[_0x019b('0x45')]=_0x494055;return _0x3608a9;})[_0x019b('0x27')](respondWithFilteredResult(_0x37957d,_0x477339))[_0x019b('0x46')](handleError(_0x37957d,null));};exports[_0x019b('0x47')]=function(_0x52ee72,_0x2fa5df){var _0x3399c4={'raw':![],'where':{'id':_0x52ee72[_0x019b('0x48')]['id']}},_0x1270d8={};_0x1270d8[_0x019b('0x34')]=_[_0x019b('0x36')](db[_0x019b('0x2f')][_0x019b('0x30')]);_0x1270d8[_0x019b('0x35')]=_[_0x019b('0x36')](_0x52ee72[_0x019b('0x35')]);_0x1270d8[_0x019b('0x3e')]=_['intersection'](_0x1270d8[_0x019b('0x34')],_0x1270d8[_0x019b('0x35')]);_0x3399c4[_0x019b('0x38')]=_[_0x019b('0x37')](_0x1270d8[_0x019b('0x34')],qs[_0x019b('0x39')](_0x52ee72['query'][_0x019b('0x39')]));_0x3399c4['attributes']=_0x3399c4['attributes'][_0x019b('0x49')]?_0x3399c4[_0x019b('0x38')]:_0x1270d8['model'];if(_0x52ee72[_0x019b('0x35')][_0x019b('0x43')]){_0x3399c4['include']=[{'all':!![]}];}_0x3399c4=_[_0x019b('0x41')]({},_0x3399c4,_0x52ee72[_0x019b('0x42')]);return db[_0x019b('0x2f')][_0x019b('0x4a')](_0x3399c4)[_0x019b('0x27')](handleEntityNotFound(_0x2fa5df,null))[_0x019b('0x27')](respondWithResult(_0x2fa5df,null))[_0x019b('0x46')](handleError(_0x2fa5df,null));};exports['create']=function(_0xfa1316,_0x37560b){return db[_0x019b('0x2f')][_0x019b('0x4b')](_0xfa1316[_0x019b('0x4c')],{})[_0x019b('0x27')](respondWithResult(_0x37560b,0xc9))[_0x019b('0x46')](handleError(_0x37560b,null));};exports[_0x019b('0x26')]=function(_0x3ae202,_0x429fb7){if(_0x3ae202[_0x019b('0x4c')]['id']){delete _0x3ae202[_0x019b('0x4c')]['id'];}return db[_0x019b('0x2f')][_0x019b('0x4a')]({'where':{'id':_0x3ae202[_0x019b('0x48')]['id']}})['then'](handleEntityNotFound(_0x429fb7,null))[_0x019b('0x27')](saveUpdates(_0x3ae202['body'],null))[_0x019b('0x27')](respondWithResult(_0x429fb7,null))[_0x019b('0x46')](handleError(_0x429fb7,null));};exports[_0x019b('0x28')]=function(_0x4d8df0,_0x247f94){return db['FreshsalesAccount']['find']({'where':{'id':_0x4d8df0[_0x019b('0x48')]['id']}})[_0x019b('0x27')](handleEntityNotFound(_0x247f94,null))[_0x019b('0x27')](removeEntity(_0x247f94,null))[_0x019b('0x46')](handleError(_0x247f94,null));};exports['getConfigurations']=function(_0x1d25d3,_0x38f887,_0x13bd41){var _0xc9ad92={};var _0x372252={};var _0x2f0baf;var _0x25d33a;return db[_0x019b('0x2f')][_0x019b('0x4d')]({'where':{'id':_0x1d25d3[_0x019b('0x48')]['id']}})[_0x019b('0x27')](handleEntityNotFound(_0x38f887,null))[_0x019b('0x27')](function(_0x2ba8bb){if(_0x2ba8bb){_0x2f0baf=_0x2ba8bb;_0x372252[_0x019b('0x34')]=_[_0x019b('0x36')](db['FreshsalesConfiguration']['rawAttributes']);_0x372252[_0x019b('0x35')]=_['keys'](_0x1d25d3['query']);_0x372252[_0x019b('0x3e')]=_[_0x019b('0x37')](_0x372252[_0x019b('0x34')],_0x372252['query']);_0xc9ad92['attributes']=_[_0x019b('0x37')](_0x372252[_0x019b('0x34')],qs[_0x019b('0x39')](_0x1d25d3[_0x019b('0x35')][_0x019b('0x39')]));_0xc9ad92['attributes']=_0xc9ad92[_0x019b('0x38')][_0x019b('0x49')]?_0xc9ad92[_0x019b('0x38')]:_0x372252[_0x019b('0x34')];_0xc9ad92['order']=qs[_0x019b('0x3c')](_0x1d25d3['query'][_0x019b('0x3c')]);_0xc9ad92[_0x019b('0x3d')]=qs[_0x019b('0x3e')](_[_0x019b('0x3f')](_0x1d25d3[_0x019b('0x35')],_0x372252[_0x019b('0x3e')]));if(_0x1d25d3['query'][_0x019b('0x40')]){_0xc9ad92['where']=_[_0x019b('0x41')](_0xc9ad92[_0x019b('0x3d')],{'$or':_[_0x019b('0x2e')](_0xc9ad92[_0x019b('0x38')],function(_0x4a1594){var _0xd7fbb={};_0xd7fbb[_0x4a1594]={'$like':'%'+_0x1d25d3[_0x019b('0x35')]['filter']+'%'};return _0xd7fbb;})});}_0xc9ad92=_[_0x019b('0x41')]({},_0xc9ad92,_0x1d25d3[_0x019b('0x42')]);return _0x2f0baf[_0x019b('0x4e')](_0xc9ad92);}})[_0x019b('0x27')](function(_0x13e747){if(_0x13e747){_0x25d33a=_0x13e747[_0x019b('0x49')];if(!_0x1d25d3[_0x019b('0x35')][_0x019b('0x3a')](_0x019b('0x3b'))){_0xc9ad92[_0x019b('0x20')]=qs[_0x019b('0x20')](_0x1d25d3[_0x019b('0x35')][_0x019b('0x20')]);_0xc9ad92[_0x019b('0x1f')]=qs[_0x019b('0x1f')](_0x1d25d3[_0x019b('0x35')][_0x019b('0x1f')]);}return _0x2f0baf[_0x019b('0x4e')](_0xc9ad92);}})['then'](function(_0x26f1fa){if(_0x26f1fa){return _0x26f1fa?{'count':_0x25d33a,'rows':_0x26f1fa}:null;}})[_0x019b('0x27')](respondWithResult(_0x38f887,null))[_0x019b('0x46')](handleError(_0x38f887,null));};exports['addConfiguration']=function(_0x44a449,_0xc1fc6b,_0xbfc85d){if(_0x44a449[_0x019b('0x4c')]['id']){delete _0x44a449[_0x019b('0x4c')]['id'];}return db[_0x019b('0x2f')][_0x019b('0x4d')]({'where':{'id':_0x44a449[_0x019b('0x48')]['id']}})[_0x019b('0x27')](handleEntityNotFound(_0xc1fc6b,null))[_0x019b('0x27')](function(_0x5327f3){if(_0x5327f3){_0x44a449[_0x019b('0x4c')][_0x019b('0x4f')]=_0x5327f3['id'];_0x44a449[_0x019b('0x4c')]['Subjects']=integrations['getSubjects'](_0x44a449[_0x019b('0x4c')][_0x019b('0x50')],_0x44a449['body'][_0x019b('0x32')]);_0x44a449[_0x019b('0x4c')][_0x019b('0x51')]=integrations[_0x019b('0x52')](_0x44a449[_0x019b('0x4c')][_0x019b('0x50')],_0x44a449[_0x019b('0x4c')]['type']);return db[_0x019b('0x53')][_0x019b('0x4b')](_0x44a449[_0x019b('0x4c')],{'include':[{'model':db[_0x019b('0x54')],'as':_0x019b('0x55')},{'model':db[_0x019b('0x54')],'as':'Descriptions'}]});}return null;})[_0x019b('0x27')](respondWithResult(_0xc1fc6b,null))[_0x019b('0x46')](handleError(_0xc1fc6b,null));};exports[_0x019b('0x56')]=function(_0x36ea7f,_0x121a8a,_0x260e33){var _0x143dee='';var _0x393695='';return db[_0x019b('0x2f')][_0x019b('0x4d')]({'where':{'id':_0x36ea7f[_0x019b('0x48')]['id']},'attributes':['id',_0x019b('0x57'),'remoteUri',_0x019b('0x58')]})['then'](handleEntityNotFound(_0x121a8a,null))[_0x019b('0x27')](function(_0x1abd31){if(_0x1abd31){_0x393695=_0x1abd31[_0x019b('0x57')];_0x143dee=_0x1abd31[_0x019b('0x59')];var _0x36a516=_0x1abd31[_0x019b('0x59')][_0x019b('0x5a')](-0x1);if(_0x36a516==='/'){_0x143dee=_0x143dee[_0x019b('0x5b')](0x0,_0x143dee[_0x019b('0x5c')](_0x36a516));}return rp({'method':_0x019b('0x5d'),'uri':util['format'](_0x019b('0x5e'),_0x143dee,_0x019b('0x5f')),'headers':{'Authorization':_0x019b('0x60')+_0x1abd31[_0x019b('0x58')]},'json':!![]});}})['then'](function(_0x5862fb){if(_0x5862fb){var _0x153adc=_0x5862fb['users'];var _0x4be09a=![];var _0xa8a739=null;for(_0xa8a739=0x0;_0xa8a739<_0x153adc[_0x019b('0x49')];_0xa8a739++){if(_0x153adc[_0xa8a739][_0x019b('0x61')]===_0x393695){_0x4be09a=!![];}}if(_0x4be09a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x019b('0x62')});}}})[_0x019b('0x27')](respondWithResult(_0x121a8a,null))[_0x019b('0x46')](function(_0x331638){var _0x28166f=_0x36ea7f[_0x019b('0x35')][_0x019b('0x63')]?0x1f4:_0x331638[_0x019b('0x64')]||0x1f4;logger['error'](_0x019b('0x65'),_0x019b('0x56'),_0x28166f,JSON[_0x019b('0x66')](_0x331638));delete _0x331638[_0x019b('0x2b')];if(_0x28166f===0x191){_0x28166f=0x190;}_0x121a8a[_0x019b('0x1e')](_0x28166f)[_0x019b('0x2c')](_0x36ea7f[_0x019b('0x35')][_0x019b('0x63')]?{'message':_0x019b('0x67'),'statusCode':_0x331638[_0x019b('0x64')]}:_0x331638);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6e9db2e..97da018 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 _0x4745=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5865fe,_0x320a58){var _0x28df36=function(_0x5e22e0){while(--_0x5e22e0){_0x5865fe['push'](_0x5865fe['shift']());}};_0x28df36(++_0x320a58);}(_0x4745,0x1e7));var _0x5474=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x4745[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));var integrations=require(_0x5474('0xb'));module['exports']=function(_0x3d1e1,_0x431f81){return _0x3d1e1['define'](_0x5474('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x4431c3,_0x32b598){var _0x5f1caf=function(_0x4fd6eb){while(--_0x4fd6eb){_0x4431c3['push'](_0x4431c3['shift']());}};_0x5f1caf(++_0x32b598);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 31aa846..f747b84 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 _0x4991=['where','attributes','limit','include','map','model','catch','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','findAll','options','raw'];(function(_0x236843,_0x36ada6){var _0x1beb7f=function(_0x4618da){while(--_0x4618da){_0x236843['push'](_0x236843['shift']());}};_0x1beb7f(++_0x36ada6);}(_0x4991,0xf7));var _0x1499=function(_0x47d586,_0x1aff73){_0x47d586=_0x47d586-0x0;var _0x17b936=_0x4991[_0x47d586];return _0x17b936;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}exports[_0x1499('0x15')]=function(_0x1e45a9){var _0x27e533=this;return new Promise(function(_0x5b9859,_0x541477){return db['FreshsalesAccount'][_0x1499('0x16')]({'raw':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'limit':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1b')]||null:null,'include':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')],function(_0x2c7f57){return{'model':db[_0x2c7f57['model']],'as':_0x2c7f57['as'],'attributes':_0x2c7f57[_0x1499('0x1a')],'include':_0x2c7f57[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x2c7f57[_0x1499('0x1c')],function(_0x3968e0){return{'model':db[_0x3968e0[_0x1499('0x1e')]],'as':_0x3968e0['as'],'attributes':_0x3968e0['attributes'],'include':_0x3968e0['include']?_[_0x1499('0x1d')](_0x3968e0[_0x1499('0x1c')],function(_0x3b9259){return{'model':db[_0x3b9259[_0x1499('0x1e')]],'as':_0x3b9259['as'],'attributes':_0x3b9259[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e5ed1){logger['info']('GetFreshsalesAccount',_0x1e45a9);logger['debug'](_0x1499('0x15'),_0x1e45a9,JSON[_0x1499('0x11')](_0x3e5ed1));_0x5b9859(_0x3e5ed1);})[_0x1499('0x1f')](function(_0x1b460b){logger[_0x1499('0x12')](_0x1499('0x15'),_0x1b460b[_0x1499('0x13')],_0x1e45a9);_0x541477(_0x27e533['error'](0x1f4,_0x1b460b[_0x1499('0x13')]));});});};exports[_0x1499('0x20')]=function(_0x39995b){var _0x5b59ea=this;return new Promise(function(_0x2dae84,_0x16466c){return db['FreshsalesAccount'][_0x1499('0x21')]({'raw':_0x39995b[_0x1499('0x17')]?_0x39995b['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'include':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x39995b[_0x1499('0x17')][_0x1499('0x1c')],function(_0x3f4c1a){return{'model':db[_0x3f4c1a[_0x1499('0x1e')]],'as':_0x3f4c1a['as'],'attributes':_0x3f4c1a[_0x1499('0x1a')],'include':_0x3f4c1a[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x3f4c1a[_0x1499('0x1c')],function(_0x29e89e){return{'model':db[_0x29e89e['model']],'as':_0x29e89e['as'],'attributes':_0x29e89e[_0x1499('0x1a')],'include':_0x29e89e[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x29e89e[_0x1499('0x1c')],function(_0x31251c){return{'model':db[_0x31251c[_0x1499('0x1e')]],'as':_0x31251c['as'],'attributes':_0x31251c[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1499('0xc')](function(_0x12cf93){logger[_0x1499('0xd')](_0x1499('0x20'),_0x39995b);logger['debug']('ShowFreshsalesAccount',_0x39995b,JSON[_0x1499('0x11')](_0x12cf93));_0x2dae84(_0x12cf93);})['catch'](function(_0x29bb8f){logger['error'](_0x1499('0x20'),_0x29bb8f[_0x1499('0x13')],_0x39995b);_0x16466c(_0x5b59ea[_0x1499('0x12')](0x1f4,_0x29bb8f[_0x1499('0x13')]));});});}; \ No newline at end of file +var _0xafb9=['ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','map','attributes','include','model','debug'];(function(_0x50c389,_0x5f5cc7){var _0x59de09=function(_0x58ef92){while(--_0x58ef92){_0x50c389['push'](_0x50c389['shift']());}};_0x59de09(++_0x5f5cc7);}(_0xafb9,0x68));var _0x9afb=function(_0x509da5,_0x50bafe){_0x509da5=_0x509da5-0x0;var _0x468a7d=_0xafb9[_0x509da5];return _0x468a7d;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});}exports[_0x9afb('0x15')]=function(_0x508433){var _0x201ff4=this;return new Promise(function(_0x50a7e4,_0x3fdb34){return db[_0x9afb('0x16')]['findAll']({'raw':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')][_0x9afb('0x19')]||null:null,'attributes':_0x508433['options']?_0x508433[_0x9afb('0x17')]['attributes']||null:null,'limit':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x1a')]||null:null,'include':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')]['include']?_[_0x9afb('0x1b')](_0x508433[_0x9afb('0x17')]['include'],function(_0x571bd9){return{'model':db[_0x571bd9['model']],'as':_0x571bd9['as'],'attributes':_0x571bd9[_0x9afb('0x1c')],'include':_0x571bd9['include']?_[_0x9afb('0x1b')](_0x571bd9[_0x9afb('0x1d')],function(_0x50a919){return{'model':db[_0x50a919[_0x9afb('0x1e')]],'as':_0x50a919['as'],'attributes':_0x50a919[_0x9afb('0x1c')],'include':_0x50a919[_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x50a919['include'],function(_0x348255){return{'model':db[_0x348255['model']],'as':_0x348255['as'],'attributes':_0x348255[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5692fa){logger[_0x9afb('0xc')](_0x9afb('0x15'),_0x508433);logger[_0x9afb('0x1f')](_0x9afb('0x15'),_0x508433,JSON[_0x9afb('0xf')](_0x5692fa));_0x50a7e4(_0x5692fa);})[_0x9afb('0x14')](function(_0x46673d){logger['error']('GetFreshsalesAccount',_0x46673d[_0x9afb('0x12')],_0x508433);_0x3fdb34(_0x201ff4[_0x9afb('0x10')](0x1f4,_0x46673d['message']));});});};exports[_0x9afb('0x20')]=function(_0x2f388c){var _0x5560bd=this;return new Promise(function(_0x1b9f18,_0xc220e9){return db[_0x9afb('0x16')][_0x9afb('0x21')]({'raw':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x2f388c[_0x9afb('0x17')]?_0x2f388c['options']['where']||null:null,'attributes':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1c')]||null:null,'include':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x2f388c['options']['include'],function(_0x67d63a){return{'model':db[_0x67d63a[_0x9afb('0x1e')]],'as':_0x67d63a['as'],'attributes':_0x67d63a['attributes'],'include':_0x67d63a[_0x9afb('0x1d')]?_['map'](_0x67d63a[_0x9afb('0x1d')],function(_0xc59d55){return{'model':db[_0xc59d55['model']],'as':_0xc59d55['as'],'attributes':_0xc59d55[_0x9afb('0x1c')],'include':_0xc59d55['include']?_[_0x9afb('0x1b')](_0xc59d55[_0x9afb('0x1d')],function(_0x45c57f){return{'model':db[_0x45c57f[_0x9afb('0x1e')]],'as':_0x45c57f['as'],'attributes':_0x45c57f[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0xb')](function(_0x19227f){logger[_0x9afb('0xc')]('ShowFreshsalesAccount',_0x2f388c);logger[_0x9afb('0x1f')]('ShowFreshsalesAccount',_0x2f388c,JSON[_0x9afb('0xf')](_0x19227f));_0x1b9f18(_0x19227f);})[_0x9afb('0x14')](function(_0x3c5231){logger[_0x9afb('0x10')](_0x9afb('0x20'),_0x3c5231[_0x9afb('0x12')],_0x2f388c);_0xc220e9(_0x5560bd[_0x9afb('0x10')](0x1f4,_0x3c5231[_0x9afb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b9d3b29..e730c8d 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 _0x08ac=['/:id/descriptions','getDescriptions','getFields','post','create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x2d56b6,_0x31c8d7){var _0x5c2c67=function(_0x45f0f2){while(--_0x45f0f2){_0x2d56b6['push'](_0x2d56b6['shift']());}};_0x5c2c67(++_0x31c8d7);}(_0x08ac,0x1d5));var _0xc08a=function(_0x14fd3d,_0x5904b2){_0x14fd3d=_0x14fd3d-0x0;var _0x182c4d=_0x08ac[_0x14fd3d];return _0x182c4d;};'use strict';var multer=require(_0xc08a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc08a('0x1'));var express=require(_0xc08a('0x2'));var router=express[_0xc08a('0x3')]();var fs_extra=require(_0xc08a('0x4'));var auth=require(_0xc08a('0x5'));var interaction=require(_0xc08a('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0xc08a('0x7')]('/',auth[_0xc08a('0x8')](),controller[_0xc08a('0x9')]);router[_0xc08a('0x7')](_0xc08a('0xa'),auth[_0xc08a('0x8')](),controller['show']);router[_0xc08a('0x7')]('/:id/subjects',auth[_0xc08a('0x8')](),controller['getSubjects']);router[_0xc08a('0x7')](_0xc08a('0xb'),auth[_0xc08a('0x8')](),controller[_0xc08a('0xc')]);router['get']('/:id/fields',auth[_0xc08a('0x8')](),controller[_0xc08a('0xd')]);router[_0xc08a('0xe')]('/',auth[_0xc08a('0x8')](),controller[_0xc08a('0xf')]);router['put']('/:id',auth[_0xc08a('0x8')](),controller[_0xc08a('0x10')]);router[_0xc08a('0x11')](_0xc08a('0xa'),auth[_0xc08a('0x8')](),controller[_0xc08a('0x12')]);module[_0xc08a('0x13')]=router; \ No newline at end of file +var _0xc92f=['../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x72c396,_0x110635){var _0x19e821=function(_0x55b439){while(--_0x55b439){_0x72c396['push'](_0x72c396['shift']());}};_0x19e821(++_0x110635);}(_0xc92f,0x1d4));var _0xfc92=function(_0x4e01ef,_0x575f94){_0x4e01ef=_0x4e01ef-0x0;var _0x56ae50=_0xc92f[_0x4e01ef];return _0x56ae50;};'use strict';var multer=require(_0xfc92('0x0'));var util=require(_0xfc92('0x1'));var path=require(_0xfc92('0x2'));var timeout=require(_0xfc92('0x3'));var express=require(_0xfc92('0x4'));var router=express[_0xfc92('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc92('0x6'));var config=require(_0xfc92('0x7'));var controller=require(_0xfc92('0x8'));router[_0xfc92('0x9')]('/',auth[_0xfc92('0xa')](),controller[_0xfc92('0xb')]);router[_0xfc92('0x9')](_0xfc92('0xc'),auth['isAuthenticated'](),controller[_0xfc92('0xd')]);router['get'](_0xfc92('0xe'),auth[_0xfc92('0xa')](),controller[_0xfc92('0xf')]);router['get'](_0xfc92('0x10'),auth[_0xfc92('0xa')](),controller[_0xfc92('0x11')]);router['get'](_0xfc92('0x12'),auth[_0xfc92('0xa')](),controller[_0xfc92('0x13')]);router[_0xfc92('0x14')]('/',auth[_0xfc92('0xa')](),controller['create']);router['put'](_0xfc92('0xc'),auth[_0xfc92('0xa')](),controller[_0xfc92('0x15')]);router[_0xfc92('0x16')](_0xfc92('0xc'),auth['isAuthenticated'](),controller[_0xfc92('0x17')]);module[_0xfc92('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index e9409a0..159361e 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 _0x8912=['STRING','exports'];(function(_0x5793a8,_0x1a6d12){var _0x2b58f5=function(_0x5b8b75){while(--_0x5b8b75){_0x5793a8['push'](_0x5793a8['shift']());}};_0x2b58f5(++_0x1a6d12);}(_0x8912,0xc3));var _0x2891=function(_0x396a32,_0x1197dc){_0x396a32=_0x396a32-0x0;var _0x200557=_0x8912[_0x396a32];return _0x200557;};'use strict';var Sequelize=require('sequelize');module[_0x2891('0x0')]={'name':{'type':Sequelize[_0x2891('0x1')]},'description':{'type':Sequelize[_0x2891('0x1')]}}; \ No newline at end of file +var _0x40db=['sequelize','exports','STRING'];(function(_0x118fd1,_0x23605d){var _0x5f5742=function(_0x5af907){while(--_0x5af907){_0x118fd1['push'](_0x118fd1['shift']());}};_0x5f5742(++_0x23605d);}(_0x40db,0x1b6));var _0xb40d=function(_0x922e81,_0x48da6f){_0x922e81=_0x922e81-0x0;var _0x5880a1=_0x40db[_0x922e81];return _0x5880a1;};'use strict';var Sequelize=require(_0xb40d('0x0'));module[_0xb40d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb40d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 9c8e3bf..29419b2 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 _0x5358=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xb4ce16,_0x2bd30c){var _0x14055c=function(_0x16909e){while(--_0x16909e){_0xb4ce16['push'](_0xb4ce16['shift']());}};_0x14055c(++_0x2bd30c);}(_0x5358,0x18b));var _0x8535=function(_0x58769b,_0x1b5fb8){_0x58769b=_0x58769b-0x0;var _0x2e3894=_0x5358[_0x58769b];return _0x2e3894;};'use strict';var emlformat=require(_0x8535('0x0'));var rimraf=require(_0x8535('0x1'));var zipdir=require(_0x8535('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8535('0x3'));var BPromise=require(_0x8535('0x4'));var Mustache=require(_0x8535('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8535('0x6'));var csv=require('to-csv');var ejs=require(_0x8535('0x7'));var fs=require('fs');var fs_extra=require(_0x8535('0x8'));var _=require(_0x8535('0x9'));var squel=require(_0x8535('0xa'));var crypto=require('crypto');var jsforce=require(_0x8535('0xb'));var deskjs=require(_0x8535('0xc'));var toCsv=require(_0x8535('0xd'));var querystring=require(_0x8535('0xe'));var Papa=require(_0x8535('0xf'));var Redis=require(_0x8535('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8535('0x11'));var as=require(_0x8535('0x12'));var hardwareService=require(_0x8535('0x13'));var logger=require(_0x8535('0x14'))(_0x8535('0x15'));var utils=require('../../config/utils');var config=require(_0x8535('0x16'));var licenseUtil=require(_0x8535('0x17'));var db=require(_0x8535('0x18'))['db'];function respondWithStatusCode(_0x548f16,_0x1da003){_0x1da003=_0x1da003||0xcc;return function(_0x3319cd){if(_0x3319cd){return _0x548f16[_0x8535('0x19')](_0x1da003);}return _0x548f16[_0x8535('0x1a')](_0x1da003)['end']();};}function respondWithResult(_0x3e40b3,_0x9c3fb1){_0x9c3fb1=_0x9c3fb1||0xc8;return function(_0x59769e){if(_0x59769e){return _0x3e40b3[_0x8535('0x1a')](_0x9c3fb1)[_0x8535('0x1b')](_0x59769e);}};}function respondWithFilteredResult(_0x343bac,_0x27dd42){return function(_0x178a6d){if(_0x178a6d){var _0x2d3ad4=typeof _0x27dd42['offset']===_0x8535('0x1c')&&typeof _0x27dd42[_0x8535('0x1d')]===_0x8535('0x1c');var _0x7d7fd6=_0x178a6d[_0x8535('0x1e')];var _0x5cdf8a=_0x2d3ad4?0x0:_0x27dd42['offset'];var _0x3306cd=_0x2d3ad4?_0x178a6d[_0x8535('0x1e')]:_0x27dd42['offset']+_0x27dd42['limit'];var _0x11f909;if(_0x3306cd>=_0x7d7fd6){_0x3306cd=_0x7d7fd6;_0x11f909=0xc8;}else{_0x11f909=0xce;}_0x343bac[_0x8535('0x1a')](_0x11f909);return _0x343bac[_0x8535('0x1f')](_0x8535('0x20'),_0x5cdf8a+'-'+_0x3306cd+'/'+_0x7d7fd6)['json'](_0x178a6d);}return null;};}function patchUpdates(_0x2d9ce6){return function(_0x245f68){try{jsonpatch[_0x8535('0x21')](_0x245f68,_0x2d9ce6,!![]);}catch(_0x1ab9a2){return BPromise[_0x8535('0x22')](_0x1ab9a2);}return _0x245f68['save']();};}function saveUpdates(_0x46f9b3,_0x3dae4b){return function(_0x5b3d24){if(_0x5b3d24){return _0x5b3d24[_0x8535('0x23')](_0x46f9b3)[_0x8535('0x24')](function(_0x62a768){return _0x62a768;});}return null;};}function removeEntity(_0x2d9b71,_0x17a070){return function(_0x3032bf){if(_0x3032bf){return _0x3032bf[_0x8535('0x25')]()[_0x8535('0x24')](function(){_0x2d9b71['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a484f,_0x7c2819){return function(_0x106839){if(!_0x106839){_0x5a484f[_0x8535('0x19')](0x194);}return _0x106839;};}function handleError(_0xa6435c,_0x43c358){_0x43c358=_0x43c358||0x1f4;return function(_0xe21889){logger[_0x8535('0x26')](_0xe21889[_0x8535('0x27')]);if(_0xe21889[_0x8535('0x28')]){delete _0xe21889[_0x8535('0x28')];}_0xa6435c[_0x8535('0x1a')](_0x43c358)[_0x8535('0x29')](_0xe21889);};}exports[_0x8535('0x2a')]=function(_0x5f4281,_0xe7cbd8){var _0x3f46d8={},_0x2ba3d8={},_0x42302e={'count':0x0,'rows':[]};var _0x4fa589=_[_0x8535('0x2b')](db[_0x8535('0x2c')]['rawAttributes'],function(_0x4d0c7a){return{'name':_0x4d0c7a[_0x8535('0x2d')],'type':_0x4d0c7a[_0x8535('0x2e')][_0x8535('0x2f')]};});_0x2ba3d8[_0x8535('0x30')]=_[_0x8535('0x2b')](_0x4fa589,_0x8535('0x28'));_0x2ba3d8['query']=_['keys'](_0x5f4281[_0x8535('0x31')]);_0x2ba3d8['filters']=_[_0x8535('0x32')](_0x2ba3d8['model'],_0x2ba3d8[_0x8535('0x31')]);_0x3f46d8['attributes']=_['intersection'](_0x2ba3d8[_0x8535('0x30')],qs[_0x8535('0x33')](_0x5f4281['query'][_0x8535('0x33')]));_0x3f46d8['attributes']=_0x3f46d8[_0x8535('0x34')][_0x8535('0x35')]?_0x3f46d8[_0x8535('0x34')]:_0x2ba3d8[_0x8535('0x30')];if(!_0x5f4281[_0x8535('0x31')]['hasOwnProperty'](_0x8535('0x36'))){_0x3f46d8['limit']=qs['limit'](_0x5f4281[_0x8535('0x31')][_0x8535('0x1d')]);_0x3f46d8[_0x8535('0x37')]=qs[_0x8535('0x37')](_0x5f4281[_0x8535('0x31')]['offset']);}_0x3f46d8[_0x8535('0x38')]=qs[_0x8535('0x39')](_0x5f4281['query'][_0x8535('0x39')]);_0x3f46d8[_0x8535('0x3a')]=qs[_0x8535('0x3b')](_[_0x8535('0x3c')](_0x5f4281[_0x8535('0x31')],_0x2ba3d8[_0x8535('0x3b')]),_0x4fa589);if(_0x5f4281['query'][_0x8535('0x3d')]){_0x3f46d8['where']=_[_0x8535('0x3e')](_0x3f46d8[_0x8535('0x3a')],{'$or':_[_0x8535('0x2b')](_0x4fa589,function(_0x374a78){if(_0x374a78[_0x8535('0x2e')]!==_0x8535('0x3f')){var _0x42f7b0={};_0x42f7b0[_0x374a78[_0x8535('0x28')]]={'$like':'%'+_0x5f4281[_0x8535('0x31')]['filter']+'%'};return _0x42f7b0;}})});}_0x3f46d8=_[_0x8535('0x3e')]({},_0x3f46d8,_0x5f4281[_0x8535('0x40')]);var _0x244997={'where':_0x3f46d8[_0x8535('0x3a')]};return db['FreshsalesConfiguration'][_0x8535('0x1e')](_0x244997)[_0x8535('0x24')](function(_0x2bd61b){_0x42302e[_0x8535('0x1e')]=_0x2bd61b;if(_0x5f4281[_0x8535('0x31')][_0x8535('0x41')]){_0x3f46d8[_0x8535('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x8535('0x43')](_0x3f46d8);})[_0x8535('0x24')](function(_0x417362){_0x42302e[_0x8535('0x44')]=_0x417362;return _0x42302e;})[_0x8535('0x24')](respondWithFilteredResult(_0xe7cbd8,_0x3f46d8))[_0x8535('0x45')](handleError(_0xe7cbd8,null));};exports[_0x8535('0x46')]=function(_0x5714dd,_0x20dad7){var _0x3545b5={'raw':![],'where':{'id':_0x5714dd[_0x8535('0x47')]['id']}},_0x5cf304={};_0x5cf304[_0x8535('0x30')]=_[_0x8535('0x48')](db[_0x8535('0x2c')][_0x8535('0x49')]);_0x5cf304['query']=_[_0x8535('0x48')](_0x5714dd['query']);_0x5cf304['filters']=_[_0x8535('0x32')](_0x5cf304[_0x8535('0x30')],_0x5cf304[_0x8535('0x31')]);_0x3545b5[_0x8535('0x34')]=_[_0x8535('0x32')](_0x5cf304[_0x8535('0x30')],qs[_0x8535('0x33')](_0x5714dd[_0x8535('0x31')][_0x8535('0x33')]));_0x3545b5[_0x8535('0x34')]=_0x3545b5[_0x8535('0x34')][_0x8535('0x35')]?_0x3545b5[_0x8535('0x34')]:_0x5cf304[_0x8535('0x30')];if(_0x5714dd[_0x8535('0x31')]['includeAll']){_0x3545b5[_0x8535('0x42')]=[{'all':!![]}];}_0x3545b5=_['merge']({},_0x3545b5,_0x5714dd['options']);return db['FreshsalesConfiguration'][_0x8535('0x4a')](_0x3545b5)['then'](handleEntityNotFound(_0x20dad7,null))['then'](respondWithResult(_0x20dad7,null))['catch'](handleError(_0x20dad7,null));};exports[_0x8535('0x4b')]=function(_0x5458c3,_0x2a1449){return db[_0x8535('0x2c')][_0x8535('0x4b')](_0x5458c3['body'],{})[_0x8535('0x24')](respondWithResult(_0x2a1449,0xc9))['catch'](handleError(_0x2a1449,null));};exports[_0x8535('0x23')]=function(_0x213abf,_0x572c72){if(_0x213abf[_0x8535('0x4c')]['id']){delete _0x213abf[_0x8535('0x4c')]['id'];}return db[_0x8535('0x2c')][_0x8535('0x4a')]({'where':{'id':_0x213abf[_0x8535('0x47')]['id']}})[_0x8535('0x24')](handleEntityNotFound(_0x572c72,null))[_0x8535('0x24')](saveUpdates(_0x213abf[_0x8535('0x4c')],null))[_0x8535('0x24')](respondWithResult(_0x572c72,null))[_0x8535('0x45')](handleError(_0x572c72,null));};exports[_0x8535('0x25')]=function(_0x25ced3,_0x4848a7){return db[_0x8535('0x2c')][_0x8535('0x4a')]({'where':{'id':_0x25ced3[_0x8535('0x47')]['id']}})['then'](handleEntityNotFound(_0x4848a7,null))[_0x8535('0x24')](removeEntity(_0x4848a7,null))[_0x8535('0x45')](handleError(_0x4848a7,null));};exports[_0x8535('0x4d')]=function(_0x36cc77,_0x33bb51,_0x1c665f){var _0xcb198={};var _0x1d7ec1={};var _0x351ab0;var _0x347302;return db['FreshsalesConfiguration'][_0x8535('0x4e')]({'where':{'id':_0x36cc77[_0x8535('0x47')]['id']}})[_0x8535('0x24')](handleEntityNotFound(_0x33bb51,null))[_0x8535('0x24')](function(_0x244534){if(_0x244534){_0x351ab0=_0x244534;_0x1d7ec1['model']=_[_0x8535('0x48')](db[_0x8535('0x4f')][_0x8535('0x49')]);_0x1d7ec1['query']=_[_0x8535('0x48')](_0x36cc77['query']);_0x1d7ec1[_0x8535('0x3b')]=_[_0x8535('0x32')](_0x1d7ec1['model'],_0x1d7ec1['query']);_0xcb198[_0x8535('0x34')]=_[_0x8535('0x32')](_0x1d7ec1[_0x8535('0x30')],qs[_0x8535('0x33')](_0x36cc77[_0x8535('0x31')][_0x8535('0x33')]));_0xcb198[_0x8535('0x34')]=_0xcb198[_0x8535('0x34')][_0x8535('0x35')]?_0xcb198[_0x8535('0x34')]:_0x1d7ec1[_0x8535('0x30')];_0xcb198['order']=qs[_0x8535('0x39')](_0x36cc77['query'][_0x8535('0x39')]);_0xcb198[_0x8535('0x3a')]=qs[_0x8535('0x3b')](_[_0x8535('0x3c')](_0x36cc77[_0x8535('0x31')],_0x1d7ec1[_0x8535('0x3b')]));if(_0x36cc77[_0x8535('0x31')][_0x8535('0x3d')]){_0xcb198[_0x8535('0x3a')]=_[_0x8535('0x3e')](_0xcb198['where'],{'$or':_[_0x8535('0x2b')](_0xcb198[_0x8535('0x34')],function(_0x4df127){var _0x550e36={};_0x550e36[_0x4df127]={'$like':'%'+_0x36cc77[_0x8535('0x31')][_0x8535('0x3d')]+'%'};return _0x550e36;})});}_0xcb198=_[_0x8535('0x3e')]({},_0xcb198,_0x36cc77[_0x8535('0x40')]);return _0x351ab0[_0x8535('0x4d')](_0xcb198);}})['then'](function(_0x5cf46b){if(_0x5cf46b){_0x347302=_0x5cf46b['length'];if(!_0x36cc77[_0x8535('0x31')][_0x8535('0x50')](_0x8535('0x36'))){_0xcb198[_0x8535('0x1d')]=qs[_0x8535('0x1d')](_0x36cc77[_0x8535('0x31')][_0x8535('0x1d')]);_0xcb198[_0x8535('0x37')]=qs[_0x8535('0x37')](_0x36cc77['query'][_0x8535('0x37')]);}return _0x351ab0[_0x8535('0x4d')](_0xcb198);}})[_0x8535('0x24')](function(_0x36ff9f){if(_0x36ff9f){return _0x36ff9f?{'count':_0x347302,'rows':_0x36ff9f}:null;}})[_0x8535('0x24')](respondWithResult(_0x33bb51,null))['catch'](handleError(_0x33bb51,null));};exports[_0x8535('0x51')]=function(_0x3f16fb,_0x1f4d27,_0x1fae06){var _0x1dd51e={};var _0x3ffdf7={};var _0x50e94e;var _0x2191fd;return db[_0x8535('0x2c')]['findOne']({'where':{'id':_0x3f16fb[_0x8535('0x47')]['id']}})[_0x8535('0x24')](handleEntityNotFound(_0x1f4d27,null))[_0x8535('0x24')](function(_0x14389f){if(_0x14389f){_0x50e94e=_0x14389f;_0x3ffdf7[_0x8535('0x30')]=_[_0x8535('0x48')](db[_0x8535('0x4f')]['rawAttributes']);_0x3ffdf7[_0x8535('0x31')]=_[_0x8535('0x48')](_0x3f16fb['query']);_0x3ffdf7[_0x8535('0x3b')]=_[_0x8535('0x32')](_0x3ffdf7[_0x8535('0x30')],_0x3ffdf7[_0x8535('0x31')]);_0x1dd51e['attributes']=_[_0x8535('0x32')](_0x3ffdf7[_0x8535('0x30')],qs['fields'](_0x3f16fb[_0x8535('0x31')]['fields']));_0x1dd51e['attributes']=_0x1dd51e[_0x8535('0x34')][_0x8535('0x35')]?_0x1dd51e[_0x8535('0x34')]:_0x3ffdf7['model'];_0x1dd51e['order']=qs['sort'](_0x3f16fb['query']['sort']);_0x1dd51e[_0x8535('0x3a')]=qs[_0x8535('0x3b')](_['pick'](_0x3f16fb[_0x8535('0x31')],_0x3ffdf7[_0x8535('0x3b')]));if(_0x3f16fb[_0x8535('0x31')]['filter']){_0x1dd51e[_0x8535('0x3a')]=_[_0x8535('0x3e')](_0x1dd51e['where'],{'$or':_[_0x8535('0x2b')](_0x1dd51e[_0x8535('0x34')],function(_0x324bfd){var _0x3c899f={};_0x3c899f[_0x324bfd]={'$like':'%'+_0x3f16fb[_0x8535('0x31')]['filter']+'%'};return _0x3c899f;})});}_0x1dd51e=_[_0x8535('0x3e')]({},_0x1dd51e,_0x3f16fb[_0x8535('0x40')]);return _0x50e94e[_0x8535('0x51')](_0x1dd51e);}})[_0x8535('0x24')](function(_0x1dad3){if(_0x1dad3){_0x2191fd=_0x1dad3[_0x8535('0x35')];if(!_0x3f16fb[_0x8535('0x31')]['hasOwnProperty']('nolimit')){_0x1dd51e[_0x8535('0x1d')]=qs[_0x8535('0x1d')](_0x3f16fb[_0x8535('0x31')][_0x8535('0x1d')]);_0x1dd51e[_0x8535('0x37')]=qs[_0x8535('0x37')](_0x3f16fb[_0x8535('0x31')][_0x8535('0x37')]);}return _0x50e94e[_0x8535('0x51')](_0x1dd51e);}})[_0x8535('0x24')](function(_0x19a61d){if(_0x19a61d){return _0x19a61d?{'count':_0x2191fd,'rows':_0x19a61d}:null;}})[_0x8535('0x24')](respondWithResult(_0x1f4d27,null))[_0x8535('0x45')](handleError(_0x1f4d27,null));};exports[_0x8535('0x52')]=function(_0x1427f7,_0x30ff07,_0x3dff35){var _0x4b45c4={};var _0x40a237={};var _0x1afe18;var _0x2aadba;return db[_0x8535('0x2c')][_0x8535('0x4e')]({'where':{'id':_0x1427f7[_0x8535('0x47')]['id']}})['then'](handleEntityNotFound(_0x30ff07,null))[_0x8535('0x24')](function(_0x3e2ea7){if(_0x3e2ea7){_0x1afe18=_0x3e2ea7;_0x40a237[_0x8535('0x30')]=_[_0x8535('0x48')](db['FreshsalesField'][_0x8535('0x49')]);_0x40a237[_0x8535('0x31')]=_[_0x8535('0x48')](_0x1427f7[_0x8535('0x31')]);_0x40a237['filters']=_['intersection'](_0x40a237['model'],_0x40a237['query']);_0x4b45c4[_0x8535('0x34')]=_[_0x8535('0x32')](_0x40a237[_0x8535('0x30')],qs['fields'](_0x1427f7[_0x8535('0x31')][_0x8535('0x33')]));_0x4b45c4[_0x8535('0x34')]=_0x4b45c4[_0x8535('0x34')][_0x8535('0x35')]?_0x4b45c4['attributes']:_0x40a237['model'];_0x4b45c4[_0x8535('0x38')]=qs['sort'](_0x1427f7[_0x8535('0x31')][_0x8535('0x39')]);_0x4b45c4['where']=qs[_0x8535('0x3b')](_['pick'](_0x1427f7[_0x8535('0x31')],_0x40a237['filters']));if(_0x1427f7['query'][_0x8535('0x3d')]){_0x4b45c4[_0x8535('0x3a')]=_[_0x8535('0x3e')](_0x4b45c4[_0x8535('0x3a')],{'$or':_[_0x8535('0x2b')](_0x4b45c4[_0x8535('0x34')],function(_0x33a383){var _0x130810={};_0x130810[_0x33a383]={'$like':'%'+_0x1427f7['query']['filter']+'%'};return _0x130810;})});}_0x4b45c4=_[_0x8535('0x3e')]({},_0x4b45c4,_0x1427f7[_0x8535('0x40')]);return _0x1afe18[_0x8535('0x52')](_0x4b45c4);}})['then'](function(_0x5104c6){if(_0x5104c6){_0x2aadba=_0x5104c6[_0x8535('0x35')];if(!_0x1427f7['query'][_0x8535('0x50')](_0x8535('0x36'))){_0x4b45c4['limit']=qs['limit'](_0x1427f7[_0x8535('0x31')][_0x8535('0x1d')]);_0x4b45c4[_0x8535('0x37')]=qs[_0x8535('0x37')](_0x1427f7['query']['offset']);}return _0x1afe18['getFields'](_0x4b45c4);}})[_0x8535('0x24')](function(_0x437268){if(_0x437268){return _0x437268?{'count':_0x2aadba,'rows':_0x437268}:null;}})['then'](respondWithResult(_0x30ff07,null))[_0x8535('0x45')](handleError(_0x30ff07,null));}; \ No newline at end of file +var _0x3c4c=['show','params','find','create','body','destroy','sort','options','getDescriptions','FreshsalesField','getFields','findOne','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','VIRTUAL','merge','includeAll','include','rows','catch'];(function(_0x6e08ed,_0x439b56){var _0x4e1198=function(_0x574b63){while(--_0x574b63){_0x6e08ed['push'](_0x6e08ed['shift']());}};_0x4e1198(++_0x439b56);}(_0x3c4c,0x192));var _0xc3c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3c4c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc3c4('0x0'));var rimraf=require(_0xc3c4('0x1'));var zipdir=require(_0xc3c4('0x2'));var jsonpatch=require(_0xc3c4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc3c4('0x4'));var util=require(_0xc3c4('0x5'));var path=require(_0xc3c4('0x6'));var sox=require('sox');var csv=require(_0xc3c4('0x7'));var ejs=require(_0xc3c4('0x8'));var fs=require('fs');var fs_extra=require(_0xc3c4('0x9'));var _=require(_0xc3c4('0xa'));var squel=require('squel');var crypto=require(_0xc3c4('0xb'));var jsforce=require(_0xc3c4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc3c4('0x7'));var querystring=require(_0xc3c4('0xd'));var Papa=require(_0xc3c4('0xe'));var Redis=require(_0xc3c4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c4('0x11'))(_0xc3c4('0x12'));var utils=require(_0xc3c4('0x13'));var config=require(_0xc3c4('0x14'));var licenseUtil=require(_0xc3c4('0x15'));var db=require(_0xc3c4('0x16'))['db'];function respondWithStatusCode(_0x1c7b5d,_0x24d138){_0x24d138=_0x24d138||0xcc;return function(_0x1c277b){if(_0x1c277b){return _0x1c7b5d[_0xc3c4('0x17')](_0x24d138);}return _0x1c7b5d['status'](_0x24d138)[_0xc3c4('0x18')]();};}function respondWithResult(_0x4b96fa,_0x344d27){_0x344d27=_0x344d27||0xc8;return function(_0x2054d6){if(_0x2054d6){return _0x4b96fa[_0xc3c4('0x19')](_0x344d27)[_0xc3c4('0x1a')](_0x2054d6);}};}function respondWithFilteredResult(_0x43b629,_0x45c988){return function(_0x20bd9b){if(_0x20bd9b){var _0x35644c=typeof _0x45c988[_0xc3c4('0x1b')]===_0xc3c4('0x1c')&&typeof _0x45c988[_0xc3c4('0x1d')]===_0xc3c4('0x1c');var _0x2a9860=_0x20bd9b['count'];var _0x349a4e=_0x35644c?0x0:_0x45c988[_0xc3c4('0x1b')];var _0xebf96a=_0x35644c?_0x20bd9b[_0xc3c4('0x1e')]:_0x45c988[_0xc3c4('0x1b')]+_0x45c988[_0xc3c4('0x1d')];var _0x18aa75;if(_0xebf96a>=_0x2a9860){_0xebf96a=_0x2a9860;_0x18aa75=0xc8;}else{_0x18aa75=0xce;}_0x43b629[_0xc3c4('0x19')](_0x18aa75);return _0x43b629['set'](_0xc3c4('0x1f'),_0x349a4e+'-'+_0xebf96a+'/'+_0x2a9860)[_0xc3c4('0x1a')](_0x20bd9b);}return null;};}function patchUpdates(_0x26784c){return function(_0x162c8b){try{jsonpatch[_0xc3c4('0x20')](_0x162c8b,_0x26784c,!![]);}catch(_0x47ffb3){return BPromise[_0xc3c4('0x21')](_0x47ffb3);}return _0x162c8b[_0xc3c4('0x22')]();};}function saveUpdates(_0x7a2b43,_0x35a6c2){return function(_0x55f3f5){if(_0x55f3f5){return _0x55f3f5[_0xc3c4('0x23')](_0x7a2b43)[_0xc3c4('0x24')](function(_0x2c74d9){return _0x2c74d9;});}return null;};}function removeEntity(_0x229596,_0xe629a0){return function(_0x2ce5a5){if(_0x2ce5a5){return _0x2ce5a5['destroy']()[_0xc3c4('0x24')](function(){_0x229596[_0xc3c4('0x19')](0xcc)[_0xc3c4('0x18')]();});}};}function handleEntityNotFound(_0x3bf4ef,_0x453b8f){return function(_0x5c9a2a){if(!_0x5c9a2a){_0x3bf4ef[_0xc3c4('0x17')](0x194);}return _0x5c9a2a;};}function handleError(_0x578c10,_0x1bb654){_0x1bb654=_0x1bb654||0x1f4;return function(_0x47b2c0){logger[_0xc3c4('0x25')](_0x47b2c0['stack']);if(_0x47b2c0[_0xc3c4('0x26')]){delete _0x47b2c0[_0xc3c4('0x26')];}_0x578c10['status'](_0x1bb654)[_0xc3c4('0x27')](_0x47b2c0);};}exports[_0xc3c4('0x28')]=function(_0x32963b,_0x57a9f8){var _0x2a4f55={},_0x32077d={},_0x395683={'count':0x0,'rows':[]};var _0x52cbb1=_[_0xc3c4('0x29')](db[_0xc3c4('0x2a')][_0xc3c4('0x2b')],function(_0x29d466){return{'name':_0x29d466[_0xc3c4('0x2c')],'type':_0x29d466[_0xc3c4('0x2d')]['key']};});_0x32077d[_0xc3c4('0x2e')]=_['map'](_0x52cbb1,_0xc3c4('0x26'));_0x32077d['query']=_[_0xc3c4('0x2f')](_0x32963b[_0xc3c4('0x30')]);_0x32077d['filters']=_[_0xc3c4('0x31')](_0x32077d[_0xc3c4('0x2e')],_0x32077d[_0xc3c4('0x30')]);_0x2a4f55[_0xc3c4('0x32')]=_[_0xc3c4('0x31')](_0x32077d[_0xc3c4('0x2e')],qs[_0xc3c4('0x33')](_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x33')]));_0x2a4f55[_0xc3c4('0x32')]=_0x2a4f55[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x2a4f55['attributes']:_0x32077d[_0xc3c4('0x2e')];if(!_0x32963b['query'][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x2a4f55[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x1d')]);_0x2a4f55[_0xc3c4('0x1b')]=qs[_0xc3c4('0x1b')](_0x32963b[_0xc3c4('0x30')]['offset']);}_0x2a4f55[_0xc3c4('0x37')]=qs['sort'](_0x32963b[_0xc3c4('0x30')]['sort']);_0x2a4f55[_0xc3c4('0x38')]=qs['filters'](_[_0xc3c4('0x39')](_0x32963b[_0xc3c4('0x30')],_0x32077d[_0xc3c4('0x3a')]),_0x52cbb1);if(_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x3b')]){_0x2a4f55['where']=_['merge'](_0x2a4f55[_0xc3c4('0x38')],{'$or':_[_0xc3c4('0x29')](_0x52cbb1,function(_0x57eeb9){if(_0x57eeb9[_0xc3c4('0x2d')]!==_0xc3c4('0x3c')){var _0x252537={};_0x252537[_0x57eeb9[_0xc3c4('0x26')]]={'$like':'%'+_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x3b')]+'%'};return _0x252537;}})});}_0x2a4f55=_[_0xc3c4('0x3d')]({},_0x2a4f55,_0x32963b['options']);var _0x3df53f={'where':_0x2a4f55[_0xc3c4('0x38')]};return db[_0xc3c4('0x2a')][_0xc3c4('0x1e')](_0x3df53f)[_0xc3c4('0x24')](function(_0x240e46){_0x395683['count']=_0x240e46;if(_0x32963b[_0xc3c4('0x30')][_0xc3c4('0x3e')]){_0x2a4f55[_0xc3c4('0x3f')]=[{'all':!![]}];}return db[_0xc3c4('0x2a')]['findAll'](_0x2a4f55);})[_0xc3c4('0x24')](function(_0x24e577){_0x395683[_0xc3c4('0x40')]=_0x24e577;return _0x395683;})[_0xc3c4('0x24')](respondWithFilteredResult(_0x57a9f8,_0x2a4f55))[_0xc3c4('0x41')](handleError(_0x57a9f8,null));};exports[_0xc3c4('0x42')]=function(_0x5c1c96,_0x392fc4){var _0x3bc526={'raw':![],'where':{'id':_0x5c1c96[_0xc3c4('0x43')]['id']}},_0x469bef={};_0x469bef[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db[_0xc3c4('0x2a')]['rawAttributes']);_0x469bef[_0xc3c4('0x30')]=_[_0xc3c4('0x2f')](_0x5c1c96[_0xc3c4('0x30')]);_0x469bef[_0xc3c4('0x3a')]=_['intersection'](_0x469bef['model'],_0x469bef[_0xc3c4('0x30')]);_0x3bc526['attributes']=_[_0xc3c4('0x31')](_0x469bef['model'],qs[_0xc3c4('0x33')](_0x5c1c96[_0xc3c4('0x30')][_0xc3c4('0x33')]));_0x3bc526[_0xc3c4('0x32')]=_0x3bc526[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x3bc526['attributes']:_0x469bef[_0xc3c4('0x2e')];if(_0x5c1c96['query']['includeAll']){_0x3bc526[_0xc3c4('0x3f')]=[{'all':!![]}];}_0x3bc526=_['merge']({},_0x3bc526,_0x5c1c96['options']);return db[_0xc3c4('0x2a')][_0xc3c4('0x44')](_0x3bc526)['then'](handleEntityNotFound(_0x392fc4,null))[_0xc3c4('0x24')](respondWithResult(_0x392fc4,null))['catch'](handleError(_0x392fc4,null));};exports['create']=function(_0x3684a3,_0x15cced){return db[_0xc3c4('0x2a')][_0xc3c4('0x45')](_0x3684a3[_0xc3c4('0x46')],{})[_0xc3c4('0x24')](respondWithResult(_0x15cced,0xc9))['catch'](handleError(_0x15cced,null));};exports[_0xc3c4('0x23')]=function(_0x43de6a,_0xf550cc){if(_0x43de6a['body']['id']){delete _0x43de6a['body']['id'];}return db['FreshsalesConfiguration'][_0xc3c4('0x44')]({'where':{'id':_0x43de6a[_0xc3c4('0x43')]['id']}})[_0xc3c4('0x24')](handleEntityNotFound(_0xf550cc,null))[_0xc3c4('0x24')](saveUpdates(_0x43de6a[_0xc3c4('0x46')],null))[_0xc3c4('0x24')](respondWithResult(_0xf550cc,null))['catch'](handleError(_0xf550cc,null));};exports[_0xc3c4('0x47')]=function(_0x4ec36a,_0x283707){return db[_0xc3c4('0x2a')][_0xc3c4('0x44')]({'where':{'id':_0x4ec36a['params']['id']}})['then'](handleEntityNotFound(_0x283707,null))[_0xc3c4('0x24')](removeEntity(_0x283707,null))[_0xc3c4('0x41')](handleError(_0x283707,null));};exports['getSubjects']=function(_0x37c02b,_0x3e424a,_0x176968){var _0x1e3e9a={};var _0x356353={};var _0x377405;var _0x18647b;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x37c02b['params']['id']}})[_0xc3c4('0x24')](handleEntityNotFound(_0x3e424a,null))[_0xc3c4('0x24')](function(_0xaad96a){if(_0xaad96a){_0x377405=_0xaad96a;_0x356353[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db['FreshsalesField'][_0xc3c4('0x2b')]);_0x356353[_0xc3c4('0x30')]=_[_0xc3c4('0x2f')](_0x37c02b[_0xc3c4('0x30')]);_0x356353[_0xc3c4('0x3a')]=_[_0xc3c4('0x31')](_0x356353[_0xc3c4('0x2e')],_0x356353[_0xc3c4('0x30')]);_0x1e3e9a[_0xc3c4('0x32')]=_[_0xc3c4('0x31')](_0x356353[_0xc3c4('0x2e')],qs[_0xc3c4('0x33')](_0x37c02b['query']['fields']));_0x1e3e9a[_0xc3c4('0x32')]=_0x1e3e9a['attributes']['length']?_0x1e3e9a['attributes']:_0x356353[_0xc3c4('0x2e')];_0x1e3e9a[_0xc3c4('0x37')]=qs[_0xc3c4('0x48')](_0x37c02b[_0xc3c4('0x30')]['sort']);_0x1e3e9a[_0xc3c4('0x38')]=qs[_0xc3c4('0x3a')](_[_0xc3c4('0x39')](_0x37c02b['query'],_0x356353['filters']));if(_0x37c02b['query'][_0xc3c4('0x3b')]){_0x1e3e9a[_0xc3c4('0x38')]=_[_0xc3c4('0x3d')](_0x1e3e9a[_0xc3c4('0x38')],{'$or':_['map'](_0x1e3e9a['attributes'],function(_0x431e13){var _0x523af9={};_0x523af9[_0x431e13]={'$like':'%'+_0x37c02b[_0xc3c4('0x30')]['filter']+'%'};return _0x523af9;})});}_0x1e3e9a=_[_0xc3c4('0x3d')]({},_0x1e3e9a,_0x37c02b[_0xc3c4('0x49')]);return _0x377405['getSubjects'](_0x1e3e9a);}})[_0xc3c4('0x24')](function(_0x351ff8){if(_0x351ff8){_0x18647b=_0x351ff8[_0xc3c4('0x34')];if(!_0x37c02b['query'][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x1e3e9a[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x37c02b[_0xc3c4('0x30')][_0xc3c4('0x1d')]);_0x1e3e9a['offset']=qs['offset'](_0x37c02b[_0xc3c4('0x30')]['offset']);}return _0x377405['getSubjects'](_0x1e3e9a);}})[_0xc3c4('0x24')](function(_0x59eb80){if(_0x59eb80){return _0x59eb80?{'count':_0x18647b,'rows':_0x59eb80}:null;}})[_0xc3c4('0x24')](respondWithResult(_0x3e424a,null))[_0xc3c4('0x41')](handleError(_0x3e424a,null));};exports[_0xc3c4('0x4a')]=function(_0x425601,_0x1ff852,_0x2d5d18){var _0x2f55dc={};var _0x311339={};var _0x21d6e9;var _0x192307;return db[_0xc3c4('0x2a')]['findOne']({'where':{'id':_0x425601[_0xc3c4('0x43')]['id']}})[_0xc3c4('0x24')](handleEntityNotFound(_0x1ff852,null))['then'](function(_0x39a267){if(_0x39a267){_0x21d6e9=_0x39a267;_0x311339[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db[_0xc3c4('0x4b')][_0xc3c4('0x2b')]);_0x311339['query']=_[_0xc3c4('0x2f')](_0x425601['query']);_0x311339[_0xc3c4('0x3a')]=_['intersection'](_0x311339['model'],_0x311339[_0xc3c4('0x30')]);_0x2f55dc['attributes']=_[_0xc3c4('0x31')](_0x311339[_0xc3c4('0x2e')],qs['fields'](_0x425601[_0xc3c4('0x30')]['fields']));_0x2f55dc['attributes']=_0x2f55dc[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x2f55dc[_0xc3c4('0x32')]:_0x311339[_0xc3c4('0x2e')];_0x2f55dc[_0xc3c4('0x37')]=qs[_0xc3c4('0x48')](_0x425601[_0xc3c4('0x30')][_0xc3c4('0x48')]);_0x2f55dc['where']=qs['filters'](_[_0xc3c4('0x39')](_0x425601[_0xc3c4('0x30')],_0x311339['filters']));if(_0x425601['query'][_0xc3c4('0x3b')]){_0x2f55dc[_0xc3c4('0x38')]=_[_0xc3c4('0x3d')](_0x2f55dc[_0xc3c4('0x38')],{'$or':_[_0xc3c4('0x29')](_0x2f55dc[_0xc3c4('0x32')],function(_0x5dedd0){var _0x3c4d88={};_0x3c4d88[_0x5dedd0]={'$like':'%'+_0x425601[_0xc3c4('0x30')][_0xc3c4('0x3b')]+'%'};return _0x3c4d88;})});}_0x2f55dc=_[_0xc3c4('0x3d')]({},_0x2f55dc,_0x425601[_0xc3c4('0x49')]);return _0x21d6e9[_0xc3c4('0x4a')](_0x2f55dc);}})[_0xc3c4('0x24')](function(_0x182ea1){if(_0x182ea1){_0x192307=_0x182ea1[_0xc3c4('0x34')];if(!_0x425601[_0xc3c4('0x30')][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x2f55dc[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x425601[_0xc3c4('0x30')]['limit']);_0x2f55dc[_0xc3c4('0x1b')]=qs[_0xc3c4('0x1b')](_0x425601[_0xc3c4('0x30')][_0xc3c4('0x1b')]);}return _0x21d6e9['getDescriptions'](_0x2f55dc);}})[_0xc3c4('0x24')](function(_0x1751b9){if(_0x1751b9){return _0x1751b9?{'count':_0x192307,'rows':_0x1751b9}:null;}})[_0xc3c4('0x24')](respondWithResult(_0x1ff852,null))[_0xc3c4('0x41')](handleError(_0x1ff852,null));};exports[_0xc3c4('0x4c')]=function(_0x5d8c92,_0x158998,_0x15d34d){var _0x5868bb={};var _0x79577c={};var _0xb9d524;var _0x3719ce;return db[_0xc3c4('0x2a')][_0xc3c4('0x4d')]({'where':{'id':_0x5d8c92[_0xc3c4('0x43')]['id']}})['then'](handleEntityNotFound(_0x158998,null))[_0xc3c4('0x24')](function(_0x1d3d6d){if(_0x1d3d6d){_0xb9d524=_0x1d3d6d;_0x79577c[_0xc3c4('0x2e')]=_[_0xc3c4('0x2f')](db[_0xc3c4('0x4b')][_0xc3c4('0x2b')]);_0x79577c[_0xc3c4('0x30')]=_[_0xc3c4('0x2f')](_0x5d8c92['query']);_0x79577c['filters']=_[_0xc3c4('0x31')](_0x79577c[_0xc3c4('0x2e')],_0x79577c[_0xc3c4('0x30')]);_0x5868bb[_0xc3c4('0x32')]=_[_0xc3c4('0x31')](_0x79577c[_0xc3c4('0x2e')],qs[_0xc3c4('0x33')](_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x33')]));_0x5868bb[_0xc3c4('0x32')]=_0x5868bb[_0xc3c4('0x32')][_0xc3c4('0x34')]?_0x5868bb[_0xc3c4('0x32')]:_0x79577c[_0xc3c4('0x2e')];_0x5868bb[_0xc3c4('0x37')]=qs['sort'](_0x5d8c92[_0xc3c4('0x30')]['sort']);_0x5868bb[_0xc3c4('0x38')]=qs[_0xc3c4('0x3a')](_[_0xc3c4('0x39')](_0x5d8c92[_0xc3c4('0x30')],_0x79577c[_0xc3c4('0x3a')]));if(_0x5d8c92['query'][_0xc3c4('0x3b')]){_0x5868bb['where']=_[_0xc3c4('0x3d')](_0x5868bb[_0xc3c4('0x38')],{'$or':_[_0xc3c4('0x29')](_0x5868bb[_0xc3c4('0x32')],function(_0x5918e2){var _0x21defd={};_0x21defd[_0x5918e2]={'$like':'%'+_0x5d8c92[_0xc3c4('0x30')]['filter']+'%'};return _0x21defd;})});}_0x5868bb=_[_0xc3c4('0x3d')]({},_0x5868bb,_0x5d8c92[_0xc3c4('0x49')]);return _0xb9d524[_0xc3c4('0x4c')](_0x5868bb);}})[_0xc3c4('0x24')](function(_0x345c04){if(_0x345c04){_0x3719ce=_0x345c04[_0xc3c4('0x34')];if(!_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x35')](_0xc3c4('0x36'))){_0x5868bb[_0xc3c4('0x1d')]=qs[_0xc3c4('0x1d')](_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x1d')]);_0x5868bb['offset']=qs[_0xc3c4('0x1b')](_0x5d8c92[_0xc3c4('0x30')][_0xc3c4('0x1b')]);}return _0xb9d524['getFields'](_0x5868bb);}})[_0xc3c4('0x24')](function(_0x413dde){if(_0x413dde){return _0x413dde?{'count':_0x3719ce,'rows':_0x413dde}:null;}})[_0xc3c4('0x24')](respondWithResult(_0x158998,null))[_0xc3c4('0x41')](handleError(_0x158998,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index c6e0163..b43a526 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 _0x7d2a=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','moment','bluebird','request-promise'];(function(_0x172402,_0x2be91f){var _0x1b6331=function(_0x3bba21){while(--_0x3bba21){_0x172402['push'](_0x172402['shift']());}};_0x1b6331(++_0x2be91f);}(_0x7d2a,0xa3));var _0xa7d2=function(_0x38c744,_0x1592d6){_0x38c744=_0x38c744-0x0;var _0x134be1=_0x7d2a[_0x38c744];return _0x134be1;};'use strict';var _=require(_0xa7d2('0x0'));var util=require(_0xa7d2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa7d2('0x2'));var BPromise=require(_0xa7d2('0x3'));var rp=require(_0xa7d2('0x4'));var fs=require('fs');var path=require(_0xa7d2('0x5'));var rimraf=require(_0xa7d2('0x6'));var config=require(_0xa7d2('0x7'));var attributes=require(_0xa7d2('0x8'));module[_0xa7d2('0x9')]=function(_0x134dbe,_0x518fb5){return _0x134dbe['define'](_0xa7d2('0xa'),attributes,{'tableName':_0xa7d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41bc=['int_freshsales_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41bc,0x85));var _0xc41b=function(_0x1d2f7c,_0xe9915b){_0x1d2f7c=_0x1d2f7c-0x0;var _0xf5965d=_0x41bc[_0x1d2f7c];return _0xf5965d;};'use strict';var _=require(_0xc41b('0x0'));var util=require(_0xc41b('0x1'));var logger=require(_0xc41b('0x2'))(_0xc41b('0x3'));var moment=require('moment');var BPromise=require(_0xc41b('0x4'));var rp=require(_0xc41b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc41b('0x6'));var attributes=require(_0xc41b('0x7'));module[_0xc41b('0x8')]=function(_0x2c0b86,_0x3b65a6){return _0x2c0b86['define'](_0xc41b('0x9'),attributes,{'tableName':_0xc41b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index f317811..2aa93b3 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 _0x5447=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','error','message','info','catch'];(function(_0x1ea7d1,_0x4b4578){var _0x30b0ea=function(_0x4f573d){while(--_0x4f573d){_0x1ea7d1['push'](_0x1ea7d1['shift']());}};_0x30b0ea(++_0x4b4578);}(_0x5447,0xc6));var _0x7544=function(_0x4afa31,_0xa44012){_0x4afa31=_0x4afa31-0x0;var _0xc19534=_0x5447[_0x4afa31];return _0xc19534;};'use strict';var _=require('lodash');var util=require(_0x7544('0x0'));var moment=require(_0x7544('0x1'));var BPromise=require('bluebird');var rs=require(_0x7544('0x2'));var fs=require('fs');var Redis=require(_0x7544('0x3'));var db=require(_0x7544('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7544('0x5'))('rpc');var config=require(_0x7544('0x6'));var jayson=require(_0x7544('0x7'));var client=jayson[_0x7544('0x8')][_0x7544('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b273b,_0x2c6df9,_0x5c1a9a){return new BPromise(function(_0x4940f5,_0x3f4db4){return client[_0x7544('0xa')](_0x3b273b,_0x5c1a9a)[_0x7544('0xb')](function(_0x254614){logger['info'](_0x7544('0xc'),_0x2c6df9,'request\x20sent');logger[_0x7544('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2c6df9,'request\x20sent',JSON['stringify'](_0x254614));if(_0x254614[_0x7544('0xe')]){if(_0x254614[_0x7544('0xe')]['code']===0x1f4){logger[_0x7544('0xe')](_0x7544('0xc'),_0x2c6df9,_0x254614[_0x7544('0xe')][_0x7544('0xf')]);return _0x3f4db4(_0x254614[_0x7544('0xe')][_0x7544('0xf')]);}logger[_0x7544('0xe')](_0x7544('0xc'),_0x2c6df9,_0x254614[_0x7544('0xe')]['message']);return _0x4940f5(_0x254614[_0x7544('0xe')][_0x7544('0xf')]);}else{logger[_0x7544('0x10')](_0x7544('0xc'),_0x2c6df9,'request\x20sent');_0x4940f5(_0x254614['result'][_0x7544('0xf')]);}})[_0x7544('0x11')](function(_0x31622f){logger[_0x7544('0xe')](_0x7544('0xc'),_0x2c6df9,_0x31622f);_0x3f4db4(_0x31622f);});});} \ No newline at end of file +var _0x17da=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x388e4e,_0x49cd53){var _0x5f5ad4=function(_0x1c37c7){while(--_0x1c37c7){_0x388e4e['push'](_0x388e4e['shift']());}};_0x5f5ad4(++_0x49cd53);}(_0x17da,0x1f2));var _0xa17d=function(_0x34e311,_0xca7350){_0x34e311=_0x34e311-0x0;var _0x31ac06=_0x17da[_0x34e311];return _0x31ac06;};'use strict';var _=require(_0xa17d('0x0'));var util=require('util');var moment=require(_0xa17d('0x1'));var BPromise=require(_0xa17d('0x2'));var rs=require(_0xa17d('0x3'));var fs=require('fs');var Redis=require(_0xa17d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa17d('0x5'));var logger=require(_0xa17d('0x6'))(_0xa17d('0x7'));var config=require('../../config/environment');var jayson=require(_0xa17d('0x8'));var client=jayson[_0xa17d('0x9')][_0xa17d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53b7fd,_0x57b561,_0x57a779){return new BPromise(function(_0x3f47d4,_0x9dcdd9){return client[_0xa17d('0xb')](_0x53b7fd,_0x57a779)[_0xa17d('0xc')](function(_0x20f1bc){logger[_0xa17d('0xd')](_0xa17d('0xe'),_0x57b561,'request\x20sent');logger[_0xa17d('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x57b561,_0xa17d('0x10'),JSON['stringify'](_0x20f1bc));if(_0x20f1bc[_0xa17d('0x11')]){if(_0x20f1bc[_0xa17d('0x11')][_0xa17d('0x12')]===0x1f4){logger[_0xa17d('0x11')](_0xa17d('0xe'),_0x57b561,_0x20f1bc[_0xa17d('0x11')]['message']);return _0x9dcdd9(_0x20f1bc[_0xa17d('0x11')][_0xa17d('0x13')]);}logger[_0xa17d('0x11')](_0xa17d('0xe'),_0x57b561,_0x20f1bc[_0xa17d('0x11')][_0xa17d('0x13')]);return _0x3f47d4(_0x20f1bc[_0xa17d('0x11')]['message']);}else{logger[_0xa17d('0xd')](_0xa17d('0xe'),_0x57b561,_0xa17d('0x10'));_0x3f47d4(_0x20f1bc[_0xa17d('0x14')][_0xa17d('0x13')]);}})['catch'](function(_0x30d057){logger[_0xa17d('0x11')](_0xa17d('0xe'),_0x57b561,_0x30d057);_0x9dcdd9(_0x30d057);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index fdb7815..d7c7b04 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 _0xd66c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','exports','multer','path','connect-timeout','express'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xd66c,0x106));var _0xcd66=function(_0x212fcc,_0x9a5423){_0x212fcc=_0x212fcc-0x0;var _0x4c129c=_0xd66c[_0x212fcc];return _0x4c129c;};'use strict';var multer=require(_0xcd66('0x0'));var util=require('util');var path=require(_0xcd66('0x1'));var timeout=require(_0xcd66('0x2'));var express=require(_0xcd66('0x3'));var router=express[_0xcd66('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcd66('0x5'));var interaction=require(_0xcd66('0x6'));var config=require(_0xcd66('0x7'));var controller=require(_0xcd66('0x8'));router[_0xcd66('0x9')]('/',auth[_0xcd66('0xa')](),controller[_0xcd66('0xb')]);router[_0xcd66('0x9')]('/:id',auth[_0xcd66('0xa')](),controller[_0xcd66('0xc')]);router[_0xcd66('0xd')]('/',auth[_0xcd66('0xa')](),controller[_0xcd66('0xe')]);router[_0xcd66('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcd66('0x10')]);router['delete'](_0xcd66('0x11'),auth[_0xcd66('0xa')](),controller['destroy']);module[_0xcd66('0x12')]=router; \ No newline at end of file +var _0x0b96=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0b96,0xa5));var _0x60b9=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0x0b96[_0x522ae8];return _0x3189b9;};'use strict';var multer=require(_0x60b9('0x0'));var util=require(_0x60b9('0x1'));var path=require(_0x60b9('0x2'));var timeout=require('connect-timeout');var express=require(_0x60b9('0x3'));var router=express[_0x60b9('0x4')]();var fs_extra=require(_0x60b9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x60b9('0x6'));var config=require(_0x60b9('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x60b9('0x8')]('/',auth[_0x60b9('0x9')](),controller[_0x60b9('0xa')]);router[_0x60b9('0x8')](_0x60b9('0xb'),auth[_0x60b9('0x9')](),controller[_0x60b9('0xc')]);router['post']('/',auth[_0x60b9('0x9')](),controller['create']);router['put'](_0x60b9('0xb'),auth[_0x60b9('0x9')](),controller[_0x60b9('0xd')]);router[_0x60b9('0xe')]('/:id',auth[_0x60b9('0x9')](),controller[_0x60b9('0xf')]);module[_0x60b9('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 6fd6a3f..ddfde68 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 _0x4861=['STRING','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x20babc,_0x18ef86){var _0x19621d=function(_0x361700){while(--_0x361700){_0x20babc['push'](_0x20babc['shift']());}};_0x19621d(++_0x18ef86);}(_0x4861,0x71));var _0x1486=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4861[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module[_0x1486('0x0')]={'type':{'type':Sequelize['ENUM'](_0x1486('0x1'),_0x1486('0x2'),_0x1486('0x3'),_0x1486('0x4'),_0x1486('0x5')),'defaultValue':_0x1486('0x1')},'content':{'type':Sequelize[_0x1486('0x6')]},'key':{'type':Sequelize[_0x1486('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1486('0x1'),'variable',_0x1486('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1486('0x6')]},'nameField':{'type':Sequelize[_0x1486('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x11fd=['BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist','string','STRING','ENUM'];(function(_0x27d697,_0xcab9a2){var _0x3dbadf=function(_0x25d161){while(--_0x25d161){_0x27d697['push'](_0x27d697['shift']());}};_0x3dbadf(++_0xcab9a2);}(_0x11fd,0xfb));var _0xd11f=function(_0x210c86,_0x3ea966){_0x210c86=_0x210c86-0x0;var _0xd44855=_0x11fd[_0x210c86];return _0xd44855;};'use strict';var Sequelize=require(_0xd11f('0x0'));module[_0xd11f('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xd11f('0x2'),_0xd11f('0x3'),_0xd11f('0x4'),_0xd11f('0x5')),'defaultValue':_0xd11f('0x6')},'content':{'type':Sequelize[_0xd11f('0x7')]},'key':{'type':Sequelize[_0xd11f('0x7')]},'keyType':{'type':Sequelize[_0xd11f('0x8')](_0xd11f('0x6'),'variable',_0xd11f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd11f('0x7')]},'nameField':{'type':Sequelize[_0xd11f('0x7')]},'customField':{'type':Sequelize[_0xd11f('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd11f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 1e90213..a864437 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 _0xc2e1=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xc2e1,0x1ea));var _0x1c2e=function(_0x2c203e,_0x253d39){_0x2c203e=_0x2c203e-0x0;var _0x28f34e=_0xc2e1[_0x2c203e];return _0x28f34e;};'use strict';var emlformat=require(_0x1c2e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c2e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c2e('0x2'));var moment=require(_0x1c2e('0x3'));var BPromise=require(_0x1c2e('0x4'));var Mustache=require(_0x1c2e('0x5'));var util=require(_0x1c2e('0x6'));var path=require(_0x1c2e('0x7'));var sox=require(_0x1c2e('0x8'));var csv=require(_0x1c2e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c2e('0xa'));var _=require(_0x1c2e('0xb'));var squel=require(_0x1c2e('0xc'));var crypto=require(_0x1c2e('0xd'));var jsforce=require(_0x1c2e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1c2e('0x9'));var querystring=require(_0x1c2e('0xf'));var Papa=require('papaparse');var Redis=require(_0x1c2e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1c2e('0x11'));var as=require(_0x1c2e('0x12'));var hardwareService=require(_0x1c2e('0x13'));var logger=require(_0x1c2e('0x14'))(_0x1c2e('0x15'));var utils=require(_0x1c2e('0x16'));var config=require(_0x1c2e('0x17'));var licenseUtil=require(_0x1c2e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d192,_0x48ee88){_0x48ee88=_0x48ee88||0xcc;return function(_0x5ed102){if(_0x5ed102){return _0x10d192[_0x1c2e('0x19')](_0x48ee88);}return _0x10d192['status'](_0x48ee88)[_0x1c2e('0x1a')]();};}function respondWithResult(_0x3245b7,_0x30420e){_0x30420e=_0x30420e||0xc8;return function(_0x3a6d05){if(_0x3a6d05){return _0x3245b7[_0x1c2e('0x1b')](_0x30420e)['json'](_0x3a6d05);}};}function respondWithFilteredResult(_0x241d3b,_0x43dd72){return function(_0xf00939){if(_0xf00939){var _0x33b103=typeof _0x43dd72[_0x1c2e('0x1c')]===_0x1c2e('0x1d')&&typeof _0x43dd72[_0x1c2e('0x1e')]===_0x1c2e('0x1d');var _0xee31b7=_0xf00939['count'];var _0x9412d3=_0x33b103?0x0:_0x43dd72[_0x1c2e('0x1c')];var _0x494fc9=_0x33b103?_0xf00939[_0x1c2e('0x1f')]:_0x43dd72[_0x1c2e('0x1c')]+_0x43dd72['limit'];var _0x37d427;if(_0x494fc9>=_0xee31b7){_0x494fc9=_0xee31b7;_0x37d427=0xc8;}else{_0x37d427=0xce;}_0x241d3b[_0x1c2e('0x1b')](_0x37d427);return _0x241d3b['set'](_0x1c2e('0x20'),_0x9412d3+'-'+_0x494fc9+'/'+_0xee31b7)[_0x1c2e('0x21')](_0xf00939);}return null;};}function patchUpdates(_0x2d644e){return function(_0x272eb5){try{jsonpatch[_0x1c2e('0x22')](_0x272eb5,_0x2d644e,!![]);}catch(_0x504983){return BPromise[_0x1c2e('0x23')](_0x504983);}return _0x272eb5[_0x1c2e('0x24')]();};}function saveUpdates(_0x4f86cb,_0x2c81d8){return function(_0x4b30ba){if(_0x4b30ba){return _0x4b30ba[_0x1c2e('0x25')](_0x4f86cb)[_0x1c2e('0x26')](function(_0x1ada39){return _0x1ada39;});}return null;};}function removeEntity(_0x10e310,_0x1422a2){return function(_0xab1891){if(_0xab1891){return _0xab1891[_0x1c2e('0x27')]()[_0x1c2e('0x26')](function(){_0x10e310['status'](0xcc)[_0x1c2e('0x1a')]();});}};}function handleEntityNotFound(_0x561166,_0x3fbec4){return function(_0x13230c){if(!_0x13230c){_0x561166[_0x1c2e('0x19')](0x194);}return _0x13230c;};}function handleError(_0x1d9153,_0x580153){_0x580153=_0x580153||0x1f4;return function(_0x536c9c){logger[_0x1c2e('0x28')](_0x536c9c[_0x1c2e('0x29')]);if(_0x536c9c[_0x1c2e('0x2a')]){delete _0x536c9c[_0x1c2e('0x2a')];}_0x1d9153[_0x1c2e('0x1b')](_0x580153)[_0x1c2e('0x2b')](_0x536c9c);};}exports[_0x1c2e('0x2c')]=function(_0xe4c1a2,_0x41b7b4){var _0x518abf={},_0x622f2d={},_0x5ec5e4={'count':0x0,'rows':[]};var _0xe61695=_[_0x1c2e('0x2d')](db[_0x1c2e('0x2e')][_0x1c2e('0x2f')],function(_0x3ed80c){return{'name':_0x3ed80c[_0x1c2e('0x30')],'type':_0x3ed80c[_0x1c2e('0x31')][_0x1c2e('0x32')]};});_0x622f2d[_0x1c2e('0x33')]=_[_0x1c2e('0x2d')](_0xe61695,_0x1c2e('0x2a'));_0x622f2d[_0x1c2e('0x34')]=_[_0x1c2e('0x35')](_0xe4c1a2[_0x1c2e('0x34')]);_0x622f2d[_0x1c2e('0x36')]=_[_0x1c2e('0x37')](_0x622f2d[_0x1c2e('0x33')],_0x622f2d[_0x1c2e('0x34')]);_0x518abf[_0x1c2e('0x38')]=_['intersection'](_0x622f2d['model'],qs[_0x1c2e('0x39')](_0xe4c1a2[_0x1c2e('0x34')]['fields']));_0x518abf[_0x1c2e('0x38')]=_0x518abf['attributes'][_0x1c2e('0x3a')]?_0x518abf[_0x1c2e('0x38')]:_0x622f2d['model'];if(!_0xe4c1a2[_0x1c2e('0x34')][_0x1c2e('0x3b')](_0x1c2e('0x3c'))){_0x518abf[_0x1c2e('0x1e')]=qs[_0x1c2e('0x1e')](_0xe4c1a2[_0x1c2e('0x34')][_0x1c2e('0x1e')]);_0x518abf[_0x1c2e('0x1c')]=qs[_0x1c2e('0x1c')](_0xe4c1a2[_0x1c2e('0x34')][_0x1c2e('0x1c')]);}_0x518abf[_0x1c2e('0x3d')]=qs[_0x1c2e('0x3e')](_0xe4c1a2[_0x1c2e('0x34')]['sort']);_0x518abf[_0x1c2e('0x3f')]=qs[_0x1c2e('0x36')](_['pick'](_0xe4c1a2[_0x1c2e('0x34')],_0x622f2d[_0x1c2e('0x36')]),_0xe61695);if(_0xe4c1a2[_0x1c2e('0x34')]['filter']){_0x518abf[_0x1c2e('0x3f')]=_[_0x1c2e('0x40')](_0x518abf[_0x1c2e('0x3f')],{'$or':_[_0x1c2e('0x2d')](_0xe61695,function(_0x1526f4){if(_0x1526f4[_0x1c2e('0x31')]!=='VIRTUAL'){var _0x43cad7={};_0x43cad7[_0x1526f4[_0x1c2e('0x2a')]]={'$like':'%'+_0xe4c1a2[_0x1c2e('0x34')][_0x1c2e('0x41')]+'%'};return _0x43cad7;}})});}_0x518abf=_[_0x1c2e('0x40')]({},_0x518abf,_0xe4c1a2[_0x1c2e('0x42')]);var _0x31d141={'where':_0x518abf[_0x1c2e('0x3f')]};return db['FreshsalesField'][_0x1c2e('0x1f')](_0x31d141)[_0x1c2e('0x26')](function(_0x750563){_0x5ec5e4['count']=_0x750563;if(_0xe4c1a2[_0x1c2e('0x34')][_0x1c2e('0x43')]){_0x518abf[_0x1c2e('0x44')]=[{'all':!![]}];}return db[_0x1c2e('0x2e')][_0x1c2e('0x45')](_0x518abf);})[_0x1c2e('0x26')](function(_0x2b4284){_0x5ec5e4[_0x1c2e('0x46')]=_0x2b4284;return _0x5ec5e4;})[_0x1c2e('0x26')](respondWithFilteredResult(_0x41b7b4,_0x518abf))[_0x1c2e('0x47')](handleError(_0x41b7b4,null));};exports[_0x1c2e('0x48')]=function(_0x174e8b,_0xd5f46b){var _0x2912e9={'raw':!![],'where':{'id':_0x174e8b[_0x1c2e('0x49')]['id']}},_0x5a1b8c={};_0x5a1b8c[_0x1c2e('0x33')]=_[_0x1c2e('0x35')](db['FreshsalesField']['rawAttributes']);_0x5a1b8c[_0x1c2e('0x34')]=_[_0x1c2e('0x35')](_0x174e8b[_0x1c2e('0x34')]);_0x5a1b8c[_0x1c2e('0x36')]=_[_0x1c2e('0x37')](_0x5a1b8c[_0x1c2e('0x33')],_0x5a1b8c[_0x1c2e('0x34')]);_0x2912e9[_0x1c2e('0x38')]=_[_0x1c2e('0x37')](_0x5a1b8c[_0x1c2e('0x33')],qs[_0x1c2e('0x39')](_0x174e8b['query'][_0x1c2e('0x39')]));_0x2912e9[_0x1c2e('0x38')]=_0x2912e9[_0x1c2e('0x38')][_0x1c2e('0x3a')]?_0x2912e9[_0x1c2e('0x38')]:_0x5a1b8c[_0x1c2e('0x33')];if(_0x174e8b[_0x1c2e('0x34')][_0x1c2e('0x43')]){_0x2912e9[_0x1c2e('0x44')]=[{'all':!![]}];}_0x2912e9=_[_0x1c2e('0x40')]({},_0x2912e9,_0x174e8b['options']);return db[_0x1c2e('0x2e')]['find'](_0x2912e9)[_0x1c2e('0x26')](handleEntityNotFound(_0xd5f46b,null))['then'](respondWithResult(_0xd5f46b,null))[_0x1c2e('0x47')](handleError(_0xd5f46b,null));};exports[_0x1c2e('0x4a')]=function(_0x15458e,_0xc4f138){return db[_0x1c2e('0x2e')][_0x1c2e('0x4a')](_0x15458e['body'],{})['then'](respondWithResult(_0xc4f138,0xc9))[_0x1c2e('0x47')](handleError(_0xc4f138,null));};exports[_0x1c2e('0x25')]=function(_0xaa10d3,_0x169f43){if(_0xaa10d3[_0x1c2e('0x4b')]['id']){delete _0xaa10d3[_0x1c2e('0x4b')]['id'];}return db['FreshsalesField'][_0x1c2e('0x4c')]({'where':{'id':_0xaa10d3[_0x1c2e('0x49')]['id']}})[_0x1c2e('0x26')](handleEntityNotFound(_0x169f43,null))[_0x1c2e('0x26')](saveUpdates(_0xaa10d3[_0x1c2e('0x4b')],null))['then'](respondWithResult(_0x169f43,null))['catch'](handleError(_0x169f43,null));};exports[_0x1c2e('0x27')]=function(_0x43921d,_0x2bb031){return db[_0x1c2e('0x2e')][_0x1c2e('0x4c')]({'where':{'id':_0x43921d[_0x1c2e('0x49')]['id']}})['then'](handleEntityNotFound(_0x2bb031,null))[_0x1c2e('0x26')](removeEntity(_0x2bb031,null))[_0x1c2e('0x47')](handleError(_0x2bb031,null));}; \ No newline at end of file +var _0x8fdb=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','findAll','catch','show','params','includeAll','include','find','create','body','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','limit','undefined','count','offset','apply','reject','update','destroy','then','sendStatus','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0x8fdb,0x1c1));var _0xb8fd=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x8fdb[_0x46efd7];return _0x5637e4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb8fd('0x0'));var rp=require('request-promise');var moment=require(_0xb8fd('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xb8fd('0x2'));var util=require(_0xb8fd('0x3'));var path=require(_0xb8fd('0x4'));var sox=require('sox');var csv=require(_0xb8fd('0x5'));var ejs=require(_0xb8fd('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8fd('0x7'));var squel=require(_0xb8fd('0x8'));var crypto=require('crypto');var jsforce=require(_0xb8fd('0x9'));var deskjs=require(_0xb8fd('0xa'));var toCsv=require(_0xb8fd('0x5'));var querystring=require(_0xb8fd('0xb'));var Papa=require(_0xb8fd('0xc'));var Redis=require(_0xb8fd('0xd'));var authService=require(_0xb8fd('0xe'));var qs=require(_0xb8fd('0xf'));var as=require(_0xb8fd('0x10'));var hardwareService=require(_0xb8fd('0x11'));var logger=require(_0xb8fd('0x12'))(_0xb8fd('0x13'));var utils=require(_0xb8fd('0x14'));var config=require(_0xb8fd('0x15'));var licenseUtil=require(_0xb8fd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bbfac,_0x1e2452){_0x1e2452=_0x1e2452||0xcc;return function(_0x31aeb1){if(_0x31aeb1){return _0x3bbfac['sendStatus'](_0x1e2452);}return _0x3bbfac['status'](_0x1e2452)[_0xb8fd('0x17')]();};}function respondWithResult(_0x593d68,_0x16bb3b){_0x16bb3b=_0x16bb3b||0xc8;return function(_0x47d744){if(_0x47d744){return _0x593d68[_0xb8fd('0x18')](_0x16bb3b)[_0xb8fd('0x19')](_0x47d744);}};}function respondWithFilteredResult(_0x4d5a28,_0x3e6840){return function(_0x512a3c){if(_0x512a3c){var _0x289b99=typeof _0x3e6840['offset']==='undefined'&&typeof _0x3e6840[_0xb8fd('0x1a')]===_0xb8fd('0x1b');var _0x5d622d=_0x512a3c[_0xb8fd('0x1c')];var _0x4f1f1d=_0x289b99?0x0:_0x3e6840[_0xb8fd('0x1d')];var _0x635c6=_0x289b99?_0x512a3c[_0xb8fd('0x1c')]:_0x3e6840[_0xb8fd('0x1d')]+_0x3e6840[_0xb8fd('0x1a')];var _0xf052b2;if(_0x635c6>=_0x5d622d){_0x635c6=_0x5d622d;_0xf052b2=0xc8;}else{_0xf052b2=0xce;}_0x4d5a28[_0xb8fd('0x18')](_0xf052b2);return _0x4d5a28['set']('Content-Range',_0x4f1f1d+'-'+_0x635c6+'/'+_0x5d622d)[_0xb8fd('0x19')](_0x512a3c);}return null;};}function patchUpdates(_0x1a7e6e){return function(_0x4a14b8){try{jsonpatch[_0xb8fd('0x1e')](_0x4a14b8,_0x1a7e6e,!![]);}catch(_0x1e8125){return BPromise[_0xb8fd('0x1f')](_0x1e8125);}return _0x4a14b8['save']();};}function saveUpdates(_0x4e393c,_0xba9803){return function(_0x33208e){if(_0x33208e){return _0x33208e[_0xb8fd('0x20')](_0x4e393c)['then'](function(_0x21ac62){return _0x21ac62;});}return null;};}function removeEntity(_0x4e8ef1,_0x4c8321){return function(_0x2cb487){if(_0x2cb487){return _0x2cb487[_0xb8fd('0x21')]()[_0xb8fd('0x22')](function(){_0x4e8ef1[_0xb8fd('0x18')](0xcc)[_0xb8fd('0x17')]();});}};}function handleEntityNotFound(_0xf3c8da,_0x270239){return function(_0x58420b){if(!_0x58420b){_0xf3c8da[_0xb8fd('0x23')](0x194);}return _0x58420b;};}function handleError(_0x3b425e,_0x1caaa2){_0x1caaa2=_0x1caaa2||0x1f4;return function(_0x32c977){logger[_0xb8fd('0x24')](_0x32c977[_0xb8fd('0x25')]);if(_0x32c977[_0xb8fd('0x26')]){delete _0x32c977[_0xb8fd('0x26')];}_0x3b425e[_0xb8fd('0x18')](_0x1caaa2)['send'](_0x32c977);};}exports[_0xb8fd('0x27')]=function(_0x3a01fb,_0x2cfb23){var _0x299c95={},_0x1fc7e1={},_0x54438b={'count':0x0,'rows':[]};var _0xd3c83d=_[_0xb8fd('0x28')](db[_0xb8fd('0x29')][_0xb8fd('0x2a')],function(_0x10a6ad){return{'name':_0x10a6ad[_0xb8fd('0x2b')],'type':_0x10a6ad[_0xb8fd('0x2c')]['key']};});_0x1fc7e1[_0xb8fd('0x2d')]=_[_0xb8fd('0x28')](_0xd3c83d,_0xb8fd('0x26'));_0x1fc7e1[_0xb8fd('0x2e')]=_[_0xb8fd('0x2f')](_0x3a01fb[_0xb8fd('0x2e')]);_0x1fc7e1['filters']=_[_0xb8fd('0x30')](_0x1fc7e1[_0xb8fd('0x2d')],_0x1fc7e1[_0xb8fd('0x2e')]);_0x299c95[_0xb8fd('0x31')]=_[_0xb8fd('0x30')](_0x1fc7e1[_0xb8fd('0x2d')],qs[_0xb8fd('0x32')](_0x3a01fb['query']['fields']));_0x299c95['attributes']=_0x299c95[_0xb8fd('0x31')][_0xb8fd('0x33')]?_0x299c95[_0xb8fd('0x31')]:_0x1fc7e1[_0xb8fd('0x2d')];if(!_0x3a01fb[_0xb8fd('0x2e')][_0xb8fd('0x34')](_0xb8fd('0x35'))){_0x299c95['limit']=qs[_0xb8fd('0x1a')](_0x3a01fb[_0xb8fd('0x2e')][_0xb8fd('0x1a')]);_0x299c95[_0xb8fd('0x1d')]=qs[_0xb8fd('0x1d')](_0x3a01fb['query'][_0xb8fd('0x1d')]);}_0x299c95[_0xb8fd('0x36')]=qs[_0xb8fd('0x37')](_0x3a01fb['query'][_0xb8fd('0x37')]);_0x299c95[_0xb8fd('0x38')]=qs[_0xb8fd('0x39')](_[_0xb8fd('0x3a')](_0x3a01fb['query'],_0x1fc7e1[_0xb8fd('0x39')]),_0xd3c83d);if(_0x3a01fb[_0xb8fd('0x2e')]['filter']){_0x299c95[_0xb8fd('0x38')]=_['merge'](_0x299c95[_0xb8fd('0x38')],{'$or':_[_0xb8fd('0x28')](_0xd3c83d,function(_0x2286d4){if(_0x2286d4[_0xb8fd('0x2c')]!=='VIRTUAL'){var _0xf6ee5b={};_0xf6ee5b[_0x2286d4['name']]={'$like':'%'+_0x3a01fb['query'][_0xb8fd('0x3b')]+'%'};return _0xf6ee5b;}})});}_0x299c95=_[_0xb8fd('0x3c')]({},_0x299c95,_0x3a01fb[_0xb8fd('0x3d')]);var _0x1cb87c={'where':_0x299c95[_0xb8fd('0x38')]};return db['FreshsalesField']['count'](_0x1cb87c)[_0xb8fd('0x22')](function(_0xea3af0){_0x54438b[_0xb8fd('0x1c')]=_0xea3af0;if(_0x3a01fb[_0xb8fd('0x2e')]['includeAll']){_0x299c95['include']=[{'all':!![]}];}return db[_0xb8fd('0x29')][_0xb8fd('0x3e')](_0x299c95);})[_0xb8fd('0x22')](function(_0x3f4da8){_0x54438b['rows']=_0x3f4da8;return _0x54438b;})['then'](respondWithFilteredResult(_0x2cfb23,_0x299c95))[_0xb8fd('0x3f')](handleError(_0x2cfb23,null));};exports[_0xb8fd('0x40')]=function(_0x5f5a28,_0x28320d){var _0x4524ff={'raw':!![],'where':{'id':_0x5f5a28[_0xb8fd('0x41')]['id']}},_0x21cf50={};_0x21cf50[_0xb8fd('0x2d')]=_[_0xb8fd('0x2f')](db[_0xb8fd('0x29')][_0xb8fd('0x2a')]);_0x21cf50[_0xb8fd('0x2e')]=_[_0xb8fd('0x2f')](_0x5f5a28[_0xb8fd('0x2e')]);_0x21cf50[_0xb8fd('0x39')]=_[_0xb8fd('0x30')](_0x21cf50['model'],_0x21cf50['query']);_0x4524ff[_0xb8fd('0x31')]=_[_0xb8fd('0x30')](_0x21cf50[_0xb8fd('0x2d')],qs[_0xb8fd('0x32')](_0x5f5a28['query']['fields']));_0x4524ff['attributes']=_0x4524ff['attributes'][_0xb8fd('0x33')]?_0x4524ff[_0xb8fd('0x31')]:_0x21cf50[_0xb8fd('0x2d')];if(_0x5f5a28[_0xb8fd('0x2e')][_0xb8fd('0x42')]){_0x4524ff[_0xb8fd('0x43')]=[{'all':!![]}];}_0x4524ff=_[_0xb8fd('0x3c')]({},_0x4524ff,_0x5f5a28[_0xb8fd('0x3d')]);return db[_0xb8fd('0x29')][_0xb8fd('0x44')](_0x4524ff)[_0xb8fd('0x22')](handleEntityNotFound(_0x28320d,null))[_0xb8fd('0x22')](respondWithResult(_0x28320d,null))[_0xb8fd('0x3f')](handleError(_0x28320d,null));};exports[_0xb8fd('0x45')]=function(_0x4ee7b5,_0x11a429){return db[_0xb8fd('0x29')][_0xb8fd('0x45')](_0x4ee7b5[_0xb8fd('0x46')],{})[_0xb8fd('0x22')](respondWithResult(_0x11a429,0xc9))[_0xb8fd('0x3f')](handleError(_0x11a429,null));};exports['update']=function(_0x5b9494,_0x5b1048){if(_0x5b9494['body']['id']){delete _0x5b9494[_0xb8fd('0x46')]['id'];}return db[_0xb8fd('0x29')][_0xb8fd('0x44')]({'where':{'id':_0x5b9494['params']['id']}})[_0xb8fd('0x22')](handleEntityNotFound(_0x5b1048,null))['then'](saveUpdates(_0x5b9494[_0xb8fd('0x46')],null))[_0xb8fd('0x22')](respondWithResult(_0x5b1048,null))['catch'](handleError(_0x5b1048,null));};exports[_0xb8fd('0x21')]=function(_0x1bae0f,_0x5efa19){return db['FreshsalesField'][_0xb8fd('0x44')]({'where':{'id':_0x1bae0f[_0xb8fd('0x41')]['id']}})[_0xb8fd('0x22')](handleEntityNotFound(_0x5efa19,null))['then'](removeEntity(_0x5efa19,null))[_0xb8fd('0x3f')](handleError(_0x5efa19,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 590204b..ddf9fdd 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 _0xef0a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x44a347,_0x965cd4){var _0x4489f1=function(_0x123c30){while(--_0x123c30){_0x44a347['push'](_0x44a347['shift']());}};_0x4489f1(++_0x965cd4);}(_0xef0a,0xdd));var _0xaef0=function(_0x49fb85,_0x18dcaa){_0x49fb85=_0x49fb85-0x0;var _0x23347e=_0xef0a[_0x49fb85];return _0x23347e;};'use strict';var _=require(_0xaef0('0x0'));var util=require(_0xaef0('0x1'));var logger=require(_0xaef0('0x2'))(_0xaef0('0x3'));var moment=require(_0xaef0('0x4'));var BPromise=require(_0xaef0('0x5'));var rp=require(_0xaef0('0x6'));var fs=require('fs');var path=require(_0xaef0('0x7'));var rimraf=require(_0xaef0('0x8'));var config=require(_0xaef0('0x9'));var attributes=require(_0xaef0('0xa'));module['exports']=function(_0x32868a,_0x12dd17){return _0x32868a[_0xaef0('0xb')](_0xaef0('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xaef0('0xd'),_0xaef0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac35=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','freshsales_unique_index','idField'];(function(_0x3d3ca4,_0x46d385){var _0x180a39=function(_0x3307cf){while(--_0x3307cf){_0x3d3ca4['push'](_0x3d3ca4['shift']());}};_0x180a39(++_0x46d385);}(_0xac35,0x141));var _0x5ac3=function(_0x1ca0d5,_0x3960bd){_0x1ca0d5=_0x1ca0d5-0x0;var _0x3aad05=_0xac35[_0x1ca0d5];return _0x3aad05;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var logger=require(_0x5ac3('0x2'))(_0x5ac3('0x3'));var moment=require(_0x5ac3('0x4'));var BPromise=require(_0x5ac3('0x5'));var rp=require(_0x5ac3('0x6'));var fs=require('fs');var path=require(_0x5ac3('0x7'));var rimraf=require(_0x5ac3('0x8'));var config=require(_0x5ac3('0x9'));var attributes=require(_0x5ac3('0xa'));module[_0x5ac3('0xb')]=function(_0x33a8f2,_0x13d4fb){return _0x33a8f2['define'](_0x5ac3('0xc'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x5ac3('0xd'),'fields':[_0x5ac3('0xe'),_0x5ac3('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 468dda8..9950688 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 _0xf61e=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4148c7,_0x5a8ab9){var _0x174690=function(_0x2ae68a){while(--_0x2ae68a){_0x4148c7['push'](_0x4148c7['shift']());}};_0x174690(++_0x5a8ab9);}(_0xf61e,0x191));var _0xef61=function(_0x54417c,_0x27ae91){_0x54417c=_0x54417c-0x0;var _0x24e98b=_0xf61e[_0x54417c];return _0x24e98b;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file +var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x16fee5,_0x392d4e){var _0x2f042a=function(_0x1d8340){while(--_0x1d8340){_0x16fee5['push'](_0x16fee5['shift']());}};_0x2f042a(++_0x392d4e);}(_0x1883,0xab));var _0x3188=function(_0x538751,_0x3217e6){_0x538751=_0x538751-0x0;var _0x52ebe8=_0x1883[_0x538751];return _0x52ebe8;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index cf8689f..d4c65b6 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(_0x1df980,_0x2bb80a){var _0x3d0e9a=function(_0x447ce9){while(--_0x447ce9){_0x1df980['push'](_0x1df980['shift']());}};_0x3d0e9a(++_0x2bb80a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x565ddb,_0x2e3dce){var _0x1c3b57=function(_0x23d1b5){while(--_0x23d1b5){_0x565ddb['push'](_0x565ddb['shift']());}};_0x1c3b57(++_0x2e3dce);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index cff6103..4297ccf 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 _0x6d38=['exports','STRING','ENUM','integrationTab','newTab'];(function(_0x50856f,_0x262f2c){var _0x505ca2=function(_0x4df2f2){while(--_0x4df2f2){_0x50856f['push'](_0x50856f['shift']());}};_0x505ca2(++_0x262f2c);}(_0x6d38,0x1ef));var _0x86d3=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6d38[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x86d3('0x0')]={'name':{'type':Sequelize[_0x86d3('0x1')]},'description':{'type':Sequelize[_0x86d3('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x86d3('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x86d3('0x1')]},'clientSecret':{'type':Sequelize[_0x86d3('0x1')]},'securityToken':{'type':Sequelize[_0x86d3('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x86d3('0x2')](_0x86d3('0x3'),_0x86d3('0x4')),'defaultValue':_0x86d3('0x3')}}; \ No newline at end of file +var _0xd481=['username','ENUM','newTab','integrationTab','sequelize','STRING'];(function(_0x1385dc,_0x2c7fd7){var _0x2f6469=function(_0x47ed8a){while(--_0x47ed8a){_0x1385dc['push'](_0x1385dc['shift']());}};_0x2f6469(++_0x2c7fd7);}(_0xd481,0x1e4));var _0x1d48=function(_0x4e1169,_0xc95789){_0x4e1169=_0x4e1169-0x0;var _0x7d531c=_0xd481[_0x4e1169];return _0x7d531c;};'use strict';var Sequelize=require(_0x1d48('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d48('0x1')]},'description':{'type':Sequelize[_0x1d48('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x1d48('0x2')},'remoteUri':{'type':Sequelize[_0x1d48('0x1')]},'password':{'type':Sequelize[_0x1d48('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1d48('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1d48('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1d48('0x3')]('integrationTab',_0x1d48('0x4')),'defaultValue':_0x1d48('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 8574da2..cfed9ca 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 _0xe685=['error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','map','SalesforceAccount','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','options','find','catch','create','body','getConfigurations','findOne','SalesforceConfiguration','order','sort','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','securityToken','slice','Connection','login','concat','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','includes','label','custom','value','True','false','test','statusCode'];(function(_0x51f111,_0x52357b){var _0x572dd2=function(_0x501431){while(--_0x501431){_0x51f111['push'](_0x51f111['shift']());}};_0x572dd2(++_0x52357b);}(_0xe685,0xea));var _0x5e68=function(_0x5bc773,_0x5b0e17){_0x5bc773=_0x5bc773-0x0;var _0x10cf24=_0xe685[_0x5bc773];return _0x10cf24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e68('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5e68('0x1'));var BPromise=require(_0x5e68('0x2'));var Mustache=require(_0x5e68('0x3'));var util=require(_0x5e68('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x5e68('0x5'));var ejs=require(_0x5e68('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5e68('0x7'));var squel=require(_0x5e68('0x8'));var crypto=require(_0x5e68('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5e68('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5e68('0xb'));var Redis=require('ioredis');var authService=require(_0x5e68('0xc'));var qs=require(_0x5e68('0xd'));var as=require(_0x5e68('0xe'));var hardwareService=require(_0x5e68('0xf'));var logger=require(_0x5e68('0x10'))('api');var utils=require(_0x5e68('0x11'));var config=require(_0x5e68('0x12'));var licenseUtil=require(_0x5e68('0x13'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x291fa7,_0x2554c3){_0x2554c3=_0x2554c3||0xcc;return function(_0x38ff33){if(_0x38ff33){return _0x291fa7[_0x5e68('0x14')](_0x2554c3);}return _0x291fa7[_0x5e68('0x15')](_0x2554c3)[_0x5e68('0x16')]();};}function respondWithResult(_0x4208d7,_0x1bdb60){_0x1bdb60=_0x1bdb60||0xc8;return function(_0x465783){if(_0x465783){return _0x4208d7['status'](_0x1bdb60)[_0x5e68('0x17')](_0x465783);}};}function respondWithFilteredResult(_0x353819,_0x481c8c){return function(_0x1d4abe){if(_0x1d4abe){var _0x16d0ef=typeof _0x481c8c[_0x5e68('0x18')]===_0x5e68('0x19')&&typeof _0x481c8c[_0x5e68('0x1a')]==='undefined';var _0x5455b5=_0x1d4abe[_0x5e68('0x1b')];var _0x47bc04=_0x16d0ef?0x0:_0x481c8c[_0x5e68('0x18')];var _0x4b9d65=_0x16d0ef?_0x1d4abe[_0x5e68('0x1b')]:_0x481c8c[_0x5e68('0x18')]+_0x481c8c[_0x5e68('0x1a')];var _0x3ef5d6;if(_0x4b9d65>=_0x5455b5){_0x4b9d65=_0x5455b5;_0x3ef5d6=0xc8;}else{_0x3ef5d6=0xce;}_0x353819[_0x5e68('0x15')](_0x3ef5d6);return _0x353819[_0x5e68('0x1c')](_0x5e68('0x1d'),_0x47bc04+'-'+_0x4b9d65+'/'+_0x5455b5)['json'](_0x1d4abe);}return null;};}function patchUpdates(_0x2ed0a7){return function(_0x42be03){try{jsonpatch[_0x5e68('0x1e')](_0x42be03,_0x2ed0a7,!![]);}catch(_0x5b2dc5){return BPromise[_0x5e68('0x1f')](_0x5b2dc5);}return _0x42be03[_0x5e68('0x20')]();};}function saveUpdates(_0x194ccc,_0xed6bef){return function(_0x5afd12){if(_0x5afd12){return _0x5afd12[_0x5e68('0x21')](_0x194ccc)['then'](function(_0x1094b6){return _0x1094b6;});}return null;};}function removeEntity(_0x27a5b0,_0x640f4c){return function(_0x44da71){if(_0x44da71){return _0x44da71[_0x5e68('0x22')]()[_0x5e68('0x23')](function(){_0x27a5b0[_0x5e68('0x15')](0xcc)[_0x5e68('0x16')]();});}};}function handleEntityNotFound(_0x288084,_0x57ec6b){return function(_0xa6496a){if(!_0xa6496a){_0x288084[_0x5e68('0x14')](0x194);}return _0xa6496a;};}function handleError(_0x449ca6,_0x4c3dc1){_0x4c3dc1=_0x4c3dc1||0x1f4;return function(_0x2c9a27){logger['error'](_0x2c9a27['stack']);if(_0x2c9a27[_0x5e68('0x24')]){delete _0x2c9a27['name'];}_0x449ca6[_0x5e68('0x15')](_0x4c3dc1)[_0x5e68('0x25')](_0x2c9a27);};}exports['index']=function(_0x223284,_0x54a495){var _0x2eb50f={},_0x5003d3={},_0x4d320b={'count':0x0,'rows':[]};var _0x321b6f=_[_0x5e68('0x26')](db[_0x5e68('0x27')]['rawAttributes'],function(_0x2e1028){return{'name':_0x2e1028[_0x5e68('0x28')],'type':_0x2e1028[_0x5e68('0x29')]['key']};});_0x5003d3['model']=_['map'](_0x321b6f,'name');_0x5003d3[_0x5e68('0x2a')]=_[_0x5e68('0x2b')](_0x223284['query']);_0x5003d3[_0x5e68('0x2c')]=_[_0x5e68('0x2d')](_0x5003d3['model'],_0x5003d3[_0x5e68('0x2a')]);_0x2eb50f['attributes']=_[_0x5e68('0x2d')](_0x5003d3[_0x5e68('0x2e')],qs[_0x5e68('0x2f')](_0x223284['query'][_0x5e68('0x2f')]));_0x2eb50f[_0x5e68('0x30')]=_0x2eb50f[_0x5e68('0x30')][_0x5e68('0x31')]?_0x2eb50f['attributes']:_0x5003d3[_0x5e68('0x2e')];if(!_0x223284[_0x5e68('0x2a')][_0x5e68('0x32')]('nolimit')){_0x2eb50f[_0x5e68('0x1a')]=qs[_0x5e68('0x1a')](_0x223284[_0x5e68('0x2a')][_0x5e68('0x1a')]);_0x2eb50f[_0x5e68('0x18')]=qs['offset'](_0x223284['query'][_0x5e68('0x18')]);}_0x2eb50f['order']=qs['sort'](_0x223284[_0x5e68('0x2a')]['sort']);_0x2eb50f[_0x5e68('0x33')]=qs[_0x5e68('0x2c')](_[_0x5e68('0x34')](_0x223284[_0x5e68('0x2a')],_0x5003d3[_0x5e68('0x2c')]),_0x321b6f);if(_0x223284['query'][_0x5e68('0x35')]){_0x2eb50f['where']=_[_0x5e68('0x36')](_0x2eb50f['where'],{'$or':_[_0x5e68('0x26')](_0x321b6f,function(_0x29b88b){if(_0x29b88b['type']!==_0x5e68('0x37')){var _0x30ff75={};_0x30ff75[_0x29b88b[_0x5e68('0x24')]]={'$like':'%'+_0x223284[_0x5e68('0x2a')]['filter']+'%'};return _0x30ff75;}})});}_0x2eb50f=_[_0x5e68('0x36')]({},_0x2eb50f,_0x223284['options']);var _0xf8f665={'where':_0x2eb50f['where']};return db[_0x5e68('0x27')][_0x5e68('0x1b')](_0xf8f665)[_0x5e68('0x23')](function(_0x138484){_0x4d320b[_0x5e68('0x1b')]=_0x138484;if(_0x223284[_0x5e68('0x2a')][_0x5e68('0x38')]){_0x2eb50f[_0x5e68('0x39')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x2eb50f);})[_0x5e68('0x23')](function(_0x18fcb9){_0x4d320b[_0x5e68('0x3a')]=_0x18fcb9;return _0x4d320b;})[_0x5e68('0x23')](respondWithFilteredResult(_0x54a495,_0x2eb50f))['catch'](handleError(_0x54a495,null));};exports[_0x5e68('0x3b')]=function(_0x53e721,_0x2c2674){var _0xc4b15={'raw':![],'where':{'id':_0x53e721[_0x5e68('0x3c')]['id']}},_0x46a45e={};_0x46a45e[_0x5e68('0x2e')]=_[_0x5e68('0x2b')](db[_0x5e68('0x27')][_0x5e68('0x3d')]);_0x46a45e['query']=_[_0x5e68('0x2b')](_0x53e721[_0x5e68('0x2a')]);_0x46a45e[_0x5e68('0x2c')]=_[_0x5e68('0x2d')](_0x46a45e['model'],_0x46a45e['query']);_0xc4b15[_0x5e68('0x30')]=_['intersection'](_0x46a45e[_0x5e68('0x2e')],qs['fields'](_0x53e721[_0x5e68('0x2a')]['fields']));_0xc4b15[_0x5e68('0x30')]=_0xc4b15[_0x5e68('0x30')][_0x5e68('0x31')]?_0xc4b15[_0x5e68('0x30')]:_0x46a45e[_0x5e68('0x2e')];if(_0x53e721[_0x5e68('0x2a')][_0x5e68('0x38')]){_0xc4b15['include']=[{'all':!![]}];}_0xc4b15=_[_0x5e68('0x36')]({},_0xc4b15,_0x53e721[_0x5e68('0x3e')]);return db[_0x5e68('0x27')][_0x5e68('0x3f')](_0xc4b15)[_0x5e68('0x23')](handleEntityNotFound(_0x2c2674,null))[_0x5e68('0x23')](respondWithResult(_0x2c2674,null))[_0x5e68('0x40')](handleError(_0x2c2674,null));};exports[_0x5e68('0x41')]=function(_0x155ec6,_0x58f7b4){return db[_0x5e68('0x27')][_0x5e68('0x41')](_0x155ec6[_0x5e68('0x42')],{})[_0x5e68('0x23')](respondWithResult(_0x58f7b4,0xc9))[_0x5e68('0x40')](handleError(_0x58f7b4,null));};exports[_0x5e68('0x21')]=function(_0x1f45b0,_0x49dfd1){if(_0x1f45b0[_0x5e68('0x42')]['id']){delete _0x1f45b0['body']['id'];}return db[_0x5e68('0x27')][_0x5e68('0x3f')]({'where':{'id':_0x1f45b0[_0x5e68('0x3c')]['id']}})[_0x5e68('0x23')](handleEntityNotFound(_0x49dfd1,null))[_0x5e68('0x23')](saveUpdates(_0x1f45b0[_0x5e68('0x42')],null))[_0x5e68('0x23')](respondWithResult(_0x49dfd1,null))['catch'](handleError(_0x49dfd1,null));};exports[_0x5e68('0x22')]=function(_0x180efb,_0xcbefdd){return db[_0x5e68('0x27')][_0x5e68('0x3f')]({'where':{'id':_0x180efb['params']['id']}})[_0x5e68('0x23')](handleEntityNotFound(_0xcbefdd,null))[_0x5e68('0x23')](removeEntity(_0xcbefdd,null))[_0x5e68('0x40')](handleError(_0xcbefdd,null));};exports[_0x5e68('0x43')]=function(_0x234f0c,_0x1420f3,_0x160af1){var _0x3e9556={};var _0x3cbde2={};var _0x51a599;var _0x58d9b8;return db[_0x5e68('0x27')][_0x5e68('0x44')]({'where':{'id':_0x234f0c[_0x5e68('0x3c')]['id']}})[_0x5e68('0x23')](handleEntityNotFound(_0x1420f3,null))[_0x5e68('0x23')](function(_0x58171c){if(_0x58171c){_0x51a599=_0x58171c;_0x3cbde2['model']=_['keys'](db[_0x5e68('0x45')][_0x5e68('0x3d')]);_0x3cbde2['query']=_[_0x5e68('0x2b')](_0x234f0c[_0x5e68('0x2a')]);_0x3cbde2[_0x5e68('0x2c')]=_[_0x5e68('0x2d')](_0x3cbde2[_0x5e68('0x2e')],_0x3cbde2[_0x5e68('0x2a')]);_0x3e9556[_0x5e68('0x30')]=_[_0x5e68('0x2d')](_0x3cbde2['model'],qs[_0x5e68('0x2f')](_0x234f0c['query']['fields']));_0x3e9556['attributes']=_0x3e9556[_0x5e68('0x30')]['length']?_0x3e9556[_0x5e68('0x30')]:_0x3cbde2[_0x5e68('0x2e')];_0x3e9556[_0x5e68('0x46')]=qs['sort'](_0x234f0c['query'][_0x5e68('0x47')]);_0x3e9556['where']=qs[_0x5e68('0x2c')](_[_0x5e68('0x34')](_0x234f0c[_0x5e68('0x2a')],_0x3cbde2[_0x5e68('0x2c')]));if(_0x234f0c['query'][_0x5e68('0x35')]){_0x3e9556['where']=_[_0x5e68('0x36')](_0x3e9556[_0x5e68('0x33')],{'$or':_[_0x5e68('0x26')](_0x3e9556[_0x5e68('0x30')],function(_0x5796c8){var _0x494c41={};_0x494c41[_0x5796c8]={'$like':'%'+_0x234f0c['query']['filter']+'%'};return _0x494c41;})});}_0x3e9556=_[_0x5e68('0x36')]({},_0x3e9556,_0x234f0c['options']);return _0x51a599['getConfigurations'](_0x3e9556);}})[_0x5e68('0x23')](function(_0x15e61b){if(_0x15e61b){_0x58d9b8=_0x15e61b[_0x5e68('0x31')];if(!_0x234f0c[_0x5e68('0x2a')][_0x5e68('0x32')](_0x5e68('0x48'))){_0x3e9556['limit']=qs['limit'](_0x234f0c[_0x5e68('0x2a')]['limit']);_0x3e9556[_0x5e68('0x18')]=qs[_0x5e68('0x18')](_0x234f0c[_0x5e68('0x2a')][_0x5e68('0x18')]);}return _0x51a599['getConfigurations'](_0x3e9556);}})[_0x5e68('0x23')](function(_0x481ae2){if(_0x481ae2){return _0x481ae2?{'count':_0x58d9b8,'rows':_0x481ae2}:null;}})[_0x5e68('0x23')](respondWithResult(_0x1420f3,null))[_0x5e68('0x40')](handleError(_0x1420f3,null));};exports[_0x5e68('0x49')]=function(_0x5791b0,_0x2a68b2,_0x33e1c3){if(_0x5791b0[_0x5e68('0x42')]['id']){delete _0x5791b0[_0x5e68('0x42')]['id'];}return db[_0x5e68('0x27')][_0x5e68('0x44')]({'where':{'id':_0x5791b0[_0x5e68('0x3c')]['id']}})[_0x5e68('0x23')](handleEntityNotFound(_0x2a68b2,null))[_0x5e68('0x23')](function(_0x1cba14){if(_0x1cba14){_0x5791b0[_0x5e68('0x42')]['AccountId']=_0x1cba14['id'];_0x5791b0[_0x5e68('0x42')][_0x5e68('0x4a')]=integrations[_0x5e68('0x4b')](_0x5791b0['body'][_0x5e68('0x4c')],_0x5791b0['body'][_0x5e68('0x29')]);_0x5791b0[_0x5e68('0x42')][_0x5e68('0x4d')]=integrations[_0x5e68('0x4e')](_0x5791b0[_0x5e68('0x42')]['channel'],_0x5791b0['body']['type']);return db[_0x5e68('0x45')][_0x5e68('0x41')](_0x5791b0[_0x5e68('0x42')],{'include':[{'model':db[_0x5e68('0x4f')],'as':_0x5e68('0x4a')},{'model':db[_0x5e68('0x4f')],'as':'Descriptions'}]});}return null;})[_0x5e68('0x23')](respondWithResult(_0x2a68b2,null))[_0x5e68('0x40')](handleError(_0x2a68b2,null));};exports[_0x5e68('0x50')]=function(_0x414e15,_0x523786,_0x5e0bd3){var _0x35a053;var _0x376a31='';var _0x36444f='Task';return db['SalesforceAccount'][_0x5e68('0x44')]({'where':{'id':_0x414e15[_0x5e68('0x3c')]['id']},'attributes':['id',_0x5e68('0x51'),_0x5e68('0x52'),_0x5e68('0x53'),_0x5e68('0x54'),_0x5e68('0x55'),_0x5e68('0x56')]})['then'](handleEntityNotFound(_0x523786,null))['then'](function(_0x357d81){if(_0x357d81){_0x376a31=_0x357d81[_0x5e68('0x51')];var _0x5064dc=_0x376a31[_0x5e68('0x57')](-0x1);if(_0x5064dc==='/'){_0x376a31=_0x376a31['substring'](0x0,_0x376a31['lastIndexOf'](_0x5064dc));}_0x35a053=new jsforce[(_0x5e68('0x58'))]({'oauth2':{'loginUrl':_0x376a31,'clientId':_0x357d81['clientId'],'clientSecret':_0x357d81['clientSecret']}});return _0x35a053[_0x5e68('0x59')](_0x357d81['username'],_0x357d81[_0x5e68('0x55')][_0x5e68('0x5a')](_0x357d81['securityToken']));}})[_0x5e68('0x23')](function(_0x2e641f){if(_0x2e641f){if(!_['isNil'](_0x414e15['query']['ticketType'])){_0x36444f=_0x414e15[_0x5e68('0x2a')][_0x5e68('0x5b')];}return _0x35a053[_0x5e68('0x5c')](_0x36444f)['describe']();}})[_0x5e68('0x23')](function(_0x2bb561){var _0x2a1cbc=['OwnerId',_0x5e68('0x5d'),_0x5e68('0x5e'),_0x5e68('0x5f'),_0x5e68('0x60'),'Description'];var _0x1fd199=[_0x5e68('0x61'),_0x5e68('0x62'),_0x5e68('0x63'),_0x5e68('0x64'),_0x5e68('0x65'),_0x5e68('0x66'),'phone'];if(_0x2bb561){_['remove'](_0x2bb561[_0x5e68('0x2f')],function(_0x83bd4e){return _0x2a1cbc['includes'](_0x83bd4e[_0x5e68('0x24')])||!_0x1fd199[_0x5e68('0x67')](_0x83bd4e[_0x5e68('0x29')]);});return{'count':_0x2bb561[_0x5e68('0x2f')][_0x5e68('0x31')],'rows':_[_0x5e68('0x26')](_0x2bb561['fields'],function(_0x42f246){return{'id':_0x42f246[_0x5e68('0x24')],'name':_0x42f246[_0x5e68('0x68')],'custom':_0x42f246[_0x5e68('0x69')],'options':_0x42f246['picklistValues'][_0x5e68('0x31')]>0x0?_[_0x5e68('0x26')](_0x42f246['picklistValues'],function(_0xd8cd99){return{'name':_0xd8cd99[_0x5e68('0x68')],'value':_0xd8cd99[_0x5e68('0x6a')]};}):_0x42f246[_0x5e68('0x29')]==_0x5e68('0x64')?[{'name':_0x5e68('0x6b'),'value':'true'},{'name':'False','value':_0x5e68('0x6c')}]:[]};})};}})[_0x5e68('0x23')](respondWithResult(_0x523786,null))[_0x5e68('0x40')](function(_0x5c06cb){var _0x1b7bae=_0x414e15[_0x5e68('0x2a')][_0x5e68('0x6d')]?0x1f4:_0x5c06cb[_0x5e68('0x6e')]||0x1f4;logger[_0x5e68('0x6f')](_0x5e68('0x70'),_0x5e68('0x50'),_0x1b7bae,JSON[_0x5e68('0x71')](_0x5c06cb));delete _0x5c06cb[_0x5e68('0x24')];if(_0x1b7bae===0x191){_0x1b7bae=0x190;}_0x523786['status'](_0x1b7bae)[_0x5e68('0x25')](_0x414e15['query'][_0x5e68('0x6d')]?{'message':_0x5e68('0x72'),'statusCode':_0x5c06cb['statusCode']}:_0x5c06cb);});}; \ No newline at end of file +var _0x3a4b=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SalesforceAccount','includeAll','include','findAll','catch','keys','length','options','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Subjects','getFields','Task','clientId','clientSecret','username','securityToken','remoteUri','slice','substring','Connection','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','textarea','phone','remove','includes','label','custom','picklistValues','value','True','False','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a4b,0x151));var _0xb3a4=function(_0x353ab7,_0x3c507b){_0x353ab7=_0x353ab7-0x0;var _0x5c663e=_0x3a4b[_0x353ab7];return _0x5c663e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3a4('0x0'));var zipdir=require(_0xb3a4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3a4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb3a4('0x3'));var path=require('path');var sox=require(_0xb3a4('0x4'));var csv=require(_0xb3a4('0x5'));var ejs=require(_0xb3a4('0x6'));var fs=require('fs');var fs_extra=require(_0xb3a4('0x7'));var _=require(_0xb3a4('0x8'));var squel=require(_0xb3a4('0x9'));var crypto=require(_0xb3a4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb3a4('0x5'));var querystring=require(_0xb3a4('0xb'));var Papa=require(_0xb3a4('0xc'));var Redis=require('ioredis');var authService=require(_0xb3a4('0xd'));var qs=require(_0xb3a4('0xe'));var as=require(_0xb3a4('0xf'));var hardwareService=require(_0xb3a4('0x10'));var logger=require(_0xb3a4('0x11'))(_0xb3a4('0x12'));var utils=require(_0xb3a4('0x13'));var config=require(_0xb3a4('0x14'));var licenseUtil=require(_0xb3a4('0x15'));var db=require(_0xb3a4('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e85a4,_0x10860a){_0x10860a=_0x10860a||0xcc;return function(_0x365b13){if(_0x365b13){return _0x5e85a4['sendStatus'](_0x10860a);}return _0x5e85a4[_0xb3a4('0x17')](_0x10860a)[_0xb3a4('0x18')]();};}function respondWithResult(_0x13362d,_0x334e47){_0x334e47=_0x334e47||0xc8;return function(_0x10bdc7){if(_0x10bdc7){return _0x13362d[_0xb3a4('0x17')](_0x334e47)[_0xb3a4('0x19')](_0x10bdc7);}};}function respondWithFilteredResult(_0x2c3f2f,_0x39f600){return function(_0x4589cc){if(_0x4589cc){var _0x1dc821=typeof _0x39f600[_0xb3a4('0x1a')]===_0xb3a4('0x1b')&&typeof _0x39f600[_0xb3a4('0x1c')]===_0xb3a4('0x1b');var _0x44267b=_0x4589cc[_0xb3a4('0x1d')];var _0x463ab0=_0x1dc821?0x0:_0x39f600['offset'];var _0x8e5b5=_0x1dc821?_0x4589cc[_0xb3a4('0x1d')]:_0x39f600['offset']+_0x39f600[_0xb3a4('0x1c')];var _0x14838b;if(_0x8e5b5>=_0x44267b){_0x8e5b5=_0x44267b;_0x14838b=0xc8;}else{_0x14838b=0xce;}_0x2c3f2f[_0xb3a4('0x17')](_0x14838b);return _0x2c3f2f[_0xb3a4('0x1e')]('Content-Range',_0x463ab0+'-'+_0x8e5b5+'/'+_0x44267b)[_0xb3a4('0x19')](_0x4589cc);}return null;};}function patchUpdates(_0x1b46ba){return function(_0x6e0716){try{jsonpatch['apply'](_0x6e0716,_0x1b46ba,!![]);}catch(_0x9f1aed){return BPromise[_0xb3a4('0x1f')](_0x9f1aed);}return _0x6e0716['save']();};}function saveUpdates(_0x4725ad,_0x1e12d3){return function(_0x53adfc){if(_0x53adfc){return _0x53adfc[_0xb3a4('0x20')](_0x4725ad)[_0xb3a4('0x21')](function(_0x26df1c){return _0x26df1c;});}return null;};}function removeEntity(_0x58e238,_0x2615c9){return function(_0x5ac9e8){if(_0x5ac9e8){return _0x5ac9e8[_0xb3a4('0x22')]()[_0xb3a4('0x21')](function(){_0x58e238['status'](0xcc)[_0xb3a4('0x18')]();});}};}function handleEntityNotFound(_0x27b73f,_0x6279f9){return function(_0xeeabb){if(!_0xeeabb){_0x27b73f[_0xb3a4('0x23')](0x194);}return _0xeeabb;};}function handleError(_0x5490c4,_0x1ff82a){_0x1ff82a=_0x1ff82a||0x1f4;return function(_0x586859){logger['error'](_0x586859[_0xb3a4('0x24')]);if(_0x586859[_0xb3a4('0x25')]){delete _0x586859[_0xb3a4('0x25')];}_0x5490c4[_0xb3a4('0x17')](_0x1ff82a)[_0xb3a4('0x26')](_0x586859);};}exports['index']=function(_0x3ccd09,_0x521650){var _0x5d06d7={},_0x2c0b67={},_0x541342={'count':0x0,'rows':[]};var _0x244adb=_[_0xb3a4('0x27')](db['SalesforceAccount'][_0xb3a4('0x28')],function(_0x504924){return{'name':_0x504924[_0xb3a4('0x29')],'type':_0x504924[_0xb3a4('0x2a')][_0xb3a4('0x2b')]};});_0x2c0b67[_0xb3a4('0x2c')]=_[_0xb3a4('0x27')](_0x244adb,_0xb3a4('0x25'));_0x2c0b67['query']=_['keys'](_0x3ccd09[_0xb3a4('0x2d')]);_0x2c0b67[_0xb3a4('0x2e')]=_[_0xb3a4('0x2f')](_0x2c0b67['model'],_0x2c0b67[_0xb3a4('0x2d')]);_0x5d06d7[_0xb3a4('0x30')]=_[_0xb3a4('0x2f')](_0x2c0b67[_0xb3a4('0x2c')],qs[_0xb3a4('0x31')](_0x3ccd09['query'][_0xb3a4('0x31')]));_0x5d06d7[_0xb3a4('0x30')]=_0x5d06d7[_0xb3a4('0x30')]['length']?_0x5d06d7['attributes']:_0x2c0b67['model'];if(!_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x32')](_0xb3a4('0x33'))){_0x5d06d7['limit']=qs[_0xb3a4('0x1c')](_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x1c')]);_0x5d06d7['offset']=qs[_0xb3a4('0x1a')](_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x1a')]);}_0x5d06d7[_0xb3a4('0x34')]=qs[_0xb3a4('0x35')](_0x3ccd09[_0xb3a4('0x2d')]['sort']);_0x5d06d7[_0xb3a4('0x36')]=qs[_0xb3a4('0x2e')](_[_0xb3a4('0x37')](_0x3ccd09[_0xb3a4('0x2d')],_0x2c0b67[_0xb3a4('0x2e')]),_0x244adb);if(_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x38')]){_0x5d06d7[_0xb3a4('0x36')]=_[_0xb3a4('0x39')](_0x5d06d7['where'],{'$or':_[_0xb3a4('0x27')](_0x244adb,function(_0x1a6cde){if(_0x1a6cde['type']!==_0xb3a4('0x3a')){var _0x666847={};_0x666847[_0x1a6cde[_0xb3a4('0x25')]]={'$like':'%'+_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x38')]+'%'};return _0x666847;}})});}_0x5d06d7=_[_0xb3a4('0x39')]({},_0x5d06d7,_0x3ccd09['options']);var _0x294770={'where':_0x5d06d7[_0xb3a4('0x36')]};return db[_0xb3a4('0x3b')][_0xb3a4('0x1d')](_0x294770)[_0xb3a4('0x21')](function(_0x33ae97){_0x541342[_0xb3a4('0x1d')]=_0x33ae97;if(_0x3ccd09[_0xb3a4('0x2d')][_0xb3a4('0x3c')]){_0x5d06d7[_0xb3a4('0x3d')]=[{'all':!![]}];}return db[_0xb3a4('0x3b')][_0xb3a4('0x3e')](_0x5d06d7);})[_0xb3a4('0x21')](function(_0x2d4d5b){_0x541342['rows']=_0x2d4d5b;return _0x541342;})['then'](respondWithFilteredResult(_0x521650,_0x5d06d7))[_0xb3a4('0x3f')](handleError(_0x521650,null));};exports['show']=function(_0x313863,_0x1a6124){var _0x5476e5={'raw':![],'where':{'id':_0x313863['params']['id']}},_0x15510b={};_0x15510b['model']=_[_0xb3a4('0x40')](db['SalesforceAccount'][_0xb3a4('0x28')]);_0x15510b[_0xb3a4('0x2d')]=_[_0xb3a4('0x40')](_0x313863[_0xb3a4('0x2d')]);_0x15510b['filters']=_['intersection'](_0x15510b[_0xb3a4('0x2c')],_0x15510b[_0xb3a4('0x2d')]);_0x5476e5[_0xb3a4('0x30')]=_[_0xb3a4('0x2f')](_0x15510b[_0xb3a4('0x2c')],qs['fields'](_0x313863['query'][_0xb3a4('0x31')]));_0x5476e5[_0xb3a4('0x30')]=_0x5476e5['attributes'][_0xb3a4('0x41')]?_0x5476e5[_0xb3a4('0x30')]:_0x15510b[_0xb3a4('0x2c')];if(_0x313863['query'][_0xb3a4('0x3c')]){_0x5476e5['include']=[{'all':!![]}];}_0x5476e5=_[_0xb3a4('0x39')]({},_0x5476e5,_0x313863[_0xb3a4('0x42')]);return db[_0xb3a4('0x3b')][_0xb3a4('0x43')](_0x5476e5)[_0xb3a4('0x21')](handleEntityNotFound(_0x1a6124,null))[_0xb3a4('0x21')](respondWithResult(_0x1a6124,null))[_0xb3a4('0x3f')](handleError(_0x1a6124,null));};exports[_0xb3a4('0x44')]=function(_0x5c8002,_0x59aa25){return db['SalesforceAccount'][_0xb3a4('0x44')](_0x5c8002['body'],{})[_0xb3a4('0x21')](respondWithResult(_0x59aa25,0xc9))[_0xb3a4('0x3f')](handleError(_0x59aa25,null));};exports[_0xb3a4('0x20')]=function(_0x891f05,_0x53b337){if(_0x891f05[_0xb3a4('0x45')]['id']){delete _0x891f05[_0xb3a4('0x45')]['id'];}return db[_0xb3a4('0x3b')]['find']({'where':{'id':_0x891f05[_0xb3a4('0x46')]['id']}})[_0xb3a4('0x21')](handleEntityNotFound(_0x53b337,null))[_0xb3a4('0x21')](saveUpdates(_0x891f05['body'],null))[_0xb3a4('0x21')](respondWithResult(_0x53b337,null))[_0xb3a4('0x3f')](handleError(_0x53b337,null));};exports['destroy']=function(_0x4618a8,_0x2bce32){return db['SalesforceAccount'][_0xb3a4('0x43')]({'where':{'id':_0x4618a8[_0xb3a4('0x46')]['id']}})['then'](handleEntityNotFound(_0x2bce32,null))[_0xb3a4('0x21')](removeEntity(_0x2bce32,null))[_0xb3a4('0x3f')](handleError(_0x2bce32,null));};exports[_0xb3a4('0x47')]=function(_0x5dd76e,_0x59f072,_0x5c28a5){var _0x6da538={};var _0x27ee56={};var _0x46e8b5;var _0x56f1e9;return db[_0xb3a4('0x3b')][_0xb3a4('0x48')]({'where':{'id':_0x5dd76e['params']['id']}})[_0xb3a4('0x21')](handleEntityNotFound(_0x59f072,null))[_0xb3a4('0x21')](function(_0x2c4791){if(_0x2c4791){_0x46e8b5=_0x2c4791;_0x27ee56[_0xb3a4('0x2c')]=_['keys'](db[_0xb3a4('0x49')]['rawAttributes']);_0x27ee56[_0xb3a4('0x2d')]=_[_0xb3a4('0x40')](_0x5dd76e['query']);_0x27ee56[_0xb3a4('0x2e')]=_[_0xb3a4('0x2f')](_0x27ee56[_0xb3a4('0x2c')],_0x27ee56['query']);_0x6da538[_0xb3a4('0x30')]=_[_0xb3a4('0x2f')](_0x27ee56[_0xb3a4('0x2c')],qs[_0xb3a4('0x31')](_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x31')]));_0x6da538['attributes']=_0x6da538['attributes']['length']?_0x6da538[_0xb3a4('0x30')]:_0x27ee56['model'];_0x6da538['order']=qs[_0xb3a4('0x35')](_0x5dd76e[_0xb3a4('0x2d')]['sort']);_0x6da538[_0xb3a4('0x36')]=qs[_0xb3a4('0x2e')](_[_0xb3a4('0x37')](_0x5dd76e['query'],_0x27ee56[_0xb3a4('0x2e')]));if(_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x38')]){_0x6da538[_0xb3a4('0x36')]=_[_0xb3a4('0x39')](_0x6da538[_0xb3a4('0x36')],{'$or':_[_0xb3a4('0x27')](_0x6da538[_0xb3a4('0x30')],function(_0x2954e1){var _0x2b0ed3={};_0x2b0ed3[_0x2954e1]={'$like':'%'+_0x5dd76e['query']['filter']+'%'};return _0x2b0ed3;})});}_0x6da538=_[_0xb3a4('0x39')]({},_0x6da538,_0x5dd76e['options']);return _0x46e8b5['getConfigurations'](_0x6da538);}})[_0xb3a4('0x21')](function(_0x52c953){if(_0x52c953){_0x56f1e9=_0x52c953[_0xb3a4('0x41')];if(!_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x32')]('nolimit')){_0x6da538[_0xb3a4('0x1c')]=qs['limit'](_0x5dd76e['query']['limit']);_0x6da538[_0xb3a4('0x1a')]=qs[_0xb3a4('0x1a')](_0x5dd76e[_0xb3a4('0x2d')][_0xb3a4('0x1a')]);}return _0x46e8b5[_0xb3a4('0x47')](_0x6da538);}})[_0xb3a4('0x21')](function(_0x2c5643){if(_0x2c5643){return _0x2c5643?{'count':_0x56f1e9,'rows':_0x2c5643}:null;}})[_0xb3a4('0x21')](respondWithResult(_0x59f072,null))[_0xb3a4('0x3f')](handleError(_0x59f072,null));};exports['addConfiguration']=function(_0x107547,_0x54afff,_0x16e08c){if(_0x107547[_0xb3a4('0x45')]['id']){delete _0x107547[_0xb3a4('0x45')]['id'];}return db[_0xb3a4('0x3b')]['findOne']({'where':{'id':_0x107547[_0xb3a4('0x46')]['id']}})[_0xb3a4('0x21')](handleEntityNotFound(_0x54afff,null))['then'](function(_0x5b286f){if(_0x5b286f){_0x107547[_0xb3a4('0x45')]['AccountId']=_0x5b286f['id'];_0x107547['body']['Subjects']=integrations[_0xb3a4('0x4a')](_0x107547['body']['channel'],_0x107547[_0xb3a4('0x45')]['type']);_0x107547['body'][_0xb3a4('0x4b')]=integrations[_0xb3a4('0x4c')](_0x107547['body'][_0xb3a4('0x4d')],_0x107547[_0xb3a4('0x45')]['type']);return db[_0xb3a4('0x49')]['create'](_0x107547[_0xb3a4('0x45')],{'include':[{'model':db[_0xb3a4('0x4e')],'as':_0xb3a4('0x4f')},{'model':db[_0xb3a4('0x4e')],'as':'Descriptions'}]});}return null;})[_0xb3a4('0x21')](respondWithResult(_0x54afff,null))[_0xb3a4('0x3f')](handleError(_0x54afff,null));};exports[_0xb3a4('0x50')]=function(_0x5da9ab,_0x51f72b,_0x2ad750){var _0xbb517c;var _0xbbbe5='';var _0x45c1df=_0xb3a4('0x51');return db[_0xb3a4('0x3b')][_0xb3a4('0x48')]({'where':{'id':_0x5da9ab[_0xb3a4('0x46')]['id']},'attributes':['id','remoteUri',_0xb3a4('0x52'),_0xb3a4('0x53'),_0xb3a4('0x54'),'password',_0xb3a4('0x55')]})[_0xb3a4('0x21')](handleEntityNotFound(_0x51f72b,null))[_0xb3a4('0x21')](function(_0x32a374){if(_0x32a374){_0xbbbe5=_0x32a374[_0xb3a4('0x56')];var _0x3513e1=_0xbbbe5[_0xb3a4('0x57')](-0x1);if(_0x3513e1==='/'){_0xbbbe5=_0xbbbe5[_0xb3a4('0x58')](0x0,_0xbbbe5['lastIndexOf'](_0x3513e1));}_0xbb517c=new jsforce[(_0xb3a4('0x59'))]({'oauth2':{'loginUrl':_0xbbbe5,'clientId':_0x32a374['clientId'],'clientSecret':_0x32a374[_0xb3a4('0x53')]}});return _0xbb517c[_0xb3a4('0x5a')](_0x32a374[_0xb3a4('0x54')],_0x32a374['password'][_0xb3a4('0x5b')](_0x32a374[_0xb3a4('0x55')]));}})[_0xb3a4('0x21')](function(_0x179ce8){if(_0x179ce8){if(!_[_0xb3a4('0x5c')](_0x5da9ab['query'][_0xb3a4('0x5d')])){_0x45c1df=_0x5da9ab[_0xb3a4('0x2d')][_0xb3a4('0x5d')];}return _0xbb517c['sobject'](_0x45c1df)[_0xb3a4('0x5e')]();}})[_0xb3a4('0x21')](function(_0x2d2729){var _0x5a9c95=[_0xb3a4('0x5f'),_0xb3a4('0x60'),_0xb3a4('0x61'),_0xb3a4('0x62'),_0xb3a4('0x63'),_0xb3a4('0x64')];var _0x19b85f=[_0xb3a4('0x65'),'int',_0xb3a4('0x66'),_0xb3a4('0x67'),'email',_0xb3a4('0x68'),_0xb3a4('0x69')];if(_0x2d2729){_[_0xb3a4('0x6a')](_0x2d2729['fields'],function(_0x2753b6){return _0x5a9c95['includes'](_0x2753b6[_0xb3a4('0x25')])||!_0x19b85f[_0xb3a4('0x6b')](_0x2753b6[_0xb3a4('0x2a')]);});return{'count':_0x2d2729['fields'][_0xb3a4('0x41')],'rows':_[_0xb3a4('0x27')](_0x2d2729[_0xb3a4('0x31')],function(_0x2eee5b){return{'id':_0x2eee5b[_0xb3a4('0x25')],'name':_0x2eee5b[_0xb3a4('0x6c')],'custom':_0x2eee5b[_0xb3a4('0x6d')],'options':_0x2eee5b[_0xb3a4('0x6e')][_0xb3a4('0x41')]>0x0?_[_0xb3a4('0x27')](_0x2eee5b[_0xb3a4('0x6e')],function(_0x305263){return{'name':_0x305263[_0xb3a4('0x6c')],'value':_0x305263[_0xb3a4('0x6f')]};}):_0x2eee5b[_0xb3a4('0x2a')]==_0xb3a4('0x67')?[{'name':_0xb3a4('0x70'),'value':'true'},{'name':_0xb3a4('0x71'),'value':'false'}]:[]};})};}})[_0xb3a4('0x21')](respondWithResult(_0x51f72b,null))[_0xb3a4('0x3f')](function(_0x474372){var _0x590fc3=_0x5da9ab[_0xb3a4('0x2d')][_0xb3a4('0x72')]?0x1f4:_0x474372[_0xb3a4('0x73')]||0x1f4;logger[_0xb3a4('0x74')](_0xb3a4('0x75'),_0xb3a4('0x50'),_0x590fc3,JSON['stringify'](_0x474372));delete _0x474372[_0xb3a4('0x25')];if(_0x590fc3===0x191){_0x590fc3=0x190;}_0x51f72b[_0xb3a4('0x17')](_0x590fc3)['send'](_0x5da9ab[_0xb3a4('0x2d')][_0xb3a4('0x72')]?{'message':_0xb3a4('0x76'),'statusCode':_0x474372[_0xb3a4('0x73')]}:_0x474372);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index b0eab29..67b6423 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 _0xd5fe=['bluebird','rimraf','../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xd5fe,0x1ab));var _0xed5f=function(_0x2dee2f,_0x19572f){_0x2dee2f=_0x2dee2f-0x0;var _0x327c18=_0xd5fe[_0x2dee2f];return _0x327c18;};'use strict';var _=require(_0xed5f('0x0'));var util=require(_0xed5f('0x1'));var logger=require('../../config/logger')(_0xed5f('0x2'));var moment=require('moment');var BPromise=require(_0xed5f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed5f('0x4'));var config=require(_0xed5f('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xed5f('0x6')]=function(_0x20a6b9,_0x3a98a7){return _0x20a6b9[_0xed5f('0x7')](_0xed5f('0x8'),attributes,{'tableName':_0xed5f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x807b=['lodash','util','../../config/logger','api','bluebird','path','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount','int_salesforce_accounts'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x807b,0x13f));var _0xb807=function(_0x9c744d,_0x7bd499){_0x9c744d=_0x9c744d-0x0;var _0x1c0718=_0x807b[_0x9c744d];return _0x1c0718;};'use strict';var _=require(_0xb807('0x0'));var util=require(_0xb807('0x1'));var logger=require(_0xb807('0x2'))(_0xb807('0x3'));var moment=require('moment');var BPromise=require(_0xb807('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb807('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb807('0x6'));var integrations=require(_0xb807('0x7'));module[_0xb807('0x8')]=function(_0x309df0,_0x689131){return _0x309df0['define'](_0xb807('0x9'),attributes,{'tableName':_0xb807('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index b52938e..04693e2 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 _0xfbe4=['request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','model','attributes','ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x2f3947,_0x2ee083){var _0x3e6ab7=function(_0x4057c0){while(--_0x4057c0){_0x2f3947['push'](_0x2f3947['shift']());}};_0x3e6ab7(++_0x2ee083);}(_0xfbe4,0x153));var _0x4fbe=function(_0x42f50b,_0x3d5fa7){_0x42f50b=_0x42f50b-0x0;var _0x454ece=_0xfbe4[_0x42f50b];return _0x454ece;};'use strict';var _=require(_0x4fbe('0x0'));var util=require(_0x4fbe('0x1'));var moment=require(_0x4fbe('0x2'));var BPromise=require(_0x4fbe('0x3'));var rs=require(_0x4fbe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fbe('0x5'))['db'];var utils=require(_0x4fbe('0x6'));var logger=require(_0x4fbe('0x7'))('rpc');var config=require(_0x4fbe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4fbe('0x9')][_0x4fbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19a165,_0x4f0f41,_0x1f997b){return new BPromise(function(_0xeef67c,_0xaf771b){return client[_0x4fbe('0xb')](_0x19a165,_0x1f997b)[_0x4fbe('0xc')](function(_0x16518b){logger[_0x4fbe('0xd')](_0x4fbe('0xe'),_0x4f0f41,_0x4fbe('0xf'));logger[_0x4fbe('0x10')](_0x4fbe('0x11'),_0x4f0f41,_0x4fbe('0xf'),JSON[_0x4fbe('0x12')](_0x16518b));if(_0x16518b[_0x4fbe('0x13')]){if(_0x16518b[_0x4fbe('0x13')]['code']===0x1f4){logger[_0x4fbe('0x13')](_0x4fbe('0xe'),_0x4f0f41,_0x16518b[_0x4fbe('0x13')][_0x4fbe('0x14')]);return _0xaf771b(_0x16518b[_0x4fbe('0x13')][_0x4fbe('0x14')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x4f0f41,_0x16518b[_0x4fbe('0x13')]['message']);return _0xeef67c(_0x16518b[_0x4fbe('0x13')]['message']);}else{logger[_0x4fbe('0xd')](_0x4fbe('0xe'),_0x4f0f41,'request\x20sent');_0xeef67c(_0x16518b['result'][_0x4fbe('0x14')]);}})[_0x4fbe('0x15')](function(_0x2db23a){logger[_0x4fbe('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x4f0f41,_0x2db23a);_0xaf771b(_0x2db23a);});});}exports[_0x4fbe('0x16')]=function(_0x149dca){var _0x3f1374=this;return new Promise(function(_0xa18aac,_0x5689a1){return db[_0x4fbe('0x17')][_0x4fbe('0x18')]({'raw':_0x149dca[_0x4fbe('0x19')]?_0x149dca[_0x4fbe('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x149dca[_0x4fbe('0x19')]?_0x149dca[_0x4fbe('0x19')][_0x4fbe('0x1a')]||null:null,'attributes':_0x149dca['options']?_0x149dca[_0x4fbe('0x19')]['attributes']||null:null,'limit':_0x149dca[_0x4fbe('0x19')]?_0x149dca[_0x4fbe('0x19')][_0x4fbe('0x1b')]||null:null,'include':_0x149dca['options']?_0x149dca[_0x4fbe('0x19')][_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x149dca['options'][_0x4fbe('0x1c')],function(_0x12687f){return{'model':db[_0x12687f[_0x4fbe('0x1e')]],'as':_0x12687f['as'],'attributes':_0x12687f[_0x4fbe('0x1f')],'include':_0x12687f[_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x12687f[_0x4fbe('0x1c')],function(_0x536b5a){return{'model':db[_0x536b5a[_0x4fbe('0x1e')]],'as':_0x536b5a['as'],'attributes':_0x536b5a[_0x4fbe('0x1f')],'include':_0x536b5a[_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x536b5a[_0x4fbe('0x1c')],function(_0x4f658e){return{'model':db[_0x4f658e[_0x4fbe('0x1e')]],'as':_0x4f658e['as'],'attributes':_0x4f658e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ab8c5){logger[_0x4fbe('0xd')](_0x4fbe('0x16'),_0x149dca);logger[_0x4fbe('0x10')](_0x4fbe('0x16'),_0x149dca,JSON[_0x4fbe('0x12')](_0x5ab8c5));_0xa18aac(_0x5ab8c5);})['catch'](function(_0x369a6f){logger[_0x4fbe('0x13')](_0x4fbe('0x16'),_0x369a6f['message'],_0x149dca);_0x5689a1(_0x3f1374[_0x4fbe('0x13')](0x1f4,_0x369a6f[_0x4fbe('0x14')]));});});};exports[_0x4fbe('0x20')]=function(_0x291ae8){var _0xe4fa96=this;return new Promise(function(_0x3d5a7e,_0x36620e){return db['SalesforceAccount'][_0x4fbe('0x21')]({'raw':_0x291ae8[_0x4fbe('0x19')]?_0x291ae8['options'][_0x4fbe('0x22')]===undefined?!![]:![]:!![],'where':_0x291ae8[_0x4fbe('0x19')]?_0x291ae8[_0x4fbe('0x19')]['where']||null:null,'attributes':_0x291ae8[_0x4fbe('0x19')]?_0x291ae8['options'][_0x4fbe('0x1f')]||null:null,'include':_0x291ae8['options']?_0x291ae8[_0x4fbe('0x19')]['include']?_[_0x4fbe('0x1d')](_0x291ae8[_0x4fbe('0x19')][_0x4fbe('0x1c')],function(_0x77b58f){return{'model':db[_0x77b58f[_0x4fbe('0x1e')]],'as':_0x77b58f['as'],'attributes':_0x77b58f[_0x4fbe('0x1f')],'include':_0x77b58f[_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x77b58f['include'],function(_0x24228d){return{'model':db[_0x24228d[_0x4fbe('0x1e')]],'as':_0x24228d['as'],'attributes':_0x24228d[_0x4fbe('0x1f')],'include':_0x24228d['include']?_[_0x4fbe('0x1d')](_0x24228d[_0x4fbe('0x1c')],function(_0x2b3c47){return{'model':db[_0x2b3c47[_0x4fbe('0x1e')]],'as':_0x2b3c47['as'],'attributes':_0x2b3c47[_0x4fbe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4fbe('0xc')](function(_0x3102ee){logger[_0x4fbe('0xd')](_0x4fbe('0x20'),_0x291ae8);logger['debug'](_0x4fbe('0x20'),_0x291ae8,JSON[_0x4fbe('0x12')](_0x3102ee));_0x3d5a7e(_0x3102ee);})[_0x4fbe('0x15')](function(_0x8f46c0){logger['error'](_0x4fbe('0x20'),_0x8f46c0[_0x4fbe('0x14')],_0x291ae8);_0x36620e(_0xe4fa96[_0x4fbe('0x13')](0x1f4,_0x8f46c0['message']));});});}; \ No newline at end of file +var _0x1fb4=['code','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x188dc5,_0x56631f){var _0x450d46=function(_0x368e4c){while(--_0x368e4c){_0x188dc5['push'](_0x188dc5['shift']());}};_0x450d46(++_0x56631f);}(_0x1fb4,0x120));var _0x41fb=function(_0x1e2bc4,_0x360038){_0x1e2bc4=_0x1e2bc4-0x0;var _0x19a465=_0x1fb4[_0x1e2bc4];return _0x19a465;};'use strict';var _=require(_0x41fb('0x0'));var util=require(_0x41fb('0x1'));var moment=require(_0x41fb('0x2'));var BPromise=require(_0x41fb('0x3'));var rs=require(_0x41fb('0x4'));var fs=require('fs');var Redis=require(_0x41fb('0x5'));var db=require(_0x41fb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x41fb('0x7'))('rpc');var config=require(_0x41fb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41fb('0x9')][_0x41fb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33cd84,_0x11dadf,_0x343b7a){return new BPromise(function(_0x3ba6b5,_0x456be4){return client[_0x41fb('0xb')](_0x33cd84,_0x343b7a)[_0x41fb('0xc')](function(_0x36b45b){logger[_0x41fb('0xd')](_0x41fb('0xe'),_0x11dadf,_0x41fb('0xf'));logger[_0x41fb('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x11dadf,_0x41fb('0xf'),JSON['stringify'](_0x36b45b));if(_0x36b45b[_0x41fb('0x11')]){if(_0x36b45b[_0x41fb('0x11')][_0x41fb('0x12')]===0x1f4){logger[_0x41fb('0x11')](_0x41fb('0xe'),_0x11dadf,_0x36b45b[_0x41fb('0x11')]['message']);return _0x456be4(_0x36b45b[_0x41fb('0x11')][_0x41fb('0x13')]);}logger[_0x41fb('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x11dadf,_0x36b45b['error'][_0x41fb('0x13')]);return _0x3ba6b5(_0x36b45b[_0x41fb('0x11')]['message']);}else{logger[_0x41fb('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x11dadf,_0x41fb('0xf'));_0x3ba6b5(_0x36b45b[_0x41fb('0x14')]['message']);}})[_0x41fb('0x15')](function(_0x1f5f5d){logger[_0x41fb('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x11dadf,_0x1f5f5d);_0x456be4(_0x1f5f5d);});});}exports[_0x41fb('0x16')]=function(_0x5389f9){var _0x31c53a=this;return new Promise(function(_0x567739,_0x4f0298){return db[_0x41fb('0x17')]['findAll']({'raw':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')]['where']||null:null,'attributes':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')][_0x41fb('0x19')]||null:null,'limit':_0x5389f9[_0x41fb('0x18')]?_0x5389f9[_0x41fb('0x18')][_0x41fb('0x1a')]||null:null,'include':_0x5389f9['options']?_0x5389f9[_0x41fb('0x18')][_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x5389f9['options'][_0x41fb('0x1b')],function(_0x4e670b){return{'model':db[_0x4e670b[_0x41fb('0x1d')]],'as':_0x4e670b['as'],'attributes':_0x4e670b['attributes'],'include':_0x4e670b[_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x4e670b[_0x41fb('0x1b')],function(_0x1aff06){return{'model':db[_0x1aff06[_0x41fb('0x1d')]],'as':_0x1aff06['as'],'attributes':_0x1aff06[_0x41fb('0x19')],'include':_0x1aff06[_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x1aff06[_0x41fb('0x1b')],function(_0x23b347){return{'model':db[_0x23b347[_0x41fb('0x1d')]],'as':_0x23b347['as'],'attributes':_0x23b347['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30868b){logger[_0x41fb('0xd')]('GetSalesforceAccount',_0x5389f9);logger[_0x41fb('0x10')](_0x41fb('0x16'),_0x5389f9,JSON[_0x41fb('0x1e')](_0x30868b));_0x567739(_0x30868b);})[_0x41fb('0x15')](function(_0x20733d){logger[_0x41fb('0x11')](_0x41fb('0x16'),_0x20733d[_0x41fb('0x13')],_0x5389f9);_0x4f0298(_0x31c53a[_0x41fb('0x11')](0x1f4,_0x20733d['message']));});});};exports[_0x41fb('0x1f')]=function(_0x3328ea){var _0x4057f9=this;return new Promise(function(_0x20f7cf,_0x39ed3a){return db[_0x41fb('0x17')]['find']({'raw':_0x3328ea[_0x41fb('0x18')]?_0x3328ea[_0x41fb('0x18')][_0x41fb('0x20')]===undefined?!![]:![]:!![],'where':_0x3328ea[_0x41fb('0x18')]?_0x3328ea[_0x41fb('0x18')][_0x41fb('0x21')]||null:null,'attributes':_0x3328ea[_0x41fb('0x18')]?_0x3328ea[_0x41fb('0x18')][_0x41fb('0x19')]||null:null,'include':_0x3328ea['options']?_0x3328ea[_0x41fb('0x18')]['include']?_[_0x41fb('0x1c')](_0x3328ea[_0x41fb('0x18')][_0x41fb('0x1b')],function(_0x233bfd){return{'model':db[_0x233bfd[_0x41fb('0x1d')]],'as':_0x233bfd['as'],'attributes':_0x233bfd[_0x41fb('0x19')],'include':_0x233bfd[_0x41fb('0x1b')]?_[_0x41fb('0x1c')](_0x233bfd[_0x41fb('0x1b')],function(_0x43319e){return{'model':db[_0x43319e[_0x41fb('0x1d')]],'as':_0x43319e['as'],'attributes':_0x43319e[_0x41fb('0x19')],'include':_0x43319e['include']?_[_0x41fb('0x1c')](_0x43319e[_0x41fb('0x1b')],function(_0x331e19){return{'model':db[_0x331e19[_0x41fb('0x1d')]],'as':_0x331e19['as'],'attributes':_0x331e19[_0x41fb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x41fb('0xc')](function(_0x1c1bf3){logger[_0x41fb('0xd')](_0x41fb('0x1f'),_0x3328ea);logger[_0x41fb('0x10')](_0x41fb('0x1f'),_0x3328ea,JSON[_0x41fb('0x1e')](_0x1c1bf3));_0x20f7cf(_0x1c1bf3);})[_0x41fb('0x15')](function(_0x58c8a1){logger[_0x41fb('0x11')](_0x41fb('0x1f'),_0x58c8a1['message'],_0x3328ea);_0x39ed3a(_0x4057f9[_0x41fb('0x11')](0x1f4,_0x58c8a1[_0x41fb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 957cd31..037af67 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xdb28,0x106));var _0x8db2=function(_0x129047,_0x3617b3){_0x129047=_0x129047-0x0;var _0x1d5ee0=_0xdb28[_0x129047];return _0x1d5ee0;};'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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x19781c,_0x40d6c2){var _0x4828f6=function(_0x198070){while(--_0x198070){_0x19781c['push'](_0x19781c['shift']());}};_0x4828f6(++_0x40d6c2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index a90fedf..218ecb5 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 _0x0918=['account','contact_lead','nothing','lead','STRING','ENUM','Task','Case','contact'];(function(_0x51b861,_0xb480d3){var _0x52401b=function(_0x30c1ea){while(--_0x30c1ea){_0x51b861['push'](_0x51b861['shift']());}};_0x52401b(++_0xb480d3);}(_0x0918,0x1b4));var _0x8091=function(_0x2e7dd0,_0x2e0016){_0x2e7dd0=_0x2e7dd0-0x0;var _0x5699e4=_0x0918[_0x2e7dd0];return _0x5699e4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8091('0x0')]},'description':{'type':Sequelize[_0x8091('0x0')]},'ticketType':{'type':Sequelize[_0x8091('0x1')](_0x8091('0x2'),_0x8091('0x3')),'defaultValue':_0x8091('0x2')},'moduleSearch':{'type':Sequelize[_0x8091('0x1')]('contact_lead',_0x8091('0x4'),'lead','account_contact_lead',_0x8091('0x5')),'defaultValue':_0x8091('0x6')},'moduleCreate':{'type':Sequelize[_0x8091('0x1')](_0x8091('0x7'),_0x8091('0x4'),_0x8091('0x8'),_0x8091('0x5')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x8091('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x8091('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x8091('0x0')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc120=['contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','STRING','Case','Task','ENUM'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xc120,0x1be));var _0x0c12=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xc120[_0xbe200f];return _0x192597;};'use strict';var Sequelize=require(_0x0c12('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c12('0x1')]},'description':{'type':Sequelize[_0x0c12('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x0c12('0x2')),'defaultValue':_0x0c12('0x3')},'moduleSearch':{'type':Sequelize[_0x0c12('0x4')](_0x0c12('0x5'),_0x0c12('0x6'),_0x0c12('0x7'),_0x0c12('0x8'),_0x0c12('0x9')),'defaultValue':_0x0c12('0x5')},'moduleCreate':{'type':Sequelize[_0x0c12('0x4')](_0x0c12('0xa'),_0x0c12('0x6'),_0x0c12('0x7'),_0x0c12('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x0c12('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x0c12('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x0c12('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x0c12('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index b3ae8b7..4095795 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 _0xceee=['stack','name','send','index','map','SalesforceConfiguration','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','findAll','catch','includeAll','include','find','create','body','params','SalesforceField','rawAttributes','order','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy'];(function(_0x4ab60f,_0x40d581){var _0x15319a=function(_0x1f5c7b){while(--_0x1f5c7b){_0x4ab60f['push'](_0x4ab60f['shift']());}};_0x15319a(++_0x40d581);}(_0xceee,0xbb));var _0xecee=function(_0x261d56,_0x31fc38){_0x261d56=_0x261d56-0x0;var _0x1da928=_0xceee[_0x261d56];return _0x1da928;};'use strict';var emlformat=require(_0xecee('0x0'));var rimraf=require(_0xecee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xecee('0x2'));var moment=require(_0xecee('0x3'));var BPromise=require(_0xecee('0x4'));var Mustache=require(_0xecee('0x5'));var util=require(_0xecee('0x6'));var path=require(_0xecee('0x7'));var sox=require('sox');var csv=require(_0xecee('0x8'));var ejs=require(_0xecee('0x9'));var fs=require('fs');var fs_extra=require(_0xecee('0xa'));var _=require(_0xecee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xecee('0xc'));var deskjs=require(_0xecee('0xd'));var toCsv=require('to-csv');var querystring=require(_0xecee('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecee('0xf'));var qs=require(_0xecee('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xecee('0x11'));var utils=require('../../config/utils');var config=require(_0xecee('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xecee('0x13'))['db'];function respondWithStatusCode(_0x9af27d,_0xa72d91){_0xa72d91=_0xa72d91||0xcc;return function(_0x2fb8eb){if(_0x2fb8eb){return _0x9af27d[_0xecee('0x14')](_0xa72d91);}return _0x9af27d[_0xecee('0x15')](_0xa72d91)[_0xecee('0x16')]();};}function respondWithResult(_0x3d8a2f,_0x5793d2){_0x5793d2=_0x5793d2||0xc8;return function(_0x3a7d2f){if(_0x3a7d2f){return _0x3d8a2f[_0xecee('0x15')](_0x5793d2)[_0xecee('0x17')](_0x3a7d2f);}};}function respondWithFilteredResult(_0x23c586,_0x3e04a0){return function(_0x48a9be){if(_0x48a9be){var _0x4754df=typeof _0x3e04a0[_0xecee('0x18')]===_0xecee('0x19')&&typeof _0x3e04a0[_0xecee('0x1a')]===_0xecee('0x19');var _0x1dd609=_0x48a9be[_0xecee('0x1b')];var _0x55dc2a=_0x4754df?0x0:_0x3e04a0[_0xecee('0x18')];var _0x308d2b=_0x4754df?_0x48a9be[_0xecee('0x1b')]:_0x3e04a0['offset']+_0x3e04a0[_0xecee('0x1a')];var _0x45a3af;if(_0x308d2b>=_0x1dd609){_0x308d2b=_0x1dd609;_0x45a3af=0xc8;}else{_0x45a3af=0xce;}_0x23c586[_0xecee('0x15')](_0x45a3af);return _0x23c586[_0xecee('0x1c')](_0xecee('0x1d'),_0x55dc2a+'-'+_0x308d2b+'/'+_0x1dd609)[_0xecee('0x17')](_0x48a9be);}return null;};}function patchUpdates(_0x481198){return function(_0x505af6){try{jsonpatch['apply'](_0x505af6,_0x481198,!![]);}catch(_0x9f8c62){return BPromise[_0xecee('0x1e')](_0x9f8c62);}return _0x505af6[_0xecee('0x1f')]();};}function saveUpdates(_0x86fe0f,_0x27e3d7){return function(_0x23b64a){if(_0x23b64a){return _0x23b64a[_0xecee('0x20')](_0x86fe0f)[_0xecee('0x21')](function(_0xc4ef66){return _0xc4ef66;});}return null;};}function removeEntity(_0x56e11c,_0x455743){return function(_0x5f09b0){if(_0x5f09b0){return _0x5f09b0[_0xecee('0x22')]()['then'](function(){_0x56e11c[_0xecee('0x15')](0xcc)[_0xecee('0x16')]();});}};}function handleEntityNotFound(_0x1ae344,_0x92055f){return function(_0x51f732){if(!_0x51f732){_0x1ae344['sendStatus'](0x194);}return _0x51f732;};}function handleError(_0x25b7af,_0x29f02c){_0x29f02c=_0x29f02c||0x1f4;return function(_0x2e6929){logger['error'](_0x2e6929[_0xecee('0x23')]);if(_0x2e6929[_0xecee('0x24')]){delete _0x2e6929[_0xecee('0x24')];}_0x25b7af[_0xecee('0x15')](_0x29f02c)[_0xecee('0x25')](_0x2e6929);};}exports[_0xecee('0x26')]=function(_0x4410d8,_0x42733d){var _0x4d5bb9={},_0x48e16b={},_0x72ae5f={'count':0x0,'rows':[]};var _0x1d5473=_[_0xecee('0x27')](db[_0xecee('0x28')]['rawAttributes'],function(_0x2ba54f){return{'name':_0x2ba54f['fieldName'],'type':_0x2ba54f[_0xecee('0x29')]['key']};});_0x48e16b[_0xecee('0x2a')]=_[_0xecee('0x27')](_0x1d5473,_0xecee('0x24'));_0x48e16b[_0xecee('0x2b')]=_[_0xecee('0x2c')](_0x4410d8['query']);_0x48e16b[_0xecee('0x2d')]=_[_0xecee('0x2e')](_0x48e16b[_0xecee('0x2a')],_0x48e16b[_0xecee('0x2b')]);_0x4d5bb9[_0xecee('0x2f')]=_[_0xecee('0x2e')](_0x48e16b['model'],qs[_0xecee('0x30')](_0x4410d8[_0xecee('0x2b')]['fields']));_0x4d5bb9[_0xecee('0x2f')]=_0x4d5bb9['attributes'][_0xecee('0x31')]?_0x4d5bb9['attributes']:_0x48e16b['model'];if(!_0x4410d8[_0xecee('0x2b')][_0xecee('0x32')](_0xecee('0x33'))){_0x4d5bb9['limit']=qs[_0xecee('0x1a')](_0x4410d8['query'][_0xecee('0x1a')]);_0x4d5bb9[_0xecee('0x18')]=qs['offset'](_0x4410d8[_0xecee('0x2b')]['offset']);}_0x4d5bb9['order']=qs[_0xecee('0x34')](_0x4410d8[_0xecee('0x2b')]['sort']);_0x4d5bb9['where']=qs['filters'](_[_0xecee('0x35')](_0x4410d8[_0xecee('0x2b')],_0x48e16b[_0xecee('0x2d')]),_0x1d5473);if(_0x4410d8[_0xecee('0x2b')]['filter']){_0x4d5bb9[_0xecee('0x36')]=_[_0xecee('0x37')](_0x4d5bb9[_0xecee('0x36')],{'$or':_[_0xecee('0x27')](_0x1d5473,function(_0x120a88){if(_0x120a88[_0xecee('0x29')]!==_0xecee('0x38')){var _0x499452={};_0x499452[_0x120a88[_0xecee('0x24')]]={'$like':'%'+_0x4410d8[_0xecee('0x2b')][_0xecee('0x39')]+'%'};return _0x499452;}})});}_0x4d5bb9=_[_0xecee('0x37')]({},_0x4d5bb9,_0x4410d8[_0xecee('0x3a')]);var _0x272a38={'where':_0x4d5bb9[_0xecee('0x36')]};return db[_0xecee('0x28')][_0xecee('0x1b')](_0x272a38)[_0xecee('0x21')](function(_0x407d4e){_0x72ae5f[_0xecee('0x1b')]=_0x407d4e;if(_0x4410d8[_0xecee('0x2b')]['includeAll']){_0x4d5bb9['include']=[{'all':!![]}];}return db[_0xecee('0x28')][_0xecee('0x3b')](_0x4d5bb9);})[_0xecee('0x21')](function(_0x3f5425){_0x72ae5f['rows']=_0x3f5425;return _0x72ae5f;})[_0xecee('0x21')](respondWithFilteredResult(_0x42733d,_0x4d5bb9))[_0xecee('0x3c')](handleError(_0x42733d,null));};exports['show']=function(_0x33a6a5,_0x462e47){var _0x5a4a8d={'raw':![],'where':{'id':_0x33a6a5['params']['id']}},_0x40a9a4={};_0x40a9a4[_0xecee('0x2a')]=_['keys'](db[_0xecee('0x28')]['rawAttributes']);_0x40a9a4[_0xecee('0x2b')]=_['keys'](_0x33a6a5['query']);_0x40a9a4[_0xecee('0x2d')]=_[_0xecee('0x2e')](_0x40a9a4[_0xecee('0x2a')],_0x40a9a4[_0xecee('0x2b')]);_0x5a4a8d[_0xecee('0x2f')]=_[_0xecee('0x2e')](_0x40a9a4[_0xecee('0x2a')],qs[_0xecee('0x30')](_0x33a6a5[_0xecee('0x2b')]['fields']));_0x5a4a8d[_0xecee('0x2f')]=_0x5a4a8d[_0xecee('0x2f')][_0xecee('0x31')]?_0x5a4a8d[_0xecee('0x2f')]:_0x40a9a4['model'];if(_0x33a6a5[_0xecee('0x2b')][_0xecee('0x3d')]){_0x5a4a8d[_0xecee('0x3e')]=[{'all':!![]}];}_0x5a4a8d=_[_0xecee('0x37')]({},_0x5a4a8d,_0x33a6a5[_0xecee('0x3a')]);return db['SalesforceConfiguration'][_0xecee('0x3f')](_0x5a4a8d)[_0xecee('0x21')](handleEntityNotFound(_0x462e47,null))[_0xecee('0x21')](respondWithResult(_0x462e47,null))[_0xecee('0x3c')](handleError(_0x462e47,null));};exports[_0xecee('0x40')]=function(_0x10b2fc,_0x23398c){return db[_0xecee('0x28')]['create'](_0x10b2fc[_0xecee('0x41')],{})[_0xecee('0x21')](respondWithResult(_0x23398c,0xc9))[_0xecee('0x3c')](handleError(_0x23398c,null));};exports[_0xecee('0x20')]=function(_0x4ffe13,_0x10b168){if(_0x4ffe13[_0xecee('0x41')]['id']){delete _0x4ffe13[_0xecee('0x41')]['id'];}return db[_0xecee('0x28')]['find']({'where':{'id':_0x4ffe13['params']['id']}})[_0xecee('0x21')](handleEntityNotFound(_0x10b168,null))[_0xecee('0x21')](saveUpdates(_0x4ffe13[_0xecee('0x41')],null))[_0xecee('0x21')](respondWithResult(_0x10b168,null))[_0xecee('0x3c')](handleError(_0x10b168,null));};exports[_0xecee('0x22')]=function(_0x4479cf,_0x2debd8){return db[_0xecee('0x28')][_0xecee('0x3f')]({'where':{'id':_0x4479cf[_0xecee('0x42')]['id']}})[_0xecee('0x21')](handleEntityNotFound(_0x2debd8,null))[_0xecee('0x21')](removeEntity(_0x2debd8,null))[_0xecee('0x3c')](handleError(_0x2debd8,null));};exports['getFields']=function(_0xb08e02,_0x2ff792,_0x246cbc){var _0x396282={};var _0x700ce7={};var _0x4851f9;var _0x2a9e8a;return db[_0xecee('0x28')]['findOne']({'where':{'id':_0xb08e02['params']['id']}})[_0xecee('0x21')](handleEntityNotFound(_0x2ff792,null))[_0xecee('0x21')](function(_0xc019ed){if(_0xc019ed){_0x4851f9=_0xc019ed;_0x700ce7[_0xecee('0x2a')]=_[_0xecee('0x2c')](db[_0xecee('0x43')][_0xecee('0x44')]);_0x700ce7[_0xecee('0x2b')]=_[_0xecee('0x2c')](_0xb08e02[_0xecee('0x2b')]);_0x700ce7[_0xecee('0x2d')]=_['intersection'](_0x700ce7['model'],_0x700ce7[_0xecee('0x2b')]);_0x396282[_0xecee('0x2f')]=_[_0xecee('0x2e')](_0x700ce7['model'],qs[_0xecee('0x30')](_0xb08e02[_0xecee('0x2b')]['fields']));_0x396282[_0xecee('0x2f')]=_0x396282['attributes']['length']?_0x396282[_0xecee('0x2f')]:_0x700ce7[_0xecee('0x2a')];_0x396282[_0xecee('0x45')]=qs[_0xecee('0x34')](_0xb08e02[_0xecee('0x2b')][_0xecee('0x34')]);_0x396282[_0xecee('0x36')]=qs[_0xecee('0x2d')](_['pick'](_0xb08e02[_0xecee('0x2b')],_0x700ce7[_0xecee('0x2d')]));if(_0xb08e02[_0xecee('0x2b')]['filter']){_0x396282['where']=_[_0xecee('0x37')](_0x396282['where'],{'$or':_[_0xecee('0x27')](_0x396282[_0xecee('0x2f')],function(_0x1a7f58){var _0x22082d={};_0x22082d[_0x1a7f58]={'$like':'%'+_0xb08e02[_0xecee('0x2b')]['filter']+'%'};return _0x22082d;})});}_0x396282=_[_0xecee('0x37')]({},_0x396282,_0xb08e02[_0xecee('0x3a')]);return _0x4851f9[_0xecee('0x46')](_0x396282);}})[_0xecee('0x21')](function(_0x35b1ed){if(_0x35b1ed){_0x2a9e8a=_0x35b1ed[_0xecee('0x31')];if(!_0xb08e02['query'][_0xecee('0x32')](_0xecee('0x33'))){_0x396282[_0xecee('0x1a')]=qs[_0xecee('0x1a')](_0xb08e02[_0xecee('0x2b')][_0xecee('0x1a')]);_0x396282[_0xecee('0x18')]=qs[_0xecee('0x18')](_0xb08e02['query'][_0xecee('0x18')]);}return _0x4851f9[_0xecee('0x46')](_0x396282);}})['then'](function(_0x5e5f5b){if(_0x5e5f5b){return _0x5e5f5b?{'count':_0x2a9e8a,'rows':_0x5e5f5b}:null;}})['then'](respondWithResult(_0x2ff792,null))['catch'](handleError(_0x2ff792,null));};exports[_0xecee('0x47')]=function(_0x3b2f71,_0x1e8bad,_0xac3408){var _0x5d1750={};var _0x4752fd={};var _0x4c8f0a;var _0x47a2ec;return db[_0xecee('0x28')][_0xecee('0x48')]({'where':{'id':_0x3b2f71['params']['id']}})['then'](handleEntityNotFound(_0x1e8bad,null))[_0xecee('0x21')](function(_0x39421f){if(_0x39421f){_0x4c8f0a=_0x39421f;_0x4752fd[_0xecee('0x2a')]=_['keys'](db[_0xecee('0x43')]['rawAttributes']);_0x4752fd[_0xecee('0x2b')]=_[_0xecee('0x2c')](_0x3b2f71['query']);_0x4752fd[_0xecee('0x2d')]=_[_0xecee('0x2e')](_0x4752fd[_0xecee('0x2a')],_0x4752fd[_0xecee('0x2b')]);_0x5d1750['attributes']=_['intersection'](_0x4752fd[_0xecee('0x2a')],qs[_0xecee('0x30')](_0x3b2f71['query'][_0xecee('0x30')]));_0x5d1750[_0xecee('0x2f')]=_0x5d1750['attributes'][_0xecee('0x31')]?_0x5d1750[_0xecee('0x2f')]:_0x4752fd[_0xecee('0x2a')];_0x5d1750[_0xecee('0x45')]=qs[_0xecee('0x34')](_0x3b2f71[_0xecee('0x2b')][_0xecee('0x34')]);_0x5d1750[_0xecee('0x36')]=qs[_0xecee('0x2d')](_['pick'](_0x3b2f71[_0xecee('0x2b')],_0x4752fd[_0xecee('0x2d')]));if(_0x3b2f71['query'][_0xecee('0x39')]){_0x5d1750[_0xecee('0x36')]=_[_0xecee('0x37')](_0x5d1750[_0xecee('0x36')],{'$or':_[_0xecee('0x27')](_0x5d1750[_0xecee('0x2f')],function(_0x25ceb5){var _0x52991f={};_0x52991f[_0x25ceb5]={'$like':'%'+_0x3b2f71[_0xecee('0x2b')][_0xecee('0x39')]+'%'};return _0x52991f;})});}_0x5d1750=_[_0xecee('0x37')]({},_0x5d1750,_0x3b2f71[_0xecee('0x3a')]);return _0x4c8f0a[_0xecee('0x47')](_0x5d1750);}})[_0xecee('0x21')](function(_0x4b8ae9){if(_0x4b8ae9){_0x47a2ec=_0x4b8ae9[_0xecee('0x31')];if(!_0x3b2f71[_0xecee('0x2b')]['hasOwnProperty']('nolimit')){_0x5d1750[_0xecee('0x1a')]=qs['limit'](_0x3b2f71[_0xecee('0x2b')][_0xecee('0x1a')]);_0x5d1750['offset']=qs[_0xecee('0x18')](_0x3b2f71[_0xecee('0x2b')]['offset']);}return _0x4c8f0a[_0xecee('0x47')](_0x5d1750);}})[_0xecee('0x21')](function(_0x2b4216){if(_0x2b4216){return _0x2b4216?{'count':_0x47a2ec,'rows':_0x2b4216}:null;}})[_0xecee('0x21')](respondWithResult(_0x1e8bad,null))[_0xecee('0x3c')](handleError(_0x1e8bad,null));};exports[_0xecee('0x49')]=function(_0x27020e,_0x21bd49,_0x250b87){var _0x25b4af={};var _0x1f837a={};var _0x12a86d;var _0x4c533f;return db['SalesforceConfiguration'][_0xecee('0x48')]({'where':{'id':_0x27020e[_0xecee('0x42')]['id']}})[_0xecee('0x21')](handleEntityNotFound(_0x21bd49,null))[_0xecee('0x21')](function(_0x57dd40){if(_0x57dd40){_0x12a86d=_0x57dd40;_0x1f837a[_0xecee('0x2a')]=_[_0xecee('0x2c')](db[_0xecee('0x43')][_0xecee('0x44')]);_0x1f837a[_0xecee('0x2b')]=_['keys'](_0x27020e[_0xecee('0x2b')]);_0x1f837a[_0xecee('0x2d')]=_[_0xecee('0x2e')](_0x1f837a[_0xecee('0x2a')],_0x1f837a[_0xecee('0x2b')]);_0x25b4af[_0xecee('0x2f')]=_[_0xecee('0x2e')](_0x1f837a[_0xecee('0x2a')],qs[_0xecee('0x30')](_0x27020e[_0xecee('0x2b')][_0xecee('0x30')]));_0x25b4af[_0xecee('0x2f')]=_0x25b4af[_0xecee('0x2f')]['length']?_0x25b4af[_0xecee('0x2f')]:_0x1f837a[_0xecee('0x2a')];_0x25b4af[_0xecee('0x45')]=qs[_0xecee('0x34')](_0x27020e[_0xecee('0x2b')][_0xecee('0x34')]);_0x25b4af[_0xecee('0x36')]=qs[_0xecee('0x2d')](_['pick'](_0x27020e[_0xecee('0x2b')],_0x1f837a[_0xecee('0x2d')]));if(_0x27020e[_0xecee('0x2b')]['filter']){_0x25b4af[_0xecee('0x36')]=_[_0xecee('0x37')](_0x25b4af[_0xecee('0x36')],{'$or':_['map'](_0x25b4af[_0xecee('0x2f')],function(_0x5bb00b){var _0xc52402={};_0xc52402[_0x5bb00b]={'$like':'%'+_0x27020e['query']['filter']+'%'};return _0xc52402;})});}_0x25b4af=_['merge']({},_0x25b4af,_0x27020e['options']);return _0x12a86d[_0xecee('0x49')](_0x25b4af);}})[_0xecee('0x21')](function(_0x19827d){if(_0x19827d){_0x4c533f=_0x19827d[_0xecee('0x31')];if(!_0x27020e['query'][_0xecee('0x32')]('nolimit')){_0x25b4af[_0xecee('0x1a')]=qs[_0xecee('0x1a')](_0x27020e[_0xecee('0x2b')][_0xecee('0x1a')]);_0x25b4af[_0xecee('0x18')]=qs[_0xecee('0x18')](_0x27020e['query'][_0xecee('0x18')]);}return _0x12a86d['getDescriptions'](_0x25b4af);}})[_0xecee('0x21')](function(_0x5aee3d){if(_0x5aee3d){return _0x5aee3d?{'count':_0x4c533f,'rows':_0x5aee3d}:null;}})[_0xecee('0x21')](respondWithResult(_0x21bd49,null))['catch'](handleError(_0x21bd49,null));}; \ No newline at end of file +var _0xefa7=['SalesforceConfiguration','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','includeAll','findAll','rows','show','params','length','include','catch','create','body','find','getFields','findOne','getSubjects','pick','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map'];(function(_0x116023,_0x2f561b){var _0x20074c=function(_0x5cec36){while(--_0x5cec36){_0x116023['push'](_0x116023['shift']());}};_0x20074c(++_0x2f561b);}(_0xefa7,0xc5));var _0x7efa=function(_0x304d0e,_0x4e2e3c){_0x304d0e=_0x304d0e-0x0;var _0x2f9310=_0xefa7[_0x304d0e];return _0x2f9310;};'use strict';var emlformat=require(_0x7efa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7efa('0x1'));var jsonpatch=require(_0x7efa('0x2'));var rp=require(_0x7efa('0x3'));var moment=require(_0x7efa('0x4'));var BPromise=require(_0x7efa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7efa('0x6'));var sox=require(_0x7efa('0x7'));var csv=require(_0x7efa('0x8'));var ejs=require(_0x7efa('0x9'));var fs=require('fs');var fs_extra=require(_0x7efa('0xa'));var _=require(_0x7efa('0xb'));var squel=require(_0x7efa('0xc'));var crypto=require(_0x7efa('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7efa('0xe'));var toCsv=require(_0x7efa('0x8'));var querystring=require(_0x7efa('0xf'));var Papa=require(_0x7efa('0x10'));var Redis=require(_0x7efa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7efa('0x12'));var as=require(_0x7efa('0x13'));var hardwareService=require(_0x7efa('0x14'));var logger=require('../../config/logger')(_0x7efa('0x15'));var utils=require(_0x7efa('0x16'));var config=require(_0x7efa('0x17'));var licenseUtil=require(_0x7efa('0x18'));var db=require(_0x7efa('0x19'))['db'];function respondWithStatusCode(_0x46bc4b,_0x1e81dd){_0x1e81dd=_0x1e81dd||0xcc;return function(_0x466037){if(_0x466037){return _0x46bc4b[_0x7efa('0x1a')](_0x1e81dd);}return _0x46bc4b[_0x7efa('0x1b')](_0x1e81dd)[_0x7efa('0x1c')]();};}function respondWithResult(_0x2ba684,_0x387e1a){_0x387e1a=_0x387e1a||0xc8;return function(_0x5b8500){if(_0x5b8500){return _0x2ba684['status'](_0x387e1a)[_0x7efa('0x1d')](_0x5b8500);}};}function respondWithFilteredResult(_0x34a8d5,_0x4da556){return function(_0xa1318e){if(_0xa1318e){var _0x1ae231=typeof _0x4da556[_0x7efa('0x1e')]===_0x7efa('0x1f')&&typeof _0x4da556[_0x7efa('0x20')]==='undefined';var _0x4f2788=_0xa1318e[_0x7efa('0x21')];var _0x46d8e0=_0x1ae231?0x0:_0x4da556[_0x7efa('0x1e')];var _0x1df18d=_0x1ae231?_0xa1318e['count']:_0x4da556['offset']+_0x4da556['limit'];var _0x22ba62;if(_0x1df18d>=_0x4f2788){_0x1df18d=_0x4f2788;_0x22ba62=0xc8;}else{_0x22ba62=0xce;}_0x34a8d5[_0x7efa('0x1b')](_0x22ba62);return _0x34a8d5[_0x7efa('0x22')](_0x7efa('0x23'),_0x46d8e0+'-'+_0x1df18d+'/'+_0x4f2788)[_0x7efa('0x1d')](_0xa1318e);}return null;};}function patchUpdates(_0x3cb60e){return function(_0x379dca){try{jsonpatch[_0x7efa('0x24')](_0x379dca,_0x3cb60e,!![]);}catch(_0x387779){return BPromise['reject'](_0x387779);}return _0x379dca[_0x7efa('0x25')]();};}function saveUpdates(_0x2b5f5c,_0x3bb54e){return function(_0x4bbcda){if(_0x4bbcda){return _0x4bbcda[_0x7efa('0x26')](_0x2b5f5c)[_0x7efa('0x27')](function(_0x35885a){return _0x35885a;});}return null;};}function removeEntity(_0x2a5891,_0x3a043c){return function(_0x4b94e6){if(_0x4b94e6){return _0x4b94e6[_0x7efa('0x28')]()['then'](function(){_0x2a5891[_0x7efa('0x1b')](0xcc)[_0x7efa('0x1c')]();});}};}function handleEntityNotFound(_0x500d6e,_0x17d9e6){return function(_0x52b47f){if(!_0x52b47f){_0x500d6e[_0x7efa('0x1a')](0x194);}return _0x52b47f;};}function handleError(_0x1b037a,_0x482276){_0x482276=_0x482276||0x1f4;return function(_0x5397cd){logger[_0x7efa('0x29')](_0x5397cd['stack']);if(_0x5397cd[_0x7efa('0x2a')]){delete _0x5397cd[_0x7efa('0x2a')];}_0x1b037a['status'](_0x482276)[_0x7efa('0x2b')](_0x5397cd);};}exports[_0x7efa('0x2c')]=function(_0x181276,_0x2706b8){var _0x152f41={},_0x3eec9b={},_0x22f992={'count':0x0,'rows':[]};var _0xb38720=_[_0x7efa('0x2d')](db[_0x7efa('0x2e')][_0x7efa('0x2f')],function(_0x9e6c98){return{'name':_0x9e6c98['fieldName'],'type':_0x9e6c98['type'][_0x7efa('0x30')]};});_0x3eec9b[_0x7efa('0x31')]=_[_0x7efa('0x2d')](_0xb38720,_0x7efa('0x2a'));_0x3eec9b[_0x7efa('0x32')]=_[_0x7efa('0x33')](_0x181276['query']);_0x3eec9b[_0x7efa('0x34')]=_[_0x7efa('0x35')](_0x3eec9b[_0x7efa('0x31')],_0x3eec9b[_0x7efa('0x32')]);_0x152f41[_0x7efa('0x36')]=_[_0x7efa('0x35')](_0x3eec9b[_0x7efa('0x31')],qs[_0x7efa('0x37')](_0x181276[_0x7efa('0x32')][_0x7efa('0x37')]));_0x152f41[_0x7efa('0x36')]=_0x152f41[_0x7efa('0x36')]['length']?_0x152f41[_0x7efa('0x36')]:_0x3eec9b[_0x7efa('0x31')];if(!_0x181276['query'][_0x7efa('0x38')](_0x7efa('0x39'))){_0x152f41[_0x7efa('0x20')]=qs[_0x7efa('0x20')](_0x181276[_0x7efa('0x32')][_0x7efa('0x20')]);_0x152f41[_0x7efa('0x1e')]=qs['offset'](_0x181276[_0x7efa('0x32')][_0x7efa('0x1e')]);}_0x152f41[_0x7efa('0x3a')]=qs['sort'](_0x181276['query'][_0x7efa('0x3b')]);_0x152f41['where']=qs[_0x7efa('0x34')](_['pick'](_0x181276[_0x7efa('0x32')],_0x3eec9b['filters']),_0xb38720);if(_0x181276[_0x7efa('0x32')][_0x7efa('0x3c')]){_0x152f41[_0x7efa('0x3d')]=_[_0x7efa('0x3e')](_0x152f41['where'],{'$or':_[_0x7efa('0x2d')](_0xb38720,function(_0x100c4f){if(_0x100c4f[_0x7efa('0x3f')]!=='VIRTUAL'){var _0x2db298={};_0x2db298[_0x100c4f[_0x7efa('0x2a')]]={'$like':'%'+_0x181276['query']['filter']+'%'};return _0x2db298;}})});}_0x152f41=_[_0x7efa('0x3e')]({},_0x152f41,_0x181276[_0x7efa('0x40')]);var _0x30969b={'where':_0x152f41[_0x7efa('0x3d')]};return db[_0x7efa('0x2e')][_0x7efa('0x21')](_0x30969b)['then'](function(_0x2151da){_0x22f992[_0x7efa('0x21')]=_0x2151da;if(_0x181276[_0x7efa('0x32')][_0x7efa('0x41')]){_0x152f41['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x7efa('0x42')](_0x152f41);})[_0x7efa('0x27')](function(_0x1ff1c9){_0x22f992[_0x7efa('0x43')]=_0x1ff1c9;return _0x22f992;})[_0x7efa('0x27')](respondWithFilteredResult(_0x2706b8,_0x152f41))['catch'](handleError(_0x2706b8,null));};exports[_0x7efa('0x44')]=function(_0x5d3d8d,_0x3b7912){var _0x652b96={'raw':![],'where':{'id':_0x5d3d8d[_0x7efa('0x45')]['id']}},_0x4eab0d={};_0x4eab0d[_0x7efa('0x31')]=_['keys'](db[_0x7efa('0x2e')][_0x7efa('0x2f')]);_0x4eab0d['query']=_[_0x7efa('0x33')](_0x5d3d8d['query']);_0x4eab0d['filters']=_['intersection'](_0x4eab0d['model'],_0x4eab0d['query']);_0x652b96[_0x7efa('0x36')]=_['intersection'](_0x4eab0d[_0x7efa('0x31')],qs[_0x7efa('0x37')](_0x5d3d8d['query'][_0x7efa('0x37')]));_0x652b96[_0x7efa('0x36')]=_0x652b96['attributes'][_0x7efa('0x46')]?_0x652b96[_0x7efa('0x36')]:_0x4eab0d[_0x7efa('0x31')];if(_0x5d3d8d[_0x7efa('0x32')][_0x7efa('0x41')]){_0x652b96[_0x7efa('0x47')]=[{'all':!![]}];}_0x652b96=_['merge']({},_0x652b96,_0x5d3d8d[_0x7efa('0x40')]);return db[_0x7efa('0x2e')]['find'](_0x652b96)[_0x7efa('0x27')](handleEntityNotFound(_0x3b7912,null))[_0x7efa('0x27')](respondWithResult(_0x3b7912,null))[_0x7efa('0x48')](handleError(_0x3b7912,null));};exports[_0x7efa('0x49')]=function(_0x2ec1e9,_0x4998a8){return db[_0x7efa('0x2e')][_0x7efa('0x49')](_0x2ec1e9[_0x7efa('0x4a')],{})[_0x7efa('0x27')](respondWithResult(_0x4998a8,0xc9))[_0x7efa('0x48')](handleError(_0x4998a8,null));};exports[_0x7efa('0x26')]=function(_0x3db066,_0x4aecef){if(_0x3db066[_0x7efa('0x4a')]['id']){delete _0x3db066['body']['id'];}return db[_0x7efa('0x2e')][_0x7efa('0x4b')]({'where':{'id':_0x3db066[_0x7efa('0x45')]['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x4aecef,null))[_0x7efa('0x27')](saveUpdates(_0x3db066['body'],null))[_0x7efa('0x27')](respondWithResult(_0x4aecef,null))[_0x7efa('0x48')](handleError(_0x4aecef,null));};exports[_0x7efa('0x28')]=function(_0x28c83e,_0x4b52d3){return db[_0x7efa('0x2e')][_0x7efa('0x4b')]({'where':{'id':_0x28c83e[_0x7efa('0x45')]['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x4b52d3,null))[_0x7efa('0x27')](removeEntity(_0x4b52d3,null))[_0x7efa('0x48')](handleError(_0x4b52d3,null));};exports[_0x7efa('0x4c')]=function(_0x2cb45f,_0x111396,_0x490d01){var _0xe33e14={};var _0x1b8b8f={};var _0x5331d8;var _0x1177d5;return db[_0x7efa('0x2e')][_0x7efa('0x4d')]({'where':{'id':_0x2cb45f[_0x7efa('0x45')]['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x111396,null))['then'](function(_0x279fd3){if(_0x279fd3){_0x5331d8=_0x279fd3;_0x1b8b8f[_0x7efa('0x31')]=_[_0x7efa('0x33')](db['SalesforceField'][_0x7efa('0x2f')]);_0x1b8b8f[_0x7efa('0x32')]=_['keys'](_0x2cb45f['query']);_0x1b8b8f[_0x7efa('0x34')]=_[_0x7efa('0x35')](_0x1b8b8f[_0x7efa('0x31')],_0x1b8b8f[_0x7efa('0x32')]);_0xe33e14[_0x7efa('0x36')]=_[_0x7efa('0x35')](_0x1b8b8f[_0x7efa('0x31')],qs['fields'](_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x37')]));_0xe33e14['attributes']=_0xe33e14[_0x7efa('0x36')][_0x7efa('0x46')]?_0xe33e14['attributes']:_0x1b8b8f['model'];_0xe33e14['order']=qs[_0x7efa('0x3b')](_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x3b')]);_0xe33e14[_0x7efa('0x3d')]=qs[_0x7efa('0x34')](_['pick'](_0x2cb45f[_0x7efa('0x32')],_0x1b8b8f[_0x7efa('0x34')]));if(_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x3c')]){_0xe33e14[_0x7efa('0x3d')]=_[_0x7efa('0x3e')](_0xe33e14['where'],{'$or':_['map'](_0xe33e14[_0x7efa('0x36')],function(_0x3ca871){var _0x4d53e5={};_0x4d53e5[_0x3ca871]={'$like':'%'+_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x3c')]+'%'};return _0x4d53e5;})});}_0xe33e14=_['merge']({},_0xe33e14,_0x2cb45f['options']);return _0x5331d8['getFields'](_0xe33e14);}})[_0x7efa('0x27')](function(_0xb44bb1){if(_0xb44bb1){_0x1177d5=_0xb44bb1[_0x7efa('0x46')];if(!_0x2cb45f[_0x7efa('0x32')][_0x7efa('0x38')](_0x7efa('0x39'))){_0xe33e14['limit']=qs['limit'](_0x2cb45f['query'][_0x7efa('0x20')]);_0xe33e14['offset']=qs['offset'](_0x2cb45f['query'][_0x7efa('0x1e')]);}return _0x5331d8[_0x7efa('0x4c')](_0xe33e14);}})[_0x7efa('0x27')](function(_0x354dc6){if(_0x354dc6){return _0x354dc6?{'count':_0x1177d5,'rows':_0x354dc6}:null;}})['then'](respondWithResult(_0x111396,null))[_0x7efa('0x48')](handleError(_0x111396,null));};exports[_0x7efa('0x4e')]=function(_0x5a35ab,_0x1f45b5,_0x341573){var _0x22c62f={};var _0x4c533a={};var _0x36007c;var _0x7fe196;return db[_0x7efa('0x2e')][_0x7efa('0x4d')]({'where':{'id':_0x5a35ab['params']['id']}})[_0x7efa('0x27')](handleEntityNotFound(_0x1f45b5,null))[_0x7efa('0x27')](function(_0x4352dc){if(_0x4352dc){_0x36007c=_0x4352dc;_0x4c533a[_0x7efa('0x31')]=_[_0x7efa('0x33')](db['SalesforceField'][_0x7efa('0x2f')]);_0x4c533a[_0x7efa('0x32')]=_[_0x7efa('0x33')](_0x5a35ab[_0x7efa('0x32')]);_0x4c533a['filters']=_[_0x7efa('0x35')](_0x4c533a['model'],_0x4c533a[_0x7efa('0x32')]);_0x22c62f[_0x7efa('0x36')]=_[_0x7efa('0x35')](_0x4c533a[_0x7efa('0x31')],qs['fields'](_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x37')]));_0x22c62f[_0x7efa('0x36')]=_0x22c62f[_0x7efa('0x36')][_0x7efa('0x46')]?_0x22c62f[_0x7efa('0x36')]:_0x4c533a[_0x7efa('0x31')];_0x22c62f[_0x7efa('0x3a')]=qs[_0x7efa('0x3b')](_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x3b')]);_0x22c62f[_0x7efa('0x3d')]=qs['filters'](_['pick'](_0x5a35ab['query'],_0x4c533a[_0x7efa('0x34')]));if(_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x3c')]){_0x22c62f[_0x7efa('0x3d')]=_[_0x7efa('0x3e')](_0x22c62f[_0x7efa('0x3d')],{'$or':_[_0x7efa('0x2d')](_0x22c62f['attributes'],function(_0x4c2eb4){var _0x34fa9f={};_0x34fa9f[_0x4c2eb4]={'$like':'%'+_0x5a35ab['query'][_0x7efa('0x3c')]+'%'};return _0x34fa9f;})});}_0x22c62f=_[_0x7efa('0x3e')]({},_0x22c62f,_0x5a35ab['options']);return _0x36007c[_0x7efa('0x4e')](_0x22c62f);}})[_0x7efa('0x27')](function(_0x15a28e){if(_0x15a28e){_0x7fe196=_0x15a28e[_0x7efa('0x46')];if(!_0x5a35ab[_0x7efa('0x32')][_0x7efa('0x38')](_0x7efa('0x39'))){_0x22c62f[_0x7efa('0x20')]=qs[_0x7efa('0x20')](_0x5a35ab['query'][_0x7efa('0x20')]);_0x22c62f['offset']=qs[_0x7efa('0x1e')](_0x5a35ab['query'][_0x7efa('0x1e')]);}return _0x36007c[_0x7efa('0x4e')](_0x22c62f);}})[_0x7efa('0x27')](function(_0x30cc3a){if(_0x30cc3a){return _0x30cc3a?{'count':_0x7fe196,'rows':_0x30cc3a}:null;}})['then'](respondWithResult(_0x1f45b5,null))[_0x7efa('0x48')](handleError(_0x1f45b5,null));};exports['getDescriptions']=function(_0x20ada9,_0x2418a6,_0x55c3c6){var _0x2bcc43={};var _0x5ab4fd={};var _0x15cf6d;var _0x57d60c;return db[_0x7efa('0x2e')][_0x7efa('0x4d')]({'where':{'id':_0x20ada9['params']['id']}})['then'](handleEntityNotFound(_0x2418a6,null))[_0x7efa('0x27')](function(_0x7d5f72){if(_0x7d5f72){_0x15cf6d=_0x7d5f72;_0x5ab4fd['model']=_[_0x7efa('0x33')](db['SalesforceField']['rawAttributes']);_0x5ab4fd['query']=_[_0x7efa('0x33')](_0x20ada9['query']);_0x5ab4fd['filters']=_['intersection'](_0x5ab4fd['model'],_0x5ab4fd[_0x7efa('0x32')]);_0x2bcc43['attributes']=_[_0x7efa('0x35')](_0x5ab4fd[_0x7efa('0x31')],qs[_0x7efa('0x37')](_0x20ada9[_0x7efa('0x32')][_0x7efa('0x37')]));_0x2bcc43[_0x7efa('0x36')]=_0x2bcc43[_0x7efa('0x36')][_0x7efa('0x46')]?_0x2bcc43['attributes']:_0x5ab4fd[_0x7efa('0x31')];_0x2bcc43['order']=qs['sort'](_0x20ada9[_0x7efa('0x32')][_0x7efa('0x3b')]);_0x2bcc43['where']=qs[_0x7efa('0x34')](_[_0x7efa('0x4f')](_0x20ada9[_0x7efa('0x32')],_0x5ab4fd[_0x7efa('0x34')]));if(_0x20ada9[_0x7efa('0x32')][_0x7efa('0x3c')]){_0x2bcc43[_0x7efa('0x3d')]=_['merge'](_0x2bcc43[_0x7efa('0x3d')],{'$or':_[_0x7efa('0x2d')](_0x2bcc43[_0x7efa('0x36')],function(_0x4b8d88){var _0x12160a={};_0x12160a[_0x4b8d88]={'$like':'%'+_0x20ada9[_0x7efa('0x32')][_0x7efa('0x3c')]+'%'};return _0x12160a;})});}_0x2bcc43=_[_0x7efa('0x3e')]({},_0x2bcc43,_0x20ada9[_0x7efa('0x40')]);return _0x15cf6d[_0x7efa('0x50')](_0x2bcc43);}})[_0x7efa('0x27')](function(_0x715beb){if(_0x715beb){_0x57d60c=_0x715beb[_0x7efa('0x46')];if(!_0x20ada9[_0x7efa('0x32')][_0x7efa('0x38')](_0x7efa('0x39'))){_0x2bcc43['limit']=qs[_0x7efa('0x20')](_0x20ada9['query'][_0x7efa('0x20')]);_0x2bcc43[_0x7efa('0x1e')]=qs[_0x7efa('0x1e')](_0x20ada9[_0x7efa('0x32')]['offset']);}return _0x15cf6d[_0x7efa('0x50')](_0x2bcc43);}})[_0x7efa('0x27')](function(_0x253bcc){if(_0x253bcc){return _0x253bcc?{'count':_0x57d60c,'rows':_0x253bcc}:null;}})[_0x7efa('0x27')](respondWithResult(_0x2418a6,null))[_0x7efa('0x48')](handleError(_0x2418a6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index cb7c391..fd9df63 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 _0x670b=['../../config/environment','exports','int_salesforce_configurations','util','../../config/logger','moment','bluebird','path'];(function(_0x2d9f05,_0x5b4566){var _0x463cc4=function(_0x2b24ec){while(--_0x2b24ec){_0x2d9f05['push'](_0x2d9f05['shift']());}};_0x463cc4(++_0x5b4566);}(_0x670b,0x13b));var _0xb670=function(_0x21e039,_0x3e9573){_0x21e039=_0x21e039-0x0;var _0x586aba=_0x670b[_0x21e039];return _0x586aba;};'use strict';var _=require('lodash');var util=require(_0xb670('0x0'));var logger=require(_0xb670('0x1'))('api');var moment=require(_0xb670('0x2'));var BPromise=require(_0xb670('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb670('0x4'));var rimraf=require('rimraf');var config=require(_0xb670('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xb670('0x6')]=function(_0x5d1aaa,_0xb39dbb){return _0x5d1aaa['define']('SalesforceConfiguration',attributes,{'tableName':_0xb670('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x788d=['../../config/environment','exports','define','SalesforceConfiguration','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x524d72,_0x489125){var _0x18ca9d=function(_0x415f35){while(--_0x415f35){_0x524d72['push'](_0x524d72['shift']());}};_0x18ca9d(++_0x489125);}(_0x788d,0xca));var _0xd788=function(_0x2d17ac,_0x3babca){_0x2d17ac=_0x2d17ac-0x0;var _0x28b912=_0x788d[_0x2d17ac];return _0x28b912;};'use strict';var _=require(_0xd788('0x0'));var util=require(_0xd788('0x1'));var logger=require('../../config/logger')(_0xd788('0x2'));var moment=require(_0xd788('0x3'));var BPromise=require(_0xd788('0x4'));var rp=require(_0xd788('0x5'));var fs=require('fs');var path=require(_0xd788('0x6'));var rimraf=require('rimraf');var config=require(_0xd788('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xd788('0x8')]=function(_0x250e01,_0x39cbb8){return _0x250e01[_0xd788('0x9')](_0xd788('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 5908efb..d39faf6 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 _0xcea4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','info','request\x20sent','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x436827,_0x570104){var _0x22434d=function(_0x55c067){while(--_0x55c067){_0x436827['push'](_0x436827['shift']());}};_0x22434d(++_0x570104);}(_0xcea4,0x85));var _0x4cea=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0xcea4[_0x4cd690];return _0x4a74a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4cea('0x0'));var BPromise=require(_0x4cea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cea('0x2'));var db=require(_0x4cea('0x3'))['db'];var utils=require(_0x4cea('0x4'));var logger=require(_0x4cea('0x5'))(_0x4cea('0x6'));var config=require(_0x4cea('0x7'));var jayson=require(_0x4cea('0x8'));var client=jayson[_0x4cea('0x9')][_0x4cea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b09b,_0x21b6bb,_0xd59571){return new BPromise(function(_0x4796eb,_0x47f6e0){return client[_0x4cea('0xb')](_0x37b09b,_0xd59571)[_0x4cea('0xc')](function(_0xd69532){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x21b6bb,'request\x20sent');logger[_0x4cea('0xd')](_0x4cea('0xe'),_0x21b6bb,'request\x20sent',JSON[_0x4cea('0xf')](_0xd69532));if(_0xd69532['error']){if(_0xd69532[_0x4cea('0x10')]['code']===0x1f4){logger[_0x4cea('0x10')](_0x4cea('0x11'),_0x21b6bb,_0xd69532['error']['message']);return _0x47f6e0(_0xd69532[_0x4cea('0x10')][_0x4cea('0x12')]);}logger[_0x4cea('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x21b6bb,_0xd69532[_0x4cea('0x10')][_0x4cea('0x12')]);return _0x4796eb(_0xd69532[_0x4cea('0x10')][_0x4cea('0x12')]);}else{logger[_0x4cea('0x13')](_0x4cea('0x11'),_0x21b6bb,_0x4cea('0x14'));_0x4796eb(_0xd69532[_0x4cea('0x15')][_0x4cea('0x12')]);}})[_0x4cea('0x16')](function(_0x5cda0e){logger[_0x4cea('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x21b6bb,_0x5cda0e);_0x47f6e0(_0x5cda0e);});});} \ No newline at end of file +var _0x742c=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x2a8bd6,_0x3bfc91){var _0x461842=function(_0x64fcca){while(--_0x64fcca){_0x2a8bd6['push'](_0x2a8bd6['shift']());}};_0x461842(++_0x3bfc91);}(_0x742c,0x12f));var _0xc742=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x742c[_0x538c70];return _0x42ae01;};'use strict';var _=require(_0xc742('0x0'));var util=require(_0xc742('0x1'));var moment=require(_0xc742('0x2'));var BPromise=require(_0xc742('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc742('0x4'))['db'];var utils=require(_0xc742('0x5'));var logger=require(_0xc742('0x6'))('rpc');var config=require(_0xc742('0x7'));var jayson=require(_0xc742('0x8'));var client=jayson['client'][_0xc742('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12f3c2,_0xbf01fd,_0x24df05){return new BPromise(function(_0x2460ae,_0x257968){return client['request'](_0x12f3c2,_0x24df05)[_0xc742('0xa')](function(_0x100d89){logger[_0xc742('0xb')](_0xc742('0xc'),_0xbf01fd,_0xc742('0xd'));logger['debug'](_0xc742('0xe'),_0xbf01fd,_0xc742('0xd'),JSON['stringify'](_0x100d89));if(_0x100d89[_0xc742('0xf')]){if(_0x100d89[_0xc742('0xf')]['code']===0x1f4){logger['error'](_0xc742('0xc'),_0xbf01fd,_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);return _0x257968(_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);}logger[_0xc742('0xf')](_0xc742('0xc'),_0xbf01fd,_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);return _0x2460ae(_0x100d89[_0xc742('0xf')][_0xc742('0x10')]);}else{logger[_0xc742('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0xbf01fd,_0xc742('0xd'));_0x2460ae(_0x100d89[_0xc742('0x11')][_0xc742('0x10')]);}})[_0xc742('0x12')](function(_0x389667){logger[_0xc742('0xf')](_0xc742('0xc'),_0xbf01fd,_0x389667);_0x257968(_0x389667);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index fc58937..c30d857 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 _0x29e2=['index','show','post','put','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x29e2,0x17f));var _0x229e=function(_0x17da92,_0x15892d){_0x17da92=_0x17da92-0x0;var _0x576a32=_0x29e2[_0x17da92];return _0x576a32;};'use strict';var multer=require(_0x229e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x229e('0x1'));var express=require(_0x229e('0x2'));var router=express[_0x229e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x229e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x229e('0x5')]('/',auth[_0x229e('0x6')](),controller[_0x229e('0x7')]);router[_0x229e('0x5')]('/:id',auth[_0x229e('0x6')](),controller[_0x229e('0x8')]);router[_0x229e('0x9')]('/',auth[_0x229e('0x6')](),controller['create']);router[_0x229e('0xa')](_0x229e('0xb'),auth[_0x229e('0x6')](),controller['update']);router[_0x229e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x229e('0xd')]);module[_0x229e('0xe')]=router; \ No newline at end of file +var _0x917a=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x179d9b,_0x465c8e){var _0x7e11dd=function(_0x6aec91){while(--_0x6aec91){_0x179d9b['push'](_0x179d9b['shift']());}};_0x7e11dd(++_0x465c8e);}(_0x917a,0x187));var _0xa917=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x917a[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xa917('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa917('0x1'));var express=require(_0xa917('0x2'));var router=express[_0xa917('0x3')]();var fs_extra=require(_0xa917('0x4'));var auth=require(_0xa917('0x5'));var interaction=require(_0xa917('0x6'));var config=require(_0xa917('0x7'));var controller=require(_0xa917('0x8'));router[_0xa917('0x9')]('/',auth[_0xa917('0xa')](),controller[_0xa917('0xb')]);router[_0xa917('0x9')](_0xa917('0xc'),auth[_0xa917('0xa')](),controller[_0xa917('0xd')]);router[_0xa917('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa917('0xf')](_0xa917('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa917('0x10')](_0xa917('0xc'),auth[_0xa917('0xa')](),controller[_0xa917('0x11')]);module[_0xa917('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 0d014a0..b4b564b 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 _0x7cbd=['variable','customVariable','keyValue','picklist','STRING','sequelize','ENUM','string'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x7cbd,0xd5));var _0xd7cb=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x7cbd[_0x43b584];return _0x48f27b;};'use strict';var Sequelize=require(_0xd7cb('0x0'));module['exports']={'type':{'type':Sequelize[_0xd7cb('0x1')](_0xd7cb('0x2'),_0xd7cb('0x3'),_0xd7cb('0x4'),_0xd7cb('0x5'),_0xd7cb('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd7cb('0x1')](_0xd7cb('0x2'),_0xd7cb('0x3'),_0xd7cb('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd7cb('0x7')]},'variableName':{'type':Sequelize[_0xd7cb('0x7')]}}; \ No newline at end of file +var _0x641f=['exports','ENUM','string','variable','keyValue','STRING','customVariable'];(function(_0x1c4f97,_0x547fb4){var _0xd6346e=function(_0x1ac0d7){while(--_0x1ac0d7){_0x1c4f97['push'](_0x1c4f97['shift']());}};_0xd6346e(++_0x547fb4);}(_0x641f,0xb6));var _0xf641=function(_0x33c294,_0x5d5c56){_0x33c294=_0x33c294-0x0;var _0x3b5125=_0x641f[_0x33c294];return _0x3b5125;};'use strict';var Sequelize=require('sequelize');module[_0xf641('0x0')]={'type':{'type':Sequelize[_0xf641('0x1')](_0xf641('0x2'),_0xf641('0x3'),'customVariable',_0xf641('0x4'),'picklist'),'defaultValue':_0xf641('0x2')},'content':{'type':Sequelize[_0xf641('0x5')]},'key':{'type':Sequelize[_0xf641('0x5')]},'keyType':{'type':Sequelize[_0xf641('0x1')](_0xf641('0x2'),_0xf641('0x3'),_0xf641('0x6'))},'keyContent':{'type':Sequelize[_0xf641('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xf641('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f17679c..e81fbe7 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 _0x3ddc=['zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','index','SalesforceField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','eml-format','rimraf'];(function(_0x59e9f2,_0x94ab80){var _0x3b6f86=function(_0x1eea8a){while(--_0x1eea8a){_0x59e9f2['push'](_0x59e9f2['shift']());}};_0x3b6f86(++_0x94ab80);}(_0x3ddc,0xd3));var _0xc3dd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x3ddc[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xc3dd('0x0'));var rimraf=require(_0xc3dd('0x1'));var zipdir=require(_0xc3dd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3dd('0x3'));var moment=require(_0xc3dd('0x4'));var BPromise=require(_0xc3dd('0x5'));var Mustache=require(_0xc3dd('0x6'));var util=require(_0xc3dd('0x7'));var path=require(_0xc3dd('0x8'));var sox=require('sox');var csv=require(_0xc3dd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3dd('0xa'));var _=require(_0xc3dd('0xb'));var squel=require(_0xc3dd('0xc'));var crypto=require(_0xc3dd('0xd'));var jsforce=require(_0xc3dd('0xe'));var deskjs=require(_0xc3dd('0xf'));var toCsv=require(_0xc3dd('0x9'));var querystring=require(_0xc3dd('0x10'));var Papa=require(_0xc3dd('0x11'));var Redis=require('ioredis');var authService=require(_0xc3dd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc3dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc3dd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc3dd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fac12,_0xa0cc8c){_0xa0cc8c=_0xa0cc8c||0xcc;return function(_0x4e9074){if(_0x4e9074){return _0x3fac12[_0xc3dd('0x16')](_0xa0cc8c);}return _0x3fac12[_0xc3dd('0x17')](_0xa0cc8c)[_0xc3dd('0x18')]();};}function respondWithResult(_0x3fcdf6,_0x15b297){_0x15b297=_0x15b297||0xc8;return function(_0x1c31b0){if(_0x1c31b0){return _0x3fcdf6[_0xc3dd('0x17')](_0x15b297)[_0xc3dd('0x19')](_0x1c31b0);}};}function respondWithFilteredResult(_0x3e0f90,_0x464712){return function(_0x46a5ac){if(_0x46a5ac){var _0x3ce2e3=typeof _0x464712[_0xc3dd('0x1a')]===_0xc3dd('0x1b')&&typeof _0x464712[_0xc3dd('0x1c')]===_0xc3dd('0x1b');var _0x30908e=_0x46a5ac['count'];var _0x198df8=_0x3ce2e3?0x0:_0x464712[_0xc3dd('0x1a')];var _0x5598e=_0x3ce2e3?_0x46a5ac[_0xc3dd('0x1d')]:_0x464712[_0xc3dd('0x1a')]+_0x464712[_0xc3dd('0x1c')];var _0x4094f0;if(_0x5598e>=_0x30908e){_0x5598e=_0x30908e;_0x4094f0=0xc8;}else{_0x4094f0=0xce;}_0x3e0f90[_0xc3dd('0x17')](_0x4094f0);return _0x3e0f90[_0xc3dd('0x1e')](_0xc3dd('0x1f'),_0x198df8+'-'+_0x5598e+'/'+_0x30908e)[_0xc3dd('0x19')](_0x46a5ac);}return null;};}function patchUpdates(_0x57d7d5){return function(_0x22bd5e){try{jsonpatch['apply'](_0x22bd5e,_0x57d7d5,!![]);}catch(_0x168205){return BPromise['reject'](_0x168205);}return _0x22bd5e[_0xc3dd('0x20')]();};}function saveUpdates(_0x4622ed,_0x4905c3){return function(_0x305d65){if(_0x305d65){return _0x305d65[_0xc3dd('0x21')](_0x4622ed)['then'](function(_0x5ac530){return _0x5ac530;});}return null;};}function removeEntity(_0x13e9de,_0x3a99b0){return function(_0x3f46a1){if(_0x3f46a1){return _0x3f46a1[_0xc3dd('0x22')]()[_0xc3dd('0x23')](function(){_0x13e9de[_0xc3dd('0x17')](0xcc)[_0xc3dd('0x18')]();});}};}function handleEntityNotFound(_0x496ca0,_0x511465){return function(_0xd6d8c0){if(!_0xd6d8c0){_0x496ca0[_0xc3dd('0x16')](0x194);}return _0xd6d8c0;};}function handleError(_0x4cc1f1,_0x212d2f){_0x212d2f=_0x212d2f||0x1f4;return function(_0x4b4fd4){logger[_0xc3dd('0x24')](_0x4b4fd4[_0xc3dd('0x25')]);if(_0x4b4fd4[_0xc3dd('0x26')]){delete _0x4b4fd4[_0xc3dd('0x26')];}_0x4cc1f1[_0xc3dd('0x17')](_0x212d2f)['send'](_0x4b4fd4);};}exports[_0xc3dd('0x27')]=function(_0x4b5754,_0x466fbb){var _0x4544b2={},_0x120206={},_0x3f52aa={'count':0x0,'rows':[]};var _0x1e8483=_['map'](db[_0xc3dd('0x28')][_0xc3dd('0x29')],function(_0x52afb6){return{'name':_0x52afb6['fieldName'],'type':_0x52afb6[_0xc3dd('0x2a')][_0xc3dd('0x2b')]};});_0x120206[_0xc3dd('0x2c')]=_[_0xc3dd('0x2d')](_0x1e8483,_0xc3dd('0x26'));_0x120206[_0xc3dd('0x2e')]=_[_0xc3dd('0x2f')](_0x4b5754[_0xc3dd('0x2e')]);_0x120206[_0xc3dd('0x30')]=_[_0xc3dd('0x31')](_0x120206['model'],_0x120206[_0xc3dd('0x2e')]);_0x4544b2[_0xc3dd('0x32')]=_[_0xc3dd('0x31')](_0x120206['model'],qs[_0xc3dd('0x33')](_0x4b5754['query']['fields']));_0x4544b2[_0xc3dd('0x32')]=_0x4544b2['attributes'][_0xc3dd('0x34')]?_0x4544b2[_0xc3dd('0x32')]:_0x120206[_0xc3dd('0x2c')];if(!_0x4b5754['query'][_0xc3dd('0x35')](_0xc3dd('0x36'))){_0x4544b2[_0xc3dd('0x1c')]=qs[_0xc3dd('0x1c')](_0x4b5754[_0xc3dd('0x2e')][_0xc3dd('0x1c')]);_0x4544b2['offset']=qs[_0xc3dd('0x1a')](_0x4b5754['query'][_0xc3dd('0x1a')]);}_0x4544b2[_0xc3dd('0x37')]=qs[_0xc3dd('0x38')](_0x4b5754[_0xc3dd('0x2e')][_0xc3dd('0x38')]);_0x4544b2[_0xc3dd('0x39')]=qs[_0xc3dd('0x30')](_[_0xc3dd('0x3a')](_0x4b5754['query'],_0x120206[_0xc3dd('0x30')]),_0x1e8483);if(_0x4b5754[_0xc3dd('0x2e')][_0xc3dd('0x3b')]){_0x4544b2['where']=_[_0xc3dd('0x3c')](_0x4544b2[_0xc3dd('0x39')],{'$or':_[_0xc3dd('0x2d')](_0x1e8483,function(_0x192493){if(_0x192493[_0xc3dd('0x2a')]!==_0xc3dd('0x3d')){var _0x118985={};_0x118985[_0x192493[_0xc3dd('0x26')]]={'$like':'%'+_0x4b5754[_0xc3dd('0x2e')][_0xc3dd('0x3b')]+'%'};return _0x118985;}})});}_0x4544b2=_[_0xc3dd('0x3c')]({},_0x4544b2,_0x4b5754[_0xc3dd('0x3e')]);var _0x1a079f={'where':_0x4544b2['where']};return db[_0xc3dd('0x28')][_0xc3dd('0x1d')](_0x1a079f)[_0xc3dd('0x23')](function(_0x29c5b7){_0x3f52aa['count']=_0x29c5b7;if(_0x4b5754[_0xc3dd('0x2e')][_0xc3dd('0x3f')]){_0x4544b2[_0xc3dd('0x40')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x4544b2);})[_0xc3dd('0x23')](function(_0x1ee539){_0x3f52aa[_0xc3dd('0x41')]=_0x1ee539;return _0x3f52aa;})[_0xc3dd('0x23')](respondWithFilteredResult(_0x466fbb,_0x4544b2))[_0xc3dd('0x42')](handleError(_0x466fbb,null));};exports['show']=function(_0xa7dd25,_0x2572b1){var _0x514a04={'raw':!![],'where':{'id':_0xa7dd25['params']['id']}},_0x3dce56={};_0x3dce56[_0xc3dd('0x2c')]=_[_0xc3dd('0x2f')](db[_0xc3dd('0x28')][_0xc3dd('0x29')]);_0x3dce56['query']=_[_0xc3dd('0x2f')](_0xa7dd25[_0xc3dd('0x2e')]);_0x3dce56['filters']=_[_0xc3dd('0x31')](_0x3dce56[_0xc3dd('0x2c')],_0x3dce56['query']);_0x514a04[_0xc3dd('0x32')]=_['intersection'](_0x3dce56['model'],qs['fields'](_0xa7dd25[_0xc3dd('0x2e')][_0xc3dd('0x33')]));_0x514a04[_0xc3dd('0x32')]=_0x514a04['attributes']['length']?_0x514a04[_0xc3dd('0x32')]:_0x3dce56[_0xc3dd('0x2c')];if(_0xa7dd25[_0xc3dd('0x2e')]['includeAll']){_0x514a04[_0xc3dd('0x40')]=[{'all':!![]}];}_0x514a04=_['merge']({},_0x514a04,_0xa7dd25[_0xc3dd('0x3e')]);return db[_0xc3dd('0x28')][_0xc3dd('0x43')](_0x514a04)[_0xc3dd('0x23')](handleEntityNotFound(_0x2572b1,null))[_0xc3dd('0x23')](respondWithResult(_0x2572b1,null))[_0xc3dd('0x42')](handleError(_0x2572b1,null));};exports[_0xc3dd('0x44')]=function(_0x3c2d25,_0x1c5b1e){return db[_0xc3dd('0x28')]['create'](_0x3c2d25['body'],{})[_0xc3dd('0x23')](respondWithResult(_0x1c5b1e,0xc9))[_0xc3dd('0x42')](handleError(_0x1c5b1e,null));};exports[_0xc3dd('0x21')]=function(_0x42fc2b,_0x526274){if(_0x42fc2b[_0xc3dd('0x45')]['id']){delete _0x42fc2b[_0xc3dd('0x45')]['id'];}return db[_0xc3dd('0x28')]['find']({'where':{'id':_0x42fc2b[_0xc3dd('0x46')]['id']}})['then'](handleEntityNotFound(_0x526274,null))['then'](saveUpdates(_0x42fc2b['body'],null))['then'](respondWithResult(_0x526274,null))['catch'](handleError(_0x526274,null));};exports[_0xc3dd('0x22')]=function(_0x4b98f2,_0x3f5466){return db['SalesforceField']['find']({'where':{'id':_0x4b98f2['params']['id']}})[_0xc3dd('0x23')](handleEntityNotFound(_0x3f5466,null))[_0xc3dd('0x23')](removeEntity(_0x3f5466,null))[_0xc3dd('0x42')](handleError(_0x3f5466,null));}; \ No newline at end of file +var _0xbb8a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format'];(function(_0x4cd0ed,_0x1969de){var _0x5043dc=function(_0x2465ce){while(--_0x2465ce){_0x4cd0ed['push'](_0x4cd0ed['shift']());}};_0x5043dc(++_0x1969de);}(_0xbb8a,0x99));var _0xabb8=function(_0x524366,_0x1e6911){_0x524366=_0x524366-0x0;var _0x5a9616=_0xbb8a[_0x524366];return _0x5a9616;};'use strict';var emlformat=require(_0xabb8('0x0'));var rimraf=require(_0xabb8('0x1'));var zipdir=require(_0xabb8('0x2'));var jsonpatch=require(_0xabb8('0x3'));var rp=require('request-promise');var moment=require(_0xabb8('0x4'));var BPromise=require(_0xabb8('0x5'));var Mustache=require('mustache');var util=require(_0xabb8('0x6'));var path=require(_0xabb8('0x7'));var sox=require(_0xabb8('0x8'));var csv=require(_0xabb8('0x9'));var ejs=require(_0xabb8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xabb8('0xb'));var squel=require(_0xabb8('0xc'));var crypto=require('crypto');var jsforce=require(_0xabb8('0xd'));var deskjs=require(_0xabb8('0xe'));var toCsv=require(_0xabb8('0x9'));var querystring=require('querystring');var Papa=require(_0xabb8('0xf'));var Redis=require(_0xabb8('0x10'));var authService=require(_0xabb8('0x11'));var qs=require(_0xabb8('0x12'));var as=require(_0xabb8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabb8('0x14'))('api');var utils=require(_0xabb8('0x15'));var config=require(_0xabb8('0x16'));var licenseUtil=require(_0xabb8('0x17'));var db=require(_0xabb8('0x18'))['db'];function respondWithStatusCode(_0x20dfdf,_0x555ce8){_0x555ce8=_0x555ce8||0xcc;return function(_0xf46fe){if(_0xf46fe){return _0x20dfdf[_0xabb8('0x19')](_0x555ce8);}return _0x20dfdf[_0xabb8('0x1a')](_0x555ce8)[_0xabb8('0x1b')]();};}function respondWithResult(_0xb7403b,_0x21a0dd){_0x21a0dd=_0x21a0dd||0xc8;return function(_0x31c7bf){if(_0x31c7bf){return _0xb7403b['status'](_0x21a0dd)['json'](_0x31c7bf);}};}function respondWithFilteredResult(_0x5a4711,_0x34c866){return function(_0xc7ef3e){if(_0xc7ef3e){var _0x6ec3da=typeof _0x34c866['offset']===_0xabb8('0x1c')&&typeof _0x34c866['limit']===_0xabb8('0x1c');var _0x41a5ca=_0xc7ef3e[_0xabb8('0x1d')];var _0xf52931=_0x6ec3da?0x0:_0x34c866[_0xabb8('0x1e')];var _0x5c3209=_0x6ec3da?_0xc7ef3e[_0xabb8('0x1d')]:_0x34c866[_0xabb8('0x1e')]+_0x34c866[_0xabb8('0x1f')];var _0x5d2a88;if(_0x5c3209>=_0x41a5ca){_0x5c3209=_0x41a5ca;_0x5d2a88=0xc8;}else{_0x5d2a88=0xce;}_0x5a4711[_0xabb8('0x1a')](_0x5d2a88);return _0x5a4711[_0xabb8('0x20')]('Content-Range',_0xf52931+'-'+_0x5c3209+'/'+_0x41a5ca)[_0xabb8('0x21')](_0xc7ef3e);}return null;};}function patchUpdates(_0x75e869){return function(_0x1737ae){try{jsonpatch[_0xabb8('0x22')](_0x1737ae,_0x75e869,!![]);}catch(_0x31f3f4){return BPromise[_0xabb8('0x23')](_0x31f3f4);}return _0x1737ae['save']();};}function saveUpdates(_0x2808b2,_0x4f0618){return function(_0x1f04f7){if(_0x1f04f7){return _0x1f04f7[_0xabb8('0x24')](_0x2808b2)[_0xabb8('0x25')](function(_0x31f5f3){return _0x31f5f3;});}return null;};}function removeEntity(_0x44688b,_0x222036){return function(_0x5733fc){if(_0x5733fc){return _0x5733fc[_0xabb8('0x26')]()[_0xabb8('0x25')](function(){_0x44688b[_0xabb8('0x1a')](0xcc)[_0xabb8('0x1b')]();});}};}function handleEntityNotFound(_0x2c821a,_0x4f5764){return function(_0x1eed88){if(!_0x1eed88){_0x2c821a['sendStatus'](0x194);}return _0x1eed88;};}function handleError(_0x20a548,_0x231437){_0x231437=_0x231437||0x1f4;return function(_0x1061c3){logger[_0xabb8('0x27')](_0x1061c3[_0xabb8('0x28')]);if(_0x1061c3['name']){delete _0x1061c3[_0xabb8('0x29')];}_0x20a548[_0xabb8('0x1a')](_0x231437)[_0xabb8('0x2a')](_0x1061c3);};}exports[_0xabb8('0x2b')]=function(_0xe1a291,_0x5e4514){var _0x292b64={},_0x4e8954={},_0x3e5ecd={'count':0x0,'rows':[]};var _0x1c270a=_[_0xabb8('0x2c')](db[_0xabb8('0x2d')][_0xabb8('0x2e')],function(_0x17f707){return{'name':_0x17f707['fieldName'],'type':_0x17f707[_0xabb8('0x2f')][_0xabb8('0x30')]};});_0x4e8954[_0xabb8('0x31')]=_['map'](_0x1c270a,'name');_0x4e8954[_0xabb8('0x32')]=_[_0xabb8('0x33')](_0xe1a291[_0xabb8('0x32')]);_0x4e8954[_0xabb8('0x34')]=_[_0xabb8('0x35')](_0x4e8954[_0xabb8('0x31')],_0x4e8954[_0xabb8('0x32')]);_0x292b64['attributes']=_[_0xabb8('0x35')](_0x4e8954[_0xabb8('0x31')],qs[_0xabb8('0x36')](_0xe1a291[_0xabb8('0x32')][_0xabb8('0x36')]));_0x292b64[_0xabb8('0x37')]=_0x292b64[_0xabb8('0x37')][_0xabb8('0x38')]?_0x292b64['attributes']:_0x4e8954[_0xabb8('0x31')];if(!_0xe1a291[_0xabb8('0x32')][_0xabb8('0x39')](_0xabb8('0x3a'))){_0x292b64[_0xabb8('0x1f')]=qs['limit'](_0xe1a291[_0xabb8('0x32')][_0xabb8('0x1f')]);_0x292b64[_0xabb8('0x1e')]=qs[_0xabb8('0x1e')](_0xe1a291['query']['offset']);}_0x292b64[_0xabb8('0x3b')]=qs['sort'](_0xe1a291[_0xabb8('0x32')][_0xabb8('0x3c')]);_0x292b64[_0xabb8('0x3d')]=qs[_0xabb8('0x34')](_[_0xabb8('0x3e')](_0xe1a291[_0xabb8('0x32')],_0x4e8954[_0xabb8('0x34')]),_0x1c270a);if(_0xe1a291[_0xabb8('0x32')][_0xabb8('0x3f')]){_0x292b64['where']=_[_0xabb8('0x40')](_0x292b64[_0xabb8('0x3d')],{'$or':_[_0xabb8('0x2c')](_0x1c270a,function(_0x28ec72){if(_0x28ec72[_0xabb8('0x2f')]!==_0xabb8('0x41')){var _0x4e01d9={};_0x4e01d9[_0x28ec72[_0xabb8('0x29')]]={'$like':'%'+_0xe1a291[_0xabb8('0x32')][_0xabb8('0x3f')]+'%'};return _0x4e01d9;}})});}_0x292b64=_[_0xabb8('0x40')]({},_0x292b64,_0xe1a291[_0xabb8('0x42')]);var _0x2f1653={'where':_0x292b64['where']};return db[_0xabb8('0x2d')][_0xabb8('0x1d')](_0x2f1653)[_0xabb8('0x25')](function(_0x4fe37d){_0x3e5ecd[_0xabb8('0x1d')]=_0x4fe37d;if(_0xe1a291[_0xabb8('0x32')][_0xabb8('0x43')]){_0x292b64[_0xabb8('0x44')]=[{'all':!![]}];}return db['SalesforceField'][_0xabb8('0x45')](_0x292b64);})[_0xabb8('0x25')](function(_0x316319){_0x3e5ecd[_0xabb8('0x46')]=_0x316319;return _0x3e5ecd;})[_0xabb8('0x25')](respondWithFilteredResult(_0x5e4514,_0x292b64))[_0xabb8('0x47')](handleError(_0x5e4514,null));};exports[_0xabb8('0x48')]=function(_0x2e2db6,_0x42d6ff){var _0x1d0f0a={'raw':!![],'where':{'id':_0x2e2db6[_0xabb8('0x49')]['id']}},_0x277858={};_0x277858[_0xabb8('0x31')]=_['keys'](db[_0xabb8('0x2d')]['rawAttributes']);_0x277858['query']=_[_0xabb8('0x33')](_0x2e2db6['query']);_0x277858[_0xabb8('0x34')]=_[_0xabb8('0x35')](_0x277858[_0xabb8('0x31')],_0x277858[_0xabb8('0x32')]);_0x1d0f0a[_0xabb8('0x37')]=_['intersection'](_0x277858[_0xabb8('0x31')],qs[_0xabb8('0x36')](_0x2e2db6[_0xabb8('0x32')][_0xabb8('0x36')]));_0x1d0f0a[_0xabb8('0x37')]=_0x1d0f0a[_0xabb8('0x37')][_0xabb8('0x38')]?_0x1d0f0a[_0xabb8('0x37')]:_0x277858[_0xabb8('0x31')];if(_0x2e2db6['query'][_0xabb8('0x43')]){_0x1d0f0a[_0xabb8('0x44')]=[{'all':!![]}];}_0x1d0f0a=_[_0xabb8('0x40')]({},_0x1d0f0a,_0x2e2db6[_0xabb8('0x42')]);return db['SalesforceField'][_0xabb8('0x4a')](_0x1d0f0a)[_0xabb8('0x25')](handleEntityNotFound(_0x42d6ff,null))[_0xabb8('0x25')](respondWithResult(_0x42d6ff,null))[_0xabb8('0x47')](handleError(_0x42d6ff,null));};exports[_0xabb8('0x4b')]=function(_0x1da80b,_0x4b0c44){return db[_0xabb8('0x2d')][_0xabb8('0x4b')](_0x1da80b[_0xabb8('0x4c')],{})[_0xabb8('0x25')](respondWithResult(_0x4b0c44,0xc9))[_0xabb8('0x47')](handleError(_0x4b0c44,null));};exports[_0xabb8('0x24')]=function(_0x2ef7c5,_0x5b8f4e){if(_0x2ef7c5['body']['id']){delete _0x2ef7c5[_0xabb8('0x4c')]['id'];}return db[_0xabb8('0x2d')][_0xabb8('0x4a')]({'where':{'id':_0x2ef7c5[_0xabb8('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b8f4e,null))['then'](saveUpdates(_0x2ef7c5[_0xabb8('0x4c')],null))[_0xabb8('0x25')](respondWithResult(_0x5b8f4e,null))[_0xabb8('0x47')](handleError(_0x5b8f4e,null));};exports[_0xabb8('0x26')]=function(_0x57b97d,_0x1da512){return db[_0xabb8('0x2d')]['find']({'where':{'id':_0x57b97d[_0xabb8('0x49')]['id']}})[_0xabb8('0x25')](handleEntityNotFound(_0x1da512,null))[_0xabb8('0x25')](removeEntity(_0x1da512,null))[_0xabb8('0x47')](handleError(_0x1da512,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2e19a4c..4a11e0c 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 _0x94b4=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x598aa9,_0x36ce33){var _0x4ccbc3=function(_0x3be91a){while(--_0x3be91a){_0x598aa9['push'](_0x598aa9['shift']());}};_0x4ccbc3(++_0x36ce33);}(_0x94b4,0x1ca));var _0x494b=function(_0x3f5a5a,_0x3ab1e8){_0x3f5a5a=_0x3f5a5a-0x0;var _0x508359=_0x94b4[_0x3f5a5a];return _0x508359;};'use strict';var _=require('lodash');var util=require(_0x494b('0x0'));var logger=require(_0x494b('0x1'))(_0x494b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x494b('0x3'));var fs=require('fs');var path=require(_0x494b('0x4'));var rimraf=require(_0x494b('0x5'));var config=require(_0x494b('0x6'));var attributes=require(_0x494b('0x7'));module[_0x494b('0x8')]=function(_0x48b897,_0x25b232){return _0x48b897[_0x494b('0x9')](_0x494b('0xa'),attributes,{'tableName':_0x494b('0xb'),'paranoid':![],'indexes':[{'name':_0x494b('0xc'),'fields':[_0x494b('0xd'),_0x494b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa324=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','request-promise'];(function(_0x8d1e41,_0xf57eed){var _0x11bcf8=function(_0x1a3ec8){while(--_0x1a3ec8){_0x8d1e41['push'](_0x8d1e41['shift']());}};_0x11bcf8(++_0xf57eed);}(_0xa324,0x9b));var _0x4a32=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa324[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require(_0x4a32('0x0'));var logger=require(_0x4a32('0x1'))(_0x4a32('0x2'));var moment=require('moment');var BPromise=require(_0x4a32('0x3'));var rp=require(_0x4a32('0x4'));var fs=require('fs');var path=require(_0x4a32('0x5'));var rimraf=require(_0x4a32('0x6'));var config=require(_0x4a32('0x7'));var attributes=require(_0x4a32('0x8'));module[_0x4a32('0x9')]=function(_0x3f2e17,_0xdea93e){return _0x3f2e17[_0x4a32('0xa')](_0x4a32('0xb'),attributes,{'tableName':_0x4a32('0xc'),'paranoid':![],'indexes':[{'name':_0x4a32('0xd'),'fields':[_0x4a32('0xe'),_0x4a32('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index d126ad8..99856b2 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 _0x4dd9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x2da70f,_0x6329f0){var _0x3fcba4=function(_0x521f82){while(--_0x521f82){_0x2da70f['push'](_0x2da70f['shift']());}};_0x3fcba4(++_0x6329f0);}(_0x4dd9,0x18f));var _0x94dd=function(_0x36a997,_0x288f0b){_0x36a997=_0x36a997-0x0;var _0x561b1b=_0x4dd9[_0x36a997];return _0x561b1b;};'use strict';var _=require(_0x94dd('0x0'));var util=require(_0x94dd('0x1'));var moment=require(_0x94dd('0x2'));var BPromise=require(_0x94dd('0x3'));var rs=require(_0x94dd('0x4'));var fs=require('fs');var Redis=require(_0x94dd('0x5'));var db=require(_0x94dd('0x6'))['db'];var utils=require(_0x94dd('0x7'));var logger=require(_0x94dd('0x8'))('rpc');var config=require(_0x94dd('0x9'));var jayson=require(_0x94dd('0xa'));var client=jayson[_0x94dd('0xb')][_0x94dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45b8ec,_0x1b2a7e,_0x313fdc){return new BPromise(function(_0x569092,_0x420739){return client[_0x94dd('0xd')](_0x45b8ec,_0x313fdc)[_0x94dd('0xe')](function(_0x2fd6f4){logger[_0x94dd('0xf')](_0x94dd('0x10'),_0x1b2a7e,'request\x20sent');logger[_0x94dd('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x1b2a7e,_0x94dd('0x12'),JSON[_0x94dd('0x13')](_0x2fd6f4));if(_0x2fd6f4['error']){if(_0x2fd6f4[_0x94dd('0x14')][_0x94dd('0x15')]===0x1f4){logger[_0x94dd('0x14')](_0x94dd('0x10'),_0x1b2a7e,_0x2fd6f4[_0x94dd('0x14')][_0x94dd('0x16')]);return _0x420739(_0x2fd6f4[_0x94dd('0x14')][_0x94dd('0x16')]);}logger[_0x94dd('0x14')](_0x94dd('0x10'),_0x1b2a7e,_0x2fd6f4['error'][_0x94dd('0x16')]);return _0x569092(_0x2fd6f4[_0x94dd('0x14')][_0x94dd('0x16')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x1b2a7e,_0x94dd('0x12'));_0x569092(_0x2fd6f4[_0x94dd('0x17')][_0x94dd('0x16')]);}})[_0x94dd('0x18')](function(_0x5d8a5e){logger[_0x94dd('0x14')](_0x94dd('0x10'),_0x1b2a7e,_0x5d8a5e);_0x420739(_0x5d8a5e);});});} \ No newline at end of file +var _0x0ff5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x0ff5,0x1cd));var _0x50ff=function(_0x54e9e7,_0x337069){_0x54e9e7=_0x54e9e7-0x0;var _0x3d4d8c=_0x0ff5[_0x54e9e7];return _0x3d4d8c;};'use strict';var _=require(_0x50ff('0x0'));var util=require('util');var moment=require(_0x50ff('0x1'));var BPromise=require(_0x50ff('0x2'));var rs=require(_0x50ff('0x3'));var fs=require('fs');var Redis=require(_0x50ff('0x4'));var db=require(_0x50ff('0x5'))['db'];var utils=require(_0x50ff('0x6'));var logger=require(_0x50ff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x50ff('0x8'));var client=jayson[_0x50ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf2f29d,_0x21f158,_0xc26ebb){return new BPromise(function(_0x51ae45,_0x5106fd){return client[_0x50ff('0xa')](_0xf2f29d,_0xc26ebb)['then'](function(_0x5cc2c7){logger[_0x50ff('0xb')](_0x50ff('0xc'),_0x21f158,_0x50ff('0xd'));logger[_0x50ff('0xe')](_0x50ff('0xf'),_0x21f158,'request\x20sent',JSON[_0x50ff('0x10')](_0x5cc2c7));if(_0x5cc2c7[_0x50ff('0x11')]){if(_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x12')]===0x1f4){logger[_0x50ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21f158,_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);return _0x5106fd(_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);}logger[_0x50ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21f158,_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);return _0x51ae45(_0x5cc2c7[_0x50ff('0x11')][_0x50ff('0x13')]);}else{logger[_0x50ff('0xb')](_0x50ff('0xc'),_0x21f158,'request\x20sent');_0x51ae45(_0x5cc2c7[_0x50ff('0x14')]['message']);}})[_0x50ff('0x15')](function(_0x419f88){logger[_0x50ff('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21f158,_0x419f88);_0x5106fd(_0x419f88);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e504d40..3e7f6b8 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 _0x3785=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','update','delete'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x3785,0x92));var _0x5378=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x3785[_0xae7c2f];return _0x5d7001;};'use strict';var multer=require(_0x5378('0x0'));var util=require(_0x5378('0x1'));var path=require(_0x5378('0x2'));var timeout=require(_0x5378('0x3'));var express=require(_0x5378('0x4'));var router=express[_0x5378('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5378('0x6'));var interaction=require(_0x5378('0x7'));var config=require('../../config/environment');var controller=require(_0x5378('0x8'));router[_0x5378('0x9')]('/',auth[_0x5378('0xa')](),controller[_0x5378('0xb')]);router[_0x5378('0x9')](_0x5378('0xc'),auth[_0x5378('0xa')](),controller[_0x5378('0xd')]);router[_0x5378('0x9')](_0x5378('0xe'),auth[_0x5378('0xa')](),controller[_0x5378('0xf')]);router[_0x5378('0x9')](_0x5378('0x10'),auth[_0x5378('0xa')](),controller['getFields']);router['post']('/',auth[_0x5378('0xa')](),controller[_0x5378('0x11')]);router[_0x5378('0x12')]('/:id/configurations',auth[_0x5378('0xa')](),controller[_0x5378('0x13')]);router['put'](_0x5378('0xc'),auth[_0x5378('0xa')](),controller[_0x5378('0x14')]);router[_0x5378('0x15')](_0x5378('0xc'),auth[_0x5378('0xa')](),controller[_0x5378('0x16')]);module[_0x5378('0x17')]=router; \ No newline at end of file +var _0x5397=['getConfigurations','getFields','post','create','addConfiguration','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x3e84f4,_0x227df7){var _0x585800=function(_0x5d39ad){while(--_0x5d39ad){_0x3e84f4['push'](_0x3e84f4['shift']());}};_0x585800(++_0x227df7);}(_0x5397,0x105));var _0x7539=function(_0x334b98,_0x4a712a){_0x334b98=_0x334b98-0x0;var _0x1a10d9=_0x5397[_0x334b98];return _0x1a10d9;};'use strict';var multer=require('multer');var util=require(_0x7539('0x0'));var path=require(_0x7539('0x1'));var timeout=require(_0x7539('0x2'));var express=require(_0x7539('0x3'));var router=express[_0x7539('0x4')]();var fs_extra=require(_0x7539('0x5'));var auth=require(_0x7539('0x6'));var interaction=require(_0x7539('0x7'));var config=require(_0x7539('0x8'));var controller=require('./intServicenowAccount.controller');router[_0x7539('0x9')]('/',auth[_0x7539('0xa')](),controller[_0x7539('0xb')]);router[_0x7539('0x9')](_0x7539('0xc'),auth['isAuthenticated'](),controller[_0x7539('0xd')]);router['get'](_0x7539('0xe'),auth[_0x7539('0xa')](),controller[_0x7539('0xf')]);router[_0x7539('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7539('0x10')]);router[_0x7539('0x11')]('/',auth[_0x7539('0xa')](),controller[_0x7539('0x12')]);router[_0x7539('0x11')]('/:id/configurations',auth[_0x7539('0xa')](),controller[_0x7539('0x13')]);router['put'](_0x7539('0xc'),auth[_0x7539('0xa')](),controller['update']);router[_0x7539('0x14')](_0x7539('0xc'),auth['isAuthenticated'](),controller[_0x7539('0x15')]);module[_0x7539('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ecd0c8a..1a06532 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 _0xfdb4=['exports','STRING','remoteUri','sequelize'];(function(_0x165058,_0x151426){var _0x3dc05e=function(_0x516698){while(--_0x516698){_0x165058['push'](_0x165058['shift']());}};_0x3dc05e(++_0x151426);}(_0xfdb4,0x127));var _0x4fdb=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xfdb4[_0x28d18d];return _0x470640;};'use strict';var Sequelize=require(_0x4fdb('0x0'));module[_0x4fdb('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4fdb('0x2')]},'username':{'type':Sequelize[_0x4fdb('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x4fdb('0x2')]},'email':{'type':Sequelize[_0x4fdb('0x2')]},'remoteUri':{'type':Sequelize[_0x4fdb('0x2')],'unique':_0x4fdb('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x11d4=['STRING','username','remoteUri','sequelize','exports'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x11d4,0x12f));var _0x411d=function(_0x3ce3b7,_0x29397e){_0x3ce3b7=_0x3ce3b7-0x0;var _0x4c957c=_0x11d4[_0x3ce3b7];return _0x4c957c;};'use strict';var Sequelize=require(_0x411d('0x0'));module[_0x411d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x411d('0x2')]},'username':{'type':Sequelize[_0x411d('0x2')],'unique':_0x411d('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x411d('0x2')]},'remoteUri':{'type':Sequelize[_0x411d('0x2')],'unique':_0x411d('0x4')},'serverUrl':{'type':Sequelize[_0x411d('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 33a8376..39f3059 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 _0x5386=['getDescriptions','ServicenowField','Subjects','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','sys_updated_on','child_incidents','approval_history','resolved_by','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','time_worked','expected_start','opened_at','business_duration','reopened_time','approval_set','work_notes','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','error','send','Wrong\x20credentials','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','label','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','map','ServicenowAccount','rawAttributes','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','destroy','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions'];(function(_0x35decc,_0x4b1cf6){var _0x5761ea=function(_0x30fc02){while(--_0x30fc02){_0x35decc['push'](_0x35decc['shift']());}};_0x5761ea(++_0x4b1cf6);}(_0x5386,0x11d));var _0x6538=function(_0x3afaae,_0x1ee943){_0x3afaae=_0x3afaae-0x0;var _0x21c7cc=_0x5386[_0x3afaae];return _0x21c7cc;};'use strict';var emlformat=require(_0x6538('0x0'));var rimraf=require(_0x6538('0x1'));var zipdir=require(_0x6538('0x2'));var jsonpatch=require(_0x6538('0x3'));var rp=require(_0x6538('0x4'));var moment=require(_0x6538('0x5'));var BPromise=require(_0x6538('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6538('0x7'));var sox=require(_0x6538('0x8'));var csv=require(_0x6538('0x9'));var ejs=require(_0x6538('0xa'));var fs=require('fs');var fs_extra=require(_0x6538('0xb'));var _=require(_0x6538('0xc'));var squel=require(_0x6538('0xd'));var crypto=require(_0x6538('0xe'));var jsforce=require(_0x6538('0xf'));var deskjs=require(_0x6538('0x10'));var toCsv=require(_0x6538('0x9'));var querystring=require('querystring');var Papa=require(_0x6538('0x11'));var Redis=require(_0x6538('0x12'));var authService=require(_0x6538('0x13'));var qs=require(_0x6538('0x14'));var as=require(_0x6538('0x15'));var hardwareService=require(_0x6538('0x16'));var logger=require(_0x6538('0x17'))('api');var utils=require(_0x6538('0x18'));var config=require(_0x6538('0x19'));var licenseUtil=require(_0x6538('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bce5c,_0x3e5ae7){_0x3e5ae7=_0x3e5ae7||0xcc;return function(_0x2d7d13){if(_0x2d7d13){return _0x5bce5c[_0x6538('0x1b')](_0x3e5ae7);}return _0x5bce5c[_0x6538('0x1c')](_0x3e5ae7)[_0x6538('0x1d')]();};}function respondWithResult(_0x2c42fb,_0x8d7cb0){_0x8d7cb0=_0x8d7cb0||0xc8;return function(_0x1af193){if(_0x1af193){return _0x2c42fb[_0x6538('0x1c')](_0x8d7cb0)[_0x6538('0x1e')](_0x1af193);}};}function respondWithFilteredResult(_0x53239f,_0x2b2fa2){return function(_0x515246){if(_0x515246){var _0x46c2b4=typeof _0x2b2fa2['offset']===_0x6538('0x1f')&&typeof _0x2b2fa2[_0x6538('0x20')]===_0x6538('0x1f');var _0x52aa1e=_0x515246[_0x6538('0x21')];var _0x44aad7=_0x46c2b4?0x0:_0x2b2fa2['offset'];var _0xdf99a3=_0x46c2b4?_0x515246[_0x6538('0x21')]:_0x2b2fa2[_0x6538('0x22')]+_0x2b2fa2[_0x6538('0x20')];var _0x427937;if(_0xdf99a3>=_0x52aa1e){_0xdf99a3=_0x52aa1e;_0x427937=0xc8;}else{_0x427937=0xce;}_0x53239f[_0x6538('0x1c')](_0x427937);return _0x53239f[_0x6538('0x23')](_0x6538('0x24'),_0x44aad7+'-'+_0xdf99a3+'/'+_0x52aa1e)['json'](_0x515246);}return null;};}function patchUpdates(_0x31dc44){return function(_0x5e95af){try{jsonpatch[_0x6538('0x25')](_0x5e95af,_0x31dc44,!![]);}catch(_0x55b481){return BPromise[_0x6538('0x26')](_0x55b481);}return _0x5e95af[_0x6538('0x27')]();};}function saveUpdates(_0x592eb3,_0x56abee){return function(_0x2de4fe){if(_0x2de4fe){return _0x2de4fe[_0x6538('0x28')](_0x592eb3)[_0x6538('0x29')](function(_0x1766e6){return _0x1766e6;});}return null;};}function removeEntity(_0x2d4c9b,_0x48e38a){return function(_0x4a3007){if(_0x4a3007){return _0x4a3007['destroy']()['then'](function(){_0x2d4c9b[_0x6538('0x1c')](0xcc)[_0x6538('0x1d')]();});}};}function handleEntityNotFound(_0x280fe0,_0x982de){return function(_0x4f94a3){if(!_0x4f94a3){_0x280fe0[_0x6538('0x1b')](0x194);}return _0x4f94a3;};}function handleError(_0xc77908,_0x1c8f63){_0x1c8f63=_0x1c8f63||0x1f4;return function(_0x50c90b){logger['error'](_0x50c90b[_0x6538('0x2a')]);if(_0x50c90b['name']){delete _0x50c90b['name'];}_0xc77908[_0x6538('0x1c')](_0x1c8f63)['send'](_0x50c90b);};}exports['index']=function(_0x3f0a82,_0x6d0209){var _0x2321ad={},_0x19f69f={},_0x1614ea={'count':0x0,'rows':[]};var _0x671932=_[_0x6538('0x2b')](db[_0x6538('0x2c')][_0x6538('0x2d')],function(_0x292306){return{'name':_0x292306['fieldName'],'type':_0x292306[_0x6538('0x2e')][_0x6538('0x2f')]};});_0x19f69f['model']=_[_0x6538('0x2b')](_0x671932,_0x6538('0x30'));_0x19f69f[_0x6538('0x31')]=_[_0x6538('0x32')](_0x3f0a82[_0x6538('0x31')]);_0x19f69f[_0x6538('0x33')]=_[_0x6538('0x34')](_0x19f69f['model'],_0x19f69f[_0x6538('0x31')]);_0x2321ad[_0x6538('0x35')]=_[_0x6538('0x34')](_0x19f69f[_0x6538('0x36')],qs[_0x6538('0x37')](_0x3f0a82[_0x6538('0x31')][_0x6538('0x37')]));_0x2321ad[_0x6538('0x35')]=_0x2321ad[_0x6538('0x35')][_0x6538('0x38')]?_0x2321ad[_0x6538('0x35')]:_0x19f69f[_0x6538('0x36')];if(!_0x3f0a82['query'][_0x6538('0x39')](_0x6538('0x3a'))){_0x2321ad[_0x6538('0x20')]=qs['limit'](_0x3f0a82[_0x6538('0x31')][_0x6538('0x20')]);_0x2321ad['offset']=qs[_0x6538('0x22')](_0x3f0a82['query']['offset']);}_0x2321ad[_0x6538('0x3b')]=qs[_0x6538('0x3c')](_0x3f0a82[_0x6538('0x31')][_0x6538('0x3c')]);_0x2321ad[_0x6538('0x3d')]=qs[_0x6538('0x33')](_[_0x6538('0x3e')](_0x3f0a82[_0x6538('0x31')],_0x19f69f['filters']),_0x671932);if(_0x3f0a82[_0x6538('0x31')]['filter']){_0x2321ad[_0x6538('0x3d')]=_[_0x6538('0x3f')](_0x2321ad[_0x6538('0x3d')],{'$or':_['map'](_0x671932,function(_0x491297){if(_0x491297[_0x6538('0x2e')]!==_0x6538('0x40')){var _0x201f58={};_0x201f58[_0x491297[_0x6538('0x30')]]={'$like':'%'+_0x3f0a82[_0x6538('0x31')][_0x6538('0x41')]+'%'};return _0x201f58;}})});}_0x2321ad=_['merge']({},_0x2321ad,_0x3f0a82[_0x6538('0x42')]);var _0x582c36={'where':_0x2321ad[_0x6538('0x3d')]};return db[_0x6538('0x2c')][_0x6538('0x21')](_0x582c36)['then'](function(_0x26d1db){_0x1614ea[_0x6538('0x21')]=_0x26d1db;if(_0x3f0a82[_0x6538('0x31')][_0x6538('0x43')]){_0x2321ad[_0x6538('0x44')]=[{'all':!![]}];}return db[_0x6538('0x2c')]['findAll'](_0x2321ad);})[_0x6538('0x29')](function(_0xec182a){_0x1614ea[_0x6538('0x45')]=_0xec182a;return _0x1614ea;})['then'](respondWithFilteredResult(_0x6d0209,_0x2321ad))[_0x6538('0x46')](handleError(_0x6d0209,null));};exports[_0x6538('0x47')]=function(_0x13b771,_0x1d1a2d){var _0x3ff26b={'raw':![],'where':{'id':_0x13b771[_0x6538('0x48')]['id']}},_0x2e81ef={};_0x2e81ef[_0x6538('0x36')]=_[_0x6538('0x32')](db[_0x6538('0x2c')]['rawAttributes']);_0x2e81ef[_0x6538('0x31')]=_['keys'](_0x13b771[_0x6538('0x31')]);_0x2e81ef[_0x6538('0x33')]=_[_0x6538('0x34')](_0x2e81ef[_0x6538('0x36')],_0x2e81ef[_0x6538('0x31')]);_0x3ff26b[_0x6538('0x35')]=_[_0x6538('0x34')](_0x2e81ef['model'],qs[_0x6538('0x37')](_0x13b771[_0x6538('0x31')]['fields']));_0x3ff26b[_0x6538('0x35')]=_0x3ff26b['attributes']['length']?_0x3ff26b[_0x6538('0x35')]:_0x2e81ef['model'];if(_0x13b771[_0x6538('0x31')][_0x6538('0x43')]){_0x3ff26b[_0x6538('0x44')]=[{'all':!![]}];}_0x3ff26b=_[_0x6538('0x3f')]({},_0x3ff26b,_0x13b771[_0x6538('0x42')]);return db[_0x6538('0x2c')][_0x6538('0x49')](_0x3ff26b)[_0x6538('0x29')](handleEntityNotFound(_0x1d1a2d,null))[_0x6538('0x29')](respondWithResult(_0x1d1a2d,null))[_0x6538('0x46')](handleError(_0x1d1a2d,null));};exports[_0x6538('0x4a')]=function(_0x2ac089,_0x300ef5){return db[_0x6538('0x2c')][_0x6538('0x4a')](_0x2ac089[_0x6538('0x4b')],{})[_0x6538('0x29')](respondWithResult(_0x300ef5,0xc9))['catch'](handleError(_0x300ef5,null));};exports[_0x6538('0x28')]=function(_0x16c7c4,_0x4100b8){if(_0x16c7c4[_0x6538('0x4b')]['id']){delete _0x16c7c4[_0x6538('0x4b')]['id'];}return db[_0x6538('0x2c')][_0x6538('0x49')]({'where':{'id':_0x16c7c4[_0x6538('0x48')]['id']}})[_0x6538('0x29')](handleEntityNotFound(_0x4100b8,null))['then'](saveUpdates(_0x16c7c4[_0x6538('0x4b')],null))['then'](respondWithResult(_0x4100b8,null))[_0x6538('0x46')](handleError(_0x4100b8,null));};exports[_0x6538('0x4c')]=function(_0x4ef83a,_0xa4283){return db[_0x6538('0x2c')][_0x6538('0x49')]({'where':{'id':_0x4ef83a['params']['id']}})[_0x6538('0x29')](handleEntityNotFound(_0xa4283,null))[_0x6538('0x29')](removeEntity(_0xa4283,null))[_0x6538('0x46')](handleError(_0xa4283,null));};exports['getConfigurations']=function(_0x277430,_0x2e2661,_0x525d71){var _0x2f46f9={};var _0x4593da={};var _0xbb60c8;var _0x3da3e9;return db[_0x6538('0x2c')][_0x6538('0x4d')]({'where':{'id':_0x277430[_0x6538('0x48')]['id']}})[_0x6538('0x29')](handleEntityNotFound(_0x2e2661,null))[_0x6538('0x29')](function(_0x4496f8){if(_0x4496f8){_0xbb60c8=_0x4496f8;_0x4593da[_0x6538('0x36')]=_[_0x6538('0x32')](db[_0x6538('0x4e')][_0x6538('0x2d')]);_0x4593da[_0x6538('0x31')]=_[_0x6538('0x32')](_0x277430[_0x6538('0x31')]);_0x4593da[_0x6538('0x33')]=_[_0x6538('0x34')](_0x4593da['model'],_0x4593da['query']);_0x2f46f9[_0x6538('0x35')]=_['intersection'](_0x4593da[_0x6538('0x36')],qs[_0x6538('0x37')](_0x277430[_0x6538('0x31')]['fields']));_0x2f46f9['attributes']=_0x2f46f9[_0x6538('0x35')]['length']?_0x2f46f9[_0x6538('0x35')]:_0x4593da[_0x6538('0x36')];_0x2f46f9[_0x6538('0x3b')]=qs[_0x6538('0x3c')](_0x277430['query'][_0x6538('0x3c')]);_0x2f46f9[_0x6538('0x3d')]=qs[_0x6538('0x33')](_[_0x6538('0x3e')](_0x277430[_0x6538('0x31')],_0x4593da['filters']));if(_0x277430[_0x6538('0x31')][_0x6538('0x41')]){_0x2f46f9['where']=_[_0x6538('0x3f')](_0x2f46f9[_0x6538('0x3d')],{'$or':_[_0x6538('0x2b')](_0x2f46f9[_0x6538('0x35')],function(_0x36e8ff){var _0x23169c={};_0x23169c[_0x36e8ff]={'$like':'%'+_0x277430[_0x6538('0x31')][_0x6538('0x41')]+'%'};return _0x23169c;})});}_0x2f46f9=_[_0x6538('0x3f')]({},_0x2f46f9,_0x277430[_0x6538('0x42')]);return _0xbb60c8['getConfigurations'](_0x2f46f9);}})[_0x6538('0x29')](function(_0x58b355){if(_0x58b355){_0x3da3e9=_0x58b355[_0x6538('0x38')];if(!_0x277430['query'][_0x6538('0x39')](_0x6538('0x3a'))){_0x2f46f9['limit']=qs[_0x6538('0x20')](_0x277430[_0x6538('0x31')]['limit']);_0x2f46f9[_0x6538('0x22')]=qs[_0x6538('0x22')](_0x277430[_0x6538('0x31')][_0x6538('0x22')]);}return _0xbb60c8[_0x6538('0x4f')](_0x2f46f9);}})['then'](function(_0x1d1d87){if(_0x1d1d87){return _0x1d1d87?{'count':_0x3da3e9,'rows':_0x1d1d87}:null;}})[_0x6538('0x29')](respondWithResult(_0x2e2661,null))[_0x6538('0x46')](handleError(_0x2e2661,null));};exports[_0x6538('0x50')]=function(_0x4dbc08,_0x354a4f,_0x29cfdc){if(_0x4dbc08[_0x6538('0x4b')]['id']){delete _0x4dbc08[_0x6538('0x4b')]['id'];}return db['ServicenowAccount'][_0x6538('0x4d')]({'where':{'id':_0x4dbc08[_0x6538('0x48')]['id']}})[_0x6538('0x29')](handleEntityNotFound(_0x354a4f,null))['then'](function(_0x29d139){if(_0x29d139){_0x4dbc08[_0x6538('0x4b')][_0x6538('0x51')]=_0x29d139['id'];_0x4dbc08['body']['Subjects']=integrations[_0x6538('0x52')](_0x4dbc08[_0x6538('0x4b')][_0x6538('0x53')],_0x4dbc08[_0x6538('0x4b')]['type']);_0x4dbc08[_0x6538('0x4b')][_0x6538('0x54')]=integrations[_0x6538('0x55')](_0x4dbc08[_0x6538('0x4b')][_0x6538('0x53')],_0x4dbc08[_0x6538('0x4b')][_0x6538('0x2e')]);return db[_0x6538('0x4e')][_0x6538('0x4a')](_0x4dbc08[_0x6538('0x4b')],{'include':[{'model':db[_0x6538('0x56')],'as':_0x6538('0x57')},{'model':db[_0x6538('0x56')],'as':_0x6538('0x54')}]});}return null;})[_0x6538('0x29')](respondWithResult(_0x354a4f,null))['catch'](handleError(_0x354a4f,null));};exports[_0x6538('0x58')]=function(_0x36f800,_0x504786,_0x30ec20){var _0xe5b6a=[_0x6538('0x59'),_0x6538('0x5a'),_0x6538('0x5b'),_0x6538('0x5c'),_0x6538('0x5d'),_0x6538('0x5e'),_0x6538('0x5f'),'severity',_0x6538('0x60')];var _0x4b01e7=[_0x6538('0x61'),'made_sla',_0x6538('0x62'),'watch_list','upon_reject',_0x6538('0x63'),_0x6538('0x64'),_0x6538('0x5a'),_0x6538('0x65'),'number',_0x6538('0x66'),'sys_updated_by','opened_by','user_input',_0x6538('0x67'),_0x6538('0x68'),_0x6538('0x69'),_0x6538('0x6a'),'knowledge',_0x6538('0x3b'),'calendar_stc',_0x6538('0x6b'),_0x6538('0x6c'),_0x6538('0x6d'),_0x6538('0x6e'),_0x6538('0x6f'),_0x6538('0x70'),_0x6538('0x71'),'priority',_0x6538('0x72'),'rfc',_0x6538('0x73'),_0x6538('0x74'),_0x6538('0x75'),_0x6538('0x76'),'group_list','work_end',_0x6538('0x77'),'resolved_at','caller_id',_0x6538('0x78'),_0x6538('0x5c'),_0x6538('0x79'),'short_description',_0x6538('0x5d'),'correlation_display',_0x6538('0x7a'),_0x6538('0x7b'),'assignment_group',_0x6538('0x7c'),_0x6538('0x7d'),'description',_0x6538('0x7e'),_0x6538('0x5e'),_0x6538('0x7f'),_0x6538('0x80'),_0x6538('0x81'),_0x6538('0x82'),'parent_incident','sys_id',_0x6538('0x83'),_0x6538('0x84'),_0x6538('0x5f'),_0x6538('0x85'),_0x6538('0x86'),_0x6538('0x87'),_0x6538('0x88'),'activity_due',_0x6538('0x89'),_0x6538('0x8a'),_0x6538('0x8b'),_0x6538('0x8c'),_0x6538('0x8d'),_0x6538('0x8e'),_0x6538('0x8f'),_0x6538('0x90'),_0x6538('0x91'),'sys_tags',_0x6538('0x92'),_0x6538('0x93'),_0x6538('0x94'),_0x6538('0x95'),'category'];var _0x2fff45='';var _0x239d24='';var _0xf2a6ea=[];var _0x2eb420='';var _0x5023dc='';var _0x2335e0=[];var _0x627e1='';var _0xb50fed='';var _0x27cb9c={};var _0x2da6f3='';return db[_0x6538('0x2c')]['findOne']({'where':{'id':_0x36f800[_0x6538('0x48')]['id']},'attributes':['id',_0x6538('0x96'),'password',_0x6538('0x97'),_0x6538('0x98'),_0x6538('0x99')]})['then'](handleEntityNotFound(_0x504786,null))[_0x6538('0x29')](function(_0x3716e0){if(_0x3716e0){_0x2da6f3=_0x3716e0[_0x6538('0x98')];var _0x36a69a=_0x2da6f3['slice'](-0x1);if(_0x36a69a==='/'){_0x2da6f3=_0x2da6f3[_0x6538('0x9a')](0x0,_0x2da6f3[_0x6538('0x9b')](_0x36a69a));}_0xb50fed=util['format'](_0x6538('0x9c'),_0x2da6f3);_0x627e1=util[_0x6538('0x9d')]('%s/api/now/table/',_0x2da6f3);_0x27cb9c={'user':_0x3716e0['username'],'pass':_0x3716e0['password']};var _0x354a5e={'method':_0x6538('0x9e'),'uri':_0xb50fed+_0x6538('0x9f'),'auth':_0x27cb9c,'json':!![]};return rp(_0x354a5e);}})[_0x6538('0x29')](function(_0x3dd8b8){if(_0x3dd8b8[_0x6538('0xa0')]['length']>0x0){_0x2fff45=_0x3dd8b8['result'];}console[_0x6538('0xa1')](_0x6538('0xa2'),_0x2fff45);_0x2335e0=[];_0x239d24=Object[_0x6538('0xa3')]([],_0x2fff45);_[_0x6538('0xa4')](_0x239d24,function(_0x2eee28){return!_0xe5b6a[_0x6538('0xa5')](_0x2eee28[_0x6538('0x30')]);});_0x239d24[_0x6538('0xa6')](function(_0x233ed8){var _0x1c53c1=createFieldObject(_0x627e1,_0x27cb9c,_0x233ed8[_0x6538('0xa7')],_0x233ed8[_0x6538('0x30')],_0x233ed8['label'],![]);_0x2335e0[_0x6538('0xa8')](_0x1c53c1);});return Promise['all'](_0x2335e0);})[_0x6538('0x29')](function(_0x4f6c07){_0xf2a6ea=_0x4f6c07;_0x2eb420=Object[_0x6538('0xa3')]([],_0x2fff45);console[_0x6538('0xa1')](_0x6538('0xa9'),_0x2fff45);_[_0x6538('0xa4')](_0x2eb420,function(_0x34c381){return _0x4b01e7[_0x6538('0xa5')](_0x34c381[_0x6538('0x30')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2eb420);_0x2335e0=[];_0x2eb420[_0x6538('0xa6')](function(_0x83d195){var _0x3e944b=createFieldObject(_0x627e1,_0x27cb9c,_0x83d195[_0x6538('0xa7')],_0x83d195[_0x6538('0x30')],_0x83d195['label'],!![]);_0x2335e0[_0x6538('0xa8')](_0x3e944b);});return Promise['all'](_0x2335e0);})[_0x6538('0x29')](function(_0x11364d){_0x5023dc=_0x11364d;var _0x43ad22=_0xf2a6ea[_0x6538('0xaa')](_0x5023dc);return{'count':_0x43ad22[_0x6538('0x38')],'rows':_0x43ad22};})['then'](respondWithResult(_0x504786,null))['catch'](function(_0x59cbd6){console['log'](_0x6538('0xab')+_0x59cbd6);var _0x2090f3=_0x36f800[_0x6538('0x31')][_0x6538('0xac')]?0x1f4:_0x59cbd6[_0x6538('0xad')]||0x1f4;logger[_0x6538('0xae')](_0x59cbd6[_0x6538('0x2a')]);delete _0x59cbd6[_0x6538('0x30')];if(_0x2090f3===0x191){_0x2090f3=0x190;}_0x504786[_0x6538('0x1c')](_0x2090f3)[_0x6538('0xaf')](_0x36f800[_0x6538('0x31')][_0x6538('0xac')]?{'message':_0x6538('0xb0'),'statusCode':_0x59cbd6[_0x6538('0xad')]}:_0x59cbd6);});};function createFieldObject(_0x1bb2dc,_0x12fdbf,_0x2b6025,_0x5a0b66,_0x69a812,_0x54afd8){return new Promise(function(_0xbf43f4,_0x4c13ee){var _0x157d7e={'id':_0x5a0b66,'name':_0x69a812,'custom':_0x54afd8};if(_0x2b6025===_0x6538('0xb1')){_0x157d7e['options']=[{'name':_0x6538('0xb2'),'value':_0x6538('0xb3')},{'name':_0x6538('0xb4'),'value':'false'}];_0xbf43f4(_0x157d7e);}else{var _0x1529f8={'method':_0x6538('0x9e'),'uri':_0x1bb2dc+_0x6538('0xb5')+_0x5a0b66,'auth':_0x12fdbf,'json':!![]};return rp(_0x1529f8)['then'](function(_0x289881){var _0x4115fa=[];if(_0x289881[_0x6538('0xa0')]['length']>0x0){_0x289881[_0x6538('0xa0')]['forEach'](function(_0x3f5e04){if(_0x3f5e04[_0x6538('0xb6')]==='false'){var _0x2b648e={'name':_0x3f5e04[_0x6538('0xb7')],'value':_0x3f5e04[_0x6538('0xb8')]};_0x4115fa[_0x6538('0xa8')](_0x2b648e);}});}_0x157d7e[_0x6538('0x42')]=_0x4115fa;if(_0x157d7e[_0x6538('0x42')][_0x6538('0x38')]>0x0){_0xbf43f4(_0x157d7e);}else{if(_0x54afd8==![]){_0xbf43f4();}else{_0xbf43f4(_0x157d7e);}}});}});} \ No newline at end of file +var _0x8df2=['work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','business_duration','group_list','work_end','caller_id','approval_set','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','urgency','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','sys_mod_count','sys_tags','escalation','correlation_id','location','username','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','test','error','Wrong\x20credentials','statusCode','boolean','True','true','False','false','inactive','eml-format','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','find','create','body','params','ServicenowConfiguration','sort','getConfigurations','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','close_code','notify','incident_state','category','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','resolved_by','opened_by','state','closed_at','cmdb_ci','delivery_plan','active'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x8df2,0x1a7));var _0x28df=function(_0x109721,_0x22da20){_0x109721=_0x109721-0x0;var _0x5460aa=_0x8df2[_0x109721];return _0x5460aa;};'use strict';var emlformat=require(_0x28df('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x28df('0x1'));var moment=require(_0x28df('0x2'));var BPromise=require(_0x28df('0x3'));var Mustache=require(_0x28df('0x4'));var util=require('util');var path=require('path');var sox=require(_0x28df('0x5'));var csv=require('to-csv');var ejs=require(_0x28df('0x6'));var fs=require('fs');var fs_extra=require(_0x28df('0x7'));var _=require('lodash');var squel=require(_0x28df('0x8'));var crypto=require(_0x28df('0x9'));var jsforce=require(_0x28df('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x28df('0xb'));var querystring=require(_0x28df('0xc'));var Papa=require(_0x28df('0xd'));var Redis=require(_0x28df('0xe'));var authService=require(_0x28df('0xf'));var qs=require(_0x28df('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x28df('0x11'));var logger=require(_0x28df('0x12'))(_0x28df('0x13'));var utils=require('../../config/utils');var config=require(_0x28df('0x14'));var licenseUtil=require(_0x28df('0x15'));var db=require(_0x28df('0x16'))['db'];var integrations=require(_0x28df('0x17'));function respondWithStatusCode(_0x52cff6,_0x1927db){_0x1927db=_0x1927db||0xcc;return function(_0x37a6c0){if(_0x37a6c0){return _0x52cff6[_0x28df('0x18')](_0x1927db);}return _0x52cff6[_0x28df('0x19')](_0x1927db)[_0x28df('0x1a')]();};}function respondWithResult(_0x500927,_0x40bf66){_0x40bf66=_0x40bf66||0xc8;return function(_0x1853de){if(_0x1853de){return _0x500927[_0x28df('0x19')](_0x40bf66)['json'](_0x1853de);}};}function respondWithFilteredResult(_0x3ce8d5,_0x366bd2){return function(_0x16d52a){if(_0x16d52a){var _0x313a31=typeof _0x366bd2[_0x28df('0x1b')]===_0x28df('0x1c')&&typeof _0x366bd2[_0x28df('0x1d')]===_0x28df('0x1c');var _0x41d86b=_0x16d52a['count'];var _0x2d8340=_0x313a31?0x0:_0x366bd2[_0x28df('0x1b')];var _0x5c47eb=_0x313a31?_0x16d52a[_0x28df('0x1e')]:_0x366bd2[_0x28df('0x1b')]+_0x366bd2['limit'];var _0x35ff88;if(_0x5c47eb>=_0x41d86b){_0x5c47eb=_0x41d86b;_0x35ff88=0xc8;}else{_0x35ff88=0xce;}_0x3ce8d5[_0x28df('0x19')](_0x35ff88);return _0x3ce8d5['set'](_0x28df('0x1f'),_0x2d8340+'-'+_0x5c47eb+'/'+_0x41d86b)[_0x28df('0x20')](_0x16d52a);}return null;};}function patchUpdates(_0xdd69da){return function(_0x495cdc){try{jsonpatch[_0x28df('0x21')](_0x495cdc,_0xdd69da,!![]);}catch(_0x3a885b){return BPromise['reject'](_0x3a885b);}return _0x495cdc['save']();};}function saveUpdates(_0x51a864,_0x358a68){return function(_0x6a59ec){if(_0x6a59ec){return _0x6a59ec[_0x28df('0x22')](_0x51a864)[_0x28df('0x23')](function(_0xe0aed6){return _0xe0aed6;});}return null;};}function removeEntity(_0x2d0608,_0x5b28bd){return function(_0x531d5d){if(_0x531d5d){return _0x531d5d[_0x28df('0x24')]()[_0x28df('0x23')](function(){_0x2d0608['status'](0xcc)[_0x28df('0x1a')]();});}};}function handleEntityNotFound(_0xeceaf4,_0xd33b7e){return function(_0x11191f){if(!_0x11191f){_0xeceaf4[_0x28df('0x18')](0x194);}return _0x11191f;};}function handleError(_0x4e2a0c,_0x34d9bc){_0x34d9bc=_0x34d9bc||0x1f4;return function(_0x4f97b3){logger['error'](_0x4f97b3[_0x28df('0x25')]);if(_0x4f97b3[_0x28df('0x26')]){delete _0x4f97b3[_0x28df('0x26')];}_0x4e2a0c[_0x28df('0x19')](_0x34d9bc)[_0x28df('0x27')](_0x4f97b3);};}exports['index']=function(_0xbd9987,_0x450186){var _0x1882df={},_0x505973={},_0x21b4a3={'count':0x0,'rows':[]};var _0x1ec07e=_[_0x28df('0x28')](db[_0x28df('0x29')][_0x28df('0x2a')],function(_0xae9fc1){return{'name':_0xae9fc1[_0x28df('0x2b')],'type':_0xae9fc1['type']['key']};});_0x505973['model']=_[_0x28df('0x28')](_0x1ec07e,'name');_0x505973[_0x28df('0x2c')]=_[_0x28df('0x2d')](_0xbd9987[_0x28df('0x2c')]);_0x505973['filters']=_[_0x28df('0x2e')](_0x505973[_0x28df('0x2f')],_0x505973[_0x28df('0x2c')]);_0x1882df[_0x28df('0x30')]=_[_0x28df('0x2e')](_0x505973[_0x28df('0x2f')],qs[_0x28df('0x31')](_0xbd9987[_0x28df('0x2c')][_0x28df('0x31')]));_0x1882df[_0x28df('0x30')]=_0x1882df[_0x28df('0x30')][_0x28df('0x32')]?_0x1882df[_0x28df('0x30')]:_0x505973[_0x28df('0x2f')];if(!_0xbd9987[_0x28df('0x2c')][_0x28df('0x33')](_0x28df('0x34'))){_0x1882df[_0x28df('0x1d')]=qs[_0x28df('0x1d')](_0xbd9987[_0x28df('0x2c')][_0x28df('0x1d')]);_0x1882df['offset']=qs[_0x28df('0x1b')](_0xbd9987[_0x28df('0x2c')][_0x28df('0x1b')]);}_0x1882df[_0x28df('0x35')]=qs['sort'](_0xbd9987[_0x28df('0x2c')]['sort']);_0x1882df[_0x28df('0x36')]=qs[_0x28df('0x37')](_[_0x28df('0x38')](_0xbd9987[_0x28df('0x2c')],_0x505973[_0x28df('0x37')]),_0x1ec07e);if(_0xbd9987[_0x28df('0x2c')][_0x28df('0x39')]){_0x1882df['where']=_[_0x28df('0x3a')](_0x1882df[_0x28df('0x36')],{'$or':_[_0x28df('0x28')](_0x1ec07e,function(_0x4ebac8){if(_0x4ebac8['type']!==_0x28df('0x3b')){var _0x5f4f15={};_0x5f4f15[_0x4ebac8['name']]={'$like':'%'+_0xbd9987[_0x28df('0x2c')]['filter']+'%'};return _0x5f4f15;}})});}_0x1882df=_[_0x28df('0x3a')]({},_0x1882df,_0xbd9987[_0x28df('0x3c')]);var _0x9fb665={'where':_0x1882df[_0x28df('0x36')]};return db['ServicenowAccount'][_0x28df('0x1e')](_0x9fb665)[_0x28df('0x23')](function(_0x4457fe){_0x21b4a3[_0x28df('0x1e')]=_0x4457fe;if(_0xbd9987[_0x28df('0x2c')][_0x28df('0x3d')]){_0x1882df[_0x28df('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x1882df);})[_0x28df('0x23')](function(_0x6a2561){_0x21b4a3['rows']=_0x6a2561;return _0x21b4a3;})[_0x28df('0x23')](respondWithFilteredResult(_0x450186,_0x1882df))[_0x28df('0x3f')](handleError(_0x450186,null));};exports['show']=function(_0x1577ae,_0xad9e69){var _0x3f0914={'raw':![],'where':{'id':_0x1577ae['params']['id']}},_0x5e1a81={};_0x5e1a81['model']=_[_0x28df('0x2d')](db[_0x28df('0x29')][_0x28df('0x2a')]);_0x5e1a81[_0x28df('0x2c')]=_[_0x28df('0x2d')](_0x1577ae[_0x28df('0x2c')]);_0x5e1a81[_0x28df('0x37')]=_[_0x28df('0x2e')](_0x5e1a81[_0x28df('0x2f')],_0x5e1a81[_0x28df('0x2c')]);_0x3f0914['attributes']=_[_0x28df('0x2e')](_0x5e1a81[_0x28df('0x2f')],qs[_0x28df('0x31')](_0x1577ae['query'][_0x28df('0x31')]));_0x3f0914[_0x28df('0x30')]=_0x3f0914[_0x28df('0x30')][_0x28df('0x32')]?_0x3f0914[_0x28df('0x30')]:_0x5e1a81[_0x28df('0x2f')];if(_0x1577ae[_0x28df('0x2c')]['includeAll']){_0x3f0914[_0x28df('0x3e')]=[{'all':!![]}];}_0x3f0914=_['merge']({},_0x3f0914,_0x1577ae[_0x28df('0x3c')]);return db[_0x28df('0x29')][_0x28df('0x40')](_0x3f0914)[_0x28df('0x23')](handleEntityNotFound(_0xad9e69,null))['then'](respondWithResult(_0xad9e69,null))[_0x28df('0x3f')](handleError(_0xad9e69,null));};exports[_0x28df('0x41')]=function(_0x3acbf7,_0x5c8790){return db[_0x28df('0x29')][_0x28df('0x41')](_0x3acbf7[_0x28df('0x42')],{})[_0x28df('0x23')](respondWithResult(_0x5c8790,0xc9))['catch'](handleError(_0x5c8790,null));};exports[_0x28df('0x22')]=function(_0x204886,_0x562fec){if(_0x204886[_0x28df('0x42')]['id']){delete _0x204886[_0x28df('0x42')]['id'];}return db['ServicenowAccount'][_0x28df('0x40')]({'where':{'id':_0x204886[_0x28df('0x43')]['id']}})['then'](handleEntityNotFound(_0x562fec,null))[_0x28df('0x23')](saveUpdates(_0x204886[_0x28df('0x42')],null))[_0x28df('0x23')](respondWithResult(_0x562fec,null))[_0x28df('0x3f')](handleError(_0x562fec,null));};exports[_0x28df('0x24')]=function(_0x4eb514,_0x59a892){return db['ServicenowAccount'][_0x28df('0x40')]({'where':{'id':_0x4eb514[_0x28df('0x43')]['id']}})['then'](handleEntityNotFound(_0x59a892,null))[_0x28df('0x23')](removeEntity(_0x59a892,null))[_0x28df('0x3f')](handleError(_0x59a892,null));};exports['getConfigurations']=function(_0x1c8cd7,_0x1b6a60,_0x32d255){var _0x3f1342={};var _0x5e1503={};var _0x5486fa;var _0x548f76;return db[_0x28df('0x29')]['findOne']({'where':{'id':_0x1c8cd7[_0x28df('0x43')]['id']}})[_0x28df('0x23')](handleEntityNotFound(_0x1b6a60,null))['then'](function(_0x1c8732){if(_0x1c8732){_0x5486fa=_0x1c8732;_0x5e1503[_0x28df('0x2f')]=_['keys'](db[_0x28df('0x44')][_0x28df('0x2a')]);_0x5e1503[_0x28df('0x2c')]=_[_0x28df('0x2d')](_0x1c8cd7['query']);_0x5e1503['filters']=_[_0x28df('0x2e')](_0x5e1503[_0x28df('0x2f')],_0x5e1503[_0x28df('0x2c')]);_0x3f1342['attributes']=_['intersection'](_0x5e1503[_0x28df('0x2f')],qs[_0x28df('0x31')](_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x31')]));_0x3f1342['attributes']=_0x3f1342[_0x28df('0x30')]['length']?_0x3f1342['attributes']:_0x5e1503[_0x28df('0x2f')];_0x3f1342[_0x28df('0x35')]=qs[_0x28df('0x45')](_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x45')]);_0x3f1342[_0x28df('0x36')]=qs[_0x28df('0x37')](_['pick'](_0x1c8cd7['query'],_0x5e1503['filters']));if(_0x1c8cd7[_0x28df('0x2c')]['filter']){_0x3f1342[_0x28df('0x36')]=_['merge'](_0x3f1342[_0x28df('0x36')],{'$or':_[_0x28df('0x28')](_0x3f1342[_0x28df('0x30')],function(_0x5e93e7){var _0x1de318={};_0x1de318[_0x5e93e7]={'$like':'%'+_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x39')]+'%'};return _0x1de318;})});}_0x3f1342=_[_0x28df('0x3a')]({},_0x3f1342,_0x1c8cd7[_0x28df('0x3c')]);return _0x5486fa[_0x28df('0x46')](_0x3f1342);}})[_0x28df('0x23')](function(_0x57ba03){if(_0x57ba03){_0x548f76=_0x57ba03[_0x28df('0x32')];if(!_0x1c8cd7[_0x28df('0x2c')]['hasOwnProperty'](_0x28df('0x34'))){_0x3f1342[_0x28df('0x1d')]=qs[_0x28df('0x1d')](_0x1c8cd7['query'][_0x28df('0x1d')]);_0x3f1342[_0x28df('0x1b')]=qs[_0x28df('0x1b')](_0x1c8cd7[_0x28df('0x2c')][_0x28df('0x1b')]);}return _0x5486fa[_0x28df('0x46')](_0x3f1342);}})[_0x28df('0x23')](function(_0x198b4d){if(_0x198b4d){return _0x198b4d?{'count':_0x548f76,'rows':_0x198b4d}:null;}})[_0x28df('0x23')](respondWithResult(_0x1b6a60,null))[_0x28df('0x3f')](handleError(_0x1b6a60,null));};exports['addConfiguration']=function(_0x3def4d,_0x1da1e8,_0x17efa5){if(_0x3def4d['body']['id']){delete _0x3def4d[_0x28df('0x42')]['id'];}return db[_0x28df('0x29')][_0x28df('0x47')]({'where':{'id':_0x3def4d['params']['id']}})[_0x28df('0x23')](handleEntityNotFound(_0x1da1e8,null))['then'](function(_0x15b5d9){if(_0x15b5d9){_0x3def4d[_0x28df('0x42')][_0x28df('0x48')]=_0x15b5d9['id'];_0x3def4d[_0x28df('0x42')][_0x28df('0x49')]=integrations['getSubjects'](_0x3def4d[_0x28df('0x42')][_0x28df('0x4a')],_0x3def4d['body'][_0x28df('0x4b')]);_0x3def4d['body'][_0x28df('0x4c')]=integrations[_0x28df('0x4d')](_0x3def4d['body']['channel'],_0x3def4d[_0x28df('0x42')]['type']);return db[_0x28df('0x44')][_0x28df('0x41')](_0x3def4d[_0x28df('0x42')],{'include':[{'model':db[_0x28df('0x4e')],'as':'Subjects'},{'model':db[_0x28df('0x4e')],'as':'Descriptions'}]});}return null;})[_0x28df('0x23')](respondWithResult(_0x1da1e8,null))['catch'](handleError(_0x1da1e8,null));};exports[_0x28df('0x4f')]=function(_0x3ab2ca,_0x15437f,_0x2989ff){var _0x542df9=['made_sla','hold_reason',_0x28df('0x50'),'subcategory',_0x28df('0x51'),_0x28df('0x52'),_0x28df('0x53'),'severity',_0x28df('0x54')];var _0x4908c0=['parent',_0x28df('0x55'),_0x28df('0x56'),_0x28df('0x57'),_0x28df('0x58'),_0x28df('0x59'),'child_incidents',_0x28df('0x5a'),_0x28df('0x5b'),'number',_0x28df('0x5c'),'sys_updated_by',_0x28df('0x5d'),'user_input','sys_created_on','sys_domain',_0x28df('0x5e'),'sys_created_by',_0x28df('0x50'),_0x28df('0x35'),'calendar_stc',_0x28df('0x5f'),_0x28df('0x60'),_0x28df('0x61'),'impact',_0x28df('0x62'),_0x28df('0x63'),_0x28df('0x64'),_0x28df('0x65'),_0x28df('0x66'),'rfc',_0x28df('0x67'),_0x28df('0x68'),'opened_at',_0x28df('0x69'),_0x28df('0x6a'),_0x28df('0x6b'),'reopened_time','resolved_at',_0x28df('0x6c'),_0x28df('0x6d'),'subcategory',_0x28df('0x6e'),'short_description','close_code',_0x28df('0x6f'),_0x28df('0x70'),_0x28df('0x71'),_0x28df('0x72'),_0x28df('0x73'),_0x28df('0x74'),_0x28df('0x75'),_0x28df('0x76'),_0x28df('0x52'),_0x28df('0x77'),_0x28df('0x78'),_0x28df('0x79'),_0x28df('0x7a'),'parent_incident',_0x28df('0x7b'),_0x28df('0x7c'),'reopened_by',_0x28df('0x53'),_0x28df('0x7d'),'problem_id',_0x28df('0x7e'),_0x28df('0x7f'),_0x28df('0x80'),_0x28df('0x81'),_0x28df('0x82'),_0x28df('0x83'),_0x28df('0x84'),_0x28df('0x85'),'comments_and_work_notes','due_date',_0x28df('0x86'),'reopen_count',_0x28df('0x87'),_0x28df('0x88'),'upon_approval',_0x28df('0x89'),_0x28df('0x8a'),_0x28df('0x54')];var _0x3d697a='';var _0x10b124='';var _0x29899c=[];var _0x188f64='';var _0x4ca639='';var _0x295bb4=[];var _0x2a711e='';var _0x2738ed='';var _0x167901={};var _0x46671c='';return db[_0x28df('0x29')][_0x28df('0x47')]({'where':{'id':_0x3ab2ca['params']['id']},'attributes':['id',_0x28df('0x8b'),'password',_0x28df('0x8c'),'remoteUri',_0x28df('0x8d')]})[_0x28df('0x23')](handleEntityNotFound(_0x15437f,null))[_0x28df('0x23')](function(_0x247485){if(_0x247485){_0x46671c=_0x247485[_0x28df('0x8e')];var _0x5624ec=_0x46671c[_0x28df('0x8f')](-0x1);if(_0x5624ec==='/'){_0x46671c=_0x46671c[_0x28df('0x90')](0x0,_0x46671c[_0x28df('0x91')](_0x5624ec));}_0x2738ed=util[_0x28df('0x92')](_0x28df('0x93'),_0x46671c);_0x2a711e=util[_0x28df('0x92')](_0x28df('0x94'),_0x46671c);_0x167901={'user':_0x247485[_0x28df('0x8b')],'pass':_0x247485[_0x28df('0x95')]};var _0xa3f379={'method':_0x28df('0x96'),'uri':_0x2738ed+_0x28df('0x97'),'auth':_0x167901,'json':!![]};return rp(_0xa3f379);}})[_0x28df('0x23')](function(_0x5085f2){if(_0x5085f2[_0x28df('0x98')]['length']>0x0){_0x3d697a=_0x5085f2[_0x28df('0x98')];}console['log'](_0x28df('0x99'),_0x3d697a);_0x295bb4=[];_0x10b124=Object[_0x28df('0x9a')]([],_0x3d697a);_[_0x28df('0x9b')](_0x10b124,function(_0x511388){return!_0x542df9['includes'](_0x511388[_0x28df('0x26')]);});_0x10b124[_0x28df('0x9c')](function(_0x104639){var _0x38877b=createFieldObject(_0x2a711e,_0x167901,_0x104639[_0x28df('0x9d')],_0x104639[_0x28df('0x26')],_0x104639[_0x28df('0x9e')],![]);_0x295bb4[_0x28df('0x9f')](_0x38877b);});return Promise[_0x28df('0xa0')](_0x295bb4);})[_0x28df('0x23')](function(_0x1da8a8){_0x29899c=_0x1da8a8;_0x188f64=Object['assign']([],_0x3d697a);console[_0x28df('0xa1')](_0x28df('0xa2'),_0x3d697a);_[_0x28df('0x9b')](_0x188f64,function(_0x201c12){return _0x4908c0[_0x28df('0xa3')](_0x201c12['name']);});console[_0x28df('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x188f64);_0x295bb4=[];_0x188f64['forEach'](function(_0x40de3a){var _0x4dd7a4=createFieldObject(_0x2a711e,_0x167901,_0x40de3a['internalType'],_0x40de3a['name'],_0x40de3a[_0x28df('0x9e')],!![]);_0x295bb4[_0x28df('0x9f')](_0x4dd7a4);});return Promise[_0x28df('0xa0')](_0x295bb4);})[_0x28df('0x23')](function(_0x2776d1){_0x4ca639=_0x2776d1;var _0x41871f=_0x29899c['concat'](_0x4ca639);return{'count':_0x41871f[_0x28df('0x32')],'rows':_0x41871f};})['then'](respondWithResult(_0x15437f,null))[_0x28df('0x3f')](function(_0x33c83f){console['log']('ServiceNow\x20error:\x20'+_0x33c83f);var _0x4dfb79=_0x3ab2ca['query'][_0x28df('0xa4')]?0x1f4:_0x33c83f['statusCode']||0x1f4;logger[_0x28df('0xa5')](_0x33c83f['stack']);delete _0x33c83f[_0x28df('0x26')];if(_0x4dfb79===0x191){_0x4dfb79=0x190;}_0x15437f[_0x28df('0x19')](_0x4dfb79)['send'](_0x3ab2ca[_0x28df('0x2c')][_0x28df('0xa4')]?{'message':_0x28df('0xa6'),'statusCode':_0x33c83f[_0x28df('0xa7')]}:_0x33c83f);});};function createFieldObject(_0x217107,_0x316c60,_0xd29f6d,_0x14d20c,_0x2c5479,_0x4a48f9){return new Promise(function(_0x1a71aa,_0x509617){var _0x4e92fe={'id':_0x14d20c,'name':_0x2c5479,'custom':_0x4a48f9};if(_0xd29f6d===_0x28df('0xa8')){_0x4e92fe[_0x28df('0x3c')]=[{'name':_0x28df('0xa9'),'value':_0x28df('0xaa')},{'name':_0x28df('0xab'),'value':_0x28df('0xac')}];_0x1a71aa(_0x4e92fe);}else{var _0x2da384={'method':_0x28df('0x96'),'uri':_0x217107+'sys_choice?sysparm_query=name=incident^element='+_0x14d20c,'auth':_0x316c60,'json':!![]};return rp(_0x2da384)[_0x28df('0x23')](function(_0x5d0695){var _0x33ff2e=[];if(_0x5d0695[_0x28df('0x98')][_0x28df('0x32')]>0x0){_0x5d0695['result'][_0x28df('0x9c')](function(_0x9b904f){if(_0x9b904f[_0x28df('0xad')]===_0x28df('0xac')){var _0x5d0b37={'name':_0x9b904f[_0x28df('0x9e')],'value':_0x9b904f['value']};_0x33ff2e[_0x28df('0x9f')](_0x5d0b37);}});}_0x4e92fe['options']=_0x33ff2e;if(_0x4e92fe[_0x28df('0x3c')][_0x28df('0x32')]>0x0){_0x1a71aa(_0x4e92fe);}else{if(_0x4a48f9==![]){_0x1a71aa();}else{_0x1a71aa(_0x4e92fe);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d7e876b..b7b6e0c 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 _0xabce=['path','rimraf','../../config/environment','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xabce,0x103));var _0xeabc=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xabce[_0x1eda20];return _0x31b953;};'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 +var _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4a1f6d,_0xc93606){var _0x4568a1=function(_0x1f33b7){while(--_0x1f33b7){_0x4a1f6d['push'](_0x4a1f6d['shift']());}};_0x4568a1(++_0xc93606);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xb048b8,_0x3d82ab){_0xb048b8=_0xb048b8-0x0;var _0x5c0ece=_0x9c5a[_0xb048b8];return _0x5c0ece;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index cc8e15e..103d9a6 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 _0x974b=['../../config/utils','rpc','../../config/environment','http','request','then','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','limit','include','model','map','debug','catch','ShowServicenowAccount','find','where','lodash','util','bluebird'];(function(_0x2ed1ad,_0x1fb8a1){var _0x1deb5e=function(_0x4a5d76){while(--_0x4a5d76){_0x2ed1ad['push'](_0x2ed1ad['shift']());}};_0x1deb5e(++_0x1fb8a1);}(_0x974b,0x1cb));var _0xb974=function(_0x2543be,_0x19ebd6){_0x2543be=_0x2543be-0x0;var _0x4636d0=_0x974b[_0x2543be];return _0x4636d0;};'use strict';var _=require(_0xb974('0x0'));var util=require(_0xb974('0x1'));var moment=require('moment');var BPromise=require(_0xb974('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb974('0x3'));var logger=require('../../config/logger')(_0xb974('0x4'));var config=require(_0xb974('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb974('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xf1e171,_0x1e9ec4,_0x2b3663){return new BPromise(function(_0x103a35,_0x347152){return client[_0xb974('0x7')](_0xf1e171,_0x2b3663)[_0xb974('0x8')](function(_0x51045b){logger['info'](_0xb974('0x9'),_0x1e9ec4,'request\x20sent');logger['debug'](_0xb974('0xa'),_0x1e9ec4,_0xb974('0xb'),JSON[_0xb974('0xc')](_0x51045b));if(_0x51045b[_0xb974('0xd')]){if(_0x51045b['error'][_0xb974('0xe')]===0x1f4){logger[_0xb974('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1e9ec4,_0x51045b[_0xb974('0xd')]['message']);return _0x347152(_0x51045b[_0xb974('0xd')][_0xb974('0xf')]);}logger[_0xb974('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1e9ec4,_0x51045b['error']['message']);return _0x103a35(_0x51045b[_0xb974('0xd')][_0xb974('0xf')]);}else{logger[_0xb974('0x10')](_0xb974('0x9'),_0x1e9ec4,'request\x20sent');_0x103a35(_0x51045b[_0xb974('0x11')][_0xb974('0xf')]);}})['catch'](function(_0x22111c){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1e9ec4,_0x22111c);_0x347152(_0x22111c);});});}exports[_0xb974('0x12')]=function(_0x37692a){var _0x39a443=this;return new Promise(function(_0x38ce9d,_0x196618){return db[_0xb974('0x13')][_0xb974('0x14')]({'raw':_0x37692a[_0xb974('0x15')]?_0x37692a['options'][_0xb974('0x16')]===undefined?!![]:![]:!![],'where':_0x37692a[_0xb974('0x15')]?_0x37692a['options']['where']||null:null,'attributes':_0x37692a['options']?_0x37692a[_0xb974('0x15')][_0xb974('0x17')]||null:null,'limit':_0x37692a[_0xb974('0x15')]?_0x37692a['options'][_0xb974('0x18')]||null:null,'include':_0x37692a[_0xb974('0x15')]?_0x37692a['options'][_0xb974('0x19')]?_['map'](_0x37692a[_0xb974('0x15')][_0xb974('0x19')],function(_0x53d7f2){return{'model':db[_0x53d7f2[_0xb974('0x1a')]],'as':_0x53d7f2['as'],'attributes':_0x53d7f2[_0xb974('0x17')],'include':_0x53d7f2[_0xb974('0x19')]?_[_0xb974('0x1b')](_0x53d7f2['include'],function(_0x3aff2c){return{'model':db[_0x3aff2c[_0xb974('0x1a')]],'as':_0x3aff2c['as'],'attributes':_0x3aff2c[_0xb974('0x17')],'include':_0x3aff2c[_0xb974('0x19')]?_[_0xb974('0x1b')](_0x3aff2c['include'],function(_0x28fd00){return{'model':db[_0x28fd00[_0xb974('0x1a')]],'as':_0x28fd00['as'],'attributes':_0x28fd00[_0xb974('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb974('0x8')](function(_0x45231b){logger[_0xb974('0x10')](_0xb974('0x12'),_0x37692a);logger[_0xb974('0x1c')](_0xb974('0x12'),_0x37692a,JSON[_0xb974('0xc')](_0x45231b));_0x38ce9d(_0x45231b);})[_0xb974('0x1d')](function(_0x55225f){logger['error'](_0xb974('0x12'),_0x55225f[_0xb974('0xf')],_0x37692a);_0x196618(_0x39a443[_0xb974('0xd')](0x1f4,_0x55225f['message']));});});};exports[_0xb974('0x1e')]=function(_0x254568){var _0x37fce9=this;return new Promise(function(_0x558c74,_0x4e5fa0){return db[_0xb974('0x13')][_0xb974('0x1f')]({'raw':_0x254568[_0xb974('0x15')]?_0x254568[_0xb974('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x254568[_0xb974('0x15')]?_0x254568['options'][_0xb974('0x20')]||null:null,'attributes':_0x254568[_0xb974('0x15')]?_0x254568[_0xb974('0x15')][_0xb974('0x17')]||null:null,'include':_0x254568[_0xb974('0x15')]?_0x254568[_0xb974('0x15')][_0xb974('0x19')]?_['map'](_0x254568['options'][_0xb974('0x19')],function(_0x5a2f55){return{'model':db[_0x5a2f55['model']],'as':_0x5a2f55['as'],'attributes':_0x5a2f55[_0xb974('0x17')],'include':_0x5a2f55[_0xb974('0x19')]?_['map'](_0x5a2f55[_0xb974('0x19')],function(_0x5d365c){return{'model':db[_0x5d365c[_0xb974('0x1a')]],'as':_0x5d365c['as'],'attributes':_0x5d365c['attributes'],'include':_0x5d365c[_0xb974('0x19')]?_[_0xb974('0x1b')](_0x5d365c[_0xb974('0x19')],function(_0x1dd1b2){return{'model':db[_0x1dd1b2['model']],'as':_0x1dd1b2['as'],'attributes':_0x1dd1b2[_0xb974('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb974('0x8')](function(_0x544d97){logger[_0xb974('0x10')](_0xb974('0x1e'),_0x254568);logger[_0xb974('0x1c')](_0xb974('0x1e'),_0x254568,JSON[_0xb974('0xc')](_0x544d97));_0x558c74(_0x544d97);})['catch'](function(_0xa57259){logger['error'](_0xb974('0x1e'),_0xa57259['message'],_0x254568);_0x4e5fa0(_0x37fce9[_0xb974('0xd')](0x1f4,_0xa57259[_0xb974('0xf')]));});});}; \ No newline at end of file +var _0xeaef=['raw','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ServicenowAccount','options','attributes','include','model','map','GetServicenowAccount','ShowServicenowAccount','find'];(function(_0x334dd4,_0x3507da){var _0x231358=function(_0x4e9d69){while(--_0x4e9d69){_0x334dd4['push'](_0x334dd4['shift']());}};_0x231358(++_0x3507da);}(_0xeaef,0x1c2));var _0xfeae=function(_0x3e9e46,_0x4c5e3a){_0x3e9e46=_0x3e9e46-0x0;var _0x8c9837=_0xeaef[_0x3e9e46];return _0x8c9837;};'use strict';var _=require(_0xfeae('0x0'));var util=require(_0xfeae('0x1'));var moment=require('moment');var BPromise=require(_0xfeae('0x2'));var rs=require(_0xfeae('0x3'));var fs=require('fs');var Redis=require(_0xfeae('0x4'));var db=require(_0xfeae('0x5'))['db'];var utils=require(_0xfeae('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xfeae('0x7'));var client=jayson['client'][_0xfeae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x194d97,_0x3bb2d0,_0x3f5ebe){return new BPromise(function(_0x1665c5,_0x464e0b){return client[_0xfeae('0x9')](_0x194d97,_0x3f5ebe)[_0xfeae('0xa')](function(_0x35de28){logger[_0xfeae('0xb')](_0xfeae('0xc'),_0x3bb2d0,'request\x20sent');logger[_0xfeae('0xd')](_0xfeae('0xe'),_0x3bb2d0,_0xfeae('0xf'),JSON[_0xfeae('0x10')](_0x35de28));if(_0x35de28[_0xfeae('0x11')]){if(_0x35de28['error']['code']===0x1f4){logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x3bb2d0,_0x35de28['error'][_0xfeae('0x12')]);return _0x464e0b(_0x35de28[_0xfeae('0x11')][_0xfeae('0x12')]);}logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x3bb2d0,_0x35de28[_0xfeae('0x11')][_0xfeae('0x12')]);return _0x1665c5(_0x35de28['error'][_0xfeae('0x12')]);}else{logger[_0xfeae('0xb')](_0xfeae('0xc'),_0x3bb2d0,_0xfeae('0xf'));_0x1665c5(_0x35de28[_0xfeae('0x13')]['message']);}})[_0xfeae('0x14')](function(_0x393da4){logger[_0xfeae('0x11')](_0xfeae('0xc'),_0x3bb2d0,_0x393da4);_0x464e0b(_0x393da4);});});}exports['GetServicenowAccount']=function(_0x269c7f){var _0x356bd1=this;return new Promise(function(_0x20401b,_0x4717db){return db[_0xfeae('0x15')]['findAll']({'raw':_0x269c7f[_0xfeae('0x16')]?_0x269c7f[_0xfeae('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x269c7f[_0xfeae('0x16')]?_0x269c7f['options']['where']||null:null,'attributes':_0x269c7f[_0xfeae('0x16')]?_0x269c7f['options'][_0xfeae('0x17')]||null:null,'limit':_0x269c7f[_0xfeae('0x16')]?_0x269c7f[_0xfeae('0x16')]['limit']||null:null,'include':_0x269c7f[_0xfeae('0x16')]?_0x269c7f['options']['include']?_['map'](_0x269c7f['options'][_0xfeae('0x18')],function(_0x438e91){return{'model':db[_0x438e91[_0xfeae('0x19')]],'as':_0x438e91['as'],'attributes':_0x438e91[_0xfeae('0x17')],'include':_0x438e91[_0xfeae('0x18')]?_[_0xfeae('0x1a')](_0x438e91['include'],function(_0x560276){return{'model':db[_0x560276[_0xfeae('0x19')]],'as':_0x560276['as'],'attributes':_0x560276[_0xfeae('0x17')],'include':_0x560276['include']?_[_0xfeae('0x1a')](_0x560276[_0xfeae('0x18')],function(_0x3d8f71){return{'model':db[_0x3d8f71[_0xfeae('0x19')]],'as':_0x3d8f71['as'],'attributes':_0x3d8f71[_0xfeae('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfeae('0xa')](function(_0x472754){logger['info'](_0xfeae('0x1b'),_0x269c7f);logger[_0xfeae('0xd')](_0xfeae('0x1b'),_0x269c7f,JSON[_0xfeae('0x10')](_0x472754));_0x20401b(_0x472754);})[_0xfeae('0x14')](function(_0x3ce80a){logger[_0xfeae('0x11')](_0xfeae('0x1b'),_0x3ce80a['message'],_0x269c7f);_0x4717db(_0x356bd1[_0xfeae('0x11')](0x1f4,_0x3ce80a[_0xfeae('0x12')]));});});};exports[_0xfeae('0x1c')]=function(_0x143000){var _0x94302a=this;return new Promise(function(_0x43cc7d,_0x4074f1){return db[_0xfeae('0x15')][_0xfeae('0x1d')]({'raw':_0x143000[_0xfeae('0x16')]?_0x143000[_0xfeae('0x16')][_0xfeae('0x1e')]===undefined?!![]:![]:!![],'where':_0x143000[_0xfeae('0x16')]?_0x143000[_0xfeae('0x16')][_0xfeae('0x1f')]||null:null,'attributes':_0x143000['options']?_0x143000[_0xfeae('0x16')][_0xfeae('0x17')]||null:null,'include':_0x143000[_0xfeae('0x16')]?_0x143000[_0xfeae('0x16')][_0xfeae('0x18')]?_[_0xfeae('0x1a')](_0x143000[_0xfeae('0x16')][_0xfeae('0x18')],function(_0x4da7dd){return{'model':db[_0x4da7dd[_0xfeae('0x19')]],'as':_0x4da7dd['as'],'attributes':_0x4da7dd['attributes'],'include':_0x4da7dd[_0xfeae('0x18')]?_['map'](_0x4da7dd[_0xfeae('0x18')],function(_0x71cfd2){return{'model':db[_0x71cfd2[_0xfeae('0x19')]],'as':_0x71cfd2['as'],'attributes':_0x71cfd2[_0xfeae('0x17')],'include':_0x71cfd2[_0xfeae('0x18')]?_[_0xfeae('0x1a')](_0x71cfd2[_0xfeae('0x18')],function(_0x4ae33a){return{'model':db[_0x4ae33a[_0xfeae('0x19')]],'as':_0x4ae33a['as'],'attributes':_0x4ae33a[_0xfeae('0x17')]};}):[]};}):[]};}):[]:[]})[_0xfeae('0xa')](function(_0x4f4fcd){logger[_0xfeae('0xb')]('ShowServicenowAccount',_0x143000);logger[_0xfeae('0xd')](_0xfeae('0x1c'),_0x143000,JSON[_0xfeae('0x10')](_0x4f4fcd));_0x43cc7d(_0x4f4fcd);})[_0xfeae('0x14')](function(_0x502a17){logger[_0xfeae('0x11')](_0xfeae('0x1c'),_0x502a17[_0xfeae('0x12')],_0x143000);_0x4074f1(_0x94302a['error'](0x1f4,_0x502a17[_0xfeae('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 63ba4e0..265747b 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 _0xde91=['../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','exports','util','path','express','Router'];(function(_0x33fadc,_0x590a1a){var _0x8ce20=function(_0x1ac5e7){while(--_0x1ac5e7){_0x33fadc['push'](_0x33fadc['shift']());}};_0x8ce20(++_0x590a1a);}(_0xde91,0x100));var _0x1de9=function(_0x1044e5,_0x498e01){_0x1044e5=_0x1044e5-0x0;var _0x5ad0dd=_0xde91[_0x1044e5];return _0x5ad0dd;};'use strict';var multer=require('multer');var util=require(_0x1de9('0x0'));var path=require(_0x1de9('0x1'));var timeout=require('connect-timeout');var express=require(_0x1de9('0x2'));var router=express[_0x1de9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1de9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1de9('0x5'));var controller=require(_0x1de9('0x6'));router[_0x1de9('0x7')]('/',auth[_0x1de9('0x8')](),controller[_0x1de9('0x9')]);router[_0x1de9('0x7')](_0x1de9('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1de9('0x7')](_0x1de9('0xb'),auth['isAuthenticated'](),controller[_0x1de9('0xc')]);router['get'](_0x1de9('0xd'),auth[_0x1de9('0x8')](),controller[_0x1de9('0xe')]);router[_0x1de9('0x7')](_0x1de9('0xf'),auth['isAuthenticated'](),controller[_0x1de9('0x10')]);router[_0x1de9('0x11')]('/',auth[_0x1de9('0x8')](),controller['create']);router[_0x1de9('0x12')](_0x1de9('0xa'),auth[_0x1de9('0x8')](),controller['update']);router['delete'](_0x1de9('0xa'),auth[_0x1de9('0x8')](),controller['destroy']);module[_0x1de9('0x13')]=router; \ No newline at end of file +var _0x20e3=['getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x37de5d,_0x403dfc){var _0x1937da=function(_0x4bb723){while(--_0x4bb723){_0x37de5d['push'](_0x37de5d['shift']());}};_0x1937da(++_0x403dfc);}(_0x20e3,0x199));var _0x320e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x20e3[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x320e('0x0'));var util=require(_0x320e('0x1'));var path=require(_0x320e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x320e('0x3')]();var fs_extra=require(_0x320e('0x4'));var auth=require(_0x320e('0x5'));var interaction=require(_0x320e('0x6'));var config=require(_0x320e('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0x320e('0x8')]('/',auth['isAuthenticated'](),controller[_0x320e('0x9')]);router['get'](_0x320e('0xa'),auth[_0x320e('0xb')](),controller[_0x320e('0xc')]);router[_0x320e('0x8')](_0x320e('0xd'),auth[_0x320e('0xb')](),controller[_0x320e('0xe')]);router[_0x320e('0x8')](_0x320e('0xf'),auth[_0x320e('0xb')](),controller[_0x320e('0x10')]);router['get'](_0x320e('0x11'),auth[_0x320e('0xb')](),controller[_0x320e('0x12')]);router[_0x320e('0x13')]('/',auth[_0x320e('0xb')](),controller['create']);router[_0x320e('0x14')](_0x320e('0xa'),auth[_0x320e('0xb')](),controller[_0x320e('0x15')]);router[_0x320e('0x16')](_0x320e('0xa'),auth[_0x320e('0xb')](),controller[_0x320e('0x17')]);module[_0x320e('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 42ad82a..805de9f 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 _0x2eb1=['STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2eb1,0x1c7));var _0x12eb=function(_0x47fb0b,_0x5300d7){_0x47fb0b=_0x47fb0b-0x0;var _0x4eb00a=_0x2eb1[_0x47fb0b];return _0x4eb00a;};'use strict';var Sequelize=require('sequelize');module[_0x12eb('0x0')]={'name':{'type':Sequelize[_0x12eb('0x1')]},'description':{'type':Sequelize[_0x12eb('0x1')]}}; \ No newline at end of file +var _0x113e=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x113e,0xba));var _0xe113=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x113e[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require('sequelize');module[_0xe113('0x0')]={'name':{'type':Sequelize[_0xe113('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 8be48e5..d22ec7b 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 _0x292a=['limit','status','set','Content-Range','reject','save','destroy','then','error','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','create','body','find','getFields','findOne','ServicenowField','order','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined'];(function(_0x5bf538,_0x5eb7eb){var _0x4b3b86=function(_0x4ee451){while(--_0x4ee451){_0x5bf538['push'](_0x5bf538['shift']());}};_0x4b3b86(++_0x5eb7eb);}(_0x292a,0x84));var _0xa292=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x292a[_0x51a6d6];return _0x5ef1a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa292('0x0'));var zipdir=require(_0xa292('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa292('0x2'));var moment=require('moment');var BPromise=require(_0xa292('0x3'));var Mustache=require(_0xa292('0x4'));var util=require(_0xa292('0x5'));var path=require(_0xa292('0x6'));var sox=require(_0xa292('0x7'));var csv=require(_0xa292('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa292('0x9'));var _=require(_0xa292('0xa'));var squel=require(_0xa292('0xb'));var crypto=require(_0xa292('0xc'));var jsforce=require(_0xa292('0xd'));var deskjs=require(_0xa292('0xe'));var toCsv=require(_0xa292('0x8'));var querystring=require(_0xa292('0xf'));var Papa=require('papaparse');var Redis=require(_0xa292('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa292('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa292('0x12'));var logger=require(_0xa292('0x13'))(_0xa292('0x14'));var utils=require(_0xa292('0x15'));var config=require(_0xa292('0x16'));var licenseUtil=require(_0xa292('0x17'));var db=require(_0xa292('0x18'))['db'];function respondWithStatusCode(_0x211764,_0x722ad0){_0x722ad0=_0x722ad0||0xcc;return function(_0xfd8e94){if(_0xfd8e94){return _0x211764[_0xa292('0x19')](_0x722ad0);}return _0x211764['status'](_0x722ad0)[_0xa292('0x1a')]();};}function respondWithResult(_0x359882,_0x5ae01c){_0x5ae01c=_0x5ae01c||0xc8;return function(_0x2cc204){if(_0x2cc204){return _0x359882['status'](_0x5ae01c)[_0xa292('0x1b')](_0x2cc204);}};}function respondWithFilteredResult(_0x1b543e,_0x528575){return function(_0x2ac0a9){if(_0x2ac0a9){var _0x161260=typeof _0x528575[_0xa292('0x1c')]==='undefined'&&typeof _0x528575['limit']===_0xa292('0x1d');var _0x39bba0=_0x2ac0a9['count'];var _0x58de0d=_0x161260?0x0:_0x528575[_0xa292('0x1c')];var _0x35d8a5=_0x161260?_0x2ac0a9['count']:_0x528575[_0xa292('0x1c')]+_0x528575[_0xa292('0x1e')];var _0x1d2fd7;if(_0x35d8a5>=_0x39bba0){_0x35d8a5=_0x39bba0;_0x1d2fd7=0xc8;}else{_0x1d2fd7=0xce;}_0x1b543e[_0xa292('0x1f')](_0x1d2fd7);return _0x1b543e[_0xa292('0x20')](_0xa292('0x21'),_0x58de0d+'-'+_0x35d8a5+'/'+_0x39bba0)[_0xa292('0x1b')](_0x2ac0a9);}return null;};}function patchUpdates(_0x3623af){return function(_0x42ccdd){try{jsonpatch['apply'](_0x42ccdd,_0x3623af,!![]);}catch(_0x263b4b){return BPromise[_0xa292('0x22')](_0x263b4b);}return _0x42ccdd[_0xa292('0x23')]();};}function saveUpdates(_0x12ad6a,_0x284689){return function(_0x4fcd6c){if(_0x4fcd6c){return _0x4fcd6c['update'](_0x12ad6a)['then'](function(_0x1b68e7){return _0x1b68e7;});}return null;};}function removeEntity(_0x5eb791,_0x2bb402){return function(_0x1eaee4){if(_0x1eaee4){return _0x1eaee4[_0xa292('0x24')]()[_0xa292('0x25')](function(){_0x5eb791[_0xa292('0x1f')](0xcc)[_0xa292('0x1a')]();});}};}function handleEntityNotFound(_0x4e7009,_0x2ebda8){return function(_0xd4fd83){if(!_0xd4fd83){_0x4e7009['sendStatus'](0x194);}return _0xd4fd83;};}function handleError(_0x5cbb22,_0x225a45){_0x225a45=_0x225a45||0x1f4;return function(_0x5e9f6d){logger[_0xa292('0x26')](_0x5e9f6d['stack']);if(_0x5e9f6d[_0xa292('0x27')]){delete _0x5e9f6d[_0xa292('0x27')];}_0x5cbb22[_0xa292('0x1f')](_0x225a45)[_0xa292('0x28')](_0x5e9f6d);};}exports[_0xa292('0x29')]=function(_0x17664c,_0x5826d3){var _0x34ac6c={},_0x240b5a={},_0x1d8435={'count':0x0,'rows':[]};var _0xd6f9e6=_['map'](db[_0xa292('0x2a')][_0xa292('0x2b')],function(_0x254105){return{'name':_0x254105[_0xa292('0x2c')],'type':_0x254105[_0xa292('0x2d')][_0xa292('0x2e')]};});_0x240b5a[_0xa292('0x2f')]=_[_0xa292('0x30')](_0xd6f9e6,'name');_0x240b5a['query']=_[_0xa292('0x31')](_0x17664c[_0xa292('0x32')]);_0x240b5a[_0xa292('0x33')]=_[_0xa292('0x34')](_0x240b5a[_0xa292('0x2f')],_0x240b5a['query']);_0x34ac6c['attributes']=_[_0xa292('0x34')](_0x240b5a[_0xa292('0x2f')],qs[_0xa292('0x35')](_0x17664c[_0xa292('0x32')][_0xa292('0x35')]));_0x34ac6c[_0xa292('0x36')]=_0x34ac6c['attributes'][_0xa292('0x37')]?_0x34ac6c[_0xa292('0x36')]:_0x240b5a[_0xa292('0x2f')];if(!_0x17664c['query'][_0xa292('0x38')](_0xa292('0x39'))){_0x34ac6c[_0xa292('0x1e')]=qs['limit'](_0x17664c[_0xa292('0x32')]['limit']);_0x34ac6c['offset']=qs[_0xa292('0x1c')](_0x17664c[_0xa292('0x32')][_0xa292('0x1c')]);}_0x34ac6c['order']=qs[_0xa292('0x3a')](_0x17664c[_0xa292('0x32')]['sort']);_0x34ac6c[_0xa292('0x3b')]=qs[_0xa292('0x33')](_[_0xa292('0x3c')](_0x17664c[_0xa292('0x32')],_0x240b5a[_0xa292('0x33')]),_0xd6f9e6);if(_0x17664c[_0xa292('0x32')][_0xa292('0x3d')]){_0x34ac6c[_0xa292('0x3b')]=_[_0xa292('0x3e')](_0x34ac6c['where'],{'$or':_['map'](_0xd6f9e6,function(_0x23bdfc){if(_0x23bdfc['type']!==_0xa292('0x3f')){var _0x3519f6={};_0x3519f6[_0x23bdfc[_0xa292('0x27')]]={'$like':'%'+_0x17664c[_0xa292('0x32')]['filter']+'%'};return _0x3519f6;}})});}_0x34ac6c=_['merge']({},_0x34ac6c,_0x17664c[_0xa292('0x40')]);var _0x4f7b91={'where':_0x34ac6c[_0xa292('0x3b')]};return db[_0xa292('0x2a')][_0xa292('0x41')](_0x4f7b91)[_0xa292('0x25')](function(_0x3d2367){_0x1d8435[_0xa292('0x41')]=_0x3d2367;if(_0x17664c[_0xa292('0x32')][_0xa292('0x42')]){_0x34ac6c[_0xa292('0x43')]=[{'all':!![]}];}return db[_0xa292('0x2a')]['findAll'](_0x34ac6c);})['then'](function(_0xe90ef8){_0x1d8435[_0xa292('0x44')]=_0xe90ef8;return _0x1d8435;})[_0xa292('0x25')](respondWithFilteredResult(_0x5826d3,_0x34ac6c))[_0xa292('0x45')](handleError(_0x5826d3,null));};exports[_0xa292('0x46')]=function(_0x2c7492,_0x38eb4c){var _0x727402={'raw':![],'where':{'id':_0x2c7492[_0xa292('0x47')]['id']}},_0x97fd4c={};_0x97fd4c[_0xa292('0x2f')]=_[_0xa292('0x31')](db['ServicenowConfiguration']['rawAttributes']);_0x97fd4c[_0xa292('0x32')]=_[_0xa292('0x31')](_0x2c7492[_0xa292('0x32')]);_0x97fd4c[_0xa292('0x33')]=_[_0xa292('0x34')](_0x97fd4c[_0xa292('0x2f')],_0x97fd4c[_0xa292('0x32')]);_0x727402[_0xa292('0x36')]=_[_0xa292('0x34')](_0x97fd4c['model'],qs[_0xa292('0x35')](_0x2c7492['query'][_0xa292('0x35')]));_0x727402['attributes']=_0x727402[_0xa292('0x36')]['length']?_0x727402[_0xa292('0x36')]:_0x97fd4c[_0xa292('0x2f')];if(_0x2c7492[_0xa292('0x32')][_0xa292('0x42')]){_0x727402['include']=[{'all':!![]}];}_0x727402=_[_0xa292('0x3e')]({},_0x727402,_0x2c7492[_0xa292('0x40')]);return db['ServicenowConfiguration']['find'](_0x727402)[_0xa292('0x25')](handleEntityNotFound(_0x38eb4c,null))['then'](respondWithResult(_0x38eb4c,null))['catch'](handleError(_0x38eb4c,null));};exports[_0xa292('0x48')]=function(_0x386727,_0x17d1cc){return db[_0xa292('0x2a')][_0xa292('0x48')](_0x386727[_0xa292('0x49')],{})[_0xa292('0x25')](respondWithResult(_0x17d1cc,0xc9))[_0xa292('0x45')](handleError(_0x17d1cc,null));};exports['update']=function(_0x2a8d3f,_0x18ede5){if(_0x2a8d3f['body']['id']){delete _0x2a8d3f[_0xa292('0x49')]['id'];}return db['ServicenowConfiguration'][_0xa292('0x4a')]({'where':{'id':_0x2a8d3f['params']['id']}})[_0xa292('0x25')](handleEntityNotFound(_0x18ede5,null))[_0xa292('0x25')](saveUpdates(_0x2a8d3f[_0xa292('0x49')],null))[_0xa292('0x25')](respondWithResult(_0x18ede5,null))[_0xa292('0x45')](handleError(_0x18ede5,null));};exports[_0xa292('0x24')]=function(_0x25724a,_0x406d21){return db[_0xa292('0x2a')]['find']({'where':{'id':_0x25724a[_0xa292('0x47')]['id']}})['then'](handleEntityNotFound(_0x406d21,null))['then'](removeEntity(_0x406d21,null))[_0xa292('0x45')](handleError(_0x406d21,null));};exports[_0xa292('0x4b')]=function(_0x48b95c,_0x560326,_0x560bf6){var _0x33d092={};var _0x415e21={};var _0x8bd59c;var _0x5768db;return db[_0xa292('0x2a')][_0xa292('0x4c')]({'where':{'id':_0x48b95c['params']['id']}})[_0xa292('0x25')](handleEntityNotFound(_0x560326,null))[_0xa292('0x25')](function(_0x283768){if(_0x283768){_0x8bd59c=_0x283768;_0x415e21[_0xa292('0x2f')]=_[_0xa292('0x31')](db[_0xa292('0x4d')][_0xa292('0x2b')]);_0x415e21[_0xa292('0x32')]=_['keys'](_0x48b95c[_0xa292('0x32')]);_0x415e21[_0xa292('0x33')]=_[_0xa292('0x34')](_0x415e21[_0xa292('0x2f')],_0x415e21[_0xa292('0x32')]);_0x33d092[_0xa292('0x36')]=_[_0xa292('0x34')](_0x415e21[_0xa292('0x2f')],qs[_0xa292('0x35')](_0x48b95c['query']['fields']));_0x33d092['attributes']=_0x33d092[_0xa292('0x36')][_0xa292('0x37')]?_0x33d092['attributes']:_0x415e21[_0xa292('0x2f')];_0x33d092[_0xa292('0x4e')]=qs['sort'](_0x48b95c['query'][_0xa292('0x3a')]);_0x33d092[_0xa292('0x3b')]=qs[_0xa292('0x33')](_[_0xa292('0x3c')](_0x48b95c['query'],_0x415e21[_0xa292('0x33')]));if(_0x48b95c[_0xa292('0x32')][_0xa292('0x3d')]){_0x33d092[_0xa292('0x3b')]=_['merge'](_0x33d092[_0xa292('0x3b')],{'$or':_[_0xa292('0x30')](_0x33d092[_0xa292('0x36')],function(_0x24ad79){var _0x452cad={};_0x452cad[_0x24ad79]={'$like':'%'+_0x48b95c[_0xa292('0x32')][_0xa292('0x3d')]+'%'};return _0x452cad;})});}_0x33d092=_[_0xa292('0x3e')]({},_0x33d092,_0x48b95c[_0xa292('0x40')]);return _0x8bd59c[_0xa292('0x4b')](_0x33d092);}})[_0xa292('0x25')](function(_0x5013e2){if(_0x5013e2){_0x5768db=_0x5013e2[_0xa292('0x37')];if(!_0x48b95c[_0xa292('0x32')][_0xa292('0x38')](_0xa292('0x39'))){_0x33d092[_0xa292('0x1e')]=qs[_0xa292('0x1e')](_0x48b95c[_0xa292('0x32')][_0xa292('0x1e')]);_0x33d092[_0xa292('0x1c')]=qs['offset'](_0x48b95c[_0xa292('0x32')][_0xa292('0x1c')]);}return _0x8bd59c['getFields'](_0x33d092);}})[_0xa292('0x25')](function(_0x30eff1){if(_0x30eff1){return _0x30eff1?{'count':_0x5768db,'rows':_0x30eff1}:null;}})[_0xa292('0x25')](respondWithResult(_0x560326,null))[_0xa292('0x45')](handleError(_0x560326,null));};exports['getSubjects']=function(_0x233850,_0x226e64,_0x1fe290){var _0x39e294={};var _0x45eef3={};var _0x21b84e;var _0x8b41ef;return db[_0xa292('0x2a')][_0xa292('0x4c')]({'where':{'id':_0x233850[_0xa292('0x47')]['id']}})[_0xa292('0x25')](handleEntityNotFound(_0x226e64,null))[_0xa292('0x25')](function(_0x323951){if(_0x323951){_0x21b84e=_0x323951;_0x45eef3[_0xa292('0x2f')]=_[_0xa292('0x31')](db[_0xa292('0x4d')][_0xa292('0x2b')]);_0x45eef3[_0xa292('0x32')]=_[_0xa292('0x31')](_0x233850[_0xa292('0x32')]);_0x45eef3[_0xa292('0x33')]=_['intersection'](_0x45eef3[_0xa292('0x2f')],_0x45eef3[_0xa292('0x32')]);_0x39e294[_0xa292('0x36')]=_[_0xa292('0x34')](_0x45eef3['model'],qs[_0xa292('0x35')](_0x233850[_0xa292('0x32')]['fields']));_0x39e294[_0xa292('0x36')]=_0x39e294['attributes']['length']?_0x39e294[_0xa292('0x36')]:_0x45eef3[_0xa292('0x2f')];_0x39e294[_0xa292('0x4e')]=qs[_0xa292('0x3a')](_0x233850[_0xa292('0x32')][_0xa292('0x3a')]);_0x39e294[_0xa292('0x3b')]=qs[_0xa292('0x33')](_[_0xa292('0x3c')](_0x233850[_0xa292('0x32')],_0x45eef3[_0xa292('0x33')]));if(_0x233850[_0xa292('0x32')][_0xa292('0x3d')]){_0x39e294[_0xa292('0x3b')]=_[_0xa292('0x3e')](_0x39e294[_0xa292('0x3b')],{'$or':_[_0xa292('0x30')](_0x39e294[_0xa292('0x36')],function(_0x5e5587){var _0x4b12dd={};_0x4b12dd[_0x5e5587]={'$like':'%'+_0x233850['query'][_0xa292('0x3d')]+'%'};return _0x4b12dd;})});}_0x39e294=_['merge']({},_0x39e294,_0x233850[_0xa292('0x40')]);return _0x21b84e[_0xa292('0x4f')](_0x39e294);}})['then'](function(_0x312157){if(_0x312157){_0x8b41ef=_0x312157[_0xa292('0x37')];if(!_0x233850[_0xa292('0x32')][_0xa292('0x38')](_0xa292('0x39'))){_0x39e294['limit']=qs[_0xa292('0x1e')](_0x233850[_0xa292('0x32')][_0xa292('0x1e')]);_0x39e294['offset']=qs['offset'](_0x233850['query']['offset']);}return _0x21b84e['getSubjects'](_0x39e294);}})[_0xa292('0x25')](function(_0x22bb44){if(_0x22bb44){return _0x22bb44?{'count':_0x8b41ef,'rows':_0x22bb44}:null;}})[_0xa292('0x25')](respondWithResult(_0x226e64,null))['catch'](handleError(_0x226e64,null));};exports[_0xa292('0x50')]=function(_0x2f57f9,_0x51ec10,_0x323495){var _0x37e56c={};var _0x30c699={};var _0x50f99d;var _0x26895f;return db[_0xa292('0x2a')][_0xa292('0x4c')]({'where':{'id':_0x2f57f9['params']['id']}})['then'](handleEntityNotFound(_0x51ec10,null))[_0xa292('0x25')](function(_0x412760){if(_0x412760){_0x50f99d=_0x412760;_0x30c699['model']=_['keys'](db[_0xa292('0x4d')][_0xa292('0x2b')]);_0x30c699[_0xa292('0x32')]=_[_0xa292('0x31')](_0x2f57f9[_0xa292('0x32')]);_0x30c699['filters']=_[_0xa292('0x34')](_0x30c699['model'],_0x30c699[_0xa292('0x32')]);_0x37e56c[_0xa292('0x36')]=_[_0xa292('0x34')](_0x30c699[_0xa292('0x2f')],qs[_0xa292('0x35')](_0x2f57f9[_0xa292('0x32')]['fields']));_0x37e56c[_0xa292('0x36')]=_0x37e56c[_0xa292('0x36')]['length']?_0x37e56c[_0xa292('0x36')]:_0x30c699['model'];_0x37e56c['order']=qs[_0xa292('0x3a')](_0x2f57f9['query'][_0xa292('0x3a')]);_0x37e56c['where']=qs[_0xa292('0x33')](_[_0xa292('0x3c')](_0x2f57f9[_0xa292('0x32')],_0x30c699[_0xa292('0x33')]));if(_0x2f57f9[_0xa292('0x32')][_0xa292('0x3d')]){_0x37e56c[_0xa292('0x3b')]=_[_0xa292('0x3e')](_0x37e56c[_0xa292('0x3b')],{'$or':_['map'](_0x37e56c[_0xa292('0x36')],function(_0x3e41dd){var _0x159146={};_0x159146[_0x3e41dd]={'$like':'%'+_0x2f57f9[_0xa292('0x32')][_0xa292('0x3d')]+'%'};return _0x159146;})});}_0x37e56c=_[_0xa292('0x3e')]({},_0x37e56c,_0x2f57f9[_0xa292('0x40')]);return _0x50f99d[_0xa292('0x50')](_0x37e56c);}})[_0xa292('0x25')](function(_0x2ea4db){if(_0x2ea4db){_0x26895f=_0x2ea4db[_0xa292('0x37')];if(!_0x2f57f9[_0xa292('0x32')][_0xa292('0x38')](_0xa292('0x39'))){_0x37e56c[_0xa292('0x1e')]=qs['limit'](_0x2f57f9[_0xa292('0x32')][_0xa292('0x1e')]);_0x37e56c['offset']=qs[_0xa292('0x1c')](_0x2f57f9[_0xa292('0x32')][_0xa292('0x1c')]);}return _0x50f99d['getDescriptions'](_0x37e56c);}})['then'](function(_0x17fcb1){if(_0x17fcb1){return _0x17fcb1?{'count':_0x26895f,'rows':_0x17fcb1}:null;}})[_0xa292('0x25')](respondWithResult(_0x51ec10,null))[_0xa292('0x45')](handleError(_0x51ec10,null));}; \ No newline at end of file +var _0xda33=['request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','apply','reject','save','update','then','error','name','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getFields','findOne','order','nolimit','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xda33,0x187));var _0x3da3=function(_0x6d053f,_0x2e4108){_0x6d053f=_0x6d053f-0x0;var _0x5b6234=_0xda33[_0x6d053f];return _0x5b6234;};'use strict';var emlformat=require(_0x3da3('0x0'));var rimraf=require(_0x3da3('0x1'));var zipdir=require(_0x3da3('0x2'));var jsonpatch=require(_0x3da3('0x3'));var rp=require(_0x3da3('0x4'));var moment=require('moment');var BPromise=require(_0x3da3('0x5'));var Mustache=require('mustache');var util=require(_0x3da3('0x6'));var path=require(_0x3da3('0x7'));var sox=require('sox');var csv=require(_0x3da3('0x8'));var ejs=require(_0x3da3('0x9'));var fs=require('fs');var fs_extra=require(_0x3da3('0xa'));var _=require(_0x3da3('0xb'));var squel=require(_0x3da3('0xc'));var crypto=require('crypto');var jsforce=require(_0x3da3('0xd'));var deskjs=require(_0x3da3('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3da3('0xf'));var Redis=require(_0x3da3('0x10'));var authService=require(_0x3da3('0x11'));var qs=require(_0x3da3('0x12'));var as=require(_0x3da3('0x13'));var hardwareService=require(_0x3da3('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3da3('0x15'));var config=require(_0x3da3('0x16'));var licenseUtil=require(_0x3da3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfbecd1,_0x20e66f){_0x20e66f=_0x20e66f||0xcc;return function(_0x2a3ff7){if(_0x2a3ff7){return _0xfbecd1[_0x3da3('0x18')](_0x20e66f);}return _0xfbecd1[_0x3da3('0x19')](_0x20e66f)[_0x3da3('0x1a')]();};}function respondWithResult(_0x411f04,_0x3aed79){_0x3aed79=_0x3aed79||0xc8;return function(_0x3d902e){if(_0x3d902e){return _0x411f04[_0x3da3('0x19')](_0x3aed79)[_0x3da3('0x1b')](_0x3d902e);}};}function respondWithFilteredResult(_0x57e954,_0x359538){return function(_0x39944a){if(_0x39944a){var _0x4328d6=typeof _0x359538['offset']==='undefined'&&typeof _0x359538[_0x3da3('0x1c')]==='undefined';var _0x4de4f5=_0x39944a[_0x3da3('0x1d')];var _0x56b2a9=_0x4328d6?0x0:_0x359538[_0x3da3('0x1e')];var _0x1ed997=_0x4328d6?_0x39944a[_0x3da3('0x1d')]:_0x359538[_0x3da3('0x1e')]+_0x359538[_0x3da3('0x1c')];var _0x3afbd3;if(_0x1ed997>=_0x4de4f5){_0x1ed997=_0x4de4f5;_0x3afbd3=0xc8;}else{_0x3afbd3=0xce;}_0x57e954[_0x3da3('0x19')](_0x3afbd3);return _0x57e954[_0x3da3('0x1f')]('Content-Range',_0x56b2a9+'-'+_0x1ed997+'/'+_0x4de4f5)[_0x3da3('0x1b')](_0x39944a);}return null;};}function patchUpdates(_0x4c59df){return function(_0x350f6e){try{jsonpatch[_0x3da3('0x20')](_0x350f6e,_0x4c59df,!![]);}catch(_0x1bde7){return BPromise[_0x3da3('0x21')](_0x1bde7);}return _0x350f6e[_0x3da3('0x22')]();};}function saveUpdates(_0x5eac27,_0x39560c){return function(_0x5d810f){if(_0x5d810f){return _0x5d810f[_0x3da3('0x23')](_0x5eac27)['then'](function(_0x36bc89){return _0x36bc89;});}return null;};}function removeEntity(_0x1bd147,_0x3fa73c){return function(_0x16247){if(_0x16247){return _0x16247['destroy']()[_0x3da3('0x24')](function(){_0x1bd147[_0x3da3('0x19')](0xcc)[_0x3da3('0x1a')]();});}};}function handleEntityNotFound(_0x3fc911,_0x3dd3eb){return function(_0x3fabd3){if(!_0x3fabd3){_0x3fc911[_0x3da3('0x18')](0x194);}return _0x3fabd3;};}function handleError(_0x413781,_0x5baafc){_0x5baafc=_0x5baafc||0x1f4;return function(_0x40befc){logger[_0x3da3('0x25')](_0x40befc['stack']);if(_0x40befc['name']){delete _0x40befc[_0x3da3('0x26')];}_0x413781[_0x3da3('0x19')](_0x5baafc)['send'](_0x40befc);};}exports['index']=function(_0x144a89,_0x1119eb){var _0x1200e2={},_0x2f8c16={},_0x3072ba={'count':0x0,'rows':[]};var _0x4a6a3c=_['map'](db[_0x3da3('0x27')][_0x3da3('0x28')],function(_0x5029d9){return{'name':_0x5029d9[_0x3da3('0x29')],'type':_0x5029d9[_0x3da3('0x2a')][_0x3da3('0x2b')]};});_0x2f8c16[_0x3da3('0x2c')]=_[_0x3da3('0x2d')](_0x4a6a3c,_0x3da3('0x26'));_0x2f8c16[_0x3da3('0x2e')]=_[_0x3da3('0x2f')](_0x144a89['query']);_0x2f8c16[_0x3da3('0x30')]=_[_0x3da3('0x31')](_0x2f8c16[_0x3da3('0x2c')],_0x2f8c16[_0x3da3('0x2e')]);_0x1200e2[_0x3da3('0x32')]=_[_0x3da3('0x31')](_0x2f8c16[_0x3da3('0x2c')],qs[_0x3da3('0x33')](_0x144a89[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x1200e2[_0x3da3('0x32')]=_0x1200e2[_0x3da3('0x32')]['length']?_0x1200e2[_0x3da3('0x32')]:_0x2f8c16['model'];if(!_0x144a89['query'][_0x3da3('0x34')]('nolimit')){_0x1200e2[_0x3da3('0x1c')]=qs['limit'](_0x144a89[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x1200e2[_0x3da3('0x1e')]=qs[_0x3da3('0x1e')](_0x144a89[_0x3da3('0x2e')][_0x3da3('0x1e')]);}_0x1200e2['order']=qs[_0x3da3('0x35')](_0x144a89[_0x3da3('0x2e')]['sort']);_0x1200e2['where']=qs['filters'](_[_0x3da3('0x36')](_0x144a89['query'],_0x2f8c16[_0x3da3('0x30')]),_0x4a6a3c);if(_0x144a89[_0x3da3('0x2e')]['filter']){_0x1200e2[_0x3da3('0x37')]=_[_0x3da3('0x38')](_0x1200e2[_0x3da3('0x37')],{'$or':_['map'](_0x4a6a3c,function(_0x479bd4){if(_0x479bd4['type']!==_0x3da3('0x39')){var _0x2eeb46={};_0x2eeb46[_0x479bd4[_0x3da3('0x26')]]={'$like':'%'+_0x144a89['query'][_0x3da3('0x3a')]+'%'};return _0x2eeb46;}})});}_0x1200e2=_[_0x3da3('0x38')]({},_0x1200e2,_0x144a89[_0x3da3('0x3b')]);var _0x445602={'where':_0x1200e2[_0x3da3('0x37')]};return db['ServicenowConfiguration'][_0x3da3('0x1d')](_0x445602)[_0x3da3('0x24')](function(_0xc9b8cc){_0x3072ba['count']=_0xc9b8cc;if(_0x144a89[_0x3da3('0x2e')][_0x3da3('0x3c')]){_0x1200e2[_0x3da3('0x3d')]=[{'all':!![]}];}return db[_0x3da3('0x27')][_0x3da3('0x3e')](_0x1200e2);})['then'](function(_0x2990d9){_0x3072ba[_0x3da3('0x3f')]=_0x2990d9;return _0x3072ba;})['then'](respondWithFilteredResult(_0x1119eb,_0x1200e2))[_0x3da3('0x40')](handleError(_0x1119eb,null));};exports[_0x3da3('0x41')]=function(_0x2e3e65,_0x26a40c){var _0x4290ff={'raw':![],'where':{'id':_0x2e3e65[_0x3da3('0x42')]['id']}},_0x452349={};_0x452349['model']=_['keys'](db['ServicenowConfiguration'][_0x3da3('0x28')]);_0x452349[_0x3da3('0x2e')]=_[_0x3da3('0x2f')](_0x2e3e65[_0x3da3('0x2e')]);_0x452349['filters']=_['intersection'](_0x452349[_0x3da3('0x2c')],_0x452349[_0x3da3('0x2e')]);_0x4290ff['attributes']=_[_0x3da3('0x31')](_0x452349[_0x3da3('0x2c')],qs['fields'](_0x2e3e65[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x4290ff[_0x3da3('0x32')]=_0x4290ff['attributes'][_0x3da3('0x43')]?_0x4290ff[_0x3da3('0x32')]:_0x452349[_0x3da3('0x2c')];if(_0x2e3e65[_0x3da3('0x2e')][_0x3da3('0x3c')]){_0x4290ff[_0x3da3('0x3d')]=[{'all':!![]}];}_0x4290ff=_[_0x3da3('0x38')]({},_0x4290ff,_0x2e3e65['options']);return db['ServicenowConfiguration'][_0x3da3('0x44')](_0x4290ff)['then'](handleEntityNotFound(_0x26a40c,null))[_0x3da3('0x24')](respondWithResult(_0x26a40c,null))[_0x3da3('0x40')](handleError(_0x26a40c,null));};exports[_0x3da3('0x45')]=function(_0x2909ec,_0x1ae2b5){return db[_0x3da3('0x27')][_0x3da3('0x45')](_0x2909ec[_0x3da3('0x46')],{})[_0x3da3('0x24')](respondWithResult(_0x1ae2b5,0xc9))[_0x3da3('0x40')](handleError(_0x1ae2b5,null));};exports['update']=function(_0x11ffb6,_0x201373){if(_0x11ffb6[_0x3da3('0x46')]['id']){delete _0x11ffb6[_0x3da3('0x46')]['id'];}return db[_0x3da3('0x27')]['find']({'where':{'id':_0x11ffb6[_0x3da3('0x42')]['id']}})['then'](handleEntityNotFound(_0x201373,null))[_0x3da3('0x24')](saveUpdates(_0x11ffb6['body'],null))['then'](respondWithResult(_0x201373,null))[_0x3da3('0x40')](handleError(_0x201373,null));};exports[_0x3da3('0x47')]=function(_0x59d224,_0x4e69b2){return db[_0x3da3('0x27')][_0x3da3('0x44')]({'where':{'id':_0x59d224[_0x3da3('0x42')]['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x4e69b2,null))[_0x3da3('0x24')](removeEntity(_0x4e69b2,null))[_0x3da3('0x40')](handleError(_0x4e69b2,null));};exports[_0x3da3('0x48')]=function(_0x5954ec,_0x1b90e1,_0x1a2088){var _0x5b80ef={};var _0x9b285d={};var _0x10b5d0;var _0x26502d;return db['ServicenowConfiguration'][_0x3da3('0x49')]({'where':{'id':_0x5954ec['params']['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x1b90e1,null))[_0x3da3('0x24')](function(_0x86dfaa){if(_0x86dfaa){_0x10b5d0=_0x86dfaa;_0x9b285d['model']=_['keys'](db['ServicenowField'][_0x3da3('0x28')]);_0x9b285d[_0x3da3('0x2e')]=_['keys'](_0x5954ec['query']);_0x9b285d[_0x3da3('0x30')]=_[_0x3da3('0x31')](_0x9b285d['model'],_0x9b285d[_0x3da3('0x2e')]);_0x5b80ef[_0x3da3('0x32')]=_[_0x3da3('0x31')](_0x9b285d[_0x3da3('0x2c')],qs['fields'](_0x5954ec[_0x3da3('0x2e')]['fields']));_0x5b80ef[_0x3da3('0x32')]=_0x5b80ef['attributes'][_0x3da3('0x43')]?_0x5b80ef[_0x3da3('0x32')]:_0x9b285d[_0x3da3('0x2c')];_0x5b80ef[_0x3da3('0x4a')]=qs[_0x3da3('0x35')](_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x35')]);_0x5b80ef[_0x3da3('0x37')]=qs['filters'](_[_0x3da3('0x36')](_0x5954ec[_0x3da3('0x2e')],_0x9b285d[_0x3da3('0x30')]));if(_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x3a')]){_0x5b80ef['where']=_[_0x3da3('0x38')](_0x5b80ef[_0x3da3('0x37')],{'$or':_['map'](_0x5b80ef[_0x3da3('0x32')],function(_0x2e41e9){var _0x25024b={};_0x25024b[_0x2e41e9]={'$like':'%'+_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x3a')]+'%'};return _0x25024b;})});}_0x5b80ef=_[_0x3da3('0x38')]({},_0x5b80ef,_0x5954ec[_0x3da3('0x3b')]);return _0x10b5d0[_0x3da3('0x48')](_0x5b80ef);}})[_0x3da3('0x24')](function(_0x489437){if(_0x489437){_0x26502d=_0x489437[_0x3da3('0x43')];if(!_0x5954ec['query'][_0x3da3('0x34')](_0x3da3('0x4b'))){_0x5b80ef['limit']=qs['limit'](_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x5b80ef[_0x3da3('0x1e')]=qs[_0x3da3('0x1e')](_0x5954ec[_0x3da3('0x2e')][_0x3da3('0x1e')]);}return _0x10b5d0[_0x3da3('0x48')](_0x5b80ef);}})[_0x3da3('0x24')](function(_0x46b0f4){if(_0x46b0f4){return _0x46b0f4?{'count':_0x26502d,'rows':_0x46b0f4}:null;}})[_0x3da3('0x24')](respondWithResult(_0x1b90e1,null))[_0x3da3('0x40')](handleError(_0x1b90e1,null));};exports[_0x3da3('0x4c')]=function(_0x722b2d,_0x5d1e89,_0x3225ac){var _0x4cba31={};var _0xd3829f={};var _0x5c1162;var _0x295663;return db[_0x3da3('0x27')]['findOne']({'where':{'id':_0x722b2d[_0x3da3('0x42')]['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x5d1e89,null))[_0x3da3('0x24')](function(_0xa26b49){if(_0xa26b49){_0x5c1162=_0xa26b49;_0xd3829f[_0x3da3('0x2c')]=_['keys'](db[_0x3da3('0x4d')][_0x3da3('0x28')]);_0xd3829f['query']=_['keys'](_0x722b2d[_0x3da3('0x2e')]);_0xd3829f['filters']=_[_0x3da3('0x31')](_0xd3829f['model'],_0xd3829f['query']);_0x4cba31[_0x3da3('0x32')]=_[_0x3da3('0x31')](_0xd3829f[_0x3da3('0x2c')],qs[_0x3da3('0x33')](_0x722b2d[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x4cba31[_0x3da3('0x32')]=_0x4cba31[_0x3da3('0x32')][_0x3da3('0x43')]?_0x4cba31['attributes']:_0xd3829f[_0x3da3('0x2c')];_0x4cba31[_0x3da3('0x4a')]=qs['sort'](_0x722b2d[_0x3da3('0x2e')][_0x3da3('0x35')]);_0x4cba31[_0x3da3('0x37')]=qs['filters'](_[_0x3da3('0x36')](_0x722b2d[_0x3da3('0x2e')],_0xd3829f[_0x3da3('0x30')]));if(_0x722b2d['query'][_0x3da3('0x3a')]){_0x4cba31[_0x3da3('0x37')]=_[_0x3da3('0x38')](_0x4cba31[_0x3da3('0x37')],{'$or':_[_0x3da3('0x2d')](_0x4cba31['attributes'],function(_0x50b4f0){var _0x4b0ce5={};_0x4b0ce5[_0x50b4f0]={'$like':'%'+_0x722b2d[_0x3da3('0x2e')]['filter']+'%'};return _0x4b0ce5;})});}_0x4cba31=_[_0x3da3('0x38')]({},_0x4cba31,_0x722b2d[_0x3da3('0x3b')]);return _0x5c1162[_0x3da3('0x4c')](_0x4cba31);}})[_0x3da3('0x24')](function(_0x5ab864){if(_0x5ab864){_0x295663=_0x5ab864['length'];if(!_0x722b2d['query'][_0x3da3('0x34')](_0x3da3('0x4b'))){_0x4cba31[_0x3da3('0x1c')]=qs[_0x3da3('0x1c')](_0x722b2d[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x4cba31[_0x3da3('0x1e')]=qs['offset'](_0x722b2d['query'][_0x3da3('0x1e')]);}return _0x5c1162[_0x3da3('0x4c')](_0x4cba31);}})[_0x3da3('0x24')](function(_0x27ecee){if(_0x27ecee){return _0x27ecee?{'count':_0x295663,'rows':_0x27ecee}:null;}})[_0x3da3('0x24')](respondWithResult(_0x5d1e89,null))['catch'](handleError(_0x5d1e89,null));};exports['getDescriptions']=function(_0x377518,_0x527a99,_0x371543){var _0x546108={};var _0x5ab2a8={};var _0x529c29;var _0x20e39a;return db[_0x3da3('0x27')][_0x3da3('0x49')]({'where':{'id':_0x377518[_0x3da3('0x42')]['id']}})[_0x3da3('0x24')](handleEntityNotFound(_0x527a99,null))[_0x3da3('0x24')](function(_0x247ad9){if(_0x247ad9){_0x529c29=_0x247ad9;_0x5ab2a8['model']=_[_0x3da3('0x2f')](db[_0x3da3('0x4d')]['rawAttributes']);_0x5ab2a8['query']=_[_0x3da3('0x2f')](_0x377518[_0x3da3('0x2e')]);_0x5ab2a8[_0x3da3('0x30')]=_[_0x3da3('0x31')](_0x5ab2a8[_0x3da3('0x2c')],_0x5ab2a8[_0x3da3('0x2e')]);_0x546108['attributes']=_['intersection'](_0x5ab2a8[_0x3da3('0x2c')],qs[_0x3da3('0x33')](_0x377518[_0x3da3('0x2e')][_0x3da3('0x33')]));_0x546108[_0x3da3('0x32')]=_0x546108[_0x3da3('0x32')]['length']?_0x546108[_0x3da3('0x32')]:_0x5ab2a8['model'];_0x546108[_0x3da3('0x4a')]=qs[_0x3da3('0x35')](_0x377518[_0x3da3('0x2e')][_0x3da3('0x35')]);_0x546108[_0x3da3('0x37')]=qs[_0x3da3('0x30')](_[_0x3da3('0x36')](_0x377518['query'],_0x5ab2a8[_0x3da3('0x30')]));if(_0x377518[_0x3da3('0x2e')][_0x3da3('0x3a')]){_0x546108[_0x3da3('0x37')]=_['merge'](_0x546108['where'],{'$or':_[_0x3da3('0x2d')](_0x546108[_0x3da3('0x32')],function(_0x204507){var _0x53c745={};_0x53c745[_0x204507]={'$like':'%'+_0x377518['query'][_0x3da3('0x3a')]+'%'};return _0x53c745;})});}_0x546108=_[_0x3da3('0x38')]({},_0x546108,_0x377518[_0x3da3('0x3b')]);return _0x529c29['getDescriptions'](_0x546108);}})[_0x3da3('0x24')](function(_0x454d34){if(_0x454d34){_0x20e39a=_0x454d34[_0x3da3('0x43')];if(!_0x377518[_0x3da3('0x2e')][_0x3da3('0x34')]('nolimit')){_0x546108[_0x3da3('0x1c')]=qs['limit'](_0x377518[_0x3da3('0x2e')][_0x3da3('0x1c')]);_0x546108[_0x3da3('0x1e')]=qs['offset'](_0x377518['query'][_0x3da3('0x1e')]);}return _0x529c29[_0x3da3('0x4e')](_0x546108);}})['then'](function(_0x5cb0f3){if(_0x5cb0f3){return _0x5cb0f3?{'count':_0x20e39a,'rows':_0x5cb0f3}:null;}})[_0x3da3('0x24')](respondWithResult(_0x527a99,null))[_0x3da3('0x40')](handleError(_0x527a99,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index fa35f00..f4980ba 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 _0x723c=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0xbc3542,_0x4de021){var _0x1c88ff=function(_0x1d1fb4){while(--_0x1d1fb4){_0xbc3542['push'](_0xbc3542['shift']());}};_0x1c88ff(++_0x4de021);}(_0x723c,0x1ad));var _0xc723=function(_0xdf6e01,_0x12dc0e){_0xdf6e01=_0xdf6e01-0x0;var _0x18b170=_0x723c[_0xdf6e01];return _0x18b170;};'use strict';var _=require('lodash');var util=require(_0xc723('0x0'));var logger=require(_0xc723('0x1'))('api');var moment=require(_0xc723('0x2'));var BPromise=require('bluebird');var rp=require(_0xc723('0x3'));var fs=require('fs');var path=require(_0xc723('0x4'));var rimraf=require(_0xc723('0x5'));var config=require(_0xc723('0x6'));var attributes=require(_0xc723('0x7'));module[_0xc723('0x8')]=function(_0xa08b3,_0x4eb5ff){return _0xa08b3[_0xc723('0x9')](_0xc723('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7fa=['exports','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x5c6951,_0x507abb){var _0x5ee145=function(_0x4f8b75){while(--_0x4f8b75){_0x5c6951['push'](_0x5c6951['shift']());}};_0x5ee145(++_0x507abb);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa7f('0x1'));var moment=require(_0xaa7f('0x2'));var BPromise=require(_0xaa7f('0x3'));var rp=require(_0xaa7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa7f('0x5'));var config=require(_0xaa7f('0x6'));var attributes=require(_0xaa7f('0x7'));module[_0xaa7f('0x8')]=function(_0x48e98f,_0xf79d63){return _0x48e98f['define']('ServicenowConfiguration',attributes,{'tableName':_0xaa7f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index c2e1012..8c751aa 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 _0x5f43=['ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x1ec100,_0x4d46b0){var _0x3ed9f4=function(_0xea9408){while(--_0xea9408){_0x1ec100['push'](_0x1ec100['shift']());}};_0x3ed9f4(++_0x4d46b0);}(_0x5f43,0xe4));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x35f4('0x0'));var util=require(_0x35f4('0x1'));var moment=require(_0x35f4('0x2'));var BPromise=require('bluebird');var rs=require(_0x35f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x35f4('0x4'));var logger=require(_0x35f4('0x5'))('rpc');var config=require(_0x35f4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x35f4('0x7')][_0x35f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ef6fc,_0x56a2ee,_0x1fcd56){return new BPromise(function(_0x1b378b,_0x5e405b){return client[_0x35f4('0x9')](_0x4ef6fc,_0x1fcd56)[_0x35f4('0xa')](function(_0x1530e6){logger[_0x35f4('0xb')](_0x35f4('0xc'),_0x56a2ee,'request\x20sent');logger['debug'](_0x35f4('0xd'),_0x56a2ee,_0x35f4('0xe'),JSON['stringify'](_0x1530e6));if(_0x1530e6[_0x35f4('0xf')]){if(_0x1530e6['error'][_0x35f4('0x10')]===0x1f4){logger[_0x35f4('0xf')](_0x35f4('0xc'),_0x56a2ee,_0x1530e6[_0x35f4('0xf')]['message']);return _0x5e405b(_0x1530e6[_0x35f4('0xf')][_0x35f4('0x11')]);}logger[_0x35f4('0xf')](_0x35f4('0xc'),_0x56a2ee,_0x1530e6[_0x35f4('0xf')][_0x35f4('0x11')]);return _0x1b378b(_0x1530e6[_0x35f4('0xf')][_0x35f4('0x11')]);}else{logger[_0x35f4('0xb')](_0x35f4('0xc'),_0x56a2ee,_0x35f4('0xe'));_0x1b378b(_0x1530e6[_0x35f4('0x12')][_0x35f4('0x11')]);}})[_0x35f4('0x13')](function(_0x127ba1){logger['error'](_0x35f4('0xc'),_0x56a2ee,_0x127ba1);_0x5e405b(_0x127ba1);});});} \ No newline at end of file +var _0x4c41=['then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4fbfd7,_0x3b7dc6){var _0x5b6ea7=function(_0x4884df){while(--_0x4884df){_0x4fbfd7['push'](_0x4fbfd7['shift']());}};_0x5b6ea7(++_0x3b7dc6);}(_0x4c41,0xda));var _0x14c4=function(_0x28b7d3,_0x100e30){_0x28b7d3=_0x28b7d3-0x0;var _0xba06c0=_0x4c41[_0x28b7d3];return _0xba06c0;};'use strict';var _=require(_0x14c4('0x0'));var util=require(_0x14c4('0x1'));var moment=require(_0x14c4('0x2'));var BPromise=require(_0x14c4('0x3'));var rs=require(_0x14c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x14c4('0x6'));var config=require(_0x14c4('0x7'));var jayson=require(_0x14c4('0x8'));var client=jayson[_0x14c4('0x9')][_0x14c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x356a5e,_0x562702,_0x1661bb){return new BPromise(function(_0x55f6e4,_0x5133b1){return client[_0x14c4('0xb')](_0x356a5e,_0x1661bb)[_0x14c4('0xc')](function(_0x39343c){logger['info'](_0x14c4('0xd'),_0x562702,_0x14c4('0xe'));logger['debug'](_0x14c4('0xf'),_0x562702,_0x14c4('0xe'),JSON[_0x14c4('0x10')](_0x39343c));if(_0x39343c[_0x14c4('0x11')]){if(_0x39343c['error'][_0x14c4('0x12')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x562702,_0x39343c[_0x14c4('0x11')]['message']);return _0x5133b1(_0x39343c['error'][_0x14c4('0x13')]);}logger[_0x14c4('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x562702,_0x39343c[_0x14c4('0x11')][_0x14c4('0x13')]);return _0x55f6e4(_0x39343c['error'][_0x14c4('0x13')]);}else{logger[_0x14c4('0x14')](_0x14c4('0xd'),_0x562702,_0x14c4('0xe'));_0x55f6e4(_0x39343c[_0x14c4('0x15')][_0x14c4('0x13')]);}})[_0x14c4('0x16')](function(_0x57cf0f){logger['error'](_0x14c4('0xd'),_0x562702,_0x57cf0f);_0x5133b1(_0x57cf0f);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 1bebf7d..065a570 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 _0x3ea2=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x50aa4f,_0x5e4caa){var _0x2fe613=function(_0x2e2a7f){while(--_0x2e2a7f){_0x50aa4f['push'](_0x50aa4f['shift']());}};_0x2fe613(++_0x5e4caa);}(_0x3ea2,0x17d));var _0x23ea=function(_0x1d760b,_0x47f9fe){_0x1d760b=_0x1d760b-0x0;var _0x18fb17=_0x3ea2[_0x1d760b];return _0x18fb17;};'use strict';var multer=require(_0x23ea('0x0'));var util=require(_0x23ea('0x1'));var path=require(_0x23ea('0x2'));var timeout=require(_0x23ea('0x3'));var express=require(_0x23ea('0x4'));var router=express[_0x23ea('0x5')]();var fs_extra=require(_0x23ea('0x6'));var auth=require(_0x23ea('0x7'));var interaction=require(_0x23ea('0x8'));var config=require('../../config/environment');var controller=require(_0x23ea('0x9'));router['get']('/',auth[_0x23ea('0xa')](),controller[_0x23ea('0xb')]);router[_0x23ea('0xc')](_0x23ea('0xd'),auth[_0x23ea('0xa')](),controller[_0x23ea('0xe')]);router[_0x23ea('0xf')]('/',auth[_0x23ea('0xa')](),controller[_0x23ea('0x10')]);router[_0x23ea('0x11')](_0x23ea('0xd'),auth[_0x23ea('0xa')](),controller[_0x23ea('0x12')]);router[_0x23ea('0x13')]('/:id',auth[_0x23ea('0xa')](),controller[_0x23ea('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7eca=['delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x7eca,0xbd));var _0xa7ec=function(_0x25524d,_0x2ca31c){_0x25524d=_0x25524d-0x0;var _0x3c3894=_0x7eca[_0x25524d];return _0x3c3894;};'use strict';var multer=require(_0xa7ec('0x0'));var util=require(_0xa7ec('0x1'));var path=require('path');var timeout=require(_0xa7ec('0x2'));var express=require(_0xa7ec('0x3'));var router=express['Router']();var fs_extra=require(_0xa7ec('0x4'));var auth=require(_0xa7ec('0x5'));var interaction=require(_0xa7ec('0x6'));var config=require(_0xa7ec('0x7'));var controller=require('./intServicenowField.controller');router[_0xa7ec('0x8')]('/',auth[_0xa7ec('0x9')](),controller['index']);router[_0xa7ec('0x8')](_0xa7ec('0xa'),auth[_0xa7ec('0x9')](),controller[_0xa7ec('0xb')]);router[_0xa7ec('0xc')]('/',auth[_0xa7ec('0x9')](),controller[_0xa7ec('0xd')]);router['put'](_0xa7ec('0xa'),auth[_0xa7ec('0x9')](),controller[_0xa7ec('0xe')]);router[_0xa7ec('0xf')](_0xa7ec('0xa'),auth['isAuthenticated'](),controller[_0xa7ec('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 620e5f8..9d324fc 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 _0x04bc=['customVariable','picklist','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x428497,_0xece53d){var _0x3c971c=function(_0x487411){while(--_0x487411){_0x428497['push'](_0x428497['shift']());}};_0x3c971c(++_0xece53d);}(_0x04bc,0xba));var _0xc04b=function(_0x3d02d1,_0x2b0c86){_0x3d02d1=_0x3d02d1-0x0;var _0x4633d1=_0x04bc[_0x3d02d1];return _0x4633d1;};'use strict';var Sequelize=require(_0xc04b('0x0'));module[_0xc04b('0x1')]={'type':{'type':Sequelize[_0xc04b('0x2')]('string','variable',_0xc04b('0x3'),'keyValue',_0xc04b('0x4')),'defaultValue':_0xc04b('0x5')},'content':{'type':Sequelize[_0xc04b('0x6')]},'key':{'type':Sequelize[_0xc04b('0x6')]},'keyType':{'type':Sequelize[_0xc04b('0x2')](_0xc04b('0x5'),_0xc04b('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xc04b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc04b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc04b('0x6')]}}; \ No newline at end of file +var _0xaee3=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x420012,_0x2fc91a){var _0x43e24c=function(_0x4f1cac){while(--_0x4f1cac){_0x420012['push'](_0x420012['shift']());}};_0x43e24c(++_0x2fc91a);}(_0xaee3,0x133));var _0x3aee=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xaee3[_0x143a91];return _0x1906f5;};'use strict';var Sequelize=require(_0x3aee('0x0'));module[_0x3aee('0x1')]={'type':{'type':Sequelize[_0x3aee('0x2')](_0x3aee('0x3'),_0x3aee('0x4'),_0x3aee('0x5'),_0x3aee('0x6'),_0x3aee('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3aee('0x8')]},'key':{'type':Sequelize[_0x3aee('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x3aee('0x3'),_0x3aee('0x4'),_0x3aee('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3aee('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 89abb18..83dca63 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 _0x424b=['ServicenowField','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','count','includeAll','findAll','rows','show','keys','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index'];(function(_0x568ccf,_0x55d51e){var _0x4832ff=function(_0x4b92d4){while(--_0x4b92d4){_0x568ccf['push'](_0x568ccf['shift']());}};_0x4832ff(++_0x55d51e);}(_0x424b,0x6a));var _0xb424=function(_0x50fa9a,_0x1da236){_0x50fa9a=_0x50fa9a-0x0;var _0x2bff39=_0x424b[_0x50fa9a];return _0x2bff39;};'use strict';var emlformat=require(_0xb424('0x0'));var rimraf=require(_0xb424('0x1'));var zipdir=require(_0xb424('0x2'));var jsonpatch=require(_0xb424('0x3'));var rp=require(_0xb424('0x4'));var moment=require('moment');var BPromise=require(_0xb424('0x5'));var Mustache=require(_0xb424('0x6'));var util=require('util');var path=require(_0xb424('0x7'));var sox=require('sox');var csv=require(_0xb424('0x8'));var ejs=require(_0xb424('0x9'));var fs=require('fs');var fs_extra=require(_0xb424('0xa'));var _=require(_0xb424('0xb'));var squel=require('squel');var crypto=require(_0xb424('0xc'));var jsforce=require(_0xb424('0xd'));var deskjs=require(_0xb424('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb424('0xf'));var authService=require(_0xb424('0x10'));var qs=require(_0xb424('0x11'));var as=require(_0xb424('0x12'));var hardwareService=require(_0xb424('0x13'));var logger=require(_0xb424('0x14'))(_0xb424('0x15'));var utils=require(_0xb424('0x16'));var config=require(_0xb424('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb424('0x18'))['db'];function respondWithStatusCode(_0x1c7cc9,_0x3c4de1){_0x3c4de1=_0x3c4de1||0xcc;return function(_0x3b1ed5){if(_0x3b1ed5){return _0x1c7cc9['sendStatus'](_0x3c4de1);}return _0x1c7cc9[_0xb424('0x19')](_0x3c4de1)['end']();};}function respondWithResult(_0x45c4e2,_0x445d5b){_0x445d5b=_0x445d5b||0xc8;return function(_0x4d85d9){if(_0x4d85d9){return _0x45c4e2[_0xb424('0x19')](_0x445d5b)['json'](_0x4d85d9);}};}function respondWithFilteredResult(_0x192a30,_0x5cfd34){return function(_0x1be19e){if(_0x1be19e){var _0xd537e9=typeof _0x5cfd34['offset']===_0xb424('0x1a')&&typeof _0x5cfd34[_0xb424('0x1b')]===_0xb424('0x1a');var _0xe4ebd8=_0x1be19e['count'];var _0x371d0a=_0xd537e9?0x0:_0x5cfd34['offset'];var _0x53e022=_0xd537e9?_0x1be19e['count']:_0x5cfd34[_0xb424('0x1c')]+_0x5cfd34[_0xb424('0x1b')];var _0x1ad032;if(_0x53e022>=_0xe4ebd8){_0x53e022=_0xe4ebd8;_0x1ad032=0xc8;}else{_0x1ad032=0xce;}_0x192a30[_0xb424('0x19')](_0x1ad032);return _0x192a30[_0xb424('0x1d')](_0xb424('0x1e'),_0x371d0a+'-'+_0x53e022+'/'+_0xe4ebd8)[_0xb424('0x1f')](_0x1be19e);}return null;};}function patchUpdates(_0x1f961d){return function(_0x2ffee9){try{jsonpatch[_0xb424('0x20')](_0x2ffee9,_0x1f961d,!![]);}catch(_0x15b6b0){return BPromise[_0xb424('0x21')](_0x15b6b0);}return _0x2ffee9[_0xb424('0x22')]();};}function saveUpdates(_0x42a348,_0x47fcb3){return function(_0x23a84e){if(_0x23a84e){return _0x23a84e[_0xb424('0x23')](_0x42a348)[_0xb424('0x24')](function(_0x344624){return _0x344624;});}return null;};}function removeEntity(_0x71c617,_0x12ba04){return function(_0x35606b){if(_0x35606b){return _0x35606b[_0xb424('0x25')]()[_0xb424('0x24')](function(){_0x71c617[_0xb424('0x19')](0xcc)[_0xb424('0x26')]();});}};}function handleEntityNotFound(_0x37ce57,_0x3e4b37){return function(_0x2dbd37){if(!_0x2dbd37){_0x37ce57[_0xb424('0x27')](0x194);}return _0x2dbd37;};}function handleError(_0x3b0e1e,_0x5e8d7c){_0x5e8d7c=_0x5e8d7c||0x1f4;return function(_0x8ab4d1){logger['error'](_0x8ab4d1[_0xb424('0x28')]);if(_0x8ab4d1[_0xb424('0x29')]){delete _0x8ab4d1['name'];}_0x3b0e1e[_0xb424('0x19')](_0x5e8d7c)[_0xb424('0x2a')](_0x8ab4d1);};}exports[_0xb424('0x2b')]=function(_0x48f10f,_0x35e3c7){var _0x5338ef={},_0x33612f={},_0x133790={'count':0x0,'rows':[]};var _0x3e11a3=_['map'](db[_0xb424('0x2c')][_0xb424('0x2d')],function(_0x5b39f5){return{'name':_0x5b39f5['fieldName'],'type':_0x5b39f5['type'][_0xb424('0x2e')]};});_0x33612f[_0xb424('0x2f')]=_[_0xb424('0x30')](_0x3e11a3,_0xb424('0x29'));_0x33612f[_0xb424('0x31')]=_['keys'](_0x48f10f['query']);_0x33612f[_0xb424('0x32')]=_[_0xb424('0x33')](_0x33612f['model'],_0x33612f[_0xb424('0x31')]);_0x5338ef[_0xb424('0x34')]=_['intersection'](_0x33612f['model'],qs['fields'](_0x48f10f[_0xb424('0x31')][_0xb424('0x35')]));_0x5338ef[_0xb424('0x34')]=_0x5338ef['attributes'][_0xb424('0x36')]?_0x5338ef[_0xb424('0x34')]:_0x33612f[_0xb424('0x2f')];if(!_0x48f10f['query'][_0xb424('0x37')](_0xb424('0x38'))){_0x5338ef[_0xb424('0x1b')]=qs[_0xb424('0x1b')](_0x48f10f[_0xb424('0x31')]['limit']);_0x5338ef[_0xb424('0x1c')]=qs[_0xb424('0x1c')](_0x48f10f['query']['offset']);}_0x5338ef['order']=qs['sort'](_0x48f10f[_0xb424('0x31')][_0xb424('0x39')]);_0x5338ef[_0xb424('0x3a')]=qs['filters'](_['pick'](_0x48f10f['query'],_0x33612f['filters']),_0x3e11a3);if(_0x48f10f[_0xb424('0x31')][_0xb424('0x3b')]){_0x5338ef[_0xb424('0x3a')]=_[_0xb424('0x3c')](_0x5338ef[_0xb424('0x3a')],{'$or':_[_0xb424('0x30')](_0x3e11a3,function(_0x2d2356){if(_0x2d2356[_0xb424('0x3d')]!=='VIRTUAL'){var _0x5cf1b5={};_0x5cf1b5[_0x2d2356[_0xb424('0x29')]]={'$like':'%'+_0x48f10f[_0xb424('0x31')][_0xb424('0x3b')]+'%'};return _0x5cf1b5;}})});}_0x5338ef=_[_0xb424('0x3c')]({},_0x5338ef,_0x48f10f[_0xb424('0x3e')]);var _0x13d956={'where':_0x5338ef[_0xb424('0x3a')]};return db[_0xb424('0x2c')][_0xb424('0x3f')](_0x13d956)[_0xb424('0x24')](function(_0x57132a){_0x133790[_0xb424('0x3f')]=_0x57132a;if(_0x48f10f[_0xb424('0x31')][_0xb424('0x40')]){_0x5338ef['include']=[{'all':!![]}];}return db[_0xb424('0x2c')][_0xb424('0x41')](_0x5338ef);})['then'](function(_0x251569){_0x133790[_0xb424('0x42')]=_0x251569;return _0x133790;})[_0xb424('0x24')](respondWithFilteredResult(_0x35e3c7,_0x5338ef))['catch'](handleError(_0x35e3c7,null));};exports[_0xb424('0x43')]=function(_0x5ef1f0,_0x89cf90){var _0x299d57={'raw':!![],'where':{'id':_0x5ef1f0['params']['id']}},_0x529d43={};_0x529d43[_0xb424('0x2f')]=_[_0xb424('0x44')](db['ServicenowField'][_0xb424('0x2d')]);_0x529d43[_0xb424('0x31')]=_[_0xb424('0x44')](_0x5ef1f0[_0xb424('0x31')]);_0x529d43[_0xb424('0x32')]=_[_0xb424('0x33')](_0x529d43[_0xb424('0x2f')],_0x529d43[_0xb424('0x31')]);_0x299d57[_0xb424('0x34')]=_[_0xb424('0x33')](_0x529d43['model'],qs[_0xb424('0x35')](_0x5ef1f0[_0xb424('0x31')]['fields']));_0x299d57[_0xb424('0x34')]=_0x299d57[_0xb424('0x34')][_0xb424('0x36')]?_0x299d57[_0xb424('0x34')]:_0x529d43['model'];if(_0x5ef1f0[_0xb424('0x31')][_0xb424('0x40')]){_0x299d57[_0xb424('0x45')]=[{'all':!![]}];}_0x299d57=_[_0xb424('0x3c')]({},_0x299d57,_0x5ef1f0['options']);return db[_0xb424('0x2c')][_0xb424('0x46')](_0x299d57)['then'](handleEntityNotFound(_0x89cf90,null))[_0xb424('0x24')](respondWithResult(_0x89cf90,null))[_0xb424('0x47')](handleError(_0x89cf90,null));};exports['create']=function(_0x3cec66,_0x112752){return db[_0xb424('0x2c')][_0xb424('0x48')](_0x3cec66[_0xb424('0x49')],{})[_0xb424('0x24')](respondWithResult(_0x112752,0xc9))[_0xb424('0x47')](handleError(_0x112752,null));};exports[_0xb424('0x23')]=function(_0x22b5fb,_0x34cad3){if(_0x22b5fb[_0xb424('0x49')]['id']){delete _0x22b5fb[_0xb424('0x49')]['id'];}return db['ServicenowField'][_0xb424('0x46')]({'where':{'id':_0x22b5fb[_0xb424('0x4a')]['id']}})[_0xb424('0x24')](handleEntityNotFound(_0x34cad3,null))[_0xb424('0x24')](saveUpdates(_0x22b5fb[_0xb424('0x49')],null))[_0xb424('0x24')](respondWithResult(_0x34cad3,null))[_0xb424('0x47')](handleError(_0x34cad3,null));};exports[_0xb424('0x25')]=function(_0x2bcfaf,_0x4b8c51){return db[_0xb424('0x2c')][_0xb424('0x46')]({'where':{'id':_0x2bcfaf['params']['id']}})[_0xb424('0x24')](handleEntityNotFound(_0x4b8c51,null))[_0xb424('0x24')](removeEntity(_0x4b8c51,null))[_0xb424('0x47')](handleError(_0x4b8c51,null));}; \ No newline at end of file +var _0x3447=['hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','catch','params','keys','options','create','body','update','find','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','apply','reject','save','then','destroy','error','stack','name','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x20f214,_0x4b02b7){var _0x5e7db5=function(_0xf2798b){while(--_0xf2798b){_0x20f214['push'](_0x20f214['shift']());}};_0x5e7db5(++_0x4b02b7);}(_0x3447,0xa1));var _0x7344=function(_0x12309b,_0x59dd8c){_0x12309b=_0x12309b-0x0;var _0x482e4d=_0x3447[_0x12309b];return _0x482e4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7344('0x0'));var rp=require(_0x7344('0x1'));var moment=require(_0x7344('0x2'));var BPromise=require(_0x7344('0x3'));var Mustache=require(_0x7344('0x4'));var util=require(_0x7344('0x5'));var path=require(_0x7344('0x6'));var sox=require(_0x7344('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7344('0x8'));var _=require(_0x7344('0x9'));var squel=require('squel');var crypto=require(_0x7344('0xa'));var jsforce=require(_0x7344('0xb'));var deskjs=require(_0x7344('0xc'));var toCsv=require(_0x7344('0xd'));var querystring=require(_0x7344('0xe'));var Papa=require('papaparse');var Redis=require(_0x7344('0xf'));var authService=require(_0x7344('0x10'));var qs=require(_0x7344('0x11'));var as=require(_0x7344('0x12'));var hardwareService=require(_0x7344('0x13'));var logger=require(_0x7344('0x14'))('api');var utils=require(_0x7344('0x15'));var config=require(_0x7344('0x16'));var licenseUtil=require(_0x7344('0x17'));var db=require(_0x7344('0x18'))['db'];function respondWithStatusCode(_0x548201,_0x54fbd1){_0x54fbd1=_0x54fbd1||0xcc;return function(_0x56740b){if(_0x56740b){return _0x548201[_0x7344('0x19')](_0x54fbd1);}return _0x548201[_0x7344('0x1a')](_0x54fbd1)[_0x7344('0x1b')]();};}function respondWithResult(_0x43b511,_0x4cbee3){_0x4cbee3=_0x4cbee3||0xc8;return function(_0x47cf2c){if(_0x47cf2c){return _0x43b511[_0x7344('0x1a')](_0x4cbee3)[_0x7344('0x1c')](_0x47cf2c);}};}function respondWithFilteredResult(_0xc088fd,_0x25b96f){return function(_0xebd5a5){if(_0xebd5a5){var _0x353521=typeof _0x25b96f['offset']==='undefined'&&typeof _0x25b96f['limit']===_0x7344('0x1d');var _0x5dde39=_0xebd5a5['count'];var _0x168ac7=_0x353521?0x0:_0x25b96f[_0x7344('0x1e')];var _0x5bc948=_0x353521?_0xebd5a5[_0x7344('0x1f')]:_0x25b96f[_0x7344('0x1e')]+_0x25b96f[_0x7344('0x20')];var _0x2b3dd2;if(_0x5bc948>=_0x5dde39){_0x5bc948=_0x5dde39;_0x2b3dd2=0xc8;}else{_0x2b3dd2=0xce;}_0xc088fd['status'](_0x2b3dd2);return _0xc088fd[_0x7344('0x21')]('Content-Range',_0x168ac7+'-'+_0x5bc948+'/'+_0x5dde39)[_0x7344('0x1c')](_0xebd5a5);}return null;};}function patchUpdates(_0x46b002){return function(_0xbd091){try{jsonpatch[_0x7344('0x22')](_0xbd091,_0x46b002,!![]);}catch(_0x2b0e08){return BPromise[_0x7344('0x23')](_0x2b0e08);}return _0xbd091[_0x7344('0x24')]();};}function saveUpdates(_0x576247,_0x3e4532){return function(_0x46f08b){if(_0x46f08b){return _0x46f08b['update'](_0x576247)[_0x7344('0x25')](function(_0x1fd222){return _0x1fd222;});}return null;};}function removeEntity(_0x386cfb,_0x3dbc78){return function(_0x53be86){if(_0x53be86){return _0x53be86[_0x7344('0x26')]()[_0x7344('0x25')](function(){_0x386cfb[_0x7344('0x1a')](0xcc)[_0x7344('0x1b')]();});}};}function handleEntityNotFound(_0x1096bb,_0x5ed8c3){return function(_0x2b09d8){if(!_0x2b09d8){_0x1096bb[_0x7344('0x19')](0x194);}return _0x2b09d8;};}function handleError(_0x334d22,_0x57cb28){_0x57cb28=_0x57cb28||0x1f4;return function(_0x7b357a){logger[_0x7344('0x27')](_0x7b357a[_0x7344('0x28')]);if(_0x7b357a[_0x7344('0x29')]){delete _0x7b357a['name'];}_0x334d22[_0x7344('0x1a')](_0x57cb28)['send'](_0x7b357a);};}exports['index']=function(_0x433146,_0x586d72){var _0x21e52f={},_0x1fdb58={},_0x5be5d2={'count':0x0,'rows':[]};var _0x271764=_[_0x7344('0x2a')](db[_0x7344('0x2b')][_0x7344('0x2c')],function(_0x3f6a15){return{'name':_0x3f6a15[_0x7344('0x2d')],'type':_0x3f6a15[_0x7344('0x2e')][_0x7344('0x2f')]};});_0x1fdb58[_0x7344('0x30')]=_[_0x7344('0x2a')](_0x271764,_0x7344('0x29'));_0x1fdb58[_0x7344('0x31')]=_['keys'](_0x433146[_0x7344('0x31')]);_0x1fdb58[_0x7344('0x32')]=_[_0x7344('0x33')](_0x1fdb58[_0x7344('0x30')],_0x1fdb58['query']);_0x21e52f[_0x7344('0x34')]=_[_0x7344('0x33')](_0x1fdb58['model'],qs[_0x7344('0x35')](_0x433146[_0x7344('0x31')]['fields']));_0x21e52f[_0x7344('0x34')]=_0x21e52f[_0x7344('0x34')][_0x7344('0x36')]?_0x21e52f[_0x7344('0x34')]:_0x1fdb58[_0x7344('0x30')];if(!_0x433146['query'][_0x7344('0x37')](_0x7344('0x38'))){_0x21e52f['limit']=qs[_0x7344('0x20')](_0x433146[_0x7344('0x31')][_0x7344('0x20')]);_0x21e52f[_0x7344('0x1e')]=qs['offset'](_0x433146[_0x7344('0x31')][_0x7344('0x1e')]);}_0x21e52f[_0x7344('0x39')]=qs['sort'](_0x433146[_0x7344('0x31')][_0x7344('0x3a')]);_0x21e52f[_0x7344('0x3b')]=qs[_0x7344('0x32')](_['pick'](_0x433146[_0x7344('0x31')],_0x1fdb58[_0x7344('0x32')]),_0x271764);if(_0x433146['query'][_0x7344('0x3c')]){_0x21e52f[_0x7344('0x3b')]=_[_0x7344('0x3d')](_0x21e52f[_0x7344('0x3b')],{'$or':_[_0x7344('0x2a')](_0x271764,function(_0x38153f){if(_0x38153f[_0x7344('0x2e')]!=='VIRTUAL'){var _0x91902a={};_0x91902a[_0x38153f['name']]={'$like':'%'+_0x433146[_0x7344('0x31')][_0x7344('0x3c')]+'%'};return _0x91902a;}})});}_0x21e52f=_[_0x7344('0x3d')]({},_0x21e52f,_0x433146['options']);var _0x104d07={'where':_0x21e52f[_0x7344('0x3b')]};return db[_0x7344('0x2b')][_0x7344('0x1f')](_0x104d07)[_0x7344('0x25')](function(_0x32cced){_0x5be5d2[_0x7344('0x1f')]=_0x32cced;if(_0x433146[_0x7344('0x31')][_0x7344('0x3e')]){_0x21e52f[_0x7344('0x3f')]=[{'all':!![]}];}return db[_0x7344('0x2b')]['findAll'](_0x21e52f);})[_0x7344('0x25')](function(_0x1c8747){_0x5be5d2['rows']=_0x1c8747;return _0x5be5d2;})['then'](respondWithFilteredResult(_0x586d72,_0x21e52f))[_0x7344('0x40')](handleError(_0x586d72,null));};exports['show']=function(_0x72a608,_0x1ea452){var _0x59a19c={'raw':!![],'where':{'id':_0x72a608[_0x7344('0x41')]['id']}},_0x2b3161={};_0x2b3161['model']=_[_0x7344('0x42')](db[_0x7344('0x2b')][_0x7344('0x2c')]);_0x2b3161['query']=_[_0x7344('0x42')](_0x72a608[_0x7344('0x31')]);_0x2b3161[_0x7344('0x32')]=_[_0x7344('0x33')](_0x2b3161[_0x7344('0x30')],_0x2b3161['query']);_0x59a19c[_0x7344('0x34')]=_[_0x7344('0x33')](_0x2b3161[_0x7344('0x30')],qs[_0x7344('0x35')](_0x72a608['query'][_0x7344('0x35')]));_0x59a19c[_0x7344('0x34')]=_0x59a19c[_0x7344('0x34')][_0x7344('0x36')]?_0x59a19c[_0x7344('0x34')]:_0x2b3161['model'];if(_0x72a608[_0x7344('0x31')]['includeAll']){_0x59a19c[_0x7344('0x3f')]=[{'all':!![]}];}_0x59a19c=_[_0x7344('0x3d')]({},_0x59a19c,_0x72a608[_0x7344('0x43')]);return db[_0x7344('0x2b')]['find'](_0x59a19c)['then'](handleEntityNotFound(_0x1ea452,null))[_0x7344('0x25')](respondWithResult(_0x1ea452,null))[_0x7344('0x40')](handleError(_0x1ea452,null));};exports[_0x7344('0x44')]=function(_0x2e3923,_0xb90516){return db[_0x7344('0x2b')][_0x7344('0x44')](_0x2e3923[_0x7344('0x45')],{})['then'](respondWithResult(_0xb90516,0xc9))[_0x7344('0x40')](handleError(_0xb90516,null));};exports[_0x7344('0x46')]=function(_0x5d717a,_0x39e6c8){if(_0x5d717a[_0x7344('0x45')]['id']){delete _0x5d717a['body']['id'];}return db['ServicenowField'][_0x7344('0x47')]({'where':{'id':_0x5d717a[_0x7344('0x41')]['id']}})[_0x7344('0x25')](handleEntityNotFound(_0x39e6c8,null))[_0x7344('0x25')](saveUpdates(_0x5d717a[_0x7344('0x45')],null))['then'](respondWithResult(_0x39e6c8,null))[_0x7344('0x40')](handleError(_0x39e6c8,null));};exports['destroy']=function(_0x561cdd,_0x48ac22){return db['ServicenowField'][_0x7344('0x47')]({'where':{'id':_0x561cdd[_0x7344('0x41')]['id']}})[_0x7344('0x25')](handleEntityNotFound(_0x48ac22,null))['then'](removeEntity(_0x48ac22,null))[_0x7344('0x40')](handleError(_0x48ac22,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index d189740..2858ad9 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 _0xc215=['ServicenowField','servicenow_unique_index','lodash','../../config/logger','api','moment','rimraf','./intServicenowField.attributes','exports'];(function(_0x4def89,_0x2319f3){var _0x3e8bd6=function(_0x5f54ca){while(--_0x5f54ca){_0x4def89['push'](_0x4def89['shift']());}};_0x3e8bd6(++_0x2319f3);}(_0xc215,0x1d6));var _0x5c21=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc215[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x5c21('0x0'));var util=require('util');var logger=require(_0x5c21('0x1'))(_0x5c21('0x2'));var moment=require(_0x5c21('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5c21('0x4'));var config=require('../../config/environment');var attributes=require(_0x5c21('0x5'));module[_0x5c21('0x6')]=function(_0x33b07b,_0x18bc32){return _0x33b07b['define'](_0x5c21('0x7'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x5c21('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa116=['idField','FieldId','lodash','util','api','request-promise','path','rimraf','../../config/environment','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x2a1185,_0x2740c5){var _0x5588d9=function(_0x16024c){while(--_0x16024c){_0x2a1185['push'](_0x2a1185['shift']());}};_0x5588d9(++_0x2740c5);}(_0xa116,0x152));var _0x6a11=function(_0x446b59,_0x31eb4d){_0x446b59=_0x446b59-0x0;var _0xa27477=_0xa116[_0x446b59];return _0xa27477;};'use strict';var _=require(_0x6a11('0x0'));var util=require(_0x6a11('0x1'));var logger=require('../../config/logger')(_0x6a11('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a11('0x3'));var fs=require('fs');var path=require(_0x6a11('0x4'));var rimraf=require(_0x6a11('0x5'));var config=require(_0x6a11('0x6'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x3f4948,_0x4cfa27){return _0x3f4948['define'](_0x6a11('0x7'),attributes,{'tableName':_0x6a11('0x8'),'paranoid':![],'indexes':[{'name':_0x6a11('0x9'),'fields':[_0x6a11('0xa'),_0x6a11('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 4e89243..cc81982 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 _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x992741,_0x1e0763){var _0x25942c=function(_0x2ffc8d){while(--_0x2ffc8d){_0x992741['push'](_0x992741['shift']());}};_0x25942c(++_0x1e0763);}(_0x70e0,0x17b));var _0x070e=function(_0x2cae76,_0x17ae3f){_0x2cae76=_0x2cae76-0x0;var _0x5ee036=_0x70e0[_0x2cae76];return _0x5ee036;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac4a,0x13f));var _0xaac4=function(_0x41319d,_0x2bcdeb){_0x41319d=_0x41319d-0x0;var _0x2c3b07=_0xac4a[_0x41319d];return _0x2c3b07;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 6e4edec..e5319be 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(_0x7845e2,_0x37afe4){var _0x116ada=function(_0x2cceed){while(--_0x2cceed){_0x7845e2['push'](_0x7845e2['shift']());}};_0x116ada(++_0x37afe4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4b18a3,_0x58859e){var _0x2b2e3f=function(_0x1a1d4d){while(--_0x1a1d4d){_0x4b18a3['push'](_0x4b18a3['shift']());}};_0x2b2e3f(++_0x58859e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 41386e9..77f6537 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(_0x5dc5ba,_0x366058){var _0x5a5b2f=function(_0x348023){while(--_0x348023){_0x5dc5ba['push'](_0x5dc5ba['shift']());}};_0x5a5b2f(++_0x366058);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x431795,_0x2755a6){var _0x2d5d11=function(_0x3e9eb2){while(--_0x3e9eb2){_0x431795['push'](_0x431795['shift']());}};_0x2d5d11(++_0x2755a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 3a0fd41..25f2e3c 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 _0x783c=['parent_id','parent_type','direction','password','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','map','SugarcrmAccount','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','findOne','getConfigurations','addConfiguration','AccountId','Subjects','channel','SugarcrmConfiguration','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes'];(function(_0x4ee23e,_0x523daf){var _0x50a2bf=function(_0x4c6ea1){while(--_0x4c6ea1){_0x4ee23e['push'](_0x4ee23e['shift']());}};_0x50a2bf(++_0x523daf);}(_0x783c,0x94));var _0xc783=function(_0x14c2ce,_0x2cb5f4){_0x14c2ce=_0x14c2ce-0x0;var _0xec8055=_0x783c[_0x14c2ce];return _0xec8055;};'use strict';var emlformat=require(_0xc783('0x0'));var rimraf=require(_0xc783('0x1'));var zipdir=require(_0xc783('0x2'));var jsonpatch=require(_0xc783('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc783('0x4'));var Mustache=require('mustache');var util=require(_0xc783('0x5'));var path=require(_0xc783('0x6'));var sox=require(_0xc783('0x7'));var csv=require('to-csv');var ejs=require(_0xc783('0x8'));var fs=require('fs');var fs_extra=require(_0xc783('0x9'));var _=require(_0xc783('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc783('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc783('0xc'));var Papa=require(_0xc783('0xd'));var Redis=require(_0xc783('0xe'));var authService=require(_0xc783('0xf'));var qs=require(_0xc783('0x10'));var as=require(_0xc783('0x11'));var hardwareService=require(_0xc783('0x12'));var logger=require(_0xc783('0x13'))(_0xc783('0x14'));var utils=require(_0xc783('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc783('0x16'));function respondWithStatusCode(_0x721324,_0x8b6ce0){_0x8b6ce0=_0x8b6ce0||0xcc;return function(_0x2915c2){if(_0x2915c2){return _0x721324[_0xc783('0x17')](_0x8b6ce0);}return _0x721324[_0xc783('0x18')](_0x8b6ce0)[_0xc783('0x19')]();};}function respondWithResult(_0x53fc7d,_0x4a473a){_0x4a473a=_0x4a473a||0xc8;return function(_0x4f4651){if(_0x4f4651){return _0x53fc7d[_0xc783('0x18')](_0x4a473a)['json'](_0x4f4651);}};}function respondWithFilteredResult(_0x3da57e,_0x2cbb40){return function(_0x3feabb){if(_0x3feabb){var _0x5dee7d=typeof _0x2cbb40[_0xc783('0x1a')]===_0xc783('0x1b')&&typeof _0x2cbb40[_0xc783('0x1c')]===_0xc783('0x1b');var _0x4c837a=_0x3feabb[_0xc783('0x1d')];var _0x4c15d2=_0x5dee7d?0x0:_0x2cbb40['offset'];var _0x234888=_0x5dee7d?_0x3feabb[_0xc783('0x1d')]:_0x2cbb40[_0xc783('0x1a')]+_0x2cbb40[_0xc783('0x1c')];var _0x3ea580;if(_0x234888>=_0x4c837a){_0x234888=_0x4c837a;_0x3ea580=0xc8;}else{_0x3ea580=0xce;}_0x3da57e[_0xc783('0x18')](_0x3ea580);return _0x3da57e[_0xc783('0x1e')](_0xc783('0x1f'),_0x4c15d2+'-'+_0x234888+'/'+_0x4c837a)[_0xc783('0x20')](_0x3feabb);}return null;};}function patchUpdates(_0x5954e6){return function(_0x5a80b5){try{jsonpatch[_0xc783('0x21')](_0x5a80b5,_0x5954e6,!![]);}catch(_0x459c59){return BPromise[_0xc783('0x22')](_0x459c59);}return _0x5a80b5['save']();};}function saveUpdates(_0x21ddf6,_0x54d6d8){return function(_0x53bfc8){if(_0x53bfc8){return _0x53bfc8[_0xc783('0x23')](_0x21ddf6)[_0xc783('0x24')](function(_0x2b4da8){return _0x2b4da8;});}return null;};}function removeEntity(_0xb16aa,_0x4a890b){return function(_0x5b6dba){if(_0x5b6dba){return _0x5b6dba[_0xc783('0x25')]()[_0xc783('0x24')](function(){_0xb16aa[_0xc783('0x18')](0xcc)[_0xc783('0x19')]();});}};}function handleEntityNotFound(_0x57bba7,_0x4caf99){return function(_0x1d375b){if(!_0x1d375b){_0x57bba7[_0xc783('0x17')](0x194);}return _0x1d375b;};}function handleError(_0x745de1,_0x3252be){_0x3252be=_0x3252be||0x1f4;return function(_0x1ff2a4){logger['error'](_0x1ff2a4[_0xc783('0x26')]);if(_0x1ff2a4[_0xc783('0x27')]){delete _0x1ff2a4[_0xc783('0x27')];}_0x745de1[_0xc783('0x18')](_0x3252be)[_0xc783('0x28')](_0x1ff2a4);};}exports['index']=function(_0x2cc9ca,_0x2ad487){var _0x2705bc={},_0x1a4027={},_0x3173bc={'count':0x0,'rows':[]};var _0xb01263=_[_0xc783('0x29')](db[_0xc783('0x2a')]['rawAttributes'],function(_0x10196f){return{'name':_0x10196f['fieldName'],'type':_0x10196f['type'][_0xc783('0x2b')]};});_0x1a4027['model']=_[_0xc783('0x29')](_0xb01263,_0xc783('0x27'));_0x1a4027[_0xc783('0x2c')]=_[_0xc783('0x2d')](_0x2cc9ca[_0xc783('0x2c')]);_0x1a4027[_0xc783('0x2e')]=_['intersection'](_0x1a4027[_0xc783('0x2f')],_0x1a4027[_0xc783('0x2c')]);_0x2705bc[_0xc783('0x30')]=_[_0xc783('0x31')](_0x1a4027['model'],qs[_0xc783('0x32')](_0x2cc9ca['query'][_0xc783('0x32')]));_0x2705bc[_0xc783('0x30')]=_0x2705bc['attributes'][_0xc783('0x33')]?_0x2705bc[_0xc783('0x30')]:_0x1a4027[_0xc783('0x2f')];if(!_0x2cc9ca['query'][_0xc783('0x34')](_0xc783('0x35'))){_0x2705bc[_0xc783('0x1c')]=qs['limit'](_0x2cc9ca[_0xc783('0x2c')][_0xc783('0x1c')]);_0x2705bc['offset']=qs['offset'](_0x2cc9ca[_0xc783('0x2c')][_0xc783('0x1a')]);}_0x2705bc[_0xc783('0x36')]=qs['sort'](_0x2cc9ca[_0xc783('0x2c')][_0xc783('0x37')]);_0x2705bc[_0xc783('0x38')]=qs[_0xc783('0x2e')](_[_0xc783('0x39')](_0x2cc9ca['query'],_0x1a4027['filters']),_0xb01263);if(_0x2cc9ca['query'][_0xc783('0x3a')]){_0x2705bc[_0xc783('0x38')]=_[_0xc783('0x3b')](_0x2705bc[_0xc783('0x38')],{'$or':_[_0xc783('0x29')](_0xb01263,function(_0x42e9b6){if(_0x42e9b6[_0xc783('0x3c')]!=='VIRTUAL'){var _0x28a64e={};_0x28a64e[_0x42e9b6[_0xc783('0x27')]]={'$like':'%'+_0x2cc9ca[_0xc783('0x2c')][_0xc783('0x3a')]+'%'};return _0x28a64e;}})});}_0x2705bc=_[_0xc783('0x3b')]({},_0x2705bc,_0x2cc9ca[_0xc783('0x3d')]);var _0x593b2f={'where':_0x2705bc[_0xc783('0x38')]};return db[_0xc783('0x2a')][_0xc783('0x1d')](_0x593b2f)[_0xc783('0x24')](function(_0x4799ee){_0x3173bc['count']=_0x4799ee;if(_0x2cc9ca[_0xc783('0x2c')][_0xc783('0x3e')]){_0x2705bc[_0xc783('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xc783('0x40')](_0x2705bc);})[_0xc783('0x24')](function(_0x1028e8){_0x3173bc[_0xc783('0x41')]=_0x1028e8;return _0x3173bc;})[_0xc783('0x24')](respondWithFilteredResult(_0x2ad487,_0x2705bc))[_0xc783('0x42')](handleError(_0x2ad487,null));};exports['show']=function(_0x25dc06,_0x52bf10){var _0x79f9b2={'raw':![],'where':{'id':_0x25dc06[_0xc783('0x43')]['id']}},_0x220b35={};_0x220b35[_0xc783('0x2f')]=_[_0xc783('0x2d')](db[_0xc783('0x2a')][_0xc783('0x44')]);_0x220b35['query']=_[_0xc783('0x2d')](_0x25dc06[_0xc783('0x2c')]);_0x220b35['filters']=_[_0xc783('0x31')](_0x220b35[_0xc783('0x2f')],_0x220b35[_0xc783('0x2c')]);_0x79f9b2['attributes']=_[_0xc783('0x31')](_0x220b35[_0xc783('0x2f')],qs[_0xc783('0x32')](_0x25dc06[_0xc783('0x2c')][_0xc783('0x32')]));_0x79f9b2[_0xc783('0x30')]=_0x79f9b2[_0xc783('0x30')][_0xc783('0x33')]?_0x79f9b2['attributes']:_0x220b35[_0xc783('0x2f')];if(_0x25dc06[_0xc783('0x2c')]['includeAll']){_0x79f9b2['include']=[{'all':!![]}];}_0x79f9b2=_[_0xc783('0x3b')]({},_0x79f9b2,_0x25dc06['options']);return db[_0xc783('0x2a')][_0xc783('0x45')](_0x79f9b2)['then'](handleEntityNotFound(_0x52bf10,null))[_0xc783('0x24')](respondWithResult(_0x52bf10,null))[_0xc783('0x42')](handleError(_0x52bf10,null));};exports[_0xc783('0x46')]=function(_0x4a682c,_0x4c278a){return db[_0xc783('0x2a')][_0xc783('0x46')](_0x4a682c[_0xc783('0x47')],{})[_0xc783('0x24')](respondWithResult(_0x4c278a,0xc9))['catch'](handleError(_0x4c278a,null));};exports[_0xc783('0x23')]=function(_0x273393,_0x38345f){if(_0x273393[_0xc783('0x47')]['id']){delete _0x273393[_0xc783('0x47')]['id'];}return db[_0xc783('0x2a')]['find']({'where':{'id':_0x273393[_0xc783('0x43')]['id']}})[_0xc783('0x24')](handleEntityNotFound(_0x38345f,null))[_0xc783('0x24')](saveUpdates(_0x273393[_0xc783('0x47')],null))['then'](respondWithResult(_0x38345f,null))['catch'](handleError(_0x38345f,null));};exports[_0xc783('0x25')]=function(_0x55051c,_0x2adc61){return db[_0xc783('0x2a')][_0xc783('0x45')]({'where':{'id':_0x55051c[_0xc783('0x43')]['id']}})[_0xc783('0x24')](handleEntityNotFound(_0x2adc61,null))[_0xc783('0x24')](removeEntity(_0x2adc61,null))['catch'](handleError(_0x2adc61,null));};exports['getConfigurations']=function(_0x212ac3,_0x157983,_0x1e0d8a){var _0x502d25={};var _0x192843={};var _0x52ed2f;var _0x4b56f9;return db[_0xc783('0x2a')][_0xc783('0x48')]({'where':{'id':_0x212ac3[_0xc783('0x43')]['id']}})[_0xc783('0x24')](handleEntityNotFound(_0x157983,null))['then'](function(_0x45284a){if(_0x45284a){_0x52ed2f=_0x45284a;_0x192843['model']=_[_0xc783('0x2d')](db['SugarcrmConfiguration'][_0xc783('0x44')]);_0x192843['query']=_[_0xc783('0x2d')](_0x212ac3[_0xc783('0x2c')]);_0x192843['filters']=_['intersection'](_0x192843['model'],_0x192843[_0xc783('0x2c')]);_0x502d25[_0xc783('0x30')]=_[_0xc783('0x31')](_0x192843[_0xc783('0x2f')],qs[_0xc783('0x32')](_0x212ac3[_0xc783('0x2c')][_0xc783('0x32')]));_0x502d25['attributes']=_0x502d25['attributes']['length']?_0x502d25[_0xc783('0x30')]:_0x192843['model'];_0x502d25[_0xc783('0x36')]=qs['sort'](_0x212ac3[_0xc783('0x2c')][_0xc783('0x37')]);_0x502d25[_0xc783('0x38')]=qs[_0xc783('0x2e')](_[_0xc783('0x39')](_0x212ac3[_0xc783('0x2c')],_0x192843[_0xc783('0x2e')]));if(_0x212ac3['query'][_0xc783('0x3a')]){_0x502d25[_0xc783('0x38')]=_[_0xc783('0x3b')](_0x502d25[_0xc783('0x38')],{'$or':_[_0xc783('0x29')](_0x502d25['attributes'],function(_0x370196){var _0x2da12f={};_0x2da12f[_0x370196]={'$like':'%'+_0x212ac3[_0xc783('0x2c')][_0xc783('0x3a')]+'%'};return _0x2da12f;})});}_0x502d25=_[_0xc783('0x3b')]({},_0x502d25,_0x212ac3['options']);return _0x52ed2f[_0xc783('0x49')](_0x502d25);}})['then'](function(_0x115255){if(_0x115255){_0x4b56f9=_0x115255[_0xc783('0x33')];if(!_0x212ac3['query']['hasOwnProperty'](_0xc783('0x35'))){_0x502d25['limit']=qs[_0xc783('0x1c')](_0x212ac3['query'][_0xc783('0x1c')]);_0x502d25[_0xc783('0x1a')]=qs[_0xc783('0x1a')](_0x212ac3[_0xc783('0x2c')]['offset']);}return _0x52ed2f[_0xc783('0x49')](_0x502d25);}})[_0xc783('0x24')](function(_0x355b8f){if(_0x355b8f){return _0x355b8f?{'count':_0x4b56f9,'rows':_0x355b8f}:null;}})[_0xc783('0x24')](respondWithResult(_0x157983,null))[_0xc783('0x42')](handleError(_0x157983,null));};exports[_0xc783('0x4a')]=function(_0x44baec,_0x54b6cc,_0x7b6177){if(_0x44baec[_0xc783('0x47')]['id']){delete _0x44baec[_0xc783('0x47')]['id'];}return db[_0xc783('0x2a')][_0xc783('0x48')]({'where':{'id':_0x44baec[_0xc783('0x43')]['id']}})[_0xc783('0x24')](handleEntityNotFound(_0x54b6cc,null))[_0xc783('0x24')](function(_0x519084){if(_0x519084){_0x44baec[_0xc783('0x47')][_0xc783('0x4b')]=_0x519084['id'];_0x44baec[_0xc783('0x47')][_0xc783('0x4c')]=integrations['getSubjects'](_0x44baec[_0xc783('0x47')][_0xc783('0x4d')],_0x44baec[_0xc783('0x47')][_0xc783('0x3c')]);_0x44baec[_0xc783('0x47')]['Descriptions']=integrations['getDescriptions'](_0x44baec['body']['channel'],_0x44baec[_0xc783('0x47')][_0xc783('0x3c')]);return db[_0xc783('0x4e')][_0xc783('0x46')](_0x44baec['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xc783('0x4c')},{'model':db['SugarcrmField'],'as':_0xc783('0x4f')}]});}return null;})[_0xc783('0x24')](respondWithResult(_0x54b6cc,null))[_0xc783('0x42')](handleError(_0x54b6cc,null));};exports[_0xc783('0x50')]=function(_0x4fb2d6,_0x332b9a,_0x3a6948){var _0x521d96='';var _0x35e754=['id',_0xc783('0x27'),_0xc783('0x51'),_0xc783('0x52'),'description',_0xc783('0x53'),_0xc783('0x54'),_0xc783('0x55'),_0xc783('0x56'),_0xc783('0x57'),'parent_name',_0xc783('0x58')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x4fb2d6['params']['id']},'attributes':['id','username',_0xc783('0x59'),'remoteUri']})['then'](handleEntityNotFound(_0x332b9a,null))[_0xc783('0x24')](function(_0x16e667){if(_0x16e667){_0x521d96=_0x16e667['remoteUri'];var _0x164527=_0x521d96[_0xc783('0x5a')](-0x1);if(_0x164527==='/'){_0x521d96=_0x521d96[_0xc783('0x5b')](0x0,_0x521d96['lastIndexOf'](_0x164527));}return rp({'method':_0xc783('0x5c'),'uri':util[_0xc783('0x5d')](_0xc783('0x5e'),_0x521d96,_0xc783('0x5f')),'json':!![],'form':{'method':_0xc783('0x60'),'input_type':_0xc783('0x61'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x16e667[_0xc783('0x62')],'password':_0x16e667['password'],'encryption':_0xc783('0x63')},'application':_0xc783('0x64')})}});}})[_0xc783('0x24')](function(_0x8108a4){if(_0x8108a4&&_0x8108a4[_0xc783('0x27')]!==_0xc783('0x65')&&_0x8108a4['name']!==_0xc783('0x66')){return rp({'method':_0xc783('0x5c'),'uri':util[_0xc783('0x5d')](_0xc783('0x5e'),_0x521d96,_0xc783('0x5f')),'json':!![],'form':{'method':_0xc783('0x67'),'input_type':_0xc783('0x61'),'response_type':_0xc783('0x61'),'rest_data':JSON[_0xc783('0x68')]({'session':_0x8108a4['id'],'module_name':'Calls'})}})[_0xc783('0x24')](function(_0x3770b5){if(_0x3770b5){var _0x2f3247=_[_0xc783('0x69')](_0x3770b5[_0xc783('0x6a')]);_[_0xc783('0x6b')](_0x2f3247,function(_0x456d42){return _0x35e754[_0xc783('0x6c')](_0x456d42[_0xc783('0x27')]);});return{'count':_0x2f3247[_0xc783('0x33')],'rows':_[_0xc783('0x29')](_0x2f3247,function(_0x5a3e18){return{'id':_0x5a3e18[_0xc783('0x27')],'name':_0x5a3e18[_0xc783('0x6d')],'custom':_[_0xc783('0x6e')](_0x5a3e18['name'],'_c')?!![]:![],'options':_0x5a3e18[_0xc783('0x3d')]?_[_0xc783('0x29')](_['values'](_0x5a3e18['options']),function(_0x361572){return{'name':_0x361572[_0xc783('0x6f')],'value':_0x361572[_0xc783('0x27')]};}):[]};})};}})[_0xc783('0x24')](respondWithResult(_0x332b9a,null))[_0xc783('0x42')](function(_0x57613a){var _0x1364d0=_0x4fb2d6['query'][_0xc783('0x70')]?0x1f4:_0x57613a[_0xc783('0x71')]||0x1f4;logger[_0xc783('0x72')](_0xc783('0x73'),_0xc783('0x50'),_0x1364d0,JSON[_0xc783('0x68')](_0x57613a));delete _0x57613a[_0xc783('0x27')];if(_0x1364d0===0x191){_0x1364d0=0x190;}_0x332b9a[_0xc783('0x18')](_0x1364d0)[_0xc783('0x28')](_0x4fb2d6['query']['test']?{'message':_0xc783('0x74'),'statusCode':_0x57613a[_0xc783('0x71')]}:_0x57613a);});}else{var _0x3cf8e9=0x1f4;_0x332b9a[_0xc783('0x18')](_0x3cf8e9)['send']({'message':_0xc783('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x0ade=['end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','name','query','keys','intersection','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','catch','params','fields','find','create','body','findOne','SugarcrmConfiguration','order','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','get_module_fields','stringify','Calls','values','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status'];(function(_0x179cce,_0x239422){var _0x54ac6d=function(_0x21a7f0){while(--_0x21a7f0){_0x179cce['push'](_0x179cce['shift']());}};_0x54ac6d(++_0x239422);}(_0x0ade,0x1bb));var _0xe0ad=function(_0x3729c,_0x1b1faf){_0x3729c=_0x3729c-0x0;var _0x20ce1f=_0x0ade[_0x3729c];return _0x20ce1f;};'use strict';var emlformat=require(_0xe0ad('0x0'));var rimraf=require(_0xe0ad('0x1'));var zipdir=require(_0xe0ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0ad('0x3'));var moment=require(_0xe0ad('0x4'));var BPromise=require(_0xe0ad('0x5'));var Mustache=require('mustache');var util=require(_0xe0ad('0x6'));var path=require(_0xe0ad('0x7'));var sox=require(_0xe0ad('0x8'));var csv=require('to-csv');var ejs=require(_0xe0ad('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0ad('0xa'));var squel=require(_0xe0ad('0xb'));var crypto=require('crypto');var jsforce=require(_0xe0ad('0xc'));var deskjs=require(_0xe0ad('0xd'));var toCsv=require(_0xe0ad('0xe'));var querystring=require(_0xe0ad('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0ad('0x10'));var authService=require(_0xe0ad('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0ad('0x12'))('api');var utils=require(_0xe0ad('0x13'));var config=require(_0xe0ad('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0ad('0x15'))['db'];var integrations=require(_0xe0ad('0x16'));function respondWithStatusCode(_0x5a1735,_0x120534){_0x120534=_0x120534||0xcc;return function(_0x54d3a1){if(_0x54d3a1){return _0x5a1735[_0xe0ad('0x17')](_0x120534);}return _0x5a1735[_0xe0ad('0x18')](_0x120534)[_0xe0ad('0x19')]();};}function respondWithResult(_0x2a3894,_0x4984a9){_0x4984a9=_0x4984a9||0xc8;return function(_0x30aca6){if(_0x30aca6){return _0x2a3894[_0xe0ad('0x18')](_0x4984a9)['json'](_0x30aca6);}};}function respondWithFilteredResult(_0x182d24,_0x5ca517){return function(_0x4b468e){if(_0x4b468e){var _0x3ff728=typeof _0x5ca517[_0xe0ad('0x1a')]===_0xe0ad('0x1b')&&typeof _0x5ca517[_0xe0ad('0x1c')]===_0xe0ad('0x1b');var _0x2b87c4=_0x4b468e[_0xe0ad('0x1d')];var _0x1eeb36=_0x3ff728?0x0:_0x5ca517['offset'];var _0x463012=_0x3ff728?_0x4b468e[_0xe0ad('0x1d')]:_0x5ca517['offset']+_0x5ca517['limit'];var _0xfe51c4;if(_0x463012>=_0x2b87c4){_0x463012=_0x2b87c4;_0xfe51c4=0xc8;}else{_0xfe51c4=0xce;}_0x182d24['status'](_0xfe51c4);return _0x182d24[_0xe0ad('0x1e')](_0xe0ad('0x1f'),_0x1eeb36+'-'+_0x463012+'/'+_0x2b87c4)[_0xe0ad('0x20')](_0x4b468e);}return null;};}function patchUpdates(_0xee7fe2){return function(_0x268128){try{jsonpatch[_0xe0ad('0x21')](_0x268128,_0xee7fe2,!![]);}catch(_0x39703d){return BPromise[_0xe0ad('0x22')](_0x39703d);}return _0x268128['save']();};}function saveUpdates(_0x1e68a6,_0x32696a){return function(_0x28aacb){if(_0x28aacb){return _0x28aacb[_0xe0ad('0x23')](_0x1e68a6)[_0xe0ad('0x24')](function(_0x2125e4){return _0x2125e4;});}return null;};}function removeEntity(_0x5c0ff5,_0x2d95db){return function(_0x3a2768){if(_0x3a2768){return _0x3a2768[_0xe0ad('0x25')]()[_0xe0ad('0x24')](function(){_0x5c0ff5[_0xe0ad('0x18')](0xcc)[_0xe0ad('0x19')]();});}};}function handleEntityNotFound(_0x2eedf2,_0x217ce4){return function(_0x2bb01e){if(!_0x2bb01e){_0x2eedf2[_0xe0ad('0x17')](0x194);}return _0x2bb01e;};}function handleError(_0x4a216e,_0x57d404){_0x57d404=_0x57d404||0x1f4;return function(_0x2d5fec){logger[_0xe0ad('0x26')](_0x2d5fec[_0xe0ad('0x27')]);if(_0x2d5fec['name']){delete _0x2d5fec['name'];}_0x4a216e[_0xe0ad('0x18')](_0x57d404)[_0xe0ad('0x28')](_0x2d5fec);};}exports[_0xe0ad('0x29')]=function(_0x54f087,_0x47f106){var _0x31a99c={},_0x98e80e={},_0x19e809={'count':0x0,'rows':[]};var _0x4b5a6b=_[_0xe0ad('0x2a')](db[_0xe0ad('0x2b')][_0xe0ad('0x2c')],function(_0x3c9ddd){return{'name':_0x3c9ddd['fieldName'],'type':_0x3c9ddd[_0xe0ad('0x2d')][_0xe0ad('0x2e')]};});_0x98e80e[_0xe0ad('0x2f')]=_['map'](_0x4b5a6b,_0xe0ad('0x30'));_0x98e80e[_0xe0ad('0x31')]=_[_0xe0ad('0x32')](_0x54f087[_0xe0ad('0x31')]);_0x98e80e['filters']=_[_0xe0ad('0x33')](_0x98e80e[_0xe0ad('0x2f')],_0x98e80e[_0xe0ad('0x31')]);_0x31a99c[_0xe0ad('0x34')]=_[_0xe0ad('0x33')](_0x98e80e[_0xe0ad('0x2f')],qs['fields'](_0x54f087[_0xe0ad('0x31')]['fields']));_0x31a99c['attributes']=_0x31a99c[_0xe0ad('0x34')][_0xe0ad('0x35')]?_0x31a99c[_0xe0ad('0x34')]:_0x98e80e[_0xe0ad('0x2f')];if(!_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x36')]('nolimit')){_0x31a99c[_0xe0ad('0x1c')]=qs[_0xe0ad('0x1c')](_0x54f087[_0xe0ad('0x31')]['limit']);_0x31a99c['offset']=qs['offset'](_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x1a')]);}_0x31a99c['order']=qs[_0xe0ad('0x37')](_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x37')]);_0x31a99c['where']=qs[_0xe0ad('0x38')](_[_0xe0ad('0x39')](_0x54f087[_0xe0ad('0x31')],_0x98e80e[_0xe0ad('0x38')]),_0x4b5a6b);if(_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x3a')]){_0x31a99c[_0xe0ad('0x3b')]=_['merge'](_0x31a99c[_0xe0ad('0x3b')],{'$or':_[_0xe0ad('0x2a')](_0x4b5a6b,function(_0x260401){if(_0x260401[_0xe0ad('0x2d')]!=='VIRTUAL'){var _0x39309a={};_0x39309a[_0x260401[_0xe0ad('0x30')]]={'$like':'%'+_0x54f087[_0xe0ad('0x31')]['filter']+'%'};return _0x39309a;}})});}_0x31a99c=_[_0xe0ad('0x3c')]({},_0x31a99c,_0x54f087[_0xe0ad('0x3d')]);var _0x5e8cf3={'where':_0x31a99c['where']};return db[_0xe0ad('0x2b')][_0xe0ad('0x1d')](_0x5e8cf3)[_0xe0ad('0x24')](function(_0x4e047b){_0x19e809['count']=_0x4e047b;if(_0x54f087[_0xe0ad('0x31')][_0xe0ad('0x3e')]){_0x31a99c[_0xe0ad('0x3f')]=[{'all':!![]}];}return db[_0xe0ad('0x2b')]['findAll'](_0x31a99c);})[_0xe0ad('0x24')](function(_0x2c3cd9){_0x19e809[_0xe0ad('0x40')]=_0x2c3cd9;return _0x19e809;})[_0xe0ad('0x24')](respondWithFilteredResult(_0x47f106,_0x31a99c))[_0xe0ad('0x41')](handleError(_0x47f106,null));};exports['show']=function(_0x533ca7,_0x3295fc){var _0x27a1de={'raw':![],'where':{'id':_0x533ca7[_0xe0ad('0x42')]['id']}},_0x280b77={};_0x280b77[_0xe0ad('0x2f')]=_[_0xe0ad('0x32')](db[_0xe0ad('0x2b')]['rawAttributes']);_0x280b77[_0xe0ad('0x31')]=_['keys'](_0x533ca7[_0xe0ad('0x31')]);_0x280b77[_0xe0ad('0x38')]=_['intersection'](_0x280b77[_0xe0ad('0x2f')],_0x280b77[_0xe0ad('0x31')]);_0x27a1de[_0xe0ad('0x34')]=_[_0xe0ad('0x33')](_0x280b77[_0xe0ad('0x2f')],qs[_0xe0ad('0x43')](_0x533ca7[_0xe0ad('0x31')][_0xe0ad('0x43')]));_0x27a1de[_0xe0ad('0x34')]=_0x27a1de[_0xe0ad('0x34')][_0xe0ad('0x35')]?_0x27a1de['attributes']:_0x280b77['model'];if(_0x533ca7['query']['includeAll']){_0x27a1de[_0xe0ad('0x3f')]=[{'all':!![]}];}_0x27a1de=_['merge']({},_0x27a1de,_0x533ca7['options']);return db['SugarcrmAccount'][_0xe0ad('0x44')](_0x27a1de)['then'](handleEntityNotFound(_0x3295fc,null))[_0xe0ad('0x24')](respondWithResult(_0x3295fc,null))['catch'](handleError(_0x3295fc,null));};exports[_0xe0ad('0x45')]=function(_0x1368bf,_0x44e031){return db[_0xe0ad('0x2b')][_0xe0ad('0x45')](_0x1368bf[_0xe0ad('0x46')],{})[_0xe0ad('0x24')](respondWithResult(_0x44e031,0xc9))['catch'](handleError(_0x44e031,null));};exports['update']=function(_0x31a6ed,_0x25f4ea){if(_0x31a6ed[_0xe0ad('0x46')]['id']){delete _0x31a6ed[_0xe0ad('0x46')]['id'];}return db[_0xe0ad('0x2b')]['find']({'where':{'id':_0x31a6ed[_0xe0ad('0x42')]['id']}})['then'](handleEntityNotFound(_0x25f4ea,null))['then'](saveUpdates(_0x31a6ed[_0xe0ad('0x46')],null))[_0xe0ad('0x24')](respondWithResult(_0x25f4ea,null))[_0xe0ad('0x41')](handleError(_0x25f4ea,null));};exports['destroy']=function(_0x843db4,_0x51b07f){return db[_0xe0ad('0x2b')][_0xe0ad('0x44')]({'where':{'id':_0x843db4[_0xe0ad('0x42')]['id']}})[_0xe0ad('0x24')](handleEntityNotFound(_0x51b07f,null))[_0xe0ad('0x24')](removeEntity(_0x51b07f,null))[_0xe0ad('0x41')](handleError(_0x51b07f,null));};exports['getConfigurations']=function(_0x2b8b81,_0x233b7c,_0x3ff000){var _0x57b5d1={};var _0x2c7701={};var _0x21559d;var _0x48815c;return db[_0xe0ad('0x2b')][_0xe0ad('0x47')]({'where':{'id':_0x2b8b81[_0xe0ad('0x42')]['id']}})[_0xe0ad('0x24')](handleEntityNotFound(_0x233b7c,null))[_0xe0ad('0x24')](function(_0x13fbdf){if(_0x13fbdf){_0x21559d=_0x13fbdf;_0x2c7701[_0xe0ad('0x2f')]=_[_0xe0ad('0x32')](db[_0xe0ad('0x48')][_0xe0ad('0x2c')]);_0x2c7701['query']=_[_0xe0ad('0x32')](_0x2b8b81['query']);_0x2c7701[_0xe0ad('0x38')]=_[_0xe0ad('0x33')](_0x2c7701[_0xe0ad('0x2f')],_0x2c7701[_0xe0ad('0x31')]);_0x57b5d1[_0xe0ad('0x34')]=_['intersection'](_0x2c7701[_0xe0ad('0x2f')],qs['fields'](_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x43')]));_0x57b5d1[_0xe0ad('0x34')]=_0x57b5d1['attributes'][_0xe0ad('0x35')]?_0x57b5d1[_0xe0ad('0x34')]:_0x2c7701[_0xe0ad('0x2f')];_0x57b5d1[_0xe0ad('0x49')]=qs[_0xe0ad('0x37')](_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x37')]);_0x57b5d1[_0xe0ad('0x3b')]=qs[_0xe0ad('0x38')](_[_0xe0ad('0x39')](_0x2b8b81[_0xe0ad('0x31')],_0x2c7701['filters']));if(_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x3a')]){_0x57b5d1['where']=_[_0xe0ad('0x3c')](_0x57b5d1[_0xe0ad('0x3b')],{'$or':_[_0xe0ad('0x2a')](_0x57b5d1['attributes'],function(_0x16fb08){var _0x319d55={};_0x319d55[_0x16fb08]={'$like':'%'+_0x2b8b81[_0xe0ad('0x31')]['filter']+'%'};return _0x319d55;})});}_0x57b5d1=_[_0xe0ad('0x3c')]({},_0x57b5d1,_0x2b8b81[_0xe0ad('0x3d')]);return _0x21559d[_0xe0ad('0x4a')](_0x57b5d1);}})[_0xe0ad('0x24')](function(_0x1ef310){if(_0x1ef310){_0x48815c=_0x1ef310[_0xe0ad('0x35')];if(!_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x36')](_0xe0ad('0x4b'))){_0x57b5d1[_0xe0ad('0x1c')]=qs[_0xe0ad('0x1c')](_0x2b8b81[_0xe0ad('0x31')]['limit']);_0x57b5d1[_0xe0ad('0x1a')]=qs[_0xe0ad('0x1a')](_0x2b8b81[_0xe0ad('0x31')][_0xe0ad('0x1a')]);}return _0x21559d[_0xe0ad('0x4a')](_0x57b5d1);}})[_0xe0ad('0x24')](function(_0x280774){if(_0x280774){return _0x280774?{'count':_0x48815c,'rows':_0x280774}:null;}})[_0xe0ad('0x24')](respondWithResult(_0x233b7c,null))[_0xe0ad('0x41')](handleError(_0x233b7c,null));};exports['addConfiguration']=function(_0x527854,_0x5a2e22,_0x111fc1){if(_0x527854[_0xe0ad('0x46')]['id']){delete _0x527854[_0xe0ad('0x46')]['id'];}return db['SugarcrmAccount'][_0xe0ad('0x47')]({'where':{'id':_0x527854[_0xe0ad('0x42')]['id']}})[_0xe0ad('0x24')](handleEntityNotFound(_0x5a2e22,null))[_0xe0ad('0x24')](function(_0xb8c9e6){if(_0xb8c9e6){_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4c')]=_0xb8c9e6['id'];_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4d')]=integrations[_0xe0ad('0x4e')](_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4f')],_0x527854[_0xe0ad('0x46')][_0xe0ad('0x2d')]);_0x527854['body']['Descriptions']=integrations[_0xe0ad('0x50')](_0x527854[_0xe0ad('0x46')][_0xe0ad('0x4f')],_0x527854[_0xe0ad('0x46')]['type']);return db['SugarcrmConfiguration']['create'](_0x527854[_0xe0ad('0x46')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xe0ad('0x51')],'as':_0xe0ad('0x52')}]});}return null;})[_0xe0ad('0x24')](respondWithResult(_0x5a2e22,null))[_0xe0ad('0x41')](handleError(_0x5a2e22,null));};exports[_0xe0ad('0x53')]=function(_0x58a6c9,_0x110f4d,_0x15e912){var _0x2fb639='';var _0x31d4bb=['id','name',_0xe0ad('0x54'),_0xe0ad('0x55'),_0xe0ad('0x56'),_0xe0ad('0x57'),_0xe0ad('0x58'),_0xe0ad('0x59'),_0xe0ad('0x5a'),'parent_type','parent_name','direction'];return db['SugarcrmAccount'][_0xe0ad('0x47')]({'where':{'id':_0x58a6c9[_0xe0ad('0x42')]['id']},'attributes':['id',_0xe0ad('0x5b'),_0xe0ad('0x5c'),_0xe0ad('0x5d')]})['then'](handleEntityNotFound(_0x110f4d,null))['then'](function(_0x2f1168){if(_0x2f1168){_0x2fb639=_0x2f1168['remoteUri'];var _0x2c187e=_0x2fb639['slice'](-0x1);if(_0x2c187e==='/'){_0x2fb639=_0x2fb639[_0xe0ad('0x5e')](0x0,_0x2fb639[_0xe0ad('0x5f')](_0x2c187e));}return rp({'method':_0xe0ad('0x60'),'uri':util['format'](_0xe0ad('0x61'),_0x2fb639,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe0ad('0x62'),'input_type':_0xe0ad('0x63'),'response_type':_0xe0ad('0x63'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2f1168['username'],'password':_0x2f1168[_0xe0ad('0x5c')],'encryption':_0xe0ad('0x64')},'application':_0xe0ad('0x65')})}});}})['then'](function(_0x247d08){if(_0x247d08&&_0x247d08['name']!=='Invalid\x20Login'&&_0x247d08[_0xe0ad('0x30')]!==_0xe0ad('0x66')){return rp({'method':'POST','uri':util[_0xe0ad('0x67')](_0xe0ad('0x61'),_0x2fb639,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xe0ad('0x68'),'input_type':_0xe0ad('0x63'),'response_type':_0xe0ad('0x63'),'rest_data':JSON[_0xe0ad('0x69')]({'session':_0x247d08['id'],'module_name':_0xe0ad('0x6a')})}})['then'](function(_0x42205e){if(_0x42205e){var _0x30fe7e=_[_0xe0ad('0x6b')](_0x42205e['module_fields']);_[_0xe0ad('0x6c')](_0x30fe7e,function(_0x2e090d){return _0x31d4bb[_0xe0ad('0x6d')](_0x2e090d['name']);});return{'count':_0x30fe7e[_0xe0ad('0x35')],'rows':_[_0xe0ad('0x2a')](_0x30fe7e,function(_0x39e241){return{'id':_0x39e241['name'],'name':_0x39e241[_0xe0ad('0x6e')],'custom':_[_0xe0ad('0x6f')](_0x39e241[_0xe0ad('0x30')],'_c')?!![]:![],'options':_0x39e241[_0xe0ad('0x3d')]?_['map'](_[_0xe0ad('0x6b')](_0x39e241[_0xe0ad('0x3d')]),function(_0x710353){return{'name':_0x710353[_0xe0ad('0x70')],'value':_0x710353['name']};}):[]};})};}})[_0xe0ad('0x24')](respondWithResult(_0x110f4d,null))[_0xe0ad('0x41')](function(_0x439201){var _0x5db6d9=_0x58a6c9[_0xe0ad('0x31')]['test']?0x1f4:_0x439201[_0xe0ad('0x71')]||0x1f4;logger[_0xe0ad('0x26')](_0xe0ad('0x72'),_0xe0ad('0x53'),_0x5db6d9,JSON['stringify'](_0x439201));delete _0x439201[_0xe0ad('0x30')];if(_0x5db6d9===0x191){_0x5db6d9=0x190;}_0x110f4d[_0xe0ad('0x18')](_0x5db6d9)[_0xe0ad('0x28')](_0x58a6c9[_0xe0ad('0x31')][_0xe0ad('0x73')]?{'message':_0xe0ad('0x74'),'statusCode':_0x439201[_0xe0ad('0x71')]}:_0x439201);});}else{var _0x146172=0x1f4;_0x110f4d[_0xe0ad('0x18')](_0x146172)['send']({'message':_0xe0ad('0x74'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index cf1b479..630d7e4 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 _0xd758=['../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0xd758,0x172));var _0x8d75=function(_0x18a54e,_0xa8b60c){_0x18a54e=_0x18a54e-0x0;var _0x5cd615=_0xd758[_0x18a54e];return _0x5cd615;};'use strict';var _=require(_0x8d75('0x0'));var util=require(_0x8d75('0x1'));var logger=require(_0x8d75('0x2'))(_0x8d75('0x3'));var moment=require(_0x8d75('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d75('0x5'));var rimraf=require(_0x8d75('0x6'));var config=require(_0x8d75('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x8d75('0x8'));module[_0x8d75('0x9')]=function(_0x388960,_0x2c6a33){return _0x388960[_0x8d75('0xa')](_0x8d75('0xb'),attributes,{'tableName':_0x8d75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc35f=['bluebird','request-promise','path','../../config/environment','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api'];(function(_0xb7172a,_0x28ca14){var _0x51911a=function(_0x44b811){while(--_0x44b811){_0xb7172a['push'](_0xb7172a['shift']());}};_0x51911a(++_0x28ca14);}(_0xc35f,0x1ca));var _0xfc35=function(_0x2b2680,_0x3adf49){_0x2b2680=_0x2b2680-0x0;var _0x2d5403=_0xc35f[_0x2b2680];return _0x2d5403;};'use strict';var _=require(_0xfc35('0x0'));var util=require(_0xfc35('0x1'));var logger=require(_0xfc35('0x2'))(_0xfc35('0x3'));var moment=require('moment');var BPromise=require(_0xfc35('0x4'));var rp=require(_0xfc35('0x5'));var fs=require('fs');var path=require(_0xfc35('0x6'));var rimraf=require('rimraf');var config=require(_0xfc35('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xfc35('0x8')]=function(_0x1991a5,_0x4c92db){return _0x1991a5['define'](_0xfc35('0x9'),attributes,{'tableName':_0xfc35('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index f066b92..60047f1 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 _0xfb61=['ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','findAll','options','where','attributes','limit','include','model','GetSugarcrmAccount','stringify','catch','ShowSugarcrmAccount','SugarcrmAccount','raw','map','lodash','util','moment','bluebird','randomstring'];(function(_0xe8da69,_0x593b7b){var _0x556581=function(_0xbc31d1){while(--_0xbc31d1){_0xe8da69['push'](_0xe8da69['shift']());}};_0x556581(++_0x593b7b);}(_0xfb61,0x1a8));var _0x1fb6=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0xfb61[_0x214a25];return _0x405988;};'use strict';var _=require(_0x1fb6('0x0'));var util=require(_0x1fb6('0x1'));var moment=require(_0x1fb6('0x2'));var BPromise=require(_0x1fb6('0x3'));var rs=require(_0x1fb6('0x4'));var fs=require('fs');var Redis=require(_0x1fb6('0x5'));var db=require(_0x1fb6('0x6'))['db'];var utils=require(_0x1fb6('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1fb6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1fb6('0x9')][_0x1fb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b528e,_0x255743,_0x2cc31c){return new BPromise(function(_0x2a5568,_0x9f35cd){return client['request'](_0x1b528e,_0x2cc31c)[_0x1fb6('0xb')](function(_0x154b73){logger[_0x1fb6('0xc')](_0x1fb6('0xd'),_0x255743,_0x1fb6('0xe'));logger[_0x1fb6('0xf')](_0x1fb6('0x10'),_0x255743,_0x1fb6('0xe'),JSON['stringify'](_0x154b73));if(_0x154b73[_0x1fb6('0x11')]){if(_0x154b73[_0x1fb6('0x11')]['code']===0x1f4){logger[_0x1fb6('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x255743,_0x154b73[_0x1fb6('0x11')][_0x1fb6('0x12')]);return _0x9f35cd(_0x154b73[_0x1fb6('0x11')][_0x1fb6('0x12')]);}logger[_0x1fb6('0x11')](_0x1fb6('0xd'),_0x255743,_0x154b73[_0x1fb6('0x11')][_0x1fb6('0x12')]);return _0x2a5568(_0x154b73[_0x1fb6('0x11')][_0x1fb6('0x12')]);}else{logger[_0x1fb6('0xc')](_0x1fb6('0xd'),_0x255743,_0x1fb6('0xe'));_0x2a5568(_0x154b73['result'][_0x1fb6('0x12')]);}})['catch'](function(_0x238332){logger[_0x1fb6('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x255743,_0x238332);_0x9f35cd(_0x238332);});});}exports['GetSugarcrmAccount']=function(_0x4ed0d1){var _0x11480c=this;return new Promise(function(_0x4ce97d,_0x13c8e8){return db['SugarcrmAccount'][_0x1fb6('0x13')]({'raw':_0x4ed0d1[_0x1fb6('0x14')]?_0x4ed0d1['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ed0d1[_0x1fb6('0x14')]?_0x4ed0d1[_0x1fb6('0x14')][_0x1fb6('0x15')]||null:null,'attributes':_0x4ed0d1['options']?_0x4ed0d1[_0x1fb6('0x14')][_0x1fb6('0x16')]||null:null,'limit':_0x4ed0d1[_0x1fb6('0x14')]?_0x4ed0d1[_0x1fb6('0x14')][_0x1fb6('0x17')]||null:null,'include':_0x4ed0d1[_0x1fb6('0x14')]?_0x4ed0d1[_0x1fb6('0x14')][_0x1fb6('0x18')]?_['map'](_0x4ed0d1[_0x1fb6('0x14')][_0x1fb6('0x18')],function(_0x346c6f){return{'model':db[_0x346c6f[_0x1fb6('0x19')]],'as':_0x346c6f['as'],'attributes':_0x346c6f['attributes'],'include':_0x346c6f[_0x1fb6('0x18')]?_['map'](_0x346c6f[_0x1fb6('0x18')],function(_0x40e9e8){return{'model':db[_0x40e9e8[_0x1fb6('0x19')]],'as':_0x40e9e8['as'],'attributes':_0x40e9e8[_0x1fb6('0x16')],'include':_0x40e9e8[_0x1fb6('0x18')]?_['map'](_0x40e9e8[_0x1fb6('0x18')],function(_0x16f236){return{'model':db[_0x16f236['model']],'as':_0x16f236['as'],'attributes':_0x16f236[_0x1fb6('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1fb6('0xb')](function(_0x4bf959){logger[_0x1fb6('0xc')](_0x1fb6('0x1a'),_0x4ed0d1);logger[_0x1fb6('0xf')](_0x1fb6('0x1a'),_0x4ed0d1,JSON[_0x1fb6('0x1b')](_0x4bf959));_0x4ce97d(_0x4bf959);})[_0x1fb6('0x1c')](function(_0x1de203){logger['error']('GetSugarcrmAccount',_0x1de203[_0x1fb6('0x12')],_0x4ed0d1);_0x13c8e8(_0x11480c['error'](0x1f4,_0x1de203[_0x1fb6('0x12')]));});});};exports[_0x1fb6('0x1d')]=function(_0x1352dc){var _0x4aaa71=this;return new Promise(function(_0x42dde9,_0x4341c1){return db[_0x1fb6('0x1e')]['find']({'raw':_0x1352dc[_0x1fb6('0x14')]?_0x1352dc['options'][_0x1fb6('0x1f')]===undefined?!![]:![]:!![],'where':_0x1352dc['options']?_0x1352dc[_0x1fb6('0x14')][_0x1fb6('0x15')]||null:null,'attributes':_0x1352dc[_0x1fb6('0x14')]?_0x1352dc[_0x1fb6('0x14')]['attributes']||null:null,'include':_0x1352dc[_0x1fb6('0x14')]?_0x1352dc[_0x1fb6('0x14')][_0x1fb6('0x18')]?_[_0x1fb6('0x20')](_0x1352dc[_0x1fb6('0x14')]['include'],function(_0xf3034b){return{'model':db[_0xf3034b[_0x1fb6('0x19')]],'as':_0xf3034b['as'],'attributes':_0xf3034b[_0x1fb6('0x16')],'include':_0xf3034b[_0x1fb6('0x18')]?_[_0x1fb6('0x20')](_0xf3034b['include'],function(_0x5f5127){return{'model':db[_0x5f5127[_0x1fb6('0x19')]],'as':_0x5f5127['as'],'attributes':_0x5f5127['attributes'],'include':_0x5f5127['include']?_['map'](_0x5f5127[_0x1fb6('0x18')],function(_0x152bba){return{'model':db[_0x152bba['model']],'as':_0x152bba['as'],'attributes':_0x152bba[_0x1fb6('0x16')]};}):[]};}):[]};}):[]:[]})[_0x1fb6('0xb')](function(_0x4f9779){logger[_0x1fb6('0xc')](_0x1fb6('0x1d'),_0x1352dc);logger[_0x1fb6('0xf')](_0x1fb6('0x1d'),_0x1352dc,JSON[_0x1fb6('0x1b')](_0x4f9779));_0x42dde9(_0x4f9779);})[_0x1fb6('0x1c')](function(_0x23e4b3){logger[_0x1fb6('0x11')](_0x1fb6('0x1d'),_0x23e4b3[_0x1fb6('0x12')],_0x1352dc);_0x4341c1(_0x4aaa71[_0x1fb6('0x11')](0x1f4,_0x23e4b3[_0x1fb6('0x12')]));});});}; \ No newline at end of file +var _0x5b68=['request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','options','raw','where','limit','include','map','model','attributes','GetSugarcrmAccount','stringify','SugarcrmAccount','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x3f93db,_0x1e3f0a){var _0x2900a4=function(_0x3ce657){while(--_0x3ce657){_0x3f93db['push'](_0x3f93db['shift']());}};_0x2900a4(++_0x1e3f0a);}(_0x5b68,0x1d6));var _0x85b6=function(_0x504dee,_0x3cefd3){_0x504dee=_0x504dee-0x0;var _0x3fb6c0=_0x5b68[_0x504dee];return _0x3fb6c0;};'use strict';var _=require(_0x85b6('0x0'));var util=require(_0x85b6('0x1'));var moment=require(_0x85b6('0x2'));var BPromise=require(_0x85b6('0x3'));var rs=require(_0x85b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x85b6('0x5'));var logger=require('../../config/logger')(_0x85b6('0x6'));var config=require(_0x85b6('0x7'));var jayson=require(_0x85b6('0x8'));var client=jayson['client'][_0x85b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22bbc4,_0x440bd3,_0x2d23e6){return new BPromise(function(_0x182273,_0x1df8ad){return client[_0x85b6('0xa')](_0x22bbc4,_0x2d23e6)[_0x85b6('0xb')](function(_0x448897){logger[_0x85b6('0xc')](_0x85b6('0xd'),_0x440bd3,_0x85b6('0xe'));logger[_0x85b6('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x440bd3,_0x85b6('0xe'),JSON['stringify'](_0x448897));if(_0x448897['error']){if(_0x448897[_0x85b6('0x10')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x440bd3,_0x448897[_0x85b6('0x10')]['message']);return _0x1df8ad(_0x448897[_0x85b6('0x10')][_0x85b6('0x11')]);}logger['error'](_0x85b6('0xd'),_0x440bd3,_0x448897[_0x85b6('0x10')][_0x85b6('0x11')]);return _0x182273(_0x448897[_0x85b6('0x10')][_0x85b6('0x11')]);}else{logger['info'](_0x85b6('0xd'),_0x440bd3,_0x85b6('0xe'));_0x182273(_0x448897[_0x85b6('0x12')][_0x85b6('0x11')]);}})[_0x85b6('0x13')](function(_0xa08a02){logger[_0x85b6('0x10')](_0x85b6('0xd'),_0x440bd3,_0xa08a02);_0x1df8ad(_0xa08a02);});});}exports['GetSugarcrmAccount']=function(_0x140fae){var _0x3d4027=this;return new Promise(function(_0x38e2cb,_0x380af4){return db['SugarcrmAccount']['findAll']({'raw':_0x140fae[_0x85b6('0x14')]?_0x140fae['options'][_0x85b6('0x15')]===undefined?!![]:![]:!![],'where':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')][_0x85b6('0x16')]||null:null,'attributes':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')]['attributes']||null:null,'limit':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')][_0x85b6('0x17')]||null:null,'include':_0x140fae[_0x85b6('0x14')]?_0x140fae[_0x85b6('0x14')][_0x85b6('0x18')]?_[_0x85b6('0x19')](_0x140fae['options'][_0x85b6('0x18')],function(_0x4d84a9){return{'model':db[_0x4d84a9[_0x85b6('0x1a')]],'as':_0x4d84a9['as'],'attributes':_0x4d84a9[_0x85b6('0x1b')],'include':_0x4d84a9[_0x85b6('0x18')]?_[_0x85b6('0x19')](_0x4d84a9['include'],function(_0x43b5fb){return{'model':db[_0x43b5fb[_0x85b6('0x1a')]],'as':_0x43b5fb['as'],'attributes':_0x43b5fb[_0x85b6('0x1b')],'include':_0x43b5fb['include']?_['map'](_0x43b5fb['include'],function(_0xd88e9d){return{'model':db[_0xd88e9d['model']],'as':_0xd88e9d['as'],'attributes':_0xd88e9d[_0x85b6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36e186){logger['info'](_0x85b6('0x1c'),_0x140fae);logger[_0x85b6('0xf')]('GetSugarcrmAccount',_0x140fae,JSON[_0x85b6('0x1d')](_0x36e186));_0x38e2cb(_0x36e186);})[_0x85b6('0x13')](function(_0x1e0ef0){logger[_0x85b6('0x10')](_0x85b6('0x1c'),_0x1e0ef0['message'],_0x140fae);_0x380af4(_0x3d4027['error'](0x1f4,_0x1e0ef0[_0x85b6('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x3dda74){var _0x1fd28a=this;return new Promise(function(_0x403e9b,_0x24a6c9){return db[_0x85b6('0x1e')]['find']({'raw':_0x3dda74[_0x85b6('0x14')]?_0x3dda74[_0x85b6('0x14')][_0x85b6('0x15')]===undefined?!![]:![]:!![],'where':_0x3dda74[_0x85b6('0x14')]?_0x3dda74['options'][_0x85b6('0x16')]||null:null,'attributes':_0x3dda74[_0x85b6('0x14')]?_0x3dda74[_0x85b6('0x14')]['attributes']||null:null,'include':_0x3dda74['options']?_0x3dda74[_0x85b6('0x14')][_0x85b6('0x18')]?_[_0x85b6('0x19')](_0x3dda74[_0x85b6('0x14')][_0x85b6('0x18')],function(_0xc73d0c){return{'model':db[_0xc73d0c[_0x85b6('0x1a')]],'as':_0xc73d0c['as'],'attributes':_0xc73d0c[_0x85b6('0x1b')],'include':_0xc73d0c[_0x85b6('0x18')]?_[_0x85b6('0x19')](_0xc73d0c['include'],function(_0xbd6e75){return{'model':db[_0xbd6e75['model']],'as':_0xbd6e75['as'],'attributes':_0xbd6e75[_0x85b6('0x1b')],'include':_0xbd6e75[_0x85b6('0x18')]?_[_0x85b6('0x19')](_0xbd6e75['include'],function(_0x274b05){return{'model':db[_0x274b05['model']],'as':_0x274b05['as'],'attributes':_0x274b05['attributes']};}):[]};}):[]};}):[]:[]})[_0x85b6('0xb')](function(_0x3cc2ab){logger[_0x85b6('0xc')](_0x85b6('0x1f'),_0x3dda74);logger['debug'](_0x85b6('0x1f'),_0x3dda74,JSON[_0x85b6('0x1d')](_0x3cc2ab));_0x403e9b(_0x3cc2ab);})[_0x85b6('0x13')](function(_0x482281){logger[_0x85b6('0x10')](_0x85b6('0x1f'),_0x482281[_0x85b6('0x11')],_0x3dda74);_0x24a6c9(_0x1fd28a[_0x85b6('0x10')](0x1f4,_0x482281[_0x85b6('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 33f5ff7..9b51d1b 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 _0x525f=['destroy','multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','update','delete'];(function(_0x5bb65,_0x2c8602){var _0x5a56dd=function(_0x15fbdc){while(--_0x15fbdc){_0x5bb65['push'](_0x5bb65['shift']());}};_0x5a56dd(++_0x2c8602);}(_0x525f,0x1dc));var _0xf525=function(_0x4afb4a,_0x32fa2c){_0x4afb4a=_0x4afb4a-0x0;var _0x5ccfea=_0x525f[_0x4afb4a];return _0x5ccfea;};'use strict';var multer=require(_0xf525('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf525('0x1'));var express=require('express');var router=express[_0xf525('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf525('0x3'));var config=require(_0xf525('0x4'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xf525('0x5')]('/',auth['isAuthenticated'](),controller[_0xf525('0x6')]);router[_0xf525('0x5')](_0xf525('0x7'),auth[_0xf525('0x8')](),controller[_0xf525('0x9')]);router['get'](_0xf525('0xa'),auth[_0xf525('0x8')](),controller[_0xf525('0xb')]);router[_0xf525('0x5')](_0xf525('0xc'),auth[_0xf525('0x8')](),controller['getSubjects']);router[_0xf525('0x5')](_0xf525('0xd'),auth[_0xf525('0x8')](),controller['getDescriptions']);router[_0xf525('0xe')]('/',auth[_0xf525('0x8')](),controller['create']);router[_0xf525('0xf')](_0xf525('0x7'),auth['isAuthenticated'](),controller[_0xf525('0x10')]);router[_0xf525('0x11')](_0xf525('0x7'),auth['isAuthenticated'](),controller[_0xf525('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb44f=['./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4c62af,_0x278628){var _0x420d2e=function(_0x3f1050){while(--_0x3f1050){_0x4c62af['push'](_0x4c62af['shift']());}};_0x420d2e(++_0x278628);}(_0xb44f,0xe3));var _0xfb44=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb44f[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xfb44('0x0'));var util=require(_0xfb44('0x1'));var path=require('path');var timeout=require(_0xfb44('0x2'));var express=require(_0xfb44('0x3'));var router=express[_0xfb44('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfb44('0x5'));var config=require(_0xfb44('0x6'));var controller=require(_0xfb44('0x7'));router[_0xfb44('0x8')]('/',auth[_0xfb44('0x9')](),controller[_0xfb44('0xa')]);router[_0xfb44('0x8')](_0xfb44('0xb'),auth['isAuthenticated'](),controller[_0xfb44('0xc')]);router['get'](_0xfb44('0xd'),auth[_0xfb44('0x9')](),controller[_0xfb44('0xe')]);router[_0xfb44('0x8')](_0xfb44('0xf'),auth['isAuthenticated'](),controller[_0xfb44('0x10')]);router['get'](_0xfb44('0x11'),auth['isAuthenticated'](),controller[_0xfb44('0x12')]);router[_0xfb44('0x13')]('/',auth[_0xfb44('0x9')](),controller[_0xfb44('0x14')]);router[_0xfb44('0x15')](_0xfb44('0xb'),auth[_0xfb44('0x9')](),controller[_0xfb44('0x16')]);router[_0xfb44('0x17')]('/:id',auth[_0xfb44('0x9')](),controller[_0xfb44('0x18')]);module[_0xfb44('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 50b5b86..73c3f85 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 _0x958f=['STRING','sequelize','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x958f,0x79));var _0xf958=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x958f[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require(_0xf958('0x0'));module[_0xf958('0x1')]={'name':{'type':Sequelize[_0xf958('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x56d2=['sequelize','exports','STRING'];(function(_0x202662,_0x48def7){var _0x3d797e=function(_0x26be52){while(--_0x26be52){_0x202662['push'](_0x202662['shift']());}};_0x3d797e(++_0x48def7);}(_0x56d2,0xa8));var _0x256d=function(_0x1f847e,_0x1672ec){_0x1f847e=_0x1f847e-0x0;var _0x313e0f=_0x56d2[_0x1f847e];return _0x313e0f;};'use strict';var Sequelize=require(_0x256d('0x0'));module[_0x256d('0x1')]={'name':{'type':Sequelize[_0x256d('0x2')]},'description':{'type':Sequelize[_0x256d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index b323d32..51b3347 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 _0xdfe9=['stack','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','SugarcrmConfiguration','include','findAll','rows','show','params','includeAll','catch','create','body','find','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x2bb930,_0xe92f28){var _0x4a7d19=function(_0x31d554){while(--_0x31d554){_0x2bb930['push'](_0x2bb930['shift']());}};_0x4a7d19(++_0xe92f28);}(_0xdfe9,0x7a));var _0x9dfe=function(_0x168148,_0x22e633){_0x168148=_0x168148-0x0;var _0xbb73a3=_0xdfe9[_0x168148];return _0xbb73a3;};'use strict';var emlformat=require(_0x9dfe('0x0'));var rimraf=require(_0x9dfe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dfe('0x2'));var rp=require(_0x9dfe('0x3'));var moment=require(_0x9dfe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9dfe('0x5'));var util=require(_0x9dfe('0x6'));var path=require(_0x9dfe('0x7'));var sox=require(_0x9dfe('0x8'));var csv=require(_0x9dfe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9dfe('0xa'));var _=require(_0x9dfe('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9dfe('0xc'));var toCsv=require(_0x9dfe('0x9'));var querystring=require(_0x9dfe('0xd'));var Papa=require('papaparse');var Redis=require(_0x9dfe('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9dfe('0xf'));var as=require(_0x9dfe('0x10'));var hardwareService=require(_0x9dfe('0x11'));var logger=require(_0x9dfe('0x12'))('api');var utils=require(_0x9dfe('0x13'));var config=require(_0x9dfe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9dfe('0x15'))['db'];function respondWithStatusCode(_0x379204,_0x41beb8){_0x41beb8=_0x41beb8||0xcc;return function(_0x95cf71){if(_0x95cf71){return _0x379204[_0x9dfe('0x16')](_0x41beb8);}return _0x379204[_0x9dfe('0x17')](_0x41beb8)[_0x9dfe('0x18')]();};}function respondWithResult(_0x667204,_0x5723e9){_0x5723e9=_0x5723e9||0xc8;return function(_0x531a7a){if(_0x531a7a){return _0x667204[_0x9dfe('0x17')](_0x5723e9)[_0x9dfe('0x19')](_0x531a7a);}};}function respondWithFilteredResult(_0x4fa241,_0x2f147d){return function(_0x33c2b9){if(_0x33c2b9){var _0x5e3f70=typeof _0x2f147d['offset']==='undefined'&&typeof _0x2f147d['limit']===_0x9dfe('0x1a');var _0x413ee5=_0x33c2b9[_0x9dfe('0x1b')];var _0x1470eb=_0x5e3f70?0x0:_0x2f147d[_0x9dfe('0x1c')];var _0x391448=_0x5e3f70?_0x33c2b9[_0x9dfe('0x1b')]:_0x2f147d[_0x9dfe('0x1c')]+_0x2f147d[_0x9dfe('0x1d')];var _0x597255;if(_0x391448>=_0x413ee5){_0x391448=_0x413ee5;_0x597255=0xc8;}else{_0x597255=0xce;}_0x4fa241[_0x9dfe('0x17')](_0x597255);return _0x4fa241[_0x9dfe('0x1e')](_0x9dfe('0x1f'),_0x1470eb+'-'+_0x391448+'/'+_0x413ee5)[_0x9dfe('0x19')](_0x33c2b9);}return null;};}function patchUpdates(_0xe635a7){return function(_0x5b3507){try{jsonpatch[_0x9dfe('0x20')](_0x5b3507,_0xe635a7,!![]);}catch(_0x86e40f){return BPromise[_0x9dfe('0x21')](_0x86e40f);}return _0x5b3507[_0x9dfe('0x22')]();};}function saveUpdates(_0x1b777e,_0x1db687){return function(_0x439883){if(_0x439883){return _0x439883[_0x9dfe('0x23')](_0x1b777e)[_0x9dfe('0x24')](function(_0x3ae2a2){return _0x3ae2a2;});}return null;};}function removeEntity(_0x3c6f57,_0x3ef2e8){return function(_0x28051a){if(_0x28051a){return _0x28051a[_0x9dfe('0x25')]()['then'](function(){_0x3c6f57[_0x9dfe('0x17')](0xcc)[_0x9dfe('0x18')]();});}};}function handleEntityNotFound(_0x319336,_0x42af12){return function(_0x4fce8f){if(!_0x4fce8f){_0x319336['sendStatus'](0x194);}return _0x4fce8f;};}function handleError(_0x56733f,_0x425a9a){_0x425a9a=_0x425a9a||0x1f4;return function(_0x2d5998){logger['error'](_0x2d5998[_0x9dfe('0x26')]);if(_0x2d5998[_0x9dfe('0x27')]){delete _0x2d5998[_0x9dfe('0x27')];}_0x56733f[_0x9dfe('0x17')](_0x425a9a)[_0x9dfe('0x28')](_0x2d5998);};}exports[_0x9dfe('0x29')]=function(_0xba12e7,_0x44c101){var _0x36b23a={},_0x47dd04={},_0x3b3f96={'count':0x0,'rows':[]};var _0x48fd0f=_['map'](db['SugarcrmConfiguration'][_0x9dfe('0x2a')],function(_0x83c4b7){return{'name':_0x83c4b7['fieldName'],'type':_0x83c4b7[_0x9dfe('0x2b')][_0x9dfe('0x2c')]};});_0x47dd04[_0x9dfe('0x2d')]=_[_0x9dfe('0x2e')](_0x48fd0f,'name');_0x47dd04[_0x9dfe('0x2f')]=_[_0x9dfe('0x30')](_0xba12e7[_0x9dfe('0x2f')]);_0x47dd04['filters']=_[_0x9dfe('0x31')](_0x47dd04[_0x9dfe('0x2d')],_0x47dd04['query']);_0x36b23a[_0x9dfe('0x32')]=_['intersection'](_0x47dd04[_0x9dfe('0x2d')],qs[_0x9dfe('0x33')](_0xba12e7['query']['fields']));_0x36b23a['attributes']=_0x36b23a['attributes'][_0x9dfe('0x34')]?_0x36b23a[_0x9dfe('0x32')]:_0x47dd04[_0x9dfe('0x2d')];if(!_0xba12e7[_0x9dfe('0x2f')][_0x9dfe('0x35')]('nolimit')){_0x36b23a[_0x9dfe('0x1d')]=qs[_0x9dfe('0x1d')](_0xba12e7[_0x9dfe('0x2f')][_0x9dfe('0x1d')]);_0x36b23a[_0x9dfe('0x1c')]=qs['offset'](_0xba12e7[_0x9dfe('0x2f')][_0x9dfe('0x1c')]);}_0x36b23a[_0x9dfe('0x36')]=qs[_0x9dfe('0x37')](_0xba12e7[_0x9dfe('0x2f')]['sort']);_0x36b23a[_0x9dfe('0x38')]=qs[_0x9dfe('0x39')](_[_0x9dfe('0x3a')](_0xba12e7[_0x9dfe('0x2f')],_0x47dd04[_0x9dfe('0x39')]),_0x48fd0f);if(_0xba12e7[_0x9dfe('0x2f')]['filter']){_0x36b23a[_0x9dfe('0x38')]=_[_0x9dfe('0x3b')](_0x36b23a['where'],{'$or':_[_0x9dfe('0x2e')](_0x48fd0f,function(_0x519f02){if(_0x519f02['type']!==_0x9dfe('0x3c')){var _0x3817a2={};_0x3817a2[_0x519f02[_0x9dfe('0x27')]]={'$like':'%'+_0xba12e7[_0x9dfe('0x2f')][_0x9dfe('0x3d')]+'%'};return _0x3817a2;}})});}_0x36b23a=_[_0x9dfe('0x3b')]({},_0x36b23a,_0xba12e7[_0x9dfe('0x3e')]);var _0x29f08a={'where':_0x36b23a[_0x9dfe('0x38')]};return db[_0x9dfe('0x3f')][_0x9dfe('0x1b')](_0x29f08a)[_0x9dfe('0x24')](function(_0x95db2a){_0x3b3f96[_0x9dfe('0x1b')]=_0x95db2a;if(_0xba12e7['query']['includeAll']){_0x36b23a[_0x9dfe('0x40')]=[{'all':!![]}];}return db[_0x9dfe('0x3f')][_0x9dfe('0x41')](_0x36b23a);})['then'](function(_0x108eac){_0x3b3f96[_0x9dfe('0x42')]=_0x108eac;return _0x3b3f96;})[_0x9dfe('0x24')](respondWithFilteredResult(_0x44c101,_0x36b23a))['catch'](handleError(_0x44c101,null));};exports[_0x9dfe('0x43')]=function(_0x1db564,_0x3c500f){var _0x3b821f={'raw':![],'where':{'id':_0x1db564[_0x9dfe('0x44')]['id']}},_0x3fa16e={};_0x3fa16e[_0x9dfe('0x2d')]=_[_0x9dfe('0x30')](db['SugarcrmConfiguration'][_0x9dfe('0x2a')]);_0x3fa16e['query']=_[_0x9dfe('0x30')](_0x1db564[_0x9dfe('0x2f')]);_0x3fa16e[_0x9dfe('0x39')]=_[_0x9dfe('0x31')](_0x3fa16e[_0x9dfe('0x2d')],_0x3fa16e[_0x9dfe('0x2f')]);_0x3b821f[_0x9dfe('0x32')]=_[_0x9dfe('0x31')](_0x3fa16e[_0x9dfe('0x2d')],qs[_0x9dfe('0x33')](_0x1db564[_0x9dfe('0x2f')][_0x9dfe('0x33')]));_0x3b821f[_0x9dfe('0x32')]=_0x3b821f[_0x9dfe('0x32')][_0x9dfe('0x34')]?_0x3b821f[_0x9dfe('0x32')]:_0x3fa16e[_0x9dfe('0x2d')];if(_0x1db564['query'][_0x9dfe('0x45')]){_0x3b821f[_0x9dfe('0x40')]=[{'all':!![]}];}_0x3b821f=_[_0x9dfe('0x3b')]({},_0x3b821f,_0x1db564['options']);return db['SugarcrmConfiguration']['find'](_0x3b821f)[_0x9dfe('0x24')](handleEntityNotFound(_0x3c500f,null))[_0x9dfe('0x24')](respondWithResult(_0x3c500f,null))[_0x9dfe('0x46')](handleError(_0x3c500f,null));};exports[_0x9dfe('0x47')]=function(_0x571072,_0x323858){return db[_0x9dfe('0x3f')][_0x9dfe('0x47')](_0x571072[_0x9dfe('0x48')],{})[_0x9dfe('0x24')](respondWithResult(_0x323858,0xc9))[_0x9dfe('0x46')](handleError(_0x323858,null));};exports[_0x9dfe('0x23')]=function(_0x4f882d,_0x1e0402){if(_0x4f882d[_0x9dfe('0x48')]['id']){delete _0x4f882d['body']['id'];}return db[_0x9dfe('0x3f')][_0x9dfe('0x49')]({'where':{'id':_0x4f882d[_0x9dfe('0x44')]['id']}})[_0x9dfe('0x24')](handleEntityNotFound(_0x1e0402,null))[_0x9dfe('0x24')](saveUpdates(_0x4f882d[_0x9dfe('0x48')],null))[_0x9dfe('0x24')](respondWithResult(_0x1e0402,null))['catch'](handleError(_0x1e0402,null));};exports['destroy']=function(_0x5c3bc3,_0x1d5387){return db[_0x9dfe('0x3f')][_0x9dfe('0x49')]({'where':{'id':_0x5c3bc3['params']['id']}})[_0x9dfe('0x24')](handleEntityNotFound(_0x1d5387,null))[_0x9dfe('0x24')](removeEntity(_0x1d5387,null))[_0x9dfe('0x46')](handleError(_0x1d5387,null));};exports[_0x9dfe('0x4a')]=function(_0x18a9d5,_0x315a61,_0x4b9e21){var _0x4bde49={};var _0x31f595={};var _0x4826c6;var _0x9242fe;return db[_0x9dfe('0x3f')][_0x9dfe('0x4b')]({'where':{'id':_0x18a9d5[_0x9dfe('0x44')]['id']}})[_0x9dfe('0x24')](handleEntityNotFound(_0x315a61,null))[_0x9dfe('0x24')](function(_0x12f75f){if(_0x12f75f){_0x4826c6=_0x12f75f;_0x31f595['model']=_[_0x9dfe('0x30')](db[_0x9dfe('0x4c')][_0x9dfe('0x2a')]);_0x31f595[_0x9dfe('0x2f')]=_[_0x9dfe('0x30')](_0x18a9d5[_0x9dfe('0x2f')]);_0x31f595[_0x9dfe('0x39')]=_[_0x9dfe('0x31')](_0x31f595[_0x9dfe('0x2d')],_0x31f595[_0x9dfe('0x2f')]);_0x4bde49[_0x9dfe('0x32')]=_[_0x9dfe('0x31')](_0x31f595[_0x9dfe('0x2d')],qs[_0x9dfe('0x33')](_0x18a9d5['query']['fields']));_0x4bde49[_0x9dfe('0x32')]=_0x4bde49[_0x9dfe('0x32')][_0x9dfe('0x34')]?_0x4bde49['attributes']:_0x31f595['model'];_0x4bde49[_0x9dfe('0x36')]=qs[_0x9dfe('0x37')](_0x18a9d5[_0x9dfe('0x2f')][_0x9dfe('0x37')]);_0x4bde49['where']=qs[_0x9dfe('0x39')](_['pick'](_0x18a9d5['query'],_0x31f595[_0x9dfe('0x39')]));if(_0x18a9d5[_0x9dfe('0x2f')][_0x9dfe('0x3d')]){_0x4bde49[_0x9dfe('0x38')]=_[_0x9dfe('0x3b')](_0x4bde49[_0x9dfe('0x38')],{'$or':_['map'](_0x4bde49[_0x9dfe('0x32')],function(_0x543e9d){var _0x5a1d60={};_0x5a1d60[_0x543e9d]={'$like':'%'+_0x18a9d5[_0x9dfe('0x2f')]['filter']+'%'};return _0x5a1d60;})});}_0x4bde49=_[_0x9dfe('0x3b')]({},_0x4bde49,_0x18a9d5[_0x9dfe('0x3e')]);return _0x4826c6[_0x9dfe('0x4a')](_0x4bde49);}})['then'](function(_0x23b30e){if(_0x23b30e){_0x9242fe=_0x23b30e[_0x9dfe('0x34')];if(!_0x18a9d5[_0x9dfe('0x2f')][_0x9dfe('0x35')](_0x9dfe('0x4d'))){_0x4bde49['limit']=qs['limit'](_0x18a9d5[_0x9dfe('0x2f')][_0x9dfe('0x1d')]);_0x4bde49['offset']=qs[_0x9dfe('0x1c')](_0x18a9d5[_0x9dfe('0x2f')][_0x9dfe('0x1c')]);}return _0x4826c6['getFields'](_0x4bde49);}})[_0x9dfe('0x24')](function(_0x21ad4d){if(_0x21ad4d){return _0x21ad4d?{'count':_0x9242fe,'rows':_0x21ad4d}:null;}})['then'](respondWithResult(_0x315a61,null))['catch'](handleError(_0x315a61,null));};exports[_0x9dfe('0x4e')]=function(_0x14a9bb,_0x39d93e,_0xb6c95d){var _0x103f27={};var _0x3fdd7d={};var _0x5cb1cb;var _0x21976a;return db[_0x9dfe('0x3f')]['findOne']({'where':{'id':_0x14a9bb[_0x9dfe('0x44')]['id']}})[_0x9dfe('0x24')](handleEntityNotFound(_0x39d93e,null))[_0x9dfe('0x24')](function(_0x334853){if(_0x334853){_0x5cb1cb=_0x334853;_0x3fdd7d[_0x9dfe('0x2d')]=_[_0x9dfe('0x30')](db['SugarcrmField'][_0x9dfe('0x2a')]);_0x3fdd7d[_0x9dfe('0x2f')]=_[_0x9dfe('0x30')](_0x14a9bb[_0x9dfe('0x2f')]);_0x3fdd7d[_0x9dfe('0x39')]=_[_0x9dfe('0x31')](_0x3fdd7d['model'],_0x3fdd7d[_0x9dfe('0x2f')]);_0x103f27[_0x9dfe('0x32')]=_[_0x9dfe('0x31')](_0x3fdd7d[_0x9dfe('0x2d')],qs[_0x9dfe('0x33')](_0x14a9bb[_0x9dfe('0x2f')]['fields']));_0x103f27[_0x9dfe('0x32')]=_0x103f27[_0x9dfe('0x32')][_0x9dfe('0x34')]?_0x103f27[_0x9dfe('0x32')]:_0x3fdd7d[_0x9dfe('0x2d')];_0x103f27[_0x9dfe('0x36')]=qs['sort'](_0x14a9bb['query']['sort']);_0x103f27[_0x9dfe('0x38')]=qs[_0x9dfe('0x39')](_[_0x9dfe('0x3a')](_0x14a9bb[_0x9dfe('0x2f')],_0x3fdd7d['filters']));if(_0x14a9bb[_0x9dfe('0x2f')]['filter']){_0x103f27['where']=_[_0x9dfe('0x3b')](_0x103f27[_0x9dfe('0x38')],{'$or':_['map'](_0x103f27[_0x9dfe('0x32')],function(_0x39acbb){var _0x3d5044={};_0x3d5044[_0x39acbb]={'$like':'%'+_0x14a9bb[_0x9dfe('0x2f')][_0x9dfe('0x3d')]+'%'};return _0x3d5044;})});}_0x103f27=_[_0x9dfe('0x3b')]({},_0x103f27,_0x14a9bb[_0x9dfe('0x3e')]);return _0x5cb1cb[_0x9dfe('0x4e')](_0x103f27);}})[_0x9dfe('0x24')](function(_0x314bb6){if(_0x314bb6){_0x21976a=_0x314bb6[_0x9dfe('0x34')];if(!_0x14a9bb[_0x9dfe('0x2f')][_0x9dfe('0x35')](_0x9dfe('0x4d'))){_0x103f27[_0x9dfe('0x1d')]=qs[_0x9dfe('0x1d')](_0x14a9bb[_0x9dfe('0x2f')][_0x9dfe('0x1d')]);_0x103f27['offset']=qs['offset'](_0x14a9bb[_0x9dfe('0x2f')]['offset']);}return _0x5cb1cb[_0x9dfe('0x4e')](_0x103f27);}})['then'](function(_0x38794b){if(_0x38794b){return _0x38794b?{'count':_0x21976a,'rows':_0x38794b}:null;}})[_0x9dfe('0x24')](respondWithResult(_0x39d93e,null))[_0x9dfe('0x46')](handleError(_0x39d93e,null));};exports[_0x9dfe('0x4f')]=function(_0x9ddef4,_0x1e13ca,_0x235dfc){var _0x31b02e={};var _0x1e0061={};var _0x505bd5;var _0x23ecdb;return db[_0x9dfe('0x3f')][_0x9dfe('0x4b')]({'where':{'id':_0x9ddef4[_0x9dfe('0x44')]['id']}})[_0x9dfe('0x24')](handleEntityNotFound(_0x1e13ca,null))[_0x9dfe('0x24')](function(_0x2a045b){if(_0x2a045b){_0x505bd5=_0x2a045b;_0x1e0061['model']=_['keys'](db[_0x9dfe('0x4c')]['rawAttributes']);_0x1e0061[_0x9dfe('0x2f')]=_['keys'](_0x9ddef4[_0x9dfe('0x2f')]);_0x1e0061[_0x9dfe('0x39')]=_[_0x9dfe('0x31')](_0x1e0061[_0x9dfe('0x2d')],_0x1e0061['query']);_0x31b02e['attributes']=_[_0x9dfe('0x31')](_0x1e0061['model'],qs[_0x9dfe('0x33')](_0x9ddef4[_0x9dfe('0x2f')][_0x9dfe('0x33')]));_0x31b02e[_0x9dfe('0x32')]=_0x31b02e[_0x9dfe('0x32')][_0x9dfe('0x34')]?_0x31b02e[_0x9dfe('0x32')]:_0x1e0061['model'];_0x31b02e[_0x9dfe('0x36')]=qs[_0x9dfe('0x37')](_0x9ddef4[_0x9dfe('0x2f')][_0x9dfe('0x37')]);_0x31b02e['where']=qs[_0x9dfe('0x39')](_['pick'](_0x9ddef4[_0x9dfe('0x2f')],_0x1e0061[_0x9dfe('0x39')]));if(_0x9ddef4['query']['filter']){_0x31b02e[_0x9dfe('0x38')]=_[_0x9dfe('0x3b')](_0x31b02e[_0x9dfe('0x38')],{'$or':_[_0x9dfe('0x2e')](_0x31b02e[_0x9dfe('0x32')],function(_0x27b79e){var _0x556271={};_0x556271[_0x27b79e]={'$like':'%'+_0x9ddef4[_0x9dfe('0x2f')][_0x9dfe('0x3d')]+'%'};return _0x556271;})});}_0x31b02e=_[_0x9dfe('0x3b')]({},_0x31b02e,_0x9ddef4[_0x9dfe('0x3e')]);return _0x505bd5[_0x9dfe('0x4f')](_0x31b02e);}})[_0x9dfe('0x24')](function(_0x41402c){if(_0x41402c){_0x23ecdb=_0x41402c[_0x9dfe('0x34')];if(!_0x9ddef4[_0x9dfe('0x2f')][_0x9dfe('0x35')](_0x9dfe('0x4d'))){_0x31b02e[_0x9dfe('0x1d')]=qs[_0x9dfe('0x1d')](_0x9ddef4[_0x9dfe('0x2f')]['limit']);_0x31b02e[_0x9dfe('0x1c')]=qs[_0x9dfe('0x1c')](_0x9ddef4['query'][_0x9dfe('0x1c')]);}return _0x505bd5[_0x9dfe('0x4f')](_0x31b02e);}})[_0x9dfe('0x24')](function(_0x42fbff){if(_0x42fbff){return _0x42fbff?{'count':_0x23ecdb,'rows':_0x42fbff}:null;}})[_0x9dfe('0x24')](respondWithResult(_0x1e13ca,null))[_0x9dfe('0x46')](handleError(_0x1e13ca,null));}; \ No newline at end of file +var _0xf67c=['options','find','create','body','params','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','keys'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xf67c,0x9f));var _0xcf67=function(_0xca9031,_0x35bc10){_0xca9031=_0xca9031-0x0;var _0x1149d8=_0xf67c[_0xca9031];return _0x1149d8;};'use strict';var emlformat=require(_0xcf67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf67('0x1'));var jsonpatch=require(_0xcf67('0x2'));var rp=require('request-promise');var moment=require(_0xcf67('0x3'));var BPromise=require(_0xcf67('0x4'));var Mustache=require(_0xcf67('0x5'));var util=require('util');var path=require(_0xcf67('0x6'));var sox=require(_0xcf67('0x7'));var csv=require(_0xcf67('0x8'));var ejs=require(_0xcf67('0x9'));var fs=require('fs');var fs_extra=require(_0xcf67('0xa'));var _=require('lodash');var squel=require(_0xcf67('0xb'));var crypto=require(_0xcf67('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcf67('0xd'));var toCsv=require(_0xcf67('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcf67('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcf67('0xf'));var hardwareService=require(_0xcf67('0x10'));var logger=require(_0xcf67('0x11'))('api');var utils=require(_0xcf67('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcf67('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42a856,_0x1abc24){_0x1abc24=_0x1abc24||0xcc;return function(_0x551b86){if(_0x551b86){return _0x42a856['sendStatus'](_0x1abc24);}return _0x42a856['status'](_0x1abc24)[_0xcf67('0x14')]();};}function respondWithResult(_0x400571,_0x31ff77){_0x31ff77=_0x31ff77||0xc8;return function(_0x321062){if(_0x321062){return _0x400571[_0xcf67('0x15')](_0x31ff77)[_0xcf67('0x16')](_0x321062);}};}function respondWithFilteredResult(_0x211910,_0x12dcf0){return function(_0x511028){if(_0x511028){var _0x592644=typeof _0x12dcf0[_0xcf67('0x17')]===_0xcf67('0x18')&&typeof _0x12dcf0[_0xcf67('0x19')]==='undefined';var _0x4f2201=_0x511028[_0xcf67('0x1a')];var _0xe1b209=_0x592644?0x0:_0x12dcf0[_0xcf67('0x17')];var _0x43d167=_0x592644?_0x511028[_0xcf67('0x1a')]:_0x12dcf0[_0xcf67('0x17')]+_0x12dcf0[_0xcf67('0x19')];var _0x4f4fa5;if(_0x43d167>=_0x4f2201){_0x43d167=_0x4f2201;_0x4f4fa5=0xc8;}else{_0x4f4fa5=0xce;}_0x211910['status'](_0x4f4fa5);return _0x211910[_0xcf67('0x1b')](_0xcf67('0x1c'),_0xe1b209+'-'+_0x43d167+'/'+_0x4f2201)[_0xcf67('0x16')](_0x511028);}return null;};}function patchUpdates(_0x151e22){return function(_0x31d814){try{jsonpatch['apply'](_0x31d814,_0x151e22,!![]);}catch(_0x870bf7){return BPromise['reject'](_0x870bf7);}return _0x31d814[_0xcf67('0x1d')]();};}function saveUpdates(_0x5177d1,_0x24037a){return function(_0x370e3c){if(_0x370e3c){return _0x370e3c[_0xcf67('0x1e')](_0x5177d1)['then'](function(_0x256f0d){return _0x256f0d;});}return null;};}function removeEntity(_0x3a6827,_0x1d3906){return function(_0x19a4cb){if(_0x19a4cb){return _0x19a4cb['destroy']()[_0xcf67('0x1f')](function(){_0x3a6827[_0xcf67('0x15')](0xcc)[_0xcf67('0x14')]();});}};}function handleEntityNotFound(_0x587e9c,_0x278b5a){return function(_0x431657){if(!_0x431657){_0x587e9c['sendStatus'](0x194);}return _0x431657;};}function handleError(_0x178777,_0x23b017){_0x23b017=_0x23b017||0x1f4;return function(_0xa05163){logger[_0xcf67('0x20')](_0xa05163['stack']);if(_0xa05163[_0xcf67('0x21')]){delete _0xa05163[_0xcf67('0x21')];}_0x178777[_0xcf67('0x15')](_0x23b017)[_0xcf67('0x22')](_0xa05163);};}exports[_0xcf67('0x23')]=function(_0x16c931,_0x4d767e){var _0x41f04d={},_0x1df399={},_0x2bfcec={'count':0x0,'rows':[]};var _0xccbaab=_[_0xcf67('0x24')](db[_0xcf67('0x25')][_0xcf67('0x26')],function(_0xd86433){return{'name':_0xd86433[_0xcf67('0x27')],'type':_0xd86433[_0xcf67('0x28')][_0xcf67('0x29')]};});_0x1df399[_0xcf67('0x2a')]=_['map'](_0xccbaab,_0xcf67('0x21'));_0x1df399[_0xcf67('0x2b')]=_['keys'](_0x16c931[_0xcf67('0x2b')]);_0x1df399[_0xcf67('0x2c')]=_[_0xcf67('0x2d')](_0x1df399[_0xcf67('0x2a')],_0x1df399['query']);_0x41f04d[_0xcf67('0x2e')]=_['intersection'](_0x1df399[_0xcf67('0x2a')],qs[_0xcf67('0x2f')](_0x16c931[_0xcf67('0x2b')]['fields']));_0x41f04d['attributes']=_0x41f04d[_0xcf67('0x2e')][_0xcf67('0x30')]?_0x41f04d['attributes']:_0x1df399['model'];if(!_0x16c931['query'][_0xcf67('0x31')](_0xcf67('0x32'))){_0x41f04d[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x16c931[_0xcf67('0x2b')]['limit']);_0x41f04d[_0xcf67('0x17')]=qs[_0xcf67('0x17')](_0x16c931[_0xcf67('0x2b')][_0xcf67('0x17')]);}_0x41f04d[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x16c931[_0xcf67('0x2b')][_0xcf67('0x34')]);_0x41f04d[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_[_0xcf67('0x36')](_0x16c931[_0xcf67('0x2b')],_0x1df399[_0xcf67('0x2c')]),_0xccbaab);if(_0x16c931[_0xcf67('0x2b')][_0xcf67('0x37')]){_0x41f04d[_0xcf67('0x35')]=_[_0xcf67('0x38')](_0x41f04d[_0xcf67('0x35')],{'$or':_['map'](_0xccbaab,function(_0x36c530){if(_0x36c530[_0xcf67('0x28')]!=='VIRTUAL'){var _0x47a094={};_0x47a094[_0x36c530[_0xcf67('0x21')]]={'$like':'%'+_0x16c931[_0xcf67('0x2b')][_0xcf67('0x37')]+'%'};return _0x47a094;}})});}_0x41f04d=_[_0xcf67('0x38')]({},_0x41f04d,_0x16c931['options']);var _0x34448e={'where':_0x41f04d[_0xcf67('0x35')]};return db[_0xcf67('0x25')]['count'](_0x34448e)[_0xcf67('0x1f')](function(_0x43fbfd){_0x2bfcec[_0xcf67('0x1a')]=_0x43fbfd;if(_0x16c931[_0xcf67('0x2b')][_0xcf67('0x39')]){_0x41f04d[_0xcf67('0x3a')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xcf67('0x3b')](_0x41f04d);})[_0xcf67('0x1f')](function(_0x229ce8){_0x2bfcec[_0xcf67('0x3c')]=_0x229ce8;return _0x2bfcec;})[_0xcf67('0x1f')](respondWithFilteredResult(_0x4d767e,_0x41f04d))[_0xcf67('0x3d')](handleError(_0x4d767e,null));};exports['show']=function(_0xbe4a4,_0x117c62){var _0x7ead0b={'raw':![],'where':{'id':_0xbe4a4['params']['id']}},_0x40499e={};_0x40499e[_0xcf67('0x2a')]=_[_0xcf67('0x3e')](db[_0xcf67('0x25')][_0xcf67('0x26')]);_0x40499e[_0xcf67('0x2b')]=_[_0xcf67('0x3e')](_0xbe4a4['query']);_0x40499e['filters']=_[_0xcf67('0x2d')](_0x40499e[_0xcf67('0x2a')],_0x40499e[_0xcf67('0x2b')]);_0x7ead0b['attributes']=_[_0xcf67('0x2d')](_0x40499e['model'],qs[_0xcf67('0x2f')](_0xbe4a4['query']['fields']));_0x7ead0b[_0xcf67('0x2e')]=_0x7ead0b[_0xcf67('0x2e')][_0xcf67('0x30')]?_0x7ead0b['attributes']:_0x40499e['model'];if(_0xbe4a4[_0xcf67('0x2b')][_0xcf67('0x39')]){_0x7ead0b[_0xcf67('0x3a')]=[{'all':!![]}];}_0x7ead0b=_[_0xcf67('0x38')]({},_0x7ead0b,_0xbe4a4[_0xcf67('0x3f')]);return db[_0xcf67('0x25')][_0xcf67('0x40')](_0x7ead0b)['then'](handleEntityNotFound(_0x117c62,null))[_0xcf67('0x1f')](respondWithResult(_0x117c62,null))[_0xcf67('0x3d')](handleError(_0x117c62,null));};exports[_0xcf67('0x41')]=function(_0x1cfd77,_0x4c6a59){return db[_0xcf67('0x25')][_0xcf67('0x41')](_0x1cfd77[_0xcf67('0x42')],{})[_0xcf67('0x1f')](respondWithResult(_0x4c6a59,0xc9))[_0xcf67('0x3d')](handleError(_0x4c6a59,null));};exports[_0xcf67('0x1e')]=function(_0x1c7ecf,_0x368826){if(_0x1c7ecf[_0xcf67('0x42')]['id']){delete _0x1c7ecf[_0xcf67('0x42')]['id'];}return db[_0xcf67('0x25')][_0xcf67('0x40')]({'where':{'id':_0x1c7ecf[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x368826,null))['then'](saveUpdates(_0x1c7ecf[_0xcf67('0x42')],null))[_0xcf67('0x1f')](respondWithResult(_0x368826,null))[_0xcf67('0x3d')](handleError(_0x368826,null));};exports[_0xcf67('0x44')]=function(_0x41d281,_0x7277fa){return db[_0xcf67('0x25')][_0xcf67('0x40')]({'where':{'id':_0x41d281[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x7277fa,null))['then'](removeEntity(_0x7277fa,null))[_0xcf67('0x3d')](handleError(_0x7277fa,null));};exports[_0xcf67('0x45')]=function(_0x7a06c4,_0x215c26,_0x9cab94){var _0x5dae8f={};var _0x4028b8={};var _0x373379;var _0x5a4045;return db[_0xcf67('0x25')][_0xcf67('0x46')]({'where':{'id':_0x7a06c4['params']['id']}})['then'](handleEntityNotFound(_0x215c26,null))[_0xcf67('0x1f')](function(_0xb37fdb){if(_0xb37fdb){_0x373379=_0xb37fdb;_0x4028b8[_0xcf67('0x2a')]=_[_0xcf67('0x3e')](db[_0xcf67('0x47')][_0xcf67('0x26')]);_0x4028b8['query']=_['keys'](_0x7a06c4['query']);_0x4028b8['filters']=_[_0xcf67('0x2d')](_0x4028b8[_0xcf67('0x2a')],_0x4028b8[_0xcf67('0x2b')]);_0x5dae8f[_0xcf67('0x2e')]=_[_0xcf67('0x2d')](_0x4028b8[_0xcf67('0x2a')],qs['fields'](_0x7a06c4['query'][_0xcf67('0x2f')]));_0x5dae8f['attributes']=_0x5dae8f['attributes'][_0xcf67('0x30')]?_0x5dae8f[_0xcf67('0x2e')]:_0x4028b8[_0xcf67('0x2a')];_0x5dae8f[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x7a06c4['query'][_0xcf67('0x34')]);_0x5dae8f[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_['pick'](_0x7a06c4[_0xcf67('0x2b')],_0x4028b8['filters']));if(_0x7a06c4[_0xcf67('0x2b')][_0xcf67('0x37')]){_0x5dae8f['where']=_[_0xcf67('0x38')](_0x5dae8f[_0xcf67('0x35')],{'$or':_['map'](_0x5dae8f[_0xcf67('0x2e')],function(_0x3974c9){var _0x1ca0ef={};_0x1ca0ef[_0x3974c9]={'$like':'%'+_0x7a06c4['query'][_0xcf67('0x37')]+'%'};return _0x1ca0ef;})});}_0x5dae8f=_[_0xcf67('0x38')]({},_0x5dae8f,_0x7a06c4[_0xcf67('0x3f')]);return _0x373379['getFields'](_0x5dae8f);}})[_0xcf67('0x1f')](function(_0x399eb8){if(_0x399eb8){_0x5a4045=_0x399eb8['length'];if(!_0x7a06c4['query']['hasOwnProperty'](_0xcf67('0x32'))){_0x5dae8f[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x7a06c4[_0xcf67('0x2b')][_0xcf67('0x19')]);_0x5dae8f[_0xcf67('0x17')]=qs[_0xcf67('0x17')](_0x7a06c4[_0xcf67('0x2b')][_0xcf67('0x17')]);}return _0x373379['getFields'](_0x5dae8f);}})[_0xcf67('0x1f')](function(_0x56c629){if(_0x56c629){return _0x56c629?{'count':_0x5a4045,'rows':_0x56c629}:null;}})[_0xcf67('0x1f')](respondWithResult(_0x215c26,null))[_0xcf67('0x3d')](handleError(_0x215c26,null));};exports[_0xcf67('0x48')]=function(_0x1c7979,_0x5de8c0,_0x59cd8e){var _0xcb80a5={};var _0x57bf8c={};var _0x235535;var _0x10cc4b;return db[_0xcf67('0x25')][_0xcf67('0x46')]({'where':{'id':_0x1c7979[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0x5de8c0,null))[_0xcf67('0x1f')](function(_0x95bb03){if(_0x95bb03){_0x235535=_0x95bb03;_0x57bf8c[_0xcf67('0x2a')]=_[_0xcf67('0x3e')](db['SugarcrmField'][_0xcf67('0x26')]);_0x57bf8c[_0xcf67('0x2b')]=_[_0xcf67('0x3e')](_0x1c7979['query']);_0x57bf8c['filters']=_[_0xcf67('0x2d')](_0x57bf8c[_0xcf67('0x2a')],_0x57bf8c[_0xcf67('0x2b')]);_0xcb80a5[_0xcf67('0x2e')]=_[_0xcf67('0x2d')](_0x57bf8c[_0xcf67('0x2a')],qs[_0xcf67('0x2f')](_0x1c7979['query']['fields']));_0xcb80a5[_0xcf67('0x2e')]=_0xcb80a5[_0xcf67('0x2e')][_0xcf67('0x30')]?_0xcb80a5[_0xcf67('0x2e')]:_0x57bf8c[_0xcf67('0x2a')];_0xcb80a5[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x1c7979['query'][_0xcf67('0x34')]);_0xcb80a5[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_[_0xcf67('0x36')](_0x1c7979['query'],_0x57bf8c[_0xcf67('0x2c')]));if(_0x1c7979['query']['filter']){_0xcb80a5['where']=_['merge'](_0xcb80a5[_0xcf67('0x35')],{'$or':_[_0xcf67('0x24')](_0xcb80a5[_0xcf67('0x2e')],function(_0x18a92b){var _0x19d91a={};_0x19d91a[_0x18a92b]={'$like':'%'+_0x1c7979[_0xcf67('0x2b')][_0xcf67('0x37')]+'%'};return _0x19d91a;})});}_0xcb80a5=_[_0xcf67('0x38')]({},_0xcb80a5,_0x1c7979[_0xcf67('0x3f')]);return _0x235535[_0xcf67('0x48')](_0xcb80a5);}})[_0xcf67('0x1f')](function(_0x6c1d2c){if(_0x6c1d2c){_0x10cc4b=_0x6c1d2c['length'];if(!_0x1c7979[_0xcf67('0x2b')][_0xcf67('0x31')]('nolimit')){_0xcb80a5[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x1c7979[_0xcf67('0x2b')][_0xcf67('0x19')]);_0xcb80a5[_0xcf67('0x17')]=qs['offset'](_0x1c7979[_0xcf67('0x2b')]['offset']);}return _0x235535['getSubjects'](_0xcb80a5);}})[_0xcf67('0x1f')](function(_0xa8cb1a){if(_0xa8cb1a){return _0xa8cb1a?{'count':_0x10cc4b,'rows':_0xa8cb1a}:null;}})['then'](respondWithResult(_0x5de8c0,null))[_0xcf67('0x3d')](handleError(_0x5de8c0,null));};exports[_0xcf67('0x49')]=function(_0x51413e,_0xc52b13,_0x2fec38){var _0x4fff3b={};var _0x4aba31={};var _0x1fa30e;var _0x49b215;return db[_0xcf67('0x25')][_0xcf67('0x46')]({'where':{'id':_0x51413e[_0xcf67('0x43')]['id']}})[_0xcf67('0x1f')](handleEntityNotFound(_0xc52b13,null))[_0xcf67('0x1f')](function(_0x86a19a){if(_0x86a19a){_0x1fa30e=_0x86a19a;_0x4aba31['model']=_[_0xcf67('0x3e')](db[_0xcf67('0x47')][_0xcf67('0x26')]);_0x4aba31[_0xcf67('0x2b')]=_['keys'](_0x51413e[_0xcf67('0x2b')]);_0x4aba31['filters']=_[_0xcf67('0x2d')](_0x4aba31['model'],_0x4aba31[_0xcf67('0x2b')]);_0x4fff3b[_0xcf67('0x2e')]=_[_0xcf67('0x2d')](_0x4aba31[_0xcf67('0x2a')],qs['fields'](_0x51413e['query'][_0xcf67('0x2f')]));_0x4fff3b['attributes']=_0x4fff3b[_0xcf67('0x2e')]['length']?_0x4fff3b['attributes']:_0x4aba31[_0xcf67('0x2a')];_0x4fff3b[_0xcf67('0x33')]=qs[_0xcf67('0x34')](_0x51413e[_0xcf67('0x2b')][_0xcf67('0x34')]);_0x4fff3b[_0xcf67('0x35')]=qs[_0xcf67('0x2c')](_[_0xcf67('0x36')](_0x51413e[_0xcf67('0x2b')],_0x4aba31[_0xcf67('0x2c')]));if(_0x51413e[_0xcf67('0x2b')][_0xcf67('0x37')]){_0x4fff3b[_0xcf67('0x35')]=_[_0xcf67('0x38')](_0x4fff3b[_0xcf67('0x35')],{'$or':_[_0xcf67('0x24')](_0x4fff3b[_0xcf67('0x2e')],function(_0x1d42eb){var _0x2ba8f1={};_0x2ba8f1[_0x1d42eb]={'$like':'%'+_0x51413e[_0xcf67('0x2b')][_0xcf67('0x37')]+'%'};return _0x2ba8f1;})});}_0x4fff3b=_['merge']({},_0x4fff3b,_0x51413e[_0xcf67('0x3f')]);return _0x1fa30e[_0xcf67('0x49')](_0x4fff3b);}})['then'](function(_0x1bbc26){if(_0x1bbc26){_0x49b215=_0x1bbc26[_0xcf67('0x30')];if(!_0x51413e['query'][_0xcf67('0x31')](_0xcf67('0x32'))){_0x4fff3b[_0xcf67('0x19')]=qs[_0xcf67('0x19')](_0x51413e[_0xcf67('0x2b')]['limit']);_0x4fff3b['offset']=qs[_0xcf67('0x17')](_0x51413e[_0xcf67('0x2b')]['offset']);}return _0x1fa30e[_0xcf67('0x49')](_0x4fff3b);}})['then'](function(_0x18e96e){if(_0x18e96e){return _0x18e96e?{'count':_0x49b215,'rows':_0x18e96e}:null;}})[_0xcf67('0x1f')](respondWithResult(_0xc52b13,null))[_0xcf67('0x3d')](handleError(_0xc52b13,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 18b1e1a..87a0e44 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 _0x6a2f=['request-promise','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash','../../config/logger','api','moment'];(function(_0x198e30,_0x491c9e){var _0x42aff5=function(_0x450ac0){while(--_0x450ac0){_0x198e30['push'](_0x198e30['shift']());}};_0x42aff5(++_0x491c9e);}(_0x6a2f,0x17f));var _0xf6a2=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0x6a2f[_0x54aea3];return _0x21ae46;};'use strict';var _=require(_0xf6a2('0x0'));var util=require('util');var logger=require(_0xf6a2('0x1'))(_0xf6a2('0x2'));var moment=require(_0xf6a2('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf6a2('0x5'));var attributes=require(_0xf6a2('0x6'));module['exports']=function(_0x4ab355,_0x21ed54){return _0x4ab355[_0xf6a2('0x7')]('SugarcrmConfiguration',attributes,{'tableName':_0xf6a2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa05d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa05d,0xdd));var _0xda05=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0xa05d[_0x46efd7];return _0x5637e4;};'use strict';var _=require('lodash');var util=require(_0xda05('0x0'));var logger=require(_0xda05('0x1'))(_0xda05('0x2'));var moment=require(_0xda05('0x3'));var BPromise=require(_0xda05('0x4'));var rp=require(_0xda05('0x5'));var fs=require('fs');var path=require(_0xda05('0x6'));var rimraf=require(_0xda05('0x7'));var config=require(_0xda05('0x8'));var attributes=require(_0xda05('0x9'));module[_0xda05('0xa')]=function(_0x5dd432,_0xdb8acc){return _0x5dd432[_0xda05('0xb')](_0xda05('0xc'),attributes,{'tableName':_0xda05('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 8f521db..05a89f6 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 _0x5497=['rpc','client','http','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x3db51d,_0x3b8d1b){var _0x217e76=function(_0x5298c5){while(--_0x5298c5){_0x3db51d['push'](_0x3db51d['shift']());}};_0x217e76(++_0x3b8d1b);}(_0x5497,0x1e8));var _0x7549=function(_0x4bf0bc,_0x2c6490){_0x4bf0bc=_0x4bf0bc-0x0;var _0x223837=_0x5497[_0x4bf0bc];return _0x223837;};'use strict';var _=require('lodash');var util=require(_0x7549('0x0'));var moment=require(_0x7549('0x1'));var BPromise=require(_0x7549('0x2'));var rs=require(_0x7549('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7549('0x4'));var logger=require(_0x7549('0x5'))(_0x7549('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7549('0x7')][_0x7549('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9fdb,_0x3b2483,_0x51c52a){return new BPromise(function(_0x864bd4,_0x3ef83f){return client['request'](_0x2b9fdb,_0x51c52a)['then'](function(_0x3144ba){logger['info'](_0x7549('0x9'),_0x3b2483,_0x7549('0xa'));logger['debug'](_0x7549('0xb'),_0x3b2483,_0x7549('0xa'),JSON[_0x7549('0xc')](_0x3144ba));if(_0x3144ba['error']){if(_0x3144ba[_0x7549('0xd')][_0x7549('0xe')]===0x1f4){logger[_0x7549('0xd')](_0x7549('0x9'),_0x3b2483,_0x3144ba[_0x7549('0xd')][_0x7549('0xf')]);return _0x3ef83f(_0x3144ba[_0x7549('0xd')]['message']);}logger['error'](_0x7549('0x9'),_0x3b2483,_0x3144ba['error'][_0x7549('0xf')]);return _0x864bd4(_0x3144ba['error'][_0x7549('0xf')]);}else{logger[_0x7549('0x10')](_0x7549('0x9'),_0x3b2483,_0x7549('0xa'));_0x864bd4(_0x3144ba[_0x7549('0x11')][_0x7549('0xf')]);}})[_0x7549('0x12')](function(_0x44095c){logger['error'](_0x7549('0x9'),_0x3b2483,_0x44095c);_0x3ef83f(_0x44095c);});});} \ No newline at end of file +var _0x5f56=['client','http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f56,0x1c2));var _0x65f5=function(_0x58418a,_0x3d9f06){_0x58418a=_0x58418a-0x0;var _0x2716bf=_0x5f56[_0x58418a];return _0x2716bf;};'use strict';var _=require('lodash');var util=require(_0x65f5('0x0'));var moment=require('moment');var BPromise=require(_0x65f5('0x1'));var rs=require(_0x65f5('0x2'));var fs=require('fs');var Redis=require(_0x65f5('0x3'));var db=require(_0x65f5('0x4'))['db'];var utils=require(_0x65f5('0x5'));var logger=require(_0x65f5('0x6'))(_0x65f5('0x7'));var config=require(_0x65f5('0x8'));var jayson=require(_0x65f5('0x9'));var client=jayson[_0x65f5('0xa')][_0x65f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x597951,_0x2900c4,_0x5e99a0){return new BPromise(function(_0x4f9512,_0x4fc5e7){return client[_0x65f5('0xc')](_0x597951,_0x5e99a0)['then'](function(_0xe75e08){logger[_0x65f5('0xd')](_0x65f5('0xe'),_0x2900c4,'request\x20sent');logger['debug'](_0x65f5('0xf'),_0x2900c4,_0x65f5('0x10'),JSON[_0x65f5('0x11')](_0xe75e08));if(_0xe75e08[_0x65f5('0x12')]){if(_0xe75e08['error'][_0x65f5('0x13')]===0x1f4){logger[_0x65f5('0x12')](_0x65f5('0xe'),_0x2900c4,_0xe75e08['error'][_0x65f5('0x14')]);return _0x4fc5e7(_0xe75e08[_0x65f5('0x12')]['message']);}logger[_0x65f5('0x12')](_0x65f5('0xe'),_0x2900c4,_0xe75e08[_0x65f5('0x12')][_0x65f5('0x14')]);return _0x4f9512(_0xe75e08[_0x65f5('0x12')][_0x65f5('0x14')]);}else{logger[_0x65f5('0xd')](_0x65f5('0xe'),_0x2900c4,'request\x20sent');_0x4f9512(_0xe75e08[_0x65f5('0x15')][_0x65f5('0x14')]);}})[_0x65f5('0x16')](function(_0x113ea1){logger[_0x65f5('0x12')](_0x65f5('0xe'),_0x2900c4,_0x113ea1);_0x4fc5e7(_0x113ea1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 111c970..960a1ea 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 _0xed6f=['isAuthenticated','index','post','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intSugarcrmField.controller','get'];(function(_0x269d1f,_0x15cec3){var _0x342bd7=function(_0x58cf22){while(--_0x58cf22){_0x269d1f['push'](_0x269d1f['shift']());}};_0x342bd7(++_0x15cec3);}(_0xed6f,0x1d8));var _0xfed6=function(_0x2acbce,_0x2b48d3){_0x2acbce=_0x2acbce-0x0;var _0x1de0e0=_0xed6f[_0x2acbce];return _0x1de0e0;};'use strict';var multer=require('multer');var util=require(_0xfed6('0x0'));var path=require(_0xfed6('0x1'));var timeout=require(_0xfed6('0x2'));var express=require(_0xfed6('0x3'));var router=express['Router']();var fs_extra=require(_0xfed6('0x4'));var auth=require(_0xfed6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfed6('0x6'));router[_0xfed6('0x7')]('/',auth[_0xfed6('0x8')](),controller[_0xfed6('0x9')]);router['get']('/:id',auth[_0xfed6('0x8')](),controller['show']);router[_0xfed6('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfed6('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfed6('0xc')](_0xfed6('0xd'),auth[_0xfed6('0x8')](),controller[_0xfed6('0xe')]);module[_0xfed6('0xf')]=router; \ No newline at end of file +var _0x9a29=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4a81c3,_0x504a70){var _0x17a34f=function(_0x1e3218){while(--_0x1e3218){_0x4a81c3['push'](_0x4a81c3['shift']());}};_0x17a34f(++_0x504a70);}(_0x9a29,0x11a));var _0x99a2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9a29[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x99a2('0x0'));var util=require(_0x99a2('0x1'));var path=require(_0x99a2('0x2'));var timeout=require(_0x99a2('0x3'));var express=require(_0x99a2('0x4'));var router=express[_0x99a2('0x5')]();var fs_extra=require(_0x99a2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x99a2('0x7'));var config=require(_0x99a2('0x8'));var controller=require(_0x99a2('0x9'));router[_0x99a2('0xa')]('/',auth[_0x99a2('0xb')](),controller[_0x99a2('0xc')]);router[_0x99a2('0xa')](_0x99a2('0xd'),auth[_0x99a2('0xb')](),controller[_0x99a2('0xe')]);router[_0x99a2('0xf')]('/',auth[_0x99a2('0xb')](),controller[_0x99a2('0x10')]);router[_0x99a2('0x11')](_0x99a2('0xd'),auth[_0x99a2('0xb')](),controller[_0x99a2('0x12')]);router[_0x99a2('0x13')](_0x99a2('0xd'),auth['isAuthenticated'](),controller[_0x99a2('0x14')]);module[_0x99a2('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8ca4b93..8251694 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 _0x9849=['STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x546e26,_0x18fc24){var _0x4702e7=function(_0x96ba40){while(--_0x96ba40){_0x546e26['push'](_0x546e26['shift']());}};_0x4702e7(++_0x18fc24);}(_0x9849,0x173));var _0x9984=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x9849[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require('sequelize');module[_0x9984('0x0')]={'type':{'type':Sequelize[_0x9984('0x1')]('string',_0x9984('0x2'),_0x9984('0x3'),_0x9984('0x4'),_0x9984('0x5')),'defaultValue':_0x9984('0x6')},'content':{'type':Sequelize[_0x9984('0x7')]},'key':{'type':Sequelize[_0x9984('0x7')]},'keyType':{'type':Sequelize[_0x9984('0x1')]('string','variable',_0x9984('0x3'))},'keyContent':{'type':Sequelize[_0x9984('0x7')]},'idField':{'type':Sequelize[_0x9984('0x7')]},'nameField':{'type':Sequelize[_0x9984('0x7')]},'customField':{'type':Sequelize[_0x9984('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4f00=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x3bf0b2,_0x271310){var _0x63ad3d=function(_0x251e6f){while(--_0x251e6f){_0x3bf0b2['push'](_0x3bf0b2['shift']());}};_0x63ad3d(++_0x271310);}(_0x4f00,0xfb));var _0x04f0=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x4f00[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x04f0('0x0'));module[_0x04f0('0x1')]={'type':{'type':Sequelize[_0x04f0('0x2')]('string',_0x04f0('0x3'),_0x04f0('0x4'),'keyValue','picklist'),'defaultValue':_0x04f0('0x5')},'content':{'type':Sequelize[_0x04f0('0x6')]},'key':{'type':Sequelize[_0x04f0('0x6')]},'keyType':{'type':Sequelize[_0x04f0('0x2')](_0x04f0('0x5'),_0x04f0('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x04f0('0x6')]},'nameField':{'type':Sequelize[_0x04f0('0x6')]},'customField':{'type':Sequelize[_0x04f0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x04f0('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index f6a011b..d0cfcd1 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 _0x5bc1=['undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','status','sendStatus','error','name','send','index','map','SugarcrmField','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','create','body','find','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','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','end','json','offset'];(function(_0x5b2175,_0x36947c){var _0x4f93a1=function(_0x60a0a6){while(--_0x60a0a6){_0x5b2175['push'](_0x5b2175['shift']());}};_0x4f93a1(++_0x36947c);}(_0x5bc1,0x1a4));var _0x15bc=function(_0x3b9bc0,_0x1c48df){_0x3b9bc0=_0x3b9bc0-0x0;var _0x9eeb03=_0x5bc1[_0x3b9bc0];return _0x9eeb03;};'use strict';var emlformat=require(_0x15bc('0x0'));var rimraf=require(_0x15bc('0x1'));var zipdir=require(_0x15bc('0x2'));var jsonpatch=require(_0x15bc('0x3'));var rp=require(_0x15bc('0x4'));var moment=require(_0x15bc('0x5'));var BPromise=require(_0x15bc('0x6'));var Mustache=require(_0x15bc('0x7'));var util=require(_0x15bc('0x8'));var path=require(_0x15bc('0x9'));var sox=require(_0x15bc('0xa'));var csv=require(_0x15bc('0xb'));var ejs=require(_0x15bc('0xc'));var fs=require('fs');var fs_extra=require(_0x15bc('0xd'));var _=require(_0x15bc('0xe'));var squel=require(_0x15bc('0xf'));var crypto=require(_0x15bc('0x10'));var jsforce=require(_0x15bc('0x11'));var deskjs=require(_0x15bc('0x12'));var toCsv=require('to-csv');var querystring=require(_0x15bc('0x13'));var Papa=require(_0x15bc('0x14'));var Redis=require('ioredis');var authService=require(_0x15bc('0x15'));var qs=require(_0x15bc('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x15bc('0x17'))(_0x15bc('0x18'));var utils=require(_0x15bc('0x19'));var config=require(_0x15bc('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28bdd1,_0x418e85){_0x418e85=_0x418e85||0xcc;return function(_0x3b7d1d){if(_0x3b7d1d){return _0x28bdd1['sendStatus'](_0x418e85);}return _0x28bdd1['status'](_0x418e85)[_0x15bc('0x1b')]();};}function respondWithResult(_0xe2013f,_0x4cb8e2){_0x4cb8e2=_0x4cb8e2||0xc8;return function(_0xff2a31){if(_0xff2a31){return _0xe2013f['status'](_0x4cb8e2)[_0x15bc('0x1c')](_0xff2a31);}};}function respondWithFilteredResult(_0x2465d4,_0x9bd41e){return function(_0x30755e){if(_0x30755e){var _0x387086=typeof _0x9bd41e[_0x15bc('0x1d')]===_0x15bc('0x1e')&&typeof _0x9bd41e[_0x15bc('0x1f')]===_0x15bc('0x1e');var _0x35f60a=_0x30755e[_0x15bc('0x20')];var _0x43b0d6=_0x387086?0x0:_0x9bd41e['offset'];var _0x2f7a6b=_0x387086?_0x30755e[_0x15bc('0x20')]:_0x9bd41e['offset']+_0x9bd41e[_0x15bc('0x1f')];var _0x1e2761;if(_0x2f7a6b>=_0x35f60a){_0x2f7a6b=_0x35f60a;_0x1e2761=0xc8;}else{_0x1e2761=0xce;}_0x2465d4['status'](_0x1e2761);return _0x2465d4[_0x15bc('0x21')](_0x15bc('0x22'),_0x43b0d6+'-'+_0x2f7a6b+'/'+_0x35f60a)['json'](_0x30755e);}return null;};}function patchUpdates(_0x36f203){return function(_0x2ddf75){try{jsonpatch[_0x15bc('0x23')](_0x2ddf75,_0x36f203,!![]);}catch(_0x589e17){return BPromise[_0x15bc('0x24')](_0x589e17);}return _0x2ddf75['save']();};}function saveUpdates(_0x37bd4e,_0x15910d){return function(_0x4d163b){if(_0x4d163b){return _0x4d163b[_0x15bc('0x25')](_0x37bd4e)[_0x15bc('0x26')](function(_0x5d053b){return _0x5d053b;});}return null;};}function removeEntity(_0x5ed66e,_0x2fb918){return function(_0x54f421){if(_0x54f421){return _0x54f421[_0x15bc('0x27')]()['then'](function(){_0x5ed66e[_0x15bc('0x28')](0xcc)[_0x15bc('0x1b')]();});}};}function handleEntityNotFound(_0xddb83b,_0x310e99){return function(_0x749b78){if(!_0x749b78){_0xddb83b[_0x15bc('0x29')](0x194);}return _0x749b78;};}function handleError(_0x4d3dc8,_0x245af6){_0x245af6=_0x245af6||0x1f4;return function(_0x3a98d2){logger[_0x15bc('0x2a')](_0x3a98d2['stack']);if(_0x3a98d2[_0x15bc('0x2b')]){delete _0x3a98d2[_0x15bc('0x2b')];}_0x4d3dc8['status'](_0x245af6)[_0x15bc('0x2c')](_0x3a98d2);};}exports[_0x15bc('0x2d')]=function(_0x1fefff,_0x2b0aff){var _0x5d98d2={},_0xe005c1={},_0x5c9e3d={'count':0x0,'rows':[]};var _0x1c477e=_[_0x15bc('0x2e')](db[_0x15bc('0x2f')][_0x15bc('0x30')],function(_0x5c7c88){return{'name':_0x5c7c88['fieldName'],'type':_0x5c7c88['type'][_0x15bc('0x31')]};});_0xe005c1['model']=_[_0x15bc('0x2e')](_0x1c477e,'name');_0xe005c1['query']=_[_0x15bc('0x32')](_0x1fefff[_0x15bc('0x33')]);_0xe005c1[_0x15bc('0x34')]=_[_0x15bc('0x35')](_0xe005c1[_0x15bc('0x36')],_0xe005c1['query']);_0x5d98d2[_0x15bc('0x37')]=_[_0x15bc('0x35')](_0xe005c1[_0x15bc('0x36')],qs[_0x15bc('0x38')](_0x1fefff['query']['fields']));_0x5d98d2[_0x15bc('0x37')]=_0x5d98d2[_0x15bc('0x37')][_0x15bc('0x39')]?_0x5d98d2[_0x15bc('0x37')]:_0xe005c1[_0x15bc('0x36')];if(!_0x1fefff[_0x15bc('0x33')][_0x15bc('0x3a')](_0x15bc('0x3b'))){_0x5d98d2['limit']=qs[_0x15bc('0x1f')](_0x1fefff[_0x15bc('0x33')][_0x15bc('0x1f')]);_0x5d98d2[_0x15bc('0x1d')]=qs['offset'](_0x1fefff[_0x15bc('0x33')]['offset']);}_0x5d98d2['order']=qs['sort'](_0x1fefff['query'][_0x15bc('0x3c')]);_0x5d98d2[_0x15bc('0x3d')]=qs[_0x15bc('0x34')](_[_0x15bc('0x3e')](_0x1fefff[_0x15bc('0x33')],_0xe005c1[_0x15bc('0x34')]),_0x1c477e);if(_0x1fefff[_0x15bc('0x33')][_0x15bc('0x3f')]){_0x5d98d2[_0x15bc('0x3d')]=_[_0x15bc('0x40')](_0x5d98d2[_0x15bc('0x3d')],{'$or':_[_0x15bc('0x2e')](_0x1c477e,function(_0x356fec){if(_0x356fec['type']!==_0x15bc('0x41')){var _0xbba27f={};_0xbba27f[_0x356fec[_0x15bc('0x2b')]]={'$like':'%'+_0x1fefff[_0x15bc('0x33')][_0x15bc('0x3f')]+'%'};return _0xbba27f;}})});}_0x5d98d2=_['merge']({},_0x5d98d2,_0x1fefff[_0x15bc('0x42')]);var _0x2b0bf9={'where':_0x5d98d2[_0x15bc('0x3d')]};return db[_0x15bc('0x2f')][_0x15bc('0x20')](_0x2b0bf9)[_0x15bc('0x26')](function(_0x411c90){_0x5c9e3d[_0x15bc('0x20')]=_0x411c90;if(_0x1fefff[_0x15bc('0x33')]['includeAll']){_0x5d98d2['include']=[{'all':!![]}];}return db[_0x15bc('0x2f')]['findAll'](_0x5d98d2);})[_0x15bc('0x26')](function(_0x3d4758){_0x5c9e3d[_0x15bc('0x43')]=_0x3d4758;return _0x5c9e3d;})[_0x15bc('0x26')](respondWithFilteredResult(_0x2b0aff,_0x5d98d2))[_0x15bc('0x44')](handleError(_0x2b0aff,null));};exports[_0x15bc('0x45')]=function(_0x29e284,_0x57a864){var _0x5609a0={'raw':!![],'where':{'id':_0x29e284[_0x15bc('0x46')]['id']}},_0x178e2a={};_0x178e2a['model']=_[_0x15bc('0x32')](db[_0x15bc('0x2f')][_0x15bc('0x30')]);_0x178e2a[_0x15bc('0x33')]=_[_0x15bc('0x32')](_0x29e284[_0x15bc('0x33')]);_0x178e2a[_0x15bc('0x34')]=_[_0x15bc('0x35')](_0x178e2a['model'],_0x178e2a[_0x15bc('0x33')]);_0x5609a0[_0x15bc('0x37')]=_[_0x15bc('0x35')](_0x178e2a[_0x15bc('0x36')],qs['fields'](_0x29e284[_0x15bc('0x33')][_0x15bc('0x38')]));_0x5609a0[_0x15bc('0x37')]=_0x5609a0[_0x15bc('0x37')][_0x15bc('0x39')]?_0x5609a0[_0x15bc('0x37')]:_0x178e2a[_0x15bc('0x36')];if(_0x29e284[_0x15bc('0x33')][_0x15bc('0x47')]){_0x5609a0['include']=[{'all':!![]}];}_0x5609a0=_['merge']({},_0x5609a0,_0x29e284[_0x15bc('0x42')]);return db[_0x15bc('0x2f')]['find'](_0x5609a0)[_0x15bc('0x26')](handleEntityNotFound(_0x57a864,null))[_0x15bc('0x26')](respondWithResult(_0x57a864,null))[_0x15bc('0x44')](handleError(_0x57a864,null));};exports['create']=function(_0x421f3c,_0x15aae5){return db[_0x15bc('0x2f')][_0x15bc('0x48')](_0x421f3c[_0x15bc('0x49')],{})[_0x15bc('0x26')](respondWithResult(_0x15aae5,0xc9))[_0x15bc('0x44')](handleError(_0x15aae5,null));};exports[_0x15bc('0x25')]=function(_0x363430,_0x460142){if(_0x363430['body']['id']){delete _0x363430[_0x15bc('0x49')]['id'];}return db[_0x15bc('0x2f')][_0x15bc('0x4a')]({'where':{'id':_0x363430[_0x15bc('0x46')]['id']}})['then'](handleEntityNotFound(_0x460142,null))[_0x15bc('0x26')](saveUpdates(_0x363430['body'],null))[_0x15bc('0x26')](respondWithResult(_0x460142,null))['catch'](handleError(_0x460142,null));};exports[_0x15bc('0x27')]=function(_0x57959e,_0x464301){return db[_0x15bc('0x2f')][_0x15bc('0x4a')]({'where':{'id':_0x57959e[_0x15bc('0x46')]['id']}})['then'](handleEntityNotFound(_0x464301,null))['then'](removeEntity(_0x464301,null))[_0x15bc('0x44')](handleError(_0x464301,null));}; \ No newline at end of file +var _0x1842=['find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','apply','reject','save','update','destroy','then','end','send','index','map','SugarcrmField','rawAttributes','key','model','name','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','show','params','include','merge'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x1842,0x171));var _0x2184=function(_0x6181a4,_0x3df1e7){_0x6181a4=_0x6181a4-0x0;var _0x263199=_0x1842[_0x6181a4];return _0x263199;};'use strict';var emlformat=require(_0x2184('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2184('0x1'));var jsonpatch=require(_0x2184('0x2'));var rp=require(_0x2184('0x3'));var moment=require(_0x2184('0x4'));var BPromise=require(_0x2184('0x5'));var Mustache=require('mustache');var util=require(_0x2184('0x6'));var path=require(_0x2184('0x7'));var sox=require(_0x2184('0x8'));var csv=require(_0x2184('0x9'));var ejs=require(_0x2184('0xa'));var fs=require('fs');var fs_extra=require(_0x2184('0xb'));var _=require('lodash');var squel=require(_0x2184('0xc'));var crypto=require(_0x2184('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2184('0xe'));var toCsv=require(_0x2184('0x9'));var querystring=require(_0x2184('0xf'));var Papa=require(_0x2184('0x10'));var Redis=require(_0x2184('0x11'));var authService=require(_0x2184('0x12'));var qs=require(_0x2184('0x13'));var as=require(_0x2184('0x14'));var hardwareService=require(_0x2184('0x15'));var logger=require(_0x2184('0x16'))(_0x2184('0x17'));var utils=require(_0x2184('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2184('0x19'));var db=require(_0x2184('0x1a'))['db'];function respondWithStatusCode(_0x1b53ff,_0x301e5e){_0x301e5e=_0x301e5e||0xcc;return function(_0x3d80e5){if(_0x3d80e5){return _0x1b53ff[_0x2184('0x1b')](_0x301e5e);}return _0x1b53ff[_0x2184('0x1c')](_0x301e5e)['end']();};}function respondWithResult(_0x63629c,_0xafebdc){_0xafebdc=_0xafebdc||0xc8;return function(_0x48e0a6){if(_0x48e0a6){return _0x63629c['status'](_0xafebdc)[_0x2184('0x1d')](_0x48e0a6);}};}function respondWithFilteredResult(_0x281cf9,_0x4aa82c){return function(_0x8d4204){if(_0x8d4204){var _0x570e49=typeof _0x4aa82c[_0x2184('0x1e')]==='undefined'&&typeof _0x4aa82c[_0x2184('0x1f')]==='undefined';var _0x5ab1aa=_0x8d4204[_0x2184('0x20')];var _0x572f98=_0x570e49?0x0:_0x4aa82c['offset'];var _0x13cf7f=_0x570e49?_0x8d4204[_0x2184('0x20')]:_0x4aa82c['offset']+_0x4aa82c[_0x2184('0x1f')];var _0x51e889;if(_0x13cf7f>=_0x5ab1aa){_0x13cf7f=_0x5ab1aa;_0x51e889=0xc8;}else{_0x51e889=0xce;}_0x281cf9[_0x2184('0x1c')](_0x51e889);return _0x281cf9['set']('Content-Range',_0x572f98+'-'+_0x13cf7f+'/'+_0x5ab1aa)['json'](_0x8d4204);}return null;};}function patchUpdates(_0x3c12d0){return function(_0x27b2d8){try{jsonpatch[_0x2184('0x21')](_0x27b2d8,_0x3c12d0,!![]);}catch(_0x2d214c){return BPromise[_0x2184('0x22')](_0x2d214c);}return _0x27b2d8[_0x2184('0x23')]();};}function saveUpdates(_0x219fbb,_0x2bd43){return function(_0x2690e7){if(_0x2690e7){return _0x2690e7[_0x2184('0x24')](_0x219fbb)['then'](function(_0x1ff954){return _0x1ff954;});}return null;};}function removeEntity(_0x518757,_0x4e8efd){return function(_0x5ed594){if(_0x5ed594){return _0x5ed594[_0x2184('0x25')]()[_0x2184('0x26')](function(){_0x518757[_0x2184('0x1c')](0xcc)[_0x2184('0x27')]();});}};}function handleEntityNotFound(_0x2318a8,_0x3db6f7){return function(_0x23e7d8){if(!_0x23e7d8){_0x2318a8['sendStatus'](0x194);}return _0x23e7d8;};}function handleError(_0xb68b4e,_0x2ad268){_0x2ad268=_0x2ad268||0x1f4;return function(_0x454ef6){logger['error'](_0x454ef6['stack']);if(_0x454ef6['name']){delete _0x454ef6['name'];}_0xb68b4e[_0x2184('0x1c')](_0x2ad268)[_0x2184('0x28')](_0x454ef6);};}exports[_0x2184('0x29')]=function(_0xf1005a,_0x5ce5fe){var _0x28e7f7={},_0x25d437={},_0x43fdc5={'count':0x0,'rows':[]};var _0x438178=_[_0x2184('0x2a')](db[_0x2184('0x2b')][_0x2184('0x2c')],function(_0x5b5ead){return{'name':_0x5b5ead['fieldName'],'type':_0x5b5ead['type'][_0x2184('0x2d')]};});_0x25d437[_0x2184('0x2e')]=_['map'](_0x438178,_0x2184('0x2f'));_0x25d437['query']=_[_0x2184('0x30')](_0xf1005a[_0x2184('0x31')]);_0x25d437[_0x2184('0x32')]=_[_0x2184('0x33')](_0x25d437[_0x2184('0x2e')],_0x25d437['query']);_0x28e7f7[_0x2184('0x34')]=_[_0x2184('0x33')](_0x25d437['model'],qs['fields'](_0xf1005a['query'][_0x2184('0x35')]));_0x28e7f7['attributes']=_0x28e7f7[_0x2184('0x34')][_0x2184('0x36')]?_0x28e7f7[_0x2184('0x34')]:_0x25d437['model'];if(!_0xf1005a[_0x2184('0x31')]['hasOwnProperty']('nolimit')){_0x28e7f7[_0x2184('0x1f')]=qs[_0x2184('0x1f')](_0xf1005a[_0x2184('0x31')][_0x2184('0x1f')]);_0x28e7f7['offset']=qs[_0x2184('0x1e')](_0xf1005a[_0x2184('0x31')][_0x2184('0x1e')]);}_0x28e7f7[_0x2184('0x37')]=qs[_0x2184('0x38')](_0xf1005a[_0x2184('0x31')]['sort']);_0x28e7f7[_0x2184('0x39')]=qs[_0x2184('0x32')](_[_0x2184('0x3a')](_0xf1005a[_0x2184('0x31')],_0x25d437[_0x2184('0x32')]),_0x438178);if(_0xf1005a[_0x2184('0x31')][_0x2184('0x3b')]){_0x28e7f7[_0x2184('0x39')]=_['merge'](_0x28e7f7[_0x2184('0x39')],{'$or':_['map'](_0x438178,function(_0x43ca92){if(_0x43ca92[_0x2184('0x3c')]!==_0x2184('0x3d')){var _0x205f75={};_0x205f75[_0x43ca92[_0x2184('0x2f')]]={'$like':'%'+_0xf1005a['query'][_0x2184('0x3b')]+'%'};return _0x205f75;}})});}_0x28e7f7=_['merge']({},_0x28e7f7,_0xf1005a[_0x2184('0x3e')]);var _0x2ff955={'where':_0x28e7f7[_0x2184('0x39')]};return db[_0x2184('0x2b')][_0x2184('0x20')](_0x2ff955)[_0x2184('0x26')](function(_0x54b3ed){_0x43fdc5[_0x2184('0x20')]=_0x54b3ed;if(_0xf1005a[_0x2184('0x31')][_0x2184('0x3f')]){_0x28e7f7['include']=[{'all':!![]}];}return db['SugarcrmField'][_0x2184('0x40')](_0x28e7f7);})[_0x2184('0x26')](function(_0x4c83c2){_0x43fdc5['rows']=_0x4c83c2;return _0x43fdc5;})[_0x2184('0x26')](respondWithFilteredResult(_0x5ce5fe,_0x28e7f7))['catch'](handleError(_0x5ce5fe,null));};exports[_0x2184('0x41')]=function(_0x51890c,_0x49031e){var _0x46d53c={'raw':!![],'where':{'id':_0x51890c[_0x2184('0x42')]['id']}},_0x11b7d0={};_0x11b7d0[_0x2184('0x2e')]=_[_0x2184('0x30')](db[_0x2184('0x2b')]['rawAttributes']);_0x11b7d0[_0x2184('0x31')]=_['keys'](_0x51890c[_0x2184('0x31')]);_0x11b7d0[_0x2184('0x32')]=_[_0x2184('0x33')](_0x11b7d0['model'],_0x11b7d0[_0x2184('0x31')]);_0x46d53c[_0x2184('0x34')]=_[_0x2184('0x33')](_0x11b7d0[_0x2184('0x2e')],qs[_0x2184('0x35')](_0x51890c['query']['fields']));_0x46d53c[_0x2184('0x34')]=_0x46d53c[_0x2184('0x34')]['length']?_0x46d53c[_0x2184('0x34')]:_0x11b7d0[_0x2184('0x2e')];if(_0x51890c[_0x2184('0x31')]['includeAll']){_0x46d53c[_0x2184('0x43')]=[{'all':!![]}];}_0x46d53c=_[_0x2184('0x44')]({},_0x46d53c,_0x51890c[_0x2184('0x3e')]);return db[_0x2184('0x2b')][_0x2184('0x45')](_0x46d53c)[_0x2184('0x26')](handleEntityNotFound(_0x49031e,null))[_0x2184('0x26')](respondWithResult(_0x49031e,null))[_0x2184('0x46')](handleError(_0x49031e,null));};exports[_0x2184('0x47')]=function(_0x4e5218,_0x1304fc){return db[_0x2184('0x2b')]['create'](_0x4e5218['body'],{})[_0x2184('0x26')](respondWithResult(_0x1304fc,0xc9))[_0x2184('0x46')](handleError(_0x1304fc,null));};exports[_0x2184('0x24')]=function(_0x25feb5,_0x359b17){if(_0x25feb5[_0x2184('0x48')]['id']){delete _0x25feb5[_0x2184('0x48')]['id'];}return db[_0x2184('0x2b')][_0x2184('0x45')]({'where':{'id':_0x25feb5[_0x2184('0x42')]['id']}})[_0x2184('0x26')](handleEntityNotFound(_0x359b17,null))['then'](saveUpdates(_0x25feb5[_0x2184('0x48')],null))['then'](respondWithResult(_0x359b17,null))[_0x2184('0x46')](handleError(_0x359b17,null));};exports[_0x2184('0x25')]=function(_0x4c8432,_0x373e60){return db[_0x2184('0x2b')][_0x2184('0x45')]({'where':{'id':_0x4c8432[_0x2184('0x42')]['id']}})['then'](handleEntityNotFound(_0x373e60,null))[_0x2184('0x26')](removeEntity(_0x373e60,null))[_0x2184('0x46')](handleError(_0x373e60,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a42511e..58f3c8d 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 _0x42eb=['define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x534412,_0x25125e){var _0x5bc2d5=function(_0x3ab842){while(--_0x3ab842){_0x534412['push'](_0x534412['shift']());}};_0x5bc2d5(++_0x25125e);}(_0x42eb,0x1d3));var _0xb42e=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x42eb[_0x54defc];return _0x1955d3;};'use strict';var _=require('lodash');var util=require(_0xb42e('0x0'));var logger=require('../../config/logger')(_0xb42e('0x1'));var moment=require(_0xb42e('0x2'));var BPromise=require(_0xb42e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb42e('0x4'));var rimraf=require(_0xb42e('0x5'));var config=require(_0xb42e('0x6'));var attributes=require(_0xb42e('0x7'));module[_0xb42e('0x8')]=function(_0x5cbc9f,_0x33f542){return _0x5cbc9f[_0xb42e('0x9')]('SugarcrmField',attributes,{'tableName':_0xb42e('0xa'),'paranoid':![],'indexes':[{'name':_0xb42e('0xb'),'fields':[_0xb42e('0xc'),_0xb42e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3292=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x55e532,_0x2ce26d){var _0x2e7bc1=function(_0xff2ed8){while(--_0xff2ed8){_0x55e532['push'](_0x55e532['shift']());}};_0x2e7bc1(++_0x2ce26d);}(_0x3292,0x1d1));var _0x2329=function(_0x198d77,_0x57932f){_0x198d77=_0x198d77-0x0;var _0xca7c1a=_0x3292[_0x198d77];return _0xca7c1a;};'use strict';var _=require(_0x2329('0x0'));var util=require(_0x2329('0x1'));var logger=require(_0x2329('0x2'))(_0x2329('0x3'));var moment=require(_0x2329('0x4'));var BPromise=require(_0x2329('0x5'));var rp=require(_0x2329('0x6'));var fs=require('fs');var path=require(_0x2329('0x7'));var rimraf=require(_0x2329('0x8'));var config=require('../../config/environment');var attributes=require('./intSugarcrmField.attributes');module[_0x2329('0x9')]=function(_0x3133c3,_0x856242){return _0x3133c3[_0x2329('0xa')](_0x2329('0xb'),attributes,{'tableName':_0x2329('0xc'),'paranoid':![],'indexes':[{'name':_0x2329('0xd'),'fields':[_0x2329('0xe'),_0x2329('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 7c6fb22..5d223e6 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 _0xb17b=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0x3f6c29,_0x370d86){var _0x4af959=function(_0x263612){while(--_0x263612){_0x3f6c29['push'](_0x3f6c29['shift']());}};_0x4af959(++_0x370d86);}(_0xb17b,0x142));var _0xbb17=function(_0x448516,_0x3559ad){_0x448516=_0x448516-0x0;var _0x137d26=_0xb17b[_0x448516];return _0x137d26;};'use strict';var _=require(_0xbb17('0x0'));var util=require(_0xbb17('0x1'));var moment=require(_0xbb17('0x2'));var BPromise=require(_0xbb17('0x3'));var rs=require(_0xbb17('0x4'));var fs=require('fs');var Redis=require(_0xbb17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb17('0x6'));var logger=require('../../config/logger')(_0xbb17('0x7'));var config=require('../../config/environment');var jayson=require(_0xbb17('0x8'));var client=jayson[_0xbb17('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44d166,_0x3b4ee1,_0x5ea1c1){return new BPromise(function(_0x4fc92c,_0x47344b){return client[_0xbb17('0xa')](_0x44d166,_0x5ea1c1)[_0xbb17('0xb')](function(_0x5998c5){logger[_0xbb17('0xc')](_0xbb17('0xd'),_0x3b4ee1,_0xbb17('0xe'));logger['debug'](_0xbb17('0xf'),_0x3b4ee1,_0xbb17('0xe'),JSON[_0xbb17('0x10')](_0x5998c5));if(_0x5998c5[_0xbb17('0x11')]){if(_0x5998c5['error']['code']===0x1f4){logger[_0xbb17('0x11')](_0xbb17('0xd'),_0x3b4ee1,_0x5998c5[_0xbb17('0x11')][_0xbb17('0x12')]);return _0x47344b(_0x5998c5['error'][_0xbb17('0x12')]);}logger[_0xbb17('0x11')](_0xbb17('0xd'),_0x3b4ee1,_0x5998c5[_0xbb17('0x11')][_0xbb17('0x12')]);return _0x4fc92c(_0x5998c5[_0xbb17('0x11')][_0xbb17('0x12')]);}else{logger[_0xbb17('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x3b4ee1,_0xbb17('0xe'));_0x4fc92c(_0x5998c5['result'][_0xbb17('0x12')]);}})['catch'](function(_0x53e363){logger[_0xbb17('0x11')](_0xbb17('0xd'),_0x3b4ee1,_0x53e363);_0x47344b(_0x53e363);});});} \ No newline at end of file +var _0x0952=['debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','info','SugarcrmField,\x20%s,\x20%s'];(function(_0xb2e670,_0x436e56){var _0x598b6b=function(_0x5ecdd8){while(--_0x5ecdd8){_0xb2e670['push'](_0xb2e670['shift']());}};_0x598b6b(++_0x436e56);}(_0x0952,0x95));var _0x2095=function(_0x1c9715,_0x94bdcf){_0x1c9715=_0x1c9715-0x0;var _0x43eb5e=_0x0952[_0x1c9715];return _0x43eb5e;};'use strict';var _=require(_0x2095('0x0'));var util=require(_0x2095('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2095('0x2'));var fs=require('fs');var Redis=require(_0x2095('0x3'));var db=require(_0x2095('0x4'))['db'];var utils=require(_0x2095('0x5'));var logger=require(_0x2095('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2095('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33be46,_0x5d7407,_0xa0d669){return new BPromise(function(_0x1bb3d0,_0x458a4a){return client[_0x2095('0x8')](_0x33be46,_0xa0d669)['then'](function(_0x3cc658){logger[_0x2095('0x9')](_0x2095('0xa'),_0x5d7407,'request\x20sent');logger[_0x2095('0xb')](_0x2095('0xc'),_0x5d7407,_0x2095('0xd'),JSON[_0x2095('0xe')](_0x3cc658));if(_0x3cc658['error']){if(_0x3cc658['error'][_0x2095('0xf')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x5d7407,_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);return _0x458a4a(_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);}logger[_0x2095('0x10')](_0x2095('0xa'),_0x5d7407,_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);return _0x1bb3d0(_0x3cc658[_0x2095('0x10')][_0x2095('0x11')]);}else{logger['info'](_0x2095('0xa'),_0x5d7407,_0x2095('0xd'));_0x1bb3d0(_0x3cc658[_0x2095('0x12')][_0x2095('0x11')]);}})[_0x2095('0x13')](function(_0x579675){logger[_0x2095('0x10')](_0x2095('0xa'),_0x5d7407,_0x579675);_0x458a4a(_0x579675);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 01e5fdb..625dff2 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 _0xea70=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x325f1a,_0x44cea5){var _0x15f0fd=function(_0x23407c){while(--_0x23407c){_0x325f1a['push'](_0x325f1a['shift']());}};_0x15f0fd(++_0x44cea5);}(_0xea70,0x175));var _0x0ea7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xea70[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0ea7('0x0'));var util=require(_0x0ea7('0x1'));var path=require(_0x0ea7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ea7('0x3'));var router=express['Router']();var fs_extra=require(_0x0ea7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0ea7('0x5'));var config=require(_0x0ea7('0x6'));var controller=require(_0x0ea7('0x7'));router[_0x0ea7('0x8')]('/',auth[_0x0ea7('0x9')](),controller['index']);router[_0x0ea7('0x8')](_0x0ea7('0xa'),auth['isAuthenticated'](),controller[_0x0ea7('0xb')]);router[_0x0ea7('0x8')]('/:id/configurations',auth[_0x0ea7('0x9')](),controller[_0x0ea7('0xc')]);router[_0x0ea7('0x8')](_0x0ea7('0xd'),auth['isAuthenticated'](),controller[_0x0ea7('0xe')]);router[_0x0ea7('0xf')]('/',auth[_0x0ea7('0x9')](),controller[_0x0ea7('0x10')]);router[_0x0ea7('0xf')]('/:id/configurations',auth[_0x0ea7('0x9')](),controller[_0x0ea7('0x11')]);router[_0x0ea7('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0ea7('0x13')](_0x0ea7('0xa'),auth[_0x0ea7('0x9')](),controller[_0x0ea7('0x14')]);module['exports']=router; \ No newline at end of file +var _0x925e=['exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','/:id'];(function(_0x34967e,_0x11f483){var _0x406971=function(_0xc805e3){while(--_0xc805e3){_0x34967e['push'](_0x34967e['shift']());}};_0x406971(++_0x11f483);}(_0x925e,0x199));var _0xe925=function(_0x19f733,_0x332935){_0x19f733=_0x19f733-0x0;var _0x5795e8=_0x925e[_0x19f733];return _0x5795e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe925('0x0'));var timeout=require(_0xe925('0x1'));var express=require(_0xe925('0x2'));var router=express['Router']();var fs_extra=require(_0xe925('0x3'));var auth=require(_0xe925('0x4'));var interaction=require(_0xe925('0x5'));var config=require(_0xe925('0x6'));var controller=require(_0xe925('0x7'));router[_0xe925('0x8')]('/',auth[_0xe925('0x9')](),controller[_0xe925('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe925('0xb')]);router['get'](_0xe925('0xc'),auth['isAuthenticated'](),controller[_0xe925('0xd')]);router[_0xe925('0x8')](_0xe925('0xe'),auth[_0xe925('0x9')](),controller[_0xe925('0xf')]);router[_0xe925('0x10')]('/',auth[_0xe925('0x9')](),controller[_0xe925('0x11')]);router[_0xe925('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe925('0x12')]);router[_0xe925('0x13')]('/:id',auth[_0xe925('0x9')](),controller[_0xe925('0x14')]);router[_0xe925('0x15')](_0xe925('0x16'),auth[_0xe925('0x9')](),controller['destroy']);module[_0xe925('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 6838430..9d4032a 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 _0x861a=['exports','STRING','HelpDesk','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x861a,0x117));var _0xa861=function(_0x1b058f,_0x5eeb2c){_0x1b058f=_0x1b058f-0x0;var _0x2148df=_0x861a[_0x1b058f];return _0x2148df;};'use strict';var Sequelize=require(_0xa861('0x0'));module[_0xa861('0x1')]={'name':{'type':Sequelize[_0xa861('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa861('0x2')]},'username':{'type':Sequelize[_0xa861('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa861('0x2')],'allowNull':![],'defaultValue':_0xa861('0x3')},'remoteUri':{'type':Sequelize[_0xa861('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xa861('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x77e3=['sequelize','exports','STRING','HelpDesk'];(function(_0xd63549,_0x5068b1){var _0xb2c2de=function(_0x2053ef){while(--_0x2053ef){_0xd63549['push'](_0xd63549['shift']());}};_0xb2c2de(++_0x5068b1);}(_0x77e3,0x130));var _0x377e=function(_0x49cfb6,_0x5ccff2){_0x49cfb6=_0x49cfb6-0x0;var _0x1ba905=_0x77e3[_0x49cfb6];return _0x1ba905;};'use strict';var Sequelize=require(_0x377e('0x0'));module[_0x377e('0x1')]={'name':{'type':Sequelize[_0x377e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x377e('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x377e('0x3')},'remoteUri':{'type':Sequelize[_0x377e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 7bd8d32..0172d43 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 _0x1ca3=['nolimit','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','intersection','create','body','find','getConfigurations','VtigerConfiguration','order','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','VtigerField','Subjects','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','GET','getchallenge','login','result','token','describe','success','autogenerated','remove','false','label','cf_','picklist','picklistValues','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty'];(function(_0xa67fe7,_0x5c1204){var _0x203834=function(_0x2d6865){while(--_0x2d6865){_0xa67fe7['push'](_0xa67fe7['shift']());}};_0x203834(++_0x5c1204);}(_0x1ca3,0xb0));var _0x31ca=function(_0x5e0574,_0xf5e161){_0x5e0574=_0x5e0574-0x0;var _0x1fdd1b=_0x1ca3[_0x5e0574];return _0x1fdd1b;};'use strict';var emlformat=require(_0x31ca('0x0'));var rimraf=require(_0x31ca('0x1'));var zipdir=require(_0x31ca('0x2'));var jsonpatch=require(_0x31ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x31ca('0x4'));var util=require('util');var path=require('path');var sox=require(_0x31ca('0x5'));var csv=require(_0x31ca('0x6'));var ejs=require(_0x31ca('0x7'));var fs=require('fs');var fs_extra=require(_0x31ca('0x8'));var _=require(_0x31ca('0x9'));var squel=require(_0x31ca('0xa'));var crypto=require(_0x31ca('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x31ca('0xc'));var toCsv=require(_0x31ca('0x6'));var querystring=require(_0x31ca('0xd'));var Papa=require('papaparse');var Redis=require(_0x31ca('0xe'));var authService=require(_0x31ca('0xf'));var qs=require(_0x31ca('0x10'));var as=require(_0x31ca('0x11'));var hardwareService=require(_0x31ca('0x12'));var logger=require('../../config/logger')(_0x31ca('0x13'));var utils=require(_0x31ca('0x14'));var config=require(_0x31ca('0x15'));var licenseUtil=require(_0x31ca('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x31ca('0x17'));function respondWithStatusCode(_0x5c3403,_0x37a5a5){_0x37a5a5=_0x37a5a5||0xcc;return function(_0x445ef6){if(_0x445ef6){return _0x5c3403[_0x31ca('0x18')](_0x37a5a5);}return _0x5c3403[_0x31ca('0x19')](_0x37a5a5)[_0x31ca('0x1a')]();};}function respondWithResult(_0x527fc9,_0x594320){_0x594320=_0x594320||0xc8;return function(_0x41f285){if(_0x41f285){return _0x527fc9[_0x31ca('0x19')](_0x594320)[_0x31ca('0x1b')](_0x41f285);}};}function respondWithFilteredResult(_0x39a5ef,_0x4c84e3){return function(_0x48fa6f){if(_0x48fa6f){var _0x472f0c=typeof _0x4c84e3[_0x31ca('0x1c')]===_0x31ca('0x1d')&&typeof _0x4c84e3[_0x31ca('0x1e')]===_0x31ca('0x1d');var _0x2d5510=_0x48fa6f['count'];var _0x546c44=_0x472f0c?0x0:_0x4c84e3[_0x31ca('0x1c')];var _0x54696c=_0x472f0c?_0x48fa6f['count']:_0x4c84e3['offset']+_0x4c84e3[_0x31ca('0x1e')];var _0x35c75d;if(_0x54696c>=_0x2d5510){_0x54696c=_0x2d5510;_0x35c75d=0xc8;}else{_0x35c75d=0xce;}_0x39a5ef[_0x31ca('0x19')](_0x35c75d);return _0x39a5ef[_0x31ca('0x1f')](_0x31ca('0x20'),_0x546c44+'-'+_0x54696c+'/'+_0x2d5510)[_0x31ca('0x1b')](_0x48fa6f);}return null;};}function patchUpdates(_0x53fe66){return function(_0x28253c){try{jsonpatch[_0x31ca('0x21')](_0x28253c,_0x53fe66,!![]);}catch(_0x5593b7){return BPromise['reject'](_0x5593b7);}return _0x28253c[_0x31ca('0x22')]();};}function saveUpdates(_0x419309,_0x5a331c){return function(_0x15bb1d){if(_0x15bb1d){return _0x15bb1d[_0x31ca('0x23')](_0x419309)[_0x31ca('0x24')](function(_0x6ac07d){return _0x6ac07d;});}return null;};}function removeEntity(_0x1c9a9e,_0x55f439){return function(_0x3ff827){if(_0x3ff827){return _0x3ff827[_0x31ca('0x25')]()[_0x31ca('0x24')](function(){_0x1c9a9e['status'](0xcc)[_0x31ca('0x1a')]();});}};}function handleEntityNotFound(_0x17f2e9,_0x43b848){return function(_0x577e46){if(!_0x577e46){_0x17f2e9[_0x31ca('0x18')](0x194);}return _0x577e46;};}function handleError(_0x533da4,_0x455867){_0x455867=_0x455867||0x1f4;return function(_0x270f06){logger[_0x31ca('0x26')](_0x270f06[_0x31ca('0x27')]);if(_0x270f06[_0x31ca('0x28')]){delete _0x270f06[_0x31ca('0x28')];}_0x533da4[_0x31ca('0x19')](_0x455867)[_0x31ca('0x29')](_0x270f06);};}exports[_0x31ca('0x2a')]=function(_0x24c008,_0x400f6f){var _0x3c0f67={},_0x22d389={},_0x5dd6d7={'count':0x0,'rows':[]};var _0x2e6a68=_[_0x31ca('0x2b')](db[_0x31ca('0x2c')]['rawAttributes'],function(_0x28a311){return{'name':_0x28a311[_0x31ca('0x2d')],'type':_0x28a311[_0x31ca('0x2e')][_0x31ca('0x2f')]};});_0x22d389[_0x31ca('0x30')]=_[_0x31ca('0x2b')](_0x2e6a68,_0x31ca('0x28'));_0x22d389[_0x31ca('0x31')]=_[_0x31ca('0x32')](_0x24c008['query']);_0x22d389[_0x31ca('0x33')]=_['intersection'](_0x22d389['model'],_0x22d389[_0x31ca('0x31')]);_0x3c0f67[_0x31ca('0x34')]=_['intersection'](_0x22d389['model'],qs[_0x31ca('0x35')](_0x24c008[_0x31ca('0x31')][_0x31ca('0x35')]));_0x3c0f67[_0x31ca('0x34')]=_0x3c0f67[_0x31ca('0x34')][_0x31ca('0x36')]?_0x3c0f67[_0x31ca('0x34')]:_0x22d389[_0x31ca('0x30')];if(!_0x24c008[_0x31ca('0x31')][_0x31ca('0x37')](_0x31ca('0x38'))){_0x3c0f67['limit']=qs['limit'](_0x24c008['query'][_0x31ca('0x1e')]);_0x3c0f67[_0x31ca('0x1c')]=qs[_0x31ca('0x1c')](_0x24c008[_0x31ca('0x31')][_0x31ca('0x1c')]);}_0x3c0f67['order']=qs[_0x31ca('0x39')](_0x24c008['query'][_0x31ca('0x39')]);_0x3c0f67[_0x31ca('0x3a')]=qs[_0x31ca('0x33')](_[_0x31ca('0x3b')](_0x24c008[_0x31ca('0x31')],_0x22d389[_0x31ca('0x33')]),_0x2e6a68);if(_0x24c008[_0x31ca('0x31')][_0x31ca('0x3c')]){_0x3c0f67[_0x31ca('0x3a')]=_['merge'](_0x3c0f67[_0x31ca('0x3a')],{'$or':_['map'](_0x2e6a68,function(_0x5da123){if(_0x5da123[_0x31ca('0x2e')]!==_0x31ca('0x3d')){var _0x4a184b={};_0x4a184b[_0x5da123['name']]={'$like':'%'+_0x24c008[_0x31ca('0x31')][_0x31ca('0x3c')]+'%'};return _0x4a184b;}})});}_0x3c0f67=_[_0x31ca('0x3e')]({},_0x3c0f67,_0x24c008[_0x31ca('0x3f')]);var _0x500bba={'where':_0x3c0f67[_0x31ca('0x3a')]};return db[_0x31ca('0x2c')][_0x31ca('0x40')](_0x500bba)[_0x31ca('0x24')](function(_0x2027ab){_0x5dd6d7[_0x31ca('0x40')]=_0x2027ab;if(_0x24c008[_0x31ca('0x31')][_0x31ca('0x41')]){_0x3c0f67[_0x31ca('0x42')]=[{'all':!![]}];}return db[_0x31ca('0x2c')][_0x31ca('0x43')](_0x3c0f67);})[_0x31ca('0x24')](function(_0x4a7bd8){_0x5dd6d7['rows']=_0x4a7bd8;return _0x5dd6d7;})['then'](respondWithFilteredResult(_0x400f6f,_0x3c0f67))[_0x31ca('0x44')](handleError(_0x400f6f,null));};exports[_0x31ca('0x45')]=function(_0x336dfe,_0x4b94a8){var _0x5838c0={'raw':![],'where':{'id':_0x336dfe[_0x31ca('0x46')]['id']}},_0x23bda4={};_0x23bda4[_0x31ca('0x30')]=_[_0x31ca('0x32')](db[_0x31ca('0x2c')][_0x31ca('0x47')]);_0x23bda4['query']=_[_0x31ca('0x32')](_0x336dfe['query']);_0x23bda4[_0x31ca('0x33')]=_[_0x31ca('0x48')](_0x23bda4[_0x31ca('0x30')],_0x23bda4[_0x31ca('0x31')]);_0x5838c0[_0x31ca('0x34')]=_[_0x31ca('0x48')](_0x23bda4[_0x31ca('0x30')],qs['fields'](_0x336dfe[_0x31ca('0x31')]['fields']));_0x5838c0[_0x31ca('0x34')]=_0x5838c0[_0x31ca('0x34')][_0x31ca('0x36')]?_0x5838c0[_0x31ca('0x34')]:_0x23bda4['model'];if(_0x336dfe[_0x31ca('0x31')][_0x31ca('0x41')]){_0x5838c0['include']=[{'all':!![]}];}_0x5838c0=_[_0x31ca('0x3e')]({},_0x5838c0,_0x336dfe[_0x31ca('0x3f')]);return db[_0x31ca('0x2c')]['find'](_0x5838c0)[_0x31ca('0x24')](handleEntityNotFound(_0x4b94a8,null))['then'](respondWithResult(_0x4b94a8,null))[_0x31ca('0x44')](handleError(_0x4b94a8,null));};exports[_0x31ca('0x49')]=function(_0x19a910,_0x180116){return db[_0x31ca('0x2c')][_0x31ca('0x49')](_0x19a910[_0x31ca('0x4a')],{})[_0x31ca('0x24')](respondWithResult(_0x180116,0xc9))['catch'](handleError(_0x180116,null));};exports['update']=function(_0x454a6e,_0x23e42b){if(_0x454a6e[_0x31ca('0x4a')]['id']){delete _0x454a6e[_0x31ca('0x4a')]['id'];}return db[_0x31ca('0x2c')][_0x31ca('0x4b')]({'where':{'id':_0x454a6e[_0x31ca('0x46')]['id']}})['then'](handleEntityNotFound(_0x23e42b,null))[_0x31ca('0x24')](saveUpdates(_0x454a6e[_0x31ca('0x4a')],null))[_0x31ca('0x24')](respondWithResult(_0x23e42b,null))[_0x31ca('0x44')](handleError(_0x23e42b,null));};exports[_0x31ca('0x25')]=function(_0x5b79a5,_0x479f36){return db['VtigerAccount']['find']({'where':{'id':_0x5b79a5[_0x31ca('0x46')]['id']}})['then'](handleEntityNotFound(_0x479f36,null))[_0x31ca('0x24')](removeEntity(_0x479f36,null))[_0x31ca('0x44')](handleError(_0x479f36,null));};exports[_0x31ca('0x4c')]=function(_0x39e72a,_0x374cf7,_0x3c754c){var _0x57f136={};var _0x1632c5={};var _0xff1f72;var _0x19d8c5;return db[_0x31ca('0x2c')]['findOne']({'where':{'id':_0x39e72a[_0x31ca('0x46')]['id']}})[_0x31ca('0x24')](handleEntityNotFound(_0x374cf7,null))[_0x31ca('0x24')](function(_0x512ab7){if(_0x512ab7){_0xff1f72=_0x512ab7;_0x1632c5['model']=_['keys'](db[_0x31ca('0x4d')][_0x31ca('0x47')]);_0x1632c5['query']=_[_0x31ca('0x32')](_0x39e72a['query']);_0x1632c5[_0x31ca('0x33')]=_[_0x31ca('0x48')](_0x1632c5[_0x31ca('0x30')],_0x1632c5[_0x31ca('0x31')]);_0x57f136[_0x31ca('0x34')]=_['intersection'](_0x1632c5[_0x31ca('0x30')],qs['fields'](_0x39e72a[_0x31ca('0x31')][_0x31ca('0x35')]));_0x57f136[_0x31ca('0x34')]=_0x57f136[_0x31ca('0x34')][_0x31ca('0x36')]?_0x57f136[_0x31ca('0x34')]:_0x1632c5['model'];_0x57f136[_0x31ca('0x4e')]=qs[_0x31ca('0x39')](_0x39e72a[_0x31ca('0x31')][_0x31ca('0x39')]);_0x57f136['where']=qs[_0x31ca('0x33')](_[_0x31ca('0x3b')](_0x39e72a[_0x31ca('0x31')],_0x1632c5[_0x31ca('0x33')]));if(_0x39e72a[_0x31ca('0x31')][_0x31ca('0x3c')]){_0x57f136[_0x31ca('0x3a')]=_['merge'](_0x57f136[_0x31ca('0x3a')],{'$or':_[_0x31ca('0x2b')](_0x57f136[_0x31ca('0x34')],function(_0x394eab){var _0x118a2d={};_0x118a2d[_0x394eab]={'$like':'%'+_0x39e72a['query'][_0x31ca('0x3c')]+'%'};return _0x118a2d;})});}_0x57f136=_[_0x31ca('0x3e')]({},_0x57f136,_0x39e72a[_0x31ca('0x3f')]);return _0xff1f72[_0x31ca('0x4c')](_0x57f136);}})[_0x31ca('0x24')](function(_0x31f31e){if(_0x31f31e){_0x19d8c5=_0x31f31e[_0x31ca('0x36')];if(!_0x39e72a[_0x31ca('0x31')][_0x31ca('0x37')]('nolimit')){_0x57f136[_0x31ca('0x1e')]=qs[_0x31ca('0x1e')](_0x39e72a['query'][_0x31ca('0x1e')]);_0x57f136[_0x31ca('0x1c')]=qs[_0x31ca('0x1c')](_0x39e72a[_0x31ca('0x31')]['offset']);}return _0xff1f72[_0x31ca('0x4c')](_0x57f136);}})[_0x31ca('0x24')](function(_0x4024b2){if(_0x4024b2){return _0x4024b2?{'count':_0x19d8c5,'rows':_0x4024b2}:null;}})[_0x31ca('0x24')](respondWithResult(_0x374cf7,null))[_0x31ca('0x44')](handleError(_0x374cf7,null));};exports[_0x31ca('0x4f')]=function(_0x10aa5,_0x503460,_0x337a56){if(_0x10aa5[_0x31ca('0x4a')]['id']){delete _0x10aa5[_0x31ca('0x4a')]['id'];}return db['VtigerAccount'][_0x31ca('0x50')]({'where':{'id':_0x10aa5[_0x31ca('0x46')]['id']}})[_0x31ca('0x24')](handleEntityNotFound(_0x503460,null))['then'](function(_0x5a168a){if(_0x5a168a){_0x10aa5[_0x31ca('0x4a')][_0x31ca('0x51')]=_0x5a168a['id'];_0x10aa5[_0x31ca('0x4a')]['Subjects']=integrations[_0x31ca('0x52')](_0x10aa5[_0x31ca('0x4a')][_0x31ca('0x53')],_0x10aa5['body'][_0x31ca('0x2e')]);_0x10aa5[_0x31ca('0x4a')][_0x31ca('0x54')]=integrations['getDescriptions'](_0x10aa5[_0x31ca('0x4a')][_0x31ca('0x53')],_0x10aa5[_0x31ca('0x4a')][_0x31ca('0x2e')]);return db[_0x31ca('0x4d')][_0x31ca('0x49')](_0x10aa5[_0x31ca('0x4a')],{'include':[{'model':db[_0x31ca('0x55')],'as':_0x31ca('0x56')},{'model':db[_0x31ca('0x55')],'as':_0x31ca('0x54')}]});}return null;})[_0x31ca('0x24')](respondWithResult(_0x503460,null))[_0x31ca('0x44')](handleError(_0x503460,null));};var md5=require('md5');exports[_0x31ca('0x57')]=function(_0x123619,_0x421f3e,_0x587908){var _0x1b0cb2=null;var _0x106a1e=null;var _0x2ed59b=null;var _0x11f8fc=null;var _0x292e44='';return db[_0x31ca('0x2c')][_0x31ca('0x50')]({'where':{'id':_0x123619[_0x31ca('0x46')]['id']},'attributes':['id',_0x31ca('0x28'),_0x31ca('0x58'),_0x31ca('0x59'),_0x31ca('0x5a'),_0x31ca('0x5b'),'serverUrl',_0x31ca('0x5c')]})['then'](handleEntityNotFound(_0x421f3e,null))[_0x31ca('0x24')](function(_0x4a26ce){if(_0x4a26ce){_0x1b0cb2=_0x4a26ce[_0x31ca('0x58')];_0x106a1e=_0x4a26ce[_0x31ca('0x5c')];_0x2ed59b=_0x4a26ce[_0x31ca('0x5a')];_0x292e44=_0x4a26ce['remoteUri'];var _0x28c7db=_0x292e44[_0x31ca('0x5d')](-0x1);if(_0x28c7db==='/'){_0x292e44=_0x292e44[_0x31ca('0x5e')](0x0,_0x292e44[_0x31ca('0x5f')](_0x28c7db));}_0x11f8fc=util[_0x31ca('0x60')]('%s/webservice.php',_0x292e44);var _0x3abbea={'method':_0x31ca('0x61'),'uri':_0x11f8fc,'qs':{'operation':_0x31ca('0x62'),'username':_0x4a26ce[_0x31ca('0x58')]},'json':!![]};return rp(_0x3abbea);}})['then'](function(_0x17ad3a){if(_0x17ad3a['success']){var _0x158965={'method':'POST','uri':_0x11f8fc,'form':{'operation':_0x31ca('0x63'),'username':_0x1b0cb2,'accessKey':md5(_0x17ad3a[_0x31ca('0x64')][_0x31ca('0x65')]+_0x106a1e)},'json':!![]};return rp(_0x158965);}})['then'](function(_0x5cfdaf){if(_0x5cfdaf['success']){var _0x17b051={'method':'GET','uri':_0x11f8fc,'qs':{'operation':_0x31ca('0x66'),'username':_0x1b0cb2,'sessionName':_0x5cfdaf[_0x31ca('0x64')]['sessionName'],'elementType':_0x2ed59b},'json':!![]};return rp(_0x17b051);}})[_0x31ca('0x24')](function(_0x12626c){if(_0x12626c[_0x31ca('0x67')]){var _0x23826f=[_0x31ca('0x68'),'reference','owner'];_[_0x31ca('0x69')](_0x12626c['result'][_0x31ca('0x35')],function(_0x3358e4){return _0x23826f['includes'](_0x3358e4[_0x31ca('0x2e')]['name']);});_[_0x31ca('0x69')](_0x12626c[_0x31ca('0x64')][_0x31ca('0x35')],function(_0x5d0ff9){return _0x5d0ff9['editable']===_0x31ca('0x6a');});return{'count':_0x12626c[_0x31ca('0x64')][_0x31ca('0x35')]['length'],'rows':_['map'](_0x12626c[_0x31ca('0x64')][_0x31ca('0x35')],function(_0x44db52){return{'id':_0x44db52['name'],'name':_0x44db52[_0x31ca('0x6b')],'custom':_['startsWith'](_0x44db52[_0x31ca('0x28')],_0x31ca('0x6c'))?!![]:![],'options':_0x44db52[_0x31ca('0x2e')][_0x31ca('0x28')]===_0x31ca('0x6d')&&_0x44db52['type'][_0x31ca('0x6e')][_0x31ca('0x36')]>0x0?_[_0x31ca('0x2b')](_0x44db52[_0x31ca('0x2e')][_0x31ca('0x6e')],function(_0x16b02d){return{'name':_0x16b02d[_0x31ca('0x6b')],'value':_0x16b02d['value']};}):[]};})};}})[_0x31ca('0x24')](respondWithResult(_0x421f3e,null))[_0x31ca('0x44')](function(_0x19022e){console['log'](_0x31ca('0x6f')+_0x19022e);var _0x7c60c2=_0x123619[_0x31ca('0x31')][_0x31ca('0x70')]?0x1f4:_0x19022e['statusCode']||0x1f4;logger[_0x31ca('0x26')](_0x31ca('0x71'),_0x31ca('0x57'),_0x7c60c2,JSON[_0x31ca('0x72')](_0x19022e));delete _0x19022e[_0x31ca('0x28')];if(_0x7c60c2===0x191){_0x7c60c2=0x190;}_0x421f3e['status'](_0x7c60c2)[_0x31ca('0x29')](_0x123619['query'][_0x31ca('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x19022e[_0x31ca('0x73')]}:_0x19022e);});}; \ No newline at end of file +var _0x5628=['intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','description','moduleName','serverUrl','accessKey','username','remoteUri','lastIndexOf','%s/webservice.php','GET','getchallenge','login','result','token','success','describe','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklistValues','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','filters'];(function(_0x21244e,_0x315135){var _0x3fbf6f=function(_0x45df90){while(--_0x45df90){_0x21244e['push'](_0x21244e['shift']());}};_0x3fbf6f(++_0x315135);}(_0x5628,0x136));var _0x8562=function(_0x9525a3,_0x39df4a){_0x9525a3=_0x9525a3-0x0;var _0x46927d=_0x5628[_0x9525a3];return _0x46927d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8562('0x0'));var zipdir=require(_0x8562('0x1'));var jsonpatch=require(_0x8562('0x2'));var rp=require(_0x8562('0x3'));var moment=require(_0x8562('0x4'));var BPromise=require(_0x8562('0x5'));var Mustache=require(_0x8562('0x6'));var util=require(_0x8562('0x7'));var path=require(_0x8562('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8562('0x9'));var fs=require('fs');var fs_extra=require(_0x8562('0xa'));var _=require(_0x8562('0xb'));var squel=require(_0x8562('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8562('0xd'));var toCsv=require(_0x8562('0xe'));var querystring=require(_0x8562('0xf'));var Papa=require(_0x8562('0x10'));var Redis=require(_0x8562('0x11'));var authService=require(_0x8562('0x12'));var qs=require(_0x8562('0x13'));var as=require(_0x8562('0x14'));var hardwareService=require(_0x8562('0x15'));var logger=require(_0x8562('0x16'))(_0x8562('0x17'));var utils=require(_0x8562('0x18'));var config=require(_0x8562('0x19'));var licenseUtil=require(_0x8562('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x278909,_0x5b7896){_0x5b7896=_0x5b7896||0xcc;return function(_0x3910fc){if(_0x3910fc){return _0x278909[_0x8562('0x1b')](_0x5b7896);}return _0x278909[_0x8562('0x1c')](_0x5b7896)['end']();};}function respondWithResult(_0x3aeff2,_0x1734c8){_0x1734c8=_0x1734c8||0xc8;return function(_0x413705){if(_0x413705){return _0x3aeff2[_0x8562('0x1c')](_0x1734c8)['json'](_0x413705);}};}function respondWithFilteredResult(_0xcb8b01,_0x12f796){return function(_0x1b0254){if(_0x1b0254){var _0x1ecadc=typeof _0x12f796[_0x8562('0x1d')]===_0x8562('0x1e')&&typeof _0x12f796[_0x8562('0x1f')]===_0x8562('0x1e');var _0x26fdef=_0x1b0254['count'];var _0x15598e=_0x1ecadc?0x0:_0x12f796[_0x8562('0x1d')];var _0x38188b=_0x1ecadc?_0x1b0254[_0x8562('0x20')]:_0x12f796[_0x8562('0x1d')]+_0x12f796[_0x8562('0x1f')];var _0x2d1e89;if(_0x38188b>=_0x26fdef){_0x38188b=_0x26fdef;_0x2d1e89=0xc8;}else{_0x2d1e89=0xce;}_0xcb8b01[_0x8562('0x1c')](_0x2d1e89);return _0xcb8b01['set'](_0x8562('0x21'),_0x15598e+'-'+_0x38188b+'/'+_0x26fdef)[_0x8562('0x22')](_0x1b0254);}return null;};}function patchUpdates(_0x212236){return function(_0x315244){try{jsonpatch[_0x8562('0x23')](_0x315244,_0x212236,!![]);}catch(_0x5c0905){return BPromise[_0x8562('0x24')](_0x5c0905);}return _0x315244[_0x8562('0x25')]();};}function saveUpdates(_0x1a5616,_0x408fba){return function(_0x1b366f){if(_0x1b366f){return _0x1b366f[_0x8562('0x26')](_0x1a5616)['then'](function(_0x488fcf){return _0x488fcf;});}return null;};}function removeEntity(_0x5aa020,_0x17ecf1){return function(_0x59edb2){if(_0x59edb2){return _0x59edb2[_0x8562('0x27')]()[_0x8562('0x28')](function(){_0x5aa020['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1904d3,_0x1df48f){return function(_0x599cbb){if(!_0x599cbb){_0x1904d3[_0x8562('0x1b')](0x194);}return _0x599cbb;};}function handleError(_0x488895,_0x50fa8a){_0x50fa8a=_0x50fa8a||0x1f4;return function(_0x2b494f){logger[_0x8562('0x29')](_0x2b494f[_0x8562('0x2a')]);if(_0x2b494f[_0x8562('0x2b')]){delete _0x2b494f[_0x8562('0x2b')];}_0x488895[_0x8562('0x1c')](_0x50fa8a)['send'](_0x2b494f);};}exports[_0x8562('0x2c')]=function(_0x4f3767,_0x5912bf){var _0x29a547={},_0x597fa5={},_0x656bca={'count':0x0,'rows':[]};var _0x3e52e8=_[_0x8562('0x2d')](db['VtigerAccount'][_0x8562('0x2e')],function(_0x88321a){return{'name':_0x88321a[_0x8562('0x2f')],'type':_0x88321a[_0x8562('0x30')][_0x8562('0x31')]};});_0x597fa5[_0x8562('0x32')]=_[_0x8562('0x2d')](_0x3e52e8,_0x8562('0x2b'));_0x597fa5['query']=_[_0x8562('0x33')](_0x4f3767['query']);_0x597fa5[_0x8562('0x34')]=_[_0x8562('0x35')](_0x597fa5['model'],_0x597fa5[_0x8562('0x36')]);_0x29a547[_0x8562('0x37')]=_[_0x8562('0x35')](_0x597fa5['model'],qs[_0x8562('0x38')](_0x4f3767[_0x8562('0x36')][_0x8562('0x38')]));_0x29a547[_0x8562('0x37')]=_0x29a547[_0x8562('0x37')]['length']?_0x29a547[_0x8562('0x37')]:_0x597fa5[_0x8562('0x32')];if(!_0x4f3767[_0x8562('0x36')][_0x8562('0x39')]('nolimit')){_0x29a547[_0x8562('0x1f')]=qs[_0x8562('0x1f')](_0x4f3767[_0x8562('0x36')]['limit']);_0x29a547['offset']=qs[_0x8562('0x1d')](_0x4f3767['query']['offset']);}_0x29a547[_0x8562('0x3a')]=qs['sort'](_0x4f3767[_0x8562('0x36')][_0x8562('0x3b')]);_0x29a547[_0x8562('0x3c')]=qs[_0x8562('0x34')](_['pick'](_0x4f3767['query'],_0x597fa5[_0x8562('0x34')]),_0x3e52e8);if(_0x4f3767[_0x8562('0x36')][_0x8562('0x3d')]){_0x29a547['where']=_[_0x8562('0x3e')](_0x29a547['where'],{'$or':_['map'](_0x3e52e8,function(_0x1a3b62){if(_0x1a3b62[_0x8562('0x30')]!==_0x8562('0x3f')){var _0x4b9f58={};_0x4b9f58[_0x1a3b62['name']]={'$like':'%'+_0x4f3767[_0x8562('0x36')][_0x8562('0x3d')]+'%'};return _0x4b9f58;}})});}_0x29a547=_[_0x8562('0x3e')]({},_0x29a547,_0x4f3767[_0x8562('0x40')]);var _0xcd6cff={'where':_0x29a547['where']};return db[_0x8562('0x41')][_0x8562('0x20')](_0xcd6cff)[_0x8562('0x28')](function(_0x1197da){_0x656bca[_0x8562('0x20')]=_0x1197da;if(_0x4f3767[_0x8562('0x36')][_0x8562('0x42')]){_0x29a547[_0x8562('0x43')]=[{'all':!![]}];}return db[_0x8562('0x41')][_0x8562('0x44')](_0x29a547);})[_0x8562('0x28')](function(_0x3adf1b){_0x656bca[_0x8562('0x45')]=_0x3adf1b;return _0x656bca;})[_0x8562('0x28')](respondWithFilteredResult(_0x5912bf,_0x29a547))[_0x8562('0x46')](handleError(_0x5912bf,null));};exports[_0x8562('0x47')]=function(_0x5afdc5,_0x1a0d4c){var _0x27a852={'raw':![],'where':{'id':_0x5afdc5[_0x8562('0x48')]['id']}},_0x38bb6b={};_0x38bb6b[_0x8562('0x32')]=_[_0x8562('0x33')](db[_0x8562('0x41')][_0x8562('0x2e')]);_0x38bb6b[_0x8562('0x36')]=_[_0x8562('0x33')](_0x5afdc5['query']);_0x38bb6b[_0x8562('0x34')]=_[_0x8562('0x35')](_0x38bb6b[_0x8562('0x32')],_0x38bb6b[_0x8562('0x36')]);_0x27a852[_0x8562('0x37')]=_[_0x8562('0x35')](_0x38bb6b[_0x8562('0x32')],qs[_0x8562('0x38')](_0x5afdc5['query']['fields']));_0x27a852[_0x8562('0x37')]=_0x27a852['attributes'][_0x8562('0x49')]?_0x27a852[_0x8562('0x37')]:_0x38bb6b[_0x8562('0x32')];if(_0x5afdc5[_0x8562('0x36')][_0x8562('0x42')]){_0x27a852[_0x8562('0x43')]=[{'all':!![]}];}_0x27a852=_[_0x8562('0x3e')]({},_0x27a852,_0x5afdc5[_0x8562('0x40')]);return db['VtigerAccount'][_0x8562('0x4a')](_0x27a852)[_0x8562('0x28')](handleEntityNotFound(_0x1a0d4c,null))['then'](respondWithResult(_0x1a0d4c,null))[_0x8562('0x46')](handleError(_0x1a0d4c,null));};exports['create']=function(_0x319f57,_0x7835f2){return db['VtigerAccount'][_0x8562('0x4b')](_0x319f57['body'],{})[_0x8562('0x28')](respondWithResult(_0x7835f2,0xc9))[_0x8562('0x46')](handleError(_0x7835f2,null));};exports[_0x8562('0x26')]=function(_0x550ba3,_0x21c448){if(_0x550ba3[_0x8562('0x4c')]['id']){delete _0x550ba3[_0x8562('0x4c')]['id'];}return db[_0x8562('0x41')]['find']({'where':{'id':_0x550ba3[_0x8562('0x48')]['id']}})[_0x8562('0x28')](handleEntityNotFound(_0x21c448,null))['then'](saveUpdates(_0x550ba3['body'],null))[_0x8562('0x28')](respondWithResult(_0x21c448,null))['catch'](handleError(_0x21c448,null));};exports[_0x8562('0x27')]=function(_0x50c8d2,_0x190c18){return db[_0x8562('0x41')]['find']({'where':{'id':_0x50c8d2[_0x8562('0x48')]['id']}})[_0x8562('0x28')](handleEntityNotFound(_0x190c18,null))[_0x8562('0x28')](removeEntity(_0x190c18,null))[_0x8562('0x46')](handleError(_0x190c18,null));};exports[_0x8562('0x4d')]=function(_0x5f223c,_0x2f8b19,_0x2623b1){var _0x1cc240={};var _0x1a2e2a={};var _0x5041b3;var _0x1be7a6;return db['VtigerAccount'][_0x8562('0x4e')]({'where':{'id':_0x5f223c[_0x8562('0x48')]['id']}})[_0x8562('0x28')](handleEntityNotFound(_0x2f8b19,null))[_0x8562('0x28')](function(_0x342e3b){if(_0x342e3b){_0x5041b3=_0x342e3b;_0x1a2e2a[_0x8562('0x32')]=_[_0x8562('0x33')](db[_0x8562('0x4f')][_0x8562('0x2e')]);_0x1a2e2a[_0x8562('0x36')]=_['keys'](_0x5f223c[_0x8562('0x36')]);_0x1a2e2a[_0x8562('0x34')]=_[_0x8562('0x35')](_0x1a2e2a[_0x8562('0x32')],_0x1a2e2a[_0x8562('0x36')]);_0x1cc240[_0x8562('0x37')]=_[_0x8562('0x35')](_0x1a2e2a[_0x8562('0x32')],qs[_0x8562('0x38')](_0x5f223c[_0x8562('0x36')]['fields']));_0x1cc240[_0x8562('0x37')]=_0x1cc240['attributes'][_0x8562('0x49')]?_0x1cc240[_0x8562('0x37')]:_0x1a2e2a[_0x8562('0x32')];_0x1cc240[_0x8562('0x3a')]=qs[_0x8562('0x3b')](_0x5f223c[_0x8562('0x36')][_0x8562('0x3b')]);_0x1cc240[_0x8562('0x3c')]=qs['filters'](_['pick'](_0x5f223c[_0x8562('0x36')],_0x1a2e2a[_0x8562('0x34')]));if(_0x5f223c[_0x8562('0x36')][_0x8562('0x3d')]){_0x1cc240[_0x8562('0x3c')]=_[_0x8562('0x3e')](_0x1cc240[_0x8562('0x3c')],{'$or':_[_0x8562('0x2d')](_0x1cc240[_0x8562('0x37')],function(_0x59c489){var _0x2f4059={};_0x2f4059[_0x59c489]={'$like':'%'+_0x5f223c[_0x8562('0x36')]['filter']+'%'};return _0x2f4059;})});}_0x1cc240=_[_0x8562('0x3e')]({},_0x1cc240,_0x5f223c['options']);return _0x5041b3['getConfigurations'](_0x1cc240);}})['then'](function(_0x5e9812){if(_0x5e9812){_0x1be7a6=_0x5e9812['length'];if(!_0x5f223c[_0x8562('0x36')][_0x8562('0x39')](_0x8562('0x50'))){_0x1cc240[_0x8562('0x1f')]=qs[_0x8562('0x1f')](_0x5f223c[_0x8562('0x36')][_0x8562('0x1f')]);_0x1cc240[_0x8562('0x1d')]=qs[_0x8562('0x1d')](_0x5f223c[_0x8562('0x36')][_0x8562('0x1d')]);}return _0x5041b3[_0x8562('0x4d')](_0x1cc240);}})[_0x8562('0x28')](function(_0x3ca216){if(_0x3ca216){return _0x3ca216?{'count':_0x1be7a6,'rows':_0x3ca216}:null;}})[_0x8562('0x28')](respondWithResult(_0x2f8b19,null))[_0x8562('0x46')](handleError(_0x2f8b19,null));};exports[_0x8562('0x51')]=function(_0x58e545,_0x357b63,_0x55031e){if(_0x58e545[_0x8562('0x4c')]['id']){delete _0x58e545[_0x8562('0x4c')]['id'];}return db['VtigerAccount'][_0x8562('0x4e')]({'where':{'id':_0x58e545['params']['id']}})['then'](handleEntityNotFound(_0x357b63,null))[_0x8562('0x28')](function(_0x2af104){if(_0x2af104){_0x58e545[_0x8562('0x4c')]['AccountId']=_0x2af104['id'];_0x58e545['body'][_0x8562('0x52')]=integrations[_0x8562('0x53')](_0x58e545['body'][_0x8562('0x54')],_0x58e545['body'][_0x8562('0x30')]);_0x58e545[_0x8562('0x4c')][_0x8562('0x55')]=integrations['getDescriptions'](_0x58e545[_0x8562('0x4c')]['channel'],_0x58e545['body'][_0x8562('0x30')]);return db['VtigerConfiguration']['create'](_0x58e545['body'],{'include':[{'model':db[_0x8562('0x56')],'as':'Subjects'},{'model':db[_0x8562('0x56')],'as':_0x8562('0x55')}]});}return null;})[_0x8562('0x28')](respondWithResult(_0x357b63,null))[_0x8562('0x46')](handleError(_0x357b63,null));};var md5=require(_0x8562('0x57'));exports[_0x8562('0x58')]=function(_0x5967f1,_0x35776f,_0x9248ee){var _0x48c728=null;var _0x495a2c=null;var _0x545580=null;var _0x1da845=null;var _0x2b6955='';return db[_0x8562('0x41')][_0x8562('0x4e')]({'where':{'id':_0x5967f1[_0x8562('0x48')]['id']},'attributes':['id','name','username',_0x8562('0x59'),_0x8562('0x5a'),'remoteUri',_0x8562('0x5b'),_0x8562('0x5c')]})[_0x8562('0x28')](handleEntityNotFound(_0x35776f,null))[_0x8562('0x28')](function(_0x23398a){if(_0x23398a){_0x48c728=_0x23398a[_0x8562('0x5d')];_0x495a2c=_0x23398a['accessKey'];_0x545580=_0x23398a['moduleName'];_0x2b6955=_0x23398a[_0x8562('0x5e')];var _0x228ca5=_0x2b6955['slice'](-0x1);if(_0x228ca5==='/'){_0x2b6955=_0x2b6955['substring'](0x0,_0x2b6955[_0x8562('0x5f')](_0x228ca5));}_0x1da845=util['format'](_0x8562('0x60'),_0x2b6955);var _0x1e4b9c={'method':_0x8562('0x61'),'uri':_0x1da845,'qs':{'operation':_0x8562('0x62'),'username':_0x23398a[_0x8562('0x5d')]},'json':!![]};return rp(_0x1e4b9c);}})[_0x8562('0x28')](function(_0x4aad4e){if(_0x4aad4e['success']){var _0x2a0f4d={'method':'POST','uri':_0x1da845,'form':{'operation':_0x8562('0x63'),'username':_0x48c728,'accessKey':md5(_0x4aad4e[_0x8562('0x64')][_0x8562('0x65')]+_0x495a2c)},'json':!![]};return rp(_0x2a0f4d);}})[_0x8562('0x28')](function(_0x589935){if(_0x589935[_0x8562('0x66')]){var _0xc3958={'method':_0x8562('0x61'),'uri':_0x1da845,'qs':{'operation':_0x8562('0x67'),'username':_0x48c728,'sessionName':_0x589935[_0x8562('0x64')]['sessionName'],'elementType':_0x545580},'json':!![]};return rp(_0xc3958);}})[_0x8562('0x28')](function(_0x59449c){if(_0x59449c[_0x8562('0x66')]){var _0x188113=['autogenerated',_0x8562('0x68'),_0x8562('0x69')];_[_0x8562('0x6a')](_0x59449c[_0x8562('0x64')][_0x8562('0x38')],function(_0x5b1791){return _0x188113[_0x8562('0x6b')](_0x5b1791[_0x8562('0x30')][_0x8562('0x2b')]);});_[_0x8562('0x6a')](_0x59449c[_0x8562('0x64')]['fields'],function(_0x546aef){return _0x546aef[_0x8562('0x6c')]===_0x8562('0x6d');});return{'count':_0x59449c['result'][_0x8562('0x38')][_0x8562('0x49')],'rows':_['map'](_0x59449c[_0x8562('0x64')][_0x8562('0x38')],function(_0x31778b){return{'id':_0x31778b[_0x8562('0x2b')],'name':_0x31778b[_0x8562('0x6e')],'custom':_[_0x8562('0x6f')](_0x31778b[_0x8562('0x2b')],_0x8562('0x70'))?!![]:![],'options':_0x31778b[_0x8562('0x30')][_0x8562('0x2b')]==='picklist'&&_0x31778b['type'][_0x8562('0x71')][_0x8562('0x49')]>0x0?_[_0x8562('0x2d')](_0x31778b[_0x8562('0x30')][_0x8562('0x71')],function(_0x1d1696){return{'name':_0x1d1696[_0x8562('0x6e')],'value':_0x1d1696['value']};}):[]};})};}})[_0x8562('0x28')](respondWithResult(_0x35776f,null))[_0x8562('0x46')](function(_0x2d7db5){console[_0x8562('0x72')]('vTiger\x20error:\x20'+_0x2d7db5);var _0x5d7811=_0x5967f1[_0x8562('0x36')][_0x8562('0x73')]?0x1f4:_0x2d7db5[_0x8562('0x74')]||0x1f4;logger[_0x8562('0x29')](_0x8562('0x75'),_0x8562('0x58'),_0x5d7811,JSON[_0x8562('0x76')](_0x2d7db5));delete _0x2d7db5[_0x8562('0x2b')];if(_0x5d7811===0x191){_0x5d7811=0x190;}_0x35776f[_0x8562('0x1c')](_0x5d7811)[_0x8562('0x77')](_0x5967f1['query'][_0x8562('0x73')]?{'message':_0x8562('0x78'),'statusCode':_0x2d7db5['statusCode']}:_0x2d7db5);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index bd26988..9ea1d5e 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 _0x2995=['api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','../../config/logger'];(function(_0x14ffe3,_0x119d82){var _0x36a690=function(_0x50b518){while(--_0x50b518){_0x14ffe3['push'](_0x14ffe3['shift']());}};_0x36a690(++_0x119d82);}(_0x2995,0x1ea));var _0x5299=function(_0x2c7661,_0x41a8b1){_0x2c7661=_0x2c7661-0x0;var _0x4a87c9=_0x2995[_0x2c7661];return _0x4a87c9;};'use strict';var _=require(_0x5299('0x0'));var util=require('util');var logger=require(_0x5299('0x1'))(_0x5299('0x2'));var moment=require('moment');var BPromise=require(_0x5299('0x3'));var rp=require(_0x5299('0x4'));var fs=require('fs');var path=require(_0x5299('0x5'));var rimraf=require(_0x5299('0x6'));var config=require(_0x5299('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x5299('0x8'));module[_0x5299('0x9')]=function(_0x4c9820,_0x58febc){return _0x4c9820[_0x5299('0xa')]('VtigerAccount',attributes,{'tableName':_0x5299('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e11=['../../config/logger','api','moment','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1e11,0xe4));var _0x11e1=function(_0xa1c700,_0x2b7abf){_0xa1c700=_0xa1c700-0x0;var _0x35da71=_0x1e11[_0xa1c700];return _0x35da71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x11e1('0x0'))(_0x11e1('0x1'));var moment=require(_0x11e1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x11e1('0x3'));var rimraf=require(_0x11e1('0x4'));var config=require(_0x11e1('0x5'));var attributes=require(_0x11e1('0x6'));var integrations=require(_0x11e1('0x7'));module[_0x11e1('0x8')]=function(_0x5a810d,_0xa1c9f9){return _0x5a810d[_0x11e1('0x9')](_0x11e1('0xa'),attributes,{'tableName':_0x11e1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 1698c83..ac4d45a 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 _0xf4eb=['VtigerAccount','findAll','options','where','attributes','limit','map','model','include','find','raw','ShowVtigerAccount','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVtigerAccount'];(function(_0x56ed3c,_0x469243){var _0x45914e=function(_0x383350){while(--_0x383350){_0x56ed3c['push'](_0x56ed3c['shift']());}};_0x45914e(++_0x469243);}(_0xf4eb,0xec));var _0xbf4e=function(_0xc92c7e,_0x3d26c3){_0xc92c7e=_0xc92c7e-0x0;var _0x19655b=_0xf4eb[_0xc92c7e];return _0x19655b;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')]({'raw':_0x577c27[_0xbf4e('0x16')]?_0x577c27['options']['raw']===undefined?!![]:![]:!![],'where':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x18')]||null:null,'limit':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x19')]||null:null,'include':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')]['include']?_[_0xbf4e('0x1a')](_0x577c27[_0xbf4e('0x16')]['include'],function(_0x31e3f5){return{'model':db[_0x31e3f5[_0xbf4e('0x1b')]],'as':_0x31e3f5['as'],'attributes':_0x31e3f5[_0xbf4e('0x18')],'include':_0x31e3f5[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x31e3f5['include'],function(_0x90635e){return{'model':db[_0x90635e[_0xbf4e('0x1b')]],'as':_0x90635e['as'],'attributes':_0x90635e[_0xbf4e('0x18')],'include':_0x90635e['include']?_[_0xbf4e('0x1a')](_0x90635e['include'],function(_0x5bcf71){return{'model':db[_0x5bcf71[_0xbf4e('0x1b')]],'as':_0x5bcf71['as'],'attributes':_0x5bcf71['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf4e('0x9')](function(_0x315df3){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger['debug'](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x315df3));_0x566ec3(_0x315df3);})[_0xbf4e('0x12')](function(_0x4cd4a1){logger[_0xbf4e('0xf')]('GetVtigerAccount',_0x4cd4a1[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x4cd4a1[_0xbf4e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x1d12e2){var _0x362716=this;return new Promise(function(_0x2f3cf8,_0xc7ca87){return db[_0xbf4e('0x14')][_0xbf4e('0x1d')]({'raw':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')]['attributes']||null:null,'include':_0x1d12e2[_0xbf4e('0x16')]?_0x1d12e2['options'][_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x1d12e2[_0xbf4e('0x16')]['include'],function(_0x2716b7){return{'model':db[_0x2716b7[_0xbf4e('0x1b')]],'as':_0x2716b7['as'],'attributes':_0x2716b7[_0xbf4e('0x18')],'include':_0x2716b7[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x2716b7[_0xbf4e('0x1c')],function(_0x5b8440){return{'model':db[_0x5b8440[_0xbf4e('0x1b')]],'as':_0x5b8440['as'],'attributes':_0x5b8440[_0xbf4e('0x18')],'include':_0x5b8440[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x5b8440[_0xbf4e('0x1c')],function(_0x5b7ea1){return{'model':db[_0x5b7ea1['model']],'as':_0x5b7ea1['as'],'attributes':_0x5b7ea1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x429c07){logger[_0xbf4e('0xa')](_0xbf4e('0x1f'),_0x1d12e2);logger[_0xbf4e('0xd')](_0xbf4e('0x1f'),_0x1d12e2,JSON[_0xbf4e('0xe')](_0x429c07));_0x2f3cf8(_0x429c07);})[_0xbf4e('0x12')](function(_0x467b74){logger[_0xbf4e('0xf')]('ShowVtigerAccount',_0x467b74['message'],_0x1d12e2);_0xc7ca87(_0x362716[_0xbf4e('0xf')](0x1f4,_0x467b74[_0xbf4e('0x11')]));});});}; \ No newline at end of file +var _0xac4a=['info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','model','attributes','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then'];(function(_0x3da920,_0x1c7d2c){var _0xb9ef8a=function(_0x44fdd0){while(--_0x44fdd0){_0x3da920['push'](_0x3da920['shift']());}};_0xb9ef8a(++_0x1c7d2c);}(_0xac4a,0x13f));var _0xaac4=function(_0x4b0cf3,_0x552943){_0x4b0cf3=_0x4b0cf3-0x0;var _0xd46326=_0xac4a[_0x4b0cf3];return _0xd46326;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}exports[_0xaac4('0x15')]=function(_0x52085a){var _0x220630=this;return new Promise(function(_0x5b6fd6,_0x3ce35a){return db[_0xaac4('0x16')][_0xaac4('0x17')]({'raw':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x19')]===undefined?!![]:![]:!![],'where':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1a')]||null:null,'attributes':_0x52085a['options']?_0x52085a[_0xaac4('0x18')]['attributes']||null:null,'limit':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1b')]||null:null,'include':_0x52085a[_0xaac4('0x18')]?_0x52085a[_0xaac4('0x18')][_0xaac4('0x1c')]?_['map'](_0x52085a[_0xaac4('0x18')][_0xaac4('0x1c')],function(_0x174860){return{'model':db[_0x174860[_0xaac4('0x1d')]],'as':_0x174860['as'],'attributes':_0x174860[_0xaac4('0x1e')],'include':_0x174860[_0xaac4('0x1c')]?_[_0xaac4('0x1f')](_0x174860['include'],function(_0x24186b){return{'model':db[_0x24186b['model']],'as':_0x24186b['as'],'attributes':_0x24186b['attributes'],'include':_0x24186b['include']?_['map'](_0x24186b[_0xaac4('0x1c')],function(_0x17d25f){return{'model':db[_0x17d25f[_0xaac4('0x1d')]],'as':_0x17d25f['as'],'attributes':_0x17d25f[_0xaac4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaac4('0xa')](function(_0x249a5d){logger[_0xaac4('0xb')](_0xaac4('0x15'),_0x52085a);logger[_0xaac4('0xc')](_0xaac4('0x15'),_0x52085a,JSON['stringify'](_0x249a5d));_0x5b6fd6(_0x249a5d);})[_0xaac4('0x14')](function(_0x16b33c){logger[_0xaac4('0x10')](_0xaac4('0x15'),_0x16b33c[_0xaac4('0x12')],_0x52085a);_0x3ce35a(_0x220630[_0xaac4('0x10')](0x1f4,_0x16b33c['message']));});});};exports[_0xaac4('0x20')]=function(_0x5d2c9a){var _0x2df7e3=this;return new Promise(function(_0xab5d04,_0x182343){return db[_0xaac4('0x16')]['find']({'raw':_0x5d2c9a['options']?_0x5d2c9a['options'][_0xaac4('0x19')]===undefined?!![]:![]:!![],'where':_0x5d2c9a[_0xaac4('0x18')]?_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1a')]||null:null,'attributes':_0x5d2c9a[_0xaac4('0x18')]?_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1e')]||null:null,'include':_0x5d2c9a[_0xaac4('0x18')]?_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1c')]?_[_0xaac4('0x1f')](_0x5d2c9a[_0xaac4('0x18')][_0xaac4('0x1c')],function(_0x3b93e5){return{'model':db[_0x3b93e5[_0xaac4('0x1d')]],'as':_0x3b93e5['as'],'attributes':_0x3b93e5['attributes'],'include':_0x3b93e5['include']?_[_0xaac4('0x1f')](_0x3b93e5[_0xaac4('0x1c')],function(_0xa07d0){return{'model':db[_0xa07d0['model']],'as':_0xa07d0['as'],'attributes':_0xa07d0[_0xaac4('0x1e')],'include':_0xa07d0[_0xaac4('0x1c')]?_[_0xaac4('0x1f')](_0xa07d0[_0xaac4('0x1c')],function(_0x1ec59d){return{'model':db[_0x1ec59d[_0xaac4('0x1d')]],'as':_0x1ec59d['as'],'attributes':_0x1ec59d[_0xaac4('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36591a){logger[_0xaac4('0xb')](_0xaac4('0x20'),_0x5d2c9a);logger['debug'](_0xaac4('0x20'),_0x5d2c9a,JSON['stringify'](_0x36591a));_0xab5d04(_0x36591a);})['catch'](function(_0x344d05){logger[_0xaac4('0x10')](_0xaac4('0x20'),_0x344d05['message'],_0x5d2c9a);_0x182343(_0x2df7e3['error'](0x1f4,_0x344d05[_0xaac4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 989b114..a3e38f7 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 _0x0cfa=['index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0x0cfa,0x123));var _0xa0cf=function(_0x31cd7b,_0x10a8af){_0x31cd7b=_0x31cd7b-0x0;var _0x3f8579=_0x0cfa[_0x31cd7b];return _0x3f8579;};'use strict';var multer=require(_0xa0cf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa0cf('0x1'));var router=express[_0xa0cf('0x2')]();var fs_extra=require(_0xa0cf('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa0cf('0x4'));var controller=require(_0xa0cf('0x5'));router[_0xa0cf('0x6')]('/',auth[_0xa0cf('0x7')](),controller[_0xa0cf('0x8')]);router['get'](_0xa0cf('0x9'),auth[_0xa0cf('0x7')](),controller[_0xa0cf('0xa')]);router[_0xa0cf('0x6')]('/:id/fields',auth[_0xa0cf('0x7')](),controller[_0xa0cf('0xb')]);router[_0xa0cf('0x6')](_0xa0cf('0xc'),auth['isAuthenticated'](),controller[_0xa0cf('0xd')]);router[_0xa0cf('0x6')](_0xa0cf('0xe'),auth[_0xa0cf('0x7')](),controller[_0xa0cf('0xf')]);router[_0xa0cf('0x10')]('/',auth[_0xa0cf('0x7')](),controller[_0xa0cf('0x11')]);router[_0xa0cf('0x12')]('/:id',auth[_0xa0cf('0x7')](),controller[_0xa0cf('0x13')]);router[_0xa0cf('0x14')]('/:id',auth[_0xa0cf('0x7')](),controller[_0xa0cf('0x15')]);module[_0xa0cf('0x16')]=router; \ No newline at end of file +var _0x0718=['../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x0718,0xe0));var _0x8071=function(_0x14b4c1,_0x587f60){_0x14b4c1=_0x14b4c1-0x0;var _0x40c266=_0x0718[_0x14b4c1];return _0x40c266;};'use strict';var multer=require('multer');var util=require(_0x8071('0x0'));var path=require(_0x8071('0x1'));var timeout=require(_0x8071('0x2'));var express=require('express');var router=express[_0x8071('0x3')]();var fs_extra=require(_0x8071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8071('0x5'));var config=require(_0x8071('0x6'));var controller=require(_0x8071('0x7'));router['get']('/',auth[_0x8071('0x8')](),controller[_0x8071('0x9')]);router[_0x8071('0xa')]('/:id',auth[_0x8071('0x8')](),controller['show']);router['get'](_0x8071('0xb'),auth[_0x8071('0x8')](),controller[_0x8071('0xc')]);router[_0x8071('0xa')](_0x8071('0xd'),auth[_0x8071('0x8')](),controller[_0x8071('0xe')]);router[_0x8071('0xa')](_0x8071('0xf'),auth[_0x8071('0x8')](),controller[_0x8071('0x10')]);router['post']('/',auth[_0x8071('0x8')](),controller[_0x8071('0x11')]);router[_0x8071('0x12')](_0x8071('0x13'),auth['isAuthenticated'](),controller[_0x8071('0x14')]);router['delete'](_0x8071('0x13'),auth[_0x8071('0x8')](),controller[_0x8071('0x15')]);module[_0x8071('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 990f66b..7b5fbfd 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 _0xd178=['sequelize','exports'];(function(_0x505585,_0x2d59e8){var _0x3409f4=function(_0x1053b5){while(--_0x1053b5){_0x505585['push'](_0x505585['shift']());}};_0x3409f4(++_0x2d59e8);}(_0xd178,0xd0));var _0x8d17=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xd178[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x8d17('0x0'));module[_0x8d17('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2aa2=['exports','STRING','sequelize'];(function(_0x534147,_0x26bebf){var _0xb12f5=function(_0x14dc93){while(--_0x14dc93){_0x534147['push'](_0x534147['shift']());}};_0xb12f5(++_0x26bebf);}(_0x2aa2,0x161));var _0x22aa=function(_0x3e0991,_0x4f7df4){_0x3e0991=_0x3e0991-0x0;var _0xea4798=_0x2aa2[_0x3e0991];return _0xea4798;};'use strict';var Sequelize=require(_0x22aa('0x0'));module[_0x22aa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x22aa('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index b6df5ed..fa7874e 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 _0x0d1a=['eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','attributes','model','fields','query','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','order','pick','nolimit','findOne','VtigerField','getSubjects','getDescriptions'];(function(_0x177f58,_0x7eb824){var _0x30c13d=function(_0x24d737){while(--_0x24d737){_0x177f58['push'](_0x177f58['shift']());}};_0x30c13d(++_0x7eb824);}(_0x0d1a,0x1e6));var _0xa0d1=function(_0x18921b,_0x1a9fe9){_0x18921b=_0x18921b-0x0;var _0xae75c5=_0x0d1a[_0x18921b];return _0xae75c5;};'use strict';var emlformat=require(_0xa0d1('0x0'));var rimraf=require(_0xa0d1('0x1'));var zipdir=require(_0xa0d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa0d1('0x3'));var moment=require('moment');var BPromise=require(_0xa0d1('0x4'));var Mustache=require(_0xa0d1('0x5'));var util=require(_0xa0d1('0x6'));var path=require(_0xa0d1('0x7'));var sox=require(_0xa0d1('0x8'));var csv=require('to-csv');var ejs=require(_0xa0d1('0x9'));var fs=require('fs');var fs_extra=require(_0xa0d1('0xa'));var _=require(_0xa0d1('0xb'));var squel=require(_0xa0d1('0xc'));var crypto=require(_0xa0d1('0xd'));var jsforce=require(_0xa0d1('0xe'));var deskjs=require(_0xa0d1('0xf'));var toCsv=require(_0xa0d1('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa0d1('0x11'));var authService=require(_0xa0d1('0x12'));var qs=require(_0xa0d1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0d1('0x14'));var logger=require('../../config/logger')(_0xa0d1('0x15'));var utils=require(_0xa0d1('0x16'));var config=require(_0xa0d1('0x17'));var licenseUtil=require(_0xa0d1('0x18'));var db=require(_0xa0d1('0x19'))['db'];function respondWithStatusCode(_0x2aaf98,_0x444158){_0x444158=_0x444158||0xcc;return function(_0xf3700e){if(_0xf3700e){return _0x2aaf98[_0xa0d1('0x1a')](_0x444158);}return _0x2aaf98[_0xa0d1('0x1b')](_0x444158)[_0xa0d1('0x1c')]();};}function respondWithResult(_0x54b860,_0x1d0d71){_0x1d0d71=_0x1d0d71||0xc8;return function(_0x5c14c4){if(_0x5c14c4){return _0x54b860[_0xa0d1('0x1b')](_0x1d0d71)[_0xa0d1('0x1d')](_0x5c14c4);}};}function respondWithFilteredResult(_0x1a29d4,_0x3b4009){return function(_0x1496e6){if(_0x1496e6){var _0x37641e=typeof _0x3b4009[_0xa0d1('0x1e')]==='undefined'&&typeof _0x3b4009[_0xa0d1('0x1f')]===_0xa0d1('0x20');var _0x4de85c=_0x1496e6[_0xa0d1('0x21')];var _0x4bba06=_0x37641e?0x0:_0x3b4009[_0xa0d1('0x1e')];var _0x1adcb5=_0x37641e?_0x1496e6[_0xa0d1('0x21')]:_0x3b4009[_0xa0d1('0x1e')]+_0x3b4009[_0xa0d1('0x1f')];var _0x36bf1b;if(_0x1adcb5>=_0x4de85c){_0x1adcb5=_0x4de85c;_0x36bf1b=0xc8;}else{_0x36bf1b=0xce;}_0x1a29d4[_0xa0d1('0x1b')](_0x36bf1b);return _0x1a29d4['set']('Content-Range',_0x4bba06+'-'+_0x1adcb5+'/'+_0x4de85c)['json'](_0x1496e6);}return null;};}function patchUpdates(_0x339652){return function(_0x1c2b3f){try{jsonpatch['apply'](_0x1c2b3f,_0x339652,!![]);}catch(_0x2798e7){return BPromise['reject'](_0x2798e7);}return _0x1c2b3f[_0xa0d1('0x22')]();};}function saveUpdates(_0x4ffa9f,_0x12615c){return function(_0x5bd2a4){if(_0x5bd2a4){return _0x5bd2a4[_0xa0d1('0x23')](_0x4ffa9f)[_0xa0d1('0x24')](function(_0x49598e){return _0x49598e;});}return null;};}function removeEntity(_0x5dbd70,_0x19b33e){return function(_0x3e582e){if(_0x3e582e){return _0x3e582e['destroy']()[_0xa0d1('0x24')](function(){_0x5dbd70[_0xa0d1('0x1b')](0xcc)[_0xa0d1('0x1c')]();});}};}function handleEntityNotFound(_0x6ef549,_0x250766){return function(_0x5c768c){if(!_0x5c768c){_0x6ef549[_0xa0d1('0x1a')](0x194);}return _0x5c768c;};}function handleError(_0x102254,_0x5a9860){_0x5a9860=_0x5a9860||0x1f4;return function(_0x3ce5c4){logger[_0xa0d1('0x25')](_0x3ce5c4[_0xa0d1('0x26')]);if(_0x3ce5c4['name']){delete _0x3ce5c4[_0xa0d1('0x27')];}_0x102254[_0xa0d1('0x1b')](_0x5a9860)[_0xa0d1('0x28')](_0x3ce5c4);};}exports[_0xa0d1('0x29')]=function(_0x3aea3b,_0x5dc40b){var _0x434b64={},_0x5ae36b={},_0x5a2f11={'count':0x0,'rows':[]};var _0x2c68e1=_[_0xa0d1('0x2a')](db['VtigerConfiguration'][_0xa0d1('0x2b')],function(_0x1c9fde){return{'name':_0x1c9fde[_0xa0d1('0x2c')],'type':_0x1c9fde[_0xa0d1('0x2d')][_0xa0d1('0x2e')]};});_0x5ae36b['model']=_[_0xa0d1('0x2a')](_0x2c68e1,_0xa0d1('0x27'));_0x5ae36b['query']=_[_0xa0d1('0x2f')](_0x3aea3b['query']);_0x5ae36b[_0xa0d1('0x30')]=_[_0xa0d1('0x31')](_0x5ae36b['model'],_0x5ae36b['query']);_0x434b64[_0xa0d1('0x32')]=_['intersection'](_0x5ae36b[_0xa0d1('0x33')],qs[_0xa0d1('0x34')](_0x3aea3b[_0xa0d1('0x35')][_0xa0d1('0x34')]));_0x434b64[_0xa0d1('0x32')]=_0x434b64[_0xa0d1('0x32')]['length']?_0x434b64[_0xa0d1('0x32')]:_0x5ae36b[_0xa0d1('0x33')];if(!_0x3aea3b[_0xa0d1('0x35')][_0xa0d1('0x36')]('nolimit')){_0x434b64[_0xa0d1('0x1f')]=qs[_0xa0d1('0x1f')](_0x3aea3b[_0xa0d1('0x35')][_0xa0d1('0x1f')]);_0x434b64[_0xa0d1('0x1e')]=qs[_0xa0d1('0x1e')](_0x3aea3b['query'][_0xa0d1('0x1e')]);}_0x434b64['order']=qs[_0xa0d1('0x37')](_0x3aea3b[_0xa0d1('0x35')][_0xa0d1('0x37')]);_0x434b64[_0xa0d1('0x38')]=qs[_0xa0d1('0x30')](_['pick'](_0x3aea3b[_0xa0d1('0x35')],_0x5ae36b[_0xa0d1('0x30')]),_0x2c68e1);if(_0x3aea3b['query'][_0xa0d1('0x39')]){_0x434b64[_0xa0d1('0x38')]=_[_0xa0d1('0x3a')](_0x434b64[_0xa0d1('0x38')],{'$or':_[_0xa0d1('0x2a')](_0x2c68e1,function(_0x2bd281){if(_0x2bd281[_0xa0d1('0x2d')]!==_0xa0d1('0x3b')){var _0x507d9a={};_0x507d9a[_0x2bd281['name']]={'$like':'%'+_0x3aea3b[_0xa0d1('0x35')][_0xa0d1('0x39')]+'%'};return _0x507d9a;}})});}_0x434b64=_['merge']({},_0x434b64,_0x3aea3b[_0xa0d1('0x3c')]);var _0x235995={'where':_0x434b64[_0xa0d1('0x38')]};return db[_0xa0d1('0x3d')][_0xa0d1('0x21')](_0x235995)[_0xa0d1('0x24')](function(_0x35a331){_0x5a2f11[_0xa0d1('0x21')]=_0x35a331;if(_0x3aea3b[_0xa0d1('0x35')][_0xa0d1('0x3e')]){_0x434b64[_0xa0d1('0x3f')]=[{'all':!![]}];}return db[_0xa0d1('0x3d')][_0xa0d1('0x40')](_0x434b64);})[_0xa0d1('0x24')](function(_0x2dbcc2){_0x5a2f11[_0xa0d1('0x41')]=_0x2dbcc2;return _0x5a2f11;})[_0xa0d1('0x24')](respondWithFilteredResult(_0x5dc40b,_0x434b64))[_0xa0d1('0x42')](handleError(_0x5dc40b,null));};exports[_0xa0d1('0x43')]=function(_0x1edc3f,_0x350754){var _0x26afa6={'raw':![],'where':{'id':_0x1edc3f[_0xa0d1('0x44')]['id']}},_0x1cacfe={};_0x1cacfe[_0xa0d1('0x33')]=_[_0xa0d1('0x2f')](db['VtigerConfiguration'][_0xa0d1('0x2b')]);_0x1cacfe['query']=_[_0xa0d1('0x2f')](_0x1edc3f[_0xa0d1('0x35')]);_0x1cacfe[_0xa0d1('0x30')]=_[_0xa0d1('0x31')](_0x1cacfe[_0xa0d1('0x33')],_0x1cacfe['query']);_0x26afa6['attributes']=_['intersection'](_0x1cacfe[_0xa0d1('0x33')],qs[_0xa0d1('0x34')](_0x1edc3f[_0xa0d1('0x35')][_0xa0d1('0x34')]));_0x26afa6[_0xa0d1('0x32')]=_0x26afa6['attributes'][_0xa0d1('0x45')]?_0x26afa6[_0xa0d1('0x32')]:_0x1cacfe['model'];if(_0x1edc3f[_0xa0d1('0x35')][_0xa0d1('0x3e')]){_0x26afa6['include']=[{'all':!![]}];}_0x26afa6=_[_0xa0d1('0x3a')]({},_0x26afa6,_0x1edc3f[_0xa0d1('0x3c')]);return db['VtigerConfiguration'][_0xa0d1('0x46')](_0x26afa6)['then'](handleEntityNotFound(_0x350754,null))[_0xa0d1('0x24')](respondWithResult(_0x350754,null))['catch'](handleError(_0x350754,null));};exports['create']=function(_0x3bfa39,_0x4023b9){return db['VtigerConfiguration'][_0xa0d1('0x47')](_0x3bfa39['body'],{})[_0xa0d1('0x24')](respondWithResult(_0x4023b9,0xc9))[_0xa0d1('0x42')](handleError(_0x4023b9,null));};exports[_0xa0d1('0x23')]=function(_0x1c2ae0,_0x64a456){if(_0x1c2ae0[_0xa0d1('0x48')]['id']){delete _0x1c2ae0['body']['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x1c2ae0[_0xa0d1('0x44')]['id']}})[_0xa0d1('0x24')](handleEntityNotFound(_0x64a456,null))['then'](saveUpdates(_0x1c2ae0['body'],null))['then'](respondWithResult(_0x64a456,null))['catch'](handleError(_0x64a456,null));};exports['destroy']=function(_0x100ad7,_0x270962){return db[_0xa0d1('0x3d')][_0xa0d1('0x46')]({'where':{'id':_0x100ad7[_0xa0d1('0x44')]['id']}})[_0xa0d1('0x24')](handleEntityNotFound(_0x270962,null))[_0xa0d1('0x24')](removeEntity(_0x270962,null))[_0xa0d1('0x42')](handleError(_0x270962,null));};exports[_0xa0d1('0x49')]=function(_0x33347d,_0x4a2e44,_0x5dbf4a){var _0x49c1ea={};var _0x264873={};var _0x43c89b;var _0x123d95;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x33347d[_0xa0d1('0x44')]['id']}})[_0xa0d1('0x24')](handleEntityNotFound(_0x4a2e44,null))['then'](function(_0x41223a){if(_0x41223a){_0x43c89b=_0x41223a;_0x264873[_0xa0d1('0x33')]=_[_0xa0d1('0x2f')](db['VtigerField'][_0xa0d1('0x2b')]);_0x264873['query']=_['keys'](_0x33347d['query']);_0x264873[_0xa0d1('0x30')]=_['intersection'](_0x264873[_0xa0d1('0x33')],_0x264873['query']);_0x49c1ea[_0xa0d1('0x32')]=_[_0xa0d1('0x31')](_0x264873[_0xa0d1('0x33')],qs[_0xa0d1('0x34')](_0x33347d[_0xa0d1('0x35')][_0xa0d1('0x34')]));_0x49c1ea[_0xa0d1('0x32')]=_0x49c1ea[_0xa0d1('0x32')][_0xa0d1('0x45')]?_0x49c1ea['attributes']:_0x264873[_0xa0d1('0x33')];_0x49c1ea[_0xa0d1('0x4a')]=qs[_0xa0d1('0x37')](_0x33347d[_0xa0d1('0x35')][_0xa0d1('0x37')]);_0x49c1ea[_0xa0d1('0x38')]=qs[_0xa0d1('0x30')](_[_0xa0d1('0x4b')](_0x33347d[_0xa0d1('0x35')],_0x264873[_0xa0d1('0x30')]));if(_0x33347d[_0xa0d1('0x35')][_0xa0d1('0x39')]){_0x49c1ea[_0xa0d1('0x38')]=_[_0xa0d1('0x3a')](_0x49c1ea[_0xa0d1('0x38')],{'$or':_['map'](_0x49c1ea[_0xa0d1('0x32')],function(_0x410fc7){var _0x274a17={};_0x274a17[_0x410fc7]={'$like':'%'+_0x33347d['query'][_0xa0d1('0x39')]+'%'};return _0x274a17;})});}_0x49c1ea=_['merge']({},_0x49c1ea,_0x33347d[_0xa0d1('0x3c')]);return _0x43c89b[_0xa0d1('0x49')](_0x49c1ea);}})[_0xa0d1('0x24')](function(_0x19feb0){if(_0x19feb0){_0x123d95=_0x19feb0['length'];if(!_0x33347d[_0xa0d1('0x35')][_0xa0d1('0x36')](_0xa0d1('0x4c'))){_0x49c1ea[_0xa0d1('0x1f')]=qs[_0xa0d1('0x1f')](_0x33347d[_0xa0d1('0x35')]['limit']);_0x49c1ea['offset']=qs[_0xa0d1('0x1e')](_0x33347d['query'][_0xa0d1('0x1e')]);}return _0x43c89b[_0xa0d1('0x49')](_0x49c1ea);}})['then'](function(_0x5ee358){if(_0x5ee358){return _0x5ee358?{'count':_0x123d95,'rows':_0x5ee358}:null;}})[_0xa0d1('0x24')](respondWithResult(_0x4a2e44,null))[_0xa0d1('0x42')](handleError(_0x4a2e44,null));};exports['getSubjects']=function(_0x4e9037,_0x50570a,_0x132fde){var _0x1e695c={};var _0x3301f1={};var _0x3d81e9;var _0x30eb72;return db[_0xa0d1('0x3d')][_0xa0d1('0x4d')]({'where':{'id':_0x4e9037['params']['id']}})[_0xa0d1('0x24')](handleEntityNotFound(_0x50570a,null))['then'](function(_0x8dafb6){if(_0x8dafb6){_0x3d81e9=_0x8dafb6;_0x3301f1[_0xa0d1('0x33')]=_['keys'](db[_0xa0d1('0x4e')][_0xa0d1('0x2b')]);_0x3301f1[_0xa0d1('0x35')]=_[_0xa0d1('0x2f')](_0x4e9037['query']);_0x3301f1['filters']=_[_0xa0d1('0x31')](_0x3301f1[_0xa0d1('0x33')],_0x3301f1[_0xa0d1('0x35')]);_0x1e695c[_0xa0d1('0x32')]=_['intersection'](_0x3301f1[_0xa0d1('0x33')],qs[_0xa0d1('0x34')](_0x4e9037[_0xa0d1('0x35')]['fields']));_0x1e695c[_0xa0d1('0x32')]=_0x1e695c[_0xa0d1('0x32')][_0xa0d1('0x45')]?_0x1e695c['attributes']:_0x3301f1[_0xa0d1('0x33')];_0x1e695c['order']=qs[_0xa0d1('0x37')](_0x4e9037['query'][_0xa0d1('0x37')]);_0x1e695c[_0xa0d1('0x38')]=qs[_0xa0d1('0x30')](_['pick'](_0x4e9037[_0xa0d1('0x35')],_0x3301f1[_0xa0d1('0x30')]));if(_0x4e9037[_0xa0d1('0x35')][_0xa0d1('0x39')]){_0x1e695c[_0xa0d1('0x38')]=_[_0xa0d1('0x3a')](_0x1e695c[_0xa0d1('0x38')],{'$or':_[_0xa0d1('0x2a')](_0x1e695c[_0xa0d1('0x32')],function(_0x360c71){var _0x598ef6={};_0x598ef6[_0x360c71]={'$like':'%'+_0x4e9037[_0xa0d1('0x35')][_0xa0d1('0x39')]+'%'};return _0x598ef6;})});}_0x1e695c=_['merge']({},_0x1e695c,_0x4e9037['options']);return _0x3d81e9['getSubjects'](_0x1e695c);}})[_0xa0d1('0x24')](function(_0x3a03e4){if(_0x3a03e4){_0x30eb72=_0x3a03e4[_0xa0d1('0x45')];if(!_0x4e9037['query']['hasOwnProperty'](_0xa0d1('0x4c'))){_0x1e695c[_0xa0d1('0x1f')]=qs[_0xa0d1('0x1f')](_0x4e9037['query'][_0xa0d1('0x1f')]);_0x1e695c[_0xa0d1('0x1e')]=qs[_0xa0d1('0x1e')](_0x4e9037[_0xa0d1('0x35')][_0xa0d1('0x1e')]);}return _0x3d81e9[_0xa0d1('0x4f')](_0x1e695c);}})[_0xa0d1('0x24')](function(_0x5cb74a){if(_0x5cb74a){return _0x5cb74a?{'count':_0x30eb72,'rows':_0x5cb74a}:null;}})['then'](respondWithResult(_0x50570a,null))[_0xa0d1('0x42')](handleError(_0x50570a,null));};exports[_0xa0d1('0x50')]=function(_0x57ef59,_0x3bcc6e,_0x4680a3){var _0x34b9a6={};var _0x1a5cde={};var _0x466647;var _0x360a64;return db[_0xa0d1('0x3d')][_0xa0d1('0x4d')]({'where':{'id':_0x57ef59['params']['id']}})['then'](handleEntityNotFound(_0x3bcc6e,null))[_0xa0d1('0x24')](function(_0x40a43b){if(_0x40a43b){_0x466647=_0x40a43b;_0x1a5cde['model']=_[_0xa0d1('0x2f')](db[_0xa0d1('0x4e')][_0xa0d1('0x2b')]);_0x1a5cde[_0xa0d1('0x35')]=_[_0xa0d1('0x2f')](_0x57ef59[_0xa0d1('0x35')]);_0x1a5cde[_0xa0d1('0x30')]=_[_0xa0d1('0x31')](_0x1a5cde[_0xa0d1('0x33')],_0x1a5cde[_0xa0d1('0x35')]);_0x34b9a6[_0xa0d1('0x32')]=_[_0xa0d1('0x31')](_0x1a5cde[_0xa0d1('0x33')],qs[_0xa0d1('0x34')](_0x57ef59[_0xa0d1('0x35')][_0xa0d1('0x34')]));_0x34b9a6[_0xa0d1('0x32')]=_0x34b9a6[_0xa0d1('0x32')]['length']?_0x34b9a6[_0xa0d1('0x32')]:_0x1a5cde[_0xa0d1('0x33')];_0x34b9a6[_0xa0d1('0x4a')]=qs['sort'](_0x57ef59[_0xa0d1('0x35')][_0xa0d1('0x37')]);_0x34b9a6['where']=qs['filters'](_[_0xa0d1('0x4b')](_0x57ef59['query'],_0x1a5cde[_0xa0d1('0x30')]));if(_0x57ef59[_0xa0d1('0x35')]['filter']){_0x34b9a6[_0xa0d1('0x38')]=_['merge'](_0x34b9a6['where'],{'$or':_[_0xa0d1('0x2a')](_0x34b9a6['attributes'],function(_0x22401f){var _0x1b423a={};_0x1b423a[_0x22401f]={'$like':'%'+_0x57ef59[_0xa0d1('0x35')]['filter']+'%'};return _0x1b423a;})});}_0x34b9a6=_[_0xa0d1('0x3a')]({},_0x34b9a6,_0x57ef59[_0xa0d1('0x3c')]);return _0x466647[_0xa0d1('0x50')](_0x34b9a6);}})[_0xa0d1('0x24')](function(_0x593d0a){if(_0x593d0a){_0x360a64=_0x593d0a[_0xa0d1('0x45')];if(!_0x57ef59[_0xa0d1('0x35')][_0xa0d1('0x36')](_0xa0d1('0x4c'))){_0x34b9a6[_0xa0d1('0x1f')]=qs[_0xa0d1('0x1f')](_0x57ef59[_0xa0d1('0x35')][_0xa0d1('0x1f')]);_0x34b9a6[_0xa0d1('0x1e')]=qs[_0xa0d1('0x1e')](_0x57ef59[_0xa0d1('0x35')][_0xa0d1('0x1e')]);}return _0x466647[_0xa0d1('0x50')](_0x34b9a6);}})[_0xa0d1('0x24')](function(_0x458e12){if(_0x458e12){return _0x458e12?{'count':_0x360a64,'rows':_0x458e12}:null;}})[_0xa0d1('0x24')](respondWithResult(_0x3bcc6e,null))[_0xa0d1('0x42')](handleError(_0x3bcc6e,null));}; \ No newline at end of file +var _0x1105=['squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','keys','include','find','create','body','params','findOne','VtigerField','length','getSubjects','pick','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1105,0x124));var _0x5110=function(_0x4bbc15,_0x5ed722){_0x4bbc15=_0x4bbc15-0x0;var _0x192991=_0x1105[_0x4bbc15];return _0x192991;};'use strict';var emlformat=require(_0x5110('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5110('0x1'));var jsonpatch=require(_0x5110('0x2'));var rp=require(_0x5110('0x3'));var moment=require(_0x5110('0x4'));var BPromise=require(_0x5110('0x5'));var Mustache=require(_0x5110('0x6'));var util=require('util');var path=require(_0x5110('0x7'));var sox=require(_0x5110('0x8'));var csv=require(_0x5110('0x9'));var ejs=require(_0x5110('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5110('0xb'));var squel=require(_0x5110('0xc'));var crypto=require(_0x5110('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5110('0x9'));var querystring=require(_0x5110('0xe'));var Papa=require(_0x5110('0xf'));var Redis=require(_0x5110('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5110('0x11'));var as=require(_0x5110('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5110('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5110('0x14'))['db'];function respondWithStatusCode(_0x18395b,_0x3a8828){_0x3a8828=_0x3a8828||0xcc;return function(_0x558c34){if(_0x558c34){return _0x18395b[_0x5110('0x15')](_0x3a8828);}return _0x18395b[_0x5110('0x16')](_0x3a8828)['end']();};}function respondWithResult(_0x8435e5,_0x5220bd){_0x5220bd=_0x5220bd||0xc8;return function(_0x51dad2){if(_0x51dad2){return _0x8435e5[_0x5110('0x16')](_0x5220bd)[_0x5110('0x17')](_0x51dad2);}};}function respondWithFilteredResult(_0x3355bb,_0x3d05ef){return function(_0x3f0cbe){if(_0x3f0cbe){var _0x239aa0=typeof _0x3d05ef[_0x5110('0x18')]==='undefined'&&typeof _0x3d05ef['limit']==='undefined';var _0x40e2fc=_0x3f0cbe[_0x5110('0x19')];var _0x1f49b9=_0x239aa0?0x0:_0x3d05ef[_0x5110('0x18')];var _0x48f42b=_0x239aa0?_0x3f0cbe[_0x5110('0x19')]:_0x3d05ef['offset']+_0x3d05ef[_0x5110('0x1a')];var _0x258dc6;if(_0x48f42b>=_0x40e2fc){_0x48f42b=_0x40e2fc;_0x258dc6=0xc8;}else{_0x258dc6=0xce;}_0x3355bb['status'](_0x258dc6);return _0x3355bb[_0x5110('0x1b')](_0x5110('0x1c'),_0x1f49b9+'-'+_0x48f42b+'/'+_0x40e2fc)[_0x5110('0x17')](_0x3f0cbe);}return null;};}function patchUpdates(_0x4cdaf1){return function(_0xf460ea){try{jsonpatch[_0x5110('0x1d')](_0xf460ea,_0x4cdaf1,!![]);}catch(_0x4788a9){return BPromise[_0x5110('0x1e')](_0x4788a9);}return _0xf460ea[_0x5110('0x1f')]();};}function saveUpdates(_0x3adf6d,_0x4180e8){return function(_0x20cb2a){if(_0x20cb2a){return _0x20cb2a[_0x5110('0x20')](_0x3adf6d)[_0x5110('0x21')](function(_0x47a91b){return _0x47a91b;});}return null;};}function removeEntity(_0x20be50,_0x293b30){return function(_0x3a56e6){if(_0x3a56e6){return _0x3a56e6[_0x5110('0x22')]()[_0x5110('0x21')](function(){_0x20be50[_0x5110('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aef6c,_0x50bd63){return function(_0x5e4ec6){if(!_0x5e4ec6){_0x4aef6c[_0x5110('0x15')](0x194);}return _0x5e4ec6;};}function handleError(_0x2b783a,_0x224ca2){_0x224ca2=_0x224ca2||0x1f4;return function(_0x13a7c2){logger[_0x5110('0x23')](_0x13a7c2[_0x5110('0x24')]);if(_0x13a7c2[_0x5110('0x25')]){delete _0x13a7c2[_0x5110('0x25')];}_0x2b783a[_0x5110('0x16')](_0x224ca2)[_0x5110('0x26')](_0x13a7c2);};}exports['index']=function(_0xd86d86,_0x107a43){var _0x4ad05f={},_0x123311={},_0x45cb3a={'count':0x0,'rows':[]};var _0x1704c3=_[_0x5110('0x27')](db[_0x5110('0x28')][_0x5110('0x29')],function(_0x4ff948){return{'name':_0x4ff948[_0x5110('0x2a')],'type':_0x4ff948[_0x5110('0x2b')][_0x5110('0x2c')]};});_0x123311[_0x5110('0x2d')]=_['map'](_0x1704c3,_0x5110('0x25'));_0x123311['query']=_['keys'](_0xd86d86['query']);_0x123311['filters']=_[_0x5110('0x2e')](_0x123311['model'],_0x123311[_0x5110('0x2f')]);_0x4ad05f[_0x5110('0x30')]=_['intersection'](_0x123311[_0x5110('0x2d')],qs[_0x5110('0x31')](_0xd86d86[_0x5110('0x2f')]['fields']));_0x4ad05f['attributes']=_0x4ad05f[_0x5110('0x30')]['length']?_0x4ad05f[_0x5110('0x30')]:_0x123311[_0x5110('0x2d')];if(!_0xd86d86[_0x5110('0x2f')][_0x5110('0x32')](_0x5110('0x33'))){_0x4ad05f[_0x5110('0x1a')]=qs[_0x5110('0x1a')](_0xd86d86[_0x5110('0x2f')]['limit']);_0x4ad05f[_0x5110('0x18')]=qs[_0x5110('0x18')](_0xd86d86['query'][_0x5110('0x18')]);}_0x4ad05f[_0x5110('0x34')]=qs[_0x5110('0x35')](_0xd86d86['query'][_0x5110('0x35')]);_0x4ad05f[_0x5110('0x36')]=qs[_0x5110('0x37')](_['pick'](_0xd86d86['query'],_0x123311[_0x5110('0x37')]),_0x1704c3);if(_0xd86d86[_0x5110('0x2f')][_0x5110('0x38')]){_0x4ad05f[_0x5110('0x36')]=_[_0x5110('0x39')](_0x4ad05f['where'],{'$or':_['map'](_0x1704c3,function(_0x1e13ad){if(_0x1e13ad['type']!==_0x5110('0x3a')){var _0x5cfd77={};_0x5cfd77[_0x1e13ad[_0x5110('0x25')]]={'$like':'%'+_0xd86d86[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x5cfd77;}})});}_0x4ad05f=_[_0x5110('0x39')]({},_0x4ad05f,_0xd86d86[_0x5110('0x3b')]);var _0x4867fb={'where':_0x4ad05f['where']};return db[_0x5110('0x28')][_0x5110('0x19')](_0x4867fb)['then'](function(_0x30df61){_0x45cb3a[_0x5110('0x19')]=_0x30df61;if(_0xd86d86[_0x5110('0x2f')][_0x5110('0x3c')]){_0x4ad05f['include']=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x4ad05f);})[_0x5110('0x21')](function(_0x414fda){_0x45cb3a[_0x5110('0x3d')]=_0x414fda;return _0x45cb3a;})['then'](respondWithFilteredResult(_0x107a43,_0x4ad05f))[_0x5110('0x3e')](handleError(_0x107a43,null));};exports[_0x5110('0x3f')]=function(_0x1467db,_0xbb130b){var _0x418f54={'raw':![],'where':{'id':_0x1467db['params']['id']}},_0x2af5be={};_0x2af5be['model']=_[_0x5110('0x40')](db[_0x5110('0x28')][_0x5110('0x29')]);_0x2af5be[_0x5110('0x2f')]=_[_0x5110('0x40')](_0x1467db[_0x5110('0x2f')]);_0x2af5be[_0x5110('0x37')]=_[_0x5110('0x2e')](_0x2af5be[_0x5110('0x2d')],_0x2af5be[_0x5110('0x2f')]);_0x418f54[_0x5110('0x30')]=_[_0x5110('0x2e')](_0x2af5be[_0x5110('0x2d')],qs[_0x5110('0x31')](_0x1467db[_0x5110('0x2f')][_0x5110('0x31')]));_0x418f54[_0x5110('0x30')]=_0x418f54[_0x5110('0x30')]['length']?_0x418f54[_0x5110('0x30')]:_0x2af5be[_0x5110('0x2d')];if(_0x1467db[_0x5110('0x2f')][_0x5110('0x3c')]){_0x418f54[_0x5110('0x41')]=[{'all':!![]}];}_0x418f54=_[_0x5110('0x39')]({},_0x418f54,_0x1467db[_0x5110('0x3b')]);return db[_0x5110('0x28')][_0x5110('0x42')](_0x418f54)[_0x5110('0x21')](handleEntityNotFound(_0xbb130b,null))['then'](respondWithResult(_0xbb130b,null))['catch'](handleError(_0xbb130b,null));};exports['create']=function(_0x1dafe3,_0x2d80e4){return db['VtigerConfiguration'][_0x5110('0x43')](_0x1dafe3[_0x5110('0x44')],{})[_0x5110('0x21')](respondWithResult(_0x2d80e4,0xc9))[_0x5110('0x3e')](handleError(_0x2d80e4,null));};exports[_0x5110('0x20')]=function(_0x5541ad,_0x28c512){if(_0x5541ad[_0x5110('0x44')]['id']){delete _0x5541ad[_0x5110('0x44')]['id'];}return db[_0x5110('0x28')]['find']({'where':{'id':_0x5541ad[_0x5110('0x45')]['id']}})[_0x5110('0x21')](handleEntityNotFound(_0x28c512,null))[_0x5110('0x21')](saveUpdates(_0x5541ad['body'],null))[_0x5110('0x21')](respondWithResult(_0x28c512,null))[_0x5110('0x3e')](handleError(_0x28c512,null));};exports[_0x5110('0x22')]=function(_0x36798e,_0x369d5c){return db['VtigerConfiguration'][_0x5110('0x42')]({'where':{'id':_0x36798e[_0x5110('0x45')]['id']}})[_0x5110('0x21')](handleEntityNotFound(_0x369d5c,null))['then'](removeEntity(_0x369d5c,null))['catch'](handleError(_0x369d5c,null));};exports['getFields']=function(_0x536c14,_0x2318ef,_0x2ecc71){var _0x395fe5={};var _0x41d750={};var _0x4f67c9;var _0xb54cdc;return db[_0x5110('0x28')][_0x5110('0x46')]({'where':{'id':_0x536c14[_0x5110('0x45')]['id']}})[_0x5110('0x21')](handleEntityNotFound(_0x2318ef,null))[_0x5110('0x21')](function(_0x4907dd){if(_0x4907dd){_0x4f67c9=_0x4907dd;_0x41d750[_0x5110('0x2d')]=_[_0x5110('0x40')](db[_0x5110('0x47')][_0x5110('0x29')]);_0x41d750[_0x5110('0x2f')]=_[_0x5110('0x40')](_0x536c14[_0x5110('0x2f')]);_0x41d750[_0x5110('0x37')]=_['intersection'](_0x41d750[_0x5110('0x2d')],_0x41d750['query']);_0x395fe5['attributes']=_[_0x5110('0x2e')](_0x41d750[_0x5110('0x2d')],qs[_0x5110('0x31')](_0x536c14['query'][_0x5110('0x31')]));_0x395fe5[_0x5110('0x30')]=_0x395fe5[_0x5110('0x30')][_0x5110('0x48')]?_0x395fe5[_0x5110('0x30')]:_0x41d750[_0x5110('0x2d')];_0x395fe5['order']=qs[_0x5110('0x35')](_0x536c14[_0x5110('0x2f')][_0x5110('0x35')]);_0x395fe5[_0x5110('0x36')]=qs[_0x5110('0x37')](_['pick'](_0x536c14['query'],_0x41d750[_0x5110('0x37')]));if(_0x536c14['query']['filter']){_0x395fe5['where']=_[_0x5110('0x39')](_0x395fe5[_0x5110('0x36')],{'$or':_[_0x5110('0x27')](_0x395fe5[_0x5110('0x30')],function(_0x1d5944){var _0x2747f1={};_0x2747f1[_0x1d5944]={'$like':'%'+_0x536c14[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x2747f1;})});}_0x395fe5=_['merge']({},_0x395fe5,_0x536c14[_0x5110('0x3b')]);return _0x4f67c9['getFields'](_0x395fe5);}})[_0x5110('0x21')](function(_0xc46944){if(_0xc46944){_0xb54cdc=_0xc46944[_0x5110('0x48')];if(!_0x536c14[_0x5110('0x2f')][_0x5110('0x32')]('nolimit')){_0x395fe5['limit']=qs[_0x5110('0x1a')](_0x536c14[_0x5110('0x2f')]['limit']);_0x395fe5[_0x5110('0x18')]=qs[_0x5110('0x18')](_0x536c14[_0x5110('0x2f')][_0x5110('0x18')]);}return _0x4f67c9['getFields'](_0x395fe5);}})['then'](function(_0x1de2f3){if(_0x1de2f3){return _0x1de2f3?{'count':_0xb54cdc,'rows':_0x1de2f3}:null;}})[_0x5110('0x21')](respondWithResult(_0x2318ef,null))[_0x5110('0x3e')](handleError(_0x2318ef,null));};exports[_0x5110('0x49')]=function(_0x124e27,_0xb01f04,_0x5ce839){var _0x5635dd={};var _0x38d6c8={};var _0x3ee5c6;var _0x390775;return db['VtigerConfiguration'][_0x5110('0x46')]({'where':{'id':_0x124e27[_0x5110('0x45')]['id']}})['then'](handleEntityNotFound(_0xb01f04,null))[_0x5110('0x21')](function(_0x182699){if(_0x182699){_0x3ee5c6=_0x182699;_0x38d6c8['model']=_[_0x5110('0x40')](db[_0x5110('0x47')]['rawAttributes']);_0x38d6c8[_0x5110('0x2f')]=_[_0x5110('0x40')](_0x124e27[_0x5110('0x2f')]);_0x38d6c8[_0x5110('0x37')]=_[_0x5110('0x2e')](_0x38d6c8[_0x5110('0x2d')],_0x38d6c8[_0x5110('0x2f')]);_0x5635dd[_0x5110('0x30')]=_[_0x5110('0x2e')](_0x38d6c8[_0x5110('0x2d')],qs['fields'](_0x124e27[_0x5110('0x2f')][_0x5110('0x31')]));_0x5635dd[_0x5110('0x30')]=_0x5635dd[_0x5110('0x30')]['length']?_0x5635dd['attributes']:_0x38d6c8[_0x5110('0x2d')];_0x5635dd[_0x5110('0x34')]=qs[_0x5110('0x35')](_0x124e27[_0x5110('0x2f')][_0x5110('0x35')]);_0x5635dd[_0x5110('0x36')]=qs[_0x5110('0x37')](_[_0x5110('0x4a')](_0x124e27['query'],_0x38d6c8[_0x5110('0x37')]));if(_0x124e27[_0x5110('0x2f')][_0x5110('0x38')]){_0x5635dd[_0x5110('0x36')]=_[_0x5110('0x39')](_0x5635dd['where'],{'$or':_[_0x5110('0x27')](_0x5635dd[_0x5110('0x30')],function(_0x1f9856){var _0x32003a={};_0x32003a[_0x1f9856]={'$like':'%'+_0x124e27[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x32003a;})});}_0x5635dd=_['merge']({},_0x5635dd,_0x124e27['options']);return _0x3ee5c6['getSubjects'](_0x5635dd);}})[_0x5110('0x21')](function(_0x49d992){if(_0x49d992){_0x390775=_0x49d992[_0x5110('0x48')];if(!_0x124e27[_0x5110('0x2f')]['hasOwnProperty'](_0x5110('0x33'))){_0x5635dd[_0x5110('0x1a')]=qs[_0x5110('0x1a')](_0x124e27[_0x5110('0x2f')]['limit']);_0x5635dd[_0x5110('0x18')]=qs[_0x5110('0x18')](_0x124e27[_0x5110('0x2f')][_0x5110('0x18')]);}return _0x3ee5c6[_0x5110('0x49')](_0x5635dd);}})['then'](function(_0x58e1d3){if(_0x58e1d3){return _0x58e1d3?{'count':_0x390775,'rows':_0x58e1d3}:null;}})[_0x5110('0x21')](respondWithResult(_0xb01f04,null))[_0x5110('0x3e')](handleError(_0xb01f04,null));};exports[_0x5110('0x4b')]=function(_0x2d6a51,_0x2ba849,_0x3fe140){var _0x358efa={};var _0xe1378b={};var _0x52e1d4;var _0x12eed4;return db[_0x5110('0x28')][_0x5110('0x46')]({'where':{'id':_0x2d6a51[_0x5110('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ba849,null))[_0x5110('0x21')](function(_0x221437){if(_0x221437){_0x52e1d4=_0x221437;_0xe1378b['model']=_[_0x5110('0x40')](db['VtigerField']['rawAttributes']);_0xe1378b['query']=_[_0x5110('0x40')](_0x2d6a51[_0x5110('0x2f')]);_0xe1378b[_0x5110('0x37')]=_[_0x5110('0x2e')](_0xe1378b['model'],_0xe1378b[_0x5110('0x2f')]);_0x358efa[_0x5110('0x30')]=_[_0x5110('0x2e')](_0xe1378b['model'],qs[_0x5110('0x31')](_0x2d6a51[_0x5110('0x2f')]['fields']));_0x358efa['attributes']=_0x358efa[_0x5110('0x30')][_0x5110('0x48')]?_0x358efa[_0x5110('0x30')]:_0xe1378b[_0x5110('0x2d')];_0x358efa['order']=qs[_0x5110('0x35')](_0x2d6a51[_0x5110('0x2f')][_0x5110('0x35')]);_0x358efa[_0x5110('0x36')]=qs[_0x5110('0x37')](_['pick'](_0x2d6a51[_0x5110('0x2f')],_0xe1378b[_0x5110('0x37')]));if(_0x2d6a51['query']['filter']){_0x358efa['where']=_[_0x5110('0x39')](_0x358efa[_0x5110('0x36')],{'$or':_[_0x5110('0x27')](_0x358efa[_0x5110('0x30')],function(_0x310042){var _0x4424d1={};_0x4424d1[_0x310042]={'$like':'%'+_0x2d6a51[_0x5110('0x2f')][_0x5110('0x38')]+'%'};return _0x4424d1;})});}_0x358efa=_[_0x5110('0x39')]({},_0x358efa,_0x2d6a51[_0x5110('0x3b')]);return _0x52e1d4[_0x5110('0x4b')](_0x358efa);}})[_0x5110('0x21')](function(_0x172bf2){if(_0x172bf2){_0x12eed4=_0x172bf2[_0x5110('0x48')];if(!_0x2d6a51[_0x5110('0x2f')]['hasOwnProperty'](_0x5110('0x33'))){_0x358efa['limit']=qs[_0x5110('0x1a')](_0x2d6a51['query'][_0x5110('0x1a')]);_0x358efa[_0x5110('0x18')]=qs['offset'](_0x2d6a51[_0x5110('0x2f')][_0x5110('0x18')]);}return _0x52e1d4[_0x5110('0x4b')](_0x358efa);}})[_0x5110('0x21')](function(_0x3fb199){if(_0x3fb199){return _0x3fb199?{'count':_0x12eed4,'rows':_0x3fb199}:null;}})[_0x5110('0x21')](respondWithResult(_0x2ba849,null))[_0x5110('0x3e')](handleError(_0x2ba849,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d00b184..9253d28 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 _0x7731=['int_vtiger_configurations','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerConfiguration'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7731,0x114));var _0x1773=function(_0x59933e,_0x2aa6be){_0x59933e=_0x59933e-0x0;var _0x48f7ac=_0x7731[_0x59933e];return _0x48f7ac;};'use strict';var _=require('lodash');var util=require(_0x1773('0x0'));var logger=require(_0x1773('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1773('0x2'));var rp=require(_0x1773('0x3'));var fs=require('fs');var path=require(_0x1773('0x4'));var rimraf=require(_0x1773('0x5'));var config=require(_0x1773('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x1773('0x7')]=function(_0x2c92e4,_0x4a5872){return _0x2c92e4[_0x1773('0x8')](_0x1773('0x9'),attributes,{'tableName':_0x1773('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa15b=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x3f1b61,_0x23ff33){var _0x15560c=function(_0x39a1c7){while(--_0x39a1c7){_0x3f1b61['push'](_0x3f1b61['shift']());}};_0x15560c(++_0x23ff33);}(_0xa15b,0x1df));var _0xba15=function(_0x47b326,_0x18ff51){_0x47b326=_0x47b326-0x0;var _0x23d5a1=_0xa15b[_0x47b326];return _0x23d5a1;};'use strict';var _=require(_0xba15('0x0'));var util=require(_0xba15('0x1'));var logger=require(_0xba15('0x2'))('api');var moment=require('moment');var BPromise=require(_0xba15('0x3'));var rp=require(_0xba15('0x4'));var fs=require('fs');var path=require(_0xba15('0x5'));var rimraf=require(_0xba15('0x6'));var config=require(_0xba15('0x7'));var attributes=require(_0xba15('0x8'));module[_0xba15('0x9')]=function(_0x4df367,_0x4a71fb){return _0x4df367[_0xba15('0xa')](_0xba15('0xb'),attributes,{'tableName':_0xba15('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 5eeba5d..d1b9158 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 _0x6ecc=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x6ecc,0x8b));var _0xc6ec=function(_0x1e961b,_0x1520a5){_0x1e961b=_0x1e961b-0x0;var _0x28326f=_0x6ecc[_0x1e961b];return _0x28326f;};'use strict';var _=require('lodash');var util=require(_0xc6ec('0x0'));var moment=require(_0xc6ec('0x1'));var BPromise=require('bluebird');var rs=require(_0xc6ec('0x2'));var fs=require('fs');var Redis=require(_0xc6ec('0x3'));var db=require(_0xc6ec('0x4'))['db'];var utils=require(_0xc6ec('0x5'));var logger=require(_0xc6ec('0x6'))('rpc');var config=require(_0xc6ec('0x7'));var jayson=require(_0xc6ec('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3554bb,_0x173be2,_0x2861b7){return new BPromise(function(_0x1454a5,_0x70a2cd){return client[_0xc6ec('0x9')](_0x3554bb,_0x2861b7)[_0xc6ec('0xa')](function(_0x620aac){logger['info'](_0xc6ec('0xb'),_0x173be2,'request\x20sent');logger[_0xc6ec('0xc')](_0xc6ec('0xd'),_0x173be2,'request\x20sent',JSON[_0xc6ec('0xe')](_0x620aac));if(_0x620aac[_0xc6ec('0xf')]){if(_0x620aac[_0xc6ec('0xf')]['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x173be2,_0x620aac[_0xc6ec('0xf')][_0xc6ec('0x10')]);return _0x70a2cd(_0x620aac[_0xc6ec('0xf')][_0xc6ec('0x10')]);}logger[_0xc6ec('0xf')](_0xc6ec('0xb'),_0x173be2,_0x620aac[_0xc6ec('0xf')][_0xc6ec('0x10')]);return _0x1454a5(_0x620aac['error']['message']);}else{logger[_0xc6ec('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x173be2,_0xc6ec('0x12'));_0x1454a5(_0x620aac['result'][_0xc6ec('0x10')]);}})[_0xc6ec('0x13')](function(_0x24ce20){logger[_0xc6ec('0xf')](_0xc6ec('0xb'),_0x173be2,_0x24ce20);_0x70a2cd(_0x24ce20);});});} \ No newline at end of file +var _0x3d30=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5c8915,_0x5f2a0c){var _0x3ae2d7=function(_0x248085){while(--_0x248085){_0x5c8915['push'](_0x5c8915['shift']());}};_0x3ae2d7(++_0x5f2a0c);}(_0x3d30,0xf1));var _0x03d3=function(_0x1ad0af,_0x140b7e){_0x1ad0af=_0x1ad0af-0x0;var _0x39d66c=_0x3d30[_0x1ad0af];return _0x39d66c;};'use strict';var _=require(_0x03d3('0x0'));var util=require(_0x03d3('0x1'));var moment=require(_0x03d3('0x2'));var BPromise=require(_0x03d3('0x3'));var rs=require(_0x03d3('0x4'));var fs=require('fs');var Redis=require(_0x03d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03d3('0x6'))(_0x03d3('0x7'));var config=require(_0x03d3('0x8'));var jayson=require(_0x03d3('0x9'));var client=jayson['client'][_0x03d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f9432,_0x4397df,_0x101bc0){return new BPromise(function(_0x307789,_0x3847d8){return client['request'](_0x3f9432,_0x101bc0)['then'](function(_0x374af8){logger[_0x03d3('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x4397df,'request\x20sent');logger[_0x03d3('0xc')](_0x03d3('0xd'),_0x4397df,_0x03d3('0xe'),JSON[_0x03d3('0xf')](_0x374af8));if(_0x374af8[_0x03d3('0x10')]){if(_0x374af8[_0x03d3('0x10')][_0x03d3('0x11')]===0x1f4){logger[_0x03d3('0x10')](_0x03d3('0x12'),_0x4397df,_0x374af8[_0x03d3('0x10')][_0x03d3('0x13')]);return _0x3847d8(_0x374af8[_0x03d3('0x10')]['message']);}logger[_0x03d3('0x10')](_0x03d3('0x12'),_0x4397df,_0x374af8[_0x03d3('0x10')][_0x03d3('0x13')]);return _0x307789(_0x374af8[_0x03d3('0x10')][_0x03d3('0x13')]);}else{logger[_0x03d3('0xb')](_0x03d3('0x12'),_0x4397df,_0x03d3('0xe'));_0x307789(_0x374af8[_0x03d3('0x14')][_0x03d3('0x13')]);}})[_0x03d3('0x15')](function(_0x220c52){logger['error'](_0x03d3('0x12'),_0x4397df,_0x220c52);_0x3847d8(_0x220c52);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 95e227c..a4082ec 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 _0xc3f0=['show','post','put','/:id','update','destroy','multer','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x4440f3,_0x3d1418){var _0x426de2=function(_0x5a3c6a){while(--_0x5a3c6a){_0x4440f3['push'](_0x4440f3['shift']());}};_0x426de2(++_0x3d1418);}(_0xc3f0,0xf0));var _0x0c3f=function(_0x44f88c,_0x437294){_0x44f88c=_0x44f88c-0x0;var _0x56dd44=_0xc3f0[_0x44f88c];return _0x56dd44;};'use strict';var multer=require(_0x0c3f('0x0'));var util=require('util');var path=require(_0x0c3f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c3f('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0c3f('0x3'));var config=require(_0x0c3f('0x4'));var controller=require('./intVtigerField.controller');router[_0x0c3f('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x0c3f('0x6')](),controller[_0x0c3f('0x7')]);router[_0x0c3f('0x8')]('/',auth[_0x0c3f('0x6')](),controller['create']);router[_0x0c3f('0x9')](_0x0c3f('0xa'),auth['isAuthenticated'](),controller[_0x0c3f('0xb')]);router['delete'](_0x0c3f('0xa'),auth[_0x0c3f('0x6')](),controller[_0x0c3f('0xc')]);module['exports']=router; \ No newline at end of file +var _0x07f9=['delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','create','put','update'];(function(_0x34b6aa,_0x5ddd29){var _0x3ead29=function(_0x53979c){while(--_0x53979c){_0x34b6aa['push'](_0x34b6aa['shift']());}};_0x3ead29(++_0x5ddd29);}(_0x07f9,0x123));var _0x907f=function(_0x79dafd,_0x240134){_0x79dafd=_0x79dafd-0x0;var _0x405d32=_0x07f9[_0x79dafd];return _0x405d32;};'use strict';var multer=require('multer');var util=require(_0x907f('0x0'));var path=require(_0x907f('0x1'));var timeout=require('connect-timeout');var express=require(_0x907f('0x2'));var router=express[_0x907f('0x3')]();var fs_extra=require(_0x907f('0x4'));var auth=require(_0x907f('0x5'));var interaction=require(_0x907f('0x6'));var config=require(_0x907f('0x7'));var controller=require('./intVtigerField.controller');router[_0x907f('0x8')]('/',auth['isAuthenticated'](),controller[_0x907f('0x9')]);router[_0x907f('0x8')](_0x907f('0xa'),auth[_0x907f('0xb')](),controller['show']);router['post']('/',auth[_0x907f('0xb')](),controller[_0x907f('0xc')]);router[_0x907f('0xd')](_0x907f('0xa'),auth[_0x907f('0xb')](),controller[_0x907f('0xe')]);router[_0x907f('0xf')](_0x907f('0xa'),auth[_0x907f('0xb')](),controller[_0x907f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 12de83e..73d2d47 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 _0xe819=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x543ae5,_0x24e12f){var _0x5da735=function(_0x55ea98){while(--_0x55ea98){_0x543ae5['push'](_0x543ae5['shift']());}};_0x5da735(++_0x24e12f);}(_0xe819,0x193));var _0x9e81=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe819[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x9e81('0x0'));module[_0x9e81('0x1')]={'type':{'type':Sequelize[_0x9e81('0x2')](_0x9e81('0x3'),_0x9e81('0x4'),_0x9e81('0x5'),'keyValue',_0x9e81('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9e81('0x7')]},'key':{'type':Sequelize[_0x9e81('0x7')]},'keyType':{'type':Sequelize[_0x9e81('0x2')]('string','variable',_0x9e81('0x5'))},'keyContent':{'type':Sequelize[_0x9e81('0x7')]},'idField':{'type':Sequelize[_0x9e81('0x7')]},'nameField':{'type':Sequelize[_0x9e81('0x7')]},'customField':{'type':Sequelize[_0x9e81('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e81('0x7')]}}; \ No newline at end of file +var _0xa382=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xa382,0x6c));var _0x2a38=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa382[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x2a38('0x0'));module['exports']={'type':{'type':Sequelize[_0x2a38('0x1')](_0x2a38('0x2'),_0x2a38('0x3'),_0x2a38('0x4'),_0x2a38('0x5'),_0x2a38('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2a38('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2a38('0x1')](_0x2a38('0x2'),_0x2a38('0x3'),_0x2a38('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2a38('0x7')]},'nameField':{'type':Sequelize[_0x2a38('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a38('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index bafbda5..59df61d 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 _0x83db=['filter','merge','options','includeAll','include','findAll','rows','keys','length','find','catch','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','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','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','VtigerField','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x3f94f9,_0x42774b){var _0x46f84f=function(_0xa080d8){while(--_0xa080d8){_0x3f94f9['push'](_0x3f94f9['shift']());}};_0x46f84f(++_0x42774b);}(_0x83db,0x13f));var _0xb83d=function(_0x39c009,_0x21b330){_0x39c009=_0x39c009-0x0;var _0x2c6cb8=_0x83db[_0x39c009];return _0x2c6cb8;};'use strict';var emlformat=require(_0xb83d('0x0'));var rimraf=require(_0xb83d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb83d('0x2'));var rp=require(_0xb83d('0x3'));var moment=require(_0xb83d('0x4'));var BPromise=require(_0xb83d('0x5'));var Mustache=require(_0xb83d('0x6'));var util=require(_0xb83d('0x7'));var path=require(_0xb83d('0x8'));var sox=require(_0xb83d('0x9'));var csv=require(_0xb83d('0xa'));var ejs=require(_0xb83d('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb83d('0xc'));var squel=require(_0xb83d('0xd'));var crypto=require(_0xb83d('0xe'));var jsforce=require(_0xb83d('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb83d('0x10'));var Redis=require(_0xb83d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb83d('0x12'));var as=require(_0xb83d('0x13'));var hardwareService=require(_0xb83d('0x14'));var logger=require(_0xb83d('0x15'))(_0xb83d('0x16'));var utils=require(_0xb83d('0x17'));var config=require(_0xb83d('0x18'));var licenseUtil=require(_0xb83d('0x19'));var db=require(_0xb83d('0x1a'))['db'];function respondWithStatusCode(_0x9bbedb,_0x40a56f){_0x40a56f=_0x40a56f||0xcc;return function(_0x2a5c40){if(_0x2a5c40){return _0x9bbedb[_0xb83d('0x1b')](_0x40a56f);}return _0x9bbedb[_0xb83d('0x1c')](_0x40a56f)[_0xb83d('0x1d')]();};}function respondWithResult(_0x24c44b,_0xdb2029){_0xdb2029=_0xdb2029||0xc8;return function(_0x5850c1){if(_0x5850c1){return _0x24c44b[_0xb83d('0x1c')](_0xdb2029)[_0xb83d('0x1e')](_0x5850c1);}};}function respondWithFilteredResult(_0x59df08,_0x4489d1){return function(_0x55c1e5){if(_0x55c1e5){var _0x1df89e=typeof _0x4489d1[_0xb83d('0x1f')]===_0xb83d('0x20')&&typeof _0x4489d1['limit']===_0xb83d('0x20');var _0x1e2bbd=_0x55c1e5[_0xb83d('0x21')];var _0x400df5=_0x1df89e?0x0:_0x4489d1[_0xb83d('0x1f')];var _0x305591=_0x1df89e?_0x55c1e5[_0xb83d('0x21')]:_0x4489d1[_0xb83d('0x1f')]+_0x4489d1[_0xb83d('0x22')];var _0x3a7556;if(_0x305591>=_0x1e2bbd){_0x305591=_0x1e2bbd;_0x3a7556=0xc8;}else{_0x3a7556=0xce;}_0x59df08['status'](_0x3a7556);return _0x59df08[_0xb83d('0x23')](_0xb83d('0x24'),_0x400df5+'-'+_0x305591+'/'+_0x1e2bbd)[_0xb83d('0x1e')](_0x55c1e5);}return null;};}function patchUpdates(_0x2cbda6){return function(_0xef63ba){try{jsonpatch[_0xb83d('0x25')](_0xef63ba,_0x2cbda6,!![]);}catch(_0x270895){return BPromise[_0xb83d('0x26')](_0x270895);}return _0xef63ba[_0xb83d('0x27')]();};}function saveUpdates(_0x55c3ee,_0x337180){return function(_0xe7e707){if(_0xe7e707){return _0xe7e707[_0xb83d('0x28')](_0x55c3ee)[_0xb83d('0x29')](function(_0x253e1d){return _0x253e1d;});}return null;};}function removeEntity(_0x5b93d6,_0x425c08){return function(_0x6a1b8){if(_0x6a1b8){return _0x6a1b8['destroy']()[_0xb83d('0x29')](function(){_0x5b93d6[_0xb83d('0x1c')](0xcc)[_0xb83d('0x1d')]();});}};}function handleEntityNotFound(_0x1a5507,_0x5e80f8){return function(_0x443223){if(!_0x443223){_0x1a5507[_0xb83d('0x1b')](0x194);}return _0x443223;};}function handleError(_0x35fdf4,_0x2d9630){_0x2d9630=_0x2d9630||0x1f4;return function(_0x5a2e0b){logger['error'](_0x5a2e0b[_0xb83d('0x2a')]);if(_0x5a2e0b[_0xb83d('0x2b')]){delete _0x5a2e0b['name'];}_0x35fdf4['status'](_0x2d9630)[_0xb83d('0x2c')](_0x5a2e0b);};}exports['index']=function(_0x5ab220,_0x3ad44f){var _0x1ef30f={},_0x21fa45={},_0xf8650a={'count':0x0,'rows':[]};var _0x4f3e87=_['map'](db[_0xb83d('0x2d')][_0xb83d('0x2e')],function(_0x57d01d){return{'name':_0x57d01d['fieldName'],'type':_0x57d01d[_0xb83d('0x2f')][_0xb83d('0x30')]};});_0x21fa45[_0xb83d('0x31')]=_[_0xb83d('0x32')](_0x4f3e87,_0xb83d('0x2b'));_0x21fa45[_0xb83d('0x33')]=_['keys'](_0x5ab220[_0xb83d('0x33')]);_0x21fa45[_0xb83d('0x34')]=_[_0xb83d('0x35')](_0x21fa45[_0xb83d('0x31')],_0x21fa45[_0xb83d('0x33')]);_0x1ef30f[_0xb83d('0x36')]=_[_0xb83d('0x35')](_0x21fa45[_0xb83d('0x31')],qs[_0xb83d('0x37')](_0x5ab220[_0xb83d('0x33')][_0xb83d('0x37')]));_0x1ef30f[_0xb83d('0x36')]=_0x1ef30f[_0xb83d('0x36')]['length']?_0x1ef30f[_0xb83d('0x36')]:_0x21fa45[_0xb83d('0x31')];if(!_0x5ab220['query'][_0xb83d('0x38')](_0xb83d('0x39'))){_0x1ef30f['limit']=qs[_0xb83d('0x22')](_0x5ab220[_0xb83d('0x33')][_0xb83d('0x22')]);_0x1ef30f['offset']=qs[_0xb83d('0x1f')](_0x5ab220['query'][_0xb83d('0x1f')]);}_0x1ef30f['order']=qs['sort'](_0x5ab220['query'][_0xb83d('0x3a')]);_0x1ef30f[_0xb83d('0x3b')]=qs[_0xb83d('0x34')](_[_0xb83d('0x3c')](_0x5ab220[_0xb83d('0x33')],_0x21fa45[_0xb83d('0x34')]),_0x4f3e87);if(_0x5ab220[_0xb83d('0x33')][_0xb83d('0x3d')]){_0x1ef30f[_0xb83d('0x3b')]=_[_0xb83d('0x3e')](_0x1ef30f['where'],{'$or':_[_0xb83d('0x32')](_0x4f3e87,function(_0x2c8aff){if(_0x2c8aff[_0xb83d('0x2f')]!=='VIRTUAL'){var _0x11d1f3={};_0x11d1f3[_0x2c8aff[_0xb83d('0x2b')]]={'$like':'%'+_0x5ab220[_0xb83d('0x33')][_0xb83d('0x3d')]+'%'};return _0x11d1f3;}})});}_0x1ef30f=_[_0xb83d('0x3e')]({},_0x1ef30f,_0x5ab220[_0xb83d('0x3f')]);var _0x90b8ca={'where':_0x1ef30f[_0xb83d('0x3b')]};return db['VtigerField'][_0xb83d('0x21')](_0x90b8ca)[_0xb83d('0x29')](function(_0x19dfdf){_0xf8650a[_0xb83d('0x21')]=_0x19dfdf;if(_0x5ab220[_0xb83d('0x33')][_0xb83d('0x40')]){_0x1ef30f[_0xb83d('0x41')]=[{'all':!![]}];}return db[_0xb83d('0x2d')][_0xb83d('0x42')](_0x1ef30f);})[_0xb83d('0x29')](function(_0x60db6a){_0xf8650a[_0xb83d('0x43')]=_0x60db6a;return _0xf8650a;})[_0xb83d('0x29')](respondWithFilteredResult(_0x3ad44f,_0x1ef30f))['catch'](handleError(_0x3ad44f,null));};exports['show']=function(_0x21c62f,_0x52ee8a){var _0x5851d5={'raw':!![],'where':{'id':_0x21c62f['params']['id']}},_0x16ec73={};_0x16ec73[_0xb83d('0x31')]=_[_0xb83d('0x44')](db[_0xb83d('0x2d')][_0xb83d('0x2e')]);_0x16ec73[_0xb83d('0x33')]=_['keys'](_0x21c62f[_0xb83d('0x33')]);_0x16ec73[_0xb83d('0x34')]=_['intersection'](_0x16ec73[_0xb83d('0x31')],_0x16ec73[_0xb83d('0x33')]);_0x5851d5[_0xb83d('0x36')]=_[_0xb83d('0x35')](_0x16ec73[_0xb83d('0x31')],qs[_0xb83d('0x37')](_0x21c62f[_0xb83d('0x33')][_0xb83d('0x37')]));_0x5851d5[_0xb83d('0x36')]=_0x5851d5[_0xb83d('0x36')][_0xb83d('0x45')]?_0x5851d5[_0xb83d('0x36')]:_0x16ec73[_0xb83d('0x31')];if(_0x21c62f[_0xb83d('0x33')][_0xb83d('0x40')]){_0x5851d5[_0xb83d('0x41')]=[{'all':!![]}];}_0x5851d5=_[_0xb83d('0x3e')]({},_0x5851d5,_0x21c62f[_0xb83d('0x3f')]);return db[_0xb83d('0x2d')][_0xb83d('0x46')](_0x5851d5)[_0xb83d('0x29')](handleEntityNotFound(_0x52ee8a,null))[_0xb83d('0x29')](respondWithResult(_0x52ee8a,null))[_0xb83d('0x47')](handleError(_0x52ee8a,null));};exports[_0xb83d('0x48')]=function(_0x4df647,_0x343b43){return db[_0xb83d('0x2d')][_0xb83d('0x48')](_0x4df647[_0xb83d('0x49')],{})['then'](respondWithResult(_0x343b43,0xc9))[_0xb83d('0x47')](handleError(_0x343b43,null));};exports[_0xb83d('0x28')]=function(_0x257ec4,_0x252aed){if(_0x257ec4[_0xb83d('0x49')]['id']){delete _0x257ec4[_0xb83d('0x49')]['id'];}return db[_0xb83d('0x2d')][_0xb83d('0x46')]({'where':{'id':_0x257ec4[_0xb83d('0x4a')]['id']}})[_0xb83d('0x29')](handleEntityNotFound(_0x252aed,null))[_0xb83d('0x29')](saveUpdates(_0x257ec4['body'],null))[_0xb83d('0x29')](respondWithResult(_0x252aed,null))[_0xb83d('0x47')](handleError(_0x252aed,null));};exports[_0xb83d('0x4b')]=function(_0x3332bb,_0x1fae2c){return db[_0xb83d('0x2d')]['find']({'where':{'id':_0x3332bb[_0xb83d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1fae2c,null))['then'](removeEntity(_0x1fae2c,null))[_0xb83d('0x47')](handleError(_0x1fae2c,null));}; \ No newline at end of file +var _0xf881=['where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','VtigerField','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2ff293,_0x34fdef){var _0x5462bb=function(_0x2a321a){while(--_0x2a321a){_0x2ff293['push'](_0x2ff293['shift']());}};_0x5462bb(++_0x34fdef);}(_0xf881,0x9f));var _0x1f88=function(_0x36240e,_0x11c6bd){_0x36240e=_0x36240e-0x0;var _0x3d0d10=_0xf881[_0x36240e];return _0x3d0d10;};'use strict';var emlformat=require(_0x1f88('0x0'));var rimraf=require(_0x1f88('0x1'));var zipdir=require(_0x1f88('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f88('0x3'));var moment=require(_0x1f88('0x4'));var BPromise=require(_0x1f88('0x5'));var Mustache=require(_0x1f88('0x6'));var util=require('util');var path=require(_0x1f88('0x7'));var sox=require('sox');var csv=require(_0x1f88('0x8'));var ejs=require(_0x1f88('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f88('0xa'));var squel=require(_0x1f88('0xb'));var crypto=require(_0x1f88('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1f88('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1f88('0xe'));var Redis=require(_0x1f88('0xf'));var authService=require(_0x1f88('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f88('0x11'))(_0x1f88('0x12'));var utils=require(_0x1f88('0x13'));var config=require(_0x1f88('0x14'));var licenseUtil=require(_0x1f88('0x15'));var db=require(_0x1f88('0x16'))['db'];function respondWithStatusCode(_0xf8c3c6,_0x5df301){_0x5df301=_0x5df301||0xcc;return function(_0x52dd67){if(_0x52dd67){return _0xf8c3c6[_0x1f88('0x17')](_0x5df301);}return _0xf8c3c6[_0x1f88('0x18')](_0x5df301)[_0x1f88('0x19')]();};}function respondWithResult(_0xee0d80,_0x380dbc){_0x380dbc=_0x380dbc||0xc8;return function(_0x1299a2){if(_0x1299a2){return _0xee0d80[_0x1f88('0x18')](_0x380dbc)['json'](_0x1299a2);}};}function respondWithFilteredResult(_0x52da82,_0x3ac73a){return function(_0x1ef29e){if(_0x1ef29e){var _0x26c299=typeof _0x3ac73a[_0x1f88('0x1a')]===_0x1f88('0x1b')&&typeof _0x3ac73a[_0x1f88('0x1c')]==='undefined';var _0x754b66=_0x1ef29e['count'];var _0x362aad=_0x26c299?0x0:_0x3ac73a[_0x1f88('0x1a')];var _0x55df4f=_0x26c299?_0x1ef29e[_0x1f88('0x1d')]:_0x3ac73a[_0x1f88('0x1a')]+_0x3ac73a['limit'];var _0x4309bb;if(_0x55df4f>=_0x754b66){_0x55df4f=_0x754b66;_0x4309bb=0xc8;}else{_0x4309bb=0xce;}_0x52da82[_0x1f88('0x18')](_0x4309bb);return _0x52da82['set'](_0x1f88('0x1e'),_0x362aad+'-'+_0x55df4f+'/'+_0x754b66)['json'](_0x1ef29e);}return null;};}function patchUpdates(_0x44ca7d){return function(_0x55601f){try{jsonpatch[_0x1f88('0x1f')](_0x55601f,_0x44ca7d,!![]);}catch(_0x5b83){return BPromise[_0x1f88('0x20')](_0x5b83);}return _0x55601f[_0x1f88('0x21')]();};}function saveUpdates(_0x35d3f2,_0x58f840){return function(_0x2e01d8){if(_0x2e01d8){return _0x2e01d8['update'](_0x35d3f2)['then'](function(_0x57194a){return _0x57194a;});}return null;};}function removeEntity(_0x340cf4,_0x48f7e6){return function(_0x45d897){if(_0x45d897){return _0x45d897['destroy']()[_0x1f88('0x22')](function(){_0x340cf4[_0x1f88('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbb6f,_0x390dd7){return function(_0x3d3966){if(!_0x3d3966){_0x1fbb6f['sendStatus'](0x194);}return _0x3d3966;};}function handleError(_0x23218e,_0x480962){_0x480962=_0x480962||0x1f4;return function(_0x1ce44b){logger[_0x1f88('0x23')](_0x1ce44b[_0x1f88('0x24')]);if(_0x1ce44b['name']){delete _0x1ce44b[_0x1f88('0x25')];}_0x23218e[_0x1f88('0x18')](_0x480962)[_0x1f88('0x26')](_0x1ce44b);};}exports[_0x1f88('0x27')]=function(_0x2ff7ee,_0x5ed957){var _0x14c57f={},_0x510ace={},_0x538d9d={'count':0x0,'rows':[]};var _0x2cf279=_[_0x1f88('0x28')](db[_0x1f88('0x29')][_0x1f88('0x2a')],function(_0x540540){return{'name':_0x540540['fieldName'],'type':_0x540540['type'][_0x1f88('0x2b')]};});_0x510ace[_0x1f88('0x2c')]=_[_0x1f88('0x28')](_0x2cf279,'name');_0x510ace[_0x1f88('0x2d')]=_[_0x1f88('0x2e')](_0x2ff7ee[_0x1f88('0x2d')]);_0x510ace['filters']=_['intersection'](_0x510ace['model'],_0x510ace[_0x1f88('0x2d')]);_0x14c57f[_0x1f88('0x2f')]=_[_0x1f88('0x30')](_0x510ace[_0x1f88('0x2c')],qs[_0x1f88('0x31')](_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x31')]));_0x14c57f[_0x1f88('0x2f')]=_0x14c57f['attributes'][_0x1f88('0x32')]?_0x14c57f['attributes']:_0x510ace[_0x1f88('0x2c')];if(!_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x33')](_0x1f88('0x34'))){_0x14c57f[_0x1f88('0x1c')]=qs[_0x1f88('0x1c')](_0x2ff7ee['query']['limit']);_0x14c57f['offset']=qs[_0x1f88('0x1a')](_0x2ff7ee[_0x1f88('0x2d')]['offset']);}_0x14c57f['order']=qs[_0x1f88('0x35')](_0x2ff7ee[_0x1f88('0x2d')]['sort']);_0x14c57f[_0x1f88('0x36')]=qs[_0x1f88('0x37')](_[_0x1f88('0x38')](_0x2ff7ee[_0x1f88('0x2d')],_0x510ace[_0x1f88('0x37')]),_0x2cf279);if(_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x39')]){_0x14c57f['where']=_[_0x1f88('0x3a')](_0x14c57f['where'],{'$or':_[_0x1f88('0x28')](_0x2cf279,function(_0x2556e1){if(_0x2556e1[_0x1f88('0x3b')]!==_0x1f88('0x3c')){var _0x432b6d={};_0x432b6d[_0x2556e1[_0x1f88('0x25')]]={'$like':'%'+_0x2ff7ee['query'][_0x1f88('0x39')]+'%'};return _0x432b6d;}})});}_0x14c57f=_['merge']({},_0x14c57f,_0x2ff7ee[_0x1f88('0x3d')]);var _0x2f2a7b={'where':_0x14c57f[_0x1f88('0x36')]};return db[_0x1f88('0x29')][_0x1f88('0x1d')](_0x2f2a7b)[_0x1f88('0x22')](function(_0x421988){_0x538d9d[_0x1f88('0x1d')]=_0x421988;if(_0x2ff7ee[_0x1f88('0x2d')][_0x1f88('0x3e')]){_0x14c57f[_0x1f88('0x3f')]=[{'all':!![]}];}return db[_0x1f88('0x29')][_0x1f88('0x40')](_0x14c57f);})[_0x1f88('0x22')](function(_0x454b0c){_0x538d9d['rows']=_0x454b0c;return _0x538d9d;})['then'](respondWithFilteredResult(_0x5ed957,_0x14c57f))[_0x1f88('0x41')](handleError(_0x5ed957,null));};exports['show']=function(_0x5cecd8,_0x3a8ebf){var _0x1cbe42={'raw':!![],'where':{'id':_0x5cecd8['params']['id']}},_0x4c8584={};_0x4c8584[_0x1f88('0x2c')]=_['keys'](db[_0x1f88('0x29')][_0x1f88('0x2a')]);_0x4c8584['query']=_[_0x1f88('0x2e')](_0x5cecd8[_0x1f88('0x2d')]);_0x4c8584[_0x1f88('0x37')]=_[_0x1f88('0x30')](_0x4c8584[_0x1f88('0x2c')],_0x4c8584[_0x1f88('0x2d')]);_0x1cbe42['attributes']=_[_0x1f88('0x30')](_0x4c8584[_0x1f88('0x2c')],qs[_0x1f88('0x31')](_0x5cecd8[_0x1f88('0x2d')][_0x1f88('0x31')]));_0x1cbe42[_0x1f88('0x2f')]=_0x1cbe42[_0x1f88('0x2f')][_0x1f88('0x32')]?_0x1cbe42[_0x1f88('0x2f')]:_0x4c8584[_0x1f88('0x2c')];if(_0x5cecd8[_0x1f88('0x2d')]['includeAll']){_0x1cbe42[_0x1f88('0x3f')]=[{'all':!![]}];}_0x1cbe42=_[_0x1f88('0x3a')]({},_0x1cbe42,_0x5cecd8[_0x1f88('0x3d')]);return db[_0x1f88('0x29')][_0x1f88('0x42')](_0x1cbe42)['then'](handleEntityNotFound(_0x3a8ebf,null))['then'](respondWithResult(_0x3a8ebf,null))[_0x1f88('0x41')](handleError(_0x3a8ebf,null));};exports[_0x1f88('0x43')]=function(_0x41d55a,_0x39f9ad){return db[_0x1f88('0x29')]['create'](_0x41d55a[_0x1f88('0x44')],{})['then'](respondWithResult(_0x39f9ad,0xc9))['catch'](handleError(_0x39f9ad,null));};exports['update']=function(_0x38a0d6,_0xdefd5a){if(_0x38a0d6[_0x1f88('0x44')]['id']){delete _0x38a0d6['body']['id'];}return db[_0x1f88('0x29')][_0x1f88('0x42')]({'where':{'id':_0x38a0d6[_0x1f88('0x45')]['id']}})[_0x1f88('0x22')](handleEntityNotFound(_0xdefd5a,null))[_0x1f88('0x22')](saveUpdates(_0x38a0d6[_0x1f88('0x44')],null))[_0x1f88('0x22')](respondWithResult(_0xdefd5a,null))['catch'](handleError(_0xdefd5a,null));};exports[_0x1f88('0x46')]=function(_0x110101,_0x1fe42e){return db[_0x1f88('0x29')][_0x1f88('0x42')]({'where':{'id':_0x110101[_0x1f88('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fe42e,null))['then'](removeEntity(_0x1fe42e,null))[_0x1f88('0x41')](handleError(_0x1fe42e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 71c09ab..7e69ee2 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 _0x26bf=['./intVtigerField.attributes','define','VtigerField','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26bf,0x101));var _0xf26b=function(_0x1256e1,_0x18af18){_0x1256e1=_0x1256e1-0x0;var _0x1132b4=_0x26bf[_0x1256e1];return _0x1132b4;};'use strict';var _=require(_0xf26b('0x0'));var util=require(_0xf26b('0x1'));var logger=require(_0xf26b('0x2'))(_0xf26b('0x3'));var moment=require(_0xf26b('0x4'));var BPromise=require(_0xf26b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf26b('0x6'));var rimraf=require(_0xf26b('0x7'));var config=require(_0xf26b('0x8'));var attributes=require(_0xf26b('0x9'));module['exports']=function(_0x1a4868,_0x400253){return _0x1a4868[_0xf26b('0xa')](_0xf26b('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xf26b('0xc'),_0xf26b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f05=['vtiger_unique_index','FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0x1f05,0x1bc));var _0x51f0=function(_0xca15a6,_0x366acb){_0xca15a6=_0xca15a6-0x0;var _0x118b13=_0x1f05[_0xca15a6];return _0x118b13;};'use strict';var _=require(_0x51f0('0x0'));var util=require('util');var logger=require(_0x51f0('0x1'))(_0x51f0('0x2'));var moment=require('moment');var BPromise=require(_0x51f0('0x3'));var rp=require(_0x51f0('0x4'));var fs=require('fs');var path=require(_0x51f0('0x5'));var rimraf=require(_0x51f0('0x6'));var config=require(_0x51f0('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x1dc67b,_0x53c8f9){return _0x1dc67b[_0x51f0('0x8')](_0x51f0('0x9'),attributes,{'tableName':_0x51f0('0xa'),'paranoid':![],'indexes':[{'name':_0x51f0('0xb'),'fields':['idField',_0x51f0('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 2ded2f7..77ae626 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 _0xf958=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x484156,_0x6fe8a2){var _0x23b64a=function(_0x235811){while(--_0x235811){_0x484156['push'](_0x484156['shift']());}};_0x23b64a(++_0x6fe8a2);}(_0xf958,0x1cf));var _0x8f95=function(_0x354bb1,_0x439ec3){_0x354bb1=_0x354bb1-0x0;var _0x39cddd=_0xf958[_0x354bb1];return _0x39cddd;};'use strict';var _=require(_0x8f95('0x0'));var util=require(_0x8f95('0x1'));var moment=require(_0x8f95('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f95('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f95('0x4'))['db'];var utils=require(_0x8f95('0x5'));var logger=require('../../config/logger')(_0x8f95('0x6'));var config=require(_0x8f95('0x7'));var jayson=require(_0x8f95('0x8'));var client=jayson[_0x8f95('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a08f2,_0x5c9ab1,_0x10c77d){return new BPromise(function(_0x5b7861,_0x136254){return client[_0x8f95('0xa')](_0x2a08f2,_0x10c77d)['then'](function(_0x5209d3){logger[_0x8f95('0xb')](_0x8f95('0xc'),_0x5c9ab1,_0x8f95('0xd'));logger[_0x8f95('0xe')](_0x8f95('0xf'),_0x5c9ab1,_0x8f95('0xd'),JSON[_0x8f95('0x10')](_0x5209d3));if(_0x5209d3['error']){if(_0x5209d3[_0x8f95('0x11')]['code']===0x1f4){logger['error'](_0x8f95('0xc'),_0x5c9ab1,_0x5209d3[_0x8f95('0x11')][_0x8f95('0x12')]);return _0x136254(_0x5209d3[_0x8f95('0x11')][_0x8f95('0x12')]);}logger['error'](_0x8f95('0xc'),_0x5c9ab1,_0x5209d3[_0x8f95('0x11')][_0x8f95('0x12')]);return _0x5b7861(_0x5209d3[_0x8f95('0x11')][_0x8f95('0x12')]);}else{logger['info'](_0x8f95('0xc'),_0x5c9ab1,_0x8f95('0xd'));_0x5b7861(_0x5209d3[_0x8f95('0x13')]['message']);}})[_0x8f95('0x14')](function(_0x256da3){logger[_0x8f95('0x11')]('VtigerField,\x20%s,\x20%s',_0x5c9ab1,_0x256da3);_0x136254(_0x256da3);});});} \ No newline at end of file +var _0xbbc1=['info','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5b1844,_0x274b04){var _0x2ca355=function(_0x18d9ac){while(--_0x18d9ac){_0x5b1844['push'](_0x5b1844['shift']());}};_0x2ca355(++_0x274b04);}(_0xbbc1,0x8e));var _0x1bbc=function(_0x158b72,_0xc0c898){_0x158b72=_0x158b72-0x0;var _0x3c7fc8=_0xbbc1[_0x158b72];return _0x3c7fc8;};'use strict';var _=require(_0x1bbc('0x0'));var util=require(_0x1bbc('0x1'));var moment=require(_0x1bbc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bbc('0x3'));var db=require(_0x1bbc('0x4'))['db'];var utils=require(_0x1bbc('0x5'));var logger=require('../../config/logger')(_0x1bbc('0x6'));var config=require(_0x1bbc('0x7'));var jayson=require(_0x1bbc('0x8'));var client=jayson[_0x1bbc('0x9')][_0x1bbc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40824c,_0xfe90be,_0x17abfc){return new BPromise(function(_0x543939,_0x5b53a5){return client[_0x1bbc('0xb')](_0x40824c,_0x17abfc)['then'](function(_0x4cc44b){logger[_0x1bbc('0xc')]('VtigerField,\x20%s,\x20%s',_0xfe90be,'request\x20sent');logger['debug'](_0x1bbc('0xd'),_0xfe90be,_0x1bbc('0xe'),JSON[_0x1bbc('0xf')](_0x4cc44b));if(_0x4cc44b['error']){if(_0x4cc44b[_0x1bbc('0x10')][_0x1bbc('0x11')]===0x1f4){logger['error'](_0x1bbc('0x12'),_0xfe90be,_0x4cc44b['error']['message']);return _0x5b53a5(_0x4cc44b[_0x1bbc('0x10')]['message']);}logger[_0x1bbc('0x10')]('VtigerField,\x20%s,\x20%s',_0xfe90be,_0x4cc44b[_0x1bbc('0x10')][_0x1bbc('0x13')]);return _0x543939(_0x4cc44b[_0x1bbc('0x10')][_0x1bbc('0x13')]);}else{logger[_0x1bbc('0xc')](_0x1bbc('0x12'),_0xfe90be,_0x1bbc('0xe'));_0x543939(_0x4cc44b[_0x1bbc('0x14')][_0x1bbc('0x13')]);}})[_0x1bbc('0x15')](function(_0x2b690f){logger[_0x1bbc('0x10')]('VtigerField,\x20%s,\x20%s',_0xfe90be,_0x2b690f);_0x5b53a5(_0x2b690f);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 39fab66..44e2ea2 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 _0x8390=['post','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8390,0xf8));var _0x0839=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x8390[_0xb24a3e];return _0x4038d7;};'use strict';var multer=require(_0x0839('0x0'));var util=require(_0x0839('0x1'));var path=require('path');var timeout=require(_0x0839('0x2'));var express=require(_0x0839('0x3'));var router=express[_0x0839('0x4')]();var fs_extra=require(_0x0839('0x5'));var auth=require(_0x0839('0x6'));var interaction=require(_0x0839('0x7'));var config=require('../../config/environment');var controller=require(_0x0839('0x8'));router['get']('/',auth[_0x0839('0x9')](),controller['index']);router[_0x0839('0xa')]('/:id',auth[_0x0839('0x9')](),controller[_0x0839('0xb')]);router[_0x0839('0xa')](_0x0839('0xc'),auth['isAuthenticated'](),controller[_0x0839('0xd')]);router[_0x0839('0xa')](_0x0839('0xe'),auth[_0x0839('0x9')](),controller[_0x0839('0xf')]);router[_0x0839('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x0839('0xc'),auth['isAuthenticated'](),controller[_0x0839('0x11')]);router[_0x0839('0x12')](_0x0839('0x13'),auth['isAuthenticated'](),controller[_0x0839('0x14')]);router[_0x0839('0x15')](_0x0839('0x13'),auth[_0x0839('0x9')](),controller[_0x0839('0x16')]);module[_0x0839('0x17')]=router; \ No newline at end of file +var _0xf13b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','path','connect-timeout','express'];(function(_0xd1c87,_0x4eacc6){var _0x42b9b8=function(_0x298732){while(--_0x298732){_0xd1c87['push'](_0xd1c87['shift']());}};_0x42b9b8(++_0x4eacc6);}(_0xf13b,0xf9));var _0xbf13=function(_0xc611d9,_0x1447d4){_0xc611d9=_0xc611d9-0x0;var _0xc6649e=_0xf13b[_0xc611d9];return _0xc6649e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbf13('0x0'));var timeout=require(_0xbf13('0x1'));var express=require(_0xbf13('0x2'));var router=express['Router']();var fs_extra=require(_0xbf13('0x3'));var auth=require(_0xbf13('0x4'));var interaction=require(_0xbf13('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xbf13('0x6')]('/',auth[_0xbf13('0x7')](),controller['index']);router[_0xbf13('0x6')](_0xbf13('0x8'),auth[_0xbf13('0x7')](),controller[_0xbf13('0x9')]);router[_0xbf13('0x6')](_0xbf13('0xa'),auth[_0xbf13('0x7')](),controller[_0xbf13('0xb')]);router[_0xbf13('0x6')](_0xbf13('0xc'),auth[_0xbf13('0x7')](),controller[_0xbf13('0xd')]);router[_0xbf13('0xe')]('/',auth[_0xbf13('0x7')](),controller[_0xbf13('0xf')]);router[_0xbf13('0xe')](_0xbf13('0xa'),auth[_0xbf13('0x7')](),controller[_0xbf13('0x10')]);router[_0xbf13('0x11')](_0xbf13('0x8'),auth[_0xbf13('0x7')](),controller[_0xbf13('0x12')]);router[_0xbf13('0x13')](_0xbf13('0x8'),auth[_0xbf13('0x7')](),controller['destroy']);module[_0xbf13('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8c99e37..cef9999 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 _0x81c6=['remoteUri','ENUM','password','token','integrationTab','exports','username','STRING'];(function(_0x832a1f,_0x4be740){var _0x3e4b83=function(_0x3b90ff){while(--_0x3b90ff){_0x832a1f['push'](_0x832a1f['shift']());}};_0x3e4b83(++_0x4be740);}(_0x81c6,0x1d5));var _0x681c=function(_0x5caee2,_0x325a65){_0x5caee2=_0x5caee2-0x0;var _0x3f8747=_0x81c6[_0x5caee2];return _0x3f8747;};'use strict';var Sequelize=require('sequelize');module[_0x681c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x681c('0x1')},'password':{'type':Sequelize[_0x681c('0x2')]},'token':{'type':Sequelize[_0x681c('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x681c('0x3')},'authType':{'type':Sequelize[_0x681c('0x4')](_0x681c('0x5'),_0x681c('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x681c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x681c('0x4')]('integrationTab','newTab'),'defaultValue':_0x681c('0x7')}}; \ No newline at end of file +var _0xc1fc=['password','integrationTab','newTab','exports','STRING','username','remoteUri','ENUM'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc1fc,0x93));var _0xcc1f=function(_0x3fb3ad,_0x7e2e03){_0x3fb3ad=_0x3fb3ad-0x0;var _0x5464c1=_0xc1fc[_0x3fb3ad];return _0x5464c1;};'use strict';var Sequelize=require('sequelize');module[_0xcc1f('0x0')]={'name':{'type':Sequelize[_0xcc1f('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcc1f('0x1')],'unique':_0xcc1f('0x2')},'password':{'type':Sequelize[_0xcc1f('0x1')]},'token':{'type':Sequelize[_0xcc1f('0x1')]},'remoteUri':{'type':Sequelize[_0xcc1f('0x1')],'unique':_0xcc1f('0x3')},'authType':{'type':Sequelize[_0xcc1f('0x4')](_0xcc1f('0x5'),'token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xcc1f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcc1f('0x4')](_0xcc1f('0x6'),_0xcc1f('0x7')),'defaultValue':_0xcc1f('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 67816ab..0858c8d 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 _0xa571=['lastIndexOf','GET','format','%s/%s','ticket_fields','headers','%s:%s','password','toString','base64','Basic\x20%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','ZendeskAccount','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ZendeskConfiguration','order','merge','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ZendeskField','Descriptions','getFields','username','token','authType','remoteUri','slice','substring'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xa571,0x107));var _0x1a57=function(_0x36373f,_0x4d2435){_0x36373f=_0x36373f-0x0;var _0x429356=_0xa571[_0x36373f];return _0x429356;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];var integrations=require(_0x1a57('0x18'));function respondWithStatusCode(_0x202d9a,_0x5ae643){_0x5ae643=_0x5ae643||0xcc;return function(_0x3de36a){if(_0x3de36a){return _0x202d9a[_0x1a57('0x19')](_0x5ae643);}return _0x202d9a['status'](_0x5ae643)[_0x1a57('0x1a')]();};}function respondWithResult(_0x587422,_0xd08107){_0xd08107=_0xd08107||0xc8;return function(_0x17434c){if(_0x17434c){return _0x587422[_0x1a57('0x1b')](_0xd08107)[_0x1a57('0x1c')](_0x17434c);}};}function respondWithFilteredResult(_0x5802d6,_0x20f7ad){return function(_0x53c61f){if(_0x53c61f){var _0x49ee05=typeof _0x20f7ad[_0x1a57('0x1d')]===_0x1a57('0x1e')&&typeof _0x20f7ad[_0x1a57('0x1f')]==='undefined';var _0x10793e=_0x53c61f[_0x1a57('0x20')];var _0x80f8c1=_0x49ee05?0x0:_0x20f7ad['offset'];var _0x3daa66=_0x49ee05?_0x53c61f[_0x1a57('0x20')]:_0x20f7ad[_0x1a57('0x1d')]+_0x20f7ad[_0x1a57('0x1f')];var _0xe936dd;if(_0x3daa66>=_0x10793e){_0x3daa66=_0x10793e;_0xe936dd=0xc8;}else{_0xe936dd=0xce;}_0x5802d6['status'](_0xe936dd);return _0x5802d6['set'](_0x1a57('0x21'),_0x80f8c1+'-'+_0x3daa66+'/'+_0x10793e)[_0x1a57('0x1c')](_0x53c61f);}return null;};}function patchUpdates(_0x211c63){return function(_0x4d3e05){try{jsonpatch['apply'](_0x4d3e05,_0x211c63,!![]);}catch(_0x51e271){return BPromise[_0x1a57('0x22')](_0x51e271);}return _0x4d3e05[_0x1a57('0x23')]();};}function saveUpdates(_0x3f52b9,_0xee133b){return function(_0x277d06){if(_0x277d06){return _0x277d06[_0x1a57('0x24')](_0x3f52b9)[_0x1a57('0x25')](function(_0x2f8b00){return _0x2f8b00;});}return null;};}function removeEntity(_0x183ca3,_0x35d5dc){return function(_0x29e7cd){if(_0x29e7cd){return _0x29e7cd[_0x1a57('0x26')]()[_0x1a57('0x25')](function(){_0x183ca3[_0x1a57('0x1b')](0xcc)[_0x1a57('0x1a')]();});}};}function handleEntityNotFound(_0x182649,_0x25c1e9){return function(_0x267302){if(!_0x267302){_0x182649[_0x1a57('0x19')](0x194);}return _0x267302;};}function handleError(_0xf6ffef,_0x26584b){_0x26584b=_0x26584b||0x1f4;return function(_0x1dd939){logger['error'](_0x1dd939['stack']);if(_0x1dd939[_0x1a57('0x27')]){delete _0x1dd939[_0x1a57('0x27')];}_0xf6ffef['status'](_0x26584b)[_0x1a57('0x28')](_0x1dd939);};}exports['index']=function(_0x2d8738,_0x4a2901){var _0x53bf6e={},_0x8179a4={},_0x274fe6={'count':0x0,'rows':[]};var _0x30527c=_[_0x1a57('0x29')](db['ZendeskAccount'][_0x1a57('0x2a')],function(_0x396832){return{'name':_0x396832[_0x1a57('0x2b')],'type':_0x396832[_0x1a57('0x2c')]['key']};});_0x8179a4[_0x1a57('0x2d')]=_[_0x1a57('0x29')](_0x30527c,_0x1a57('0x27'));_0x8179a4[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x2d8738[_0x1a57('0x2e')]);_0x8179a4[_0x1a57('0x30')]=_[_0x1a57('0x31')](_0x8179a4[_0x1a57('0x2d')],_0x8179a4['query']);_0x53bf6e[_0x1a57('0x32')]=_[_0x1a57('0x31')](_0x8179a4['model'],qs['fields'](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x33')]));_0x53bf6e[_0x1a57('0x32')]=_0x53bf6e[_0x1a57('0x32')][_0x1a57('0x34')]?_0x53bf6e[_0x1a57('0x32')]:_0x8179a4[_0x1a57('0x2d')];if(!_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x35')](_0x1a57('0x36'))){_0x53bf6e[_0x1a57('0x1f')]=qs[_0x1a57('0x1f')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x1f')]);_0x53bf6e[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x1d')]);}_0x53bf6e['order']=qs[_0x1a57('0x37')](_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x37')]);_0x53bf6e[_0x1a57('0x38')]=qs[_0x1a57('0x30')](_[_0x1a57('0x39')](_0x2d8738[_0x1a57('0x2e')],_0x8179a4[_0x1a57('0x30')]),_0x30527c);if(_0x2d8738[_0x1a57('0x2e')]['filter']){_0x53bf6e['where']=_['merge'](_0x53bf6e['where'],{'$or':_[_0x1a57('0x29')](_0x30527c,function(_0x14d619){if(_0x14d619[_0x1a57('0x2c')]!=='VIRTUAL'){var _0x364797={};_0x364797[_0x14d619[_0x1a57('0x27')]]={'$like':'%'+_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x3a')]+'%'};return _0x364797;}})});}_0x53bf6e=_['merge']({},_0x53bf6e,_0x2d8738[_0x1a57('0x3b')]);var _0x5e79f0={'where':_0x53bf6e[_0x1a57('0x38')]};return db[_0x1a57('0x3c')][_0x1a57('0x20')](_0x5e79f0)['then'](function(_0x1848cc){_0x274fe6[_0x1a57('0x20')]=_0x1848cc;if(_0x2d8738[_0x1a57('0x2e')][_0x1a57('0x3d')]){_0x53bf6e[_0x1a57('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x1a57('0x3f')](_0x53bf6e);})['then'](function(_0x4ba6b3){_0x274fe6[_0x1a57('0x40')]=_0x4ba6b3;return _0x274fe6;})['then'](respondWithFilteredResult(_0x4a2901,_0x53bf6e))[_0x1a57('0x41')](handleError(_0x4a2901,null));};exports[_0x1a57('0x42')]=function(_0x3fbae1,_0x59abb1){var _0x188a50={'raw':![],'where':{'id':_0x3fbae1[_0x1a57('0x43')]['id']}},_0x3c7ea8={};_0x3c7ea8[_0x1a57('0x2d')]=_['keys'](db[_0x1a57('0x3c')][_0x1a57('0x2a')]);_0x3c7ea8['query']=_[_0x1a57('0x2f')](_0x3fbae1['query']);_0x3c7ea8['filters']=_[_0x1a57('0x31')](_0x3c7ea8[_0x1a57('0x2d')],_0x3c7ea8[_0x1a57('0x2e')]);_0x188a50[_0x1a57('0x32')]=_['intersection'](_0x3c7ea8[_0x1a57('0x2d')],qs[_0x1a57('0x33')](_0x3fbae1[_0x1a57('0x2e')][_0x1a57('0x33')]));_0x188a50[_0x1a57('0x32')]=_0x188a50['attributes'][_0x1a57('0x34')]?_0x188a50[_0x1a57('0x32')]:_0x3c7ea8[_0x1a57('0x2d')];if(_0x3fbae1[_0x1a57('0x2e')]['includeAll']){_0x188a50[_0x1a57('0x3e')]=[{'all':!![]}];}_0x188a50=_['merge']({},_0x188a50,_0x3fbae1[_0x1a57('0x3b')]);return db[_0x1a57('0x3c')][_0x1a57('0x44')](_0x188a50)[_0x1a57('0x25')](handleEntityNotFound(_0x59abb1,null))[_0x1a57('0x25')](respondWithResult(_0x59abb1,null))[_0x1a57('0x41')](handleError(_0x59abb1,null));};exports[_0x1a57('0x45')]=function(_0x401285,_0x29fe1f){return db[_0x1a57('0x3c')][_0x1a57('0x45')](_0x401285[_0x1a57('0x46')],{})[_0x1a57('0x25')](respondWithResult(_0x29fe1f,0xc9))['catch'](handleError(_0x29fe1f,null));};exports[_0x1a57('0x24')]=function(_0x480aff,_0x3bf103){if(_0x480aff[_0x1a57('0x46')]['id']){delete _0x480aff[_0x1a57('0x46')]['id'];}return db[_0x1a57('0x3c')][_0x1a57('0x44')]({'where':{'id':_0x480aff[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x3bf103,null))[_0x1a57('0x25')](saveUpdates(_0x480aff[_0x1a57('0x46')],null))['then'](respondWithResult(_0x3bf103,null))[_0x1a57('0x41')](handleError(_0x3bf103,null));};exports[_0x1a57('0x26')]=function(_0x51651d,_0x15f1f5){return db[_0x1a57('0x3c')]['find']({'where':{'id':_0x51651d[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x15f1f5,null))['then'](removeEntity(_0x15f1f5,null))['catch'](handleError(_0x15f1f5,null));};exports['getConfigurations']=function(_0x2c1bac,_0x41465b,_0x509c4f){var _0x1ec79c={};var _0x18267c={};var _0x572202;var _0x5e510e;return db['ZendeskAccount'][_0x1a57('0x47')]({'where':{'id':_0x2c1bac[_0x1a57('0x43')]['id']}})[_0x1a57('0x25')](handleEntityNotFound(_0x41465b,null))[_0x1a57('0x25')](function(_0x28738e){if(_0x28738e){_0x572202=_0x28738e;_0x18267c[_0x1a57('0x2d')]=_[_0x1a57('0x2f')](db[_0x1a57('0x48')]['rawAttributes']);_0x18267c['query']=_['keys'](_0x2c1bac['query']);_0x18267c['filters']=_[_0x1a57('0x31')](_0x18267c[_0x1a57('0x2d')],_0x18267c[_0x1a57('0x2e')]);_0x1ec79c[_0x1a57('0x32')]=_[_0x1a57('0x31')](_0x18267c[_0x1a57('0x2d')],qs[_0x1a57('0x33')](_0x2c1bac[_0x1a57('0x2e')]['fields']));_0x1ec79c['attributes']=_0x1ec79c['attributes'][_0x1a57('0x34')]?_0x1ec79c['attributes']:_0x18267c[_0x1a57('0x2d')];_0x1ec79c[_0x1a57('0x49')]=qs[_0x1a57('0x37')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x37')]);_0x1ec79c[_0x1a57('0x38')]=qs[_0x1a57('0x30')](_['pick'](_0x2c1bac['query'],_0x18267c['filters']));if(_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x3a')]){_0x1ec79c[_0x1a57('0x38')]=_[_0x1a57('0x4a')](_0x1ec79c[_0x1a57('0x38')],{'$or':_[_0x1a57('0x29')](_0x1ec79c[_0x1a57('0x32')],function(_0x4ab246){var _0x5b691c={};_0x5b691c[_0x4ab246]={'$like':'%'+_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x3a')]+'%'};return _0x5b691c;})});}_0x1ec79c=_[_0x1a57('0x4a')]({},_0x1ec79c,_0x2c1bac[_0x1a57('0x3b')]);return _0x572202[_0x1a57('0x4b')](_0x1ec79c);}})[_0x1a57('0x25')](function(_0x59a731){if(_0x59a731){_0x5e510e=_0x59a731['length'];if(!_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x35')]('nolimit')){_0x1ec79c['limit']=qs[_0x1a57('0x1f')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x1f')]);_0x1ec79c[_0x1a57('0x1d')]=qs[_0x1a57('0x1d')](_0x2c1bac[_0x1a57('0x2e')][_0x1a57('0x1d')]);}return _0x572202['getConfigurations'](_0x1ec79c);}})['then'](function(_0x2fbf49){if(_0x2fbf49){return _0x2fbf49?{'count':_0x5e510e,'rows':_0x2fbf49}:null;}})[_0x1a57('0x25')](respondWithResult(_0x41465b,null))[_0x1a57('0x41')](handleError(_0x41465b,null));};exports[_0x1a57('0x4c')]=function(_0x5d92dc,_0x33092d,_0x28354c){if(_0x5d92dc[_0x1a57('0x46')]['id']){delete _0x5d92dc[_0x1a57('0x46')]['id'];}return db[_0x1a57('0x3c')]['findOne']({'where':{'id':_0x5d92dc['params']['id']}})['then'](handleEntityNotFound(_0x33092d,null))[_0x1a57('0x25')](function(_0x223ba5){if(_0x223ba5){_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x4d')]=_0x223ba5['id'];_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x4e')]=integrations[_0x1a57('0x4f')](_0x5d92dc[_0x1a57('0x46')]['channel'],_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x2c')]);_0x5d92dc['body']['Descriptions']=integrations[_0x1a57('0x50')](_0x5d92dc['body'][_0x1a57('0x51')],_0x5d92dc[_0x1a57('0x46')][_0x1a57('0x2c')]);return db[_0x1a57('0x48')][_0x1a57('0x45')](_0x5d92dc[_0x1a57('0x46')],{'include':[{'model':db[_0x1a57('0x52')],'as':_0x1a57('0x4e')},{'model':db['ZendeskField'],'as':_0x1a57('0x53')}]});}return null;})[_0x1a57('0x25')](respondWithResult(_0x33092d,null))['catch'](handleError(_0x33092d,null));};exports[_0x1a57('0x54')]=function(_0x392f49,_0x20b0d5,_0x570674){var _0x5c3eb8='';return db[_0x1a57('0x3c')][_0x1a57('0x47')]({'where':{'id':_0x392f49[_0x1a57('0x43')]['id']},'attributes':['id',_0x1a57('0x55'),'password',_0x1a57('0x56'),_0x1a57('0x57'),_0x1a57('0x58')]})[_0x1a57('0x25')](handleEntityNotFound(_0x20b0d5,null))[_0x1a57('0x25')](function(_0x58d8cc){if(_0x58d8cc){_0x5c3eb8=_0x58d8cc[_0x1a57('0x58')];var _0x393187=_0x5c3eb8[_0x1a57('0x59')](-0x1);if(_0x393187==='/'){_0x5c3eb8=_0x5c3eb8[_0x1a57('0x5a')](0x0,_0x5c3eb8[_0x1a57('0x5b')](_0x393187));}var _0x69f3fb={'method':_0x1a57('0x5c'),'uri':util[_0x1a57('0x5d')](_0x1a57('0x5e'),_0x5c3eb8,_0x1a57('0x5f')),'json':!![]};switch(_0x58d8cc[_0x1a57('0x57')]){case'password':_0x69f3fb[_0x1a57('0x60')]={'Authorization':util[_0x1a57('0x5d')]('Basic\x20%s',new Buffer(util[_0x1a57('0x5d')](_0x1a57('0x61'),_0x58d8cc['username'],_0x58d8cc[_0x1a57('0x62')]))[_0x1a57('0x63')](_0x1a57('0x64')))};break;case _0x1a57('0x56'):_0x69f3fb[_0x1a57('0x60')]={'Authorization':util[_0x1a57('0x5d')](_0x1a57('0x65'),new Buffer(util[_0x1a57('0x5d')]('%s/token:%s',_0x58d8cc[_0x1a57('0x55')],_0x58d8cc[_0x1a57('0x56')]))['toString'](_0x1a57('0x64')))};break;default:throw new db[(_0x1a57('0x66'))][(_0x1a57('0x67'))](_0x1a57('0x68'));}return rp(_0x69f3fb);}})[_0x1a57('0x25')](function(_0xf2b1c5){if(_0xf2b1c5){var _0x220725=[_0x1a57('0x69'),_0x1a57('0x6a'),'group',_0x1a57('0x6b')];_[_0x1a57('0x6c')](_0xf2b1c5[_0x1a57('0x5f')],function(_0x1e4d4e){return _0x220725[_0x1a57('0x6d')](_0x1e4d4e['type']);});return{'count':_0xf2b1c5[_0x1a57('0x5f')][_0x1a57('0x34')],'rows':_[_0x1a57('0x29')](_0xf2b1c5[_0x1a57('0x5f')],function(_0x33f8da){return{'id':_0x33f8da['id'],'name':_0x33f8da[_0x1a57('0x6e')]>0x7?_0x33f8da[_0x1a57('0x6f')]:_0x33f8da[_0x1a57('0x2c')],'custom':_0x33f8da['position']>0x7?!![]:![],'options':_0x33f8da[_0x1a57('0x70')]?_0x33f8da[_0x1a57('0x70')]:_0x33f8da[_0x1a57('0x71')]?_0x33f8da[_0x1a57('0x71')]:[]};})};}})['then'](respondWithResult(_0x20b0d5,null))['catch'](function(_0x49f809){var _0x57cd92=_0x392f49['query'][_0x1a57('0x72')]?0x1f4:_0x49f809[_0x1a57('0x73')]||0x1f4;logger['error'](_0x1a57('0x74'),_0x1a57('0x54'),_0x57cd92,JSON['stringify'](_0x49f809));delete _0x49f809[_0x1a57('0x27')];if(_0x57cd92===0x191){_0x57cd92=0x190;}_0x20b0d5[_0x1a57('0x1b')](_0x57cd92)[_0x1a57('0x28')](_0x392f49[_0x1a57('0x2e')]['test']?{'message':_0x1a57('0x75'),'statusCode':_0x49f809[_0x1a57('0x73')]}:_0x49f809);});}; \ No newline at end of file +var _0x39cb=['count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ZendeskConfiguration','order','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','token','authType','remoteUri','slice','substring','format','%s/%s','headers','Basic\x20%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x46f7df,_0x224a06){var _0x26e96f=function(_0xcba5b5){while(--_0xcba5b5){_0x46f7df['push'](_0x46f7df['shift']());}};_0x26e96f(++_0x224a06);}(_0x39cb,0x1bd));var _0xb39c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x39cb[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb39c('0x0'));var zipdir=require(_0xb39c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb39c('0x2'));var moment=require(_0xb39c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb39c('0x4'));var util=require(_0xb39c('0x5'));var path=require(_0xb39c('0x6'));var sox=require(_0xb39c('0x7'));var csv=require(_0xb39c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb39c('0x9'));var _=require(_0xb39c('0xa'));var squel=require(_0xb39c('0xb'));var crypto=require(_0xb39c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb39c('0x8'));var querystring=require(_0xb39c('0xd'));var Papa=require(_0xb39c('0xe'));var Redis=require(_0xb39c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb39c('0x10'));var logger=require(_0xb39c('0x11'))(_0xb39c('0x12'));var utils=require(_0xb39c('0x13'));var config=require(_0xb39c('0x14'));var licenseUtil=require(_0xb39c('0x15'));var db=require(_0xb39c('0x16'))['db'];var integrations=require(_0xb39c('0x17'));function respondWithStatusCode(_0x51ff24,_0x31e07e){_0x31e07e=_0x31e07e||0xcc;return function(_0x468995){if(_0x468995){return _0x51ff24[_0xb39c('0x18')](_0x31e07e);}return _0x51ff24['status'](_0x31e07e)[_0xb39c('0x19')]();};}function respondWithResult(_0x40a6d3,_0x42a203){_0x42a203=_0x42a203||0xc8;return function(_0x386c80){if(_0x386c80){return _0x40a6d3[_0xb39c('0x1a')](_0x42a203)[_0xb39c('0x1b')](_0x386c80);}};}function respondWithFilteredResult(_0x8e9181,_0x5277ce){return function(_0x316c9b){if(_0x316c9b){var _0x3223f6=typeof _0x5277ce[_0xb39c('0x1c')]===_0xb39c('0x1d')&&typeof _0x5277ce[_0xb39c('0x1e')]===_0xb39c('0x1d');var _0x1a2f48=_0x316c9b[_0xb39c('0x1f')];var _0x35dade=_0x3223f6?0x0:_0x5277ce[_0xb39c('0x1c')];var _0x559ad6=_0x3223f6?_0x316c9b[_0xb39c('0x1f')]:_0x5277ce[_0xb39c('0x1c')]+_0x5277ce[_0xb39c('0x1e')];var _0x447352;if(_0x559ad6>=_0x1a2f48){_0x559ad6=_0x1a2f48;_0x447352=0xc8;}else{_0x447352=0xce;}_0x8e9181['status'](_0x447352);return _0x8e9181[_0xb39c('0x20')](_0xb39c('0x21'),_0x35dade+'-'+_0x559ad6+'/'+_0x1a2f48)['json'](_0x316c9b);}return null;};}function patchUpdates(_0x2d8e93){return function(_0x363e52){try{jsonpatch[_0xb39c('0x22')](_0x363e52,_0x2d8e93,!![]);}catch(_0x4ebfca){return BPromise['reject'](_0x4ebfca);}return _0x363e52[_0xb39c('0x23')]();};}function saveUpdates(_0x1a5b9d,_0x3c8dfd){return function(_0x5719e2){if(_0x5719e2){return _0x5719e2[_0xb39c('0x24')](_0x1a5b9d)[_0xb39c('0x25')](function(_0x1bb895){return _0x1bb895;});}return null;};}function removeEntity(_0x16f3b0,_0x3b03ed){return function(_0x4a32f6){if(_0x4a32f6){return _0x4a32f6[_0xb39c('0x26')]()[_0xb39c('0x25')](function(){_0x16f3b0['status'](0xcc)[_0xb39c('0x19')]();});}};}function handleEntityNotFound(_0x4492a4,_0x39116b){return function(_0x12be70){if(!_0x12be70){_0x4492a4[_0xb39c('0x18')](0x194);}return _0x12be70;};}function handleError(_0x5453a6,_0x23a2f1){_0x23a2f1=_0x23a2f1||0x1f4;return function(_0x299c27){logger[_0xb39c('0x27')](_0x299c27['stack']);if(_0x299c27[_0xb39c('0x28')]){delete _0x299c27[_0xb39c('0x28')];}_0x5453a6['status'](_0x23a2f1)[_0xb39c('0x29')](_0x299c27);};}exports[_0xb39c('0x2a')]=function(_0x328db1,_0x4e9672){var _0x714d20={},_0x45fed4={},_0x59172f={'count':0x0,'rows':[]};var _0x2bc742=_['map'](db[_0xb39c('0x2b')][_0xb39c('0x2c')],function(_0x309697){return{'name':_0x309697[_0xb39c('0x2d')],'type':_0x309697[_0xb39c('0x2e')]['key']};});_0x45fed4[_0xb39c('0x2f')]=_['map'](_0x2bc742,_0xb39c('0x28'));_0x45fed4['query']=_[_0xb39c('0x30')](_0x328db1[_0xb39c('0x31')]);_0x45fed4[_0xb39c('0x32')]=_[_0xb39c('0x33')](_0x45fed4['model'],_0x45fed4['query']);_0x714d20[_0xb39c('0x34')]=_[_0xb39c('0x33')](_0x45fed4['model'],qs[_0xb39c('0x35')](_0x328db1[_0xb39c('0x31')][_0xb39c('0x35')]));_0x714d20[_0xb39c('0x34')]=_0x714d20[_0xb39c('0x34')][_0xb39c('0x36')]?_0x714d20[_0xb39c('0x34')]:_0x45fed4[_0xb39c('0x2f')];if(!_0x328db1[_0xb39c('0x31')][_0xb39c('0x37')](_0xb39c('0x38'))){_0x714d20[_0xb39c('0x1e')]=qs[_0xb39c('0x1e')](_0x328db1[_0xb39c('0x31')][_0xb39c('0x1e')]);_0x714d20[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x328db1[_0xb39c('0x31')][_0xb39c('0x1c')]);}_0x714d20['order']=qs[_0xb39c('0x39')](_0x328db1[_0xb39c('0x31')]['sort']);_0x714d20['where']=qs['filters'](_[_0xb39c('0x3a')](_0x328db1[_0xb39c('0x31')],_0x45fed4[_0xb39c('0x32')]),_0x2bc742);if(_0x328db1['query'][_0xb39c('0x3b')]){_0x714d20[_0xb39c('0x3c')]=_[_0xb39c('0x3d')](_0x714d20[_0xb39c('0x3c')],{'$or':_[_0xb39c('0x3e')](_0x2bc742,function(_0x4b51ac){if(_0x4b51ac[_0xb39c('0x2e')]!==_0xb39c('0x3f')){var _0x51b489={};_0x51b489[_0x4b51ac[_0xb39c('0x28')]]={'$like':'%'+_0x328db1['query'][_0xb39c('0x3b')]+'%'};return _0x51b489;}})});}_0x714d20=_[_0xb39c('0x3d')]({},_0x714d20,_0x328db1[_0xb39c('0x40')]);var _0x4c043a={'where':_0x714d20[_0xb39c('0x3c')]};return db[_0xb39c('0x2b')][_0xb39c('0x1f')](_0x4c043a)[_0xb39c('0x25')](function(_0x10b87b){_0x59172f[_0xb39c('0x1f')]=_0x10b87b;if(_0x328db1[_0xb39c('0x31')][_0xb39c('0x41')]){_0x714d20[_0xb39c('0x42')]=[{'all':!![]}];}return db[_0xb39c('0x2b')][_0xb39c('0x43')](_0x714d20);})[_0xb39c('0x25')](function(_0x53347e){_0x59172f[_0xb39c('0x44')]=_0x53347e;return _0x59172f;})[_0xb39c('0x25')](respondWithFilteredResult(_0x4e9672,_0x714d20))[_0xb39c('0x45')](handleError(_0x4e9672,null));};exports[_0xb39c('0x46')]=function(_0x3d301e,_0x390cd7){var _0x1db549={'raw':![],'where':{'id':_0x3d301e[_0xb39c('0x47')]['id']}},_0x8cb33a={};_0x8cb33a['model']=_['keys'](db[_0xb39c('0x2b')][_0xb39c('0x2c')]);_0x8cb33a['query']=_['keys'](_0x3d301e[_0xb39c('0x31')]);_0x8cb33a['filters']=_[_0xb39c('0x33')](_0x8cb33a[_0xb39c('0x2f')],_0x8cb33a[_0xb39c('0x31')]);_0x1db549[_0xb39c('0x34')]=_[_0xb39c('0x33')](_0x8cb33a['model'],qs[_0xb39c('0x35')](_0x3d301e[_0xb39c('0x31')]['fields']));_0x1db549['attributes']=_0x1db549[_0xb39c('0x34')]['length']?_0x1db549['attributes']:_0x8cb33a[_0xb39c('0x2f')];if(_0x3d301e[_0xb39c('0x31')][_0xb39c('0x41')]){_0x1db549[_0xb39c('0x42')]=[{'all':!![]}];}_0x1db549=_[_0xb39c('0x3d')]({},_0x1db549,_0x3d301e[_0xb39c('0x40')]);return db[_0xb39c('0x2b')][_0xb39c('0x48')](_0x1db549)[_0xb39c('0x25')](handleEntityNotFound(_0x390cd7,null))[_0xb39c('0x25')](respondWithResult(_0x390cd7,null))['catch'](handleError(_0x390cd7,null));};exports[_0xb39c('0x49')]=function(_0x7e9750,_0xe329bf){return db[_0xb39c('0x2b')][_0xb39c('0x49')](_0x7e9750[_0xb39c('0x4a')],{})[_0xb39c('0x25')](respondWithResult(_0xe329bf,0xc9))[_0xb39c('0x45')](handleError(_0xe329bf,null));};exports[_0xb39c('0x24')]=function(_0x1ae2cb,_0x2150aa){if(_0x1ae2cb[_0xb39c('0x4a')]['id']){delete _0x1ae2cb[_0xb39c('0x4a')]['id'];}return db[_0xb39c('0x2b')][_0xb39c('0x48')]({'where':{'id':_0x1ae2cb[_0xb39c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2150aa,null))[_0xb39c('0x25')](saveUpdates(_0x1ae2cb[_0xb39c('0x4a')],null))[_0xb39c('0x25')](respondWithResult(_0x2150aa,null))[_0xb39c('0x45')](handleError(_0x2150aa,null));};exports[_0xb39c('0x26')]=function(_0x18db8f,_0xd4f368){return db[_0xb39c('0x2b')]['find']({'where':{'id':_0x18db8f['params']['id']}})[_0xb39c('0x25')](handleEntityNotFound(_0xd4f368,null))[_0xb39c('0x25')](removeEntity(_0xd4f368,null))['catch'](handleError(_0xd4f368,null));};exports['getConfigurations']=function(_0x226f60,_0x1d1abf,_0x538258){var _0x2a55db={};var _0x55b6b1={};var _0x5e367e;var _0x2d88dd;return db['ZendeskAccount'][_0xb39c('0x4b')]({'where':{'id':_0x226f60[_0xb39c('0x47')]['id']}})[_0xb39c('0x25')](handleEntityNotFound(_0x1d1abf,null))[_0xb39c('0x25')](function(_0x2f2944){if(_0x2f2944){_0x5e367e=_0x2f2944;_0x55b6b1[_0xb39c('0x2f')]=_['keys'](db[_0xb39c('0x4c')][_0xb39c('0x2c')]);_0x55b6b1[_0xb39c('0x31')]=_[_0xb39c('0x30')](_0x226f60[_0xb39c('0x31')]);_0x55b6b1['filters']=_[_0xb39c('0x33')](_0x55b6b1['model'],_0x55b6b1[_0xb39c('0x31')]);_0x2a55db[_0xb39c('0x34')]=_[_0xb39c('0x33')](_0x55b6b1[_0xb39c('0x2f')],qs[_0xb39c('0x35')](_0x226f60[_0xb39c('0x31')][_0xb39c('0x35')]));_0x2a55db[_0xb39c('0x34')]=_0x2a55db[_0xb39c('0x34')][_0xb39c('0x36')]?_0x2a55db[_0xb39c('0x34')]:_0x55b6b1[_0xb39c('0x2f')];_0x2a55db[_0xb39c('0x4d')]=qs[_0xb39c('0x39')](_0x226f60[_0xb39c('0x31')][_0xb39c('0x39')]);_0x2a55db[_0xb39c('0x3c')]=qs[_0xb39c('0x32')](_[_0xb39c('0x3a')](_0x226f60['query'],_0x55b6b1['filters']));if(_0x226f60[_0xb39c('0x31')][_0xb39c('0x3b')]){_0x2a55db['where']=_[_0xb39c('0x3d')](_0x2a55db[_0xb39c('0x3c')],{'$or':_['map'](_0x2a55db[_0xb39c('0x34')],function(_0x121545){var _0x129d1f={};_0x129d1f[_0x121545]={'$like':'%'+_0x226f60[_0xb39c('0x31')][_0xb39c('0x3b')]+'%'};return _0x129d1f;})});}_0x2a55db=_[_0xb39c('0x3d')]({},_0x2a55db,_0x226f60['options']);return _0x5e367e[_0xb39c('0x4e')](_0x2a55db);}})[_0xb39c('0x25')](function(_0x1c16c5){if(_0x1c16c5){_0x2d88dd=_0x1c16c5[_0xb39c('0x36')];if(!_0x226f60[_0xb39c('0x31')][_0xb39c('0x37')](_0xb39c('0x38'))){_0x2a55db['limit']=qs[_0xb39c('0x1e')](_0x226f60[_0xb39c('0x31')][_0xb39c('0x1e')]);_0x2a55db[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x226f60['query']['offset']);}return _0x5e367e[_0xb39c('0x4e')](_0x2a55db);}})[_0xb39c('0x25')](function(_0x26b55f){if(_0x26b55f){return _0x26b55f?{'count':_0x2d88dd,'rows':_0x26b55f}:null;}})['then'](respondWithResult(_0x1d1abf,null))[_0xb39c('0x45')](handleError(_0x1d1abf,null));};exports['addConfiguration']=function(_0x2f3c24,_0x5ce5fb,_0x1abe57){if(_0x2f3c24[_0xb39c('0x4a')]['id']){delete _0x2f3c24[_0xb39c('0x4a')]['id'];}return db['ZendeskAccount'][_0xb39c('0x4b')]({'where':{'id':_0x2f3c24[_0xb39c('0x47')]['id']}})[_0xb39c('0x25')](handleEntityNotFound(_0x5ce5fb,null))[_0xb39c('0x25')](function(_0x3e8783){if(_0x3e8783){_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x4f')]=_0x3e8783['id'];_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x50')]=integrations[_0xb39c('0x51')](_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x52')],_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x2e')]);_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x53')]=integrations[_0xb39c('0x54')](_0x2f3c24['body'][_0xb39c('0x52')],_0x2f3c24[_0xb39c('0x4a')][_0xb39c('0x2e')]);return db['ZendeskConfiguration'][_0xb39c('0x49')](_0x2f3c24['body'],{'include':[{'model':db['ZendeskField'],'as':_0xb39c('0x50')},{'model':db[_0xb39c('0x55')],'as':_0xb39c('0x53')}]});}return null;})[_0xb39c('0x25')](respondWithResult(_0x5ce5fb,null))[_0xb39c('0x45')](handleError(_0x5ce5fb,null));};exports['getFields']=function(_0x5de073,_0x26d08c,_0x27723c){var _0x5cfd2a='';return db[_0xb39c('0x2b')][_0xb39c('0x4b')]({'where':{'id':_0x5de073[_0xb39c('0x47')]['id']},'attributes':['id',_0xb39c('0x56'),_0xb39c('0x57'),_0xb39c('0x58'),_0xb39c('0x59'),_0xb39c('0x5a')]})[_0xb39c('0x25')](handleEntityNotFound(_0x26d08c,null))[_0xb39c('0x25')](function(_0xb5e7fb){if(_0xb5e7fb){_0x5cfd2a=_0xb5e7fb[_0xb39c('0x5a')];var _0x29b793=_0x5cfd2a[_0xb39c('0x5b')](-0x1);if(_0x29b793==='/'){_0x5cfd2a=_0x5cfd2a[_0xb39c('0x5c')](0x0,_0x5cfd2a['lastIndexOf'](_0x29b793));}var _0x2bba77={'method':'GET','uri':util[_0xb39c('0x5d')](_0xb39c('0x5e'),_0x5cfd2a,'ticket_fields'),'json':!![]};switch(_0xb5e7fb[_0xb39c('0x59')]){case _0xb39c('0x57'):_0x2bba77[_0xb39c('0x5f')]={'Authorization':util[_0xb39c('0x5d')](_0xb39c('0x60'),new Buffer(util[_0xb39c('0x5d')]('%s:%s',_0xb5e7fb[_0xb39c('0x56')],_0xb5e7fb[_0xb39c('0x57')]))[_0xb39c('0x61')](_0xb39c('0x62')))};break;case _0xb39c('0x58'):_0x2bba77[_0xb39c('0x5f')]={'Authorization':util[_0xb39c('0x5d')](_0xb39c('0x60'),new Buffer(util[_0xb39c('0x5d')]('%s/token:%s',_0xb5e7fb[_0xb39c('0x56')],_0xb5e7fb[_0xb39c('0x58')]))[_0xb39c('0x61')](_0xb39c('0x62')))};break;default:throw new db[(_0xb39c('0x63'))][(_0xb39c('0x64'))](_0xb39c('0x65'));}return rp(_0x2bba77);}})['then'](function(_0x29b32c){if(_0x29b32c){var _0xe23f8=[_0xb39c('0x66'),_0xb39c('0x67'),_0xb39c('0x68'),_0xb39c('0x69')];_[_0xb39c('0x6a')](_0x29b32c[_0xb39c('0x6b')],function(_0x483be1){return _0xe23f8[_0xb39c('0x6c')](_0x483be1['type']);});return{'count':_0x29b32c[_0xb39c('0x6b')][_0xb39c('0x36')],'rows':_[_0xb39c('0x3e')](_0x29b32c[_0xb39c('0x6b')],function(_0x37f395){return{'id':_0x37f395['id'],'name':_0x37f395[_0xb39c('0x6d')]>0x7?_0x37f395[_0xb39c('0x6e')]:_0x37f395[_0xb39c('0x2e')],'custom':_0x37f395['position']>0x7?!![]:![],'options':_0x37f395[_0xb39c('0x6f')]?_0x37f395[_0xb39c('0x6f')]:_0x37f395[_0xb39c('0x70')]?_0x37f395[_0xb39c('0x70')]:[]};})};}})[_0xb39c('0x25')](respondWithResult(_0x26d08c,null))[_0xb39c('0x45')](function(_0x26f2a0){var _0x46dcef=_0x5de073[_0xb39c('0x31')][_0xb39c('0x71')]?0x1f4:_0x26f2a0[_0xb39c('0x72')]||0x1f4;logger[_0xb39c('0x27')](_0xb39c('0x73'),_0xb39c('0x74'),_0x46dcef,JSON[_0xb39c('0x75')](_0x26f2a0));delete _0x26f2a0[_0xb39c('0x28')];if(_0x46dcef===0x191){_0x46dcef=0x190;}_0x26d08c['status'](_0x46dcef)['send'](_0x5de073[_0xb39c('0x31')][_0xb39c('0x71')]?{'message':_0xb39c('0x76'),'statusCode':_0x26f2a0['statusCode']}:_0x26f2a0);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index d501f98..26c2e2c 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 _0x66c9=['api','moment','bluebird','request-promise','../../components/integrations/configuration','exports','ZendeskAccount','lodash','util','../../config/logger'];(function(_0x138cec,_0x3cf8c9){var _0x1515f0=function(_0x3dbab0){while(--_0x3dbab0){_0x138cec['push'](_0x138cec['shift']());}};_0x1515f0(++_0x3cf8c9);}(_0x66c9,0x1dd));var _0x966c=function(_0x376ac1,_0x510e23){_0x376ac1=_0x376ac1-0x0;var _0x14cb27=_0x66c9[_0x376ac1];return _0x14cb27;};'use strict';var _=require(_0x966c('0x0'));var util=require(_0x966c('0x1'));var logger=require(_0x966c('0x2'))(_0x966c('0x3'));var moment=require(_0x966c('0x4'));var BPromise=require(_0x966c('0x5'));var rp=require(_0x966c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x966c('0x7'));module[_0x966c('0x8')]=function(_0x1090b0,_0x588722){return _0x1090b0['define'](_0x966c('0x9'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0316=['api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0316,0x115));var _0x6031=function(_0x29efce,_0xb0d231){_0x29efce=_0x29efce-0x0;var _0x2e4617=_0x0316[_0x29efce];return _0x2e4617;};'use strict';var _=require(_0x6031('0x0'));var util=require(_0x6031('0x1'));var logger=require(_0x6031('0x2'))(_0x6031('0x3'));var moment=require(_0x6031('0x4'));var BPromise=require('bluebird');var rp=require(_0x6031('0x5'));var fs=require('fs');var path=require(_0x6031('0x6'));var rimraf=require(_0x6031('0x7'));var config=require(_0x6031('0x8'));var attributes=require(_0x6031('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x6031('0xa')]=function(_0x15bc1d,_0x312586){return _0x15bc1d[_0x6031('0xb')](_0x6031('0xc'),attributes,{'tableName':_0x6031('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 707c27d..acd1b21 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 _0xbd08=['findAll','options','raw','where','attributes','map','include','model','GetZendeskAccount','ShowZendeskAccount','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','catch','ZendeskAccount'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xbd08,0x6e));var _0x8bd0=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xbd08[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x8bd0('0x0'));var util=require('util');var moment=require(_0x8bd0('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bd0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bd0('0x3'))['db'];var utils=require(_0x8bd0('0x4'));var logger=require(_0x8bd0('0x5'))('rpc');var config=require(_0x8bd0('0x6'));var jayson=require(_0x8bd0('0x7'));var client=jayson['client'][_0x8bd0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4660f8,_0x248781,_0x32cf5a){return new BPromise(function(_0x202c95,_0x31baa3){return client[_0x8bd0('0x9')](_0x4660f8,_0x32cf5a)[_0x8bd0('0xa')](function(_0xf1838b){logger[_0x8bd0('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x248781,_0x8bd0('0xc'));logger[_0x8bd0('0xd')](_0x8bd0('0xe'),_0x248781,'request\x20sent',JSON[_0x8bd0('0xf')](_0xf1838b));if(_0xf1838b[_0x8bd0('0x10')]){if(_0xf1838b[_0x8bd0('0x10')][_0x8bd0('0x11')]===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x248781,_0xf1838b[_0x8bd0('0x10')][_0x8bd0('0x12')]);return _0x31baa3(_0xf1838b[_0x8bd0('0x10')]['message']);}logger[_0x8bd0('0x10')](_0x8bd0('0x13'),_0x248781,_0xf1838b[_0x8bd0('0x10')]['message']);return _0x202c95(_0xf1838b[_0x8bd0('0x10')][_0x8bd0('0x12')]);}else{logger[_0x8bd0('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x248781,_0x8bd0('0xc'));_0x202c95(_0xf1838b['result']['message']);}})[_0x8bd0('0x14')](function(_0x44ff58){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x248781,_0x44ff58);_0x31baa3(_0x44ff58);});});}exports['GetZendeskAccount']=function(_0x241283){var _0x4b2cbc=this;return new Promise(function(_0x349e66,_0x3031fa){return db[_0x8bd0('0x15')][_0x8bd0('0x16')]({'raw':_0x241283[_0x8bd0('0x17')]?_0x241283[_0x8bd0('0x17')][_0x8bd0('0x18')]===undefined?!![]:![]:!![],'where':_0x241283['options']?_0x241283['options'][_0x8bd0('0x19')]||null:null,'attributes':_0x241283[_0x8bd0('0x17')]?_0x241283['options'][_0x8bd0('0x1a')]||null:null,'limit':_0x241283['options']?_0x241283[_0x8bd0('0x17')]['limit']||null:null,'include':_0x241283['options']?_0x241283[_0x8bd0('0x17')]['include']?_[_0x8bd0('0x1b')](_0x241283[_0x8bd0('0x17')][_0x8bd0('0x1c')],function(_0x28644a){return{'model':db[_0x28644a[_0x8bd0('0x1d')]],'as':_0x28644a['as'],'attributes':_0x28644a[_0x8bd0('0x1a')],'include':_0x28644a[_0x8bd0('0x1c')]?_[_0x8bd0('0x1b')](_0x28644a[_0x8bd0('0x1c')],function(_0x358e20){return{'model':db[_0x358e20[_0x8bd0('0x1d')]],'as':_0x358e20['as'],'attributes':_0x358e20[_0x8bd0('0x1a')],'include':_0x358e20[_0x8bd0('0x1c')]?_[_0x8bd0('0x1b')](_0x358e20[_0x8bd0('0x1c')],function(_0x5ca626){return{'model':db[_0x5ca626['model']],'as':_0x5ca626['as'],'attributes':_0x5ca626[_0x8bd0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8bd0('0xa')](function(_0x6d107c){logger['info'](_0x8bd0('0x1e'),_0x241283);logger[_0x8bd0('0xd')](_0x8bd0('0x1e'),_0x241283,JSON[_0x8bd0('0xf')](_0x6d107c));_0x349e66(_0x6d107c);})[_0x8bd0('0x14')](function(_0xd4b3f8){logger[_0x8bd0('0x10')](_0x8bd0('0x1e'),_0xd4b3f8['message'],_0x241283);_0x3031fa(_0x4b2cbc[_0x8bd0('0x10')](0x1f4,_0xd4b3f8[_0x8bd0('0x12')]));});});};exports[_0x8bd0('0x1f')]=function(_0x586b55){var _0x44feb5=this;return new Promise(function(_0x3ff3dd,_0x2ff0ad){return db['ZendeskAccount'][_0x8bd0('0x20')]({'raw':_0x586b55[_0x8bd0('0x17')]?_0x586b55['options'][_0x8bd0('0x18')]===undefined?!![]:![]:!![],'where':_0x586b55['options']?_0x586b55[_0x8bd0('0x17')]['where']||null:null,'attributes':_0x586b55[_0x8bd0('0x17')]?_0x586b55['options'][_0x8bd0('0x1a')]||null:null,'include':_0x586b55[_0x8bd0('0x17')]?_0x586b55[_0x8bd0('0x17')][_0x8bd0('0x1c')]?_[_0x8bd0('0x1b')](_0x586b55[_0x8bd0('0x17')][_0x8bd0('0x1c')],function(_0x3a2eac){return{'model':db[_0x3a2eac[_0x8bd0('0x1d')]],'as':_0x3a2eac['as'],'attributes':_0x3a2eac[_0x8bd0('0x1a')],'include':_0x3a2eac[_0x8bd0('0x1c')]?_['map'](_0x3a2eac['include'],function(_0x243eb6){return{'model':db[_0x243eb6[_0x8bd0('0x1d')]],'as':_0x243eb6['as'],'attributes':_0x243eb6['attributes'],'include':_0x243eb6[_0x8bd0('0x1c')]?_['map'](_0x243eb6['include'],function(_0x1af8e1){return{'model':db[_0x1af8e1[_0x8bd0('0x1d')]],'as':_0x1af8e1['as'],'attributes':_0x1af8e1[_0x8bd0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a73a5){logger['info'](_0x8bd0('0x1f'),_0x586b55);logger[_0x8bd0('0xd')](_0x8bd0('0x1f'),_0x586b55,JSON[_0x8bd0('0xf')](_0x4a73a5));_0x3ff3dd(_0x4a73a5);})[_0x8bd0('0x14')](function(_0x1d4a49){logger[_0x8bd0('0x10')](_0x8bd0('0x1f'),_0x1d4a49['message'],_0x586b55);_0x2ff0ad(_0x44feb5[_0x8bd0('0x10')](0x1f4,_0x1d4a49[_0x8bd0('0x12')]));});});}; \ No newline at end of file +var _0x246b=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','include','map','model','find','ShowZendeskAccount'];(function(_0x22befc,_0x408fb8){var _0x14f120=function(_0x3b281c){while(--_0x3b281c){_0x22befc['push'](_0x22befc['shift']());}};_0x14f120(++_0x408fb8);}(_0x246b,0x176));var _0xb246=function(_0x56139e,_0x44fe83){_0x56139e=_0x56139e-0x0;var _0x51fc8a=_0x246b[_0x56139e];return _0x51fc8a;};'use strict';var _=require(_0xb246('0x0'));var util=require(_0xb246('0x1'));var moment=require(_0xb246('0x2'));var BPromise=require(_0xb246('0x3'));var rs=require(_0xb246('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb246('0x5'))['db'];var utils=require(_0xb246('0x6'));var logger=require(_0xb246('0x7'))(_0xb246('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb246('0x9')][_0xb246('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x275da7,_0x4dbd51,_0x4be6a4){return new BPromise(function(_0x54c53c,_0x11a8f3){return client['request'](_0x275da7,_0x4be6a4)[_0xb246('0xb')](function(_0x3c37df){logger['info'](_0xb246('0xc'),_0x4dbd51,'request\x20sent');logger[_0xb246('0xd')](_0xb246('0xe'),_0x4dbd51,_0xb246('0xf'),JSON[_0xb246('0x10')](_0x3c37df));if(_0x3c37df[_0xb246('0x11')]){if(_0x3c37df[_0xb246('0x11')][_0xb246('0x12')]===0x1f4){logger['error'](_0xb246('0xc'),_0x4dbd51,_0x3c37df['error'][_0xb246('0x13')]);return _0x11a8f3(_0x3c37df['error'][_0xb246('0x13')]);}logger[_0xb246('0x11')](_0xb246('0xc'),_0x4dbd51,_0x3c37df[_0xb246('0x11')][_0xb246('0x13')]);return _0x54c53c(_0x3c37df[_0xb246('0x11')][_0xb246('0x13')]);}else{logger[_0xb246('0x14')](_0xb246('0xc'),_0x4dbd51,_0xb246('0xf'));_0x54c53c(_0x3c37df[_0xb246('0x15')][_0xb246('0x13')]);}})[_0xb246('0x16')](function(_0x1ba384){logger['error'](_0xb246('0xc'),_0x4dbd51,_0x1ba384);_0x11a8f3(_0x1ba384);});});}exports[_0xb246('0x17')]=function(_0x30e951){var _0x5303d9=this;return new Promise(function(_0x32c7a4,_0x500cc7){return db[_0xb246('0x18')]['findAll']({'raw':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')][_0xb246('0x1a')]===undefined?!![]:![]:!![],'where':_0x30e951[_0xb246('0x19')]?_0x30e951['options'][_0xb246('0x1b')]||null:null,'attributes':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')][_0xb246('0x1c')]||null:null,'limit':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')]['limit']||null:null,'include':_0x30e951[_0xb246('0x19')]?_0x30e951[_0xb246('0x19')][_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x30e951['options']['include'],function(_0x25cd9e){return{'model':db[_0x25cd9e['model']],'as':_0x25cd9e['as'],'attributes':_0x25cd9e[_0xb246('0x1c')],'include':_0x25cd9e[_0xb246('0x1d')]?_['map'](_0x25cd9e[_0xb246('0x1d')],function(_0x9af137){return{'model':db[_0x9af137[_0xb246('0x1f')]],'as':_0x9af137['as'],'attributes':_0x9af137[_0xb246('0x1c')],'include':_0x9af137['include']?_['map'](_0x9af137['include'],function(_0x17d5d1){return{'model':db[_0x17d5d1[_0xb246('0x1f')]],'as':_0x17d5d1['as'],'attributes':_0x17d5d1[_0xb246('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b8b01){logger[_0xb246('0x14')](_0xb246('0x17'),_0x30e951);logger[_0xb246('0xd')](_0xb246('0x17'),_0x30e951,JSON[_0xb246('0x10')](_0x4b8b01));_0x32c7a4(_0x4b8b01);})[_0xb246('0x16')](function(_0x1ce36f){logger[_0xb246('0x11')](_0xb246('0x17'),_0x1ce36f[_0xb246('0x13')],_0x30e951);_0x500cc7(_0x5303d9['error'](0x1f4,_0x1ce36f[_0xb246('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x1bfa06){var _0x14a69e=this;return new Promise(function(_0xabf125,_0x55ba49){return db[_0xb246('0x18')][_0xb246('0x20')]({'raw':_0x1bfa06['options']?_0x1bfa06['options'][_0xb246('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bfa06[_0xb246('0x19')]?_0x1bfa06[_0xb246('0x19')][_0xb246('0x1b')]||null:null,'attributes':_0x1bfa06[_0xb246('0x19')]?_0x1bfa06[_0xb246('0x19')][_0xb246('0x1c')]||null:null,'include':_0x1bfa06['options']?_0x1bfa06[_0xb246('0x19')][_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x1bfa06[_0xb246('0x19')][_0xb246('0x1d')],function(_0x5cc1d1){return{'model':db[_0x5cc1d1[_0xb246('0x1f')]],'as':_0x5cc1d1['as'],'attributes':_0x5cc1d1[_0xb246('0x1c')],'include':_0x5cc1d1[_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x5cc1d1['include'],function(_0x231353){return{'model':db[_0x231353[_0xb246('0x1f')]],'as':_0x231353['as'],'attributes':_0x231353[_0xb246('0x1c')],'include':_0x231353[_0xb246('0x1d')]?_[_0xb246('0x1e')](_0x231353[_0xb246('0x1d')],function(_0x526dd6){return{'model':db[_0x526dd6['model']],'as':_0x526dd6['as'],'attributes':_0x526dd6[_0xb246('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb246('0xb')](function(_0x64d804){logger[_0xb246('0x14')](_0xb246('0x21'),_0x1bfa06);logger['debug'](_0xb246('0x21'),_0x1bfa06,JSON[_0xb246('0x10')](_0x64d804));_0xabf125(_0x64d804);})['catch'](function(_0x30836f){logger['error'](_0xb246('0x21'),_0x30836f['message'],_0x1bfa06);_0x55ba49(_0x14a69e[_0xb246('0x11')](0x1f4,_0x30836f[_0xb246('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 03915e2..c4c9eb5 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 _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x12a50e,_0x169b19){var _0xb09760=function(_0x6ea973){while(--_0x6ea973){_0x12a50e['push'](_0x12a50e['shift']());}};_0xb09760(++_0x169b19);}(_0x0bb5,0x148));var _0x50bb=function(_0x132b41,_0x22d192){_0x132b41=_0x132b41-0x0;var _0x4a21e7=_0x0bb5[_0x132b41];return _0x4a21e7;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file +var _0x0713=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','setTags','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x7f0774,_0x3ce09c){var _0x5d5a31=function(_0x53e30f){while(--_0x53e30f){_0x7f0774['push'](_0x7f0774['shift']());}};_0x5d5a31(++_0x3ce09c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getFields']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/descriptions',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x8')](_0x3071('0x11'),auth[_0x3071('0x9')](),controller['getTags']);router['post']('/',auth[_0x3071('0x9')](),controller['create']);router[_0x3071('0x12')](_0x3071('0x11'),auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['put'](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x14')]);router[_0x3071('0x15')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0x16')]);module[_0x3071('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 1d484ed..5f66f15 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 _0x2d47=['sequelize','exports','STRING'];(function(_0x985a99,_0x2c2b4e){var _0xd3eea4=function(_0x2e9276){while(--_0x2e9276){_0x985a99['push'](_0x985a99['shift']());}};_0xd3eea4(++_0x2c2b4e);}(_0x2d47,0x132));var _0x72d4=function(_0x33a7fc,_0xe092e2){_0x33a7fc=_0x33a7fc-0x0;var _0xdedfa3=_0x2d47[_0x33a7fc];return _0xdedfa3;};'use strict';var Sequelize=require(_0x72d4('0x0'));module[_0x72d4('0x1')]={'name':{'type':Sequelize[_0x72d4('0x2')]},'description':{'type':Sequelize[_0x72d4('0x2')]}}; \ No newline at end of file +var _0xebc0=['exports','STRING','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xebc0,0x1e2));var _0x0ebc=function(_0x1c9ec1,_0x4ec841){_0x1c9ec1=_0x1c9ec1-0x0;var _0x3814a6=_0xebc0[_0x1c9ec1];return _0x3814a6;};'use strict';var Sequelize=require(_0x0ebc('0x0'));module[_0x0ebc('0x1')]={'name':{'type':Sequelize[_0x0ebc('0x2')]},'description':{'type':Sequelize[_0x0ebc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 6abbf37..d0d4c00 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 _0x30a2=['filter','options','findAll','rows','catch','params','include','create','body','getFields','findOne','ZendeskField','pick','getSubjects','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','update','then','destroy','error','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x30a2,0xfb));var _0x230a=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x30a2[_0x3f3bad];return _0x4f0801;};'use strict';var emlformat=require(_0x230a('0x0'));var rimraf=require(_0x230a('0x1'));var zipdir=require(_0x230a('0x2'));var jsonpatch=require(_0x230a('0x3'));var rp=require('request-promise');var moment=require(_0x230a('0x4'));var BPromise=require(_0x230a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x230a('0x6'));var csv=require(_0x230a('0x7'));var ejs=require(_0x230a('0x8'));var fs=require('fs');var fs_extra=require(_0x230a('0x9'));var _=require(_0x230a('0xa'));var squel=require(_0x230a('0xb'));var crypto=require(_0x230a('0xc'));var jsforce=require(_0x230a('0xd'));var deskjs=require(_0x230a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x230a('0xf'));var Papa=require(_0x230a('0x10'));var Redis=require(_0x230a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x230a('0x12'));var as=require(_0x230a('0x13'));var hardwareService=require(_0x230a('0x14'));var logger=require(_0x230a('0x15'))(_0x230a('0x16'));var utils=require('../../config/utils');var config=require(_0x230a('0x17'));var licenseUtil=require(_0x230a('0x18'));var db=require(_0x230a('0x19'))['db'];function respondWithStatusCode(_0xfdb320,_0x4bc44d){_0x4bc44d=_0x4bc44d||0xcc;return function(_0x1d41c4){if(_0x1d41c4){return _0xfdb320[_0x230a('0x1a')](_0x4bc44d);}return _0xfdb320[_0x230a('0x1b')](_0x4bc44d)['end']();};}function respondWithResult(_0x3b7a36,_0x9cc8cf){_0x9cc8cf=_0x9cc8cf||0xc8;return function(_0x78de8c){if(_0x78de8c){return _0x3b7a36[_0x230a('0x1b')](_0x9cc8cf)[_0x230a('0x1c')](_0x78de8c);}};}function respondWithFilteredResult(_0x116b42,_0x32d9ed){return function(_0x5b0493){if(_0x5b0493){var _0x3df16c=typeof _0x32d9ed['offset']===_0x230a('0x1d')&&typeof _0x32d9ed[_0x230a('0x1e')]==='undefined';var _0x36ed0f=_0x5b0493[_0x230a('0x1f')];var _0x4dc64a=_0x3df16c?0x0:_0x32d9ed[_0x230a('0x20')];var _0x2ffbb1=_0x3df16c?_0x5b0493['count']:_0x32d9ed[_0x230a('0x20')]+_0x32d9ed[_0x230a('0x1e')];var _0x14006f;if(_0x2ffbb1>=_0x36ed0f){_0x2ffbb1=_0x36ed0f;_0x14006f=0xc8;}else{_0x14006f=0xce;}_0x116b42['status'](_0x14006f);return _0x116b42['set'](_0x230a('0x21'),_0x4dc64a+'-'+_0x2ffbb1+'/'+_0x36ed0f)['json'](_0x5b0493);}return null;};}function patchUpdates(_0x5dcfbd){return function(_0x39bf42){try{jsonpatch['apply'](_0x39bf42,_0x5dcfbd,!![]);}catch(_0x60ccf2){return BPromise['reject'](_0x60ccf2);}return _0x39bf42['save']();};}function saveUpdates(_0x144a71,_0x17d758){return function(_0x53ea7b){if(_0x53ea7b){return _0x53ea7b[_0x230a('0x22')](_0x144a71)[_0x230a('0x23')](function(_0x165a75){return _0x165a75;});}return null;};}function removeEntity(_0x50db28,_0xd06514){return function(_0x50a10a){if(_0x50a10a){return _0x50a10a[_0x230a('0x24')]()[_0x230a('0x23')](function(){_0x50db28[_0x230a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bc08d,_0x1abbc1){return function(_0x3662cf){if(!_0x3662cf){_0x1bc08d[_0x230a('0x1a')](0x194);}return _0x3662cf;};}function handleError(_0x5f2833,_0x4fd6b3){_0x4fd6b3=_0x4fd6b3||0x1f4;return function(_0x5da83f){logger[_0x230a('0x25')](_0x5da83f['stack']);if(_0x5da83f['name']){delete _0x5da83f['name'];}_0x5f2833[_0x230a('0x1b')](_0x4fd6b3)[_0x230a('0x26')](_0x5da83f);};}exports[_0x230a('0x27')]=function(_0x20659a,_0x1349af){var _0x502a4d={},_0x192265={},_0x9fbaf3={'count':0x0,'rows':[]};var _0x4bde13=_[_0x230a('0x28')](db[_0x230a('0x29')][_0x230a('0x2a')],function(_0x24c76b){return{'name':_0x24c76b[_0x230a('0x2b')],'type':_0x24c76b[_0x230a('0x2c')][_0x230a('0x2d')]};});_0x192265[_0x230a('0x2e')]=_['map'](_0x4bde13,_0x230a('0x2f'));_0x192265[_0x230a('0x30')]=_[_0x230a('0x31')](_0x20659a['query']);_0x192265[_0x230a('0x32')]=_['intersection'](_0x192265[_0x230a('0x2e')],_0x192265[_0x230a('0x30')]);_0x502a4d[_0x230a('0x33')]=_[_0x230a('0x34')](_0x192265[_0x230a('0x2e')],qs['fields'](_0x20659a['query'][_0x230a('0x35')]));_0x502a4d[_0x230a('0x33')]=_0x502a4d['attributes'][_0x230a('0x36')]?_0x502a4d['attributes']:_0x192265[_0x230a('0x2e')];if(!_0x20659a[_0x230a('0x30')][_0x230a('0x37')](_0x230a('0x38'))){_0x502a4d[_0x230a('0x1e')]=qs[_0x230a('0x1e')](_0x20659a[_0x230a('0x30')]['limit']);_0x502a4d[_0x230a('0x20')]=qs['offset'](_0x20659a['query'][_0x230a('0x20')]);}_0x502a4d[_0x230a('0x39')]=qs[_0x230a('0x3a')](_0x20659a[_0x230a('0x30')]['sort']);_0x502a4d[_0x230a('0x3b')]=qs[_0x230a('0x32')](_['pick'](_0x20659a['query'],_0x192265['filters']),_0x4bde13);if(_0x20659a['query']['filter']){_0x502a4d['where']=_[_0x230a('0x3c')](_0x502a4d['where'],{'$or':_['map'](_0x4bde13,function(_0x5481ad){if(_0x5481ad[_0x230a('0x2c')]!=='VIRTUAL'){var _0x4d07df={};_0x4d07df[_0x5481ad[_0x230a('0x2f')]]={'$like':'%'+_0x20659a['query'][_0x230a('0x3d')]+'%'};return _0x4d07df;}})});}_0x502a4d=_['merge']({},_0x502a4d,_0x20659a[_0x230a('0x3e')]);var _0x129d0f={'where':_0x502a4d[_0x230a('0x3b')]};return db[_0x230a('0x29')][_0x230a('0x1f')](_0x129d0f)['then'](function(_0x264163){_0x9fbaf3['count']=_0x264163;if(_0x20659a[_0x230a('0x30')]['includeAll']){_0x502a4d['include']=[{'all':!![]}];}return db[_0x230a('0x29')][_0x230a('0x3f')](_0x502a4d);})[_0x230a('0x23')](function(_0x1eae2e){_0x9fbaf3[_0x230a('0x40')]=_0x1eae2e;return _0x9fbaf3;})[_0x230a('0x23')](respondWithFilteredResult(_0x1349af,_0x502a4d))[_0x230a('0x41')](handleError(_0x1349af,null));};exports['show']=function(_0x5d0947,_0x48d797){var _0x24c18e={'raw':![],'where':{'id':_0x5d0947[_0x230a('0x42')]['id']}},_0x2e4a95={};_0x2e4a95[_0x230a('0x2e')]=_[_0x230a('0x31')](db['ZendeskConfiguration'][_0x230a('0x2a')]);_0x2e4a95[_0x230a('0x30')]=_[_0x230a('0x31')](_0x5d0947[_0x230a('0x30')]);_0x2e4a95[_0x230a('0x32')]=_['intersection'](_0x2e4a95[_0x230a('0x2e')],_0x2e4a95[_0x230a('0x30')]);_0x24c18e[_0x230a('0x33')]=_['intersection'](_0x2e4a95['model'],qs['fields'](_0x5d0947['query']['fields']));_0x24c18e[_0x230a('0x33')]=_0x24c18e[_0x230a('0x33')][_0x230a('0x36')]?_0x24c18e[_0x230a('0x33')]:_0x2e4a95['model'];if(_0x5d0947[_0x230a('0x30')]['includeAll']){_0x24c18e[_0x230a('0x43')]=[{'all':!![]}];}_0x24c18e=_[_0x230a('0x3c')]({},_0x24c18e,_0x5d0947[_0x230a('0x3e')]);return db['ZendeskConfiguration']['find'](_0x24c18e)['then'](handleEntityNotFound(_0x48d797,null))['then'](respondWithResult(_0x48d797,null))[_0x230a('0x41')](handleError(_0x48d797,null));};exports[_0x230a('0x44')]=function(_0x179039,_0x291a7d){return db['ZendeskConfiguration'][_0x230a('0x44')](_0x179039[_0x230a('0x45')],{})['then'](respondWithResult(_0x291a7d,0xc9))['catch'](handleError(_0x291a7d,null));};exports[_0x230a('0x22')]=function(_0x1d7d38,_0x38a01a){if(_0x1d7d38[_0x230a('0x45')]['id']){delete _0x1d7d38[_0x230a('0x45')]['id'];}return db[_0x230a('0x29')]['find']({'where':{'id':_0x1d7d38[_0x230a('0x42')]['id']}})['then'](handleEntityNotFound(_0x38a01a,null))[_0x230a('0x23')](saveUpdates(_0x1d7d38[_0x230a('0x45')],null))['then'](respondWithResult(_0x38a01a,null))[_0x230a('0x41')](handleError(_0x38a01a,null));};exports[_0x230a('0x24')]=function(_0x3cd405,_0x3e6264){return db[_0x230a('0x29')]['find']({'where':{'id':_0x3cd405[_0x230a('0x42')]['id']}})[_0x230a('0x23')](handleEntityNotFound(_0x3e6264,null))['then'](removeEntity(_0x3e6264,null))[_0x230a('0x41')](handleError(_0x3e6264,null));};exports[_0x230a('0x46')]=function(_0x4c1e66,_0x380193,_0x3ca407){var _0x507ee1={};var _0x1577a1={};var _0x2ebf37;var _0x38b70b;return db[_0x230a('0x29')][_0x230a('0x47')]({'where':{'id':_0x4c1e66[_0x230a('0x42')]['id']}})[_0x230a('0x23')](handleEntityNotFound(_0x380193,null))[_0x230a('0x23')](function(_0x164d1a){if(_0x164d1a){_0x2ebf37=_0x164d1a;_0x1577a1[_0x230a('0x2e')]=_[_0x230a('0x31')](db[_0x230a('0x48')]['rawAttributes']);_0x1577a1['query']=_[_0x230a('0x31')](_0x4c1e66[_0x230a('0x30')]);_0x1577a1[_0x230a('0x32')]=_[_0x230a('0x34')](_0x1577a1['model'],_0x1577a1['query']);_0x507ee1[_0x230a('0x33')]=_['intersection'](_0x1577a1['model'],qs[_0x230a('0x35')](_0x4c1e66[_0x230a('0x30')][_0x230a('0x35')]));_0x507ee1[_0x230a('0x33')]=_0x507ee1[_0x230a('0x33')]['length']?_0x507ee1['attributes']:_0x1577a1[_0x230a('0x2e')];_0x507ee1[_0x230a('0x39')]=qs[_0x230a('0x3a')](_0x4c1e66[_0x230a('0x30')][_0x230a('0x3a')]);_0x507ee1[_0x230a('0x3b')]=qs[_0x230a('0x32')](_[_0x230a('0x49')](_0x4c1e66[_0x230a('0x30')],_0x1577a1[_0x230a('0x32')]));if(_0x4c1e66[_0x230a('0x30')][_0x230a('0x3d')]){_0x507ee1[_0x230a('0x3b')]=_[_0x230a('0x3c')](_0x507ee1[_0x230a('0x3b')],{'$or':_[_0x230a('0x28')](_0x507ee1[_0x230a('0x33')],function(_0x35faf5){var _0x16b6b0={};_0x16b6b0[_0x35faf5]={'$like':'%'+_0x4c1e66[_0x230a('0x30')][_0x230a('0x3d')]+'%'};return _0x16b6b0;})});}_0x507ee1=_[_0x230a('0x3c')]({},_0x507ee1,_0x4c1e66[_0x230a('0x3e')]);return _0x2ebf37[_0x230a('0x46')](_0x507ee1);}})['then'](function(_0x8cfcc5){if(_0x8cfcc5){_0x38b70b=_0x8cfcc5[_0x230a('0x36')];if(!_0x4c1e66['query'][_0x230a('0x37')](_0x230a('0x38'))){_0x507ee1[_0x230a('0x1e')]=qs[_0x230a('0x1e')](_0x4c1e66[_0x230a('0x30')][_0x230a('0x1e')]);_0x507ee1['offset']=qs[_0x230a('0x20')](_0x4c1e66[_0x230a('0x30')][_0x230a('0x20')]);}return _0x2ebf37[_0x230a('0x46')](_0x507ee1);}})['then'](function(_0x14a8b1){if(_0x14a8b1){return _0x14a8b1?{'count':_0x38b70b,'rows':_0x14a8b1}:null;}})[_0x230a('0x23')](respondWithResult(_0x380193,null))[_0x230a('0x41')](handleError(_0x380193,null));};exports[_0x230a('0x4a')]=function(_0x5173dc,_0x5480d0,_0x3f2e59){var _0x5daa1e={};var _0x4ab2a6={};var _0x50df0f;var _0x130ad0;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5173dc[_0x230a('0x42')]['id']}})['then'](handleEntityNotFound(_0x5480d0,null))[_0x230a('0x23')](function(_0x1c7740){if(_0x1c7740){_0x50df0f=_0x1c7740;_0x4ab2a6[_0x230a('0x2e')]=_[_0x230a('0x31')](db[_0x230a('0x48')][_0x230a('0x2a')]);_0x4ab2a6['query']=_[_0x230a('0x31')](_0x5173dc[_0x230a('0x30')]);_0x4ab2a6[_0x230a('0x32')]=_['intersection'](_0x4ab2a6['model'],_0x4ab2a6[_0x230a('0x30')]);_0x5daa1e['attributes']=_[_0x230a('0x34')](_0x4ab2a6[_0x230a('0x2e')],qs[_0x230a('0x35')](_0x5173dc[_0x230a('0x30')][_0x230a('0x35')]));_0x5daa1e['attributes']=_0x5daa1e[_0x230a('0x33')][_0x230a('0x36')]?_0x5daa1e['attributes']:_0x4ab2a6[_0x230a('0x2e')];_0x5daa1e[_0x230a('0x39')]=qs[_0x230a('0x3a')](_0x5173dc['query'][_0x230a('0x3a')]);_0x5daa1e[_0x230a('0x3b')]=qs['filters'](_[_0x230a('0x49')](_0x5173dc[_0x230a('0x30')],_0x4ab2a6[_0x230a('0x32')]));if(_0x5173dc[_0x230a('0x30')]['filter']){_0x5daa1e[_0x230a('0x3b')]=_['merge'](_0x5daa1e[_0x230a('0x3b')],{'$or':_['map'](_0x5daa1e[_0x230a('0x33')],function(_0x2df95e){var _0x30b03c={};_0x30b03c[_0x2df95e]={'$like':'%'+_0x5173dc['query'][_0x230a('0x3d')]+'%'};return _0x30b03c;})});}_0x5daa1e=_[_0x230a('0x3c')]({},_0x5daa1e,_0x5173dc[_0x230a('0x3e')]);return _0x50df0f[_0x230a('0x4a')](_0x5daa1e);}})[_0x230a('0x23')](function(_0x31b54f){if(_0x31b54f){_0x130ad0=_0x31b54f[_0x230a('0x36')];if(!_0x5173dc[_0x230a('0x30')][_0x230a('0x37')](_0x230a('0x38'))){_0x5daa1e[_0x230a('0x1e')]=qs[_0x230a('0x1e')](_0x5173dc['query'][_0x230a('0x1e')]);_0x5daa1e[_0x230a('0x20')]=qs['offset'](_0x5173dc[_0x230a('0x30')]['offset']);}return _0x50df0f[_0x230a('0x4a')](_0x5daa1e);}})[_0x230a('0x23')](function(_0x409939){if(_0x409939){return _0x409939?{'count':_0x130ad0,'rows':_0x409939}:null;}})[_0x230a('0x23')](respondWithResult(_0x5480d0,null))[_0x230a('0x41')](handleError(_0x5480d0,null));};exports['getDescriptions']=function(_0x14cc8d,_0x20784a,_0xf58419){var _0x25890e={};var _0x36afa0={};var _0x250673;var _0x1d8388;return db[_0x230a('0x29')][_0x230a('0x47')]({'where':{'id':_0x14cc8d['params']['id']}})[_0x230a('0x23')](handleEntityNotFound(_0x20784a,null))[_0x230a('0x23')](function(_0x35ce50){if(_0x35ce50){_0x250673=_0x35ce50;_0x36afa0[_0x230a('0x2e')]=_[_0x230a('0x31')](db['ZendeskField'][_0x230a('0x2a')]);_0x36afa0[_0x230a('0x30')]=_[_0x230a('0x31')](_0x14cc8d[_0x230a('0x30')]);_0x36afa0[_0x230a('0x32')]=_[_0x230a('0x34')](_0x36afa0[_0x230a('0x2e')],_0x36afa0[_0x230a('0x30')]);_0x25890e[_0x230a('0x33')]=_['intersection'](_0x36afa0[_0x230a('0x2e')],qs[_0x230a('0x35')](_0x14cc8d[_0x230a('0x30')][_0x230a('0x35')]));_0x25890e[_0x230a('0x33')]=_0x25890e[_0x230a('0x33')][_0x230a('0x36')]?_0x25890e[_0x230a('0x33')]:_0x36afa0['model'];_0x25890e[_0x230a('0x39')]=qs[_0x230a('0x3a')](_0x14cc8d[_0x230a('0x30')][_0x230a('0x3a')]);_0x25890e['where']=qs[_0x230a('0x32')](_['pick'](_0x14cc8d['query'],_0x36afa0[_0x230a('0x32')]));if(_0x14cc8d[_0x230a('0x30')]['filter']){_0x25890e[_0x230a('0x3b')]=_[_0x230a('0x3c')](_0x25890e[_0x230a('0x3b')],{'$or':_['map'](_0x25890e[_0x230a('0x33')],function(_0x361795){var _0x41e320={};_0x41e320[_0x361795]={'$like':'%'+_0x14cc8d['query']['filter']+'%'};return _0x41e320;})});}_0x25890e=_[_0x230a('0x3c')]({},_0x25890e,_0x14cc8d[_0x230a('0x3e')]);return _0x250673['getDescriptions'](_0x25890e);}})['then'](function(_0x53a6ea){if(_0x53a6ea){_0x1d8388=_0x53a6ea[_0x230a('0x36')];if(!_0x14cc8d[_0x230a('0x30')][_0x230a('0x37')](_0x230a('0x38'))){_0x25890e[_0x230a('0x1e')]=qs[_0x230a('0x1e')](_0x14cc8d[_0x230a('0x30')][_0x230a('0x1e')]);_0x25890e[_0x230a('0x20')]=qs[_0x230a('0x20')](_0x14cc8d['query']['offset']);}return _0x250673['getDescriptions'](_0x25890e);}})[_0x230a('0x23')](function(_0x4913e3){if(_0x4913e3){return _0x4913e3?{'count':_0x1d8388,'rows':_0x4913e3}:null;}})[_0x230a('0x23')](respondWithResult(_0x20784a,null))[_0x230a('0x41')](handleError(_0x20784a,null));};exports[_0x230a('0x4b')]=function(_0x11f558,_0x377af3,_0x2e8e4d){var _0x1e37b8={};var _0x2fc8dd={};var _0x2abeda;var _0x2d120f;return db[_0x230a('0x29')]['findOne']({'where':{'id':_0x11f558['params']['id']}})['then'](handleEntityNotFound(_0x377af3,null))[_0x230a('0x23')](function(_0x281e5c){if(_0x281e5c){_0x2abeda=_0x281e5c;_0x2fc8dd[_0x230a('0x2e')]=_[_0x230a('0x31')](db['Tag']['rawAttributes']);_0x2fc8dd[_0x230a('0x30')]=_[_0x230a('0x31')](_0x11f558[_0x230a('0x30')]);_0x2fc8dd[_0x230a('0x32')]=_[_0x230a('0x34')](_0x2fc8dd[_0x230a('0x2e')],_0x2fc8dd['query']);_0x1e37b8['attributes']=_[_0x230a('0x34')](_0x2fc8dd[_0x230a('0x2e')],qs[_0x230a('0x35')](_0x11f558[_0x230a('0x30')]['fields']));_0x1e37b8['attributes']=_0x1e37b8[_0x230a('0x33')][_0x230a('0x36')]?_0x1e37b8[_0x230a('0x33')]:_0x2fc8dd[_0x230a('0x2e')];_0x1e37b8[_0x230a('0x39')]=qs[_0x230a('0x3a')](_0x11f558[_0x230a('0x30')][_0x230a('0x3a')]);_0x1e37b8[_0x230a('0x3b')]=qs[_0x230a('0x32')](_[_0x230a('0x49')](_0x11f558[_0x230a('0x30')],_0x2fc8dd['filters']));if(_0x11f558['query'][_0x230a('0x3d')]){_0x1e37b8[_0x230a('0x3b')]=_[_0x230a('0x3c')](_0x1e37b8['where'],{'$or':_[_0x230a('0x28')](_0x1e37b8['attributes'],function(_0x2b2dd0){var _0x133230={};_0x133230[_0x2b2dd0]={'$like':'%'+_0x11f558[_0x230a('0x30')]['filter']+'%'};return _0x133230;})});}_0x1e37b8=_['merge']({},_0x1e37b8,_0x11f558[_0x230a('0x3e')]);return _0x2abeda[_0x230a('0x4b')](_0x1e37b8);}})[_0x230a('0x23')](function(_0x1be6f0){if(_0x1be6f0){_0x2d120f=_0x1be6f0['length'];if(!_0x11f558[_0x230a('0x30')][_0x230a('0x37')](_0x230a('0x38'))){_0x1e37b8[_0x230a('0x1e')]=qs[_0x230a('0x1e')](_0x11f558['query'][_0x230a('0x1e')]);_0x1e37b8[_0x230a('0x20')]=qs[_0x230a('0x20')](_0x11f558[_0x230a('0x30')][_0x230a('0x20')]);}return _0x2abeda[_0x230a('0x4b')](_0x1e37b8);}})[_0x230a('0x23')](function(_0x42f8fe){if(_0x42f8fe){return _0x42f8fe?{'count':_0x2d120f,'rows':_0x42f8fe}:null;}})['then'](respondWithResult(_0x377af3,null))[_0x230a('0x41')](handleError(_0x377af3,null));};exports[_0x230a('0x4c')]=function(_0x4952fe,_0x29686e,_0x55b945){if(_0x4952fe[_0x230a('0x45')]['id']){delete _0x4952fe[_0x230a('0x45')]['id'];}return db[_0x230a('0x29')][_0x230a('0x47')]({'where':{'id':_0x4952fe[_0x230a('0x42')]['id']}})[_0x230a('0x23')](handleEntityNotFound(_0x29686e,null))[_0x230a('0x23')](function(_0x36cc45){if(_0x36cc45){return _0x36cc45['setTags'](_0x4952fe[_0x230a('0x45')][_0x230a('0x4d')]||[]);}return null;})['then'](respondWithResult(_0x29686e,null))['catch'](handleError(_0x29686e,null));}; \ No newline at end of file +var _0x3be9=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','rawAttributes','type','key','model','map','keys','intersection','query','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','ZendeskConfiguration','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format'];(function(_0x18981a,_0x418117){var _0x487367=function(_0x3a6696){while(--_0x3a6696){_0x18981a['push'](_0x18981a['shift']());}};_0x487367(++_0x418117);}(_0x3be9,0x1bc));var _0x93be=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x3be9[_0x532112];return _0x23e5fb;};'use strict';var emlformat=require(_0x93be('0x0'));var rimraf=require(_0x93be('0x1'));var zipdir=require(_0x93be('0x2'));var jsonpatch=require(_0x93be('0x3'));var rp=require(_0x93be('0x4'));var moment=require(_0x93be('0x5'));var BPromise=require(_0x93be('0x6'));var Mustache=require(_0x93be('0x7'));var util=require(_0x93be('0x8'));var path=require(_0x93be('0x9'));var sox=require(_0x93be('0xa'));var csv=require(_0x93be('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93be('0xc'));var _=require(_0x93be('0xd'));var squel=require(_0x93be('0xe'));var crypto=require(_0x93be('0xf'));var jsforce=require(_0x93be('0x10'));var deskjs=require(_0x93be('0x11'));var toCsv=require(_0x93be('0xb'));var querystring=require(_0x93be('0x12'));var Papa=require(_0x93be('0x13'));var Redis=require(_0x93be('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x93be('0x15'));var as=require(_0x93be('0x16'));var hardwareService=require(_0x93be('0x17'));var logger=require(_0x93be('0x18'))('api');var utils=require(_0x93be('0x19'));var config=require(_0x93be('0x1a'));var licenseUtil=require(_0x93be('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x365c40,_0x2c6cf1){_0x2c6cf1=_0x2c6cf1||0xcc;return function(_0x41b564){if(_0x41b564){return _0x365c40[_0x93be('0x1c')](_0x2c6cf1);}return _0x365c40[_0x93be('0x1d')](_0x2c6cf1)[_0x93be('0x1e')]();};}function respondWithResult(_0x2ba89d,_0x22b6b0){_0x22b6b0=_0x22b6b0||0xc8;return function(_0x487b64){if(_0x487b64){return _0x2ba89d[_0x93be('0x1d')](_0x22b6b0)[_0x93be('0x1f')](_0x487b64);}};}function respondWithFilteredResult(_0x2ef59b,_0x3dac11){return function(_0x44398f){if(_0x44398f){var _0xdb9a81=typeof _0x3dac11[_0x93be('0x20')]===_0x93be('0x21')&&typeof _0x3dac11[_0x93be('0x22')]===_0x93be('0x21');var _0x33a303=_0x44398f[_0x93be('0x23')];var _0xe5a69c=_0xdb9a81?0x0:_0x3dac11['offset'];var _0x23dcc1=_0xdb9a81?_0x44398f[_0x93be('0x23')]:_0x3dac11[_0x93be('0x20')]+_0x3dac11[_0x93be('0x22')];var _0x3e9424;if(_0x23dcc1>=_0x33a303){_0x23dcc1=_0x33a303;_0x3e9424=0xc8;}else{_0x3e9424=0xce;}_0x2ef59b[_0x93be('0x1d')](_0x3e9424);return _0x2ef59b[_0x93be('0x24')](_0x93be('0x25'),_0xe5a69c+'-'+_0x23dcc1+'/'+_0x33a303)[_0x93be('0x1f')](_0x44398f);}return null;};}function patchUpdates(_0x3a3eb9){return function(_0x6afab){try{jsonpatch[_0x93be('0x26')](_0x6afab,_0x3a3eb9,!![]);}catch(_0x24fc3a){return BPromise[_0x93be('0x27')](_0x24fc3a);}return _0x6afab[_0x93be('0x28')]();};}function saveUpdates(_0x209dba,_0x7121e){return function(_0xf517a0){if(_0xf517a0){return _0xf517a0[_0x93be('0x29')](_0x209dba)['then'](function(_0x2fa565){return _0x2fa565;});}return null;};}function removeEntity(_0x30f8b4,_0x48885f){return function(_0x122863){if(_0x122863){return _0x122863[_0x93be('0x2a')]()['then'](function(){_0x30f8b4['status'](0xcc)[_0x93be('0x1e')]();});}};}function handleEntityNotFound(_0x33d07c,_0x176e31){return function(_0x1c9990){if(!_0x1c9990){_0x33d07c[_0x93be('0x1c')](0x194);}return _0x1c9990;};}function handleError(_0x385ebf,_0x391b1a){_0x391b1a=_0x391b1a||0x1f4;return function(_0x4d8db6){logger[_0x93be('0x2b')](_0x4d8db6[_0x93be('0x2c')]);if(_0x4d8db6[_0x93be('0x2d')]){delete _0x4d8db6['name'];}_0x385ebf[_0x93be('0x1d')](_0x391b1a)[_0x93be('0x2e')](_0x4d8db6);};}exports['index']=function(_0x13c62d,_0x2174fa){var _0x200553={},_0x4b47ee={},_0x43e76a={'count':0x0,'rows':[]};var _0xfc0cc8=_['map'](db['ZendeskConfiguration'][_0x93be('0x2f')],function(_0x191b35){return{'name':_0x191b35['fieldName'],'type':_0x191b35[_0x93be('0x30')][_0x93be('0x31')]};});_0x4b47ee[_0x93be('0x32')]=_[_0x93be('0x33')](_0xfc0cc8,_0x93be('0x2d'));_0x4b47ee['query']=_[_0x93be('0x34')](_0x13c62d['query']);_0x4b47ee['filters']=_[_0x93be('0x35')](_0x4b47ee[_0x93be('0x32')],_0x4b47ee[_0x93be('0x36')]);_0x200553['attributes']=_[_0x93be('0x35')](_0x4b47ee[_0x93be('0x32')],qs[_0x93be('0x37')](_0x13c62d[_0x93be('0x36')][_0x93be('0x37')]));_0x200553[_0x93be('0x38')]=_0x200553[_0x93be('0x38')][_0x93be('0x39')]?_0x200553['attributes']:_0x4b47ee[_0x93be('0x32')];if(!_0x13c62d[_0x93be('0x36')]['hasOwnProperty'](_0x93be('0x3a'))){_0x200553[_0x93be('0x22')]=qs['limit'](_0x13c62d[_0x93be('0x36')][_0x93be('0x22')]);_0x200553[_0x93be('0x20')]=qs[_0x93be('0x20')](_0x13c62d[_0x93be('0x36')]['offset']);}_0x200553[_0x93be('0x3b')]=qs[_0x93be('0x3c')](_0x13c62d[_0x93be('0x36')][_0x93be('0x3c')]);_0x200553['where']=qs[_0x93be('0x3d')](_['pick'](_0x13c62d[_0x93be('0x36')],_0x4b47ee[_0x93be('0x3d')]),_0xfc0cc8);if(_0x13c62d[_0x93be('0x36')][_0x93be('0x3e')]){_0x200553[_0x93be('0x3f')]=_[_0x93be('0x40')](_0x200553[_0x93be('0x3f')],{'$or':_['map'](_0xfc0cc8,function(_0x25a12b){if(_0x25a12b[_0x93be('0x30')]!==_0x93be('0x41')){var _0x1acc00={};_0x1acc00[_0x25a12b[_0x93be('0x2d')]]={'$like':'%'+_0x13c62d[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x1acc00;}})});}_0x200553=_[_0x93be('0x40')]({},_0x200553,_0x13c62d[_0x93be('0x42')]);var _0x90f69c={'where':_0x200553['where']};return db[_0x93be('0x43')]['count'](_0x90f69c)[_0x93be('0x44')](function(_0x174985){_0x43e76a[_0x93be('0x23')]=_0x174985;if(_0x13c62d['query'][_0x93be('0x45')]){_0x200553[_0x93be('0x46')]=[{'all':!![]}];}return db[_0x93be('0x43')][_0x93be('0x47')](_0x200553);})[_0x93be('0x44')](function(_0x4b72b2){_0x43e76a[_0x93be('0x48')]=_0x4b72b2;return _0x43e76a;})[_0x93be('0x44')](respondWithFilteredResult(_0x2174fa,_0x200553))[_0x93be('0x49')](handleError(_0x2174fa,null));};exports[_0x93be('0x4a')]=function(_0x32cec5,_0x15831a){var _0x5d68a7={'raw':![],'where':{'id':_0x32cec5[_0x93be('0x4b')]['id']}},_0x540ab7={};_0x540ab7[_0x93be('0x32')]=_[_0x93be('0x34')](db['ZendeskConfiguration'][_0x93be('0x2f')]);_0x540ab7['query']=_[_0x93be('0x34')](_0x32cec5['query']);_0x540ab7[_0x93be('0x3d')]=_['intersection'](_0x540ab7[_0x93be('0x32')],_0x540ab7[_0x93be('0x36')]);_0x5d68a7[_0x93be('0x38')]=_['intersection'](_0x540ab7['model'],qs[_0x93be('0x37')](_0x32cec5['query'][_0x93be('0x37')]));_0x5d68a7[_0x93be('0x38')]=_0x5d68a7[_0x93be('0x38')][_0x93be('0x39')]?_0x5d68a7['attributes']:_0x540ab7[_0x93be('0x32')];if(_0x32cec5['query'][_0x93be('0x45')]){_0x5d68a7[_0x93be('0x46')]=[{'all':!![]}];}_0x5d68a7=_[_0x93be('0x40')]({},_0x5d68a7,_0x32cec5[_0x93be('0x42')]);return db[_0x93be('0x43')][_0x93be('0x4c')](_0x5d68a7)[_0x93be('0x44')](handleEntityNotFound(_0x15831a,null))[_0x93be('0x44')](respondWithResult(_0x15831a,null))[_0x93be('0x49')](handleError(_0x15831a,null));};exports[_0x93be('0x4d')]=function(_0x174b64,_0x2ee04b){return db['ZendeskConfiguration']['create'](_0x174b64[_0x93be('0x4e')],{})[_0x93be('0x44')](respondWithResult(_0x2ee04b,0xc9))[_0x93be('0x49')](handleError(_0x2ee04b,null));};exports[_0x93be('0x29')]=function(_0x567f6b,_0x1b4196){if(_0x567f6b[_0x93be('0x4e')]['id']){delete _0x567f6b[_0x93be('0x4e')]['id'];}return db[_0x93be('0x43')]['find']({'where':{'id':_0x567f6b[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x1b4196,null))[_0x93be('0x44')](saveUpdates(_0x567f6b[_0x93be('0x4e')],null))[_0x93be('0x44')](respondWithResult(_0x1b4196,null))[_0x93be('0x49')](handleError(_0x1b4196,null));};exports[_0x93be('0x2a')]=function(_0x1acc3b,_0x44bc07){return db[_0x93be('0x43')][_0x93be('0x4c')]({'where':{'id':_0x1acc3b[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x44bc07,null))[_0x93be('0x44')](removeEntity(_0x44bc07,null))[_0x93be('0x49')](handleError(_0x44bc07,null));};exports[_0x93be('0x4f')]=function(_0x343143,_0x3500c5,_0x223b92){var _0x5ce933={};var _0x4dced5={};var _0x5833a0;var _0x1e801d;return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x343143[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x3500c5,null))[_0x93be('0x44')](function(_0x164d06){if(_0x164d06){_0x5833a0=_0x164d06;_0x4dced5[_0x93be('0x32')]=_[_0x93be('0x34')](db[_0x93be('0x51')]['rawAttributes']);_0x4dced5[_0x93be('0x36')]=_[_0x93be('0x34')](_0x343143[_0x93be('0x36')]);_0x4dced5[_0x93be('0x3d')]=_[_0x93be('0x35')](_0x4dced5[_0x93be('0x32')],_0x4dced5[_0x93be('0x36')]);_0x5ce933[_0x93be('0x38')]=_[_0x93be('0x35')](_0x4dced5[_0x93be('0x32')],qs[_0x93be('0x37')](_0x343143['query'][_0x93be('0x37')]));_0x5ce933['attributes']=_0x5ce933[_0x93be('0x38')][_0x93be('0x39')]?_0x5ce933[_0x93be('0x38')]:_0x4dced5[_0x93be('0x32')];_0x5ce933[_0x93be('0x3b')]=qs[_0x93be('0x3c')](_0x343143[_0x93be('0x36')]['sort']);_0x5ce933[_0x93be('0x3f')]=qs[_0x93be('0x3d')](_[_0x93be('0x52')](_0x343143[_0x93be('0x36')],_0x4dced5[_0x93be('0x3d')]));if(_0x343143[_0x93be('0x36')][_0x93be('0x3e')]){_0x5ce933[_0x93be('0x3f')]=_[_0x93be('0x40')](_0x5ce933[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x5ce933[_0x93be('0x38')],function(_0x5a6f07){var _0x54ec9a={};_0x54ec9a[_0x5a6f07]={'$like':'%'+_0x343143[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x54ec9a;})});}_0x5ce933=_[_0x93be('0x40')]({},_0x5ce933,_0x343143[_0x93be('0x42')]);return _0x5833a0[_0x93be('0x4f')](_0x5ce933);}})[_0x93be('0x44')](function(_0x3d2bf9){if(_0x3d2bf9){_0x1e801d=_0x3d2bf9[_0x93be('0x39')];if(!_0x343143[_0x93be('0x36')][_0x93be('0x53')]('nolimit')){_0x5ce933[_0x93be('0x22')]=qs['limit'](_0x343143[_0x93be('0x36')][_0x93be('0x22')]);_0x5ce933['offset']=qs[_0x93be('0x20')](_0x343143[_0x93be('0x36')][_0x93be('0x20')]);}return _0x5833a0[_0x93be('0x4f')](_0x5ce933);}})[_0x93be('0x44')](function(_0x5e341f){if(_0x5e341f){return _0x5e341f?{'count':_0x1e801d,'rows':_0x5e341f}:null;}})[_0x93be('0x44')](respondWithResult(_0x3500c5,null))[_0x93be('0x49')](handleError(_0x3500c5,null));};exports[_0x93be('0x54')]=function(_0x1a2b0e,_0xfc7702,_0x34dbd2){var _0x49adb6={};var _0x56bf51={};var _0x2fbdc2;var _0x2776c8;return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x1a2b0e['params']['id']}})[_0x93be('0x44')](handleEntityNotFound(_0xfc7702,null))[_0x93be('0x44')](function(_0x2855de){if(_0x2855de){_0x2fbdc2=_0x2855de;_0x56bf51[_0x93be('0x32')]=_['keys'](db[_0x93be('0x51')][_0x93be('0x2f')]);_0x56bf51[_0x93be('0x36')]=_[_0x93be('0x34')](_0x1a2b0e[_0x93be('0x36')]);_0x56bf51[_0x93be('0x3d')]=_[_0x93be('0x35')](_0x56bf51[_0x93be('0x32')],_0x56bf51[_0x93be('0x36')]);_0x49adb6['attributes']=_[_0x93be('0x35')](_0x56bf51[_0x93be('0x32')],qs[_0x93be('0x37')](_0x1a2b0e[_0x93be('0x36')][_0x93be('0x37')]));_0x49adb6[_0x93be('0x38')]=_0x49adb6[_0x93be('0x38')][_0x93be('0x39')]?_0x49adb6[_0x93be('0x38')]:_0x56bf51[_0x93be('0x32')];_0x49adb6[_0x93be('0x3b')]=qs[_0x93be('0x3c')](_0x1a2b0e['query']['sort']);_0x49adb6[_0x93be('0x3f')]=qs[_0x93be('0x3d')](_['pick'](_0x1a2b0e[_0x93be('0x36')],_0x56bf51[_0x93be('0x3d')]));if(_0x1a2b0e[_0x93be('0x36')]['filter']){_0x49adb6[_0x93be('0x3f')]=_[_0x93be('0x40')](_0x49adb6[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x49adb6[_0x93be('0x38')],function(_0x176129){var _0x27c136={};_0x27c136[_0x176129]={'$like':'%'+_0x1a2b0e[_0x93be('0x36')]['filter']+'%'};return _0x27c136;})});}_0x49adb6=_[_0x93be('0x40')]({},_0x49adb6,_0x1a2b0e[_0x93be('0x42')]);return _0x2fbdc2[_0x93be('0x54')](_0x49adb6);}})[_0x93be('0x44')](function(_0x25e434){if(_0x25e434){_0x2776c8=_0x25e434[_0x93be('0x39')];if(!_0x1a2b0e[_0x93be('0x36')][_0x93be('0x53')]('nolimit')){_0x49adb6[_0x93be('0x22')]=qs[_0x93be('0x22')](_0x1a2b0e['query']['limit']);_0x49adb6[_0x93be('0x20')]=qs[_0x93be('0x20')](_0x1a2b0e['query'][_0x93be('0x20')]);}return _0x2fbdc2[_0x93be('0x54')](_0x49adb6);}})[_0x93be('0x44')](function(_0x41dac1){if(_0x41dac1){return _0x41dac1?{'count':_0x2776c8,'rows':_0x41dac1}:null;}})[_0x93be('0x44')](respondWithResult(_0xfc7702,null))[_0x93be('0x49')](handleError(_0xfc7702,null));};exports[_0x93be('0x55')]=function(_0x824277,_0x3d6be3,_0x1b20da){var _0x683045={};var _0x4d67e0={};var _0x553502;var _0x27cbbd;return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x824277['params']['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x3d6be3,null))[_0x93be('0x44')](function(_0x10ef9f){if(_0x10ef9f){_0x553502=_0x10ef9f;_0x4d67e0[_0x93be('0x32')]=_[_0x93be('0x34')](db['ZendeskField']['rawAttributes']);_0x4d67e0[_0x93be('0x36')]=_[_0x93be('0x34')](_0x824277[_0x93be('0x36')]);_0x4d67e0['filters']=_[_0x93be('0x35')](_0x4d67e0['model'],_0x4d67e0[_0x93be('0x36')]);_0x683045[_0x93be('0x38')]=_[_0x93be('0x35')](_0x4d67e0[_0x93be('0x32')],qs[_0x93be('0x37')](_0x824277['query']['fields']));_0x683045['attributes']=_0x683045['attributes'][_0x93be('0x39')]?_0x683045[_0x93be('0x38')]:_0x4d67e0[_0x93be('0x32')];_0x683045['order']=qs['sort'](_0x824277['query'][_0x93be('0x3c')]);_0x683045['where']=qs[_0x93be('0x3d')](_[_0x93be('0x52')](_0x824277[_0x93be('0x36')],_0x4d67e0[_0x93be('0x3d')]));if(_0x824277['query'][_0x93be('0x3e')]){_0x683045['where']=_[_0x93be('0x40')](_0x683045[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x683045[_0x93be('0x38')],function(_0x5c7f47){var _0x2233fe={};_0x2233fe[_0x5c7f47]={'$like':'%'+_0x824277[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x2233fe;})});}_0x683045=_[_0x93be('0x40')]({},_0x683045,_0x824277['options']);return _0x553502['getDescriptions'](_0x683045);}})['then'](function(_0x20942a){if(_0x20942a){_0x27cbbd=_0x20942a['length'];if(!_0x824277['query'][_0x93be('0x53')](_0x93be('0x3a'))){_0x683045['limit']=qs[_0x93be('0x22')](_0x824277[_0x93be('0x36')][_0x93be('0x22')]);_0x683045['offset']=qs['offset'](_0x824277[_0x93be('0x36')][_0x93be('0x20')]);}return _0x553502[_0x93be('0x55')](_0x683045);}})[_0x93be('0x44')](function(_0x234f7){if(_0x234f7){return _0x234f7?{'count':_0x27cbbd,'rows':_0x234f7}:null;}})[_0x93be('0x44')](respondWithResult(_0x3d6be3,null))[_0x93be('0x49')](handleError(_0x3d6be3,null));};exports[_0x93be('0x56')]=function(_0x8b9a8d,_0x2cfad5,_0x3e2243){var _0x5d5431={};var _0x3a616b={};var _0x476292;var _0xc3460a;return db[_0x93be('0x43')]['findOne']({'where':{'id':_0x8b9a8d['params']['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x2cfad5,null))[_0x93be('0x44')](function(_0x4fb76a){if(_0x4fb76a){_0x476292=_0x4fb76a;_0x3a616b[_0x93be('0x32')]=_[_0x93be('0x34')](db[_0x93be('0x57')][_0x93be('0x2f')]);_0x3a616b['query']=_[_0x93be('0x34')](_0x8b9a8d[_0x93be('0x36')]);_0x3a616b[_0x93be('0x3d')]=_['intersection'](_0x3a616b[_0x93be('0x32')],_0x3a616b[_0x93be('0x36')]);_0x5d5431[_0x93be('0x38')]=_[_0x93be('0x35')](_0x3a616b[_0x93be('0x32')],qs['fields'](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x37')]));_0x5d5431[_0x93be('0x38')]=_0x5d5431[_0x93be('0x38')][_0x93be('0x39')]?_0x5d5431[_0x93be('0x38')]:_0x3a616b[_0x93be('0x32')];_0x5d5431[_0x93be('0x3b')]=qs['sort'](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x3c')]);_0x5d5431[_0x93be('0x3f')]=qs[_0x93be('0x3d')](_[_0x93be('0x52')](_0x8b9a8d[_0x93be('0x36')],_0x3a616b['filters']));if(_0x8b9a8d[_0x93be('0x36')][_0x93be('0x3e')]){_0x5d5431['where']=_[_0x93be('0x40')](_0x5d5431[_0x93be('0x3f')],{'$or':_[_0x93be('0x33')](_0x5d5431[_0x93be('0x38')],function(_0x4a0d57){var _0x39471c={};_0x39471c[_0x4a0d57]={'$like':'%'+_0x8b9a8d[_0x93be('0x36')][_0x93be('0x3e')]+'%'};return _0x39471c;})});}_0x5d5431=_[_0x93be('0x40')]({},_0x5d5431,_0x8b9a8d[_0x93be('0x42')]);return _0x476292[_0x93be('0x56')](_0x5d5431);}})['then'](function(_0x3ec6b1){if(_0x3ec6b1){_0xc3460a=_0x3ec6b1[_0x93be('0x39')];if(!_0x8b9a8d[_0x93be('0x36')][_0x93be('0x53')](_0x93be('0x3a'))){_0x5d5431[_0x93be('0x22')]=qs[_0x93be('0x22')](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x22')]);_0x5d5431[_0x93be('0x20')]=qs['offset'](_0x8b9a8d[_0x93be('0x36')][_0x93be('0x20')]);}return _0x476292[_0x93be('0x56')](_0x5d5431);}})[_0x93be('0x44')](function(_0x552c1e){if(_0x552c1e){return _0x552c1e?{'count':_0xc3460a,'rows':_0x552c1e}:null;}})[_0x93be('0x44')](respondWithResult(_0x2cfad5,null))['catch'](handleError(_0x2cfad5,null));};exports[_0x93be('0x58')]=function(_0x34cb63,_0x1b5674,_0x6b7ea){if(_0x34cb63[_0x93be('0x4e')]['id']){delete _0x34cb63['body']['id'];}return db[_0x93be('0x43')][_0x93be('0x50')]({'where':{'id':_0x34cb63[_0x93be('0x4b')]['id']}})[_0x93be('0x44')](handleEntityNotFound(_0x1b5674,null))[_0x93be('0x44')](function(_0x54d2b0){if(_0x54d2b0){return _0x54d2b0[_0x93be('0x58')](_0x34cb63[_0x93be('0x4e')]['ids']||[]);}return null;})[_0x93be('0x44')](respondWithResult(_0x1b5674,null))[_0x93be('0x49')](handleError(_0x1b5674,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index bdd64a0..c7a3042 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 _0xc900=['api','moment','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations','../../config/logger'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xc900,0xb3));var _0x0c90=function(_0x36ba7a,_0x1ce129){_0x36ba7a=_0x36ba7a-0x0;var _0x4a2470=_0xc900[_0x36ba7a];return _0x4a2470;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c90('0x0'))(_0x0c90('0x1'));var moment=require(_0x0c90('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c90('0x3'));var fs=require('fs');var path=require(_0x0c90('0x4'));var rimraf=require('rimraf');var config=require(_0x0c90('0x5'));var attributes=require(_0x0c90('0x6'));module[_0x0c90('0x7')]=function(_0x718a5c,_0x42f9a3){return _0x718a5c[_0x0c90('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x0c90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b12=['int_zendesk_configurations','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','ZendeskConfiguration'];(function(_0x182dd9,_0x3c81cf){var _0x349502=function(_0x44fc6f){while(--_0x44fc6f){_0x182dd9['push'](_0x182dd9['shift']());}};_0x349502(++_0x3c81cf);}(_0x5b12,0xa3));var _0x25b1=function(_0x1de390,_0x3e5e2c){_0x1de390=_0x1de390-0x0;var _0x3a3f13=_0x5b12[_0x1de390];return _0x3a3f13;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var logger=require(_0x25b1('0x2'))('api');var moment=require(_0x25b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x25b1('0x4'));var fs=require('fs');var path=require(_0x25b1('0x5'));var rimraf=require('rimraf');var config=require(_0x25b1('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x35d90b,_0x5523c9){return _0x35d90b['define'](_0x25b1('0x7'),attributes,{'tableName':_0x25b1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 51fe087..5ffcd95 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 _0x1ce1=['client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3abd13,_0x3912ba){var _0x4504a5=function(_0x31f7f1){while(--_0x31f7f1){_0x3abd13['push'](_0x3abd13['shift']());}};_0x4504a5(++_0x3912ba);}(_0x1ce1,0x1da));var _0x11ce=function(_0x150551,_0x6cbe68){_0x150551=_0x150551-0x0;var _0x19f9fc=_0x1ce1[_0x150551];return _0x19f9fc;};'use strict';var _=require(_0x11ce('0x0'));var util=require(_0x11ce('0x1'));var moment=require(_0x11ce('0x2'));var BPromise=require(_0x11ce('0x3'));var rs=require(_0x11ce('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x11ce('0x5'));var logger=require(_0x11ce('0x6'))(_0x11ce('0x7'));var config=require(_0x11ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x11ce('0x9')][_0x11ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409a9,_0x5cd208,_0xdf887d){return new BPromise(function(_0x5cd00d,_0x54acc4){return client[_0x11ce('0xb')](_0x3409a9,_0xdf887d)[_0x11ce('0xc')](function(_0x368cb3){logger[_0x11ce('0xd')](_0x11ce('0xe'),_0x5cd208,_0x11ce('0xf'));logger[_0x11ce('0x10')](_0x11ce('0x11'),_0x5cd208,_0x11ce('0xf'),JSON[_0x11ce('0x12')](_0x368cb3));if(_0x368cb3['error']){if(_0x368cb3[_0x11ce('0x13')][_0x11ce('0x14')]===0x1f4){logger[_0x11ce('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5cd208,_0x368cb3['error'][_0x11ce('0x15')]);return _0x54acc4(_0x368cb3[_0x11ce('0x13')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5cd208,_0x368cb3[_0x11ce('0x13')][_0x11ce('0x15')]);return _0x5cd00d(_0x368cb3[_0x11ce('0x13')][_0x11ce('0x15')]);}else{logger[_0x11ce('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5cd208,_0x11ce('0xf'));_0x5cd00d(_0x368cb3[_0x11ce('0x16')][_0x11ce('0x15')]);}})['catch'](function(_0x15582f){logger['error'](_0x11ce('0xe'),_0x5cd208,_0x15582f);_0x54acc4(_0x15582f);});});} \ No newline at end of file +var _0x130a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2e5184,_0x3d9825){var _0x298144=function(_0x1e1b2b){while(--_0x1e1b2b){_0x2e5184['push'](_0x2e5184['shift']());}};_0x298144(++_0x3d9825);}(_0x130a,0x103));var _0xa130=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x130a[_0x2f4c1c];return _0x25e0f2;};'use strict';var _=require(_0xa130('0x0'));var util=require(_0xa130('0x1'));var moment=require(_0xa130('0x2'));var BPromise=require('bluebird');var rs=require(_0xa130('0x3'));var fs=require('fs');var Redis=require(_0xa130('0x4'));var db=require(_0xa130('0x5'))['db'];var utils=require(_0xa130('0x6'));var logger=require('../../config/logger')(_0xa130('0x7'));var config=require(_0xa130('0x8'));var jayson=require(_0xa130('0x9'));var client=jayson[_0xa130('0xa')][_0xa130('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e662a,_0x401ff6,_0x1e36d8){return new BPromise(function(_0x418568,_0x1c7cba){return client[_0xa130('0xc')](_0x1e662a,_0x1e36d8)['then'](function(_0x39abe9){logger[_0xa130('0xd')](_0xa130('0xe'),_0x401ff6,_0xa130('0xf'));logger[_0xa130('0x10')](_0xa130('0x11'),_0x401ff6,_0xa130('0xf'),JSON[_0xa130('0x12')](_0x39abe9));if(_0x39abe9[_0xa130('0x13')]){if(_0x39abe9[_0xa130('0x13')][_0xa130('0x14')]===0x1f4){logger[_0xa130('0x13')](_0xa130('0xe'),_0x401ff6,_0x39abe9['error'][_0xa130('0x15')]);return _0x1c7cba(_0x39abe9[_0xa130('0x13')][_0xa130('0x15')]);}logger[_0xa130('0x13')](_0xa130('0xe'),_0x401ff6,_0x39abe9[_0xa130('0x13')][_0xa130('0x15')]);return _0x418568(_0x39abe9[_0xa130('0x13')][_0xa130('0x15')]);}else{logger[_0xa130('0xd')](_0xa130('0xe'),_0x401ff6,_0xa130('0xf'));_0x418568(_0x39abe9[_0xa130('0x16')][_0xa130('0x15')]);}})[_0xa130('0x17')](function(_0xc66c7b){logger[_0xa130('0x13')](_0xa130('0xe'),_0x401ff6,_0xc66c7b);_0x1c7cba(_0xc66c7b);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 6fa9786..dbee0b2 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 _0x36f2=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0xd58b2,_0x126018){var _0x2575d0=function(_0x39844e){while(--_0x39844e){_0xd58b2['push'](_0xd58b2['shift']());}};_0x2575d0(++_0x126018);}(_0x36f2,0xc3));var _0x236f=function(_0x1133cd,_0x344580){_0x1133cd=_0x1133cd-0x0;var _0x1816d1=_0x36f2[_0x1133cd];return _0x1816d1;};'use strict';var multer=require('multer');var util=require(_0x236f('0x0'));var path=require(_0x236f('0x1'));var timeout=require(_0x236f('0x2'));var express=require(_0x236f('0x3'));var router=express['Router']();var fs_extra=require(_0x236f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x236f('0x5'));var controller=require(_0x236f('0x6'));router[_0x236f('0x7')]('/',auth[_0x236f('0x8')](),controller[_0x236f('0x9')]);router['get'](_0x236f('0xa'),auth[_0x236f('0x8')](),controller[_0x236f('0xb')]);router[_0x236f('0xc')]('/',auth[_0x236f('0x8')](),controller[_0x236f('0xd')]);router[_0x236f('0xe')](_0x236f('0xa'),auth[_0x236f('0x8')](),controller[_0x236f('0xf')]);router[_0x236f('0x10')](_0x236f('0xa'),auth[_0x236f('0x8')](),controller[_0x236f('0x11')]);module[_0x236f('0x12')]=router; \ No newline at end of file +var _0xc3fc=['../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4f0a7d,_0x1a2052){var _0x55d9f1=function(_0x2be6bd){while(--_0x2be6bd){_0x4f0a7d['push'](_0x4f0a7d['shift']());}};_0x55d9f1(++_0x1a2052);}(_0xc3fc,0x163));var _0xcc3f=function(_0x194bdb,_0xbffaf9){_0x194bdb=_0x194bdb-0x0;var _0x59b220=_0xc3fc[_0x194bdb];return _0x59b220;};'use strict';var multer=require(_0xcc3f('0x0'));var util=require(_0xcc3f('0x1'));var path=require('path');var timeout=require(_0xcc3f('0x2'));var express=require(_0xcc3f('0x3'));var router=express[_0xcc3f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcc3f('0x5'));var interaction=require(_0xcc3f('0x6'));var config=require(_0xcc3f('0x7'));var controller=require(_0xcc3f('0x8'));router['get']('/',auth[_0xcc3f('0x9')](),controller[_0xcc3f('0xa')]);router[_0xcc3f('0xb')](_0xcc3f('0xc'),auth['isAuthenticated'](),controller[_0xcc3f('0xd')]);router['post']('/',auth[_0xcc3f('0x9')](),controller[_0xcc3f('0xe')]);router[_0xcc3f('0xf')]('/:id',auth[_0xcc3f('0x9')](),controller[_0xcc3f('0x10')]);router[_0xcc3f('0x11')](_0xcc3f('0xc'),auth[_0xcc3f('0x9')](),controller['destroy']);module[_0xcc3f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 7282976..c10988b 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 _0x3bd1=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0x3bd1,0x116));var _0x13bd=function(_0x53b3be,_0x3f1013){_0x53b3be=_0x53b3be-0x0;var _0x4f7677=_0x3bd1[_0x53b3be];return _0x4f7677;};'use strict';var Sequelize=require(_0x13bd('0x0'));module[_0x13bd('0x1')]={'type':{'type':Sequelize[_0x13bd('0x2')](_0x13bd('0x3'),'variable',_0x13bd('0x4'),_0x13bd('0x5'),_0x13bd('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x13bd('0x7')]},'key':{'type':Sequelize[_0x13bd('0x7')]},'keyType':{'type':Sequelize[_0x13bd('0x2')](_0x13bd('0x3'),_0x13bd('0x8'),_0x13bd('0x4'))},'keyContent':{'type':Sequelize[_0x13bd('0x7')]},'idField':{'type':Sequelize[_0x13bd('0x7')]},'nameField':{'type':Sequelize[_0x13bd('0x7')]},'customField':{'type':Sequelize[_0x13bd('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x13bd('0x7')]}}; \ No newline at end of file +var _0x3010=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0xe91c2f,_0x186b38){var _0x32c63c=function(_0x5a3d45){while(--_0x5a3d45){_0xe91c2f['push'](_0xe91c2f['shift']());}};_0x32c63c(++_0x186b38);}(_0x3010,0x123));var _0x0301=function(_0x565b67,_0x25d78c){_0x565b67=_0x565b67-0x0;var _0x54ba32=_0x3010[_0x565b67];return _0x54ba32;};'use strict';var Sequelize=require(_0x0301('0x0'));module[_0x0301('0x1')]={'type':{'type':Sequelize[_0x0301('0x2')](_0x0301('0x3'),'variable',_0x0301('0x4'),_0x0301('0x5'),_0x0301('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0301('0x7')]},'key':{'type':Sequelize[_0x0301('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0301('0x8'),_0x0301('0x4'))},'keyContent':{'type':Sequelize[_0x0301('0x7')]},'idField':{'type':Sequelize[_0x0301('0x7')]},'nameField':{'type':Sequelize[_0x0301('0x7')]},'customField':{'type':Sequelize[_0x0301('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0301('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 7d94874..d2a5042 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 _0x32d3=['apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ZendeskField','count','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x32d3,0xbf));var _0x332d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x32d3[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x332d('0x0'));var rimraf=require(_0x332d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x332d('0x2'));var rp=require(_0x332d('0x3'));var moment=require(_0x332d('0x4'));var BPromise=require(_0x332d('0x5'));var Mustache=require(_0x332d('0x6'));var util=require(_0x332d('0x7'));var path=require(_0x332d('0x8'));var sox=require(_0x332d('0x9'));var csv=require(_0x332d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x332d('0xb'));var _=require('lodash');var squel=require(_0x332d('0xc'));var crypto=require(_0x332d('0xd'));var jsforce=require(_0x332d('0xe'));var deskjs=require(_0x332d('0xf'));var toCsv=require(_0x332d('0xa'));var querystring=require(_0x332d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x332d('0x11'));var qs=require(_0x332d('0x12'));var as=require(_0x332d('0x13'));var hardwareService=require(_0x332d('0x14'));var logger=require(_0x332d('0x15'))('api');var utils=require(_0x332d('0x16'));var config=require(_0x332d('0x17'));var licenseUtil=require(_0x332d('0x18'));var db=require(_0x332d('0x19'))['db'];function respondWithStatusCode(_0x3cf120,_0x3a0a22){_0x3a0a22=_0x3a0a22||0xcc;return function(_0x5de395){if(_0x5de395){return _0x3cf120[_0x332d('0x1a')](_0x3a0a22);}return _0x3cf120['status'](_0x3a0a22)[_0x332d('0x1b')]();};}function respondWithResult(_0x188d3e,_0xd4152a){_0xd4152a=_0xd4152a||0xc8;return function(_0x5ecbde){if(_0x5ecbde){return _0x188d3e[_0x332d('0x1c')](_0xd4152a)[_0x332d('0x1d')](_0x5ecbde);}};}function respondWithFilteredResult(_0x37182c,_0x540941){return function(_0x3d7c65){if(_0x3d7c65){var _0x4402ff=typeof _0x540941[_0x332d('0x1e')]===_0x332d('0x1f')&&typeof _0x540941[_0x332d('0x20')]===_0x332d('0x1f');var _0x2193ad=_0x3d7c65['count'];var _0xab6015=_0x4402ff?0x0:_0x540941['offset'];var _0xd8dbe8=_0x4402ff?_0x3d7c65['count']:_0x540941[_0x332d('0x1e')]+_0x540941['limit'];var _0x1e0393;if(_0xd8dbe8>=_0x2193ad){_0xd8dbe8=_0x2193ad;_0x1e0393=0xc8;}else{_0x1e0393=0xce;}_0x37182c[_0x332d('0x1c')](_0x1e0393);return _0x37182c['set'](_0x332d('0x21'),_0xab6015+'-'+_0xd8dbe8+'/'+_0x2193ad)[_0x332d('0x1d')](_0x3d7c65);}return null;};}function patchUpdates(_0x1ac382){return function(_0x5c2a59){try{jsonpatch[_0x332d('0x22')](_0x5c2a59,_0x1ac382,!![]);}catch(_0xed49a0){return BPromise['reject'](_0xed49a0);}return _0x5c2a59['save']();};}function saveUpdates(_0x4c2076,_0x56acd9){return function(_0x3aad0e){if(_0x3aad0e){return _0x3aad0e[_0x332d('0x23')](_0x4c2076)[_0x332d('0x24')](function(_0x130648){return _0x130648;});}return null;};}function removeEntity(_0x350241,_0x451c29){return function(_0x5aa10c){if(_0x5aa10c){return _0x5aa10c[_0x332d('0x25')]()[_0x332d('0x24')](function(){_0x350241[_0x332d('0x1c')](0xcc)[_0x332d('0x1b')]();});}};}function handleEntityNotFound(_0xcc115e,_0x25ff5f){return function(_0x21c283){if(!_0x21c283){_0xcc115e[_0x332d('0x1a')](0x194);}return _0x21c283;};}function handleError(_0x8d4358,_0x22139e){_0x22139e=_0x22139e||0x1f4;return function(_0xff019b){logger[_0x332d('0x26')](_0xff019b[_0x332d('0x27')]);if(_0xff019b[_0x332d('0x28')]){delete _0xff019b[_0x332d('0x28')];}_0x8d4358[_0x332d('0x1c')](_0x22139e)[_0x332d('0x29')](_0xff019b);};}exports[_0x332d('0x2a')]=function(_0x831b59,_0x5f4304){var _0x43836a={},_0x45860a={},_0x29e1ae={'count':0x0,'rows':[]};var _0x4904d0=_[_0x332d('0x2b')](db['ZendeskField'][_0x332d('0x2c')],function(_0x1931ea){return{'name':_0x1931ea[_0x332d('0x2d')],'type':_0x1931ea[_0x332d('0x2e')]['key']};});_0x45860a[_0x332d('0x2f')]=_[_0x332d('0x2b')](_0x4904d0,_0x332d('0x28'));_0x45860a[_0x332d('0x30')]=_[_0x332d('0x31')](_0x831b59[_0x332d('0x30')]);_0x45860a[_0x332d('0x32')]=_['intersection'](_0x45860a[_0x332d('0x2f')],_0x45860a['query']);_0x43836a['attributes']=_[_0x332d('0x33')](_0x45860a[_0x332d('0x2f')],qs[_0x332d('0x34')](_0x831b59[_0x332d('0x30')][_0x332d('0x34')]));_0x43836a['attributes']=_0x43836a['attributes'][_0x332d('0x35')]?_0x43836a[_0x332d('0x36')]:_0x45860a[_0x332d('0x2f')];if(!_0x831b59[_0x332d('0x30')][_0x332d('0x37')](_0x332d('0x38'))){_0x43836a[_0x332d('0x20')]=qs['limit'](_0x831b59['query']['limit']);_0x43836a[_0x332d('0x1e')]=qs[_0x332d('0x1e')](_0x831b59[_0x332d('0x30')]['offset']);}_0x43836a['order']=qs['sort'](_0x831b59[_0x332d('0x30')][_0x332d('0x39')]);_0x43836a[_0x332d('0x3a')]=qs[_0x332d('0x32')](_[_0x332d('0x3b')](_0x831b59[_0x332d('0x30')],_0x45860a['filters']),_0x4904d0);if(_0x831b59['query'][_0x332d('0x3c')]){_0x43836a[_0x332d('0x3a')]=_['merge'](_0x43836a[_0x332d('0x3a')],{'$or':_[_0x332d('0x2b')](_0x4904d0,function(_0x385673){if(_0x385673['type']!==_0x332d('0x3d')){var _0x1cb44c={};_0x1cb44c[_0x385673[_0x332d('0x28')]]={'$like':'%'+_0x831b59[_0x332d('0x30')][_0x332d('0x3c')]+'%'};return _0x1cb44c;}})});}_0x43836a=_[_0x332d('0x3e')]({},_0x43836a,_0x831b59[_0x332d('0x3f')]);var _0x3b8ae0={'where':_0x43836a['where']};return db[_0x332d('0x40')][_0x332d('0x41')](_0x3b8ae0)[_0x332d('0x24')](function(_0x235e75){_0x29e1ae[_0x332d('0x41')]=_0x235e75;if(_0x831b59['query'][_0x332d('0x42')]){_0x43836a[_0x332d('0x43')]=[{'all':!![]}];}return db[_0x332d('0x40')][_0x332d('0x44')](_0x43836a);})[_0x332d('0x24')](function(_0x116f9e){_0x29e1ae['rows']=_0x116f9e;return _0x29e1ae;})[_0x332d('0x24')](respondWithFilteredResult(_0x5f4304,_0x43836a))[_0x332d('0x45')](handleError(_0x5f4304,null));};exports[_0x332d('0x46')]=function(_0x524240,_0x227f33){var _0x9320ad={'raw':!![],'where':{'id':_0x524240[_0x332d('0x47')]['id']}},_0x35e002={};_0x35e002['model']=_[_0x332d('0x31')](db[_0x332d('0x40')]['rawAttributes']);_0x35e002[_0x332d('0x30')]=_[_0x332d('0x31')](_0x524240[_0x332d('0x30')]);_0x35e002['filters']=_[_0x332d('0x33')](_0x35e002[_0x332d('0x2f')],_0x35e002['query']);_0x9320ad['attributes']=_[_0x332d('0x33')](_0x35e002[_0x332d('0x2f')],qs[_0x332d('0x34')](_0x524240[_0x332d('0x30')][_0x332d('0x34')]));_0x9320ad[_0x332d('0x36')]=_0x9320ad[_0x332d('0x36')][_0x332d('0x35')]?_0x9320ad[_0x332d('0x36')]:_0x35e002['model'];if(_0x524240[_0x332d('0x30')][_0x332d('0x42')]){_0x9320ad[_0x332d('0x43')]=[{'all':!![]}];}_0x9320ad=_[_0x332d('0x3e')]({},_0x9320ad,_0x524240[_0x332d('0x3f')]);return db[_0x332d('0x40')][_0x332d('0x48')](_0x9320ad)[_0x332d('0x24')](handleEntityNotFound(_0x227f33,null))[_0x332d('0x24')](respondWithResult(_0x227f33,null))[_0x332d('0x45')](handleError(_0x227f33,null));};exports[_0x332d('0x49')]=function(_0x1221a3,_0x488743){return db['ZendeskField'][_0x332d('0x49')](_0x1221a3[_0x332d('0x4a')],{})[_0x332d('0x24')](respondWithResult(_0x488743,0xc9))[_0x332d('0x45')](handleError(_0x488743,null));};exports[_0x332d('0x23')]=function(_0xcd025d,_0x5a0576){if(_0xcd025d[_0x332d('0x4a')]['id']){delete _0xcd025d[_0x332d('0x4a')]['id'];}return db[_0x332d('0x40')][_0x332d('0x48')]({'where':{'id':_0xcd025d['params']['id']}})['then'](handleEntityNotFound(_0x5a0576,null))[_0x332d('0x24')](saveUpdates(_0xcd025d['body'],null))[_0x332d('0x24')](respondWithResult(_0x5a0576,null))[_0x332d('0x45')](handleError(_0x5a0576,null));};exports[_0x332d('0x25')]=function(_0x1f4fe7,_0x72accc){return db[_0x332d('0x40')][_0x332d('0x48')]({'where':{'id':_0x1f4fe7[_0x332d('0x47')]['id']}})['then'](handleEntityNotFound(_0x72accc,null))[_0x332d('0x24')](removeEntity(_0x72accc,null))['catch'](handleError(_0x72accc,null));}; \ No newline at end of file +var _0x846f=['body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','reject','then','destroy','end','sendStatus','error','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','find','create'];(function(_0x321008,_0x3c121e){var _0x4e569d=function(_0x555e52){while(--_0x555e52){_0x321008['push'](_0x321008['shift']());}};_0x4e569d(++_0x3c121e);}(_0x846f,0x93));var _0xf846=function(_0x37a53d,_0x3d92c0){_0x37a53d=_0x37a53d-0x0;var _0x41f7da=_0x846f[_0x37a53d];return _0x41f7da;};'use strict';var emlformat=require(_0xf846('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf846('0x1'));var jsonpatch=require(_0xf846('0x2'));var rp=require(_0xf846('0x3'));var moment=require('moment');var BPromise=require(_0xf846('0x4'));var Mustache=require(_0xf846('0x5'));var util=require(_0xf846('0x6'));var path=require(_0xf846('0x7'));var sox=require(_0xf846('0x8'));var csv=require('to-csv');var ejs=require(_0xf846('0x9'));var fs=require('fs');var fs_extra=require(_0xf846('0xa'));var _=require(_0xf846('0xb'));var squel=require(_0xf846('0xc'));var crypto=require(_0xf846('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf846('0xe'));var querystring=require(_0xf846('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf846('0x10'));var hardwareService=require(_0xf846('0x11'));var logger=require('../../config/logger')(_0xf846('0x12'));var utils=require(_0xf846('0x13'));var config=require(_0xf846('0x14'));var licenseUtil=require(_0xf846('0x15'));var db=require(_0xf846('0x16'))['db'];function respondWithStatusCode(_0x28e634,_0x55ddb1){_0x55ddb1=_0x55ddb1||0xcc;return function(_0x145449){if(_0x145449){return _0x28e634['sendStatus'](_0x55ddb1);}return _0x28e634['status'](_0x55ddb1)['end']();};}function respondWithResult(_0x81f7cd,_0xc3d1ef){_0xc3d1ef=_0xc3d1ef||0xc8;return function(_0x5b9f9e){if(_0x5b9f9e){return _0x81f7cd[_0xf846('0x17')](_0xc3d1ef)['json'](_0x5b9f9e);}};}function respondWithFilteredResult(_0x548fbf,_0x4cb115){return function(_0x59fe82){if(_0x59fe82){var _0x1e3c2b=typeof _0x4cb115[_0xf846('0x18')]===_0xf846('0x19')&&typeof _0x4cb115[_0xf846('0x1a')]===_0xf846('0x19');var _0x578e61=_0x59fe82['count'];var _0x231dd1=_0x1e3c2b?0x0:_0x4cb115['offset'];var _0x716f7d=_0x1e3c2b?_0x59fe82['count']:_0x4cb115[_0xf846('0x18')]+_0x4cb115['limit'];var _0x20e95e;if(_0x716f7d>=_0x578e61){_0x716f7d=_0x578e61;_0x20e95e=0xc8;}else{_0x20e95e=0xce;}_0x548fbf[_0xf846('0x17')](_0x20e95e);return _0x548fbf[_0xf846('0x1b')](_0xf846('0x1c'),_0x231dd1+'-'+_0x716f7d+'/'+_0x578e61)[_0xf846('0x1d')](_0x59fe82);}return null;};}function patchUpdates(_0x26a976){return function(_0x48d276){try{jsonpatch['apply'](_0x48d276,_0x26a976,!![]);}catch(_0x50f244){return BPromise[_0xf846('0x1e')](_0x50f244);}return _0x48d276['save']();};}function saveUpdates(_0x300e11,_0x17e4fa){return function(_0x5c2e05){if(_0x5c2e05){return _0x5c2e05['update'](_0x300e11)[_0xf846('0x1f')](function(_0x123d2d){return _0x123d2d;});}return null;};}function removeEntity(_0x32a00d,_0x5d18a9){return function(_0xe2dfa2){if(_0xe2dfa2){return _0xe2dfa2[_0xf846('0x20')]()[_0xf846('0x1f')](function(){_0x32a00d['status'](0xcc)[_0xf846('0x21')]();});}};}function handleEntityNotFound(_0x51e458,_0x1d8dc4){return function(_0x19602a){if(!_0x19602a){_0x51e458[_0xf846('0x22')](0x194);}return _0x19602a;};}function handleError(_0x58e045,_0x11ac05){_0x11ac05=_0x11ac05||0x1f4;return function(_0x575ddb){logger[_0xf846('0x23')](_0x575ddb['stack']);if(_0x575ddb[_0xf846('0x24')]){delete _0x575ddb[_0xf846('0x24')];}_0x58e045['status'](_0x11ac05)[_0xf846('0x25')](_0x575ddb);};}exports[_0xf846('0x26')]=function(_0x4f756a,_0x1ffdff){var _0x4b3629={},_0x3e49f5={},_0x367981={'count':0x0,'rows':[]};var _0x3dda7e=_['map'](db[_0xf846('0x27')][_0xf846('0x28')],function(_0x1dbdab){return{'name':_0x1dbdab[_0xf846('0x29')],'type':_0x1dbdab[_0xf846('0x2a')][_0xf846('0x2b')]};});_0x3e49f5['model']=_[_0xf846('0x2c')](_0x3dda7e,_0xf846('0x24'));_0x3e49f5[_0xf846('0x2d')]=_[_0xf846('0x2e')](_0x4f756a[_0xf846('0x2d')]);_0x3e49f5[_0xf846('0x2f')]=_[_0xf846('0x30')](_0x3e49f5[_0xf846('0x31')],_0x3e49f5['query']);_0x4b3629['attributes']=_[_0xf846('0x30')](_0x3e49f5['model'],qs['fields'](_0x4f756a[_0xf846('0x2d')][_0xf846('0x32')]));_0x4b3629['attributes']=_0x4b3629[_0xf846('0x33')][_0xf846('0x34')]?_0x4b3629[_0xf846('0x33')]:_0x3e49f5[_0xf846('0x31')];if(!_0x4f756a[_0xf846('0x2d')][_0xf846('0x35')]('nolimit')){_0x4b3629['limit']=qs[_0xf846('0x1a')](_0x4f756a[_0xf846('0x2d')][_0xf846('0x1a')]);_0x4b3629['offset']=qs['offset'](_0x4f756a[_0xf846('0x2d')][_0xf846('0x18')]);}_0x4b3629[_0xf846('0x36')]=qs[_0xf846('0x37')](_0x4f756a[_0xf846('0x2d')]['sort']);_0x4b3629[_0xf846('0x38')]=qs[_0xf846('0x2f')](_[_0xf846('0x39')](_0x4f756a['query'],_0x3e49f5[_0xf846('0x2f')]),_0x3dda7e);if(_0x4f756a[_0xf846('0x2d')][_0xf846('0x3a')]){_0x4b3629[_0xf846('0x38')]=_[_0xf846('0x3b')](_0x4b3629[_0xf846('0x38')],{'$or':_[_0xf846('0x2c')](_0x3dda7e,function(_0x181387){if(_0x181387[_0xf846('0x2a')]!==_0xf846('0x3c')){var _0x4bce39={};_0x4bce39[_0x181387[_0xf846('0x24')]]={'$like':'%'+_0x4f756a[_0xf846('0x2d')][_0xf846('0x3a')]+'%'};return _0x4bce39;}})});}_0x4b3629=_[_0xf846('0x3b')]({},_0x4b3629,_0x4f756a['options']);var _0x3085e9={'where':_0x4b3629[_0xf846('0x38')]};return db[_0xf846('0x27')][_0xf846('0x3d')](_0x3085e9)[_0xf846('0x1f')](function(_0x39fd69){_0x367981[_0xf846('0x3d')]=_0x39fd69;if(_0x4f756a[_0xf846('0x2d')][_0xf846('0x3e')]){_0x4b3629[_0xf846('0x3f')]=[{'all':!![]}];}return db[_0xf846('0x27')]['findAll'](_0x4b3629);})['then'](function(_0x187e01){_0x367981[_0xf846('0x40')]=_0x187e01;return _0x367981;})['then'](respondWithFilteredResult(_0x1ffdff,_0x4b3629))[_0xf846('0x41')](handleError(_0x1ffdff,null));};exports[_0xf846('0x42')]=function(_0x5edd68,_0xbf92a6){var _0x6fa310={'raw':!![],'where':{'id':_0x5edd68['params']['id']}},_0x36cc3b={};_0x36cc3b[_0xf846('0x31')]=_[_0xf846('0x2e')](db[_0xf846('0x27')][_0xf846('0x28')]);_0x36cc3b['query']=_[_0xf846('0x2e')](_0x5edd68['query']);_0x36cc3b['filters']=_[_0xf846('0x30')](_0x36cc3b[_0xf846('0x31')],_0x36cc3b['query']);_0x6fa310[_0xf846('0x33')]=_['intersection'](_0x36cc3b[_0xf846('0x31')],qs[_0xf846('0x32')](_0x5edd68[_0xf846('0x2d')]['fields']));_0x6fa310[_0xf846('0x33')]=_0x6fa310['attributes'][_0xf846('0x34')]?_0x6fa310[_0xf846('0x33')]:_0x36cc3b[_0xf846('0x31')];if(_0x5edd68[_0xf846('0x2d')]['includeAll']){_0x6fa310[_0xf846('0x3f')]=[{'all':!![]}];}_0x6fa310=_[_0xf846('0x3b')]({},_0x6fa310,_0x5edd68['options']);return db['ZendeskField'][_0xf846('0x43')](_0x6fa310)['then'](handleEntityNotFound(_0xbf92a6,null))['then'](respondWithResult(_0xbf92a6,null))['catch'](handleError(_0xbf92a6,null));};exports['create']=function(_0x43a4f5,_0x5b6427){return db[_0xf846('0x27')][_0xf846('0x44')](_0x43a4f5[_0xf846('0x45')],{})[_0xf846('0x1f')](respondWithResult(_0x5b6427,0xc9))['catch'](handleError(_0x5b6427,null));};exports[_0xf846('0x46')]=function(_0x44cfb8,_0x271afc){if(_0x44cfb8['body']['id']){delete _0x44cfb8['body']['id'];}return db[_0xf846('0x27')][_0xf846('0x43')]({'where':{'id':_0x44cfb8[_0xf846('0x47')]['id']}})[_0xf846('0x1f')](handleEntityNotFound(_0x271afc,null))[_0xf846('0x1f')](saveUpdates(_0x44cfb8[_0xf846('0x45')],null))[_0xf846('0x1f')](respondWithResult(_0x271afc,null))[_0xf846('0x41')](handleError(_0x271afc,null));};exports[_0xf846('0x20')]=function(_0x17df95,_0x30e072){return db['ZendeskField'][_0xf846('0x43')]({'where':{'id':_0x17df95['params']['id']}})[_0xf846('0x1f')](handleEntityNotFound(_0x30e072,null))['then'](removeEntity(_0x30e072,null))[_0xf846('0x41')](handleError(_0x30e072,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8b3c961..ab8304c 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 _0xdbb0=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','ZendeskField','zendesk_unique_index','idField','FieldId'];(function(_0x423797,_0x3d393b){var _0x57ec0c=function(_0x24c145){while(--_0x24c145){_0x423797['push'](_0x423797['shift']());}};_0x57ec0c(++_0x3d393b);}(_0xdbb0,0x1ad));var _0x0dbb=function(_0x47b295,_0x4120bb){_0x47b295=_0x47b295-0x0;var _0x29003c=_0xdbb0[_0x47b295];return _0x29003c;};'use strict';var _=require(_0x0dbb('0x0'));var util=require(_0x0dbb('0x1'));var logger=require('../../config/logger')(_0x0dbb('0x2'));var moment=require(_0x0dbb('0x3'));var BPromise=require(_0x0dbb('0x4'));var rp=require(_0x0dbb('0x5'));var fs=require('fs');var path=require(_0x0dbb('0x6'));var rimraf=require('rimraf');var config=require(_0x0dbb('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x0dbb('0x8')]=function(_0x56ba47,_0x2c3220){return _0x56ba47['define'](_0x0dbb('0x9'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x0dbb('0xa'),'fields':[_0x0dbb('0xb'),_0x0dbb('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0bed=['./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5b1a3e,_0xb3967b){var _0x193aa2=function(_0x2d0ca6){while(--_0x2d0ca6){_0x5b1a3e['push'](_0x5b1a3e['shift']());}};_0x193aa2(++_0xb3967b);}(_0x0bed,0xb6));var _0xd0be=function(_0x100ad3,_0x1e560a){_0x100ad3=_0x100ad3-0x0;var _0x96040e=_0x0bed[_0x100ad3];return _0x96040e;};'use strict';var _=require(_0xd0be('0x0'));var util=require(_0xd0be('0x1'));var logger=require(_0xd0be('0x2'))(_0xd0be('0x3'));var moment=require(_0xd0be('0x4'));var BPromise=require(_0xd0be('0x5'));var rp=require(_0xd0be('0x6'));var fs=require('fs');var path=require(_0xd0be('0x7'));var rimraf=require(_0xd0be('0x8'));var config=require(_0xd0be('0x9'));var attributes=require(_0xd0be('0xa'));module['exports']=function(_0x4215a1,_0x36eb88){return _0x4215a1[_0xd0be('0xb')]('ZendeskField',attributes,{'tableName':_0xd0be('0xc'),'paranoid':![],'indexes':[{'name':_0xd0be('0xd'),'fields':[_0xd0be('0xe'),_0xd0be('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 2e6dc6c..0acf3bb 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 _0x793e=['../../config/environment','jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0x793e,0x81));var _0xe793=function(_0x182fff,_0x568aee){_0x182fff=_0x182fff-0x0;var _0x1b4171=_0x793e[_0x182fff];return _0x1b4171;};'use strict';var _=require('lodash');var util=require(_0xe793('0x0'));var moment=require(_0xe793('0x1'));var BPromise=require(_0xe793('0x2'));var rs=require(_0xe793('0x3'));var fs=require('fs');var Redis=require(_0xe793('0x4'));var db=require(_0xe793('0x5'))['db'];var utils=require(_0xe793('0x6'));var logger=require(_0xe793('0x7'))(_0xe793('0x8'));var config=require(_0xe793('0x9'));var jayson=require(_0xe793('0xa'));var client=jayson[_0xe793('0xb')][_0xe793('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14f662,_0x4c2521,_0x464188){return new BPromise(function(_0x44e6a4,_0x459084){return client['request'](_0x14f662,_0x464188)['then'](function(_0x338019){logger[_0xe793('0xd')](_0xe793('0xe'),_0x4c2521,_0xe793('0xf'));logger[_0xe793('0x10')](_0xe793('0x11'),_0x4c2521,'request\x20sent',JSON[_0xe793('0x12')](_0x338019));if(_0x338019[_0xe793('0x13')]){if(_0x338019['error'][_0xe793('0x14')]===0x1f4){logger[_0xe793('0x13')](_0xe793('0xe'),_0x4c2521,_0x338019[_0xe793('0x13')][_0xe793('0x15')]);return _0x459084(_0x338019[_0xe793('0x13')]['message']);}logger[_0xe793('0x13')](_0xe793('0xe'),_0x4c2521,_0x338019[_0xe793('0x13')][_0xe793('0x15')]);return _0x44e6a4(_0x338019[_0xe793('0x13')][_0xe793('0x15')]);}else{logger[_0xe793('0xd')](_0xe793('0xe'),_0x4c2521,_0xe793('0xf'));_0x44e6a4(_0x338019[_0xe793('0x16')][_0xe793('0x15')]);}})['catch'](function(_0x437da4){logger['error'](_0xe793('0xe'),_0x4c2521,_0x437da4);_0x459084(_0x437da4);});});} \ No newline at end of file +var _0x74c3=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x74c3,0x1bc));var _0x374c=function(_0x3a37f0,_0x2bb0d8){_0x3a37f0=_0x3a37f0-0x0;var _0x380e06=_0x74c3[_0x3a37f0];return _0x380e06;};'use strict';var _=require(_0x374c('0x0'));var util=require('util');var moment=require(_0x374c('0x1'));var BPromise=require(_0x374c('0x2'));var rs=require(_0x374c('0x3'));var fs=require('fs');var Redis=require(_0x374c('0x4'));var db=require(_0x374c('0x5'))['db'];var utils=require(_0x374c('0x6'));var logger=require(_0x374c('0x7'))(_0x374c('0x8'));var config=require('../../config/environment');var jayson=require(_0x374c('0x9'));var client=jayson[_0x374c('0xa')][_0x374c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0fc7,_0x2b4a9d,_0x51dedc){return new BPromise(function(_0x45a68b,_0x2bda90){return client['request'](_0x4b0fc7,_0x51dedc)['then'](function(_0x124313){logger[_0x374c('0xc')](_0x374c('0xd'),_0x2b4a9d,_0x374c('0xe'));logger['debug'](_0x374c('0xf'),_0x2b4a9d,_0x374c('0xe'),JSON['stringify'](_0x124313));if(_0x124313[_0x374c('0x10')]){if(_0x124313['error']['code']===0x1f4){logger['error'](_0x374c('0xd'),_0x2b4a9d,_0x124313['error']['message']);return _0x2bda90(_0x124313[_0x374c('0x10')]['message']);}logger['error'](_0x374c('0xd'),_0x2b4a9d,_0x124313[_0x374c('0x10')][_0x374c('0x11')]);return _0x45a68b(_0x124313[_0x374c('0x10')][_0x374c('0x11')]);}else{logger[_0x374c('0xc')](_0x374c('0xd'),_0x2b4a9d,'request\x20sent');_0x45a68b(_0x124313['result'][_0x374c('0x11')]);}})[_0x374c('0x12')](function(_0x18b961){logger['error'](_0x374c('0xd'),_0x2b4a9d,_0x18b961);_0x2bda90(_0x18b961);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 82c7a99..dd4d555 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 _0xa43d=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','/:id','destroy'];(function(_0x275746,_0x37c6ed){var _0x5f1900=function(_0x2a6555){while(--_0x2a6555){_0x275746['push'](_0x275746['shift']());}};_0x5f1900(++_0x37c6ed);}(_0xa43d,0x159));var _0xda43=function(_0x45943c,_0x292e90){_0x45943c=_0x45943c-0x0;var _0xe1cf98=_0xa43d[_0x45943c];return _0xe1cf98;};'use strict';var multer=require(_0xda43('0x0'));var util=require(_0xda43('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xda43('0x2'));var router=express['Router']();var fs_extra=require(_0xda43('0x3'));var auth=require(_0xda43('0x4'));var interaction=require(_0xda43('0x5'));var config=require(_0xda43('0x6'));var controller=require(_0xda43('0x7'));router[_0xda43('0x8')]('/',auth[_0xda43('0x9')](),controller[_0xda43('0xa')]);router[_0xda43('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xda43('0x8')](_0xda43('0xb'),auth['isAuthenticated'](),controller[_0xda43('0xc')]);router[_0xda43('0x8')](_0xda43('0xd'),auth[_0xda43('0x9')](),controller[_0xda43('0xe')]);router[_0xda43('0xf')]('/',auth[_0xda43('0x9')](),controller[_0xda43('0x10')]);router[_0xda43('0xf')](_0xda43('0xb'),auth['isAuthenticated'](),controller[_0xda43('0x11')]);router[_0xda43('0x12')]('/:id',auth[_0xda43('0x9')](),controller[_0xda43('0x13')]);router[_0xda43('0x14')](_0xda43('0x15'),auth['isAuthenticated'](),controller[_0xda43('0x16')]);module['exports']=router; \ No newline at end of file +var _0x98b7=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','post','/:id/configurations','put','update','delete'];(function(_0x44c61e,_0xa02775){var _0x1dcf3f=function(_0x38e153){while(--_0x38e153){_0x44c61e['push'](_0x44c61e['shift']());}};_0x1dcf3f(++_0xa02775);}(_0x98b7,0x1a6));var _0x798b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x98b7[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x798b('0x0'));var util=require(_0x798b('0x1'));var path=require(_0x798b('0x2'));var timeout=require(_0x798b('0x3'));var express=require('express');var router=express[_0x798b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x798b('0x5'));var interaction=require(_0x798b('0x6'));var config=require(_0x798b('0x7'));var controller=require('./intZohoAccount.controller');router[_0x798b('0x8')]('/',auth[_0x798b('0x9')](),controller[_0x798b('0xa')]);router[_0x798b('0x8')](_0x798b('0xb'),auth[_0x798b('0x9')](),controller[_0x798b('0xc')]);router[_0x798b('0x8')]('/:id/configurations',auth[_0x798b('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x798b('0x9')](),controller[_0x798b('0xd')]);router[_0x798b('0xe')]('/',auth[_0x798b('0x9')](),controller['create']);router['post'](_0x798b('0xf'),auth[_0x798b('0x9')](),controller['addConfiguration']);router[_0x798b('0x10')]('/:id',auth[_0x798b('0x9')](),controller[_0x798b('0x11')]);router[_0x798b('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x798b('0x13')]);module[_0x798b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 7e88156..b3f3b76 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 _0x17ba=['sequelize','exports','STRING'];(function(_0x332109,_0x474add){var _0x7a6ab2=function(_0x5132dd){while(--_0x5132dd){_0x332109['push'](_0x332109['shift']());}};_0x7a6ab2(++_0x474add);}(_0x17ba,0xab));var _0xa17b=function(_0x529c00,_0x298516){_0x529c00=_0x529c00-0x0;var _0x10bbf7=_0x17ba[_0x529c00];return _0x10bbf7;};'use strict';var Sequelize=require(_0xa17b('0x0'));module[_0xa17b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa17b('0x2')]},'host':{'type':Sequelize[_0xa17b('0x2')]},'zone':{'type':Sequelize[_0xa17b('0x2')]},'clientId':{'type':Sequelize[_0xa17b('0x2')]},'clientSecret':{'type':Sequelize[_0xa17b('0x2')]},'serverUrl':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xa17b('0x2')]},'refreshToken':{'type':Sequelize[_0xa17b('0x2')]}}; \ No newline at end of file +var _0x5ff3=['STRING','exports'];(function(_0x59e4fe,_0x416bba){var _0x4591da=function(_0x17c6d7){while(--_0x17c6d7){_0x59e4fe['push'](_0x59e4fe['shift']());}};_0x4591da(++_0x416bba);}(_0x5ff3,0x17d));var _0x35ff=function(_0xd0a872,_0x55e1be){_0xd0a872=_0xd0a872-0x0;var _0x5c28d6=_0x5ff3[_0xd0a872];return _0x5c28d6;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35ff('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x35ff('0x1')]},'clientId':{'type':Sequelize[_0x35ff('0x1')]},'clientSecret':{'type':Sequelize[_0x35ff('0x1')]},'serverUrl':{'type':Sequelize[_0x35ff('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x35ff('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 7b0d774..6f00ae2 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 _0x4965=['end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','filter','merge','options','include','ZohoAccount','findAll','rows','params','keys','length','includeAll','find','catch','create','body','destroy','getConfigurations','ZohoConfiguration','order','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x2dc201,_0x4d6980){var _0xfc06b2=function(_0xade7fc){while(--_0xade7fc){_0x2dc201['push'](_0x2dc201['shift']());}};_0xfc06b2(++_0x4d6980);}(_0x4965,0x16e));var _0x5496=function(_0x303310,_0x3d6211){_0x303310=_0x303310-0x0;var _0x1e4370=_0x4965[_0x303310];return _0x1e4370;};'use strict';var emlformat=require(_0x5496('0x0'));var rimraf=require(_0x5496('0x1'));var zipdir=require(_0x5496('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5496('0x3'));var Mustache=require('mustache');var util=require(_0x5496('0x4'));var path=require(_0x5496('0x5'));var sox=require(_0x5496('0x6'));var csv=require('to-csv');var ejs=require(_0x5496('0x7'));var fs=require('fs');var fs_extra=require(_0x5496('0x8'));var _=require(_0x5496('0x9'));var squel=require(_0x5496('0xa'));var crypto=require('crypto');var jsforce=require(_0x5496('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5496('0xc'));var querystring=require(_0x5496('0xd'));var Papa=require(_0x5496('0xe'));var Redis=require('ioredis');var authService=require(_0x5496('0xf'));var qs=require(_0x5496('0x10'));var as=require(_0x5496('0x11'));var hardwareService=require(_0x5496('0x12'));var logger=require(_0x5496('0x13'))(_0x5496('0x14'));var utils=require(_0x5496('0x15'));var config=require(_0x5496('0x16'));var licenseUtil=require(_0x5496('0x17'));var db=require(_0x5496('0x18'))['db'];var integrations=require(_0x5496('0x19'));function respondWithStatusCode(_0x3a7353,_0x39f846){_0x39f846=_0x39f846||0xcc;return function(_0x45c7fb){if(_0x45c7fb){return _0x3a7353[_0x5496('0x1a')](_0x39f846);}return _0x3a7353['status'](_0x39f846)[_0x5496('0x1b')]();};}function respondWithResult(_0x3b6d0f,_0x27072e){_0x27072e=_0x27072e||0xc8;return function(_0x35520e){if(_0x35520e){return _0x3b6d0f[_0x5496('0x1c')](_0x27072e)[_0x5496('0x1d')](_0x35520e);}};}function respondWithFilteredResult(_0xe68124,_0x2f746c){return function(_0x4c7317){if(_0x4c7317){var _0x4bf295=typeof _0x2f746c[_0x5496('0x1e')]===_0x5496('0x1f')&&typeof _0x2f746c[_0x5496('0x20')]===_0x5496('0x1f');var _0x333c6d=_0x4c7317[_0x5496('0x21')];var _0x165c58=_0x4bf295?0x0:_0x2f746c[_0x5496('0x1e')];var _0x11beb8=_0x4bf295?_0x4c7317['count']:_0x2f746c['offset']+_0x2f746c[_0x5496('0x20')];var _0x1258f8;if(_0x11beb8>=_0x333c6d){_0x11beb8=_0x333c6d;_0x1258f8=0xc8;}else{_0x1258f8=0xce;}_0xe68124[_0x5496('0x1c')](_0x1258f8);return _0xe68124[_0x5496('0x22')]('Content-Range',_0x165c58+'-'+_0x11beb8+'/'+_0x333c6d)[_0x5496('0x1d')](_0x4c7317);}return null;};}function patchUpdates(_0x2df542){return function(_0x58b5a2){try{jsonpatch[_0x5496('0x23')](_0x58b5a2,_0x2df542,!![]);}catch(_0x2435fb){return BPromise[_0x5496('0x24')](_0x2435fb);}return _0x58b5a2[_0x5496('0x25')]();};}function saveUpdates(_0x23bd12,_0x408716){return function(_0x25a988){if(_0x25a988){return _0x25a988[_0x5496('0x26')](_0x23bd12)[_0x5496('0x27')](function(_0x203876){return _0x203876;});}return null;};}function removeEntity(_0x394551,_0x1ab3ca){return function(_0x385134){if(_0x385134){return _0x385134['destroy']()[_0x5496('0x27')](function(){_0x394551['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bce20,_0xc6e98b){return function(_0x409d64){if(!_0x409d64){_0x4bce20[_0x5496('0x1a')](0x194);}return _0x409d64;};}function handleError(_0x2a5e6b,_0x21bad5){_0x21bad5=_0x21bad5||0x1f4;return function(_0x3253aa){logger[_0x5496('0x28')](_0x3253aa[_0x5496('0x29')]);if(_0x3253aa[_0x5496('0x2a')]){delete _0x3253aa[_0x5496('0x2a')];}_0x2a5e6b['status'](_0x21bad5)[_0x5496('0x2b')](_0x3253aa);};}exports[_0x5496('0x2c')]=function(_0x519bd7,_0x802f78){var _0x1ff1a0={},_0x119a56={},_0x47dfa7={'count':0x0,'rows':[]};var _0x57358c=_['map'](db['ZohoAccount'][_0x5496('0x2d')],function(_0x36a421){return{'name':_0x36a421[_0x5496('0x2e')],'type':_0x36a421[_0x5496('0x2f')][_0x5496('0x30')]};});_0x119a56[_0x5496('0x31')]=_['map'](_0x57358c,_0x5496('0x2a'));_0x119a56[_0x5496('0x32')]=_['keys'](_0x519bd7[_0x5496('0x32')]);_0x119a56[_0x5496('0x33')]=_[_0x5496('0x34')](_0x119a56[_0x5496('0x31')],_0x119a56['query']);_0x1ff1a0['attributes']=_[_0x5496('0x34')](_0x119a56[_0x5496('0x31')],qs[_0x5496('0x35')](_0x519bd7[_0x5496('0x32')][_0x5496('0x35')]));_0x1ff1a0[_0x5496('0x36')]=_0x1ff1a0[_0x5496('0x36')]['length']?_0x1ff1a0['attributes']:_0x119a56[_0x5496('0x31')];if(!_0x519bd7['query'][_0x5496('0x37')](_0x5496('0x38'))){_0x1ff1a0[_0x5496('0x20')]=qs[_0x5496('0x20')](_0x519bd7[_0x5496('0x32')]['limit']);_0x1ff1a0[_0x5496('0x1e')]=qs['offset'](_0x519bd7[_0x5496('0x32')][_0x5496('0x1e')]);}_0x1ff1a0['order']=qs[_0x5496('0x39')](_0x519bd7[_0x5496('0x32')]['sort']);_0x1ff1a0[_0x5496('0x3a')]=qs[_0x5496('0x33')](_[_0x5496('0x3b')](_0x519bd7[_0x5496('0x32')],_0x119a56['filters']),_0x57358c);if(_0x519bd7['query']['filter']){_0x1ff1a0[_0x5496('0x3a')]=_['merge'](_0x1ff1a0['where'],{'$or':_[_0x5496('0x3c')](_0x57358c,function(_0x265b6d){if(_0x265b6d['type']!==_0x5496('0x3d')){var _0x2426b8={};_0x2426b8[_0x265b6d['name']]={'$like':'%'+_0x519bd7[_0x5496('0x32')][_0x5496('0x3e')]+'%'};return _0x2426b8;}})});}_0x1ff1a0=_[_0x5496('0x3f')]({},_0x1ff1a0,_0x519bd7[_0x5496('0x40')]);var _0x1af21b={'where':_0x1ff1a0['where']};return db['ZohoAccount'][_0x5496('0x21')](_0x1af21b)[_0x5496('0x27')](function(_0x4dffd2){_0x47dfa7[_0x5496('0x21')]=_0x4dffd2;if(_0x519bd7[_0x5496('0x32')]['includeAll']){_0x1ff1a0[_0x5496('0x41')]=[{'all':!![]}];}return db[_0x5496('0x42')][_0x5496('0x43')](_0x1ff1a0);})[_0x5496('0x27')](function(_0x47088c){_0x47dfa7[_0x5496('0x44')]=_0x47088c;return _0x47dfa7;})[_0x5496('0x27')](respondWithFilteredResult(_0x802f78,_0x1ff1a0))['catch'](handleError(_0x802f78,null));};exports['show']=function(_0x3cc798,_0x4314b1){var _0x4a9701={'raw':![],'where':{'id':_0x3cc798[_0x5496('0x45')]['id']}},_0x3bc507={};_0x3bc507[_0x5496('0x31')]=_[_0x5496('0x46')](db[_0x5496('0x42')][_0x5496('0x2d')]);_0x3bc507[_0x5496('0x32')]=_[_0x5496('0x46')](_0x3cc798['query']);_0x3bc507[_0x5496('0x33')]=_[_0x5496('0x34')](_0x3bc507[_0x5496('0x31')],_0x3bc507[_0x5496('0x32')]);_0x4a9701[_0x5496('0x36')]=_[_0x5496('0x34')](_0x3bc507[_0x5496('0x31')],qs['fields'](_0x3cc798['query'][_0x5496('0x35')]));_0x4a9701[_0x5496('0x36')]=_0x4a9701[_0x5496('0x36')][_0x5496('0x47')]?_0x4a9701['attributes']:_0x3bc507[_0x5496('0x31')];if(_0x3cc798[_0x5496('0x32')][_0x5496('0x48')]){_0x4a9701['include']=[{'all':!![]}];}_0x4a9701=_[_0x5496('0x3f')]({},_0x4a9701,_0x3cc798[_0x5496('0x40')]);return db[_0x5496('0x42')][_0x5496('0x49')](_0x4a9701)[_0x5496('0x27')](handleEntityNotFound(_0x4314b1,null))[_0x5496('0x27')](respondWithResult(_0x4314b1,null))[_0x5496('0x4a')](handleError(_0x4314b1,null));};exports[_0x5496('0x4b')]=function(_0x3d79e0,_0x429632){return db['ZohoAccount'][_0x5496('0x4b')](_0x3d79e0[_0x5496('0x4c')],{})[_0x5496('0x27')](respondWithResult(_0x429632,0xc9))[_0x5496('0x4a')](handleError(_0x429632,null));};exports[_0x5496('0x26')]=function(_0x36be2b,_0x15fbde){if(_0x36be2b[_0x5496('0x4c')]['id']){delete _0x36be2b['body']['id'];}return db['ZohoAccount'][_0x5496('0x49')]({'where':{'id':_0x36be2b[_0x5496('0x45')]['id']}})[_0x5496('0x27')](handleEntityNotFound(_0x15fbde,null))[_0x5496('0x27')](saveUpdates(_0x36be2b['body'],null))[_0x5496('0x27')](respondWithResult(_0x15fbde,null))[_0x5496('0x4a')](handleError(_0x15fbde,null));};exports[_0x5496('0x4d')]=function(_0x2225df,_0x395e94){return db[_0x5496('0x42')][_0x5496('0x49')]({'where':{'id':_0x2225df[_0x5496('0x45')]['id']}})[_0x5496('0x27')](handleEntityNotFound(_0x395e94,null))[_0x5496('0x27')](removeEntity(_0x395e94,null))[_0x5496('0x4a')](handleError(_0x395e94,null));};exports[_0x5496('0x4e')]=function(_0x5df52b,_0x12e603,_0x383be3){var _0x16486f={};var _0x356109={};var _0xbde23e;var _0x43268c;return db[_0x5496('0x42')]['findOne']({'where':{'id':_0x5df52b[_0x5496('0x45')]['id']}})[_0x5496('0x27')](handleEntityNotFound(_0x12e603,null))['then'](function(_0x30af69){if(_0x30af69){_0xbde23e=_0x30af69;_0x356109[_0x5496('0x31')]=_[_0x5496('0x46')](db[_0x5496('0x4f')][_0x5496('0x2d')]);_0x356109[_0x5496('0x32')]=_[_0x5496('0x46')](_0x5df52b[_0x5496('0x32')]);_0x356109[_0x5496('0x33')]=_[_0x5496('0x34')](_0x356109[_0x5496('0x31')],_0x356109[_0x5496('0x32')]);_0x16486f[_0x5496('0x36')]=_[_0x5496('0x34')](_0x356109[_0x5496('0x31')],qs['fields'](_0x5df52b[_0x5496('0x32')][_0x5496('0x35')]));_0x16486f[_0x5496('0x36')]=_0x16486f[_0x5496('0x36')]['length']?_0x16486f['attributes']:_0x356109[_0x5496('0x31')];_0x16486f[_0x5496('0x50')]=qs[_0x5496('0x39')](_0x5df52b[_0x5496('0x32')][_0x5496('0x39')]);_0x16486f[_0x5496('0x3a')]=qs[_0x5496('0x33')](_['pick'](_0x5df52b[_0x5496('0x32')],_0x356109[_0x5496('0x33')]));if(_0x5df52b[_0x5496('0x32')][_0x5496('0x3e')]){_0x16486f[_0x5496('0x3a')]=_[_0x5496('0x3f')](_0x16486f[_0x5496('0x3a')],{'$or':_[_0x5496('0x3c')](_0x16486f[_0x5496('0x36')],function(_0x20ee4a){var _0x4f56cb={};_0x4f56cb[_0x20ee4a]={'$like':'%'+_0x5df52b[_0x5496('0x32')][_0x5496('0x3e')]+'%'};return _0x4f56cb;})});}_0x16486f=_[_0x5496('0x3f')]({},_0x16486f,_0x5df52b[_0x5496('0x40')]);return _0xbde23e[_0x5496('0x4e')](_0x16486f);}})[_0x5496('0x27')](function(_0x560658){if(_0x560658){_0x43268c=_0x560658[_0x5496('0x47')];if(!_0x5df52b[_0x5496('0x32')][_0x5496('0x37')]('nolimit')){_0x16486f['limit']=qs['limit'](_0x5df52b[_0x5496('0x32')][_0x5496('0x20')]);_0x16486f[_0x5496('0x1e')]=qs[_0x5496('0x1e')](_0x5df52b[_0x5496('0x32')][_0x5496('0x1e')]);}return _0xbde23e[_0x5496('0x4e')](_0x16486f);}})[_0x5496('0x27')](function(_0x49b7e5){if(_0x49b7e5){return _0x49b7e5?{'count':_0x43268c,'rows':_0x49b7e5}:null;}})[_0x5496('0x27')](respondWithResult(_0x12e603,null))['catch'](handleError(_0x12e603,null));};exports['addConfiguration']=function(_0x3c37da,_0x154e3a,_0x36b9f0){if(_0x3c37da[_0x5496('0x4c')]['id']){delete _0x3c37da[_0x5496('0x4c')]['id'];}return db['ZohoAccount'][_0x5496('0x51')]({'where':{'id':_0x3c37da[_0x5496('0x45')]['id']}})['then'](handleEntityNotFound(_0x154e3a,null))[_0x5496('0x27')](function(_0x28acc0){if(_0x28acc0){_0x3c37da[_0x5496('0x4c')][_0x5496('0x52')]=_0x28acc0['id'];_0x3c37da[_0x5496('0x4c')][_0x5496('0x53')]=integrations['getSubjects'](_0x3c37da['body'][_0x5496('0x54')],_0x3c37da[_0x5496('0x4c')]['type']);_0x3c37da['body'][_0x5496('0x55')]=integrations[_0x5496('0x56')](_0x3c37da[_0x5496('0x4c')][_0x5496('0x54')],_0x3c37da[_0x5496('0x4c')]['type']);return db[_0x5496('0x4f')]['create'](_0x3c37da[_0x5496('0x4c')],{'include':[{'model':db['ZohoField'],'as':_0x5496('0x53')},{'model':db[_0x5496('0x57')],'as':_0x5496('0x55')}]});}return null;})[_0x5496('0x27')](respondWithResult(_0x154e3a,null))['catch'](handleError(_0x154e3a,null));};function getAccessToken(_0x110dbf){return new Promise(function(_0x107896,_0x39d04d){var _0x30f477;switch(_0x110dbf[_0x5496('0x58')]){case'US':_0x30f477='https://accounts.zoho.com';break;case'AU':_0x30f477='https://accounts.zoho.com.au';break;case'EU':_0x30f477='https://accounts.zoho.eu';break;case'IN':_0x30f477=_0x5496('0x59');break;case'CN':_0x30f477=_0x5496('0x5a');break;default:_0x30f477=_0x5496('0x5b');break;}var _0x45712e={'method':_0x5496('0x5c'),'uri':_0x30f477+'/oauth/v2/token','qs':{'refresh_token':_0x110dbf[_0x5496('0x5d')],'client_id':_0x110dbf[_0x5496('0x5e')],'client_secret':_0x110dbf[_0x5496('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x45712e)['then'](function(_0xdd45d8){if(_0xdd45d8[_0x5496('0x60')]){_0x107896(_0xdd45d8[_0x5496('0x60')]);}else{_0x39d04d(_0x5496('0x61'));}})[_0x5496('0x4a')](function(_0x777dd0){_0x39d04d(_0x777dd0);});});}exports['getFields']=function(_0x198d38,_0x4bbbe7,_0x26b6a3){var _0x256675,_0xb61b25,_0x17ccde,_0x3320ad,_0x4c5325;return db[_0x5496('0x42')][_0x5496('0x51')]({'where':{'id':_0x198d38[_0x5496('0x45')]['id']},'attributes':['id',_0x5496('0x62'),_0x5496('0x58'),_0x5496('0x5e'),'clientSecret',_0x5496('0x63'),'code','refreshToken']})[_0x5496('0x27')](handleEntityNotFound(_0x4bbbe7,null))[_0x5496('0x27')](function(_0x132834){_0x4c5325=_0x132834;_0x256675=_0x4c5325['host'];_0xb61b25=_0x256675===_0x5496('0x64')?'eu':_0x5496('0x65');_0x17ccde=_0x4c5325[_0x5496('0x63')];var _0x260e8f=_0x17ccde[_0x5496('0x66')](-0x1);if(_0x260e8f==='/'||_0x260e8f==='\x5c'||_0x260e8f===':'){_0x17ccde=_0x17ccde[_0x5496('0x67')](0x0,_0x17ccde[_0x5496('0x68')](_0x260e8f));}if(!_0x4c5325[_0x5496('0x5d')]){throw new Error(_0x5496('0x69'));}return getAccessToken(_0x4c5325);})[_0x5496('0x27')](function(_0x25702d){if(_0x25702d){return rp({'method':'GET','uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0xb61b25),'qs':{'module':_0x5496('0x6a')},'headers':{'Authorization':_0x5496('0x6b')+_0x25702d},'json':!![]});}})[_0x5496('0x27')](function(_0x4afc08){if(_0x4afc08){if(_0x4afc08[_0x5496('0x6c')]&&_0x4afc08[_0x5496('0x6c')][_0x5496('0x28')]){throw new Error(_0x4afc08[_0x5496('0x6c')][_0x5496('0x28')][_0x5496('0x6d')]);}var _0x4e59d3=[];var _0x2f99ab=[];var _0x31ced2=[_0x5496('0x6e'),_0x5496('0x6f'),'Description',_0x5496('0x70'),_0x5496('0x71'),_0x5496('0x72'),_0x5496('0x73'),_0x5496('0x74')];_0x2f99ab=_[_0x5496('0x75')](_0x4afc08[_0x5496('0x35')],function(_0x23b9e2){return _0x31ced2[_0x5496('0x76')](_0x23b9e2[_0x5496('0x77')]);});for(var _0x2feb26=0x0;_0x2feb26<_0x2f99ab['length'];_0x2feb26++){if(_0x2f99ab[_0x2feb26]['system_mandatory']===![]){_0x4e59d3[_0x5496('0x78')]({'id':_0x2f99ab[_0x2feb26]['id'],'name':_0x2f99ab[_0x2feb26][_0x5496('0x79')],'custom':_0x2f99ab[_0x2feb26][_0x5496('0x7a')],'options':_0x2f99ab[_0x2feb26][_0x5496('0x7b')]===_0x5496('0x7c')&&_0x2f99ab[_0x2feb26][_0x5496('0x7d')][_0x5496('0x47')]>-0x1?_['map'](_0x2f99ab[_0x2feb26][_0x5496('0x7d')],function(_0x34796b){return{'name':_0x34796b,'value':_0x34796b};}):[]});}}return{'count':_0x4e59d3[_0x5496('0x47')],'rows':_0x4e59d3};}else{return{'count':0x0,'rows':[]};}})[_0x5496('0x27')](respondWithResult(_0x4bbbe7,null))[_0x5496('0x4a')](function(_0x3655fd){var _0x14723c=_0x198d38[_0x5496('0x32')]['test']?0x1f4:_0x3655fd[_0x5496('0x7e')]||0x1f4;logger['error'](_0x5496('0x7f'),_0x5496('0x80'),_0x14723c,JSON[_0x5496('0x81')](_0x3655fd));delete _0x3655fd[_0x5496('0x2a')];if(_0x14723c===0x191){_0x14723c=0x190;}_0x4bbbe7['status'](_0x14723c)[_0x5496('0x2b')](_0x198d38[_0x5496('0x32')]['test']?{'message':_0x5496('0x82'),'statusCode':_0x3655fd['statusCode']}:_0x3655fd);});}; \ No newline at end of file +var _0x87db=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','ZohoAccount','then','includeAll','findAll','rows','catch','show','params','length','include','find','create','update','body','getConfigurations','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','includes','api_name','system_mandatory','display_label','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x87db,0x1ef));var _0xb87d=function(_0x3ed672,_0x3c8e83){_0x3ed672=_0x3ed672-0x0;var _0x1d2b02=_0x87db[_0x3ed672];return _0x1d2b02;};'use strict';var emlformat=require(_0xb87d('0x0'));var rimraf=require(_0xb87d('0x1'));var zipdir=require(_0xb87d('0x2'));var jsonpatch=require(_0xb87d('0x3'));var rp=require(_0xb87d('0x4'));var moment=require(_0xb87d('0x5'));var BPromise=require(_0xb87d('0x6'));var Mustache=require('mustache');var util=require(_0xb87d('0x7'));var path=require('path');var sox=require(_0xb87d('0x8'));var csv=require(_0xb87d('0x9'));var ejs=require(_0xb87d('0xa'));var fs=require('fs');var fs_extra=require(_0xb87d('0xb'));var _=require(_0xb87d('0xc'));var squel=require(_0xb87d('0xd'));var crypto=require(_0xb87d('0xe'));var jsforce=require(_0xb87d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb87d('0x9'));var querystring=require(_0xb87d('0x10'));var Papa=require(_0xb87d('0x11'));var Redis=require(_0xb87d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb87d('0x13'));var as=require(_0xb87d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb87d('0x15'))(_0xb87d('0x16'));var utils=require(_0xb87d('0x17'));var config=require(_0xb87d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb87d('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x772c26,_0x255435){_0x255435=_0x255435||0xcc;return function(_0x5dbea9){if(_0x5dbea9){return _0x772c26['sendStatus'](_0x255435);}return _0x772c26['status'](_0x255435)[_0xb87d('0x1a')]();};}function respondWithResult(_0x25ac79,_0x4e93b5){_0x4e93b5=_0x4e93b5||0xc8;return function(_0x1928c0){if(_0x1928c0){return _0x25ac79[_0xb87d('0x1b')](_0x4e93b5)['json'](_0x1928c0);}};}function respondWithFilteredResult(_0x50877f,_0x2dd3e3){return function(_0x2455a4){if(_0x2455a4){var _0x30a52d=typeof _0x2dd3e3[_0xb87d('0x1c')]===_0xb87d('0x1d')&&typeof _0x2dd3e3[_0xb87d('0x1e')]==='undefined';var _0x1b4e40=_0x2455a4['count'];var _0x58368c=_0x30a52d?0x0:_0x2dd3e3[_0xb87d('0x1c')];var _0x539ec7=_0x30a52d?_0x2455a4[_0xb87d('0x1f')]:_0x2dd3e3[_0xb87d('0x1c')]+_0x2dd3e3[_0xb87d('0x1e')];var _0x50d41a;if(_0x539ec7>=_0x1b4e40){_0x539ec7=_0x1b4e40;_0x50d41a=0xc8;}else{_0x50d41a=0xce;}_0x50877f['status'](_0x50d41a);return _0x50877f[_0xb87d('0x20')](_0xb87d('0x21'),_0x58368c+'-'+_0x539ec7+'/'+_0x1b4e40)[_0xb87d('0x22')](_0x2455a4);}return null;};}function patchUpdates(_0x4b25c4){return function(_0x2bd6bb){try{jsonpatch['apply'](_0x2bd6bb,_0x4b25c4,!![]);}catch(_0x569314){return BPromise[_0xb87d('0x23')](_0x569314);}return _0x2bd6bb[_0xb87d('0x24')]();};}function saveUpdates(_0x5dbf2f,_0x2a2d39){return function(_0x2d34de){if(_0x2d34de){return _0x2d34de['update'](_0x5dbf2f)['then'](function(_0x153277){return _0x153277;});}return null;};}function removeEntity(_0x225b89,_0x3e99bb){return function(_0x1c4364){if(_0x1c4364){return _0x1c4364['destroy']()['then'](function(){_0x225b89[_0xb87d('0x1b')](0xcc)[_0xb87d('0x1a')]();});}};}function handleEntityNotFound(_0x5d5032,_0x5afa50){return function(_0x23baa5){if(!_0x23baa5){_0x5d5032['sendStatus'](0x194);}return _0x23baa5;};}function handleError(_0x19ed9f,_0xc87988){_0xc87988=_0xc87988||0x1f4;return function(_0x4f67a1){logger[_0xb87d('0x25')](_0x4f67a1[_0xb87d('0x26')]);if(_0x4f67a1[_0xb87d('0x27')]){delete _0x4f67a1[_0xb87d('0x27')];}_0x19ed9f[_0xb87d('0x1b')](_0xc87988)[_0xb87d('0x28')](_0x4f67a1);};}exports[_0xb87d('0x29')]=function(_0x8e6b43,_0x5456b4){var _0x4b2fa1={},_0x30e26e={},_0x51acf8={'count':0x0,'rows':[]};var _0x4e4e9a=_[_0xb87d('0x2a')](db['ZohoAccount'][_0xb87d('0x2b')],function(_0x4776e6){return{'name':_0x4776e6['fieldName'],'type':_0x4776e6[_0xb87d('0x2c')][_0xb87d('0x2d')]};});_0x30e26e[_0xb87d('0x2e')]=_[_0xb87d('0x2a')](_0x4e4e9a,_0xb87d('0x27'));_0x30e26e[_0xb87d('0x2f')]=_[_0xb87d('0x30')](_0x8e6b43[_0xb87d('0x2f')]);_0x30e26e[_0xb87d('0x31')]=_[_0xb87d('0x32')](_0x30e26e[_0xb87d('0x2e')],_0x30e26e[_0xb87d('0x2f')]);_0x4b2fa1[_0xb87d('0x33')]=_[_0xb87d('0x32')](_0x30e26e['model'],qs[_0xb87d('0x34')](_0x8e6b43[_0xb87d('0x2f')]['fields']));_0x4b2fa1[_0xb87d('0x33')]=_0x4b2fa1[_0xb87d('0x33')]['length']?_0x4b2fa1['attributes']:_0x30e26e[_0xb87d('0x2e')];if(!_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x35')]('nolimit')){_0x4b2fa1['limit']=qs[_0xb87d('0x1e')](_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x1e')]);_0x4b2fa1[_0xb87d('0x1c')]=qs[_0xb87d('0x1c')](_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x1c')]);}_0x4b2fa1['order']=qs['sort'](_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x36')]);_0x4b2fa1['where']=qs[_0xb87d('0x31')](_['pick'](_0x8e6b43[_0xb87d('0x2f')],_0x30e26e[_0xb87d('0x31')]),_0x4e4e9a);if(_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x37')]){_0x4b2fa1[_0xb87d('0x38')]=_[_0xb87d('0x39')](_0x4b2fa1[_0xb87d('0x38')],{'$or':_['map'](_0x4e4e9a,function(_0x7c698){if(_0x7c698[_0xb87d('0x2c')]!==_0xb87d('0x3a')){var _0x24a222={};_0x24a222[_0x7c698[_0xb87d('0x27')]]={'$like':'%'+_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x37')]+'%'};return _0x24a222;}})});}_0x4b2fa1=_[_0xb87d('0x39')]({},_0x4b2fa1,_0x8e6b43[_0xb87d('0x3b')]);var _0xbd8389={'where':_0x4b2fa1[_0xb87d('0x38')]};return db[_0xb87d('0x3c')][_0xb87d('0x1f')](_0xbd8389)[_0xb87d('0x3d')](function(_0x43136c){_0x51acf8[_0xb87d('0x1f')]=_0x43136c;if(_0x8e6b43[_0xb87d('0x2f')][_0xb87d('0x3e')]){_0x4b2fa1['include']=[{'all':!![]}];}return db[_0xb87d('0x3c')][_0xb87d('0x3f')](_0x4b2fa1);})[_0xb87d('0x3d')](function(_0x35a160){_0x51acf8[_0xb87d('0x40')]=_0x35a160;return _0x51acf8;})[_0xb87d('0x3d')](respondWithFilteredResult(_0x5456b4,_0x4b2fa1))[_0xb87d('0x41')](handleError(_0x5456b4,null));};exports[_0xb87d('0x42')]=function(_0x36971e,_0x47b51d){var _0x3d4ec0={'raw':![],'where':{'id':_0x36971e[_0xb87d('0x43')]['id']}},_0x488195={};_0x488195['model']=_[_0xb87d('0x30')](db['ZohoAccount'][_0xb87d('0x2b')]);_0x488195[_0xb87d('0x2f')]=_[_0xb87d('0x30')](_0x36971e[_0xb87d('0x2f')]);_0x488195['filters']=_[_0xb87d('0x32')](_0x488195[_0xb87d('0x2e')],_0x488195[_0xb87d('0x2f')]);_0x3d4ec0[_0xb87d('0x33')]=_['intersection'](_0x488195[_0xb87d('0x2e')],qs[_0xb87d('0x34')](_0x36971e['query'][_0xb87d('0x34')]));_0x3d4ec0[_0xb87d('0x33')]=_0x3d4ec0[_0xb87d('0x33')][_0xb87d('0x44')]?_0x3d4ec0[_0xb87d('0x33')]:_0x488195[_0xb87d('0x2e')];if(_0x36971e[_0xb87d('0x2f')][_0xb87d('0x3e')]){_0x3d4ec0[_0xb87d('0x45')]=[{'all':!![]}];}_0x3d4ec0=_[_0xb87d('0x39')]({},_0x3d4ec0,_0x36971e['options']);return db[_0xb87d('0x3c')][_0xb87d('0x46')](_0x3d4ec0)['then'](handleEntityNotFound(_0x47b51d,null))['then'](respondWithResult(_0x47b51d,null))[_0xb87d('0x41')](handleError(_0x47b51d,null));};exports['create']=function(_0x3ac28d,_0x6cd580){return db['ZohoAccount'][_0xb87d('0x47')](_0x3ac28d['body'],{})[_0xb87d('0x3d')](respondWithResult(_0x6cd580,0xc9))[_0xb87d('0x41')](handleError(_0x6cd580,null));};exports[_0xb87d('0x48')]=function(_0x2382e8,_0x421041){if(_0x2382e8[_0xb87d('0x49')]['id']){delete _0x2382e8[_0xb87d('0x49')]['id'];}return db['ZohoAccount'][_0xb87d('0x46')]({'where':{'id':_0x2382e8[_0xb87d('0x43')]['id']}})['then'](handleEntityNotFound(_0x421041,null))[_0xb87d('0x3d')](saveUpdates(_0x2382e8[_0xb87d('0x49')],null))['then'](respondWithResult(_0x421041,null))[_0xb87d('0x41')](handleError(_0x421041,null));};exports['destroy']=function(_0x13cb79,_0x5bd72b){return db[_0xb87d('0x3c')]['find']({'where':{'id':_0x13cb79[_0xb87d('0x43')]['id']}})['then'](handleEntityNotFound(_0x5bd72b,null))[_0xb87d('0x3d')](removeEntity(_0x5bd72b,null))[_0xb87d('0x41')](handleError(_0x5bd72b,null));};exports[_0xb87d('0x4a')]=function(_0x2cae57,_0x5a7933,_0x5921f3){var _0x59ff51={};var _0x40d729={};var _0x2c3145;var _0x2f52b7;return db[_0xb87d('0x3c')][_0xb87d('0x4b')]({'where':{'id':_0x2cae57['params']['id']}})[_0xb87d('0x3d')](handleEntityNotFound(_0x5a7933,null))['then'](function(_0x1473d4){if(_0x1473d4){_0x2c3145=_0x1473d4;_0x40d729['model']=_[_0xb87d('0x30')](db['ZohoConfiguration'][_0xb87d('0x2b')]);_0x40d729[_0xb87d('0x2f')]=_[_0xb87d('0x30')](_0x2cae57[_0xb87d('0x2f')]);_0x40d729[_0xb87d('0x31')]=_[_0xb87d('0x32')](_0x40d729['model'],_0x40d729[_0xb87d('0x2f')]);_0x59ff51['attributes']=_[_0xb87d('0x32')](_0x40d729[_0xb87d('0x2e')],qs[_0xb87d('0x34')](_0x2cae57[_0xb87d('0x2f')][_0xb87d('0x34')]));_0x59ff51[_0xb87d('0x33')]=_0x59ff51['attributes'][_0xb87d('0x44')]?_0x59ff51['attributes']:_0x40d729[_0xb87d('0x2e')];_0x59ff51['order']=qs[_0xb87d('0x36')](_0x2cae57[_0xb87d('0x2f')][_0xb87d('0x36')]);_0x59ff51[_0xb87d('0x38')]=qs['filters'](_['pick'](_0x2cae57['query'],_0x40d729[_0xb87d('0x31')]));if(_0x2cae57[_0xb87d('0x2f')]['filter']){_0x59ff51[_0xb87d('0x38')]=_[_0xb87d('0x39')](_0x59ff51[_0xb87d('0x38')],{'$or':_[_0xb87d('0x2a')](_0x59ff51['attributes'],function(_0x329a72){var _0x1eff41={};_0x1eff41[_0x329a72]={'$like':'%'+_0x2cae57['query'][_0xb87d('0x37')]+'%'};return _0x1eff41;})});}_0x59ff51=_[_0xb87d('0x39')]({},_0x59ff51,_0x2cae57[_0xb87d('0x3b')]);return _0x2c3145[_0xb87d('0x4a')](_0x59ff51);}})['then'](function(_0x1b21c4){if(_0x1b21c4){_0x2f52b7=_0x1b21c4[_0xb87d('0x44')];if(!_0x2cae57[_0xb87d('0x2f')][_0xb87d('0x35')]('nolimit')){_0x59ff51[_0xb87d('0x1e')]=qs[_0xb87d('0x1e')](_0x2cae57[_0xb87d('0x2f')]['limit']);_0x59ff51[_0xb87d('0x1c')]=qs['offset'](_0x2cae57['query'][_0xb87d('0x1c')]);}return _0x2c3145[_0xb87d('0x4a')](_0x59ff51);}})[_0xb87d('0x3d')](function(_0x1117b8){if(_0x1117b8){return _0x1117b8?{'count':_0x2f52b7,'rows':_0x1117b8}:null;}})['then'](respondWithResult(_0x5a7933,null))['catch'](handleError(_0x5a7933,null));};exports['addConfiguration']=function(_0x4a5895,_0x1fa03,_0x59f352){if(_0x4a5895[_0xb87d('0x49')]['id']){delete _0x4a5895['body']['id'];}return db[_0xb87d('0x3c')][_0xb87d('0x4b')]({'where':{'id':_0x4a5895[_0xb87d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1fa03,null))['then'](function(_0x1f6b1a){if(_0x1f6b1a){_0x4a5895[_0xb87d('0x49')][_0xb87d('0x4c')]=_0x1f6b1a['id'];_0x4a5895[_0xb87d('0x49')][_0xb87d('0x4d')]=integrations[_0xb87d('0x4e')](_0x4a5895[_0xb87d('0x49')]['channel'],_0x4a5895['body'][_0xb87d('0x2c')]);_0x4a5895[_0xb87d('0x49')][_0xb87d('0x4f')]=integrations[_0xb87d('0x50')](_0x4a5895[_0xb87d('0x49')]['channel'],_0x4a5895[_0xb87d('0x49')][_0xb87d('0x2c')]);return db['ZohoConfiguration'][_0xb87d('0x47')](_0x4a5895[_0xb87d('0x49')],{'include':[{'model':db[_0xb87d('0x51')],'as':_0xb87d('0x4d')},{'model':db['ZohoField'],'as':_0xb87d('0x4f')}]});}return null;})[_0xb87d('0x3d')](respondWithResult(_0x1fa03,null))[_0xb87d('0x41')](handleError(_0x1fa03,null));};function getAccessToken(_0x56090a){return new Promise(function(_0x22569b,_0x4e99b6){var _0x398149;switch(_0x56090a[_0xb87d('0x52')]){case'US':_0x398149=_0xb87d('0x53');break;case'AU':_0x398149=_0xb87d('0x54');break;case'EU':_0x398149=_0xb87d('0x55');break;case'IN':_0x398149=_0xb87d('0x56');break;case'CN':_0x398149=_0xb87d('0x57');break;default:_0x398149='https://accounts.zoho.eu';break;}var _0x3abdad={'method':_0xb87d('0x58'),'uri':_0x398149+_0xb87d('0x59'),'qs':{'refresh_token':_0x56090a[_0xb87d('0x5a')],'client_id':_0x56090a[_0xb87d('0x5b')],'client_secret':_0x56090a[_0xb87d('0x5c')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x3abdad)[_0xb87d('0x3d')](function(_0x31daf8){if(_0x31daf8[_0xb87d('0x5d')]){_0x22569b(_0x31daf8['access_token']);}else{_0x4e99b6(_0xb87d('0x5e'));}})[_0xb87d('0x41')](function(_0x4f74e1){_0x4e99b6(_0x4f74e1);});});}exports[_0xb87d('0x5f')]=function(_0x4fb807,_0x1e753f,_0x22979c){var _0x5eb50e,_0x32f31e,_0x476e5e,_0x12a164,_0x5c9702;return db[_0xb87d('0x3c')]['findOne']({'where':{'id':_0x4fb807['params']['id']},'attributes':['id',_0xb87d('0x60'),_0xb87d('0x52'),_0xb87d('0x5b'),_0xb87d('0x5c'),_0xb87d('0x61'),'code',_0xb87d('0x5a')]})['then'](handleEntityNotFound(_0x1e753f,null))[_0xb87d('0x3d')](function(_0x2080b4){_0x5c9702=_0x2080b4;_0x5eb50e=_0x5c9702[_0xb87d('0x60')];_0x32f31e=_0x5eb50e===_0xb87d('0x62')?'eu':_0xb87d('0x63');_0x476e5e=_0x5c9702['serverUrl'];var _0x1e422a=_0x476e5e[_0xb87d('0x64')](-0x1);if(_0x1e422a==='/'||_0x1e422a==='\x5c'||_0x1e422a===':'){_0x476e5e=_0x476e5e[_0xb87d('0x65')](0x0,_0x476e5e[_0xb87d('0x66')](_0x1e422a));}if(!_0x5c9702['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5c9702);})[_0xb87d('0x3d')](function(_0x5409bb){if(_0x5409bb){return rp({'method':_0xb87d('0x67'),'uri':util['format'](_0xb87d('0x68'),_0x32f31e),'qs':{'module':_0xb87d('0x69')},'headers':{'Authorization':_0xb87d('0x6a')+_0x5409bb},'json':!![]});}})['then'](function(_0x33d12c){if(_0x33d12c){if(_0x33d12c[_0xb87d('0x6b')]&&_0x33d12c[_0xb87d('0x6b')][_0xb87d('0x25')]){throw new Error(_0x33d12c['response']['error'][_0xb87d('0x6c')]);}var _0x10a42e=[];var _0x56283e=[];var _0x395d59=[_0xb87d('0x6d'),_0xb87d('0x6e'),_0xb87d('0x6f'),_0xb87d('0x70'),_0xb87d('0x71'),_0xb87d('0x72'),_0xb87d('0x73'),'Call_Type'];_0x56283e=_['remove'](_0x33d12c[_0xb87d('0x34')],function(_0x30a648){return _0x395d59[_0xb87d('0x74')](_0x30a648[_0xb87d('0x75')]);});for(var _0x584c74=0x0;_0x584c74<_0x56283e[_0xb87d('0x44')];_0x584c74++){if(_0x56283e[_0x584c74][_0xb87d('0x76')]===![]){_0x10a42e['push']({'id':_0x56283e[_0x584c74]['id'],'name':_0x56283e[_0x584c74][_0xb87d('0x77')],'custom':_0x56283e[_0x584c74]['custom_field'],'options':_0x56283e[_0x584c74]['data_type']==='picklist'&&_0x56283e[_0x584c74]['pick_list_values'][_0xb87d('0x44')]>-0x1?_[_0xb87d('0x2a')](_0x56283e[_0x584c74][_0xb87d('0x78')],function(_0x2c8d02){return{'name':_0x2c8d02,'value':_0x2c8d02};}):[]});}}return{'count':_0x10a42e[_0xb87d('0x44')],'rows':_0x10a42e};}else{return{'count':0x0,'rows':[]};}})[_0xb87d('0x3d')](respondWithResult(_0x1e753f,null))[_0xb87d('0x41')](function(_0x347a64){var _0x521e8f=_0x4fb807[_0xb87d('0x2f')][_0xb87d('0x79')]?0x1f4:_0x347a64[_0xb87d('0x7a')]||0x1f4;logger['error'](_0xb87d('0x7b'),_0xb87d('0x5f'),_0x521e8f,JSON[_0xb87d('0x7c')](_0x347a64));delete _0x347a64[_0xb87d('0x27')];if(_0x521e8f===0x191){_0x521e8f=0x190;}_0x1e753f['status'](_0x521e8f)[_0xb87d('0x28')](_0x4fb807['query'][_0xb87d('0x79')]?{'message':'Wrong\x20credentials','statusCode':_0x347a64[_0xb87d('0x7a')]}:_0x347a64);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f41b982..207a3a6 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 _0x2f1d=['format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','https://accounts.zoho.com','https://accounts.zoho.com.au','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientId','code','host','slice','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name'];(function(_0x4ac595,_0x158dfe){var _0x49cff7=function(_0x5eaea4){while(--_0x5eaea4){_0x4ac595['push'](_0x4ac595['shift']());}};_0x49cff7(++_0x158dfe);}(_0x2f1d,0x126));var _0xd2f1=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x2f1d[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xd2f1('0x0'));var util=require(_0xd2f1('0x1'));var logger=require('../../config/logger')(_0xd2f1('0x2'));var moment=require('moment');var BPromise=require(_0xd2f1('0x3'));var rp=require(_0xd2f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2f1('0x5'));var config=require(_0xd2f1('0x6'));var attributes=require(_0xd2f1('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xd2f1('0x8')]=function(_0x19565e,_0x2c029e){return _0x19565e[_0xd2f1('0x9')]('ZohoAccount',attributes,{'tableName':_0xd2f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5717ba,_0x149325,_0x24cdb7){if(_0x5717ba[_0xd2f1('0xb')](_0xd2f1('0xc'))||_0x5717ba[_0xd2f1('0xb')](_0xd2f1('0xd'))||_0x5717ba['changed'](_0xd2f1('0xe'))||_0x5717ba['changed']('clientSecret')||_0x5717ba[_0xd2f1('0xb')](_0xd2f1('0xf'))||_0x5717ba[_0xd2f1('0xb')](_0xd2f1('0x10'))){var _0x3ca4fb,_0x533b05;_0x3ca4fb=_0x5717ba[_0xd2f1('0xd')];var _0x9411a3=_0x3ca4fb[_0xd2f1('0x11')](-0x1);if(_0x9411a3==='/'||_0x9411a3==='\x5c'||_0x9411a3===':'){_0x3ca4fb=_0x3ca4fb[_0xd2f1('0x12')](0x0,_0x3ca4fb[_0xd2f1('0x13')](_0x9411a3));}switch(_0x5717ba[_0xd2f1('0xc')]){case'US':_0x533b05='https://accounts.zoho.com';break;case'AU':_0x533b05='https://accounts.zoho.com.au';break;case'IN':_0x533b05=_0xd2f1('0x14');break;case'CN':_0x533b05=_0xd2f1('0x15');break;default:_0x533b05=_0xd2f1('0x16');break;}var _0x587760={'method':_0xd2f1('0x17'),'uri':_0x533b05+_0xd2f1('0x18'),'form':{'grant_type':_0xd2f1('0x19'),'client_id':_0x5717ba[_0xd2f1('0xe')],'client_secret':_0x5717ba[_0xd2f1('0x1a')],'redirect_uri':_0x5717ba[_0xd2f1('0xd')],'code':_0x5717ba[_0xd2f1('0xf')]},'headers':{'Content-Type':_0xd2f1('0x1b')}};return rp(_0x587760)[_0xd2f1('0x1c')](function(_0x588bc6){var _0x17fff0=JSON[_0xd2f1('0x1d')](_0x588bc6);if(_0x17fff0[_0xd2f1('0x1e')]){_0x5717ba[_0xd2f1('0x1f')]=_0x17fff0[_0xd2f1('0x1e')];logger['info'](util['format'](_0xd2f1('0x20'),_0x5717ba[_0xd2f1('0x21')],_0x5717ba['id']));}else{logger['error'](util[_0xd2f1('0x22')](_0xd2f1('0x23'),_0x5717ba[_0xd2f1('0x21')],_0x5717ba['id']),util[_0xd2f1('0x24')](_0x17fff0,{'showHidden':![],'depth':null}));}return _0x24cdb7(null,_0x149325);})[_0xd2f1('0x25')](function(_0x416986){logger[_0xd2f1('0x26')](util[_0xd2f1('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5717ba['name'],_0x5717ba['id']),util[_0xd2f1('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x24cdb7(_0x416986);});}else{return _0x24cdb7(null,_0x149325);}},'beforeUpdate':function(_0x10d98e,_0x56f981,_0x2706bc){if(_0x10d98e[_0xd2f1('0xb')]('zone')||_0x10d98e[_0xd2f1('0xb')](_0xd2f1('0xd'))||_0x10d98e['changed'](_0xd2f1('0xe'))||_0x10d98e[_0xd2f1('0xb')](_0xd2f1('0x1a'))||_0x10d98e[_0xd2f1('0xb')](_0xd2f1('0xf'))||_0x10d98e[_0xd2f1('0xb')](_0xd2f1('0x10'))){var _0x376b6f,_0x187774;_0x376b6f=_0x10d98e[_0xd2f1('0xd')];var _0x135bd0=_0x376b6f[_0xd2f1('0x11')](-0x1);if(_0x135bd0==='/'||_0x135bd0==='\x5c'||_0x135bd0===':'){_0x376b6f=_0x376b6f['substring'](0x0,_0x376b6f[_0xd2f1('0x13')](_0x135bd0));}switch(_0x10d98e[_0xd2f1('0xc')]){case'US':_0x187774=_0xd2f1('0x27');break;case'AU':_0x187774=_0xd2f1('0x28');break;case'IN':_0x187774=_0xd2f1('0x14');break;case'CN':_0x187774=_0xd2f1('0x15');break;default:_0x187774=_0xd2f1('0x16');break;}var _0x622d87={'method':'POST','uri':_0x187774+_0xd2f1('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x10d98e[_0xd2f1('0xe')],'client_secret':_0x10d98e[_0xd2f1('0x1a')],'redirect_uri':_0x10d98e[_0xd2f1('0xd')],'code':_0x10d98e[_0xd2f1('0xf')]},'headers':{'Content-Type':_0xd2f1('0x1b')}};return rp(_0x622d87)[_0xd2f1('0x1c')](function(_0x134a58){var _0x419f97=JSON[_0xd2f1('0x1d')](_0x134a58);if(_0x419f97[_0xd2f1('0x1e')]){_0x10d98e['refreshToken']=_0x419f97[_0xd2f1('0x1e')];logger['info'](util[_0xd2f1('0x22')](_0xd2f1('0x20'),_0x10d98e[_0xd2f1('0x21')],_0x10d98e['id']));}else{logger['error'](util['format'](_0xd2f1('0x23'),_0x10d98e[_0xd2f1('0x21')],_0x10d98e['id']),util[_0xd2f1('0x24')](_0x419f97,{'showHidden':![],'depth':null}));}return _0x2706bc(null,_0x56f981);})[_0xd2f1('0x25')](function(_0x500eb5){logger['error'](util[_0xd2f1('0x22')](_0xd2f1('0x23'),_0x10d98e[_0xd2f1('0x21')],_0x10d98e['id']),util[_0xd2f1('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2706bc(_0x500eb5);});}else{return _0x2706bc(null,_0x56f981);}}}});}; \ No newline at end of file +var _0xc6a3=['api','moment','bluebird','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','code','https://accounts.zoho.com','util','../../config/logger'];(function(_0x404f40,_0x1221af){var _0x38e296=function(_0x2699a6){while(--_0x2699a6){_0x404f40['push'](_0x404f40['shift']());}};_0x38e296(++_0x1221af);}(_0xc6a3,0x166));var _0x3c6a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc6a3[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x3c6a('0x0'));var logger=require(_0x3c6a('0x1'))(_0x3c6a('0x2'));var moment=require(_0x3c6a('0x3'));var BPromise=require(_0x3c6a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3c6a('0x5'));var config=require('../../config/environment');var attributes=require(_0x3c6a('0x6'));var integrations=require(_0x3c6a('0x7'));module[_0x3c6a('0x8')]=function(_0x1d1101,_0x5ecff2){return _0x1d1101['define']('ZohoAccount',attributes,{'tableName':_0x3c6a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b3ba8,_0x1138db,_0x227e57){if(_0x2b3ba8[_0x3c6a('0xa')](_0x3c6a('0xb'))||_0x2b3ba8[_0x3c6a('0xa')](_0x3c6a('0xc'))||_0x2b3ba8['changed'](_0x3c6a('0xd'))||_0x2b3ba8['changed'](_0x3c6a('0xe'))||_0x2b3ba8['changed']('code')||_0x2b3ba8[_0x3c6a('0xa')](_0x3c6a('0xf'))){var _0x4ab691,_0x379893;_0x4ab691=_0x2b3ba8[_0x3c6a('0xc')];var _0x107d56=_0x4ab691[_0x3c6a('0x10')](-0x1);if(_0x107d56==='/'||_0x107d56==='\x5c'||_0x107d56===':'){_0x4ab691=_0x4ab691[_0x3c6a('0x11')](0x0,_0x4ab691[_0x3c6a('0x12')](_0x107d56));}switch(_0x2b3ba8[_0x3c6a('0xb')]){case'US':_0x379893='https://accounts.zoho.com';break;case'AU':_0x379893=_0x3c6a('0x13');break;case'IN':_0x379893=_0x3c6a('0x14');break;case'CN':_0x379893=_0x3c6a('0x15');break;default:_0x379893=_0x3c6a('0x16');break;}var _0x2476e9={'method':_0x3c6a('0x17'),'uri':_0x379893+_0x3c6a('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x2b3ba8['clientId'],'client_secret':_0x2b3ba8[_0x3c6a('0xe')],'redirect_uri':_0x2b3ba8[_0x3c6a('0xc')],'code':_0x2b3ba8['code']},'headers':{'Content-Type':_0x3c6a('0x19')}};return rp(_0x2476e9)[_0x3c6a('0x1a')](function(_0x2301eb){var _0x11fac6=JSON[_0x3c6a('0x1b')](_0x2301eb);if(_0x11fac6[_0x3c6a('0x1c')]){_0x2b3ba8[_0x3c6a('0x1d')]=_0x11fac6[_0x3c6a('0x1c')];logger[_0x3c6a('0x1e')](util[_0x3c6a('0x1f')](_0x3c6a('0x20'),_0x2b3ba8[_0x3c6a('0x21')],_0x2b3ba8['id']));}else{logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')](_0x3c6a('0x23'),_0x2b3ba8['name'],_0x2b3ba8['id']),util[_0x3c6a('0x24')](_0x11fac6,{'showHidden':![],'depth':null}));}return _0x227e57(null,_0x1138db);})[_0x3c6a('0x25')](function(_0x261a30){logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')](_0x3c6a('0x23'),_0x2b3ba8[_0x3c6a('0x21')],_0x2b3ba8['id']),util[_0x3c6a('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x227e57(_0x261a30);});}else{return _0x227e57(null,_0x1138db);}},'beforeUpdate':function(_0x3b1594,_0x419ca4,_0x54ca94){if(_0x3b1594[_0x3c6a('0xa')](_0x3c6a('0xb'))||_0x3b1594[_0x3c6a('0xa')](_0x3c6a('0xc'))||_0x3b1594['changed'](_0x3c6a('0xd'))||_0x3b1594[_0x3c6a('0xa')]('clientSecret')||_0x3b1594[_0x3c6a('0xa')](_0x3c6a('0x26'))||_0x3b1594[_0x3c6a('0xa')]('host')){var _0x18eeb7,_0x50a89a;_0x18eeb7=_0x3b1594['serverUrl'];var _0x28c45f=_0x18eeb7[_0x3c6a('0x10')](-0x1);if(_0x28c45f==='/'||_0x28c45f==='\x5c'||_0x28c45f===':'){_0x18eeb7=_0x18eeb7['substring'](0x0,_0x18eeb7[_0x3c6a('0x12')](_0x28c45f));}switch(_0x3b1594[_0x3c6a('0xb')]){case'US':_0x50a89a=_0x3c6a('0x27');break;case'AU':_0x50a89a=_0x3c6a('0x13');break;case'IN':_0x50a89a=_0x3c6a('0x14');break;case'CN':_0x50a89a=_0x3c6a('0x15');break;default:_0x50a89a=_0x3c6a('0x16');break;}var _0x4f7f86={'method':_0x3c6a('0x17'),'uri':_0x50a89a+_0x3c6a('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x3b1594['clientId'],'client_secret':_0x3b1594[_0x3c6a('0xe')],'redirect_uri':_0x3b1594['serverUrl'],'code':_0x3b1594[_0x3c6a('0x26')]},'headers':{'Content-Type':_0x3c6a('0x19')}};return rp(_0x4f7f86)[_0x3c6a('0x1a')](function(_0x5cb9cb){var _0x12da32=JSON[_0x3c6a('0x1b')](_0x5cb9cb);if(_0x12da32['refresh_token']){_0x3b1594[_0x3c6a('0x1d')]=_0x12da32['refresh_token'];logger[_0x3c6a('0x1e')](util[_0x3c6a('0x1f')](_0x3c6a('0x20'),_0x3b1594[_0x3c6a('0x21')],_0x3b1594['id']));}else{logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3b1594['name'],_0x3b1594['id']),util[_0x3c6a('0x24')](_0x12da32,{'showHidden':![],'depth':null}));}return _0x54ca94(null,_0x419ca4);})[_0x3c6a('0x25')](function(_0x4da265){logger[_0x3c6a('0x22')](util[_0x3c6a('0x1f')](_0x3c6a('0x23'),_0x3b1594['name'],_0x3b1594['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x54ca94(_0x4da265);});}else{return _0x54ca94(null,_0x419ca4);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 792ca33..595c3ea 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 _0x7e74=['message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','attributes','map','include','model','where','ShowZohoAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x9b49c6,_0x2ea7ba){var _0x578e11=function(_0x1d3e5c){while(--_0x1d3e5c){_0x9b49c6['push'](_0x9b49c6['shift']());}};_0x578e11(++_0x2ea7ba);}(_0x7e74,0xbd));var _0x47e7=function(_0xdeca95,_0x1609c3){_0xdeca95=_0xdeca95-0x0;var _0x5d3ca8=_0x7e74[_0xdeca95];return _0x5d3ca8;};'use strict';var _=require(_0x47e7('0x0'));var util=require('util');var moment=require(_0x47e7('0x1'));var BPromise=require(_0x47e7('0x2'));var rs=require(_0x47e7('0x3'));var fs=require('fs');var Redis=require(_0x47e7('0x4'));var db=require(_0x47e7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x47e7('0x6'))(_0x47e7('0x7'));var config=require(_0x47e7('0x8'));var jayson=require(_0x47e7('0x9'));var client=jayson[_0x47e7('0xa')][_0x47e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x412d3e,_0x50fc6c,_0x29cd0a){return new BPromise(function(_0x4dc1ee,_0x14fe2f){return client[_0x47e7('0xc')](_0x412d3e,_0x29cd0a)[_0x47e7('0xd')](function(_0x2f66c0){logger[_0x47e7('0xe')](_0x47e7('0xf'),_0x50fc6c,_0x47e7('0x10'));logger[_0x47e7('0x11')](_0x47e7('0x12'),_0x50fc6c,_0x47e7('0x10'),JSON[_0x47e7('0x13')](_0x2f66c0));if(_0x2f66c0[_0x47e7('0x14')]){if(_0x2f66c0[_0x47e7('0x14')]['code']===0x1f4){logger[_0x47e7('0x14')](_0x47e7('0xf'),_0x50fc6c,_0x2f66c0[_0x47e7('0x14')]['message']);return _0x14fe2f(_0x2f66c0[_0x47e7('0x14')][_0x47e7('0x15')]);}logger[_0x47e7('0x14')](_0x47e7('0xf'),_0x50fc6c,_0x2f66c0['error'][_0x47e7('0x15')]);return _0x4dc1ee(_0x2f66c0[_0x47e7('0x14')][_0x47e7('0x15')]);}else{logger[_0x47e7('0xe')](_0x47e7('0xf'),_0x50fc6c,'request\x20sent');_0x4dc1ee(_0x2f66c0[_0x47e7('0x16')]['message']);}})[_0x47e7('0x17')](function(_0x8c320e){logger[_0x47e7('0x14')](_0x47e7('0xf'),_0x50fc6c,_0x8c320e);_0x14fe2f(_0x8c320e);});});}exports[_0x47e7('0x18')]=function(_0x4429e6){var _0x6a3682=this;return new Promise(function(_0x42d837,_0x25d0f0){return db[_0x47e7('0x19')][_0x47e7('0x1a')]({'raw':_0x4429e6[_0x47e7('0x1b')]?_0x4429e6[_0x47e7('0x1b')][_0x47e7('0x1c')]===undefined?!![]:![]:!![],'where':_0x4429e6['options']?_0x4429e6['options']['where']||null:null,'attributes':_0x4429e6['options']?_0x4429e6[_0x47e7('0x1b')][_0x47e7('0x1d')]||null:null,'limit':_0x4429e6[_0x47e7('0x1b')]?_0x4429e6[_0x47e7('0x1b')]['limit']||null:null,'include':_0x4429e6['options']?_0x4429e6[_0x47e7('0x1b')]['include']?_[_0x47e7('0x1e')](_0x4429e6['options'][_0x47e7('0x1f')],function(_0x8e7237){return{'model':db[_0x8e7237[_0x47e7('0x20')]],'as':_0x8e7237['as'],'attributes':_0x8e7237[_0x47e7('0x1d')],'include':_0x8e7237['include']?_['map'](_0x8e7237[_0x47e7('0x1f')],function(_0x25c0ca){return{'model':db[_0x25c0ca[_0x47e7('0x20')]],'as':_0x25c0ca['as'],'attributes':_0x25c0ca[_0x47e7('0x1d')],'include':_0x25c0ca['include']?_[_0x47e7('0x1e')](_0x25c0ca[_0x47e7('0x1f')],function(_0x28f414){return{'model':db[_0x28f414[_0x47e7('0x20')]],'as':_0x28f414['as'],'attributes':_0x28f414['attributes']};}):[]};}):[]};}):[]:[]})[_0x47e7('0xd')](function(_0x1bdb4c){logger[_0x47e7('0xe')](_0x47e7('0x18'),_0x4429e6);logger[_0x47e7('0x11')](_0x47e7('0x18'),_0x4429e6,JSON[_0x47e7('0x13')](_0x1bdb4c));_0x42d837(_0x1bdb4c);})[_0x47e7('0x17')](function(_0x172c80){logger[_0x47e7('0x14')](_0x47e7('0x18'),_0x172c80[_0x47e7('0x15')],_0x4429e6);_0x25d0f0(_0x6a3682[_0x47e7('0x14')](0x1f4,_0x172c80[_0x47e7('0x15')]));});});};exports['ShowZohoAccount']=function(_0x2bc66d){var _0x193a9a=this;return new Promise(function(_0x4078bd,_0x2f8f2d){return db[_0x47e7('0x19')]['find']({'raw':_0x2bc66d[_0x47e7('0x1b')]?_0x2bc66d[_0x47e7('0x1b')][_0x47e7('0x1c')]===undefined?!![]:![]:!![],'where':_0x2bc66d[_0x47e7('0x1b')]?_0x2bc66d[_0x47e7('0x1b')][_0x47e7('0x21')]||null:null,'attributes':_0x2bc66d[_0x47e7('0x1b')]?_0x2bc66d['options']['attributes']||null:null,'include':_0x2bc66d[_0x47e7('0x1b')]?_0x2bc66d['options'][_0x47e7('0x1f')]?_[_0x47e7('0x1e')](_0x2bc66d['options'][_0x47e7('0x1f')],function(_0x228a56){return{'model':db[_0x228a56[_0x47e7('0x20')]],'as':_0x228a56['as'],'attributes':_0x228a56['attributes'],'include':_0x228a56['include']?_[_0x47e7('0x1e')](_0x228a56[_0x47e7('0x1f')],function(_0x4a4667){return{'model':db[_0x4a4667[_0x47e7('0x20')]],'as':_0x4a4667['as'],'attributes':_0x4a4667[_0x47e7('0x1d')],'include':_0x4a4667[_0x47e7('0x1f')]?_['map'](_0x4a4667[_0x47e7('0x1f')],function(_0x5711eb){return{'model':db[_0x5711eb[_0x47e7('0x20')]],'as':_0x5711eb['as'],'attributes':_0x5711eb[_0x47e7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47e7('0xd')](function(_0x47ecc9){logger[_0x47e7('0xe')](_0x47e7('0x22'),_0x2bc66d);logger[_0x47e7('0x11')](_0x47e7('0x22'),_0x2bc66d,JSON[_0x47e7('0x13')](_0x47ecc9));_0x4078bd(_0x47ecc9);})[_0x47e7('0x17')](function(_0x4a551a){logger['error'](_0x47e7('0x22'),_0x4a551a['message'],_0x2bc66d);_0x2f8f2d(_0x193a9a[_0x47e7('0x14')](0x1f4,_0x4a551a[_0x47e7('0x15')]));});});}; \ No newline at end of file +var _0xbedb=['message','catch','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','then','GetZohoAccount','ShowZohoAccount','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbed('0x0'));var util=require('util');var moment=require(_0xbbed('0x1'));var BPromise=require(_0xbbed('0x2'));var rs=require(_0xbbed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbed('0x4'));var logger=require(_0xbbed('0x5'))(_0xbbed('0x6'));var config=require(_0xbbed('0x7'));var jayson=require(_0xbbed('0x8'));var client=jayson[_0xbbed('0x9')][_0xbbed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a3d9c,_0x44f7ff,_0x42f499){return new BPromise(function(_0x51d8c6,_0x12e6d0){return client['request'](_0x3a3d9c,_0x42f499)['then'](function(_0x3f5d87){logger[_0xbbed('0xb')](_0xbbed('0xc'),_0x44f7ff,'request\x20sent');logger['debug'](_0xbbed('0xd'),_0x44f7ff,_0xbbed('0xe'),JSON[_0xbbed('0xf')](_0x3f5d87));if(_0x3f5d87[_0xbbed('0x10')]){if(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x11')]===0x1f4){logger['error'](_0xbbed('0xc'),_0x44f7ff,_0x3f5d87['error'][_0xbbed('0x12')]);return _0x12e6d0(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);}logger[_0xbbed('0x10')](_0xbbed('0xc'),_0x44f7ff,_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);return _0x51d8c6(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);}else{logger[_0xbbed('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x44f7ff,_0xbbed('0xe'));_0x51d8c6(_0x3f5d87['result'][_0xbbed('0x12')]);}})[_0xbbed('0x13')](function(_0xf860ff){logger[_0xbbed('0x10')](_0xbbed('0xc'),_0x44f7ff,_0xf860ff);_0x12e6d0(_0xf860ff);});});}exports['GetZohoAccount']=function(_0x19e9ce){var _0x2e1789=this;return new Promise(function(_0x44fd74,_0xb8a474){return db[_0xbbed('0x14')][_0xbbed('0x15')]({'raw':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x17')]===undefined?!![]:![]:!![],'where':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x18')]||null:null,'attributes':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce['options'][_0xbbed('0x19')]||null:null,'limit':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')]['limit']||null:null,'include':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x19e9ce['options'][_0xbbed('0x1a')],function(_0x479c81){return{'model':db[_0x479c81[_0xbbed('0x1c')]],'as':_0x479c81['as'],'attributes':_0x479c81[_0xbbed('0x19')],'include':_0x479c81['include']?_[_0xbbed('0x1b')](_0x479c81[_0xbbed('0x1a')],function(_0x11ebcf){return{'model':db[_0x11ebcf[_0xbbed('0x1c')]],'as':_0x11ebcf['as'],'attributes':_0x11ebcf[_0xbbed('0x19')],'include':_0x11ebcf[_0xbbed('0x1a')]?_['map'](_0x11ebcf[_0xbbed('0x1a')],function(_0x5dd187){return{'model':db[_0x5dd187[_0xbbed('0x1c')]],'as':_0x5dd187['as'],'attributes':_0x5dd187['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbed('0x1d')](function(_0x457b58){logger[_0xbbed('0xb')](_0xbbed('0x1e'),_0x19e9ce);logger['debug'](_0xbbed('0x1e'),_0x19e9ce,JSON[_0xbbed('0xf')](_0x457b58));_0x44fd74(_0x457b58);})[_0xbbed('0x13')](function(_0x446c21){logger['error'](_0xbbed('0x1e'),_0x446c21['message'],_0x19e9ce);_0xb8a474(_0x2e1789[_0xbbed('0x10')](0x1f4,_0x446c21[_0xbbed('0x12')]));});});};exports['ShowZohoAccount']=function(_0x35fb77){var _0xe9870c=this;return new Promise(function(_0x4d444f,_0x5de590){return db['ZohoAccount']['find']({'raw':_0x35fb77['options']?_0x35fb77[_0xbbed('0x16')][_0xbbed('0x17')]===undefined?!![]:![]:!![],'where':_0x35fb77['options']?_0x35fb77['options'][_0xbbed('0x18')]||null:null,'attributes':_0x35fb77[_0xbbed('0x16')]?_0x35fb77['options'][_0xbbed('0x19')]||null:null,'include':_0x35fb77['options']?_0x35fb77[_0xbbed('0x16')][_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x35fb77['options'][_0xbbed('0x1a')],function(_0x1e598c){return{'model':db[_0x1e598c[_0xbbed('0x1c')]],'as':_0x1e598c['as'],'attributes':_0x1e598c[_0xbbed('0x19')],'include':_0x1e598c[_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x1e598c['include'],function(_0x3324eb){return{'model':db[_0x3324eb['model']],'as':_0x3324eb['as'],'attributes':_0x3324eb['attributes'],'include':_0x3324eb[_0xbbed('0x1a')]?_['map'](_0x3324eb[_0xbbed('0x1a')],function(_0x46e494){return{'model':db[_0x46e494[_0xbbed('0x1c')]],'as':_0x46e494['as'],'attributes':_0x46e494[_0xbbed('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b25fd){logger[_0xbbed('0xb')]('ShowZohoAccount',_0x35fb77);logger['debug']('ShowZohoAccount',_0x35fb77,JSON[_0xbbed('0xf')](_0x1b25fd));_0x4d444f(_0x1b25fd);})[_0xbbed('0x13')](function(_0x2ab97c){logger[_0xbbed('0x10')](_0xbbed('0x1f'),_0x2ab97c[_0xbbed('0x12')],_0x35fb77);_0x5de590(_0xe9870c[_0xbbed('0x10')](0x1f4,_0x2ab97c['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index dff2611..331edee 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 _0xe6d5=['isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2bee21,_0x21d6fc){var _0x3242bb=function(_0x525509){while(--_0x525509){_0x2bee21['push'](_0x2bee21['shift']());}};_0x3242bb(++_0x21d6fc);}(_0xe6d5,0x187));var _0x5e6d=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0xe6d5[_0x55fa03];return _0x2cd7cd;};'use strict';var multer=require(_0x5e6d('0x0'));var util=require('util');var path=require(_0x5e6d('0x1'));var timeout=require(_0x5e6d('0x2'));var express=require(_0x5e6d('0x3'));var router=express[_0x5e6d('0x4')]();var fs_extra=require(_0x5e6d('0x5'));var auth=require(_0x5e6d('0x6'));var interaction=require(_0x5e6d('0x7'));var config=require(_0x5e6d('0x8'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0x5e6d('0x9')](),controller[_0x5e6d('0xa')]);router[_0x5e6d('0xb')](_0x5e6d('0xc'),auth['isAuthenticated'](),controller[_0x5e6d('0xd')]);router[_0x5e6d('0xb')](_0x5e6d('0xe'),auth[_0x5e6d('0x9')](),controller[_0x5e6d('0xf')]);router[_0x5e6d('0xb')](_0x5e6d('0x10'),auth[_0x5e6d('0x9')](),controller[_0x5e6d('0x11')]);router[_0x5e6d('0xb')](_0x5e6d('0x12'),auth[_0x5e6d('0x9')](),controller[_0x5e6d('0x13')]);router[_0x5e6d('0x14')]('/',auth['isAuthenticated'](),controller[_0x5e6d('0x15')]);router[_0x5e6d('0x16')](_0x5e6d('0xc'),auth['isAuthenticated'](),controller[_0x5e6d('0x17')]);router[_0x5e6d('0x18')](_0x5e6d('0xc'),auth[_0x5e6d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x502c=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','show','getSubjects','/:id/descriptions','getDescriptions','post','update','destroy','exports','multer','util','path'];(function(_0x150397,_0x258581){var _0x5cadab=function(_0x3052d6){while(--_0x3052d6){_0x150397['push'](_0x150397['shift']());}};_0x5cadab(++_0x258581);}(_0x502c,0x1f1));var _0xc502=function(_0xba24f8,_0x4da107){_0xba24f8=_0xba24f8-0x0;var _0x430857=_0x502c[_0xba24f8];return _0x430857;};'use strict';var multer=require(_0xc502('0x0'));var util=require(_0xc502('0x1'));var path=require(_0xc502('0x2'));var timeout=require(_0xc502('0x3'));var express=require(_0xc502('0x4'));var router=express[_0xc502('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc502('0x6'));var config=require(_0xc502('0x7'));var controller=require(_0xc502('0x8'));router[_0xc502('0x9')]('/',auth[_0xc502('0xa')](),controller[_0xc502('0xb')]);router[_0xc502('0x9')]('/:id',auth[_0xc502('0xa')](),controller[_0xc502('0xc')]);router['get']('/:id/fields',auth[_0xc502('0xa')](),controller['getFields']);router[_0xc502('0x9')]('/:id/subjects',auth[_0xc502('0xa')](),controller[_0xc502('0xd')]);router[_0xc502('0x9')](_0xc502('0xe'),auth[_0xc502('0xa')](),controller[_0xc502('0xf')]);router[_0xc502('0x10')]('/',auth[_0xc502('0xa')](),controller['create']);router['put']('/:id',auth[_0xc502('0xa')](),controller[_0xc502('0x11')]);router['delete']('/:id',auth[_0xc502('0xa')](),controller[_0xc502('0x12')]);module[_0xc502('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index f74e852..2892c0b 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 _0x3ec3=['sequelize','exports','STRING','lead','nothing','ENUM','contact_lead','contact'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3ec3,0x148));var _0x33ec=function(_0x1682a9,_0x34b75f){_0x1682a9=_0x1682a9-0x0;var _0x1cdf47=_0x3ec3[_0x1682a9];return _0x1cdf47;};'use strict';var Sequelize=require(_0x33ec('0x0'));module[_0x33ec('0x1')]={'name':{'type':Sequelize[_0x33ec('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x33ec('0x3'),'contact',_0x33ec('0x4')),'defaultValue':_0x33ec('0x3')},'moduleSearch':{'type':Sequelize[_0x33ec('0x5')](_0x33ec('0x6'),_0x33ec('0x7'),_0x33ec('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x33ec('0x2')]}}; \ No newline at end of file +var _0x138b=['STRING','ENUM','lead','contact','nothing','contact_lead','exports'];(function(_0xc95e9b,_0x4e9058){var _0x43d048=function(_0x9fba56){while(--_0x9fba56){_0xc95e9b['push'](_0xc95e9b['shift']());}};_0x43d048(++_0x4e9058);}(_0x138b,0x156));var _0xb138=function(_0x3df43a,_0x109af6){_0x3df43a=_0x3df43a-0x0;var _0x25d612=_0x138b[_0x3df43a];return _0x25d612;};'use strict';var Sequelize=require('sequelize');module[_0xb138('0x0')]={'name':{'type':Sequelize[_0xb138('0x1')]},'moduleCreate':{'type':Sequelize[_0xb138('0x2')](_0xb138('0x3'),_0xb138('0x4'),_0xb138('0x5')),'defaultValue':_0xb138('0x3')},'moduleSearch':{'type':Sequelize[_0xb138('0x2')]('contact_lead','contact',_0xb138('0x3')),'defaultValue':_0xb138('0x6')},'description':{'type':Sequelize[_0xb138('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 5b5f55d..00b55cc 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 _0x57ad=['getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','findAll','rows','catch','show','include','create','body','params','destroy','find','getFields','findOne','ZohoField','getSubjects'];(function(_0x28629b,_0x2b2d2a){var _0x290ae7=function(_0x1c96ca){while(--_0x1c96ca){_0x28629b['push'](_0x28629b['shift']());}};_0x290ae7(++_0x2b2d2a);}(_0x57ad,0x145));var _0xd57a=function(_0x40bcc0,_0x58e25a){_0x40bcc0=_0x40bcc0-0x0;var _0x314620=_0x57ad[_0x40bcc0];return _0x314620;};'use strict';var emlformat=require(_0xd57a('0x0'));var rimraf=require(_0xd57a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd57a('0x2'));var rp=require(_0xd57a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd57a('0x4'));var util=require(_0xd57a('0x5'));var path=require(_0xd57a('0x6'));var sox=require('sox');var csv=require(_0xd57a('0x7'));var ejs=require(_0xd57a('0x8'));var fs=require('fs');var fs_extra=require(_0xd57a('0x9'));var _=require(_0xd57a('0xa'));var squel=require(_0xd57a('0xb'));var crypto=require(_0xd57a('0xc'));var jsforce=require(_0xd57a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd57a('0xe'));var Papa=require('papaparse');var Redis=require(_0xd57a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd57a('0x10'));var as=require(_0xd57a('0x11'));var hardwareService=require(_0xd57a('0x12'));var logger=require(_0xd57a('0x13'))('api');var utils=require(_0xd57a('0x14'));var config=require(_0xd57a('0x15'));var licenseUtil=require(_0xd57a('0x16'));var db=require(_0xd57a('0x17'))['db'];function respondWithStatusCode(_0x19e2eb,_0x4a5457){_0x4a5457=_0x4a5457||0xcc;return function(_0x5326bf){if(_0x5326bf){return _0x19e2eb['sendStatus'](_0x4a5457);}return _0x19e2eb[_0xd57a('0x18')](_0x4a5457)['end']();};}function respondWithResult(_0x1d98f7,_0x7c2840){_0x7c2840=_0x7c2840||0xc8;return function(_0x3b78c2){if(_0x3b78c2){return _0x1d98f7[_0xd57a('0x18')](_0x7c2840)[_0xd57a('0x19')](_0x3b78c2);}};}function respondWithFilteredResult(_0x3f8f59,_0x14b94c){return function(_0xe7903a){if(_0xe7903a){var _0x1a3754=typeof _0x14b94c['offset']===_0xd57a('0x1a')&&typeof _0x14b94c[_0xd57a('0x1b')]==='undefined';var _0x32618e=_0xe7903a[_0xd57a('0x1c')];var _0x584573=_0x1a3754?0x0:_0x14b94c[_0xd57a('0x1d')];var _0x293264=_0x1a3754?_0xe7903a[_0xd57a('0x1c')]:_0x14b94c[_0xd57a('0x1d')]+_0x14b94c[_0xd57a('0x1b')];var _0x4bd339;if(_0x293264>=_0x32618e){_0x293264=_0x32618e;_0x4bd339=0xc8;}else{_0x4bd339=0xce;}_0x3f8f59[_0xd57a('0x18')](_0x4bd339);return _0x3f8f59[_0xd57a('0x1e')](_0xd57a('0x1f'),_0x584573+'-'+_0x293264+'/'+_0x32618e)[_0xd57a('0x19')](_0xe7903a);}return null;};}function patchUpdates(_0x5cad2b){return function(_0x55e247){try{jsonpatch[_0xd57a('0x20')](_0x55e247,_0x5cad2b,!![]);}catch(_0x554a4e){return BPromise['reject'](_0x554a4e);}return _0x55e247[_0xd57a('0x21')]();};}function saveUpdates(_0x7acc8f,_0x513096){return function(_0x9904c){if(_0x9904c){return _0x9904c[_0xd57a('0x22')](_0x7acc8f)['then'](function(_0xce2686){return _0xce2686;});}return null;};}function removeEntity(_0x54161c,_0x479a94){return function(_0x1301ba){if(_0x1301ba){return _0x1301ba['destroy']()['then'](function(){_0x54161c[_0xd57a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x164dd1,_0x47bb1f){return function(_0x51de86){if(!_0x51de86){_0x164dd1[_0xd57a('0x23')](0x194);}return _0x51de86;};}function handleError(_0x32e251,_0xd87237){_0xd87237=_0xd87237||0x1f4;return function(_0x40e211){logger[_0xd57a('0x24')](_0x40e211[_0xd57a('0x25')]);if(_0x40e211[_0xd57a('0x26')]){delete _0x40e211[_0xd57a('0x26')];}_0x32e251['status'](_0xd87237)[_0xd57a('0x27')](_0x40e211);};}exports[_0xd57a('0x28')]=function(_0x1be8be,_0x49ec6c){var _0x54d365={},_0x2d90f1={},_0x290a4e={'count':0x0,'rows':[]};var _0x554cdb=_[_0xd57a('0x29')](db[_0xd57a('0x2a')][_0xd57a('0x2b')],function(_0x37bf25){return{'name':_0x37bf25[_0xd57a('0x2c')],'type':_0x37bf25[_0xd57a('0x2d')][_0xd57a('0x2e')]};});_0x2d90f1[_0xd57a('0x2f')]=_['map'](_0x554cdb,_0xd57a('0x26'));_0x2d90f1[_0xd57a('0x30')]=_[_0xd57a('0x31')](_0x1be8be[_0xd57a('0x30')]);_0x2d90f1[_0xd57a('0x32')]=_['intersection'](_0x2d90f1[_0xd57a('0x2f')],_0x2d90f1[_0xd57a('0x30')]);_0x54d365[_0xd57a('0x33')]=_[_0xd57a('0x34')](_0x2d90f1['model'],qs[_0xd57a('0x35')](_0x1be8be[_0xd57a('0x30')]['fields']));_0x54d365['attributes']=_0x54d365[_0xd57a('0x33')][_0xd57a('0x36')]?_0x54d365[_0xd57a('0x33')]:_0x2d90f1[_0xd57a('0x2f')];if(!_0x1be8be[_0xd57a('0x30')][_0xd57a('0x37')](_0xd57a('0x38'))){_0x54d365['limit']=qs[_0xd57a('0x1b')](_0x1be8be[_0xd57a('0x30')]['limit']);_0x54d365[_0xd57a('0x1d')]=qs[_0xd57a('0x1d')](_0x1be8be[_0xd57a('0x30')]['offset']);}_0x54d365[_0xd57a('0x39')]=qs[_0xd57a('0x3a')](_0x1be8be['query']['sort']);_0x54d365['where']=qs['filters'](_[_0xd57a('0x3b')](_0x1be8be[_0xd57a('0x30')],_0x2d90f1[_0xd57a('0x32')]),_0x554cdb);if(_0x1be8be[_0xd57a('0x30')][_0xd57a('0x3c')]){_0x54d365[_0xd57a('0x3d')]=_['merge'](_0x54d365[_0xd57a('0x3d')],{'$or':_[_0xd57a('0x29')](_0x554cdb,function(_0x3f5282){if(_0x3f5282[_0xd57a('0x2d')]!==_0xd57a('0x3e')){var _0x327fc5={};_0x327fc5[_0x3f5282[_0xd57a('0x26')]]={'$like':'%'+_0x1be8be['query']['filter']+'%'};return _0x327fc5;}})});}_0x54d365=_[_0xd57a('0x3f')]({},_0x54d365,_0x1be8be[_0xd57a('0x40')]);var _0x4a133c={'where':_0x54d365['where']};return db[_0xd57a('0x2a')][_0xd57a('0x1c')](_0x4a133c)[_0xd57a('0x41')](function(_0x54bd9f){_0x290a4e[_0xd57a('0x1c')]=_0x54bd9f;if(_0x1be8be['query']['includeAll']){_0x54d365['include']=[{'all':!![]}];}return db[_0xd57a('0x2a')][_0xd57a('0x42')](_0x54d365);})['then'](function(_0xce763b){_0x290a4e[_0xd57a('0x43')]=_0xce763b;return _0x290a4e;})[_0xd57a('0x41')](respondWithFilteredResult(_0x49ec6c,_0x54d365))[_0xd57a('0x44')](handleError(_0x49ec6c,null));};exports[_0xd57a('0x45')]=function(_0x303ef7,_0x34bb13){var _0xc28f7d={'raw':![],'where':{'id':_0x303ef7['params']['id']}},_0x424b66={};_0x424b66[_0xd57a('0x2f')]=_[_0xd57a('0x31')](db['ZohoConfiguration'][_0xd57a('0x2b')]);_0x424b66[_0xd57a('0x30')]=_[_0xd57a('0x31')](_0x303ef7[_0xd57a('0x30')]);_0x424b66[_0xd57a('0x32')]=_[_0xd57a('0x34')](_0x424b66[_0xd57a('0x2f')],_0x424b66['query']);_0xc28f7d[_0xd57a('0x33')]=_[_0xd57a('0x34')](_0x424b66[_0xd57a('0x2f')],qs[_0xd57a('0x35')](_0x303ef7['query'][_0xd57a('0x35')]));_0xc28f7d[_0xd57a('0x33')]=_0xc28f7d[_0xd57a('0x33')][_0xd57a('0x36')]?_0xc28f7d[_0xd57a('0x33')]:_0x424b66[_0xd57a('0x2f')];if(_0x303ef7['query']['includeAll']){_0xc28f7d[_0xd57a('0x46')]=[{'all':!![]}];}_0xc28f7d=_[_0xd57a('0x3f')]({},_0xc28f7d,_0x303ef7[_0xd57a('0x40')]);return db[_0xd57a('0x2a')]['find'](_0xc28f7d)['then'](handleEntityNotFound(_0x34bb13,null))[_0xd57a('0x41')](respondWithResult(_0x34bb13,null))['catch'](handleError(_0x34bb13,null));};exports['create']=function(_0x2f9522,_0x10abb4){return db[_0xd57a('0x2a')][_0xd57a('0x47')](_0x2f9522[_0xd57a('0x48')],{})['then'](respondWithResult(_0x10abb4,0xc9))[_0xd57a('0x44')](handleError(_0x10abb4,null));};exports[_0xd57a('0x22')]=function(_0x44ad4d,_0x39e7f4){if(_0x44ad4d[_0xd57a('0x48')]['id']){delete _0x44ad4d['body']['id'];}return db[_0xd57a('0x2a')]['find']({'where':{'id':_0x44ad4d[_0xd57a('0x49')]['id']}})[_0xd57a('0x41')](handleEntityNotFound(_0x39e7f4,null))[_0xd57a('0x41')](saveUpdates(_0x44ad4d[_0xd57a('0x48')],null))['then'](respondWithResult(_0x39e7f4,null))['catch'](handleError(_0x39e7f4,null));};exports[_0xd57a('0x4a')]=function(_0x233e8f,_0x5ed294){return db[_0xd57a('0x2a')][_0xd57a('0x4b')]({'where':{'id':_0x233e8f['params']['id']}})['then'](handleEntityNotFound(_0x5ed294,null))[_0xd57a('0x41')](removeEntity(_0x5ed294,null))[_0xd57a('0x44')](handleError(_0x5ed294,null));};exports[_0xd57a('0x4c')]=function(_0x531ae9,_0x51b8f5,_0x26276e){var _0xb34d1c={};var _0x1d453f={};var _0x33b3df;var _0xe2b784;return db[_0xd57a('0x2a')][_0xd57a('0x4d')]({'where':{'id':_0x531ae9[_0xd57a('0x49')]['id']}})[_0xd57a('0x41')](handleEntityNotFound(_0x51b8f5,null))[_0xd57a('0x41')](function(_0x3b4c8a){if(_0x3b4c8a){_0x33b3df=_0x3b4c8a;_0x1d453f[_0xd57a('0x2f')]=_[_0xd57a('0x31')](db[_0xd57a('0x4e')]['rawAttributes']);_0x1d453f[_0xd57a('0x30')]=_[_0xd57a('0x31')](_0x531ae9[_0xd57a('0x30')]);_0x1d453f[_0xd57a('0x32')]=_[_0xd57a('0x34')](_0x1d453f[_0xd57a('0x2f')],_0x1d453f[_0xd57a('0x30')]);_0xb34d1c[_0xd57a('0x33')]=_[_0xd57a('0x34')](_0x1d453f[_0xd57a('0x2f')],qs[_0xd57a('0x35')](_0x531ae9['query']['fields']));_0xb34d1c[_0xd57a('0x33')]=_0xb34d1c['attributes']['length']?_0xb34d1c[_0xd57a('0x33')]:_0x1d453f['model'];_0xb34d1c[_0xd57a('0x39')]=qs[_0xd57a('0x3a')](_0x531ae9[_0xd57a('0x30')][_0xd57a('0x3a')]);_0xb34d1c[_0xd57a('0x3d')]=qs['filters'](_[_0xd57a('0x3b')](_0x531ae9['query'],_0x1d453f[_0xd57a('0x32')]));if(_0x531ae9[_0xd57a('0x30')]['filter']){_0xb34d1c[_0xd57a('0x3d')]=_[_0xd57a('0x3f')](_0xb34d1c[_0xd57a('0x3d')],{'$or':_[_0xd57a('0x29')](_0xb34d1c['attributes'],function(_0x5244f9){var _0x2e8f33={};_0x2e8f33[_0x5244f9]={'$like':'%'+_0x531ae9['query'][_0xd57a('0x3c')]+'%'};return _0x2e8f33;})});}_0xb34d1c=_[_0xd57a('0x3f')]({},_0xb34d1c,_0x531ae9[_0xd57a('0x40')]);return _0x33b3df[_0xd57a('0x4c')](_0xb34d1c);}})[_0xd57a('0x41')](function(_0x4e86a2){if(_0x4e86a2){_0xe2b784=_0x4e86a2[_0xd57a('0x36')];if(!_0x531ae9[_0xd57a('0x30')]['hasOwnProperty'](_0xd57a('0x38'))){_0xb34d1c[_0xd57a('0x1b')]=qs[_0xd57a('0x1b')](_0x531ae9[_0xd57a('0x30')]['limit']);_0xb34d1c[_0xd57a('0x1d')]=qs[_0xd57a('0x1d')](_0x531ae9['query'][_0xd57a('0x1d')]);}return _0x33b3df[_0xd57a('0x4c')](_0xb34d1c);}})[_0xd57a('0x41')](function(_0x14cc11){if(_0x14cc11){return _0x14cc11?{'count':_0xe2b784,'rows':_0x14cc11}:null;}})[_0xd57a('0x41')](respondWithResult(_0x51b8f5,null))[_0xd57a('0x44')](handleError(_0x51b8f5,null));};exports[_0xd57a('0x4f')]=function(_0x56d390,_0x16ec39,_0x24654b){var _0xb8f196={};var _0x50c833={};var _0xa3123e;var _0x58ede1;return db[_0xd57a('0x2a')]['findOne']({'where':{'id':_0x56d390['params']['id']}})[_0xd57a('0x41')](handleEntityNotFound(_0x16ec39,null))[_0xd57a('0x41')](function(_0x107ae2){if(_0x107ae2){_0xa3123e=_0x107ae2;_0x50c833[_0xd57a('0x2f')]=_[_0xd57a('0x31')](db[_0xd57a('0x4e')]['rawAttributes']);_0x50c833[_0xd57a('0x30')]=_[_0xd57a('0x31')](_0x56d390[_0xd57a('0x30')]);_0x50c833[_0xd57a('0x32')]=_[_0xd57a('0x34')](_0x50c833[_0xd57a('0x2f')],_0x50c833[_0xd57a('0x30')]);_0xb8f196[_0xd57a('0x33')]=_[_0xd57a('0x34')](_0x50c833[_0xd57a('0x2f')],qs[_0xd57a('0x35')](_0x56d390[_0xd57a('0x30')][_0xd57a('0x35')]));_0xb8f196[_0xd57a('0x33')]=_0xb8f196['attributes'][_0xd57a('0x36')]?_0xb8f196[_0xd57a('0x33')]:_0x50c833['model'];_0xb8f196[_0xd57a('0x39')]=qs[_0xd57a('0x3a')](_0x56d390[_0xd57a('0x30')][_0xd57a('0x3a')]);_0xb8f196[_0xd57a('0x3d')]=qs['filters'](_['pick'](_0x56d390['query'],_0x50c833[_0xd57a('0x32')]));if(_0x56d390[_0xd57a('0x30')]['filter']){_0xb8f196[_0xd57a('0x3d')]=_[_0xd57a('0x3f')](_0xb8f196[_0xd57a('0x3d')],{'$or':_['map'](_0xb8f196['attributes'],function(_0x1aa464){var _0x39176f={};_0x39176f[_0x1aa464]={'$like':'%'+_0x56d390[_0xd57a('0x30')]['filter']+'%'};return _0x39176f;})});}_0xb8f196=_['merge']({},_0xb8f196,_0x56d390['options']);return _0xa3123e[_0xd57a('0x4f')](_0xb8f196);}})[_0xd57a('0x41')](function(_0x2e38de){if(_0x2e38de){_0x58ede1=_0x2e38de[_0xd57a('0x36')];if(!_0x56d390[_0xd57a('0x30')]['hasOwnProperty'](_0xd57a('0x38'))){_0xb8f196[_0xd57a('0x1b')]=qs[_0xd57a('0x1b')](_0x56d390[_0xd57a('0x30')][_0xd57a('0x1b')]);_0xb8f196[_0xd57a('0x1d')]=qs[_0xd57a('0x1d')](_0x56d390['query'][_0xd57a('0x1d')]);}return _0xa3123e[_0xd57a('0x4f')](_0xb8f196);}})['then'](function(_0x174832){if(_0x174832){return _0x174832?{'count':_0x58ede1,'rows':_0x174832}:null;}})[_0xd57a('0x41')](respondWithResult(_0x16ec39,null))['catch'](handleError(_0x16ec39,null));};exports['getDescriptions']=function(_0x27bb96,_0x3563d5,_0x27ba26){var _0x4d6ec3={};var _0x2ba6c5={};var _0x192179;var _0x403b8b;return db[_0xd57a('0x2a')][_0xd57a('0x4d')]({'where':{'id':_0x27bb96[_0xd57a('0x49')]['id']}})['then'](handleEntityNotFound(_0x3563d5,null))['then'](function(_0x35d925){if(_0x35d925){_0x192179=_0x35d925;_0x2ba6c5[_0xd57a('0x2f')]=_[_0xd57a('0x31')](db[_0xd57a('0x4e')][_0xd57a('0x2b')]);_0x2ba6c5[_0xd57a('0x30')]=_[_0xd57a('0x31')](_0x27bb96[_0xd57a('0x30')]);_0x2ba6c5[_0xd57a('0x32')]=_[_0xd57a('0x34')](_0x2ba6c5[_0xd57a('0x2f')],_0x2ba6c5[_0xd57a('0x30')]);_0x4d6ec3[_0xd57a('0x33')]=_[_0xd57a('0x34')](_0x2ba6c5[_0xd57a('0x2f')],qs[_0xd57a('0x35')](_0x27bb96[_0xd57a('0x30')][_0xd57a('0x35')]));_0x4d6ec3['attributes']=_0x4d6ec3[_0xd57a('0x33')]['length']?_0x4d6ec3['attributes']:_0x2ba6c5['model'];_0x4d6ec3[_0xd57a('0x39')]=qs[_0xd57a('0x3a')](_0x27bb96['query'][_0xd57a('0x3a')]);_0x4d6ec3[_0xd57a('0x3d')]=qs['filters'](_[_0xd57a('0x3b')](_0x27bb96['query'],_0x2ba6c5[_0xd57a('0x32')]));if(_0x27bb96[_0xd57a('0x30')]['filter']){_0x4d6ec3[_0xd57a('0x3d')]=_['merge'](_0x4d6ec3[_0xd57a('0x3d')],{'$or':_[_0xd57a('0x29')](_0x4d6ec3['attributes'],function(_0x1c35c7){var _0x40f02c={};_0x40f02c[_0x1c35c7]={'$like':'%'+_0x27bb96['query'][_0xd57a('0x3c')]+'%'};return _0x40f02c;})});}_0x4d6ec3=_['merge']({},_0x4d6ec3,_0x27bb96[_0xd57a('0x40')]);return _0x192179[_0xd57a('0x50')](_0x4d6ec3);}})[_0xd57a('0x41')](function(_0x5ae160){if(_0x5ae160){_0x403b8b=_0x5ae160[_0xd57a('0x36')];if(!_0x27bb96[_0xd57a('0x30')][_0xd57a('0x37')](_0xd57a('0x38'))){_0x4d6ec3[_0xd57a('0x1b')]=qs['limit'](_0x27bb96[_0xd57a('0x30')][_0xd57a('0x1b')]);_0x4d6ec3[_0xd57a('0x1d')]=qs[_0xd57a('0x1d')](_0x27bb96[_0xd57a('0x30')][_0xd57a('0x1d')]);}return _0x192179[_0xd57a('0x50')](_0x4d6ec3);}})[_0xd57a('0x41')](function(_0xb63cae){if(_0xb63cae){return _0xb63cae?{'count':_0x403b8b,'rows':_0xb63cae}:null;}})['then'](respondWithResult(_0x3563d5,null))[_0xd57a('0x44')](handleError(_0x3563d5,null));}; \ No newline at end of file +var _0x4873=['end','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','findAll','rows','show','params','length','includeAll','find','catch','create','body','getFields','findOne','ZohoField','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy'];(function(_0xf6ca8e,_0x280706){var _0xb44fcd=function(_0xdc879e){while(--_0xdc879e){_0xf6ca8e['push'](_0xf6ca8e['shift']());}};_0xb44fcd(++_0x280706);}(_0x4873,0x7c));var _0x3487=function(_0x56fed8,_0x517c21){_0x56fed8=_0x56fed8-0x0;var _0x21bc5b=_0x4873[_0x56fed8];return _0x21bc5b;};'use strict';var emlformat=require(_0x3487('0x0'));var rimraf=require(_0x3487('0x1'));var zipdir=require(_0x3487('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3487('0x3'));var moment=require(_0x3487('0x4'));var BPromise=require(_0x3487('0x5'));var Mustache=require('mustache');var util=require(_0x3487('0x6'));var path=require(_0x3487('0x7'));var sox=require('sox');var csv=require(_0x3487('0x8'));var ejs=require(_0x3487('0x9'));var fs=require('fs');var fs_extra=require(_0x3487('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3487('0xb'));var deskjs=require(_0x3487('0xc'));var toCsv=require(_0x3487('0x8'));var querystring=require(_0x3487('0xd'));var Papa=require(_0x3487('0xe'));var Redis=require(_0x3487('0xf'));var authService=require(_0x3487('0x10'));var qs=require(_0x3487('0x11'));var as=require(_0x3487('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3487('0x13'))(_0x3487('0x14'));var utils=require(_0x3487('0x15'));var config=require(_0x3487('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3487('0x17'))['db'];function respondWithStatusCode(_0x312e98,_0x2e1445){_0x2e1445=_0x2e1445||0xcc;return function(_0x1b515a){if(_0x1b515a){return _0x312e98[_0x3487('0x18')](_0x2e1445);}return _0x312e98['status'](_0x2e1445)['end']();};}function respondWithResult(_0x88b4bc,_0x4efb04){_0x4efb04=_0x4efb04||0xc8;return function(_0x2c9255){if(_0x2c9255){return _0x88b4bc[_0x3487('0x19')](_0x4efb04)['json'](_0x2c9255);}};}function respondWithFilteredResult(_0xdabf9d,_0x41225d){return function(_0x2df947){if(_0x2df947){var _0x460027=typeof _0x41225d[_0x3487('0x1a')]===_0x3487('0x1b')&&typeof _0x41225d[_0x3487('0x1c')]===_0x3487('0x1b');var _0x25b2b2=_0x2df947[_0x3487('0x1d')];var _0x2bc54e=_0x460027?0x0:_0x41225d[_0x3487('0x1a')];var _0x18c624=_0x460027?_0x2df947['count']:_0x41225d[_0x3487('0x1a')]+_0x41225d[_0x3487('0x1c')];var _0xbda1f6;if(_0x18c624>=_0x25b2b2){_0x18c624=_0x25b2b2;_0xbda1f6=0xc8;}else{_0xbda1f6=0xce;}_0xdabf9d[_0x3487('0x19')](_0xbda1f6);return _0xdabf9d[_0x3487('0x1e')](_0x3487('0x1f'),_0x2bc54e+'-'+_0x18c624+'/'+_0x25b2b2)[_0x3487('0x20')](_0x2df947);}return null;};}function patchUpdates(_0x1a4c7e){return function(_0x11a9af){try{jsonpatch[_0x3487('0x21')](_0x11a9af,_0x1a4c7e,!![]);}catch(_0x2b2985){return BPromise['reject'](_0x2b2985);}return _0x11a9af[_0x3487('0x22')]();};}function saveUpdates(_0x3c94b4,_0x3aea6c){return function(_0x2526dc){if(_0x2526dc){return _0x2526dc[_0x3487('0x23')](_0x3c94b4)[_0x3487('0x24')](function(_0x24c03f){return _0x24c03f;});}return null;};}function removeEntity(_0x193f46,_0x218bb9){return function(_0x57d658){if(_0x57d658){return _0x57d658[_0x3487('0x25')]()[_0x3487('0x24')](function(){_0x193f46[_0x3487('0x19')](0xcc)[_0x3487('0x26')]();});}};}function handleEntityNotFound(_0x4d9b71,_0x2d8862){return function(_0x47ecc5){if(!_0x47ecc5){_0x4d9b71['sendStatus'](0x194);}return _0x47ecc5;};}function handleError(_0x3195d5,_0x552a32){_0x552a32=_0x552a32||0x1f4;return function(_0x107ae2){logger[_0x3487('0x27')](_0x107ae2[_0x3487('0x28')]);if(_0x107ae2[_0x3487('0x29')]){delete _0x107ae2['name'];}_0x3195d5[_0x3487('0x19')](_0x552a32)[_0x3487('0x2a')](_0x107ae2);};}exports[_0x3487('0x2b')]=function(_0x53551d,_0x2261ee){var _0x8bdc69={},_0x144c3c={},_0x998682={'count':0x0,'rows':[]};var _0x2c1e38=_[_0x3487('0x2c')](db[_0x3487('0x2d')][_0x3487('0x2e')],function(_0x4c9a9e){return{'name':_0x4c9a9e[_0x3487('0x2f')],'type':_0x4c9a9e[_0x3487('0x30')][_0x3487('0x31')]};});_0x144c3c[_0x3487('0x32')]=_[_0x3487('0x2c')](_0x2c1e38,_0x3487('0x29'));_0x144c3c[_0x3487('0x33')]=_[_0x3487('0x34')](_0x53551d[_0x3487('0x33')]);_0x144c3c[_0x3487('0x35')]=_['intersection'](_0x144c3c[_0x3487('0x32')],_0x144c3c[_0x3487('0x33')]);_0x8bdc69[_0x3487('0x36')]=_[_0x3487('0x37')](_0x144c3c[_0x3487('0x32')],qs[_0x3487('0x38')](_0x53551d[_0x3487('0x33')][_0x3487('0x38')]));_0x8bdc69[_0x3487('0x36')]=_0x8bdc69[_0x3487('0x36')]['length']?_0x8bdc69['attributes']:_0x144c3c[_0x3487('0x32')];if(!_0x53551d[_0x3487('0x33')][_0x3487('0x39')](_0x3487('0x3a'))){_0x8bdc69['limit']=qs['limit'](_0x53551d[_0x3487('0x33')][_0x3487('0x1c')]);_0x8bdc69['offset']=qs[_0x3487('0x1a')](_0x53551d['query'][_0x3487('0x1a')]);}_0x8bdc69[_0x3487('0x3b')]=qs[_0x3487('0x3c')](_0x53551d[_0x3487('0x33')]['sort']);_0x8bdc69[_0x3487('0x3d')]=qs[_0x3487('0x35')](_['pick'](_0x53551d[_0x3487('0x33')],_0x144c3c[_0x3487('0x35')]),_0x2c1e38);if(_0x53551d[_0x3487('0x33')]['filter']){_0x8bdc69[_0x3487('0x3d')]=_[_0x3487('0x3e')](_0x8bdc69['where'],{'$or':_[_0x3487('0x2c')](_0x2c1e38,function(_0x37bb70){if(_0x37bb70[_0x3487('0x30')]!=='VIRTUAL'){var _0x39c85e={};_0x39c85e[_0x37bb70[_0x3487('0x29')]]={'$like':'%'+_0x53551d['query'][_0x3487('0x3f')]+'%'};return _0x39c85e;}})});}_0x8bdc69=_[_0x3487('0x3e')]({},_0x8bdc69,_0x53551d[_0x3487('0x40')]);var _0x5aaee9={'where':_0x8bdc69[_0x3487('0x3d')]};return db[_0x3487('0x2d')][_0x3487('0x1d')](_0x5aaee9)[_0x3487('0x24')](function(_0x345278){_0x998682['count']=_0x345278;if(_0x53551d[_0x3487('0x33')]['includeAll']){_0x8bdc69['include']=[{'all':!![]}];}return db[_0x3487('0x2d')][_0x3487('0x41')](_0x8bdc69);})[_0x3487('0x24')](function(_0x176343){_0x998682[_0x3487('0x42')]=_0x176343;return _0x998682;})[_0x3487('0x24')](respondWithFilteredResult(_0x2261ee,_0x8bdc69))['catch'](handleError(_0x2261ee,null));};exports[_0x3487('0x43')]=function(_0x46e04e,_0x4b1f55){var _0x2f2e56={'raw':![],'where':{'id':_0x46e04e[_0x3487('0x44')]['id']}},_0x245263={};_0x245263['model']=_[_0x3487('0x34')](db[_0x3487('0x2d')][_0x3487('0x2e')]);_0x245263['query']=_[_0x3487('0x34')](_0x46e04e[_0x3487('0x33')]);_0x245263['filters']=_[_0x3487('0x37')](_0x245263['model'],_0x245263[_0x3487('0x33')]);_0x2f2e56[_0x3487('0x36')]=_[_0x3487('0x37')](_0x245263[_0x3487('0x32')],qs[_0x3487('0x38')](_0x46e04e[_0x3487('0x33')][_0x3487('0x38')]));_0x2f2e56[_0x3487('0x36')]=_0x2f2e56[_0x3487('0x36')][_0x3487('0x45')]?_0x2f2e56[_0x3487('0x36')]:_0x245263[_0x3487('0x32')];if(_0x46e04e[_0x3487('0x33')][_0x3487('0x46')]){_0x2f2e56['include']=[{'all':!![]}];}_0x2f2e56=_[_0x3487('0x3e')]({},_0x2f2e56,_0x46e04e[_0x3487('0x40')]);return db['ZohoConfiguration'][_0x3487('0x47')](_0x2f2e56)[_0x3487('0x24')](handleEntityNotFound(_0x4b1f55,null))['then'](respondWithResult(_0x4b1f55,null))[_0x3487('0x48')](handleError(_0x4b1f55,null));};exports['create']=function(_0xfa4b83,_0xcd2b14){return db[_0x3487('0x2d')][_0x3487('0x49')](_0xfa4b83['body'],{})[_0x3487('0x24')](respondWithResult(_0xcd2b14,0xc9))[_0x3487('0x48')](handleError(_0xcd2b14,null));};exports[_0x3487('0x23')]=function(_0x50f64f,_0xfad25b){if(_0x50f64f['body']['id']){delete _0x50f64f[_0x3487('0x4a')]['id'];}return db[_0x3487('0x2d')][_0x3487('0x47')]({'where':{'id':_0x50f64f[_0x3487('0x44')]['id']}})['then'](handleEntityNotFound(_0xfad25b,null))[_0x3487('0x24')](saveUpdates(_0x50f64f[_0x3487('0x4a')],null))['then'](respondWithResult(_0xfad25b,null))[_0x3487('0x48')](handleError(_0xfad25b,null));};exports[_0x3487('0x25')]=function(_0x3c7991,_0xa9b6cb){return db[_0x3487('0x2d')][_0x3487('0x47')]({'where':{'id':_0x3c7991['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0xa9b6cb,null))[_0x3487('0x24')](removeEntity(_0xa9b6cb,null))[_0x3487('0x48')](handleError(_0xa9b6cb,null));};exports[_0x3487('0x4b')]=function(_0x18c2f3,_0x853c16,_0x34cf67){var _0xcdef85={};var _0x187373={};var _0x32b634;var _0xce717f;return db[_0x3487('0x2d')][_0x3487('0x4c')]({'where':{'id':_0x18c2f3[_0x3487('0x44')]['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x853c16,null))[_0x3487('0x24')](function(_0x3f54d5){if(_0x3f54d5){_0x32b634=_0x3f54d5;_0x187373[_0x3487('0x32')]=_[_0x3487('0x34')](db[_0x3487('0x4d')][_0x3487('0x2e')]);_0x187373[_0x3487('0x33')]=_[_0x3487('0x34')](_0x18c2f3[_0x3487('0x33')]);_0x187373[_0x3487('0x35')]=_[_0x3487('0x37')](_0x187373[_0x3487('0x32')],_0x187373[_0x3487('0x33')]);_0xcdef85['attributes']=_[_0x3487('0x37')](_0x187373[_0x3487('0x32')],qs[_0x3487('0x38')](_0x18c2f3['query']['fields']));_0xcdef85[_0x3487('0x36')]=_0xcdef85['attributes'][_0x3487('0x45')]?_0xcdef85[_0x3487('0x36')]:_0x187373[_0x3487('0x32')];_0xcdef85['order']=qs[_0x3487('0x3c')](_0x18c2f3[_0x3487('0x33')][_0x3487('0x3c')]);_0xcdef85['where']=qs[_0x3487('0x35')](_['pick'](_0x18c2f3['query'],_0x187373['filters']));if(_0x18c2f3['query'][_0x3487('0x3f')]){_0xcdef85[_0x3487('0x3d')]=_['merge'](_0xcdef85[_0x3487('0x3d')],{'$or':_[_0x3487('0x2c')](_0xcdef85['attributes'],function(_0x4c4892){var _0x27596b={};_0x27596b[_0x4c4892]={'$like':'%'+_0x18c2f3[_0x3487('0x33')][_0x3487('0x3f')]+'%'};return _0x27596b;})});}_0xcdef85=_[_0x3487('0x3e')]({},_0xcdef85,_0x18c2f3[_0x3487('0x40')]);return _0x32b634[_0x3487('0x4b')](_0xcdef85);}})[_0x3487('0x24')](function(_0x148703){if(_0x148703){_0xce717f=_0x148703[_0x3487('0x45')];if(!_0x18c2f3[_0x3487('0x33')][_0x3487('0x39')]('nolimit')){_0xcdef85[_0x3487('0x1c')]=qs['limit'](_0x18c2f3[_0x3487('0x33')][_0x3487('0x1c')]);_0xcdef85[_0x3487('0x1a')]=qs[_0x3487('0x1a')](_0x18c2f3[_0x3487('0x33')][_0x3487('0x1a')]);}return _0x32b634[_0x3487('0x4b')](_0xcdef85);}})['then'](function(_0x85bea4){if(_0x85bea4){return _0x85bea4?{'count':_0xce717f,'rows':_0x85bea4}:null;}})[_0x3487('0x24')](respondWithResult(_0x853c16,null))[_0x3487('0x48')](handleError(_0x853c16,null));};exports[_0x3487('0x4e')]=function(_0x32570f,_0x4a1a2d,_0x12faa9){var _0x23eae1={};var _0x253100={};var _0x34623a;var _0x47803d;return db['ZohoConfiguration'][_0x3487('0x4c')]({'where':{'id':_0x32570f[_0x3487('0x44')]['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x4a1a2d,null))[_0x3487('0x24')](function(_0x19af7b){if(_0x19af7b){_0x34623a=_0x19af7b;_0x253100[_0x3487('0x32')]=_[_0x3487('0x34')](db[_0x3487('0x4d')][_0x3487('0x2e')]);_0x253100[_0x3487('0x33')]=_[_0x3487('0x34')](_0x32570f[_0x3487('0x33')]);_0x253100[_0x3487('0x35')]=_[_0x3487('0x37')](_0x253100[_0x3487('0x32')],_0x253100['query']);_0x23eae1[_0x3487('0x36')]=_[_0x3487('0x37')](_0x253100[_0x3487('0x32')],qs['fields'](_0x32570f[_0x3487('0x33')]['fields']));_0x23eae1[_0x3487('0x36')]=_0x23eae1['attributes'][_0x3487('0x45')]?_0x23eae1[_0x3487('0x36')]:_0x253100[_0x3487('0x32')];_0x23eae1['order']=qs[_0x3487('0x3c')](_0x32570f[_0x3487('0x33')][_0x3487('0x3c')]);_0x23eae1[_0x3487('0x3d')]=qs[_0x3487('0x35')](_[_0x3487('0x4f')](_0x32570f[_0x3487('0x33')],_0x253100[_0x3487('0x35')]));if(_0x32570f[_0x3487('0x33')][_0x3487('0x3f')]){_0x23eae1['where']=_[_0x3487('0x3e')](_0x23eae1[_0x3487('0x3d')],{'$or':_[_0x3487('0x2c')](_0x23eae1['attributes'],function(_0xda5dcc){var _0x261b31={};_0x261b31[_0xda5dcc]={'$like':'%'+_0x32570f[_0x3487('0x33')][_0x3487('0x3f')]+'%'};return _0x261b31;})});}_0x23eae1=_[_0x3487('0x3e')]({},_0x23eae1,_0x32570f[_0x3487('0x40')]);return _0x34623a[_0x3487('0x4e')](_0x23eae1);}})[_0x3487('0x24')](function(_0x301045){if(_0x301045){_0x47803d=_0x301045[_0x3487('0x45')];if(!_0x32570f[_0x3487('0x33')]['hasOwnProperty'](_0x3487('0x3a'))){_0x23eae1[_0x3487('0x1c')]=qs[_0x3487('0x1c')](_0x32570f['query'][_0x3487('0x1c')]);_0x23eae1[_0x3487('0x1a')]=qs['offset'](_0x32570f['query'][_0x3487('0x1a')]);}return _0x34623a[_0x3487('0x4e')](_0x23eae1);}})[_0x3487('0x24')](function(_0x534b07){if(_0x534b07){return _0x534b07?{'count':_0x47803d,'rows':_0x534b07}:null;}})[_0x3487('0x24')](respondWithResult(_0x4a1a2d,null))[_0x3487('0x48')](handleError(_0x4a1a2d,null));};exports['getDescriptions']=function(_0x494970,_0x141aff,_0x1aa0e7){var _0x26091a={};var _0x135678={};var _0x575ab5;var _0x165b80;return db[_0x3487('0x2d')]['findOne']({'where':{'id':_0x494970['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x141aff,null))[_0x3487('0x24')](function(_0x4837c2){if(_0x4837c2){_0x575ab5=_0x4837c2;_0x135678[_0x3487('0x32')]=_[_0x3487('0x34')](db[_0x3487('0x4d')][_0x3487('0x2e')]);_0x135678[_0x3487('0x33')]=_[_0x3487('0x34')](_0x494970['query']);_0x135678[_0x3487('0x35')]=_[_0x3487('0x37')](_0x135678[_0x3487('0x32')],_0x135678[_0x3487('0x33')]);_0x26091a[_0x3487('0x36')]=_[_0x3487('0x37')](_0x135678[_0x3487('0x32')],qs[_0x3487('0x38')](_0x494970[_0x3487('0x33')][_0x3487('0x38')]));_0x26091a[_0x3487('0x36')]=_0x26091a[_0x3487('0x36')][_0x3487('0x45')]?_0x26091a[_0x3487('0x36')]:_0x135678[_0x3487('0x32')];_0x26091a['order']=qs[_0x3487('0x3c')](_0x494970[_0x3487('0x33')]['sort']);_0x26091a[_0x3487('0x3d')]=qs[_0x3487('0x35')](_[_0x3487('0x4f')](_0x494970['query'],_0x135678[_0x3487('0x35')]));if(_0x494970[_0x3487('0x33')]['filter']){_0x26091a[_0x3487('0x3d')]=_[_0x3487('0x3e')](_0x26091a['where'],{'$or':_[_0x3487('0x2c')](_0x26091a['attributes'],function(_0xdf43eb){var _0xc1b61c={};_0xc1b61c[_0xdf43eb]={'$like':'%'+_0x494970[_0x3487('0x33')][_0x3487('0x3f')]+'%'};return _0xc1b61c;})});}_0x26091a=_[_0x3487('0x3e')]({},_0x26091a,_0x494970[_0x3487('0x40')]);return _0x575ab5['getDescriptions'](_0x26091a);}})[_0x3487('0x24')](function(_0x3a80ad){if(_0x3a80ad){_0x165b80=_0x3a80ad[_0x3487('0x45')];if(!_0x494970[_0x3487('0x33')][_0x3487('0x39')]('nolimit')){_0x26091a['limit']=qs[_0x3487('0x1c')](_0x494970['query'][_0x3487('0x1c')]);_0x26091a[_0x3487('0x1a')]=qs[_0x3487('0x1a')](_0x494970[_0x3487('0x33')][_0x3487('0x1a')]);}return _0x575ab5[_0x3487('0x50')](_0x26091a);}})['then'](function(_0x5a8fd5){if(_0x5a8fd5){return _0x5a8fd5?{'count':_0x165b80,'rows':_0x5a8fd5}:null;}})['then'](respondWithResult(_0x141aff,null))['catch'](handleError(_0x141aff,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b80a12b..8a5e638 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 _0x008b=['./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','request-promise','../../config/environment'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x008b,0x144));var _0xb008=function(_0x2206fc,_0x1c184c){_0x2206fc=_0x2206fc-0x0;var _0x1861f1=_0x008b[_0x2206fc];return _0x1861f1;};'use strict';var _=require(_0xb008('0x0'));var util=require(_0xb008('0x1'));var logger=require(_0xb008('0x2'))(_0xb008('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb008('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb008('0x5'));var attributes=require(_0xb008('0x6'));module[_0xb008('0x7')]=function(_0x3f5f8a,_0x53531f){return _0x3f5f8a['define'](_0xb008('0x8'),attributes,{'tableName':_0xb008('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabeb=['../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2c47f4,_0x3e7d5c){var _0x5e3e6a=function(_0x33be81){while(--_0x33be81){_0x2c47f4['push'](_0x2c47f4['shift']());}};_0x5e3e6a(++_0x3e7d5c);}(_0xabeb,0xd1));var _0xbabe=function(_0x1716ac,_0x245897){_0x1716ac=_0x1716ac-0x0;var _0xa54aaa=_0xabeb[_0x1716ac];return _0xa54aaa;};'use strict';var _=require('lodash');var util=require(_0xbabe('0x0'));var logger=require(_0xbabe('0x1'))(_0xbabe('0x2'));var moment=require(_0xbabe('0x3'));var BPromise=require(_0xbabe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbabe('0x5'));var rimraf=require(_0xbabe('0x6'));var config=require(_0xbabe('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0xbabe('0x8')]=function(_0x26c525,_0x4d2474){return _0x26c525[_0xbabe('0x9')](_0xbabe('0xa'),attributes,{'tableName':_0xbabe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 9cedc6e..05a1c69 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 _0xc7cb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash'];(function(_0x58e92d,_0x1181bd){var _0x45d179=function(_0xf162a4){while(--_0xf162a4){_0x58e92d['push'](_0x58e92d['shift']());}};_0x45d179(++_0x1181bd);}(_0xc7cb,0x12b));var _0xbc7c=function(_0x1e3e5e,_0x525d38){_0x1e3e5e=_0x1e3e5e-0x0;var _0x3b33fe=_0xc7cb[_0x1e3e5e];return _0x3b33fe;};'use strict';var _=require(_0xbc7c('0x0'));var util=require('util');var moment=require(_0xbc7c('0x1'));var BPromise=require(_0xbc7c('0x2'));var rs=require(_0xbc7c('0x3'));var fs=require('fs');var Redis=require(_0xbc7c('0x4'));var db=require(_0xbc7c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc7c('0x6'))(_0xbc7c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbc7c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1220e1,_0x2783aa,_0x212173){return new BPromise(function(_0x56c564,_0x334209){return client[_0xbc7c('0x9')](_0x1220e1,_0x212173)[_0xbc7c('0xa')](function(_0x249d4b){logger['info'](_0xbc7c('0xb'),_0x2783aa,_0xbc7c('0xc'));logger[_0xbc7c('0xd')](_0xbc7c('0xe'),_0x2783aa,_0xbc7c('0xc'),JSON[_0xbc7c('0xf')](_0x249d4b));if(_0x249d4b[_0xbc7c('0x10')]){if(_0x249d4b[_0xbc7c('0x10')]['code']===0x1f4){logger[_0xbc7c('0x10')](_0xbc7c('0xb'),_0x2783aa,_0x249d4b[_0xbc7c('0x10')][_0xbc7c('0x11')]);return _0x334209(_0x249d4b[_0xbc7c('0x10')][_0xbc7c('0x11')]);}logger['error'](_0xbc7c('0xb'),_0x2783aa,_0x249d4b[_0xbc7c('0x10')][_0xbc7c('0x11')]);return _0x56c564(_0x249d4b[_0xbc7c('0x10')][_0xbc7c('0x11')]);}else{logger[_0xbc7c('0x12')](_0xbc7c('0xb'),_0x2783aa,_0xbc7c('0xc'));_0x56c564(_0x249d4b[_0xbc7c('0x13')][_0xbc7c('0x11')]);}})['catch'](function(_0x24d4d2){logger[_0xbc7c('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2783aa,_0x24d4d2);_0x334209(_0x24d4d2);});});} \ No newline at end of file +var _0x29bc=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x29bc,0xa1));var _0xc29b=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x29bc[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require(_0xc29b('0x0'));var util=require(_0xc29b('0x1'));var moment=require(_0xc29b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc29b('0x3'));var fs=require('fs');var Redis=require(_0xc29b('0x4'));var db=require(_0xc29b('0x5'))['db'];var utils=require(_0xc29b('0x6'));var logger=require(_0xc29b('0x7'))(_0xc29b('0x8'));var config=require(_0xc29b('0x9'));var jayson=require(_0xc29b('0xa'));var client=jayson[_0xc29b('0xb')][_0xc29b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e180d,_0x17f4b9,_0x2bcb55){return new BPromise(function(_0xd21575,_0x99977){return client[_0xc29b('0xd')](_0x2e180d,_0x2bcb55)['then'](function(_0x5dfa15){logger[_0xc29b('0xe')](_0xc29b('0xf'),_0x17f4b9,_0xc29b('0x10'));logger[_0xc29b('0x11')](_0xc29b('0x12'),_0x17f4b9,_0xc29b('0x10'),JSON['stringify'](_0x5dfa15));if(_0x5dfa15[_0xc29b('0x13')]){if(_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x14')]===0x1f4){logger['error'](_0xc29b('0xf'),_0x17f4b9,_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x15')]);return _0x99977(_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x15')]);}logger[_0xc29b('0x13')](_0xc29b('0xf'),_0x17f4b9,_0x5dfa15[_0xc29b('0x13')][_0xc29b('0x15')]);return _0xd21575(_0x5dfa15['error']['message']);}else{logger[_0xc29b('0xe')](_0xc29b('0xf'),_0x17f4b9,_0xc29b('0x10'));_0xd21575(_0x5dfa15[_0xc29b('0x16')]['message']);}})[_0xc29b('0x17')](function(_0x21f2b1){logger['error'](_0xc29b('0xf'),_0x17f4b9,_0x21f2b1);_0x99977(_0x21f2b1);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 305b900..65f1882 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 _0x9dc0=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x5335ea,_0x2a612d){var _0x40a7da=function(_0x28023c){while(--_0x28023c){_0x5335ea['push'](_0x5335ea['shift']());}};_0x40a7da(++_0x2a612d);}(_0x9dc0,0xe5));var _0x09dc=function(_0x4dda69,_0x2a0fe4){_0x4dda69=_0x4dda69-0x0;var _0x9014a9=_0x9dc0[_0x4dda69];return _0x9014a9;};'use strict';var multer=require(_0x09dc('0x0'));var util=require(_0x09dc('0x1'));var path=require(_0x09dc('0x2'));var timeout=require(_0x09dc('0x3'));var express=require(_0x09dc('0x4'));var router=express[_0x09dc('0x5')]();var fs_extra=require(_0x09dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x09dc('0x7'));var config=require(_0x09dc('0x8'));var controller=require(_0x09dc('0x9'));router[_0x09dc('0xa')]('/',auth[_0x09dc('0xb')](),controller[_0x09dc('0xc')]);router[_0x09dc('0xa')](_0x09dc('0xd'),auth[_0x09dc('0xb')](),controller[_0x09dc('0xe')]);router[_0x09dc('0xf')]('/',auth[_0x09dc('0xb')](),controller[_0x09dc('0x10')]);router[_0x09dc('0x11')]('/:id',auth[_0x09dc('0xb')](),controller[_0x09dc('0x12')]);router[_0x09dc('0x13')]('/:id',auth[_0x09dc('0xb')](),controller[_0x09dc('0x14')]);module['exports']=router; \ No newline at end of file +var _0x94ad=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x116927,_0x315e84){var _0x393752=function(_0x16aaa1){while(--_0x16aaa1){_0x116927['push'](_0x116927['shift']());}};_0x393752(++_0x315e84);}(_0x94ad,0xc1));var _0xd94a=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x94ad[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require(_0xd94a('0x0'));var util=require(_0xd94a('0x1'));var path=require(_0xd94a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd94a('0x3'));var router=express[_0xd94a('0x4')]();var fs_extra=require(_0xd94a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd94a('0x6'));var config=require(_0xd94a('0x7'));var controller=require(_0xd94a('0x8'));router[_0xd94a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd94a('0x9')]('/:id',auth[_0xd94a('0xa')](),controller[_0xd94a('0xb')]);router[_0xd94a('0xc')]('/',auth[_0xd94a('0xa')](),controller[_0xd94a('0xd')]);router[_0xd94a('0xe')](_0xd94a('0xf'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x10')]);router[_0xd94a('0x11')](_0xd94a('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xd94a('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index f3e7356..e7b1a06 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 _0x2eff=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x26cab7,_0x1ccfca){var _0x31ba06=function(_0x1ed04a){while(--_0x1ed04a){_0x26cab7['push'](_0x26cab7['shift']());}};_0x31ba06(++_0x1ccfca);}(_0x2eff,0xad));var _0xf2ef=function(_0x1bd845,_0x567d93){_0x1bd845=_0x1bd845-0x0;var _0x2257b3=_0x2eff[_0x1bd845];return _0x2257b3;};'use strict';var Sequelize=require(_0xf2ef('0x0'));module[_0xf2ef('0x1')]={'type':{'type':Sequelize[_0xf2ef('0x2')](_0xf2ef('0x3'),_0xf2ef('0x4'),'customVariable',_0xf2ef('0x5'),'picklist'),'defaultValue':_0xf2ef('0x3')},'content':{'type':Sequelize[_0xf2ef('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf2ef('0x2')]('string','variable',_0xf2ef('0x7'))},'keyContent':{'type':Sequelize[_0xf2ef('0x6')]},'idField':{'type':Sequelize[_0xf2ef('0x6')]},'nameField':{'type':Sequelize[_0xf2ef('0x6')]},'customField':{'type':Sequelize[_0xf2ef('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf2ef('0x6')]}}; \ No newline at end of file +var _0x16ad=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x16ad,0x1bc));var _0xd16a=function(_0x194338,_0x4f8d65){_0x194338=_0x194338-0x0;var _0x169a3b=_0x16ad[_0x194338];return _0x169a3b;};'use strict';var Sequelize=require('sequelize');module[_0xd16a('0x0')]={'type':{'type':Sequelize[_0xd16a('0x1')](_0xd16a('0x2'),_0xd16a('0x3'),_0xd16a('0x4'),_0xd16a('0x5'),_0xd16a('0x6')),'defaultValue':_0xd16a('0x2')},'content':{'type':Sequelize[_0xd16a('0x7')]},'key':{'type':Sequelize[_0xd16a('0x7')]},'keyType':{'type':Sequelize[_0xd16a('0x1')](_0xd16a('0x2'),_0xd16a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd16a('0x7')]},'idField':{'type':Sequelize[_0xd16a('0x7')]},'nameField':{'type':Sequelize[_0xd16a('0x7')]},'customField':{'type':Sequelize[_0xd16a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd16a('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 794b85a..b6ff64e 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 _0x6cb4=['count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ZohoField','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','includeAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','end','json','undefined','offset'];(function(_0x13f280,_0xf8d085){var _0x50fbcd=function(_0x50b066){while(--_0x50b066){_0x13f280['push'](_0x13f280['shift']());}};_0x50fbcd(++_0xf8d085);}(_0x6cb4,0xff));var _0x46cb=function(_0x5ae333,_0x5917ca){_0x5ae333=_0x5ae333-0x0;var _0x23a79d=_0x6cb4[_0x5ae333];return _0x23a79d;};'use strict';var emlformat=require(_0x46cb('0x0'));var rimraf=require(_0x46cb('0x1'));var zipdir=require(_0x46cb('0x2'));var jsonpatch=require(_0x46cb('0x3'));var rp=require(_0x46cb('0x4'));var moment=require(_0x46cb('0x5'));var BPromise=require(_0x46cb('0x6'));var Mustache=require(_0x46cb('0x7'));var util=require(_0x46cb('0x8'));var path=require('path');var sox=require(_0x46cb('0x9'));var csv=require('to-csv');var ejs=require(_0x46cb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0x10'));var querystring=require('querystring');var Papa=require(_0x46cb('0x11'));var Redis=require(_0x46cb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x13'));var as=require(_0x46cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x15'))(_0x46cb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x46cb('0x17'))['db'];function respondWithStatusCode(_0x323ac2,_0x1058a8){_0x1058a8=_0x1058a8||0xcc;return function(_0xf22158){if(_0xf22158){return _0x323ac2['sendStatus'](_0x1058a8);}return _0x323ac2[_0x46cb('0x18')](_0x1058a8)[_0x46cb('0x19')]();};}function respondWithResult(_0x2a1f9d,_0x3c0071){_0x3c0071=_0x3c0071||0xc8;return function(_0x1f7150){if(_0x1f7150){return _0x2a1f9d[_0x46cb('0x18')](_0x3c0071)[_0x46cb('0x1a')](_0x1f7150);}};}function respondWithFilteredResult(_0x3c396b,_0x37d368){return function(_0x41e398){if(_0x41e398){var _0x136215=typeof _0x37d368['offset']===_0x46cb('0x1b')&&typeof _0x37d368['limit']===_0x46cb('0x1b');var _0x4ab22b=_0x41e398['count'];var _0x4e3454=_0x136215?0x0:_0x37d368[_0x46cb('0x1c')];var _0x1f2891=_0x136215?_0x41e398[_0x46cb('0x1d')]:_0x37d368[_0x46cb('0x1c')]+_0x37d368[_0x46cb('0x1e')];var _0x26e38d;if(_0x1f2891>=_0x4ab22b){_0x1f2891=_0x4ab22b;_0x26e38d=0xc8;}else{_0x26e38d=0xce;}_0x3c396b[_0x46cb('0x18')](_0x26e38d);return _0x3c396b[_0x46cb('0x1f')](_0x46cb('0x20'),_0x4e3454+'-'+_0x1f2891+'/'+_0x4ab22b)[_0x46cb('0x1a')](_0x41e398);}return null;};}function patchUpdates(_0x149483){return function(_0x46e541){try{jsonpatch[_0x46cb('0x21')](_0x46e541,_0x149483,!![]);}catch(_0x2f438b){return BPromise[_0x46cb('0x22')](_0x2f438b);}return _0x46e541[_0x46cb('0x23')]();};}function saveUpdates(_0x7084b2,_0x1fb467){return function(_0x41ecd2){if(_0x41ecd2){return _0x41ecd2[_0x46cb('0x24')](_0x7084b2)[_0x46cb('0x25')](function(_0x1e9e38){return _0x1e9e38;});}return null;};}function removeEntity(_0x309e4b,_0xadcad6){return function(_0x40e0e5){if(_0x40e0e5){return _0x40e0e5['destroy']()['then'](function(){_0x309e4b[_0x46cb('0x18')](0xcc)[_0x46cb('0x19')]();});}};}function handleEntityNotFound(_0x2711ac,_0xe078a8){return function(_0x6e6d9){if(!_0x6e6d9){_0x2711ac['sendStatus'](0x194);}return _0x6e6d9;};}function handleError(_0xc5a9a4,_0x578ffd){_0x578ffd=_0x578ffd||0x1f4;return function(_0x495886){logger['error'](_0x495886[_0x46cb('0x26')]);if(_0x495886[_0x46cb('0x27')]){delete _0x495886[_0x46cb('0x27')];}_0xc5a9a4[_0x46cb('0x18')](_0x578ffd)[_0x46cb('0x28')](_0x495886);};}exports[_0x46cb('0x29')]=function(_0x378dc7,_0x8c65b2){var _0x2b846a={},_0x12e01e={},_0x4620ef={'count':0x0,'rows':[]};var _0x4a1517=_[_0x46cb('0x2a')](db[_0x46cb('0x2b')]['rawAttributes'],function(_0x49e0bc){return{'name':_0x49e0bc[_0x46cb('0x2c')],'type':_0x49e0bc['type'][_0x46cb('0x2d')]};});_0x12e01e[_0x46cb('0x2e')]=_[_0x46cb('0x2a')](_0x4a1517,_0x46cb('0x27'));_0x12e01e[_0x46cb('0x2f')]=_[_0x46cb('0x30')](_0x378dc7['query']);_0x12e01e[_0x46cb('0x31')]=_['intersection'](_0x12e01e[_0x46cb('0x2e')],_0x12e01e[_0x46cb('0x2f')]);_0x2b846a['attributes']=_[_0x46cb('0x32')](_0x12e01e[_0x46cb('0x2e')],qs[_0x46cb('0x33')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x33')]));_0x2b846a['attributes']=_0x2b846a[_0x46cb('0x34')]['length']?_0x2b846a[_0x46cb('0x34')]:_0x12e01e[_0x46cb('0x2e')];if(!_0x378dc7[_0x46cb('0x2f')]['hasOwnProperty'](_0x46cb('0x35'))){_0x2b846a[_0x46cb('0x1e')]=qs['limit'](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x1e')]);_0x2b846a[_0x46cb('0x1c')]=qs[_0x46cb('0x1c')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x1c')]);}_0x2b846a[_0x46cb('0x36')]=qs[_0x46cb('0x37')](_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x37')]);_0x2b846a[_0x46cb('0x38')]=qs['filters'](_['pick'](_0x378dc7['query'],_0x12e01e[_0x46cb('0x31')]),_0x4a1517);if(_0x378dc7[_0x46cb('0x2f')][_0x46cb('0x39')]){_0x2b846a[_0x46cb('0x38')]=_[_0x46cb('0x3a')](_0x2b846a[_0x46cb('0x38')],{'$or':_['map'](_0x4a1517,function(_0x1f2e11){if(_0x1f2e11['type']!=='VIRTUAL'){var _0x173fac={};_0x173fac[_0x1f2e11['name']]={'$like':'%'+_0x378dc7['query'][_0x46cb('0x39')]+'%'};return _0x173fac;}})});}_0x2b846a=_['merge']({},_0x2b846a,_0x378dc7['options']);var _0x67bd14={'where':_0x2b846a[_0x46cb('0x38')]};return db[_0x46cb('0x2b')][_0x46cb('0x1d')](_0x67bd14)[_0x46cb('0x25')](function(_0x4075b4){_0x4620ef[_0x46cb('0x1d')]=_0x4075b4;if(_0x378dc7['query'][_0x46cb('0x3b')]){_0x2b846a['include']=[{'all':!![]}];}return db[_0x46cb('0x2b')]['findAll'](_0x2b846a);})[_0x46cb('0x25')](function(_0x2fbad9){_0x4620ef[_0x46cb('0x3c')]=_0x2fbad9;return _0x4620ef;})['then'](respondWithFilteredResult(_0x8c65b2,_0x2b846a))[_0x46cb('0x3d')](handleError(_0x8c65b2,null));};exports[_0x46cb('0x3e')]=function(_0x4d24b6,_0x18be96){var _0x3d0b83={'raw':!![],'where':{'id':_0x4d24b6[_0x46cb('0x3f')]['id']}},_0x1f67af={};_0x1f67af[_0x46cb('0x2e')]=_['keys'](db['ZohoField'][_0x46cb('0x40')]);_0x1f67af['query']=_[_0x46cb('0x30')](_0x4d24b6[_0x46cb('0x2f')]);_0x1f67af['filters']=_[_0x46cb('0x32')](_0x1f67af[_0x46cb('0x2e')],_0x1f67af[_0x46cb('0x2f')]);_0x3d0b83['attributes']=_['intersection'](_0x1f67af['model'],qs['fields'](_0x4d24b6[_0x46cb('0x2f')][_0x46cb('0x33')]));_0x3d0b83[_0x46cb('0x34')]=_0x3d0b83[_0x46cb('0x34')][_0x46cb('0x41')]?_0x3d0b83['attributes']:_0x1f67af['model'];if(_0x4d24b6[_0x46cb('0x2f')][_0x46cb('0x3b')]){_0x3d0b83['include']=[{'all':!![]}];}_0x3d0b83=_[_0x46cb('0x3a')]({},_0x3d0b83,_0x4d24b6[_0x46cb('0x42')]);return db[_0x46cb('0x2b')][_0x46cb('0x43')](_0x3d0b83)[_0x46cb('0x25')](handleEntityNotFound(_0x18be96,null))[_0x46cb('0x25')](respondWithResult(_0x18be96,null))[_0x46cb('0x3d')](handleError(_0x18be96,null));};exports['create']=function(_0x58c69f,_0x449593){return db['ZohoField'][_0x46cb('0x44')](_0x58c69f[_0x46cb('0x45')],{})[_0x46cb('0x25')](respondWithResult(_0x449593,0xc9))['catch'](handleError(_0x449593,null));};exports[_0x46cb('0x24')]=function(_0x5c1665,_0x5c02c9){if(_0x5c1665[_0x46cb('0x45')]['id']){delete _0x5c1665[_0x46cb('0x45')]['id'];}return db[_0x46cb('0x2b')][_0x46cb('0x43')]({'where':{'id':_0x5c1665[_0x46cb('0x3f')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x5c02c9,null))[_0x46cb('0x25')](saveUpdates(_0x5c1665['body'],null))['then'](respondWithResult(_0x5c02c9,null))[_0x46cb('0x3d')](handleError(_0x5c02c9,null));};exports[_0x46cb('0x46')]=function(_0x52e479,_0x34399d){return db[_0x46cb('0x2b')][_0x46cb('0x43')]({'where':{'id':_0x52e479[_0x46cb('0x3f')]['id']}})[_0x46cb('0x25')](handleEntityNotFound(_0x34399d,null))['then'](removeEntity(_0x34399d,null))[_0x46cb('0x3d')](handleError(_0x34399d,null));}; \ No newline at end of file +var _0x58ab=['name','send','index','ZohoField','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack'];(function(_0x19b9c1,_0x17c9e2){var _0x927134=function(_0x40fef4){while(--_0x40fef4){_0x19b9c1['push'](_0x19b9c1['shift']());}};_0x927134(++_0x17c9e2);}(_0x58ab,0xf8));var _0xb58a=function(_0x1cdaf1,_0x4d9699){_0x1cdaf1=_0x1cdaf1-0x0;var _0x397c09=_0x58ab[_0x1cdaf1];return _0x397c09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb58a('0x0'));var zipdir=require(_0xb58a('0x1'));var jsonpatch=require(_0xb58a('0x2'));var rp=require('request-promise');var moment=require(_0xb58a('0x3'));var BPromise=require(_0xb58a('0x4'));var Mustache=require(_0xb58a('0x5'));var util=require(_0xb58a('0x6'));var path=require('path');var sox=require(_0xb58a('0x7'));var csv=require(_0xb58a('0x8'));var ejs=require(_0xb58a('0x9'));var fs=require('fs');var fs_extra=require(_0xb58a('0xa'));var _=require('lodash');var squel=require(_0xb58a('0xb'));var crypto=require(_0xb58a('0xc'));var jsforce=require(_0xb58a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb58a('0x8'));var querystring=require(_0xb58a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb58a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb58a('0x10'));var as=require(_0xb58a('0x11'));var hardwareService=require(_0xb58a('0x12'));var logger=require(_0xb58a('0x13'))(_0xb58a('0x14'));var utils=require(_0xb58a('0x15'));var config=require(_0xb58a('0x16'));var licenseUtil=require(_0xb58a('0x17'));var db=require(_0xb58a('0x18'))['db'];function respondWithStatusCode(_0x3d04d7,_0x22d143){_0x22d143=_0x22d143||0xcc;return function(_0x1a68cf){if(_0x1a68cf){return _0x3d04d7[_0xb58a('0x19')](_0x22d143);}return _0x3d04d7['status'](_0x22d143)[_0xb58a('0x1a')]();};}function respondWithResult(_0x5b8443,_0x450dcf){_0x450dcf=_0x450dcf||0xc8;return function(_0x4131b1){if(_0x4131b1){return _0x5b8443[_0xb58a('0x1b')](_0x450dcf)[_0xb58a('0x1c')](_0x4131b1);}};}function respondWithFilteredResult(_0xb3ba0a,_0x464991){return function(_0x42d3d9){if(_0x42d3d9){var _0x48bac8=typeof _0x464991[_0xb58a('0x1d')]===_0xb58a('0x1e')&&typeof _0x464991[_0xb58a('0x1f')]===_0xb58a('0x1e');var _0x4a054e=_0x42d3d9[_0xb58a('0x20')];var _0x99aa29=_0x48bac8?0x0:_0x464991['offset'];var _0x4329ca=_0x48bac8?_0x42d3d9[_0xb58a('0x20')]:_0x464991[_0xb58a('0x1d')]+_0x464991['limit'];var _0x49d899;if(_0x4329ca>=_0x4a054e){_0x4329ca=_0x4a054e;_0x49d899=0xc8;}else{_0x49d899=0xce;}_0xb3ba0a[_0xb58a('0x1b')](_0x49d899);return _0xb3ba0a['set']('Content-Range',_0x99aa29+'-'+_0x4329ca+'/'+_0x4a054e)['json'](_0x42d3d9);}return null;};}function patchUpdates(_0x22895b){return function(_0x3fb0dc){try{jsonpatch[_0xb58a('0x21')](_0x3fb0dc,_0x22895b,!![]);}catch(_0x44fed4){return BPromise['reject'](_0x44fed4);}return _0x3fb0dc[_0xb58a('0x22')]();};}function saveUpdates(_0x51d271,_0x15a35d){return function(_0x4435f6){if(_0x4435f6){return _0x4435f6[_0xb58a('0x23')](_0x51d271)[_0xb58a('0x24')](function(_0x31f625){return _0x31f625;});}return null;};}function removeEntity(_0x3eb664,_0x2eb035){return function(_0x927f4){if(_0x927f4){return _0x927f4[_0xb58a('0x25')]()['then'](function(){_0x3eb664[_0xb58a('0x1b')](0xcc)[_0xb58a('0x1a')]();});}};}function handleEntityNotFound(_0x543212,_0x5a2254){return function(_0xa52543){if(!_0xa52543){_0x543212[_0xb58a('0x19')](0x194);}return _0xa52543;};}function handleError(_0x3e61a9,_0x1869bd){_0x1869bd=_0x1869bd||0x1f4;return function(_0x5d8923){logger[_0xb58a('0x26')](_0x5d8923[_0xb58a('0x27')]);if(_0x5d8923['name']){delete _0x5d8923[_0xb58a('0x28')];}_0x3e61a9[_0xb58a('0x1b')](_0x1869bd)[_0xb58a('0x29')](_0x5d8923);};}exports[_0xb58a('0x2a')]=function(_0x3ba89f,_0x5461bc){var _0x2ebf78={},_0x14c49f={},_0x58b57f={'count':0x0,'rows':[]};var _0x15a5e9=_['map'](db[_0xb58a('0x2b')]['rawAttributes'],function(_0x33cd88){return{'name':_0x33cd88['fieldName'],'type':_0x33cd88[_0xb58a('0x2c')][_0xb58a('0x2d')]};});_0x14c49f[_0xb58a('0x2e')]=_[_0xb58a('0x2f')](_0x15a5e9,_0xb58a('0x28'));_0x14c49f[_0xb58a('0x30')]=_[_0xb58a('0x31')](_0x3ba89f['query']);_0x14c49f[_0xb58a('0x32')]=_['intersection'](_0x14c49f[_0xb58a('0x2e')],_0x14c49f[_0xb58a('0x30')]);_0x2ebf78[_0xb58a('0x33')]=_[_0xb58a('0x34')](_0x14c49f[_0xb58a('0x2e')],qs[_0xb58a('0x35')](_0x3ba89f[_0xb58a('0x30')][_0xb58a('0x35')]));_0x2ebf78[_0xb58a('0x33')]=_0x2ebf78['attributes'][_0xb58a('0x36')]?_0x2ebf78[_0xb58a('0x33')]:_0x14c49f[_0xb58a('0x2e')];if(!_0x3ba89f['query'][_0xb58a('0x37')]('nolimit')){_0x2ebf78['limit']=qs[_0xb58a('0x1f')](_0x3ba89f[_0xb58a('0x30')][_0xb58a('0x1f')]);_0x2ebf78['offset']=qs[_0xb58a('0x1d')](_0x3ba89f['query'][_0xb58a('0x1d')]);}_0x2ebf78[_0xb58a('0x38')]=qs['sort'](_0x3ba89f[_0xb58a('0x30')]['sort']);_0x2ebf78[_0xb58a('0x39')]=qs[_0xb58a('0x32')](_[_0xb58a('0x3a')](_0x3ba89f[_0xb58a('0x30')],_0x14c49f[_0xb58a('0x32')]),_0x15a5e9);if(_0x3ba89f['query']['filter']){_0x2ebf78[_0xb58a('0x39')]=_[_0xb58a('0x3b')](_0x2ebf78['where'],{'$or':_['map'](_0x15a5e9,function(_0x397398){if(_0x397398['type']!=='VIRTUAL'){var _0x2c3442={};_0x2c3442[_0x397398[_0xb58a('0x28')]]={'$like':'%'+_0x3ba89f['query'][_0xb58a('0x3c')]+'%'};return _0x2c3442;}})});}_0x2ebf78=_['merge']({},_0x2ebf78,_0x3ba89f[_0xb58a('0x3d')]);var _0x471250={'where':_0x2ebf78[_0xb58a('0x39')]};return db[_0xb58a('0x2b')][_0xb58a('0x20')](_0x471250)[_0xb58a('0x24')](function(_0x21d22f){_0x58b57f['count']=_0x21d22f;if(_0x3ba89f[_0xb58a('0x30')][_0xb58a('0x3e')]){_0x2ebf78[_0xb58a('0x3f')]=[{'all':!![]}];}return db[_0xb58a('0x2b')][_0xb58a('0x40')](_0x2ebf78);})[_0xb58a('0x24')](function(_0x23e594){_0x58b57f[_0xb58a('0x41')]=_0x23e594;return _0x58b57f;})['then'](respondWithFilteredResult(_0x5461bc,_0x2ebf78))['catch'](handleError(_0x5461bc,null));};exports[_0xb58a('0x42')]=function(_0x2cc73f,_0x3a6626){var _0x689ca7={'raw':!![],'where':{'id':_0x2cc73f[_0xb58a('0x43')]['id']}},_0x39867d={};_0x39867d[_0xb58a('0x2e')]=_[_0xb58a('0x31')](db[_0xb58a('0x2b')]['rawAttributes']);_0x39867d['query']=_['keys'](_0x2cc73f['query']);_0x39867d[_0xb58a('0x32')]=_[_0xb58a('0x34')](_0x39867d[_0xb58a('0x2e')],_0x39867d[_0xb58a('0x30')]);_0x689ca7[_0xb58a('0x33')]=_[_0xb58a('0x34')](_0x39867d['model'],qs['fields'](_0x2cc73f[_0xb58a('0x30')]['fields']));_0x689ca7[_0xb58a('0x33')]=_0x689ca7[_0xb58a('0x33')][_0xb58a('0x36')]?_0x689ca7[_0xb58a('0x33')]:_0x39867d[_0xb58a('0x2e')];if(_0x2cc73f[_0xb58a('0x30')]['includeAll']){_0x689ca7[_0xb58a('0x3f')]=[{'all':!![]}];}_0x689ca7=_[_0xb58a('0x3b')]({},_0x689ca7,_0x2cc73f[_0xb58a('0x3d')]);return db['ZohoField']['find'](_0x689ca7)[_0xb58a('0x24')](handleEntityNotFound(_0x3a6626,null))['then'](respondWithResult(_0x3a6626,null))['catch'](handleError(_0x3a6626,null));};exports[_0xb58a('0x44')]=function(_0x3fb003,_0x448e89){return db[_0xb58a('0x2b')][_0xb58a('0x44')](_0x3fb003[_0xb58a('0x45')],{})[_0xb58a('0x24')](respondWithResult(_0x448e89,0xc9))[_0xb58a('0x46')](handleError(_0x448e89,null));};exports['update']=function(_0x2df8ed,_0x3c40f9){if(_0x2df8ed['body']['id']){delete _0x2df8ed[_0xb58a('0x45')]['id'];}return db[_0xb58a('0x2b')][_0xb58a('0x47')]({'where':{'id':_0x2df8ed[_0xb58a('0x43')]['id']}})[_0xb58a('0x24')](handleEntityNotFound(_0x3c40f9,null))[_0xb58a('0x24')](saveUpdates(_0x2df8ed[_0xb58a('0x45')],null))[_0xb58a('0x24')](respondWithResult(_0x3c40f9,null))[_0xb58a('0x46')](handleError(_0x3c40f9,null));};exports['destroy']=function(_0x5eba1c,_0x31c7bc){return db[_0xb58a('0x2b')][_0xb58a('0x47')]({'where':{'id':_0x5eba1c[_0xb58a('0x43')]['id']}})['then'](handleEntityNotFound(_0x31c7bc,null))[_0xb58a('0x24')](removeEntity(_0x31c7bc,null))[_0xb58a('0x46')](handleError(_0x31c7bc,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 3ac1074..6a8ccfb 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 _0x7ee1=['request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','moment','bluebird'];(function(_0x1bc22b,_0x46ea2d){var _0x1e9efa=function(_0x50f378){while(--_0x50f378){_0x1bc22b['push'](_0x1bc22b['shift']());}};_0x1e9efa(++_0x46ea2d);}(_0x7ee1,0x8d));var _0x17ee=function(_0x40c0e1,_0x37811d){_0x40c0e1=_0x40c0e1-0x0;var _0x4efaa8=_0x7ee1[_0x40c0e1];return _0x4efaa8;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));module[_0x17ee('0x7')]=function(_0x5c0617,_0x52b1db){return _0x5c0617[_0x17ee('0x8')]('ZohoField',attributes,{'tableName':_0x17ee('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x17ee('0xa'),_0x17ee('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xadb5,0xad));var _0x5adb=function(_0xe25d69,_0x28142f){_0xe25d69=_0xe25d69-0x0;var _0x1f8ab1=_0xadb5[_0xe25d69];return _0x1f8ab1;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./intZohoField.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xc'),_0x5adb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 60a87ef..e7b6429 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 _0xf68c=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','debug','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xa16cc0,_0x217e43){var _0x5b7c04=function(_0xb3e2eb){while(--_0xb3e2eb){_0xa16cc0['push'](_0xa16cc0['shift']());}};_0x5b7c04(++_0x217e43);}(_0xf68c,0x175));var _0xcf68=function(_0x2dff33,_0x3cdfdf){_0x2dff33=_0x2dff33-0x0;var _0x2c722b=_0xf68c[_0x2dff33];return _0x2c722b;};'use strict';var _=require(_0xcf68('0x0'));var util=require(_0xcf68('0x1'));var moment=require(_0xcf68('0x2'));var BPromise=require(_0xcf68('0x3'));var rs=require(_0xcf68('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf68('0x5'))['db'];var utils=require(_0xcf68('0x6'));var logger=require(_0xcf68('0x7'))(_0xcf68('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcf68('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x633cea,_0x1422db,_0x3d7e1f){return new BPromise(function(_0x1d387a,_0x5de3dc){return client['request'](_0x633cea,_0x3d7e1f)[_0xcf68('0xa')](function(_0x15bb8f){logger[_0xcf68('0xb')]('ZohoField,\x20%s,\x20%s',_0x1422db,_0xcf68('0xc'));logger[_0xcf68('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1422db,_0xcf68('0xc'),JSON[_0xcf68('0xe')](_0x15bb8f));if(_0x15bb8f[_0xcf68('0xf')]){if(_0x15bb8f['error'][_0xcf68('0x10')]===0x1f4){logger[_0xcf68('0xf')](_0xcf68('0x11'),_0x1422db,_0x15bb8f['error'][_0xcf68('0x12')]);return _0x5de3dc(_0x15bb8f[_0xcf68('0xf')][_0xcf68('0x12')]);}logger[_0xcf68('0xf')](_0xcf68('0x11'),_0x1422db,_0x15bb8f[_0xcf68('0xf')][_0xcf68('0x12')]);return _0x1d387a(_0x15bb8f['error'][_0xcf68('0x12')]);}else{logger[_0xcf68('0xb')](_0xcf68('0x11'),_0x1422db,_0xcf68('0xc'));_0x1d387a(_0x15bb8f[_0xcf68('0x13')][_0xcf68('0x12')]);}})[_0xcf68('0x14')](function(_0x4bf053){logger[_0xcf68('0xf')](_0xcf68('0x11'),_0x1422db,_0x4bf053);_0x5de3dc(_0x4bf053);});});} \ No newline at end of file +var _0xb841=['code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb841,0x118));var _0x1b84=function(_0x51413f,_0x2177d7){_0x51413f=_0x51413f-0x0;var _0x5dbbf5=_0xb841[_0x51413f];return _0x5dbbf5;};'use strict';var _=require(_0x1b84('0x0'));var util=require('util');var moment=require(_0x1b84('0x1'));var BPromise=require(_0x1b84('0x2'));var rs=require(_0x1b84('0x3'));var fs=require('fs');var Redis=require(_0x1b84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b84('0x5'));var logger=require(_0x1b84('0x6'))(_0x1b84('0x7'));var config=require(_0x1b84('0x8'));var jayson=require(_0x1b84('0x9'));var client=jayson[_0x1b84('0xa')][_0x1b84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38ca37,_0xd5419e,_0x1c2796){return new BPromise(function(_0x342a9d,_0x3f7d5d){return client[_0x1b84('0xc')](_0x38ca37,_0x1c2796)['then'](function(_0x3bf861){logger['info'](_0x1b84('0xd'),_0xd5419e,_0x1b84('0xe'));logger[_0x1b84('0xf')](_0x1b84('0x10'),_0xd5419e,'request\x20sent',JSON[_0x1b84('0x11')](_0x3bf861));if(_0x3bf861[_0x1b84('0x12')]){if(_0x3bf861[_0x1b84('0x12')][_0x1b84('0x13')]===0x1f4){logger['error'](_0x1b84('0xd'),_0xd5419e,_0x3bf861['error']['message']);return _0x3f7d5d(_0x3bf861[_0x1b84('0x12')][_0x1b84('0x14')]);}logger['error'](_0x1b84('0xd'),_0xd5419e,_0x3bf861[_0x1b84('0x12')][_0x1b84('0x14')]);return _0x342a9d(_0x3bf861[_0x1b84('0x12')]['message']);}else{logger[_0x1b84('0x15')](_0x1b84('0xd'),_0xd5419e,_0x1b84('0xe'));_0x342a9d(_0x3bf861[_0x1b84('0x16')]['message']);}})['catch'](function(_0x5eb96e){logger[_0x1b84('0x12')](_0x1b84('0xd'),_0xd5419e,_0x5eb96e);_0x3f7d5d(_0x5eb96e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 4e93acf..dabf99a 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3045c6,_0x538123){var _0x48304a=function(_0x3f88a2){while(--_0x3f88a2){_0x3045c6['push'](_0x3045c6['shift']());}};_0x48304a(++_0x538123);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xcb91[_0x44bcb0];return _0xfaf881;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x427473,_0x5b5951){var _0x419e0f=function(_0x474910){while(--_0x474910){_0x427473['push'](_0x427473['shift']());}};_0x419e0f(++_0x5b5951);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0xcb91[_0x33080e];return _0x407395;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 99a9bf6..68e1c08 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 _0x7e87=['exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x565711,_0x4e20bf){var _0x49df60=function(_0x122dbc){while(--_0x122dbc){_0x565711['push'](_0x565711['shift']());}};_0x49df60(++_0x4e20bf);}(_0x7e87,0x172));var _0x77e8=function(_0x3ea882,_0x5b2e3f){_0x3ea882=_0x3ea882-0x0;var _0x3bb58e=_0x7e87[_0x3ea882];return _0x3bb58e;};'use strict';var Sequelize=require('sequelize');module[_0x77e8('0x0')]={'name':{'type':Sequelize[_0x77e8('0x1')],'allowNull':![],'unique':_0x77e8('0x2')},'version':{'type':Sequelize[_0x77e8('0x1')],'allowNull':![],'unique':_0x77e8('0x2')},'main':{'type':Sequelize[_0x77e8('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x77e8('0x1')]},'path':{'type':Sequelize[_0x77e8('0x1')]},'type':{'type':Sequelize[_0x77e8('0x1')]},'size':{'type':Sequelize[_0x77e8('0x3')]},'active':{'type':Sequelize[_0x77e8('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x77e8('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x77e8('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x77e8('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x77e8('0x1')]},'link':{'type':Sequelize[_0x77e8('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x161d=['exports','STRING','unique_name_and_version','INTEGER','sequelize'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x161d,0x171));var _0xd161=function(_0x1df951,_0xb89e8e){_0x1df951=_0x1df951-0x0;var _0x27c50c=_0x161d[_0x1df951];return _0x27c50c;};'use strict';var Sequelize=require(_0xd161('0x0'));module[_0xd161('0x1')]={'name':{'type':Sequelize[_0xd161('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd161('0x3')},'main':{'type':Sequelize[_0xd161('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xd161('0x2')]},'path':{'type':Sequelize[_0xd161('0x2')]},'type':{'type':Sequelize[_0xd161('0x2')]},'size':{'type':Sequelize[_0xd161('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xd161('0x2')]},'logo':{'type':Sequelize[_0xd161('0x2')]},'state':{'type':Sequelize[_0xd161('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xd161('0x2')]},'title':{'type':Sequelize[_0xd161('0x2')]},'remoteUri':{'type':Sequelize[_0xd161('0x2')]},'link':{'type':Sequelize[_0xd161('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 00d80c3..80cf041 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','Integration','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x23e0c1,_0x3db138){var _0x5b19e6=function(_0x560fc0){while(--_0x560fc0){_0x23e0c1['push'](_0x23e0c1['shift']());}};_0x5b19e6(++_0x3db138);}(_0x2ef3,0xba));var _0x32ef=function(_0x40fdeb,_0x137ed9){_0x40fdeb=_0x40fdeb-0x0;var _0x2ae88c=_0x2ef3[_0x40fdeb];return _0x2ae88c;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['Integration'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['Integration'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['Integration']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +var _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x1c99f7,_0x14134f){var _0x443613=function(_0x129e02){while(--_0x129e02){_0x1c99f7['push'](_0x1c99f7['shift']());}};_0x443613(++_0x14134f);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x11ce99,_0x9ab527){_0x11ce99=_0x11ce99-0x0;var _0x5206c6=_0xc1c6[_0x11ce99];return _0x5206c6;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 8829733..b7f81bd 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 _0x25fe=['../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f5294,_0x58552f){var _0x5dbefb=function(_0x11594a){while(--_0x11594a){_0x2f5294['push'](_0x2f5294['shift']());}};_0x5dbefb(++_0x58552f);}(_0x25fe,0x12c));var _0xe25f=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0x25fe[_0x25b4a4];return _0x707267;};'use strict';var _=require(_0xe25f('0x0'));var util=require(_0xe25f('0x1'));var logger=require(_0xe25f('0x2'))(_0xe25f('0x3'));var moment=require(_0xe25f('0x4'));var BPromise=require(_0xe25f('0x5'));var rp=require(_0xe25f('0x6'));var fs=require('fs');var path=require(_0xe25f('0x7'));var rimraf=require('rimraf');var config=require(_0xe25f('0x8'));var attributes=require(_0xe25f('0x9'));module[_0xe25f('0xa')]=function(_0x1ee41f,_0x5bff16){return _0x1ee41f[_0xe25f('0xb')](_0xe25f('0xc'),attributes,{'tableName':_0xe25f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c5d=['api','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c5d,0x174));var _0xd3c5=function(_0x50d148,_0x98e59b){_0x50d148=_0x50d148-0x0;var _0x5fdc4d=_0x3c5d[_0x50d148];return _0x5fdc4d;};'use strict';var _=require(_0xd3c5('0x0'));var util=require('util');var logger=require(_0xd3c5('0x1'))(_0xd3c5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3c5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3c5('0x4'));var config=require(_0xd3c5('0x5'));var attributes=require(_0xd3c5('0x6'));module[_0xd3c5('0x7')]=function(_0x517e84,_0x391195){return _0x517e84[_0xd3c5('0x8')](_0xd3c5('0x9'),attributes,{'tableName':_0xd3c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index d21bc88..013d19e 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x3b660f,_0x45c3db){var _0x187a29=function(_0x11cedf){while(--_0x11cedf){_0x3b660f['push'](_0x3b660f['shift']());}};_0x187a29(++_0x45c3db);}(_0xda2d,0x102));var _0xdda2=function(_0xb997f1,_0x2b3811){_0xb997f1=_0xb997f1-0x0;var _0x24c56b=_0xda2d[_0xb997f1];return _0x24c56b;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x5d0e5c,_0x1eb95f){var _0x2c4bd4=function(_0x5528dd){while(--_0x5528dd){_0x5d0e5c['push'](_0x5d0e5c['shift']());}};_0x2c4bd4(++_0x1eb95f);}(_0xda2d,0x102));var _0xdda2=function(_0x19bc2b,_0x39d493){_0x19bc2b=_0x19bc2b-0x0;var _0x28c6b9=_0xda2d[_0x19bc2b];return _0x28c6b9;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 76e2ea9..f030928 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 _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29c68a,_0x373534){var _0x26852d=function(_0x2dbb21){while(--_0x2dbb21){_0x29c68a['push'](_0x29c68a['shift']());}};_0x26852d(++_0x373534);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x152dda,_0xb60739){_0x152dda=_0x152dda-0x0;var _0x349c47=_0xc6ac[_0x152dda];return _0x349c47;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0xf0c959,_0x223921){var _0xc006e8=function(_0x56c650){while(--_0x56c650){_0xf0c959['push'](_0xf0c959['shift']());}};_0xc006e8(++_0x223921);}(_0x955f,0x1eb));var _0xf955=function(_0x6944ba,_0x855e0e){_0x6944ba=_0x6944ba-0x0;var _0x1ff574=_0x955f[_0x6944ba];return _0x1ff574;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c561d45..5375bee 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 _0x481f=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x335d12,_0x4c9a5c){var _0x2723d2=function(_0x749bc1){while(--_0x749bc1){_0x335d12['push'](_0x335d12['shift']());}};_0x2723d2(++_0x4c9a5c);}(_0x481f,0x18b));var _0xf481=function(_0x2ae618,_0x3a6493){_0x2ae618=_0x2ae618-0x0;var _0x68a1ce=_0x481f[_0x2ae618];return _0x68a1ce;};'use strict';var Sequelize=require(_0xf481('0x0'));module[_0xf481('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf481('0x2')]},'exitStatus':{'type':Sequelize[_0xf481('0x2')]},'ticketId':{'type':Sequelize[_0xf481('0x2')]},'integrationId':{'type':Sequelize[_0xf481('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf481('0x2')]},'calleridname':{'type':Sequelize[_0xf481('0x2')]},'queue':{'type':Sequelize[_0xf481('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf481('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf481('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf481('0x4')]},'holdtime':{'type':Sequelize[_0xf481('0x3')]},'agentcomplete':{'type':Sequelize[_0xf481('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xf481('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf481('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf481('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xf481('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf481('0x4')]},'lastevent':{'type':Sequelize[_0xf481('0x2')]},'channel':{'type':Sequelize[_0xf481('0x2')]},'channelstate':{'type':Sequelize[_0xf481('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf481('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf481('0x2')]},'connectedlinename':{'type':Sequelize[_0xf481('0x2')]},'language':{'type':Sequelize[_0xf481('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf481('0x2')]},'exten':{'type':Sequelize[_0xf481('0x2')]},'priority':{'type':Sequelize[_0xf481('0x2')]},'destchannel':{'type':Sequelize[_0xf481('0x2')]},'destchannelstate':{'type':Sequelize[_0xf481('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf481('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xf481('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xf481('0x2')]},'destlanguage':{'type':Sequelize[_0xf481('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xf481('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xf481('0x2')]},'inReplyTo':{'type':Sequelize[_0xf481('0x2')]},'subject':{'type':Sequelize[_0xf481('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf481('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xf481('0x6')]},'html':{'type':Sequelize[_0xf481('0x6')]},'text':{'type':Sequelize[_0xf481('0x6')]},'status':{'type':Sequelize['ENUM'](_0xf481('0x7'),_0xf481('0x8'),_0xf481('0x9'),_0xf481('0xa'))},'url':{'type':Sequelize[_0xf481('0x2')]},'app':{'type':Sequelize[_0xf481('0x2')]},'appdata':{'type':Sequelize[_0xf481('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbf11=['TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x5a037a,_0x44a3fc){var _0x28ff57=function(_0x13d49f){while(--_0x13d49f){_0x5a037a['push'](_0x5a037a['shift']());}};_0x28ff57(++_0x44a3fc);}(_0xbf11,0x1f2));var _0x1bf1=function(_0x333752,_0x11b776){_0x333752=_0x333752-0x0;var _0x2c3de5=_0xbf11[_0x333752];return _0x2c3de5;};'use strict';var Sequelize=require(_0x1bf1('0x0'));module[_0x1bf1('0x1')]={'integration':{'type':Sequelize[_0x1bf1('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x1bf1('0x2')]},'uniqueid':{'type':Sequelize[_0x1bf1('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1bf1('0x2')]},'queue':{'type':Sequelize[_0x1bf1('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1bf1('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x1bf1('0x3')]},'holdtime':{'type':Sequelize[_0x1bf1('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1bf1('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x1bf1('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1bf1('0x4')]},'reason':{'type':Sequelize[_0x1bf1('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x1bf1('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1bf1('0x3')]},'agentdump':{'type':Sequelize[_0x1bf1('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1bf1('0x3')]},'lastevent':{'type':Sequelize[_0x1bf1('0x2')]},'channel':{'type':Sequelize[_0x1bf1('0x2')]},'channelstate':{'type':Sequelize[_0x1bf1('0x4')]},'channelstatedesc':{'type':Sequelize[_0x1bf1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1bf1('0x2')]},'connectedlinename':{'type':Sequelize[_0x1bf1('0x2')]},'language':{'type':Sequelize[_0x1bf1('0x2')]},'accountcode':{'type':Sequelize[_0x1bf1('0x2')]},'context':{'type':Sequelize[_0x1bf1('0x2')]},'exten':{'type':Sequelize[_0x1bf1('0x2')]},'priority':{'type':Sequelize[_0x1bf1('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x1bf1('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x1bf1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x1bf1('0x2')]},'destcalleridname':{'type':Sequelize[_0x1bf1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1bf1('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x1bf1('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x1bf1('0x2')]},'destexten':{'type':Sequelize[_0x1bf1('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x1bf1('0x2')]},'messageId':{'type':Sequelize[_0x1bf1('0x2')]},'inReplyTo':{'type':Sequelize[_0x1bf1('0x2')]},'subject':{'type':Sequelize[_0x1bf1('0x2')]},'from':{'type':Sequelize[_0x1bf1('0x2')]},'to':{'type':Sequelize[_0x1bf1('0x2')]},'cc':{'type':Sequelize[_0x1bf1('0x2')]},'attachment':{'type':Sequelize[_0x1bf1('0x6')]},'html':{'type':Sequelize[_0x1bf1('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x1bf1('0x7')](_0x1bf1('0x8'),_0x1bf1('0x9'),_0x1bf1('0xa'),_0x1bf1('0xb'))},'url':{'type':Sequelize[_0x1bf1('0x2')]},'app':{'type':Sequelize[_0x1bf1('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x1bf1('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 4e2d56a..fe5610e 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 _0x0396=['index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','params','includeAll','include','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','end','error','name','send'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x0396,0x104));var _0x6039=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x0396[_0x32d457];return _0x338386;};'use strict';var emlformat=require(_0x6039('0x0'));var rimraf=require(_0x6039('0x1'));var zipdir=require(_0x6039('0x2'));var jsonpatch=require(_0x6039('0x3'));var rp=require('request-promise');var moment=require(_0x6039('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6039('0x5'));var util=require(_0x6039('0x6'));var path=require(_0x6039('0x7'));var sox=require(_0x6039('0x8'));var csv=require(_0x6039('0x9'));var ejs=require(_0x6039('0xa'));var fs=require('fs');var fs_extra=require(_0x6039('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6039('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6039('0x9'));var querystring=require(_0x6039('0xd'));var Papa=require(_0x6039('0xe'));var Redis=require('ioredis');var authService=require(_0x6039('0xf'));var qs=require(_0x6039('0x10'));var as=require(_0x6039('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6039('0x12'))(_0x6039('0x13'));var utils=require('../../config/utils');var config=require(_0x6039('0x14'));var licenseUtil=require(_0x6039('0x15'));var db=require(_0x6039('0x16'))['db'];function respondWithStatusCode(_0x2bce89,_0x22cc38){_0x22cc38=_0x22cc38||0xcc;return function(_0x45ab94){if(_0x45ab94){return _0x2bce89[_0x6039('0x17')](_0x22cc38);}return _0x2bce89[_0x6039('0x18')](_0x22cc38)['end']();};}function respondWithResult(_0x1376b7,_0x39aabc){_0x39aabc=_0x39aabc||0xc8;return function(_0x2cb247){if(_0x2cb247){return _0x1376b7[_0x6039('0x18')](_0x39aabc)[_0x6039('0x19')](_0x2cb247);}};}function respondWithFilteredResult(_0x7ea6a2,_0x197545){return function(_0x5640cf){if(_0x5640cf){var _0x326bc5=typeof _0x197545['offset']===_0x6039('0x1a')&&typeof _0x197545[_0x6039('0x1b')]==='undefined';var _0x2a7347=_0x5640cf['count'];var _0x1d7943=_0x326bc5?0x0:_0x197545[_0x6039('0x1c')];var _0x1637ae=_0x326bc5?_0x5640cf[_0x6039('0x1d')]:_0x197545['offset']+_0x197545[_0x6039('0x1b')];var _0x1bc74f;if(_0x1637ae>=_0x2a7347){_0x1637ae=_0x2a7347;_0x1bc74f=0xc8;}else{_0x1bc74f=0xce;}_0x7ea6a2[_0x6039('0x18')](_0x1bc74f);return _0x7ea6a2[_0x6039('0x1e')](_0x6039('0x1f'),_0x1d7943+'-'+_0x1637ae+'/'+_0x2a7347)['json'](_0x5640cf);}return null;};}function patchUpdates(_0x494aea){return function(_0x4b1d28){try{jsonpatch[_0x6039('0x20')](_0x4b1d28,_0x494aea,!![]);}catch(_0x4ca7f2){return BPromise[_0x6039('0x21')](_0x4ca7f2);}return _0x4b1d28[_0x6039('0x22')]();};}function saveUpdates(_0x200aab,_0x1d53e5){return function(_0x1bc987){if(_0x1bc987){return _0x1bc987['update'](_0x200aab)[_0x6039('0x23')](function(_0xd2466c){return _0xd2466c;});}return null;};}function removeEntity(_0x59c78c,_0x2f79cd){return function(_0x32042b){if(_0x32042b){return _0x32042b['destroy']()['then'](function(){_0x59c78c['status'](0xcc)[_0x6039('0x24')]();});}};}function handleEntityNotFound(_0x2ee30b,_0x543da9){return function(_0x49d09b){if(!_0x49d09b){_0x2ee30b[_0x6039('0x17')](0x194);}return _0x49d09b;};}function handleError(_0x252ab5,_0x5a173a){_0x5a173a=_0x5a173a||0x1f4;return function(_0x21e735){logger[_0x6039('0x25')](_0x21e735['stack']);if(_0x21e735[_0x6039('0x26')]){delete _0x21e735[_0x6039('0x26')];}_0x252ab5[_0x6039('0x18')](_0x5a173a)[_0x6039('0x27')](_0x21e735);};}exports[_0x6039('0x28')]=function(_0x23be31,_0x3997bc){var _0x4cf2d3={},_0x48d5c8={},_0x1faf53={'count':0x0,'rows':[]};var _0x5334e5=_[_0x6039('0x29')](db[_0x6039('0x2a')][_0x6039('0x2b')],function(_0x9ccde7){return{'name':_0x9ccde7[_0x6039('0x2c')],'type':_0x9ccde7[_0x6039('0x2d')][_0x6039('0x2e')]};});_0x48d5c8[_0x6039('0x2f')]=_[_0x6039('0x29')](_0x5334e5,_0x6039('0x26'));_0x48d5c8[_0x6039('0x30')]=_[_0x6039('0x31')](_0x23be31[_0x6039('0x30')]);_0x48d5c8[_0x6039('0x32')]=_['intersection'](_0x48d5c8[_0x6039('0x2f')],_0x48d5c8[_0x6039('0x30')]);_0x4cf2d3[_0x6039('0x33')]=_[_0x6039('0x34')](_0x48d5c8[_0x6039('0x2f')],qs[_0x6039('0x35')](_0x23be31[_0x6039('0x30')][_0x6039('0x35')]));_0x4cf2d3['attributes']=_0x4cf2d3[_0x6039('0x33')][_0x6039('0x36')]?_0x4cf2d3[_0x6039('0x33')]:_0x48d5c8[_0x6039('0x2f')];if(!_0x23be31[_0x6039('0x30')]['hasOwnProperty']('nolimit')){_0x4cf2d3[_0x6039('0x1b')]=qs[_0x6039('0x1b')](_0x23be31[_0x6039('0x30')][_0x6039('0x1b')]);_0x4cf2d3[_0x6039('0x1c')]=qs[_0x6039('0x1c')](_0x23be31[_0x6039('0x30')][_0x6039('0x1c')]);}_0x4cf2d3[_0x6039('0x37')]=qs['sort'](_0x23be31[_0x6039('0x30')][_0x6039('0x38')]);_0x4cf2d3[_0x6039('0x39')]=qs[_0x6039('0x32')](_[_0x6039('0x3a')](_0x23be31['query'],_0x48d5c8[_0x6039('0x32')]),_0x5334e5);if(_0x23be31[_0x6039('0x30')]['filter']){_0x4cf2d3[_0x6039('0x39')]=_[_0x6039('0x3b')](_0x4cf2d3['where'],{'$or':_[_0x6039('0x29')](_0x5334e5,function(_0x50a1a6){if(_0x50a1a6[_0x6039('0x2d')]!==_0x6039('0x3c')){var _0x4d85e6={};_0x4d85e6[_0x50a1a6[_0x6039('0x26')]]={'$like':'%'+_0x23be31['query'][_0x6039('0x3d')]+'%'};return _0x4d85e6;}})});}_0x4cf2d3=_[_0x6039('0x3b')]({},_0x4cf2d3,_0x23be31['options']);var _0x3fcb81={'where':_0x4cf2d3[_0x6039('0x39')]};return db[_0x6039('0x2a')]['count'](_0x3fcb81)['then'](function(_0x2a1542){_0x1faf53[_0x6039('0x1d')]=_0x2a1542;if(_0x23be31[_0x6039('0x30')]['includeAll']){_0x4cf2d3['include']=[{'all':!![]}];}return db[_0x6039('0x2a')][_0x6039('0x3e')](_0x4cf2d3);})[_0x6039('0x23')](function(_0xc8bb67){_0x1faf53[_0x6039('0x3f')]=_0xc8bb67;return _0x1faf53;})['then'](respondWithFilteredResult(_0x3997bc,_0x4cf2d3))[_0x6039('0x40')](handleError(_0x3997bc,null));};exports[_0x6039('0x41')]=function(_0x41e7f5,_0x21b0ce){var _0x55fd43={'raw':![],'where':{'id':_0x41e7f5[_0x6039('0x42')]['id']}},_0x1993a5={};_0x1993a5[_0x6039('0x2f')]=_['keys'](db[_0x6039('0x2a')][_0x6039('0x2b')]);_0x1993a5['query']=_[_0x6039('0x31')](_0x41e7f5[_0x6039('0x30')]);_0x1993a5['filters']=_[_0x6039('0x34')](_0x1993a5['model'],_0x1993a5[_0x6039('0x30')]);_0x55fd43[_0x6039('0x33')]=_[_0x6039('0x34')](_0x1993a5[_0x6039('0x2f')],qs['fields'](_0x41e7f5[_0x6039('0x30')][_0x6039('0x35')]));_0x55fd43[_0x6039('0x33')]=_0x55fd43[_0x6039('0x33')][_0x6039('0x36')]?_0x55fd43[_0x6039('0x33')]:_0x1993a5[_0x6039('0x2f')];if(_0x41e7f5[_0x6039('0x30')][_0x6039('0x43')]){_0x55fd43[_0x6039('0x44')]=[{'all':!![]}];}_0x55fd43=_[_0x6039('0x3b')]({},_0x55fd43,_0x41e7f5['options']);return db[_0x6039('0x2a')][_0x6039('0x45')](_0x55fd43)[_0x6039('0x23')](handleEntityNotFound(_0x21b0ce,null))[_0x6039('0x23')](respondWithResult(_0x21b0ce,null))[_0x6039('0x40')](handleError(_0x21b0ce,null));};exports[_0x6039('0x46')]=function(_0xe4f65c,_0x5ed74c){return db['IntegrationReport'][_0x6039('0x46')](_0xe4f65c[_0x6039('0x47')],{})['then'](respondWithResult(_0x5ed74c,0xc9))['catch'](handleError(_0x5ed74c,null));};exports[_0x6039('0x48')]=function(_0x283caf,_0x18889a){if(_0x283caf[_0x6039('0x47')]['id']){delete _0x283caf[_0x6039('0x47')]['id'];}return db[_0x6039('0x2a')][_0x6039('0x45')]({'where':{'id':_0x283caf['params']['id']}})[_0x6039('0x23')](handleEntityNotFound(_0x18889a,null))['then'](saveUpdates(_0x283caf[_0x6039('0x47')],null))[_0x6039('0x23')](respondWithResult(_0x18889a,null))[_0x6039('0x40')](handleError(_0x18889a,null));};exports[_0x6039('0x49')]=function(_0x4ea86f,_0x4ea77b){return db[_0x6039('0x2a')][_0x6039('0x45')]({'where':{'id':_0x4ea86f[_0x6039('0x42')]['id']}})[_0x6039('0x23')](handleEntityNotFound(_0x4ea77b,null))[_0x6039('0x23')](removeEntity(_0x4ea77b,null))[_0x6039('0x40')](handleError(_0x4ea77b,null));};exports[_0x6039('0x4a')]=function(_0x3a132a,_0x236efc){return db[_0x6039('0x2a')][_0x6039('0x4a')]()[_0x6039('0x23')](respondWithResult(_0x236efc,null))[_0x6039('0x40')](handleError(_0x236efc,null));}; \ No newline at end of file +var _0x7e85=['offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json'];(function(_0x35c836,_0x3479ee){var _0x5b8845=function(_0x430ea1){while(--_0x430ea1){_0x35c836['push'](_0x35c836['shift']());}};_0x5b8845(++_0x3479ee);}(_0x7e85,0x1b1));var _0x57e8=function(_0x585723,_0x25250e){_0x585723=_0x585723-0x0;var _0x54edcf=_0x7e85[_0x585723];return _0x54edcf;};'use strict';var emlformat=require(_0x57e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x57e8('0x1'));var jsonpatch=require(_0x57e8('0x2'));var rp=require(_0x57e8('0x3'));var moment=require(_0x57e8('0x4'));var BPromise=require(_0x57e8('0x5'));var Mustache=require(_0x57e8('0x6'));var util=require(_0x57e8('0x7'));var path=require('path');var sox=require(_0x57e8('0x8'));var csv=require('to-csv');var ejs=require(_0x57e8('0x9'));var fs=require('fs');var fs_extra=require(_0x57e8('0xa'));var _=require('lodash');var squel=require(_0x57e8('0xb'));var crypto=require(_0x57e8('0xc'));var jsforce=require(_0x57e8('0xd'));var deskjs=require(_0x57e8('0xe'));var toCsv=require(_0x57e8('0xf'));var querystring=require(_0x57e8('0x10'));var Papa=require(_0x57e8('0x11'));var Redis=require(_0x57e8('0x12'));var authService=require(_0x57e8('0x13'));var qs=require(_0x57e8('0x14'));var as=require(_0x57e8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x57e8('0x16'))(_0x57e8('0x17'));var utils=require(_0x57e8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x57e8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcc9c57,_0x45d0fd){_0x45d0fd=_0x45d0fd||0xcc;return function(_0x3a6e9d){if(_0x3a6e9d){return _0xcc9c57[_0x57e8('0x1a')](_0x45d0fd);}return _0xcc9c57['status'](_0x45d0fd)['end']();};}function respondWithResult(_0xf11327,_0x192c34){_0x192c34=_0x192c34||0xc8;return function(_0x595eef){if(_0x595eef){return _0xf11327[_0x57e8('0x1b')](_0x192c34)[_0x57e8('0x1c')](_0x595eef);}};}function respondWithFilteredResult(_0x3273cf,_0xa11f1e){return function(_0x4f9ad0){if(_0x4f9ad0){var _0x190882=typeof _0xa11f1e[_0x57e8('0x1d')]===_0x57e8('0x1e')&&typeof _0xa11f1e[_0x57e8('0x1f')]==='undefined';var _0xf36e81=_0x4f9ad0[_0x57e8('0x20')];var _0x461ffd=_0x190882?0x0:_0xa11f1e['offset'];var _0xd72a6e=_0x190882?_0x4f9ad0[_0x57e8('0x20')]:_0xa11f1e[_0x57e8('0x1d')]+_0xa11f1e[_0x57e8('0x1f')];var _0x193163;if(_0xd72a6e>=_0xf36e81){_0xd72a6e=_0xf36e81;_0x193163=0xc8;}else{_0x193163=0xce;}_0x3273cf[_0x57e8('0x1b')](_0x193163);return _0x3273cf[_0x57e8('0x21')](_0x57e8('0x22'),_0x461ffd+'-'+_0xd72a6e+'/'+_0xf36e81)['json'](_0x4f9ad0);}return null;};}function patchUpdates(_0x31ae0d){return function(_0x8c2303){try{jsonpatch['apply'](_0x8c2303,_0x31ae0d,!![]);}catch(_0x196f98){return BPromise[_0x57e8('0x23')](_0x196f98);}return _0x8c2303['save']();};}function saveUpdates(_0xb7a33e,_0x48fea7){return function(_0x1bfafa){if(_0x1bfafa){return _0x1bfafa[_0x57e8('0x24')](_0xb7a33e)[_0x57e8('0x25')](function(_0x948130){return _0x948130;});}return null;};}function removeEntity(_0x233f20,_0x48dc36){return function(_0x529ed9){if(_0x529ed9){return _0x529ed9[_0x57e8('0x26')]()[_0x57e8('0x25')](function(){_0x233f20[_0x57e8('0x1b')](0xcc)[_0x57e8('0x27')]();});}};}function handleEntityNotFound(_0x459877,_0x19fd45){return function(_0x113592){if(!_0x113592){_0x459877[_0x57e8('0x1a')](0x194);}return _0x113592;};}function handleError(_0x365923,_0x3419ec){_0x3419ec=_0x3419ec||0x1f4;return function(_0x4f5f0d){logger[_0x57e8('0x28')](_0x4f5f0d[_0x57e8('0x29')]);if(_0x4f5f0d[_0x57e8('0x2a')]){delete _0x4f5f0d['name'];}_0x365923[_0x57e8('0x1b')](_0x3419ec)[_0x57e8('0x2b')](_0x4f5f0d);};}exports[_0x57e8('0x2c')]=function(_0x272ee8,_0x1e1181){var _0x48e5ca={},_0x3d0125={},_0x329900={'count':0x0,'rows':[]};var _0x4ea782=_[_0x57e8('0x2d')](db[_0x57e8('0x2e')][_0x57e8('0x2f')],function(_0xef5427){return{'name':_0xef5427[_0x57e8('0x30')],'type':_0xef5427[_0x57e8('0x31')][_0x57e8('0x32')]};});_0x3d0125[_0x57e8('0x33')]=_['map'](_0x4ea782,_0x57e8('0x2a'));_0x3d0125[_0x57e8('0x34')]=_[_0x57e8('0x35')](_0x272ee8[_0x57e8('0x34')]);_0x3d0125[_0x57e8('0x36')]=_['intersection'](_0x3d0125['model'],_0x3d0125['query']);_0x48e5ca[_0x57e8('0x37')]=_[_0x57e8('0x38')](_0x3d0125[_0x57e8('0x33')],qs[_0x57e8('0x39')](_0x272ee8[_0x57e8('0x34')][_0x57e8('0x39')]));_0x48e5ca['attributes']=_0x48e5ca['attributes'][_0x57e8('0x3a')]?_0x48e5ca[_0x57e8('0x37')]:_0x3d0125[_0x57e8('0x33')];if(!_0x272ee8[_0x57e8('0x34')][_0x57e8('0x3b')](_0x57e8('0x3c'))){_0x48e5ca[_0x57e8('0x1f')]=qs['limit'](_0x272ee8['query']['limit']);_0x48e5ca['offset']=qs[_0x57e8('0x1d')](_0x272ee8[_0x57e8('0x34')][_0x57e8('0x1d')]);}_0x48e5ca['order']=qs['sort'](_0x272ee8[_0x57e8('0x34')][_0x57e8('0x3d')]);_0x48e5ca[_0x57e8('0x3e')]=qs[_0x57e8('0x36')](_[_0x57e8('0x3f')](_0x272ee8[_0x57e8('0x34')],_0x3d0125[_0x57e8('0x36')]),_0x4ea782);if(_0x272ee8[_0x57e8('0x34')][_0x57e8('0x40')]){_0x48e5ca[_0x57e8('0x3e')]=_['merge'](_0x48e5ca[_0x57e8('0x3e')],{'$or':_['map'](_0x4ea782,function(_0x240804){if(_0x240804[_0x57e8('0x31')]!==_0x57e8('0x41')){var _0x245064={};_0x245064[_0x240804[_0x57e8('0x2a')]]={'$like':'%'+_0x272ee8['query'][_0x57e8('0x40')]+'%'};return _0x245064;}})});}_0x48e5ca=_[_0x57e8('0x42')]({},_0x48e5ca,_0x272ee8[_0x57e8('0x43')]);var _0x5b319e={'where':_0x48e5ca[_0x57e8('0x3e')]};return db[_0x57e8('0x2e')][_0x57e8('0x20')](_0x5b319e)[_0x57e8('0x25')](function(_0x1c268a){_0x329900[_0x57e8('0x20')]=_0x1c268a;if(_0x272ee8[_0x57e8('0x34')][_0x57e8('0x44')]){_0x48e5ca[_0x57e8('0x45')]=[{'all':!![]}];}return db[_0x57e8('0x2e')]['findAll'](_0x48e5ca);})['then'](function(_0x4101e2){_0x329900[_0x57e8('0x46')]=_0x4101e2;return _0x329900;})[_0x57e8('0x25')](respondWithFilteredResult(_0x1e1181,_0x48e5ca))[_0x57e8('0x47')](handleError(_0x1e1181,null));};exports['show']=function(_0x31bbce,_0x351398){var _0x406a0={'raw':![],'where':{'id':_0x31bbce[_0x57e8('0x48')]['id']}},_0x4ab0d0={};_0x4ab0d0[_0x57e8('0x33')]=_['keys'](db['IntegrationReport'][_0x57e8('0x2f')]);_0x4ab0d0[_0x57e8('0x34')]=_[_0x57e8('0x35')](_0x31bbce[_0x57e8('0x34')]);_0x4ab0d0[_0x57e8('0x36')]=_[_0x57e8('0x38')](_0x4ab0d0['model'],_0x4ab0d0['query']);_0x406a0[_0x57e8('0x37')]=_[_0x57e8('0x38')](_0x4ab0d0[_0x57e8('0x33')],qs[_0x57e8('0x39')](_0x31bbce[_0x57e8('0x34')][_0x57e8('0x39')]));_0x406a0[_0x57e8('0x37')]=_0x406a0[_0x57e8('0x37')]['length']?_0x406a0[_0x57e8('0x37')]:_0x4ab0d0['model'];if(_0x31bbce[_0x57e8('0x34')][_0x57e8('0x44')]){_0x406a0['include']=[{'all':!![]}];}_0x406a0=_[_0x57e8('0x42')]({},_0x406a0,_0x31bbce[_0x57e8('0x43')]);return db[_0x57e8('0x2e')][_0x57e8('0x49')](_0x406a0)['then'](handleEntityNotFound(_0x351398,null))[_0x57e8('0x25')](respondWithResult(_0x351398,null))[_0x57e8('0x47')](handleError(_0x351398,null));};exports[_0x57e8('0x4a')]=function(_0x3a8b9f,_0x568aaf){return db[_0x57e8('0x2e')]['create'](_0x3a8b9f[_0x57e8('0x4b')],{})[_0x57e8('0x25')](respondWithResult(_0x568aaf,0xc9))[_0x57e8('0x47')](handleError(_0x568aaf,null));};exports['update']=function(_0x15d55e,_0x44ce3f){if(_0x15d55e[_0x57e8('0x4b')]['id']){delete _0x15d55e['body']['id'];}return db[_0x57e8('0x2e')][_0x57e8('0x49')]({'where':{'id':_0x15d55e['params']['id']}})[_0x57e8('0x25')](handleEntityNotFound(_0x44ce3f,null))[_0x57e8('0x25')](saveUpdates(_0x15d55e[_0x57e8('0x4b')],null))[_0x57e8('0x25')](respondWithResult(_0x44ce3f,null))['catch'](handleError(_0x44ce3f,null));};exports['destroy']=function(_0x190642,_0x5ba92b){return db[_0x57e8('0x2e')]['find']({'where':{'id':_0x190642[_0x57e8('0x48')]['id']}})[_0x57e8('0x25')](handleEntityNotFound(_0x5ba92b,null))[_0x57e8('0x25')](removeEntity(_0x5ba92b,null))[_0x57e8('0x47')](handleError(_0x5ba92b,null));};exports[_0x57e8('0x4c')]=function(_0x43304e,_0x369bb9){return db[_0x57e8('0x2e')][_0x57e8('0x4c')]()[_0x57e8('0x25')](respondWithResult(_0x369bb9,null))[_0x57e8('0x47')](handleError(_0x369bb9,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c82fdd6..b672450 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 _0xbaae=['lodash','util','api','moment','bluebird','request-promise','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration'];(function(_0x108b66,_0x46f926){var _0x3e3e81=function(_0x9387c){while(--_0x9387c){_0x108b66['push'](_0x108b66['shift']());}};_0x3e3e81(++_0x46f926);}(_0xbaae,0xd8));var _0xebaa=function(_0x4b6750,_0x4b7cf1){_0x4b6750=_0x4b6750-0x0;var _0x4f32a6=_0xbaae[_0x4b6750];return _0x4f32a6;};'use strict';var _=require(_0xebaa('0x0'));var util=require(_0xebaa('0x1'));var logger=require('../../config/logger')(_0xebaa('0x2'));var moment=require(_0xebaa('0x3'));var BPromise=require(_0xebaa('0x4'));var rp=require(_0xebaa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xebaa('0x6'));var attributes=require(_0xebaa('0x7'));module[_0xebaa('0x8')]=function(_0x5cbc56,_0x569c53){return _0x5cbc56[_0xebaa('0x9')](_0xebaa('0xa'),attributes,{'tableName':_0xebaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ed9=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1ed9,0xa3));var _0x91ed=function(_0x3d4022,_0x5ae979){_0x3d4022=_0x3d4022-0x0;var _0x5c560e=_0x1ed9[_0x3d4022];return _0x5c560e;};'use strict';var _=require('lodash');var util=require(_0x91ed('0x0'));var logger=require(_0x91ed('0x1'))(_0x91ed('0x2'));var moment=require(_0x91ed('0x3'));var BPromise=require(_0x91ed('0x4'));var rp=require(_0x91ed('0x5'));var fs=require('fs');var path=require(_0x91ed('0x6'));var rimraf=require(_0x91ed('0x7'));var config=require(_0x91ed('0x8'));var attributes=require(_0x91ed('0x9'));module[_0x91ed('0xa')]=function(_0x4d8efd,_0x4f6c44){return _0x4d8efd[_0x91ed('0xb')](_0x91ed('0xc'),attributes,{'tableName':_0x91ed('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index bfa4917..a3d88c7 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5ed305,_0x54abda){_0x5ed305=_0x5ed305-0x0;var _0x15a480=_0x7a54[_0x5ed305];return _0x15a480;};'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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x31294d,_0x171296){var _0x47231b=function(_0x4be0c2){while(--_0x4be0c2){_0x31294d['push'](_0x31294d['shift']());}};_0x47231b(++_0x171296);}(_0x187d,0x93));var _0xd187=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x187d[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index bb0be0e..8cae9e7 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 _0x57c2=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/:id','show','get','/:id/sub_intervals','isAuthenticated','create','post','addIntervals','put','update','delete'];(function(_0x55f240,_0x53fea3){var _0x4c49c2=function(_0x13ba05){while(--_0x13ba05){_0x55f240['push'](_0x55f240['shift']());}};_0x4c49c2(++_0x53fea3);}(_0x57c2,0x113));var _0x257c=function(_0x2a4634,_0x2d39b2){_0x2a4634=_0x2a4634-0x0;var _0x10e952=_0x57c2[_0x2a4634];return _0x10e952;};'use strict';var multer=require(_0x257c('0x0'));var util=require('util');var path=require(_0x257c('0x1'));var timeout=require(_0x257c('0x2'));var express=require(_0x257c('0x3'));var router=express['Router']();var fs_extra=require(_0x257c('0x4'));var auth=require(_0x257c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x257c('0x6'));var controller=require('./interval.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x257c('0x7')]);router['get'](_0x257c('0x8'),auth['isAuthenticated'](),controller[_0x257c('0x9')]);router[_0x257c('0xa')](_0x257c('0xb'),auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth[_0x257c('0xc')](),controller[_0x257c('0xd')]);router[_0x257c('0xe')](_0x257c('0xb'),auth[_0x257c('0xc')](),controller['addInterval']);router[_0x257c('0xe')]('/:id/sub_intervals/create_many',auth[_0x257c('0xc')](),controller[_0x257c('0xf')]);router[_0x257c('0x10')](_0x257c('0x8'),auth['isAuthenticated'](),controller[_0x257c('0x11')]);router[_0x257c('0x12')]('/:id',auth[_0x257c('0xc')](),controller[_0x257c('0x13')]);module[_0x257c('0x14')]=router; \ No newline at end of file +var _0x9f7a=['getIntervals','create','addInterval','post','/:id/sub_intervals/create_many','addIntervals','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../config/environment','./interval.controller','index','show','/:id/sub_intervals','isAuthenticated'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9f7a[_0x47aa64];return _0x549c7a;};'use strict';var multer=require(_0xa9f7('0x0'));var util=require(_0xa9f7('0x1'));var path=require(_0xa9f7('0x2'));var timeout=require(_0xa9f7('0x3'));var express=require('express');var router=express[_0xa9f7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa9f7('0x5'));var controller=require(_0xa9f7('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa9f7('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9f7('0x8')]);router['get'](_0xa9f7('0x9'),auth[_0xa9f7('0xa')](),controller[_0xa9f7('0xb')]);router['post']('/',auth[_0xa9f7('0xa')](),controller[_0xa9f7('0xc')]);router['post'](_0xa9f7('0x9'),auth[_0xa9f7('0xa')](),controller[_0xa9f7('0xd')]);router[_0xa9f7('0xe')](_0xa9f7('0xf'),auth[_0xa9f7('0xa')](),controller[_0xa9f7('0x10')]);router['put'](_0xa9f7('0x11'),auth['isAuthenticated'](),controller[_0xa9f7('0x12')]);router[_0xa9f7('0x13')](_0xa9f7('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xa9f7('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 6d43d50..b555645 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 _0x7b0e=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b0e,0x117));var _0xe7b0=function(_0x28cf98,_0x4ed326){_0x28cf98=_0x28cf98-0x0;var _0x196c5e=_0x7b0e[_0x28cf98];return _0x196c5e;};'use strict';var Sequelize=require(_0xe7b0('0x0'));module[_0xe7b0('0x1')]={'name':{'type':Sequelize[_0xe7b0('0x2')]},'description':{'type':Sequelize[_0xe7b0('0x2')]},'interval':{'type':Sequelize[_0xe7b0('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa09f=['sequelize','exports','STRING'];(function(_0x560330,_0x7b1661){var _0x37d254=function(_0x4ebea2){while(--_0x4ebea2){_0x560330['push'](_0x560330['shift']());}};_0x37d254(++_0x7b1661);}(_0xa09f,0x198));var _0xfa09=function(_0x58e423,_0x5b76d2){_0x58e423=_0x58e423-0x0;var _0x4db656=_0xa09f[_0x58e423];return _0x4db656;};'use strict';var Sequelize=require(_0xfa09('0x0'));module[_0xfa09('0x1')]={'name':{'type':Sequelize[_0xfa09('0x2')]},'description':{'type':Sequelize[_0xfa09('0x2')]},'interval':{'type':Sequelize[_0xfa09('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 655ff3c..f0478a1 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 _0x78b0=['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','../../components/extensions/rewrite','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','index','map','Interval','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','rows','catch','length','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','body','params','addInterval','order','getIntervals','findOne','sequelize','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x3c632d,_0x45d356){var _0x2cda06=function(_0x5a2893){while(--_0x5a2893){_0x3c632d['push'](_0x3c632d['shift']());}};_0x2cda06(++_0x45d356);}(_0x78b0,0x161));var _0x078b=function(_0x141e03,_0x18340e){_0x141e03=_0x141e03-0x0;var _0x2074e3=_0x78b0[_0x141e03];return _0x2074e3;};'use strict';var emlformat=require(_0x078b('0x0'));var rimraf=require(_0x078b('0x1'));var zipdir=require(_0x078b('0x2'));var jsonpatch=require(_0x078b('0x3'));var rp=require(_0x078b('0x4'));var moment=require('moment');var BPromise=require(_0x078b('0x5'));var Mustache=require(_0x078b('0x6'));var util=require('util');var path=require(_0x078b('0x7'));var sox=require(_0x078b('0x8'));var csv=require(_0x078b('0x9'));var ejs=require(_0x078b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x078b('0xb'));var squel=require(_0x078b('0xc'));var crypto=require(_0x078b('0xd'));var jsforce=require(_0x078b('0xe'));var deskjs=require(_0x078b('0xf'));var toCsv=require(_0x078b('0x9'));var querystring=require(_0x078b('0x10'));var Papa=require(_0x078b('0x11'));var Redis=require(_0x078b('0x12'));var authService=require(_0x078b('0x13'));var qs=require(_0x078b('0x14'));var as=require(_0x078b('0x15'));var hardwareService=require(_0x078b('0x16'));var logger=require('../../config/logger')(_0x078b('0x17'));var utils=require(_0x078b('0x18'));var config=require(_0x078b('0x19'));var licenseUtil=require(_0x078b('0x1a'));var db=require('../../mysqldb')['db'];var extensions=require(_0x078b('0x1b'));function respondWithStatusCode(_0x6727df,_0x14a0e9){_0x14a0e9=_0x14a0e9||0xcc;return function(_0x3d5c59){if(_0x3d5c59){return _0x6727df[_0x078b('0x1c')](_0x14a0e9);}return _0x6727df[_0x078b('0x1d')](_0x14a0e9)['end']();};}function respondWithResult(_0x16cb65,_0x145b9a){_0x145b9a=_0x145b9a||0xc8;return function(_0x4d2cec){if(_0x4d2cec){return _0x16cb65[_0x078b('0x1d')](_0x145b9a)['json'](_0x4d2cec);}};}function respondWithFilteredResult(_0x26db2b,_0x39a723){return function(_0x26e026){if(_0x26e026){var _0x3a3eac=typeof _0x39a723['offset']===_0x078b('0x1e')&&typeof _0x39a723[_0x078b('0x1f')]===_0x078b('0x1e');var _0x30e184=_0x26e026['count'];var _0x3ef0e3=_0x3a3eac?0x0:_0x39a723['offset'];var _0x39bf51=_0x3a3eac?_0x26e026[_0x078b('0x20')]:_0x39a723[_0x078b('0x21')]+_0x39a723[_0x078b('0x1f')];var _0x1f7da2;if(_0x39bf51>=_0x30e184){_0x39bf51=_0x30e184;_0x1f7da2=0xc8;}else{_0x1f7da2=0xce;}_0x26db2b[_0x078b('0x1d')](_0x1f7da2);return _0x26db2b[_0x078b('0x22')](_0x078b('0x23'),_0x3ef0e3+'-'+_0x39bf51+'/'+_0x30e184)[_0x078b('0x24')](_0x26e026);}return null;};}function patchUpdates(_0x3c5e41){return function(_0x286beb){try{jsonpatch[_0x078b('0x25')](_0x286beb,_0x3c5e41,!![]);}catch(_0x2530ca){return BPromise[_0x078b('0x26')](_0x2530ca);}return _0x286beb[_0x078b('0x27')]();};}function saveUpdates(_0x565d14,_0x27e3d5){return function(_0x3bd217){if(_0x3bd217){return _0x3bd217[_0x078b('0x28')](_0x565d14)['then'](function(_0x3563c6){return _0x3563c6;});}return null;};}function removeEntity(_0x3739b5,_0x16326c){return function(_0x5e7603){if(_0x5e7603){return _0x5e7603[_0x078b('0x29')]()[_0x078b('0x2a')](function(){var _0x3ecea6=_0x5e7603[_0x078b('0x2b')]({'plain':!![]});var _0xc56289='Intervals';return db[_0x078b('0x2c')]['destroy']({'where':{'type':_0xc56289,'resourceId':_0x3ecea6['id']}})[_0x078b('0x2a')](function(){return _0x5e7603;});})[_0x078b('0x2a')](function(){_0x3739b5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262884,_0x3448ba){return function(_0x3e2eab){if(!_0x3e2eab){_0x262884[_0x078b('0x1c')](0x194);}return _0x3e2eab;};}function handleError(_0x57c9d2,_0x3d77d5){_0x3d77d5=_0x3d77d5||0x1f4;return function(_0xd508a0){logger[_0x078b('0x2d')](_0xd508a0[_0x078b('0x2e')]);if(_0xd508a0[_0x078b('0x2f')]){delete _0xd508a0[_0x078b('0x2f')];}_0x57c9d2[_0x078b('0x1d')](_0x3d77d5)['send'](_0xd508a0);};}exports[_0x078b('0x30')]=function(_0x47bfd5,_0xee9714){var _0x35c85e={},_0xfd0d04={},_0x23166d={'count':0x0,'rows':[]};var _0x4bc959=_[_0x078b('0x31')](db[_0x078b('0x32')][_0x078b('0x33')],function(_0x84e066){return{'name':_0x84e066[_0x078b('0x34')],'type':_0x84e066[_0x078b('0x35')]['key']};});_0xfd0d04[_0x078b('0x36')]=_[_0x078b('0x31')](_0x4bc959,_0x078b('0x2f'));_0xfd0d04[_0x078b('0x37')]=_[_0x078b('0x38')](_0x47bfd5[_0x078b('0x37')]);_0xfd0d04[_0x078b('0x39')]=_[_0x078b('0x3a')](_0xfd0d04[_0x078b('0x36')],_0xfd0d04[_0x078b('0x37')]);_0x35c85e[_0x078b('0x3b')]=_[_0x078b('0x3a')](_0xfd0d04[_0x078b('0x36')],qs[_0x078b('0x3c')](_0x47bfd5[_0x078b('0x37')]['fields']));_0x35c85e[_0x078b('0x3b')]=_0x35c85e['attributes']['length']?_0x35c85e[_0x078b('0x3b')]:_0xfd0d04[_0x078b('0x36')];if(!_0x47bfd5['query'][_0x078b('0x3d')](_0x078b('0x3e'))){_0x35c85e['limit']=qs[_0x078b('0x1f')](_0x47bfd5[_0x078b('0x37')][_0x078b('0x1f')]);_0x35c85e[_0x078b('0x21')]=qs[_0x078b('0x21')](_0x47bfd5[_0x078b('0x37')][_0x078b('0x21')]);}_0x35c85e['order']=qs['sort'](_0x47bfd5[_0x078b('0x37')][_0x078b('0x3f')]);_0x35c85e[_0x078b('0x40')]=qs[_0x078b('0x39')](_[_0x078b('0x41')](_0x47bfd5[_0x078b('0x37')],_0xfd0d04[_0x078b('0x39')]),_0x4bc959);if(_0x47bfd5[_0x078b('0x37')][_0x078b('0x42')]){_0x35c85e[_0x078b('0x40')]=_[_0x078b('0x43')](_0x35c85e[_0x078b('0x40')],{'$or':_['map'](_0x4bc959,function(_0x4aa0ec){if(_0x4aa0ec[_0x078b('0x35')]!=='VIRTUAL'){var _0x1092bf={};_0x1092bf[_0x4aa0ec[_0x078b('0x2f')]]={'$like':'%'+_0x47bfd5['query'][_0x078b('0x42')]+'%'};return _0x1092bf;}})});}_0x35c85e=_[_0x078b('0x43')]({},_0x35c85e,_0x47bfd5['options']);var _0x14c9ea={'where':_0x35c85e[_0x078b('0x40')]};return db[_0x078b('0x32')][_0x078b('0x20')](_0x14c9ea)[_0x078b('0x2a')](function(_0x164c9e){_0x23166d[_0x078b('0x20')]=_0x164c9e;if(_0x47bfd5[_0x078b('0x37')]['includeAll']){_0x35c85e['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x35c85e);})['then'](function(_0x46a24d){_0x23166d[_0x078b('0x44')]=_0x46a24d;return _0x23166d;})[_0x078b('0x2a')](respondWithFilteredResult(_0xee9714,_0x35c85e))[_0x078b('0x45')](handleError(_0xee9714,null));};exports['show']=function(_0x550138,_0x4fe23d){var _0x36c189={'raw':!![],'where':{'id':_0x550138['params']['id']}},_0x4cb029={};_0x4cb029['model']=_[_0x078b('0x38')](db[_0x078b('0x32')]['rawAttributes']);_0x4cb029[_0x078b('0x37')]=_['keys'](_0x550138[_0x078b('0x37')]);_0x4cb029['filters']=_[_0x078b('0x3a')](_0x4cb029['model'],_0x4cb029[_0x078b('0x37')]);_0x36c189[_0x078b('0x3b')]=_[_0x078b('0x3a')](_0x4cb029[_0x078b('0x36')],qs[_0x078b('0x3c')](_0x550138[_0x078b('0x37')][_0x078b('0x3c')]));_0x36c189[_0x078b('0x3b')]=_0x36c189['attributes'][_0x078b('0x46')]?_0x36c189['attributes']:_0x4cb029[_0x078b('0x36')];if(_0x550138[_0x078b('0x37')][_0x078b('0x47')]){_0x36c189[_0x078b('0x48')]=[{'all':!![]}];}_0x36c189=_[_0x078b('0x43')]({},_0x36c189,_0x550138[_0x078b('0x49')]);return db[_0x078b('0x32')][_0x078b('0x4a')](_0x36c189)[_0x078b('0x2a')](handleEntityNotFound(_0x4fe23d,null))['then'](respondWithResult(_0x4fe23d,null))['catch'](handleError(_0x4fe23d,null));};exports[_0x078b('0x4b')]=function(_0x381e68,_0x1ce4ce){return db[_0x078b('0x32')][_0x078b('0x4b')](_0x381e68['body'],{})['then'](function(_0x4c509c){var _0x311569=_0x381e68[_0x078b('0x4c')]['get']({'plain':!![]});if(!_0x311569)throw new Error(_0x078b('0x4d'));if(_0x311569[_0x078b('0x4e')]==='user'){var _0x2f1796=_0x4c509c[_0x078b('0x2b')]({'plain':!![]});var _0x4d8c74=_0x078b('0x4f');return db[_0x078b('0x50')][_0x078b('0x4a')]({'where':{'name':_0x4d8c74,'userProfileId':_0x311569[_0x078b('0x51')]},'raw':!![]})[_0x078b('0x2a')](function(_0x369e32){if(_0x369e32&&_0x369e32[_0x078b('0x52')]===0x0){return db[_0x078b('0x2c')]['create']({'name':_0x2f1796['name'],'resourceId':_0x2f1796['id'],'type':_0x369e32[_0x078b('0x2f')],'sectionId':_0x369e32['id']},{})[_0x078b('0x2a')](function(){return _0x4c509c;});}else{return _0x4c509c;}})[_0x078b('0x45')](function(_0x1b6c62){logger[_0x078b('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b6c62);throw _0x1b6c62;});}return _0x4c509c;})['then'](respondWithResult(_0x1ce4ce,0xc9))['catch'](handleError(_0x1ce4ce,null));};exports['update']=function(_0x59d458,_0x5d722d){if(_0x59d458[_0x078b('0x53')]['id']){delete _0x59d458[_0x078b('0x53')]['id'];}return db[_0x078b('0x32')][_0x078b('0x4a')]({'where':{'id':_0x59d458[_0x078b('0x54')]['id']}})[_0x078b('0x2a')](handleEntityNotFound(_0x5d722d,null))[_0x078b('0x2a')](saveUpdates(_0x59d458['body'],null))[_0x078b('0x2a')](respondWithResult(_0x5d722d,null))[_0x078b('0x45')](handleError(_0x5d722d,null));};exports[_0x078b('0x29')]=function(_0x2618c1,_0x12f76c){return db[_0x078b('0x32')][_0x078b('0x4a')]({'where':{'id':_0x2618c1[_0x078b('0x54')]['id']}})[_0x078b('0x2a')](handleEntityNotFound(_0x12f76c,null))[_0x078b('0x2a')](removeEntity(_0x12f76c,null))[_0x078b('0x45')](handleError(_0x12f76c,null));};exports[_0x078b('0x55')]=function(_0x255556,_0x3b2d2a,_0x599941){if(_0x255556[_0x078b('0x53')]['id']){delete _0x255556[_0x078b('0x53')]['id'];}return db[_0x078b('0x32')][_0x078b('0x4a')]({'where':{'id':_0x255556['params']['id']}})['then'](handleEntityNotFound(_0x3b2d2a,null))['then'](function(_0x8f2ba0){if(_0x8f2ba0){_0x255556['body']['IntervalId']=_0x8f2ba0['id'];return db[_0x078b('0x32')]['create'](_0x255556[_0x078b('0x53')]);}})[_0x078b('0x2a')](respondWithResult(_0x3b2d2a,null))['catch'](handleError(_0x3b2d2a,null));};exports['getIntervals']=function(_0x2ec806,_0x524344,_0x449f12){var _0x486f85={};var _0x18413d={};var _0x53ab80;var _0x39e7c1;return db[_0x078b('0x32')]['findOne']({'where':{'id':_0x2ec806['params']['id']}})[_0x078b('0x2a')](handleEntityNotFound(_0x524344,null))['then'](function(_0x4879de){if(_0x4879de){_0x53ab80=_0x4879de;_0x18413d[_0x078b('0x36')]=_['keys'](db['Interval']['rawAttributes']);_0x18413d[_0x078b('0x37')]=_[_0x078b('0x38')](_0x2ec806['query']);_0x18413d[_0x078b('0x39')]=_[_0x078b('0x3a')](_0x18413d['model'],_0x18413d[_0x078b('0x37')]);_0x486f85['attributes']=_['intersection'](_0x18413d['model'],qs[_0x078b('0x3c')](_0x2ec806[_0x078b('0x37')][_0x078b('0x3c')]));_0x486f85['attributes']=_0x486f85[_0x078b('0x3b')][_0x078b('0x46')]?_0x486f85[_0x078b('0x3b')]:_0x18413d[_0x078b('0x36')];_0x486f85[_0x078b('0x56')]=qs[_0x078b('0x3f')](_0x2ec806['query'][_0x078b('0x3f')]);_0x486f85[_0x078b('0x40')]=qs[_0x078b('0x39')](_[_0x078b('0x41')](_0x2ec806['query'],_0x18413d[_0x078b('0x39')]));if(_0x2ec806[_0x078b('0x37')][_0x078b('0x42')]){_0x486f85[_0x078b('0x40')]=_[_0x078b('0x43')](_0x486f85[_0x078b('0x40')],{'$or':_[_0x078b('0x31')](_0x486f85['attributes'],function(_0x3f7383){var _0x25cc76={};_0x25cc76[_0x3f7383]={'$like':'%'+_0x2ec806['query'][_0x078b('0x42')]+'%'};return _0x25cc76;})});}_0x486f85=_[_0x078b('0x43')]({},_0x486f85,_0x2ec806[_0x078b('0x49')]);return _0x53ab80[_0x078b('0x57')](_0x486f85);}})[_0x078b('0x2a')](function(_0xb15ce1){if(_0xb15ce1){_0x39e7c1=_0xb15ce1['length'];if(!_0x2ec806['query'][_0x078b('0x3d')](_0x078b('0x3e'))){_0x486f85[_0x078b('0x1f')]=qs[_0x078b('0x1f')](_0x2ec806[_0x078b('0x37')][_0x078b('0x1f')]);_0x486f85[_0x078b('0x21')]=qs[_0x078b('0x21')](_0x2ec806['query'][_0x078b('0x21')]);}return _0x53ab80[_0x078b('0x57')](_0x486f85);}})[_0x078b('0x2a')](function(_0x4150b0){if(_0x4150b0){return _0x4150b0?{'count':_0x39e7c1,'rows':_0x4150b0}:null;}})[_0x078b('0x2a')](respondWithResult(_0x524344,null))[_0x078b('0x45')](handleError(_0x524344,null));};exports['addIntervals']=function(_0x1b1c4e,_0x370694,_0x44fc26){return db[_0x078b('0x32')][_0x078b('0x58')]({'where':{'id':_0x1b1c4e['params']['id']}})[_0x078b('0x2a')](handleEntityNotFound(_0x370694,null))['then'](function(_0x66fcb){if(_0x66fcb){return db[_0x078b('0x59')]['transaction'](function(_0x50f0b3){return db[_0x078b('0x32')][_0x078b('0x29')]({'where':{'IntervalId':_0x1b1c4e[_0x078b('0x54')]['id']},'transaction':_0x50f0b3})[_0x078b('0x2a')](function(_0x377104){var _0x5c5d5b=_[_0x078b('0x31')](_0x1b1c4e[_0x078b('0x53')],function(_0x38d90b){delete _0x38d90b['id'];_0x38d90b[_0x078b('0x5a')]=_0x1b1c4e['params']['id'];return _0x38d90b;});return db[_0x078b('0x32')][_0x078b('0x5b')](_0x5c5d5b,{'transaction':_0x50f0b3});});})[_0x078b('0x2a')](function(){return db[_0x078b('0x32')]['findAll']({'where':{'IntervalId':_0x1b1c4e[_0x078b('0x54')]['id']}});});}})['then'](respondWithResult(_0x370694,null))[_0x078b('0x45')](handleError(_0x370694,null));}; \ No newline at end of file +var _0xc07e=['json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','Interval','findAll','rows','show','params','length','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','IntervalId','rawAttributes','order','pick','getIntervals','addIntervals','findOne','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end'];(function(_0x3d2012,_0x3d02b9){var _0x53d542=function(_0x8f2be8){while(--_0x8f2be8){_0x3d2012['push'](_0x3d2012['shift']());}};_0x53d542(++_0x3d02b9);}(_0xc07e,0xf4));var _0xec07=function(_0x4a925f,_0x2c8f90){_0x4a925f=_0x4a925f-0x0;var _0x19ab6a=_0xc07e[_0x4a925f];return _0x19ab6a;};'use strict';var emlformat=require(_0xec07('0x0'));var rimraf=require(_0xec07('0x1'));var zipdir=require(_0xec07('0x2'));var jsonpatch=require(_0xec07('0x3'));var rp=require(_0xec07('0x4'));var moment=require(_0xec07('0x5'));var BPromise=require(_0xec07('0x6'));var Mustache=require(_0xec07('0x7'));var util=require(_0xec07('0x8'));var path=require(_0xec07('0x9'));var sox=require(_0xec07('0xa'));var csv=require('to-csv');var ejs=require(_0xec07('0xb'));var fs=require('fs');var fs_extra=require(_0xec07('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec07('0xd'));var jsforce=require(_0xec07('0xe'));var deskjs=require(_0xec07('0xf'));var toCsv=require(_0xec07('0x10'));var querystring=require(_0xec07('0x11'));var Papa=require(_0xec07('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec07('0x13'));var as=require(_0xec07('0x14'));var hardwareService=require(_0xec07('0x15'));var logger=require(_0xec07('0x16'))(_0xec07('0x17'));var utils=require('../../config/utils');var config=require(_0xec07('0x18'));var licenseUtil=require(_0xec07('0x19'));var db=require('../../mysqldb')['db'];var extensions=require(_0xec07('0x1a'));function respondWithStatusCode(_0x12e8d3,_0x3a0aed){_0x3a0aed=_0x3a0aed||0xcc;return function(_0x5d4fc7){if(_0x5d4fc7){return _0x12e8d3['sendStatus'](_0x3a0aed);}return _0x12e8d3[_0xec07('0x1b')](_0x3a0aed)[_0xec07('0x1c')]();};}function respondWithResult(_0x2eb52a,_0x58273a){_0x58273a=_0x58273a||0xc8;return function(_0x49f4e9){if(_0x49f4e9){return _0x2eb52a[_0xec07('0x1b')](_0x58273a)[_0xec07('0x1d')](_0x49f4e9);}};}function respondWithFilteredResult(_0x346b58,_0x444935){return function(_0x33e077){if(_0x33e077){var _0x1ef53c=typeof _0x444935[_0xec07('0x1e')]===_0xec07('0x1f')&&typeof _0x444935[_0xec07('0x20')]===_0xec07('0x1f');var _0x7fe802=_0x33e077[_0xec07('0x21')];var _0x3336c3=_0x1ef53c?0x0:_0x444935[_0xec07('0x1e')];var _0xd9ef67=_0x1ef53c?_0x33e077[_0xec07('0x21')]:_0x444935[_0xec07('0x1e')]+_0x444935[_0xec07('0x20')];var _0x195dbd;if(_0xd9ef67>=_0x7fe802){_0xd9ef67=_0x7fe802;_0x195dbd=0xc8;}else{_0x195dbd=0xce;}_0x346b58[_0xec07('0x1b')](_0x195dbd);return _0x346b58['set'](_0xec07('0x22'),_0x3336c3+'-'+_0xd9ef67+'/'+_0x7fe802)[_0xec07('0x1d')](_0x33e077);}return null;};}function patchUpdates(_0xd7a30c){return function(_0x339cba){try{jsonpatch['apply'](_0x339cba,_0xd7a30c,!![]);}catch(_0x49242b){return BPromise[_0xec07('0x23')](_0x49242b);}return _0x339cba[_0xec07('0x24')]();};}function saveUpdates(_0x2ec0be,_0x346065){return function(_0x464330){if(_0x464330){return _0x464330[_0xec07('0x25')](_0x2ec0be)[_0xec07('0x26')](function(_0x38c7ae){return _0x38c7ae;});}return null;};}function removeEntity(_0x3d6fa3,_0x1e6bed){return function(_0xa9a143){if(_0xa9a143){return _0xa9a143[_0xec07('0x27')]()[_0xec07('0x26')](function(){var _0x57f0f1=_0xa9a143[_0xec07('0x28')]({'plain':!![]});var _0x8cb18e=_0xec07('0x29');return db[_0xec07('0x2a')][_0xec07('0x27')]({'where':{'type':_0x8cb18e,'resourceId':_0x57f0f1['id']}})['then'](function(){return _0xa9a143;});})[_0xec07('0x26')](function(){_0x3d6fa3[_0xec07('0x1b')](0xcc)[_0xec07('0x1c')]();});}};}function handleEntityNotFound(_0x113e94,_0x1cc9fe){return function(_0x38c3b8){if(!_0x38c3b8){_0x113e94[_0xec07('0x2b')](0x194);}return _0x38c3b8;};}function handleError(_0xd4b70b,_0x206311){_0x206311=_0x206311||0x1f4;return function(_0x5e1abe){logger['error'](_0x5e1abe[_0xec07('0x2c')]);if(_0x5e1abe[_0xec07('0x2d')]){delete _0x5e1abe[_0xec07('0x2d')];}_0xd4b70b[_0xec07('0x1b')](_0x206311)[_0xec07('0x2e')](_0x5e1abe);};}exports[_0xec07('0x2f')]=function(_0x1ee55f,_0xc63351){var _0x1d292b={},_0x4a48c0={},_0x41b1b2={'count':0x0,'rows':[]};var _0x545f80=_[_0xec07('0x30')](db['Interval']['rawAttributes'],function(_0x2c2f27){return{'name':_0x2c2f27[_0xec07('0x31')],'type':_0x2c2f27[_0xec07('0x32')]['key']};});_0x4a48c0[_0xec07('0x33')]=_[_0xec07('0x30')](_0x545f80,_0xec07('0x2d'));_0x4a48c0['query']=_[_0xec07('0x34')](_0x1ee55f[_0xec07('0x35')]);_0x4a48c0[_0xec07('0x36')]=_[_0xec07('0x37')](_0x4a48c0[_0xec07('0x33')],_0x4a48c0[_0xec07('0x35')]);_0x1d292b['attributes']=_['intersection'](_0x4a48c0[_0xec07('0x33')],qs['fields'](_0x1ee55f[_0xec07('0x35')][_0xec07('0x38')]));_0x1d292b[_0xec07('0x39')]=_0x1d292b[_0xec07('0x39')]['length']?_0x1d292b[_0xec07('0x39')]:_0x4a48c0['model'];if(!_0x1ee55f['query'][_0xec07('0x3a')](_0xec07('0x3b'))){_0x1d292b[_0xec07('0x20')]=qs[_0xec07('0x20')](_0x1ee55f['query']['limit']);_0x1d292b[_0xec07('0x1e')]=qs[_0xec07('0x1e')](_0x1ee55f[_0xec07('0x35')][_0xec07('0x1e')]);}_0x1d292b['order']=qs[_0xec07('0x3c')](_0x1ee55f[_0xec07('0x35')][_0xec07('0x3c')]);_0x1d292b[_0xec07('0x3d')]=qs[_0xec07('0x36')](_['pick'](_0x1ee55f[_0xec07('0x35')],_0x4a48c0[_0xec07('0x36')]),_0x545f80);if(_0x1ee55f['query']['filter']){_0x1d292b[_0xec07('0x3d')]=_[_0xec07('0x3e')](_0x1d292b[_0xec07('0x3d')],{'$or':_['map'](_0x545f80,function(_0x1de8ce){if(_0x1de8ce[_0xec07('0x32')]!==_0xec07('0x3f')){var _0x2c14b1={};_0x2c14b1[_0x1de8ce[_0xec07('0x2d')]]={'$like':'%'+_0x1ee55f[_0xec07('0x35')][_0xec07('0x40')]+'%'};return _0x2c14b1;}})});}_0x1d292b=_[_0xec07('0x3e')]({},_0x1d292b,_0x1ee55f[_0xec07('0x41')]);var _0x4cdb9e={'where':_0x1d292b[_0xec07('0x3d')]};return db['Interval'][_0xec07('0x21')](_0x4cdb9e)[_0xec07('0x26')](function(_0x586643){_0x41b1b2[_0xec07('0x21')]=_0x586643;if(_0x1ee55f['query']['includeAll']){_0x1d292b['include']=[{'all':!![]}];}return db[_0xec07('0x42')][_0xec07('0x43')](_0x1d292b);})[_0xec07('0x26')](function(_0x22d93c){_0x41b1b2[_0xec07('0x44')]=_0x22d93c;return _0x41b1b2;})[_0xec07('0x26')](respondWithFilteredResult(_0xc63351,_0x1d292b))['catch'](handleError(_0xc63351,null));};exports[_0xec07('0x45')]=function(_0x3a28ec,_0x4ce113){var _0x84d986={'raw':!![],'where':{'id':_0x3a28ec[_0xec07('0x46')]['id']}},_0x3be2ab={};_0x3be2ab[_0xec07('0x33')]=_[_0xec07('0x34')](db['Interval']['rawAttributes']);_0x3be2ab[_0xec07('0x35')]=_['keys'](_0x3a28ec['query']);_0x3be2ab[_0xec07('0x36')]=_[_0xec07('0x37')](_0x3be2ab['model'],_0x3be2ab[_0xec07('0x35')]);_0x84d986[_0xec07('0x39')]=_[_0xec07('0x37')](_0x3be2ab['model'],qs['fields'](_0x3a28ec[_0xec07('0x35')][_0xec07('0x38')]));_0x84d986[_0xec07('0x39')]=_0x84d986[_0xec07('0x39')][_0xec07('0x47')]?_0x84d986[_0xec07('0x39')]:_0x3be2ab[_0xec07('0x33')];if(_0x3a28ec[_0xec07('0x35')]['includeAll']){_0x84d986[_0xec07('0x48')]=[{'all':!![]}];}_0x84d986=_['merge']({},_0x84d986,_0x3a28ec[_0xec07('0x41')]);return db['Interval'][_0xec07('0x49')](_0x84d986)[_0xec07('0x26')](handleEntityNotFound(_0x4ce113,null))['then'](respondWithResult(_0x4ce113,null))[_0xec07('0x4a')](handleError(_0x4ce113,null));};exports[_0xec07('0x4b')]=function(_0x4ea02a,_0x2808ce){return db[_0xec07('0x42')][_0xec07('0x4b')](_0x4ea02a[_0xec07('0x4c')],{})['then'](function(_0x16707b){var _0x2df12e=_0x4ea02a['user']['get']({'plain':!![]});if(!_0x2df12e)throw new Error(_0xec07('0x4d'));if(_0x2df12e[_0xec07('0x4e')]==='user'){var _0x1e2a9b=_0x16707b[_0xec07('0x28')]({'plain':!![]});var _0x18d549=_0xec07('0x29');return db[_0xec07('0x4f')][_0xec07('0x49')]({'where':{'name':_0x18d549,'userProfileId':_0x2df12e[_0xec07('0x50')]},'raw':!![]})[_0xec07('0x26')](function(_0x4a893a){if(_0x4a893a&&_0x4a893a[_0xec07('0x51')]===0x0){return db[_0xec07('0x2a')][_0xec07('0x4b')]({'name':_0x1e2a9b['name'],'resourceId':_0x1e2a9b['id'],'type':_0x4a893a[_0xec07('0x2d')],'sectionId':_0x4a893a['id']},{})[_0xec07('0x26')](function(){return _0x16707b;});}else{return _0x16707b;}})[_0xec07('0x4a')](function(_0x4fb3f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fb3f4);throw _0x4fb3f4;});}return _0x16707b;})['then'](respondWithResult(_0x2808ce,0xc9))[_0xec07('0x4a')](handleError(_0x2808ce,null));};exports[_0xec07('0x25')]=function(_0x32d9d8,_0x3a7ecf){if(_0x32d9d8[_0xec07('0x4c')]['id']){delete _0x32d9d8[_0xec07('0x4c')]['id'];}return db[_0xec07('0x42')][_0xec07('0x49')]({'where':{'id':_0x32d9d8[_0xec07('0x46')]['id']}})[_0xec07('0x26')](handleEntityNotFound(_0x3a7ecf,null))['then'](saveUpdates(_0x32d9d8['body'],null))[_0xec07('0x26')](respondWithResult(_0x3a7ecf,null))[_0xec07('0x4a')](handleError(_0x3a7ecf,null));};exports[_0xec07('0x27')]=function(_0x2193db,_0x402635){return db['Interval']['find']({'where':{'id':_0x2193db['params']['id']}})['then'](handleEntityNotFound(_0x402635,null))[_0xec07('0x26')](removeEntity(_0x402635,null))[_0xec07('0x4a')](handleError(_0x402635,null));};exports['addInterval']=function(_0x3be561,_0xb63511,_0x136f1d){if(_0x3be561[_0xec07('0x4c')]['id']){delete _0x3be561[_0xec07('0x4c')]['id'];}return db[_0xec07('0x42')][_0xec07('0x49')]({'where':{'id':_0x3be561[_0xec07('0x46')]['id']}})['then'](handleEntityNotFound(_0xb63511,null))[_0xec07('0x26')](function(_0x4aaba1){if(_0x4aaba1){_0x3be561[_0xec07('0x4c')][_0xec07('0x52')]=_0x4aaba1['id'];return db[_0xec07('0x42')][_0xec07('0x4b')](_0x3be561[_0xec07('0x4c')]);}})[_0xec07('0x26')](respondWithResult(_0xb63511,null))[_0xec07('0x4a')](handleError(_0xb63511,null));};exports['getIntervals']=function(_0x1ad907,_0x284910,_0x1be321){var _0x54fad3={};var _0x3de768={};var _0x3d1926;var _0x5a2a4a;return db['Interval']['findOne']({'where':{'id':_0x1ad907[_0xec07('0x46')]['id']}})[_0xec07('0x26')](handleEntityNotFound(_0x284910,null))[_0xec07('0x26')](function(_0xb51fa6){if(_0xb51fa6){_0x3d1926=_0xb51fa6;_0x3de768[_0xec07('0x33')]=_['keys'](db['Interval'][_0xec07('0x53')]);_0x3de768[_0xec07('0x35')]=_[_0xec07('0x34')](_0x1ad907['query']);_0x3de768[_0xec07('0x36')]=_[_0xec07('0x37')](_0x3de768[_0xec07('0x33')],_0x3de768[_0xec07('0x35')]);_0x54fad3[_0xec07('0x39')]=_[_0xec07('0x37')](_0x3de768[_0xec07('0x33')],qs[_0xec07('0x38')](_0x1ad907[_0xec07('0x35')][_0xec07('0x38')]));_0x54fad3[_0xec07('0x39')]=_0x54fad3[_0xec07('0x39')][_0xec07('0x47')]?_0x54fad3[_0xec07('0x39')]:_0x3de768[_0xec07('0x33')];_0x54fad3[_0xec07('0x54')]=qs[_0xec07('0x3c')](_0x1ad907['query'][_0xec07('0x3c')]);_0x54fad3[_0xec07('0x3d')]=qs['filters'](_[_0xec07('0x55')](_0x1ad907[_0xec07('0x35')],_0x3de768[_0xec07('0x36')]));if(_0x1ad907[_0xec07('0x35')][_0xec07('0x40')]){_0x54fad3[_0xec07('0x3d')]=_[_0xec07('0x3e')](_0x54fad3['where'],{'$or':_[_0xec07('0x30')](_0x54fad3['attributes'],function(_0x4e3166){var _0x16baab={};_0x16baab[_0x4e3166]={'$like':'%'+_0x1ad907[_0xec07('0x35')][_0xec07('0x40')]+'%'};return _0x16baab;})});}_0x54fad3=_['merge']({},_0x54fad3,_0x1ad907[_0xec07('0x41')]);return _0x3d1926[_0xec07('0x56')](_0x54fad3);}})['then'](function(_0x41530a){if(_0x41530a){_0x5a2a4a=_0x41530a[_0xec07('0x47')];if(!_0x1ad907[_0xec07('0x35')][_0xec07('0x3a')]('nolimit')){_0x54fad3['limit']=qs['limit'](_0x1ad907[_0xec07('0x35')][_0xec07('0x20')]);_0x54fad3['offset']=qs[_0xec07('0x1e')](_0x1ad907[_0xec07('0x35')][_0xec07('0x1e')]);}return _0x3d1926['getIntervals'](_0x54fad3);}})[_0xec07('0x26')](function(_0x350a91){if(_0x350a91){return _0x350a91?{'count':_0x5a2a4a,'rows':_0x350a91}:null;}})[_0xec07('0x26')](respondWithResult(_0x284910,null))[_0xec07('0x4a')](handleError(_0x284910,null));};exports[_0xec07('0x57')]=function(_0x1868f1,_0x3345e7,_0x1d48bb){return db[_0xec07('0x42')][_0xec07('0x58')]({'where':{'id':_0x1868f1[_0xec07('0x46')]['id']}})['then'](handleEntityNotFound(_0x3345e7,null))[_0xec07('0x26')](function(_0x11d212){if(_0x11d212){return db[_0xec07('0x59')][_0xec07('0x5a')](function(_0x137080){return db['Interval'][_0xec07('0x27')]({'where':{'IntervalId':_0x1868f1[_0xec07('0x46')]['id']},'transaction':_0x137080})[_0xec07('0x26')](function(_0xbd8da){var _0x125e14=_[_0xec07('0x30')](_0x1868f1[_0xec07('0x4c')],function(_0x2920b7){delete _0x2920b7['id'];_0x2920b7['IntervalId']=_0x1868f1[_0xec07('0x46')]['id'];return _0x2920b7;});return db[_0xec07('0x42')]['bulkCreate'](_0x125e14,{'transaction':_0x137080});});})[_0xec07('0x26')](function(){return db[_0xec07('0x42')][_0xec07('0x43')]({'where':{'IntervalId':_0x1868f1[_0xec07('0x46')]['id']}});});}})[_0xec07('0x26')](respondWithResult(_0x3345e7,null))[_0xec07('0x4a')](handleError(_0x3345e7,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index d3d3b83..8274987 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 _0x7b17=['../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','interval','getIntervals','then','all','map','reduce','./interval.attributes'];(function(_0x1253cb,_0x3806eb){var _0xde7eed=function(_0x199bf9){while(--_0x199bf9){_0x1253cb['push'](_0x1253cb['shift']());}};_0xde7eed(++_0x3806eb);}(_0x7b17,0x77));var _0x77b1=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x7b17[_0x54bac5];return _0xc15971;};'use strict';var attributes=require(_0x77b1('0x0'));var extensions=require(_0x77b1('0x1'));var iftime=require(_0x77b1('0x2'))[_0x77b1('0x3')];module[_0x77b1('0x4')]=function(_0x4f4cc3){return _0x4f4cc3[_0x77b1('0x5')](_0x77b1('0x6'),attributes,{'tableName':_0x77b1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e944){extensions[_0x77b1('0x8')](_0x4f4cc3,_0x5e944);},'afterBulkCreate':function(_0x3a12f5,_0x4ad9f4,_0x2c86c6){_0x2c86c6();extensions['rewrite'](_0x4f4cc3,_0x3a12f5[0x0]);},'afterUpdate':function(_0x40ad28){extensions['rewrite'](_0x4f4cc3,_0x40ad28);},'afterDestroy':function(_0x4654b0){extensions[_0x77b1('0x8')](_0x4f4cc3,_0x4654b0);}},'instanceMethods':{'ifTime':function(_0x3ff84c=undefined,_0x266bc6=new Date()){if(typeof this[_0x77b1('0x9')]==='string'){return iftime(this['interval'],_0x3ff84c,_0x266bc6);}else{return this[_0x77b1('0xa')]()[_0x77b1('0xb')](function(_0x233ca1){return Promise[_0x77b1('0xc')](_0x233ca1[_0x77b1('0xd')](function(_0x500c34){return _0x500c34['ifTime'](_0x3ff84c,_0x266bc6);}));})[_0x77b1('0xb')](function(_0x2b8c52){return _0x2b8c52[_0x77b1('0xe')](function(_0x9fd19d,_0x307040){return _0x9fd19d||_0x307040;},![]);});}}}});}; \ No newline at end of file +var _0xebd0=['all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval','tools_intervals','rewrite','interval','string','getIntervals','then'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xebd0,0x6a));var _0x0ebd=function(_0x5d36a5,_0x61494){_0x5d36a5=_0x5d36a5-0x0;var _0x1fee3b=_0xebd0[_0x5d36a5];return _0x1fee3b;};'use strict';var attributes=require(_0x0ebd('0x0'));var extensions=require(_0x0ebd('0x1'));var iftime=require(_0x0ebd('0x2'))[_0x0ebd('0x3')];module[_0x0ebd('0x4')]=function(_0x253e3){return _0x253e3[_0x0ebd('0x5')](_0x0ebd('0x6'),attributes,{'tableName':_0x0ebd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x529ad9){extensions[_0x0ebd('0x8')](_0x253e3,_0x529ad9);},'afterBulkCreate':function(_0x1530bf,_0xdd79cc,_0x4eedd8){_0x4eedd8();extensions[_0x0ebd('0x8')](_0x253e3,_0x1530bf[0x0]);},'afterUpdate':function(_0x44acd2){extensions[_0x0ebd('0x8')](_0x253e3,_0x44acd2);},'afterDestroy':function(_0x2efdff){extensions[_0x0ebd('0x8')](_0x253e3,_0x2efdff);}},'instanceMethods':{'ifTime':function(_0x535e14=undefined,_0x4dc477=new Date()){if(typeof this[_0x0ebd('0x9')]===_0x0ebd('0xa')){return iftime(this[_0x0ebd('0x9')],_0x535e14,_0x4dc477);}else{return this[_0x0ebd('0xb')]()[_0x0ebd('0xc')](function(_0x4cac4b){return Promise[_0x0ebd('0xd')](_0x4cac4b[_0x0ebd('0xe')](function(_0x432d12){return _0x432d12[_0x0ebd('0xf')](_0x535e14,_0x4dc477);}));})[_0x0ebd('0xc')](function(_0x2655da){return _0x2655da[_0x0ebd('0x10')](function(_0x16e122,_0x2c3bbf){return _0x16e122||_0x2c3bbf;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 51abca3..12c2004 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 _0x3c2e=['lodash','util','../../mysqldb','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','where','attributes','limit','include','model','then','info','catch','error','message','ShowInterval','raw','map','stringify','all','ifTime','reduce','format','name','join','findById','IntervalIftime','intervalIds','intervals','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','resolve','isArray'];(function(_0x50f382,_0x32473c){var _0x16afda=function(_0x199898){while(--_0x199898){_0x50f382['push'](_0x50f382['shift']());}};_0x16afda(++_0x32473c);}(_0x3c2e,0x168));var _0xe3c2=function(_0x7fcd4,_0x32eba1){_0x7fcd4=_0x7fcd4-0x0;var _0xb00870=_0x3c2e[_0x7fcd4];return _0xb00870;};'use strict';var _=require(_0xe3c2('0x0'));var util=require(_0xe3c2('0x1'));var db=require(_0xe3c2('0x2'))['db'];var iftime=require('../../utils/iftime')[_0xe3c2('0x3')];var logger=require(_0xe3c2('0x4'))(_0xe3c2('0x5'));exports[_0xe3c2('0x6')]=function(_0x9d40ee){var _0xd84b85=this;return new Promise(function(_0x415613,_0x7cd9de){return db[_0xe3c2('0x7')][_0xe3c2('0x8')]({'raw':_0x9d40ee[_0xe3c2('0x9')]?_0x9d40ee[_0xe3c2('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x9d40ee[_0xe3c2('0x9')]?_0x9d40ee[_0xe3c2('0x9')][_0xe3c2('0xa')]||null:null,'attributes':_0x9d40ee[_0xe3c2('0x9')]?_0x9d40ee['options'][_0xe3c2('0xb')]||null:null,'limit':_0x9d40ee[_0xe3c2('0x9')]?_0x9d40ee['options'][_0xe3c2('0xc')]||null:null,'include':_0x9d40ee['options']?_0x9d40ee[_0xe3c2('0x9')][_0xe3c2('0xd')]?_['map'](_0x9d40ee[_0xe3c2('0x9')][_0xe3c2('0xd')],function(_0x119406){return{'model':db[_0x119406['model']],'as':_0x119406['as'],'attributes':_0x119406['attributes'],'include':_0x119406['include']?_['map'](_0x119406['include'],function(_0x4f4d39){return{'model':db[_0x4f4d39[_0xe3c2('0xe')]],'as':_0x4f4d39['as'],'attributes':_0x4f4d39[_0xe3c2('0xb')],'include':_0x4f4d39['include']?_['map'](_0x4f4d39[_0xe3c2('0xd')],function(_0x2da63e){return{'model':db[_0x2da63e[_0xe3c2('0xe')]],'as':_0x2da63e['as'],'attributes':_0x2da63e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3c2('0xf')](function(_0x5753e7){logger[_0xe3c2('0x10')](_0xe3c2('0x6'),_0x9d40ee);logger['debug']('GetInterval',_0x9d40ee,JSON['stringify'](_0x5753e7));_0x415613(_0x5753e7);})[_0xe3c2('0x11')](function(_0x2bcb0f){logger[_0xe3c2('0x12')](_0xe3c2('0x6'),_0x2bcb0f[_0xe3c2('0x13')],_0x9d40ee);_0x7cd9de(_0xd84b85[_0xe3c2('0x12')](0x1f4,_0x2bcb0f['message']));});});};exports[_0xe3c2('0x14')]=function(_0x33a2a2){var _0x6b433a=this;return new Promise(function(_0x43fa9b,_0x2a8dd2){return db['Interval']['find']({'raw':_0x33a2a2[_0xe3c2('0x9')]?_0x33a2a2[_0xe3c2('0x9')][_0xe3c2('0x15')]===undefined?!![]:![]:!![],'where':_0x33a2a2['options']?_0x33a2a2[_0xe3c2('0x9')][_0xe3c2('0xa')]||null:null,'attributes':_0x33a2a2[_0xe3c2('0x9')]?_0x33a2a2[_0xe3c2('0x9')][_0xe3c2('0xb')]||null:null,'include':_0x33a2a2['options']?_0x33a2a2[_0xe3c2('0x9')]['include']?_[_0xe3c2('0x16')](_0x33a2a2[_0xe3c2('0x9')]['include'],function(_0x4bd212){return{'model':db[_0x4bd212[_0xe3c2('0xe')]],'as':_0x4bd212['as'],'attributes':_0x4bd212['attributes'],'include':_0x4bd212[_0xe3c2('0xd')]?_[_0xe3c2('0x16')](_0x4bd212['include'],function(_0xf8fb38){return{'model':db[_0xf8fb38[_0xe3c2('0xe')]],'as':_0xf8fb38['as'],'attributes':_0xf8fb38[_0xe3c2('0xb')],'include':_0xf8fb38['include']?_['map'](_0xf8fb38[_0xe3c2('0xd')],function(_0x4339f4){return{'model':db[_0x4339f4[_0xe3c2('0xe')]],'as':_0x4339f4['as'],'attributes':_0x4339f4['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3c2('0xf')](function(_0x210325){logger[_0xe3c2('0x10')]('ShowInterval',_0x33a2a2);logger['debug'](_0xe3c2('0x14'),_0x33a2a2,JSON[_0xe3c2('0x17')](_0x210325));_0x43fa9b(_0x210325);})[_0xe3c2('0x11')](function(_0x90df66){logger[_0xe3c2('0x12')]('ShowInterval',_0x90df66[_0xe3c2('0x13')],_0x33a2a2);_0x2a8dd2(_0x6b433a[_0xe3c2('0x12')](0x1f4,_0x90df66[_0xe3c2('0x13')]));});});};function checkArrayOfIntervals(_0x2ef726,_0x27e8b6){var _0x2c527d=[];return db[_0xe3c2('0x7')][_0xe3c2('0x8')]({'where':{'id':_0x2ef726}})['then'](function(_0x593d85){_0x2c527d=_0x593d85;return Promise[_0xe3c2('0x18')](_0x2c527d[_0xe3c2('0x16')](function(_0x5490ee){return _0x5490ee[_0xe3c2('0x19')](_0x27e8b6);}));})[_0xe3c2('0xf')](function(_0x560f0c){var _0x4a6490=_0x560f0c[_0xe3c2('0x1a')](function(_0x3d02d1,_0x4023ab){return _0x3d02d1||_0x4023ab;},![]);logger[_0xe3c2('0x10')](util[_0xe3c2('0x1b')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x2c527d['map'](function(_0x226e4d){return _0x226e4d[_0xe3c2('0x1c')];})[_0xe3c2('0x1d')](',\x20'),_0x2c527d[_0xe3c2('0x16')](function(_0x392b87){return _0x392b87['id'];})[_0xe3c2('0x1d')](',\x20')));return _0x4a6490;});}function checkSingleInterval(_0xa4331c,_0x5768e0){return db['Interval'][_0xe3c2('0x1e')](_0xa4331c)[_0xe3c2('0xf')](function(_0x53cf11){if(_0x53cf11){logger[_0xe3c2('0x10')](util[_0xe3c2('0x1b')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x53cf11[_0xe3c2('0x1c')],_0x53cf11['id']));return _0x53cf11[_0xe3c2('0x19')](_0x5768e0);}});}exports[_0xe3c2('0x1f')]=function(_0x9a8bf){var _0x41ebde=_0x9a8bf[_0xe3c2('0x20')];var _0x3e48c8=Array['isArray'](_0x9a8bf[_0xe3c2('0x21')])?_0x9a8bf[_0xe3c2('0x21')]:typeof _0x9a8bf[_0xe3c2('0x21')]==='string'?[_0x9a8bf['intervals']]:[];var _0x23e7fa=_0x9a8bf['timezone']||undefined;var _0x5d6d74=![];if(_0x3e48c8[_0xe3c2('0x22')]){logger[_0xe3c2('0x10')](util[_0xe3c2('0x1b')](_0xe3c2('0x23'),_0x3e48c8[_0xe3c2('0x1d')](';\x20')));}if(_0x23e7fa){logger[_0xe3c2('0x10')](util['format']('IntervalIftime:\x20timezone\x20=\x20%s',_0x23e7fa));}logger['debug'](_0xe3c2('0x24'),_0x5d6d74);logger[_0xe3c2('0x25')](_0xe3c2('0x1f'),_0x9a8bf);return Promise[_0xe3c2('0x26')]()[_0xe3c2('0xf')](function(){if(Array[_0xe3c2('0x27')](_0x41ebde)){return checkArrayOfIntervals(_0x41ebde,_0x23e7fa);}else if(_0x41ebde){return checkSingleInterval(_0x41ebde,_0x23e7fa);}})[_0xe3c2('0xf')](function(_0x1ce223){var _0x5b522a=_0x3e48c8['reduce'](function(_0x3e412b,_0x592af0){return _0x3e412b||iftime(_0x592af0,_0x23e7fa);},![]);_0x5d6d74=_0x1ce223||_0x5b522a;return _0x5d6d74;})[_0xe3c2('0x11')](function(_0x100c0d){logger[_0xe3c2('0x12')](_0xe3c2('0x1f'),_0x9a8bf,_0x100c0d);throw this['error'](0x1f4,_0x100c0d[_0xe3c2('0x13')]);});}; \ No newline at end of file +var _0xe9f4=['timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','resolve','lodash','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','findAll','options','raw','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','ShowInterval','Interval','find','message','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime','intervalIds','isArray','intervals','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9f4,0x107));var _0x4e9f=function(_0x478446,_0x2b8654){_0x478446=_0x478446-0x0;var _0x3de39b=_0xe9f4[_0x478446];return _0x3de39b;};'use strict';var _=require(_0x4e9f('0x0'));var util=require('util');var db=require(_0x4e9f('0x1'))['db'];var iftime=require(_0x4e9f('0x2'))['iftime'];var logger=require(_0x4e9f('0x3'))(_0x4e9f('0x4'));exports[_0x4e9f('0x5')]=function(_0x1766a8){var _0x14b3da=this;return new Promise(function(_0x1cbc48,_0x58fb77){return db['Interval'][_0x4e9f('0x6')]({'raw':_0x1766a8[_0x4e9f('0x7')]?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0x8')]===undefined?!![]:![]:!![],'where':_0x1766a8['options']?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0x9')]||null:null,'attributes':_0x1766a8['options']?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xa')]||null:null,'limit':_0x1766a8[_0x4e9f('0x7')]?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xb')]||null:null,'include':_0x1766a8[_0x4e9f('0x7')]?_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xc')]?_['map'](_0x1766a8[_0x4e9f('0x7')][_0x4e9f('0xc')],function(_0x47a1cc){return{'model':db[_0x47a1cc[_0x4e9f('0xd')]],'as':_0x47a1cc['as'],'attributes':_0x47a1cc[_0x4e9f('0xa')],'include':_0x47a1cc[_0x4e9f('0xc')]?_['map'](_0x47a1cc[_0x4e9f('0xc')],function(_0x48b14f){return{'model':db[_0x48b14f[_0x4e9f('0xd')]],'as':_0x48b14f['as'],'attributes':_0x48b14f[_0x4e9f('0xa')],'include':_0x48b14f[_0x4e9f('0xc')]?_[_0x4e9f('0xe')](_0x48b14f[_0x4e9f('0xc')],function(_0x178b66){return{'model':db[_0x178b66[_0x4e9f('0xd')]],'as':_0x178b66['as'],'attributes':_0x178b66[_0x4e9f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4e9f('0xf')](function(_0x3aa941){logger[_0x4e9f('0x10')](_0x4e9f('0x5'),_0x1766a8);logger[_0x4e9f('0x11')](_0x4e9f('0x5'),_0x1766a8,JSON[_0x4e9f('0x12')](_0x3aa941));_0x1cbc48(_0x3aa941);})[_0x4e9f('0x13')](function(_0x5bf1d8){logger[_0x4e9f('0x14')]('GetInterval',_0x5bf1d8['message'],_0x1766a8);_0x58fb77(_0x14b3da[_0x4e9f('0x14')](0x1f4,_0x5bf1d8['message']));});});};exports[_0x4e9f('0x15')]=function(_0x99db3a){var _0x18f2c5=this;return new Promise(function(_0x4a6718,_0x518704){return db[_0x4e9f('0x16')][_0x4e9f('0x17')]({'raw':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a['options'][_0x4e9f('0x8')]===undefined?!![]:![]:!![],'where':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a[_0x4e9f('0x7')][_0x4e9f('0x9')]||null:null,'attributes':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a[_0x4e9f('0x7')][_0x4e9f('0xa')]||null:null,'include':_0x99db3a[_0x4e9f('0x7')]?_0x99db3a['options'][_0x4e9f('0xc')]?_[_0x4e9f('0xe')](_0x99db3a['options'][_0x4e9f('0xc')],function(_0x3277c8){return{'model':db[_0x3277c8[_0x4e9f('0xd')]],'as':_0x3277c8['as'],'attributes':_0x3277c8[_0x4e9f('0xa')],'include':_0x3277c8[_0x4e9f('0xc')]?_[_0x4e9f('0xe')](_0x3277c8[_0x4e9f('0xc')],function(_0x25802c){return{'model':db[_0x25802c[_0x4e9f('0xd')]],'as':_0x25802c['as'],'attributes':_0x25802c[_0x4e9f('0xa')],'include':_0x25802c[_0x4e9f('0xc')]?_['map'](_0x25802c[_0x4e9f('0xc')],function(_0x1384ed){return{'model':db[_0x1384ed[_0x4e9f('0xd')]],'as':_0x1384ed['as'],'attributes':_0x1384ed[_0x4e9f('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4e9f('0xf')](function(_0x38c8e1){logger[_0x4e9f('0x10')]('ShowInterval',_0x99db3a);logger[_0x4e9f('0x11')](_0x4e9f('0x15'),_0x99db3a,JSON[_0x4e9f('0x12')](_0x38c8e1));_0x4a6718(_0x38c8e1);})[_0x4e9f('0x13')](function(_0x406d21){logger[_0x4e9f('0x14')](_0x4e9f('0x15'),_0x406d21[_0x4e9f('0x18')],_0x99db3a);_0x518704(_0x18f2c5['error'](0x1f4,_0x406d21[_0x4e9f('0x18')]));});});};function checkArrayOfIntervals(_0x301710,_0x2d93ca){var _0x3841d0=[];return db[_0x4e9f('0x16')][_0x4e9f('0x6')]({'where':{'id':_0x301710}})[_0x4e9f('0xf')](function(_0x18d955){_0x3841d0=_0x18d955;return Promise[_0x4e9f('0x19')](_0x3841d0['map'](function(_0x31b933){return _0x31b933[_0x4e9f('0x1a')](_0x2d93ca);}));})['then'](function(_0x4bddcf){var _0x257f15=_0x4bddcf[_0x4e9f('0x1b')](function(_0x466771,_0x2b7b74){return _0x466771||_0x2b7b74;},![]);logger[_0x4e9f('0x10')](util[_0x4e9f('0x1c')](_0x4e9f('0x1d'),_0x3841d0['map'](function(_0x24ae5d){return _0x24ae5d[_0x4e9f('0x1e')];})[_0x4e9f('0x1f')](',\x20'),_0x3841d0[_0x4e9f('0xe')](function(_0x40bb79){return _0x40bb79['id'];})[_0x4e9f('0x1f')](',\x20')));return _0x257f15;});}function checkSingleInterval(_0x42e652,_0x50fc6d){return db[_0x4e9f('0x16')][_0x4e9f('0x20')](_0x42e652)['then'](function(_0x442b11){if(_0x442b11){logger['info'](util[_0x4e9f('0x1c')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x442b11[_0x4e9f('0x1e')],_0x442b11['id']));return _0x442b11['ifTime'](_0x50fc6d);}});}exports[_0x4e9f('0x21')]=function(_0x3aca93){var _0x196117=_0x3aca93[_0x4e9f('0x22')];var _0xb0547a=Array[_0x4e9f('0x23')](_0x3aca93[_0x4e9f('0x24')])?_0x3aca93[_0x4e9f('0x24')]:typeof _0x3aca93['intervals']===_0x4e9f('0x25')?[_0x3aca93[_0x4e9f('0x24')]]:[];var _0x20a9b9=_0x3aca93[_0x4e9f('0x26')]||undefined;var _0x2981ce=![];if(_0xb0547a['length']){logger[_0x4e9f('0x10')](util[_0x4e9f('0x1c')](_0x4e9f('0x27'),_0xb0547a[_0x4e9f('0x1f')](';\x20')));}if(_0x20a9b9){logger[_0x4e9f('0x10')](util[_0x4e9f('0x1c')](_0x4e9f('0x28'),_0x20a9b9));}logger['debug'](_0x4e9f('0x29'),_0x2981ce);logger['silly']('IntervalIftime',_0x3aca93);return Promise[_0x4e9f('0x2a')]()[_0x4e9f('0xf')](function(){if(Array[_0x4e9f('0x23')](_0x196117)){return checkArrayOfIntervals(_0x196117,_0x20a9b9);}else if(_0x196117){return checkSingleInterval(_0x196117,_0x20a9b9);}})[_0x4e9f('0xf')](function(_0xae13d){var _0x844811=_0xb0547a[_0x4e9f('0x1b')](function(_0x7e6609,_0x5569e2){return _0x7e6609||iftime(_0x5569e2,_0x20a9b9);},![]);_0x2981ce=_0xae13d||_0x844811;return _0x2981ce;})[_0x4e9f('0x13')](function(_0x5f4232){logger['error'](_0x4e9f('0x21'),_0x3aca93,_0x5f4232);throw this[_0x4e9f('0x14')](0x1f4,_0x5f4232[_0x4e9f('0x18')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index cdeb3bf..97beb65 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x1e1d21,_0x179d95){var _0x5b0475=function(_0x462266){while(--_0x462266){_0x1e1d21['push'](_0x1e1d21['shift']());}};_0x5b0475(++_0x179d95);}(_0x2032,0xd9));var _0x2203=function(_0x1b5894,_0x2ee5ff){_0x1b5894=_0x1b5894-0x0;var _0x40dc4b=_0x2032[_0x1b5894];return _0x40dc4b;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x5f66,0x1a0));var _0x65f6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x5f66[_0x17d9e3];return _0x14192d;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 89eb15f..0845a09 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 _0xa7c5=['parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','setEncoding','utf8','data','end','status','statusCode','json'];(function(_0x5ce4e8,_0x1b98b7){var _0x4fabe4=function(_0x3461d5){while(--_0x3461d5){_0x5ce4e8['push'](_0x5ce4e8['shift']());}};_0x4fabe4(++_0x1b98b7);}(_0xa7c5,0x65));var _0x5a7c=function(_0x28d37c,_0x49bf24){_0x28d37c=_0x28d37c-0x0;var _0x4e4767=_0xa7c5[_0x28d37c];return _0x4e4767;};'use strict';var BPromise=require(_0x5a7c('0x0'));var https=require(_0x5a7c('0x1'));var logger=require(_0x5a7c('0x2'))(_0x5a7c('0x3'));var USERNAME='support';var PASSWORD=_0x5a7c('0x4');function openIssue(_0x406f40,_0x2d0fea){var _0xe5921a={'fields':{'project':{'key':_0x406f40[_0x5a7c('0x5')]||'MOTGUI'},'summary':(_0x406f40[_0x5a7c('0x6')]||_0x5a7c('0x7'))+_0x5a7c('0x8')+_0x406f40['ip'],'description':_0x406f40[_0x5a7c('0x9')]||JSON[_0x5a7c('0xa')](_0x406f40),'issuetype':{'name':_0x406f40[_0x5a7c('0xb')]||_0x5a7c('0xc')}}};_0xe5921a[_0x5a7c('0xd')]['customfield_11500']=_0x406f40[_0x5a7c('0xe')];_0xe5921a[_0x5a7c('0xd')]['customfield_11501']=_0x406f40[_0x5a7c('0xf')];_0xe5921a[_0x5a7c('0xd')][_0x5a7c('0x10')]=_0x406f40[_0x5a7c('0x11')];_0xe5921a[_0x5a7c('0xd')][_0x5a7c('0x12')]=_0x406f40[_0x5a7c('0x13')];_0xe5921a[_0x5a7c('0xd')]['customfield_11504']=_0x406f40[_0x5a7c('0x14')];_0xe5921a['fields'][_0x5a7c('0x15')]=_0x406f40['ip'];var _0xbb8b8f={'host':_0x5a7c('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x5a7c('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x5a7c('0x18'),'Authorization':_0x5a7c('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x5a7c('0x1a')]('base64')}};var _0xe5a2e8=JSON[_0x5a7c('0xa')](_0xe5921a);var _0x52a2c8=https['request'](_0xbb8b8f,function(_0x202695){_0x202695[_0x5a7c('0x1b')](_0x5a7c('0x1c'));var _0x2eba31='';_0x202695['on'](_0x5a7c('0x1d'),function(_0x3e8a82){_0x2eba31+=_0x3e8a82;});_0x202695['on'](_0x5a7c('0x1e'),function(){if(_0x2d0fea){return _0x2d0fea[_0x5a7c('0x1f')](_0x202695[_0x5a7c('0x20')])[_0x5a7c('0x21')](JSON[_0x5a7c('0x22')](_0x2eba31));}});});_0x52a2c8['on']('error',function(_0xb7289a){if(_0x2d0fea){return _0x2d0fea[_0x5a7c('0x1f')](0x1f4)[_0x5a7c('0x21')]({'errors':[{'message':_0x5a7c('0x23'),'type':_0x5a7c('0x24')}]});}});_0x52a2c8[_0x5a7c('0x25')](_0xe5a2e8);_0x52a2c8[_0x5a7c('0x1e')]();}exports[_0x5a7c('0x26')]=openIssue;exports[_0x5a7c('0x27')]=function(_0x471c21,_0x2be752){_0x471c21[_0x5a7c('0x28')]['ip']=_0x471c21['headers'][_0x5a7c('0x29')]||_0x471c21['connection'][_0x5a7c('0x2a')]||_0x471c21[_0x5a7c('0x2b')][_0x5a7c('0x2a')]||_0x471c21[_0x5a7c('0x2c')][_0x5a7c('0x2b')][_0x5a7c('0x2a')];return openIssue(_0x471c21[_0x5a7c('0x28')],_0x2be752);}; \ No newline at end of file +var _0xb7a0=['socket','connection','https','../../config/logger','api','support','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11502','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','request','setEncoding','utf8','data','end','status','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','x-forwarded-for','remoteAddress'];(function(_0x14e9e9,_0x42ba7c){var _0x426c1a=function(_0x244aa){while(--_0x244aa){_0x14e9e9['push'](_0x14e9e9['shift']());}};_0x426c1a(++_0x42ba7c);}(_0xb7a0,0x7a));var _0x0b7a=function(_0x23600e,_0x3742e4){_0x23600e=_0x23600e-0x0;var _0x5794d9=_0xb7a0[_0x23600e];return _0x5794d9;};'use strict';var BPromise=require('bluebird');var https=require(_0x0b7a('0x0'));var logger=require(_0x0b7a('0x1'))(_0x0b7a('0x2'));var USERNAME=_0x0b7a('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x20e0c2,_0x1ddedb){var _0x337efb={'fields':{'project':{'key':_0x20e0c2['key']||_0x0b7a('0x4')},'summary':(_0x20e0c2['summary']||_0x0b7a('0x5'))+_0x0b7a('0x6')+_0x20e0c2['ip'],'description':_0x20e0c2[_0x0b7a('0x7')]||JSON[_0x0b7a('0x8')](_0x20e0c2),'issuetype':{'name':_0x20e0c2[_0x0b7a('0x9')]||'Bug'}}};_0x337efb[_0x0b7a('0xa')][_0x0b7a('0xb')]=_0x20e0c2[_0x0b7a('0xc')];_0x337efb[_0x0b7a('0xa')]['customfield_11501']=_0x20e0c2['oldToken'];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0xd')]=_0x20e0c2['newToken'];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0xe')]=_0x20e0c2[_0x0b7a('0xf')];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0x10')]=_0x20e0c2['reason'];_0x337efb[_0x0b7a('0xa')][_0x0b7a('0x11')]=_0x20e0c2['ip'];var _0x23d6fd={'host':_0x0b7a('0x12'),'port':0x1bb,'path':_0x0b7a('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x0b7a('0x14'),'Authorization':_0x0b7a('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x0b7a('0x16')]('base64')}};var _0x318e6b=JSON[_0x0b7a('0x8')](_0x337efb);var _0x3d5637=https[_0x0b7a('0x17')](_0x23d6fd,function(_0x4126ea){_0x4126ea[_0x0b7a('0x18')](_0x0b7a('0x19'));var _0x26fb70='';_0x4126ea['on'](_0x0b7a('0x1a'),function(_0x5e0d64){_0x26fb70+=_0x5e0d64;});_0x4126ea['on'](_0x0b7a('0x1b'),function(){if(_0x1ddedb){return _0x1ddedb[_0x0b7a('0x1c')](_0x4126ea['statusCode'])[_0x0b7a('0x1d')](JSON['parse'](_0x26fb70));}});});_0x3d5637['on'](_0x0b7a('0x1e'),function(_0x547c60){if(_0x1ddedb){return _0x1ddedb[_0x0b7a('0x1c')](0x1f4)[_0x0b7a('0x1d')]({'errors':[{'message':_0x0b7a('0x1f'),'type':'api.jira'}]});}});_0x3d5637[_0x0b7a('0x20')](_0x318e6b);_0x3d5637[_0x0b7a('0x1b')]();}exports[_0x0b7a('0x21')]=openIssue;exports[_0x0b7a('0x22')]=function(_0x5c94bc,_0x1026af){_0x5c94bc[_0x0b7a('0x23')]['ip']=_0x5c94bc['headers'][_0x0b7a('0x24')]||_0x5c94bc['connection'][_0x0b7a('0x25')]||_0x5c94bc[_0x0b7a('0x26')][_0x0b7a('0x25')]||_0x5c94bc[_0x0b7a('0x27')][_0x0b7a('0x26')][_0x0b7a('0x25')];return openIssue(_0x5c94bc[_0x0b7a('0x23')],_0x1026af);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 1670184..48aec41 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 _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x1e80b6,_0xcf415a){var _0x15e712=function(_0x4321fd){while(--_0x4321fd){_0x1e80b6['push'](_0x1e80b6['shift']());}};_0x15e712(++_0xcf415a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router; \ No newline at end of file +var _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0x4e92df,_0x3ed0d7){var _0x5a22ba=function(_0x489b4c){while(--_0x489b4c){_0x4e92df['push'](_0x4e92df['shift']());}};_0x5a22ba(++_0x3ed0d7);}(_0x750a,0x140));var _0xa750=function(_0x25bcb4,_0x2952c9){_0x25bcb4=_0x25bcb4-0x0;var _0x58f5fe=_0x750a[_0x25bcb4];return _0x58f5fe;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 66ac73f..c7145ec 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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7a54,0x106));var _0x47a5=function(_0x312276,_0x4f600a){_0x312276=_0x312276-0x0;var _0x900b20=_0x7a54[_0x312276];return _0x900b20;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7a54,0x106));var _0x47a5=function(_0x5f584b,_0x45e03d){_0x5f584b=_0x5f584b-0x0;var _0x5460a0=_0x7a54[_0x5f584b];return _0x5460a0;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index d371ae1..025b8cb 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 _0x5292=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','fields','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyAnswerReport'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5292,0xf7));var _0x2529=function(_0x2795dd,_0x157893){_0x2795dd=_0x2795dd-0x0;var _0x30f875=_0x5292[_0x2795dd];return _0x30f875;};'use strict';var emlformat=require(_0x2529('0x0'));var rimraf=require(_0x2529('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2529('0x2'));var rp=require('request-promise');var moment=require(_0x2529('0x3'));var BPromise=require(_0x2529('0x4'));var Mustache=require(_0x2529('0x5'));var util=require(_0x2529('0x6'));var path=require('path');var sox=require(_0x2529('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2529('0x8'));var squel=require(_0x2529('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2529('0xa'));var toCsv=require(_0x2529('0xb'));var querystring=require('querystring');var Papa=require(_0x2529('0xc'));var Redis=require(_0x2529('0xd'));var authService=require(_0x2529('0xe'));var qs=require(_0x2529('0xf'));var as=require(_0x2529('0x10'));var hardwareService=require(_0x2529('0x11'));var logger=require(_0x2529('0x12'))(_0x2529('0x13'));var utils=require('../../config/utils');var config=require(_0x2529('0x14'));var licenseUtil=require(_0x2529('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe333c9,_0x23bfaf){_0x23bfaf=_0x23bfaf||0xcc;return function(_0x149692){if(_0x149692){return _0xe333c9[_0x2529('0x16')](_0x23bfaf);}return _0xe333c9[_0x2529('0x17')](_0x23bfaf)[_0x2529('0x18')]();};}function respondWithResult(_0x3f3b40,_0x5245cf){_0x5245cf=_0x5245cf||0xc8;return function(_0x101668){if(_0x101668){return _0x3f3b40[_0x2529('0x17')](_0x5245cf)[_0x2529('0x19')](_0x101668);}};}function respondWithFilteredResult(_0x19e4bf,_0x1cc716){return function(_0x2598a1){if(_0x2598a1){var _0x1a1ccc=typeof _0x1cc716[_0x2529('0x1a')]==='undefined'&&typeof _0x1cc716[_0x2529('0x1b')]==='undefined';var _0x337720=_0x2598a1[_0x2529('0x1c')];var _0x89be58=_0x1a1ccc?0x0:_0x1cc716['offset'];var _0x5b4d0d=_0x1a1ccc?_0x2598a1[_0x2529('0x1c')]:_0x1cc716[_0x2529('0x1a')]+_0x1cc716[_0x2529('0x1b')];var _0x37204a;if(_0x5b4d0d>=_0x337720){_0x5b4d0d=_0x337720;_0x37204a=0xc8;}else{_0x37204a=0xce;}_0x19e4bf[_0x2529('0x17')](_0x37204a);return _0x19e4bf['set'](_0x2529('0x1d'),_0x89be58+'-'+_0x5b4d0d+'/'+_0x337720)[_0x2529('0x19')](_0x2598a1);}return null;};}function patchUpdates(_0x1ca15f){return function(_0xeff5a6){try{jsonpatch['apply'](_0xeff5a6,_0x1ca15f,!![]);}catch(_0x1fa873){return BPromise[_0x2529('0x1e')](_0x1fa873);}return _0xeff5a6[_0x2529('0x1f')]();};}function saveUpdates(_0x5b4760,_0x3d5d17){return function(_0x3f57da){if(_0x3f57da){return _0x3f57da[_0x2529('0x20')](_0x5b4760)[_0x2529('0x21')](function(_0x5540e4){return _0x5540e4;});}return null;};}function removeEntity(_0x2736f6,_0x2d0c6d){return function(_0x400a01){if(_0x400a01){return _0x400a01[_0x2529('0x22')]()[_0x2529('0x21')](function(){_0x2736f6[_0x2529('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5539ef,_0x856e50){return function(_0x40f42b){if(!_0x40f42b){_0x5539ef[_0x2529('0x16')](0x194);}return _0x40f42b;};}function handleError(_0x431c40,_0x24418a){_0x24418a=_0x24418a||0x1f4;return function(_0x2a8371){logger[_0x2529('0x23')](_0x2a8371[_0x2529('0x24')]);if(_0x2a8371[_0x2529('0x25')]){delete _0x2a8371[_0x2529('0x25')];}_0x431c40['status'](_0x24418a)[_0x2529('0x26')](_0x2a8371);};}exports[_0x2529('0x27')]=function(_0x4dd0fb,_0x1822ce){var _0x3c46c6={},_0x5bea2d={},_0x17bcbd={'count':0x0,'rows':[]};var _0x1d7e98=_['map'](db[_0x2529('0x28')][_0x2529('0x29')],function(_0x4a18f6){return{'name':_0x4a18f6[_0x2529('0x2a')],'type':_0x4a18f6[_0x2529('0x2b')][_0x2529('0x2c')]};});_0x5bea2d[_0x2529('0x2d')]=_[_0x2529('0x2e')](_0x1d7e98,'name');_0x5bea2d[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x4dd0fb[_0x2529('0x2f')]);_0x5bea2d[_0x2529('0x31')]=_[_0x2529('0x32')](_0x5bea2d[_0x2529('0x2d')],_0x5bea2d[_0x2529('0x2f')]);_0x3c46c6['attributes']=_['intersection'](_0x5bea2d[_0x2529('0x2d')],qs['fields'](_0x4dd0fb[_0x2529('0x2f')]['fields']));_0x3c46c6['attributes']=_0x3c46c6['attributes'][_0x2529('0x33')]?_0x3c46c6[_0x2529('0x34')]:_0x5bea2d[_0x2529('0x2d')];if(!_0x4dd0fb['query'][_0x2529('0x35')]('nolimit')){_0x3c46c6['limit']=qs['limit'](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1b')]);_0x3c46c6[_0x2529('0x1a')]=qs[_0x2529('0x1a')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x1a')]);}_0x3c46c6[_0x2529('0x36')]=qs[_0x2529('0x37')](_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x37')]);_0x3c46c6[_0x2529('0x38')]=qs[_0x2529('0x31')](_[_0x2529('0x39')](_0x4dd0fb['query'],_0x5bea2d['filters']),_0x1d7e98);if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]){_0x3c46c6['where']=_[_0x2529('0x3b')](_0x3c46c6[_0x2529('0x38')],{'$or':_[_0x2529('0x2e')](_0x1d7e98,function(_0x1b1f81){if(_0x1b1f81[_0x2529('0x2b')]!==_0x2529('0x3c')){var _0x1b8226={};_0x1b8226[_0x1b1f81['name']]={'$like':'%'+_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3a')]+'%'};return _0x1b8226;}})});}_0x3c46c6=_[_0x2529('0x3b')]({},_0x3c46c6,_0x4dd0fb['options']);var _0x1393b7={'where':_0x3c46c6[_0x2529('0x38')]};return db[_0x2529('0x28')][_0x2529('0x1c')](_0x1393b7)[_0x2529('0x21')](function(_0x33acbf){_0x17bcbd[_0x2529('0x1c')]=_0x33acbf;if(_0x4dd0fb[_0x2529('0x2f')][_0x2529('0x3d')]){_0x3c46c6['include']=[{'all':!![]}];}return db[_0x2529('0x28')][_0x2529('0x3e')](_0x3c46c6);})[_0x2529('0x21')](function(_0x3b4e47){_0x17bcbd[_0x2529('0x3f')]=_0x3b4e47;return _0x17bcbd;})[_0x2529('0x21')](respondWithFilteredResult(_0x1822ce,_0x3c46c6))[_0x2529('0x40')](handleError(_0x1822ce,null));};exports['show']=function(_0x8ced2e,_0x33a13e){var _0x3f76e8={'raw':!![],'where':{'id':_0x8ced2e[_0x2529('0x41')]['id']}},_0x2aaecb={};_0x2aaecb['model']=_[_0x2529('0x30')](db[_0x2529('0x28')][_0x2529('0x29')]);_0x2aaecb[_0x2529('0x2f')]=_[_0x2529('0x30')](_0x8ced2e[_0x2529('0x2f')]);_0x2aaecb['filters']=_['intersection'](_0x2aaecb['model'],_0x2aaecb['query']);_0x3f76e8[_0x2529('0x34')]=_['intersection'](_0x2aaecb[_0x2529('0x2d')],qs[_0x2529('0x42')](_0x8ced2e[_0x2529('0x2f')][_0x2529('0x42')]));_0x3f76e8[_0x2529('0x34')]=_0x3f76e8['attributes'][_0x2529('0x33')]?_0x3f76e8['attributes']:_0x2aaecb[_0x2529('0x2d')];if(_0x8ced2e['query'][_0x2529('0x3d')]){_0x3f76e8['include']=[{'all':!![]}];}_0x3f76e8=_[_0x2529('0x3b')]({},_0x3f76e8,_0x8ced2e[_0x2529('0x43')]);return db['JscriptyAnswerReport'][_0x2529('0x44')](_0x3f76e8)['then'](handleEntityNotFound(_0x33a13e,null))[_0x2529('0x21')](respondWithResult(_0x33a13e,null))[_0x2529('0x40')](handleError(_0x33a13e,null));};exports[_0x2529('0x45')]=function(_0x3c6d79,_0xdc4bef){return db[_0x2529('0x28')][_0x2529('0x45')](_0x3c6d79[_0x2529('0x46')],{})[_0x2529('0x21')](respondWithResult(_0xdc4bef,0xc9))['catch'](handleError(_0xdc4bef,null));};exports['update']=function(_0x5e72d1,_0x37a23a){if(_0x5e72d1[_0x2529('0x46')]['id']){delete _0x5e72d1[_0x2529('0x46')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x5e72d1[_0x2529('0x41')]['id']}})['then'](handleEntityNotFound(_0x37a23a,null))[_0x2529('0x21')](saveUpdates(_0x5e72d1[_0x2529('0x46')],null))[_0x2529('0x21')](respondWithResult(_0x37a23a,null))[_0x2529('0x40')](handleError(_0x37a23a,null));};exports[_0x2529('0x22')]=function(_0x196ee8,_0x4583ba){return db[_0x2529('0x28')]['find']({'where':{'id':_0x196ee8['params']['id']}})[_0x2529('0x21')](handleEntityNotFound(_0x4583ba,null))[_0x2529('0x21')](removeEntity(_0x4583ba,null))[_0x2529('0x40')](handleError(_0x4583ba,null));};exports[_0x2529('0x47')]=function(_0x1f76d3,_0x3ac799){return db[_0x2529('0x28')][_0x2529('0x47')]()[_0x2529('0x21')](respondWithResult(_0x3ac799,null))[_0x2529('0x40')](handleError(_0x3ac799,null));}; \ No newline at end of file +var _0x80c3=['bluebird','mustache','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','pick','filter','merge','options','where','count','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','fast-json-patch','moment'];(function(_0x3071ab,_0x574a59){var _0x2f458c=function(_0x1eb9c7){while(--_0x1eb9c7){_0x3071ab['push'](_0x3071ab['shift']());}};_0x2f458c(++_0x574a59);}(_0x80c3,0x18f));var _0x380c=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x80c3[_0x2307fa];return _0x496486;};'use strict';var emlformat=require(_0x380c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x380c('0x1'));var rp=require('request-promise');var moment=require(_0x380c('0x2'));var BPromise=require(_0x380c('0x3'));var Mustache=require(_0x380c('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x380c('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x380c('0x6'));var squel=require(_0x380c('0x7'));var crypto=require(_0x380c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x380c('0x9'));var toCsv=require(_0x380c('0x5'));var querystring=require('querystring');var Papa=require(_0x380c('0xa'));var Redis=require(_0x380c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x380c('0xc'));var as=require(_0x380c('0xd'));var hardwareService=require(_0x380c('0xe'));var logger=require('../../config/logger')(_0x380c('0xf'));var utils=require(_0x380c('0x10'));var config=require(_0x380c('0x11'));var licenseUtil=require(_0x380c('0x12'));var db=require(_0x380c('0x13'))['db'];function respondWithStatusCode(_0x475148,_0x39bd46){_0x39bd46=_0x39bd46||0xcc;return function(_0x14793b){if(_0x14793b){return _0x475148[_0x380c('0x14')](_0x39bd46);}return _0x475148[_0x380c('0x15')](_0x39bd46)['end']();};}function respondWithResult(_0x485a05,_0x12cdac){_0x12cdac=_0x12cdac||0xc8;return function(_0x5b59af){if(_0x5b59af){return _0x485a05[_0x380c('0x15')](_0x12cdac)[_0x380c('0x16')](_0x5b59af);}};}function respondWithFilteredResult(_0x8add18,_0x1aa44b){return function(_0x3704b3){if(_0x3704b3){var _0x1b902d=typeof _0x1aa44b[_0x380c('0x17')]===_0x380c('0x18')&&typeof _0x1aa44b[_0x380c('0x19')]==='undefined';var _0x31edee=_0x3704b3['count'];var _0x5b2c5c=_0x1b902d?0x0:_0x1aa44b[_0x380c('0x17')];var _0x4fa7a1=_0x1b902d?_0x3704b3['count']:_0x1aa44b['offset']+_0x1aa44b['limit'];var _0x14443e;if(_0x4fa7a1>=_0x31edee){_0x4fa7a1=_0x31edee;_0x14443e=0xc8;}else{_0x14443e=0xce;}_0x8add18[_0x380c('0x15')](_0x14443e);return _0x8add18[_0x380c('0x1a')](_0x380c('0x1b'),_0x5b2c5c+'-'+_0x4fa7a1+'/'+_0x31edee)[_0x380c('0x16')](_0x3704b3);}return null;};}function patchUpdates(_0x4086c2){return function(_0x271e4e){try{jsonpatch[_0x380c('0x1c')](_0x271e4e,_0x4086c2,!![]);}catch(_0x16d06a){return BPromise[_0x380c('0x1d')](_0x16d06a);}return _0x271e4e[_0x380c('0x1e')]();};}function saveUpdates(_0x16b9ac,_0x374e50){return function(_0x3aeff4){if(_0x3aeff4){return _0x3aeff4[_0x380c('0x1f')](_0x16b9ac)[_0x380c('0x20')](function(_0x38427b){return _0x38427b;});}return null;};}function removeEntity(_0x286564,_0x19d0ef){return function(_0x394119){if(_0x394119){return _0x394119[_0x380c('0x21')]()['then'](function(){_0x286564[_0x380c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb2d3,_0x5cb022){return function(_0x2f2e98){if(!_0x2f2e98){_0xcb2d3['sendStatus'](0x194);}return _0x2f2e98;};}function handleError(_0x551940,_0x2456ab){_0x2456ab=_0x2456ab||0x1f4;return function(_0x290f1c){logger['error'](_0x290f1c[_0x380c('0x22')]);if(_0x290f1c[_0x380c('0x23')]){delete _0x290f1c[_0x380c('0x23')];}_0x551940[_0x380c('0x15')](_0x2456ab)[_0x380c('0x24')](_0x290f1c);};}exports[_0x380c('0x25')]=function(_0x229840,_0x5ac3c2){var _0x575010={},_0x460d35={},_0x3a32f9={'count':0x0,'rows':[]};var _0x20e3db=_[_0x380c('0x26')](db[_0x380c('0x27')]['rawAttributes'],function(_0x5a2e17){return{'name':_0x5a2e17['fieldName'],'type':_0x5a2e17[_0x380c('0x28')]['key']};});_0x460d35[_0x380c('0x29')]=_[_0x380c('0x26')](_0x20e3db,'name');_0x460d35[_0x380c('0x2a')]=_[_0x380c('0x2b')](_0x229840[_0x380c('0x2a')]);_0x460d35[_0x380c('0x2c')]=_['intersection'](_0x460d35[_0x380c('0x29')],_0x460d35[_0x380c('0x2a')]);_0x575010[_0x380c('0x2d')]=_[_0x380c('0x2e')](_0x460d35[_0x380c('0x29')],qs[_0x380c('0x2f')](_0x229840[_0x380c('0x2a')][_0x380c('0x2f')]));_0x575010['attributes']=_0x575010['attributes']['length']?_0x575010[_0x380c('0x2d')]:_0x460d35['model'];if(!_0x229840[_0x380c('0x2a')]['hasOwnProperty'](_0x380c('0x30'))){_0x575010[_0x380c('0x19')]=qs[_0x380c('0x19')](_0x229840['query'][_0x380c('0x19')]);_0x575010[_0x380c('0x17')]=qs[_0x380c('0x17')](_0x229840[_0x380c('0x2a')]['offset']);}_0x575010[_0x380c('0x31')]=qs['sort'](_0x229840[_0x380c('0x2a')]['sort']);_0x575010['where']=qs[_0x380c('0x2c')](_[_0x380c('0x32')](_0x229840[_0x380c('0x2a')],_0x460d35[_0x380c('0x2c')]),_0x20e3db);if(_0x229840[_0x380c('0x2a')][_0x380c('0x33')]){_0x575010['where']=_[_0x380c('0x34')](_0x575010['where'],{'$or':_[_0x380c('0x26')](_0x20e3db,function(_0x1b5769){if(_0x1b5769[_0x380c('0x28')]!=='VIRTUAL'){var _0x306c61={};_0x306c61[_0x1b5769[_0x380c('0x23')]]={'$like':'%'+_0x229840[_0x380c('0x2a')][_0x380c('0x33')]+'%'};return _0x306c61;}})});}_0x575010=_['merge']({},_0x575010,_0x229840[_0x380c('0x35')]);var _0x561772={'where':_0x575010[_0x380c('0x36')]};return db['JscriptyAnswerReport'][_0x380c('0x37')](_0x561772)[_0x380c('0x20')](function(_0x1c30bf){_0x3a32f9[_0x380c('0x37')]=_0x1c30bf;if(_0x229840['query'][_0x380c('0x38')]){_0x575010[_0x380c('0x39')]=[{'all':!![]}];}return db[_0x380c('0x27')][_0x380c('0x3a')](_0x575010);})['then'](function(_0x1b06ac){_0x3a32f9[_0x380c('0x3b')]=_0x1b06ac;return _0x3a32f9;})[_0x380c('0x20')](respondWithFilteredResult(_0x5ac3c2,_0x575010))[_0x380c('0x3c')](handleError(_0x5ac3c2,null));};exports['show']=function(_0x2ea3c4,_0x4019fe){var _0x39cbdb={'raw':!![],'where':{'id':_0x2ea3c4[_0x380c('0x3d')]['id']}},_0x2eac8d={};_0x2eac8d[_0x380c('0x29')]=_[_0x380c('0x2b')](db['JscriptyAnswerReport']['rawAttributes']);_0x2eac8d[_0x380c('0x2a')]=_['keys'](_0x2ea3c4[_0x380c('0x2a')]);_0x2eac8d[_0x380c('0x2c')]=_[_0x380c('0x2e')](_0x2eac8d['model'],_0x2eac8d['query']);_0x39cbdb['attributes']=_[_0x380c('0x2e')](_0x2eac8d['model'],qs[_0x380c('0x2f')](_0x2ea3c4[_0x380c('0x2a')]['fields']));_0x39cbdb[_0x380c('0x2d')]=_0x39cbdb[_0x380c('0x2d')][_0x380c('0x3e')]?_0x39cbdb[_0x380c('0x2d')]:_0x2eac8d['model'];if(_0x2ea3c4[_0x380c('0x2a')][_0x380c('0x38')]){_0x39cbdb['include']=[{'all':!![]}];}_0x39cbdb=_[_0x380c('0x34')]({},_0x39cbdb,_0x2ea3c4['options']);return db['JscriptyAnswerReport'][_0x380c('0x3f')](_0x39cbdb)[_0x380c('0x20')](handleEntityNotFound(_0x4019fe,null))[_0x380c('0x20')](respondWithResult(_0x4019fe,null))[_0x380c('0x3c')](handleError(_0x4019fe,null));};exports['create']=function(_0x6b9c8f,_0x2cf774){return db[_0x380c('0x27')][_0x380c('0x40')](_0x6b9c8f['body'],{})['then'](respondWithResult(_0x2cf774,0xc9))[_0x380c('0x3c')](handleError(_0x2cf774,null));};exports['update']=function(_0xdf44b0,_0x20c47e){if(_0xdf44b0[_0x380c('0x41')]['id']){delete _0xdf44b0[_0x380c('0x41')]['id'];}return db[_0x380c('0x27')][_0x380c('0x3f')]({'where':{'id':_0xdf44b0[_0x380c('0x3d')]['id']}})[_0x380c('0x20')](handleEntityNotFound(_0x20c47e,null))['then'](saveUpdates(_0xdf44b0[_0x380c('0x41')],null))['then'](respondWithResult(_0x20c47e,null))[_0x380c('0x3c')](handleError(_0x20c47e,null));};exports['destroy']=function(_0x5bf2dc,_0x3292cc){return db[_0x380c('0x27')]['find']({'where':{'id':_0x5bf2dc[_0x380c('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3292cc,null))[_0x380c('0x20')](removeEntity(_0x3292cc,null))[_0x380c('0x3c')](handleError(_0x3292cc,null));};exports['describe']=function(_0x4e503d,_0x5488e4){return db[_0x380c('0x27')][_0x380c('0x42')]()['then'](respondWithResult(_0x5488e4,null))[_0x380c('0x3c')](handleError(_0x5488e4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index d9af702..e2646fd 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 _0xe4e7=['define','JscriptyAnswerReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x4c8c4d,_0x170fc3){var _0x7c72d2=function(_0x249fd1){while(--_0x249fd1){_0x4c8c4d['push'](_0x4c8c4d['shift']());}};_0x7c72d2(++_0x170fc3);}(_0xe4e7,0xc2));var _0x7e4e=function(_0x4aa222,_0x103892){_0x4aa222=_0x4aa222-0x0;var _0x3e9fc0=_0xe4e7[_0x4aa222];return _0x3e9fc0;};'use strict';var _=require(_0x7e4e('0x0'));var util=require(_0x7e4e('0x1'));var logger=require(_0x7e4e('0x2'))('api');var moment=require(_0x7e4e('0x3'));var BPromise=require(_0x7e4e('0x4'));var rp=require(_0x7e4e('0x5'));var fs=require('fs');var path=require(_0x7e4e('0x6'));var rimraf=require(_0x7e4e('0x7'));var config=require(_0x7e4e('0x8'));var attributes=require(_0x7e4e('0x9'));module['exports']=function(_0x322c3d,_0xf85713){return _0x322c3d[_0x7e4e('0xa')](_0x7e4e('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77fa=['report_jscripty_answers','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x1c7fa1,_0x40a5a1){var _0x1d2765=function(_0x490e14){while(--_0x490e14){_0x1c7fa1['push'](_0x1c7fa1['shift']());}};_0x1d2765(++_0x40a5a1);}(_0x77fa,0x198));var _0xa77f=function(_0x44ab74,_0x2ab34b){_0x44ab74=_0x44ab74-0x0;var _0x5f04bb=_0x77fa[_0x44ab74];return _0x5f04bb;};'use strict';var _=require('lodash');var util=require(_0xa77f('0x0'));var logger=require(_0xa77f('0x1'))(_0xa77f('0x2'));var moment=require('moment');var BPromise=require(_0xa77f('0x3'));var rp=require(_0xa77f('0x4'));var fs=require('fs');var path=require(_0xa77f('0x5'));var rimraf=require('rimraf');var config=require(_0xa77f('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xa77f('0x7')]=function(_0x6cd630,_0x4f3a07){return _0x6cd630[_0xa77f('0x8')](_0xa77f('0x9'),attributes,{'tableName':_0xa77f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 3c550a7..ce1f821 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 _0xb39f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x7d3a7c,_0x2968e3){var _0x3edd2d=function(_0xebec05){while(--_0xebec05){_0x7d3a7c['push'](_0x7d3a7c['shift']());}};_0x3edd2d(++_0x2968e3);}(_0xb39f,0x1b5));var _0xfb39=function(_0x48dea8,_0x329bda){_0x48dea8=_0x48dea8-0x0;var _0x4bccd9=_0xb39f[_0x48dea8];return _0x4bccd9;};'use strict';var _=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var moment=require(_0xfb39('0x2'));var BPromise=require(_0xfb39('0x3'));var rs=require(_0xfb39('0x4'));var fs=require('fs');var Redis=require(_0xfb39('0x5'));var db=require(_0xfb39('0x6'))['db'];var utils=require(_0xfb39('0x7'));var logger=require(_0xfb39('0x8'))(_0xfb39('0x9'));var config=require('../../config/environment');var jayson=require(_0xfb39('0xa'));var client=jayson[_0xfb39('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c59b3,_0x45f0ea,_0x314f4b){return new BPromise(function(_0x5a3973,_0x36a1cb){return client['request'](_0x4c59b3,_0x314f4b)['then'](function(_0x3293e8){logger[_0xfb39('0xc')](_0xfb39('0xd'),_0x45f0ea,'request\x20sent');logger['debug'](_0xfb39('0xe'),_0x45f0ea,_0xfb39('0xf'),JSON[_0xfb39('0x10')](_0x3293e8));if(_0x3293e8[_0xfb39('0x11')]){if(_0x3293e8[_0xfb39('0x11')][_0xfb39('0x12')]===0x1f4){logger[_0xfb39('0x11')](_0xfb39('0xd'),_0x45f0ea,_0x3293e8[_0xfb39('0x11')]['message']);return _0x36a1cb(_0x3293e8['error'][_0xfb39('0x13')]);}logger[_0xfb39('0x11')](_0xfb39('0xd'),_0x45f0ea,_0x3293e8['error'][_0xfb39('0x13')]);return _0x5a3973(_0x3293e8[_0xfb39('0x11')][_0xfb39('0x13')]);}else{logger['info'](_0xfb39('0xd'),_0x45f0ea,'request\x20sent');_0x5a3973(_0x3293e8['result'][_0xfb39('0x13')]);}})[_0xfb39('0x14')](function(_0x16d62a){logger[_0xfb39('0x11')](_0xfb39('0xd'),_0x45f0ea,_0x16d62a);_0x36a1cb(_0x16d62a);});});} \ No newline at end of file +var _0x5280=['rpc','jayson/promise','client','request','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x4a69e9,_0x5927e2){var _0x342107=function(_0x39e16d){while(--_0x39e16d){_0x4a69e9['push'](_0x4a69e9['shift']());}};_0x342107(++_0x5927e2);}(_0x5280,0x104));var _0x0528=function(_0x2d90cc,_0x45bb4e){_0x2d90cc=_0x2d90cc-0x0;var _0x227a99=_0x5280[_0x2d90cc];return _0x227a99;};'use strict';var _=require(_0x0528('0x0'));var util=require('util');var moment=require(_0x0528('0x1'));var BPromise=require(_0x0528('0x2'));var rs=require(_0x0528('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0528('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0528('0x5'))(_0x0528('0x6'));var config=require('../../config/environment');var jayson=require(_0x0528('0x7'));var client=jayson[_0x0528('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x407601,_0x1e86ce,_0x3913f4){return new BPromise(function(_0x2c780e,_0x3c3fab){return client[_0x0528('0x9')](_0x407601,_0x3913f4)['then'](function(_0x12495a){logger['info'](_0x0528('0xa'),_0x1e86ce,_0x0528('0xb'));logger[_0x0528('0xc')](_0x0528('0xd'),_0x1e86ce,_0x0528('0xb'),JSON['stringify'](_0x12495a));if(_0x12495a['error']){if(_0x12495a[_0x0528('0xe')][_0x0528('0xf')]===0x1f4){logger[_0x0528('0xe')](_0x0528('0xa'),_0x1e86ce,_0x12495a[_0x0528('0xe')][_0x0528('0x10')]);return _0x3c3fab(_0x12495a[_0x0528('0xe')]['message']);}logger['error'](_0x0528('0xa'),_0x1e86ce,_0x12495a['error'][_0x0528('0x10')]);return _0x2c780e(_0x12495a['error']['message']);}else{logger[_0x0528('0x11')](_0x0528('0xa'),_0x1e86ce,_0x0528('0xb'));_0x2c780e(_0x12495a[_0x0528('0x12')][_0x0528('0x10')]);}})['catch'](function(_0x552056){logger[_0x0528('0xe')](_0x0528('0xa'),_0x1e86ce,_0x552056);_0x3c3fab(_0x552056);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 130783c..fa7f036 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 _0x6ccb=['isAuthenticated','show','/:id/sessions','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x31494e,_0x399c31){var _0x5145d6=function(_0x5acc71){while(--_0x5acc71){_0x31494e['push'](_0x31494e['shift']());}};_0x5145d6(++_0x399c31);}(_0x6ccb,0x1c0));var _0xb6cc=function(_0x41037f,_0x435ff5){_0x41037f=_0x41037f-0x0;var _0x22fa8e=_0x6ccb[_0x41037f];return _0x22fa8e;};'use strict';var multer=require(_0xb6cc('0x0'));var util=require('util');var path=require(_0xb6cc('0x1'));var timeout=require(_0xb6cc('0x2'));var express=require(_0xb6cc('0x3'));var router=express[_0xb6cc('0x4')]();var fs_extra=require(_0xb6cc('0x5'));var auth=require(_0xb6cc('0x6'));var interaction=require(_0xb6cc('0x7'));var config=require(_0xb6cc('0x8'));var controller=require('./jscriptyProject.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb6cc('0x9')]);router[_0xb6cc('0xa')]('/:id',auth[_0xb6cc('0xb')](),controller[_0xb6cc('0xc')]);router['get'](_0xb6cc('0xd'),auth[_0xb6cc('0xb')](),controller['getSessions']);router[_0xb6cc('0xa')]('/:id/answers',auth[_0xb6cc('0xb')](),controller['getAnswers']);router[_0xb6cc('0xa')](_0xb6cc('0xe'),auth[_0xb6cc('0xb')](),timeout(_0xb6cc('0xf')),controller[_0xb6cc('0x10')]);router[_0xb6cc('0x11')]('/',auth[_0xb6cc('0xb')](),controller[_0xb6cc('0x12')]);router['post'](_0xb6cc('0x13'),auth['isAuthenticated'](),controller[_0xb6cc('0x14')]);router[_0xb6cc('0x15')](_0xb6cc('0x16'),auth[_0xb6cc('0xb')](),controller[_0xb6cc('0x17')]);router[_0xb6cc('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xb6cc('0x19')]);module[_0xb6cc('0x1a')]=router; \ No newline at end of file +var _0x5b91=['getSummary','post','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','getAnswers','30s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5b91,0x1d3));var _0x15b9=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x5b91[_0x1196bd];return _0x26014f;};'use strict';var multer=require(_0x15b9('0x0'));var util=require(_0x15b9('0x1'));var path=require(_0x15b9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x15b9('0x3')]();var fs_extra=require(_0x15b9('0x4'));var auth=require(_0x15b9('0x5'));var interaction=require(_0x15b9('0x6'));var config=require('../../config/environment');var controller=require(_0x15b9('0x7'));router[_0x15b9('0x8')]('/',auth[_0x15b9('0x9')](),controller[_0x15b9('0xa')]);router[_0x15b9('0x8')](_0x15b9('0xb'),auth['isAuthenticated'](),controller[_0x15b9('0xc')]);router[_0x15b9('0x8')]('/:id/sessions',auth[_0x15b9('0x9')](),controller[_0x15b9('0xd')]);router[_0x15b9('0x8')]('/:id/answers',auth['isAuthenticated'](),controller[_0x15b9('0xe')]);router['get']('/:id/summary',auth[_0x15b9('0x9')](),timeout(_0x15b9('0xf')),controller[_0x15b9('0x10')]);router[_0x15b9('0x11')]('/',auth['isAuthenticated'](),controller[_0x15b9('0x12')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x15b9('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x15b9('0x14')]);router['delete']('/:id',auth[_0x15b9('0x9')](),controller[_0x15b9('0x15')]);module[_0x15b9('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 743ae38..4542745 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 _0x9836=['lodash','util','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize'];(function(_0x463143,_0x144cf9){var _0x86eb52=function(_0x538e1f){while(--_0x538e1f){_0x463143['push'](_0x463143['shift']());}};_0x86eb52(++_0x144cf9);}(_0x9836,0x1cf));var _0x6983=function(_0x2d2e0d,_0x2bf907){_0x2d2e0d=_0x2d2e0d-0x0;var _0x103367=_0x9836[_0x2d2e0d];return _0x103367;};'use strict';var Sequelize=require(_0x6983('0x0'));var _=require(_0x6983('0x1'));var util=require(_0x6983('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6983('0x3')},'description':{'type':Sequelize[_0x6983('0x4')]},'formData':{'type':Sequelize[_0x6983('0x5')](_0x6983('0x6')),'set':function(_0x4c2faf){if(_[_0x6983('0x7')](_0x4c2faf)){this[_0x6983('0x8')](_0x6983('0x9'),JSON[_0x6983('0xa')](_0x4c2faf));}else if(_[_0x6983('0xb')](_0x4c2faf)){this['setDataValue'](_0x6983('0x9'),_0x4c2faf);}else{this[_0x6983('0x8')](_0x6983('0x9'),util['format'](_0x6983('0xc'),this['getDataValue'](_0x6983('0x3'))||'',this[_0x6983('0xd')](_0x6983('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x6983('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xc712=['getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x2fc5d4,_0x514199){var _0x3b273c=function(_0x46665a){while(--_0x46665a){_0x2fc5d4['push'](_0x2fc5d4['shift']());}};_0x3b273c(++_0x514199);}(_0xc712,0x1c3));var _0x2c71=function(_0x4c3ba0,_0xdc0e0f){_0x4c3ba0=_0x4c3ba0-0x0;var _0xe09d6d=_0xc712[_0x4c3ba0];return _0xe09d6d;};'use strict';var Sequelize=require(_0x2c71('0x0'));var _=require('lodash');var util=require(_0x2c71('0x1'));module[_0x2c71('0x2')]={'name':{'type':Sequelize[_0x2c71('0x3')],'unique':_0x2c71('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x2c71('0x5')](_0x2c71('0x6')),'set':function(_0xff145d){if(_['isObjectLike'](_0xff145d)){this[_0x2c71('0x7')](_0x2c71('0x8'),JSON[_0x2c71('0x9')](_0xff145d));}else if(_[_0x2c71('0xa')](_0xff145d)){this[_0x2c71('0x7')](_0x2c71('0x8'),_0xff145d);}else{this[_0x2c71('0x7')]('formData',util[_0x2c71('0xb')](_0x2c71('0xc'),this[_0x2c71('0xd')](_0x2c71('0x4'))||'',this[_0x2c71('0xd')](_0x2c71('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x2c71('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index a0e774c..d646bcb 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 _0xaec5=['findOne','hasOwnProperty','order','ProjectId','findAll','JscriptyAnswerReport','fromCharCode','apply','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptySessionReport','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','get','Projects','UserProfileResource','name','index','map','JscriptyProject','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','autoAssociation','getSessions'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xaec5,0x92));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5aec('0x0'));var rimraf=require(_0x5aec('0x1'));var zipdir=require(_0x5aec('0x2'));var jsonpatch=require(_0x5aec('0x3'));var rp=require(_0x5aec('0x4'));var moment=require(_0x5aec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5aec('0x6'));var util=require(_0x5aec('0x7'));var path=require(_0x5aec('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5aec('0x9'));var squel=require(_0x5aec('0xa'));var crypto=require(_0x5aec('0xb'));var jsforce=require(_0x5aec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5aec('0xd'));var querystring=require(_0x5aec('0xe'));var Papa=require('papaparse');var Redis=require(_0x5aec('0xf'));var authService=require(_0x5aec('0x10'));var qs=require(_0x5aec('0x11'));var as=require(_0x5aec('0x12'));var hardwareService=require(_0x5aec('0x13'));var logger=require(_0x5aec('0x14'))(_0x5aec('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5aec('0x16'));var db=require(_0x5aec('0x17'))['db'];function respondWithStatusCode(_0x11e7ed,_0xfd051e){_0xfd051e=_0xfd051e||0xcc;return function(_0x300ae8){if(_0x300ae8){return _0x11e7ed[_0x5aec('0x18')](_0xfd051e);}return _0x11e7ed[_0x5aec('0x19')](_0xfd051e)[_0x5aec('0x1a')]();};}function respondWithResult(_0x2ea084,_0x3e9026){_0x3e9026=_0x3e9026||0xc8;return function(_0x229950){if(_0x229950){return _0x2ea084['status'](_0x3e9026)[_0x5aec('0x1b')](_0x229950);}};}function respondWithFilteredResult(_0x4101d7,_0x526340){return function(_0x6e35b7){if(_0x6e35b7){var _0x51cc5b=typeof _0x526340[_0x5aec('0x1c')]===_0x5aec('0x1d')&&typeof _0x526340[_0x5aec('0x1e')]===_0x5aec('0x1d');var _0x589fab=_0x6e35b7[_0x5aec('0x1f')];var _0x2c32bf=_0x51cc5b?0x0:_0x526340[_0x5aec('0x1c')];var _0x4518c9=_0x51cc5b?_0x6e35b7[_0x5aec('0x1f')]:_0x526340['offset']+_0x526340[_0x5aec('0x1e')];var _0x35eacf;if(_0x4518c9>=_0x589fab){_0x4518c9=_0x589fab;_0x35eacf=0xc8;}else{_0x35eacf=0xce;}_0x4101d7['status'](_0x35eacf);return _0x4101d7[_0x5aec('0x20')]('Content-Range',_0x2c32bf+'-'+_0x4518c9+'/'+_0x589fab)[_0x5aec('0x1b')](_0x6e35b7);}return null;};}function patchUpdates(_0x24368b){return function(_0x47785f){try{jsonpatch['apply'](_0x47785f,_0x24368b,!![]);}catch(_0x45810c){return BPromise['reject'](_0x45810c);}return _0x47785f[_0x5aec('0x21')]();};}function saveUpdates(_0x5641f1,_0x1048e5){return function(_0xb95cb3){if(_0xb95cb3){return _0xb95cb3[_0x5aec('0x22')](_0x5641f1)[_0x5aec('0x23')](function(_0x54e71f){return _0x54e71f;});}return null;};}function removeEntity(_0x52a98c,_0x3da833){return function(_0x33269){if(_0x33269){return _0x33269[_0x5aec('0x24')]()['then'](function(){var _0x5aee09=_0x33269[_0x5aec('0x25')]({'plain':!![]});var _0x5c30c0=_0x5aec('0x26');return db[_0x5aec('0x27')][_0x5aec('0x24')]({'where':{'type':_0x5c30c0,'resourceId':_0x5aee09['id']}})['then'](function(){return _0x33269;});})[_0x5aec('0x23')](function(){_0x52a98c[_0x5aec('0x19')](0xcc)[_0x5aec('0x1a')]();});}};}function handleEntityNotFound(_0x804d7,_0xe7e06e){return function(_0x2fea8b){if(!_0x2fea8b){_0x804d7[_0x5aec('0x18')](0x194);}return _0x2fea8b;};}function handleError(_0x4fb6f1,_0x27563c){_0x27563c=_0x27563c||0x1f4;return function(_0x3124c4){logger['error'](_0x3124c4['stack']);if(_0x3124c4[_0x5aec('0x28')]){delete _0x3124c4[_0x5aec('0x28')];}_0x4fb6f1['status'](_0x27563c)['send'](_0x3124c4);};}exports[_0x5aec('0x29')]=function(_0x5da377,_0x5bdc6f){var _0x2c4b3e={},_0x37e76a={},_0x64f7ed={'count':0x0,'rows':[]};var _0xf74789=_[_0x5aec('0x2a')](db[_0x5aec('0x2b')][_0x5aec('0x2c')],function(_0x3a07f3){return{'name':_0x3a07f3[_0x5aec('0x2d')],'type':_0x3a07f3['type']['key']};});_0x37e76a[_0x5aec('0x2e')]=_[_0x5aec('0x2a')](_0xf74789,_0x5aec('0x28'));_0x37e76a[_0x5aec('0x2f')]=_[_0x5aec('0x30')](_0x5da377[_0x5aec('0x2f')]);_0x37e76a[_0x5aec('0x31')]=_['intersection'](_0x37e76a[_0x5aec('0x2e')],_0x37e76a[_0x5aec('0x2f')]);_0x2c4b3e['attributes']=_[_0x5aec('0x32')](_0x37e76a[_0x5aec('0x2e')],qs['fields'](_0x5da377[_0x5aec('0x2f')][_0x5aec('0x33')]));_0x2c4b3e[_0x5aec('0x34')]=_0x2c4b3e[_0x5aec('0x34')]['length']?_0x2c4b3e[_0x5aec('0x34')]:_0x37e76a['model'];if(!_0x5da377[_0x5aec('0x2f')]['hasOwnProperty'](_0x5aec('0x35'))){_0x2c4b3e[_0x5aec('0x1e')]=qs[_0x5aec('0x1e')](_0x5da377[_0x5aec('0x2f')][_0x5aec('0x1e')]);_0x2c4b3e[_0x5aec('0x1c')]=qs[_0x5aec('0x1c')](_0x5da377[_0x5aec('0x2f')][_0x5aec('0x1c')]);}_0x2c4b3e['order']=qs['sort'](_0x5da377[_0x5aec('0x2f')][_0x5aec('0x36')]);_0x2c4b3e['where']=qs[_0x5aec('0x31')](_[_0x5aec('0x37')](_0x5da377[_0x5aec('0x2f')],_0x37e76a[_0x5aec('0x31')]),_0xf74789);if(_0x5da377[_0x5aec('0x2f')]['filter']){_0x2c4b3e[_0x5aec('0x38')]=_[_0x5aec('0x39')](_0x2c4b3e[_0x5aec('0x38')],{'$or':_['map'](_0xf74789,function(_0x598927){if(_0x598927[_0x5aec('0x3a')]!==_0x5aec('0x3b')){var _0x2e0c38={};_0x2e0c38[_0x598927[_0x5aec('0x28')]]={'$like':'%'+_0x5da377['query'][_0x5aec('0x3c')]+'%'};return _0x2e0c38;}})});}_0x2c4b3e=_[_0x5aec('0x39')]({},_0x2c4b3e,_0x5da377[_0x5aec('0x3d')]);var _0x44b7ee={'where':_0x2c4b3e[_0x5aec('0x38')]};return db[_0x5aec('0x2b')]['count'](_0x44b7ee)[_0x5aec('0x23')](function(_0x23d9dc){_0x64f7ed[_0x5aec('0x1f')]=_0x23d9dc;if(_0x5da377[_0x5aec('0x2f')][_0x5aec('0x3e')]){_0x2c4b3e[_0x5aec('0x3f')]=[{'all':!![]}];}return db[_0x5aec('0x2b')]['findAll'](_0x2c4b3e);})[_0x5aec('0x23')](function(_0x4bde73){_0x64f7ed[_0x5aec('0x40')]=_0x4bde73;return _0x64f7ed;})[_0x5aec('0x23')](respondWithFilteredResult(_0x5bdc6f,_0x2c4b3e))[_0x5aec('0x41')](handleError(_0x5bdc6f,null));};exports['show']=function(_0x271afa,_0xffa56e){var _0x4367c0={'raw':![],'where':{'id':_0x271afa[_0x5aec('0x42')]['id']}},_0x4ea488={};_0x4ea488[_0x5aec('0x2e')]=_['keys'](db[_0x5aec('0x2b')][_0x5aec('0x2c')]);_0x4ea488[_0x5aec('0x2f')]=_[_0x5aec('0x30')](_0x271afa[_0x5aec('0x2f')]);_0x4ea488[_0x5aec('0x31')]=_['intersection'](_0x4ea488[_0x5aec('0x2e')],_0x4ea488['query']);_0x4367c0[_0x5aec('0x34')]=_['intersection'](_0x4ea488[_0x5aec('0x2e')],qs[_0x5aec('0x33')](_0x271afa[_0x5aec('0x2f')][_0x5aec('0x33')]));_0x4367c0[_0x5aec('0x34')]=_0x4367c0['attributes'][_0x5aec('0x43')]?_0x4367c0[_0x5aec('0x34')]:_0x4ea488['model'];if(_0x271afa[_0x5aec('0x2f')][_0x5aec('0x3e')]){_0x4367c0[_0x5aec('0x3f')]=[{'all':!![]}];}_0x4367c0=_[_0x5aec('0x39')]({},_0x4367c0,_0x271afa[_0x5aec('0x3d')]);return db[_0x5aec('0x2b')][_0x5aec('0x44')](_0x4367c0)[_0x5aec('0x23')](handleEntityNotFound(_0xffa56e,null))[_0x5aec('0x23')](respondWithResult(_0xffa56e,null))['catch'](handleError(_0xffa56e,null));};exports['create']=function(_0x2f69f2,_0x10269d){return db['JscriptyProject'][_0x5aec('0x45')](_0x2f69f2[_0x5aec('0x46')],{})[_0x5aec('0x23')](function(_0x2bc944){var _0x2b6ebe=_0x2f69f2[_0x5aec('0x47')]['get']({'plain':!![]});if(!_0x2b6ebe)throw new Error(_0x5aec('0x48'));if(_0x2b6ebe[_0x5aec('0x49')]===_0x5aec('0x47')){var _0x2d76ce=_0x2bc944[_0x5aec('0x25')]({'plain':!![]});var _0x3b0c37=_0x5aec('0x26');return db[_0x5aec('0x4a')][_0x5aec('0x44')]({'where':{'name':_0x3b0c37,'userProfileId':_0x2b6ebe[_0x5aec('0x4b')]},'raw':!![]})[_0x5aec('0x23')](function(_0xeb171c){if(_0xeb171c&&_0xeb171c['autoAssociation']===0x0){return db[_0x5aec('0x27')][_0x5aec('0x45')]({'name':_0x2d76ce[_0x5aec('0x28')],'resourceId':_0x2d76ce['id'],'type':_0xeb171c['name'],'sectionId':_0xeb171c['id']},{})['then'](function(){return _0x2bc944;});}else{return _0x2bc944;}})[_0x5aec('0x41')](function(_0x5e4071){logger[_0x5aec('0x4c')](_0x5aec('0x4d'),_0x5e4071);throw _0x5e4071;});}return _0x2bc944;})['then'](respondWithResult(_0x10269d,0xc9))['catch'](handleError(_0x10269d,null));};exports[_0x5aec('0x4e')]=function(_0x1c991f,_0x1c6537){var _0x209ade={'where':{'id':_0x1c991f[_0x5aec('0x42')]['id']}},_0x1abb60={};_0x1abb60[_0x5aec('0x2e')]=_[_0x5aec('0x30')](db['JscriptyProject'][_0x5aec('0x2c')]);_0x209ade[_0x5aec('0x34')]=_[_0x5aec('0x32')](_0x1abb60[_0x5aec('0x2e')],qs[_0x5aec('0x33')](_0x1c991f['query']['fields']));_0x209ade[_0x5aec('0x34')]=_0x209ade[_0x5aec('0x34')]['length']?_0x209ade[_0x5aec('0x34')]:_0x1abb60[_0x5aec('0x2e')];if(_0x1c991f['query'][_0x5aec('0x3e')]){_0x209ade[_0x5aec('0x3f')]=[{'all':!![]}];}_0x209ade=_[_0x5aec('0x39')]({},_0x209ade,_0x1c991f['options']);return db['JscriptyProject']['find'](_0x209ade)['then'](handleEntityNotFound(_0x1c6537,null))['then'](function(_0x49bf52){if(_0x49bf52){var _0x289af0=_0x49bf52[_0x5aec('0x25')]({'plain':!![]});_0x289af0=qs['omit'](_0x289af0,['id',_0x5aec('0x4f'),'updatedAt']);_0x1c991f['body']=_[_0x5aec('0x50')](_0x1c991f[_0x5aec('0x46')],['id','createdAt',_0x5aec('0x51')]);return db[_0x5aec('0x2b')]['create'](_[_0x5aec('0x39')](_0x289af0,_0x1c991f[_0x5aec('0x46')]),{'include':_0x1c991f[_0x5aec('0x2f')][_0x5aec('0x3e')]?[{'all':!![]}]:undefined})[_0x5aec('0x23')](function(_0x3dd518){var _0x15f52c=_0x1c991f[_0x5aec('0x47')][_0x5aec('0x25')]({'plain':!![]});if(!_0x15f52c)throw new Error(_0x5aec('0x48'));if(_0x15f52c[_0x5aec('0x49')]===_0x5aec('0x47')){var _0x2a17c2=_0x3dd518[_0x5aec('0x25')]({'plain':!![]});var _0x1bc74c='Projects';return db[_0x5aec('0x4a')][_0x5aec('0x44')]({'where':{'name':_0x1bc74c,'userProfileId':_0x15f52c[_0x5aec('0x4b')]},'raw':!![]})[_0x5aec('0x23')](function(_0x3f3dbe){if(_0x3f3dbe&&_0x3f3dbe[_0x5aec('0x52')]===0x0){return db[_0x5aec('0x27')][_0x5aec('0x45')]({'name':_0x2a17c2[_0x5aec('0x28')],'resourceId':_0x2a17c2['id'],'type':_0x3f3dbe[_0x5aec('0x28')],'sectionId':_0x3f3dbe['id']},{})[_0x5aec('0x23')](function(){return _0x3dd518;});}else{return _0x3dd518;}})[_0x5aec('0x41')](function(_0x5f4206){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f4206);throw _0x5f4206;});}return _0x3dd518;});}})['then'](respondWithResult(_0x1c6537,0xc9))[_0x5aec('0x41')](handleError(_0x1c6537,null));};exports[_0x5aec('0x22')]=function(_0x5d0795,_0x328f79){if(_0x5d0795[_0x5aec('0x46')]['id']){delete _0x5d0795[_0x5aec('0x46')]['id'];}return db[_0x5aec('0x2b')]['find']({'where':{'id':_0x5d0795[_0x5aec('0x42')]['id']}})[_0x5aec('0x23')](handleEntityNotFound(_0x328f79,null))['then'](saveUpdates(_0x5d0795[_0x5aec('0x46')],null))[_0x5aec('0x23')](respondWithResult(_0x328f79,null))[_0x5aec('0x41')](handleError(_0x328f79,null));};exports[_0x5aec('0x24')]=function(_0x505dc1,_0x580826){return db[_0x5aec('0x2b')]['find']({'where':{'id':_0x505dc1[_0x5aec('0x42')]['id']}})[_0x5aec('0x23')](handleEntityNotFound(_0x580826,null))[_0x5aec('0x23')](removeEntity(_0x580826,null))[_0x5aec('0x41')](handleError(_0x580826,null));};exports[_0x5aec('0x53')]=function(_0x42b2b7,_0x58fc5d,_0x10e9f0){var _0x1a0c5d={'raw':!![],'where':{}};var _0x2671ba={};var _0x26da0f={'count':0x0,'rows':[]};return db[_0x5aec('0x2b')][_0x5aec('0x54')]({'where':{'id':_0x42b2b7[_0x5aec('0x42')]['id']}})[_0x5aec('0x23')](handleEntityNotFound(_0x58fc5d,null))[_0x5aec('0x23')](function(_0x41795a){if(_0x41795a){_0x2671ba['model']=_[_0x5aec('0x30')](db['JscriptySessionReport'][_0x5aec('0x2c')]);_0x2671ba[_0x5aec('0x2f')]=_[_0x5aec('0x30')](_0x42b2b7['query']);_0x2671ba[_0x5aec('0x31')]=_[_0x5aec('0x32')](_0x2671ba[_0x5aec('0x2e')],_0x2671ba['query']);_0x1a0c5d[_0x5aec('0x34')]=_[_0x5aec('0x32')](_0x2671ba[_0x5aec('0x2e')],qs[_0x5aec('0x33')](_0x42b2b7[_0x5aec('0x2f')][_0x5aec('0x33')]));_0x1a0c5d[_0x5aec('0x34')]=_0x1a0c5d['attributes'][_0x5aec('0x43')]?_0x1a0c5d[_0x5aec('0x34')]:_0x2671ba[_0x5aec('0x2e')];if(!_0x42b2b7[_0x5aec('0x2f')][_0x5aec('0x55')](_0x5aec('0x35'))){_0x1a0c5d[_0x5aec('0x1e')]=qs[_0x5aec('0x1e')](_0x42b2b7[_0x5aec('0x2f')]['limit']);_0x1a0c5d['offset']=qs[_0x5aec('0x1c')](_0x42b2b7[_0x5aec('0x2f')][_0x5aec('0x1c')]);}_0x1a0c5d[_0x5aec('0x56')]=qs[_0x5aec('0x36')](_0x42b2b7[_0x5aec('0x2f')][_0x5aec('0x36')]);_0x1a0c5d[_0x5aec('0x38')]=qs[_0x5aec('0x31')](_[_0x5aec('0x37')](_0x42b2b7['query'],_0x2671ba[_0x5aec('0x31')]));_0x1a0c5d[_0x5aec('0x38')][_0x5aec('0x57')]=_0x41795a['id'];if(_0x42b2b7[_0x5aec('0x2f')][_0x5aec('0x3c')]){_0x1a0c5d[_0x5aec('0x38')]=_[_0x5aec('0x39')](_0x1a0c5d[_0x5aec('0x38')],{'$or':_[_0x5aec('0x2a')](_0x1a0c5d[_0x5aec('0x34')],function(_0x5f5c13){var _0x555730={};_0x555730[_0x5f5c13]={'$like':'%'+_0x42b2b7['query'][_0x5aec('0x3c')]+'%'};return _0x555730;})});}_0x1a0c5d=_[_0x5aec('0x39')]({},_0x1a0c5d,_0x42b2b7['options']);return db['JscriptySessionReport']['count']({'where':_0x1a0c5d[_0x5aec('0x38')]})[_0x5aec('0x23')](function(_0x2b6b20){_0x26da0f[_0x5aec('0x1f')]=_0x2b6b20;if(_0x42b2b7[_0x5aec('0x2f')][_0x5aec('0x3e')]){_0x1a0c5d['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x5aec('0x58')](_0x1a0c5d);})[_0x5aec('0x23')](function(_0x920c47){_0x26da0f[_0x5aec('0x40')]=_0x920c47;return _0x26da0f;});}})[_0x5aec('0x23')](respondWithFilteredResult(_0x58fc5d,_0x1a0c5d))['catch'](handleError(_0x58fc5d,null));};exports['getAnswers']=function(_0x470c8c,_0x491a99,_0x413fba){var _0x3443d7={'raw':!![],'where':{}};var _0x3835ca={};var _0x382b52={'count':0x0,'rows':[]};return db[_0x5aec('0x2b')]['findOne']({'where':{'id':_0x470c8c[_0x5aec('0x42')]['id']}})[_0x5aec('0x23')](handleEntityNotFound(_0x491a99,null))[_0x5aec('0x23')](function(_0x2198ed){if(_0x2198ed){_0x3835ca[_0x5aec('0x2e')]=_[_0x5aec('0x30')](db[_0x5aec('0x59')][_0x5aec('0x2c')]);_0x3835ca[_0x5aec('0x2f')]=_[_0x5aec('0x30')](_0x470c8c[_0x5aec('0x2f')]);_0x3835ca[_0x5aec('0x31')]=_[_0x5aec('0x32')](_0x3835ca[_0x5aec('0x2e')],_0x3835ca[_0x5aec('0x2f')]);_0x3443d7[_0x5aec('0x34')]=_[_0x5aec('0x32')](_0x3835ca[_0x5aec('0x2e')],qs['fields'](_0x470c8c[_0x5aec('0x2f')][_0x5aec('0x33')]));_0x3443d7['attributes']=_0x3443d7['attributes']['length']?_0x3443d7[_0x5aec('0x34')]:_0x3835ca['model'];if(!_0x470c8c['query'][_0x5aec('0x55')](_0x5aec('0x35'))){_0x3443d7[_0x5aec('0x1e')]=qs[_0x5aec('0x1e')](_0x470c8c[_0x5aec('0x2f')][_0x5aec('0x1e')]);_0x3443d7[_0x5aec('0x1c')]=qs['offset'](_0x470c8c[_0x5aec('0x2f')][_0x5aec('0x1c')]);}_0x3443d7[_0x5aec('0x56')]=qs[_0x5aec('0x36')](_0x470c8c[_0x5aec('0x2f')][_0x5aec('0x36')]);_0x3443d7[_0x5aec('0x38')]=qs[_0x5aec('0x31')](_['pick'](_0x470c8c[_0x5aec('0x2f')],_0x3835ca[_0x5aec('0x31')]));_0x3443d7[_0x5aec('0x38')][_0x5aec('0x57')]=_0x2198ed['id'];if(_0x470c8c['query'][_0x5aec('0x3c')]){_0x3443d7[_0x5aec('0x38')]=_[_0x5aec('0x39')](_0x3443d7[_0x5aec('0x38')],{'$or':_[_0x5aec('0x2a')](_0x3443d7['attributes'],function(_0x5b47f6){var _0x266563={};_0x266563[_0x5b47f6]={'$like':'%'+_0x470c8c[_0x5aec('0x2f')][_0x5aec('0x3c')]+'%'};return _0x266563;})});}_0x3443d7=_[_0x5aec('0x39')]({},_0x3443d7,_0x470c8c[_0x5aec('0x3d')]);return db[_0x5aec('0x59')][_0x5aec('0x1f')]({'where':_0x3443d7[_0x5aec('0x38')]})[_0x5aec('0x23')](function(_0x5e546d){_0x382b52[_0x5aec('0x1f')]=_0x5e546d;if(_0x470c8c[_0x5aec('0x2f')][_0x5aec('0x3e')]){_0x3443d7['include']=[{'all':!![]}];}return db[_0x5aec('0x59')]['findAll'](_0x3443d7);})[_0x5aec('0x23')](function(_0x452577){_0x382b52[_0x5aec('0x40')]=_0x452577;return _0x382b52;});}})[_0x5aec('0x23')](respondWithFilteredResult(_0x491a99,_0x3443d7))[_0x5aec('0x41')](handleError(_0x491a99,null));};function char(_0x4e722a){return'number'===typeof _0x4e722a?String[_0x5aec('0x5a')][_0x5aec('0x5b')](null,arguments):_0x4e722a;}function needsEncapsulation(_0x420e9f){return!!_0x420e9f&&(_0x420e9f[_0x5aec('0x5c')]()[_0x5aec('0x5d')](char(0xd))>=0x0||_0x420e9f[_0x5aec('0x5c')]()['indexOf'](char(0xa))>=0x0||_0x420e9f[_0x5aec('0x5c')]()[_0x5aec('0x5d')](char(0x2c))>=0x0||_0x420e9f[_0x5aec('0x5c')]()[_0x5aec('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x55463b){var _0xd2b075=char(0x22),_0x502e48='\x5c'+char(0x22),_0x5612ff=_0x55463b[_0x5aec('0x5c')]()[_0x5aec('0x5e')](new RegExp(_0xd2b075,'g'),_0x502e48);return _0xd2b075+_0x5612ff+_0xd2b075;}exports[_0x5aec('0x5f')]=function(_0x413155,_0x41d8f8,_0x356bd0){var _0x342f51,_0x2d28fe;var _0x347f92={'where':{'ProjectId':_0x413155[_0x5aec('0x42')]['id']}};if(_0x413155[_0x5aec('0x2f')]['startTime']){_0x347f92[_0x5aec('0x38')][_0x5aec('0x60')]=JSON[_0x5aec('0x61')](_0x413155[_0x5aec('0x2f')][_0x5aec('0x62')]);}return db[_0x5aec('0x63')][_0x5aec('0x58')](_0x347f92)[_0x5aec('0x23')](handleEntityNotFound(_0x41d8f8,null))[_0x5aec('0x23')](function(_0x4b4722){if(_0x4b4722){_0x342f51=_0x4b4722;return db[_0x5aec('0x64')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x342f51,'id')},'ProjectId':_0x413155[_0x5aec('0x42')]['id']},'order':_0x5aec('0x65')});}})[_0x5aec('0x23')](handleEntityNotFound(_0x41d8f8,null))[_0x5aec('0x23')](function(_0x1b437b){if(_0x1b437b){_0x2d28fe=_0x1b437b;var _0x10453f={};for(var _0x193ad0=0x0,_0x46952f=_0x2d28fe['length'];_0x193ad0<_0x46952f;_0x193ad0++){if(!_0x10453f[_0x5aec('0x55')](_0x2d28fe[_0x193ad0][_0x5aec('0x66')])){_0x10453f[_0x2d28fe[_0x193ad0][_0x5aec('0x66')]]=needsEncapsulation(_0x2d28fe[_0x193ad0][_0x5aec('0x67')])?encapsulate(_0x2d28fe[_0x193ad0][_0x5aec('0x67')]):_0x2d28fe[_0x193ad0][_0x5aec('0x67')];}}var _0x324acd=[],_0x363de6={};for(var _0xa8638c=0x0,_0x560ddb=_0x342f51['length'];_0xa8638c<_0x560ddb;_0xa8638c++){_0x363de6={'ProjectId':_0x413155['params']['id'],'SessionId':_0x342f51[_0xa8638c]['id'],'StartTime':moment(_0x342f51[_0xa8638c]['starttime'])['format'](_0x5aec('0x68'))};for(var _0x395de4=0x0,_0xe07822=_0x2d28fe[_0x5aec('0x43')];_0x395de4<_0xe07822;_0x395de4++){if(_0x2d28fe[_0x395de4]['SessionId']==_0x342f51[_0xa8638c]['id']&&_0x10453f[_0x5aec('0x55')](_0x2d28fe[_0x395de4][_0x5aec('0x66')])){_0x363de6[_0x10453f[_0x2d28fe[_0x395de4][_0x5aec('0x66')]]]=_0x2d28fe[_0x395de4][_0x5aec('0x69')];}}for(var _0x38bc70 in _0x10453f){if(!_0x363de6[_0x5aec('0x55')](_0x10453f[_0x38bc70])){_0x363de6[_0x10453f[_0x38bc70]]=null;}}_0x324acd[_0x5aec('0x6a')](_0x363de6);}return _0x324acd;}})[_0x5aec('0x23')](function(_0xbc1707){if(!_['isEmpty'](_0xbc1707)){var _0x406065=toCsv(_0xbc1707);var _0x100627=Date[_0x5aec('0x6b')]();fs[_0x5aec('0x6c')](util['format'](_0x5aec('0x6d'),_0x413155['params']['id'],_0x100627),_0x406065);_0x41d8f8[_0x5aec('0x6e')]('Content-disposition',_0x5aec('0x6f')+util['format'](_0x5aec('0x70'),_0x413155[_0x5aec('0x42')]['id'],_0x100627));_0x41d8f8[_0x5aec('0x6e')]('Content-type',_0x5aec('0x71'));return _0x41d8f8[_0x5aec('0x72')](util['format'](_0x5aec('0x6d'),_0x413155[_0x5aec('0x42')]['id'],_0x100627));}else{return _0x41d8f8[_0x5aec('0x18')](0xcc);}})[_0x5aec('0x41')](handleError(_0x41d8f8,null));}; \ No newline at end of file +var _0x4959=['autoAssociation','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','JscriptySessionReport','order','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','userProfileId'];(function(_0x5a77d1,_0x1b4a60){var _0x5a2eee=function(_0x23c6b0){while(--_0x23c6b0){_0x5a77d1['push'](_0x5a77d1['shift']());}};_0x5a2eee(++_0x1b4a60);}(_0x4959,0x9b));var _0x9495=function(_0xfd1271,_0x44ab24){_0xfd1271=_0xfd1271-0x0;var _0x5e7c29=_0x4959[_0xfd1271];return _0x5e7c29;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9495('0x0'));var jsonpatch=require(_0x9495('0x1'));var rp=require(_0x9495('0x2'));var moment=require('moment');var BPromise=require(_0x9495('0x3'));var Mustache=require(_0x9495('0x4'));var util=require(_0x9495('0x5'));var path=require(_0x9495('0x6'));var sox=require('sox');var csv=require(_0x9495('0x7'));var ejs=require(_0x9495('0x8'));var fs=require('fs');var fs_extra=require(_0x9495('0x9'));var _=require(_0x9495('0xa'));var squel=require(_0x9495('0xb'));var crypto=require(_0x9495('0xc'));var jsforce=require(_0x9495('0xd'));var deskjs=require(_0x9495('0xe'));var toCsv=require(_0x9495('0x7'));var querystring=require(_0x9495('0xf'));var Papa=require(_0x9495('0x10'));var Redis=require('ioredis');var authService=require(_0x9495('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9495('0x12'));var utils=require(_0x9495('0x13'));var config=require(_0x9495('0x14'));var licenseUtil=require(_0x9495('0x15'));var db=require(_0x9495('0x16'))['db'];function respondWithStatusCode(_0x26ba0e,_0x170d6c){_0x170d6c=_0x170d6c||0xcc;return function(_0xcb593d){if(_0xcb593d){return _0x26ba0e[_0x9495('0x17')](_0x170d6c);}return _0x26ba0e[_0x9495('0x18')](_0x170d6c)[_0x9495('0x19')]();};}function respondWithResult(_0xa2a8e5,_0x3ab519){_0x3ab519=_0x3ab519||0xc8;return function(_0xf7e975){if(_0xf7e975){return _0xa2a8e5[_0x9495('0x18')](_0x3ab519)[_0x9495('0x1a')](_0xf7e975);}};}function respondWithFilteredResult(_0x583db3,_0x436769){return function(_0x17d951){if(_0x17d951){var _0x3cf201=typeof _0x436769[_0x9495('0x1b')]===_0x9495('0x1c')&&typeof _0x436769['limit']===_0x9495('0x1c');var _0x16a07e=_0x17d951[_0x9495('0x1d')];var _0x7ca882=_0x3cf201?0x0:_0x436769[_0x9495('0x1b')];var _0x502562=_0x3cf201?_0x17d951[_0x9495('0x1d')]:_0x436769[_0x9495('0x1b')]+_0x436769['limit'];var _0x4c80ef;if(_0x502562>=_0x16a07e){_0x502562=_0x16a07e;_0x4c80ef=0xc8;}else{_0x4c80ef=0xce;}_0x583db3['status'](_0x4c80ef);return _0x583db3['set'](_0x9495('0x1e'),_0x7ca882+'-'+_0x502562+'/'+_0x16a07e)[_0x9495('0x1a')](_0x17d951);}return null;};}function patchUpdates(_0x95e617){return function(_0x1ca75b){try{jsonpatch[_0x9495('0x1f')](_0x1ca75b,_0x95e617,!![]);}catch(_0x1dc482){return BPromise[_0x9495('0x20')](_0x1dc482);}return _0x1ca75b[_0x9495('0x21')]();};}function saveUpdates(_0xe9d143,_0x4053bb){return function(_0x4acbaa){if(_0x4acbaa){return _0x4acbaa[_0x9495('0x22')](_0xe9d143)[_0x9495('0x23')](function(_0x39404c){return _0x39404c;});}return null;};}function removeEntity(_0x2fb493,_0x40d9d1){return function(_0x8fa430){if(_0x8fa430){return _0x8fa430[_0x9495('0x24')]()[_0x9495('0x23')](function(){var _0x4087d9=_0x8fa430['get']({'plain':!![]});var _0x224e5e=_0x9495('0x25');return db[_0x9495('0x26')][_0x9495('0x24')]({'where':{'type':_0x224e5e,'resourceId':_0x4087d9['id']}})[_0x9495('0x23')](function(){return _0x8fa430;});})[_0x9495('0x23')](function(){_0x2fb493[_0x9495('0x18')](0xcc)[_0x9495('0x19')]();});}};}function handleEntityNotFound(_0x535e24,_0xea3162){return function(_0x13b1b6){if(!_0x13b1b6){_0x535e24[_0x9495('0x17')](0x194);}return _0x13b1b6;};}function handleError(_0x23b5e7,_0x5ee329){_0x5ee329=_0x5ee329||0x1f4;return function(_0xbaa782){logger[_0x9495('0x27')](_0xbaa782[_0x9495('0x28')]);if(_0xbaa782['name']){delete _0xbaa782[_0x9495('0x29')];}_0x23b5e7[_0x9495('0x18')](_0x5ee329)[_0x9495('0x2a')](_0xbaa782);};}exports[_0x9495('0x2b')]=function(_0xcbfbee,_0x2fdb30){var _0x4770ed={},_0x5e2d9e={},_0x3f6df9={'count':0x0,'rows':[]};var _0x1d641b=_[_0x9495('0x2c')](db[_0x9495('0x2d')][_0x9495('0x2e')],function(_0x26b9f4){return{'name':_0x26b9f4[_0x9495('0x2f')],'type':_0x26b9f4[_0x9495('0x30')]['key']};});_0x5e2d9e[_0x9495('0x31')]=_['map'](_0x1d641b,'name');_0x5e2d9e['query']=_[_0x9495('0x32')](_0xcbfbee[_0x9495('0x33')]);_0x5e2d9e[_0x9495('0x34')]=_[_0x9495('0x35')](_0x5e2d9e[_0x9495('0x31')],_0x5e2d9e[_0x9495('0x33')]);_0x4770ed[_0x9495('0x36')]=_[_0x9495('0x35')](_0x5e2d9e[_0x9495('0x31')],qs[_0x9495('0x37')](_0xcbfbee[_0x9495('0x33')][_0x9495('0x37')]));_0x4770ed[_0x9495('0x36')]=_0x4770ed['attributes'][_0x9495('0x38')]?_0x4770ed[_0x9495('0x36')]:_0x5e2d9e[_0x9495('0x31')];if(!_0xcbfbee[_0x9495('0x33')][_0x9495('0x39')](_0x9495('0x3a'))){_0x4770ed[_0x9495('0x3b')]=qs['limit'](_0xcbfbee['query'][_0x9495('0x3b')]);_0x4770ed[_0x9495('0x1b')]=qs['offset'](_0xcbfbee[_0x9495('0x33')][_0x9495('0x1b')]);}_0x4770ed['order']=qs[_0x9495('0x3c')](_0xcbfbee[_0x9495('0x33')]['sort']);_0x4770ed[_0x9495('0x3d')]=qs[_0x9495('0x34')](_[_0x9495('0x3e')](_0xcbfbee['query'],_0x5e2d9e[_0x9495('0x34')]),_0x1d641b);if(_0xcbfbee[_0x9495('0x33')][_0x9495('0x3f')]){_0x4770ed[_0x9495('0x3d')]=_[_0x9495('0x40')](_0x4770ed[_0x9495('0x3d')],{'$or':_['map'](_0x1d641b,function(_0x4fca2b){if(_0x4fca2b[_0x9495('0x30')]!==_0x9495('0x41')){var _0x582cc8={};_0x582cc8[_0x4fca2b[_0x9495('0x29')]]={'$like':'%'+_0xcbfbee[_0x9495('0x33')][_0x9495('0x3f')]+'%'};return _0x582cc8;}})});}_0x4770ed=_[_0x9495('0x40')]({},_0x4770ed,_0xcbfbee[_0x9495('0x42')]);var _0x221451={'where':_0x4770ed[_0x9495('0x3d')]};return db[_0x9495('0x2d')]['count'](_0x221451)[_0x9495('0x23')](function(_0x2e525b){_0x3f6df9[_0x9495('0x1d')]=_0x2e525b;if(_0xcbfbee['query'][_0x9495('0x43')]){_0x4770ed[_0x9495('0x44')]=[{'all':!![]}];}return db[_0x9495('0x2d')][_0x9495('0x45')](_0x4770ed);})['then'](function(_0x3fdf94){_0x3f6df9[_0x9495('0x46')]=_0x3fdf94;return _0x3f6df9;})[_0x9495('0x23')](respondWithFilteredResult(_0x2fdb30,_0x4770ed))[_0x9495('0x47')](handleError(_0x2fdb30,null));};exports[_0x9495('0x48')]=function(_0x2c72f9,_0x2606d2){var _0x3975b8={'raw':![],'where':{'id':_0x2c72f9[_0x9495('0x49')]['id']}},_0x16ce80={};_0x16ce80['model']=_[_0x9495('0x32')](db[_0x9495('0x2d')][_0x9495('0x2e')]);_0x16ce80[_0x9495('0x33')]=_[_0x9495('0x32')](_0x2c72f9['query']);_0x16ce80[_0x9495('0x34')]=_[_0x9495('0x35')](_0x16ce80[_0x9495('0x31')],_0x16ce80[_0x9495('0x33')]);_0x3975b8[_0x9495('0x36')]=_['intersection'](_0x16ce80[_0x9495('0x31')],qs[_0x9495('0x37')](_0x2c72f9['query'][_0x9495('0x37')]));_0x3975b8[_0x9495('0x36')]=_0x3975b8['attributes']['length']?_0x3975b8['attributes']:_0x16ce80['model'];if(_0x2c72f9[_0x9495('0x33')][_0x9495('0x43')]){_0x3975b8[_0x9495('0x44')]=[{'all':!![]}];}_0x3975b8=_[_0x9495('0x40')]({},_0x3975b8,_0x2c72f9[_0x9495('0x42')]);return db[_0x9495('0x2d')][_0x9495('0x4a')](_0x3975b8)['then'](handleEntityNotFound(_0x2606d2,null))[_0x9495('0x23')](respondWithResult(_0x2606d2,null))[_0x9495('0x47')](handleError(_0x2606d2,null));};exports[_0x9495('0x4b')]=function(_0x257cd1,_0x5ec40d){return db[_0x9495('0x2d')]['create'](_0x257cd1[_0x9495('0x4c')],{})[_0x9495('0x23')](function(_0x515e4c){var _0x4f4977=_0x257cd1[_0x9495('0x4d')][_0x9495('0x4e')]({'plain':!![]});if(!_0x4f4977)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f4977[_0x9495('0x4f')]===_0x9495('0x4d')){var _0x388ddb=_0x515e4c[_0x9495('0x4e')]({'plain':!![]});var _0x513b8c='Projects';return db['UserProfileSection'][_0x9495('0x4a')]({'where':{'name':_0x513b8c,'userProfileId':_0x4f4977[_0x9495('0x50')]},'raw':!![]})[_0x9495('0x23')](function(_0x3d2acc){if(_0x3d2acc&&_0x3d2acc[_0x9495('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x388ddb[_0x9495('0x29')],'resourceId':_0x388ddb['id'],'type':_0x3d2acc['name'],'sectionId':_0x3d2acc['id']},{})[_0x9495('0x23')](function(){return _0x515e4c;});}else{return _0x515e4c;}})[_0x9495('0x47')](function(_0xaade15){logger[_0x9495('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xaade15);throw _0xaade15;});}return _0x515e4c;})[_0x9495('0x23')](respondWithResult(_0x5ec40d,0xc9))[_0x9495('0x47')](handleError(_0x5ec40d,null));};exports[_0x9495('0x52')]=function(_0x29b219,_0x3d7436){var _0x522372={'where':{'id':_0x29b219['params']['id']}},_0x4d3e4e={};_0x4d3e4e[_0x9495('0x31')]=_[_0x9495('0x32')](db['JscriptyProject']['rawAttributes']);_0x522372[_0x9495('0x36')]=_[_0x9495('0x35')](_0x4d3e4e['model'],qs['fields'](_0x29b219['query'][_0x9495('0x37')]));_0x522372[_0x9495('0x36')]=_0x522372[_0x9495('0x36')]['length']?_0x522372[_0x9495('0x36')]:_0x4d3e4e[_0x9495('0x31')];if(_0x29b219[_0x9495('0x33')]['includeAll']){_0x522372['include']=[{'all':!![]}];}_0x522372=_['merge']({},_0x522372,_0x29b219[_0x9495('0x42')]);return db[_0x9495('0x2d')]['find'](_0x522372)[_0x9495('0x23')](handleEntityNotFound(_0x3d7436,null))[_0x9495('0x23')](function(_0x1b17cf){if(_0x1b17cf){var _0x4e9173=_0x1b17cf[_0x9495('0x4e')]({'plain':!![]});_0x4e9173=qs[_0x9495('0x53')](_0x4e9173,['id',_0x9495('0x54'),_0x9495('0x55')]);_0x29b219[_0x9495('0x4c')]=_[_0x9495('0x53')](_0x29b219[_0x9495('0x4c')],['id',_0x9495('0x54'),_0x9495('0x55')]);return db[_0x9495('0x2d')][_0x9495('0x4b')](_[_0x9495('0x40')](_0x4e9173,_0x29b219[_0x9495('0x4c')]),{'include':_0x29b219[_0x9495('0x33')][_0x9495('0x43')]?[{'all':!![]}]:undefined})[_0x9495('0x23')](function(_0xaab88d){var _0x5f4a7a=_0x29b219['user'][_0x9495('0x4e')]({'plain':!![]});if(!_0x5f4a7a)throw new Error(_0x9495('0x56'));if(_0x5f4a7a[_0x9495('0x4f')]===_0x9495('0x4d')){var _0x6986c1=_0xaab88d['get']({'plain':!![]});var _0x2f0456=_0x9495('0x25');return db['UserProfileSection'][_0x9495('0x4a')]({'where':{'name':_0x2f0456,'userProfileId':_0x5f4a7a[_0x9495('0x50')]},'raw':!![]})['then'](function(_0x5d8a9b){if(_0x5d8a9b&&_0x5d8a9b['autoAssociation']===0x0){return db['UserProfileResource'][_0x9495('0x4b')]({'name':_0x6986c1[_0x9495('0x29')],'resourceId':_0x6986c1['id'],'type':_0x5d8a9b[_0x9495('0x29')],'sectionId':_0x5d8a9b['id']},{})[_0x9495('0x23')](function(){return _0xaab88d;});}else{return _0xaab88d;}})[_0x9495('0x47')](function(_0x5d5f21){logger[_0x9495('0x27')](_0x9495('0x57'),_0x5d5f21);throw _0x5d5f21;});}return _0xaab88d;});}})['then'](respondWithResult(_0x3d7436,0xc9))[_0x9495('0x47')](handleError(_0x3d7436,null));};exports[_0x9495('0x22')]=function(_0x2bbc67,_0xcc4881){if(_0x2bbc67[_0x9495('0x4c')]['id']){delete _0x2bbc67[_0x9495('0x4c')]['id'];}return db[_0x9495('0x2d')]['find']({'where':{'id':_0x2bbc67[_0x9495('0x49')]['id']}})[_0x9495('0x23')](handleEntityNotFound(_0xcc4881,null))['then'](saveUpdates(_0x2bbc67[_0x9495('0x4c')],null))[_0x9495('0x23')](respondWithResult(_0xcc4881,null))[_0x9495('0x47')](handleError(_0xcc4881,null));};exports[_0x9495('0x24')]=function(_0x2611ee,_0x4f948a){return db[_0x9495('0x2d')][_0x9495('0x4a')]({'where':{'id':_0x2611ee[_0x9495('0x49')]['id']}})[_0x9495('0x23')](handleEntityNotFound(_0x4f948a,null))[_0x9495('0x23')](removeEntity(_0x4f948a,null))[_0x9495('0x47')](handleError(_0x4f948a,null));};exports[_0x9495('0x58')]=function(_0x123291,_0x505794,_0x35d547){var _0x38ede0={'raw':!![],'where':{}};var _0x222601={};var _0x52dc69={'count':0x0,'rows':[]};return db[_0x9495('0x2d')]['findOne']({'where':{'id':_0x123291[_0x9495('0x49')]['id']}})[_0x9495('0x23')](handleEntityNotFound(_0x505794,null))['then'](function(_0x38a36d){if(_0x38a36d){_0x222601[_0x9495('0x31')]=_[_0x9495('0x32')](db[_0x9495('0x59')][_0x9495('0x2e')]);_0x222601[_0x9495('0x33')]=_[_0x9495('0x32')](_0x123291[_0x9495('0x33')]);_0x222601[_0x9495('0x34')]=_[_0x9495('0x35')](_0x222601[_0x9495('0x31')],_0x222601['query']);_0x38ede0[_0x9495('0x36')]=_['intersection'](_0x222601[_0x9495('0x31')],qs[_0x9495('0x37')](_0x123291[_0x9495('0x33')][_0x9495('0x37')]));_0x38ede0['attributes']=_0x38ede0[_0x9495('0x36')][_0x9495('0x38')]?_0x38ede0[_0x9495('0x36')]:_0x222601[_0x9495('0x31')];if(!_0x123291[_0x9495('0x33')][_0x9495('0x39')](_0x9495('0x3a'))){_0x38ede0['limit']=qs[_0x9495('0x3b')](_0x123291[_0x9495('0x33')][_0x9495('0x3b')]);_0x38ede0[_0x9495('0x1b')]=qs[_0x9495('0x1b')](_0x123291[_0x9495('0x33')][_0x9495('0x1b')]);}_0x38ede0[_0x9495('0x5a')]=qs[_0x9495('0x3c')](_0x123291[_0x9495('0x33')][_0x9495('0x3c')]);_0x38ede0['where']=qs['filters'](_[_0x9495('0x3e')](_0x123291[_0x9495('0x33')],_0x222601[_0x9495('0x34')]));_0x38ede0[_0x9495('0x3d')][_0x9495('0x5b')]=_0x38a36d['id'];if(_0x123291[_0x9495('0x33')][_0x9495('0x3f')]){_0x38ede0['where']=_[_0x9495('0x40')](_0x38ede0['where'],{'$or':_['map'](_0x38ede0[_0x9495('0x36')],function(_0x5822b1){var _0xff2d79={};_0xff2d79[_0x5822b1]={'$like':'%'+_0x123291['query'][_0x9495('0x3f')]+'%'};return _0xff2d79;})});}_0x38ede0=_[_0x9495('0x40')]({},_0x38ede0,_0x123291[_0x9495('0x42')]);return db[_0x9495('0x59')][_0x9495('0x1d')]({'where':_0x38ede0[_0x9495('0x3d')]})[_0x9495('0x23')](function(_0x5c6f70){_0x52dc69[_0x9495('0x1d')]=_0x5c6f70;if(_0x123291[_0x9495('0x33')][_0x9495('0x43')]){_0x38ede0[_0x9495('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9495('0x45')](_0x38ede0);})[_0x9495('0x23')](function(_0xd1d6dd){_0x52dc69[_0x9495('0x46')]=_0xd1d6dd;return _0x52dc69;});}})[_0x9495('0x23')](respondWithFilteredResult(_0x505794,_0x38ede0))[_0x9495('0x47')](handleError(_0x505794,null));};exports[_0x9495('0x5c')]=function(_0x511597,_0x3c0fd3,_0x39e5ce){var _0x382179={'raw':!![],'where':{}};var _0x4061d2={};var _0x4ec39e={'count':0x0,'rows':[]};return db[_0x9495('0x2d')][_0x9495('0x5d')]({'where':{'id':_0x511597['params']['id']}})[_0x9495('0x23')](handleEntityNotFound(_0x3c0fd3,null))[_0x9495('0x23')](function(_0x5116d5){if(_0x5116d5){_0x4061d2[_0x9495('0x31')]=_[_0x9495('0x32')](db[_0x9495('0x5e')][_0x9495('0x2e')]);_0x4061d2[_0x9495('0x33')]=_[_0x9495('0x32')](_0x511597[_0x9495('0x33')]);_0x4061d2[_0x9495('0x34')]=_[_0x9495('0x35')](_0x4061d2[_0x9495('0x31')],_0x4061d2[_0x9495('0x33')]);_0x382179[_0x9495('0x36')]=_[_0x9495('0x35')](_0x4061d2[_0x9495('0x31')],qs[_0x9495('0x37')](_0x511597['query'][_0x9495('0x37')]));_0x382179[_0x9495('0x36')]=_0x382179['attributes'][_0x9495('0x38')]?_0x382179[_0x9495('0x36')]:_0x4061d2[_0x9495('0x31')];if(!_0x511597['query'][_0x9495('0x39')](_0x9495('0x3a'))){_0x382179[_0x9495('0x3b')]=qs[_0x9495('0x3b')](_0x511597[_0x9495('0x33')][_0x9495('0x3b')]);_0x382179[_0x9495('0x1b')]=qs[_0x9495('0x1b')](_0x511597['query'][_0x9495('0x1b')]);}_0x382179[_0x9495('0x5a')]=qs['sort'](_0x511597[_0x9495('0x33')][_0x9495('0x3c')]);_0x382179[_0x9495('0x3d')]=qs['filters'](_[_0x9495('0x3e')](_0x511597[_0x9495('0x33')],_0x4061d2[_0x9495('0x34')]));_0x382179[_0x9495('0x3d')][_0x9495('0x5b')]=_0x5116d5['id'];if(_0x511597[_0x9495('0x33')][_0x9495('0x3f')]){_0x382179[_0x9495('0x3d')]=_[_0x9495('0x40')](_0x382179[_0x9495('0x3d')],{'$or':_[_0x9495('0x2c')](_0x382179['attributes'],function(_0x3ccca0){var _0x48ae60={};_0x48ae60[_0x3ccca0]={'$like':'%'+_0x511597['query'][_0x9495('0x3f')]+'%'};return _0x48ae60;})});}_0x382179=_['merge']({},_0x382179,_0x511597['options']);return db[_0x9495('0x5e')][_0x9495('0x1d')]({'where':_0x382179[_0x9495('0x3d')]})[_0x9495('0x23')](function(_0x5c02be){_0x4ec39e[_0x9495('0x1d')]=_0x5c02be;if(_0x511597['query'][_0x9495('0x43')]){_0x382179['include']=[{'all':!![]}];}return db[_0x9495('0x5e')][_0x9495('0x45')](_0x382179);})[_0x9495('0x23')](function(_0x2310e1){_0x4ec39e[_0x9495('0x46')]=_0x2310e1;return _0x4ec39e;});}})[_0x9495('0x23')](respondWithFilteredResult(_0x3c0fd3,_0x382179))[_0x9495('0x47')](handleError(_0x3c0fd3,null));};function char(_0xbb3e25){return _0x9495('0x5f')===typeof _0xbb3e25?String[_0x9495('0x60')][_0x9495('0x1f')](null,arguments):_0xbb3e25;}function needsEncapsulation(_0x25eb6e){return!!_0x25eb6e&&(_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0xd))>=0x0||_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0xa))>=0x0||_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0x2c))>=0x0||_0x25eb6e[_0x9495('0x61')]()[_0x9495('0x62')](char(0x22))>=0x0);}function encapsulate(_0x35758e){var _0x1470db=char(0x22),_0x3fcf93='\x5c'+char(0x22),_0x4f33e0=_0x35758e[_0x9495('0x61')]()[_0x9495('0x63')](new RegExp(_0x1470db,'g'),_0x3fcf93);return _0x1470db+_0x4f33e0+_0x1470db;}exports['getSummary']=function(_0x3f629b,_0x278eb3,_0x5d939f){var _0x240ba4,_0x512d7a;var _0x1ab41f={'where':{'ProjectId':_0x3f629b[_0x9495('0x49')]['id']}};if(_0x3f629b[_0x9495('0x33')][_0x9495('0x64')]){_0x1ab41f[_0x9495('0x3d')]['starttime']=JSON[_0x9495('0x65')](_0x3f629b[_0x9495('0x33')][_0x9495('0x64')]);}return db[_0x9495('0x59')][_0x9495('0x45')](_0x1ab41f)['then'](handleEntityNotFound(_0x278eb3,null))[_0x9495('0x23')](function(_0x36204f){if(_0x36204f){_0x240ba4=_0x36204f;return db[_0x9495('0x66')][_0x9495('0x45')]({'where':{'SessionId':{'$in':_[_0x9495('0x2c')](_0x240ba4,'id')},'ProjectId':_0x3f629b[_0x9495('0x49')]['id']},'order':_0x9495('0x67')});}})['then'](handleEntityNotFound(_0x278eb3,null))[_0x9495('0x23')](function(_0x62135b){if(_0x62135b){_0x512d7a=_0x62135b;var _0x22d786={};for(var _0x4a42c4=0x0,_0x2646a5=_0x512d7a[_0x9495('0x38')];_0x4a42c4<_0x2646a5;_0x4a42c4++){if(!_0x22d786[_0x9495('0x39')](_0x512d7a[_0x4a42c4][_0x9495('0x68')])){_0x22d786[_0x512d7a[_0x4a42c4][_0x9495('0x68')]]=needsEncapsulation(_0x512d7a[_0x4a42c4][_0x9495('0x69')])?encapsulate(_0x512d7a[_0x4a42c4][_0x9495('0x69')]):_0x512d7a[_0x4a42c4]['question'];}}var _0x62285a=[],_0x140498={};for(var _0x4bedf9=0x0,_0x55f493=_0x240ba4['length'];_0x4bedf9<_0x55f493;_0x4bedf9++){_0x140498={'ProjectId':_0x3f629b['params']['id'],'SessionId':_0x240ba4[_0x4bedf9]['id'],'StartTime':moment(_0x240ba4[_0x4bedf9]['starttime'])[_0x9495('0x6a')](_0x9495('0x6b'))};for(var _0x1a0f3a=0x0,_0x231f5f=_0x512d7a[_0x9495('0x38')];_0x1a0f3a<_0x231f5f;_0x1a0f3a++){if(_0x512d7a[_0x1a0f3a]['SessionId']==_0x240ba4[_0x4bedf9]['id']&&_0x22d786['hasOwnProperty'](_0x512d7a[_0x1a0f3a][_0x9495('0x68')])){_0x140498[_0x22d786[_0x512d7a[_0x1a0f3a][_0x9495('0x68')]]]=_0x512d7a[_0x1a0f3a]['answer'];}}for(var _0x2396f1 in _0x22d786){if(!_0x140498['hasOwnProperty'](_0x22d786[_0x2396f1])){_0x140498[_0x22d786[_0x2396f1]]=null;}}_0x62285a[_0x9495('0x6c')](_0x140498);}return _0x62285a;}})[_0x9495('0x23')](function(_0xaae89b){if(!_[_0x9495('0x6d')](_0xaae89b)){var _0x466ebd=toCsv(_0xaae89b);var _0x1733b3=Date[_0x9495('0x6e')]();fs[_0x9495('0x6f')](util['format'](_0x9495('0x70'),_0x3f629b[_0x9495('0x49')]['id'],_0x1733b3),_0x466ebd);_0x278eb3[_0x9495('0x71')](_0x9495('0x72'),_0x9495('0x73')+util[_0x9495('0x6a')](_0x9495('0x74'),_0x3f629b[_0x9495('0x49')]['id'],_0x1733b3));_0x278eb3['setHeader'](_0x9495('0x75'),'text/csv');return _0x278eb3['download'](util[_0x9495('0x6a')](_0x9495('0x70'),_0x3f629b['params']['id'],_0x1733b3));}else{return _0x278eb3[_0x9495('0x17')](0xcc);}})[_0x9495('0x47')](handleError(_0x278eb3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index d5a531a..5a715ed 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 _0x82f5=['api','moment','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','lodash','util','../../config/logger'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x82f5,0x15d));var _0x582f=function(_0x2381e5,_0x44e53c){_0x2381e5=_0x2381e5-0x0;var _0x3ca4df=_0x82f5[_0x2381e5];return _0x3ca4df;};'use strict';var _=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var logger=require(_0x582f('0x2'))(_0x582f('0x3'));var moment=require(_0x582f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x582f('0x5'));var rimraf=require(_0x582f('0x6'));var config=require(_0x582f('0x7'));var attributes=require(_0x582f('0x8'));module[_0x582f('0x9')]=function(_0x15d332,_0x459755){return _0x15d332['define'](_0x582f('0xa'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72a2=['define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0x72a2,0x161));var _0x272a=function(_0x40519e,_0x3b403d){_0x40519e=_0x40519e-0x0;var _0x4813a4=_0x72a2[_0x40519e];return _0x4813a4;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var logger=require(_0x272a('0x1'))(_0x272a('0x2'));var moment=require(_0x272a('0x3'));var BPromise=require(_0x272a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x272a('0x5'));var rimraf=require('rimraf');var config=require(_0x272a('0x6'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x4f628a,_0x2ba5db){return _0x4f628a[_0x272a('0x7')](_0x272a('0x8'),attributes,{'tableName':_0x272a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 7f23f96..fb6d66b 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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x45d640,_0x5e5d37){var _0x1a15f8=function(_0x46fd3f){while(--_0x46fd3f){_0x45d640['push'](_0x45d640['shift']());}};_0x1a15f8(++_0x5e5d37);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0xda3f,0xec));var _0xfda3=function(_0x1e7c6f,_0x3858be){_0x1e7c6f=_0x1e7c6f-0x0;var _0x1e077e=_0xda3f[_0x1e7c6f];return _0x1e077e;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 6923966..7c80d57 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 _0x5ca4=['fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x43a615,_0x20760f){var _0x5e8822=function(_0x3d5596){while(--_0x3d5596){_0x43a615['push'](_0x43a615['shift']());}};_0x5e8822(++_0x20760f);}(_0x5ca4,0x175));var _0x45ca=function(_0x11067f,_0x377fe9){_0x11067f=_0x11067f-0x0;var _0x805eb1=_0x5ca4[_0x11067f];return _0x805eb1;};'use strict';var multer=require(_0x45ca('0x0'));var util=require(_0x45ca('0x1'));var path=require(_0x45ca('0x2'));var timeout=require(_0x45ca('0x3'));var express=require(_0x45ca('0x4'));var router=express['Router']();var fs_extra=require(_0x45ca('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x45ca('0x6'));var config=require(_0x45ca('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x45ca('0x8')]('/',auth['isAuthenticated'](),controller[_0x45ca('0x9')]);router[_0x45ca('0x8')](_0x45ca('0xa'),auth[_0x45ca('0xb')](),controller['describe']);router[_0x45ca('0x8')](_0x45ca('0xc'),auth[_0x45ca('0xb')](),controller[_0x45ca('0xd')]);router[_0x45ca('0xe')]('/',auth[_0x45ca('0xb')](),controller[_0x45ca('0xf')]);router[_0x45ca('0x10')](_0x45ca('0xc'),auth['isAuthenticated'](),controller[_0x45ca('0x11')]);router[_0x45ca('0x12')](_0x45ca('0xc'),auth[_0x45ca('0xb')](),controller[_0x45ca('0x13')]);module[_0x45ca('0x14')]=router; \ No newline at end of file +var _0xc800=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index'];(function(_0xf7d613,_0x5da9d6){var _0x42278b=function(_0x4286b2){while(--_0x4286b2){_0xf7d613['push'](_0xf7d613['shift']());}};_0x42278b(++_0x5da9d6);}(_0xc800,0x183));var _0x0c80=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0xc800[_0x43fdf8];return _0x1160c6;};'use strict';var multer=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var path=require(_0x0c80('0x2'));var timeout=require(_0x0c80('0x3'));var express=require(_0x0c80('0x4'));var router=express[_0x0c80('0x5')]();var fs_extra=require(_0x0c80('0x6'));var auth=require(_0x0c80('0x7'));var interaction=require(_0x0c80('0x8'));var config=require(_0x0c80('0x9'));var controller=require(_0x0c80('0xa'));router['get']('/',auth[_0x0c80('0xb')](),controller[_0x0c80('0xc')]);router[_0x0c80('0xd')](_0x0c80('0xe'),auth[_0x0c80('0xb')](),controller[_0x0c80('0xf')]);router['get'](_0x0c80('0x10'),auth['isAuthenticated'](),controller[_0x0c80('0x11')]);router[_0x0c80('0x12')]('/',auth[_0x0c80('0xb')](),controller[_0x0c80('0x13')]);router[_0x0c80('0x14')](_0x0c80('0x10'),auth[_0x0c80('0xb')](),controller[_0x0c80('0x15')]);router[_0x0c80('0x16')](_0x0c80('0x10'),auth[_0x0c80('0xb')](),controller[_0x0c80('0x17')]);module[_0x0c80('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 8952c61..5e1edad 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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x3eccff,_0xb28ddd){_0x3eccff=_0x3eccff-0x0;var _0x1e02fe=_0x7a54[_0x3eccff];return _0x1e02fe;};'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(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x2ec1e5,_0x1d191e){_0x2ec1e5=_0x2ec1e5-0x0;var _0x2356a3=_0x7a54[_0x2ec1e5];return _0x2356a3;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 1ac2f1c..711ef4e 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 _0xaf74=['nolimit','order','sort','where','filter','options','includeAll','include','findAll','show','params','keys','merge','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','model','filters','intersection','attributes','fields','query','length','hasOwnProperty'];(function(_0xc8fedf,_0x252f3a){var _0x269088=function(_0x599564){while(--_0x599564){_0xc8fedf['push'](_0xc8fedf['shift']());}};_0x269088(++_0x252f3a);}(_0xaf74,0x166));var _0x4af7=function(_0x42d2ad,_0x2b85d1){_0x42d2ad=_0x42d2ad-0x0;var _0x33d2ba=_0xaf74[_0x42d2ad];return _0x33d2ba;};'use strict';var emlformat=require(_0x4af7('0x0'));var rimraf=require(_0x4af7('0x1'));var zipdir=require(_0x4af7('0x2'));var jsonpatch=require(_0x4af7('0x3'));var rp=require(_0x4af7('0x4'));var moment=require(_0x4af7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4af7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4af7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4af7('0x8'));var squel=require(_0x4af7('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4af7('0xa'));var toCsv=require(_0x4af7('0xb'));var querystring=require(_0x4af7('0xc'));var Papa=require('papaparse');var Redis=require(_0x4af7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4af7('0xe'));var as=require(_0x4af7('0xf'));var hardwareService=require(_0x4af7('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4af7('0x11'));var config=require(_0x4af7('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x4af7('0x13'))['db'];function respondWithStatusCode(_0xe6c464,_0x420f58){_0x420f58=_0x420f58||0xcc;return function(_0x5222ab){if(_0x5222ab){return _0xe6c464[_0x4af7('0x14')](_0x420f58);}return _0xe6c464[_0x4af7('0x15')](_0x420f58)['end']();};}function respondWithResult(_0x468fc0,_0x455178){_0x455178=_0x455178||0xc8;return function(_0x37f1c6){if(_0x37f1c6){return _0x468fc0['status'](_0x455178)['json'](_0x37f1c6);}};}function respondWithFilteredResult(_0x18305d,_0x31e9f9){return function(_0x262049){if(_0x262049){var _0x68f1f3=typeof _0x31e9f9[_0x4af7('0x16')]===_0x4af7('0x17')&&typeof _0x31e9f9[_0x4af7('0x18')]===_0x4af7('0x17');var _0x3fbdfe=_0x262049['count'];var _0x26a265=_0x68f1f3?0x0:_0x31e9f9[_0x4af7('0x16')];var _0x3b208e=_0x68f1f3?_0x262049[_0x4af7('0x19')]:_0x31e9f9[_0x4af7('0x16')]+_0x31e9f9[_0x4af7('0x18')];var _0x55e81e;if(_0x3b208e>=_0x3fbdfe){_0x3b208e=_0x3fbdfe;_0x55e81e=0xc8;}else{_0x55e81e=0xce;}_0x18305d[_0x4af7('0x15')](_0x55e81e);return _0x18305d[_0x4af7('0x1a')]('Content-Range',_0x26a265+'-'+_0x3b208e+'/'+_0x3fbdfe)[_0x4af7('0x1b')](_0x262049);}return null;};}function patchUpdates(_0x1ee164){return function(_0x5c9409){try{jsonpatch[_0x4af7('0x1c')](_0x5c9409,_0x1ee164,!![]);}catch(_0x400d95){return BPromise[_0x4af7('0x1d')](_0x400d95);}return _0x5c9409['save']();};}function saveUpdates(_0x2fa889,_0x43b1c3){return function(_0x1a6887){if(_0x1a6887){return _0x1a6887[_0x4af7('0x1e')](_0x2fa889)[_0x4af7('0x1f')](function(_0x16b3cb){return _0x16b3cb;});}return null;};}function removeEntity(_0x55fc33,_0x2804c3){return function(_0x228bac){if(_0x228bac){return _0x228bac[_0x4af7('0x20')]()['then'](function(){_0x55fc33[_0x4af7('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x517750,_0x53cfba){return function(_0x317baa){if(!_0x317baa){_0x517750[_0x4af7('0x14')](0x194);}return _0x317baa;};}function handleError(_0x58cef8,_0x5e491c){_0x5e491c=_0x5e491c||0x1f4;return function(_0x6dd3f1){logger[_0x4af7('0x21')](_0x6dd3f1[_0x4af7('0x22')]);if(_0x6dd3f1['name']){delete _0x6dd3f1[_0x4af7('0x23')];}_0x58cef8['status'](_0x5e491c)[_0x4af7('0x24')](_0x6dd3f1);};}exports[_0x4af7('0x25')]=function(_0x288444,_0x9c747e){var _0x3e8c03={},_0x22bfd8={},_0x43f6a7={'count':0x0,'rows':[]};var _0x55c01b=_[_0x4af7('0x26')](db[_0x4af7('0x27')][_0x4af7('0x28')],function(_0xec3cef){return{'name':_0xec3cef['fieldName'],'type':_0xec3cef[_0x4af7('0x29')]['key']};});_0x22bfd8[_0x4af7('0x2a')]=_[_0x4af7('0x26')](_0x55c01b,'name');_0x22bfd8['query']=_['keys'](_0x288444['query']);_0x22bfd8[_0x4af7('0x2b')]=_[_0x4af7('0x2c')](_0x22bfd8[_0x4af7('0x2a')],_0x22bfd8['query']);_0x3e8c03[_0x4af7('0x2d')]=_[_0x4af7('0x2c')](_0x22bfd8[_0x4af7('0x2a')],qs[_0x4af7('0x2e')](_0x288444[_0x4af7('0x2f')][_0x4af7('0x2e')]));_0x3e8c03['attributes']=_0x3e8c03[_0x4af7('0x2d')][_0x4af7('0x30')]?_0x3e8c03[_0x4af7('0x2d')]:_0x22bfd8[_0x4af7('0x2a')];if(!_0x288444['query'][_0x4af7('0x31')](_0x4af7('0x32'))){_0x3e8c03[_0x4af7('0x18')]=qs[_0x4af7('0x18')](_0x288444[_0x4af7('0x2f')]['limit']);_0x3e8c03[_0x4af7('0x16')]=qs['offset'](_0x288444['query']['offset']);}_0x3e8c03[_0x4af7('0x33')]=qs[_0x4af7('0x34')](_0x288444[_0x4af7('0x2f')]['sort']);_0x3e8c03[_0x4af7('0x35')]=qs[_0x4af7('0x2b')](_['pick'](_0x288444[_0x4af7('0x2f')],_0x22bfd8[_0x4af7('0x2b')]),_0x55c01b);if(_0x288444['query']['filter']){_0x3e8c03[_0x4af7('0x35')]=_['merge'](_0x3e8c03[_0x4af7('0x35')],{'$or':_[_0x4af7('0x26')](_0x55c01b,function(_0x541c23){if(_0x541c23[_0x4af7('0x29')]!=='VIRTUAL'){var _0x246045={};_0x246045[_0x541c23[_0x4af7('0x23')]]={'$like':'%'+_0x288444[_0x4af7('0x2f')][_0x4af7('0x36')]+'%'};return _0x246045;}})});}_0x3e8c03=_['merge']({},_0x3e8c03,_0x288444[_0x4af7('0x37')]);var _0x32d94e={'where':_0x3e8c03[_0x4af7('0x35')]};return db[_0x4af7('0x27')]['count'](_0x32d94e)[_0x4af7('0x1f')](function(_0x1a93cc){_0x43f6a7[_0x4af7('0x19')]=_0x1a93cc;if(_0x288444['query'][_0x4af7('0x38')]){_0x3e8c03[_0x4af7('0x39')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x4af7('0x3a')](_0x3e8c03);})['then'](function(_0x1f67f2){_0x43f6a7['rows']=_0x1f67f2;return _0x43f6a7;})['then'](respondWithFilteredResult(_0x9c747e,_0x3e8c03))['catch'](handleError(_0x9c747e,null));};exports[_0x4af7('0x3b')]=function(_0xfaec,_0x93b154){var _0x49575a={'raw':!![],'where':{'id':_0xfaec[_0x4af7('0x3c')]['id']}},_0x7dc650={};_0x7dc650[_0x4af7('0x2a')]=_[_0x4af7('0x3d')](db[_0x4af7('0x27')][_0x4af7('0x28')]);_0x7dc650[_0x4af7('0x2f')]=_[_0x4af7('0x3d')](_0xfaec[_0x4af7('0x2f')]);_0x7dc650[_0x4af7('0x2b')]=_[_0x4af7('0x2c')](_0x7dc650['model'],_0x7dc650[_0x4af7('0x2f')]);_0x49575a['attributes']=_[_0x4af7('0x2c')](_0x7dc650[_0x4af7('0x2a')],qs['fields'](_0xfaec['query'][_0x4af7('0x2e')]));_0x49575a['attributes']=_0x49575a[_0x4af7('0x2d')][_0x4af7('0x30')]?_0x49575a[_0x4af7('0x2d')]:_0x7dc650[_0x4af7('0x2a')];if(_0xfaec[_0x4af7('0x2f')]['includeAll']){_0x49575a[_0x4af7('0x39')]=[{'all':!![]}];}_0x49575a=_[_0x4af7('0x3e')]({},_0x49575a,_0xfaec['options']);return db['JscriptyQuestionReport'][_0x4af7('0x3f')](_0x49575a)[_0x4af7('0x1f')](handleEntityNotFound(_0x93b154,null))['then'](respondWithResult(_0x93b154,null))[_0x4af7('0x40')](handleError(_0x93b154,null));};exports[_0x4af7('0x41')]=function(_0x17c086,_0x2a4991){return db[_0x4af7('0x27')][_0x4af7('0x41')](_0x17c086['body'],{})[_0x4af7('0x1f')](respondWithResult(_0x2a4991,0xc9))[_0x4af7('0x40')](handleError(_0x2a4991,null));};exports[_0x4af7('0x1e')]=function(_0x116297,_0x557bad){if(_0x116297['body']['id']){delete _0x116297[_0x4af7('0x42')]['id'];}return db['JscriptyQuestionReport'][_0x4af7('0x3f')]({'where':{'id':_0x116297['params']['id']}})[_0x4af7('0x1f')](handleEntityNotFound(_0x557bad,null))[_0x4af7('0x1f')](saveUpdates(_0x116297['body'],null))[_0x4af7('0x1f')](respondWithResult(_0x557bad,null))[_0x4af7('0x40')](handleError(_0x557bad,null));};exports['destroy']=function(_0x295b8b,_0x5e3a6b){return db[_0x4af7('0x27')]['find']({'where':{'id':_0x295b8b[_0x4af7('0x3c')]['id']}})[_0x4af7('0x1f')](handleEntityNotFound(_0x5e3a6b,null))[_0x4af7('0x1f')](removeEntity(_0x5e3a6b,null))[_0x4af7('0x40')](handleError(_0x5e3a6b,null));};exports[_0x4af7('0x43')]=function(_0x93ce3,_0xca7e30){return db['JscriptyQuestionReport']['describe']()['then'](respondWithResult(_0xca7e30,null))['catch'](handleError(_0xca7e30,null));}; \ No newline at end of file +var _0x2da5=['key','model','map','query','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','VIRTUAL','JscriptyQuestionReport','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','update','destroy','then','error','name','send','index','rawAttributes','type'];(function(_0x2302a1,_0x4bc33d){var _0x413cae=function(_0x233632){while(--_0x233632){_0x2302a1['push'](_0x2302a1['shift']());}};_0x413cae(++_0x4bc33d);}(_0x2da5,0x175));var _0x52da=function(_0x1231ba,_0x441f87){_0x1231ba=_0x1231ba-0x0;var _0x25f913=_0x2da5[_0x1231ba];return _0x25f913;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x52da('0x0'));var jsonpatch=require(_0x52da('0x1'));var rp=require('request-promise');var moment=require(_0x52da('0x2'));var BPromise=require(_0x52da('0x3'));var Mustache=require(_0x52da('0x4'));var util=require(_0x52da('0x5'));var path=require(_0x52da('0x6'));var sox=require(_0x52da('0x7'));var csv=require(_0x52da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x52da('0x9'));var _=require('lodash');var squel=require(_0x52da('0xa'));var crypto=require(_0x52da('0xb'));var jsforce=require(_0x52da('0xc'));var deskjs=require(_0x52da('0xd'));var toCsv=require(_0x52da('0x8'));var querystring=require('querystring');var Papa=require(_0x52da('0xe'));var Redis=require(_0x52da('0xf'));var authService=require(_0x52da('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x52da('0x11'));var hardwareService=require(_0x52da('0x12'));var logger=require(_0x52da('0x13'))(_0x52da('0x14'));var utils=require(_0x52da('0x15'));var config=require(_0x52da('0x16'));var licenseUtil=require(_0x52da('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26d29e,_0xcb88e7){_0xcb88e7=_0xcb88e7||0xcc;return function(_0x152960){if(_0x152960){return _0x26d29e['sendStatus'](_0xcb88e7);}return _0x26d29e[_0x52da('0x18')](_0xcb88e7)[_0x52da('0x19')]();};}function respondWithResult(_0x3aeafd,_0x6ca680){_0x6ca680=_0x6ca680||0xc8;return function(_0x2ff557){if(_0x2ff557){return _0x3aeafd[_0x52da('0x18')](_0x6ca680)[_0x52da('0x1a')](_0x2ff557);}};}function respondWithFilteredResult(_0x3d490e,_0x1140ca){return function(_0x39b7c7){if(_0x39b7c7){var _0x2d4b87=typeof _0x1140ca[_0x52da('0x1b')]===_0x52da('0x1c')&&typeof _0x1140ca[_0x52da('0x1d')]===_0x52da('0x1c');var _0x972ec=_0x39b7c7[_0x52da('0x1e')];var _0x5697bd=_0x2d4b87?0x0:_0x1140ca[_0x52da('0x1b')];var _0xc910dc=_0x2d4b87?_0x39b7c7[_0x52da('0x1e')]:_0x1140ca['offset']+_0x1140ca['limit'];var _0x51140c;if(_0xc910dc>=_0x972ec){_0xc910dc=_0x972ec;_0x51140c=0xc8;}else{_0x51140c=0xce;}_0x3d490e[_0x52da('0x18')](_0x51140c);return _0x3d490e['set']('Content-Range',_0x5697bd+'-'+_0xc910dc+'/'+_0x972ec)[_0x52da('0x1a')](_0x39b7c7);}return null;};}function patchUpdates(_0x43dd1a){return function(_0x43d988){try{jsonpatch[_0x52da('0x1f')](_0x43d988,_0x43dd1a,!![]);}catch(_0x5e7cd5){return BPromise['reject'](_0x5e7cd5);}return _0x43d988['save']();};}function saveUpdates(_0x37d541,_0x271926){return function(_0x53fdc3){if(_0x53fdc3){return _0x53fdc3[_0x52da('0x20')](_0x37d541)['then'](function(_0x5c6b99){return _0x5c6b99;});}return null;};}function removeEntity(_0xb05170,_0xbb4aa7){return function(_0x53f24b){if(_0x53f24b){return _0x53f24b[_0x52da('0x21')]()[_0x52da('0x22')](function(){_0xb05170[_0x52da('0x18')](0xcc)[_0x52da('0x19')]();});}};}function handleEntityNotFound(_0xeb4e2c,_0x36d258){return function(_0x3742d1){if(!_0x3742d1){_0xeb4e2c['sendStatus'](0x194);}return _0x3742d1;};}function handleError(_0x3c6275,_0x5d8d48){_0x5d8d48=_0x5d8d48||0x1f4;return function(_0x380e0a){logger[_0x52da('0x23')](_0x380e0a['stack']);if(_0x380e0a[_0x52da('0x24')]){delete _0x380e0a[_0x52da('0x24')];}_0x3c6275[_0x52da('0x18')](_0x5d8d48)[_0x52da('0x25')](_0x380e0a);};}exports[_0x52da('0x26')]=function(_0xa6238b,_0x33a93b){var _0x53066a={},_0x107dc8={},_0x43c098={'count':0x0,'rows':[]};var _0x53f2ed=_['map'](db['JscriptyQuestionReport'][_0x52da('0x27')],function(_0x17accc){return{'name':_0x17accc['fieldName'],'type':_0x17accc[_0x52da('0x28')][_0x52da('0x29')]};});_0x107dc8[_0x52da('0x2a')]=_[_0x52da('0x2b')](_0x53f2ed,_0x52da('0x24'));_0x107dc8[_0x52da('0x2c')]=_['keys'](_0xa6238b[_0x52da('0x2c')]);_0x107dc8[_0x52da('0x2d')]=_[_0x52da('0x2e')](_0x107dc8['model'],_0x107dc8[_0x52da('0x2c')]);_0x53066a[_0x52da('0x2f')]=_[_0x52da('0x2e')](_0x107dc8['model'],qs[_0x52da('0x30')](_0xa6238b[_0x52da('0x2c')][_0x52da('0x30')]));_0x53066a[_0x52da('0x2f')]=_0x53066a[_0x52da('0x2f')][_0x52da('0x31')]?_0x53066a['attributes']:_0x107dc8[_0x52da('0x2a')];if(!_0xa6238b[_0x52da('0x2c')]['hasOwnProperty']('nolimit')){_0x53066a[_0x52da('0x1d')]=qs[_0x52da('0x1d')](_0xa6238b[_0x52da('0x2c')]['limit']);_0x53066a[_0x52da('0x1b')]=qs[_0x52da('0x1b')](_0xa6238b[_0x52da('0x2c')]['offset']);}_0x53066a[_0x52da('0x32')]=qs[_0x52da('0x33')](_0xa6238b['query'][_0x52da('0x33')]);_0x53066a['where']=qs[_0x52da('0x2d')](_['pick'](_0xa6238b[_0x52da('0x2c')],_0x107dc8[_0x52da('0x2d')]),_0x53f2ed);if(_0xa6238b['query'][_0x52da('0x34')]){_0x53066a[_0x52da('0x35')]=_[_0x52da('0x36')](_0x53066a[_0x52da('0x35')],{'$or':_[_0x52da('0x2b')](_0x53f2ed,function(_0x1e7430){if(_0x1e7430[_0x52da('0x28')]!==_0x52da('0x37')){var _0x782304={};_0x782304[_0x1e7430[_0x52da('0x24')]]={'$like':'%'+_0xa6238b[_0x52da('0x2c')][_0x52da('0x34')]+'%'};return _0x782304;}})});}_0x53066a=_['merge']({},_0x53066a,_0xa6238b['options']);var _0x4ae4eb={'where':_0x53066a[_0x52da('0x35')]};return db[_0x52da('0x38')][_0x52da('0x1e')](_0x4ae4eb)[_0x52da('0x22')](function(_0x49d66){_0x43c098[_0x52da('0x1e')]=_0x49d66;if(_0xa6238b[_0x52da('0x2c')][_0x52da('0x39')]){_0x53066a[_0x52da('0x3a')]=[{'all':!![]}];}return db[_0x52da('0x38')][_0x52da('0x3b')](_0x53066a);})['then'](function(_0x7592db){_0x43c098[_0x52da('0x3c')]=_0x7592db;return _0x43c098;})['then'](respondWithFilteredResult(_0x33a93b,_0x53066a))['catch'](handleError(_0x33a93b,null));};exports['show']=function(_0x40fcbd,_0x40e90e){var _0xd78e29={'raw':!![],'where':{'id':_0x40fcbd[_0x52da('0x3d')]['id']}},_0x47156d={};_0x47156d['model']=_[_0x52da('0x3e')](db[_0x52da('0x38')][_0x52da('0x27')]);_0x47156d[_0x52da('0x2c')]=_['keys'](_0x40fcbd[_0x52da('0x2c')]);_0x47156d[_0x52da('0x2d')]=_['intersection'](_0x47156d[_0x52da('0x2a')],_0x47156d['query']);_0xd78e29[_0x52da('0x2f')]=_['intersection'](_0x47156d[_0x52da('0x2a')],qs[_0x52da('0x30')](_0x40fcbd[_0x52da('0x2c')][_0x52da('0x30')]));_0xd78e29[_0x52da('0x2f')]=_0xd78e29['attributes'][_0x52da('0x31')]?_0xd78e29[_0x52da('0x2f')]:_0x47156d[_0x52da('0x2a')];if(_0x40fcbd[_0x52da('0x2c')]['includeAll']){_0xd78e29[_0x52da('0x3a')]=[{'all':!![]}];}_0xd78e29=_[_0x52da('0x36')]({},_0xd78e29,_0x40fcbd[_0x52da('0x3f')]);return db[_0x52da('0x38')][_0x52da('0x40')](_0xd78e29)[_0x52da('0x22')](handleEntityNotFound(_0x40e90e,null))[_0x52da('0x22')](respondWithResult(_0x40e90e,null))[_0x52da('0x41')](handleError(_0x40e90e,null));};exports[_0x52da('0x42')]=function(_0x14f970,_0x3ebcf6){return db[_0x52da('0x38')][_0x52da('0x42')](_0x14f970[_0x52da('0x43')],{})[_0x52da('0x22')](respondWithResult(_0x3ebcf6,0xc9))[_0x52da('0x41')](handleError(_0x3ebcf6,null));};exports[_0x52da('0x20')]=function(_0x401dea,_0x34337e){if(_0x401dea[_0x52da('0x43')]['id']){delete _0x401dea[_0x52da('0x43')]['id'];}return db[_0x52da('0x38')][_0x52da('0x40')]({'where':{'id':_0x401dea[_0x52da('0x3d')]['id']}})[_0x52da('0x22')](handleEntityNotFound(_0x34337e,null))['then'](saveUpdates(_0x401dea['body'],null))[_0x52da('0x22')](respondWithResult(_0x34337e,null))['catch'](handleError(_0x34337e,null));};exports[_0x52da('0x21')]=function(_0x8c33dc,_0xaa7700){return db[_0x52da('0x38')]['find']({'where':{'id':_0x8c33dc[_0x52da('0x3d')]['id']}})[_0x52da('0x22')](handleEntityNotFound(_0xaa7700,null))[_0x52da('0x22')](removeEntity(_0xaa7700,null))[_0x52da('0x41')](handleError(_0xaa7700,null));};exports['describe']=function(_0x2347a5,_0x5a6deb){return db[_0x52da('0x38')][_0x52da('0x44')]()[_0x52da('0x22')](respondWithResult(_0x5a6deb,null))[_0x52da('0x41')](handleError(_0x5a6deb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 657cdb4..ef7d359 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 _0x531a=['api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger'];(function(_0x1b73ab,_0x1f30de){var _0x3dbad6=function(_0x190652){while(--_0x190652){_0x1b73ab['push'](_0x1b73ab['shift']());}};_0x3dbad6(++_0x1f30de);}(_0x531a,0x11b));var _0xa531=function(_0x2ab350,_0x32859f){_0x2ab350=_0x2ab350-0x0;var _0x4acac=_0x531a[_0x2ab350];return _0x4acac;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var logger=require(_0xa531('0x2'))(_0xa531('0x3'));var moment=require(_0xa531('0x4'));var BPromise=require(_0xa531('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa531('0x6'));var rimraf=require(_0xa531('0x7'));var config=require(_0xa531('0x8'));var attributes=require(_0xa531('0x9'));module[_0xa531('0xa')]=function(_0x499873,_0x5150b2){return _0x499873['define'](_0xa531('0xb'),attributes,{'tableName':_0xa531('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdd5=['request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2595a6,_0x48fc45){var _0x460197=function(_0x18f9db){while(--_0x18f9db){_0x2595a6['push'](_0x2595a6['shift']());}};_0x460197(++_0x48fc45);}(_0xbdd5,0x140));var _0x5bdd=function(_0xca81f6,_0x35cb4f){_0xca81f6=_0xca81f6-0x0;var _0x2f6673=_0xbdd5[_0xca81f6];return _0x2f6673;};'use strict';var _=require(_0x5bdd('0x0'));var util=require('util');var logger=require(_0x5bdd('0x1'))(_0x5bdd('0x2'));var moment=require(_0x5bdd('0x3'));var BPromise=require(_0x5bdd('0x4'));var rp=require(_0x5bdd('0x5'));var fs=require('fs');var path=require(_0x5bdd('0x6'));var rimraf=require('rimraf');var config=require(_0x5bdd('0x7'));var attributes=require(_0x5bdd('0x8'));module[_0x5bdd('0x9')]=function(_0xe3bea1,_0x42a7f6){return _0xe3bea1[_0x5bdd('0xa')](_0x5bdd('0xb'),attributes,{'tableName':_0x5bdd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index cfe3bbf..635b286 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 _0xf673=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x15fb0b,_0x44b92d){var _0x423f50=function(_0x32b8c5){while(--_0x32b8c5){_0x15fb0b['push'](_0x15fb0b['shift']());}};_0x423f50(++_0x44b92d);}(_0xf673,0x190));var _0x3f67=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0xf673[_0x5ff517];return _0x19a245;};'use strict';var _=require(_0x3f67('0x0'));var util=require(_0x3f67('0x1'));var moment=require(_0x3f67('0x2'));var BPromise=require('bluebird');var rs=require(_0x3f67('0x3'));var fs=require('fs');var Redis=require(_0x3f67('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f67('0x5'));var logger=require(_0x3f67('0x6'))(_0x3f67('0x7'));var config=require(_0x3f67('0x8'));var jayson=require(_0x3f67('0x9'));var client=jayson[_0x3f67('0xa')][_0x3f67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x244c27,_0x57c547,_0xa79837){return new BPromise(function(_0x29bd5b,_0x55c439){return client['request'](_0x244c27,_0xa79837)[_0x3f67('0xc')](function(_0x21faa6){logger[_0x3f67('0xd')](_0x3f67('0xe'),_0x57c547,'request\x20sent');logger['debug'](_0x3f67('0xf'),_0x57c547,_0x3f67('0x10'),JSON['stringify'](_0x21faa6));if(_0x21faa6[_0x3f67('0x11')]){if(_0x21faa6[_0x3f67('0x11')][_0x3f67('0x12')]===0x1f4){logger['error'](_0x3f67('0xe'),_0x57c547,_0x21faa6['error'][_0x3f67('0x13')]);return _0x55c439(_0x21faa6[_0x3f67('0x11')][_0x3f67('0x13')]);}logger[_0x3f67('0x11')](_0x3f67('0xe'),_0x57c547,_0x21faa6[_0x3f67('0x11')]['message']);return _0x29bd5b(_0x21faa6[_0x3f67('0x11')]['message']);}else{logger[_0x3f67('0xd')](_0x3f67('0xe'),_0x57c547,_0x3f67('0x10'));_0x29bd5b(_0x21faa6[_0x3f67('0x14')]['message']);}})[_0x3f67('0x15')](function(_0x4d30f6){logger['error'](_0x3f67('0xe'),_0x57c547,_0x4d30f6);_0x55c439(_0x4d30f6);});});} \ No newline at end of file +var _0xc2c4=['stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x3937fe,_0xbc0f87){var _0x37910f=function(_0x4f6b06){while(--_0x4f6b06){_0x3937fe['push'](_0x3937fe['shift']());}};_0x37910f(++_0xbc0f87);}(_0xc2c4,0x17d));var _0x4c2c=function(_0x5c54f5,_0x493113){_0x5c54f5=_0x5c54f5-0x0;var _0x3df2bc=_0xc2c4[_0x5c54f5];return _0x3df2bc;};'use strict';var _=require(_0x4c2c('0x0'));var util=require(_0x4c2c('0x1'));var moment=require(_0x4c2c('0x2'));var BPromise=require(_0x4c2c('0x3'));var rs=require(_0x4c2c('0x4'));var fs=require('fs');var Redis=require(_0x4c2c('0x5'));var db=require(_0x4c2c('0x6'))['db'];var utils=require(_0x4c2c('0x7'));var logger=require(_0x4c2c('0x8'))(_0x4c2c('0x9'));var config=require(_0x4c2c('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c91b8,_0x26d7cb,_0x4b86da){return new BPromise(function(_0x55bb24,_0x278598){return client[_0x4c2c('0xb')](_0x3c91b8,_0x4b86da)[_0x4c2c('0xc')](function(_0x4d9273){logger['info'](_0x4c2c('0xd'),_0x26d7cb,'request\x20sent');logger['debug'](_0x4c2c('0xe'),_0x26d7cb,'request\x20sent',JSON[_0x4c2c('0xf')](_0x4d9273));if(_0x4d9273[_0x4c2c('0x10')]){if(_0x4d9273['error']['code']===0x1f4){logger[_0x4c2c('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x26d7cb,_0x4d9273[_0x4c2c('0x10')]['message']);return _0x278598(_0x4d9273[_0x4c2c('0x10')][_0x4c2c('0x11')]);}logger[_0x4c2c('0x10')](_0x4c2c('0xd'),_0x26d7cb,_0x4d9273[_0x4c2c('0x10')][_0x4c2c('0x11')]);return _0x55bb24(_0x4d9273[_0x4c2c('0x10')][_0x4c2c('0x11')]);}else{logger[_0x4c2c('0x12')](_0x4c2c('0xd'),_0x26d7cb,_0x4c2c('0x13'));_0x55bb24(_0x4d9273[_0x4c2c('0x14')][_0x4c2c('0x11')]);}})[_0x4c2c('0x15')](function(_0x4913d1){logger[_0x4c2c('0x10')](_0x4c2c('0xd'),_0x26d7cb,_0x4913d1);_0x278598(_0x4913d1);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 04a78f1..2f0896e 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 _0x67d4=['show','/:id/questions','getQuestions','post','create','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe'];(function(_0x8e59a4,_0x5a18a2){var _0x4f5f2d=function(_0x5b5363){while(--_0x5b5363){_0x8e59a4['push'](_0x8e59a4['shift']());}};_0x4f5f2d(++_0x5a18a2);}(_0x67d4,0x6a));var _0x467d=function(_0x53870d,_0x1c4e87){_0x53870d=_0x53870d-0x0;var _0x481096=_0x67d4[_0x53870d];return _0x481096;};'use strict';var multer=require(_0x467d('0x0'));var util=require('util');var path=require(_0x467d('0x1'));var timeout=require(_0x467d('0x2'));var express=require(_0x467d('0x3'));var router=express[_0x467d('0x4')]();var fs_extra=require(_0x467d('0x5'));var auth=require(_0x467d('0x6'));var interaction=require(_0x467d('0x7'));var config=require(_0x467d('0x8'));var controller=require(_0x467d('0x9'));router[_0x467d('0xa')]('/',auth[_0x467d('0xb')](),controller[_0x467d('0xc')]);router['get']('/describe',auth[_0x467d('0xb')](),controller[_0x467d('0xd')]);router[_0x467d('0xa')]('/:id',auth[_0x467d('0xb')](),controller[_0x467d('0xe')]);router[_0x467d('0xa')](_0x467d('0xf'),auth[_0x467d('0xb')](),controller[_0x467d('0x10')]);router[_0x467d('0x11')]('/',auth[_0x467d('0xb')](),controller[_0x467d('0x12')]);router[_0x467d('0x13')]('/:id',auth[_0x467d('0xb')](),controller['update']);router[_0x467d('0x14')](_0x467d('0x15'),auth['isAuthenticated'](),controller[_0x467d('0x16')]);module[_0x467d('0x17')]=router; \ No newline at end of file +var _0xbadd=['../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x15dbc1,_0x553399){var _0x2a178c=function(_0x5eb288){while(--_0x5eb288){_0x15dbc1['push'](_0x15dbc1['shift']());}};_0x2a178c(++_0x553399);}(_0xbadd,0x142));var _0xdbad=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xbadd[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xdbad('0x0'));var util=require('util');var path=require(_0xdbad('0x1'));var timeout=require(_0xdbad('0x2'));var express=require(_0xdbad('0x3'));var router=express[_0xdbad('0x4')]();var fs_extra=require(_0xdbad('0x5'));var auth=require(_0xdbad('0x6'));var interaction=require(_0xdbad('0x7'));var config=require(_0xdbad('0x8'));var controller=require(_0xdbad('0x9'));router[_0xdbad('0xa')]('/',auth[_0xdbad('0xb')](),controller[_0xdbad('0xc')]);router[_0xdbad('0xa')](_0xdbad('0xd'),auth[_0xdbad('0xb')](),controller[_0xdbad('0xe')]);router[_0xdbad('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xdbad('0xf')]);router[_0xdbad('0xa')]('/:id/questions',auth[_0xdbad('0xb')](),controller['getQuestions']);router[_0xdbad('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdbad('0x11')](_0xdbad('0x12'),auth['isAuthenticated'](),controller[_0xdbad('0x13')]);router[_0xdbad('0x14')](_0xdbad('0x12'),auth[_0xdbad('0xb')](),controller[_0xdbad('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 10707ee..4c2d322 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 _0x7aa0=['starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x462a4f,_0x1e644e){var _0x36b938=function(_0x2fc8af){while(--_0x2fc8af){_0x462a4f['push'](_0x462a4f['shift']());}};_0x36b938(++_0x1e644e);}(_0x7aa0,0xa1));var _0x07aa=function(_0x37253f,_0x4cc2a7){_0x37253f=_0x37253f-0x0;var _0x5f1783=_0x7aa0[_0x37253f];return _0x5f1783;};'use strict';var moment=require(_0x07aa('0x0'));var Sequelize=require(_0x07aa('0x1'));module[_0x07aa('0x2')]={'starttime':{'type':Sequelize[_0x07aa('0x3')],'set':function(_0x5edbb2){this['setDataValue'](_0x07aa('0x4'),_0x5edbb2);this[_0x07aa('0x5')](_0x07aa('0x6'),moment()[_0x07aa('0x7')](_0x07aa('0x8')));}},'endtime':{'type':Sequelize[_0x07aa('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x07aa('0x9')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x07aa('0x9')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x07aa('0x9')]},'completed':{'type':Sequelize[_0x07aa('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x8c75=['DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c75,0x1d1));var _0x58c7=function(_0x33a5d0,_0x470669){_0x33a5d0=_0x33a5d0-0x0;var _0x5e2b53=_0x8c75[_0x33a5d0];return _0x5e2b53;};'use strict';var moment=require(_0x58c7('0x0'));var Sequelize=require(_0x58c7('0x1'));module[_0x58c7('0x2')]={'starttime':{'type':Sequelize[_0x58c7('0x3')],'set':function(_0x52509d){this[_0x58c7('0x4')]('starttime',_0x52509d);this[_0x58c7('0x4')](_0x58c7('0x5'),moment()['format'](_0x58c7('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x58c7('0x7')]},'projectname':{'type':Sequelize[_0x58c7('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x58c7('0x7')]},'calleridname':{'type':Sequelize[_0x58c7('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x58c7('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 4b1cebd..c316e64 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 _0x5b38=['sort','SessionId','filter','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filters','pick','merge','where','VIRTUAL','includeAll','include','JscriptySessionReport','findAll','rows','show','params','options','find','catch','create','body','describe','getQuestions','JscriptyQuestionReport'];(function(_0xbc9e92,_0x42b470){var _0x3010f2=function(_0x258d03){while(--_0x258d03){_0xbc9e92['push'](_0xbc9e92['shift']());}};_0x3010f2(++_0x42b470);}(_0x5b38,0x137));var _0x85b3=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x5b38[_0x46361e];return _0x14e302;};'use strict';var emlformat=require(_0x85b3('0x0'));var rimraf=require(_0x85b3('0x1'));var zipdir=require(_0x85b3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x85b3('0x3'));var moment=require(_0x85b3('0x4'));var BPromise=require(_0x85b3('0x5'));var Mustache=require(_0x85b3('0x6'));var util=require(_0x85b3('0x7'));var path=require('path');var sox=require(_0x85b3('0x8'));var csv=require(_0x85b3('0x9'));var ejs=require(_0x85b3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85b3('0xb'));var squel=require('squel');var crypto=require(_0x85b3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x85b3('0xd'));var toCsv=require(_0x85b3('0x9'));var querystring=require(_0x85b3('0xe'));var Papa=require(_0x85b3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x85b3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x85b3('0x11'))(_0x85b3('0x12'));var utils=require(_0x85b3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x85b3('0x14'));var db=require(_0x85b3('0x15'))['db'];function respondWithStatusCode(_0x1e62f4,_0x330407){_0x330407=_0x330407||0xcc;return function(_0x3741d4){if(_0x3741d4){return _0x1e62f4[_0x85b3('0x16')](_0x330407);}return _0x1e62f4[_0x85b3('0x17')](_0x330407)[_0x85b3('0x18')]();};}function respondWithResult(_0x1ac078,_0x4cffde){_0x4cffde=_0x4cffde||0xc8;return function(_0x3bc230){if(_0x3bc230){return _0x1ac078[_0x85b3('0x17')](_0x4cffde)[_0x85b3('0x19')](_0x3bc230);}};}function respondWithFilteredResult(_0x38c838,_0x550bc7){return function(_0x38b118){if(_0x38b118){var _0x576d0c=typeof _0x550bc7[_0x85b3('0x1a')]===_0x85b3('0x1b')&&typeof _0x550bc7['limit']===_0x85b3('0x1b');var _0x4922fe=_0x38b118[_0x85b3('0x1c')];var _0x149b04=_0x576d0c?0x0:_0x550bc7[_0x85b3('0x1a')];var _0x5ed250=_0x576d0c?_0x38b118[_0x85b3('0x1c')]:_0x550bc7[_0x85b3('0x1a')]+_0x550bc7[_0x85b3('0x1d')];var _0x15d92b;if(_0x5ed250>=_0x4922fe){_0x5ed250=_0x4922fe;_0x15d92b=0xc8;}else{_0x15d92b=0xce;}_0x38c838[_0x85b3('0x17')](_0x15d92b);return _0x38c838[_0x85b3('0x1e')]('Content-Range',_0x149b04+'-'+_0x5ed250+'/'+_0x4922fe)[_0x85b3('0x19')](_0x38b118);}return null;};}function patchUpdates(_0x12edee){return function(_0x7bc4ac){try{jsonpatch['apply'](_0x7bc4ac,_0x12edee,!![]);}catch(_0x26899b){return BPromise[_0x85b3('0x1f')](_0x26899b);}return _0x7bc4ac[_0x85b3('0x20')]();};}function saveUpdates(_0xb4f2d3,_0x2bcbda){return function(_0x404868){if(_0x404868){return _0x404868[_0x85b3('0x21')](_0xb4f2d3)[_0x85b3('0x22')](function(_0x1f8a7){return _0x1f8a7;});}return null;};}function removeEntity(_0x1d915e,_0x514d94){return function(_0xe42a91){if(_0xe42a91){return _0xe42a91[_0x85b3('0x23')]()[_0x85b3('0x22')](function(){_0x1d915e[_0x85b3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42db71,_0x3033b5){return function(_0x523e94){if(!_0x523e94){_0x42db71[_0x85b3('0x16')](0x194);}return _0x523e94;};}function handleError(_0x2763d3,_0x19745a){_0x19745a=_0x19745a||0x1f4;return function(_0x52db23){logger[_0x85b3('0x24')](_0x52db23[_0x85b3('0x25')]);if(_0x52db23[_0x85b3('0x26')]){delete _0x52db23[_0x85b3('0x26')];}_0x2763d3[_0x85b3('0x17')](_0x19745a)['send'](_0x52db23);};}exports[_0x85b3('0x27')]=function(_0x1391f9,_0x4b7472){var _0x3474df={},_0x40a2ef={},_0x258e88={'count':0x0,'rows':[]};var _0x3dbf13=_[_0x85b3('0x28')](db['JscriptySessionReport'][_0x85b3('0x29')],function(_0x427bd0){return{'name':_0x427bd0[_0x85b3('0x2a')],'type':_0x427bd0[_0x85b3('0x2b')]['key']};});_0x40a2ef[_0x85b3('0x2c')]=_[_0x85b3('0x28')](_0x3dbf13,_0x85b3('0x26'));_0x40a2ef[_0x85b3('0x2d')]=_[_0x85b3('0x2e')](_0x1391f9['query']);_0x40a2ef['filters']=_[_0x85b3('0x2f')](_0x40a2ef[_0x85b3('0x2c')],_0x40a2ef['query']);_0x3474df[_0x85b3('0x30')]=_['intersection'](_0x40a2ef[_0x85b3('0x2c')],qs[_0x85b3('0x31')](_0x1391f9['query'][_0x85b3('0x31')]));_0x3474df[_0x85b3('0x30')]=_0x3474df['attributes'][_0x85b3('0x32')]?_0x3474df['attributes']:_0x40a2ef[_0x85b3('0x2c')];if(!_0x1391f9[_0x85b3('0x2d')][_0x85b3('0x33')](_0x85b3('0x34'))){_0x3474df[_0x85b3('0x1d')]=qs[_0x85b3('0x1d')](_0x1391f9['query'][_0x85b3('0x1d')]);_0x3474df[_0x85b3('0x1a')]=qs[_0x85b3('0x1a')](_0x1391f9[_0x85b3('0x2d')]['offset']);}_0x3474df[_0x85b3('0x35')]=qs['sort'](_0x1391f9[_0x85b3('0x2d')]['sort']);_0x3474df['where']=qs[_0x85b3('0x36')](_[_0x85b3('0x37')](_0x1391f9[_0x85b3('0x2d')],_0x40a2ef[_0x85b3('0x36')]),_0x3dbf13);if(_0x1391f9['query']['filter']){_0x3474df['where']=_[_0x85b3('0x38')](_0x3474df[_0x85b3('0x39')],{'$or':_[_0x85b3('0x28')](_0x3dbf13,function(_0x23404e){if(_0x23404e['type']!==_0x85b3('0x3a')){var _0x524e73={};_0x524e73[_0x23404e[_0x85b3('0x26')]]={'$like':'%'+_0x1391f9[_0x85b3('0x2d')]['filter']+'%'};return _0x524e73;}})});}_0x3474df=_[_0x85b3('0x38')]({},_0x3474df,_0x1391f9['options']);var _0x1f7bbe={'where':_0x3474df[_0x85b3('0x39')]};return db['JscriptySessionReport'][_0x85b3('0x1c')](_0x1f7bbe)['then'](function(_0x20b8cc){_0x258e88['count']=_0x20b8cc;if(_0x1391f9[_0x85b3('0x2d')][_0x85b3('0x3b')]){_0x3474df[_0x85b3('0x3c')]=[{'all':!![]}];}return db[_0x85b3('0x3d')][_0x85b3('0x3e')](_0x3474df);})[_0x85b3('0x22')](function(_0x5eadba){_0x258e88[_0x85b3('0x3f')]=_0x5eadba;return _0x258e88;})['then'](respondWithFilteredResult(_0x4b7472,_0x3474df))['catch'](handleError(_0x4b7472,null));};exports[_0x85b3('0x40')]=function(_0x33819a,_0x319b04){var _0x89f05e={'raw':!![],'where':{'id':_0x33819a[_0x85b3('0x41')]['id']}},_0x385d1d={};_0x385d1d['model']=_[_0x85b3('0x2e')](db[_0x85b3('0x3d')][_0x85b3('0x29')]);_0x385d1d['query']=_[_0x85b3('0x2e')](_0x33819a['query']);_0x385d1d[_0x85b3('0x36')]=_['intersection'](_0x385d1d['model'],_0x385d1d[_0x85b3('0x2d')]);_0x89f05e[_0x85b3('0x30')]=_[_0x85b3('0x2f')](_0x385d1d['model'],qs[_0x85b3('0x31')](_0x33819a['query']['fields']));_0x89f05e[_0x85b3('0x30')]=_0x89f05e['attributes'][_0x85b3('0x32')]?_0x89f05e[_0x85b3('0x30')]:_0x385d1d['model'];if(_0x33819a['query'][_0x85b3('0x3b')]){_0x89f05e[_0x85b3('0x3c')]=[{'all':!![]}];}_0x89f05e=_[_0x85b3('0x38')]({},_0x89f05e,_0x33819a[_0x85b3('0x42')]);return db[_0x85b3('0x3d')][_0x85b3('0x43')](_0x89f05e)[_0x85b3('0x22')](handleEntityNotFound(_0x319b04,null))[_0x85b3('0x22')](respondWithResult(_0x319b04,null))[_0x85b3('0x44')](handleError(_0x319b04,null));};exports[_0x85b3('0x45')]=function(_0x53f890,_0x231d88){return db[_0x85b3('0x3d')][_0x85b3('0x45')](_0x53f890[_0x85b3('0x46')],{})[_0x85b3('0x22')](respondWithResult(_0x231d88,0xc9))[_0x85b3('0x44')](handleError(_0x231d88,null));};exports[_0x85b3('0x21')]=function(_0x1b9b37,_0xbe00cb){if(_0x1b9b37[_0x85b3('0x46')]['id']){delete _0x1b9b37['body']['id'];}return db[_0x85b3('0x3d')][_0x85b3('0x43')]({'where':{'id':_0x1b9b37[_0x85b3('0x41')]['id']}})[_0x85b3('0x22')](handleEntityNotFound(_0xbe00cb,null))['then'](saveUpdates(_0x1b9b37[_0x85b3('0x46')],null))[_0x85b3('0x22')](respondWithResult(_0xbe00cb,null))[_0x85b3('0x44')](handleError(_0xbe00cb,null));};exports[_0x85b3('0x23')]=function(_0x17cf41,_0x5b050d){return db[_0x85b3('0x3d')][_0x85b3('0x43')]({'where':{'id':_0x17cf41[_0x85b3('0x41')]['id']}})[_0x85b3('0x22')](handleEntityNotFound(_0x5b050d,null))[_0x85b3('0x22')](removeEntity(_0x5b050d,null))[_0x85b3('0x44')](handleError(_0x5b050d,null));};exports[_0x85b3('0x47')]=function(_0x4dc5db,_0x321608){return db[_0x85b3('0x3d')]['describe']()[_0x85b3('0x22')](respondWithResult(_0x321608,null))[_0x85b3('0x44')](handleError(_0x321608,null));};exports[_0x85b3('0x48')]=function(_0xa62cac,_0x5b72db,_0x4de417){var _0xc5bdc7={'raw':!![],'where':{}};var _0x401c67={};var _0x4fc0f4={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0xa62cac[_0x85b3('0x41')]['id']}})[_0x85b3('0x22')](handleEntityNotFound(_0x5b72db,null))[_0x85b3('0x22')](function(_0x5e2e47){if(_0x5e2e47){_0x401c67[_0x85b3('0x2c')]=_[_0x85b3('0x2e')](db[_0x85b3('0x49')][_0x85b3('0x29')]);_0x401c67[_0x85b3('0x2d')]=_['keys'](_0xa62cac[_0x85b3('0x2d')]);_0x401c67['filters']=_[_0x85b3('0x2f')](_0x401c67[_0x85b3('0x2c')],_0x401c67[_0x85b3('0x2d')]);_0xc5bdc7[_0x85b3('0x30')]=_['intersection'](_0x401c67[_0x85b3('0x2c')],qs[_0x85b3('0x31')](_0xa62cac['query'][_0x85b3('0x31')]));_0xc5bdc7[_0x85b3('0x30')]=_0xc5bdc7['attributes']['length']?_0xc5bdc7['attributes']:_0x401c67[_0x85b3('0x2c')];if(!_0xa62cac[_0x85b3('0x2d')][_0x85b3('0x33')]('nolimit')){_0xc5bdc7['limit']=qs[_0x85b3('0x1d')](_0xa62cac['query']['limit']);_0xc5bdc7[_0x85b3('0x1a')]=qs['offset'](_0xa62cac[_0x85b3('0x2d')][_0x85b3('0x1a')]);}_0xc5bdc7['order']=qs[_0x85b3('0x4a')](_0xa62cac[_0x85b3('0x2d')]['sort']);_0xc5bdc7[_0x85b3('0x39')]=qs[_0x85b3('0x36')](_[_0x85b3('0x37')](_0xa62cac[_0x85b3('0x2d')],_0x401c67[_0x85b3('0x36')]));_0xc5bdc7[_0x85b3('0x39')][_0x85b3('0x4b')]=_0x5e2e47['id'];if(_0xa62cac[_0x85b3('0x2d')]['filter']){_0xc5bdc7['where']=_[_0x85b3('0x38')](_0xc5bdc7['where'],{'$or':_[_0x85b3('0x28')](_0xc5bdc7['attributes'],function(_0x455b47){var _0x3e5006={};_0x3e5006[_0x455b47]={'$like':'%'+_0xa62cac[_0x85b3('0x2d')][_0x85b3('0x4c')]+'%'};return _0x3e5006;})});}_0xc5bdc7=_['merge']({},_0xc5bdc7,_0xa62cac[_0x85b3('0x42')]);return db['JscriptyQuestionReport']['count']({'where':_0xc5bdc7[_0x85b3('0x39')]})['then'](function(_0x5901b2){_0x4fc0f4[_0x85b3('0x1c')]=_0x5901b2;if(_0xa62cac['query']['includeAll']){_0xc5bdc7[_0x85b3('0x3c')]=[{'all':!![]}];}return db[_0x85b3('0x49')]['findAll'](_0xc5bdc7);})[_0x85b3('0x22')](function(_0x3e9963){_0x4fc0f4[_0x85b3('0x3f')]=_0x3e9963;return _0x4fc0f4;});}})[_0x85b3('0x22')](respondWithFilteredResult(_0x5b72db,_0xc5bdc7))[_0x85b3('0x44')](handleError(_0x5b72db,null));}; \ No newline at end of file +var _0xb886=['key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','params','create','body','find','describe','getQuestions','JscriptyQuestionReport','SessionId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x1b736a,_0x3ddec4){var _0x557e9a=function(_0x340fbb){while(--_0x340fbb){_0x1b736a['push'](_0x1b736a['shift']());}};_0x557e9a(++_0x3ddec4);}(_0xb886,0xbd));var _0x6b88=function(_0x12ce6b,_0x3e38d9){_0x12ce6b=_0x12ce6b-0x0;var _0x37f604=_0xb886[_0x12ce6b];return _0x37f604;};'use strict';var emlformat=require(_0x6b88('0x0'));var rimraf=require(_0x6b88('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b88('0x2'));var rp=require(_0x6b88('0x3'));var moment=require(_0x6b88('0x4'));var BPromise=require(_0x6b88('0x5'));var Mustache=require('mustache');var util=require(_0x6b88('0x6'));var path=require(_0x6b88('0x7'));var sox=require(_0x6b88('0x8'));var csv=require(_0x6b88('0x9'));var ejs=require(_0x6b88('0xa'));var fs=require('fs');var fs_extra=require(_0x6b88('0xb'));var _=require('lodash');var squel=require(_0x6b88('0xc'));var crypto=require('crypto');var jsforce=require(_0x6b88('0xd'));var deskjs=require(_0x6b88('0xe'));var toCsv=require(_0x6b88('0x9'));var querystring=require('querystring');var Papa=require(_0x6b88('0xf'));var Redis=require('ioredis');var authService=require(_0x6b88('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6b88('0x11'));var hardwareService=require(_0x6b88('0x12'));var logger=require(_0x6b88('0x13'))(_0x6b88('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b88('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12110a,_0x15a08a){_0x15a08a=_0x15a08a||0xcc;return function(_0x2903eb){if(_0x2903eb){return _0x12110a[_0x6b88('0x16')](_0x15a08a);}return _0x12110a['status'](_0x15a08a)['end']();};}function respondWithResult(_0x227341,_0x2188bb){_0x2188bb=_0x2188bb||0xc8;return function(_0x4cbb71){if(_0x4cbb71){return _0x227341['status'](_0x2188bb)[_0x6b88('0x17')](_0x4cbb71);}};}function respondWithFilteredResult(_0x1e4781,_0x4aedd8){return function(_0x18363a){if(_0x18363a){var _0x4340eb=typeof _0x4aedd8[_0x6b88('0x18')]===_0x6b88('0x19')&&typeof _0x4aedd8[_0x6b88('0x1a')]==='undefined';var _0x327865=_0x18363a[_0x6b88('0x1b')];var _0x4b17c5=_0x4340eb?0x0:_0x4aedd8[_0x6b88('0x18')];var _0x44865d=_0x4340eb?_0x18363a[_0x6b88('0x1b')]:_0x4aedd8[_0x6b88('0x18')]+_0x4aedd8[_0x6b88('0x1a')];var _0x358d7b;if(_0x44865d>=_0x327865){_0x44865d=_0x327865;_0x358d7b=0xc8;}else{_0x358d7b=0xce;}_0x1e4781[_0x6b88('0x1c')](_0x358d7b);return _0x1e4781[_0x6b88('0x1d')](_0x6b88('0x1e'),_0x4b17c5+'-'+_0x44865d+'/'+_0x327865)['json'](_0x18363a);}return null;};}function patchUpdates(_0x3ce50f){return function(_0x4317f7){try{jsonpatch['apply'](_0x4317f7,_0x3ce50f,!![]);}catch(_0x12c1fd){return BPromise[_0x6b88('0x1f')](_0x12c1fd);}return _0x4317f7[_0x6b88('0x20')]();};}function saveUpdates(_0x4b6080,_0x4dc307){return function(_0x59c726){if(_0x59c726){return _0x59c726[_0x6b88('0x21')](_0x4b6080)[_0x6b88('0x22')](function(_0x2db1af){return _0x2db1af;});}return null;};}function removeEntity(_0x385007,_0x86a999){return function(_0xfe46d2){if(_0xfe46d2){return _0xfe46d2[_0x6b88('0x23')]()[_0x6b88('0x22')](function(){_0x385007[_0x6b88('0x1c')](0xcc)[_0x6b88('0x24')]();});}};}function handleEntityNotFound(_0x44dc9f,_0x4a7ea8){return function(_0x279d63){if(!_0x279d63){_0x44dc9f[_0x6b88('0x16')](0x194);}return _0x279d63;};}function handleError(_0x34edb1,_0x42559d){_0x42559d=_0x42559d||0x1f4;return function(_0x251213){logger[_0x6b88('0x25')](_0x251213[_0x6b88('0x26')]);if(_0x251213['name']){delete _0x251213[_0x6b88('0x27')];}_0x34edb1[_0x6b88('0x1c')](_0x42559d)['send'](_0x251213);};}exports[_0x6b88('0x28')]=function(_0x1a3471,_0x5db09c){var _0x2e8312={},_0x1f6689={},_0x32bd00={'count':0x0,'rows':[]};var _0x55a00c=_[_0x6b88('0x29')](db['JscriptySessionReport'][_0x6b88('0x2a')],function(_0x31a530){return{'name':_0x31a530[_0x6b88('0x2b')],'type':_0x31a530[_0x6b88('0x2c')][_0x6b88('0x2d')]};});_0x1f6689[_0x6b88('0x2e')]=_[_0x6b88('0x29')](_0x55a00c,_0x6b88('0x27'));_0x1f6689[_0x6b88('0x2f')]=_[_0x6b88('0x30')](_0x1a3471[_0x6b88('0x2f')]);_0x1f6689['filters']=_[_0x6b88('0x31')](_0x1f6689['model'],_0x1f6689[_0x6b88('0x2f')]);_0x2e8312[_0x6b88('0x32')]=_['intersection'](_0x1f6689[_0x6b88('0x2e')],qs[_0x6b88('0x33')](_0x1a3471[_0x6b88('0x2f')]['fields']));_0x2e8312['attributes']=_0x2e8312[_0x6b88('0x32')][_0x6b88('0x34')]?_0x2e8312[_0x6b88('0x32')]:_0x1f6689[_0x6b88('0x2e')];if(!_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x35')](_0x6b88('0x36'))){_0x2e8312[_0x6b88('0x1a')]=qs[_0x6b88('0x1a')](_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x1a')]);_0x2e8312['offset']=qs[_0x6b88('0x18')](_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x18')]);}_0x2e8312[_0x6b88('0x37')]=qs[_0x6b88('0x38')](_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x38')]);_0x2e8312[_0x6b88('0x39')]=qs[_0x6b88('0x3a')](_[_0x6b88('0x3b')](_0x1a3471[_0x6b88('0x2f')],_0x1f6689[_0x6b88('0x3a')]),_0x55a00c);if(_0x1a3471['query'][_0x6b88('0x3c')]){_0x2e8312[_0x6b88('0x39')]=_[_0x6b88('0x3d')](_0x2e8312[_0x6b88('0x39')],{'$or':_[_0x6b88('0x29')](_0x55a00c,function(_0x376927){if(_0x376927[_0x6b88('0x2c')]!==_0x6b88('0x3e')){var _0x1d24bc={};_0x1d24bc[_0x376927[_0x6b88('0x27')]]={'$like':'%'+_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x3c')]+'%'};return _0x1d24bc;}})});}_0x2e8312=_[_0x6b88('0x3d')]({},_0x2e8312,_0x1a3471[_0x6b88('0x3f')]);var _0x8fea33={'where':_0x2e8312['where']};return db[_0x6b88('0x40')][_0x6b88('0x1b')](_0x8fea33)[_0x6b88('0x22')](function(_0x758836){_0x32bd00[_0x6b88('0x1b')]=_0x758836;if(_0x1a3471[_0x6b88('0x2f')][_0x6b88('0x41')]){_0x2e8312[_0x6b88('0x42')]=[{'all':!![]}];}return db[_0x6b88('0x40')][_0x6b88('0x43')](_0x2e8312);})[_0x6b88('0x22')](function(_0x58c3fc){_0x32bd00[_0x6b88('0x44')]=_0x58c3fc;return _0x32bd00;})[_0x6b88('0x22')](respondWithFilteredResult(_0x5db09c,_0x2e8312))[_0x6b88('0x45')](handleError(_0x5db09c,null));};exports['show']=function(_0x5b3846,_0x5b0308){var _0x45805b={'raw':!![],'where':{'id':_0x5b3846[_0x6b88('0x46')]['id']}},_0x3f4b97={};_0x3f4b97['model']=_['keys'](db[_0x6b88('0x40')][_0x6b88('0x2a')]);_0x3f4b97['query']=_[_0x6b88('0x30')](_0x5b3846[_0x6b88('0x2f')]);_0x3f4b97[_0x6b88('0x3a')]=_[_0x6b88('0x31')](_0x3f4b97[_0x6b88('0x2e')],_0x3f4b97['query']);_0x45805b[_0x6b88('0x32')]=_[_0x6b88('0x31')](_0x3f4b97[_0x6b88('0x2e')],qs[_0x6b88('0x33')](_0x5b3846['query'][_0x6b88('0x33')]));_0x45805b[_0x6b88('0x32')]=_0x45805b[_0x6b88('0x32')]['length']?_0x45805b[_0x6b88('0x32')]:_0x3f4b97['model'];if(_0x5b3846[_0x6b88('0x2f')][_0x6b88('0x41')]){_0x45805b[_0x6b88('0x42')]=[{'all':!![]}];}_0x45805b=_[_0x6b88('0x3d')]({},_0x45805b,_0x5b3846[_0x6b88('0x3f')]);return db[_0x6b88('0x40')]['find'](_0x45805b)[_0x6b88('0x22')](handleEntityNotFound(_0x5b0308,null))[_0x6b88('0x22')](respondWithResult(_0x5b0308,null))['catch'](handleError(_0x5b0308,null));};exports['create']=function(_0x35581b,_0x1a7ca7){return db[_0x6b88('0x40')][_0x6b88('0x47')](_0x35581b['body'],{})[_0x6b88('0x22')](respondWithResult(_0x1a7ca7,0xc9))[_0x6b88('0x45')](handleError(_0x1a7ca7,null));};exports['update']=function(_0x1569f4,_0x46b3ba){if(_0x1569f4[_0x6b88('0x48')]['id']){delete _0x1569f4[_0x6b88('0x48')]['id'];}return db[_0x6b88('0x40')]['find']({'where':{'id':_0x1569f4['params']['id']}})[_0x6b88('0x22')](handleEntityNotFound(_0x46b3ba,null))[_0x6b88('0x22')](saveUpdates(_0x1569f4['body'],null))['then'](respondWithResult(_0x46b3ba,null))[_0x6b88('0x45')](handleError(_0x46b3ba,null));};exports[_0x6b88('0x23')]=function(_0xd5dea3,_0x431cba){return db['JscriptySessionReport'][_0x6b88('0x49')]({'where':{'id':_0xd5dea3[_0x6b88('0x46')]['id']}})['then'](handleEntityNotFound(_0x431cba,null))['then'](removeEntity(_0x431cba,null))['catch'](handleError(_0x431cba,null));};exports[_0x6b88('0x4a')]=function(_0x94afd8,_0x317759){return db[_0x6b88('0x40')][_0x6b88('0x4a')]()[_0x6b88('0x22')](respondWithResult(_0x317759,null))[_0x6b88('0x45')](handleError(_0x317759,null));};exports[_0x6b88('0x4b')]=function(_0x1d00b9,_0x2c8c9b,_0x4c5791){var _0x87b933={'raw':!![],'where':{}};var _0x267314={};var _0x3766c5={'count':0x0,'rows':[]};return db[_0x6b88('0x40')]['findOne']({'where':{'id':_0x1d00b9[_0x6b88('0x46')]['id']}})[_0x6b88('0x22')](handleEntityNotFound(_0x2c8c9b,null))[_0x6b88('0x22')](function(_0x420db1){if(_0x420db1){_0x267314[_0x6b88('0x2e')]=_[_0x6b88('0x30')](db[_0x6b88('0x4c')][_0x6b88('0x2a')]);_0x267314[_0x6b88('0x2f')]=_[_0x6b88('0x30')](_0x1d00b9[_0x6b88('0x2f')]);_0x267314['filters']=_[_0x6b88('0x31')](_0x267314[_0x6b88('0x2e')],_0x267314[_0x6b88('0x2f')]);_0x87b933[_0x6b88('0x32')]=_[_0x6b88('0x31')](_0x267314[_0x6b88('0x2e')],qs[_0x6b88('0x33')](_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x33')]));_0x87b933[_0x6b88('0x32')]=_0x87b933[_0x6b88('0x32')][_0x6b88('0x34')]?_0x87b933[_0x6b88('0x32')]:_0x267314['model'];if(!_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x35')](_0x6b88('0x36'))){_0x87b933[_0x6b88('0x1a')]=qs[_0x6b88('0x1a')](_0x1d00b9['query'][_0x6b88('0x1a')]);_0x87b933[_0x6b88('0x18')]=qs['offset'](_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x18')]);}_0x87b933[_0x6b88('0x37')]=qs[_0x6b88('0x38')](_0x1d00b9[_0x6b88('0x2f')]['sort']);_0x87b933[_0x6b88('0x39')]=qs[_0x6b88('0x3a')](_['pick'](_0x1d00b9[_0x6b88('0x2f')],_0x267314['filters']));_0x87b933[_0x6b88('0x39')][_0x6b88('0x4d')]=_0x420db1['id'];if(_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x3c')]){_0x87b933[_0x6b88('0x39')]=_[_0x6b88('0x3d')](_0x87b933[_0x6b88('0x39')],{'$or':_[_0x6b88('0x29')](_0x87b933[_0x6b88('0x32')],function(_0x9a0b0){var _0x413d88={};_0x413d88[_0x9a0b0]={'$like':'%'+_0x1d00b9[_0x6b88('0x2f')][_0x6b88('0x3c')]+'%'};return _0x413d88;})});}_0x87b933=_[_0x6b88('0x3d')]({},_0x87b933,_0x1d00b9['options']);return db[_0x6b88('0x4c')][_0x6b88('0x1b')]({'where':_0x87b933[_0x6b88('0x39')]})[_0x6b88('0x22')](function(_0x4ffcdb){_0x3766c5['count']=_0x4ffcdb;if(_0x1d00b9['query'][_0x6b88('0x41')]){_0x87b933[_0x6b88('0x42')]=[{'all':!![]}];}return db[_0x6b88('0x4c')][_0x6b88('0x43')](_0x87b933);})[_0x6b88('0x22')](function(_0x13a60b){_0x3766c5[_0x6b88('0x44')]=_0x13a60b;return _0x3766c5;});}})[_0x6b88('0x22')](respondWithFilteredResult(_0x2c8c9b,_0x87b933))['catch'](handleError(_0x2c8c9b,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index cfd46af..9059bfa 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 _0x038b=['report_jscripty_sessions','util','../../config/logger','api','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x32ab8d,_0x25bfc6){var _0x27953b=function(_0xf7bbfe){while(--_0xf7bbfe){_0x32ab8d['push'](_0x32ab8d['shift']());}};_0x27953b(++_0x25bfc6);}(_0x038b,0x114));var _0xb038=function(_0x20af90,_0x48e126){_0x20af90=_0x20af90-0x0;var _0x292fa2=_0x038b[_0x20af90];return _0x292fa2;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb66=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xcb66,0x19f));var _0x6cb6=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0xcb66[_0x5c78d9];return _0x69ae1f;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var logger=require(_0x6cb6('0x1'))(_0x6cb6('0x2'));var moment=require(_0x6cb6('0x3'));var BPromise=require(_0x6cb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb6('0x5'));var rimraf=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var attributes=require(_0x6cb6('0x8'));module[_0x6cb6('0x9')]=function(_0x506d14,_0x53078d){return _0x506d14[_0x6cb6('0xa')](_0x6cb6('0xb'),attributes,{'tableName':_0x6cb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index f8b6715..64cd121 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 _0x9582=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4d99b0,_0x1f7565){var _0x57ad78=function(_0x21f1a5){while(--_0x21f1a5){_0x4d99b0['push'](_0x4d99b0['shift']());}};_0x57ad78(++_0x1f7565);}(_0x9582,0x95));var _0x2958=function(_0x12d042,_0x3316d5){_0x12d042=_0x12d042-0x0;var _0x57f951=_0x9582[_0x12d042];return _0x57f951;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});} \ No newline at end of file +var _0x1967=['then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x1967,0x173));var _0x7196=function(_0x560945,_0x5a2a1d){_0x560945=_0x560945-0x0;var _0x2a21c7=_0x1967[_0x560945];return _0x2a21c7;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5bebd74..05898e8 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 _0x12f5=['get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b434d,_0x58c6f7){var _0x29e492=function(_0x27ef49){while(--_0x27ef49){_0x2b434d['push'](_0x2b434d['shift']());}};_0x29e492(++_0x58c6f7);}(_0x12f5,0x171));var _0x512f=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x12f5[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require(_0x512f('0x0'));var path=require(_0x512f('0x1'));var timeout=require('connect-timeout');var express=require(_0x512f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x512f('0x3'));var interaction=require(_0x512f('0x4'));var config=require(_0x512f('0x5'));var controller=require('./license.controller');router[_0x512f('0x6')]('/',controller[_0x512f('0x7')]);router[_0x512f('0x8')](_0x512f('0x9'),auth[_0x512f('0xa')](),controller[_0x512f('0xb')]);router[_0x512f('0x6')](_0x512f('0xc'),auth[_0x512f('0xa')](),controller[_0x512f('0xd')]);module[_0x512f('0xe')]=router; \ No newline at end of file +var _0xc578=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','/:id','/download_log_file','isAuthenticated','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x126bb6,_0x3ca06d){var _0x9dd2d2=function(_0x545c26){while(--_0x545c26){_0x126bb6['push'](_0x126bb6['shift']());}};_0x9dd2d2(++_0x3ca06d);}(_0xc578,0x89));var _0x8c57=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xc578[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0x8c57('0x0'));var util=require(_0x8c57('0x1'));var path=require(_0x8c57('0x2'));var timeout=require(_0x8c57('0x3'));var express=require(_0x8c57('0x4'));var router=express[_0x8c57('0x5')]();var fs_extra=require(_0x8c57('0x6'));var auth=require(_0x8c57('0x7'));var interaction=require(_0x8c57('0x8'));var config=require(_0x8c57('0x9'));var controller=require(_0x8c57('0xa'));router[_0x8c57('0xb')]('/',controller[_0x8c57('0xc')]);router['put'](_0x8c57('0xd'),auth['isAuthenticated'](),controller['update']);router['get'](_0x8c57('0xe'),auth[_0x8c57('0xf')](),controller[_0x8c57('0x10')]);module[_0x8c57('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0791dfc..d0505e4 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 _0x9fa9=['INTEGER','exports','TEXT','STRING'];(function(_0x2f375c,_0x534764){var _0x22c4f8=function(_0x20bec3){while(--_0x20bec3){_0x2f375c['push'](_0x2f375c['shift']());}};_0x22c4f8(++_0x534764);}(_0x9fa9,0x195));var _0x99fa=function(_0x599c3e,_0x28796c){_0x599c3e=_0x599c3e-0x0;var _0x244fe6=_0x9fa9[_0x599c3e];return _0x244fe6;};'use strict';var Sequelize=require('sequelize');module[_0x99fa('0x0')]={'license':{'type':Sequelize[_0x99fa('0x1')]},'data1':{'type':Sequelize[_0x99fa('0x2')]},'data2':{'type':Sequelize[_0x99fa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x99fa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x04ab=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x46f623,_0x3aa940){var _0x575d0d=function(_0x2731e7){while(--_0x2731e7){_0x46f623['push'](_0x46f623['shift']());}};_0x575d0d(++_0x3aa940);}(_0x04ab,0xfe));var _0xb04a=function(_0x483e00,_0x4bc2db){_0x483e00=_0x483e00-0x0;var _0x53b424=_0x04ab[_0x483e00];return _0x53b424;};'use strict';var Sequelize=require(_0xb04a('0x0'));module[_0xb04a('0x1')]={'license':{'type':Sequelize[_0xb04a('0x2')]},'data1':{'type':Sequelize[_0xb04a('0x3')]},'data2':{'type':Sequelize[_0xb04a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xb04a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 3cf2f3a..6abf697 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 _0x71e7=['download','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','end','error','name','send','index','model','keys','License','rawAttributes','query','attributes','intersection','fields','length','merge','options','getLicense','catch','body','get','key','demo','downloadLogFile','license-info.log','join','/var','log','setHeader','Content-Type','text/plain'];(function(_0x4591db,_0x24c100){var _0x244255=function(_0x1c3a71){while(--_0x1c3a71){_0x4591db['push'](_0x4591db['shift']());}};_0x244255(++_0x24c100);}(_0x71e7,0x14b));var _0x771e=function(_0x1bea9e,_0x258985){_0x1bea9e=_0x1bea9e-0x0;var _0xafd9be=_0x71e7[_0x1bea9e];return _0xafd9be;};'use strict';var emlformat=require(_0x771e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x771e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x771e('0x2'));var moment=require(_0x771e('0x3'));var BPromise=require(_0x771e('0x4'));var Mustache=require(_0x771e('0x5'));var util=require('util');var path=require(_0x771e('0x6'));var sox=require('sox');var csv=require(_0x771e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x771e('0x8'));var squel=require(_0x771e('0x9'));var crypto=require(_0x771e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x771e('0xb'));var toCsv=require(_0x771e('0x7'));var querystring=require('querystring');var Papa=require(_0x771e('0xc'));var Redis=require(_0x771e('0xd'));var authService=require(_0x771e('0xe'));var qs=require(_0x771e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x771e('0x10'));var logger=require(_0x771e('0x11'))('api');var utils=require(_0x771e('0x12'));var config=require(_0x771e('0x13'));var licenseUtil=require(_0x771e('0x14'));var db=require(_0x771e('0x15'))['db'];function respondWithStatusCode(_0x265581,_0x17660d){_0x17660d=_0x17660d||0xcc;return function(_0xe68376){if(_0xe68376){return _0x265581[_0x771e('0x16')](_0x17660d);}return _0x265581[_0x771e('0x17')](_0x17660d)['end']();};}function respondWithResult(_0x363f18,_0x11004f){_0x11004f=_0x11004f||0xc8;return function(_0x50f0e6){if(_0x50f0e6){return _0x363f18[_0x771e('0x17')](_0x11004f)[_0x771e('0x18')](_0x50f0e6);}};}function respondWithFilteredResult(_0x259f42,_0xe3e628){return function(_0x1f658f){if(_0x1f658f){var _0x1ef3bf=typeof _0xe3e628[_0x771e('0x19')]===_0x771e('0x1a')&&typeof _0xe3e628['limit']===_0x771e('0x1a');var _0x143ad5=_0x1f658f[_0x771e('0x1b')];var _0x19e37d=_0x1ef3bf?0x0:_0xe3e628[_0x771e('0x19')];var _0xdf6ae4=_0x1ef3bf?_0x1f658f[_0x771e('0x1b')]:_0xe3e628[_0x771e('0x19')]+_0xe3e628[_0x771e('0x1c')];var _0x28a3d1;if(_0xdf6ae4>=_0x143ad5){_0xdf6ae4=_0x143ad5;_0x28a3d1=0xc8;}else{_0x28a3d1=0xce;}_0x259f42[_0x771e('0x17')](_0x28a3d1);return _0x259f42[_0x771e('0x1d')]('Content-Range',_0x19e37d+'-'+_0xdf6ae4+'/'+_0x143ad5)[_0x771e('0x18')](_0x1f658f);}return null;};}function patchUpdates(_0x112fea){return function(_0xa26e06){try{jsonpatch[_0x771e('0x1e')](_0xa26e06,_0x112fea,!![]);}catch(_0x1c5128){return BPromise[_0x771e('0x1f')](_0x1c5128);}return _0xa26e06['save']();};}function saveUpdates(_0x586918,_0x1bc4b6){return function(_0x389fe9){if(_0x389fe9){return _0x389fe9[_0x771e('0x20')](_0x586918)[_0x771e('0x21')](function(_0x17e1c6){return _0x17e1c6;});}return null;};}function removeEntity(_0x541521,_0x3a816e){return function(_0x5bfbdf){if(_0x5bfbdf){return _0x5bfbdf[_0x771e('0x22')]()[_0x771e('0x21')](function(){_0x541521[_0x771e('0x17')](0xcc)[_0x771e('0x23')]();});}};}function handleEntityNotFound(_0x468fb7,_0x2515df){return function(_0x1e6c74){if(!_0x1e6c74){_0x468fb7[_0x771e('0x16')](0x194);}return _0x1e6c74;};}function handleError(_0x16ebcd,_0x207467){_0x207467=_0x207467||0x1f4;return function(_0x2dcd6b){logger[_0x771e('0x24')](_0x2dcd6b['stack']);if(_0x2dcd6b[_0x771e('0x25')]){delete _0x2dcd6b['name'];}_0x16ebcd['status'](_0x207467)[_0x771e('0x26')](_0x2dcd6b);};}var utilLicense=require(_0x771e('0x14'));exports[_0x771e('0x27')]=function(_0x5973a9,_0x1bb8cc){var _0x3a1d6f={'raw':!![],'where':{'id':0x1}},_0x4575db={};_0x4575db[_0x771e('0x28')]=_[_0x771e('0x29')](db[_0x771e('0x2a')][_0x771e('0x2b')]);_0x4575db[_0x771e('0x2c')]=_[_0x771e('0x29')](_0x5973a9[_0x771e('0x2c')]);_0x4575db['filters']=_['intersection'](_0x4575db[_0x771e('0x28')],_0x4575db['query']);_0x3a1d6f[_0x771e('0x2d')]=_[_0x771e('0x2e')](_0x4575db[_0x771e('0x28')],qs[_0x771e('0x2f')](_0x5973a9[_0x771e('0x2c')][_0x771e('0x2f')]));_0x3a1d6f['attributes']=_0x3a1d6f[_0x771e('0x2d')][_0x771e('0x30')]?_0x3a1d6f['attributes']:_0x4575db['model'];_0x3a1d6f=_[_0x771e('0x31')]({},_0x3a1d6f,_0x5973a9[_0x771e('0x32')]);return utilLicense[_0x771e('0x33')](_0x3a1d6f)[_0x771e('0x21')](respondWithResult(_0x1bb8cc,null))[_0x771e('0x34')](handleError(_0x1bb8cc,null));};exports[_0x771e('0x20')]=function(_0x425907,_0x63ccb){if(_0x425907[_0x771e('0x35')]['id']){delete _0x425907[_0x771e('0x35')]['id'];}return db[_0x771e('0x2a')]['find']({'where':{'id':_0x425907['params']['id']}})[_0x771e('0x21')](handleEntityNotFound(_0x63ccb,null))[_0x771e('0x21')](function(_0x4728f1){var _0x2581b6=_0x4728f1[_0x771e('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x2581b6,_0x425907['body'][_0x771e('0x37')]);})[_0x771e('0x21')](function(_0x1a3255){if(!_0x1a3255[_0x771e('0x38')]){return saveUpdates(_0x425907[_0x771e('0x35')],null);}return _0x1a3255;})[_0x771e('0x21')](respondWithResult(_0x63ccb,null))[_0x771e('0x34')](handleError(_0x63ccb,null));};exports[_0x771e('0x39')]=function(_0x39d78c,_0x1da293){var _0x587f13=_0x771e('0x3a');var _0x576924=path[_0x771e('0x3b')](_0x771e('0x3c'),_0x771e('0x3d'),'xcally',_0x587f13);_0x1da293[_0x771e('0x3e')]('Content-disposition','attachment;\x20filename='+_0x587f13);_0x1da293[_0x771e('0x1d')](_0x771e('0x3f'),_0x771e('0x40'));_0x1da293[_0x771e('0x41')](_0x576924);}; \ No newline at end of file +var _0x876a=['index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','update','body','find','params','get','key','demo','license-info.log','join','xcally','setHeader','Content-disposition','Content-Type','text/plain','download','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','../../config/license/util'];(function(_0x1da9d5,_0x847c97){var _0x34b30e=function(_0x56a4f4){while(--_0x56a4f4){_0x1da9d5['push'](_0x1da9d5['shift']());}};_0x34b30e(++_0x847c97);}(_0x876a,0xe2));var _0xa876=function(_0x5e20df,_0x353238){_0x5e20df=_0x5e20df-0x0;var _0x5750f0=_0x876a[_0x5e20df];return _0x5750f0;};'use strict';var emlformat=require(_0xa876('0x0'));var rimraf=require(_0xa876('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa876('0x2'));var moment=require(_0xa876('0x3'));var BPromise=require(_0xa876('0x4'));var Mustache=require(_0xa876('0x5'));var util=require(_0xa876('0x6'));var path=require(_0xa876('0x7'));var sox=require('sox');var csv=require(_0xa876('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa876('0x9'));var _=require(_0xa876('0xa'));var squel=require(_0xa876('0xb'));var crypto=require(_0xa876('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa876('0xd'));var toCsv=require(_0xa876('0x8'));var querystring=require(_0xa876('0xe'));var Papa=require('papaparse');var Redis=require(_0xa876('0xf'));var authService=require(_0xa876('0x10'));var qs=require(_0xa876('0x11'));var as=require(_0xa876('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa876('0x13'));var utils=require(_0xa876('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa876('0x15'))['db'];function respondWithStatusCode(_0x4cda82,_0x54be95){_0x54be95=_0x54be95||0xcc;return function(_0x1d954f){if(_0x1d954f){return _0x4cda82[_0xa876('0x16')](_0x54be95);}return _0x4cda82[_0xa876('0x17')](_0x54be95)['end']();};}function respondWithResult(_0x2ee851,_0xe37f3b){_0xe37f3b=_0xe37f3b||0xc8;return function(_0x45a8ef){if(_0x45a8ef){return _0x2ee851[_0xa876('0x17')](_0xe37f3b)['json'](_0x45a8ef);}};}function respondWithFilteredResult(_0x97abcc,_0x4feb6e){return function(_0x460ded){if(_0x460ded){var _0x5285ed=typeof _0x4feb6e[_0xa876('0x18')]===_0xa876('0x19')&&typeof _0x4feb6e[_0xa876('0x1a')]===_0xa876('0x19');var _0x3e945a=_0x460ded[_0xa876('0x1b')];var _0x1aa332=_0x5285ed?0x0:_0x4feb6e[_0xa876('0x18')];var _0x2e7d35=_0x5285ed?_0x460ded['count']:_0x4feb6e[_0xa876('0x18')]+_0x4feb6e['limit'];var _0x3bc1d6;if(_0x2e7d35>=_0x3e945a){_0x2e7d35=_0x3e945a;_0x3bc1d6=0xc8;}else{_0x3bc1d6=0xce;}_0x97abcc[_0xa876('0x17')](_0x3bc1d6);return _0x97abcc[_0xa876('0x1c')](_0xa876('0x1d'),_0x1aa332+'-'+_0x2e7d35+'/'+_0x3e945a)['json'](_0x460ded);}return null;};}function patchUpdates(_0x4ef202){return function(_0x3faf31){try{jsonpatch['apply'](_0x3faf31,_0x4ef202,!![]);}catch(_0x42c42e){return BPromise['reject'](_0x42c42e);}return _0x3faf31[_0xa876('0x1e')]();};}function saveUpdates(_0x21f80a,_0x4c1397){return function(_0x17118a){if(_0x17118a){return _0x17118a['update'](_0x21f80a)[_0xa876('0x1f')](function(_0x1e3b19){return _0x1e3b19;});}return null;};}function removeEntity(_0x2445be,_0x46fc5b){return function(_0x79484){if(_0x79484){return _0x79484[_0xa876('0x20')]()[_0xa876('0x1f')](function(){_0x2445be[_0xa876('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19092f,_0x597a33){return function(_0x5839c4){if(!_0x5839c4){_0x19092f[_0xa876('0x16')](0x194);}return _0x5839c4;};}function handleError(_0x45ca1e,_0x45539a){_0x45539a=_0x45539a||0x1f4;return function(_0x2cfc3e){logger[_0xa876('0x21')](_0x2cfc3e[_0xa876('0x22')]);if(_0x2cfc3e['name']){delete _0x2cfc3e[_0xa876('0x23')];}_0x45ca1e[_0xa876('0x17')](_0x45539a)[_0xa876('0x24')](_0x2cfc3e);};}var utilLicense=require(_0xa876('0x25'));exports[_0xa876('0x26')]=function(_0x41aa8c,_0x5d28a3){var _0x4ee8eb={'raw':!![],'where':{'id':0x1}},_0x8cd85b={};_0x8cd85b[_0xa876('0x27')]=_[_0xa876('0x28')](db[_0xa876('0x29')][_0xa876('0x2a')]);_0x8cd85b[_0xa876('0x2b')]=_[_0xa876('0x28')](_0x41aa8c[_0xa876('0x2b')]);_0x8cd85b[_0xa876('0x2c')]=_[_0xa876('0x2d')](_0x8cd85b[_0xa876('0x27')],_0x8cd85b[_0xa876('0x2b')]);_0x4ee8eb[_0xa876('0x2e')]=_[_0xa876('0x2d')](_0x8cd85b['model'],qs[_0xa876('0x2f')](_0x41aa8c[_0xa876('0x2b')][_0xa876('0x2f')]));_0x4ee8eb[_0xa876('0x2e')]=_0x4ee8eb[_0xa876('0x2e')][_0xa876('0x30')]?_0x4ee8eb[_0xa876('0x2e')]:_0x8cd85b[_0xa876('0x27')];_0x4ee8eb=_['merge']({},_0x4ee8eb,_0x41aa8c[_0xa876('0x31')]);return utilLicense[_0xa876('0x32')](_0x4ee8eb)[_0xa876('0x1f')](respondWithResult(_0x5d28a3,null))['catch'](handleError(_0x5d28a3,null));};exports[_0xa876('0x33')]=function(_0x12949f,_0x4c4434){if(_0x12949f[_0xa876('0x34')]['id']){delete _0x12949f[_0xa876('0x34')]['id'];}return db[_0xa876('0x29')][_0xa876('0x35')]({'where':{'id':_0x12949f[_0xa876('0x36')]['id']}})[_0xa876('0x1f')](handleEntityNotFound(_0x4c4434,null))[_0xa876('0x1f')](function(_0xec86cf){var _0x1244fb=_0xec86cf[_0xa876('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x1244fb,_0x12949f[_0xa876('0x34')][_0xa876('0x38')]);})[_0xa876('0x1f')](function(_0x269059){if(!_0x269059[_0xa876('0x39')]){return saveUpdates(_0x12949f[_0xa876('0x34')],null);}return _0x269059;})[_0xa876('0x1f')](respondWithResult(_0x4c4434,null))['catch'](handleError(_0x4c4434,null));};exports['downloadLogFile']=function(_0x2d4550,_0x44436b){var _0x28710d=_0xa876('0x3a');var _0x26c11f=path[_0xa876('0x3b')]('/var','log',_0xa876('0x3c'),_0x28710d);_0x44436b[_0xa876('0x3d')](_0xa876('0x3e'),'attachment;\x20filename='+_0x28710d);_0x44436b[_0xa876('0x1c')](_0xa876('0x3f'),_0xa876('0x40'));_0x44436b[_0xa876('0x41')](_0x26c11f);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f7b0d96..2739f7c 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 _0xb460=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','moment'];(function(_0x107581,_0x395d26){var _0x24ca48=function(_0x49f5a6){while(--_0x49f5a6){_0x107581['push'](_0x107581['shift']());}};_0x24ca48(++_0x395d26);}(_0xb460,0x1a9));var _0x0b46=function(_0x448510,_0x16fa6c){_0x448510=_0x448510-0x0;var _0x552a06=_0xb460[_0x448510];return _0x552a06;};'use strict';var _=require(_0x0b46('0x0'));var util=require(_0x0b46('0x1'));var logger=require(_0x0b46('0x2'))('api');var moment=require(_0x0b46('0x3'));var BPromise=require('bluebird');var rp=require(_0x0b46('0x4'));var fs=require('fs');var path=require(_0x0b46('0x5'));var rimraf=require(_0x0b46('0x6'));var config=require(_0x0b46('0x7'));var attributes=require(_0x0b46('0x8'));module[_0x0b46('0x9')]=function(_0x2455f0,_0x5f4592){return _0x2455f0[_0x0b46('0xa')](_0x0b46('0xb'),attributes,{'tableName':_0x0b46('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc64f=['request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','lodash','util','../../config/logger','api','moment'];(function(_0x283bc4,_0x46d959){var _0x3ef1c9=function(_0x199ed0){while(--_0x199ed0){_0x283bc4['push'](_0x283bc4['shift']());}};_0x3ef1c9(++_0x46d959);}(_0xc64f,0x1a8));var _0xfc64=function(_0x568aa5,_0x3c0edd){_0x568aa5=_0x568aa5-0x0;var _0xa935db=_0xc64f[_0x568aa5];return _0xa935db;};'use strict';var _=require(_0xfc64('0x0'));var util=require(_0xfc64('0x1'));var logger=require(_0xfc64('0x2'))(_0xfc64('0x3'));var moment=require(_0xfc64('0x4'));var BPromise=require('bluebird');var rp=require(_0xfc64('0x5'));var fs=require('fs');var path=require(_0xfc64('0x6'));var rimraf=require(_0xfc64('0x7'));var config=require(_0xfc64('0x8'));var attributes=require(_0xfc64('0x9'));module[_0xfc64('0xa')]=function(_0xc47a3d,_0x3e15a3){return _0xc47a3d[_0xfc64('0xb')](_0xfc64('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 3e90c02..6c6d0d8 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 _0x4f84=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2bf081,_0x23ca2f){var _0x19dbb0=function(_0x123f1d){while(--_0x123f1d){_0x2bf081['push'](_0x2bf081['shift']());}};_0x19dbb0(++_0x23ca2f);}(_0x4f84,0x1a3));var _0x44f8=function(_0x293caa,_0x10c8a3){_0x293caa=_0x293caa-0x0;var _0x5ec971=_0x4f84[_0x293caa];return _0x5ec971;};'use strict';var _=require(_0x44f8('0x0'));var util=require(_0x44f8('0x1'));var moment=require(_0x44f8('0x2'));var BPromise=require(_0x44f8('0x3'));var rs=require(_0x44f8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44f8('0x5'))['db'];var utils=require(_0x44f8('0x6'));var logger=require(_0x44f8('0x7'))(_0x44f8('0x8'));var config=require(_0x44f8('0x9'));var jayson=require(_0x44f8('0xa'));var client=jayson[_0x44f8('0xb')][_0x44f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x178b6b,_0x672a1c,_0x1974a6){return new BPromise(function(_0x167914,_0x24b5bf){return client[_0x44f8('0xd')](_0x178b6b,_0x1974a6)[_0x44f8('0xe')](function(_0x558c06){logger['info'](_0x44f8('0xf'),_0x672a1c,'request\x20sent');logger[_0x44f8('0x10')](_0x44f8('0x11'),_0x672a1c,_0x44f8('0x12'),JSON[_0x44f8('0x13')](_0x558c06));if(_0x558c06[_0x44f8('0x14')]){if(_0x558c06[_0x44f8('0x14')][_0x44f8('0x15')]===0x1f4){logger['error'](_0x44f8('0xf'),_0x672a1c,_0x558c06[_0x44f8('0x14')][_0x44f8('0x16')]);return _0x24b5bf(_0x558c06[_0x44f8('0x14')][_0x44f8('0x16')]);}logger[_0x44f8('0x14')]('License,\x20%s,\x20%s',_0x672a1c,_0x558c06[_0x44f8('0x14')][_0x44f8('0x16')]);return _0x167914(_0x558c06['error']['message']);}else{logger[_0x44f8('0x17')](_0x44f8('0xf'),_0x672a1c,_0x44f8('0x12'));_0x167914(_0x558c06[_0x44f8('0x18')][_0x44f8('0x16')]);}})[_0x44f8('0x19')](function(_0x59785f){logger['error'](_0x44f8('0xf'),_0x672a1c,_0x59785f);_0x24b5bf(_0x59785f);});});} \ No newline at end of file +var _0xe8a3=['debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x4a2036,_0x2e8401){var _0x46aa57=function(_0x4fbcf7){while(--_0x4fbcf7){_0x4a2036['push'](_0x4a2036['shift']());}};_0x46aa57(++_0x2e8401);}(_0xe8a3,0x93));var _0x3e8a=function(_0x15c056,_0x5bf32d){_0x15c056=_0x15c056-0x0;var _0x3838c3=_0xe8a3[_0x15c056];return _0x3838c3;};'use strict';var _=require('lodash');var util=require(_0x3e8a('0x0'));var moment=require('moment');var BPromise=require(_0x3e8a('0x1'));var rs=require(_0x3e8a('0x2'));var fs=require('fs');var Redis=require(_0x3e8a('0x3'));var db=require(_0x3e8a('0x4'))['db'];var utils=require(_0x3e8a('0x5'));var logger=require(_0x3e8a('0x6'))('rpc');var config=require(_0x3e8a('0x7'));var jayson=require(_0x3e8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff282,_0x4f98de,_0x5b07e1){return new BPromise(function(_0x35d93e,_0x568888){return client['request'](_0x4ff282,_0x5b07e1)[_0x3e8a('0x9')](function(_0x323ed0){logger[_0x3e8a('0xa')](_0x3e8a('0xb'),_0x4f98de,_0x3e8a('0xc'));logger[_0x3e8a('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x4f98de,'request\x20sent',JSON[_0x3e8a('0xe')](_0x323ed0));if(_0x323ed0[_0x3e8a('0xf')]){if(_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x10')]===0x1f4){logger['error'](_0x3e8a('0xb'),_0x4f98de,_0x323ed0['error'][_0x3e8a('0x11')]);return _0x568888(_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x11')]);}logger[_0x3e8a('0xf')](_0x3e8a('0xb'),_0x4f98de,_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x11')]);return _0x35d93e(_0x323ed0[_0x3e8a('0xf')][_0x3e8a('0x11')]);}else{logger[_0x3e8a('0xa')]('License,\x20%s,\x20%s',_0x4f98de,_0x3e8a('0xc'));_0x35d93e(_0x323ed0[_0x3e8a('0x12')][_0x3e8a('0x11')]);}})[_0x3e8a('0x13')](function(_0xc29180){logger[_0x3e8a('0xf')](_0x3e8a('0xb'),_0x4f98de,_0xc29180);_0x568888(_0xc29180);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 1d93b04..994a2f7 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 _0x2e23=['/:id/interactions','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','addImap','addInteraction','/:id/applications','/:id/send','send','delete','removeAnswers','removeImap','removeSmtp','/:id','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp'];(function(_0x3ad08b,_0x356065){var _0xc01bd6=function(_0x2ee436){while(--_0x2ee436){_0x3ad08b['push'](_0x3ad08b['shift']());}};_0xc01bd6(++_0x356065);}(_0x2e23,0x6b));var _0x32e2=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x2e23[_0x15bc81];return _0x59440e;};'use strict';var multer=require(_0x32e2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x32e2('0x1'));var express=require(_0x32e2('0x2'));var router=express['Router']();var fs_extra=require(_0x32e2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x32e2('0x4'));var config=require(_0x32e2('0x5'));var controller=require(_0x32e2('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x32e2('0x7')](_0x32e2('0x8'),auth[_0x32e2('0x9')](),controller[_0x32e2('0xa')]);router[_0x32e2('0x7')]('/:id',auth[_0x32e2('0x9')](),controller[_0x32e2('0xb')]);router[_0x32e2('0x7')](_0x32e2('0xc'),auth['isAuthenticated'](),controller[_0x32e2('0xd')]);router[_0x32e2('0x7')](_0x32e2('0xe'),auth[_0x32e2('0x9')](),controller[_0x32e2('0xf')]);router[_0x32e2('0x7')](_0x32e2('0x10'),auth[_0x32e2('0x9')](),controller['getImap']);router[_0x32e2('0x7')](_0x32e2('0x11'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x12')]);router['get'](_0x32e2('0x13'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x14')]);router[_0x32e2('0x7')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x32e2('0x7')](_0x32e2('0x15'),auth['isAuthenticated'](),controller[_0x32e2('0x16')]);router['get'](_0x32e2('0x17'),auth['isAuthenticated'](),controller[_0x32e2('0x18')]);router[_0x32e2('0x7')](_0x32e2('0x19'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x1a')]);router['post'](_0x32e2('0xc'),auth['isAuthenticated'](),controller[_0x32e2('0x1b')]);router[_0x32e2('0x1c')](_0x32e2('0xe'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x1d')]);router[_0x32e2('0x1c')]('/',auth[_0x32e2('0x9')](),controller['create']);router[_0x32e2('0x1c')](_0x32e2('0x10'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x1e')]);router[_0x32e2('0x1c')](_0x32e2('0x11'),auth[_0x32e2('0x9')](),controller['addSmtp']);router['post'](_0x32e2('0x13'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x1f')]);router[_0x32e2('0x1c')](_0x32e2('0x20'),auth[_0x32e2('0x9')](),controller['addApplications']);router['post'](_0x32e2('0x21'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x22')]);router[_0x32e2('0x1c')]('/:id/users',auth[_0x32e2('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x32e2('0x9')](),controller['update']);router[_0x32e2('0x23')](_0x32e2('0xc'),auth[_0x32e2('0x9')](),controller['removeDispositions']);router['delete'](_0x32e2('0xe'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x24')]);router['delete'](_0x32e2('0x10'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x25')]);router[_0x32e2('0x23')](_0x32e2('0x11'),auth[_0x32e2('0x9')](),controller[_0x32e2('0x26')]);router['delete'](_0x32e2('0x27'),auth['isAuthenticated'](),controller[_0x32e2('0x28')]);router[_0x32e2('0x23')]('/:id/users',auth[_0x32e2('0x9')](),controller['removeAgents']);module[_0x32e2('0x29')]=router; \ No newline at end of file +var _0x4900=['/:id/applications','/:id/messages','/:id/users','getAgents','/:id/dispositions','addDisposition','post','addAnswer','create','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','delete','removeDispositions','removeImap','removeSmtp','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions'];(function(_0x88f701,_0x5ed538){var _0x53bf89=function(_0x31756e){while(--_0x31756e){_0x88f701['push'](_0x88f701['shift']());}};_0x53bf89(++_0x5ed538);}(_0x4900,0x16e));var _0x0490=function(_0x3e90a2,_0x1bd9f9){_0x3e90a2=_0x3e90a2-0x0;var _0x4fe655=_0x4900[_0x3e90a2];return _0x4fe655;};'use strict';var multer=require(_0x0490('0x0'));var util=require(_0x0490('0x1'));var path=require(_0x0490('0x2'));var timeout=require('connect-timeout');var express=require(_0x0490('0x3'));var router=express[_0x0490('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0490('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0490('0x6'));var controller=require(_0x0490('0x7'));router[_0x0490('0x8')]('/',auth[_0x0490('0x9')](),controller['index']);router[_0x0490('0x8')](_0x0490('0xa'),auth['isAuthenticated'](),controller[_0x0490('0xb')]);router[_0x0490('0x8')](_0x0490('0xc'),auth[_0x0490('0x9')](),controller[_0x0490('0xd')]);router['get']('/:id/dispositions',auth[_0x0490('0x9')](),controller[_0x0490('0xe')]);router[_0x0490('0x8')](_0x0490('0xf'),auth[_0x0490('0x9')](),controller['getAnswers']);router[_0x0490('0x8')](_0x0490('0x10'),auth[_0x0490('0x9')](),controller[_0x0490('0x11')]);router[_0x0490('0x8')]('/:id/out_servers',auth[_0x0490('0x9')](),controller[_0x0490('0x12')]);router[_0x0490('0x8')](_0x0490('0x13'),auth[_0x0490('0x9')](),controller[_0x0490('0x14')]);router[_0x0490('0x8')](_0x0490('0x15'),auth[_0x0490('0x9')](),controller['getApplications']);router[_0x0490('0x8')](_0x0490('0x16'),auth[_0x0490('0x9')](),controller['getMessages']);router[_0x0490('0x8')]('/:id/verify',auth[_0x0490('0x9')](),controller['verifySmtp']);router['get'](_0x0490('0x17'),auth[_0x0490('0x9')](),controller[_0x0490('0x18')]);router['post'](_0x0490('0x19'),auth[_0x0490('0x9')](),controller[_0x0490('0x1a')]);router[_0x0490('0x1b')](_0x0490('0xf'),auth[_0x0490('0x9')](),controller[_0x0490('0x1c')]);router[_0x0490('0x1b')]('/',auth['isAuthenticated'](),controller[_0x0490('0x1d')]);router[_0x0490('0x1b')]('/:id/in_servers',auth[_0x0490('0x9')](),controller['addImap']);router[_0x0490('0x1b')](_0x0490('0x1e'),auth['isAuthenticated'](),controller[_0x0490('0x1f')]);router[_0x0490('0x1b')](_0x0490('0x13'),auth[_0x0490('0x9')](),controller[_0x0490('0x20')]);router[_0x0490('0x1b')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0490('0x21')]);router['post'](_0x0490('0x22'),auth['isAuthenticated'](),controller[_0x0490('0x23')]);router[_0x0490('0x1b')](_0x0490('0x17'),auth[_0x0490('0x9')](),controller[_0x0490('0x24')]);router['put'](_0x0490('0xc'),auth[_0x0490('0x9')](),controller['update']);router[_0x0490('0x25')](_0x0490('0x19'),auth['isAuthenticated'](),controller[_0x0490('0x26')]);router[_0x0490('0x25')]('/:id/canned_answers',auth[_0x0490('0x9')](),controller['removeAnswers']);router[_0x0490('0x25')](_0x0490('0x10'),auth[_0x0490('0x9')](),controller[_0x0490('0x27')]);router[_0x0490('0x25')](_0x0490('0x1e'),auth[_0x0490('0x9')](),controller[_0x0490('0x28')]);router['delete']('/:id',auth[_0x0490('0x9')](),controller[_0x0490('0x29')]);router[_0x0490('0x25')](_0x0490('0x17'),auth[_0x0490('0x9')](),controller['removeAgents']);module[_0x0490('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index a69b17e..06f8727 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 _0xd43c=['mandatoryDisposition','gmail','hotmail','yahoo','getDataValue','provider','custom','sequelize','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}}','setDataValue'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xd43c,0xf7));var _0xcd43=function(_0x1c4e37,_0x166cab){_0x1c4e37=_0x1c4e37-0x0;var _0x20406e=_0xd43c[_0x1c4e37];return _0x20406e;};'use strict';var Sequelize=require(_0xcd43('0x0'));module['exports']={'description':{'type':Sequelize[_0xcd43('0x1')]},'name':{'type':Sequelize[_0xcd43('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xcd43('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xcd43('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xcd43('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xcd43('0x3')]},'markAsUnread':{'type':Sequelize[_0xcd43('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xcd43('0x1')],'allowNull':![],'defaultValue':_0xcd43('0x4')},'fontSize':{'type':Sequelize[_0xcd43('0x5')](0x2)[_0xcd43('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xcd43('0x3')],'defaultValue':function(){return _0xcd43('0x7');}},'notificationSound':{'type':Sequelize[_0xcd43('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcd43('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcd43('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xcd43('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcd43('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcd43('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcd43('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcd43('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcd43('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcd43('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4edf74){if(!_0x4edf74)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xcd43('0x8')](_0xcd43('0x9'),_0x4edf74);}},'provider':{'type':Sequelize['ENUM'](_0xcd43('0xa'),_0xcd43('0xb'),_0xcd43('0xc'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0xcd43('0xd')](_0xcd43('0xe')))return _0xcd43('0xf');return this[_0xcd43('0xd')]('provider');},'set':function(_0x2d0cfa){if(_0x2d0cfa===_0xcd43('0xf'))_0x2d0cfa=null;return this[_0xcd43('0x8')](_0xcd43('0xe'),_0x2d0cfa);}}}; \ No newline at end of file +var _0xb5a9=['TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','provider','custom','getDataValue','sequelize','exports','STRING','BOOLEAN'];(function(_0x17c7f7,_0x402af8){var _0xf196dc=function(_0x381d3f){while(--_0x381d3f){_0x17c7f7['push'](_0x17c7f7['shift']());}};_0xf196dc(++_0x402af8);}(_0xb5a9,0x19e));var _0x9b5a=function(_0x3c645f,_0x512146){_0x3c645f=_0x3c645f-0x0;var _0x2e2d24=_0xb5a9[_0x3c645f];return _0x2e2d24;};'use strict';var Sequelize=require(_0x9b5a('0x0'));module[_0x9b5a('0x1')]={'description':{'type':Sequelize[_0x9b5a('0x2')]},'name':{'type':Sequelize[_0x9b5a('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9b5a('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x9b5a('0x4')]},'markAsUnread':{'type':Sequelize[_0x9b5a('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9b5a('0x2')],'allowNull':![],'defaultValue':_0x9b5a('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x9b5a('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9b5a('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9b5a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9b5a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b5a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x9b5a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1b1c7f){if(!_0x1b1c7f)this[_0x9b5a('0x9')](_0x9b5a('0xa'),null);this[_0x9b5a('0x9')](_0x9b5a('0xb'),_0x1b1c7f);}},'provider':{'type':Sequelize[_0x9b5a('0xc')](_0x9b5a('0xd'),_0x9b5a('0xe'),_0x9b5a('0xf'),'outlook365'),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x9b5a('0x10')))return _0x9b5a('0x11');return this[_0x9b5a('0x12')](_0x9b5a('0x10'));},'set':function(_0x4904d4){if(_0x4904d4===_0x9b5a('0x11'))_0x4904d4=null;return this[_0x9b5a('0x9')]('provider',_0x4904d4);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2338bc7..0cef81e 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 _0x5917=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','include','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','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','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','destroy','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','Contacts','DESC','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','verifySmtp','CloudProvider','VerifySmtp','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','client','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','update','get','MailAccounts','sendStatus','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','username','pass','modernAuthentication','CloudProviderId','password','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','model','query','keys','attributes','intersection'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x5917,0x134));var _0x7591=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5917[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x7591('0x0'));var BPromise=require('bluebird');var util=require(_0x7591('0x1'));var path=require(_0x7591('0x2'));var _=require(_0x7591('0x3'));var juice=require(_0x7591('0x4'));var Redis=require(_0x7591('0x5'));var qs=require(_0x7591('0x6'));var logger=require(_0x7591('0x7'))('api');var config=require(_0x7591('0x8'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7591('0x9')](config[_0x7591('0xa')],{'host':_0x7591('0xb'),'port':0x18eb});var socket=require(_0x7591('0xc'))(new Redis(config[_0x7591('0xa')]));require(_0x7591('0xd'))[_0x7591('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7591('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x6fb551,_0x1f6ad9,_0x31b068,_0x10e261){return new BPromise(function(_0x4b2575,_0xb0abb9){var _0x4ef15d=_0x10e261||client;return _0x4ef15d['request'](_0x6fb551,_0x31b068)[_0x7591('0x10')](function(_0x2e31e5){logger[_0x7591('0x11')](_0x7591('0x12'),_0x1f6ad9,_0x7591('0x13'));logger[_0x7591('0x14')](_0x7591('0x15'),_0x1f6ad9,'request\x20sent',JSON[_0x7591('0x16')](_0x2e31e5));if(_0x2e31e5[_0x7591('0x17')]){if(_0x2e31e5[_0x7591('0x17')][_0x7591('0x18')]===0x1f4){logger[_0x7591('0x17')](_0x7591('0x12'),_0x1f6ad9,_0x2e31e5[_0x7591('0x17')][_0x7591('0x19')]);return _0xb0abb9(_0x2e31e5[_0x7591('0x17')]['message']);}logger[_0x7591('0x17')]('MailAccount,\x20%s,\x20%s',_0x1f6ad9,_0x2e31e5['error']['message']);return _0x4b2575(_0x2e31e5['error'][_0x7591('0x19')]);}else{logger[_0x7591('0x11')](_0x7591('0x12'),_0x1f6ad9,_0x7591('0x13'));_0x4b2575(_0x2e31e5[_0x7591('0x1a')]['message']);}})[_0x7591('0x1b')](function(_0x2bdcb6){logger[_0x7591('0x17')](_0x7591('0x12'),_0x1f6ad9,_0x2bdcb6);_0xb0abb9(_0x2bdcb6);});});}function respondWithStatusCode(_0x56c27d,_0x270985){_0x270985=_0x270985||0xcc;return function(_0xabc50e){if(_0xabc50e){return _0x56c27d['sendStatus'](_0x270985);}return _0x56c27d[_0x7591('0x1c')](_0x270985)[_0x7591('0x1d')]();};}function respondWithResult(_0x45fbee,_0x5bf7a2){_0x5bf7a2=_0x5bf7a2||0xc8;return function(_0x22a59e){if(_0x22a59e){return _0x45fbee[_0x7591('0x1c')](_0x5bf7a2)[_0x7591('0x1e')](_0x22a59e);}};}function respondWithFilteredResult(_0x3e5ab2,_0x2dbda5){return function(_0xd4d48f){if(_0xd4d48f){var _0x41d2b8=typeof _0x2dbda5[_0x7591('0x1f')]===_0x7591('0x20')&&typeof _0x2dbda5[_0x7591('0x21')]===_0x7591('0x20');var _0x401535=_0xd4d48f[_0x7591('0x22')];var _0x1fc2f7=_0x41d2b8?0x0:_0x2dbda5[_0x7591('0x1f')];var _0x200719=_0x41d2b8?_0xd4d48f[_0x7591('0x22')]:_0x2dbda5[_0x7591('0x1f')]+_0x2dbda5[_0x7591('0x21')];var _0xad8992;if(_0x200719>=_0x401535){_0x200719=_0x401535;_0xad8992=0xc8;}else{_0xad8992=0xce;}_0x3e5ab2['status'](_0xad8992);return _0x3e5ab2[_0x7591('0x23')]('Content-Range',_0x1fc2f7+'-'+_0x200719+'/'+_0x401535)[_0x7591('0x1e')](_0xd4d48f);}return null;};}function saveUpdates(_0x3c211c){return function(_0x31515e){if(_0x31515e){return _0x31515e[_0x7591('0x24')](_0x3c211c)[_0x7591('0x10')](function(_0x39462b){return _0x39462b;});}return null;};}function removeEntity(_0x2544d4){return function(_0x53a44c){if(_0x53a44c){return _0x53a44c['destroy']()['then'](function(){var _0x4cb9e1=_0x53a44c[_0x7591('0x25')]({'plain':!![]});var _0x22100b=_0x7591('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x22100b,'resourceId':_0x4cb9e1['id']}})[_0x7591('0x10')](function(){return _0x53a44c;});})['then'](function(){_0x2544d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d59b){return function(_0x448c4a){if(!_0x448c4a){_0x18d59b[_0x7591('0x27')](0x194);}return _0x448c4a;};}function handleError(_0x1d794b,_0xce33d6){_0xce33d6=_0xce33d6||0x1f4;return function(_0x4e084c){logger['error'](_0x4e084c[_0x7591('0x28')]);if(_0x4e084c['name']){delete _0x4e084c[_0x7591('0x29')];}_0x1d794b[_0x7591('0x1c')](_0xce33d6)[_0x7591('0x2a')](_0x4e084c);};}function getImapHost(_0x47603b){switch(_0x47603b){case _0x7591('0x2b'):return'imap.gmail.com';case _0x7591('0x2c'):return _0x7591('0x2d');case'hotmail':return _0x7591('0x2e');case _0x7591('0x2f'):return _0x7591('0x30');}throw new Error(_0x7591('0x31'),_0x47603b);}function getSmtpHost(_0x5b87be){switch(_0x5b87be){case _0x7591('0x2b'):return'smtp.gmail.com';case _0x7591('0x2c'):return _0x7591('0x32');case _0x7591('0x33'):return _0x7591('0x34');case'outlook365':return _0x7591('0x35');}throw new Error(_0x7591('0x31'),_0x5b87be);}function getAuthenticationOptions(_0x260b37,_0x2e745a){var _0x256f84={};var _0x6ac984={};if(_0x260b37){_0x256f84[_0x7591('0x36')]=_0x6ac984[_0x7591('0x36')]=_0x2e745a[_0x7591('0x37')];_0x256f84['password']=_0x6ac984[_0x7591('0x38')]=_0x2e745a['password'];if(_0x2e745a['modernAuthentication']){_0x256f84[_0x7591('0x39')]=_0x6ac984[_0x7591('0x39')]=!![];_0x256f84[_0x7591('0x3a')]=_0x6ac984[_0x7591('0x3a')]=_0x2e745a['CloudProviderId'];_0x256f84[_0x7591('0x3b')]=_0x6ac984['pass']=null;}else{_0x256f84[_0x7591('0x3a')]=_0x6ac984['CloudProviderId']=null;}_0x256f84['host']=getImapHost(_0x260b37);_0x256f84['port']=0x3e1;_0x6ac984[_0x7591('0x3c')]=getSmtpHost(_0x260b37);_0x6ac984[_0x7591('0x3d')]=0x24b;_0x6ac984[_0x7591('0x3e')]=![];_0x256f84[_0x7591('0x3f')]=_0x6ac984[_0x7591('0x3f')]=null;}else{if(_0x2e745a[_0x7591('0x40')]){_0x256f84[_0x7591('0x36')]=_0x6ac984['user']=_0x2e745a[_0x7591('0x37')];_0x256f84['password']=_0x6ac984[_0x7591('0x38')]=_0x2e745a[_0x7591('0x3b')];}else{_0x256f84[_0x7591('0x40')]=_0x6ac984[_0x7591('0x40')]=![];_0x256f84['user']=_0x6ac984[_0x7591('0x36')]=null;_0x256f84['password']=_0x6ac984[_0x7591('0x38')]=null;}_0x256f84['host']=_0x2e745a['Imap']['host'];_0x256f84[_0x7591('0x3d')]=_0x2e745a[_0x7591('0x41')][_0x7591('0x3d')];_0x6ac984['host']=_0x2e745a['Smtp'][_0x7591('0x3c')];_0x6ac984[_0x7591('0x3d')]=_0x2e745a[_0x7591('0x42')][_0x7591('0x3d')];}return{'Imap':_0x256f84,'Smtp':_0x6ac984};}exports[_0x7591('0x43')]=function(_0x3a44be,_0x5dff84){var _0x42afc5={'include':[{'model':db[_0x7591('0x44')],'as':_0x7591('0x41')},{'model':db[_0x7591('0x45')],'as':_0x7591('0x42')},{'model':db[_0x7591('0x46')],'as':_0x7591('0x47')}]},_0x36b2c2={},_0x1991fd={'count':0x0,'rows':[]};var _0x12f6e8=_[_0x7591('0x48')](db[_0x7591('0x49')]['rawAttributes'],function(_0x33a145){return{'name':_0x33a145[_0x7591('0x4a')],'type':_0x33a145['type']['key']};});_0x36b2c2[_0x7591('0x4b')]=_[_0x7591('0x48')](_0x12f6e8,_0x7591('0x29'));_0x36b2c2[_0x7591('0x4c')]=_[_0x7591('0x4d')](_0x3a44be[_0x7591('0x4c')]);_0x36b2c2['filters']=_['intersection'](_0x36b2c2[_0x7591('0x4b')],_0x36b2c2[_0x7591('0x4c')]);_0x42afc5[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0x36b2c2[_0x7591('0x4b')],qs[_0x7591('0x50')](_0x3a44be[_0x7591('0x4c')]['fields']));_0x42afc5[_0x7591('0x4e')]=_0x42afc5['attributes'][_0x7591('0x51')]?_0x42afc5[_0x7591('0x4e')]:_0x36b2c2[_0x7591('0x4b')];if(!_0x3a44be[_0x7591('0x4c')][_0x7591('0x52')](_0x7591('0x53'))){_0x42afc5[_0x7591('0x21')]=qs['limit'](_0x3a44be[_0x7591('0x4c')][_0x7591('0x21')]);_0x42afc5[_0x7591('0x1f')]=qs[_0x7591('0x1f')](_0x3a44be['query'][_0x7591('0x1f')]);}_0x42afc5[_0x7591('0x54')]=qs['sort'](_0x3a44be[_0x7591('0x4c')][_0x7591('0x55')]);_0x42afc5[_0x7591('0x56')]=qs[_0x7591('0x57')](_['pick'](_0x3a44be['query'],_0x36b2c2[_0x7591('0x57')]),_0x12f6e8);if(_0x3a44be['query'][_0x7591('0x58')]){_0x42afc5['where']=_[_0x7591('0x59')](_0x42afc5[_0x7591('0x56')],{'$or':_['map'](_0x12f6e8,function(_0x359ac9){if(_0x359ac9['type']!==_0x7591('0x5a')){var _0x26dff1={};_0x26dff1[_0x359ac9[_0x7591('0x29')]]={'$like':'%'+_0x3a44be[_0x7591('0x4c')]['filter']+'%'};return _0x26dff1;}})});}_0x42afc5=_[_0x7591('0x59')]({},_0x42afc5,_0x3a44be[_0x7591('0x5b')]);var _0x2dfd37={'where':_0x42afc5[_0x7591('0x56')]};return db[_0x7591('0x49')][_0x7591('0x22')](_0x2dfd37)[_0x7591('0x10')](function(_0x514a83){_0x1991fd[_0x7591('0x22')]=_0x514a83;if(_0x3a44be['query'][_0x7591('0x5c')]){_0x42afc5['include']=[{'all':!![]}];}return db[_0x7591('0x49')][_0x7591('0x5d')](_0x42afc5);})[_0x7591('0x10')](function(_0x54f4a2){_0x1991fd['rows']=_0x54f4a2;return _0x1991fd;})[_0x7591('0x10')](respondWithFilteredResult(_0x5dff84,_0x42afc5))[_0x7591('0x1b')](handleError(_0x5dff84,null));};exports[_0x7591('0x5e')]=function(_0x286dd7,_0x41e150){var _0x53ea94={'raw':![],'where':{'id':_0x286dd7[_0x7591('0x5f')]['id']},'include':[{'model':db[_0x7591('0x44')],'as':'Imap'},{'model':db[_0x7591('0x45')],'as':_0x7591('0x42')},{'model':db[_0x7591('0x46')],'as':_0x7591('0x47')}]},_0xa86bc2={};_0xa86bc2[_0x7591('0x4b')]=_[_0x7591('0x4d')](db[_0x7591('0x49')][_0x7591('0x60')]);_0xa86bc2[_0x7591('0x4c')]=_['keys'](_0x286dd7[_0x7591('0x4c')]);_0xa86bc2[_0x7591('0x57')]=_[_0x7591('0x4f')](_0xa86bc2[_0x7591('0x4b')],_0xa86bc2['query']);_0x53ea94[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0xa86bc2['model'],qs[_0x7591('0x50')](_0x286dd7[_0x7591('0x4c')][_0x7591('0x50')]));_0x53ea94['attributes']=_0x53ea94[_0x7591('0x4e')][_0x7591('0x51')]?_0x53ea94[_0x7591('0x4e')]:_0xa86bc2[_0x7591('0x4b')];if(_0x286dd7[_0x7591('0x4c')][_0x7591('0x5c')]){_0x53ea94[_0x7591('0x61')]=[{'all':!![]}];}_0x53ea94=_['merge']({},_0x53ea94,_0x286dd7[_0x7591('0x5b')]);return db[_0x7591('0x49')][_0x7591('0x62')](_0x53ea94)[_0x7591('0x10')](handleEntityNotFound(_0x41e150,null))[_0x7591('0x10')](respondWithResult(_0x41e150,null))[_0x7591('0x1b')](handleError(_0x41e150,null));};exports['update']=function(_0x2c02bf,_0x3230ae){if(_0x2c02bf['body']['id']){delete _0x2c02bf[_0x7591('0x63')]['id'];}var _0xa29abc=_0x2c02bf[_0x7591('0x63')][_0x7591('0x64')]===_0x7591('0x65')?null:_0x2c02bf[_0x7591('0x63')][_0x7591('0x64')];var _0x430823=_0x2c02bf['body'][_0x7591('0x41')]||{};var _0x381893=_0x2c02bf[_0x7591('0x63')]['Smtp']||{};if(_0xa29abc){_0x430823['host']=getImapHost(_0xa29abc);_0x430823[_0x7591('0x3d')]=0x3e1;_0x381893[_0x7591('0x3c')]=getSmtpHost(_0xa29abc);_0x381893[_0x7591('0x3d')]=0x24b;_0x381893[_0x7591('0x3e')]=![];}if(_0x381893[_0x7591('0x39')]){_0x381893['secure']=![];}else{_0x381893[_0x7591('0x3a')]=null;}if(!_0x430823[_0x7591('0x39')])_0x430823['CloudProviderId']=null;_0x2c02bf[_0x7591('0x63')][_0x7591('0x41')]=_0x430823;_0x2c02bf[_0x7591('0x63')][_0x7591('0x42')]=_0x381893;return db[_0x7591('0x49')]['find']({'where':{'id':_0x2c02bf[_0x7591('0x5f')]['id']},'include':[{'model':db[_0x7591('0x44')],'as':'Imap'},{'model':db[_0x7591('0x45')],'as':_0x7591('0x42')},{'model':db[_0x7591('0x46')],'as':'mandatoryDispositionPause'}]})[_0x7591('0x10')](handleEntityNotFound(_0x3230ae,null))[_0x7591('0x10')](function(_0x4c5375){if(!_0x4c5375)throw new Error(_0x7591('0x66'));if(_0x4c5375[_0x7591('0x3f')])delete _0x2c02bf[_0x7591('0x63')]['Imap'];return _0x4c5375;})[_0x7591('0x10')](saveUpdates(_0x2c02bf[_0x7591('0x63')],null))['then'](function(_0xb3b3e4){if(!_0x2c02bf[_0x7591('0x63')][_0x7591('0x41')])return _0xb3b3e4;return db[_0x7591('0x44')]['update'](_0x2c02bf[_0x7591('0x63')][_0x7591('0x41')],{'where':{'MailAccountId':_0xb3b3e4['id']}})[_0x7591('0x10')](function(){return _0xb3b3e4;});})[_0x7591('0x10')](function(_0x554eaa){if(!_0x2c02bf['body'][_0x7591('0x42')])return _0x554eaa;return db[_0x7591('0x45')][_0x7591('0x24')](_0x2c02bf[_0x7591('0x63')]['Smtp'],{'where':{'MailAccountId':_0x554eaa['id']}})['then'](function(){return _0x554eaa;});})[_0x7591('0x10')](respondWithResult(_0x3230ae,null))['catch'](handleError(_0x3230ae,null));};exports[_0x7591('0x67')]=function(_0x59636b,_0x58daa4){return db[_0x7591('0x49')]['describe']()[_0x7591('0x10')](respondWithResult(_0x58daa4,null))[_0x7591('0x1b')](handleError(_0x58daa4,null));};exports[_0x7591('0x68')]=function(_0x1ffd1e,_0x4d6b14){if(_0x1ffd1e[_0x7591('0x63')]['id']){delete _0x1ffd1e[_0x7591('0x63')]['id'];}return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x1ffd1e[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x4d6b14,null))[_0x7591('0x10')](function(_0x3f2972){if(_0x3f2972){_0x1ffd1e[_0x7591('0x63')][_0x7591('0x69')]=_0x3f2972['id'];return db[_0x7591('0x6a')][_0x7591('0x6b')](_0x1ffd1e[_0x7591('0x63')]);}})[_0x7591('0x10')](respondWithResult(_0x4d6b14,null))[_0x7591('0x1b')](handleError(_0x4d6b14,null));};exports[_0x7591('0x6c')]=function(_0x161975,_0x247371){var _0x3c3644={'raw':![],'where':{}};var _0x516d4f={};var _0x4ec6a6={'count':0x0,'rows':[]};return db['MailAccount'][_0x7591('0x6d')]({'where':{'id':_0x161975['params']['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x247371,null))['then'](function(_0x131e77){if(_0x131e77){_0x516d4f[_0x7591('0x4b')]=_[_0x7591('0x4d')](db[_0x7591('0x6a')]['rawAttributes']);_0x516d4f['query']=_[_0x7591('0x4d')](_0x161975[_0x7591('0x4c')]);_0x516d4f[_0x7591('0x57')]=_[_0x7591('0x4f')](_0x516d4f['model'],_0x516d4f[_0x7591('0x4c')]);_0x3c3644[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0x516d4f[_0x7591('0x4b')],qs['fields'](_0x161975['query']['fields']));_0x3c3644[_0x7591('0x4e')]=_0x3c3644['attributes'][_0x7591('0x51')]?_0x3c3644[_0x7591('0x4e')]:_0x516d4f[_0x7591('0x4b')];if(!_0x161975['query'][_0x7591('0x52')]('nolimit')){_0x3c3644[_0x7591('0x21')]=qs['limit'](_0x161975[_0x7591('0x4c')][_0x7591('0x21')]);_0x3c3644[_0x7591('0x1f')]=qs['offset'](_0x161975['query']['offset']);}_0x3c3644[_0x7591('0x54')]=qs[_0x7591('0x55')](_0x161975[_0x7591('0x4c')][_0x7591('0x55')]);_0x3c3644[_0x7591('0x56')]=qs[_0x7591('0x57')](_[_0x7591('0x6e')](_0x161975[_0x7591('0x4c')],_0x516d4f[_0x7591('0x57')]));_0x3c3644['where'][_0x7591('0x69')]=_0x131e77['id'];if(_0x161975['query'][_0x7591('0x58')]){_0x3c3644[_0x7591('0x56')]=_[_0x7591('0x59')](_0x3c3644[_0x7591('0x56')],{'$or':_[_0x7591('0x48')](_0x3c3644[_0x7591('0x4e')],function(_0x20593a){var _0x3cfc21={};_0x3cfc21[_0x20593a]={'$like':'%'+_0x161975[_0x7591('0x4c')][_0x7591('0x58')]+'%'};return _0x3cfc21;})});}_0x3c3644=_[_0x7591('0x59')]({},_0x3c3644,_0x161975[_0x7591('0x5b')]);return db['Disposition'][_0x7591('0x22')]({'where':_0x3c3644[_0x7591('0x56')]})[_0x7591('0x10')](function(_0x4fd68f){_0x4ec6a6[_0x7591('0x22')]=_0x4fd68f;if(_0x161975[_0x7591('0x4c')][_0x7591('0x5c')]){_0x3c3644[_0x7591('0x61')]=[{'all':!![]}];}return db['Disposition'][_0x7591('0x5d')](_0x3c3644);})[_0x7591('0x10')](function(_0x2f69c5){_0x4ec6a6[_0x7591('0x6f')]=_0x2f69c5;return _0x4ec6a6;});}})[_0x7591('0x10')](respondWithFilteredResult(_0x247371,_0x3c3644))[_0x7591('0x1b')](handleError(_0x247371,null));};exports[_0x7591('0x70')]=function(_0x33fe0c,_0x3c49bb){return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x33fe0c[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x3c49bb,null))[_0x7591('0x10')](function(_0x5f4a0e){if(_0x5f4a0e){return _0x5f4a0e[_0x7591('0x70')](_0x33fe0c['query'][_0x7591('0x71')]);}})[_0x7591('0x10')](respondWithStatusCode(_0x3c49bb,null))[_0x7591('0x1b')](handleError(_0x3c49bb,null));};exports[_0x7591('0x72')]=function(_0xf974dd,_0x11cf41){if(_0xf974dd['body']['id']){delete _0xf974dd[_0x7591('0x63')]['id'];}return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0xf974dd['params']['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x11cf41,null))[_0x7591('0x10')](function(_0x2fde82){if(_0x2fde82){_0xf974dd[_0x7591('0x63')]['MailAccountId']=_0x2fde82['id'];return db[_0x7591('0x73')][_0x7591('0x6b')](_0xf974dd['body']);}})[_0x7591('0x10')](respondWithResult(_0x11cf41,null))['catch'](handleError(_0x11cf41,null));};exports[_0x7591('0x74')]=function(_0x1b9acd,_0x265e00){var _0x336069={'raw':![],'where':{}};var _0x2fbc1c={};var _0x126731={'count':0x0,'rows':[]};return db['MailAccount'][_0x7591('0x6d')]({'where':{'id':_0x1b9acd[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x265e00,null))[_0x7591('0x10')](function(_0x3ebf89){if(_0x3ebf89){_0x2fbc1c[_0x7591('0x4b')]=_['keys'](db[_0x7591('0x73')][_0x7591('0x60')]);_0x2fbc1c['query']=_[_0x7591('0x4d')](_0x1b9acd[_0x7591('0x4c')]);_0x2fbc1c[_0x7591('0x57')]=_[_0x7591('0x4f')](_0x2fbc1c[_0x7591('0x4b')],_0x2fbc1c[_0x7591('0x4c')]);_0x336069[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0x2fbc1c[_0x7591('0x4b')],qs[_0x7591('0x50')](_0x1b9acd['query']['fields']));_0x336069['attributes']=_0x336069[_0x7591('0x4e')]['length']?_0x336069[_0x7591('0x4e')]:_0x2fbc1c[_0x7591('0x4b')];if(!_0x1b9acd[_0x7591('0x4c')][_0x7591('0x52')](_0x7591('0x53'))){_0x336069['limit']=qs['limit'](_0x1b9acd['query']['limit']);_0x336069[_0x7591('0x1f')]=qs['offset'](_0x1b9acd[_0x7591('0x4c')][_0x7591('0x1f')]);}_0x336069['order']=qs[_0x7591('0x55')](_0x1b9acd['query'][_0x7591('0x55')]);_0x336069[_0x7591('0x56')]=qs[_0x7591('0x57')](_[_0x7591('0x6e')](_0x1b9acd[_0x7591('0x4c')],_0x2fbc1c[_0x7591('0x57')]));_0x336069[_0x7591('0x56')][_0x7591('0x69')]=_0x3ebf89['id'];if(_0x1b9acd[_0x7591('0x4c')][_0x7591('0x58')]){_0x336069['where']=_[_0x7591('0x59')](_0x336069[_0x7591('0x56')],{'$or':_['map'](_0x336069[_0x7591('0x4e')],function(_0x8b283b){var _0x203d03={};_0x203d03[_0x8b283b]={'$like':'%'+_0x1b9acd['query']['filter']+'%'};return _0x203d03;})});}_0x336069=_[_0x7591('0x59')]({},_0x336069,_0x1b9acd[_0x7591('0x5b')]);return db['CannedAnswer'][_0x7591('0x22')]({'where':_0x336069[_0x7591('0x56')]})[_0x7591('0x10')](function(_0x1ca8ae){_0x126731[_0x7591('0x22')]=_0x1ca8ae;if(_0x1b9acd[_0x7591('0x4c')][_0x7591('0x5c')]){_0x336069[_0x7591('0x61')]=[{'all':!![]}];}return db[_0x7591('0x73')][_0x7591('0x5d')](_0x336069);})['then'](function(_0x43d372){_0x126731[_0x7591('0x6f')]=_0x43d372;return _0x126731;});}})[_0x7591('0x10')](respondWithFilteredResult(_0x265e00,_0x336069))[_0x7591('0x1b')](handleError(_0x265e00,null));};exports[_0x7591('0x75')]=function(_0x49e4cf,_0x38f5bb){return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x49e4cf[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x38f5bb,null))[_0x7591('0x10')](function(_0x144ff8){if(_0x144ff8){return _0x144ff8['removeAnswers'](_0x49e4cf[_0x7591('0x4c')]['ids']);}})[_0x7591('0x10')](respondWithStatusCode(_0x38f5bb,null))['catch'](handleError(_0x38f5bb,null));};exports['create']=function(_0x2f469d,_0x23f546){var _0x1bdeca={'name':_0x2f469d['body'][_0x7591('0x29')],'key':_0x2f469d[_0x7591('0x63')]['key'],'provider':_0x2f469d[_0x7591('0x63')][_0x7591('0x64')]===_0x7591('0x65')?null:_0x2f469d[_0x7591('0x63')]['provider'],'email':_0x2f469d[_0x7591('0x63')][_0x7591('0x76')],'ListId':_0x2f469d[_0x7591('0x63')][_0x7591('0x77')],'active':!_[_0x7591('0x78')](_0x2f469d[_0x7591('0x63')]['active'])?_0x2f469d[_0x7591('0x63')][_0x7591('0x79')]:!![],'description':_0x2f469d['body'][_0x7591('0x7a')]||null};var _0x42d4fe=getAuthenticationOptions(_0x1bdeca[_0x7591('0x64')],_0x2f469d[_0x7591('0x63')]);_0x1bdeca[_0x7591('0x41')]=_0x42d4fe[_0x7591('0x41')];_0x1bdeca['Smtp']=_0x42d4fe[_0x7591('0x42')];return db['MailAccount'][_0x7591('0x6b')](_0x1bdeca,{'include':[{'model':db[_0x7591('0x45')],'as':_0x7591('0x42')},{'model':db[_0x7591('0x44')],'as':'Imap'}]})[_0x7591('0x10')](function(_0x8935b4){var _0x5b4157=_0x2f469d['user']['get']({'plain':!![]});if(!_0x5b4157)throw new Error(_0x7591('0x7b'));if(_0x5b4157[_0x7591('0x7c')]===_0x7591('0x36')){var _0x2ab3b7=_0x8935b4[_0x7591('0x25')]({'plain':!![]});return db[_0x7591('0x7d')][_0x7591('0x62')]({'where':{'name':_0x7591('0x26'),'userProfileId':_0x5b4157[_0x7591('0x7e')]},'raw':!![]})[_0x7591('0x10')](function(_0x3c6737){if(_0x3c6737&&_0x3c6737[_0x7591('0x7f')]===0x0){return db['UserProfileResource'][_0x7591('0x6b')]({'name':_0x2ab3b7[_0x7591('0x29')],'resourceId':_0x2ab3b7['id'],'type':_0x3c6737[_0x7591('0x29')],'sectionId':_0x3c6737['id']},{})[_0x7591('0x10')](function(){return _0x8935b4;});}else{return _0x8935b4;}})['catch'](function(_0x36eaf7){logger[_0x7591('0x17')](_0x7591('0x80'),_0x36eaf7);throw _0x36eaf7;});}return _0x8935b4;})[_0x7591('0x10')](respondWithResult(_0x23f546,0xc9))['catch'](handleError(_0x23f546,null));};exports['getImap']=function(_0x43962e,_0x1609e0){return db[_0x7591('0x49')][_0x7591('0x6d')]({'where':{'id':_0x43962e[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x1609e0,null))[_0x7591('0x10')](function(_0x2beb28){if(_0x2beb28){return _0x2beb28[_0x7591('0x81')]();}return null;})[_0x7591('0x10')](respondWithResult(_0x1609e0,null))[_0x7591('0x1b')](handleError(_0x1609e0,null));};exports[_0x7591('0x82')]=function(_0x13c17c,_0x39b8e6){if(_0x13c17c['body']['id']){delete _0x13c17c['body']['id'];}return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x13c17c['params']['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x39b8e6,null))['then'](function(_0x5b70f9){if(_0x5b70f9){_0x13c17c['body'][_0x7591('0x69')]=_0x5b70f9['id'];return db[_0x7591('0x44')]['create'](_0x13c17c['body']);}})['then'](respondWithResult(_0x39b8e6,null))[_0x7591('0x1b')](handleError(_0x39b8e6,null));};exports[_0x7591('0x83')]=function(_0xf0b016,_0x45facf){return db['MailAccount'][_0x7591('0x6d')]({'where':{'id':_0xf0b016[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x45facf,null))[_0x7591('0x10')](function(_0x1f5b71){if(_0x1f5b71){return _0x1f5b71[_0x7591('0x84')](null);}return null;})[_0x7591('0x10')](respondWithStatusCode(_0x45facf,null))['catch'](handleError(_0x45facf,null));};exports[_0x7591('0x85')]=function(_0x23179b,_0x4909bb){return db['MailAccount'][_0x7591('0x6d')]({'where':{'id':_0x23179b[_0x7591('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4909bb,null))['then'](function(_0x2f90ec){if(_0x2f90ec){return _0x2f90ec['getSmtp']();}return null;})[_0x7591('0x10')](respondWithResult(_0x4909bb,null))[_0x7591('0x1b')](handleError(_0x4909bb,null));};exports[_0x7591('0x86')]=function(_0x17a69c,_0x2890de){if(_0x17a69c[_0x7591('0x63')]['id']){delete _0x17a69c[_0x7591('0x63')]['id'];}return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x17a69c[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x2890de,null))[_0x7591('0x10')](function(_0x3108b0){if(_0x3108b0){_0x17a69c[_0x7591('0x63')][_0x7591('0x69')]=_0x3108b0['id'];return db['MailServerOut'][_0x7591('0x6b')](_0x17a69c[_0x7591('0x63')]);}})[_0x7591('0x10')](respondWithResult(_0x2890de,null))['catch'](handleError(_0x2890de,null));};exports[_0x7591('0x87')]=function(_0x192771,_0x270653){return db[_0x7591('0x49')][_0x7591('0x6d')]({'where':{'id':_0x192771['params']['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x270653,null))['then'](function(_0x3a071b){if(_0x3a071b){return _0x3a071b[_0x7591('0x88')](null);}return null;})[_0x7591('0x10')](respondWithStatusCode(_0x270653,null))[_0x7591('0x1b')](handleError(_0x270653,null));};exports[_0x7591('0x89')]=function(_0x1de0eb,_0x4a044b){return db[_0x7591('0x8a')]['find']({'where':{'id':_0x1de0eb['params']['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x4a044b,null))[_0x7591('0x10')](function(_0x249ecf){if(_0x249ecf){return _0x249ecf[_0x7591('0x89')](_0x1de0eb[_0x7591('0x63')][_0x7591('0x71')],_[_0x7591('0x8b')](_0x1de0eb['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4a044b,null))['catch'](handleError(_0x4a044b,null));};exports[_0x7591('0x8c')]=function(_0x497e7b,_0x4ec008){var _0x1be924={'raw':![],'where':{}};var _0x3601c3={};var _0x53a355={'count':0x0,'rows':[]};return db[_0x7591('0x49')][_0x7591('0x6d')]({'where':{'id':_0x497e7b[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x4ec008,null))['then'](function(_0x1c1b55){if(_0x1c1b55){_0x3601c3['model']=_[_0x7591('0x4d')](db[_0x7591('0x8a')][_0x7591('0x60')]);_0x3601c3[_0x7591('0x4c')]=_[_0x7591('0x4d')](_0x497e7b[_0x7591('0x4c')]);_0x3601c3[_0x7591('0x57')]=_[_0x7591('0x4f')](_0x3601c3[_0x7591('0x4b')],_0x3601c3[_0x7591('0x4c')]);_0x1be924[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0x3601c3[_0x7591('0x4b')],qs[_0x7591('0x50')](_0x497e7b[_0x7591('0x4c')][_0x7591('0x50')]));_0x1be924['attributes']=_0x1be924[_0x7591('0x4e')]['length']?_0x1be924['attributes']:_0x3601c3[_0x7591('0x4b')];if(!_0x497e7b[_0x7591('0x4c')][_0x7591('0x52')](_0x7591('0x53'))){_0x1be924['limit']=qs[_0x7591('0x21')](_0x497e7b[_0x7591('0x4c')]['limit']);_0x1be924[_0x7591('0x1f')]=qs[_0x7591('0x1f')](_0x497e7b['query'][_0x7591('0x1f')]);}_0x1be924[_0x7591('0x54')]=qs[_0x7591('0x55')](_0x497e7b[_0x7591('0x4c')]['sort']);_0x1be924[_0x7591('0x56')]=qs[_0x7591('0x57')](_[_0x7591('0x6e')](_0x497e7b[_0x7591('0x4c')],_0x3601c3[_0x7591('0x57')]));_0x1be924['where'][_0x7591('0x69')]=_0x1c1b55['id'];if(_0x497e7b[_0x7591('0x4c')][_0x7591('0x58')]){_0x1be924[_0x7591('0x56')]=_[_0x7591('0x59')](_0x1be924['where'],{'$or':_[_0x7591('0x48')](_0x1be924[_0x7591('0x4e')],function(_0xa0b386){var _0x5a3531={};_0x5a3531[_0xa0b386]={'$like':'%'+_0x497e7b[_0x7591('0x4c')]['filter']+'%'};return _0x5a3531;})});}_0x1be924=_[_0x7591('0x59')]({},_0x1be924,_0x497e7b[_0x7591('0x5b')]);return db['MailInteraction'][_0x7591('0x22')]({'where':_0x1be924[_0x7591('0x56')]})[_0x7591('0x10')](function(_0x298779){_0x53a355['count']=_0x298779;if(_0x497e7b['query'][_0x7591('0x5c')]){_0x1be924[_0x7591('0x61')]=[{'model':db[_0x7591('0x8d')],'as':_0x7591('0x8e'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x7591('0x29'),_0x7591('0x8f'),'internal'],'required':![]},{'model':db[_0x7591('0x90')],'as':_0x7591('0x91'),'attributes':['id',_0x7591('0x29'),_0x7591('0x92')],'where':_0x497e7b['query'][_0x7591('0x93')]?{'id':_0x497e7b[_0x7591('0x4c')][_0x7591('0x93')]}:undefined,'required':_0x497e7b[_0x7591('0x4c')][_0x7591('0x93')]?!![]:![]}];}return db[_0x7591('0x8a')]['findAll'](_0x1be924);})['then'](function(_0x11048e){_0x53a355[_0x7591('0x6f')]=_0x11048e;return _0x53a355;});}})[_0x7591('0x10')](respondWithFilteredResult(_0x4ec008,_0x1be924))[_0x7591('0x1b')](handleError(_0x4ec008,null));};exports[_0x7591('0x94')]=function addApplications(_0x3b01bd,_0x4cdaa9){var _0x5dbcbb=_0x3b01bd[_0x7591('0x5f')]['id'];var _0x4538e3=_0x3b01bd[_0x7591('0x63')];var _0x4da7d1=0xc8;var _0x1757a3=null;return db[_0x7591('0x95')][_0x7591('0x96')]({'isolationLevel':db[_0x7591('0x95')]['Transaction']['ISOLATION_LEVELS'][_0x7591('0x97')]},function(_0x598a4a){return db[_0x7591('0x49')]['findOne']({'where':{'id':_0x5dbcbb},'transaction':_0x598a4a})[_0x7591('0x10')](function(_0x12a6f2){if(_0x12a6f2){return db[_0x7591('0x98')][_0x7591('0x99')]({'where':{'MailAccountId':_0x5dbcbb},'transaction':_0x598a4a})[_0x7591('0x10')](function(){var _0x5977f2=_['map'](_0x4538e3,function(_0x5cabf1){_0x5cabf1[_0x7591('0x69')]=_0x5dbcbb;return _0x5cabf1;});return db[_0x7591('0x98')]['bulkCreate'](_0x5977f2,{'transaction':_0x598a4a});});}else{_0x4da7d1=0x194;_0x1757a3=[];}});})['then'](function(){if(_0x4da7d1!==0x194){return db['MailApplication'][_0x7591('0x9a')]({'where':{'MailAccountId':_0x5dbcbb},'order':_0x7591('0x9b')})[_0x7591('0x10')](function(_0x2a9d66){_0x1757a3=_0x2a9d66;});}})['catch'](function(_0x155af3){_0x4da7d1=0x1f4;logger[_0x7591('0x17')](_0x155af3[_0x7591('0x28')]);if(_0x155af3[_0x7591('0x29')]){delete _0x155af3[_0x7591('0x29')];}_0x1757a3=_0x155af3;})[_0x7591('0x9c')](function(){if(_0x1757a3===null){_0x4cdaa9[_0x7591('0x27')](_0x4da7d1);}else{if(_0x4da7d1===0x1f4){_0x4cdaa9[_0x7591('0x1c')](_0x4da7d1)[_0x7591('0x2a')](_0x1757a3);}else{_0x4cdaa9[_0x7591('0x1c')](_0x4da7d1)[_0x7591('0x1e')](_0x1757a3);}}});};exports[_0x7591('0x9d')]=function(_0x5535b6,_0xcd00d7){var _0x5c6b55={};var _0x3dec2c={};var _0xe2af5e;var _0x5e490c;return db[_0x7591('0x49')][_0x7591('0x6d')]({'where':{'id':_0x5535b6['params']['id']}})[_0x7591('0x10')](handleEntityNotFound(_0xcd00d7,null))[_0x7591('0x10')](function(_0x1a0d57){if(_0x1a0d57){_0xe2af5e=_0x1a0d57;_0x3dec2c[_0x7591('0x4b')]=_[_0x7591('0x4d')](db[_0x7591('0x98')][_0x7591('0x60')]);_0x3dec2c['query']=_['keys'](_0x5535b6[_0x7591('0x4c')]);_0x3dec2c[_0x7591('0x57')]=_[_0x7591('0x4f')](_0x3dec2c['model'],_0x3dec2c[_0x7591('0x4c')]);_0x5c6b55[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0x3dec2c[_0x7591('0x4b')],qs[_0x7591('0x50')](_0x5535b6[_0x7591('0x4c')][_0x7591('0x50')]));_0x5c6b55[_0x7591('0x4e')]=_0x5c6b55[_0x7591('0x4e')]['length']?_0x5c6b55[_0x7591('0x4e')]:_0x3dec2c[_0x7591('0x4b')];_0x5c6b55[_0x7591('0x54')]=qs[_0x7591('0x55')](_0x5535b6[_0x7591('0x4c')][_0x7591('0x55')]);_0x5c6b55[_0x7591('0x56')]=qs[_0x7591('0x57')](_[_0x7591('0x6e')](_0x5535b6[_0x7591('0x4c')],_0x3dec2c[_0x7591('0x57')]));if(_0x5535b6[_0x7591('0x4c')][_0x7591('0x58')]){_0x5c6b55[_0x7591('0x56')]=_['merge'](_0x5c6b55[_0x7591('0x56')],{'$or':_[_0x7591('0x48')](_0x5c6b55['attributes'],function(_0x8be4e7){var _0x10d65d={};_0x10d65d[_0x8be4e7]={'$like':'%'+_0x5535b6[_0x7591('0x4c')]['filter']+'%'};return _0x10d65d;})});}_0x5c6b55=_['merge']({},_0x5c6b55,_0x5535b6[_0x7591('0x5b')]);return _0xe2af5e[_0x7591('0x9d')](_0x5c6b55);}})[_0x7591('0x10')](function(_0x37fdba){if(_0x37fdba){_0x5e490c=_0x37fdba[_0x7591('0x51')];if(!_0x5535b6[_0x7591('0x4c')][_0x7591('0x52')](_0x7591('0x53'))){_0x5c6b55['limit']=qs[_0x7591('0x21')](_0x5535b6['query']['limit']);_0x5c6b55[_0x7591('0x1f')]=qs[_0x7591('0x1f')](_0x5535b6[_0x7591('0x4c')][_0x7591('0x1f')]);}return _0xe2af5e['getApplications'](_0x5c6b55);}})[_0x7591('0x10')](function(_0x19cb68){if(_0x19cb68){return _0x19cb68?{'count':_0x5e490c,'rows':_0x19cb68}:null;}})['then'](respondWithResult(_0xcd00d7,null))['catch'](handleError(_0xcd00d7,null));};exports['getMessages']=function(_0x51eba1,_0x2d807d){var _0x19a18a={'raw':!![],'where':{}};var _0x72978f={};var _0xa1e7b={'count':0x0,'rows':[]};return db[_0x7591('0x49')][_0x7591('0x6d')]({'where':{'id':_0x51eba1[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x2d807d,null))['then'](function(_0xa0feb8){if(_0xa0feb8){_0x72978f['model']=_[_0x7591('0x4d')](db[_0x7591('0x9e')]['rawAttributes']);_0x72978f[_0x7591('0x4c')]=_[_0x7591('0x4d')](_0x51eba1['query']);_0x72978f['filters']=_[_0x7591('0x4f')](_0x72978f[_0x7591('0x4b')],_0x72978f[_0x7591('0x4c')]);_0x19a18a[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0x72978f[_0x7591('0x4b')],qs[_0x7591('0x50')](_0x51eba1[_0x7591('0x4c')][_0x7591('0x50')]));_0x19a18a['attributes']=_0x19a18a[_0x7591('0x4e')]['length']?_0x19a18a[_0x7591('0x4e')]:_0x72978f[_0x7591('0x4b')];if(!_0x51eba1[_0x7591('0x4c')][_0x7591('0x52')](_0x7591('0x53'))){_0x19a18a[_0x7591('0x21')]=qs[_0x7591('0x21')](_0x51eba1[_0x7591('0x4c')][_0x7591('0x21')]);_0x19a18a[_0x7591('0x1f')]=qs['offset'](_0x51eba1[_0x7591('0x4c')][_0x7591('0x1f')]);}_0x19a18a['order']=qs[_0x7591('0x55')](_0x51eba1[_0x7591('0x4c')]['sort']);_0x19a18a[_0x7591('0x56')]=qs[_0x7591('0x57')](_[_0x7591('0x6e')](_0x51eba1[_0x7591('0x4c')],_0x72978f[_0x7591('0x57')]));_0x19a18a[_0x7591('0x56')][_0x7591('0x69')]=_0xa0feb8['id'];if(_0x51eba1[_0x7591('0x4c')][_0x7591('0x58')]){_0x19a18a[_0x7591('0x56')]=_[_0x7591('0x59')](_0x19a18a['where'],{'$or':_[_0x7591('0x48')](_0x19a18a[_0x7591('0x4e')],function(_0x9429f9){var _0x477118={};_0x477118[_0x9429f9]={'$like':'%'+_0x51eba1[_0x7591('0x4c')][_0x7591('0x58')]+'%'};return _0x477118;})});}if(_0x51eba1['query'][_0x7591('0x9f')]){var _0x3a412d=_0x51eba1[_0x7591('0x4c')][_0x7591('0x9f')][_0x7591('0xa0')](',');var _0x7461b={};_0x7461b[_0x3a412d[0x0]]={'$gte':moment(_0x3a412d[0x1])['format'](_0x7591('0xa1'))};_0x19a18a[_0x7591('0x56')]=_[_0x7591('0x59')](_0x19a18a[_0x7591('0x56')],_0x7461b);}_0x19a18a=_['merge']({},_0x19a18a,_0x51eba1['options']);return db['MailMessage'][_0x7591('0x22')]({'where':_0x19a18a[_0x7591('0x56')]})[_0x7591('0x10')](function(_0x4775c6){_0xa1e7b[_0x7591('0x22')]=_0x4775c6;if(_0x51eba1[_0x7591('0x4c')]['includeAll']){_0x19a18a[_0x7591('0x61')]=[{'all':!![]}];}return db[_0x7591('0x9e')]['findAll'](_0x19a18a);})['then'](function(_0x3f9a5c){if(_0x51eba1[_0x7591('0x4c')][_0x7591('0xa2')]==='true'){for(var _0x1434c3=0x0;_0x1434c3<_0x3f9a5c[_0x7591('0x51')];_0x1434c3++){_0x3f9a5c[_0x1434c3][_0x7591('0x63')]=juice(_0x3f9a5c[_0x1434c3][_0x7591('0x63')]);}}_0xa1e7b[_0x7591('0x6f')]=_0x3f9a5c;return _0xa1e7b;});}})[_0x7591('0x10')](respondWithFilteredResult(_0x2d807d,_0x19a18a))['catch'](handleError(_0x2d807d,null));};exports[_0x7591('0x2a')]=function(_0x428167,_0x3efbf2){var _0x111c5a,_0x5c29b7={},_0x579af5;if(_0x428167[_0x7591('0x63')]['to']){_0x579af5=_0x428167[_0x7591('0x63')]['to'][_0x7591('0xa0')](',')[0x0];}return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x428167[_0x7591('0x5f')]['id']},'include':[{'model':db[_0x7591('0xa3')],'as':_0x7591('0xa4'),'include':[{'model':db[_0x7591('0x8d')],'as':_0x7591('0xa5'),'where':{'email':_0x579af5},'limit':0x1,'order':[['updatedAt',_0x7591('0xa6')]]}]},{'model':db[_0x7591('0x45')],'as':_0x7591('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x7591('0x10')](handleEntityNotFound(_0x3efbf2,null))['then'](function(_0x451840){if(!_0x451840)return;_0x111c5a=_0x451840;if(!_0x451840[_0x7591('0x42')])throw new Error(_0x7591('0xa7'));if(_[_0x7591('0x78')](_0x428167[_0x7591('0x63')][_0x7591('0xa8')])){_0x428167[_0x7591('0x63')]['from']=util[_0x7591('0xa9')](_0x7591('0xaa'),_0x451840['name'],_0x451840[_0x7591('0x76')]||_0x451840[_0x7591('0x42')][_0x7591('0x36')]);}if(_0x428167[_0x7591('0x63')][_0x7591('0xab')]&&_0x428167[_0x7591('0x63')][_0x7591('0xab')][_0x7591('0x51')]){for(var _0x58388c=0x0;_0x58388c<_0x428167[_0x7591('0x63')][_0x7591('0xab')][_0x7591('0x51')];_0x58388c+=0x1){_0x428167[_0x7591('0x63')][_0x7591('0xab')][_0x58388c]={'filename':_0x428167[_0x7591('0x63')][_0x7591('0xab')][_0x58388c][_0x7591('0x29')],'path':path[_0x7591('0xac')](config[_0x7591('0xad')],'server/files/attachments',_0x428167['body'][_0x7591('0xab')][_0x58388c]['basename'])};}}var _0xe41d50=_0x451840[_0x7591('0xae')]();return respondWithRpcPromise(_0x7591('0xaf'),_0x7591('0xb0'),{'account':_0xe41d50,'message':_0x428167[_0x7591('0x63')]});})[_0x7591('0x10')](function(_0x5382a5){if(!_0x5382a5)return;_0x5c29b7=_0x5382a5;if(!_0x111c5a[_0x7591('0xa4')])throw new Error(_0x7591('0xb1'));if(_0x111c5a[_0x7591('0xa4')]['Contacts']['length'])return _0x111c5a[_0x7591('0xa4')]['Contacts'][0x0];return db[_0x7591('0x8d')][_0x7591('0x6b')](_[_0x7591('0x9')](_0x428167[_0x7591('0x63')],{'firstName':_0x428167[_0x7591('0x63')]['to'],'email':_0x428167[_0x7591('0x63')]['to'],'phone':_0x428167[_0x7591('0x63')]['to'],'ListId':_0x111c5a[_0x7591('0x77')]}));})[_0x7591('0x10')](function(_0x52d747){if(!_0x52d747)return;var _0x347001={'UserId':_0x428167[_0x7591('0x36')]['id'],'ContactId':_0x52d747['id'],'MailAccountId':_0x111c5a['id'],'inReplyTo':_0x5c29b7[_0x7591('0xb2')],'to':_0x428167[_0x7591('0x63')]['from'],'cc':_0x428167[_0x7591('0x63')]['cc'],'subject':_0x428167[_0x7591('0x63')][_0x7591('0xb3')],'attach':_0x428167[_0x7591('0x63')][_0x7591('0xb4')],'firstMsgDirection':_0x7591('0xb5'),'lastMsgAt':moment()[_0x7591('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x7591('0xb5'),'Messages':[_[_0x7591('0x59')](_0x428167[_0x7591('0x63')],{'messageId':_0x5c29b7[_0x7591('0xb2')],'sentAt':moment()['format'](_0x7591('0xa1')),'read':!![],'MailAccountId':_0x111c5a['id'],'UserId':_0x428167[_0x7591('0x36')]['id'],'ContactId':_0x52d747['id']})]};if(_0x428167[_0x7591('0x63')]['Interaction']){_0x347001=_['merge'](_0x347001,_0x428167[_0x7591('0x63')]['Interaction']);}return db['MailInteraction'][_0x7591('0x6b')](_0x347001,{'include':[{'model':db[_0x7591('0x9e')],'as':'Messages'}]});})[_0x7591('0x10')](respondWithResult(_0x3efbf2,null))['catch'](handleError(_0x3efbf2,null));};exports[_0x7591('0xb6')]=function(_0xb0c61b,_0x16f012){return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0xb0c61b[_0x7591('0x5f')]['id']},'include':[{'model':db[_0x7591('0x45')],'as':_0x7591('0x42'),'raw':!![],'include':[{'model':db[_0x7591('0xb7')],'as':_0x7591('0xb7'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x16f012,null))['then'](function(_0xe521f8){if(!_0xe521f8[_0x7591('0x42')])return;var _0x3bc641=_0xe521f8[_0x7591('0xae')]();return respondWithRpcPromise(_0x7591('0xb8'),_0x7591('0xb6'),{'account':_0x3bc641});})[_0x7591('0x10')](respondWithResult(_0x16f012,null))['catch'](handleError(_0x16f012,null));};exports[_0x7591('0x99')]=function(_0x27e818,_0x5bdb83){return db['MailAccount']['find']({'where':{'id':_0x27e818[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x5bdb83,null))['then'](function(_0x204bd4){if(_0x204bd4&&_0x204bd4[_0x7591('0x3f')]){throw new db[(_0x7591('0xb9'))][(_0x7591('0xba'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x204bd4;})[_0x7591('0x10')](removeEntity(_0x5bdb83,null))[_0x7591('0x1b')](handleError(_0x5bdb83,null));};exports['addAgents']=function(_0x36d52a,_0x594060){return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x36d52a[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x594060,null))[_0x7591('0x10')](function(_0x11a94a){if(_0x11a94a){return _0x11a94a[_0x7591('0xbb')](_0x36d52a[_0x7591('0x63')][_0x7591('0x71')],_[_0x7591('0x8b')](_0x36d52a[_0x7591('0x63')],[_0x7591('0x71'),'id'])||{})[_0x7591('0xbc')](function(_0xf9e6c6){for(var _0x3880b5=0x0;_0x3880b5<_0x36d52a[_0x7591('0x63')]['ids'][_0x7591('0x51')];_0x3880b5+=0x1){socket[_0x7591('0xbd')](_0x7591('0xbe'),{'UserId':Number(_0x36d52a[_0x7591('0x63')][_0x7591('0x71')][_0x3880b5]),'MailAccountId':Number(_0x36d52a[_0x7591('0x5f')]['id'])});}return _0xf9e6c6;});}})['then'](respondWithResult(_0x594060,null))[_0x7591('0x1b')](handleError(_0x594060,null));};exports[_0x7591('0xbf')]=function(_0x3fee8d,_0x2bd33d){return db[_0x7591('0x49')][_0x7591('0x62')]({'where':{'id':_0x3fee8d[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x2bd33d,null))[_0x7591('0x10')](function(_0x432e79){if(_0x432e79){return _0x432e79[_0x7591('0xbf')](_0x3fee8d['query'][_0x7591('0x71')])['then'](function(){if(_['isArray'](_0x3fee8d['query'][_0x7591('0x71')])){for(var _0x3a3e0f=0x0;_0x3a3e0f<_0x3fee8d[_0x7591('0x4c')][_0x7591('0x71')][_0x7591('0x51')];_0x3a3e0f+=0x1){socket[_0x7591('0xbd')](_0x7591('0xc0'),{'UserId':Number(_0x3fee8d[_0x7591('0x4c')][_0x7591('0x71')][_0x3a3e0f]),'MailAccountId':Number(_0x3fee8d['params']['id'])});}}else{socket[_0x7591('0xbd')](_0x7591('0xc0'),{'UserId':Number(_0x3fee8d[_0x7591('0x4c')][_0x7591('0x71')]),'MailAccountId':Number(_0x3fee8d[_0x7591('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x2bd33d,null))[_0x7591('0x1b')](handleError(_0x2bd33d,null));};exports[_0x7591('0xc1')]=function(_0xd400d3,_0x24d79b){var _0x3d3770={};var _0x1604ac={};var _0x5d9167;var _0x555bad;return db['MailAccount']['findOne']({'where':{'id':_0xd400d3[_0x7591('0x5f')]['id']}})[_0x7591('0x10')](handleEntityNotFound(_0x24d79b,null))['then'](function(_0x100936){if(_0x100936){_0x5d9167=_0x100936;_0x1604ac[_0x7591('0x4b')]=_[_0x7591('0x4d')](db['User']['rawAttributes']);_0x1604ac[_0x7591('0x4c')]=_['keys'](_0xd400d3[_0x7591('0x4c')]);_0x1604ac[_0x7591('0x57')]=_[_0x7591('0x4f')](_0x1604ac[_0x7591('0x4b')],_0x1604ac[_0x7591('0x4c')]);_0x3d3770[_0x7591('0x4e')]=_[_0x7591('0x4f')](_0x1604ac[_0x7591('0x4b')],qs[_0x7591('0x50')](_0xd400d3[_0x7591('0x4c')][_0x7591('0x50')]));_0x3d3770['attributes']=_0x3d3770['attributes'][_0x7591('0x51')]?_0x3d3770[_0x7591('0x4e')]:_0x1604ac[_0x7591('0x4b')];_0x3d3770['order']=qs[_0x7591('0x55')](_0xd400d3['query']['sort']);_0x3d3770[_0x7591('0x56')]=qs[_0x7591('0x57')](_['pick'](_0xd400d3[_0x7591('0x4c')],_0x1604ac[_0x7591('0x57')]));if(_0xd400d3[_0x7591('0x4c')][_0x7591('0x58')]){_0x3d3770[_0x7591('0x56')]=_[_0x7591('0x59')](_0x3d3770[_0x7591('0x56')],{'$or':_['map'](_0x3d3770[_0x7591('0x4e')],function(_0x55af5d){var _0x1a5376={};_0x1a5376[_0x55af5d]={'$like':'%'+_0xd400d3[_0x7591('0x4c')]['filter']+'%'};return _0x1a5376;})});}_0x3d3770=_[_0x7591('0x59')]({},_0x3d3770,_0xd400d3[_0x7591('0x5b')]);return _0x5d9167[_0x7591('0xc1')](_0x3d3770);}})['then'](function(_0x1d99f7){if(_0x1d99f7){_0x555bad=_0x1d99f7[_0x7591('0x51')];if(!_0xd400d3[_0x7591('0x4c')][_0x7591('0x52')](_0x7591('0x53'))){_0x3d3770['limit']=qs['limit'](_0xd400d3[_0x7591('0x4c')][_0x7591('0x21')]);_0x3d3770[_0x7591('0x1f')]=qs[_0x7591('0x1f')](_0xd400d3[_0x7591('0x4c')][_0x7591('0x1f')]);}return _0x5d9167[_0x7591('0xc1')](_0x3d3770);}})['then'](function(_0x4989dd){if(_0x4989dd){return _0x4989dd?{'count':_0x555bad,'rows':_0x4989dd}:null;}})[_0x7591('0x10')](respondWithResult(_0x24d79b,null))[_0x7591('0x1b')](handleError(_0x24d79b,null));}; \ No newline at end of file +var _0xea95=['hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','MailAccount','includeAll','include','show','params','MailServerOut','find','body','provider','custom','describe','addDisposition','MailAccountId','create','getDispositions','Disposition','rows','removeDispositions','ids','CannedAnswer','findAll','removeAnswers','email','ListId','isNil','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','send','getApplications','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','split','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','Contacts','CmContact','defaults','messageId','from','attach','out','Interaction','MailMessage','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./mailAccount.socket','jayson/promise','client','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','update','then','destroy','get','MailAccounts','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','user','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','username','authentication','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x306334,_0x482970){var _0x49e21a=function(_0x3d6ca6){while(--_0x3d6ca6){_0x306334['push'](_0x306334['shift']());}};_0x49e21a(++_0x482970);}(_0xea95,0x129));var _0x5ea9=function(_0x1e1f31,_0x42b9a9){_0x1e1f31=_0x1e1f31-0x0;var _0x1ea43c=_0xea95[_0x1e1f31];return _0x1ea43c;};'use strict';var moment=require(_0x5ea9('0x0'));var BPromise=require(_0x5ea9('0x1'));var util=require(_0x5ea9('0x2'));var path=require(_0x5ea9('0x3'));var _=require(_0x5ea9('0x4'));var juice=require(_0x5ea9('0x5'));var Redis=require(_0x5ea9('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x5ea9('0x7'))(_0x5ea9('0x8'));var config=require(_0x5ea9('0x9'));var db=require(_0x5ea9('0xa'))['db'];config[_0x5ea9('0xb')]=_['defaults'](config[_0x5ea9('0xb')],{'host':_0x5ea9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ea9('0xb')]));require(_0x5ea9('0xd'))['register'](socket);var jayson=require(_0x5ea9('0xe'));var client=jayson[_0x5ea9('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x542590,_0x56220,_0x441646,_0x221f4e){return new BPromise(function(_0x55584e,_0x53f913){var _0x193c07=_0x221f4e||client;return _0x193c07[_0x5ea9('0x10')](_0x542590,_0x441646)['then'](function(_0x1e1d1d){logger[_0x5ea9('0x11')](_0x5ea9('0x12'),_0x56220,_0x5ea9('0x13'));logger[_0x5ea9('0x14')](_0x5ea9('0x15'),_0x56220,_0x5ea9('0x13'),JSON[_0x5ea9('0x16')](_0x1e1d1d));if(_0x1e1d1d[_0x5ea9('0x17')]){if(_0x1e1d1d[_0x5ea9('0x17')][_0x5ea9('0x18')]===0x1f4){logger[_0x5ea9('0x17')](_0x5ea9('0x12'),_0x56220,_0x1e1d1d[_0x5ea9('0x17')]['message']);return _0x53f913(_0x1e1d1d[_0x5ea9('0x17')]['message']);}logger['error'](_0x5ea9('0x12'),_0x56220,_0x1e1d1d[_0x5ea9('0x17')]['message']);return _0x55584e(_0x1e1d1d[_0x5ea9('0x17')][_0x5ea9('0x19')]);}else{logger[_0x5ea9('0x11')](_0x5ea9('0x12'),_0x56220,_0x5ea9('0x13'));_0x55584e(_0x1e1d1d[_0x5ea9('0x1a')][_0x5ea9('0x19')]);}})[_0x5ea9('0x1b')](function(_0x51f7e8){logger[_0x5ea9('0x17')](_0x5ea9('0x12'),_0x56220,_0x51f7e8);_0x53f913(_0x51f7e8);});});}function respondWithStatusCode(_0x3b1fb8,_0x1959cf){_0x1959cf=_0x1959cf||0xcc;return function(_0x50ae5d){if(_0x50ae5d){return _0x3b1fb8[_0x5ea9('0x1c')](_0x1959cf);}return _0x3b1fb8[_0x5ea9('0x1d')](_0x1959cf)[_0x5ea9('0x1e')]();};}function respondWithResult(_0x3ae87a,_0x2e8076){_0x2e8076=_0x2e8076||0xc8;return function(_0x45a493){if(_0x45a493){return _0x3ae87a[_0x5ea9('0x1d')](_0x2e8076)[_0x5ea9('0x1f')](_0x45a493);}};}function respondWithFilteredResult(_0x51c330,_0x164db7){return function(_0x2eeaae){if(_0x2eeaae){var _0x4c4d48=typeof _0x164db7[_0x5ea9('0x20')]===_0x5ea9('0x21')&&typeof _0x164db7['limit']===_0x5ea9('0x21');var _0x1941e4=_0x2eeaae['count'];var _0x8c5a38=_0x4c4d48?0x0:_0x164db7[_0x5ea9('0x20')];var _0x235b19=_0x4c4d48?_0x2eeaae[_0x5ea9('0x22')]:_0x164db7[_0x5ea9('0x20')]+_0x164db7[_0x5ea9('0x23')];var _0x5805a5;if(_0x235b19>=_0x1941e4){_0x235b19=_0x1941e4;_0x5805a5=0xc8;}else{_0x5805a5=0xce;}_0x51c330[_0x5ea9('0x1d')](_0x5805a5);return _0x51c330[_0x5ea9('0x24')]('Content-Range',_0x8c5a38+'-'+_0x235b19+'/'+_0x1941e4)[_0x5ea9('0x1f')](_0x2eeaae);}return null;};}function saveUpdates(_0x136200){return function(_0x383c57){if(_0x383c57){return _0x383c57[_0x5ea9('0x25')](_0x136200)[_0x5ea9('0x26')](function(_0x45234f){return _0x45234f;});}return null;};}function removeEntity(_0x373977){return function(_0x52b560){if(_0x52b560){return _0x52b560[_0x5ea9('0x27')]()[_0x5ea9('0x26')](function(){var _0x5755f1=_0x52b560[_0x5ea9('0x28')]({'plain':!![]});var _0x18657e=_0x5ea9('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x18657e,'resourceId':_0x5755f1['id']}})[_0x5ea9('0x26')](function(){return _0x52b560;});})[_0x5ea9('0x26')](function(){_0x373977[_0x5ea9('0x1d')](0xcc)[_0x5ea9('0x1e')]();});}};}function handleEntityNotFound(_0x3dd156){return function(_0x2cb287){if(!_0x2cb287){_0x3dd156[_0x5ea9('0x1c')](0x194);}return _0x2cb287;};}function handleError(_0x442bd9,_0x25fd94){_0x25fd94=_0x25fd94||0x1f4;return function(_0x5dfc01){logger[_0x5ea9('0x17')](_0x5dfc01[_0x5ea9('0x2a')]);if(_0x5dfc01[_0x5ea9('0x2b')]){delete _0x5dfc01[_0x5ea9('0x2b')];}_0x442bd9[_0x5ea9('0x1d')](_0x25fd94)['send'](_0x5dfc01);};}function getImapHost(_0x414840){switch(_0x414840){case _0x5ea9('0x2c'):return _0x5ea9('0x2d');case _0x5ea9('0x2e'):return _0x5ea9('0x2f');case _0x5ea9('0x30'):return _0x5ea9('0x31');case _0x5ea9('0x32'):return'outlook.office365.com';}throw new Error(_0x5ea9('0x33'),_0x414840);}function getSmtpHost(_0x1d429f){switch(_0x1d429f){case _0x5ea9('0x2c'):return _0x5ea9('0x34');case _0x5ea9('0x2e'):return _0x5ea9('0x35');case _0x5ea9('0x30'):return _0x5ea9('0x36');case'outlook365':return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x1d429f);}function getAuthenticationOptions(_0x31ddf1,_0x493e16){var _0x2c5719={};var _0x328db6={};if(_0x31ddf1){_0x2c5719[_0x5ea9('0x37')]=_0x328db6[_0x5ea9('0x37')]=_0x493e16['username'];_0x2c5719[_0x5ea9('0x38')]=_0x328db6[_0x5ea9('0x39')]=_0x493e16['password'];if(_0x493e16[_0x5ea9('0x3a')]){_0x2c5719[_0x5ea9('0x3a')]=_0x328db6[_0x5ea9('0x3a')]=!![];_0x2c5719[_0x5ea9('0x3b')]=_0x328db6[_0x5ea9('0x3b')]=_0x493e16[_0x5ea9('0x3b')];_0x2c5719[_0x5ea9('0x38')]=_0x328db6[_0x5ea9('0x39')]=null;}else{_0x2c5719[_0x5ea9('0x3b')]=_0x328db6[_0x5ea9('0x3b')]=null;}_0x2c5719[_0x5ea9('0x3c')]=getImapHost(_0x31ddf1);_0x2c5719['port']=0x3e1;_0x328db6[_0x5ea9('0x3c')]=getSmtpHost(_0x31ddf1);_0x328db6[_0x5ea9('0x3d')]=0x24b;_0x328db6[_0x5ea9('0x3e')]=![];_0x2c5719['service']=_0x328db6[_0x5ea9('0x3f')]=null;}else{if(_0x493e16['authentication']){_0x2c5719[_0x5ea9('0x37')]=_0x328db6['user']=_0x493e16[_0x5ea9('0x40')];_0x2c5719[_0x5ea9('0x38')]=_0x328db6['pass']=_0x493e16[_0x5ea9('0x38')];}else{_0x2c5719[_0x5ea9('0x41')]=_0x328db6[_0x5ea9('0x41')]=![];_0x2c5719[_0x5ea9('0x37')]=_0x328db6[_0x5ea9('0x37')]=null;_0x2c5719[_0x5ea9('0x38')]=_0x328db6[_0x5ea9('0x39')]=null;}_0x2c5719[_0x5ea9('0x3c')]=_0x493e16[_0x5ea9('0x42')]['host'];_0x2c5719['port']=_0x493e16[_0x5ea9('0x42')][_0x5ea9('0x3d')];_0x328db6[_0x5ea9('0x3c')]=_0x493e16['Smtp'][_0x5ea9('0x3c')];_0x328db6['port']=_0x493e16[_0x5ea9('0x43')][_0x5ea9('0x3d')];}return{'Imap':_0x2c5719,'Smtp':_0x328db6};}exports[_0x5ea9('0x44')]=function(_0x415c99,_0x5290e2){var _0x55adce={'include':[{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')},{'model':db['MailServerOut'],'as':_0x5ea9('0x43')},{'model':db[_0x5ea9('0x46')],'as':_0x5ea9('0x47')}]},_0x1a74b2={},_0x59771a={'count':0x0,'rows':[]};var _0x2ab669=_[_0x5ea9('0x48')](db['MailAccount'][_0x5ea9('0x49')],function(_0x4a1c59){return{'name':_0x4a1c59[_0x5ea9('0x4a')],'type':_0x4a1c59[_0x5ea9('0x4b')][_0x5ea9('0x4c')]};});_0x1a74b2[_0x5ea9('0x4d')]=_[_0x5ea9('0x48')](_0x2ab669,'name');_0x1a74b2['query']=_[_0x5ea9('0x4e')](_0x415c99[_0x5ea9('0x4f')]);_0x1a74b2[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x1a74b2['model'],_0x1a74b2[_0x5ea9('0x4f')]);_0x55adce[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x1a74b2['model'],qs[_0x5ea9('0x53')](_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x55adce[_0x5ea9('0x52')]=_0x55adce[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x55adce[_0x5ea9('0x52')]:_0x1a74b2[_0x5ea9('0x4d')];if(!_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x55adce[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x55adce[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x415c99['query'][_0x5ea9('0x20')]);}_0x55adce[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x58')]);_0x55adce['where']=qs['filters'](_[_0x5ea9('0x59')](_0x415c99[_0x5ea9('0x4f')],_0x1a74b2[_0x5ea9('0x50')]),_0x2ab669);if(_0x415c99[_0x5ea9('0x4f')]['filter']){_0x55adce[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x55adce[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x2ab669,function(_0x14463c){if(_0x14463c[_0x5ea9('0x4b')]!=='VIRTUAL'){var _0x125a96={};_0x125a96[_0x14463c[_0x5ea9('0x2b')]]={'$like':'%'+_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x5c')]+'%'};return _0x125a96;}})});}_0x55adce=_[_0x5ea9('0x5b')]({},_0x55adce,_0x415c99[_0x5ea9('0x5d')]);var _0x5111ef={'where':_0x55adce[_0x5ea9('0x5a')]};return db[_0x5ea9('0x5e')][_0x5ea9('0x22')](_0x5111ef)[_0x5ea9('0x26')](function(_0x53aa9b){_0x59771a[_0x5ea9('0x22')]=_0x53aa9b;if(_0x415c99[_0x5ea9('0x4f')][_0x5ea9('0x5f')]){_0x55adce[_0x5ea9('0x60')]=[{'all':!![]}];}return db[_0x5ea9('0x5e')]['findAll'](_0x55adce);})['then'](function(_0x4efdd9){_0x59771a['rows']=_0x4efdd9;return _0x59771a;})[_0x5ea9('0x26')](respondWithFilteredResult(_0x5290e2,_0x55adce))['catch'](handleError(_0x5290e2,null));};exports[_0x5ea9('0x61')]=function(_0x5874bd,_0x281f91){var _0x3785c={'raw':![],'where':{'id':_0x5874bd[_0x5ea9('0x62')]['id']},'include':[{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')},{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43')},{'model':db['Pause'],'as':_0x5ea9('0x47')}]},_0x142bd7={};_0x142bd7['model']=_['keys'](db[_0x5ea9('0x5e')][_0x5ea9('0x49')]);_0x142bd7['query']=_[_0x5ea9('0x4e')](_0x5874bd[_0x5ea9('0x4f')]);_0x142bd7[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x142bd7[_0x5ea9('0x4d')],_0x142bd7['query']);_0x3785c[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x142bd7['model'],qs[_0x5ea9('0x53')](_0x5874bd['query']['fields']));_0x3785c['attributes']=_0x3785c[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x3785c[_0x5ea9('0x52')]:_0x142bd7[_0x5ea9('0x4d')];if(_0x5874bd[_0x5ea9('0x4f')]['includeAll']){_0x3785c[_0x5ea9('0x60')]=[{'all':!![]}];}_0x3785c=_[_0x5ea9('0x5b')]({},_0x3785c,_0x5874bd[_0x5ea9('0x5d')]);return db['MailAccount'][_0x5ea9('0x64')](_0x3785c)[_0x5ea9('0x26')](handleEntityNotFound(_0x281f91,null))[_0x5ea9('0x26')](respondWithResult(_0x281f91,null))[_0x5ea9('0x1b')](handleError(_0x281f91,null));};exports[_0x5ea9('0x25')]=function(_0x898cb6,_0x37f276){if(_0x898cb6['body']['id']){delete _0x898cb6[_0x5ea9('0x65')]['id'];}var _0x1721d6=_0x898cb6['body'][_0x5ea9('0x66')]===_0x5ea9('0x67')?null:_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x66')];var _0x39a88e=_0x898cb6['body'][_0x5ea9('0x42')]||{};var _0x5d301a=_0x898cb6['body']['Smtp']||{};if(_0x1721d6){_0x39a88e['host']=getImapHost(_0x1721d6);_0x39a88e['port']=0x3e1;_0x5d301a['host']=getSmtpHost(_0x1721d6);_0x5d301a[_0x5ea9('0x3d')]=0x24b;_0x5d301a['secure']=![];}if(_0x5d301a['modernAuthentication']){_0x5d301a['secure']=![];}else{_0x5d301a[_0x5ea9('0x3b')]=null;}if(!_0x39a88e[_0x5ea9('0x3a')])_0x39a88e[_0x5ea9('0x3b')]=null;_0x898cb6['body'][_0x5ea9('0x42')]=_0x39a88e;_0x898cb6['body']['Smtp']=_0x5d301a;return db['MailAccount'][_0x5ea9('0x64')]({'where':{'id':_0x898cb6[_0x5ea9('0x62')]['id']},'include':[{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')},{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43')},{'model':db[_0x5ea9('0x46')],'as':_0x5ea9('0x47')}]})[_0x5ea9('0x26')](handleEntityNotFound(_0x37f276,null))[_0x5ea9('0x26')](function(_0x271212){if(!_0x271212)throw new Error('Mail\x20Account\x20not\x20found');if(_0x271212[_0x5ea9('0x3f')])delete _0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x42')];return _0x271212;})[_0x5ea9('0x26')](saveUpdates(_0x898cb6['body'],null))[_0x5ea9('0x26')](function(_0x3ab508){if(!_0x898cb6['body']['Imap'])return _0x3ab508;return db[_0x5ea9('0x45')]['update'](_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x42')],{'where':{'MailAccountId':_0x3ab508['id']}})[_0x5ea9('0x26')](function(){return _0x3ab508;});})[_0x5ea9('0x26')](function(_0x1576de){if(!_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x43')])return _0x1576de;return db[_0x5ea9('0x63')][_0x5ea9('0x25')](_0x898cb6[_0x5ea9('0x65')][_0x5ea9('0x43')],{'where':{'MailAccountId':_0x1576de['id']}})['then'](function(){return _0x1576de;});})[_0x5ea9('0x26')](respondWithResult(_0x37f276,null))[_0x5ea9('0x1b')](handleError(_0x37f276,null));};exports[_0x5ea9('0x68')]=function(_0x5bde8c,_0xd50c9c){return db[_0x5ea9('0x5e')][_0x5ea9('0x68')]()['then'](respondWithResult(_0xd50c9c,null))[_0x5ea9('0x1b')](handleError(_0xd50c9c,null));};exports[_0x5ea9('0x69')]=function(_0x4fb575,_0x9cfe9c){if(_0x4fb575[_0x5ea9('0x65')]['id']){delete _0x4fb575[_0x5ea9('0x65')]['id'];}return db[_0x5ea9('0x5e')]['find']({'where':{'id':_0x4fb575[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x9cfe9c,null))[_0x5ea9('0x26')](function(_0x435aad){if(_0x435aad){_0x4fb575['body'][_0x5ea9('0x6a')]=_0x435aad['id'];return db['Disposition'][_0x5ea9('0x6b')](_0x4fb575[_0x5ea9('0x65')]);}})['then'](respondWithResult(_0x9cfe9c,null))[_0x5ea9('0x1b')](handleError(_0x9cfe9c,null));};exports[_0x5ea9('0x6c')]=function(_0x3803e2,_0x345264){var _0x1f9529={'raw':![],'where':{}};var _0x2007e4={};var _0x619cf7={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3803e2[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x345264,null))[_0x5ea9('0x26')](function(_0x47d6d6){if(_0x47d6d6){_0x2007e4[_0x5ea9('0x4d')]=_[_0x5ea9('0x4e')](db[_0x5ea9('0x6d')][_0x5ea9('0x49')]);_0x2007e4[_0x5ea9('0x4f')]=_['keys'](_0x3803e2[_0x5ea9('0x4f')]);_0x2007e4['filters']=_[_0x5ea9('0x51')](_0x2007e4[_0x5ea9('0x4d')],_0x2007e4[_0x5ea9('0x4f')]);_0x1f9529[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x2007e4[_0x5ea9('0x4d')],qs[_0x5ea9('0x53')](_0x3803e2[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x1f9529[_0x5ea9('0x52')]=_0x1f9529[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x1f9529[_0x5ea9('0x52')]:_0x2007e4[_0x5ea9('0x4d')];if(!_0x3803e2[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x1f9529[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x3803e2[_0x5ea9('0x4f')]['limit']);_0x1f9529[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x3803e2['query']['offset']);}_0x1f9529[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x3803e2[_0x5ea9('0x4f')]['sort']);_0x1f9529[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_['pick'](_0x3803e2[_0x5ea9('0x4f')],_0x2007e4['filters']));_0x1f9529['where'][_0x5ea9('0x6a')]=_0x47d6d6['id'];if(_0x3803e2['query'][_0x5ea9('0x5c')]){_0x1f9529[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x1f9529['where'],{'$or':_['map'](_0x1f9529['attributes'],function(_0x42b9a2){var _0x5e1f14={};_0x5e1f14[_0x42b9a2]={'$like':'%'+_0x3803e2[_0x5ea9('0x4f')]['filter']+'%'};return _0x5e1f14;})});}_0x1f9529=_['merge']({},_0x1f9529,_0x3803e2[_0x5ea9('0x5d')]);return db[_0x5ea9('0x6d')][_0x5ea9('0x22')]({'where':_0x1f9529[_0x5ea9('0x5a')]})[_0x5ea9('0x26')](function(_0x1db6b2){_0x619cf7[_0x5ea9('0x22')]=_0x1db6b2;if(_0x3803e2[_0x5ea9('0x4f')]['includeAll']){_0x1f9529[_0x5ea9('0x60')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1f9529);})[_0x5ea9('0x26')](function(_0x3abcd1){_0x619cf7[_0x5ea9('0x6e')]=_0x3abcd1;return _0x619cf7;});}})['then'](respondWithFilteredResult(_0x345264,_0x1f9529))[_0x5ea9('0x1b')](handleError(_0x345264,null));};exports['removeDispositions']=function(_0x22777e,_0x1c1028){return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x22777e[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x1c1028,null))[_0x5ea9('0x26')](function(_0x143f83){if(_0x143f83){return _0x143f83[_0x5ea9('0x6f')](_0x22777e[_0x5ea9('0x4f')][_0x5ea9('0x70')]);}})[_0x5ea9('0x26')](respondWithStatusCode(_0x1c1028,null))[_0x5ea9('0x1b')](handleError(_0x1c1028,null));};exports['addAnswer']=function(_0x4309ed,_0x5cfe32){if(_0x4309ed[_0x5ea9('0x65')]['id']){delete _0x4309ed[_0x5ea9('0x65')]['id'];}return db['MailAccount'][_0x5ea9('0x64')]({'where':{'id':_0x4309ed[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x5cfe32,null))[_0x5ea9('0x26')](function(_0x24603b){if(_0x24603b){_0x4309ed['body']['MailAccountId']=_0x24603b['id'];return db[_0x5ea9('0x71')][_0x5ea9('0x6b')](_0x4309ed[_0x5ea9('0x65')]);}})[_0x5ea9('0x26')](respondWithResult(_0x5cfe32,null))[_0x5ea9('0x1b')](handleError(_0x5cfe32,null));};exports['getAnswers']=function(_0x2e508f,_0x3ab635){var _0x50f69c={'raw':![],'where':{}};var _0x42d44c={};var _0x48adaf={'count':0x0,'rows':[]};return db[_0x5ea9('0x5e')]['findOne']({'where':{'id':_0x2e508f[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x3ab635,null))[_0x5ea9('0x26')](function(_0x1adc13){if(_0x1adc13){_0x42d44c['model']=_[_0x5ea9('0x4e')](db['CannedAnswer'][_0x5ea9('0x49')]);_0x42d44c['query']=_[_0x5ea9('0x4e')](_0x2e508f[_0x5ea9('0x4f')]);_0x42d44c[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x42d44c[_0x5ea9('0x4d')],_0x42d44c[_0x5ea9('0x4f')]);_0x50f69c[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x42d44c[_0x5ea9('0x4d')],qs[_0x5ea9('0x53')](_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x50f69c['attributes']=_0x50f69c['attributes']['length']?_0x50f69c[_0x5ea9('0x52')]:_0x42d44c['model'];if(!_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x50f69c['limit']=qs[_0x5ea9('0x23')](_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x50f69c[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x2e508f[_0x5ea9('0x4f')]['offset']);}_0x50f69c['order']=qs[_0x5ea9('0x58')](_0x2e508f[_0x5ea9('0x4f')]['sort']);_0x50f69c[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x2e508f['query'],_0x42d44c[_0x5ea9('0x50')]));_0x50f69c['where']['MailAccountId']=_0x1adc13['id'];if(_0x2e508f['query'][_0x5ea9('0x5c')]){_0x50f69c[_0x5ea9('0x5a')]=_['merge'](_0x50f69c[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x50f69c[_0x5ea9('0x52')],function(_0xd5c2fd){var _0x2a1572={};_0x2a1572[_0xd5c2fd]={'$like':'%'+_0x2e508f['query'][_0x5ea9('0x5c')]+'%'};return _0x2a1572;})});}_0x50f69c=_['merge']({},_0x50f69c,_0x2e508f[_0x5ea9('0x5d')]);return db[_0x5ea9('0x71')][_0x5ea9('0x22')]({'where':_0x50f69c['where']})['then'](function(_0x171969){_0x48adaf[_0x5ea9('0x22')]=_0x171969;if(_0x2e508f[_0x5ea9('0x4f')][_0x5ea9('0x5f')]){_0x50f69c[_0x5ea9('0x60')]=[{'all':!![]}];}return db[_0x5ea9('0x71')][_0x5ea9('0x72')](_0x50f69c);})[_0x5ea9('0x26')](function(_0x220dbf){_0x48adaf[_0x5ea9('0x6e')]=_0x220dbf;return _0x48adaf;});}})[_0x5ea9('0x26')](respondWithFilteredResult(_0x3ab635,_0x50f69c))[_0x5ea9('0x1b')](handleError(_0x3ab635,null));};exports[_0x5ea9('0x73')]=function(_0x3a1d99,_0x49733c){return db[_0x5ea9('0x5e')]['find']({'where':{'id':_0x3a1d99[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x49733c,null))[_0x5ea9('0x26')](function(_0x5c954c){if(_0x5c954c){return _0x5c954c[_0x5ea9('0x73')](_0x3a1d99[_0x5ea9('0x4f')][_0x5ea9('0x70')]);}})[_0x5ea9('0x26')](respondWithStatusCode(_0x49733c,null))[_0x5ea9('0x1b')](handleError(_0x49733c,null));};exports[_0x5ea9('0x6b')]=function(_0x18a1d9,_0x2ae19a){var _0x24e91f={'name':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x2b')],'key':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x4c')],'provider':_0x18a1d9[_0x5ea9('0x65')]['provider']==='custom'?null:_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x66')],'email':_0x18a1d9['body'][_0x5ea9('0x74')],'ListId':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x75')],'active':!_[_0x5ea9('0x76')](_0x18a1d9[_0x5ea9('0x65')]['active'])?_0x18a1d9[_0x5ea9('0x65')]['active']:!![],'description':_0x18a1d9[_0x5ea9('0x65')][_0x5ea9('0x77')]||null};var _0x4bb83c=getAuthenticationOptions(_0x24e91f[_0x5ea9('0x66')],_0x18a1d9[_0x5ea9('0x65')]);_0x24e91f[_0x5ea9('0x42')]=_0x4bb83c[_0x5ea9('0x42')];_0x24e91f[_0x5ea9('0x43')]=_0x4bb83c[_0x5ea9('0x43')];return db[_0x5ea9('0x5e')][_0x5ea9('0x6b')](_0x24e91f,{'include':[{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43')},{'model':db[_0x5ea9('0x45')],'as':_0x5ea9('0x42')}]})[_0x5ea9('0x26')](function(_0x1a2049){var _0x104599=_0x18a1d9[_0x5ea9('0x37')][_0x5ea9('0x28')]({'plain':!![]});if(!_0x104599)throw new Error(_0x5ea9('0x78'));if(_0x104599[_0x5ea9('0x79')]===_0x5ea9('0x37')){var _0x204080=_0x1a2049[_0x5ea9('0x28')]({'plain':!![]});return db[_0x5ea9('0x7a')][_0x5ea9('0x64')]({'where':{'name':_0x5ea9('0x29'),'userProfileId':_0x104599[_0x5ea9('0x7b')]},'raw':!![]})[_0x5ea9('0x26')](function(_0x582df5){if(_0x582df5&&_0x582df5[_0x5ea9('0x7c')]===0x0){return db['UserProfileResource']['create']({'name':_0x204080[_0x5ea9('0x2b')],'resourceId':_0x204080['id'],'type':_0x582df5[_0x5ea9('0x2b')],'sectionId':_0x582df5['id']},{})['then'](function(){return _0x1a2049;});}else{return _0x1a2049;}})[_0x5ea9('0x1b')](function(_0xf7e6e9){logger[_0x5ea9('0x17')](_0x5ea9('0x7d'),_0xf7e6e9);throw _0xf7e6e9;});}return _0x1a2049;})[_0x5ea9('0x26')](respondWithResult(_0x2ae19a,0xc9))[_0x5ea9('0x1b')](handleError(_0x2ae19a,null));};exports['getImap']=function(_0x564228,_0x3b27a9){return db['MailAccount'][_0x5ea9('0x7e')]({'where':{'id':_0x564228[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x3b27a9,null))['then'](function(_0x47f5d3){if(_0x47f5d3){return _0x47f5d3['getImap']();}return null;})[_0x5ea9('0x26')](respondWithResult(_0x3b27a9,null))[_0x5ea9('0x1b')](handleError(_0x3b27a9,null));};exports[_0x5ea9('0x7f')]=function(_0x74b764,_0x2b755b){if(_0x74b764[_0x5ea9('0x65')]['id']){delete _0x74b764['body']['id'];}return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x74b764[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x2b755b,null))[_0x5ea9('0x26')](function(_0x39d917){if(_0x39d917){_0x74b764[_0x5ea9('0x65')][_0x5ea9('0x6a')]=_0x39d917['id'];return db[_0x5ea9('0x45')]['create'](_0x74b764[_0x5ea9('0x65')]);}})[_0x5ea9('0x26')](respondWithResult(_0x2b755b,null))[_0x5ea9('0x1b')](handleError(_0x2b755b,null));};exports[_0x5ea9('0x80')]=function(_0x10b9f4,_0x5664c3){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x10b9f4[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x5664c3,null))[_0x5ea9('0x26')](function(_0x1e9a34){if(_0x1e9a34){return _0x1e9a34[_0x5ea9('0x81')](null);}return null;})['then'](respondWithStatusCode(_0x5664c3,null))['catch'](handleError(_0x5664c3,null));};exports[_0x5ea9('0x82')]=function(_0x1ac3d1,_0x4ab187){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x1ac3d1[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x4ab187,null))[_0x5ea9('0x26')](function(_0x5a3b63){if(_0x5a3b63){return _0x5a3b63[_0x5ea9('0x82')]();}return null;})[_0x5ea9('0x26')](respondWithResult(_0x4ab187,null))['catch'](handleError(_0x4ab187,null));};exports[_0x5ea9('0x83')]=function(_0x11a95a,_0x115fea){if(_0x11a95a[_0x5ea9('0x65')]['id']){delete _0x11a95a[_0x5ea9('0x65')]['id'];}return db['MailAccount'][_0x5ea9('0x64')]({'where':{'id':_0x11a95a[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x115fea,null))[_0x5ea9('0x26')](function(_0x2e7844){if(_0x2e7844){_0x11a95a[_0x5ea9('0x65')]['MailAccountId']=_0x2e7844['id'];return db[_0x5ea9('0x63')]['create'](_0x11a95a[_0x5ea9('0x65')]);}})['then'](respondWithResult(_0x115fea,null))[_0x5ea9('0x1b')](handleError(_0x115fea,null));};exports[_0x5ea9('0x84')]=function(_0x56d6af,_0x1eff1c){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x56d6af['params']['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x1eff1c,null))[_0x5ea9('0x26')](function(_0x302f6d){if(_0x302f6d){return _0x302f6d[_0x5ea9('0x85')](null);}return null;})['then'](respondWithStatusCode(_0x1eff1c,null))['catch'](handleError(_0x1eff1c,null));};exports['addInteraction']=function(_0x5941f6,_0x2bbcf6){return db[_0x5ea9('0x86')][_0x5ea9('0x64')]({'where':{'id':_0x5941f6[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x2bbcf6,null))[_0x5ea9('0x26')](function(_0x44d42c){if(_0x44d42c){return _0x44d42c[_0x5ea9('0x87')](_0x5941f6[_0x5ea9('0x65')][_0x5ea9('0x70')],_['omit'](_0x5941f6[_0x5ea9('0x65')],[_0x5ea9('0x70'),'id'])||{});}})[_0x5ea9('0x26')](respondWithResult(_0x2bbcf6,null))[_0x5ea9('0x1b')](handleError(_0x2bbcf6,null));};exports[_0x5ea9('0x88')]=function(_0x19baca,_0x4cea60){var _0x575a01={'raw':![],'where':{}};var _0x560400={};var _0x16b675={'count':0x0,'rows':[]};return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x19baca[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x4cea60,null))['then'](function(_0x283dc7){if(_0x283dc7){_0x560400[_0x5ea9('0x4d')]=_[_0x5ea9('0x4e')](db[_0x5ea9('0x86')][_0x5ea9('0x49')]);_0x560400[_0x5ea9('0x4f')]=_[_0x5ea9('0x4e')](_0x19baca['query']);_0x560400[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x560400[_0x5ea9('0x4d')],_0x560400[_0x5ea9('0x4f')]);_0x575a01[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x560400['model'],qs['fields'](_0x19baca[_0x5ea9('0x4f')]['fields']));_0x575a01[_0x5ea9('0x52')]=_0x575a01['attributes'][_0x5ea9('0x54')]?_0x575a01[_0x5ea9('0x52')]:_0x560400[_0x5ea9('0x4d')];if(!_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x575a01['limit']=qs[_0x5ea9('0x23')](_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x575a01[_0x5ea9('0x20')]=qs['offset'](_0x19baca[_0x5ea9('0x4f')]['offset']);}_0x575a01[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x58')]);_0x575a01[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x19baca[_0x5ea9('0x4f')],_0x560400[_0x5ea9('0x50')]));_0x575a01[_0x5ea9('0x5a')][_0x5ea9('0x6a')]=_0x283dc7['id'];if(_0x19baca['query'][_0x5ea9('0x5c')]){_0x575a01[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x575a01[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x575a01[_0x5ea9('0x52')],function(_0x595f26){var _0x3e3550={};_0x3e3550[_0x595f26]={'$like':'%'+_0x19baca['query']['filter']+'%'};return _0x3e3550;})});}_0x575a01=_['merge']({},_0x575a01,_0x19baca[_0x5ea9('0x5d')]);return db['MailInteraction'][_0x5ea9('0x22')]({'where':_0x575a01['where']})[_0x5ea9('0x26')](function(_0x3ec6a9){_0x16b675[_0x5ea9('0x22')]=_0x3ec6a9;if(_0x19baca[_0x5ea9('0x4f')]['includeAll']){_0x575a01[_0x5ea9('0x60')]=[{'model':db['CmContact'],'as':_0x5ea9('0x89'),'required':![]},{'model':db[_0x5ea9('0x8a')],'as':_0x5ea9('0x8b'),'attributes':[_0x5ea9('0x2b'),_0x5ea9('0x8c'),_0x5ea9('0x8d')],'required':![]},{'model':db[_0x5ea9('0x8e')],'as':'Tags','attributes':['id','name','color'],'where':_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x8f')]?{'id':_0x19baca[_0x5ea9('0x4f')][_0x5ea9('0x8f')]}:undefined,'required':_0x19baca['query'][_0x5ea9('0x8f')]?!![]:![]}];}return db[_0x5ea9('0x86')]['findAll'](_0x575a01);})[_0x5ea9('0x26')](function(_0x1a144d){_0x16b675[_0x5ea9('0x6e')]=_0x1a144d;return _0x16b675;});}})[_0x5ea9('0x26')](respondWithFilteredResult(_0x4cea60,_0x575a01))['catch'](handleError(_0x4cea60,null));};exports[_0x5ea9('0x90')]=function addApplications(_0x38f296,_0x325d09){var _0x320410=_0x38f296[_0x5ea9('0x62')]['id'];var _0x3f7c17=_0x38f296['body'];var _0x20c1a1=0xc8;var _0x16bedc=null;return db[_0x5ea9('0x91')][_0x5ea9('0x92')]({'isolationLevel':db[_0x5ea9('0x91')]['Transaction'][_0x5ea9('0x93')][_0x5ea9('0x94')]},function(_0x4775f2){return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x320410},'transaction':_0x4775f2})[_0x5ea9('0x26')](function(_0x92d011){if(_0x92d011){return db[_0x5ea9('0x95')]['destroy']({'where':{'MailAccountId':_0x320410},'transaction':_0x4775f2})[_0x5ea9('0x26')](function(){var _0xaa2196=_['map'](_0x3f7c17,function(_0x514a59){_0x514a59[_0x5ea9('0x6a')]=_0x320410;return _0x514a59;});return db[_0x5ea9('0x95')][_0x5ea9('0x96')](_0xaa2196,{'transaction':_0x4775f2});});}else{_0x20c1a1=0x194;_0x16bedc=[];}});})['then'](function(){if(_0x20c1a1!==0x194){return db[_0x5ea9('0x95')][_0x5ea9('0x97')]({'where':{'MailAccountId':_0x320410},'order':'priority'})[_0x5ea9('0x26')](function(_0x3b9c32){_0x16bedc=_0x3b9c32;});}})['catch'](function(_0x54901b){_0x20c1a1=0x1f4;logger['error'](_0x54901b[_0x5ea9('0x2a')]);if(_0x54901b[_0x5ea9('0x2b')]){delete _0x54901b['name'];}_0x16bedc=_0x54901b;})['finally'](function(){if(_0x16bedc===null){_0x325d09[_0x5ea9('0x1c')](_0x20c1a1);}else{if(_0x20c1a1===0x1f4){_0x325d09[_0x5ea9('0x1d')](_0x20c1a1)[_0x5ea9('0x98')](_0x16bedc);}else{_0x325d09[_0x5ea9('0x1d')](_0x20c1a1)[_0x5ea9('0x1f')](_0x16bedc);}}});};exports[_0x5ea9('0x99')]=function(_0x4e43f1,_0x4241fb){var _0x592100={};var _0x3009f3={};var _0x3e1edd;var _0x3ed4f6;return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x4e43f1['params']['id']}})['then'](handleEntityNotFound(_0x4241fb,null))[_0x5ea9('0x26')](function(_0x2d3c98){if(_0x2d3c98){_0x3e1edd=_0x2d3c98;_0x3009f3['model']=_[_0x5ea9('0x4e')](db['MailApplication'][_0x5ea9('0x49')]);_0x3009f3[_0x5ea9('0x4f')]=_[_0x5ea9('0x4e')](_0x4e43f1[_0x5ea9('0x4f')]);_0x3009f3['filters']=_['intersection'](_0x3009f3['model'],_0x3009f3['query']);_0x592100[_0x5ea9('0x52')]=_['intersection'](_0x3009f3[_0x5ea9('0x4d')],qs['fields'](_0x4e43f1['query'][_0x5ea9('0x53')]));_0x592100[_0x5ea9('0x52')]=_0x592100['attributes'][_0x5ea9('0x54')]?_0x592100['attributes']:_0x3009f3[_0x5ea9('0x4d')];_0x592100[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x4e43f1[_0x5ea9('0x4f')]['sort']);_0x592100[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_['pick'](_0x4e43f1[_0x5ea9('0x4f')],_0x3009f3[_0x5ea9('0x50')]));if(_0x4e43f1[_0x5ea9('0x4f')][_0x5ea9('0x5c')]){_0x592100[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x592100[_0x5ea9('0x5a')],{'$or':_['map'](_0x592100[_0x5ea9('0x52')],function(_0x2008a6){var _0x57260a={};_0x57260a[_0x2008a6]={'$like':'%'+_0x4e43f1[_0x5ea9('0x4f')]['filter']+'%'};return _0x57260a;})});}_0x592100=_[_0x5ea9('0x5b')]({},_0x592100,_0x4e43f1[_0x5ea9('0x5d')]);return _0x3e1edd[_0x5ea9('0x99')](_0x592100);}})[_0x5ea9('0x26')](function(_0x40282c){if(_0x40282c){_0x3ed4f6=_0x40282c['length'];if(!_0x4e43f1['query'][_0x5ea9('0x55')]('nolimit')){_0x592100[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x4e43f1[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x592100[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x4e43f1[_0x5ea9('0x4f')]['offset']);}return _0x3e1edd['getApplications'](_0x592100);}})[_0x5ea9('0x26')](function(_0x204093){if(_0x204093){return _0x204093?{'count':_0x3ed4f6,'rows':_0x204093}:null;}})[_0x5ea9('0x26')](respondWithResult(_0x4241fb,null))[_0x5ea9('0x1b')](handleError(_0x4241fb,null));};exports['getMessages']=function(_0x1fa5f8,_0x1cc226){var _0x324d7f={'raw':!![],'where':{}};var _0x53d218={};var _0x2b3a3f={'count':0x0,'rows':[]};return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x1fa5f8['params']['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x1cc226,null))[_0x5ea9('0x26')](function(_0x34d3c3){if(_0x34d3c3){_0x53d218['model']=_['keys'](db['MailMessage']['rawAttributes']);_0x53d218['query']=_[_0x5ea9('0x4e')](_0x1fa5f8['query']);_0x53d218[_0x5ea9('0x50')]=_['intersection'](_0x53d218[_0x5ea9('0x4d')],_0x53d218[_0x5ea9('0x4f')]);_0x324d7f[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x53d218[_0x5ea9('0x4d')],qs[_0x5ea9('0x53')](_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x53')]));_0x324d7f[_0x5ea9('0x52')]=_0x324d7f[_0x5ea9('0x52')][_0x5ea9('0x54')]?_0x324d7f[_0x5ea9('0x52')]:_0x53d218[_0x5ea9('0x4d')];if(!_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x55')]('nolimit')){_0x324d7f[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x1fa5f8['query'][_0x5ea9('0x23')]);_0x324d7f[_0x5ea9('0x20')]=qs[_0x5ea9('0x20')](_0x1fa5f8['query']['offset']);}_0x324d7f[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x1fa5f8[_0x5ea9('0x4f')]['sort']);_0x324d7f[_0x5ea9('0x5a')]=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x1fa5f8[_0x5ea9('0x4f')],_0x53d218['filters']));_0x324d7f['where'][_0x5ea9('0x6a')]=_0x34d3c3['id'];if(_0x1fa5f8['query'][_0x5ea9('0x5c')]){_0x324d7f[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x324d7f[_0x5ea9('0x5a')],{'$or':_['map'](_0x324d7f['attributes'],function(_0x308ebc){var _0x41a1ea={};_0x41a1ea[_0x308ebc]={'$like':'%'+_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x5c')]+'%'};return _0x41a1ea;})});}if(_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x9a')]){var _0x565685=_0x1fa5f8['query'][_0x5ea9('0x9a')]['split'](',');var _0x143165={};_0x143165[_0x565685[0x0]]={'$gte':moment(_0x565685[0x1])[_0x5ea9('0x9b')](_0x5ea9('0x9c'))};_0x324d7f[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x324d7f['where'],_0x143165);}_0x324d7f=_['merge']({},_0x324d7f,_0x1fa5f8['options']);return db['MailMessage']['count']({'where':_0x324d7f[_0x5ea9('0x5a')]})[_0x5ea9('0x26')](function(_0x3d1515){_0x2b3a3f[_0x5ea9('0x22')]=_0x3d1515;if(_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x5f')]){_0x324d7f[_0x5ea9('0x60')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x324d7f);})[_0x5ea9('0x26')](function(_0x5b668a){if(_0x1fa5f8[_0x5ea9('0x4f')][_0x5ea9('0x9d')]==='true'){for(var _0x330c6e=0x0;_0x330c6e<_0x5b668a[_0x5ea9('0x54')];_0x330c6e++){_0x5b668a[_0x330c6e][_0x5ea9('0x65')]=juice(_0x5b668a[_0x330c6e][_0x5ea9('0x65')]);}}_0x2b3a3f[_0x5ea9('0x6e')]=_0x5b668a;return _0x2b3a3f;});}})[_0x5ea9('0x26')](respondWithFilteredResult(_0x1cc226,_0x324d7f))[_0x5ea9('0x1b')](handleError(_0x1cc226,null));};exports[_0x5ea9('0x98')]=function(_0x399f55,_0xb75d29){var _0x555b30,_0x434907={},_0x35ff29;if(_0x399f55['body']['to']){_0x35ff29=_0x399f55[_0x5ea9('0x65')]['to'][_0x5ea9('0x9e')](',')[0x0];}return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x399f55[_0x5ea9('0x62')]['id']},'include':[{'model':db['CmList'],'as':_0x5ea9('0x9f'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x35ff29},'limit':0x1,'order':[[_0x5ea9('0xa0'),_0x5ea9('0xa1')]]}]},{'model':db['MailServerOut'],'as':_0x5ea9('0x43'),'raw':!![],'include':[{'model':db[_0x5ea9('0xa2')],'as':_0x5ea9('0xa2'),'raw':!![]}]}]})[_0x5ea9('0x26')](handleEntityNotFound(_0xb75d29,null))[_0x5ea9('0x26')](function(_0x13f8f7){if(!_0x13f8f7)return;_0x555b30=_0x13f8f7;if(!_0x13f8f7[_0x5ea9('0x43')])throw new Error(_0x5ea9('0xa3'));if(_[_0x5ea9('0x76')](_0x399f55[_0x5ea9('0x65')]['from'])){_0x399f55[_0x5ea9('0x65')]['from']=util['format'](_0x5ea9('0xa4'),_0x13f8f7[_0x5ea9('0x2b')],_0x13f8f7['email']||_0x13f8f7[_0x5ea9('0x43')][_0x5ea9('0x37')]);}if(_0x399f55['body']['attachments']&&_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x5ea9('0x54')]){for(var _0x466c48=0x0;_0x466c48<_0x399f55[_0x5ea9('0x65')]['attachments'][_0x5ea9('0x54')];_0x466c48+=0x1){_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x466c48]={'filename':_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x466c48][_0x5ea9('0x2b')],'path':path[_0x5ea9('0xa6')](config[_0x5ea9('0xa7')],'server/files/attachments',_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xa5')][_0x466c48]['basename'])};}}var _0x4addb0=_0x13f8f7[_0x5ea9('0xa8')]();return respondWithRpcPromise(_0x5ea9('0xa9'),_0x5ea9('0xaa'),{'account':_0x4addb0,'message':_0x399f55[_0x5ea9('0x65')]});})[_0x5ea9('0x26')](function(_0x3e7cb8){if(!_0x3e7cb8)return;_0x434907=_0x3e7cb8;if(!_0x555b30['List'])throw new Error('List\x20not\x20found');if(_0x555b30['List']['Contacts'][_0x5ea9('0x54')])return _0x555b30[_0x5ea9('0x9f')][_0x5ea9('0xab')][0x0];return db[_0x5ea9('0xac')][_0x5ea9('0x6b')](_[_0x5ea9('0xad')](_0x399f55['body'],{'firstName':_0x399f55[_0x5ea9('0x65')]['to'],'email':_0x399f55[_0x5ea9('0x65')]['to'],'phone':_0x399f55[_0x5ea9('0x65')]['to'],'ListId':_0x555b30['ListId']}));})[_0x5ea9('0x26')](function(_0x5d6991){if(!_0x5d6991)return;var _0x5a38a1={'UserId':_0x399f55[_0x5ea9('0x37')]['id'],'ContactId':_0x5d6991['id'],'MailAccountId':_0x555b30['id'],'inReplyTo':_0x434907[_0x5ea9('0xae')],'to':_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xaf')],'cc':_0x399f55[_0x5ea9('0x65')]['cc'],'subject':_0x399f55['body']['subject'],'attach':_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xb0')],'firstMsgDirection':_0x5ea9('0xb1'),'lastMsgAt':moment()['format'](_0x5ea9('0x9c')),'lastMsgDirection':_0x5ea9('0xb1'),'Messages':[_[_0x5ea9('0x5b')](_0x399f55['body'],{'messageId':_0x434907[_0x5ea9('0xae')],'sentAt':moment()['format'](_0x5ea9('0x9c')),'read':!![],'MailAccountId':_0x555b30['id'],'UserId':_0x399f55[_0x5ea9('0x37')]['id'],'ContactId':_0x5d6991['id']})]};if(_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xb2')]){_0x5a38a1=_[_0x5ea9('0x5b')](_0x5a38a1,_0x399f55[_0x5ea9('0x65')][_0x5ea9('0xb2')]);}return db[_0x5ea9('0x86')][_0x5ea9('0x6b')](_0x5a38a1,{'include':[{'model':db[_0x5ea9('0xb3')],'as':_0x5ea9('0xb4')}]});})['then'](respondWithResult(_0xb75d29,null))[_0x5ea9('0x1b')](handleError(_0xb75d29,null));};exports[_0x5ea9('0xb5')]=function(_0x4769fc,_0x1a4329){return db['MailAccount']['find']({'where':{'id':_0x4769fc[_0x5ea9('0x62')]['id']},'include':[{'model':db[_0x5ea9('0x63')],'as':_0x5ea9('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5ea9('0xa2'),'raw':!![]}]}]})[_0x5ea9('0x26')](handleEntityNotFound(_0x1a4329,null))['then'](function(_0x23d4f1){if(!_0x23d4f1[_0x5ea9('0x43')])return;var _0x5d3077=_0x23d4f1[_0x5ea9('0xa8')]();return respondWithRpcPromise(_0x5ea9('0xb6'),_0x5ea9('0xb5'),{'account':_0x5d3077});})['then'](respondWithResult(_0x1a4329,null))[_0x5ea9('0x1b')](handleError(_0x1a4329,null));};exports['destroy']=function(_0x549199,_0x30ec8b){return db[_0x5ea9('0x5e')]['find']({'where':{'id':_0x549199[_0x5ea9('0x62')]['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x30ec8b,null))[_0x5ea9('0x26')](function(_0x59ce8f){if(_0x59ce8f&&_0x59ce8f[_0x5ea9('0x3f')]){throw new db[(_0x5ea9('0xb7'))]['ValidationError'](_0x5ea9('0xb8'));}return _0x59ce8f;})[_0x5ea9('0x26')](removeEntity(_0x30ec8b,null))[_0x5ea9('0x1b')](handleError(_0x30ec8b,null));};exports[_0x5ea9('0xb9')]=function(_0x576248,_0x376a2d){return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x576248['params']['id']}})['then'](handleEntityNotFound(_0x376a2d,null))[_0x5ea9('0x26')](function(_0x10c75a){if(_0x10c75a){return _0x10c75a[_0x5ea9('0xb9')](_0x576248[_0x5ea9('0x65')][_0x5ea9('0x70')],_[_0x5ea9('0xba')](_0x576248[_0x5ea9('0x65')],['ids','id'])||{})['spread'](function(_0x4e90b1){for(var _0x1140fa=0x0;_0x1140fa<_0x576248[_0x5ea9('0x65')][_0x5ea9('0x70')][_0x5ea9('0x54')];_0x1140fa+=0x1){socket[_0x5ea9('0xbb')](_0x5ea9('0xbc'),{'UserId':Number(_0x576248[_0x5ea9('0x65')]['ids'][_0x1140fa]),'MailAccountId':Number(_0x576248['params']['id'])});}return _0x4e90b1;});}})['then'](respondWithResult(_0x376a2d,null))[_0x5ea9('0x1b')](handleError(_0x376a2d,null));};exports['removeAgents']=function(_0x19dfbe,_0x397bf4){return db[_0x5ea9('0x5e')][_0x5ea9('0x64')]({'where':{'id':_0x19dfbe['params']['id']}})[_0x5ea9('0x26')](handleEntityNotFound(_0x397bf4,null))[_0x5ea9('0x26')](function(_0x58e0d3){if(_0x58e0d3){return _0x58e0d3['removeAgents'](_0x19dfbe[_0x5ea9('0x4f')][_0x5ea9('0x70')])['then'](function(){if(_['isArray'](_0x19dfbe[_0x5ea9('0x4f')][_0x5ea9('0x70')])){for(var _0x36af14=0x0;_0x36af14<_0x19dfbe[_0x5ea9('0x4f')]['ids'][_0x5ea9('0x54')];_0x36af14+=0x1){socket[_0x5ea9('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x19dfbe[_0x5ea9('0x4f')]['ids'][_0x36af14]),'MailAccountId':Number(_0x19dfbe[_0x5ea9('0x62')]['id'])});}}else{socket[_0x5ea9('0xbb')](_0x5ea9('0xbd'),{'UserId':Number(_0x19dfbe[_0x5ea9('0x4f')][_0x5ea9('0x70')]),'MailAccountId':Number(_0x19dfbe['params']['id'])});}});}})[_0x5ea9('0x26')](respondWithStatusCode(_0x397bf4,null))[_0x5ea9('0x1b')](handleError(_0x397bf4,null));};exports['getAgents']=function(_0x2a7455,_0x33eae0){var _0x373893={};var _0x1f4a9b={};var _0x61f7c8;var _0x2c9408;return db[_0x5ea9('0x5e')][_0x5ea9('0x7e')]({'where':{'id':_0x2a7455[_0x5ea9('0x62')]['id']}})['then'](handleEntityNotFound(_0x33eae0,null))['then'](function(_0x56b716){if(_0x56b716){_0x61f7c8=_0x56b716;_0x1f4a9b[_0x5ea9('0x4d')]=_[_0x5ea9('0x4e')](db[_0x5ea9('0x8a')][_0x5ea9('0x49')]);_0x1f4a9b[_0x5ea9('0x4f')]=_[_0x5ea9('0x4e')](_0x2a7455[_0x5ea9('0x4f')]);_0x1f4a9b[_0x5ea9('0x50')]=_[_0x5ea9('0x51')](_0x1f4a9b[_0x5ea9('0x4d')],_0x1f4a9b['query']);_0x373893[_0x5ea9('0x52')]=_[_0x5ea9('0x51')](_0x1f4a9b['model'],qs[_0x5ea9('0x53')](_0x2a7455['query'][_0x5ea9('0x53')]));_0x373893[_0x5ea9('0x52')]=_0x373893['attributes']['length']?_0x373893['attributes']:_0x1f4a9b[_0x5ea9('0x4d')];_0x373893[_0x5ea9('0x57')]=qs[_0x5ea9('0x58')](_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x58')]);_0x373893['where']=qs[_0x5ea9('0x50')](_[_0x5ea9('0x59')](_0x2a7455[_0x5ea9('0x4f')],_0x1f4a9b[_0x5ea9('0x50')]));if(_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x5c')]){_0x373893[_0x5ea9('0x5a')]=_[_0x5ea9('0x5b')](_0x373893[_0x5ea9('0x5a')],{'$or':_[_0x5ea9('0x48')](_0x373893['attributes'],function(_0x122062){var _0x221d0a={};_0x221d0a[_0x122062]={'$like':'%'+_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x5c')]+'%'};return _0x221d0a;})});}_0x373893=_[_0x5ea9('0x5b')]({},_0x373893,_0x2a7455['options']);return _0x61f7c8[_0x5ea9('0xbe')](_0x373893);}})[_0x5ea9('0x26')](function(_0x3fb97f){if(_0x3fb97f){_0x2c9408=_0x3fb97f['length'];if(!_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x55')](_0x5ea9('0x56'))){_0x373893[_0x5ea9('0x23')]=qs[_0x5ea9('0x23')](_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x23')]);_0x373893['offset']=qs[_0x5ea9('0x20')](_0x2a7455[_0x5ea9('0x4f')][_0x5ea9('0x20')]);}return _0x61f7c8[_0x5ea9('0xbe')](_0x373893);}})[_0x5ea9('0x26')](function(_0x2f06bf){if(_0x2f06bf){return _0x2f06bf?{'count':_0x2c9408,'rows':_0x2f06bf}:null;}})[_0x5ea9('0x26')](respondWithResult(_0x33eae0,null))[_0x5ea9('0x1b')](handleError(_0x33eae0,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 0c2466f..c2b0deb 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 _0x36e0=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x488ebd,_0x157586){var _0x70c90b=function(_0x4d7b57){while(--_0x4d7b57){_0x488ebd['push'](_0x488ebd['shift']());}};_0x70c90b(++_0x157586);}(_0x36e0,0x15c));var _0x036e=function(_0x5e9a13,_0x22e47a){_0x5e9a13=_0x5e9a13-0x0;var _0x329c2a=_0x36e0[_0x5e9a13];return _0x329c2a;};'use strict';var EventEmitter=require(_0x036e('0x0'));var MailAccount=require(_0x036e('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x036e('0x2')](0x0);var events={'afterCreate':_0x036e('0x3'),'afterUpdate':_0x036e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2ef73c){return function(_0x400837,_0x4f9d06,_0xac7036){MailAccountEvents[_0x036e('0x5')](_0x2ef73c+':'+_0x400837['id'],_0x400837);MailAccountEvents[_0x036e('0x5')](_0x2ef73c,_0x400837);_0xac7036(null);};}for(var e in events){if(events[_0x036e('0x6')](e)){var event=events[e];MailAccount[_0x036e('0x7')](e,emitEvent(event));}}module[_0x036e('0x8')]=MailAccountEvents; \ No newline at end of file +var _0xbd36=['hook','exports','events','../../mysqldb','MailAccount','update','remove','emit','hasOwnProperty'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xbd36,0x65));var _0x6bd3=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xbd36[_0x2dea24];return _0x309d58;};'use strict';var EventEmitter=require(_0x6bd3('0x0'));var MailAccount=require(_0x6bd3('0x1'))['db'][_0x6bd3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6bd3('0x3'),'afterDestroy':_0x6bd3('0x4')};function emitEvent(_0x513e89){return function(_0x3b2956,_0xa0380,_0x31143d){MailAccountEvents[_0x6bd3('0x5')](_0x513e89+':'+_0x3b2956['id'],_0x3b2956);MailAccountEvents['emit'](_0x513e89,_0x3b2956);_0x31143d(null);};}for(var e in events){if(events[_0x6bd3('0x6')](e)){var event=events[e];MailAccount[_0x6bd3('0x7')](e,emitEvent(event));}}module[_0x6bd3('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ef9f79e..08a74a0 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 _0x4b7b=['user','data5','auth','pass','./mailAccount.attributes','exports','define','MailAccount','provider','custom','service','host','Smtp','port','secure','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2'];(function(_0x3ebe5f,_0x2add53){var _0x51ebc9=function(_0xa653f0){while(--_0xa653f0){_0x3ebe5f['push'](_0x3ebe5f['shift']());}};_0x51ebc9(++_0x2add53);}(_0x4b7b,0x136));var _0xb4b7=function(_0x3be189,_0x233297){_0x3be189=_0x3be189-0x0;var _0x1a9d84=_0x4b7b[_0x3be189];return _0x1a9d84;};'use strict';var attributes=require(_0xb4b7('0x0'));module[_0xb4b7('0x1')]=function(_0x2d4c16){return _0x2d4c16[_0xb4b7('0x2')](_0xb4b7('0x3'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5444a5=this;var _0x1ed76e={'id':_0x5444a5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5444a5[_0xb4b7('0x4')]!==_0xb4b7('0x5')){_0x1ed76e[_0xb4b7('0x6')]=_0x5444a5[_0xb4b7('0x4')];}else{_0x1ed76e[_0xb4b7('0x7')]=_0x5444a5[_0xb4b7('0x8')][_0xb4b7('0x7')];_0x1ed76e[_0xb4b7('0x9')]=_0x5444a5[_0xb4b7('0x8')]['port'];_0x1ed76e[_0xb4b7('0xa')]=_0x5444a5[_0xb4b7('0x8')]['secure'];}if(_0x5444a5[_0xb4b7('0x8')]['authentication']){if(_0x5444a5[_0xb4b7('0x8')]['modernAuthentication']){if(!_0x5444a5[_0xb4b7('0x8')][_0xb4b7('0xb')])throw new Error(_0xb4b7('0xc'));_0x1ed76e['auth']={'type':_0xb4b7('0xd'),'user':_0x5444a5[_0xb4b7('0x8')][_0xb4b7('0xe')],'accessToken':_0x5444a5['Smtp'][_0xb4b7('0xb')][_0xb4b7('0xf')]};}else{_0x1ed76e[_0xb4b7('0x10')]={'user':_0x5444a5['Smtp'][_0xb4b7('0xe')],'pass':_0x5444a5[_0xb4b7('0x8')][_0xb4b7('0x11')]};}}return _0x1ed76e;}}});}; \ No newline at end of file +var _0xb5f2=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb5f2,0x1ba));var _0x2b5f=function(_0x1b82ec,_0x3788ed){_0x1b82ec=_0x1b82ec-0x0;var _0x1ecfff=_0xb5f2[_0x1b82ec];return _0x1ecfff;};'use strict';var attributes=require(_0x2b5f('0x0'));module[_0x2b5f('0x1')]=function(_0x5dc9df){return _0x5dc9df[_0x2b5f('0x2')](_0x2b5f('0x3'),attributes,{'tableName':_0x2b5f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5c209f=this;var _0xa7d2a9={'id':_0x5c209f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c209f[_0x2b5f('0x5')]!=='custom'){_0xa7d2a9['service']=_0x5c209f[_0x2b5f('0x5')];}else{_0xa7d2a9[_0x2b5f('0x6')]=_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0x6')];_0xa7d2a9[_0x2b5f('0x8')]=_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0x8')];_0xa7d2a9[_0x2b5f('0x9')]=_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0x9')];}if(_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xa')]){if(_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xb')]){if(!_0x5c209f[_0x2b5f('0x7')]['CloudProvider'])throw new Error(_0x2b5f('0xc'));_0xa7d2a9[_0x2b5f('0xd')]={'type':'OAuth2','user':_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xe')],'accessToken':_0x5c209f[_0x2b5f('0x7')]['CloudProvider'][_0x2b5f('0xf')]};}else{_0xa7d2a9['auth']={'user':_0x5c209f[_0x2b5f('0x7')][_0x2b5f('0xe')],'pass':_0x5c209f['Smtp'][_0x2b5f('0x10')]};}}return _0xa7d2a9;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 51ea651..1c9d738 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 _0x4317=['name','agent','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','waitForTheAssignedQueue','startRouting','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailAccount','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','smtp','setDataValue','ShowMailAccount','NotifyMailAccount','body','mail','keys','rawAttributes','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','CmContact','Contacts','updatedAt','Applications','MailServerOut','Smtp','CloudProvider','get','account','omit','applications','list','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','generate','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User'];(function(_0x32c03a,_0x4f76d4){var _0x301d53=function(_0x2ff3bb){while(--_0x2ff3bb){_0x32c03a['push'](_0x32c03a['shift']());}};_0x301d53(++_0x4f76d4);}(_0x4317,0x7c));var _0x7431=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x4317[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var moment=require(_0x7431('0x0'));var BPromise=require(_0x7431('0x1'));var rs=require(_0x7431('0x2'));var Redis=require('ioredis');var db=require(_0x7431('0x3'))['db'];var logger=require(_0x7431('0x4'))(_0x7431('0x5'));var config=require(_0x7431('0x6'));var jayson=require(_0x7431('0x7'));var client=jayson[_0x7431('0x8')]['http']({'port':0x232c});config['redis']=_[_0x7431('0x9')](config[_0x7431('0xa')],{'host':_0x7431('0xb'),'port':0x18eb});var socket=require(_0x7431('0xc'))(new Redis(config[_0x7431('0xa')]));require(_0x7431('0xd'))[_0x7431('0xe')](socket);function respondWithRpcPromise(_0x2294b8,_0xccbaee,_0xcf3ea4){return new BPromise(function(_0x9a8b79,_0x13bf7b){return client[_0x7431('0xf')](_0x2294b8,_0xcf3ea4)[_0x7431('0x10')](function(_0x216897){logger[_0x7431('0x11')](_0x7431('0x12'),_0xccbaee,_0x7431('0x13'));logger[_0x7431('0x14')](_0x7431('0x15'),_0xccbaee,_0x7431('0x13'),JSON[_0x7431('0x16')](_0x216897));if(_0x216897[_0x7431('0x17')]){if(_0x216897[_0x7431('0x17')]['code']===0x1f4){logger[_0x7431('0x17')](_0x7431('0x12'),_0xccbaee,_0x216897[_0x7431('0x17')]['message']);return _0x13bf7b(_0x216897[_0x7431('0x17')][_0x7431('0x18')]);}logger[_0x7431('0x17')]('MailAccount,\x20%s,\x20%s',_0xccbaee,_0x216897[_0x7431('0x17')]['message']);return _0x9a8b79(_0x216897['error']['message']);}else{logger[_0x7431('0x11')](_0x7431('0x12'),_0xccbaee,_0x7431('0x13'));_0x9a8b79(_0x216897[_0x7431('0x19')]['message']);}})['catch'](function(_0x167238){logger[_0x7431('0x17')](_0x7431('0x12'),_0xccbaee,_0x167238);_0x13bf7b(_0x167238);});});}exports[_0x7431('0x1a')]=function(_0x1e7fdf){var _0x409c6c=this;return new Promise(function(_0x488e1a,_0x563c0a){return db['MailAccount'][_0x7431('0x1b')]({'raw':_0x1e7fdf[_0x7431('0x1c')]?_0x1e7fdf['options'][_0x7431('0x1d')]===undefined?!![]:![]:!![],'where':_0x1e7fdf[_0x7431('0x1c')]?_0x1e7fdf[_0x7431('0x1c')]['where']||null:null,'attributes':_0x1e7fdf[_0x7431('0x1c')]?_0x1e7fdf[_0x7431('0x1c')][_0x7431('0x1e')]||null:null,'limit':_0x1e7fdf[_0x7431('0x1c')]?_0x1e7fdf['options'][_0x7431('0x1f')]||null:null,'include':_0x1e7fdf[_0x7431('0x1c')]?_0x1e7fdf[_0x7431('0x1c')][_0x7431('0x20')]?_[_0x7431('0x21')](_0x1e7fdf[_0x7431('0x1c')][_0x7431('0x20')],function(_0x183e53){return{'model':db[_0x183e53[_0x7431('0x22')]],'as':_0x183e53['as'],'attributes':_0x183e53[_0x7431('0x1e')],'include':_0x183e53[_0x7431('0x20')]?_[_0x7431('0x21')](_0x183e53['include'],function(_0x43116e){return{'model':db[_0x43116e['model']],'as':_0x43116e['as'],'attributes':_0x43116e['attributes'],'include':_0x43116e[_0x7431('0x20')]?_[_0x7431('0x21')](_0x43116e['include'],function(_0x3052fc){return{'model':db[_0x3052fc[_0x7431('0x22')]],'as':_0x3052fc['as'],'attributes':_0x3052fc[_0x7431('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7431('0x10')](function(_0x30e63f){logger[_0x7431('0x11')](_0x7431('0x1a'),_0x1e7fdf);logger[_0x7431('0x14')](_0x7431('0x1a'),_0x1e7fdf,JSON[_0x7431('0x16')](_0x30e63f));_0x488e1a(_0x30e63f);})[_0x7431('0x23')](function(_0xa63228){logger['error'](_0x7431('0x1a'),_0xa63228[_0x7431('0x18')],_0x1e7fdf);_0x563c0a(_0x409c6c[_0x7431('0x17')](0x1f4,_0xa63228[_0x7431('0x18')]));});});};exports['ShowMailAccount']=function(_0x2e3d64){var _0x27d324=this;return new Promise(function(_0x3e3fe6,_0x516dc1){return db['MailAccount'][_0x7431('0x24')]({'raw':_0x2e3d64['options']?_0x2e3d64['options'][_0x7431('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e3d64['options']?_0x2e3d64[_0x7431('0x1c')][_0x7431('0x25')]||null:null,'attributes':_0x2e3d64['options']?_0x2e3d64[_0x7431('0x1c')][_0x7431('0x1e')]||null:null,'include':_0x2e3d64['options']?_0x2e3d64[_0x7431('0x1c')][_0x7431('0x20')]?_[_0x7431('0x21')](_0x2e3d64[_0x7431('0x1c')][_0x7431('0x20')],function(_0x4d2be3){return{'model':db[_0x4d2be3[_0x7431('0x22')]],'as':_0x4d2be3['as'],'attributes':_0x4d2be3['attributes'],'include':_0x4d2be3[_0x7431('0x20')]?_[_0x7431('0x21')](_0x4d2be3[_0x7431('0x20')],function(_0x524de5){return{'model':db[_0x524de5[_0x7431('0x22')]],'as':_0x524de5['as'],'attributes':_0x524de5[_0x7431('0x1e')],'include':_0x524de5[_0x7431('0x20')]?_[_0x7431('0x21')](_0x524de5[_0x7431('0x20')],function(_0x316e0c){return{'model':db[_0x316e0c[_0x7431('0x22')]],'as':_0x316e0c['as'],'attributes':_0x316e0c[_0x7431('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7431('0x10')](function(_0xfde13f){if(_0x2e3d64[_0x7431('0x1c')][_0x7431('0x26')]===!![])_0xfde13f[_0x7431('0x27')]('smtpOptions',_0xfde13f['getSmtpOptions']());logger[_0x7431('0x11')](_0x7431('0x28'),_0x2e3d64);logger['debug']('ShowMailAccount',_0x2e3d64,JSON[_0x7431('0x16')](_0xfde13f));_0x3e3fe6(_0xfde13f);})[_0x7431('0x23')](function(_0x273bb8){logger[_0x7431('0x17')](_0x7431('0x28'),_0x273bb8[_0x7431('0x18')],_0x2e3d64);_0x516dc1(_0x27d324['error'](0x1f4,_0x273bb8['message']));});});};exports[_0x7431('0x29')]=function(_0x4330e5){var _0x13d903=this;return new Promise(function(_0x53dba5,_0x4fe1d7){var _0x178fc6={'body':_0x4330e5[_0x7431('0x2a')],'channel':_0x7431('0x2b')};var _0x12feb1=_['difference'](_[_0x7431('0x2c')](db['CmContact'][_0x7431('0x2d')]),[_0x7431('0x2e'),'updatedAt',_0x7431('0x2f'),_0x7431('0x30')]);var _0x32589c=![];if(_0x4330e5['body']['id']){delete _0x4330e5[_0x7431('0x2a')]['id'];}if(_[_0x7431('0x31')](_0x4330e5['body'][_0x7431('0x32')])){return _0x4fe1d7(_0x13d903[_0x7431('0x17')](0x1f4,_0x7431('0x33')));}if(_[_0x7431('0x31')](_0x4330e5['body'][_0x7431('0x2a')])||_0x4330e5['body']['body']===''){return _0x4fe1d7(_0x13d903[_0x7431('0x17')](0x1f4,_0x7431('0x34')));}if(_[_0x7431('0x31')](_0x4330e5['body']['mapKey'])){return _0x4fe1d7(_0x13d903[_0x7431('0x17')](0x1f4,_0x7431('0x35')+_0x12feb1));}if(!_['includes'](_0x12feb1,_0x4330e5[_0x7431('0x2a')][_0x7431('0x36')])){return _0x4fe1d7(_0x13d903['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12feb1));}var _0x119608={};_0x119608[_0x4330e5['body'][_0x7431('0x36')]]=_0x4330e5[_0x7431('0x2a')][_0x7431('0x32')];return db['MailAccount'][_0x7431('0x24')]({'where':{'id':_0x4330e5['account']['id']},'include':[{'model':db[_0x7431('0x37')],'as':_0x7431('0x38'),'include':[{'model':db[_0x7431('0x39')],'as':_0x7431('0x3a'),'where':_0x119608,'limit':0x1,'order':[[_0x7431('0x3b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x7431('0x3c')},{'model':db[_0x7431('0x3d')],'as':_0x7431('0x3e'),'include':[{'model':db[_0x7431('0x3f')],'as':_0x7431('0x3f')}]}]})[_0x7431('0x10')](function(_0x6f7b4){if(_0x6f7b4&&_0x6f7b4['List']){var _0x43ebe4=_0x6f7b4[_0x7431('0x40')]({'plain':!![]});_0x178fc6[_0x7431('0x41')]=_[_0x7431('0x42')](_0x43ebe4,[_0x7431('0x3c'),'List']);_0x178fc6[_0x7431('0x41')]['smtpOptions']=_0x6f7b4['getSmtpOptions']();_0x178fc6[_0x7431('0x43')]=_0x43ebe4[_0x7431('0x3c')];_0x178fc6[_0x7431('0x44')]=_0x43ebe4[_0x7431('0x38')];_0x178fc6[_0x7431('0x43')]=_[_0x7431('0x45')](_0x178fc6['applications'],[_0x7431('0x46')],[_0x7431('0x47')]);if(_0x178fc6['account']&&_0x178fc6[_0x7431('0x41')][_0x7431('0x48')]){_0x178fc6[_0x7431('0x43')][_0x7431('0x49')]({'id':0x0,'priority':_0x178fc6['applications'][_0x7431('0x4a')]+0x1,'app':'close','appdata':'autoclose','interval':_0x7431('0x4b')});}if(_0x178fc6[_0x7431('0x41')][_0x7431('0x3c')]){delete _0x178fc6[_0x7431('0x41')][_0x7431('0x3c')];}if(_0x178fc6[_0x7431('0x41')][_0x7431('0x38')]){delete _0x178fc6['account'][_0x7431('0x38')];}if(_0x43ebe4[_0x7431('0x38')]['Contacts'][_0x7431('0x4a')]){return _0x43ebe4[_0x7431('0x38')]['Contacts'][0x0];}var _0x840001=_[_0x7431('0x9')](_0x4330e5[_0x7431('0x2a')],{'firstName':_0x4330e5['body']['from'],'ListId':_0x43ebe4[_0x7431('0x30')]});_0x840001[_0x4330e5[_0x7431('0x2a')][_0x7431('0x36')]]=_0x4330e5['body'][_0x7431('0x32')];return db[_0x7431('0x39')][_0x7431('0x4c')](_0x840001);}else{throw new Error(_0x7431('0x4d'));}})[_0x7431('0x10')](function(_0x39e2aa){_0x178fc6['contact']=_0x39e2aa;if(_0x39e2aa){if(!_0x4330e5['body'][_0x7431('0x18')]['messageId']){_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')]['messageId']=rs[_0x7431('0x4e')]()+'\x20'+_0x4330e5[_0x7431('0x2a')]['message']['from'];}var _0x12cb28={'ContactId':_0x39e2aa['id'],'MailAccountId':_0x4330e5[_0x7431('0x41')]['id'],'inReplyTo':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x4f')],'to':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x32')],'cc':_0x4330e5['body']['message']['cc'],'subject':_0x4330e5['body']['message'][_0x7431('0x50')],'attach':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')]['attach'],'lastMsgAt':moment()[_0x7431('0x51')](_0x7431('0x52')),'lastMsgDirection':'in'};return db[_0x7431('0x53')][_0x7431('0x24')]({'where':{'closed':![],'MailAccountId':_0x4330e5[_0x7431('0x41')]['id']},'include':[{'model':db[_0x7431('0x54')],'as':_0x7431('0x55'),'attributes':[_0x7431('0x4f')],'where':{'messageId':_0x4330e5['body'][_0x7431('0x18')][_0x7431('0x56')]}}]})['then'](function(_0x5db955){if(_0x5db955){return[_0x5db955,![]];}return db['MailInteraction'][_0x7431('0x4c')](_0x12cb28)[_0x7431('0x10')](function(_0x52b2e8){return[_0x52b2e8,!![]];});});}else{throw new Error(_0x7431('0x57'));}})[_0x7431('0x58')](function(_0x3d26be,_0x5109ee){if(_0x3d26be){_0x32589c=_0x5109ee;if(!_0x5109ee){return _0x3d26be[_0x7431('0x59')]({'inReplyTo':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x4f')],'to':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')]['from'],'cc':_0x4330e5[_0x7431('0x2a')]['message']['cc'],'subject':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x50')],'attach':_0x3d26be[_0x7431('0x5a')]?_0x3d26be['attach']:_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x5a')],'substatus':null,'substatusAt':moment()[_0x7431('0x51')](_0x7431('0x52')),'lastMsgAt':moment()[_0x7431('0x51')](_0x7431('0x52')),'lastMsgDirection':'in'});}else{return _0x3d26be;}}})[_0x7431('0x10')](function(_0x2f24f1){_0x178fc6[_0x7431('0x5b')]=_0x2f24f1[_0x7431('0x40')]({'plain':!![]});_0x178fc6[_0x7431('0x5b')][_0x7431('0x5c')]=_0x32589c;return db[_0x7431('0x54')][_0x7431('0x4c')]({'body':_0x4330e5[_0x7431('0x2a')][_0x7431('0x2a')],'MailAccountId':_0x4330e5[_0x7431('0x41')]['id'],'MailInteractionId':_0x2f24f1['id'],'direction':'in','ContactId':_0x178fc6[_0x7431('0x5d')]['id'],'messageId':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x4f')],'from':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x32')],'to':_0x4330e5['body'][_0x7431('0x18')]['to'],'cc':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')]['cc'],'subject':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x50')],'attach':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x5a')],'Attachments':_0x4330e5[_0x7431('0x2a')]['message'][_0x7431('0x5e')],'originTo':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x5f')],'originCc':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x60')],'bcc':_0x4330e5['body'][_0x7431('0x18')][_0x7431('0x61')],'ChatWebsiteId':_0x4330e5[_0x7431('0x2a')][_0x7431('0x18')][_0x7431('0x62')]||null,'originChannel':_0x4330e5['body'][_0x7431('0x18')][_0x7431('0x63')]||_0x7431('0x64'),'ChatOfflineMessageId':_0x4330e5[_0x7431('0x2a')]['message'][_0x7431('0x65')]||null},{'include':[{'model':db[_0x7431('0x66')],'as':_0x7431('0x67')}]});})['then'](function(_0x25695b){_0x178fc6[_0x7431('0x18')]=_0x25695b;if(!_0x178fc6[_0x7431('0x5b')][_0x7431('0x68')]){return;}return db[_0x7431('0x69')][_0x7431('0x24')]({'attributes':['id',_0x7431('0x6a')],'where':{'id':_0x178fc6['interaction'][_0x7431('0x68')]}});})[_0x7431('0x10')](function(_0x3071bb){if(_0x3071bb){_0x178fc6[_0x7431('0x43')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7431('0x6b'),'appdata':_0x3071bb[_0x7431('0x6a')]+','+(_0x178fc6['account'][_0x7431('0x6c')]||0xa),'interval':_0x7431('0x4b')});}if(!_0x178fc6[_0x7431('0x5b')][_0x7431('0x6d')]){return;}return db[_0x7431('0x6e')][_0x7431('0x24')]({'attributes':['id',_0x7431('0x6a')],'where':{'id':_0x178fc6[_0x7431('0x5b')][_0x7431('0x6d')]}});})[_0x7431('0x10')](function(_0x4f9001){if(_0x4f9001){_0x178fc6[_0x7431('0x43')][_0x7431('0x6f')]({'id':0x0,'priority':0x1,'app':_0x7431('0x70'),'appdata':_0x4f9001['name']+','+(_0x178fc6[_0x7431('0x41')][_0x7431('0x71')]||0x12c),'interval':_0x7431('0x4b')});}return respondWithRpcPromise('Start',_0x7431('0x72'),_0x178fc6);})[_0x7431('0x10')](function(_0x39ce1b){_0x53dba5(_0x39ce1b);})[_0x7431('0x23')](function(_0x10d474){_0x4fe1d7(_0x13d903[_0x7431('0x17')](0x1f4,_0x10d474[_0x7431('0x18')]));});});}; \ No newline at end of file +var _0xbd51=['message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','get','omit','account','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','from','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','update','subject','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x470940,_0x3a6afd){_0x470940=_0x470940-0x0;var _0x58b1df=_0xbd51[_0x470940];return _0x58b1df;};'use strict';var _=require(_0x1bd5('0x0'));var moment=require('moment');var BPromise=require(_0x1bd5('0x1'));var rs=require(_0x1bd5('0x2'));var Redis=require(_0x1bd5('0x3'));var db=require(_0x1bd5('0x4'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1bd5('0x5')][_0x1bd5('0x6')]({'port':0x232c});config[_0x1bd5('0x7')]=_['defaults'](config[_0x1bd5('0x7')],{'host':_0x1bd5('0x8'),'port':0x18eb});var socket=require(_0x1bd5('0x9'))(new Redis(config[_0x1bd5('0x7')]));require(_0x1bd5('0xa'))['register'](socket);function respondWithRpcPromise(_0x36ef1a,_0x5c8e0d,_0x2bd975){return new BPromise(function(_0x28df8e,_0x3b868a){return client[_0x1bd5('0xb')](_0x36ef1a,_0x2bd975)[_0x1bd5('0xc')](function(_0x3e3d06){logger['info'](_0x1bd5('0xd'),_0x5c8e0d,'request\x20sent');logger[_0x1bd5('0xe')](_0x1bd5('0xf'),_0x5c8e0d,_0x1bd5('0x10'),JSON[_0x1bd5('0x11')](_0x3e3d06));if(_0x3e3d06[_0x1bd5('0x12')]){if(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x13')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x3b868a(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x28df8e(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xd'),_0x5c8e0d,_0x1bd5('0x10'));_0x28df8e(_0x3e3d06[_0x1bd5('0x16')][_0x1bd5('0x14')]);}})['catch'](function(_0x53ad5e){logger[_0x1bd5('0x12')](_0x1bd5('0xd'),_0x5c8e0d,_0x53ad5e);_0x3b868a(_0x53ad5e);});});}exports[_0x1bd5('0x17')]=function(_0xb95d4e){var _0x459649=this;return new Promise(function(_0x2ff39a,_0x3fbb39){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'limit':_0xb95d4e['options']?_0xb95d4e[_0x1bd5('0x1a')]['limit']||null:null,'include':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_['map'](_0xb95d4e[_0x1bd5('0x1a')]['include'],function(_0x2ed551){return{'model':db[_0x2ed551[_0x1bd5('0x1f')]],'as':_0x2ed551['as'],'attributes':_0x2ed551[_0x1bd5('0x1d')],'include':_0x2ed551[_0x1bd5('0x1e')]?_['map'](_0x2ed551[_0x1bd5('0x1e')],function(_0x69bb17){return{'model':db[_0x69bb17[_0x1bd5('0x1f')]],'as':_0x69bb17['as'],'attributes':_0x69bb17[_0x1bd5('0x1d')],'include':_0x69bb17['include']?_[_0x1bd5('0x20')](_0x69bb17[_0x1bd5('0x1e')],function(_0x3595e9){return{'model':db[_0x3595e9[_0x1bd5('0x1f')]],'as':_0x3595e9['as'],'attributes':_0x3595e9[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bd5('0xc')](function(_0x4e72b2){logger[_0x1bd5('0x15')](_0x1bd5('0x17'),_0xb95d4e);logger[_0x1bd5('0xe')]('GetMailAccount',_0xb95d4e,JSON[_0x1bd5('0x11')](_0x4e72b2));_0x2ff39a(_0x4e72b2);})[_0x1bd5('0x21')](function(_0x345181){logger[_0x1bd5('0x12')](_0x1bd5('0x17'),_0x345181[_0x1bd5('0x14')],_0xb95d4e);_0x3fbb39(_0x459649['error'](0x1f4,_0x345181['message']));});});};exports[_0x1bd5('0x22')]=function(_0x305126){var _0x5542aa=this;return new Promise(function(_0x36649d,_0x198b88){return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'raw':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'include':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')],function(_0x18a9db){return{'model':db[_0x18a9db[_0x1bd5('0x1f')]],'as':_0x18a9db['as'],'attributes':_0x18a9db['attributes'],'include':_0x18a9db[_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x18a9db[_0x1bd5('0x1e')],function(_0x2f5a48){return{'model':db[_0x2f5a48[_0x1bd5('0x1f')]],'as':_0x2f5a48['as'],'attributes':_0x2f5a48[_0x1bd5('0x1d')],'include':_0x2f5a48[_0x1bd5('0x1e')]?_['map'](_0x2f5a48['include'],function(_0x155e4c){return{'model':db[_0x155e4c[_0x1bd5('0x1f')]],'as':_0x155e4c['as'],'attributes':_0x155e4c[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4595a0){if(_0x305126['options'][_0x1bd5('0x24')]===!![])_0x4595a0[_0x1bd5('0x25')](_0x1bd5('0x26'),_0x4595a0[_0x1bd5('0x27')]());logger[_0x1bd5('0x15')](_0x1bd5('0x22'),_0x305126);logger[_0x1bd5('0xe')](_0x1bd5('0x22'),_0x305126,JSON['stringify'](_0x4595a0));_0x36649d(_0x4595a0);})[_0x1bd5('0x21')](function(_0x2978d8){logger['error'](_0x1bd5('0x22'),_0x2978d8[_0x1bd5('0x14')],_0x305126);_0x198b88(_0x5542aa[_0x1bd5('0x12')](0x1f4,_0x2978d8['message']));});});};exports[_0x1bd5('0x28')]=function(_0x53482){var _0x2997a2=this;return new Promise(function(_0x4074f1,_0x4e8ff7){var _0x305720={'body':_0x53482[_0x1bd5('0x29')],'channel':_0x1bd5('0x2a')};var _0x11e996=_['difference'](_['keys'](db[_0x1bd5('0x2b')][_0x1bd5('0x2c')]),[_0x1bd5('0x2d'),'updatedAt',_0x1bd5('0x2e'),_0x1bd5('0x2f')]);var _0x574d95=![];if(_0x53482[_0x1bd5('0x29')]['id']){delete _0x53482['body']['id'];}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')]['from'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x31')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')])||_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')]===''){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x32')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x33')])){return _0x4e8ff7(_0x2997a2['error'](0x1f4,_0x1bd5('0x34')+_0x11e996));}if(!_[_0x1bd5('0x35')](_0x11e996,_0x53482[_0x1bd5('0x29')]['mapKey'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x36')+_0x11e996));}var _0x5bb8a6={};_0x5bb8a6[_0x53482[_0x1bd5('0x29')]['mapKey']]=_0x53482[_0x1bd5('0x29')]['from'];return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'where':{'id':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x37')],'as':'List','include':[{'model':db[_0x1bd5('0x2b')],'as':_0x1bd5('0x38'),'where':_0x5bb8a6,'limit':0x1,'order':[[_0x1bd5('0x39'),_0x1bd5('0x3a')]]}]},{'model':db[_0x1bd5('0x3b')],'as':_0x1bd5('0x3c')},{'model':db[_0x1bd5('0x3d')],'as':_0x1bd5('0x3e'),'include':[{'model':db['CloudProvider'],'as':_0x1bd5('0x3f')}]}]})[_0x1bd5('0xc')](function(_0x2a1ece){if(_0x2a1ece&&_0x2a1ece[_0x1bd5('0x40')]){var _0x34452a=_0x2a1ece[_0x1bd5('0x41')]({'plain':!![]});_0x305720['account']=_[_0x1bd5('0x42')](_0x34452a,[_0x1bd5('0x3c'),_0x1bd5('0x40')]);_0x305720[_0x1bd5('0x43')][_0x1bd5('0x26')]=_0x2a1ece[_0x1bd5('0x27')]();_0x305720[_0x1bd5('0x44')]=_0x34452a['Applications'];_0x305720['list']=_0x34452a[_0x1bd5('0x40')];_0x305720[_0x1bd5('0x44')]=_[_0x1bd5('0x45')](_0x305720['applications'],[_0x1bd5('0x46')],[_0x1bd5('0x47')]);if(_0x305720[_0x1bd5('0x43')]&&_0x305720[_0x1bd5('0x43')][_0x1bd5('0x48')]){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x49')]({'id':0x0,'priority':_0x305720['applications'][_0x1bd5('0x4a')]+0x1,'app':_0x1bd5('0x4b'),'appdata':'autoclose','interval':_0x1bd5('0x4c')});}if(_0x305720['account'][_0x1bd5('0x3c')]){delete _0x305720['account'][_0x1bd5('0x3c')];}if(_0x305720[_0x1bd5('0x43')]['List']){delete _0x305720[_0x1bd5('0x43')][_0x1bd5('0x40')];}if(_0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][_0x1bd5('0x4a')]){return _0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][0x0];}var _0x51aebe=_[_0x1bd5('0x4d')](_0x53482['body'],{'firstName':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')],'ListId':_0x34452a[_0x1bd5('0x2f')]});_0x51aebe[_0x53482['body']['mapKey']]=_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')];return db[_0x1bd5('0x2b')][_0x1bd5('0x4f')](_0x51aebe);}else{throw new Error(_0x1bd5('0x50'));}})[_0x1bd5('0xc')](function(_0x46e36c){_0x305720[_0x1bd5('0x51')]=_0x46e36c;if(_0x46e36c){if(!_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['messageId']){_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')]=rs[_0x1bd5('0x53')]()+'\x20'+_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x4e')];}var _0x17b3a9={'ContactId':_0x46e36c['id'],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'inReplyTo':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['from'],'cc':_0x53482['body'][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482['body'][_0x1bd5('0x14')]['attach'],'lastMsgAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x1bd5('0x23')]({'where':{'closed':![],'MailAccountId':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x56')],'as':'Messages','attributes':[_0x1bd5('0x52')],'where':{'messageId':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x57')]}}]})[_0x1bd5('0xc')](function(_0x47ca3f){if(_0x47ca3f){return[_0x47ca3f,![]];}return db['MailInteraction'][_0x1bd5('0x4f')](_0x17b3a9)[_0x1bd5('0xc')](function(_0x1a9ad2){return[_0x1a9ad2,!![]];});});}else{throw new Error(_0x1bd5('0x58'));}})['spread'](function(_0x551f22,_0x14dd41){if(_0x551f22){_0x574d95=_0x14dd41;if(!_0x14dd41){return _0x551f22[_0x1bd5('0x59')]({'inReplyTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')]['message']['from'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5a')],'attach':_0x551f22['attach']?_0x551f22[_0x1bd5('0x5b')]:_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x5b')],'substatus':null,'substatusAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x551f22;}}})[_0x1bd5('0xc')](function(_0x36d62e){_0x305720[_0x1bd5('0x5c')]=_0x36d62e[_0x1bd5('0x41')]({'plain':!![]});_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x5d')]=_0x574d95;return db[_0x1bd5('0x56')][_0x1bd5('0x4f')]({'body':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'MailInteractionId':_0x36d62e['id'],'direction':'in','ContactId':_0x305720[_0x1bd5('0x51')]['id'],'messageId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x52')],'from':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x4e')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['to'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5b')],'Attachments':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5e')],'originTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x5f')],'originCc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x60')],'bcc':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x61')],'ChatWebsiteId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x62')]||null,'originChannel':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['originChannel']||_0x1bd5('0x63'),'ChatOfflineMessageId':_0x53482['body']['message'][_0x1bd5('0x64')]||null},{'include':[{'model':db['Attachment'],'as':_0x1bd5('0x65')}]});})[_0x1bd5('0xc')](function(_0x560f20){_0x305720[_0x1bd5('0x14')]=_0x560f20;if(!_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x66')]){return;}return db[_0x1bd5('0x67')][_0x1bd5('0x23')]({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x66')]}});})[_0x1bd5('0xc')](function(_0xdd5183){if(_0xdd5183){_0x305720[_0x1bd5('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xdd5183[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x69')]||0xa),'interval':_0x1bd5('0x4c')});}if(!_0x305720['interaction'][_0x1bd5('0x6a')]){return;}return db['MailQueue']['find']({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x6a')]}});})[_0x1bd5('0xc')](function(_0x231556){if(_0x231556){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x6b')]({'id':0x0,'priority':0x1,'app':_0x1bd5('0x6c'),'appdata':_0x231556[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x6d')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1bd5('0x6e'),'startRouting',_0x305720);})['then'](function(_0x59b491){_0x4074f1(_0x59b491);})[_0x1bd5('0x21')](function(_0x524b86){_0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x524b86[_0x1bd5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 607b1bc..98ebde0 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 _0xc54c=['./mailAccount.events','remove','emit','register','length','mailAccount:'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xc54c,0x1c2));var _0xcc54=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0xc54c[_0x10852d];return _0x13a8d6;};'use strict';var MailAccountEvents=require(_0xcc54('0x0'));var events=['save',_0xcc54('0x1'),'update'];function createListener(_0x3295a2,_0x5e8e5b){return function(_0x12c235){_0x5e8e5b[_0xcc54('0x2')](_0x3295a2,_0x12c235);};}function removeListener(_0x5cace5,_0x41da53){return function(){MailAccountEvents['removeListener'](_0x5cace5,_0x41da53);};}exports[_0xcc54('0x3')]=function(_0xe3c555){for(var _0x3b80c9=0x0,_0x5badee=events[_0xcc54('0x4')];_0x3b80c9<_0x5badee;_0x3b80c9++){var _0x35f3ab=events[_0x3b80c9];var _0x15fb3b=createListener(_0xcc54('0x5')+_0x35f3ab,_0xe3c555);MailAccountEvents['on'](_0x35f3ab,_0x15fb3b);}}; \ No newline at end of file +var _0x78ce=['emit','register','length','mailAccount:','update'];(function(_0xa6c1a1,_0xf4f801){var _0x1d6ac7=function(_0x3346e8){while(--_0x3346e8){_0xa6c1a1['push'](_0xa6c1a1['shift']());}};_0x1d6ac7(++_0xf4f801);}(_0x78ce,0x158));var _0xe78c=function(_0x45d174,_0x47c6bb){_0x45d174=_0x45d174-0x0;var _0x3a0128=_0x78ce[_0x45d174];return _0x3a0128;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove',_0xe78c('0x0')];function createListener(_0x32c698,_0x107af8){return function(_0x41887a){_0x107af8[_0xe78c('0x1')](_0x32c698,_0x41887a);};}function removeListener(_0x3cdad6,_0x5768cb){return function(){MailAccountEvents['removeListener'](_0x3cdad6,_0x5768cb);};}exports[_0xe78c('0x2')]=function(_0x1e76fb){for(var _0x288d17=0x0,_0x45d0f9=events[_0xe78c('0x3')];_0x288d17<_0x45d0f9;_0x288d17++){var _0x72ec90=events[_0x288d17];var _0x2ac46b=createListener(_0xe78c('0x4')+_0x72ec90,_0x1e76fb);MailAccountEvents['on'](_0x72ec90,_0x2ac46b);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index effcec1..f3da283 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 _0x372e=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','multer'];(function(_0x275293,_0x31bf61){var _0x539b28=function(_0x36e11c){while(--_0x36e11c){_0x275293['push'](_0x275293['shift']());}};_0x539b28(++_0x31bf61);}(_0x372e,0x1df));var _0xe372=function(_0x645525,_0x143bfb){_0x645525=_0x645525-0x0;var _0x2a1af3=_0x372e[_0x645525];return _0x2a1af3;};'use strict';var multer=require(_0xe372('0x0'));var util=require(_0xe372('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe372('0x2'));var router=express[_0xe372('0x3')]();var fs_extra=require(_0xe372('0x4'));var auth=require(_0xe372('0x5'));var interaction=require(_0xe372('0x6'));var config=require(_0xe372('0x7'));var controller=require(_0xe372('0x8'));router[_0xe372('0x9')](_0xe372('0xa'),auth['isAuthenticated'](),controller[_0xe372('0xb')]);router[_0xe372('0xc')](_0xe372('0xa'),auth[_0xe372('0xd')](),controller[_0xe372('0xe')]);router[_0xe372('0xf')](_0xe372('0xa'),auth[_0xe372('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x437f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','/:id','delete','destroy','exports','multer','util','path'];(function(_0x41de3d,_0x41170d){var _0x2f3a63=function(_0x465e42){while(--_0x465e42){_0x41de3d['push'](_0x41de3d['shift']());}};_0x2f3a63(++_0x41170d);}(_0x437f,0x107));var _0xf437=function(_0x4a752b,_0x1a8b9a){_0x4a752b=_0x4a752b-0x0;var _0x4696a4=_0x437f[_0x4a752b];return _0x4696a4;};'use strict';var multer=require(_0xf437('0x0'));var util=require(_0xf437('0x1'));var path=require(_0xf437('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf437('0x3'));var auth=require(_0xf437('0x4'));var interaction=require(_0xf437('0x5'));var config=require(_0xf437('0x6'));var controller=require(_0xf437('0x7'));router['get']('/:id',auth[_0xf437('0x8')](),controller[_0xf437('0x9')]);router['put'](_0xf437('0xa'),auth[_0xf437('0x8')](),controller['update']);router[_0xf437('0xb')](_0xf437('0xa'),auth['isAuthenticated'](),controller[_0xf437('0xc')]);module[_0xf437('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 307b52e..997802a 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 _0x7bca=['exports','INTEGER','STRING','noop','TEXT'];(function(_0x24d24e,_0x4e17a4){var _0x20e068=function(_0x48d5e5){while(--_0x48d5e5){_0x24d24e['push'](_0x24d24e['shift']());}};_0x20e068(++_0x4e17a4);}(_0x7bca,0x163));var _0xa7bc=function(_0x5a7b40,_0x585230){_0x5a7b40=_0x5a7b40-0x0;var _0x463559=_0x7bca[_0x5a7b40];return _0x463559;};'use strict';var Sequelize=require('sequelize');module[_0xa7bc('0x0')]={'priority':{'type':Sequelize[_0xa7bc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa7bc('0x2')],'allowNull':![],'defaultValue':_0xa7bc('0x3')},'appdata':{'type':Sequelize[_0xa7bc('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa7bc('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xd748=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xd748,0x184));var _0x8d74=function(_0x529abc,_0x17b97e){_0x529abc=_0x529abc-0x0;var _0x453afa=_0xd748[_0x529abc];return _0x453afa;};'use strict';var Sequelize=require(_0x8d74('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8d74('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8d74('0x2')],'allowNull':![],'defaultValue':_0x8d74('0x3')},'appdata':{'type':Sequelize[_0x8d74('0x4')]()},'description':{'type':Sequelize[_0x8d74('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x8d74('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 024187c..1b50485 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 _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x2ec477,_0x1e155a){var _0x23f196=function(_0x3c3f74){while(--_0x3c3f74){_0x2ec477['push'](_0x2ec477['shift']());}};_0x23f196(++_0x1e155a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));}; \ No newline at end of file +var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x381f2d,_0x5a7622){var _0xbf594=function(_0x599c42){while(--_0x599c42){_0x381f2d['push'](_0x381f2d['shift']());}};_0xbf594(++_0x5a7622);}(_0xb43b,0x1b2));var _0xbb43=function(_0x40fc58,_0xe7b094){_0x40fc58=_0x40fc58-0x0;var _0x11974f=_0xb43b[_0x40fc58];return _0x11974f;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index ca222c7..27e365f 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 _0xd4bc=['mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0xd4bc,0x197));var _0xcd4b=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0xd4bc[_0x4fa291];return _0x506d9b;};'use strict';var _=require(_0xcd4b('0x0'));var util=require(_0xcd4b('0x1'));var logger=require(_0xcd4b('0x2'))(_0xcd4b('0x3'));var moment=require(_0xcd4b('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd4b('0x5'));var fs=require('fs');var path=require(_0xcd4b('0x6'));var rimraf=require(_0xcd4b('0x7'));var config=require(_0xcd4b('0x8'));var attributes=require(_0xcd4b('0x9'));module[_0xcd4b('0xa')]=function(_0x2ff4a6,_0x1e5837){return _0x2ff4a6[_0xcd4b('0xb')](_0xcd4b('0xc'),attributes,{'tableName':_0xcd4b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd4b('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb168=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','util'];(function(_0x13c704,_0x485ae0){var _0x3a2103=function(_0x32a200){while(--_0x32a200){_0x13c704['push'](_0x13c704['shift']());}};_0x3a2103(++_0x485ae0);}(_0xb168,0x67));var _0x8b16=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xb168[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require('lodash');var util=require(_0x8b16('0x0'));var logger=require(_0x8b16('0x1'))(_0x8b16('0x2'));var moment=require(_0x8b16('0x3'));var BPromise=require(_0x8b16('0x4'));var rp=require(_0x8b16('0x5'));var fs=require('fs');var path=require(_0x8b16('0x6'));var rimraf=require('rimraf');var config=require(_0x8b16('0x7'));var attributes=require(_0x8b16('0x8'));module[_0x8b16('0x9')]=function(_0x718878,_0x589a97){return _0x718878[_0x8b16('0xa')](_0x8b16('0xb'),attributes,{'tableName':_0x8b16('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index cda30a2..6729ffc 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 _0xbc54=['code','message','catch','UpdateMailApplication','MailApplication','update','options','raw','attributes','limit','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0xbc54,0xeb));var _0x4bc5=function(_0xac51b0,_0x435d3a){_0xac51b0=_0xac51b0-0x0;var _0x25d43b=_0xbc54[_0xac51b0];return _0x25d43b;};'use strict';var _=require(_0x4bc5('0x0'));var util=require('util');var moment=require(_0x4bc5('0x1'));var BPromise=require(_0x4bc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4bc5('0x3'))['db'];var utils=require(_0x4bc5('0x4'));var logger=require('../../config/logger')(_0x4bc5('0x5'));var config=require('../../config/environment');var jayson=require(_0x4bc5('0x6'));var client=jayson[_0x4bc5('0x7')][_0x4bc5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x66991f,_0x3e7d8f,_0x5da458){return new BPromise(function(_0x1330c2,_0x322868){return client[_0x4bc5('0x9')](_0x66991f,_0x5da458)[_0x4bc5('0xa')](function(_0x489462){logger[_0x4bc5('0xb')](_0x4bc5('0xc'),_0x3e7d8f,_0x4bc5('0xd'));logger['debug'](_0x4bc5('0xe'),_0x3e7d8f,_0x4bc5('0xd'),JSON[_0x4bc5('0xf')](_0x489462));if(_0x489462[_0x4bc5('0x10')]){if(_0x489462[_0x4bc5('0x10')][_0x4bc5('0x11')]===0x1f4){logger[_0x4bc5('0x10')](_0x4bc5('0xc'),_0x3e7d8f,_0x489462['error'][_0x4bc5('0x12')]);return _0x322868(_0x489462[_0x4bc5('0x10')][_0x4bc5('0x12')]);}logger[_0x4bc5('0x10')]('MailApplication,\x20%s,\x20%s',_0x3e7d8f,_0x489462[_0x4bc5('0x10')]['message']);return _0x1330c2(_0x489462['error'][_0x4bc5('0x12')]);}else{logger[_0x4bc5('0xb')](_0x4bc5('0xc'),_0x3e7d8f,'request\x20sent');_0x1330c2(_0x489462['result']['message']);}})[_0x4bc5('0x13')](function(_0x36f5dd){logger[_0x4bc5('0x10')](_0x4bc5('0xc'),_0x3e7d8f,_0x36f5dd);_0x322868(_0x36f5dd);});});}exports[_0x4bc5('0x14')]=function(_0x5d836e){var _0xc62fb7=this;return new Promise(function(_0x4e2bec,_0x29a636){return db[_0x4bc5('0x15')][_0x4bc5('0x16')](_0x5d836e['body'],{'raw':_0x5d836e[_0x4bc5('0x17')]?_0x5d836e[_0x4bc5('0x17')][_0x4bc5('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d836e[_0x4bc5('0x17')]?_0x5d836e[_0x4bc5('0x17')]['where']||null:null,'attributes':_0x5d836e[_0x4bc5('0x17')]?_0x5d836e[_0x4bc5('0x17')][_0x4bc5('0x19')]||null:null,'limit':_0x5d836e[_0x4bc5('0x17')]?_0x5d836e[_0x4bc5('0x17')][_0x4bc5('0x1a')]||null:null})['then'](function(_0x271ef1){logger['info'](_0x4bc5('0x14'),_0x5d836e);logger[_0x4bc5('0x1b')]('UpdateMailApplication',_0x5d836e,JSON[_0x4bc5('0xf')](_0x271ef1));_0x4e2bec(_0x271ef1);})[_0x4bc5('0x13')](function(_0x1bc731){logger['error'](_0x4bc5('0x14'),_0x1bc731['message'],_0x5d836e);_0x29a636(_0xc62fb7['error'](0x1f4,_0x1bc731[_0x4bc5('0x12')]));});});}; \ No newline at end of file +var _0x385e=['MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x385e,0x1bc));var _0xe385=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0x385e[_0x171fdc];return _0x3782ea;};'use strict';var _=require(_0xe385('0x0'));var util=require(_0xe385('0x1'));var moment=require(_0xe385('0x2'));var BPromise=require(_0xe385('0x3'));var rs=require(_0xe385('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe385('0x5'))['db'];var utils=require(_0xe385('0x6'));var logger=require(_0xe385('0x7'))(_0xe385('0x8'));var config=require('../../config/environment');var jayson=require(_0xe385('0x9'));var client=jayson[_0xe385('0xa')][_0xe385('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c39cc,_0x585f95,_0x1235c6){return new BPromise(function(_0x2d3915,_0x3b3755){return client[_0xe385('0xc')](_0x2c39cc,_0x1235c6)[_0xe385('0xd')](function(_0xa3452d){logger[_0xe385('0xe')](_0xe385('0xf'),_0x585f95,_0xe385('0x10'));logger[_0xe385('0x11')](_0xe385('0x12'),_0x585f95,_0xe385('0x10'),JSON[_0xe385('0x13')](_0xa3452d));if(_0xa3452d[_0xe385('0x14')]){if(_0xa3452d[_0xe385('0x14')][_0xe385('0x15')]===0x1f4){logger[_0xe385('0x14')]('MailApplication,\x20%s,\x20%s',_0x585f95,_0xa3452d[_0xe385('0x14')]['message']);return _0x3b3755(_0xa3452d['error'][_0xe385('0x16')]);}logger[_0xe385('0x14')]('MailApplication,\x20%s,\x20%s',_0x585f95,_0xa3452d[_0xe385('0x14')][_0xe385('0x16')]);return _0x2d3915(_0xa3452d[_0xe385('0x14')][_0xe385('0x16')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x585f95,_0xe385('0x10'));_0x2d3915(_0xa3452d[_0xe385('0x17')]['message']);}})['catch'](function(_0x2c8dfc){logger['error']('MailApplication,\x20%s,\x20%s',_0x585f95,_0x2c8dfc);_0x3b3755(_0x2c8dfc);});});}exports[_0xe385('0x18')]=function(_0x530cc2){var _0x17e530=this;return new Promise(function(_0x5ec6de,_0x945191){return db[_0xe385('0x19')][_0xe385('0x1a')](_0x530cc2[_0xe385('0x1b')],{'raw':_0x530cc2['options']?_0x530cc2[_0xe385('0x1c')][_0xe385('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x530cc2[_0xe385('0x1c')]?_0x530cc2[_0xe385('0x1c')][_0xe385('0x1e')]||null:null,'attributes':_0x530cc2[_0xe385('0x1c')]?_0x530cc2['options'][_0xe385('0x1f')]||null:null,'limit':_0x530cc2[_0xe385('0x1c')]?_0x530cc2['options']['limit']||null:null})[_0xe385('0xd')](function(_0x3f52de){logger[_0xe385('0xe')](_0xe385('0x18'),_0x530cc2);logger['debug'](_0xe385('0x18'),_0x530cc2,JSON[_0xe385('0x13')](_0x3f52de));_0x5ec6de(_0x3f52de);})[_0xe385('0x20')](function(_0x303cd8){logger[_0xe385('0x14')]('UpdateMailApplication',_0x303cd8[_0xe385('0x16')],_0x530cc2);_0x945191(_0x17e530[_0xe385('0x14')](0x1f4,_0x303cd8['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d75a705..c56229c 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 _0x5b05=['delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','mailinteraction:update','update'];(function(_0x22551e,_0x5772eb){var _0x63f68c=function(_0x3369f8){while(--_0x3369f8){_0x22551e['push'](_0x22551e['shift']());}};_0x63f68c(++_0x5772eb);}(_0x5b05,0xe5));var _0x55b0=function(_0x3d1f0f,_0x589ead){_0x3d1f0f=_0x3d1f0f-0x0;var _0x79eca3=_0x5b05[_0x3d1f0f];return _0x79eca3;};'use strict';var express=require(_0x55b0('0x0'));var router=express[_0x55b0('0x1')]();var auth=require(_0x55b0('0x2'));var interaction=require(_0x55b0('0x3'));var controller=require('./mailInteraction.controller');router[_0x55b0('0x4')]('/',auth[_0x55b0('0x5')](),controller[_0x55b0('0x6')]);router[_0x55b0('0x4')](_0x55b0('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x55b0('0x4')]('/:id',auth[_0x55b0('0x5')](),controller[_0x55b0('0x8')]);router[_0x55b0('0x4')]('/:id/messages',auth[_0x55b0('0x5')](),controller[_0x55b0('0x9')]);router['get'](_0x55b0('0xa'),auth[_0x55b0('0x5')](),controller[_0x55b0('0xb')]);router[_0x55b0('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x55b0('0xc')](_0x55b0('0xd'),auth[_0x55b0('0x5')](),controller[_0x55b0('0xe')]);router[_0x55b0('0xc')](_0x55b0('0xf'),auth[_0x55b0('0x5')](),interaction[_0x55b0('0x10')](_0x55b0('0x11'),_0x55b0('0x12')),controller['addTags']);router['put']('/:id',auth[_0x55b0('0x5')](),interaction[_0x55b0('0x10')](_0x55b0('0x11'),_0x55b0('0x13')),controller[_0x55b0('0x14')]);router[_0x55b0('0x15')]('/:id',auth[_0x55b0('0x5')](),interaction[_0x55b0('0x10')](_0x55b0('0x11'),_0x55b0('0x16')),controller['destroy']);router[_0x55b0('0x15')]('/:id/tags',auth['isAuthenticated'](),controller[_0x55b0('0x17')]);module[_0x55b0('0x18')]=router; \ No newline at end of file +var _0xa722=['post','/:id/messages','/:id/tags','mail','mailinteraction:addtags','put','mailinteraction:update','/:id','tracked','destroy','delete','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','index','get','/describe','isAuthenticated','describe','getMessages','/:id/download','create'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xa722,0x1c7));var _0x2a72=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0xa722[_0x296809];return _0x18c0d3;};'use strict';var express=require(_0x2a72('0x0'));var router=express[_0x2a72('0x1')]();var auth=require(_0x2a72('0x2'));var interaction=require(_0x2a72('0x3'));var controller=require(_0x2a72('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x2a72('0x5')]);router[_0x2a72('0x6')](_0x2a72('0x7'),auth[_0x2a72('0x8')](),controller[_0x2a72('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2a72('0x6')]('/:id/messages',auth[_0x2a72('0x8')](),controller[_0x2a72('0xa')]);router[_0x2a72('0x6')](_0x2a72('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x2a72('0x8')](),controller[_0x2a72('0xc')]);router[_0x2a72('0xd')](_0x2a72('0xe'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x2a72('0xf'),auth[_0x2a72('0x8')](),interaction['tracked'](_0x2a72('0x10'),_0x2a72('0x11')),controller['addTags']);router[_0x2a72('0x12')]('/:id',auth[_0x2a72('0x8')](),interaction['tracked'](_0x2a72('0x10'),_0x2a72('0x13')),controller['update']);router['delete'](_0x2a72('0x14'),auth[_0x2a72('0x8')](),interaction[_0x2a72('0x15')](_0x2a72('0x10'),'mailinteraction:destroy'),controller[_0x2a72('0x16')]);router[_0x2a72('0x17')](_0x2a72('0xf'),auth['isAuthenticated'](),controller[_0x2a72('0x18')]);module[_0x2a72('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index e66374b..39a7181 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 _0x2f7b=['exports','STRING','TEXT','BOOLEAN','DATE','ENUM','out','sequelize','iconv'];(function(_0x4034c2,_0x3253e5){var _0x1cc244=function(_0x409dd0){while(--_0x409dd0){_0x4034c2['push'](_0x4034c2['shift']());}};_0x1cc244(++_0x3253e5);}(_0x2f7b,0x8e));var _0xb2f7=function(_0x2bd5b0,_0x3470ed){_0x2bd5b0=_0x2bd5b0-0x0;var _0x13f4d0=_0x2f7b[_0x2bd5b0];return _0x13f4d0;};'use strict';var Sequelize=require(_0xb2f7('0x0'));var iconv=require(_0xb2f7('0x1'));module[_0xb2f7('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb2f7('0x3')]},'secondDisposition':{'type':Sequelize[_0xb2f7('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb2f7('0x3')]},'inReplyTo':{'type':Sequelize[_0xb2f7('0x3')](0x1fe)},'to':{'type':Sequelize[_0xb2f7('0x3')]},'cc':{'type':Sequelize[_0xb2f7('0x4')]('long')},'subject':{'type':Sequelize[_0xb2f7('0x4')]()},'attach':{'type':Sequelize[_0xb2f7('0x5')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb2f7('0x6')]},'substatus':{'type':Sequelize[_0xb2f7('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xb2f7('0x6')]},'firstMsgDirection':{'type':Sequelize[_0xb2f7('0x7')]('in',_0xb2f7('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb2f7('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb2f7('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb2f7('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe8a7=['ENUM','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','out'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0xe8a7,0x136));var _0x7e8a=function(_0xa69a96,_0x286688){_0xa69a96=_0xa69a96-0x0;var _0x51918a=_0xe8a7[_0xa69a96];return _0x51918a;};'use strict';var Sequelize=require(_0x7e8a('0x0'));var iconv=require(_0x7e8a('0x1'));module[_0x7e8a('0x2')]={'closed':{'type':Sequelize[_0x7e8a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7e8a('0x4')]},'disposition':{'type':Sequelize[_0x7e8a('0x5')]},'secondDisposition':{'type':Sequelize[_0x7e8a('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7e8a('0x5')]},'note':{'type':Sequelize[_0x7e8a('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x7e8a('0x5')]},'cc':{'type':Sequelize[_0x7e8a('0x6')](_0x7e8a('0x7'))},'subject':{'type':Sequelize[_0x7e8a('0x6')]()},'attach':{'type':Sequelize[_0x7e8a('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x7e8a('0x4')]},'substatus':{'type':Sequelize[_0x7e8a('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7e8a('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7e8a('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7e8a('0x9')]('in',_0x7e8a('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7e8a('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 1b42bcf..9becda1 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 _0xfbcd=['catch','show','keys','MailInteraction','query','filters','intersection','fields','attributes','length','model','includeAll','include','merge','find','create','body','params','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','true','rows','addTags','setTags','Tag','mailInteractionTags:save','removeTags','download','unix','root','files','tmp','server','attachments','join','transcript-%d-%s.zip','push','Attachment','Attachments','from','Messages','get','missing.recipient@your.company.com','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','basename','existsSync','writeFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','util','path','lodash','ioredis','../../components/interaction/service','../../config/environment','html-entities','redis','localhost','./mailInteraction.socket','register','sendStatus','end','status','json','limit','count','offset','set','Content-Range','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','getOptions','findAll','mail','user'];(function(_0xb3275c,_0x2623c3){var _0x58e50b=function(_0x2303a3){while(--_0x2303a3){_0xb3275c['push'](_0xb3275c['shift']());}};_0x58e50b(++_0x2623c3);}(_0xfbcd,0x11c));var _0xdfbc=function(_0x597775,_0x12141b){_0x597775=_0x597775-0x0;var _0xd92b5=_0xfbcd[_0x597775];return _0xd92b5;};'use strict';var emlformat=require(_0xdfbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdfbc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xdfbc('0x2'));var path=require(_0xdfbc('0x3'));var fs=require('fs');var _=require(_0xdfbc('0x4'));var juice=require('juice');var Redis=require(_0xdfbc('0x5'));var interaction=require(_0xdfbc('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xdfbc('0x7'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xdfbc('0x8'));config['redis']=_['defaults'](config[_0xdfbc('0x9')],{'host':_0xdfbc('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdfbc('0xb'))[_0xdfbc('0xc')](socket);function respondWithStatusCode(_0x19f556,_0x16ab42){_0x16ab42=_0x16ab42||0xcc;return function(_0xed3b8d){if(_0xed3b8d){return _0x19f556[_0xdfbc('0xd')](_0x16ab42);}return _0x19f556['status'](_0x16ab42)[_0xdfbc('0xe')]();};}function respondWithResult(_0x831b02,_0x49e570){_0x49e570=_0x49e570||0xc8;return function(_0x267dec){if(_0x267dec){return _0x831b02[_0xdfbc('0xf')](_0x49e570)[_0xdfbc('0x10')](_0x267dec);}};}function respondWithFilteredResult(_0x38e15d,_0x14cca5){return function(_0x4f7360){if(_0x4f7360){var _0x2c00e1=typeof _0x14cca5['offset']==='undefined'&&typeof _0x14cca5[_0xdfbc('0x11')]==='undefined';var _0xa07cf5=_0x4f7360[_0xdfbc('0x12')];var _0x4dbacf=_0x2c00e1?0x0:_0x14cca5[_0xdfbc('0x13')];var _0xdeaf46=_0x2c00e1?_0x4f7360[_0xdfbc('0x12')]:_0x14cca5[_0xdfbc('0x13')]+_0x14cca5['limit'];var _0x266797;if(_0xdeaf46>=_0xa07cf5){_0xdeaf46=_0xa07cf5;_0x266797=0xc8;}else{_0x266797=0xce;}_0x38e15d[_0xdfbc('0xf')](_0x266797);return _0x38e15d[_0xdfbc('0x14')](_0xdfbc('0x15'),_0x4dbacf+'-'+_0xdeaf46+'/'+_0xa07cf5)['json'](_0x4f7360);}return null;};}function saveUpdates(_0x25951f){return function(_0x1c604f){if(_0x1c604f){return _0x1c604f[_0xdfbc('0x16')](_0x25951f)[_0xdfbc('0x17')](function(_0x26ca6a){return _0x26ca6a;});}return null;};}function removeEntity(_0x15640e){return function(_0x632b47){if(_0x632b47){return _0x632b47[_0xdfbc('0x18')]()[_0xdfbc('0x17')](function(){_0x15640e[_0xdfbc('0xf')](0xcc)[_0xdfbc('0xe')]();});}};}function handleEntityNotFound(_0x7f2690){return function(_0x456e75){if(!_0x456e75){_0x7f2690[_0xdfbc('0xd')](0x194);}return _0x456e75;};}function handleError(_0x5c92be,_0x583c5e){_0x583c5e=_0x583c5e||0x1f4;return function(_0x41adc2){logger[_0xdfbc('0x19')](_0x41adc2['stack']);if(_0x41adc2[_0xdfbc('0x1a')]){delete _0x41adc2[_0xdfbc('0x1a')];}_0x5c92be['status'](_0x583c5e)[_0xdfbc('0x1b')](_0x41adc2);};}exports['index']=function(_0x44ec03,_0x56fa3a){var _0x26f986={};var _0x50c051=_[_0xdfbc('0x1c')](db['MailInteraction'][_0xdfbc('0x1d')],function(_0x399851){return{'name':_0x399851[_0xdfbc('0x1e')],'type':_0x399851[_0xdfbc('0x1f')][_0xdfbc('0x20')]};});_0x26f986=qs[_0xdfbc('0x21')](_0x50c051,_0x44ec03);return interaction[_0xdfbc('0x22')](_0xdfbc('0x23'),_0x44ec03['query'],_0x44ec03[_0xdfbc('0x24')],_0x26f986,_0x50c051)[_0xdfbc('0x17')](respondWithFilteredResult(_0x56fa3a,_0x26f986))[_0xdfbc('0x25')](handleError(_0x56fa3a,null));};exports[_0xdfbc('0x26')]=function(_0x3bebe2,_0x4e4ec9){var _0x5b57d2={'raw':![],'where':{'id':_0x3bebe2['params']['id']}},_0x395c40={};_0x395c40['model']=_[_0xdfbc('0x27')](db[_0xdfbc('0x28')][_0xdfbc('0x1d')]);_0x395c40['query']=_[_0xdfbc('0x27')](_0x3bebe2[_0xdfbc('0x29')]);_0x395c40[_0xdfbc('0x2a')]=_['intersection'](_0x395c40['model'],_0x395c40[_0xdfbc('0x29')]);_0x5b57d2['attributes']=_[_0xdfbc('0x2b')](_0x395c40['model'],qs[_0xdfbc('0x2c')](_0x3bebe2[_0xdfbc('0x29')][_0xdfbc('0x2c')]));_0x5b57d2['attributes']=_0x5b57d2[_0xdfbc('0x2d')][_0xdfbc('0x2e')]?_0x5b57d2[_0xdfbc('0x2d')]:_0x395c40[_0xdfbc('0x2f')];if(_0x3bebe2['query'][_0xdfbc('0x30')]){_0x5b57d2[_0xdfbc('0x31')]=[{'all':!![]}];}_0x5b57d2=_[_0xdfbc('0x32')]({},_0x5b57d2,_0x3bebe2['options']);return db[_0xdfbc('0x28')][_0xdfbc('0x33')](_0x5b57d2)['then'](handleEntityNotFound(_0x4e4ec9,null))[_0xdfbc('0x17')](respondWithResult(_0x4e4ec9,null))[_0xdfbc('0x25')](handleError(_0x4e4ec9,null));};exports[_0xdfbc('0x34')]=function(_0x5e9d5f,_0x2bd094){return db[_0xdfbc('0x28')][_0xdfbc('0x34')](_0x5e9d5f['body'],{})[_0xdfbc('0x17')](respondWithResult(_0x2bd094,0xc9))[_0xdfbc('0x25')](handleError(_0x2bd094,null));};exports[_0xdfbc('0x16')]=function(_0x21fc92,_0x4de379){if(_0x21fc92[_0xdfbc('0x35')]['id']){delete _0x21fc92[_0xdfbc('0x35')]['id'];}return db[_0xdfbc('0x28')][_0xdfbc('0x33')]({'where':{'id':_0x21fc92[_0xdfbc('0x36')]['id']}})['then'](handleEntityNotFound(_0x4de379,null))['then'](saveUpdates(_0x21fc92['body'],null))[_0xdfbc('0x17')](respondWithResult(_0x4de379,null))['catch'](handleError(_0x4de379,null));};exports[_0xdfbc('0x18')]=function(_0x5da9a2,_0x3867f8){return db[_0xdfbc('0x28')][_0xdfbc('0x33')]({'where':{'id':_0x5da9a2[_0xdfbc('0x36')]['id']}})[_0xdfbc('0x17')](handleEntityNotFound(_0x3867f8,null))[_0xdfbc('0x17')](removeEntity(_0x3867f8,null))[_0xdfbc('0x25')](handleError(_0x3867f8,null));};exports[_0xdfbc('0x37')]=function(_0xec601c,_0x521386){return db['MailInteraction'][_0xdfbc('0x37')]()[_0xdfbc('0x17')](respondWithResult(_0x521386,null))[_0xdfbc('0x25')](handleError(_0x521386,null));};exports[_0xdfbc('0x38')]=function(_0x194dc4,_0xa8bc3d){return db[_0xdfbc('0x39')][_0xdfbc('0x33')]({'where':{'id':_0x194dc4['params']['id']}})['then'](handleEntityNotFound(_0xa8bc3d,null))['then'](function(_0xb3e7c0){if(_0xb3e7c0){return _0xb3e7c0['addMessage'](_0x194dc4[_0xdfbc('0x35')][_0xdfbc('0x3a')],_[_0xdfbc('0x3b')](_0x194dc4['body'],[_0xdfbc('0x3a'),'id'])||{});}})['then'](respondWithResult(_0xa8bc3d,null))['catch'](handleError(_0xa8bc3d,null));};exports['getMessages']=function(_0x332e87,_0x3190e7){var _0x367aa5={'raw':![],'where':{}};var _0x3f7c38={};var _0x192a20={'count':0x0,'rows':[]};return db[_0xdfbc('0x28')][_0xdfbc('0x3c')]({'where':{'id':_0x332e87[_0xdfbc('0x36')]['id']}})[_0xdfbc('0x17')](handleEntityNotFound(_0x3190e7,null))[_0xdfbc('0x17')](function(_0x275ea7){if(_0x275ea7){_0x3f7c38[_0xdfbc('0x2f')]=_[_0xdfbc('0x27')](db['MailMessage']['rawAttributes']);_0x3f7c38[_0xdfbc('0x29')]=_[_0xdfbc('0x27')](_0x332e87[_0xdfbc('0x29')]);_0x3f7c38[_0xdfbc('0x2a')]=_[_0xdfbc('0x2b')](_0x3f7c38[_0xdfbc('0x2f')],_0x3f7c38[_0xdfbc('0x29')]);_0x367aa5[_0xdfbc('0x2d')]=_[_0xdfbc('0x2b')](_0x3f7c38[_0xdfbc('0x2f')],qs[_0xdfbc('0x2c')](_0x332e87[_0xdfbc('0x29')][_0xdfbc('0x2c')]));_0x367aa5[_0xdfbc('0x2d')]=_0x367aa5[_0xdfbc('0x2d')]['length']?_0x367aa5[_0xdfbc('0x2d')]:_0x3f7c38[_0xdfbc('0x2f')];if(!_0x332e87['query'][_0xdfbc('0x3d')](_0xdfbc('0x3e'))){_0x367aa5[_0xdfbc('0x11')]=qs[_0xdfbc('0x11')](_0x332e87['query']['limit']);_0x367aa5[_0xdfbc('0x13')]=qs[_0xdfbc('0x13')](_0x332e87[_0xdfbc('0x29')][_0xdfbc('0x13')]);}_0x367aa5[_0xdfbc('0x3f')]=qs[_0xdfbc('0x40')](_0x332e87[_0xdfbc('0x29')][_0xdfbc('0x40')]);_0x367aa5[_0xdfbc('0x41')]=qs['filters'](_[_0xdfbc('0x42')](_0x332e87[_0xdfbc('0x29')],_0x3f7c38[_0xdfbc('0x2a')]));_0x367aa5[_0xdfbc('0x41')][_0xdfbc('0x43')]=_0x275ea7['id'];if(_0x332e87[_0xdfbc('0x29')][_0xdfbc('0x44')]){_0x367aa5['where']=_[_0xdfbc('0x32')](_0x367aa5[_0xdfbc('0x41')],{'$or':_[_0xdfbc('0x1c')](_0x367aa5[_0xdfbc('0x2d')],function(_0x5cecb8){var _0x25cfec={};_0x25cfec[_0x5cecb8]={'$like':'%'+_0x332e87[_0xdfbc('0x29')][_0xdfbc('0x44')]+'%'};return _0x25cfec;})});}if(_0x332e87['query'][_0xdfbc('0x45')]){var _0x13aeb3=_0x332e87[_0xdfbc('0x29')][_0xdfbc('0x45')][_0xdfbc('0x46')](',');var _0x4e3690={};_0x4e3690[_0x13aeb3[0x0]]={'$gte':moment(_0x13aeb3[0x1])[_0xdfbc('0x47')](_0xdfbc('0x48'))};_0x367aa5['where']=_[_0xdfbc('0x32')](_0x367aa5['where'],_0x4e3690);}_0x367aa5=_[_0xdfbc('0x32')]({},_0x367aa5,_0x332e87[_0xdfbc('0x49')]);return db[_0xdfbc('0x39')][_0xdfbc('0x12')]({'where':_0x367aa5[_0xdfbc('0x41')]})[_0xdfbc('0x17')](function(_0x44b569){_0x192a20['count']=_0x44b569;if(_0x332e87['query'][_0xdfbc('0x30')]){_0x367aa5[_0xdfbc('0x31')]=[{'all':!![]}];}return db[_0xdfbc('0x39')]['findAll'](_0x367aa5);})['then'](function(_0x4b2e31){if(_0x332e87[_0xdfbc('0x29')]['inlineCss']===_0xdfbc('0x4a')){for(var _0x554b53=0x0;_0x554b53<_0x4b2e31[_0xdfbc('0x2e')];_0x554b53++){_0x4b2e31[_0x554b53][_0xdfbc('0x35')]=juice(_0x4b2e31[_0x554b53][_0xdfbc('0x35')]);}}_0x192a20[_0xdfbc('0x4b')]=_0x4b2e31;return _0x192a20;});}})[_0xdfbc('0x17')](respondWithFilteredResult(_0x3190e7,_0x367aa5))[_0xdfbc('0x25')](handleError(_0x3190e7,null));};exports[_0xdfbc('0x4c')]=function(_0x30700c,_0x24a55d){return db[_0xdfbc('0x28')][_0xdfbc('0x33')]({'where':{'id':_0x30700c[_0xdfbc('0x36')]['id']}})[_0xdfbc('0x17')](handleEntityNotFound(_0x24a55d,null))[_0xdfbc('0x17')](function(_0x49146c){if(_0x49146c){return _0x49146c[_0xdfbc('0x4d')](_0x30700c['body'][_0xdfbc('0x3a')],_[_0xdfbc('0x3b')](_0x30700c[_0xdfbc('0x35')],[_0xdfbc('0x3a'),'id'])||{})['spread'](function(){return db[_0xdfbc('0x4e')]['findAll']({'attributes':['id',_0xdfbc('0x1a'),'color'],'where':{'id':_0x30700c[_0xdfbc('0x35')][_0xdfbc('0x3a')]}});})[_0xdfbc('0x17')](function(_0x2b096f){socket['emit'](_0xdfbc('0x4f'),{'id':Number(_0x30700c[_0xdfbc('0x36')]['id']),'tags':_0x2b096f||[]});return{'id':Number(_0x30700c[_0xdfbc('0x36')]['id']),'tags':_0x2b096f||[]};});}})['then'](respondWithResult(_0x24a55d,null))[_0xdfbc('0x25')](handleError(_0x24a55d,null));};exports[_0xdfbc('0x50')]=function(_0x8819b4,_0x46ca46){return db[_0xdfbc('0x28')]['find']({'where':{'id':_0x8819b4['params']['id']}})[_0xdfbc('0x17')](handleEntityNotFound(_0x46ca46,null))[_0xdfbc('0x17')](function(_0x2141d6){if(_0x2141d6){return _0x2141d6[_0xdfbc('0x50')](_0x8819b4['query']['ids']);}})[_0xdfbc('0x17')](respondWithStatusCode(_0x46ca46,null))[_0xdfbc('0x25')](handleError(_0x46ca46,null));};exports[_0xdfbc('0x51')]=function(_0x3053a7,_0x20117b){var _0x313746=moment()[_0xdfbc('0x52')]()['toString']();var _0x566fb5=path['join'](config[_0xdfbc('0x53')],'server',_0xdfbc('0x54'),_0xdfbc('0x55'));var _0x8e48e2=path['join'](config[_0xdfbc('0x53')],_0xdfbc('0x56'),_0xdfbc('0x54'),_0xdfbc('0x57'));var _0x5b643b=path[_0xdfbc('0x58')](_0x566fb5,_0x313746);var _0x9d7677=util[_0xdfbc('0x47')](_0xdfbc('0x59'),_0x3053a7[_0xdfbc('0x36')]['id'],_0x313746);var _0x633d1a=path[_0xdfbc('0x58')](_0x566fb5,_0x9d7677);var _0x351fc7=[];if(_0x3053a7[_0xdfbc('0x29')][_0xdfbc('0x57')]){_0x351fc7[_0xdfbc('0x5a')]({'model':db[_0xdfbc('0x5b')],'as':_0xdfbc('0x5c'),'raw':!![]});}var _0x12a9e0=[{'model':db[_0xdfbc('0x39')],'as':'Messages','attributes':['id',_0xdfbc('0x35'),_0xdfbc('0x5d'),'to','cc','bcc','subject','createdAt'],'where':{'secret':![]},'order':qs[_0xdfbc('0x40')]('id'),'include':_0x351fc7}];return db[_0xdfbc('0x28')]['find']({'where':{'id':_0x3053a7[_0xdfbc('0x36')]['id']},'include':_0x12a9e0})[_0xdfbc('0x17')](handleEntityNotFound(_0x20117b,null))[_0xdfbc('0x17')](function(_0xffeed0){if(_0xffeed0&&_0xffeed0[_0xdfbc('0x5e')]){var _0x4686e7=_0xffeed0[_0xdfbc('0x5f')]({'plain':!![]});fs['mkdirSync'](_0x5b643b);return BPromise['each'](_0x4686e7[_0xdfbc('0x5e')],function(_0x452571,_0x4fbbeb){var _0x19f45d={'from':_0x452571[_0xdfbc('0x5d')],'to':_0x452571['to']||_0xdfbc('0x60'),'subject':_0x452571[_0xdfbc('0x61')],'html':htmlEntities['decode'](_0x452571[_0xdfbc('0x35')]),'headers':{'Date':moment(_0x452571['createdAt'])[_0xdfbc('0x47')](_0xdfbc('0x62'))},'attachments':[]};if(_0x452571['cc']){_0x19f45d['headers']['Cc']=_0x452571['cc'];}if(_0x452571['bcc']){_0x19f45d[_0xdfbc('0x63')][_0xdfbc('0x64')]=_0x452571[_0xdfbc('0x65')];}return new BPromise(function(_0x43198b,_0x2410ba){if(_0x452571[_0xdfbc('0x5c')]){for(var _0x534437=0x0;_0x534437<_0x452571[_0xdfbc('0x5c')]['length'];_0x534437++){var _0x4e7bd2=_0x452571[_0xdfbc('0x5c')][_0x534437];var _0xa7118e=path['join'](_0x8e48e2,_0x4e7bd2[_0xdfbc('0x66')]);if(fs[_0xdfbc('0x67')](_0xa7118e)){_0x19f45d[_0xdfbc('0x57')][_0xdfbc('0x5a')]({'name':_0x4e7bd2[_0xdfbc('0x1a')],'contentType':_0x4e7bd2[_0xdfbc('0x1f')],'data':fs['readFileSync'](_0xa7118e)});}}}emlformat['build'](_0x19f45d,function(_0x307250,_0xec5770){if(_0x307250)return _0x2410ba(_0x307250);fs[_0xdfbc('0x68')](path[_0xdfbc('0x58')](_0x5b643b,util['format'](_0xdfbc('0x69'),_0x4fbbeb)),_0xec5770);return _0x43198b(_0xec5770);});});})[_0xdfbc('0x17')](function(){return new BPromise(function(_0x19b8e,_0x27fc70){zipdir(_0x5b643b,{'saveTo':_0x633d1a},function(_0x473166,_0x431370){if(_0x473166)return _0x27fc70(_0x473166);return _0x19b8e(_0x431370);});})[_0xdfbc('0x17')](function(){return new BPromise(function(_0x1ad416,_0x2211c9){rimraf(_0x5b643b,function(_0x299c67){if(_0x299c67)_0x2211c9(_0x299c67);return _0x1ad416();});});})[_0xdfbc('0x17')](function(){return _0x20117b[_0xdfbc('0x51')](_0x633d1a,_0x9d7677,function(_0x53475b){if(!_0x53475b)fs[_0xdfbc('0x6a')](_0x633d1a);});});});}else{return _0x20117b[_0xdfbc('0xd')](0xc8);}})[_0xdfbc('0x25')](handleError(_0x20117b,null));}; \ No newline at end of file +var _0xe895=['options','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','hasOwnProperty','order','sort','where','filter','map','$gte','split','format','inlineCss','rows','addTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','push','Attachments','Messages','from','bcc','subject','get','mkdirSync','each','missing.recipient@your.company.com','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','sendStatus','eml-format','zip-dir','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','getOptions','findAll','mail','query','user','catch','params','model','MailInteraction','keys','filters','intersection','attributes','fields','length','includeAll','include','merge'];(function(_0x18f917,_0x4d3ae5){var _0x4d013d=function(_0x5c9acc){while(--_0x5c9acc){_0x18f917['push'](_0x18f917['shift']());}};_0x4d013d(++_0x4d3ae5);}(_0xe895,0x11b));var _0x5e89=function(_0x55bd12,_0x3ccb52){_0x55bd12=_0x55bd12-0x0;var _0x1941dd=_0xe895[_0x55bd12];return _0x1941dd;};'use strict';var emlformat=require(_0x5e89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e89('0x1'));var moment=require(_0x5e89('0x2'));var BPromise=require(_0x5e89('0x3'));var util=require(_0x5e89('0x4'));var path=require(_0x5e89('0x5'));var fs=require('fs');var _=require(_0x5e89('0x6'));var juice=require(_0x5e89('0x7'));var Redis=require(_0x5e89('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0x5e89('0x9'));var logger=require(_0x5e89('0xa'))(_0x5e89('0xb'));var config=require(_0x5e89('0xc'));var db=require(_0x5e89('0xd'))['db'];var htmlEntities=require('html-entities');config[_0x5e89('0xe')]=_['defaults'](config[_0x5e89('0xe')],{'host':_0x5e89('0xf'),'port':0x18eb});var socket=require(_0x5e89('0x10'))(new Redis(config['redis']));require(_0x5e89('0x11'))[_0x5e89('0x12')](socket);function respondWithStatusCode(_0x2f4e15,_0x2ea423){_0x2ea423=_0x2ea423||0xcc;return function(_0x158d4c){if(_0x158d4c){return _0x2f4e15['sendStatus'](_0x2ea423);}return _0x2f4e15[_0x5e89('0x13')](_0x2ea423)['end']();};}function respondWithResult(_0x304dda,_0x205223){_0x205223=_0x205223||0xc8;return function(_0xf4e24e){if(_0xf4e24e){return _0x304dda[_0x5e89('0x13')](_0x205223)[_0x5e89('0x14')](_0xf4e24e);}};}function respondWithFilteredResult(_0x226ace,_0x522ba1){return function(_0x4c6436){if(_0x4c6436){var _0x1a9781=typeof _0x522ba1[_0x5e89('0x15')]==='undefined'&&typeof _0x522ba1[_0x5e89('0x16')]===_0x5e89('0x17');var _0x2160e1=_0x4c6436[_0x5e89('0x18')];var _0x1d795b=_0x1a9781?0x0:_0x522ba1[_0x5e89('0x15')];var _0x18d9aa=_0x1a9781?_0x4c6436[_0x5e89('0x18')]:_0x522ba1[_0x5e89('0x15')]+_0x522ba1[_0x5e89('0x16')];var _0x1e6902;if(_0x18d9aa>=_0x2160e1){_0x18d9aa=_0x2160e1;_0x1e6902=0xc8;}else{_0x1e6902=0xce;}_0x226ace['status'](_0x1e6902);return _0x226ace[_0x5e89('0x19')](_0x5e89('0x1a'),_0x1d795b+'-'+_0x18d9aa+'/'+_0x2160e1)[_0x5e89('0x14')](_0x4c6436);}return null;};}function saveUpdates(_0x4b5b60){return function(_0x10e7d6){if(_0x10e7d6){return _0x10e7d6[_0x5e89('0x1b')](_0x4b5b60)[_0x5e89('0x1c')](function(_0x1208ff){return _0x1208ff;});}return null;};}function removeEntity(_0x3114e9){return function(_0x39ae79){if(_0x39ae79){return _0x39ae79[_0x5e89('0x1d')]()['then'](function(){_0x3114e9[_0x5e89('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18b4bf){return function(_0x16a775){if(!_0x16a775){_0x18b4bf['sendStatus'](0x194);}return _0x16a775;};}function handleError(_0x42c08d,_0x41af3a){_0x41af3a=_0x41af3a||0x1f4;return function(_0x381996){logger[_0x5e89('0x1e')](_0x381996[_0x5e89('0x1f')]);if(_0x381996[_0x5e89('0x20')]){delete _0x381996[_0x5e89('0x20')];}_0x42c08d[_0x5e89('0x13')](_0x41af3a)[_0x5e89('0x21')](_0x381996);};}exports[_0x5e89('0x22')]=function(_0x39ae4b,_0x5da418){var _0x2d1f77={};var _0x2c15e0=_['map'](db['MailInteraction'][_0x5e89('0x23')],function(_0x3b874e){return{'name':_0x3b874e[_0x5e89('0x24')],'type':_0x3b874e[_0x5e89('0x25')]['key']};});_0x2d1f77=qs[_0x5e89('0x26')](_0x2c15e0,_0x39ae4b);return interaction[_0x5e89('0x27')](_0x5e89('0x28'),_0x39ae4b[_0x5e89('0x29')],_0x39ae4b[_0x5e89('0x2a')],_0x2d1f77,_0x2c15e0)['then'](respondWithFilteredResult(_0x5da418,_0x2d1f77))[_0x5e89('0x2b')](handleError(_0x5da418,null));};exports['show']=function(_0xdfa356,_0x2f8fe5){var _0xfdf5c9={'raw':![],'where':{'id':_0xdfa356[_0x5e89('0x2c')]['id']}},_0x466690={};_0x466690[_0x5e89('0x2d')]=_['keys'](db[_0x5e89('0x2e')][_0x5e89('0x23')]);_0x466690[_0x5e89('0x29')]=_[_0x5e89('0x2f')](_0xdfa356[_0x5e89('0x29')]);_0x466690[_0x5e89('0x30')]=_[_0x5e89('0x31')](_0x466690[_0x5e89('0x2d')],_0x466690[_0x5e89('0x29')]);_0xfdf5c9[_0x5e89('0x32')]=_[_0x5e89('0x31')](_0x466690[_0x5e89('0x2d')],qs[_0x5e89('0x33')](_0xdfa356['query'][_0x5e89('0x33')]));_0xfdf5c9[_0x5e89('0x32')]=_0xfdf5c9[_0x5e89('0x32')][_0x5e89('0x34')]?_0xfdf5c9['attributes']:_0x466690[_0x5e89('0x2d')];if(_0xdfa356[_0x5e89('0x29')][_0x5e89('0x35')]){_0xfdf5c9[_0x5e89('0x36')]=[{'all':!![]}];}_0xfdf5c9=_[_0x5e89('0x37')]({},_0xfdf5c9,_0xdfa356[_0x5e89('0x38')]);return db[_0x5e89('0x2e')][_0x5e89('0x39')](_0xfdf5c9)['then'](handleEntityNotFound(_0x2f8fe5,null))[_0x5e89('0x1c')](respondWithResult(_0x2f8fe5,null))[_0x5e89('0x2b')](handleError(_0x2f8fe5,null));};exports[_0x5e89('0x3a')]=function(_0x510723,_0x5d871f){return db[_0x5e89('0x2e')]['create'](_0x510723[_0x5e89('0x3b')],{})[_0x5e89('0x1c')](respondWithResult(_0x5d871f,0xc9))[_0x5e89('0x2b')](handleError(_0x5d871f,null));};exports['update']=function(_0x11bf71,_0x3fe354){if(_0x11bf71['body']['id']){delete _0x11bf71[_0x5e89('0x3b')]['id'];}return db[_0x5e89('0x2e')]['find']({'where':{'id':_0x11bf71[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x3fe354,null))[_0x5e89('0x1c')](saveUpdates(_0x11bf71['body'],null))['then'](respondWithResult(_0x3fe354,null))[_0x5e89('0x2b')](handleError(_0x3fe354,null));};exports[_0x5e89('0x1d')]=function(_0x33e644,_0x484a2b){return db[_0x5e89('0x2e')][_0x5e89('0x39')]({'where':{'id':_0x33e644[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x484a2b,null))['then'](removeEntity(_0x484a2b,null))[_0x5e89('0x2b')](handleError(_0x484a2b,null));};exports[_0x5e89('0x3c')]=function(_0x181aeb,_0x323b4c){return db['MailInteraction'][_0x5e89('0x3c')]()['then'](respondWithResult(_0x323b4c,null))[_0x5e89('0x2b')](handleError(_0x323b4c,null));};exports[_0x5e89('0x3d')]=function(_0x12333a,_0x53d3d0){return db[_0x5e89('0x3e')][_0x5e89('0x39')]({'where':{'id':_0x12333a[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x53d3d0,null))[_0x5e89('0x1c')](function(_0x5796d2){if(_0x5796d2){return _0x5796d2[_0x5e89('0x3d')](_0x12333a[_0x5e89('0x3b')]['ids'],_[_0x5e89('0x3f')](_0x12333a['body'],[_0x5e89('0x40'),'id'])||{});}})['then'](respondWithResult(_0x53d3d0,null))[_0x5e89('0x2b')](handleError(_0x53d3d0,null));};exports[_0x5e89('0x41')]=function(_0x34dba6,_0x5ce050){var _0x4ab079={'raw':![],'where':{}};var _0x4bf1ea={};var _0x312dda={'count':0x0,'rows':[]};return db[_0x5e89('0x2e')][_0x5e89('0x42')]({'where':{'id':_0x34dba6[_0x5e89('0x2c')]['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x5ce050,null))[_0x5e89('0x1c')](function(_0x5409bc){if(_0x5409bc){_0x4bf1ea[_0x5e89('0x2d')]=_[_0x5e89('0x2f')](db[_0x5e89('0x3e')][_0x5e89('0x23')]);_0x4bf1ea['query']=_['keys'](_0x34dba6[_0x5e89('0x29')]);_0x4bf1ea[_0x5e89('0x30')]=_['intersection'](_0x4bf1ea[_0x5e89('0x2d')],_0x4bf1ea['query']);_0x4ab079['attributes']=_[_0x5e89('0x31')](_0x4bf1ea['model'],qs['fields'](_0x34dba6[_0x5e89('0x29')][_0x5e89('0x33')]));_0x4ab079[_0x5e89('0x32')]=_0x4ab079[_0x5e89('0x32')][_0x5e89('0x34')]?_0x4ab079[_0x5e89('0x32')]:_0x4bf1ea[_0x5e89('0x2d')];if(!_0x34dba6[_0x5e89('0x29')][_0x5e89('0x43')]('nolimit')){_0x4ab079[_0x5e89('0x16')]=qs[_0x5e89('0x16')](_0x34dba6['query'][_0x5e89('0x16')]);_0x4ab079[_0x5e89('0x15')]=qs['offset'](_0x34dba6[_0x5e89('0x29')][_0x5e89('0x15')]);}_0x4ab079[_0x5e89('0x44')]=qs[_0x5e89('0x45')](_0x34dba6[_0x5e89('0x29')]['sort']);_0x4ab079[_0x5e89('0x46')]=qs['filters'](_['pick'](_0x34dba6[_0x5e89('0x29')],_0x4bf1ea[_0x5e89('0x30')]));_0x4ab079[_0x5e89('0x46')]['MailInteractionId']=_0x5409bc['id'];if(_0x34dba6[_0x5e89('0x29')][_0x5e89('0x47')]){_0x4ab079[_0x5e89('0x46')]=_['merge'](_0x4ab079['where'],{'$or':_[_0x5e89('0x48')](_0x4ab079[_0x5e89('0x32')],function(_0x287ccd){var _0x59ed2d={};_0x59ed2d[_0x287ccd]={'$like':'%'+_0x34dba6[_0x5e89('0x29')]['filter']+'%'};return _0x59ed2d;})});}if(_0x34dba6[_0x5e89('0x29')][_0x5e89('0x49')]){var _0x21df8a=_0x34dba6[_0x5e89('0x29')][_0x5e89('0x49')][_0x5e89('0x4a')](',');var _0x2ca99b={};_0x2ca99b[_0x21df8a[0x0]]={'$gte':moment(_0x21df8a[0x1])[_0x5e89('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4ab079[_0x5e89('0x46')]=_[_0x5e89('0x37')](_0x4ab079[_0x5e89('0x46')],_0x2ca99b);}_0x4ab079=_[_0x5e89('0x37')]({},_0x4ab079,_0x34dba6[_0x5e89('0x38')]);return db[_0x5e89('0x3e')][_0x5e89('0x18')]({'where':_0x4ab079['where']})[_0x5e89('0x1c')](function(_0x3e27b1){_0x312dda['count']=_0x3e27b1;if(_0x34dba6['query'][_0x5e89('0x35')]){_0x4ab079['include']=[{'all':!![]}];}return db[_0x5e89('0x3e')]['findAll'](_0x4ab079);})[_0x5e89('0x1c')](function(_0x3160e3){if(_0x34dba6['query'][_0x5e89('0x4c')]==='true'){for(var _0x2146ed=0x0;_0x2146ed<_0x3160e3[_0x5e89('0x34')];_0x2146ed++){_0x3160e3[_0x2146ed]['body']=juice(_0x3160e3[_0x2146ed]['body']);}}_0x312dda[_0x5e89('0x4d')]=_0x3160e3;return _0x312dda;});}})[_0x5e89('0x1c')](respondWithFilteredResult(_0x5ce050,_0x4ab079))[_0x5e89('0x2b')](handleError(_0x5ce050,null));};exports[_0x5e89('0x4e')]=function(_0x105eb0,_0x135494){return db[_0x5e89('0x2e')]['find']({'where':{'id':_0x105eb0['params']['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x135494,null))['then'](function(_0x25189b){if(_0x25189b){return _0x25189b['setTags'](_0x105eb0[_0x5e89('0x3b')][_0x5e89('0x40')],_['omit'](_0x105eb0[_0x5e89('0x3b')],['ids','id'])||{})[_0x5e89('0x4f')](function(){return db['Tag'][_0x5e89('0x27')]({'attributes':['id','name',_0x5e89('0x50')],'where':{'id':_0x105eb0[_0x5e89('0x3b')][_0x5e89('0x40')]}});})[_0x5e89('0x1c')](function(_0x2e31f6){socket[_0x5e89('0x51')](_0x5e89('0x52'),{'id':Number(_0x105eb0['params']['id']),'tags':_0x2e31f6||[]});return{'id':Number(_0x105eb0[_0x5e89('0x2c')]['id']),'tags':_0x2e31f6||[]};});}})[_0x5e89('0x1c')](respondWithResult(_0x135494,null))[_0x5e89('0x2b')](handleError(_0x135494,null));};exports[_0x5e89('0x53')]=function(_0x2ff94e,_0x329c5d){return db[_0x5e89('0x2e')]['find']({'where':{'id':_0x2ff94e['params']['id']}})[_0x5e89('0x1c')](handleEntityNotFound(_0x329c5d,null))['then'](function(_0x463530){if(_0x463530){return _0x463530['removeTags'](_0x2ff94e[_0x5e89('0x29')]['ids']);}})[_0x5e89('0x1c')](respondWithStatusCode(_0x329c5d,null))['catch'](handleError(_0x329c5d,null));};exports[_0x5e89('0x54')]=function(_0xbcea20,_0x5b3896){var _0x3fce25=moment()[_0x5e89('0x55')]()['toString']();var _0x478377=path[_0x5e89('0x56')](config['root'],_0x5e89('0x57'),'files',_0x5e89('0x58'));var _0x3bbd2c=path[_0x5e89('0x56')](config[_0x5e89('0x59')],_0x5e89('0x57'),_0x5e89('0x5a'),_0x5e89('0x5b'));var _0x47f3e8=path[_0x5e89('0x56')](_0x478377,_0x3fce25);var _0x2353b3=util[_0x5e89('0x4b')]('transcript-%d-%s.zip',_0xbcea20['params']['id'],_0x3fce25);var _0xcfbf4f=path[_0x5e89('0x56')](_0x478377,_0x2353b3);var _0x41f956=[];if(_0xbcea20[_0x5e89('0x29')][_0x5e89('0x5b')]){_0x41f956[_0x5e89('0x5c')]({'model':db['Attachment'],'as':_0x5e89('0x5d'),'raw':!![]});}var _0x11e4c0=[{'model':db[_0x5e89('0x3e')],'as':_0x5e89('0x5e'),'attributes':['id',_0x5e89('0x3b'),_0x5e89('0x5f'),'to','cc',_0x5e89('0x60'),_0x5e89('0x61'),'createdAt'],'where':{'secret':![]},'order':qs[_0x5e89('0x45')]('id'),'include':_0x41f956}];return db[_0x5e89('0x2e')]['find']({'where':{'id':_0xbcea20[_0x5e89('0x2c')]['id']},'include':_0x11e4c0})['then'](handleEntityNotFound(_0x5b3896,null))[_0x5e89('0x1c')](function(_0x5cfad2){if(_0x5cfad2&&_0x5cfad2[_0x5e89('0x5e')]){var _0x2e424e=_0x5cfad2[_0x5e89('0x62')]({'plain':!![]});fs[_0x5e89('0x63')](_0x47f3e8);return BPromise[_0x5e89('0x64')](_0x2e424e[_0x5e89('0x5e')],function(_0x402988,_0x9998f){var _0x17e666={'from':_0x402988['from'],'to':_0x402988['to']||_0x5e89('0x65'),'subject':_0x402988[_0x5e89('0x61')],'html':htmlEntities['decode'](_0x402988[_0x5e89('0x3b')]),'headers':{'Date':moment(_0x402988[_0x5e89('0x66')])[_0x5e89('0x4b')](_0x5e89('0x67'))},'attachments':[]};if(_0x402988['cc']){_0x17e666['headers']['Cc']=_0x402988['cc'];}if(_0x402988[_0x5e89('0x60')]){_0x17e666[_0x5e89('0x68')][_0x5e89('0x69')]=_0x402988[_0x5e89('0x60')];}return new BPromise(function(_0x2a82be,_0x2e52fd){if(_0x402988['Attachments']){for(var _0x32bac2=0x0;_0x32bac2<_0x402988[_0x5e89('0x5d')][_0x5e89('0x34')];_0x32bac2++){var _0x590111=_0x402988[_0x5e89('0x5d')][_0x32bac2];var _0x32b221=path[_0x5e89('0x56')](_0x3bbd2c,_0x590111['basename']);if(fs[_0x5e89('0x6a')](_0x32b221)){_0x17e666[_0x5e89('0x5b')]['push']({'name':_0x590111[_0x5e89('0x20')],'contentType':_0x590111[_0x5e89('0x25')],'data':fs[_0x5e89('0x6b')](_0x32b221)});}}}emlformat[_0x5e89('0x6c')](_0x17e666,function(_0x361a6d,_0x334cc3){if(_0x361a6d)return _0x2e52fd(_0x361a6d);fs[_0x5e89('0x6d')](path['join'](_0x47f3e8,util[_0x5e89('0x4b')](_0x5e89('0x6e'),_0x9998f)),_0x334cc3);return _0x2a82be(_0x334cc3);});});})[_0x5e89('0x1c')](function(){return new BPromise(function(_0x3f7265,_0x445d7d){zipdir(_0x47f3e8,{'saveTo':_0xcfbf4f},function(_0x597f02,_0x1877bc){if(_0x597f02)return _0x445d7d(_0x597f02);return _0x3f7265(_0x1877bc);});})[_0x5e89('0x1c')](function(){return new BPromise(function(_0x4f2f3b,_0x161c63){rimraf(_0x47f3e8,function(_0x278075){if(_0x278075)_0x161c63(_0x278075);return _0x4f2f3b();});});})[_0x5e89('0x1c')](function(){return _0x5b3896[_0x5e89('0x54')](_0xcfbf4f,_0x2353b3,function(_0x37d194){if(!_0x37d194)fs[_0x5e89('0x6f')](_0xcfbf4f);});});});}else{return _0x5b3896[_0x5e89('0x70')](0xc8);}})[_0x5e89('0x2b')](handleError(_0x5b3896,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index ab56921..d9bf468 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 _0x17d1=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','emit','hook','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x17d1,0x1c2));var _0x117d=function(_0x7fb67e,_0x4ddffc){_0x7fb67e=_0x7fb67e-0x0;var _0x274ccc=_0x17d1[_0x7fb67e];return _0x274ccc;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x117d('0x0'))['db']['MailInteraction'];var MailMessage=require(_0x117d('0x0'))['db'][_0x117d('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x117d('0x2')](0x0);var events={'afterCreate':_0x117d('0x3'),'afterUpdate':_0x117d('0x4'),'afterDestroy':_0x117d('0x5')};function emitEvent(_0x1f3f40){return function(_0x242976,_0x82e12e,_0x5d0472){_0x242976[_0x117d('0x6')]({'attributes':['id'],'raw':!![]})[_0x117d('0x7')](function(_0x4e204b){_0x242976[_0x117d('0x8')](_0x117d('0x9'),_0x4e204b[_0x117d('0xa')](function(_0x34599b){return{'id':_0x34599b['id']};}));return MailMessage[_0x117d('0xb')]({'where':{'MailInteractionId':_0x242976['id'],'direction':'in','read':![]},'raw':!![]});})[_0x117d('0x7')](function(_0x1cfcfa){_0x242976[_0x117d('0x8')]('unreadMessages',_0x1cfcfa['length']);MailInteractionEvents[_0x117d('0xc')](_0x1f3f40+':'+_0x242976['id'],_0x242976);MailInteractionEvents[_0x117d('0xc')](_0x1f3f40,_0x242976);_0x5d0472(null);})['catch'](_0x5d0472(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x117d('0xd')](e,emitEvent(event));}}module[_0x117d('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x946d=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','emit','catch'];(function(_0x1039bb,_0x509899){var _0x279dc2=function(_0x10f980){while(--_0x10f980){_0x1039bb['push'](_0x1039bb['shift']());}};_0x279dc2(++_0x509899);}(_0x946d,0x1c2));var _0xd946=function(_0x498288,_0x2c34ec){_0x498288=_0x498288-0x0;var _0xc37555=_0x946d[_0x498288];return _0xc37555;};'use strict';var EventEmitter=require(_0xd946('0x0'));var MailInteraction=require(_0xd946('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xd946('0x1'))['db'][_0xd946('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xd946('0x3')](0x0);var events={'afterCreate':_0xd946('0x4'),'afterUpdate':_0xd946('0x5'),'afterDestroy':_0xd946('0x6')};function emitEvent(_0x56b21f){return function(_0x523278,_0x55bbaf,_0x4971f0){_0x523278[_0xd946('0x7')]({'attributes':['id'],'raw':!![]})[_0xd946('0x8')](function(_0x1f574e){_0x523278[_0xd946('0x9')](_0xd946('0xa'),_0x1f574e[_0xd946('0xb')](function(_0x3200af){return{'id':_0x3200af['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x523278['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd946('0x8')](function(_0x21a96b){_0x523278[_0xd946('0x9')]('unreadMessages',_0x21a96b['length']);MailInteractionEvents[_0xd946('0xc')](_0x56b21f+':'+_0x523278['id'],_0x523278);MailInteractionEvents[_0xd946('0xc')](_0x56b21f,_0x523278);_0x4971f0(null);})[_0xd946('0xd')](_0x4971f0(null));};}for(var e in events){if(events[_0xd946('0xe')](e)){var event=events[e];MailInteraction[_0xd946('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8b95d8d..3d5cd18 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 _0x07d6=['fti_mail_interactions','subject','FULLTEXT','substatusAt','format','changed','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','models','get','MailMessage','catch','utf8mb4','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions'];(function(_0x28d26f,_0x5581e2){var _0x2e8185=function(_0x2b7193){while(--_0x2b7193){_0x28d26f['push'](_0x28d26f['shift']());}};_0x2e8185(++_0x5581e2);}(_0x07d6,0x12d));var _0x607d=function(_0x3f43ef,_0x4c2ba9){_0x3f43ef=_0x3f43ef-0x0;var _0x20af43=_0x07d6[_0x3f43ef];return _0x20af43;};'use strict';var _=require('lodash');var util=require(_0x607d('0x0'));var logger=require(_0x607d('0x1'))('api');var moment=require(_0x607d('0x2'));var BPromise=require('bluebird');var rp=require(_0x607d('0x3'));var fs=require('fs');var path=require(_0x607d('0x4'));var rimraf=require(_0x607d('0x5'));var config=require(_0x607d('0x6'));var attributes=require(_0x607d('0x7'));module['exports']=function(_0x901224,_0x1d837f){return _0x901224[_0x607d('0x8')](_0x607d('0x9'),attributes,{'tableName':_0x607d('0xa'),'paranoid':![],'indexes':[{'name':_0x607d('0xb'),'fields':[_0x607d('0xc'),'to'],'type':_0x607d('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1858a6,_0x47522e,_0x3ca499){if(_0x1858a6['substatus']){_0x1858a6[_0x607d('0xe')]=moment()[_0x607d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1858a6['closed']){_0x1858a6['closedAt']=moment()[_0x607d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3ca499(null,_0x47522e);},'beforeUpdate':function(_0x305957,_0x263391,_0xaf253e){if(_0x305957[_0x607d('0x10')](_0x607d('0x11'))){_0x305957[_0x607d('0xe')]=_0x305957[_0x607d('0x11')]?moment()[_0x607d('0xf')](_0x607d('0x12')):null;}if(_0x305957[_0x607d('0x10')](_0x607d('0x13'))){_0x305957[_0x607d('0x14')]=moment()[_0x607d('0xf')](_0x607d('0x12'));_0x305957['substatus']=null;_0x305957[_0x607d('0xe')]=null;}_0xaf253e(null,_0x305957);},'afterUpdate':function(_0x303cd5,_0x28520a,_0xe42c7b){var _0x3e5333=_0x901224[_0x607d('0x15')];var _0x3bfa12=_0x303cd5[_0x607d('0x16')]({'plain':!![]});if(_0x3bfa12[_0x607d('0x13')]){return _0x3e5333[_0x607d('0x17')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x3bfa12['id']}})['then'](function(){_0xe42c7b();})[_0x607d('0x18')](function(_0x13e910){_0xe42c7b(_0x13e910);});}else{_0xe42c7b();}}},'charset':_0x607d('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x748c=['catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','substatus','changed','closed','get','MailMessage','then'];(function(_0x1e22f8,_0xea094e){var _0x5e0633=function(_0x3f8f1a){while(--_0x3f8f1a){_0x1e22f8['push'](_0x1e22f8['shift']());}};_0x5e0633(++_0xea094e);}(_0x748c,0x125));var _0xc748=function(_0x1b69af,_0x534c91){_0x1b69af=_0x1b69af-0x0;var _0xc78ff7=_0x748c[_0x1b69af];return _0xc78ff7;};'use strict';var _=require(_0xc748('0x0'));var util=require(_0xc748('0x1'));var logger=require(_0xc748('0x2'))(_0xc748('0x3'));var moment=require(_0xc748('0x4'));var BPromise=require(_0xc748('0x5'));var rp=require(_0xc748('0x6'));var fs=require('fs');var path=require(_0xc748('0x7'));var rimraf=require(_0xc748('0x8'));var config=require(_0xc748('0x9'));var attributes=require(_0xc748('0xa'));module[_0xc748('0xb')]=function(_0x3f4b80,_0x2bb866){return _0x3f4b80['define'](_0xc748('0xc'),attributes,{'tableName':_0xc748('0xd'),'paranoid':![],'indexes':[{'name':_0xc748('0xe'),'fields':[_0xc748('0xf'),'to'],'type':_0xc748('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x20542d,_0x3e2d66,_0x492769){if(_0x20542d['substatus']){_0x20542d[_0xc748('0x11')]=moment()[_0xc748('0x12')](_0xc748('0x13'));}if(_0x20542d['closed']){_0x20542d['closedAt']=moment()[_0xc748('0x12')](_0xc748('0x13'));}_0x492769(null,_0x3e2d66);},'beforeUpdate':function(_0x2f3dbb,_0x2542be,_0x32807a){if(_0x2f3dbb['changed'](_0xc748('0x14'))){_0x2f3dbb[_0xc748('0x11')]=_0x2f3dbb[_0xc748('0x14')]?moment()['format'](_0xc748('0x13')):null;}if(_0x2f3dbb[_0xc748('0x15')](_0xc748('0x16'))){_0x2f3dbb['closedAt']=moment()[_0xc748('0x12')](_0xc748('0x13'));_0x2f3dbb['substatus']=null;_0x2f3dbb[_0xc748('0x11')]=null;}_0x32807a(null,_0x2f3dbb);},'afterUpdate':function(_0x55e8c2,_0x51457a,_0x17ddc1){var _0x1e2fce=_0x3f4b80['models'];var _0x534584=_0x55e8c2[_0xc748('0x17')]({'plain':!![]});if(_0x534584[_0xc748('0x16')]){return _0x1e2fce[_0xc748('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x534584['id']}})[_0xc748('0x19')](function(){_0x17ddc1();})[_0xc748('0x1a')](function(_0x1ec7cf){_0x17ddc1(_0x1ec7cf);});}else{_0x17ddc1();}}},'charset':_0xc748('0x1b'),'collate':_0xc748('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 2bb575b..41da678 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 _0x7fd6=['catch','UpdateMailInteraction','update','body','options','raw','where','attributes','MailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3afc31,_0x2456dd){var _0x2f5885=function(_0x3d84e0){while(--_0x3d84e0){_0x3afc31['push'](_0x3afc31['shift']());}};_0x2f5885(++_0x2456dd);}(_0x7fd6,0x157));var _0x67fd=function(_0x37cc11,_0x2194c1){_0x37cc11=_0x37cc11-0x0;var _0x4f10e4=_0x7fd6[_0x37cc11];return _0x4f10e4;};'use strict';var _=require(_0x67fd('0x0'));var util=require('util');var moment=require(_0x67fd('0x1'));var BPromise=require(_0x67fd('0x2'));var rs=require(_0x67fd('0x3'));var fs=require('fs');var Redis=require(_0x67fd('0x4'));var db=require(_0x67fd('0x5'))['db'];var utils=require(_0x67fd('0x6'));var logger=require('../../config/logger')(_0x67fd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x67fd('0x8')]=_[_0x67fd('0x9')](config[_0x67fd('0x8')],{'host':_0x67fd('0xa'),'port':0x18eb});var socket=require(_0x67fd('0xb'))(new Redis(config[_0x67fd('0x8')]));require(_0x67fd('0xc'))[_0x67fd('0xd')](socket);function respondWithRpcPromise(_0x5c64a6,_0x25ce35,_0xf35a50){return new BPromise(function(_0xb7abc,_0x65f39c){return client[_0x67fd('0xe')](_0x5c64a6,_0xf35a50)[_0x67fd('0xf')](function(_0x5cb377){logger[_0x67fd('0x10')](_0x67fd('0x11'),_0x25ce35,_0x67fd('0x12'));logger[_0x67fd('0x13')](_0x67fd('0x14'),_0x25ce35,_0x67fd('0x12'),JSON[_0x67fd('0x15')](_0x5cb377));if(_0x5cb377[_0x67fd('0x16')]){if(_0x5cb377[_0x67fd('0x16')][_0x67fd('0x17')]===0x1f4){logger[_0x67fd('0x16')]('MailInteraction,\x20%s,\x20%s',_0x25ce35,_0x5cb377[_0x67fd('0x16')][_0x67fd('0x18')]);return _0x65f39c(_0x5cb377[_0x67fd('0x16')][_0x67fd('0x18')]);}logger['error'](_0x67fd('0x11'),_0x25ce35,_0x5cb377[_0x67fd('0x16')]['message']);return _0xb7abc(_0x5cb377[_0x67fd('0x16')][_0x67fd('0x18')]);}else{logger[_0x67fd('0x10')](_0x67fd('0x11'),_0x25ce35,_0x67fd('0x12'));_0xb7abc(_0x5cb377[_0x67fd('0x19')][_0x67fd('0x18')]);}})[_0x67fd('0x1a')](function(_0x575fa2){logger[_0x67fd('0x16')]('MailInteraction,\x20%s,\x20%s',_0x25ce35,_0x575fa2);_0x65f39c(_0x575fa2);});});}exports[_0x67fd('0x1b')]=function(_0x4e9fa7){var _0x271c26=this;return new Promise(function(_0x9b7393,_0x118169){return db['MailInteraction'][_0x67fd('0x1c')](_0x4e9fa7[_0x67fd('0x1d')],{'raw':_0x4e9fa7['options']?_0x4e9fa7[_0x67fd('0x1e')][_0x67fd('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e9fa7[_0x67fd('0x1e')]?_0x4e9fa7[_0x67fd('0x1e')][_0x67fd('0x20')]||null:null,'attributes':_0x4e9fa7[_0x67fd('0x1e')]?_0x4e9fa7[_0x67fd('0x1e')][_0x67fd('0x21')]||null:null,'limit':_0x4e9fa7[_0x67fd('0x1e')]?_0x4e9fa7[_0x67fd('0x1e')]['limit']||null:null})[_0x67fd('0xf')](function(_0x2b2190){logger['info']('UpdateMailInteraction',_0x4e9fa7);logger[_0x67fd('0x13')](_0x67fd('0x1b'),_0x4e9fa7,JSON[_0x67fd('0x15')](_0x2b2190));_0x9b7393(_0x2b2190);})[_0x67fd('0x1a')](function(_0x43aee0){logger[_0x67fd('0x16')]('UpdateMailInteraction',_0x43aee0[_0x67fd('0x18')],_0x4e9fa7);_0x118169(_0x271c26[_0x67fd('0x16')](0x1f4,_0x43aee0[_0x67fd('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x4ffe92){return new Promise(function(_0x142920,_0x3b3393){return db[_0x67fd('0x22')][_0x67fd('0x23')]({'where':_0x4ffe92[_0x67fd('0x1e')]?_0x4ffe92[_0x67fd('0x1e')]['where']||null:null})[_0x67fd('0xf')](function(_0x559fdb){if(_0x559fdb){return _0x559fdb[_0x67fd('0x24')](_0x4ffe92[_0x67fd('0x1d')][_0x67fd('0x25')],_[_0x67fd('0x26')](_0x4ffe92['body'],['ids','id'])||{});}})[_0x67fd('0x27')](function(_0x4d629e){logger[_0x67fd('0x10')]('AddTags',_0x4ffe92);logger['debug'](_0x67fd('0x28'),_0x4ffe92,JSON[_0x67fd('0x15')](_0x4d629e));_0x142920(_0x4d629e);})[_0x67fd('0x1a')](function(_0x1c1ccf){logger[_0x67fd('0x16')](_0x67fd('0x28'),_0x1c1ccf[_0x67fd('0x18')],_0x4ffe92);_0x3b3393(_this['error'](0x1f4,_0x1c1ccf['message']));});});}; \ No newline at end of file +var _0xdc6f=['client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MailInteraction','body','options','raw','where','attributes','UpdateMailInteraction','AddTagsToMailInteraction','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x4565eb,_0x167f79){_0x4565eb=_0x4565eb-0x0;var _0x67832=_0xdc6f[_0x4565eb];return _0x67832;};'use strict';var _=require(_0xfdc6('0x0'));var util=require(_0xfdc6('0x1'));var moment=require(_0xfdc6('0x2'));var BPromise=require(_0xfdc6('0x3'));var rs=require(_0xfdc6('0x4'));var fs=require('fs');var Redis=require(_0xfdc6('0x5'));var db=require(_0xfdc6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfdc6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfdc6('0x8')][_0xfdc6('0x9')]({'port':0x232a});config[_0xfdc6('0xa')]=_['defaults'](config[_0xfdc6('0xa')],{'host':_0xfdc6('0xb'),'port':0x18eb});var socket=require(_0xfdc6('0xc'))(new Redis(config[_0xfdc6('0xa')]));require(_0xfdc6('0xd'))[_0xfdc6('0xe')](socket);function respondWithRpcPromise(_0x20c067,_0x5c06a0,_0x4e2b64){return new BPromise(function(_0x50e028,_0x1b1e29){return client[_0xfdc6('0xf')](_0x20c067,_0x4e2b64)[_0xfdc6('0x10')](function(_0xe4c282){logger[_0xfdc6('0x11')](_0xfdc6('0x12'),_0x5c06a0,_0xfdc6('0x13'));logger[_0xfdc6('0x14')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x5c06a0,'request\x20sent',JSON[_0xfdc6('0x15')](_0xe4c282));if(_0xe4c282[_0xfdc6('0x16')]){if(_0xe4c282['error'][_0xfdc6('0x17')]===0x1f4){logger[_0xfdc6('0x16')](_0xfdc6('0x12'),_0x5c06a0,_0xe4c282[_0xfdc6('0x16')][_0xfdc6('0x18')]);return _0x1b1e29(_0xe4c282[_0xfdc6('0x16')]['message']);}logger['error'](_0xfdc6('0x12'),_0x5c06a0,_0xe4c282['error'][_0xfdc6('0x18')]);return _0x50e028(_0xe4c282[_0xfdc6('0x16')][_0xfdc6('0x18')]);}else{logger[_0xfdc6('0x11')](_0xfdc6('0x12'),_0x5c06a0,_0xfdc6('0x13'));_0x50e028(_0xe4c282[_0xfdc6('0x19')][_0xfdc6('0x18')]);}})[_0xfdc6('0x1a')](function(_0x573404){logger[_0xfdc6('0x16')]('MailInteraction,\x20%s,\x20%s',_0x5c06a0,_0x573404);_0x1b1e29(_0x573404);});});}exports['UpdateMailInteraction']=function(_0x2c153e){var _0x2f9bec=this;return new Promise(function(_0x3ee545,_0x23b151){return db[_0xfdc6('0x1b')]['update'](_0x2c153e[_0xfdc6('0x1c')],{'raw':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e['options'][_0xfdc6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e[_0xfdc6('0x1d')][_0xfdc6('0x1f')]||null:null,'attributes':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e['options'][_0xfdc6('0x20')]||null:null,'limit':_0x2c153e[_0xfdc6('0x1d')]?_0x2c153e[_0xfdc6('0x1d')]['limit']||null:null})[_0xfdc6('0x10')](function(_0x32e986){logger[_0xfdc6('0x11')]('UpdateMailInteraction',_0x2c153e);logger[_0xfdc6('0x14')]('UpdateMailInteraction',_0x2c153e,JSON[_0xfdc6('0x15')](_0x32e986));_0x3ee545(_0x32e986);})[_0xfdc6('0x1a')](function(_0x257b66){logger[_0xfdc6('0x16')](_0xfdc6('0x21'),_0x257b66[_0xfdc6('0x18')],_0x2c153e);_0x23b151(_0x2f9bec[_0xfdc6('0x16')](0x1f4,_0x257b66[_0xfdc6('0x18')]));});});};exports[_0xfdc6('0x22')]=function(_0x2e48af){return new Promise(function(_0x5402d2,_0x4d28b5){return db[_0xfdc6('0x1b')]['find']({'where':_0x2e48af['options']?_0x2e48af[_0xfdc6('0x1d')][_0xfdc6('0x1f')]||null:null})[_0xfdc6('0x10')](function(_0x1a099b){if(_0x1a099b){return _0x1a099b['addTags'](_0x2e48af[_0xfdc6('0x1c')]['ids'],_[_0xfdc6('0x23')](_0x2e48af[_0xfdc6('0x1c')],[_0xfdc6('0x24'),'id'])||{});}})[_0xfdc6('0x25')](function(_0x3b298a){logger[_0xfdc6('0x11')](_0xfdc6('0x26'),_0x2e48af);logger[_0xfdc6('0x14')](_0xfdc6('0x26'),_0x2e48af,JSON[_0xfdc6('0x15')](_0x3b298a));_0x5402d2(_0x3b298a);})[_0xfdc6('0x1a')](function(_0xb0361d){logger[_0xfdc6('0x16')](_0xfdc6('0x26'),_0xb0361d[_0xfdc6('0x18')],_0x2e48af);_0x4d28b5(_this[_0xfdc6('0x16')](0x1f4,_0xb0361d[_0xfdc6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0b9fafc..3767a59 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 _0x2600=['./mailInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x2600,0xe0));var _0x0260=function(_0x290b3b,_0x4e6213){_0x290b3b=_0x290b3b-0x0;var _0x49dfc2=_0x2600[_0x290b3b];return _0x49dfc2;};'use strict';var MailInteractionEvents=require(_0x0260('0x0'));var events=['save',_0x0260('0x1'),_0x0260('0x2')];function createListener(_0x1e1abd,_0x35c62c){return function(_0x5133ee){_0x35c62c[_0x0260('0x3')](_0x1e1abd,_0x5133ee);};}function removeListener(_0x3616f7,_0x50773a){return function(){MailInteractionEvents[_0x0260('0x4')](_0x3616f7,_0x50773a);};}exports[_0x0260('0x5')]=function(_0x2e7793){for(var _0x44788a=0x0,_0x10b73d=events[_0x0260('0x6')];_0x44788a<_0x10b73d;_0x44788a++){var _0x312e16=events[_0x44788a];var _0x4cca76=createListener('mailInteraction:'+_0x312e16,_0x2e7793);MailInteractionEvents['on'](_0x312e16,_0x4cca76);}}; \ No newline at end of file +var _0x9994=['update','emit','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x35d6c4,_0x2773a4){var _0x42a30f=function(_0x2703e1){while(--_0x2703e1){_0x35d6c4['push'](_0x35d6c4['shift']());}};_0x42a30f(++_0x2773a4);}(_0x9994,0x85));var _0x4999=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0x9994[_0x11dc39];return _0x457277;};'use strict';var MailInteractionEvents=require(_0x4999('0x0'));var events=[_0x4999('0x1'),_0x4999('0x2'),_0x4999('0x3')];function createListener(_0x26095b,_0x355181){return function(_0x141007){_0x355181[_0x4999('0x4')](_0x26095b,_0x141007);};}function removeListener(_0x4b2e00,_0x462062){return function(){MailInteractionEvents['removeListener'](_0x4b2e00,_0x462062);};}exports[_0x4999('0x5')]=function(_0x12dae1){for(var _0x1f6c9b=0x0,_0x1ba5c3=events[_0x4999('0x6')];_0x1f6c9b<_0x1ba5c3;_0x1f6c9b++){var _0x49d7e8=events[_0x1f6c9b];var _0x30b4b6=createListener(_0x4999('0x7')+_0x49d7e8,_0x12dae1);MailInteractionEvents['on'](_0x49d7e8,_0x30b4b6);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 165449f..93dbfe6 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 _0xe9f9=['../../components/interaction/service','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','mailmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xe9f9,0x174));var _0x9e9f=function(_0x42d4db,_0xe5a183){_0x42d4db=_0x42d4db-0x0;var _0x76b8ea=_0xe9f9[_0x42d4db];return _0x76b8ea;};'use strict';var multer=require(_0x9e9f('0x0'));var util=require('util');var path=require(_0x9e9f('0x1'));var timeout=require(_0x9e9f('0x2'));var express=require(_0x9e9f('0x3'));var router=express[_0x9e9f('0x4')]();var fs_extra=require(_0x9e9f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9e9f('0x6'));var config=require('../../config/environment');var controller=require(_0x9e9f('0x7'));router[_0x9e9f('0x8')]('/',auth['isAuthenticated'](),controller[_0x9e9f('0x9')]);router['get'](_0x9e9f('0xa'),auth[_0x9e9f('0xb')](),controller[_0x9e9f('0xc')]);router['get'](_0x9e9f('0xd'),auth[_0x9e9f('0xb')](),controller[_0x9e9f('0xe')]);router[_0x9e9f('0x8')](_0x9e9f('0xf'),auth[_0x9e9f('0xb')](),controller['download']);router[_0x9e9f('0x10')]('/',auth[_0x9e9f('0xb')](),interaction[_0x9e9f('0x11')]('mail',_0x9e9f('0x12')),controller[_0x9e9f('0x13')]);router[_0x9e9f('0x14')](_0x9e9f('0xd'),auth[_0x9e9f('0xb')](),controller[_0x9e9f('0x15')]);router[_0x9e9f('0x14')](_0x9e9f('0x16'),auth[_0x9e9f('0xb')](),controller['accept']);router['put'](_0x9e9f('0x17'),auth[_0x9e9f('0xb')](),controller[_0x9e9f('0x18')]);router[_0x9e9f('0x19')](_0x9e9f('0xd'),auth[_0x9e9f('0xb')](),controller['destroy']);module[_0x9e9f('0x1a')]=router; \ No newline at end of file +var _0xc8de=['tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','describe','/:id','show','/:id/download','isAuthenticated','download','post'];(function(_0x3ecb5a,_0x2c2e99){var _0x31a071=function(_0x39716d){while(--_0x39716d){_0x3ecb5a['push'](_0x3ecb5a['shift']());}};_0x31a071(++_0x2c2e99);}(_0xc8de,0x167));var _0xec8d=function(_0x34058d,_0x2a325e){_0x34058d=_0x34058d-0x0;var _0x112248=_0xc8de[_0x34058d];return _0x112248;};'use strict';var multer=require('multer');var util=require(_0xec8d('0x0'));var path=require(_0xec8d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xec8d('0x2')]();var fs_extra=require(_0xec8d('0x3'));var auth=require(_0xec8d('0x4'));var interaction=require(_0xec8d('0x5'));var config=require(_0xec8d('0x6'));var controller=require(_0xec8d('0x7'));router[_0xec8d('0x8')]('/',auth['isAuthenticated'](),controller[_0xec8d('0x9')]);router['get'](_0xec8d('0xa'),auth['isAuthenticated'](),controller[_0xec8d('0xb')]);router['get'](_0xec8d('0xc'),auth['isAuthenticated'](),controller[_0xec8d('0xd')]);router[_0xec8d('0x8')](_0xec8d('0xe'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x10')]);router[_0xec8d('0x11')]('/',auth[_0xec8d('0xf')](),interaction[_0xec8d('0x12')](_0xec8d('0x13'),_0xec8d('0x14')),controller['create']);router[_0xec8d('0x15')](_0xec8d('0xc'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x16')]);router[_0xec8d('0x15')](_0xec8d('0x17'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x18')]);router[_0xec8d('0x15')](_0xec8d('0x19'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x1a')]);router['delete'](_0xec8d('0xc'),auth[_0xec8d('0xf')](),controller[_0xec8d('0x1b')]);module[_0xec8d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7552ccd..d025802 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 _0x72de=['exports','TEXT','medium','out','STRING','long','DATE','BOOLEAN','Email'];(function(_0x558615,_0x1eb496){var _0x1e032a=function(_0x538f1d){while(--_0x538f1d){_0x558615['push'](_0x558615['shift']());}};_0x1e032a(++_0x1eb496);}(_0x72de,0x99));var _0xe72d=function(_0x15ef85,_0x32e885){_0x15ef85=_0x15ef85-0x0;var _0x3de475=_0x72de[_0x15ef85];return _0x3de475;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xe72d('0x0')]={'body':{'type':Sequelize[_0xe72d('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xe72d('0x2'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe72d('0x3')),'defaultValue':_0xe72d('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe72d('0x4')](0x1fe)},'from':{'type':Sequelize[_0xe72d('0x4')]},'to':{'type':Sequelize[_0xe72d('0x1')](_0xe72d('0x5'))},'cc':{'type':Sequelize['TEXT'](_0xe72d('0x5'))},'bcc':{'type':Sequelize['TEXT'](_0xe72d('0x5'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xe72d('0x6')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe72d('0x7')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe72d('0x6')]},'originTo':{'type':Sequelize[_0xe72d('0x1')]('long')},'originCc':{'type':Sequelize[_0xe72d('0x1')](_0xe72d('0x5'))},'originChannel':{'type':Sequelize['ENUM'](_0xe72d('0x8'),'Chat'),'defaultValue':_0xe72d('0x8'),'allowNull':![]}}; \ No newline at end of file +var _0xd9da=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Chat','Email','lodash','exports','TEXT','long'];(function(_0x137701,_0x4b5e06){var _0x535e28=function(_0x37997f){while(--_0x37997f){_0x137701['push'](_0x137701['shift']());}};_0x535e28(++_0x4b5e06);}(_0xd9da,0x170));var _0xad9d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd9da[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');var _=require(_0xad9d('0x0'));module[_0xad9d('0x1')]={'body':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xad9d('0x2')]('medium')},'read':{'type':Sequelize[_0xad9d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xad9d('0x5')]('in',_0xad9d('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xad9d('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'cc':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'bcc':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'subject':{'type':Sequelize[_0xad9d('0x2')]},'sentAt':{'type':Sequelize[_0xad9d('0x8')]},'attach':{'type':Sequelize[_0xad9d('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xad9d('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xad9d('0x8')]},'originTo':{'type':Sequelize[_0xad9d('0x2')]('long')},'originCc':{'type':Sequelize[_0xad9d('0x2')](_0xad9d('0x3'))},'originChannel':{'type':Sequelize[_0xad9d('0x5')]('Email',_0xad9d('0xa')),'defaultValue':_0xad9d('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index c90135e..ef49806 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 _0xe9bd=['socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','offset','count','limit','set','Content-Range','update','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','attachments','length','join','root','basename','ListId','List\x20not\x20found','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','format','UserId','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','email','agent','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','fullname','internal','motionChannel','download','unix','toString','tmp','files','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','localhost'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xe9bd,0x1ce));var _0xde9b=function(_0x451451,_0xe3c88f){_0x451451=_0x451451-0x0;var _0x48110a=_0xe9bd[_0x451451];return _0x48110a;};'use strict';var emlformat=require(_0xde9b('0x0'));var moment=require(_0xde9b('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xde9b('0x2'));var fs=require('fs');var _=require(_0xde9b('0x3'));var Redis=require(_0xde9b('0x4'));var htmlToText=require(_0xde9b('0x5'));var qs=require(_0xde9b('0x6'));var logger=require(_0xde9b('0x7'))(_0xde9b('0x8'));var interaction_log=require('../../config/logger')(_0xde9b('0x9'));var config=require(_0xde9b('0xa'));var db=require(_0xde9b('0xb'))['db'];config['redis']=_[_0xde9b('0xc')](config[_0xde9b('0xd')],{'host':_0xde9b('0xe'),'port':0x18eb});var socket=require(_0xde9b('0xf'))(new Redis(config['redis']));var htmlEntities=require(_0xde9b('0x10'));require(_0xde9b('0x11'))[_0xde9b('0x12')](socket);var jayson=require(_0xde9b('0x13'));var client=jayson[_0xde9b('0x14')][_0xde9b('0x15')]({'port':0x232c});var client9003=jayson['client'][_0xde9b('0x15')]({'port':0x232b});var client9002=jayson[_0xde9b('0x14')][_0xde9b('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x495f47,_0x49f499,_0xeb8af4,_0x3c4083){return new BPromise(function(_0x2c2fd6,_0x39d0fb){var _0x2f0202=_0x3c4083||client;return _0x2f0202[_0xde9b('0x16')](_0x495f47,_0xeb8af4)[_0xde9b('0x17')](function(_0x843ebb){logger['info'](_0xde9b('0x18'),_0x49f499,_0xde9b('0x19'));logger['debug'](_0xde9b('0x1a'),_0x49f499,'request\x20sent',JSON['stringify'](_0x843ebb));if(_0x843ebb[_0xde9b('0x1b')]){if(_0x843ebb[_0xde9b('0x1b')][_0xde9b('0x1c')]===0x1f4){logger[_0xde9b('0x1b')](_0xde9b('0x18'),_0x49f499,_0x843ebb['error']['message']);return _0x39d0fb(_0x843ebb['error'][_0xde9b('0x1d')]);}logger[_0xde9b('0x1b')](_0xde9b('0x18'),_0x49f499,_0x843ebb[_0xde9b('0x1b')]['message']);return _0x2c2fd6(_0x843ebb[_0xde9b('0x1b')][_0xde9b('0x1d')]);}else{logger[_0xde9b('0x1e')]('MailMessage,\x20%s,\x20%s',_0x49f499,_0xde9b('0x19'));_0x2c2fd6(_0x843ebb[_0xde9b('0x1f')][_0xde9b('0x1d')]);}})[_0xde9b('0x20')](function(_0x2bc9c3){logger[_0xde9b('0x1b')](_0xde9b('0x18'),_0x49f499,_0x2bc9c3);_0x39d0fb(_0x2bc9c3);});});}function respondWithResult(_0x46fe6e,_0x2cb073){_0x2cb073=_0x2cb073||0xc8;return function(_0x1d9a16){if(_0x1d9a16){return _0x46fe6e[_0xde9b('0x21')](_0x2cb073)[_0xde9b('0x22')](_0x1d9a16);}};}function respondWithFilteredResult(_0x27ee7c,_0xca25b9){return function(_0x361f94){if(_0x361f94){var _0x40d1c5=typeof _0xca25b9[_0xde9b('0x23')]==='undefined'&&typeof _0xca25b9['limit']==='undefined';var _0x4e2be4=_0x361f94[_0xde9b('0x24')];var _0x3e018b=_0x40d1c5?0x0:_0xca25b9[_0xde9b('0x23')];var _0x1bd57b=_0x40d1c5?_0x361f94[_0xde9b('0x24')]:_0xca25b9[_0xde9b('0x23')]+_0xca25b9[_0xde9b('0x25')];var _0xe8b23;if(_0x1bd57b>=_0x4e2be4){_0x1bd57b=_0x4e2be4;_0xe8b23=0xc8;}else{_0xe8b23=0xce;}_0x27ee7c[_0xde9b('0x21')](_0xe8b23);return _0x27ee7c[_0xde9b('0x26')](_0xde9b('0x27'),_0x3e018b+'-'+_0x1bd57b+'/'+_0x4e2be4)['json'](_0x361f94);}return null;};}function saveUpdates(_0x114317){return function(_0x15b6de){if(_0x15b6de){return _0x15b6de[_0xde9b('0x28')](_0x114317)[_0xde9b('0x17')](function(_0xf6a384){return _0xf6a384;});}return null;};}function removeEntity(_0x3d84bd){return function(_0x16a07e){if(_0x16a07e){return _0x16a07e['destroy']()['then'](function(){_0x3d84bd['status'](0xcc)[_0xde9b('0x29')]();});}};}function handleEntityNotFound(_0x13c80f){return function(_0x283dbe){if(!_0x283dbe){_0x13c80f[_0xde9b('0x2a')](0x194);}return _0x283dbe;};}function handleError(_0x2f7e74,_0x16d613){_0x16d613=_0x16d613||0x1f4;return function(_0x2ec78b){logger[_0xde9b('0x1b')](_0x2ec78b[_0xde9b('0x2b')]);if(_0x2ec78b['name']){delete _0x2ec78b[_0xde9b('0x2c')];}_0x2f7e74[_0xde9b('0x21')](_0x16d613)[_0xde9b('0x2d')](_0x2ec78b);};}exports[_0xde9b('0x2e')]=function(_0x1e7c17,_0x190b62){var _0x5ab0cd={},_0x15b3c9={},_0x1bce67={'count':0x0,'rows':[]};var _0x517a9e=_[_0xde9b('0x2f')](db[_0xde9b('0x30')][_0xde9b('0x31')],function(_0x3b62c3){return{'name':_0x3b62c3[_0xde9b('0x32')],'type':_0x3b62c3[_0xde9b('0x33')]['key']};});_0x15b3c9[_0xde9b('0x34')]=_[_0xde9b('0x2f')](_0x517a9e,_0xde9b('0x2c'));_0x15b3c9[_0xde9b('0x35')]=_[_0xde9b('0x36')](_0x1e7c17['query']);_0x15b3c9[_0xde9b('0x37')]=_['intersection'](_0x15b3c9[_0xde9b('0x34')],_0x15b3c9[_0xde9b('0x35')]);_0x5ab0cd[_0xde9b('0x38')]=_[_0xde9b('0x39')](_0x15b3c9[_0xde9b('0x34')],qs[_0xde9b('0x3a')](_0x1e7c17['query'][_0xde9b('0x3a')]));_0x5ab0cd['attributes']=_0x5ab0cd[_0xde9b('0x38')]['length']?_0x5ab0cd[_0xde9b('0x38')]:_0x15b3c9[_0xde9b('0x34')];if(!_0x1e7c17[_0xde9b('0x35')][_0xde9b('0x3b')]('nolimit')){_0x5ab0cd[_0xde9b('0x25')]=qs[_0xde9b('0x25')](_0x1e7c17[_0xde9b('0x35')][_0xde9b('0x25')]);_0x5ab0cd[_0xde9b('0x23')]=qs[_0xde9b('0x23')](_0x1e7c17['query'][_0xde9b('0x23')]);}_0x5ab0cd['order']=qs[_0xde9b('0x3c')](_0x1e7c17['query']['sort']);_0x5ab0cd['where']=qs[_0xde9b('0x37')](_[_0xde9b('0x3d')](_0x1e7c17['query'],_0x15b3c9[_0xde9b('0x37')]),_0x517a9e);if(_0x1e7c17[_0xde9b('0x35')][_0xde9b('0x3e')]){_0x5ab0cd[_0xde9b('0x3f')]=_[_0xde9b('0x40')](_0x5ab0cd[_0xde9b('0x3f')],{'$or':_[_0xde9b('0x2f')](_0x517a9e,function(_0x5f3f79){if(_0x5f3f79[_0xde9b('0x33')]!=='VIRTUAL'){var _0x32cb78={};_0x32cb78[_0x5f3f79['name']]={'$like':'%'+_0x1e7c17[_0xde9b('0x35')][_0xde9b('0x3e')]+'%'};return _0x32cb78;}})});}_0x5ab0cd=_[_0xde9b('0x40')]({},_0x5ab0cd,_0x1e7c17[_0xde9b('0x41')]);var _0x4999b7={'where':_0x5ab0cd['where']};return db[_0xde9b('0x30')]['count'](_0x4999b7)[_0xde9b('0x17')](function(_0x1fb915){_0x1bce67[_0xde9b('0x24')]=_0x1fb915;if(_0x1e7c17[_0xde9b('0x35')][_0xde9b('0x42')]){_0x5ab0cd[_0xde9b('0x43')]=[{'all':!![]}];}return db[_0xde9b('0x30')][_0xde9b('0x44')](_0x5ab0cd);})[_0xde9b('0x17')](function(_0x1dc099){_0x1bce67['rows']=_0x1dc099;return _0x1bce67;})[_0xde9b('0x17')](respondWithFilteredResult(_0x190b62,_0x5ab0cd))[_0xde9b('0x20')](handleError(_0x190b62,null));};exports[_0xde9b('0x45')]=function(_0x45dbb4,_0xf9d020){var _0x2b2cb3={'raw':!![],'where':{'id':_0x45dbb4[_0xde9b('0x46')]['id']}},_0x2f3123={};_0x2f3123[_0xde9b('0x34')]=_[_0xde9b('0x36')](db['MailMessage'][_0xde9b('0x31')]);_0x2f3123[_0xde9b('0x35')]=_['keys'](_0x45dbb4['query']);_0x2f3123[_0xde9b('0x37')]=_[_0xde9b('0x39')](_0x2f3123[_0xde9b('0x34')],_0x2f3123[_0xde9b('0x35')]);_0x2b2cb3[_0xde9b('0x38')]=_[_0xde9b('0x39')](_0x2f3123[_0xde9b('0x34')],qs[_0xde9b('0x3a')](_0x45dbb4[_0xde9b('0x35')][_0xde9b('0x3a')]));_0x2b2cb3[_0xde9b('0x38')]=_0x2b2cb3[_0xde9b('0x38')]['length']?_0x2b2cb3[_0xde9b('0x38')]:_0x2f3123[_0xde9b('0x34')];if(_0x45dbb4['query'][_0xde9b('0x42')]){_0x2b2cb3['include']=[{'all':!![]}];}_0x2b2cb3=_[_0xde9b('0x40')]({},_0x2b2cb3,_0x45dbb4[_0xde9b('0x41')]);return db[_0xde9b('0x30')][_0xde9b('0x47')](_0x2b2cb3)['then'](handleEntityNotFound(_0xf9d020,null))[_0xde9b('0x17')](respondWithResult(_0xf9d020,null))['catch'](handleError(_0xf9d020,null));};exports['update']=function(_0x237081,_0x4972e6){if(_0x237081[_0xde9b('0x48')]['id']){delete _0x237081[_0xde9b('0x48')]['id'];}return db[_0xde9b('0x30')]['find']({'where':{'id':_0x237081[_0xde9b('0x46')]['id']}})[_0xde9b('0x17')](handleEntityNotFound(_0x4972e6,null))[_0xde9b('0x17')](saveUpdates(_0x237081['body'],null))[_0xde9b('0x17')](respondWithResult(_0x4972e6,null))['catch'](handleError(_0x4972e6,null));};exports['destroy']=function(_0x3e962b,_0x5a2d3e){return db['MailMessage'][_0xde9b('0x47')]({'where':{'id':_0x3e962b[_0xde9b('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a2d3e,null))['then'](removeEntity(_0x5a2d3e,null))[_0xde9b('0x20')](handleError(_0x5a2d3e,null));};exports[_0xde9b('0x49')]=function(_0x593551,_0x543437){return db[_0xde9b('0x30')][_0xde9b('0x49')]()[_0xde9b('0x17')](respondWithResult(_0x543437,null))[_0xde9b('0x20')](handleError(_0x543437,null));};exports[_0xde9b('0x4a')]=function(_0x1eb0b6,_0x81adc){return db['MailMessage']['create'](_0x1eb0b6[_0xde9b('0x48')])[_0xde9b('0x17')](function(_0x3fc186){if(_0x3fc186){if(_0x3fc186[_0xde9b('0x4b')]===_0xde9b('0x4c')&&!_0x3fc186[_0xde9b('0x4d')]){var _0xfd39a8,_0x1ca959,_0x40aa13;if(_0x1eb0b6[_0xde9b('0x48')]['to']){_0x1ca959=_0x1eb0b6[_0xde9b('0x48')]['to'][_0xde9b('0x4e')](',')[0x0];}return db[_0xde9b('0x4f')][_0xde9b('0x50')]({'where':{'id':_0x3fc186[_0xde9b('0x51')]},'include':[{'model':db[_0xde9b('0x52')],'as':_0xde9b('0x53'),'include':[{'model':db[_0xde9b('0x54')],'as':_0xde9b('0x55'),'where':{'email':_0x1ca959},'limit':0x1,'order':[[_0xde9b('0x56'),_0xde9b('0x57')]]}]},{'model':db[_0xde9b('0x58')],'as':_0xde9b('0x59'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x325ece){_0xfd39a8=_0x325ece;if(!_0xfd39a8||!_0xfd39a8[_0xde9b('0x59')])return;var _0x37b528=_0xfd39a8['getSmtpOptions']();if(_0x1eb0b6[_0xde9b('0x48')][_0xde9b('0x5a')]&&_0x1eb0b6['body'][_0xde9b('0x5a')][_0xde9b('0x5b')]){for(var _0x457f53=0x0;_0x457f53<_0x1eb0b6['body'][_0xde9b('0x5a')][_0xde9b('0x5b')];_0x457f53+=0x1){_0x1eb0b6['body'][_0xde9b('0x5a')][_0x457f53]={'filename':_0x1eb0b6['body'][_0xde9b('0x5a')][_0x457f53]['name'],'path':path[_0xde9b('0x5c')](config[_0xde9b('0x5d')],'server/files/attachments',_0x1eb0b6['body'][_0xde9b('0x5a')][_0x457f53][_0xde9b('0x5e')])};}}_0x40aa13={'account':_0x37b528,'message':_0x1eb0b6[_0xde9b('0x48')]};return;})[_0xde9b('0x17')](function(){if(_0xfd39a8[_0xde9b('0x53')]){if(_0xfd39a8['List'][_0xde9b('0x55')][_0xde9b('0x5b')]){return _0xfd39a8[_0xde9b('0x53')][_0xde9b('0x55')][0x0];}else{return db[_0xde9b('0x54')]['create'](_['defaults'](_0x1eb0b6[_0xde9b('0x48')],{'firstName':_0x1eb0b6[_0xde9b('0x48')]['to'],'email':_0x1eb0b6[_0xde9b('0x48')]['to'],'phone':_0x1eb0b6[_0xde9b('0x48')]['to'],'ListId':_0xfd39a8[_0xde9b('0x5f')]}));}}else{throw new Error(_0xde9b('0x60'));}})['then'](function(){if(_0x40aa13){return respondWithRpcPromise(_0xde9b('0x61'),_0xde9b('0x62'),_0x40aa13,client9003)[_0xde9b('0x17')](function(_0x4358c4){return _0x3fc186['update']({'read':!![],'messageId':_0x4358c4['messageId'],'sentAt':moment()['format'](_0xde9b('0x63'))});})[_0xde9b('0x20')](function(_0x279d8e){logger[_0xde9b('0x1b')]('%s',JSON[_0xde9b('0x64')](_0x279d8e));return _0x3fc186;});}return _0x3fc186;});}return _0x3fc186;}})[_0xde9b('0x17')](respondWithResult(_0x81adc,0xc9))[_0xde9b('0x20')](handleError(_0x81adc,null));};exports[_0xde9b('0x65')]=function(_0x3870db,_0x57bddf){var _0x23fdc7={'agent':{},'channel':_0xde9b('0x66')};if(_0x3870db['body']['id']){delete _0x3870db['body']['id'];}_0x3870db[_0xde9b('0x48')][_0xde9b('0x67')]=!![];_0x3870db[_0xde9b('0x48')]['readAt']=moment()[_0xde9b('0x68')](_0xde9b('0x63'));_0x3870db[_0xde9b('0x48')][_0xde9b('0x69')]=_0x3870db['body'][_0xde9b('0x69')]||_0x3870db['user']['id'];_0x23fdc7['agent']['id']=_0x3870db[_0xde9b('0x48')][_0xde9b('0x69')];return db[_0xde9b('0x30')][_0xde9b('0x47')]({'where':{'id':_0x3870db[_0xde9b('0x46')]['id'],'UserId':null}})[_0xde9b('0x17')](handleEntityNotFound(_0x57bddf,null))[_0xde9b('0x17')](saveUpdates(_0x3870db['body'],null))[_0xde9b('0x17')](function(_0x58b9d2){if(_0x58b9d2){_0x23fdc7['message']=_0x58b9d2[_0xde9b('0x6a')]({'plain':!![]});return db[_0xde9b('0x6b')][_0xde9b('0x47')]({'where':{'id':_0x58b9d2[_0xde9b('0x6c')]}});}return null;})[_0xde9b('0x17')](handleEntityNotFound(_0x57bddf,null))[_0xde9b('0x17')](function(_0x37bf3f){if(_0x37bf3f){return _0x37bf3f[_0xde9b('0x28')]({'UserId':_0x3870db['body'][_0xde9b('0x69')],'read1stAt':_[_0xde9b('0x6d')](_0x37bf3f[_0xde9b('0x6e')])?moment()[_0xde9b('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x55dacd){if(_0x55dacd){_0x23fdc7[_0xde9b('0x6f')]=_0x55dacd[_0xde9b('0x6a')]({'plain':!![]});interaction_log[_0xde9b('0x1e')](_0xde9b('0x70'),_0x3870db[_0xde9b('0x71')]['id'],_0x3870db[_0xde9b('0x71')][_0xde9b('0x2c')],_0x3870db[_0xde9b('0x71')][_0xde9b('0x72')],_0x23fdc7[_0xde9b('0x6f')]['id'],_0x3870db[_0xde9b('0x48')]?JSON[_0xde9b('0x64')](_0x3870db[_0xde9b('0x48')]):_0xde9b('0x73'));return respondWithRpcPromise('AcceptMessage',_0xde9b('0x74'),_0x23fdc7);}return null;})[_0xde9b('0x17')](function(_0x5911ef){var _0x45b250=_0xde9b('0x75')+_0x5911ef[_0xde9b('0x1d')][_0xde9b('0x76')];return db[_0xde9b('0x77')][_0xde9b('0x35')](_0x45b250,{'type':db[_0xde9b('0x78')]['QueryTypes'][_0xde9b('0x79')],'raw':!![]})[_0xde9b('0x17')](function(_0x4df348){return _0x4df348;});})['then'](function(_0x4ada32){if(_0x4ada32){_0x23fdc7['message'][_0xde9b('0x7a')]=_0x4ada32[0x0];if(!_0x3870db['body']['UserId'])return;return db['User'][_0xde9b('0x47')]({'where':{'id':_0x3870db[_0xde9b('0x48')][_0xde9b('0x69')],'role':'agent'},'attributes':['id',_0xde9b('0x2c'),'fullname',_0xde9b('0x7b'),'internal'],'raw':!![]});}return null;})[_0xde9b('0x17')](function(_0x264516){if(!_0x264516)return null;_0x23fdc7['message'][_0xde9b('0x7c')]=_0x264516;return _0x23fdc7;})[_0xde9b('0x17')](function(_0x188fff){if(_0x188fff){if(_0x3870db[_0xde9b('0x48')][_0xde9b('0x7d')]){_0x23fdc7[_0xde9b('0x1d')][_0xde9b('0x7e')]=util['format'](_0xde9b('0x7f'),_0x3870db[_0xde9b('0x71')][_0xde9b('0x2c')]);_0x23fdc7['message'][_0xde9b('0x80')]=_0x23fdc7[_0xde9b('0x80')];_0x23fdc7[_0xde9b('0x1d')]['motionChannel']=_0x23fdc7[_0xde9b('0x80')];_0x23fdc7[_0xde9b('0x1d')][_0xde9b('0x81')]=_0xde9b('0x65');_0x23fdc7['message'][_0xde9b('0x48')]=htmlToText[_0xde9b('0x82')](_0x23fdc7['message'][_0xde9b('0x48')]);return respondWithRpcPromise(_0xde9b('0x83'),'EventManager',{'event':_0xde9b('0x84'),'message':_0x23fdc7['message']},client9002)[_0xde9b('0x17')](function(){return _0x23fdc7;});}return _0x23fdc7;}return null;})[_0xde9b('0x17')](respondWithResult(_0x57bddf,null))['catch'](handleError(_0x57bddf,null));};exports[_0xde9b('0x85')]=function(_0x4bf18b,_0x178c79){var _0x1dff77={'agent':{},'channel':_0xde9b('0x66')};if(_0x4bf18b[_0xde9b('0x48')]['id']){delete _0x4bf18b['body']['id'];}_0x4bf18b[_0xde9b('0x48')][_0xde9b('0x69')]=_0x4bf18b[_0xde9b('0x48')][_0xde9b('0x69')]||_0x4bf18b['user']['id'];_0x1dff77[_0xde9b('0x7c')]['id']=_0x4bf18b['body'][_0xde9b('0x69')];return db['MailMessage'][_0xde9b('0x47')]({'where':{'id':_0x4bf18b['params']['id'],'UserId':null}})[_0xde9b('0x17')](handleEntityNotFound(_0x178c79,null))['then'](function(_0x4caa66){if(_0x4caa66){_0x1dff77[_0xde9b('0x1d')]=_0x4caa66[_0xde9b('0x6a')]({'plain':!![]});return db[_0xde9b('0x6b')]['find']({'where':{'id':_0x4caa66[_0xde9b('0x6c')]}});}return null;})[_0xde9b('0x17')](handleEntityNotFound(_0x178c79,null))[_0xde9b('0x17')](function(_0x5c0000){if(_0x5c0000){_0x1dff77[_0xde9b('0x6f')]=_0x5c0000[_0xde9b('0x6a')]({'plain':!![]});interaction_log[_0xde9b('0x1e')](_0xde9b('0x86'),_0x4bf18b[_0xde9b('0x71')]['id'],_0x4bf18b['user'][_0xde9b('0x2c')],_0x4bf18b[_0xde9b('0x71')][_0xde9b('0x72')],_0x1dff77[_0xde9b('0x6f')]['id'],_0x4bf18b[_0xde9b('0x48')]?JSON[_0xde9b('0x64')](_0x4bf18b[_0xde9b('0x48')]):_0xde9b('0x73'));return respondWithRpcPromise(_0xde9b('0x87'),'rejectMessage',_0x1dff77);}return null;})[_0xde9b('0x17')](function(_0x209a50){var _0x35f6e9=_0xde9b('0x75')+_0x209a50[_0xde9b('0x1d')][_0xde9b('0x76')];return db['sequelize'][_0xde9b('0x35')](_0x35f6e9,{'type':db[_0xde9b('0x78')]['QueryTypes'][_0xde9b('0x79')],'raw':!![]})[_0xde9b('0x17')](function(_0x550364){return _0x550364;});})['then'](function(_0x34393c){if(_0x34393c){_0x1dff77[_0xde9b('0x1d')]['contact']=_0x34393c[0x0];if(!_0x4bf18b[_0xde9b('0x48')][_0xde9b('0x69')])return;return db[_0xde9b('0x88')]['find']({'where':{'id':_0x4bf18b[_0xde9b('0x48')][_0xde9b('0x69')],'role':_0xde9b('0x7c')},'attributes':['id',_0xde9b('0x2c'),_0xde9b('0x89'),_0xde9b('0x7b'),_0xde9b('0x8a')],'raw':!![]});}return null;})[_0xde9b('0x17')](function(_0xbdc25d){if(!_0xbdc25d)return null;_0x1dff77[_0xde9b('0x1d')][_0xde9b('0x7c')]=_0xbdc25d;return _0x1dff77;})[_0xde9b('0x17')](function(_0x509714){if(_0x509714){_0x509714['message']['interface']=util['format']('SIP/%s',_0x4bf18b['user']['name']);_0x509714[_0xde9b('0x1d')]['channel']=_0x1dff77[_0xde9b('0x80')];_0x509714[_0xde9b('0x1d')][_0xde9b('0x8b')]=_0x1dff77[_0xde9b('0x80')];_0x509714[_0xde9b('0x1d')]['event']=_0xde9b('0x85');_0x509714['message'][_0xde9b('0x48')]=htmlToText[_0xde9b('0x82')](_0x1dff77[_0xde9b('0x1d')][_0xde9b('0x48')]);respondWithRpcPromise(_0xde9b('0x83'),_0xde9b('0x83'),{'event':'rejectmessage','message':_0x509714[_0xde9b('0x1d')]},client9002);return _0x1dff77;}return null;})[_0xde9b('0x17')](respondWithResult(_0x178c79,null))['catch'](handleError(_0x178c79,null));};exports[_0xde9b('0x8c')]=function(_0x44506c,_0x1b2f5c){var _0x58d692=moment()[_0xde9b('0x8d')]()[_0xde9b('0x8e')]();var _0x110483=path[_0xde9b('0x5c')](config[_0xde9b('0x5d')],'server','files',_0xde9b('0x8f'));var _0x591d1c=path['join'](config[_0xde9b('0x5d')],'server',_0xde9b('0x90'),_0xde9b('0x5a'));var _0x4f2df1=util[_0xde9b('0x68')]('message-%s.eml',_0x58d692);return db[_0xde9b('0x30')][_0xde9b('0x47')]({'where':{'id':_0x44506c['params']['id']},'attributes':['id',_0xde9b('0x48'),_0xde9b('0x91'),'to','cc',_0xde9b('0x92'),_0xde9b('0x93'),_0xde9b('0x94')],'include':_0x44506c['query'][_0xde9b('0x5a')]?[{'model':db['Attachment'],'as':_0xde9b('0x95')}]:undefined})[_0xde9b('0x17')](handleEntityNotFound(_0x1b2f5c,null))[_0xde9b('0x17')](function(_0x3b3994){if(_0x3b3994){var _0x52c1b0=_0x3b3994;var _0xaf3461={'from':_0x52c1b0[_0xde9b('0x91')],'to':_0x52c1b0['to'],'subject':_0x52c1b0[_0xde9b('0x93')],'html':htmlEntities[_0xde9b('0x96')](_0x52c1b0[_0xde9b('0x48')]),'headers':{'Date':moment(_0x52c1b0[_0xde9b('0x94')])[_0xde9b('0x68')](_0xde9b('0x97'))},'attachments':[]};if(_0x3b3994['cc']){_0xaf3461['headers']['Cc']=_0x3b3994['cc'];}if(_0x3b3994['bcc']){_0xaf3461[_0xde9b('0x98')][_0xde9b('0x99')]=_0x3b3994[_0xde9b('0x92')];}return new BPromise(function(_0x488c60,_0x5330dd){if(_0x3b3994[_0xde9b('0x95')]){for(var _0x5cc902=0x0;_0x5cc902<_0x3b3994['Attachments'][_0xde9b('0x5b')];_0x5cc902++){var _0x245f20=_0x3b3994[_0xde9b('0x95')][_0x5cc902];var _0x4a4d01=path[_0xde9b('0x5c')](_0x591d1c,_0x245f20[_0xde9b('0x5e')]);if(fs[_0xde9b('0x9a')](_0x4a4d01)){_0xaf3461[_0xde9b('0x5a')]['push']({'name':_0x245f20['name'],'contentType':_0x245f20[_0xde9b('0x33')],'data':fs[_0xde9b('0x9b')](_0x4a4d01)});}}}emlformat[_0xde9b('0x9c')](_0xaf3461,function(_0x2acbbc,_0x2f47fc){if(_0x2acbbc)return _0x5330dd(_0x2acbbc);fs[_0xde9b('0x9d')](path['join'](_0x110483,_0x4f2df1),_0x2f47fc);return _0x488c60(_0x2f47fc);});});}})[_0xde9b('0x17')](function(_0x5ae2ce){if(_0x5ae2ce){return _0x1b2f5c[_0xde9b('0x8c')](path[_0xde9b('0x5c')](_0x110483,_0x4f2df1),_0x4f2df1,function(_0x13aaca){if(!_0x13aaca)fs[_0xde9b('0x9e')](path[_0xde9b('0x5c')](_0x110483,_0x4f2df1));});}})['catch'](handleError(_0x1b2f5c,null));}; \ No newline at end of file +var _0x32de=['fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','ListId','List\x20not\x20found','SendMail','messageId','format','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','fromString','EventManager','acceptmessage','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','motionChannel','unix','toString','server','tmp','files','message-%s.eml','from','subject','Attachment','decode','headers','bcc','Bcc','Attachments','existsSync','push','build','writeFileSync','download','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','undefined','offset','count','limit','status','set','update','destroy','end','sendStatus','stack','name','map','MailMessage','rawAttributes','type','key','model','query','filters','attributes','intersection'];(function(_0x522e52,_0x16a0ae){var _0x19134b=function(_0x55f4b3){while(--_0x55f4b3){_0x522e52['push'](_0x522e52['shift']());}};_0x19134b(++_0x16a0ae);}(_0x32de,0x10d));var _0xe32d=function(_0x571f36,_0x58551e){_0x571f36=_0x571f36-0x0;var _0x12724f=_0x32de[_0x571f36];return _0x12724f;};'use strict';var emlformat=require(_0xe32d('0x0'));var moment=require(_0xe32d('0x1'));var BPromise=require('bluebird');var util=require(_0xe32d('0x2'));var path=require(_0xe32d('0x3'));var fs=require('fs');var _=require(_0xe32d('0x4'));var Redis=require(_0xe32d('0x5'));var htmlToText=require(_0xe32d('0x6'));var qs=require(_0xe32d('0x7'));var logger=require('../../config/logger')(_0xe32d('0x8'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require('../../config/environment');var db=require(_0xe32d('0x9'))['db'];config['redis']=_[_0xe32d('0xa')](config[_0xe32d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe32d('0xc'))(new Redis(config[_0xe32d('0xb')]));var htmlEntities=require(_0xe32d('0xd'));require(_0xe32d('0xe'))[_0xe32d('0xf')](socket);var jayson=require(_0xe32d('0x10'));var client=jayson[_0xe32d('0x11')]['http']({'port':0x232c});var client9003=jayson[_0xe32d('0x11')][_0xe32d('0x12')]({'port':0x232b});var client9002=jayson[_0xe32d('0x11')][_0xe32d('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2061b7,_0x282bff,_0x396a3b,_0x4fa52a){return new BPromise(function(_0xab410c,_0x484695){var _0x155b49=_0x4fa52a||client;return _0x155b49[_0xe32d('0x13')](_0x2061b7,_0x396a3b)[_0xe32d('0x14')](function(_0x352f14){logger[_0xe32d('0x15')](_0xe32d('0x16'),_0x282bff,_0xe32d('0x17'));logger[_0xe32d('0x18')](_0xe32d('0x19'),_0x282bff,_0xe32d('0x17'),JSON[_0xe32d('0x1a')](_0x352f14));if(_0x352f14[_0xe32d('0x1b')]){if(_0x352f14[_0xe32d('0x1b')][_0xe32d('0x1c')]===0x1f4){logger[_0xe32d('0x1b')](_0xe32d('0x16'),_0x282bff,_0x352f14[_0xe32d('0x1b')][_0xe32d('0x1d')]);return _0x484695(_0x352f14['error'][_0xe32d('0x1d')]);}logger[_0xe32d('0x1b')](_0xe32d('0x16'),_0x282bff,_0x352f14[_0xe32d('0x1b')]['message']);return _0xab410c(_0x352f14['error']['message']);}else{logger[_0xe32d('0x15')](_0xe32d('0x16'),_0x282bff,_0xe32d('0x17'));_0xab410c(_0x352f14[_0xe32d('0x1e')][_0xe32d('0x1d')]);}})[_0xe32d('0x1f')](function(_0x5dd05f){logger[_0xe32d('0x1b')]('MailMessage,\x20%s,\x20%s',_0x282bff,_0x5dd05f);_0x484695(_0x5dd05f);});});}function respondWithResult(_0x5260bb,_0x46d47a){_0x46d47a=_0x46d47a||0xc8;return function(_0x8bf0b){if(_0x8bf0b){return _0x5260bb['status'](_0x46d47a)[_0xe32d('0x20')](_0x8bf0b);}};}function respondWithFilteredResult(_0xb31d23,_0x58d925){return function(_0x1c1153){if(_0x1c1153){var _0x2f2e1b=typeof _0x58d925['offset']==='undefined'&&typeof _0x58d925['limit']===_0xe32d('0x21');var _0x4a41d4=_0x1c1153['count'];var _0x3894b4=_0x2f2e1b?0x0:_0x58d925[_0xe32d('0x22')];var _0x42a6a9=_0x2f2e1b?_0x1c1153[_0xe32d('0x23')]:_0x58d925[_0xe32d('0x22')]+_0x58d925[_0xe32d('0x24')];var _0xa46817;if(_0x42a6a9>=_0x4a41d4){_0x42a6a9=_0x4a41d4;_0xa46817=0xc8;}else{_0xa46817=0xce;}_0xb31d23[_0xe32d('0x25')](_0xa46817);return _0xb31d23[_0xe32d('0x26')]('Content-Range',_0x3894b4+'-'+_0x42a6a9+'/'+_0x4a41d4)[_0xe32d('0x20')](_0x1c1153);}return null;};}function saveUpdates(_0x5b8418){return function(_0x45608e){if(_0x45608e){return _0x45608e[_0xe32d('0x27')](_0x5b8418)[_0xe32d('0x14')](function(_0x127a5a){return _0x127a5a;});}return null;};}function removeEntity(_0x1240b1){return function(_0x7867ea){if(_0x7867ea){return _0x7867ea[_0xe32d('0x28')]()[_0xe32d('0x14')](function(){_0x1240b1[_0xe32d('0x25')](0xcc)[_0xe32d('0x29')]();});}};}function handleEntityNotFound(_0x1981f5){return function(_0x32339b){if(!_0x32339b){_0x1981f5[_0xe32d('0x2a')](0x194);}return _0x32339b;};}function handleError(_0x224fe3,_0x34839b){_0x34839b=_0x34839b||0x1f4;return function(_0x571cab){logger['error'](_0x571cab[_0xe32d('0x2b')]);if(_0x571cab[_0xe32d('0x2c')]){delete _0x571cab[_0xe32d('0x2c')];}_0x224fe3[_0xe32d('0x25')](_0x34839b)['send'](_0x571cab);};}exports['index']=function(_0x44a3b0,_0x4a63ab){var _0x35c5da={},_0xf4498c={},_0x5b3db0={'count':0x0,'rows':[]};var _0x29291a=_[_0xe32d('0x2d')](db[_0xe32d('0x2e')][_0xe32d('0x2f')],function(_0x273beb){return{'name':_0x273beb['fieldName'],'type':_0x273beb[_0xe32d('0x30')][_0xe32d('0x31')]};});_0xf4498c[_0xe32d('0x32')]=_[_0xe32d('0x2d')](_0x29291a,_0xe32d('0x2c'));_0xf4498c[_0xe32d('0x33')]=_['keys'](_0x44a3b0[_0xe32d('0x33')]);_0xf4498c[_0xe32d('0x34')]=_['intersection'](_0xf4498c[_0xe32d('0x32')],_0xf4498c['query']);_0x35c5da[_0xe32d('0x35')]=_[_0xe32d('0x36')](_0xf4498c['model'],qs['fields'](_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x37')]));_0x35c5da['attributes']=_0x35c5da[_0xe32d('0x35')][_0xe32d('0x38')]?_0x35c5da['attributes']:_0xf4498c[_0xe32d('0x32')];if(!_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x39')](_0xe32d('0x3a'))){_0x35c5da[_0xe32d('0x24')]=qs[_0xe32d('0x24')](_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x24')]);_0x35c5da[_0xe32d('0x22')]=qs[_0xe32d('0x22')](_0x44a3b0[_0xe32d('0x33')]['offset']);}_0x35c5da['order']=qs[_0xe32d('0x3b')](_0x44a3b0[_0xe32d('0x33')]['sort']);_0x35c5da['where']=qs['filters'](_[_0xe32d('0x3c')](_0x44a3b0[_0xe32d('0x33')],_0xf4498c['filters']),_0x29291a);if(_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x3d')]){_0x35c5da[_0xe32d('0x3e')]=_[_0xe32d('0x3f')](_0x35c5da[_0xe32d('0x3e')],{'$or':_['map'](_0x29291a,function(_0x2dac67){if(_0x2dac67[_0xe32d('0x30')]!==_0xe32d('0x40')){var _0x2c54bc={};_0x2c54bc[_0x2dac67[_0xe32d('0x2c')]]={'$like':'%'+_0x44a3b0['query'][_0xe32d('0x3d')]+'%'};return _0x2c54bc;}})});}_0x35c5da=_[_0xe32d('0x3f')]({},_0x35c5da,_0x44a3b0[_0xe32d('0x41')]);var _0x2a7118={'where':_0x35c5da['where']};return db['MailMessage'][_0xe32d('0x23')](_0x2a7118)[_0xe32d('0x14')](function(_0x2ddf83){_0x5b3db0[_0xe32d('0x23')]=_0x2ddf83;if(_0x44a3b0[_0xe32d('0x33')][_0xe32d('0x42')]){_0x35c5da[_0xe32d('0x43')]=[{'all':!![]}];}return db[_0xe32d('0x2e')][_0xe32d('0x44')](_0x35c5da);})['then'](function(_0x4c0341){_0x5b3db0[_0xe32d('0x45')]=_0x4c0341;return _0x5b3db0;})[_0xe32d('0x14')](respondWithFilteredResult(_0x4a63ab,_0x35c5da))[_0xe32d('0x1f')](handleError(_0x4a63ab,null));};exports['show']=function(_0xeffe98,_0x44a9ed){var _0x18a92c={'raw':!![],'where':{'id':_0xeffe98[_0xe32d('0x46')]['id']}},_0x51dfc7={};_0x51dfc7[_0xe32d('0x32')]=_[_0xe32d('0x47')](db[_0xe32d('0x2e')][_0xe32d('0x2f')]);_0x51dfc7[_0xe32d('0x33')]=_[_0xe32d('0x47')](_0xeffe98[_0xe32d('0x33')]);_0x51dfc7['filters']=_[_0xe32d('0x36')](_0x51dfc7[_0xe32d('0x32')],_0x51dfc7[_0xe32d('0x33')]);_0x18a92c['attributes']=_[_0xe32d('0x36')](_0x51dfc7[_0xe32d('0x32')],qs[_0xe32d('0x37')](_0xeffe98[_0xe32d('0x33')][_0xe32d('0x37')]));_0x18a92c[_0xe32d('0x35')]=_0x18a92c[_0xe32d('0x35')][_0xe32d('0x38')]?_0x18a92c[_0xe32d('0x35')]:_0x51dfc7['model'];if(_0xeffe98[_0xe32d('0x33')]['includeAll']){_0x18a92c[_0xe32d('0x43')]=[{'all':!![]}];}_0x18a92c=_['merge']({},_0x18a92c,_0xeffe98['options']);return db[_0xe32d('0x2e')][_0xe32d('0x48')](_0x18a92c)[_0xe32d('0x14')](handleEntityNotFound(_0x44a9ed,null))['then'](respondWithResult(_0x44a9ed,null))[_0xe32d('0x1f')](handleError(_0x44a9ed,null));};exports[_0xe32d('0x27')]=function(_0x5c7036,_0x6f4e6a){if(_0x5c7036[_0xe32d('0x49')]['id']){delete _0x5c7036[_0xe32d('0x49')]['id'];}return db['MailMessage'][_0xe32d('0x48')]({'where':{'id':_0x5c7036[_0xe32d('0x46')]['id']}})[_0xe32d('0x14')](handleEntityNotFound(_0x6f4e6a,null))[_0xe32d('0x14')](saveUpdates(_0x5c7036[_0xe32d('0x49')],null))['then'](respondWithResult(_0x6f4e6a,null))['catch'](handleError(_0x6f4e6a,null));};exports['destroy']=function(_0x1d8c65,_0x409ae4){return db[_0xe32d('0x2e')]['find']({'where':{'id':_0x1d8c65['params']['id']}})[_0xe32d('0x14')](handleEntityNotFound(_0x409ae4,null))[_0xe32d('0x14')](removeEntity(_0x409ae4,null))[_0xe32d('0x1f')](handleError(_0x409ae4,null));};exports[_0xe32d('0x4a')]=function(_0x1dadd5,_0x572e3a){return db[_0xe32d('0x2e')][_0xe32d('0x4a')]()[_0xe32d('0x14')](respondWithResult(_0x572e3a,null))[_0xe32d('0x1f')](handleError(_0x572e3a,null));};exports[_0xe32d('0x4b')]=function(_0x3c2370,_0x1eedbf){return db[_0xe32d('0x2e')][_0xe32d('0x4b')](_0x3c2370['body'])['then'](function(_0x4fb38b){if(_0x4fb38b){if(_0x4fb38b[_0xe32d('0x4c')]===_0xe32d('0x4d')&&!_0x4fb38b[_0xe32d('0x4e')]){var _0x445b9c,_0x392c36,_0x3f602d;if(_0x3c2370[_0xe32d('0x49')]['to']){_0x392c36=_0x3c2370[_0xe32d('0x49')]['to'][_0xe32d('0x4f')](',')[0x0];}return db[_0xe32d('0x50')][_0xe32d('0x51')]({'where':{'id':_0x4fb38b['MailAccountId']},'include':[{'model':db[_0xe32d('0x52')],'as':_0xe32d('0x53'),'include':[{'model':db[_0xe32d('0x54')],'as':_0xe32d('0x55'),'where':{'email':_0x392c36},'limit':0x1,'order':[[_0xe32d('0x56'),_0xe32d('0x57')]]}]},{'model':db[_0xe32d('0x58')],'as':_0xe32d('0x59'),'raw':!![],'include':[{'model':db[_0xe32d('0x5a')],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x28543c){_0x445b9c=_0x28543c;if(!_0x445b9c||!_0x445b9c['Smtp'])return;var _0x5d2d43=_0x445b9c[_0xe32d('0x5b')]();if(_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')]&&_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')][_0xe32d('0x38')]){for(var _0x266e01=0x0;_0x266e01<_0x3c2370[_0xe32d('0x49')]['attachments'][_0xe32d('0x38')];_0x266e01+=0x1){_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')][_0x266e01]={'filename':_0x3c2370[_0xe32d('0x49')][_0xe32d('0x5c')][_0x266e01][_0xe32d('0x2c')],'path':path[_0xe32d('0x5d')](config[_0xe32d('0x5e')],_0xe32d('0x5f'),_0x3c2370[_0xe32d('0x49')]['attachments'][_0x266e01]['basename'])};}}_0x3f602d={'account':_0x5d2d43,'message':_0x3c2370[_0xe32d('0x49')]};return;})[_0xe32d('0x14')](function(){if(_0x445b9c[_0xe32d('0x53')]){if(_0x445b9c['List'][_0xe32d('0x55')][_0xe32d('0x38')]){return _0x445b9c[_0xe32d('0x53')][_0xe32d('0x55')][0x0];}else{return db[_0xe32d('0x54')][_0xe32d('0x4b')](_['defaults'](_0x3c2370[_0xe32d('0x49')],{'firstName':_0x3c2370[_0xe32d('0x49')]['to'],'email':_0x3c2370['body']['to'],'phone':_0x3c2370[_0xe32d('0x49')]['to'],'ListId':_0x445b9c[_0xe32d('0x60')]}));}}else{throw new Error(_0xe32d('0x61'));}})[_0xe32d('0x14')](function(){if(_0x3f602d){return respondWithRpcPromise(_0xe32d('0x62'),'sendMail',_0x3f602d,client9003)[_0xe32d('0x14')](function(_0x24a89){return _0x4fb38b[_0xe32d('0x27')]({'read':!![],'messageId':_0x24a89[_0xe32d('0x63')],'sentAt':moment()[_0xe32d('0x64')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xe32d('0x1f')](function(_0x56c003){logger[_0xe32d('0x1b')]('%s',JSON[_0xe32d('0x1a')](_0x56c003));return _0x4fb38b;});}return _0x4fb38b;});}return _0x4fb38b;}})[_0xe32d('0x14')](respondWithResult(_0x1eedbf,0xc9))[_0xe32d('0x1f')](handleError(_0x1eedbf,null));};exports['accept']=function(_0x3fb2f7,_0x13d32a){var _0xfc28e3={'agent':{},'channel':_0xe32d('0x65')};if(_0x3fb2f7[_0xe32d('0x49')]['id']){delete _0x3fb2f7[_0xe32d('0x49')]['id'];}_0x3fb2f7[_0xe32d('0x49')]['read']=!![];_0x3fb2f7['body'][_0xe32d('0x66')]=moment()[_0xe32d('0x64')](_0xe32d('0x67'));_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')]=_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')]||_0x3fb2f7[_0xe32d('0x69')]['id'];_0xfc28e3[_0xe32d('0x6a')]['id']=_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')];return db['MailMessage'][_0xe32d('0x48')]({'where':{'id':_0x3fb2f7[_0xe32d('0x46')]['id'],'UserId':null}})[_0xe32d('0x14')](handleEntityNotFound(_0x13d32a,null))[_0xe32d('0x14')](saveUpdates(_0x3fb2f7[_0xe32d('0x49')],null))[_0xe32d('0x14')](function(_0x212d51){if(_0x212d51){_0xfc28e3[_0xe32d('0x1d')]=_0x212d51[_0xe32d('0x6b')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x212d51['MailInteractionId']}});}return null;})[_0xe32d('0x14')](handleEntityNotFound(_0x13d32a,null))[_0xe32d('0x14')](function(_0x461627){if(_0x461627){return _0x461627[_0xe32d('0x27')]({'UserId':_0x3fb2f7['body'][_0xe32d('0x68')],'read1stAt':_[_0xe32d('0x6c')](_0x461627['read1stAt'])?moment()[_0xe32d('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3c18c6){if(_0x3c18c6){_0xfc28e3['interaction']=_0x3c18c6[_0xe32d('0x6b')]({'plain':!![]});interaction_log['info'](_0xe32d('0x6d'),_0x3fb2f7[_0xe32d('0x69')]['id'],_0x3fb2f7[_0xe32d('0x69')][_0xe32d('0x2c')],_0x3fb2f7[_0xe32d('0x69')][_0xe32d('0x6e')],_0xfc28e3[_0xe32d('0x6f')]['id'],_0x3fb2f7[_0xe32d('0x49')]?JSON['stringify'](_0x3fb2f7[_0xe32d('0x49')]):_0xe32d('0x70'));return respondWithRpcPromise(_0xe32d('0x71'),_0xe32d('0x72'),_0xfc28e3);}return null;})[_0xe32d('0x14')](function(_0x4fdfc8){var _0x229b88=_0xe32d('0x73')+_0x4fdfc8[_0xe32d('0x1d')][_0xe32d('0x74')];return db[_0xe32d('0x75')][_0xe32d('0x33')](_0x229b88,{'type':db[_0xe32d('0x76')]['QueryTypes']['SELECT'],'raw':!![]})[_0xe32d('0x14')](function(_0xe5b4c5){return _0xe5b4c5;});})['then'](function(_0x358a24){if(_0x358a24){_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x77')]=_0x358a24[0x0];if(!_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')])return;return db[_0xe32d('0x78')]['find']({'where':{'id':_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x68')],'role':_0xe32d('0x6a')},'attributes':['id',_0xe32d('0x2c'),_0xe32d('0x79'),_0xe32d('0x7a'),_0xe32d('0x7b')],'raw':!![]});}return null;})[_0xe32d('0x14')](function(_0x3a08cd){if(!_0x3a08cd)return null;_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x6a')]=_0x3a08cd;return _0xfc28e3;})[_0xe32d('0x14')](function(_0x24b14e){if(_0x24b14e){if(_0x3fb2f7[_0xe32d('0x49')][_0xe32d('0x7c')]){_0xfc28e3['message'][_0xe32d('0x7d')]=util['format'](_0xe32d('0x7e'),_0x3fb2f7[_0xe32d('0x69')][_0xe32d('0x2c')]);_0xfc28e3[_0xe32d('0x1d')]['channel']=_0xfc28e3[_0xe32d('0x7f')];_0xfc28e3[_0xe32d('0x1d')]['motionChannel']=_0xfc28e3[_0xe32d('0x7f')];_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x80')]=_0xe32d('0x81');_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x49')]=htmlToText[_0xe32d('0x82')](_0xfc28e3[_0xe32d('0x1d')][_0xe32d('0x49')]);return respondWithRpcPromise(_0xe32d('0x83'),'EventManager',{'event':_0xe32d('0x84'),'message':_0xfc28e3['message']},client9002)[_0xe32d('0x14')](function(){return _0xfc28e3;});}return _0xfc28e3;}return null;})[_0xe32d('0x14')](respondWithResult(_0x13d32a,null))[_0xe32d('0x1f')](handleError(_0x13d32a,null));};exports[_0xe32d('0x85')]=function(_0x45a64f,_0x273b8f){var _0x33d1db={'agent':{},'channel':_0xe32d('0x65')};if(_0x45a64f[_0xe32d('0x49')]['id']){delete _0x45a64f['body']['id'];}_0x45a64f['body'][_0xe32d('0x68')]=_0x45a64f[_0xe32d('0x49')][_0xe32d('0x68')]||_0x45a64f[_0xe32d('0x69')]['id'];_0x33d1db['agent']['id']=_0x45a64f[_0xe32d('0x49')][_0xe32d('0x68')];return db[_0xe32d('0x2e')][_0xe32d('0x48')]({'where':{'id':_0x45a64f[_0xe32d('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x273b8f,null))['then'](function(_0x10090b){if(_0x10090b){_0x33d1db[_0xe32d('0x1d')]=_0x10090b[_0xe32d('0x6b')]({'plain':!![]});return db[_0xe32d('0x86')][_0xe32d('0x48')]({'where':{'id':_0x10090b[_0xe32d('0x87')]}});}return null;})[_0xe32d('0x14')](handleEntityNotFound(_0x273b8f,null))['then'](function(_0x463512){if(_0x463512){_0x33d1db[_0xe32d('0x6f')]=_0x463512[_0xe32d('0x6b')]({'plain':!![]});interaction_log[_0xe32d('0x15')](_0xe32d('0x88'),_0x45a64f['user']['id'],_0x45a64f[_0xe32d('0x69')][_0xe32d('0x2c')],_0x45a64f[_0xe32d('0x69')][_0xe32d('0x6e')],_0x33d1db[_0xe32d('0x6f')]['id'],_0x45a64f[_0xe32d('0x49')]?JSON[_0xe32d('0x1a')](_0x45a64f[_0xe32d('0x49')]):_0xe32d('0x70'));return respondWithRpcPromise(_0xe32d('0x89'),_0xe32d('0x8a'),_0x33d1db);}return null;})[_0xe32d('0x14')](function(_0x4ef039){var _0x181cfb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4ef039[_0xe32d('0x1d')][_0xe32d('0x74')];return db[_0xe32d('0x75')][_0xe32d('0x33')](_0x181cfb,{'type':db[_0xe32d('0x76')][_0xe32d('0x8b')][_0xe32d('0x8c')],'raw':!![]})['then'](function(_0x16bcc1){return _0x16bcc1;});})[_0xe32d('0x14')](function(_0x124275){if(_0x124275){_0x33d1db[_0xe32d('0x1d')][_0xe32d('0x77')]=_0x124275[0x0];if(!_0x45a64f['body'][_0xe32d('0x68')])return;return db[_0xe32d('0x78')][_0xe32d('0x48')]({'where':{'id':_0x45a64f[_0xe32d('0x49')][_0xe32d('0x68')],'role':_0xe32d('0x6a')},'attributes':['id',_0xe32d('0x2c'),_0xe32d('0x79'),_0xe32d('0x7a'),_0xe32d('0x7b')],'raw':!![]});}return null;})[_0xe32d('0x14')](function(_0x1f6dbb){if(!_0x1f6dbb)return null;_0x33d1db[_0xe32d('0x1d')]['agent']=_0x1f6dbb;return _0x33d1db;})[_0xe32d('0x14')](function(_0x2dad95){if(_0x2dad95){_0x2dad95[_0xe32d('0x1d')][_0xe32d('0x7d')]=util['format'](_0xe32d('0x7e'),_0x45a64f[_0xe32d('0x69')][_0xe32d('0x2c')]);_0x2dad95[_0xe32d('0x1d')]['channel']=_0x33d1db['channel'];_0x2dad95['message'][_0xe32d('0x8d')]=_0x33d1db[_0xe32d('0x7f')];_0x2dad95[_0xe32d('0x1d')][_0xe32d('0x80')]=_0xe32d('0x85');_0x2dad95[_0xe32d('0x1d')][_0xe32d('0x49')]=htmlToText[_0xe32d('0x82')](_0x33d1db['message'][_0xe32d('0x49')]);respondWithRpcPromise('EventManager',_0xe32d('0x83'),{'event':'rejectmessage','message':_0x2dad95[_0xe32d('0x1d')]},client9002);return _0x33d1db;}return null;})['then'](respondWithResult(_0x273b8f,null))[_0xe32d('0x1f')](handleError(_0x273b8f,null));};exports['download']=function(_0x499506,_0x56d698){var _0x1d92a1=moment()[_0xe32d('0x8e')]()[_0xe32d('0x8f')]();var _0x47630b=path[_0xe32d('0x5d')](config[_0xe32d('0x5e')],_0xe32d('0x90'),'files',_0xe32d('0x91'));var _0xe97cd7=path['join'](config[_0xe32d('0x5e')],_0xe32d('0x90'),_0xe32d('0x92'),_0xe32d('0x5c'));var _0x3d387b=util['format'](_0xe32d('0x93'),_0x1d92a1);return db[_0xe32d('0x2e')][_0xe32d('0x48')]({'where':{'id':_0x499506[_0xe32d('0x46')]['id']},'attributes':['id',_0xe32d('0x49'),_0xe32d('0x94'),'to','cc','bcc',_0xe32d('0x95'),'createdAt'],'include':_0x499506[_0xe32d('0x33')]['attachments']?[{'model':db[_0xe32d('0x96')],'as':'Attachments'}]:undefined})[_0xe32d('0x14')](handleEntityNotFound(_0x56d698,null))[_0xe32d('0x14')](function(_0x527e08){if(_0x527e08){var _0x58c1cc=_0x527e08;var _0xb2a371={'from':_0x58c1cc[_0xe32d('0x94')],'to':_0x58c1cc['to'],'subject':_0x58c1cc[_0xe32d('0x95')],'html':htmlEntities[_0xe32d('0x97')](_0x58c1cc[_0xe32d('0x49')]),'headers':{'Date':moment(_0x58c1cc['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x527e08['cc']){_0xb2a371[_0xe32d('0x98')]['Cc']=_0x527e08['cc'];}if(_0x527e08[_0xe32d('0x99')]){_0xb2a371[_0xe32d('0x98')][_0xe32d('0x9a')]=_0x527e08[_0xe32d('0x99')];}return new BPromise(function(_0x1b2863,_0x26bd55){if(_0x527e08[_0xe32d('0x9b')]){for(var _0x5a6bca=0x0;_0x5a6bca<_0x527e08[_0xe32d('0x9b')][_0xe32d('0x38')];_0x5a6bca++){var _0x55faba=_0x527e08['Attachments'][_0x5a6bca];var _0xaf0618=path[_0xe32d('0x5d')](_0xe97cd7,_0x55faba['basename']);if(fs[_0xe32d('0x9c')](_0xaf0618)){_0xb2a371[_0xe32d('0x5c')][_0xe32d('0x9d')]({'name':_0x55faba[_0xe32d('0x2c')],'contentType':_0x55faba['type'],'data':fs['readFileSync'](_0xaf0618)});}}}emlformat[_0xe32d('0x9e')](_0xb2a371,function(_0xb82dfb,_0x212b4d){if(_0xb82dfb)return _0x26bd55(_0xb82dfb);fs[_0xe32d('0x9f')](path['join'](_0x47630b,_0x3d387b),_0x212b4d);return _0x1b2863(_0x212b4d);});});}})['then'](function(_0x49fbb5){if(_0x49fbb5){return _0x56d698[_0xe32d('0xa0')](path[_0xe32d('0x5d')](_0x47630b,_0x3d387b),_0x3d387b,function(_0x2c401c){if(!_0x2c401c)fs[_0xe32d('0xa1')](path['join'](_0x47630b,_0x3d387b));});}})[_0xe32d('0x1f')](handleError(_0x56d698,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 689bdac..c407a2c 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 _0x5da4=['save','update','emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x2d7fbe,_0x44b669){var _0x3a93ac=function(_0x101520){while(--_0x101520){_0x2d7fbe['push'](_0x2d7fbe['shift']());}};_0x3a93ac(++_0x44b669);}(_0x5da4,0xa7));var _0x45da=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x5da4[_0x422905];return _0x33dc6c;};'use strict';var EventEmitter=require(_0x45da('0x0'));var MailMessage=require(_0x45da('0x1'))['db'][_0x45da('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x45da('0x3')](0x0);var events={'afterCreate':_0x45da('0x4'),'afterUpdate':_0x45da('0x5'),'afterDestroy':'remove'};function emitEvent(_0x445fb4){return function(_0x43b603,_0x4a5933,_0x40dd1b){MailMessageEvents['emit'](_0x445fb4+':'+_0x43b603['id'],_0x43b603);MailMessageEvents[_0x45da('0x6')](_0x445fb4,_0x43b603);_0x40dd1b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x45da('0x7')](e,emitEvent(event));}}module[_0x45da('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xb063=['MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xb063,0x152));var _0x3b06=function(_0x7d2272,_0x41f365){_0x7d2272=_0x7d2272-0x0;var _0x5bc56e=_0xb063[_0x7d2272];return _0x5bc56e;};'use strict';var EventEmitter=require(_0x3b06('0x0'));var MailMessage=require(_0x3b06('0x1'))['db'][_0x3b06('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3b06('0x3')](0x0);var events={'afterCreate':_0x3b06('0x4'),'afterUpdate':_0x3b06('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4682a1){return function(_0x5e5120,_0x6b5091,_0x287ca7){MailMessageEvents['emit'](_0x4682a1+':'+_0x5e5120['id'],_0x5e5120);MailMessageEvents[_0x3b06('0x6')](_0x4682a1,_0x5e5120);_0x287ca7(null);};}for(var e in events){if(events[_0x3b06('0x7')](e)){var event=events[e];MailMessage[_0x3b06('0x8')](e,emitEvent(event));}}module[_0x3b06('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 87ba7a1..1e05137 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 _0x7224=['findOne','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','body','fromString','get','direction','toLowerCase','out','secret','UserId','MailInteraction'];(function(_0x445114,_0x1598ee){var _0x597164=function(_0x1c9b8a){while(--_0x1c9b8a){_0x445114['push'](_0x445114['shift']());}};_0x597164(++_0x1598ee);}(_0x7224,0xb9));var _0x4722=function(_0x3b7113,_0x2f92c8){_0x3b7113=_0x3b7113-0x0;var _0x35096c=_0x7224[_0x3b7113];return _0x35096c;};'use strict';var _=require(_0x4722('0x0'));var util=require(_0x4722('0x1'));var logger=require(_0x4722('0x2'))(_0x4722('0x3'));var moment=require(_0x4722('0x4'));var BPromise=require(_0x4722('0x5'));var rp=require(_0x4722('0x6'));var htmlToText=require(_0x4722('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4722('0x8'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x4722('0x9')]=function(_0x23e146,_0x389846){return _0x23e146[_0x4722('0xa')](_0x4722('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4722('0xc')]},{'name':_0x4722('0xd'),'fields':[_0x4722('0xe'),_0x4722('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a7c79,_0x423271,_0x40a028){if(_0x5a7c79[_0x4722('0x10')]){_0x5a7c79[_0x4722('0xe')]=htmlToText[_0x4722('0x11')](_0x5a7c79[_0x4722('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x40a028(null,_0x423271);},'afterCreate':function(_0x243381,_0x4f7dc0,_0x17c42a){var _0x2ca3bc=_0x23e146['models'];var _0x525d66=_0x243381[_0x4722('0x12')]({'plain':!![]});if(_0x525d66[_0x4722('0x13')]['toLowerCase']()==='in'||_0x525d66['direction'][_0x4722('0x14')]()===_0x4722('0x15')&&!_0x525d66[_0x4722('0x16')]&&!_['isNil'](_0x525d66[_0x4722('0x17')])){_0x2ca3bc[_0x4722('0x18')][_0x4722('0x19')]({'where':{'id':_0x525d66['MailInteractionId']}})['then'](function(_0x32d071){if(_0x32d071){_0x32d071['update']({'lastMsgAt':_0x525d66['createdAt'],'lastMsgDirection':_0x525d66['direction'][_0x4722('0x14')]()});}})[_0x4722('0x1a')](function(_0xe740fc){console[_0x4722('0x1b')](_0xe740fc);});}_0x17c42a();}},'charset':_0x4722('0x1c'),'collate':_0x4722('0x1d')});}; \ No newline at end of file +var _0xa594=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','mail_messages','messageId','plainBody','FULLTEXT','body','fromString','models','direction','toLowerCase','isNil','UserId','MailInteraction','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0xd21d83,_0x1de2ee){var _0x2f0012=function(_0x4c87fc){while(--_0x4c87fc){_0xd21d83['push'](_0xd21d83['shift']());}};_0x2f0012(++_0x1de2ee);}(_0xa594,0x1b3));var _0x4a59=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0xa594[_0xc14df7];return _0x34a445;};'use strict';var _=require(_0x4a59('0x0'));var util=require(_0x4a59('0x1'));var logger=require(_0x4a59('0x2'))(_0x4a59('0x3'));var moment=require(_0x4a59('0x4'));var BPromise=require(_0x4a59('0x5'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x4a59('0x6'));var rimraf=require(_0x4a59('0x7'));var config=require(_0x4a59('0x8'));var attributes=require(_0x4a59('0x9'));module['exports']=function(_0x343578,_0x413af8){return _0x343578['define']('MailMessage',attributes,{'tableName':_0x4a59('0xa'),'paranoid':![],'indexes':[{'name':_0x4a59('0xb'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0x4a59('0xc'),'subject'],'type':_0x4a59('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x246d57,_0x4c27ba,_0x35c122){if(_0x246d57[_0x4a59('0xe')]){_0x246d57[_0x4a59('0xc')]=htmlToText[_0x4a59('0xf')](_0x246d57[_0x4a59('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x35c122(null,_0x4c27ba);},'afterCreate':function(_0x41e16b,_0x2c789,_0x2167c5){var _0x112b49=_0x343578[_0x4a59('0x10')];var _0x4b4c76=_0x41e16b['get']({'plain':!![]});if(_0x4b4c76[_0x4a59('0x11')][_0x4a59('0x12')]()==='in'||_0x4b4c76['direction'][_0x4a59('0x12')]()==='out'&&!_0x4b4c76['secret']&&!_[_0x4a59('0x13')](_0x4b4c76[_0x4a59('0x14')])){_0x112b49[_0x4a59('0x15')]['findOne']({'where':{'id':_0x4b4c76[_0x4a59('0x16')]}})[_0x4a59('0x17')](function(_0x4bb22d){if(_0x4bb22d){_0x4bb22d[_0x4a59('0x18')]({'lastMsgAt':_0x4b4c76['createdAt'],'lastMsgDirection':_0x4b4c76[_0x4a59('0x11')][_0x4a59('0x12')]()});}})[_0x4a59('0x19')](function(_0x3a164c){console[_0x4a59('0x1a')](_0x3a164c);});}_0x2167c5();}},'charset':_0x4a59('0x1b'),'collate':_0x4a59('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 7589ea9..53bc59c 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 _0x1893=['result','MailMessage','body','options','CreateMailMessage','debug','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4a0bac,_0x3dd32b){var _0x48458a=function(_0x1941a0){while(--_0x1941a0){_0x4a0bac['push'](_0x4a0bac['shift']());}};_0x48458a(++_0x3dd32b);}(_0x1893,0xa2));var _0x3189=function(_0x5b3496,_0x31c442){_0x5b3496=_0x5b3496-0x0;var _0x216727=_0x1893[_0x5b3496];return _0x216727;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});config[_0x3189('0xb')]=_[_0x3189('0xc')](config[_0x3189('0xb')],{'host':_0x3189('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3189('0xb')]));require('./mailMessage.socket')[_0x3189('0xe')](socket);function respondWithRpcPromise(_0x4ac683,_0x3ec9d0,_0x33cdfb){return new BPromise(function(_0xca480c,_0x176799){return client['request'](_0x4ac683,_0x33cdfb)[_0x3189('0xf')](function(_0x149428){logger[_0x3189('0x10')](_0x3189('0x11'),_0x3ec9d0,_0x3189('0x12'));logger['debug'](_0x3189('0x13'),_0x3ec9d0,_0x3189('0x12'),JSON[_0x3189('0x14')](_0x149428));if(_0x149428[_0x3189('0x15')]){if(_0x149428[_0x3189('0x15')][_0x3189('0x16')]===0x1f4){logger[_0x3189('0x15')](_0x3189('0x11'),_0x3ec9d0,_0x149428['error'][_0x3189('0x17')]);return _0x176799(_0x149428[_0x3189('0x15')][_0x3189('0x17')]);}logger[_0x3189('0x15')]('MailMessage,\x20%s,\x20%s',_0x3ec9d0,_0x149428[_0x3189('0x15')]['message']);return _0xca480c(_0x149428['error'][_0x3189('0x17')]);}else{logger['info'](_0x3189('0x11'),_0x3ec9d0,_0x3189('0x12'));_0xca480c(_0x149428[_0x3189('0x18')][_0x3189('0x17')]);}})['catch'](function(_0xd3d5a){logger[_0x3189('0x15')](_0x3189('0x11'),_0x3ec9d0,_0xd3d5a);_0x176799(_0xd3d5a);});});}exports['CreateMailMessage']=function(_0x561265){var _0xb0e89b=this;return new Promise(function(_0x306ed3,_0x2c1e59){return db[_0x3189('0x19')]['create'](_0x561265[_0x3189('0x1a')],{'raw':_0x561265[_0x3189('0x1b')]?_0x561265[_0x3189('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3189('0xf')](function(_0x47abb4){logger[_0x3189('0x10')](_0x3189('0x1c'),_0x561265);logger[_0x3189('0x1d')](_0x3189('0x1c'),_0x561265,JSON[_0x3189('0x14')](_0x47abb4));_0x306ed3(_0x47abb4);})[_0x3189('0x1e')](function(_0x5a08dc){logger['error'](_0x3189('0x1c'),_0x5a08dc[_0x3189('0x17')],_0x561265);_0x2c1e59(_0xb0e89b[_0x3189('0x15')](0x1f4,_0x5a08dc[_0x3189('0x17')]));});});}; \ No newline at end of file +var _0xb574=['../../config/environment','http','socket.io-emitter','redis','./mailMessage.socket','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','info','catch','CreateMailMessage','MailMessage','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xb574,0x106));var _0x4b57=function(_0x5980a9,_0x2241e9){_0x5980a9=_0x5980a9-0x0;var _0x2d7949=_0xb574[_0x5980a9];return _0x2d7949;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4b57('0xa'))(new Redis(config[_0x4b57('0xb')]));require(_0x4b57('0xc'))[_0x4b57('0xd')](socket);function respondWithRpcPromise(_0xce47ad,_0x116958,_0x1db79a){return new BPromise(function(_0x43b108,_0x5593b8){return client[_0x4b57('0xe')](_0xce47ad,_0x1db79a)[_0x4b57('0xf')](function(_0x274912){logger['info']('MailMessage,\x20%s,\x20%s',_0x116958,_0x4b57('0x10'));logger[_0x4b57('0x11')](_0x4b57('0x12'),_0x116958,_0x4b57('0x10'),JSON[_0x4b57('0x13')](_0x274912));if(_0x274912[_0x4b57('0x14')]){if(_0x274912[_0x4b57('0x14')][_0x4b57('0x15')]===0x1f4){logger[_0x4b57('0x14')]('MailMessage,\x20%s,\x20%s',_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x5593b8(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}logger['error'](_0x4b57('0x17'),_0x116958,_0x274912['error'][_0x4b57('0x16')]);return _0x43b108(_0x274912[_0x4b57('0x14')][_0x4b57('0x16')]);}else{logger[_0x4b57('0x18')](_0x4b57('0x17'),_0x116958,_0x4b57('0x10'));_0x43b108(_0x274912['result'][_0x4b57('0x16')]);}})[_0x4b57('0x19')](function(_0x53f29a){logger[_0x4b57('0x14')]('MailMessage,\x20%s,\x20%s',_0x116958,_0x53f29a);_0x5593b8(_0x53f29a);});});}exports[_0x4b57('0x1a')]=function(_0x1ca49e){var _0xad9165=this;return new Promise(function(_0x2682d6,_0xef1eae){return db[_0x4b57('0x1b')]['create'](_0x1ca49e[_0x4b57('0x1c')],{'raw':_0x1ca49e[_0x4b57('0x1d')]?_0x1ca49e[_0x4b57('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x4b57('0xf')](function(_0x4a34b2){logger[_0x4b57('0x18')](_0x4b57('0x1a'),_0x1ca49e);logger['debug'](_0x4b57('0x1a'),_0x1ca49e,JSON[_0x4b57('0x13')](_0x4a34b2));_0x2682d6(_0x4a34b2);})['catch'](function(_0x3e7b96){logger[_0x4b57('0x14')](_0x4b57('0x1a'),_0x3e7b96[_0x4b57('0x16')],_0x1ca49e);_0xef1eae(_0xad9165['error'](0x1f4,_0x3e7b96[_0x4b57('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index d986716..a996f57 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 _0xbc5e=['mailMessage:','./mailMessage.events','save','remove','update','removeListener','length'];(function(_0x544d5c,_0x5197d2){var _0x347a47=function(_0x5d645a){while(--_0x5d645a){_0x544d5c['push'](_0x544d5c['shift']());}};_0x347a47(++_0x5197d2);}(_0xbc5e,0xda));var _0xebc5=function(_0x44a232,_0x1d4edb){_0x44a232=_0x44a232-0x0;var _0x582519=_0xbc5e[_0x44a232];return _0x582519;};'use strict';var MailMessageEvents=require(_0xebc5('0x0'));var events=[_0xebc5('0x1'),_0xebc5('0x2'),_0xebc5('0x3')];function createListener(_0x5a6b82,_0x1238a7){return function(_0x916e8){_0x1238a7['emit'](_0x5a6b82,_0x916e8);};}function removeListener(_0xfdeee0,_0x37c47d){return function(){MailMessageEvents[_0xebc5('0x4')](_0xfdeee0,_0x37c47d);};}exports['register']=function(_0x1d4bf2){for(var _0x34a53a=0x0,_0x4cc601=events[_0xebc5('0x5')];_0x34a53a<_0x4cc601;_0x34a53a++){var _0x5a5990=events[_0x34a53a];var _0x2416da=createListener(_0xebc5('0x6')+_0x5a5990,_0x1d4bf2);MailMessageEvents['on'](_0x5a5990,_0x2416da);}}; \ No newline at end of file +var _0x9b0d=['mailMessage:','./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9b0d,0x139));var _0xd9b0=function(_0x432262,_0x2e6c48){_0x432262=_0x432262-0x0;var _0x152d35=_0x9b0d[_0x432262];return _0x152d35;};'use strict';var MailMessageEvents=require(_0xd9b0('0x0'));var events=[_0xd9b0('0x1'),_0xd9b0('0x2'),_0xd9b0('0x3')];function createListener(_0x14d7bf,_0x241d78){return function(_0x4ba81f){_0x241d78[_0xd9b0('0x4')](_0x14d7bf,_0x4ba81f);};}function removeListener(_0x3768f4,_0x1e3ec4){return function(){MailMessageEvents[_0xd9b0('0x5')](_0x3768f4,_0x1e3ec4);};}exports[_0xd9b0('0x6')]=function(_0x527c72){for(var _0xe201a4=0x0,_0x1efd16=events['length'];_0xe201a4<_0x1efd16;_0xe201a4++){var _0x5c41de=events[_0xe201a4];var _0x3a76bb=createListener(_0xd9b0('0x7')+_0x5c41de,_0x527c72);MailMessageEvents['on'](_0x5c41de,_0x3a76bb);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index a934790..eab387d 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 _0xb86a=['getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x3c0ee3,_0xc2af81){var _0xc41e7=function(_0x23bccd){while(--_0x23bccd){_0x3c0ee3['push'](_0x3c0ee3['shift']());}};_0xc41e7(++_0xc2af81);}(_0xb86a,0x11a));var _0xab86=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xb86a[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xab86('0x0'));var util=require(_0xab86('0x1'));var path=require(_0xab86('0x2'));var timeout=require(_0xab86('0x3'));var express=require(_0xab86('0x4'));var router=express[_0xab86('0x5')]();var fs_extra=require(_0xab86('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xab86('0x7'));var config=require(_0xab86('0x8'));var controller=require('./mailQueue.controller');router[_0xab86('0x9')]('/',auth[_0xab86('0xa')](),controller['index']);router[_0xab86('0x9')](_0xab86('0xb'),auth[_0xab86('0xa')](),controller[_0xab86('0xc')]);router['get'](_0xab86('0xd'),auth[_0xab86('0xa')](),controller[_0xab86('0xe')]);router[_0xab86('0x9')](_0xab86('0xf'),auth[_0xab86('0xa')](),controller[_0xab86('0x10')]);router[_0xab86('0x9')](_0xab86('0x11'),auth[_0xab86('0xa')](),controller[_0xab86('0x12')]);router[_0xab86('0x9')]('/:id/users',auth[_0xab86('0xa')](),controller[_0xab86('0x13')]);router[_0xab86('0x14')]('/',auth[_0xab86('0xa')](),controller['create']);router['post'](_0xab86('0x11'),auth[_0xab86('0xa')](),controller[_0xab86('0x15')]);router[_0xab86('0x14')](_0xab86('0x16'),auth[_0xab86('0xa')](),controller[_0xab86('0x17')]);router[_0xab86('0x18')]('/:id',auth[_0xab86('0xa')](),controller[_0xab86('0x19')]);router[_0xab86('0x1a')](_0xab86('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xab86('0x1a')](_0xab86('0x11'),auth['isAuthenticated'](),controller[_0xab86('0x1b')]);router[_0xab86('0x1a')](_0xab86('0x16'),auth[_0xab86('0xa')](),controller[_0xab86('0x1c')]);module[_0xab86('0x1d')]=router; \ No newline at end of file +var _0xd04f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0xd04f,0x7e));var _0xfd04=function(_0x5b2f92,_0x49efdb){_0x5b2f92=_0x5b2f92-0x0;var _0x134d3c=_0xd04f[_0x5b2f92];return _0x134d3c;};'use strict';var multer=require(_0xfd04('0x0'));var util=require(_0xfd04('0x1'));var path=require('path');var timeout=require(_0xfd04('0x2'));var express=require(_0xfd04('0x3'));var router=express[_0xfd04('0x4')]();var fs_extra=require(_0xfd04('0x5'));var auth=require(_0xfd04('0x6'));var interaction=require(_0xfd04('0x7'));var config=require('../../config/environment');var controller=require(_0xfd04('0x8'));router[_0xfd04('0x9')]('/',auth[_0xfd04('0xa')](),controller[_0xfd04('0xb')]);router[_0xfd04('0x9')](_0xfd04('0xc'),auth[_0xfd04('0xa')](),controller[_0xfd04('0xd')]);router[_0xfd04('0x9')](_0xfd04('0xe'),auth['isAuthenticated'](),controller[_0xfd04('0xf')]);router[_0xfd04('0x9')](_0xfd04('0x10'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x11')]);router[_0xfd04('0x9')](_0xfd04('0x12'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x13')]);router['get'](_0xfd04('0x14'),auth['isAuthenticated'](),controller[_0xfd04('0x15')]);router[_0xfd04('0x16')]('/',auth['isAuthenticated'](),controller[_0xfd04('0x17')]);router[_0xfd04('0x16')](_0xfd04('0x12'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x18')]);router[_0xfd04('0x16')]('/:id/users',auth[_0xfd04('0xa')](),controller[_0xfd04('0x19')]);router[_0xfd04('0x1a')]('/:id',auth[_0xfd04('0xa')](),controller[_0xfd04('0x1b')]);router[_0xfd04('0x1c')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xfd04('0x1c')](_0xfd04('0x12'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x1d')]);router[_0xfd04('0x1c')](_0xfd04('0x14'),auth[_0xfd04('0xa')](),controller[_0xfd04('0x1e')]);module[_0xfd04('0x1f')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index b27279c..03c3a49 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 _0x2dc1=['rrmemory','beepall','sequelize','exports','STRING','INTEGER','ENUM'];(function(_0x27a16c,_0x5965b0){var _0x435335=function(_0x17584f){while(--_0x17584f){_0x27a16c['push'](_0x27a16c['shift']());}};_0x435335(++_0x5965b0);}(_0x2dc1,0x6b));var _0x12dc=function(_0x53c2ff,_0x5bbf5a){_0x53c2ff=_0x53c2ff-0x0;var _0x1dfddd=_0x2dc1[_0x53c2ff];return _0x1dfddd;};'use strict';var Sequelize=require(_0x12dc('0x0'));module[_0x12dc('0x1')]={'name':{'type':Sequelize[_0x12dc('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x12dc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x12dc('0x4')](_0x12dc('0x5'),_0x12dc('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x2f1a=['beepall','roundrobin','sequelize','STRING','INTEGER','ENUM','rrmemory'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x2f1a,0xe9));var _0xa2f1=function(_0x10448d,_0x57a5cd){_0x10448d=_0x10448d-0x0;var _0x4066fc=_0x2f1a[_0x10448d];return _0x4066fc;};'use strict';var Sequelize=require(_0xa2f1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa2f1('0x1')]},'timeout':{'type':Sequelize[_0xa2f1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa2f1('0x3')](_0xa2f1('0x4'),_0xa2f1('0x5'),_0xa2f1('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 048b2d6..88b3908 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 _0x41e8=['then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','rows','catch','show','model','keys','query','filters','intersection','fields','attributes','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserMailQueue','hasOwnProperty','order','sort','pick','MailQueueId','filter','options','UserId','agent','createdAt','%s/%s','SIP','mailPause','updatedAt','getTeams','findOne','Team','nolimit','addTeams','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','tq.TeamId','from','team_has_mail_queues','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','ids','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','userMailQueue:save','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','redis','defaults','socket.io-emitter','./mailQueue.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','update'];(function(_0x394576,_0x5d447b){var _0x3dbf0b=function(_0x5a602a){while(--_0x5a602a){_0x394576['push'](_0x394576['shift']());}};_0x3dbf0b(++_0x5d447b);}(_0x41e8,0x15c));var _0x841e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x41e8[_0x297fd3];return _0x2af381;};'use strict';var BPromise=require(_0x841e('0x0'));var util=require(_0x841e('0x1'));var _=require(_0x841e('0x2'));var squel=require(_0x841e('0x3'));var Redis=require(_0x841e('0x4'));var qs=require(_0x841e('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x841e('0x6'));var db=require('../../mysqldb')['db'];config[_0x841e('0x7')]=_[_0x841e('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x841e('0x9'))(new Redis(config[_0x841e('0x7')]));require(_0x841e('0xa'))[_0x841e('0xb')](socket);function respondWithStatusCode(_0x1410be,_0x4224ec){_0x4224ec=_0x4224ec||0xcc;return function(_0x52ce59){if(_0x52ce59){return _0x1410be['sendStatus'](_0x4224ec);}return _0x1410be[_0x841e('0xc')](_0x4224ec)[_0x841e('0xd')]();};}function respondWithResult(_0x25b1a2,_0x57c072){_0x57c072=_0x57c072||0xc8;return function(_0x59f0d6){if(_0x59f0d6){return _0x25b1a2[_0x841e('0xc')](_0x57c072)['json'](_0x59f0d6);}};}function respondWithFilteredResult(_0x55b2c8,_0xa90021){return function(_0x5dc0c0){if(_0x5dc0c0){var _0xf2e746=typeof _0xa90021[_0x841e('0xe')]===_0x841e('0xf')&&typeof _0xa90021[_0x841e('0x10')]===_0x841e('0xf');var _0x25f52c=_0x5dc0c0[_0x841e('0x11')];var _0x5ae059=_0xf2e746?0x0:_0xa90021['offset'];var _0x4a7c88=_0xf2e746?_0x5dc0c0[_0x841e('0x11')]:_0xa90021[_0x841e('0xe')]+_0xa90021['limit'];var _0x113dd0;if(_0x4a7c88>=_0x25f52c){_0x4a7c88=_0x25f52c;_0x113dd0=0xc8;}else{_0x113dd0=0xce;}_0x55b2c8[_0x841e('0xc')](_0x113dd0);return _0x55b2c8[_0x841e('0x12')](_0x841e('0x13'),_0x5ae059+'-'+_0x4a7c88+'/'+_0x25f52c)['json'](_0x5dc0c0);}return null;};}function saveUpdates(_0x1e43bd){return function(_0x9f3403){if(_0x9f3403){return _0x9f3403[_0x841e('0x14')](_0x1e43bd)[_0x841e('0x15')](function(_0x2b85fa){return _0x2b85fa;});}return null;};}function removeEntity(_0x5b188b){return function(_0xec3317){if(_0xec3317){return _0xec3317[_0x841e('0x16')]()['then'](function(){var _0x34c6a6=_0xec3317[_0x841e('0x17')]({'plain':!![]});var _0x32ec31=_0x841e('0x18');return db[_0x841e('0x19')][_0x841e('0x16')]({'where':{'type':_0x32ec31,'resourceId':_0x34c6a6['id']}})[_0x841e('0x15')](function(){return _0xec3317;});})[_0x841e('0x15')](function(){_0x5b188b[_0x841e('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9aff4){return function(_0x50fc8a){if(!_0x50fc8a){_0x9aff4[_0x841e('0x1a')](0x194);}return _0x50fc8a;};}function handleError(_0x40ad09,_0x46c938){_0x46c938=_0x46c938||0x1f4;return function(_0x8e8459){logger[_0x841e('0x1b')](_0x8e8459[_0x841e('0x1c')]);if(_0x8e8459[_0x841e('0x1d')]){delete _0x8e8459[_0x841e('0x1d')];}_0x40ad09[_0x841e('0xc')](_0x46c938)['send'](_0x8e8459);};}exports[_0x841e('0x1e')]=function(_0x3da6c5,_0x5f1371){var _0x55da2d={};var _0x9ffffc={'count':0x0,'rows':[]};var _0x10b354=_[_0x841e('0x1f')](db[_0x841e('0x20')][_0x841e('0x21')],function(_0x3c55a1){return{'name':_0x3c55a1[_0x841e('0x22')],'type':_0x3c55a1[_0x841e('0x23')][_0x841e('0x24')]};});_0x55da2d=qs[_0x841e('0x25')](_0x10b354,_0x3da6c5);var _0x30a446={'where':_0x55da2d[_0x841e('0x26')]};return db[_0x841e('0x20')]['count'](_0x30a446)['then'](function(_0x495daa){_0x9ffffc[_0x841e('0x11')]=_0x495daa;_0x55da2d[_0x841e('0x27')]=qs[_0x841e('0x27')](_0x3da6c5['query']);return db['MailQueue'][_0x841e('0x28')](_0x55da2d);})[_0x841e('0x15')](function(_0x44a979){_0x9ffffc[_0x841e('0x29')]=_0x44a979;return _0x9ffffc;})[_0x841e('0x15')](respondWithFilteredResult(_0x5f1371,_0x55da2d))[_0x841e('0x2a')](handleError(_0x5f1371,null));};exports[_0x841e('0x2b')]=function(_0x2c4e20,_0x38f9b9){var _0x301442={'raw':!![],'where':{'id':_0x2c4e20['params']['id']}},_0x338766={};_0x338766[_0x841e('0x2c')]=_[_0x841e('0x2d')](db['MailQueue']['rawAttributes']);_0x338766[_0x841e('0x2e')]=_['keys'](_0x2c4e20[_0x841e('0x2e')]);_0x338766[_0x841e('0x2f')]=_[_0x841e('0x30')](_0x338766[_0x841e('0x2c')],_0x338766['query']);_0x301442['attributes']=_[_0x841e('0x30')](_0x338766[_0x841e('0x2c')],qs[_0x841e('0x31')](_0x2c4e20[_0x841e('0x2e')][_0x841e('0x31')]));_0x301442[_0x841e('0x32')]=_0x301442[_0x841e('0x32')][_0x841e('0x33')]?_0x301442[_0x841e('0x32')]:_0x338766[_0x841e('0x2c')];if(_0x2c4e20['query'][_0x841e('0x34')]){_0x301442[_0x841e('0x27')]=[{'all':!![]}];}_0x301442=_[_0x841e('0x35')]({},_0x301442,_0x2c4e20['options']);return db[_0x841e('0x20')][_0x841e('0x36')](_0x301442)[_0x841e('0x15')](handleEntityNotFound(_0x38f9b9,null))[_0x841e('0x15')](respondWithResult(_0x38f9b9,null))[_0x841e('0x2a')](handleError(_0x38f9b9,null));};exports[_0x841e('0x37')]=function(_0x5dd1f4,_0x2f1955){return db[_0x841e('0x20')][_0x841e('0x37')](_0x5dd1f4[_0x841e('0x38')],{})[_0x841e('0x15')](function(_0x27e1d8){var _0x381ea7=_0x5dd1f4[_0x841e('0x39')]['get']({'plain':!![]});if(!_0x381ea7)throw new Error(_0x841e('0x3a'));if(_0x381ea7['role']===_0x841e('0x39')){var _0x44123d=_0x27e1d8[_0x841e('0x17')]({'plain':!![]});var _0x19a0cf='MailQueues';return db[_0x841e('0x3b')][_0x841e('0x36')]({'where':{'name':_0x19a0cf,'userProfileId':_0x381ea7[_0x841e('0x3c')]},'raw':!![]})[_0x841e('0x15')](function(_0x2a2644){if(_0x2a2644&&_0x2a2644[_0x841e('0x3d')]===0x0){return db[_0x841e('0x19')][_0x841e('0x37')]({'name':_0x44123d[_0x841e('0x1d')],'resourceId':_0x44123d['id'],'type':_0x2a2644[_0x841e('0x1d')],'sectionId':_0x2a2644['id']},{})[_0x841e('0x15')](function(){return _0x27e1d8;});}else{return _0x27e1d8;}})[_0x841e('0x2a')](function(_0x359f40){logger[_0x841e('0x1b')](_0x841e('0x3e'),_0x359f40);throw _0x359f40;});}return _0x27e1d8;})[_0x841e('0x15')](respondWithResult(_0x2f1955,0xc9))[_0x841e('0x2a')](handleError(_0x2f1955,null));};exports[_0x841e('0x14')]=function(_0x587bfb,_0xe87ba){if(_0x587bfb[_0x841e('0x38')]['id']){delete _0x587bfb[_0x841e('0x38')]['id'];}return db['MailQueue'][_0x841e('0x36')]({'where':{'id':_0x587bfb['params']['id']}})[_0x841e('0x15')](handleEntityNotFound(_0xe87ba,null))[_0x841e('0x15')](saveUpdates(_0x587bfb[_0x841e('0x38')],null))[_0x841e('0x15')](respondWithResult(_0xe87ba,null))[_0x841e('0x2a')](handleError(_0xe87ba,null));};exports[_0x841e('0x16')]=function(_0x2d1568,_0x5ece00){return db[_0x841e('0x20')][_0x841e('0x36')]({'where':{'id':_0x2d1568[_0x841e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5ece00,null))[_0x841e('0x15')](removeEntity(_0x5ece00,null))[_0x841e('0x2a')](handleError(_0x5ece00,null));};exports[_0x841e('0x40')]=function(_0x381557,_0x2b35f5){return db[_0x841e('0x20')][_0x841e('0x40')]()[_0x841e('0x15')](respondWithResult(_0x2b35f5,null))[_0x841e('0x2a')](handleError(_0x2b35f5,null));};exports['getMembers']=function(_0x52184d,_0x48317c){var _0x17d9b6={'raw':!![],'where':{}},_0x5ed348={},_0x4046c0;return db[_0x841e('0x20')]['findOne']({'where':{'id':_0x52184d[_0x841e('0x3f')]['id']}})[_0x841e('0x15')](handleEntityNotFound(_0x48317c,null))['then'](function(_0x2d9b24){if(_0x2d9b24){_0x4046c0=_0x2d9b24[_0x841e('0x17')]({'plain':!![]});_0x5ed348['model']=_[_0x841e('0x2d')](db[_0x841e('0x41')]['rawAttributes']);_0x5ed348[_0x841e('0x2e')]=_['keys'](_0x52184d[_0x841e('0x2e')]);_0x5ed348[_0x841e('0x2f')]=_['intersection'](_0x5ed348[_0x841e('0x2c')],_0x5ed348[_0x841e('0x2e')]);_0x17d9b6[_0x841e('0x32')]=_[_0x841e('0x30')](_0x5ed348[_0x841e('0x2c')],qs[_0x841e('0x31')](_0x52184d[_0x841e('0x2e')][_0x841e('0x31')]));_0x17d9b6[_0x841e('0x32')]=_0x17d9b6[_0x841e('0x32')][_0x841e('0x33')]?_0x17d9b6['attributes']:_0x5ed348[_0x841e('0x2c')];if(!_0x52184d['query'][_0x841e('0x42')]('nolimit')){_0x17d9b6[_0x841e('0x10')]=qs[_0x841e('0x10')](_0x52184d[_0x841e('0x2e')][_0x841e('0x10')]);_0x17d9b6[_0x841e('0xe')]=qs[_0x841e('0xe')](_0x52184d['query'][_0x841e('0xe')]);}_0x17d9b6[_0x841e('0x43')]=qs[_0x841e('0x44')](_0x52184d[_0x841e('0x2e')][_0x841e('0x44')]);_0x17d9b6[_0x841e('0x26')]=qs[_0x841e('0x2f')](_[_0x841e('0x45')](_0x52184d[_0x841e('0x2e')],_0x5ed348['filters']));_0x17d9b6[_0x841e('0x26')][_0x841e('0x46')]=_0x2d9b24['id'];if(_0x52184d[_0x841e('0x2e')][_0x841e('0x47')]){_0x17d9b6[_0x841e('0x26')]=_['merge'](_0x17d9b6[_0x841e('0x26')],{'$or':_[_0x841e('0x1f')](_0x17d9b6[_0x841e('0x32')],function(_0x1a52a1){var _0x4965c8={};_0x4965c8[_0x1a52a1]={'$like':'%'+_0x52184d[_0x841e('0x2e')]['filter']+'%'};return _0x4965c8;})});}_0x17d9b6=_[_0x841e('0x35')]({},_0x17d9b6,_0x52184d[_0x841e('0x48')]);return db[_0x841e('0x41')][_0x841e('0x28')](_0x17d9b6);}})[_0x841e('0x15')](function(_0x42fd44){if(_0x42fd44){return db['User']['findAndCountAll']({'where':{'id':_[_0x841e('0x1f')](_0x42fd44,_0x841e('0x49')),'role':_0x841e('0x4a')},'attributes':['id',_0x841e('0x1d'),'mailPause','updatedAt',_0x841e('0x4b')]});}})[_0x841e('0x15')](function(_0x24a68f){if(_0x24a68f){return{'count':_0x24a68f[_0x841e('0x11')],'rows':_[_0x841e('0x1f')](_0x24a68f['rows'],function(_0x2a9ea8){return{'membername':_0x2a9ea8['name'],'UserId':_0x2a9ea8['id'],'queue_name':_0x4046c0[_0x841e('0x1d')],'MailQueueId':_0x4046c0['id'],'interface':util['format'](_0x841e('0x4c'),_0x841e('0x4d'),_0x2a9ea8[_0x841e('0x1d')]),'penalty':0x0,'paused':_0x2a9ea8[_0x841e('0x4e')],'createdAt':_0x2a9ea8[_0x841e('0x4b')],'updatedAt':_0x2a9ea8[_0x841e('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x841e('0x15')](respondWithFilteredResult(_0x48317c,_0x17d9b6))[_0x841e('0x2a')](handleError(_0x48317c,null));};exports[_0x841e('0x50')]=function(_0x108920,_0x365ecb){var _0x2873b0={};var _0x5953c2={};var _0x580204;var _0x3c76dc;return db['MailQueue'][_0x841e('0x51')]({'where':{'id':_0x108920['params']['id']}})[_0x841e('0x15')](handleEntityNotFound(_0x365ecb,null))[_0x841e('0x15')](function(_0xd43fff){if(_0xd43fff){_0x580204=_0xd43fff;_0x5953c2['model']=_['keys'](db[_0x841e('0x52')][_0x841e('0x21')]);_0x5953c2[_0x841e('0x2e')]=_[_0x841e('0x2d')](_0x108920[_0x841e('0x2e')]);_0x5953c2['filters']=_[_0x841e('0x30')](_0x5953c2[_0x841e('0x2c')],_0x5953c2[_0x841e('0x2e')]);_0x2873b0[_0x841e('0x32')]=_['intersection'](_0x5953c2[_0x841e('0x2c')],qs[_0x841e('0x31')](_0x108920[_0x841e('0x2e')][_0x841e('0x31')]));_0x2873b0['attributes']=_0x2873b0['attributes'][_0x841e('0x33')]?_0x2873b0[_0x841e('0x32')]:_0x5953c2['model'];_0x2873b0[_0x841e('0x43')]=qs[_0x841e('0x44')](_0x108920[_0x841e('0x2e')][_0x841e('0x44')]);_0x2873b0[_0x841e('0x26')]=qs[_0x841e('0x2f')](_['pick'](_0x108920[_0x841e('0x2e')],_0x5953c2[_0x841e('0x2f')]));if(_0x108920[_0x841e('0x2e')][_0x841e('0x47')]){_0x2873b0[_0x841e('0x26')]=_[_0x841e('0x35')](_0x2873b0[_0x841e('0x26')],{'$or':_[_0x841e('0x1f')](_0x2873b0['attributes'],function(_0x342da4){var _0x8f4018={};_0x8f4018[_0x342da4]={'$like':'%'+_0x108920[_0x841e('0x2e')][_0x841e('0x47')]+'%'};return _0x8f4018;})});}_0x2873b0=_['merge']({},_0x2873b0,_0x108920[_0x841e('0x48')]);return _0x580204[_0x841e('0x50')](_0x2873b0);}})[_0x841e('0x15')](function(_0x5054c1){if(_0x5054c1){_0x3c76dc=_0x5054c1[_0x841e('0x33')];if(!_0x108920[_0x841e('0x2e')][_0x841e('0x42')](_0x841e('0x53'))){_0x2873b0[_0x841e('0x10')]=qs['limit'](_0x108920[_0x841e('0x2e')][_0x841e('0x10')]);_0x2873b0['offset']=qs[_0x841e('0xe')](_0x108920[_0x841e('0x2e')][_0x841e('0xe')]);}return _0x580204[_0x841e('0x50')](_0x2873b0);}})[_0x841e('0x15')](function(_0x3ad9a9){if(_0x3ad9a9){return _0x3ad9a9?{'count':_0x3c76dc,'rows':_0x3ad9a9}:null;}})[_0x841e('0x15')](respondWithResult(_0x365ecb,null))[_0x841e('0x2a')](handleError(_0x365ecb,null));};exports[_0x841e('0x54')]=function(_0x42097f,_0x5bc732){var _0x232e1b=_0x42097f[_0x841e('0x38')]['ids'];return db[_0x841e('0x52')][_0x841e('0x28')]({'where':{'id':_0x232e1b},'attributes':['id'],'include':[{'model':db[_0x841e('0x55')],'as':_0x841e('0x56'),'attributes':['id',_0x841e('0x1d'),_0x841e('0x57'),_0x841e('0x58'),'interface'],'raw':!![]}]})[_0x841e('0x15')](function(_0xe8e548){if(_0xe8e548){var _0x3d55bf=_[_0x841e('0x59')](_0xe8e548,function(_0x12159f){var _0x5c35cf=_0x12159f[_0x841e('0x17')]({'plain':!![]});return _0x5c35cf[_0x841e('0x56')];});return db[_0x841e('0x20')][_0x841e('0x36')]({'where':{'id':_0x42097f[_0x841e('0x3f')]['id']}})[_0x841e('0x15')](function(_0x5310b0){return db[_0x841e('0x5a')][_0x841e('0x5b')](function(_0x5ee4e4){return _0x5310b0[_0x841e('0x54')](_0x232e1b,{'transaction':_0x5ee4e4})[_0x841e('0x15')](function(){return BPromise[_0x841e('0x5c')](_0x3d55bf,function(_0x290da3){return db[_0x841e('0x41')][_0x841e('0x5d')]({'where':{'UserId':_0x290da3['id'],'MailQueueId':_0x42097f[_0x841e('0x3f')]['id']},'transaction':_0x5ee4e4});});})[_0x841e('0x15')](function(){_0x3d55bf['forEach'](function(_0x306563){socket[_0x841e('0x5e')]('userMailQueue:save',{'UserId':_0x306563['id'],'MailQueueId':_0x5310b0['id']});});});});});}})[_0x841e('0x15')](respondWithStatusCode(_0x5bc732,null))[_0x841e('0x2a')](handleError(_0x5bc732,null));};exports[_0x841e('0x5f')]=function(_0xabc068,_0x9f1eba){return db[_0x841e('0x52')][_0x841e('0x28')]({'where':{'id':_0xabc068['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x841e('0x55')],'as':_0x841e('0x56'),'attributes':['id'],'raw':!![]}]})[_0x841e('0x15')](handleEntityNotFound(_0x9f1eba,null))[_0x841e('0x15')](function(_0x41c3dd){var _0x510d55=_[_0x841e('0x1f')](_0x41c3dd,'id');var _0x73944f=[];var _0x23504e=[];var _0x3bf29b=squel[_0x841e('0x60')]();_0x3bf29b['field'](_0x841e('0x61'))[_0x841e('0x62')](_0x841e('0x63'),'tq')['join'](_0x841e('0x64'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x841e('0x65'),_0xabc068[_0x841e('0x3f')]['id']);for(var _0x5dc64f=0x0;_0x5dc64f<_0x41c3dd[_0x841e('0x33')];_0x5dc64f+=0x1){let _0x2c0c2e=_0x41c3dd[_0x5dc64f];for(var _0x297883=0x0;_0x297883<_0x2c0c2e[_0x841e('0x56')][_0x841e('0x33')];_0x297883+=0x1){let _0x5bfb86=_0x2c0c2e['Agents'][_0x297883];var _0x30f8d5=_0x3bf29b[_0x841e('0x66')]();_0x30f8d5['where'](_0x841e('0x67'),_0x5bfb86['id']);_0x23504e[_0x841e('0x68')](db['sequelize']['query'](_0x30f8d5[_0x841e('0x69')](),{'type':db[_0x841e('0x5a')][_0x841e('0x6a')][_0x841e('0x6b')]})['then'](function(_0x1cc70e){if(_0x1cc70e[_0x841e('0x33')]===0x1){return _0x5bfb86['id'];}else{var _0x10095d=_['every'](_['map'](_0x1cc70e,_0x841e('0x6c')),function(_0xa1388d){return _[_0x841e('0x6d')](_0x510d55,_0xa1388d);});if(_0x10095d){return _0x5bfb86['id'];}}}));}}return BPromise['all'](_0x23504e)['then'](function(_0x1e0dcb){_0x73944f=_(_0x73944f)[_0x841e('0x6e')](_0x1e0dcb)[_0x841e('0x6f')]()[_0x841e('0x70')]();return db[_0x841e('0x20')][_0x841e('0x36')]({'where':{'id':_0xabc068['params']['id']}})[_0x841e('0x15')](function(_0xf9c353){return db[_0x841e('0x5a')]['transaction'](function(_0x54b855){return _0xf9c353[_0x841e('0x5f')](_0xabc068[_0x841e('0x2e')][_0x841e('0x71')],{'transaction':_0x54b855})[_0x841e('0x15')](function(){if(!_[_0x841e('0x72')](_0x73944f)){return _0xf9c353[_0x841e('0x73')](_0x73944f,{'transaction':_0x54b855});}})[_0x841e('0x15')](function(){_0x73944f[_0x841e('0x74')](function(_0x23cfbb){socket[_0x841e('0x5e')](_0x841e('0x75'),{'UserId':_0x23cfbb,'MailQueueId':_0xf9c353['id']});});});});});});})[_0x841e('0x15')](respondWithStatusCode(_0x9f1eba,null))[_0x841e('0x2a')](handleError(_0x9f1eba,null));};exports[_0x841e('0x76')]=function(_0x520ab3,_0x50e94c){return db[_0x841e('0x20')][_0x841e('0x36')]({'where':{'id':_0x520ab3[_0x841e('0x3f')]['id']}})[_0x841e('0x15')](handleEntityNotFound(_0x50e94c,null))['then'](function(_0x515632){if(_0x515632){return _0x515632[_0x841e('0x76')](_0x520ab3[_0x841e('0x38')][_0x841e('0x71')],_[_0x841e('0x77')](_0x520ab3[_0x841e('0x38')],['ids','id'])||{})['spread'](function(_0x2cc750){for(var _0x5f1ddd=0x0;_0x5f1ddd<_0x520ab3['body']['ids']['length'];_0x5f1ddd+=0x1){socket[_0x841e('0x5e')](_0x841e('0x78'),{'UserId':Number(_0x520ab3[_0x841e('0x38')][_0x841e('0x71')][_0x5f1ddd]),'MailQueueId':Number(_0x520ab3['params']['id'])});}return _0x2cc750;});}})[_0x841e('0x15')](respondWithResult(_0x50e94c,null))[_0x841e('0x2a')](handleError(_0x50e94c,null));};exports[_0x841e('0x73')]=function(_0x463f10,_0x3b7121){return db[_0x841e('0x20')][_0x841e('0x36')]({'where':{'id':_0x463f10[_0x841e('0x3f')]['id']}})[_0x841e('0x15')](handleEntityNotFound(_0x3b7121,null))[_0x841e('0x15')](function(_0x515349){if(_0x515349){return _0x515349[_0x841e('0x73')](_0x463f10[_0x841e('0x2e')]['ids'])['then'](function(){if(_[_0x841e('0x79')](_0x463f10[_0x841e('0x2e')][_0x841e('0x71')])){for(var _0x497b07=0x0;_0x497b07<_0x463f10[_0x841e('0x2e')][_0x841e('0x71')][_0x841e('0x33')];_0x497b07+=0x1){socket[_0x841e('0x5e')]('userMailQueue:remove',{'UserId':Number(_0x463f10[_0x841e('0x2e')][_0x841e('0x71')][_0x497b07]),'MailQueueId':Number(_0x463f10['params']['id'])});}}else{socket[_0x841e('0x5e')](_0x841e('0x75'),{'UserId':Number(_0x463f10[_0x841e('0x2e')][_0x841e('0x71')]),'MailQueueId':Number(_0x463f10['params']['id'])});}});}})[_0x841e('0x15')](respondWithStatusCode(_0x3b7121,null))[_0x841e('0x2a')](handleError(_0x3b7121,null));};exports[_0x841e('0x7a')]=function(_0x803f9c,_0x45b423){var _0x538a1f={};var _0x1c85bc={};var _0x6ec0d0;var _0x6504b7;return db['MailQueue']['findOne']({'where':{'id':_0x803f9c[_0x841e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x45b423,null))[_0x841e('0x15')](function(_0x351493){if(_0x351493){_0x6ec0d0=_0x351493;_0x1c85bc[_0x841e('0x2c')]=_[_0x841e('0x2d')](db[_0x841e('0x55')][_0x841e('0x21')]);_0x1c85bc['query']=_['keys'](_0x803f9c[_0x841e('0x2e')]);_0x1c85bc[_0x841e('0x2f')]=_[_0x841e('0x30')](_0x1c85bc[_0x841e('0x2c')],_0x1c85bc[_0x841e('0x2e')]);_0x538a1f['attributes']=_[_0x841e('0x30')](_0x1c85bc['model'],qs[_0x841e('0x31')](_0x803f9c['query']['fields']));_0x538a1f[_0x841e('0x32')]=_0x538a1f[_0x841e('0x32')][_0x841e('0x33')]?_0x538a1f['attributes']:_0x1c85bc['model'];_0x538a1f[_0x841e('0x43')]=qs[_0x841e('0x44')](_0x803f9c['query'][_0x841e('0x44')]);_0x538a1f[_0x841e('0x26')]=qs[_0x841e('0x2f')](_[_0x841e('0x45')](_0x803f9c[_0x841e('0x2e')],_0x1c85bc[_0x841e('0x2f')]));if(_0x803f9c[_0x841e('0x2e')]['filter']){_0x538a1f[_0x841e('0x26')]=_[_0x841e('0x35')](_0x538a1f[_0x841e('0x26')],{'$or':_[_0x841e('0x1f')](_0x538a1f[_0x841e('0x32')],function(_0xd35ba7){var _0x240813={};_0x240813[_0xd35ba7]={'$like':'%'+_0x803f9c['query'][_0x841e('0x47')]+'%'};return _0x240813;})});}_0x538a1f=_[_0x841e('0x35')]({},_0x538a1f,_0x803f9c['options']);return _0x6ec0d0[_0x841e('0x7a')](_0x538a1f);}})[_0x841e('0x15')](function(_0x39e5a4){if(_0x39e5a4){_0x6504b7=_0x39e5a4[_0x841e('0x33')];if(!_0x803f9c[_0x841e('0x2e')][_0x841e('0x42')](_0x841e('0x53'))){_0x538a1f[_0x841e('0x10')]=qs[_0x841e('0x10')](_0x803f9c[_0x841e('0x2e')][_0x841e('0x10')]);_0x538a1f[_0x841e('0xe')]=qs[_0x841e('0xe')](_0x803f9c[_0x841e('0x2e')][_0x841e('0xe')]);}return _0x6ec0d0['getAgents'](_0x538a1f);}})['then'](function(_0x3b6e96){if(_0x3b6e96){return _0x3b6e96?{'count':_0x6504b7,'rows':_0x3b6e96}:null;}})[_0x841e('0x15')](respondWithResult(_0x45b423,null))['catch'](handleError(_0x45b423,null));}; \ No newline at end of file +var _0x67f0=['role','get','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','keys','UserMailQueue','nolimit','order','sort','pick','MailQueueId','filter','findAndCountAll','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','MailQueues','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','where','MailQueue','include','query','findAll','rows','show','params','model','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0x67f0,0x136));var _0x067f=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x67f0[_0x5ecadc];return _0x565037;};'use strict';var BPromise=require(_0x067f('0x0'));var util=require(_0x067f('0x1'));var _=require(_0x067f('0x2'));var squel=require(_0x067f('0x3'));var Redis=require('ioredis');var qs=require(_0x067f('0x4'));var logger=require(_0x067f('0x5'))(_0x067f('0x6'));var config=require(_0x067f('0x7'));var db=require(_0x067f('0x8'))['db'];config[_0x067f('0x9')]=_['defaults'](config[_0x067f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x067f('0xa'))(new Redis(config[_0x067f('0x9')]));require('./mailQueue.socket')[_0x067f('0xb')](socket);function respondWithStatusCode(_0x11e136,_0x42cf70){_0x42cf70=_0x42cf70||0xcc;return function(_0x418a71){if(_0x418a71){return _0x11e136[_0x067f('0xc')](_0x42cf70);}return _0x11e136['status'](_0x42cf70)[_0x067f('0xd')]();};}function respondWithResult(_0x2a47a5,_0x3c462a){_0x3c462a=_0x3c462a||0xc8;return function(_0x554364){if(_0x554364){return _0x2a47a5[_0x067f('0xe')](_0x3c462a)[_0x067f('0xf')](_0x554364);}};}function respondWithFilteredResult(_0x3b4049,_0xaed4d1){return function(_0x2506bb){if(_0x2506bb){var _0x3ede5c=typeof _0xaed4d1['offset']===_0x067f('0x10')&&typeof _0xaed4d1[_0x067f('0x11')]==='undefined';var _0x3b6941=_0x2506bb[_0x067f('0x12')];var _0x37157c=_0x3ede5c?0x0:_0xaed4d1[_0x067f('0x13')];var _0x5e1bc0=_0x3ede5c?_0x2506bb[_0x067f('0x12')]:_0xaed4d1[_0x067f('0x13')]+_0xaed4d1[_0x067f('0x11')];var _0x5ce18f;if(_0x5e1bc0>=_0x3b6941){_0x5e1bc0=_0x3b6941;_0x5ce18f=0xc8;}else{_0x5ce18f=0xce;}_0x3b4049['status'](_0x5ce18f);return _0x3b4049[_0x067f('0x14')](_0x067f('0x15'),_0x37157c+'-'+_0x5e1bc0+'/'+_0x3b6941)[_0x067f('0xf')](_0x2506bb);}return null;};}function saveUpdates(_0xe9240){return function(_0x48a6b7){if(_0x48a6b7){return _0x48a6b7[_0x067f('0x16')](_0xe9240)[_0x067f('0x17')](function(_0x52fb58){return _0x52fb58;});}return null;};}function removeEntity(_0x287df5){return function(_0x462f8b){if(_0x462f8b){return _0x462f8b[_0x067f('0x18')]()[_0x067f('0x17')](function(){var _0x274dba=_0x462f8b['get']({'plain':!![]});var _0x23d665=_0x067f('0x19');return db[_0x067f('0x1a')][_0x067f('0x18')]({'where':{'type':_0x23d665,'resourceId':_0x274dba['id']}})[_0x067f('0x17')](function(){return _0x462f8b;});})[_0x067f('0x17')](function(){_0x287df5['status'](0xcc)[_0x067f('0xd')]();});}};}function handleEntityNotFound(_0x4d9417){return function(_0x1b136c){if(!_0x1b136c){_0x4d9417['sendStatus'](0x194);}return _0x1b136c;};}function handleError(_0x2a40c4,_0x23b04a){_0x23b04a=_0x23b04a||0x1f4;return function(_0x26a37c){logger[_0x067f('0x1b')](_0x26a37c['stack']);if(_0x26a37c[_0x067f('0x1c')]){delete _0x26a37c[_0x067f('0x1c')];}_0x2a40c4['status'](_0x23b04a)[_0x067f('0x1d')](_0x26a37c);};}exports['index']=function(_0x3a884c,_0x2aa122){var _0x151e0b={};var _0x3c62ab={'count':0x0,'rows':[]};var _0x1e3b6c=_[_0x067f('0x1e')](db['MailQueue'][_0x067f('0x1f')],function(_0x130d48){return{'name':_0x130d48[_0x067f('0x20')],'type':_0x130d48[_0x067f('0x21')]['key']};});_0x151e0b=qs['getOptions'](_0x1e3b6c,_0x3a884c);var _0x9726f7={'where':_0x151e0b[_0x067f('0x22')]};return db[_0x067f('0x23')][_0x067f('0x12')](_0x9726f7)[_0x067f('0x17')](function(_0x5497de){_0x3c62ab[_0x067f('0x12')]=_0x5497de;_0x151e0b[_0x067f('0x24')]=qs['include'](_0x3a884c[_0x067f('0x25')]);return db[_0x067f('0x23')][_0x067f('0x26')](_0x151e0b);})[_0x067f('0x17')](function(_0x13ca2b){_0x3c62ab[_0x067f('0x27')]=_0x13ca2b;return _0x3c62ab;})['then'](respondWithFilteredResult(_0x2aa122,_0x151e0b))['catch'](handleError(_0x2aa122,null));};exports[_0x067f('0x28')]=function(_0x59be6,_0x5a7c56){var _0x550024={'raw':!![],'where':{'id':_0x59be6[_0x067f('0x29')]['id']}},_0x3da6f8={};_0x3da6f8[_0x067f('0x2a')]=_['keys'](db[_0x067f('0x23')]['rawAttributes']);_0x3da6f8[_0x067f('0x25')]=_['keys'](_0x59be6['query']);_0x3da6f8[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x3da6f8[_0x067f('0x2a')],_0x3da6f8['query']);_0x550024['attributes']=_[_0x067f('0x2c')](_0x3da6f8['model'],qs[_0x067f('0x2d')](_0x59be6['query'][_0x067f('0x2d')]));_0x550024[_0x067f('0x2e')]=_0x550024['attributes'][_0x067f('0x2f')]?_0x550024[_0x067f('0x2e')]:_0x3da6f8[_0x067f('0x2a')];if(_0x59be6[_0x067f('0x25')][_0x067f('0x30')]){_0x550024[_0x067f('0x24')]=[{'all':!![]}];}_0x550024=_[_0x067f('0x31')]({},_0x550024,_0x59be6[_0x067f('0x32')]);return db[_0x067f('0x23')][_0x067f('0x33')](_0x550024)[_0x067f('0x17')](handleEntityNotFound(_0x5a7c56,null))[_0x067f('0x17')](respondWithResult(_0x5a7c56,null))['catch'](handleError(_0x5a7c56,null));};exports['create']=function(_0x373ce8,_0x1fda37){return db[_0x067f('0x23')][_0x067f('0x34')](_0x373ce8[_0x067f('0x35')],{})['then'](function(_0x32b884){var _0x4c059e=_0x373ce8[_0x067f('0x36')]['get']({'plain':!![]});if(!_0x4c059e)throw new Error(_0x067f('0x37'));if(_0x4c059e[_0x067f('0x38')]==='user'){var _0x92da89=_0x32b884[_0x067f('0x39')]({'plain':!![]});var _0x4ae522='MailQueues';return db['UserProfileSection'][_0x067f('0x33')]({'where':{'name':_0x4ae522,'userProfileId':_0x4c059e[_0x067f('0x3a')]},'raw':!![]})[_0x067f('0x17')](function(_0x4dfc0f){if(_0x4dfc0f&&_0x4dfc0f[_0x067f('0x3b')]===0x0){return db[_0x067f('0x1a')][_0x067f('0x34')]({'name':_0x92da89[_0x067f('0x1c')],'resourceId':_0x92da89['id'],'type':_0x4dfc0f[_0x067f('0x1c')],'sectionId':_0x4dfc0f['id']},{})[_0x067f('0x17')](function(){return _0x32b884;});}else{return _0x32b884;}})[_0x067f('0x3c')](function(_0x1fe2a0){logger[_0x067f('0x1b')](_0x067f('0x3d'),_0x1fe2a0);throw _0x1fe2a0;});}return _0x32b884;})['then'](respondWithResult(_0x1fda37,0xc9))[_0x067f('0x3c')](handleError(_0x1fda37,null));};exports[_0x067f('0x16')]=function(_0x2848e2,_0x2499ca){if(_0x2848e2[_0x067f('0x35')]['id']){delete _0x2848e2[_0x067f('0x35')]['id'];}return db['MailQueue'][_0x067f('0x33')]({'where':{'id':_0x2848e2['params']['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x2499ca,null))[_0x067f('0x17')](saveUpdates(_0x2848e2[_0x067f('0x35')],null))[_0x067f('0x17')](respondWithResult(_0x2499ca,null))['catch'](handleError(_0x2499ca,null));};exports[_0x067f('0x18')]=function(_0x4e6a65,_0x5b640e){return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x4e6a65[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x5b640e,null))[_0x067f('0x17')](removeEntity(_0x5b640e,null))['catch'](handleError(_0x5b640e,null));};exports[_0x067f('0x3e')]=function(_0x82a100,_0x5eb2df){return db[_0x067f('0x23')]['describe']()['then'](respondWithResult(_0x5eb2df,null))[_0x067f('0x3c')](handleError(_0x5eb2df,null));};exports['getMembers']=function(_0x2d973a,_0x31d130){var _0xdd94b7={'raw':!![],'where':{}},_0x2e75b6={},_0x1547ae;return db[_0x067f('0x23')][_0x067f('0x3f')]({'where':{'id':_0x2d973a['params']['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x31d130,null))[_0x067f('0x17')](function(_0x45efca){if(_0x45efca){_0x1547ae=_0x45efca[_0x067f('0x39')]({'plain':!![]});_0x2e75b6[_0x067f('0x2a')]=_[_0x067f('0x40')](db[_0x067f('0x41')][_0x067f('0x1f')]);_0x2e75b6[_0x067f('0x25')]=_['keys'](_0x2d973a['query']);_0x2e75b6[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x2e75b6[_0x067f('0x2a')],_0x2e75b6[_0x067f('0x25')]);_0xdd94b7[_0x067f('0x2e')]=_[_0x067f('0x2c')](_0x2e75b6[_0x067f('0x2a')],qs['fields'](_0x2d973a[_0x067f('0x25')]['fields']));_0xdd94b7[_0x067f('0x2e')]=_0xdd94b7[_0x067f('0x2e')]['length']?_0xdd94b7[_0x067f('0x2e')]:_0x2e75b6[_0x067f('0x2a')];if(!_0x2d973a[_0x067f('0x25')]['hasOwnProperty'](_0x067f('0x42'))){_0xdd94b7['limit']=qs[_0x067f('0x11')](_0x2d973a[_0x067f('0x25')][_0x067f('0x11')]);_0xdd94b7[_0x067f('0x13')]=qs[_0x067f('0x13')](_0x2d973a[_0x067f('0x25')]['offset']);}_0xdd94b7[_0x067f('0x43')]=qs['sort'](_0x2d973a[_0x067f('0x25')][_0x067f('0x44')]);_0xdd94b7['where']=qs[_0x067f('0x2b')](_[_0x067f('0x45')](_0x2d973a['query'],_0x2e75b6[_0x067f('0x2b')]));_0xdd94b7['where'][_0x067f('0x46')]=_0x45efca['id'];if(_0x2d973a[_0x067f('0x25')][_0x067f('0x47')]){_0xdd94b7[_0x067f('0x22')]=_[_0x067f('0x31')](_0xdd94b7[_0x067f('0x22')],{'$or':_[_0x067f('0x1e')](_0xdd94b7['attributes'],function(_0x3d7c65){var _0x25b980={};_0x25b980[_0x3d7c65]={'$like':'%'+_0x2d973a[_0x067f('0x25')]['filter']+'%'};return _0x25b980;})});}_0xdd94b7=_['merge']({},_0xdd94b7,_0x2d973a[_0x067f('0x32')]);return db[_0x067f('0x41')][_0x067f('0x26')](_0xdd94b7);}})[_0x067f('0x17')](function(_0xe94eb7){if(_0xe94eb7){return db['User'][_0x067f('0x48')]({'where':{'id':_[_0x067f('0x1e')](_0xe94eb7,'UserId'),'role':_0x067f('0x49')},'attributes':['id','name',_0x067f('0x4a'),_0x067f('0x4b'),_0x067f('0x4c')]});}})['then'](function(_0x58460d){if(_0x58460d){return{'count':_0x58460d[_0x067f('0x12')],'rows':_['map'](_0x58460d[_0x067f('0x27')],function(_0x4c0c07){return{'membername':_0x4c0c07[_0x067f('0x1c')],'UserId':_0x4c0c07['id'],'queue_name':_0x1547ae[_0x067f('0x1c')],'MailQueueId':_0x1547ae['id'],'interface':util['format'](_0x067f('0x4d'),_0x067f('0x4e'),_0x4c0c07['name']),'penalty':0x0,'paused':_0x4c0c07[_0x067f('0x4a')],'createdAt':_0x4c0c07[_0x067f('0x4c')],'updatedAt':_0x4c0c07[_0x067f('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x067f('0x17')](respondWithFilteredResult(_0x31d130,_0xdd94b7))[_0x067f('0x3c')](handleError(_0x31d130,null));};exports[_0x067f('0x4f')]=function(_0x149a89,_0x33807f){var _0x5edc4b={};var _0x5d9848={};var _0x22e49f;var _0x51d8b7;return db['MailQueue']['findOne']({'where':{'id':_0x149a89[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x33807f,null))[_0x067f('0x17')](function(_0x575938){if(_0x575938){_0x22e49f=_0x575938;_0x5d9848[_0x067f('0x2a')]=_[_0x067f('0x40')](db[_0x067f('0x50')]['rawAttributes']);_0x5d9848['query']=_[_0x067f('0x40')](_0x149a89[_0x067f('0x25')]);_0x5d9848[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x5d9848[_0x067f('0x2a')],_0x5d9848[_0x067f('0x25')]);_0x5edc4b['attributes']=_[_0x067f('0x2c')](_0x5d9848[_0x067f('0x2a')],qs['fields'](_0x149a89[_0x067f('0x25')]['fields']));_0x5edc4b['attributes']=_0x5edc4b[_0x067f('0x2e')][_0x067f('0x2f')]?_0x5edc4b[_0x067f('0x2e')]:_0x5d9848[_0x067f('0x2a')];_0x5edc4b[_0x067f('0x43')]=qs[_0x067f('0x44')](_0x149a89[_0x067f('0x25')][_0x067f('0x44')]);_0x5edc4b[_0x067f('0x22')]=qs[_0x067f('0x2b')](_[_0x067f('0x45')](_0x149a89['query'],_0x5d9848['filters']));if(_0x149a89[_0x067f('0x25')]['filter']){_0x5edc4b[_0x067f('0x22')]=_[_0x067f('0x31')](_0x5edc4b['where'],{'$or':_[_0x067f('0x1e')](_0x5edc4b['attributes'],function(_0x332c5e){var _0x589180={};_0x589180[_0x332c5e]={'$like':'%'+_0x149a89[_0x067f('0x25')][_0x067f('0x47')]+'%'};return _0x589180;})});}_0x5edc4b=_['merge']({},_0x5edc4b,_0x149a89[_0x067f('0x32')]);return _0x22e49f[_0x067f('0x4f')](_0x5edc4b);}})[_0x067f('0x17')](function(_0x14918a){if(_0x14918a){_0x51d8b7=_0x14918a[_0x067f('0x2f')];if(!_0x149a89[_0x067f('0x25')][_0x067f('0x51')](_0x067f('0x42'))){_0x5edc4b[_0x067f('0x11')]=qs[_0x067f('0x11')](_0x149a89['query'][_0x067f('0x11')]);_0x5edc4b[_0x067f('0x13')]=qs[_0x067f('0x13')](_0x149a89['query'][_0x067f('0x13')]);}return _0x22e49f[_0x067f('0x4f')](_0x5edc4b);}})['then'](function(_0x5c8f9d){if(_0x5c8f9d){return _0x5c8f9d?{'count':_0x51d8b7,'rows':_0x5c8f9d}:null;}})[_0x067f('0x17')](respondWithResult(_0x33807f,null))[_0x067f('0x3c')](handleError(_0x33807f,null));};exports[_0x067f('0x52')]=function(_0x57f8db,_0x1e3c65){var _0x55e577=_0x57f8db[_0x067f('0x35')][_0x067f('0x53')];return db[_0x067f('0x50')]['findAll']({'where':{'id':_0x55e577},'attributes':['id'],'include':[{'model':db[_0x067f('0x54')],'as':_0x067f('0x55'),'attributes':['id',_0x067f('0x1c'),_0x067f('0x56'),_0x067f('0x57'),_0x067f('0x58')],'raw':!![]}]})[_0x067f('0x17')](function(_0xe5f8da){if(_0xe5f8da){var _0x376d2d=_[_0x067f('0x59')](_0xe5f8da,function(_0x481338){var _0x1f45bc=_0x481338[_0x067f('0x39')]({'plain':!![]});return _0x1f45bc[_0x067f('0x55')];});return db[_0x067f('0x23')]['find']({'where':{'id':_0x57f8db[_0x067f('0x29')]['id']}})[_0x067f('0x17')](function(_0x2226dc){return db[_0x067f('0x5a')]['transaction'](function(_0x179854){return _0x2226dc['addTeams'](_0x55e577,{'transaction':_0x179854})[_0x067f('0x17')](function(){return BPromise[_0x067f('0x5b')](_0x376d2d,function(_0x30fff9){return db[_0x067f('0x41')][_0x067f('0x5c')]({'where':{'UserId':_0x30fff9['id'],'MailQueueId':_0x57f8db[_0x067f('0x29')]['id']},'transaction':_0x179854});});})[_0x067f('0x17')](function(){_0x376d2d[_0x067f('0x5d')](function(_0x5982a1){socket[_0x067f('0x5e')]('userMailQueue:save',{'UserId':_0x5982a1['id'],'MailQueueId':_0x2226dc['id']});});});});});}})[_0x067f('0x17')](respondWithStatusCode(_0x1e3c65,null))['catch'](handleError(_0x1e3c65,null));};exports[_0x067f('0x5f')]=function(_0x5485e4,_0x4db0b9){return db[_0x067f('0x50')][_0x067f('0x26')]({'where':{'id':_0x5485e4[_0x067f('0x25')][_0x067f('0x53')]},'attributes':['id'],'include':[{'model':db[_0x067f('0x54')],'as':_0x067f('0x55'),'attributes':['id'],'raw':!![]}]})[_0x067f('0x17')](handleEntityNotFound(_0x4db0b9,null))[_0x067f('0x17')](function(_0x7f4473){var _0x308ea1=_[_0x067f('0x1e')](_0x7f4473,'id');var _0x48be2d=[];var _0x3a2fa8=[];var _0x55f4c5=squel['select']();_0x55f4c5['field'](_0x067f('0x60'))[_0x067f('0x61')](_0x067f('0x62'),'tq')[_0x067f('0x63')]('user_has_teams','ut',_0x067f('0x64'))[_0x067f('0x22')](_0x067f('0x65'),_0x5485e4[_0x067f('0x29')]['id']);for(var _0x58d127=0x0;_0x58d127<_0x7f4473[_0x067f('0x2f')];_0x58d127+=0x1){let _0x593065=_0x7f4473[_0x58d127];for(var _0x5b7ae6=0x0;_0x5b7ae6<_0x593065[_0x067f('0x55')][_0x067f('0x2f')];_0x5b7ae6+=0x1){let _0x26c194=_0x593065[_0x067f('0x55')][_0x5b7ae6];var _0xf14057=_0x55f4c5[_0x067f('0x66')]();_0xf14057[_0x067f('0x22')](_0x067f('0x67'),_0x26c194['id']);_0x3a2fa8[_0x067f('0x68')](db[_0x067f('0x5a')][_0x067f('0x25')](_0xf14057[_0x067f('0x69')](),{'type':db[_0x067f('0x5a')][_0x067f('0x6a')][_0x067f('0x6b')]})[_0x067f('0x17')](function(_0x5f2936){if(_0x5f2936[_0x067f('0x2f')]===0x1){return _0x26c194['id'];}else{var _0x5841b0=_[_0x067f('0x6c')](_[_0x067f('0x1e')](_0x5f2936,_0x067f('0x6d')),function(_0x1187a0){return _[_0x067f('0x6e')](_0x308ea1,_0x1187a0);});if(_0x5841b0){return _0x26c194['id'];}}}));}}return BPromise[_0x067f('0x6f')](_0x3a2fa8)['then'](function(_0x5510ba){_0x48be2d=_(_0x48be2d)[_0x067f('0x70')](_0x5510ba)['compact']()['value']();return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x5485e4[_0x067f('0x29')]['id']}})[_0x067f('0x17')](function(_0x22cb23){return db['sequelize'][_0x067f('0x71')](function(_0x2cda18){return _0x22cb23[_0x067f('0x5f')](_0x5485e4[_0x067f('0x25')][_0x067f('0x53')],{'transaction':_0x2cda18})[_0x067f('0x17')](function(){if(!_[_0x067f('0x72')](_0x48be2d)){return _0x22cb23[_0x067f('0x73')](_0x48be2d,{'transaction':_0x2cda18});}})[_0x067f('0x17')](function(){_0x48be2d[_0x067f('0x5d')](function(_0x420ead){socket[_0x067f('0x5e')]('userMailQueue:remove',{'UserId':_0x420ead,'MailQueueId':_0x22cb23['id']});});});});});});})['then'](respondWithStatusCode(_0x4db0b9,null))[_0x067f('0x3c')](handleError(_0x4db0b9,null));};exports['addAgents']=function(_0x56b51b,_0x5484bf){return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x56b51b['params']['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x5484bf,null))[_0x067f('0x17')](function(_0x403046){if(_0x403046){return _0x403046[_0x067f('0x74')](_0x56b51b[_0x067f('0x35')][_0x067f('0x53')],_[_0x067f('0x75')](_0x56b51b[_0x067f('0x35')],['ids','id'])||{})[_0x067f('0x76')](function(_0x3677f1){for(var _0x1626a7=0x0;_0x1626a7<_0x56b51b[_0x067f('0x35')]['ids'][_0x067f('0x2f')];_0x1626a7+=0x1){socket[_0x067f('0x5e')]('userMailQueue:save',{'UserId':Number(_0x56b51b[_0x067f('0x35')][_0x067f('0x53')][_0x1626a7]),'MailQueueId':Number(_0x56b51b['params']['id'])});}return _0x3677f1;});}})[_0x067f('0x17')](respondWithResult(_0x5484bf,null))[_0x067f('0x3c')](handleError(_0x5484bf,null));};exports[_0x067f('0x73')]=function(_0x5f1a49,_0x522a97){return db[_0x067f('0x23')][_0x067f('0x33')]({'where':{'id':_0x5f1a49[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0x522a97,null))[_0x067f('0x17')](function(_0x4413ef){if(_0x4413ef){return _0x4413ef[_0x067f('0x73')](_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')])[_0x067f('0x17')](function(){if(_[_0x067f('0x77')](_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')])){for(var _0x3e1c4c=0x0;_0x3e1c4c<_0x5f1a49['query'][_0x067f('0x53')][_0x067f('0x2f')];_0x3e1c4c+=0x1){socket['emit'](_0x067f('0x78'),{'UserId':Number(_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')][_0x3e1c4c]),'MailQueueId':Number(_0x5f1a49['params']['id'])});}}else{socket['emit'](_0x067f('0x78'),{'UserId':Number(_0x5f1a49[_0x067f('0x25')][_0x067f('0x53')]),'MailQueueId':Number(_0x5f1a49[_0x067f('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x522a97,null))['catch'](handleError(_0x522a97,null));};exports[_0x067f('0x79')]=function(_0x5e6572,_0xb80081){var _0x1a3df1={};var _0x3f90fb={};var _0x3d65b9;var _0xfad42a;return db[_0x067f('0x23')][_0x067f('0x3f')]({'where':{'id':_0x5e6572[_0x067f('0x29')]['id']}})[_0x067f('0x17')](handleEntityNotFound(_0xb80081,null))[_0x067f('0x17')](function(_0x59531a){if(_0x59531a){_0x3d65b9=_0x59531a;_0x3f90fb[_0x067f('0x2a')]=_[_0x067f('0x40')](db[_0x067f('0x54')][_0x067f('0x1f')]);_0x3f90fb[_0x067f('0x25')]=_[_0x067f('0x40')](_0x5e6572[_0x067f('0x25')]);_0x3f90fb[_0x067f('0x2b')]=_[_0x067f('0x2c')](_0x3f90fb[_0x067f('0x2a')],_0x3f90fb[_0x067f('0x25')]);_0x1a3df1[_0x067f('0x2e')]=_[_0x067f('0x2c')](_0x3f90fb[_0x067f('0x2a')],qs[_0x067f('0x2d')](_0x5e6572[_0x067f('0x25')]['fields']));_0x1a3df1['attributes']=_0x1a3df1[_0x067f('0x2e')][_0x067f('0x2f')]?_0x1a3df1['attributes']:_0x3f90fb[_0x067f('0x2a')];_0x1a3df1[_0x067f('0x43')]=qs[_0x067f('0x44')](_0x5e6572[_0x067f('0x25')][_0x067f('0x44')]);_0x1a3df1['where']=qs[_0x067f('0x2b')](_[_0x067f('0x45')](_0x5e6572[_0x067f('0x25')],_0x3f90fb[_0x067f('0x2b')]));if(_0x5e6572[_0x067f('0x25')][_0x067f('0x47')]){_0x1a3df1[_0x067f('0x22')]=_['merge'](_0x1a3df1['where'],{'$or':_['map'](_0x1a3df1['attributes'],function(_0x4da5ea){var _0x5cbed7={};_0x5cbed7[_0x4da5ea]={'$like':'%'+_0x5e6572[_0x067f('0x25')][_0x067f('0x47')]+'%'};return _0x5cbed7;})});}_0x1a3df1=_[_0x067f('0x31')]({},_0x1a3df1,_0x5e6572[_0x067f('0x32')]);return _0x3d65b9[_0x067f('0x79')](_0x1a3df1);}})[_0x067f('0x17')](function(_0x41dee9){if(_0x41dee9){_0xfad42a=_0x41dee9[_0x067f('0x2f')];if(!_0x5e6572[_0x067f('0x25')][_0x067f('0x51')](_0x067f('0x42'))){_0x1a3df1['limit']=qs[_0x067f('0x11')](_0x5e6572['query']['limit']);_0x1a3df1[_0x067f('0x13')]=qs[_0x067f('0x13')](_0x5e6572[_0x067f('0x25')][_0x067f('0x13')]);}return _0x3d65b9[_0x067f('0x79')](_0x1a3df1);}})[_0x067f('0x17')](function(_0x7c3929){if(_0x7c3929){return _0x7c3929?{'count':_0xfad42a,'rows':_0x7c3929}:null;}})[_0x067f('0x17')](respondWithResult(_0xb80081,null))[_0x067f('0x3c')](handleError(_0xb80081,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 712dc79..0cb51b9 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 _0xe11a=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe11a,0x105));var _0xae11=function(_0x2c6a5d,_0x2b9bf6){_0x2c6a5d=_0x2c6a5d-0x0;var _0x51a19a=_0xe11a[_0x2c6a5d];return _0x51a19a;};'use strict';var EventEmitter=require(_0xae11('0x0'));var MailQueue=require(_0xae11('0x1'))['db'][_0xae11('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xae11('0x3')](0x0);var events={'afterCreate':_0xae11('0x4'),'afterUpdate':_0xae11('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a093c){return function(_0x1e931c,_0x12ceab,_0x10080e){MailQueueEvents[_0xae11('0x6')](_0x2a093c+':'+_0x1e931c['id'],_0x1e931c);MailQueueEvents[_0xae11('0x6')](_0x2a093c,_0x1e931c);_0x10080e(null);};}for(var e in events){if(events[_0xae11('0x7')](e)){var event=events[e];MailQueue[_0xae11('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x0610=['../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','exports','events'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0x0610,0xaf));var _0x0061=function(_0x130b0f,_0x3bb0de){_0x130b0f=_0x130b0f-0x0;var _0x5f4468=_0x0610[_0x130b0f];return _0x5f4468;};'use strict';var EventEmitter=require(_0x0061('0x0'));var MailQueue=require(_0x0061('0x1'))['db'][_0x0061('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x0061('0x3')](0x0);var events={'afterCreate':_0x0061('0x4'),'afterUpdate':'update','afterDestroy':_0x0061('0x5')};function emitEvent(_0x455246){return function(_0x4841f2,_0x2da1d9,_0x4beca5){MailQueueEvents[_0x0061('0x6')](_0x455246+':'+_0x4841f2['id'],_0x4841f2);MailQueueEvents[_0x0061('0x6')](_0x455246,_0x4841f2);_0x4beca5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x0061('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 326a9d1..9a0bad5 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 _0x89d5=['lodash','util','api','moment','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues'];(function(_0x4997f9,_0x832b9a){var _0x488b9b=function(_0x6ab118){while(--_0x6ab118){_0x4997f9['push'](_0x4997f9['shift']());}};_0x488b9b(++_0x832b9a);}(_0x89d5,0xb4));var _0x589d=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x89d5[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x589d('0x0'));var util=require(_0x589d('0x1'));var logger=require('../../config/logger')(_0x589d('0x2'));var moment=require(_0x589d('0x3'));var BPromise=require('bluebird');var rp=require(_0x589d('0x4'));var fs=require('fs');var path=require(_0x589d('0x5'));var rimraf=require('rimraf');var config=require(_0x589d('0x6'));var attributes=require(_0x589d('0x7'));module[_0x589d('0x8')]=function(_0x3a6197,_0x5c8f67){return _0x3a6197[_0x589d('0x9')](_0x589d('0xa'),attributes,{'tableName':_0x589d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd64=['define','MailQueue','mail_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0xf6d8f1,_0x87ece3){var _0x3fd9d1=function(_0x3d0dbd){while(--_0x3d0dbd){_0xf6d8f1['push'](_0xf6d8f1['shift']());}};_0x3fd9d1(++_0x87ece3);}(_0xcd64,0x123));var _0x4cd6=function(_0x388ef9,_0x2751b8){_0x388ef9=_0x388ef9-0x0;var _0x80e8aa=_0xcd64[_0x388ef9];return _0x80e8aa;};'use strict';var _=require('lodash');var util=require(_0x4cd6('0x0'));var logger=require(_0x4cd6('0x1'))(_0x4cd6('0x2'));var moment=require(_0x4cd6('0x3'));var BPromise=require('bluebird');var rp=require(_0x4cd6('0x4'));var fs=require('fs');var path=require(_0x4cd6('0x5'));var rimraf=require(_0x4cd6('0x6'));var config=require(_0x4cd6('0x7'));var attributes=require(_0x4cd6('0x8'));module['exports']=function(_0x28b983,_0x172a11){return _0x28b983[_0x4cd6('0x9')](_0x4cd6('0xa'),attributes,{'tableName':_0x4cd6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 1e0f0dc..a6dd0ed 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 _0x2eab=['rpc','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','catch','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x2eab,0x8d));var _0xb2ea=function(_0x52e610,_0x2a8101){_0x52e610=_0x52e610-0x0;var _0x10fe6e=_0x2eab[_0x52e610];return _0x10fe6e;};'use strict';var _=require(_0xb2ea('0x0'));var util=require(_0xb2ea('0x1'));var moment=require(_0xb2ea('0x2'));var BPromise=require(_0xb2ea('0x3'));var rs=require(_0xb2ea('0x4'));var fs=require('fs');var Redis=require(_0xb2ea('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb2ea('0x6'));var logger=require('../../config/logger')(_0xb2ea('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb2ea('0x8')][_0xb2ea('0x9')]({'port':0x232a});config[_0xb2ea('0xa')]=_['defaults'](config[_0xb2ea('0xa')],{'host':_0xb2ea('0xb'),'port':0x18eb});var socket=require(_0xb2ea('0xc'))(new Redis(config[_0xb2ea('0xa')]));require(_0xb2ea('0xd'))['register'](socket);function respondWithRpcPromise(_0x6af7c6,_0x24af6f,_0xe08dec){return new BPromise(function(_0x1af8ad,_0x43a85a){return client['request'](_0x6af7c6,_0xe08dec)[_0xb2ea('0xe')](function(_0x4c10ab){logger[_0xb2ea('0xf')](_0xb2ea('0x10'),_0x24af6f,_0xb2ea('0x11'));logger[_0xb2ea('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x24af6f,'request\x20sent',JSON[_0xb2ea('0x13')](_0x4c10ab));if(_0x4c10ab[_0xb2ea('0x14')]){if(_0x4c10ab['error'][_0xb2ea('0x15')]===0x1f4){logger['error'](_0xb2ea('0x10'),_0x24af6f,_0x4c10ab[_0xb2ea('0x14')][_0xb2ea('0x16')]);return _0x43a85a(_0x4c10ab['error'][_0xb2ea('0x16')]);}logger[_0xb2ea('0x14')](_0xb2ea('0x10'),_0x24af6f,_0x4c10ab[_0xb2ea('0x14')]['message']);return _0x1af8ad(_0x4c10ab[_0xb2ea('0x14')][_0xb2ea('0x16')]);}else{logger['info'](_0xb2ea('0x10'),_0x24af6f,_0xb2ea('0x11'));_0x1af8ad(_0x4c10ab[_0xb2ea('0x17')][_0xb2ea('0x16')]);}})['catch'](function(_0x16217a){logger[_0xb2ea('0x14')]('MailQueue,\x20%s,\x20%s',_0x24af6f,_0x16217a);_0x43a85a(_0x16217a);});});}exports[_0xb2ea('0x18')]=function(_0x19d0a1){var _0x6fc2c3=this;return new Promise(function(_0x2cd8f7,_0xa5cacd){return db[_0xb2ea('0x19')]['findAll']({'raw':_0x19d0a1[_0xb2ea('0x1a')]?_0x19d0a1['options'][_0xb2ea('0x1b')]===undefined?!![]:![]:!![],'where':_0x19d0a1['options']?_0x19d0a1['options'][_0xb2ea('0x1c')]||null:null,'attributes':_0x19d0a1[_0xb2ea('0x1a')]?_0x19d0a1['options'][_0xb2ea('0x1d')]||null:null,'limit':_0x19d0a1['options']?_0x19d0a1['options'][_0xb2ea('0x1e')]||null:null,'include':_0x19d0a1['options']?_0x19d0a1[_0xb2ea('0x1a')][_0xb2ea('0x1f')]?_[_0xb2ea('0x20')](_0x19d0a1['options'][_0xb2ea('0x1f')],function(_0xaeda58){return{'model':db[_0xaeda58[_0xb2ea('0x21')]],'as':_0xaeda58['as'],'attributes':_0xaeda58[_0xb2ea('0x1d')],'include':_0xaeda58['include']?_[_0xb2ea('0x20')](_0xaeda58['include'],function(_0x4c2903){return{'model':db[_0x4c2903[_0xb2ea('0x21')]],'as':_0x4c2903['as'],'attributes':_0x4c2903[_0xb2ea('0x1d')],'include':_0x4c2903[_0xb2ea('0x1f')]?_[_0xb2ea('0x20')](_0x4c2903[_0xb2ea('0x1f')],function(_0x2d3776){return{'model':db[_0x2d3776[_0xb2ea('0x21')]],'as':_0x2d3776['as'],'attributes':_0x2d3776[_0xb2ea('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb2ea('0xe')](function(_0x16c5b7){logger[_0xb2ea('0xf')](_0xb2ea('0x18'),_0x19d0a1);logger['debug'](_0xb2ea('0x18'),_0x19d0a1,JSON[_0xb2ea('0x13')](_0x16c5b7));_0x2cd8f7(_0x16c5b7);})[_0xb2ea('0x22')](function(_0xcfb360){logger[_0xb2ea('0x14')](_0xb2ea('0x18'),_0xcfb360[_0xb2ea('0x16')],_0x19d0a1);_0xa5cacd(_0x6fc2c3[_0xb2ea('0x14')](0x1f4,_0xcfb360[_0xb2ea('0x16')]));});});};exports[_0xb2ea('0x23')]=function(_0x37394c){var _0x354ba6=this;return new Promise(function(_0x5e82b6,_0x2127da){return db[_0xb2ea('0x19')][_0xb2ea('0x24')]({'raw':_0x37394c[_0xb2ea('0x1a')]?_0x37394c['options']['raw']===undefined?!![]:![]:!![],'where':_0x37394c[_0xb2ea('0x1a')]?_0x37394c[_0xb2ea('0x1a')][_0xb2ea('0x1c')]||null:null,'attributes':_0x37394c[_0xb2ea('0x1a')]?_0x37394c[_0xb2ea('0x1a')][_0xb2ea('0x1d')]||null:null,'include':_0x37394c['options']?_0x37394c[_0xb2ea('0x1a')][_0xb2ea('0x1f')]?_[_0xb2ea('0x20')](_0x37394c[_0xb2ea('0x1a')]['include'],function(_0x282be8){return{'model':db[_0x282be8[_0xb2ea('0x21')]],'as':_0x282be8['as'],'attributes':_0x282be8[_0xb2ea('0x1d')],'include':_0x282be8[_0xb2ea('0x1f')]?_[_0xb2ea('0x20')](_0x282be8[_0xb2ea('0x1f')],function(_0x4b8094){return{'model':db[_0x4b8094[_0xb2ea('0x21')]],'as':_0x4b8094['as'],'attributes':_0x4b8094[_0xb2ea('0x1d')],'include':_0x4b8094[_0xb2ea('0x1f')]?_[_0xb2ea('0x20')](_0x4b8094['include'],function(_0x4ef332){return{'model':db[_0x4ef332[_0xb2ea('0x21')]],'as':_0x4ef332['as'],'attributes':_0x4ef332[_0xb2ea('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cfdc4){logger[_0xb2ea('0xf')]('ShowMailQueue',_0x37394c);logger[_0xb2ea('0x12')](_0xb2ea('0x23'),_0x37394c,JSON[_0xb2ea('0x13')](_0x4cfdc4));_0x5e82b6(_0x4cfdc4);})['catch'](function(_0x2a5a65){logger[_0xb2ea('0x14')](_0xb2ea('0x23'),_0x2a5a65[_0xb2ea('0x16')],_0x37394c);_0x2127da(_0x354ba6[_0xb2ea('0x14')](0x1f4,_0x2a5a65['message']));});});}; \ No newline at end of file +var _0x5c70=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','debug','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','ShowMailQueue','find','raw'];(function(_0x2afe0c,_0x306d23){var _0x2395ca=function(_0x5e0d1f){while(--_0x5e0d1f){_0x2afe0c['push'](_0x2afe0c['shift']());}};_0x2395ca(++_0x306d23);}(_0x5c70,0x102));var _0x05c7=function(_0x948262,_0x1610b5){_0x948262=_0x948262-0x0;var _0x582757=_0x5c70[_0x948262];return _0x582757;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x05c7('0x0'));var BPromise=require(_0x05c7('0x1'));var rs=require(_0x05c7('0x2'));var fs=require('fs');var Redis=require(_0x05c7('0x3'));var db=require(_0x05c7('0x4'))['db'];var utils=require(_0x05c7('0x5'));var logger=require(_0x05c7('0x6'))(_0x05c7('0x7'));var config=require(_0x05c7('0x8'));var jayson=require(_0x05c7('0x9'));var client=jayson[_0x05c7('0xa')][_0x05c7('0xb')]({'port':0x232a});config[_0x05c7('0xc')]=_[_0x05c7('0xd')](config['redis'],{'host':_0x05c7('0xe'),'port':0x18eb});var socket=require(_0x05c7('0xf'))(new Redis(config[_0x05c7('0xc')]));require(_0x05c7('0x10'))[_0x05c7('0x11')](socket);function respondWithRpcPromise(_0x26b9d8,_0x2e331b,_0x355053){return new BPromise(function(_0x2ea087,_0x2b6c28){return client[_0x05c7('0x12')](_0x26b9d8,_0x355053)[_0x05c7('0x13')](function(_0x4ccd02){logger['info']('MailQueue,\x20%s,\x20%s',_0x2e331b,'request\x20sent');logger[_0x05c7('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x2e331b,_0x05c7('0x15'),JSON[_0x05c7('0x16')](_0x4ccd02));if(_0x4ccd02[_0x05c7('0x17')]){if(_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x18')]===0x1f4){logger[_0x05c7('0x17')](_0x05c7('0x19'),_0x2e331b,_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);return _0x2b6c28(_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);}logger['error'](_0x05c7('0x19'),_0x2e331b,_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);return _0x2ea087(_0x4ccd02[_0x05c7('0x17')][_0x05c7('0x1a')]);}else{logger[_0x05c7('0x1b')](_0x05c7('0x19'),_0x2e331b,_0x05c7('0x15'));_0x2ea087(_0x4ccd02[_0x05c7('0x1c')][_0x05c7('0x1a')]);}})[_0x05c7('0x1d')](function(_0x42608e){logger['error'](_0x05c7('0x19'),_0x2e331b,_0x42608e);_0x2b6c28(_0x42608e);});});}exports[_0x05c7('0x1e')]=function(_0x650270){var _0x561b9d=this;return new Promise(function(_0x21ed11,_0x1091f4){return db[_0x05c7('0x1f')][_0x05c7('0x20')]({'raw':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')][_0x05c7('0x22')]||null:null,'attributes':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')][_0x05c7('0x23')]||null:null,'limit':_0x650270['options']?_0x650270[_0x05c7('0x21')][_0x05c7('0x24')]||null:null,'include':_0x650270[_0x05c7('0x21')]?_0x650270[_0x05c7('0x21')][_0x05c7('0x25')]?_[_0x05c7('0x26')](_0x650270[_0x05c7('0x21')]['include'],function(_0x2abc92){return{'model':db[_0x2abc92[_0x05c7('0x27')]],'as':_0x2abc92['as'],'attributes':_0x2abc92[_0x05c7('0x23')],'include':_0x2abc92[_0x05c7('0x25')]?_['map'](_0x2abc92[_0x05c7('0x25')],function(_0x33b885){return{'model':db[_0x33b885[_0x05c7('0x27')]],'as':_0x33b885['as'],'attributes':_0x33b885[_0x05c7('0x23')],'include':_0x33b885[_0x05c7('0x25')]?_[_0x05c7('0x26')](_0x33b885[_0x05c7('0x25')],function(_0x4c27bc){return{'model':db[_0x4c27bc[_0x05c7('0x27')]],'as':_0x4c27bc['as'],'attributes':_0x4c27bc[_0x05c7('0x23')]};}):[]};}):[]};}):[]:[]})[_0x05c7('0x13')](function(_0x588975){logger[_0x05c7('0x1b')](_0x05c7('0x1e'),_0x650270);logger[_0x05c7('0x14')]('GetMailQueue',_0x650270,JSON['stringify'](_0x588975));_0x21ed11(_0x588975);})[_0x05c7('0x1d')](function(_0x3e3df2){logger[_0x05c7('0x17')](_0x05c7('0x1e'),_0x3e3df2[_0x05c7('0x1a')],_0x650270);_0x1091f4(_0x561b9d[_0x05c7('0x17')](0x1f4,_0x3e3df2[_0x05c7('0x1a')]));});});};exports[_0x05c7('0x28')]=function(_0x2daf79){var _0x1bd05c=this;return new Promise(function(_0x312222,_0x24a160){return db[_0x05c7('0x1f')][_0x05c7('0x29')]({'raw':_0x2daf79[_0x05c7('0x21')]?_0x2daf79[_0x05c7('0x21')][_0x05c7('0x2a')]===undefined?!![]:![]:!![],'where':_0x2daf79[_0x05c7('0x21')]?_0x2daf79['options'][_0x05c7('0x22')]||null:null,'attributes':_0x2daf79['options']?_0x2daf79['options'][_0x05c7('0x23')]||null:null,'include':_0x2daf79[_0x05c7('0x21')]?_0x2daf79[_0x05c7('0x21')][_0x05c7('0x25')]?_['map'](_0x2daf79[_0x05c7('0x21')][_0x05c7('0x25')],function(_0x5dd100){return{'model':db[_0x5dd100['model']],'as':_0x5dd100['as'],'attributes':_0x5dd100['attributes'],'include':_0x5dd100[_0x05c7('0x25')]?_[_0x05c7('0x26')](_0x5dd100[_0x05c7('0x25')],function(_0x5c10ae){return{'model':db[_0x5c10ae[_0x05c7('0x27')]],'as':_0x5c10ae['as'],'attributes':_0x5c10ae[_0x05c7('0x23')],'include':_0x5c10ae['include']?_[_0x05c7('0x26')](_0x5c10ae[_0x05c7('0x25')],function(_0x3ed66e){return{'model':db[_0x3ed66e[_0x05c7('0x27')]],'as':_0x3ed66e['as'],'attributes':_0x3ed66e[_0x05c7('0x23')]};}):[]};}):[]};}):[]:[]})[_0x05c7('0x13')](function(_0x1e5183){logger[_0x05c7('0x1b')]('ShowMailQueue',_0x2daf79);logger['debug'](_0x05c7('0x28'),_0x2daf79,JSON[_0x05c7('0x16')](_0x1e5183));_0x312222(_0x1e5183);})['catch'](function(_0x2c3587){logger['error'](_0x05c7('0x28'),_0x2c3587[_0x05c7('0x1a')],_0x2daf79);_0x24a160(_0x1bd05c['error'](0x1f4,_0x2c3587[_0x05c7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index bb8c28e..02dae34 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 _0x5e68=['./mailQueue.events','save','remove','update','removeListener','register','length','mailQueue:'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x5e68,0x140));var _0x85e6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5e68[_0x432682];return _0x463d05;};'use strict';var MailQueueEvents=require(_0x85e6('0x0'));var events=[_0x85e6('0x1'),_0x85e6('0x2'),_0x85e6('0x3')];function createListener(_0x5d3707,_0x41b1ce){return function(_0x2b6f40){_0x41b1ce['emit'](_0x5d3707,_0x2b6f40);};}function removeListener(_0x52a5ed,_0x49a7fa){return function(){MailQueueEvents[_0x85e6('0x4')](_0x52a5ed,_0x49a7fa);};}exports[_0x85e6('0x5')]=function(_0x2fa28a){for(var _0x3df397=0x0,_0x5c828b=events[_0x85e6('0x6')];_0x3df397<_0x5c828b;_0x3df397++){var _0x2bd9ff=events[_0x3df397];var _0x37229e=createListener(_0x85e6('0x7')+_0x2bd9ff,_0x2fa28a);MailQueueEvents['on'](_0x2bd9ff,_0x37229e);}}; \ No newline at end of file +var _0x2fee=['length','mailQueue:','./mailQueue.events','remove','emit','removeListener','register'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x2fee,0x11a));var _0xe2fe=function(_0x4fcd21,_0x3b4148){_0x4fcd21=_0x4fcd21-0x0;var _0x3af7b8=_0x2fee[_0x4fcd21];return _0x3af7b8;};'use strict';var MailQueueEvents=require(_0xe2fe('0x0'));var events=['save',_0xe2fe('0x1'),'update'];function createListener(_0x1d5e13,_0x5dd7b6){return function(_0x35d241){_0x5dd7b6[_0xe2fe('0x2')](_0x1d5e13,_0x35d241);};}function removeListener(_0x4ca9af,_0x15f1a2){return function(){MailQueueEvents[_0xe2fe('0x3')](_0x4ca9af,_0x15f1a2);};}exports[_0xe2fe('0x4')]=function(_0x4d4ac4){for(var _0x20d031=0x0,_0x361d40=events[_0xe2fe('0x5')];_0x20d031<_0x361d40;_0x20d031++){var _0xe0f512=events[_0x20d031];var _0x39a31c=createListener(_0xe2fe('0x6')+_0xe0f512,_0x4d4ac4);MailQueueEvents['on'](_0xe0f512,_0x39a31c);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 99a2f10..e951a04 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 _0x5dad=['index','/describe','describe','/:id','show','post','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x267da8,_0x4895a9){var _0x29cfd0=function(_0x5dfafd){while(--_0x5dfafd){_0x267da8['push'](_0x267da8['shift']());}};_0x29cfd0(++_0x4895a9);}(_0x5dad,0x15e));var _0xd5da=function(_0x62daf8,_0x25a16e){_0x62daf8=_0x62daf8-0x0;var _0x15b34c=_0x5dad[_0x62daf8];return _0x15b34c;};'use strict';var multer=require('multer');var util=require(_0xd5da('0x0'));var path=require(_0xd5da('0x1'));var timeout=require(_0xd5da('0x2'));var express=require(_0xd5da('0x3'));var router=express[_0xd5da('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd5da('0x5'));var interaction=require(_0xd5da('0x6'));var config=require('../../config/environment');var controller=require(_0xd5da('0x7'));router[_0xd5da('0x8')]('/',auth[_0xd5da('0x9')](),controller[_0xd5da('0xa')]);router[_0xd5da('0x8')](_0xd5da('0xb'),auth[_0xd5da('0x9')](),controller[_0xd5da('0xc')]);router[_0xd5da('0x8')](_0xd5da('0xd'),auth[_0xd5da('0x9')](),controller[_0xd5da('0xe')]);router[_0xd5da('0xf')]('/',auth[_0xd5da('0x9')](),controller['create']);router[_0xd5da('0x10')]('/:id',auth[_0xd5da('0x9')](),controller[_0xd5da('0x11')]);router[_0xd5da('0x12')]('/:id',auth[_0xd5da('0x9')](),controller['destroy']);module[_0xd5da('0x13')]=router; \ No newline at end of file +var _0xbc2d=['isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','../../config/environment','./mailQueueReport.controller','get'];(function(_0x3324d4,_0x115bef){var _0x88552f=function(_0x329114){while(--_0x329114){_0x3324d4['push'](_0x3324d4['shift']());}};_0x88552f(++_0x115bef);}(_0xbc2d,0x172));var _0xdbc2=function(_0x40b9d9,_0x53eaec){_0x40b9d9=_0x40b9d9-0x0;var _0x3edc14=_0xbc2d[_0x40b9d9];return _0x3edc14;};'use strict';var multer=require(_0xdbc2('0x0'));var util=require('util');var path=require(_0xdbc2('0x1'));var timeout=require(_0xdbc2('0x2'));var express=require(_0xdbc2('0x3'));var router=express[_0xdbc2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdbc2('0x5'));var controller=require(_0xdbc2('0x6'));router[_0xdbc2('0x7')]('/',auth[_0xdbc2('0x8')](),controller['index']);router[_0xdbc2('0x7')](_0xdbc2('0x9'),auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xa')]);router[_0xdbc2('0x7')](_0xdbc2('0xb'),auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xc')]);router[_0xdbc2('0xd')]('/',auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xe')]);router['put']('/:id',auth[_0xdbc2('0x8')](),controller[_0xdbc2('0xf')]);router[_0xdbc2('0x10')](_0xdbc2('0xb'),auth[_0xdbc2('0x8')](),controller[_0xdbc2('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 8408e5d..86528dc 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 _0xf589=['DATE','moment','sequelize','STRING'];(function(_0x2eff9,_0xb5e45b){var _0x5c87e3=function(_0x239249){while(--_0x239249){_0x2eff9['push'](_0x2eff9['shift']());}};_0x5c87e3(++_0xb5e45b);}(_0xf589,0xe1));var _0x9f58=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xf589[_0x6131cd];return _0x47e916;};'use strict';var moment=require(_0x9f58('0x0'));var Sequelize=require(_0x9f58('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9f58('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9f58('0x2')]},'joinAt':{'type':Sequelize[_0x9f58('0x3')]},'leaveAt':{'type':Sequelize[_0x9f58('0x3')]},'acceptAt':{'type':Sequelize[_0x9f58('0x3')]},'exitAt':{'type':Sequelize[_0x9f58('0x3')]},'reason':{'type':Sequelize[_0x9f58('0x2')]}}; \ No newline at end of file +var _0xa7ac=['DATE','sequelize','STRING'];(function(_0x484969,_0x59cf16){var _0x4a04b3=function(_0x506475){while(--_0x506475){_0x484969['push'](_0x484969['shift']());}};_0x4a04b3(++_0x59cf16);}(_0xa7ac,0x14e));var _0xca7a=function(_0x17dc52,_0x1912b2){_0x17dc52=_0x17dc52-0x0;var _0x2faf8b=_0xa7ac[_0x17dc52];return _0x2faf8b;};'use strict';var moment=require('moment');var Sequelize=require(_0xca7a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xca7a('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xca7a('0x2')]},'leaveAt':{'type':Sequelize[_0xca7a('0x2')]},'acceptAt':{'type':Sequelize[_0xca7a('0x2')]},'exitAt':{'type':Sequelize[_0xca7a('0x2')]},'reason':{'type':Sequelize[_0xca7a('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index a42ef95..76d4c65 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 _0x7b84=['sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','merge','VIRTUAL','filter','MailQueueReport','includeAll','findAll','rows','catch','show','params','include','options','create','body','update','find','describe','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','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'];(function(_0x5b14ff,_0xf4601f){var _0x4ae554=function(_0x2c922b){while(--_0x2c922b){_0x5b14ff['push'](_0x5b14ff['shift']());}};_0x4ae554(++_0xf4601f);}(_0x7b84,0x17c));var _0x47b8=function(_0x3cf73f,_0x110c25){_0x3cf73f=_0x3cf73f-0x0;var _0x233fd2=_0x7b84[_0x3cf73f];return _0x233fd2;};'use strict';var emlformat=require(_0x47b8('0x0'));var rimraf=require(_0x47b8('0x1'));var zipdir=require(_0x47b8('0x2'));var jsonpatch=require(_0x47b8('0x3'));var rp=require(_0x47b8('0x4'));var moment=require(_0x47b8('0x5'));var BPromise=require(_0x47b8('0x6'));var Mustache=require('mustache');var util=require(_0x47b8('0x7'));var path=require(_0x47b8('0x8'));var sox=require(_0x47b8('0x9'));var csv=require(_0x47b8('0xa'));var ejs=require(_0x47b8('0xb'));var fs=require('fs');var fs_extra=require(_0x47b8('0xc'));var _=require('lodash');var squel=require(_0x47b8('0xd'));var crypto=require(_0x47b8('0xe'));var jsforce=require(_0x47b8('0xf'));var deskjs=require(_0x47b8('0x10'));var toCsv=require(_0x47b8('0xa'));var querystring=require(_0x47b8('0x11'));var Papa=require(_0x47b8('0x12'));var Redis=require(_0x47b8('0x13'));var authService=require(_0x47b8('0x14'));var qs=require(_0x47b8('0x15'));var as=require(_0x47b8('0x16'));var hardwareService=require(_0x47b8('0x17'));var logger=require(_0x47b8('0x18'))(_0x47b8('0x19'));var utils=require(_0x47b8('0x1a'));var config=require(_0x47b8('0x1b'));var licenseUtil=require(_0x47b8('0x1c'));var db=require(_0x47b8('0x1d'))['db'];function respondWithStatusCode(_0x25a224,_0x289ac7){_0x289ac7=_0x289ac7||0xcc;return function(_0x1edb4b){if(_0x1edb4b){return _0x25a224[_0x47b8('0x1e')](_0x289ac7);}return _0x25a224[_0x47b8('0x1f')](_0x289ac7)[_0x47b8('0x20')]();};}function respondWithResult(_0x173015,_0x223121){_0x223121=_0x223121||0xc8;return function(_0xf66dd6){if(_0xf66dd6){return _0x173015['status'](_0x223121)[_0x47b8('0x21')](_0xf66dd6);}};}function respondWithFilteredResult(_0x340da0,_0x3e760a){return function(_0x1217a4){if(_0x1217a4){var _0x34d5a5=typeof _0x3e760a[_0x47b8('0x22')]===_0x47b8('0x23')&&typeof _0x3e760a['limit']===_0x47b8('0x23');var _0x5c2b2c=_0x1217a4['count'];var _0x4f7317=_0x34d5a5?0x0:_0x3e760a[_0x47b8('0x22')];var _0x36faf1=_0x34d5a5?_0x1217a4[_0x47b8('0x24')]:_0x3e760a['offset']+_0x3e760a['limit'];var _0x4f6716;if(_0x36faf1>=_0x5c2b2c){_0x36faf1=_0x5c2b2c;_0x4f6716=0xc8;}else{_0x4f6716=0xce;}_0x340da0[_0x47b8('0x1f')](_0x4f6716);return _0x340da0['set'](_0x47b8('0x25'),_0x4f7317+'-'+_0x36faf1+'/'+_0x5c2b2c)[_0x47b8('0x21')](_0x1217a4);}return null;};}function patchUpdates(_0x303f19){return function(_0xfccf56){try{jsonpatch['apply'](_0xfccf56,_0x303f19,!![]);}catch(_0xc20df1){return BPromise[_0x47b8('0x26')](_0xc20df1);}return _0xfccf56[_0x47b8('0x27')]();};}function saveUpdates(_0x2f75d2,_0x168cde){return function(_0x232708){if(_0x232708){return _0x232708['update'](_0x2f75d2)[_0x47b8('0x28')](function(_0x2a22e3){return _0x2a22e3;});}return null;};}function removeEntity(_0x5301f8,_0x22e7dd){return function(_0x247429){if(_0x247429){return _0x247429[_0x47b8('0x29')]()[_0x47b8('0x28')](function(){_0x5301f8['status'](0xcc)[_0x47b8('0x20')]();});}};}function handleEntityNotFound(_0x332c23,_0x319d17){return function(_0x3e3de0){if(!_0x3e3de0){_0x332c23[_0x47b8('0x1e')](0x194);}return _0x3e3de0;};}function handleError(_0xbf5ce9,_0x40918f){_0x40918f=_0x40918f||0x1f4;return function(_0x568c1e){logger[_0x47b8('0x2a')](_0x568c1e[_0x47b8('0x2b')]);if(_0x568c1e['name']){delete _0x568c1e[_0x47b8('0x2c')];}_0xbf5ce9[_0x47b8('0x1f')](_0x40918f)[_0x47b8('0x2d')](_0x568c1e);};}exports[_0x47b8('0x2e')]=function(_0x4da0e0,_0x162d96){var _0x5c347f={},_0x2c89fc={},_0x2255ab={'count':0x0,'rows':[]};var _0x33e653=_[_0x47b8('0x2f')](db['MailQueueReport'][_0x47b8('0x30')],function(_0x264dd9){return{'name':_0x264dd9[_0x47b8('0x31')],'type':_0x264dd9[_0x47b8('0x32')][_0x47b8('0x33')]};});_0x2c89fc[_0x47b8('0x34')]=_['map'](_0x33e653,'name');_0x2c89fc['query']=_[_0x47b8('0x35')](_0x4da0e0[_0x47b8('0x36')]);_0x2c89fc[_0x47b8('0x37')]=_['intersection'](_0x2c89fc['model'],_0x2c89fc['query']);_0x5c347f['attributes']=_[_0x47b8('0x38')](_0x2c89fc[_0x47b8('0x34')],qs[_0x47b8('0x39')](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x39')]));_0x5c347f[_0x47b8('0x3a')]=_0x5c347f[_0x47b8('0x3a')][_0x47b8('0x3b')]?_0x5c347f[_0x47b8('0x3a')]:_0x2c89fc['model'];if(!_0x4da0e0['query'][_0x47b8('0x3c')](_0x47b8('0x3d'))){_0x5c347f['limit']=qs['limit'](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x3e')]);_0x5c347f[_0x47b8('0x22')]=qs['offset'](_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x22')]);}_0x5c347f['order']=qs['sort'](_0x4da0e0['query']['sort']);_0x5c347f[_0x47b8('0x3f')]=qs[_0x47b8('0x37')](_[_0x47b8('0x40')](_0x4da0e0[_0x47b8('0x36')],_0x2c89fc[_0x47b8('0x37')]),_0x33e653);if(_0x4da0e0[_0x47b8('0x36')]['filter']){_0x5c347f['where']=_[_0x47b8('0x41')](_0x5c347f[_0x47b8('0x3f')],{'$or':_[_0x47b8('0x2f')](_0x33e653,function(_0x4a9ed6){if(_0x4a9ed6['type']!==_0x47b8('0x42')){var _0x2c89bc={};_0x2c89bc[_0x4a9ed6['name']]={'$like':'%'+_0x4da0e0[_0x47b8('0x36')][_0x47b8('0x43')]+'%'};return _0x2c89bc;}})});}_0x5c347f=_['merge']({},_0x5c347f,_0x4da0e0['options']);var _0x493b69={'where':_0x5c347f['where']};return db[_0x47b8('0x44')][_0x47b8('0x24')](_0x493b69)[_0x47b8('0x28')](function(_0x28cf2c){_0x2255ab[_0x47b8('0x24')]=_0x28cf2c;if(_0x4da0e0['query'][_0x47b8('0x45')]){_0x5c347f['include']=[{'all':!![]}];}return db[_0x47b8('0x44')][_0x47b8('0x46')](_0x5c347f);})[_0x47b8('0x28')](function(_0x5bede8){_0x2255ab[_0x47b8('0x47')]=_0x5bede8;return _0x2255ab;})[_0x47b8('0x28')](respondWithFilteredResult(_0x162d96,_0x5c347f))[_0x47b8('0x48')](handleError(_0x162d96,null));};exports[_0x47b8('0x49')]=function(_0x3eaf01,_0x15b9a1){var _0x2d2971={'raw':!![],'where':{'id':_0x3eaf01[_0x47b8('0x4a')]['id']}},_0x569d29={};_0x569d29['model']=_[_0x47b8('0x35')](db[_0x47b8('0x44')][_0x47b8('0x30')]);_0x569d29[_0x47b8('0x36')]=_[_0x47b8('0x35')](_0x3eaf01[_0x47b8('0x36')]);_0x569d29['filters']=_['intersection'](_0x569d29[_0x47b8('0x34')],_0x569d29[_0x47b8('0x36')]);_0x2d2971[_0x47b8('0x3a')]=_['intersection'](_0x569d29[_0x47b8('0x34')],qs['fields'](_0x3eaf01[_0x47b8('0x36')][_0x47b8('0x39')]));_0x2d2971[_0x47b8('0x3a')]=_0x2d2971[_0x47b8('0x3a')][_0x47b8('0x3b')]?_0x2d2971['attributes']:_0x569d29[_0x47b8('0x34')];if(_0x3eaf01[_0x47b8('0x36')][_0x47b8('0x45')]){_0x2d2971[_0x47b8('0x4b')]=[{'all':!![]}];}_0x2d2971=_[_0x47b8('0x41')]({},_0x2d2971,_0x3eaf01[_0x47b8('0x4c')]);return db[_0x47b8('0x44')]['find'](_0x2d2971)[_0x47b8('0x28')](handleEntityNotFound(_0x15b9a1,null))['then'](respondWithResult(_0x15b9a1,null))[_0x47b8('0x48')](handleError(_0x15b9a1,null));};exports[_0x47b8('0x4d')]=function(_0x4a46eb,_0x132e9a){return db[_0x47b8('0x44')][_0x47b8('0x4d')](_0x4a46eb[_0x47b8('0x4e')],{})[_0x47b8('0x28')](respondWithResult(_0x132e9a,0xc9))[_0x47b8('0x48')](handleError(_0x132e9a,null));};exports[_0x47b8('0x4f')]=function(_0x381d3a,_0x4ad8a8){if(_0x381d3a[_0x47b8('0x4e')]['id']){delete _0x381d3a[_0x47b8('0x4e')]['id'];}return db[_0x47b8('0x44')]['find']({'where':{'id':_0x381d3a[_0x47b8('0x4a')]['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x4ad8a8,null))[_0x47b8('0x28')](saveUpdates(_0x381d3a[_0x47b8('0x4e')],null))['then'](respondWithResult(_0x4ad8a8,null))[_0x47b8('0x48')](handleError(_0x4ad8a8,null));};exports[_0x47b8('0x29')]=function(_0x51ac62,_0x270054){return db[_0x47b8('0x44')][_0x47b8('0x50')]({'where':{'id':_0x51ac62['params']['id']}})[_0x47b8('0x28')](handleEntityNotFound(_0x270054,null))['then'](removeEntity(_0x270054,null))[_0x47b8('0x48')](handleError(_0x270054,null));};exports['describe']=function(_0x2a03c2,_0x498512){return db[_0x47b8('0x44')][_0x47b8('0x51')]()[_0x47b8('0x28')](respondWithResult(_0x498512,null))[_0x47b8('0x48')](handleError(_0x498512,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(_0x290df2,_0x2ff46d){var _0x2db4dd=function(_0x8aba30){while(--_0x8aba30){_0x290df2['push'](_0x290df2['shift']());}};_0x2db4dd(++_0x2ff46d);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4f9b35,_0x14d869){_0x4f9b35=_0x4f9b35-0x0;var _0x243002=_0xc1c6[_0x4f9b35];return _0x243002;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['MailQueueReport']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['MailQueueReport'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['MailQueueReport']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['MailQueueReport'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 5131433..d675758 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 _0x256e=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x10c4d6,_0x1cd56c){var _0x3a4a5f=function(_0x18c39f){while(--_0x18c39f){_0x10c4d6['push'](_0x10c4d6['shift']());}};_0x3a4a5f(++_0x1cd56c);}(_0x256e,0x105));var _0xe256=function(_0x427b91,_0x2ea30f){_0x427b91=_0x427b91-0x0;var _0x31d379=_0x256e[_0x427b91];return _0x31d379;};'use strict';var _=require(_0xe256('0x0'));var util=require(_0xe256('0x1'));var logger=require(_0xe256('0x2'))(_0xe256('0x3'));var moment=require('moment');var BPromise=require(_0xe256('0x4'));var rp=require(_0xe256('0x5'));var fs=require('fs');var path=require(_0xe256('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe256('0x7'));module[_0xe256('0x8')]=function(_0x288393,_0x1e6928){return _0x288393[_0xe256('0x9')](_0xe256('0xa'),attributes,{'tableName':_0xe256('0xb'),'paranoid':![],'indexes':[{'name':_0xe256('0xc'),'fields':[_0xe256('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd3e7=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','lodash'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xd3e7,0xe3));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x7d3e('0x0'));var util=require('util');var logger=require(_0x7d3e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7d3e('0x2'));var rp=require(_0x7d3e('0x3'));var fs=require('fs');var path=require(_0x7d3e('0x4'));var rimraf=require(_0x7d3e('0x5'));var config=require(_0x7d3e('0x6'));var attributes=require(_0x7d3e('0x7'));module[_0x7d3e('0x8')]=function(_0x155c51,_0x506bf){return _0x155c51[_0x7d3e('0x9')](_0x7d3e('0xa'),attributes,{'tableName':_0x7d3e('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index dcd2590..89164c4 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3cfbec,_0x15c105){var _0x41116e=function(_0x577550){while(--_0x577550){_0x3cfbec['push'](_0x3cfbec['shift']());}};_0x41116e(++_0x15c105);}(_0xadb5,0xad));var _0x5adb=function(_0x56d0f8,_0x42a4db){_0x56d0f8=_0x56d0f8-0x0;var _0x413416=_0xadb5[_0x56d0f8];return _0x413416;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x339ab4,_0x192626){var _0x1da7ca=function(_0x2ab7bd){while(--_0x2ab7bd){_0x339ab4['push'](_0x339ab4['shift']());}};_0x1da7ca(++_0x192626);}(_0x7a54,0x106));var _0x47a5=function(_0x1473d5,_0x5cbde8){_0x1473d5=_0x1473d5-0x0;var _0x5ea5e8=_0x7a54[_0x1473d5];return _0x5ea5e8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 389f0ca..08c73d3 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5d014a,_0x4aba87){var _0x5d05da=function(_0x208f3b){while(--_0x208f3b){_0x5d014a['push'](_0x5d014a['shift']());}};_0x5d05da(++_0x4aba87);}(_0x70e0,0x17b));var _0x070e=function(_0x587c72,_0xeab0a0){_0x587c72=_0x587c72-0x0;var _0x477474=_0x70e0[_0x587c72];return _0x477474;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4869c0,_0x1a6fa2){var _0x519b1c=function(_0xaa69c9){while(--_0xaa69c9){_0x4869c0['push'](_0x4869c0['shift']());}};_0x519b1c(++_0x1a6fa2);}(_0xe706,0xa3));var _0x6e70=function(_0x4c10fe,_0x19e0b2){_0x4c10fe=_0x4c10fe-0x0;var _0x5d4ffe=_0xe706[_0x4c10fe];return _0x5d4ffe;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index ea6e461..d44fd19 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 _0x0ae9=['INBOX','sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0x0ae9,0x105));var _0x90ae=function(_0x6752b9,_0x1e20d8){_0x6752b9=_0x6752b9-0x0;var _0x1382ac=_0x0ae9[_0x6752b9];return _0x1382ac;};'use strict';var Sequelize=require(_0x90ae('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x90ae('0x1')]},'authentication':{'type':Sequelize[_0x90ae('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x90ae('0x1')]},'password':{'type':Sequelize[_0x90ae('0x1')]},'port':{'type':Sequelize[_0x90ae('0x3')]},'tls':{'type':Sequelize[_0x90ae('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x90ae('0x1')],'defaultValue':_0x90ae('0x4')},'connTimeout':{'type':Sequelize[_0x90ae('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x90ae('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x90ae('0x1')]},'modernAuthentication':{'type':Sequelize[_0x90ae('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x17c9=['BOOLEAN','INBOX','INTEGER','exports','STRING'];(function(_0x42f2a5,_0x3fd9a3){var _0x56d5b6=function(_0x53e87b){while(--_0x53e87b){_0x42f2a5['push'](_0x42f2a5['shift']());}};_0x56d5b6(++_0x3fd9a3);}(_0x17c9,0xee));var _0x917c=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x17c9[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require('sequelize');module[_0x917c('0x0')]={'description':{'type':Sequelize[_0x917c('0x1')]},'host':{'type':Sequelize[_0x917c('0x1')]},'authentication':{'type':Sequelize[_0x917c('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x917c('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x917c('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x917c('0x1')],'defaultValue':_0x917c('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x917c('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x917c('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index f255665..f99e6f3 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 _0xe44e=['api','moment','path','./mailServerIn.attributes','MailServerIn','mail_servers_in','lodash'];(function(_0x508bcf,_0x26d03d){var _0x386240=function(_0x7a6f08){while(--_0x7a6f08){_0x508bcf['push'](_0x508bcf['shift']());}};_0x386240(++_0x26d03d);}(_0xe44e,0x18e));var _0xee44=function(_0x144349,_0x2e2512){_0x144349=_0x144349-0x0;var _0x52bb84=_0xe44e[_0x144349];return _0x52bb84;};'use strict';var _=require(_0xee44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee44('0x1'));var moment=require(_0xee44('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee44('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xee44('0x4'));module['exports']=function(_0xfa122f,_0x36d9a7){return _0xfa122f['define'](_0xee44('0x5'),attributes,{'tableName':_0xee44('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa520=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','../../config/logger','api'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0xa520,0x19d));var _0x0a52=function(_0x2f275b,_0x4ee0ab){_0x2f275b=_0x2f275b-0x0;var _0x3c2c76=_0xa520[_0x2f275b];return _0x3c2c76;};'use strict';var _=require(_0x0a52('0x0'));var util=require('util');var logger=require(_0x0a52('0x1'))(_0x0a52('0x2'));var moment=require(_0x0a52('0x3'));var BPromise=require(_0x0a52('0x4'));var rp=require(_0x0a52('0x5'));var fs=require('fs');var path=require(_0x0a52('0x6'));var rimraf=require(_0x0a52('0x7'));var config=require(_0x0a52('0x8'));var attributes=require(_0x0a52('0x9'));module[_0x0a52('0xa')]=function(_0x2c6614,_0x517bed){return _0x2c6614[_0x0a52('0xb')](_0x0a52('0xc'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 4874a89..7a7c242 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 _0x928c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','limit','include','model','attributes','map','debug','stringify','moment'];(function(_0x39792c,_0x68ed5f){var _0x2657c1=function(_0x2ff0af){while(--_0x2ff0af){_0x39792c['push'](_0x39792c['shift']());}};_0x2657c1(++_0x68ed5f);}(_0x928c,0x17f));var _0xc928=function(_0x2df386,_0x44a917){_0x2df386=_0x2df386-0x0;var _0x46862a=_0x928c[_0x2df386];return _0x46862a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc928('0x0'));var BPromise=require(_0xc928('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc928('0x2'));var db=require(_0xc928('0x3'))['db'];var utils=require(_0xc928('0x4'));var logger=require(_0xc928('0x5'))(_0xc928('0x6'));var config=require('../../config/environment');var jayson=require(_0xc928('0x7'));var client=jayson[_0xc928('0x8')][_0xc928('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ff9e6,_0x4fd2a0,_0x5e433b){return new BPromise(function(_0x445248,_0x4270ab){return client[_0xc928('0xa')](_0x4ff9e6,_0x5e433b)[_0xc928('0xb')](function(_0x421f1b){logger[_0xc928('0xc')](_0xc928('0xd'),_0x4fd2a0,_0xc928('0xe'));logger['debug'](_0xc928('0xf'),_0x4fd2a0,_0xc928('0xe'),JSON['stringify'](_0x421f1b));if(_0x421f1b['error']){if(_0x421f1b[_0xc928('0x10')]['code']===0x1f4){logger[_0xc928('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4fd2a0,_0x421f1b[_0xc928('0x10')][_0xc928('0x11')]);return _0x4270ab(_0x421f1b['error'][_0xc928('0x11')]);}logger[_0xc928('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4fd2a0,_0x421f1b[_0xc928('0x10')][_0xc928('0x11')]);return _0x445248(_0x421f1b[_0xc928('0x10')][_0xc928('0x11')]);}else{logger[_0xc928('0xc')](_0xc928('0xd'),_0x4fd2a0,'request\x20sent');_0x445248(_0x421f1b[_0xc928('0x12')][_0xc928('0x11')]);}})[_0xc928('0x13')](function(_0x6cc463){logger[_0xc928('0x10')](_0xc928('0xd'),_0x4fd2a0,_0x6cc463);_0x4270ab(_0x6cc463);});});}exports[_0xc928('0x14')]=function(_0x3206ae){var _0x3f858d=this;return new Promise(function(_0x456dc3,_0x16485d){return db[_0xc928('0x15')]['findAll']({'raw':_0x3206ae[_0xc928('0x16')]?_0x3206ae[_0xc928('0x16')][_0xc928('0x17')]===undefined?!![]:![]:!![],'where':_0x3206ae[_0xc928('0x16')]?_0x3206ae['options'][_0xc928('0x18')]||null:null,'attributes':_0x3206ae[_0xc928('0x16')]?_0x3206ae[_0xc928('0x16')]['attributes']||null:null,'limit':_0x3206ae['options']?_0x3206ae[_0xc928('0x16')][_0xc928('0x19')]||null:null,'include':_0x3206ae[_0xc928('0x16')]?_0x3206ae[_0xc928('0x16')]['include']?_['map'](_0x3206ae[_0xc928('0x16')][_0xc928('0x1a')],function(_0x3ce74d){return{'model':db[_0x3ce74d[_0xc928('0x1b')]],'as':_0x3ce74d['as'],'attributes':_0x3ce74d[_0xc928('0x1c')],'include':_0x3ce74d['include']?_[_0xc928('0x1d')](_0x3ce74d[_0xc928('0x1a')],function(_0x2ac3c7){return{'model':db[_0x2ac3c7['model']],'as':_0x2ac3c7['as'],'attributes':_0x2ac3c7['attributes'],'include':_0x2ac3c7[_0xc928('0x1a')]?_[_0xc928('0x1d')](_0x2ac3c7['include'],function(_0x3d8f30){return{'model':db[_0x3d8f30[_0xc928('0x1b')]],'as':_0x3d8f30['as'],'attributes':_0x3d8f30[_0xc928('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc928('0xb')](function(_0x58b20b){logger[_0xc928('0xc')](_0xc928('0x14'),_0x3206ae);logger[_0xc928('0x1e')](_0xc928('0x14'),_0x3206ae,JSON[_0xc928('0x1f')](_0x58b20b));_0x456dc3(_0x58b20b);})[_0xc928('0x13')](function(_0x9deef4){logger[_0xc928('0x10')](_0xc928('0x14'),_0x9deef4[_0xc928('0x11')],_0x3206ae);_0x16485d(_0x3f858d[_0xc928('0x10')](0x1f4,_0x9deef4[_0xc928('0x11')]));});});}; \ No newline at end of file +var _0x49f2=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','map','model','lodash','util'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0x49f2,0x86));var _0x249f=function(_0x2bd8fd,_0x3e4ce3){_0x2bd8fd=_0x2bd8fd-0x0;var _0x10c92a=_0x49f2[_0x2bd8fd];return _0x10c92a;};'use strict';var _=require(_0x249f('0x0'));var util=require(_0x249f('0x1'));var moment=require(_0x249f('0x2'));var BPromise=require('bluebird');var rs=require(_0x249f('0x3'));var fs=require('fs');var Redis=require(_0x249f('0x4'));var db=require(_0x249f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x249f('0x6'))(_0x249f('0x7'));var config=require(_0x249f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x249f('0x9')][_0x249f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4308ec,_0x47b9c4,_0x50dc6b){return new BPromise(function(_0x2d81e8,_0x3d266d){return client[_0x249f('0xb')](_0x4308ec,_0x50dc6b)[_0x249f('0xc')](function(_0x5a9eb8){logger[_0x249f('0xd')]('MailServerIn,\x20%s,\x20%s',_0x47b9c4,_0x249f('0xe'));logger[_0x249f('0xf')](_0x249f('0x10'),_0x47b9c4,_0x249f('0xe'),JSON[_0x249f('0x11')](_0x5a9eb8));if(_0x5a9eb8[_0x249f('0x12')]){if(_0x5a9eb8[_0x249f('0x12')][_0x249f('0x13')]===0x1f4){logger['error'](_0x249f('0x14'),_0x47b9c4,_0x5a9eb8['error']['message']);return _0x3d266d(_0x5a9eb8[_0x249f('0x12')][_0x249f('0x15')]);}logger[_0x249f('0x12')](_0x249f('0x14'),_0x47b9c4,_0x5a9eb8[_0x249f('0x12')][_0x249f('0x15')]);return _0x2d81e8(_0x5a9eb8[_0x249f('0x12')][_0x249f('0x15')]);}else{logger[_0x249f('0xd')](_0x249f('0x14'),_0x47b9c4,_0x249f('0xe'));_0x2d81e8(_0x5a9eb8[_0x249f('0x16')][_0x249f('0x15')]);}})[_0x249f('0x17')](function(_0x527f64){logger[_0x249f('0x12')](_0x249f('0x14'),_0x47b9c4,_0x527f64);_0x3d266d(_0x527f64);});});}exports[_0x249f('0x18')]=function(_0x392ed3){var _0x5e6395=this;return new Promise(function(_0x3820c5,_0x4f61b9){return db[_0x249f('0x19')]['findAll']({'raw':_0x392ed3[_0x249f('0x1a')]?_0x392ed3['options'][_0x249f('0x1b')]===undefined?!![]:![]:!![],'where':_0x392ed3['options']?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1c')]||null:null,'attributes':_0x392ed3[_0x249f('0x1a')]?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1d')]||null:null,'limit':_0x392ed3[_0x249f('0x1a')]?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1e')]||null:null,'include':_0x392ed3['options']?_0x392ed3[_0x249f('0x1a')][_0x249f('0x1f')]?_[_0x249f('0x20')](_0x392ed3[_0x249f('0x1a')]['include'],function(_0x5ebdd1){return{'model':db[_0x5ebdd1[_0x249f('0x21')]],'as':_0x5ebdd1['as'],'attributes':_0x5ebdd1['attributes'],'include':_0x5ebdd1[_0x249f('0x1f')]?_[_0x249f('0x20')](_0x5ebdd1['include'],function(_0x1f1ca3){return{'model':db[_0x1f1ca3[_0x249f('0x21')]],'as':_0x1f1ca3['as'],'attributes':_0x1f1ca3[_0x249f('0x1d')],'include':_0x1f1ca3['include']?_[_0x249f('0x20')](_0x1f1ca3[_0x249f('0x1f')],function(_0x4f2d8a){return{'model':db[_0x4f2d8a[_0x249f('0x21')]],'as':_0x4f2d8a['as'],'attributes':_0x4f2d8a[_0x249f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x249f('0xc')](function(_0x3de798){logger[_0x249f('0xd')](_0x249f('0x18'),_0x392ed3);logger[_0x249f('0xf')](_0x249f('0x18'),_0x392ed3,JSON[_0x249f('0x11')](_0x3de798));_0x3820c5(_0x3de798);})[_0x249f('0x17')](function(_0xfa7e9f){logger[_0x249f('0x12')](_0x249f('0x18'),_0xfa7e9f[_0x249f('0x15')],_0x392ed3);_0x4f61b9(_0x5e6395[_0x249f('0x12')](0x1f4,_0xfa7e9f[_0x249f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 0e6acd5..2fe5399 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index dec2261..3211121 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 _0x0abf=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x2bc270,_0x5041bd){var _0x3b2ff6=function(_0x50849c){while(--_0x50849c){_0x2bc270['push'](_0x2bc270['shift']());}};_0x3b2ff6(++_0x5041bd);}(_0x0abf,0xe8));var _0xf0ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0abf[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'description':{'type':Sequelize[_0xf0ab('0x1')]},'host':{'type':Sequelize[_0xf0ab('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf0ab('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xf0ab('0x1')]},'authentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7072=['exports','STRING','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7072,0x138));var _0x2707=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x7072[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'description':{'type':Sequelize[_0x2707('0x1')]},'host':{'type':Sequelize[_0x2707('0x1')]},'user':{'type':Sequelize[_0x2707('0x1')]},'pass':{'type':Sequelize[_0x2707('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x2707('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2707('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 74a0f68..063764b 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 _0x8305=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','then','destroy','error','stack','name','send','index','map','MailServerOut','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','find','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4cba05,_0x403f45){var _0x262468=function(_0x27ff63){while(--_0x27ff63){_0x4cba05['push'](_0x4cba05['shift']());}};_0x262468(++_0x403f45);}(_0x8305,0xbf));var _0x5830=function(_0x49584d,_0x1ec19d){_0x49584d=_0x49584d-0x0;var _0x1959db=_0x8305[_0x49584d];return _0x1959db;};'use strict';var emlformat=require(_0x5830('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5830('0x1'));var jsonpatch=require(_0x5830('0x2'));var rp=require(_0x5830('0x3'));var moment=require(_0x5830('0x4'));var BPromise=require(_0x5830('0x5'));var Mustache=require(_0x5830('0x6'));var util=require(_0x5830('0x7'));var path=require(_0x5830('0x8'));var sox=require(_0x5830('0x9'));var csv=require(_0x5830('0xa'));var ejs=require(_0x5830('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5830('0xc'));var crypto=require('crypto');var jsforce=require(_0x5830('0xd'));var deskjs=require(_0x5830('0xe'));var toCsv=require(_0x5830('0xa'));var querystring=require('querystring');var Papa=require(_0x5830('0xf'));var Redis=require(_0x5830('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5830('0x11'));var as=require(_0x5830('0x12'));var hardwareService=require(_0x5830('0x13'));var logger=require(_0x5830('0x14'))(_0x5830('0x15'));var utils=require('../../config/utils');var config=require(_0x5830('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5830('0x17'))['db'];function respondWithStatusCode(_0x24a5fb,_0x218f6b){_0x218f6b=_0x218f6b||0xcc;return function(_0x1ddec7){if(_0x1ddec7){return _0x24a5fb[_0x5830('0x18')](_0x218f6b);}return _0x24a5fb[_0x5830('0x19')](_0x218f6b)[_0x5830('0x1a')]();};}function respondWithResult(_0x15f186,_0xecdd02){_0xecdd02=_0xecdd02||0xc8;return function(_0x8c7b30){if(_0x8c7b30){return _0x15f186[_0x5830('0x19')](_0xecdd02)[_0x5830('0x1b')](_0x8c7b30);}};}function respondWithFilteredResult(_0x3fcc94,_0x4c8598){return function(_0x5c4b1a){if(_0x5c4b1a){var _0x24a00c=typeof _0x4c8598[_0x5830('0x1c')]===_0x5830('0x1d')&&typeof _0x4c8598[_0x5830('0x1e')]==='undefined';var _0x298bfb=_0x5c4b1a[_0x5830('0x1f')];var _0x5e0a52=_0x24a00c?0x0:_0x4c8598[_0x5830('0x1c')];var _0x20483d=_0x24a00c?_0x5c4b1a[_0x5830('0x1f')]:_0x4c8598[_0x5830('0x1c')]+_0x4c8598['limit'];var _0x42f9d2;if(_0x20483d>=_0x298bfb){_0x20483d=_0x298bfb;_0x42f9d2=0xc8;}else{_0x42f9d2=0xce;}_0x3fcc94[_0x5830('0x19')](_0x42f9d2);return _0x3fcc94[_0x5830('0x20')]('Content-Range',_0x5e0a52+'-'+_0x20483d+'/'+_0x298bfb)[_0x5830('0x1b')](_0x5c4b1a);}return null;};}function patchUpdates(_0x1d2f1c){return function(_0x5b28f5){try{jsonpatch['apply'](_0x5b28f5,_0x1d2f1c,!![]);}catch(_0x1327a5){return BPromise[_0x5830('0x21')](_0x1327a5);}return _0x5b28f5['save']();};}function saveUpdates(_0xf16bb2,_0x2a1a3e){return function(_0x3b1bb2){if(_0x3b1bb2){return _0x3b1bb2['update'](_0xf16bb2)[_0x5830('0x22')](function(_0x4f99eb){return _0x4f99eb;});}return null;};}function removeEntity(_0x429071,_0x3729b9){return function(_0x1a176f){if(_0x1a176f){return _0x1a176f[_0x5830('0x23')]()['then'](function(){_0x429071[_0x5830('0x19')](0xcc)[_0x5830('0x1a')]();});}};}function handleEntityNotFound(_0x492712,_0x59bd1a){return function(_0x229795){if(!_0x229795){_0x492712['sendStatus'](0x194);}return _0x229795;};}function handleError(_0x5ac6fe,_0x167cec){_0x167cec=_0x167cec||0x1f4;return function(_0x5ca2c2){logger[_0x5830('0x24')](_0x5ca2c2[_0x5830('0x25')]);if(_0x5ca2c2[_0x5830('0x26')]){delete _0x5ca2c2[_0x5830('0x26')];}_0x5ac6fe[_0x5830('0x19')](_0x167cec)[_0x5830('0x27')](_0x5ca2c2);};}exports[_0x5830('0x28')]=function(_0x19771d,_0x6916da){var _0x3cb48c={},_0x1247fe={},_0x3b4b0c={'count':0x0,'rows':[]};var _0x4423cc=_[_0x5830('0x29')](db[_0x5830('0x2a')]['rawAttributes'],function(_0x6d8d92){return{'name':_0x6d8d92['fieldName'],'type':_0x6d8d92[_0x5830('0x2b')]['key']};});_0x1247fe[_0x5830('0x2c')]=_['map'](_0x4423cc,'name');_0x1247fe[_0x5830('0x2d')]=_[_0x5830('0x2e')](_0x19771d['query']);_0x1247fe[_0x5830('0x2f')]=_[_0x5830('0x30')](_0x1247fe[_0x5830('0x2c')],_0x1247fe[_0x5830('0x2d')]);_0x3cb48c['attributes']=_[_0x5830('0x30')](_0x1247fe[_0x5830('0x2c')],qs[_0x5830('0x31')](_0x19771d[_0x5830('0x2d')][_0x5830('0x31')]));_0x3cb48c[_0x5830('0x32')]=_0x3cb48c[_0x5830('0x32')][_0x5830('0x33')]?_0x3cb48c[_0x5830('0x32')]:_0x1247fe['model'];if(!_0x19771d[_0x5830('0x2d')][_0x5830('0x34')](_0x5830('0x35'))){_0x3cb48c[_0x5830('0x1e')]=qs[_0x5830('0x1e')](_0x19771d[_0x5830('0x2d')][_0x5830('0x1e')]);_0x3cb48c[_0x5830('0x1c')]=qs['offset'](_0x19771d[_0x5830('0x2d')][_0x5830('0x1c')]);}_0x3cb48c[_0x5830('0x36')]=qs[_0x5830('0x37')](_0x19771d[_0x5830('0x2d')][_0x5830('0x37')]);_0x3cb48c['where']=qs[_0x5830('0x2f')](_['pick'](_0x19771d[_0x5830('0x2d')],_0x1247fe['filters']),_0x4423cc);if(_0x19771d['query'][_0x5830('0x38')]){_0x3cb48c['where']=_['merge'](_0x3cb48c[_0x5830('0x39')],{'$or':_['map'](_0x4423cc,function(_0x182bc8){if(_0x182bc8[_0x5830('0x2b')]!=='VIRTUAL'){var _0x3bf0c4={};_0x3bf0c4[_0x182bc8[_0x5830('0x26')]]={'$like':'%'+_0x19771d[_0x5830('0x2d')][_0x5830('0x38')]+'%'};return _0x3bf0c4;}})});}_0x3cb48c=_[_0x5830('0x3a')]({},_0x3cb48c,_0x19771d[_0x5830('0x3b')]);var _0x31882d={'where':_0x3cb48c['where']};return db['MailServerOut'][_0x5830('0x1f')](_0x31882d)[_0x5830('0x22')](function(_0x3d4016){_0x3b4b0c['count']=_0x3d4016;if(_0x19771d[_0x5830('0x2d')][_0x5830('0x3c')]){_0x3cb48c[_0x5830('0x3d')]=[{'all':!![]}];}return db[_0x5830('0x2a')][_0x5830('0x3e')](_0x3cb48c);})[_0x5830('0x22')](function(_0x1a6760){_0x3b4b0c[_0x5830('0x3f')]=_0x1a6760;return _0x3b4b0c;})[_0x5830('0x22')](respondWithFilteredResult(_0x6916da,_0x3cb48c))[_0x5830('0x40')](handleError(_0x6916da,null));};exports['show']=function(_0x352f09,_0x5efec7){var _0x96d0b0={'raw':!![],'where':{'id':_0x352f09['params']['id']}},_0x3ab6dd={};_0x3ab6dd[_0x5830('0x2c')]=_['keys'](db['MailServerOut']['rawAttributes']);_0x3ab6dd[_0x5830('0x2d')]=_[_0x5830('0x2e')](_0x352f09[_0x5830('0x2d')]);_0x3ab6dd[_0x5830('0x2f')]=_[_0x5830('0x30')](_0x3ab6dd[_0x5830('0x2c')],_0x3ab6dd[_0x5830('0x2d')]);_0x96d0b0[_0x5830('0x32')]=_['intersection'](_0x3ab6dd[_0x5830('0x2c')],qs[_0x5830('0x31')](_0x352f09[_0x5830('0x2d')][_0x5830('0x31')]));_0x96d0b0[_0x5830('0x32')]=_0x96d0b0[_0x5830('0x32')][_0x5830('0x33')]?_0x96d0b0['attributes']:_0x3ab6dd[_0x5830('0x2c')];if(_0x352f09[_0x5830('0x2d')]['includeAll']){_0x96d0b0[_0x5830('0x3d')]=[{'all':!![]}];}_0x96d0b0=_[_0x5830('0x3a')]({},_0x96d0b0,_0x352f09[_0x5830('0x3b')]);return db[_0x5830('0x2a')][_0x5830('0x41')](_0x96d0b0)['then'](handleEntityNotFound(_0x5efec7,null))[_0x5830('0x22')](respondWithResult(_0x5efec7,null))['catch'](handleError(_0x5efec7,null));};exports[_0x5830('0x42')]=function(_0x1f212e,_0x113b5b){return db['MailServerOut']['create'](_0x1f212e[_0x5830('0x43')],{})[_0x5830('0x22')](respondWithResult(_0x113b5b,0xc9))[_0x5830('0x40')](handleError(_0x113b5b,null));};exports[_0x5830('0x44')]=function(_0x569527,_0x5ca919){if(_0x569527[_0x5830('0x43')]['id']){delete _0x569527['body']['id'];}return db[_0x5830('0x2a')][_0x5830('0x41')]({'where':{'id':_0x569527[_0x5830('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ca919,null))[_0x5830('0x22')](saveUpdates(_0x569527[_0x5830('0x43')],null))[_0x5830('0x22')](respondWithResult(_0x5ca919,null))[_0x5830('0x40')](handleError(_0x5ca919,null));};exports[_0x5830('0x23')]=function(_0x4a5d23,_0x5101b0){return db[_0x5830('0x2a')]['find']({'where':{'id':_0x4a5d23[_0x5830('0x45')]['id']}})['then'](handleEntityNotFound(_0x5101b0,null))['then'](removeEntity(_0x5101b0,null))[_0x5830('0x40')](handleError(_0x5101b0,null));}; \ No newline at end of file +var _0x4bb9=['create','catch','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find'];(function(_0x5704b3,_0x2fde4f){var _0x594a4f=function(_0x45dbac){while(--_0x45dbac){_0x5704b3['push'](_0x5704b3['shift']());}};_0x594a4f(++_0x2fde4f);}(_0x4bb9,0xdb));var _0x94bb=function(_0x173449,_0x5dd89a){_0x173449=_0x173449-0x0;var _0x230295=_0x4bb9[_0x173449];return _0x230295;};'use strict';var emlformat=require(_0x94bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x94bb('0x1'));var jsonpatch=require(_0x94bb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x94bb('0x3'));var Mustache=require(_0x94bb('0x4'));var util=require(_0x94bb('0x5'));var path=require(_0x94bb('0x6'));var sox=require('sox');var csv=require(_0x94bb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x94bb('0x8'));var deskjs=require(_0x94bb('0x9'));var toCsv=require(_0x94bb('0x7'));var querystring=require(_0x94bb('0xa'));var Papa=require(_0x94bb('0xb'));var Redis=require(_0x94bb('0xc'));var authService=require(_0x94bb('0xd'));var qs=require(_0x94bb('0xe'));var as=require(_0x94bb('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94bb('0x10'))(_0x94bb('0x11'));var utils=require(_0x94bb('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x94bb('0x13'));var db=require(_0x94bb('0x14'))['db'];function respondWithStatusCode(_0x50b967,_0x1a2f16){_0x1a2f16=_0x1a2f16||0xcc;return function(_0x3a8bd3){if(_0x3a8bd3){return _0x50b967[_0x94bb('0x15')](_0x1a2f16);}return _0x50b967[_0x94bb('0x16')](_0x1a2f16)[_0x94bb('0x17')]();};}function respondWithResult(_0x52d805,_0x48f0b9){_0x48f0b9=_0x48f0b9||0xc8;return function(_0x44533d){if(_0x44533d){return _0x52d805[_0x94bb('0x16')](_0x48f0b9)[_0x94bb('0x18')](_0x44533d);}};}function respondWithFilteredResult(_0x2550b9,_0x175edf){return function(_0x33c5e5){if(_0x33c5e5){var _0x478941=typeof _0x175edf[_0x94bb('0x19')]===_0x94bb('0x1a')&&typeof _0x175edf[_0x94bb('0x1b')]==='undefined';var _0x54c66a=_0x33c5e5[_0x94bb('0x1c')];var _0x947b7a=_0x478941?0x0:_0x175edf[_0x94bb('0x19')];var _0x27c1f3=_0x478941?_0x33c5e5[_0x94bb('0x1c')]:_0x175edf[_0x94bb('0x19')]+_0x175edf[_0x94bb('0x1b')];var _0x10135d;if(_0x27c1f3>=_0x54c66a){_0x27c1f3=_0x54c66a;_0x10135d=0xc8;}else{_0x10135d=0xce;}_0x2550b9[_0x94bb('0x16')](_0x10135d);return _0x2550b9[_0x94bb('0x1d')](_0x94bb('0x1e'),_0x947b7a+'-'+_0x27c1f3+'/'+_0x54c66a)[_0x94bb('0x18')](_0x33c5e5);}return null;};}function patchUpdates(_0x222d83){return function(_0x2c9980){try{jsonpatch[_0x94bb('0x1f')](_0x2c9980,_0x222d83,!![]);}catch(_0x1ae645){return BPromise[_0x94bb('0x20')](_0x1ae645);}return _0x2c9980[_0x94bb('0x21')]();};}function saveUpdates(_0xaafe41,_0x5af1d3){return function(_0x1e061b){if(_0x1e061b){return _0x1e061b[_0x94bb('0x22')](_0xaafe41)[_0x94bb('0x23')](function(_0x121084){return _0x121084;});}return null;};}function removeEntity(_0x3e01ce,_0x15f7dc){return function(_0x17568b){if(_0x17568b){return _0x17568b[_0x94bb('0x24')]()['then'](function(){_0x3e01ce['status'](0xcc)[_0x94bb('0x17')]();});}};}function handleEntityNotFound(_0xe2f263,_0xc37ae8){return function(_0x426d20){if(!_0x426d20){_0xe2f263[_0x94bb('0x15')](0x194);}return _0x426d20;};}function handleError(_0x16441f,_0x264a7a){_0x264a7a=_0x264a7a||0x1f4;return function(_0x649b53){logger[_0x94bb('0x25')](_0x649b53['stack']);if(_0x649b53[_0x94bb('0x26')]){delete _0x649b53[_0x94bb('0x26')];}_0x16441f[_0x94bb('0x16')](_0x264a7a)['send'](_0x649b53);};}exports[_0x94bb('0x27')]=function(_0x1d5536,_0x1a20b4){var _0x4fb049={},_0x3757b5={},_0x423030={'count':0x0,'rows':[]};var _0x21bbd2=_['map'](db[_0x94bb('0x28')][_0x94bb('0x29')],function(_0x2f8a13){return{'name':_0x2f8a13[_0x94bb('0x2a')],'type':_0x2f8a13[_0x94bb('0x2b')][_0x94bb('0x2c')]};});_0x3757b5[_0x94bb('0x2d')]=_['map'](_0x21bbd2,_0x94bb('0x26'));_0x3757b5[_0x94bb('0x2e')]=_[_0x94bb('0x2f')](_0x1d5536['query']);_0x3757b5['filters']=_[_0x94bb('0x30')](_0x3757b5[_0x94bb('0x2d')],_0x3757b5['query']);_0x4fb049['attributes']=_['intersection'](_0x3757b5[_0x94bb('0x2d')],qs[_0x94bb('0x31')](_0x1d5536[_0x94bb('0x2e')]['fields']));_0x4fb049['attributes']=_0x4fb049[_0x94bb('0x32')][_0x94bb('0x33')]?_0x4fb049[_0x94bb('0x32')]:_0x3757b5['model'];if(!_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x34')](_0x94bb('0x35'))){_0x4fb049[_0x94bb('0x1b')]=qs[_0x94bb('0x1b')](_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x1b')]);_0x4fb049['offset']=qs[_0x94bb('0x19')](_0x1d5536[_0x94bb('0x2e')]['offset']);}_0x4fb049[_0x94bb('0x36')]=qs['sort'](_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x37')]);_0x4fb049['where']=qs[_0x94bb('0x38')](_['pick'](_0x1d5536[_0x94bb('0x2e')],_0x3757b5[_0x94bb('0x38')]),_0x21bbd2);if(_0x1d5536[_0x94bb('0x2e')]['filter']){_0x4fb049[_0x94bb('0x39')]=_[_0x94bb('0x3a')](_0x4fb049[_0x94bb('0x39')],{'$or':_[_0x94bb('0x3b')](_0x21bbd2,function(_0x3b04cf){if(_0x3b04cf[_0x94bb('0x2b')]!==_0x94bb('0x3c')){var _0x49c814={};_0x49c814[_0x3b04cf['name']]={'$like':'%'+_0x1d5536[_0x94bb('0x2e')][_0x94bb('0x3d')]+'%'};return _0x49c814;}})});}_0x4fb049=_[_0x94bb('0x3a')]({},_0x4fb049,_0x1d5536[_0x94bb('0x3e')]);var _0x2bcbce={'where':_0x4fb049[_0x94bb('0x39')]};return db[_0x94bb('0x28')][_0x94bb('0x1c')](_0x2bcbce)['then'](function(_0x4c8c80){_0x423030[_0x94bb('0x1c')]=_0x4c8c80;if(_0x1d5536['query'][_0x94bb('0x3f')]){_0x4fb049[_0x94bb('0x40')]=[{'all':!![]}];}return db[_0x94bb('0x28')][_0x94bb('0x41')](_0x4fb049);})[_0x94bb('0x23')](function(_0x51ff80){_0x423030['rows']=_0x51ff80;return _0x423030;})[_0x94bb('0x23')](respondWithFilteredResult(_0x1a20b4,_0x4fb049))['catch'](handleError(_0x1a20b4,null));};exports[_0x94bb('0x42')]=function(_0x40c8f5,_0x4b543f){var _0x71c371={'raw':!![],'where':{'id':_0x40c8f5[_0x94bb('0x43')]['id']}},_0x598e20={};_0x598e20['model']=_[_0x94bb('0x2f')](db[_0x94bb('0x28')][_0x94bb('0x29')]);_0x598e20[_0x94bb('0x2e')]=_[_0x94bb('0x2f')](_0x40c8f5[_0x94bb('0x2e')]);_0x598e20[_0x94bb('0x38')]=_['intersection'](_0x598e20[_0x94bb('0x2d')],_0x598e20[_0x94bb('0x2e')]);_0x71c371[_0x94bb('0x32')]=_[_0x94bb('0x30')](_0x598e20['model'],qs['fields'](_0x40c8f5[_0x94bb('0x2e')][_0x94bb('0x31')]));_0x71c371['attributes']=_0x71c371[_0x94bb('0x32')]['length']?_0x71c371[_0x94bb('0x32')]:_0x598e20[_0x94bb('0x2d')];if(_0x40c8f5['query'][_0x94bb('0x3f')]){_0x71c371[_0x94bb('0x40')]=[{'all':!![]}];}_0x71c371=_[_0x94bb('0x3a')]({},_0x71c371,_0x40c8f5[_0x94bb('0x3e')]);return db['MailServerOut'][_0x94bb('0x44')](_0x71c371)[_0x94bb('0x23')](handleEntityNotFound(_0x4b543f,null))[_0x94bb('0x23')](respondWithResult(_0x4b543f,null))['catch'](handleError(_0x4b543f,null));};exports[_0x94bb('0x45')]=function(_0x107596,_0x2d3555){return db[_0x94bb('0x28')][_0x94bb('0x45')](_0x107596['body'],{})[_0x94bb('0x23')](respondWithResult(_0x2d3555,0xc9))[_0x94bb('0x46')](handleError(_0x2d3555,null));};exports[_0x94bb('0x22')]=function(_0x5339cd,_0x33955f){if(_0x5339cd['body']['id']){delete _0x5339cd[_0x94bb('0x47')]['id'];}return db['MailServerOut'][_0x94bb('0x44')]({'where':{'id':_0x5339cd['params']['id']}})[_0x94bb('0x23')](handleEntityNotFound(_0x33955f,null))[_0x94bb('0x23')](saveUpdates(_0x5339cd[_0x94bb('0x47')],null))[_0x94bb('0x23')](respondWithResult(_0x33955f,null))[_0x94bb('0x46')](handleError(_0x33955f,null));};exports['destroy']=function(_0x4a98db,_0x560969){return db[_0x94bb('0x28')][_0x94bb('0x44')]({'where':{'id':_0x4a98db[_0x94bb('0x43')]['id']}})[_0x94bb('0x23')](handleEntityNotFound(_0x560969,null))['then'](removeEntity(_0x560969,null))['catch'](handleError(_0x560969,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 1b01c15..e8d38bd 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 _0xcd9e=['./mailServerOut.attributes','exports','define','mail_servers_out','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0xcd9e,0x164));var _0xecd9=function(_0x31d36d,_0x3e6cda){_0x31d36d=_0x31d36d-0x0;var _0x201d22=_0xcd9e[_0x31d36d];return _0x201d22;};'use strict';var _=require(_0xecd9('0x0'));var util=require('util');var logger=require(_0xecd9('0x1'))(_0xecd9('0x2'));var moment=require(_0xecd9('0x3'));var BPromise=require('bluebird');var rp=require(_0xecd9('0x4'));var fs=require('fs');var path=require(_0xecd9('0x5'));var rimraf=require(_0xecd9('0x6'));var config=require('../../config/environment');var attributes=require(_0xecd9('0x7'));module[_0xecd9('0x8')]=function(_0x9f8629,_0x550a8){return _0x9f8629[_0xecd9('0x9')]('MailServerOut',attributes,{'tableName':_0xecd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7c2=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','api','moment','bluebird','request-promise','path'];(function(_0x4862f4,_0xe6f851){var _0x18137e=function(_0x1d09b4){while(--_0x1d09b4){_0x4862f4['push'](_0x4862f4['shift']());}};_0x18137e(++_0xe6f851);}(_0xb7c2,0x1f3));var _0x2b7c=function(_0x3ac4be,_0x3a7c54){_0x3ac4be=_0x3ac4be-0x0;var _0x2ed804=_0xb7c2[_0x3ac4be];return _0x2ed804;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2b7c('0x0'));var moment=require(_0x2b7c('0x1'));var BPromise=require(_0x2b7c('0x2'));var rp=require(_0x2b7c('0x3'));var fs=require('fs');var path=require(_0x2b7c('0x4'));var rimraf=require(_0x2b7c('0x5'));var config=require(_0x2b7c('0x6'));var attributes=require(_0x2b7c('0x7'));module[_0x2b7c('0x8')]=function(_0x294f6c,_0x3aaba3){return _0x294f6c[_0x2b7c('0x9')](_0x2b7c('0xa'),attributes,{'tableName':_0x2b7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 38e6b20..1d48d50 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2c7530,_0x4fdd68){var _0x20ed3c=function(_0x242175){while(--_0x242175){_0x2c7530['push'](_0x2c7530['shift']());}};_0x20ed3c(++_0x4fdd68);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d20c8,_0x28d948){_0x4d20c8=_0x4d20c8-0x0;var _0x324c4d=_0x5f2f[_0x4d20c8];return _0x324c4d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x1a14c4,_0x2dabb0){var _0x2a407d=function(_0xb655c0){while(--_0xb655c0){_0x1a14c4['push'](_0x1a14c4['shift']());}};_0x2a407d(++_0x2dabb0);}(_0x2ef3,0xba));var _0x32ef=function(_0x546237,_0x441eae){_0x546237=_0x546237-0x0;var _0x5e351d=_0x2ef3[_0x546237];return _0x5e351d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index e8202b2..d859b57 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 _0x9fd8=['update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show','post','put'];(function(_0x1c1501,_0x14f4a6){var _0x4bebd6=function(_0x3ce79f){while(--_0x3ce79f){_0x1c1501['push'](_0x1c1501['shift']());}};_0x4bebd6(++_0x14f4a6);}(_0x9fd8,0x12f));var _0x89fd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9fd8[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x89fd('0x0'));var path=require(_0x89fd('0x1'));var timeout=require('connect-timeout');var express=require(_0x89fd('0x2'));var router=express[_0x89fd('0x3')]();var fs_extra=require(_0x89fd('0x4'));var auth=require(_0x89fd('0x5'));var interaction=require(_0x89fd('0x6'));var config=require(_0x89fd('0x7'));var controller=require(_0x89fd('0x8'));router[_0x89fd('0x9')]('/',auth[_0x89fd('0xa')](),controller[_0x89fd('0xb')]);router['get'](_0x89fd('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x89fd('0x9')](_0x89fd('0xd'),auth['isAuthenticated'](),controller[_0x89fd('0xe')]);router[_0x89fd('0xf')]('/',auth[_0x89fd('0xa')](),controller['create']);router[_0x89fd('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x89fd('0x11')]);router[_0x89fd('0x12')]('/:id',auth[_0x89fd('0xa')](),controller[_0x89fd('0x13')]);module['exports']=router; \ No newline at end of file +var _0x596f=['get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x596f,0x64));var _0xf596=function(_0x337970,_0x591854){_0x337970=_0x337970-0x0;var _0x164d62=_0x596f[_0x337970];return _0x164d62;};'use strict';var multer=require(_0xf596('0x0'));var util=require(_0xf596('0x1'));var path=require(_0xf596('0x2'));var timeout=require(_0xf596('0x3'));var express=require(_0xf596('0x4'));var router=express[_0xf596('0x5')]();var fs_extra=require(_0xf596('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf596('0x7'));var config=require(_0xf596('0x8'));var controller=require(_0xf596('0x9'));router[_0xf596('0xa')]('/',auth[_0xf596('0xb')](),controller[_0xf596('0xc')]);router[_0xf596('0xa')](_0xf596('0xd'),auth[_0xf596('0xb')](),controller[_0xf596('0xe')]);router['get'](_0xf596('0xf'),auth[_0xf596('0xb')](),controller[_0xf596('0x10')]);router['post']('/',auth[_0xf596('0xb')](),controller[_0xf596('0x11')]);router[_0xf596('0x12')](_0xf596('0xf'),auth[_0xf596('0xb')](),controller[_0xf596('0x13')]);router[_0xf596('0x14')](_0xf596('0xf'),auth[_0xf596('0xb')](),controller['destroy']);module[_0xf596('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 7066032..108716d 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 _0x02a7=['exports','STRING'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x02a7,0x7a));var _0x702a=function(_0x73495b,_0x20b4ca){_0x73495b=_0x73495b-0x0;var _0x49d548=_0x02a7[_0x73495b];return _0x49d548;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x702a('0x1')]}}; \ No newline at end of file +var _0xdbb1=['STRING','sequelize'];(function(_0xd9eb0c,_0x242300){var _0x2371c3=function(_0x5b999e){while(--_0x5b999e){_0xd9eb0c['push'](_0xd9eb0c['shift']());}};_0x2371c3(++_0x242300);}(_0xdbb1,0x105));var _0x1dbb=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xdbb1[_0x10004e];return _0x5af990;};'use strict';var Sequelize=require(_0x1dbb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1dbb('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 5659303..081c66b 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 _0x7e19=['destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x236c67,_0x28b77e){var _0x19e4fb=function(_0x7cffa2){while(--_0x7cffa2){_0x236c67['push'](_0x236c67['shift']());}};_0x19e4fb(++_0x28b77e);}(_0x7e19,0x76));var _0x97e1=function(_0x332bba,_0x5616ba){_0x332bba=_0x332bba-0x0;var _0x40747e=_0x7e19[_0x332bba];return _0x40747e;};'use strict';var emlformat=require(_0x97e1('0x0'));var rimraf=require(_0x97e1('0x1'));var zipdir=require(_0x97e1('0x2'));var jsonpatch=require(_0x97e1('0x3'));var rp=require('request-promise');var moment=require(_0x97e1('0x4'));var BPromise=require(_0x97e1('0x5'));var Mustache=require(_0x97e1('0x6'));var util=require(_0x97e1('0x7'));var path=require(_0x97e1('0x8'));var sox=require(_0x97e1('0x9'));var csv=require(_0x97e1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97e1('0xb'));var _=require(_0x97e1('0xc'));var squel=require(_0x97e1('0xd'));var crypto=require(_0x97e1('0xe'));var jsforce=require(_0x97e1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x97e1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97e1('0x10'));var qs=require(_0x97e1('0x11'));var as=require(_0x97e1('0x12'));var hardwareService=require(_0x97e1('0x13'));var logger=require(_0x97e1('0x14'))('api');var utils=require(_0x97e1('0x15'));var config=require(_0x97e1('0x16'));var licenseUtil=require(_0x97e1('0x17'));var db=require(_0x97e1('0x18'))['db'];function respondWithStatusCode(_0x522bdc,_0x5c2f14){_0x5c2f14=_0x5c2f14||0xcc;return function(_0x4f0aa6){if(_0x4f0aa6){return _0x522bdc[_0x97e1('0x19')](_0x5c2f14);}return _0x522bdc[_0x97e1('0x1a')](_0x5c2f14)[_0x97e1('0x1b')]();};}function respondWithResult(_0x1b5f2a,_0x5c13ac){_0x5c13ac=_0x5c13ac||0xc8;return function(_0x41dce6){if(_0x41dce6){return _0x1b5f2a[_0x97e1('0x1a')](_0x5c13ac)[_0x97e1('0x1c')](_0x41dce6);}};}function respondWithFilteredResult(_0x21ad6b,_0x519a4d){return function(_0x3a1dc1){if(_0x3a1dc1){var _0x39edf5=typeof _0x519a4d[_0x97e1('0x1d')]===_0x97e1('0x1e')&&typeof _0x519a4d['limit']===_0x97e1('0x1e');var _0x3c7f24=_0x3a1dc1[_0x97e1('0x1f')];var _0x5344b5=_0x39edf5?0x0:_0x519a4d[_0x97e1('0x1d')];var _0x11e145=_0x39edf5?_0x3a1dc1[_0x97e1('0x1f')]:_0x519a4d['offset']+_0x519a4d[_0x97e1('0x20')];var _0x2b1a7d;if(_0x11e145>=_0x3c7f24){_0x11e145=_0x3c7f24;_0x2b1a7d=0xc8;}else{_0x2b1a7d=0xce;}_0x21ad6b[_0x97e1('0x1a')](_0x2b1a7d);return _0x21ad6b[_0x97e1('0x21')](_0x97e1('0x22'),_0x5344b5+'-'+_0x11e145+'/'+_0x3c7f24)[_0x97e1('0x1c')](_0x3a1dc1);}return null;};}function patchUpdates(_0x15c616){return function(_0x2ac5c2){try{jsonpatch[_0x97e1('0x23')](_0x2ac5c2,_0x15c616,!![]);}catch(_0x2dcdc3){return BPromise[_0x97e1('0x24')](_0x2dcdc3);}return _0x2ac5c2[_0x97e1('0x25')]();};}function saveUpdates(_0x1e4fee,_0x2c247d){return function(_0x555930){if(_0x555930){return _0x555930[_0x97e1('0x26')](_0x1e4fee)[_0x97e1('0x27')](function(_0x16b6d5){return _0x16b6d5;});}return null;};}function removeEntity(_0x2efc08,_0x57f902){return function(_0x4e5944){if(_0x4e5944){return _0x4e5944[_0x97e1('0x28')]()[_0x97e1('0x27')](function(){_0x2efc08[_0x97e1('0x1a')](0xcc)[_0x97e1('0x1b')]();});}};}function handleEntityNotFound(_0x30a5ee,_0x276f3c){return function(_0x3f00f6){if(!_0x3f00f6){_0x30a5ee['sendStatus'](0x194);}return _0x3f00f6;};}function handleError(_0x32124b,_0x2e3e76){_0x2e3e76=_0x2e3e76||0x1f4;return function(_0x752d61){logger[_0x97e1('0x29')](_0x752d61[_0x97e1('0x2a')]);if(_0x752d61[_0x97e1('0x2b')]){delete _0x752d61[_0x97e1('0x2b')];}_0x32124b[_0x97e1('0x1a')](_0x2e3e76)[_0x97e1('0x2c')](_0x752d61);};}exports[_0x97e1('0x2d')]=function(_0x5e14c9,_0x196644){var _0x56c10b={},_0x41fe21={},_0x2f97b8={'count':0x0,'rows':[]};var _0x570aed=_['map'](db[_0x97e1('0x2e')][_0x97e1('0x2f')],function(_0x47798d){return{'name':_0x47798d[_0x97e1('0x30')],'type':_0x47798d[_0x97e1('0x31')][_0x97e1('0x32')]};});_0x41fe21['model']=_[_0x97e1('0x33')](_0x570aed,_0x97e1('0x2b'));_0x41fe21[_0x97e1('0x34')]=_[_0x97e1('0x35')](_0x5e14c9['query']);_0x41fe21[_0x97e1('0x36')]=_[_0x97e1('0x37')](_0x41fe21[_0x97e1('0x38')],_0x41fe21[_0x97e1('0x34')]);_0x56c10b['attributes']=_[_0x97e1('0x37')](_0x41fe21[_0x97e1('0x38')],qs[_0x97e1('0x39')](_0x5e14c9[_0x97e1('0x34')][_0x97e1('0x39')]));_0x56c10b[_0x97e1('0x3a')]=_0x56c10b[_0x97e1('0x3a')][_0x97e1('0x3b')]?_0x56c10b[_0x97e1('0x3a')]:_0x41fe21[_0x97e1('0x38')];if(!_0x5e14c9['query'][_0x97e1('0x3c')](_0x97e1('0x3d'))){_0x56c10b[_0x97e1('0x20')]=qs[_0x97e1('0x20')](_0x5e14c9[_0x97e1('0x34')][_0x97e1('0x20')]);_0x56c10b[_0x97e1('0x1d')]=qs[_0x97e1('0x1d')](_0x5e14c9[_0x97e1('0x34')]['offset']);}_0x56c10b[_0x97e1('0x3e')]=qs['sort'](_0x5e14c9[_0x97e1('0x34')][_0x97e1('0x3f')]);_0x56c10b[_0x97e1('0x40')]=qs[_0x97e1('0x36')](_[_0x97e1('0x41')](_0x5e14c9['query'],_0x41fe21[_0x97e1('0x36')]),_0x570aed);if(_0x5e14c9[_0x97e1('0x34')]['filter']){_0x56c10b['where']=_[_0x97e1('0x42')](_0x56c10b[_0x97e1('0x40')],{'$or':_[_0x97e1('0x33')](_0x570aed,function(_0x5b109b){if(_0x5b109b['type']!==_0x97e1('0x43')){var _0x28c13c={};_0x28c13c[_0x5b109b[_0x97e1('0x2b')]]={'$like':'%'+_0x5e14c9[_0x97e1('0x34')][_0x97e1('0x44')]+'%'};return _0x28c13c;}})});}_0x56c10b=_['merge']({},_0x56c10b,_0x5e14c9['options']);var _0x2870b5={'where':_0x56c10b[_0x97e1('0x40')]};return db['MailSubstatus'][_0x97e1('0x1f')](_0x2870b5)[_0x97e1('0x27')](function(_0x439390){_0x2f97b8['count']=_0x439390;if(_0x5e14c9[_0x97e1('0x34')]['includeAll']){_0x56c10b['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x97e1('0x45')](_0x56c10b);})[_0x97e1('0x27')](function(_0x4f4d19){_0x2f97b8[_0x97e1('0x46')]=_0x4f4d19;return _0x2f97b8;})[_0x97e1('0x27')](respondWithFilteredResult(_0x196644,_0x56c10b))[_0x97e1('0x47')](handleError(_0x196644,null));};exports[_0x97e1('0x48')]=function(_0x1036b3,_0x501bd6){var _0x1b1c8a={'raw':!![],'where':{'id':_0x1036b3['params']['id']}},_0x2ad628={};_0x2ad628[_0x97e1('0x38')]=_[_0x97e1('0x35')](db[_0x97e1('0x2e')][_0x97e1('0x2f')]);_0x2ad628['query']=_['keys'](_0x1036b3[_0x97e1('0x34')]);_0x2ad628[_0x97e1('0x36')]=_[_0x97e1('0x37')](_0x2ad628['model'],_0x2ad628[_0x97e1('0x34')]);_0x1b1c8a[_0x97e1('0x3a')]=_[_0x97e1('0x37')](_0x2ad628[_0x97e1('0x38')],qs[_0x97e1('0x39')](_0x1036b3[_0x97e1('0x34')][_0x97e1('0x39')]));_0x1b1c8a[_0x97e1('0x3a')]=_0x1b1c8a[_0x97e1('0x3a')][_0x97e1('0x3b')]?_0x1b1c8a[_0x97e1('0x3a')]:_0x2ad628[_0x97e1('0x38')];if(_0x1036b3[_0x97e1('0x34')]['includeAll']){_0x1b1c8a['include']=[{'all':!![]}];}_0x1b1c8a=_['merge']({},_0x1b1c8a,_0x1036b3[_0x97e1('0x49')]);return db[_0x97e1('0x2e')][_0x97e1('0x4a')](_0x1b1c8a)[_0x97e1('0x27')](handleEntityNotFound(_0x501bd6,null))[_0x97e1('0x27')](respondWithResult(_0x501bd6,null))[_0x97e1('0x47')](handleError(_0x501bd6,null));};exports[_0x97e1('0x4b')]=function(_0x13ea8b,_0x48715d){return db[_0x97e1('0x2e')][_0x97e1('0x4b')](_0x13ea8b[_0x97e1('0x4c')],{})[_0x97e1('0x27')](respondWithResult(_0x48715d,0xc9))['catch'](handleError(_0x48715d,null));};exports[_0x97e1('0x26')]=function(_0x328ae0,_0x55d043){if(_0x328ae0[_0x97e1('0x4c')]['id']){delete _0x328ae0[_0x97e1('0x4c')]['id'];}return db[_0x97e1('0x2e')]['find']({'where':{'id':_0x328ae0[_0x97e1('0x4d')]['id']}})[_0x97e1('0x27')](handleEntityNotFound(_0x55d043,null))[_0x97e1('0x27')](saveUpdates(_0x328ae0[_0x97e1('0x4c')],null))[_0x97e1('0x27')](respondWithResult(_0x55d043,null))[_0x97e1('0x47')](handleError(_0x55d043,null));};exports['destroy']=function(_0xa725a2,_0x42d864){return db[_0x97e1('0x2e')]['find']({'where':{'id':_0xa725a2[_0x97e1('0x4d')]['id']}})[_0x97e1('0x27')](handleEntityNotFound(_0x42d864,null))[_0x97e1('0x27')](removeEntity(_0x42d864,null))[_0x97e1('0x47')](handleError(_0x42d864,null));};exports[_0x97e1('0x4e')]=function(_0x4041ce,_0x366755){return db[_0x97e1('0x2e')][_0x97e1('0x4e')]()[_0x97e1('0x27')](respondWithResult(_0x366755,null))[_0x97e1('0x47')](handleError(_0x366755,null));}; \ No newline at end of file +var _0x00e2=['filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','apply','reject','save','update','then','destroy','end','error','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where'];(function(_0x3cb52a,_0x5a586d){var _0x4e6bab=function(_0xd38f5){while(--_0xd38f5){_0x3cb52a['push'](_0x3cb52a['shift']());}};_0x4e6bab(++_0x5a586d);}(_0x00e2,0x126));var _0x200e=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x00e2[_0x2af160];return _0x439d67;};'use strict';var emlformat=require(_0x200e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x200e('0x1'));var jsonpatch=require(_0x200e('0x2'));var rp=require('request-promise');var moment=require(_0x200e('0x3'));var BPromise=require(_0x200e('0x4'));var Mustache=require('mustache');var util=require(_0x200e('0x5'));var path=require(_0x200e('0x6'));var sox=require('sox');var csv=require(_0x200e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x200e('0x8'));var _=require('lodash');var squel=require(_0x200e('0x9'));var crypto=require(_0x200e('0xa'));var jsforce=require(_0x200e('0xb'));var deskjs=require(_0x200e('0xc'));var toCsv=require(_0x200e('0x7'));var querystring=require(_0x200e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x200e('0xe'));var qs=require(_0x200e('0xf'));var as=require(_0x200e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x200e('0x11'))('api');var utils=require(_0x200e('0x12'));var config=require(_0x200e('0x13'));var licenseUtil=require(_0x200e('0x14'));var db=require(_0x200e('0x15'))['db'];function respondWithStatusCode(_0x5913e3,_0x41c100){_0x41c100=_0x41c100||0xcc;return function(_0x5a0d39){if(_0x5a0d39){return _0x5913e3[_0x200e('0x16')](_0x41c100);}return _0x5913e3[_0x200e('0x17')](_0x41c100)['end']();};}function respondWithResult(_0x4d3ddc,_0x3c4960){_0x3c4960=_0x3c4960||0xc8;return function(_0x25c435){if(_0x25c435){return _0x4d3ddc[_0x200e('0x17')](_0x3c4960)['json'](_0x25c435);}};}function respondWithFilteredResult(_0x584c42,_0x4c9046){return function(_0x2765b0){if(_0x2765b0){var _0x48c16c=typeof _0x4c9046[_0x200e('0x18')]===_0x200e('0x19')&&typeof _0x4c9046['limit']===_0x200e('0x19');var _0x2a51fe=_0x2765b0[_0x200e('0x1a')];var _0xbd86d7=_0x48c16c?0x0:_0x4c9046[_0x200e('0x18')];var _0x54ee31=_0x48c16c?_0x2765b0[_0x200e('0x1a')]:_0x4c9046[_0x200e('0x18')]+_0x4c9046[_0x200e('0x1b')];var _0x8a5d6b;if(_0x54ee31>=_0x2a51fe){_0x54ee31=_0x2a51fe;_0x8a5d6b=0xc8;}else{_0x8a5d6b=0xce;}_0x584c42['status'](_0x8a5d6b);return _0x584c42['set']('Content-Range',_0xbd86d7+'-'+_0x54ee31+'/'+_0x2a51fe)['json'](_0x2765b0);}return null;};}function patchUpdates(_0x7d403b){return function(_0xb5be3b){try{jsonpatch[_0x200e('0x1c')](_0xb5be3b,_0x7d403b,!![]);}catch(_0x519bbf){return BPromise[_0x200e('0x1d')](_0x519bbf);}return _0xb5be3b[_0x200e('0x1e')]();};}function saveUpdates(_0x3d0dce,_0x2dfe48){return function(_0x21317b){if(_0x21317b){return _0x21317b[_0x200e('0x1f')](_0x3d0dce)[_0x200e('0x20')](function(_0x349c17){return _0x349c17;});}return null;};}function removeEntity(_0x1103e8,_0x1a484f){return function(_0x21ca0f){if(_0x21ca0f){return _0x21ca0f[_0x200e('0x21')]()['then'](function(){_0x1103e8[_0x200e('0x17')](0xcc)[_0x200e('0x22')]();});}};}function handleEntityNotFound(_0x2da88e,_0x59e8b3){return function(_0x32f157){if(!_0x32f157){_0x2da88e[_0x200e('0x16')](0x194);}return _0x32f157;};}function handleError(_0x3190bf,_0x222372){_0x222372=_0x222372||0x1f4;return function(_0x3f27ee){logger[_0x200e('0x23')](_0x3f27ee['stack']);if(_0x3f27ee[_0x200e('0x24')]){delete _0x3f27ee[_0x200e('0x24')];}_0x3190bf['status'](_0x222372)[_0x200e('0x25')](_0x3f27ee);};}exports[_0x200e('0x26')]=function(_0x438cf5,_0x22513d){var _0x88f265={},_0x595121={},_0xa8945a={'count':0x0,'rows':[]};var _0x14127f=_[_0x200e('0x27')](db[_0x200e('0x28')][_0x200e('0x29')],function(_0x2b8c30){return{'name':_0x2b8c30[_0x200e('0x2a')],'type':_0x2b8c30[_0x200e('0x2b')][_0x200e('0x2c')]};});_0x595121[_0x200e('0x2d')]=_[_0x200e('0x27')](_0x14127f,_0x200e('0x24'));_0x595121[_0x200e('0x2e')]=_[_0x200e('0x2f')](_0x438cf5[_0x200e('0x2e')]);_0x595121[_0x200e('0x30')]=_[_0x200e('0x31')](_0x595121[_0x200e('0x2d')],_0x595121['query']);_0x88f265[_0x200e('0x32')]=_[_0x200e('0x31')](_0x595121['model'],qs[_0x200e('0x33')](_0x438cf5[_0x200e('0x2e')][_0x200e('0x33')]));_0x88f265['attributes']=_0x88f265[_0x200e('0x32')][_0x200e('0x34')]?_0x88f265[_0x200e('0x32')]:_0x595121[_0x200e('0x2d')];if(!_0x438cf5[_0x200e('0x2e')]['hasOwnProperty']('nolimit')){_0x88f265[_0x200e('0x1b')]=qs['limit'](_0x438cf5[_0x200e('0x2e')][_0x200e('0x1b')]);_0x88f265['offset']=qs[_0x200e('0x18')](_0x438cf5[_0x200e('0x2e')]['offset']);}_0x88f265[_0x200e('0x35')]=qs[_0x200e('0x36')](_0x438cf5[_0x200e('0x2e')][_0x200e('0x36')]);_0x88f265[_0x200e('0x37')]=qs[_0x200e('0x30')](_['pick'](_0x438cf5[_0x200e('0x2e')],_0x595121[_0x200e('0x30')]),_0x14127f);if(_0x438cf5['query'][_0x200e('0x38')]){_0x88f265[_0x200e('0x37')]=_['merge'](_0x88f265['where'],{'$or':_['map'](_0x14127f,function(_0x1f41a1){if(_0x1f41a1[_0x200e('0x2b')]!==_0x200e('0x39')){var _0xeed03b={};_0xeed03b[_0x1f41a1[_0x200e('0x24')]]={'$like':'%'+_0x438cf5[_0x200e('0x2e')][_0x200e('0x38')]+'%'};return _0xeed03b;}})});}_0x88f265=_[_0x200e('0x3a')]({},_0x88f265,_0x438cf5['options']);var _0x43f33c={'where':_0x88f265[_0x200e('0x37')]};return db[_0x200e('0x28')][_0x200e('0x1a')](_0x43f33c)['then'](function(_0x3bb6d3){_0xa8945a['count']=_0x3bb6d3;if(_0x438cf5[_0x200e('0x2e')][_0x200e('0x3b')]){_0x88f265[_0x200e('0x3c')]=[{'all':!![]}];}return db[_0x200e('0x28')][_0x200e('0x3d')](_0x88f265);})[_0x200e('0x20')](function(_0x2ab570){_0xa8945a[_0x200e('0x3e')]=_0x2ab570;return _0xa8945a;})[_0x200e('0x20')](respondWithFilteredResult(_0x22513d,_0x88f265))[_0x200e('0x3f')](handleError(_0x22513d,null));};exports[_0x200e('0x40')]=function(_0x3a6ddf,_0x18d82c){var _0x2c9c3e={'raw':!![],'where':{'id':_0x3a6ddf[_0x200e('0x41')]['id']}},_0x1c2441={};_0x1c2441[_0x200e('0x2d')]=_[_0x200e('0x2f')](db[_0x200e('0x28')][_0x200e('0x29')]);_0x1c2441[_0x200e('0x2e')]=_[_0x200e('0x2f')](_0x3a6ddf[_0x200e('0x2e')]);_0x1c2441['filters']=_['intersection'](_0x1c2441[_0x200e('0x2d')],_0x1c2441[_0x200e('0x2e')]);_0x2c9c3e['attributes']=_['intersection'](_0x1c2441[_0x200e('0x2d')],qs['fields'](_0x3a6ddf[_0x200e('0x2e')]['fields']));_0x2c9c3e['attributes']=_0x2c9c3e[_0x200e('0x32')][_0x200e('0x34')]?_0x2c9c3e[_0x200e('0x32')]:_0x1c2441[_0x200e('0x2d')];if(_0x3a6ddf[_0x200e('0x2e')][_0x200e('0x3b')]){_0x2c9c3e[_0x200e('0x3c')]=[{'all':!![]}];}_0x2c9c3e=_[_0x200e('0x3a')]({},_0x2c9c3e,_0x3a6ddf['options']);return db['MailSubstatus'][_0x200e('0x42')](_0x2c9c3e)[_0x200e('0x20')](handleEntityNotFound(_0x18d82c,null))['then'](respondWithResult(_0x18d82c,null))[_0x200e('0x3f')](handleError(_0x18d82c,null));};exports[_0x200e('0x43')]=function(_0x43e520,_0x3fc8ee){return db[_0x200e('0x28')][_0x200e('0x43')](_0x43e520[_0x200e('0x44')],{})[_0x200e('0x20')](respondWithResult(_0x3fc8ee,0xc9))['catch'](handleError(_0x3fc8ee,null));};exports[_0x200e('0x1f')]=function(_0x4e40bb,_0x4554ae){if(_0x4e40bb[_0x200e('0x44')]['id']){delete _0x4e40bb[_0x200e('0x44')]['id'];}return db['MailSubstatus'][_0x200e('0x42')]({'where':{'id':_0x4e40bb[_0x200e('0x41')]['id']}})[_0x200e('0x20')](handleEntityNotFound(_0x4554ae,null))[_0x200e('0x20')](saveUpdates(_0x4e40bb[_0x200e('0x44')],null))['then'](respondWithResult(_0x4554ae,null))['catch'](handleError(_0x4554ae,null));};exports[_0x200e('0x21')]=function(_0x2eecef,_0x3b3255){return db[_0x200e('0x28')][_0x200e('0x42')]({'where':{'id':_0x2eecef[_0x200e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b3255,null))[_0x200e('0x20')](removeEntity(_0x3b3255,null))[_0x200e('0x3f')](handleError(_0x3b3255,null));};exports[_0x200e('0x45')]=function(_0x33cb7b,_0x59e4f9){return db[_0x200e('0x28')]['describe']()[_0x200e('0x20')](respondWithResult(_0x59e4f9,null))['catch'](handleError(_0x59e4f9,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index a51e31a..4c0fd86 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 _0x78ae=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xd2e6bd,_0x558a85){var _0x50028b=function(_0x2221b1){while(--_0x2221b1){_0xd2e6bd['push'](_0xd2e6bd['shift']());}};_0x50028b(++_0x558a85);}(_0x78ae,0xb2));var _0xe78a=function(_0x5eb180,_0x127912){_0x5eb180=_0x5eb180-0x0;var _0xc5f79c=_0x78ae[_0x5eb180];return _0xc5f79c;};'use strict';var EventEmitter=require(_0xe78a('0x0'));var MailSubstatus=require(_0xe78a('0x1'))['db'][_0xe78a('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe78a('0x3')](0x0);var events={'afterUpdate':_0xe78a('0x4')};function emitEvent(_0x2483d4){return function(_0x408f14,_0x5cfa6b,_0x1739f9){MailSubstatusEvents[_0xe78a('0x5')](_0x2483d4+':'+_0x408f14['id'],_0x408f14);MailSubstatusEvents['emit'](_0x2483d4,_0x408f14);_0x1739f9(null);};}for(var e in events){if(events[_0xe78a('0x6')](e)){var event=events[e];MailSubstatus[_0xe78a('0x7')](e,emitEvent(event));}}module[_0xe78a('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0x4e60=['hasOwnProperty','exports','events','../../mysqldb','MailSubstatus','update','emit'];(function(_0x27ada5,_0x2390c5){var _0x57a42a=function(_0x460f84){while(--_0x460f84){_0x27ada5['push'](_0x27ada5['shift']());}};_0x57a42a(++_0x2390c5);}(_0x4e60,0x9c));var _0x04e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4e60[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x04e6('0x0'));var MailSubstatus=require(_0x04e6('0x1'))['db'][_0x04e6('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x04e6('0x3')};function emitEvent(_0x4beb40){return function(_0x3acb87,_0x522345,_0x519025){MailSubstatusEvents['emit'](_0x4beb40+':'+_0x3acb87['id'],_0x3acb87);MailSubstatusEvents[_0x04e6('0x4')](_0x4beb40,_0x3acb87);_0x519025(null);};}for(var e in events){if(events[_0x04e6('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x04e6('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index c30bb6e..5576d55 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 _0xdab6=['models','define','MailSubstatus','Condition','update','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports'];(function(_0x1cd51f,_0x297954){var _0x54208a=function(_0x33fbf7){while(--_0x33fbf7){_0x1cd51f['push'](_0x1cd51f['shift']());}};_0x54208a(++_0x297954);}(_0xdab6,0x153));var _0x6dab=function(_0x338f23,_0x4baf56){_0x338f23=_0x338f23-0x0;var _0x11a457=_0xdab6[_0x338f23];return _0x11a457;};'use strict';var attributes=require(_0x6dab('0x0'));module[_0x6dab('0x1')]=function(_0x15d9ea){var _0x3347ca=_0x15d9ea[_0x6dab('0x2')];return _0x15d9ea[_0x6dab('0x3')](_0x6dab('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2de437,_0xac13e5,_0x325eb6){return _0x3347ca[_0x6dab('0x5')][_0x6dab('0x6')]({'value':_0x2de437[_0x6dab('0x7')]},{'where':{'field':_0x6dab('0x8'),'value':_0x2de437['_previousDataValues'][_0x6dab('0x7')]}})[_0x6dab('0x9')](function(){_0x325eb6();})[_0x6dab('0xa')](function(_0x734e8b){_0x325eb6(_0x734e8b);});}}});}; \ No newline at end of file +var _0x9c87=['_previousDataValues','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus'];(function(_0x50ae20,_0x4e52fb){var _0x5153dc=function(_0x2832ae){while(--_0x2832ae){_0x50ae20['push'](_0x50ae20['shift']());}};_0x5153dc(++_0x4e52fb);}(_0x9c87,0x86));var _0x79c8=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x9c87[_0x419e17];return _0x1f2044;};'use strict';var attributes=require(_0x79c8('0x0'));module[_0x79c8('0x1')]=function(_0x45572e){var _0x376b79=_0x45572e[_0x79c8('0x2')];return _0x45572e[_0x79c8('0x3')](_0x79c8('0x4'),attributes,{'tableName':_0x79c8('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5439d4,_0xb3b314,_0x5e8095){return _0x376b79[_0x79c8('0x6')][_0x79c8('0x7')]({'value':_0x5439d4[_0x79c8('0x8')]},{'where':{'field':_0x79c8('0x9'),'value':_0x5439d4[_0x79c8('0xa')]['name']}})['then'](function(){_0x5e8095();})[_0x79c8('0xb')](function(_0x4ef00c){_0x5e8095(_0x4ef00c);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 3ef05c8..83bd33c 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 _0xbb33=['error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0xbb33,0x8f));var _0x3bb3=function(_0x3b4756,_0x3ee9b7){_0x3b4756=_0x3b4756-0x0;var _0x3ce1a5=_0xbb33[_0x3b4756];return _0x3ce1a5;};'use strict';var _=require(_0x3bb3('0x0'));var util=require('util');var moment=require(_0x3bb3('0x1'));var BPromise=require(_0x3bb3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bb3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bb3('0x4'))(_0x3bb3('0x5'));var config=require(_0x3bb3('0x6'));var jayson=require(_0x3bb3('0x7'));var client=jayson['client'][_0x3bb3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e2923,_0x840d50,_0x195b55){return new BPromise(function(_0x1744f6,_0x4e833d){return client[_0x3bb3('0x9')](_0x1e2923,_0x195b55)[_0x3bb3('0xa')](function(_0x5f0a79){logger[_0x3bb3('0xb')](_0x3bb3('0xc'),_0x840d50,'request\x20sent');logger[_0x3bb3('0xd')](_0x3bb3('0xe'),_0x840d50,_0x3bb3('0xf'),JSON[_0x3bb3('0x10')](_0x5f0a79));if(_0x5f0a79[_0x3bb3('0x11')]){if(_0x5f0a79[_0x3bb3('0x11')]['code']===0x1f4){logger['error'](_0x3bb3('0xc'),_0x840d50,_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);return _0x4e833d(_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);}logger[_0x3bb3('0x11')](_0x3bb3('0xc'),_0x840d50,_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);return _0x1744f6(_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);}else{logger[_0x3bb3('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x840d50,_0x3bb3('0xf'));_0x1744f6(_0x5f0a79[_0x3bb3('0x13')][_0x3bb3('0x12')]);}})['catch'](function(_0x2274cb){logger[_0x3bb3('0x11')](_0x3bb3('0xc'),_0x840d50,_0x2274cb);_0x4e833d(_0x2274cb);});});} \ No newline at end of file +var _0xa5c9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x348d2c,_0x1f7ecc){var _0x383ac5=function(_0x5cbd24){while(--_0x5cbd24){_0x348d2c['push'](_0x348d2c['shift']());}};_0x383ac5(++_0x1f7ecc);}(_0xa5c9,0x199));var _0x9a5c=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xa5c9[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9a5c('0x0'));var BPromise=require(_0x9a5c('0x1'));var rs=require(_0x9a5c('0x2'));var fs=require('fs');var Redis=require(_0x9a5c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a5c('0x4'));var logger=require(_0x9a5c('0x5'))(_0x9a5c('0x6'));var config=require(_0x9a5c('0x7'));var jayson=require(_0x9a5c('0x8'));var client=jayson[_0x9a5c('0x9')][_0x9a5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a7951,_0x22265c,_0x33a547){return new BPromise(function(_0x3b67c8,_0x4b9292){return client['request'](_0x5a7951,_0x33a547)[_0x9a5c('0xb')](function(_0x5cd4a9){logger[_0x9a5c('0xc')](_0x9a5c('0xd'),_0x22265c,_0x9a5c('0xe'));logger[_0x9a5c('0xf')](_0x9a5c('0x10'),_0x22265c,_0x9a5c('0xe'),JSON[_0x9a5c('0x11')](_0x5cd4a9));if(_0x5cd4a9[_0x9a5c('0x12')]){if(_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x13')]===0x1f4){logger['error'](_0x9a5c('0xd'),_0x22265c,_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);return _0x4b9292(_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);}logger[_0x9a5c('0x12')](_0x9a5c('0xd'),_0x22265c,_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);return _0x3b67c8(_0x5cd4a9[_0x9a5c('0x12')][_0x9a5c('0x14')]);}else{logger[_0x9a5c('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x22265c,_0x9a5c('0xe'));_0x3b67c8(_0x5cd4a9[_0x9a5c('0x15')][_0x9a5c('0x14')]);}})[_0x9a5c('0x16')](function(_0x4a0ed6){logger[_0x9a5c('0x12')](_0x9a5c('0xd'),_0x22265c,_0x4a0ed6);_0x4b9292(_0x4a0ed6);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 7280dc1..2b21933 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 _0xa9c6=['../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','destroy','exports','path','express','Router','fs-extra'];(function(_0x35e647,_0x52c47e){var _0x58c907=function(_0x4b3dad){while(--_0x4b3dad){_0x35e647['push'](_0x35e647['shift']());}};_0x58c907(++_0x52c47e);}(_0xa9c6,0xb0));var _0x6a9c=function(_0x25d98a,_0x5be971){_0x25d98a=_0x25d98a-0x0;var _0x2f4c5b=_0xa9c6[_0x25d98a];return _0x2f4c5b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6a9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x6a9c('0x1'));var router=express[_0x6a9c('0x2')]();var fs_extra=require(_0x6a9c('0x3'));var auth=require(_0x6a9c('0x4'));var interaction=require(_0x6a9c('0x5'));var config=require('../../config/environment');var controller=require(_0x6a9c('0x6'));router[_0x6a9c('0x7')]('/',auth[_0x6a9c('0x8')](),controller['index']);router['get'](_0x6a9c('0x9'),auth[_0x6a9c('0x8')](),controller[_0x6a9c('0xa')]);router[_0x6a9c('0x7')](_0x6a9c('0xb'),auth[_0x6a9c('0x8')](),controller[_0x6a9c('0xc')]);router[_0x6a9c('0xd')]('/',auth['isAuthenticated'](),controller[_0x6a9c('0xe')]);router[_0x6a9c('0xf')](_0x6a9c('0xb'),auth[_0x6a9c('0x8')](),controller['update']);router['delete'](_0x6a9c('0xb'),auth[_0x6a9c('0x8')](),controller[_0x6a9c('0x10')]);module[_0x6a9c('0x11')]=router; \ No newline at end of file +var _0x80de=['describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x80de,0x169));var _0xe80d=function(_0x33b934,_0x22591d){_0x33b934=_0x33b934-0x0;var _0x4c1d91=_0x80de[_0x33b934];return _0x4c1d91;};'use strict';var multer=require(_0xe80d('0x0'));var util=require(_0xe80d('0x1'));var path=require(_0xe80d('0x2'));var timeout=require(_0xe80d('0x3'));var express=require(_0xe80d('0x4'));var router=express[_0xe80d('0x5')]();var fs_extra=require(_0xe80d('0x6'));var auth=require(_0xe80d('0x7'));var interaction=require(_0xe80d('0x8'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0xe80d('0x9')]('/',auth[_0xe80d('0xa')](),controller[_0xe80d('0xb')]);router[_0xe80d('0x9')](_0xe80d('0xc'),auth['isAuthenticated'](),controller[_0xe80d('0xd')]);router['get'](_0xe80d('0xe'),auth[_0xe80d('0xa')](),controller[_0xe80d('0xf')]);router[_0xe80d('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe80d('0x11')](_0xe80d('0xe'),auth[_0xe80d('0xa')](),controller[_0xe80d('0x12')]);router[_0xe80d('0x13')]('/:id',auth[_0xe80d('0xa')](),controller[_0xe80d('0x14')]);module[_0xe80d('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4165aec..5abd923 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x34e8,0x12c));var _0x834e=function(_0x90e3e3,_0x16ad09){_0x90e3e3=_0x90e3e3-0x0;var _0x53f867=_0x34e8[_0x90e3e3];return _0x53f867;};'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 +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3c707b,_0x1d958d){var _0x14a0a7=function(_0x406774){while(--_0x406774){_0x3c707b['push'](_0x3c707b['shift']());}};_0x14a0a7(++_0x1d958d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d6ac0,_0x201628){_0x4d6ac0=_0x4d6ac0-0x0;var _0x5296c4=_0xcb91[_0x4d6ac0];return _0x5296c4;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index db7fa43..e139c2b 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 _0x64fe=['rimraf','zip-dir','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/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format'];(function(_0x55ffc6,_0x2cfe0b){var _0x5e7fa5=function(_0x52c64c){while(--_0x52c64c){_0x55ffc6['push'](_0x55ffc6['shift']());}};_0x5e7fa5(++_0x2cfe0b);}(_0x64fe,0xf8));var _0xe64f=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x64fe[_0x31cb5f];return _0x586042;};'use strict';var emlformat=require(_0xe64f('0x0'));var rimraf=require(_0xe64f('0x1'));var zipdir=require(_0xe64f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe64f('0x3'));var moment=require(_0xe64f('0x4'));var BPromise=require(_0xe64f('0x5'));var Mustache=require(_0xe64f('0x6'));var util=require(_0xe64f('0x7'));var path=require(_0xe64f('0x8'));var sox=require(_0xe64f('0x9'));var csv=require(_0xe64f('0xa'));var ejs=require(_0xe64f('0xb'));var fs=require('fs');var fs_extra=require(_0xe64f('0xc'));var _=require(_0xe64f('0xd'));var squel=require(_0xe64f('0xe'));var crypto=require(_0xe64f('0xf'));var jsforce=require(_0xe64f('0x10'));var deskjs=require(_0xe64f('0x11'));var toCsv=require(_0xe64f('0xa'));var querystring=require(_0xe64f('0x12'));var Papa=require(_0xe64f('0x13'));var Redis=require('ioredis');var authService=require(_0xe64f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe64f('0x15'));var hardwareService=require(_0xe64f('0x16'));var logger=require('../../config/logger')(_0xe64f('0x17'));var utils=require(_0xe64f('0x18'));var config=require(_0xe64f('0x19'));var licenseUtil=require(_0xe64f('0x1a'));var db=require(_0xe64f('0x1b'))['db'];function respondWithStatusCode(_0x5e0d55,_0x155981){_0x155981=_0x155981||0xcc;return function(_0xcd38cc){if(_0xcd38cc){return _0x5e0d55[_0xe64f('0x1c')](_0x155981);}return _0x5e0d55[_0xe64f('0x1d')](_0x155981)[_0xe64f('0x1e')]();};}function respondWithResult(_0x5f226b,_0xfa2a0e){_0xfa2a0e=_0xfa2a0e||0xc8;return function(_0x2c9280){if(_0x2c9280){return _0x5f226b[_0xe64f('0x1d')](_0xfa2a0e)[_0xe64f('0x1f')](_0x2c9280);}};}function respondWithFilteredResult(_0x3f7cd5,_0xb84eef){return function(_0x4f2e4a){if(_0x4f2e4a){var _0x31f11c=typeof _0xb84eef[_0xe64f('0x20')]===_0xe64f('0x21')&&typeof _0xb84eef['limit']===_0xe64f('0x21');var _0xc51a17=_0x4f2e4a[_0xe64f('0x22')];var _0x14ca0d=_0x31f11c?0x0:_0xb84eef[_0xe64f('0x20')];var _0x4d1e45=_0x31f11c?_0x4f2e4a[_0xe64f('0x22')]:_0xb84eef['offset']+_0xb84eef[_0xe64f('0x23')];var _0x22460a;if(_0x4d1e45>=_0xc51a17){_0x4d1e45=_0xc51a17;_0x22460a=0xc8;}else{_0x22460a=0xce;}_0x3f7cd5[_0xe64f('0x1d')](_0x22460a);return _0x3f7cd5[_0xe64f('0x24')](_0xe64f('0x25'),_0x14ca0d+'-'+_0x4d1e45+'/'+_0xc51a17)[_0xe64f('0x1f')](_0x4f2e4a);}return null;};}function patchUpdates(_0x226aa0){return function(_0xaed612){try{jsonpatch[_0xe64f('0x26')](_0xaed612,_0x226aa0,!![]);}catch(_0x5b55f2){return BPromise[_0xe64f('0x27')](_0x5b55f2);}return _0xaed612[_0xe64f('0x28')]();};}function saveUpdates(_0x1f3543,_0xe2a1ee){return function(_0x2e2fb6){if(_0x2e2fb6){return _0x2e2fb6[_0xe64f('0x29')](_0x1f3543)[_0xe64f('0x2a')](function(_0xe9f824){return _0xe9f824;});}return null;};}function removeEntity(_0x14401b,_0x31131f){return function(_0x30818a){if(_0x30818a){return _0x30818a[_0xe64f('0x2b')]()[_0xe64f('0x2a')](function(){_0x14401b[_0xe64f('0x1d')](0xcc)[_0xe64f('0x1e')]();});}};}function handleEntityNotFound(_0x29c217,_0x5ac4f9){return function(_0x53f32c){if(!_0x53f32c){_0x29c217[_0xe64f('0x1c')](0x194);}return _0x53f32c;};}function handleError(_0x333bf8,_0x6b0c1f){_0x6b0c1f=_0x6b0c1f||0x1f4;return function(_0x351a60){logger['error'](_0x351a60[_0xe64f('0x2c')]);if(_0x351a60[_0xe64f('0x2d')]){delete _0x351a60[_0xe64f('0x2d')];}_0x333bf8[_0xe64f('0x1d')](_0x6b0c1f)[_0xe64f('0x2e')](_0x351a60);};}exports[_0xe64f('0x2f')]=function(_0x4f50fb,_0x2d8704){var _0x2dff5c={},_0x19dc64={},_0x4c8677={'count':0x0,'rows':[]};var _0x3844c8=_[_0xe64f('0x30')](db[_0xe64f('0x31')][_0xe64f('0x32')],function(_0x19ebbb){return{'name':_0x19ebbb[_0xe64f('0x33')],'type':_0x19ebbb['type'][_0xe64f('0x34')]};});_0x19dc64['model']=_[_0xe64f('0x30')](_0x3844c8,_0xe64f('0x2d'));_0x19dc64['query']=_[_0xe64f('0x35')](_0x4f50fb[_0xe64f('0x36')]);_0x19dc64[_0xe64f('0x37')]=_['intersection'](_0x19dc64[_0xe64f('0x38')],_0x19dc64[_0xe64f('0x36')]);_0x2dff5c[_0xe64f('0x39')]=_[_0xe64f('0x3a')](_0x19dc64[_0xe64f('0x38')],qs[_0xe64f('0x3b')](_0x4f50fb[_0xe64f('0x36')]['fields']));_0x2dff5c[_0xe64f('0x39')]=_0x2dff5c[_0xe64f('0x39')][_0xe64f('0x3c')]?_0x2dff5c['attributes']:_0x19dc64[_0xe64f('0x38')];if(!_0x4f50fb[_0xe64f('0x36')][_0xe64f('0x3d')](_0xe64f('0x3e'))){_0x2dff5c[_0xe64f('0x23')]=qs[_0xe64f('0x23')](_0x4f50fb[_0xe64f('0x36')][_0xe64f('0x23')]);_0x2dff5c[_0xe64f('0x20')]=qs['offset'](_0x4f50fb[_0xe64f('0x36')][_0xe64f('0x20')]);}_0x2dff5c[_0xe64f('0x3f')]=qs[_0xe64f('0x40')](_0x4f50fb[_0xe64f('0x36')][_0xe64f('0x40')]);_0x2dff5c[_0xe64f('0x41')]=qs[_0xe64f('0x37')](_[_0xe64f('0x42')](_0x4f50fb[_0xe64f('0x36')],_0x19dc64['filters']),_0x3844c8);if(_0x4f50fb[_0xe64f('0x36')][_0xe64f('0x43')]){_0x2dff5c['where']=_[_0xe64f('0x44')](_0x2dff5c[_0xe64f('0x41')],{'$or':_['map'](_0x3844c8,function(_0x2ef6d5){if(_0x2ef6d5[_0xe64f('0x45')]!==_0xe64f('0x46')){var _0x38ea78={};_0x38ea78[_0x2ef6d5[_0xe64f('0x2d')]]={'$like':'%'+_0x4f50fb[_0xe64f('0x36')][_0xe64f('0x43')]+'%'};return _0x38ea78;}})});}_0x2dff5c=_[_0xe64f('0x44')]({},_0x2dff5c,_0x4f50fb[_0xe64f('0x47')]);var _0xf679ee={'where':_0x2dff5c['where']};return db[_0xe64f('0x31')][_0xe64f('0x22')](_0xf679ee)['then'](function(_0x198c76){_0x4c8677[_0xe64f('0x22')]=_0x198c76;if(_0x4f50fb[_0xe64f('0x36')][_0xe64f('0x48')]){_0x2dff5c[_0xe64f('0x49')]=[{'all':!![]}];}return db['MailTransferReport'][_0xe64f('0x4a')](_0x2dff5c);})[_0xe64f('0x2a')](function(_0x2e8d73){_0x4c8677[_0xe64f('0x4b')]=_0x2e8d73;return _0x4c8677;})['then'](respondWithFilteredResult(_0x2d8704,_0x2dff5c))[_0xe64f('0x4c')](handleError(_0x2d8704,null));};exports[_0xe64f('0x4d')]=function(_0x47d981,_0x9324d3){var _0x54eb57={'raw':!![],'where':{'id':_0x47d981['params']['id']}},_0x215fc2={};_0x215fc2[_0xe64f('0x38')]=_[_0xe64f('0x35')](db[_0xe64f('0x31')][_0xe64f('0x32')]);_0x215fc2[_0xe64f('0x36')]=_[_0xe64f('0x35')](_0x47d981[_0xe64f('0x36')]);_0x215fc2['filters']=_[_0xe64f('0x3a')](_0x215fc2[_0xe64f('0x38')],_0x215fc2['query']);_0x54eb57[_0xe64f('0x39')]=_[_0xe64f('0x3a')](_0x215fc2[_0xe64f('0x38')],qs[_0xe64f('0x3b')](_0x47d981[_0xe64f('0x36')][_0xe64f('0x3b')]));_0x54eb57[_0xe64f('0x39')]=_0x54eb57[_0xe64f('0x39')][_0xe64f('0x3c')]?_0x54eb57[_0xe64f('0x39')]:_0x215fc2[_0xe64f('0x38')];if(_0x47d981[_0xe64f('0x36')][_0xe64f('0x48')]){_0x54eb57[_0xe64f('0x49')]=[{'all':!![]}];}_0x54eb57=_[_0xe64f('0x44')]({},_0x54eb57,_0x47d981['options']);return db[_0xe64f('0x31')][_0xe64f('0x4e')](_0x54eb57)[_0xe64f('0x2a')](handleEntityNotFound(_0x9324d3,null))[_0xe64f('0x2a')](respondWithResult(_0x9324d3,null))[_0xe64f('0x4c')](handleError(_0x9324d3,null));};exports['create']=function(_0xcd9ed9,_0x582f7e){return db[_0xe64f('0x31')][_0xe64f('0x4f')](_0xcd9ed9['body'],{})[_0xe64f('0x2a')](respondWithResult(_0x582f7e,0xc9))['catch'](handleError(_0x582f7e,null));};exports[_0xe64f('0x29')]=function(_0xf28f1a,_0x3b2907){if(_0xf28f1a[_0xe64f('0x50')]['id']){delete _0xf28f1a[_0xe64f('0x50')]['id'];}return db[_0xe64f('0x31')]['find']({'where':{'id':_0xf28f1a[_0xe64f('0x51')]['id']}})[_0xe64f('0x2a')](handleEntityNotFound(_0x3b2907,null))[_0xe64f('0x2a')](saveUpdates(_0xf28f1a[_0xe64f('0x50')],null))[_0xe64f('0x2a')](respondWithResult(_0x3b2907,null))[_0xe64f('0x4c')](handleError(_0x3b2907,null));};exports[_0xe64f('0x2b')]=function(_0x3b41bf,_0x38ffd6){return db[_0xe64f('0x31')][_0xe64f('0x4e')]({'where':{'id':_0x3b41bf['params']['id']}})[_0xe64f('0x2a')](handleEntityNotFound(_0x38ffd6,null))[_0xe64f('0x2a')](removeEntity(_0x38ffd6,null))[_0xe64f('0x4c')](handleError(_0x38ffd6,null));};exports[_0xe64f('0x52')]=function(_0x15a793,_0x36e729){return db['MailTransferReport'][_0xe64f('0x52')]()[_0xe64f('0x2a')](respondWithResult(_0x36e729,null))[_0xe64f('0x4c')](handleError(_0x36e729,null));}; \ No newline at end of file +var _0xcd0c=['map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','name','index'];(function(_0x4e82bb,_0x4c39d5){var _0x1b5ac5=function(_0x578c77){while(--_0x578c77){_0x4e82bb['push'](_0x4e82bb['shift']());}};_0x1b5ac5(++_0x4c39d5);}(_0xcd0c,0x1f2));var _0xccd0=function(_0x5acaea,_0x442cb0){_0x5acaea=_0x5acaea-0x0;var _0x509dfa=_0xcd0c[_0x5acaea];return _0x509dfa;};'use strict';var emlformat=require(_0xccd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccd0('0x1'));var jsonpatch=require(_0xccd0('0x2'));var rp=require('request-promise');var moment=require(_0xccd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xccd0('0x4'));var util=require(_0xccd0('0x5'));var path=require(_0xccd0('0x6'));var sox=require(_0xccd0('0x7'));var csv=require(_0xccd0('0x8'));var ejs=require(_0xccd0('0x9'));var fs=require('fs');var fs_extra=require(_0xccd0('0xa'));var _=require(_0xccd0('0xb'));var squel=require(_0xccd0('0xc'));var crypto=require(_0xccd0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xccd0('0x8'));var querystring=require(_0xccd0('0xe'));var Papa=require(_0xccd0('0xf'));var Redis=require(_0xccd0('0x10'));var authService=require(_0xccd0('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xccd0('0x12'))(_0xccd0('0x13'));var utils=require(_0xccd0('0x14'));var config=require(_0xccd0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xccd0('0x16'))['db'];function respondWithStatusCode(_0xc3e353,_0x71b4db){_0x71b4db=_0x71b4db||0xcc;return function(_0x132cf9){if(_0x132cf9){return _0xc3e353[_0xccd0('0x17')](_0x71b4db);}return _0xc3e353['status'](_0x71b4db)[_0xccd0('0x18')]();};}function respondWithResult(_0x2b5d12,_0x3bfb7b){_0x3bfb7b=_0x3bfb7b||0xc8;return function(_0x5bc5d1){if(_0x5bc5d1){return _0x2b5d12[_0xccd0('0x19')](_0x3bfb7b)[_0xccd0('0x1a')](_0x5bc5d1);}};}function respondWithFilteredResult(_0x501202,_0x42c791){return function(_0x447e03){if(_0x447e03){var _0x14dab7=typeof _0x42c791[_0xccd0('0x1b')]==='undefined'&&typeof _0x42c791['limit']===_0xccd0('0x1c');var _0x1e8c31=_0x447e03[_0xccd0('0x1d')];var _0x3afc51=_0x14dab7?0x0:_0x42c791['offset'];var _0x42b0ff=_0x14dab7?_0x447e03[_0xccd0('0x1d')]:_0x42c791[_0xccd0('0x1b')]+_0x42c791[_0xccd0('0x1e')];var _0x1a6b1c;if(_0x42b0ff>=_0x1e8c31){_0x42b0ff=_0x1e8c31;_0x1a6b1c=0xc8;}else{_0x1a6b1c=0xce;}_0x501202['status'](_0x1a6b1c);return _0x501202[_0xccd0('0x1f')](_0xccd0('0x20'),_0x3afc51+'-'+_0x42b0ff+'/'+_0x1e8c31)[_0xccd0('0x1a')](_0x447e03);}return null;};}function patchUpdates(_0x533753){return function(_0x2065d9){try{jsonpatch[_0xccd0('0x21')](_0x2065d9,_0x533753,!![]);}catch(_0x32ad06){return BPromise[_0xccd0('0x22')](_0x32ad06);}return _0x2065d9[_0xccd0('0x23')]();};}function saveUpdates(_0x1339c9,_0xeca904){return function(_0x2382b4){if(_0x2382b4){return _0x2382b4[_0xccd0('0x24')](_0x1339c9)['then'](function(_0x2584f5){return _0x2584f5;});}return null;};}function removeEntity(_0x6ee207,_0x6441a0){return function(_0x345868){if(_0x345868){return _0x345868[_0xccd0('0x25')]()['then'](function(){_0x6ee207[_0xccd0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0f35,_0x3541e8){return function(_0x7cf87e){if(!_0x7cf87e){_0x1c0f35[_0xccd0('0x17')](0x194);}return _0x7cf87e;};}function handleError(_0x198554,_0x2c8d8e){_0x2c8d8e=_0x2c8d8e||0x1f4;return function(_0x4f98a1){logger[_0xccd0('0x26')](_0x4f98a1['stack']);if(_0x4f98a1[_0xccd0('0x27')]){delete _0x4f98a1['name'];}_0x198554[_0xccd0('0x19')](_0x2c8d8e)['send'](_0x4f98a1);};}exports[_0xccd0('0x28')]=function(_0x2a8920,_0x261615){var _0x11a784={},_0x277309={},_0x135336={'count':0x0,'rows':[]};var _0x46342d=_[_0xccd0('0x29')](db[_0xccd0('0x2a')][_0xccd0('0x2b')],function(_0x51d57a){return{'name':_0x51d57a[_0xccd0('0x2c')],'type':_0x51d57a[_0xccd0('0x2d')][_0xccd0('0x2e')]};});_0x277309['model']=_[_0xccd0('0x29')](_0x46342d,_0xccd0('0x27'));_0x277309[_0xccd0('0x2f')]=_[_0xccd0('0x30')](_0x2a8920[_0xccd0('0x2f')]);_0x277309[_0xccd0('0x31')]=_['intersection'](_0x277309[_0xccd0('0x32')],_0x277309[_0xccd0('0x2f')]);_0x11a784[_0xccd0('0x33')]=_[_0xccd0('0x34')](_0x277309['model'],qs[_0xccd0('0x35')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x35')]));_0x11a784[_0xccd0('0x33')]=_0x11a784[_0xccd0('0x33')]['length']?_0x11a784[_0xccd0('0x33')]:_0x277309[_0xccd0('0x32')];if(!_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x36')](_0xccd0('0x37'))){_0x11a784[_0xccd0('0x1e')]=qs[_0xccd0('0x1e')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x1e')]);_0x11a784[_0xccd0('0x1b')]=qs[_0xccd0('0x1b')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x1b')]);}_0x11a784[_0xccd0('0x38')]=qs[_0xccd0('0x39')](_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x39')]);_0x11a784[_0xccd0('0x3a')]=qs['filters'](_[_0xccd0('0x3b')](_0x2a8920[_0xccd0('0x2f')],_0x277309[_0xccd0('0x31')]),_0x46342d);if(_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x3c')]){_0x11a784['where']=_[_0xccd0('0x3d')](_0x11a784['where'],{'$or':_[_0xccd0('0x29')](_0x46342d,function(_0x1629b6){if(_0x1629b6[_0xccd0('0x2d')]!==_0xccd0('0x3e')){var _0x308e63={};_0x308e63[_0x1629b6[_0xccd0('0x27')]]={'$like':'%'+_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x3c')]+'%'};return _0x308e63;}})});}_0x11a784=_[_0xccd0('0x3d')]({},_0x11a784,_0x2a8920[_0xccd0('0x3f')]);var _0x41b325={'where':_0x11a784[_0xccd0('0x3a')]};return db[_0xccd0('0x2a')][_0xccd0('0x1d')](_0x41b325)[_0xccd0('0x40')](function(_0x2ae5f1){_0x135336['count']=_0x2ae5f1;if(_0x2a8920[_0xccd0('0x2f')][_0xccd0('0x41')]){_0x11a784['include']=[{'all':!![]}];}return db[_0xccd0('0x2a')][_0xccd0('0x42')](_0x11a784);})[_0xccd0('0x40')](function(_0x3174bc){_0x135336[_0xccd0('0x43')]=_0x3174bc;return _0x135336;})[_0xccd0('0x40')](respondWithFilteredResult(_0x261615,_0x11a784))[_0xccd0('0x44')](handleError(_0x261615,null));};exports[_0xccd0('0x45')]=function(_0x266dbf,_0x1e3174){var _0x32d00a={'raw':!![],'where':{'id':_0x266dbf[_0xccd0('0x46')]['id']}},_0x35fa4b={};_0x35fa4b[_0xccd0('0x32')]=_[_0xccd0('0x30')](db[_0xccd0('0x2a')][_0xccd0('0x2b')]);_0x35fa4b['query']=_['keys'](_0x266dbf['query']);_0x35fa4b[_0xccd0('0x31')]=_['intersection'](_0x35fa4b[_0xccd0('0x32')],_0x35fa4b[_0xccd0('0x2f')]);_0x32d00a[_0xccd0('0x33')]=_[_0xccd0('0x34')](_0x35fa4b[_0xccd0('0x32')],qs[_0xccd0('0x35')](_0x266dbf[_0xccd0('0x2f')]['fields']));_0x32d00a[_0xccd0('0x33')]=_0x32d00a[_0xccd0('0x33')][_0xccd0('0x47')]?_0x32d00a[_0xccd0('0x33')]:_0x35fa4b['model'];if(_0x266dbf['query'][_0xccd0('0x41')]){_0x32d00a[_0xccd0('0x48')]=[{'all':!![]}];}_0x32d00a=_[_0xccd0('0x3d')]({},_0x32d00a,_0x266dbf[_0xccd0('0x3f')]);return db[_0xccd0('0x2a')][_0xccd0('0x49')](_0x32d00a)[_0xccd0('0x40')](handleEntityNotFound(_0x1e3174,null))[_0xccd0('0x40')](respondWithResult(_0x1e3174,null))[_0xccd0('0x44')](handleError(_0x1e3174,null));};exports[_0xccd0('0x4a')]=function(_0x358577,_0x20a440){return db[_0xccd0('0x2a')]['create'](_0x358577[_0xccd0('0x4b')],{})[_0xccd0('0x40')](respondWithResult(_0x20a440,0xc9))[_0xccd0('0x44')](handleError(_0x20a440,null));};exports[_0xccd0('0x24')]=function(_0x366998,_0x50ac8f){if(_0x366998['body']['id']){delete _0x366998[_0xccd0('0x4b')]['id'];}return db[_0xccd0('0x2a')][_0xccd0('0x49')]({'where':{'id':_0x366998[_0xccd0('0x46')]['id']}})[_0xccd0('0x40')](handleEntityNotFound(_0x50ac8f,null))[_0xccd0('0x40')](saveUpdates(_0x366998[_0xccd0('0x4b')],null))['then'](respondWithResult(_0x50ac8f,null))[_0xccd0('0x44')](handleError(_0x50ac8f,null));};exports[_0xccd0('0x25')]=function(_0x477e50,_0x3e3bb4){return db[_0xccd0('0x2a')][_0xccd0('0x49')]({'where':{'id':_0x477e50['params']['id']}})[_0xccd0('0x40')](handleEntityNotFound(_0x3e3bb4,null))[_0xccd0('0x40')](removeEntity(_0x3e3bb4,null))[_0xccd0('0x44')](handleError(_0x3e3bb4,null));};exports[_0xccd0('0x4c')]=function(_0x4daa4e,_0x46f4d6){return db[_0xccd0('0x2a')][_0xccd0('0x4c')]()[_0xccd0('0x40')](respondWithResult(_0x46f4d6,null))[_0xccd0('0x44')](handleError(_0x46f4d6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 4aa87b7..fe50528 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 _0x2e3d=['api','moment','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','util','../../config/logger'];(function(_0x495569,_0x5e6eab){var _0x46286b=function(_0x33a218){while(--_0x33a218){_0x495569['push'](_0x495569['shift']());}};_0x46286b(++_0x5e6eab);}(_0x2e3d,0x8c));var _0xd2e3=function(_0x1f15d0,_0x5979f4){_0x1f15d0=_0x1f15d0-0x0;var _0x9200ae=_0x2e3d[_0x1f15d0];return _0x9200ae;};'use strict';var _=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var logger=require(_0xd2e3('0x2'))(_0xd2e3('0x3'));var moment=require(_0xd2e3('0x4'));var BPromise=require(_0xd2e3('0x5'));var rp=require(_0xd2e3('0x6'));var fs=require('fs');var path=require(_0xd2e3('0x7'));var rimraf=require(_0xd2e3('0x8'));var config=require('../../config/environment');var attributes=require(_0xd2e3('0x9'));module[_0xd2e3('0xa')]=function(_0x2ea6e2,_0x3da0e9){return _0x2ea6e2['define'](_0xd2e3('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xd2e3('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7ed=['bluebird','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','moment'];(function(_0x53e93b,_0x488a91){var _0x1a5985=function(_0x1c6c3c){while(--_0x1c6c3c){_0x53e93b['push'](_0x53e93b['shift']());}};_0x1a5985(++_0x488a91);}(_0xf7ed,0x1a1));var _0xdf7e=function(_0x33840e,_0x45b058){_0x33840e=_0x33840e-0x0;var _0x3bf4ec=_0xf7ed[_0x33840e];return _0x3bf4ec;};'use strict';var _=require('lodash');var util=require(_0xdf7e('0x0'));var logger=require(_0xdf7e('0x1'))('api');var moment=require(_0xdf7e('0x2'));var BPromise=require(_0xdf7e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf7e('0x4'));var rimraf=require(_0xdf7e('0x5'));var config=require('../../config/environment');var attributes=require(_0xdf7e('0x6'));module[_0xdf7e('0x7')]=function(_0x1c4f77,_0x51db33){return _0x1c4f77[_0xdf7e('0x8')](_0xdf7e('0x9'),attributes,{'tableName':_0xdf7e('0xa'),'paranoid':![],'indexes':[{'name':_0xdf7e('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 857b8f7..4ec665d 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 _0xbd2a=['randomstring','ioredis','../../config/utils','rpc','then','request\x20sent','debug','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0xd4cee4,_0x587f80){var _0x3bc2e4=function(_0x36676c){while(--_0x36676c){_0xd4cee4['push'](_0xd4cee4['shift']());}};_0x3bc2e4(++_0x587f80);}(_0xbd2a,0x1ac));var _0xabd2=function(_0xcaee61,_0x185703){_0xcaee61=_0xcaee61-0x0;var _0x3bf0d8=_0xbd2a[_0xcaee61];return _0x3bf0d8;};'use strict';var _=require(_0xabd2('0x0'));var util=require(_0xabd2('0x1'));var moment=require(_0xabd2('0x2'));var BPromise=require(_0xabd2('0x3'));var rs=require(_0xabd2('0x4'));var fs=require('fs');var Redis=require(_0xabd2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xabd2('0x6'));var logger=require('../../config/logger')(_0xabd2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15adec,_0x22ff1e,_0x4a4801){return new BPromise(function(_0x417340,_0x2f6b65){return client['request'](_0x15adec,_0x4a4801)[_0xabd2('0x8')](function(_0x3ea576){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x22ff1e,_0xabd2('0x9'));logger[_0xabd2('0xa')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x22ff1e,_0xabd2('0x9'),JSON[_0xabd2('0xb')](_0x3ea576));if(_0x3ea576['error']){if(_0x3ea576[_0xabd2('0xc')][_0xabd2('0xd')]===0x1f4){logger['error'](_0xabd2('0xe'),_0x22ff1e,_0x3ea576[_0xabd2('0xc')][_0xabd2('0xf')]);return _0x2f6b65(_0x3ea576[_0xabd2('0xc')]['message']);}logger[_0xabd2('0xc')](_0xabd2('0xe'),_0x22ff1e,_0x3ea576[_0xabd2('0xc')]['message']);return _0x417340(_0x3ea576['error'][_0xabd2('0xf')]);}else{logger[_0xabd2('0x10')](_0xabd2('0xe'),_0x22ff1e,_0xabd2('0x9'));_0x417340(_0x3ea576[_0xabd2('0x11')][_0xabd2('0xf')]);}})['catch'](function(_0x4053f5){logger[_0xabd2('0xc')](_0xabd2('0xe'),_0x22ff1e,_0x4053f5);_0x2f6b65(_0x4053f5);});});} \ No newline at end of file +var _0xeadf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1061c8,_0x2eb6a3){var _0x7f876d=function(_0x599dc3){while(--_0x599dc3){_0x1061c8['push'](_0x1061c8['shift']());}};_0x7f876d(++_0x2eb6a3);}(_0xeadf,0xa4));var _0xfead=function(_0x5ba513,_0x459c3b){_0x5ba513=_0x5ba513-0x0;var _0x1132a0=_0xeadf[_0x5ba513];return _0x1132a0;};'use strict';var _=require(_0xfead('0x0'));var util=require('util');var moment=require(_0xfead('0x1'));var BPromise=require(_0xfead('0x2'));var rs=require(_0xfead('0x3'));var fs=require('fs');var Redis=require(_0xfead('0x4'));var db=require(_0xfead('0x5'))['db'];var utils=require(_0xfead('0x6'));var logger=require(_0xfead('0x7'))(_0xfead('0x8'));var config=require('../../config/environment');var jayson=require(_0xfead('0x9'));var client=jayson['client'][_0xfead('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56afbf,_0x1d3aa7,_0x4eb17d){return new BPromise(function(_0x7faaa5,_0x50feef){return client[_0xfead('0xb')](_0x56afbf,_0x4eb17d)[_0xfead('0xc')](function(_0x310edc){logger['info'](_0xfead('0xd'),_0x1d3aa7,_0xfead('0xe'));logger[_0xfead('0xf')](_0xfead('0x10'),_0x1d3aa7,_0xfead('0xe'),JSON[_0xfead('0x11')](_0x310edc));if(_0x310edc[_0xfead('0x12')]){if(_0x310edc[_0xfead('0x12')][_0xfead('0x13')]===0x1f4){logger[_0xfead('0x12')](_0xfead('0xd'),_0x1d3aa7,_0x310edc[_0xfead('0x12')][_0xfead('0x14')]);return _0x50feef(_0x310edc[_0xfead('0x12')][_0xfead('0x14')]);}logger['error'](_0xfead('0xd'),_0x1d3aa7,_0x310edc['error']['message']);return _0x7faaa5(_0x310edc[_0xfead('0x12')]['message']);}else{logger[_0xfead('0x15')](_0xfead('0xd'),_0x1d3aa7,'request\x20sent');_0x7faaa5(_0x310edc[_0xfead('0x16')][_0xfead('0x14')]);}})[_0xfead('0x17')](function(_0x23d3ba){logger[_0xfead('0x12')](_0xfead('0xd'),_0x1d3aa7,_0x23d3ba);_0x50feef(_0x23d3ba);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 552e594..16ae2de 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 _0xb4c3=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','/:id','delete','destroy','exports'];(function(_0x49cb88,_0x1d3c8b){var _0x1308fd=function(_0x209511){while(--_0x209511){_0x49cb88['push'](_0x49cb88['shift']());}};_0x1308fd(++_0x1d3c8b);}(_0xb4c3,0x140));var _0x3b4c=function(_0x3f7e30,_0x34ee12){_0x3f7e30=_0x3f7e30-0x0;var _0x18efe6=_0xb4c3[_0x3f7e30];return _0x18efe6;};'use strict';var multer=require(_0x3b4c('0x0'));var util=require(_0x3b4c('0x1'));var path=require(_0x3b4c('0x2'));var timeout=require(_0x3b4c('0x3'));var express=require('express');var router=express[_0x3b4c('0x4')]();var fs_extra=require(_0x3b4c('0x5'));var auth=require(_0x3b4c('0x6'));var interaction=require(_0x3b4c('0x7'));var config=require('../../config/environment');var controller=require(_0x3b4c('0x8'));router[_0x3b4c('0x9')]('/',auth[_0x3b4c('0xa')](),controller[_0x3b4c('0xb')]);router['get'](_0x3b4c('0xc'),auth[_0x3b4c('0xa')](),controller[_0x3b4c('0xd')]);router[_0x3b4c('0x9')]('/:id',auth[_0x3b4c('0xa')](),controller[_0x3b4c('0xe')]);router[_0x3b4c('0xf')]('/',auth[_0x3b4c('0xa')](),controller['create']);router['put'](_0x3b4c('0x10'),auth[_0x3b4c('0xa')](),controller['update']);router[_0x3b4c('0x11')](_0x3b4c('0x10'),auth['isAuthenticated'](),controller[_0x3b4c('0x12')]);module[_0x3b4c('0x13')]=router; \ No newline at end of file +var _0xaabd=['index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0xaabd,0x1c1));var _0xdaab=function(_0x56213b,_0x20a174){_0x56213b=_0x56213b-0x0;var _0x1d74be=_0xaabd[_0x56213b];return _0x1d74be;};'use strict';var multer=require(_0xdaab('0x0'));var util=require(_0xdaab('0x1'));var path=require(_0xdaab('0x2'));var timeout=require(_0xdaab('0x3'));var express=require(_0xdaab('0x4'));var router=express[_0xdaab('0x5')]();var fs_extra=require(_0xdaab('0x6'));var auth=require(_0xdaab('0x7'));var interaction=require(_0xdaab('0x8'));var config=require('../../config/environment');var controller=require(_0xdaab('0x9'));router[_0xdaab('0xa')]('/',auth['isAuthenticated'](),controller[_0xdaab('0xb')]);router[_0xdaab('0xa')](_0xdaab('0xc'),auth[_0xdaab('0xd')](),controller['describe']);router[_0xdaab('0xa')]('/:id',auth[_0xdaab('0xd')](),controller[_0xdaab('0xe')]);router[_0xdaab('0xf')]('/',auth[_0xdaab('0xd')](),controller[_0xdaab('0x10')]);router[_0xdaab('0x11')](_0xdaab('0x12'),auth['isAuthenticated'](),controller[_0xdaab('0x13')]);router[_0xdaab('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdaab('0x15')]);module[_0xdaab('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 50748f9..4bcfbda 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 _0x141e=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','getDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize'];(function(_0x15a033,_0x379888){var _0x44b426=function(_0x3d1309){while(--_0x3d1309){_0x15a033['push'](_0x15a033['shift']());}};_0x44b426(++_0x379888);}(_0x141e,0x192));var _0xe141=function(_0x5be8db,_0x1f198f){_0x5be8db=_0x5be8db-0x0;var _0x2e8b8b=_0x141e[_0x5be8db];return _0x2e8b8b;};'use strict';var Sequelize=require(_0xe141('0x0'));var moment=require(_0xe141('0x1'));module[_0xe141('0x2')]={'channel':{'type':Sequelize[_0xe141('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe141('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x45cc64){var _0xa6520c=moment(_0x45cc64);var _0x3401d7=moment(this[_0xe141('0x5')]('enterAt'));var _0x2260d6=_0xa6520c['diff'](_0x3401d7,'seconds');this['setDataValue'](_0xe141('0x6'),_0x45cc64);this['setDataValue'](_0xe141('0x7'),_0x2260d6>=0x0?_0x2260d6:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xe141('0x3')],'comment':_0xe141('0x8')},'data3':{'type':Sequelize[_0xe141('0x3')],'comment':_0xe141('0x9')},'data4':{'type':Sequelize[_0xe141('0x3')],'comment':_0xe141('0xa')},'data5':{'type':Sequelize[_0xe141('0x3')],'comment':_0xe141('0xb')},'role':{'type':Sequelize[_0xe141('0x3')]},'internal':{'type':Sequelize[_0xe141('0xc')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0dae=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize'];(function(_0x215f22,_0x208e27){var _0xab09fe=function(_0x13deae){while(--_0x13deae){_0x215f22['push'](_0x215f22['shift']());}};_0xab09fe(++_0x208e27);}(_0x0dae,0x18e));var _0xe0da=function(_0xb60ae4,_0x48b458){_0xb60ae4=_0xb60ae4-0x0;var _0x53d530=_0x0dae[_0xb60ae4];return _0x53d530;};'use strict';var Sequelize=require(_0xe0da('0x0'));var moment=require('moment');module[_0xe0da('0x1')]={'channel':{'type':Sequelize[_0xe0da('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xe0da('0x2')]},'type':{'type':Sequelize[_0xe0da('0x2')],'defaultValue':_0xe0da('0x3'),'comment':_0xe0da('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xe0da('0x5')]},'exitAt':{'type':Sequelize[_0xe0da('0x5')],'set':function(_0x1a5cd2){var _0x4cbc80=moment(_0x1a5cd2);var _0x149e9a=moment(this[_0xe0da('0x6')](_0xe0da('0x7')));var _0x4fbde7=_0x4cbc80[_0xe0da('0x8')](_0x149e9a,_0xe0da('0x9'));this[_0xe0da('0xa')](_0xe0da('0xb'),_0x1a5cd2);this['setDataValue'](_0xe0da('0xc'),_0x4fbde7>=0x0?_0x4fbde7:null);}},'data1':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0xd')},'data2':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0xe')},'data3':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0xe0da('0x10')},'data5':{'type':Sequelize[_0xe0da('0x2')],'comment':_0xe0da('0x11')},'role':{'type':Sequelize[_0xe0da('0x2')]},'internal':{'type':Sequelize[_0xe0da('0x12')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index c57d4dc..2dd4ee0 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(_0x53b07e,_0x3bc254){var _0x5490b7=function(_0xd2e262){while(--_0xd2e262){_0x53b07e['push'](_0x53b07e['shift']());}};_0x5490b7(++_0x3bc254);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0xf1a005,_0x361fee){var _0x5313f6=function(_0x3753f8){while(--_0x3753f8){_0xf1a005['push'](_0xf1a005['shift']());}};_0x5313f6(++_0x361fee);}(_0x008c,0x188));var _0xc008=function(_0x50c7e5,_0x380f0f){_0x50c7e5=_0x50c7e5-0x0;var _0x108f56=_0x008c[_0x50c7e5];return _0x108f56;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8e6acac..ea0f32b 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 _0xe542=['./memberReport.attributes','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','rimraf','../../config/environment'];(function(_0x417bb2,_0x5c9f9d){var _0x30fa6e=function(_0x1f4651){while(--_0x1f4651){_0x417bb2['push'](_0x417bb2['shift']());}};_0x30fa6e(++_0x5c9f9d);}(_0xe542,0x16e));var _0x2e54=function(_0x886a77,_0x431993){_0x886a77=_0x886a77-0x0;var _0x40c505=_0xe542[_0x886a77];return _0x40c505;};'use strict';var _=require(_0x2e54('0x0'));var util=require(_0x2e54('0x1'));var logger=require(_0x2e54('0x2'))(_0x2e54('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e54('0x4'));var config=require(_0x2e54('0x5'));var attributes=require(_0x2e54('0x6'));module['exports']=function(_0x2e251a,_0x265290){return _0x2e251a['define'](_0x2e54('0x7'),attributes,{'tableName':_0x2e54('0x8'),'paranoid':![],'indexes':[{'name':_0x2e54('0x9'),'fields':[_0x2e54('0xa'),_0x2e54('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2171=['api','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername','interface','util','../../config/logger'];(function(_0xb725be,_0x45bd01){var _0x2f2424=function(_0x2566ca){while(--_0x2566ca){_0xb725be['push'](_0xb725be['shift']());}};_0x2f2424(++_0x45bd01);}(_0x2171,0x143));var _0x1217=function(_0xee8ecf,_0x428de6){_0xee8ecf=_0xee8ecf-0x0;var _0x1884c4=_0x2171[_0xee8ecf];return _0x1884c4;};'use strict';var _=require('lodash');var util=require(_0x1217('0x0'));var logger=require(_0x1217('0x1'))(_0x1217('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1217('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1217('0x4'));var config=require(_0x1217('0x5'));var attributes=require(_0x1217('0x6'));module[_0x1217('0x7')]=function(_0x4eb644,_0xafdf42){return _0x4eb644[_0x1217('0x8')](_0x1217('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x1217('0xa'),'fields':[_0x1217('0xb'),_0x1217('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 4627bc7..fa7a8e3 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 _0x8ad5=['code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','map','include','model','CreateMemberReport','body','UpdateMemberReport','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x152b67,_0x172d87){var _0x34014b=function(_0x4138da){while(--_0x4138da){_0x152b67['push'](_0x152b67['shift']());}};_0x34014b(++_0x172d87);}(_0x8ad5,0xf1));var _0x58ad=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x8ad5[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var moment=require(_0x58ad('0x2'));var BPromise=require(_0x58ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58ad('0x4'))['db'];var utils=require(_0x58ad('0x5'));var logger=require(_0x58ad('0x6'))(_0x58ad('0x7'));var config=require(_0x58ad('0x8'));var jayson=require(_0x58ad('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x394972,_0x22c63f,_0x220c5f){return new BPromise(function(_0x2033a3,_0xe5d483){return client[_0x58ad('0xa')](_0x394972,_0x220c5f)[_0x58ad('0xb')](function(_0x14fa03){logger[_0x58ad('0xc')]('MemberReport,\x20%s,\x20%s',_0x22c63f,_0x58ad('0xd'));logger[_0x58ad('0xe')](_0x58ad('0xf'),_0x22c63f,_0x58ad('0xd'),JSON[_0x58ad('0x10')](_0x14fa03));if(_0x14fa03[_0x58ad('0x11')]){if(_0x14fa03[_0x58ad('0x11')][_0x58ad('0x12')]===0x1f4){logger['error'](_0x58ad('0x13'),_0x22c63f,_0x14fa03[_0x58ad('0x11')][_0x58ad('0x14')]);return _0xe5d483(_0x14fa03[_0x58ad('0x11')][_0x58ad('0x14')]);}logger[_0x58ad('0x11')](_0x58ad('0x13'),_0x22c63f,_0x14fa03[_0x58ad('0x11')]['message']);return _0x2033a3(_0x14fa03['error']['message']);}else{logger['info'](_0x58ad('0x13'),_0x22c63f,'request\x20sent');_0x2033a3(_0x14fa03[_0x58ad('0x15')][_0x58ad('0x14')]);}})[_0x58ad('0x16')](function(_0x280618){logger[_0x58ad('0x11')]('MemberReport,\x20%s,\x20%s',_0x22c63f,_0x280618);_0xe5d483(_0x280618);});});}exports[_0x58ad('0x17')]=function(_0x24fbe0){var _0x3233d8=this;return new Promise(function(_0xc8b034,_0x397027){return db[_0x58ad('0x18')][_0x58ad('0x19')]({'raw':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0['options'][_0x58ad('0x1b')]===undefined?!![]:![]:!![],'where':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0[_0x58ad('0x1a')]['where']||null:null,'attributes':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0[_0x58ad('0x1a')][_0x58ad('0x1c')]||null:null,'limit':_0x24fbe0['options']?_0x24fbe0[_0x58ad('0x1a')][_0x58ad('0x1d')]||null:null,'include':_0x24fbe0[_0x58ad('0x1a')]?_0x24fbe0[_0x58ad('0x1a')]['include']?_[_0x58ad('0x1e')](_0x24fbe0[_0x58ad('0x1a')][_0x58ad('0x1f')],function(_0x5f7669){return{'model':db[_0x5f7669[_0x58ad('0x20')]],'as':_0x5f7669['as'],'attributes':_0x5f7669[_0x58ad('0x1c')],'include':_0x5f7669[_0x58ad('0x1f')]?_[_0x58ad('0x1e')](_0x5f7669['include'],function(_0x13220b){return{'model':db[_0x13220b['model']],'as':_0x13220b['as'],'attributes':_0x13220b[_0x58ad('0x1c')],'include':_0x13220b['include']?_['map'](_0x13220b[_0x58ad('0x1f')],function(_0x3d7d74){return{'model':db[_0x3d7d74[_0x58ad('0x20')]],'as':_0x3d7d74['as'],'attributes':_0x3d7d74[_0x58ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x58ad('0xb')](function(_0x4332c){logger[_0x58ad('0xc')](_0x58ad('0x17'),_0x24fbe0);logger[_0x58ad('0xe')](_0x58ad('0x17'),_0x24fbe0,JSON[_0x58ad('0x10')](_0x4332c));_0xc8b034(_0x4332c);})['catch'](function(_0x2bffbd){logger[_0x58ad('0x11')](_0x58ad('0x17'),_0x2bffbd[_0x58ad('0x14')],_0x24fbe0);_0x397027(_0x3233d8[_0x58ad('0x11')](0x1f4,_0x2bffbd['message']));});});};exports[_0x58ad('0x21')]=function(_0x35ee58){var _0x3850d4=this;return new Promise(function(_0x7dacc4,_0x370d12){return db['MemberReport']['create'](_0x35ee58[_0x58ad('0x22')],{'raw':_0x35ee58[_0x58ad('0x1a')]?_0x35ee58[_0x58ad('0x1a')][_0x58ad('0x1b')]===undefined?!![]:![]:!![]})[_0x58ad('0xb')](function(_0x2aa6df){logger[_0x58ad('0xc')](_0x58ad('0x21'),_0x35ee58);logger['debug'](_0x58ad('0x21'),_0x35ee58,JSON[_0x58ad('0x10')](_0x2aa6df));_0x7dacc4(_0x2aa6df);})[_0x58ad('0x16')](function(_0x512281){logger[_0x58ad('0x11')]('CreateMemberReport',_0x512281[_0x58ad('0x14')],_0x35ee58);_0x370d12(_0x3850d4[_0x58ad('0x11')](0x1f4,_0x512281['message']));});});};exports[_0x58ad('0x23')]=function(_0x305c1f){var _0x4b0d2d=this;return new Promise(function(_0x4caf7b,_0x1d6ddd){return db[_0x58ad('0x18')]['update'](_0x305c1f[_0x58ad('0x22')],{'raw':_0x305c1f['options']?_0x305c1f['options'][_0x58ad('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x305c1f[_0x58ad('0x1a')]?_0x305c1f[_0x58ad('0x1a')][_0x58ad('0x24')]||null:null,'attributes':_0x305c1f[_0x58ad('0x1a')]?_0x305c1f['options'][_0x58ad('0x1c')]||null:null,'limit':_0x305c1f[_0x58ad('0x1a')]?_0x305c1f[_0x58ad('0x1a')][_0x58ad('0x1d')]||null:null})[_0x58ad('0xb')](function(_0x572a61){logger[_0x58ad('0xc')](_0x58ad('0x23'),_0x305c1f);logger[_0x58ad('0xe')]('UpdateMemberReport',_0x305c1f,JSON['stringify'](_0x572a61));_0x4caf7b(_0x572a61);})['catch'](function(_0x9693ee){logger['error'](_0x58ad('0x23'),_0x9693ee[_0x58ad('0x14')],_0x305c1f);_0x1d6ddd(_0x4b0d2d[_0x58ad('0x11')](0x1f4,_0x9693ee[_0x58ad('0x14')]));});});}; \ No newline at end of file +var _0x6b4e=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','MemberReport,\x20%s,\x20%s','message','result','catch','MemberReport','options','raw','where','limit','include','map','model','attributes','GetMemberReport','CreateMemberReport','body','stringify','update','UpdateMemberReport','util','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4358f5,_0x5b1ac6){var _0x4d8104=function(_0x1d4aee){while(--_0x1d4aee){_0x4358f5['push'](_0x4358f5['shift']());}};_0x4d8104(++_0x5b1ac6);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x37c987,_0x437c1f){_0x37c987=_0x37c987-0x0;var _0x26c65a=_0x6b4e[_0x37c987];return _0x26c65a;};'use strict';var _=require('lodash');var util=require(_0xe6b4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6b4('0x1'))['db'];var utils=require(_0xe6b4('0x2'));var logger=require(_0xe6b4('0x3'))(_0xe6b4('0x4'));var config=require(_0xe6b4('0x5'));var jayson=require(_0xe6b4('0x6'));var client=jayson['client'][_0xe6b4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3458d8,_0x3391b9,_0x1d062b){return new BPromise(function(_0x15cf31,_0x3e5506){return client[_0xe6b4('0x8')](_0x3458d8,_0x1d062b)[_0xe6b4('0x9')](function(_0x461f53){logger[_0xe6b4('0xa')]('MemberReport,\x20%s,\x20%s',_0x3391b9,_0xe6b4('0xb'));logger[_0xe6b4('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3391b9,'request\x20sent',JSON['stringify'](_0x461f53));if(_0x461f53[_0xe6b4('0xd')]){if(_0x461f53[_0xe6b4('0xd')]['code']===0x1f4){logger[_0xe6b4('0xd')](_0xe6b4('0xe'),_0x3391b9,_0x461f53[_0xe6b4('0xd')][_0xe6b4('0xf')]);return _0x3e5506(_0x461f53[_0xe6b4('0xd')]['message']);}logger[_0xe6b4('0xd')](_0xe6b4('0xe'),_0x3391b9,_0x461f53[_0xe6b4('0xd')][_0xe6b4('0xf')]);return _0x15cf31(_0x461f53['error'][_0xe6b4('0xf')]);}else{logger[_0xe6b4('0xa')](_0xe6b4('0xe'),_0x3391b9,_0xe6b4('0xb'));_0x15cf31(_0x461f53[_0xe6b4('0x10')]['message']);}})[_0xe6b4('0x11')](function(_0x2c9335){logger[_0xe6b4('0xd')]('MemberReport,\x20%s,\x20%s',_0x3391b9,_0x2c9335);_0x3e5506(_0x2c9335);});});}exports['GetMemberReport']=function(_0x5e77f2){var _0x3b5ce6=this;return new Promise(function(_0x5877c1,_0x529858){return db[_0xe6b4('0x12')]['findAll']({'raw':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')][_0xe6b4('0x14')]===undefined?!![]:![]:!![],'where':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')][_0xe6b4('0x15')]||null:null,'attributes':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')]['attributes']||null:null,'limit':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2['options'][_0xe6b4('0x16')]||null:null,'include':_0x5e77f2[_0xe6b4('0x13')]?_0x5e77f2[_0xe6b4('0x13')][_0xe6b4('0x17')]?_[_0xe6b4('0x18')](_0x5e77f2['options']['include'],function(_0x52ee39){return{'model':db[_0x52ee39[_0xe6b4('0x19')]],'as':_0x52ee39['as'],'attributes':_0x52ee39['attributes'],'include':_0x52ee39[_0xe6b4('0x17')]?_[_0xe6b4('0x18')](_0x52ee39[_0xe6b4('0x17')],function(_0x28bfef){return{'model':db[_0x28bfef['model']],'as':_0x28bfef['as'],'attributes':_0x28bfef[_0xe6b4('0x1a')],'include':_0x28bfef[_0xe6b4('0x17')]?_[_0xe6b4('0x18')](_0x28bfef['include'],function(_0x45a397){return{'model':db[_0x45a397['model']],'as':_0x45a397['as'],'attributes':_0x45a397[_0xe6b4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe6b4('0x9')](function(_0x5a4e25){logger[_0xe6b4('0xa')](_0xe6b4('0x1b'),_0x5e77f2);logger[_0xe6b4('0xc')]('GetMemberReport',_0x5e77f2,JSON['stringify'](_0x5a4e25));_0x5877c1(_0x5a4e25);})[_0xe6b4('0x11')](function(_0x223239){logger[_0xe6b4('0xd')](_0xe6b4('0x1b'),_0x223239[_0xe6b4('0xf')],_0x5e77f2);_0x529858(_0x3b5ce6[_0xe6b4('0xd')](0x1f4,_0x223239[_0xe6b4('0xf')]));});});};exports[_0xe6b4('0x1c')]=function(_0x42f875){var _0x56a91e=this;return new Promise(function(_0x4f2c58,_0x1e236b){return db[_0xe6b4('0x12')]['create'](_0x42f875[_0xe6b4('0x1d')],{'raw':_0x42f875[_0xe6b4('0x13')]?_0x42f875[_0xe6b4('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xe6b4('0x9')](function(_0x3a9c18){logger[_0xe6b4('0xa')](_0xe6b4('0x1c'),_0x42f875);logger[_0xe6b4('0xc')](_0xe6b4('0x1c'),_0x42f875,JSON[_0xe6b4('0x1e')](_0x3a9c18));_0x4f2c58(_0x3a9c18);})['catch'](function(_0x195cb1){logger[_0xe6b4('0xd')](_0xe6b4('0x1c'),_0x195cb1['message'],_0x42f875);_0x1e236b(_0x56a91e[_0xe6b4('0xd')](0x1f4,_0x195cb1[_0xe6b4('0xf')]));});});};exports['UpdateMemberReport']=function(_0x28e3a8){var _0x425b84=this;return new Promise(function(_0x2b846a,_0x46ea16){return db['MemberReport'][_0xe6b4('0x1f')](_0x28e3a8[_0xe6b4('0x1d')],{'raw':_0x28e3a8[_0xe6b4('0x13')]?_0x28e3a8['options'][_0xe6b4('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28e3a8['options']?_0x28e3a8[_0xe6b4('0x13')]['where']||null:null,'attributes':_0x28e3a8['options']?_0x28e3a8[_0xe6b4('0x13')][_0xe6b4('0x1a')]||null:null,'limit':_0x28e3a8[_0xe6b4('0x13')]?_0x28e3a8['options'][_0xe6b4('0x16')]||null:null})[_0xe6b4('0x9')](function(_0x417787){logger[_0xe6b4('0xa')](_0xe6b4('0x20'),_0x28e3a8);logger[_0xe6b4('0xc')](_0xe6b4('0x20'),_0x28e3a8,JSON[_0xe6b4('0x1e')](_0x417787));_0x2b846a(_0x417787);})[_0xe6b4('0x11')](function(_0x54a545){logger[_0xe6b4('0xd')]('UpdateMemberReport',_0x54a545['message'],_0x28e3a8);_0x46ea16(_0x425b84[_0xe6b4('0xd')](0x1f4,_0x54a545[_0xe6b4('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d7445f8..2cad589 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 _0x9f82=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x4dfa20,_0x35afb5){var _0x146afc=function(_0x5a4344){while(--_0x5a4344){_0x4dfa20['push'](_0x4dfa20['shift']());}};_0x146afc(++_0x35afb5);}(_0x9f82,0x111));var _0x29f8=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9f82[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require(_0x29f8('0x0'));var path=require(_0x29f8('0x1'));var timeout=require(_0x29f8('0x2'));var express=require(_0x29f8('0x3'));var router=express[_0x29f8('0x4')]();var fs_extra=require(_0x29f8('0x5'));var auth=require(_0x29f8('0x6'));var interaction=require(_0x29f8('0x7'));var config=require(_0x29f8('0x8'));var controller=require(_0x29f8('0x9'));router[_0x29f8('0xa')]('/',controller[_0x29f8('0xb')]);module[_0x29f8('0xc')]=router; \ No newline at end of file +var _0xe0bf=['../../components/auth/service','../../config/environment','get','index','exports','util','connect-timeout','express','Router'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xe0bf,0xa7));var _0xfe0b=function(_0x18222c,_0x30fcd9){_0x18222c=_0x18222c-0x0;var _0x50bdab=_0xe0bf[_0x18222c];return _0x50bdab;};'use strict';var multer=require('multer');var util=require(_0xfe0b('0x0'));var path=require('path');var timeout=require(_0xfe0b('0x1'));var express=require(_0xfe0b('0x2'));var router=express[_0xfe0b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfe0b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfe0b('0x5'));var controller=require('./migration.controller');router[_0xfe0b('0x6')]('/',controller[_0xfe0b('0x7')]);module[_0xfe0b('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index ae33331..902482b 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 _0xe7f0=['sequelize','version'];(function(_0x26abd4,_0x422bfc){var _0x458578=function(_0xfcb055){while(--_0xfcb055){_0x26abd4['push'](_0x26abd4['shift']());}};_0x458578(++_0x422bfc);}(_0xe7f0,0x122));var _0x0e7f=function(_0x36103d,_0x3453b9){_0x36103d=_0x36103d-0x0;var _0x4edadd=_0xe7f0[_0x36103d];return _0x4edadd;};'use strict';var Sequelize=require(_0x0e7f('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x0e7f('0x1')}}; \ No newline at end of file +var _0x1816=['exports','STRING','version','sequelize'];(function(_0x134836,_0x2da340){var _0x2bef16=function(_0x3579ad){while(--_0x3579ad){_0x134836['push'](_0x134836['shift']());}};_0x2bef16(++_0x2da340);}(_0x1816,0x1ab));var _0x6181=function(_0x220759,_0x3d2209){_0x220759=_0x220759-0x0;var _0x5b6439=_0x1816[_0x220759];return _0x5b6439;};'use strict';var Sequelize=require(_0x6181('0x0'));module[_0x6181('0x1')]={'version':{'type':Sequelize[_0x6181('0x2')],'unique':_0x6181('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0f5aded..70f0e65 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 _0x35b4=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','Migration','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x2616cd,_0x6b2d90){var _0x4e1fcb=function(_0x2562cb){while(--_0x2562cb){_0x2616cd['push'](_0x2616cd['shift']());}};_0x4e1fcb(++_0x6b2d90);}(_0x35b4,0x14e));var _0x435b=function(_0x5f513c,_0x100e31){_0x5f513c=_0x5f513c-0x0;var _0xa9dc8f=_0x35b4[_0x5f513c];return _0xa9dc8f;};'use strict';var emlformat=require(_0x435b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x435b('0x1'));var jsonpatch=require(_0x435b('0x2'));var rp=require(_0x435b('0x3'));var moment=require('moment');var BPromise=require(_0x435b('0x4'));var Mustache=require(_0x435b('0x5'));var util=require('util');var path=require(_0x435b('0x6'));var sox=require(_0x435b('0x7'));var csv=require(_0x435b('0x8'));var ejs=require(_0x435b('0x9'));var fs=require('fs');var fs_extra=require(_0x435b('0xa'));var _=require(_0x435b('0xb'));var squel=require(_0x435b('0xc'));var crypto=require(_0x435b('0xd'));var jsforce=require(_0x435b('0xe'));var deskjs=require(_0x435b('0xf'));var toCsv=require(_0x435b('0x8'));var querystring=require(_0x435b('0x10'));var Papa=require(_0x435b('0x11'));var Redis=require(_0x435b('0x12'));var authService=require(_0x435b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x435b('0x14'));var hardwareService=require(_0x435b('0x15'));var logger=require(_0x435b('0x16'))(_0x435b('0x17'));var utils=require('../../config/utils');var config=require(_0x435b('0x18'));var licenseUtil=require(_0x435b('0x19'));var db=require(_0x435b('0x1a'))['db'];function respondWithStatusCode(_0x2853ab,_0x160174){_0x160174=_0x160174||0xcc;return function(_0x58b643){if(_0x58b643){return _0x2853ab[_0x435b('0x1b')](_0x160174);}return _0x2853ab[_0x435b('0x1c')](_0x160174)[_0x435b('0x1d')]();};}function respondWithResult(_0x144539,_0x2837f2){_0x2837f2=_0x2837f2||0xc8;return function(_0xc97186){if(_0xc97186){return _0x144539['status'](_0x2837f2)['json'](_0xc97186);}};}function respondWithFilteredResult(_0x3bda64,_0x526236){return function(_0x22dd37){if(_0x22dd37){var _0x5b3968=typeof _0x526236[_0x435b('0x1e')]===_0x435b('0x1f')&&typeof _0x526236[_0x435b('0x20')]==='undefined';var _0x5e726b=_0x22dd37[_0x435b('0x21')];var _0x4822b9=_0x5b3968?0x0:_0x526236[_0x435b('0x1e')];var _0x568665=_0x5b3968?_0x22dd37[_0x435b('0x21')]:_0x526236[_0x435b('0x1e')]+_0x526236[_0x435b('0x20')];var _0x5c7e77;if(_0x568665>=_0x5e726b){_0x568665=_0x5e726b;_0x5c7e77=0xc8;}else{_0x5c7e77=0xce;}_0x3bda64['status'](_0x5c7e77);return _0x3bda64[_0x435b('0x22')](_0x435b('0x23'),_0x4822b9+'-'+_0x568665+'/'+_0x5e726b)['json'](_0x22dd37);}return null;};}function patchUpdates(_0xfcb005){return function(_0x1eeb37){try{jsonpatch[_0x435b('0x24')](_0x1eeb37,_0xfcb005,!![]);}catch(_0x377f93){return BPromise[_0x435b('0x25')](_0x377f93);}return _0x1eeb37[_0x435b('0x26')]();};}function saveUpdates(_0x2141a3,_0x45895c){return function(_0x252e53){if(_0x252e53){return _0x252e53[_0x435b('0x27')](_0x2141a3)[_0x435b('0x28')](function(_0x53715b){return _0x53715b;});}return null;};}function removeEntity(_0x38acdd,_0x5bb74a){return function(_0x2aff9c){if(_0x2aff9c){return _0x2aff9c['destroy']()[_0x435b('0x28')](function(){_0x38acdd['status'](0xcc)[_0x435b('0x1d')]();});}};}function handleEntityNotFound(_0x38a600,_0x381d69){return function(_0xf1c5a0){if(!_0xf1c5a0){_0x38a600[_0x435b('0x1b')](0x194);}return _0xf1c5a0;};}function handleError(_0x4b3643,_0x306846){_0x306846=_0x306846||0x1f4;return function(_0x86e22a){logger[_0x435b('0x29')](_0x86e22a[_0x435b('0x2a')]);if(_0x86e22a['name']){delete _0x86e22a[_0x435b('0x2b')];}_0x4b3643[_0x435b('0x1c')](_0x306846)['send'](_0x86e22a);};}exports[_0x435b('0x2c')]=function(_0x2c0f06,_0x2a61d3){var _0x54a8f7={},_0x54160={},_0x4811a5={'count':0x0,'rows':[]};var _0x32cad3=_[_0x435b('0x2d')](db[_0x435b('0x2e')][_0x435b('0x2f')],function(_0x4cd768){return{'name':_0x4cd768['fieldName'],'type':_0x4cd768['type'][_0x435b('0x30')]};});_0x54160['model']=_[_0x435b('0x2d')](_0x32cad3,_0x435b('0x2b'));_0x54160[_0x435b('0x31')]=_[_0x435b('0x32')](_0x2c0f06[_0x435b('0x31')]);_0x54160[_0x435b('0x33')]=_[_0x435b('0x34')](_0x54160[_0x435b('0x35')],_0x54160[_0x435b('0x31')]);_0x54a8f7[_0x435b('0x36')]=_['intersection'](_0x54160[_0x435b('0x35')],qs[_0x435b('0x37')](_0x2c0f06[_0x435b('0x31')]['fields']));_0x54a8f7[_0x435b('0x36')]=_0x54a8f7[_0x435b('0x36')]['length']?_0x54a8f7[_0x435b('0x36')]:_0x54160[_0x435b('0x35')];if(!_0x2c0f06['query'][_0x435b('0x38')](_0x435b('0x39'))){_0x54a8f7['limit']=qs[_0x435b('0x20')](_0x2c0f06['query'][_0x435b('0x20')]);_0x54a8f7[_0x435b('0x1e')]=qs[_0x435b('0x1e')](_0x2c0f06['query']['offset']);}_0x54a8f7['order']=qs[_0x435b('0x3a')](_0x2c0f06[_0x435b('0x31')]['sort']);_0x54a8f7[_0x435b('0x3b')]=qs[_0x435b('0x33')](_[_0x435b('0x3c')](_0x2c0f06['query'],_0x54160[_0x435b('0x33')]),_0x32cad3);if(_0x2c0f06[_0x435b('0x31')][_0x435b('0x3d')]){_0x54a8f7[_0x435b('0x3b')]=_[_0x435b('0x3e')](_0x54a8f7['where'],{'$or':_[_0x435b('0x2d')](_0x32cad3,function(_0x3453c5){if(_0x3453c5[_0x435b('0x3f')]!=='VIRTUAL'){var _0x97f1be={};_0x97f1be[_0x3453c5[_0x435b('0x2b')]]={'$like':'%'+_0x2c0f06[_0x435b('0x31')][_0x435b('0x3d')]+'%'};return _0x97f1be;}})});}_0x54a8f7=_[_0x435b('0x3e')]({},_0x54a8f7,_0x2c0f06['options']);var _0x286637={'where':_0x54a8f7['where']};return db[_0x435b('0x2e')][_0x435b('0x21')](_0x286637)[_0x435b('0x28')](function(_0x55dd19){_0x4811a5[_0x435b('0x21')]=_0x55dd19;if(_0x2c0f06['query'][_0x435b('0x40')]){_0x54a8f7[_0x435b('0x41')]=[{'all':!![]}];}return db[_0x435b('0x2e')][_0x435b('0x42')](_0x54a8f7);})['then'](function(_0x262f28){_0x4811a5[_0x435b('0x43')]=_0x262f28;return _0x4811a5;})['then'](respondWithFilteredResult(_0x2a61d3,_0x54a8f7))[_0x435b('0x44')](handleError(_0x2a61d3,null));}; \ No newline at end of file +var _0x3516=['VIRTUAL','Migration','includeAll','include','rows','catch','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3516,0x192));var _0x6351=function(_0x5a4960,_0x36e10b){_0x5a4960=_0x5a4960-0x0;var _0x59a7a8=_0x3516[_0x5a4960];return _0x59a7a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6351('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6351('0x1'));var moment=require('moment');var BPromise=require(_0x6351('0x2'));var Mustache=require(_0x6351('0x3'));var util=require(_0x6351('0x4'));var path=require('path');var sox=require(_0x6351('0x5'));var csv=require(_0x6351('0x6'));var ejs=require(_0x6351('0x7'));var fs=require('fs');var fs_extra=require(_0x6351('0x8'));var _=require(_0x6351('0x9'));var squel=require(_0x6351('0xa'));var crypto=require(_0x6351('0xb'));var jsforce=require(_0x6351('0xc'));var deskjs=require(_0x6351('0xd'));var toCsv=require(_0x6351('0x6'));var querystring=require(_0x6351('0xe'));var Papa=require(_0x6351('0xf'));var Redis=require(_0x6351('0x10'));var authService=require(_0x6351('0x11'));var qs=require(_0x6351('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6351('0x13'));var logger=require(_0x6351('0x14'))(_0x6351('0x15'));var utils=require(_0x6351('0x16'));var config=require(_0x6351('0x17'));var licenseUtil=require(_0x6351('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x436b29,_0x4f3267){_0x4f3267=_0x4f3267||0xcc;return function(_0xea9e6c){if(_0xea9e6c){return _0x436b29[_0x6351('0x19')](_0x4f3267);}return _0x436b29[_0x6351('0x1a')](_0x4f3267)[_0x6351('0x1b')]();};}function respondWithResult(_0xc9fe39,_0x156761){_0x156761=_0x156761||0xc8;return function(_0x5b6025){if(_0x5b6025){return _0xc9fe39[_0x6351('0x1a')](_0x156761)[_0x6351('0x1c')](_0x5b6025);}};}function respondWithFilteredResult(_0xfea6e8,_0x3d656c){return function(_0x4d2eff){if(_0x4d2eff){var _0x216b10=typeof _0x3d656c['offset']===_0x6351('0x1d')&&typeof _0x3d656c[_0x6351('0x1e')]===_0x6351('0x1d');var _0x4542d7=_0x4d2eff[_0x6351('0x1f')];var _0x400af5=_0x216b10?0x0:_0x3d656c[_0x6351('0x20')];var _0x4735fe=_0x216b10?_0x4d2eff['count']:_0x3d656c[_0x6351('0x20')]+_0x3d656c[_0x6351('0x1e')];var _0x2d786f;if(_0x4735fe>=_0x4542d7){_0x4735fe=_0x4542d7;_0x2d786f=0xc8;}else{_0x2d786f=0xce;}_0xfea6e8[_0x6351('0x1a')](_0x2d786f);return _0xfea6e8[_0x6351('0x21')](_0x6351('0x22'),_0x400af5+'-'+_0x4735fe+'/'+_0x4542d7)[_0x6351('0x1c')](_0x4d2eff);}return null;};}function patchUpdates(_0x152896){return function(_0x22b634){try{jsonpatch[_0x6351('0x23')](_0x22b634,_0x152896,!![]);}catch(_0x24cb02){return BPromise['reject'](_0x24cb02);}return _0x22b634['save']();};}function saveUpdates(_0x313eb0,_0x359d4a){return function(_0x3c8e1a){if(_0x3c8e1a){return _0x3c8e1a[_0x6351('0x24')](_0x313eb0)[_0x6351('0x25')](function(_0x4a7cd8){return _0x4a7cd8;});}return null;};}function removeEntity(_0x50298e,_0x4637b5){return function(_0x5cd02d){if(_0x5cd02d){return _0x5cd02d[_0x6351('0x26')]()['then'](function(){_0x50298e[_0x6351('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec370,_0x212ec1){return function(_0x2c6367){if(!_0x2c6367){_0x4ec370[_0x6351('0x19')](0x194);}return _0x2c6367;};}function handleError(_0x441586,_0x44dc0e){_0x44dc0e=_0x44dc0e||0x1f4;return function(_0x317b6b){logger['error'](_0x317b6b[_0x6351('0x27')]);if(_0x317b6b[_0x6351('0x28')]){delete _0x317b6b[_0x6351('0x28')];}_0x441586[_0x6351('0x1a')](_0x44dc0e)['send'](_0x317b6b);};}exports[_0x6351('0x29')]=function(_0x8f5ca1,_0x491315){var _0x9260cd={},_0x413fcf={},_0x2e6887={'count':0x0,'rows':[]};var _0x41a7a3=_[_0x6351('0x2a')](db['Migration'][_0x6351('0x2b')],function(_0xaf8492){return{'name':_0xaf8492[_0x6351('0x2c')],'type':_0xaf8492[_0x6351('0x2d')][_0x6351('0x2e')]};});_0x413fcf[_0x6351('0x2f')]=_[_0x6351('0x2a')](_0x41a7a3,_0x6351('0x28'));_0x413fcf[_0x6351('0x30')]=_['keys'](_0x8f5ca1[_0x6351('0x30')]);_0x413fcf[_0x6351('0x31')]=_[_0x6351('0x32')](_0x413fcf['model'],_0x413fcf['query']);_0x9260cd['attributes']=_[_0x6351('0x32')](_0x413fcf[_0x6351('0x2f')],qs[_0x6351('0x33')](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x33')]));_0x9260cd[_0x6351('0x34')]=_0x9260cd[_0x6351('0x34')]['length']?_0x9260cd[_0x6351('0x34')]:_0x413fcf['model'];if(!_0x8f5ca1[_0x6351('0x30')][_0x6351('0x35')]('nolimit')){_0x9260cd[_0x6351('0x1e')]=qs['limit'](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x1e')]);_0x9260cd[_0x6351('0x20')]=qs[_0x6351('0x20')](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x20')]);}_0x9260cd[_0x6351('0x36')]=qs[_0x6351('0x37')](_0x8f5ca1[_0x6351('0x30')][_0x6351('0x37')]);_0x9260cd[_0x6351('0x38')]=qs[_0x6351('0x31')](_[_0x6351('0x39')](_0x8f5ca1[_0x6351('0x30')],_0x413fcf[_0x6351('0x31')]),_0x41a7a3);if(_0x8f5ca1[_0x6351('0x30')][_0x6351('0x3a')]){_0x9260cd[_0x6351('0x38')]=_[_0x6351('0x3b')](_0x9260cd['where'],{'$or':_['map'](_0x41a7a3,function(_0x5ea7a9){if(_0x5ea7a9['type']!==_0x6351('0x3c')){var _0x28df48={};_0x28df48[_0x5ea7a9['name']]={'$like':'%'+_0x8f5ca1['query'][_0x6351('0x3a')]+'%'};return _0x28df48;}})});}_0x9260cd=_[_0x6351('0x3b')]({},_0x9260cd,_0x8f5ca1['options']);var _0x272658={'where':_0x9260cd[_0x6351('0x38')]};return db[_0x6351('0x3d')]['count'](_0x272658)[_0x6351('0x25')](function(_0x16544c){_0x2e6887['count']=_0x16544c;if(_0x8f5ca1[_0x6351('0x30')][_0x6351('0x3e')]){_0x9260cd[_0x6351('0x3f')]=[{'all':!![]}];}return db[_0x6351('0x3d')]['findAll'](_0x9260cd);})['then'](function(_0x235d35){_0x2e6887[_0x6351('0x40')]=_0x235d35;return _0x2e6887;})[_0x6351('0x25')](respondWithFilteredResult(_0x491315,_0x9260cd))[_0x6351('0x41')](handleError(_0x491315,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 08fe09c..63a5176 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 _0xcb55=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xcb55,0x1a3));var _0x5cb5=function(_0x4e65b9,_0x1b4c3e){_0x4e65b9=_0x4e65b9-0x0;var _0xedcb74=_0xcb55[_0x4e65b9];return _0xedcb74;};'use strict';var _=require(_0x5cb5('0x0'));var util=require(_0x5cb5('0x1'));var logger=require(_0x5cb5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5cb5('0x3'));var rp=require(_0x5cb5('0x4'));var fs=require('fs');var path=require(_0x5cb5('0x5'));var rimraf=require('rimraf');var config=require(_0x5cb5('0x6'));var attributes=require(_0x5cb5('0x7'));module[_0x5cb5('0x8')]=function(_0x4e53e5,_0x40aadb){return _0x4e53e5[_0x5cb5('0x9')](_0x5cb5('0xa'),attributes,{'tableName':_0x5cb5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceae=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xceae,0x1a0));var _0xecea=function(_0x1cb701,_0xaebc06){_0x1cb701=_0x1cb701-0x0;var _0x2ac38d=_0xceae[_0x1cb701];return _0x2ac38d;};'use strict';var _=require(_0xecea('0x0'));var util=require('util');var logger=require(_0xecea('0x1'))(_0xecea('0x2'));var moment=require('moment');var BPromise=require(_0xecea('0x3'));var rp=require(_0xecea('0x4'));var fs=require('fs');var path=require(_0xecea('0x5'));var rimraf=require(_0xecea('0x6'));var config=require(_0xecea('0x7'));var attributes=require(_0xecea('0x8'));module[_0xecea('0x9')]=function(_0x3f3fd8,_0x58429a){return _0x3f3fd8[_0xecea('0xa')](_0xecea('0xb'),attributes,{'tableName':_0xecea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 1844e01..70e846f 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 _0xbbfa=['Migration,\x20%s,\x20%s,\x20%s','error','code','Migration,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x2e35f7,_0x3e0691){var _0x37ca08=function(_0x1be895){while(--_0x1be895){_0x2e35f7['push'](_0x2e35f7['shift']());}};_0x37ca08(++_0x3e0691);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x23f8d2,_0x301fec){_0x23f8d2=_0x23f8d2-0x0;var _0x5d174b=_0xbbfa[_0x23f8d2];return _0x5d174b;};'use strict';var _=require(_0xabbf('0x0'));var util=require('util');var moment=require(_0xabbf('0x1'));var BPromise=require('bluebird');var rs=require(_0xabbf('0x2'));var fs=require('fs');var Redis=require(_0xabbf('0x3'));var db=require(_0xabbf('0x4'))['db'];var utils=require(_0xabbf('0x5'));var logger=require(_0xabbf('0x6'))(_0xabbf('0x7'));var config=require(_0xabbf('0x8'));var jayson=require(_0xabbf('0x9'));var client=jayson[_0xabbf('0xa')][_0xabbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45b7d6,_0x58f0a8,_0x5b471b){return new BPromise(function(_0x536a4c,_0x1380cd){return client[_0xabbf('0xc')](_0x45b7d6,_0x5b471b)['then'](function(_0x5f35ee){logger[_0xabbf('0xd')]('Migration,\x20%s,\x20%s',_0x58f0a8,_0xabbf('0xe'));logger['debug'](_0xabbf('0xf'),_0x58f0a8,'request\x20sent',JSON['stringify'](_0x5f35ee));if(_0x5f35ee[_0xabbf('0x10')]){if(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x11')]===0x1f4){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);return _0x1380cd(_0x5f35ee[_0xabbf('0x10')][_0xabbf('0x13')]);}logger['error'](_0xabbf('0x12'),_0x58f0a8,_0x5f35ee['error'][_0xabbf('0x13')]);return _0x536a4c(_0x5f35ee['error'][_0xabbf('0x13')]);}else{logger[_0xabbf('0xd')](_0xabbf('0x12'),_0x58f0a8,_0xabbf('0xe'));_0x536a4c(_0x5f35ee['result'][_0xabbf('0x13')]);}})[_0xabbf('0x14')](function(_0x31245d){logger[_0xabbf('0x10')](_0xabbf('0x12'),_0x58f0a8,_0x31245d);_0x1380cd(_0x31245d);});});} \ No newline at end of file +var _0x67da=['error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x67da,0x192));var _0xa67d=function(_0x12e146,_0x3bb7bf){_0x12e146=_0x12e146-0x0;var _0x3c1602=_0x67da[_0x12e146];return _0x3c1602;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var moment=require(_0xa67d('0x1'));var BPromise=require(_0xa67d('0x2'));var rs=require(_0xa67d('0x3'));var fs=require('fs');var Redis=require(_0xa67d('0x4'));var db=require(_0xa67d('0x5'))['db'];var utils=require(_0xa67d('0x6'));var logger=require(_0xa67d('0x7'))(_0xa67d('0x8'));var config=require(_0xa67d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa67d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d2734,_0x31d56a,_0x2346f4){return new BPromise(function(_0x10f89a,_0x2c37c2){return client[_0xa67d('0xb')](_0x4d2734,_0x2346f4)[_0xa67d('0xc')](function(_0x330a9f){logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));logger['debug'](_0xa67d('0x10'),_0x31d56a,_0xa67d('0xf'),JSON[_0xa67d('0x11')](_0x330a9f));if(_0x330a9f[_0xa67d('0x12')]){if(_0x330a9f['error'][_0xa67d('0x13')]===0x1f4){logger[_0xa67d('0x12')]('Migration,\x20%s,\x20%s',_0x31d56a,_0x330a9f['error'][_0xa67d('0x14')]);return _0x2c37c2(_0x330a9f['error'][_0xa67d('0x14')]);}logger['error']('Migration,\x20%s,\x20%s',_0x31d56a,_0x330a9f[_0xa67d('0x12')][_0xa67d('0x14')]);return _0x10f89a(_0x330a9f['error'][_0xa67d('0x14')]);}else{logger[_0xa67d('0xd')](_0xa67d('0xe'),_0x31d56a,_0xa67d('0xf'));_0x10f89a(_0x330a9f['result']['message']);}})['catch'](function(_0x4fa50f){logger[_0xa67d('0x12')]('Migration,\x20%s,\x20%s',_0x31d56a,_0x4fa50f);_0x2c37c2(_0x4fa50f);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 7572411..aa376d4 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 _0xea4e=['fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','multer','express'];(function(_0x559fbe,_0x165810){var _0x1e8dcf=function(_0x6545d6){while(--_0x6545d6){_0x559fbe['push'](_0x559fbe['shift']());}};_0x1e8dcf(++_0x165810);}(_0xea4e,0x10c));var _0xeea4=function(_0x9e55f6,_0x5df434){_0x9e55f6=_0x9e55f6-0x0;var _0x220e55=_0xea4e[_0x9e55f6];return _0x220e55;};'use strict';var multer=require(_0xeea4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeea4('0x1'));var router=express['Router']();var fs_extra=require(_0xeea4('0x2'));var auth=require(_0xeea4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xeea4('0x4'));var controller=require(_0xeea4('0x5'));router[_0xeea4('0x6')]('/',auth[_0xeea4('0x7')](),controller[_0xeea4('0x8')]);router[_0xeea4('0x6')](_0xeea4('0x9'),auth[_0xeea4('0x7')](),controller[_0xeea4('0xa')]);router['post']('/',auth[_0xeea4('0x7')](),controller['create']);router[_0xeea4('0xb')](_0xeea4('0x9'),auth[_0xeea4('0x7')](),controller[_0xeea4('0xc')]);router[_0xeea4('0xd')](_0xeea4('0x9'),auth[_0xeea4('0x7')](),controller[_0xeea4('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2706=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x209d0a,_0x46ff15){var _0x9ddd1f=function(_0x590be6){while(--_0x590be6){_0x209d0a['push'](_0x209d0a['shift']());}};_0x9ddd1f(++_0x46ff15);}(_0x2706,0x107));var _0x6270=function(_0x112916,_0x1b8cba){_0x112916=_0x112916-0x0;var _0xf5381f=_0x2706[_0x112916];return _0xf5381f;};'use strict';var multer=require('multer');var util=require(_0x6270('0x0'));var path=require(_0x6270('0x1'));var timeout=require(_0x6270('0x2'));var express=require(_0x6270('0x3'));var router=express['Router']();var fs_extra=require(_0x6270('0x4'));var auth=require(_0x6270('0x5'));var interaction=require(_0x6270('0x6'));var config=require(_0x6270('0x7'));var controller=require(_0x6270('0x8'));router[_0x6270('0x9')]('/',auth[_0x6270('0xa')](),controller[_0x6270('0xb')]);router['get'](_0x6270('0xc'),auth[_0x6270('0xa')](),controller['show']);router[_0x6270('0xd')]('/',auth[_0x6270('0xa')](),controller[_0x6270('0xe')]);router[_0x6270('0xf')](_0x6270('0xc'),auth[_0x6270('0xa')](),controller['update']);router[_0x6270('0x10')](_0x6270('0xc'),auth[_0x6270('0xa')](),controller[_0x6270('0x11')]);module[_0x6270('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d1c3009..fa78ef4 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 _0xe61a=['turn','STRING','exports','ENUM','externip'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xe61a,0x10b));var _0xae61=function(_0x2ded38,_0x25837d){_0x2ded38=_0x2ded38-0x0;var _0x5d1a45=_0xe61a[_0x2ded38];return _0x5d1a45;};'use strict';var Sequelize=require('sequelize');module[_0xae61('0x0')]={'type':{'type':Sequelize[_0xae61('0x1')]('localnet',_0xae61('0x2'),'stun',_0xae61('0x3'))},'value':{'type':Sequelize[_0xae61('0x4')]},'username':{'type':Sequelize[_0xae61('0x4')]},'password':{'type':Sequelize[_0xae61('0x4')]}}; \ No newline at end of file +var _0xc6ec=['exports','ENUM','localnet','stun','turn','STRING','sequelize'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xc6ec,0x92));var _0xcc6e=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0xc6ec[_0x217c2e];return _0x22b7d8;};'use strict';var Sequelize=require(_0xcc6e('0x0'));module[_0xcc6e('0x1')]={'type':{'type':Sequelize[_0xcc6e('0x2')](_0xcc6e('0x3'),'externip',_0xcc6e('0x4'),_0xcc6e('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xcc6e('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index bff1ace..0ebc3c9 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 _0xe3a7=['params','intersection','include','find','create','body','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','/etc/asterisk/stun_xcally.conf','toLowerCase','STUN','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','offset','undefined','limit','count','Content-Range','json','update','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Network','includeAll','findAll','rows','show'];(function(_0x546e00,_0x3526d9){var _0xb68b71=function(_0xbfa4e4){while(--_0xbfa4e4){_0x546e00['push'](_0x546e00['shift']());}};_0xb68b71(++_0x3526d9);}(_0xe3a7,0x11c));var _0x7e3a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe3a7[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x7e3a('0x0'));var path=require(_0x7e3a('0x1'));var ejs=require(_0x7e3a('0x2'));var fs=require('fs');var _=require(_0x7e3a('0x3'));var qs=require(_0x7e3a('0x4'));var logger=require(_0x7e3a('0x5'))(_0x7e3a('0x6'));var config=require(_0x7e3a('0x7'));var db=require(_0x7e3a('0x8'))['db'];var jayson=require(_0x7e3a('0x9'));var client=jayson[_0x7e3a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27a41b,_0xe252fe,_0x47f016,_0x174b7f){return new Promise(function(_0x50b649,_0x30eabb){var _0x507dfb=_0x174b7f||client;return _0x507dfb['request'](_0x27a41b,_0x47f016)[_0x7e3a('0xb')](function(_0x116adc){logger[_0x7e3a('0xc')](_0x7e3a('0xd'),_0xe252fe,_0x7e3a('0xe'));logger[_0x7e3a('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0xe252fe,'request\x20sent',JSON[_0x7e3a('0x10')](_0x116adc));if(_0x116adc[_0x7e3a('0x11')]){if(_0x116adc[_0x7e3a('0x11')]['code']===0x1f4){logger[_0x7e3a('0x11')]('Network,\x20%s,\x20%s',_0xe252fe,_0x116adc[_0x7e3a('0x11')][_0x7e3a('0x12')]);return _0x30eabb(_0x116adc[_0x7e3a('0x11')]['message']);}logger[_0x7e3a('0x11')]('Network,\x20%s,\x20%s',_0xe252fe,_0x116adc[_0x7e3a('0x11')]['message']);return _0x50b649(_0x116adc[_0x7e3a('0x11')]['message']);}else{logger[_0x7e3a('0xc')](_0x7e3a('0xd'),_0xe252fe,_0x7e3a('0xe'));_0x50b649(_0x116adc[_0x7e3a('0x13')][_0x7e3a('0x12')]);}})[_0x7e3a('0x14')](function(_0x596414){logger[_0x7e3a('0x11')](_0x7e3a('0xd'),_0xe252fe,_0x596414);_0x30eabb(_0x596414);});});}function respondWithResult(_0x47b912,_0x197768){_0x197768=_0x197768||0xc8;return function(_0x4fcc38){if(_0x4fcc38){return _0x47b912[_0x7e3a('0x15')](_0x197768)['json'](_0x4fcc38);}};}function respondWithFilteredResult(_0x4bd52d,_0x14fd9d){return function(_0x4a9630){if(_0x4a9630){var _0x4a83f3=typeof _0x14fd9d[_0x7e3a('0x16')]===_0x7e3a('0x17')&&typeof _0x14fd9d[_0x7e3a('0x18')]===_0x7e3a('0x17');var _0x155a0d=_0x4a9630['count'];var _0x3b99f2=_0x4a83f3?0x0:_0x14fd9d[_0x7e3a('0x16')];var _0x165b06=_0x4a83f3?_0x4a9630[_0x7e3a('0x19')]:_0x14fd9d[_0x7e3a('0x16')]+_0x14fd9d[_0x7e3a('0x18')];var _0x378c16;if(_0x165b06>=_0x155a0d){_0x165b06=_0x155a0d;_0x378c16=0xc8;}else{_0x378c16=0xce;}_0x4bd52d[_0x7e3a('0x15')](_0x378c16);return _0x4bd52d['set'](_0x7e3a('0x1a'),_0x3b99f2+'-'+_0x165b06+'/'+_0x155a0d)[_0x7e3a('0x1b')](_0x4a9630);}return null;};}function saveUpdates(_0x2c5b23){return function(_0x2b26f9){if(_0x2b26f9){return _0x2b26f9[_0x7e3a('0x1c')](_0x2c5b23)[_0x7e3a('0xb')](function(_0x4691d3){return _0x4691d3;});}return null;};}function removeEntity(_0x516da2){return function(_0xa82f84){if(_0xa82f84){return _0xa82f84[_0x7e3a('0x1d')]()[_0x7e3a('0xb')](function(){_0x516da2[_0x7e3a('0x15')](0xcc)[_0x7e3a('0x1e')]();});}};}function handleEntityNotFound(_0x2b950f){return function(_0x35a1e9){if(!_0x35a1e9){_0x2b950f['sendStatus'](0x194);}return _0x35a1e9;};}function handleError(_0x59a494,_0x398204){_0x398204=_0x398204||0x1f4;return function(_0x41bde6){logger[_0x7e3a('0x11')](_0x41bde6['stack']);if(_0x41bde6[_0x7e3a('0x1f')]){delete _0x41bde6['name'];}_0x59a494['status'](_0x398204)[_0x7e3a('0x20')](_0x41bde6);};}exports[_0x7e3a('0x21')]=function(_0x199d21,_0xfb5caa){var _0x119b12={},_0x322c3d={},_0xf33653={'count':0x0,'rows':[]};var _0x3c46b8=_[_0x7e3a('0x22')](db['Network'][_0x7e3a('0x23')],function(_0x305fb3){return{'name':_0x305fb3[_0x7e3a('0x24')],'type':_0x305fb3[_0x7e3a('0x25')][_0x7e3a('0x26')]};});_0x322c3d[_0x7e3a('0x27')]=_['map'](_0x3c46b8,_0x7e3a('0x1f'));_0x322c3d[_0x7e3a('0x28')]=_['keys'](_0x199d21[_0x7e3a('0x28')]);_0x322c3d[_0x7e3a('0x29')]=_['intersection'](_0x322c3d['model'],_0x322c3d[_0x7e3a('0x28')]);_0x119b12[_0x7e3a('0x2a')]=_['intersection'](_0x322c3d[_0x7e3a('0x27')],qs[_0x7e3a('0x2b')](_0x199d21[_0x7e3a('0x28')][_0x7e3a('0x2b')]));_0x119b12[_0x7e3a('0x2a')]=_0x119b12[_0x7e3a('0x2a')][_0x7e3a('0x2c')]?_0x119b12[_0x7e3a('0x2a')]:_0x322c3d[_0x7e3a('0x27')];if(!_0x199d21[_0x7e3a('0x28')][_0x7e3a('0x2d')](_0x7e3a('0x2e'))){_0x119b12['limit']=qs[_0x7e3a('0x18')](_0x199d21[_0x7e3a('0x28')][_0x7e3a('0x18')]);_0x119b12['offset']=qs[_0x7e3a('0x16')](_0x199d21[_0x7e3a('0x28')][_0x7e3a('0x16')]);}_0x119b12[_0x7e3a('0x2f')]=qs['sort'](_0x199d21[_0x7e3a('0x28')][_0x7e3a('0x30')]);_0x119b12['where']=qs['filters'](_[_0x7e3a('0x31')](_0x199d21['query'],_0x322c3d[_0x7e3a('0x29')]),_0x3c46b8);if(_0x199d21['query'][_0x7e3a('0x32')]){_0x119b12[_0x7e3a('0x33')]=_[_0x7e3a('0x34')](_0x119b12[_0x7e3a('0x33')],{'$or':_[_0x7e3a('0x22')](_0x3c46b8,function(_0x529aaf){if(_0x529aaf[_0x7e3a('0x25')]!==_0x7e3a('0x35')){var _0x49a641={};_0x49a641[_0x529aaf[_0x7e3a('0x1f')]]={'$like':'%'+_0x199d21[_0x7e3a('0x28')]['filter']+'%'};return _0x49a641;}})});}_0x119b12=_['merge']({},_0x119b12,_0x199d21[_0x7e3a('0x36')]);var _0x375f2c={'where':_0x119b12[_0x7e3a('0x33')]};return db[_0x7e3a('0x37')][_0x7e3a('0x19')](_0x375f2c)[_0x7e3a('0xb')](function(_0x5d6e24){_0xf33653[_0x7e3a('0x19')]=_0x5d6e24;if(_0x199d21[_0x7e3a('0x28')][_0x7e3a('0x38')]){_0x119b12['include']=[{'all':!![]}];}return db[_0x7e3a('0x37')][_0x7e3a('0x39')](_0x119b12);})[_0x7e3a('0xb')](function(_0x1f02db){_0xf33653[_0x7e3a('0x3a')]=_0x1f02db;return _0xf33653;})['then'](respondWithFilteredResult(_0xfb5caa,_0x119b12))['catch'](handleError(_0xfb5caa,null));};exports[_0x7e3a('0x3b')]=function(_0x5a761d,_0x58cb89){var _0xb4a323={'raw':!![],'where':{'id':_0x5a761d[_0x7e3a('0x3c')]['id']}},_0x47278c={};_0x47278c['model']=_['keys'](db['Network']['rawAttributes']);_0x47278c[_0x7e3a('0x28')]=_['keys'](_0x5a761d['query']);_0x47278c[_0x7e3a('0x29')]=_[_0x7e3a('0x3d')](_0x47278c[_0x7e3a('0x27')],_0x47278c[_0x7e3a('0x28')]);_0xb4a323[_0x7e3a('0x2a')]=_['intersection'](_0x47278c[_0x7e3a('0x27')],qs['fields'](_0x5a761d[_0x7e3a('0x28')][_0x7e3a('0x2b')]));_0xb4a323[_0x7e3a('0x2a')]=_0xb4a323['attributes'][_0x7e3a('0x2c')]?_0xb4a323[_0x7e3a('0x2a')]:_0x47278c[_0x7e3a('0x27')];if(_0x5a761d['query'][_0x7e3a('0x38')]){_0xb4a323[_0x7e3a('0x3e')]=[{'all':!![]}];}_0xb4a323=_[_0x7e3a('0x34')]({},_0xb4a323,_0x5a761d[_0x7e3a('0x36')]);return db[_0x7e3a('0x37')][_0x7e3a('0x3f')](_0xb4a323)[_0x7e3a('0xb')](handleEntityNotFound(_0x58cb89,null))[_0x7e3a('0xb')](respondWithResult(_0x58cb89,null))['catch'](handleError(_0x58cb89,null));};exports[_0x7e3a('0x40')]=function(_0x4b63e4,_0x528d5b){var _0x5cf004;return db[_0x7e3a('0x37')][_0x7e3a('0x40')](_0x4b63e4['body'],{'raw':!![]})[_0x7e3a('0xb')](function(_0x605b5){_0x5cf004=_0x605b5;return db[_0x7e3a('0x37')][_0x7e3a('0x39')]({'where':{'type':_0x4b63e4[_0x7e3a('0x41')][_0x7e3a('0x25')]},'raw':!![]});})[_0x7e3a('0xb')](function(_0x149a73){if(_0x5cf004['type']['toUpperCase']()=='STUN'){var _0x2b7df8=fs['readFileSync'](path['join'](config[_0x7e3a('0x42')],_0x7e3a('0x43')),_0x7e3a('0x44'));var _0xa6e7f2=ejs[_0x7e3a('0x45')](_0x2b7df8,{'networks':_0x149a73||[]});fs[_0x7e3a('0x46')]('/etc/asterisk/stun_xcally.conf',_0xa6e7f2);return respondWithRpcPromise(_0x7e3a('0x47'),_0x7e3a('0x40'),{'module':_0x7e3a('0x48')});}else if(_0x5cf004[_0x7e3a('0x25')][_0x7e3a('0x49')]()==_0x7e3a('0x4a')){var _0x10dd2b=fs[_0x7e3a('0x4b')](path[_0x7e3a('0x4c')](config[_0x7e3a('0x42')],_0x7e3a('0x4d')),_0x7e3a('0x44'));var _0x5230c3=ejs['render'](_0x10dd2b,{'networks':_0x149a73||[]});fs[_0x7e3a('0x46')](_0x7e3a('0x4e'),_0x5230c3);return respondWithRpcPromise(_0x7e3a('0x47'),'create',{'module':_0x7e3a('0x48')});}else{var _0x5ba166=fs['readFileSync'](path[_0x7e3a('0x4c')](config[_0x7e3a('0x42')],_0x7e3a('0x4f')),_0x7e3a('0x44'));var _0x1c1c12=ejs[_0x7e3a('0x45')](_0x5ba166,{'networks':_0x149a73||[]});fs[_0x7e3a('0x46')](util[_0x7e3a('0x50')](_0x7e3a('0x51'),_0x4b63e4[_0x7e3a('0x41')][_0x7e3a('0x25')]['toLowerCase']()),_0x1c1c12);return respondWithRpcPromise('Reload',_0x7e3a('0x40'),{'module':_0x7e3a('0x52')});}})[_0x7e3a('0xb')](function(){return _0x5cf004;})['then'](respondWithResult(_0x528d5b,0xc9))[_0x7e3a('0x14')](handleError(_0x528d5b,null));};exports['update']=function(_0x2dc326,_0x4207f2){var _0x212bdf;return db['Network']['find']({'where':{'id':_0x2dc326[_0x7e3a('0x3c')]['id']}})[_0x7e3a('0xb')](handleEntityNotFound(_0x4207f2,null))[_0x7e3a('0xb')](saveUpdates(_0x2dc326['body'],null))['then'](function(_0x2f2001){if(_0x2f2001){_0x212bdf=_0x2f2001;return db[_0x7e3a('0x37')][_0x7e3a('0x39')]({'where':{'type':_0x212bdf[_0x7e3a('0x25')]},'raw':!![]});}return null;})[_0x7e3a('0xb')](function(_0xbdaedb){if(_0x212bdf['type'][_0x7e3a('0x49')]()=='STUN'){var _0x26dab0=fs[_0x7e3a('0x4b')](path[_0x7e3a('0x4c')](config[_0x7e3a('0x42')],_0x7e3a('0x43')),_0x7e3a('0x44'));var _0xa6e482=ejs['render'](_0x26dab0,{'networks':_0xbdaedb||[]});fs[_0x7e3a('0x46')](_0x7e3a('0x53'),_0xa6e482);return respondWithRpcPromise(_0x7e3a('0x47'),_0x7e3a('0x1c'),{'module':_0x7e3a('0x48')});}else if(_0x212bdf[_0x7e3a('0x25')][_0x7e3a('0x49')]()=='TURN'){var _0x40d0f3=fs[_0x7e3a('0x4b')](path['join'](config[_0x7e3a('0x42')],_0x7e3a('0x4d')),_0x7e3a('0x44'));var _0x2c6e6b=ejs['render'](_0x40d0f3,{'networks':_0xbdaedb||[]});fs['writeFileSync'](_0x7e3a('0x4e'),_0x2c6e6b);return respondWithRpcPromise(_0x7e3a('0x47'),_0x7e3a('0x1c'),{'module':_0x7e3a('0x48')});}else{var _0x7bba51=fs[_0x7e3a('0x4b')](path['join'](config[_0x7e3a('0x42')],_0x7e3a('0x4f')),_0x7e3a('0x44'));var _0x5b2541=ejs[_0x7e3a('0x45')](_0x7bba51,{'networks':_0xbdaedb||[]});fs[_0x7e3a('0x46')](util['format'](_0x7e3a('0x51'),_0x2dc326[_0x7e3a('0x41')][_0x7e3a('0x25')][_0x7e3a('0x54')]()),_0x5b2541);return respondWithRpcPromise(_0x7e3a('0x47'),'update',{'module':_0x7e3a('0x52')});}})[_0x7e3a('0xb')](function(_0x31075a){if(_0x31075a){return _0x212bdf;}return null;})[_0x7e3a('0xb')](respondWithResult(_0x4207f2,null))[_0x7e3a('0x14')](handleError(_0x4207f2,null));};exports[_0x7e3a('0x1d')]=function(_0x2ab4be,_0x56170f){var _0x50025b;return db[_0x7e3a('0x37')]['find']({'where':{'id':_0x2ab4be[_0x7e3a('0x3c')]['id']}})['then'](function(_0x4a2dcb){_0x50025b=_0x4a2dcb;return _0x4a2dcb;})[_0x7e3a('0xb')](handleEntityNotFound(_0x56170f,null))[_0x7e3a('0xb')](removeEntity(_0x56170f,null))[_0x7e3a('0xb')](function(){if(_0x50025b){return db[_0x7e3a('0x37')][_0x7e3a('0x39')]({'where':{'type':_0x50025b['type']},'raw':!![]});}})['then'](function(_0x55c1df){if(_0x50025b[_0x7e3a('0x25')][_0x7e3a('0x49')]()==_0x7e3a('0x55')){var _0xc96cda=fs[_0x7e3a('0x4b')](path[_0x7e3a('0x4c')](config['root'],_0x7e3a('0x43')),'utf8');var _0x5bc1da=ejs[_0x7e3a('0x45')](_0xc96cda,{'networks':_0x55c1df||[]});fs['writeFileSync'](_0x7e3a('0x53'),_0x5bc1da);return respondWithRpcPromise(_0x7e3a('0x47'),_0x7e3a('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x50025b[_0x7e3a('0x25')][_0x7e3a('0x49')]()==_0x7e3a('0x4a')){var _0x538656=fs[_0x7e3a('0x4b')](path[_0x7e3a('0x4c')](config[_0x7e3a('0x42')],_0x7e3a('0x4d')),_0x7e3a('0x44'));var _0x155809=ejs[_0x7e3a('0x45')](_0x538656,{'networks':_0x55c1df||[]});fs[_0x7e3a('0x46')]('/etc/asterisk/turn_xcally.conf',_0x155809);return respondWithRpcPromise(_0x7e3a('0x47'),_0x7e3a('0x1d'),{'module':_0x7e3a('0x48')});}else{var _0x2932dc=fs['readFileSync'](path[_0x7e3a('0x4c')](config[_0x7e3a('0x42')],_0x7e3a('0x4f')),_0x7e3a('0x44'));var _0x274291=ejs['render'](_0x2932dc,{'networks':_0x55c1df||[]});fs['writeFileSync'](util[_0x7e3a('0x50')](_0x7e3a('0x51'),_0x50025b[_0x7e3a('0x25')][_0x7e3a('0x54')]()),_0x274291);return respondWithRpcPromise('Reload',_0x7e3a('0x1d'),{'module':_0x7e3a('0x52')});}})[_0x7e3a('0x14')](handleError(_0x56170f,null));}; \ No newline at end of file +var _0x891f=['sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','find','/etc/asterisk/sip_xcally_%s.conf','util','path','ejs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','undefined','limit','count','offset','set','Content-Range','json','destroy','end','stack','name','map','Network','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit'];(function(_0x69998a,_0x112648){var _0x2ab0b9=function(_0x5267dd){while(--_0x5267dd){_0x69998a['push'](_0x69998a['shift']());}};_0x2ab0b9(++_0x112648);}(_0x891f,0xc9));var _0xf891=function(_0x2e8a7e,_0x99071){_0x2e8a7e=_0x2e8a7e-0x0;var _0x4a525d=_0x891f[_0x2e8a7e];return _0x4a525d;};'use strict';var util=require(_0xf891('0x0'));var path=require(_0xf891('0x1'));var ejs=require(_0xf891('0x2'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xf891('0x3'))('api');var config=require(_0xf891('0x4'));var db=require(_0xf891('0x5'))['db'];var jayson=require(_0xf891('0x6'));var client=jayson['client'][_0xf891('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c44f5,_0x4e216c,_0x75bda4,_0x312d22){return new Promise(function(_0x319274,_0x3b3c67){var _0x2b7eff=_0x312d22||client;return _0x2b7eff['request'](_0x3c44f5,_0x75bda4)[_0xf891('0x8')](function(_0x5152b2){logger['info'](_0xf891('0x9'),_0x4e216c,_0xf891('0xa'));logger['debug'](_0xf891('0xb'),_0x4e216c,_0xf891('0xa'),JSON[_0xf891('0xc')](_0x5152b2));if(_0x5152b2[_0xf891('0xd')]){if(_0x5152b2['error'][_0xf891('0xe')]===0x1f4){logger['error'](_0xf891('0x9'),_0x4e216c,_0x5152b2['error'][_0xf891('0xf')]);return _0x3b3c67(_0x5152b2[_0xf891('0xd')][_0xf891('0xf')]);}logger[_0xf891('0xd')](_0xf891('0x9'),_0x4e216c,_0x5152b2['error']['message']);return _0x319274(_0x5152b2[_0xf891('0xd')][_0xf891('0xf')]);}else{logger['info'](_0xf891('0x9'),_0x4e216c,_0xf891('0xa'));_0x319274(_0x5152b2[_0xf891('0x10')][_0xf891('0xf')]);}})[_0xf891('0x11')](function(_0x351ebb){logger['error'](_0xf891('0x9'),_0x4e216c,_0x351ebb);_0x3b3c67(_0x351ebb);});});}function respondWithResult(_0x421927,_0x393cd2){_0x393cd2=_0x393cd2||0xc8;return function(_0x1bcd0c){if(_0x1bcd0c){return _0x421927[_0xf891('0x12')](_0x393cd2)['json'](_0x1bcd0c);}};}function respondWithFilteredResult(_0x4f1730,_0x56c068){return function(_0x1a5fe2){if(_0x1a5fe2){var _0x3ead04=typeof _0x56c068['offset']===_0xf891('0x13')&&typeof _0x56c068[_0xf891('0x14')]===_0xf891('0x13');var _0x30764a=_0x1a5fe2[_0xf891('0x15')];var _0x20ba3b=_0x3ead04?0x0:_0x56c068[_0xf891('0x16')];var _0x3ed043=_0x3ead04?_0x1a5fe2[_0xf891('0x15')]:_0x56c068[_0xf891('0x16')]+_0x56c068[_0xf891('0x14')];var _0x11bae0;if(_0x3ed043>=_0x30764a){_0x3ed043=_0x30764a;_0x11bae0=0xc8;}else{_0x11bae0=0xce;}_0x4f1730[_0xf891('0x12')](_0x11bae0);return _0x4f1730[_0xf891('0x17')](_0xf891('0x18'),_0x20ba3b+'-'+_0x3ed043+'/'+_0x30764a)[_0xf891('0x19')](_0x1a5fe2);}return null;};}function saveUpdates(_0xaf4901){return function(_0xb1b377){if(_0xb1b377){return _0xb1b377['update'](_0xaf4901)[_0xf891('0x8')](function(_0x42c76e){return _0x42c76e;});}return null;};}function removeEntity(_0x9b1678){return function(_0x14b627){if(_0x14b627){return _0x14b627[_0xf891('0x1a')]()[_0xf891('0x8')](function(){_0x9b1678[_0xf891('0x12')](0xcc)[_0xf891('0x1b')]();});}};}function handleEntityNotFound(_0x2f571b){return function(_0x3190fc){if(!_0x3190fc){_0x2f571b['sendStatus'](0x194);}return _0x3190fc;};}function handleError(_0x3faa81,_0x3726ed){_0x3726ed=_0x3726ed||0x1f4;return function(_0x3d8955){logger['error'](_0x3d8955[_0xf891('0x1c')]);if(_0x3d8955[_0xf891('0x1d')]){delete _0x3d8955[_0xf891('0x1d')];}_0x3faa81['status'](_0x3726ed)['send'](_0x3d8955);};}exports['index']=function(_0x44ce1f,_0x24514d){var _0x5d1a2f={},_0x437448={},_0x4d07df={'count':0x0,'rows':[]};var _0x3f6409=_[_0xf891('0x1e')](db[_0xf891('0x1f')]['rawAttributes'],function(_0x405839){return{'name':_0x405839[_0xf891('0x20')],'type':_0x405839[_0xf891('0x21')][_0xf891('0x22')]};});_0x437448[_0xf891('0x23')]=_[_0xf891('0x1e')](_0x3f6409,_0xf891('0x1d'));_0x437448['query']=_['keys'](_0x44ce1f[_0xf891('0x24')]);_0x437448[_0xf891('0x25')]=_[_0xf891('0x26')](_0x437448['model'],_0x437448[_0xf891('0x24')]);_0x5d1a2f[_0xf891('0x27')]=_[_0xf891('0x26')](_0x437448[_0xf891('0x23')],qs[_0xf891('0x28')](_0x44ce1f['query'][_0xf891('0x28')]));_0x5d1a2f['attributes']=_0x5d1a2f[_0xf891('0x27')]['length']?_0x5d1a2f[_0xf891('0x27')]:_0x437448[_0xf891('0x23')];if(!_0x44ce1f[_0xf891('0x24')]['hasOwnProperty'](_0xf891('0x29'))){_0x5d1a2f[_0xf891('0x14')]=qs['limit'](_0x44ce1f[_0xf891('0x24')][_0xf891('0x14')]);_0x5d1a2f[_0xf891('0x16')]=qs[_0xf891('0x16')](_0x44ce1f[_0xf891('0x24')][_0xf891('0x16')]);}_0x5d1a2f['order']=qs['sort'](_0x44ce1f[_0xf891('0x24')][_0xf891('0x2a')]);_0x5d1a2f['where']=qs[_0xf891('0x25')](_[_0xf891('0x2b')](_0x44ce1f[_0xf891('0x24')],_0x437448['filters']),_0x3f6409);if(_0x44ce1f['query'][_0xf891('0x2c')]){_0x5d1a2f['where']=_[_0xf891('0x2d')](_0x5d1a2f['where'],{'$or':_['map'](_0x3f6409,function(_0x41d745){if(_0x41d745[_0xf891('0x21')]!=='VIRTUAL'){var _0x580c2a={};_0x580c2a[_0x41d745['name']]={'$like':'%'+_0x44ce1f[_0xf891('0x24')][_0xf891('0x2c')]+'%'};return _0x580c2a;}})});}_0x5d1a2f=_[_0xf891('0x2d')]({},_0x5d1a2f,_0x44ce1f[_0xf891('0x2e')]);var _0x55ecbd={'where':_0x5d1a2f[_0xf891('0x2f')]};return db['Network'][_0xf891('0x15')](_0x55ecbd)[_0xf891('0x8')](function(_0x406f4a){_0x4d07df['count']=_0x406f4a;if(_0x44ce1f['query'][_0xf891('0x30')]){_0x5d1a2f[_0xf891('0x31')]=[{'all':!![]}];}return db[_0xf891('0x1f')][_0xf891('0x32')](_0x5d1a2f);})[_0xf891('0x8')](function(_0x10016b){_0x4d07df[_0xf891('0x33')]=_0x10016b;return _0x4d07df;})[_0xf891('0x8')](respondWithFilteredResult(_0x24514d,_0x5d1a2f))[_0xf891('0x11')](handleError(_0x24514d,null));};exports[_0xf891('0x34')]=function(_0x33f018,_0xd95684){var _0x4d2e38={'raw':!![],'where':{'id':_0x33f018[_0xf891('0x35')]['id']}},_0x1e33f5={};_0x1e33f5[_0xf891('0x23')]=_[_0xf891('0x36')](db['Network'][_0xf891('0x37')]);_0x1e33f5[_0xf891('0x24')]=_[_0xf891('0x36')](_0x33f018[_0xf891('0x24')]);_0x1e33f5[_0xf891('0x25')]=_[_0xf891('0x26')](_0x1e33f5['model'],_0x1e33f5[_0xf891('0x24')]);_0x4d2e38['attributes']=_[_0xf891('0x26')](_0x1e33f5[_0xf891('0x23')],qs[_0xf891('0x28')](_0x33f018[_0xf891('0x24')][_0xf891('0x28')]));_0x4d2e38[_0xf891('0x27')]=_0x4d2e38[_0xf891('0x27')][_0xf891('0x38')]?_0x4d2e38['attributes']:_0x1e33f5[_0xf891('0x23')];if(_0x33f018['query']['includeAll']){_0x4d2e38[_0xf891('0x31')]=[{'all':!![]}];}_0x4d2e38=_[_0xf891('0x2d')]({},_0x4d2e38,_0x33f018[_0xf891('0x2e')]);return db['Network']['find'](_0x4d2e38)[_0xf891('0x8')](handleEntityNotFound(_0xd95684,null))['then'](respondWithResult(_0xd95684,null))[_0xf891('0x11')](handleError(_0xd95684,null));};exports['create']=function(_0x37ebdd,_0x5bdcc5){var _0x304b2f;return db['Network'][_0xf891('0x39')](_0x37ebdd[_0xf891('0x3a')],{'raw':!![]})[_0xf891('0x8')](function(_0x4d1e27){_0x304b2f=_0x4d1e27;return db[_0xf891('0x1f')][_0xf891('0x32')]({'where':{'type':_0x37ebdd[_0xf891('0x3a')]['type']},'raw':!![]});})[_0xf891('0x8')](function(_0x3cee04){if(_0x304b2f['type'][_0xf891('0x3b')]()==_0xf891('0x3c')){var _0xbf1fb=fs[_0xf891('0x3d')](path['join'](config[_0xf891('0x3e')],_0xf891('0x3f')),_0xf891('0x40'));var _0x288244=ejs[_0xf891('0x41')](_0xbf1fb,{'networks':_0x3cee04||[]});fs[_0xf891('0x42')](_0xf891('0x43'),_0x288244);return respondWithRpcPromise('Reload',_0xf891('0x39'),{'module':_0xf891('0x44')});}else if(_0x304b2f[_0xf891('0x21')][_0xf891('0x3b')]()==_0xf891('0x45')){var _0x2a800c=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config[_0xf891('0x3e')],_0xf891('0x47')),_0xf891('0x40'));var _0x3f3072=ejs[_0xf891('0x41')](_0x2a800c,{'networks':_0x3cee04||[]});fs[_0xf891('0x42')](_0xf891('0x48'),_0x3f3072);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x39'),{'module':_0xf891('0x44')});}else{var _0x1dbb3b=fs['readFileSync'](path['join'](config[_0xf891('0x3e')],_0xf891('0x4a')),_0xf891('0x40'));var _0x5806dd=ejs[_0xf891('0x41')](_0x1dbb3b,{'networks':_0x3cee04||[]});fs[_0xf891('0x42')](util[_0xf891('0x4b')]('/etc/asterisk/sip_xcally_%s.conf',_0x37ebdd[_0xf891('0x3a')][_0xf891('0x21')][_0xf891('0x4c')]()),_0x5806dd);return respondWithRpcPromise('Reload',_0xf891('0x39'),{'module':_0xf891('0x4d')});}})[_0xf891('0x8')](function(){return _0x304b2f;})[_0xf891('0x8')](respondWithResult(_0x5bdcc5,0xc9))['catch'](handleError(_0x5bdcc5,null));};exports[_0xf891('0x4e')]=function(_0x1877b5,_0xa81555){var _0x53f4df;return db['Network'][_0xf891('0x4f')]({'where':{'id':_0x1877b5[_0xf891('0x35')]['id']}})[_0xf891('0x8')](handleEntityNotFound(_0xa81555,null))['then'](saveUpdates(_0x1877b5[_0xf891('0x3a')],null))[_0xf891('0x8')](function(_0x9b1b8d){if(_0x9b1b8d){_0x53f4df=_0x9b1b8d;return db[_0xf891('0x1f')][_0xf891('0x32')]({'where':{'type':_0x53f4df[_0xf891('0x21')]},'raw':!![]});}return null;})['then'](function(_0x423f5f){if(_0x53f4df[_0xf891('0x21')][_0xf891('0x3b')]()==_0xf891('0x3c')){var _0x2d82e9=fs['readFileSync'](path['join'](config['root'],_0xf891('0x3f')),_0xf891('0x40'));var _0x204428=ejs[_0xf891('0x41')](_0x2d82e9,{'networks':_0x423f5f||[]});fs[_0xf891('0x42')]('/etc/asterisk/stun_xcally.conf',_0x204428);return respondWithRpcPromise('Reload','update',{'module':_0xf891('0x44')});}else if(_0x53f4df[_0xf891('0x21')][_0xf891('0x3b')]()=='TURN'){var _0x217b77=fs[_0xf891('0x3d')](path['join'](config[_0xf891('0x3e')],_0xf891('0x47')),_0xf891('0x40'));var _0x2150cc=ejs[_0xf891('0x41')](_0x217b77,{'networks':_0x423f5f||[]});fs[_0xf891('0x42')](_0xf891('0x48'),_0x2150cc);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x4e'),{'module':_0xf891('0x44')});}else{var _0x336451=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config['root'],_0xf891('0x4a')),_0xf891('0x40'));var _0x14b6d1=ejs[_0xf891('0x41')](_0x336451,{'networks':_0x423f5f||[]});fs[_0xf891('0x42')](util[_0xf891('0x4b')](_0xf891('0x50'),_0x1877b5[_0xf891('0x3a')][_0xf891('0x21')][_0xf891('0x4c')]()),_0x14b6d1);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x4e'),{'module':_0xf891('0x4d')});}})[_0xf891('0x8')](function(_0x36c1d6){if(_0x36c1d6){return _0x53f4df;}return null;})[_0xf891('0x8')](respondWithResult(_0xa81555,null))['catch'](handleError(_0xa81555,null));};exports[_0xf891('0x1a')]=function(_0x4f3a3b,_0x316b36){var _0x2b3f2d;return db[_0xf891('0x1f')][_0xf891('0x4f')]({'where':{'id':_0x4f3a3b[_0xf891('0x35')]['id']}})['then'](function(_0x1b8a0e){_0x2b3f2d=_0x1b8a0e;return _0x1b8a0e;})[_0xf891('0x8')](handleEntityNotFound(_0x316b36,null))[_0xf891('0x8')](removeEntity(_0x316b36,null))['then'](function(){if(_0x2b3f2d){return db[_0xf891('0x1f')]['findAll']({'where':{'type':_0x2b3f2d['type']},'raw':!![]});}})[_0xf891('0x8')](function(_0x36640c){if(_0x2b3f2d['type']['toUpperCase']()==_0xf891('0x3c')){var _0x5c7cbb=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config[_0xf891('0x3e')],_0xf891('0x3f')),_0xf891('0x40'));var _0x47628b=ejs[_0xf891('0x41')](_0x5c7cbb,{'networks':_0x36640c||[]});fs[_0xf891('0x42')](_0xf891('0x43'),_0x47628b);return respondWithRpcPromise(_0xf891('0x49'),'destroy',{'module':_0xf891('0x44')});}else if(_0x2b3f2d[_0xf891('0x21')][_0xf891('0x3b')]()=='TURN'){var _0x1b6240=fs[_0xf891('0x3d')](path['join'](config[_0xf891('0x3e')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x5a61bf=ejs[_0xf891('0x41')](_0x1b6240,{'networks':_0x36640c||[]});fs[_0xf891('0x42')](_0xf891('0x48'),_0x5a61bf);return respondWithRpcPromise('Reload','destroy',{'module':_0xf891('0x44')});}else{var _0x46f6f4=fs[_0xf891('0x3d')](path[_0xf891('0x46')](config[_0xf891('0x3e')],_0xf891('0x4a')),'utf8');var _0x316fe4=ejs[_0xf891('0x41')](_0x46f6f4,{'networks':_0x36640c||[]});fs[_0xf891('0x42')](util[_0xf891('0x4b')](_0xf891('0x50'),_0x2b3f2d[_0xf891('0x21')][_0xf891('0x4c')]()),_0x316fe4);return respondWithRpcPromise(_0xf891('0x49'),_0xf891('0x1a'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x316b36,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 47ccfb9..3e43420 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 _0x073e=['rimraf','../../config/environment','define','Network','network','lodash','util','../../config/logger','api','path'];(function(_0x3c9e09,_0x1bd0eb){var _0x55cb86=function(_0x520d0f){while(--_0x520d0f){_0x3c9e09['push'](_0x3c9e09['shift']());}};_0x55cb86(++_0x1bd0eb);}(_0x073e,0x181));var _0xe073=function(_0x2b7b04,_0x5491aa){_0x2b7b04=_0x2b7b04-0x0;var _0x4b0728=_0x073e[_0x2b7b04];return _0x4b0728;};'use strict';var _=require(_0xe073('0x0'));var util=require(_0xe073('0x1'));var logger=require(_0xe073('0x2'))(_0xe073('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe073('0x4'));var rimraf=require(_0xe073('0x5'));var config=require(_0xe073('0x6'));var attributes=require('./network.attributes');module['exports']=function(_0x4bc6b3,_0x45995e){return _0x4bc6b3[_0xe073('0x7')](_0xe073('0x8'),attributes,{'tableName':_0xe073('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6d8=['../../config/logger','moment','request-promise','../../config/environment','./network.attributes','exports','define','Network','lodash'];(function(_0x856fb0,_0x571677){var _0x2e35ca=function(_0xdf485a){while(--_0xdf485a){_0x856fb0['push'](_0x856fb0['shift']());}};_0x2e35ca(++_0x571677);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4b92b9,_0x1bd47d){_0x4b92b9=_0x4b92b9-0x0;var _0x157b9d=_0xc6d8[_0x4b92b9];return _0x157b9d;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var logger=require(_0x8c6d('0x1'))('api');var moment=require(_0x8c6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c6d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c6d('0x4'));var attributes=require(_0x8c6d('0x5'));module[_0x8c6d('0x6')]=function(_0x4f5e8f,_0x3c265c){return _0x4f5e8f[_0x8c6d('0x7')](_0x8c6d('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index fdb16f4..3886626 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39a15d,_0x316506){var _0x4b2bb9=function(_0x3d1292){while(--_0x3d1292){_0x39a15d['push'](_0x39a15d['shift']());}};_0x4b2bb9(++_0x316506);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x6fe074,_0x337e39){_0x6fe074=_0x6fe074-0x0;var _0x2949cb=_0x7a54[_0x6fe074];return _0x2949cb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 4d59fc7..bf948ea 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 _0xd41b=['show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','isAuthenticated','index','get','describe'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xd41b,0x148));var _0xbd41=function(_0x3f75ce,_0x3092a0){_0x3f75ce=_0x3f75ce-0x0;var _0x34eb22=_0xd41b[_0x3f75ce];return _0x34eb22;};'use strict';var multer=require(_0xbd41('0x0'));var util=require(_0xbd41('0x1'));var path=require('path');var timeout=require(_0xbd41('0x2'));var express=require(_0xbd41('0x3'));var router=express[_0xbd41('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbd41('0x5'));var interaction=require(_0xbd41('0x6'));var config=require('../../config/environment');var controller=require(_0xbd41('0x7'));router['get']('/',auth[_0xbd41('0x8')](),controller[_0xbd41('0x9')]);router[_0xbd41('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xbd41('0xb')]);router['get']('/:id',auth[_0xbd41('0x8')](),controller[_0xbd41('0xc')]);router[_0xbd41('0xa')](_0xbd41('0xd'),auth[_0xbd41('0x8')](),controller[_0xbd41('0xe')]);router[_0xbd41('0xa')]('/:id/canned_answers',auth[_0xbd41('0x8')](),controller[_0xbd41('0xf')]);router[_0xbd41('0xa')](_0xbd41('0x10'),auth[_0xbd41('0x8')](),controller['getApplications']);router[_0xbd41('0xa')]('/:id/interactions',auth[_0xbd41('0x8')](),controller['getInteractions']);router['get'](_0xbd41('0x11'),auth[_0xbd41('0x8')](),controller[_0xbd41('0x12')]);router[_0xbd41('0x13')]('/',auth['isAuthenticated'](),controller[_0xbd41('0x14')]);router['post'](_0xbd41('0xd'),auth['isAuthenticated'](),controller[_0xbd41('0x15')]);router['post'](_0xbd41('0x16'),auth['isAuthenticated'](),controller[_0xbd41('0x17')]);router[_0xbd41('0x13')](_0xbd41('0x18'),controller[_0xbd41('0x19')]);router['post'](_0xbd41('0x10'),auth[_0xbd41('0x8')](),controller['addApplications']);router[_0xbd41('0x13')](_0xbd41('0x11'),auth[_0xbd41('0x8')](),controller['addAgents']);router[_0xbd41('0x13')]('/:id/send',auth[_0xbd41('0x8')](),controller['send']);router[_0xbd41('0x1a')](_0xbd41('0x1b'),auth[_0xbd41('0x8')](),controller['update']);router[_0xbd41('0x1c')]('/:id',auth[_0xbd41('0x8')](),controller[_0xbd41('0x1d')]);router['delete'](_0xbd41('0xd'),auth['isAuthenticated'](),controller[_0xbd41('0x1e')]);router['delete'](_0xbd41('0x16'),auth[_0xbd41('0x8')](),controller[_0xbd41('0x1f')]);router['delete'](_0xbd41('0x11'),auth[_0xbd41('0x8')](),controller[_0xbd41('0x20')]);module[_0xbd41('0x21')]=router; \ No newline at end of file +var _0x8048=['index','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','/:id/send','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get'];(function(_0x6db2fc,_0x3279b6){var _0x30eadd=function(_0x3385f5){while(--_0x3385f5){_0x6db2fc['push'](_0x6db2fc['shift']());}};_0x30eadd(++_0x3279b6);}(_0x8048,0xcb));var _0x8804=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x8048[_0xa6cb09];return _0x12b437;};'use strict';var multer=require('multer');var util=require(_0x8804('0x0'));var path=require('path');var timeout=require(_0x8804('0x1'));var express=require(_0x8804('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8804('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8804('0x4'));var controller=require(_0x8804('0x5'));router[_0x8804('0x6')]('/',auth['isAuthenticated'](),controller[_0x8804('0x7')]);router[_0x8804('0x6')]('/describe',auth[_0x8804('0x8')](),controller[_0x8804('0x9')]);router[_0x8804('0x6')](_0x8804('0xa'),auth[_0x8804('0x8')](),controller[_0x8804('0xb')]);router[_0x8804('0x6')](_0x8804('0xc'),auth[_0x8804('0x8')](),controller['getDispositions']);router[_0x8804('0x6')](_0x8804('0xd'),auth[_0x8804('0x8')](),controller[_0x8804('0xe')]);router['get'](_0x8804('0xf'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8804('0x6')](_0x8804('0x10'),auth[_0x8804('0x8')](),controller[_0x8804('0x11')]);router[_0x8804('0x6')](_0x8804('0x12'),auth[_0x8804('0x8')](),controller[_0x8804('0x13')]);router[_0x8804('0x14')]('/',auth[_0x8804('0x8')](),controller[_0x8804('0x15')]);router['post'](_0x8804('0xc'),auth['isAuthenticated'](),controller[_0x8804('0x16')]);router[_0x8804('0x14')](_0x8804('0xd'),auth[_0x8804('0x8')](),controller[_0x8804('0x17')]);router[_0x8804('0x14')]('/:id/notify',controller[_0x8804('0x18')]);router['post'](_0x8804('0xf'),auth[_0x8804('0x8')](),controller[_0x8804('0x19')]);router['post'](_0x8804('0x12'),auth[_0x8804('0x8')](),controller['addAgents']);router[_0x8804('0x14')](_0x8804('0x1a'),auth[_0x8804('0x8')](),controller[_0x8804('0x1b')]);router[_0x8804('0x1c')](_0x8804('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8804('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x8804('0x1e')]);router[_0x8804('0x1d')](_0x8804('0xc'),auth[_0x8804('0x8')](),controller[_0x8804('0x1f')]);router[_0x8804('0x1d')](_0x8804('0xd'),auth[_0x8804('0x8')](),controller[_0x8804('0x20')]);router[_0x8804('0x1d')](_0x8804('0x12'),auth[_0x8804('0x8')](),controller[_0x8804('0x21')]);module[_0x8804('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index a64d807..fe5f0a5 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 _0x6df7=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','TEXT','BOOLEAN'];(function(_0x4fbc43,_0x4800c6){var _0x4f4e22=function(_0x40fa0c){while(--_0x40fa0c){_0x4fbc43['push'](_0x4fbc43['shift']());}};_0x4f4e22(++_0x4800c6);}(_0x6df7,0x138));var _0x76df=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6df7[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x76df('0x0'));var rs=require(_0x76df('0x1'));module[_0x76df('0x2')]={'name':{'type':Sequelize[_0x76df('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x76df('0x3')]},'token':{'type':Sequelize[_0x76df('0x3')],'defaultValue':function(){return rs[_0x76df('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x76df('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x76df('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x76df('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x76df('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x76df('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x76df('0x3')]},'queueTransfer':{'type':Sequelize[_0x76df('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x76df('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x76df('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x76df('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x76df('0x6')],'defaultValue':![],'comment':_0x76df('0x8'),'set':function(_0x4ff306){if(!_0x4ff306)this[_0x76df('0x9')]('mandatoryDispositionPauseId',null);this[_0x76df('0x9')](_0x76df('0xa'),_0x4ff306);}}}; \ No newline at end of file +var _0x717c=['sequelize','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDisposition'];(function(_0x589eb9,_0x30290c){var _0x5bd498=function(_0x1dec09){while(--_0x1dec09){_0x589eb9['push'](_0x589eb9['shift']());}};_0x5bd498(++_0x30290c);}(_0x717c,0xdc));var _0xc717=function(_0x7af2d3,_0x2ce735){_0x7af2d3=_0x7af2d3-0x0;var _0xf3a9d0=_0x717c[_0x7af2d3];return _0xf3a9d0;};'use strict';var Sequelize=require(_0xc717('0x0'));var rs=require('randomstring');module[_0xc717('0x1')]={'name':{'type':Sequelize[_0xc717('0x2')],'unique':_0xc717('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xc717('0x2')],'defaultValue':function(){return rs[_0xc717('0x4')]();}},'replyUri':{'type':Sequelize[_0xc717('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc717('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc717('0x5')],'defaultValue':function(){return _0xc717('0x6');}},'notificationSound':{'type':Sequelize[_0xc717('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc717('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc717('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc717('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc717('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc717('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc717('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x50cb20){if(!_0x50cb20)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc717('0x9')](_0xc717('0xa'),_0x50cb20);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0f9837e..2d7e294 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 _0x8991=['OpenchannelMessage','UserId','User','unshift','waitForTheAssignedAgent','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','bulkCreate','findAndCountAll','finally','getApplications','rawAttributes','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','end','stack','name','send','Pause','map','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','type','VIRTUAL','filter','OpenchannelAccount','include','findAll','rows','catch','show','params','mandatoryDispositionPause','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','length','hasOwnProperty','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x8991,0x1b0));var _0x1899=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0x8991[_0x42bfb7];return _0x5c497d;};'use strict';var emlformat=require(_0x1899('0x0'));var rimraf=require(_0x1899('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1899('0x2'));var moment=require(_0x1899('0x3'));var BPromise=require(_0x1899('0x4'));var Mustache=require(_0x1899('0x5'));var util=require(_0x1899('0x6'));var path=require(_0x1899('0x7'));var sox=require(_0x1899('0x8'));var csv=require(_0x1899('0x9'));var ejs=require(_0x1899('0xa'));var fs=require('fs');var fs_extra=require(_0x1899('0xb'));var _=require(_0x1899('0xc'));var squel=require(_0x1899('0xd'));var crypto=require(_0x1899('0xe'));var jsforce=require(_0x1899('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1899('0x9'));var querystring=require(_0x1899('0x10'));var Papa=require('papaparse');var Redis=require(_0x1899('0x11'));var authService=require(_0x1899('0x12'));var qs=require(_0x1899('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1899('0x14'));var logger=require(_0x1899('0x15'))(_0x1899('0x16'));var utils=require(_0x1899('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1899('0x18'))['db'];config['redis']=_[_0x1899('0x19')](config[_0x1899('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x1899('0x1b'))(new Redis(config[_0x1899('0x1a')]));require(_0x1899('0x1c'))[_0x1899('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1899('0x1e')][_0x1899('0x1f')]({'port':0x232c});var client9002=jayson[_0x1899('0x1e')][_0x1899('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x245c55,_0x29c778,_0xf3a0b8,_0x482764){return new BPromise(function(_0x5ba31b,_0x56e781){var _0x31330f=_0x482764||client;return _0x31330f['request'](_0x245c55,_0xf3a0b8)[_0x1899('0x20')](function(_0x5ee432){logger[_0x1899('0x21')](_0x1899('0x22'),_0x29c778,_0x1899('0x23'));logger[_0x1899('0x24')](_0x1899('0x25'),_0x29c778,_0x1899('0x23'),JSON[_0x1899('0x26')](_0x5ee432));if(_0x5ee432[_0x1899('0x27')]){if(_0x5ee432[_0x1899('0x27')][_0x1899('0x28')]===0x1f4){logger[_0x1899('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x29c778,_0x5ee432[_0x1899('0x27')][_0x1899('0x29')]);return _0x56e781(_0x5ee432['error'][_0x1899('0x29')]);}logger[_0x1899('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x29c778,_0x5ee432[_0x1899('0x27')][_0x1899('0x29')]);return _0x5ba31b(_0x5ee432[_0x1899('0x27')]['message']);}else{logger[_0x1899('0x21')](_0x1899('0x22'),_0x29c778,_0x1899('0x23'));_0x5ba31b(_0x5ee432[_0x1899('0x2a')][_0x1899('0x29')]);}})['catch'](function(_0x569c4b){logger[_0x1899('0x27')](_0x1899('0x22'),_0x29c778,_0x569c4b);_0x56e781(_0x569c4b);});});}function respondWithStatusCode(_0x28ca90,_0xbb935f){_0xbb935f=_0xbb935f||0xcc;return function(_0x3730ed){if(_0x3730ed){return _0x28ca90[_0x1899('0x2b')](_0xbb935f);}return _0x28ca90[_0x1899('0x2c')](_0xbb935f)['end']();};}function respondWithResult(_0x2aa9c1,_0x109581){_0x109581=_0x109581||0xc8;return function(_0x556ff2){if(_0x556ff2){return _0x2aa9c1[_0x1899('0x2c')](_0x109581)[_0x1899('0x2d')](_0x556ff2);}};}function respondWithFilteredResult(_0x52be21,_0x55d2f9){return function(_0x809138){if(_0x809138){var _0x286dc8=typeof _0x55d2f9['offset']===_0x1899('0x2e')&&typeof _0x55d2f9[_0x1899('0x2f')]===_0x1899('0x2e');var _0x2dddae=_0x809138[_0x1899('0x30')];var _0x4dc9fd=_0x286dc8?0x0:_0x55d2f9[_0x1899('0x31')];var _0x2e4adb=_0x286dc8?_0x809138[_0x1899('0x30')]:_0x55d2f9[_0x1899('0x31')]+_0x55d2f9['limit'];var _0x25aa07;if(_0x2e4adb>=_0x2dddae){_0x2e4adb=_0x2dddae;_0x25aa07=0xc8;}else{_0x25aa07=0xce;}_0x52be21['status'](_0x25aa07);return _0x52be21[_0x1899('0x32')](_0x1899('0x33'),_0x4dc9fd+'-'+_0x2e4adb+'/'+_0x2dddae)[_0x1899('0x2d')](_0x809138);}return null;};}function patchUpdates(_0x1d9682){return function(_0x38d0b8){try{jsonpatch[_0x1899('0x34')](_0x38d0b8,_0x1d9682,!![]);}catch(_0x1c89dc){return BPromise[_0x1899('0x35')](_0x1c89dc);}return _0x38d0b8[_0x1899('0x36')]();};}function saveUpdates(_0x36ea00,_0x3473e9){return function(_0x1d5a5e){if(_0x1d5a5e){return _0x1d5a5e[_0x1899('0x37')](_0x36ea00)[_0x1899('0x20')](function(_0x82bf77){return _0x82bf77;});}return null;};}function removeEntity(_0x4a7a31,_0x5d45ba){return function(_0x5e0055){if(_0x5e0055){return _0x5e0055[_0x1899('0x38')]()['then'](function(){var _0x5a3215=_0x5e0055[_0x1899('0x39')]({'plain':!![]});var _0x3dff05=_0x1899('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x3dff05,'resourceId':_0x5a3215['id']}})['then'](function(){return _0x5e0055;});})['then'](function(){_0x4a7a31[_0x1899('0x2c')](0xcc)[_0x1899('0x3b')]();});}};}function handleEntityNotFound(_0x25eb23,_0x10d9e1){return function(_0x45f054){if(!_0x45f054){_0x25eb23['sendStatus'](0x194);}return _0x45f054;};}function handleError(_0x3e0432,_0xa9c8c0){_0xa9c8c0=_0xa9c8c0||0x1f4;return function(_0x2160a5){logger[_0x1899('0x27')](_0x2160a5[_0x1899('0x3c')]);if(_0x2160a5[_0x1899('0x3d')]){delete _0x2160a5['name'];}_0x3e0432['status'](_0xa9c8c0)[_0x1899('0x3e')](_0x2160a5);};}exports['index']=function(_0x599c7a,_0x81c10c){var _0x4fdfc3={'include':[{'model':db[_0x1899('0x3f')],'as':'mandatoryDispositionPause'}]},_0x221bad={},_0x202116={'count':0x0,'rows':[]};var _0x578f52=_[_0x1899('0x40')](db['OpenchannelAccount']['rawAttributes'],function(_0x3c4fc8){return{'name':_0x3c4fc8[_0x1899('0x41')],'type':_0x3c4fc8['type'][_0x1899('0x42')]};});_0x221bad[_0x1899('0x43')]=_[_0x1899('0x40')](_0x578f52,'name');_0x221bad[_0x1899('0x44')]=_['keys'](_0x599c7a[_0x1899('0x44')]);_0x221bad[_0x1899('0x45')]=_[_0x1899('0x46')](_0x221bad[_0x1899('0x43')],_0x221bad[_0x1899('0x44')]);_0x4fdfc3[_0x1899('0x47')]=_[_0x1899('0x46')](_0x221bad[_0x1899('0x43')],qs[_0x1899('0x48')](_0x599c7a[_0x1899('0x44')][_0x1899('0x48')]));_0x4fdfc3[_0x1899('0x47')]=_0x4fdfc3['attributes']['length']?_0x4fdfc3[_0x1899('0x47')]:_0x221bad[_0x1899('0x43')];if(!_0x599c7a[_0x1899('0x44')]['hasOwnProperty'](_0x1899('0x49'))){_0x4fdfc3[_0x1899('0x2f')]=qs[_0x1899('0x2f')](_0x599c7a[_0x1899('0x44')][_0x1899('0x2f')]);_0x4fdfc3['offset']=qs[_0x1899('0x31')](_0x599c7a[_0x1899('0x44')]['offset']);}_0x4fdfc3[_0x1899('0x4a')]=qs[_0x1899('0x4b')](_0x599c7a[_0x1899('0x44')][_0x1899('0x4b')]);_0x4fdfc3[_0x1899('0x4c')]=qs[_0x1899('0x45')](_['pick'](_0x599c7a[_0x1899('0x44')],_0x221bad[_0x1899('0x45')]),_0x578f52);if(_0x599c7a[_0x1899('0x44')]['filter']){_0x4fdfc3[_0x1899('0x4c')]=_[_0x1899('0x4d')](_0x4fdfc3[_0x1899('0x4c')],{'$or':_[_0x1899('0x40')](_0x578f52,function(_0x55324c){if(_0x55324c[_0x1899('0x4e')]!==_0x1899('0x4f')){var _0x353de4={};_0x353de4[_0x55324c['name']]={'$like':'%'+_0x599c7a[_0x1899('0x44')][_0x1899('0x50')]+'%'};return _0x353de4;}})});}_0x4fdfc3=_[_0x1899('0x4d')]({},_0x4fdfc3,_0x599c7a['options']);var _0x1e1342={'where':_0x4fdfc3[_0x1899('0x4c')]};return db[_0x1899('0x51')][_0x1899('0x30')](_0x1e1342)[_0x1899('0x20')](function(_0x1c1bd5){_0x202116['count']=_0x1c1bd5;if(_0x599c7a[_0x1899('0x44')]['includeAll']){_0x4fdfc3[_0x1899('0x52')]=[{'all':!![]}];}return db[_0x1899('0x51')][_0x1899('0x53')](_0x4fdfc3);})['then'](function(_0x4f4c31){_0x202116[_0x1899('0x54')]=_0x4f4c31;return _0x202116;})[_0x1899('0x20')](respondWithFilteredResult(_0x81c10c,_0x4fdfc3))[_0x1899('0x55')](handleError(_0x81c10c,null));};exports[_0x1899('0x56')]=function(_0x342d67,_0x118d47){var _0x46f3f0={'raw':![],'where':{'id':_0x342d67[_0x1899('0x57')]['id']},'include':[{'model':db[_0x1899('0x3f')],'as':_0x1899('0x58')}]},_0x75ed38={};_0x75ed38[_0x1899('0x43')]=_['keys'](db[_0x1899('0x51')]['rawAttributes']);_0x75ed38[_0x1899('0x44')]=_[_0x1899('0x59')](_0x342d67['query']);_0x75ed38[_0x1899('0x45')]=_[_0x1899('0x46')](_0x75ed38[_0x1899('0x43')],_0x75ed38[_0x1899('0x44')]);_0x46f3f0[_0x1899('0x47')]=_['intersection'](_0x75ed38[_0x1899('0x43')],qs['fields'](_0x342d67[_0x1899('0x44')]['fields']));_0x46f3f0['attributes']=_0x46f3f0[_0x1899('0x47')]['length']?_0x46f3f0[_0x1899('0x47')]:_0x75ed38[_0x1899('0x43')];if(_0x342d67['query'][_0x1899('0x5a')]){_0x46f3f0[_0x1899('0x52')]=[{'all':!![]}];}_0x46f3f0=_[_0x1899('0x4d')]({},_0x46f3f0,_0x342d67['options']);return db['OpenchannelAccount']['find'](_0x46f3f0)['then'](handleEntityNotFound(_0x118d47,null))[_0x1899('0x20')](respondWithResult(_0x118d47,null))[_0x1899('0x55')](handleError(_0x118d47,null));};exports['create']=function(_0x585efd,_0x27b076){return db[_0x1899('0x51')][_0x1899('0x5b')](_0x585efd[_0x1899('0x5c')],{})[_0x1899('0x20')](function(_0x8f7234){var _0x35d82f=_0x585efd[_0x1899('0x5d')][_0x1899('0x39')]({'plain':!![]});if(!_0x35d82f)throw new Error(_0x1899('0x5e'));if(_0x35d82f['role']===_0x1899('0x5d')){var _0x15d439=_0x8f7234['get']({'plain':!![]});var _0x983a42=_0x1899('0x3a');return db[_0x1899('0x5f')]['find']({'where':{'name':_0x983a42,'userProfileId':_0x35d82f['userProfileId']},'raw':!![]})[_0x1899('0x20')](function(_0x5b59db){if(_0x5b59db&&_0x5b59db['autoAssociation']===0x0){return db[_0x1899('0x60')][_0x1899('0x5b')]({'name':_0x15d439[_0x1899('0x3d')],'resourceId':_0x15d439['id'],'type':_0x5b59db['name'],'sectionId':_0x5b59db['id']},{})['then'](function(){return _0x8f7234;});}else{return _0x8f7234;}})[_0x1899('0x55')](function(_0x53e546){logger[_0x1899('0x27')](_0x1899('0x61'),_0x53e546);throw _0x53e546;});}return _0x8f7234;})[_0x1899('0x20')](respondWithResult(_0x27b076,0xc9))['catch'](handleError(_0x27b076,null));};exports['update']=function(_0x3d26d0,_0x4b0082){if(_0x3d26d0[_0x1899('0x5c')]['id']){delete _0x3d26d0[_0x1899('0x5c')]['id'];}return db[_0x1899('0x51')]['find']({'where':{'id':_0x3d26d0['params']['id']},'include':[{'model':db['Pause'],'as':_0x1899('0x58')}]})['then'](handleEntityNotFound(_0x4b0082,null))[_0x1899('0x20')](saveUpdates(_0x3d26d0[_0x1899('0x5c')],null))['then'](respondWithResult(_0x4b0082,null))[_0x1899('0x55')](handleError(_0x4b0082,null));};exports['destroy']=function(_0x2c3794,_0xf4db8a){return db[_0x1899('0x51')][_0x1899('0x62')]({'where':{'id':_0x2c3794['params']['id']}})['then'](handleEntityNotFound(_0xf4db8a,null))[_0x1899('0x20')](removeEntity(_0xf4db8a,null))[_0x1899('0x55')](handleError(_0xf4db8a,null));};exports[_0x1899('0x63')]=function(_0x12040c,_0x39381d){return db[_0x1899('0x51')][_0x1899('0x63')]()[_0x1899('0x20')](respondWithResult(_0x39381d,null))[_0x1899('0x55')](handleError(_0x39381d,null));};exports[_0x1899('0x64')]=function(_0x3422b8,_0x4797c3,_0x1da291){if(_0x3422b8['body']['id']){delete _0x3422b8[_0x1899('0x5c')]['id'];}return db[_0x1899('0x51')]['find']({'where':{'id':_0x3422b8['params']['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x4797c3,null))[_0x1899('0x20')](function(_0x5543bd){if(_0x5543bd){_0x3422b8[_0x1899('0x5c')][_0x1899('0x65')]=_0x5543bd['id'];return db[_0x1899('0x66')]['create'](_0x3422b8['body']);}})[_0x1899('0x20')](respondWithResult(_0x4797c3,null))[_0x1899('0x55')](handleError(_0x4797c3,null));};exports[_0x1899('0x67')]=function(_0x3aa72e,_0x44eb1d,_0x5c7e22){var _0x5c4aa7={'raw':![],'where':{}};var _0x3c2484={};var _0x18181b={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3aa72e[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x44eb1d,null))[_0x1899('0x20')](function(_0x4f64e0){if(_0x4f64e0){_0x3c2484[_0x1899('0x43')]=_[_0x1899('0x59')](db[_0x1899('0x66')]['rawAttributes']);_0x3c2484[_0x1899('0x44')]=_[_0x1899('0x59')](_0x3aa72e['query']);_0x3c2484[_0x1899('0x45')]=_[_0x1899('0x46')](_0x3c2484['model'],_0x3c2484[_0x1899('0x44')]);_0x5c4aa7[_0x1899('0x47')]=_[_0x1899('0x46')](_0x3c2484[_0x1899('0x43')],qs[_0x1899('0x48')](_0x3aa72e[_0x1899('0x44')]['fields']));_0x5c4aa7[_0x1899('0x47')]=_0x5c4aa7[_0x1899('0x47')][_0x1899('0x68')]?_0x5c4aa7[_0x1899('0x47')]:_0x3c2484[_0x1899('0x43')];if(!_0x3aa72e[_0x1899('0x44')][_0x1899('0x69')](_0x1899('0x49'))){_0x5c4aa7[_0x1899('0x2f')]=qs['limit'](_0x3aa72e['query'][_0x1899('0x2f')]);_0x5c4aa7[_0x1899('0x31')]=qs[_0x1899('0x31')](_0x3aa72e[_0x1899('0x44')]['offset']);}_0x5c4aa7['order']=qs[_0x1899('0x4b')](_0x3aa72e['query'][_0x1899('0x4b')]);_0x5c4aa7[_0x1899('0x4c')]=qs[_0x1899('0x45')](_[_0x1899('0x6a')](_0x3aa72e[_0x1899('0x44')],_0x3c2484[_0x1899('0x45')]));_0x5c4aa7[_0x1899('0x4c')][_0x1899('0x65')]=_0x4f64e0['id'];if(_0x3aa72e[_0x1899('0x44')][_0x1899('0x50')]){_0x5c4aa7[_0x1899('0x4c')]=_['merge'](_0x5c4aa7['where'],{'$or':_[_0x1899('0x40')](_0x5c4aa7[_0x1899('0x47')],function(_0x74b8ee){var _0x3a1a74={};_0x3a1a74[_0x74b8ee]={'$like':'%'+_0x3aa72e['query'][_0x1899('0x50')]+'%'};return _0x3a1a74;})});}_0x5c4aa7=_[_0x1899('0x4d')]({},_0x5c4aa7,_0x3aa72e[_0x1899('0x6b')]);return db[_0x1899('0x66')]['count']({'where':_0x5c4aa7[_0x1899('0x4c')]})[_0x1899('0x20')](function(_0x4730c2){_0x18181b[_0x1899('0x30')]=_0x4730c2;if(_0x3aa72e[_0x1899('0x44')][_0x1899('0x5a')]){_0x5c4aa7['include']=[{'all':!![]}];}return db[_0x1899('0x66')][_0x1899('0x53')](_0x5c4aa7);})[_0x1899('0x20')](function(_0x4444ab){_0x18181b[_0x1899('0x54')]=_0x4444ab;return _0x18181b;});}})[_0x1899('0x20')](respondWithFilteredResult(_0x44eb1d,_0x5c4aa7))[_0x1899('0x55')](handleError(_0x44eb1d,null));};exports[_0x1899('0x6c')]=function(_0x25195a,_0x23f0e3,_0x2673e7){return db['OpenchannelAccount'][_0x1899('0x62')]({'where':{'id':_0x25195a[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x23f0e3,null))[_0x1899('0x20')](function(_0x275199){if(_0x275199){return _0x275199[_0x1899('0x6c')](_0x25195a['query'][_0x1899('0x6d')]);}})[_0x1899('0x20')](respondWithStatusCode(_0x23f0e3,null))[_0x1899('0x55')](handleError(_0x23f0e3,null));};exports[_0x1899('0x6e')]=function(_0x10fad9,_0x19e5cf,_0x5d90a9){if(_0x10fad9[_0x1899('0x5c')]['id']){delete _0x10fad9[_0x1899('0x5c')]['id'];}return db[_0x1899('0x51')][_0x1899('0x62')]({'where':{'id':_0x10fad9[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x19e5cf,null))[_0x1899('0x20')](function(_0x58beab){if(_0x58beab){_0x10fad9[_0x1899('0x5c')]['OpenchannelAccountId']=_0x58beab['id'];return db[_0x1899('0x6f')][_0x1899('0x5b')](_0x10fad9[_0x1899('0x5c')]);}})['then'](respondWithResult(_0x19e5cf,null))[_0x1899('0x55')](handleError(_0x19e5cf,null));};exports['getAnswers']=function(_0xc1bc7,_0x29d0f3,_0x3b7bf8){var _0x5def50={'raw':![],'where':{}};var _0x4851a1={};var _0x40b019={'count':0x0,'rows':[]};return db[_0x1899('0x51')]['findOne']({'where':{'id':_0xc1bc7[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x29d0f3,null))[_0x1899('0x20')](function(_0x201821){if(_0x201821){_0x4851a1[_0x1899('0x43')]=_['keys'](db[_0x1899('0x6f')]['rawAttributes']);_0x4851a1[_0x1899('0x44')]=_[_0x1899('0x59')](_0xc1bc7[_0x1899('0x44')]);_0x4851a1[_0x1899('0x45')]=_[_0x1899('0x46')](_0x4851a1[_0x1899('0x43')],_0x4851a1[_0x1899('0x44')]);_0x5def50[_0x1899('0x47')]=_['intersection'](_0x4851a1[_0x1899('0x43')],qs[_0x1899('0x48')](_0xc1bc7[_0x1899('0x44')][_0x1899('0x48')]));_0x5def50[_0x1899('0x47')]=_0x5def50['attributes']['length']?_0x5def50[_0x1899('0x47')]:_0x4851a1[_0x1899('0x43')];if(!_0xc1bc7[_0x1899('0x44')]['hasOwnProperty']('nolimit')){_0x5def50[_0x1899('0x2f')]=qs[_0x1899('0x2f')](_0xc1bc7[_0x1899('0x44')][_0x1899('0x2f')]);_0x5def50[_0x1899('0x31')]=qs[_0x1899('0x31')](_0xc1bc7[_0x1899('0x44')][_0x1899('0x31')]);}_0x5def50['order']=qs[_0x1899('0x4b')](_0xc1bc7[_0x1899('0x44')][_0x1899('0x4b')]);_0x5def50['where']=qs[_0x1899('0x45')](_[_0x1899('0x6a')](_0xc1bc7[_0x1899('0x44')],_0x4851a1[_0x1899('0x45')]));_0x5def50['where'][_0x1899('0x65')]=_0x201821['id'];if(_0xc1bc7[_0x1899('0x44')][_0x1899('0x50')]){_0x5def50[_0x1899('0x4c')]=_[_0x1899('0x4d')](_0x5def50[_0x1899('0x4c')],{'$or':_['map'](_0x5def50[_0x1899('0x47')],function(_0x128bad){var _0x5301af={};_0x5301af[_0x128bad]={'$like':'%'+_0xc1bc7[_0x1899('0x44')][_0x1899('0x50')]+'%'};return _0x5301af;})});}_0x5def50=_[_0x1899('0x4d')]({},_0x5def50,_0xc1bc7[_0x1899('0x6b')]);return db[_0x1899('0x6f')][_0x1899('0x30')]({'where':_0x5def50[_0x1899('0x4c')]})['then'](function(_0x2e38b8){_0x40b019[_0x1899('0x30')]=_0x2e38b8;if(_0xc1bc7[_0x1899('0x44')][_0x1899('0x5a')]){_0x5def50[_0x1899('0x52')]=[{'all':!![]}];}return db[_0x1899('0x6f')][_0x1899('0x53')](_0x5def50);})[_0x1899('0x20')](function(_0xd250d7){_0x40b019[_0x1899('0x54')]=_0xd250d7;return _0x40b019;});}})['then'](respondWithFilteredResult(_0x29d0f3,_0x5def50))[_0x1899('0x55')](handleError(_0x29d0f3,null));};exports['removeAnswers']=function(_0x43474e,_0x502a10,_0x128ad0){return db[_0x1899('0x51')][_0x1899('0x62')]({'where':{'id':_0x43474e[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x502a10,null))['then'](function(_0x4e3db2){if(_0x4e3db2){return _0x4e3db2[_0x1899('0x70')](_0x43474e[_0x1899('0x44')][_0x1899('0x6d')]);}})[_0x1899('0x20')](respondWithStatusCode(_0x502a10,null))['catch'](handleError(_0x502a10,null));};exports['notify']=function(_0x966cd5,_0x13bc6d,_0x8277c3){var _0x36a431={'body':_0x966cd5['body'],'channel':_0x1899('0x71')};var _0x434665=[];var _0x342b99=[];var _0x557e4a={};var _0x3db663=![];return db[_0x1899('0x72')][_0x1899('0x63')]()[_0x1899('0x20')](function(_0x15ba90){if(!_0x15ba90){throw new db[(_0x1899('0x73'))][(_0x1899('0x74'))](_0x1899('0x75'));}_0x434665=_['difference'](_[_0x1899('0x59')](_0x15ba90),[_0x1899('0x76'),_0x1899('0x77')]);_0x342b99=_[_0x1899('0x78')](_[_0x1899('0x59')](_0x15ba90),[_0x1899('0x76'),_0x1899('0x77'),_0x1899('0x79'),'ListId']);if(_0x966cd5['body']['id']){delete _0x966cd5[_0x1899('0x5c')]['id'];}if(_[_0x1899('0x7a')](_0x966cd5[_0x1899('0x5c')]['from'])){throw new db[(_0x1899('0x73'))][(_0x1899('0x74'))]('from\x20is\x20mandatory');}if(_[_0x1899('0x7a')](_0x966cd5[_0x1899('0x5c')][_0x1899('0x5c')])||_0x966cd5['body'][_0x1899('0x5c')]===''){throw new db[(_0x1899('0x73'))]['ValidationError'](_0x1899('0x7b'));}if(_[_0x1899('0x7a')](_0x966cd5[_0x1899('0x5c')][_0x1899('0x7c')])){throw new db[(_0x1899('0x73'))][(_0x1899('0x74'))](_0x1899('0x7d')+_0x342b99);}if(!_[_0x1899('0x7e')](_0x342b99,_0x966cd5[_0x1899('0x5c')][_0x1899('0x7c')])){throw new db['Sequelize'][(_0x1899('0x74'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x342b99);}_0x557e4a[_0x966cd5[_0x1899('0x5c')]['mapKey']]=_0x966cd5['body'][_0x1899('0x7f')];})[_0x1899('0x20')](function(){return db['OpenchannelAccount'][_0x1899('0x62')]({'where':{'id':_0x966cd5[_0x1899('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x1899('0x80'),'include':[{'model':db[_0x1899('0x72')],'as':_0x1899('0x81'),'where':_0x557e4a,'limit':0x1,'order':[[_0x1899('0x77'),_0x1899('0x82')]]}]},{'model':db[_0x1899('0x83')],'as':_0x1899('0x84')}]});})['then'](handleEntityNotFound(_0x13bc6d,null))[_0x1899('0x20')](function(_0x1873a9){if(_0x1873a9&&_0x1873a9[_0x1899('0x80')]){_0x36a431[_0x1899('0x85')]=_0x1873a9;_0x36a431[_0x1899('0x86')]=_0x1873a9[_0x1899('0x84')];_0x36a431[_0x1899('0x87')]=_0x1873a9[_0x1899('0x80')];_0x36a431[_0x1899('0x86')]=_[_0x1899('0x88')](_0x36a431[_0x1899('0x86')],[_0x1899('0x89')],['asc']);if(_0x36a431[_0x1899('0x85')][_0x1899('0x84')]){delete _0x36a431[_0x1899('0x85')][_0x1899('0x84')];}if(_0x36a431['account'][_0x1899('0x80')]&&_0x36a431['account'][_0x1899('0x80')][_0x1899('0x81')]['length']){return _0x36a431[_0x1899('0x85')][_0x1899('0x80')]['Contacts'][0x0];}var _0x30f339=_[_0x1899('0x19')](_0x966cd5[_0x1899('0x5c')],{'firstName':_0x966cd5['body'][_0x1899('0x7f')],'ListId':_0x1873a9[_0x1899('0x8a')]});_0x30f339[_0x966cd5[_0x1899('0x5c')][_0x1899('0x7c')]]=_0x966cd5['body'][_0x1899('0x7f')];return db['CmContact'][_0x1899('0x5b')](_0x30f339,{'fields':_0x434665,'raw':!![]});}})['then'](handleEntityNotFound(_0x13bc6d,null))[_0x1899('0x20')](function(_0x5220ab){_0x36a431[_0x1899('0x8b')]=_0x5220ab;if(_0x5220ab){var _0x578852={'ContactId':_0x5220ab['id'],'OpenchannelAccountId':_0x966cd5[_0x1899('0x57')]['id'],'from':(_0x5220ab[_0x1899('0x8c')]||'')+'\x20'+(_0x5220ab['lastName']||'')};var _0x2b1070={'OpenchannelAccountId':_0x966cd5[_0x1899('0x57')]['id'],'closed':![]};if(_0x966cd5['body'][_0x1899('0x8d')]){_0x2b1070[_0x1899('0x8d')]=_0x966cd5[_0x1899('0x5c')][_0x1899('0x8d')];return db[_0x1899('0x8e')][_0x1899('0x62')]({'where':_0x2b1070})[_0x1899('0x20')](function(_0x4dd235){if(_0x4dd235){return[_0x4dd235,![]];}_0x578852[_0x1899('0x8d')]=_0x966cd5[_0x1899('0x5c')][_0x1899('0x8d')];_0x578852[_0x1899('0x8f')]=_0x966cd5[_0x1899('0x5c')][_0x1899('0x8f')];return db[_0x1899('0x8e')]['create'](_0x578852)[_0x1899('0x20')](function(_0x41722c){return[_0x41722c,!![]];});});}else{_0x2b1070[_0x1899('0x8d')]=null;}_0x2b1070[_0x1899('0x90')]=_0x5220ab['id'];return db[_0x1899('0x8e')][_0x1899('0x62')]({'where':_0x2b1070})[_0x1899('0x20')](function(_0x3a0d56){if(_0x3a0d56){return[_0x3a0d56,![]];}return db[_0x1899('0x8e')]['create'](_0x578852)[_0x1899('0x20')](function(_0x4cd845){return[_0x4cd845,!![]];});});}})[_0x1899('0x91')](function(_0x5accc7,_0x924f19){if(_0x5accc7){_0x3db663=_0x924f19;if(!_0x924f19){var _0x18017b={'from':(_0x36a431[_0x1899('0x8b')][_0x1899('0x8c')]||'')+'\x20'+(_0x36a431[_0x1899('0x8b')]['lastName']||'')};if(_0x966cd5[_0x1899('0x5c')]['threadId']&&_0x966cd5['body']['messageId']&&_0x966cd5[_0x1899('0x5c')][_0x1899('0x8d')]!=_0x966cd5[_0x1899('0x5c')]['messageId']){_0x18017b['threadId']=_0x966cd5['body'][_0x1899('0x92')];}return _0x5accc7[_0x1899('0x37')](_0x18017b);}else{return _0x5accc7;}}})[_0x1899('0x20')](function(_0x5b8cf4){_0x36a431[_0x1899('0x93')]=_0x5b8cf4['get']({'plain':!![]});_0x36a431[_0x1899('0x93')][_0x1899('0x94')]=_0x3db663;if(_0x36a431[_0x1899('0x93')][_0x1899('0x94')]){if(_0x36a431[_0x1899('0x85')]['autoclose']){_0x36a431['applications'][_0x1899('0x95')]({'id':0x0,'priority':_0x36a431[_0x1899('0x86')][_0x1899('0x68')]+0x1,'app':_0x1899('0x96'),'appdata':_0x1899('0x97'),'interval':_0x1899('0x98')});}}return db[_0x1899('0x99')]['create']({'body':_0x966cd5[_0x1899('0x5c')]['body'],'OpenchannelAccountId':_0x966cd5[_0x1899('0x57')]['id'],'OpenchannelInteractionId':_0x5b8cf4['id'],'direction':'in','ContactId':_0x36a431[_0x1899('0x8b')]['id'],'AttachmentId':_0x966cd5[_0x1899('0x5c')]['AttachmentId']});})[_0x1899('0x20')](function(_0x44b210){_0x36a431[_0x1899('0x29')]=_0x44b210;if(!_0x36a431[_0x1899('0x93')][_0x1899('0x9a')])return;return db[_0x1899('0x9b')][_0x1899('0x62')]({'attributes':['id',_0x1899('0x3d')],'where':{'id':_0x36a431[_0x1899('0x93')][_0x1899('0x9a')]}});})[_0x1899('0x20')](function(_0x17cb1b){if(_0x17cb1b){_0x36a431[_0x1899('0x86')][_0x1899('0x9c')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x17cb1b[_0x1899('0x3d')]+','+(_0x36a431['account'][_0x1899('0x9d')]||0xa),'interval':'*,*,*,*'});}if(!_0x36a431['interaction']['queueId'])return;return db[_0x1899('0x9e')][_0x1899('0x62')]({'attributes':['id','name'],'where':{'id':_0x36a431[_0x1899('0x93')]['queueId']}});})[_0x1899('0x20')](function(_0x329956){if(_0x329956){_0x36a431[_0x1899('0x86')][_0x1899('0x9c')]({'id':0x0,'priority':0x1,'app':_0x1899('0x9f'),'appdata':_0x329956[_0x1899('0x3d')]+','+(_0x36a431[_0x1899('0x85')][_0x1899('0xa0')]||0x12c),'interval':_0x1899('0x98')});}return respondWithRpcPromise(_0x1899('0xa1'),_0x1899('0xa2'),_0x36a431);})[_0x1899('0x20')](function(_0x576d25){respondWithRpcPromise(_0x1899('0xa3'),'EventManager',{'event':_0x1899('0xa4'),'message':_0x576d25},client9002);return _0x576d25;})[_0x1899('0x20')](respondWithResult(_0x13bc6d,null))[_0x1899('0x55')](handleError(_0x13bc6d,null));};exports['addApplications']=function(_0x37db22,_0x4ff896){var _0x1bb97c=_0x37db22['params']['id'];var _0x21ccbc=_0x37db22[_0x1899('0x5c')];var _0x2ab991=0xc8;var _0x1386dc=null;return db[_0x1899('0xa5')][_0x1899('0xa6')]({'isolationLevel':db['sequelize'][_0x1899('0xa7')][_0x1899('0xa8')][_0x1899('0xa9')]},function(_0xd26015){return db['OpenchannelAccount'][_0x1899('0xaa')]({'where':{'id':_0x1bb97c},'transaction':_0xd26015})[_0x1899('0x20')](function(_0x114d76){if(_0x114d76){return db[_0x1899('0x83')][_0x1899('0x38')]({'where':{'OpenchannelAccountId':_0x1bb97c},'transaction':_0xd26015})[_0x1899('0x20')](function(){var _0x46bbb6=_[_0x1899('0x40')](_0x21ccbc,function(_0x3f2648){_0x3f2648[_0x1899('0x65')]=_0x1bb97c;return _0x3f2648;});return db[_0x1899('0x83')][_0x1899('0xab')](_0x46bbb6,{'transaction':_0xd26015});});}else{_0x2ab991=0x194;_0x1386dc=[];}});})[_0x1899('0x20')](function(){if(_0x2ab991!==0x194){return db[_0x1899('0x83')][_0x1899('0xac')]({'where':{'OpenchannelAccountId':_0x1bb97c},'order':'priority'})[_0x1899('0x20')](function(_0x2ce01e){_0x1386dc=_0x2ce01e;});}})[_0x1899('0x55')](function(_0x24679c){_0x2ab991=0x1f4;logger[_0x1899('0x27')](_0x24679c[_0x1899('0x3c')]);if(_0x24679c[_0x1899('0x3d')]){delete _0x24679c[_0x1899('0x3d')];}_0x1386dc=_0x24679c;})[_0x1899('0xad')](function(){if(_0x1386dc===null){_0x4ff896[_0x1899('0x2b')](_0x2ab991);}else{if(_0x2ab991===0x1f4){_0x4ff896[_0x1899('0x2c')](_0x2ab991)[_0x1899('0x3e')](_0x1386dc);}else{_0x4ff896[_0x1899('0x2c')](_0x2ab991)[_0x1899('0x2d')](_0x1386dc);}}});};exports[_0x1899('0xae')]=function(_0xd150a6,_0x2a93f6,_0x45d2bb){var _0x14eb51={};var _0x23c465={};var _0x5649ab;var _0x50304b;return db['OpenchannelAccount'][_0x1899('0xaa')]({'where':{'id':_0xd150a6[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x2a93f6,null))[_0x1899('0x20')](function(_0x145882){if(_0x145882){_0x5649ab=_0x145882;_0x23c465[_0x1899('0x43')]=_[_0x1899('0x59')](db[_0x1899('0x83')][_0x1899('0xaf')]);_0x23c465[_0x1899('0x44')]=_['keys'](_0xd150a6[_0x1899('0x44')]);_0x23c465[_0x1899('0x45')]=_[_0x1899('0x46')](_0x23c465['model'],_0x23c465[_0x1899('0x44')]);_0x14eb51[_0x1899('0x47')]=_[_0x1899('0x46')](_0x23c465[_0x1899('0x43')],qs[_0x1899('0x48')](_0xd150a6[_0x1899('0x44')]['fields']));_0x14eb51[_0x1899('0x47')]=_0x14eb51[_0x1899('0x47')][_0x1899('0x68')]?_0x14eb51[_0x1899('0x47')]:_0x23c465[_0x1899('0x43')];_0x14eb51['order']=qs[_0x1899('0x4b')](_0xd150a6['query'][_0x1899('0x4b')]);_0x14eb51[_0x1899('0x4c')]=qs[_0x1899('0x45')](_['pick'](_0xd150a6[_0x1899('0x44')],_0x23c465[_0x1899('0x45')]));if(_0xd150a6[_0x1899('0x44')][_0x1899('0x50')]){_0x14eb51[_0x1899('0x4c')]=_['merge'](_0x14eb51['where'],{'$or':_[_0x1899('0x40')](_0x14eb51[_0x1899('0x47')],function(_0xd48d02){var _0x5ea3a7={};_0x5ea3a7[_0xd48d02]={'$like':'%'+_0xd150a6[_0x1899('0x44')]['filter']+'%'};return _0x5ea3a7;})});}_0x14eb51=_[_0x1899('0x4d')]({},_0x14eb51,_0xd150a6[_0x1899('0x6b')]);return _0x5649ab['getApplications'](_0x14eb51);}})[_0x1899('0x20')](function(_0x3ecab2){if(_0x3ecab2){_0x50304b=_0x3ecab2[_0x1899('0x68')];if(!_0xd150a6['query'][_0x1899('0x69')](_0x1899('0x49'))){_0x14eb51[_0x1899('0x2f')]=qs[_0x1899('0x2f')](_0xd150a6['query'][_0x1899('0x2f')]);_0x14eb51['offset']=qs[_0x1899('0x31')](_0xd150a6['query'][_0x1899('0x31')]);}return _0x5649ab[_0x1899('0xae')](_0x14eb51);}})[_0x1899('0x20')](function(_0x4a4cc5){if(_0x4a4cc5){return _0x4a4cc5?{'count':_0x50304b,'rows':_0x4a4cc5}:null;}})[_0x1899('0x20')](respondWithResult(_0x2a93f6,null))[_0x1899('0x55')](handleError(_0x2a93f6,null));};exports[_0x1899('0xb0')]=function(_0x4bcb0c,_0x538557,_0x5531aa){var _0x46a978={'raw':![],'where':{}};var _0xe07879={};var _0x294219={'count':0x0,'rows':[]};return db[_0x1899('0x51')][_0x1899('0xaa')]({'where':{'id':_0x4bcb0c[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x538557,null))['then'](function(_0x1e2b59){if(_0x1e2b59){_0xe07879['model']=_[_0x1899('0x59')](db[_0x1899('0x8e')][_0x1899('0xaf')]);_0xe07879[_0x1899('0x44')]=_[_0x1899('0x59')](_0x4bcb0c[_0x1899('0x44')]);_0xe07879[_0x1899('0x45')]=_[_0x1899('0x46')](_0xe07879[_0x1899('0x43')],_0xe07879[_0x1899('0x44')]);_0x46a978[_0x1899('0x47')]=_[_0x1899('0x46')](_0xe07879[_0x1899('0x43')],qs[_0x1899('0x48')](_0x4bcb0c[_0x1899('0x44')][_0x1899('0x48')]));_0x46a978[_0x1899('0x47')]=_0x46a978[_0x1899('0x47')][_0x1899('0x68')]?_0x46a978[_0x1899('0x47')]:_0xe07879[_0x1899('0x43')];if(!_0x4bcb0c[_0x1899('0x44')][_0x1899('0x69')](_0x1899('0x49'))){_0x46a978[_0x1899('0x2f')]=qs[_0x1899('0x2f')](_0x4bcb0c[_0x1899('0x44')][_0x1899('0x2f')]);_0x46a978['offset']=qs[_0x1899('0x31')](_0x4bcb0c[_0x1899('0x44')][_0x1899('0x31')]);}_0x46a978[_0x1899('0x4a')]=qs['sort'](_0x4bcb0c['query']['sort']);_0x46a978[_0x1899('0x4c')]=qs[_0x1899('0x45')](_['pick'](_0x4bcb0c[_0x1899('0x44')],_0xe07879[_0x1899('0x45')]));_0x46a978['where'][_0x1899('0x65')]=_0x1e2b59['id'];if(_0x4bcb0c['query'][_0x1899('0x50')]){_0x46a978[_0x1899('0x4c')]=_['merge'](_0x46a978[_0x1899('0x4c')],{'$or':_['map'](_0x46a978[_0x1899('0x47')],function(_0x1d2ebf){var _0x5e207c={};_0x5e207c[_0x1d2ebf]={'$like':'%'+_0x4bcb0c[_0x1899('0x44')]['filter']+'%'};return _0x5e207c;})});}_0x46a978=_[_0x1899('0x4d')]({},_0x46a978,_0x4bcb0c[_0x1899('0x6b')]);return db['OpenchannelInteraction']['count']({'where':_0x46a978[_0x1899('0x4c')]})['then'](function(_0x58b741){_0x294219['count']=_0x58b741;if(_0x4bcb0c['query'][_0x1899('0x5a')]){_0x46a978[_0x1899('0x52')]=[{'model':db[_0x1899('0x72')],'as':_0x1899('0xb1'),'required':![]},{'model':db[_0x1899('0x9b')],'as':_0x1899('0xb2'),'attributes':[_0x1899('0x3d'),_0x1899('0xb3'),_0x1899('0xb4')],'required':![]},{'model':db[_0x1899('0xb5')],'as':_0x1899('0xb6'),'attributes':['id',_0x1899('0x3d'),'color'],'where':_0x4bcb0c[_0x1899('0x44')][_0x1899('0xb7')]?{'id':_0x4bcb0c[_0x1899('0x44')][_0x1899('0xb7')]}:undefined,'required':_0x4bcb0c[_0x1899('0x44')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0x1899('0x53')](_0x46a978);})[_0x1899('0x20')](function(_0x496e84){_0x294219['rows']=_0x496e84;return _0x294219;});}})[_0x1899('0x20')](respondWithFilteredResult(_0x538557,_0x46a978))[_0x1899('0x55')](handleError(_0x538557,null));};exports[_0x1899('0xb8')]=function(_0x15a5be,_0x39a11a,_0x31083a){return db[_0x1899('0x51')][_0x1899('0x62')]({'where':{'id':_0x15a5be[_0x1899('0x57')]['id']}})['then'](handleEntityNotFound(_0x39a11a,null))['then'](function(_0x162375){if(_0x162375){return _0x162375[_0x1899('0xb8')](_0x15a5be['body'][_0x1899('0x6d')],_['omit'](_0x15a5be['body'],[_0x1899('0x6d'),'id'])||{})[_0x1899('0x91')](function(_0x44e4cc){for(var _0x4c8233=0x0;_0x4c8233<_0x15a5be[_0x1899('0x5c')]['ids']['length'];_0x4c8233+=0x1){socket[_0x1899('0xb9')](_0x1899('0xba'),{'UserId':Number(_0x15a5be[_0x1899('0x5c')]['ids'][_0x4c8233]),'OpenchannelAccountId':Number(_0x15a5be[_0x1899('0x57')]['id'])});}return _0x44e4cc;});}})[_0x1899('0x20')](respondWithResult(_0x39a11a,null))['catch'](handleError(_0x39a11a,null));};exports[_0x1899('0xbb')]=function(_0x81597f,_0x25197a,_0x3e241c){return db[_0x1899('0x51')][_0x1899('0x62')]({'where':{'id':_0x81597f['params']['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x25197a,null))[_0x1899('0x20')](function(_0x35c6cf){if(_0x35c6cf){return _0x35c6cf['removeAgents'](_0x81597f[_0x1899('0x44')][_0x1899('0x6d')])['then'](function(){if(_[_0x1899('0xbc')](_0x81597f[_0x1899('0x44')]['ids'])){for(var _0x2a9b9a=0x0;_0x2a9b9a<_0x81597f[_0x1899('0x44')]['ids'][_0x1899('0x68')];_0x2a9b9a+=0x1){socket[_0x1899('0xb9')](_0x1899('0xbd'),{'UserId':Number(_0x81597f[_0x1899('0x44')][_0x1899('0x6d')][_0x2a9b9a]),'OpenchannelAccountId':Number(_0x81597f['params']['id'])});}}else{socket['emit'](_0x1899('0xbd'),{'UserId':Number(_0x81597f[_0x1899('0x44')][_0x1899('0x6d')]),'OpenchannelAccountId':Number(_0x81597f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x25197a,null))[_0x1899('0x55')](handleError(_0x25197a,null));};exports['getAgents']=function(_0x3b20a9,_0x44010e,_0x36609f){var _0x3d6bbd={};var _0x2c479b={};var _0x4e6307;var _0x22737d;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3b20a9[_0x1899('0x57')]['id']}})[_0x1899('0x20')](handleEntityNotFound(_0x44010e,null))['then'](function(_0x2c8bf8){if(_0x2c8bf8){_0x4e6307=_0x2c8bf8;_0x2c479b[_0x1899('0x43')]=_[_0x1899('0x59')](db[_0x1899('0x9b')][_0x1899('0xaf')]);_0x2c479b[_0x1899('0x44')]=_[_0x1899('0x59')](_0x3b20a9[_0x1899('0x44')]);_0x2c479b[_0x1899('0x45')]=_['intersection'](_0x2c479b['model'],_0x2c479b['query']);_0x3d6bbd[_0x1899('0x47')]=_[_0x1899('0x46')](_0x2c479b[_0x1899('0x43')],qs[_0x1899('0x48')](_0x3b20a9[_0x1899('0x44')][_0x1899('0x48')]));_0x3d6bbd[_0x1899('0x47')]=_0x3d6bbd['attributes'][_0x1899('0x68')]?_0x3d6bbd[_0x1899('0x47')]:_0x2c479b[_0x1899('0x43')];_0x3d6bbd[_0x1899('0x4a')]=qs['sort'](_0x3b20a9[_0x1899('0x44')][_0x1899('0x4b')]);_0x3d6bbd[_0x1899('0x4c')]=qs[_0x1899('0x45')](_['pick'](_0x3b20a9['query'],_0x2c479b[_0x1899('0x45')]));if(_0x3b20a9['query'][_0x1899('0x50')]){_0x3d6bbd[_0x1899('0x4c')]=_[_0x1899('0x4d')](_0x3d6bbd[_0x1899('0x4c')],{'$or':_['map'](_0x3d6bbd[_0x1899('0x47')],function(_0x59b8eb){var _0x3738ed={};_0x3738ed[_0x59b8eb]={'$like':'%'+_0x3b20a9['query'][_0x1899('0x50')]+'%'};return _0x3738ed;})});}_0x3d6bbd=_[_0x1899('0x4d')]({},_0x3d6bbd,_0x3b20a9[_0x1899('0x6b')]);return _0x4e6307[_0x1899('0xbe')](_0x3d6bbd);}})['then'](function(_0x18d5ca){if(_0x18d5ca){_0x22737d=_0x18d5ca['length'];if(!_0x3b20a9['query'][_0x1899('0x69')]('nolimit')){_0x3d6bbd[_0x1899('0x2f')]=qs[_0x1899('0x2f')](_0x3b20a9[_0x1899('0x44')][_0x1899('0x2f')]);_0x3d6bbd[_0x1899('0x31')]=qs[_0x1899('0x31')](_0x3b20a9['query'][_0x1899('0x31')]);}return _0x4e6307[_0x1899('0xbe')](_0x3d6bbd);}})['then'](function(_0x224040){if(_0x224040){return _0x224040?{'count':_0x22737d,'rows':_0x224040}:null;}})[_0x1899('0x20')](respondWithResult(_0x44010e,null))['catch'](handleError(_0x44010e,null));};exports[_0x1899('0x3e')]=function(_0x3fa6e1,_0x5857d6,_0x54ab46){var _0x6826f1,_0x43a2f5,_0x1a7f33;if(_['isNil'](_0x3fa6e1[_0x1899('0x5c')]['body'])||_0x3fa6e1[_0x1899('0x5c')][_0x1899('0x5c')]===''){throw new db[(_0x1899('0x73'))]['ValidationError'](_0x1899('0x7b'));}if(_[_0x1899('0x7a')](_0x3fa6e1[_0x1899('0x5c')]['to'])){}_0x6826f1=_0x3fa6e1[_0x1899('0x5c')]['to'];return db[_0x1899('0x51')][_0x1899('0xaa')]({'where':{'id':_0x3fa6e1[_0x1899('0x57')]['id']}})['then'](handleEntityNotFound(_0x5857d6,null))[_0x1899('0x20')](function(_0x14d0fb){if(_0x14d0fb){return db[_0x1899('0x51')][_0x1899('0x62')]({'where':{'id':_0x14d0fb['id']},'include':[{'model':db[_0x1899('0xbf')],'as':'List','include':[{'model':db['CmContact'],'as':_0x1899('0x81'),'where':{[_0x14d0fb['mapKey']]:_0x6826f1},'limit':0x1,'order':[[_0x1899('0x77'),_0x1899('0x82')]]}]}]})[_0x1899('0x20')](handleEntityNotFound(_0x5857d6,null))['then'](function(_0x15b0d9){if(_0x15b0d9&&_0x15b0d9[_0x1899('0x80')]){_0x43a2f5=_0x15b0d9[_0x1899('0x39')]({'plain':!![]});if(_0x43a2f5[_0x1899('0x80')]&&_0x43a2f5['List'][_0x1899('0x81')][_0x1899('0x68')]){return _0x43a2f5[_0x1899('0x80')]['Contacts'][0x0];}return db[_0x1899('0x72')][_0x1899('0x5b')](_['defaults'](_0x3fa6e1[_0x1899('0x5c')],{'firstName':_0x6826f1,[_0x15b0d9[_0x1899('0x7c')]]:_0x6826f1,'phone':_0x6826f1,'ListId':_0x43a2f5[_0x1899('0x8a')]}));}})[_0x1899('0x20')](handleEntityNotFound(_0x5857d6,null))[_0x1899('0x20')](function(_0xfe533){if(_0xfe533){_0x1a7f33=_0xfe533;return db['OpenchannelInteraction'][_0x1899('0x62')]({'where':{'ContactId':_0x1a7f33['id'],'closed':![],'OpenchannelAccountId':_0x43a2f5['id']}})[_0x1899('0x20')](function(_0x26c66e){if(_0x26c66e){return[_0x26c66e,![]];}return db[_0x1899('0x8e')][_0x1899('0x5b')]({'UserId':_0x3fa6e1['user']['id'],'ContactId':_0x1a7f33['id'],'OpenchannelAccountId':_0x43a2f5['id'],'lastMsgDirection':_0x1899('0xc0'),'firstMsgDirection':_0x1899('0xc0'),'Messages':[_[_0x1899('0x4d')](_0x3fa6e1[_0x1899('0x5c')],{'read':![],'body':_0x3fa6e1['body'][_0x1899('0x5c')],'OpenchannelAccountId':_0x43a2f5['id'],'UserId':_0x3fa6e1[_0x1899('0x5d')]['id'],'ContactId':_0x1a7f33['id']})]},{'include':[{'model':db[_0x1899('0x99')],'as':_0x1899('0xc1')}]})[_0x1899('0x20')](function(_0x31c99c){return[_0x31c99c,!![]];});});}})['spread'](function(_0x4d9247,_0x34faf2){if(_0x34faf2){return _0x4d9247;}return db[_0x1899('0x99')][_0x1899('0x5b')](_[_0x1899('0x4d')](_0x3fa6e1[_0x1899('0x5c')],{'read':![],'body':_0x3fa6e1[_0x1899('0x5c')]['body'],'OpenchannelAccountId':_0x43a2f5['id'],'OpenchannelInteractionId':_0x4d9247['id'],'UserId':_0x3fa6e1[_0x1899('0x5d')]['id'],'ContactId':_0x1a7f33['id']}))[_0x1899('0x20')](function(_0x32e735){_0x4d9247[_0x1899('0xc2')][_0x1899('0xc1')]=[];_0x4d9247[_0x1899('0xc2')][_0x1899('0xc1')][_0x1899('0x95')](_0x32e735['dataValues']);return _0x4d9247;});});}})['then'](respondWithResult(_0x5857d6,null))['catch'](handleError(_0x5857d6,null));}; \ No newline at end of file +var _0x6462=['params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','body','describe','getDispositions','findOne','Disposition','filter','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','ids','notify','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','Applications','List','applications','list','priority','asc','account','Contacts','defaults','from','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','contact','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','transaction','sequelize','Transaction','ISOLATION_LEVELS','OpenchannelApplication','bulkCreate','finally','getApplications','Contact','Owner','fullname','Tag','Tags','color','tag','addAgents','emit','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','show'];(function(_0x29bef7,_0x5127f0){var _0x1ba0c1=function(_0x90b156){while(--_0x90b156){_0x29bef7['push'](_0x29bef7['shift']());}};_0x1ba0c1(++_0x5127f0);}(_0x6462,0x11f));var _0x2646=function(_0x55b3c9,_0x109d9f){_0x55b3c9=_0x55b3c9-0x0;var _0x41886b=_0x6462[_0x55b3c9];return _0x41886b;};'use strict';var emlformat=require(_0x2646('0x0'));var rimraf=require(_0x2646('0x1'));var zipdir=require(_0x2646('0x2'));var jsonpatch=require(_0x2646('0x3'));var rp=require('request-promise');var moment=require(_0x2646('0x4'));var BPromise=require(_0x2646('0x5'));var Mustache=require(_0x2646('0x6'));var util=require(_0x2646('0x7'));var path=require(_0x2646('0x8'));var sox=require(_0x2646('0x9'));var csv=require(_0x2646('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2646('0xb'));var squel=require(_0x2646('0xc'));var crypto=require(_0x2646('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2646('0xe'));var toCsv=require(_0x2646('0xa'));var querystring=require(_0x2646('0xf'));var Papa=require(_0x2646('0x10'));var Redis=require(_0x2646('0x11'));var authService=require(_0x2646('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2646('0x13'));var hardwareService=require(_0x2646('0x14'));var logger=require('../../config/logger')(_0x2646('0x15'));var utils=require('../../config/utils');var config=require(_0x2646('0x16'));var licenseUtil=require(_0x2646('0x17'));var db=require(_0x2646('0x18'))['db'];config[_0x2646('0x19')]=_['defaults'](config[_0x2646('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2646('0x19')]));require('./openchannelAccount.socket')[_0x2646('0x1a')](socket);var jayson=require(_0x2646('0x1b'));var client=jayson[_0x2646('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0x2646('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x19a4a1,_0x52914d,_0x58cd87,_0x477528){return new BPromise(function(_0x29d0e6,_0x22819e){var _0x7d2ddb=_0x477528||client;return _0x7d2ddb[_0x2646('0x1e')](_0x19a4a1,_0x58cd87)[_0x2646('0x1f')](function(_0x45d577){logger[_0x2646('0x20')](_0x2646('0x21'),_0x52914d,_0x2646('0x22'));logger[_0x2646('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x52914d,'request\x20sent',JSON['stringify'](_0x45d577));if(_0x45d577[_0x2646('0x24')]){if(_0x45d577[_0x2646('0x24')][_0x2646('0x25')]===0x1f4){logger[_0x2646('0x24')](_0x2646('0x21'),_0x52914d,_0x45d577['error'][_0x2646('0x26')]);return _0x22819e(_0x45d577[_0x2646('0x24')][_0x2646('0x26')]);}logger[_0x2646('0x24')](_0x2646('0x21'),_0x52914d,_0x45d577[_0x2646('0x24')][_0x2646('0x26')]);return _0x29d0e6(_0x45d577[_0x2646('0x24')][_0x2646('0x26')]);}else{logger[_0x2646('0x20')](_0x2646('0x21'),_0x52914d,_0x2646('0x22'));_0x29d0e6(_0x45d577[_0x2646('0x27')]['message']);}})[_0x2646('0x28')](function(_0x3d0ee3){logger['error'](_0x2646('0x21'),_0x52914d,_0x3d0ee3);_0x22819e(_0x3d0ee3);});});}function respondWithStatusCode(_0x585380,_0x4566d5){_0x4566d5=_0x4566d5||0xcc;return function(_0x46e2a2){if(_0x46e2a2){return _0x585380[_0x2646('0x29')](_0x4566d5);}return _0x585380[_0x2646('0x2a')](_0x4566d5)['end']();};}function respondWithResult(_0x3a2f6d,_0x43bd0a){_0x43bd0a=_0x43bd0a||0xc8;return function(_0x203407){if(_0x203407){return _0x3a2f6d[_0x2646('0x2a')](_0x43bd0a)[_0x2646('0x2b')](_0x203407);}};}function respondWithFilteredResult(_0x3e12b9,_0x5b3a9b){return function(_0x43bb08){if(_0x43bb08){var _0x460f34=typeof _0x5b3a9b[_0x2646('0x2c')]===_0x2646('0x2d')&&typeof _0x5b3a9b[_0x2646('0x2e')]===_0x2646('0x2d');var _0x2b23c9=_0x43bb08[_0x2646('0x2f')];var _0x29ef79=_0x460f34?0x0:_0x5b3a9b[_0x2646('0x2c')];var _0x2f3be3=_0x460f34?_0x43bb08[_0x2646('0x2f')]:_0x5b3a9b[_0x2646('0x2c')]+_0x5b3a9b['limit'];var _0x3579dc;if(_0x2f3be3>=_0x2b23c9){_0x2f3be3=_0x2b23c9;_0x3579dc=0xc8;}else{_0x3579dc=0xce;}_0x3e12b9[_0x2646('0x2a')](_0x3579dc);return _0x3e12b9[_0x2646('0x30')](_0x2646('0x31'),_0x29ef79+'-'+_0x2f3be3+'/'+_0x2b23c9)[_0x2646('0x2b')](_0x43bb08);}return null;};}function patchUpdates(_0x4d4c03){return function(_0x365fe0){try{jsonpatch['apply'](_0x365fe0,_0x4d4c03,!![]);}catch(_0x30ac55){return BPromise[_0x2646('0x32')](_0x30ac55);}return _0x365fe0[_0x2646('0x33')]();};}function saveUpdates(_0x22ba31,_0x19284d){return function(_0x492596){if(_0x492596){return _0x492596['update'](_0x22ba31)['then'](function(_0x224373){return _0x224373;});}return null;};}function removeEntity(_0xb2e8dc,_0x168e2c){return function(_0x23c503){if(_0x23c503){return _0x23c503['destroy']()[_0x2646('0x1f')](function(){var _0x3978fe=_0x23c503[_0x2646('0x34')]({'plain':!![]});var _0x56cdc7=_0x2646('0x35');return db[_0x2646('0x36')][_0x2646('0x37')]({'where':{'type':_0x56cdc7,'resourceId':_0x3978fe['id']}})[_0x2646('0x1f')](function(){return _0x23c503;});})['then'](function(){_0xb2e8dc[_0x2646('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x285440,_0x5a61e4){return function(_0xabbc72){if(!_0xabbc72){_0x285440['sendStatus'](0x194);}return _0xabbc72;};}function handleError(_0x7de16,_0x44b717){_0x44b717=_0x44b717||0x1f4;return function(_0x165685){logger['error'](_0x165685[_0x2646('0x38')]);if(_0x165685['name']){delete _0x165685[_0x2646('0x39')];}_0x7de16[_0x2646('0x2a')](_0x44b717)[_0x2646('0x3a')](_0x165685);};}exports[_0x2646('0x3b')]=function(_0x5dca9a,_0x4600a6){var _0x218a5b={'include':[{'model':db[_0x2646('0x3c')],'as':_0x2646('0x3d')}]},_0x48a48e={},_0x232c4f={'count':0x0,'rows':[]};var _0x172781=_[_0x2646('0x3e')](db['OpenchannelAccount']['rawAttributes'],function(_0x50730f){return{'name':_0x50730f[_0x2646('0x3f')],'type':_0x50730f[_0x2646('0x40')][_0x2646('0x41')]};});_0x48a48e[_0x2646('0x42')]=_[_0x2646('0x3e')](_0x172781,_0x2646('0x39'));_0x48a48e[_0x2646('0x43')]=_[_0x2646('0x44')](_0x5dca9a[_0x2646('0x43')]);_0x48a48e[_0x2646('0x45')]=_[_0x2646('0x46')](_0x48a48e[_0x2646('0x42')],_0x48a48e['query']);_0x218a5b['attributes']=_[_0x2646('0x46')](_0x48a48e['model'],qs[_0x2646('0x47')](_0x5dca9a[_0x2646('0x43')][_0x2646('0x47')]));_0x218a5b['attributes']=_0x218a5b[_0x2646('0x48')][_0x2646('0x49')]?_0x218a5b[_0x2646('0x48')]:_0x48a48e[_0x2646('0x42')];if(!_0x5dca9a[_0x2646('0x43')][_0x2646('0x4a')](_0x2646('0x4b'))){_0x218a5b['limit']=qs['limit'](_0x5dca9a[_0x2646('0x43')][_0x2646('0x2e')]);_0x218a5b[_0x2646('0x2c')]=qs['offset'](_0x5dca9a[_0x2646('0x43')]['offset']);}_0x218a5b[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x5dca9a[_0x2646('0x43')]['sort']);_0x218a5b[_0x2646('0x4e')]=qs['filters'](_[_0x2646('0x4f')](_0x5dca9a[_0x2646('0x43')],_0x48a48e['filters']),_0x172781);if(_0x5dca9a[_0x2646('0x43')]['filter']){_0x218a5b[_0x2646('0x4e')]=_['merge'](_0x218a5b[_0x2646('0x4e')],{'$or':_[_0x2646('0x3e')](_0x172781,function(_0x35499b){if(_0x35499b[_0x2646('0x40')]!==_0x2646('0x50')){var _0x2c066e={};_0x2c066e[_0x35499b['name']]={'$like':'%'+_0x5dca9a[_0x2646('0x43')]['filter']+'%'};return _0x2c066e;}})});}_0x218a5b=_[_0x2646('0x51')]({},_0x218a5b,_0x5dca9a[_0x2646('0x52')]);var _0x462b73={'where':_0x218a5b[_0x2646('0x4e')]};return db[_0x2646('0x53')][_0x2646('0x2f')](_0x462b73)[_0x2646('0x1f')](function(_0x292afa){_0x232c4f[_0x2646('0x2f')]=_0x292afa;if(_0x5dca9a[_0x2646('0x43')][_0x2646('0x54')]){_0x218a5b[_0x2646('0x55')]=[{'all':!![]}];}return db[_0x2646('0x53')][_0x2646('0x56')](_0x218a5b);})[_0x2646('0x1f')](function(_0x1c3987){_0x232c4f[_0x2646('0x57')]=_0x1c3987;return _0x232c4f;})[_0x2646('0x1f')](respondWithFilteredResult(_0x4600a6,_0x218a5b))['catch'](handleError(_0x4600a6,null));};exports[_0x2646('0x58')]=function(_0x352beb,_0x5d6e63){var _0x58924a={'raw':![],'where':{'id':_0x352beb[_0x2646('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1e6aa9={};_0x1e6aa9[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0x53')][_0x2646('0x5a')]);_0x1e6aa9[_0x2646('0x43')]=_[_0x2646('0x44')](_0x352beb[_0x2646('0x43')]);_0x1e6aa9['filters']=_[_0x2646('0x46')](_0x1e6aa9[_0x2646('0x42')],_0x1e6aa9[_0x2646('0x43')]);_0x58924a[_0x2646('0x48')]=_[_0x2646('0x46')](_0x1e6aa9['model'],qs[_0x2646('0x47')](_0x352beb[_0x2646('0x43')][_0x2646('0x47')]));_0x58924a[_0x2646('0x48')]=_0x58924a['attributes'][_0x2646('0x49')]?_0x58924a[_0x2646('0x48')]:_0x1e6aa9[_0x2646('0x42')];if(_0x352beb[_0x2646('0x43')][_0x2646('0x54')]){_0x58924a[_0x2646('0x55')]=[{'all':!![]}];}_0x58924a=_[_0x2646('0x51')]({},_0x58924a,_0x352beb['options']);return db[_0x2646('0x53')][_0x2646('0x5b')](_0x58924a)[_0x2646('0x1f')](handleEntityNotFound(_0x5d6e63,null))[_0x2646('0x1f')](respondWithResult(_0x5d6e63,null))[_0x2646('0x28')](handleError(_0x5d6e63,null));};exports[_0x2646('0x5c')]=function(_0x479cdf,_0x3135c3){return db['OpenchannelAccount'][_0x2646('0x5c')](_0x479cdf['body'],{})[_0x2646('0x1f')](function(_0x16df63){var _0x46081a=_0x479cdf['user']['get']({'plain':!![]});if(!_0x46081a)throw new Error(_0x2646('0x5d'));if(_0x46081a[_0x2646('0x5e')]===_0x2646('0x5f')){var _0xfeb1c=_0x16df63[_0x2646('0x34')]({'plain':!![]});var _0x3d6b25=_0x2646('0x35');return db[_0x2646('0x60')][_0x2646('0x5b')]({'where':{'name':_0x3d6b25,'userProfileId':_0x46081a[_0x2646('0x61')]},'raw':!![]})[_0x2646('0x1f')](function(_0x59de60){if(_0x59de60&&_0x59de60['autoAssociation']===0x0){return db['UserProfileResource'][_0x2646('0x5c')]({'name':_0xfeb1c[_0x2646('0x39')],'resourceId':_0xfeb1c['id'],'type':_0x59de60[_0x2646('0x39')],'sectionId':_0x59de60['id']},{})['then'](function(){return _0x16df63;});}else{return _0x16df63;}})[_0x2646('0x28')](function(_0xa95b63){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa95b63);throw _0xa95b63;});}return _0x16df63;})[_0x2646('0x1f')](respondWithResult(_0x3135c3,0xc9))['catch'](handleError(_0x3135c3,null));};exports[_0x2646('0x62')]=function(_0x584c8f,_0x502436){if(_0x584c8f[_0x2646('0x63')]['id']){delete _0x584c8f[_0x2646('0x63')]['id'];}return db[_0x2646('0x53')]['find']({'where':{'id':_0x584c8f[_0x2646('0x59')]['id']},'include':[{'model':db[_0x2646('0x3c')],'as':_0x2646('0x3d')}]})['then'](handleEntityNotFound(_0x502436,null))[_0x2646('0x1f')](saveUpdates(_0x584c8f[_0x2646('0x63')],null))[_0x2646('0x1f')](respondWithResult(_0x502436,null))['catch'](handleError(_0x502436,null));};exports[_0x2646('0x37')]=function(_0xfe02b0,_0x4db5d8){return db['OpenchannelAccount']['find']({'where':{'id':_0xfe02b0[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x4db5d8,null))['then'](removeEntity(_0x4db5d8,null))[_0x2646('0x28')](handleError(_0x4db5d8,null));};exports[_0x2646('0x64')]=function(_0x21daa8,_0x5d917c){return db[_0x2646('0x53')][_0x2646('0x64')]()[_0x2646('0x1f')](respondWithResult(_0x5d917c,null))[_0x2646('0x28')](handleError(_0x5d917c,null));};exports['addDisposition']=function(_0xf4ab5,_0x433b79,_0x1a767c){if(_0xf4ab5['body']['id']){delete _0xf4ab5[_0x2646('0x63')]['id'];}return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0xf4ab5[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x433b79,null))['then'](function(_0x569c46){if(_0x569c46){_0xf4ab5[_0x2646('0x63')]['OpenchannelAccountId']=_0x569c46['id'];return db['Disposition'][_0x2646('0x5c')](_0xf4ab5[_0x2646('0x63')]);}})[_0x2646('0x1f')](respondWithResult(_0x433b79,null))['catch'](handleError(_0x433b79,null));};exports[_0x2646('0x65')]=function(_0x5758c1,_0x2661da,_0x99c33d){var _0x5313fc={'raw':![],'where':{}};var _0x9579b5={};var _0x58ab6e={'count':0x0,'rows':[]};return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x5758c1[_0x2646('0x59')]['id']}})['then'](handleEntityNotFound(_0x2661da,null))['then'](function(_0x1405eb){if(_0x1405eb){_0x9579b5['model']=_['keys'](db[_0x2646('0x67')][_0x2646('0x5a')]);_0x9579b5[_0x2646('0x43')]=_[_0x2646('0x44')](_0x5758c1['query']);_0x9579b5['filters']=_['intersection'](_0x9579b5[_0x2646('0x42')],_0x9579b5[_0x2646('0x43')]);_0x5313fc[_0x2646('0x48')]=_[_0x2646('0x46')](_0x9579b5[_0x2646('0x42')],qs[_0x2646('0x47')](_0x5758c1[_0x2646('0x43')]['fields']));_0x5313fc[_0x2646('0x48')]=_0x5313fc[_0x2646('0x48')][_0x2646('0x49')]?_0x5313fc[_0x2646('0x48')]:_0x9579b5[_0x2646('0x42')];if(!_0x5758c1[_0x2646('0x43')][_0x2646('0x4a')](_0x2646('0x4b'))){_0x5313fc[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x5758c1['query']['limit']);_0x5313fc[_0x2646('0x2c')]=qs[_0x2646('0x2c')](_0x5758c1[_0x2646('0x43')][_0x2646('0x2c')]);}_0x5313fc[_0x2646('0x4c')]=qs['sort'](_0x5758c1['query'][_0x2646('0x4d')]);_0x5313fc[_0x2646('0x4e')]=qs[_0x2646('0x45')](_[_0x2646('0x4f')](_0x5758c1['query'],_0x9579b5['filters']));_0x5313fc[_0x2646('0x4e')]['OpenchannelAccountId']=_0x1405eb['id'];if(_0x5758c1[_0x2646('0x43')][_0x2646('0x68')]){_0x5313fc['where']=_['merge'](_0x5313fc[_0x2646('0x4e')],{'$or':_[_0x2646('0x3e')](_0x5313fc['attributes'],function(_0x308677){var _0xd13fec={};_0xd13fec[_0x308677]={'$like':'%'+_0x5758c1['query'][_0x2646('0x68')]+'%'};return _0xd13fec;})});}_0x5313fc=_['merge']({},_0x5313fc,_0x5758c1[_0x2646('0x52')]);return db[_0x2646('0x67')][_0x2646('0x2f')]({'where':_0x5313fc[_0x2646('0x4e')]})[_0x2646('0x1f')](function(_0x59c362){_0x58ab6e[_0x2646('0x2f')]=_0x59c362;if(_0x5758c1[_0x2646('0x43')][_0x2646('0x54')]){_0x5313fc[_0x2646('0x55')]=[{'all':!![]}];}return db[_0x2646('0x67')][_0x2646('0x56')](_0x5313fc);})['then'](function(_0x19fc52){_0x58ab6e[_0x2646('0x57')]=_0x19fc52;return _0x58ab6e;});}})[_0x2646('0x1f')](respondWithFilteredResult(_0x2661da,_0x5313fc))[_0x2646('0x28')](handleError(_0x2661da,null));};exports[_0x2646('0x69')]=function(_0x4178f7,_0x26e340,_0x5ad62c){return db[_0x2646('0x53')]['find']({'where':{'id':_0x4178f7[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x26e340,null))[_0x2646('0x1f')](function(_0x3ab543){if(_0x3ab543){return _0x3ab543[_0x2646('0x69')](_0x4178f7['query']['ids']);}})[_0x2646('0x1f')](respondWithStatusCode(_0x26e340,null))[_0x2646('0x28')](handleError(_0x26e340,null));};exports[_0x2646('0x6a')]=function(_0x4fa75f,_0x21b140,_0x225e54){if(_0x4fa75f[_0x2646('0x63')]['id']){delete _0x4fa75f[_0x2646('0x63')]['id'];}return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x4fa75f['params']['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x21b140,null))[_0x2646('0x1f')](function(_0x597e0c){if(_0x597e0c){_0x4fa75f['body'][_0x2646('0x6b')]=_0x597e0c['id'];return db[_0x2646('0x6c')][_0x2646('0x5c')](_0x4fa75f['body']);}})[_0x2646('0x1f')](respondWithResult(_0x21b140,null))[_0x2646('0x28')](handleError(_0x21b140,null));};exports[_0x2646('0x6d')]=function(_0x371844,_0x337aa9,_0x433f32){var _0xc88084={'raw':![],'where':{}};var _0x2eee38={};var _0x28f9a9={'count':0x0,'rows':[]};return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x371844[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x337aa9,null))['then'](function(_0x43cca7){if(_0x43cca7){_0x2eee38[_0x2646('0x42')]=_['keys'](db[_0x2646('0x6c')][_0x2646('0x5a')]);_0x2eee38[_0x2646('0x43')]=_[_0x2646('0x44')](_0x371844[_0x2646('0x43')]);_0x2eee38[_0x2646('0x45')]=_['intersection'](_0x2eee38[_0x2646('0x42')],_0x2eee38['query']);_0xc88084['attributes']=_['intersection'](_0x2eee38[_0x2646('0x42')],qs[_0x2646('0x47')](_0x371844['query'][_0x2646('0x47')]));_0xc88084[_0x2646('0x48')]=_0xc88084['attributes'][_0x2646('0x49')]?_0xc88084['attributes']:_0x2eee38[_0x2646('0x42')];if(!_0x371844[_0x2646('0x43')][_0x2646('0x4a')]('nolimit')){_0xc88084['limit']=qs[_0x2646('0x2e')](_0x371844[_0x2646('0x43')]['limit']);_0xc88084['offset']=qs[_0x2646('0x2c')](_0x371844[_0x2646('0x43')][_0x2646('0x2c')]);}_0xc88084[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x371844[_0x2646('0x43')][_0x2646('0x4d')]);_0xc88084[_0x2646('0x4e')]=qs['filters'](_['pick'](_0x371844['query'],_0x2eee38['filters']));_0xc88084[_0x2646('0x4e')][_0x2646('0x6b')]=_0x43cca7['id'];if(_0x371844[_0x2646('0x43')][_0x2646('0x68')]){_0xc88084[_0x2646('0x4e')]=_[_0x2646('0x51')](_0xc88084[_0x2646('0x4e')],{'$or':_['map'](_0xc88084[_0x2646('0x48')],function(_0x436158){var _0x1a8d4e={};_0x1a8d4e[_0x436158]={'$like':'%'+_0x371844[_0x2646('0x43')][_0x2646('0x68')]+'%'};return _0x1a8d4e;})});}_0xc88084=_[_0x2646('0x51')]({},_0xc88084,_0x371844[_0x2646('0x52')]);return db['CannedAnswer'][_0x2646('0x2f')]({'where':_0xc88084[_0x2646('0x4e')]})[_0x2646('0x1f')](function(_0x3aba33){_0x28f9a9[_0x2646('0x2f')]=_0x3aba33;if(_0x371844[_0x2646('0x43')][_0x2646('0x54')]){_0xc88084[_0x2646('0x55')]=[{'all':!![]}];}return db[_0x2646('0x6c')]['findAll'](_0xc88084);})[_0x2646('0x1f')](function(_0x2db151){_0x28f9a9[_0x2646('0x57')]=_0x2db151;return _0x28f9a9;});}})['then'](respondWithFilteredResult(_0x337aa9,_0xc88084))[_0x2646('0x28')](handleError(_0x337aa9,null));};exports[_0x2646('0x6e')]=function(_0x3b093d,_0x4707e4,_0x33018d){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x3b093d[_0x2646('0x59')]['id']}})['then'](handleEntityNotFound(_0x4707e4,null))['then'](function(_0x309556){if(_0x309556){return _0x309556[_0x2646('0x6e')](_0x3b093d[_0x2646('0x43')][_0x2646('0x6f')]);}})[_0x2646('0x1f')](respondWithStatusCode(_0x4707e4,null))[_0x2646('0x28')](handleError(_0x4707e4,null));};exports[_0x2646('0x70')]=function(_0x5ea5c7,_0x4c1ee0,_0x2fe60e){var _0x2f7ce6={'body':_0x5ea5c7[_0x2646('0x63')],'channel':'openchannel'};var _0x17fab8=[];var _0x46ac3e=[];var _0xca0bbe={};var _0x11a7eb=![];return db['CmContact']['describe']()['then'](function(_0x56cd34){if(!_0x56cd34){throw new db[(_0x2646('0x71'))]['ValidationError'](_0x2646('0x72'));}_0x17fab8=_[_0x2646('0x73')](_[_0x2646('0x44')](_0x56cd34),[_0x2646('0x74'),_0x2646('0x75')]);_0x46ac3e=_[_0x2646('0x73')](_[_0x2646('0x44')](_0x56cd34),[_0x2646('0x74'),'updatedAt',_0x2646('0x76'),_0x2646('0x77')]);if(_0x5ea5c7[_0x2646('0x63')]['id']){delete _0x5ea5c7[_0x2646('0x63')]['id'];}if(_[_0x2646('0x78')](_0x5ea5c7['body']['from'])){throw new db[(_0x2646('0x71'))]['ValidationError'](_0x2646('0x79'));}if(_[_0x2646('0x78')](_0x5ea5c7[_0x2646('0x63')][_0x2646('0x63')])||_0x5ea5c7[_0x2646('0x63')][_0x2646('0x63')]===''){throw new db[(_0x2646('0x71'))][(_0x2646('0x7a'))](_0x2646('0x7b'));}if(_[_0x2646('0x78')](_0x5ea5c7[_0x2646('0x63')]['mapKey'])){throw new db[(_0x2646('0x71'))][(_0x2646('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46ac3e);}if(!_['includes'](_0x46ac3e,_0x5ea5c7[_0x2646('0x63')][_0x2646('0x7c')])){throw new db['Sequelize'][(_0x2646('0x7a'))](_0x2646('0x7d')+_0x46ac3e);}_0xca0bbe[_0x5ea5c7[_0x2646('0x63')][_0x2646('0x7c')]]=_0x5ea5c7[_0x2646('0x63')]['from'];})['then'](function(){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x5ea5c7['params']['id']},'include':[{'model':db[_0x2646('0x7e')],'as':'List','include':[{'model':db[_0x2646('0x7f')],'as':'Contacts','where':_0xca0bbe,'limit':0x1,'order':[['updatedAt',_0x2646('0x80')]]}]},{'model':db['OpenchannelApplication'],'as':_0x2646('0x81')}]});})[_0x2646('0x1f')](handleEntityNotFound(_0x4c1ee0,null))[_0x2646('0x1f')](function(_0x157401){if(_0x157401&&_0x157401[_0x2646('0x82')]){_0x2f7ce6['account']=_0x157401;_0x2f7ce6[_0x2646('0x83')]=_0x157401[_0x2646('0x81')];_0x2f7ce6[_0x2646('0x84')]=_0x157401[_0x2646('0x82')];_0x2f7ce6['applications']=_['orderBy'](_0x2f7ce6[_0x2646('0x83')],[_0x2646('0x85')],[_0x2646('0x86')]);if(_0x2f7ce6[_0x2646('0x87')][_0x2646('0x81')]){delete _0x2f7ce6[_0x2646('0x87')][_0x2646('0x81')];}if(_0x2f7ce6[_0x2646('0x87')]['List']&&_0x2f7ce6[_0x2646('0x87')][_0x2646('0x82')][_0x2646('0x88')][_0x2646('0x49')]){return _0x2f7ce6['account'][_0x2646('0x82')][_0x2646('0x88')][0x0];}var _0x13a669=_[_0x2646('0x89')](_0x5ea5c7[_0x2646('0x63')],{'firstName':_0x5ea5c7['body'][_0x2646('0x8a')],'ListId':_0x157401[_0x2646('0x77')]});_0x13a669[_0x5ea5c7['body'][_0x2646('0x7c')]]=_0x5ea5c7[_0x2646('0x63')]['from'];return db['CmContact'][_0x2646('0x5c')](_0x13a669,{'fields':_0x17fab8,'raw':!![]});}})[_0x2646('0x1f')](handleEntityNotFound(_0x4c1ee0,null))[_0x2646('0x1f')](function(_0xbb5b05){_0x2f7ce6['contact']=_0xbb5b05;if(_0xbb5b05){var _0x3d9965={'ContactId':_0xbb5b05['id'],'OpenchannelAccountId':_0x5ea5c7[_0x2646('0x59')]['id'],'from':(_0xbb5b05['firstName']||'')+'\x20'+(_0xbb5b05['lastName']||'')};var _0x57c0c9={'OpenchannelAccountId':_0x5ea5c7[_0x2646('0x59')]['id'],'closed':![]};if(_0x5ea5c7['body']['threadId']){_0x57c0c9[_0x2646('0x8b')]=_0x5ea5c7['body'][_0x2646('0x8b')];return db[_0x2646('0x8c')]['find']({'where':_0x57c0c9})['then'](function(_0x2f2efe){if(_0x2f2efe){return[_0x2f2efe,![]];}_0x3d9965[_0x2646('0x8b')]=_0x5ea5c7[_0x2646('0x63')][_0x2646('0x8b')];_0x3d9965[_0x2646('0x8d')]=_0x5ea5c7['body'][_0x2646('0x8d')];return db[_0x2646('0x8c')][_0x2646('0x5c')](_0x3d9965)['then'](function(_0xde919b){return[_0xde919b,!![]];});});}else{_0x57c0c9['threadId']=null;}_0x57c0c9[_0x2646('0x8e')]=_0xbb5b05['id'];return db[_0x2646('0x8c')][_0x2646('0x5b')]({'where':_0x57c0c9})[_0x2646('0x1f')](function(_0x2878a7){if(_0x2878a7){return[_0x2878a7,![]];}return db[_0x2646('0x8c')][_0x2646('0x5c')](_0x3d9965)[_0x2646('0x1f')](function(_0x33a21c){return[_0x33a21c,!![]];});});}})[_0x2646('0x8f')](function(_0x20e7e8,_0x5e028b){if(_0x20e7e8){_0x11a7eb=_0x5e028b;if(!_0x5e028b){var _0x5bc921={'from':(_0x2f7ce6['contact'][_0x2646('0x90')]||'')+'\x20'+(_0x2f7ce6[_0x2646('0x91')][_0x2646('0x92')]||'')};if(_0x5ea5c7[_0x2646('0x63')][_0x2646('0x8b')]&&_0x5ea5c7[_0x2646('0x63')][_0x2646('0x93')]&&_0x5ea5c7[_0x2646('0x63')]['threadId']!=_0x5ea5c7[_0x2646('0x63')][_0x2646('0x93')]){_0x5bc921[_0x2646('0x8b')]=_0x5ea5c7[_0x2646('0x63')][_0x2646('0x93')];}return _0x20e7e8['update'](_0x5bc921);}else{return _0x20e7e8;}}})[_0x2646('0x1f')](function(_0x57c494){_0x2f7ce6['interaction']=_0x57c494[_0x2646('0x34')]({'plain':!![]});_0x2f7ce6[_0x2646('0x94')][_0x2646('0x95')]=_0x11a7eb;if(_0x2f7ce6[_0x2646('0x94')][_0x2646('0x95')]){if(_0x2f7ce6[_0x2646('0x87')][_0x2646('0x96')]){_0x2f7ce6[_0x2646('0x83')]['push']({'id':0x0,'priority':_0x2f7ce6[_0x2646('0x83')][_0x2646('0x49')]+0x1,'app':_0x2646('0x97'),'appdata':_0x2646('0x98'),'interval':_0x2646('0x99')});}}return db[_0x2646('0x9a')][_0x2646('0x5c')]({'body':_0x5ea5c7[_0x2646('0x63')][_0x2646('0x63')],'OpenchannelAccountId':_0x5ea5c7[_0x2646('0x59')]['id'],'OpenchannelInteractionId':_0x57c494['id'],'direction':'in','ContactId':_0x2f7ce6[_0x2646('0x91')]['id'],'AttachmentId':_0x5ea5c7[_0x2646('0x63')]['AttachmentId']});})[_0x2646('0x1f')](function(_0x3092cc){_0x2f7ce6['message']=_0x3092cc;if(!_0x2f7ce6[_0x2646('0x94')]['UserId'])return;return db[_0x2646('0x9b')]['find']({'attributes':['id','name'],'where':{'id':_0x2f7ce6[_0x2646('0x94')]['UserId']}});})['then'](function(_0x102722){if(_0x102722){_0x2f7ce6['applications'][_0x2646('0x9c')]({'id':0x0,'priority':0x0,'app':_0x2646('0x9d'),'appdata':_0x102722['name']+','+(_0x2f7ce6['account'][_0x2646('0x9e')]||0xa),'interval':'*,*,*,*'});}if(!_0x2f7ce6[_0x2646('0x94')][_0x2646('0x9f')])return;return db[_0x2646('0xa0')]['find']({'attributes':['id',_0x2646('0x39')],'where':{'id':_0x2f7ce6[_0x2646('0x94')][_0x2646('0x9f')]}});})['then'](function(_0x4114b6){if(_0x4114b6){_0x2f7ce6[_0x2646('0x83')][_0x2646('0x9c')]({'id':0x0,'priority':0x1,'app':_0x2646('0xa1'),'appdata':_0x4114b6[_0x2646('0x39')]+','+(_0x2f7ce6[_0x2646('0x87')][_0x2646('0xa2')]||0x12c),'interval':_0x2646('0x99')});}return respondWithRpcPromise(_0x2646('0xa3'),'startRouting',_0x2f7ce6);})['then'](function(_0x48aa95){respondWithRpcPromise('EventManager','EventManager',{'event':_0x2646('0x70'),'message':_0x48aa95},client9002);return _0x48aa95;})[_0x2646('0x1f')](respondWithResult(_0x4c1ee0,null))[_0x2646('0x28')](handleError(_0x4c1ee0,null));};exports['addApplications']=function(_0x5ca682,_0x407212){var _0x1c6951=_0x5ca682[_0x2646('0x59')]['id'];var _0x117c50=_0x5ca682[_0x2646('0x63')];var _0x556c07=0xc8;var _0xf7867=null;return db['sequelize'][_0x2646('0xa4')]({'isolationLevel':db[_0x2646('0xa5')][_0x2646('0xa6')][_0x2646('0xa7')]['READ_COMMITTED']},function(_0x5884eb){return db['OpenchannelAccount'][_0x2646('0x66')]({'where':{'id':_0x1c6951},'transaction':_0x5884eb})[_0x2646('0x1f')](function(_0x3c4808){if(_0x3c4808){return db['OpenchannelApplication'][_0x2646('0x37')]({'where':{'OpenchannelAccountId':_0x1c6951},'transaction':_0x5884eb})[_0x2646('0x1f')](function(){var _0x7248cf=_[_0x2646('0x3e')](_0x117c50,function(_0x439906){_0x439906['OpenchannelAccountId']=_0x1c6951;return _0x439906;});return db[_0x2646('0xa8')][_0x2646('0xa9')](_0x7248cf,{'transaction':_0x5884eb});});}else{_0x556c07=0x194;_0xf7867=[];}});})['then'](function(){if(_0x556c07!==0x194){return db[_0x2646('0xa8')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1c6951},'order':_0x2646('0x85')})[_0x2646('0x1f')](function(_0x10b491){_0xf7867=_0x10b491;});}})[_0x2646('0x28')](function(_0x532e34){_0x556c07=0x1f4;logger[_0x2646('0x24')](_0x532e34[_0x2646('0x38')]);if(_0x532e34[_0x2646('0x39')]){delete _0x532e34[_0x2646('0x39')];}_0xf7867=_0x532e34;})[_0x2646('0xaa')](function(){if(_0xf7867===null){_0x407212[_0x2646('0x29')](_0x556c07);}else{if(_0x556c07===0x1f4){_0x407212['status'](_0x556c07)['send'](_0xf7867);}else{_0x407212['status'](_0x556c07)[_0x2646('0x2b')](_0xf7867);}}});};exports[_0x2646('0xab')]=function(_0x5476e9,_0x533882,_0x3c9865){var _0x36558a={};var _0x3c0c33={};var _0x5846f0;var _0x49d632;return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x5476e9[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x533882,null))[_0x2646('0x1f')](function(_0xc1fed1){if(_0xc1fed1){_0x5846f0=_0xc1fed1;_0x3c0c33[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0xa8')][_0x2646('0x5a')]);_0x3c0c33[_0x2646('0x43')]=_['keys'](_0x5476e9[_0x2646('0x43')]);_0x3c0c33['filters']=_['intersection'](_0x3c0c33[_0x2646('0x42')],_0x3c0c33['query']);_0x36558a['attributes']=_['intersection'](_0x3c0c33[_0x2646('0x42')],qs[_0x2646('0x47')](_0x5476e9[_0x2646('0x43')][_0x2646('0x47')]));_0x36558a['attributes']=_0x36558a[_0x2646('0x48')][_0x2646('0x49')]?_0x36558a[_0x2646('0x48')]:_0x3c0c33[_0x2646('0x42')];_0x36558a[_0x2646('0x4c')]=qs['sort'](_0x5476e9[_0x2646('0x43')][_0x2646('0x4d')]);_0x36558a[_0x2646('0x4e')]=qs['filters'](_[_0x2646('0x4f')](_0x5476e9[_0x2646('0x43')],_0x3c0c33[_0x2646('0x45')]));if(_0x5476e9['query']['filter']){_0x36558a['where']=_['merge'](_0x36558a[_0x2646('0x4e')],{'$or':_['map'](_0x36558a[_0x2646('0x48')],function(_0x2c8a12){var _0x616982={};_0x616982[_0x2c8a12]={'$like':'%'+_0x5476e9['query']['filter']+'%'};return _0x616982;})});}_0x36558a=_[_0x2646('0x51')]({},_0x36558a,_0x5476e9[_0x2646('0x52')]);return _0x5846f0[_0x2646('0xab')](_0x36558a);}})[_0x2646('0x1f')](function(_0x18f4d0){if(_0x18f4d0){_0x49d632=_0x18f4d0[_0x2646('0x49')];if(!_0x5476e9['query'][_0x2646('0x4a')]('nolimit')){_0x36558a[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x5476e9[_0x2646('0x43')][_0x2646('0x2e')]);_0x36558a['offset']=qs[_0x2646('0x2c')](_0x5476e9[_0x2646('0x43')][_0x2646('0x2c')]);}return _0x5846f0['getApplications'](_0x36558a);}})['then'](function(_0x4602f1){if(_0x4602f1){return _0x4602f1?{'count':_0x49d632,'rows':_0x4602f1}:null;}})[_0x2646('0x1f')](respondWithResult(_0x533882,null))['catch'](handleError(_0x533882,null));};exports['getInteractions']=function(_0x246cde,_0x45f4a3,_0x3cd27c){var _0x100075={'raw':![],'where':{}};var _0x294618={};var _0x5a4f2e={'count':0x0,'rows':[]};return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x246cde[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x45f4a3,null))[_0x2646('0x1f')](function(_0x5160e5){if(_0x5160e5){_0x294618[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0x8c')][_0x2646('0x5a')]);_0x294618[_0x2646('0x43')]=_['keys'](_0x246cde[_0x2646('0x43')]);_0x294618[_0x2646('0x45')]=_[_0x2646('0x46')](_0x294618[_0x2646('0x42')],_0x294618[_0x2646('0x43')]);_0x100075[_0x2646('0x48')]=_[_0x2646('0x46')](_0x294618[_0x2646('0x42')],qs[_0x2646('0x47')](_0x246cde[_0x2646('0x43')]['fields']));_0x100075[_0x2646('0x48')]=_0x100075[_0x2646('0x48')][_0x2646('0x49')]?_0x100075[_0x2646('0x48')]:_0x294618[_0x2646('0x42')];if(!_0x246cde[_0x2646('0x43')]['hasOwnProperty'](_0x2646('0x4b'))){_0x100075[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x246cde[_0x2646('0x43')][_0x2646('0x2e')]);_0x100075[_0x2646('0x2c')]=qs[_0x2646('0x2c')](_0x246cde[_0x2646('0x43')][_0x2646('0x2c')]);}_0x100075[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x246cde['query'][_0x2646('0x4d')]);_0x100075['where']=qs[_0x2646('0x45')](_[_0x2646('0x4f')](_0x246cde[_0x2646('0x43')],_0x294618[_0x2646('0x45')]));_0x100075[_0x2646('0x4e')][_0x2646('0x6b')]=_0x5160e5['id'];if(_0x246cde[_0x2646('0x43')][_0x2646('0x68')]){_0x100075[_0x2646('0x4e')]=_[_0x2646('0x51')](_0x100075[_0x2646('0x4e')],{'$or':_['map'](_0x100075['attributes'],function(_0x492a4c){var _0x4eab86={};_0x4eab86[_0x492a4c]={'$like':'%'+_0x246cde[_0x2646('0x43')][_0x2646('0x68')]+'%'};return _0x4eab86;})});}_0x100075=_[_0x2646('0x51')]({},_0x100075,_0x246cde[_0x2646('0x52')]);return db[_0x2646('0x8c')][_0x2646('0x2f')]({'where':_0x100075[_0x2646('0x4e')]})[_0x2646('0x1f')](function(_0x411976){_0x5a4f2e['count']=_0x411976;if(_0x246cde[_0x2646('0x43')]['includeAll']){_0x100075[_0x2646('0x55')]=[{'model':db[_0x2646('0x7f')],'as':_0x2646('0xac'),'required':![]},{'model':db[_0x2646('0x9b')],'as':_0x2646('0xad'),'attributes':[_0x2646('0x39'),_0x2646('0xae'),'internal'],'required':![]},{'model':db[_0x2646('0xaf')],'as':_0x2646('0xb0'),'attributes':['id',_0x2646('0x39'),_0x2646('0xb1')],'where':_0x246cde[_0x2646('0x43')][_0x2646('0xb2')]?{'id':_0x246cde['query'][_0x2646('0xb2')]}:undefined,'required':_0x246cde[_0x2646('0x43')][_0x2646('0xb2')]?!![]:![]}];}return db[_0x2646('0x8c')][_0x2646('0x56')](_0x100075);})[_0x2646('0x1f')](function(_0x2ad4a2){_0x5a4f2e[_0x2646('0x57')]=_0x2ad4a2;return _0x5a4f2e;});}})[_0x2646('0x1f')](respondWithFilteredResult(_0x45f4a3,_0x100075))[_0x2646('0x28')](handleError(_0x45f4a3,null));};exports[_0x2646('0xb3')]=function(_0x1ec012,_0x437270,_0x4fb80a){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x1ec012[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x437270,null))[_0x2646('0x1f')](function(_0x228431){if(_0x228431){return _0x228431[_0x2646('0xb3')](_0x1ec012[_0x2646('0x63')][_0x2646('0x6f')],_['omit'](_0x1ec012[_0x2646('0x63')],[_0x2646('0x6f'),'id'])||{})[_0x2646('0x8f')](function(_0x4cfeee){for(var _0x183e89=0x0;_0x183e89<_0x1ec012[_0x2646('0x63')][_0x2646('0x6f')][_0x2646('0x49')];_0x183e89+=0x1){socket[_0x2646('0xb4')]('userOpenchannelAccount:save',{'UserId':Number(_0x1ec012['body'][_0x2646('0x6f')][_0x183e89]),'OpenchannelAccountId':Number(_0x1ec012[_0x2646('0x59')]['id'])});}return _0x4cfeee;});}})[_0x2646('0x1f')](respondWithResult(_0x437270,null))['catch'](handleError(_0x437270,null));};exports['removeAgents']=function(_0x275caf,_0x344b12,_0x5bda8c){return db[_0x2646('0x53')][_0x2646('0x5b')]({'where':{'id':_0x275caf[_0x2646('0x59')]['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x344b12,null))[_0x2646('0x1f')](function(_0x3e970b){if(_0x3e970b){return _0x3e970b['removeAgents'](_0x275caf[_0x2646('0x43')][_0x2646('0x6f')])[_0x2646('0x1f')](function(){if(_[_0x2646('0xb5')](_0x275caf[_0x2646('0x43')][_0x2646('0x6f')])){for(var _0x5dc74e=0x0;_0x5dc74e<_0x275caf['query'][_0x2646('0x6f')][_0x2646('0x49')];_0x5dc74e+=0x1){socket[_0x2646('0xb4')](_0x2646('0xb6'),{'UserId':Number(_0x275caf['query'][_0x2646('0x6f')][_0x5dc74e]),'OpenchannelAccountId':Number(_0x275caf[_0x2646('0x59')]['id'])});}}else{socket['emit'](_0x2646('0xb6'),{'UserId':Number(_0x275caf[_0x2646('0x43')][_0x2646('0x6f')]),'OpenchannelAccountId':Number(_0x275caf[_0x2646('0x59')]['id'])});}});}})[_0x2646('0x1f')](respondWithStatusCode(_0x344b12,null))['catch'](handleError(_0x344b12,null));};exports[_0x2646('0xb7')]=function(_0x186208,_0x5d0390,_0x58e07a){var _0x496ae0={};var _0x51637f={};var _0x488165;var _0x1e7d4d;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x186208[_0x2646('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d0390,null))['then'](function(_0x26825c){if(_0x26825c){_0x488165=_0x26825c;_0x51637f[_0x2646('0x42')]=_[_0x2646('0x44')](db[_0x2646('0x9b')][_0x2646('0x5a')]);_0x51637f[_0x2646('0x43')]=_['keys'](_0x186208[_0x2646('0x43')]);_0x51637f[_0x2646('0x45')]=_[_0x2646('0x46')](_0x51637f[_0x2646('0x42')],_0x51637f[_0x2646('0x43')]);_0x496ae0[_0x2646('0x48')]=_[_0x2646('0x46')](_0x51637f[_0x2646('0x42')],qs[_0x2646('0x47')](_0x186208[_0x2646('0x43')]['fields']));_0x496ae0[_0x2646('0x48')]=_0x496ae0[_0x2646('0x48')][_0x2646('0x49')]?_0x496ae0[_0x2646('0x48')]:_0x51637f[_0x2646('0x42')];_0x496ae0[_0x2646('0x4c')]=qs[_0x2646('0x4d')](_0x186208[_0x2646('0x43')]['sort']);_0x496ae0[_0x2646('0x4e')]=qs[_0x2646('0x45')](_[_0x2646('0x4f')](_0x186208[_0x2646('0x43')],_0x51637f[_0x2646('0x45')]));if(_0x186208[_0x2646('0x43')][_0x2646('0x68')]){_0x496ae0[_0x2646('0x4e')]=_['merge'](_0x496ae0[_0x2646('0x4e')],{'$or':_[_0x2646('0x3e')](_0x496ae0[_0x2646('0x48')],function(_0x578b64){var _0xfb39e1={};_0xfb39e1[_0x578b64]={'$like':'%'+_0x186208[_0x2646('0x43')][_0x2646('0x68')]+'%'};return _0xfb39e1;})});}_0x496ae0=_['merge']({},_0x496ae0,_0x186208[_0x2646('0x52')]);return _0x488165[_0x2646('0xb7')](_0x496ae0);}})[_0x2646('0x1f')](function(_0x8a521b){if(_0x8a521b){_0x1e7d4d=_0x8a521b[_0x2646('0x49')];if(!_0x186208[_0x2646('0x43')][_0x2646('0x4a')](_0x2646('0x4b'))){_0x496ae0[_0x2646('0x2e')]=qs[_0x2646('0x2e')](_0x186208[_0x2646('0x43')][_0x2646('0x2e')]);_0x496ae0[_0x2646('0x2c')]=qs[_0x2646('0x2c')](_0x186208[_0x2646('0x43')][_0x2646('0x2c')]);}return _0x488165[_0x2646('0xb7')](_0x496ae0);}})[_0x2646('0x1f')](function(_0x2400d6){if(_0x2400d6){return _0x2400d6?{'count':_0x1e7d4d,'rows':_0x2400d6}:null;}})['then'](respondWithResult(_0x5d0390,null))[_0x2646('0x28')](handleError(_0x5d0390,null));};exports['send']=function(_0x36d6c5,_0x1c86bf,_0x4c4de6){var _0x459fac,_0x5dc980,_0x567520;if(_[_0x2646('0x78')](_0x36d6c5['body'][_0x2646('0x63')])||_0x36d6c5[_0x2646('0x63')]['body']===''){throw new db[(_0x2646('0x71'))][(_0x2646('0x7a'))](_0x2646('0x7b'));}if(_[_0x2646('0x78')](_0x36d6c5[_0x2646('0x63')]['to'])){}_0x459fac=_0x36d6c5['body']['to'];return db[_0x2646('0x53')][_0x2646('0x66')]({'where':{'id':_0x36d6c5['params']['id']}})[_0x2646('0x1f')](handleEntityNotFound(_0x1c86bf,null))[_0x2646('0x1f')](function(_0x346f3c){if(_0x346f3c){return db[_0x2646('0x53')]['find']({'where':{'id':_0x346f3c['id']},'include':[{'model':db[_0x2646('0x7e')],'as':_0x2646('0x82'),'include':[{'model':db[_0x2646('0x7f')],'as':_0x2646('0x88'),'where':{[_0x346f3c[_0x2646('0x7c')]]:_0x459fac},'limit':0x1,'order':[[_0x2646('0x75'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x1c86bf,null))[_0x2646('0x1f')](function(_0x21ec99){if(_0x21ec99&&_0x21ec99['List']){_0x5dc980=_0x21ec99['get']({'plain':!![]});if(_0x5dc980['List']&&_0x5dc980[_0x2646('0x82')]['Contacts'][_0x2646('0x49')]){return _0x5dc980[_0x2646('0x82')]['Contacts'][0x0];}return db[_0x2646('0x7f')][_0x2646('0x5c')](_[_0x2646('0x89')](_0x36d6c5['body'],{'firstName':_0x459fac,[_0x21ec99['mapKey']]:_0x459fac,'phone':_0x459fac,'ListId':_0x5dc980[_0x2646('0x77')]}));}})[_0x2646('0x1f')](handleEntityNotFound(_0x1c86bf,null))[_0x2646('0x1f')](function(_0x5a1290){if(_0x5a1290){_0x567520=_0x5a1290;return db['OpenchannelInteraction'][_0x2646('0x5b')]({'where':{'ContactId':_0x567520['id'],'closed':![],'OpenchannelAccountId':_0x5dc980['id']}})[_0x2646('0x1f')](function(_0x23f12f){if(_0x23f12f){return[_0x23f12f,![]];}return db[_0x2646('0x8c')][_0x2646('0x5c')]({'UserId':_0x36d6c5[_0x2646('0x5f')]['id'],'ContactId':_0x567520['id'],'OpenchannelAccountId':_0x5dc980['id'],'lastMsgDirection':_0x2646('0xb8'),'firstMsgDirection':_0x2646('0xb8'),'Messages':[_[_0x2646('0x51')](_0x36d6c5['body'],{'read':![],'body':_0x36d6c5['body'][_0x2646('0x63')],'OpenchannelAccountId':_0x5dc980['id'],'UserId':_0x36d6c5[_0x2646('0x5f')]['id'],'ContactId':_0x567520['id']})]},{'include':[{'model':db[_0x2646('0x9a')],'as':_0x2646('0xb9')}]})[_0x2646('0x1f')](function(_0x58c0ca){return[_0x58c0ca,!![]];});});}})[_0x2646('0x8f')](function(_0x2993f6,_0x36961f){if(_0x36961f){return _0x2993f6;}return db[_0x2646('0x9a')][_0x2646('0x5c')](_['merge'](_0x36d6c5[_0x2646('0x63')],{'read':![],'body':_0x36d6c5['body'][_0x2646('0x63')],'OpenchannelAccountId':_0x5dc980['id'],'OpenchannelInteractionId':_0x2993f6['id'],'UserId':_0x36d6c5[_0x2646('0x5f')]['id'],'ContactId':_0x567520['id']}))[_0x2646('0x1f')](function(_0x562232){_0x2993f6[_0x2646('0xba')]['Messages']=[];_0x2993f6['dataValues'][_0x2646('0xb9')][_0x2646('0xbb')](_0x562232['dataValues']);return _0x2993f6;});});}})[_0x2646('0x1f')](respondWithResult(_0x1c86bf,null))[_0x2646('0x28')](handleError(_0x1c86bf,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 9b80cdf..55d2200 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 _0xf109=['OpenchannelAccount','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xec0833,_0x1b4e39){var _0x166af1=function(_0x59ec7d){while(--_0x59ec7d){_0xec0833['push'](_0xec0833['shift']());}};_0x166af1(++_0x1b4e39);}(_0xf109,0xce));var _0x9f10=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xf109[_0x44946b];return _0x249bc4;};'use strict';var EventEmitter=require(_0x9f10('0x0'));var OpenchannelAccount=require(_0x9f10('0x1'))['db'][_0x9f10('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9f10('0x3')};function emitEvent(_0x74f517){return function(_0x74d0ee,_0x26f01c,_0x4027f4){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517+':'+_0x74d0ee['id'],_0x74d0ee);OpenchannelAccountEvents[_0x9f10('0x4')](_0x74f517,_0x74d0ee);_0x4027f4(null);};}for(var e in events){if(events[_0x9f10('0x5')](e)){var event=events[e];OpenchannelAccount[_0x9f10('0x6')](e,emitEvent(event));}}module[_0x9f10('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb688=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x257268,_0x2d5655){var _0x5a7a98=function(_0x8f3db4){while(--_0x8f3db4){_0x257268['push'](_0x257268['shift']());}};_0x5a7a98(++_0x2d5655);}(_0xb688,0xcf));var _0x8b68=function(_0x4f87f5,_0xc0627f){_0x4f87f5=_0x4f87f5-0x0;var _0x107af9=_0xb688[_0x4f87f5];return _0x107af9;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x8b68('0x0'))['db'][_0x8b68('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8b68('0x2')](0x0);var events={'afterCreate':_0x8b68('0x3'),'afterUpdate':_0x8b68('0x4'),'afterDestroy':_0x8b68('0x5')};function emitEvent(_0x4e281c){return function(_0x41030e,_0x27925d,_0x30f33d){OpenchannelAccountEvents[_0x8b68('0x6')](_0x4e281c+':'+_0x41030e['id'],_0x41030e);OpenchannelAccountEvents['emit'](_0x4e281c,_0x41030e);_0x30f33d(null);};}for(var e in events){if(events[_0x8b68('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8b68('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index ad38860..f611f05 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(_0x3d8824,_0x4a1799){var _0x411e2c=function(_0x1baeb3){while(--_0x1baeb3){_0x3d8824['push'](_0x3d8824['shift']());}};_0x411e2c(++_0x4a1799);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1252ca,_0x593c02){var _0x19ff97=function(_0x4d979d){while(--_0x4d979d){_0x1252ca['push'](_0x1252ca['shift']());}};_0x19ff97(++_0x593c02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 4d9c4d9..29122e8 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 _0xd523=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message'];(function(_0x504cd4,_0x41ce57){var _0x402687=function(_0x2fabae){while(--_0x2fabae){_0x504cd4['push'](_0x504cd4['shift']());}};_0x402687(++_0x41ce57);}(_0xd523,0x153));var _0x3d52=function(_0x648186,_0x27de97){_0x648186=_0x648186-0x0;var _0x50e46c=_0xd523[_0x648186];return _0x50e46c;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3d52('0xb')](config[_0x3d52('0xc')],{'host':_0x3d52('0xd'),'port':0x18eb});var socket=require(_0x3d52('0xe'))(new Redis(config[_0x3d52('0xc')]));require(_0x3d52('0xf'))[_0x3d52('0x10')](socket);function respondWithRpcPromise(_0x2d966e,_0x30ee09,_0x4a5a9a){return new BPromise(function(_0x46c2e6,_0x873de6){return client[_0x3d52('0x11')](_0x2d966e,_0x4a5a9a)[_0x3d52('0x12')](function(_0x2675d2){logger['info'](_0x3d52('0x13'),_0x30ee09,'request\x20sent');logger['debug'](_0x3d52('0x14'),_0x30ee09,_0x3d52('0x15'),JSON['stringify'](_0x2675d2));if(_0x2675d2['error']){if(_0x2675d2['error'][_0x3d52('0x16')]===0x1f4){logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);return _0x873de6(_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);}logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);return _0x46c2e6(_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);}else{logger[_0x3d52('0x19')](_0x3d52('0x13'),_0x30ee09,'request\x20sent');_0x46c2e6(_0x2675d2[_0x3d52('0x1a')][_0x3d52('0x18')]);}})[_0x3d52('0x1b')](function(_0x54a514){logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x54a514);_0x873de6(_0x54a514);});});} \ No newline at end of file +var _0x1152=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','socket.io-emitter','redis','./openchannelAccount.socket','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1f1b09,_0x41f1b9){var _0x43505c=function(_0x3bc2d5){while(--_0x3bc2d5){_0x1f1b09['push'](_0x1f1b09['shift']());}};_0x43505c(++_0x41f1b9);}(_0x1152,0x182));var _0x2115=function(_0xe5287b,_0x26b8ab){_0xe5287b=_0xe5287b-0x0;var _0x346f77=_0x1152[_0xe5287b];return _0x346f77;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require(_0x2115('0x3'));var rs=require(_0x2115('0x4'));var fs=require('fs');var Redis=require(_0x2115('0x5'));var db=require(_0x2115('0x6'))['db'];var utils=require(_0x2115('0x7'));var logger=require('../../config/logger')(_0x2115('0x8'));var config=require('../../config/environment');var jayson=require(_0x2115('0x9'));var client=jayson[_0x2115('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2115('0xb'))(new Redis(config[_0x2115('0xc')]));require(_0x2115('0xd'))['register'](socket);function respondWithRpcPromise(_0x254648,_0x534958,_0x5ca468){return new BPromise(function(_0x225a1c,_0x272a95){return client[_0x2115('0xe')](_0x254648,_0x5ca468)['then'](function(_0x400b19){logger['info'](_0x2115('0xf'),_0x534958,_0x2115('0x10'));logger[_0x2115('0x11')](_0x2115('0x12'),_0x534958,_0x2115('0x10'),JSON['stringify'](_0x400b19));if(_0x400b19[_0x2115('0x13')]){if(_0x400b19['error'][_0x2115('0x14')]===0x1f4){logger[_0x2115('0x13')](_0x2115('0xf'),_0x534958,_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);return _0x272a95(_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);}logger['error'](_0x2115('0xf'),_0x534958,_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);return _0x225a1c(_0x400b19[_0x2115('0x13')][_0x2115('0x15')]);}else{logger[_0x2115('0x16')](_0x2115('0xf'),_0x534958,_0x2115('0x10'));_0x225a1c(_0x400b19['result'][_0x2115('0x15')]);}})[_0x2115('0x17')](function(_0x38c26f){logger['error'](_0x2115('0xf'),_0x534958,_0x38c26f);_0x272a95(_0x38c26f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index f51b9fb..52c5348 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 _0x86dd=['update','emit','removeListener','register','save'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x86dd,0x1ee));var _0xd86d=function(_0x36332a,_0x496406){_0x36332a=_0x36332a-0x0;var _0xee06cd=_0x86dd[_0x36332a];return _0xee06cd;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xd86d('0x0'),'remove',_0xd86d('0x1')];function createListener(_0x2cb4b4,_0x287d1d){return function(_0x217373){_0x287d1d[_0xd86d('0x2')](_0x2cb4b4,_0x217373);};}function removeListener(_0x30a31c,_0x2e82a9){return function(){OpenchannelAccountEvents[_0xd86d('0x3')](_0x30a31c,_0x2e82a9);};}exports[_0xd86d('0x4')]=function(_0x1d5ffc){for(var _0x3b13f9=0x0,_0x4274f8=events['length'];_0x3b13f9<_0x4274f8;_0x3b13f9++){var _0x341335=events[_0x3b13f9];var _0xfcba94=createListener('openchannelAccount:'+_0x341335,_0x1d5ffc);OpenchannelAccountEvents['on'](_0x341335,_0xfcba94);}}; \ No newline at end of file +var _0x4f88=['removeListener','register','length','./openchannelAccount.events','save','update'];(function(_0x5ae268,_0x4b3d90){var _0x3fea8b=function(_0x4a0c9c){while(--_0x4a0c9c){_0x5ae268['push'](_0x5ae268['shift']());}};_0x3fea8b(++_0x4b3d90);}(_0x4f88,0xf3));var _0x84f8=function(_0x3c4e4c,_0x36ff70){_0x3c4e4c=_0x3c4e4c-0x0;var _0x144a87=_0x4f88[_0x3c4e4c];return _0x144a87;};'use strict';var OpenchannelAccountEvents=require(_0x84f8('0x0'));var events=[_0x84f8('0x1'),'remove',_0x84f8('0x2')];function createListener(_0x1b0c3f,_0x305358){return function(_0x4c27ff){_0x305358['emit'](_0x1b0c3f,_0x4c27ff);};}function removeListener(_0xef8394,_0x17ca7c){return function(){OpenchannelAccountEvents[_0x84f8('0x3')](_0xef8394,_0x17ca7c);};}exports[_0x84f8('0x4')]=function(_0x79dcec){for(var _0x1ac0c8=0x0,_0x5aa345=events[_0x84f8('0x5')];_0x1ac0c8<_0x5aa345;_0x1ac0c8++){var _0x40e5f3=events[_0x1ac0c8];var _0x4ae430=createListener('openchannelAccount:'+_0x40e5f3,_0x79dcec);OpenchannelAccountEvents['on'](_0x40e5f3,_0x4ae430);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 6dfa945..efde182 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 _0x80d8=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller'];(function(_0x59f46a,_0x3e44de){var _0x3608fb=function(_0x5d0b24){while(--_0x5d0b24){_0x59f46a['push'](_0x59f46a['shift']());}};_0x3608fb(++_0x3e44de);}(_0x80d8,0x1ef));var _0x880d=function(_0x5eaa6a,_0x41d4f9){_0x5eaa6a=_0x5eaa6a-0x0;var _0x332a98=_0x80d8[_0x5eaa6a];return _0x332a98;};'use strict';var multer=require(_0x880d('0x0'));var util=require(_0x880d('0x1'));var path=require(_0x880d('0x2'));var timeout=require(_0x880d('0x3'));var express=require('express');var router=express[_0x880d('0x4')]();var fs_extra=require(_0x880d('0x5'));var auth=require(_0x880d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x880d('0x7'));var controller=require(_0x880d('0x8'));router[_0x880d('0x9')]('/',auth[_0x880d('0xa')](),controller[_0x880d('0xb')]);router[_0x880d('0x9')](_0x880d('0xc'),auth['isAuthenticated'](),controller[_0x880d('0xd')]);router[_0x880d('0xe')]('/',auth[_0x880d('0xa')](),controller[_0x880d('0xf')]);router[_0x880d('0x10')](_0x880d('0xc'),auth[_0x880d('0xa')](),controller[_0x880d('0x11')]);router[_0x880d('0x12')]('/:id',auth[_0x880d('0xa')](),controller[_0x880d('0x13')]);module[_0x880d('0x14')]=router; \ No newline at end of file +var _0xc51b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x409124,_0x2c73e6){var _0x4eb007=function(_0x131345){while(--_0x131345){_0x409124['push'](_0x409124['shift']());}};_0x4eb007(++_0x2c73e6);}(_0xc51b,0x152));var _0xbc51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc51b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbc51('0x0'));var util=require(_0xbc51('0x1'));var path=require(_0xbc51('0x2'));var timeout=require(_0xbc51('0x3'));var express=require('express');var router=express[_0xbc51('0x4')]();var fs_extra=require(_0xbc51('0x5'));var auth=require(_0xbc51('0x6'));var interaction=require(_0xbc51('0x7'));var config=require(_0xbc51('0x8'));var controller=require(_0xbc51('0x9'));router[_0xbc51('0xa')]('/',auth[_0xbc51('0xb')](),controller[_0xbc51('0xc')]);router[_0xbc51('0xa')](_0xbc51('0xd'),auth[_0xbc51('0xb')](),controller['show']);router[_0xbc51('0xe')]('/',auth[_0xbc51('0xb')](),controller[_0xbc51('0xf')]);router['put'](_0xbc51('0xd'),auth['isAuthenticated'](),controller[_0xbc51('0x10')]);router[_0xbc51('0x11')](_0xbc51('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xbc51('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index b65b4ac..5d8c0e3 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 _0x46ba=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x48e2ea,_0x4105df){var _0x85f652=function(_0x28a14a){while(--_0x28a14a){_0x48e2ea['push'](_0x48e2ea['shift']());}};_0x85f652(++_0x4105df);}(_0x46ba,0x8c));var _0xa46b=function(_0x607e6a,_0x1c9331){_0x607e6a=_0x607e6a-0x0;var _0x214d70=_0x46ba[_0x607e6a];return _0x214d70;};'use strict';var Sequelize=require('sequelize');module[_0xa46b('0x0')]={'priority':{'type':Sequelize[_0xa46b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa46b('0x2')],'allowNull':![],'defaultValue':_0xa46b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa46b('0x2')]},'interval':{'type':Sequelize[_0xa46b('0x2')],'defaultValue':_0xa46b('0x4')}}; \ No newline at end of file +var _0x233c=['exports','STRING','noop','sequelize'];(function(_0x5379a4,_0x533a6d){var _0x3e78f3=function(_0x261ede){while(--_0x261ede){_0x5379a4['push'](_0x5379a4['shift']());}};_0x3e78f3(++_0x533a6d);}(_0x233c,0x6f));var _0xc233=function(_0x5db25b,_0x4455a9){_0x5db25b=_0x5db25b-0x0;var _0x408708=_0x233c[_0x5db25b];return _0x408708;};'use strict';var Sequelize=require(_0xc233('0x0'));module[_0xc233('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc233('0x2')],'allowNull':![],'defaultValue':_0xc233('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc233('0x2')]},'interval':{'type':Sequelize[_0xc233('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index f810a58..1f8492a 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 _0x6b88=['ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','show','params','merge','catch','create','body','find','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv'];(function(_0x18acfa,_0x2a40e6){var _0x16d81c=function(_0x5a05dc){while(--_0x5a05dc){_0x18acfa['push'](_0x18acfa['shift']());}};_0x16d81c(++_0x2a40e6);}(_0x6b88,0x16f));var _0x86b8=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x6b88[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require(_0x86b8('0x0'));var rimraf=require(_0x86b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86b8('0x2'));var BPromise=require(_0x86b8('0x3'));var Mustache=require('mustache');var util=require(_0x86b8('0x4'));var path=require(_0x86b8('0x5'));var sox=require(_0x86b8('0x6'));var csv=require(_0x86b8('0x7'));var ejs=require(_0x86b8('0x8'));var fs=require('fs');var fs_extra=require(_0x86b8('0x9'));var _=require('lodash');var squel=require(_0x86b8('0xa'));var crypto=require(_0x86b8('0xb'));var jsforce=require(_0x86b8('0xc'));var deskjs=require(_0x86b8('0xd'));var toCsv=require(_0x86b8('0x7'));var querystring=require('querystring');var Papa=require(_0x86b8('0xe'));var Redis=require(_0x86b8('0xf'));var authService=require(_0x86b8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x86b8('0x11'));var hardwareService=require(_0x86b8('0x12'));var logger=require(_0x86b8('0x13'))(_0x86b8('0x14'));var utils=require(_0x86b8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x86b8('0x16'))['db'];function respondWithStatusCode(_0xa2c257,_0x930d5){_0x930d5=_0x930d5||0xcc;return function(_0x283c37){if(_0x283c37){return _0xa2c257[_0x86b8('0x17')](_0x930d5);}return _0xa2c257['status'](_0x930d5)[_0x86b8('0x18')]();};}function respondWithResult(_0x22bfe9,_0x1df9f7){_0x1df9f7=_0x1df9f7||0xc8;return function(_0x5af32f){if(_0x5af32f){return _0x22bfe9[_0x86b8('0x19')](_0x1df9f7)['json'](_0x5af32f);}};}function respondWithFilteredResult(_0x58d29b,_0x124666){return function(_0x365549){if(_0x365549){var _0x456136=typeof _0x124666[_0x86b8('0x1a')]===_0x86b8('0x1b')&&typeof _0x124666[_0x86b8('0x1c')]==='undefined';var _0x81f8db=_0x365549[_0x86b8('0x1d')];var _0x56e473=_0x456136?0x0:_0x124666[_0x86b8('0x1a')];var _0x10dcc9=_0x456136?_0x365549['count']:_0x124666['offset']+_0x124666[_0x86b8('0x1c')];var _0x1256fd;if(_0x10dcc9>=_0x81f8db){_0x10dcc9=_0x81f8db;_0x1256fd=0xc8;}else{_0x1256fd=0xce;}_0x58d29b[_0x86b8('0x19')](_0x1256fd);return _0x58d29b[_0x86b8('0x1e')](_0x86b8('0x1f'),_0x56e473+'-'+_0x10dcc9+'/'+_0x81f8db)['json'](_0x365549);}return null;};}function patchUpdates(_0x27c685){return function(_0x3f4245){try{jsonpatch[_0x86b8('0x20')](_0x3f4245,_0x27c685,!![]);}catch(_0x14866b){return BPromise[_0x86b8('0x21')](_0x14866b);}return _0x3f4245[_0x86b8('0x22')]();};}function saveUpdates(_0x54adf0,_0x1c1313){return function(_0x5cbd29){if(_0x5cbd29){return _0x5cbd29[_0x86b8('0x23')](_0x54adf0)[_0x86b8('0x24')](function(_0x1cd861){return _0x1cd861;});}return null;};}function removeEntity(_0x1da565,_0x468c21){return function(_0x1ea496){if(_0x1ea496){return _0x1ea496[_0x86b8('0x25')]()['then'](function(){_0x1da565['status'](0xcc)[_0x86b8('0x18')]();});}};}function handleEntityNotFound(_0x342e1a,_0x25d3a3){return function(_0x38320f){if(!_0x38320f){_0x342e1a[_0x86b8('0x17')](0x194);}return _0x38320f;};}function handleError(_0x880ae5,_0x3b4908){_0x3b4908=_0x3b4908||0x1f4;return function(_0x3fe335){logger[_0x86b8('0x26')](_0x3fe335[_0x86b8('0x27')]);if(_0x3fe335[_0x86b8('0x28')]){delete _0x3fe335[_0x86b8('0x28')];}_0x880ae5[_0x86b8('0x19')](_0x3b4908)[_0x86b8('0x29')](_0x3fe335);};}exports[_0x86b8('0x2a')]=function(_0x30aebc,_0xce9832){var _0x1ef924={},_0xd26f9a={},_0x522b06={'count':0x0,'rows':[]};var _0x303af2=_['map'](db[_0x86b8('0x2b')][_0x86b8('0x2c')],function(_0x5e985a){return{'name':_0x5e985a[_0x86b8('0x2d')],'type':_0x5e985a[_0x86b8('0x2e')][_0x86b8('0x2f')]};});_0xd26f9a[_0x86b8('0x30')]=_[_0x86b8('0x31')](_0x303af2,_0x86b8('0x28'));_0xd26f9a[_0x86b8('0x32')]=_[_0x86b8('0x33')](_0x30aebc[_0x86b8('0x32')]);_0xd26f9a[_0x86b8('0x34')]=_[_0x86b8('0x35')](_0xd26f9a[_0x86b8('0x30')],_0xd26f9a[_0x86b8('0x32')]);_0x1ef924[_0x86b8('0x36')]=_[_0x86b8('0x35')](_0xd26f9a[_0x86b8('0x30')],qs[_0x86b8('0x37')](_0x30aebc[_0x86b8('0x32')][_0x86b8('0x37')]));_0x1ef924[_0x86b8('0x36')]=_0x1ef924[_0x86b8('0x36')][_0x86b8('0x38')]?_0x1ef924[_0x86b8('0x36')]:_0xd26f9a[_0x86b8('0x30')];if(!_0x30aebc['query'][_0x86b8('0x39')](_0x86b8('0x3a'))){_0x1ef924[_0x86b8('0x1c')]=qs[_0x86b8('0x1c')](_0x30aebc[_0x86b8('0x32')][_0x86b8('0x1c')]);_0x1ef924[_0x86b8('0x1a')]=qs['offset'](_0x30aebc['query'][_0x86b8('0x1a')]);}_0x1ef924[_0x86b8('0x3b')]=qs[_0x86b8('0x3c')](_0x30aebc[_0x86b8('0x32')][_0x86b8('0x3c')]);_0x1ef924[_0x86b8('0x3d')]=qs[_0x86b8('0x34')](_[_0x86b8('0x3e')](_0x30aebc[_0x86b8('0x32')],_0xd26f9a[_0x86b8('0x34')]),_0x303af2);if(_0x30aebc[_0x86b8('0x32')]['filter']){_0x1ef924['where']=_['merge'](_0x1ef924['where'],{'$or':_[_0x86b8('0x31')](_0x303af2,function(_0x1fef2f){if(_0x1fef2f['type']!==_0x86b8('0x3f')){var _0x5b76f3={};_0x5b76f3[_0x1fef2f[_0x86b8('0x28')]]={'$like':'%'+_0x30aebc['query']['filter']+'%'};return _0x5b76f3;}})});}_0x1ef924=_['merge']({},_0x1ef924,_0x30aebc[_0x86b8('0x40')]);var _0x351521={'where':_0x1ef924[_0x86b8('0x3d')]};return db[_0x86b8('0x2b')]['count'](_0x351521)[_0x86b8('0x24')](function(_0x50c931){_0x522b06[_0x86b8('0x1d')]=_0x50c931;if(_0x30aebc[_0x86b8('0x32')][_0x86b8('0x41')]){_0x1ef924[_0x86b8('0x42')]=[{'all':!![]}];}return db[_0x86b8('0x2b')][_0x86b8('0x43')](_0x1ef924);})[_0x86b8('0x24')](function(_0x4ed1c9){_0x522b06['rows']=_0x4ed1c9;return _0x522b06;})['then'](respondWithFilteredResult(_0xce9832,_0x1ef924))['catch'](handleError(_0xce9832,null));};exports[_0x86b8('0x44')]=function(_0xf1aa41,_0x427fce){var _0x42475c={'raw':!![],'where':{'id':_0xf1aa41[_0x86b8('0x45')]['id']}},_0x251c01={};_0x251c01[_0x86b8('0x30')]=_[_0x86b8('0x33')](db[_0x86b8('0x2b')][_0x86b8('0x2c')]);_0x251c01['query']=_[_0x86b8('0x33')](_0xf1aa41[_0x86b8('0x32')]);_0x251c01[_0x86b8('0x34')]=_[_0x86b8('0x35')](_0x251c01[_0x86b8('0x30')],_0x251c01['query']);_0x42475c['attributes']=_[_0x86b8('0x35')](_0x251c01['model'],qs[_0x86b8('0x37')](_0xf1aa41[_0x86b8('0x32')][_0x86b8('0x37')]));_0x42475c[_0x86b8('0x36')]=_0x42475c[_0x86b8('0x36')][_0x86b8('0x38')]?_0x42475c[_0x86b8('0x36')]:_0x251c01[_0x86b8('0x30')];if(_0xf1aa41['query'][_0x86b8('0x41')]){_0x42475c[_0x86b8('0x42')]=[{'all':!![]}];}_0x42475c=_[_0x86b8('0x46')]({},_0x42475c,_0xf1aa41[_0x86b8('0x40')]);return db[_0x86b8('0x2b')]['find'](_0x42475c)[_0x86b8('0x24')](handleEntityNotFound(_0x427fce,null))[_0x86b8('0x24')](respondWithResult(_0x427fce,null))[_0x86b8('0x47')](handleError(_0x427fce,null));};exports[_0x86b8('0x48')]=function(_0x5a2e94,_0x43469b){return db[_0x86b8('0x2b')][_0x86b8('0x48')](_0x5a2e94[_0x86b8('0x49')],{})['then'](respondWithResult(_0x43469b,0xc9))[_0x86b8('0x47')](handleError(_0x43469b,null));};exports['update']=function(_0x4a3e57,_0x107f73){if(_0x4a3e57[_0x86b8('0x49')]['id']){delete _0x4a3e57[_0x86b8('0x49')]['id'];}return db[_0x86b8('0x2b')][_0x86b8('0x4a')]({'where':{'id':_0x4a3e57['params']['id']}})[_0x86b8('0x24')](handleEntityNotFound(_0x107f73,null))[_0x86b8('0x24')](saveUpdates(_0x4a3e57['body'],null))[_0x86b8('0x24')](respondWithResult(_0x107f73,null))[_0x86b8('0x47')](handleError(_0x107f73,null));};exports[_0x86b8('0x25')]=function(_0x34681e,_0x116597){return db['OpenchannelApplication'][_0x86b8('0x4a')]({'where':{'id':_0x34681e[_0x86b8('0x45')]['id']}})['then'](handleEntityNotFound(_0x116597,null))[_0x86b8('0x24')](removeEntity(_0x116597,null))[_0x86b8('0x47')](handleError(_0x116597,null));}; \ No newline at end of file +var _0x621e=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','OpenchannelApplication','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x621e,0x16b));var _0xe621=function(_0x969a32,_0x3cabe8){_0x969a32=_0x969a32-0x0;var _0x5945e7=_0x621e[_0x969a32];return _0x5945e7;};'use strict';var emlformat=require(_0xe621('0x0'));var rimraf=require(_0xe621('0x1'));var zipdir=require(_0xe621('0x2'));var jsonpatch=require(_0xe621('0x3'));var rp=require(_0xe621('0x4'));var moment=require(_0xe621('0x5'));var BPromise=require(_0xe621('0x6'));var Mustache=require(_0xe621('0x7'));var util=require('util');var path=require(_0xe621('0x8'));var sox=require(_0xe621('0x9'));var csv=require(_0xe621('0xa'));var ejs=require(_0xe621('0xb'));var fs=require('fs');var fs_extra=require(_0xe621('0xc'));var _=require(_0xe621('0xd'));var squel=require(_0xe621('0xe'));var crypto=require(_0xe621('0xf'));var jsforce=require(_0xe621('0x10'));var deskjs=require(_0xe621('0x11'));var toCsv=require(_0xe621('0xa'));var querystring=require(_0xe621('0x12'));var Papa=require(_0xe621('0x13'));var Redis=require('ioredis');var authService=require(_0xe621('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe621('0x15'));var hardwareService=require(_0xe621('0x16'));var logger=require(_0xe621('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xe621('0x18'));var licenseUtil=require(_0xe621('0x19'));var db=require(_0xe621('0x1a'))['db'];function respondWithStatusCode(_0x3fed9a,_0x1e171b){_0x1e171b=_0x1e171b||0xcc;return function(_0x1d3118){if(_0x1d3118){return _0x3fed9a[_0xe621('0x1b')](_0x1e171b);}return _0x3fed9a[_0xe621('0x1c')](_0x1e171b)[_0xe621('0x1d')]();};}function respondWithResult(_0x2871df,_0x1c914b){_0x1c914b=_0x1c914b||0xc8;return function(_0x12c4f4){if(_0x12c4f4){return _0x2871df['status'](_0x1c914b)['json'](_0x12c4f4);}};}function respondWithFilteredResult(_0x146564,_0x3da25b){return function(_0x274b93){if(_0x274b93){var _0x2f7d39=typeof _0x3da25b[_0xe621('0x1e')]===_0xe621('0x1f')&&typeof _0x3da25b['limit']===_0xe621('0x1f');var _0x435531=_0x274b93[_0xe621('0x20')];var _0x418035=_0x2f7d39?0x0:_0x3da25b[_0xe621('0x1e')];var _0x53de63=_0x2f7d39?_0x274b93[_0xe621('0x20')]:_0x3da25b[_0xe621('0x1e')]+_0x3da25b[_0xe621('0x21')];var _0x1afe53;if(_0x53de63>=_0x435531){_0x53de63=_0x435531;_0x1afe53=0xc8;}else{_0x1afe53=0xce;}_0x146564['status'](_0x1afe53);return _0x146564['set'](_0xe621('0x22'),_0x418035+'-'+_0x53de63+'/'+_0x435531)[_0xe621('0x23')](_0x274b93);}return null;};}function patchUpdates(_0x328451){return function(_0x4f7ae7){try{jsonpatch[_0xe621('0x24')](_0x4f7ae7,_0x328451,!![]);}catch(_0x1d27af){return BPromise[_0xe621('0x25')](_0x1d27af);}return _0x4f7ae7[_0xe621('0x26')]();};}function saveUpdates(_0x4f7c92,_0x222717){return function(_0x58821a){if(_0x58821a){return _0x58821a[_0xe621('0x27')](_0x4f7c92)[_0xe621('0x28')](function(_0x51d0a0){return _0x51d0a0;});}return null;};}function removeEntity(_0x45d786,_0x3d7e50){return function(_0x1a0ce1){if(_0x1a0ce1){return _0x1a0ce1[_0xe621('0x29')]()[_0xe621('0x28')](function(){_0x45d786[_0xe621('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b7d72,_0x19241c){return function(_0x5bcb4a){if(!_0x5bcb4a){_0x1b7d72[_0xe621('0x1b')](0x194);}return _0x5bcb4a;};}function handleError(_0x1a93c7,_0x3d93e1){_0x3d93e1=_0x3d93e1||0x1f4;return function(_0xa114b9){logger[_0xe621('0x2a')](_0xa114b9['stack']);if(_0xa114b9['name']){delete _0xa114b9['name'];}_0x1a93c7[_0xe621('0x1c')](_0x3d93e1)['send'](_0xa114b9);};}exports[_0xe621('0x2b')]=function(_0x33dece,_0x950d17){var _0x2da886={},_0x56433a={},_0x450b44={'count':0x0,'rows':[]};var _0x3d1377=_[_0xe621('0x2c')](db['OpenchannelApplication'][_0xe621('0x2d')],function(_0x4655ef){return{'name':_0x4655ef[_0xe621('0x2e')],'type':_0x4655ef[_0xe621('0x2f')][_0xe621('0x30')]};});_0x56433a[_0xe621('0x31')]=_[_0xe621('0x2c')](_0x3d1377,'name');_0x56433a[_0xe621('0x32')]=_[_0xe621('0x33')](_0x33dece[_0xe621('0x32')]);_0x56433a[_0xe621('0x34')]=_['intersection'](_0x56433a['model'],_0x56433a[_0xe621('0x32')]);_0x2da886['attributes']=_[_0xe621('0x35')](_0x56433a[_0xe621('0x31')],qs['fields'](_0x33dece['query'][_0xe621('0x36')]));_0x2da886[_0xe621('0x37')]=_0x2da886[_0xe621('0x37')][_0xe621('0x38')]?_0x2da886[_0xe621('0x37')]:_0x56433a[_0xe621('0x31')];if(!_0x33dece[_0xe621('0x32')]['hasOwnProperty'](_0xe621('0x39'))){_0x2da886[_0xe621('0x21')]=qs['limit'](_0x33dece[_0xe621('0x32')][_0xe621('0x21')]);_0x2da886['offset']=qs[_0xe621('0x1e')](_0x33dece[_0xe621('0x32')][_0xe621('0x1e')]);}_0x2da886[_0xe621('0x3a')]=qs[_0xe621('0x3b')](_0x33dece[_0xe621('0x32')][_0xe621('0x3b')]);_0x2da886[_0xe621('0x3c')]=qs[_0xe621('0x34')](_['pick'](_0x33dece[_0xe621('0x32')],_0x56433a[_0xe621('0x34')]),_0x3d1377);if(_0x33dece['query'][_0xe621('0x3d')]){_0x2da886['where']=_[_0xe621('0x3e')](_0x2da886[_0xe621('0x3c')],{'$or':_[_0xe621('0x2c')](_0x3d1377,function(_0x43a1f9){if(_0x43a1f9[_0xe621('0x2f')]!==_0xe621('0x3f')){var _0x9c2240={};_0x9c2240[_0x43a1f9[_0xe621('0x40')]]={'$like':'%'+_0x33dece['query'][_0xe621('0x3d')]+'%'};return _0x9c2240;}})});}_0x2da886=_['merge']({},_0x2da886,_0x33dece[_0xe621('0x41')]);var _0x4126eb={'where':_0x2da886['where']};return db[_0xe621('0x42')][_0xe621('0x20')](_0x4126eb)['then'](function(_0x3eb6b0){_0x450b44[_0xe621('0x20')]=_0x3eb6b0;if(_0x33dece[_0xe621('0x32')][_0xe621('0x43')]){_0x2da886[_0xe621('0x44')]=[{'all':!![]}];}return db[_0xe621('0x42')]['findAll'](_0x2da886);})[_0xe621('0x28')](function(_0x5ea8a1){_0x450b44[_0xe621('0x45')]=_0x5ea8a1;return _0x450b44;})[_0xe621('0x28')](respondWithFilteredResult(_0x950d17,_0x2da886))[_0xe621('0x46')](handleError(_0x950d17,null));};exports[_0xe621('0x47')]=function(_0x4f3bd6,_0x2f0320){var _0x58abec={'raw':!![],'where':{'id':_0x4f3bd6[_0xe621('0x48')]['id']}},_0xdd7c9a={};_0xdd7c9a[_0xe621('0x31')]=_[_0xe621('0x33')](db[_0xe621('0x42')]['rawAttributes']);_0xdd7c9a[_0xe621('0x32')]=_[_0xe621('0x33')](_0x4f3bd6[_0xe621('0x32')]);_0xdd7c9a[_0xe621('0x34')]=_[_0xe621('0x35')](_0xdd7c9a[_0xe621('0x31')],_0xdd7c9a[_0xe621('0x32')]);_0x58abec[_0xe621('0x37')]=_[_0xe621('0x35')](_0xdd7c9a[_0xe621('0x31')],qs['fields'](_0x4f3bd6[_0xe621('0x32')][_0xe621('0x36')]));_0x58abec[_0xe621('0x37')]=_0x58abec[_0xe621('0x37')][_0xe621('0x38')]?_0x58abec[_0xe621('0x37')]:_0xdd7c9a[_0xe621('0x31')];if(_0x4f3bd6['query']['includeAll']){_0x58abec[_0xe621('0x44')]=[{'all':!![]}];}_0x58abec=_[_0xe621('0x3e')]({},_0x58abec,_0x4f3bd6[_0xe621('0x41')]);return db['OpenchannelApplication'][_0xe621('0x49')](_0x58abec)[_0xe621('0x28')](handleEntityNotFound(_0x2f0320,null))[_0xe621('0x28')](respondWithResult(_0x2f0320,null))['catch'](handleError(_0x2f0320,null));};exports[_0xe621('0x4a')]=function(_0x3654ad,_0x1a114a){return db[_0xe621('0x42')][_0xe621('0x4a')](_0x3654ad[_0xe621('0x4b')],{})[_0xe621('0x28')](respondWithResult(_0x1a114a,0xc9))[_0xe621('0x46')](handleError(_0x1a114a,null));};exports[_0xe621('0x27')]=function(_0x2d7948,_0x4d0a1f){if(_0x2d7948[_0xe621('0x4b')]['id']){delete _0x2d7948[_0xe621('0x4b')]['id'];}return db[_0xe621('0x42')][_0xe621('0x49')]({'where':{'id':_0x2d7948[_0xe621('0x48')]['id']}})[_0xe621('0x28')](handleEntityNotFound(_0x4d0a1f,null))['then'](saveUpdates(_0x2d7948['body'],null))['then'](respondWithResult(_0x4d0a1f,null))[_0xe621('0x46')](handleError(_0x4d0a1f,null));};exports[_0xe621('0x29')]=function(_0x25ddc5,_0x1ae158){return db['OpenchannelApplication'][_0xe621('0x49')]({'where':{'id':_0x25ddc5['params']['id']}})['then'](handleEntityNotFound(_0x1ae158,null))[_0xe621('0x28')](removeEntity(_0x1ae158,null))['catch'](handleError(_0x1ae158,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index af666e8..7b96857 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 _0x66fe=['request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x66fe,0x7d));var _0xe66f=function(_0x570461,_0x18cb77){_0x570461=_0x570461-0x0;var _0x4ddbcb=_0x66fe[_0x570461];return _0x4ddbcb;};'use strict';var _=require(_0xe66f('0x0'));var util=require('util');var logger=require(_0xe66f('0x1'))(_0xe66f('0x2'));var moment=require(_0xe66f('0x3'));var BPromise=require(_0xe66f('0x4'));var rp=require(_0xe66f('0x5'));var fs=require('fs');var path=require(_0xe66f('0x6'));var rimraf=require(_0xe66f('0x7'));var config=require('../../config/environment');var attributes=require(_0xe66f('0x8'));module[_0xe66f('0x9')]=function(_0x446553,_0x49e218){return _0x446553[_0xe66f('0xa')](_0xe66f('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe66f('0xc')});}; \ No newline at end of file +var _0x9e14=['rimraf','../../config/environment','exports','OpenchannelApplication','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xa7915c,_0x416c03){var _0x5a9555=function(_0xd5aaf0){while(--_0xd5aaf0){_0xa7915c['push'](_0xa7915c['shift']());}};_0x5a9555(++_0x416c03);}(_0x9e14,0x65));var _0x49e1=function(_0x1a5f16,_0x37427a){_0x1a5f16=_0x1a5f16-0x0;var _0x231f07=_0x9e14[_0x1a5f16];return _0x231f07;};'use strict';var _=require(_0x49e1('0x0'));var util=require(_0x49e1('0x1'));var logger=require('../../config/logger')(_0x49e1('0x2'));var moment=require(_0x49e1('0x3'));var BPromise=require(_0x49e1('0x4'));var rp=require(_0x49e1('0x5'));var fs=require('fs');var path=require(_0x49e1('0x6'));var rimraf=require(_0x49e1('0x7'));var config=require(_0x49e1('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0x49e1('0x9')]=function(_0xaf0556,_0x3f7761){return _0xaf0556['define'](_0x49e1('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x49e1('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 42c1f13..003ea1b 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 _0x18d9=['body','raw','options','where','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','UpdateOpenchannelApplication','update'];(function(_0x4f29a0,_0x4e643a){var _0x5e6c61=function(_0x46218b){while(--_0x46218b){_0x4f29a0['push'](_0x4f29a0['shift']());}};_0x5e6c61(++_0x4e643a);}(_0x18d9,0x10b));var _0x918d=function(_0x646cc,_0xdbd418){_0x646cc=_0x646cc-0x0;var _0x5d962b=_0x18d9[_0x646cc];return _0x5d962b;};'use strict';var _=require(_0x918d('0x0'));var util=require('util');var moment=require(_0x918d('0x1'));var BPromise=require(_0x918d('0x2'));var rs=require(_0x918d('0x3'));var fs=require('fs');var Redis=require(_0x918d('0x4'));var db=require(_0x918d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x918d('0x6'))('rpc');var config=require(_0x918d('0x7'));var jayson=require(_0x918d('0x8'));var client=jayson[_0x918d('0x9')][_0x918d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x891bbd,_0x461822,_0x2854c0){return new BPromise(function(_0x1cbd8e,_0x11e0ec){return client['request'](_0x891bbd,_0x2854c0)[_0x918d('0xb')](function(_0x2de854){logger[_0x918d('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x461822,'request\x20sent');logger[_0x918d('0xd')](_0x918d('0xe'),_0x461822,_0x918d('0xf'),JSON[_0x918d('0x10')](_0x2de854));if(_0x2de854[_0x918d('0x11')]){if(_0x2de854[_0x918d('0x11')][_0x918d('0x12')]===0x1f4){logger['error'](_0x918d('0x13'),_0x461822,_0x2de854[_0x918d('0x11')][_0x918d('0x14')]);return _0x11e0ec(_0x2de854[_0x918d('0x11')][_0x918d('0x14')]);}logger['error'](_0x918d('0x13'),_0x461822,_0x2de854[_0x918d('0x11')][_0x918d('0x14')]);return _0x1cbd8e(_0x2de854[_0x918d('0x11')][_0x918d('0x14')]);}else{logger[_0x918d('0xc')](_0x918d('0x13'),_0x461822,_0x918d('0xf'));_0x1cbd8e(_0x2de854['result'][_0x918d('0x14')]);}})['catch'](function(_0x50f21a){logger[_0x918d('0x11')](_0x918d('0x13'),_0x461822,_0x50f21a);_0x11e0ec(_0x50f21a);});});}exports[_0x918d('0x15')]=function(_0x290753){var _0x510cc7=this;return new Promise(function(_0x8f9d87,_0x159497){return db['OpenchannelApplication'][_0x918d('0x16')](_0x290753[_0x918d('0x17')],{'raw':_0x290753['options']?_0x290753['options'][_0x918d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x290753[_0x918d('0x19')]?_0x290753[_0x918d('0x19')][_0x918d('0x1a')]||null:null,'attributes':_0x290753['options']?_0x290753[_0x918d('0x19')]['attributes']||null:null,'limit':_0x290753['options']?_0x290753[_0x918d('0x19')][_0x918d('0x1b')]||null:null})[_0x918d('0xb')](function(_0x1fc60e){logger[_0x918d('0xc')]('UpdateOpenchannelApplication',_0x290753);logger[_0x918d('0xd')](_0x918d('0x15'),_0x290753,JSON[_0x918d('0x10')](_0x1fc60e));_0x8f9d87(_0x1fc60e);})[_0x918d('0x1c')](function(_0x2a3520){logger[_0x918d('0x11')](_0x918d('0x15'),_0x2a3520[_0x918d('0x14')],_0x290753);_0x159497(_0x510cc7[_0x918d('0x11')](0x1f4,_0x2a3520['message']));});});}; \ No newline at end of file +var _0xefe2=['OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x26cfa1,_0x2f8769){var _0x65353c=function(_0x52377b){while(--_0x52377b){_0x26cfa1['push'](_0x26cfa1['shift']());}};_0x65353c(++_0x2f8769);}(_0xefe2,0xeb));var _0x2efe=function(_0x1eab44,_0x5f0d5e){_0x1eab44=_0x1eab44-0x0;var _0x54ec11=_0xefe2[_0x1eab44];return _0x54ec11;};'use strict';var _=require(_0x2efe('0x0'));var util=require(_0x2efe('0x1'));var moment=require(_0x2efe('0x2'));var BPromise=require(_0x2efe('0x3'));var rs=require(_0x2efe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2efe('0x5'))['db'];var utils=require(_0x2efe('0x6'));var logger=require(_0x2efe('0x7'))(_0x2efe('0x8'));var config=require(_0x2efe('0x9'));var jayson=require(_0x2efe('0xa'));var client=jayson['client'][_0x2efe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc72550,_0x42b865,_0x35a9b5){return new BPromise(function(_0x53f17,_0x129ab8){return client[_0x2efe('0xc')](_0xc72550,_0x35a9b5)['then'](function(_0x36ed54){logger['info'](_0x2efe('0xd'),_0x42b865,_0x2efe('0xe'));logger[_0x2efe('0xf')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x42b865,_0x2efe('0xe'),JSON[_0x2efe('0x10')](_0x36ed54));if(_0x36ed54[_0x2efe('0x11')]){if(_0x36ed54[_0x2efe('0x11')][_0x2efe('0x12')]===0x1f4){logger[_0x2efe('0x11')](_0x2efe('0xd'),_0x42b865,_0x36ed54[_0x2efe('0x11')][_0x2efe('0x13')]);return _0x129ab8(_0x36ed54[_0x2efe('0x11')][_0x2efe('0x13')]);}logger[_0x2efe('0x11')](_0x2efe('0xd'),_0x42b865,_0x36ed54[_0x2efe('0x11')]['message']);return _0x53f17(_0x36ed54[_0x2efe('0x11')][_0x2efe('0x13')]);}else{logger[_0x2efe('0x14')](_0x2efe('0xd'),_0x42b865,_0x2efe('0xe'));_0x53f17(_0x36ed54[_0x2efe('0x15')][_0x2efe('0x13')]);}})['catch'](function(_0x212e82){logger[_0x2efe('0x11')](_0x2efe('0xd'),_0x42b865,_0x212e82);_0x129ab8(_0x212e82);});});}exports[_0x2efe('0x16')]=function(_0x453c30){var _0x57e745=this;return new Promise(function(_0x172ade,_0x1712bf){return db['OpenchannelApplication'][_0x2efe('0x17')](_0x453c30[_0x2efe('0x18')],{'raw':_0x453c30[_0x2efe('0x19')]?_0x453c30[_0x2efe('0x19')][_0x2efe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x453c30[_0x2efe('0x19')]?_0x453c30[_0x2efe('0x19')][_0x2efe('0x1b')]||null:null,'attributes':_0x453c30['options']?_0x453c30['options'][_0x2efe('0x1c')]||null:null,'limit':_0x453c30[_0x2efe('0x19')]?_0x453c30['options'][_0x2efe('0x1d')]||null:null})['then'](function(_0x53978f){logger[_0x2efe('0x14')](_0x2efe('0x16'),_0x453c30);logger[_0x2efe('0xf')]('UpdateOpenchannelApplication',_0x453c30,JSON[_0x2efe('0x10')](_0x53978f));_0x172ade(_0x53978f);})[_0x2efe('0x1e')](function(_0x32d90b){logger[_0x2efe('0x11')]('UpdateOpenchannelApplication',_0x32d90b[_0x2efe('0x13')],_0x453c30);_0x1712bf(_0x57e745[_0x2efe('0x11')](0x1f4,_0x32d90b[_0x2efe('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index eb572ea..4d635a4 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 _0x4fc9=['describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x5961e8,_0x5138b6){var _0x7b1e3e=function(_0x283d75){while(--_0x283d75){_0x5961e8['push'](_0x5961e8['shift']());}};_0x7b1e3e(++_0x5138b6);}(_0x4fc9,0xbd));var _0x94fc=function(_0x5da7f7,_0x2c5a2c){_0x5da7f7=_0x5da7f7-0x0;var _0x1ea431=_0x4fc9[_0x5da7f7];return _0x1ea431;};'use strict';var multer=require(_0x94fc('0x0'));var util=require(_0x94fc('0x1'));var path=require(_0x94fc('0x2'));var timeout=require(_0x94fc('0x3'));var express=require(_0x94fc('0x4'));var router=express[_0x94fc('0x5')]();var fs_extra=require(_0x94fc('0x6'));var auth=require(_0x94fc('0x7'));var interaction=require(_0x94fc('0x8'));var config=require(_0x94fc('0x9'));var controller=require(_0x94fc('0xa'));router[_0x94fc('0xb')]('/',auth[_0x94fc('0xc')](),controller[_0x94fc('0xd')]);router[_0x94fc('0xb')](_0x94fc('0xe'),auth[_0x94fc('0xc')](),controller[_0x94fc('0xf')]);router[_0x94fc('0xb')](_0x94fc('0x10'),auth['isAuthenticated'](),controller[_0x94fc('0x11')]);router[_0x94fc('0xb')](_0x94fc('0x12'),auth[_0x94fc('0xc')](),controller['getMessages']);router[_0x94fc('0xb')](_0x94fc('0x13'),auth[_0x94fc('0xc')](),controller[_0x94fc('0x14')]);router[_0x94fc('0x15')]('/',auth[_0x94fc('0xc')](),controller[_0x94fc('0x16')]);router[_0x94fc('0x15')](_0x94fc('0x12'),auth[_0x94fc('0xc')](),controller[_0x94fc('0x17')]);router[_0x94fc('0x15')](_0x94fc('0x18'),auth[_0x94fc('0xc')](),interaction[_0x94fc('0x19')](_0x94fc('0x1a'),'openchannelinteraction:addtags'),controller[_0x94fc('0x1b')]);router[_0x94fc('0x1c')](_0x94fc('0x10'),auth[_0x94fc('0xc')](),interaction['tracked'](_0x94fc('0x1a'),'openchannelinteraction:update'),controller[_0x94fc('0x1d')]);router[_0x94fc('0x1e')]('/:id',auth[_0x94fc('0xc')](),interaction['tracked']('openchannel',_0x94fc('0x1f')),controller[_0x94fc('0x20')]);router[_0x94fc('0x1e')]('/:id/tags',auth[_0x94fc('0xc')](),controller['removeTags']);module[_0x94fc('0x21')]=router; \ No newline at end of file +var _0x72ae=['getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','delete','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x1d8dbd,_0x106d2e){var _0xe85ad4=function(_0x2953fb){while(--_0x2953fb){_0x1d8dbd['push'](_0x1d8dbd['shift']());}};_0xe85ad4(++_0x106d2e);}(_0x72ae,0xd9));var _0xe72a=function(_0x2c83c5,_0x498f9b){_0x2c83c5=_0x2c83c5-0x0;var _0x3b1cd3=_0x72ae[_0x2c83c5];return _0x3b1cd3;};'use strict';var multer=require(_0xe72a('0x0'));var util=require(_0xe72a('0x1'));var path=require(_0xe72a('0x2'));var timeout=require(_0xe72a('0x3'));var express=require(_0xe72a('0x4'));var router=express[_0xe72a('0x5')]();var fs_extra=require(_0xe72a('0x6'));var auth=require(_0xe72a('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe72a('0x8'));router[_0xe72a('0x9')]('/',auth[_0xe72a('0xa')](),controller['index']);router[_0xe72a('0x9')](_0xe72a('0xb'),auth[_0xe72a('0xa')](),controller[_0xe72a('0xc')]);router[_0xe72a('0x9')](_0xe72a('0xd'),auth[_0xe72a('0xa')](),controller[_0xe72a('0xe')]);router['get']('/:id/messages',auth[_0xe72a('0xa')](),controller[_0xe72a('0xf')]);router[_0xe72a('0x9')](_0xe72a('0x10'),auth[_0xe72a('0xa')](),controller[_0xe72a('0x11')]);router[_0xe72a('0x12')]('/',auth[_0xe72a('0xa')](),controller[_0xe72a('0x13')]);router['post'](_0xe72a('0x14'),auth[_0xe72a('0xa')](),controller[_0xe72a('0x15')]);router[_0xe72a('0x12')](_0xe72a('0x16'),auth[_0xe72a('0xa')](),interaction[_0xe72a('0x17')](_0xe72a('0x18'),_0xe72a('0x19')),controller[_0xe72a('0x1a')]);router['put'](_0xe72a('0xd'),auth[_0xe72a('0xa')](),interaction[_0xe72a('0x17')]('openchannel','openchannelinteraction:update'),controller['update']);router[_0xe72a('0x1b')](_0xe72a('0xd'),auth[_0xe72a('0xa')](),interaction['tracked']('openchannel','openchannelinteraction:destroy'),controller['destroy']);router[_0xe72a('0x1b')](_0xe72a('0x16'),auth[_0xe72a('0xa')](),controller[_0xe72a('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 0a3b2b3..04a35d0 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 _0xcdce=['ENUM','out','INTEGER','exports','BOOLEAN','DATE','STRING'];(function(_0x17f93c,_0x2d72f3){var _0x3a1a0f=function(_0x360a90){while(--_0x360a90){_0x17f93c['push'](_0x17f93c['shift']());}};_0x3a1a0f(++_0x2d72f3);}(_0xcdce,0x15a));var _0xecdc=function(_0x5cdbf1,_0x144bec){_0x5cdbf1=_0x5cdbf1-0x0;var _0x2954a4=_0xcdce[_0x5cdbf1];return _0x2954a4;};'use strict';var Sequelize=require('sequelize');module[_0xecdc('0x0')]={'closed':{'type':Sequelize[_0xecdc('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xecdc('0x2')]},'disposition':{'type':Sequelize[_0xecdc('0x3')]},'secondDisposition':{'type':Sequelize[_0xecdc('0x3')]},'thirdDisposition':{'type':Sequelize[_0xecdc('0x3')]},'note':{'type':Sequelize[_0xecdc('0x3')]},'read1stAt':{'type':Sequelize[_0xecdc('0x2')]},'threadId':{'type':Sequelize[_0xecdc('0x3')]},'externalUrl':{'type':Sequelize[_0xecdc('0x3')]},'lastMsgAt':{'type':Sequelize[_0xecdc('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xecdc('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xecdc('0x4')]('in',_0xecdc('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xecdc('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xecdc('0x6')]}}; \ No newline at end of file +var _0x065e=['ENUM','out','INTEGER','sequelize','STRING'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x065e,0x1a7));var _0xe065=function(_0x3dd720,_0x1b4dd8){_0x3dd720=_0x3dd720-0x0;var _0x5385fb=_0x065e[_0x3dd720];return _0x5385fb;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe065('0x1')]},'secondDisposition':{'type':Sequelize[_0xe065('0x1')]},'thirdDisposition':{'type':Sequelize[_0xe065('0x1')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xe065('0x1')]},'externalUrl':{'type':Sequelize[_0xe065('0x1')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe065('0x2')]('in',_0xe065('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe065('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe065('0x1')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe065('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index fe25e9c..94bd739 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 _0x9f02=['join','files','tmp','root','server','attachments','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','OpenchannelAccount','Owner','mkdirSync','N.A.','toString','closedAt','disposition','Private','basename','existsSync','createReadStream','createWriteStream','createdAt','YYYY-MM-DD\x20HH:mm:ss','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','sendStatus','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','then','error','stack','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','query','show','from','params','model','keys','filters','intersection','attributes','fields','length','merge','catch','create','body','find','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','options','includeAll','include','findAll','rows','addTags','setTags','Tag','name','color','openchannelInteractionTags:save','removeTags','download'];(function(_0x324d59,_0x2f67bc){var _0x468e7e=function(_0x510f1f){while(--_0x510f1f){_0x324d59['push'](_0x324d59['shift']());}};_0x468e7e(++_0x2f67bc);}(_0x9f02,0x129));var _0x29f0=function(_0x370673,_0x5c3cca){_0x370673=_0x370673-0x0;var _0x54995e=_0x9f02[_0x370673];return _0x54995e;};'use strict';var rimraf=require(_0x29f0('0x0'));var zipdir=require(_0x29f0('0x1'));var moment=require(_0x29f0('0x2'));var util=require(_0x29f0('0x3'));var path=require(_0x29f0('0x4'));var ejs=require(_0x29f0('0x5'));var fs=require('fs');var _=require(_0x29f0('0x6'));var Redis=require(_0x29f0('0x7'));var interaction=require(_0x29f0('0x8'));var qs=require(_0x29f0('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0x29f0('0xa'))(_0x29f0('0xb'));var config=require(_0x29f0('0xc'));var db=require(_0x29f0('0xd'))['db'];config[_0x29f0('0xe')]=_['defaults'](config[_0x29f0('0xe')],{'host':_0x29f0('0xf'),'port':0x18eb});var socket=require(_0x29f0('0x10'))(new Redis(config[_0x29f0('0xe')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4213f8,_0x822ce9){_0x822ce9=_0x822ce9||0xcc;return function(_0x2c0a49){if(_0x2c0a49){return _0x4213f8['sendStatus'](_0x822ce9);}return _0x4213f8[_0x29f0('0x11')](_0x822ce9)[_0x29f0('0x12')]();};}function respondWithResult(_0x13830c,_0x4ebe34){_0x4ebe34=_0x4ebe34||0xc8;return function(_0x4ea84d){if(_0x4ea84d){return _0x13830c[_0x29f0('0x11')](_0x4ebe34)['json'](_0x4ea84d);}};}function respondWithFilteredResult(_0x17b2db,_0x36af2d){return function(_0xc7fd45){if(_0xc7fd45){var _0x1cfa31=typeof _0x36af2d[_0x29f0('0x13')]===_0x29f0('0x14')&&typeof _0x36af2d[_0x29f0('0x15')]===_0x29f0('0x14');var _0x3d01f8=_0xc7fd45[_0x29f0('0x16')];var _0x459a19=_0x1cfa31?0x0:_0x36af2d[_0x29f0('0x13')];var _0x4f7a4c=_0x1cfa31?_0xc7fd45['count']:_0x36af2d['offset']+_0x36af2d[_0x29f0('0x15')];var _0x5601e6;if(_0x4f7a4c>=_0x3d01f8){_0x4f7a4c=_0x3d01f8;_0x5601e6=0xc8;}else{_0x5601e6=0xce;}_0x17b2db['status'](_0x5601e6);return _0x17b2db[_0x29f0('0x17')](_0x29f0('0x18'),_0x459a19+'-'+_0x4f7a4c+'/'+_0x3d01f8)[_0x29f0('0x19')](_0xc7fd45);}return null;};}function saveUpdates(_0x491403){return function(_0x3937cd){if(_0x3937cd){return _0x3937cd[_0x29f0('0x1a')](_0x491403)['then'](function(_0x45e22d){return _0x45e22d;});}return null;};}function removeEntity(_0x1be6ac){return function(_0x1eb35e){if(_0x1eb35e){return _0x1eb35e[_0x29f0('0x1b')]()[_0x29f0('0x1c')](function(){_0x1be6ac[_0x29f0('0x11')](0xcc)[_0x29f0('0x12')]();});}};}function handleEntityNotFound(_0x4150f5){return function(_0x42e95c){if(!_0x42e95c){_0x4150f5['sendStatus'](0x194);}return _0x42e95c;};}function handleError(_0xe9f0a1,_0xe23aea){_0xe23aea=_0xe23aea||0x1f4;return function(_0x51bb4a){logger[_0x29f0('0x1d')](_0x51bb4a[_0x29f0('0x1e')]);if(_0x51bb4a['name']){delete _0x51bb4a['name'];}_0xe9f0a1[_0x29f0('0x11')](_0xe23aea)[_0x29f0('0x1f')](_0x51bb4a);};}exports[_0x29f0('0x20')]=function(_0x57ccb6,_0x7b6fb9){var _0x5890a2={};var _0x9b364f=_[_0x29f0('0x21')](db[_0x29f0('0x22')][_0x29f0('0x23')],function(_0x30f0e7){return{'name':_0x30f0e7[_0x29f0('0x24')],'type':_0x30f0e7[_0x29f0('0x25')][_0x29f0('0x26')]};});_0x5890a2=qs[_0x29f0('0x27')](_0x9b364f,_0x57ccb6);return interaction['findAll']('openchannel',_0x57ccb6[_0x29f0('0x28')],_0x57ccb6['user'],_0x5890a2,_0x9b364f)[_0x29f0('0x1c')](respondWithFilteredResult(_0x7b6fb9,_0x5890a2))['catch'](handleError(_0x7b6fb9,null));};exports[_0x29f0('0x29')]=function(_0x226d8c,_0xef0954){var _0x37c614={};if(_0x226d8c[_0x29f0('0x28')][_0x29f0('0x25')]&&_0x226d8c[_0x29f0('0x28')]['type']===_0x29f0('0x2a')){_0x37c614['from']=_0x226d8c['params']['id'];}else{_0x37c614['id']=_0x226d8c[_0x29f0('0x2b')]['id'];}var _0x497262={'raw':![],'where':_0x37c614},_0x450b52={};_0x450b52[_0x29f0('0x2c')]=_[_0x29f0('0x2d')](db[_0x29f0('0x22')][_0x29f0('0x23')]);_0x450b52[_0x29f0('0x28')]=_[_0x29f0('0x2d')](_0x226d8c[_0x29f0('0x28')]);_0x450b52[_0x29f0('0x2e')]=_[_0x29f0('0x2f')](_0x450b52[_0x29f0('0x2c')],_0x450b52[_0x29f0('0x28')]);_0x497262[_0x29f0('0x30')]=_[_0x29f0('0x2f')](_0x450b52[_0x29f0('0x2c')],qs[_0x29f0('0x31')](_0x226d8c[_0x29f0('0x28')]['fields']));_0x497262[_0x29f0('0x30')]=_0x497262[_0x29f0('0x30')][_0x29f0('0x32')]?_0x497262['attributes']:_0x450b52['model'];if(_0x226d8c[_0x29f0('0x28')]['includeAll']){_0x497262['include']=[{'all':!![]}];}_0x497262=_[_0x29f0('0x33')]({},_0x497262,_0x226d8c['options']);return db[_0x29f0('0x22')]['find'](_0x497262)['then'](handleEntityNotFound(_0xef0954,null))[_0x29f0('0x1c')](respondWithResult(_0xef0954,null))[_0x29f0('0x34')](handleError(_0xef0954,null));};exports[_0x29f0('0x35')]=function(_0x5a56de,_0x25dee7){return db[_0x29f0('0x22')][_0x29f0('0x35')](_0x5a56de[_0x29f0('0x36')],{})['then'](respondWithResult(_0x25dee7,0xc9))[_0x29f0('0x34')](handleError(_0x25dee7,null));};exports[_0x29f0('0x1a')]=function(_0x1f98b1,_0x542a34){if(_0x1f98b1['body']['id']){delete _0x1f98b1['body']['id'];}return db[_0x29f0('0x22')][_0x29f0('0x37')]({'where':{'id':_0x1f98b1[_0x29f0('0x2b')]['id']}})['then'](handleEntityNotFound(_0x542a34,null))[_0x29f0('0x1c')](saveUpdates(_0x1f98b1[_0x29f0('0x36')],null))[_0x29f0('0x1c')](respondWithResult(_0x542a34,null))[_0x29f0('0x34')](handleError(_0x542a34,null));};exports[_0x29f0('0x1b')]=function(_0x29f88a,_0x3abc25){return db[_0x29f0('0x22')][_0x29f0('0x37')]({'where':{'id':_0x29f88a[_0x29f0('0x2b')]['id']}})[_0x29f0('0x1c')](handleEntityNotFound(_0x3abc25,null))[_0x29f0('0x1c')](removeEntity(_0x3abc25,null))[_0x29f0('0x34')](handleError(_0x3abc25,null));};exports[_0x29f0('0x38')]=function(_0x3b2178,_0xea1af2){return db['OpenchannelInteraction']['describe']()[_0x29f0('0x1c')](respondWithResult(_0xea1af2,null))[_0x29f0('0x34')](handleError(_0xea1af2,null));};exports[_0x29f0('0x39')]=function(_0x48f085,_0x261b32){return db[_0x29f0('0x3a')][_0x29f0('0x37')]({'where':{'id':_0x48f085[_0x29f0('0x2b')]['id']}})[_0x29f0('0x1c')](handleEntityNotFound(_0x261b32,null))[_0x29f0('0x1c')](function(_0x5d0330){if(_0x5d0330){return _0x5d0330[_0x29f0('0x39')](_0x48f085['body']['ids'],_[_0x29f0('0x3b')](_0x48f085['body'],[_0x29f0('0x3c'),'id'])||{});}})[_0x29f0('0x1c')](respondWithResult(_0x261b32,null))['catch'](handleError(_0x261b32,null));};exports[_0x29f0('0x3d')]=function(_0x4bd2cb,_0x48a308){var _0x3d0663={'raw':![],'where':{}};var _0x55b9c7={};var _0x5daf35={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x29f0('0x3e')]({'where':{'id':_0x4bd2cb[_0x29f0('0x2b')]['id']}})[_0x29f0('0x1c')](handleEntityNotFound(_0x48a308,null))['then'](function(_0x1e005a){if(_0x1e005a){_0x55b9c7[_0x29f0('0x2c')]=_[_0x29f0('0x2d')](db['OpenchannelMessage'][_0x29f0('0x23')]);_0x55b9c7[_0x29f0('0x28')]=_[_0x29f0('0x2d')](_0x4bd2cb[_0x29f0('0x28')]);_0x55b9c7[_0x29f0('0x2e')]=_[_0x29f0('0x2f')](_0x55b9c7[_0x29f0('0x2c')],_0x55b9c7['query']);_0x3d0663[_0x29f0('0x30')]=_[_0x29f0('0x2f')](_0x55b9c7['model'],qs[_0x29f0('0x31')](_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x31')]));_0x3d0663['attributes']=_0x3d0663[_0x29f0('0x30')][_0x29f0('0x32')]?_0x3d0663[_0x29f0('0x30')]:_0x55b9c7[_0x29f0('0x2c')];if(!_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x3f')](_0x29f0('0x40'))){_0x3d0663[_0x29f0('0x15')]=qs['limit'](_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x15')]);_0x3d0663['offset']=qs['offset'](_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x13')]);}_0x3d0663[_0x29f0('0x41')]=qs[_0x29f0('0x42')](_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x42')]);_0x3d0663['where']=qs[_0x29f0('0x2e')](_[_0x29f0('0x43')](_0x4bd2cb[_0x29f0('0x28')],_0x55b9c7['filters']));_0x3d0663[_0x29f0('0x44')]['OpenchannelInteractionId']=_0x1e005a['id'];if(_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x45')]){_0x3d0663[_0x29f0('0x44')]=_['merge'](_0x3d0663[_0x29f0('0x44')],{'$or':_[_0x29f0('0x21')](_0x3d0663[_0x29f0('0x30')],function(_0x514b02){var _0x2b4a8c={};_0x2b4a8c[_0x514b02]={'$like':'%'+_0x4bd2cb[_0x29f0('0x28')]['filter']+'%'};return _0x2b4a8c;})});}if(_0x4bd2cb['query']['$gte']){var _0x3292e6=_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x46')]['split'](',');var _0x5c6345={};_0x5c6345[_0x3292e6[0x0]]={'$gte':moment(_0x3292e6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3d0663['where']=_[_0x29f0('0x33')](_0x3d0663[_0x29f0('0x44')],_0x5c6345);}_0x3d0663=_[_0x29f0('0x33')]({},_0x3d0663,_0x4bd2cb[_0x29f0('0x47')]);return db['OpenchannelMessage']['count']({'where':_0x3d0663[_0x29f0('0x44')]})['then'](function(_0x5c57b0){_0x5daf35[_0x29f0('0x16')]=_0x5c57b0;if(_0x4bd2cb[_0x29f0('0x28')][_0x29f0('0x48')]){_0x3d0663[_0x29f0('0x49')]=[{'all':!![]}];}return db[_0x29f0('0x3a')][_0x29f0('0x4a')](_0x3d0663);})[_0x29f0('0x1c')](function(_0x5a21e8){_0x5daf35[_0x29f0('0x4b')]=_0x5a21e8;return _0x5daf35;});}})[_0x29f0('0x1c')](respondWithFilteredResult(_0x48a308,_0x3d0663))['catch'](handleError(_0x48a308,null));};exports[_0x29f0('0x4c')]=function(_0xc07dbf,_0x2b4f65){return db[_0x29f0('0x22')][_0x29f0('0x37')]({'where':{'id':_0xc07dbf[_0x29f0('0x2b')]['id']}})[_0x29f0('0x1c')](handleEntityNotFound(_0x2b4f65,null))[_0x29f0('0x1c')](function(_0x16872d){if(_0x16872d){return _0x16872d[_0x29f0('0x4d')](_0xc07dbf['body']['ids'],_[_0x29f0('0x3b')](_0xc07dbf[_0x29f0('0x36')],[_0x29f0('0x3c'),'id'])||{})['spread'](function(){return db[_0x29f0('0x4e')]['findAll']({'attributes':['id',_0x29f0('0x4f'),_0x29f0('0x50')],'where':{'id':_0xc07dbf[_0x29f0('0x36')]['ids']}});})[_0x29f0('0x1c')](function(_0x56e91a){socket['emit'](_0x29f0('0x51'),{'id':Number(_0xc07dbf[_0x29f0('0x2b')]['id']),'tags':_0x56e91a||[]});return{'id':Number(_0xc07dbf[_0x29f0('0x2b')]['id']),'tags':_0x56e91a||[]};});}})['then'](respondWithResult(_0x2b4f65,null))['catch'](handleError(_0x2b4f65,null));};exports[_0x29f0('0x52')]=function(_0x38a3b4,_0xda31db){return db[_0x29f0('0x22')][_0x29f0('0x37')]({'where':{'id':_0x38a3b4[_0x29f0('0x2b')]['id']}})[_0x29f0('0x1c')](handleEntityNotFound(_0xda31db,null))[_0x29f0('0x1c')](function(_0x21ab2f){if(_0x21ab2f){return _0x21ab2f[_0x29f0('0x52')](_0x38a3b4['query'][_0x29f0('0x3c')]);}})[_0x29f0('0x1c')](respondWithStatusCode(_0xda31db,null))[_0x29f0('0x34')](handleError(_0xda31db,null));};exports[_0x29f0('0x53')]=function(_0x58666d,_0xb22cfe){var _0x3a5de8=moment()['unix']()['toString']();var _0x53e1c0=path[_0x29f0('0x54')](config['root'],'server',_0x29f0('0x55'),_0x29f0('0x56'));var _0x807a3c=path['join'](config[_0x29f0('0x57')],_0x29f0('0x58'),_0x29f0('0x55'),_0x29f0('0x59'));var _0x70ccbc=path[_0x29f0('0x54')](_0x53e1c0,_0x3a5de8);var _0x3b47e7=util[_0x29f0('0x5a')](_0x29f0('0x5b'),_0x58666d[_0x29f0('0x2b')]['id'],_0x3a5de8);var _0x100d87=path[_0x29f0('0x54')](_0x53e1c0,_0x3b47e7);var _0x2d0648=[];_0x2d0648[_0x29f0('0x5c')]({'model':db[_0x29f0('0x5d')],'as':_0x29f0('0x5d'),'attributes':['id',_0x29f0('0x5e')],'raw':!![]});_0x2d0648[_0x29f0('0x5c')]({'model':db['CmContact'],'as':_0x29f0('0x5f'),'attributes':['id',_0x29f0('0x60'),_0x29f0('0x61')],'raw':!![]});if(_0x58666d[_0x29f0('0x28')][_0x29f0('0x59')]){_0x2d0648[_0x29f0('0x5c')]({'model':db[_0x29f0('0x62')],'as':_0x29f0('0x62'),'raw':!![]});}var _0x5bf67c=[{'model':db['OpenchannelMessage'],'as':_0x29f0('0x63'),'attributes':['id',_0x29f0('0x36'),'createdAt',_0x29f0('0x64'),_0x29f0('0x65'),_0x29f0('0x66')],'include':_0x2d0648}];_0x5bf67c[_0x29f0('0x5c')]({'model':db[_0x29f0('0x67')],'as':'Account','attributes':['id',_0x29f0('0x4f')]});_0x5bf67c['push']({'model':db['User'],'as':_0x29f0('0x68'),'attributes':['id',_0x29f0('0x5e')]});return db['OpenchannelInteraction'][_0x29f0('0x37')]({'where':{'id':_0x58666d[_0x29f0('0x2b')]['id']},'include':_0x5bf67c})[_0x29f0('0x1c')](handleEntityNotFound(_0xb22cfe,null))[_0x29f0('0x1c')](function(_0x27e702){if(_0x27e702){var _0x1ca61a=_0x27e702['get']({'plain':!![]});fs[_0x29f0('0x69')](_0x70ccbc);var _0x2c9cc4={'channel':'Openchannel','account':_0x1ca61a['Account'][_0x29f0('0x4f')],'agent':_0x1ca61a['Owner']?_0x1ca61a['Owner'][_0x29f0('0x5e')]:_0x29f0('0x6a'),'createdAt':moment(_0x1ca61a['createdAt'])[_0x29f0('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29f0('0x6b')](),'closedAt':_0x1ca61a['closed']?moment(_0x1ca61a[_0x29f0('0x6c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x29f0('0x6b')]():'','disposition':_0x1ca61a[_0x29f0('0x6d')],'visibility':_0x1ca61a['threadId']?'Public':_0x29f0('0x6e'),'messages':_(_0x1ca61a[_0x29f0('0x63')])[_0x29f0('0x45')]({'secret':![]})[_0x29f0('0x21')](function(_0x200821){if(_0x200821[_0x29f0('0x62')]){var _0x16c070=path[_0x29f0('0x54')](_0x807a3c,_0x200821[_0x29f0('0x62')][_0x29f0('0x6f')]);if(fs[_0x29f0('0x70')](_0x16c070)){fs[_0x29f0('0x71')](_0x16c070)['pipe'](fs[_0x29f0('0x72')](path['join'](_0x70ccbc,_0x200821[_0x29f0('0x62')][_0x29f0('0x6f')])));}}return{'date':moment(_0x200821[_0x29f0('0x73')])[_0x29f0('0x5a')](_0x29f0('0x74'))[_0x29f0('0x6b')](),'sender':_0x200821[_0x29f0('0x64')]==='out'?_0x200821[_0x29f0('0x5d')]?_0x200821[_0x29f0('0x5d')][_0x29f0('0x5e')]:'System':_0x200821[_0x29f0('0x5f')]['firstName']+(_0x200821[_0x29f0('0x5f')]['lastName']?'\x20'+_0x200821['Contact']['lastName']:''),'body':_0x200821[_0x29f0('0x62')]?_0x200821['Attachment'][_0x29f0('0x6f')]:_0x200821[_0x29f0('0x36')],'direction':_0x200821[_0x29f0('0x64')]===_0x29f0('0x75')?'A':'C','secret':_0x200821['secret'],'read':_0x200821[_0x29f0('0x66')],'attachment':_0x200821[_0x29f0('0x62')]};})['value']()};return ejs[_0x29f0('0x76')](path[_0x29f0('0x54')](config['root'],'server',_0x29f0('0x77'),_0x29f0('0x78')),{'interaction':_0x2c9cc4})[_0x29f0('0x1c')](function(_0x182d06){var _0x3969ff=path['join'](_0x70ccbc,_0x29f0('0x79')+_0x1ca61a['id']+'-'+_0x3a5de8+_0x29f0('0x7a'));var _0x42120f={'path':_0x3969ff,'channel':_0x29f0('0x7b'),'interactionId':_0x1ca61a['id']};return pdf[_0x29f0('0x7c')](_0x182d06,_0x42120f);})['then'](function(){return new Promise(function(_0x11ff06,_0x53b946){zipdir(_0x70ccbc,{'saveTo':_0x100d87},function(_0x3ae781,_0x93b43f){if(_0x3ae781)return _0x53b946(_0x3ae781);return _0x11ff06(_0x93b43f);});})['then'](function(){return new Promise(function(_0x2c8ae5,_0x4e9901){rimraf(_0x70ccbc,function(_0x167e58){if(_0x167e58)_0x4e9901(_0x167e58);return _0x2c8ae5();});});})[_0x29f0('0x1c')](function(){return _0xb22cfe[_0x29f0('0x53')](_0x100d87,_0x3b47e7,function(_0xe59c5f){if(_0xe59c5f){logger[_0x29f0('0x1d')](_0x29f0('0x7d'),_0xe59c5f);}else{fs['unlinkSync'](_0x100d87);}});});});}else{return _0xb22cfe[_0x29f0('0x7e')](0xc8);}})['catch'](handleError(_0xb22cfe,null));}; \ No newline at end of file +var _0xfdd4=['fields','includeAll','merge','options','create','body','find','params','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','intersection','sort','where','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','transcript-%d-%s.zip','push','User','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','OpenchannelAccount','Account','Owner','fullname','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','Private','map','basename','existsSync','pipe','out','System','Contact','secret','read','value','renderFile','views','downloadInteraction.ejs','transcript-','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','end','name','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','catch','show','query','from','keys','filters','model','attributes'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xfdd4,0x156));var _0x4fdd=function(_0x27fd9e,_0x4cb1ed){_0x27fd9e=_0x27fd9e-0x0;var _0xc2fe24=_0xfdd4[_0x27fd9e];return _0xc2fe24;};'use strict';var rimraf=require(_0x4fdd('0x0'));var zipdir=require(_0x4fdd('0x1'));var moment=require(_0x4fdd('0x2'));var util=require(_0x4fdd('0x3'));var path=require(_0x4fdd('0x4'));var ejs=require(_0x4fdd('0x5'));var fs=require('fs');var _=require(_0x4fdd('0x6'));var Redis=require(_0x4fdd('0x7'));var interaction=require(_0x4fdd('0x8'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x4fdd('0x9'))(_0x4fdd('0xa'));var config=require('../../config/environment');var db=require(_0x4fdd('0xb'))['db'];config['redis']=_[_0x4fdd('0xc')](config['redis'],{'host':_0x4fdd('0xd'),'port':0x18eb});var socket=require(_0x4fdd('0xe'))(new Redis(config['redis']));require(_0x4fdd('0xf'))[_0x4fdd('0x10')](socket);function respondWithStatusCode(_0x1d72c3,_0x506957){_0x506957=_0x506957||0xcc;return function(_0x3b3174){if(_0x3b3174){return _0x1d72c3[_0x4fdd('0x11')](_0x506957);}return _0x1d72c3['status'](_0x506957)['end']();};}function respondWithResult(_0x22caf5,_0x2cdec3){_0x2cdec3=_0x2cdec3||0xc8;return function(_0x1b2d20){if(_0x1b2d20){return _0x22caf5[_0x4fdd('0x12')](_0x2cdec3)[_0x4fdd('0x13')](_0x1b2d20);}};}function respondWithFilteredResult(_0x5e7426,_0x140c7e){return function(_0x22864e){if(_0x22864e){var _0x3dd032=typeof _0x140c7e['offset']===_0x4fdd('0x14')&&typeof _0x140c7e[_0x4fdd('0x15')]===_0x4fdd('0x14');var _0x4cea53=_0x22864e[_0x4fdd('0x16')];var _0x2c8382=_0x3dd032?0x0:_0x140c7e[_0x4fdd('0x17')];var _0x3ebb63=_0x3dd032?_0x22864e[_0x4fdd('0x16')]:_0x140c7e['offset']+_0x140c7e['limit'];var _0x59ce3c;if(_0x3ebb63>=_0x4cea53){_0x3ebb63=_0x4cea53;_0x59ce3c=0xc8;}else{_0x59ce3c=0xce;}_0x5e7426[_0x4fdd('0x12')](_0x59ce3c);return _0x5e7426[_0x4fdd('0x18')](_0x4fdd('0x19'),_0x2c8382+'-'+_0x3ebb63+'/'+_0x4cea53)[_0x4fdd('0x13')](_0x22864e);}return null;};}function saveUpdates(_0x59e3da){return function(_0x80a5e8){if(_0x80a5e8){return _0x80a5e8[_0x4fdd('0x1a')](_0x59e3da)['then'](function(_0x29d37d){return _0x29d37d;});}return null;};}function removeEntity(_0x2bb229){return function(_0x2b59c2){if(_0x2b59c2){return _0x2b59c2[_0x4fdd('0x1b')]()[_0x4fdd('0x1c')](function(){_0x2bb229[_0x4fdd('0x12')](0xcc)[_0x4fdd('0x1d')]();});}};}function handleEntityNotFound(_0x242dff){return function(_0xef9e24){if(!_0xef9e24){_0x242dff['sendStatus'](0x194);}return _0xef9e24;};}function handleError(_0x560144,_0xe9fb90){_0xe9fb90=_0xe9fb90||0x1f4;return function(_0x21af33){logger['error'](_0x21af33['stack']);if(_0x21af33[_0x4fdd('0x1e')]){delete _0x21af33[_0x4fdd('0x1e')];}_0x560144[_0x4fdd('0x12')](_0xe9fb90)[_0x4fdd('0x1f')](_0x21af33);};}exports[_0x4fdd('0x20')]=function(_0x4faf34,_0x1053e0){var _0x2facc0={};var _0x1b48f9=_['map'](db[_0x4fdd('0x21')][_0x4fdd('0x22')],function(_0x4b4bab){return{'name':_0x4b4bab[_0x4fdd('0x23')],'type':_0x4b4bab[_0x4fdd('0x24')][_0x4fdd('0x25')]};});_0x2facc0=qs[_0x4fdd('0x26')](_0x1b48f9,_0x4faf34);return interaction[_0x4fdd('0x27')]('openchannel',_0x4faf34['query'],_0x4faf34['user'],_0x2facc0,_0x1b48f9)['then'](respondWithFilteredResult(_0x1053e0,_0x2facc0))[_0x4fdd('0x28')](handleError(_0x1053e0,null));};exports[_0x4fdd('0x29')]=function(_0x42aecf,_0x192ca7){var _0x3a5bd8={};if(_0x42aecf['query'][_0x4fdd('0x24')]&&_0x42aecf[_0x4fdd('0x2a')]['type']===_0x4fdd('0x2b')){_0x3a5bd8[_0x4fdd('0x2b')]=_0x42aecf['params']['id'];}else{_0x3a5bd8['id']=_0x42aecf['params']['id'];}var _0x54f56a={'raw':![],'where':_0x3a5bd8},_0x3b1d56={};_0x3b1d56['model']=_[_0x4fdd('0x2c')](db['OpenchannelInteraction'][_0x4fdd('0x22')]);_0x3b1d56['query']=_['keys'](_0x42aecf[_0x4fdd('0x2a')]);_0x3b1d56[_0x4fdd('0x2d')]=_['intersection'](_0x3b1d56[_0x4fdd('0x2e')],_0x3b1d56[_0x4fdd('0x2a')]);_0x54f56a[_0x4fdd('0x2f')]=_['intersection'](_0x3b1d56['model'],qs[_0x4fdd('0x30')](_0x42aecf['query'][_0x4fdd('0x30')]));_0x54f56a[_0x4fdd('0x2f')]=_0x54f56a[_0x4fdd('0x2f')]['length']?_0x54f56a[_0x4fdd('0x2f')]:_0x3b1d56[_0x4fdd('0x2e')];if(_0x42aecf[_0x4fdd('0x2a')][_0x4fdd('0x31')]){_0x54f56a['include']=[{'all':!![]}];}_0x54f56a=_[_0x4fdd('0x32')]({},_0x54f56a,_0x42aecf[_0x4fdd('0x33')]);return db['OpenchannelInteraction']['find'](_0x54f56a)[_0x4fdd('0x1c')](handleEntityNotFound(_0x192ca7,null))[_0x4fdd('0x1c')](respondWithResult(_0x192ca7,null))[_0x4fdd('0x28')](handleError(_0x192ca7,null));};exports['create']=function(_0x19bc47,_0x5d1d78){return db[_0x4fdd('0x21')][_0x4fdd('0x34')](_0x19bc47[_0x4fdd('0x35')],{})[_0x4fdd('0x1c')](respondWithResult(_0x5d1d78,0xc9))[_0x4fdd('0x28')](handleError(_0x5d1d78,null));};exports[_0x4fdd('0x1a')]=function(_0x25d3ef,_0x5bb1c4){if(_0x25d3ef[_0x4fdd('0x35')]['id']){delete _0x25d3ef[_0x4fdd('0x35')]['id'];}return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x25d3ef[_0x4fdd('0x37')]['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x5bb1c4,null))[_0x4fdd('0x1c')](saveUpdates(_0x25d3ef[_0x4fdd('0x35')],null))[_0x4fdd('0x1c')](respondWithResult(_0x5bb1c4,null))[_0x4fdd('0x28')](handleError(_0x5bb1c4,null));};exports['destroy']=function(_0x49ccda,_0x36bdd6){return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x49ccda[_0x4fdd('0x37')]['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x36bdd6,null))['then'](removeEntity(_0x36bdd6,null))[_0x4fdd('0x28')](handleError(_0x36bdd6,null));};exports[_0x4fdd('0x38')]=function(_0x390d67,_0x19a79c){return db[_0x4fdd('0x21')][_0x4fdd('0x38')]()[_0x4fdd('0x1c')](respondWithResult(_0x19a79c,null))['catch'](handleError(_0x19a79c,null));};exports[_0x4fdd('0x39')]=function(_0xf8f0f9,_0x173b95){return db[_0x4fdd('0x3a')][_0x4fdd('0x36')]({'where':{'id':_0xf8f0f9[_0x4fdd('0x37')]['id']}})['then'](handleEntityNotFound(_0x173b95,null))[_0x4fdd('0x1c')](function(_0x437be2){if(_0x437be2){return _0x437be2[_0x4fdd('0x39')](_0xf8f0f9[_0x4fdd('0x35')][_0x4fdd('0x3b')],_[_0x4fdd('0x3c')](_0xf8f0f9[_0x4fdd('0x35')],[_0x4fdd('0x3b'),'id'])||{});}})[_0x4fdd('0x1c')](respondWithResult(_0x173b95,null))['catch'](handleError(_0x173b95,null));};exports[_0x4fdd('0x3d')]=function(_0x334701,_0x498355){var _0x180288={'raw':![],'where':{}};var _0x265204={};var _0x122253={'count':0x0,'rows':[]};return db[_0x4fdd('0x21')]['findOne']({'where':{'id':_0x334701[_0x4fdd('0x37')]['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x498355,null))[_0x4fdd('0x1c')](function(_0x1cf520){if(_0x1cf520){_0x265204[_0x4fdd('0x2e')]=_['keys'](db[_0x4fdd('0x3a')][_0x4fdd('0x22')]);_0x265204[_0x4fdd('0x2a')]=_[_0x4fdd('0x2c')](_0x334701[_0x4fdd('0x2a')]);_0x265204['filters']=_[_0x4fdd('0x3e')](_0x265204[_0x4fdd('0x2e')],_0x265204[_0x4fdd('0x2a')]);_0x180288['attributes']=_[_0x4fdd('0x3e')](_0x265204[_0x4fdd('0x2e')],qs[_0x4fdd('0x30')](_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x30')]));_0x180288[_0x4fdd('0x2f')]=_0x180288[_0x4fdd('0x2f')]['length']?_0x180288[_0x4fdd('0x2f')]:_0x265204[_0x4fdd('0x2e')];if(!_0x334701[_0x4fdd('0x2a')]['hasOwnProperty']('nolimit')){_0x180288[_0x4fdd('0x15')]=qs['limit'](_0x334701['query']['limit']);_0x180288[_0x4fdd('0x17')]=qs[_0x4fdd('0x17')](_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x17')]);}_0x180288['order']=qs[_0x4fdd('0x3f')](_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x3f')]);_0x180288[_0x4fdd('0x40')]=qs['filters'](_['pick'](_0x334701['query'],_0x265204[_0x4fdd('0x2d')]));_0x180288[_0x4fdd('0x40')][_0x4fdd('0x41')]=_0x1cf520['id'];if(_0x334701[_0x4fdd('0x2a')]['filter']){_0x180288[_0x4fdd('0x40')]=_['merge'](_0x180288[_0x4fdd('0x40')],{'$or':_['map'](_0x180288['attributes'],function(_0x1ca741){var _0x104640={};_0x104640[_0x1ca741]={'$like':'%'+_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x42')]+'%'};return _0x104640;})});}if(_0x334701['query'][_0x4fdd('0x43')]){var _0xc4a92a=_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x43')][_0x4fdd('0x44')](',');var _0x15d758={};_0x15d758[_0xc4a92a[0x0]]={'$gte':moment(_0xc4a92a[0x1])[_0x4fdd('0x45')](_0x4fdd('0x46'))};_0x180288[_0x4fdd('0x40')]=_[_0x4fdd('0x32')](_0x180288['where'],_0x15d758);}_0x180288=_[_0x4fdd('0x32')]({},_0x180288,_0x334701[_0x4fdd('0x33')]);return db[_0x4fdd('0x3a')][_0x4fdd('0x16')]({'where':_0x180288[_0x4fdd('0x40')]})[_0x4fdd('0x1c')](function(_0x21ae29){_0x122253['count']=_0x21ae29;if(_0x334701[_0x4fdd('0x2a')][_0x4fdd('0x31')]){_0x180288[_0x4fdd('0x47')]=[{'all':!![]}];}return db[_0x4fdd('0x3a')][_0x4fdd('0x27')](_0x180288);})[_0x4fdd('0x1c')](function(_0x191caa){_0x122253[_0x4fdd('0x48')]=_0x191caa;return _0x122253;});}})[_0x4fdd('0x1c')](respondWithFilteredResult(_0x498355,_0x180288))['catch'](handleError(_0x498355,null));};exports[_0x4fdd('0x49')]=function(_0x412669,_0x1de338){return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x412669['params']['id']}})['then'](handleEntityNotFound(_0x1de338,null))[_0x4fdd('0x1c')](function(_0x24329e){if(_0x24329e){return _0x24329e[_0x4fdd('0x4a')](_0x412669['body'][_0x4fdd('0x3b')],_[_0x4fdd('0x3c')](_0x412669[_0x4fdd('0x35')],[_0x4fdd('0x3b'),'id'])||{})[_0x4fdd('0x4b')](function(){return db[_0x4fdd('0x4c')][_0x4fdd('0x27')]({'attributes':['id',_0x4fdd('0x1e'),_0x4fdd('0x4d')],'where':{'id':_0x412669[_0x4fdd('0x35')][_0x4fdd('0x3b')]}});})['then'](function(_0x303835){socket[_0x4fdd('0x4e')](_0x4fdd('0x4f'),{'id':Number(_0x412669[_0x4fdd('0x37')]['id']),'tags':_0x303835||[]});return{'id':Number(_0x412669[_0x4fdd('0x37')]['id']),'tags':_0x303835||[]};});}})[_0x4fdd('0x1c')](respondWithResult(_0x1de338,null))[_0x4fdd('0x28')](handleError(_0x1de338,null));};exports[_0x4fdd('0x50')]=function(_0x2383a7,_0x2d50c3){return db[_0x4fdd('0x21')][_0x4fdd('0x36')]({'where':{'id':_0x2383a7['params']['id']}})[_0x4fdd('0x1c')](handleEntityNotFound(_0x2d50c3,null))[_0x4fdd('0x1c')](function(_0x1eebfa){if(_0x1eebfa){return _0x1eebfa[_0x4fdd('0x50')](_0x2383a7[_0x4fdd('0x2a')][_0x4fdd('0x3b')]);}})[_0x4fdd('0x1c')](respondWithStatusCode(_0x2d50c3,null))[_0x4fdd('0x28')](handleError(_0x2d50c3,null));};exports[_0x4fdd('0x51')]=function(_0x2dfe1d,_0x329071){var _0x32d09b=moment()[_0x4fdd('0x52')]()[_0x4fdd('0x53')]();var _0x578d52=path[_0x4fdd('0x54')](config[_0x4fdd('0x55')],_0x4fdd('0x56'),_0x4fdd('0x57'),'tmp');var _0x56a9b8=path[_0x4fdd('0x54')](config[_0x4fdd('0x55')],'server',_0x4fdd('0x57'),'attachments');var _0x52c3d9=path['join'](_0x578d52,_0x32d09b);var _0x440d5a=util[_0x4fdd('0x45')](_0x4fdd('0x58'),_0x2dfe1d[_0x4fdd('0x37')]['id'],_0x32d09b);var _0x595bb2=path[_0x4fdd('0x54')](_0x578d52,_0x440d5a);var _0x11c99e=[];_0x11c99e[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x5a')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x11c99e[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x5b')],'as':'Contact','attributes':['id',_0x4fdd('0x5c'),_0x4fdd('0x5d')],'raw':!![]});if(_0x2dfe1d['query'][_0x4fdd('0x5e')]){_0x11c99e['push']({'model':db[_0x4fdd('0x5f')],'as':'Attachment','raw':!![]});}var _0x52694b=[{'model':db[_0x4fdd('0x3a')],'as':_0x4fdd('0x60'),'attributes':['id','body',_0x4fdd('0x61'),_0x4fdd('0x62'),'secret','read'],'include':_0x11c99e}];_0x52694b[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x63')],'as':_0x4fdd('0x64'),'attributes':['id','name']});_0x52694b[_0x4fdd('0x59')]({'model':db[_0x4fdd('0x5a')],'as':_0x4fdd('0x65'),'attributes':['id',_0x4fdd('0x66')]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x2dfe1d['params']['id']},'include':_0x52694b})[_0x4fdd('0x1c')](handleEntityNotFound(_0x329071,null))['then'](function(_0x41b4a1){if(_0x41b4a1){var _0x556f29=_0x41b4a1[_0x4fdd('0x67')]({'plain':!![]});fs[_0x4fdd('0x68')](_0x52c3d9);var _0x151c7e={'channel':_0x4fdd('0x69'),'account':_0x556f29[_0x4fdd('0x64')]['name'],'agent':_0x556f29[_0x4fdd('0x65')]?_0x556f29[_0x4fdd('0x65')]['fullname']:_0x4fdd('0x6a'),'createdAt':moment(_0x556f29[_0x4fdd('0x61')])[_0x4fdd('0x45')](_0x4fdd('0x46'))[_0x4fdd('0x53')](),'closedAt':_0x556f29[_0x4fdd('0x6b')]?moment(_0x556f29[_0x4fdd('0x6c')])[_0x4fdd('0x45')](_0x4fdd('0x46'))['toString']():'','disposition':_0x556f29[_0x4fdd('0x6d')],'visibility':_0x556f29[_0x4fdd('0x6e')]?_0x4fdd('0x6f'):_0x4fdd('0x70'),'messages':_(_0x556f29[_0x4fdd('0x60')])[_0x4fdd('0x42')]({'secret':![]})[_0x4fdd('0x71')](function(_0x84382e){if(_0x84382e[_0x4fdd('0x5f')]){var _0x2bc64f=path['join'](_0x56a9b8,_0x84382e['Attachment'][_0x4fdd('0x72')]);if(fs[_0x4fdd('0x73')](_0x2bc64f)){fs['createReadStream'](_0x2bc64f)[_0x4fdd('0x74')](fs['createWriteStream'](path[_0x4fdd('0x54')](_0x52c3d9,_0x84382e[_0x4fdd('0x5f')]['basename'])));}}return{'date':moment(_0x84382e['createdAt'])['format'](_0x4fdd('0x46'))[_0x4fdd('0x53')](),'sender':_0x84382e[_0x4fdd('0x62')]===_0x4fdd('0x75')?_0x84382e['User']?_0x84382e[_0x4fdd('0x5a')]['fullname']:_0x4fdd('0x76'):_0x84382e['Contact'][_0x4fdd('0x5c')]+(_0x84382e[_0x4fdd('0x77')][_0x4fdd('0x5d')]?'\x20'+_0x84382e[_0x4fdd('0x77')][_0x4fdd('0x5d')]:''),'body':_0x84382e[_0x4fdd('0x5f')]?_0x84382e[_0x4fdd('0x5f')]['basename']:_0x84382e['body'],'direction':_0x84382e[_0x4fdd('0x62')]===_0x4fdd('0x75')?'A':'C','secret':_0x84382e[_0x4fdd('0x78')],'read':_0x84382e[_0x4fdd('0x79')],'attachment':_0x84382e[_0x4fdd('0x5f')]};})[_0x4fdd('0x7a')]()};return ejs[_0x4fdd('0x7b')](path[_0x4fdd('0x54')](config[_0x4fdd('0x55')],_0x4fdd('0x56'),_0x4fdd('0x7c'),_0x4fdd('0x7d')),{'interaction':_0x151c7e})[_0x4fdd('0x1c')](function(_0x15ba30){var _0x19c792=path[_0x4fdd('0x54')](_0x52c3d9,_0x4fdd('0x7e')+_0x556f29['id']+'-'+_0x32d09b+'.pdf');var _0x507921={'path':_0x19c792,'channel':_0x4fdd('0x69'),'interactionId':_0x556f29['id']};return pdf['createPdfFromHTML'](_0x15ba30,_0x507921);})[_0x4fdd('0x1c')](function(){return new Promise(function(_0x276ec1,_0x59148a){zipdir(_0x52c3d9,{'saveTo':_0x595bb2},function(_0x20ac62,_0x1b44c5){if(_0x20ac62)return _0x59148a(_0x20ac62);return _0x276ec1(_0x1b44c5);});})[_0x4fdd('0x1c')](function(){return new Promise(function(_0x46610e,_0x47fbcd){rimraf(_0x52c3d9,function(_0x499831){if(_0x499831)_0x47fbcd(_0x499831);return _0x46610e();});});})['then'](function(){return _0x329071['download'](_0x595bb2,_0x440d5a,function(_0x310df0){if(_0x310df0){logger[_0x4fdd('0x7f')](_0x4fdd('0x80'),_0x310df0);}else{fs[_0x4fdd('0x81')](_0x595bb2);}});});});}else{return _0x329071[_0x4fdd('0x11')](0xc8);}})['catch'](handleError(_0x329071,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index bc25f00..742af84 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 _0xf25b=['then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','getUsers'];(function(_0x149eb7,_0x11536f){var _0x11cf29=function(_0x40b944){while(--_0x40b944){_0x149eb7['push'](_0x149eb7['shift']());}};_0x11cf29(++_0x11536f);}(_0xf25b,0x184));var _0xbf25=function(_0x5efc44,_0x263bd7){_0x5efc44=_0x5efc44-0x0;var _0x2c857a=_0xf25b[_0x5efc44];return _0x2c857a;};'use strict';var EventEmitter=require(_0xbf25('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xbf25('0x1')];var OpenchannelMessage=require(_0xbf25('0x2'))['db'][_0xbf25('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xbf25('0x4')](0x0);var events={'afterCreate':_0xbf25('0x5'),'afterUpdate':_0xbf25('0x6'),'afterDestroy':'remove'};function emitEvent(_0xd12881){return function(_0x23419c,_0x5281f9,_0x398a7b){_0x23419c[_0xbf25('0x7')]({'attributes':['id'],'raw':!![]})[_0xbf25('0x8')](function(_0x33abba){_0x23419c[_0xbf25('0x9')]('Users',_0x33abba[_0xbf25('0xa')](function(_0x2caf82){return{'id':_0x2caf82['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x23419c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1e65d0){_0x23419c[_0xbf25('0x9')](_0xbf25('0xb'),_0x1e65d0[_0xbf25('0xc')]);OpenchannelInteractionEvents['emit'](_0xd12881+':'+_0x23419c['id'],_0x23419c);OpenchannelInteractionEvents[_0xbf25('0xd')](_0xd12881,_0x23419c);_0x398a7b(null);})[_0xbf25('0xe')](_0x398a7b(null));};}for(var e in events){if(events[_0xbf25('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xbf25('0x10')](e,emitEvent(event));}}module[_0xbf25('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x5b19=['then','unreadMessages','length','emit','catch','hook','../../mysqldb','OpenchannelMessage','save','update','getUsers','setDataValue','Users','map','findAll'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5b19,0xba));var _0x95b1=function(_0x2351b7,_0x56b743){_0x2351b7=_0x2351b7-0x0;var _0x1b2e84=_0x5b19[_0x2351b7];return _0x1b2e84;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x95b1('0x0'))['db'][_0x95b1('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x95b1('0x2'),'afterUpdate':_0x95b1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3eee82){return function(_0x23fb24,_0xf5192,_0x1e7fa9){_0x23fb24[_0x95b1('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x344543){_0x23fb24[_0x95b1('0x5')](_0x95b1('0x6'),_0x344543[_0x95b1('0x7')](function(_0x590cac){return{'id':_0x590cac['id']};}));return OpenchannelMessage[_0x95b1('0x8')]({'where':{'OpenchannelInteractionId':_0x23fb24['id'],'direction':'in','read':![]},'raw':!![]});})[_0x95b1('0x9')](function(_0x26356f){_0x23fb24[_0x95b1('0x5')](_0x95b1('0xa'),_0x26356f[_0x95b1('0xb')]);OpenchannelInteractionEvents['emit'](_0x3eee82+':'+_0x23fb24['id'],_0x23fb24);OpenchannelInteractionEvents[_0x95b1('0xc')](_0x3eee82,_0x23fb24);_0x1e7fa9(null);})[_0x95b1('0xd')](_0x1e7fa9(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x95b1('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 11dad3f..012e718 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 _0x7fcb=['api','moment','bluebird','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0xa87ba9,_0x235dc4){var _0x100167=function(_0x463a76){while(--_0x463a76){_0xa87ba9['push'](_0xa87ba9['shift']());}};_0x100167(++_0x235dc4);}(_0x7fcb,0xd5));var _0xb7fc=function(_0x42e7ce,_0x375d2e){_0x42e7ce=_0x42e7ce-0x0;var _0x3d5428=_0x7fcb[_0x42e7ce];return _0x3d5428;};'use strict';var _=require(_0xb7fc('0x0'));var util=require(_0xb7fc('0x1'));var logger=require(_0xb7fc('0x2'))(_0xb7fc('0x3'));var moment=require(_0xb7fc('0x4'));var BPromise=require(_0xb7fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb7fc('0x6'));var attributes=require(_0xb7fc('0x7'));module[_0xb7fc('0x8')]=function(_0x1cb6c1,_0x34c0ee){return _0x1cb6c1[_0xb7fc('0x9')](_0xb7fc('0xa'),attributes,{'tableName':_0xb7fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb7fc('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x1abbda,_0x128325,_0x43506e){if(_0x1abbda[_0xb7fc('0xd')](_0xb7fc('0xe'))){_0x1abbda[_0xb7fc('0xf')]=moment()[_0xb7fc('0x10')](_0xb7fc('0x11'));}_0x43506e(null,_0x1abbda);}}});}; \ No newline at end of file +var _0x5cb8=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','format'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5cb8,0xef));var _0x85cb=function(_0x51c3aa,_0x4480ef){_0x51c3aa=_0x51c3aa-0x0;var _0x512699=_0x5cb8[_0x51c3aa];return _0x512699;};'use strict';var _=require('lodash');var util=require(_0x85cb('0x0'));var logger=require(_0x85cb('0x1'))(_0x85cb('0x2'));var moment=require(_0x85cb('0x3'));var BPromise=require(_0x85cb('0x4'));var rp=require(_0x85cb('0x5'));var fs=require('fs');var path=require(_0x85cb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x85cb('0x7'));module[_0x85cb('0x8')]=function(_0x1913a7,_0x4b40d9){return _0x1913a7[_0x85cb('0x9')](_0x85cb('0xa'),attributes,{'tableName':_0x85cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x85cb('0xc'),'collate':_0x85cb('0xd'),'hooks':{'beforeUpdate':function(_0x9d9fc7,_0x10d19f,_0x63bb30){if(_0x9d9fc7[_0x85cb('0xe')]('closed')){_0x9d9fc7['closedAt']=moment()[_0x85cb('0xf')](_0x85cb('0x10'));}_0x63bb30(null,_0x9d9fc7);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index c17d192..72fdb10 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 _0x7855=['debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','find','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x206de9,_0x5a909f){var _0x5e9fe2=function(_0x475b41){while(--_0x475b41){_0x206de9['push'](_0x206de9['shift']());}};_0x5e9fe2(++_0x5a909f);}(_0x7855,0x1c0));var _0x5785=function(_0x31065c,_0x3c6bdf){_0x31065c=_0x31065c-0x0;var _0xfee4a=_0x7855[_0x31065c];return _0xfee4a;};'use strict';var _=require('lodash');var util=require(_0x5785('0x0'));var moment=require(_0x5785('0x1'));var BPromise=require(_0x5785('0x2'));var rs=require(_0x5785('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5785('0x4'))['db'];var utils=require(_0x5785('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5785('0x6'));var jayson=require(_0x5785('0x7'));var client=jayson[_0x5785('0x8')][_0x5785('0x9')]({'port':0x232a});config[_0x5785('0xa')]=_[_0x5785('0xb')](config[_0x5785('0xa')],{'host':_0x5785('0xc'),'port':0x18eb});var socket=require(_0x5785('0xd'))(new Redis(config[_0x5785('0xa')]));require(_0x5785('0xe'))[_0x5785('0xf')](socket);function respondWithRpcPromise(_0x29dce6,_0x142758,_0x275f99){return new BPromise(function(_0x58f850,_0x27a56b){return client['request'](_0x29dce6,_0x275f99)[_0x5785('0x10')](function(_0x2ad1cd){logger[_0x5785('0x11')](_0x5785('0x12'),_0x142758,_0x5785('0x13'));logger[_0x5785('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x142758,_0x5785('0x13'),JSON[_0x5785('0x15')](_0x2ad1cd));if(_0x2ad1cd[_0x5785('0x16')]){if(_0x2ad1cd['error'][_0x5785('0x17')]===0x1f4){logger[_0x5785('0x16')](_0x5785('0x12'),_0x142758,_0x2ad1cd[_0x5785('0x16')][_0x5785('0x18')]);return _0x27a56b(_0x2ad1cd['error'][_0x5785('0x18')]);}logger[_0x5785('0x16')](_0x5785('0x12'),_0x142758,_0x2ad1cd[_0x5785('0x16')][_0x5785('0x18')]);return _0x58f850(_0x2ad1cd[_0x5785('0x16')][_0x5785('0x18')]);}else{logger[_0x5785('0x11')](_0x5785('0x12'),_0x142758,_0x5785('0x13'));_0x58f850(_0x2ad1cd[_0x5785('0x19')][_0x5785('0x18')]);}})[_0x5785('0x1a')](function(_0x43a264){logger['error'](_0x5785('0x12'),_0x142758,_0x43a264);_0x27a56b(_0x43a264);});});}exports[_0x5785('0x1b')]=function(_0x691f1c){var _0x234185=this;return new Promise(function(_0x1f660c,_0xec16fc){return db[_0x5785('0x1c')]['update'](_0x691f1c[_0x5785('0x1d')],{'raw':_0x691f1c[_0x5785('0x1e')]?_0x691f1c[_0x5785('0x1e')][_0x5785('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x691f1c[_0x5785('0x1e')]?_0x691f1c['options']['where']||null:null,'attributes':_0x691f1c[_0x5785('0x1e')]?_0x691f1c[_0x5785('0x1e')]['attributes']||null:null,'limit':_0x691f1c['options']?_0x691f1c[_0x5785('0x1e')]['limit']||null:null})[_0x5785('0x10')](function(_0x1a36c6){logger[_0x5785('0x11')](_0x5785('0x1b'),_0x691f1c);logger[_0x5785('0x14')](_0x5785('0x1b'),_0x691f1c,JSON['stringify'](_0x1a36c6));_0x1f660c(_0x1a36c6);})[_0x5785('0x1a')](function(_0x16ec74){logger[_0x5785('0x16')](_0x5785('0x1b'),_0x16ec74['message'],_0x691f1c);_0xec16fc(_0x234185[_0x5785('0x16')](0x1f4,_0x16ec74['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x1eee26){return new Promise(function(_0x51601f,_0x5ef830){return db[_0x5785('0x1c')][_0x5785('0x20')]({'where':_0x1eee26['options']?_0x1eee26[_0x5785('0x1e')][_0x5785('0x21')]||null:null})[_0x5785('0x10')](function(_0x219669){if(_0x219669){return _0x219669[_0x5785('0x22')](_0x1eee26['body'][_0x5785('0x23')],_[_0x5785('0x24')](_0x1eee26[_0x5785('0x1d')],[_0x5785('0x23'),'id'])||{});}})[_0x5785('0x25')](function(_0x4cffc9){logger['info'](_0x5785('0x26'),_0x1eee26);logger[_0x5785('0x14')](_0x5785('0x26'),_0x1eee26,JSON[_0x5785('0x15')](_0x4cffc9));_0x51601f(_0x4cffc9);})['catch'](function(_0x2d55ce){logger[_0x5785('0x16')](_0x5785('0x26'),_0x2d55ce['message'],_0x1eee26);_0x5ef830(_this[_0x5785('0x16')](0x1f4,_0x2d55ce[_0x5785('0x18')]));});});}; \ No newline at end of file +var _0xa515=['result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4ae621,_0x7fecd4){var _0x3fc9ff=function(_0x3e97e0){while(--_0x3e97e0){_0x4ae621['push'](_0x4ae621['shift']());}};_0x3fc9ff(++_0x7fecd4);}(_0xa515,0xf9));var _0x5a51=function(_0x161c81,_0x310971){_0x161c81=_0x161c81-0x0;var _0x25a6c6=_0xa515[_0x161c81];return _0x25a6c6;};'use strict';var _=require(_0x5a51('0x0'));var util=require(_0x5a51('0x1'));var moment=require(_0x5a51('0x2'));var BPromise=require(_0x5a51('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a51('0x4'));var db=require(_0x5a51('0x5'))['db'];var utils=require(_0x5a51('0x6'));var logger=require('../../config/logger')(_0x5a51('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a51('0x8'));var client=jayson[_0x5a51('0x9')]['http']({'port':0x232a});config[_0x5a51('0xa')]=_['defaults'](config[_0x5a51('0xa')],{'host':_0x5a51('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a51('0xa')]));require(_0x5a51('0xc'))[_0x5a51('0xd')](socket);function respondWithRpcPromise(_0x445388,_0xb9f988,_0x387f41){return new BPromise(function(_0x51016d,_0xd7a0bb){return client[_0x5a51('0xe')](_0x445388,_0x387f41)[_0x5a51('0xf')](function(_0x3cb780){logger[_0x5a51('0x10')](_0x5a51('0x11'),_0xb9f988,_0x5a51('0x12'));logger[_0x5a51('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xb9f988,_0x5a51('0x12'),JSON[_0x5a51('0x14')](_0x3cb780));if(_0x3cb780[_0x5a51('0x15')]){if(_0x3cb780['error'][_0x5a51('0x16')]===0x1f4){logger['error'](_0x5a51('0x11'),_0xb9f988,_0x3cb780[_0x5a51('0x15')][_0x5a51('0x17')]);return _0xd7a0bb(_0x3cb780[_0x5a51('0x15')][_0x5a51('0x17')]);}logger[_0x5a51('0x15')](_0x5a51('0x11'),_0xb9f988,_0x3cb780[_0x5a51('0x15')]['message']);return _0x51016d(_0x3cb780[_0x5a51('0x15')][_0x5a51('0x17')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xb9f988,_0x5a51('0x12'));_0x51016d(_0x3cb780[_0x5a51('0x18')]['message']);}})[_0x5a51('0x19')](function(_0x46ecba){logger[_0x5a51('0x15')](_0x5a51('0x11'),_0xb9f988,_0x46ecba);_0xd7a0bb(_0x46ecba);});});}exports[_0x5a51('0x1a')]=function(_0x3bd226){var _0x287321=this;return new Promise(function(_0x545924,_0xe32753){return db[_0x5a51('0x1b')]['update'](_0x3bd226[_0x5a51('0x1c')],{'raw':_0x3bd226[_0x5a51('0x1d')]?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bd226['options']?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x1f')]||null:null,'attributes':_0x3bd226[_0x5a51('0x1d')]?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x20')]||null:null,'limit':_0x3bd226['options']?_0x3bd226[_0x5a51('0x1d')][_0x5a51('0x21')]||null:null})['then'](function(_0x53ad0d){logger[_0x5a51('0x10')]('UpdateOpenchannelInteraction',_0x3bd226);logger['debug']('UpdateOpenchannelInteraction',_0x3bd226,JSON[_0x5a51('0x14')](_0x53ad0d));_0x545924(_0x53ad0d);})[_0x5a51('0x19')](function(_0x2acb6e){logger['error']('UpdateOpenchannelInteraction',_0x2acb6e['message'],_0x3bd226);_0xe32753(_0x287321['error'](0x1f4,_0x2acb6e[_0x5a51('0x17')]));});});};exports[_0x5a51('0x22')]=function(_0x373237){return new Promise(function(_0x38389d,_0x575f18){return db[_0x5a51('0x1b')]['find']({'where':_0x373237[_0x5a51('0x1d')]?_0x373237['options']['where']||null:null})[_0x5a51('0xf')](function(_0xac177e){if(_0xac177e){return _0xac177e[_0x5a51('0x23')](_0x373237['body'][_0x5a51('0x24')],_[_0x5a51('0x25')](_0x373237['body'],[_0x5a51('0x24'),'id'])||{});}})['spread'](function(_0x48e66d){logger[_0x5a51('0x10')]('AddTags',_0x373237);logger[_0x5a51('0x13')](_0x5a51('0x26'),_0x373237,JSON[_0x5a51('0x14')](_0x48e66d));_0x38389d(_0x48e66d);})[_0x5a51('0x19')](function(_0x47c092){logger[_0x5a51('0x15')](_0x5a51('0x26'),_0x47c092[_0x5a51('0x17')],_0x373237);_0x575f18(_this[_0x5a51('0x15')](0x1f4,_0x47c092[_0x5a51('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 1948e8b..8555e45 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 _0x5777=['remove','update','emit','openchannelInteraction:','save'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5777,0x68));var _0x7577=function(_0x109613,_0x39a8b4){_0x109613=_0x109613-0x0;var _0x130272=_0x5777[_0x109613];return _0x130272;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x7577('0x0'),_0x7577('0x1'),_0x7577('0x2')];function createListener(_0x46e44f,_0x3b6422){return function(_0x31fdc3){_0x3b6422[_0x7577('0x3')](_0x46e44f,_0x31fdc3);};}function removeListener(_0x3a014a,_0x76b6d1){return function(){OpenchannelInteractionEvents['removeListener'](_0x3a014a,_0x76b6d1);};}exports['register']=function(_0x4aea82){for(var _0x3c17a3=0x0,_0x3d1dcd=events['length'];_0x3c17a3<_0x3d1dcd;_0x3c17a3++){var _0x5d6589=events[_0x3c17a3];var _0xb1b07c=createListener(_0x7577('0x4')+_0x5d6589,_0x4aea82);OpenchannelInteractionEvents['on'](_0x5d6589,_0xb1b07c);}}; \ No newline at end of file +var _0xf8c2=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xf8c2,0x1c3));var _0x2f8c=function(_0x4e0f32,_0x5b4b18){_0x4e0f32=_0x4e0f32-0x0;var _0x63290f=_0xf8c2[_0x4e0f32];return _0x63290f;};'use strict';var OpenchannelInteractionEvents=require(_0x2f8c('0x0'));var events=[_0x2f8c('0x1'),_0x2f8c('0x2'),_0x2f8c('0x3')];function createListener(_0x3f65de,_0x36d29a){return function(_0x1f85bb){_0x36d29a[_0x2f8c('0x4')](_0x3f65de,_0x1f85bb);};}function removeListener(_0xcd94b5,_0x326108){return function(){OpenchannelInteractionEvents[_0x2f8c('0x5')](_0xcd94b5,_0x326108);};}exports[_0x2f8c('0x6')]=function(_0x5decf9){for(var _0x211954=0x0,_0x130a8b=events['length'];_0x211954<_0x130a8b;_0x211954++){var _0x536fe6=events[_0x211954];var _0x2ad83f=createListener(_0x2f8c('0x7')+_0x536fe6,_0x5decf9);OpenchannelInteractionEvents['on'](_0x536fe6,_0x2ad83f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 81e7896..0c624de 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x369f62,_0x17a354){var _0x323a6d=function(_0x4fc5cf){while(--_0x4fc5cf){_0x369f62['push'](_0x369f62['shift']());}};_0x323a6d(++_0x17a354);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x134d5e,_0x2a47d8){_0x134d5e=_0x134d5e-0x0;var _0x1e166a=_0xcb91[_0x134d5e];return _0x1e166a;};'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')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x131eb1,_0x55b270){var _0x3a3b7a=function(_0xab2165){while(--_0xab2165){_0x131eb1['push'](_0x131eb1['shift']());}};_0x3a3b7a(++_0x55b270);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index e24ec3d..d519e42 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 _0xd4a2=['sequelize','medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0xd4a2,0x173));var _0x2d4a=function(_0x40a3c3,_0xe1111e){_0x40a3c3=_0x40a3c3-0x0;var _0x561c37=_0xd4a2[_0x40a3c3];return _0x561c37;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2d4a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2d4a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2d4a('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x2d4a('0x4')]},'providerName':{'type':Sequelize[_0x2d4a('0x5')]},'providerResponse':{'type':Sequelize[_0x2d4a('0x6')]}}; \ No newline at end of file +var _0x6947=['STRING','TEXT','exports','medium','BOOLEAN','ENUM','DATE'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x6947,0x72));var _0x7694=function(_0x4bc600,_0x1780d){_0x4bc600=_0x4bc600-0x0;var _0x1e2383=_0x6947[_0x4bc600];return _0x1e2383;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7694('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7694('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7694('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7694('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7694('0x4')]},'providerName':{'type':Sequelize[_0x7694('0x5')]},'providerResponse':{'type':Sequelize[_0x7694('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 9800fd7..3e3e515 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 _0xa671=['count','set','reject','destroy','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','create','body','update','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','openchannel-interactions','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x3bbde7,_0x344127){var _0x117992=function(_0x1d0170){while(--_0x1d0170){_0x3bbde7['push'](_0x3bbde7['shift']());}};_0x117992(++_0x344127);}(_0xa671,0x153));var _0x1a67=function(_0x18cf50,_0x3d88f9){_0x18cf50=_0x18cf50-0x0;var _0x408c31=_0xa671[_0x18cf50];return _0x408c31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a67('0x0'));var zipdir=require(_0x1a67('0x1'));var jsonpatch=require(_0x1a67('0x2'));var rp=require(_0x1a67('0x3'));var moment=require(_0x1a67('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a67('0x5'));var util=require(_0x1a67('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1a67('0x7'));var ejs=require(_0x1a67('0x8'));var fs=require('fs');var fs_extra=require(_0x1a67('0x9'));var _=require(_0x1a67('0xa'));var squel=require(_0x1a67('0xb'));var crypto=require(_0x1a67('0xc'));var jsforce=require(_0x1a67('0xd'));var deskjs=require(_0x1a67('0xe'));var toCsv=require(_0x1a67('0x7'));var querystring=require('querystring');var Papa=require(_0x1a67('0xf'));var Redis=require(_0x1a67('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1a67('0x11'));var as=require(_0x1a67('0x12'));var hardwareService=require(_0x1a67('0x13'));var logger=require(_0x1a67('0x14'))('api');var utils=require(_0x1a67('0x15'));var config=require(_0x1a67('0x16'));var licenseUtil=require(_0x1a67('0x17'));var db=require('../../mysqldb')['db'];config[_0x1a67('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1a67('0x19'))(new Redis(config[_0x1a67('0x18')]));require(_0x1a67('0x1a'))[_0x1a67('0x1b')](socket);var jayson=require(_0x1a67('0x1c'));var client=jayson[_0x1a67('0x1d')][_0x1a67('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x1a67('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4c72b6,_0x23f20e,_0x5b1957,_0x411d1b){return new BPromise(function(_0x58096c,_0xffec2){var _0x1fb246=_0x411d1b||client;return _0x1fb246[_0x1a67('0x1f')](_0x4c72b6,_0x5b1957)[_0x1a67('0x20')](function(_0x2f0e4d){logger[_0x1a67('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x23f20e,_0x1a67('0x22'));logger[_0x1a67('0x23')](_0x1a67('0x24'),_0x23f20e,'request\x20sent',JSON[_0x1a67('0x25')](_0x2f0e4d));if(_0x2f0e4d[_0x1a67('0x26')]){if(_0x2f0e4d[_0x1a67('0x26')][_0x1a67('0x27')]===0x1f4){logger['error'](_0x1a67('0x28'),_0x23f20e,_0x2f0e4d['error']['message']);return _0xffec2(_0x2f0e4d['error'][_0x1a67('0x29')]);}logger[_0x1a67('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x23f20e,_0x2f0e4d[_0x1a67('0x26')][_0x1a67('0x29')]);return _0x58096c(_0x2f0e4d[_0x1a67('0x26')][_0x1a67('0x29')]);}else{logger[_0x1a67('0x21')](_0x1a67('0x28'),_0x23f20e,'request\x20sent');_0x58096c(_0x2f0e4d[_0x1a67('0x2a')][_0x1a67('0x29')]);}})[_0x1a67('0x2b')](function(_0x113beb){logger['error'](_0x1a67('0x28'),_0x23f20e,_0x113beb);_0xffec2(_0x113beb);});});}function respondWithStatusCode(_0x213825,_0x46f0ef){_0x46f0ef=_0x46f0ef||0xcc;return function(_0x307fc1){if(_0x307fc1){return _0x213825[_0x1a67('0x2c')](_0x46f0ef);}return _0x213825['status'](_0x46f0ef)[_0x1a67('0x2d')]();};}function respondWithResult(_0x39dba4,_0x365eca){_0x365eca=_0x365eca||0xc8;return function(_0x326bd3){if(_0x326bd3){return _0x39dba4[_0x1a67('0x2e')](_0x365eca)[_0x1a67('0x2f')](_0x326bd3);}};}function respondWithFilteredResult(_0xed79ad,_0x2c14ec){return function(_0x62e27){if(_0x62e27){var _0x2d9ea9=typeof _0x2c14ec[_0x1a67('0x30')]===_0x1a67('0x31')&&typeof _0x2c14ec[_0x1a67('0x32')]===_0x1a67('0x31');var _0x230adc=_0x62e27[_0x1a67('0x33')];var _0x57cc3f=_0x2d9ea9?0x0:_0x2c14ec[_0x1a67('0x30')];var _0x5ea1c6=_0x2d9ea9?_0x62e27[_0x1a67('0x33')]:_0x2c14ec[_0x1a67('0x30')]+_0x2c14ec[_0x1a67('0x32')];var _0x5b6eb9;if(_0x5ea1c6>=_0x230adc){_0x5ea1c6=_0x230adc;_0x5b6eb9=0xc8;}else{_0x5b6eb9=0xce;}_0xed79ad['status'](_0x5b6eb9);return _0xed79ad[_0x1a67('0x34')]('Content-Range',_0x57cc3f+'-'+_0x5ea1c6+'/'+_0x230adc)[_0x1a67('0x2f')](_0x62e27);}return null;};}function patchUpdates(_0x19292d){return function(_0x5488cc){try{jsonpatch['apply'](_0x5488cc,_0x19292d,!![]);}catch(_0x16ae80){return BPromise[_0x1a67('0x35')](_0x16ae80);}return _0x5488cc['save']();};}function saveUpdates(_0x2bfb0f,_0x23b810){return function(_0x22439c){if(_0x22439c){return _0x22439c['update'](_0x2bfb0f)[_0x1a67('0x20')](function(_0x3f19bb){return _0x3f19bb;});}return null;};}function removeEntity(_0x3400a5,_0x428ade){return function(_0x5b3dd8){if(_0x5b3dd8){return _0x5b3dd8[_0x1a67('0x36')]()['then'](function(){_0x3400a5[_0x1a67('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339c6c,_0x310d04){return function(_0x98ed52){if(!_0x98ed52){_0x339c6c[_0x1a67('0x2c')](0x194);}return _0x98ed52;};}function handleError(_0x3dda59,_0x4f43ed){_0x4f43ed=_0x4f43ed||0x1f4;return function(_0x353564){logger['error'](_0x353564['stack']);if(_0x353564['name']){delete _0x353564[_0x1a67('0x37')];}_0x3dda59[_0x1a67('0x2e')](_0x4f43ed)[_0x1a67('0x38')](_0x353564);};}exports[_0x1a67('0x39')]=function(_0x4f5287,_0x221cca){var _0x4b24a5={},_0x2ba7f3={},_0x1e76c0={'count':0x0,'rows':[]};var _0x171946=_['map'](db[_0x1a67('0x3a')][_0x1a67('0x3b')],function(_0x12f01b){return{'name':_0x12f01b[_0x1a67('0x3c')],'type':_0x12f01b[_0x1a67('0x3d')][_0x1a67('0x3e')]};});_0x2ba7f3[_0x1a67('0x3f')]=_['map'](_0x171946,'name');_0x2ba7f3[_0x1a67('0x40')]=_[_0x1a67('0x41')](_0x4f5287[_0x1a67('0x40')]);_0x2ba7f3[_0x1a67('0x42')]=_['intersection'](_0x2ba7f3[_0x1a67('0x3f')],_0x2ba7f3[_0x1a67('0x40')]);_0x4b24a5[_0x1a67('0x43')]=_[_0x1a67('0x44')](_0x2ba7f3[_0x1a67('0x3f')],qs['fields'](_0x4f5287[_0x1a67('0x40')][_0x1a67('0x45')]));_0x4b24a5['attributes']=_0x4b24a5[_0x1a67('0x43')][_0x1a67('0x46')]?_0x4b24a5[_0x1a67('0x43')]:_0x2ba7f3[_0x1a67('0x3f')];if(!_0x4f5287[_0x1a67('0x40')]['hasOwnProperty'](_0x1a67('0x47'))){_0x4b24a5[_0x1a67('0x32')]=qs[_0x1a67('0x32')](_0x4f5287['query']['limit']);_0x4b24a5['offset']=qs[_0x1a67('0x30')](_0x4f5287[_0x1a67('0x40')][_0x1a67('0x30')]);}_0x4b24a5[_0x1a67('0x48')]=qs[_0x1a67('0x49')](_0x4f5287[_0x1a67('0x40')][_0x1a67('0x49')]);_0x4b24a5['where']=qs[_0x1a67('0x42')](_[_0x1a67('0x4a')](_0x4f5287['query'],_0x2ba7f3[_0x1a67('0x42')]),_0x171946);if(_0x4f5287[_0x1a67('0x40')][_0x1a67('0x4b')]){_0x4b24a5[_0x1a67('0x4c')]=_[_0x1a67('0x4d')](_0x4b24a5['where'],{'$or':_['map'](_0x171946,function(_0x37cf3c){if(_0x37cf3c[_0x1a67('0x3d')]!==_0x1a67('0x4e')){var _0x34e003={};_0x34e003[_0x37cf3c['name']]={'$like':'%'+_0x4f5287[_0x1a67('0x40')][_0x1a67('0x4b')]+'%'};return _0x34e003;}})});}_0x4b24a5=_[_0x1a67('0x4d')]({},_0x4b24a5,_0x4f5287[_0x1a67('0x4f')]);var _0x30abc4={'where':_0x4b24a5[_0x1a67('0x4c')]};return db[_0x1a67('0x3a')][_0x1a67('0x33')](_0x30abc4)['then'](function(_0x1a65f8){_0x1e76c0[_0x1a67('0x33')]=_0x1a65f8;if(_0x4f5287[_0x1a67('0x40')]['includeAll']){_0x4b24a5['include']=[{'all':!![]}];}return db[_0x1a67('0x3a')][_0x1a67('0x50')](_0x4b24a5);})[_0x1a67('0x20')](function(_0x5f169b){_0x1e76c0[_0x1a67('0x51')]=_0x5f169b;return _0x1e76c0;})[_0x1a67('0x20')](respondWithFilteredResult(_0x221cca,_0x4b24a5))[_0x1a67('0x2b')](handleError(_0x221cca,null));};exports[_0x1a67('0x52')]=function(_0x2aceff,_0x93cba4){var _0x521317={'raw':!![],'where':{'id':_0x2aceff[_0x1a67('0x53')]['id']}},_0x1e8d7e={};_0x1e8d7e[_0x1a67('0x3f')]=_[_0x1a67('0x41')](db['OpenchannelMessage']['rawAttributes']);_0x1e8d7e[_0x1a67('0x40')]=_[_0x1a67('0x41')](_0x2aceff[_0x1a67('0x40')]);_0x1e8d7e[_0x1a67('0x42')]=_[_0x1a67('0x44')](_0x1e8d7e[_0x1a67('0x3f')],_0x1e8d7e[_0x1a67('0x40')]);_0x521317[_0x1a67('0x43')]=_[_0x1a67('0x44')](_0x1e8d7e[_0x1a67('0x3f')],qs['fields'](_0x2aceff[_0x1a67('0x40')][_0x1a67('0x45')]));_0x521317[_0x1a67('0x43')]=_0x521317[_0x1a67('0x43')]['length']?_0x521317['attributes']:_0x1e8d7e[_0x1a67('0x3f')];if(_0x2aceff[_0x1a67('0x40')][_0x1a67('0x54')]){_0x521317[_0x1a67('0x55')]=[{'all':!![]}];}_0x521317=_[_0x1a67('0x4d')]({},_0x521317,_0x2aceff['options']);return db[_0x1a67('0x3a')]['find'](_0x521317)[_0x1a67('0x20')](handleEntityNotFound(_0x93cba4,null))[_0x1a67('0x20')](respondWithResult(_0x93cba4,null))[_0x1a67('0x2b')](handleError(_0x93cba4,null));};exports[_0x1a67('0x56')]=function(_0x538b6e,_0x5b194d){return db['OpenchannelMessage']['create'](_0x538b6e[_0x1a67('0x57')],{})[_0x1a67('0x20')](respondWithResult(_0x5b194d,0xc9))[_0x1a67('0x2b')](handleError(_0x5b194d,null));};exports[_0x1a67('0x58')]=function(_0x37aa83,_0xc96afa){if(_0x37aa83[_0x1a67('0x57')]['id']){delete _0x37aa83[_0x1a67('0x57')]['id'];}return db[_0x1a67('0x3a')]['find']({'where':{'id':_0x37aa83['params']['id']}})['then'](handleEntityNotFound(_0xc96afa,null))[_0x1a67('0x20')](saveUpdates(_0x37aa83[_0x1a67('0x57')],null))[_0x1a67('0x20')](respondWithResult(_0xc96afa,null))[_0x1a67('0x2b')](handleError(_0xc96afa,null));};exports[_0x1a67('0x36')]=function(_0x29998,_0x4c111d){return db[_0x1a67('0x3a')]['find']({'where':{'id':_0x29998[_0x1a67('0x53')]['id']}})[_0x1a67('0x20')](handleEntityNotFound(_0x4c111d,null))['then'](removeEntity(_0x4c111d,null))['catch'](handleError(_0x4c111d,null));};exports[_0x1a67('0x59')]=function(_0x12a6e4,_0x333dcc){return db['OpenchannelMessage']['describe']()[_0x1a67('0x20')](respondWithResult(_0x333dcc,null))[_0x1a67('0x2b')](handleError(_0x333dcc,null));};var interaction_log=require(_0x1a67('0x14'))('openchannel-interactions');exports[_0x1a67('0x5a')]=function(_0x379474,_0x52079a,_0x446fed){var _0xf7e27e={'agent':{},'channel':_0x1a67('0x5b')};if(_0x379474[_0x1a67('0x57')]['id']){delete _0x379474[_0x1a67('0x57')]['id'];}_0x379474[_0x1a67('0x57')][_0x1a67('0x5c')]=!![];_0x379474[_0x1a67('0x57')][_0x1a67('0x5d')]=moment()[_0x1a67('0x5e')](_0x1a67('0x5f'));_0x379474[_0x1a67('0x57')][_0x1a67('0x60')]=_0x379474[_0x1a67('0x57')][_0x1a67('0x60')]||_0x379474[_0x1a67('0x61')]['id'];_0xf7e27e['agent']['id']=_0x379474[_0x1a67('0x57')][_0x1a67('0x60')];return db[_0x1a67('0x3a')][_0x1a67('0x62')]({'where':{'id':_0x379474[_0x1a67('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52079a,null))[_0x1a67('0x20')](saveUpdates(_0x379474[_0x1a67('0x57')],null))[_0x1a67('0x20')](function(_0x4f004e){if(_0x4f004e){_0xf7e27e[_0x1a67('0x29')]=_0x4f004e[_0x1a67('0x63')]({'plain':!![]});return db[_0x1a67('0x64')]['find']({'where':{'id':_0x4f004e[_0x1a67('0x65')]}});}return null;})[_0x1a67('0x20')](handleEntityNotFound(_0x52079a,null))[_0x1a67('0x20')](function(_0x13d511){if(_0x13d511){return _0x13d511[_0x1a67('0x58')]({'UserId':_0x379474['body'][_0x1a67('0x60')],'read1stAt':_[_0x1a67('0x66')](_0x13d511[_0x1a67('0x67')])?moment()[_0x1a67('0x5e')](_0x1a67('0x5f')):undefined});}return null;})[_0x1a67('0x20')](function(_0x433519){if(_0x433519){_0xf7e27e['interaction']=_0x433519[_0x1a67('0x63')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x379474['user']['id'],_0x379474[_0x1a67('0x61')][_0x1a67('0x37')],_0x379474['user'][_0x1a67('0x68')],_0xf7e27e[_0x1a67('0x69')]['id'],_0x379474[_0x1a67('0x57')]?JSON[_0x1a67('0x25')](_0x379474[_0x1a67('0x57')]):_0x1a67('0x6a'));return respondWithRpcPromise(_0x1a67('0x6b'),_0x1a67('0x6c'),_0xf7e27e);}return null;})['then'](function(_0x35fe52){var _0x46f8ca='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x35fe52[_0x1a67('0x29')][_0x1a67('0x6d')];return db[_0x1a67('0x6e')][_0x1a67('0x40')](_0x46f8ca,{'type':db[_0x1a67('0x6f')][_0x1a67('0x70')]['SELECT'],'raw':!![]})[_0x1a67('0x20')](function(_0x87fb2b){return _0x87fb2b;});})['then'](function(_0x4d170d){if(_0x4d170d){_0xf7e27e[_0x1a67('0x29')]['contact']=_0x4d170d[0x0];if(!_0x379474['body'][_0x1a67('0x60')])return;return db[_0x1a67('0x71')]['find']({'where':{'id':_0x379474['body'][_0x1a67('0x60')],'role':_0x1a67('0x72')},'attributes':['id',_0x1a67('0x37'),_0x1a67('0x73'),_0x1a67('0x74'),_0x1a67('0x75')],'raw':!![]});}return null;})[_0x1a67('0x20')](function(_0x33bc35){if(!_0x33bc35)return null;_0xf7e27e[_0x1a67('0x29')]['agent']=_0x33bc35;return _0xf7e27e;})['then'](function(_0x1f9131){if(_0x1f9131){if(_0x379474[_0x1a67('0x57')]['manual']){_0xf7e27e[_0x1a67('0x29')][_0x1a67('0x76')]=util[_0x1a67('0x5e')](_0x1a67('0x77'),_0x379474['user']['name']);_0xf7e27e[_0x1a67('0x29')][_0x1a67('0x78')]=_0xf7e27e['channel'];_0xf7e27e['message'][_0x1a67('0x79')]=_0xf7e27e[_0x1a67('0x78')];_0xf7e27e[_0x1a67('0x29')]['event']=_0x1a67('0x5a');return respondWithRpcPromise(_0x1a67('0x7a'),_0x1a67('0x7a'),{'event':'acceptmessage','message':_0xf7e27e[_0x1a67('0x29')]},client9002)[_0x1a67('0x20')](function(){return _0xf7e27e;});}return _0xf7e27e;}return null;})[_0x1a67('0x20')](respondWithResult(_0x52079a,null))['catch'](handleError(_0x52079a,null));};var interaction_log=require(_0x1a67('0x14'))(_0x1a67('0x7b'));exports[_0x1a67('0x35')]=function(_0x4f5c01,_0x4e0dc8,_0x3c55f7){var _0x2365d8={'agent':{},'channel':_0x1a67('0x5b')};if(_0x4f5c01[_0x1a67('0x57')]['id']){delete _0x4f5c01[_0x1a67('0x57')]['id'];}_0x4f5c01[_0x1a67('0x57')][_0x1a67('0x60')]=_0x4f5c01['body'][_0x1a67('0x60')]||_0x4f5c01[_0x1a67('0x61')]['id'];_0x2365d8['agent']['id']=_0x4f5c01[_0x1a67('0x57')][_0x1a67('0x60')];return db[_0x1a67('0x3a')][_0x1a67('0x62')]({'where':{'id':_0x4f5c01[_0x1a67('0x53')]['id'],'UserId':null}})[_0x1a67('0x20')](handleEntityNotFound(_0x4e0dc8,null))[_0x1a67('0x20')](function(_0x14550e){if(_0x14550e){_0x2365d8[_0x1a67('0x29')]=_0x14550e['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x1a67('0x62')]({'where':{'id':_0x14550e[_0x1a67('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x4e0dc8,null))[_0x1a67('0x20')](function(_0x4f7b69){if(_0x4f7b69){_0x2365d8[_0x1a67('0x69')]=_0x4f7b69[_0x1a67('0x63')]({'plain':!![]});interaction_log[_0x1a67('0x21')](_0x1a67('0x7c'),_0x4f5c01[_0x1a67('0x61')]['id'],_0x4f5c01['user'][_0x1a67('0x37')],_0x4f5c01[_0x1a67('0x61')][_0x1a67('0x68')],_0x2365d8['interaction']['id'],_0x4f5c01[_0x1a67('0x57')]?JSON['stringify'](_0x4f5c01['body']):_0x1a67('0x6a'));return respondWithRpcPromise(_0x1a67('0x7d'),_0x1a67('0x7e'),_0x2365d8);}return null;})['then'](function(_0x326466){var _0x3fed1c=_0x1a67('0x7f')+_0x326466['message']['ContactId'];return db[_0x1a67('0x6e')][_0x1a67('0x40')](_0x3fed1c,{'type':db[_0x1a67('0x6f')][_0x1a67('0x70')][_0x1a67('0x80')],'raw':!![]})[_0x1a67('0x20')](function(_0x3ca310){return _0x3ca310;});})[_0x1a67('0x20')](function(_0x3d3454){if(_0x3d3454){_0x2365d8[_0x1a67('0x29')]['contact']=_0x3d3454[0x0];if(!_0x4f5c01['body'][_0x1a67('0x60')])return;return db[_0x1a67('0x71')][_0x1a67('0x62')]({'where':{'id':_0x4f5c01[_0x1a67('0x57')][_0x1a67('0x60')],'role':_0x1a67('0x72')},'attributes':['id',_0x1a67('0x37'),_0x1a67('0x73'),'email',_0x1a67('0x75')],'raw':!![]});}return null;})[_0x1a67('0x20')](function(_0x29fcb9){if(!_0x29fcb9)return null;_0x2365d8[_0x1a67('0x29')][_0x1a67('0x72')]=_0x29fcb9;return _0x2365d8;})['then'](function(_0x1c7183){if(_0x1c7183){_0x1c7183[_0x1a67('0x29')]['interface']=util['format'](_0x1a67('0x77'),_0x4f5c01[_0x1a67('0x61')][_0x1a67('0x37')]);_0x1c7183[_0x1a67('0x29')][_0x1a67('0x78')]=_0x2365d8[_0x1a67('0x78')];_0x1c7183[_0x1a67('0x29')][_0x1a67('0x79')]=_0x2365d8['channel'];_0x1c7183[_0x1a67('0x29')]['event']=_0x1a67('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0x1a67('0x81'),'message':_0x1c7183['message']},client9002);return _0x2365d8;}return null;})[_0x1a67('0x20')](respondWithResult(_0x4e0dc8,null))[_0x1a67('0x2b')](handleError(_0x4e0dc8,null));}; \ No newline at end of file +var _0xe3db=['readAt','format','user','agent','UserId','get','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','fullname','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','openchannel','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','QueryTypes','SIP/%s','rejectmessage','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./openchannelMessage.socket','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','openchannel-interactions'];(function(_0x5a0e1d,_0x261edc){var _0x320dc0=function(_0x2fef8a){while(--_0x2fef8a){_0x5a0e1d['push'](_0x5a0e1d['shift']());}};_0x320dc0(++_0x261edc);}(_0xe3db,0xa5));var _0xbe3d=function(_0x5728ac,_0x2bd794){_0x5728ac=_0x5728ac-0x0;var _0xef9203=_0xe3db[_0x5728ac];return _0xef9203;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbe3d('0x0'));var jsonpatch=require(_0xbe3d('0x1'));var rp=require('request-promise');var moment=require(_0xbe3d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbe3d('0x3'));var util=require(_0xbe3d('0x4'));var path=require('path');var sox=require(_0xbe3d('0x5'));var csv=require(_0xbe3d('0x6'));var ejs=require(_0xbe3d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbe3d('0x8'));var crypto=require(_0xbe3d('0x9'));var jsforce=require(_0xbe3d('0xa'));var deskjs=require(_0xbe3d('0xb'));var toCsv=require(_0xbe3d('0x6'));var querystring=require(_0xbe3d('0xc'));var Papa=require('papaparse');var Redis=require(_0xbe3d('0xd'));var authService=require(_0xbe3d('0xe'));var qs=require(_0xbe3d('0xf'));var as=require(_0xbe3d('0x10'));var hardwareService=require(_0xbe3d('0x11'));var logger=require(_0xbe3d('0x12'))(_0xbe3d('0x13'));var utils=require('../../config/utils');var config=require(_0xbe3d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe3d('0x15'))['db'];config[_0xbe3d('0x16')]=_['defaults'](config['redis'],{'host':_0xbe3d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe3d('0x16')]));require(_0xbe3d('0x18'))['register'](socket);var jayson=require(_0xbe3d('0x19'));var client=jayson[_0xbe3d('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0xbe3d('0x1a')][_0xbe3d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5a5d79,_0x15d7f5,_0xad757a,_0x2392cf){return new BPromise(function(_0x555914,_0x2625e9){var _0x43e77b=_0x2392cf||client;return _0x43e77b['request'](_0x5a5d79,_0xad757a)[_0xbe3d('0x1c')](function(_0x3d50e1){logger[_0xbe3d('0x1d')](_0xbe3d('0x1e'),_0x15d7f5,_0xbe3d('0x1f'));logger['debug'](_0xbe3d('0x20'),_0x15d7f5,_0xbe3d('0x1f'),JSON['stringify'](_0x3d50e1));if(_0x3d50e1[_0xbe3d('0x21')]){if(_0x3d50e1[_0xbe3d('0x21')][_0xbe3d('0x22')]===0x1f4){logger['error'](_0xbe3d('0x1e'),_0x15d7f5,_0x3d50e1['error'][_0xbe3d('0x23')]);return _0x2625e9(_0x3d50e1['error'][_0xbe3d('0x23')]);}logger[_0xbe3d('0x21')](_0xbe3d('0x1e'),_0x15d7f5,_0x3d50e1[_0xbe3d('0x21')]['message']);return _0x555914(_0x3d50e1['error'][_0xbe3d('0x23')]);}else{logger[_0xbe3d('0x1d')](_0xbe3d('0x1e'),_0x15d7f5,'request\x20sent');_0x555914(_0x3d50e1[_0xbe3d('0x24')][_0xbe3d('0x23')]);}})[_0xbe3d('0x25')](function(_0x56376f){logger[_0xbe3d('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x15d7f5,_0x56376f);_0x2625e9(_0x56376f);});});}function respondWithStatusCode(_0x3de0b3,_0x31fb28){_0x31fb28=_0x31fb28||0xcc;return function(_0x3dc795){if(_0x3dc795){return _0x3de0b3[_0xbe3d('0x26')](_0x31fb28);}return _0x3de0b3[_0xbe3d('0x27')](_0x31fb28)[_0xbe3d('0x28')]();};}function respondWithResult(_0x2eaadf,_0x597368){_0x597368=_0x597368||0xc8;return function(_0x4cc8ed){if(_0x4cc8ed){return _0x2eaadf[_0xbe3d('0x27')](_0x597368)['json'](_0x4cc8ed);}};}function respondWithFilteredResult(_0x3d9adb,_0x11a58e){return function(_0x597a51){if(_0x597a51){var _0x12e9db=typeof _0x11a58e[_0xbe3d('0x29')]===_0xbe3d('0x2a')&&typeof _0x11a58e['limit']===_0xbe3d('0x2a');var _0x214dab=_0x597a51[_0xbe3d('0x2b')];var _0x495ab4=_0x12e9db?0x0:_0x11a58e[_0xbe3d('0x29')];var _0x15cc4f=_0x12e9db?_0x597a51[_0xbe3d('0x2b')]:_0x11a58e[_0xbe3d('0x29')]+_0x11a58e[_0xbe3d('0x2c')];var _0x2f371f;if(_0x15cc4f>=_0x214dab){_0x15cc4f=_0x214dab;_0x2f371f=0xc8;}else{_0x2f371f=0xce;}_0x3d9adb[_0xbe3d('0x27')](_0x2f371f);return _0x3d9adb[_0xbe3d('0x2d')](_0xbe3d('0x2e'),_0x495ab4+'-'+_0x15cc4f+'/'+_0x214dab)['json'](_0x597a51);}return null;};}function patchUpdates(_0x3240f1){return function(_0x41d335){try{jsonpatch[_0xbe3d('0x2f')](_0x41d335,_0x3240f1,!![]);}catch(_0x18b797){return BPromise['reject'](_0x18b797);}return _0x41d335['save']();};}function saveUpdates(_0x20248c,_0x4ae0ec){return function(_0x9b4d13){if(_0x9b4d13){return _0x9b4d13[_0xbe3d('0x30')](_0x20248c)[_0xbe3d('0x1c')](function(_0x4d505d){return _0x4d505d;});}return null;};}function removeEntity(_0x4b6aa2,_0x2ed7a5){return function(_0x1a45c3){if(_0x1a45c3){return _0x1a45c3[_0xbe3d('0x31')]()[_0xbe3d('0x1c')](function(){_0x4b6aa2[_0xbe3d('0x27')](0xcc)[_0xbe3d('0x28')]();});}};}function handleEntityNotFound(_0x1020bf,_0x2129fc){return function(_0x1b5952){if(!_0x1b5952){_0x1020bf[_0xbe3d('0x26')](0x194);}return _0x1b5952;};}function handleError(_0x53a8dd,_0x2725fc){_0x2725fc=_0x2725fc||0x1f4;return function(_0xd1f6d1){logger[_0xbe3d('0x21')](_0xd1f6d1[_0xbe3d('0x32')]);if(_0xd1f6d1[_0xbe3d('0x33')]){delete _0xd1f6d1['name'];}_0x53a8dd[_0xbe3d('0x27')](_0x2725fc)[_0xbe3d('0x34')](_0xd1f6d1);};}exports[_0xbe3d('0x35')]=function(_0x144cee,_0x57e316){var _0x3c3866={},_0x389c66={},_0x41b8f8={'count':0x0,'rows':[]};var _0x25e5be=_[_0xbe3d('0x36')](db[_0xbe3d('0x37')][_0xbe3d('0x38')],function(_0x71437d){return{'name':_0x71437d[_0xbe3d('0x39')],'type':_0x71437d[_0xbe3d('0x3a')][_0xbe3d('0x3b')]};});_0x389c66[_0xbe3d('0x3c')]=_['map'](_0x25e5be,'name');_0x389c66[_0xbe3d('0x3d')]=_[_0xbe3d('0x3e')](_0x144cee[_0xbe3d('0x3d')]);_0x389c66[_0xbe3d('0x3f')]=_[_0xbe3d('0x40')](_0x389c66[_0xbe3d('0x3c')],_0x389c66[_0xbe3d('0x3d')]);_0x3c3866['attributes']=_[_0xbe3d('0x40')](_0x389c66[_0xbe3d('0x3c')],qs['fields'](_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x41')]));_0x3c3866['attributes']=_0x3c3866['attributes'][_0xbe3d('0x42')]?_0x3c3866[_0xbe3d('0x43')]:_0x389c66[_0xbe3d('0x3c')];if(!_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x44')]('nolimit')){_0x3c3866[_0xbe3d('0x2c')]=qs[_0xbe3d('0x2c')](_0x144cee['query'][_0xbe3d('0x2c')]);_0x3c3866[_0xbe3d('0x29')]=qs['offset'](_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x29')]);}_0x3c3866[_0xbe3d('0x45')]=qs[_0xbe3d('0x46')](_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x46')]);_0x3c3866['where']=qs['filters'](_[_0xbe3d('0x47')](_0x144cee['query'],_0x389c66['filters']),_0x25e5be);if(_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x48')]){_0x3c3866[_0xbe3d('0x49')]=_['merge'](_0x3c3866[_0xbe3d('0x49')],{'$or':_[_0xbe3d('0x36')](_0x25e5be,function(_0x195c34){if(_0x195c34[_0xbe3d('0x3a')]!=='VIRTUAL'){var _0x1eea09={};_0x1eea09[_0x195c34[_0xbe3d('0x33')]]={'$like':'%'+_0x144cee['query'][_0xbe3d('0x48')]+'%'};return _0x1eea09;}})});}_0x3c3866=_[_0xbe3d('0x4a')]({},_0x3c3866,_0x144cee[_0xbe3d('0x4b')]);var _0x56f548={'where':_0x3c3866['where']};return db[_0xbe3d('0x37')][_0xbe3d('0x2b')](_0x56f548)['then'](function(_0x16076a){_0x41b8f8[_0xbe3d('0x2b')]=_0x16076a;if(_0x144cee[_0xbe3d('0x3d')][_0xbe3d('0x4c')]){_0x3c3866[_0xbe3d('0x4d')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xbe3d('0x4e')](_0x3c3866);})[_0xbe3d('0x1c')](function(_0x29b5d1){_0x41b8f8[_0xbe3d('0x4f')]=_0x29b5d1;return _0x41b8f8;})[_0xbe3d('0x1c')](respondWithFilteredResult(_0x57e316,_0x3c3866))[_0xbe3d('0x25')](handleError(_0x57e316,null));};exports[_0xbe3d('0x50')]=function(_0x29055a,_0x26cbfc){var _0x1ee89d={'raw':!![],'where':{'id':_0x29055a[_0xbe3d('0x51')]['id']}},_0xd01618={};_0xd01618[_0xbe3d('0x3c')]=_[_0xbe3d('0x3e')](db[_0xbe3d('0x37')][_0xbe3d('0x38')]);_0xd01618[_0xbe3d('0x3d')]=_['keys'](_0x29055a[_0xbe3d('0x3d')]);_0xd01618[_0xbe3d('0x3f')]=_[_0xbe3d('0x40')](_0xd01618['model'],_0xd01618[_0xbe3d('0x3d')]);_0x1ee89d[_0xbe3d('0x43')]=_[_0xbe3d('0x40')](_0xd01618[_0xbe3d('0x3c')],qs['fields'](_0x29055a['query'][_0xbe3d('0x41')]));_0x1ee89d['attributes']=_0x1ee89d['attributes'][_0xbe3d('0x42')]?_0x1ee89d[_0xbe3d('0x43')]:_0xd01618[_0xbe3d('0x3c')];if(_0x29055a[_0xbe3d('0x3d')]['includeAll']){_0x1ee89d['include']=[{'all':!![]}];}_0x1ee89d=_['merge']({},_0x1ee89d,_0x29055a['options']);return db[_0xbe3d('0x37')]['find'](_0x1ee89d)[_0xbe3d('0x1c')](handleEntityNotFound(_0x26cbfc,null))['then'](respondWithResult(_0x26cbfc,null))[_0xbe3d('0x25')](handleError(_0x26cbfc,null));};exports[_0xbe3d('0x52')]=function(_0x4aeaf5,_0x12378){return db['OpenchannelMessage'][_0xbe3d('0x52')](_0x4aeaf5[_0xbe3d('0x53')],{})[_0xbe3d('0x1c')](respondWithResult(_0x12378,0xc9))['catch'](handleError(_0x12378,null));};exports[_0xbe3d('0x30')]=function(_0x24323a,_0x8c19a){if(_0x24323a[_0xbe3d('0x53')]['id']){delete _0x24323a[_0xbe3d('0x53')]['id'];}return db[_0xbe3d('0x37')][_0xbe3d('0x54')]({'where':{'id':_0x24323a[_0xbe3d('0x51')]['id']}})[_0xbe3d('0x1c')](handleEntityNotFound(_0x8c19a,null))[_0xbe3d('0x1c')](saveUpdates(_0x24323a['body'],null))['then'](respondWithResult(_0x8c19a,null))[_0xbe3d('0x25')](handleError(_0x8c19a,null));};exports[_0xbe3d('0x31')]=function(_0x3bdc36,_0x279159){return db[_0xbe3d('0x37')][_0xbe3d('0x54')]({'where':{'id':_0x3bdc36['params']['id']}})['then'](handleEntityNotFound(_0x279159,null))['then'](removeEntity(_0x279159,null))[_0xbe3d('0x25')](handleError(_0x279159,null));};exports[_0xbe3d('0x55')]=function(_0x59e98b,_0x2b4fd2){return db[_0xbe3d('0x37')]['describe']()[_0xbe3d('0x1c')](respondWithResult(_0x2b4fd2,null))[_0xbe3d('0x25')](handleError(_0x2b4fd2,null));};var interaction_log=require(_0xbe3d('0x12'))(_0xbe3d('0x56'));exports['accept']=function(_0x451558,_0x149ac7,_0x46610c){var _0x3643af={'agent':{},'channel':'openchannel'};if(_0x451558[_0xbe3d('0x53')]['id']){delete _0x451558[_0xbe3d('0x53')]['id'];}_0x451558[_0xbe3d('0x53')]['read']=!![];_0x451558['body'][_0xbe3d('0x57')]=moment()[_0xbe3d('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x451558[_0xbe3d('0x53')]['UserId']=_0x451558['body']['UserId']||_0x451558[_0xbe3d('0x59')]['id'];_0x3643af[_0xbe3d('0x5a')]['id']=_0x451558[_0xbe3d('0x53')][_0xbe3d('0x5b')];return db['OpenchannelMessage'][_0xbe3d('0x54')]({'where':{'id':_0x451558[_0xbe3d('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x149ac7,null))[_0xbe3d('0x1c')](saveUpdates(_0x451558[_0xbe3d('0x53')],null))[_0xbe3d('0x1c')](function(_0x28f120){if(_0x28f120){_0x3643af[_0xbe3d('0x23')]=_0x28f120[_0xbe3d('0x5c')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x28f120[_0xbe3d('0x5d')]}});}return null;})[_0xbe3d('0x1c')](handleEntityNotFound(_0x149ac7,null))['then'](function(_0x19c0a0){if(_0x19c0a0){return _0x19c0a0['update']({'UserId':_0x451558[_0xbe3d('0x53')][_0xbe3d('0x5b')],'read1stAt':_[_0xbe3d('0x5e')](_0x19c0a0[_0xbe3d('0x5f')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4ed605){if(_0x4ed605){_0x3643af[_0xbe3d('0x60')]=_0x4ed605[_0xbe3d('0x5c')]({'plain':!![]});interaction_log['info'](_0xbe3d('0x61'),_0x451558[_0xbe3d('0x59')]['id'],_0x451558[_0xbe3d('0x59')][_0xbe3d('0x33')],_0x451558[_0xbe3d('0x59')][_0xbe3d('0x62')],_0x3643af[_0xbe3d('0x60')]['id'],_0x451558[_0xbe3d('0x53')]?JSON[_0xbe3d('0x63')](_0x451558['body']):_0xbe3d('0x64'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3643af);}return null;})[_0xbe3d('0x1c')](function(_0x562262){var _0x391beb=_0xbe3d('0x65')+_0x562262['message']['ContactId'];return db[_0xbe3d('0x66')]['query'](_0x391beb,{'type':db['Sequelize']['QueryTypes'][_0xbe3d('0x67')],'raw':!![]})[_0xbe3d('0x1c')](function(_0x6eeb98){return _0x6eeb98;});})[_0xbe3d('0x1c')](function(_0x4d1966){if(_0x4d1966){_0x3643af[_0xbe3d('0x23')][_0xbe3d('0x68')]=_0x4d1966[0x0];if(!_0x451558[_0xbe3d('0x53')][_0xbe3d('0x5b')])return;return db['User'][_0xbe3d('0x54')]({'where':{'id':_0x451558[_0xbe3d('0x53')]['UserId'],'role':'agent'},'attributes':['id','name',_0xbe3d('0x69'),_0xbe3d('0x6a'),_0xbe3d('0x6b')],'raw':!![]});}return null;})[_0xbe3d('0x1c')](function(_0x574554){if(!_0x574554)return null;_0x3643af[_0xbe3d('0x23')]['agent']=_0x574554;return _0x3643af;})[_0xbe3d('0x1c')](function(_0x148afd){if(_0x148afd){if(_0x451558[_0xbe3d('0x53')][_0xbe3d('0x6c')]){_0x3643af['message'][_0xbe3d('0x6d')]=util[_0xbe3d('0x58')]('SIP/%s',_0x451558[_0xbe3d('0x59')][_0xbe3d('0x33')]);_0x3643af[_0xbe3d('0x23')][_0xbe3d('0x6e')]=_0x3643af['channel'];_0x3643af['message'][_0xbe3d('0x6f')]=_0x3643af['channel'];_0x3643af['message'][_0xbe3d('0x70')]=_0xbe3d('0x71');return respondWithRpcPromise(_0xbe3d('0x72'),'EventManager',{'event':_0xbe3d('0x73'),'message':_0x3643af[_0xbe3d('0x23')]},client9002)['then'](function(){return _0x3643af;});}return _0x3643af;}return null;})['then'](respondWithResult(_0x149ac7,null))[_0xbe3d('0x25')](handleError(_0x149ac7,null));};var interaction_log=require(_0xbe3d('0x12'))(_0xbe3d('0x56'));exports[_0xbe3d('0x74')]=function(_0x5c981d,_0x2938d2,_0x3cdd85){var _0x34ab85={'agent':{},'channel':_0xbe3d('0x75')};if(_0x5c981d['body']['id']){delete _0x5c981d[_0xbe3d('0x53')]['id'];}_0x5c981d[_0xbe3d('0x53')][_0xbe3d('0x5b')]=_0x5c981d['body'][_0xbe3d('0x5b')]||_0x5c981d[_0xbe3d('0x59')]['id'];_0x34ab85[_0xbe3d('0x5a')]['id']=_0x5c981d[_0xbe3d('0x53')][_0xbe3d('0x5b')];return db[_0xbe3d('0x37')][_0xbe3d('0x54')]({'where':{'id':_0x5c981d[_0xbe3d('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2938d2,null))['then'](function(_0x30d694){if(_0x30d694){_0x34ab85[_0xbe3d('0x23')]=_0x30d694[_0xbe3d('0x5c')]({'plain':!![]});return db[_0xbe3d('0x76')][_0xbe3d('0x54')]({'where':{'id':_0x30d694[_0xbe3d('0x5d')]}});}return null;})[_0xbe3d('0x1c')](handleEntityNotFound(_0x2938d2,null))[_0xbe3d('0x1c')](function(_0x344e7a){if(_0x344e7a){_0x34ab85[_0xbe3d('0x60')]=_0x344e7a['get']({'plain':!![]});interaction_log[_0xbe3d('0x1d')](_0xbe3d('0x77'),_0x5c981d[_0xbe3d('0x59')]['id'],_0x5c981d['user'][_0xbe3d('0x33')],_0x5c981d[_0xbe3d('0x59')][_0xbe3d('0x62')],_0x34ab85[_0xbe3d('0x60')]['id'],_0x5c981d[_0xbe3d('0x53')]?JSON[_0xbe3d('0x63')](_0x5c981d[_0xbe3d('0x53')]):'null');return respondWithRpcPromise(_0xbe3d('0x78'),_0xbe3d('0x79'),_0x34ab85);}return null;})[_0xbe3d('0x1c')](function(_0x588212){var _0x28d3d6=_0xbe3d('0x65')+_0x588212[_0xbe3d('0x23')][_0xbe3d('0x7a')];return db[_0xbe3d('0x66')]['query'](_0x28d3d6,{'type':db['Sequelize'][_0xbe3d('0x7b')][_0xbe3d('0x67')],'raw':!![]})[_0xbe3d('0x1c')](function(_0x510097){return _0x510097;});})[_0xbe3d('0x1c')](function(_0x57c0a3){if(_0x57c0a3){_0x34ab85[_0xbe3d('0x23')][_0xbe3d('0x68')]=_0x57c0a3[0x0];if(!_0x5c981d[_0xbe3d('0x53')]['UserId'])return;return db['User'][_0xbe3d('0x54')]({'where':{'id':_0x5c981d[_0xbe3d('0x53')][_0xbe3d('0x5b')],'role':_0xbe3d('0x5a')},'attributes':['id','name','fullname',_0xbe3d('0x6a'),_0xbe3d('0x6b')],'raw':!![]});}return null;})[_0xbe3d('0x1c')](function(_0x5c733e){if(!_0x5c733e)return null;_0x34ab85['message']['agent']=_0x5c733e;return _0x34ab85;})[_0xbe3d('0x1c')](function(_0x388edf){if(_0x388edf){_0x388edf[_0xbe3d('0x23')][_0xbe3d('0x6d')]=util[_0xbe3d('0x58')](_0xbe3d('0x7c'),_0x5c981d['user']['name']);_0x388edf[_0xbe3d('0x23')]['channel']=_0x34ab85['channel'];_0x388edf[_0xbe3d('0x23')]['motionChannel']=_0x34ab85[_0xbe3d('0x6e')];_0x388edf[_0xbe3d('0x23')][_0xbe3d('0x70')]=_0xbe3d('0x74');respondWithRpcPromise('EventManager',_0xbe3d('0x72'),{'event':_0xbe3d('0x7d'),'message':_0x388edf[_0xbe3d('0x23')]},client9002);return _0x34ab85;}return null;})[_0xbe3d('0x1c')](respondWithResult(_0x2938d2,null))[_0xbe3d('0x25')](handleError(_0x2938d2,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ac41fe4..6c6583a 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 _0x3557=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x23dfc5,_0x317332){var _0x2e2ef4=function(_0x3d1931){while(--_0x3d1931){_0x23dfc5['push'](_0x23dfc5['shift']());}};_0x2e2ef4(++_0x317332);}(_0x3557,0xc6));var _0x7355=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0x3557[_0x4ce1b9];return _0x2bb15d;};'use strict';var EventEmitter=require(_0x7355('0x0'));var OpenchannelMessage=require(_0x7355('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7355('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7355('0x3')};function emitEvent(_0x477d8c){return function(_0x5b12c0,_0x52a811,_0x364c3a){OpenchannelMessageEvents[_0x7355('0x4')](_0x477d8c+':'+_0x5b12c0['id'],_0x5b12c0);OpenchannelMessageEvents[_0x7355('0x4')](_0x477d8c,_0x5b12c0);_0x364c3a(null);};}for(var e in events){if(events[_0x7355('0x5')](e)){var event=events[e];OpenchannelMessage[_0x7355('0x6')](e,emitEvent(event));}}module[_0x7355('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xfe80=['setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x160bd7,_0x4b9a11){var _0x319116=function(_0x3517c5){while(--_0x3517c5){_0x160bd7['push'](_0x160bd7['shift']());}};_0x319116(++_0x4b9a11);}(_0xfe80,0x1a3));var _0x0fe8=function(_0x141ed8,_0x5cfe0f){_0x141ed8=_0x141ed8-0x0;var _0x3a648c=_0xfe80[_0x141ed8];return _0x3a648c;};'use strict';var EventEmitter=require(_0x0fe8('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0fe8('0x1')](0x0);var events={'afterCreate':_0x0fe8('0x2'),'afterUpdate':_0x0fe8('0x3'),'afterDestroy':_0x0fe8('0x4')};function emitEvent(_0x20a66c){return function(_0x3c0dc0,_0x273387,_0x5e061a){OpenchannelMessageEvents[_0x0fe8('0x5')](_0x20a66c+':'+_0x3c0dc0['id'],_0x3c0dc0);OpenchannelMessageEvents[_0x0fe8('0x5')](_0x20a66c,_0x3c0dc0);_0x5e061a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x0fe8('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 8c76f7e..2f39a83 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 _0x9677=['request-promise','path','rimraf','../../config/environment','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','out','secret','UserId','OpenchannelInteraction','findOne','toLowerCase','error','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','Contact','method','GET','threadId','update','catch','inspect','utf8mb4','lodash','../../config/logger','bluebird'];(function(_0xac8859,_0x1c333e){var _0x550373=function(_0x1716d0){while(--_0x1716d0){_0xac8859['push'](_0xac8859['shift']());}};_0x550373(++_0x1c333e);}(_0x9677,0xad));var _0x7967=function(_0xa650d8,_0x6d01ef){_0xa650d8=_0xa650d8-0x0;var _0x79ce97=_0x9677[_0xa650d8];return _0x79ce97;};'use strict';var _=require(_0x7967('0x0'));var util=require('util');var logger=require(_0x7967('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7967('0x2'));var rp=require(_0x7967('0x3'));var fs=require('fs');var path=require(_0x7967('0x4'));var rimraf=require(_0x7967('0x5'));var config=require(_0x7967('0x6'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x295d21,_0x3a2542){return _0x295d21[_0x7967('0x7')](_0x7967('0x8'),attributes,{'tableName':_0x7967('0x9'),'paranoid':![],'indexes':[{'name':_0x7967('0xa'),'fields':[_0x7967('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x52529d,_0x5481ab,_0x5166a0){var _0x2fca7d=_0x295d21[_0x7967('0xc')];var _0x187cdb=_0x52529d[_0x7967('0xd')]({'plain':!![]});if(_0x187cdb[_0x7967('0xe')]['toLowerCase']()==='in'||_0x187cdb[_0x7967('0xe')]['toLowerCase']()===_0x7967('0xf')&&!_0x187cdb[_0x7967('0x10')]&&!_['isNil'](_0x187cdb[_0x7967('0x11')])){_0x2fca7d[_0x7967('0x12')][_0x7967('0x13')]({'where':{'id':_0x187cdb['OpenchannelInteractionId']}})['then'](function(_0x53be3e){if(_0x53be3e){_0x53be3e['update']({'lastMsgAt':_0x187cdb['createdAt'],'lastMsgDirection':_0x187cdb[_0x7967('0xe')][_0x7967('0x14')]()});}})['catch'](function(_0x4fcc12){console[_0x7967('0x15')](_0x4fcc12);});}if(_0x187cdb[_0x7967('0xe')]===_0x7967('0xf')&&!_0x187cdb['secret']){var _0x571f85;_0x2fca7d[_0x7967('0x16')]['describe']()[_0x7967('0x17')](function(_0x32a250){return _0x2fca7d[_0x7967('0x18')][_0x7967('0x19')]({'where':{'id':_0x187cdb[_0x7967('0x1a')]},'include':[{'model':_0x2fca7d[_0x7967('0x12')],'as':'Interactions','where':{'id':_0x187cdb[_0x7967('0x1b')]},'limit':0x1,'include':[{'model':_0x2fca7d[_0x7967('0x16')],'as':'Contact','attributes':_['keys'](_0x32a250)}]}]});})[_0x7967('0x17')](function(_0x132226){_0x571f85=_0x132226[_0x7967('0xd')]({'plain':!![]});if(_0x571f85&&_0x571f85[_0x7967('0x1c')]){logger[_0x7967('0x1d')](_0x7967('0x1e'),_0x7967('0x1f'),util[_0x7967('0x20')](_0x7967('0x21'),_0x187cdb['id'],_0x571f85[_0x7967('0x1c')]));if(_0x571f85[_0x7967('0x22')]&&_0x571f85[_0x7967('0x22')]['length']){_0x187cdb['Interaction']=_[_0x7967('0x23')](_0x571f85[_0x7967('0x22')][0x0],_0x7967('0x24'));_0x187cdb[_0x7967('0x24')]=_0x571f85[_0x7967('0x22')][0x0][_0x7967('0x24')];}var _0x5481ab={'method':'POST','uri':encodeURI(_0x571f85[_0x7967('0x1c')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5481ab[_0x7967('0x25')]){case _0x7967('0x26'):_0x5481ab['qs']=_0x187cdb;break;case'POST':_0x5481ab[_0x7967('0xb')]=_0x187cdb;break;}return rp(_0x5481ab)['then'](function(_0x294377){logger[_0x7967('0x1d')](_0x7967('0x1e'),_0x7967('0x1f'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x187cdb['id'],_0x571f85[_0x7967('0x1c')]));if(_0x294377[_0x7967('0xb')][_0x7967('0x27')]&&_0x294377['body'][_0x7967('0x27')]!=_0x187cdb['Interaction'][_0x7967('0x27')]){return _0x2fca7d['OpenchannelInteraction']['update']({'threadId':_0x294377['body'][_0x7967('0x27')]},{'where':{'id':_0x187cdb['Interaction']['id']}});}else{return;}})[_0x7967('0x17')](function(){return _0x52529d[_0x7967('0x28')]({'read':!![]});})[_0x7967('0x29')](function(_0x290832){logger[_0x7967('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x7967('0x1f'),util[_0x7967('0x2a')](_0x290832,{'showHidden':![],'depth':null}));_0x5166a0();});}else{_0x5166a0();}})['finally'](function(){_0x5166a0();});}else{_0x5166a0();}}},'charset':_0x7967('0x2b'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7e5d=['GET','POST','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','utf8mb4','utf8mb4_unicode_ci','lodash','moment','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','UserId','findOne','OpenchannelInteractionId','then','createdAt','catch','error','secret','describe','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','Contact','method'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x7e5d,0x128));var _0xd7e5=function(_0x24d683,_0x1ac495){_0x24d683=_0x24d683-0x0;var _0x156b11=_0x7e5d[_0x24d683];return _0x156b11;};'use strict';var _=require(_0xd7e5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd7e5('0x1'));var BPromise=require('bluebird');var rp=require(_0xd7e5('0x2'));var fs=require('fs');var path=require(_0xd7e5('0x3'));var rimraf=require(_0xd7e5('0x4'));var config=require(_0xd7e5('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0xd7e5('0x6')]=function(_0x5dd706,_0x38eb60){return _0x5dd706[_0xd7e5('0x7')](_0xd7e5('0x8'),attributes,{'tableName':_0xd7e5('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xd7e5('0xa')],'type':_0xd7e5('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f640e,_0x147d0b,_0x24c49e){var _0x326fdc=_0x5dd706[_0xd7e5('0xc')];var _0x1f04de=_0x4f640e[_0xd7e5('0xd')]({'plain':!![]});if(_0x1f04de[_0xd7e5('0xe')][_0xd7e5('0xf')]()==='in'||_0x1f04de[_0xd7e5('0xe')]['toLowerCase']()===_0xd7e5('0x10')&&!_0x1f04de['secret']&&!_['isNil'](_0x1f04de[_0xd7e5('0x11')])){_0x326fdc['OpenchannelInteraction'][_0xd7e5('0x12')]({'where':{'id':_0x1f04de[_0xd7e5('0x13')]}})[_0xd7e5('0x14')](function(_0x335c48){if(_0x335c48){_0x335c48['update']({'lastMsgAt':_0x1f04de[_0xd7e5('0x15')],'lastMsgDirection':_0x1f04de[_0xd7e5('0xe')][_0xd7e5('0xf')]()});}})[_0xd7e5('0x16')](function(_0x4a86b9){console[_0xd7e5('0x17')](_0x4a86b9);});}if(_0x1f04de['direction']==='out'&&!_0x1f04de[_0xd7e5('0x18')]){var _0x606af5;_0x326fdc['CmContact'][_0xd7e5('0x19')]()[_0xd7e5('0x14')](function(_0x25ffe4){return _0x326fdc['OpenchannelAccount']['find']({'where':{'id':_0x1f04de[_0xd7e5('0x1a')]},'include':[{'model':_0x326fdc[_0xd7e5('0x1b')],'as':_0xd7e5('0x1c'),'where':{'id':_0x1f04de[_0xd7e5('0x13')]},'limit':0x1,'include':[{'model':_0x326fdc[_0xd7e5('0x1d')],'as':'Contact','attributes':_['keys'](_0x25ffe4)}]}]});})[_0xd7e5('0x14')](function(_0x3f0275){_0x606af5=_0x3f0275['get']({'plain':!![]});if(_0x606af5&&_0x606af5['replyUri']){logger[_0xd7e5('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0xd7e5('0x1f'),util[_0xd7e5('0x20')](_0xd7e5('0x21'),_0x1f04de['id'],_0x606af5[_0xd7e5('0x22')]));if(_0x606af5[_0xd7e5('0x1c')]&&_0x606af5[_0xd7e5('0x1c')][_0xd7e5('0x23')]){_0x1f04de[_0xd7e5('0x24')]=_[_0xd7e5('0x25')](_0x606af5[_0xd7e5('0x1c')][0x0],_0xd7e5('0x26'));_0x1f04de[_0xd7e5('0x26')]=_0x606af5[_0xd7e5('0x1c')][0x0][_0xd7e5('0x26')];}var _0x147d0b={'method':'POST','uri':encodeURI(_0x606af5[_0xd7e5('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x147d0b[_0xd7e5('0x27')]){case _0xd7e5('0x28'):_0x147d0b['qs']=_0x1f04de;break;case _0xd7e5('0x29'):_0x147d0b[_0xd7e5('0xa')]=_0x1f04de;break;}return rp(_0x147d0b)['then'](function(_0xa1fc37){logger[_0xd7e5('0x1e')](_0xd7e5('0x2a'),'afterCreate',util['format'](_0xd7e5('0x2b'),_0x1f04de['id'],_0x606af5[_0xd7e5('0x22')]));if(_0xa1fc37['body'][_0xd7e5('0x2c')]&&_0xa1fc37[_0xd7e5('0xa')][_0xd7e5('0x2c')]!=_0x1f04de[_0xd7e5('0x24')]['threadId']){return _0x326fdc[_0xd7e5('0x1b')][_0xd7e5('0x2d')]({'threadId':_0xa1fc37[_0xd7e5('0xa')]['threadId']},{'where':{'id':_0x1f04de[_0xd7e5('0x24')]['id']}});}else{return;}})[_0xd7e5('0x14')](function(){return _0x4f640e[_0xd7e5('0x2d')]({'read':!![]});})[_0xd7e5('0x16')](function(_0x2bde22){logger[_0xd7e5('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0xd7e5('0x1f'),util['inspect'](_0x2bde22,{'showHidden':![],'depth':null}));_0x24c49e();});}else{_0x24c49e();}})['finally'](function(){_0x24c49e();});}else{_0x24c49e();}}},'charset':_0xd7e5('0x2e'),'collate':_0xd7e5('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index b50ef5e..0261371 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 _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x1dc98e,_0x47e503){var _0x48f6a3=function(_0x37697c){while(--_0x37697c){_0x1dc98e['push'](_0x1dc98e['shift']());}};_0x48f6a3(++_0x47e503);}(_0x2ef3,0xba));var _0x32ef=function(_0x3d159e,_0xdfe4aa){_0x3d159e=_0x3d159e-0x0;var _0x29e263=_0x2ef3[_0x3d159e];return _0x29e263;};'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});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2e6fe5,_0x30c233){var _0x231909=function(_0x441d93){while(--_0x441d93){_0x2e6fe5['push'](_0x2e6fe5['shift']());}};_0x231909(++_0x30c233);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ef30ad2..8796a2f 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 _0xaae7=['update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x3d7365,_0x13ccfb){var _0x3d96ac=function(_0x24135e){while(--_0x24135e){_0x3d7365['push'](_0x3d7365['shift']());}};_0x3d96ac(++_0x13ccfb);}(_0xaae7,0xa8));var _0x7aae=function(_0x7c1ec5,_0xdb3636){_0x7c1ec5=_0x7c1ec5-0x0;var _0x4db0ab=_0xaae7[_0x7c1ec5];return _0x4db0ab;};'use strict';var OpenchannelMessageEvents=require(_0x7aae('0x0'));var events=[_0x7aae('0x1'),_0x7aae('0x2'),_0x7aae('0x3')];function createListener(_0x2f1385,_0x33d08f){return function(_0x499bc8){_0x33d08f[_0x7aae('0x4')](_0x2f1385,_0x499bc8);};}function removeListener(_0x5b321c,_0x48ca8a){return function(){OpenchannelMessageEvents[_0x7aae('0x5')](_0x5b321c,_0x48ca8a);};}exports[_0x7aae('0x6')]=function(_0x42e3d6){for(var _0x426b84=0x0,_0x3455c3=events[_0x7aae('0x7')];_0x426b84<_0x3455c3;_0x426b84++){var _0x29e4c6=events[_0x426b84];var _0x11d511=createListener(_0x7aae('0x8')+_0x29e4c6,_0x42e3d6);OpenchannelMessageEvents['on'](_0x29e4c6,_0x11d511);}}; \ No newline at end of file +var _0xe132=['remove','update','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x7ab2dc,_0x176ed4){var _0x534aad=function(_0x2eebb1){while(--_0x2eebb1){_0x7ab2dc['push'](_0x7ab2dc['shift']());}};_0x534aad(++_0x176ed4);}(_0xe132,0x162));var _0x2e13=function(_0x399fcf,_0x2e2bbb){_0x399fcf=_0x399fcf-0x0;var _0x4dfcc1=_0xe132[_0x399fcf];return _0x4dfcc1;};'use strict';var OpenchannelMessageEvents=require(_0x2e13('0x0'));var events=['save',_0x2e13('0x1'),_0x2e13('0x2')];function createListener(_0x21dfef,_0x2c2bdd){return function(_0x2a5250){_0x2c2bdd['emit'](_0x21dfef,_0x2a5250);};}function removeListener(_0x1ae6a9,_0x3f01fe){return function(){OpenchannelMessageEvents['removeListener'](_0x1ae6a9,_0x3f01fe);};}exports['register']=function(_0x260dc1){for(var _0x2f9d00=0x0,_0x1c670b=events[_0x2e13('0x3')];_0x2f9d00<_0x1c670b;_0x2f9d00++){var _0x3be5dc=events[_0x2f9d00];var _0x2d9487=createListener(_0x2e13('0x4')+_0x3be5dc,_0x260dc1);OpenchannelMessageEvents['on'](_0x3be5dc,_0x2d9487);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 0245860..8950c48 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 _0xb2b7=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','removeTeams','delete','exports'];(function(_0x2f3947,_0x2ee083){var _0x3e6ab7=function(_0x4057c0){while(--_0x4057c0){_0x2f3947['push'](_0x2f3947['shift']());}};_0x3e6ab7(++_0x2ee083);}(_0xb2b7,0x179));var _0x7b2b=function(_0x298aed,_0x4334ce){_0x298aed=_0x298aed-0x0;var _0x58edbc=_0xb2b7[_0x298aed];return _0x58edbc;};'use strict';var multer=require(_0x7b2b('0x0'));var util=require('util');var path=require(_0x7b2b('0x1'));var timeout=require(_0x7b2b('0x2'));var express=require(_0x7b2b('0x3'));var router=express[_0x7b2b('0x4')]();var fs_extra=require(_0x7b2b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7b2b('0x6'));var config=require('../../config/environment');var controller=require(_0x7b2b('0x7'));router[_0x7b2b('0x8')]('/',auth[_0x7b2b('0x9')](),controller[_0x7b2b('0xa')]);router[_0x7b2b('0x8')]('/describe',auth[_0x7b2b('0x9')](),controller[_0x7b2b('0xb')]);router[_0x7b2b('0x8')](_0x7b2b('0xc'),auth[_0x7b2b('0x9')](),controller[_0x7b2b('0xd')]);router['get'](_0x7b2b('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x7b2b('0x8')](_0x7b2b('0xf'),auth[_0x7b2b('0x9')](),controller[_0x7b2b('0x10')]);router[_0x7b2b('0x8')](_0x7b2b('0x11'),auth['isAuthenticated'](),controller[_0x7b2b('0x12')]);router[_0x7b2b('0x13')]('/',auth[_0x7b2b('0x9')](),controller[_0x7b2b('0x14')]);router[_0x7b2b('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7b2b('0x15')]);router[_0x7b2b('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x7b2b('0x16')]);router[_0x7b2b('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b2b('0x18')]);router['delete']('/:id',auth[_0x7b2b('0x9')](),controller[_0x7b2b('0x19')]);router['delete'](_0x7b2b('0xf'),auth[_0x7b2b('0x9')](),controller[_0x7b2b('0x1a')]);router[_0x7b2b('0x1b')](_0x7b2b('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7b2b('0x1c')]=router; \ No newline at end of file +var _0x9450=['update','delete','/:id/users','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getAgents','post','create','addTeams','addAgents','put','/:id'];(function(_0x207bcc,_0x23b059){var _0x236f9e=function(_0x48bac8){while(--_0x48bac8){_0x207bcc['push'](_0x207bcc['shift']());}};_0x236f9e(++_0x23b059);}(_0x9450,0x6f));var _0x0945=function(_0x4126b9,_0x5087cd){_0x4126b9=_0x4126b9-0x0;var _0x4ff625=_0x9450[_0x4126b9];return _0x4ff625;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0945('0x0'));var timeout=require(_0x0945('0x1'));var express=require(_0x0945('0x2'));var router=express[_0x0945('0x3')]();var fs_extra=require(_0x0945('0x4'));var auth=require(_0x0945('0x5'));var interaction=require(_0x0945('0x6'));var config=require(_0x0945('0x7'));var controller=require(_0x0945('0x8'));router[_0x0945('0x9')]('/',auth[_0x0945('0xa')](),controller[_0x0945('0xb')]);router[_0x0945('0x9')](_0x0945('0xc'),auth[_0x0945('0xa')](),controller[_0x0945('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0945('0xe')]);router[_0x0945('0x9')]('/:id/members',auth[_0x0945('0xa')](),controller[_0x0945('0xf')]);router[_0x0945('0x9')](_0x0945('0x10'),auth[_0x0945('0xa')](),controller['getTeams']);router['get']('/:id/users',auth[_0x0945('0xa')](),controller[_0x0945('0x11')]);router[_0x0945('0x12')]('/',auth[_0x0945('0xa')](),controller[_0x0945('0x13')]);router[_0x0945('0x12')](_0x0945('0x10'),auth[_0x0945('0xa')](),controller[_0x0945('0x14')]);router[_0x0945('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x0945('0x15')]);router[_0x0945('0x16')](_0x0945('0x17'),auth[_0x0945('0xa')](),controller[_0x0945('0x18')]);router[_0x0945('0x19')](_0x0945('0x17'),auth['isAuthenticated'](),controller['destroy']);router[_0x0945('0x19')](_0x0945('0x10'),auth[_0x0945('0xa')](),controller['removeTeams']);router[_0x0945('0x19')](_0x0945('0x1a'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 006508c..c111be7 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 _0xc893=['name','INTEGER','ENUM','rrmemory','sequelize','STRING'];(function(_0x4b8da0,_0x24a5c7){var _0xd8024=function(_0x4734dc){while(--_0x4734dc){_0x4b8da0['push'](_0x4b8da0['shift']());}};_0xd8024(++_0x24a5c7);}(_0xc893,0x7c));var _0x3c89=function(_0x5a18f2,_0x2286ad){_0x5a18f2=_0x5a18f2-0x0;var _0x542682=_0xc893[_0x5a18f2];return _0x542682;};'use strict';var Sequelize=require(_0x3c89('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c89('0x1')],'unique':_0x3c89('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3c89('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3c89('0x4')](_0x3c89('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xfbf7=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0xfbf7,0xff));var _0x7fbf=function(_0x59b159,_0x38ebb1){_0x59b159=_0x59b159-0x0;var _0x425692=_0xfbf7[_0x59b159];return _0x425692;};'use strict';var Sequelize=require(_0x7fbf('0x0'));module[_0x7fbf('0x1')]={'name':{'type':Sequelize[_0x7fbf('0x2')],'unique':_0x7fbf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7fbf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7fbf('0x5')](_0x7fbf('0x6'),_0x7fbf('0x7'),_0x7fbf('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 8fa00d7..d2d5bee 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 _0x1c36=['rows','show','model','rawAttributes','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','filter','User','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','pick','addTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','UserOpenchannelQueue','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','value','ids','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','where','OpenchannelQueue','count','include','query','findAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1c36,0x1ba));var _0x61c3=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x1c36[_0x21549c];return _0x426cbd;};'use strict';var BPromise=require(_0x61c3('0x0'));var util=require('util');var _=require(_0x61c3('0x1'));var squel=require(_0x61c3('0x2'));var Redis=require(_0x61c3('0x3'));var qs=require(_0x61c3('0x4'));var logger=require('../../config/logger')('api');var config=require(_0x61c3('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x61c3('0x6')](config['redis'],{'host':_0x61c3('0x7'),'port':0x18eb});var socket=require(_0x61c3('0x8'))(new Redis(config[_0x61c3('0x9')]));require(_0x61c3('0xa'))[_0x61c3('0xb')](socket);function respondWithStatusCode(_0xf2df4f,_0x574477){_0x574477=_0x574477||0xcc;return function(_0x32c396){if(_0x32c396){return _0xf2df4f[_0x61c3('0xc')](_0x574477);}return _0xf2df4f[_0x61c3('0xd')](_0x574477)[_0x61c3('0xe')]();};}function respondWithResult(_0x1834ae,_0x3b3f7d){_0x3b3f7d=_0x3b3f7d||0xc8;return function(_0x29729d){if(_0x29729d){return _0x1834ae[_0x61c3('0xd')](_0x3b3f7d)[_0x61c3('0xf')](_0x29729d);}};}function respondWithFilteredResult(_0x4779b7,_0x373c93){return function(_0x16b19f){if(_0x16b19f){var _0x17c81c=typeof _0x373c93[_0x61c3('0x10')]===_0x61c3('0x11')&&typeof _0x373c93[_0x61c3('0x12')]==='undefined';var _0xb36c71=_0x16b19f['count'];var _0x3d9610=_0x17c81c?0x0:_0x373c93[_0x61c3('0x10')];var _0x21dbaf=_0x17c81c?_0x16b19f['count']:_0x373c93[_0x61c3('0x10')]+_0x373c93[_0x61c3('0x12')];var _0x3eed26;if(_0x21dbaf>=_0xb36c71){_0x21dbaf=_0xb36c71;_0x3eed26=0xc8;}else{_0x3eed26=0xce;}_0x4779b7['status'](_0x3eed26);return _0x4779b7[_0x61c3('0x13')](_0x61c3('0x14'),_0x3d9610+'-'+_0x21dbaf+'/'+_0xb36c71)[_0x61c3('0xf')](_0x16b19f);}return null;};}function saveUpdates(_0xa992b8){return function(_0x1de264){if(_0x1de264){return _0x1de264[_0x61c3('0x15')](_0xa992b8)[_0x61c3('0x16')](function(_0x4f3841){return _0x4f3841;});}return null;};}function removeEntity(_0x5a6168){return function(_0x514462){if(_0x514462){return _0x514462[_0x61c3('0x17')]()[_0x61c3('0x16')](function(){var _0x356d54=_0x514462['get']({'plain':!![]});var _0x110345=_0x61c3('0x18');return db[_0x61c3('0x19')][_0x61c3('0x17')]({'where':{'type':_0x110345,'resourceId':_0x356d54['id']}})[_0x61c3('0x16')](function(){return _0x514462;});})[_0x61c3('0x16')](function(){_0x5a6168[_0x61c3('0xd')](0xcc)[_0x61c3('0xe')]();});}};}function handleEntityNotFound(_0x5312dd){return function(_0x5b5ff1){if(!_0x5b5ff1){_0x5312dd[_0x61c3('0xc')](0x194);}return _0x5b5ff1;};}function handleError(_0x26a431,_0x11700c){_0x11700c=_0x11700c||0x1f4;return function(_0x51814e){logger[_0x61c3('0x1a')](_0x51814e[_0x61c3('0x1b')]);if(_0x51814e[_0x61c3('0x1c')]){delete _0x51814e[_0x61c3('0x1c')];}_0x26a431['status'](_0x11700c)[_0x61c3('0x1d')](_0x51814e);};}exports[_0x61c3('0x1e')]=function(_0x32369c,_0x1ae909){var _0x1c3df4={};var _0x1f85b9={'count':0x0,'rows':[]};var _0x2d3265=_[_0x61c3('0x1f')](db['OpenchannelQueue']['rawAttributes'],function(_0x30ac3d){return{'name':_0x30ac3d['fieldName'],'type':_0x30ac3d['type']['key']};});_0x1c3df4=qs['getOptions'](_0x2d3265,_0x32369c);var _0x33b12d={'where':_0x1c3df4[_0x61c3('0x20')]};return db[_0x61c3('0x21')]['count'](_0x33b12d)[_0x61c3('0x16')](function(_0x52dd61){_0x1f85b9[_0x61c3('0x22')]=_0x52dd61;_0x1c3df4['include']=qs[_0x61c3('0x23')](_0x32369c[_0x61c3('0x24')]);return db[_0x61c3('0x21')][_0x61c3('0x25')](_0x1c3df4);})['then'](function(_0xcdff94){_0x1f85b9[_0x61c3('0x26')]=_0xcdff94;return _0x1f85b9;})[_0x61c3('0x16')](respondWithFilteredResult(_0x1ae909,_0x1c3df4))['catch'](handleError(_0x1ae909,null));};exports[_0x61c3('0x27')]=function(_0x207ee6,_0x13ef84){var _0x8c4a2d={'raw':!![],'where':{'id':_0x207ee6['params']['id']}},_0x12a8b6={};_0x12a8b6[_0x61c3('0x28')]=_['keys'](db['OpenchannelQueue'][_0x61c3('0x29')]);_0x12a8b6['query']=_[_0x61c3('0x2a')](_0x207ee6[_0x61c3('0x24')]);_0x12a8b6[_0x61c3('0x2b')]=_[_0x61c3('0x2c')](_0x12a8b6[_0x61c3('0x28')],_0x12a8b6['query']);_0x8c4a2d[_0x61c3('0x2d')]=_['intersection'](_0x12a8b6[_0x61c3('0x28')],qs[_0x61c3('0x2e')](_0x207ee6[_0x61c3('0x24')]['fields']));_0x8c4a2d['attributes']=_0x8c4a2d[_0x61c3('0x2d')][_0x61c3('0x2f')]?_0x8c4a2d[_0x61c3('0x2d')]:_0x12a8b6[_0x61c3('0x28')];if(_0x207ee6[_0x61c3('0x24')][_0x61c3('0x30')]){_0x8c4a2d[_0x61c3('0x23')]=[{'all':!![]}];}_0x8c4a2d=_[_0x61c3('0x31')]({},_0x8c4a2d,_0x207ee6[_0x61c3('0x32')]);return db['OpenchannelQueue']['find'](_0x8c4a2d)[_0x61c3('0x16')](handleEntityNotFound(_0x13ef84,null))[_0x61c3('0x16')](respondWithResult(_0x13ef84,null))[_0x61c3('0x33')](handleError(_0x13ef84,null));};exports[_0x61c3('0x34')]=function(_0x3fc801,_0x3caa03){return db['OpenchannelQueue'][_0x61c3('0x34')](_0x3fc801[_0x61c3('0x35')],{})[_0x61c3('0x16')](function(_0x32a76d){var _0xa343a=_0x3fc801[_0x61c3('0x36')][_0x61c3('0x37')]({'plain':!![]});if(!_0xa343a)throw new Error(_0x61c3('0x38'));if(_0xa343a[_0x61c3('0x39')]===_0x61c3('0x36')){var _0x1d9c5b=_0x32a76d['get']({'plain':!![]});var _0x49e473='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x49e473,'userProfileId':_0xa343a[_0x61c3('0x3a')]},'raw':!![]})[_0x61c3('0x16')](function(_0x46482b){if(_0x46482b&&_0x46482b['autoAssociation']===0x0){return db[_0x61c3('0x19')][_0x61c3('0x34')]({'name':_0x1d9c5b[_0x61c3('0x1c')],'resourceId':_0x1d9c5b['id'],'type':_0x46482b[_0x61c3('0x1c')],'sectionId':_0x46482b['id']},{})['then'](function(){return _0x32a76d;});}else{return _0x32a76d;}})[_0x61c3('0x33')](function(_0x582956){logger[_0x61c3('0x1a')](_0x61c3('0x3b'),_0x582956);throw _0x582956;});}return _0x32a76d;})['then'](respondWithResult(_0x3caa03,0xc9))[_0x61c3('0x33')](handleError(_0x3caa03,null));};exports[_0x61c3('0x15')]=function(_0x575257,_0x3c2291){if(_0x575257[_0x61c3('0x35')]['id']){delete _0x575257['body']['id'];}return db[_0x61c3('0x21')][_0x61c3('0x3c')]({'where':{'id':_0x575257[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](handleEntityNotFound(_0x3c2291,null))[_0x61c3('0x16')](saveUpdates(_0x575257[_0x61c3('0x35')],null))[_0x61c3('0x16')](respondWithResult(_0x3c2291,null))[_0x61c3('0x33')](handleError(_0x3c2291,null));};exports[_0x61c3('0x17')]=function(_0x137ad1,_0x3cebb2){return db[_0x61c3('0x21')]['find']({'where':{'id':_0x137ad1[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](handleEntityNotFound(_0x3cebb2,null))['then'](removeEntity(_0x3cebb2,null))[_0x61c3('0x33')](handleError(_0x3cebb2,null));};exports[_0x61c3('0x3e')]=function(_0x44fcb3,_0x13c2b5){return db[_0x61c3('0x21')]['describe']()[_0x61c3('0x16')](respondWithResult(_0x13c2b5,null))[_0x61c3('0x33')](handleError(_0x13c2b5,null));};exports[_0x61c3('0x3f')]=function(_0xa61d3c,_0x1ff060){var _0x4aa8c1={'raw':!![],'where':{}},_0x156454={},_0x53cec1;return db['OpenchannelQueue'][_0x61c3('0x40')]({'where':{'id':_0xa61d3c[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](handleEntityNotFound(_0x1ff060,null))['then'](function(_0x3e053d){if(_0x3e053d){_0x53cec1=_0x3e053d[_0x61c3('0x37')]({'plain':!![]});_0x156454[_0x61c3('0x28')]=_[_0x61c3('0x2a')](db['UserOpenchannelQueue'][_0x61c3('0x29')]);_0x156454[_0x61c3('0x24')]=_[_0x61c3('0x2a')](_0xa61d3c['query']);_0x156454[_0x61c3('0x2b')]=_[_0x61c3('0x2c')](_0x156454['model'],_0x156454[_0x61c3('0x24')]);_0x4aa8c1[_0x61c3('0x2d')]=_[_0x61c3('0x2c')](_0x156454['model'],qs[_0x61c3('0x2e')](_0xa61d3c[_0x61c3('0x24')][_0x61c3('0x2e')]));_0x4aa8c1[_0x61c3('0x2d')]=_0x4aa8c1[_0x61c3('0x2d')][_0x61c3('0x2f')]?_0x4aa8c1[_0x61c3('0x2d')]:_0x156454['model'];if(!_0xa61d3c[_0x61c3('0x24')][_0x61c3('0x41')](_0x61c3('0x42'))){_0x4aa8c1[_0x61c3('0x12')]=qs[_0x61c3('0x12')](_0xa61d3c[_0x61c3('0x24')][_0x61c3('0x12')]);_0x4aa8c1[_0x61c3('0x10')]=qs['offset'](_0xa61d3c['query'][_0x61c3('0x10')]);}_0x4aa8c1[_0x61c3('0x43')]=qs['sort'](_0xa61d3c['query'][_0x61c3('0x44')]);_0x4aa8c1[_0x61c3('0x20')]=qs[_0x61c3('0x2b')](_['pick'](_0xa61d3c[_0x61c3('0x24')],_0x156454['filters']));_0x4aa8c1[_0x61c3('0x20')]['OpenchannelQueueId']=_0x3e053d['id'];if(_0xa61d3c['query'][_0x61c3('0x45')]){_0x4aa8c1[_0x61c3('0x20')]=_[_0x61c3('0x31')](_0x4aa8c1['where'],{'$or':_[_0x61c3('0x1f')](_0x4aa8c1['attributes'],function(_0x3b92fa){var _0x19405b={};_0x19405b[_0x3b92fa]={'$like':'%'+_0xa61d3c[_0x61c3('0x24')][_0x61c3('0x45')]+'%'};return _0x19405b;})});}_0x4aa8c1=_[_0x61c3('0x31')]({},_0x4aa8c1,_0xa61d3c[_0x61c3('0x32')]);return db['UserOpenchannelQueue']['findAll'](_0x4aa8c1);}})[_0x61c3('0x16')](function(_0x2e1cf8){if(_0x2e1cf8){return db[_0x61c3('0x46')]['findAndCountAll']({'where':{'id':_[_0x61c3('0x1f')](_0x2e1cf8,'UserId'),'role':_0x61c3('0x47')},'attributes':['id',_0x61c3('0x1c'),_0x61c3('0x48'),_0x61c3('0x49'),_0x61c3('0x4a')]});}})[_0x61c3('0x16')](function(_0x1dd467){if(_0x1dd467){return{'count':_0x1dd467[_0x61c3('0x22')],'rows':_['map'](_0x1dd467[_0x61c3('0x26')],function(_0x1a7573){return{'membername':_0x1a7573['name'],'UserId':_0x1a7573['id'],'queue_name':_0x53cec1['name'],'OpenchannelQueueId':_0x53cec1['id'],'interface':util[_0x61c3('0x4b')](_0x61c3('0x4c'),_0x61c3('0x4d'),_0x1a7573[_0x61c3('0x1c')]),'penalty':0x0,'paused':_0x1a7573[_0x61c3('0x48')],'createdAt':_0x1a7573[_0x61c3('0x4a')],'updatedAt':_0x1a7573['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1ff060,_0x4aa8c1))[_0x61c3('0x33')](handleError(_0x1ff060,null));};exports[_0x61c3('0x4e')]=function(_0x26b404,_0x2fcb1a){var _0x5ee675={};var _0x535146={};var _0x43ae2a;var _0x3989d6;return db[_0x61c3('0x21')][_0x61c3('0x40')]({'where':{'id':_0x26b404[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](handleEntityNotFound(_0x2fcb1a,null))[_0x61c3('0x16')](function(_0x303caa){if(_0x303caa){_0x43ae2a=_0x303caa;_0x535146[_0x61c3('0x28')]=_[_0x61c3('0x2a')](db['Team']['rawAttributes']);_0x535146[_0x61c3('0x24')]=_[_0x61c3('0x2a')](_0x26b404[_0x61c3('0x24')]);_0x535146[_0x61c3('0x2b')]=_['intersection'](_0x535146[_0x61c3('0x28')],_0x535146['query']);_0x5ee675[_0x61c3('0x2d')]=_['intersection'](_0x535146[_0x61c3('0x28')],qs[_0x61c3('0x2e')](_0x26b404[_0x61c3('0x24')][_0x61c3('0x2e')]));_0x5ee675[_0x61c3('0x2d')]=_0x5ee675['attributes'][_0x61c3('0x2f')]?_0x5ee675['attributes']:_0x535146[_0x61c3('0x28')];_0x5ee675['order']=qs[_0x61c3('0x44')](_0x26b404[_0x61c3('0x24')][_0x61c3('0x44')]);_0x5ee675['where']=qs[_0x61c3('0x2b')](_[_0x61c3('0x4f')](_0x26b404[_0x61c3('0x24')],_0x535146[_0x61c3('0x2b')]));if(_0x26b404['query'][_0x61c3('0x45')]){_0x5ee675['where']=_[_0x61c3('0x31')](_0x5ee675[_0x61c3('0x20')],{'$or':_['map'](_0x5ee675['attributes'],function(_0x56993a){var _0x297c90={};_0x297c90[_0x56993a]={'$like':'%'+_0x26b404[_0x61c3('0x24')][_0x61c3('0x45')]+'%'};return _0x297c90;})});}_0x5ee675=_[_0x61c3('0x31')]({},_0x5ee675,_0x26b404[_0x61c3('0x32')]);return _0x43ae2a[_0x61c3('0x4e')](_0x5ee675);}})[_0x61c3('0x16')](function(_0x1829a3){if(_0x1829a3){_0x3989d6=_0x1829a3[_0x61c3('0x2f')];if(!_0x26b404[_0x61c3('0x24')]['hasOwnProperty'](_0x61c3('0x42'))){_0x5ee675[_0x61c3('0x12')]=qs[_0x61c3('0x12')](_0x26b404['query'][_0x61c3('0x12')]);_0x5ee675[_0x61c3('0x10')]=qs[_0x61c3('0x10')](_0x26b404['query'][_0x61c3('0x10')]);}return _0x43ae2a[_0x61c3('0x4e')](_0x5ee675);}})[_0x61c3('0x16')](function(_0x26fec4){if(_0x26fec4){return _0x26fec4?{'count':_0x3989d6,'rows':_0x26fec4}:null;}})[_0x61c3('0x16')](respondWithResult(_0x2fcb1a,null))[_0x61c3('0x33')](handleError(_0x2fcb1a,null));};exports[_0x61c3('0x50')]=function(_0x4190bf,_0x1dab6e){var _0x545e59=_0x4190bf[_0x61c3('0x35')]['ids'];return db[_0x61c3('0x51')][_0x61c3('0x25')]({'where':{'id':_0x545e59},'attributes':['id'],'include':[{'model':db[_0x61c3('0x46')],'as':_0x61c3('0x52'),'attributes':['id','name','online',_0x61c3('0x53'),_0x61c3('0x54')],'raw':!![]}]})[_0x61c3('0x16')](function(_0x35330b){if(_0x35330b){var _0x46e4d8=_[_0x61c3('0x55')](_0x35330b,function(_0x303c13){var _0x4947c8=_0x303c13['get']({'plain':!![]});return _0x4947c8[_0x61c3('0x52')];});return db['OpenchannelQueue'][_0x61c3('0x3c')]({'where':{'id':_0x4190bf[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](function(_0x1593d7){return db[_0x61c3('0x56')][_0x61c3('0x57')](function(_0x26cfe2){return _0x1593d7[_0x61c3('0x50')](_0x545e59,{'transaction':_0x26cfe2})[_0x61c3('0x16')](function(){return BPromise[_0x61c3('0x58')](_0x46e4d8,function(_0x526ea7){return db[_0x61c3('0x59')]['findOrCreate']({'where':{'UserId':_0x526ea7['id'],'OpenchannelQueueId':_0x4190bf[_0x61c3('0x3d')]['id']},'transaction':_0x26cfe2});});})[_0x61c3('0x16')](function(){_0x46e4d8[_0x61c3('0x5a')](function(_0x52bfeb){socket[_0x61c3('0x5b')](_0x61c3('0x5c'),{'UserId':_0x52bfeb['id'],'OpenchannelQueueId':_0x1593d7['id']});});});});});}})['then'](respondWithStatusCode(_0x1dab6e,null))['catch'](handleError(_0x1dab6e,null));};exports[_0x61c3('0x5d')]=function(_0x1df255,_0x25630b){return db[_0x61c3('0x51')][_0x61c3('0x25')]({'where':{'id':_0x1df255[_0x61c3('0x24')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x61c3('0x52'),'attributes':['id'],'raw':!![]}]})[_0x61c3('0x16')](handleEntityNotFound(_0x25630b,null))[_0x61c3('0x16')](function(_0x7e06f3){var _0x39f43a=_['map'](_0x7e06f3,'id');var _0x3c7b0f=[];var _0x21dae7=[];var _0x5df485=squel[_0x61c3('0x5e')]();_0x5df485[_0x61c3('0x5f')]('tq.TeamId')[_0x61c3('0x60')]('team_has_openchannel_queues','tq')[_0x61c3('0x61')](_0x61c3('0x62'),'ut',_0x61c3('0x63'))['where'](_0x61c3('0x64'),_0x1df255['params']['id']);for(var _0x5e53b5=0x0;_0x5e53b5<_0x7e06f3[_0x61c3('0x2f')];_0x5e53b5+=0x1){let _0x54b2fc=_0x7e06f3[_0x5e53b5];for(var _0x59e328=0x0;_0x59e328<_0x54b2fc['Agents']['length'];_0x59e328+=0x1){let _0x53c428=_0x54b2fc[_0x61c3('0x52')][_0x59e328];var _0x306fa4=_0x5df485[_0x61c3('0x65')]();_0x306fa4[_0x61c3('0x20')](_0x61c3('0x66'),_0x53c428['id']);_0x21dae7[_0x61c3('0x67')](db['sequelize'][_0x61c3('0x24')](_0x306fa4[_0x61c3('0x68')](),{'type':db[_0x61c3('0x56')][_0x61c3('0x69')]['SELECT']})['then'](function(_0x16bcbd){if(_0x16bcbd[_0x61c3('0x2f')]===0x1){return _0x53c428['id'];}else{var _0x1effbf=_[_0x61c3('0x6a')](_[_0x61c3('0x1f')](_0x16bcbd,'TeamId'),function(_0x5cfa6b){return _[_0x61c3('0x6b')](_0x39f43a,_0x5cfa6b);});if(_0x1effbf){return _0x53c428['id'];}}}));}}return BPromise[_0x61c3('0x6c')](_0x21dae7)[_0x61c3('0x16')](function(_0xb4661c){_0x3c7b0f=_(_0x3c7b0f)[_0x61c3('0x6d')](_0xb4661c)['compact']()[_0x61c3('0x6e')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x1df255[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](function(_0x56e161){return db[_0x61c3('0x56')][_0x61c3('0x57')](function(_0x35fdeb){return _0x56e161[_0x61c3('0x5d')](_0x1df255['query'][_0x61c3('0x6f')],{'transaction':_0x35fdeb})[_0x61c3('0x16')](function(){if(!_[_0x61c3('0x70')](_0x3c7b0f)){return _0x56e161[_0x61c3('0x71')](_0x3c7b0f,{'transaction':_0x35fdeb});}})[_0x61c3('0x16')](function(){_0x3c7b0f[_0x61c3('0x5a')](function(_0x589f9f){socket[_0x61c3('0x5b')]('userOpenchannelQueue:remove',{'UserId':_0x589f9f,'OpenchannelQueueId':_0x56e161['id']});});});});});});})[_0x61c3('0x16')](respondWithStatusCode(_0x25630b,null))[_0x61c3('0x33')](handleError(_0x25630b,null));};exports[_0x61c3('0x72')]=function(_0x205686,_0x23f118){return db[_0x61c3('0x21')][_0x61c3('0x3c')]({'where':{'id':_0x205686[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](handleEntityNotFound(_0x23f118,null))[_0x61c3('0x16')](function(_0x563970){if(_0x563970){return _0x563970[_0x61c3('0x72')](_0x205686[_0x61c3('0x35')][_0x61c3('0x6f')],_[_0x61c3('0x73')](_0x205686[_0x61c3('0x35')],[_0x61c3('0x6f'),'id'])||{})[_0x61c3('0x74')](function(_0x15c650){for(var _0x51d1a0=0x0;_0x51d1a0<_0x205686[_0x61c3('0x35')]['ids']['length'];_0x51d1a0+=0x1){socket[_0x61c3('0x5b')](_0x61c3('0x5c'),{'UserId':Number(_0x205686[_0x61c3('0x35')][_0x61c3('0x6f')][_0x51d1a0]),'OpenchannelQueueId':Number(_0x205686['params']['id'])});}return _0x15c650;});}})[_0x61c3('0x16')](respondWithResult(_0x23f118,null))[_0x61c3('0x33')](handleError(_0x23f118,null));};exports[_0x61c3('0x71')]=function(_0x3f7b81,_0x31969d){return db[_0x61c3('0x21')][_0x61c3('0x3c')]({'where':{'id':_0x3f7b81['params']['id']}})['then'](handleEntityNotFound(_0x31969d,null))[_0x61c3('0x16')](function(_0x5dda6c){if(_0x5dda6c){return _0x5dda6c[_0x61c3('0x71')](_0x3f7b81[_0x61c3('0x24')]['ids'])[_0x61c3('0x16')](function(){if(_[_0x61c3('0x75')](_0x3f7b81[_0x61c3('0x24')][_0x61c3('0x6f')])){for(var _0x479331=0x0;_0x479331<_0x3f7b81[_0x61c3('0x24')][_0x61c3('0x6f')][_0x61c3('0x2f')];_0x479331+=0x1){socket[_0x61c3('0x5b')](_0x61c3('0x76'),{'UserId':Number(_0x3f7b81[_0x61c3('0x24')][_0x61c3('0x6f')][_0x479331]),'OpenchannelQueueId':Number(_0x3f7b81[_0x61c3('0x3d')]['id'])});}}else{socket[_0x61c3('0x5b')](_0x61c3('0x76'),{'UserId':Number(_0x3f7b81[_0x61c3('0x24')]['ids']),'OpenchannelQueueId':Number(_0x3f7b81[_0x61c3('0x3d')]['id'])});}});}})[_0x61c3('0x16')](respondWithStatusCode(_0x31969d,null))[_0x61c3('0x33')](handleError(_0x31969d,null));};exports[_0x61c3('0x77')]=function(_0x3cbb15,_0xe69527){var _0x30aaf8={};var _0x3d7097={};var _0x505f07;var _0x1de32d;return db[_0x61c3('0x21')]['findOne']({'where':{'id':_0x3cbb15[_0x61c3('0x3d')]['id']}})[_0x61c3('0x16')](handleEntityNotFound(_0xe69527,null))['then'](function(_0x5cfcd5){if(_0x5cfcd5){_0x505f07=_0x5cfcd5;_0x3d7097[_0x61c3('0x28')]=_[_0x61c3('0x2a')](db[_0x61c3('0x46')][_0x61c3('0x29')]);_0x3d7097['query']=_[_0x61c3('0x2a')](_0x3cbb15[_0x61c3('0x24')]);_0x3d7097[_0x61c3('0x2b')]=_[_0x61c3('0x2c')](_0x3d7097[_0x61c3('0x28')],_0x3d7097['query']);_0x30aaf8[_0x61c3('0x2d')]=_[_0x61c3('0x2c')](_0x3d7097[_0x61c3('0x28')],qs[_0x61c3('0x2e')](_0x3cbb15[_0x61c3('0x24')][_0x61c3('0x2e')]));_0x30aaf8[_0x61c3('0x2d')]=_0x30aaf8[_0x61c3('0x2d')][_0x61c3('0x2f')]?_0x30aaf8[_0x61c3('0x2d')]:_0x3d7097[_0x61c3('0x28')];_0x30aaf8[_0x61c3('0x43')]=qs[_0x61c3('0x44')](_0x3cbb15[_0x61c3('0x24')]['sort']);_0x30aaf8[_0x61c3('0x20')]=qs['filters'](_[_0x61c3('0x4f')](_0x3cbb15[_0x61c3('0x24')],_0x3d7097[_0x61c3('0x2b')]));if(_0x3cbb15['query'][_0x61c3('0x45')]){_0x30aaf8[_0x61c3('0x20')]=_[_0x61c3('0x31')](_0x30aaf8[_0x61c3('0x20')],{'$or':_[_0x61c3('0x1f')](_0x30aaf8[_0x61c3('0x2d')],function(_0x103be7){var _0x4bba6c={};_0x4bba6c[_0x103be7]={'$like':'%'+_0x3cbb15[_0x61c3('0x24')][_0x61c3('0x45')]+'%'};return _0x4bba6c;})});}_0x30aaf8=_[_0x61c3('0x31')]({},_0x30aaf8,_0x3cbb15[_0x61c3('0x32')]);return _0x505f07[_0x61c3('0x77')](_0x30aaf8);}})[_0x61c3('0x16')](function(_0x54c6b1){if(_0x54c6b1){_0x1de32d=_0x54c6b1[_0x61c3('0x2f')];if(!_0x3cbb15[_0x61c3('0x24')][_0x61c3('0x41')](_0x61c3('0x42'))){_0x30aaf8['limit']=qs[_0x61c3('0x12')](_0x3cbb15[_0x61c3('0x24')]['limit']);_0x30aaf8[_0x61c3('0x10')]=qs['offset'](_0x3cbb15[_0x61c3('0x24')][_0x61c3('0x10')]);}return _0x505f07[_0x61c3('0x77')](_0x30aaf8);}})[_0x61c3('0x16')](function(_0x4cba2d){if(_0x4cba2d){return _0x4cba2d?{'count':_0x1de32d,'rows':_0x4cba2d}:null;}})[_0x61c3('0x16')](respondWithResult(_0xe69527,null))['catch'](handleError(_0xe69527,null));}; \ No newline at end of file +var _0xdeaa=['update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','catch','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','nolimit','sort','filter','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','order','pick','addTeams','ids','Team','Agents','voicePause','flatMap','transaction','each','UserOpenchannelQueue','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x1dcb69,_0x314902){var _0x1ae3b6=function(_0x5e4013){while(--_0x5e4013){_0x1dcb69['push'](_0x1dcb69['shift']());}};_0x1ae3b6(++_0x314902);}(_0xdeaa,0x150));var _0xadea=function(_0xe5844a,_0x3a9180){_0xe5844a=_0xe5844a-0x0;var _0x3bbf18=_0xdeaa[_0xe5844a];return _0x3bbf18;};'use strict';var BPromise=require(_0xadea('0x0'));var util=require(_0xadea('0x1'));var _=require(_0xadea('0x2'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xadea('0x3'));var logger=require('../../config/logger')(_0xadea('0x4'));var config=require(_0xadea('0x5'));var db=require(_0xadea('0x6'))['db'];config['redis']=_['defaults'](config[_0xadea('0x7')],{'host':_0xadea('0x8'),'port':0x18eb});var socket=require(_0xadea('0x9'))(new Redis(config[_0xadea('0x7')]));require(_0xadea('0xa'))[_0xadea('0xb')](socket);function respondWithStatusCode(_0x1701c4,_0x423764){_0x423764=_0x423764||0xcc;return function(_0x15408){if(_0x15408){return _0x1701c4[_0xadea('0xc')](_0x423764);}return _0x1701c4['status'](_0x423764)[_0xadea('0xd')]();};}function respondWithResult(_0x60a304,_0x1a7904){_0x1a7904=_0x1a7904||0xc8;return function(_0x44ba75){if(_0x44ba75){return _0x60a304[_0xadea('0xe')](_0x1a7904)[_0xadea('0xf')](_0x44ba75);}};}function respondWithFilteredResult(_0x40c0f8,_0x5f9245){return function(_0x2f0af4){if(_0x2f0af4){var _0x33eedc=typeof _0x5f9245[_0xadea('0x10')]===_0xadea('0x11')&&typeof _0x5f9245[_0xadea('0x12')]===_0xadea('0x11');var _0x2e837b=_0x2f0af4['count'];var _0x27435b=_0x33eedc?0x0:_0x5f9245['offset'];var _0x359a5e=_0x33eedc?_0x2f0af4[_0xadea('0x13')]:_0x5f9245[_0xadea('0x10')]+_0x5f9245[_0xadea('0x12')];var _0x4c4a6f;if(_0x359a5e>=_0x2e837b){_0x359a5e=_0x2e837b;_0x4c4a6f=0xc8;}else{_0x4c4a6f=0xce;}_0x40c0f8[_0xadea('0xe')](_0x4c4a6f);return _0x40c0f8[_0xadea('0x14')]('Content-Range',_0x27435b+'-'+_0x359a5e+'/'+_0x2e837b)[_0xadea('0xf')](_0x2f0af4);}return null;};}function saveUpdates(_0x85ee8a){return function(_0x555bdd){if(_0x555bdd){return _0x555bdd[_0xadea('0x15')](_0x85ee8a)[_0xadea('0x16')](function(_0x3e5e2d){return _0x3e5e2d;});}return null;};}function removeEntity(_0x1e1057){return function(_0x5a0d7b){if(_0x5a0d7b){return _0x5a0d7b['destroy']()[_0xadea('0x16')](function(){var _0x470769=_0x5a0d7b[_0xadea('0x17')]({'plain':!![]});var _0x5238b3='OpenchannelQueues';return db[_0xadea('0x18')][_0xadea('0x19')]({'where':{'type':_0x5238b3,'resourceId':_0x470769['id']}})[_0xadea('0x16')](function(){return _0x5a0d7b;});})['then'](function(){_0x1e1057[_0xadea('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x152b0c){return function(_0x14ceb9){if(!_0x14ceb9){_0x152b0c[_0xadea('0xc')](0x194);}return _0x14ceb9;};}function handleError(_0x1838d2,_0x8e0a9a){_0x8e0a9a=_0x8e0a9a||0x1f4;return function(_0x468ec4){logger[_0xadea('0x1a')](_0x468ec4[_0xadea('0x1b')]);if(_0x468ec4['name']){delete _0x468ec4[_0xadea('0x1c')];}_0x1838d2[_0xadea('0xe')](_0x8e0a9a)[_0xadea('0x1d')](_0x468ec4);};}exports[_0xadea('0x1e')]=function(_0x52c476,_0x20f32c){var _0x4c6bb6={};var _0x26cf12={'count':0x0,'rows':[]};var _0x50195e=_[_0xadea('0x1f')](db[_0xadea('0x20')][_0xadea('0x21')],function(_0x2648dd){return{'name':_0x2648dd[_0xadea('0x22')],'type':_0x2648dd[_0xadea('0x23')][_0xadea('0x24')]};});_0x4c6bb6=qs[_0xadea('0x25')](_0x50195e,_0x52c476);var _0x20d081={'where':_0x4c6bb6[_0xadea('0x26')]};return db['OpenchannelQueue'][_0xadea('0x13')](_0x20d081)['then'](function(_0x26e599){_0x26cf12[_0xadea('0x13')]=_0x26e599;_0x4c6bb6[_0xadea('0x27')]=qs['include'](_0x52c476[_0xadea('0x28')]);return db[_0xadea('0x20')][_0xadea('0x29')](_0x4c6bb6);})[_0xadea('0x16')](function(_0x1f5798){_0x26cf12['rows']=_0x1f5798;return _0x26cf12;})[_0xadea('0x16')](respondWithFilteredResult(_0x20f32c,_0x4c6bb6))[_0xadea('0x2a')](handleError(_0x20f32c,null));};exports['show']=function(_0x1a3477,_0x38056b){var _0x37e65b={'raw':!![],'where':{'id':_0x1a3477['params']['id']}},_0x5d7cb9={};_0x5d7cb9[_0xadea('0x2b')]=_[_0xadea('0x2c')](db['OpenchannelQueue'][_0xadea('0x21')]);_0x5d7cb9[_0xadea('0x28')]=_[_0xadea('0x2c')](_0x1a3477['query']);_0x5d7cb9[_0xadea('0x2d')]=_[_0xadea('0x2e')](_0x5d7cb9['model'],_0x5d7cb9[_0xadea('0x28')]);_0x37e65b['attributes']=_[_0xadea('0x2e')](_0x5d7cb9['model'],qs[_0xadea('0x2f')](_0x1a3477['query'][_0xadea('0x2f')]));_0x37e65b[_0xadea('0x30')]=_0x37e65b['attributes'][_0xadea('0x31')]?_0x37e65b[_0xadea('0x30')]:_0x5d7cb9[_0xadea('0x2b')];if(_0x1a3477[_0xadea('0x28')][_0xadea('0x32')]){_0x37e65b['include']=[{'all':!![]}];}_0x37e65b=_[_0xadea('0x33')]({},_0x37e65b,_0x1a3477[_0xadea('0x34')]);return db['OpenchannelQueue'][_0xadea('0x35')](_0x37e65b)[_0xadea('0x16')](handleEntityNotFound(_0x38056b,null))['then'](respondWithResult(_0x38056b,null))[_0xadea('0x2a')](handleError(_0x38056b,null));};exports['create']=function(_0x1a8739,_0x269e09){return db[_0xadea('0x20')][_0xadea('0x36')](_0x1a8739[_0xadea('0x37')],{})[_0xadea('0x16')](function(_0x1878b2){var _0x8a9027=_0x1a8739[_0xadea('0x38')][_0xadea('0x17')]({'plain':!![]});if(!_0x8a9027)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8a9027[_0xadea('0x39')]===_0xadea('0x38')){var _0x5e6cac=_0x1878b2[_0xadea('0x17')]({'plain':!![]});var _0x2590e4='OpenchannelQueues';return db[_0xadea('0x3a')][_0xadea('0x35')]({'where':{'name':_0x2590e4,'userProfileId':_0x8a9027['userProfileId']},'raw':!![]})[_0xadea('0x16')](function(_0x90deec){if(_0x90deec&&_0x90deec[_0xadea('0x3b')]===0x0){return db['UserProfileResource'][_0xadea('0x36')]({'name':_0x5e6cac['name'],'resourceId':_0x5e6cac['id'],'type':_0x90deec['name'],'sectionId':_0x90deec['id']},{})['then'](function(){return _0x1878b2;});}else{return _0x1878b2;}})[_0xadea('0x2a')](function(_0x2a1f9c){logger[_0xadea('0x1a')](_0xadea('0x3c'),_0x2a1f9c);throw _0x2a1f9c;});}return _0x1878b2;})[_0xadea('0x16')](respondWithResult(_0x269e09,0xc9))[_0xadea('0x2a')](handleError(_0x269e09,null));};exports[_0xadea('0x15')]=function(_0x2cf382,_0x35d642){if(_0x2cf382[_0xadea('0x37')]['id']){delete _0x2cf382[_0xadea('0x37')]['id'];}return db[_0xadea('0x20')]['find']({'where':{'id':_0x2cf382[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x35d642,null))[_0xadea('0x16')](saveUpdates(_0x2cf382[_0xadea('0x37')],null))[_0xadea('0x16')](respondWithResult(_0x35d642,null))['catch'](handleError(_0x35d642,null));};exports[_0xadea('0x19')]=function(_0x54a4d0,_0x4791db){return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x54a4d0[_0xadea('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4791db,null))['then'](removeEntity(_0x4791db,null))[_0xadea('0x2a')](handleError(_0x4791db,null));};exports[_0xadea('0x3e')]=function(_0x5f1da8,_0x37cfa4){return db['OpenchannelQueue']['describe']()['then'](respondWithResult(_0x37cfa4,null))[_0xadea('0x2a')](handleError(_0x37cfa4,null));};exports['getMembers']=function(_0x3a20ca,_0x326171){var _0x2d0dfd={'raw':!![],'where':{}},_0x488525={},_0x2e4070;return db[_0xadea('0x20')][_0xadea('0x3f')]({'where':{'id':_0x3a20ca[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x326171,null))['then'](function(_0x291769){if(_0x291769){_0x2e4070=_0x291769[_0xadea('0x17')]({'plain':!![]});_0x488525[_0xadea('0x2b')]=_[_0xadea('0x2c')](db['UserOpenchannelQueue'][_0xadea('0x21')]);_0x488525[_0xadea('0x28')]=_[_0xadea('0x2c')](_0x3a20ca['query']);_0x488525[_0xadea('0x2d')]=_[_0xadea('0x2e')](_0x488525[_0xadea('0x2b')],_0x488525['query']);_0x2d0dfd[_0xadea('0x30')]=_['intersection'](_0x488525['model'],qs['fields'](_0x3a20ca[_0xadea('0x28')][_0xadea('0x2f')]));_0x2d0dfd[_0xadea('0x30')]=_0x2d0dfd[_0xadea('0x30')][_0xadea('0x31')]?_0x2d0dfd[_0xadea('0x30')]:_0x488525[_0xadea('0x2b')];if(!_0x3a20ca[_0xadea('0x28')]['hasOwnProperty'](_0xadea('0x40'))){_0x2d0dfd['limit']=qs[_0xadea('0x12')](_0x3a20ca[_0xadea('0x28')][_0xadea('0x12')]);_0x2d0dfd['offset']=qs['offset'](_0x3a20ca[_0xadea('0x28')][_0xadea('0x10')]);}_0x2d0dfd['order']=qs[_0xadea('0x41')](_0x3a20ca[_0xadea('0x28')][_0xadea('0x41')]);_0x2d0dfd[_0xadea('0x26')]=qs[_0xadea('0x2d')](_['pick'](_0x3a20ca[_0xadea('0x28')],_0x488525['filters']));_0x2d0dfd['where']['OpenchannelQueueId']=_0x291769['id'];if(_0x3a20ca['query'][_0xadea('0x42')]){_0x2d0dfd[_0xadea('0x26')]=_[_0xadea('0x33')](_0x2d0dfd['where'],{'$or':_[_0xadea('0x1f')](_0x2d0dfd[_0xadea('0x30')],function(_0xe0e995){var _0x1c8a81={};_0x1c8a81[_0xe0e995]={'$like':'%'+_0x3a20ca[_0xadea('0x28')]['filter']+'%'};return _0x1c8a81;})});}_0x2d0dfd=_['merge']({},_0x2d0dfd,_0x3a20ca['options']);return db['UserOpenchannelQueue'][_0xadea('0x29')](_0x2d0dfd);}})['then'](function(_0x5c7e8d){if(_0x5c7e8d){return db[_0xadea('0x43')][_0xadea('0x44')]({'where':{'id':_['map'](_0x5c7e8d,_0xadea('0x45')),'role':'agent'},'attributes':['id','name',_0xadea('0x46'),_0xadea('0x47'),_0xadea('0x48')]});}})[_0xadea('0x16')](function(_0x2d1aaa){if(_0x2d1aaa){return{'count':_0x2d1aaa[_0xadea('0x13')],'rows':_[_0xadea('0x1f')](_0x2d1aaa[_0xadea('0x49')],function(_0x37d2df){return{'membername':_0x37d2df[_0xadea('0x1c')],'UserId':_0x37d2df['id'],'queue_name':_0x2e4070[_0xadea('0x1c')],'OpenchannelQueueId':_0x2e4070['id'],'interface':util[_0xadea('0x4a')](_0xadea('0x4b'),_0xadea('0x4c'),_0x37d2df[_0xadea('0x1c')]),'penalty':0x0,'paused':_0x37d2df[_0xadea('0x46')],'createdAt':_0x37d2df[_0xadea('0x48')],'updatedAt':_0x37d2df[_0xadea('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xadea('0x16')](respondWithFilteredResult(_0x326171,_0x2d0dfd))[_0xadea('0x2a')](handleError(_0x326171,null));};exports[_0xadea('0x4d')]=function(_0x3c45e3,_0x3f6498){var _0x45422d={};var _0x26d44c={};var _0xbfdf06;var _0x45a2dd;return db[_0xadea('0x20')][_0xadea('0x3f')]({'where':{'id':_0x3c45e3['params']['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x3f6498,null))[_0xadea('0x16')](function(_0x5dcd91){if(_0x5dcd91){_0xbfdf06=_0x5dcd91;_0x26d44c[_0xadea('0x2b')]=_[_0xadea('0x2c')](db['Team'][_0xadea('0x21')]);_0x26d44c[_0xadea('0x28')]=_['keys'](_0x3c45e3['query']);_0x26d44c[_0xadea('0x2d')]=_['intersection'](_0x26d44c['model'],_0x26d44c[_0xadea('0x28')]);_0x45422d[_0xadea('0x30')]=_['intersection'](_0x26d44c[_0xadea('0x2b')],qs[_0xadea('0x2f')](_0x3c45e3[_0xadea('0x28')]['fields']));_0x45422d['attributes']=_0x45422d[_0xadea('0x30')]['length']?_0x45422d['attributes']:_0x26d44c[_0xadea('0x2b')];_0x45422d[_0xadea('0x4e')]=qs[_0xadea('0x41')](_0x3c45e3[_0xadea('0x28')][_0xadea('0x41')]);_0x45422d[_0xadea('0x26')]=qs[_0xadea('0x2d')](_[_0xadea('0x4f')](_0x3c45e3[_0xadea('0x28')],_0x26d44c[_0xadea('0x2d')]));if(_0x3c45e3['query']['filter']){_0x45422d[_0xadea('0x26')]=_[_0xadea('0x33')](_0x45422d[_0xadea('0x26')],{'$or':_['map'](_0x45422d[_0xadea('0x30')],function(_0x1639b9){var _0x50f314={};_0x50f314[_0x1639b9]={'$like':'%'+_0x3c45e3[_0xadea('0x28')][_0xadea('0x42')]+'%'};return _0x50f314;})});}_0x45422d=_[_0xadea('0x33')]({},_0x45422d,_0x3c45e3['options']);return _0xbfdf06[_0xadea('0x4d')](_0x45422d);}})[_0xadea('0x16')](function(_0x5c0f60){if(_0x5c0f60){_0x45a2dd=_0x5c0f60[_0xadea('0x31')];if(!_0x3c45e3[_0xadea('0x28')]['hasOwnProperty'](_0xadea('0x40'))){_0x45422d[_0xadea('0x12')]=qs['limit'](_0x3c45e3['query'][_0xadea('0x12')]);_0x45422d['offset']=qs[_0xadea('0x10')](_0x3c45e3[_0xadea('0x28')][_0xadea('0x10')]);}return _0xbfdf06[_0xadea('0x4d')](_0x45422d);}})[_0xadea('0x16')](function(_0x9f3f45){if(_0x9f3f45){return _0x9f3f45?{'count':_0x45a2dd,'rows':_0x9f3f45}:null;}})[_0xadea('0x16')](respondWithResult(_0x3f6498,null))['catch'](handleError(_0x3f6498,null));};exports[_0xadea('0x50')]=function(_0x5515f6,_0x39b4b2){var _0xcbd5ec=_0x5515f6[_0xadea('0x37')][_0xadea('0x51')];return db[_0xadea('0x52')]['findAll']({'where':{'id':_0xcbd5ec},'attributes':['id'],'include':[{'model':db[_0xadea('0x43')],'as':_0xadea('0x53'),'attributes':['id','name','online',_0xadea('0x54'),'interface'],'raw':!![]}]})[_0xadea('0x16')](function(_0x5d585b){if(_0x5d585b){var _0x2288f7=_[_0xadea('0x55')](_0x5d585b,function(_0x2469b3){var _0x37d953=_0x2469b3[_0xadea('0x17')]({'plain':!![]});return _0x37d953[_0xadea('0x53')];});return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x5515f6['params']['id']}})['then'](function(_0x14cd6a){return db['sequelize'][_0xadea('0x56')](function(_0xa2e5af){return _0x14cd6a[_0xadea('0x50')](_0xcbd5ec,{'transaction':_0xa2e5af})[_0xadea('0x16')](function(){return BPromise[_0xadea('0x57')](_0x2288f7,function(_0x3160b6){return db[_0xadea('0x58')][_0xadea('0x59')]({'where':{'UserId':_0x3160b6['id'],'OpenchannelQueueId':_0x5515f6[_0xadea('0x3d')]['id']},'transaction':_0xa2e5af});});})[_0xadea('0x16')](function(){_0x2288f7[_0xadea('0x5a')](function(_0x2e8b67){socket[_0xadea('0x5b')](_0xadea('0x5c'),{'UserId':_0x2e8b67['id'],'OpenchannelQueueId':_0x14cd6a['id']});});});});});}})[_0xadea('0x16')](respondWithStatusCode(_0x39b4b2,null))[_0xadea('0x2a')](handleError(_0x39b4b2,null));};exports[_0xadea('0x5d')]=function(_0x1dcbc8,_0x198cb2){return db['Team'][_0xadea('0x29')]({'where':{'id':_0x1dcbc8[_0xadea('0x28')][_0xadea('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xadea('0x53'),'attributes':['id'],'raw':!![]}]})[_0xadea('0x16')](handleEntityNotFound(_0x198cb2,null))[_0xadea('0x16')](function(_0xce11cc){var _0x308fa9=_[_0xadea('0x1f')](_0xce11cc,'id');var _0x2ca09b=[];var _0x275ab8=[];var _0x29ce55=squel['select']();_0x29ce55[_0xadea('0x5e')](_0xadea('0x5f'))[_0xadea('0x60')](_0xadea('0x61'),'tq')[_0xadea('0x62')](_0xadea('0x63'),'ut',_0xadea('0x64'))[_0xadea('0x26')]('OpenchannelQueueId\x20=\x20?',_0x1dcbc8[_0xadea('0x3d')]['id']);for(var _0x133849=0x0;_0x133849<_0xce11cc[_0xadea('0x31')];_0x133849+=0x1){let _0x503196=_0xce11cc[_0x133849];for(var _0x4284d2=0x0;_0x4284d2<_0x503196[_0xadea('0x53')][_0xadea('0x31')];_0x4284d2+=0x1){let _0x3c6f3a=_0x503196['Agents'][_0x4284d2];var _0x142463=_0x29ce55['clone']();_0x142463[_0xadea('0x26')](_0xadea('0x65'),_0x3c6f3a['id']);_0x275ab8[_0xadea('0x66')](db[_0xadea('0x67')][_0xadea('0x28')](_0x142463[_0xadea('0x68')](),{'type':db[_0xadea('0x67')]['QueryTypes'][_0xadea('0x69')]})['then'](function(_0x3554d7){if(_0x3554d7[_0xadea('0x31')]===0x1){return _0x3c6f3a['id'];}else{var _0x2435d6=_[_0xadea('0x6a')](_[_0xadea('0x1f')](_0x3554d7,_0xadea('0x6b')),function(_0x2e36f6){return _[_0xadea('0x6c')](_0x308fa9,_0x2e36f6);});if(_0x2435d6){return _0x3c6f3a['id'];}}}));}}return BPromise['all'](_0x275ab8)[_0xadea('0x16')](function(_0x216333){_0x2ca09b=_(_0x2ca09b)[_0xadea('0x6d')](_0x216333)[_0xadea('0x6e')]()[_0xadea('0x6f')]();return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x1dcbc8[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](function(_0x477595){return db[_0xadea('0x67')][_0xadea('0x56')](function(_0xc2e8ce){return _0x477595[_0xadea('0x5d')](_0x1dcbc8[_0xadea('0x28')][_0xadea('0x51')],{'transaction':_0xc2e8ce})[_0xadea('0x16')](function(){if(!_[_0xadea('0x70')](_0x2ca09b)){return _0x477595['removeAgents'](_0x2ca09b,{'transaction':_0xc2e8ce});}})[_0xadea('0x16')](function(){_0x2ca09b[_0xadea('0x5a')](function(_0xba1b44){socket[_0xadea('0x5b')](_0xadea('0x71'),{'UserId':_0xba1b44,'OpenchannelQueueId':_0x477595['id']});});});});});});})[_0xadea('0x16')](respondWithStatusCode(_0x198cb2,null))['catch'](handleError(_0x198cb2,null));};exports[_0xadea('0x72')]=function(_0xfe410d,_0x4a29e3){return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0xfe410d[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x4a29e3,null))['then'](function(_0x251e8f){if(_0x251e8f){return _0x251e8f[_0xadea('0x72')](_0xfe410d['body'][_0xadea('0x51')],_[_0xadea('0x73')](_0xfe410d['body'],['ids','id'])||{})[_0xadea('0x74')](function(_0x300097){for(var _0x406aa5=0x0;_0x406aa5<_0xfe410d[_0xadea('0x37')][_0xadea('0x51')][_0xadea('0x31')];_0x406aa5+=0x1){socket[_0xadea('0x5b')](_0xadea('0x5c'),{'UserId':Number(_0xfe410d[_0xadea('0x37')]['ids'][_0x406aa5]),'OpenchannelQueueId':Number(_0xfe410d[_0xadea('0x3d')]['id'])});}return _0x300097;});}})[_0xadea('0x16')](respondWithResult(_0x4a29e3,null))[_0xadea('0x2a')](handleError(_0x4a29e3,null));};exports['removeAgents']=function(_0x3511a4,_0x5c0720){return db[_0xadea('0x20')][_0xadea('0x35')]({'where':{'id':_0x3511a4[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x5c0720,null))[_0xadea('0x16')](function(_0xeb7fdd){if(_0xeb7fdd){return _0xeb7fdd['removeAgents'](_0x3511a4[_0xadea('0x28')][_0xadea('0x51')])['then'](function(){if(_[_0xadea('0x75')](_0x3511a4[_0xadea('0x28')][_0xadea('0x51')])){for(var _0x2e7417=0x0;_0x2e7417<_0x3511a4[_0xadea('0x28')]['ids'][_0xadea('0x31')];_0x2e7417+=0x1){socket[_0xadea('0x5b')](_0xadea('0x71'),{'UserId':Number(_0x3511a4['query'][_0xadea('0x51')][_0x2e7417]),'OpenchannelQueueId':Number(_0x3511a4[_0xadea('0x3d')]['id'])});}}else{socket['emit'](_0xadea('0x71'),{'UserId':Number(_0x3511a4['query'][_0xadea('0x51')]),'OpenchannelQueueId':Number(_0x3511a4['params']['id'])});}});}})[_0xadea('0x16')](respondWithStatusCode(_0x5c0720,null))['catch'](handleError(_0x5c0720,null));};exports['getAgents']=function(_0x371b26,_0x3bf8fa){var _0x2df3ca={};var _0xeb652a={};var _0x45208b;var _0x42c96b;return db['OpenchannelQueue'][_0xadea('0x3f')]({'where':{'id':_0x371b26[_0xadea('0x3d')]['id']}})[_0xadea('0x16')](handleEntityNotFound(_0x3bf8fa,null))[_0xadea('0x16')](function(_0x1ea91c){if(_0x1ea91c){_0x45208b=_0x1ea91c;_0xeb652a[_0xadea('0x2b')]=_['keys'](db[_0xadea('0x43')][_0xadea('0x21')]);_0xeb652a['query']=_['keys'](_0x371b26[_0xadea('0x28')]);_0xeb652a[_0xadea('0x2d')]=_[_0xadea('0x2e')](_0xeb652a[_0xadea('0x2b')],_0xeb652a[_0xadea('0x28')]);_0x2df3ca[_0xadea('0x30')]=_[_0xadea('0x2e')](_0xeb652a[_0xadea('0x2b')],qs[_0xadea('0x2f')](_0x371b26['query'][_0xadea('0x2f')]));_0x2df3ca[_0xadea('0x30')]=_0x2df3ca[_0xadea('0x30')][_0xadea('0x31')]?_0x2df3ca[_0xadea('0x30')]:_0xeb652a[_0xadea('0x2b')];_0x2df3ca[_0xadea('0x4e')]=qs[_0xadea('0x41')](_0x371b26[_0xadea('0x28')]['sort']);_0x2df3ca[_0xadea('0x26')]=qs[_0xadea('0x2d')](_[_0xadea('0x4f')](_0x371b26[_0xadea('0x28')],_0xeb652a[_0xadea('0x2d')]));if(_0x371b26[_0xadea('0x28')][_0xadea('0x42')]){_0x2df3ca[_0xadea('0x26')]=_[_0xadea('0x33')](_0x2df3ca[_0xadea('0x26')],{'$or':_[_0xadea('0x1f')](_0x2df3ca[_0xadea('0x30')],function(_0x41860c){var _0xc0446c={};_0xc0446c[_0x41860c]={'$like':'%'+_0x371b26[_0xadea('0x28')]['filter']+'%'};return _0xc0446c;})});}_0x2df3ca=_[_0xadea('0x33')]({},_0x2df3ca,_0x371b26[_0xadea('0x34')]);return _0x45208b[_0xadea('0x76')](_0x2df3ca);}})[_0xadea('0x16')](function(_0x4b5400){if(_0x4b5400){_0x42c96b=_0x4b5400['length'];if(!_0x371b26[_0xadea('0x28')]['hasOwnProperty'](_0xadea('0x40'))){_0x2df3ca['limit']=qs[_0xadea('0x12')](_0x371b26['query'][_0xadea('0x12')]);_0x2df3ca[_0xadea('0x10')]=qs[_0xadea('0x10')](_0x371b26[_0xadea('0x28')]['offset']);}return _0x45208b['getAgents'](_0x2df3ca);}})[_0xadea('0x16')](function(_0x53deb0){if(_0x53deb0){return _0x53deb0?{'count':_0x42c96b,'rows':_0x53deb0}:null;}})[_0xadea('0x16')](respondWithResult(_0x3bf8fa,null))[_0xadea('0x2a')](handleError(_0x3bf8fa,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index f4ba28e..39ba7b8 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 _0x96a5=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2fd772,_0x5b32d1){var _0x2a85c4=function(_0x31027f){while(--_0x31027f){_0x2fd772['push'](_0x2fd772['shift']());}};_0x2a85c4(++_0x5b32d1);}(_0x96a5,0xfe));var _0x596a=function(_0xdd84b6,_0x69948){_0xdd84b6=_0xdd84b6-0x0;var _0x4c3f03=_0x96a5[_0xdd84b6];return _0x4c3f03;};'use strict';var EventEmitter=require(_0x596a('0x0'));var OpenchannelQueue=require(_0x596a('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x596a('0x2')](0x0);var events={'afterCreate':_0x596a('0x3'),'afterUpdate':_0x596a('0x4'),'afterDestroy':_0x596a('0x5')};function emitEvent(_0x35b36b){return function(_0x1fe885,_0x3c9bce,_0x2b8019){OpenchannelQueueEvents[_0x596a('0x6')](_0x35b36b+':'+_0x1fe885['id'],_0x1fe885);OpenchannelQueueEvents[_0x596a('0x6')](_0x35b36b,_0x1fe885);_0x2b8019(null);};}for(var e in events){if(events[_0x596a('0x7')](e)){var event=events[e];OpenchannelQueue[_0x596a('0x8')](e,emitEvent(event));}}module[_0x596a('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x700b=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x3ef4ce,_0x5b4e3e){var _0x414d9d=function(_0x28e388){while(--_0x28e388){_0x3ef4ce['push'](_0x3ef4ce['shift']());}};_0x414d9d(++_0x5b4e3e);}(_0x700b,0xde));var _0xb700=function(_0x2e37c0,_0x174b1c){_0x2e37c0=_0x2e37c0-0x0;var _0x3588e7=_0x700b[_0x2e37c0];return _0x3588e7;};'use strict';var EventEmitter=require(_0xb700('0x0'));var OpenchannelQueue=require(_0xb700('0x1'))['db'][_0xb700('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb700('0x3'),'afterUpdate':'update','afterDestroy':_0xb700('0x4')};function emitEvent(_0x4ff54c){return function(_0x3d9c68,_0x29058f,_0x2d7f97){OpenchannelQueueEvents[_0xb700('0x5')](_0x4ff54c+':'+_0x3d9c68['id'],_0x3d9c68);OpenchannelQueueEvents['emit'](_0x4ff54c,_0x3d9c68);_0x2d7f97(null);};}for(var e in events){if(events[_0xb700('0x6')](e)){var event=events[e];OpenchannelQueue[_0xb700('0x7')](e,emitEvent(event));}}module[_0xb700('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 95fdd72..40f9ce0 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 _0x3072=['moment','request-promise','../../config/environment','./openchannelQueue.attributes','exports','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x8c6cae,_0x58059e){var _0x24f3df=function(_0x267382){while(--_0x267382){_0x8c6cae['push'](_0x8c6cae['shift']());}};_0x24f3df(++_0x58059e);}(_0x3072,0x88));var _0x2307=function(_0x30ad6b,_0x37b5d0){_0x30ad6b=_0x30ad6b-0x0;var _0x1382c0=_0x3072[_0x30ad6b];return _0x1382c0;};'use strict';var _=require(_0x2307('0x0'));var util=require(_0x2307('0x1'));var logger=require(_0x2307('0x2'))(_0x2307('0x3'));var moment=require(_0x2307('0x4'));var BPromise=require('bluebird');var rp=require(_0x2307('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2307('0x6'));var attributes=require(_0x2307('0x7'));module[_0x2307('0x8')]=function(_0x113823,_0x100f52){return _0x113823['define']('OpenchannelQueue',attributes,{'tableName':_0x2307('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea7b=['exports','define','openchannel_queues','util','../../config/logger','bluebird','request-promise','rimraf','./openchannelQueue.attributes'];(function(_0x4575fb,_0x415909){var _0x22d065=function(_0x6a911e){while(--_0x6a911e){_0x4575fb['push'](_0x4575fb['shift']());}};_0x22d065(++_0x415909);}(_0xea7b,0x1b3));var _0xbea7=function(_0x379a66,_0x5c3446){_0x379a66=_0x379a66-0x0;var _0x3e96ba=_0xea7b[_0x379a66];return _0x3e96ba;};'use strict';var _=require('lodash');var util=require(_0xbea7('0x0'));var logger=require(_0xbea7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbea7('0x2'));var rp=require(_0xbea7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbea7('0x4'));var config=require('../../config/environment');var attributes=require(_0xbea7('0x5'));module[_0xbea7('0x6')]=function(_0x5381f9,_0x3e7e78){return _0x5381f9[_0xbea7('0x7')]('OpenchannelQueue',attributes,{'tableName':_0xbea7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index a5e47a9..ffaffc9 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 _0x53ec=['request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','options','raw','attributes','include','model','map','ShowOpenchannelQueue','OpenchannelQueue','find','where','info','stringify','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x16108a,_0x3fff24){var _0x205d37=function(_0x30d93a){while(--_0x30d93a){_0x16108a['push'](_0x16108a['shift']());}};_0x205d37(++_0x3fff24);}(_0x53ec,0x13d));var _0xc53e=function(_0x3e1fe8,_0x223c26){_0x3e1fe8=_0x3e1fe8-0x0;var _0x55d8e5=_0x53ec[_0x3e1fe8];return _0x55d8e5;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc53e('0x2'));var fs=require('fs');var Redis=require(_0xc53e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x4'));var logger=require(_0xc53e('0x5'))(_0xc53e('0x6'));var config=require(_0xc53e('0x7'));var jayson=require(_0xc53e('0x8'));var client=jayson['client'][_0xc53e('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc53e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc53e('0xb'))(new Redis(config[_0xc53e('0xa')]));require(_0xc53e('0xc'))['register'](socket);function respondWithRpcPromise(_0x48e9c2,_0x5a1f83,_0x362601){return new BPromise(function(_0x11f48a,_0x857a5f){return client[_0xc53e('0xd')](_0x48e9c2,_0x362601)[_0xc53e('0xe')](function(_0x485587){logger['info'](_0xc53e('0xf'),_0x5a1f83,_0xc53e('0x10'));logger[_0xc53e('0x11')](_0xc53e('0x12'),_0x5a1f83,'request\x20sent',JSON['stringify'](_0x485587));if(_0x485587['error']){if(_0x485587[_0xc53e('0x13')][_0xc53e('0x14')]===0x1f4){logger[_0xc53e('0x13')](_0xc53e('0xf'),_0x5a1f83,_0x485587[_0xc53e('0x13')][_0xc53e('0x15')]);return _0x857a5f(_0x485587[_0xc53e('0x13')][_0xc53e('0x15')]);}logger['error'](_0xc53e('0xf'),_0x5a1f83,_0x485587[_0xc53e('0x13')]['message']);return _0x11f48a(_0x485587[_0xc53e('0x13')][_0xc53e('0x15')]);}else{logger['info'](_0xc53e('0xf'),_0x5a1f83,_0xc53e('0x10'));_0x11f48a(_0x485587[_0xc53e('0x16')][_0xc53e('0x15')]);}})[_0xc53e('0x17')](function(_0x5a9f67){logger[_0xc53e('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x5a1f83,_0x5a9f67);_0x857a5f(_0x5a9f67);});});}exports[_0xc53e('0x18')]=function(_0x3a207a){var _0x42b9b0=this;return new Promise(function(_0x50c47e,_0x3fab67){return db['OpenchannelQueue']['findAll']({'raw':_0x3a207a[_0xc53e('0x19')]?_0x3a207a['options'][_0xc53e('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a207a['options']?_0x3a207a[_0xc53e('0x19')]['where']||null:null,'attributes':_0x3a207a[_0xc53e('0x19')]?_0x3a207a[_0xc53e('0x19')][_0xc53e('0x1b')]||null:null,'limit':_0x3a207a[_0xc53e('0x19')]?_0x3a207a[_0xc53e('0x19')]['limit']||null:null,'include':_0x3a207a[_0xc53e('0x19')]?_0x3a207a['options'][_0xc53e('0x1c')]?_['map'](_0x3a207a[_0xc53e('0x19')][_0xc53e('0x1c')],function(_0x396c9c){return{'model':db[_0x396c9c[_0xc53e('0x1d')]],'as':_0x396c9c['as'],'attributes':_0x396c9c[_0xc53e('0x1b')],'include':_0x396c9c['include']?_[_0xc53e('0x1e')](_0x396c9c[_0xc53e('0x1c')],function(_0x6897){return{'model':db[_0x6897[_0xc53e('0x1d')]],'as':_0x6897['as'],'attributes':_0x6897[_0xc53e('0x1b')],'include':_0x6897[_0xc53e('0x1c')]?_[_0xc53e('0x1e')](_0x6897[_0xc53e('0x1c')],function(_0x469657){return{'model':db[_0x469657[_0xc53e('0x1d')]],'as':_0x469657['as'],'attributes':_0x469657[_0xc53e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc53e('0xe')](function(_0x598987){logger['info'](_0xc53e('0x18'),_0x3a207a);logger['debug'](_0xc53e('0x18'),_0x3a207a,JSON['stringify'](_0x598987));_0x50c47e(_0x598987);})[_0xc53e('0x17')](function(_0x18fa6e){logger[_0xc53e('0x13')](_0xc53e('0x18'),_0x18fa6e['message'],_0x3a207a);_0x3fab67(_0x42b9b0[_0xc53e('0x13')](0x1f4,_0x18fa6e['message']));});});};exports[_0xc53e('0x1f')]=function(_0x580ba9){var _0x4baea9=this;return new Promise(function(_0x3047da,_0x37ae33){return db[_0xc53e('0x20')][_0xc53e('0x21')]({'raw':_0x580ba9['options']?_0x580ba9[_0xc53e('0x19')][_0xc53e('0x1a')]===undefined?!![]:![]:!![],'where':_0x580ba9[_0xc53e('0x19')]?_0x580ba9['options'][_0xc53e('0x22')]||null:null,'attributes':_0x580ba9[_0xc53e('0x19')]?_0x580ba9['options'][_0xc53e('0x1b')]||null:null,'include':_0x580ba9[_0xc53e('0x19')]?_0x580ba9['options'][_0xc53e('0x1c')]?_[_0xc53e('0x1e')](_0x580ba9[_0xc53e('0x19')]['include'],function(_0x36ac7d){return{'model':db[_0x36ac7d[_0xc53e('0x1d')]],'as':_0x36ac7d['as'],'attributes':_0x36ac7d[_0xc53e('0x1b')],'include':_0x36ac7d[_0xc53e('0x1c')]?_[_0xc53e('0x1e')](_0x36ac7d['include'],function(_0x2f16da){return{'model':db[_0x2f16da['model']],'as':_0x2f16da['as'],'attributes':_0x2f16da[_0xc53e('0x1b')],'include':_0x2f16da[_0xc53e('0x1c')]?_[_0xc53e('0x1e')](_0x2f16da[_0xc53e('0x1c')],function(_0x1a9345){return{'model':db[_0x1a9345[_0xc53e('0x1d')]],'as':_0x1a9345['as'],'attributes':_0x1a9345[_0xc53e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc53e('0xe')](function(_0x376b72){logger[_0xc53e('0x23')](_0xc53e('0x1f'),_0x580ba9);logger[_0xc53e('0x11')]('ShowOpenchannelQueue',_0x580ba9,JSON[_0xc53e('0x24')](_0x376b72));_0x3047da(_0x376b72);})[_0xc53e('0x17')](function(_0x1166d5){logger[_0xc53e('0x13')](_0xc53e('0x1f'),_0x1166d5[_0xc53e('0x15')],_0x580ba9);_0x37ae33(_0x4baea9['error'](0x1f4,_0x1166d5[_0xc53e('0x15')]));});});}; \ No newline at end of file +var _0x3045=['code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x10801d,_0x3b037e){var _0x204f57=function(_0x565206){while(--_0x565206){_0x10801d['push'](_0x10801d['shift']());}};_0x204f57(++_0x3b037e);}(_0x3045,0x90));var _0x5304=function(_0x2482a8,_0x51a04a){_0x2482a8=_0x2482a8-0x0;var _0x3d80fe=_0x3045[_0x2482a8];return _0x3d80fe;};'use strict';var _=require(_0x5304('0x0'));var util=require(_0x5304('0x1'));var moment=require(_0x5304('0x2'));var BPromise=require(_0x5304('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5304('0x4'))['db'];var utils=require(_0x5304('0x5'));var logger=require(_0x5304('0x6'))(_0x5304('0x7'));var config=require(_0x5304('0x8'));var jayson=require(_0x5304('0x9'));var client=jayson[_0x5304('0xa')]['http']({'port':0x232a});config[_0x5304('0xb')]=_[_0x5304('0xc')](config[_0x5304('0xb')],{'host':_0x5304('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5304('0xb')]));require(_0x5304('0xe'))[_0x5304('0xf')](socket);function respondWithRpcPromise(_0x5da3d6,_0x447e6d,_0xf489b3){return new BPromise(function(_0x1f75ba,_0x110f1e){return client[_0x5304('0x10')](_0x5da3d6,_0xf489b3)[_0x5304('0x11')](function(_0x4f3050){logger[_0x5304('0x12')](_0x5304('0x13'),_0x447e6d,_0x5304('0x14'));logger[_0x5304('0x15')](_0x5304('0x16'),_0x447e6d,_0x5304('0x14'),JSON['stringify'](_0x4f3050));if(_0x4f3050[_0x5304('0x17')]){if(_0x4f3050['error'][_0x5304('0x18')]===0x1f4){logger[_0x5304('0x17')](_0x5304('0x13'),_0x447e6d,_0x4f3050[_0x5304('0x17')][_0x5304('0x19')]);return _0x110f1e(_0x4f3050[_0x5304('0x17')][_0x5304('0x19')]);}logger[_0x5304('0x17')](_0x5304('0x13'),_0x447e6d,_0x4f3050[_0x5304('0x17')]['message']);return _0x1f75ba(_0x4f3050[_0x5304('0x17')]['message']);}else{logger[_0x5304('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x447e6d,_0x5304('0x14'));_0x1f75ba(_0x4f3050[_0x5304('0x1a')][_0x5304('0x19')]);}})[_0x5304('0x1b')](function(_0xee89dc){logger[_0x5304('0x17')](_0x5304('0x13'),_0x447e6d,_0xee89dc);_0x110f1e(_0xee89dc);});});}exports[_0x5304('0x1c')]=function(_0x54283a){var _0x16054b=this;return new Promise(function(_0x241cf2,_0x351442){return db[_0x5304('0x1d')][_0x5304('0x1e')]({'raw':_0x54283a['options']?_0x54283a[_0x5304('0x1f')][_0x5304('0x20')]===undefined?!![]:![]:!![],'where':_0x54283a['options']?_0x54283a['options'][_0x5304('0x21')]||null:null,'attributes':_0x54283a[_0x5304('0x1f')]?_0x54283a[_0x5304('0x1f')]['attributes']||null:null,'limit':_0x54283a['options']?_0x54283a[_0x5304('0x1f')][_0x5304('0x22')]||null:null,'include':_0x54283a[_0x5304('0x1f')]?_0x54283a[_0x5304('0x1f')][_0x5304('0x23')]?_[_0x5304('0x24')](_0x54283a['options']['include'],function(_0x15625e){return{'model':db[_0x15625e[_0x5304('0x25')]],'as':_0x15625e['as'],'attributes':_0x15625e[_0x5304('0x26')],'include':_0x15625e['include']?_['map'](_0x15625e[_0x5304('0x23')],function(_0x5b9881){return{'model':db[_0x5b9881['model']],'as':_0x5b9881['as'],'attributes':_0x5b9881[_0x5304('0x26')],'include':_0x5b9881[_0x5304('0x23')]?_[_0x5304('0x24')](_0x5b9881['include'],function(_0x39b4d9){return{'model':db[_0x39b4d9[_0x5304('0x25')]],'as':_0x39b4d9['as'],'attributes':_0x39b4d9[_0x5304('0x26')]};}):[]};}):[]};}):[]:[]})[_0x5304('0x11')](function(_0x1382f0){logger[_0x5304('0x12')](_0x5304('0x1c'),_0x54283a);logger['debug'](_0x5304('0x1c'),_0x54283a,JSON[_0x5304('0x27')](_0x1382f0));_0x241cf2(_0x1382f0);})[_0x5304('0x1b')](function(_0x15d878){logger[_0x5304('0x17')](_0x5304('0x1c'),_0x15d878['message'],_0x54283a);_0x351442(_0x16054b['error'](0x1f4,_0x15d878[_0x5304('0x19')]));});});};exports[_0x5304('0x28')]=function(_0x2b0fcf){var _0x435ee6=this;return new Promise(function(_0x556f93,_0x52791a){return db[_0x5304('0x1d')][_0x5304('0x29')]({'raw':_0x2b0fcf[_0x5304('0x1f')]?_0x2b0fcf['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b0fcf['options']?_0x2b0fcf[_0x5304('0x1f')][_0x5304('0x21')]||null:null,'attributes':_0x2b0fcf[_0x5304('0x1f')]?_0x2b0fcf[_0x5304('0x1f')][_0x5304('0x26')]||null:null,'include':_0x2b0fcf[_0x5304('0x1f')]?_0x2b0fcf['options'][_0x5304('0x23')]?_[_0x5304('0x24')](_0x2b0fcf['options'][_0x5304('0x23')],function(_0x6019c){return{'model':db[_0x6019c[_0x5304('0x25')]],'as':_0x6019c['as'],'attributes':_0x6019c[_0x5304('0x26')],'include':_0x6019c[_0x5304('0x23')]?_[_0x5304('0x24')](_0x6019c[_0x5304('0x23')],function(_0x1409cc){return{'model':db[_0x1409cc[_0x5304('0x25')]],'as':_0x1409cc['as'],'attributes':_0x1409cc['attributes'],'include':_0x1409cc[_0x5304('0x23')]?_['map'](_0x1409cc[_0x5304('0x23')],function(_0x2c6e73){return{'model':db[_0x2c6e73[_0x5304('0x25')]],'as':_0x2c6e73['as'],'attributes':_0x2c6e73[_0x5304('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac38d){logger['info'](_0x5304('0x28'),_0x2b0fcf);logger[_0x5304('0x15')](_0x5304('0x28'),_0x2b0fcf,JSON[_0x5304('0x27')](_0x4ac38d));_0x556f93(_0x4ac38d);})[_0x5304('0x1b')](function(_0x429a1a){logger[_0x5304('0x17')](_0x5304('0x28'),_0x429a1a[_0x5304('0x19')],_0x2b0fcf);_0x52791a(_0x435ee6[_0x5304('0x17')](0x1f4,_0x429a1a[_0x5304('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index fee1bf0..ac8d168 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 _0x962b=['register','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x185a91,_0x2c3262){var _0x27b9f4=function(_0x4822cc){while(--_0x4822cc){_0x185a91['push'](_0x185a91['shift']());}};_0x27b9f4(++_0x2c3262);}(_0x962b,0xba));var _0xb962=function(_0x201ae1,_0x31c8b7){_0x201ae1=_0x201ae1-0x0;var _0x3635fd=_0x962b[_0x201ae1];return _0x3635fd;};'use strict';var OpenchannelQueueEvents=require(_0xb962('0x0'));var events=[_0xb962('0x1'),_0xb962('0x2'),_0xb962('0x3')];function createListener(_0x4d6e16,_0x5abe4b){return function(_0x51de2b){_0x5abe4b[_0xb962('0x4')](_0x4d6e16,_0x51de2b);};}function removeListener(_0x41cc1d,_0x5c76f7){return function(){OpenchannelQueueEvents[_0xb962('0x5')](_0x41cc1d,_0x5c76f7);};}exports[_0xb962('0x6')]=function(_0x1b5cc4){for(var _0x1f8202=0x0,_0x392434=events['length'];_0x1f8202<_0x392434;_0x1f8202++){var _0x48d2f6=events[_0x1f8202];var _0x109b50=createListener(_0xb962('0x7')+_0x48d2f6,_0x1b5cc4);OpenchannelQueueEvents['on'](_0x48d2f6,_0x109b50);}}; \ No newline at end of file +var _0x098f=['openchannelQueue:','remove','update','emit','length'];(function(_0x4b69f2,_0x243719){var _0x5beec8=function(_0x332c00){while(--_0x332c00){_0x4b69f2['push'](_0x4b69f2['shift']());}};_0x5beec8(++_0x243719);}(_0x098f,0x1c8));var _0xf098=function(_0x56a944,_0x50361a){_0x56a944=_0x56a944-0x0;var _0x1c9794=_0x098f[_0x56a944];return _0x1c9794;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0xf098('0x0'),_0xf098('0x1')];function createListener(_0x154a2e,_0x5de1f5){return function(_0x1f3831){_0x5de1f5[_0xf098('0x2')](_0x154a2e,_0x1f3831);};}function removeListener(_0x5ddf70,_0x5f027c){return function(){OpenchannelQueueEvents['removeListener'](_0x5ddf70,_0x5f027c);};}exports['register']=function(_0x15eb0c){for(var _0x44fe6f=0x0,_0x377066=events[_0xf098('0x3')];_0x44fe6f<_0x377066;_0x44fe6f++){var _0x37595c=events[_0x44fe6f];var _0x1e6a2a=createListener(_0xf098('0x4')+_0x37595c,_0x15eb0c);OpenchannelQueueEvents['on'](_0x37595c,_0x1e6a2a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 750332d..0050f9f 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 _0x1c3e=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x21efbc,_0x232828){var _0x2e2730=function(_0x2d12f7){while(--_0x2d12f7){_0x21efbc['push'](_0x21efbc['shift']());}};_0x2e2730(++_0x232828);}(_0x1c3e,0x120));var _0xe1c3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1c3e[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xe1c3('0x0'));var util=require(_0xe1c3('0x1'));var path=require(_0xe1c3('0x2'));var timeout=require(_0xe1c3('0x3'));var express=require(_0xe1c3('0x4'));var router=express[_0xe1c3('0x5')]();var fs_extra=require(_0xe1c3('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe1c3('0x7'));var controller=require(_0xe1c3('0x8'));router[_0xe1c3('0x9')]('/',auth[_0xe1c3('0xa')](),controller[_0xe1c3('0xb')]);router[_0xe1c3('0x9')](_0xe1c3('0xc'),auth[_0xe1c3('0xa')](),controller[_0xe1c3('0xd')]);router[_0xe1c3('0x9')](_0xe1c3('0xe'),auth[_0xe1c3('0xa')](),controller[_0xe1c3('0xf')]);router['post']('/',auth[_0xe1c3('0xa')](),controller['create']);router['put']('/:id',auth[_0xe1c3('0xa')](),controller[_0xe1c3('0x10')]);router[_0xe1c3('0x11')](_0xe1c3('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xe1c3('0x12')]=router; \ No newline at end of file +var _0x32a7=['../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x32a7,0xcd));var _0x732a=function(_0x2c646c,_0x166dd4){_0x2c646c=_0x2c646c-0x0;var _0x14c3f2=_0x32a7[_0x2c646c];return _0x14c3f2;};'use strict';var multer=require('multer');var util=require(_0x732a('0x0'));var path=require(_0x732a('0x1'));var timeout=require(_0x732a('0x2'));var express=require(_0x732a('0x3'));var router=express[_0x732a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x732a('0x5'));var config=require(_0x732a('0x6'));var controller=require(_0x732a('0x7'));router[_0x732a('0x8')]('/',auth[_0x732a('0x9')](),controller[_0x732a('0xa')]);router['get'](_0x732a('0xb'),auth[_0x732a('0x9')](),controller[_0x732a('0xc')]);router[_0x732a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x732a('0xd')]);router[_0x732a('0xe')]('/',auth[_0x732a('0x9')](),controller[_0x732a('0xf')]);router['put'](_0x732a('0x10'),auth[_0x732a('0x9')](),controller[_0x732a('0x11')]);router[_0x732a('0x12')](_0x732a('0x10'),auth[_0x732a('0x9')](),controller[_0x732a('0x13')]);module[_0x732a('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b48f7bd..9767a06 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 _0xa914=['DATE','moment','sequelize','exports','STRING'];(function(_0x3a3470,_0x55b861){var _0x356927=function(_0xfcae7){while(--_0xfcae7){_0x3a3470['push'](_0x3a3470['shift']());}};_0x356927(++_0x55b861);}(_0xa914,0xce));var _0x4a91=function(_0x1d79c3,_0x3992a9){_0x1d79c3=_0x1d79c3-0x0;var _0x5ed06c=_0xa914[_0x1d79c3];return _0x5ed06c;};'use strict';var moment=require(_0x4a91('0x0'));var Sequelize=require(_0x4a91('0x1'));module[_0x4a91('0x2')]={'uniqueid':{'type':Sequelize[_0x4a91('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4a91('0x3')]},'joinAt':{'type':Sequelize[_0x4a91('0x4')]},'leaveAt':{'type':Sequelize[_0x4a91('0x4')]},'acceptAt':{'type':Sequelize[_0x4a91('0x4')]},'exitAt':{'type':Sequelize[_0x4a91('0x4')]},'reason':{'type':Sequelize[_0x4a91('0x3')]}}; \ No newline at end of file +var _0xbb6b=['DATE','moment','sequelize','STRING'];(function(_0x1d7e08,_0x220bae){var _0x4e1f6a=function(_0x5b9e9f){while(--_0x5b9e9f){_0x1d7e08['push'](_0x1d7e08['shift']());}};_0x4e1f6a(++_0x220bae);}(_0xbb6b,0x1ed));var _0xbbb6=function(_0xd535bc,_0x54c2b4){_0xd535bc=_0xd535bc-0x0;var _0x530e6d=_0xbb6b[_0xd535bc];return _0x530e6d;};'use strict';var moment=require(_0xbbb6('0x0'));var Sequelize=require(_0xbbb6('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbbb6('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbbb6('0x2')]},'joinAt':{'type':Sequelize[_0xbbb6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbbb6('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbbb6('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index c8cb892..1349931 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 _0x8311=['keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','OpenchannelQueueReport','includeAll','include','findAll','catch','params','rawAttributes','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','fieldName','type','model','query'];(function(_0x2fcc1e,_0x952ada){var _0x266401=function(_0x1c2cf4){while(--_0x1c2cf4){_0x2fcc1e['push'](_0x2fcc1e['shift']());}};_0x266401(++_0x952ada);}(_0x8311,0x1d0));var _0x1831=function(_0x3eda5d,_0x2320c4){_0x3eda5d=_0x3eda5d-0x0;var _0x5cdebc=_0x8311[_0x3eda5d];return _0x5cdebc;};'use strict';var emlformat=require(_0x1831('0x0'));var rimraf=require(_0x1831('0x1'));var zipdir=require(_0x1831('0x2'));var jsonpatch=require(_0x1831('0x3'));var rp=require(_0x1831('0x4'));var moment=require(_0x1831('0x5'));var BPromise=require(_0x1831('0x6'));var Mustache=require('mustache');var util=require(_0x1831('0x7'));var path=require('path');var sox=require(_0x1831('0x8'));var csv=require(_0x1831('0x9'));var ejs=require(_0x1831('0xa'));var fs=require('fs');var fs_extra=require(_0x1831('0xb'));var _=require(_0x1831('0xc'));var squel=require(_0x1831('0xd'));var crypto=require(_0x1831('0xe'));var jsforce=require(_0x1831('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1831('0x10'));var Papa=require(_0x1831('0x11'));var Redis=require('ioredis');var authService=require(_0x1831('0x12'));var qs=require(_0x1831('0x13'));var as=require(_0x1831('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1831('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1831('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1831('0x17'))['db'];function respondWithStatusCode(_0x539d9d,_0x504dd2){_0x504dd2=_0x504dd2||0xcc;return function(_0xe89420){if(_0xe89420){return _0x539d9d['sendStatus'](_0x504dd2);}return _0x539d9d[_0x1831('0x18')](_0x504dd2)['end']();};}function respondWithResult(_0x56537a,_0x125592){_0x125592=_0x125592||0xc8;return function(_0x5d5d22){if(_0x5d5d22){return _0x56537a[_0x1831('0x18')](_0x125592)['json'](_0x5d5d22);}};}function respondWithFilteredResult(_0x42732b,_0x84fc15){return function(_0x17fbf1){if(_0x17fbf1){var _0x39aa5d=typeof _0x84fc15['offset']===_0x1831('0x19')&&typeof _0x84fc15[_0x1831('0x1a')]===_0x1831('0x19');var _0x24d8ef=_0x17fbf1[_0x1831('0x1b')];var _0x332b53=_0x39aa5d?0x0:_0x84fc15[_0x1831('0x1c')];var _0x36a3f6=_0x39aa5d?_0x17fbf1[_0x1831('0x1b')]:_0x84fc15['offset']+_0x84fc15[_0x1831('0x1a')];var _0x277db5;if(_0x36a3f6>=_0x24d8ef){_0x36a3f6=_0x24d8ef;_0x277db5=0xc8;}else{_0x277db5=0xce;}_0x42732b['status'](_0x277db5);return _0x42732b[_0x1831('0x1d')](_0x1831('0x1e'),_0x332b53+'-'+_0x36a3f6+'/'+_0x24d8ef)[_0x1831('0x1f')](_0x17fbf1);}return null;};}function patchUpdates(_0x5451d9){return function(_0x25731a){try{jsonpatch[_0x1831('0x20')](_0x25731a,_0x5451d9,!![]);}catch(_0x599fb9){return BPromise[_0x1831('0x21')](_0x599fb9);}return _0x25731a[_0x1831('0x22')]();};}function saveUpdates(_0x1744f7,_0x31ed){return function(_0x28ab84){if(_0x28ab84){return _0x28ab84[_0x1831('0x23')](_0x1744f7)[_0x1831('0x24')](function(_0x4bb16f){return _0x4bb16f;});}return null;};}function removeEntity(_0xd388b,_0x11047f){return function(_0x39c038){if(_0x39c038){return _0x39c038[_0x1831('0x25')]()[_0x1831('0x24')](function(){_0xd388b[_0x1831('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38aebf,_0x3843b6){return function(_0x3cbe7c){if(!_0x3cbe7c){_0x38aebf[_0x1831('0x26')](0x194);}return _0x3cbe7c;};}function handleError(_0xe06cef,_0x2b9764){_0x2b9764=_0x2b9764||0x1f4;return function(_0x1365f2){logger[_0x1831('0x27')](_0x1365f2['stack']);if(_0x1365f2[_0x1831('0x28')]){delete _0x1365f2[_0x1831('0x28')];}_0xe06cef[_0x1831('0x18')](_0x2b9764)[_0x1831('0x29')](_0x1365f2);};}exports['index']=function(_0xf18daf,_0xaca43){var _0x28b0e4={},_0xd2f887={},_0x4adb49={'count':0x0,'rows':[]};var _0x29eb76=_[_0x1831('0x2a')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x345b9b){return{'name':_0x345b9b[_0x1831('0x2b')],'type':_0x345b9b[_0x1831('0x2c')]['key']};});_0xd2f887[_0x1831('0x2d')]=_[_0x1831('0x2a')](_0x29eb76,_0x1831('0x28'));_0xd2f887[_0x1831('0x2e')]=_[_0x1831('0x2f')](_0xf18daf[_0x1831('0x2e')]);_0xd2f887[_0x1831('0x30')]=_[_0x1831('0x31')](_0xd2f887[_0x1831('0x2d')],_0xd2f887[_0x1831('0x2e')]);_0x28b0e4['attributes']=_[_0x1831('0x31')](_0xd2f887[_0x1831('0x2d')],qs[_0x1831('0x32')](_0xf18daf['query'][_0x1831('0x32')]));_0x28b0e4[_0x1831('0x33')]=_0x28b0e4[_0x1831('0x33')]['length']?_0x28b0e4[_0x1831('0x33')]:_0xd2f887['model'];if(!_0xf18daf[_0x1831('0x2e')][_0x1831('0x34')](_0x1831('0x35'))){_0x28b0e4[_0x1831('0x1a')]=qs[_0x1831('0x1a')](_0xf18daf[_0x1831('0x2e')][_0x1831('0x1a')]);_0x28b0e4[_0x1831('0x1c')]=qs['offset'](_0xf18daf[_0x1831('0x2e')][_0x1831('0x1c')]);}_0x28b0e4[_0x1831('0x36')]=qs[_0x1831('0x37')](_0xf18daf[_0x1831('0x2e')]['sort']);_0x28b0e4[_0x1831('0x38')]=qs['filters'](_[_0x1831('0x39')](_0xf18daf[_0x1831('0x2e')],_0xd2f887[_0x1831('0x30')]),_0x29eb76);if(_0xf18daf['query'][_0x1831('0x3a')]){_0x28b0e4[_0x1831('0x38')]=_['merge'](_0x28b0e4['where'],{'$or':_['map'](_0x29eb76,function(_0x42f5e2){if(_0x42f5e2['type']!=='VIRTUAL'){var _0x20af23={};_0x20af23[_0x42f5e2[_0x1831('0x28')]]={'$like':'%'+_0xf18daf['query']['filter']+'%'};return _0x20af23;}})});}_0x28b0e4=_['merge']({},_0x28b0e4,_0xf18daf[_0x1831('0x3b')]);var _0x14b9bf={'where':_0x28b0e4[_0x1831('0x38')]};return db[_0x1831('0x3c')][_0x1831('0x1b')](_0x14b9bf)[_0x1831('0x24')](function(_0x5e241e){_0x4adb49[_0x1831('0x1b')]=_0x5e241e;if(_0xf18daf[_0x1831('0x2e')][_0x1831('0x3d')]){_0x28b0e4[_0x1831('0x3e')]=[{'all':!![]}];}return db[_0x1831('0x3c')][_0x1831('0x3f')](_0x28b0e4);})[_0x1831('0x24')](function(_0x48cfdb){_0x4adb49['rows']=_0x48cfdb;return _0x4adb49;})[_0x1831('0x24')](respondWithFilteredResult(_0xaca43,_0x28b0e4))[_0x1831('0x40')](handleError(_0xaca43,null));};exports['show']=function(_0x1ca7b0,_0x431816){var _0x120dd8={'raw':!![],'where':{'id':_0x1ca7b0[_0x1831('0x41')]['id']}},_0x2d50d1={};_0x2d50d1[_0x1831('0x2d')]=_['keys'](db[_0x1831('0x3c')][_0x1831('0x42')]);_0x2d50d1['query']=_[_0x1831('0x2f')](_0x1ca7b0[_0x1831('0x2e')]);_0x2d50d1[_0x1831('0x30')]=_[_0x1831('0x31')](_0x2d50d1['model'],_0x2d50d1[_0x1831('0x2e')]);_0x120dd8[_0x1831('0x33')]=_[_0x1831('0x31')](_0x2d50d1['model'],qs[_0x1831('0x32')](_0x1ca7b0['query'][_0x1831('0x32')]));_0x120dd8[_0x1831('0x33')]=_0x120dd8[_0x1831('0x33')][_0x1831('0x43')]?_0x120dd8[_0x1831('0x33')]:_0x2d50d1['model'];if(_0x1ca7b0['query'][_0x1831('0x3d')]){_0x120dd8['include']=[{'all':!![]}];}_0x120dd8=_[_0x1831('0x44')]({},_0x120dd8,_0x1ca7b0[_0x1831('0x3b')]);return db[_0x1831('0x3c')][_0x1831('0x45')](_0x120dd8)[_0x1831('0x24')](handleEntityNotFound(_0x431816,null))[_0x1831('0x24')](respondWithResult(_0x431816,null))['catch'](handleError(_0x431816,null));};exports[_0x1831('0x46')]=function(_0x12f09e,_0x331810){return db[_0x1831('0x3c')][_0x1831('0x46')](_0x12f09e[_0x1831('0x47')],{})[_0x1831('0x24')](respondWithResult(_0x331810,0xc9))['catch'](handleError(_0x331810,null));};exports[_0x1831('0x23')]=function(_0x7a53c5,_0x51dd02){if(_0x7a53c5['body']['id']){delete _0x7a53c5[_0x1831('0x47')]['id'];}return db[_0x1831('0x3c')][_0x1831('0x45')]({'where':{'id':_0x7a53c5[_0x1831('0x41')]['id']}})[_0x1831('0x24')](handleEntityNotFound(_0x51dd02,null))['then'](saveUpdates(_0x7a53c5[_0x1831('0x47')],null))[_0x1831('0x24')](respondWithResult(_0x51dd02,null))[_0x1831('0x40')](handleError(_0x51dd02,null));};exports[_0x1831('0x25')]=function(_0x3e114e,_0x334f9d){return db['OpenchannelQueueReport'][_0x1831('0x45')]({'where':{'id':_0x3e114e[_0x1831('0x41')]['id']}})['then'](handleEntityNotFound(_0x334f9d,null))['then'](removeEntity(_0x334f9d,null))['catch'](handleError(_0x334f9d,null));};exports[_0x1831('0x48')]=function(_0x53f012,_0x2f3a07){return db['OpenchannelQueueReport'][_0x1831('0x48')]()[_0x1831('0x24')](respondWithResult(_0x2f3a07,null))[_0x1831('0x40')](handleError(_0x2f3a07,null));}; \ No newline at end of file +var _0x81cd=['where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','attributes','create','body','catch','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','nolimit','order','sort'];(function(_0x166414,_0x36bd02){var _0x3c24ea=function(_0x3ab4d2){while(--_0x3ab4d2){_0x166414['push'](_0x166414['shift']());}};_0x3c24ea(++_0x36bd02);}(_0x81cd,0x100));var _0xd81c=function(_0x11ae20,_0x257ec6){_0x11ae20=_0x11ae20-0x0;var _0xc8800f=_0x81cd[_0x11ae20];return _0xc8800f;};'use strict';var emlformat=require(_0xd81c('0x0'));var rimraf=require(_0xd81c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd81c('0x2'));var moment=require(_0xd81c('0x3'));var BPromise=require(_0xd81c('0x4'));var Mustache=require(_0xd81c('0x5'));var util=require(_0xd81c('0x6'));var path=require(_0xd81c('0x7'));var sox=require(_0xd81c('0x8'));var csv=require(_0xd81c('0x9'));var ejs=require(_0xd81c('0xa'));var fs=require('fs');var fs_extra=require(_0xd81c('0xb'));var _=require('lodash');var squel=require(_0xd81c('0xc'));var crypto=require(_0xd81c('0xd'));var jsforce=require(_0xd81c('0xe'));var deskjs=require(_0xd81c('0xf'));var toCsv=require(_0xd81c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd81c('0x10'));var authService=require(_0xd81c('0x11'));var qs=require(_0xd81c('0x12'));var as=require(_0xd81c('0x13'));var hardwareService=require(_0xd81c('0x14'));var logger=require(_0xd81c('0x15'))(_0xd81c('0x16'));var utils=require(_0xd81c('0x17'));var config=require(_0xd81c('0x18'));var licenseUtil=require(_0xd81c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d09fb,_0x87f703){_0x87f703=_0x87f703||0xcc;return function(_0xb20a7){if(_0xb20a7){return _0x5d09fb['sendStatus'](_0x87f703);}return _0x5d09fb[_0xd81c('0x1a')](_0x87f703)['end']();};}function respondWithResult(_0x38fdeb,_0x1269b0){_0x1269b0=_0x1269b0||0xc8;return function(_0x2bcd89){if(_0x2bcd89){return _0x38fdeb[_0xd81c('0x1a')](_0x1269b0)['json'](_0x2bcd89);}};}function respondWithFilteredResult(_0x260706,_0x9c5a43){return function(_0x1a2d94){if(_0x1a2d94){var _0x3d28d=typeof _0x9c5a43[_0xd81c('0x1b')]===_0xd81c('0x1c')&&typeof _0x9c5a43[_0xd81c('0x1d')]==='undefined';var _0x102afa=_0x1a2d94[_0xd81c('0x1e')];var _0x68230e=_0x3d28d?0x0:_0x9c5a43[_0xd81c('0x1b')];var _0x5d5401=_0x3d28d?_0x1a2d94[_0xd81c('0x1e')]:_0x9c5a43[_0xd81c('0x1b')]+_0x9c5a43[_0xd81c('0x1d')];var _0x2bf4a4;if(_0x5d5401>=_0x102afa){_0x5d5401=_0x102afa;_0x2bf4a4=0xc8;}else{_0x2bf4a4=0xce;}_0x260706['status'](_0x2bf4a4);return _0x260706['set'](_0xd81c('0x1f'),_0x68230e+'-'+_0x5d5401+'/'+_0x102afa)[_0xd81c('0x20')](_0x1a2d94);}return null;};}function patchUpdates(_0x5aad6a){return function(_0x11e9d9){try{jsonpatch[_0xd81c('0x21')](_0x11e9d9,_0x5aad6a,!![]);}catch(_0x29280c){return BPromise[_0xd81c('0x22')](_0x29280c);}return _0x11e9d9[_0xd81c('0x23')]();};}function saveUpdates(_0xfd6664,_0x4d0ccc){return function(_0x3dc088){if(_0x3dc088){return _0x3dc088[_0xd81c('0x24')](_0xfd6664)[_0xd81c('0x25')](function(_0x711a36){return _0x711a36;});}return null;};}function removeEntity(_0x2fba63,_0x38d18b){return function(_0x24b15c){if(_0x24b15c){return _0x24b15c[_0xd81c('0x26')]()[_0xd81c('0x25')](function(){_0x2fba63['status'](0xcc)[_0xd81c('0x27')]();});}};}function handleEntityNotFound(_0x335d4e,_0x45e144){return function(_0x5bb34e){if(!_0x5bb34e){_0x335d4e[_0xd81c('0x28')](0x194);}return _0x5bb34e;};}function handleError(_0x97eb28,_0x791220){_0x791220=_0x791220||0x1f4;return function(_0x160459){logger[_0xd81c('0x29')](_0x160459['stack']);if(_0x160459['name']){delete _0x160459[_0xd81c('0x2a')];}_0x97eb28[_0xd81c('0x1a')](_0x791220)[_0xd81c('0x2b')](_0x160459);};}exports[_0xd81c('0x2c')]=function(_0x154661,_0xeb6aed){var _0x493902={},_0x2414cd={},_0x380ed5={'count':0x0,'rows':[]};var _0xd04da6=_[_0xd81c('0x2d')](db[_0xd81c('0x2e')][_0xd81c('0x2f')],function(_0x5b593d){return{'name':_0x5b593d[_0xd81c('0x30')],'type':_0x5b593d[_0xd81c('0x31')][_0xd81c('0x32')]};});_0x2414cd[_0xd81c('0x33')]=_[_0xd81c('0x2d')](_0xd04da6,'name');_0x2414cd[_0xd81c('0x34')]=_[_0xd81c('0x35')](_0x154661[_0xd81c('0x34')]);_0x2414cd['filters']=_[_0xd81c('0x36')](_0x2414cd['model'],_0x2414cd[_0xd81c('0x34')]);_0x493902['attributes']=_[_0xd81c('0x36')](_0x2414cd[_0xd81c('0x33')],qs[_0xd81c('0x37')](_0x154661[_0xd81c('0x34')]['fields']));_0x493902['attributes']=_0x493902['attributes'][_0xd81c('0x38')]?_0x493902['attributes']:_0x2414cd[_0xd81c('0x33')];if(!_0x154661[_0xd81c('0x34')]['hasOwnProperty'](_0xd81c('0x39'))){_0x493902[_0xd81c('0x1d')]=qs[_0xd81c('0x1d')](_0x154661['query']['limit']);_0x493902['offset']=qs[_0xd81c('0x1b')](_0x154661['query']['offset']);}_0x493902[_0xd81c('0x3a')]=qs[_0xd81c('0x3b')](_0x154661[_0xd81c('0x34')][_0xd81c('0x3b')]);_0x493902[_0xd81c('0x3c')]=qs[_0xd81c('0x3d')](_[_0xd81c('0x3e')](_0x154661[_0xd81c('0x34')],_0x2414cd[_0xd81c('0x3d')]),_0xd04da6);if(_0x154661[_0xd81c('0x34')][_0xd81c('0x3f')]){_0x493902['where']=_[_0xd81c('0x40')](_0x493902[_0xd81c('0x3c')],{'$or':_['map'](_0xd04da6,function(_0x42adc9){if(_0x42adc9['type']!==_0xd81c('0x41')){var _0x15980c={};_0x15980c[_0x42adc9[_0xd81c('0x2a')]]={'$like':'%'+_0x154661[_0xd81c('0x34')]['filter']+'%'};return _0x15980c;}})});}_0x493902=_[_0xd81c('0x40')]({},_0x493902,_0x154661[_0xd81c('0x42')]);var _0x15a080={'where':_0x493902[_0xd81c('0x3c')]};return db[_0xd81c('0x2e')][_0xd81c('0x1e')](_0x15a080)[_0xd81c('0x25')](function(_0x21373f){_0x380ed5[_0xd81c('0x1e')]=_0x21373f;if(_0x154661[_0xd81c('0x34')][_0xd81c('0x43')]){_0x493902[_0xd81c('0x44')]=[{'all':!![]}];}return db[_0xd81c('0x2e')][_0xd81c('0x45')](_0x493902);})['then'](function(_0xb9ab9c){_0x380ed5[_0xd81c('0x46')]=_0xb9ab9c;return _0x380ed5;})[_0xd81c('0x25')](respondWithFilteredResult(_0xeb6aed,_0x493902))['catch'](handleError(_0xeb6aed,null));};exports[_0xd81c('0x47')]=function(_0x37872e,_0x5a487f){var _0x11400b={'raw':!![],'where':{'id':_0x37872e[_0xd81c('0x48')]['id']}},_0x285cba={};_0x285cba[_0xd81c('0x33')]=_[_0xd81c('0x35')](db[_0xd81c('0x2e')][_0xd81c('0x2f')]);_0x285cba[_0xd81c('0x34')]=_[_0xd81c('0x35')](_0x37872e['query']);_0x285cba['filters']=_[_0xd81c('0x36')](_0x285cba[_0xd81c('0x33')],_0x285cba[_0xd81c('0x34')]);_0x11400b[_0xd81c('0x49')]=_['intersection'](_0x285cba[_0xd81c('0x33')],qs[_0xd81c('0x37')](_0x37872e[_0xd81c('0x34')][_0xd81c('0x37')]));_0x11400b[_0xd81c('0x49')]=_0x11400b[_0xd81c('0x49')][_0xd81c('0x38')]?_0x11400b['attributes']:_0x285cba[_0xd81c('0x33')];if(_0x37872e[_0xd81c('0x34')][_0xd81c('0x43')]){_0x11400b['include']=[{'all':!![]}];}_0x11400b=_[_0xd81c('0x40')]({},_0x11400b,_0x37872e[_0xd81c('0x42')]);return db[_0xd81c('0x2e')]['find'](_0x11400b)['then'](handleEntityNotFound(_0x5a487f,null))[_0xd81c('0x25')](respondWithResult(_0x5a487f,null))['catch'](handleError(_0x5a487f,null));};exports[_0xd81c('0x4a')]=function(_0x51d51c,_0x175941){return db['OpenchannelQueueReport']['create'](_0x51d51c[_0xd81c('0x4b')],{})[_0xd81c('0x25')](respondWithResult(_0x175941,0xc9))['catch'](handleError(_0x175941,null));};exports[_0xd81c('0x24')]=function(_0x61a09a,_0x2196c7){if(_0x61a09a['body']['id']){delete _0x61a09a[_0xd81c('0x4b')]['id'];}return db[_0xd81c('0x2e')]['find']({'where':{'id':_0x61a09a['params']['id']}})['then'](handleEntityNotFound(_0x2196c7,null))[_0xd81c('0x25')](saveUpdates(_0x61a09a['body'],null))['then'](respondWithResult(_0x2196c7,null))[_0xd81c('0x4c')](handleError(_0x2196c7,null));};exports['destroy']=function(_0x514ff5,_0x241f18){return db[_0xd81c('0x2e')][_0xd81c('0x4d')]({'where':{'id':_0x514ff5[_0xd81c('0x48')]['id']}})['then'](handleEntityNotFound(_0x241f18,null))[_0xd81c('0x25')](removeEntity(_0x241f18,null))[_0xd81c('0x4c')](handleError(_0x241f18,null));};exports['describe']=function(_0x2400c0,_0x1f0223){return db[_0xd81c('0x2e')][_0xd81c('0x4e')]()[_0xd81c('0x25')](respondWithResult(_0x1f0223,null))['catch'](handleError(_0x1f0223,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 0c4ac91..2e1d0c2 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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x2d576c,_0x1ae8f6){var _0x153cee=function(_0x4ab2fa){while(--_0x4ab2fa){_0x2d576c['push'](_0x2d576c['shift']());}};_0x153cee(++_0x1ae8f6);}(_0x7a54,0x106));var _0x47a5=function(_0x1182ab,_0x10bb6f){_0x1182ab=_0x1182ab-0x0;var _0x403bac=_0x7a54[_0x1182ab];return _0x403bac;};'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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x2acc70,_0x198b20){var _0x1d1e9e=function(_0x38bf48){while(--_0x38bf48){_0x2acc70['push'](_0x2acc70['shift']());}};_0x1d1e9e(++_0x198b20);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 8caf86c..d19f92e 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 _0xaa5e=['UpdateOpenchannelQueueReport','update','body','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','OpenchannelQueueReport','create','options','raw','CreateOpenchannelQueueReport','debug','catch'];(function(_0x91b85b,_0x39f625){var _0x4d0549=function(_0x1b6cfc){while(--_0x1b6cfc){_0x91b85b['push'](_0x91b85b['shift']());}};_0x4d0549(++_0x39f625);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x1c36b7,_0x17bf0){_0x1c36b7=_0x1c36b7-0x0;var _0x25360d=_0xaa5e[_0x1c36b7];return _0x25360d;};'use strict';var _=require(_0xeaa5('0x0'));var util=require(_0xeaa5('0x1'));var moment=require('moment');var BPromise=require(_0xeaa5('0x2'));var rs=require(_0xeaa5('0x3'));var fs=require('fs');var Redis=require(_0xeaa5('0x4'));var db=require(_0xeaa5('0x5'))['db'];var utils=require(_0xeaa5('0x6'));var logger=require('../../config/logger')(_0xeaa5('0x7'));var config=require(_0xeaa5('0x8'));var jayson=require(_0xeaa5('0x9'));var client=jayson[_0xeaa5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d405e,_0x2f9041,_0x2c9696){return new BPromise(function(_0x50cb62,_0x2e35c3){return client[_0xeaa5('0xb')](_0x4d405e,_0x2c9696)['then'](function(_0x2e9ca6){logger['info'](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));logger['debug'](_0xeaa5('0xe'),_0x2f9041,_0xeaa5('0xd'),JSON[_0xeaa5('0xf')](_0x2e9ca6));if(_0x2e9ca6[_0xeaa5('0x10')]){if(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x11')]===0x1f4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x2e35c3(_0x2e9ca6[_0xeaa5('0x10')][_0xeaa5('0x12')]);}logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x2e9ca6[_0xeaa5('0x10')]['message']);return _0x50cb62(_0x2e9ca6[_0xeaa5('0x10')]['message']);}else{logger[_0xeaa5('0x13')](_0xeaa5('0xc'),_0x2f9041,_0xeaa5('0xd'));_0x50cb62(_0x2e9ca6['result'][_0xeaa5('0x12')]);}})['catch'](function(_0x44e4b4){logger[_0xeaa5('0x10')](_0xeaa5('0xc'),_0x2f9041,_0x44e4b4);_0x2e35c3(_0x44e4b4);});});}exports['CreateOpenchannelQueueReport']=function(_0x1877a6){var _0x50256a=this;return new Promise(function(_0x222da7,_0x85fb44){return db[_0xeaa5('0x14')][_0xeaa5('0x15')](_0x1877a6['body'],{'raw':_0x1877a6[_0xeaa5('0x16')]?_0x1877a6[_0xeaa5('0x16')][_0xeaa5('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x11ace2){logger[_0xeaa5('0x13')](_0xeaa5('0x18'),_0x1877a6);logger[_0xeaa5('0x19')](_0xeaa5('0x18'),_0x1877a6,JSON['stringify'](_0x11ace2));_0x222da7(_0x11ace2);})[_0xeaa5('0x1a')](function(_0x5f2d83){logger[_0xeaa5('0x10')](_0xeaa5('0x18'),_0x5f2d83[_0xeaa5('0x12')],_0x1877a6);_0x85fb44(_0x50256a[_0xeaa5('0x10')](0x1f4,_0x5f2d83[_0xeaa5('0x12')]));});});};exports[_0xeaa5('0x1b')]=function(_0x355dbd){var _0xee844c=this;return new Promise(function(_0xebce8c,_0x2c4003){return db[_0xeaa5('0x14')][_0xeaa5('0x1c')](_0x355dbd[_0xeaa5('0x1d')],{'raw':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['where']||null:null,'attributes':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')][_0xeaa5('0x1e')]||null:null,'limit':_0x355dbd[_0xeaa5('0x16')]?_0x355dbd[_0xeaa5('0x16')]['limit']||null:null})[_0xeaa5('0x1f')](function(_0x592fe1){logger[_0xeaa5('0x13')](_0xeaa5('0x1b'),_0x355dbd);logger[_0xeaa5('0x19')](_0xeaa5('0x1b'),_0x355dbd,JSON[_0xeaa5('0xf')](_0x592fe1));_0xebce8c(_0x592fe1);})[_0xeaa5('0x1a')](function(_0x5121b6){logger[_0xeaa5('0x10')](_0xeaa5('0x1b'),_0x5121b6['message'],_0x355dbd);_0x2c4003(_0xee844c[_0xeaa5('0x10')](0x1f4,_0x5121b6['message']));});});}; \ No newline at end of file +var _0xeb3b=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','raw','debug','stringify','UpdateOpenchannelQueueReport','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x541095,_0x582b30){_0x541095=_0x541095-0x0;var _0x5a2c40=_0xeb3b[_0x541095];return _0x5a2c40;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1d917b){logger['info']('CreateOpenchannelQueueReport',_0x44a4bb);logger[_0xbeb3('0x1a')](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1b')](_0x1d917b));_0x10b15d(_0x1d917b);})['catch'](function(_0x301899){logger[_0xbeb3('0x10')]('CreateOpenchannelQueueReport',_0x301899[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x301899['message']));});});};exports[_0xbeb3('0x1c')]=function(_0x278fe4){var _0x16b079=this;return new Promise(function(_0x42c6c3,_0x2bc188){return db[_0xbeb3('0x16')][_0xbeb3('0x1d')](_0x278fe4[_0xbeb3('0x18')],{'raw':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4['options'][_0xbeb3('0x1f')]||null:null,'attributes':_0x278fe4[_0xbeb3('0x1e')]?_0x278fe4[_0xbeb3('0x1e')][_0xbeb3('0x20')]||null:null,'limit':_0x278fe4['options']?_0x278fe4[_0xbeb3('0x1e')]['limit']||null:null})[_0xbeb3('0xb')](function(_0xab301c){logger['info']('UpdateOpenchannelQueueReport',_0x278fe4);logger[_0xbeb3('0x1a')]('UpdateOpenchannelQueueReport',_0x278fe4,JSON['stringify'](_0xab301c));_0x42c6c3(_0xab301c);})['catch'](function(_0x5bfef7){logger[_0xbeb3('0x10')]('UpdateOpenchannelQueueReport',_0x5bfef7[_0xbeb3('0x12')],_0x278fe4);_0x2bc188(_0x16b079[_0xbeb3('0x10')](0x1f4,_0x5bfef7[_0xbeb3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 7acc717..335c7a1 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 _0xeecd=['update','delete','exports','multer','util','path','Router','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id'];(function(_0xb17137,_0x51d889){var _0x10d596=function(_0x1f78ef){while(--_0x1f78ef){_0xb17137['push'](_0xb17137['shift']());}};_0x10d596(++_0x51d889);}(_0xeecd,0x159));var _0xdeec=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeecd[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xdeec('0x0'));var util=require(_0xdeec('0x1'));var path=require(_0xdeec('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdeec('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdeec('0x4'));router[_0xdeec('0x5')]('/',auth[_0xdeec('0x6')](),controller[_0xdeec('0x7')]);router[_0xdeec('0x5')](_0xdeec('0x8'),auth['isAuthenticated'](),controller[_0xdeec('0x9')]);router[_0xdeec('0x5')]('/:id',auth[_0xdeec('0x6')](),controller[_0xdeec('0xa')]);router[_0xdeec('0xb')]('/',auth[_0xdeec('0x6')](),controller[_0xdeec('0xc')]);router[_0xdeec('0xd')](_0xdeec('0xe'),auth[_0xdeec('0x6')](),controller[_0xdeec('0xf')]);router[_0xdeec('0x10')]('/:id',auth[_0xdeec('0x6')](),controller['destroy']);module[_0xdeec('0x11')]=router; \ No newline at end of file +var _0x55aa=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x475687,_0x782d14){var _0x4fc3b5=function(_0x8ef69e){while(--_0x8ef69e){_0x475687['push'](_0x475687['shift']());}};_0x4fc3b5(++_0x782d14);}(_0x55aa,0x111));var _0xa55a=function(_0x3c0645,_0xde815e){_0x3c0645=_0x3c0645-0x0;var _0x2c5e49=_0x55aa[_0x3c0645];return _0x2c5e49;};'use strict';var multer=require(_0xa55a('0x0'));var util=require(_0xa55a('0x1'));var path=require(_0xa55a('0x2'));var timeout=require(_0xa55a('0x3'));var express=require(_0xa55a('0x4'));var router=express[_0xa55a('0x5')]();var fs_extra=require(_0xa55a('0x6'));var auth=require(_0xa55a('0x7'));var interaction=require(_0xa55a('0x8'));var config=require(_0xa55a('0x9'));var controller=require('./openchannelTransferReport.controller');router[_0xa55a('0xa')]('/',auth['isAuthenticated'](),controller[_0xa55a('0xb')]);router[_0xa55a('0xa')](_0xa55a('0xc'),auth[_0xa55a('0xd')](),controller['describe']);router[_0xa55a('0xa')](_0xa55a('0xe'),auth[_0xa55a('0xd')](),controller[_0xa55a('0xf')]);router[_0xa55a('0x10')]('/',auth['isAuthenticated'](),controller[_0xa55a('0x11')]);router[_0xa55a('0x12')]('/:id',auth[_0xa55a('0xd')](),controller[_0xa55a('0x13')]);router[_0xa55a('0x14')]('/:id',auth[_0xa55a('0xd')](),controller[_0xa55a('0x15')]);module[_0xa55a('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index cc41a53..e4297bf 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x5ef77f,_0x24e148){var _0x7a34d6=function(_0x12e228){while(--_0x12e228){_0x5ef77f['push'](_0x5ef77f['shift']());}};_0x7a34d6(++_0x24e148);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xf3cd[_0x4b174a];return _0x3cd7bf;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x543bf6,_0x763bd7){var _0x4187b3=function(_0x2e44c7){while(--_0x2e44c7){_0x543bf6['push'](_0x543bf6['shift']());}};_0x4187b3(++_0x763bd7);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index af1246e..a4fa81e 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 _0xe2bb=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','VIRTUAL','merge','options','includeAll','include','rows','params','find','create','body','catch','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status'];(function(_0x5028f0,_0x47fb90){var _0x2ba45b=function(_0x49411a){while(--_0x49411a){_0x5028f0['push'](_0x5028f0['shift']());}};_0x2ba45b(++_0x47fb90);}(_0xe2bb,0x13d));var _0xbe2b=function(_0x455730,_0x33a55f){_0x455730=_0x455730-0x0;var _0x43ca34=_0xe2bb[_0x455730];return _0x43ca34;};'use strict';var emlformat=require(_0xbe2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe2b('0x1'));var jsonpatch=require(_0xbe2b('0x2'));var rp=require(_0xbe2b('0x3'));var moment=require('moment');var BPromise=require(_0xbe2b('0x4'));var Mustache=require(_0xbe2b('0x5'));var util=require(_0xbe2b('0x6'));var path=require(_0xbe2b('0x7'));var sox=require(_0xbe2b('0x8'));var csv=require(_0xbe2b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe2b('0xa'));var _=require(_0xbe2b('0xb'));var squel=require(_0xbe2b('0xc'));var crypto=require(_0xbe2b('0xd'));var jsforce=require(_0xbe2b('0xe'));var deskjs=require(_0xbe2b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbe2b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe2b('0x11'));var hardwareService=require(_0xbe2b('0x12'));var logger=require(_0xbe2b('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbe2b('0x14'));var db=require(_0xbe2b('0x15'))['db'];function respondWithStatusCode(_0x4573ac,_0x40c4b3){_0x40c4b3=_0x40c4b3||0xcc;return function(_0x1ca9fe){if(_0x1ca9fe){return _0x4573ac['sendStatus'](_0x40c4b3);}return _0x4573ac[_0xbe2b('0x16')](_0x40c4b3)[_0xbe2b('0x17')]();};}function respondWithResult(_0x67f399,_0x307d64){_0x307d64=_0x307d64||0xc8;return function(_0x2f584b){if(_0x2f584b){return _0x67f399[_0xbe2b('0x16')](_0x307d64)[_0xbe2b('0x18')](_0x2f584b);}};}function respondWithFilteredResult(_0x2dde47,_0x2141e5){return function(_0x2f1cd6){if(_0x2f1cd6){var _0x2baa86=typeof _0x2141e5[_0xbe2b('0x19')]===_0xbe2b('0x1a')&&typeof _0x2141e5[_0xbe2b('0x1b')]==='undefined';var _0x1493b4=_0x2f1cd6[_0xbe2b('0x1c')];var _0x5d3e63=_0x2baa86?0x0:_0x2141e5[_0xbe2b('0x19')];var _0x57cbb5=_0x2baa86?_0x2f1cd6[_0xbe2b('0x1c')]:_0x2141e5[_0xbe2b('0x19')]+_0x2141e5[_0xbe2b('0x1b')];var _0x2fad80;if(_0x57cbb5>=_0x1493b4){_0x57cbb5=_0x1493b4;_0x2fad80=0xc8;}else{_0x2fad80=0xce;}_0x2dde47[_0xbe2b('0x16')](_0x2fad80);return _0x2dde47['set'](_0xbe2b('0x1d'),_0x5d3e63+'-'+_0x57cbb5+'/'+_0x1493b4)[_0xbe2b('0x18')](_0x2f1cd6);}return null;};}function patchUpdates(_0x34dc12){return function(_0x54c1ed){try{jsonpatch[_0xbe2b('0x1e')](_0x54c1ed,_0x34dc12,!![]);}catch(_0x110ef3){return BPromise[_0xbe2b('0x1f')](_0x110ef3);}return _0x54c1ed[_0xbe2b('0x20')]();};}function saveUpdates(_0x28027e,_0x8ea87b){return function(_0x398379){if(_0x398379){return _0x398379['update'](_0x28027e)['then'](function(_0x2e1e32){return _0x2e1e32;});}return null;};}function removeEntity(_0x951438,_0x5b5bff){return function(_0x2fbbe9){if(_0x2fbbe9){return _0x2fbbe9[_0xbe2b('0x21')]()[_0xbe2b('0x22')](function(){_0x951438[_0xbe2b('0x16')](0xcc)[_0xbe2b('0x17')]();});}};}function handleEntityNotFound(_0x20856d,_0xeabafb){return function(_0x1ebece){if(!_0x1ebece){_0x20856d['sendStatus'](0x194);}return _0x1ebece;};}function handleError(_0x269525,_0x4fce85){_0x4fce85=_0x4fce85||0x1f4;return function(_0x3ff30d){logger[_0xbe2b('0x23')](_0x3ff30d[_0xbe2b('0x24')]);if(_0x3ff30d['name']){delete _0x3ff30d[_0xbe2b('0x25')];}_0x269525[_0xbe2b('0x16')](_0x4fce85)['send'](_0x3ff30d);};}exports[_0xbe2b('0x26')]=function(_0x4f89c4,_0xa1a7cc){var _0x3352d6={},_0xf06d53={},_0x34047c={'count':0x0,'rows':[]};var _0x3136ee=_[_0xbe2b('0x27')](db[_0xbe2b('0x28')][_0xbe2b('0x29')],function(_0x23a262){return{'name':_0x23a262[_0xbe2b('0x2a')],'type':_0x23a262[_0xbe2b('0x2b')]['key']};});_0xf06d53[_0xbe2b('0x2c')]=_[_0xbe2b('0x27')](_0x3136ee,'name');_0xf06d53[_0xbe2b('0x2d')]=_[_0xbe2b('0x2e')](_0x4f89c4[_0xbe2b('0x2d')]);_0xf06d53[_0xbe2b('0x2f')]=_[_0xbe2b('0x30')](_0xf06d53['model'],_0xf06d53[_0xbe2b('0x2d')]);_0x3352d6['attributes']=_[_0xbe2b('0x30')](_0xf06d53[_0xbe2b('0x2c')],qs['fields'](_0x4f89c4[_0xbe2b('0x2d')][_0xbe2b('0x31')]));_0x3352d6[_0xbe2b('0x32')]=_0x3352d6['attributes'][_0xbe2b('0x33')]?_0x3352d6[_0xbe2b('0x32')]:_0xf06d53['model'];if(!_0x4f89c4[_0xbe2b('0x2d')][_0xbe2b('0x34')]('nolimit')){_0x3352d6[_0xbe2b('0x1b')]=qs['limit'](_0x4f89c4['query']['limit']);_0x3352d6[_0xbe2b('0x19')]=qs[_0xbe2b('0x19')](_0x4f89c4[_0xbe2b('0x2d')][_0xbe2b('0x19')]);}_0x3352d6[_0xbe2b('0x35')]=qs['sort'](_0x4f89c4['query']['sort']);_0x3352d6['where']=qs[_0xbe2b('0x2f')](_['pick'](_0x4f89c4['query'],_0xf06d53[_0xbe2b('0x2f')]),_0x3136ee);if(_0x4f89c4[_0xbe2b('0x2d')]['filter']){_0x3352d6['where']=_['merge'](_0x3352d6[_0xbe2b('0x36')],{'$or':_[_0xbe2b('0x27')](_0x3136ee,function(_0x571d0d){if(_0x571d0d[_0xbe2b('0x2b')]!==_0xbe2b('0x37')){var _0x4dca36={};_0x4dca36[_0x571d0d[_0xbe2b('0x25')]]={'$like':'%'+_0x4f89c4[_0xbe2b('0x2d')]['filter']+'%'};return _0x4dca36;}})});}_0x3352d6=_[_0xbe2b('0x38')]({},_0x3352d6,_0x4f89c4[_0xbe2b('0x39')]);var _0x1155e4={'where':_0x3352d6[_0xbe2b('0x36')]};return db[_0xbe2b('0x28')][_0xbe2b('0x1c')](_0x1155e4)[_0xbe2b('0x22')](function(_0xc9ab9b){_0x34047c[_0xbe2b('0x1c')]=_0xc9ab9b;if(_0x4f89c4[_0xbe2b('0x2d')][_0xbe2b('0x3a')]){_0x3352d6[_0xbe2b('0x3b')]=[{'all':!![]}];}return db[_0xbe2b('0x28')]['findAll'](_0x3352d6);})['then'](function(_0x20a1bc){_0x34047c[_0xbe2b('0x3c')]=_0x20a1bc;return _0x34047c;})[_0xbe2b('0x22')](respondWithFilteredResult(_0xa1a7cc,_0x3352d6))['catch'](handleError(_0xa1a7cc,null));};exports['show']=function(_0x4b3219,_0x152165){var _0x3ddd70={'raw':!![],'where':{'id':_0x4b3219[_0xbe2b('0x3d')]['id']}},_0x44a3cd={};_0x44a3cd['model']=_[_0xbe2b('0x2e')](db[_0xbe2b('0x28')][_0xbe2b('0x29')]);_0x44a3cd[_0xbe2b('0x2d')]=_[_0xbe2b('0x2e')](_0x4b3219[_0xbe2b('0x2d')]);_0x44a3cd[_0xbe2b('0x2f')]=_[_0xbe2b('0x30')](_0x44a3cd[_0xbe2b('0x2c')],_0x44a3cd[_0xbe2b('0x2d')]);_0x3ddd70['attributes']=_[_0xbe2b('0x30')](_0x44a3cd[_0xbe2b('0x2c')],qs[_0xbe2b('0x31')](_0x4b3219[_0xbe2b('0x2d')][_0xbe2b('0x31')]));_0x3ddd70[_0xbe2b('0x32')]=_0x3ddd70[_0xbe2b('0x32')][_0xbe2b('0x33')]?_0x3ddd70[_0xbe2b('0x32')]:_0x44a3cd[_0xbe2b('0x2c')];if(_0x4b3219[_0xbe2b('0x2d')][_0xbe2b('0x3a')]){_0x3ddd70[_0xbe2b('0x3b')]=[{'all':!![]}];}_0x3ddd70=_[_0xbe2b('0x38')]({},_0x3ddd70,_0x4b3219[_0xbe2b('0x39')]);return db[_0xbe2b('0x28')][_0xbe2b('0x3e')](_0x3ddd70)[_0xbe2b('0x22')](handleEntityNotFound(_0x152165,null))[_0xbe2b('0x22')](respondWithResult(_0x152165,null))['catch'](handleError(_0x152165,null));};exports[_0xbe2b('0x3f')]=function(_0x570bf8,_0x2f3150){return db[_0xbe2b('0x28')]['create'](_0x570bf8[_0xbe2b('0x40')],{})['then'](respondWithResult(_0x2f3150,0xc9))[_0xbe2b('0x41')](handleError(_0x2f3150,null));};exports[_0xbe2b('0x42')]=function(_0x37e009,_0x510587){if(_0x37e009[_0xbe2b('0x40')]['id']){delete _0x37e009[_0xbe2b('0x40')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x37e009[_0xbe2b('0x3d')]['id']}})[_0xbe2b('0x22')](handleEntityNotFound(_0x510587,null))[_0xbe2b('0x22')](saveUpdates(_0x37e009['body'],null))[_0xbe2b('0x22')](respondWithResult(_0x510587,null))['catch'](handleError(_0x510587,null));};exports[_0xbe2b('0x21')]=function(_0x64f421,_0x3bee45){return db[_0xbe2b('0x28')][_0xbe2b('0x3e')]({'where':{'id':_0x64f421[_0xbe2b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3bee45,null))[_0xbe2b('0x22')](removeEntity(_0x3bee45,null))[_0xbe2b('0x41')](handleError(_0x3bee45,null));};exports[_0xbe2b('0x43')]=function(_0x40a752,_0x2d135d){return db['OpenchannelTransferReport'][_0xbe2b('0x43')]()[_0xbe2b('0x22')](respondWithResult(_0x2d135d,null))[_0xbe2b('0x41')](handleError(_0x2d135d,null));}; \ No newline at end of file +var _0x948d=['limit','count','offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','OpenchannelTransferReport','rawAttributes','type','key','model','query','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','status','end','undefined'];(function(_0x2695a7,_0x510601){var _0x3715fa=function(_0x5abf19){while(--_0x5abf19){_0x2695a7['push'](_0x2695a7['shift']());}};_0x3715fa(++_0x510601);}(_0x948d,0x1e5));var _0xd948=function(_0x357313,_0x8c348f){_0x357313=_0x357313-0x0;var _0x2042e7=_0x948d[_0x357313];return _0x2042e7;};'use strict';var emlformat=require(_0xd948('0x0'));var rimraf=require(_0xd948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd948('0x2'));var rp=require(_0xd948('0x3'));var moment=require(_0xd948('0x4'));var BPromise=require(_0xd948('0x5'));var Mustache=require('mustache');var util=require(_0xd948('0x6'));var path=require(_0xd948('0x7'));var sox=require(_0xd948('0x8'));var csv=require('to-csv');var ejs=require(_0xd948('0x9'));var fs=require('fs');var fs_extra=require(_0xd948('0xa'));var _=require('lodash');var squel=require(_0xd948('0xb'));var crypto=require(_0xd948('0xc'));var jsforce=require(_0xd948('0xd'));var deskjs=require(_0xd948('0xe'));var toCsv=require(_0xd948('0xf'));var querystring=require(_0xd948('0x10'));var Papa=require('papaparse');var Redis=require(_0xd948('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd948('0x12'));var as=require(_0xd948('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd948('0x14'))('api');var utils=require(_0xd948('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd948('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4039f8,_0x314eaa){_0x314eaa=_0x314eaa||0xcc;return function(_0x2773af){if(_0x2773af){return _0x4039f8['sendStatus'](_0x314eaa);}return _0x4039f8[_0xd948('0x17')](_0x314eaa)[_0xd948('0x18')]();};}function respondWithResult(_0x4f0029,_0x51c338){_0x51c338=_0x51c338||0xc8;return function(_0x21270a){if(_0x21270a){return _0x4f0029['status'](_0x51c338)['json'](_0x21270a);}};}function respondWithFilteredResult(_0x28ec1b,_0x4a745d){return function(_0x3dc6b0){if(_0x3dc6b0){var _0x142101=typeof _0x4a745d['offset']===_0xd948('0x19')&&typeof _0x4a745d[_0xd948('0x1a')]===_0xd948('0x19');var _0x5e5e6e=_0x3dc6b0[_0xd948('0x1b')];var _0x19ff4c=_0x142101?0x0:_0x4a745d[_0xd948('0x1c')];var _0x2d9af2=_0x142101?_0x3dc6b0['count']:_0x4a745d[_0xd948('0x1c')]+_0x4a745d[_0xd948('0x1a')];var _0x110af5;if(_0x2d9af2>=_0x5e5e6e){_0x2d9af2=_0x5e5e6e;_0x110af5=0xc8;}else{_0x110af5=0xce;}_0x28ec1b[_0xd948('0x17')](_0x110af5);return _0x28ec1b[_0xd948('0x1d')]('Content-Range',_0x19ff4c+'-'+_0x2d9af2+'/'+_0x5e5e6e)[_0xd948('0x1e')](_0x3dc6b0);}return null;};}function patchUpdates(_0x14d8f4){return function(_0x24b31e){try{jsonpatch[_0xd948('0x1f')](_0x24b31e,_0x14d8f4,!![]);}catch(_0x4d5b42){return BPromise[_0xd948('0x20')](_0x4d5b42);}return _0x24b31e[_0xd948('0x21')]();};}function saveUpdates(_0x137880,_0x590c3e){return function(_0x425556){if(_0x425556){return _0x425556[_0xd948('0x22')](_0x137880)[_0xd948('0x23')](function(_0x43f468){return _0x43f468;});}return null;};}function removeEntity(_0x3e8722,_0x2dd070){return function(_0x233490){if(_0x233490){return _0x233490[_0xd948('0x24')]()[_0xd948('0x23')](function(){_0x3e8722['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a80f,_0x562989){return function(_0x545678){if(!_0x545678){_0x54a80f[_0xd948('0x25')](0x194);}return _0x545678;};}function handleError(_0x52fa00,_0x13c7bb){_0x13c7bb=_0x13c7bb||0x1f4;return function(_0x28ae42){logger[_0xd948('0x26')](_0x28ae42['stack']);if(_0x28ae42[_0xd948('0x27')]){delete _0x28ae42[_0xd948('0x27')];}_0x52fa00[_0xd948('0x17')](_0x13c7bb)[_0xd948('0x28')](_0x28ae42);};}exports['index']=function(_0x3d7331,_0x1fecee){var _0x47c660={},_0x38484f={},_0x575e07={'count':0x0,'rows':[]};var _0x2dfb93=_['map'](db[_0xd948('0x29')][_0xd948('0x2a')],function(_0x99d453){return{'name':_0x99d453['fieldName'],'type':_0x99d453[_0xd948('0x2b')][_0xd948('0x2c')]};});_0x38484f[_0xd948('0x2d')]=_['map'](_0x2dfb93,_0xd948('0x27'));_0x38484f['query']=_['keys'](_0x3d7331[_0xd948('0x2e')]);_0x38484f['filters']=_['intersection'](_0x38484f[_0xd948('0x2d')],_0x38484f[_0xd948('0x2e')]);_0x47c660[_0xd948('0x2f')]=_['intersection'](_0x38484f[_0xd948('0x2d')],qs['fields'](_0x3d7331[_0xd948('0x2e')][_0xd948('0x30')]));_0x47c660['attributes']=_0x47c660[_0xd948('0x2f')]['length']?_0x47c660['attributes']:_0x38484f['model'];if(!_0x3d7331['query']['hasOwnProperty'](_0xd948('0x31'))){_0x47c660[_0xd948('0x1a')]=qs['limit'](_0x3d7331['query']['limit']);_0x47c660['offset']=qs[_0xd948('0x1c')](_0x3d7331[_0xd948('0x2e')][_0xd948('0x1c')]);}_0x47c660[_0xd948('0x32')]=qs[_0xd948('0x33')](_0x3d7331[_0xd948('0x2e')]['sort']);_0x47c660[_0xd948('0x34')]=qs[_0xd948('0x35')](_[_0xd948('0x36')](_0x3d7331[_0xd948('0x2e')],_0x38484f['filters']),_0x2dfb93);if(_0x3d7331[_0xd948('0x2e')][_0xd948('0x37')]){_0x47c660['where']=_[_0xd948('0x38')](_0x47c660[_0xd948('0x34')],{'$or':_[_0xd948('0x39')](_0x2dfb93,function(_0x3c0c0a){if(_0x3c0c0a[_0xd948('0x2b')]!==_0xd948('0x3a')){var _0x41f2c5={};_0x41f2c5[_0x3c0c0a[_0xd948('0x27')]]={'$like':'%'+_0x3d7331[_0xd948('0x2e')][_0xd948('0x37')]+'%'};return _0x41f2c5;}})});}_0x47c660=_[_0xd948('0x38')]({},_0x47c660,_0x3d7331[_0xd948('0x3b')]);var _0x97bf24={'where':_0x47c660['where']};return db[_0xd948('0x29')]['count'](_0x97bf24)[_0xd948('0x23')](function(_0x580c81){_0x575e07[_0xd948('0x1b')]=_0x580c81;if(_0x3d7331[_0xd948('0x2e')]['includeAll']){_0x47c660[_0xd948('0x3c')]=[{'all':!![]}];}return db[_0xd948('0x29')][_0xd948('0x3d')](_0x47c660);})[_0xd948('0x23')](function(_0x23854e){_0x575e07[_0xd948('0x3e')]=_0x23854e;return _0x575e07;})['then'](respondWithFilteredResult(_0x1fecee,_0x47c660))[_0xd948('0x3f')](handleError(_0x1fecee,null));};exports[_0xd948('0x40')]=function(_0x63c343,_0x2b6a9d){var _0x164ff8={'raw':!![],'where':{'id':_0x63c343[_0xd948('0x41')]['id']}},_0x16e9de={};_0x16e9de['model']=_[_0xd948('0x42')](db[_0xd948('0x29')]['rawAttributes']);_0x16e9de[_0xd948('0x2e')]=_[_0xd948('0x42')](_0x63c343[_0xd948('0x2e')]);_0x16e9de[_0xd948('0x35')]=_[_0xd948('0x43')](_0x16e9de[_0xd948('0x2d')],_0x16e9de[_0xd948('0x2e')]);_0x164ff8[_0xd948('0x2f')]=_[_0xd948('0x43')](_0x16e9de[_0xd948('0x2d')],qs[_0xd948('0x30')](_0x63c343['query'][_0xd948('0x30')]));_0x164ff8['attributes']=_0x164ff8[_0xd948('0x2f')]['length']?_0x164ff8[_0xd948('0x2f')]:_0x16e9de[_0xd948('0x2d')];if(_0x63c343['query'][_0xd948('0x44')]){_0x164ff8['include']=[{'all':!![]}];}_0x164ff8=_[_0xd948('0x38')]({},_0x164ff8,_0x63c343['options']);return db[_0xd948('0x29')][_0xd948('0x45')](_0x164ff8)[_0xd948('0x23')](handleEntityNotFound(_0x2b6a9d,null))[_0xd948('0x23')](respondWithResult(_0x2b6a9d,null))[_0xd948('0x3f')](handleError(_0x2b6a9d,null));};exports[_0xd948('0x46')]=function(_0x1df8b7,_0xc296f5){return db[_0xd948('0x29')][_0xd948('0x46')](_0x1df8b7[_0xd948('0x47')],{})['then'](respondWithResult(_0xc296f5,0xc9))[_0xd948('0x3f')](handleError(_0xc296f5,null));};exports[_0xd948('0x22')]=function(_0x28a94e,_0x5b8694){if(_0x28a94e[_0xd948('0x47')]['id']){delete _0x28a94e[_0xd948('0x47')]['id'];}return db[_0xd948('0x29')]['find']({'where':{'id':_0x28a94e[_0xd948('0x41')]['id']}})[_0xd948('0x23')](handleEntityNotFound(_0x5b8694,null))[_0xd948('0x23')](saveUpdates(_0x28a94e[_0xd948('0x47')],null))[_0xd948('0x23')](respondWithResult(_0x5b8694,null))[_0xd948('0x3f')](handleError(_0x5b8694,null));};exports[_0xd948('0x24')]=function(_0x4f22eb,_0xa6c2e6){return db[_0xd948('0x29')][_0xd948('0x45')]({'where':{'id':_0x4f22eb[_0xd948('0x41')]['id']}})[_0xd948('0x23')](handleEntityNotFound(_0xa6c2e6,null))['then'](removeEntity(_0xa6c2e6,null))[_0xd948('0x3f')](handleError(_0xa6c2e6,null));};exports[_0xd948('0x48')]=function(_0x13a824,_0x54f7da){return db[_0xd948('0x29')]['describe']()['then'](respondWithResult(_0x54f7da,null))['catch'](handleError(_0x54f7da,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a6f2ecb..77d30d3 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 _0x61f7=['./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x39979b,_0x2111f9){var _0x560b41=function(_0x859cc0){while(--_0x859cc0){_0x39979b['push'](_0x39979b['shift']());}};_0x560b41(++_0x2111f9);}(_0x61f7,0x18b));var _0x761f=function(_0x1e021e,_0x3a4df1){_0x1e021e=_0x1e021e-0x0;var _0x537dbd=_0x61f7[_0x1e021e];return _0x537dbd;};'use strict';var _=require(_0x761f('0x0'));var util=require(_0x761f('0x1'));var logger=require(_0x761f('0x2'))(_0x761f('0x3'));var moment=require(_0x761f('0x4'));var BPromise=require('bluebird');var rp=require(_0x761f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x761f('0x6'));var config=require(_0x761f('0x7'));var attributes=require(_0x761f('0x8'));module[_0x761f('0x9')]=function(_0x4feda2,_0x1d90f2){return _0x4feda2['define'](_0x761f('0xa'),attributes,{'tableName':_0x761f('0xb'),'paranoid':![],'indexes':[{'name':_0x761f('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x543a=['util','../../config/logger','bluebird','../../config/environment','./openchannelTransferReport.attributes','exports','report_openchannel_transfer','uniqueid','lodash'];(function(_0x41bdd4,_0x3d5c76){var _0x5c03a6=function(_0x59634a){while(--_0x59634a){_0x41bdd4['push'](_0x41bdd4['shift']());}};_0x5c03a6(++_0x3d5c76);}(_0x543a,0xa1));var _0xa543=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x543a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa543('0x0'));var util=require(_0xa543('0x1'));var logger=require(_0xa543('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa543('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa543('0x4'));var attributes=require(_0xa543('0x5'));module[_0xa543('0x6')]=function(_0x191182,_0x1e70a4){return _0x191182['define']('OpenchannelTransferReport',attributes,{'tableName':_0xa543('0x7'),'paranoid':![],'indexes':[{'name':_0xa543('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 90a8d60..13b1e88 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 _0x3595=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0x3595,0x147));var _0x5359=function(_0x4e08a7,_0x2ee952){_0x4e08a7=_0x4e08a7-0x0;var _0x5c9b7d=_0x3595[_0x4e08a7];return _0x5c9b7d;};'use strict';var _=require(_0x5359('0x0'));var util=require(_0x5359('0x1'));var moment=require(_0x5359('0x2'));var BPromise=require('bluebird');var rs=require(_0x5359('0x3'));var fs=require('fs');var Redis=require(_0x5359('0x4'));var db=require(_0x5359('0x5'))['db'];var utils=require(_0x5359('0x6'));var logger=require(_0x5359('0x7'))(_0x5359('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5359('0x9')][_0x5359('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b6f48,_0x29a776,_0x39fcd8){return new BPromise(function(_0x51b2fb,_0x400db4){return client[_0x5359('0xb')](_0x1b6f48,_0x39fcd8)[_0x5359('0xc')](function(_0x15e2c6){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x29a776,'request\x20sent');logger['debug'](_0x5359('0xd'),_0x29a776,_0x5359('0xe'),JSON[_0x5359('0xf')](_0x15e2c6));if(_0x15e2c6[_0x5359('0x10')]){if(_0x15e2c6[_0x5359('0x10')][_0x5359('0x11')]===0x1f4){logger[_0x5359('0x10')](_0x5359('0x12'),_0x29a776,_0x15e2c6[_0x5359('0x10')][_0x5359('0x13')]);return _0x400db4(_0x15e2c6[_0x5359('0x10')][_0x5359('0x13')]);}logger[_0x5359('0x10')](_0x5359('0x12'),_0x29a776,_0x15e2c6['error']['message']);return _0x51b2fb(_0x15e2c6[_0x5359('0x10')][_0x5359('0x13')]);}else{logger[_0x5359('0x14')](_0x5359('0x12'),_0x29a776,_0x5359('0xe'));_0x51b2fb(_0x15e2c6[_0x5359('0x15')]['message']);}})['catch'](function(_0x267d4c){logger[_0x5359('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x29a776,_0x267d4c);_0x400db4(_0x267d4c);});});} \ No newline at end of file +var _0x0734=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1c2831,_0x5111a1){var _0x44a44e=function(_0x163adb){while(--_0x163adb){_0x1c2831['push'](_0x1c2831['shift']());}};_0x44a44e(++_0x5111a1);}(_0x0734,0xba));var _0x4073=function(_0x4459a6,_0x288e03){_0x4459a6=_0x4459a6-0x0;var _0x31a0c0=_0x0734[_0x4459a6];return _0x31a0c0;};'use strict';var _=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var moment=require(_0x4073('0x2'));var BPromise=require(_0x4073('0x3'));var rs=require(_0x4073('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4073('0x5'))['db'];var utils=require(_0x4073('0x6'));var logger=require(_0x4073('0x7'))(_0x4073('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4073('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3c14,_0x2195e0,_0x1251bd){return new BPromise(function(_0x22a33d,_0x51515d){return client[_0x4073('0xa')](_0x2c3c14,_0x1251bd)['then'](function(_0x5432c4){logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,_0x4073('0xd'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2195e0,_0x4073('0xd'),JSON[_0x4073('0xe')](_0x5432c4));if(_0x5432c4['error']){if(_0x5432c4[_0x4073('0xf')]['code']===0x1f4){logger[_0x4073('0xf')](_0x4073('0xc'),_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x51515d(_0x5432c4['error'][_0x4073('0x10')]);}logger[_0x4073('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x22a33d(_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);}else{logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,'request\x20sent');_0x22a33d(_0x5432c4[_0x4073('0x11')]['message']);}})[_0x4073('0x12')](function(_0x38ea09){logger['error'](_0x4073('0xc'),_0x2195e0,_0x38ea09);_0x51515d(_0x38ea09);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 46c97ea..0a63c34 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 _0x88ac=['../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x30712c,_0x92e797){var _0x5c66e1=function(_0x341d8d){while(--_0x341d8d){_0x30712c['push'](_0x30712c['shift']());}};_0x5c66e1(++_0x92e797);}(_0x88ac,0x72));var _0xc88a=function(_0x11eeda,_0x4a266f){_0x11eeda=_0x11eeda-0x0;var _0x385c89=_0x88ac[_0x11eeda];return _0x385c89;};'use strict';var multer=require(_0xc88a('0x0'));var util=require('util');var path=require(_0xc88a('0x1'));var timeout=require(_0xc88a('0x2'));var express=require('express');var router=express[_0xc88a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc88a('0x4'));var interaction=require(_0xc88a('0x5'));var config=require(_0xc88a('0x6'));var controller=require(_0xc88a('0x7'));router[_0xc88a('0x8')]('/',auth[_0xc88a('0x9')](),controller[_0xc88a('0xa')]);router[_0xc88a('0x8')](_0xc88a('0xb'),auth[_0xc88a('0x9')](),controller[_0xc88a('0xc')]);router[_0xc88a('0xd')]('/',auth[_0xc88a('0x9')](),controller[_0xc88a('0xe')]);router[_0xc88a('0xf')](_0xc88a('0xb'),auth[_0xc88a('0x9')](),controller[_0xc88a('0x10')]);router[_0xc88a('0x11')](_0xc88a('0xb'),auth['isAuthenticated'](),controller[_0xc88a('0x12')]);module[_0xc88a('0x13')]=router; \ No newline at end of file +var _0xabb2=['put','/:id','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','show','post','create'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xabb2,0x82));var _0x2abb=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0xabb2[_0x4c3070];return _0x536a44;};'use strict';var multer=require('multer');var util=require(_0x2abb('0x0'));var path=require(_0x2abb('0x1'));var timeout=require('connect-timeout');var express=require(_0x2abb('0x2'));var router=express[_0x2abb('0x3')]();var fs_extra=require(_0x2abb('0x4'));var auth=require(_0x2abb('0x5'));var interaction=require(_0x2abb('0x6'));var config=require(_0x2abb('0x7'));var controller=require(_0x2abb('0x8'));router[_0x2abb('0x9')]('/',auth[_0x2abb('0xa')](),controller['index']);router[_0x2abb('0x9')]('/:id',auth[_0x2abb('0xa')](),controller[_0x2abb('0xb')]);router[_0x2abb('0xc')]('/',auth['isAuthenticated'](),controller[_0x2abb('0xd')]);router[_0x2abb('0xe')](_0x2abb('0xf'),auth[_0x2abb('0xa')](),controller[_0x2abb('0x10')]);router['delete'](_0x2abb('0xf'),auth[_0x2abb('0xa')](),controller['destroy']);module[_0x2abb('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2633e04..8f63fc0 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 _0xba27=['name','exports','STRING'];(function(_0x437dcb,_0x4dce4c){var _0x420f5b=function(_0x1934aa){while(--_0x1934aa){_0x437dcb['push'](_0x437dcb['shift']());}};_0x420f5b(++_0x4dce4c);}(_0xba27,0x14b));var _0x7ba2=function(_0x26f169,_0x2d01b2){_0x26f169=_0x26f169-0x0;var _0x43aad9=_0xba27[_0x26f169];return _0x43aad9;};'use strict';var Sequelize=require('sequelize');module[_0x7ba2('0x0')]={'name':{'type':Sequelize[_0x7ba2('0x1')],'unique':_0x7ba2('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7ba2('0x1')]}}; \ No newline at end of file +var _0x5fc1=['name','sequelize','STRING'];(function(_0x355611,_0x417818){var _0x1cf2d9=function(_0x32b808){while(--_0x32b808){_0x355611['push'](_0x355611['shift']());}};_0x1cf2d9(++_0x417818);}(_0x5fc1,0x148));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x15fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fc('0x1')],'unique':_0x15fc('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 2987496..8cbffea 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 _0xb5d3=['../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','stack','name','send','index','map','Pause','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0xb5d3,0x128));var _0x3b5d=function(_0x64b31d,_0x393b36){_0x64b31d=_0x64b31d-0x0;var _0x42c45b=_0xb5d3[_0x64b31d];return _0x42c45b;};'use strict';var emlformat=require(_0x3b5d('0x0'));var rimraf=require(_0x3b5d('0x1'));var zipdir=require(_0x3b5d('0x2'));var jsonpatch=require(_0x3b5d('0x3'));var rp=require(_0x3b5d('0x4'));var moment=require(_0x3b5d('0x5'));var BPromise=require(_0x3b5d('0x6'));var Mustache=require(_0x3b5d('0x7'));var util=require('util');var path=require(_0x3b5d('0x8'));var sox=require(_0x3b5d('0x9'));var csv=require(_0x3b5d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b5d('0xb'));var _=require(_0x3b5d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3b5d('0xd'));var deskjs=require(_0x3b5d('0xe'));var toCsv=require(_0x3b5d('0xa'));var querystring=require(_0x3b5d('0xf'));var Papa=require(_0x3b5d('0x10'));var Redis=require(_0x3b5d('0x11'));var authService=require(_0x3b5d('0x12'));var qs=require(_0x3b5d('0x13'));var as=require(_0x3b5d('0x14'));var hardwareService=require(_0x3b5d('0x15'));var logger=require('../../config/logger')(_0x3b5d('0x16'));var utils=require('../../config/utils');var config=require(_0x3b5d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b5d('0x18'))['db'];function respondWithStatusCode(_0x425408,_0x23ac46){_0x23ac46=_0x23ac46||0xcc;return function(_0x451c9d){if(_0x451c9d){return _0x425408[_0x3b5d('0x19')](_0x23ac46);}return _0x425408[_0x3b5d('0x1a')](_0x23ac46)[_0x3b5d('0x1b')]();};}function respondWithResult(_0x1e8d34,_0x50027a){_0x50027a=_0x50027a||0xc8;return function(_0x50d9d2){if(_0x50d9d2){return _0x1e8d34[_0x3b5d('0x1a')](_0x50027a)[_0x3b5d('0x1c')](_0x50d9d2);}};}function respondWithFilteredResult(_0x18f96c,_0x372070){return function(_0x22c9c8){if(_0x22c9c8){var _0x49fd98=typeof _0x372070['offset']==='undefined'&&typeof _0x372070[_0x3b5d('0x1d')]===_0x3b5d('0x1e');var _0x41e526=_0x22c9c8[_0x3b5d('0x1f')];var _0x2cb610=_0x49fd98?0x0:_0x372070[_0x3b5d('0x20')];var _0x3e46c6=_0x49fd98?_0x22c9c8[_0x3b5d('0x1f')]:_0x372070[_0x3b5d('0x20')]+_0x372070['limit'];var _0x2edab7;if(_0x3e46c6>=_0x41e526){_0x3e46c6=_0x41e526;_0x2edab7=0xc8;}else{_0x2edab7=0xce;}_0x18f96c[_0x3b5d('0x1a')](_0x2edab7);return _0x18f96c['set'](_0x3b5d('0x21'),_0x2cb610+'-'+_0x3e46c6+'/'+_0x41e526)[_0x3b5d('0x1c')](_0x22c9c8);}return null;};}function patchUpdates(_0x52fedc){return function(_0x254d24){try{jsonpatch[_0x3b5d('0x22')](_0x254d24,_0x52fedc,!![]);}catch(_0x2f392d){return BPromise[_0x3b5d('0x23')](_0x2f392d);}return _0x254d24[_0x3b5d('0x24')]();};}function saveUpdates(_0xc7273c,_0x14f16f){return function(_0x3f5c0c){if(_0x3f5c0c){return _0x3f5c0c['update'](_0xc7273c)[_0x3b5d('0x25')](function(_0x452ecc){return _0x452ecc;});}return null;};}function removeEntity(_0x4aa388,_0x30bd50){return function(_0x3a0f92){if(_0x3a0f92){return _0x3a0f92[_0x3b5d('0x26')]()['then'](function(){var _0x2c13e7=_0x3a0f92[_0x3b5d('0x27')]({'plain':!![]});var _0x229040=_0x3b5d('0x28');return db[_0x3b5d('0x29')][_0x3b5d('0x26')]({'where':{'type':_0x229040,'resourceId':_0x2c13e7['id']}})[_0x3b5d('0x25')](function(){return _0x3a0f92;});})[_0x3b5d('0x25')](function(){_0x4aa388['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d0c0,_0x3bc6d8){return function(_0x5563a8){if(!_0x5563a8){_0x57d0c0[_0x3b5d('0x19')](0x194);}return _0x5563a8;};}function handleError(_0x508574,_0x1cde7f){_0x1cde7f=_0x1cde7f||0x1f4;return function(_0x1b4f63){logger['error'](_0x1b4f63[_0x3b5d('0x2a')]);if(_0x1b4f63[_0x3b5d('0x2b')]){delete _0x1b4f63['name'];}_0x508574['status'](_0x1cde7f)[_0x3b5d('0x2c')](_0x1b4f63);};}exports[_0x3b5d('0x2d')]=function(_0xe03a02,_0x38e2bc){var _0x1a35be={},_0xc92c0c={},_0x35c538={'count':0x0,'rows':[]};var _0x16a56c=_[_0x3b5d('0x2e')](db[_0x3b5d('0x2f')][_0x3b5d('0x30')],function(_0x15c0ca){return{'name':_0x15c0ca['fieldName'],'type':_0x15c0ca[_0x3b5d('0x31')]['key']};});_0xc92c0c[_0x3b5d('0x32')]=_['map'](_0x16a56c,_0x3b5d('0x2b'));_0xc92c0c[_0x3b5d('0x33')]=_[_0x3b5d('0x34')](_0xe03a02[_0x3b5d('0x33')]);_0xc92c0c[_0x3b5d('0x35')]=_[_0x3b5d('0x36')](_0xc92c0c['model'],_0xc92c0c[_0x3b5d('0x33')]);_0x1a35be[_0x3b5d('0x37')]=_['intersection'](_0xc92c0c[_0x3b5d('0x32')],qs[_0x3b5d('0x38')](_0xe03a02[_0x3b5d('0x33')][_0x3b5d('0x38')]));_0x1a35be[_0x3b5d('0x37')]=_0x1a35be[_0x3b5d('0x37')][_0x3b5d('0x39')]?_0x1a35be[_0x3b5d('0x37')]:_0xc92c0c[_0x3b5d('0x32')];if(!_0xe03a02['query'][_0x3b5d('0x3a')](_0x3b5d('0x3b'))){_0x1a35be[_0x3b5d('0x1d')]=qs[_0x3b5d('0x1d')](_0xe03a02[_0x3b5d('0x33')][_0x3b5d('0x1d')]);_0x1a35be[_0x3b5d('0x20')]=qs[_0x3b5d('0x20')](_0xe03a02['query']['offset']);}_0x1a35be['order']=qs[_0x3b5d('0x3c')](_0xe03a02['query'][_0x3b5d('0x3c')]);_0x1a35be[_0x3b5d('0x3d')]=qs[_0x3b5d('0x35')](_['pick'](_0xe03a02[_0x3b5d('0x33')],_0xc92c0c[_0x3b5d('0x35')]),_0x16a56c);if(_0xe03a02['query'][_0x3b5d('0x3e')]){_0x1a35be[_0x3b5d('0x3d')]=_['merge'](_0x1a35be[_0x3b5d('0x3d')],{'$or':_[_0x3b5d('0x2e')](_0x16a56c,function(_0x4c7f02){if(_0x4c7f02[_0x3b5d('0x31')]!==_0x3b5d('0x3f')){var _0xdb023e={};_0xdb023e[_0x4c7f02[_0x3b5d('0x2b')]]={'$like':'%'+_0xe03a02[_0x3b5d('0x33')]['filter']+'%'};return _0xdb023e;}})});}_0x1a35be=_[_0x3b5d('0x40')]({},_0x1a35be,_0xe03a02[_0x3b5d('0x41')]);var _0x41af9f={'where':_0x1a35be['where']};return db[_0x3b5d('0x2f')]['count'](_0x41af9f)[_0x3b5d('0x25')](function(_0x3feb8f){_0x35c538[_0x3b5d('0x1f')]=_0x3feb8f;if(_0xe03a02[_0x3b5d('0x33')][_0x3b5d('0x42')]){_0x1a35be[_0x3b5d('0x43')]=[{'all':!![]}];}return db[_0x3b5d('0x2f')]['findAll'](_0x1a35be);})[_0x3b5d('0x25')](function(_0x371a3b){_0x35c538[_0x3b5d('0x44')]=_0x371a3b;return _0x35c538;})[_0x3b5d('0x25')](respondWithFilteredResult(_0x38e2bc,_0x1a35be))[_0x3b5d('0x45')](handleError(_0x38e2bc,null));};exports[_0x3b5d('0x46')]=function(_0xc16ef8,_0x42505f){var _0xc98a7b={'raw':!![],'where':{'id':_0xc16ef8['params']['id']}},_0xca8137={};_0xca8137[_0x3b5d('0x32')]=_[_0x3b5d('0x34')](db[_0x3b5d('0x2f')][_0x3b5d('0x30')]);_0xca8137['query']=_[_0x3b5d('0x34')](_0xc16ef8[_0x3b5d('0x33')]);_0xca8137[_0x3b5d('0x35')]=_[_0x3b5d('0x36')](_0xca8137['model'],_0xca8137[_0x3b5d('0x33')]);_0xc98a7b['attributes']=_[_0x3b5d('0x36')](_0xca8137[_0x3b5d('0x32')],qs[_0x3b5d('0x38')](_0xc16ef8['query'][_0x3b5d('0x38')]));_0xc98a7b[_0x3b5d('0x37')]=_0xc98a7b[_0x3b5d('0x37')]['length']?_0xc98a7b[_0x3b5d('0x37')]:_0xca8137[_0x3b5d('0x32')];if(_0xc16ef8[_0x3b5d('0x33')][_0x3b5d('0x42')]){_0xc98a7b[_0x3b5d('0x43')]=[{'all':!![]}];}_0xc98a7b=_[_0x3b5d('0x40')]({},_0xc98a7b,_0xc16ef8[_0x3b5d('0x41')]);return db[_0x3b5d('0x2f')][_0x3b5d('0x47')](_0xc98a7b)[_0x3b5d('0x25')](handleEntityNotFound(_0x42505f,null))[_0x3b5d('0x25')](respondWithResult(_0x42505f,null))[_0x3b5d('0x45')](handleError(_0x42505f,null));};exports[_0x3b5d('0x48')]=function(_0x1774ce,_0xf3319){return db[_0x3b5d('0x2f')]['create'](_0x1774ce['body'],{})['then'](function(_0x517e32){var _0x34efe8=_0x1774ce[_0x3b5d('0x49')][_0x3b5d('0x27')]({'plain':!![]});if(!_0x34efe8)throw new Error(_0x3b5d('0x4a'));if(_0x34efe8['role']===_0x3b5d('0x49')){var _0x51e2f9=_0x517e32[_0x3b5d('0x27')]({'plain':!![]});var _0x356daa=_0x3b5d('0x28');return db['UserProfileSection'][_0x3b5d('0x47')]({'where':{'name':_0x356daa,'userProfileId':_0x34efe8[_0x3b5d('0x4b')]},'raw':!![]})[_0x3b5d('0x25')](function(_0x502d92){if(_0x502d92&&_0x502d92['autoAssociation']===0x0){return db[_0x3b5d('0x29')][_0x3b5d('0x48')]({'name':_0x51e2f9['name'],'resourceId':_0x51e2f9['id'],'type':_0x502d92['name'],'sectionId':_0x502d92['id']},{})['then'](function(){return _0x517e32;});}else{return _0x517e32;}})[_0x3b5d('0x45')](function(_0x39e64e){logger[_0x3b5d('0x4c')](_0x3b5d('0x4d'),_0x39e64e);throw _0x39e64e;});}return _0x517e32;})[_0x3b5d('0x25')](respondWithResult(_0xf3319,0xc9))['catch'](handleError(_0xf3319,null));};exports['update']=function(_0x5dabfd,_0x2f569d){if(_0x5dabfd[_0x3b5d('0x4e')]['id']){delete _0x5dabfd['body']['id'];}return db[_0x3b5d('0x2f')][_0x3b5d('0x47')]({'where':{'id':_0x5dabfd['params']['id']}})['then'](handleEntityNotFound(_0x2f569d,null))[_0x3b5d('0x25')](saveUpdates(_0x5dabfd['body'],null))[_0x3b5d('0x25')](respondWithResult(_0x2f569d,null))[_0x3b5d('0x45')](handleError(_0x2f569d,null));};exports[_0x3b5d('0x26')]=function(_0x55949f,_0x257e35){return db[_0x3b5d('0x2f')]['find']({'where':{'id':_0x55949f[_0x3b5d('0x4f')]['id']}})[_0x3b5d('0x25')](handleEntityNotFound(_0x257e35,null))[_0x3b5d('0x25')](removeEntity(_0x257e35,null))['catch'](handleError(_0x257e35,null));}; \ No newline at end of file +var _0x4c21=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','sendStatus','error','stack','name','index','map','Pause','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','params','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x4c21,0x9a));var _0x14c2=function(_0x68a0b0,_0x2bba91){_0x68a0b0=_0x68a0b0-0x0;var _0x4b4ee6=_0x4c21[_0x68a0b0];return _0x4b4ee6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x14c2('0x0'));var zipdir=require(_0x14c2('0x1'));var jsonpatch=require(_0x14c2('0x2'));var rp=require('request-promise');var moment=require(_0x14c2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x14c2('0x4'));var util=require('util');var path=require(_0x14c2('0x5'));var sox=require('sox');var csv=require(_0x14c2('0x6'));var ejs=require(_0x14c2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14c2('0x8'));var squel=require(_0x14c2('0x9'));var crypto=require(_0x14c2('0xa'));var jsforce=require(_0x14c2('0xb'));var deskjs=require(_0x14c2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x14c2('0xd'));var Papa=require(_0x14c2('0xe'));var Redis=require(_0x14c2('0xf'));var authService=require(_0x14c2('0x10'));var qs=require(_0x14c2('0x11'));var as=require(_0x14c2('0x12'));var hardwareService=require(_0x14c2('0x13'));var logger=require(_0x14c2('0x14'))(_0x14c2('0x15'));var utils=require(_0x14c2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31bdbb,_0x3fdfe1){_0x3fdfe1=_0x3fdfe1||0xcc;return function(_0x24dc41){if(_0x24dc41){return _0x31bdbb['sendStatus'](_0x3fdfe1);}return _0x31bdbb[_0x14c2('0x17')](_0x3fdfe1)[_0x14c2('0x18')]();};}function respondWithResult(_0x10bfdd,_0x55641f){_0x55641f=_0x55641f||0xc8;return function(_0x5c8179){if(_0x5c8179){return _0x10bfdd[_0x14c2('0x17')](_0x55641f)[_0x14c2('0x19')](_0x5c8179);}};}function respondWithFilteredResult(_0x266c41,_0x18f608){return function(_0x5843ea){if(_0x5843ea){var _0x1df7c7=typeof _0x18f608[_0x14c2('0x1a')]===_0x14c2('0x1b')&&typeof _0x18f608[_0x14c2('0x1c')]===_0x14c2('0x1b');var _0x17897a=_0x5843ea[_0x14c2('0x1d')];var _0xd1ac45=_0x1df7c7?0x0:_0x18f608[_0x14c2('0x1a')];var _0x103490=_0x1df7c7?_0x5843ea[_0x14c2('0x1d')]:_0x18f608[_0x14c2('0x1a')]+_0x18f608[_0x14c2('0x1c')];var _0x4701a6;if(_0x103490>=_0x17897a){_0x103490=_0x17897a;_0x4701a6=0xc8;}else{_0x4701a6=0xce;}_0x266c41[_0x14c2('0x17')](_0x4701a6);return _0x266c41[_0x14c2('0x1e')](_0x14c2('0x1f'),_0xd1ac45+'-'+_0x103490+'/'+_0x17897a)[_0x14c2('0x19')](_0x5843ea);}return null;};}function patchUpdates(_0x226ae1){return function(_0x2d6f4c){try{jsonpatch[_0x14c2('0x20')](_0x2d6f4c,_0x226ae1,!![]);}catch(_0x37b59e){return BPromise[_0x14c2('0x21')](_0x37b59e);}return _0x2d6f4c[_0x14c2('0x22')]();};}function saveUpdates(_0x2ad2cf,_0x980668){return function(_0x3aba1e){if(_0x3aba1e){return _0x3aba1e[_0x14c2('0x23')](_0x2ad2cf)['then'](function(_0x53e0cb){return _0x53e0cb;});}return null;};}function removeEntity(_0x10d3d3,_0x33b72a){return function(_0x4e2a71){if(_0x4e2a71){return _0x4e2a71[_0x14c2('0x24')]()['then'](function(){var _0x484813=_0x4e2a71[_0x14c2('0x25')]({'plain':!![]});var _0x3dc613='Pauses';return db[_0x14c2('0x26')][_0x14c2('0x24')]({'where':{'type':_0x3dc613,'resourceId':_0x484813['id']}})[_0x14c2('0x27')](function(){return _0x4e2a71;});})[_0x14c2('0x27')](function(){_0x10d3d3[_0x14c2('0x17')](0xcc)[_0x14c2('0x18')]();});}};}function handleEntityNotFound(_0x27f400,_0x3e7b19){return function(_0x51b2fe){if(!_0x51b2fe){_0x27f400[_0x14c2('0x28')](0x194);}return _0x51b2fe;};}function handleError(_0x3b8a42,_0x2fa971){_0x2fa971=_0x2fa971||0x1f4;return function(_0x4d04ff){logger[_0x14c2('0x29')](_0x4d04ff[_0x14c2('0x2a')]);if(_0x4d04ff[_0x14c2('0x2b')]){delete _0x4d04ff[_0x14c2('0x2b')];}_0x3b8a42['status'](_0x2fa971)['send'](_0x4d04ff);};}exports[_0x14c2('0x2c')]=function(_0x4705cf,_0x53c351){var _0x4e04d2={},_0x3e62c2={},_0x1badab={'count':0x0,'rows':[]};var _0x31d9b9=_[_0x14c2('0x2d')](db[_0x14c2('0x2e')][_0x14c2('0x2f')],function(_0x27107e){return{'name':_0x27107e[_0x14c2('0x30')],'type':_0x27107e[_0x14c2('0x31')][_0x14c2('0x32')]};});_0x3e62c2[_0x14c2('0x33')]=_['map'](_0x31d9b9,_0x14c2('0x2b'));_0x3e62c2['query']=_['keys'](_0x4705cf['query']);_0x3e62c2[_0x14c2('0x34')]=_[_0x14c2('0x35')](_0x3e62c2['model'],_0x3e62c2[_0x14c2('0x36')]);_0x4e04d2[_0x14c2('0x37')]=_[_0x14c2('0x35')](_0x3e62c2[_0x14c2('0x33')],qs[_0x14c2('0x38')](_0x4705cf[_0x14c2('0x36')][_0x14c2('0x38')]));_0x4e04d2[_0x14c2('0x37')]=_0x4e04d2[_0x14c2('0x37')]['length']?_0x4e04d2[_0x14c2('0x37')]:_0x3e62c2[_0x14c2('0x33')];if(!_0x4705cf['query'][_0x14c2('0x39')](_0x14c2('0x3a'))){_0x4e04d2['limit']=qs[_0x14c2('0x1c')](_0x4705cf[_0x14c2('0x36')]['limit']);_0x4e04d2[_0x14c2('0x1a')]=qs[_0x14c2('0x1a')](_0x4705cf['query'][_0x14c2('0x1a')]);}_0x4e04d2['order']=qs[_0x14c2('0x3b')](_0x4705cf[_0x14c2('0x36')][_0x14c2('0x3b')]);_0x4e04d2[_0x14c2('0x3c')]=qs[_0x14c2('0x34')](_['pick'](_0x4705cf['query'],_0x3e62c2[_0x14c2('0x34')]),_0x31d9b9);if(_0x4705cf[_0x14c2('0x36')][_0x14c2('0x3d')]){_0x4e04d2[_0x14c2('0x3c')]=_[_0x14c2('0x3e')](_0x4e04d2[_0x14c2('0x3c')],{'$or':_[_0x14c2('0x2d')](_0x31d9b9,function(_0x5c975e){if(_0x5c975e[_0x14c2('0x31')]!==_0x14c2('0x3f')){var _0x5b80eb={};_0x5b80eb[_0x5c975e[_0x14c2('0x2b')]]={'$like':'%'+_0x4705cf[_0x14c2('0x36')][_0x14c2('0x3d')]+'%'};return _0x5b80eb;}})});}_0x4e04d2=_[_0x14c2('0x3e')]({},_0x4e04d2,_0x4705cf[_0x14c2('0x40')]);var _0x25d25a={'where':_0x4e04d2[_0x14c2('0x3c')]};return db[_0x14c2('0x2e')][_0x14c2('0x1d')](_0x25d25a)[_0x14c2('0x27')](function(_0xbbdf9f){_0x1badab[_0x14c2('0x1d')]=_0xbbdf9f;if(_0x4705cf[_0x14c2('0x36')][_0x14c2('0x41')]){_0x4e04d2[_0x14c2('0x42')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x4e04d2);})[_0x14c2('0x27')](function(_0x2e00b7){_0x1badab['rows']=_0x2e00b7;return _0x1badab;})[_0x14c2('0x27')](respondWithFilteredResult(_0x53c351,_0x4e04d2))[_0x14c2('0x43')](handleError(_0x53c351,null));};exports[_0x14c2('0x44')]=function(_0x57b799,_0x11bdd2){var _0x394831={'raw':!![],'where':{'id':_0x57b799['params']['id']}},_0x93aa7={};_0x93aa7['model']=_[_0x14c2('0x45')](db[_0x14c2('0x2e')][_0x14c2('0x2f')]);_0x93aa7[_0x14c2('0x36')]=_[_0x14c2('0x45')](_0x57b799[_0x14c2('0x36')]);_0x93aa7[_0x14c2('0x34')]=_[_0x14c2('0x35')](_0x93aa7['model'],_0x93aa7['query']);_0x394831[_0x14c2('0x37')]=_[_0x14c2('0x35')](_0x93aa7[_0x14c2('0x33')],qs[_0x14c2('0x38')](_0x57b799[_0x14c2('0x36')][_0x14c2('0x38')]));_0x394831[_0x14c2('0x37')]=_0x394831['attributes'][_0x14c2('0x46')]?_0x394831[_0x14c2('0x37')]:_0x93aa7[_0x14c2('0x33')];if(_0x57b799[_0x14c2('0x36')][_0x14c2('0x41')]){_0x394831[_0x14c2('0x42')]=[{'all':!![]}];}_0x394831=_[_0x14c2('0x3e')]({},_0x394831,_0x57b799[_0x14c2('0x40')]);return db[_0x14c2('0x2e')][_0x14c2('0x47')](_0x394831)[_0x14c2('0x27')](handleEntityNotFound(_0x11bdd2,null))['then'](respondWithResult(_0x11bdd2,null))['catch'](handleError(_0x11bdd2,null));};exports[_0x14c2('0x48')]=function(_0x5d4d8d,_0x23470d){return db[_0x14c2('0x2e')]['create'](_0x5d4d8d[_0x14c2('0x49')],{})[_0x14c2('0x27')](function(_0x158c92){var _0x45c50b=_0x5d4d8d[_0x14c2('0x4a')][_0x14c2('0x25')]({'plain':!![]});if(!_0x45c50b)throw new Error(_0x14c2('0x4b'));if(_0x45c50b[_0x14c2('0x4c')]===_0x14c2('0x4a')){var _0x5b5a93=_0x158c92[_0x14c2('0x25')]({'plain':!![]});var _0x4db205=_0x14c2('0x4d');return db[_0x14c2('0x4e')][_0x14c2('0x47')]({'where':{'name':_0x4db205,'userProfileId':_0x45c50b[_0x14c2('0x4f')]},'raw':!![]})[_0x14c2('0x27')](function(_0x340044){if(_0x340044&&_0x340044[_0x14c2('0x50')]===0x0){return db[_0x14c2('0x26')][_0x14c2('0x48')]({'name':_0x5b5a93[_0x14c2('0x2b')],'resourceId':_0x5b5a93['id'],'type':_0x340044[_0x14c2('0x2b')],'sectionId':_0x340044['id']},{})[_0x14c2('0x27')](function(){return _0x158c92;});}else{return _0x158c92;}})[_0x14c2('0x43')](function(_0x1c4093){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c4093);throw _0x1c4093;});}return _0x158c92;})[_0x14c2('0x27')](respondWithResult(_0x23470d,0xc9))[_0x14c2('0x43')](handleError(_0x23470d,null));};exports[_0x14c2('0x23')]=function(_0x5e4987,_0x2d3159){if(_0x5e4987[_0x14c2('0x49')]['id']){delete _0x5e4987[_0x14c2('0x49')]['id'];}return db[_0x14c2('0x2e')][_0x14c2('0x47')]({'where':{'id':_0x5e4987[_0x14c2('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d3159,null))[_0x14c2('0x27')](saveUpdates(_0x5e4987['body'],null))[_0x14c2('0x27')](respondWithResult(_0x2d3159,null))['catch'](handleError(_0x2d3159,null));};exports[_0x14c2('0x24')]=function(_0x301edd,_0x54a1a0){return db['Pause'][_0x14c2('0x47')]({'where':{'id':_0x301edd[_0x14c2('0x51')]['id']}})[_0x14c2('0x27')](handleEntityNotFound(_0x54a1a0,null))['then'](removeEntity(_0x54a1a0,null))[_0x14c2('0x43')](handleError(_0x54a1a0,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ad17716..e301f35 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x1382a2,_0x13ff8e){var _0xadaf54=function(_0x1f541a){while(--_0x1f541a){_0x1382a2['push'](_0x1382a2['shift']());}};_0xadaf54(++_0x13ff8e);}(_0xf494,0x1c6));var _0x4f49=function(_0x208ca4,_0x4a028c){_0x208ca4=_0x208ca4-0x0;var _0x5b299f=_0xf494[_0x208ca4];return _0x5b299f;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x1239a7,_0x944a3e){var _0x318e98=function(_0x3215d2){while(--_0x3215d2){_0x1239a7['push'](_0x1239a7['shift']());}};_0x318e98(++_0x944a3e);}(_0x814b,0x1a2));var _0xb814=function(_0x262323,_0x4a81f1){_0x262323=_0x262323-0x0;var _0xa963c3=_0x814b[_0x262323];return _0xa963c3;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 58b4469..95ddfac 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(_0x117c6c,_0x4a1ef0){var _0xfddfd8=function(_0x31d0c1){while(--_0x31d0c1){_0x117c6c['push'](_0x117c6c['shift']());}};_0xfddfd8(++_0x4a1ef0);}(_0x7a54,0x106));var _0x47a5=function(_0x5a19f1,_0x332e5a){_0x5a19f1=_0x5a19f1-0x0;var _0x35e17a=_0x7a54[_0x5a19f1];return _0x35e17a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5205af,_0x1f88a4){var _0x1265df=function(_0x56733c){while(--_0x56733c){_0x5205af['push'](_0x5205af['shift']());}};_0x1265df(++_0x1f88a4);}(_0xb10b,0x12a));var _0xbb10=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0xb10b[_0x27c25f];return _0x2da4c4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index f39db0a..74c255d 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 _0xd6d6=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','put','update','exports','multer','util'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x35611a,_0x3293ab){_0x35611a=_0x35611a-0x0;var _0xeb0854=_0xd6d6[_0x35611a];return _0xeb0854;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),controller[_0x6d6d('0xd')]);router[_0x6d6d('0xa')](_0x6d6d('0xe'),auth[_0x6d6d('0xf')](),controller['show']);router['get'](_0x6d6d('0x10'),auth[_0x6d6d('0xf')](),controller[_0x6d6d('0x11')]);var upload=multer({'storage':multer[_0x6d6d('0x12')]({'destination':function(_0xf84314,_0x576c88,_0x1f2b86){_0x1f2b86(null,path[_0x6d6d('0x13')](config['root'],'server/files/plugins'));},'filename':function(_0x176618,_0x32146d,_0xe61c36){_0x32146d[_0x6d6d('0x14')]=_0x32146d[_0x6d6d('0x14')][_0x6d6d('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe61c36(null,util[_0x6d6d('0x16')](_0x6d6d('0x17'),path['basename'](_0x32146d[_0x6d6d('0x14')],path[_0x6d6d('0x18')](_0x32146d[_0x6d6d('0x14')])),Date[_0x6d6d('0x19')](),path[_0x6d6d('0x18')](_0x32146d['originalname'])));}})});router[_0x6d6d('0x1a')]('/',upload['single'](_0x6d6d('0x1b')),controller[_0x6d6d('0x1c')]);router[_0x6d6d('0x1a')]('/webhook',controller['webhookPost']);router[_0x6d6d('0x1d')](_0x6d6d('0xe'),auth[_0x6d6d('0xf')](),controller[_0x6d6d('0x1e')]);router['delete']('/:id',auth[_0x6d6d('0xf')](),controller['delete']);module[_0x6d6d('0x1f')]=router; \ No newline at end of file +var _0xbec5=['get','index','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','upload','webhookPost','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x41ebe2,_0x4c7ab9){var _0x2fc8dc=function(_0x44424c){while(--_0x44424c){_0x41ebe2['push'](_0x41ebe2['shift']());}};_0x2fc8dc(++_0x4c7ab9);}(_0xbec5,0xe5));var _0x5bec=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0xbec5[_0x27bcf5];return _0x4ce4cf;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),controller[_0x5bec('0xc')]);router[_0x5bec('0x9')](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0xf')]);router['get'](_0x5bec('0x10'),auth['isAuthenticated'](),controller[_0x5bec('0x11')]);var upload=multer({'storage':multer[_0x5bec('0x12')]({'destination':function(_0x117162,_0x4a5482,_0x288d1b){_0x288d1b(null,path[_0x5bec('0x13')](config[_0x5bec('0x14')],'server/files/plugins'));},'filename':function(_0x6bee21,_0x1c888f,_0x589d14){_0x1c888f[_0x5bec('0x15')]=_0x1c888f[_0x5bec('0x15')][_0x5bec('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x589d14(null,util[_0x5bec('0x17')](_0x5bec('0x18'),path[_0x5bec('0x19')](_0x1c888f[_0x5bec('0x15')],path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])),Date[_0x5bec('0x1b')](),path[_0x5bec('0x1a')](_0x1c888f[_0x5bec('0x15')])));}})});router[_0x5bec('0x1c')]('/',upload['single']('file'),controller[_0x5bec('0x1d')]);router[_0x5bec('0x1c')](_0x5bec('0xb'),controller[_0x5bec('0x1e')]);router['put']('/:id',auth[_0x5bec('0xe')](),controller[_0x5bec('0x1f')]);router['delete'](_0x5bec('0xd'),auth[_0x5bec('0xe')](),controller[_0x5bec('0x20')]);module[_0x5bec('0x21')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 31289b5..3a961df 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 _0xdaf9=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','never','always'];(function(_0x312e53,_0x7cc669){var _0x38ebd6=function(_0x1cf427){while(--_0x1cf427){_0x312e53['push'](_0x312e53['shift']());}};_0x38ebd6(++_0x7cc669);}(_0xdaf9,0xe5));var _0x9daf=function(_0x4a87a6,_0x52539b){_0x4a87a6=_0x4a87a6-0x0;var _0x735efb=_0xdaf9[_0x4a87a6];return _0x735efb;};'use strict';var Sequelize=require(_0x9daf('0x0'));module[_0x9daf('0x1')]={'name':{'type':Sequelize[_0x9daf('0x2')]},'type':{'type':Sequelize['ENUM'](_0x9daf('0x3'),'script')},'description':{'type':Sequelize[_0x9daf('0x4')]},'version':{'type':Sequelize[_0x9daf('0x4')]},'path':{'type':Sequelize[_0x9daf('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x9daf('0x5')],'defaultValue':0x0,'comment':_0x9daf('0x6')},'sidebar':{'type':Sequelize[_0x9daf('0x7')](_0x9daf('0x8'),'agentOnly','always',_0x9daf('0x9')),'defaultValue':_0x9daf('0xa'),'comment':_0x9daf('0xb')},'icon':{'type':Sequelize[_0x9daf('0x2')]},'adminUrl':{'type':Sequelize[_0x9daf('0x2')]},'agentUrl':{'type':Sequelize[_0x9daf('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x9daf('0x2')]}}; \ No newline at end of file +var _0x1a64=['ENUM','html','script','TEXT','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x181728,_0x471cc4){var _0x3525db=function(_0x59c05c){while(--_0x59c05c){_0x181728['push'](_0x181728['shift']());}};_0x3525db(++_0x471cc4);}(_0x1a64,0x1d6));var _0x41a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a64[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x41a6('0x0'));module[_0x41a6('0x1')]={'name':{'type':Sequelize[_0x41a6('0x2')]},'type':{'type':Sequelize[_0x41a6('0x3')](_0x41a6('0x4'),_0x41a6('0x5'))},'description':{'type':Sequelize[_0x41a6('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0x41a6('0x7'),_0x41a6('0x8'),_0x41a6('0x9'),'never'),'defaultValue':_0x41a6('0x9'),'comment':_0x41a6('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x41a6('0x2')]},'agentUrl':{'type':Sequelize[_0x41a6('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index fca6e51..8f9859e 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 _0x187b=['Content-Range','apply','reject','save','update','then','destroy','get','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','keys','includeAll','catch','download','find','join','server/files/plugins','format','%s.zip','basename','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','UserProfileResource','Zip\x20archive\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified','method','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x187b,0x79));var _0xb187=function(_0x446ceb,_0x54aa4a){_0x446ceb=_0x446ceb-0x0;var _0x5d181d=_0x187b[_0x446ceb];return _0x5d181d;};'use strict';var emlformat=require(_0xb187('0x0'));var rimraf=require(_0xb187('0x1'));var zipdir=require(_0xb187('0x2'));var jsonpatch=require(_0xb187('0x3'));var rp=require(_0xb187('0x4'));var moment=require(_0xb187('0x5'));var BPromise=require(_0xb187('0x6'));var Mustache=require(_0xb187('0x7'));var util=require(_0xb187('0x8'));var path=require(_0xb187('0x9'));var sox=require(_0xb187('0xa'));var csv=require(_0xb187('0xb'));var ejs=require(_0xb187('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb187('0xd'));var squel=require(_0xb187('0xe'));var crypto=require('crypto');var jsforce=require(_0xb187('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb187('0xb'));var querystring=require(_0xb187('0x10'));var Papa=require(_0xb187('0x11'));var extract=require(_0xb187('0x12'));var rimraf=require('rimraf');var archiver=require(_0xb187('0x13'));var Redis=require(_0xb187('0x14'));var authService=require(_0xb187('0x15'));var qs=require(_0xb187('0x16'));var as=require(_0xb187('0x17'));var hardwareService=require(_0xb187('0x18'));var logger=require(_0xb187('0x19'))(_0xb187('0x1a'));var utils=require(_0xb187('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xb187('0x1c'));var db=require(_0xb187('0x1d'))['db'];config[_0xb187('0x1e')]=_['defaults'](config[_0xb187('0x1e')],{'host':_0xb187('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb187('0x1e')]));require(_0xb187('0x20'))[_0xb187('0x21')](socket);function respondWithStatusCode(_0x545559,_0x5ae5f5){_0x5ae5f5=_0x5ae5f5||0xcc;return function(_0x4152b4){if(_0x4152b4){return _0x545559[_0xb187('0x22')](_0x5ae5f5);}return _0x545559[_0xb187('0x23')](_0x5ae5f5)[_0xb187('0x24')]();};}function respondWithResult(_0x41eced,_0x1119cc){_0x1119cc=_0x1119cc||0xc8;return function(_0x10b44d){if(_0x10b44d){return _0x41eced[_0xb187('0x23')](_0x1119cc)[_0xb187('0x25')](_0x10b44d);}};}function respondWithFilteredResult(_0xc3eacf,_0x3de0d6){return function(_0x39fcaa){if(_0x39fcaa){var _0x2d263a=typeof _0x3de0d6['offset']===_0xb187('0x26')&&typeof _0x3de0d6[_0xb187('0x27')]===_0xb187('0x26');var _0x3ba637=_0x39fcaa[_0xb187('0x28')];var _0xc7c16c=_0x2d263a?0x0:_0x3de0d6[_0xb187('0x29')];var _0x2bc9f6=_0x2d263a?_0x39fcaa[_0xb187('0x28')]:_0x3de0d6['offset']+_0x3de0d6[_0xb187('0x27')];var _0x1f05c9;if(_0x2bc9f6>=_0x3ba637){_0x2bc9f6=_0x3ba637;_0x1f05c9=0xc8;}else{_0x1f05c9=0xce;}_0xc3eacf[_0xb187('0x23')](_0x1f05c9);return _0xc3eacf[_0xb187('0x2a')](_0xb187('0x2b'),_0xc7c16c+'-'+_0x2bc9f6+'/'+_0x3ba637)[_0xb187('0x25')](_0x39fcaa);}return null;};}function patchUpdates(_0x47316e){return function(_0x21a136){try{jsonpatch[_0xb187('0x2c')](_0x21a136,_0x47316e,!![]);}catch(_0x3c771d){return BPromise[_0xb187('0x2d')](_0x3c771d);}return _0x21a136[_0xb187('0x2e')]();};}function saveUpdates(_0x367fb5,_0x1af969){return function(_0x4b20eb){if(_0x4b20eb){return _0x4b20eb[_0xb187('0x2f')](_0x367fb5)[_0xb187('0x30')](function(_0x3931cc){return _0x3931cc;});}return null;};}function removeEntity(_0x49df0f,_0xf06baa){return function(_0x52d957){if(_0x52d957){return _0x52d957[_0xb187('0x31')]()[_0xb187('0x30')](function(){var _0x32d2ef=_0x52d957[_0xb187('0x32')]({'plain':!![]});var _0x18e700='Plugins';return db['UserProfileResource'][_0xb187('0x31')]({'where':{'type':_0x18e700,'resourceId':_0x32d2ef['id']}})[_0xb187('0x30')](function(){return _0x52d957;});})[_0xb187('0x30')](function(){_0x49df0f[_0xb187('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45689c,_0x139a70){return function(_0x1c76c4){if(!_0x1c76c4){_0x45689c[_0xb187('0x22')](0x194);}return _0x1c76c4;};}function handleError(_0x32070d,_0x2c30bd){_0x2c30bd=_0x2c30bd||0x1f4;return function(_0x40ec9a){logger[_0xb187('0x33')](_0x40ec9a['stack']);if(_0x40ec9a['name']){delete _0x40ec9a[_0xb187('0x34')];}_0x32070d[_0xb187('0x23')](_0x2c30bd)[_0xb187('0x35')](_0x40ec9a);};}exports[_0xb187('0x36')]=function(_0x37639c,_0x2cc9e4){var _0x46f9f8={},_0xc6c2a4={},_0x114538={'count':0x0,'rows':[]};var _0x486585=_[_0xb187('0x37')](db[_0xb187('0x38')][_0xb187('0x39')],function(_0x44e5b7){return{'name':_0x44e5b7[_0xb187('0x3a')],'type':_0x44e5b7[_0xb187('0x3b')][_0xb187('0x3c')]};});_0xc6c2a4[_0xb187('0x3d')]=_[_0xb187('0x37')](_0x486585,'name');_0xc6c2a4[_0xb187('0x3e')]=_['keys'](_0x37639c[_0xb187('0x3e')]);_0xc6c2a4[_0xb187('0x3f')]=_[_0xb187('0x40')](_0xc6c2a4['model'],_0xc6c2a4['query']);_0x46f9f8[_0xb187('0x41')]=_[_0xb187('0x40')](_0xc6c2a4['model'],qs['fields'](_0x37639c[_0xb187('0x3e')][_0xb187('0x42')]));_0x46f9f8[_0xb187('0x41')]=_0x46f9f8[_0xb187('0x41')][_0xb187('0x43')]?_0x46f9f8['attributes']:_0xc6c2a4[_0xb187('0x3d')];if(!_0x37639c['query']['hasOwnProperty']('nolimit')){_0x46f9f8[_0xb187('0x27')]=qs[_0xb187('0x27')](_0x37639c[_0xb187('0x3e')][_0xb187('0x27')]);_0x46f9f8['offset']=qs['offset'](_0x37639c[_0xb187('0x3e')][_0xb187('0x29')]);}_0x46f9f8[_0xb187('0x44')]=qs['sort'](_0x37639c[_0xb187('0x3e')]['sort']);_0x46f9f8['where']=qs[_0xb187('0x3f')](_[_0xb187('0x45')](_0x37639c[_0xb187('0x3e')],_0xc6c2a4['filters']),_0x486585);if(_0x37639c[_0xb187('0x3e')][_0xb187('0x46')]){_0x46f9f8[_0xb187('0x47')]=_[_0xb187('0x48')](_0x46f9f8[_0xb187('0x47')],{'$or':_[_0xb187('0x37')](_0x486585,function(_0x598b24){if(_0x598b24['type']!==_0xb187('0x49')){var _0x4fbbb7={};_0x4fbbb7[_0x598b24[_0xb187('0x34')]]={'$like':'%'+_0x37639c[_0xb187('0x3e')]['filter']+'%'};return _0x4fbbb7;}})});}_0x46f9f8=_['merge']({},_0x46f9f8,_0x37639c[_0xb187('0x4a')]);var _0x3c89a3={'where':_0x46f9f8[_0xb187('0x47')]};return db[_0xb187('0x38')][_0xb187('0x28')](_0x3c89a3)['then'](function(_0x1f233a){_0x114538['count']=_0x1f233a;if(_0x37639c[_0xb187('0x3e')]['includeAll']){_0x46f9f8[_0xb187('0x4b')]=[{'all':!![]}];}return db['Plugin'][_0xb187('0x4c')](_0x46f9f8);})['then'](function(_0x536df9){_0x114538['rows']=_0x536df9;return _0x114538;})[_0xb187('0x30')](respondWithFilteredResult(_0x2cc9e4,_0x46f9f8))['catch'](handleError(_0x2cc9e4,null));};exports[_0xb187('0x4d')]=function(_0x3c9c1d,_0x5a81f3){var _0x2dc042={'raw':!![],'where':{'id':_0x3c9c1d[_0xb187('0x4e')]['id']}},_0x128b06={};_0x128b06[_0xb187('0x3d')]=_[_0xb187('0x4f')](db[_0xb187('0x38')][_0xb187('0x39')]);_0x128b06['query']=_[_0xb187('0x4f')](_0x3c9c1d[_0xb187('0x3e')]);_0x128b06[_0xb187('0x3f')]=_[_0xb187('0x40')](_0x128b06[_0xb187('0x3d')],_0x128b06['query']);_0x2dc042[_0xb187('0x41')]=_[_0xb187('0x40')](_0x128b06[_0xb187('0x3d')],qs[_0xb187('0x42')](_0x3c9c1d[_0xb187('0x3e')][_0xb187('0x42')]));_0x2dc042[_0xb187('0x41')]=_0x2dc042[_0xb187('0x41')]['length']?_0x2dc042[_0xb187('0x41')]:_0x128b06['model'];if(_0x3c9c1d['query'][_0xb187('0x50')]){_0x2dc042[_0xb187('0x4b')]=[{'all':!![]}];}_0x2dc042=_[_0xb187('0x48')]({},_0x2dc042,_0x3c9c1d[_0xb187('0x4a')]);return db[_0xb187('0x38')]['find'](_0x2dc042)['then'](handleEntityNotFound(_0x5a81f3,null))[_0xb187('0x30')](respondWithResult(_0x5a81f3,null))[_0xb187('0x51')](handleError(_0x5a81f3,null));};exports[_0xb187('0x52')]=function(_0x480154,_0x1064d6,_0x3a0a9f){return db['Plugin'][_0xb187('0x53')]({'where':{'id':_0x480154[_0xb187('0x4e')]['id']},'attributes':[_0xb187('0x34'),'path'],'raw':!![]})[_0xb187('0x30')](handleEntityNotFound(_0x1064d6,null))[_0xb187('0x30')](function(_0x1f5d51){if(_0x1f5d51){var _0x5dac49=path[_0xb187('0x54')](config['root'],_0xb187('0x55'),util[_0xb187('0x56')](_0xb187('0x57'),path[_0xb187('0x58')](_0x1f5d51[_0xb187('0x9')])));var _0x1e6b48=fs['createWriteStream'](_0x5dac49);var _0x4824a1=archiver('zip',{'zlib':{'level':0x9}});_0x4824a1['on'](_0xb187('0x59'),function(_0x4c3b0d){if(_0x4c3b0d['code']===_0xb187('0x5a')){logger[_0xb187('0x33')](_0x4c3b0d);}else{throw new db[(_0xb187('0x5b'))][(_0xb187('0x5c'))](_0xb187('0x5d'));}});_0x4824a1['on'](_0xb187('0x33'),function(_0x244f9c){throw new db[(_0xb187('0x5b'))][(_0xb187('0x5c'))](_0xb187('0x5d'));});_0x4824a1[_0xb187('0x5e')](_0x1e6b48);_0x4824a1['glob'](_0xb187('0x5f'),{'cwd':path[_0xb187('0x54')](config[_0xb187('0x60')],_0xb187('0x55'),path['dirname'](_0x1f5d51['path'])),'ignore':[path['join'](path[_0xb187('0x58')](_0x1f5d51['path']),_0xb187('0x61')),path[_0xb187('0x54')](path[_0xb187('0x58')](_0x1f5d51['path']),_0xb187('0x62'))],'nodir':!![]})[_0xb187('0x63')]();_0x1e6b48['on'](_0xb187('0x64'),function(){if(!fs['existsSync'](_0x5dac49)){throw new db[(_0xb187('0x5b'))][(_0xb187('0x5c'))](_0xb187('0x65'));}return _0x1064d6[_0xb187('0x52')](_0x5dac49,util['format']('%s.zip',path[_0xb187('0x58')](_0x1f5d51[_0xb187('0x9')])),function(_0x3097fe){if(_0x3097fe){throw new db['Sequelize'][(_0xb187('0x5c'))](_0xb187('0x66'));}fs[_0xb187('0x67')](_0x5dac49);logger[_0xb187('0x68')](_0xb187('0x69'));logger[_0xb187('0x68')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x1064d6,null));};exports[_0xb187('0x6a')]=function(_0x372717,_0x21d06b,_0x6ac5fb){var _0x3e1d4f=path[_0xb187('0x58')](_0x372717[_0xb187('0x6b')][_0xb187('0x6c')],path[_0xb187('0x6d')](_0x372717[_0xb187('0x6b')]['filename']));var _0x4e9404=path[_0xb187('0x54')](config[_0xb187('0x60')],_0xb187('0x55'),_0x372717['file'][_0xb187('0x6c')]);var _0x9ce6b3=path['join'](config[_0xb187('0x60')],'server/files/plugins',_0x3e1d4f);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x4e9404);logger[_0xb187('0x68')](_0xb187('0x6e'),_0x9ce6b3);try{fs['chmodSync'](_0x4e9404,parseInt('0777',0x8));extract(_0x4e9404,{'dir':_0x9ce6b3},function(_0x434b5a){if(_0x434b5a){logger[_0xb187('0x33')](_0x434b5a);handleError(_0x434b5a,!![]);};var _0x2e05a0=fs[_0xb187('0x6f')](_0x9ce6b3);if(_0x2e05a0[_0xb187('0x43')]>0x1){removeReferences(_0x4e9404,_0x9ce6b3);logger[_0xb187('0x33')]('Invalid\x20plugin\x20structure');return _0x6ac5fb(new Error(_0xb187('0x70')));}var _0x5e2394=fs['lstatSync'](path['join'](_0x9ce6b3,_0x2e05a0[0x0]));if(_0x5e2394['isFile']()){removeReferences(_0x4e9404,_0x9ce6b3);logger[_0xb187('0x33')](_0xb187('0x70'));return _0x6ac5fb(new Error(_0xb187('0x70')));}if(_0x5e2394[_0xb187('0x71')]()){var _0x58b7f7=fs[_0xb187('0x6f')](path[_0xb187('0x54')](_0x9ce6b3,_0x2e05a0[0x0]));if(_0x58b7f7[_0xb187('0x43')]===0x0){removeReferences(_0x4e9404,_0x9ce6b3);logger[_0xb187('0x33')](_0xb187('0x70'));return _0x6ac5fb(new Error(_0xb187('0x70')));}var _0x2cc00a=_0x58b7f7['some'](function(_0x4a9569){return _0x4a9569===_0xb187('0x72');});if(!_0x2cc00a){return _0x6ac5fb(new Error(_0xb187('0x73')));}var _0x1344e4=fs[_0xb187('0x74')](path[_0xb187('0x54')](_0x9ce6b3,_0x2e05a0[0x0],_0xb187('0x72')));var _0x163d55=JSON['parse'](_0x1344e4);if(_0xb187('0x26')==typeof _0x163d55['name']){return _0x6ac5fb(new Error(_0xb187('0x75')));}if(_0xb187('0x26')==typeof _0x163d55[_0xb187('0x3b')]){return _0x6ac5fb(new Error(_0xb187('0x76')));}if(_0xb187('0x26')==typeof _0x163d55['version']){return _0x6ac5fb(new Error(_0xb187('0x77')));}if(_0xb187('0x26')==typeof _0x163d55[_0xb187('0x78')]){return _0x6ac5fb(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x163d55[_0xb187('0x3b')]==='html'){if('undefined'==typeof _0x163d55[_0xb187('0x78')][_0xb187('0x79')]){return _0x6ac5fb(new Error(_0xb187('0x7a')));}if('undefined'==typeof _0x163d55[_0xb187('0x78')][_0xb187('0x79')][_0xb187('0x7b')]&&_0xb187('0x26')==typeof _0x163d55[_0xb187('0x78')]['views']['agent']){return _0x6ac5fb(new Error(_0xb187('0x7c')));}}else if(_0x163d55['type']==='script'){if('undefined'==typeof _0x163d55[_0xb187('0x78')][_0xb187('0x7d')]){return _0x6ac5fb(new Error(_0xb187('0x7e')));}if(_0xb187('0x26')==typeof _0x163d55[_0xb187('0x78')][_0xb187('0x7f')]){return _0x6ac5fb(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x6ac5fb(new Error(_0xb187('0x80')));}var _0x2904e2=_0x163d55[_0xb187('0x34')];var _0xf049a=_0x163d55['description'];var _0x4a250b=_0x163d55[_0xb187('0x3b')];var _0x4ef9f2=_0x163d55[_0xb187('0x81')]?_0x163d55[_0xb187('0x81')]:_0xb187('0x82');var _0x4f3aa2=_0x163d55[_0xb187('0x83')]?_0x163d55['icon']:_0xb187('0x84');var _0x4f2fc2='';var _0xc8e59c='';var _0x55ca40='';var _0x5303af='';var _0x38a305=_0x163d55['version'];if(_0x4a250b==='html'){if('undefined'!=typeof _0x163d55[_0xb187('0x78')][_0xb187('0x79')][_0xb187('0x7b')]){var _0x248b89=_0x163d55['parameters'][_0xb187('0x79')][_0xb187('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xb187('0x85')](_0x248b89)){_0x4f2fc2=path[_0xb187('0x54')](_0xb187('0x86'),_0x3e1d4f,_0x2e05a0[0x0],_0x248b89);}else{_0x4f2fc2=_0x248b89;}}else{logger[_0xb187('0x68')](_0xb187('0x87'));}if('undefined'!=typeof _0x163d55[_0xb187('0x78')][_0xb187('0x79')][_0xb187('0x88')]){var _0x360669=_0x163d55[_0xb187('0x78')]['views'][_0xb187('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xb187('0x85')](_0x360669)){_0xc8e59c=path[_0xb187('0x54')]('plugins',_0x3e1d4f,_0x2e05a0[0x0],_0x360669);}else{_0xc8e59c=_0x360669;}}else{logger[_0xb187('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x4a250b==='script'){_0x55ca40=_0x163d55['parameters']['scriptName'];_0x5303af=_0x163d55[_0xb187('0x78')]['scriptPath'];if(_0xb187('0x26')!=typeof _0x163d55[_0xb187('0x78')]['views']){if(_0xb187('0x26')!=typeof _0x163d55[_0xb187('0x78')][_0xb187('0x79')][_0xb187('0x7b')]){var _0x248b89=_0x163d55['parameters'][_0xb187('0x79')][_0xb187('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x248b89)){_0x4f2fc2=path[_0xb187('0x54')]('plugins',_0x3e1d4f,_0x2e05a0[0x0],_0x248b89);}else{_0x4f2fc2=_0x248b89;}}if('undefined'!=typeof _0x163d55[_0xb187('0x78')][_0xb187('0x79')][_0xb187('0x88')]){var _0x360669=_0x163d55[_0xb187('0x78')][_0xb187('0x79')][_0xb187('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xb187('0x85')](_0x360669)){_0xc8e59c=path[_0xb187('0x54')](_0xb187('0x86'),_0x3e1d4f,_0x2e05a0[0x0],_0x360669);}else{_0xc8e59c=_0x360669;}}}}var _0xe86c55={'name':_0x2904e2,'description':_0xf049a,'path':path[_0xb187('0x54')](_0x3e1d4f,_0x2e05a0[0x0]),'type':_0x4a250b,'sidebar':_0x4ef9f2,'icon':_0x4f3aa2,'adminUrl':_0x4f2fc2,'agentUrl':_0xc8e59c,'scriptName':_0x55ca40,'scriptPath':_0x5303af,'version':_0x38a305};removeReferences(_0x4e9404,null);return db[_0xb187('0x38')][_0xb187('0x89')](_0xe86c55)[_0xb187('0x30')](function(_0x20bec1){var _0x553f16={'role':_0x372717[_0xb187('0x8a')][_0xb187('0x8b')],'userProfileId':_0x372717[_0xb187('0x8a')][_0xb187('0x8c')]};if(!_0x553f16)throw new Error(_0xb187('0x8d'));if(_0x553f16[_0xb187('0x8b')]===_0xb187('0x8e')){var _0x3b5e56=_0x20bec1['get']({'plain':!![]});return db[_0xb187('0x8f')][_0xb187('0x53')]({'where':{'name':_0xb187('0x90'),'userProfileId':_0x553f16[_0xb187('0x8c')]},'raw':!![]})['then'](function(_0x303f28){if(_0x303f28&&_0x303f28['autoAssociation']===0x0){return db[_0xb187('0x91')][_0xb187('0x89')]({'name':_0x3b5e56['name'],'resourceId':_0x3b5e56['id'],'type':_0x303f28[_0xb187('0x34')],'sectionId':_0x303f28['id']},{})[_0xb187('0x30')](function(){return _0x20bec1;});}else{return _0x20bec1;}})[_0xb187('0x51')](function(_0x5d1c1d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d1c1d);throw _0x5d1c1d;});}return _0x20bec1;})[_0xb187('0x30')](respondWithResult(_0x21d06b,null))[_0xb187('0x51')](handleError(_0x21d06b,null));}});}catch(_0x3676e1){_0x21d06b[_0xb187('0x23')](0x1f4)[_0xb187('0x35')](_0x3676e1);}};function removeReferences(_0xdc2abc,_0x226414){try{if(_0xdc2abc){fs[_0xb187('0x67')](_0xdc2abc);logger[_0xb187('0x68')](_0xb187('0x92'));}if(_0x226414){rimraf(_0x226414,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x26756e){logger[_0xb187('0x33')](_0x26756e);}}exports[_0xb187('0x2f')]=function(_0x275456,_0x2db85b,_0x25d9e2){return db[_0xb187('0x38')][_0xb187('0x53')]({'where':{'id':_0x275456['params']['id']}})['then'](handleEntityNotFound(_0x2db85b,null))[_0xb187('0x30')](saveUpdates(_0x275456[_0xb187('0x8a')],null))[_0xb187('0x30')](respondWithResult(_0x2db85b,null))[_0xb187('0x51')](handleError(_0x2db85b,null));};exports[_0xb187('0x93')]=function(_0x509191,_0x5d8ab9,_0x28e6b0){return db[_0xb187('0x38')][_0xb187('0x53')]({'where':{'id':_0x509191['params']['id']}})[_0xb187('0x30')](function(_0x14543a){if(_0x14543a){return _0x14543a['destroy']();}})[_0xb187('0x30')](function(_0x202751){rimraf(path['join'](config['root'],_0xb187('0x55'),path[_0xb187('0x94')](_0x202751[_0xb187('0x9')])),function(){});return _0x202751;})['then'](handleEntityNotFound(_0x5d8ab9,null))[_0xb187('0x30')](respondWithStatusCode(_0x5d8ab9,null))[_0xb187('0x51')](handleError(_0x5d8ab9,null));};exports[_0xb187('0x95')]=function(_0x5ab61f,_0x207d5a,_0x3845e6){return BPromise[_0xb187('0x96')]()[_0xb187('0x30')](function(){if(!_0x5ab61f['query'][_0xb187('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5ab61f[_0xb187('0x3e')][_0xb187('0x97')]){throw new Error(_0xb187('0x98'));}var _0x315cc8=_0x5ab61f[_0xb187('0x3e')][_0xb187('0x99')]?_0x5ab61f[_0xb187('0x3e')][_0xb187('0x99')]+':'+_0x5ab61f[_0xb187('0x3e')][_0xb187('0x97')]:_0xb187('0x9a')+_0x5ab61f[_0xb187('0x3e')]['port'];var _0x48cd34=_0x5ab61f[_0xb187('0x3e')][_0xb187('0x25')]?_0x5ab61f['query'][_0xb187('0x25')]:!![];var _0x43dddd=_0x5ab61f[_0xb187('0x3e')][_0xb187('0x9b')]?_0x5ab61f[_0xb187('0x3e')]['encoding']:null;var _0x206154={'method':_0x5ab61f['method'],'uri':util['format'](_0xb187('0x9c'),_0x315cc8,_0x5ab61f['query']['path']),'json':_0x48cd34,'resolveWithFullResponse':!![],'encoding':_0x43dddd,'qs':_0x5ab61f['query']};if(_0x5ab61f[_0xb187('0x9d')]){_0x206154[_0xb187('0x9d')]=_0x5ab61f['headers'];if(_0x206154['headers'][_0xb187('0x9e')]){delete _0x206154['headers']['content-length'];}}if(_0x206154[_0xb187('0x9d')][_0xb187('0x9f')]){delete _0x206154[_0xb187('0x9d')]['content-type'];}return rp(_0x206154);})[_0xb187('0x30')](function(_0x4aeec5){if(_0x4aeec5){_0x207d5a[_0xb187('0x2a')](_0x4aeec5[_0xb187('0x9d')]);logger[_0xb187('0x68')](_0x4aeec5[_0xb187('0x8a')]);if(_[_0xb187('0xa0')](_0x5ab61f[_0xb187('0x3e')][_0xb187('0x9')],_0xb187('0x52'))&&_0x4aeec5[_0xb187('0xa1')]==0x1f4){return _0x207d5a['sendStatus'](_0x4aeec5[_0xb187('0xa1')]);}else{return _0x207d5a[_0xb187('0x23')](_0x4aeec5['statusCode'])[_0xb187('0x35')](_0x4aeec5[_0xb187('0x8a')]);}}else{return _0x207d5a[_0xb187('0x22')](0xc8);}})[_0xb187('0x51')](handleError(_0x207d5a,null));};exports['webhookPost']=function(_0x1770fa,_0x3b8d50,_0x5d6cd5){return BPromise[_0xb187('0x96')]()['then'](function(){if(!_0x1770fa[_0xb187('0x3e')][_0xb187('0x9')]){throw new Error(_0xb187('0xa2'));}if(!_0x1770fa['query'][_0xb187('0x97')]){throw new Error(_0xb187('0x98'));}var _0x48d9fc=_0x1770fa[_0xb187('0x3e')]['hostname']?_0x1770fa[_0xb187('0x3e')][_0xb187('0x99')]+':'+_0x1770fa[_0xb187('0x3e')][_0xb187('0x97')]:_0xb187('0x9a')+_0x1770fa[_0xb187('0x3e')]['port'];var _0x397855=_0x1770fa[_0xb187('0x3e')]['json']?_0x1770fa[_0xb187('0x3e')][_0xb187('0x25')]:!![];var _0x2dc309=_0x1770fa[_0xb187('0x3e')][_0xb187('0x9b')]?_0x1770fa[_0xb187('0x3e')][_0xb187('0x9b')]:null;var _0xd2232a={'method':_0x1770fa[_0xb187('0xa3')],'uri':util['format']('%s%s',_0x48d9fc,_0x1770fa[_0xb187('0x3e')][_0xb187('0x9')]),'json':_0x397855,'resolveWithFullResponse':!![],'encoding':_0x2dc309,'body':_0x1770fa[_0xb187('0x8a')]};if(_0x1770fa[_0xb187('0x9d')]){_0xd2232a['headers']=_0x1770fa[_0xb187('0x9d')];if(_0xd2232a[_0xb187('0x9d')]['content-length']){delete _0xd2232a[_0xb187('0x9d')][_0xb187('0x9e')];}}if(_0xd2232a[_0xb187('0x9d')][_0xb187('0x9f')]){delete _0xd2232a[_0xb187('0x9d')][_0xb187('0x9f')];}return rp(_0xd2232a);})[_0xb187('0x30')](function(_0x349866){if(_0x349866){_0x3b8d50[_0xb187('0x2a')](_0x349866['headers']);logger[_0xb187('0x68')](_0x349866[_0xb187('0x8a')]);return _0x3b8d50[_0xb187('0x23')](_0x349866[_0xb187('0xa1')])[_0xb187('0x35')](_0x349866[_0xb187('0x8a')]);}else{return _0x3b8d50['sendStatus'](0xc8);}})[_0xb187('0x51')](handleError(_0x3b8d50,null));}; \ No newline at end of file +var _0xef13=['Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','create','body','role','userProfileId','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','endsWith','statusCode','method','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','show','length','includeAll','catch','download','find','root','server/files/plugins','format','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0x5e0963,_0x3ff898){var _0x15dfd6=function(_0x286fab){while(--_0x286fab){_0x5e0963['push'](_0x5e0963['shift']());}};_0x15dfd6(++_0x3ff898);}(_0xef13,0x17d));var _0x3ef1=function(_0x12628b,_0x155dc7){_0x12628b=_0x12628b-0x0;var _0x17d4ec=_0xef13[_0x12628b];return _0x17d4ec;};'use strict';var emlformat=require(_0x3ef1('0x0'));var rimraf=require(_0x3ef1('0x1'));var zipdir=require(_0x3ef1('0x2'));var jsonpatch=require(_0x3ef1('0x3'));var rp=require(_0x3ef1('0x4'));var moment=require(_0x3ef1('0x5'));var BPromise=require(_0x3ef1('0x6'));var Mustache=require('mustache');var util=require(_0x3ef1('0x7'));var path=require(_0x3ef1('0x8'));var sox=require(_0x3ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x3ef1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ef1('0xb'));var _=require(_0x3ef1('0xc'));var squel=require(_0x3ef1('0xd'));var crypto=require(_0x3ef1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ef1('0xf'));var toCsv=require(_0x3ef1('0x10'));var querystring=require(_0x3ef1('0x11'));var Papa=require(_0x3ef1('0x12'));var extract=require(_0x3ef1('0x13'));var rimraf=require('rimraf');var archiver=require(_0x3ef1('0x14'));var Redis=require(_0x3ef1('0x15'));var authService=require(_0x3ef1('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x3ef1('0x17'));var hardwareService=require(_0x3ef1('0x18'));var logger=require(_0x3ef1('0x19'))(_0x3ef1('0x1a'));var utils=require(_0x3ef1('0x1b'));var config=require(_0x3ef1('0x1c'));var licenseUtil=require(_0x3ef1('0x1d'));var db=require(_0x3ef1('0x1e'))['db'];config[_0x3ef1('0x1f')]=_[_0x3ef1('0x20')](config['redis'],{'host':_0x3ef1('0x21'),'port':0x18eb});var socket=require(_0x3ef1('0x22'))(new Redis(config['redis']));require('./plugin.socket')[_0x3ef1('0x23')](socket);function respondWithStatusCode(_0x17ce66,_0x32c00d){_0x32c00d=_0x32c00d||0xcc;return function(_0x5a4779){if(_0x5a4779){return _0x17ce66[_0x3ef1('0x24')](_0x32c00d);}return _0x17ce66['status'](_0x32c00d)[_0x3ef1('0x25')]();};}function respondWithResult(_0x3d5bee,_0x81349c){_0x81349c=_0x81349c||0xc8;return function(_0x5954c0){if(_0x5954c0){return _0x3d5bee[_0x3ef1('0x26')](_0x81349c)[_0x3ef1('0x27')](_0x5954c0);}};}function respondWithFilteredResult(_0xa63e06,_0x56fd1c){return function(_0x3818d3){if(_0x3818d3){var _0x5746d3=typeof _0x56fd1c[_0x3ef1('0x28')]===_0x3ef1('0x29')&&typeof _0x56fd1c[_0x3ef1('0x2a')]===_0x3ef1('0x29');var _0x77d39e=_0x3818d3['count'];var _0x15fc5b=_0x5746d3?0x0:_0x56fd1c[_0x3ef1('0x28')];var _0x1d7709=_0x5746d3?_0x3818d3[_0x3ef1('0x2b')]:_0x56fd1c[_0x3ef1('0x28')]+_0x56fd1c['limit'];var _0x1bdaf6;if(_0x1d7709>=_0x77d39e){_0x1d7709=_0x77d39e;_0x1bdaf6=0xc8;}else{_0x1bdaf6=0xce;}_0xa63e06[_0x3ef1('0x26')](_0x1bdaf6);return _0xa63e06[_0x3ef1('0x2c')](_0x3ef1('0x2d'),_0x15fc5b+'-'+_0x1d7709+'/'+_0x77d39e)[_0x3ef1('0x27')](_0x3818d3);}return null;};}function patchUpdates(_0x297c15){return function(_0x40cb31){try{jsonpatch[_0x3ef1('0x2e')](_0x40cb31,_0x297c15,!![]);}catch(_0x447b8a){return BPromise[_0x3ef1('0x2f')](_0x447b8a);}return _0x40cb31[_0x3ef1('0x30')]();};}function saveUpdates(_0xa179c4,_0x2379ab){return function(_0x13dd32){if(_0x13dd32){return _0x13dd32[_0x3ef1('0x31')](_0xa179c4)[_0x3ef1('0x32')](function(_0x1673d0){return _0x1673d0;});}return null;};}function removeEntity(_0x2b7f65,_0x136fea){return function(_0x3bc081){if(_0x3bc081){return _0x3bc081[_0x3ef1('0x33')]()[_0x3ef1('0x32')](function(){var _0x2fe191=_0x3bc081[_0x3ef1('0x34')]({'plain':!![]});var _0x53a12a=_0x3ef1('0x35');return db[_0x3ef1('0x36')]['destroy']({'where':{'type':_0x53a12a,'resourceId':_0x2fe191['id']}})[_0x3ef1('0x32')](function(){return _0x3bc081;});})[_0x3ef1('0x32')](function(){_0x2b7f65[_0x3ef1('0x26')](0xcc)[_0x3ef1('0x25')]();});}};}function handleEntityNotFound(_0x44588c,_0x2c43c6){return function(_0x57d7c5){if(!_0x57d7c5){_0x44588c[_0x3ef1('0x24')](0x194);}return _0x57d7c5;};}function handleError(_0x51ec62,_0x2ad275){_0x2ad275=_0x2ad275||0x1f4;return function(_0x1b1e4b){logger[_0x3ef1('0x37')](_0x1b1e4b['stack']);if(_0x1b1e4b[_0x3ef1('0x38')]){delete _0x1b1e4b[_0x3ef1('0x38')];}_0x51ec62[_0x3ef1('0x26')](_0x2ad275)[_0x3ef1('0x39')](_0x1b1e4b);};}exports[_0x3ef1('0x3a')]=function(_0x36beb6,_0xd1c8a8){var _0x4df840={},_0x45b134={},_0x2155d5={'count':0x0,'rows':[]};var _0x561590=_[_0x3ef1('0x3b')](db[_0x3ef1('0x3c')][_0x3ef1('0x3d')],function(_0x393cdd){return{'name':_0x393cdd[_0x3ef1('0x3e')],'type':_0x393cdd[_0x3ef1('0x3f')]['key']};});_0x45b134[_0x3ef1('0x40')]=_['map'](_0x561590,'name');_0x45b134[_0x3ef1('0x41')]=_[_0x3ef1('0x42')](_0x36beb6[_0x3ef1('0x41')]);_0x45b134[_0x3ef1('0x43')]=_[_0x3ef1('0x44')](_0x45b134['model'],_0x45b134['query']);_0x4df840['attributes']=_[_0x3ef1('0x44')](_0x45b134[_0x3ef1('0x40')],qs['fields'](_0x36beb6['query'][_0x3ef1('0x45')]));_0x4df840[_0x3ef1('0x46')]=_0x4df840[_0x3ef1('0x46')]['length']?_0x4df840[_0x3ef1('0x46')]:_0x45b134[_0x3ef1('0x40')];if(!_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x47')](_0x3ef1('0x48'))){_0x4df840[_0x3ef1('0x2a')]=qs[_0x3ef1('0x2a')](_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x2a')]);_0x4df840[_0x3ef1('0x28')]=qs[_0x3ef1('0x28')](_0x36beb6['query'][_0x3ef1('0x28')]);}_0x4df840[_0x3ef1('0x49')]=qs['sort'](_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x4a')]);_0x4df840[_0x3ef1('0x4b')]=qs[_0x3ef1('0x43')](_[_0x3ef1('0x4c')](_0x36beb6['query'],_0x45b134['filters']),_0x561590);if(_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x4d')]){_0x4df840[_0x3ef1('0x4b')]=_['merge'](_0x4df840['where'],{'$or':_[_0x3ef1('0x3b')](_0x561590,function(_0x176968){if(_0x176968[_0x3ef1('0x3f')]!=='VIRTUAL'){var _0x4b38de={};_0x4b38de[_0x176968['name']]={'$like':'%'+_0x36beb6[_0x3ef1('0x41')][_0x3ef1('0x4d')]+'%'};return _0x4b38de;}})});}_0x4df840=_[_0x3ef1('0x4e')]({},_0x4df840,_0x36beb6[_0x3ef1('0x4f')]);var _0x4bd4fc={'where':_0x4df840['where']};return db[_0x3ef1('0x3c')][_0x3ef1('0x2b')](_0x4bd4fc)[_0x3ef1('0x32')](function(_0x30aad4){_0x2155d5[_0x3ef1('0x2b')]=_0x30aad4;if(_0x36beb6[_0x3ef1('0x41')]['includeAll']){_0x4df840[_0x3ef1('0x50')]=[{'all':!![]}];}return db[_0x3ef1('0x3c')]['findAll'](_0x4df840);})['then'](function(_0x12b37e){_0x2155d5['rows']=_0x12b37e;return _0x2155d5;})[_0x3ef1('0x32')](respondWithFilteredResult(_0xd1c8a8,_0x4df840))['catch'](handleError(_0xd1c8a8,null));};exports[_0x3ef1('0x51')]=function(_0x56138b,_0x57dd81){var _0x1451d6={'raw':!![],'where':{'id':_0x56138b['params']['id']}},_0x2b5f3b={};_0x2b5f3b['model']=_[_0x3ef1('0x42')](db[_0x3ef1('0x3c')][_0x3ef1('0x3d')]);_0x2b5f3b[_0x3ef1('0x41')]=_[_0x3ef1('0x42')](_0x56138b[_0x3ef1('0x41')]);_0x2b5f3b[_0x3ef1('0x43')]=_[_0x3ef1('0x44')](_0x2b5f3b['model'],_0x2b5f3b[_0x3ef1('0x41')]);_0x1451d6[_0x3ef1('0x46')]=_[_0x3ef1('0x44')](_0x2b5f3b[_0x3ef1('0x40')],qs[_0x3ef1('0x45')](_0x56138b[_0x3ef1('0x41')][_0x3ef1('0x45')]));_0x1451d6['attributes']=_0x1451d6['attributes'][_0x3ef1('0x52')]?_0x1451d6[_0x3ef1('0x46')]:_0x2b5f3b[_0x3ef1('0x40')];if(_0x56138b[_0x3ef1('0x41')][_0x3ef1('0x53')]){_0x1451d6[_0x3ef1('0x50')]=[{'all':!![]}];}_0x1451d6=_[_0x3ef1('0x4e')]({},_0x1451d6,_0x56138b[_0x3ef1('0x4f')]);return db[_0x3ef1('0x3c')]['find'](_0x1451d6)[_0x3ef1('0x32')](handleEntityNotFound(_0x57dd81,null))['then'](respondWithResult(_0x57dd81,null))[_0x3ef1('0x54')](handleError(_0x57dd81,null));};exports[_0x3ef1('0x55')]=function(_0x3c0933,_0x5b6cf5,_0x11f112){return db['Plugin'][_0x3ef1('0x56')]({'where':{'id':_0x3c0933['params']['id']},'attributes':[_0x3ef1('0x38'),_0x3ef1('0x8')],'raw':!![]})[_0x3ef1('0x32')](handleEntityNotFound(_0x5b6cf5,null))[_0x3ef1('0x32')](function(_0x46fe3f){if(_0x46fe3f){var _0x3082f1=path['join'](config[_0x3ef1('0x57')],_0x3ef1('0x58'),util[_0x3ef1('0x59')]('%s.zip',path[_0x3ef1('0x5a')](_0x46fe3f['path'])));var _0x1b835d=fs['createWriteStream'](_0x3082f1);var _0x2556f0=archiver('zip',{'zlib':{'level':0x9}});_0x2556f0['on'](_0x3ef1('0x5b'),function(_0x16e8b0){if(_0x16e8b0[_0x3ef1('0x5c')]===_0x3ef1('0x5d')){logger[_0x3ef1('0x37')](_0x16e8b0);}else{throw new db[(_0x3ef1('0x5e'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2556f0['on'](_0x3ef1('0x37'),function(_0x1d321d){throw new db[(_0x3ef1('0x5e'))][(_0x3ef1('0x5f'))](_0x3ef1('0x60'));});_0x2556f0[_0x3ef1('0x61')](_0x1b835d);_0x2556f0[_0x3ef1('0x62')](_0x3ef1('0x63'),{'cwd':path[_0x3ef1('0x64')](config[_0x3ef1('0x57')],_0x3ef1('0x58'),path[_0x3ef1('0x65')](_0x46fe3f[_0x3ef1('0x8')])),'ignore':[path['join'](path[_0x3ef1('0x5a')](_0x46fe3f[_0x3ef1('0x8')]),_0x3ef1('0x66')),path['join'](path[_0x3ef1('0x5a')](_0x46fe3f[_0x3ef1('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x3ef1('0x67')]();_0x1b835d['on'](_0x3ef1('0x68'),function(){if(!fs[_0x3ef1('0x69')](_0x3082f1)){throw new db[(_0x3ef1('0x5e'))][(_0x3ef1('0x5f'))](_0x3ef1('0x6a'));}return _0x5b6cf5[_0x3ef1('0x55')](_0x3082f1,util[_0x3ef1('0x59')]('%s.zip',path[_0x3ef1('0x5a')](_0x46fe3f[_0x3ef1('0x8')])),function(_0x282b2b){if(_0x282b2b){throw new db['Sequelize'][(_0x3ef1('0x5f'))](_0x3ef1('0x6b'));}fs[_0x3ef1('0x6c')](_0x3082f1);logger[_0x3ef1('0x6d')](_0x3ef1('0x6e'));logger['info'](_0x3ef1('0x6f'));});});}return null;})['catch'](handleError(_0x5b6cf5,null));};exports['upload']=function(_0x3eaa2f,_0x3d428c,_0x53c7a5){var _0x17798c=path['basename'](_0x3eaa2f[_0x3ef1('0x70')][_0x3ef1('0x71')],path[_0x3ef1('0x72')](_0x3eaa2f[_0x3ef1('0x70')][_0x3ef1('0x71')]));var _0x1329ab=path[_0x3ef1('0x64')](config['root'],_0x3ef1('0x58'),_0x3eaa2f[_0x3ef1('0x70')][_0x3ef1('0x71')]);var _0x482016=path[_0x3ef1('0x64')](config[_0x3ef1('0x57')],_0x3ef1('0x58'),_0x17798c);logger[_0x3ef1('0x6d')](_0x3ef1('0x73'),_0x1329ab);logger[_0x3ef1('0x6d')](_0x3ef1('0x74'),_0x482016);try{fs[_0x3ef1('0x75')](_0x1329ab,parseInt(_0x3ef1('0x76'),0x8));extract(_0x1329ab,{'dir':_0x482016},function(_0x2ae025){if(_0x2ae025){logger[_0x3ef1('0x37')](_0x2ae025);handleError(_0x2ae025,!![]);};var _0x405688=fs[_0x3ef1('0x77')](_0x482016);if(_0x405688['length']>0x1){removeReferences(_0x1329ab,_0x482016);logger['error'](_0x3ef1('0x78'));return _0x53c7a5(new Error(_0x3ef1('0x78')));}var _0x2cf5d3=fs[_0x3ef1('0x79')](path[_0x3ef1('0x64')](_0x482016,_0x405688[0x0]));if(_0x2cf5d3[_0x3ef1('0x7a')]()){removeReferences(_0x1329ab,_0x482016);logger[_0x3ef1('0x37')](_0x3ef1('0x78'));return _0x53c7a5(new Error(_0x3ef1('0x78')));}if(_0x2cf5d3['isDirectory']()){var _0x39a7a9=fs[_0x3ef1('0x77')](path[_0x3ef1('0x64')](_0x482016,_0x405688[0x0]));if(_0x39a7a9['length']===0x0){removeReferences(_0x1329ab,_0x482016);logger['error'](_0x3ef1('0x78'));return _0x53c7a5(new Error(_0x3ef1('0x78')));}var _0xf55113=_0x39a7a9[_0x3ef1('0x7b')](function(_0x34df8d){return _0x34df8d===_0x3ef1('0x7c');});if(!_0xf55113){return _0x53c7a5(new Error(_0x3ef1('0x7d')));}var _0x18ab5e=fs[_0x3ef1('0x7e')](path[_0x3ef1('0x64')](_0x482016,_0x405688[0x0],'manifest.json'));var _0x549185=JSON[_0x3ef1('0x7f')](_0x18ab5e);if('undefined'==typeof _0x549185[_0x3ef1('0x38')]){return _0x53c7a5(new Error(_0x3ef1('0x80')));}if(_0x3ef1('0x29')==typeof _0x549185[_0x3ef1('0x3f')]){return _0x53c7a5(new Error(_0x3ef1('0x81')));}if(_0x3ef1('0x29')==typeof _0x549185[_0x3ef1('0x82')]){return _0x53c7a5(new Error(_0x3ef1('0x83')));}if('undefined'==typeof _0x549185['parameters']){return _0x53c7a5(new Error(_0x3ef1('0x84')));}if(_0x549185[_0x3ef1('0x3f')]===_0x3ef1('0x85')){if(_0x3ef1('0x29')==typeof _0x549185['parameters'][_0x3ef1('0x86')]){return _0x53c7a5(new Error(_0x3ef1('0x87')));}if('undefined'==typeof _0x549185[_0x3ef1('0x88')]['views'][_0x3ef1('0x89')]&&'undefined'==typeof _0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x8a')]){return _0x53c7a5(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x549185[_0x3ef1('0x3f')]===_0x3ef1('0x8b')){if('undefined'==typeof _0x549185[_0x3ef1('0x88')][_0x3ef1('0x8c')]){return _0x53c7a5(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x3ef1('0x29')==typeof _0x549185[_0x3ef1('0x88')][_0x3ef1('0x8d')]){return _0x53c7a5(new Error(_0x3ef1('0x8e')));}}else{return _0x53c7a5(new Error(_0x3ef1('0x8f')));}var _0x1a22e6=_0x549185[_0x3ef1('0x38')];var _0x129a0a=_0x549185[_0x3ef1('0x90')];var _0x780821=_0x549185[_0x3ef1('0x3f')];var _0x120fc7=_0x549185[_0x3ef1('0x91')]?_0x549185[_0x3ef1('0x91')]:_0x3ef1('0x92');var _0x33b669=_0x549185[_0x3ef1('0x93')]?_0x549185['icon']:'icon-apps';var _0x383cff='';var _0x58484e='';var _0x1cebac='';var _0x117568='';var _0x131301=_0x549185['version'];if(_0x780821===_0x3ef1('0x85')){if('undefined'!=typeof _0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x89')]){var _0x5609ab=_0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5609ab)){_0x383cff=path['join']('plugins',_0x17798c,_0x405688[0x0],_0x5609ab);}else{_0x383cff=_0x5609ab;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x549185['parameters']['views'][_0x3ef1('0x8a')]){var _0x5b4000=_0x549185['parameters']['views'][_0x3ef1('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x3ef1('0x94')](_0x5b4000)){_0x58484e=path[_0x3ef1('0x64')](_0x3ef1('0x95'),_0x17798c,_0x405688[0x0],_0x5b4000);}else{_0x58484e=_0x5b4000;}}else{logger[_0x3ef1('0x6d')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x780821===_0x3ef1('0x8b')){_0x1cebac=_0x549185[_0x3ef1('0x88')]['scriptName'];_0x117568=_0x549185['parameters'][_0x3ef1('0x8d')];if('undefined'!=typeof _0x549185[_0x3ef1('0x88')][_0x3ef1('0x86')]){if(_0x3ef1('0x29')!=typeof _0x549185[_0x3ef1('0x88')]['views'][_0x3ef1('0x89')]){var _0x5609ab=_0x549185[_0x3ef1('0x88')]['views'][_0x3ef1('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x3ef1('0x94')](_0x5609ab)){_0x383cff=path[_0x3ef1('0x64')](_0x3ef1('0x95'),_0x17798c,_0x405688[0x0],_0x5609ab);}else{_0x383cff=_0x5609ab;}}if(_0x3ef1('0x29')!=typeof _0x549185['parameters']['views'][_0x3ef1('0x8a')]){var _0x5b4000=_0x549185['parameters'][_0x3ef1('0x86')][_0x3ef1('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x3ef1('0x94')](_0x5b4000)){_0x58484e=path[_0x3ef1('0x64')]('plugins',_0x17798c,_0x405688[0x0],_0x5b4000);}else{_0x58484e=_0x5b4000;}}}}var _0x29b19b={'name':_0x1a22e6,'description':_0x129a0a,'path':path[_0x3ef1('0x64')](_0x17798c,_0x405688[0x0]),'type':_0x780821,'sidebar':_0x120fc7,'icon':_0x33b669,'adminUrl':_0x383cff,'agentUrl':_0x58484e,'scriptName':_0x1cebac,'scriptPath':_0x117568,'version':_0x131301};removeReferences(_0x1329ab,null);return db[_0x3ef1('0x3c')][_0x3ef1('0x96')](_0x29b19b)['then'](function(_0x6de535){var _0x31bcd9={'role':_0x3eaa2f[_0x3ef1('0x97')][_0x3ef1('0x98')],'userProfileId':_0x3eaa2f[_0x3ef1('0x97')][_0x3ef1('0x99')]};if(!_0x31bcd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31bcd9[_0x3ef1('0x98')]==='user'){var _0x29a760=_0x6de535[_0x3ef1('0x34')]({'plain':!![]});return db[_0x3ef1('0x9a')][_0x3ef1('0x56')]({'where':{'name':_0x3ef1('0x35'),'userProfileId':_0x31bcd9[_0x3ef1('0x99')]},'raw':!![]})[_0x3ef1('0x32')](function(_0x1c1b34){if(_0x1c1b34&&_0x1c1b34['autoAssociation']===0x0){return db['UserProfileResource'][_0x3ef1('0x96')]({'name':_0x29a760[_0x3ef1('0x38')],'resourceId':_0x29a760['id'],'type':_0x1c1b34[_0x3ef1('0x38')],'sectionId':_0x1c1b34['id']},{})[_0x3ef1('0x32')](function(){return _0x6de535;});}else{return _0x6de535;}})[_0x3ef1('0x54')](function(_0x38e234){logger['error'](_0x3ef1('0x9b'),_0x38e234);throw _0x38e234;});}return _0x6de535;})['then'](respondWithResult(_0x3d428c,null))[_0x3ef1('0x54')](handleError(_0x3d428c,null));}});}catch(_0x5d0c8b){_0x3d428c[_0x3ef1('0x26')](0x1f4)[_0x3ef1('0x39')](_0x5d0c8b);}};function removeReferences(_0x26384f,_0x5542ee){try{if(_0x26384f){fs['unlinkSync'](_0x26384f);logger['info']('Zip\x20archive\x20removed');}if(_0x5542ee){rimraf(_0x5542ee,function(){});logger[_0x3ef1('0x6d')]('Extracted\x20folder\x20removed');}}catch(_0x5a85ef){logger['error'](_0x5a85ef);}}exports['update']=function(_0x5bff52,_0x3ca4bd,_0x3219e5){return db[_0x3ef1('0x3c')][_0x3ef1('0x56')]({'where':{'id':_0x5bff52[_0x3ef1('0x9c')]['id']}})[_0x3ef1('0x32')](handleEntityNotFound(_0x3ca4bd,null))[_0x3ef1('0x32')](saveUpdates(_0x5bff52[_0x3ef1('0x97')],null))[_0x3ef1('0x32')](respondWithResult(_0x3ca4bd,null))['catch'](handleError(_0x3ca4bd,null));};exports['delete']=function(_0x87cf28,_0x4fb83a,_0x50213f){return db[_0x3ef1('0x3c')][_0x3ef1('0x56')]({'where':{'id':_0x87cf28[_0x3ef1('0x9c')]['id']}})[_0x3ef1('0x32')](function(_0x5af013){if(_0x5af013){return _0x5af013[_0x3ef1('0x33')]();}})['then'](function(_0x509352){rimraf(path[_0x3ef1('0x64')](config[_0x3ef1('0x57')],_0x3ef1('0x58'),path[_0x3ef1('0x65')](_0x509352[_0x3ef1('0x8')])),function(){});return _0x509352;})['then'](handleEntityNotFound(_0x4fb83a,null))['then'](respondWithStatusCode(_0x4fb83a,null))[_0x3ef1('0x54')](handleError(_0x4fb83a,null));};exports[_0x3ef1('0x9d')]=function(_0x339c1f,_0x8b8690,_0x44eb6e){return BPromise[_0x3ef1('0x9e')]()[_0x3ef1('0x32')](function(){if(!_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x9f')]){throw new Error(_0x3ef1('0xa0'));}var _0x135700=_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0xa1')]?_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0xa1')]+':'+_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x9f')]:_0x3ef1('0xa2')+_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x9f')];var _0x182910=_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x27')]?_0x339c1f['query'][_0x3ef1('0x27')]:!![];var _0x5d91da=_0x339c1f['query'][_0x3ef1('0xa3')]?_0x339c1f[_0x3ef1('0x41')]['encoding']:null;var _0x3a13dd={'method':_0x339c1f['method'],'uri':util[_0x3ef1('0x59')]('%s%s',_0x135700,_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x8')]),'json':_0x182910,'resolveWithFullResponse':!![],'encoding':_0x5d91da,'qs':_0x339c1f[_0x3ef1('0x41')]};if(_0x339c1f['headers']){_0x3a13dd['headers']=_0x339c1f[_0x3ef1('0xa4')];if(_0x3a13dd[_0x3ef1('0xa4')][_0x3ef1('0xa5')]){delete _0x3a13dd[_0x3ef1('0xa4')]['content-length'];}}if(_0x3a13dd['headers'][_0x3ef1('0xa6')]){delete _0x3a13dd[_0x3ef1('0xa4')][_0x3ef1('0xa6')];}return rp(_0x3a13dd);})[_0x3ef1('0x32')](function(_0x429f6c){if(_0x429f6c){_0x8b8690[_0x3ef1('0x2c')](_0x429f6c[_0x3ef1('0xa4')]);logger[_0x3ef1('0x6d')](_0x429f6c['body']);if(_[_0x3ef1('0xa7')](_0x339c1f[_0x3ef1('0x41')][_0x3ef1('0x8')],_0x3ef1('0x55'))&&_0x429f6c[_0x3ef1('0xa8')]==0x1f4){return _0x8b8690[_0x3ef1('0x24')](_0x429f6c[_0x3ef1('0xa8')]);}else{return _0x8b8690[_0x3ef1('0x26')](_0x429f6c[_0x3ef1('0xa8')])[_0x3ef1('0x39')](_0x429f6c[_0x3ef1('0x97')]);}}else{return _0x8b8690['sendStatus'](0xc8);}})['catch'](handleError(_0x8b8690,null));};exports['webhookPost']=function(_0xdc3284,_0x578729,_0x2d2297){return BPromise[_0x3ef1('0x9e')]()[_0x3ef1('0x32')](function(){if(!_0xdc3284[_0x3ef1('0x41')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x9f')]){throw new Error(_0x3ef1('0xa0'));}var _0x353ac3=_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0xa1')]?_0xdc3284['query'][_0x3ef1('0xa1')]+':'+_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x9f')]:_0x3ef1('0xa2')+_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x9f')];var _0xdedce8=_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x27')]?_0xdc3284['query'][_0x3ef1('0x27')]:!![];var _0x15d08b=_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0xa3')]?_0xdc3284[_0x3ef1('0x41')]['encoding']:null;var _0x34fec9={'method':_0xdc3284[_0x3ef1('0xa9')],'uri':util[_0x3ef1('0x59')](_0x3ef1('0xaa'),_0x353ac3,_0xdc3284[_0x3ef1('0x41')][_0x3ef1('0x8')]),'json':_0xdedce8,'resolveWithFullResponse':!![],'encoding':_0x15d08b,'body':_0xdc3284[_0x3ef1('0x97')]};if(_0xdc3284[_0x3ef1('0xa4')]){_0x34fec9[_0x3ef1('0xa4')]=_0xdc3284[_0x3ef1('0xa4')];if(_0x34fec9[_0x3ef1('0xa4')]['content-length']){delete _0x34fec9[_0x3ef1('0xa4')][_0x3ef1('0xa5')];}}if(_0x34fec9[_0x3ef1('0xa4')][_0x3ef1('0xa6')]){delete _0x34fec9['headers'][_0x3ef1('0xa6')];}return rp(_0x34fec9);})[_0x3ef1('0x32')](function(_0x52bafc){if(_0x52bafc){_0x578729[_0x3ef1('0x2c')](_0x52bafc[_0x3ef1('0xa4')]);logger[_0x3ef1('0x6d')](_0x52bafc[_0x3ef1('0x97')]);return _0x578729[_0x3ef1('0x26')](_0x52bafc[_0x3ef1('0xa8')])['send'](_0x52bafc[_0x3ef1('0x97')]);}else{return _0x578729[_0x3ef1('0x24')](0xc8);}})['catch'](handleError(_0x578729,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 1959670..7259073 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 _0x36bb=['events','../../mysqldb','Plugin','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x248a73,_0x53533f){var _0x4b40c9=function(_0x381b10){while(--_0x381b10){_0x248a73['push'](_0x248a73['shift']());}};_0x4b40c9(++_0x53533f);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb36b('0x0'));var Plugin=require(_0xb36b('0x1'))['db'][_0xb36b('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb36b('0x3'),'afterUpdate':_0xb36b('0x4'),'afterDestroy':_0xb36b('0x5')};function emitEvent(_0x4003b8){return function(_0x311671,_0x3d57d7,_0x2bcc68){PluginEvents[_0xb36b('0x6')](_0x4003b8+':'+_0x311671['id'],_0x311671);PluginEvents[_0xb36b('0x6')](_0x4003b8,_0x311671);_0x2bcc68(null);};}for(var e in events){if(events[_0xb36b('0x7')](e)){var event=events[e];Plugin[_0xb36b('0x8')](e,emitEvent(event));}}module[_0xb36b('0x9')]=PluginEvents; \ No newline at end of file +var _0xecb2=['exports','events','setMaxListeners','remove','emit'];(function(_0x2d2793,_0x295ee3){var _0x21c1a8=function(_0x1377dc){while(--_0x1377dc){_0x2d2793['push'](_0x2d2793['shift']());}};_0x21c1a8(++_0x295ee3);}(_0xecb2,0xf6));var _0x2ecb=function(_0x29ecc0,_0x191222){_0x29ecc0=_0x29ecc0-0x0;var _0x17d553=_0xecb2[_0x29ecc0];return _0x17d553;};'use strict';var EventEmitter=require(_0x2ecb('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x2ecb('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2ecb('0x2')};function emitEvent(_0x2f3639){return function(_0x393e7c,_0x2a4fe5,_0x1d007c){PluginEvents[_0x2ecb('0x3')](_0x2f3639+':'+_0x393e7c['id'],_0x393e7c);PluginEvents['emit'](_0x2f3639,_0x393e7c);_0x1d007c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x2ecb('0x4')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 0084011..c4b2d77 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 _0x65d3=['api','bluebird','path','../../config/environment','./plugin.attributes','exports','define','plugins','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x65d3,0x134));var _0x365d=function(_0x5b7c64,_0x2f7c6d){_0x5b7c64=_0x5b7c64-0x0;var _0x455a9c=_0x65d3[_0x5b7c64];return _0x455a9c;};'use strict';var _=require('lodash');var util=require(_0x365d('0x0'));var logger=require(_0x365d('0x1'))(_0x365d('0x2'));var moment=require('moment');var BPromise=require(_0x365d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x365d('0x4'));var rimraf=require('rimraf');var config=require(_0x365d('0x5'));var attributes=require(_0x365d('0x6'));module[_0x365d('0x7')]=function(_0x2c903f,_0x2cafd5){return _0x2c903f[_0x365d('0x8')]('Plugin',attributes,{'tableName':_0x365d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e06=['define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./plugin.attributes','exports'];(function(_0x5071c0,_0x29a4bf){var _0x2c5d5d=function(_0x45dde1){while(--_0x45dde1){_0x5071c0['push'](_0x5071c0['shift']());}};_0x2c5d5d(++_0x29a4bf);}(_0x3e06,0x153));var _0x63e0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e06[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x63e0('0x0'));var util=require(_0x63e0('0x1'));var logger=require(_0x63e0('0x2'))(_0x63e0('0x3'));var moment=require(_0x63e0('0x4'));var BPromise=require(_0x63e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63e0('0x6'));var rimraf=require(_0x63e0('0x7'));var config=require(_0x63e0('0x8'));var attributes=require(_0x63e0('0x9'));module[_0x63e0('0xa')]=function(_0x562ed8,_0x2630e0){return _0x562ed8[_0x63e0('0xb')](_0x63e0('0xc'),attributes,{'tableName':_0x63e0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index a3c6c43..d8c8ce5 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 _0x53ff=['info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./plugin.socket','register','request','then'];(function(_0x5a3731,_0x49a0c9){var _0xbaf3d2=function(_0x24dd63){while(--_0x24dd63){_0x5a3731['push'](_0x5a3731['shift']());}};_0xbaf3d2(++_0x49a0c9);}(_0x53ff,0xb6));var _0xf53f=function(_0x7ad8b0,_0x1ae2a5){_0x7ad8b0=_0x7ad8b0-0x0;var _0x3311d8=_0x53ff[_0x7ad8b0];return _0x3311d8;};'use strict';var _=require(_0xf53f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf53f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf53f('0x2'));var db=require(_0xf53f('0x3'))['db'];var utils=require(_0xf53f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf53f('0x5'));var jayson=require(_0xf53f('0x6'));var client=jayson[_0xf53f('0x7')][_0xf53f('0x8')]({'port':0x232a});config['redis']=_[_0xf53f('0x9')](config[_0xf53f('0xa')],{'host':_0xf53f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf53f('0xc'))[_0xf53f('0xd')](socket);function respondWithRpcPromise(_0x200cfb,_0x48642f,_0x4dd6c3){return new BPromise(function(_0x21e5a0,_0x8d1c9f){return client[_0xf53f('0xe')](_0x200cfb,_0x4dd6c3)[_0xf53f('0xf')](function(_0x4fe54a){logger[_0xf53f('0x10')](_0xf53f('0x11'),_0x48642f,_0xf53f('0x12'));logger[_0xf53f('0x13')](_0xf53f('0x14'),_0x48642f,_0xf53f('0x12'),JSON[_0xf53f('0x15')](_0x4fe54a));if(_0x4fe54a[_0xf53f('0x16')]){if(_0x4fe54a[_0xf53f('0x16')][_0xf53f('0x17')]===0x1f4){logger[_0xf53f('0x16')](_0xf53f('0x11'),_0x48642f,_0x4fe54a[_0xf53f('0x16')]['message']);return _0x8d1c9f(_0x4fe54a['error']['message']);}logger['error'](_0xf53f('0x11'),_0x48642f,_0x4fe54a[_0xf53f('0x16')][_0xf53f('0x18')]);return _0x21e5a0(_0x4fe54a['error'][_0xf53f('0x18')]);}else{logger[_0xf53f('0x10')](_0xf53f('0x11'),_0x48642f,'request\x20sent');_0x21e5a0(_0x4fe54a[_0xf53f('0x19')]['message']);}})[_0xf53f('0x1a')](function(_0x771d9){logger[_0xf53f('0x16')]('Plugin,\x20%s,\x20%s',_0x48642f,_0x771d9);_0x8d1c9f(_0x771d9);});});}exports[_0xf53f('0x1b')]=function(_0x1c4054){var _0x504080=this;return new Promise(function(_0x5bd469,_0x2f5d06){return db[_0xf53f('0x1c')][_0xf53f('0x1d')](_0x1c4054[_0xf53f('0x1e')],{'raw':_0x1c4054[_0xf53f('0x1f')]?_0x1c4054[_0xf53f('0x1f')][_0xf53f('0x20')]===undefined?!![]:![]:!![]})[_0xf53f('0xf')](function(_0x2a24e3){logger[_0xf53f('0x10')]('CreatePlugin',_0x1c4054);logger['debug'](_0xf53f('0x1b'),_0x1c4054,JSON[_0xf53f('0x15')](_0x2a24e3));_0x5bd469(_0x2a24e3);})[_0xf53f('0x1a')](function(_0xf61c64){logger[_0xf53f('0x16')]('CreatePlugin',_0xf61c64['message'],_0x1c4054);_0x2f5d06(_0x504080[_0xf53f('0x16')](0x1f4,_0xf61c64[_0xf53f('0x18')]));});});}; \ No newline at end of file +var _0x969e=['lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreatePlugin','Plugin','body','raw','then'];(function(_0x5a3273,_0x2092ef){var _0x2a0a17=function(_0x238c66){while(--_0x238c66){_0x5a3273['push'](_0x5a3273['shift']());}};_0x2a0a17(++_0x2092ef);}(_0x969e,0x136));var _0xe969=function(_0x4baa7d,_0x5382e7){_0x4baa7d=_0x4baa7d-0x0;var _0x5353ef=_0x969e[_0x4baa7d];return _0x5353ef;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var moment=require('moment');var BPromise=require(_0xe969('0x2'));var rs=require(_0xe969('0x3'));var fs=require('fs');var Redis=require(_0xe969('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe969('0x5'));var config=require(_0xe969('0x6'));var jayson=require(_0xe969('0x7'));var client=jayson[_0xe969('0x8')]['http']({'port':0x232a});config[_0xe969('0x9')]=_[_0xe969('0xa')](config[_0xe969('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe969('0xb'))(new Redis(config['redis']));require(_0xe969('0xc'))[_0xe969('0xd')](socket);function respondWithRpcPromise(_0x5d9841,_0x431f1c,_0x4ced4b){return new BPromise(function(_0x32d427,_0x2991d6){return client[_0xe969('0xe')](_0x5d9841,_0x4ced4b)['then'](function(_0x80b852){logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));logger[_0xe969('0x12')](_0xe969('0x13'),_0x431f1c,'request\x20sent',JSON[_0xe969('0x14')](_0x80b852));if(_0x80b852['error']){if(_0x80b852['error'][_0xe969('0x15')]===0x1f4){logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')]['message']);return _0x2991d6(_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);}logger[_0xe969('0x16')](_0xe969('0x10'),_0x431f1c,_0x80b852[_0xe969('0x16')][_0xe969('0x17')]);return _0x32d427(_0x80b852['error']['message']);}else{logger[_0xe969('0xf')](_0xe969('0x10'),_0x431f1c,_0xe969('0x11'));_0x32d427(_0x80b852[_0xe969('0x18')][_0xe969('0x17')]);}})[_0xe969('0x19')](function(_0x5aa68c){logger['error'](_0xe969('0x10'),_0x431f1c,_0x5aa68c);_0x2991d6(_0x5aa68c);});});}exports[_0xe969('0x1a')]=function(_0x295b44){var _0x5dd070=this;return new Promise(function(_0x1f6e31,_0x524542){return db[_0xe969('0x1b')]['create'](_0x295b44[_0xe969('0x1c')],{'raw':_0x295b44['options']?_0x295b44['options'][_0xe969('0x1d')]===undefined?!![]:![]:!![]})[_0xe969('0x1e')](function(_0x58da99){logger[_0xe969('0xf')](_0xe969('0x1a'),_0x295b44);logger[_0xe969('0x12')](_0xe969('0x1a'),_0x295b44,JSON[_0xe969('0x14')](_0x58da99));_0x1f6e31(_0x58da99);})[_0xe969('0x19')](function(_0x3d1358){logger[_0xe969('0x16')](_0xe969('0x1a'),_0x3d1358[_0xe969('0x17')],_0x295b44);_0x524542(_0x5dd070['error'](0x1f4,_0x3d1358['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 6e0cf6c..cad1687 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 _0x8447=['removeListener','register','plugin:','./plugin.events','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8447,0x18f));var _0x7844=function(_0x282641,_0x1adcc9){_0x282641=_0x282641-0x0;var _0x340e44=_0x8447[_0x282641];return _0x340e44;};'use strict';var PluginEvents=require(_0x7844('0x0'));var events=[_0x7844('0x1'),'remove',_0x7844('0x2')];function createListener(_0x21c8c5,_0x3448a4){return function(_0x4729ee){_0x3448a4['emit'](_0x21c8c5,_0x4729ee);};}function removeListener(_0x1b67db,_0x377c2d){return function(){PluginEvents[_0x7844('0x3')](_0x1b67db,_0x377c2d);};}exports[_0x7844('0x4')]=function(_0x476c56){for(var _0x34bcd5=0x0,_0x3647b7=events['length'];_0x34bcd5<_0x3647b7;_0x34bcd5++){var _0x1ebc40=events[_0x34bcd5];var _0x49b76b=createListener(_0x7844('0x5')+_0x1ebc40,_0x476c56);PluginEvents['on'](_0x1ebc40,_0x49b76b);}}; \ No newline at end of file +var _0x5d41=['./plugin.events','save','remove','update','emit','removeListener','register','plugin:'];(function(_0x521863,_0x52bb0f){var _0x3f0072=function(_0x1763b4){while(--_0x1763b4){_0x521863['push'](_0x521863['shift']());}};_0x3f0072(++_0x52bb0f);}(_0x5d41,0x150));var _0x15d4=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x5d41[_0x30faec];return _0x29484f;};'use strict';var PluginEvents=require(_0x15d4('0x0'));var events=[_0x15d4('0x1'),_0x15d4('0x2'),_0x15d4('0x3')];function createListener(_0x4c8a9c,_0x530d39){return function(_0x4d596b){_0x530d39[_0x15d4('0x4')](_0x4c8a9c,_0x4d596b);};}function removeListener(_0x4cda9c,_0x535f91){return function(){PluginEvents[_0x15d4('0x5')](_0x4cda9c,_0x535f91);};}exports[_0x15d4('0x6')]=function(_0x31a994){for(var _0x49a5e2=0x0,_0xe9adcf=events['length'];_0x49a5e2<_0xe9adcf;_0x49a5e2++){var _0x25f0fa=events[_0x49a5e2];var _0x534b7f=createListener(_0x15d4('0x7')+_0x25f0fa,_0x31a994);PluginEvents['on'](_0x25f0fa,_0x534b7f);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 6c18165..dc2f08a 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(_0x5a2ad9,_0x4530ac){var _0x24fb9a=function(_0x486d3b){while(--_0x486d3b){_0x5a2ad9['push'](_0x5a2ad9['shift']());}};_0x24fb9a(++_0x4530ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x4a008e,_0x2ffe82){var _0x16550e=function(_0x354027){while(--_0x354027){_0x4a008e['push'](_0x4a008e['shift']());}};_0x16550e(++_0x2ffe82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 2bf51bf..326099e 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 _0x70e0=['dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','child_process','exec','bluebird','json','error','stack','name','send','npm\x20install','info','index','list','reject','motion2','length','then','describe','params','catch','create','body','join','../../files/plugins','script','cwd','chdir','dirname','start'];(function(_0x461236,_0x378759){var _0x4d791e=function(_0x1dc116){while(--_0x1dc116){_0x461236['push'](_0x461236['shift']());}};_0x4d791e(++_0x378759);}(_0x70e0,0x17b));var _0x070e=function(_0x4e3345,_0x4db8cb){_0x4e3345=_0x4e3345-0x0;var _0x31704f=_0x70e0[_0x4e3345];return _0x31704f;};'use strict';var _=require(_0x070e('0x0'));var pm2=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var path=require('path');var exec=require(_0x070e('0x3'))[_0x070e('0x4')];var BPromise=require(_0x070e('0x5'));function handleEntityNotFound(_0x2593e5,_0x5c90fc){return function(_0x7bce9b){if(!_0x7bce9b){_0x2593e5['sendStatus'](0x194);;}return _0x7bce9b;};}function respondWithResult(_0x46fe68,_0x4b041d){_0x4b041d=_0x4b041d||0xc8;return function(_0x56e420){if(_0x56e420){return _0x46fe68['status'](_0x4b041d)[_0x070e('0x6')](_0x56e420);}return null;};}function handleError(_0x1e11f0,_0x604664){_0x604664=_0x604664||0x1f4;return function(_0x2611e6){logger[_0x070e('0x7')](_0x2611e6[_0x070e('0x8')]);if(_0x2611e6[_0x070e('0x9')]){delete _0x2611e6['name'];}_0x1e11f0['status'](_0x604664)[_0x070e('0xa')](_0x2611e6);};}function execChildProcess(){return new BPromise(function(_0x2e3e5e,_0x12bb37){exec(_0x070e('0xb'),function(_0xa927a2,_0xffcdd6,_0x25cfe1){logger[_0x070e('0xc')](_0xffcdd6);logger[_0x070e('0xc')](_0x25cfe1);if(_0xa927a2){logger[_0x070e('0x7')](_0xa927a2);return _0x12bb37(_0xa927a2);}return _0x2e3e5e(_0xffcdd6);});});}exports[_0x070e('0xd')]=function(_0x52da3b,_0x5dca0f){return pm2[_0x070e('0xe')]()['then'](function(_0x4a33d2){if(_0x4a33d2){var _0x5bae0f=_[_0x070e('0xf')](_0x4a33d2,function(_0x14c3fd){return _0x14c3fd['name']==='express'||_0x14c3fd[_0x070e('0x9')]===_0x070e('0x10');});return{'rows':_0x5bae0f,'count':_0x5bae0f[_0x070e('0x11')]};}return null;})[_0x070e('0x12')](respondWithResult(_0x5dca0f,null))['catch'](handleError(_0x5dca0f,null));};exports['show']=function(_0x17e2e4,_0x2bd937){return pm2[_0x070e('0x13')](_0x17e2e4[_0x070e('0x14')]['id'])[_0x070e('0x12')](respondWithResult(_0x2bd937,null))['then'](handleEntityNotFound(_0x2bd937,null))[_0x070e('0x15')](handleError(_0x2bd937,null));};exports[_0x070e('0x16')]=function(_0x1ad3de,_0x3ea105){if(_0x1ad3de[_0x070e('0x17')]['name']&&_0x1ad3de['body']['script']){var _0x9907cf=path[_0x070e('0x18')](__dirname,_0x070e('0x19'),_0x1ad3de['body'][_0x070e('0x1a')]);var _0x5dc5d2=process[_0x070e('0x1b')]();process[_0x070e('0x1c')](path[_0x070e('0x1d')](_0x9907cf));return execChildProcess()[_0x070e('0x12')](function(_0x28a1c3){process[_0x070e('0x1c')](_0x5dc5d2);return pm2[_0x070e('0x1e')]({'name':_0x1ad3de[_0x070e('0x17')]['name'],'script':_0x9907cf});})[_0x070e('0x12')](function(_0x270061){pm2[_0x070e('0x1f')]();return _0x270061[0x0];})['then'](respondWithResult(_0x3ea105,0xc9))[_0x070e('0x15')](handleError(_0x3ea105,null));}else{return _0x3ea105['status'](0x1f4)['send']({'message':_0x070e('0x20')});}};exports[_0x070e('0x21')]=function(_0x41deb1,_0x1743cc){if(_0x41deb1[_0x070e('0x17')]['id']){delete _0x41deb1['body']['id'];}var _0x374c54={'online':_0x070e('0x22'),'stopped':_0x070e('0x23')};if(_0x374c54[_0x070e('0x24')](_0x41deb1[_0x070e('0x17')][_0x070e('0x25')])){return pm2[_0x374c54[_0x41deb1[_0x070e('0x17')][_0x070e('0x25')]]](_0x41deb1['params']['id'])[_0x070e('0x12')](respondWithResult(_0x1743cc,0xc8))[_0x070e('0x15')](handleError(_0x1743cc,null));}else{return _0x1743cc[_0x070e('0x25')](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x070e('0x26')]=function(_0x46065c,_0xa6c0ab){if(_0x46065c['body']['id']){delete _0x46065c[_0x070e('0x17')]['id'];}if(_0x46065c[_0x070e('0x14')]['id']){return pm2[_0x070e('0x27')](_0x46065c[_0x070e('0x14')]['id'])['then'](function(_0x5bf522){pm2['dump']();return _0x5bf522[0x0];})['then'](respondWithResult(_0xa6c0ab,null))[_0x070e('0x15')](handleError(_0xa6c0ab,null));}else{return _0xa6c0ab['status'](0x1f4)[_0x070e('0xa')]({'message':_0x070e('0x28')});}}; \ No newline at end of file +var _0x5db8=['Unknown\x20status','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec','sendStatus','status','json','error','name','send','info','index','list','then','reject','express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','params'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x5db8,0xbb));var _0x85db=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0x5db8[_0x4a1ec0];return _0x49ab91;};'use strict';var _=require(_0x85db('0x0'));var pm2=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))('api');var path=require(_0x85db('0x3'));var exec=require(_0x85db('0x4'))[_0x85db('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5b7426,_0x13c216){return function(_0x1182c0){if(!_0x1182c0){_0x5b7426[_0x85db('0x6')](0x194);;}return _0x1182c0;};}function respondWithResult(_0x34d71f,_0x48bf16){_0x48bf16=_0x48bf16||0xc8;return function(_0x489b13){if(_0x489b13){return _0x34d71f[_0x85db('0x7')](_0x48bf16)[_0x85db('0x8')](_0x489b13);}return null;};}function handleError(_0xc6fd00,_0x308988){_0x308988=_0x308988||0x1f4;return function(_0x59a522){logger[_0x85db('0x9')](_0x59a522['stack']);if(_0x59a522[_0x85db('0xa')]){delete _0x59a522[_0x85db('0xa')];}_0xc6fd00[_0x85db('0x7')](_0x308988)[_0x85db('0xb')](_0x59a522);};}function execChildProcess(){return new BPromise(function(_0x5491fa,_0x54feb2){exec('npm\x20install',function(_0x14f838,_0x458b2b,_0x4de057){logger[_0x85db('0xc')](_0x458b2b);logger['info'](_0x4de057);if(_0x14f838){logger[_0x85db('0x9')](_0x14f838);return _0x54feb2(_0x14f838);}return _0x5491fa(_0x458b2b);});});}exports[_0x85db('0xd')]=function(_0x382c43,_0x216a41){return pm2[_0x85db('0xe')]()[_0x85db('0xf')](function(_0x2b7507){if(_0x2b7507){var _0x25ec64=_[_0x85db('0x10')](_0x2b7507,function(_0x415281){return _0x415281[_0x85db('0xa')]===_0x85db('0x11')||_0x415281[_0x85db('0xa')]==='motion2';});return{'rows':_0x25ec64,'count':_0x25ec64[_0x85db('0x12')]};}return null;})[_0x85db('0xf')](respondWithResult(_0x216a41,null))[_0x85db('0x13')](handleError(_0x216a41,null));};exports[_0x85db('0x14')]=function(_0x2ecd71,_0x396afa){return pm2[_0x85db('0x15')](_0x2ecd71['params']['id'])[_0x85db('0xf')](respondWithResult(_0x396afa,null))[_0x85db('0xf')](handleEntityNotFound(_0x396afa,null))[_0x85db('0x13')](handleError(_0x396afa,null));};exports[_0x85db('0x16')]=function(_0x4d976d,_0x2bc9a4){if(_0x4d976d[_0x85db('0x17')][_0x85db('0xa')]&&_0x4d976d[_0x85db('0x17')][_0x85db('0x18')]){var _0x5c37d7=path[_0x85db('0x19')](__dirname,_0x85db('0x1a'),_0x4d976d[_0x85db('0x17')][_0x85db('0x18')]);var _0x44c122=process[_0x85db('0x1b')]();process[_0x85db('0x1c')](path[_0x85db('0x1d')](_0x5c37d7));return execChildProcess()['then'](function(_0xfffea2){process[_0x85db('0x1c')](_0x44c122);return pm2[_0x85db('0x1e')]({'name':_0x4d976d[_0x85db('0x17')][_0x85db('0xa')],'script':_0x5c37d7});})[_0x85db('0xf')](function(_0x51c948){pm2[_0x85db('0x1f')]();return _0x51c948[0x0];})[_0x85db('0xf')](respondWithResult(_0x2bc9a4,0xc9))[_0x85db('0x13')](handleError(_0x2bc9a4,null));}else{return _0x2bc9a4['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x85db('0x20')]=function(_0x105bb9,_0x33448e){if(_0x105bb9['body']['id']){delete _0x105bb9[_0x85db('0x17')]['id'];}var _0xc2abb8={'online':_0x85db('0x21'),'stopped':'stop'};if(_0xc2abb8['hasOwnProperty'](_0x105bb9[_0x85db('0x17')][_0x85db('0x7')])){return pm2[_0xc2abb8[_0x105bb9[_0x85db('0x17')][_0x85db('0x7')]]](_0x105bb9[_0x85db('0x22')]['id'])[_0x85db('0xf')](respondWithResult(_0x33448e,0xc8))[_0x85db('0x13')](handleError(_0x33448e,null));}else{return _0x33448e[_0x85db('0x7')](0x1f4)[_0x85db('0xb')]({'message':_0x85db('0x23')});}};exports['destroy']=function(_0x4a15b9,_0x13ad98){if(_0x4a15b9['body']['id']){delete _0x4a15b9[_0x85db('0x17')]['id'];}if(_0x4a15b9[_0x85db('0x22')]['id']){return pm2['delete'](_0x4a15b9[_0x85db('0x22')]['id'])[_0x85db('0xf')](function(_0x38369f){pm2[_0x85db('0x1f')]();return _0x38369f[0x0];})['then'](respondWithResult(_0x13ad98,null))[_0x85db('0x13')](handleError(_0x13ad98,null));}else{return _0x13ad98[_0x85db('0x7')](0x1f4)[_0x85db('0xb')]({'message':_0x85db('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 1e6d8bb..fb5ed16 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 _0x8c6d=['exports','../../components/auth/service','/agents','isAuthenticated','getAgents','get','/queues','getQueues'];(function(_0x327ec0,_0x5f7e24){var _0x36892f=function(_0x456073){while(--_0x456073){_0x327ec0['push'](_0x327ec0['shift']());}};_0x36892f(++_0x5f7e24);}(_0x8c6d,0x1d9));var _0xd8c6=function(_0x4150a0,_0x43e9d9){_0x4150a0=_0x4150a0-0x0;var _0x55cdf7=_0x8c6d[_0x4150a0];return _0x55cdf7;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xd8c6('0x0'));var controller=require('./realtime.controller');router['get'](_0xd8c6('0x1'),auth[_0xd8c6('0x2')](),controller[_0xd8c6('0x3')]);router[_0xd8c6('0x4')](_0xd8c6('0x5'),auth[_0xd8c6('0x2')](),controller[_0xd8c6('0x6')]);module[_0xd8c6('0x7')]=router; \ No newline at end of file +var _0x3335=['getAgents','/queues','getQueues','Router','get','/agents'];(function(_0x40f99e,_0x4c3287){var _0x1f85ae=function(_0x4f835c){while(--_0x4f835c){_0x40f99e['push'](_0x40f99e['shift']());}};_0x1f85ae(++_0x4c3287);}(_0x3335,0x10b));var _0x5333=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x3335[_0x3de8a4];return _0x4635cf;};'use strict';var express=require('express');var router=express[_0x5333('0x0')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x5333('0x1')](_0x5333('0x2'),auth['isAuthenticated'](),controller[_0x5333('0x3')]);router[_0x5333('0x1')](_0x5333('0x4'),auth['isAuthenticated'](),controller[_0x5333('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index e696b35..371400a 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x2254f3,_0x36ed5c){var _0x2e3ec5=function(_0x1a2c51){while(--_0x1a2c51){_0x2254f3['push'](_0x2254f3['shift']());}};_0x2e3ec5(++_0x36ed5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file +var _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x3f111a,_0x1d3d7e){var _0x3be0e7=function(_0x1a0a5d){while(--_0x1a0a5d){_0x3f111a['push'](_0x3f111a['shift']());}};_0x3be0e7(++_0x1d3d7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index eb6041e..89562c7 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x245e0e,_0xcab6db){var _0xafcff4=function(_0x3ec00c){while(--_0x3ec00c){_0x245e0e['push'](_0x245e0e['shift']());}};_0xafcff4(++_0xcab6db);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x12b8d2,_0x10b159){var _0x404bd5=function(_0x22b3fb){while(--_0x22b3fb){_0x12b8d2['push'](_0x12b8d2['shift']());}};_0x404bd5(++_0x10b159);}(_0xe706,0xa3));var _0x6e70=function(_0x145eae,_0x2fc6a5){_0x145eae=_0x145eae-0x0;var _0x4c6a1f=_0xe706[_0x145eae];return _0x4c6a1f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 6c275e6..bfa2077 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 _0x6c7b=['DATE','INTEGER','STRING','sequelize'];(function(_0x2084e0,_0x2a50ee){var _0x22625b=function(_0x5c6f96){while(--_0x5c6f96){_0x2084e0['push'](_0x2084e0['shift']());}};_0x22625b(++_0x2a50ee);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x2cbdab,_0x3d0164){_0x2cbdab=_0x2cbdab-0x0;var _0x38ee3b=_0x6c7b[_0x2cbdab];return _0x38ee3b;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xb6c7('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb6c7('0x1')]},'responsetime':{'type':Sequelize[_0xb6c7('0x1')]},'ringtime':{'type':Sequelize[_0xb6c7('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb6c7('0x3')]},'membername':{'type':Sequelize[_0xb6c7('0x3')]}}; \ No newline at end of file +var _0x6596=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6596,0x1d3));var _0x6659=function(_0x242282,_0x431f68){_0x242282=_0x242282-0x0;var _0x33c912=_0x6596[_0x242282];return _0x33c912;};'use strict';var Sequelize=require(_0x6659('0x0'));module[_0x6659('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6659('0x2')]},'scheduledat':{'type':Sequelize[_0x6659('0x3')]},'uniqueid':{'type':Sequelize[_0x6659('0x2')]},'starttime':{'type':Sequelize[_0x6659('0x3')]},'responsetime':{'type':Sequelize[_0x6659('0x3')]},'ringtime':{'type':Sequelize[_0x6659('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6659('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index a3c2708..36c1b77 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 _0x7c52=['rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x528ae6,_0x3edab8){var _0x6bf3ae=function(_0x59aa51){while(--_0x59aa51){_0x528ae6['push'](_0x528ae6['shift']());}};_0x6bf3ae(++_0x3edab8);}(_0x7c52,0x1ce));var _0x27c5=function(_0x1da1a7,_0x1be937){_0x1da1a7=_0x1da1a7-0x0;var _0x460192=_0x7c52[_0x1da1a7];return _0x460192;};'use strict';var _=require(_0x27c5('0x0'));var util=require('util');var logger=require(_0x27c5('0x1'))(_0x27c5('0x2'));var moment=require(_0x27c5('0x3'));var BPromise=require(_0x27c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27c5('0x5'));var rimraf=require(_0x27c5('0x6'));var config=require(_0x27c5('0x7'));var attributes=require(_0x27c5('0x8'));module[_0x27c5('0x9')]=function(_0x2635a4,_0x5d5778){return _0x2635a4[_0x27c5('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x27c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe871=['moment','bluebird','path','../../config/environment','./reportAgentPreview.attributes','define','util','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe871,0x86));var _0x1e87=function(_0x73060b,_0x33c24f){_0x73060b=_0x73060b-0x0;var _0x5e5275=_0xe871[_0x73060b];return _0x5e5275;};'use strict';var _=require('lodash');var util=require(_0x1e87('0x0'));var logger=require(_0x1e87('0x1'))('api');var moment=require(_0x1e87('0x2'));var BPromise=require(_0x1e87('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e87('0x4'));var rimraf=require('rimraf');var config=require(_0x1e87('0x5'));var attributes=require(_0x1e87('0x6'));module['exports']=function(_0x26a877,_0x19795e){return _0x26a877[_0x1e87('0x7')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 19c2b73..3d52f2e 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 _0xe5c1=['message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1730eb,_0x1c37b0){var _0x1074f6=function(_0x31e53f){while(--_0x31e53f){_0x1730eb['push'](_0x1730eb['shift']());}};_0x1074f6(++_0x1c37b0);}(_0xe5c1,0x1e9));var _0x1e5c=function(_0x16e287,_0x1219d3){_0x16e287=_0x16e287-0x0;var _0x3c9430=_0xe5c1[_0x16e287];return _0x3c9430;};'use strict';var _=require(_0x1e5c('0x0'));var util=require(_0x1e5c('0x1'));var moment=require(_0x1e5c('0x2'));var BPromise=require(_0x1e5c('0x3'));var rs=require(_0x1e5c('0x4'));var fs=require('fs');var Redis=require(_0x1e5c('0x5'));var db=require(_0x1e5c('0x6'))['db'];var utils=require(_0x1e5c('0x7'));var logger=require(_0x1e5c('0x8'))(_0x1e5c('0x9'));var config=require(_0x1e5c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e5c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e89b5,_0x477c28,_0x58fc52){return new BPromise(function(_0x53dbfc,_0x4de9b6){return client[_0x1e5c('0xc')](_0x1e89b5,_0x58fc52)[_0x1e5c('0xd')](function(_0x10dbe5){logger[_0x1e5c('0xe')](_0x1e5c('0xf'),_0x477c28,'request\x20sent');logger[_0x1e5c('0x10')](_0x1e5c('0x11'),_0x477c28,_0x1e5c('0x12'),JSON[_0x1e5c('0x13')](_0x10dbe5));if(_0x10dbe5[_0x1e5c('0x14')]){if(_0x10dbe5[_0x1e5c('0x14')]['code']===0x1f4){logger[_0x1e5c('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x477c28,_0x10dbe5[_0x1e5c('0x14')][_0x1e5c('0x15')]);return _0x4de9b6(_0x10dbe5['error']['message']);}logger[_0x1e5c('0x14')](_0x1e5c('0xf'),_0x477c28,_0x10dbe5[_0x1e5c('0x14')][_0x1e5c('0x15')]);return _0x53dbfc(_0x10dbe5[_0x1e5c('0x14')]['message']);}else{logger[_0x1e5c('0xe')](_0x1e5c('0xf'),_0x477c28,_0x1e5c('0x12'));_0x53dbfc(_0x10dbe5[_0x1e5c('0x16')][_0x1e5c('0x15')]);}})[_0x1e5c('0x17')](function(_0x53a0cc){logger[_0x1e5c('0x14')](_0x1e5c('0xf'),_0x477c28,_0x53a0cc);_0x4de9b6(_0x53a0cc);});});}exports['CreateReportAgentPreview']=function(_0x1fbfe1){var _0x10b6c=this;return new Promise(function(_0x214a79,_0x124078){return db[_0x1e5c('0x18')][_0x1e5c('0x19')](_0x1fbfe1[_0x1e5c('0x1a')],{'raw':_0x1fbfe1[_0x1e5c('0x1b')]?_0x1fbfe1['options'][_0x1e5c('0x1c')]===undefined?!![]:![]:!![]})[_0x1e5c('0xd')](function(_0xdfeb29){logger[_0x1e5c('0xe')]('CreateReportAgentPreview',_0x1fbfe1);logger['debug'](_0x1e5c('0x1d'),_0x1fbfe1,JSON[_0x1e5c('0x13')](_0xdfeb29));_0x214a79(_0xdfeb29);})[_0x1e5c('0x17')](function(_0x58eba8){logger[_0x1e5c('0x14')]('CreateReportAgentPreview',_0x58eba8[_0x1e5c('0x15')],_0x1fbfe1);_0x124078(_0x10b6c['error'](0x1f4,_0x58eba8[_0x1e5c('0x15')]));});});}; \ No newline at end of file +var _0xf96d=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ReportAgentPreview','body','options','CreateReportAgentPreview','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2818b9,_0x2c1043){var _0x1f1462=function(_0xc728c){while(--_0xc728c){_0x2818b9['push'](_0x2818b9['shift']());}};_0x1f1462(++_0x2c1043);}(_0xf96d,0x1c9));var _0xdf96=function(_0x1c7092,_0x46063a){_0x1c7092=_0x1c7092-0x0;var _0x40e78e=_0xf96d[_0x1c7092];return _0x40e78e;};'use strict';var _=require(_0xdf96('0x0'));var util=require(_0xdf96('0x1'));var moment=require(_0xdf96('0x2'));var BPromise=require('bluebird');var rs=require(_0xdf96('0x3'));var fs=require('fs');var Redis=require(_0xdf96('0x4'));var db=require(_0xdf96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf96('0x6'))(_0xdf96('0x7'));var config=require('../../config/environment');var jayson=require(_0xdf96('0x8'));var client=jayson[_0xdf96('0x9')][_0xdf96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x222a46,_0x3fde5d,_0x166474){return new BPromise(function(_0x167441,_0x5d2547){return client['request'](_0x222a46,_0x166474)[_0xdf96('0xb')](function(_0x66c0a9){logger[_0xdf96('0xc')](_0xdf96('0xd'),_0x3fde5d,_0xdf96('0xe'));logger[_0xdf96('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3fde5d,'request\x20sent',JSON[_0xdf96('0x10')](_0x66c0a9));if(_0x66c0a9[_0xdf96('0x11')]){if(_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3fde5d,_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x13')]);return _0x5d2547(_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x13')]);}logger[_0xdf96('0x11')](_0xdf96('0xd'),_0x3fde5d,_0x66c0a9[_0xdf96('0x11')][_0xdf96('0x13')]);return _0x167441(_0x66c0a9['error']['message']);}else{logger[_0xdf96('0xc')](_0xdf96('0xd'),_0x3fde5d,_0xdf96('0xe'));_0x167441(_0x66c0a9[_0xdf96('0x14')][_0xdf96('0x13')]);}})['catch'](function(_0x39c1ee){logger[_0xdf96('0x11')](_0xdf96('0xd'),_0x3fde5d,_0x39c1ee);_0x5d2547(_0x39c1ee);});});}exports['CreateReportAgentPreview']=function(_0x47a60){var _0x391fd9=this;return new Promise(function(_0x374043,_0x2a0b69){return db[_0xdf96('0x15')]['create'](_0x47a60[_0xdf96('0x16')],{'raw':_0x47a60[_0xdf96('0x17')]?_0x47a60['options']['raw']===undefined?!![]:![]:!![]})[_0xdf96('0xb')](function(_0x32fd50){logger[_0xdf96('0xc')]('CreateReportAgentPreview',_0x47a60);logger[_0xdf96('0xf')](_0xdf96('0x18'),_0x47a60,JSON[_0xdf96('0x10')](_0x32fd50));_0x374043(_0x32fd50);})[_0xdf96('0x19')](function(_0x58b8a8){logger[_0xdf96('0x11')](_0xdf96('0x18'),_0x58b8a8[_0xdf96('0x13')],_0x47a60);_0x2a0b69(_0x391fd9[_0xdf96('0x11')](0x1f4,_0x58b8a8[_0xdf96('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1a6e372..62a8737 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 _0xd247=['/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd247,0x10e));var _0x7d24=function(_0x477fdb,_0x462b55){_0x477fdb=_0x477fdb-0x0;var _0x32beaf=_0xd247[_0x477fdb];return _0x32beaf;};'use strict';var multer=require(_0x7d24('0x0'));var util=require('util');var path=require(_0x7d24('0x1'));var express=require(_0x7d24('0x2'));var router=express[_0x7d24('0x3')]();var auth=require(_0x7d24('0x4'));var controller=require(_0x7d24('0x5'));router[_0x7d24('0x6')]('/voice/channels',auth['isAuthenticated'](),controller[_0x7d24('0x7')]);router[_0x7d24('0x6')](_0x7d24('0x8'),auth[_0x7d24('0x9')](),controller['voiceChannelMixMonitor']);router['get'](_0x7d24('0xa'),auth[_0x7d24('0x9')](),controller[_0x7d24('0xb')]);router[_0x7d24('0x6')]('/voice/queues',auth[_0x7d24('0x9')](),controller['voiceQueues']);router['get']('/chat/queues',auth['isAuthenticated'](),controller[_0x7d24('0xc')]);router['get']('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x7d24('0x6')](_0x7d24('0xd'),auth[_0x7d24('0x9')](),controller[_0x7d24('0xe')]);router[_0x7d24('0x6')](_0x7d24('0xf'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x10')]);router[_0x7d24('0x6')](_0x7d24('0x11'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x12')]);router[_0x7d24('0x6')](_0x7d24('0x13'),auth[_0x7d24('0x9')](),controller['whatsappQueues']);router[_0x7d24('0x6')](_0x7d24('0x14'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x15')]);router[_0x7d24('0x6')](_0x7d24('0x16'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x17')]);router[_0x7d24('0x6')](_0x7d24('0x18'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x19')]);router['get'](_0x7d24('0x1a'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x1b')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x7d24('0x9')](),controller['voiceQueuesChannelHangup']);router[_0x7d24('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x7d24('0x9')](),controller['voiceQueuesChannelRedirect']);router[_0x7d24('0x6')]('/voice/queues/:id',auth[_0x7d24('0x9')](),controller[_0x7d24('0x1c')]);router[_0x7d24('0x1d')](_0x7d24('0x1e'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x1f')]);router[_0x7d24('0x6')](_0x7d24('0x20'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x21')]);router[_0x7d24('0x6')]('/outbound/channels',auth[_0x7d24('0x9')](),controller['outboundChannels']);router[_0x7d24('0x6')]('/agents',auth['isAuthenticated'](),controller['agents']);router[_0x7d24('0x1d')]('/agents/:id/capacity',auth[_0x7d24('0x9')](),controller[_0x7d24('0x22')]);router['get'](_0x7d24('0x23'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x24')]);router[_0x7d24('0x6')]('/trunks',auth[_0x7d24('0x9')](),controller[_0x7d24('0x25')]);router[_0x7d24('0x6')](_0x7d24('0x26'),auth['isAuthenticated'](),controller[_0x7d24('0x27')]);router[_0x7d24('0x6')](_0x7d24('0x28'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x29')]);router[_0x7d24('0x6')](_0x7d24('0x2a'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x2b')]);router[_0x7d24('0x6')]('/mail/queues/waitinginteractions',auth[_0x7d24('0x9')](),controller['mailQueuesWaitingInteractions']);router[_0x7d24('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x7d24('0x9')](),controller[_0x7d24('0x2c')]);router[_0x7d24('0x6')](_0x7d24('0x2d'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x2e')]);router['get'](_0x7d24('0x2f'),auth[_0x7d24('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0x7d24('0x6')](_0x7d24('0x30'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x31')]);router['get'](_0x7d24('0x32'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x33')]);router[_0x7d24('0x34')](_0x7d24('0x35'),auth['isAuthenticated'](),controller[_0x7d24('0x36')](_0x7d24('0x37')));router[_0x7d24('0x6')]('/mail/queues/:id',auth[_0x7d24('0x9')](),controller[_0x7d24('0x38')]);router[_0x7d24('0x34')](_0x7d24('0x39'),auth[_0x7d24('0x9')](),controller['queueNotify']('chat'));router['get'](_0x7d24('0x3a'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x3b')]);router['post']('/fax/queues/:id/notify',auth[_0x7d24('0x9')](),controller['queueNotify'](_0x7d24('0x3c')));router[_0x7d24('0x6')](_0x7d24('0x3d'),auth[_0x7d24('0x9')](),controller['showFaxQueues']);router['post'](_0x7d24('0x3e'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x36')](_0x7d24('0x3f')));router[_0x7d24('0x6')](_0x7d24('0x40'),auth[_0x7d24('0x9')](),controller['showOpenchannelQueues']);router['post'](_0x7d24('0x41'),auth['isAuthenticated'](),controller[_0x7d24('0x36')]('sms'));router[_0x7d24('0x34')](_0x7d24('0x42'),auth[_0x7d24('0x9')](),controller['queueNotify'](_0x7d24('0x43')));router[_0x7d24('0x6')]('/sms/queues/:id',auth[_0x7d24('0x9')](),controller[_0x7d24('0x44')]);router['get']('/whatsapp/queues/:id',auth[_0x7d24('0x9')](),controller[_0x7d24('0x45')]);router[_0x7d24('0x34')](_0x7d24('0x46'),auth[_0x7d24('0x9')](),controller[_0x7d24('0x47')]);module[_0x7d24('0x48')]=router; \ No newline at end of file +var _0x51a6=['/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','post','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0x51a6,0x1ad));var _0x651a=function(_0x34c26b,_0x5e279b){_0x34c26b=_0x34c26b-0x0;var _0x2f9f58=_0x51a6[_0x34c26b];return _0x2f9f58;};'use strict';var multer=require(_0x651a('0x0'));var util=require(_0x651a('0x1'));var path=require(_0x651a('0x2'));var express=require(_0x651a('0x3'));var router=express[_0x651a('0x4')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x651a('0x5')](_0x651a('0x6'),auth[_0x651a('0x7')](),controller[_0x651a('0x8')]);router[_0x651a('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x651a('0x7')](),controller['voiceChannelMixMonitor']);router[_0x651a('0x5')](_0x651a('0x9'),auth['isAuthenticated'](),controller[_0x651a('0xa')]);router['get'](_0x651a('0xb'),auth[_0x651a('0x7')](),controller[_0x651a('0xc')]);router[_0x651a('0x5')](_0x651a('0xd'),auth[_0x651a('0x7')](),controller['chatQueues']);router[_0x651a('0x5')](_0x651a('0xe'),auth['isAuthenticated'](),controller[_0x651a('0xf')]);router['get'](_0x651a('0x10'),auth[_0x651a('0x7')](),controller[_0x651a('0x11')]);router[_0x651a('0x5')](_0x651a('0x12'),auth[_0x651a('0x7')](),controller['openchannelQueues']);router[_0x651a('0x5')](_0x651a('0x13'),auth[_0x651a('0x7')](),controller[_0x651a('0x14')]);router[_0x651a('0x5')](_0x651a('0x15'),auth['isAuthenticated'](),controller[_0x651a('0x16')]);router[_0x651a('0x5')]('/fax/queues',auth[_0x651a('0x7')](),controller[_0x651a('0x17')]);router[_0x651a('0x5')](_0x651a('0x18'),auth['isAuthenticated'](),controller[_0x651a('0x19')]);router[_0x651a('0x5')](_0x651a('0x1a'),auth[_0x651a('0x7')](),controller[_0x651a('0x1b')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x651a('0x1c')]);router[_0x651a('0x5')](_0x651a('0x1d'),auth[_0x651a('0x7')](),controller['voiceQueuesChannelHangup']);router['get'](_0x651a('0x1e'),auth[_0x651a('0x7')](),controller[_0x651a('0x1f')]);router[_0x651a('0x5')](_0x651a('0x20'),auth[_0x651a('0x7')](),controller[_0x651a('0x21')]);router[_0x651a('0x22')](_0x651a('0x20'),auth[_0x651a('0x7')](),controller[_0x651a('0x23')]);router[_0x651a('0x5')](_0x651a('0x24'),auth[_0x651a('0x7')](),controller[_0x651a('0x25')]);router['get'](_0x651a('0x26'),auth['isAuthenticated'](),controller[_0x651a('0x27')]);router[_0x651a('0x5')](_0x651a('0x28'),auth[_0x651a('0x7')](),controller[_0x651a('0x29')]);router[_0x651a('0x22')](_0x651a('0x2a'),auth[_0x651a('0x7')](),controller[_0x651a('0x2b')]);router[_0x651a('0x5')](_0x651a('0x2c'),auth[_0x651a('0x7')](),controller[_0x651a('0x2d')]);router[_0x651a('0x5')](_0x651a('0x2e'),auth[_0x651a('0x7')](),controller['trunks']);router['get'](_0x651a('0x2f'),auth[_0x651a('0x7')](),controller[_0x651a('0x30')]);router[_0x651a('0x5')](_0x651a('0x31'),auth[_0x651a('0x7')](),controller[_0x651a('0x32')]);router[_0x651a('0x5')](_0x651a('0x33'),auth[_0x651a('0x7')](),controller[_0x651a('0x34')]);router[_0x651a('0x5')](_0x651a('0x35'),auth[_0x651a('0x7')](),controller[_0x651a('0x36')]);router[_0x651a('0x5')](_0x651a('0x37'),auth[_0x651a('0x7')](),controller[_0x651a('0x38')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x651a('0x7')](),controller[_0x651a('0x39')]);router['get'](_0x651a('0x3a'),auth['isAuthenticated'](),controller[_0x651a('0x3b')]);router[_0x651a('0x5')](_0x651a('0x3c'),auth[_0x651a('0x7')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x651a('0x3d'),auth[_0x651a('0x7')](),controller[_0x651a('0x3e')]);router['post'](_0x651a('0x3f'),auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x41')));router['get']('/mail/queues/:id',auth[_0x651a('0x7')](),controller[_0x651a('0x42')]);router['post'](_0x651a('0x43'),auth['isAuthenticated'](),controller[_0x651a('0x40')]('chat'));router['get']('/chat/queues/:id',auth[_0x651a('0x7')](),controller['showChatQueues']);router[_0x651a('0x44')]('/fax/queues/:id/notify',auth[_0x651a('0x7')](),controller[_0x651a('0x40')]('fax'));router['get'](_0x651a('0x45'),auth[_0x651a('0x7')](),controller[_0x651a('0x46')]);router['post']('/openchannel/queues/:id/notify',auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x47')));router[_0x651a('0x5')](_0x651a('0x48'),auth[_0x651a('0x7')](),controller[_0x651a('0x49')]);router[_0x651a('0x44')]('/sms/queues/:id/notify',auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x4a')));router['post'](_0x651a('0x4b'),auth[_0x651a('0x7')](),controller[_0x651a('0x40')](_0x651a('0x4c')));router[_0x651a('0x5')](_0x651a('0x4d'),auth['isAuthenticated'](),controller[_0x651a('0x4e')]);router[_0x651a('0x5')](_0x651a('0x4f'),auth[_0x651a('0x7')](),controller[_0x651a('0x50')]);router[_0x651a('0x44')](_0x651a('0x51'),auth[_0x651a('0x7')](),controller[_0x651a('0x52')]);module[_0x651a('0x53')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index e042ebd..9501958 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 _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(_0x410501,_0x3d953c){var _0x338ba3=function(_0xffc0b0){while(--_0xffc0b0){_0x410501['push'](_0x410501['shift']());}};_0x338ba3(++_0x3d953c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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 +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x53019e,_0x10c61f){var _0x3dbc44=function(_0x449884){while(--_0x449884){_0x53019e['push'](_0x53019e['shift']());}};_0x3dbc44(++_0x10c61f);}(_0xe706,0xa3));var _0x6e70=function(_0x2aaec6,_0x291a6f){_0x2aaec6=_0x2aaec6-0x0;var _0x179e5b=_0xe706[_0x2aaec6];return _0x179e5b;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index ca860ee..759fd22 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 _0x7b66=['show','/:id/run','run','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','/:id','isAuthenticated'];(function(_0x4a83f4,_0x50f589){var _0x1fc810=function(_0xc651f9){while(--_0xc651f9){_0x4a83f4['push'](_0x4a83f4['shift']());}};_0x1fc810(++_0x50f589);}(_0x7b66,0x1d6));var _0x67b6=function(_0x3ab052,_0x46cb8e){_0x3ab052=_0x3ab052-0x0;var _0x2465be=_0x7b66[_0x3ab052];return _0x2465be;};'use strict';var multer=require(_0x67b6('0x0'));var util=require(_0x67b6('0x1'));var path=require(_0x67b6('0x2'));var timeout=require(_0x67b6('0x3'));var express=require(_0x67b6('0x4'));var router=express[_0x67b6('0x5')]();var fs_extra=require(_0x67b6('0x6'));var auth=require(_0x67b6('0x7'));var interaction=require(_0x67b6('0x8'));var config=require('../../config/environment');var controller=require(_0x67b6('0x9'));router[_0x67b6('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x67b6('0xa')](_0x67b6('0xb'),auth[_0x67b6('0xc')](),controller[_0x67b6('0xd')]);router[_0x67b6('0xa')](_0x67b6('0xe'),auth[_0x67b6('0xc')](),controller[_0x67b6('0xf')]);router[_0x67b6('0x10')]('/',auth[_0x67b6('0xc')](),controller[_0x67b6('0x11')]);router[_0x67b6('0x12')](_0x67b6('0xb'),auth['isAuthenticated'](),controller[_0x67b6('0x13')]);router['delete'](_0x67b6('0xb'),auth[_0x67b6('0xc')](),controller['destroy']);module[_0x67b6('0x14')]=router; \ No newline at end of file +var _0xb6fe=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','run','post','put'];(function(_0x1e6bdf,_0x2b8e95){var _0x327d8e=function(_0x95af53){while(--_0x95af53){_0x1e6bdf['push'](_0x1e6bdf['shift']());}};_0x327d8e(++_0x2b8e95);}(_0xb6fe,0x1dc));var _0xeb6f=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xb6fe[_0x382e89];return _0x3a1318;};'use strict';var multer=require(_0xeb6f('0x0'));var util=require(_0xeb6f('0x1'));var path=require(_0xeb6f('0x2'));var timeout=require(_0xeb6f('0x3'));var express=require(_0xeb6f('0x4'));var router=express[_0xeb6f('0x5')]();var fs_extra=require(_0xeb6f('0x6'));var auth=require(_0xeb6f('0x7'));var interaction=require(_0xeb6f('0x8'));var config=require(_0xeb6f('0x9'));var controller=require(_0xeb6f('0xa'));router[_0xeb6f('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb6f('0xb')](_0xeb6f('0xc'),auth[_0xeb6f('0xd')](),controller[_0xeb6f('0xe')]);router['get']('/:id/run',auth[_0xeb6f('0xd')](),controller[_0xeb6f('0xf')]);router[_0xeb6f('0x10')]('/',auth[_0xeb6f('0xd')](),controller['create']);router[_0xeb6f('0x11')](_0xeb6f('0xc'),auth[_0xeb6f('0xd')](),controller['update']);router['delete'](_0xeb6f('0xc'),auth[_0xeb6f('0xd')](),controller[_0xeb6f('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 83ebe0b..31e02f1 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 _0x33d7=['sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','csv','pdf','xlsx','custom','TEXT'];(function(_0x563546,_0x1a3d50){var _0x2c8e5f=function(_0x3cbda2){while(--_0x3cbda2){_0x563546['push'](_0x563546['shift']());}};_0x2c8e5f(++_0x1a3d50);}(_0x33d7,0x154));var _0x733d=function(_0x3ee6d9,_0x3f88b0){_0x3ee6d9=_0x3ee6d9-0x0;var _0x1aef96=_0x33d7[_0x3ee6d9];return _0x1aef96;};'use strict';var Sequelize=require(_0x733d('0x0'));module[_0x733d('0x1')]={'name':{'type':Sequelize[_0x733d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x733d('0x2')]},'active':{'type':Sequelize[_0x733d('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x733d('0x4')},'startAt':{'type':Sequelize[_0x733d('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x733d('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x733d('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x733d('0x7')](_0x733d('0x8'),_0x733d('0x9'),'months',_0x733d('0xa'),_0x733d('0xb'),'hours','minutes'),'allowNull':![],'defaultValue':_0x733d('0xb')},'output':{'type':Sequelize['ENUM'](_0x733d('0xc'),_0x733d('0xd'),_0x733d('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x733d('0xf'),'default'),'allowNull':![],'defaultValue':_0x733d('0xf')},'sendMail':{'type':Sequelize[_0x733d('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x733d('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x733d('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x733d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x8535=['pdf','custom','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','csv'];(function(_0x58772f,_0x1df712){var _0x296f87=function(_0x7ac19a){while(--_0x7ac19a){_0x58772f['push'](_0x58772f['shift']());}};_0x296f87(++_0x1df712);}(_0x8535,0x114));var _0x5853=function(_0x36f4f0,_0x3a822f){_0x36f4f0=_0x36f4f0-0x0;var _0x3066df=_0x8535[_0x36f4f0];return _0x3066df;};'use strict';var Sequelize=require('sequelize');module[_0x5853('0x0')]={'name':{'type':Sequelize[_0x5853('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5853('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5853('0x1')],'allowNull':![],'defaultValue':_0x5853('0x2')},'startAt':{'type':Sequelize[_0x5853('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x5853('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5853('0x5')]('years',_0x5853('0x6'),_0x5853('0x7'),_0x5853('0x8'),_0x5853('0x9'),_0x5853('0xa'),'minutes'),'allowNull':![],'defaultValue':_0x5853('0x9')},'output':{'type':Sequelize[_0x5853('0x5')](_0x5853('0xb'),_0x5853('0xc'),'xlsx'),'allowNull':![],'defaultValue':_0x5853('0xb')},'type':{'type':Sequelize[_0x5853('0x5')](_0x5853('0xd'),'default'),'allowNull':![],'defaultValue':_0x5853('0xd')},'sendMail':{'type':Sequelize[_0x5853('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x5853('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x5853('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index b0ab3b9..d720d78 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 _0xdf94=['then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','Schedule','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0xc864d,_0x3443f2){var _0x4a1305=function(_0x162dd6){while(--_0x162dd6){_0xc864d['push'](_0xc864d['shift']());}};_0x4a1305(++_0x3443f2);}(_0xdf94,0x1d7));var _0x4df9=function(_0x5d44f8,_0x13d6ef){_0x5d44f8=_0x5d44f8-0x0;var _0xdc41ae=_0xdf94[_0x5d44f8];return _0xdc41ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4df9('0x0'));var zipdir=require(_0x4df9('0x1'));var jsonpatch=require(_0x4df9('0x2'));var rp=require(_0x4df9('0x3'));var moment=require(_0x4df9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4df9('0x5'));var util=require(_0x4df9('0x6'));var path=require(_0x4df9('0x7'));var sox=require('sox');var csv=require(_0x4df9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4df9('0x9'));var crypto=require(_0x4df9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4df9('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4df9('0xc'));var Papa=require(_0x4df9('0xd'));var Redis=require(_0x4df9('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4df9('0xf'));var hardwareService=require(_0x4df9('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4df9('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4df9('0x12'));var db=require(_0x4df9('0x13'))['db'];function respondWithStatusCode(_0x50957f,_0x2d1fc2){_0x2d1fc2=_0x2d1fc2||0xcc;return function(_0x22dd23){if(_0x22dd23){return _0x50957f[_0x4df9('0x14')](_0x2d1fc2);}return _0x50957f[_0x4df9('0x15')](_0x2d1fc2)['end']();};}function respondWithResult(_0x277796,_0x53fed1){_0x53fed1=_0x53fed1||0xc8;return function(_0x11249a){if(_0x11249a){return _0x277796['status'](_0x53fed1)[_0x4df9('0x16')](_0x11249a);}};}function respondWithFilteredResult(_0xf851a4,_0x36a194){return function(_0x8efcbd){if(_0x8efcbd){var _0x213899=typeof _0x36a194[_0x4df9('0x17')]===_0x4df9('0x18')&&typeof _0x36a194['limit']===_0x4df9('0x18');var _0x3a4b37=_0x8efcbd[_0x4df9('0x19')];var _0x2b2fe3=_0x213899?0x0:_0x36a194[_0x4df9('0x17')];var _0x468ec4=_0x213899?_0x8efcbd[_0x4df9('0x19')]:_0x36a194[_0x4df9('0x17')]+_0x36a194[_0x4df9('0x1a')];var _0x335c93;if(_0x468ec4>=_0x3a4b37){_0x468ec4=_0x3a4b37;_0x335c93=0xc8;}else{_0x335c93=0xce;}_0xf851a4[_0x4df9('0x15')](_0x335c93);return _0xf851a4[_0x4df9('0x1b')](_0x4df9('0x1c'),_0x2b2fe3+'-'+_0x468ec4+'/'+_0x3a4b37)[_0x4df9('0x16')](_0x8efcbd);}return null;};}function patchUpdates(_0x18dcb1){return function(_0x388246){try{jsonpatch[_0x4df9('0x1d')](_0x388246,_0x18dcb1,!![]);}catch(_0x66ea1){return BPromise[_0x4df9('0x1e')](_0x66ea1);}return _0x388246[_0x4df9('0x1f')]();};}function saveUpdates(_0x2225da,_0x2aea3a){return function(_0x2b8812){if(_0x2b8812){return _0x2b8812[_0x4df9('0x20')](_0x2225da)[_0x4df9('0x21')](function(_0x575241){return _0x575241;});}return null;};}function removeEntity(_0x5fd917,_0x5d3488){return function(_0x55e50f){if(_0x55e50f){return _0x55e50f[_0x4df9('0x22')]()['then'](function(){var _0x24ab3d=_0x55e50f[_0x4df9('0x23')]({'plain':!![]});var _0x1ae429=_0x4df9('0x24');return db[_0x4df9('0x25')][_0x4df9('0x22')]({'where':{'type':_0x1ae429,'resourceId':_0x24ab3d['id']}})[_0x4df9('0x21')](function(){return _0x55e50f;});})[_0x4df9('0x21')](function(){_0x5fd917[_0x4df9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50bd4e,_0x1f346d){return function(_0x5996c0){if(!_0x5996c0){_0x50bd4e[_0x4df9('0x14')](0x194);}return _0x5996c0;};}function handleError(_0x27df48,_0x4438dd){_0x4438dd=_0x4438dd||0x1f4;return function(_0xa4d8c9){logger['error'](_0xa4d8c9[_0x4df9('0x26')]);if(_0xa4d8c9['name']){delete _0xa4d8c9[_0x4df9('0x27')];}_0x27df48[_0x4df9('0x15')](_0x4438dd)[_0x4df9('0x28')](_0xa4d8c9);};}exports[_0x4df9('0x29')]=function(_0x461c6b,_0x508643){var _0x1166a6={},_0x2ac13a={},_0x5afbcf={'count':0x0,'rows':[]};var _0x42d80e=_['map'](db[_0x4df9('0x2a')][_0x4df9('0x2b')],function(_0x5e6482){return{'name':_0x5e6482[_0x4df9('0x2c')],'type':_0x5e6482[_0x4df9('0x2d')]['key']};});_0x2ac13a[_0x4df9('0x2e')]=_[_0x4df9('0x2f')](_0x42d80e,_0x4df9('0x27'));_0x2ac13a['query']=_['keys'](_0x461c6b[_0x4df9('0x30')]);_0x2ac13a[_0x4df9('0x31')]=_[_0x4df9('0x32')](_0x2ac13a['model'],_0x2ac13a[_0x4df9('0x30')]);_0x1166a6[_0x4df9('0x33')]=_[_0x4df9('0x32')](_0x2ac13a[_0x4df9('0x2e')],qs['fields'](_0x461c6b[_0x4df9('0x30')][_0x4df9('0x34')]));_0x1166a6['attributes']=_0x1166a6[_0x4df9('0x33')][_0x4df9('0x35')]?_0x1166a6[_0x4df9('0x33')]:_0x2ac13a[_0x4df9('0x2e')];if(!_0x461c6b[_0x4df9('0x30')][_0x4df9('0x36')](_0x4df9('0x37'))){_0x1166a6[_0x4df9('0x1a')]=qs[_0x4df9('0x1a')](_0x461c6b[_0x4df9('0x30')][_0x4df9('0x1a')]);_0x1166a6['offset']=qs[_0x4df9('0x17')](_0x461c6b[_0x4df9('0x30')][_0x4df9('0x17')]);}_0x1166a6[_0x4df9('0x38')]=qs[_0x4df9('0x39')](_0x461c6b['query']['sort']);_0x1166a6[_0x4df9('0x3a')]=qs['filters'](_[_0x4df9('0x3b')](_0x461c6b[_0x4df9('0x30')],_0x2ac13a['filters']),_0x42d80e);if(_0x461c6b['query'][_0x4df9('0x3c')]){_0x1166a6[_0x4df9('0x3a')]=_['merge'](_0x1166a6[_0x4df9('0x3a')],{'$or':_[_0x4df9('0x2f')](_0x42d80e,function(_0x21901a){if(_0x21901a[_0x4df9('0x2d')]!==_0x4df9('0x3d')){var _0x1609b8={};_0x1609b8[_0x21901a[_0x4df9('0x27')]]={'$like':'%'+_0x461c6b[_0x4df9('0x30')][_0x4df9('0x3c')]+'%'};return _0x1609b8;}})});}_0x1166a6=_[_0x4df9('0x3e')]({},_0x1166a6,_0x461c6b[_0x4df9('0x3f')]);var _0x5d9cea={'where':_0x1166a6[_0x4df9('0x3a')]};return db['Schedule'][_0x4df9('0x19')](_0x5d9cea)[_0x4df9('0x21')](function(_0x1b3066){_0x5afbcf[_0x4df9('0x19')]=_0x1b3066;if(_0x461c6b[_0x4df9('0x30')][_0x4df9('0x40')]){_0x1166a6['include']=[{'all':!![]}];}return db[_0x4df9('0x2a')][_0x4df9('0x41')](_0x1166a6);})['then'](function(_0x11ba31){_0x5afbcf[_0x4df9('0x42')]=_0x11ba31;return _0x5afbcf;})[_0x4df9('0x21')](respondWithFilteredResult(_0x508643,_0x1166a6))[_0x4df9('0x43')](handleError(_0x508643,null));};exports[_0x4df9('0x44')]=function(_0x7f7216,_0x4eb1b3){var _0x1c7de2={'raw':![],'where':{'id':_0x7f7216[_0x4df9('0x45')]['id']}},_0x5b74cb={};_0x5b74cb[_0x4df9('0x2e')]=_[_0x4df9('0x46')](db[_0x4df9('0x2a')][_0x4df9('0x2b')]);_0x5b74cb[_0x4df9('0x30')]=_[_0x4df9('0x46')](_0x7f7216[_0x4df9('0x30')]);_0x5b74cb['filters']=_[_0x4df9('0x32')](_0x5b74cb[_0x4df9('0x2e')],_0x5b74cb[_0x4df9('0x30')]);_0x1c7de2[_0x4df9('0x33')]=_['intersection'](_0x5b74cb[_0x4df9('0x2e')],qs[_0x4df9('0x34')](_0x7f7216[_0x4df9('0x30')][_0x4df9('0x34')]));_0x1c7de2[_0x4df9('0x33')]=_0x1c7de2[_0x4df9('0x33')][_0x4df9('0x35')]?_0x1c7de2[_0x4df9('0x33')]:_0x5b74cb[_0x4df9('0x2e')];if(_0x7f7216[_0x4df9('0x30')][_0x4df9('0x40')]){_0x1c7de2[_0x4df9('0x47')]=[{'all':!![]}];}_0x1c7de2=_[_0x4df9('0x3e')]({},_0x1c7de2,_0x7f7216[_0x4df9('0x3f')]);return db[_0x4df9('0x2a')][_0x4df9('0x48')](_0x1c7de2)[_0x4df9('0x21')](handleEntityNotFound(_0x4eb1b3,null))[_0x4df9('0x21')](respondWithResult(_0x4eb1b3,null))[_0x4df9('0x43')](handleError(_0x4eb1b3,null));};exports[_0x4df9('0x49')]=function(_0x539896,_0x4640fc){return db[_0x4df9('0x2a')][_0x4df9('0x49')](_0x539896[_0x4df9('0x4a')],{})[_0x4df9('0x21')](function(_0x1c9bf0){var _0x2fc290=_0x539896['user'][_0x4df9('0x23')]({'plain':!![]});if(!_0x2fc290)throw new Error(_0x4df9('0x4b'));if(_0x2fc290[_0x4df9('0x4c')]===_0x4df9('0x4d')){var _0x24229c=_0x1c9bf0['get']({'plain':!![]});var _0x789475=_0x4df9('0x24');return db[_0x4df9('0x4e')][_0x4df9('0x48')]({'where':{'name':_0x789475,'userProfileId':_0x2fc290[_0x4df9('0x4f')]},'raw':!![]})[_0x4df9('0x21')](function(_0x217d84){if(_0x217d84&&_0x217d84[_0x4df9('0x50')]===0x0){return db['UserProfileResource'][_0x4df9('0x49')]({'name':_0x24229c[_0x4df9('0x27')],'resourceId':_0x24229c['id'],'type':_0x217d84[_0x4df9('0x27')],'sectionId':_0x217d84['id']},{})[_0x4df9('0x21')](function(){return _0x1c9bf0;});}else{return _0x1c9bf0;}})[_0x4df9('0x43')](function(_0x5d1775){logger[_0x4df9('0x51')](_0x4df9('0x52'),_0x5d1775);throw _0x5d1775;});}return _0x1c9bf0;})['then'](respondWithResult(_0x4640fc,0xc9))[_0x4df9('0x43')](handleError(_0x4640fc,null));};exports[_0x4df9('0x20')]=function(_0x38f233,_0x7a65f0){if(_0x38f233['body']['id']){delete _0x38f233[_0x4df9('0x4a')]['id'];}return db[_0x4df9('0x2a')][_0x4df9('0x48')]({'where':{'id':_0x38f233[_0x4df9('0x45')]['id']}})[_0x4df9('0x21')](handleEntityNotFound(_0x7a65f0,null))['then'](saveUpdates(_0x38f233[_0x4df9('0x4a')],null))[_0x4df9('0x21')](respondWithResult(_0x7a65f0,null))[_0x4df9('0x43')](handleError(_0x7a65f0,null));};exports[_0x4df9('0x22')]=function(_0x6343ce,_0x14c8b9){return db[_0x4df9('0x2a')][_0x4df9('0x48')]({'where':{'id':_0x6343ce['params']['id']}})[_0x4df9('0x21')](handleEntityNotFound(_0x14c8b9,null))[_0x4df9('0x21')](removeEntity(_0x14c8b9,null))[_0x4df9('0x43')](handleError(_0x14c8b9,null));};exports['run']=function(_0x5e07d8,_0x58d9f4,_0x1e0cb7){var _0x3a83fa=require(_0x4df9('0x53'));return db[_0x4df9('0x2a')]['find']({'where':{'id':_0x5e07d8[_0x4df9('0x45')]['id']},'raw':!![]})[_0x4df9('0x21')](handleEntityNotFound(_0x58d9f4,null))['then'](function(){_0x3a83fa['run'](_0x5e07d8['params']['id']);})['then'](respondWithStatusCode(_0x58d9f4,null))['catch'](handleError(_0x58d9f4,null));}; \ No newline at end of file +var _0xcf76=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','get','Scheduler','UserProfileResource','then','stack','name','index','Schedule','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x3ee6d4,_0x44243f){var _0x377e7c=function(_0x51deb3){while(--_0x51deb3){_0x3ee6d4['push'](_0x3ee6d4['shift']());}};_0x377e7c(++_0x44243f);}(_0xcf76,0xff));var _0x6cf7=function(_0x4d8734,_0x4817bb){_0x4d8734=_0x4d8734-0x0;var _0x4a9e6d=_0xcf76[_0x4d8734];return _0x4a9e6d;};'use strict';var emlformat=require(_0x6cf7('0x0'));var rimraf=require(_0x6cf7('0x1'));var zipdir=require(_0x6cf7('0x2'));var jsonpatch=require(_0x6cf7('0x3'));var rp=require('request-promise');var moment=require(_0x6cf7('0x4'));var BPromise=require(_0x6cf7('0x5'));var Mustache=require(_0x6cf7('0x6'));var util=require(_0x6cf7('0x7'));var path=require(_0x6cf7('0x8'));var sox=require(_0x6cf7('0x9'));var csv=require(_0x6cf7('0xa'));var ejs=require(_0x6cf7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cf7('0xc'));var squel=require(_0x6cf7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6cf7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6cf7('0xa'));var querystring=require(_0x6cf7('0xf'));var Papa=require(_0x6cf7('0x10'));var Redis=require('ioredis');var authService=require(_0x6cf7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6cf7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6cf7('0x13'));var utils=require(_0x6cf7('0x14'));var config=require(_0x6cf7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6cf7('0x16'))['db'];function respondWithStatusCode(_0x49f316,_0x1d21f9){_0x1d21f9=_0x1d21f9||0xcc;return function(_0x101f97){if(_0x101f97){return _0x49f316[_0x6cf7('0x17')](_0x1d21f9);}return _0x49f316[_0x6cf7('0x18')](_0x1d21f9)[_0x6cf7('0x19')]();};}function respondWithResult(_0x5bad31,_0x4382e2){_0x4382e2=_0x4382e2||0xc8;return function(_0x296477){if(_0x296477){return _0x5bad31['status'](_0x4382e2)[_0x6cf7('0x1a')](_0x296477);}};}function respondWithFilteredResult(_0x3e5607,_0x3dda46){return function(_0x5c2e50){if(_0x5c2e50){var _0x227dc8=typeof _0x3dda46[_0x6cf7('0x1b')]===_0x6cf7('0x1c')&&typeof _0x3dda46[_0x6cf7('0x1d')]===_0x6cf7('0x1c');var _0x225b51=_0x5c2e50[_0x6cf7('0x1e')];var _0x27e3c8=_0x227dc8?0x0:_0x3dda46[_0x6cf7('0x1b')];var _0x527d5a=_0x227dc8?_0x5c2e50[_0x6cf7('0x1e')]:_0x3dda46['offset']+_0x3dda46[_0x6cf7('0x1d')];var _0x9429c0;if(_0x527d5a>=_0x225b51){_0x527d5a=_0x225b51;_0x9429c0=0xc8;}else{_0x9429c0=0xce;}_0x3e5607['status'](_0x9429c0);return _0x3e5607['set']('Content-Range',_0x27e3c8+'-'+_0x527d5a+'/'+_0x225b51)['json'](_0x5c2e50);}return null;};}function patchUpdates(_0x5df7e0){return function(_0x9b3b17){try{jsonpatch[_0x6cf7('0x1f')](_0x9b3b17,_0x5df7e0,!![]);}catch(_0xcfb5ce){return BPromise[_0x6cf7('0x20')](_0xcfb5ce);}return _0x9b3b17[_0x6cf7('0x21')]();};}function saveUpdates(_0x2d6328,_0x3ffa3b){return function(_0x1819a1){if(_0x1819a1){return _0x1819a1[_0x6cf7('0x22')](_0x2d6328)['then'](function(_0x2761cd){return _0x2761cd;});}return null;};}function removeEntity(_0x23c8cc,_0x19015f){return function(_0x17ad12){if(_0x17ad12){return _0x17ad12['destroy']()['then'](function(){var _0x1bd215=_0x17ad12[_0x6cf7('0x23')]({'plain':!![]});var _0x46eee1=_0x6cf7('0x24');return db[_0x6cf7('0x25')]['destroy']({'where':{'type':_0x46eee1,'resourceId':_0x1bd215['id']}})['then'](function(){return _0x17ad12;});})[_0x6cf7('0x26')](function(){_0x23c8cc['status'](0xcc)[_0x6cf7('0x19')]();});}};}function handleEntityNotFound(_0x3718ff,_0x28dcff){return function(_0x447e62){if(!_0x447e62){_0x3718ff[_0x6cf7('0x17')](0x194);}return _0x447e62;};}function handleError(_0x11615d,_0x205f9f){_0x205f9f=_0x205f9f||0x1f4;return function(_0x28717e){logger['error'](_0x28717e[_0x6cf7('0x27')]);if(_0x28717e[_0x6cf7('0x28')]){delete _0x28717e[_0x6cf7('0x28')];}_0x11615d['status'](_0x205f9f)['send'](_0x28717e);};}exports[_0x6cf7('0x29')]=function(_0x5e685d,_0xfbd1fc){var _0x188132={},_0x343bc6={},_0x1f8d8e={'count':0x0,'rows':[]};var _0x353f9b=_['map'](db[_0x6cf7('0x2a')]['rawAttributes'],function(_0x8df79c){return{'name':_0x8df79c[_0x6cf7('0x2b')],'type':_0x8df79c[_0x6cf7('0x2c')][_0x6cf7('0x2d')]};});_0x343bc6[_0x6cf7('0x2e')]=_[_0x6cf7('0x2f')](_0x353f9b,_0x6cf7('0x28'));_0x343bc6[_0x6cf7('0x30')]=_[_0x6cf7('0x31')](_0x5e685d[_0x6cf7('0x30')]);_0x343bc6[_0x6cf7('0x32')]=_[_0x6cf7('0x33')](_0x343bc6[_0x6cf7('0x2e')],_0x343bc6[_0x6cf7('0x30')]);_0x188132[_0x6cf7('0x34')]=_[_0x6cf7('0x33')](_0x343bc6[_0x6cf7('0x2e')],qs[_0x6cf7('0x35')](_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x35')]));_0x188132[_0x6cf7('0x34')]=_0x188132[_0x6cf7('0x34')][_0x6cf7('0x36')]?_0x188132['attributes']:_0x343bc6[_0x6cf7('0x2e')];if(!_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x37')](_0x6cf7('0x38'))){_0x188132[_0x6cf7('0x1d')]=qs[_0x6cf7('0x1d')](_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x1d')]);_0x188132['offset']=qs[_0x6cf7('0x1b')](_0x5e685d['query']['offset']);}_0x188132[_0x6cf7('0x39')]=qs[_0x6cf7('0x3a')](_0x5e685d[_0x6cf7('0x30')]['sort']);_0x188132[_0x6cf7('0x3b')]=qs[_0x6cf7('0x32')](_['pick'](_0x5e685d[_0x6cf7('0x30')],_0x343bc6[_0x6cf7('0x32')]),_0x353f9b);if(_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x3c')]){_0x188132[_0x6cf7('0x3b')]=_['merge'](_0x188132[_0x6cf7('0x3b')],{'$or':_[_0x6cf7('0x2f')](_0x353f9b,function(_0x479cac){if(_0x479cac[_0x6cf7('0x2c')]!==_0x6cf7('0x3d')){var _0x439b7c={};_0x439b7c[_0x479cac[_0x6cf7('0x28')]]={'$like':'%'+_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x3c')]+'%'};return _0x439b7c;}})});}_0x188132=_[_0x6cf7('0x3e')]({},_0x188132,_0x5e685d['options']);var _0x2a76f1={'where':_0x188132[_0x6cf7('0x3b')]};return db[_0x6cf7('0x2a')]['count'](_0x2a76f1)[_0x6cf7('0x26')](function(_0x58e812){_0x1f8d8e[_0x6cf7('0x1e')]=_0x58e812;if(_0x5e685d[_0x6cf7('0x30')][_0x6cf7('0x3f')]){_0x188132[_0x6cf7('0x40')]=[{'all':!![]}];}return db[_0x6cf7('0x2a')][_0x6cf7('0x41')](_0x188132);})[_0x6cf7('0x26')](function(_0xe970b4){_0x1f8d8e[_0x6cf7('0x42')]=_0xe970b4;return _0x1f8d8e;})[_0x6cf7('0x26')](respondWithFilteredResult(_0xfbd1fc,_0x188132))[_0x6cf7('0x43')](handleError(_0xfbd1fc,null));};exports['show']=function(_0x5d152e,_0x394062){var _0x4df61e={'raw':![],'where':{'id':_0x5d152e[_0x6cf7('0x44')]['id']}},_0x25633e={};_0x25633e[_0x6cf7('0x2e')]=_['keys'](db[_0x6cf7('0x2a')][_0x6cf7('0x45')]);_0x25633e[_0x6cf7('0x30')]=_[_0x6cf7('0x31')](_0x5d152e[_0x6cf7('0x30')]);_0x25633e[_0x6cf7('0x32')]=_[_0x6cf7('0x33')](_0x25633e[_0x6cf7('0x2e')],_0x25633e[_0x6cf7('0x30')]);_0x4df61e[_0x6cf7('0x34')]=_[_0x6cf7('0x33')](_0x25633e[_0x6cf7('0x2e')],qs['fields'](_0x5d152e['query'][_0x6cf7('0x35')]));_0x4df61e[_0x6cf7('0x34')]=_0x4df61e[_0x6cf7('0x34')]['length']?_0x4df61e[_0x6cf7('0x34')]:_0x25633e[_0x6cf7('0x2e')];if(_0x5d152e[_0x6cf7('0x30')][_0x6cf7('0x3f')]){_0x4df61e['include']=[{'all':!![]}];}_0x4df61e=_[_0x6cf7('0x3e')]({},_0x4df61e,_0x5d152e[_0x6cf7('0x46')]);return db[_0x6cf7('0x2a')][_0x6cf7('0x47')](_0x4df61e)[_0x6cf7('0x26')](handleEntityNotFound(_0x394062,null))['then'](respondWithResult(_0x394062,null))[_0x6cf7('0x43')](handleError(_0x394062,null));};exports[_0x6cf7('0x48')]=function(_0x4b5388,_0x2a2e83){return db[_0x6cf7('0x2a')][_0x6cf7('0x48')](_0x4b5388['body'],{})[_0x6cf7('0x26')](function(_0x101dce){var _0x4de190=_0x4b5388[_0x6cf7('0x49')][_0x6cf7('0x23')]({'plain':!![]});if(!_0x4de190)throw new Error(_0x6cf7('0x4a'));if(_0x4de190['role']==='user'){var _0x3b0a84=_0x101dce[_0x6cf7('0x23')]({'plain':!![]});var _0x6eb9cd=_0x6cf7('0x24');return db[_0x6cf7('0x4b')][_0x6cf7('0x47')]({'where':{'name':_0x6eb9cd,'userProfileId':_0x4de190[_0x6cf7('0x4c')]},'raw':!![]})[_0x6cf7('0x26')](function(_0x2008d2){if(_0x2008d2&&_0x2008d2['autoAssociation']===0x0){return db['UserProfileResource'][_0x6cf7('0x48')]({'name':_0x3b0a84['name'],'resourceId':_0x3b0a84['id'],'type':_0x2008d2[_0x6cf7('0x28')],'sectionId':_0x2008d2['id']},{})[_0x6cf7('0x26')](function(){return _0x101dce;});}else{return _0x101dce;}})['catch'](function(_0x58f986){logger[_0x6cf7('0x4d')](_0x6cf7('0x4e'),_0x58f986);throw _0x58f986;});}return _0x101dce;})[_0x6cf7('0x26')](respondWithResult(_0x2a2e83,0xc9))[_0x6cf7('0x43')](handleError(_0x2a2e83,null));};exports[_0x6cf7('0x22')]=function(_0x127275,_0x268f54){if(_0x127275[_0x6cf7('0x4f')]['id']){delete _0x127275[_0x6cf7('0x4f')]['id'];}return db[_0x6cf7('0x2a')][_0x6cf7('0x47')]({'where':{'id':_0x127275[_0x6cf7('0x44')]['id']}})[_0x6cf7('0x26')](handleEntityNotFound(_0x268f54,null))[_0x6cf7('0x26')](saveUpdates(_0x127275[_0x6cf7('0x4f')],null))[_0x6cf7('0x26')](respondWithResult(_0x268f54,null))[_0x6cf7('0x43')](handleError(_0x268f54,null));};exports[_0x6cf7('0x50')]=function(_0x2665a5,_0x17468d){return db[_0x6cf7('0x2a')][_0x6cf7('0x47')]({'where':{'id':_0x2665a5['params']['id']}})[_0x6cf7('0x26')](handleEntityNotFound(_0x17468d,null))[_0x6cf7('0x26')](removeEntity(_0x17468d,null))['catch'](handleError(_0x17468d,null));};exports[_0x6cf7('0x51')]=function(_0x29a0ca,_0x5494e1,_0x31b67c){var _0x5d1810=require(_0x6cf7('0x52'));return db[_0x6cf7('0x2a')][_0x6cf7('0x47')]({'where':{'id':_0x29a0ca[_0x6cf7('0x44')]['id']},'raw':!![]})[_0x6cf7('0x26')](handleEntityNotFound(_0x5494e1,null))[_0x6cf7('0x26')](function(){_0x5d1810[_0x6cf7('0x51')](_0x29a0ca[_0x6cf7('0x44')]['id']);})[_0x6cf7('0x26')](respondWithStatusCode(_0x5494e1,null))[_0x6cf7('0x43')](handleError(_0x5494e1,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c3503e3..c32283d 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 _0x8ef2=['path','define','Schedule','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8ef2,0x1ab));var _0x28ef=function(_0x10b757,_0x3cf7ca){_0x10b757=_0x10b757-0x0;var _0x5fffd2=_0x8ef2[_0x10b757];return _0x5fffd2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x28ef('0x0'))(_0x28ef('0x1'));var moment=require(_0x28ef('0x2'));var BPromise=require(_0x28ef('0x3'));var rp=require(_0x28ef('0x4'));var fs=require('fs');var path=require(_0x28ef('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./schedule.attributes');module['exports']=function(_0x244f6d,_0xec264d){return _0x244f6d[_0x28ef('0x6')](_0x28ef('0x7'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e70=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5e70,0x1df));var _0x05e7=function(_0x18afd7,_0x2bb7c3){_0x18afd7=_0x18afd7-0x0;var _0x4d212a=_0x5e70[_0x18afd7];return _0x4d212a;};'use strict';var _=require(_0x05e7('0x0'));var util=require(_0x05e7('0x1'));var logger=require(_0x05e7('0x2'))('api');var moment=require(_0x05e7('0x3'));var BPromise=require(_0x05e7('0x4'));var rp=require(_0x05e7('0x5'));var fs=require('fs');var path=require(_0x05e7('0x6'));var rimraf=require('rimraf');var config=require(_0x05e7('0x7'));var attributes=require(_0x05e7('0x8'));module['exports']=function(_0x5eecf1,_0x5cd47f){return _0x5eecf1[_0x05e7('0x9')](_0x05e7('0xa'),attributes,{'tableName':_0x05e7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 603640f..8919076 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 _0xa18a=['debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x211e6d,_0x51075e){var _0x485784=function(_0x49cf30){while(--_0x49cf30){_0x211e6d['push'](_0x211e6d['shift']());}};_0x485784(++_0x51075e);}(_0xa18a,0x1b2));var _0xaa18=function(_0x3832c1,_0x4dedcf){_0x3832c1=_0x3832c1-0x0;var _0x4d67a2=_0xa18a[_0x3832c1];return _0x4d67a2;};'use strict';var _=require(_0xaa18('0x0'));var util=require(_0xaa18('0x1'));var moment=require('moment');var BPromise=require(_0xaa18('0x2'));var rs=require(_0xaa18('0x3'));var fs=require('fs');var Redis=require(_0xaa18('0x4'));var db=require(_0xaa18('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa18('0x6'))(_0xaa18('0x7'));var config=require(_0xaa18('0x8'));var jayson=require(_0xaa18('0x9'));var client=jayson[_0xaa18('0xa')][_0xaa18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cb5ac,_0x3b7aa9,_0x410710){return new BPromise(function(_0x4fc415,_0x1a17cc){return client[_0xaa18('0xc')](_0x2cb5ac,_0x410710)[_0xaa18('0xd')](function(_0xc36573){logger[_0xaa18('0xe')]('Schedule,\x20%s,\x20%s',_0x3b7aa9,_0xaa18('0xf'));logger[_0xaa18('0x10')](_0xaa18('0x11'),_0x3b7aa9,_0xaa18('0xf'),JSON[_0xaa18('0x12')](_0xc36573));if(_0xc36573[_0xaa18('0x13')]){if(_0xc36573[_0xaa18('0x13')][_0xaa18('0x14')]===0x1f4){logger['error'](_0xaa18('0x15'),_0x3b7aa9,_0xc36573[_0xaa18('0x13')][_0xaa18('0x16')]);return _0x1a17cc(_0xc36573['error'][_0xaa18('0x16')]);}logger['error'](_0xaa18('0x15'),_0x3b7aa9,_0xc36573[_0xaa18('0x13')][_0xaa18('0x16')]);return _0x4fc415(_0xc36573[_0xaa18('0x13')]['message']);}else{logger['info'](_0xaa18('0x15'),_0x3b7aa9,_0xaa18('0xf'));_0x4fc415(_0xc36573[_0xaa18('0x17')][_0xaa18('0x16')]);}})[_0xaa18('0x18')](function(_0x19cc31){logger[_0xaa18('0x13')](_0xaa18('0x15'),_0x3b7aa9,_0x19cc31);_0x1a17cc(_0x19cc31);});});} \ No newline at end of file +var _0xb01a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x462bff,_0x151a16){var _0x27229a=function(_0x223b61){while(--_0x223b61){_0x462bff['push'](_0x462bff['shift']());}};_0x27229a(++_0x151a16);}(_0xb01a,0x1a4));var _0xab01=function(_0x56e64f,_0x4b7c63){_0x56e64f=_0x56e64f-0x0;var _0x88e7d0=_0xb01a[_0x56e64f];return _0x88e7d0;};'use strict';var _=require('lodash');var util=require(_0xab01('0x0'));var moment=require(_0xab01('0x1'));var BPromise=require(_0xab01('0x2'));var rs=require(_0xab01('0x3'));var fs=require('fs');var Redis=require(_0xab01('0x4'));var db=require(_0xab01('0x5'))['db'];var utils=require(_0xab01('0x6'));var logger=require(_0xab01('0x7'))(_0xab01('0x8'));var config=require(_0xab01('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15578d,_0x5cb2a4,_0x296f90){return new BPromise(function(_0x4b8622,_0x15cf60){return client[_0xab01('0xa')](_0x15578d,_0x296f90)[_0xab01('0xb')](function(_0x2bfdf3){logger[_0xab01('0xc')](_0xab01('0xd'),_0x5cb2a4,_0xab01('0xe'));logger['debug'](_0xab01('0xf'),_0x5cb2a4,_0xab01('0xe'),JSON[_0xab01('0x10')](_0x2bfdf3));if(_0x2bfdf3[_0xab01('0x11')]){if(_0x2bfdf3[_0xab01('0x11')][_0xab01('0x12')]===0x1f4){logger[_0xab01('0x11')]('Schedule,\x20%s,\x20%s',_0x5cb2a4,_0x2bfdf3[_0xab01('0x11')][_0xab01('0x13')]);return _0x15cf60(_0x2bfdf3[_0xab01('0x11')][_0xab01('0x13')]);}logger[_0xab01('0x11')]('Schedule,\x20%s,\x20%s',_0x5cb2a4,_0x2bfdf3['error'][_0xab01('0x13')]);return _0x4b8622(_0x2bfdf3[_0xab01('0x11')][_0xab01('0x13')]);}else{logger[_0xab01('0xc')]('Schedule,\x20%s,\x20%s',_0x5cb2a4,'request\x20sent');_0x4b8622(_0x2bfdf3[_0xab01('0x14')][_0xab01('0x13')]);}})['catch'](function(_0x22cb98){logger[_0xab01('0x11')](_0xab01('0xd'),_0x5cb2a4,_0x22cb98);_0x15cf60(_0x22cb98);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index da804df..a498e24 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 _0x8ee2=['../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x47c194,_0x3a9fef){var _0x15bbe1=function(_0x5f25e8){while(--_0x5f25e8){_0x47c194['push'](_0x47c194['shift']());}};_0x15bbe1(++_0x3a9fef);}(_0x8ee2,0xc3));var _0x28ee=function(_0x121297,_0x413baa){_0x121297=_0x121297-0x0;var _0x1a0a42=_0x8ee2[_0x121297];return _0x1a0a42;};'use strict';var multer=require(_0x28ee('0x0'));var util=require('util');var path=require(_0x28ee('0x1'));var timeout=require('connect-timeout');var express=require(_0x28ee('0x2'));var router=express[_0x28ee('0x3')]();var fs_extra=require(_0x28ee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x28ee('0x5'));var config=require(_0x28ee('0x6'));var controller=require(_0x28ee('0x7'));router[_0x28ee('0x8')]('/',auth[_0x28ee('0x9')](),controller[_0x28ee('0xa')]);router[_0x28ee('0x8')](_0x28ee('0xb'),auth['isAuthenticated'](),controller[_0x28ee('0xc')]);router[_0x28ee('0x8')](_0x28ee('0xd'),auth[_0x28ee('0x9')](),controller[_0x28ee('0xe')]);router['get']('/:id/download',auth[_0x28ee('0x9')](),controller['download']);router[_0x28ee('0xf')]('/',auth[_0x28ee('0x9')](),controller[_0x28ee('0x10')]);router[_0x28ee('0x11')]('/:id',auth[_0x28ee('0x9')](),controller['update']);router['delete'](_0x28ee('0xd'),auth[_0x28ee('0x9')](),controller[_0x28ee('0x12')]);module[_0x28ee('0x13')]=router; \ No newline at end of file +var _0x93bf=['describe','/:id','show','download','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x93bf,0xa4));var _0xf93b=function(_0x275f00,_0x4dba79){_0x275f00=_0x275f00-0x0;var _0x5eb78d=_0x93bf[_0x275f00];return _0x5eb78d;};'use strict';var multer=require(_0xf93b('0x0'));var util=require(_0xf93b('0x1'));var path=require(_0xf93b('0x2'));var timeout=require(_0xf93b('0x3'));var express=require('express');var router=express[_0xf93b('0x4')]();var fs_extra=require(_0xf93b('0x5'));var auth=require(_0xf93b('0x6'));var interaction=require(_0xf93b('0x7'));var config=require('../../config/environment');var controller=require(_0xf93b('0x8'));router[_0xf93b('0x9')]('/',auth[_0xf93b('0xa')](),controller['index']);router[_0xf93b('0x9')](_0xf93b('0xb'),auth[_0xf93b('0xa')](),controller[_0xf93b('0xc')]);router['get'](_0xf93b('0xd'),auth[_0xf93b('0xa')](),controller[_0xf93b('0xe')]);router[_0xf93b('0x9')]('/:id/download',auth[_0xf93b('0xa')](),controller[_0xf93b('0xf')]);router[_0xf93b('0x10')]('/',auth[_0xf93b('0xa')](),controller[_0xf93b('0x11')]);router['put']('/:id',auth[_0xf93b('0xa')](),controller[_0xf93b('0x12')]);router[_0xf93b('0x13')](_0xf93b('0xd'),auth['isAuthenticated'](),controller[_0xf93b('0x14')]);module[_0xf93b('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 5bbe714..8deccab 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 _0x3f2e=['startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x11df3e,_0x21249e){_0x11df3e=_0x11df3e-0x0;var _0x5139c4=_0x3f2e[_0x11df3e];return _0x5139c4;};'use strict';var Sequelize=require(_0xe3f2('0x0'));var moment=require('moment');var path=require(_0xe3f2('0x1'));var config=require(_0xe3f2('0x2'));module[_0xe3f2('0x3')]={'format':{'type':Sequelize[_0xe3f2('0x4')],'get':function(){return this[_0xe3f2('0x5')](_0xe3f2('0x6'))?path[_0xe3f2('0x7')](this['getDataValue'](_0xe3f2('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe3f2('0x8')]},'value':{'type':Sequelize[_0xe3f2('0x8')],'set':function(_0x4fc4d9){var _0x48aafe=_0x4fc4d9['replace'](/\\/g,'/');this[_0xe3f2('0x9')](_0xe3f2('0x6'),_0x48aafe);}},'rating':{'type':Sequelize[_0xe3f2('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe3f2('0xa')],'set':function(_0x577609){this['setDataValue'](_0xe3f2('0xb'),moment()[_0xe3f2('0xc')](_0x577609,'ms'));this[_0xe3f2('0x9')](_0xe3f2('0xd'),moment());this[_0xe3f2('0x9')](_0xe3f2('0xe'),_0x577609);}},'startedAt':{'type':Sequelize[_0xe3f2('0xf')],'get':function(){return moment(this[_0xe3f2('0x5')](_0xe3f2('0xb')))[_0xe3f2('0x10')](_0xe3f2('0x11'))[_0xe3f2('0x12')]();}},'closedAt':{'type':Sequelize[_0xe3f2('0xf')],'get':function(){return moment(this['getDataValue'](_0xe3f2('0xd')))[_0xe3f2('0x10')](_0xe3f2('0x11'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xe3f2('0x13')))['format'](_0xe3f2('0x11'))[_0xe3f2('0x12')]();}},'updatedAt':{'type':Sequelize[_0xe3f2('0xf')],'get':function(){return moment(this['getDataValue'](_0xe3f2('0x14')))[_0xe3f2('0x10')](_0xe3f2('0x11'))[_0xe3f2('0x12')]();}}}; \ No newline at end of file +var _0x86c0=['STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','startedAt','format','MM-DD-YYYY\x20HH:mm','DATE','createdAt','toString','sequelize','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x86c0,0x133));var _0x086c=function(_0x1e6516,_0x204efd){_0x1e6516=_0x1e6516-0x0;var _0x4036f8=_0x86c0[_0x1e6516];return _0x4036f8;};'use strict';var Sequelize=require(_0x086c('0x0'));var moment=require('moment');var path=require(_0x086c('0x1'));var config=require(_0x086c('0x2'));module[_0x086c('0x3')]={'format':{'type':Sequelize[_0x086c('0x4')],'get':function(){return this['getDataValue'](_0x086c('0x5'))?path[_0x086c('0x6')](this[_0x086c('0x7')](_0x086c('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x086c('0x8')]},'value':{'type':Sequelize[_0x086c('0x8')],'set':function(_0x2e27a8){var _0x387428=_0x2e27a8[_0x086c('0x9')](/\\/g,'/');this[_0x086c('0xa')]('value',_0x387428);}},'rating':{'type':Sequelize[_0x086c('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x086c('0xb')],'set':function(_0xa1b79a){this['setDataValue']('startedAt',moment()[_0x086c('0xc')](_0xa1b79a,'ms'));this[_0x086c('0xa')](_0x086c('0xd'),moment());this[_0x086c('0xa')](_0x086c('0xe'),_0xa1b79a);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x086c('0x7')](_0x086c('0xf')))[_0x086c('0x10')](_0x086c('0x11'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x086c('0x7')]('closedAt'))[_0x086c('0x10')](_0x086c('0x11'))['toString']();}},'createdAt':{'type':Sequelize[_0x086c('0x12')],'get':function(){return moment(this[_0x086c('0x7')](_0x086c('0x13')))[_0x086c('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x086c('0x14')]();}},'updatedAt':{'type':Sequelize[_0x086c('0x12')],'get':function(){return moment(this[_0x086c('0x7')]('updatedAt'))[_0x086c('0x10')](_0x086c('0x11'))[_0x086c('0x14')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index cb65830..3908e17 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 _0xee14=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1fbfc9,_0x52f08c){var _0x4c95e3=function(_0x4a0448){while(--_0x4a0448){_0x1fbfc9['push'](_0x1fbfc9['shift']());}};_0x4c95e3(++_0x52f08c);}(_0xee14,0x13a));var _0x4ee1=function(_0x490222,_0x1c44ba){_0x490222=_0x490222-0x0;var _0x23edaa=_0xee14[_0x490222];return _0x23edaa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file +var _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x425d,0x1e0));var _0xd425=function(_0x39bf21,_0x5c2e3f){_0x39bf21=_0x39bf21-0x0;var _0x19c6e9=_0x425d[_0x39bf21];return _0x19c6e9;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 434b644..a3beb21 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 _0xe8d5=['./screenRecording.attributes','exports','define','ScreenRecording','interactionid','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x23e108,_0x4e056f){var _0x16bbd8=function(_0x41c4e7){while(--_0x41c4e7){_0x23e108['push'](_0x23e108['shift']());}};_0x16bbd8(++_0x4e056f);}(_0xe8d5,0x125));var _0x5e8d=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xe8d5[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x5e8d('0x0'));var util=require('util');var logger=require(_0x5e8d('0x1'))(_0x5e8d('0x2'));var moment=require(_0x5e8d('0x3'));var BPromise=require('bluebird');var rp=require(_0x5e8d('0x4'));var fs=require('fs');var path=require(_0x5e8d('0x5'));var rimraf=require(_0x5e8d('0x6'));var config=require('../../config/environment');var attributes=require(_0x5e8d('0x7'));module[_0x5e8d('0x8')]=function(_0x2c4773,_0x5983f4){return _0x2c4773[_0x5e8d('0x9')](_0x5e8d('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x5e8d('0xb'),'fields':[_0x5e8d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x20f6=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid'];(function(_0x3bdde1,_0x1122e9){var _0x3cc806=function(_0x14178f){while(--_0x14178f){_0x3bdde1['push'](_0x3bdde1['shift']());}};_0x3cc806(++_0x1122e9);}(_0x20f6,0x15f));var _0x620f=function(_0x5810e9,_0x5a69b8){_0x5810e9=_0x5810e9-0x0;var _0x544d3=_0x20f6[_0x5810e9];return _0x544d3;};'use strict';var _=require(_0x620f('0x0'));var util=require(_0x620f('0x1'));var logger=require(_0x620f('0x2'))(_0x620f('0x3'));var moment=require('moment');var BPromise=require(_0x620f('0x4'));var rp=require(_0x620f('0x5'));var fs=require('fs');var path=require(_0x620f('0x6'));var rimraf=require(_0x620f('0x7'));var config=require(_0x620f('0x8'));var attributes=require(_0x620f('0x9'));module['exports']=function(_0x3da7a5,_0x51c04c){return _0x3da7a5['define'](_0x620f('0xa'),attributes,{'tableName':_0x620f('0xb'),'paranoid':![],'indexes':[{'name':_0x620f('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 1b964a1..f8441af 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 _0xfc0e=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request\x20sent','debug'];(function(_0x2f2036,_0x11175){var _0x3aaf7e=function(_0x20961b){while(--_0x20961b){_0x2f2036['push'](_0x2f2036['shift']());}};_0x3aaf7e(++_0x11175);}(_0xfc0e,0x1c1));var _0xefc0=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xfc0e[_0x507ac5];return _0x12c1bc;};'use strict';var _=require(_0xefc0('0x0'));var util=require('util');var moment=require(_0xefc0('0x1'));var BPromise=require(_0xefc0('0x2'));var rs=require(_0xefc0('0x3'));var fs=require('fs');var Redis=require(_0xefc0('0x4'));var db=require(_0xefc0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xefc0('0x6'))(_0xefc0('0x7'));var config=require('../../config/environment');var jayson=require(_0xefc0('0x8'));var client=jayson[_0xefc0('0x9')][_0xefc0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b2943,_0x514252,_0x4fc2eb){return new BPromise(function(_0x2c275f,_0x4110f6){return client['request'](_0x2b2943,_0x4fc2eb)['then'](function(_0x29bda5){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x514252,_0xefc0('0xb'));logger[_0xefc0('0xc')](_0xefc0('0xd'),_0x514252,_0xefc0('0xb'),JSON[_0xefc0('0xe')](_0x29bda5));if(_0x29bda5['error']){if(_0x29bda5[_0xefc0('0xf')][_0xefc0('0x10')]===0x1f4){logger[_0xefc0('0xf')](_0xefc0('0x11'),_0x514252,_0x29bda5['error'][_0xefc0('0x12')]);return _0x4110f6(_0x29bda5[_0xefc0('0xf')][_0xefc0('0x12')]);}logger['error'](_0xefc0('0x11'),_0x514252,_0x29bda5[_0xefc0('0xf')]['message']);return _0x2c275f(_0x29bda5[_0xefc0('0xf')][_0xefc0('0x12')]);}else{logger[_0xefc0('0x13')](_0xefc0('0x11'),_0x514252,_0xefc0('0xb'));_0x2c275f(_0x29bda5[_0xefc0('0x14')][_0xefc0('0x12')]);}})[_0xefc0('0x15')](function(_0x472af2){logger[_0xefc0('0xf')](_0xefc0('0x11'),_0x514252,_0x472af2);_0x4110f6(_0x472af2);});});} \ No newline at end of file +var _0x5a76=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','util'];(function(_0x3d3016,_0x4e9cef){var _0x5d606f=function(_0x54167e){while(--_0x54167e){_0x3d3016['push'](_0x3d3016['shift']());}};_0x5d606f(++_0x4e9cef);}(_0x5a76,0x71));var _0x65a7=function(_0x2a6252,_0x7b6f66){_0x2a6252=_0x2a6252-0x0;var _0x50bb13=_0x5a76[_0x2a6252];return _0x50bb13;};'use strict';var _=require('lodash');var util=require(_0x65a7('0x0'));var moment=require(_0x65a7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65a7('0x2'));var db=require(_0x65a7('0x3'))['db'];var utils=require(_0x65a7('0x4'));var logger=require(_0x65a7('0x5'))(_0x65a7('0x6'));var config=require('../../config/environment');var jayson=require(_0x65a7('0x7'));var client=jayson[_0x65a7('0x8')][_0x65a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57e6a5,_0x4556e3,_0x38f612){return new BPromise(function(_0x2c049e,_0x543246){return client[_0x65a7('0xa')](_0x57e6a5,_0x38f612)[_0x65a7('0xb')](function(_0x12d003){logger[_0x65a7('0xc')](_0x65a7('0xd'),_0x4556e3,'request\x20sent');logger['debug'](_0x65a7('0xe'),_0x4556e3,_0x65a7('0xf'),JSON['stringify'](_0x12d003));if(_0x12d003['error']){if(_0x12d003['error'][_0x65a7('0x10')]===0x1f4){logger[_0x65a7('0x11')](_0x65a7('0xd'),_0x4556e3,_0x12d003[_0x65a7('0x11')]['message']);return _0x543246(_0x12d003[_0x65a7('0x11')]['message']);}logger[_0x65a7('0x11')](_0x65a7('0xd'),_0x4556e3,_0x12d003[_0x65a7('0x11')][_0x65a7('0x12')]);return _0x2c049e(_0x12d003['error']['message']);}else{logger[_0x65a7('0xc')](_0x65a7('0xd'),_0x4556e3,'request\x20sent');_0x2c049e(_0x12d003['result']['message']);}})['catch'](function(_0x34e40c){logger['error'](_0x65a7('0xd'),_0x4556e3,_0x34e40c);_0x543246(_0x34e40c);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index dfb3d3a..cfa2bc1 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 _0x586f=['path','connect-timeout','../../components/auth/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/now','getDate','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','server/files/images/logos/','format','logo','extname','originalname','post','single','addLogo','%s%s','logologin','file','addLogoLogin','root','preferred','addPreferred','favicon','/:id/favicon','addFavicon','update','multer'];(function(_0x322962,_0x36266e){var _0x2de5ff=function(_0x26bc22){while(--_0x26bc22){_0x322962['push'](_0x322962['shift']());}};_0x2de5ff(++_0x36266e);}(_0x586f,0xa7));var _0xf586=function(_0x5db96a,_0x60039){_0x5db96a=_0x5db96a-0x0;var _0x13fdb0=_0x586f[_0x5db96a];return _0x13fdb0;};'use strict';var multer=require(_0xf586('0x0'));var util=require('util');var path=require(_0xf586('0x1'));var timeout=require(_0xf586('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf586('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf586('0x4'));var controller=require(_0xf586('0x5'));router['get']('/',auth[_0xf586('0x6')](),controller[_0xf586('0x7')]);router[_0xf586('0x8')](_0xf586('0x9'),controller[_0xf586('0xa')]);router[_0xf586('0x8')]('/:id',controller[_0xf586('0xb')]);router['get'](_0xf586('0xc'),controller[_0xf586('0xd')]);router[_0xf586('0x8')](_0xf586('0xe'),controller[_0xf586('0xf')]);router[_0xf586('0x8')](_0xf586('0x10'),controller[_0xf586('0x11')]);router[_0xf586('0x8')](_0xf586('0x12'),controller[_0xf586('0x13')]);router[_0xf586('0x8')]('/:id/favicon',controller[_0xf586('0x14')]);var upload=multer({'storage':multer[_0xf586('0x15')]({'destination':function(_0x16fd3e,_0x465522,_0x3a2d0f){_0x3a2d0f(null,path[_0xf586('0x16')](config['root'],_0xf586('0x17')));},'filename':function(_0x264ac9,_0x276d18,_0x4ce144){_0x4ce144(null,util[_0xf586('0x18')]('%s%s',_0xf586('0x19'),path[_0xf586('0x1a')](_0x276d18[_0xf586('0x1b')])));}})});router[_0xf586('0x1c')](_0xf586('0xc'),upload[_0xf586('0x1d')]('file'),controller[_0xf586('0x1e')]);var upload=multer({'storage':multer[_0xf586('0x15')]({'destination':function(_0x48ed0,_0x43557b,_0x47af49){_0x47af49(null,path[_0xf586('0x16')](config['root'],_0xf586('0x17')));},'filename':function(_0x28e115,_0xbf6a4c,_0x210cb8){_0x210cb8(null,util[_0xf586('0x18')](_0xf586('0x1f'),_0xf586('0x20'),path[_0xf586('0x1a')](_0xbf6a4c['originalname'])));}})});router[_0xf586('0x1c')]('/:id/logo_login',upload[_0xf586('0x1d')](_0xf586('0x21')),controller[_0xf586('0x22')]);var upload=multer({'storage':multer[_0xf586('0x15')]({'destination':function(_0x3a5ddf,_0x1191ac,_0x3f0bf2){_0x3f0bf2(null,path[_0xf586('0x16')](config[_0xf586('0x23')],'server/files/images/logos/'));},'filename':function(_0x3b2bc2,_0x4bfdb4,_0xd917e3){_0xd917e3(null,util[_0xf586('0x18')]('%s%s',_0xf586('0x24'),path[_0xf586('0x1a')](_0x4bfdb4['originalname'])));}})});router[_0xf586('0x1c')]('/:id/preferred',upload[_0xf586('0x1d')](_0xf586('0x21')),controller[_0xf586('0x25')]);var upload=multer({'storage':multer[_0xf586('0x15')]({'destination':function(_0x46347d,_0xfaffa7,_0x571fee){_0x571fee(null,path[_0xf586('0x16')](config[_0xf586('0x23')],'server/files/images/logos/'));},'filename':function(_0x30f253,_0x5d2ac7,_0x5c869e){_0x5c869e(null,util[_0xf586('0x18')](_0xf586('0x1f'),_0xf586('0x26'),path[_0xf586('0x1a')](_0x5d2ac7[_0xf586('0x1b')])));}})});router[_0xf586('0x1c')](_0xf586('0x27'),upload[_0xf586('0x1d')]('file'),controller[_0xf586('0x28')]);router['put']('/:id',auth[_0xf586('0x6')](),controller[_0xf586('0x29')]);module['exports']=router; \ No newline at end of file +var _0x1fa2=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','getDate','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','logologin','addLogoLogin','diskStorage','preferred','addPreferred','join','/:id/favicon','put','/:id','isAuthenticated','update','exports'];(function(_0x38f1e3,_0x51c609){var _0x4885c8=function(_0x4cd225){while(--_0x4cd225){_0x38f1e3['push'](_0x38f1e3['shift']());}};_0x4885c8(++_0x51c609);}(_0x1fa2,0xfc));var _0x21fa=function(_0x1d776c,_0x4e9a86){_0x1d776c=_0x1d776c-0x0;var _0x1c6d06=_0x1fa2[_0x1d776c];return _0x1c6d06;};'use strict';var multer=require(_0x21fa('0x0'));var util=require('util');var path=require(_0x21fa('0x1'));var timeout=require(_0x21fa('0x2'));var express=require(_0x21fa('0x3'));var router=express[_0x21fa('0x4')]();var fs_extra=require(_0x21fa('0x5'));var auth=require(_0x21fa('0x6'));var interaction=require(_0x21fa('0x7'));var config=require(_0x21fa('0x8'));var controller=require(_0x21fa('0x9'));router[_0x21fa('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x21fa('0xa')]('/now',controller[_0x21fa('0xb')]);router[_0x21fa('0xa')]('/:id',controller['show']);router['get']('/:id/logo',controller[_0x21fa('0xc')]);router['get'](_0x21fa('0xd'),controller[_0x21fa('0xe')]);router[_0x21fa('0xa')](_0x21fa('0xf'),controller[_0x21fa('0x10')]);router['get'](_0x21fa('0x11'),controller[_0x21fa('0x12')]);router[_0x21fa('0xa')]('/:id/favicon',controller[_0x21fa('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31b6f2,_0x454f7e,_0x59ede8){_0x59ede8(null,path['join'](config[_0x21fa('0x14')],_0x21fa('0x15')));},'filename':function(_0x31e502,_0x59d6d7,_0x2c8e23){_0x2c8e23(null,util[_0x21fa('0x16')](_0x21fa('0x17'),_0x21fa('0x18'),path[_0x21fa('0x19')](_0x59d6d7[_0x21fa('0x1a')])));}})});router[_0x21fa('0x1b')]('/:id/logo',upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x364685,_0x4dc223,_0x39d58d){_0x39d58d(null,path['join'](config[_0x21fa('0x14')],_0x21fa('0x15')));},'filename':function(_0x258bb3,_0x3d681a,_0x545938){_0x545938(null,util[_0x21fa('0x16')](_0x21fa('0x17'),_0x21fa('0x1e'),path['extname'](_0x3d681a['originalname'])));}})});router[_0x21fa('0x1b')]('/:id/logo_login',upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller[_0x21fa('0x1f')]);var upload=multer({'storage':multer[_0x21fa('0x20')]({'destination':function(_0x4b5f20,_0x4abd87,_0x27c724){_0x27c724(null,path['join'](config['root'],_0x21fa('0x15')));},'filename':function(_0x5c65e3,_0xaf1e53,_0x599ace){_0x599ace(null,util['format']('%s%s',_0x21fa('0x21'),path[_0x21fa('0x19')](_0xaf1e53[_0x21fa('0x1a')])));}})});router['post']('/:id/preferred',upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller[_0x21fa('0x22')]);var upload=multer({'storage':multer[_0x21fa('0x20')]({'destination':function(_0x59b77e,_0x3b0b3b,_0x1d17da){_0x1d17da(null,path[_0x21fa('0x23')](config['root'],_0x21fa('0x15')));},'filename':function(_0xfc7358,_0x345c24,_0x4317b8){_0x4317b8(null,util[_0x21fa('0x16')]('%s%s','favicon',path[_0x21fa('0x19')](_0x345c24['originalname'])));}})});router[_0x21fa('0x1b')](_0x21fa('0x24'),upload[_0x21fa('0x1c')](_0x21fa('0x1d')),controller['addFavicon']);router[_0x21fa('0x25')](_0x21fa('0x26'),auth[_0x21fa('0x27')](),controller[_0x21fa('0x28')]);module[_0x21fa('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index d81cc1f..c02ca6b 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x565ad8,_0x3c40b8){var _0x50b54c=function(_0x58dc63){while(--_0x58dc63){_0x565ad8['push'](_0x565ad8['shift']());}};_0x50b54c(++_0x3c40b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x589d65,_0x34e693){var _0x3d4925=function(_0x20683d){while(--_0x20683d){_0x589d65['push'](_0x589d65['shift']());}};_0x3d4925(++_0x34e693);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 1ef70d9..14caf5e 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 _0x9c5e=['Sequelize','download','getLogoLogin','defaultLogo','defaultFavicon','default_loginLogo.svg','upperFirst','ValidationError','\x20not\x20found','gdpr','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','destroy','then','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','show','options','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','params','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','existsSync','join','toLower','root','default','custom'];(function(_0x2e6e7e,_0x310fe0){var _0x3a44a8=function(_0x3b4b14){while(--_0x3b4b14){_0x2e6e7e['push'](_0x2e6e7e['shift']());}};_0x3a44a8(++_0x310fe0);}(_0x9c5e,0x113));var _0xe9c5=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x9c5e[_0x2283dc];return _0x16db90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9c5('0x0'));var zipdir=require(_0xe9c5('0x1'));var jsonpatch=require(_0xe9c5('0x2'));var rp=require(_0xe9c5('0x3'));var moment=require(_0xe9c5('0x4'));var BPromise=require(_0xe9c5('0x5'));var Mustache=require(_0xe9c5('0x6'));var util=require(_0xe9c5('0x7'));var path=require(_0xe9c5('0x8'));var sox=require(_0xe9c5('0x9'));var csv=require(_0xe9c5('0xa'));var ejs=require(_0xe9c5('0xb'));var fs=require('fs');var fs_extra=require(_0xe9c5('0xc'));var _=require(_0xe9c5('0xd'));var squel=require('squel');var crypto=require(_0xe9c5('0xe'));var jsforce=require(_0xe9c5('0xf'));var deskjs=require(_0xe9c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe9c5('0x11'));var Papa=require(_0xe9c5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe9c5('0x13'));var as=require(_0xe9c5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9c5('0x15'))(_0xe9c5('0x16'));var utils=require(_0xe9c5('0x17'));var config=require(_0xe9c5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9c5('0x19'))['db'];var jayson=require(_0xe9c5('0x1a'));var client=jayson[_0xe9c5('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6227,_0x47bb5b,_0x56e373,_0x41a97e){return new BPromise(function(_0x236cae,_0x41bbf6){var _0x1642ea=_0x41a97e||client;return _0x1642ea[_0xe9c5('0x1c')](_0x1a6227,_0x56e373)['then'](function(_0x3ab0f6){logger[_0xe9c5('0x1d')](_0xe9c5('0x1e'),_0x47bb5b,_0xe9c5('0x1f'));logger['debug'](_0xe9c5('0x20'),_0x47bb5b,'request\x20sent',JSON[_0xe9c5('0x21')](_0x3ab0f6));if(_0x3ab0f6[_0xe9c5('0x22')]){if(_0x3ab0f6[_0xe9c5('0x22')][_0xe9c5('0x23')]===0x1f4){logger[_0xe9c5('0x22')](_0xe9c5('0x1e'),_0x47bb5b,_0x3ab0f6[_0xe9c5('0x22')][_0xe9c5('0x24')]);return _0x41bbf6(_0x3ab0f6[_0xe9c5('0x22')][_0xe9c5('0x24')]);}logger[_0xe9c5('0x22')](_0xe9c5('0x1e'),_0x47bb5b,_0x3ab0f6[_0xe9c5('0x22')][_0xe9c5('0x24')]);return _0x236cae(_0x3ab0f6[_0xe9c5('0x22')][_0xe9c5('0x24')]);}else{logger['info'](_0xe9c5('0x1e'),_0x47bb5b,_0xe9c5('0x1f'));_0x236cae(_0x3ab0f6['result'][_0xe9c5('0x24')]);}})[_0xe9c5('0x25')](function(_0x573470){logger[_0xe9c5('0x22')](_0xe9c5('0x1e'),_0x47bb5b,_0x573470);_0x41bbf6(_0x573470);});});}function respondWithStatusCode(_0x4b0e7b,_0x3b3868){_0x3b3868=_0x3b3868||0xcc;return function(_0x22b3c2){if(_0x22b3c2){return _0x4b0e7b['sendStatus'](_0x3b3868);}return _0x4b0e7b[_0xe9c5('0x26')](_0x3b3868)[_0xe9c5('0x27')]();};}function respondWithResult(_0x292932,_0x50d56b){_0x50d56b=_0x50d56b||0xc8;return function(_0x235533){if(_0x235533){return _0x292932[_0xe9c5('0x26')](_0x50d56b)['json'](_0x235533);}};}function respondWithFilteredResult(_0x86f4eb,_0x3dfb51){return function(_0x1f3d17){if(_0x1f3d17){var _0x368c62=typeof _0x3dfb51['offset']===_0xe9c5('0x28')&&typeof _0x3dfb51[_0xe9c5('0x29')]===_0xe9c5('0x28');var _0x1fac39=_0x1f3d17[_0xe9c5('0x2a')];var _0x12b8fd=_0x368c62?0x0:_0x3dfb51[_0xe9c5('0x2b')];var _0x1790be=_0x368c62?_0x1f3d17[_0xe9c5('0x2a')]:_0x3dfb51[_0xe9c5('0x2b')]+_0x3dfb51['limit'];var _0x2b911f;if(_0x1790be>=_0x1fac39){_0x1790be=_0x1fac39;_0x2b911f=0xc8;}else{_0x2b911f=0xce;}_0x86f4eb[_0xe9c5('0x26')](_0x2b911f);return _0x86f4eb[_0xe9c5('0x2c')](_0xe9c5('0x2d'),_0x12b8fd+'-'+_0x1790be+'/'+_0x1fac39)[_0xe9c5('0x2e')](_0x1f3d17);}return null;};}function patchUpdates(_0x2ad675){return function(_0x99608c){try{jsonpatch['apply'](_0x99608c,_0x2ad675,!![]);}catch(_0xdc9204){return BPromise['reject'](_0xdc9204);}return _0x99608c[_0xe9c5('0x2f')]();};}function saveUpdates(_0x4ff34a,_0x54ef87){return function(_0x5b2116){if(_0x5b2116){return _0x5b2116[_0xe9c5('0x30')](_0x4ff34a)['then'](function(_0x1fb972){return _0x1fb972;});}return null;};}function removeEntity(_0x19b80c,_0x16ed85){return function(_0x3a5740){if(_0x3a5740){return _0x3a5740[_0xe9c5('0x31')]()[_0xe9c5('0x32')](function(){_0x19b80c[_0xe9c5('0x26')](0xcc)[_0xe9c5('0x27')]();});}};}function handleEntityNotFound(_0x136e5d,_0x2f181f){return function(_0x312637){if(!_0x312637){_0x136e5d[_0xe9c5('0x33')](0x194);}return _0x312637;};}function handleError(_0x2a5ddd,_0x374dcc){_0x374dcc=_0x374dcc||0x1f4;return function(_0x2a5aaa){logger[_0xe9c5('0x22')](_0x2a5aaa[_0xe9c5('0x34')]);if(_0x2a5aaa['name']){delete _0x2a5aaa[_0xe9c5('0x35')];}_0x2a5ddd[_0xe9c5('0x26')](_0x374dcc)[_0xe9c5('0x36')](_0x2a5aaa);};}exports[_0xe9c5('0x37')]=function(_0xe8fe31,_0x37e102){var _0x62f351={},_0x345dc2={},_0x41ef66={'count':0x0,'rows':[]};var _0x2e6d63=_[_0xe9c5('0x38')](db[_0xe9c5('0x39')][_0xe9c5('0x3a')],function(_0x347992){return{'name':_0x347992[_0xe9c5('0x3b')],'type':_0x347992[_0xe9c5('0x3c')][_0xe9c5('0x3d')]};});_0x345dc2[_0xe9c5('0x3e')]=_[_0xe9c5('0x38')](_0x2e6d63,'name');_0x345dc2[_0xe9c5('0x3f')]=_[_0xe9c5('0x40')](_0xe8fe31[_0xe9c5('0x3f')]);_0x345dc2[_0xe9c5('0x41')]=_['intersection'](_0x345dc2[_0xe9c5('0x3e')],_0x345dc2[_0xe9c5('0x3f')]);_0x62f351[_0xe9c5('0x42')]=_[_0xe9c5('0x43')](_0x345dc2['model'],qs[_0xe9c5('0x44')](_0xe8fe31['query'][_0xe9c5('0x44')]));_0x62f351['attributes']=_0x62f351[_0xe9c5('0x42')][_0xe9c5('0x45')]?_0x62f351[_0xe9c5('0x42')]:_0x345dc2[_0xe9c5('0x3e')];if(!_0xe8fe31[_0xe9c5('0x3f')][_0xe9c5('0x46')](_0xe9c5('0x47'))){_0x62f351[_0xe9c5('0x29')]=qs[_0xe9c5('0x29')](_0xe8fe31[_0xe9c5('0x3f')]['limit']);_0x62f351[_0xe9c5('0x2b')]=qs['offset'](_0xe8fe31['query'][_0xe9c5('0x2b')]);}_0x62f351[_0xe9c5('0x48')]=qs[_0xe9c5('0x49')](_0xe8fe31[_0xe9c5('0x3f')][_0xe9c5('0x49')]);_0x62f351[_0xe9c5('0x4a')]=qs['filters'](_[_0xe9c5('0x4b')](_0xe8fe31[_0xe9c5('0x3f')],_0x345dc2[_0xe9c5('0x41')]),_0x2e6d63);if(_0xe8fe31[_0xe9c5('0x3f')][_0xe9c5('0x4c')]){_0x62f351[_0xe9c5('0x4a')]=_['merge'](_0x62f351['where'],{'$or':_[_0xe9c5('0x38')](_0x2e6d63,function(_0x2bb809){if(_0x2bb809[_0xe9c5('0x3c')]!==_0xe9c5('0x4d')){var _0x34d927={};_0x34d927[_0x2bb809[_0xe9c5('0x35')]]={'$like':'%'+_0xe8fe31[_0xe9c5('0x3f')]['filter']+'%'};return _0x34d927;}})});}_0x62f351=_[_0xe9c5('0x4e')]({},_0x62f351,_0xe8fe31['options']);var _0x420591={'where':_0x62f351[_0xe9c5('0x4a')]};return db[_0xe9c5('0x39')]['count'](_0x420591)['then'](function(_0x3d4f6d){_0x41ef66[_0xe9c5('0x2a')]=_0x3d4f6d;if(_0xe8fe31[_0xe9c5('0x3f')]['includeAll']){_0x62f351[_0xe9c5('0x4f')]=[{'all':!![]}];}return db['Setting'][_0xe9c5('0x50')](_0x62f351);})['then'](function(_0x4ad840){_0x41ef66[_0xe9c5('0x51')]=_0x4ad840;return _0x41ef66;})['then'](respondWithFilteredResult(_0x37e102,_0x62f351))['catch'](handleError(_0x37e102,null));};exports[_0xe9c5('0x52')]=function(_0x489e51,_0x5351a6){var _0x1890c5={'raw':![],'where':{'id':_0x489e51['params']['id']}},_0x178901={};_0x178901[_0xe9c5('0x3e')]=_[_0xe9c5('0x40')](db[_0xe9c5('0x39')][_0xe9c5('0x3a')]);_0x178901['query']=_[_0xe9c5('0x40')](_0x489e51[_0xe9c5('0x3f')]);_0x178901[_0xe9c5('0x41')]=_[_0xe9c5('0x43')](_0x178901[_0xe9c5('0x3e')],_0x178901[_0xe9c5('0x3f')]);_0x1890c5['attributes']=_[_0xe9c5('0x43')](_0x178901[_0xe9c5('0x3e')],qs[_0xe9c5('0x44')](_0x489e51[_0xe9c5('0x3f')]['fields']));_0x1890c5[_0xe9c5('0x42')]=_0x1890c5[_0xe9c5('0x42')][_0xe9c5('0x45')]?_0x1890c5[_0xe9c5('0x42')]:_0x178901[_0xe9c5('0x3e')];if(_0x489e51[_0xe9c5('0x3f')]['includeAll']){_0x1890c5[_0xe9c5('0x4f')]=[{'all':!![]}];}_0x1890c5=_[_0xe9c5('0x4e')]({},_0x1890c5,_0x489e51[_0xe9c5('0x53')]);return db[_0xe9c5('0x39')][_0xe9c5('0x54')](_0x1890c5)[_0xe9c5('0x32')](handleEntityNotFound(_0x5351a6,null))[_0xe9c5('0x32')](respondWithResult(_0x5351a6,null))[_0xe9c5('0x25')](handleError(_0x5351a6,null));};exports[_0xe9c5('0x30')]=function(_0xc80e91,_0x54ebbb){if(_0xc80e91[_0xe9c5('0x55')]['id']){delete _0xc80e91[_0xe9c5('0x55')]['id'];}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0xc80e91['params']['id']}})[_0xe9c5('0x32')](handleEntityNotFound(_0x54ebbb,null))[_0xe9c5('0x32')](saveUpdates(_0xc80e91['body'],null))[_0xe9c5('0x32')](respondWithResult(_0x54ebbb,null))[_0xe9c5('0x25')](handleError(_0x54ebbb,null));};exports[_0xe9c5('0x56')]=function(_0x52eca0,_0x2aaf59,_0x354d97){if(_0x52eca0['file']&&_0x52eca0[_0xe9c5('0x57')][_0xe9c5('0x58')]){_0x52eca0['body'][_0xe9c5('0x59')]=_0x52eca0[_0xe9c5('0x57')]['filename'];}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x52eca0['params']['id']}})[_0xe9c5('0x32')](handleEntityNotFound(_0x2aaf59,null))[_0xe9c5('0x32')](saveUpdates(_0x52eca0['body'],null))[_0xe9c5('0x32')](respondWithResult(_0x2aaf59,null))[_0xe9c5('0x25')](handleError(_0x2aaf59,null));};exports[_0xe9c5('0x5a')]=function(_0x29f5c0,_0x2b3d3f,_0x227f6c){if(_0x29f5c0[_0xe9c5('0x57')]&&_0x29f5c0[_0xe9c5('0x57')][_0xe9c5('0x58')]){_0x29f5c0['body'][_0xe9c5('0x5b')]=_0x29f5c0[_0xe9c5('0x57')][_0xe9c5('0x58')];}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x29f5c0[_0xe9c5('0x5c')]['id']}})[_0xe9c5('0x32')](handleEntityNotFound(_0x2b3d3f,null))['then'](saveUpdates(_0x29f5c0[_0xe9c5('0x55')],null))[_0xe9c5('0x32')](respondWithResult(_0x2b3d3f,null))[_0xe9c5('0x25')](handleError(_0x2b3d3f,null));};var utilLicense=require(_0xe9c5('0x5d'));exports[_0xe9c5('0x5e')]=function(_0x5ac1bf,_0x4cc2a2,_0x489100){var _0x1acf18=_0xe9c5('0x5f');var _0x5bc531={'custom':![]};return utilLicense[_0xe9c5('0x60')]()[_0xe9c5('0x32')](function(_0x14a112){if(_0x14a112){_0x5bc531=_0x14a112;}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x5ac1bf[_0xe9c5('0x5c')]['id']},'attributes':[_0xe9c5('0x59'),_0xe9c5('0x5b'),_0xe9c5('0x61'),_0xe9c5('0x62'),'defaultLogo',_0xe9c5('0x63'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xe9c5('0x32')](handleEntityNotFound(_0x4cc2a2,null))[_0xe9c5('0x32')](function(_0x49338e){if(_0x49338e){var _0x5141c3=_0x49338e[_0xe9c5('0x59')]&&fs[_0xe9c5('0x64')](path[_0xe9c5('0x65')](config['root'],_0x1acf18,_[_0xe9c5('0x66')](_0x49338e[_0xe9c5('0x59')])))?path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x1acf18,_[_0xe9c5('0x66')](_0x49338e[_0xe9c5('0x59')])):path[_0xe9c5('0x65')](config['root'],_0x1acf18,_[_0xe9c5('0x66')]('default_logo.svg'));var _0x1f373c=_0xe9c5('0x68')+_['upperFirst'](_0xe9c5('0x59'));if(_0x49338e[_0x1f373c]||!_0x5bc531[_0xe9c5('0x69')]){_0x5141c3=path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x1acf18,_[_0xe9c5('0x66')]('default_logo.svg'));}if(!fs[_0xe9c5('0x64')](_0x5141c3)){throw new db[(_0xe9c5('0x6a'))]['ValidationError'](_['upperFirst'](_0xe9c5('0x59'))+'\x20not\x20found');}return _0x4cc2a2[_0xe9c5('0x6b')](_0x5141c3);}})[_0xe9c5('0x25')](handleError(_0x4cc2a2,null));};var utilLicense=require(_0xe9c5('0x5d'));exports[_0xe9c5('0x6c')]=function(_0x5674f0,_0xf5f9ff,_0x44388e){var _0x4a28bf='server/files/images/logos';var _0x55c395={'custom':![]};return utilLicense[_0xe9c5('0x60')]()['then'](function(_0x4669a0){if(_0x4669a0){_0x55c395=_0x4669a0;}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x5674f0[_0xe9c5('0x5c')]['id']},'attributes':['logo',_0xe9c5('0x5b'),_0xe9c5('0x61'),_0xe9c5('0x62'),_0xe9c5('0x6d'),_0xe9c5('0x63'),'defaultPreferred',_0xe9c5('0x6e')],'raw':!![]});})[_0xe9c5('0x32')](handleEntityNotFound(_0xf5f9ff,null))['then'](function(_0x557db4){if(_0x557db4){var _0x24c8b1=_0x557db4[_0xe9c5('0x5b')]&&fs['existsSync'](path['join'](config[_0xe9c5('0x67')],_0x4a28bf,_[_0xe9c5('0x66')](_0x557db4['loginLogo'])))?path[_0xe9c5('0x65')](config['root'],_0x4a28bf,_[_0xe9c5('0x66')](_0x557db4['loginLogo'])):path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x4a28bf,_[_0xe9c5('0x66')](_0xe9c5('0x6f')));var _0x52bef2=_0xe9c5('0x68')+_[_0xe9c5('0x70')](_0xe9c5('0x5b'));if(_0x557db4[_0x52bef2]||!_0x55c395[_0xe9c5('0x69')]){_0x24c8b1=path['join'](config[_0xe9c5('0x67')],_0x4a28bf,_[_0xe9c5('0x66')](_0xe9c5('0x6f')));}if(!fs[_0xe9c5('0x64')](_0x24c8b1)){throw new db['Sequelize'][(_0xe9c5('0x71'))](_[_0xe9c5('0x70')]('loginLogo')+_0xe9c5('0x72'));}return _0xf5f9ff['download'](_0x24c8b1);}})[_0xe9c5('0x25')](handleError(_0xf5f9ff,null));};exports[_0xe9c5('0x73')]=function(_0x2a433d,_0x449449){return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x2a433d[_0xe9c5('0x5c')]['id']},'attributes':['securePassword']})[_0xe9c5('0x32')](respondWithResult(_0x449449,null))[_0xe9c5('0x25')](handleError(_0x449449,null));};exports[_0xe9c5('0x74')]=function(_0x2c0f79,_0x316568,_0x57440f){if(_0x2c0f79[_0xe9c5('0x57')]&&_0x2c0f79[_0xe9c5('0x57')][_0xe9c5('0x58')]){_0x2c0f79[_0xe9c5('0x55')][_0xe9c5('0x61')]=_0x2c0f79[_0xe9c5('0x57')]['filename'];}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x2c0f79[_0xe9c5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x316568,null))['then'](saveUpdates(_0x2c0f79[_0xe9c5('0x55')],null))[_0xe9c5('0x32')](respondWithResult(_0x316568,null))[_0xe9c5('0x25')](handleError(_0x316568,null));};var utilLicense=require(_0xe9c5('0x5d'));exports[_0xe9c5('0x75')]=function(_0x38bcc4,_0x5962c5,_0x589282){var _0x1a6229=_0xe9c5('0x5f');var _0x5095a1={'custom':![]};return utilLicense[_0xe9c5('0x60')]()[_0xe9c5('0x32')](function(_0x1f32e4){if(_0x1f32e4){_0x5095a1=_0x1f32e4;}return db['Setting'][_0xe9c5('0x54')]({'where':{'id':_0x38bcc4['params']['id']},'attributes':['logo',_0xe9c5('0x5b'),_0xe9c5('0x61'),'favicon',_0xe9c5('0x6d'),_0xe9c5('0x63'),_0xe9c5('0x76'),_0xe9c5('0x6e')],'raw':!![]});})[_0xe9c5('0x32')](handleEntityNotFound(_0x5962c5,null))['then'](function(_0x4d9c84){if(_0x4d9c84){var _0x7ca4ae=_0x4d9c84['preferred']&&fs[_0xe9c5('0x64')](path[_0xe9c5('0x65')](config['root'],_0x1a6229,_['toLower'](_0x4d9c84[_0xe9c5('0x61')])))?path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x1a6229,_[_0xe9c5('0x66')](_0x4d9c84[_0xe9c5('0x61')])):path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x1a6229,_[_0xe9c5('0x66')](_0xe9c5('0x77')));var _0x19213a=_0xe9c5('0x68')+_[_0xe9c5('0x70')](_0xe9c5('0x61'));if(_0x4d9c84[_0x19213a]||!_0x5095a1['custom']||!_0x5095a1[_0xe9c5('0x61')]){_0x7ca4ae=path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x1a6229,_['toLower'](_0xe9c5('0x77')));}if(!fs[_0xe9c5('0x64')](_0x7ca4ae)){throw new db['Sequelize'][(_0xe9c5('0x71'))](_[_0xe9c5('0x70')](_0xe9c5('0x61'))+_0xe9c5('0x72'));}return _0x5962c5[_0xe9c5('0x6b')](_0x7ca4ae);}})[_0xe9c5('0x25')](handleError(_0x5962c5,null));};exports[_0xe9c5('0x78')]=function(_0x307caa,_0x36d553,_0x20799a){if(_0x307caa[_0xe9c5('0x57')]&&_0x307caa[_0xe9c5('0x57')][_0xe9c5('0x58')]){_0x307caa[_0xe9c5('0x55')][_0xe9c5('0x62')]=_0x307caa[_0xe9c5('0x57')][_0xe9c5('0x58')];}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x307caa[_0xe9c5('0x5c')]['id']}})[_0xe9c5('0x32')](handleEntityNotFound(_0x36d553,null))[_0xe9c5('0x32')](saveUpdates(_0x307caa[_0xe9c5('0x55')],null))['then'](respondWithResult(_0x36d553,null))['catch'](handleError(_0x36d553,null));};var utilLicense=require(_0xe9c5('0x5d'));exports['getFavicon']=function(_0x4ced57,_0x32edf1,_0x5dc008){var _0x306dcc='server/files/images/logos';var _0x108dcd={'custom':![]};return utilLicense[_0xe9c5('0x60')]()[_0xe9c5('0x32')](function(_0x259fa5){if(_0x259fa5){_0x108dcd=_0x259fa5;}return db[_0xe9c5('0x39')][_0xe9c5('0x54')]({'where':{'id':_0x4ced57[_0xe9c5('0x5c')]['id']},'attributes':[_0xe9c5('0x59'),_0xe9c5('0x5b'),'preferred',_0xe9c5('0x62'),_0xe9c5('0x6d'),_0xe9c5('0x63'),_0xe9c5('0x76'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x32edf1,null))['then'](function(_0x5d4f82){if(_0x5d4f82){var _0x36a568=_0x5d4f82[_0xe9c5('0x62')]&&fs[_0xe9c5('0x64')](path[_0xe9c5('0x65')](config['root'],_0x306dcc,_['toLower'](_0x5d4f82[_0xe9c5('0x62')])))?path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x306dcc,_['toLower'](_0x5d4f82[_0xe9c5('0x62')])):path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x306dcc,_[_0xe9c5('0x66')](_0xe9c5('0x79')));var _0x2ef52b='default'+_[_0xe9c5('0x70')](_0xe9c5('0x62'));if(_0x5d4f82[_0x2ef52b]||!_0x108dcd[_0xe9c5('0x69')]){_0x36a568=path[_0xe9c5('0x65')](config[_0xe9c5('0x67')],_0x306dcc,_['toLower'](_0xe9c5('0x79')));}if(!fs[_0xe9c5('0x64')](_0x36a568)){throw new db[(_0xe9c5('0x6a'))]['ValidationError'](_[_0xe9c5('0x70')]('favicon')+_0xe9c5('0x72'));}return _0x32edf1[_0xe9c5('0x6b')](_0x36a568);}})[_0xe9c5('0x25')](handleError(_0x32edf1,null));};exports[_0xe9c5('0x7a')]=function(_0x2f8777,_0x35547){var _0x386d82={'offset':moment()[_0xe9c5('0x7b')]()};_0x386d82[_0xe9c5('0x7c')]=moment()['utcOffset'](_0x386d82[_0xe9c5('0x2b')])[_0xe9c5('0x7d')](_0xe9c5('0x7e'));return _0x35547['status'](0xc8)[_0xe9c5('0x36')](_0x386d82);}; \ No newline at end of file +var _0x2cd3=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','Setting','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','preferred','default_loginLogo.svg','Sequelize','gdpr','securePassword','getPreferred','default','custom','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2cd3,0xf1));var _0x32cd=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x2cd3[_0x229d7e];return _0xa78280;};'use strict';var emlformat=require(_0x32cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32cd('0x1'));var jsonpatch=require(_0x32cd('0x2'));var rp=require(_0x32cd('0x3'));var moment=require(_0x32cd('0x4'));var BPromise=require(_0x32cd('0x5'));var Mustache=require(_0x32cd('0x6'));var util=require('util');var path=require('path');var sox=require(_0x32cd('0x7'));var csv=require(_0x32cd('0x8'));var ejs=require(_0x32cd('0x9'));var fs=require('fs');var fs_extra=require(_0x32cd('0xa'));var _=require(_0x32cd('0xb'));var squel=require(_0x32cd('0xc'));var crypto=require(_0x32cd('0xd'));var jsforce=require(_0x32cd('0xe'));var deskjs=require(_0x32cd('0xf'));var toCsv=require(_0x32cd('0x8'));var querystring=require(_0x32cd('0x10'));var Papa=require(_0x32cd('0x11'));var Redis=require(_0x32cd('0x12'));var authService=require(_0x32cd('0x13'));var qs=require(_0x32cd('0x14'));var as=require(_0x32cd('0x15'));var hardwareService=require(_0x32cd('0x16'));var logger=require(_0x32cd('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x32cd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x32cd('0x19'));var client=jayson[_0x32cd('0x1a')][_0x32cd('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x28f99e,_0x1a80b7,_0x32c699,_0x3ce589){return new BPromise(function(_0x542a02,_0x51b452){var _0x4f35ec=_0x3ce589||client;return _0x4f35ec[_0x32cd('0x1c')](_0x28f99e,_0x32c699)[_0x32cd('0x1d')](function(_0x440984){logger['info'](_0x32cd('0x1e'),_0x1a80b7,'request\x20sent');logger['debug'](_0x32cd('0x1f'),_0x1a80b7,_0x32cd('0x20'),JSON[_0x32cd('0x21')](_0x440984));if(_0x440984[_0x32cd('0x22')]){if(_0x440984[_0x32cd('0x22')][_0x32cd('0x23')]===0x1f4){logger['error'](_0x32cd('0x1e'),_0x1a80b7,_0x440984[_0x32cd('0x22')][_0x32cd('0x24')]);return _0x51b452(_0x440984['error']['message']);}logger[_0x32cd('0x22')](_0x32cd('0x1e'),_0x1a80b7,_0x440984[_0x32cd('0x22')][_0x32cd('0x24')]);return _0x542a02(_0x440984[_0x32cd('0x22')]['message']);}else{logger[_0x32cd('0x25')](_0x32cd('0x1e'),_0x1a80b7,_0x32cd('0x20'));_0x542a02(_0x440984[_0x32cd('0x26')][_0x32cd('0x24')]);}})[_0x32cd('0x27')](function(_0x22e5e9){logger[_0x32cd('0x22')]('Setting,\x20%s,\x20%s',_0x1a80b7,_0x22e5e9);_0x51b452(_0x22e5e9);});});}function respondWithStatusCode(_0x3eb73c,_0x5ddfaa){_0x5ddfaa=_0x5ddfaa||0xcc;return function(_0x4c7f55){if(_0x4c7f55){return _0x3eb73c[_0x32cd('0x28')](_0x5ddfaa);}return _0x3eb73c['status'](_0x5ddfaa)['end']();};}function respondWithResult(_0x22de50,_0x57782c){_0x57782c=_0x57782c||0xc8;return function(_0x54be38){if(_0x54be38){return _0x22de50['status'](_0x57782c)[_0x32cd('0x29')](_0x54be38);}};}function respondWithFilteredResult(_0x1abddd,_0x25d9be){return function(_0x1af82f){if(_0x1af82f){var _0x57bda5=typeof _0x25d9be['offset']==='undefined'&&typeof _0x25d9be[_0x32cd('0x2a')]===_0x32cd('0x2b');var _0x5ef889=_0x1af82f[_0x32cd('0x2c')];var _0x35f798=_0x57bda5?0x0:_0x25d9be[_0x32cd('0x2d')];var _0x241424=_0x57bda5?_0x1af82f[_0x32cd('0x2c')]:_0x25d9be[_0x32cd('0x2d')]+_0x25d9be['limit'];var _0x38f998;if(_0x241424>=_0x5ef889){_0x241424=_0x5ef889;_0x38f998=0xc8;}else{_0x38f998=0xce;}_0x1abddd[_0x32cd('0x2e')](_0x38f998);return _0x1abddd[_0x32cd('0x2f')](_0x32cd('0x30'),_0x35f798+'-'+_0x241424+'/'+_0x5ef889)[_0x32cd('0x29')](_0x1af82f);}return null;};}function patchUpdates(_0x1232f1){return function(_0x5053ff){try{jsonpatch[_0x32cd('0x31')](_0x5053ff,_0x1232f1,!![]);}catch(_0x3dbd6b){return BPromise[_0x32cd('0x32')](_0x3dbd6b);}return _0x5053ff[_0x32cd('0x33')]();};}function saveUpdates(_0x42385a,_0x2ed13e){return function(_0x49da33){if(_0x49da33){return _0x49da33[_0x32cd('0x34')](_0x42385a)[_0x32cd('0x1d')](function(_0x49abf0){return _0x49abf0;});}return null;};}function removeEntity(_0x4321be,_0x1fd665){return function(_0x441824){if(_0x441824){return _0x441824[_0x32cd('0x35')]()[_0x32cd('0x1d')](function(){_0x4321be[_0x32cd('0x2e')](0xcc)[_0x32cd('0x36')]();});}};}function handleEntityNotFound(_0x24a1ef,_0x11aa2e){return function(_0x1241f3){if(!_0x1241f3){_0x24a1ef[_0x32cd('0x28')](0x194);}return _0x1241f3;};}function handleError(_0xd46797,_0x2ff2cf){_0x2ff2cf=_0x2ff2cf||0x1f4;return function(_0x4cce47){logger[_0x32cd('0x22')](_0x4cce47[_0x32cd('0x37')]);if(_0x4cce47[_0x32cd('0x38')]){delete _0x4cce47[_0x32cd('0x38')];}_0xd46797['status'](_0x2ff2cf)['send'](_0x4cce47);};}exports[_0x32cd('0x39')]=function(_0x417663,_0x3b10ec){var _0x481e23={},_0x3a4f49={},_0x330e77={'count':0x0,'rows':[]};var _0x10aefd=_[_0x32cd('0x3a')](db[_0x32cd('0x3b')][_0x32cd('0x3c')],function(_0x100b3c){return{'name':_0x100b3c[_0x32cd('0x3d')],'type':_0x100b3c[_0x32cd('0x3e')]['key']};});_0x3a4f49[_0x32cd('0x3f')]=_['map'](_0x10aefd,_0x32cd('0x38'));_0x3a4f49[_0x32cd('0x40')]=_[_0x32cd('0x41')](_0x417663[_0x32cd('0x40')]);_0x3a4f49['filters']=_[_0x32cd('0x42')](_0x3a4f49[_0x32cd('0x3f')],_0x3a4f49[_0x32cd('0x40')]);_0x481e23[_0x32cd('0x43')]=_[_0x32cd('0x42')](_0x3a4f49[_0x32cd('0x3f')],qs[_0x32cd('0x44')](_0x417663[_0x32cd('0x40')][_0x32cd('0x44')]));_0x481e23[_0x32cd('0x43')]=_0x481e23[_0x32cd('0x43')][_0x32cd('0x45')]?_0x481e23[_0x32cd('0x43')]:_0x3a4f49[_0x32cd('0x3f')];if(!_0x417663[_0x32cd('0x40')][_0x32cd('0x46')](_0x32cd('0x47'))){_0x481e23['limit']=qs[_0x32cd('0x2a')](_0x417663[_0x32cd('0x40')]['limit']);_0x481e23[_0x32cd('0x2d')]=qs[_0x32cd('0x2d')](_0x417663[_0x32cd('0x40')]['offset']);}_0x481e23['order']=qs[_0x32cd('0x48')](_0x417663[_0x32cd('0x40')][_0x32cd('0x48')]);_0x481e23[_0x32cd('0x49')]=qs['filters'](_[_0x32cd('0x4a')](_0x417663[_0x32cd('0x40')],_0x3a4f49[_0x32cd('0x4b')]),_0x10aefd);if(_0x417663[_0x32cd('0x40')][_0x32cd('0x4c')]){_0x481e23[_0x32cd('0x49')]=_[_0x32cd('0x4d')](_0x481e23['where'],{'$or':_[_0x32cd('0x3a')](_0x10aefd,function(_0x9826e){if(_0x9826e['type']!==_0x32cd('0x4e')){var _0x13b579={};_0x13b579[_0x9826e['name']]={'$like':'%'+_0x417663[_0x32cd('0x40')][_0x32cd('0x4c')]+'%'};return _0x13b579;}})});}_0x481e23=_['merge']({},_0x481e23,_0x417663[_0x32cd('0x4f')]);var _0xffd6df={'where':_0x481e23[_0x32cd('0x49')]};return db['Setting'][_0x32cd('0x2c')](_0xffd6df)[_0x32cd('0x1d')](function(_0xac75b0){_0x330e77['count']=_0xac75b0;if(_0x417663[_0x32cd('0x40')][_0x32cd('0x50')]){_0x481e23[_0x32cd('0x51')]=[{'all':!![]}];}return db[_0x32cd('0x3b')][_0x32cd('0x52')](_0x481e23);})[_0x32cd('0x1d')](function(_0xd1d4){_0x330e77['rows']=_0xd1d4;return _0x330e77;})[_0x32cd('0x1d')](respondWithFilteredResult(_0x3b10ec,_0x481e23))['catch'](handleError(_0x3b10ec,null));};exports[_0x32cd('0x53')]=function(_0x3e7de8,_0x492320){var _0x88b34b={'raw':![],'where':{'id':_0x3e7de8[_0x32cd('0x54')]['id']}},_0x27aabc={};_0x27aabc[_0x32cd('0x3f')]=_[_0x32cd('0x41')](db[_0x32cd('0x3b')][_0x32cd('0x3c')]);_0x27aabc[_0x32cd('0x40')]=_['keys'](_0x3e7de8[_0x32cd('0x40')]);_0x27aabc['filters']=_[_0x32cd('0x42')](_0x27aabc[_0x32cd('0x3f')],_0x27aabc[_0x32cd('0x40')]);_0x88b34b[_0x32cd('0x43')]=_[_0x32cd('0x42')](_0x27aabc[_0x32cd('0x3f')],qs[_0x32cd('0x44')](_0x3e7de8[_0x32cd('0x40')]['fields']));_0x88b34b[_0x32cd('0x43')]=_0x88b34b[_0x32cd('0x43')][_0x32cd('0x45')]?_0x88b34b['attributes']:_0x27aabc[_0x32cd('0x3f')];if(_0x3e7de8[_0x32cd('0x40')][_0x32cd('0x50')]){_0x88b34b['include']=[{'all':!![]}];}_0x88b34b=_['merge']({},_0x88b34b,_0x3e7de8[_0x32cd('0x4f')]);return db['Setting'][_0x32cd('0x55')](_0x88b34b)[_0x32cd('0x1d')](handleEntityNotFound(_0x492320,null))['then'](respondWithResult(_0x492320,null))['catch'](handleError(_0x492320,null));};exports['update']=function(_0x1c7b25,_0x583f01){if(_0x1c7b25['body']['id']){delete _0x1c7b25[_0x32cd('0x56')]['id'];}return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0x1c7b25[_0x32cd('0x54')]['id']}})[_0x32cd('0x1d')](handleEntityNotFound(_0x583f01,null))[_0x32cd('0x1d')](saveUpdates(_0x1c7b25[_0x32cd('0x56')],null))[_0x32cd('0x1d')](respondWithResult(_0x583f01,null))['catch'](handleError(_0x583f01,null));};exports['addLogo']=function(_0x3bccbf,_0x39c7be,_0x54ea80){if(_0x3bccbf[_0x32cd('0x57')]&&_0x3bccbf[_0x32cd('0x57')]['filename']){_0x3bccbf[_0x32cd('0x56')][_0x32cd('0x58')]=_0x3bccbf[_0x32cd('0x57')][_0x32cd('0x59')];}return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0x3bccbf['params']['id']}})['then'](handleEntityNotFound(_0x39c7be,null))[_0x32cd('0x1d')](saveUpdates(_0x3bccbf[_0x32cd('0x56')],null))[_0x32cd('0x1d')](respondWithResult(_0x39c7be,null))[_0x32cd('0x27')](handleError(_0x39c7be,null));};exports[_0x32cd('0x5a')]=function(_0x498cff,_0x67b566,_0x380213){if(_0x498cff[_0x32cd('0x57')]&&_0x498cff[_0x32cd('0x57')]['filename']){_0x498cff[_0x32cd('0x56')][_0x32cd('0x5b')]=_0x498cff[_0x32cd('0x57')][_0x32cd('0x59')];}return db['Setting'][_0x32cd('0x55')]({'where':{'id':_0x498cff['params']['id']}})[_0x32cd('0x1d')](handleEntityNotFound(_0x67b566,null))[_0x32cd('0x1d')](saveUpdates(_0x498cff[_0x32cd('0x56')],null))[_0x32cd('0x1d')](respondWithResult(_0x67b566,null))['catch'](handleError(_0x67b566,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x5d')]=function(_0x1e313d,_0x10a420,_0x1ba647){var _0x4ea13b=_0x32cd('0x5e');var _0x529c1a={'custom':![]};return utilLicense['getLicense']()[_0x32cd('0x1d')](function(_0x1e0875){if(_0x1e0875){_0x529c1a=_0x1e0875;}return db[_0x32cd('0x3b')]['find']({'where':{'id':_0x1e313d[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x58'),_0x32cd('0x5b'),'preferred',_0x32cd('0x5f'),_0x32cd('0x60'),_0x32cd('0x61'),_0x32cd('0x62'),_0x32cd('0x63')],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x10a420,null))[_0x32cd('0x1d')](function(_0x27be15){if(_0x27be15){var _0x32b0fd=_0x27be15[_0x32cd('0x58')]&&fs[_0x32cd('0x64')](path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_[_0x32cd('0x67')](_0x27be15[_0x32cd('0x58')])))?path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_[_0x32cd('0x67')](_0x27be15[_0x32cd('0x58')])):path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_[_0x32cd('0x67')](_0x32cd('0x68')));var _0x5ab5ad='default'+_[_0x32cd('0x69')]('logo');if(_0x27be15[_0x5ab5ad]||!_0x529c1a['custom']){_0x32b0fd=path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x4ea13b,_['toLower']('default_logo.svg'));}if(!fs[_0x32cd('0x64')](_0x32b0fd)){throw new db['Sequelize'][(_0x32cd('0x6a'))](_['upperFirst'](_0x32cd('0x58'))+_0x32cd('0x6b'));}return _0x10a420[_0x32cd('0x6c')](_0x32b0fd);}})['catch'](handleError(_0x10a420,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x6d')]=function(_0xda0bc0,_0x4afbdc,_0x1a5ea8){var _0x94b72a=_0x32cd('0x5e');var _0x33bbec={'custom':![]};return utilLicense[_0x32cd('0x6e')]()[_0x32cd('0x1d')](function(_0xadf8a5){if(_0xadf8a5){_0x33bbec=_0xadf8a5;}return db[_0x32cd('0x3b')]['find']({'where':{'id':_0xda0bc0[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x58'),'loginLogo',_0x32cd('0x6f'),_0x32cd('0x5f'),_0x32cd('0x60'),_0x32cd('0x61'),_0x32cd('0x62'),'defaultFavicon'],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x4afbdc,null))[_0x32cd('0x1d')](function(_0x2be08e){if(_0x2be08e){var _0x42a238=_0x2be08e[_0x32cd('0x5b')]&&fs['existsSync'](path['join'](config[_0x32cd('0x66')],_0x94b72a,_['toLower'](_0x2be08e[_0x32cd('0x5b')])))?path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x94b72a,_[_0x32cd('0x67')](_0x2be08e[_0x32cd('0x5b')])):path['join'](config['root'],_0x94b72a,_[_0x32cd('0x67')](_0x32cd('0x70')));var _0x60fc80='default'+_['upperFirst']('loginLogo');if(_0x2be08e[_0x60fc80]||!_0x33bbec['custom']){_0x42a238=path['join'](config[_0x32cd('0x66')],_0x94b72a,_['toLower'](_0x32cd('0x70')));}if(!fs['existsSync'](_0x42a238)){throw new db[(_0x32cd('0x71'))][(_0x32cd('0x6a'))](_[_0x32cd('0x69')]('loginLogo')+_0x32cd('0x6b'));}return _0x4afbdc[_0x32cd('0x6c')](_0x42a238);}})['catch'](handleError(_0x4afbdc,null));};exports[_0x32cd('0x72')]=function(_0x59d99a,_0x378f85){return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0x59d99a[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x73')]})[_0x32cd('0x1d')](respondWithResult(_0x378f85,null))['catch'](handleError(_0x378f85,null));};exports['addPreferred']=function(_0xd8d7f0,_0x37921b,_0x2f378b){if(_0xd8d7f0[_0x32cd('0x57')]&&_0xd8d7f0[_0x32cd('0x57')][_0x32cd('0x59')]){_0xd8d7f0[_0x32cd('0x56')][_0x32cd('0x6f')]=_0xd8d7f0['file'][_0x32cd('0x59')];}return db[_0x32cd('0x3b')][_0x32cd('0x55')]({'where':{'id':_0xd8d7f0[_0x32cd('0x54')]['id']}})['then'](handleEntityNotFound(_0x37921b,null))['then'](saveUpdates(_0xd8d7f0[_0x32cd('0x56')],null))['then'](respondWithResult(_0x37921b,null))[_0x32cd('0x27')](handleError(_0x37921b,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x74')]=function(_0x550a0d,_0x35d50c,_0x557c0){var _0x1eccb1=_0x32cd('0x5e');var _0x49c467={'custom':![]};return utilLicense[_0x32cd('0x6e')]()['then'](function(_0x1d4c39){if(_0x1d4c39){_0x49c467=_0x1d4c39;}return db[_0x32cd('0x3b')]['find']({'where':{'id':_0x550a0d['params']['id']},'attributes':['logo','loginLogo',_0x32cd('0x6f'),_0x32cd('0x5f'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x35d50c,null))['then'](function(_0x135a80){if(_0x135a80){var _0x40149f=_0x135a80[_0x32cd('0x6f')]&&fs[_0x32cd('0x64')](path['join'](config['root'],_0x1eccb1,_['toLower'](_0x135a80[_0x32cd('0x6f')])))?path[_0x32cd('0x65')](config['root'],_0x1eccb1,_[_0x32cd('0x67')](_0x135a80[_0x32cd('0x6f')])):path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x1eccb1,_[_0x32cd('0x67')]('default_preferred.png'));var _0x301269=_0x32cd('0x75')+_[_0x32cd('0x69')](_0x32cd('0x6f'));if(_0x135a80[_0x301269]||!_0x49c467[_0x32cd('0x76')]||!_0x49c467[_0x32cd('0x6f')]){_0x40149f=path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x1eccb1,_[_0x32cd('0x67')]('default_preferred.png'));}if(!fs[_0x32cd('0x64')](_0x40149f)){throw new db[(_0x32cd('0x71'))][(_0x32cd('0x6a'))](_[_0x32cd('0x69')](_0x32cd('0x6f'))+_0x32cd('0x6b'));}return _0x35d50c[_0x32cd('0x6c')](_0x40149f);}})[_0x32cd('0x27')](handleError(_0x35d50c,null));};exports[_0x32cd('0x77')]=function(_0x1feb72,_0x27da52,_0x1b6b57){if(_0x1feb72['file']&&_0x1feb72[_0x32cd('0x57')][_0x32cd('0x59')]){_0x1feb72[_0x32cd('0x56')][_0x32cd('0x5f')]=_0x1feb72[_0x32cd('0x57')][_0x32cd('0x59')];}return db['Setting'][_0x32cd('0x55')]({'where':{'id':_0x1feb72[_0x32cd('0x54')]['id']}})[_0x32cd('0x1d')](handleEntityNotFound(_0x27da52,null))['then'](saveUpdates(_0x1feb72[_0x32cd('0x56')],null))['then'](respondWithResult(_0x27da52,null))[_0x32cd('0x27')](handleError(_0x27da52,null));};var utilLicense=require(_0x32cd('0x5c'));exports[_0x32cd('0x78')]=function(_0x2d9104,_0x2aa21c,_0x653d){var _0x111f12=_0x32cd('0x5e');var _0x2cc6b4={'custom':![]};return utilLicense[_0x32cd('0x6e')]()[_0x32cd('0x1d')](function(_0xca921a){if(_0xca921a){_0x2cc6b4=_0xca921a;}return db['Setting'][_0x32cd('0x55')]({'where':{'id':_0x2d9104[_0x32cd('0x54')]['id']},'attributes':[_0x32cd('0x58'),'loginLogo','preferred',_0x32cd('0x5f'),_0x32cd('0x60'),'defaultLoginLogo','defaultPreferred',_0x32cd('0x63')],'raw':!![]});})[_0x32cd('0x1d')](handleEntityNotFound(_0x2aa21c,null))[_0x32cd('0x1d')](function(_0x1ca490){if(_0x1ca490){var _0x2a9293=_0x1ca490[_0x32cd('0x5f')]&&fs['existsSync'](path[_0x32cd('0x65')](config[_0x32cd('0x66')],_0x111f12,_[_0x32cd('0x67')](_0x1ca490['favicon'])))?path['join'](config[_0x32cd('0x66')],_0x111f12,_[_0x32cd('0x67')](_0x1ca490[_0x32cd('0x5f')])):path[_0x32cd('0x65')](config['root'],_0x111f12,_[_0x32cd('0x67')](_0x32cd('0x79')));var _0x48fbb6='default'+_[_0x32cd('0x69')](_0x32cd('0x5f'));if(_0x1ca490[_0x48fbb6]||!_0x2cc6b4[_0x32cd('0x76')]){_0x2a9293=path['join'](config['root'],_0x111f12,_[_0x32cd('0x67')](_0x32cd('0x79')));}if(!fs[_0x32cd('0x64')](_0x2a9293)){throw new db['Sequelize'][(_0x32cd('0x6a'))](_[_0x32cd('0x69')](_0x32cd('0x5f'))+_0x32cd('0x6b'));}return _0x2aa21c[_0x32cd('0x6c')](_0x2a9293);}})[_0x32cd('0x27')](handleError(_0x2aa21c,null));};exports[_0x32cd('0x7a')]=function(_0x24ea8a,_0x3e62fe){var _0x2f829f={'offset':moment()['utcOffset']()};_0x2f829f['now']=moment()[_0x32cd('0x7b')](_0x2f829f['offset'])[_0x32cd('0x7c')](_0x32cd('0x7d'));return _0x3e62fe[_0x32cd('0x2e')](0xc8)['send'](_0x2f829f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index d2979f4..657e35b 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x53a6ce,_0x32a352){var _0x41d59e=function(_0x1f5895){while(--_0x1f5895){_0x53a6ce['push'](_0x53a6ce['shift']());}};_0x41d59e(++_0x32a352);}(_0xe14b,0x93));var _0xbe14=function(_0x2747d5,_0x4d8719){_0x2747d5=_0x2747d5-0x0;var _0x264645=_0xe14b[_0x2747d5];return _0x264645;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x21a168,_0x1d8335){var _0x2053f1=function(_0x528523){while(--_0x528523){_0x21a168['push'](_0x21a168['shift']());}};_0x2053f1(++_0x1d8335);}(_0x34e8,0x12c));var _0x834e=function(_0x30aaba,_0x16f943){_0x30aaba=_0x30aaba-0x0;var _0x4724ec=_0x34e8[_0x30aaba];return _0x4724ec;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 5a42474..f419a16 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 _0xc540=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','catch','ShowSetting','Setting','options','raw','where','attributes','include','map','model','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5268ba,_0x1843e1){var _0x539d89=function(_0x5c9ced){while(--_0x5c9ced){_0x5268ba['push'](_0x5268ba['shift']());}};_0x539d89(++_0x1843e1);}(_0xc540,0x162));var _0x0c54=function(_0x1df409,_0x1c7d63){_0x1df409=_0x1df409-0x0;var _0x53e65d=_0xc540[_0x1df409];return _0x53e65d;};'use strict';var _=require('lodash');var util=require(_0x0c54('0x0'));var moment=require('moment');var BPromise=require(_0x0c54('0x1'));var rs=require(_0x0c54('0x2'));var fs=require('fs');var Redis=require(_0x0c54('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c54('0x4'));var logger=require(_0x0c54('0x5'))('rpc');var config=require(_0x0c54('0x6'));var jayson=require(_0x0c54('0x7'));var client=jayson[_0x0c54('0x8')][_0x0c54('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x292ed5,_0x51d04a,_0x4f2a1a){return new BPromise(function(_0x569171,_0x2cc665){return client[_0x0c54('0xa')](_0x292ed5,_0x4f2a1a)[_0x0c54('0xb')](function(_0x3ea043){logger[_0x0c54('0xc')]('Setting,\x20%s,\x20%s',_0x51d04a,_0x0c54('0xd'));logger['debug'](_0x0c54('0xe'),_0x51d04a,'request\x20sent',JSON[_0x0c54('0xf')](_0x3ea043));if(_0x3ea043[_0x0c54('0x10')]){if(_0x3ea043[_0x0c54('0x10')][_0x0c54('0x11')]===0x1f4){logger[_0x0c54('0x10')]('Setting,\x20%s,\x20%s',_0x51d04a,_0x3ea043['error'][_0x0c54('0x12')]);return _0x2cc665(_0x3ea043[_0x0c54('0x10')][_0x0c54('0x12')]);}logger[_0x0c54('0x10')](_0x0c54('0x13'),_0x51d04a,_0x3ea043[_0x0c54('0x10')][_0x0c54('0x12')]);return _0x569171(_0x3ea043[_0x0c54('0x10')]['message']);}else{logger[_0x0c54('0xc')](_0x0c54('0x13'),_0x51d04a,_0x0c54('0xd'));_0x569171(_0x3ea043['result'][_0x0c54('0x12')]);}})[_0x0c54('0x14')](function(_0x49282b){logger[_0x0c54('0x10')](_0x0c54('0x13'),_0x51d04a,_0x49282b);_0x2cc665(_0x49282b);});});}exports[_0x0c54('0x15')]=function(_0x3cb404){var _0x36763b=this;return new Promise(function(_0x359fb0,_0x41716d){return db[_0x0c54('0x16')]['find']({'raw':_0x3cb404[_0x0c54('0x17')]?_0x3cb404['options'][_0x0c54('0x18')]===undefined?!![]:![]:!![],'where':_0x3cb404[_0x0c54('0x17')]?_0x3cb404[_0x0c54('0x17')][_0x0c54('0x19')]||null:null,'attributes':_0x3cb404[_0x0c54('0x17')]?_0x3cb404[_0x0c54('0x17')][_0x0c54('0x1a')]||null:null,'include':_0x3cb404[_0x0c54('0x17')]?_0x3cb404['options'][_0x0c54('0x1b')]?_[_0x0c54('0x1c')](_0x3cb404[_0x0c54('0x17')][_0x0c54('0x1b')],function(_0x1cd41c){return{'model':db[_0x1cd41c[_0x0c54('0x1d')]],'as':_0x1cd41c['as'],'attributes':_0x1cd41c[_0x0c54('0x1a')],'include':_0x1cd41c['include']?_['map'](_0x1cd41c[_0x0c54('0x1b')],function(_0x3f57b8){return{'model':db[_0x3f57b8[_0x0c54('0x1d')]],'as':_0x3f57b8['as'],'attributes':_0x3f57b8[_0x0c54('0x1a')],'include':_0x3f57b8[_0x0c54('0x1b')]?_[_0x0c54('0x1c')](_0x3f57b8[_0x0c54('0x1b')],function(_0x236c82){return{'model':db[_0x236c82['model']],'as':_0x236c82['as'],'attributes':_0x236c82[_0x0c54('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0c54('0xb')](function(_0x1e5a3b){logger[_0x0c54('0xc')](_0x0c54('0x15'),_0x3cb404);logger['debug'](_0x0c54('0x15'),_0x3cb404,JSON[_0x0c54('0xf')](_0x1e5a3b));_0x359fb0(_0x1e5a3b);})[_0x0c54('0x14')](function(_0x4261fa){logger['error'](_0x0c54('0x15'),_0x4261fa[_0x0c54('0x12')],_0x3cb404);_0x41716d(_0x36763b[_0x0c54('0x10')](0x1f4,_0x4261fa[_0x0c54('0x12')]));});});}; \ No newline at end of file +var _0x88dc=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','ShowSetting','find','raw','options','where','attributes','include','model','map','catch','lodash'];(function(_0x51d410,_0x57e15d){var _0x4aa03c=function(_0x431fcb){while(--_0x431fcb){_0x51d410['push'](_0x51d410['shift']());}};_0x4aa03c(++_0x57e15d);}(_0x88dc,0x9f));var _0xc88d=function(_0x3c6dfe,_0x2c0656){_0x3c6dfe=_0x3c6dfe-0x0;var _0x22aa48=_0x88dc[_0x3c6dfe];return _0x22aa48;};'use strict';var _=require(_0xc88d('0x0'));var util=require(_0xc88d('0x1'));var moment=require(_0xc88d('0x2'));var BPromise=require(_0xc88d('0x3'));var rs=require(_0xc88d('0x4'));var fs=require('fs');var Redis=require(_0xc88d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc88d('0x6'))(_0xc88d('0x7'));var config=require(_0xc88d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc88d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff463,_0x58b159,_0x8afb12){return new BPromise(function(_0x4d5796,_0x28ce19){return client[_0xc88d('0xa')](_0x3ff463,_0x8afb12)[_0xc88d('0xb')](function(_0x5c54f5){logger[_0xc88d('0xc')]('Setting,\x20%s,\x20%s',_0x58b159,_0xc88d('0xd'));logger[_0xc88d('0xe')](_0xc88d('0xf'),_0x58b159,_0xc88d('0xd'),JSON[_0xc88d('0x10')](_0x5c54f5));if(_0x5c54f5[_0xc88d('0x11')]){if(_0x5c54f5[_0xc88d('0x11')][_0xc88d('0x12')]===0x1f4){logger[_0xc88d('0x11')](_0xc88d('0x13'),_0x58b159,_0x5c54f5['error'][_0xc88d('0x14')]);return _0x28ce19(_0x5c54f5['error'][_0xc88d('0x14')]);}logger[_0xc88d('0x11')](_0xc88d('0x13'),_0x58b159,_0x5c54f5['error'][_0xc88d('0x14')]);return _0x4d5796(_0x5c54f5[_0xc88d('0x11')][_0xc88d('0x14')]);}else{logger['info'](_0xc88d('0x13'),_0x58b159,'request\x20sent');_0x4d5796(_0x5c54f5[_0xc88d('0x15')]['message']);}})['catch'](function(_0x2d84fd){logger[_0xc88d('0x11')](_0xc88d('0x13'),_0x58b159,_0x2d84fd);_0x28ce19(_0x2d84fd);});});}exports[_0xc88d('0x16')]=function(_0x3fca09){var _0x149a8e=this;return new Promise(function(_0x310b21,_0xc343e5){return db['Setting'][_0xc88d('0x17')]({'raw':_0x3fca09['options']?_0x3fca09['options'][_0xc88d('0x18')]===undefined?!![]:![]:!![],'where':_0x3fca09[_0xc88d('0x19')]?_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1a')]||null:null,'attributes':_0x3fca09[_0xc88d('0x19')]?_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1b')]||null:null,'include':_0x3fca09[_0xc88d('0x19')]?_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1c')]?_['map'](_0x3fca09[_0xc88d('0x19')][_0xc88d('0x1c')],function(_0x1be5e3){return{'model':db[_0x1be5e3[_0xc88d('0x1d')]],'as':_0x1be5e3['as'],'attributes':_0x1be5e3[_0xc88d('0x1b')],'include':_0x1be5e3[_0xc88d('0x1c')]?_[_0xc88d('0x1e')](_0x1be5e3[_0xc88d('0x1c')],function(_0x1dc43e){return{'model':db[_0x1dc43e['model']],'as':_0x1dc43e['as'],'attributes':_0x1dc43e[_0xc88d('0x1b')],'include':_0x1dc43e[_0xc88d('0x1c')]?_[_0xc88d('0x1e')](_0x1dc43e[_0xc88d('0x1c')],function(_0x479dfc){return{'model':db[_0x479dfc[_0xc88d('0x1d')]],'as':_0x479dfc['as'],'attributes':_0x479dfc['attributes']};}):[]};}):[]};}):[]:[]})[_0xc88d('0xb')](function(_0x39ce4b){logger[_0xc88d('0xc')]('ShowSetting',_0x3fca09);logger['debug'](_0xc88d('0x16'),_0x3fca09,JSON['stringify'](_0x39ce4b));_0x310b21(_0x39ce4b);})[_0xc88d('0x1f')](function(_0x37a204){logger[_0xc88d('0x11')](_0xc88d('0x16'),_0x37a204['message'],_0x3fca09);_0xc343e5(_0x149a8e[_0xc88d('0x11')](0x1f4,_0x37a204[_0xc88d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 7796e66..95c9f6a 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 _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x289c97,_0x483fdb){var _0x21b27b=function(_0x345c15){while(--_0x345c15){_0x289c97['push'](_0x289c97['shift']());}};_0x21b27b(++_0x483fdb);}(_0x7a54,0x106));var _0x47a5=function(_0x368392,_0x31cab9){_0x368392=_0x368392-0x0;var _0x5f32e8=_0x7a54[_0x368392];return _0x5f32e8;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x3c0765,_0x28c42f){var _0xd83b55=function(_0x1e6325){while(--_0x1e6325){_0x3c0765['push'](_0x3c0765['shift']());}};_0xd83b55(++_0x28c42f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 07ab6ef..02d2754 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 _0x47dc=['randomstring','exports','STRING','skebby','connectel','clicksend','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue','mandatoryDisposition','sequelize'];(function(_0x4cc756,_0x455fdd){var _0x5738e3=function(_0x4fc566){while(--_0x4fc566){_0x4cc756['push'](_0x4cc756['shift']());}};_0x5738e3(++_0x455fdd);}(_0x47dc,0xfe));var _0xc47d=function(_0x5d12be,_0x257dea){_0x5d12be=_0x5d12be-0x0;var _0x467154=_0x47dc[_0x5d12be];return _0x467154;};'use strict';var Sequelize=require(_0xc47d('0x0'));var rs=require(_0xc47d('0x1'));module[_0xc47d('0x2')]={'name':{'type':Sequelize[_0xc47d('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xc47d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xc47d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xc47d('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc47d('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0xc47d('0x4'),_0xc47d('0x5'),_0xc47d('0x6'),'plivo','clickatell','bandwidth',_0xc47d('0x7'),_0xc47d('0x8'),'intelepeer')},'accountSid':{'type':Sequelize[_0xc47d('0x3')]},'authId':{'type':Sequelize[_0xc47d('0x3')]},'authToken':{'type':Sequelize[_0xc47d('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc47d('0x3')]},'apiKey':{'type':Sequelize[_0xc47d('0x3')]},'applicationId':{'type':Sequelize[_0xc47d('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xc47d('0x3')]},'deliveryReport':{'type':Sequelize[_0xc47d('0x9')],'defaultValue':![]},'description':{'type':Sequelize[_0xc47d('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc47d('0xa')],'defaultValue':function(){return _0xc47d('0xb');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc47d('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc47d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc47d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc47d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc47d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc47d('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc47d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc47d('0xc')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc47d('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xff1767){if(!_0xff1767)this[_0xc47d('0xd')]('mandatoryDispositionPauseId',null);this[_0xc47d('0xd')](_0xc47d('0xe'),_0xff1767);}}}; \ No newline at end of file +var _0x73dd=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','name','STRING','generate','ENUM','clicksend','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x2b8bbe,_0x37eb6a){var _0x1bb210=function(_0x116173){while(--_0x116173){_0x2b8bbe['push'](_0x2b8bbe['shift']());}};_0x1bb210(++_0x37eb6a);}(_0x73dd,0x130));var _0xd73d=function(_0x5722b7,_0x276f63){_0x5722b7=_0x5722b7-0x0;var _0x38ad54=_0x73dd[_0x5722b7];return _0x38ad54;};'use strict';var Sequelize=require(_0xd73d('0x0'));var rs=require(_0xd73d('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd73d('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd73d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xd73d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xd73d('0x3')],'defaultValue':function(){return rs[_0xd73d('0x4')]();}},'phone':{'type':Sequelize[_0xd73d('0x3')]},'type':{'type':Sequelize[_0xd73d('0x5')]('twilio','skebby','connectel',_0xd73d('0x6'),_0xd73d('0x7'),_0xd73d('0x8'),_0xd73d('0x9'),'csc',_0xd73d('0xa'),_0xd73d('0xb'))},'accountSid':{'type':Sequelize[_0xd73d('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xd73d('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xd73d('0x3')]},'password':{'type':Sequelize[_0xd73d('0x3')]},'apiKey':{'type':Sequelize[_0xd73d('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xd73d('0x3')]},'senderString':{'type':Sequelize[_0xd73d('0x3')]},'deliveryReport':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xd73d('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd73d('0xd')],'defaultValue':function(){return _0xd73d('0xe');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd73d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd73d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd73d('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd73d('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd73d('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xd73d('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1a5c08){if(!_0x1a5c08)this[_0xd73d('0x11')](_0xd73d('0x12'),null);this[_0xd73d('0x11')](_0xd73d('0x13'),_0x1a5c08);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 739cc30..477e7e2 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 _0xa32e=['keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsAccounts','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','Disposition','nolimit','rows','removeDispositions','ids','addAnswer','SmsAccountId','CannedAnswer','removeAnswers','sms','Applications','applications','orderBy','account','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','messageId','MessageSid','skebby','text','clicksend','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','defaults','contact','SmsInteraction','interaction','created','autoclose','push','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','receiveMessage','entity\x20found','twilio','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','priority','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','DESC','List','SmsMessage','spread','dataValues','Messages','debug','inspect','skebby_dispatch_id','connectel','statusInt','requestid','message_id','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','bandwidth','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./smsAccount.socket','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','json','reject','update','destroy','get','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','model','map','query'];(function(_0xeab51d,_0x1bc23e){var _0x190c24=function(_0x2b7136){while(--_0x2b7136){_0xeab51d['push'](_0xeab51d['shift']());}};_0x190c24(++_0x1bc23e);}(_0xa32e,0x180));var _0xea32=function(_0x396d21,_0x4a093c){_0x396d21=_0x396d21-0x0;var _0x13554a=_0xa32e[_0x396d21];return _0x13554a;};'use strict';var emlformat=require(_0xea32('0x0'));var rimraf=require(_0xea32('0x1'));var zipdir=require(_0xea32('0x2'));var jsonpatch=require(_0xea32('0x3'));var rp=require('request-promise');var moment=require(_0xea32('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xea32('0x5'));var path=require(_0xea32('0x6'));var sox=require(_0xea32('0x7'));var csv=require(_0xea32('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea32('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xea32('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xea32('0xb'));var toCsv=require('to-csv');var querystring=require(_0xea32('0xc'));var Papa=require(_0xea32('0xd'));var Redis=require(_0xea32('0xe'));var authService=require(_0xea32('0xf'));var qs=require(_0xea32('0x10'));var as=require(_0xea32('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xea32('0x12'));var utils=require(_0xea32('0x13'));var config=require(_0xea32('0x14'));var licenseUtil=require(_0xea32('0x15'));var db=require(_0xea32('0x16'))['db'];config[_0xea32('0x17')]=_['defaults'](config[_0xea32('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea32('0x17')]));require(_0xea32('0x18'))['register'](socket);var jayson=require(_0xea32('0x19'));var client=jayson['client'][_0xea32('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x2a2e99,_0x34d2c6,_0x1b4eb4,_0x407b4f){return new BPromise(function(_0x56f08e,_0x2c946b){var _0x5b3904=_0x407b4f||client;return _0x5b3904[_0xea32('0x1b')](_0x2a2e99,_0x1b4eb4)[_0xea32('0x1c')](function(_0x212e5d){logger[_0xea32('0x1d')](_0xea32('0x1e'),_0x34d2c6,_0xea32('0x1f'));logger['debug'](_0xea32('0x20'),_0x34d2c6,_0xea32('0x1f'),JSON[_0xea32('0x21')](_0x212e5d));if(_0x212e5d[_0xea32('0x22')]){if(_0x212e5d[_0xea32('0x22')]['code']===0x1f4){logger[_0xea32('0x22')](_0xea32('0x1e'),_0x34d2c6,_0x212e5d[_0xea32('0x22')][_0xea32('0x23')]);return _0x2c946b(_0x212e5d[_0xea32('0x22')][_0xea32('0x23')]);}logger['error'](_0xea32('0x1e'),_0x34d2c6,_0x212e5d[_0xea32('0x22')][_0xea32('0x23')]);return _0x56f08e(_0x212e5d[_0xea32('0x22')]['message']);}else{logger[_0xea32('0x1d')]('SmsAccount,\x20%s,\x20%s',_0x34d2c6,_0xea32('0x1f'));_0x56f08e(_0x212e5d[_0xea32('0x24')]['message']);}})[_0xea32('0x25')](function(_0x43d928){logger[_0xea32('0x22')]('SmsAccount,\x20%s,\x20%s',_0x34d2c6,_0x43d928);_0x2c946b(_0x43d928);});});}function respondWithStatusCode(_0x266980,_0x2e68c7){_0x2e68c7=_0x2e68c7||0xcc;return function(_0x3bc121){if(_0x3bc121){return _0x266980[_0xea32('0x26')](_0x2e68c7);}return _0x266980[_0xea32('0x27')](_0x2e68c7)[_0xea32('0x28')]();};}function respondWithResult(_0x2ff2d8,_0x521037){_0x521037=_0x521037||0xc8;return function(_0x1bd2c3){if(_0x1bd2c3){return _0x2ff2d8['status'](_0x521037)['json'](_0x1bd2c3);}};}function respondWithFilteredResult(_0xa7e62a,_0x5cad5e){return function(_0x20c7e8){if(_0x20c7e8){var _0x28f892=typeof _0x5cad5e[_0xea32('0x29')]===_0xea32('0x2a')&&typeof _0x5cad5e['limit']==='undefined';var _0x41eb3b=_0x20c7e8[_0xea32('0x2b')];var _0x170e48=_0x28f892?0x0:_0x5cad5e['offset'];var _0x410369=_0x28f892?_0x20c7e8['count']:_0x5cad5e['offset']+_0x5cad5e[_0xea32('0x2c')];var _0x137a9d;if(_0x410369>=_0x41eb3b){_0x410369=_0x41eb3b;_0x137a9d=0xc8;}else{_0x137a9d=0xce;}_0xa7e62a[_0xea32('0x27')](_0x137a9d);return _0xa7e62a['set']('Content-Range',_0x170e48+'-'+_0x410369+'/'+_0x41eb3b)[_0xea32('0x2d')](_0x20c7e8);}return null;};}function patchUpdates(_0x5b372a){return function(_0x283e5a){try{jsonpatch['apply'](_0x283e5a,_0x5b372a,!![]);}catch(_0x16893e){return BPromise[_0xea32('0x2e')](_0x16893e);}return _0x283e5a['save']();};}function saveUpdates(_0x380ebe,_0x509b7e){return function(_0x1ce1a5){if(_0x1ce1a5){return _0x1ce1a5[_0xea32('0x2f')](_0x380ebe)[_0xea32('0x1c')](function(_0x28d67b){return _0x28d67b;});}return null;};}function removeEntity(_0x2f2196,_0x3130f6){return function(_0x3d102b){if(_0x3d102b){return _0x3d102b[_0xea32('0x30')]()[_0xea32('0x1c')](function(){var _0x149022=_0x3d102b[_0xea32('0x31')]({'plain':!![]});var _0x8e9dc2='SmsAccounts';return db['UserProfileResource'][_0xea32('0x30')]({'where':{'type':_0x8e9dc2,'resourceId':_0x149022['id']}})[_0xea32('0x1c')](function(){return _0x3d102b;});})[_0xea32('0x1c')](function(){_0x2f2196[_0xea32('0x27')](0xcc)[_0xea32('0x28')]();});}};}function handleEntityNotFound(_0xec0180,_0x487a5e){return function(_0x57c641){if(!_0x57c641){_0xec0180[_0xea32('0x26')](0x194);}return _0x57c641;};}function handleError(_0x5c5203,_0x5474a9){_0x5474a9=_0x5474a9||0x1f4;return function(_0x4f9bb6){logger[_0xea32('0x22')](_0x4f9bb6['stack']);if(_0x4f9bb6[_0xea32('0x32')]){delete _0x4f9bb6[_0xea32('0x32')];}_0x5c5203[_0xea32('0x27')](_0x5474a9)[_0xea32('0x33')](_0x4f9bb6);};}exports[_0xea32('0x34')]=function(_0x1d792b,_0x51216d){var _0x2e036a={'include':[{'model':db[_0xea32('0x35')],'as':_0xea32('0x36')}]},_0x57fd58={},_0x3a133a={'count':0x0,'rows':[]};var _0x1119a1=_['map'](db[_0xea32('0x37')][_0xea32('0x38')],function(_0x3b0689){return{'name':_0x3b0689[_0xea32('0x39')],'type':_0x3b0689[_0xea32('0x3a')]['key']};});_0x57fd58[_0xea32('0x3b')]=_[_0xea32('0x3c')](_0x1119a1,_0xea32('0x32'));_0x57fd58[_0xea32('0x3d')]=_[_0xea32('0x3e')](_0x1d792b[_0xea32('0x3d')]);_0x57fd58['filters']=_[_0xea32('0x3f')](_0x57fd58['model'],_0x57fd58[_0xea32('0x3d')]);_0x2e036a['attributes']=_['intersection'](_0x57fd58[_0xea32('0x3b')],qs[_0xea32('0x40')](_0x1d792b[_0xea32('0x3d')]['fields']));_0x2e036a['attributes']=_0x2e036a[_0xea32('0x41')][_0xea32('0x42')]?_0x2e036a[_0xea32('0x41')]:_0x57fd58[_0xea32('0x3b')];if(!_0x1d792b[_0xea32('0x3d')][_0xea32('0x43')]('nolimit')){_0x2e036a[_0xea32('0x2c')]=qs[_0xea32('0x2c')](_0x1d792b[_0xea32('0x3d')][_0xea32('0x2c')]);_0x2e036a[_0xea32('0x29')]=qs['offset'](_0x1d792b[_0xea32('0x3d')][_0xea32('0x29')]);}_0x2e036a[_0xea32('0x44')]=qs[_0xea32('0x45')](_0x1d792b[_0xea32('0x3d')][_0xea32('0x45')]);_0x2e036a[_0xea32('0x46')]=qs[_0xea32('0x47')](_[_0xea32('0x48')](_0x1d792b['query'],_0x57fd58['filters']),_0x1119a1);if(_0x1d792b['query'][_0xea32('0x49')]){_0x2e036a[_0xea32('0x46')]=_[_0xea32('0x4a')](_0x2e036a[_0xea32('0x46')],{'$or':_['map'](_0x1119a1,function(_0x5619cd){if(_0x5619cd[_0xea32('0x3a')]!==_0xea32('0x4b')){var _0xf16df3={};_0xf16df3[_0x5619cd[_0xea32('0x32')]]={'$like':'%'+_0x1d792b['query'][_0xea32('0x49')]+'%'};return _0xf16df3;}})});}_0x2e036a=_['merge']({},_0x2e036a,_0x1d792b[_0xea32('0x4c')]);var _0x21dd80={'where':_0x2e036a[_0xea32('0x46')]};return db[_0xea32('0x37')]['count'](_0x21dd80)[_0xea32('0x1c')](function(_0xb0dbf4){_0x3a133a[_0xea32('0x2b')]=_0xb0dbf4;if(_0x1d792b[_0xea32('0x3d')][_0xea32('0x4d')]){_0x2e036a['include']=[{'all':!![]}];}return db[_0xea32('0x37')][_0xea32('0x4e')](_0x2e036a);})[_0xea32('0x1c')](function(_0x389bda){_0x3a133a['rows']=_0x389bda;return _0x3a133a;})[_0xea32('0x1c')](respondWithFilteredResult(_0x51216d,_0x2e036a))[_0xea32('0x25')](handleError(_0x51216d,null));};exports[_0xea32('0x4f')]=function(_0x227377,_0x37b502){var _0x57e0b0={'raw':![],'where':{'id':_0x227377[_0xea32('0x50')]['id']},'include':[{'model':db['Pause'],'as':_0xea32('0x36')}]},_0x29eef2={};_0x29eef2[_0xea32('0x3b')]=_['keys'](db[_0xea32('0x37')]['rawAttributes']);_0x29eef2[_0xea32('0x3d')]=_[_0xea32('0x3e')](_0x227377[_0xea32('0x3d')]);_0x29eef2[_0xea32('0x47')]=_[_0xea32('0x3f')](_0x29eef2[_0xea32('0x3b')],_0x29eef2[_0xea32('0x3d')]);_0x57e0b0['attributes']=_[_0xea32('0x3f')](_0x29eef2[_0xea32('0x3b')],qs['fields'](_0x227377['query'][_0xea32('0x40')]));_0x57e0b0[_0xea32('0x41')]=_0x57e0b0[_0xea32('0x41')][_0xea32('0x42')]?_0x57e0b0['attributes']:_0x29eef2['model'];if(_0x227377['query']['includeAll']){_0x57e0b0[_0xea32('0x51')]=[{'all':!![]}];}_0x57e0b0=_[_0xea32('0x4a')]({},_0x57e0b0,_0x227377[_0xea32('0x4c')]);return db[_0xea32('0x37')]['find'](_0x57e0b0)[_0xea32('0x1c')](handleEntityNotFound(_0x37b502,null))[_0xea32('0x1c')](respondWithResult(_0x37b502,null))['catch'](handleError(_0x37b502,null));};exports['create']=function(_0x179ee0,_0x52d570){return db[_0xea32('0x37')][_0xea32('0x52')](_0x179ee0['body'],{})['then'](function(_0x927af8){var _0x2ab229=_0x179ee0['user'][_0xea32('0x31')]({'plain':!![]});if(!_0x2ab229)throw new Error(_0xea32('0x53'));if(_0x2ab229[_0xea32('0x54')]===_0xea32('0x55')){var _0x357bb6=_0x927af8[_0xea32('0x31')]({'plain':!![]});var _0x36919f=_0xea32('0x56');return db[_0xea32('0x57')][_0xea32('0x58')]({'where':{'name':_0x36919f,'userProfileId':_0x2ab229[_0xea32('0x59')]},'raw':!![]})[_0xea32('0x1c')](function(_0x163e13){if(_0x163e13&&_0x163e13['autoAssociation']===0x0){return db[_0xea32('0x5a')][_0xea32('0x52')]({'name':_0x357bb6['name'],'resourceId':_0x357bb6['id'],'type':_0x163e13[_0xea32('0x32')],'sectionId':_0x163e13['id']},{})[_0xea32('0x1c')](function(){return _0x927af8;});}else{return _0x927af8;}})[_0xea32('0x25')](function(_0x324744){logger[_0xea32('0x22')](_0xea32('0x5b'),_0x324744);throw _0x324744;});}return _0x927af8;})['then'](respondWithResult(_0x52d570,0xc9))[_0xea32('0x25')](handleError(_0x52d570,null));};exports['update']=function(_0xa6e0f5,_0x14e6e6){if(_0xa6e0f5[_0xea32('0x5c')]['id']){delete _0xa6e0f5[_0xea32('0x5c')]['id'];}return db[_0xea32('0x37')][_0xea32('0x58')]({'where':{'id':_0xa6e0f5['params']['id']},'include':[{'model':db['Pause'],'as':_0xea32('0x36')}]})[_0xea32('0x1c')](handleEntityNotFound(_0x14e6e6,null))[_0xea32('0x1c')](saveUpdates(_0xa6e0f5['body'],null))[_0xea32('0x1c')](respondWithResult(_0x14e6e6,null))[_0xea32('0x25')](handleError(_0x14e6e6,null));};exports['destroy']=function(_0x55277e,_0xd730bd){return db[_0xea32('0x37')]['find']({'where':{'id':_0x55277e[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0xd730bd,null))[_0xea32('0x1c')](removeEntity(_0xd730bd,null))[_0xea32('0x25')](handleError(_0xd730bd,null));};exports[_0xea32('0x5d')]=function(_0x3596fb,_0x3a08fa){return db[_0xea32('0x37')]['describe']()[_0xea32('0x1c')](respondWithResult(_0x3a08fa,null))[_0xea32('0x25')](handleError(_0x3a08fa,null));};exports['addDisposition']=function(_0x2a1bbb,_0x4ddd6a,_0x546497){if(_0x2a1bbb[_0xea32('0x5c')]['id']){delete _0x2a1bbb[_0xea32('0x5c')]['id'];}return db[_0xea32('0x37')]['find']({'where':{'id':_0x2a1bbb[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x4ddd6a,null))[_0xea32('0x1c')](function(_0x53c219){if(_0x53c219){_0x2a1bbb[_0xea32('0x5c')]['SmsAccountId']=_0x53c219['id'];return db['Disposition'][_0xea32('0x52')](_0x2a1bbb[_0xea32('0x5c')]);}})[_0xea32('0x1c')](respondWithResult(_0x4ddd6a,null))[_0xea32('0x25')](handleError(_0x4ddd6a,null));};exports['getDispositions']=function(_0x2278a4,_0x30d6d0,_0x2f581f){var _0xc4cf1f={'raw':![],'where':{}};var _0x1edf88={};var _0x464f9c={'count':0x0,'rows':[]};return db[_0xea32('0x37')][_0xea32('0x5e')]({'where':{'id':_0x2278a4[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x30d6d0,null))[_0xea32('0x1c')](function(_0x36753c){if(_0x36753c){_0x1edf88[_0xea32('0x3b')]=_[_0xea32('0x3e')](db[_0xea32('0x5f')]['rawAttributes']);_0x1edf88['query']=_[_0xea32('0x3e')](_0x2278a4[_0xea32('0x3d')]);_0x1edf88[_0xea32('0x47')]=_[_0xea32('0x3f')](_0x1edf88[_0xea32('0x3b')],_0x1edf88[_0xea32('0x3d')]);_0xc4cf1f[_0xea32('0x41')]=_[_0xea32('0x3f')](_0x1edf88[_0xea32('0x3b')],qs[_0xea32('0x40')](_0x2278a4[_0xea32('0x3d')][_0xea32('0x40')]));_0xc4cf1f[_0xea32('0x41')]=_0xc4cf1f[_0xea32('0x41')][_0xea32('0x42')]?_0xc4cf1f[_0xea32('0x41')]:_0x1edf88[_0xea32('0x3b')];if(!_0x2278a4[_0xea32('0x3d')]['hasOwnProperty'](_0xea32('0x60'))){_0xc4cf1f[_0xea32('0x2c')]=qs[_0xea32('0x2c')](_0x2278a4[_0xea32('0x3d')]['limit']);_0xc4cf1f['offset']=qs[_0xea32('0x29')](_0x2278a4[_0xea32('0x3d')][_0xea32('0x29')]);}_0xc4cf1f[_0xea32('0x44')]=qs[_0xea32('0x45')](_0x2278a4[_0xea32('0x3d')]['sort']);_0xc4cf1f['where']=qs[_0xea32('0x47')](_[_0xea32('0x48')](_0x2278a4['query'],_0x1edf88[_0xea32('0x47')]));_0xc4cf1f[_0xea32('0x46')]['SmsAccountId']=_0x36753c['id'];if(_0x2278a4['query'][_0xea32('0x49')]){_0xc4cf1f['where']=_[_0xea32('0x4a')](_0xc4cf1f[_0xea32('0x46')],{'$or':_[_0xea32('0x3c')](_0xc4cf1f[_0xea32('0x41')],function(_0x3ce62b){var _0x19abe9={};_0x19abe9[_0x3ce62b]={'$like':'%'+_0x2278a4['query'][_0xea32('0x49')]+'%'};return _0x19abe9;})});}_0xc4cf1f=_[_0xea32('0x4a')]({},_0xc4cf1f,_0x2278a4[_0xea32('0x4c')]);return db[_0xea32('0x5f')][_0xea32('0x2b')]({'where':_0xc4cf1f[_0xea32('0x46')]})['then'](function(_0x4a168c){_0x464f9c[_0xea32('0x2b')]=_0x4a168c;if(_0x2278a4[_0xea32('0x3d')][_0xea32('0x4d')]){_0xc4cf1f[_0xea32('0x51')]=[{'all':!![]}];}return db[_0xea32('0x5f')][_0xea32('0x4e')](_0xc4cf1f);})[_0xea32('0x1c')](function(_0x4245cb){_0x464f9c[_0xea32('0x61')]=_0x4245cb;return _0x464f9c;});}})[_0xea32('0x1c')](respondWithFilteredResult(_0x30d6d0,_0xc4cf1f))[_0xea32('0x25')](handleError(_0x30d6d0,null));};exports[_0xea32('0x62')]=function(_0x4eb092,_0x37a39a,_0x507d33){return db[_0xea32('0x37')]['find']({'where':{'id':_0x4eb092[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x37a39a,null))['then'](function(_0x96621f){if(_0x96621f){return _0x96621f[_0xea32('0x62')](_0x4eb092[_0xea32('0x3d')][_0xea32('0x63')]);}})[_0xea32('0x1c')](respondWithStatusCode(_0x37a39a,null))[_0xea32('0x25')](handleError(_0x37a39a,null));};exports[_0xea32('0x64')]=function(_0x787c5f,_0x28c2d6,_0x58c380){if(_0x787c5f[_0xea32('0x5c')]['id']){delete _0x787c5f[_0xea32('0x5c')]['id'];}return db[_0xea32('0x37')][_0xea32('0x58')]({'where':{'id':_0x787c5f['params']['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x28c2d6,null))[_0xea32('0x1c')](function(_0x523e66){if(_0x523e66){_0x787c5f[_0xea32('0x5c')][_0xea32('0x65')]=_0x523e66['id'];return db[_0xea32('0x66')]['create'](_0x787c5f[_0xea32('0x5c')]);}})['then'](respondWithResult(_0x28c2d6,null))[_0xea32('0x25')](handleError(_0x28c2d6,null));};exports['getAnswers']=function(_0x263a33,_0x396560,_0x4f1acd){var _0x6c63e5={'raw':![],'where':{}};var _0x567c01={};var _0x186f50={'count':0x0,'rows':[]};return db[_0xea32('0x37')][_0xea32('0x5e')]({'where':{'id':_0x263a33['params']['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x396560,null))['then'](function(_0x214255){if(_0x214255){_0x567c01[_0xea32('0x3b')]=_[_0xea32('0x3e')](db['CannedAnswer'][_0xea32('0x38')]);_0x567c01['query']=_[_0xea32('0x3e')](_0x263a33[_0xea32('0x3d')]);_0x567c01[_0xea32('0x47')]=_[_0xea32('0x3f')](_0x567c01[_0xea32('0x3b')],_0x567c01[_0xea32('0x3d')]);_0x6c63e5[_0xea32('0x41')]=_[_0xea32('0x3f')](_0x567c01[_0xea32('0x3b')],qs['fields'](_0x263a33[_0xea32('0x3d')]['fields']));_0x6c63e5['attributes']=_0x6c63e5[_0xea32('0x41')][_0xea32('0x42')]?_0x6c63e5[_0xea32('0x41')]:_0x567c01['model'];if(!_0x263a33[_0xea32('0x3d')][_0xea32('0x43')]('nolimit')){_0x6c63e5[_0xea32('0x2c')]=qs[_0xea32('0x2c')](_0x263a33[_0xea32('0x3d')][_0xea32('0x2c')]);_0x6c63e5[_0xea32('0x29')]=qs[_0xea32('0x29')](_0x263a33[_0xea32('0x3d')]['offset']);}_0x6c63e5[_0xea32('0x44')]=qs[_0xea32('0x45')](_0x263a33['query'][_0xea32('0x45')]);_0x6c63e5['where']=qs[_0xea32('0x47')](_[_0xea32('0x48')](_0x263a33[_0xea32('0x3d')],_0x567c01[_0xea32('0x47')]));_0x6c63e5['where']['SmsAccountId']=_0x214255['id'];if(_0x263a33[_0xea32('0x3d')]['filter']){_0x6c63e5['where']=_[_0xea32('0x4a')](_0x6c63e5['where'],{'$or':_[_0xea32('0x3c')](_0x6c63e5['attributes'],function(_0x53179d){var _0x414b47={};_0x414b47[_0x53179d]={'$like':'%'+_0x263a33[_0xea32('0x3d')][_0xea32('0x49')]+'%'};return _0x414b47;})});}_0x6c63e5=_['merge']({},_0x6c63e5,_0x263a33['options']);return db['CannedAnswer'][_0xea32('0x2b')]({'where':_0x6c63e5['where']})[_0xea32('0x1c')](function(_0x27b6b5){_0x186f50[_0xea32('0x2b')]=_0x27b6b5;if(_0x263a33['query'][_0xea32('0x4d')]){_0x6c63e5['include']=[{'all':!![]}];}return db[_0xea32('0x66')]['findAll'](_0x6c63e5);})[_0xea32('0x1c')](function(_0x3da5ac){_0x186f50['rows']=_0x3da5ac;return _0x186f50;});}})[_0xea32('0x1c')](respondWithFilteredResult(_0x396560,_0x6c63e5))[_0xea32('0x25')](handleError(_0x396560,null));};exports[_0xea32('0x67')]=function(_0xd5a9d9,_0x133d3a,_0x1a0735){return db['SmsAccount'][_0xea32('0x58')]({'where':{'id':_0xd5a9d9['params']['id']}})['then'](handleEntityNotFound(_0x133d3a,null))[_0xea32('0x1c')](function(_0x4e511a){if(_0x4e511a){return _0x4e511a[_0xea32('0x67')](_0xd5a9d9[_0xea32('0x3d')][_0xea32('0x63')]);}})[_0xea32('0x1c')](respondWithStatusCode(_0x133d3a,null))[_0xea32('0x25')](handleError(_0x133d3a,null));};exports['notify']=function(_0x32c5f5,_0x492353,_0x252708){var _0x20c04e={'channel':_0xea32('0x68')};var _0x3a36af=[];var _0x323726=[];var _0x392cdf={};return db[_0xea32('0x37')][_0xea32('0x58')]({'where':{'id':_0x32c5f5[_0xea32('0x50')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xea32('0x69')}]})[_0xea32('0x1c')](handleEntityNotFound(_0x492353,null))['then'](function(_0x1021cc){_0x20c04e['account']=_0x1021cc;_0x20c04e[_0xea32('0x6a')]=_[_0xea32('0x6b')](_0x1021cc[_0xea32('0x69')],['priority'],['asc']);if(_0x20c04e[_0xea32('0x6c')][_0xea32('0x69')]){delete _0x20c04e[_0xea32('0x6c')]['Applications'];}return db[_0xea32('0x6d')][_0xea32('0x5d')]();})[_0xea32('0x1c')](function(_0x6ff818){if(!_0x6ff818){throw new db[(_0xea32('0x6e'))]['ValidationError'](_0xea32('0x6f'));}_0x3a36af=_[_0xea32('0x70')](_[_0xea32('0x3e')](_0x6ff818),[_0xea32('0x71'),'updatedAt']);_0x323726=_['difference'](_[_0xea32('0x3e')](_0x6ff818),[_0xea32('0x71'),_0xea32('0x72'),_0xea32('0x73'),_0xea32('0x74')]);_0x20c04e[_0xea32('0x5c')]={'mapKey':_0xea32('0x75')};if(_0x20c04e[_0xea32('0x6c')][_0xea32('0x3a')]){switch(_0x20c04e[_0xea32('0x6c')][_0xea32('0x3a')]){case'twilio':_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')]=_0x32c5f5[_0xea32('0x5c')]['From'];_0x20c04e[_0xea32('0x5c')]['body']=_0x32c5f5[_0xea32('0x5c')]['Body'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x77')]=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x78')];break;case _0xea32('0x79'):_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')]='+'+_0x32c5f5[_0xea32('0x5c')]['sender'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x7a')];break;case'connectel':_0x20c04e[_0xea32('0x5c')]['from']=_0x32c5f5[_0xea32('0x5c')]['from'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5[_0xea32('0x5c')]['message'];break;case _0xea32('0x7b'):_0x20c04e[_0xea32('0x5c')]['from']=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x76')];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5['body'][_0xea32('0x5c')];_0x20c04e['body'][_0xea32('0x77')]=_0x32c5f5['body']['message_id'];break;case _0xea32('0x7c'):_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')]=_0x32c5f5[_0xea32('0x5c')]['From'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x7d')];_0x20c04e[_0xea32('0x5c')][_0xea32('0x77')]=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x7e')];break;case _0xea32('0x7f'):_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')]='+'+_0x32c5f5[_0xea32('0x5c')][_0xea32('0x80')][0x0][_0xea32('0x76')];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x80')][0x0]['text'];_0x20c04e['body'][_0xea32('0x77')]=_0x32c5f5['body'][_0xea32('0x80')][0x0][_0xea32('0x77')];break;case _0xea32('0x81'):_0x20c04e[_0xea32('0x5c')]['from']=_0x32c5f5[_0xea32('0x5c')]['originatingAddress'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x82')][_0xea32('0x23')];break;case _0xea32('0x83'):_0x20c04e[_0xea32('0x5c')]['from']=_0x32c5f5['body'][_0xea32('0x84')];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5['body'][_0xea32('0x7a')];_0x20c04e[_0xea32('0x5c')]['messageId']=_0x32c5f5['body'][_0xea32('0x85')];break;case'bandwidth':_0x20c04e[_0xea32('0x5c')][_0xea32('0x77')]=_0x32c5f5[_0xea32('0x5c')][0x0][_0xea32('0x23')]['id'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')]=_0x32c5f5[_0xea32('0x5c')][0x0]['message']['from'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5[_0xea32('0x5c')][0x0]['message'][_0xea32('0x7a')];break;case _0xea32('0x86'):_0x20c04e[_0xea32('0x5c')]['from']=_0x32c5f5[_0xea32('0x5c')]['from'];_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x23')];_0x20c04e['body']['messageId']=_0x32c5f5[_0xea32('0x5c')][_0xea32('0x87')];break;}}if(_0x20c04e[_0xea32('0x5c')]['id']){delete _0x20c04e[_0xea32('0x5c')]['id'];}if(_[_0xea32('0x88')](_0x20c04e['body'][_0xea32('0x76')])){throw new db[(_0xea32('0x6e'))][(_0xea32('0x89'))](_0xea32('0x8a'));}if(_[_0xea32('0x88')](_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')])||_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')]===''){throw new db[(_0xea32('0x6e'))][(_0xea32('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xea32('0x88')](_0x20c04e['body'][_0xea32('0x8b')])){throw new db['Sequelize']['ValidationError'](_0xea32('0x8c')+_0x323726);}if(!_[_0xea32('0x8d')](_0x323726,_0x20c04e[_0xea32('0x5c')][_0xea32('0x8b')])){throw new db[(_0xea32('0x6e'))][(_0xea32('0x89'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x323726);}_0x392cdf[_0x20c04e[_0xea32('0x5c')][_0xea32('0x8b')]]=_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')];return db['CmList'][_0xea32('0x58')]({'where':{'id':_0x20c04e[_0xea32('0x6c')][_0xea32('0x74')]},'include':[{'model':db[_0xea32('0x6d')],'as':_0xea32('0x8e'),'where':_0x392cdf,'limit':0x1,'order':[[_0xea32('0x72'),'DESC']]}]});})['then'](handleEntityNotFound(_0x492353,null))[_0xea32('0x1c')](function(_0xffaa13){if(_0xffaa13){_0x20c04e['list']=_['omit'](_0xffaa13,[_0xea32('0x8e')]);if(_0xffaa13[_0xea32('0x8e')]['length']){return _0xffaa13[_0xea32('0x8e')][0x0];}var _0x19a853=_[_0xea32('0x8f')](_0x20c04e[_0xea32('0x5c')],{'firstName':_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')],'ListId':_0xffaa13['id']});_0x19a853[_0x20c04e[_0xea32('0x5c')][_0xea32('0x8b')]]=_0x20c04e['body'][_0xea32('0x76')];return db['CmContact']['create'](_0x19a853,{'fields':_0x3a36af,'raw':!![]});}})[_0xea32('0x1c')](handleEntityNotFound(_0x492353,null))[_0xea32('0x1c')](function(_0x265a3f){if(_0x265a3f){_0x20c04e[_0xea32('0x90')]=_0x265a3f;var _0x19e813={'ContactId':_0x265a3f['id'],'phone':_0x20c04e[_0xea32('0x5c')]['from'],'SmsAccountId':_0x32c5f5['params']['id']};var _0x18ffee={'ContactId':_0x265a3f['id'],'SmsAccountId':_0x32c5f5['params']['id'],'closed':![]};return db[_0xea32('0x91')][_0xea32('0x58')]({'where':_0x18ffee})[_0xea32('0x1c')](function(_0x935528){if(_0x935528){return[_0x935528,![]];}return db[_0xea32('0x91')][_0xea32('0x52')](_0x19e813)[_0xea32('0x1c')](function(_0x46fadc){return[_0x46fadc,!![]];});});}})['spread'](function(_0x395ef3,_0x22dae8){_0x20c04e[_0xea32('0x92')]=_0x395ef3['get']({'plain':!![]});_0x20c04e[_0xea32('0x92')][_0xea32('0x93')]=![];if(_0x22dae8){if(_0x20c04e['account'][_0xea32('0x94')]){_0x20c04e[_0xea32('0x6a')][_0xea32('0x95')]({'id':0x0,'priority':_0x20c04e['applications'][_0xea32('0x42')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xea32('0x96')});}_0x20c04e[_0xea32('0x92')][_0xea32('0x93')]=!![];}return db['SmsMessage']['create']({'phone':_0x20c04e[_0xea32('0x5c')][_0xea32('0x76')],'messageId':_0x20c04e['body'][_0xea32('0x77')],'body':_0x20c04e[_0xea32('0x5c')][_0xea32('0x5c')],'SmsAccountId':_0x32c5f5[_0xea32('0x50')]['id'],'SmsInteractionId':_0x395ef3['id'],'direction':'in','ContactId':_0x395ef3[_0xea32('0x97')],'AttachmentId':_0x20c04e[_0xea32('0x5c')][_0xea32('0x98')]});})['then'](function(_0x53653c){_0x20c04e[_0xea32('0x23')]=_0x53653c;if(!_0x20c04e[_0xea32('0x92')][_0xea32('0x99')])return;return db['User']['find']({'attributes':['id',_0xea32('0x32')],'where':{'id':_0x20c04e[_0xea32('0x92')][_0xea32('0x99')]}});})[_0xea32('0x1c')](function(_0x18f4cb){if(_0x18f4cb){_0x20c04e['applications'][_0xea32('0x9a')]({'id':0x0,'priority':0x0,'app':_0xea32('0x9b'),'appdata':_0x18f4cb[_0xea32('0x32')]+','+(_0x20c04e[_0xea32('0x6c')][_0xea32('0x9c')]||0xa),'interval':_0xea32('0x96')});}if(!_0x20c04e['interaction'][_0xea32('0x9d')])return;return db[_0xea32('0x9e')][_0xea32('0x58')]({'attributes':['id',_0xea32('0x32')],'where':{'id':_0x20c04e[_0xea32('0x92')][_0xea32('0x9d')]}});})[_0xea32('0x1c')](function(_0x27121e){if(_0x27121e){_0x20c04e[_0xea32('0x6a')]['unshift']({'id':0x0,'priority':0x1,'app':_0xea32('0x9f'),'appdata':_0x27121e[_0xea32('0x32')]+','+(_0x20c04e['account'][_0xea32('0xa0')]||0x12c),'interval':_0xea32('0x96')});}return respondWithRpcPromise('Start','startRouting',_0x20c04e);})[_0xea32('0x1c')](function(_0x42fe7e){if(_0x42fe7e){var _0x31a32c=0xc8;var _0x110965=_0xea32('0xa1');logger[_0xea32('0x1d')](_0xea32('0x20'),_0x110965,_0x31a32c,_0xea32('0xa2'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x110965,_0x31a32c,'entity\x20found',JSON['stringify'](_0x42fe7e));if(_0x20c04e['account'][_0xea32('0x3a')]===_0xea32('0xa3')){return _0x492353[_0xea32('0x27')](_0x31a32c)[_0xea32('0xa4')](_0xea32('0xa5'),_0xea32('0xa6'))[_0xea32('0x33')](_0xea32('0xa7'));}else{return _0x492353['status'](_0x31a32c)[_0xea32('0x2d')](_0x42fe7e);}}})[_0xea32('0x25')](handleError(_0x492353,null));};exports[_0xea32('0xa8')]=function(_0x1c288e,_0x300bc8){var _0x4b0fb5=_0x1c288e['params']['id'];var _0x554c76=_0x1c288e[_0xea32('0x5c')];var _0x101cfb=0xc8;var _0x5a9c7d=null;return db[_0xea32('0xa9')][_0xea32('0xaa')]({'isolationLevel':db[_0xea32('0xa9')]['Transaction'][_0xea32('0xab')][_0xea32('0xac')]},function(_0xad1e7d){return db[_0xea32('0x37')][_0xea32('0x5e')]({'where':{'id':_0x4b0fb5},'transaction':_0xad1e7d})[_0xea32('0x1c')](function(_0x3f8137){if(_0x3f8137){return db[_0xea32('0xad')]['destroy']({'where':{'SmsAccountId':_0x4b0fb5},'transaction':_0xad1e7d})['then'](function(){var _0x1a29e7=_[_0xea32('0x3c')](_0x554c76,function(_0x231c8b){_0x231c8b[_0xea32('0x65')]=_0x4b0fb5;return _0x231c8b;});return db[_0xea32('0xad')]['bulkCreate'](_0x1a29e7,{'transaction':_0xad1e7d});});}else{_0x101cfb=0x194;_0x5a9c7d=[];}});})[_0xea32('0x1c')](function(){if(_0x101cfb!==0x194){return db[_0xea32('0xad')]['findAndCountAll']({'where':{'SmsAccountId':_0x4b0fb5},'order':_0xea32('0xae')})[_0xea32('0x1c')](function(_0x53e5b0){_0x5a9c7d=_0x53e5b0;});}})[_0xea32('0x25')](function(_0x681f51){_0x101cfb=0x1f4;logger[_0xea32('0x22')](_0x681f51['stack']);if(_0x681f51[_0xea32('0x32')]){delete _0x681f51['name'];}_0x5a9c7d=_0x681f51;})[_0xea32('0xaf')](function(){if(_0x5a9c7d===null){_0x300bc8[_0xea32('0x26')](_0x101cfb);}else{if(_0x101cfb===0x1f4){_0x300bc8[_0xea32('0x27')](_0x101cfb)[_0xea32('0x33')](_0x5a9c7d);}else{_0x300bc8[_0xea32('0x27')](_0x101cfb)[_0xea32('0x2d')](_0x5a9c7d);}}});};exports[_0xea32('0xb0')]=function(_0x19ab4a,_0x4b6dcc,_0x4c6647){var _0x179d3a={};var _0x58c2d2={};var _0xabda9f;var _0x13022a;return db[_0xea32('0x37')][_0xea32('0x5e')]({'where':{'id':_0x19ab4a[_0xea32('0x50')]['id']}})['then'](handleEntityNotFound(_0x4b6dcc,null))[_0xea32('0x1c')](function(_0x334daa){if(_0x334daa){_0xabda9f=_0x334daa;_0x58c2d2[_0xea32('0x3b')]=_[_0xea32('0x3e')](db['SmsApplication'][_0xea32('0x38')]);_0x58c2d2[_0xea32('0x3d')]=_[_0xea32('0x3e')](_0x19ab4a[_0xea32('0x3d')]);_0x58c2d2[_0xea32('0x47')]=_[_0xea32('0x3f')](_0x58c2d2['model'],_0x58c2d2['query']);_0x179d3a[_0xea32('0x41')]=_[_0xea32('0x3f')](_0x58c2d2[_0xea32('0x3b')],qs[_0xea32('0x40')](_0x19ab4a[_0xea32('0x3d')][_0xea32('0x40')]));_0x179d3a[_0xea32('0x41')]=_0x179d3a['attributes'][_0xea32('0x42')]?_0x179d3a['attributes']:_0x58c2d2[_0xea32('0x3b')];_0x179d3a[_0xea32('0x44')]=qs[_0xea32('0x45')](_0x19ab4a[_0xea32('0x3d')][_0xea32('0x45')]);_0x179d3a[_0xea32('0x46')]=qs['filters'](_[_0xea32('0x48')](_0x19ab4a[_0xea32('0x3d')],_0x58c2d2['filters']));if(_0x19ab4a['query'][_0xea32('0x49')]){_0x179d3a[_0xea32('0x46')]=_[_0xea32('0x4a')](_0x179d3a['where'],{'$or':_[_0xea32('0x3c')](_0x179d3a[_0xea32('0x41')],function(_0x175048){var _0x508192={};_0x508192[_0x175048]={'$like':'%'+_0x19ab4a[_0xea32('0x3d')][_0xea32('0x49')]+'%'};return _0x508192;})});}_0x179d3a=_[_0xea32('0x4a')]({},_0x179d3a,_0x19ab4a['options']);return _0xabda9f[_0xea32('0xb0')](_0x179d3a);}})[_0xea32('0x1c')](function(_0x194b88){if(_0x194b88){_0x13022a=_0x194b88[_0xea32('0x42')];if(!_0x19ab4a[_0xea32('0x3d')][_0xea32('0x43')]('nolimit')){_0x179d3a[_0xea32('0x2c')]=qs[_0xea32('0x2c')](_0x19ab4a['query'][_0xea32('0x2c')]);_0x179d3a[_0xea32('0x29')]=qs['offset'](_0x19ab4a[_0xea32('0x3d')][_0xea32('0x29')]);}return _0xabda9f[_0xea32('0xb0')](_0x179d3a);}})['then'](function(_0x319cf6){if(_0x319cf6){return _0x319cf6?{'count':_0x13022a,'rows':_0x319cf6}:null;}})[_0xea32('0x1c')](respondWithResult(_0x4b6dcc,null))[_0xea32('0x25')](handleError(_0x4b6dcc,null));};exports[_0xea32('0xb1')]=function(_0x16b616,_0x451b3b,_0x560066){var _0x3c7028={'raw':![],'where':{}};var _0x4841a2={};var _0x3e83dc={'count':0x0,'rows':[]};return db[_0xea32('0x37')]['findOne']({'where':{'id':_0x16b616[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x451b3b,null))[_0xea32('0x1c')](function(_0x241506){if(_0x241506){_0x4841a2[_0xea32('0x3b')]=_[_0xea32('0x3e')](db['SmsInteraction'][_0xea32('0x38')]);_0x4841a2['query']=_[_0xea32('0x3e')](_0x16b616[_0xea32('0x3d')]);_0x4841a2['filters']=_[_0xea32('0x3f')](_0x4841a2[_0xea32('0x3b')],_0x4841a2[_0xea32('0x3d')]);_0x3c7028[_0xea32('0x41')]=_[_0xea32('0x3f')](_0x4841a2['model'],qs[_0xea32('0x40')](_0x16b616[_0xea32('0x3d')][_0xea32('0x40')]));_0x3c7028['attributes']=_0x3c7028[_0xea32('0x41')][_0xea32('0x42')]?_0x3c7028[_0xea32('0x41')]:_0x4841a2[_0xea32('0x3b')];if(!_0x16b616[_0xea32('0x3d')]['hasOwnProperty']('nolimit')){_0x3c7028[_0xea32('0x2c')]=qs[_0xea32('0x2c')](_0x16b616['query'][_0xea32('0x2c')]);_0x3c7028[_0xea32('0x29')]=qs[_0xea32('0x29')](_0x16b616[_0xea32('0x3d')][_0xea32('0x29')]);}_0x3c7028[_0xea32('0x44')]=qs[_0xea32('0x45')](_0x16b616[_0xea32('0x3d')][_0xea32('0x45')]);_0x3c7028[_0xea32('0x46')]=qs[_0xea32('0x47')](_[_0xea32('0x48')](_0x16b616[_0xea32('0x3d')],_0x4841a2[_0xea32('0x47')]));_0x3c7028[_0xea32('0x46')][_0xea32('0x65')]=_0x241506['id'];if(_0x16b616[_0xea32('0x3d')][_0xea32('0x49')]){_0x3c7028[_0xea32('0x46')]=_[_0xea32('0x4a')](_0x3c7028[_0xea32('0x46')],{'$or':_[_0xea32('0x3c')](_0x3c7028[_0xea32('0x41')],function(_0x311569){var _0x4b3f2d={};_0x4b3f2d[_0x311569]={'$like':'%'+_0x16b616[_0xea32('0x3d')][_0xea32('0x49')]+'%'};return _0x4b3f2d;})});}_0x3c7028=_[_0xea32('0x4a')]({},_0x3c7028,_0x16b616[_0xea32('0x4c')]);return db[_0xea32('0x91')][_0xea32('0x2b')]({'where':_0x3c7028['where']})['then'](function(_0x1bb80b){_0x3e83dc[_0xea32('0x2b')]=_0x1bb80b;if(_0x16b616[_0xea32('0x3d')][_0xea32('0x4d')]){_0x3c7028['include']=[{'model':db[_0xea32('0x6d')],'as':_0xea32('0xb2'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xea32('0x32'),_0xea32('0xb3'),_0xea32('0xb4')],'required':![]},{'model':db[_0xea32('0xb5')],'as':_0xea32('0xb6'),'attributes':['id','name',_0xea32('0xb7')],'where':_0x16b616[_0xea32('0x3d')][_0xea32('0xb8')]?{'id':_0x16b616[_0xea32('0x3d')][_0xea32('0xb8')]}:undefined,'required':_0x16b616[_0xea32('0x3d')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0xea32('0x4e')](_0x3c7028);})[_0xea32('0x1c')](function(_0x4632dd){_0x3e83dc[_0xea32('0x61')]=_0x4632dd;return _0x3e83dc;});}})[_0xea32('0x1c')](respondWithFilteredResult(_0x451b3b,_0x3c7028))[_0xea32('0x25')](handleError(_0x451b3b,null));};exports['send']=function(_0x162c06,_0x59d401,_0x26e0c7){var _0x2f78dc,_0x28a2fc,_0x3ffdf7;if(_['isNil'](_0x162c06['body'][_0xea32('0x5c')])||_0x162c06[_0xea32('0x5c')][_0xea32('0x5c')]===''){throw new db[(_0xea32('0x6e'))][(_0xea32('0x89'))](_0xea32('0xb9'));}if(_[_0xea32('0x88')](_0x162c06[_0xea32('0x5c')]['to'])){throw new db['Sequelize'][(_0xea32('0x89'))](_0xea32('0xba'));}_0x2f78dc=_0x162c06[_0xea32('0x5c')]['to'];return db[_0xea32('0x37')][_0xea32('0x58')]({'where':{'id':_0x162c06[_0xea32('0x50')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xea32('0x6d')],'as':_0xea32('0x8e'),'where':{'mobile':_0x2f78dc},'limit':0x1,'order':[['updatedAt',_0xea32('0xbb')]]}]}]})[_0xea32('0x1c')](handleEntityNotFound(_0x59d401,null))['then'](function(_0x347472){if(_0x347472&&_0x347472['List']){_0x28a2fc=_0x347472[_0xea32('0x31')]({'plain':!![]});if(_0x28a2fc[_0xea32('0xbc')]&&_0x28a2fc['List'][_0xea32('0x8e')][_0xea32('0x42')]){return _0x28a2fc[_0xea32('0xbc')][_0xea32('0x8e')][0x0];}return db[_0xea32('0x6d')][_0xea32('0x52')](_[_0xea32('0x8f')](_0x162c06[_0xea32('0x5c')],{'firstName':_0x2f78dc,'mobile':_0x2f78dc,'phone':_0x2f78dc,'ListId':_0x28a2fc[_0xea32('0x74')]}));}})[_0xea32('0x1c')](handleEntityNotFound(_0x59d401,null))[_0xea32('0x1c')](function(_0x571e42){if(_0x571e42){_0x3ffdf7=_0x571e42;return db[_0xea32('0x91')][_0xea32('0x58')]({'where':{'ContactId':_0x3ffdf7['id'],'closed':![],'SmsAccountId':_0x28a2fc['id']}})[_0xea32('0x1c')](function(_0x19264e){if(_0x19264e){return[_0x19264e,![]];}return db['SmsInteraction'][_0xea32('0x52')]({'UserId':_0x162c06[_0xea32('0x55')]['id'],'ContactId':_0x3ffdf7['id'],'SmsAccountId':_0x28a2fc['id'],'phone':_0x2f78dc,'firstMsgDirection':'out','Messages':[_[_0xea32('0x4a')](_0x162c06['body'],{'read':![],'body':_0x162c06['body'][_0xea32('0x5c')],'phone':_0x2f78dc,'SmsAccountId':_0x28a2fc['id'],'UserId':_0x162c06[_0xea32('0x55')]['id'],'ContactId':_0x3ffdf7['id']})]},{'include':[{'model':db[_0xea32('0xbd')],'as':'Messages'}]})['then'](function(_0x423c6b){return[_0x423c6b,!![]];});});}})[_0xea32('0xbe')](function(_0x299569,_0x3f011f){if(_0x3f011f){return _0x299569;}return db['SmsMessage'][_0xea32('0x52')](_[_0xea32('0x4a')](_0x162c06[_0xea32('0x5c')],{'read':![],'body':_0x162c06['body']['body'],'phone':_0x2f78dc,'SmsAccountId':_0x28a2fc['id'],'SmsInteractionId':_0x299569['id'],'UserId':_0x162c06[_0xea32('0x55')]['id'],'ContactId':_0x3ffdf7['id']}))[_0xea32('0x1c')](function(_0x17af23){_0x299569[_0xea32('0xbf')][_0xea32('0xc0')]=[];_0x299569[_0xea32('0xbf')][_0xea32('0xc0')]['push'](_0x17af23[_0xea32('0xbf')]);return _0x299569;});})['then'](respondWithResult(_0x59d401,null))[_0xea32('0x25')](handleError(_0x59d401,null));};exports[_0xea32('0x27')]=function(_0x1fd360,_0x724779,_0x357ccf){if(_0x1fd360[_0xea32('0x5c')]['id']){delete _0x1fd360[_0xea32('0x5c')]['id'];}var _0x1d0840,_0x454c33,_0x25d713;return db[_0xea32('0x37')][_0xea32('0x58')]({'where':{'id':_0x1fd360[_0xea32('0x50')]['id']}})['then'](handleEntityNotFound(_0x724779,null))[_0xea32('0x1c')](function(_0xf86797){if(_0xf86797){_0x25d713=_0xf86797;logger[_0xea32('0xc1')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xea32('0x27'),'received\x20delivery\x20report\x20from',_0xf86797[_0xea32('0x3a')],util[_0xea32('0xc2')](_0x1fd360[_0xea32('0x5c')],{'showHidden':![],'depth':null}));switch(_0xf86797[_0xea32('0x3a')]){case _0xea32('0x79'):if(_0x1fd360[_0xea32('0x5c')][_0xea32('0xc3')]&&_0x1fd360[_0xea32('0x5c')][_0xea32('0x27')]){_0x454c33=_0x1fd360[_0xea32('0x5c')][_0xea32('0x27')];return db[_0xea32('0xbd')][_0xea32('0x58')]({'where':{'messageId':_0x1fd360['body'][_0xea32('0xc3')]}});}break;case _0xea32('0xc4'):if(_0x1fd360['body']['requestid']&&_0x1fd360[_0xea32('0x5c')][_0xea32('0xc5')]){_0x454c33=_0x1fd360[_0xea32('0x5c')][_0xea32('0xc5')];return db['SmsMessage'][_0xea32('0x58')]({'where':{'messageId':_0x1fd360[_0xea32('0x5c')][_0xea32('0xc6')]}});}break;case _0xea32('0x7b'):if(_0x1fd360['body'][_0xea32('0xc7')]&&_0x1fd360[_0xea32('0x5c')][_0xea32('0xc8')]){_0x454c33=_0x1fd360[_0xea32('0x5c')][_0xea32('0xc8')];return db[_0xea32('0xbd')][_0xea32('0x58')]({'where':{'messageId':_0x1fd360['body'][_0xea32('0xc7')]}});}break;case _0xea32('0x7f'):var _0x1a5ab1=_0x1fd360['body'][_0xea32('0x80')][0x0];if(_0x1a5ab1[_0xea32('0x77')]&&_0x1a5ab1[_0xea32('0x27')][_0xea32('0xc9')]===_0xea32('0xca')){_0x454c33=_0x1a5ab1[_0xea32('0x27')][_0xea32('0xc9')];return db[_0xea32('0xbd')]['find']({'where':{'messageId':_0x1a5ab1[_0xea32('0x77')]}});}break;case _0xea32('0x83'):if(_0x1fd360[_0xea32('0x5c')][_0xea32('0x77')]&&_0x1fd360[_0xea32('0x5c')][_0xea32('0x27')]){_0x454c33=_0x1fd360[_0xea32('0x5c')][_0xea32('0x27')];return db[_0xea32('0xbd')][_0xea32('0x58')]({'where':{'messageId':_0x1fd360[_0xea32('0x5c')][_0xea32('0x77')]}});}break;case'bandwidth':if(_0x1fd360[_0xea32('0x5c')][0x0][_0xea32('0x23')]['id']){_0x454c33=_0x1fd360[_0xea32('0x5c')][0x0][_0xea32('0x3a')];return db['SmsMessage'][_0xea32('0x58')]({'where':{'messageId':_0x1fd360[_0xea32('0x5c')][0x0][_0xea32('0x23')]['id']}});}break;case _0xea32('0x86'):if(_0x1fd360[_0xea32('0x5c')][_0xea32('0xcb')]&&_0x1fd360['body'][_0xea32('0x27')]){_0x454c33=_0x1fd360[_0xea32('0x5c')][_0xea32('0x27')];return db[_0xea32('0xbd')][_0xea32('0x58')]({'where':{'messageId':_0x1fd360['body'][_0xea32('0xcb')]}});}break;}}})[_0xea32('0x1c')](handleEntityNotFound(_0x724779,null))[_0xea32('0x1c')](function(_0x2581d7){if(_0x2581d7){_0x1d0840=_0x2581d7;switch(_0x25d713[_0xea32('0x3a')]){case'skebby':if(_0x454c33==='DELIVERED'){return _0x1d0840[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')](_0xea32('0x20'),'status','skebby',util[_0xea32('0xc2')](_0x1fd360[_0xea32('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xea32('0xc4'):if(_0x454c33==='1'){return _0x1d0840[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')](_0xea32('0x20'),_0xea32('0x27'),_0xea32('0x79'),util[_0xea32('0xc2')](_0x1fd360[_0xea32('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xea32('0x7b'):if(!_0x1fd360[_0xea32('0x5c')][_0xea32('0xcc')]&&_0x454c33>=0xc8&&_0x454c33<=0xce){return _0x1d0840[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')](_0xea32('0x20'),'status',_0xea32('0x7b'),util['inspect'](_0x1fd360['body'],{'showHidden':![],'depth':null}));}break;case _0xea32('0x7f'):var _0x19ed12=_0x1fd360[_0xea32('0x5c')][_0xea32('0x80')][0x0];if(_0x19ed12[_0xea32('0x27')]['groupName']===_0xea32('0xca')){return _0x1d0840[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')](_0xea32('0x20'),'status',_0xea32('0x7f'),util[_0xea32('0xc2')](_0x1fd360[_0xea32('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xea32('0x83'):if(_0x454c33==_0xea32('0xcd')||_0x454c33=='RECEIVED_BY_RECIPIENT'){return _0x1d0840[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xea32('0x27'),'clickatell',util[_0xea32('0xc2')](_0x1fd360[_0xea32('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xea32('0xce'):if(_0x454c33==_0xea32('0xcf')){return _0x1d0840[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')](_0xea32('0x20'),_0xea32('0x27'),_0xea32('0xce'),util[_0xea32('0xc2')](_0x1fd360[_0xea32('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xea32('0x86'):if(_0x454c33===_0xea32('0xd0')||_0x454c33===_0xea32('0xd1')){return _0x1d0840[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xea32('0x86'),util['inspect'](_0x1fd360[_0xea32('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x1d0840;}})[_0xea32('0x1c')](respondWithResult(_0x724779,null))[_0xea32('0x25')](handleError(_0x724779,null));};exports[_0xea32('0xd2')]=function(_0x2b6003,_0x22eefa,_0x1ba1c0){var _0x44055a,_0x4b1eb4,_0x2478b1;return db[_0xea32('0x37')][_0xea32('0x58')]({'where':{'id':_0x2b6003[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x22eefa,null))[_0xea32('0x1c')](function(_0x471693){if(_0x471693){_0x2478b1=_0x471693;logger[_0xea32('0xc1')](_0xea32('0x20'),_0xea32('0x27'),_0xea32('0xd3'),_0x471693[_0xea32('0x3a')],util[_0xea32('0xc2')](_0x2b6003['query'],{'showHidden':![],'depth':null}));switch(_0x471693[_0xea32('0x3a')]){case _0xea32('0x81'):if(_0x2b6003[_0xea32('0x3d')][_0xea32('0xd4')]&&_0x2b6003[_0xea32('0x3d')][_0xea32('0xd5')]){_0x4b1eb4=_0x2b6003[_0xea32('0x3d')]['state'];return db[_0xea32('0xbd')]['find']({'where':{'messageId':_0x2b6003[_0xea32('0x3d')][_0xea32('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x22eefa,null))[_0xea32('0x1c')](function(_0x1aa81e){if(_0x1aa81e){_0x44055a=_0x1aa81e;switch(_0x2478b1[_0xea32('0x3a')]){case'csc':if(_0x4b1eb4==='2'||_0x4b1eb4==='6'){return _0x44055a[_0xea32('0x2f')]({'read':!![]});}else{logger[_0xea32('0x22')](_0xea32('0x20'),_0xea32('0x27'),_0xea32('0x81'),util[_0xea32('0xc2')](_0x2b6003[_0xea32('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x44055a;}})[_0xea32('0x1c')](respondWithResult(_0x22eefa,null))[_0xea32('0x25')](handleError(_0x22eefa,null));};exports[_0xea32('0xd6')]=function(_0x2e2e2f,_0x532775,_0x9da77f){return db['SmsAccount'][_0xea32('0x58')]({'where':{'id':_0x2e2e2f['params']['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x532775,null))[_0xea32('0x1c')](function(_0x6552d1){if(_0x6552d1){return _0x6552d1['addAgents'](_0x2e2e2f['body']['ids'],_[_0xea32('0xd7')](_0x2e2e2f[_0xea32('0x5c')],[_0xea32('0x63'),'id'])||{})[_0xea32('0xbe')](function(_0x35071e){for(var _0xa68654=0x0;_0xa68654<_0x2e2e2f[_0xea32('0x5c')][_0xea32('0x63')][_0xea32('0x42')];_0xa68654+=0x1){socket[_0xea32('0xd8')](_0xea32('0xd9'),{'UserId':Number(_0x2e2e2f[_0xea32('0x5c')][_0xea32('0x63')][_0xa68654]),'SmsAccountId':Number(_0x2e2e2f['params']['id'])});}return _0x35071e;});}})[_0xea32('0x1c')](respondWithResult(_0x532775,null))['catch'](handleError(_0x532775,null));};exports['removeAgents']=function(_0x17c60b,_0x162eb1,_0x4cb43d){return db['SmsAccount'][_0xea32('0x58')]({'where':{'id':_0x17c60b[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x162eb1,null))[_0xea32('0x1c')](function(_0x1ec0d0){if(_0x1ec0d0){return _0x1ec0d0[_0xea32('0xda')](_0x17c60b[_0xea32('0x3d')]['ids'])[_0xea32('0x1c')](function(){if(_[_0xea32('0xdb')](_0x17c60b[_0xea32('0x3d')]['ids'])){for(var _0x1266cb=0x0;_0x1266cb<_0x17c60b[_0xea32('0x3d')][_0xea32('0x63')][_0xea32('0x42')];_0x1266cb+=0x1){socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x17c60b[_0xea32('0x3d')][_0xea32('0x63')][_0x1266cb]),'SmsAccountId':Number(_0x17c60b[_0xea32('0x50')]['id'])});}}else{socket[_0xea32('0xd8')](_0xea32('0xdc'),{'UserId':Number(_0x17c60b[_0xea32('0x3d')]['ids']),'SmsAccountId':Number(_0x17c60b[_0xea32('0x50')]['id'])});}});}})[_0xea32('0x1c')](respondWithStatusCode(_0x162eb1,null))['catch'](handleError(_0x162eb1,null));};exports[_0xea32('0xdd')]=function(_0x4f8f4c,_0x5287b0,_0x4acad7){var _0x1d38f9={};var _0x41277b={};var _0x27fbc5;var _0x5765c5;return db['SmsAccount'][_0xea32('0x5e')]({'where':{'id':_0x4f8f4c[_0xea32('0x50')]['id']}})[_0xea32('0x1c')](handleEntityNotFound(_0x5287b0,null))[_0xea32('0x1c')](function(_0x4cdfc1){if(_0x4cdfc1){_0x27fbc5=_0x4cdfc1;_0x41277b[_0xea32('0x3b')]=_[_0xea32('0x3e')](db[_0xea32('0xde')]['rawAttributes']);_0x41277b[_0xea32('0x3d')]=_['keys'](_0x4f8f4c[_0xea32('0x3d')]);_0x41277b[_0xea32('0x47')]=_[_0xea32('0x3f')](_0x41277b[_0xea32('0x3b')],_0x41277b[_0xea32('0x3d')]);_0x1d38f9[_0xea32('0x41')]=_['intersection'](_0x41277b[_0xea32('0x3b')],qs[_0xea32('0x40')](_0x4f8f4c[_0xea32('0x3d')]['fields']));_0x1d38f9[_0xea32('0x41')]=_0x1d38f9[_0xea32('0x41')][_0xea32('0x42')]?_0x1d38f9[_0xea32('0x41')]:_0x41277b[_0xea32('0x3b')];_0x1d38f9[_0xea32('0x44')]=qs[_0xea32('0x45')](_0x4f8f4c['query'][_0xea32('0x45')]);_0x1d38f9[_0xea32('0x46')]=qs[_0xea32('0x47')](_[_0xea32('0x48')](_0x4f8f4c[_0xea32('0x3d')],_0x41277b['filters']));if(_0x4f8f4c[_0xea32('0x3d')]['filter']){_0x1d38f9['where']=_[_0xea32('0x4a')](_0x1d38f9[_0xea32('0x46')],{'$or':_['map'](_0x1d38f9[_0xea32('0x41')],function(_0x52f508){var _0xb6dbc2={};_0xb6dbc2[_0x52f508]={'$like':'%'+_0x4f8f4c['query'][_0xea32('0x49')]+'%'};return _0xb6dbc2;})});}_0x1d38f9=_['merge']({},_0x1d38f9,_0x4f8f4c['options']);return _0x27fbc5[_0xea32('0xdd')](_0x1d38f9);}})['then'](function(_0x5308cd){if(_0x5308cd){_0x5765c5=_0x5308cd[_0xea32('0x42')];if(!_0x4f8f4c[_0xea32('0x3d')][_0xea32('0x43')]('nolimit')){_0x1d38f9[_0xea32('0x2c')]=qs['limit'](_0x4f8f4c[_0xea32('0x3d')][_0xea32('0x2c')]);_0x1d38f9['offset']=qs[_0xea32('0x29')](_0x4f8f4c[_0xea32('0x3d')][_0xea32('0x29')]);}return _0x27fbc5['getAgents'](_0x1d38f9);}})[_0xea32('0x1c')](function(_0x5b1a99){if(_0x5b1a99){return _0x5b1a99?{'count':_0x5765c5,'rows':_0x5b1a99}:null;}})['then'](respondWithResult(_0x5287b0,null))['catch'](handleError(_0x5287b0,null));}; \ No newline at end of file +var _0x8b1b=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','sendStatus','status','json','limit','undefined','offset','count','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','end','stack','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','getDispositions','findOne','hasOwnProperty','pick','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','applications','orderBy','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','messageId','text','connectel','message_id','plivo','From','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','SmsMessage','AttachmentId','UserId','User','unshift','*,*,*,*','queue','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','send','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','redif','DELIVERED','error_code','infobip','DELIVERED_TO_GATEWAY','bandwidth','message-delivered','intelepeer','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','emit','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0x8b1b,0x1bc));var _0xb8b1=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x8b1b[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb8b1('0x0'));var jsonpatch=require(_0xb8b1('0x1'));var rp=require(_0xb8b1('0x2'));var moment=require(_0xb8b1('0x3'));var BPromise=require(_0xb8b1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb8b1('0x5'));var sox=require(_0xb8b1('0x6'));var csv=require(_0xb8b1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8b1('0x8'));var squel=require(_0xb8b1('0x9'));var crypto=require(_0xb8b1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb8b1('0x7'));var querystring=require(_0xb8b1('0xb'));var Papa=require('papaparse');var Redis=require(_0xb8b1('0xc'));var authService=require(_0xb8b1('0xd'));var qs=require(_0xb8b1('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8b1('0xf'));var logger=require(_0xb8b1('0x10'))(_0xb8b1('0x11'));var utils=require(_0xb8b1('0x12'));var config=require(_0xb8b1('0x13'));var licenseUtil=require(_0xb8b1('0x14'));var db=require(_0xb8b1('0x15'))['db'];config[_0xb8b1('0x16')]=_[_0xb8b1('0x17')](config[_0xb8b1('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xb8b1('0x18'))(new Redis(config[_0xb8b1('0x16')]));require(_0xb8b1('0x19'))[_0xb8b1('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb8b1('0x1b')][_0xb8b1('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x268fc3,_0x387e8e,_0x405e25,_0x1abb70){return new BPromise(function(_0x2ed2c7,_0x369013){var _0x680e1c=_0x1abb70||client;return _0x680e1c['request'](_0x268fc3,_0x405e25)[_0xb8b1('0x1d')](function(_0x16fb1f){logger['info'](_0xb8b1('0x1e'),_0x387e8e,_0xb8b1('0x1f'));logger[_0xb8b1('0x20')](_0xb8b1('0x21'),_0x387e8e,'request\x20sent',JSON[_0xb8b1('0x22')](_0x16fb1f));if(_0x16fb1f['error']){if(_0x16fb1f['error'][_0xb8b1('0x23')]===0x1f4){logger[_0xb8b1('0x24')](_0xb8b1('0x1e'),_0x387e8e,_0x16fb1f[_0xb8b1('0x24')][_0xb8b1('0x25')]);return _0x369013(_0x16fb1f[_0xb8b1('0x24')][_0xb8b1('0x25')]);}logger[_0xb8b1('0x24')](_0xb8b1('0x1e'),_0x387e8e,_0x16fb1f[_0xb8b1('0x24')][_0xb8b1('0x25')]);return _0x2ed2c7(_0x16fb1f[_0xb8b1('0x24')]['message']);}else{logger[_0xb8b1('0x26')](_0xb8b1('0x1e'),_0x387e8e,_0xb8b1('0x1f'));_0x2ed2c7(_0x16fb1f[_0xb8b1('0x27')][_0xb8b1('0x25')]);}})[_0xb8b1('0x28')](function(_0x5a26cc){logger[_0xb8b1('0x24')]('SmsAccount,\x20%s,\x20%s',_0x387e8e,_0x5a26cc);_0x369013(_0x5a26cc);});});}function respondWithStatusCode(_0x501584,_0x3047d1){_0x3047d1=_0x3047d1||0xcc;return function(_0x260887){if(_0x260887){return _0x501584[_0xb8b1('0x29')](_0x3047d1);}return _0x501584[_0xb8b1('0x2a')](_0x3047d1)['end']();};}function respondWithResult(_0x50571e,_0x3c031c){_0x3c031c=_0x3c031c||0xc8;return function(_0x4444f2){if(_0x4444f2){return _0x50571e[_0xb8b1('0x2a')](_0x3c031c)[_0xb8b1('0x2b')](_0x4444f2);}};}function respondWithFilteredResult(_0x498087,_0x58d77c){return function(_0x32edd1){if(_0x32edd1){var _0x11f9a3=typeof _0x58d77c['offset']==='undefined'&&typeof _0x58d77c[_0xb8b1('0x2c')]===_0xb8b1('0x2d');var _0x5684b9=_0x32edd1['count'];var _0x316f33=_0x11f9a3?0x0:_0x58d77c[_0xb8b1('0x2e')];var _0x2f9b1a=_0x11f9a3?_0x32edd1[_0xb8b1('0x2f')]:_0x58d77c[_0xb8b1('0x2e')]+_0x58d77c[_0xb8b1('0x2c')];var _0x45b339;if(_0x2f9b1a>=_0x5684b9){_0x2f9b1a=_0x5684b9;_0x45b339=0xc8;}else{_0x45b339=0xce;}_0x498087[_0xb8b1('0x2a')](_0x45b339);return _0x498087['set'](_0xb8b1('0x30'),_0x316f33+'-'+_0x2f9b1a+'/'+_0x5684b9)['json'](_0x32edd1);}return null;};}function patchUpdates(_0x10e6b0){return function(_0x501e46){try{jsonpatch[_0xb8b1('0x31')](_0x501e46,_0x10e6b0,!![]);}catch(_0x1a6c5d){return BPromise[_0xb8b1('0x32')](_0x1a6c5d);}return _0x501e46[_0xb8b1('0x33')]();};}function saveUpdates(_0x3f6a6e,_0x1ba67){return function(_0x279b72){if(_0x279b72){return _0x279b72['update'](_0x3f6a6e)['then'](function(_0x43f999){return _0x43f999;});}return null;};}function removeEntity(_0x5bddd2,_0x4a5843){return function(_0x336ef1){if(_0x336ef1){return _0x336ef1[_0xb8b1('0x34')]()[_0xb8b1('0x1d')](function(){var _0x185bb9=_0x336ef1[_0xb8b1('0x35')]({'plain':!![]});var _0x5c4d19=_0xb8b1('0x36');return db[_0xb8b1('0x37')]['destroy']({'where':{'type':_0x5c4d19,'resourceId':_0x185bb9['id']}})[_0xb8b1('0x1d')](function(){return _0x336ef1;});})['then'](function(){_0x5bddd2[_0xb8b1('0x2a')](0xcc)[_0xb8b1('0x38')]();});}};}function handleEntityNotFound(_0x598b14,_0x6c5acf){return function(_0xff36ce){if(!_0xff36ce){_0x598b14[_0xb8b1('0x29')](0x194);}return _0xff36ce;};}function handleError(_0x5181d1,_0x352c02){_0x352c02=_0x352c02||0x1f4;return function(_0x4100c3){logger[_0xb8b1('0x24')](_0x4100c3[_0xb8b1('0x39')]);if(_0x4100c3['name']){delete _0x4100c3['name'];}_0x5181d1['status'](_0x352c02)['send'](_0x4100c3);};}exports[_0xb8b1('0x3a')]=function(_0x3a1a18,_0x5bd1b1){var _0x43b941={'include':[{'model':db['Pause'],'as':_0xb8b1('0x3b')}]},_0x383f62={},_0x43b368={'count':0x0,'rows':[]};var _0x27aa17=_[_0xb8b1('0x3c')](db[_0xb8b1('0x3d')][_0xb8b1('0x3e')],function(_0x386229){return{'name':_0x386229[_0xb8b1('0x3f')],'type':_0x386229['type'][_0xb8b1('0x40')]};});_0x383f62[_0xb8b1('0x41')]=_[_0xb8b1('0x3c')](_0x27aa17,_0xb8b1('0x42'));_0x383f62[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x3a1a18['query']);_0x383f62[_0xb8b1('0x45')]=_[_0xb8b1('0x46')](_0x383f62['model'],_0x383f62[_0xb8b1('0x43')]);_0x43b941[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x383f62[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x48')]));_0x43b941['attributes']=_0x43b941[_0xb8b1('0x47')][_0xb8b1('0x49')]?_0x43b941[_0xb8b1('0x47')]:_0x383f62['model'];if(!_0x3a1a18[_0xb8b1('0x43')]['hasOwnProperty'](_0xb8b1('0x4a'))){_0x43b941[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x2c')]);_0x43b941[_0xb8b1('0x2e')]=qs[_0xb8b1('0x2e')](_0x3a1a18[_0xb8b1('0x43')]['offset']);}_0x43b941[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x43b941[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_['pick'](_0x3a1a18[_0xb8b1('0x43')],_0x383f62[_0xb8b1('0x45')]),_0x27aa17);if(_0x3a1a18['query'][_0xb8b1('0x4e')]){_0x43b941[_0xb8b1('0x4d')]=_[_0xb8b1('0x4f')](_0x43b941['where'],{'$or':_['map'](_0x27aa17,function(_0x59011e){if(_0x59011e[_0xb8b1('0x50')]!=='VIRTUAL'){var _0x5109fd={};_0x5109fd[_0x59011e['name']]={'$like':'%'+_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x5109fd;}})});}_0x43b941=_[_0xb8b1('0x4f')]({},_0x43b941,_0x3a1a18[_0xb8b1('0x51')]);var _0x55b86c={'where':_0x43b941[_0xb8b1('0x4d')]};return db[_0xb8b1('0x3d')]['count'](_0x55b86c)[_0xb8b1('0x1d')](function(_0x31a461){_0x43b368[_0xb8b1('0x2f')]=_0x31a461;if(_0x3a1a18[_0xb8b1('0x43')][_0xb8b1('0x52')]){_0x43b941[_0xb8b1('0x53')]=[{'all':!![]}];}return db['SmsAccount'][_0xb8b1('0x54')](_0x43b941);})[_0xb8b1('0x1d')](function(_0x1bead6){_0x43b368[_0xb8b1('0x55')]=_0x1bead6;return _0x43b368;})[_0xb8b1('0x1d')](respondWithFilteredResult(_0x5bd1b1,_0x43b941))[_0xb8b1('0x28')](handleError(_0x5bd1b1,null));};exports[_0xb8b1('0x56')]=function(_0x39ee3e,_0x18f031){var _0x49520f={'raw':![],'where':{'id':_0x39ee3e[_0xb8b1('0x57')]['id']},'include':[{'model':db[_0xb8b1('0x58')],'as':'mandatoryDispositionPause'}]},_0x19144a={};_0x19144a[_0xb8b1('0x41')]=_[_0xb8b1('0x44')](db[_0xb8b1('0x3d')][_0xb8b1('0x3e')]);_0x19144a[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x39ee3e[_0xb8b1('0x43')]);_0x19144a[_0xb8b1('0x45')]=_['intersection'](_0x19144a[_0xb8b1('0x41')],_0x19144a[_0xb8b1('0x43')]);_0x49520f[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x19144a[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x39ee3e[_0xb8b1('0x43')]['fields']));_0x49520f[_0xb8b1('0x47')]=_0x49520f[_0xb8b1('0x47')]['length']?_0x49520f[_0xb8b1('0x47')]:_0x19144a[_0xb8b1('0x41')];if(_0x39ee3e[_0xb8b1('0x43')][_0xb8b1('0x52')]){_0x49520f[_0xb8b1('0x53')]=[{'all':!![]}];}_0x49520f=_['merge']({},_0x49520f,_0x39ee3e[_0xb8b1('0x51')]);return db['SmsAccount'][_0xb8b1('0x59')](_0x49520f)[_0xb8b1('0x1d')](handleEntityNotFound(_0x18f031,null))[_0xb8b1('0x1d')](respondWithResult(_0x18f031,null))[_0xb8b1('0x28')](handleError(_0x18f031,null));};exports[_0xb8b1('0x5a')]=function(_0x3dca68,_0x298e5c){return db[_0xb8b1('0x3d')][_0xb8b1('0x5a')](_0x3dca68[_0xb8b1('0x5b')],{})[_0xb8b1('0x1d')](function(_0x9634c3){var _0x529e96=_0x3dca68[_0xb8b1('0x5c')][_0xb8b1('0x35')]({'plain':!![]});if(!_0x529e96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x529e96[_0xb8b1('0x5d')]===_0xb8b1('0x5c')){var _0x3a992e=_0x9634c3[_0xb8b1('0x35')]({'plain':!![]});var _0x540700='SmsAccounts';return db[_0xb8b1('0x5e')][_0xb8b1('0x59')]({'where':{'name':_0x540700,'userProfileId':_0x529e96[_0xb8b1('0x5f')]},'raw':!![]})[_0xb8b1('0x1d')](function(_0x55e007){if(_0x55e007&&_0x55e007[_0xb8b1('0x60')]===0x0){return db[_0xb8b1('0x37')]['create']({'name':_0x3a992e[_0xb8b1('0x42')],'resourceId':_0x3a992e['id'],'type':_0x55e007[_0xb8b1('0x42')],'sectionId':_0x55e007['id']},{})['then'](function(){return _0x9634c3;});}else{return _0x9634c3;}})[_0xb8b1('0x28')](function(_0x2126b5){logger[_0xb8b1('0x24')](_0xb8b1('0x61'),_0x2126b5);throw _0x2126b5;});}return _0x9634c3;})[_0xb8b1('0x1d')](respondWithResult(_0x298e5c,0xc9))[_0xb8b1('0x28')](handleError(_0x298e5c,null));};exports[_0xb8b1('0x62')]=function(_0x1f61d7,_0x2a3944){if(_0x1f61d7['body']['id']){delete _0x1f61d7[_0xb8b1('0x5b')]['id'];}return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x1f61d7['params']['id']},'include':[{'model':db[_0xb8b1('0x58')],'as':_0xb8b1('0x3b')}]})[_0xb8b1('0x1d')](handleEntityNotFound(_0x2a3944,null))['then'](saveUpdates(_0x1f61d7[_0xb8b1('0x5b')],null))[_0xb8b1('0x1d')](respondWithResult(_0x2a3944,null))['catch'](handleError(_0x2a3944,null));};exports[_0xb8b1('0x34')]=function(_0x7a439b,_0x530b11){return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x7a439b[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x530b11,null))[_0xb8b1('0x1d')](removeEntity(_0x530b11,null))[_0xb8b1('0x28')](handleError(_0x530b11,null));};exports['describe']=function(_0x587a83,_0xd858cf){return db[_0xb8b1('0x3d')][_0xb8b1('0x63')]()[_0xb8b1('0x1d')](respondWithResult(_0xd858cf,null))[_0xb8b1('0x28')](handleError(_0xd858cf,null));};exports[_0xb8b1('0x64')]=function(_0x1d9c1a,_0x546542,_0x481f22){if(_0x1d9c1a[_0xb8b1('0x5b')]['id']){delete _0x1d9c1a['body']['id'];}return db[_0xb8b1('0x3d')]['find']({'where':{'id':_0x1d9c1a[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x546542,null))[_0xb8b1('0x1d')](function(_0x7741fa){if(_0x7741fa){_0x1d9c1a[_0xb8b1('0x5b')][_0xb8b1('0x65')]=_0x7741fa['id'];return db['Disposition'][_0xb8b1('0x5a')](_0x1d9c1a[_0xb8b1('0x5b')]);}})[_0xb8b1('0x1d')](respondWithResult(_0x546542,null))[_0xb8b1('0x28')](handleError(_0x546542,null));};exports[_0xb8b1('0x66')]=function(_0x4445e7,_0x4c02df,_0xa3faca){var _0x3078cd={'raw':![],'where':{}};var _0x4082e7={};var _0x1c2f96={'count':0x0,'rows':[]};return db[_0xb8b1('0x3d')][_0xb8b1('0x67')]({'where':{'id':_0x4445e7['params']['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x4c02df,null))[_0xb8b1('0x1d')](function(_0x4844f2){if(_0x4844f2){_0x4082e7[_0xb8b1('0x41')]=_[_0xb8b1('0x44')](db['Disposition'][_0xb8b1('0x3e')]);_0x4082e7[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x4445e7[_0xb8b1('0x43')]);_0x4082e7[_0xb8b1('0x45')]=_[_0xb8b1('0x46')](_0x4082e7[_0xb8b1('0x41')],_0x4082e7[_0xb8b1('0x43')]);_0x3078cd[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x4082e7[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x4445e7[_0xb8b1('0x43')]['fields']));_0x3078cd[_0xb8b1('0x47')]=_0x3078cd[_0xb8b1('0x47')][_0xb8b1('0x49')]?_0x3078cd['attributes']:_0x4082e7[_0xb8b1('0x41')];if(!_0x4445e7['query'][_0xb8b1('0x68')]('nolimit')){_0x3078cd[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x4445e7['query'][_0xb8b1('0x2c')]);_0x3078cd['offset']=qs[_0xb8b1('0x2e')](_0x4445e7[_0xb8b1('0x43')]['offset']);}_0x3078cd[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x4445e7[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x3078cd[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x4445e7['query'],_0x4082e7[_0xb8b1('0x45')]));_0x3078cd[_0xb8b1('0x4d')][_0xb8b1('0x65')]=_0x4844f2['id'];if(_0x4445e7['query'][_0xb8b1('0x4e')]){_0x3078cd[_0xb8b1('0x4d')]=_['merge'](_0x3078cd['where'],{'$or':_['map'](_0x3078cd[_0xb8b1('0x47')],function(_0x6822cf){var _0xcf06ac={};_0xcf06ac[_0x6822cf]={'$like':'%'+_0x4445e7[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0xcf06ac;})});}_0x3078cd=_[_0xb8b1('0x4f')]({},_0x3078cd,_0x4445e7['options']);return db[_0xb8b1('0x6a')][_0xb8b1('0x2f')]({'where':_0x3078cd[_0xb8b1('0x4d')]})['then'](function(_0x27e3fb){_0x1c2f96[_0xb8b1('0x2f')]=_0x27e3fb;if(_0x4445e7[_0xb8b1('0x43')][_0xb8b1('0x52')]){_0x3078cd[_0xb8b1('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xb8b1('0x54')](_0x3078cd);})['then'](function(_0x55ac15){_0x1c2f96[_0xb8b1('0x55')]=_0x55ac15;return _0x1c2f96;});}})[_0xb8b1('0x1d')](respondWithFilteredResult(_0x4c02df,_0x3078cd))[_0xb8b1('0x28')](handleError(_0x4c02df,null));};exports[_0xb8b1('0x6b')]=function(_0x2cffef,_0x3b93aa,_0x4628fb){return db['SmsAccount'][_0xb8b1('0x59')]({'where':{'id':_0x2cffef[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x3b93aa,null))[_0xb8b1('0x1d')](function(_0x476ab4){if(_0x476ab4){return _0x476ab4['removeDispositions'](_0x2cffef[_0xb8b1('0x43')][_0xb8b1('0x6c')]);}})[_0xb8b1('0x1d')](respondWithStatusCode(_0x3b93aa,null))[_0xb8b1('0x28')](handleError(_0x3b93aa,null));};exports[_0xb8b1('0x6d')]=function(_0x1db9f3,_0x549019,_0x5a3c1d){if(_0x1db9f3[_0xb8b1('0x5b')]['id']){delete _0x1db9f3[_0xb8b1('0x5b')]['id'];}return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x1db9f3['params']['id']}})['then'](handleEntityNotFound(_0x549019,null))[_0xb8b1('0x1d')](function(_0x198130){if(_0x198130){_0x1db9f3['body'][_0xb8b1('0x65')]=_0x198130['id'];return db[_0xb8b1('0x6e')][_0xb8b1('0x5a')](_0x1db9f3[_0xb8b1('0x5b')]);}})[_0xb8b1('0x1d')](respondWithResult(_0x549019,null))[_0xb8b1('0x28')](handleError(_0x549019,null));};exports['getAnswers']=function(_0x5689ae,_0x326bf4,_0x48bd70){var _0x54a9db={'raw':![],'where':{}};var _0xd9b3d1={};var _0x1649bc={'count':0x0,'rows':[]};return db[_0xb8b1('0x3d')][_0xb8b1('0x67')]({'where':{'id':_0x5689ae[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x326bf4,null))[_0xb8b1('0x1d')](function(_0x3dbc05){if(_0x3dbc05){_0xd9b3d1['model']=_[_0xb8b1('0x44')](db[_0xb8b1('0x6e')][_0xb8b1('0x3e')]);_0xd9b3d1[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x5689ae[_0xb8b1('0x43')]);_0xd9b3d1[_0xb8b1('0x45')]=_[_0xb8b1('0x46')](_0xd9b3d1['model'],_0xd9b3d1[_0xb8b1('0x43')]);_0x54a9db[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0xd9b3d1[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x5689ae['query'][_0xb8b1('0x48')]));_0x54a9db[_0xb8b1('0x47')]=_0x54a9db[_0xb8b1('0x47')]['length']?_0x54a9db['attributes']:_0xd9b3d1[_0xb8b1('0x41')];if(!_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x68')]('nolimit')){_0x54a9db['limit']=qs[_0xb8b1('0x2c')](_0x5689ae['query'][_0xb8b1('0x2c')]);_0x54a9db[_0xb8b1('0x2e')]=qs['offset'](_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x2e')]);}_0x54a9db[_0xb8b1('0x4b')]=qs['sort'](_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x54a9db[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x5689ae[_0xb8b1('0x43')],_0xd9b3d1[_0xb8b1('0x45')]));_0x54a9db[_0xb8b1('0x4d')]['SmsAccountId']=_0x3dbc05['id'];if(_0x5689ae[_0xb8b1('0x43')][_0xb8b1('0x4e')]){_0x54a9db['where']=_[_0xb8b1('0x4f')](_0x54a9db[_0xb8b1('0x4d')],{'$or':_[_0xb8b1('0x3c')](_0x54a9db[_0xb8b1('0x47')],function(_0xb50e51){var _0x29d06d={};_0x29d06d[_0xb50e51]={'$like':'%'+_0x5689ae[_0xb8b1('0x43')]['filter']+'%'};return _0x29d06d;})});}_0x54a9db=_[_0xb8b1('0x4f')]({},_0x54a9db,_0x5689ae[_0xb8b1('0x51')]);return db[_0xb8b1('0x6e')]['count']({'where':_0x54a9db[_0xb8b1('0x4d')]})[_0xb8b1('0x1d')](function(_0xffa2af){_0x1649bc[_0xb8b1('0x2f')]=_0xffa2af;if(_0x5689ae['query'][_0xb8b1('0x52')]){_0x54a9db[_0xb8b1('0x53')]=[{'all':!![]}];}return db[_0xb8b1('0x6e')][_0xb8b1('0x54')](_0x54a9db);})[_0xb8b1('0x1d')](function(_0x5f05b6){_0x1649bc['rows']=_0x5f05b6;return _0x1649bc;});}})['then'](respondWithFilteredResult(_0x326bf4,_0x54a9db))['catch'](handleError(_0x326bf4,null));};exports['removeAnswers']=function(_0x16091d,_0x13ce5a,_0x4ce1bd){return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x16091d['params']['id']}})['then'](handleEntityNotFound(_0x13ce5a,null))[_0xb8b1('0x1d')](function(_0x4e455d){if(_0x4e455d){return _0x4e455d[_0xb8b1('0x6f')](_0x16091d['query'][_0xb8b1('0x6c')]);}})[_0xb8b1('0x1d')](respondWithStatusCode(_0x13ce5a,null))['catch'](handleError(_0x13ce5a,null));};exports['notify']=function(_0x18a9a6,_0x5bfaa2,_0x351707){var _0x57bd31={'channel':_0xb8b1('0x70')};var _0x332f76=[];var _0x162052=[];var _0x353be8={};return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x18a9a6[_0xb8b1('0x57')]['id']},'include':[{'model':db[_0xb8b1('0x71')],'as':_0xb8b1('0x72')}]})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5bfaa2,null))[_0xb8b1('0x1d')](function(_0x1ba639){_0x57bd31['account']=_0x1ba639;_0x57bd31[_0xb8b1('0x73')]=_[_0xb8b1('0x74')](_0x1ba639[_0xb8b1('0x72')],['priority'],[_0xb8b1('0x75')]);if(_0x57bd31['account'][_0xb8b1('0x72')]){delete _0x57bd31[_0xb8b1('0x76')]['Applications'];}return db[_0xb8b1('0x77')][_0xb8b1('0x63')]();})['then'](function(_0x1b2d1d){if(!_0x1b2d1d){throw new db[(_0xb8b1('0x78'))][(_0xb8b1('0x79'))](_0xb8b1('0x7a'));}_0x332f76=_[_0xb8b1('0x7b')](_[_0xb8b1('0x44')](_0x1b2d1d),[_0xb8b1('0x7c'),_0xb8b1('0x7d')]);_0x162052=_['difference'](_[_0xb8b1('0x44')](_0x1b2d1d),[_0xb8b1('0x7c'),_0xb8b1('0x7d'),'CompanyId',_0xb8b1('0x7e')]);_0x57bd31[_0xb8b1('0x5b')]={'mapKey':_0xb8b1('0x7f')};if(_0x57bd31['account'][_0xb8b1('0x50')]){switch(_0x57bd31[_0xb8b1('0x76')][_0xb8b1('0x50')]){case _0xb8b1('0x80'):_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')]['From'];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6['body']['Body'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6['body']['MessageSid'];break;case'skebby':_0x57bd31[_0xb8b1('0x5b')]['from']='+'+_0x18a9a6[_0xb8b1('0x5b')]['sender'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x83')];break;case _0xb8b1('0x84'):_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x81')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x25')];break;case'clicksend':_0x57bd31['body']['from']=_0x18a9a6['body'][_0xb8b1('0x81')];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6['body'][_0xb8b1('0x5b')];_0x57bd31[_0xb8b1('0x5b')]['messageId']=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x85')];break;case _0xb8b1('0x86'):_0x57bd31['body'][_0xb8b1('0x81')]=_0x18a9a6['body'][_0xb8b1('0x87')];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x88')];_0x57bd31[_0xb8b1('0x5b')]['messageId']=_0x18a9a6['body'][_0xb8b1('0x89')];break;case'infobip':_0x57bd31[_0xb8b1('0x5b')]['from']='+'+_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0][_0xb8b1('0x81')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0][_0xb8b1('0x83')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')]['results'][0x0]['messageId'];break;case _0xb8b1('0x8b'):_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8c')];_0x57bd31['body'][_0xb8b1('0x5b')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8d')][_0xb8b1('0x25')];break;case _0xb8b1('0x8e'):_0x57bd31['body'][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x8f')];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x83')];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x90')];break;case'bandwidth':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')][0x0][_0xb8b1('0x25')]['id'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')]=_0x18a9a6['body'][0x0][_0xb8b1('0x25')]['from'];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6['body'][0x0][_0xb8b1('0x25')][_0xb8b1('0x83')];break;case'intelepeer':_0x57bd31['body'][_0xb8b1('0x81')]=_0x18a9a6[_0xb8b1('0x5b')]['from'];_0x57bd31[_0xb8b1('0x5b')]['body']=_0x18a9a6[_0xb8b1('0x5b')]['message'];_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x82')]=_0x18a9a6[_0xb8b1('0x5b')][_0xb8b1('0x91')];break;}}if(_0x57bd31[_0xb8b1('0x5b')]['id']){delete _0x57bd31['body']['id'];}if(_['isNil'](_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')])){throw new db[(_0xb8b1('0x78'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb8b1('0x92')](_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')])||_0x57bd31['body'][_0xb8b1('0x5b')]===''){throw new db[(_0xb8b1('0x78'))]['ValidationError'](_0xb8b1('0x93'));}if(_['isNil'](_0x57bd31[_0xb8b1('0x5b')]['mapKey'])){throw new db[(_0xb8b1('0x78'))][(_0xb8b1('0x79'))](_0xb8b1('0x94')+_0x162052);}if(!_['includes'](_0x162052,_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x95')])){throw new db['Sequelize'][(_0xb8b1('0x79'))](_0xb8b1('0x96')+_0x162052);}_0x353be8[_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x95')]]=_0x57bd31['body']['from'];return db[_0xb8b1('0x97')][_0xb8b1('0x59')]({'where':{'id':_0x57bd31['account'][_0xb8b1('0x7e')]},'include':[{'model':db[_0xb8b1('0x77')],'as':_0xb8b1('0x98'),'where':_0x353be8,'limit':0x1,'order':[[_0xb8b1('0x7d'),'DESC']]}]});})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5bfaa2,null))[_0xb8b1('0x1d')](function(_0x52523d){if(_0x52523d){_0x57bd31[_0xb8b1('0x99')]=_[_0xb8b1('0x9a')](_0x52523d,[_0xb8b1('0x98')]);if(_0x52523d['Contacts'][_0xb8b1('0x49')]){return _0x52523d[_0xb8b1('0x98')][0x0];}var _0x1bcfc9=_[_0xb8b1('0x17')](_0x57bd31['body'],{'firstName':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')],'ListId':_0x52523d['id']});_0x1bcfc9[_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x95')]]=_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')];return db[_0xb8b1('0x77')][_0xb8b1('0x5a')](_0x1bcfc9,{'fields':_0x332f76,'raw':!![]});}})['then'](handleEntityNotFound(_0x5bfaa2,null))[_0xb8b1('0x1d')](function(_0x23b2a0){if(_0x23b2a0){_0x57bd31['contact']=_0x23b2a0;var _0x4f3781={'ContactId':_0x23b2a0['id'],'phone':_0x57bd31[_0xb8b1('0x5b')]['from'],'SmsAccountId':_0x18a9a6[_0xb8b1('0x57')]['id']};var _0x4dc646={'ContactId':_0x23b2a0['id'],'SmsAccountId':_0x18a9a6[_0xb8b1('0x57')]['id'],'closed':![]};return db[_0xb8b1('0x9b')][_0xb8b1('0x59')]({'where':_0x4dc646})[_0xb8b1('0x1d')](function(_0x39ba8e){if(_0x39ba8e){return[_0x39ba8e,![]];}return db[_0xb8b1('0x9b')]['create'](_0x4f3781)['then'](function(_0x34cc47){return[_0x34cc47,!![]];});});}})[_0xb8b1('0x9c')](function(_0x2a23a1,_0x314a59){_0x57bd31[_0xb8b1('0x9d')]=_0x2a23a1[_0xb8b1('0x35')]({'plain':!![]});_0x57bd31[_0xb8b1('0x9d')][_0xb8b1('0x9e')]=![];if(_0x314a59){if(_0x57bd31[_0xb8b1('0x76')][_0xb8b1('0x9f')]){_0x57bd31[_0xb8b1('0x73')][_0xb8b1('0xa0')]({'id':0x0,'priority':_0x57bd31[_0xb8b1('0x73')]['length']+0x1,'app':'close','appdata':_0xb8b1('0xa1'),'interval':'*,*,*,*'});}_0x57bd31['interaction']['created']=!![];}return db[_0xb8b1('0xa2')][_0xb8b1('0x5a')]({'phone':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x81')],'messageId':_0x57bd31[_0xb8b1('0x5b')]['messageId'],'body':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0x5b')],'SmsAccountId':_0x18a9a6[_0xb8b1('0x57')]['id'],'SmsInteractionId':_0x2a23a1['id'],'direction':'in','ContactId':_0x2a23a1['ContactId'],'AttachmentId':_0x57bd31[_0xb8b1('0x5b')][_0xb8b1('0xa3')]});})[_0xb8b1('0x1d')](function(_0x1b07b7){_0x57bd31['message']=_0x1b07b7;if(!_0x57bd31['interaction'][_0xb8b1('0xa4')])return;return db[_0xb8b1('0xa5')][_0xb8b1('0x59')]({'attributes':['id',_0xb8b1('0x42')],'where':{'id':_0x57bd31[_0xb8b1('0x9d')]['UserId']}});})[_0xb8b1('0x1d')](function(_0x411cd7){if(_0x411cd7){_0x57bd31['applications'][_0xb8b1('0xa6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x411cd7[_0xb8b1('0x42')]+','+(_0x57bd31[_0xb8b1('0x76')]['waitForTheAssignedAgent']||0xa),'interval':_0xb8b1('0xa7')});}if(!_0x57bd31[_0xb8b1('0x9d')]['queueId'])return;return db['SmsQueue']['find']({'attributes':['id',_0xb8b1('0x42')],'where':{'id':_0x57bd31[_0xb8b1('0x9d')]['queueId']}});})[_0xb8b1('0x1d')](function(_0x150e55){if(_0x150e55){_0x57bd31[_0xb8b1('0x73')][_0xb8b1('0xa6')]({'id':0x0,'priority':0x1,'app':_0xb8b1('0xa8'),'appdata':_0x150e55[_0xb8b1('0x42')]+','+(_0x57bd31[_0xb8b1('0x76')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb8b1('0xa9'),_0xb8b1('0xaa'),_0x57bd31);})[_0xb8b1('0x1d')](function(_0x4d22ff){if(_0x4d22ff){var _0xc71b25=0xc8;var _0x4bbfe5='receiveMessage';logger[_0xb8b1('0x26')](_0xb8b1('0x21'),_0x4bbfe5,_0xc71b25,_0xb8b1('0xab'));logger[_0xb8b1('0x20')](_0xb8b1('0xac'),_0x4bbfe5,_0xc71b25,_0xb8b1('0xab'),JSON[_0xb8b1('0x22')](_0x4d22ff));if(_0x57bd31[_0xb8b1('0x76')]['type']===_0xb8b1('0x80')){return _0x5bfaa2['status'](_0xc71b25)[_0xb8b1('0xad')](_0xb8b1('0xae'),_0xb8b1('0xaf'))[_0xb8b1('0xb0')]('\x0a');}else{return _0x5bfaa2['status'](_0xc71b25)[_0xb8b1('0x2b')](_0x4d22ff);}}})['catch'](handleError(_0x5bfaa2,null));};exports[_0xb8b1('0xb1')]=function(_0x29d351,_0x5a73df){var _0x41e65c=_0x29d351[_0xb8b1('0x57')]['id'];var _0x2d40ea=_0x29d351['body'];var _0x49e617=0xc8;var _0x3f1556=null;return db['sequelize'][_0xb8b1('0xb2')]({'isolationLevel':db[_0xb8b1('0xb3')][_0xb8b1('0xb4')][_0xb8b1('0xb5')][_0xb8b1('0xb6')]},function(_0x4e3594){return db['SmsAccount'][_0xb8b1('0x67')]({'where':{'id':_0x41e65c},'transaction':_0x4e3594})['then'](function(_0x239081){if(_0x239081){return db[_0xb8b1('0x71')][_0xb8b1('0x34')]({'where':{'SmsAccountId':_0x41e65c},'transaction':_0x4e3594})['then'](function(){var _0x276252=_[_0xb8b1('0x3c')](_0x2d40ea,function(_0x2ead65){_0x2ead65['SmsAccountId']=_0x41e65c;return _0x2ead65;});return db[_0xb8b1('0x71')][_0xb8b1('0xb7')](_0x276252,{'transaction':_0x4e3594});});}else{_0x49e617=0x194;_0x3f1556=[];}});})[_0xb8b1('0x1d')](function(){if(_0x49e617!==0x194){return db[_0xb8b1('0x71')][_0xb8b1('0xb8')]({'where':{'SmsAccountId':_0x41e65c},'order':_0xb8b1('0xb9')})[_0xb8b1('0x1d')](function(_0x233846){_0x3f1556=_0x233846;});}})[_0xb8b1('0x28')](function(_0xd2027c){_0x49e617=0x1f4;logger[_0xb8b1('0x24')](_0xd2027c[_0xb8b1('0x39')]);if(_0xd2027c[_0xb8b1('0x42')]){delete _0xd2027c['name'];}_0x3f1556=_0xd2027c;})[_0xb8b1('0xba')](function(){if(_0x3f1556===null){_0x5a73df[_0xb8b1('0x29')](_0x49e617);}else{if(_0x49e617===0x1f4){_0x5a73df['status'](_0x49e617)[_0xb8b1('0xb0')](_0x3f1556);}else{_0x5a73df[_0xb8b1('0x2a')](_0x49e617)['json'](_0x3f1556);}}});};exports['getApplications']=function(_0x3d4ee8,_0x400b31,_0x259c86){var _0xc08bc4={};var _0x59e00b={};var _0x43d82e;var _0x2cecee;return db[_0xb8b1('0x3d')]['findOne']({'where':{'id':_0x3d4ee8[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x400b31,null))[_0xb8b1('0x1d')](function(_0x29e25f){if(_0x29e25f){_0x43d82e=_0x29e25f;_0x59e00b['model']=_[_0xb8b1('0x44')](db['SmsApplication'][_0xb8b1('0x3e')]);_0x59e00b[_0xb8b1('0x43')]=_[_0xb8b1('0x44')](_0x3d4ee8['query']);_0x59e00b[_0xb8b1('0x45')]=_['intersection'](_0x59e00b['model'],_0x59e00b['query']);_0xc08bc4[_0xb8b1('0x47')]=_[_0xb8b1('0x46')](_0x59e00b[_0xb8b1('0x41')],qs['fields'](_0x3d4ee8['query'][_0xb8b1('0x48')]));_0xc08bc4[_0xb8b1('0x47')]=_0xc08bc4['attributes']['length']?_0xc08bc4[_0xb8b1('0x47')]:_0x59e00b['model'];_0xc08bc4[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x3d4ee8[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0xc08bc4[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x3d4ee8['query'],_0x59e00b[_0xb8b1('0x45')]));if(_0x3d4ee8[_0xb8b1('0x43')][_0xb8b1('0x4e')]){_0xc08bc4[_0xb8b1('0x4d')]=_[_0xb8b1('0x4f')](_0xc08bc4['where'],{'$or':_[_0xb8b1('0x3c')](_0xc08bc4[_0xb8b1('0x47')],function(_0x4dee80){var _0x583fab={};_0x583fab[_0x4dee80]={'$like':'%'+_0x3d4ee8[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x583fab;})});}_0xc08bc4=_[_0xb8b1('0x4f')]({},_0xc08bc4,_0x3d4ee8[_0xb8b1('0x51')]);return _0x43d82e[_0xb8b1('0xbb')](_0xc08bc4);}})[_0xb8b1('0x1d')](function(_0x1e0d0e){if(_0x1e0d0e){_0x2cecee=_0x1e0d0e[_0xb8b1('0x49')];if(!_0x3d4ee8['query']['hasOwnProperty']('nolimit')){_0xc08bc4[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x3d4ee8['query'][_0xb8b1('0x2c')]);_0xc08bc4[_0xb8b1('0x2e')]=qs[_0xb8b1('0x2e')](_0x3d4ee8['query'][_0xb8b1('0x2e')]);}return _0x43d82e['getApplications'](_0xc08bc4);}})[_0xb8b1('0x1d')](function(_0x357f5c){if(_0x357f5c){return _0x357f5c?{'count':_0x2cecee,'rows':_0x357f5c}:null;}})[_0xb8b1('0x1d')](respondWithResult(_0x400b31,null))[_0xb8b1('0x28')](handleError(_0x400b31,null));};exports[_0xb8b1('0xbc')]=function(_0x412224,_0x3b748a,_0x1a9182){var _0x486b09={'raw':![],'where':{}};var _0x3ffe26={};var _0x217e1c={'count':0x0,'rows':[]};return db[_0xb8b1('0x3d')][_0xb8b1('0x67')]({'where':{'id':_0x412224[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x3b748a,null))[_0xb8b1('0x1d')](function(_0x3d2d25){if(_0x3d2d25){_0x3ffe26['model']=_[_0xb8b1('0x44')](db['SmsInteraction'][_0xb8b1('0x3e')]);_0x3ffe26[_0xb8b1('0x43')]=_['keys'](_0x412224[_0xb8b1('0x43')]);_0x3ffe26['filters']=_[_0xb8b1('0x46')](_0x3ffe26[_0xb8b1('0x41')],_0x3ffe26[_0xb8b1('0x43')]);_0x486b09[_0xb8b1('0x47')]=_['intersection'](_0x3ffe26[_0xb8b1('0x41')],qs[_0xb8b1('0x48')](_0x412224['query'][_0xb8b1('0x48')]));_0x486b09['attributes']=_0x486b09[_0xb8b1('0x47')][_0xb8b1('0x49')]?_0x486b09[_0xb8b1('0x47')]:_0x3ffe26[_0xb8b1('0x41')];if(!_0x412224[_0xb8b1('0x43')][_0xb8b1('0x68')](_0xb8b1('0x4a'))){_0x486b09[_0xb8b1('0x2c')]=qs[_0xb8b1('0x2c')](_0x412224[_0xb8b1('0x43')]['limit']);_0x486b09['offset']=qs[_0xb8b1('0x2e')](_0x412224[_0xb8b1('0x43')][_0xb8b1('0x2e')]);}_0x486b09[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x412224[_0xb8b1('0x43')][_0xb8b1('0x4c')]);_0x486b09['where']=qs['filters'](_[_0xb8b1('0x69')](_0x412224['query'],_0x3ffe26[_0xb8b1('0x45')]));_0x486b09[_0xb8b1('0x4d')][_0xb8b1('0x65')]=_0x3d2d25['id'];if(_0x412224[_0xb8b1('0x43')]['filter']){_0x486b09[_0xb8b1('0x4d')]=_[_0xb8b1('0x4f')](_0x486b09['where'],{'$or':_['map'](_0x486b09['attributes'],function(_0x14e36d){var _0x2ff192={};_0x2ff192[_0x14e36d]={'$like':'%'+_0x412224[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x2ff192;})});}_0x486b09=_[_0xb8b1('0x4f')]({},_0x486b09,_0x412224[_0xb8b1('0x51')]);return db['SmsInteraction'][_0xb8b1('0x2f')]({'where':_0x486b09[_0xb8b1('0x4d')]})[_0xb8b1('0x1d')](function(_0x899d96){_0x217e1c[_0xb8b1('0x2f')]=_0x899d96;if(_0x412224[_0xb8b1('0x43')]['includeAll']){_0x486b09[_0xb8b1('0x53')]=[{'model':db[_0xb8b1('0x77')],'as':_0xb8b1('0xbd'),'required':![]},{'model':db[_0xb8b1('0xa5')],'as':'Owner','attributes':[_0xb8b1('0x42'),'fullname',_0xb8b1('0xbe')],'required':![]},{'model':db[_0xb8b1('0xbf')],'as':_0xb8b1('0xc0'),'attributes':['id',_0xb8b1('0x42'),_0xb8b1('0xc1')],'where':_0x412224[_0xb8b1('0x43')]['tag']?{'id':_0x412224['query'][_0xb8b1('0xc2')]}:undefined,'required':_0x412224[_0xb8b1('0x43')]['tag']?!![]:![]}];}return db[_0xb8b1('0x9b')][_0xb8b1('0x54')](_0x486b09);})[_0xb8b1('0x1d')](function(_0x5e8567){_0x217e1c[_0xb8b1('0x55')]=_0x5e8567;return _0x217e1c;});}})[_0xb8b1('0x1d')](respondWithFilteredResult(_0x3b748a,_0x486b09))[_0xb8b1('0x28')](handleError(_0x3b748a,null));};exports[_0xb8b1('0xb0')]=function(_0x345201,_0x393889,_0x210abb){var _0x1777cb,_0x20b77a,_0xf7a78;if(_[_0xb8b1('0x92')](_0x345201[_0xb8b1('0x5b')][_0xb8b1('0x5b')])||_0x345201['body'][_0xb8b1('0x5b')]===''){throw new db['Sequelize'][(_0xb8b1('0x79'))](_0xb8b1('0x93'));}if(_[_0xb8b1('0x92')](_0x345201[_0xb8b1('0x5b')]['to'])){throw new db[(_0xb8b1('0x78'))]['ValidationError'](_0xb8b1('0xc3'));}_0x1777cb=_0x345201[_0xb8b1('0x5b')]['to'];return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x345201[_0xb8b1('0x57')]['id']},'include':[{'model':db[_0xb8b1('0x97')],'as':_0xb8b1('0xc4'),'include':[{'model':db['CmContact'],'as':_0xb8b1('0x98'),'where':{'mobile':_0x1777cb},'limit':0x1,'order':[[_0xb8b1('0x7d'),_0xb8b1('0xc5')]]}]}]})[_0xb8b1('0x1d')](handleEntityNotFound(_0x393889,null))['then'](function(_0x33d74e){if(_0x33d74e&&_0x33d74e[_0xb8b1('0xc4')]){_0x20b77a=_0x33d74e[_0xb8b1('0x35')]({'plain':!![]});if(_0x20b77a[_0xb8b1('0xc4')]&&_0x20b77a[_0xb8b1('0xc4')][_0xb8b1('0x98')][_0xb8b1('0x49')]){return _0x20b77a[_0xb8b1('0xc4')][_0xb8b1('0x98')][0x0];}return db[_0xb8b1('0x77')][_0xb8b1('0x5a')](_[_0xb8b1('0x17')](_0x345201['body'],{'firstName':_0x1777cb,'mobile':_0x1777cb,'phone':_0x1777cb,'ListId':_0x20b77a[_0xb8b1('0x7e')]}));}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x393889,null))[_0xb8b1('0x1d')](function(_0x32e9c2){if(_0x32e9c2){_0xf7a78=_0x32e9c2;return db[_0xb8b1('0x9b')]['find']({'where':{'ContactId':_0xf7a78['id'],'closed':![],'SmsAccountId':_0x20b77a['id']}})[_0xb8b1('0x1d')](function(_0x3830d1){if(_0x3830d1){return[_0x3830d1,![]];}return db[_0xb8b1('0x9b')]['create']({'UserId':_0x345201[_0xb8b1('0x5c')]['id'],'ContactId':_0xf7a78['id'],'SmsAccountId':_0x20b77a['id'],'phone':_0x1777cb,'firstMsgDirection':_0xb8b1('0xc6'),'Messages':[_['merge'](_0x345201[_0xb8b1('0x5b')],{'read':![],'body':_0x345201[_0xb8b1('0x5b')][_0xb8b1('0x5b')],'phone':_0x1777cb,'SmsAccountId':_0x20b77a['id'],'UserId':_0x345201[_0xb8b1('0x5c')]['id'],'ContactId':_0xf7a78['id']})]},{'include':[{'model':db[_0xb8b1('0xa2')],'as':_0xb8b1('0xc7')}]})[_0xb8b1('0x1d')](function(_0x462235){return[_0x462235,!![]];});});}})[_0xb8b1('0x9c')](function(_0x31b8f9,_0x282fea){if(_0x282fea){return _0x31b8f9;}return db['SmsMessage'][_0xb8b1('0x5a')](_[_0xb8b1('0x4f')](_0x345201[_0xb8b1('0x5b')],{'read':![],'body':_0x345201[_0xb8b1('0x5b')][_0xb8b1('0x5b')],'phone':_0x1777cb,'SmsAccountId':_0x20b77a['id'],'SmsInteractionId':_0x31b8f9['id'],'UserId':_0x345201[_0xb8b1('0x5c')]['id'],'ContactId':_0xf7a78['id']}))[_0xb8b1('0x1d')](function(_0x9c5c4f){_0x31b8f9[_0xb8b1('0xc8')][_0xb8b1('0xc7')]=[];_0x31b8f9['dataValues']['Messages'][_0xb8b1('0xa0')](_0x9c5c4f['dataValues']);return _0x31b8f9;});})[_0xb8b1('0x1d')](respondWithResult(_0x393889,null))['catch'](handleError(_0x393889,null));};exports[_0xb8b1('0x2a')]=function(_0x5b0e74,_0x35674f,_0x3ce5ad){if(_0x5b0e74[_0xb8b1('0x5b')]['id']){delete _0x5b0e74['body']['id'];}var _0x456662,_0x250e6b,_0x56eb5f;return db['SmsAccount'][_0xb8b1('0x59')]({'where':{'id':_0x5b0e74[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x35674f,null))['then'](function(_0x955a60){if(_0x955a60){_0x56eb5f=_0x955a60;logger[_0xb8b1('0x20')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xc9'),_0x955a60[_0xb8b1('0x50')],util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));switch(_0x955a60['type']){case _0xb8b1('0xcb'):if(_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xcc')]&&_0x5b0e74['body'][_0xb8b1('0x2a')]){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')]['status'];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74['body'][_0xb8b1('0xcc')]}});}break;case _0xb8b1('0x84'):if(_0x5b0e74['body'][_0xb8b1('0xcd')]&&_0x5b0e74[_0xb8b1('0x5b')]['statusInt']){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xce')];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74['body']['requestid']}});}break;case _0xb8b1('0xcf'):if(_0x5b0e74['body'][_0xb8b1('0x85')]&&_0x5b0e74['body'][_0xb8b1('0xd0')]){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')]['status_code'];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x85')]}});}break;case'infobip':var _0x4241c=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0];if(_0x4241c[_0xb8b1('0x82')]&&_0x4241c[_0xb8b1('0x2a')][_0xb8b1('0xd1')]==='DELIVERED'){_0x250e6b=_0x4241c['status']['groupName'];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x4241c[_0xb8b1('0x82')]}});}break;case _0xb8b1('0x8e'):if(_0x5b0e74['body']['messageId']&&_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x2a')]){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x2a')];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x82')]}});}break;case'bandwidth':if(_0x5b0e74[_0xb8b1('0x5b')][0x0][_0xb8b1('0x25')]['id']){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][0x0][_0xb8b1('0x50')];return db['SmsMessage'][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][0x0][_0xb8b1('0x25')]['id']}});}break;case'intelepeer':if(_0x5b0e74['body'][_0xb8b1('0xd2')]&&_0x5b0e74[_0xb8b1('0x5b')]['status']){_0x250e6b=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x2a')];return db[_0xb8b1('0xa2')][_0xb8b1('0x59')]({'where':{'messageId':_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xd2')]}});}break;}}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x35674f,null))[_0xb8b1('0x1d')](function(_0x136759){if(_0x136759){_0x456662=_0x136759;switch(_0x56eb5f[_0xb8b1('0x50')]){case _0xb8b1('0xcb'):if(_0x250e6b===_0xb8b1('0xd3')){return _0x456662[_0xb8b1('0x62')]({'read':!![]});}else{logger['error'](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xcb'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0x84'):if(_0x250e6b==='1'){return _0x456662[_0xb8b1('0x62')]({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),'status','skebby',util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0xcf'):if(!_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0xd4')]&&_0x250e6b>=0xc8&&_0x250e6b<=0xce){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),'status',_0xb8b1('0xcf'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x161327=_0x5b0e74[_0xb8b1('0x5b')][_0xb8b1('0x8a')][0x0];if(_0x161327['status'][_0xb8b1('0xd1')]==='DELIVERED'){return _0x456662[_0xb8b1('0x62')]({'read':!![]});}else{logger['error'](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xd5'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0x8e'):if(_0x250e6b==_0xb8b1('0xd6')||_0x250e6b=='RECEIVED_BY_RECIPIENT'){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb8b1('0x2a'),_0xb8b1('0x8e'),util[_0xb8b1('0xca')](_0x5b0e74['body'],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0xd7'):if(_0x250e6b==_0xb8b1('0xd8')){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xd7'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xb8b1('0xd9'):if(_0x250e6b===_0xb8b1('0xda')||_0x250e6b===_0xb8b1('0xdb')){return _0x456662['update']({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xd9'),util[_0xb8b1('0xca')](_0x5b0e74[_0xb8b1('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x456662;}})['then'](respondWithResult(_0x35674f,null))['catch'](handleError(_0x35674f,null));};exports[_0xb8b1('0xdc')]=function(_0x42090c,_0x5d163e,_0x4b107f){var _0x522f33,_0x392db6,_0x7d6afd;return db[_0xb8b1('0x3d')][_0xb8b1('0x59')]({'where':{'id':_0x42090c[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5d163e,null))[_0xb8b1('0x1d')](function(_0x22de2a){if(_0x22de2a){_0x7d6afd=_0x22de2a;logger[_0xb8b1('0x20')](_0xb8b1('0x21'),_0xb8b1('0x2a'),_0xb8b1('0xc9'),_0x22de2a[_0xb8b1('0x50')],util[_0xb8b1('0xca')](_0x42090c[_0xb8b1('0x43')],{'showHidden':![],'depth':null}));switch(_0x22de2a['type']){case'csc':if(_0x42090c[_0xb8b1('0x43')][_0xb8b1('0xdd')]&&_0x42090c['query'][_0xb8b1('0xde')]){_0x392db6=_0x42090c[_0xb8b1('0x43')][_0xb8b1('0xde')];return db['SmsMessage'][_0xb8b1('0x59')]({'where':{'messageId':_0x42090c[_0xb8b1('0x43')][_0xb8b1('0xdd')]}});}break;}}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x5d163e,null))[_0xb8b1('0x1d')](function(_0x27efd6){if(_0x27efd6){_0x522f33=_0x27efd6;switch(_0x7d6afd[_0xb8b1('0x50')]){case _0xb8b1('0x8b'):if(_0x392db6==='2'||_0x392db6==='6'){return _0x522f33[_0xb8b1('0x62')]({'read':!![]});}else{logger[_0xb8b1('0x24')](_0xb8b1('0x21'),_0xb8b1('0x2a'),'csc',util[_0xb8b1('0xca')](_0x42090c[_0xb8b1('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x522f33;}})[_0xb8b1('0x1d')](respondWithResult(_0x5d163e,null))[_0xb8b1('0x28')](handleError(_0x5d163e,null));};exports[_0xb8b1('0xdf')]=function(_0x2b532f,_0x22686d,_0x34f61b){return db[_0xb8b1('0x3d')]['find']({'where':{'id':_0x2b532f[_0xb8b1('0x57')]['id']}})[_0xb8b1('0x1d')](handleEntityNotFound(_0x22686d,null))[_0xb8b1('0x1d')](function(_0x480f2e){if(_0x480f2e){return _0x480f2e[_0xb8b1('0xdf')](_0x2b532f[_0xb8b1('0x5b')][_0xb8b1('0x6c')],_[_0xb8b1('0x9a')](_0x2b532f[_0xb8b1('0x5b')],[_0xb8b1('0x6c'),'id'])||{})[_0xb8b1('0x9c')](function(_0x31213a){for(var _0x47897d=0x0;_0x47897d<_0x2b532f[_0xb8b1('0x5b')]['ids']['length'];_0x47897d+=0x1){socket['emit'](_0xb8b1('0xe0'),{'UserId':Number(_0x2b532f[_0xb8b1('0x5b')][_0xb8b1('0x6c')][_0x47897d]),'SmsAccountId':Number(_0x2b532f[_0xb8b1('0x57')]['id'])});}return _0x31213a;});}})[_0xb8b1('0x1d')](respondWithResult(_0x22686d,null))[_0xb8b1('0x28')](handleError(_0x22686d,null));};exports[_0xb8b1('0xe1')]=function(_0x1b8fb5,_0x29ba35,_0x320fb0){return db[_0xb8b1('0x3d')]['find']({'where':{'id':_0x1b8fb5['params']['id']}})['then'](handleEntityNotFound(_0x29ba35,null))['then'](function(_0x26b183){if(_0x26b183){return _0x26b183['removeAgents'](_0x1b8fb5['query'][_0xb8b1('0x6c')])[_0xb8b1('0x1d')](function(){if(_['isArray'](_0x1b8fb5['query'][_0xb8b1('0x6c')])){for(var _0x27c510=0x0;_0x27c510<_0x1b8fb5['query'][_0xb8b1('0x6c')]['length'];_0x27c510+=0x1){socket[_0xb8b1('0xe2')](_0xb8b1('0xe3'),{'UserId':Number(_0x1b8fb5[_0xb8b1('0x43')][_0xb8b1('0x6c')][_0x27c510]),'SmsAccountId':Number(_0x1b8fb5[_0xb8b1('0x57')]['id'])});}}else{socket[_0xb8b1('0xe2')](_0xb8b1('0xe3'),{'UserId':Number(_0x1b8fb5[_0xb8b1('0x43')][_0xb8b1('0x6c')]),'SmsAccountId':Number(_0x1b8fb5[_0xb8b1('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x29ba35,null))[_0xb8b1('0x28')](handleError(_0x29ba35,null));};exports[_0xb8b1('0xe4')]=function(_0x5cfe26,_0x571f9d,_0xc77fd5){var _0x4df3b7={};var _0x2bc154={};var _0x48e18e;var _0x473f0a;return db['SmsAccount'][_0xb8b1('0x67')]({'where':{'id':_0x5cfe26[_0xb8b1('0x57')]['id']}})['then'](handleEntityNotFound(_0x571f9d,null))[_0xb8b1('0x1d')](function(_0x5d725c){if(_0x5d725c){_0x48e18e=_0x5d725c;_0x2bc154[_0xb8b1('0x41')]=_['keys'](db['User'][_0xb8b1('0x3e')]);_0x2bc154[_0xb8b1('0x43')]=_['keys'](_0x5cfe26[_0xb8b1('0x43')]);_0x2bc154[_0xb8b1('0x45')]=_['intersection'](_0x2bc154[_0xb8b1('0x41')],_0x2bc154[_0xb8b1('0x43')]);_0x4df3b7['attributes']=_[_0xb8b1('0x46')](_0x2bc154[_0xb8b1('0x41')],qs['fields'](_0x5cfe26['query'][_0xb8b1('0x48')]));_0x4df3b7[_0xb8b1('0x47')]=_0x4df3b7[_0xb8b1('0x47')]['length']?_0x4df3b7[_0xb8b1('0x47')]:_0x2bc154[_0xb8b1('0x41')];_0x4df3b7[_0xb8b1('0x4b')]=qs[_0xb8b1('0x4c')](_0x5cfe26['query'][_0xb8b1('0x4c')]);_0x4df3b7[_0xb8b1('0x4d')]=qs[_0xb8b1('0x45')](_[_0xb8b1('0x69')](_0x5cfe26[_0xb8b1('0x43')],_0x2bc154[_0xb8b1('0x45')]));if(_0x5cfe26[_0xb8b1('0x43')][_0xb8b1('0x4e')]){_0x4df3b7[_0xb8b1('0x4d')]=_['merge'](_0x4df3b7['where'],{'$or':_['map'](_0x4df3b7['attributes'],function(_0x2ee69b){var _0x3bb6ba={};_0x3bb6ba[_0x2ee69b]={'$like':'%'+_0x5cfe26[_0xb8b1('0x43')][_0xb8b1('0x4e')]+'%'};return _0x3bb6ba;})});}_0x4df3b7=_[_0xb8b1('0x4f')]({},_0x4df3b7,_0x5cfe26[_0xb8b1('0x51')]);return _0x48e18e[_0xb8b1('0xe4')](_0x4df3b7);}})[_0xb8b1('0x1d')](function(_0x29cce6){if(_0x29cce6){_0x473f0a=_0x29cce6[_0xb8b1('0x49')];if(!_0x5cfe26[_0xb8b1('0x43')][_0xb8b1('0x68')]('nolimit')){_0x4df3b7['limit']=qs[_0xb8b1('0x2c')](_0x5cfe26['query'][_0xb8b1('0x2c')]);_0x4df3b7[_0xb8b1('0x2e')]=qs[_0xb8b1('0x2e')](_0x5cfe26[_0xb8b1('0x43')]['offset']);}return _0x48e18e[_0xb8b1('0xe4')](_0x4df3b7);}})[_0xb8b1('0x1d')](function(_0x480fea){if(_0x480fea){return _0x480fea?{'count':_0x473f0a,'rows':_0x480fea}:null;}})[_0xb8b1('0x1d')](respondWithResult(_0x571f9d,null))[_0xb8b1('0x28')](handleError(_0x571f9d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 933ff35..af4046c 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 _0xf604=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf604,0x1a4));var _0x4f60=function(_0x206f02,_0x36f322){_0x206f02=_0x206f02-0x0;var _0x8a2663=_0xf604[_0x206f02];return _0x8a2663;};'use strict';var EventEmitter=require(_0x4f60('0x0'));var SmsAccount=require(_0x4f60('0x1'))['db'][_0x4f60('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4f60('0x3')](0x0);var events={'afterCreate':_0x4f60('0x4'),'afterUpdate':_0x4f60('0x5'),'afterDestroy':'remove'};function emitEvent(_0x514ef6){return function(_0x307fa8,_0x10c144,_0x2084ea){SmsAccountEvents[_0x4f60('0x6')](_0x514ef6+':'+_0x307fa8['id'],_0x307fa8);SmsAccountEvents[_0x4f60('0x6')](_0x514ef6,_0x307fa8);_0x2084ea(null);};}for(var e in events){if(events[_0x4f60('0x7')](e)){var event=events[e];SmsAccount[_0x4f60('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x2383=['SmsAccount','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3ce221,_0x22d678){var _0x3995b8=function(_0x4f0a97){while(--_0x4f0a97){_0x3ce221['push'](_0x3ce221['shift']());}};_0x3995b8(++_0x22d678);}(_0x2383,0xf6));var _0x3238=function(_0xfc7be9,_0x133ec3){_0xfc7be9=_0xfc7be9-0x0;var _0x39b641=_0x2383[_0xfc7be9];return _0x39b641;};'use strict';var EventEmitter=require(_0x3238('0x0'));var SmsAccount=require(_0x3238('0x1'))['db'][_0x3238('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3238('0x3'),'afterUpdate':_0x3238('0x4'),'afterDestroy':_0x3238('0x5')};function emitEvent(_0x349e2c){return function(_0x303c98,_0xf88a03,_0x139359){SmsAccountEvents[_0x3238('0x6')](_0x349e2c+':'+_0x303c98['id'],_0x303c98);SmsAccountEvents[_0x3238('0x6')](_0x349e2c,_0x303c98);_0x139359(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x3238('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 42ef878..a8254e0 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 _0x44d9=['lodash','util','../../config/logger','api','moment','path','rimraf','./smsAccount.attributes','define','SmsAccount','sms_accounts'];(function(_0x2e6c19,_0x131233){var _0x52885d=function(_0x38f224){while(--_0x38f224){_0x2e6c19['push'](_0x2e6c19['shift']());}};_0x52885d(++_0x131233);}(_0x44d9,0x155));var _0x944d=function(_0x6e9211,_0x320422){_0x6e9211=_0x6e9211-0x0;var _0x448207=_0x44d9[_0x6e9211];return _0x448207;};'use strict';var _=require(_0x944d('0x0'));var util=require(_0x944d('0x1'));var logger=require(_0x944d('0x2'))(_0x944d('0x3'));var moment=require(_0x944d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x944d('0x5'));var rimraf=require(_0x944d('0x6'));var config=require('../../config/environment');var attributes=require(_0x944d('0x7'));module['exports']=function(_0x2aed10,_0x377950){return _0x2aed10[_0x944d('0x8')](_0x944d('0x9'),attributes,{'tableName':_0x944d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x258f=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','SmsAccount','sms_accounts','util'];(function(_0x198ed6,_0x383c04){var _0x47ddc5=function(_0xa3dddf){while(--_0xa3dddf){_0x198ed6['push'](_0x198ed6['shift']());}};_0x47ddc5(++_0x383c04);}(_0x258f,0x1d5));var _0xf258=function(_0x35a13d,_0x17a149){_0x35a13d=_0x35a13d-0x0;var _0x28031c=_0x258f[_0x35a13d];return _0x28031c;};'use strict';var _=require('lodash');var util=require(_0xf258('0x0'));var logger=require(_0xf258('0x1'))(_0xf258('0x2'));var moment=require(_0xf258('0x3'));var BPromise=require('bluebird');var rp=require(_0xf258('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf258('0x5'));var config=require(_0xf258('0x6'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x36d740,_0x1d5e07){return _0x36d740[_0xf258('0x7')](_0xf258('0x8'),attributes,{'tableName':_0xf258('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index e2e7d37..5e84dd4 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 _0x5a9b=['rpc','../../config/environment','http','defaults','redis','localhost','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x5a9b,0x157));var _0xb5a9=function(_0x59f4a5,_0x5d4944){_0x59f4a5=_0x59f4a5-0x0;var _0x38f1a7=_0x5a9b[_0x59f4a5];return _0x38f1a7;};'use strict';var _=require('lodash');var util=require(_0xb5a9('0x0'));var moment=require(_0xb5a9('0x1'));var BPromise=require(_0xb5a9('0x2'));var rs=require(_0xb5a9('0x3'));var fs=require('fs');var Redis=require(_0xb5a9('0x4'));var db=require(_0xb5a9('0x5'))['db'];var utils=require(_0xb5a9('0x6'));var logger=require('../../config/logger')(_0xb5a9('0x7'));var config=require(_0xb5a9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb5a9('0x9')]({'port':0x232a});config['redis']=_[_0xb5a9('0xa')](config[_0xb5a9('0xb')],{'host':_0xb5a9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5a9('0xb')]));require(_0xb5a9('0xd'))['register'](socket);function respondWithRpcPromise(_0x26de82,_0x51fca2,_0x32f46d){return new BPromise(function(_0x4281d0,_0x2b2b81){return client[_0xb5a9('0xe')](_0x26de82,_0x32f46d)[_0xb5a9('0xf')](function(_0x557393){logger['info'](_0xb5a9('0x10'),_0x51fca2,_0xb5a9('0x11'));logger['debug'](_0xb5a9('0x12'),_0x51fca2,_0xb5a9('0x11'),JSON[_0xb5a9('0x13')](_0x557393));if(_0x557393[_0xb5a9('0x14')]){if(_0x557393['error']['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x51fca2,_0x557393[_0xb5a9('0x14')][_0xb5a9('0x15')]);return _0x2b2b81(_0x557393[_0xb5a9('0x14')][_0xb5a9('0x15')]);}logger[_0xb5a9('0x14')](_0xb5a9('0x10'),_0x51fca2,_0x557393['error']['message']);return _0x4281d0(_0x557393[_0xb5a9('0x14')][_0xb5a9('0x15')]);}else{logger[_0xb5a9('0x16')]('SmsAccount,\x20%s,\x20%s',_0x51fca2,_0xb5a9('0x11'));_0x4281d0(_0x557393[_0xb5a9('0x17')][_0xb5a9('0x15')]);}})[_0xb5a9('0x18')](function(_0x1ddf30){logger[_0xb5a9('0x14')](_0xb5a9('0x10'),_0x51fca2,_0x1ddf30);_0x2b2b81(_0x1ddf30);});});}exports[_0xb5a9('0x19')]=function(_0x4edeb8){var _0x545f50=this;return new Promise(function(_0x20a6d6,_0x42f49a){return db[_0xb5a9('0x1a')][_0xb5a9('0x1b')]({'raw':_0x4edeb8[_0xb5a9('0x1c')]?_0x4edeb8[_0xb5a9('0x1c')][_0xb5a9('0x1d')]===undefined?!![]:![]:!![],'where':_0x4edeb8[_0xb5a9('0x1c')]?_0x4edeb8['options'][_0xb5a9('0x1e')]||null:null,'attributes':_0x4edeb8[_0xb5a9('0x1c')]?_0x4edeb8['options'][_0xb5a9('0x1f')]||null:null,'include':_0x4edeb8['options']?_0x4edeb8[_0xb5a9('0x1c')][_0xb5a9('0x20')]?_[_0xb5a9('0x21')](_0x4edeb8['options'][_0xb5a9('0x20')],function(_0x53f98c){return{'model':db[_0x53f98c[_0xb5a9('0x22')]],'as':_0x53f98c['as'],'attributes':_0x53f98c[_0xb5a9('0x1f')],'include':_0x53f98c[_0xb5a9('0x20')]?_['map'](_0x53f98c[_0xb5a9('0x20')],function(_0x583706){return{'model':db[_0x583706['model']],'as':_0x583706['as'],'attributes':_0x583706[_0xb5a9('0x1f')],'include':_0x583706[_0xb5a9('0x20')]?_[_0xb5a9('0x21')](_0x583706[_0xb5a9('0x20')],function(_0x2086cf){return{'model':db[_0x2086cf[_0xb5a9('0x22')]],'as':_0x2086cf['as'],'attributes':_0x2086cf[_0xb5a9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5a9('0xf')](function(_0x1cbb01){logger['info']('ShowSmsAccount',_0x4edeb8);logger['debug'](_0xb5a9('0x19'),_0x4edeb8,JSON['stringify'](_0x1cbb01));_0x20a6d6(_0x1cbb01);})[_0xb5a9('0x18')](function(_0x15e648){logger[_0xb5a9('0x14')](_0xb5a9('0x19'),_0x15e648[_0xb5a9('0x15')],_0x4edeb8);_0x42f49a(_0x545f50[_0xb5a9('0x14')](0x1f4,_0x15e648[_0xb5a9('0x15')]));});});}; \ No newline at end of file +var _0x5687=['ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','SmsAccount','options','raw','where','attributes','include','map','model','ShowSmsAccount','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x59f464,_0x4339ec){var _0x413943=function(_0x2db4a3){while(--_0x2db4a3){_0x59f464['push'](_0x59f464['shift']());}};_0x413943(++_0x4339ec);}(_0x5687,0xa0));var _0x7568=function(_0x53e2b6,_0x543857){_0x53e2b6=_0x53e2b6-0x0;var _0x721cc4=_0x5687[_0x53e2b6];return _0x721cc4;};'use strict';var _=require(_0x7568('0x0'));var util=require(_0x7568('0x1'));var moment=require(_0x7568('0x2'));var BPromise=require(_0x7568('0x3'));var rs=require(_0x7568('0x4'));var fs=require('fs');var Redis=require(_0x7568('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7568('0x6'))(_0x7568('0x7'));var config=require(_0x7568('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x7568('0x9')]=_[_0x7568('0xa')](config[_0x7568('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7568('0x9')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x12ca38,_0x5877c3,_0x2b33ff){return new BPromise(function(_0x56a6c0,_0x4fad72){return client[_0x7568('0xb')](_0x12ca38,_0x2b33ff)[_0x7568('0xc')](function(_0x52f4cd){logger[_0x7568('0xd')]('SmsAccount,\x20%s,\x20%s',_0x5877c3,_0x7568('0xe'));logger[_0x7568('0xf')](_0x7568('0x10'),_0x5877c3,'request\x20sent',JSON[_0x7568('0x11')](_0x52f4cd));if(_0x52f4cd[_0x7568('0x12')]){if(_0x52f4cd[_0x7568('0x12')][_0x7568('0x13')]===0x1f4){logger[_0x7568('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5877c3,_0x52f4cd[_0x7568('0x12')]['message']);return _0x4fad72(_0x52f4cd['error'][_0x7568('0x14')]);}logger[_0x7568('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5877c3,_0x52f4cd[_0x7568('0x12')]['message']);return _0x56a6c0(_0x52f4cd['error']['message']);}else{logger[_0x7568('0xd')](_0x7568('0x15'),_0x5877c3,_0x7568('0xe'));_0x56a6c0(_0x52f4cd[_0x7568('0x16')][_0x7568('0x14')]);}})['catch'](function(_0x5b5866){logger['error'](_0x7568('0x15'),_0x5877c3,_0x5b5866);_0x4fad72(_0x5b5866);});});}exports['ShowSmsAccount']=function(_0x16af7c){var _0x134d7a=this;return new Promise(function(_0x49f41d,_0x112871){return db[_0x7568('0x17')]['find']({'raw':_0x16af7c[_0x7568('0x18')]?_0x16af7c['options'][_0x7568('0x19')]===undefined?!![]:![]:!![],'where':_0x16af7c[_0x7568('0x18')]?_0x16af7c[_0x7568('0x18')][_0x7568('0x1a')]||null:null,'attributes':_0x16af7c[_0x7568('0x18')]?_0x16af7c['options'][_0x7568('0x1b')]||null:null,'include':_0x16af7c[_0x7568('0x18')]?_0x16af7c[_0x7568('0x18')][_0x7568('0x1c')]?_[_0x7568('0x1d')](_0x16af7c[_0x7568('0x18')][_0x7568('0x1c')],function(_0x3bf4c0){return{'model':db[_0x3bf4c0[_0x7568('0x1e')]],'as':_0x3bf4c0['as'],'attributes':_0x3bf4c0[_0x7568('0x1b')],'include':_0x3bf4c0['include']?_['map'](_0x3bf4c0[_0x7568('0x1c')],function(_0xcf864a){return{'model':db[_0xcf864a[_0x7568('0x1e')]],'as':_0xcf864a['as'],'attributes':_0xcf864a[_0x7568('0x1b')],'include':_0xcf864a[_0x7568('0x1c')]?_[_0x7568('0x1d')](_0xcf864a['include'],function(_0x5275a6){return{'model':db[_0x5275a6[_0x7568('0x1e')]],'as':_0x5275a6['as'],'attributes':_0x5275a6[_0x7568('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7568('0xc')](function(_0x108369){logger[_0x7568('0xd')](_0x7568('0x1f'),_0x16af7c);logger[_0x7568('0xf')](_0x7568('0x1f'),_0x16af7c,JSON[_0x7568('0x11')](_0x108369));_0x49f41d(_0x108369);})[_0x7568('0x20')](function(_0x4a5fd7){logger[_0x7568('0x12')](_0x7568('0x1f'),_0x4a5fd7[_0x7568('0x14')],_0x16af7c);_0x112871(_0x134d7a[_0x7568('0x12')](0x1f4,_0x4a5fd7[_0x7568('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 29cc429..5840cc4 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 210dbdc..9ab8b82 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x30726d,_0x31ba2b){var _0x381a8d=function(_0x186093){while(--_0x186093){_0x30726d['push'](_0x30726d['shift']());}};_0x381a8d(++_0x31ba2b);}(_0x008c,0x188));var _0xc008=function(_0x40be1a,_0x13b843){_0x40be1a=_0x40be1a-0x0;var _0x4e6f36=_0x008c[_0x40be1a];return _0x4e6f36;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x85087d,_0x5d221f){var _0x38474a=function(_0x4cf251){while(--_0x4cf251){_0x85087d['push'](_0x85087d['shift']());}};_0x38474a(++_0x5d221f);}(_0x3e74,0x175));var _0x43e7=function(_0xe07fbc,_0x9ba5fa){_0xe07fbc=_0xe07fbc-0x0;var _0x57acbf=_0x3e74[_0xe07fbc];return _0x57acbf;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index c56f8bf..5b1615f 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 _0x8b79=['STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x4add40,_0x4ef660){var _0x52a1de=function(_0x1af192){while(--_0x1af192){_0x4add40['push'](_0x4add40['shift']());}};_0x52a1de(++_0x4ef660);}(_0x8b79,0x182));var _0x98b7=function(_0x2e370b,_0x1e23dc){_0x2e370b=_0x2e370b-0x0;var _0x913368=_0x8b79[_0x2e370b];return _0x913368;};'use strict';var Sequelize=require(_0x98b7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x98b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x98b7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x98b7('0x2')]},'interval':{'type':Sequelize[_0x98b7('0x2')],'defaultValue':_0x98b7('0x3')}}; \ No newline at end of file +var _0x8f13=['noop','STRING','sequelize','INTEGER'];(function(_0x293de0,_0x3a4643){var _0x10129e=function(_0x368dab){while(--_0x368dab){_0x293de0['push'](_0x293de0['shift']());}};_0x10129e(++_0x3a4643);}(_0x8f13,0x1ca));var _0x38f1=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x8f13[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x38f1('0x0'));module['exports']={'priority':{'type':Sequelize[_0x38f1('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x38f1('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x38f1('0x3')]},'interval':{'type':Sequelize[_0x38f1('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0bd95ac..22e7734 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 _0x94a8=['sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','catch','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','name','send','SmsApplication','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x52b52b,_0x109b5e){var _0xe4a7cb=function(_0x4b693d){while(--_0x4b693d){_0x52b52b['push'](_0x52b52b['shift']());}};_0xe4a7cb(++_0x109b5e);}(_0x94a8,0x16c));var _0x894a=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x94a8[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0x894a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x894a('0x1'));var jsonpatch=require(_0x894a('0x2'));var rp=require(_0x894a('0x3'));var moment=require(_0x894a('0x4'));var BPromise=require(_0x894a('0x5'));var Mustache=require(_0x894a('0x6'));var util=require('util');var path=require(_0x894a('0x7'));var sox=require(_0x894a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x894a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x894a('0xa'));var toCsv=require('to-csv');var querystring=require(_0x894a('0xb'));var Papa=require(_0x894a('0xc'));var Redis=require('ioredis');var authService=require(_0x894a('0xd'));var qs=require(_0x894a('0xe'));var as=require(_0x894a('0xf'));var hardwareService=require(_0x894a('0x10'));var logger=require(_0x894a('0x11'))(_0x894a('0x12'));var utils=require('../../config/utils');var config=require(_0x894a('0x13'));var licenseUtil=require(_0x894a('0x14'));var db=require(_0x894a('0x15'))['db'];function respondWithStatusCode(_0x304a8c,_0x5e0be8){_0x5e0be8=_0x5e0be8||0xcc;return function(_0x370bc6){if(_0x370bc6){return _0x304a8c[_0x894a('0x16')](_0x5e0be8);}return _0x304a8c[_0x894a('0x17')](_0x5e0be8)[_0x894a('0x18')]();};}function respondWithResult(_0x2907e2,_0x5dc327){_0x5dc327=_0x5dc327||0xc8;return function(_0x288323){if(_0x288323){return _0x2907e2[_0x894a('0x17')](_0x5dc327)['json'](_0x288323);}};}function respondWithFilteredResult(_0x51eaf8,_0x2a62a2){return function(_0x4244c6){if(_0x4244c6){var _0x3f318a=typeof _0x2a62a2[_0x894a('0x19')]===_0x894a('0x1a')&&typeof _0x2a62a2['limit']===_0x894a('0x1a');var _0x43e09d=_0x4244c6['count'];var _0x218eae=_0x3f318a?0x0:_0x2a62a2[_0x894a('0x19')];var _0x2713eb=_0x3f318a?_0x4244c6[_0x894a('0x1b')]:_0x2a62a2[_0x894a('0x19')]+_0x2a62a2[_0x894a('0x1c')];var _0x867562;if(_0x2713eb>=_0x43e09d){_0x2713eb=_0x43e09d;_0x867562=0xc8;}else{_0x867562=0xce;}_0x51eaf8[_0x894a('0x17')](_0x867562);return _0x51eaf8[_0x894a('0x1d')](_0x894a('0x1e'),_0x218eae+'-'+_0x2713eb+'/'+_0x43e09d)['json'](_0x4244c6);}return null;};}function patchUpdates(_0x2f7abc){return function(_0xfb7216){try{jsonpatch['apply'](_0xfb7216,_0x2f7abc,!![]);}catch(_0x36059f){return BPromise[_0x894a('0x1f')](_0x36059f);}return _0xfb7216['save']();};}function saveUpdates(_0x2ed35b,_0x50de63){return function(_0x17602a){if(_0x17602a){return _0x17602a[_0x894a('0x20')](_0x2ed35b)[_0x894a('0x21')](function(_0x33fcce){return _0x33fcce;});}return null;};}function removeEntity(_0x5eb2fc,_0x444fcf){return function(_0x18f9cb){if(_0x18f9cb){return _0x18f9cb['destroy']()[_0x894a('0x21')](function(){_0x5eb2fc[_0x894a('0x17')](0xcc)[_0x894a('0x18')]();});}};}function handleEntityNotFound(_0x5597d0,_0x48ef21){return function(_0x586106){if(!_0x586106){_0x5597d0[_0x894a('0x16')](0x194);}return _0x586106;};}function handleError(_0x4c6d3e,_0x14921b){_0x14921b=_0x14921b||0x1f4;return function(_0x161845){logger[_0x894a('0x22')](_0x161845['stack']);if(_0x161845[_0x894a('0x23')]){delete _0x161845['name'];}_0x4c6d3e[_0x894a('0x17')](_0x14921b)[_0x894a('0x24')](_0x161845);};}exports['index']=function(_0x16bfcb,_0x5dba76){var _0x215f86={},_0x56b382={},_0x167fc7={'count':0x0,'rows':[]};var _0x142aa9=_['map'](db[_0x894a('0x25')]['rawAttributes'],function(_0x4b67b1){return{'name':_0x4b67b1['fieldName'],'type':_0x4b67b1[_0x894a('0x26')][_0x894a('0x27')]};});_0x56b382[_0x894a('0x28')]=_[_0x894a('0x29')](_0x142aa9,_0x894a('0x23'));_0x56b382[_0x894a('0x2a')]=_[_0x894a('0x2b')](_0x16bfcb['query']);_0x56b382[_0x894a('0x2c')]=_['intersection'](_0x56b382[_0x894a('0x28')],_0x56b382[_0x894a('0x2a')]);_0x215f86[_0x894a('0x2d')]=_['intersection'](_0x56b382['model'],qs[_0x894a('0x2e')](_0x16bfcb[_0x894a('0x2a')]['fields']));_0x215f86[_0x894a('0x2d')]=_0x215f86[_0x894a('0x2d')][_0x894a('0x2f')]?_0x215f86[_0x894a('0x2d')]:_0x56b382[_0x894a('0x28')];if(!_0x16bfcb[_0x894a('0x2a')][_0x894a('0x30')](_0x894a('0x31'))){_0x215f86[_0x894a('0x1c')]=qs[_0x894a('0x1c')](_0x16bfcb[_0x894a('0x2a')][_0x894a('0x1c')]);_0x215f86[_0x894a('0x19')]=qs['offset'](_0x16bfcb[_0x894a('0x2a')][_0x894a('0x19')]);}_0x215f86['order']=qs['sort'](_0x16bfcb[_0x894a('0x2a')][_0x894a('0x32')]);_0x215f86[_0x894a('0x33')]=qs[_0x894a('0x2c')](_[_0x894a('0x34')](_0x16bfcb[_0x894a('0x2a')],_0x56b382[_0x894a('0x2c')]),_0x142aa9);if(_0x16bfcb[_0x894a('0x2a')][_0x894a('0x35')]){_0x215f86[_0x894a('0x33')]=_['merge'](_0x215f86['where'],{'$or':_[_0x894a('0x29')](_0x142aa9,function(_0x1d86bc){if(_0x1d86bc[_0x894a('0x26')]!=='VIRTUAL'){var _0xd67c16={};_0xd67c16[_0x1d86bc[_0x894a('0x23')]]={'$like':'%'+_0x16bfcb[_0x894a('0x2a')]['filter']+'%'};return _0xd67c16;}})});}_0x215f86=_[_0x894a('0x36')]({},_0x215f86,_0x16bfcb[_0x894a('0x37')]);var _0x19c8f4={'where':_0x215f86[_0x894a('0x33')]};return db[_0x894a('0x25')][_0x894a('0x1b')](_0x19c8f4)[_0x894a('0x21')](function(_0x28a576){_0x167fc7['count']=_0x28a576;if(_0x16bfcb['query'][_0x894a('0x38')]){_0x215f86[_0x894a('0x39')]=[{'all':!![]}];}return db['SmsApplication'][_0x894a('0x3a')](_0x215f86);})[_0x894a('0x21')](function(_0x8f41cd){_0x167fc7[_0x894a('0x3b')]=_0x8f41cd;return _0x167fc7;})[_0x894a('0x21')](respondWithFilteredResult(_0x5dba76,_0x215f86))['catch'](handleError(_0x5dba76,null));};exports[_0x894a('0x3c')]=function(_0x24c0a8,_0x5544bc){var _0x49041a={'raw':!![],'where':{'id':_0x24c0a8[_0x894a('0x3d')]['id']}},_0x1a0fce={};_0x1a0fce[_0x894a('0x28')]=_['keys'](db[_0x894a('0x25')][_0x894a('0x3e')]);_0x1a0fce['query']=_[_0x894a('0x2b')](_0x24c0a8[_0x894a('0x2a')]);_0x1a0fce[_0x894a('0x2c')]=_[_0x894a('0x3f')](_0x1a0fce[_0x894a('0x28')],_0x1a0fce[_0x894a('0x2a')]);_0x49041a[_0x894a('0x2d')]=_[_0x894a('0x3f')](_0x1a0fce[_0x894a('0x28')],qs[_0x894a('0x2e')](_0x24c0a8[_0x894a('0x2a')]['fields']));_0x49041a[_0x894a('0x2d')]=_0x49041a['attributes'][_0x894a('0x2f')]?_0x49041a[_0x894a('0x2d')]:_0x1a0fce[_0x894a('0x28')];if(_0x24c0a8[_0x894a('0x2a')]['includeAll']){_0x49041a[_0x894a('0x39')]=[{'all':!![]}];}_0x49041a=_[_0x894a('0x36')]({},_0x49041a,_0x24c0a8[_0x894a('0x37')]);return db[_0x894a('0x25')]['find'](_0x49041a)['then'](handleEntityNotFound(_0x5544bc,null))[_0x894a('0x21')](respondWithResult(_0x5544bc,null))[_0x894a('0x40')](handleError(_0x5544bc,null));};exports[_0x894a('0x41')]=function(_0xd2d6ce,_0x49fc86){return db[_0x894a('0x25')][_0x894a('0x41')](_0xd2d6ce['body'],{})[_0x894a('0x21')](respondWithResult(_0x49fc86,0xc9))['catch'](handleError(_0x49fc86,null));};exports[_0x894a('0x20')]=function(_0x186656,_0x3bb759){if(_0x186656[_0x894a('0x42')]['id']){delete _0x186656[_0x894a('0x42')]['id'];}return db[_0x894a('0x25')][_0x894a('0x43')]({'where':{'id':_0x186656[_0x894a('0x3d')]['id']}})[_0x894a('0x21')](handleEntityNotFound(_0x3bb759,null))[_0x894a('0x21')](saveUpdates(_0x186656[_0x894a('0x42')],null))[_0x894a('0x21')](respondWithResult(_0x3bb759,null))[_0x894a('0x40')](handleError(_0x3bb759,null));};exports[_0x894a('0x44')]=function(_0x4c2eb7,_0x10cd39){return db[_0x894a('0x25')][_0x894a('0x43')]({'where':{'id':_0x4c2eb7[_0x894a('0x3d')]['id']}})[_0x894a('0x21')](handleEntityNotFound(_0x10cd39,null))[_0x894a('0x21')](removeEntity(_0x10cd39,null))['catch'](handleError(_0x10cd39,null));}; \ No newline at end of file +var _0x364e=['type','VIRTUAL','options','SmsApplication','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','limit','undefined','count','offset','status','set','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge'];(function(_0x4f9afc,_0x4fb145){var _0x324836=function(_0x10ab20){while(--_0x10ab20){_0x4f9afc['push'](_0x4f9afc['shift']());}};_0x324836(++_0x4fb145);}(_0x364e,0x1e3));var _0xe364=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x364e[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0xe364('0x0'));var rimraf=require(_0xe364('0x1'));var zipdir=require(_0xe364('0x2'));var jsonpatch=require(_0xe364('0x3'));var rp=require(_0xe364('0x4'));var moment=require('moment');var BPromise=require(_0xe364('0x5'));var Mustache=require(_0xe364('0x6'));var util=require(_0xe364('0x7'));var path=require(_0xe364('0x8'));var sox=require(_0xe364('0x9'));var csv=require(_0xe364('0xa'));var ejs=require(_0xe364('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe364('0xc'));var squel=require(_0xe364('0xd'));var crypto=require(_0xe364('0xe'));var jsforce=require(_0xe364('0xf'));var deskjs=require(_0xe364('0x10'));var toCsv=require(_0xe364('0xa'));var querystring=require(_0xe364('0x11'));var Papa=require(_0xe364('0x12'));var Redis=require(_0xe364('0x13'));var authService=require(_0xe364('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe364('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe364('0x16'))(_0xe364('0x17'));var utils=require(_0xe364('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe364('0x19'));var db=require(_0xe364('0x1a'))['db'];function respondWithStatusCode(_0x308e37,_0x3a67b9){_0x3a67b9=_0x3a67b9||0xcc;return function(_0x4c08b7){if(_0x4c08b7){return _0x308e37[_0xe364('0x1b')](_0x3a67b9);}return _0x308e37['status'](_0x3a67b9)[_0xe364('0x1c')]();};}function respondWithResult(_0x5d49f3,_0x3a2c50){_0x3a2c50=_0x3a2c50||0xc8;return function(_0x112cde){if(_0x112cde){return _0x5d49f3['status'](_0x3a2c50)[_0xe364('0x1d')](_0x112cde);}};}function respondWithFilteredResult(_0x29d9ee,_0x3e584b){return function(_0x265b96){if(_0x265b96){var _0xa3ba58=typeof _0x3e584b['offset']==='undefined'&&typeof _0x3e584b[_0xe364('0x1e')]===_0xe364('0x1f');var _0x1c0d1e=_0x265b96[_0xe364('0x20')];var _0x1c259c=_0xa3ba58?0x0:_0x3e584b[_0xe364('0x21')];var _0x3270a9=_0xa3ba58?_0x265b96['count']:_0x3e584b[_0xe364('0x21')]+_0x3e584b[_0xe364('0x1e')];var _0x38f3b3;if(_0x3270a9>=_0x1c0d1e){_0x3270a9=_0x1c0d1e;_0x38f3b3=0xc8;}else{_0x38f3b3=0xce;}_0x29d9ee[_0xe364('0x22')](_0x38f3b3);return _0x29d9ee[_0xe364('0x23')]('Content-Range',_0x1c259c+'-'+_0x3270a9+'/'+_0x1c0d1e)[_0xe364('0x1d')](_0x265b96);}return null;};}function patchUpdates(_0x5f4573){return function(_0x638a66){try{jsonpatch['apply'](_0x638a66,_0x5f4573,!![]);}catch(_0x14cffc){return BPromise[_0xe364('0x24')](_0x14cffc);}return _0x638a66[_0xe364('0x25')]();};}function saveUpdates(_0x2a41b6,_0x3b8840){return function(_0x1914d5){if(_0x1914d5){return _0x1914d5['update'](_0x2a41b6)[_0xe364('0x26')](function(_0x5a826d){return _0x5a826d;});}return null;};}function removeEntity(_0x14225b,_0x1c1e3d){return function(_0x3c33ce){if(_0x3c33ce){return _0x3c33ce[_0xe364('0x27')]()[_0xe364('0x26')](function(){_0x14225b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x525662,_0x10fb65){return function(_0x129c92){if(!_0x129c92){_0x525662['sendStatus'](0x194);}return _0x129c92;};}function handleError(_0x37fc89,_0x5e29aa){_0x5e29aa=_0x5e29aa||0x1f4;return function(_0x645256){logger[_0xe364('0x28')](_0x645256[_0xe364('0x29')]);if(_0x645256[_0xe364('0x2a')]){delete _0x645256['name'];}_0x37fc89[_0xe364('0x22')](_0x5e29aa)[_0xe364('0x2b')](_0x645256);};}exports[_0xe364('0x2c')]=function(_0x38a331,_0x1a2add){var _0x133f4c={},_0x2a370d={},_0x18ff74={'count':0x0,'rows':[]};var _0x55b542=_[_0xe364('0x2d')](db['SmsApplication'][_0xe364('0x2e')],function(_0x71a76d){return{'name':_0x71a76d[_0xe364('0x2f')],'type':_0x71a76d['type'][_0xe364('0x30')]};});_0x2a370d['model']=_[_0xe364('0x2d')](_0x55b542,'name');_0x2a370d[_0xe364('0x31')]=_[_0xe364('0x32')](_0x38a331[_0xe364('0x31')]);_0x2a370d['filters']=_[_0xe364('0x33')](_0x2a370d[_0xe364('0x34')],_0x2a370d[_0xe364('0x31')]);_0x133f4c[_0xe364('0x35')]=_[_0xe364('0x33')](_0x2a370d['model'],qs[_0xe364('0x36')](_0x38a331[_0xe364('0x31')]['fields']));_0x133f4c[_0xe364('0x35')]=_0x133f4c['attributes'][_0xe364('0x37')]?_0x133f4c['attributes']:_0x2a370d['model'];if(!_0x38a331[_0xe364('0x31')][_0xe364('0x38')](_0xe364('0x39'))){_0x133f4c[_0xe364('0x1e')]=qs[_0xe364('0x1e')](_0x38a331[_0xe364('0x31')]['limit']);_0x133f4c['offset']=qs[_0xe364('0x21')](_0x38a331[_0xe364('0x31')][_0xe364('0x21')]);}_0x133f4c['order']=qs[_0xe364('0x3a')](_0x38a331[_0xe364('0x31')]['sort']);_0x133f4c[_0xe364('0x3b')]=qs[_0xe364('0x3c')](_['pick'](_0x38a331['query'],_0x2a370d[_0xe364('0x3c')]),_0x55b542);if(_0x38a331['query'][_0xe364('0x3d')]){_0x133f4c['where']=_[_0xe364('0x3e')](_0x133f4c[_0xe364('0x3b')],{'$or':_[_0xe364('0x2d')](_0x55b542,function(_0x1b9dbb){if(_0x1b9dbb[_0xe364('0x3f')]!==_0xe364('0x40')){var _0x764f44={};_0x764f44[_0x1b9dbb[_0xe364('0x2a')]]={'$like':'%'+_0x38a331[_0xe364('0x31')][_0xe364('0x3d')]+'%'};return _0x764f44;}})});}_0x133f4c=_[_0xe364('0x3e')]({},_0x133f4c,_0x38a331[_0xe364('0x41')]);var _0x1e4ec3={'where':_0x133f4c[_0xe364('0x3b')]};return db[_0xe364('0x42')]['count'](_0x1e4ec3)[_0xe364('0x26')](function(_0x4a0dca){_0x18ff74[_0xe364('0x20')]=_0x4a0dca;if(_0x38a331['query'][_0xe364('0x43')]){_0x133f4c[_0xe364('0x44')]=[{'all':!![]}];}return db[_0xe364('0x42')][_0xe364('0x45')](_0x133f4c);})[_0xe364('0x26')](function(_0x29679e){_0x18ff74[_0xe364('0x46')]=_0x29679e;return _0x18ff74;})[_0xe364('0x26')](respondWithFilteredResult(_0x1a2add,_0x133f4c))['catch'](handleError(_0x1a2add,null));};exports[_0xe364('0x47')]=function(_0x377fde,_0x31b6e6){var _0x59988e={'raw':!![],'where':{'id':_0x377fde['params']['id']}},_0x1fff62={};_0x1fff62[_0xe364('0x34')]=_[_0xe364('0x32')](db[_0xe364('0x42')][_0xe364('0x2e')]);_0x1fff62[_0xe364('0x31')]=_[_0xe364('0x32')](_0x377fde[_0xe364('0x31')]);_0x1fff62['filters']=_[_0xe364('0x33')](_0x1fff62[_0xe364('0x34')],_0x1fff62[_0xe364('0x31')]);_0x59988e[_0xe364('0x35')]=_[_0xe364('0x33')](_0x1fff62['model'],qs[_0xe364('0x36')](_0x377fde['query'][_0xe364('0x36')]));_0x59988e[_0xe364('0x35')]=_0x59988e[_0xe364('0x35')]['length']?_0x59988e['attributes']:_0x1fff62[_0xe364('0x34')];if(_0x377fde[_0xe364('0x31')][_0xe364('0x43')]){_0x59988e[_0xe364('0x44')]=[{'all':!![]}];}_0x59988e=_[_0xe364('0x3e')]({},_0x59988e,_0x377fde['options']);return db[_0xe364('0x42')][_0xe364('0x48')](_0x59988e)[_0xe364('0x26')](handleEntityNotFound(_0x31b6e6,null))[_0xe364('0x26')](respondWithResult(_0x31b6e6,null))[_0xe364('0x49')](handleError(_0x31b6e6,null));};exports[_0xe364('0x4a')]=function(_0x1f94e8,_0xd0e421){return db[_0xe364('0x42')][_0xe364('0x4a')](_0x1f94e8[_0xe364('0x4b')],{})[_0xe364('0x26')](respondWithResult(_0xd0e421,0xc9))[_0xe364('0x49')](handleError(_0xd0e421,null));};exports[_0xe364('0x4c')]=function(_0x21f5e3,_0x2158d0){if(_0x21f5e3[_0xe364('0x4b')]['id']){delete _0x21f5e3[_0xe364('0x4b')]['id'];}return db[_0xe364('0x42')][_0xe364('0x48')]({'where':{'id':_0x21f5e3[_0xe364('0x4d')]['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x2158d0,null))[_0xe364('0x26')](saveUpdates(_0x21f5e3[_0xe364('0x4b')],null))['then'](respondWithResult(_0x2158d0,null))[_0xe364('0x49')](handleError(_0x2158d0,null));};exports[_0xe364('0x27')]=function(_0x230e4f,_0x15c90d){return db['SmsApplication'][_0xe364('0x48')]({'where':{'id':_0x230e4f['params']['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x15c90d,null))[_0xe364('0x26')](removeEntity(_0x15c90d,null))['catch'](handleError(_0x15c90d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index f13638d..7e3a2a7 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 _0x36f4=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4_unicode_ci','util'];(function(_0x2fceb3,_0x1e08ae){var _0x3624af=function(_0x171166){while(--_0x171166){_0x2fceb3['push'](_0x2fceb3['shift']());}};_0x3624af(++_0x1e08ae);}(_0x36f4,0xb3));var _0x436f=function(_0x2cb345,_0x15d1f0){_0x2cb345=_0x2cb345-0x0;var _0x2ac76c=_0x36f4[_0x2cb345];return _0x2ac76c;};'use strict';var _=require('lodash');var util=require(_0x436f('0x0'));var logger=require(_0x436f('0x1'))(_0x436f('0x2'));var moment=require(_0x436f('0x3'));var BPromise=require(_0x436f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x436f('0x5'));var config=require(_0x436f('0x6'));var attributes=require(_0x436f('0x7'));module[_0x436f('0x8')]=function(_0x59cfcf,_0x5f31ff){return _0x59cfcf[_0x436f('0x9')]('SmsApplication',attributes,{'tableName':_0x436f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x436f('0xb')});}; \ No newline at end of file +var _0x61c6=['exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','./smsApplication.attributes'];(function(_0x479523,_0x1a6a9b){var _0x28ffee=function(_0x41ca12){while(--_0x41ca12){_0x479523['push'](_0x479523['shift']());}};_0x28ffee(++_0x1a6a9b);}(_0x61c6,0x199));var _0x661c=function(_0x212d0a,_0x39affb){_0x212d0a=_0x212d0a-0x0;var _0x3f61d9=_0x61c6[_0x212d0a];return _0x3f61d9;};'use strict';var _=require(_0x661c('0x0'));var util=require(_0x661c('0x1'));var logger=require(_0x661c('0x2'))(_0x661c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x661c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x661c('0x5'));var config=require('../../config/environment');var attributes=require(_0x661c('0x6'));module[_0x661c('0x7')]=function(_0x531865,_0x4936a9){return _0x531865[_0x661c('0x8')](_0x661c('0x9'),attributes,{'tableName':_0x661c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x661c('0xb'),'collate':_0x661c('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index cbb47a1..e75d01a 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 _0x1775=['stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x377023,_0x35328a){var _0x83b351=function(_0x569bd9){while(--_0x569bd9){_0x377023['push'](_0x377023['shift']());}};_0x83b351(++_0x35328a);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('SmsApplication,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});} \ No newline at end of file +var _0x4bd3=['request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4155ba,_0x443f76){var _0xe3f2e2=function(_0x4ab529){while(--_0x4ab529){_0x4155ba['push'](_0x4155ba['shift']());}};_0xe3f2e2(++_0x443f76);}(_0x4bd3,0x174));var _0x34bd=function(_0x1477d1,_0x442a29){_0x1477d1=_0x1477d1-0x0;var _0x152e87=_0x4bd3[_0x1477d1];return _0x152e87;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var moment=require(_0x34bd('0x1'));var BPromise=require(_0x34bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34bd('0x3'));var logger=require(_0x34bd('0x4'))(_0x34bd('0x5'));var config=require('../../config/environment');var jayson=require(_0x34bd('0x6'));var client=jayson[_0x34bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8744,_0x213716,_0x51a4d7){return new BPromise(function(_0xd600e1,_0x76de8d){return client[_0x34bd('0x8')](_0x3e8744,_0x51a4d7)[_0x34bd('0x9')](function(_0x1ac77f){logger[_0x34bd('0xa')]('SmsApplication,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));logger[_0x34bd('0xc')](_0x34bd('0xd'),_0x213716,_0x34bd('0xb'),JSON['stringify'](_0x1ac77f));if(_0x1ac77f['error']){if(_0x1ac77f[_0x34bd('0xe')]['code']===0x1f4){logger['error'](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0x76de8d(_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);}logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x1ac77f[_0x34bd('0xe')][_0x34bd('0x10')]);return _0xd600e1(_0x1ac77f['error'][_0x34bd('0x10')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x213716,_0x34bd('0xb'));_0xd600e1(_0x1ac77f[_0x34bd('0x11')][_0x34bd('0x10')]);}})[_0x34bd('0x12')](function(_0x34b91b){logger[_0x34bd('0xe')](_0x34bd('0xf'),_0x213716,_0x34b91b);_0x76de8d(_0x34b91b);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index ba00ad5..ce43fd7 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 _0x6cb4=['./smsInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','/:id/download','create','post','/:id/messages','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a8eca,_0x2390c2){var _0x3ec4b9=function(_0x2d3651){while(--_0x2d3651){_0x2a8eca['push'](_0x2a8eca['shift']());}};_0x3ec4b9(++_0x2390c2);}(_0x6cb4,0xff));var _0x46cb=function(_0x1a65b1,_0xba7520){_0x1a65b1=_0x1a65b1-0x0;var _0x3b86a6=_0x6cb4[_0x1a65b1];return _0x3b86a6;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xb')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0xf')]);router[_0x46cb('0xb')]('/:id/messages',auth[_0x46cb('0xa')](),controller[_0x46cb('0x10')]);router['get'](_0x46cb('0x11'),auth[_0x46cb('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x46cb('0x12')]);router[_0x46cb('0x13')](_0x46cb('0x14'),auth[_0x46cb('0xa')](),controller['addMessage']);router[_0x46cb('0x13')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')](_0x46cb('0x17'),_0x46cb('0x18')),controller[_0x46cb('0x19')]);router[_0x46cb('0x1a')](_0x46cb('0xe'),auth[_0x46cb('0xa')](),interaction[_0x46cb('0x16')]('sms',_0x46cb('0x1b')),controller['update']);router[_0x46cb('0x1c')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x46cb('0x17'),_0x46cb('0x1d')),controller[_0x46cb('0x1e')]);router[_0x46cb('0x1c')](_0x46cb('0x15'),auth[_0x46cb('0xa')](),controller[_0x46cb('0x1f')]);module[_0x46cb('0x20')]=router; \ No newline at end of file +var _0x4024=['addTags','put','smsinteraction:update','update','delete','destroy','removeTags','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','download','create','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x4024,0x89));var _0x4402=function(_0x50cc5c,_0x4afd90){_0x50cc5c=_0x50cc5c-0x0;var _0x4e6835=_0x4024[_0x50cc5c];return _0x4e6835;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/describe',auth[_0x4402('0x7')](),controller['describe']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4402('0x9')]('/:id/messages',auth[_0x4402('0x7')](),controller['getMessages']);router[_0x4402('0x9')]('/:id/download',auth[_0x4402('0x7')](),controller[_0x4402('0xb')]);router['post']('/',auth[_0x4402('0x7')](),controller[_0x4402('0xc')]);router[_0x4402('0xd')]('/:id/messages',auth[_0x4402('0x7')](),controller[_0x4402('0xe')]);router[_0x4402('0xd')](_0x4402('0xf'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')](_0x4402('0x11'),_0x4402('0x12')),controller[_0x4402('0x13')]);router[_0x4402('0x14')](_0x4402('0xa'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')](_0x4402('0x11'),_0x4402('0x15')),controller[_0x4402('0x16')]);router[_0x4402('0x17')](_0x4402('0xa'),auth[_0x4402('0x7')](),interaction[_0x4402('0x10')]('sms','smsinteraction:destroy'),controller[_0x4402('0x18')]);router[_0x4402('0x17')]('/:id/tags',auth[_0x4402('0x7')](),controller[_0x4402('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 643ef67..082ac5f 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 _0x6df9=['moment','BOOLEAN','STRING','DATE','out','INTEGER','sequelize'];(function(_0x525838,_0x4afad4){var _0x4d6645=function(_0x4d2921){while(--_0x4d2921){_0x525838['push'](_0x525838['shift']());}};_0x4d6645(++_0x4afad4);}(_0x6df9,0x84));var _0x96df=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6df9[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x96df('0x0'));var moment=require(_0x96df('0x1'));module['exports']={'closed':{'type':Sequelize[_0x96df('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x96df('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x96df('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x96df('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x96df('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x96df('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x96df('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x96df('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x96df('0x6')]}}; \ No newline at end of file +var _0xabad=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x212960,_0x520f14){var _0x4f5a8a=function(_0x5e40c5){while(--_0x5e40c5){_0x212960['push'](_0x212960['shift']());}};_0x4f5a8a(++_0x520f14);}(_0xabad,0x150));var _0xdaba=function(_0xfa716b,_0x1fa236){_0xfa716b=_0xfa716b-0x0;var _0xe946ab=_0xabad[_0xfa716b];return _0xe946ab;};'use strict';var Sequelize=require(_0xdaba('0x0'));var moment=require('moment');module[_0xdaba('0x1')]={'closed':{'type':Sequelize[_0xdaba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdaba('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdaba('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdaba('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdaba('0x4')]},'read1stAt':{'type':Sequelize[_0xdaba('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdaba('0x5')]('in',_0xdaba('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdaba('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdaba('0x5')]('in',_0xdaba('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdaba('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 65d8a6d..5ae5652 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 _0x5e52=['filter','out','Contact','lastName','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','findAll','user','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','include','options','SmsInteraction','find','create','body','destroy','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','nolimit','sort','where','pick','SmsInteractionId','$gte','split','format','merge','includeAll','rows','addTags','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','Messages','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','createdAt','closed','YYYY-MM-DD\x20HH:mm:ss','disposition'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5e52,0x105));var _0x25e5=function(_0x5e7e4c,_0x4cf045){_0x5e7e4c=_0x5e7e4c-0x0;var _0x4a2530=_0x5e52[_0x5e7e4c];return _0x4a2530;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x25e5('0x0'));var BPromise=require(_0x25e5('0x1'));var util=require(_0x25e5('0x2'));var path=require(_0x25e5('0x3'));var ejs=require(_0x25e5('0x4'));var fs=require('fs');var _=require(_0x25e5('0x5'));var Redis=require(_0x25e5('0x6'));var interaction=require(_0x25e5('0x7'));var qs=require(_0x25e5('0x8'));var pdf=require(_0x25e5('0x9'));var logger=require(_0x25e5('0xa'))(_0x25e5('0xb'));var config=require(_0x25e5('0xc'));var db=require(_0x25e5('0xd'))['db'];config[_0x25e5('0xe')]=_['defaults'](config['redis'],{'host':_0x25e5('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x25e5('0xe')]));require(_0x25e5('0x10'))[_0x25e5('0x11')](socket);function respondWithStatusCode(_0x30fcbe,_0x13b1c1){_0x13b1c1=_0x13b1c1||0xcc;return function(_0x8f21e1){if(_0x8f21e1){return _0x30fcbe['sendStatus'](_0x13b1c1);}return _0x30fcbe[_0x25e5('0x12')](_0x13b1c1)[_0x25e5('0x13')]();};}function respondWithResult(_0x5b6b39,_0x361722){_0x361722=_0x361722||0xc8;return function(_0x1eca30){if(_0x1eca30){return _0x5b6b39['status'](_0x361722)[_0x25e5('0x14')](_0x1eca30);}};}function respondWithFilteredResult(_0x1927a7,_0xe78421){return function(_0x4136b5){if(_0x4136b5){var _0x22c549=typeof _0xe78421[_0x25e5('0x15')]===_0x25e5('0x16')&&typeof _0xe78421[_0x25e5('0x17')]===_0x25e5('0x16');var _0x1e5c8e=_0x4136b5[_0x25e5('0x18')];var _0x1d7510=_0x22c549?0x0:_0xe78421[_0x25e5('0x15')];var _0x2a6dfb=_0x22c549?_0x4136b5[_0x25e5('0x18')]:_0xe78421[_0x25e5('0x15')]+_0xe78421[_0x25e5('0x17')];var _0x42b954;if(_0x2a6dfb>=_0x1e5c8e){_0x2a6dfb=_0x1e5c8e;_0x42b954=0xc8;}else{_0x42b954=0xce;}_0x1927a7[_0x25e5('0x12')](_0x42b954);return _0x1927a7[_0x25e5('0x19')](_0x25e5('0x1a'),_0x1d7510+'-'+_0x2a6dfb+'/'+_0x1e5c8e)[_0x25e5('0x14')](_0x4136b5);}return null;};}function saveUpdates(_0x5a5406){return function(_0x1757a1){if(_0x1757a1){return _0x1757a1['update'](_0x5a5406)['then'](function(_0x175948){return _0x175948;});}return null;};}function removeEntity(_0x31f41e){return function(_0x4e9bbd){if(_0x4e9bbd){return _0x4e9bbd['destroy']()[_0x25e5('0x1b')](function(){_0x31f41e[_0x25e5('0x12')](0xcc)[_0x25e5('0x13')]();});}};}function handleEntityNotFound(_0x6048b3){return function(_0x23dcf1){if(!_0x23dcf1){_0x6048b3[_0x25e5('0x1c')](0x194);}return _0x23dcf1;};}function handleError(_0x5fb5f,_0x16970b){_0x16970b=_0x16970b||0x1f4;return function(_0x78e2b5){logger[_0x25e5('0x1d')](_0x78e2b5[_0x25e5('0x1e')]);if(_0x78e2b5[_0x25e5('0x1f')]){delete _0x78e2b5['name'];}_0x5fb5f[_0x25e5('0x12')](_0x16970b)[_0x25e5('0x20')](_0x78e2b5);};}exports[_0x25e5('0x21')]=function(_0x2c14af,_0x587f87){var _0x7503f9={};var _0x406196=_[_0x25e5('0x22')](db['SmsInteraction'][_0x25e5('0x23')],function(_0x4921bc){return{'name':_0x4921bc[_0x25e5('0x24')],'type':_0x4921bc[_0x25e5('0x25')]['key']};});_0x7503f9=qs[_0x25e5('0x26')](_0x406196,_0x2c14af);return interaction[_0x25e5('0x27')]('sms',_0x2c14af['query'],_0x2c14af[_0x25e5('0x28')],_0x7503f9,_0x406196)['then'](respondWithFilteredResult(_0x587f87,_0x7503f9))[_0x25e5('0x29')](handleError(_0x587f87,null));};exports[_0x25e5('0x2a')]=function(_0x395280,_0x1867b3){var _0x44a345={'raw':![],'where':{'id':_0x395280[_0x25e5('0x2b')]['id']}},_0xe6403a={};_0xe6403a[_0x25e5('0x2c')]=_[_0x25e5('0x2d')](db['SmsInteraction'][_0x25e5('0x23')]);_0xe6403a[_0x25e5('0x2e')]=_[_0x25e5('0x2d')](_0x395280[_0x25e5('0x2e')]);_0xe6403a[_0x25e5('0x2f')]=_[_0x25e5('0x30')](_0xe6403a['model'],_0xe6403a[_0x25e5('0x2e')]);_0x44a345[_0x25e5('0x31')]=_[_0x25e5('0x30')](_0xe6403a[_0x25e5('0x2c')],qs[_0x25e5('0x32')](_0x395280[_0x25e5('0x2e')][_0x25e5('0x32')]));_0x44a345[_0x25e5('0x31')]=_0x44a345[_0x25e5('0x31')][_0x25e5('0x33')]?_0x44a345['attributes']:_0xe6403a[_0x25e5('0x2c')];if(_0x395280['query']['includeAll']){_0x44a345[_0x25e5('0x34')]=[{'all':!![]}];}_0x44a345=_['merge']({},_0x44a345,_0x395280[_0x25e5('0x35')]);return db[_0x25e5('0x36')][_0x25e5('0x37')](_0x44a345)[_0x25e5('0x1b')](handleEntityNotFound(_0x1867b3,null))[_0x25e5('0x1b')](respondWithResult(_0x1867b3,null))[_0x25e5('0x29')](handleError(_0x1867b3,null));};exports[_0x25e5('0x38')]=function(_0x3f67ad,_0x57cab7){return db[_0x25e5('0x36')][_0x25e5('0x38')](_0x3f67ad[_0x25e5('0x39')],{})[_0x25e5('0x1b')](respondWithResult(_0x57cab7,0xc9))[_0x25e5('0x29')](handleError(_0x57cab7,null));};exports['update']=function(_0xe0d97,_0x3c96e8){if(_0xe0d97[_0x25e5('0x39')]['id']){delete _0xe0d97[_0x25e5('0x39')]['id'];}return db['SmsInteraction'][_0x25e5('0x37')]({'where':{'id':_0xe0d97[_0x25e5('0x2b')]['id']}})[_0x25e5('0x1b')](handleEntityNotFound(_0x3c96e8,null))[_0x25e5('0x1b')](saveUpdates(_0xe0d97[_0x25e5('0x39')],null))['then'](respondWithResult(_0x3c96e8,null))['catch'](handleError(_0x3c96e8,null));};exports[_0x25e5('0x3a')]=function(_0x1894c0,_0x18c918){return db[_0x25e5('0x36')][_0x25e5('0x37')]({'where':{'id':_0x1894c0[_0x25e5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x18c918,null))['then'](removeEntity(_0x18c918,null))[_0x25e5('0x29')](handleError(_0x18c918,null));};exports[_0x25e5('0x3b')]=function(_0x577245,_0x1d4b94){return db[_0x25e5('0x36')][_0x25e5('0x3b')]()[_0x25e5('0x1b')](respondWithResult(_0x1d4b94,null))[_0x25e5('0x29')](handleError(_0x1d4b94,null));};exports[_0x25e5('0x3c')]=function(_0x5e3bfd,_0x520218){return db[_0x25e5('0x3d')][_0x25e5('0x37')]({'where':{'id':_0x5e3bfd[_0x25e5('0x2b')]['id']}})['then'](handleEntityNotFound(_0x520218,null))['then'](function(_0x664d52){if(_0x664d52){return _0x664d52[_0x25e5('0x3c')](_0x5e3bfd[_0x25e5('0x39')]['ids'],_[_0x25e5('0x3e')](_0x5e3bfd[_0x25e5('0x39')],[_0x25e5('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x520218,null))['catch'](handleError(_0x520218,null));};exports[_0x25e5('0x40')]=function(_0x2d61a0,_0x38c559){var _0x37ca75={'raw':![],'where':{}};var _0x297df0={};var _0x52587a={'count':0x0,'rows':[]};return db[_0x25e5('0x36')][_0x25e5('0x41')]({'where':{'id':_0x2d61a0[_0x25e5('0x2b')]['id']}})[_0x25e5('0x1b')](handleEntityNotFound(_0x38c559,null))['then'](function(_0x4127a9){if(_0x4127a9){_0x297df0[_0x25e5('0x2c')]=_[_0x25e5('0x2d')](db[_0x25e5('0x3d')][_0x25e5('0x23')]);_0x297df0['query']=_[_0x25e5('0x2d')](_0x2d61a0[_0x25e5('0x2e')]);_0x297df0[_0x25e5('0x2f')]=_[_0x25e5('0x30')](_0x297df0[_0x25e5('0x2c')],_0x297df0[_0x25e5('0x2e')]);_0x37ca75['attributes']=_['intersection'](_0x297df0[_0x25e5('0x2c')],qs[_0x25e5('0x32')](_0x2d61a0['query'][_0x25e5('0x32')]));_0x37ca75[_0x25e5('0x31')]=_0x37ca75[_0x25e5('0x31')][_0x25e5('0x33')]?_0x37ca75[_0x25e5('0x31')]:_0x297df0['model'];if(!_0x2d61a0[_0x25e5('0x2e')]['hasOwnProperty'](_0x25e5('0x42'))){_0x37ca75[_0x25e5('0x17')]=qs[_0x25e5('0x17')](_0x2d61a0['query'][_0x25e5('0x17')]);_0x37ca75[_0x25e5('0x15')]=qs[_0x25e5('0x15')](_0x2d61a0[_0x25e5('0x2e')][_0x25e5('0x15')]);}_0x37ca75['order']=qs[_0x25e5('0x43')](_0x2d61a0[_0x25e5('0x2e')]['sort']);_0x37ca75[_0x25e5('0x44')]=qs['filters'](_[_0x25e5('0x45')](_0x2d61a0[_0x25e5('0x2e')],_0x297df0[_0x25e5('0x2f')]));_0x37ca75['where'][_0x25e5('0x46')]=_0x4127a9['id'];if(_0x2d61a0[_0x25e5('0x2e')]['filter']){_0x37ca75[_0x25e5('0x44')]=_['merge'](_0x37ca75[_0x25e5('0x44')],{'$or':_['map'](_0x37ca75['attributes'],function(_0x47693f){var _0x4a89d2={};_0x4a89d2[_0x47693f]={'$like':'%'+_0x2d61a0[_0x25e5('0x2e')]['filter']+'%'};return _0x4a89d2;})});}if(_0x2d61a0[_0x25e5('0x2e')][_0x25e5('0x47')]){var _0x344ab5=_0x2d61a0[_0x25e5('0x2e')]['$gte'][_0x25e5('0x48')](',');var _0x55dc1b={};_0x55dc1b[_0x344ab5[0x0]]={'$gte':moment(_0x344ab5[0x1])[_0x25e5('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0x37ca75[_0x25e5('0x44')]=_[_0x25e5('0x4a')](_0x37ca75['where'],_0x55dc1b);}_0x37ca75=_['merge']({},_0x37ca75,_0x2d61a0[_0x25e5('0x35')]);return db[_0x25e5('0x3d')][_0x25e5('0x18')]({'where':_0x37ca75[_0x25e5('0x44')]})[_0x25e5('0x1b')](function(_0x4ac419){_0x52587a['count']=_0x4ac419;if(_0x2d61a0[_0x25e5('0x2e')][_0x25e5('0x4b')]){_0x37ca75[_0x25e5('0x34')]=[{'all':!![]}];}return db[_0x25e5('0x3d')][_0x25e5('0x27')](_0x37ca75);})['then'](function(_0x1cce91){_0x52587a[_0x25e5('0x4c')]=_0x1cce91;return _0x52587a;});}})[_0x25e5('0x1b')](respondWithFilteredResult(_0x38c559,_0x37ca75))['catch'](handleError(_0x38c559,null));};exports[_0x25e5('0x4d')]=function(_0x2bc914,_0x47a32e){return db['SmsInteraction'][_0x25e5('0x37')]({'where':{'id':_0x2bc914[_0x25e5('0x2b')]['id']}})[_0x25e5('0x1b')](handleEntityNotFound(_0x47a32e,null))[_0x25e5('0x1b')](function(_0x268649){if(_0x268649){return _0x268649['setTags'](_0x2bc914[_0x25e5('0x39')]['ids'],_[_0x25e5('0x3e')](_0x2bc914[_0x25e5('0x39')],[_0x25e5('0x3f'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x25e5('0x1f'),_0x25e5('0x4e')],'where':{'id':_0x2bc914[_0x25e5('0x39')][_0x25e5('0x3f')]}});})[_0x25e5('0x1b')](function(_0x2984ca){socket[_0x25e5('0x4f')](_0x25e5('0x50'),{'id':Number(_0x2bc914[_0x25e5('0x2b')]['id']),'tags':_0x2984ca||[]});return{'id':Number(_0x2bc914[_0x25e5('0x2b')]['id']),'tags':_0x2984ca||[]};});}})[_0x25e5('0x1b')](respondWithResult(_0x47a32e,null))[_0x25e5('0x29')](handleError(_0x47a32e,null));};exports[_0x25e5('0x51')]=function(_0x3b1293,_0x5cdad5){return db[_0x25e5('0x36')][_0x25e5('0x37')]({'where':{'id':_0x3b1293[_0x25e5('0x2b')]['id']}})[_0x25e5('0x1b')](handleEntityNotFound(_0x5cdad5,null))[_0x25e5('0x1b')](function(_0x30976a){if(_0x30976a){return _0x30976a[_0x25e5('0x51')](_0x3b1293[_0x25e5('0x2e')][_0x25e5('0x3f')]);}})[_0x25e5('0x1b')](respondWithStatusCode(_0x5cdad5,null))[_0x25e5('0x29')](handleError(_0x5cdad5,null));};exports[_0x25e5('0x52')]=function(_0x49ea17,_0x35b833){var _0x5b4615=moment()[_0x25e5('0x53')]()[_0x25e5('0x54')]();var _0x14107f=path[_0x25e5('0x55')](config[_0x25e5('0x56')],_0x25e5('0x57'),_0x25e5('0x58'),_0x25e5('0x59'));var _0x3e0139=path[_0x25e5('0x55')](_0x14107f,_0x5b4615);var _0x4941fc=util[_0x25e5('0x49')](_0x25e5('0x5a'),_0x49ea17['params']['id'],_0x5b4615);var _0x34cd2b=path[_0x25e5('0x55')](_0x14107f,_0x4941fc);var _0x58adf7=[];_0x58adf7[_0x25e5('0x5b')]({'model':db[_0x25e5('0x5c')],'as':_0x25e5('0x5c'),'attributes':['id',_0x25e5('0x5d')],'raw':!![]});_0x58adf7['push']({'model':db[_0x25e5('0x5e')],'as':'Contact','attributes':['id',_0x25e5('0x5f'),'lastName'],'raw':!![]});var _0x4d8687=[{'model':db['SmsMessage'],'as':_0x25e5('0x60'),'attributes':['id',_0x25e5('0x39'),'createdAt',_0x25e5('0x61'),_0x25e5('0x62'),_0x25e5('0x63')],'include':_0x58adf7}];_0x4d8687[_0x25e5('0x5b')]({'model':db[_0x25e5('0x64')],'as':_0x25e5('0x65'),'attributes':['id',_0x25e5('0x1f')]});_0x4d8687[_0x25e5('0x5b')]({'model':db[_0x25e5('0x5c')],'as':_0x25e5('0x66'),'attributes':['id',_0x25e5('0x5d')]});return db[_0x25e5('0x36')][_0x25e5('0x37')]({'where':{'id':_0x49ea17[_0x25e5('0x2b')]['id']},'include':_0x4d8687})['then'](handleEntityNotFound(_0x35b833,null))[_0x25e5('0x1b')](function(_0x2f9329){if(_0x2f9329){var _0x23669b=_0x2f9329[_0x25e5('0x67')]({'plain':!![]});fs[_0x25e5('0x68')](_0x3e0139);var _0x19828f={'channel':_0x25e5('0x69'),'account':_0x23669b[_0x25e5('0x65')][_0x25e5('0x1f')],'agent':_0x23669b[_0x25e5('0x66')]?_0x23669b['Owner'][_0x25e5('0x5d')]:_0x25e5('0x6a'),'createdAt':moment(_0x23669b[_0x25e5('0x6b')])[_0x25e5('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x25e5('0x54')](),'closedAt':_0x23669b[_0x25e5('0x6c')]?moment(_0x23669b['closedAt'])['format'](_0x25e5('0x6d'))['toString']():'','disposition':_0x23669b[_0x25e5('0x6e')],'messages':_(_0x23669b[_0x25e5('0x60')])[_0x25e5('0x6f')]({'secret':![]})[_0x25e5('0x22')](function(_0x16d35e){return{'date':moment(_0x16d35e['createdAt'])['format'](_0x25e5('0x6d'))['toString'](),'sender':_0x16d35e[_0x25e5('0x61')]===_0x25e5('0x70')?_0x16d35e['User']?_0x16d35e[_0x25e5('0x5c')][_0x25e5('0x5d')]:'System':_0x16d35e[_0x25e5('0x71')][_0x25e5('0x5f')]+(_0x16d35e[_0x25e5('0x71')]['lastName']?'\x20'+_0x16d35e[_0x25e5('0x71')][_0x25e5('0x72')]:''),'body':_0x16d35e['body'],'direction':_0x16d35e[_0x25e5('0x61')]===_0x25e5('0x70')?'A':'C','secret':_0x16d35e[_0x25e5('0x62')],'read':_0x16d35e['read']};})[_0x25e5('0x73')]()};return ejs[_0x25e5('0x74')](path[_0x25e5('0x55')](config[_0x25e5('0x56')],'server','views',_0x25e5('0x75')),{'interaction':_0x19828f})['then'](function(_0x8d79ae){var _0x57434e=path[_0x25e5('0x55')](_0x3e0139,_0x25e5('0x76')+_0x23669b['id']+'-'+_0x5b4615+_0x25e5('0x77'));var _0x1c926d={'path':_0x57434e,'channel':'Sms','interactionId':_0x23669b['id']};return pdf[_0x25e5('0x78')](_0x8d79ae,_0x1c926d);})[_0x25e5('0x1b')](function(){return new BPromise(function(_0x5b5aad,_0x1e74ee){zipdir(_0x3e0139,{'saveTo':_0x34cd2b},function(_0x2f9bef,_0xd2f34e){if(_0x2f9bef)return _0x1e74ee(_0x2f9bef);return _0x5b5aad(_0xd2f34e);});})['then'](function(){return new BPromise(function(_0x53e19f,_0x1f8e48){rimraf(_0x3e0139,function(_0x5a3bff){if(_0x5a3bff)_0x1f8e48(_0x5a3bff);return _0x53e19f();});});})[_0x25e5('0x1b')](function(){return _0x35b833[_0x25e5('0x52')](_0x34cd2b,_0x4941fc,function(_0x4d61cc){if(_0x4d61cc){console[_0x25e5('0x79')](_0x25e5('0x7a'),_0x4d61cc);}else{fs[_0x25e5('0x7b')](_0x34cd2b);}});});});}else{return _0x35b833[_0x25e5('0x1c')](0xc8);}})[_0x25e5('0x29')](handleError(_0x35b833,null));}; \ No newline at end of file +var _0x21ee=['secret','read','Account','mkdirSync','Sms','Owner','N.A.','toString','closed','closedAt','disposition','Messages','createdAt','YYYY-MM-DD\x20HH:mm:ss','direction','out','System','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','update','then','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','findAll','sms','query','user','catch','show','params','model','keys','fields','attributes','length','includeAll','include','merge','options','find','create','body','destroy','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','filters','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','rows','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','root','tmp','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','lastName'];(function(_0x1afd7d,_0x430d12){var _0x2a7fa4=function(_0x8b5dbd){while(--_0x8b5dbd){_0x1afd7d['push'](_0x1afd7d['shift']());}};_0x2a7fa4(++_0x430d12);}(_0x21ee,0x18d));var _0xe21e=function(_0xdfd829,_0x46ff2b){_0xdfd829=_0xdfd829-0x0;var _0x68903=_0x21ee[_0xdfd829];return _0x68903;};'use strict';var rimraf=require(_0xe21e('0x0'));var zipdir=require(_0xe21e('0x1'));var moment=require(_0xe21e('0x2'));var BPromise=require(_0xe21e('0x3'));var util=require(_0xe21e('0x4'));var path=require(_0xe21e('0x5'));var ejs=require(_0xe21e('0x6'));var fs=require('fs');var _=require(_0xe21e('0x7'));var Redis=require(_0xe21e('0x8'));var interaction=require(_0xe21e('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0xe21e('0xa'));var logger=require(_0xe21e('0xb'))('api');var config=require('../../config/environment');var db=require(_0xe21e('0xc'))['db'];config[_0xe21e('0xd')]=_[_0xe21e('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe21e('0xf'))(new Redis(config[_0xe21e('0xd')]));require(_0xe21e('0x10'))[_0xe21e('0x11')](socket);function respondWithStatusCode(_0x3b2558,_0x236f6b){_0x236f6b=_0x236f6b||0xcc;return function(_0x1da3ec){if(_0x1da3ec){return _0x3b2558[_0xe21e('0x12')](_0x236f6b);}return _0x3b2558[_0xe21e('0x13')](_0x236f6b)['end']();};}function respondWithResult(_0x12678,_0x118bda){_0x118bda=_0x118bda||0xc8;return function(_0x80e487){if(_0x80e487){return _0x12678['status'](_0x118bda)[_0xe21e('0x14')](_0x80e487);}};}function respondWithFilteredResult(_0x108637,_0x33b651){return function(_0xceb261){if(_0xceb261){var _0x43e101=typeof _0x33b651[_0xe21e('0x15')]==='undefined'&&typeof _0x33b651[_0xe21e('0x16')]===_0xe21e('0x17');var _0x454894=_0xceb261[_0xe21e('0x18')];var _0x5e0639=_0x43e101?0x0:_0x33b651[_0xe21e('0x15')];var _0x5e86da=_0x43e101?_0xceb261['count']:_0x33b651[_0xe21e('0x15')]+_0x33b651[_0xe21e('0x16')];var _0x5ece7c;if(_0x5e86da>=_0x454894){_0x5e86da=_0x454894;_0x5ece7c=0xc8;}else{_0x5ece7c=0xce;}_0x108637['status'](_0x5ece7c);return _0x108637[_0xe21e('0x19')]('Content-Range',_0x5e0639+'-'+_0x5e86da+'/'+_0x454894)[_0xe21e('0x14')](_0xceb261);}return null;};}function saveUpdates(_0x12d5c4){return function(_0x33b1ec){if(_0x33b1ec){return _0x33b1ec[_0xe21e('0x1a')](_0x12d5c4)[_0xe21e('0x1b')](function(_0x14664a){return _0x14664a;});}return null;};}function removeEntity(_0x47e889){return function(_0x177f8d){if(_0x177f8d){return _0x177f8d['destroy']()[_0xe21e('0x1b')](function(){_0x47e889[_0xe21e('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41a657){return function(_0x117658){if(!_0x117658){_0x41a657[_0xe21e('0x12')](0x194);}return _0x117658;};}function handleError(_0x42da50,_0x3a649a){_0x3a649a=_0x3a649a||0x1f4;return function(_0x323253){logger[_0xe21e('0x1c')](_0x323253[_0xe21e('0x1d')]);if(_0x323253['name']){delete _0x323253[_0xe21e('0x1e')];}_0x42da50[_0xe21e('0x13')](_0x3a649a)[_0xe21e('0x1f')](_0x323253);};}exports[_0xe21e('0x20')]=function(_0x22dd8c,_0x4fdb43){var _0x117726={};var _0x591447=_[_0xe21e('0x21')](db[_0xe21e('0x22')][_0xe21e('0x23')],function(_0x50b38d){return{'name':_0x50b38d[_0xe21e('0x24')],'type':_0x50b38d[_0xe21e('0x25')]['key']};});_0x117726=qs['getOptions'](_0x591447,_0x22dd8c);return interaction[_0xe21e('0x26')](_0xe21e('0x27'),_0x22dd8c[_0xe21e('0x28')],_0x22dd8c[_0xe21e('0x29')],_0x117726,_0x591447)[_0xe21e('0x1b')](respondWithFilteredResult(_0x4fdb43,_0x117726))[_0xe21e('0x2a')](handleError(_0x4fdb43,null));};exports[_0xe21e('0x2b')]=function(_0x1087d6,_0x5288f3){var _0x229c07={'raw':![],'where':{'id':_0x1087d6[_0xe21e('0x2c')]['id']}},_0x464415={};_0x464415[_0xe21e('0x2d')]=_[_0xe21e('0x2e')](db[_0xe21e('0x22')][_0xe21e('0x23')]);_0x464415[_0xe21e('0x28')]=_['keys'](_0x1087d6[_0xe21e('0x28')]);_0x464415['filters']=_['intersection'](_0x464415[_0xe21e('0x2d')],_0x464415[_0xe21e('0x28')]);_0x229c07['attributes']=_['intersection'](_0x464415[_0xe21e('0x2d')],qs[_0xe21e('0x2f')](_0x1087d6[_0xe21e('0x28')][_0xe21e('0x2f')]));_0x229c07[_0xe21e('0x30')]=_0x229c07[_0xe21e('0x30')][_0xe21e('0x31')]?_0x229c07['attributes']:_0x464415[_0xe21e('0x2d')];if(_0x1087d6[_0xe21e('0x28')][_0xe21e('0x32')]){_0x229c07[_0xe21e('0x33')]=[{'all':!![]}];}_0x229c07=_[_0xe21e('0x34')]({},_0x229c07,_0x1087d6[_0xe21e('0x35')]);return db[_0xe21e('0x22')][_0xe21e('0x36')](_0x229c07)[_0xe21e('0x1b')](handleEntityNotFound(_0x5288f3,null))['then'](respondWithResult(_0x5288f3,null))[_0xe21e('0x2a')](handleError(_0x5288f3,null));};exports[_0xe21e('0x37')]=function(_0x56a31c,_0x23efe2){return db[_0xe21e('0x22')][_0xe21e('0x37')](_0x56a31c['body'],{})['then'](respondWithResult(_0x23efe2,0xc9))[_0xe21e('0x2a')](handleError(_0x23efe2,null));};exports[_0xe21e('0x1a')]=function(_0x1e568a,_0x1f08ca){if(_0x1e568a[_0xe21e('0x38')]['id']){delete _0x1e568a[_0xe21e('0x38')]['id'];}return db[_0xe21e('0x22')][_0xe21e('0x36')]({'where':{'id':_0x1e568a[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x1f08ca,null))[_0xe21e('0x1b')](saveUpdates(_0x1e568a['body'],null))['then'](respondWithResult(_0x1f08ca,null))['catch'](handleError(_0x1f08ca,null));};exports[_0xe21e('0x39')]=function(_0xabd050,_0x5214a4){return db[_0xe21e('0x22')][_0xe21e('0x36')]({'where':{'id':_0xabd050['params']['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x5214a4,null))[_0xe21e('0x1b')](removeEntity(_0x5214a4,null))[_0xe21e('0x2a')](handleError(_0x5214a4,null));};exports[_0xe21e('0x3a')]=function(_0x1dd64,_0x210b5b){return db[_0xe21e('0x22')][_0xe21e('0x3a')]()[_0xe21e('0x1b')](respondWithResult(_0x210b5b,null))[_0xe21e('0x2a')](handleError(_0x210b5b,null));};exports['addMessage']=function(_0x40d300,_0x43399c){return db[_0xe21e('0x3b')][_0xe21e('0x36')]({'where':{'id':_0x40d300['params']['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x43399c,null))[_0xe21e('0x1b')](function(_0xb4180){if(_0xb4180){return _0xb4180[_0xe21e('0x3c')](_0x40d300[_0xe21e('0x38')][_0xe21e('0x3d')],_[_0xe21e('0x3e')](_0x40d300[_0xe21e('0x38')],['ids','id'])||{});}})[_0xe21e('0x1b')](respondWithResult(_0x43399c,null))[_0xe21e('0x2a')](handleError(_0x43399c,null));};exports[_0xe21e('0x3f')]=function(_0x41d43b,_0x34bdff){var _0x418b48={'raw':![],'where':{}};var _0x46415d={};var _0x9c8d9b={'count':0x0,'rows':[]};return db[_0xe21e('0x22')][_0xe21e('0x40')]({'where':{'id':_0x41d43b[_0xe21e('0x2c')]['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x34bdff,null))[_0xe21e('0x1b')](function(_0x55c8e0){if(_0x55c8e0){_0x46415d[_0xe21e('0x2d')]=_['keys'](db[_0xe21e('0x3b')][_0xe21e('0x23')]);_0x46415d[_0xe21e('0x28')]=_[_0xe21e('0x2e')](_0x41d43b['query']);_0x46415d[_0xe21e('0x41')]=_['intersection'](_0x46415d['model'],_0x46415d[_0xe21e('0x28')]);_0x418b48[_0xe21e('0x30')]=_['intersection'](_0x46415d[_0xe21e('0x2d')],qs['fields'](_0x41d43b['query'][_0xe21e('0x2f')]));_0x418b48[_0xe21e('0x30')]=_0x418b48[_0xe21e('0x30')]['length']?_0x418b48[_0xe21e('0x30')]:_0x46415d[_0xe21e('0x2d')];if(!_0x41d43b[_0xe21e('0x28')]['hasOwnProperty'](_0xe21e('0x42'))){_0x418b48['limit']=qs['limit'](_0x41d43b['query'][_0xe21e('0x16')]);_0x418b48['offset']=qs[_0xe21e('0x15')](_0x41d43b[_0xe21e('0x28')]['offset']);}_0x418b48[_0xe21e('0x43')]=qs[_0xe21e('0x44')](_0x41d43b[_0xe21e('0x28')][_0xe21e('0x44')]);_0x418b48[_0xe21e('0x45')]=qs['filters'](_[_0xe21e('0x46')](_0x41d43b[_0xe21e('0x28')],_0x46415d['filters']));_0x418b48['where'][_0xe21e('0x47')]=_0x55c8e0['id'];if(_0x41d43b[_0xe21e('0x28')][_0xe21e('0x48')]){_0x418b48[_0xe21e('0x45')]=_[_0xe21e('0x34')](_0x418b48[_0xe21e('0x45')],{'$or':_['map'](_0x418b48[_0xe21e('0x30')],function(_0xd079bd){var _0x1f76d2={};_0x1f76d2[_0xd079bd]={'$like':'%'+_0x41d43b[_0xe21e('0x28')][_0xe21e('0x48')]+'%'};return _0x1f76d2;})});}if(_0x41d43b[_0xe21e('0x28')][_0xe21e('0x49')]){var _0x47ab3a=_0x41d43b[_0xe21e('0x28')][_0xe21e('0x49')]['split'](',');var _0xd43e05={};_0xd43e05[_0x47ab3a[0x0]]={'$gte':moment(_0x47ab3a[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x418b48[_0xe21e('0x45')]=_['merge'](_0x418b48[_0xe21e('0x45')],_0xd43e05);}_0x418b48=_[_0xe21e('0x34')]({},_0x418b48,_0x41d43b[_0xe21e('0x35')]);return db[_0xe21e('0x3b')][_0xe21e('0x18')]({'where':_0x418b48[_0xe21e('0x45')]})[_0xe21e('0x1b')](function(_0x12bfa2){_0x9c8d9b[_0xe21e('0x18')]=_0x12bfa2;if(_0x41d43b[_0xe21e('0x28')][_0xe21e('0x32')]){_0x418b48[_0xe21e('0x33')]=[{'all':!![]}];}return db[_0xe21e('0x3b')]['findAll'](_0x418b48);})['then'](function(_0x233202){_0x9c8d9b[_0xe21e('0x4a')]=_0x233202;return _0x9c8d9b;});}})[_0xe21e('0x1b')](respondWithFilteredResult(_0x34bdff,_0x418b48))[_0xe21e('0x2a')](handleError(_0x34bdff,null));};exports[_0xe21e('0x4b')]=function(_0x383b7b,_0x5e6d55){return db[_0xe21e('0x22')][_0xe21e('0x36')]({'where':{'id':_0x383b7b['params']['id']}})['then'](handleEntityNotFound(_0x5e6d55,null))[_0xe21e('0x1b')](function(_0x43daef){if(_0x43daef){return _0x43daef[_0xe21e('0x4c')](_0x383b7b['body']['ids'],_['omit'](_0x383b7b['body'],[_0xe21e('0x3d'),'id'])||{})[_0xe21e('0x4d')](function(){return db[_0xe21e('0x4e')][_0xe21e('0x26')]({'attributes':['id',_0xe21e('0x1e'),_0xe21e('0x4f')],'where':{'id':_0x383b7b[_0xe21e('0x38')]['ids']}});})['then'](function(_0x3a3d69){socket[_0xe21e('0x50')](_0xe21e('0x51'),{'id':Number(_0x383b7b[_0xe21e('0x2c')]['id']),'tags':_0x3a3d69||[]});return{'id':Number(_0x383b7b['params']['id']),'tags':_0x3a3d69||[]};});}})[_0xe21e('0x1b')](respondWithResult(_0x5e6d55,null))['catch'](handleError(_0x5e6d55,null));};exports[_0xe21e('0x52')]=function(_0x1d8073,_0x1d7453){return db['SmsInteraction']['find']({'where':{'id':_0x1d8073['params']['id']}})[_0xe21e('0x1b')](handleEntityNotFound(_0x1d7453,null))[_0xe21e('0x1b')](function(_0xf6fe86){if(_0xf6fe86){return _0xf6fe86['removeTags'](_0x1d8073[_0xe21e('0x28')]['ids']);}})[_0xe21e('0x1b')](respondWithStatusCode(_0x1d7453,null))[_0xe21e('0x2a')](handleError(_0x1d7453,null));};exports[_0xe21e('0x53')]=function(_0x1d2a63,_0x955b44){var _0xdbbe59=moment()['unix']()['toString']();var _0x2ecb4f=path['join'](config[_0xe21e('0x54')],'server','files',_0xe21e('0x55'));var _0x43338b=path[_0xe21e('0x56')](_0x2ecb4f,_0xdbbe59);var _0x63f4b3=util[_0xe21e('0x57')](_0xe21e('0x58'),_0x1d2a63[_0xe21e('0x2c')]['id'],_0xdbbe59);var _0x14b805=path[_0xe21e('0x56')](_0x2ecb4f,_0x63f4b3);var _0x5963f0=[];_0x5963f0[_0xe21e('0x59')]({'model':db[_0xe21e('0x5a')],'as':'User','attributes':['id',_0xe21e('0x5b')],'raw':!![]});_0x5963f0[_0xe21e('0x59')]({'model':db[_0xe21e('0x5c')],'as':_0xe21e('0x5d'),'attributes':['id','firstName',_0xe21e('0x5e')],'raw':!![]});var _0x1659ca=[{'model':db[_0xe21e('0x3b')],'as':'Messages','attributes':['id',_0xe21e('0x38'),'createdAt','direction',_0xe21e('0x5f'),_0xe21e('0x60')],'include':_0x5963f0}];_0x1659ca[_0xe21e('0x59')]({'model':db['SmsAccount'],'as':_0xe21e('0x61'),'attributes':['id',_0xe21e('0x1e')]});_0x1659ca[_0xe21e('0x59')]({'model':db[_0xe21e('0x5a')],'as':'Owner','attributes':['id',_0xe21e('0x5b')]});return db['SmsInteraction'][_0xe21e('0x36')]({'where':{'id':_0x1d2a63[_0xe21e('0x2c')]['id']},'include':_0x1659ca})['then'](handleEntityNotFound(_0x955b44,null))[_0xe21e('0x1b')](function(_0x487e9f){if(_0x487e9f){var _0x402f1f=_0x487e9f['get']({'plain':!![]});fs[_0xe21e('0x62')](_0x43338b);var _0x3ff43c={'channel':_0xe21e('0x63'),'account':_0x402f1f['Account'][_0xe21e('0x1e')],'agent':_0x402f1f['Owner']?_0x402f1f[_0xe21e('0x64')]['fullname']:_0xe21e('0x65'),'createdAt':moment(_0x402f1f['createdAt'])[_0xe21e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe21e('0x66')](),'closedAt':_0x402f1f[_0xe21e('0x67')]?moment(_0x402f1f[_0xe21e('0x68')])[_0xe21e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x402f1f[_0xe21e('0x69')],'messages':_(_0x402f1f[_0xe21e('0x6a')])[_0xe21e('0x48')]({'secret':![]})[_0xe21e('0x21')](function(_0x1fc6b4){return{'date':moment(_0x1fc6b4[_0xe21e('0x6b')])[_0xe21e('0x57')](_0xe21e('0x6c'))[_0xe21e('0x66')](),'sender':_0x1fc6b4[_0xe21e('0x6d')]===_0xe21e('0x6e')?_0x1fc6b4[_0xe21e('0x5a')]?_0x1fc6b4[_0xe21e('0x5a')][_0xe21e('0x5b')]:_0xe21e('0x6f'):_0x1fc6b4['Contact']['firstName']+(_0x1fc6b4['Contact'][_0xe21e('0x5e')]?'\x20'+_0x1fc6b4[_0xe21e('0x5d')][_0xe21e('0x5e')]:''),'body':_0x1fc6b4[_0xe21e('0x38')],'direction':_0x1fc6b4[_0xe21e('0x6d')]===_0xe21e('0x6e')?'A':'C','secret':_0x1fc6b4[_0xe21e('0x5f')],'read':_0x1fc6b4[_0xe21e('0x60')]};})[_0xe21e('0x70')]()};return ejs[_0xe21e('0x71')](path[_0xe21e('0x56')](config['root'],_0xe21e('0x72'),_0xe21e('0x73'),_0xe21e('0x74')),{'interaction':_0x3ff43c})[_0xe21e('0x1b')](function(_0x37d57d){var _0x58d361=path['join'](_0x43338b,_0xe21e('0x75')+_0x402f1f['id']+'-'+_0xdbbe59+_0xe21e('0x76'));var _0x2456c2={'path':_0x58d361,'channel':_0xe21e('0x63'),'interactionId':_0x402f1f['id']};return pdf[_0xe21e('0x77')](_0x37d57d,_0x2456c2);})[_0xe21e('0x1b')](function(){return new BPromise(function(_0x3725ba,_0x4e1ecb){zipdir(_0x43338b,{'saveTo':_0x14b805},function(_0xb91d91,_0x1c46bb){if(_0xb91d91)return _0x4e1ecb(_0xb91d91);return _0x3725ba(_0x1c46bb);});})[_0xe21e('0x1b')](function(){return new BPromise(function(_0x4cc9b7,_0x1195d2){rimraf(_0x43338b,function(_0x42b4ba){if(_0x42b4ba)_0x1195d2(_0x42b4ba);return _0x4cc9b7();});});})[_0xe21e('0x1b')](function(){return _0x955b44[_0xe21e('0x53')](_0x14b805,_0x63f4b3,function(_0x136245){if(_0x136245){console[_0xe21e('0x78')](_0xe21e('0x79'),_0x136245);}else{fs[_0xe21e('0x7a')](_0x14b805);}});});});}else{return _0x955b44['sendStatus'](0xc8);}})[_0xe21e('0x2a')](handleError(_0x955b44,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 1f41c46..c826539 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 _0x02ce=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0xe5c15e,_0x5989c9){var _0x518c37=function(_0x7fcc22){while(--_0x7fcc22){_0xe5c15e['push'](_0xe5c15e['shift']());}};_0x518c37(++_0x5989c9);}(_0x02ce,0x1ac));var _0xe02c=function(_0x4cdab2,_0x59093e){_0x4cdab2=_0x4cdab2-0x0;var _0x52a581=_0x02ce[_0x4cdab2];return _0x52a581;};'use strict';var EventEmitter=require(_0xe02c('0x0'));var SmsInteraction=require(_0xe02c('0x1'))['db'][_0xe02c('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0xe02c('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe02c('0x4'),'afterUpdate':_0xe02c('0x5'),'afterDestroy':_0xe02c('0x6')};function emitEvent(_0xf4b764){return function(_0x41b41c,_0x229653,_0x3f7436){_0x41b41c[_0xe02c('0x7')]({'attributes':['id'],'raw':!![]})[_0xe02c('0x8')](function(_0x4fecb3){_0x41b41c['setDataValue'](_0xe02c('0x9'),_0x4fecb3[_0xe02c('0xa')](function(_0x469932){return{'id':_0x469932['id']};}));return SmsMessage[_0xe02c('0xb')]({'where':{'SmsInteractionId':_0x41b41c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe02c('0x8')](function(_0x18a398){_0x41b41c[_0xe02c('0xc')](_0xe02c('0xd'),_0x18a398[_0xe02c('0xe')]);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764+':'+_0x41b41c['id'],_0x41b41c);SmsInteractionEvents[_0xe02c('0xf')](_0xf4b764,_0x41b41c);_0x3f7436(null);})[_0xe02c('0x10')](_0x3f7436(null));};}for(var e in events){if(events[_0xe02c('0x11')](e)){var event=events[e];SmsInteraction[_0xe02c('0x12')](e,emitEvent(event));}}module[_0xe02c('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0x236c=['length','emit','catch','hasOwnProperty','exports','events','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue','findAll','unreadMessages'];(function(_0x5a4dde,_0x5327fa){var _0x52bfba=function(_0x421c4e){while(--_0x421c4e){_0x5a4dde['push'](_0x5a4dde['shift']());}};_0x52bfba(++_0x5327fa);}(_0x236c,0x155));var _0xc236=function(_0x5f044d,_0xd31e46){_0x5f044d=_0x5f044d-0x0;var _0x4e5f84=_0x236c[_0x5f044d];return _0x4e5f84;};'use strict';var EventEmitter=require(_0xc236('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var SmsMessage=require(_0xc236('0x2'))['db'][_0xc236('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc236('0x4')](0x0);var events={'afterCreate':_0xc236('0x5'),'afterUpdate':'update','afterDestroy':_0xc236('0x6')};function emitEvent(_0x36e87d){return function(_0x33bc57,_0xd582f6,_0x23d3cc){_0x33bc57[_0xc236('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xd612c6){_0x33bc57[_0xc236('0x8')]('Users',_0xd612c6['map'](function(_0x5cdee5){return{'id':_0x5cdee5['id']};}));return SmsMessage[_0xc236('0x9')]({'where':{'SmsInteractionId':_0x33bc57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x30a28d){_0x33bc57[_0xc236('0x8')](_0xc236('0xa'),_0x30a28d[_0xc236('0xb')]);SmsInteractionEvents[_0xc236('0xc')](_0x36e87d+':'+_0x33bc57['id'],_0x33bc57);SmsInteractionEvents['emit'](_0x36e87d,_0x33bc57);_0x23d3cc(null);})[_0xc236('0xd')](_0x23d3cc(null));};}for(var e in events){if(events[_0xc236('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 68673f6..b615a0f 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 _0x3958=['path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise'];(function(_0x45598f,_0x1649ec){var _0x517e2b=function(_0xd0990e){while(--_0xd0990e){_0x45598f['push'](_0x45598f['shift']());}};_0x517e2b(++_0x1649ec);}(_0x3958,0x64));var _0x8395=function(_0x1d5299,_0x599477){_0x1d5299=_0x1d5299-0x0;var _0x3c6a79=_0x3958[_0x1d5299];return _0x3c6a79;};'use strict';var _=require(_0x8395('0x0'));var util=require('util');var logger=require(_0x8395('0x1'))(_0x8395('0x2'));var moment=require(_0x8395('0x3'));var BPromise=require('bluebird');var rp=require(_0x8395('0x4'));var fs=require('fs');var path=require(_0x8395('0x5'));var rimraf=require(_0x8395('0x6'));var config=require(_0x8395('0x7'));var attributes=require(_0x8395('0x8'));module[_0x8395('0x9')]=function(_0xf38428,_0x320720){return _0xf38428['define'](_0x8395('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a082a,_0x2d75a2,_0x35faea){if(_0x2a082a[_0x8395('0xb')](_0x8395('0xc'))){_0x2a082a[_0x8395('0xd')]=moment()['format'](_0x8395('0xe'));}_0x35faea(null,_0x2a082a);}}});}; \ No newline at end of file +var _0x233a=['path','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x19478d,_0x649afe){var _0x44bf69=function(_0x466667){while(--_0x466667){_0x19478d['push'](_0x19478d['shift']());}};_0x44bf69(++_0x649afe);}(_0x233a,0x17a));var _0xa233=function(_0x1ef0ee,_0x2b260a){_0x1ef0ee=_0x1ef0ee-0x0;var _0x1af4e8=_0x233a[_0x1ef0ee];return _0x1af4e8;};'use strict';var _=require(_0xa233('0x0'));var util=require(_0xa233('0x1'));var logger=require(_0xa233('0x2'))('api');var moment=require(_0xa233('0x3'));var BPromise=require(_0xa233('0x4'));var rp=require(_0xa233('0x5'));var fs=require('fs');var path=require(_0xa233('0x6'));var rimraf=require('rimraf');var config=require(_0xa233('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xa233('0x8')]=function(_0x267a5d,_0x4338f8){return _0x267a5d[_0xa233('0x9')](_0xa233('0xa'),attributes,{'tableName':_0xa233('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45be72,_0x5c1677,_0x8cb410){if(_0x45be72[_0xa233('0xc')](_0xa233('0xd'))){_0x45be72[_0xa233('0xe')]=moment()['format'](_0xa233('0xf'));}_0x8cb410(null,_0x45be72);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2f4893a..71dc102 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 _0xe64c=['addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','SmsInteraction','update','body','options','where','attributes','limit','UpdateSmsInteraction','stringify','AddTagsToSmsInteraction','find'];(function(_0x4be3ec,_0x218441){var _0x44b79f=function(_0x56d3c1){while(--_0x56d3c1){_0x4be3ec['push'](_0x4be3ec['shift']());}};_0x44b79f(++_0x218441);}(_0xe64c,0x187));var _0xce64=function(_0x4f7003,_0x39ed50){_0x4f7003=_0x4f7003-0x0;var _0x12597f=_0xe64c[_0x4f7003];return _0x12597f;};'use strict';var _=require(_0xce64('0x0'));var util=require(_0xce64('0x1'));var moment=require(_0xce64('0x2'));var BPromise=require(_0xce64('0x3'));var rs=require(_0xce64('0x4'));var fs=require('fs');var Redis=require(_0xce64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce64('0x6'));var logger=require(_0xce64('0x7'))('rpc');var config=require(_0xce64('0x8'));var jayson=require(_0xce64('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xce64('0xa')]=_[_0xce64('0xb')](config['redis'],{'host':_0xce64('0xc'),'port':0x18eb});var socket=require(_0xce64('0xd'))(new Redis(config[_0xce64('0xa')]));require(_0xce64('0xe'))[_0xce64('0xf')](socket);function respondWithRpcPromise(_0x51689f,_0x19c246,_0x28cd6e){return new BPromise(function(_0x355720,_0x1e13c7){return client[_0xce64('0x10')](_0x51689f,_0x28cd6e)[_0xce64('0x11')](function(_0x443e72){logger[_0xce64('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x19c246,'request\x20sent');logger[_0xce64('0x13')](_0xce64('0x14'),_0x19c246,_0xce64('0x15'),JSON['stringify'](_0x443e72));if(_0x443e72[_0xce64('0x16')]){if(_0x443e72[_0xce64('0x16')][_0xce64('0x17')]===0x1f4){logger['error'](_0xce64('0x18'),_0x19c246,_0x443e72[_0xce64('0x16')][_0xce64('0x19')]);return _0x1e13c7(_0x443e72[_0xce64('0x16')][_0xce64('0x19')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x19c246,_0x443e72[_0xce64('0x16')][_0xce64('0x19')]);return _0x355720(_0x443e72[_0xce64('0x16')][_0xce64('0x19')]);}else{logger[_0xce64('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x19c246,_0xce64('0x15'));_0x355720(_0x443e72[_0xce64('0x1a')][_0xce64('0x19')]);}})[_0xce64('0x1b')](function(_0x3e6a7b){logger[_0xce64('0x16')](_0xce64('0x18'),_0x19c246,_0x3e6a7b);_0x1e13c7(_0x3e6a7b);});});}exports['UpdateSmsInteraction']=function(_0x1de040){var _0x375535=this;return new Promise(function(_0x597c8,_0x1c2598){return db[_0xce64('0x1c')][_0xce64('0x1d')](_0x1de040[_0xce64('0x1e')],{'raw':_0x1de040[_0xce64('0x1f')]?_0x1de040['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1de040['options']?_0x1de040[_0xce64('0x1f')][_0xce64('0x20')]||null:null,'attributes':_0x1de040['options']?_0x1de040['options'][_0xce64('0x21')]||null:null,'limit':_0x1de040[_0xce64('0x1f')]?_0x1de040['options'][_0xce64('0x22')]||null:null})['then'](function(_0x5c7e64){logger['info'](_0xce64('0x23'),_0x1de040);logger[_0xce64('0x13')](_0xce64('0x23'),_0x1de040,JSON[_0xce64('0x24')](_0x5c7e64));_0x597c8(_0x5c7e64);})[_0xce64('0x1b')](function(_0x3491cb){logger[_0xce64('0x16')](_0xce64('0x23'),_0x3491cb['message'],_0x1de040);_0x1c2598(_0x375535[_0xce64('0x16')](0x1f4,_0x3491cb['message']));});});};exports[_0xce64('0x25')]=function(_0x40be12){return new Promise(function(_0x3481f0,_0x3ed14a){return db[_0xce64('0x1c')][_0xce64('0x26')]({'where':_0x40be12[_0xce64('0x1f')]?_0x40be12[_0xce64('0x1f')]['where']||null:null})[_0xce64('0x11')](function(_0x5481eb){if(_0x5481eb){return _0x5481eb[_0xce64('0x27')](_0x40be12[_0xce64('0x1e')][_0xce64('0x28')],_['omit'](_0x40be12[_0xce64('0x1e')],[_0xce64('0x28'),'id'])||{});}})[_0xce64('0x29')](function(_0x2194a2){logger[_0xce64('0x12')]('AddTags',_0x40be12);logger[_0xce64('0x13')](_0xce64('0x2a'),_0x40be12,JSON[_0xce64('0x24')](_0x2194a2));_0x3481f0(_0x2194a2);})[_0xce64('0x1b')](function(_0x19f681){logger[_0xce64('0x16')](_0xce64('0x2a'),_0x19f681[_0xce64('0x19')],_0x40be12);_0x3ed14a(_this[_0xce64('0x16')](0x1f4,_0x19f681['message']));});});}; \ No newline at end of file +var _0x2de5=['client','redis','defaults','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','raw','options','where','limit','find','addTags','body','omit','ids','spread','AddTags','stringify','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x2de5,0x13f));var _0x52de=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x2de5[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0x52de('0x0'));var util=require('util');var moment=require(_0x52de('0x1'));var BPromise=require(_0x52de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52de('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x52de('0x4'));var logger=require(_0x52de('0x5'))(_0x52de('0x6'));var config=require(_0x52de('0x7'));var jayson=require(_0x52de('0x8'));var client=jayson[_0x52de('0x9')]['http']({'port':0x232a});config[_0x52de('0xa')]=_[_0x52de('0xb')](config[_0x52de('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x52de('0xc'))[_0x52de('0xd')](socket);function respondWithRpcPromise(_0x314781,_0x113d8b,_0x3a20cc){return new BPromise(function(_0x1b36e1,_0x46d552){return client[_0x52de('0xe')](_0x314781,_0x3a20cc)[_0x52de('0xf')](function(_0x1fda12){logger[_0x52de('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x113d8b,_0x52de('0x11'));logger[_0x52de('0x12')](_0x52de('0x13'),_0x113d8b,_0x52de('0x11'),JSON['stringify'](_0x1fda12));if(_0x1fda12['error']){if(_0x1fda12[_0x52de('0x14')][_0x52de('0x15')]===0x1f4){logger[_0x52de('0x14')](_0x52de('0x16'),_0x113d8b,_0x1fda12['error'][_0x52de('0x17')]);return _0x46d552(_0x1fda12[_0x52de('0x14')][_0x52de('0x17')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x113d8b,_0x1fda12[_0x52de('0x14')][_0x52de('0x17')]);return _0x1b36e1(_0x1fda12[_0x52de('0x14')][_0x52de('0x17')]);}else{logger[_0x52de('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x113d8b,_0x52de('0x11'));_0x1b36e1(_0x1fda12[_0x52de('0x18')][_0x52de('0x17')]);}})[_0x52de('0x19')](function(_0x25ed90){logger[_0x52de('0x14')](_0x52de('0x16'),_0x113d8b,_0x25ed90);_0x46d552(_0x25ed90);});});}exports[_0x52de('0x1a')]=function(_0x2ea061){var _0x471f4a=this;return new Promise(function(_0x326a11,_0x2d8642){return db[_0x52de('0x1b')][_0x52de('0x1c')](_0x2ea061['body'],{'raw':_0x2ea061['options']?_0x2ea061['options'][_0x52de('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ea061['options']?_0x2ea061[_0x52de('0x1e')][_0x52de('0x1f')]||null:null,'attributes':_0x2ea061['options']?_0x2ea061[_0x52de('0x1e')]['attributes']||null:null,'limit':_0x2ea061[_0x52de('0x1e')]?_0x2ea061[_0x52de('0x1e')][_0x52de('0x20')]||null:null})[_0x52de('0xf')](function(_0x2050c4){logger[_0x52de('0x10')](_0x52de('0x1a'),_0x2ea061);logger['debug'](_0x52de('0x1a'),_0x2ea061,JSON['stringify'](_0x2050c4));_0x326a11(_0x2050c4);})[_0x52de('0x19')](function(_0x3eea8b){logger['error'](_0x52de('0x1a'),_0x3eea8b[_0x52de('0x17')],_0x2ea061);_0x2d8642(_0x471f4a[_0x52de('0x14')](0x1f4,_0x3eea8b[_0x52de('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x3493f3){return new Promise(function(_0x3ddacf,_0x22cd62){return db[_0x52de('0x1b')][_0x52de('0x21')]({'where':_0x3493f3[_0x52de('0x1e')]?_0x3493f3[_0x52de('0x1e')]['where']||null:null})[_0x52de('0xf')](function(_0x38c226){if(_0x38c226){return _0x38c226[_0x52de('0x22')](_0x3493f3[_0x52de('0x23')]['ids'],_[_0x52de('0x24')](_0x3493f3['body'],[_0x52de('0x25'),'id'])||{});}})[_0x52de('0x26')](function(_0x235b1c){logger['info'](_0x52de('0x27'),_0x3493f3);logger['debug'](_0x52de('0x27'),_0x3493f3,JSON[_0x52de('0x28')](_0x235b1c));_0x3ddacf(_0x235b1c);})[_0x52de('0x19')](function(_0x180f24){logger['error'](_0x52de('0x27'),_0x180f24['message'],_0x3493f3);_0x22cd62(_this[_0x52de('0x14')](0x1f4,_0x180f24[_0x52de('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 12e4daf..9602bc2 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 _0x8817=['./smsInteraction.events','remove','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x2db8ec,_0x24a75b){var _0x11fdc7=function(_0x58a9b7){while(--_0x58a9b7){_0x2db8ec['push'](_0x2db8ec['shift']());}};_0x11fdc7(++_0x24a75b);}(_0x8817,0xc0));var _0x7881=function(_0x492156,_0x42ef81){_0x492156=_0x492156-0x0;var _0xbaed83=_0x8817[_0x492156];return _0xbaed83;};'use strict';var SmsInteractionEvents=require(_0x7881('0x0'));var events=['save',_0x7881('0x1'),_0x7881('0x2')];function createListener(_0x262eb7,_0x298a59){return function(_0x48e78d){_0x298a59[_0x7881('0x3')](_0x262eb7,_0x48e78d);};}function removeListener(_0x115341,_0x136739){return function(){SmsInteractionEvents[_0x7881('0x4')](_0x115341,_0x136739);};}exports[_0x7881('0x5')]=function(_0x2d8f3e){for(var _0x31c70f=0x0,_0x36b6fb=events[_0x7881('0x6')];_0x31c70f<_0x36b6fb;_0x31c70f++){var _0x1aa931=events[_0x31c70f];var _0x282a73=createListener(_0x7881('0x7')+_0x1aa931,_0x2d8f3e);SmsInteractionEvents['on'](_0x1aa931,_0x282a73);}}; \ No newline at end of file +var _0x88aa=['removeListener','register','length','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88aa,0x66));var _0xa88a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x88aa[_0x4565bf];return _0x5610ba;};'use strict';var SmsInteractionEvents=require(_0xa88a('0x0'));var events=['save',_0xa88a('0x1'),_0xa88a('0x2')];function createListener(_0x1448d6,_0x3c40f1){return function(_0x33136f){_0x3c40f1['emit'](_0x1448d6,_0x33136f);};}function removeListener(_0x31ce88,_0x2913ff){return function(){SmsInteractionEvents[_0xa88a('0x3')](_0x31ce88,_0x2913ff);};}exports[_0xa88a('0x4')]=function(_0x3a38f4){for(var _0x47732b=0x0,_0x321d49=events[_0xa88a('0x5')];_0x47732b<_0x321d49;_0x47732b++){var _0x1263c4=events[_0x47732b];var _0x47b370=createListener(_0xa88a('0x6')+_0x1263c4,_0x3a38f4);SmsInteractionEvents['on'](_0x1263c4,_0x47b370);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index e2d6d8c..7de29f3 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 _0x5b0f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id','/:id/accept','/:id/reject','reject','destroy','exports','util','connect-timeout'];(function(_0x2b8c77,_0x4d0fb0){var _0x3288a9=function(_0x42ada2){while(--_0x42ada2){_0x2b8c77['push'](_0x2b8c77['shift']());}};_0x3288a9(++_0x4d0fb0);}(_0x5b0f,0xde));var _0xf5b0=function(_0xe1fcfb,_0x24fcee){_0xe1fcfb=_0xe1fcfb-0x0;var _0x21528f=_0x5b0f[_0xe1fcfb];return _0x21528f;};'use strict';var multer=require('multer');var util=require(_0xf5b0('0x0'));var path=require('path');var timeout=require(_0xf5b0('0x1'));var express=require(_0xf5b0('0x2'));var router=express[_0xf5b0('0x3')]();var fs_extra=require(_0xf5b0('0x4'));var auth=require(_0xf5b0('0x5'));var interaction=require(_0xf5b0('0x6'));var config=require(_0xf5b0('0x7'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0xf5b0('0x8')](),controller[_0xf5b0('0x9')]);router[_0xf5b0('0xa')](_0xf5b0('0xb'),auth['isAuthenticated'](),controller[_0xf5b0('0xc')]);router[_0xf5b0('0xa')]('/:id',auth[_0xf5b0('0x8')](),controller[_0xf5b0('0xd')]);router[_0xf5b0('0xe')]('/',auth['isAuthenticated'](),interaction[_0xf5b0('0xf')](_0xf5b0('0x10'),_0xf5b0('0x11')),controller[_0xf5b0('0x12')]);router['post'](_0xf5b0('0x13'),controller[_0xf5b0('0x14')]);router[_0xf5b0('0x15')](_0xf5b0('0x16'),auth[_0xf5b0('0x8')](),controller['update']);router[_0xf5b0('0x15')](_0xf5b0('0x17'),auth[_0xf5b0('0x8')](),controller['accept']);router['put'](_0xf5b0('0x18'),auth[_0xf5b0('0x8')](),controller[_0xf5b0('0x19')]);router['delete'](_0xf5b0('0x16'),auth[_0xf5b0('0x8')](),controller[_0xf5b0('0x1a')]);module[_0xf5b0('0x1b')]=router; \ No newline at end of file +var _0x1ef8=['multer','util','connect-timeout','express','Router','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x2eb74e,_0x5f5b95){var _0x1807ec=function(_0x247e97){while(--_0x247e97){_0x2eb74e['push'](_0x2eb74e['shift']());}};_0x1807ec(++_0x5f5b95);}(_0x1ef8,0xa2));var _0x81ef=function(_0x3a60d8,_0x1e2ea2){_0x3a60d8=_0x3a60d8-0x0;var _0x20cd35=_0x1ef8[_0x3a60d8];return _0x20cd35;};'use strict';var multer=require(_0x81ef('0x0'));var util=require(_0x81ef('0x1'));var path=require('path');var timeout=require(_0x81ef('0x2'));var express=require(_0x81ef('0x3'));var router=express[_0x81ef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x81ef('0x5'));var config=require('../../config/environment');var controller=require(_0x81ef('0x6'));router[_0x81ef('0x7')]('/',auth[_0x81ef('0x8')](),controller[_0x81ef('0x9')]);router['get'](_0x81ef('0xa'),auth[_0x81ef('0x8')](),controller[_0x81ef('0xb')]);router[_0x81ef('0x7')](_0x81ef('0xc'),auth['isAuthenticated'](),controller[_0x81ef('0xd')]);router[_0x81ef('0xe')]('/',auth[_0x81ef('0x8')](),interaction[_0x81ef('0xf')](_0x81ef('0x10'),'smsmessage:create'),controller[_0x81ef('0x11')]);router[_0x81ef('0xe')](_0x81ef('0x12'),controller['status']);router[_0x81ef('0x13')](_0x81ef('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x81ef('0x13')](_0x81ef('0x14'),auth[_0x81ef('0x8')](),controller[_0x81ef('0x15')]);router[_0x81ef('0x13')](_0x81ef('0x16'),auth[_0x81ef('0x8')](),controller[_0x81ef('0x17')]);router[_0x81ef('0x18')]('/:id',auth[_0x81ef('0x8')](),controller[_0x81ef('0x19')]);module[_0x81ef('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 15d1370..85e8625 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 _0xb1ed=['BOOLEAN','TEXT','ENUM','out','STRING','DATE'];(function(_0x3feaf7,_0x5474f8){var _0x548ebf=function(_0x58af2f){while(--_0x58af2f){_0x3feaf7['push'](_0x3feaf7['shift']());}};_0x548ebf(++_0x5474f8);}(_0xb1ed,0x8b));var _0xdb1e=function(_0x56f0b2,_0xdcf225){_0x56f0b2=_0x56f0b2-0x0;var _0x194f36=_0xb1ed[_0x56f0b2];return _0x194f36;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xdb1e('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdb1e('0x1')]('in',_0xdb1e('0x2')),'defaultValue':_0xdb1e('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0xdb1e('0x3')](0xbe)},'phone':{'type':Sequelize[_0xdb1e('0x3')]},'readAt':{'type':Sequelize[_0xdb1e('0x4')]},'secret':{'type':Sequelize[_0xdb1e('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdb1e('0x0')]}}; \ No newline at end of file +var _0xf4b9=['TEXT','BOOLEAN','out','STRING','DATE'];(function(_0x18862b,_0x12a226){var _0x1f0981=function(_0xc6a2e5){while(--_0xc6a2e5){_0x18862b['push'](_0x18862b['shift']());}};_0x1f0981(++_0x12a226);}(_0xf4b9,0x14f));var _0x9f4b=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xf4b9[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x9f4b('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9f4b('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9f4b('0x2')),'defaultValue':_0x9f4b('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9f4b('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x9f4b('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9f4b('0x3')]},'providerResponse':{'type':Sequelize[_0x9f4b('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 61ae9b9..74958e1 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 _0xaf79=['include','rows','show','params','includeAll','create','body','find','destroy','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x6c0603,_0x127f82){var _0x4ca675=function(_0x4643f7){while(--_0x4643f7){_0x6c0603['push'](_0x6c0603['shift']());}};_0x4ca675(++_0x127f82);}(_0xaf79,0xe4));var _0x9af7=function(_0x12c0fe,_0x469071){_0x12c0fe=_0x12c0fe-0x0;var _0x33333f=_0xaf79[_0x12c0fe];return _0x33333f;};'use strict';var emlformat=require(_0x9af7('0x0'));var rimraf=require(_0x9af7('0x1'));var zipdir=require(_0x9af7('0x2'));var jsonpatch=require(_0x9af7('0x3'));var rp=require(_0x9af7('0x4'));var moment=require(_0x9af7('0x5'));var BPromise=require(_0x9af7('0x6'));var Mustache=require(_0x9af7('0x7'));var util=require(_0x9af7('0x8'));var path=require(_0x9af7('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9af7('0xa'));var _=require(_0x9af7('0xb'));var squel=require(_0x9af7('0xc'));var crypto=require(_0x9af7('0xd'));var jsforce=require(_0x9af7('0xe'));var deskjs=require(_0x9af7('0xf'));var toCsv=require(_0x9af7('0x10'));var querystring=require(_0x9af7('0x11'));var Papa=require(_0x9af7('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9af7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9af7('0x14'));var logger=require(_0x9af7('0x15'))(_0x9af7('0x16'));var utils=require(_0x9af7('0x17'));var config=require(_0x9af7('0x18'));var licenseUtil=require(_0x9af7('0x19'));var db=require('../../mysqldb')['db'];config[_0x9af7('0x1a')]=_[_0x9af7('0x1b')](config[_0x9af7('0x1a')],{'host':_0x9af7('0x1c'),'port':0x18eb});var socket=require(_0x9af7('0x1d'))(new Redis(config[_0x9af7('0x1a')]));require(_0x9af7('0x1e'))[_0x9af7('0x1f')](socket);var jayson=require(_0x9af7('0x20'));var client=jayson[_0x9af7('0x21')][_0x9af7('0x22')]({'port':0x232c});var client9002=jayson[_0x9af7('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ff2f5,_0x10d96b,_0x48feb1,_0x372991){return new BPromise(function(_0x1a6312,_0x336625){var _0x4de57f=_0x372991||client;return _0x4de57f[_0x9af7('0x23')](_0x1ff2f5,_0x48feb1)[_0x9af7('0x24')](function(_0xe74d23){logger[_0x9af7('0x25')](_0x9af7('0x26'),_0x10d96b,_0x9af7('0x27'));logger[_0x9af7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x10d96b,'request\x20sent',JSON[_0x9af7('0x29')](_0xe74d23));if(_0xe74d23[_0x9af7('0x2a')]){if(_0xe74d23[_0x9af7('0x2a')][_0x9af7('0x2b')]===0x1f4){logger[_0x9af7('0x2a')](_0x9af7('0x26'),_0x10d96b,_0xe74d23[_0x9af7('0x2a')][_0x9af7('0x2c')]);return _0x336625(_0xe74d23[_0x9af7('0x2a')][_0x9af7('0x2c')]);}logger[_0x9af7('0x2a')](_0x9af7('0x26'),_0x10d96b,_0xe74d23[_0x9af7('0x2a')][_0x9af7('0x2c')]);return _0x1a6312(_0xe74d23[_0x9af7('0x2a')][_0x9af7('0x2c')]);}else{logger[_0x9af7('0x25')]('SmsMessage,\x20%s,\x20%s',_0x10d96b,_0x9af7('0x27'));_0x1a6312(_0xe74d23['result']['message']);}})[_0x9af7('0x2d')](function(_0x1b5b50){logger[_0x9af7('0x2a')]('SmsMessage,\x20%s,\x20%s',_0x10d96b,_0x1b5b50);_0x336625(_0x1b5b50);});});}function respondWithStatusCode(_0x148d09,_0x521260){_0x521260=_0x521260||0xcc;return function(_0x6626bf){if(_0x6626bf){return _0x148d09[_0x9af7('0x2e')](_0x521260);}return _0x148d09['status'](_0x521260)[_0x9af7('0x2f')]();};}function respondWithResult(_0x2a0bc5,_0x7f3c6e){_0x7f3c6e=_0x7f3c6e||0xc8;return function(_0x3201c4){if(_0x3201c4){return _0x2a0bc5[_0x9af7('0x30')](_0x7f3c6e)[_0x9af7('0x31')](_0x3201c4);}};}function respondWithFilteredResult(_0x28f3c1,_0x1fed7e){return function(_0x5c29b9){if(_0x5c29b9){var _0x4fb57f=typeof _0x1fed7e[_0x9af7('0x32')]===_0x9af7('0x33')&&typeof _0x1fed7e[_0x9af7('0x34')]==='undefined';var _0xc5e9de=_0x5c29b9[_0x9af7('0x35')];var _0x881bbe=_0x4fb57f?0x0:_0x1fed7e[_0x9af7('0x32')];var _0x210f8f=_0x4fb57f?_0x5c29b9[_0x9af7('0x35')]:_0x1fed7e['offset']+_0x1fed7e['limit'];var _0x321bc9;if(_0x210f8f>=_0xc5e9de){_0x210f8f=_0xc5e9de;_0x321bc9=0xc8;}else{_0x321bc9=0xce;}_0x28f3c1[_0x9af7('0x30')](_0x321bc9);return _0x28f3c1[_0x9af7('0x36')](_0x9af7('0x37'),_0x881bbe+'-'+_0x210f8f+'/'+_0xc5e9de)[_0x9af7('0x31')](_0x5c29b9);}return null;};}function patchUpdates(_0x4dc32a){return function(_0x516b6c){try{jsonpatch[_0x9af7('0x38')](_0x516b6c,_0x4dc32a,!![]);}catch(_0x27b102){return BPromise[_0x9af7('0x39')](_0x27b102);}return _0x516b6c[_0x9af7('0x3a')]();};}function saveUpdates(_0x6f65c6,_0x37922d){return function(_0x41fd58){if(_0x41fd58){return _0x41fd58[_0x9af7('0x3b')](_0x6f65c6)[_0x9af7('0x24')](function(_0x4f07e2){return _0x4f07e2;});}return null;};}function removeEntity(_0x39a0b7,_0x51434c){return function(_0x11e486){if(_0x11e486){return _0x11e486['destroy']()['then'](function(){_0x39a0b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d80cd,_0xcbb171){return function(_0x557920){if(!_0x557920){_0x5d80cd[_0x9af7('0x2e')](0x194);}return _0x557920;};}function handleError(_0x58e382,_0x5806c7){_0x5806c7=_0x5806c7||0x1f4;return function(_0xc06b27){logger[_0x9af7('0x2a')](_0xc06b27[_0x9af7('0x3c')]);if(_0xc06b27[_0x9af7('0x3d')]){delete _0xc06b27['name'];}_0x58e382[_0x9af7('0x30')](_0x5806c7)[_0x9af7('0x3e')](_0xc06b27);};}exports[_0x9af7('0x3f')]=function(_0xb0debc,_0x3d7079){var _0x30447d={},_0x59630f={},_0x3e076e={'count':0x0,'rows':[]};var _0x511225=_[_0x9af7('0x40')](db[_0x9af7('0x41')][_0x9af7('0x42')],function(_0x20da0b){return{'name':_0x20da0b[_0x9af7('0x43')],'type':_0x20da0b['type'][_0x9af7('0x44')]};});_0x59630f[_0x9af7('0x45')]=_['map'](_0x511225,_0x9af7('0x3d'));_0x59630f[_0x9af7('0x46')]=_[_0x9af7('0x47')](_0xb0debc[_0x9af7('0x46')]);_0x59630f[_0x9af7('0x48')]=_[_0x9af7('0x49')](_0x59630f[_0x9af7('0x45')],_0x59630f[_0x9af7('0x46')]);_0x30447d[_0x9af7('0x4a')]=_[_0x9af7('0x49')](_0x59630f[_0x9af7('0x45')],qs['fields'](_0xb0debc[_0x9af7('0x46')][_0x9af7('0x4b')]));_0x30447d['attributes']=_0x30447d[_0x9af7('0x4a')][_0x9af7('0x4c')]?_0x30447d[_0x9af7('0x4a')]:_0x59630f[_0x9af7('0x45')];if(!_0xb0debc[_0x9af7('0x46')][_0x9af7('0x4d')]('nolimit')){_0x30447d[_0x9af7('0x34')]=qs[_0x9af7('0x34')](_0xb0debc[_0x9af7('0x46')]['limit']);_0x30447d['offset']=qs[_0x9af7('0x32')](_0xb0debc[_0x9af7('0x46')][_0x9af7('0x32')]);}_0x30447d[_0x9af7('0x4e')]=qs[_0x9af7('0x4f')](_0xb0debc[_0x9af7('0x46')][_0x9af7('0x4f')]);_0x30447d[_0x9af7('0x50')]=qs[_0x9af7('0x48')](_['pick'](_0xb0debc[_0x9af7('0x46')],_0x59630f[_0x9af7('0x48')]),_0x511225);if(_0xb0debc[_0x9af7('0x46')][_0x9af7('0x51')]){_0x30447d['where']=_[_0x9af7('0x52')](_0x30447d[_0x9af7('0x50')],{'$or':_[_0x9af7('0x40')](_0x511225,function(_0x453c6e){if(_0x453c6e[_0x9af7('0x53')]!==_0x9af7('0x54')){var _0x5c2e92={};_0x5c2e92[_0x453c6e['name']]={'$like':'%'+_0xb0debc[_0x9af7('0x46')]['filter']+'%'};return _0x5c2e92;}})});}_0x30447d=_[_0x9af7('0x52')]({},_0x30447d,_0xb0debc[_0x9af7('0x55')]);var _0x41f758={'where':_0x30447d[_0x9af7('0x50')]};return db['SmsMessage'][_0x9af7('0x35')](_0x41f758)[_0x9af7('0x24')](function(_0x4d9268){_0x3e076e[_0x9af7('0x35')]=_0x4d9268;if(_0xb0debc['query']['includeAll']){_0x30447d[_0x9af7('0x56')]=[{'all':!![]}];}return db[_0x9af7('0x41')]['findAll'](_0x30447d);})['then'](function(_0x361ca7){_0x3e076e[_0x9af7('0x57')]=_0x361ca7;return _0x3e076e;})[_0x9af7('0x24')](respondWithFilteredResult(_0x3d7079,_0x30447d))['catch'](handleError(_0x3d7079,null));};exports[_0x9af7('0x58')]=function(_0x300f55,_0x5678df){var _0x1ebd1c={'raw':!![],'where':{'id':_0x300f55[_0x9af7('0x59')]['id']}},_0x3e91e2={};_0x3e91e2[_0x9af7('0x45')]=_[_0x9af7('0x47')](db[_0x9af7('0x41')][_0x9af7('0x42')]);_0x3e91e2[_0x9af7('0x46')]=_[_0x9af7('0x47')](_0x300f55[_0x9af7('0x46')]);_0x3e91e2[_0x9af7('0x48')]=_[_0x9af7('0x49')](_0x3e91e2['model'],_0x3e91e2[_0x9af7('0x46')]);_0x1ebd1c[_0x9af7('0x4a')]=_[_0x9af7('0x49')](_0x3e91e2[_0x9af7('0x45')],qs[_0x9af7('0x4b')](_0x300f55[_0x9af7('0x46')]['fields']));_0x1ebd1c[_0x9af7('0x4a')]=_0x1ebd1c[_0x9af7('0x4a')][_0x9af7('0x4c')]?_0x1ebd1c[_0x9af7('0x4a')]:_0x3e91e2['model'];if(_0x300f55[_0x9af7('0x46')][_0x9af7('0x5a')]){_0x1ebd1c[_0x9af7('0x56')]=[{'all':!![]}];}_0x1ebd1c=_['merge']({},_0x1ebd1c,_0x300f55[_0x9af7('0x55')]);return db['SmsMessage']['find'](_0x1ebd1c)[_0x9af7('0x24')](handleEntityNotFound(_0x5678df,null))[_0x9af7('0x24')](respondWithResult(_0x5678df,null))[_0x9af7('0x2d')](handleError(_0x5678df,null));};exports[_0x9af7('0x5b')]=function(_0x352d13,_0x489f6b){return db[_0x9af7('0x41')][_0x9af7('0x5b')](_0x352d13[_0x9af7('0x5c')],{})[_0x9af7('0x24')](respondWithResult(_0x489f6b,0xc9))['catch'](handleError(_0x489f6b,null));};exports[_0x9af7('0x3b')]=function(_0x5506b1,_0x5c94e3){if(_0x5506b1[_0x9af7('0x5c')]['id']){delete _0x5506b1[_0x9af7('0x5c')]['id'];}return db[_0x9af7('0x41')][_0x9af7('0x5d')]({'where':{'id':_0x5506b1[_0x9af7('0x59')]['id']}})[_0x9af7('0x24')](handleEntityNotFound(_0x5c94e3,null))[_0x9af7('0x24')](saveUpdates(_0x5506b1[_0x9af7('0x5c')],null))[_0x9af7('0x24')](respondWithResult(_0x5c94e3,null))[_0x9af7('0x2d')](handleError(_0x5c94e3,null));};exports[_0x9af7('0x5e')]=function(_0x17ccc0,_0x641e59){return db[_0x9af7('0x41')][_0x9af7('0x5d')]({'where':{'id':_0x17ccc0[_0x9af7('0x59')]['id']}})[_0x9af7('0x24')](handleEntityNotFound(_0x641e59,null))[_0x9af7('0x24')](removeEntity(_0x641e59,null))['catch'](handleError(_0x641e59,null));};exports[_0x9af7('0x5f')]=function(_0x4f8add,_0x4add0a){return db[_0x9af7('0x41')][_0x9af7('0x5f')]()[_0x9af7('0x24')](respondWithResult(_0x4add0a,null))['catch'](handleError(_0x4add0a,null));};var interaction_log=require(_0x9af7('0x15'))(_0x9af7('0x60'));exports['accept']=function(_0x4edc28,_0x815543,_0xc78e73){var _0x5cc96b={'agent':{},'channel':_0x9af7('0x61')};if(_0x4edc28[_0x9af7('0x5c')]['id']){delete _0x4edc28[_0x9af7('0x5c')]['id'];}_0x4edc28[_0x9af7('0x5c')][_0x9af7('0x62')]=!![];_0x4edc28['body'][_0x9af7('0x63')]=moment()[_0x9af7('0x64')](_0x9af7('0x65'));_0x4edc28[_0x9af7('0x5c')][_0x9af7('0x66')]=_0x4edc28['body'][_0x9af7('0x66')]||_0x4edc28['user']['id'];_0x5cc96b[_0x9af7('0x67')]['id']=_0x4edc28[_0x9af7('0x5c')]['UserId'];return db['SmsMessage'][_0x9af7('0x5d')]({'where':{'id':_0x4edc28[_0x9af7('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x815543,null))['then'](saveUpdates(_0x4edc28['body'],null))['then'](function(_0x18732c){if(_0x18732c){_0x5cc96b['message']=_0x18732c[_0x9af7('0x68')]({'plain':!![]});return db[_0x9af7('0x69')][_0x9af7('0x5d')]({'where':{'id':_0x18732c[_0x9af7('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x815543,null))[_0x9af7('0x24')](function(_0x12f004){if(_0x12f004){return _0x12f004[_0x9af7('0x3b')]({'UserId':_0x4edc28[_0x9af7('0x5c')][_0x9af7('0x66')],'read1stAt':_[_0x9af7('0x6b')](_0x12f004['read1stAt'])?moment()['format'](_0x9af7('0x65')):undefined});}return null;})['then'](function(_0x55210f){if(_0x55210f){_0x5cc96b[_0x9af7('0x6c')]=_0x55210f[_0x9af7('0x68')]({'plain':!![]});interaction_log[_0x9af7('0x25')](_0x9af7('0x6d'),_0x4edc28[_0x9af7('0x6e')]['id'],_0x4edc28[_0x9af7('0x6e')]['name'],_0x4edc28['user']['role'],_0x5cc96b[_0x9af7('0x6c')]['id'],_0x4edc28['body']?JSON[_0x9af7('0x29')](_0x4edc28['body']):_0x9af7('0x6f'));return respondWithRpcPromise(_0x9af7('0x70'),_0x9af7('0x71'),_0x5cc96b);}return null;})[_0x9af7('0x24')](function(_0x1ad49d){var _0x5c1216='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1ad49d['message'][_0x9af7('0x72')];return db['sequelize'][_0x9af7('0x46')](_0x5c1216,{'type':db['Sequelize'][_0x9af7('0x73')]['SELECT'],'raw':!![]})[_0x9af7('0x24')](function(_0x1ef49f){return _0x1ef49f;});})['then'](function(_0x97bf5f){if(_0x97bf5f){_0x5cc96b[_0x9af7('0x2c')][_0x9af7('0x74')]=_0x97bf5f[0x0];if(!_0x4edc28[_0x9af7('0x5c')][_0x9af7('0x66')])return;return db[_0x9af7('0x75')][_0x9af7('0x5d')]({'where':{'id':_0x4edc28[_0x9af7('0x5c')]['UserId'],'role':_0x9af7('0x67')},'attributes':['id',_0x9af7('0x3d'),_0x9af7('0x76'),_0x9af7('0x77'),_0x9af7('0x78')],'raw':!![]});}return null;})[_0x9af7('0x24')](function(_0x76fbb6){if(!_0x76fbb6)return null;_0x5cc96b[_0x9af7('0x2c')]['agent']=_0x76fbb6;return _0x5cc96b;})[_0x9af7('0x24')](function(_0xd96003){if(_0xd96003){if(_0x4edc28[_0x9af7('0x5c')][_0x9af7('0x79')]){_0x5cc96b[_0x9af7('0x2c')][_0x9af7('0x7a')]=util[_0x9af7('0x64')](_0x9af7('0x7b'),_0x4edc28[_0x9af7('0x6e')][_0x9af7('0x3d')]);_0x5cc96b[_0x9af7('0x2c')]['channel']=_0x5cc96b[_0x9af7('0x7c')];_0x5cc96b[_0x9af7('0x2c')][_0x9af7('0x7d')]=_0x5cc96b['channel'];_0x5cc96b[_0x9af7('0x2c')][_0x9af7('0x7e')]=_0x9af7('0x7f');return respondWithRpcPromise(_0x9af7('0x80'),_0x9af7('0x80'),{'event':_0x9af7('0x81'),'message':_0x5cc96b[_0x9af7('0x2c')]},client9002)[_0x9af7('0x24')](function(){return _0x5cc96b;});}return _0x5cc96b;}return null;})[_0x9af7('0x24')](respondWithResult(_0x815543,null))[_0x9af7('0x2d')](handleError(_0x815543,null));};var interaction_log=require(_0x9af7('0x15'))(_0x9af7('0x60'));exports[_0x9af7('0x39')]=function(_0x3595db,_0x900d27,_0x59790b){var _0x5678da={'agent':{},'channel':'sms'};if(_0x3595db[_0x9af7('0x5c')]['id']){delete _0x3595db['body']['id'];}_0x3595db['body'][_0x9af7('0x66')]=_0x3595db[_0x9af7('0x5c')]['UserId']||_0x3595db[_0x9af7('0x6e')]['id'];_0x5678da['agent']['id']=_0x3595db['body'][_0x9af7('0x66')];return db['SmsMessage'][_0x9af7('0x5d')]({'where':{'id':_0x3595db[_0x9af7('0x59')]['id'],'UserId':null}})[_0x9af7('0x24')](handleEntityNotFound(_0x900d27,null))[_0x9af7('0x24')](function(_0xab2b08){if(_0xab2b08){_0x5678da[_0x9af7('0x2c')]=_0xab2b08[_0x9af7('0x68')]({'plain':!![]});return db[_0x9af7('0x69')][_0x9af7('0x5d')]({'where':{'id':_0xab2b08[_0x9af7('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x900d27,null))[_0x9af7('0x24')](function(_0x227753){if(_0x227753){_0x5678da['interaction']=_0x227753[_0x9af7('0x68')]({'plain':!![]});interaction_log['info'](_0x9af7('0x82'),_0x3595db[_0x9af7('0x6e')]['id'],_0x3595db[_0x9af7('0x6e')][_0x9af7('0x3d')],_0x3595db[_0x9af7('0x6e')][_0x9af7('0x83')],_0x5678da[_0x9af7('0x6c')]['id'],_0x3595db[_0x9af7('0x5c')]?JSON[_0x9af7('0x29')](_0x3595db[_0x9af7('0x5c')]):_0x9af7('0x6f'));return respondWithRpcPromise(_0x9af7('0x84'),_0x9af7('0x85'),_0x5678da);}return null;})[_0x9af7('0x24')](function(_0x7b8658){var _0x91c4b3=_0x9af7('0x86')+_0x7b8658[_0x9af7('0x2c')][_0x9af7('0x72')];return db[_0x9af7('0x87')][_0x9af7('0x46')](_0x91c4b3,{'type':db[_0x9af7('0x88')][_0x9af7('0x73')][_0x9af7('0x89')],'raw':!![]})[_0x9af7('0x24')](function(_0x58574b){return _0x58574b;});})[_0x9af7('0x24')](function(_0x2bc9c1){if(_0x2bc9c1){_0x5678da['message'][_0x9af7('0x74')]=_0x2bc9c1[0x0];if(!_0x3595db[_0x9af7('0x5c')][_0x9af7('0x66')])return;return db[_0x9af7('0x75')][_0x9af7('0x5d')]({'where':{'id':_0x3595db[_0x9af7('0x5c')]['UserId'],'role':'agent'},'attributes':['id',_0x9af7('0x3d'),_0x9af7('0x76'),'email',_0x9af7('0x78')],'raw':!![]});}return null;})[_0x9af7('0x24')](function(_0x5d3bbb){if(!_0x5d3bbb)return null;_0x5678da[_0x9af7('0x2c')]['agent']=_0x5d3bbb;return _0x5678da;})[_0x9af7('0x24')](function(_0x4725c1){if(_0x4725c1){_0x4725c1['message']['interface']=util[_0x9af7('0x64')](_0x9af7('0x7b'),_0x3595db[_0x9af7('0x6e')]['name']);_0x4725c1[_0x9af7('0x2c')][_0x9af7('0x7c')]=_0x5678da[_0x9af7('0x7c')];_0x4725c1[_0x9af7('0x2c')][_0x9af7('0x7d')]=_0x5678da[_0x9af7('0x7c')];_0x4725c1[_0x9af7('0x2c')][_0x9af7('0x7e')]=_0x9af7('0x39');respondWithRpcPromise(_0x9af7('0x80'),_0x9af7('0x80'),{'event':'rejectmessage','message':_0x4725c1[_0x9af7('0x2c')]},client9002);return _0x5678da;}return null;})[_0x9af7('0x24')](respondWithResult(_0x900d27,null))[_0x9af7('0x2d')](handleError(_0x900d27,null));};exports[_0x9af7('0x30')]=function(_0x1c4be4,_0x150eea,_0x151405){if(_0x1c4be4['body']['id']){delete _0x1c4be4[_0x9af7('0x5c')]['id'];}var _0x6c1d27;return db[_0x9af7('0x41')][_0x9af7('0x5d')]({'where':{'id':_0x1c4be4[_0x9af7('0x59')]['id']}})[_0x9af7('0x24')](handleEntityNotFound(_0x150eea,null))[_0x9af7('0x24')](function(_0x1c0f74){if(_0x1c0f74){_0x6c1d27=_0x1c0f74;return db[_0x9af7('0x8a')]['find']({'where':{'id':_0x1c0f74[_0x9af7('0x8b')]}});}})[_0x9af7('0x24')](handleEntityNotFound(_0x150eea,null))[_0x9af7('0x24')](function(_0x25b7f1){if(_0x25b7f1){logger[_0x9af7('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9af7('0x30'),_0x9af7('0x8c'),_0x25b7f1[_0x9af7('0x53')],util[_0x9af7('0x8d')](_0x1c4be4[_0x9af7('0x5c')],{'showHidden':![],'depth':null}));switch(_0x25b7f1[_0x9af7('0x53')]){case _0x9af7('0x8e'):if(_0x1c4be4['body'][_0x9af7('0x8f')]&&_0x1c4be4[_0x9af7('0x5c')]['MessageSid']===_0x6c1d27[_0x9af7('0x90')]){return _0x6c1d27[_0x9af7('0x3b')]({'read':!![]});}else{logger[_0x9af7('0x2a')](_0x9af7('0x91'),_0x9af7('0x30'),_0x9af7('0x8e'),util[_0x9af7('0x8d')](_0x1c4be4[_0x9af7('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x9af7('0x92'):if(_0x1c4be4[_0x9af7('0x5c')][_0x9af7('0x93')]&&_0x1c4be4[_0x9af7('0x5c')][_0x9af7('0x93')]===_0x6c1d27['messageId']&&_[_0x9af7('0x94')]([_0x9af7('0x95'),_0x9af7('0x96')],_0x1c4be4['body'][_0x9af7('0x97')])>=0x0){return _0x6c1d27[_0x9af7('0x3b')]({'read':!![]});}else{logger['error'](_0x9af7('0x91'),'status',_0x9af7('0x98'),util['inspect'](_0x1c4be4[_0x9af7('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x9af7('0x99'):var _0xcf6b04=_0x1c4be4[_0x9af7('0x5c')][_0x9af7('0x9a')][0x0];if(_0xcf6b04[_0x9af7('0x30')][_0x9af7('0x9b')]===_0x9af7('0x9c')){return _0x6c1d27[_0x9af7('0x3b')]({'read':!![]});}else{logger[_0x9af7('0x2a')](_0x9af7('0x91'),_0x9af7('0x30'),_0x9af7('0x99'),util[_0x9af7('0x8d')](_0x1c4be4[_0x9af7('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x6c1d27;}})[_0x9af7('0x24')](respondWithResult(_0x150eea,null))[_0x9af7('0x2d')](handleError(_0x150eea,null));}; \ No newline at end of file +var _0x8aad=['acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','Sequelize','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','MessageSid','twilio','plivo','MessageUUID','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','eml-format','rimraf','fast-json-patch','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','VIRTUAL','filter','options','includeAll','SmsMessage','findAll','rows','show','params','include','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager'];(function(_0x300a4d,_0x30dd6f){var _0x291ef5=function(_0x287fcf){while(--_0x287fcf){_0x300a4d['push'](_0x300a4d['shift']());}};_0x291ef5(++_0x30dd6f);}(_0x8aad,0x146));var _0xd8aa=function(_0x17cc1d,_0x83d64b){_0x17cc1d=_0x17cc1d-0x0;var _0x239435=_0x8aad[_0x17cc1d];return _0x239435;};'use strict';var emlformat=require(_0xd8aa('0x0'));var rimraf=require(_0xd8aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8aa('0x2'));var rp=require('request-promise');var moment=require(_0xd8aa('0x3'));var BPromise=require(_0xd8aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd8aa('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd8aa('0x6'));var fs=require('fs');var fs_extra=require(_0xd8aa('0x7'));var _=require(_0xd8aa('0x8'));var squel=require('squel');var crypto=require(_0xd8aa('0x9'));var jsforce=require(_0xd8aa('0xa'));var deskjs=require(_0xd8aa('0xb'));var toCsv=require(_0xd8aa('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd8aa('0xd'));var authService=require(_0xd8aa('0xe'));var qs=require(_0xd8aa('0xf'));var as=require(_0xd8aa('0x10'));var hardwareService=require(_0xd8aa('0x11'));var logger=require('../../config/logger')(_0xd8aa('0x12'));var utils=require(_0xd8aa('0x13'));var config=require(_0xd8aa('0x14'));var licenseUtil=require(_0xd8aa('0x15'));var db=require(_0xd8aa('0x16'))['db'];config[_0xd8aa('0x17')]=_[_0xd8aa('0x18')](config[_0xd8aa('0x17')],{'host':_0xd8aa('0x19'),'port':0x18eb});var socket=require(_0xd8aa('0x1a'))(new Redis(config['redis']));require('./smsMessage.socket')[_0xd8aa('0x1b')](socket);var jayson=require(_0xd8aa('0x1c'));var client=jayson[_0xd8aa('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xd8aa('0x1d')][_0xd8aa('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x39b5bc,_0x404ed6,_0x47a0e3,_0x476930){return new BPromise(function(_0xa9ba1b,_0x5652b7){var _0x16d5c6=_0x476930||client;return _0x16d5c6[_0xd8aa('0x1f')](_0x39b5bc,_0x47a0e3)[_0xd8aa('0x20')](function(_0x3a29ca){logger[_0xd8aa('0x21')]('SmsMessage,\x20%s,\x20%s',_0x404ed6,_0xd8aa('0x22'));logger[_0xd8aa('0x23')](_0xd8aa('0x24'),_0x404ed6,_0xd8aa('0x22'),JSON['stringify'](_0x3a29ca));if(_0x3a29ca[_0xd8aa('0x25')]){if(_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x26')]===0x1f4){logger[_0xd8aa('0x25')](_0xd8aa('0x27'),_0x404ed6,_0x3a29ca['error'][_0xd8aa('0x28')]);return _0x5652b7(_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x28')]);}logger['error'](_0xd8aa('0x27'),_0x404ed6,_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x28')]);return _0xa9ba1b(_0x3a29ca[_0xd8aa('0x25')][_0xd8aa('0x28')]);}else{logger[_0xd8aa('0x21')](_0xd8aa('0x27'),_0x404ed6,_0xd8aa('0x22'));_0xa9ba1b(_0x3a29ca[_0xd8aa('0x29')][_0xd8aa('0x28')]);}})[_0xd8aa('0x2a')](function(_0x370d6f){logger[_0xd8aa('0x25')]('SmsMessage,\x20%s,\x20%s',_0x404ed6,_0x370d6f);_0x5652b7(_0x370d6f);});});}function respondWithStatusCode(_0x1f066a,_0x59eb3f){_0x59eb3f=_0x59eb3f||0xcc;return function(_0xd4d204){if(_0xd4d204){return _0x1f066a[_0xd8aa('0x2b')](_0x59eb3f);}return _0x1f066a[_0xd8aa('0x2c')](_0x59eb3f)[_0xd8aa('0x2d')]();};}function respondWithResult(_0x26ab06,_0x19edee){_0x19edee=_0x19edee||0xc8;return function(_0x3bba1d){if(_0x3bba1d){return _0x26ab06[_0xd8aa('0x2c')](_0x19edee)['json'](_0x3bba1d);}};}function respondWithFilteredResult(_0x1f2a28,_0x34b792){return function(_0x214393){if(_0x214393){var _0x49a7c8=typeof _0x34b792[_0xd8aa('0x2e')]==='undefined'&&typeof _0x34b792[_0xd8aa('0x2f')]===_0xd8aa('0x30');var _0x37902c=_0x214393[_0xd8aa('0x31')];var _0x44f783=_0x49a7c8?0x0:_0x34b792[_0xd8aa('0x2e')];var _0xd8d3b3=_0x49a7c8?_0x214393[_0xd8aa('0x31')]:_0x34b792['offset']+_0x34b792[_0xd8aa('0x2f')];var _0x1c6fe6;if(_0xd8d3b3>=_0x37902c){_0xd8d3b3=_0x37902c;_0x1c6fe6=0xc8;}else{_0x1c6fe6=0xce;}_0x1f2a28[_0xd8aa('0x2c')](_0x1c6fe6);return _0x1f2a28[_0xd8aa('0x32')](_0xd8aa('0x33'),_0x44f783+'-'+_0xd8d3b3+'/'+_0x37902c)[_0xd8aa('0x34')](_0x214393);}return null;};}function patchUpdates(_0x271230){return function(_0x3133fb){try{jsonpatch['apply'](_0x3133fb,_0x271230,!![]);}catch(_0x265217){return BPromise[_0xd8aa('0x35')](_0x265217);}return _0x3133fb[_0xd8aa('0x36')]();};}function saveUpdates(_0x511b4a,_0x1d16d6){return function(_0x3c8941){if(_0x3c8941){return _0x3c8941[_0xd8aa('0x37')](_0x511b4a)[_0xd8aa('0x20')](function(_0x249564){return _0x249564;});}return null;};}function removeEntity(_0x25672a,_0x400bdf){return function(_0x3bb8e4){if(_0x3bb8e4){return _0x3bb8e4[_0xd8aa('0x38')]()['then'](function(){_0x25672a[_0xd8aa('0x2c')](0xcc)[_0xd8aa('0x2d')]();});}};}function handleEntityNotFound(_0x41cd24,_0x221f41){return function(_0x3e23fd){if(!_0x3e23fd){_0x41cd24[_0xd8aa('0x2b')](0x194);}return _0x3e23fd;};}function handleError(_0xd0bc2b,_0x30b0c4){_0x30b0c4=_0x30b0c4||0x1f4;return function(_0xb8bfe6){logger['error'](_0xb8bfe6[_0xd8aa('0x39')]);if(_0xb8bfe6['name']){delete _0xb8bfe6[_0xd8aa('0x3a')];}_0xd0bc2b[_0xd8aa('0x2c')](_0x30b0c4)['send'](_0xb8bfe6);};}exports[_0xd8aa('0x3b')]=function(_0x1a4f2c,_0xb503cc){var _0x18da91={},_0x7cd3a9={},_0x567b24={'count':0x0,'rows':[]};var _0x56ab19=_[_0xd8aa('0x3c')](db['SmsMessage'][_0xd8aa('0x3d')],function(_0x7a6df2){return{'name':_0x7a6df2[_0xd8aa('0x3e')],'type':_0x7a6df2[_0xd8aa('0x3f')][_0xd8aa('0x40')]};});_0x7cd3a9[_0xd8aa('0x41')]=_[_0xd8aa('0x3c')](_0x56ab19,_0xd8aa('0x3a'));_0x7cd3a9[_0xd8aa('0x42')]=_[_0xd8aa('0x43')](_0x1a4f2c[_0xd8aa('0x42')]);_0x7cd3a9['filters']=_[_0xd8aa('0x44')](_0x7cd3a9[_0xd8aa('0x41')],_0x7cd3a9[_0xd8aa('0x42')]);_0x18da91['attributes']=_[_0xd8aa('0x44')](_0x7cd3a9[_0xd8aa('0x41')],qs[_0xd8aa('0x45')](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x45')]));_0x18da91[_0xd8aa('0x46')]=_0x18da91[_0xd8aa('0x46')][_0xd8aa('0x47')]?_0x18da91[_0xd8aa('0x46')]:_0x7cd3a9[_0xd8aa('0x41')];if(!_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x48')](_0xd8aa('0x49'))){_0x18da91[_0xd8aa('0x2f')]=qs[_0xd8aa('0x2f')](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x2f')]);_0x18da91[_0xd8aa('0x2e')]=qs['offset'](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x2e')]);}_0x18da91[_0xd8aa('0x4a')]=qs[_0xd8aa('0x4b')](_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x4b')]);_0x18da91['where']=qs[_0xd8aa('0x4c')](_['pick'](_0x1a4f2c[_0xd8aa('0x42')],_0x7cd3a9['filters']),_0x56ab19);if(_0x1a4f2c[_0xd8aa('0x42')]['filter']){_0x18da91['where']=_[_0xd8aa('0x4d')](_0x18da91[_0xd8aa('0x4e')],{'$or':_[_0xd8aa('0x3c')](_0x56ab19,function(_0xfa6cbf){if(_0xfa6cbf[_0xd8aa('0x3f')]!==_0xd8aa('0x4f')){var _0x4c7eec={};_0x4c7eec[_0xfa6cbf[_0xd8aa('0x3a')]]={'$like':'%'+_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x50')]+'%'};return _0x4c7eec;}})});}_0x18da91=_[_0xd8aa('0x4d')]({},_0x18da91,_0x1a4f2c[_0xd8aa('0x51')]);var _0x581f57={'where':_0x18da91['where']};return db['SmsMessage'][_0xd8aa('0x31')](_0x581f57)[_0xd8aa('0x20')](function(_0x131012){_0x567b24[_0xd8aa('0x31')]=_0x131012;if(_0x1a4f2c[_0xd8aa('0x42')][_0xd8aa('0x52')]){_0x18da91['include']=[{'all':!![]}];}return db[_0xd8aa('0x53')][_0xd8aa('0x54')](_0x18da91);})['then'](function(_0x2ad21f){_0x567b24[_0xd8aa('0x55')]=_0x2ad21f;return _0x567b24;})[_0xd8aa('0x20')](respondWithFilteredResult(_0xb503cc,_0x18da91))['catch'](handleError(_0xb503cc,null));};exports[_0xd8aa('0x56')]=function(_0x625df9,_0x3b93b1){var _0x1f3ed6={'raw':!![],'where':{'id':_0x625df9[_0xd8aa('0x57')]['id']}},_0x1c6a21={};_0x1c6a21['model']=_['keys'](db[_0xd8aa('0x53')][_0xd8aa('0x3d')]);_0x1c6a21[_0xd8aa('0x42')]=_[_0xd8aa('0x43')](_0x625df9[_0xd8aa('0x42')]);_0x1c6a21[_0xd8aa('0x4c')]=_[_0xd8aa('0x44')](_0x1c6a21['model'],_0x1c6a21[_0xd8aa('0x42')]);_0x1f3ed6[_0xd8aa('0x46')]=_['intersection'](_0x1c6a21[_0xd8aa('0x41')],qs['fields'](_0x625df9[_0xd8aa('0x42')][_0xd8aa('0x45')]));_0x1f3ed6[_0xd8aa('0x46')]=_0x1f3ed6['attributes']['length']?_0x1f3ed6['attributes']:_0x1c6a21['model'];if(_0x625df9[_0xd8aa('0x42')][_0xd8aa('0x52')]){_0x1f3ed6[_0xd8aa('0x58')]=[{'all':!![]}];}_0x1f3ed6=_['merge']({},_0x1f3ed6,_0x625df9['options']);return db['SmsMessage'][_0xd8aa('0x59')](_0x1f3ed6)[_0xd8aa('0x20')](handleEntityNotFound(_0x3b93b1,null))[_0xd8aa('0x20')](respondWithResult(_0x3b93b1,null))[_0xd8aa('0x2a')](handleError(_0x3b93b1,null));};exports[_0xd8aa('0x5a')]=function(_0x19e97d,_0x1d7d7d){return db[_0xd8aa('0x53')][_0xd8aa('0x5a')](_0x19e97d[_0xd8aa('0x5b')],{})[_0xd8aa('0x20')](respondWithResult(_0x1d7d7d,0xc9))[_0xd8aa('0x2a')](handleError(_0x1d7d7d,null));};exports[_0xd8aa('0x37')]=function(_0x5da09b,_0x56f4b0){if(_0x5da09b[_0xd8aa('0x5b')]['id']){delete _0x5da09b[_0xd8aa('0x5b')]['id'];}return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x5da09b['params']['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x56f4b0,null))[_0xd8aa('0x20')](saveUpdates(_0x5da09b['body'],null))['then'](respondWithResult(_0x56f4b0,null))[_0xd8aa('0x2a')](handleError(_0x56f4b0,null));};exports[_0xd8aa('0x38')]=function(_0x157b97,_0x410436){return db['SmsMessage']['find']({'where':{'id':_0x157b97[_0xd8aa('0x57')]['id']}})['then'](handleEntityNotFound(_0x410436,null))[_0xd8aa('0x20')](removeEntity(_0x410436,null))[_0xd8aa('0x2a')](handleError(_0x410436,null));};exports[_0xd8aa('0x5c')]=function(_0x2d41c9,_0x158eee){return db[_0xd8aa('0x53')]['describe']()[_0xd8aa('0x20')](respondWithResult(_0x158eee,null))[_0xd8aa('0x2a')](handleError(_0x158eee,null));};var interaction_log=require(_0xd8aa('0x5d'))(_0xd8aa('0x5e'));exports[_0xd8aa('0x5f')]=function(_0x170954,_0x3368ce,_0x33706c){var _0x3fba51={'agent':{},'channel':_0xd8aa('0x60')};if(_0x170954[_0xd8aa('0x5b')]['id']){delete _0x170954[_0xd8aa('0x5b')]['id'];}_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x61')]=!![];_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x62')]=moment()[_0xd8aa('0x63')](_0xd8aa('0x64'));_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x65')]=_0x170954[_0xd8aa('0x5b')]['UserId']||_0x170954['user']['id'];_0x3fba51['agent']['id']=_0x170954[_0xd8aa('0x5b')]['UserId'];return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x170954[_0xd8aa('0x57')]['id'],'UserId':null}})[_0xd8aa('0x20')](handleEntityNotFound(_0x3368ce,null))[_0xd8aa('0x20')](saveUpdates(_0x170954[_0xd8aa('0x5b')],null))[_0xd8aa('0x20')](function(_0x26bf3f){if(_0x26bf3f){_0x3fba51[_0xd8aa('0x28')]=_0x26bf3f[_0xd8aa('0x66')]({'plain':!![]});return db[_0xd8aa('0x67')]['find']({'where':{'id':_0x26bf3f['SmsInteractionId']}});}return null;})[_0xd8aa('0x20')](handleEntityNotFound(_0x3368ce,null))['then'](function(_0x384f5d){if(_0x384f5d){return _0x384f5d['update']({'UserId':_0x170954['body'][_0xd8aa('0x65')],'read1stAt':_[_0xd8aa('0x68')](_0x384f5d[_0xd8aa('0x69')])?moment()[_0xd8aa('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd8aa('0x20')](function(_0x332179){if(_0x332179){_0x3fba51[_0xd8aa('0x6a')]=_0x332179[_0xd8aa('0x66')]({'plain':!![]});interaction_log[_0xd8aa('0x21')](_0xd8aa('0x6b'),_0x170954[_0xd8aa('0x6c')]['id'],_0x170954[_0xd8aa('0x6c')][_0xd8aa('0x3a')],_0x170954[_0xd8aa('0x6c')]['role'],_0x3fba51[_0xd8aa('0x6a')]['id'],_0x170954[_0xd8aa('0x5b')]?JSON[_0xd8aa('0x6d')](_0x170954['body']):'null');return respondWithRpcPromise(_0xd8aa('0x6e'),_0xd8aa('0x6f'),_0x3fba51);}return null;})['then'](function(_0x2c869e){var _0x36c155=_0xd8aa('0x70')+_0x2c869e[_0xd8aa('0x28')][_0xd8aa('0x71')];return db[_0xd8aa('0x72')][_0xd8aa('0x42')](_0x36c155,{'type':db['Sequelize'][_0xd8aa('0x73')][_0xd8aa('0x74')],'raw':!![]})[_0xd8aa('0x20')](function(_0x1fac92){return _0x1fac92;});})[_0xd8aa('0x20')](function(_0x3ede08){if(_0x3ede08){_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x75')]=_0x3ede08[0x0];if(!_0x170954['body'][_0xd8aa('0x65')])return;return db[_0xd8aa('0x76')][_0xd8aa('0x59')]({'where':{'id':_0x170954['body'][_0xd8aa('0x65')],'role':_0xd8aa('0x77')},'attributes':['id',_0xd8aa('0x3a'),_0xd8aa('0x78'),_0xd8aa('0x79'),_0xd8aa('0x7a')],'raw':!![]});}return null;})[_0xd8aa('0x20')](function(_0x2c6083){if(!_0x2c6083)return null;_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x77')]=_0x2c6083;return _0x3fba51;})[_0xd8aa('0x20')](function(_0x373194){if(_0x373194){if(_0x170954[_0xd8aa('0x5b')][_0xd8aa('0x7b')]){_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x7c')]=util[_0xd8aa('0x63')](_0xd8aa('0x7d'),_0x170954['user'][_0xd8aa('0x3a')]);_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x7e')]=_0x3fba51[_0xd8aa('0x7e')];_0x3fba51['message'][_0xd8aa('0x7f')]=_0x3fba51[_0xd8aa('0x7e')];_0x3fba51[_0xd8aa('0x28')][_0xd8aa('0x80')]='accept';return respondWithRpcPromise(_0xd8aa('0x81'),'EventManager',{'event':_0xd8aa('0x82'),'message':_0x3fba51[_0xd8aa('0x28')]},client9002)[_0xd8aa('0x20')](function(){return _0x3fba51;});}return _0x3fba51;}return null;})[_0xd8aa('0x20')](respondWithResult(_0x3368ce,null))[_0xd8aa('0x2a')](handleError(_0x3368ce,null));};var interaction_log=require(_0xd8aa('0x5d'))(_0xd8aa('0x5e'));exports['reject']=function(_0x512c32,_0x2b2222,_0x4299c4){var _0xbcc774={'agent':{},'channel':'sms'};if(_0x512c32[_0xd8aa('0x5b')]['id']){delete _0x512c32[_0xd8aa('0x5b')]['id'];}_0x512c32[_0xd8aa('0x5b')][_0xd8aa('0x65')]=_0x512c32[_0xd8aa('0x5b')]['UserId']||_0x512c32['user']['id'];_0xbcc774[_0xd8aa('0x77')]['id']=_0x512c32['body'][_0xd8aa('0x65')];return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x512c32[_0xd8aa('0x57')]['id'],'UserId':null}})[_0xd8aa('0x20')](handleEntityNotFound(_0x2b2222,null))[_0xd8aa('0x20')](function(_0x49d5ab){if(_0x49d5ab){_0xbcc774[_0xd8aa('0x28')]=_0x49d5ab[_0xd8aa('0x66')]({'plain':!![]});return db[_0xd8aa('0x67')]['find']({'where':{'id':_0x49d5ab['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2b2222,null))['then'](function(_0x38e8d3){if(_0x38e8d3){_0xbcc774[_0xd8aa('0x6a')]=_0x38e8d3['get']({'plain':!![]});interaction_log['info'](_0xd8aa('0x83'),_0x512c32[_0xd8aa('0x6c')]['id'],_0x512c32['user']['name'],_0x512c32[_0xd8aa('0x6c')][_0xd8aa('0x84')],_0xbcc774[_0xd8aa('0x6a')]['id'],_0x512c32['body']?JSON['stringify'](_0x512c32[_0xd8aa('0x5b')]):_0xd8aa('0x85'));return respondWithRpcPromise(_0xd8aa('0x86'),_0xd8aa('0x87'),_0xbcc774);}return null;})[_0xd8aa('0x20')](function(_0x41d5a9){var _0x3f7a70=_0xd8aa('0x70')+_0x41d5a9[_0xd8aa('0x28')][_0xd8aa('0x71')];return db[_0xd8aa('0x72')][_0xd8aa('0x42')](_0x3f7a70,{'type':db[_0xd8aa('0x88')][_0xd8aa('0x73')][_0xd8aa('0x74')],'raw':!![]})[_0xd8aa('0x20')](function(_0x522d5c){return _0x522d5c;});})[_0xd8aa('0x20')](function(_0x3f4aff){if(_0x3f4aff){_0xbcc774['message'][_0xd8aa('0x75')]=_0x3f4aff[0x0];if(!_0x512c32[_0xd8aa('0x5b')][_0xd8aa('0x65')])return;return db[_0xd8aa('0x76')][_0xd8aa('0x59')]({'where':{'id':_0x512c32['body'][_0xd8aa('0x65')],'role':_0xd8aa('0x77')},'attributes':['id','name',_0xd8aa('0x78'),_0xd8aa('0x79'),'internal'],'raw':!![]});}return null;})[_0xd8aa('0x20')](function(_0x2b95de){if(!_0x2b95de)return null;_0xbcc774[_0xd8aa('0x28')][_0xd8aa('0x77')]=_0x2b95de;return _0xbcc774;})[_0xd8aa('0x20')](function(_0x2bfbaa){if(_0x2bfbaa){_0x2bfbaa['message'][_0xd8aa('0x7c')]=util[_0xd8aa('0x63')](_0xd8aa('0x7d'),_0x512c32[_0xd8aa('0x6c')][_0xd8aa('0x3a')]);_0x2bfbaa['message'][_0xd8aa('0x7e')]=_0xbcc774['channel'];_0x2bfbaa[_0xd8aa('0x28')][_0xd8aa('0x7f')]=_0xbcc774[_0xd8aa('0x7e')];_0x2bfbaa[_0xd8aa('0x28')]['event']=_0xd8aa('0x35');respondWithRpcPromise(_0xd8aa('0x81'),_0xd8aa('0x81'),{'event':_0xd8aa('0x89'),'message':_0x2bfbaa['message']},client9002);return _0xbcc774;}return null;})[_0xd8aa('0x20')](respondWithResult(_0x2b2222,null))[_0xd8aa('0x2a')](handleError(_0x2b2222,null));};exports[_0xd8aa('0x2c')]=function(_0x36d479,_0x3cfcb9,_0x5e4bca){if(_0x36d479['body']['id']){delete _0x36d479[_0xd8aa('0x5b')]['id'];}var _0x28052a;return db[_0xd8aa('0x53')][_0xd8aa('0x59')]({'where':{'id':_0x36d479[_0xd8aa('0x57')]['id']}})[_0xd8aa('0x20')](handleEntityNotFound(_0x3cfcb9,null))[_0xd8aa('0x20')](function(_0x553fa6){if(_0x553fa6){_0x28052a=_0x553fa6;return db[_0xd8aa('0x8a')][_0xd8aa('0x59')]({'where':{'id':_0x553fa6['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x3cfcb9,null))[_0xd8aa('0x20')](function(_0x53035e){if(_0x53035e){logger[_0xd8aa('0x23')](_0xd8aa('0x24'),_0xd8aa('0x2c'),_0xd8aa('0x8b'),_0x53035e[_0xd8aa('0x3f')],util[_0xd8aa('0x8c')](_0x36d479['body'],{'showHidden':![],'depth':null}));switch(_0x53035e['type']){case'twilio':if(_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x8d')]&&_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x8d')]===_0x28052a['messageId']){return _0x28052a[_0xd8aa('0x37')]({'read':!![]});}else{logger[_0xd8aa('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd8aa('0x2c'),_0xd8aa('0x8e'),util[_0xd8aa('0x8c')](_0x36d479[_0xd8aa('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd8aa('0x8f'):if(_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x90')]&&_0x36d479['body'][_0xd8aa('0x90')]===_0x28052a['messageId']&&_[_0xd8aa('0x91')]([_0xd8aa('0x92'),'delivered'],_0x36d479[_0xd8aa('0x5b')][_0xd8aa('0x93')])>=0x0){return _0x28052a[_0xd8aa('0x37')]({'read':!![]});}else{logger[_0xd8aa('0x25')](_0xd8aa('0x94'),_0xd8aa('0x2c'),_0xd8aa('0x95'),util['inspect'](_0x36d479[_0xd8aa('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd8aa('0x96'):var _0x2b4fac=_0x36d479[_0xd8aa('0x5b')]['results'][0x0];if(_0x2b4fac[_0xd8aa('0x2c')][_0xd8aa('0x97')]==='DELIVERED'){return _0x28052a['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd8aa('0x2c'),_0xd8aa('0x96'),util[_0xd8aa('0x8c')](_0x36d479['body'],{'showHidden':![],'depth':null}));}break;}return _0x28052a;}})[_0xd8aa('0x20')](respondWithResult(_0x3cfcb9,null))['catch'](handleError(_0x3cfcb9,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 52e74ff..d4f79d6 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 _0xb8f4=['SmsMessage','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x404a11,_0x5d5647){var _0x471865=function(_0x2e3bc8){while(--_0x2e3bc8){_0x404a11['push'](_0x404a11['shift']());}};_0x471865(++_0x5d5647);}(_0xb8f4,0x11f));var _0x4b8f=function(_0x1fd5f5,_0x36b4ec){_0x1fd5f5=_0x1fd5f5-0x0;var _0x3f2e69=_0xb8f4[_0x1fd5f5];return _0x3f2e69;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x4b8f('0x0'))['db'][_0x4b8f('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b8f('0x2'),'afterUpdate':_0x4b8f('0x3'),'afterDestroy':_0x4b8f('0x4')};function emitEvent(_0x28d263){return function(_0x48215c,_0x160a94,_0x1cfa0e){SmsMessageEvents[_0x4b8f('0x5')](_0x28d263+':'+_0x48215c['id'],_0x48215c);SmsMessageEvents['emit'](_0x28d263,_0x48215c);_0x1cfa0e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x4b8f('0x6')](e,emitEvent(event));}}module[_0x4b8f('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xb676=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb676,0xcc));var _0x6b67=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xb676[_0x409353];return _0x4f4b59;};'use strict';var EventEmitter=require(_0x6b67('0x0'));var SmsMessage=require(_0x6b67('0x1'))['db'][_0x6b67('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6b67('0x3')](0x0);var events={'afterCreate':_0x6b67('0x4'),'afterUpdate':_0x6b67('0x5'),'afterDestroy':_0x6b67('0x6')};function emitEvent(_0x38bb3b){return function(_0x597ad8,_0x12de17,_0x477384){SmsMessageEvents[_0x6b67('0x7')](_0x38bb3b+':'+_0x597ad8['id'],_0x597ad8);SmsMessageEvents[_0x6b67('0x7')](_0x38bb3b,_0x597ad8);_0x477384(null);};}for(var e in events){if(events[_0x6b67('0x8')](e)){var event=events[e];SmsMessage[_0x6b67('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index ac14238..06cf1ea 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 _0x96f1=['data','head','message_id','clickSend','plivo','authId','/status?token=','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','keys','sort','length','createHash','hex','signature=','id_sms','csc','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','accountId','/messages','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','toLowerCase','direction','isNil','UserId','SmsInteractionId','findOne','then','createdAt','catch','out','secret','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/api/sms/messages/','token','sid','error','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','username','smsMethod','sender','login?username=','password','GET','split','POST','session_key','total_sent','internal_order_id','deliveryReport','read','update','Missing\x20parameters:\x20username,\x20password','connectel','requestid','clicksend','xCALLY\x20Motion','senderString','https://rest.clicksend.com/v3/sms/send','format','toString','base64','http_code'];(function(_0x30a9a5,_0x5aa213){var _0x493ed3=function(_0x496669){while(--_0x496669){_0x30a9a5['push'](_0x30a9a5['shift']());}};_0x493ed3(++_0x5aa213);}(_0x96f1,0xa1));var _0x196f=function(_0x35505f,_0x54cea0){_0x35505f=_0x35505f-0x0;var _0x37e24e=_0x96f1[_0x35505f];return _0x37e24e;};'use strict';var _=require(_0x196f('0x0'));var util=require('util');var logger=require(_0x196f('0x1'))('api');var moment=require(_0x196f('0x2'));var BPromise=require(_0x196f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x196f('0x4'));var rimraf=require('rimraf');var config=require(_0x196f('0x5'));var attributes=require(_0x196f('0x6'));module[_0x196f('0x7')]=function(_0x1ab7cf,_0x5c3655){return _0x1ab7cf[_0x196f('0x8')](_0x196f('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x196f('0xa'),'fields':['messageId']},{'name':_0x196f('0xb'),'fields':[_0x196f('0xc')],'type':_0x196f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d3032,_0x2231c8,_0x1da487){var _0x51e86a=_0x1ab7cf['models'];var _0x5f472d=_0x5d3032[_0x196f('0xe')]({'plain':!![]});if(_0x5f472d['direction'][_0x196f('0xf')]()==='in'||_0x5f472d[_0x196f('0x10')]['toLowerCase']()==='out'&&!_0x5f472d['secret']&&!_[_0x196f('0x11')](_0x5f472d[_0x196f('0x12')])&&!_[_0x196f('0x11')](_0x5f472d[_0x196f('0x13')])){_0x51e86a['SmsInteraction'][_0x196f('0x14')]({'where':{'id':_0x5f472d['SmsInteractionId']}})[_0x196f('0x15')](function(_0x304c4c){if(_0x304c4c){_0x304c4c['update']({'lastMsgAt':_0x5f472d[_0x196f('0x16')],'lastMsgDirection':_0x5f472d['direction']['toLowerCase']()});}})[_0x196f('0x17')](function(_0x16e769){console['error'](_0x16e769);});}if(_0x5f472d[_0x196f('0x10')]===_0x196f('0x18')&&!_0x5f472d[_0x196f('0x19')]){var _0x4ebe6b;_0x51e86a['SmsAccount'][_0x196f('0x1a')]({'where':{'id':_0x5f472d[_0x196f('0x1b')]},'raw':!![]})[_0x196f('0x15')](function(_0x1bf1bd){_0x4ebe6b=_0x1bf1bd;if(_0x4ebe6b&&_0x4ebe6b['type']){switch(_0x4ebe6b[_0x196f('0x1c')]){case'twilio':var _0x4a1703=require(_0x196f('0x1d'));if(_0x4ebe6b[_0x196f('0x1e')]&&_0x4ebe6b['authToken']&&_0x4ebe6b[_0x196f('0x1f')]){var _0xeac588=new _0x4a1703(_0x4ebe6b['accountSid'],_0x4ebe6b[_0x196f('0x20')]);_0xeac588[_0x196f('0x21')][_0x196f('0x22')]({'body':_0x5f472d[_0x196f('0xc')],'to':_0x5f472d[_0x196f('0x1f')],'from':_0x4ebe6b[_0x196f('0x1f')],'statusCallback':_0x4ebe6b[_0x196f('0x23')]+_0x196f('0x24')+_0x5f472d['id']+'/status?token='+_0x4ebe6b[_0x196f('0x25')]})[_0x196f('0x15')](function(_0x46a436){if(_0x46a436['sid']){return _0x5d3032['update']({'messageId':_0x46a436[_0x196f('0x26')]});}})[_0x196f('0x17')](function(_0x5c53e3){logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x196f('0x28'),_0x196f('0x1d'),util[_0x196f('0x29')](_0x5c53e3,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x196f('0x2b'):var _0x2b4574='https://api.skebby.it/API/v1.0/REST/';if(_0x4ebe6b[_0x196f('0x2c')]&&_0x4ebe6b['password']){var _0x2c25bd={'recipient':[_0x5f472d[_0x196f('0x1f')]],'message':_0x5f472d['body'],'message_type':_0x4ebe6b['smsMethod']};if(_0x4ebe6b[_0x196f('0x2d')]&&_0x4ebe6b['smsMethod']!=='SI'){_0x2c25bd[_0x196f('0x2e')]=_0x4ebe6b[_0x196f('0x1f')];}var _0x1d9347={'url':_0x2b4574+_0x196f('0x2f')+_0x4ebe6b[_0x196f('0x2c')]+'&password='+_0x4ebe6b[_0x196f('0x30')],'method':_0x196f('0x31')};rp(_0x1d9347)[_0x196f('0x15')](function(_0x1c1b6c){var _0x2ae825=_0x1c1b6c[_0x196f('0x32')](';');var _0x394ee3={'user_key':_0x2ae825[0x0],'session_key':_0x2ae825[0x1]};_0x1d9347={'url':_0x2b4574+'sms','method':_0x196f('0x33'),'headers':{'user_key':_0x394ee3['user_key'],'Session_key':_0x394ee3[_0x196f('0x34')]},'json':!![],'body':_0x2c25bd};return rp(_0x1d9347);})[_0x196f('0x15')](function(_0x18e8da){if(_0x18e8da[_0x196f('0x35')]>=0x1){var _0x5ba21e={'messageId':_0x18e8da[_0x196f('0x36')]};if(_0x4ebe6b[_0x196f('0x2d')]!=='GP'||!_0x4ebe6b[_0x196f('0x37')]){_0x5ba21e[_0x196f('0x38')]=!![];}return _0x5d3032[_0x196f('0x39')](_0x5ba21e);}else{return logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x2b'),util[_0x196f('0x29')](_0x18e8da,{'showHidden':![],'depth':null}));}})['catch'](function(_0x9a7884){return logger[_0x196f('0x27')](_0x196f('0x2a'),'afterCreate',_0x196f('0x2b'),util[_0x196f('0x29')](_0x9a7884,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x2b'),_0x196f('0x3a'));}break;case _0x196f('0x3b'):if(_0x4ebe6b['authToken']){var _0x17dc47={'recipient':_0x5f472d[_0x196f('0x1f')],'message':_0x5f472d['body'],'sender':_0x4ebe6b['senderString']||_0x4ebe6b[_0x196f('0x1f')],'authorization':_0x4ebe6b[_0x196f('0x20')]};var _0x2231c8={'method':_0x196f('0x33'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x17dc47,'json':!![]};rp(_0x2231c8)[_0x196f('0x15')](function(_0x41c678){var _0x1a2c5f={'messageId':_0x41c678[_0x196f('0x3c')]};if(!_0x4ebe6b[_0x196f('0x37')]){_0x1a2c5f[_0x196f('0x38')]=!![];}return _0x5d3032['update'](_0x1a2c5f);})['catch'](function(_0x5850f8){logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x196f('0x3b'),util[_0x196f('0x29')](_0x5850f8,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')](_0x196f('0x2a'),'afterCreate',_0x196f('0x3b'),'Missing\x20parameters:\x20authToken');}break;case _0x196f('0x3d'):if(_0x4ebe6b[_0x196f('0x2c')]&&_0x4ebe6b['password']){var _0x17dc47={'messages':[{'source':_0x196f('0x3e'),'to':_0x5f472d['phone'],'body':_0x5f472d[_0x196f('0xc')],'from':_0x4ebe6b[_0x196f('0x3f')]||_0x4ebe6b[_0x196f('0x1f')]}]};var _0x305570=util['format']('%s:%s',_0x4ebe6b[_0x196f('0x2c')],_0x4ebe6b[_0x196f('0x30')]);var _0x2231c8={'method':'POST','uri':_0x196f('0x40'),'body':_0x17dc47,'headers':{'Authorization':util[_0x196f('0x41')]('Basic\x20%s',new Buffer(_0x305570)[_0x196f('0x42')](_0x196f('0x43')))},'json':!![]};rp(_0x2231c8)[_0x196f('0x15')](function(_0x3f7e91){if(_0x3f7e91[_0x196f('0x44')]>=0xc8&&_0x3f7e91[_0x196f('0x44')]<=0xce){if(_0x3f7e91[_0x196f('0x45')]&&_0x3f7e91['data']['queued_count']>0x0){var _0x4baa50=_[_0x196f('0x46')](_0x3f7e91[_0x196f('0x45')]['messages']);var _0x2f25c1={'messageId':_0x4baa50[_0x196f('0x47')]};if(!_0x4ebe6b[_0x196f('0x37')]){_0x2f25c1[_0x196f('0x38')]=!![];}return _0x5d3032[_0x196f('0x39')](_0x2f25c1);}else{logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x196f('0x28'),_0x196f('0x48'),util[_0x196f('0x29')](_0x3f7e91,{'showHidden':![],'depth':null}));}}else{logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),'clickSend',util['inspect'](_0x3f7e91,{'showHidden':![],'depth':null}));}})[_0x196f('0x17')](function(_0x499f14){logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x196f('0x28'),_0x196f('0x48'),util[_0x196f('0x29')](_0x499f14,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x48'),_0x196f('0x3a'));}break;case _0x196f('0x49'):if(_0x4ebe6b[_0x196f('0x4a')]&&_0x4ebe6b[_0x196f('0x20')]){var _0x17dc47={'dst':_0x5f472d[_0x196f('0x1f')],'text':_0x5f472d[_0x196f('0xc')],'src':_0x4ebe6b[_0x196f('0x3f')]||_0x4ebe6b[_0x196f('0x1f')],'url':_0x4ebe6b[_0x196f('0x23')]+_0x196f('0x24')+_0x5f472d['id']+_0x196f('0x4b')+_0x4ebe6b['token']};var _0x305570=util[_0x196f('0x41')](_0x196f('0x4c'),_0x4ebe6b['authId'],_0x4ebe6b[_0x196f('0x20')]);var _0x2231c8={'method':'POST','uri':util['format'](_0x196f('0x4d'),_0x4ebe6b[_0x196f('0x4a')]),'body':_0x17dc47,'headers':{'Authorization':util[_0x196f('0x41')](_0x196f('0x4e'),new Buffer(_0x305570)[_0x196f('0x42')](_0x196f('0x43')))},'json':!![]};rp(_0x2231c8)[_0x196f('0x15')](function(_0x53a381){var _0x2f90a2={'messageId':_0x53a381['message_uuid'][0x0]};return _0x5d3032[_0x196f('0x39')](_0x2f90a2);})[_0x196f('0x17')](function(_0x417b21){logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x49'),util[_0x196f('0x29')](_0x417b21,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x49'),_0x196f('0x4f'));}break;case _0x196f('0x50'):if(_0x4ebe6b[_0x196f('0x2c')]&&_0x4ebe6b['password']){if(_0x4ebe6b[_0x196f('0x51')]){var _0x350b00={'method':'POST','uri':_0x4ebe6b[_0x196f('0x51')]+'/auth/1/session','body':{'username':_0x4ebe6b[_0x196f('0x2c')],'password':_0x4ebe6b[_0x196f('0x30')]},'json':!![]};return rp(_0x350b00)[_0x196f('0x15')](function(_0x2e3c8b){var _0x248c71={'method':_0x196f('0x33'),'uri':_0x4ebe6b['baseUrl']+_0x196f('0x52'),'body':{'messages':[{'from':_0x4ebe6b[_0x196f('0x1f')],'destinations':[{'to':_0x5f472d[_0x196f('0x1f')]}],'text':_0x5f472d[_0x196f('0xc')],'notifyUrl':_0x4ebe6b[_0x196f('0x23')]+_0x196f('0x24')+_0x5f472d['id']+_0x196f('0x4b')+_0x4ebe6b[_0x196f('0x25')],'notifyContentType':_0x196f('0x53'),'callbackData':_0x4ebe6b['phone']+';'+_0x5f472d['body']}]},'headers':{'Authorization':_0x196f('0x54')+_0x2e3c8b[_0x196f('0x25')]},'json':!![]};return rp(_0x248c71)[_0x196f('0x15')](function(_0x42d420){if(_0x42d420[_0x196f('0x21')]){var _0x24b1ed={'messageId':_0x42d420[_0x196f('0x21')][0x0][_0x196f('0xa')]};if(!_0x4ebe6b[_0x196f('0x37')]){_0x24b1ed['read']=!![];}return _0x5d3032['update'](_0x24b1ed);}else{return logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x196f('0x28'),_0x196f('0x50'),util[_0x196f('0x29')](_0x42d420,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2c881e){return logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x50'),util[_0x196f('0x29')](_0x2c881e,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x50'),_0x196f('0x55'));}}else{logger['error'](_0x196f('0x2a'),'afterCreate',_0x196f('0x50'),_0x196f('0x3a'));}break;case'csc':var _0x337a34=require(_0x196f('0x56'));if(_0x4ebe6b[_0x196f('0x57')]){var _0x225a12={};_0x225a12['login']=_0x4ebe6b[_0x196f('0x2c')];_0x225a12[_0x196f('0x1f')]=_0x5f472d[_0x196f('0x1f')];_0x225a12[_0x196f('0x2e')]=_0x4ebe6b[_0x196f('0x1f')];_0x225a12['text']=_0x5f472d['body'];_0x225a12['timestamp']=+new Date();var _0x3cd4f8='';var _0x234c51='';var _0x2cf4ed=Object[_0x196f('0x58')](_0x225a12);_0x2cf4ed[_0x196f('0x59')]();for(var _0x267517=0x0;_0x267517<_0x2cf4ed[_0x196f('0x5a')];_0x267517++){if(_0x3cd4f8!=''){_0x3cd4f8+='&';}_0x3cd4f8+=_0x2cf4ed[_0x267517]+'='+encodeURIComponent(_0x225a12[_0x2cf4ed[_0x267517]]);_0x234c51+=_0x225a12[_0x2cf4ed[_0x267517]];}_0x234c51+=_0x4ebe6b[_0x196f('0x57')];_0x234c51=_0x337a34[_0x196f('0x5b')]('md5')['update'](_0x234c51)['digest'](_0x196f('0x5c'));if(_0x3cd4f8!==''){_0x3cd4f8+='&';}_0x3cd4f8+=_0x196f('0x5d')+_0x234c51;var _0x1d9347={'method':'GET','uri':_0x4ebe6b[_0x196f('0x51')]+'/external/get/send.php?'+_0x3cd4f8,'json':!![]};return rp(_0x1d9347)['then'](function(_0x3cd92a){var _0x38887e=Object[_0x196f('0x58')](_0x3cd92a);if(_0x3cd92a[_0x38887e[0x0]][_0x196f('0x27')]&&parseInt(_0x3cd92a[_0x38887e[0x0]][_0x196f('0x27')])===0x0){var _0x37e4ae={'messageId':_0x3cd92a[_0x38887e[0x0]][_0x196f('0x5e')]};if(!_0x4ebe6b[_0x196f('0x37')]){_0x37e4ae[_0x196f('0x38')]=!![];}return _0x5d3032[_0x196f('0x39')](_0x37e4ae);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x196f('0x5f'),util[_0x196f('0x29')](_0x3cd92a['error'],{'showHidden':![],'depth':null}));}})[_0x196f('0x17')](function(_0x4052b6){return logger['error'](_0x196f('0x2a'),_0x196f('0x28'),'csc',util[_0x196f('0x29')](_0x4052b6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x196f('0x2a'),_0x196f('0x28'),'csc','Missing\x20parameters:\x20apiKey');}break;case _0x196f('0x60'):if(_0x4ebe6b[_0x196f('0x57')]){var _0x4118d6={'method':_0x196f('0x33'),'uri':_0x196f('0x61'),'headers':{'Authorization':_0x4ebe6b[_0x196f('0x57')]},'body':{'content':_0x5f472d[_0x196f('0xc')],'to':[_0x5f472d['phone']],'from':_0x4ebe6b[_0x196f('0x1f')],'binary':![],'clientMessageId':_0x196f('0x62'),'charset':'UTF-8'},'json':!![]};rp(_0x4118d6)[_0x196f('0x15')](function(_0x2db46d){if(!_0x2db46d['error']){var _0x43a9e7={'messageId':_0x2db46d[_0x196f('0x21')][0x0][_0x196f('0x63')]};if(!_0x4ebe6b['deliveryReport']){_0x43a9e7[_0x196f('0x38')]=!![];}return _0x5d3032[_0x196f('0x39')](_0x43a9e7);}else{return logger[_0x196f('0x27')](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x60'),util[_0x196f('0x29')](_0x2db46d[_0x196f('0x27')],{'showHidden':![],'depth':null}));}})[_0x196f('0x17')](function(_0x63190){return logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x196f('0x60'),util['inspect'](_0x63190,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x196f('0x28'),_0x196f('0x60'),_0x196f('0x64'));}break;case'bandwidth':if(_0x4ebe6b[_0x196f('0x2c')]&&_0x4ebe6b[_0x196f('0x30')]){var _0x305570=util[_0x196f('0x41')]('%s:%s',_0x4ebe6b[_0x196f('0x2c')],_0x4ebe6b[_0x196f('0x30')]);var _0x2231c8={'method':_0x196f('0x33'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x4ebe6b[_0x196f('0x65')]+_0x196f('0x66'),'body':{'to':[_0x5f472d['phone']],'text':_0x5f472d[_0x196f('0xc')],'from':_0x4ebe6b['phone'],'applicationId':_0x4ebe6b['applicationId']},'headers':{'Authorization':util[_0x196f('0x41')](_0x196f('0x4e'),new Buffer(_0x305570)[_0x196f('0x42')](_0x196f('0x43')))},'json':!![]};rp(_0x2231c8)[_0x196f('0x15')](function(_0x5cd30c){if(_0x5cd30c['id']){var _0x5cfa94={'messageId':_0x5cd30c['id']};return _0x5d3032[_0x196f('0x39')](_0x5cfa94);}else{logger['error'](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x67'),util[_0x196f('0x29')](_0x5cd30c,{'showHidden':![],'depth':null}));}})[_0x196f('0x17')](function(_0x3312b0){logger['error'](_0x196f('0x2a'),_0x196f('0x28'),_0x196f('0x67'),util['inspect'](_0x3312b0,{'showHidden':![],'depth':null}));});}else{logger[_0x196f('0x27')](_0x196f('0x2a'),'afterCreate',_0x196f('0x67'),_0x196f('0x3a'));}break;case _0x196f('0x68'):if(_0x4ebe6b[_0x196f('0x57')]){var _0x457c08={};var _0x1d9347={'method':_0x196f('0x33'),'uri':_0x196f('0x69'),'headers':{'Authorization':'Bearer\x20'+_0x4ebe6b[_0x196f('0x57')],'Content-Type':'application/json'},'body':{'from':_0x4ebe6b[_0x196f('0x1f')],'to':_0x5f472d['phone'],'text':_0x5f472d[_0x196f('0xc')]},'json':!![]};return rp(_0x1d9347)[_0x196f('0x15')](function(_0x1a925b){if(_0x1a925b[_0x196f('0x6a')]==0xca){_0x457c08[_0x196f('0x6b')]=_0x1a925b;var _0x50e5fe={'method':_0x196f('0x33'),'uri':_0x196f('0x6c'),'headers':{'Authorization':_0x196f('0x6d')+_0x4ebe6b[_0x196f('0x57')],'Content-Type':'application/json'},'body':{'refid':_0x457c08[_0x196f('0x6b')]['refid']},'json':!![]};return rp(_0x50e5fe)[_0x196f('0x15')](function(_0x5d82ff){_0x457c08[_0x196f('0x6e')]=_0x5d82ff;var _0x4aef62={'messageId':_0x457c08['message']['refid'],'read':!![]};return _0x5d3032[_0x196f('0x39')](_0x4aef62);});}else{return logger[_0x196f('0x27')](_0x196f('0x2a'),'afterCreate',_0x196f('0x68'),util[_0x196f('0x29')](_0x1a925b,{'showHidden':![],'depth':null}));}})[_0x196f('0x17')](function(_0x574d7d){return logger['error'](_0x196f('0x2a'),'afterCreate','intelepeer',util['inspect'](_0x574d7d,{'showHidden':![],'depth':null}));});}else{return logger[_0x196f('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x196f('0x68'),_0x196f('0x6f'));}break;}}})[_0x196f('0x70')](function(){_0x1da487();});}else{_0x1da487();}}},'charset':_0x196f('0x71'),'collate':_0x196f('0x72')});}; \ No newline at end of file +var _0xdfcd=['messages','create','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','error','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','smsMethod','sender','login?username=','&password=','password','split','POST','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','xCALLY\x20Motion','senderString','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','remote','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','length','createHash','md5','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','status','refid','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','type','twilio','accountSid','phone','authToken'];(function(_0x568ae7,_0x2b5fa3){var _0x257050=function(_0x43e8df){while(--_0x43e8df){_0x568ae7['push'](_0x568ae7['shift']());}};_0x257050(++_0x2b5fa3);}(_0xdfcd,0xcd));var _0xddfc=function(_0x3cdff3,_0x4ff364){_0x3cdff3=_0x3cdff3-0x0;var _0x6e0e6=_0xdfcd[_0x3cdff3];return _0x6e0e6;};'use strict';var _=require(_0xddfc('0x0'));var util=require(_0xddfc('0x1'));var logger=require('../../config/logger')(_0xddfc('0x2'));var moment=require(_0xddfc('0x3'));var BPromise=require(_0xddfc('0x4'));var rp=require(_0xddfc('0x5'));var fs=require('fs');var path=require(_0xddfc('0x6'));var rimraf=require(_0xddfc('0x7'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xddfc('0x8')]=function(_0x339e3d,_0x2df7cf){return _0x339e3d['define'](_0xddfc('0x9'),attributes,{'tableName':_0xddfc('0xa'),'paranoid':![],'indexes':[{'name':_0xddfc('0xb'),'fields':[_0xddfc('0xb')]},{'name':_0xddfc('0xc'),'fields':[_0xddfc('0xd')],'type':_0xddfc('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x15fcb6,_0x127fef,_0x3ddb78){var _0x4b8924=_0x339e3d[_0xddfc('0xf')];var _0x1b3192=_0x15fcb6[_0xddfc('0x10')]({'plain':!![]});if(_0x1b3192[_0xddfc('0x11')]['toLowerCase']()==='in'||_0x1b3192['direction'][_0xddfc('0x12')]()===_0xddfc('0x13')&&!_0x1b3192['secret']&&!_[_0xddfc('0x14')](_0x1b3192['UserId'])&&!_[_0xddfc('0x14')](_0x1b3192['SmsInteractionId'])){_0x4b8924['SmsInteraction'][_0xddfc('0x15')]({'where':{'id':_0x1b3192[_0xddfc('0x16')]}})[_0xddfc('0x17')](function(_0x20a887){if(_0x20a887){_0x20a887[_0xddfc('0x18')]({'lastMsgAt':_0x1b3192[_0xddfc('0x19')],'lastMsgDirection':_0x1b3192[_0xddfc('0x11')]['toLowerCase']()});}})[_0xddfc('0x1a')](function(_0x2bf605){console['error'](_0x2bf605);});}if(_0x1b3192['direction']===_0xddfc('0x13')&&!_0x1b3192['secret']){var _0x200c66;_0x4b8924[_0xddfc('0x1b')]['find']({'where':{'id':_0x1b3192['SmsAccountId']},'raw':!![]})[_0xddfc('0x17')](function(_0x14dbb9){_0x200c66=_0x14dbb9;if(_0x200c66&&_0x200c66[_0xddfc('0x1c')]){switch(_0x200c66[_0xddfc('0x1c')]){case _0xddfc('0x1d'):var _0xc8720b=require(_0xddfc('0x1d'));if(_0x200c66[_0xddfc('0x1e')]&&_0x200c66['authToken']&&_0x200c66[_0xddfc('0x1f')]){var _0x48d0e9=new _0xc8720b(_0x200c66[_0xddfc('0x1e')],_0x200c66[_0xddfc('0x20')]);_0x48d0e9[_0xddfc('0x21')][_0xddfc('0x22')]({'body':_0x1b3192[_0xddfc('0xd')],'to':_0x1b3192[_0xddfc('0x1f')],'from':_0x200c66[_0xddfc('0x1f')],'statusCallback':_0x200c66['remote']+_0xddfc('0x23')+_0x1b3192['id']+_0xddfc('0x24')+_0x200c66[_0xddfc('0x25')]})['then'](function(_0x3b6167){if(_0x3b6167[_0xddfc('0x26')]){return _0x15fcb6[_0xddfc('0x18')]({'messageId':_0x3b6167[_0xddfc('0x26')]});}})['catch'](function(_0x1559ea){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddfc('0x27'),_0xddfc('0x1d'),util[_0xddfc('0x28')](_0x1559ea,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x1d'),_0xddfc('0x2b'));}break;case _0xddfc('0x2c'):var _0x54954c='https://api.skebby.it/API/v1.0/REST/';if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66['password']){var _0x57c474={'recipient':[_0x1b3192[_0xddfc('0x1f')]],'message':_0x1b3192[_0xddfc('0xd')],'message_type':_0x200c66[_0xddfc('0x2e')]};if(_0x200c66[_0xddfc('0x2e')]&&_0x200c66[_0xddfc('0x2e')]!=='SI'){_0x57c474[_0xddfc('0x2f')]=_0x200c66['phone'];}var _0xd09c84={'url':_0x54954c+_0xddfc('0x30')+_0x200c66['username']+_0xddfc('0x31')+_0x200c66[_0xddfc('0x32')],'method':'GET'};rp(_0xd09c84)[_0xddfc('0x17')](function(_0x5d7494){var _0x57afae=_0x5d7494[_0xddfc('0x33')](';');var _0xa7b72d={'user_key':_0x57afae[0x0],'session_key':_0x57afae[0x1]};_0xd09c84={'url':_0x54954c+'sms','method':_0xddfc('0x34'),'headers':{'user_key':_0xa7b72d['user_key'],'Session_key':_0xa7b72d[_0xddfc('0x35')]},'json':!![],'body':_0x57c474};return rp(_0xd09c84);})['then'](function(_0x23edeb){if(_0x23edeb[_0xddfc('0x36')]>=0x1){var _0x334691={'messageId':_0x23edeb[_0xddfc('0x37')]};if(_0x200c66[_0xddfc('0x2e')]!=='GP'||!_0x200c66[_0xddfc('0x38')]){_0x334691[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x334691);}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x2c'),util[_0xddfc('0x28')](_0x23edeb,{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x368519){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x2c'),util['inspect'](_0x368519,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddfc('0x27'),'skebby',_0xddfc('0x3a'));}break;case _0xddfc('0x3b'):if(_0x200c66['authToken']){var _0x1062f1={'recipient':_0x1b3192[_0xddfc('0x1f')],'message':_0x1b3192['body'],'sender':_0x200c66['senderString']||_0x200c66[_0xddfc('0x1f')],'authorization':_0x200c66[_0xddfc('0x20')]};var _0x127fef={'method':_0xddfc('0x34'),'uri':_0xddfc('0x3c'),'body':_0x1062f1,'json':!![]};rp(_0x127fef)[_0xddfc('0x17')](function(_0x586cef){var _0x4d52e8={'messageId':_0x586cef[_0xddfc('0x3d')]};if(!_0x200c66[_0xddfc('0x38')]){_0x4d52e8[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x4d52e8);})[_0xddfc('0x1a')](function(_0x1783f0){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x3b'),util[_0xddfc('0x28')](_0x1783f0,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66[_0xddfc('0x32')]){var _0x1062f1={'messages':[{'source':_0xddfc('0x3e'),'to':_0x1b3192[_0xddfc('0x1f')],'body':_0x1b3192['body'],'from':_0x200c66[_0xddfc('0x3f')]||_0x200c66[_0xddfc('0x1f')]}]};var _0x4f6c10=util[_0xddfc('0x40')](_0xddfc('0x41'),_0x200c66['username'],_0x200c66[_0xddfc('0x32')]);var _0x127fef={'method':_0xddfc('0x34'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1062f1,'headers':{'Authorization':util[_0xddfc('0x40')](_0xddfc('0x42'),new Buffer(_0x4f6c10)['toString'](_0xddfc('0x43')))},'json':!![]};rp(_0x127fef)['then'](function(_0x4d91c4){if(_0x4d91c4['http_code']>=0xc8&&_0x4d91c4[_0xddfc('0x44')]<=0xce){if(_0x4d91c4['data']&&_0x4d91c4[_0xddfc('0x45')][_0xddfc('0x46')]>0x0){var _0xe81882=_['head'](_0x4d91c4[_0xddfc('0x45')][_0xddfc('0x21')]);var _0x50b623={'messageId':_0xe81882[_0xddfc('0x47')]};if(!_0x200c66[_0xddfc('0x38')]){_0x50b623[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x50b623);}else{logger['error'](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x48'),util[_0xddfc('0x28')](_0x4d91c4,{'showHidden':![],'depth':null}));}}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x48'),util[_0xddfc('0x28')](_0x4d91c4,{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x6f0d01){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x48'),util[_0xddfc('0x28')](_0x6f0d01,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),'afterCreate',_0xddfc('0x48'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xddfc('0x49'):if(_0x200c66['authId']&&_0x200c66[_0xddfc('0x20')]){var _0x1062f1={'dst':_0x1b3192[_0xddfc('0x1f')],'text':_0x1b3192[_0xddfc('0xd')],'src':_0x200c66[_0xddfc('0x3f')]||_0x200c66[_0xddfc('0x1f')],'url':_0x200c66[_0xddfc('0x4a')]+_0xddfc('0x23')+_0x1b3192['id']+_0xddfc('0x24')+_0x200c66['token']};var _0x4f6c10=util[_0xddfc('0x40')]('%s:%s',_0x200c66[_0xddfc('0x4b')],_0x200c66[_0xddfc('0x20')]);var _0x127fef={'method':_0xddfc('0x34'),'uri':util[_0xddfc('0x40')](_0xddfc('0x4c'),_0x200c66[_0xddfc('0x4b')]),'body':_0x1062f1,'headers':{'Authorization':util[_0xddfc('0x40')](_0xddfc('0x42'),new Buffer(_0x4f6c10)[_0xddfc('0x4d')](_0xddfc('0x43')))},'json':!![]};rp(_0x127fef)[_0xddfc('0x17')](function(_0x16b0c3){var _0xa2b3f8={'messageId':_0x16b0c3[_0xddfc('0x4e')][0x0]};return _0x15fcb6[_0xddfc('0x18')](_0xa2b3f8);})[_0xddfc('0x1a')](function(_0xca37b9){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x49'),util[_0xddfc('0x28')](_0xca37b9,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),'afterCreate',_0xddfc('0x49'),_0xddfc('0x4f'));}break;case _0xddfc('0x50'):if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66[_0xddfc('0x32')]){if(_0x200c66[_0xddfc('0x51')]){var _0x180a93={'method':_0xddfc('0x34'),'uri':_0x200c66[_0xddfc('0x51')]+'/auth/1/session','body':{'username':_0x200c66[_0xddfc('0x2d')],'password':_0x200c66[_0xddfc('0x32')]},'json':!![]};return rp(_0x180a93)['then'](function(_0x4d817f){var _0x2238be={'method':'POST','uri':_0x200c66[_0xddfc('0x51')]+_0xddfc('0x52'),'body':{'messages':[{'from':_0x200c66['phone'],'destinations':[{'to':_0x1b3192[_0xddfc('0x1f')]}],'text':_0x1b3192[_0xddfc('0xd')],'notifyUrl':_0x200c66[_0xddfc('0x4a')]+_0xddfc('0x23')+_0x1b3192['id']+_0xddfc('0x24')+_0x200c66['token'],'notifyContentType':_0xddfc('0x53'),'callbackData':_0x200c66[_0xddfc('0x1f')]+';'+_0x1b3192[_0xddfc('0xd')]}]},'headers':{'Authorization':_0xddfc('0x54')+_0x4d817f['token']},'json':!![]};return rp(_0x2238be)[_0xddfc('0x17')](function(_0x46a852){if(_0x46a852['messages']){var _0x36d98e={'messageId':_0x46a852['messages'][0x0][_0xddfc('0xb')]};if(!_0x200c66[_0xddfc('0x38')]){_0x36d98e[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x36d98e);}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'infobip',util[_0xddfc('0x28')](_0x46a852,{'showHidden':![],'depth':null}));}});})[_0xddfc('0x1a')](function(_0x36d6ad){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'infobip',util['inspect'](_0x36d6ad,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'infobip',_0xddfc('0x55'));}}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x50'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xddfc('0x56'):var _0x45a57d=require(_0xddfc('0x57'));if(_0x200c66[_0xddfc('0x58')]){var _0x25b1f7={};_0x25b1f7['login']=_0x200c66[_0xddfc('0x2d')];_0x25b1f7[_0xddfc('0x1f')]=_0x1b3192[_0xddfc('0x1f')];_0x25b1f7[_0xddfc('0x2f')]=_0x200c66['phone'];_0x25b1f7[_0xddfc('0x59')]=_0x1b3192[_0xddfc('0xd')];_0x25b1f7[_0xddfc('0x5a')]=+new Date();var _0xffb416='';var _0x238621='';var _0x1d6d17=Object[_0xddfc('0x5b')](_0x25b1f7);_0x1d6d17[_0xddfc('0x5c')]();for(var _0x3ad5c2=0x0;_0x3ad5c2<_0x1d6d17[_0xddfc('0x5d')];_0x3ad5c2++){if(_0xffb416!=''){_0xffb416+='&';}_0xffb416+=_0x1d6d17[_0x3ad5c2]+'='+encodeURIComponent(_0x25b1f7[_0x1d6d17[_0x3ad5c2]]);_0x238621+=_0x25b1f7[_0x1d6d17[_0x3ad5c2]];}_0x238621+=_0x200c66[_0xddfc('0x58')];_0x238621=_0x45a57d[_0xddfc('0x5e')](_0xddfc('0x5f'))[_0xddfc('0x18')](_0x238621)['digest']('hex');if(_0xffb416!==''){_0xffb416+='&';}_0xffb416+=_0xddfc('0x60')+_0x238621;var _0xd09c84={'method':_0xddfc('0x61'),'uri':_0x200c66[_0xddfc('0x51')]+_0xddfc('0x62')+_0xffb416,'json':!![]};return rp(_0xd09c84)['then'](function(_0x1e2fe6){var _0x56653a=Object[_0xddfc('0x5b')](_0x1e2fe6);if(_0x1e2fe6[_0x56653a[0x0]]['error']&&parseInt(_0x1e2fe6[_0x56653a[0x0]]['error'])===0x0){var _0x5d8fba={'messageId':_0x1e2fe6[_0x56653a[0x0]][_0xddfc('0x63')]};if(!_0x200c66[_0xddfc('0x38')]){_0x5d8fba[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x5d8fba);}else{return logger[_0xddfc('0x29')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util['inspect'](_0x1e2fe6[_0xddfc('0x29')],{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x2149f1){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x56'),util['inspect'](_0x2149f1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xddfc('0x27'),'csc',_0xddfc('0x64'));}break;case _0xddfc('0x65'):if(_0x200c66[_0xddfc('0x58')]){var _0x296961={'method':_0xddfc('0x34'),'uri':_0xddfc('0x66'),'headers':{'Authorization':_0x200c66[_0xddfc('0x58')]},'body':{'content':_0x1b3192[_0xddfc('0xd')],'to':[_0x1b3192[_0xddfc('0x1f')]],'from':_0x200c66[_0xddfc('0x1f')],'binary':![],'clientMessageId':_0xddfc('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x296961)['then'](function(_0x548fe4){if(!_0x548fe4['error']){var _0x88f53={'messageId':_0x548fe4['messages'][0x0][_0xddfc('0x68')]};if(!_0x200c66[_0xddfc('0x38')]){_0x88f53[_0xddfc('0x39')]=!![];}return _0x15fcb6[_0xddfc('0x18')](_0x88f53);}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'clickatell',util[_0xddfc('0x28')](_0x548fe4[_0xddfc('0x29')],{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x4adc3d){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),'afterCreate',_0xddfc('0x65'),util[_0xddfc('0x28')](_0x4adc3d,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),'clickatell',_0xddfc('0x64'));}break;case _0xddfc('0x69'):if(_0x200c66[_0xddfc('0x2d')]&&_0x200c66[_0xddfc('0x32')]){var _0x4f6c10=util['format'](_0xddfc('0x41'),_0x200c66[_0xddfc('0x2d')],_0x200c66[_0xddfc('0x32')]);var _0x127fef={'method':_0xddfc('0x34'),'uri':_0xddfc('0x6a')+_0x200c66[_0xddfc('0x6b')]+_0xddfc('0x6c'),'body':{'to':[_0x1b3192[_0xddfc('0x1f')]],'text':_0x1b3192['body'],'from':_0x200c66[_0xddfc('0x1f')],'applicationId':_0x200c66[_0xddfc('0x6d')]},'headers':{'Authorization':util[_0xddfc('0x40')](_0xddfc('0x42'),new Buffer(_0x4f6c10)[_0xddfc('0x4d')](_0xddfc('0x43')))},'json':!![]};rp(_0x127fef)['then'](function(_0x2e845e){if(_0x2e845e['id']){var _0x21897f={'messageId':_0x2e845e['id']};return _0x15fcb6[_0xddfc('0x18')](_0x21897f);}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x69'),util[_0xddfc('0x28')](_0x2e845e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x123074){logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x69'),util[_0xddfc('0x28')](_0x123074,{'showHidden':![],'depth':null}));});}else{logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x69'),_0xddfc('0x3a'));}break;case _0xddfc('0x6e'):if(_0x200c66[_0xddfc('0x58')]){var _0x276ac4={};var _0xd09c84={'method':_0xddfc('0x34'),'uri':_0xddfc('0x6f'),'headers':{'Authorization':_0xddfc('0x70')+_0x200c66[_0xddfc('0x58')],'Content-Type':_0xddfc('0x53')},'body':{'from':_0x200c66[_0xddfc('0x1f')],'to':_0x1b3192[_0xddfc('0x1f')],'text':_0x1b3192['body']},'json':!![]};return rp(_0xd09c84)[_0xddfc('0x17')](function(_0x4caba3){if(_0x4caba3[_0xddfc('0x71')]==0xca){_0x276ac4[_0xddfc('0x72')]=_0x4caba3;var _0x1a1e23={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xddfc('0x70')+_0x200c66['apiKey'],'Content-Type':_0xddfc('0x53')},'body':{'refid':_0x276ac4[_0xddfc('0x72')]['refid']},'json':!![]};return rp(_0x1a1e23)[_0xddfc('0x17')](function(_0x38787e){_0x276ac4[_0xddfc('0x73')]=_0x38787e;var _0x5acf77={'messageId':_0x276ac4[_0xddfc('0x72')][_0xddfc('0x74')],'read':!![]};return _0x15fcb6[_0xddfc('0x18')](_0x5acf77);});}else{return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x6e'),util[_0xddfc('0x28')](_0x4caba3,{'showHidden':![],'depth':null}));}})[_0xddfc('0x1a')](function(_0x5cb8a1){return logger[_0xddfc('0x29')](_0xddfc('0x2a'),_0xddfc('0x27'),_0xddfc('0x6e'),util['inspect'](_0x5cb8a1,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xddfc('0x2a'),_0xddfc('0x27'),'intelepeer',_0xddfc('0x75'));}break;}}})['finally'](function(){_0x3ddb78();});}else{_0x3ddb78();}}},'charset':'utf8mb4','collate':_0xddfc('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index c30d84f..273d61e 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 _0x2fb1=['http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','options','raw','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x53758c,_0x3f5260){var _0x297de2=function(_0x20e632){while(--_0x20e632){_0x53758c['push'](_0x53758c['shift']());}};_0x297de2(++_0x3f5260);}(_0x2fb1,0x105));var _0x12fb=function(_0x557b76,_0x4fde98){_0x557b76=_0x557b76-0x0;var _0x27ab4f=_0x2fb1[_0x557b76];return _0x27ab4f;};'use strict';var _=require('lodash');var util=require(_0x12fb('0x0'));var moment=require(_0x12fb('0x1'));var BPromise=require(_0x12fb('0x2'));var rs=require(_0x12fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12fb('0x4'))['db'];var utils=require(_0x12fb('0x5'));var logger=require(_0x12fb('0x6'))(_0x12fb('0x7'));var config=require(_0x12fb('0x8'));var jayson=require(_0x12fb('0x9'));var client=jayson[_0x12fb('0xa')][_0x12fb('0xb')]({'port':0x232a});config[_0x12fb('0xc')]=_[_0x12fb('0xd')](config[_0x12fb('0xc')],{'host':_0x12fb('0xe'),'port':0x18eb});var socket=require(_0x12fb('0xf'))(new Redis(config[_0x12fb('0xc')]));require(_0x12fb('0x10'))[_0x12fb('0x11')](socket);function respondWithRpcPromise(_0x10aef3,_0x410249,_0x2df64b){return new BPromise(function(_0x2e47a7,_0xb0501f){return client[_0x12fb('0x12')](_0x10aef3,_0x2df64b)['then'](function(_0x13915b){logger[_0x12fb('0x13')]('SmsMessage,\x20%s,\x20%s',_0x410249,_0x12fb('0x14'));logger[_0x12fb('0x15')](_0x12fb('0x16'),_0x410249,_0x12fb('0x14'),JSON[_0x12fb('0x17')](_0x13915b));if(_0x13915b[_0x12fb('0x18')]){if(_0x13915b[_0x12fb('0x18')]['code']===0x1f4){logger[_0x12fb('0x18')](_0x12fb('0x19'),_0x410249,_0x13915b[_0x12fb('0x18')]['message']);return _0xb0501f(_0x13915b[_0x12fb('0x18')][_0x12fb('0x1a')]);}logger[_0x12fb('0x18')](_0x12fb('0x19'),_0x410249,_0x13915b[_0x12fb('0x18')][_0x12fb('0x1a')]);return _0x2e47a7(_0x13915b[_0x12fb('0x18')][_0x12fb('0x1a')]);}else{logger[_0x12fb('0x13')](_0x12fb('0x19'),_0x410249,_0x12fb('0x14'));_0x2e47a7(_0x13915b[_0x12fb('0x1b')][_0x12fb('0x1a')]);}})[_0x12fb('0x1c')](function(_0x554e13){logger[_0x12fb('0x18')](_0x12fb('0x19'),_0x410249,_0x554e13);_0xb0501f(_0x554e13);});});}exports[_0x12fb('0x1d')]=function(_0x5574a1){var _0x11ac72=this;return new Promise(function(_0xf1eea4,_0x1f4b95){return db[_0x12fb('0x1e')]['create'](_0x5574a1['body'],{'raw':_0x5574a1['options']?_0x5574a1[_0x12fb('0x1f')][_0x12fb('0x20')]===undefined?!![]:![]:!![]})[_0x12fb('0x21')](function(_0x24b5e0){logger[_0x12fb('0x13')]('CreateSmsMessage',_0x5574a1);logger[_0x12fb('0x15')]('CreateSmsMessage',_0x5574a1,JSON[_0x12fb('0x17')](_0x24b5e0));_0xf1eea4(_0x24b5e0);})['catch'](function(_0x1c0822){logger[_0x12fb('0x18')](_0x12fb('0x1d'),_0x1c0822['message'],_0x5574a1);_0x1f4b95(_0x11ac72['error'](0x1f4,_0x1c0822['message']));});});}; \ No newline at end of file +var _0xb254=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','CreateSmsMessage','create','options','raw','debug'];(function(_0x20cc0d,_0x40def4){var _0xbb3b0f=function(_0x77da03){while(--_0x77da03){_0x20cc0d['push'](_0x20cc0d['shift']());}};_0xbb3b0f(++_0x40def4);}(_0xb254,0x182));var _0x4b25=function(_0x5f392a,_0x4374e1){_0x5f392a=_0x5f392a-0x0;var _0x18d0fb=_0xb254[_0x5f392a];return _0x18d0fb;};'use strict';var _=require(_0x4b25('0x0'));var util=require(_0x4b25('0x1'));var moment=require(_0x4b25('0x2'));var BPromise=require(_0x4b25('0x3'));var rs=require(_0x4b25('0x4'));var fs=require('fs');var Redis=require(_0x4b25('0x5'));var db=require(_0x4b25('0x6'))['db'];var utils=require(_0x4b25('0x7'));var logger=require('../../config/logger')(_0x4b25('0x8'));var config=require(_0x4b25('0x9'));var jayson=require(_0x4b25('0xa'));var client=jayson[_0x4b25('0xb')][_0x4b25('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4b25('0xd')],{'host':_0x4b25('0xe'),'port':0x18eb});var socket=require(_0x4b25('0xf'))(new Redis(config[_0x4b25('0xd')]));require(_0x4b25('0x10'))[_0x4b25('0x11')](socket);function respondWithRpcPromise(_0x9e2fae,_0xb87327,_0x2d4889){return new BPromise(function(_0x47054d,_0x125788){return client[_0x4b25('0x12')](_0x9e2fae,_0x2d4889)[_0x4b25('0x13')](function(_0x511378){logger[_0x4b25('0x14')]('SmsMessage,\x20%s,\x20%s',_0xb87327,_0x4b25('0x15'));logger['debug'](_0x4b25('0x16'),_0xb87327,_0x4b25('0x15'),JSON[_0x4b25('0x17')](_0x511378));if(_0x511378['error']){if(_0x511378[_0x4b25('0x18')][_0x4b25('0x19')]===0x1f4){logger[_0x4b25('0x18')]('SmsMessage,\x20%s,\x20%s',_0xb87327,_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);return _0x125788(_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);}logger[_0x4b25('0x18')](_0x4b25('0x1b'),_0xb87327,_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);return _0x47054d(_0x511378[_0x4b25('0x18')][_0x4b25('0x1a')]);}else{logger[_0x4b25('0x14')](_0x4b25('0x1b'),_0xb87327,_0x4b25('0x15'));_0x47054d(_0x511378[_0x4b25('0x1c')][_0x4b25('0x1a')]);}})['catch'](function(_0x3b67e7){logger[_0x4b25('0x18')](_0x4b25('0x1b'),_0xb87327,_0x3b67e7);_0x125788(_0x3b67e7);});});}exports[_0x4b25('0x1d')]=function(_0x392298){var _0x385f54=this;return new Promise(function(_0x37e03b,_0x42a6a5){return db['SmsMessage'][_0x4b25('0x1e')](_0x392298['body'],{'raw':_0x392298['options']?_0x392298[_0x4b25('0x1f')][_0x4b25('0x20')]===undefined?!![]:![]:!![]})[_0x4b25('0x13')](function(_0x2c56fc){logger[_0x4b25('0x14')](_0x4b25('0x1d'),_0x392298);logger[_0x4b25('0x21')](_0x4b25('0x1d'),_0x392298,JSON[_0x4b25('0x17')](_0x2c56fc));_0x37e03b(_0x2c56fc);})[_0x4b25('0x22')](function(_0x792e67){logger[_0x4b25('0x18')](_0x4b25('0x1d'),_0x792e67['message'],_0x392298);_0x42a6a5(_0x385f54[_0x4b25('0x18')](0x1f4,_0x792e67[_0x4b25('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4729bff..c641e6b 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 _0x0c29=['removeListener','length','./smsMessage.events','save','update','emit'];(function(_0x15802c,_0x240be6){var _0x33d406=function(_0x5d8478){while(--_0x5d8478){_0x15802c['push'](_0x15802c['shift']());}};_0x33d406(++_0x240be6);}(_0x0c29,0xe0));var _0x90c2=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0x0c29[_0x45346d];return _0x5ce7ca;};'use strict';var SmsMessageEvents=require(_0x90c2('0x0'));var events=[_0x90c2('0x1'),'remove',_0x90c2('0x2')];function createListener(_0x450f90,_0x5838ab){return function(_0x4fd0db){_0x5838ab[_0x90c2('0x3')](_0x450f90,_0x4fd0db);};}function removeListener(_0x47879b,_0x2fee3a){return function(){SmsMessageEvents[_0x90c2('0x4')](_0x47879b,_0x2fee3a);};}exports['register']=function(_0x302d60){for(var _0x53a969=0x0,_0x516b32=events[_0x90c2('0x5')];_0x53a969<_0x516b32;_0x53a969++){var _0x149c15=events[_0x53a969];var _0x3ee8b4=createListener('smsMessage:'+_0x149c15,_0x302d60);SmsMessageEvents['on'](_0x149c15,_0x3ee8b4);}}; \ No newline at end of file +var _0xccd9=['length','remove','update','emit'];(function(_0x51888b,_0x1fb992){var _0x43ad21=function(_0x2b68e9){while(--_0x2b68e9){_0x51888b['push'](_0x51888b['shift']());}};_0x43ad21(++_0x1fb992);}(_0xccd9,0x191));var _0x9ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd9[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x9ccd('0x0'),_0x9ccd('0x1')];function createListener(_0x39343b,_0x5e863d){return function(_0x174ac9){_0x5e863d[_0x9ccd('0x2')](_0x39343b,_0x174ac9);};}function removeListener(_0x3ab764,_0x33ee86){return function(){SmsMessageEvents['removeListener'](_0x3ab764,_0x33ee86);};}exports['register']=function(_0xb86921){for(var _0x125e33=0x0,_0x7d6b20=events[_0x9ccd('0x3')];_0x125e33<_0x7d6b20;_0x125e33++){var _0x79f9fa=events[_0x125e33];var _0x284adf=createListener('smsMessage:'+_0x79f9fa,_0xb86921);SmsMessageEvents['on'](_0x79f9fa,_0x284adf);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index cb83704..e5174d7 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 _0x0969=['./smsQueue.controller','index','get','/describe','isAuthenticated','show','getMembers','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','/:id','update','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x470e67,_0x4a596d){var _0x28bbde=function(_0x1bbf56){while(--_0x1bbf56){_0x470e67['push'](_0x470e67['shift']());}};_0x28bbde(++_0x4a596d);}(_0x0969,0x10f));var _0x9096=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x0969[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x9096('0x0'));var util=require(_0x9096('0x1'));var path=require('path');var timeout=require(_0x9096('0x2'));var express=require(_0x9096('0x3'));var router=express[_0x9096('0x4')]();var fs_extra=require(_0x9096('0x5'));var auth=require(_0x9096('0x6'));var interaction=require(_0x9096('0x7'));var config=require(_0x9096('0x8'));var controller=require(_0x9096('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9096('0xa')]);router[_0x9096('0xb')](_0x9096('0xc'),auth[_0x9096('0xd')](),controller['describe']);router[_0x9096('0xb')]('/:id',auth[_0x9096('0xd')](),controller[_0x9096('0xe')]);router[_0x9096('0xb')]('/:id/members',auth[_0x9096('0xd')](),controller[_0x9096('0xf')]);router[_0x9096('0xb')](_0x9096('0x10'),auth['isAuthenticated'](),controller[_0x9096('0x11')]);router[_0x9096('0xb')](_0x9096('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0x9096('0x13')]('/',auth[_0x9096('0xd')](),controller[_0x9096('0x14')]);router[_0x9096('0x13')](_0x9096('0x10'),auth[_0x9096('0xd')](),controller['addTeams']);router['post']('/:id/users',auth[_0x9096('0xd')](),controller[_0x9096('0x15')]);router[_0x9096('0x16')](_0x9096('0x17'),auth[_0x9096('0xd')](),controller[_0x9096('0x18')]);router[_0x9096('0x19')]('/:id',auth[_0x9096('0xd')](),controller['destroy']);router['delete'](_0x9096('0x10'),auth[_0x9096('0xd')](),controller['removeTeams']);router['delete'](_0x9096('0x12'),auth[_0x9096('0xd')](),controller[_0x9096('0x1a')]);module[_0x9096('0x1b')]=router; \ No newline at end of file +var _0xf072=['update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','put'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0xf072,0xb3));var _0x2f07=function(_0x23e5a8,_0x1a32d0){_0x23e5a8=_0x23e5a8-0x0;var _0x39df93=_0xf072[_0x23e5a8];return _0x39df93;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require(_0x2f07('0x3'));var express=require(_0x2f07('0x4'));var router=express['Router']();var fs_extra=require(_0x2f07('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2f07('0x6'));var config=require(_0x2f07('0x7'));var controller=require(_0x2f07('0x8'));router[_0x2f07('0x9')]('/',auth[_0x2f07('0xa')](),controller['index']);router['get'](_0x2f07('0xb'),auth[_0x2f07('0xa')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x9')](_0x2f07('0xd'),auth['isAuthenticated'](),controller[_0x2f07('0xe')]);router[_0x2f07('0x9')](_0x2f07('0xf'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x10')]);router[_0x2f07('0x9')]('/:id/teams',auth[_0x2f07('0xa')](),controller[_0x2f07('0x11')]);router['get'](_0x2f07('0x12'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f07('0x14')]);router[_0x2f07('0x15')](_0x2f07('0x16'),auth['isAuthenticated'](),controller['addTeams']);router[_0x2f07('0x15')](_0x2f07('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2f07('0x17')](_0x2f07('0xd'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x18')]);router[_0x2f07('0x19')]('/:id',auth[_0x2f07('0xa')](),controller[_0x2f07('0x1a')]);router[_0x2f07('0x19')](_0x2f07('0x16'),auth[_0x2f07('0xa')](),controller[_0x2f07('0x1b')]);router[_0x2f07('0x19')](_0x2f07('0x12'),auth[_0x2f07('0xa')](),controller['removeAgents']);module[_0x2f07('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index a0ca7ff..f853cf2 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 _0xe550=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xbf3369,_0x53c50a){var _0x4d35ce=function(_0x100c4f){while(--_0x100c4f){_0xbf3369['push'](_0xbf3369['shift']());}};_0x4d35ce(++_0x53c50a);}(_0xe550,0x18a));var _0x0e55=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe550[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0e55('0x0'));module[_0x0e55('0x1')]={'name':{'type':Sequelize[_0x0e55('0x2')],'unique':_0x0e55('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0e55('0x2')]},'timeout':{'type':Sequelize[_0x0e55('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0e55('0x5')](_0x0e55('0x6'),'beepall',_0x0e55('0x7'))}}; \ No newline at end of file +var _0x14b8=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x11c0cb,_0x4476aa){var _0x3dbf20=function(_0x58f366){while(--_0x58f366){_0x11c0cb['push'](_0x11c0cb['shift']());}};_0x3dbf20(++_0x4476aa);}(_0x14b8,0xe2));var _0x814b=function(_0x5e4f2f,_0x163926){_0x5e4f2f=_0x5e4f2f-0x0;var _0x58137d=_0x14b8[_0x5e4f2f];return _0x58137d;};'use strict';var Sequelize=require(_0x814b('0x0'));module[_0x814b('0x1')]={'name':{'type':Sequelize[_0x814b('0x2')],'unique':_0x814b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x814b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x814b('0x5')](_0x814b('0x6'),_0x814b('0x7'),_0x814b('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a417e45..2662e50 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 _0x7a54=['transaction','addTeams','each','findOrCreate','userSmsQueue:save','removeTeams','Team','select','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','QueryTypes','SELECT','every','includes','all','compact','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','emit','removeAgents','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','SmsQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','SmsQueue','include','rows','catch','show','params','model','query','intersection','fields','attributes','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','limit','order','sort','filters','pick','filter','User','UserId','createdAt','format','%s/%s','smsPause','getTeams','keys','nolimit','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x4474ea,_0x46a29d){var _0x5aae20=function(_0x29cec7){while(--_0x29cec7){_0x4474ea['push'](_0x4474ea['shift']());}};_0x5aae20(++_0x46a29d);}(_0x7a54,0x106));var _0x47a5=function(_0x625e14,_0x563431){_0x625e14=_0x625e14-0x0;var _0x105943=_0x7a54[_0x625e14];return _0x105943;};'use strict';var BPromise=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var squel=require('squel');var Redis=require(_0x47a5('0x3'));var qs=require(_0x47a5('0x4'));var logger=require('../../config/logger')(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var db=require(_0x47a5('0x7'))['db'];config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));require(_0x47a5('0xb'))['register'](socket);function respondWithStatusCode(_0x194fb0,_0x5077f3){_0x5077f3=_0x5077f3||0xcc;return function(_0x5d90b3){if(_0x5d90b3){return _0x194fb0['sendStatus'](_0x5077f3);}return _0x194fb0[_0x47a5('0xc')](_0x5077f3)[_0x47a5('0xd')]();};}function respondWithResult(_0x5e31dd,_0x2eb0dd){_0x2eb0dd=_0x2eb0dd||0xc8;return function(_0x49e844){if(_0x49e844){return _0x5e31dd['status'](_0x2eb0dd)[_0x47a5('0xe')](_0x49e844);}};}function respondWithFilteredResult(_0x69e4d4,_0x2f399b){return function(_0x250fad){if(_0x250fad){var _0xd612dd=typeof _0x2f399b[_0x47a5('0xf')]===_0x47a5('0x10')&&typeof _0x2f399b['limit']===_0x47a5('0x10');var _0x221b54=_0x250fad[_0x47a5('0x11')];var _0x711793=_0xd612dd?0x0:_0x2f399b[_0x47a5('0xf')];var _0x620ee9=_0xd612dd?_0x250fad[_0x47a5('0x11')]:_0x2f399b[_0x47a5('0xf')]+_0x2f399b['limit'];var _0x362359;if(_0x620ee9>=_0x221b54){_0x620ee9=_0x221b54;_0x362359=0xc8;}else{_0x362359=0xce;}_0x69e4d4[_0x47a5('0xc')](_0x362359);return _0x69e4d4[_0x47a5('0x12')](_0x47a5('0x13'),_0x711793+'-'+_0x620ee9+'/'+_0x221b54)[_0x47a5('0xe')](_0x250fad);}return null;};}function saveUpdates(_0x574af6){return function(_0x549de3){if(_0x549de3){return _0x549de3[_0x47a5('0x14')](_0x574af6)['then'](function(_0x5247fd){return _0x5247fd;});}return null;};}function removeEntity(_0x423a81){return function(_0xaf70a6){if(_0xaf70a6){return _0xaf70a6[_0x47a5('0x15')]()[_0x47a5('0x16')](function(){var _0x477b1d=_0xaf70a6[_0x47a5('0x17')]({'plain':!![]});var _0x2763d6=_0x47a5('0x18');return db[_0x47a5('0x19')]['destroy']({'where':{'type':_0x2763d6,'resourceId':_0x477b1d['id']}})[_0x47a5('0x16')](function(){return _0xaf70a6;});})[_0x47a5('0x16')](function(){_0x423a81['status'](0xcc)[_0x47a5('0xd')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1a')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1b')]){delete _0x23db32[_0x47a5('0x1b')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1c')](_0x23db32);};}exports[_0x47a5('0x1d')]=function(_0x4437f1,_0x129ce5){var _0x3abd6a={};var _0x50bf17={'count':0x0,'rows':[]};var _0x53078a=_[_0x47a5('0x1e')](db['SmsQueue'][_0x47a5('0x1f')],function(_0x5b6c4e){return{'name':_0x5b6c4e[_0x47a5('0x20')],'type':_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x22')]};});_0x3abd6a=qs[_0x47a5('0x23')](_0x53078a,_0x4437f1);var _0x21f296={'where':_0x3abd6a[_0x47a5('0x24')]};return db[_0x47a5('0x25')][_0x47a5('0x11')](_0x21f296)[_0x47a5('0x16')](function(_0x361bfa){_0x50bf17[_0x47a5('0x11')]=_0x361bfa;_0x3abd6a[_0x47a5('0x26')]=qs[_0x47a5('0x26')](_0x4437f1['query']);return db[_0x47a5('0x25')]['findAll'](_0x3abd6a);})[_0x47a5('0x16')](function(_0x9ac908){_0x50bf17[_0x47a5('0x27')]=_0x9ac908;return _0x50bf17;})['then'](respondWithFilteredResult(_0x129ce5,_0x3abd6a))[_0x47a5('0x28')](handleError(_0x129ce5,null));};exports[_0x47a5('0x29')]=function(_0x39b50b,_0x1f1c68){var _0x51cc81={'raw':!![],'where':{'id':_0x39b50b[_0x47a5('0x2a')]['id']}},_0x50d875={};_0x50d875[_0x47a5('0x2b')]=_['keys'](db['SmsQueue'][_0x47a5('0x1f')]);_0x50d875[_0x47a5('0x2c')]=_['keys'](_0x39b50b[_0x47a5('0x2c')]);_0x50d875['filters']=_[_0x47a5('0x2d')](_0x50d875[_0x47a5('0x2b')],_0x50d875['query']);_0x51cc81['attributes']=_[_0x47a5('0x2d')](_0x50d875['model'],qs[_0x47a5('0x2e')](_0x39b50b[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x51cc81['attributes']=_0x51cc81[_0x47a5('0x2f')]['length']?_0x51cc81['attributes']:_0x50d875[_0x47a5('0x2b')];if(_0x39b50b['query'][_0x47a5('0x30')]){_0x51cc81['include']=[{'all':!![]}];}_0x51cc81=_[_0x47a5('0x31')]({},_0x51cc81,_0x39b50b[_0x47a5('0x32')]);return db[_0x47a5('0x25')][_0x47a5('0x33')](_0x51cc81)[_0x47a5('0x16')](handleEntityNotFound(_0x1f1c68,null))[_0x47a5('0x16')](respondWithResult(_0x1f1c68,null))[_0x47a5('0x28')](handleError(_0x1f1c68,null));};exports[_0x47a5('0x34')]=function(_0x1a0d23,_0x4caed5){return db[_0x47a5('0x25')][_0x47a5('0x34')](_0x1a0d23['body'],{})[_0x47a5('0x16')](function(_0x2bf53d){var _0x1d4348=_0x1a0d23['user'][_0x47a5('0x17')]({'plain':!![]});if(!_0x1d4348)throw new Error(_0x47a5('0x35'));if(_0x1d4348['role']===_0x47a5('0x36')){var _0x19218a=_0x2bf53d['get']({'plain':!![]});var _0x55c5eb='SmsQueues';return db[_0x47a5('0x37')]['find']({'where':{'name':_0x55c5eb,'userProfileId':_0x1d4348[_0x47a5('0x38')]},'raw':!![]})[_0x47a5('0x16')](function(_0x301a85){if(_0x301a85&&_0x301a85[_0x47a5('0x39')]===0x0){return db[_0x47a5('0x19')][_0x47a5('0x34')]({'name':_0x19218a[_0x47a5('0x1b')],'resourceId':_0x19218a['id'],'type':_0x301a85[_0x47a5('0x1b')],'sectionId':_0x301a85['id']},{})[_0x47a5('0x16')](function(){return _0x2bf53d;});}else{return _0x2bf53d;}})[_0x47a5('0x28')](function(_0x280500){logger[_0x47a5('0x1a')](_0x47a5('0x3a'),_0x280500);throw _0x280500;});}return _0x2bf53d;})['then'](respondWithResult(_0x4caed5,0xc9))[_0x47a5('0x28')](handleError(_0x4caed5,null));};exports[_0x47a5('0x14')]=function(_0x331474,_0x23bd8d){if(_0x331474['body']['id']){delete _0x331474[_0x47a5('0x3b')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x331474['params']['id']}})['then'](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x16')](saveUpdates(_0x331474['body'],null))[_0x47a5('0x16')](respondWithResult(_0x23bd8d,null))[_0x47a5('0x28')](handleError(_0x23bd8d,null));};exports[_0x47a5('0x15')]=function(_0x494526,_0x3805fd){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x494526['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3805fd,null))['then'](removeEntity(_0x3805fd,null))[_0x47a5('0x28')](handleError(_0x3805fd,null));};exports[_0x47a5('0x3c')]=function(_0x188614,_0xd75ca3){return db[_0x47a5('0x25')][_0x47a5('0x3c')]()[_0x47a5('0x16')](respondWithResult(_0xd75ca3,null))[_0x47a5('0x28')](handleError(_0xd75ca3,null));};exports[_0x47a5('0x3d')]=function(_0x162fa0,_0x24ecb1){var _0x3c3ebf={'raw':!![],'where':{}},_0xe28d76={},_0x3574d4;return db[_0x47a5('0x25')][_0x47a5('0x3e')]({'where':{'id':_0x162fa0['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x24ecb1,null))[_0x47a5('0x16')](function(_0x49eab1){if(_0x49eab1){_0x3574d4=_0x49eab1['get']({'plain':!![]});_0xe28d76[_0x47a5('0x2b')]=_['keys'](db[_0x47a5('0x3f')][_0x47a5('0x1f')]);_0xe28d76['query']=_['keys'](_0x162fa0[_0x47a5('0x2c')]);_0xe28d76['filters']=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],_0xe28d76[_0x47a5('0x2c')]);_0x3c3ebf[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0xe28d76[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x162fa0['query']['fields']));_0x3c3ebf[_0x47a5('0x2f')]=_0x3c3ebf[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x3c3ebf[_0x47a5('0x2f')]:_0xe28d76[_0x47a5('0x2b')];if(!_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x41')]('nolimit')){_0x3c3ebf[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x162fa0[_0x47a5('0x2c')]['limit']);_0x3c3ebf[_0x47a5('0xf')]=qs['offset'](_0x162fa0[_0x47a5('0x2c')][_0x47a5('0xf')]);}_0x3c3ebf[_0x47a5('0x43')]=qs[_0x47a5('0x44')](_0x162fa0['query'][_0x47a5('0x44')]);_0x3c3ebf[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_[_0x47a5('0x46')](_0x162fa0[_0x47a5('0x2c')],_0xe28d76[_0x47a5('0x45')]));_0x3c3ebf[_0x47a5('0x24')]['SmsQueueId']=_0x49eab1['id'];if(_0x162fa0[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x3c3ebf[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x3c3ebf[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x3c3ebf['attributes'],function(_0x1ad6a9){var _0x245a15={};_0x245a15[_0x1ad6a9]={'$like':'%'+_0x162fa0[_0x47a5('0x2c')]['filter']+'%'};return _0x245a15;})});}_0x3c3ebf=_[_0x47a5('0x31')]({},_0x3c3ebf,_0x162fa0[_0x47a5('0x32')]);return db[_0x47a5('0x3f')]['findAll'](_0x3c3ebf);}})['then'](function(_0x274e38){if(_0x274e38){return db[_0x47a5('0x48')]['findAndCountAll']({'where':{'id':_['map'](_0x274e38,_0x47a5('0x49')),'role':'agent'},'attributes':['id',_0x47a5('0x1b'),'smsPause','updatedAt',_0x47a5('0x4a')]});}})[_0x47a5('0x16')](function(_0x53eedf){if(_0x53eedf){return{'count':_0x53eedf[_0x47a5('0x11')],'rows':_[_0x47a5('0x1e')](_0x53eedf['rows'],function(_0x5b6127){return{'membername':_0x5b6127[_0x47a5('0x1b')],'UserId':_0x5b6127['id'],'queue_name':_0x3574d4[_0x47a5('0x1b')],'SmsQueueId':_0x3574d4['id'],'interface':util[_0x47a5('0x4b')](_0x47a5('0x4c'),'SIP',_0x5b6127[_0x47a5('0x1b')]),'penalty':0x0,'paused':_0x5b6127[_0x47a5('0x4d')],'createdAt':_0x5b6127[_0x47a5('0x4a')],'updatedAt':_0x5b6127['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x47a5('0x16')](respondWithFilteredResult(_0x24ecb1,_0x3c3ebf))['catch'](handleError(_0x24ecb1,null));};exports[_0x47a5('0x4e')]=function(_0x470da6,_0x943a15){var _0x1c485b={};var _0x3603b7={};var _0x4966af;var _0x144af9;return db['SmsQueue']['findOne']({'where':{'id':_0x470da6['params']['id']}})['then'](handleEntityNotFound(_0x943a15,null))[_0x47a5('0x16')](function(_0x6cd4ea){if(_0x6cd4ea){_0x4966af=_0x6cd4ea;_0x3603b7[_0x47a5('0x2b')]=_['keys'](db['Team'][_0x47a5('0x1f')]);_0x3603b7[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x470da6[_0x47a5('0x2c')]);_0x3603b7[_0x47a5('0x45')]=_['intersection'](_0x3603b7[_0x47a5('0x2b')],_0x3603b7['query']);_0x1c485b[_0x47a5('0x2f')]=_[_0x47a5('0x2d')](_0x3603b7['model'],qs[_0x47a5('0x2e')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x1c485b[_0x47a5('0x2f')]=_0x1c485b[_0x47a5('0x2f')][_0x47a5('0x40')]?_0x1c485b[_0x47a5('0x2f')]:_0x3603b7[_0x47a5('0x2b')];_0x1c485b['order']=qs[_0x47a5('0x44')](_0x470da6[_0x47a5('0x2c')][_0x47a5('0x44')]);_0x1c485b[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x470da6[_0x47a5('0x2c')],_0x3603b7[_0x47a5('0x45')]));if(_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x1c485b[_0x47a5('0x24')]=_[_0x47a5('0x31')](_0x1c485b[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x1c485b[_0x47a5('0x2f')],function(_0x44cb90){var _0x1d56f3={};_0x1d56f3[_0x44cb90]={'$like':'%'+_0x470da6[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x1d56f3;})});}_0x1c485b=_[_0x47a5('0x31')]({},_0x1c485b,_0x470da6[_0x47a5('0x32')]);return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x284fb8){if(_0x284fb8){_0x144af9=_0x284fb8[_0x47a5('0x40')];if(!_0x470da6['query'][_0x47a5('0x41')](_0x47a5('0x50'))){_0x1c485b[_0x47a5('0x42')]=qs[_0x47a5('0x42')](_0x470da6['query'][_0x47a5('0x42')]);_0x1c485b['offset']=qs[_0x47a5('0xf')](_0x470da6['query'][_0x47a5('0xf')]);}return _0x4966af['getTeams'](_0x1c485b);}})[_0x47a5('0x16')](function(_0x2f27c3){if(_0x2f27c3){return _0x2f27c3?{'count':_0x144af9,'rows':_0x2f27c3}:null;}})[_0x47a5('0x16')](respondWithResult(_0x943a15,null))['catch'](handleError(_0x943a15,null));};exports['addTeams']=function(_0x4b8084,_0x4164a3){var _0x2b1303=_0x4b8084[_0x47a5('0x3b')][_0x47a5('0x51')];return db['Team'][_0x47a5('0x52')]({'where':{'id':_0x2b1303},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id',_0x47a5('0x1b'),_0x47a5('0x54'),_0x47a5('0x55'),_0x47a5('0x56')],'raw':!![]}]})[_0x47a5('0x16')](function(_0x4618a0){if(_0x4618a0){var _0xc69a68=_[_0x47a5('0x57')](_0x4618a0,function(_0x463e5e){var _0x49d3dc=_0x463e5e[_0x47a5('0x17')]({'plain':!![]});return _0x49d3dc['Agents'];});return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x4b8084[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x40e584){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x448981){return _0x40e584[_0x47a5('0x5a')](_0x2b1303,{'transaction':_0x448981})[_0x47a5('0x16')](function(){return BPromise[_0x47a5('0x5b')](_0xc69a68,function(_0x1f07ac){return db[_0x47a5('0x3f')][_0x47a5('0x5c')]({'where':{'UserId':_0x1f07ac['id'],'SmsQueueId':_0x4b8084[_0x47a5('0x2a')]['id']},'transaction':_0x448981});});})['then'](function(){_0xc69a68['forEach'](function(_0x5ccc89){socket['emit'](_0x47a5('0x5d'),{'UserId':_0x5ccc89['id'],'SmsQueueId':_0x40e584['id']});});});});});}})[_0x47a5('0x16')](respondWithStatusCode(_0x4164a3,null))['catch'](handleError(_0x4164a3,null));};exports[_0x47a5('0x5e')]=function(_0x44dda2,_0x1baa5a){return db[_0x47a5('0x5f')][_0x47a5('0x52')]({'where':{'id':_0x44dda2[_0x47a5('0x2c')][_0x47a5('0x51')]},'attributes':['id'],'include':[{'model':db[_0x47a5('0x48')],'as':_0x47a5('0x53'),'attributes':['id'],'raw':!![]}]})[_0x47a5('0x16')](handleEntityNotFound(_0x1baa5a,null))[_0x47a5('0x16')](function(_0x5e5f16){var _0x18fa31=_[_0x47a5('0x1e')](_0x5e5f16,'id');var _0x420671=[];var _0x4f35ff=[];var _0x340846=squel[_0x47a5('0x60')]();_0x340846[_0x47a5('0x61')]('tq.TeamId')[_0x47a5('0x62')]('team_has_sms_queues','tq')['join'](_0x47a5('0x63'),'ut',_0x47a5('0x64'))[_0x47a5('0x24')](_0x47a5('0x65'),_0x44dda2[_0x47a5('0x2a')]['id']);for(var _0xea50f3=0x0;_0xea50f3<_0x5e5f16['length'];_0xea50f3+=0x1){let _0x592322=_0x5e5f16[_0xea50f3];for(var _0x3e0dbd=0x0;_0x3e0dbd<_0x592322['Agents'][_0x47a5('0x40')];_0x3e0dbd+=0x1){let _0x3fffd1=_0x592322[_0x47a5('0x53')][_0x3e0dbd];var _0xb16bdd=_0x340846['clone']();_0xb16bdd[_0x47a5('0x24')]('ut.UserId\x20=\x20?',_0x3fffd1['id']);_0x4f35ff['push'](db[_0x47a5('0x58')][_0x47a5('0x2c')](_0xb16bdd['toString'](),{'type':db[_0x47a5('0x58')][_0x47a5('0x66')][_0x47a5('0x67')]})['then'](function(_0x280372){if(_0x280372['length']===0x1){return _0x3fffd1['id'];}else{var _0x2307da=_[_0x47a5('0x68')](_[_0x47a5('0x1e')](_0x280372,'TeamId'),function(_0x2e0af1){return _[_0x47a5('0x69')](_0x18fa31,_0x2e0af1);});if(_0x2307da){return _0x3fffd1['id'];}}}));}}return BPromise[_0x47a5('0x6a')](_0x4f35ff)['then'](function(_0x3525e7){_0x420671=_(_0x420671)['union'](_0x3525e7)[_0x47a5('0x6b')]()['value']();return db[_0x47a5('0x25')][_0x47a5('0x33')]({'where':{'id':_0x44dda2[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](function(_0x51738b){return db[_0x47a5('0x58')][_0x47a5('0x59')](function(_0x23c393){return _0x51738b[_0x47a5('0x5e')](_0x44dda2[_0x47a5('0x2c')]['ids'],{'transaction':_0x23c393})['then'](function(){if(!_[_0x47a5('0x6c')](_0x420671)){return _0x51738b['removeAgents'](_0x420671,{'transaction':_0x23c393});}})[_0x47a5('0x16')](function(){_0x420671[_0x47a5('0x6d')](function(_0x216402){socket['emit'](_0x47a5('0x6e'),{'UserId':_0x216402,'SmsQueueId':_0x51738b['id']});});});});});});})[_0x47a5('0x16')](respondWithStatusCode(_0x1baa5a,null))['catch'](handleError(_0x1baa5a,null));};exports[_0x47a5('0x6f')]=function(_0x8a9dea,_0x19acfa){return db[_0x47a5('0x25')]['find']({'where':{'id':_0x8a9dea['params']['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x19acfa,null))[_0x47a5('0x16')](function(_0x48e7f3){if(_0x48e7f3){return _0x48e7f3[_0x47a5('0x6f')](_0x8a9dea[_0x47a5('0x3b')]['ids'],_[_0x47a5('0x70')](_0x8a9dea[_0x47a5('0x3b')],[_0x47a5('0x51'),'id'])||{})['spread'](function(_0x3f2ad9){for(var _0x59b4a5=0x0;_0x59b4a5<_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x47a5('0x40')];_0x59b4a5+=0x1){socket[_0x47a5('0x71')]('userSmsQueue:save',{'UserId':Number(_0x8a9dea[_0x47a5('0x3b')]['ids'][_0x59b4a5]),'SmsQueueId':Number(_0x8a9dea[_0x47a5('0x2a')]['id'])});}return _0x3f2ad9;});}})[_0x47a5('0x16')](respondWithResult(_0x19acfa,null))[_0x47a5('0x28')](handleError(_0x19acfa,null));};exports[_0x47a5('0x72')]=function(_0x49b76a,_0x3eb5c1){return db['SmsQueue']['find']({'where':{'id':_0x49b76a[_0x47a5('0x2a')]['id']}})[_0x47a5('0x16')](handleEntityNotFound(_0x3eb5c1,null))[_0x47a5('0x16')](function(_0x96fb22){if(_0x96fb22){return _0x96fb22[_0x47a5('0x72')](_0x49b76a['query'][_0x47a5('0x51')])[_0x47a5('0x16')](function(){if(_[_0x47a5('0x73')](_0x49b76a[_0x47a5('0x2c')]['ids'])){for(var _0x240db9=0x0;_0x240db9<_0x49b76a['query'][_0x47a5('0x51')][_0x47a5('0x40')];_0x240db9+=0x1){socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a[_0x47a5('0x2c')][_0x47a5('0x51')][_0x240db9]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}}else{socket[_0x47a5('0x71')](_0x47a5('0x6e'),{'UserId':Number(_0x49b76a['query'][_0x47a5('0x51')]),'SmsQueueId':Number(_0x49b76a[_0x47a5('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3eb5c1,null))[_0x47a5('0x28')](handleError(_0x3eb5c1,null));};exports[_0x47a5('0x74')]=function(_0x6d6a5,_0x5b85cd){var _0x4bf1f5={};var _0x126bb1={};var _0x3d7371;var _0x47fbb6;return db['SmsQueue'][_0x47a5('0x3e')]({'where':{'id':_0x6d6a5[_0x47a5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x16')](function(_0x269ff6){if(_0x269ff6){_0x3d7371=_0x269ff6;_0x126bb1['model']=_[_0x47a5('0x4f')](db[_0x47a5('0x48')][_0x47a5('0x1f')]);_0x126bb1[_0x47a5('0x2c')]=_[_0x47a5('0x4f')](_0x6d6a5[_0x47a5('0x2c')]);_0x126bb1['filters']=_['intersection'](_0x126bb1['model'],_0x126bb1[_0x47a5('0x2c')]);_0x4bf1f5[_0x47a5('0x2f')]=_['intersection'](_0x126bb1[_0x47a5('0x2b')],qs[_0x47a5('0x2e')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x2e')]));_0x4bf1f5[_0x47a5('0x2f')]=_0x4bf1f5['attributes'][_0x47a5('0x40')]?_0x4bf1f5['attributes']:_0x126bb1['model'];_0x4bf1f5['order']=qs[_0x47a5('0x44')](_0x6d6a5['query'][_0x47a5('0x44')]);_0x4bf1f5[_0x47a5('0x24')]=qs[_0x47a5('0x45')](_['pick'](_0x6d6a5[_0x47a5('0x2c')],_0x126bb1[_0x47a5('0x45')]));if(_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]){_0x4bf1f5[_0x47a5('0x24')]=_['merge'](_0x4bf1f5[_0x47a5('0x24')],{'$or':_[_0x47a5('0x1e')](_0x4bf1f5['attributes'],function(_0x42ba59){var _0x419870={};_0x419870[_0x42ba59]={'$like':'%'+_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x47')]+'%'};return _0x419870;})});}_0x4bf1f5=_[_0x47a5('0x31')]({},_0x4bf1f5,_0x6d6a5[_0x47a5('0x32')]);return _0x3d7371['getAgents'](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x2e418d){if(_0x2e418d){_0x47fbb6=_0x2e418d['length'];if(!_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0x41')](_0x47a5('0x50'))){_0x4bf1f5[_0x47a5('0x42')]=qs['limit'](_0x6d6a5['query']['limit']);_0x4bf1f5['offset']=qs[_0x47a5('0xf')](_0x6d6a5[_0x47a5('0x2c')][_0x47a5('0xf')]);}return _0x3d7371[_0x47a5('0x74')](_0x4bf1f5);}})[_0x47a5('0x16')](function(_0x6bc37b){if(_0x6bc37b){return _0x6bc37b?{'count':_0x47fbb6,'rows':_0x6bc37b}:null;}})[_0x47a5('0x16')](respondWithResult(_0x5b85cd,null))[_0x47a5('0x28')](handleError(_0x5b85cd,null));}; \ No newline at end of file +var _0x5f66=['show','params','model','keys','intersection','attributes','fields','includeAll','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rawAttributes','filters','hasOwnProperty','order','sort','pick','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','length','filter','nolimit','ids','Team','Agents','interface','flatMap','sequelize','transaction','addTeams','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','findOne','getAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','./smsQueue.socket','register','end','json','offset','limit','undefined','count','status','update','then','UserProfileResource','destroy','sendStatus','stack','name','send','index','fieldName','key','getOptions','where','SmsQueue','include','query','findAll','catch'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var BPromise=require('bluebird');var util=require(_0x65f6('0x0'));var _=require('lodash');var squel=require(_0x65f6('0x1'));var Redis=require(_0x65f6('0x2'));var qs=require(_0x65f6('0x3'));var logger=require(_0x65f6('0x4'))(_0x65f6('0x5'));var config=require('../../config/environment');var db=require(_0x65f6('0x6'))['db'];config['redis']=_[_0x65f6('0x7')](config[_0x65f6('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f6('0x8')]));require(_0x65f6('0x9'))[_0x65f6('0xa')](socket);function respondWithStatusCode(_0x8f6451,_0xc44c70){_0xc44c70=_0xc44c70||0xcc;return function(_0x14f4c7){if(_0x14f4c7){return _0x8f6451['sendStatus'](_0xc44c70);}return _0x8f6451['status'](_0xc44c70)[_0x65f6('0xb')]();};}function respondWithResult(_0x2f6d5b,_0x264647){_0x264647=_0x264647||0xc8;return function(_0x25c416){if(_0x25c416){return _0x2f6d5b['status'](_0x264647)[_0x65f6('0xc')](_0x25c416);}};}function respondWithFilteredResult(_0x571436,_0x497cf3){return function(_0x2d2dfa){if(_0x2d2dfa){var _0x576875=typeof _0x497cf3[_0x65f6('0xd')]==='undefined'&&typeof _0x497cf3[_0x65f6('0xe')]===_0x65f6('0xf');var _0x2c4ee5=_0x2d2dfa[_0x65f6('0x10')];var _0x369f96=_0x576875?0x0:_0x497cf3[_0x65f6('0xd')];var _0x44144b=_0x576875?_0x2d2dfa[_0x65f6('0x10')]:_0x497cf3[_0x65f6('0xd')]+_0x497cf3[_0x65f6('0xe')];var _0x59154e;if(_0x44144b>=_0x2c4ee5){_0x44144b=_0x2c4ee5;_0x59154e=0xc8;}else{_0x59154e=0xce;}_0x571436[_0x65f6('0x11')](_0x59154e);return _0x571436['set']('Content-Range',_0x369f96+'-'+_0x44144b+'/'+_0x2c4ee5)[_0x65f6('0xc')](_0x2d2dfa);}return null;};}function saveUpdates(_0x5c69f8){return function(_0x37330d){if(_0x37330d){return _0x37330d[_0x65f6('0x12')](_0x5c69f8)[_0x65f6('0x13')](function(_0x1f974c){return _0x1f974c;});}return null;};}function removeEntity(_0xc8660c){return function(_0x18380e){if(_0x18380e){return _0x18380e['destroy']()['then'](function(){var _0x2d538c=_0x18380e['get']({'plain':!![]});var _0x4c81f3='SmsQueues';return db[_0x65f6('0x14')][_0x65f6('0x15')]({'where':{'type':_0x4c81f3,'resourceId':_0x2d538c['id']}})['then'](function(){return _0x18380e;});})[_0x65f6('0x13')](function(){_0xc8660c[_0x65f6('0x11')](0xcc)[_0x65f6('0xb')]();});}};}function handleEntityNotFound(_0x3876ed){return function(_0x219ab2){if(!_0x219ab2){_0x3876ed[_0x65f6('0x16')](0x194);}return _0x219ab2;};}function handleError(_0x581374,_0x197a49){_0x197a49=_0x197a49||0x1f4;return function(_0x4bb39e){logger['error'](_0x4bb39e[_0x65f6('0x17')]);if(_0x4bb39e[_0x65f6('0x18')]){delete _0x4bb39e['name'];}_0x581374[_0x65f6('0x11')](_0x197a49)[_0x65f6('0x19')](_0x4bb39e);};}exports[_0x65f6('0x1a')]=function(_0x2774a1,_0x4f5a69){var _0x9d7bb0={};var _0x59ea32={'count':0x0,'rows':[]};var _0x20a161=_['map'](db['SmsQueue']['rawAttributes'],function(_0x29abdb){return{'name':_0x29abdb[_0x65f6('0x1b')],'type':_0x29abdb['type'][_0x65f6('0x1c')]};});_0x9d7bb0=qs[_0x65f6('0x1d')](_0x20a161,_0x2774a1);var _0x52277c={'where':_0x9d7bb0[_0x65f6('0x1e')]};return db[_0x65f6('0x1f')][_0x65f6('0x10')](_0x52277c)['then'](function(_0x4ac04b){_0x59ea32['count']=_0x4ac04b;_0x9d7bb0[_0x65f6('0x20')]=qs[_0x65f6('0x20')](_0x2774a1[_0x65f6('0x21')]);return db[_0x65f6('0x1f')][_0x65f6('0x22')](_0x9d7bb0);})[_0x65f6('0x13')](function(_0x144e55){_0x59ea32['rows']=_0x144e55;return _0x59ea32;})['then'](respondWithFilteredResult(_0x4f5a69,_0x9d7bb0))[_0x65f6('0x23')](handleError(_0x4f5a69,null));};exports[_0x65f6('0x24')]=function(_0x5878bc,_0x4e50c0){var _0x10b368={'raw':!![],'where':{'id':_0x5878bc[_0x65f6('0x25')]['id']}},_0x1ce43c={};_0x1ce43c[_0x65f6('0x26')]=_[_0x65f6('0x27')](db[_0x65f6('0x1f')]['rawAttributes']);_0x1ce43c[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x5878bc[_0x65f6('0x21')]);_0x1ce43c['filters']=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],_0x1ce43c[_0x65f6('0x21')]);_0x10b368[_0x65f6('0x29')]=_[_0x65f6('0x28')](_0x1ce43c[_0x65f6('0x26')],qs['fields'](_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x10b368['attributes']=_0x10b368[_0x65f6('0x29')]['length']?_0x10b368[_0x65f6('0x29')]:_0x1ce43c['model'];if(_0x5878bc[_0x65f6('0x21')][_0x65f6('0x2b')]){_0x10b368['include']=[{'all':!![]}];}_0x10b368=_[_0x65f6('0x2c')]({},_0x10b368,_0x5878bc[_0x65f6('0x2d')]);return db[_0x65f6('0x1f')]['find'](_0x10b368)['then'](handleEntityNotFound(_0x4e50c0,null))[_0x65f6('0x13')](respondWithResult(_0x4e50c0,null))['catch'](handleError(_0x4e50c0,null));};exports[_0x65f6('0x2e')]=function(_0x4e6653,_0x22d760){return db[_0x65f6('0x1f')]['create'](_0x4e6653[_0x65f6('0x2f')],{})['then'](function(_0x5edd04){var _0x71b16b=_0x4e6653[_0x65f6('0x30')][_0x65f6('0x31')]({'plain':!![]});if(!_0x71b16b)throw new Error(_0x65f6('0x32'));if(_0x71b16b[_0x65f6('0x33')]===_0x65f6('0x30')){var _0x1a55da=_0x5edd04[_0x65f6('0x31')]({'plain':!![]});var _0x4f933b=_0x65f6('0x34');return db['UserProfileSection'][_0x65f6('0x35')]({'where':{'name':_0x4f933b,'userProfileId':_0x71b16b[_0x65f6('0x36')]},'raw':!![]})[_0x65f6('0x13')](function(_0x2ea7f7){if(_0x2ea7f7&&_0x2ea7f7['autoAssociation']===0x0){return db[_0x65f6('0x14')][_0x65f6('0x2e')]({'name':_0x1a55da[_0x65f6('0x18')],'resourceId':_0x1a55da['id'],'type':_0x2ea7f7[_0x65f6('0x18')],'sectionId':_0x2ea7f7['id']},{})[_0x65f6('0x13')](function(){return _0x5edd04;});}else{return _0x5edd04;}})[_0x65f6('0x23')](function(_0xed4c96){logger[_0x65f6('0x37')](_0x65f6('0x38'),_0xed4c96);throw _0xed4c96;});}return _0x5edd04;})['then'](respondWithResult(_0x22d760,0xc9))[_0x65f6('0x23')](handleError(_0x22d760,null));};exports[_0x65f6('0x12')]=function(_0x377ae5,_0x181798){if(_0x377ae5[_0x65f6('0x2f')]['id']){delete _0x377ae5[_0x65f6('0x2f')]['id'];}return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x377ae5[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x181798,null))[_0x65f6('0x13')](saveUpdates(_0x377ae5[_0x65f6('0x2f')],null))[_0x65f6('0x13')](respondWithResult(_0x181798,null))[_0x65f6('0x23')](handleError(_0x181798,null));};exports[_0x65f6('0x15')]=function(_0x2cb38d,_0x5119ee){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x2cb38d[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x5119ee,null))['then'](removeEntity(_0x5119ee,null))[_0x65f6('0x23')](handleError(_0x5119ee,null));};exports[_0x65f6('0x39')]=function(_0x2b01eb,_0x5e69b4){return db[_0x65f6('0x1f')][_0x65f6('0x39')]()[_0x65f6('0x13')](respondWithResult(_0x5e69b4,null))[_0x65f6('0x23')](handleError(_0x5e69b4,null));};exports['getMembers']=function(_0x2ec114,_0x512527){var _0x3f1baa={'raw':!![],'where':{}},_0x6968b={},_0x577c93;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x2ec114[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x512527,null))[_0x65f6('0x13')](function(_0xc0db01){if(_0xc0db01){_0x577c93=_0xc0db01[_0x65f6('0x31')]({'plain':!![]});_0x6968b[_0x65f6('0x26')]=_['keys'](db['UserSmsQueue'][_0x65f6('0x3a')]);_0x6968b[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x2ec114[_0x65f6('0x21')]);_0x6968b[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x6968b[_0x65f6('0x26')],_0x6968b[_0x65f6('0x21')]);_0x3f1baa[_0x65f6('0x29')]=_['intersection'](_0x6968b[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x2ec114[_0x65f6('0x21')]['fields']));_0x3f1baa[_0x65f6('0x29')]=_0x3f1baa[_0x65f6('0x29')]['length']?_0x3f1baa[_0x65f6('0x29')]:_0x6968b[_0x65f6('0x26')];if(!_0x2ec114['query'][_0x65f6('0x3c')]('nolimit')){_0x3f1baa[_0x65f6('0xe')]=qs[_0x65f6('0xe')](_0x2ec114[_0x65f6('0x21')]['limit']);_0x3f1baa[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x2ec114['query'][_0x65f6('0xd')]);}_0x3f1baa[_0x65f6('0x3d')]=qs['sort'](_0x2ec114[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x3f1baa[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x2ec114[_0x65f6('0x21')],_0x6968b[_0x65f6('0x3b')]));_0x3f1baa[_0x65f6('0x1e')]['SmsQueueId']=_0xc0db01['id'];if(_0x2ec114['query']['filter']){_0x3f1baa[_0x65f6('0x1e')]=_[_0x65f6('0x2c')](_0x3f1baa[_0x65f6('0x1e')],{'$or':_[_0x65f6('0x40')](_0x3f1baa['attributes'],function(_0x183c08){var _0x2032b9={};_0x2032b9[_0x183c08]={'$like':'%'+_0x2ec114[_0x65f6('0x21')]['filter']+'%'};return _0x2032b9;})});}_0x3f1baa=_[_0x65f6('0x2c')]({},_0x3f1baa,_0x2ec114[_0x65f6('0x2d')]);return db[_0x65f6('0x41')]['findAll'](_0x3f1baa);}})['then'](function(_0x1d337d){if(_0x1d337d){return db[_0x65f6('0x42')][_0x65f6('0x43')]({'where':{'id':_[_0x65f6('0x40')](_0x1d337d,_0x65f6('0x44')),'role':_0x65f6('0x45')},'attributes':['id',_0x65f6('0x18'),_0x65f6('0x46'),_0x65f6('0x47'),_0x65f6('0x48')]});}})[_0x65f6('0x13')](function(_0x141fcc){if(_0x141fcc){return{'count':_0x141fcc[_0x65f6('0x10')],'rows':_[_0x65f6('0x40')](_0x141fcc['rows'],function(_0x47610a){return{'membername':_0x47610a[_0x65f6('0x18')],'UserId':_0x47610a['id'],'queue_name':_0x577c93[_0x65f6('0x18')],'SmsQueueId':_0x577c93['id'],'interface':util['format'](_0x65f6('0x49'),_0x65f6('0x4a'),_0x47610a[_0x65f6('0x18')]),'penalty':0x0,'paused':_0x47610a[_0x65f6('0x46')],'createdAt':_0x47610a['createdAt'],'updatedAt':_0x47610a[_0x65f6('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x65f6('0x13')](respondWithFilteredResult(_0x512527,_0x3f1baa))[_0x65f6('0x23')](handleError(_0x512527,null));};exports[_0x65f6('0x4b')]=function(_0x553ff0,_0x2923ff){var _0x2fc20f={};var _0x5c55e4={};var _0x28682b;var _0x26481e;return db[_0x65f6('0x1f')]['findOne']({'where':{'id':_0x553ff0[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x2923ff,null))[_0x65f6('0x13')](function(_0x3c23e3){if(_0x3c23e3){_0x28682b=_0x3c23e3;_0x5c55e4[_0x65f6('0x26')]=_[_0x65f6('0x27')](db['Team']['rawAttributes']);_0x5c55e4['query']=_[_0x65f6('0x27')](_0x553ff0[_0x65f6('0x21')]);_0x5c55e4[_0x65f6('0x3b')]=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],_0x5c55e4[_0x65f6('0x21')]);_0x2fc20f['attributes']=_[_0x65f6('0x28')](_0x5c55e4[_0x65f6('0x26')],qs['fields'](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x2fc20f[_0x65f6('0x29')]=_0x2fc20f['attributes'][_0x65f6('0x4c')]?_0x2fc20f[_0x65f6('0x29')]:_0x5c55e4['model'];_0x2fc20f[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0x3e')]);_0x2fc20f[_0x65f6('0x1e')]=qs[_0x65f6('0x3b')](_[_0x65f6('0x3f')](_0x553ff0['query'],_0x5c55e4['filters']));if(_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x2fc20f['where']=_[_0x65f6('0x2c')](_0x2fc20f['where'],{'$or':_[_0x65f6('0x40')](_0x2fc20f['attributes'],function(_0x440df1){var _0xdc8989={};_0xdc8989[_0x440df1]={'$like':'%'+_0x553ff0[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0xdc8989;})});}_0x2fc20f=_[_0x65f6('0x2c')]({},_0x2fc20f,_0x553ff0[_0x65f6('0x2d')]);return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})[_0x65f6('0x13')](function(_0x2405a7){if(_0x2405a7){_0x26481e=_0x2405a7['length'];if(!_0x553ff0['query'][_0x65f6('0x3c')](_0x65f6('0x4e'))){_0x2fc20f[_0x65f6('0xe')]=qs['limit'](_0x553ff0['query'][_0x65f6('0xe')]);_0x2fc20f[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x553ff0[_0x65f6('0x21')][_0x65f6('0xd')]);}return _0x28682b[_0x65f6('0x4b')](_0x2fc20f);}})['then'](function(_0x4f42ae){if(_0x4f42ae){return _0x4f42ae?{'count':_0x26481e,'rows':_0x4f42ae}:null;}})[_0x65f6('0x13')](respondWithResult(_0x2923ff,null))[_0x65f6('0x23')](handleError(_0x2923ff,null));};exports['addTeams']=function(_0x219bf8,_0x4a8b60){var _0x254e9f=_0x219bf8[_0x65f6('0x2f')][_0x65f6('0x4f')];return db[_0x65f6('0x50')]['findAll']({'where':{'id':_0x254e9f},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id',_0x65f6('0x18'),'online','voicePause',_0x65f6('0x52')],'raw':!![]}]})['then'](function(_0x305967){if(_0x305967){var _0xf6de=_[_0x65f6('0x53')](_0x305967,function(_0x354b90){var _0x512776=_0x354b90['get']({'plain':!![]});return _0x512776['Agents'];});return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x219bf8[_0x65f6('0x25')]['id']}})['then'](function(_0x46cbde){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x49cee2){return _0x46cbde[_0x65f6('0x56')](_0x254e9f,{'transaction':_0x49cee2})[_0x65f6('0x13')](function(){return BPromise['each'](_0xf6de,function(_0x758e80){return db[_0x65f6('0x41')]['findOrCreate']({'where':{'UserId':_0x758e80['id'],'SmsQueueId':_0x219bf8[_0x65f6('0x25')]['id']},'transaction':_0x49cee2});});})['then'](function(){_0xf6de[_0x65f6('0x57')](function(_0x55ea91){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':_0x55ea91['id'],'SmsQueueId':_0x46cbde['id']});});});});});}})['then'](respondWithStatusCode(_0x4a8b60,null))[_0x65f6('0x23')](handleError(_0x4a8b60,null));};exports[_0x65f6('0x5a')]=function(_0x2a700b,_0x299b85){return db[_0x65f6('0x50')][_0x65f6('0x22')]({'where':{'id':_0x2a700b[_0x65f6('0x21')][_0x65f6('0x4f')]},'attributes':['id'],'include':[{'model':db[_0x65f6('0x42')],'as':_0x65f6('0x51'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x13')](handleEntityNotFound(_0x299b85,null))['then'](function(_0x10a661){var _0x1cf1bd=_[_0x65f6('0x40')](_0x10a661,'id');var _0x219e42=[];var _0x5694f9=[];var _0x453080=squel[_0x65f6('0x5b')]();_0x453080['field'](_0x65f6('0x5c'))['from'](_0x65f6('0x5d'),'tq')['join'](_0x65f6('0x5e'),'ut',_0x65f6('0x5f'))['where']('SmsQueueId\x20=\x20?',_0x2a700b[_0x65f6('0x25')]['id']);for(var _0x413c21=0x0;_0x413c21<_0x10a661['length'];_0x413c21+=0x1){let _0x2d86c8=_0x10a661[_0x413c21];for(var _0x3b3bd5=0x0;_0x3b3bd5<_0x2d86c8[_0x65f6('0x51')]['length'];_0x3b3bd5+=0x1){let _0x1348ec=_0x2d86c8[_0x65f6('0x51')][_0x3b3bd5];var _0x5889dc=_0x453080[_0x65f6('0x60')]();_0x5889dc['where'](_0x65f6('0x61'),_0x1348ec['id']);_0x5694f9['push'](db['sequelize'][_0x65f6('0x21')](_0x5889dc[_0x65f6('0x62')](),{'type':db[_0x65f6('0x54')][_0x65f6('0x63')][_0x65f6('0x64')]})[_0x65f6('0x13')](function(_0x1ac46f){if(_0x1ac46f[_0x65f6('0x4c')]===0x1){return _0x1348ec['id'];}else{var _0x4d66fe=_['every'](_[_0x65f6('0x40')](_0x1ac46f,'TeamId'),function(_0x1ee28a){return _[_0x65f6('0x65')](_0x1cf1bd,_0x1ee28a);});if(_0x4d66fe){return _0x1348ec['id'];}}}));}}return BPromise[_0x65f6('0x66')](_0x5694f9)[_0x65f6('0x13')](function(_0x43127b){_0x219e42=_(_0x219e42)['union'](_0x43127b)[_0x65f6('0x67')]()[_0x65f6('0x68')]();return db[_0x65f6('0x1f')]['find']({'where':{'id':_0x2a700b[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](function(_0x4254c2){return db[_0x65f6('0x54')][_0x65f6('0x55')](function(_0x16bf93){return _0x4254c2['removeTeams'](_0x2a700b['query'][_0x65f6('0x4f')],{'transaction':_0x16bf93})[_0x65f6('0x13')](function(){if(!_[_0x65f6('0x69')](_0x219e42)){return _0x4254c2[_0x65f6('0x6a')](_0x219e42,{'transaction':_0x16bf93});}})['then'](function(){_0x219e42['forEach'](function(_0x336076){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':_0x336076,'SmsQueueId':_0x4254c2['id']});});});});});});})[_0x65f6('0x13')](respondWithStatusCode(_0x299b85,null))[_0x65f6('0x23')](handleError(_0x299b85,null));};exports[_0x65f6('0x6c')]=function(_0x5daaf4,_0x4d607a){return db['SmsQueue'][_0x65f6('0x35')]({'where':{'id':_0x5daaf4[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x4d607a,null))[_0x65f6('0x13')](function(_0x53b11c){if(_0x53b11c){return _0x53b11c['addAgents'](_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')],_['omit'](_0x5daaf4[_0x65f6('0x2f')],['ids','id'])||{})[_0x65f6('0x6d')](function(_0x4f3ef8){for(var _0x3a30ed=0x0;_0x3a30ed<_0x5daaf4[_0x65f6('0x2f')]['ids'][_0x65f6('0x4c')];_0x3a30ed+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x59'),{'UserId':Number(_0x5daaf4[_0x65f6('0x2f')][_0x65f6('0x4f')][_0x3a30ed]),'SmsQueueId':Number(_0x5daaf4[_0x65f6('0x25')]['id'])});}return _0x4f3ef8;});}})['then'](respondWithResult(_0x4d607a,null))[_0x65f6('0x23')](handleError(_0x4d607a,null));};exports['removeAgents']=function(_0x24495c,_0x56336a){return db[_0x65f6('0x1f')][_0x65f6('0x35')]({'where':{'id':_0x24495c[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x56336a,null))['then'](function(_0x2b6f98){if(_0x2b6f98){return _0x2b6f98[_0x65f6('0x6a')](_0x24495c[_0x65f6('0x21')]['ids'])['then'](function(){if(_[_0x65f6('0x6e')](_0x24495c[_0x65f6('0x21')]['ids'])){for(var _0x180cde=0x0;_0x180cde<_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]['length'];_0x180cde+=0x1){socket[_0x65f6('0x58')](_0x65f6('0x6b'),{'UserId':Number(_0x24495c['query'][_0x65f6('0x4f')][_0x180cde]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}}else{socket[_0x65f6('0x58')]('userSmsQueue:remove',{'UserId':Number(_0x24495c[_0x65f6('0x21')][_0x65f6('0x4f')]),'SmsQueueId':Number(_0x24495c[_0x65f6('0x25')]['id'])});}});}})['then'](respondWithStatusCode(_0x56336a,null))[_0x65f6('0x23')](handleError(_0x56336a,null));};exports['getAgents']=function(_0x1beaa7,_0x87a9e4){var _0x31ec61={};var _0x22be6e={};var _0x29b2de;var _0x430fb8;return db['SmsQueue'][_0x65f6('0x6f')]({'where':{'id':_0x1beaa7[_0x65f6('0x25')]['id']}})[_0x65f6('0x13')](handleEntityNotFound(_0x87a9e4,null))[_0x65f6('0x13')](function(_0x207d15){if(_0x207d15){_0x29b2de=_0x207d15;_0x22be6e['model']=_['keys'](db['User'][_0x65f6('0x3a')]);_0x22be6e[_0x65f6('0x21')]=_[_0x65f6('0x27')](_0x1beaa7['query']);_0x22be6e[_0x65f6('0x3b')]=_['intersection'](_0x22be6e['model'],_0x22be6e[_0x65f6('0x21')]);_0x31ec61[_0x65f6('0x29')]=_['intersection'](_0x22be6e[_0x65f6('0x26')],qs[_0x65f6('0x2a')](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x2a')]));_0x31ec61[_0x65f6('0x29')]=_0x31ec61[_0x65f6('0x29')][_0x65f6('0x4c')]?_0x31ec61[_0x65f6('0x29')]:_0x22be6e[_0x65f6('0x26')];_0x31ec61[_0x65f6('0x3d')]=qs[_0x65f6('0x3e')](_0x1beaa7[_0x65f6('0x21')]['sort']);_0x31ec61[_0x65f6('0x1e')]=qs['filters'](_['pick'](_0x1beaa7[_0x65f6('0x21')],_0x22be6e[_0x65f6('0x3b')]));if(_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]){_0x31ec61['where']=_[_0x65f6('0x2c')](_0x31ec61['where'],{'$or':_['map'](_0x31ec61[_0x65f6('0x29')],function(_0x99fe6e){var _0x1a7e52={};_0x1a7e52[_0x99fe6e]={'$like':'%'+_0x1beaa7[_0x65f6('0x21')][_0x65f6('0x4d')]+'%'};return _0x1a7e52;})});}_0x31ec61=_[_0x65f6('0x2c')]({},_0x31ec61,_0x1beaa7['options']);return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})['then'](function(_0x1ef2a0){if(_0x1ef2a0){_0x430fb8=_0x1ef2a0[_0x65f6('0x4c')];if(!_0x1beaa7[_0x65f6('0x21')]['hasOwnProperty'](_0x65f6('0x4e'))){_0x31ec61['limit']=qs['limit'](_0x1beaa7[_0x65f6('0x21')][_0x65f6('0xe')]);_0x31ec61[_0x65f6('0xd')]=qs[_0x65f6('0xd')](_0x1beaa7[_0x65f6('0x21')]['offset']);}return _0x29b2de[_0x65f6('0x70')](_0x31ec61);}})[_0x65f6('0x13')](function(_0x3bebe3){if(_0x3bebe3){return _0x3bebe3?{'count':_0x430fb8,'rows':_0x3bebe3}:null;}})[_0x65f6('0x13')](respondWithResult(_0x87a9e4,null))['catch'](handleError(_0x87a9e4,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index c0249ed..374b86f 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 _0xb16e=['save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb16e,0x14e));var _0xeb16=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0xb16e[_0x5a6644];return _0x3a2a5d;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xeb16('0x0'))['db'][_0xeb16('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb16('0x2'),'afterUpdate':_0xeb16('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4bd57c){return function(_0x106d8f,_0x3a0f9a,_0x431b54){SmsQueueEvents['emit'](_0x4bd57c+':'+_0x106d8f['id'],_0x106d8f);SmsQueueEvents[_0xeb16('0x4')](_0x4bd57c,_0x106d8f);_0x431b54(null);};}for(var e in events){if(events[_0xeb16('0x5')](e)){var event=events[e];SmsQueue[_0xeb16('0x6')](e,emitEvent(event));}}module[_0xeb16('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x6669=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x50e1cf,_0x5b8361){var _0x39104f=function(_0x342287){while(--_0x342287){_0x50e1cf['push'](_0x50e1cf['shift']());}};_0x39104f(++_0x5b8361);}(_0x6669,0xd9));var _0x9666=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x6669[_0x403c20];return _0x2b271a;};'use strict';var EventEmitter=require(_0x9666('0x0'));var SmsQueue=require(_0x9666('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9666('0x2')](0x0);var events={'afterCreate':_0x9666('0x3'),'afterUpdate':_0x9666('0x4'),'afterDestroy':_0x9666('0x5')};function emitEvent(_0x4030ef){return function(_0x54a128,_0x125107,_0x1eeba4){SmsQueueEvents[_0x9666('0x6')](_0x4030ef+':'+_0x54a128['id'],_0x54a128);SmsQueueEvents[_0x9666('0x6')](_0x4030ef,_0x54a128);_0x1eeba4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x9666('0x7')](e,emitEvent(event));}}module[_0x9666('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index bddab8a..b665d58 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 _0x434f=['define','SmsQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x47a472,_0x40f1d9){var _0x2ce58a=function(_0x14834d){while(--_0x14834d){_0x47a472['push'](_0x47a472['shift']());}};_0x2ce58a(++_0x40f1d9);}(_0x434f,0x120));var _0xf434=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x434f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf434('0x0'));var util=require(_0xf434('0x1'));var logger=require(_0xf434('0x2'))(_0xf434('0x3'));var moment=require(_0xf434('0x4'));var BPromise=require(_0xf434('0x5'));var rp=require(_0xf434('0x6'));var fs=require('fs');var path=require(_0xf434('0x7'));var rimraf=require(_0xf434('0x8'));var config=require(_0xf434('0x9'));var attributes=require('./smsQueue.attributes');module[_0xf434('0xa')]=function(_0xb282b7,_0x465732){return _0xb282b7[_0xf434('0xb')](_0xf434('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef05=['rimraf','../../config/environment','./smsQueue.attributes','define','sms_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x60e7fc,_0xae4e2a){var _0x19c8be=function(_0x472eb7){while(--_0x472eb7){_0x60e7fc['push'](_0x60e7fc['shift']());}};_0x19c8be(++_0xae4e2a);}(_0xef05,0x1c8));var _0x5ef0=function(_0x1b2d48,_0x4a48f5){_0x1b2d48=_0x1b2d48-0x0;var _0x369d9b=_0xef05[_0x1b2d48];return _0x369d9b;};'use strict';var _=require(_0x5ef0('0x0'));var util=require(_0x5ef0('0x1'));var logger=require(_0x5ef0('0x2'))(_0x5ef0('0x3'));var moment=require(_0x5ef0('0x4'));var BPromise=require('bluebird');var rp=require(_0x5ef0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ef0('0x6'));var config=require(_0x5ef0('0x7'));var attributes=require(_0x5ef0('0x8'));module['exports']=function(_0xe036a1,_0x2cb95e){return _0xe036a1[_0x5ef0('0x9')]('SmsQueue',attributes,{'tableName':_0x5ef0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 3383bca..2a4ecb0 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 _0x9e70=['find','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSmsQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowSmsQueue','SmsQueue'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x9e70,0x1af));var _0x09e7=function(_0x9a5bba,_0x4758db){_0x9a5bba=_0x9a5bba-0x0;var _0x5bbc01=_0x9e70[_0x9a5bba];return _0x5bbc01;};'use strict';var _=require(_0x09e7('0x0'));var util=require(_0x09e7('0x1'));var moment=require(_0x09e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x09e7('0x3'));var fs=require('fs');var Redis=require(_0x09e7('0x4'));var db=require(_0x09e7('0x5'))['db'];var utils=require(_0x09e7('0x6'));var logger=require('../../config/logger')(_0x09e7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x09e7('0x8')]({'port':0x232a});config[_0x09e7('0x9')]=_[_0x09e7('0xa')](config['redis'],{'host':_0x09e7('0xb'),'port':0x18eb});var socket=require(_0x09e7('0xc'))(new Redis(config[_0x09e7('0x9')]));require(_0x09e7('0xd'))[_0x09e7('0xe')](socket);function respondWithRpcPromise(_0xfcfe70,_0x11b8e2,_0x383b7c){return new BPromise(function(_0x5f4e45,_0x1efa19){return client[_0x09e7('0xf')](_0xfcfe70,_0x383b7c)[_0x09e7('0x10')](function(_0x1cf811){logger[_0x09e7('0x11')](_0x09e7('0x12'),_0x11b8e2,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x11b8e2,_0x09e7('0x13'),JSON[_0x09e7('0x14')](_0x1cf811));if(_0x1cf811[_0x09e7('0x15')]){if(_0x1cf811['error'][_0x09e7('0x16')]===0x1f4){logger[_0x09e7('0x15')](_0x09e7('0x12'),_0x11b8e2,_0x1cf811['error'][_0x09e7('0x17')]);return _0x1efa19(_0x1cf811['error']['message']);}logger[_0x09e7('0x15')](_0x09e7('0x12'),_0x11b8e2,_0x1cf811[_0x09e7('0x15')]['message']);return _0x5f4e45(_0x1cf811['error'][_0x09e7('0x17')]);}else{logger['info'](_0x09e7('0x12'),_0x11b8e2,_0x09e7('0x13'));_0x5f4e45(_0x1cf811[_0x09e7('0x18')]['message']);}})['catch'](function(_0x413680){logger[_0x09e7('0x15')]('SmsQueue,\x20%s,\x20%s',_0x11b8e2,_0x413680);_0x1efa19(_0x413680);});});}exports[_0x09e7('0x19')]=function(_0x31bf4f){var _0x1e49c4=this;return new Promise(function(_0x3aaaa0,_0x4e34b6){return db['SmsQueue']['findAll']({'raw':_0x31bf4f['options']?_0x31bf4f[_0x09e7('0x1a')][_0x09e7('0x1b')]===undefined?!![]:![]:!![],'where':_0x31bf4f[_0x09e7('0x1a')]?_0x31bf4f['options'][_0x09e7('0x1c')]||null:null,'attributes':_0x31bf4f[_0x09e7('0x1a')]?_0x31bf4f['options'][_0x09e7('0x1d')]||null:null,'limit':_0x31bf4f[_0x09e7('0x1a')]?_0x31bf4f[_0x09e7('0x1a')][_0x09e7('0x1e')]||null:null,'include':_0x31bf4f['options']?_0x31bf4f[_0x09e7('0x1a')][_0x09e7('0x1f')]?_['map'](_0x31bf4f[_0x09e7('0x1a')][_0x09e7('0x1f')],function(_0x3ba2de){return{'model':db[_0x3ba2de['model']],'as':_0x3ba2de['as'],'attributes':_0x3ba2de[_0x09e7('0x1d')],'include':_0x3ba2de[_0x09e7('0x1f')]?_[_0x09e7('0x20')](_0x3ba2de[_0x09e7('0x1f')],function(_0x3f0662){return{'model':db[_0x3f0662[_0x09e7('0x21')]],'as':_0x3f0662['as'],'attributes':_0x3f0662[_0x09e7('0x1d')],'include':_0x3f0662['include']?_['map'](_0x3f0662[_0x09e7('0x1f')],function(_0x477346){return{'model':db[_0x477346[_0x09e7('0x21')]],'as':_0x477346['as'],'attributes':_0x477346[_0x09e7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x09e7('0x10')](function(_0x440e72){logger[_0x09e7('0x11')](_0x09e7('0x19'),_0x31bf4f);logger[_0x09e7('0x22')](_0x09e7('0x19'),_0x31bf4f,JSON[_0x09e7('0x14')](_0x440e72));_0x3aaaa0(_0x440e72);})['catch'](function(_0x310346){logger[_0x09e7('0x15')]('GetSmsQueue',_0x310346[_0x09e7('0x17')],_0x31bf4f);_0x4e34b6(_0x1e49c4[_0x09e7('0x15')](0x1f4,_0x310346[_0x09e7('0x17')]));});});};exports[_0x09e7('0x23')]=function(_0x31b070){var _0x443860=this;return new Promise(function(_0x149639,_0x961966){return db[_0x09e7('0x24')][_0x09e7('0x25')]({'raw':_0x31b070[_0x09e7('0x1a')]?_0x31b070[_0x09e7('0x1a')][_0x09e7('0x1b')]===undefined?!![]:![]:!![],'where':_0x31b070[_0x09e7('0x1a')]?_0x31b070['options']['where']||null:null,'attributes':_0x31b070[_0x09e7('0x1a')]?_0x31b070['options']['attributes']||null:null,'include':_0x31b070[_0x09e7('0x1a')]?_0x31b070[_0x09e7('0x1a')][_0x09e7('0x1f')]?_[_0x09e7('0x20')](_0x31b070[_0x09e7('0x1a')][_0x09e7('0x1f')],function(_0x291896){return{'model':db[_0x291896[_0x09e7('0x21')]],'as':_0x291896['as'],'attributes':_0x291896[_0x09e7('0x1d')],'include':_0x291896[_0x09e7('0x1f')]?_[_0x09e7('0x20')](_0x291896['include'],function(_0x1d0b2e){return{'model':db[_0x1d0b2e[_0x09e7('0x21')]],'as':_0x1d0b2e['as'],'attributes':_0x1d0b2e[_0x09e7('0x1d')],'include':_0x1d0b2e['include']?_['map'](_0x1d0b2e['include'],function(_0x5e8793){return{'model':db[_0x5e8793[_0x09e7('0x21')]],'as':_0x5e8793['as'],'attributes':_0x5e8793[_0x09e7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x09e7('0x10')](function(_0x59b918){logger[_0x09e7('0x11')](_0x09e7('0x23'),_0x31b070);logger[_0x09e7('0x22')](_0x09e7('0x23'),_0x31b070,JSON['stringify'](_0x59b918));_0x149639(_0x59b918);})[_0x09e7('0x26')](function(_0x4d3e45){logger[_0x09e7('0x15')](_0x09e7('0x23'),_0x4d3e45[_0x09e7('0x17')],_0x31b070);_0x961966(_0x443860[_0x09e7('0x15')](0x1f4,_0x4d3e45[_0x09e7('0x17')]));});});}; \ No newline at end of file +var _0x3769=['GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowSmsQueue','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','debug','request\x20sent','stringify','error','code','message','SmsQueue,\x20%s,\x20%s','result','catch'];(function(_0x595afe,_0x422419){var _0x4947ae=function(_0x49cf9e){while(--_0x49cf9e){_0x595afe['push'](_0x595afe['shift']());}};_0x4947ae(++_0x422419);}(_0x3769,0x125));var _0x9376=function(_0x1f6f8f,_0x185111){_0x1f6f8f=_0x1f6f8f-0x0;var _0x2e958e=_0x3769[_0x1f6f8f];return _0x2e958e;};'use strict';var _=require(_0x9376('0x0'));var util=require(_0x9376('0x1'));var moment=require(_0x9376('0x2'));var BPromise=require(_0x9376('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9376('0x4'))['db'];var utils=require(_0x9376('0x5'));var logger=require(_0x9376('0x6'))(_0x9376('0x7'));var config=require(_0x9376('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9376('0x9')]({'port':0x232a});config['redis']=_[_0x9376('0xa')](config['redis'],{'host':_0x9376('0xb'),'port':0x18eb});var socket=require(_0x9376('0xc'))(new Redis(config[_0x9376('0xd')]));require('./smsQueue.socket')[_0x9376('0xe')](socket);function respondWithRpcPromise(_0x5a6276,_0x2e2fb4,_0x3010b3){return new BPromise(function(_0x2187e6,_0x266bfe){return client[_0x9376('0xf')](_0x5a6276,_0x3010b3)[_0x9376('0x10')](function(_0x3e9627){logger[_0x9376('0x11')]('SmsQueue,\x20%s,\x20%s',_0x2e2fb4,'request\x20sent');logger[_0x9376('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x2e2fb4,_0x9376('0x13'),JSON[_0x9376('0x14')](_0x3e9627));if(_0x3e9627[_0x9376('0x15')]){if(_0x3e9627[_0x9376('0x15')][_0x9376('0x16')]===0x1f4){logger[_0x9376('0x15')]('SmsQueue,\x20%s,\x20%s',_0x2e2fb4,_0x3e9627['error']['message']);return _0x266bfe(_0x3e9627[_0x9376('0x15')][_0x9376('0x17')]);}logger['error'](_0x9376('0x18'),_0x2e2fb4,_0x3e9627[_0x9376('0x15')]['message']);return _0x2187e6(_0x3e9627[_0x9376('0x15')][_0x9376('0x17')]);}else{logger[_0x9376('0x11')](_0x9376('0x18'),_0x2e2fb4,_0x9376('0x13'));_0x2187e6(_0x3e9627[_0x9376('0x19')][_0x9376('0x17')]);}})[_0x9376('0x1a')](function(_0x278c65){logger[_0x9376('0x15')](_0x9376('0x18'),_0x2e2fb4,_0x278c65);_0x266bfe(_0x278c65);});});}exports[_0x9376('0x1b')]=function(_0x90d7fc){var _0x403950=this;return new Promise(function(_0x4c20de,_0x34d59f){return db[_0x9376('0x1c')][_0x9376('0x1d')]({'raw':_0x90d7fc[_0x9376('0x1e')]?_0x90d7fc[_0x9376('0x1e')][_0x9376('0x1f')]===undefined?!![]:![]:!![],'where':_0x90d7fc[_0x9376('0x1e')]?_0x90d7fc['options'][_0x9376('0x20')]||null:null,'attributes':_0x90d7fc['options']?_0x90d7fc[_0x9376('0x1e')][_0x9376('0x21')]||null:null,'limit':_0x90d7fc['options']?_0x90d7fc[_0x9376('0x1e')][_0x9376('0x22')]||null:null,'include':_0x90d7fc[_0x9376('0x1e')]?_0x90d7fc['options'][_0x9376('0x23')]?_['map'](_0x90d7fc[_0x9376('0x1e')][_0x9376('0x23')],function(_0x131e80){return{'model':db[_0x131e80[_0x9376('0x24')]],'as':_0x131e80['as'],'attributes':_0x131e80[_0x9376('0x21')],'include':_0x131e80[_0x9376('0x23')]?_[_0x9376('0x25')](_0x131e80[_0x9376('0x23')],function(_0x28b7d0){return{'model':db[_0x28b7d0[_0x9376('0x24')]],'as':_0x28b7d0['as'],'attributes':_0x28b7d0[_0x9376('0x21')],'include':_0x28b7d0[_0x9376('0x23')]?_[_0x9376('0x25')](_0x28b7d0[_0x9376('0x23')],function(_0x48d5f1){return{'model':db[_0x48d5f1[_0x9376('0x24')]],'as':_0x48d5f1['as'],'attributes':_0x48d5f1[_0x9376('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9376('0x10')](function(_0x3484c8){logger['info'](_0x9376('0x1b'),_0x90d7fc);logger[_0x9376('0x12')]('GetSmsQueue',_0x90d7fc,JSON['stringify'](_0x3484c8));_0x4c20de(_0x3484c8);})[_0x9376('0x1a')](function(_0x46c70d){logger[_0x9376('0x15')](_0x9376('0x1b'),_0x46c70d[_0x9376('0x17')],_0x90d7fc);_0x34d59f(_0x403950[_0x9376('0x15')](0x1f4,_0x46c70d[_0x9376('0x17')]));});});};exports['ShowSmsQueue']=function(_0xbb32f4){var _0x41db6d=this;return new Promise(function(_0x3f2dc1,_0x5d534b){return db[_0x9376('0x1c')][_0x9376('0x26')]({'raw':_0xbb32f4['options']?_0xbb32f4[_0x9376('0x1e')][_0x9376('0x1f')]===undefined?!![]:![]:!![],'where':_0xbb32f4[_0x9376('0x1e')]?_0xbb32f4['options'][_0x9376('0x20')]||null:null,'attributes':_0xbb32f4[_0x9376('0x1e')]?_0xbb32f4[_0x9376('0x1e')]['attributes']||null:null,'include':_0xbb32f4[_0x9376('0x1e')]?_0xbb32f4[_0x9376('0x1e')][_0x9376('0x23')]?_['map'](_0xbb32f4[_0x9376('0x1e')][_0x9376('0x23')],function(_0x3891c2){return{'model':db[_0x3891c2[_0x9376('0x24')]],'as':_0x3891c2['as'],'attributes':_0x3891c2[_0x9376('0x21')],'include':_0x3891c2[_0x9376('0x23')]?_[_0x9376('0x25')](_0x3891c2['include'],function(_0x20c600){return{'model':db[_0x20c600[_0x9376('0x24')]],'as':_0x20c600['as'],'attributes':_0x20c600['attributes'],'include':_0x20c600['include']?_[_0x9376('0x25')](_0x20c600[_0x9376('0x23')],function(_0x5733ce){return{'model':db[_0x5733ce[_0x9376('0x24')]],'as':_0x5733ce['as'],'attributes':_0x5733ce['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5508e7){logger[_0x9376('0x11')]('ShowSmsQueue',_0xbb32f4);logger[_0x9376('0x12')](_0x9376('0x27'),_0xbb32f4,JSON[_0x9376('0x14')](_0x5508e7));_0x3f2dc1(_0x5508e7);})[_0x9376('0x1a')](function(_0x457ff8){logger[_0x9376('0x15')](_0x9376('0x27'),_0x457ff8[_0x9376('0x17')],_0xbb32f4);_0x5d534b(_0x41db6d['error'](0x1f4,_0x457ff8[_0x9376('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 0815d3f..3d9de74 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 _0xc1fb=['./smsQueue.events','save','remove','emit','removeListener'];(function(_0x398e07,_0x35db57){var _0x17d57f=function(_0x77123){while(--_0x77123){_0x398e07['push'](_0x398e07['shift']());}};_0x17d57f(++_0x35db57);}(_0xc1fb,0x7d));var _0xbc1f=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0xc1fb[_0x4695ba];return _0x524b7d;};'use strict';var SmsQueueEvents=require(_0xbc1f('0x0'));var events=[_0xbc1f('0x1'),_0xbc1f('0x2'),'update'];function createListener(_0x4d72fd,_0xa856f0){return function(_0x3719a3){_0xa856f0[_0xbc1f('0x3')](_0x4d72fd,_0x3719a3);};}function removeListener(_0x1feda1,_0x2d0428){return function(){SmsQueueEvents[_0xbc1f('0x4')](_0x1feda1,_0x2d0428);};}exports['register']=function(_0x4f59c0){for(var _0x3c146a=0x0,_0x367506=events['length'];_0x3c146a<_0x367506;_0x3c146a++){var _0xc263e=events[_0x3c146a];var _0x1a93e6=createListener('smsQueue:'+_0xc263e,_0x4f59c0);SmsQueueEvents['on'](_0xc263e,_0x1a93e6);}}; \ No newline at end of file +var _0xf4e6=['length','smsQueue:','./smsQueue.events','save','remove','emit','removeListener','register'];(function(_0x20701e,_0x5ce88f){var _0x395493=function(_0x45106d){while(--_0x45106d){_0x20701e['push'](_0x20701e['shift']());}};_0x395493(++_0x5ce88f);}(_0xf4e6,0x132));var _0x6f4e=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0xf4e6[_0xc69f39];return _0x93be41;};'use strict';var SmsQueueEvents=require(_0x6f4e('0x0'));var events=[_0x6f4e('0x1'),_0x6f4e('0x2'),'update'];function createListener(_0x3e3bf9,_0x24f50a){return function(_0x20e638){_0x24f50a[_0x6f4e('0x3')](_0x3e3bf9,_0x20e638);};}function removeListener(_0x5ebf6a,_0x5cfd48){return function(){SmsQueueEvents[_0x6f4e('0x4')](_0x5ebf6a,_0x5cfd48);};}exports[_0x6f4e('0x5')]=function(_0x17f494){for(var _0x474fdc=0x0,_0x4b2bd1=events[_0x6f4e('0x6')];_0x474fdc<_0x4b2bd1;_0x474fdc++){var _0x317af3=events[_0x474fdc];var _0x8da5c4=createListener(_0x6f4e('0x7')+_0x317af3,_0x17f494);SmsQueueEvents['on'](_0x317af3,_0x8da5c4);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index aa62b7a..7f3c908 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 _0xbeea=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/describe','show','post'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbeea,0xb1));var _0xabee=function(_0x317412,_0xd00b08){_0x317412=_0x317412-0x0;var _0x904316=_0xbeea[_0x317412];return _0x904316;};'use strict';var multer=require(_0xabee('0x0'));var util=require('util');var path=require(_0xabee('0x1'));var timeout=require(_0xabee('0x2'));var express=require(_0xabee('0x3'));var router=express['Router']();var fs_extra=require(_0xabee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xabee('0x5'));var config=require(_0xabee('0x6'));var controller=require(_0xabee('0x7'));router[_0xabee('0x8')]('/',auth[_0xabee('0x9')](),controller['index']);router['get'](_0xabee('0xa'),auth[_0xabee('0x9')](),controller['describe']);router[_0xabee('0x8')]('/:id',auth[_0xabee('0x9')](),controller[_0xabee('0xb')]);router[_0xabee('0xc')]('/',auth[_0xabee('0x9')](),controller[_0xabee('0xd')]);router[_0xabee('0xe')]('/:id',auth[_0xabee('0x9')](),controller[_0xabee('0xf')]);router[_0xabee('0x10')]('/:id',auth[_0xabee('0x9')](),controller[_0xabee('0x11')]);module[_0xabee('0x12')]=router; \ No newline at end of file +var _0x174d=['show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/describe','/:id'];(function(_0x62d53d,_0x1ece01){var _0x3d65d1=function(_0x44ffc3){while(--_0x44ffc3){_0x62d53d['push'](_0x62d53d['shift']());}};_0x3d65d1(++_0x1ece01);}(_0x174d,0x1ca));var _0xd174=function(_0x4d77d5,_0xf3c18){_0x4d77d5=_0x4d77d5-0x0;var _0x4d590d=_0x174d[_0x4d77d5];return _0x4d590d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd174('0x0'));var timeout=require(_0xd174('0x1'));var express=require(_0xd174('0x2'));var router=express['Router']();var fs_extra=require(_0xd174('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd174('0x4'));var config=require('../../config/environment');var controller=require(_0xd174('0x5'));router[_0xd174('0x6')]('/',auth[_0xd174('0x7')](),controller['index']);router[_0xd174('0x6')](_0xd174('0x8'),auth[_0xd174('0x7')](),controller['describe']);router[_0xd174('0x6')](_0xd174('0x9'),auth['isAuthenticated'](),controller[_0xd174('0xa')]);router[_0xd174('0xb')]('/',auth[_0xd174('0x7')](),controller[_0xd174('0xc')]);router[_0xd174('0xd')](_0xd174('0x9'),auth[_0xd174('0x7')](),controller[_0xd174('0xe')]);router[_0xd174('0xf')](_0xd174('0x9'),auth[_0xd174('0x7')](),controller[_0xd174('0x10')]);module[_0xd174('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index a97aede..6537e30 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 _0x64d4=['exports','DATE','STRING','moment','sequelize'];(function(_0x23282f,_0x39e993){var _0x542bdb=function(_0x37da02){while(--_0x37da02){_0x23282f['push'](_0x23282f['shift']());}};_0x542bdb(++_0x39e993);}(_0x64d4,0x94));var _0x464d=function(_0x1e4a5f,_0x5781a0){_0x1e4a5f=_0x1e4a5f-0x0;var _0x30047e=_0x64d4[_0x1e4a5f];return _0x30047e;};'use strict';var moment=require(_0x464d('0x0'));var Sequelize=require(_0x464d('0x1'));module[_0x464d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x464d('0x3')]},'leaveAt':{'type':Sequelize[_0x464d('0x3')]},'acceptAt':{'type':Sequelize[_0x464d('0x3')]},'exitAt':{'type':Sequelize[_0x464d('0x3')]},'reason':{'type':Sequelize[_0x464d('0x4')]}}; \ No newline at end of file +var _0xa296=['exports','STRING','DATE','moment','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa296,0x1d4));var _0x6a29=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0xa296[_0x4c9380];return _0x49a523;};'use strict';var moment=require(_0x6a29('0x0'));var Sequelize=require(_0x6a29('0x1'));module[_0x6a29('0x2')]={'uniqueid':{'type':Sequelize[_0x6a29('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6a29('0x4')]},'leaveAt':{'type':Sequelize[_0x6a29('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6a29('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 28e8f2c..af1bba1 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 _0x6737=['fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filters','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','index','map','SmsQueueReport','rawAttributes'];(function(_0x577e13,_0xc2c054){var _0x13a973=function(_0x517cc9){while(--_0x517cc9){_0x577e13['push'](_0x577e13['shift']());}};_0x13a973(++_0xc2c054);}(_0x6737,0xaf));var _0x7673=function(_0x58a47d,_0x225912){_0x58a47d=_0x58a47d-0x0;var _0x1124cd=_0x6737[_0x58a47d];return _0x1124cd;};'use strict';var emlformat=require(_0x7673('0x0'));var rimraf=require(_0x7673('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7673('0x2'));var moment=require(_0x7673('0x3'));var BPromise=require(_0x7673('0x4'));var Mustache=require(_0x7673('0x5'));var util=require(_0x7673('0x6'));var path=require(_0x7673('0x7'));var sox=require(_0x7673('0x8'));var csv=require('to-csv');var ejs=require(_0x7673('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7673('0xa'));var squel=require(_0x7673('0xb'));var crypto=require('crypto');var jsforce=require(_0x7673('0xc'));var deskjs=require(_0x7673('0xd'));var toCsv=require(_0x7673('0xe'));var querystring=require(_0x7673('0xf'));var Papa=require('papaparse');var Redis=require(_0x7673('0x10'));var authService=require(_0x7673('0x11'));var qs=require(_0x7673('0x12'));var as=require(_0x7673('0x13'));var hardwareService=require(_0x7673('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7673('0x15'));var config=require(_0x7673('0x16'));var licenseUtil=require(_0x7673('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d5502,_0x381070){_0x381070=_0x381070||0xcc;return function(_0x1b4899){if(_0x1b4899){return _0x4d5502[_0x7673('0x18')](_0x381070);}return _0x4d5502[_0x7673('0x19')](_0x381070)[_0x7673('0x1a')]();};}function respondWithResult(_0x11e618,_0x3ade58){_0x3ade58=_0x3ade58||0xc8;return function(_0x10d626){if(_0x10d626){return _0x11e618['status'](_0x3ade58)['json'](_0x10d626);}};}function respondWithFilteredResult(_0x3a7837,_0x1ee508){return function(_0x477a18){if(_0x477a18){var _0x50b2b0=typeof _0x1ee508[_0x7673('0x1b')]===_0x7673('0x1c')&&typeof _0x1ee508[_0x7673('0x1d')]===_0x7673('0x1c');var _0x130715=_0x477a18['count'];var _0x169ad7=_0x50b2b0?0x0:_0x1ee508[_0x7673('0x1b')];var _0x13fc9b=_0x50b2b0?_0x477a18[_0x7673('0x1e')]:_0x1ee508[_0x7673('0x1b')]+_0x1ee508[_0x7673('0x1d')];var _0x2658c5;if(_0x13fc9b>=_0x130715){_0x13fc9b=_0x130715;_0x2658c5=0xc8;}else{_0x2658c5=0xce;}_0x3a7837[_0x7673('0x19')](_0x2658c5);return _0x3a7837[_0x7673('0x1f')]('Content-Range',_0x169ad7+'-'+_0x13fc9b+'/'+_0x130715)['json'](_0x477a18);}return null;};}function patchUpdates(_0x1c6b95){return function(_0x74feae){try{jsonpatch[_0x7673('0x20')](_0x74feae,_0x1c6b95,!![]);}catch(_0x2043a8){return BPromise[_0x7673('0x21')](_0x2043a8);}return _0x74feae[_0x7673('0x22')]();};}function saveUpdates(_0x5aebf2,_0x118521){return function(_0x430e7e){if(_0x430e7e){return _0x430e7e['update'](_0x5aebf2)[_0x7673('0x23')](function(_0x75be5d){return _0x75be5d;});}return null;};}function removeEntity(_0x4f8a6b,_0x32c623){return function(_0x45000c){if(_0x45000c){return _0x45000c[_0x7673('0x24')]()[_0x7673('0x23')](function(){_0x4f8a6b[_0x7673('0x19')](0xcc)[_0x7673('0x1a')]();});}};}function handleEntityNotFound(_0x3215f7,_0x491cab){return function(_0x53eda3){if(!_0x53eda3){_0x3215f7[_0x7673('0x18')](0x194);}return _0x53eda3;};}function handleError(_0x51bfbd,_0x11dd82){_0x11dd82=_0x11dd82||0x1f4;return function(_0x2bc8ee){logger['error'](_0x2bc8ee[_0x7673('0x25')]);if(_0x2bc8ee[_0x7673('0x26')]){delete _0x2bc8ee[_0x7673('0x26')];}_0x51bfbd[_0x7673('0x19')](_0x11dd82)[_0x7673('0x27')](_0x2bc8ee);};}exports[_0x7673('0x28')]=function(_0x1c89a6,_0x4144ea){var _0x5aab5a={},_0x27dde6={},_0x646053={'count':0x0,'rows':[]};var _0x643a60=_[_0x7673('0x29')](db[_0x7673('0x2a')][_0x7673('0x2b')],function(_0x2969c0){return{'name':_0x2969c0[_0x7673('0x2c')],'type':_0x2969c0[_0x7673('0x2d')][_0x7673('0x2e')]};});_0x27dde6['model']=_['map'](_0x643a60,_0x7673('0x26'));_0x27dde6[_0x7673('0x2f')]=_[_0x7673('0x30')](_0x1c89a6[_0x7673('0x2f')]);_0x27dde6['filters']=_[_0x7673('0x31')](_0x27dde6[_0x7673('0x32')],_0x27dde6[_0x7673('0x2f')]);_0x5aab5a[_0x7673('0x33')]=_[_0x7673('0x31')](_0x27dde6['model'],qs[_0x7673('0x34')](_0x1c89a6[_0x7673('0x2f')][_0x7673('0x34')]));_0x5aab5a['attributes']=_0x5aab5a[_0x7673('0x33')]['length']?_0x5aab5a[_0x7673('0x33')]:_0x27dde6[_0x7673('0x32')];if(!_0x1c89a6['query'][_0x7673('0x35')](_0x7673('0x36'))){_0x5aab5a[_0x7673('0x1d')]=qs[_0x7673('0x1d')](_0x1c89a6[_0x7673('0x2f')][_0x7673('0x1d')]);_0x5aab5a[_0x7673('0x1b')]=qs['offset'](_0x1c89a6[_0x7673('0x2f')]['offset']);}_0x5aab5a['order']=qs['sort'](_0x1c89a6[_0x7673('0x2f')][_0x7673('0x37')]);_0x5aab5a['where']=qs[_0x7673('0x38')](_['pick'](_0x1c89a6[_0x7673('0x2f')],_0x27dde6[_0x7673('0x38')]),_0x643a60);if(_0x1c89a6[_0x7673('0x2f')]['filter']){_0x5aab5a[_0x7673('0x39')]=_[_0x7673('0x3a')](_0x5aab5a['where'],{'$or':_[_0x7673('0x29')](_0x643a60,function(_0x214c1a){if(_0x214c1a[_0x7673('0x2d')]!=='VIRTUAL'){var _0x43fc6f={};_0x43fc6f[_0x214c1a['name']]={'$like':'%'+_0x1c89a6[_0x7673('0x2f')][_0x7673('0x3b')]+'%'};return _0x43fc6f;}})});}_0x5aab5a=_[_0x7673('0x3a')]({},_0x5aab5a,_0x1c89a6[_0x7673('0x3c')]);var _0x2f7ebb={'where':_0x5aab5a[_0x7673('0x39')]};return db[_0x7673('0x2a')][_0x7673('0x1e')](_0x2f7ebb)['then'](function(_0x4fcd86){_0x646053[_0x7673('0x1e')]=_0x4fcd86;if(_0x1c89a6[_0x7673('0x2f')][_0x7673('0x3d')]){_0x5aab5a[_0x7673('0x3e')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x7673('0x3f')](_0x5aab5a);})[_0x7673('0x23')](function(_0x3fc47e){_0x646053[_0x7673('0x40')]=_0x3fc47e;return _0x646053;})[_0x7673('0x23')](respondWithFilteredResult(_0x4144ea,_0x5aab5a))[_0x7673('0x41')](handleError(_0x4144ea,null));};exports[_0x7673('0x42')]=function(_0x4f6a24,_0x58739a){var _0x45e787={'raw':!![],'where':{'id':_0x4f6a24[_0x7673('0x43')]['id']}},_0x1b8370={};_0x1b8370[_0x7673('0x32')]=_['keys'](db[_0x7673('0x2a')][_0x7673('0x2b')]);_0x1b8370[_0x7673('0x2f')]=_[_0x7673('0x30')](_0x4f6a24[_0x7673('0x2f')]);_0x1b8370[_0x7673('0x38')]=_[_0x7673('0x31')](_0x1b8370[_0x7673('0x32')],_0x1b8370[_0x7673('0x2f')]);_0x45e787['attributes']=_[_0x7673('0x31')](_0x1b8370['model'],qs[_0x7673('0x34')](_0x4f6a24[_0x7673('0x2f')][_0x7673('0x34')]));_0x45e787[_0x7673('0x33')]=_0x45e787['attributes']['length']?_0x45e787[_0x7673('0x33')]:_0x1b8370[_0x7673('0x32')];if(_0x4f6a24['query'][_0x7673('0x3d')]){_0x45e787['include']=[{'all':!![]}];}_0x45e787=_[_0x7673('0x3a')]({},_0x45e787,_0x4f6a24['options']);return db['SmsQueueReport']['find'](_0x45e787)[_0x7673('0x23')](handleEntityNotFound(_0x58739a,null))[_0x7673('0x23')](respondWithResult(_0x58739a,null))['catch'](handleError(_0x58739a,null));};exports[_0x7673('0x44')]=function(_0x388ae9,_0x4147c2){return db[_0x7673('0x2a')][_0x7673('0x44')](_0x388ae9[_0x7673('0x45')],{})['then'](respondWithResult(_0x4147c2,0xc9))['catch'](handleError(_0x4147c2,null));};exports[_0x7673('0x46')]=function(_0x4356d9,_0x5426d2){if(_0x4356d9[_0x7673('0x45')]['id']){delete _0x4356d9[_0x7673('0x45')]['id'];}return db[_0x7673('0x2a')]['find']({'where':{'id':_0x4356d9['params']['id']}})[_0x7673('0x23')](handleEntityNotFound(_0x5426d2,null))[_0x7673('0x23')](saveUpdates(_0x4356d9[_0x7673('0x45')],null))[_0x7673('0x23')](respondWithResult(_0x5426d2,null))[_0x7673('0x41')](handleError(_0x5426d2,null));};exports[_0x7673('0x24')]=function(_0x42210c,_0x20de2a){return db[_0x7673('0x2a')][_0x7673('0x47')]({'where':{'id':_0x42210c['params']['id']}})[_0x7673('0x23')](handleEntityNotFound(_0x20de2a,null))[_0x7673('0x23')](removeEntity(_0x20de2a,null))[_0x7673('0x41')](handleError(_0x20de2a,null));};exports[_0x7673('0x48')]=function(_0x403517,_0x101082){return db[_0x7673('0x2a')][_0x7673('0x48')]()[_0x7673('0x23')](respondWithResult(_0x101082,null))[_0x7673('0x41')](handleError(_0x101082,null));}; \ No newline at end of file +var _0xab8f=['type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter'];(function(_0x45b6f3,_0x298dab){var _0x585127=function(_0x30fb36){while(--_0x30fb36){_0x45b6f3['push'](_0x45b6f3['shift']());}};_0x585127(++_0x298dab);}(_0xab8f,0xb0));var _0xfab8=function(_0x28b89f,_0x4a97db){_0x28b89f=_0x28b89f-0x0;var _0x9f9abf=_0xab8f[_0x28b89f];return _0x9f9abf;};'use strict';var emlformat=require(_0xfab8('0x0'));var rimraf=require(_0xfab8('0x1'));var zipdir=require(_0xfab8('0x2'));var jsonpatch=require(_0xfab8('0x3'));var rp=require(_0xfab8('0x4'));var moment=require(_0xfab8('0x5'));var BPromise=require(_0xfab8('0x6'));var Mustache=require(_0xfab8('0x7'));var util=require(_0xfab8('0x8'));var path=require(_0xfab8('0x9'));var sox=require(_0xfab8('0xa'));var csv=require(_0xfab8('0xb'));var ejs=require(_0xfab8('0xc'));var fs=require('fs');var fs_extra=require(_0xfab8('0xd'));var _=require(_0xfab8('0xe'));var squel=require(_0xfab8('0xf'));var crypto=require(_0xfab8('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfab8('0xb'));var querystring=require('querystring');var Papa=require(_0xfab8('0x11'));var Redis=require(_0xfab8('0x12'));var authService=require(_0xfab8('0x13'));var qs=require(_0xfab8('0x14'));var as=require(_0xfab8('0x15'));var hardwareService=require(_0xfab8('0x16'));var logger=require(_0xfab8('0x17'))(_0xfab8('0x18'));var utils=require(_0xfab8('0x19'));var config=require(_0xfab8('0x1a'));var licenseUtil=require(_0xfab8('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28dd2c,_0x14e028){_0x14e028=_0x14e028||0xcc;return function(_0x2d0959){if(_0x2d0959){return _0x28dd2c['sendStatus'](_0x14e028);}return _0x28dd2c[_0xfab8('0x1c')](_0x14e028)[_0xfab8('0x1d')]();};}function respondWithResult(_0x139e69,_0x1061e8){_0x1061e8=_0x1061e8||0xc8;return function(_0x1515e9){if(_0x1515e9){return _0x139e69[_0xfab8('0x1c')](_0x1061e8)[_0xfab8('0x1e')](_0x1515e9);}};}function respondWithFilteredResult(_0x23bda8,_0x151c7c){return function(_0x1d5c64){if(_0x1d5c64){var _0x1d8f25=typeof _0x151c7c[_0xfab8('0x1f')]===_0xfab8('0x20')&&typeof _0x151c7c[_0xfab8('0x21')]===_0xfab8('0x20');var _0x150e4e=_0x1d5c64[_0xfab8('0x22')];var _0x4c191e=_0x1d8f25?0x0:_0x151c7c[_0xfab8('0x1f')];var _0x143f7c=_0x1d8f25?_0x1d5c64[_0xfab8('0x22')]:_0x151c7c['offset']+_0x151c7c[_0xfab8('0x21')];var _0x13c5a6;if(_0x143f7c>=_0x150e4e){_0x143f7c=_0x150e4e;_0x13c5a6=0xc8;}else{_0x13c5a6=0xce;}_0x23bda8['status'](_0x13c5a6);return _0x23bda8[_0xfab8('0x23')](_0xfab8('0x24'),_0x4c191e+'-'+_0x143f7c+'/'+_0x150e4e)[_0xfab8('0x1e')](_0x1d5c64);}return null;};}function patchUpdates(_0x172244){return function(_0xf095ef){try{jsonpatch[_0xfab8('0x25')](_0xf095ef,_0x172244,!![]);}catch(_0x534f10){return BPromise[_0xfab8('0x26')](_0x534f10);}return _0xf095ef[_0xfab8('0x27')]();};}function saveUpdates(_0x91615a,_0x5b5560){return function(_0x1faa34){if(_0x1faa34){return _0x1faa34[_0xfab8('0x28')](_0x91615a)[_0xfab8('0x29')](function(_0x2b4cd7){return _0x2b4cd7;});}return null;};}function removeEntity(_0x58cdee,_0x5b4218){return function(_0x2ee4ee){if(_0x2ee4ee){return _0x2ee4ee[_0xfab8('0x2a')]()[_0xfab8('0x29')](function(){_0x58cdee[_0xfab8('0x1c')](0xcc)[_0xfab8('0x1d')]();});}};}function handleEntityNotFound(_0x56e225,_0x8a8ec6){return function(_0x220daf){if(!_0x220daf){_0x56e225[_0xfab8('0x2b')](0x194);}return _0x220daf;};}function handleError(_0x3d9545,_0xbab5c9){_0xbab5c9=_0xbab5c9||0x1f4;return function(_0x3ef8b4){logger[_0xfab8('0x2c')](_0x3ef8b4[_0xfab8('0x2d')]);if(_0x3ef8b4['name']){delete _0x3ef8b4[_0xfab8('0x2e')];}_0x3d9545[_0xfab8('0x1c')](_0xbab5c9)[_0xfab8('0x2f')](_0x3ef8b4);};}exports[_0xfab8('0x30')]=function(_0x3e69a5,_0x18ae3f){var _0x1e8c50={},_0x42a70c={},_0x3e16e9={'count':0x0,'rows':[]};var _0x257141=_['map'](db[_0xfab8('0x31')][_0xfab8('0x32')],function(_0x7f08b9){return{'name':_0x7f08b9[_0xfab8('0x33')],'type':_0x7f08b9['type'][_0xfab8('0x34')]};});_0x42a70c[_0xfab8('0x35')]=_[_0xfab8('0x36')](_0x257141,_0xfab8('0x2e'));_0x42a70c[_0xfab8('0x37')]=_['keys'](_0x3e69a5['query']);_0x42a70c['filters']=_[_0xfab8('0x38')](_0x42a70c[_0xfab8('0x35')],_0x42a70c[_0xfab8('0x37')]);_0x1e8c50[_0xfab8('0x39')]=_[_0xfab8('0x38')](_0x42a70c['model'],qs[_0xfab8('0x3a')](_0x3e69a5['query'][_0xfab8('0x3a')]));_0x1e8c50[_0xfab8('0x39')]=_0x1e8c50['attributes'][_0xfab8('0x3b')]?_0x1e8c50[_0xfab8('0x39')]:_0x42a70c[_0xfab8('0x35')];if(!_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x3c')]('nolimit')){_0x1e8c50[_0xfab8('0x21')]=qs['limit'](_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x21')]);_0x1e8c50[_0xfab8('0x1f')]=qs['offset'](_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x1f')]);}_0x1e8c50[_0xfab8('0x3d')]=qs[_0xfab8('0x3e')](_0x3e69a5['query']['sort']);_0x1e8c50[_0xfab8('0x3f')]=qs['filters'](_[_0xfab8('0x40')](_0x3e69a5['query'],_0x42a70c[_0xfab8('0x41')]),_0x257141);if(_0x3e69a5['query'][_0xfab8('0x42')]){_0x1e8c50[_0xfab8('0x3f')]=_['merge'](_0x1e8c50[_0xfab8('0x3f')],{'$or':_[_0xfab8('0x36')](_0x257141,function(_0x4c2ffd){if(_0x4c2ffd[_0xfab8('0x43')]!==_0xfab8('0x44')){var _0x26a723={};_0x26a723[_0x4c2ffd[_0xfab8('0x2e')]]={'$like':'%'+_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x42')]+'%'};return _0x26a723;}})});}_0x1e8c50=_[_0xfab8('0x45')]({},_0x1e8c50,_0x3e69a5[_0xfab8('0x46')]);var _0x1f2239={'where':_0x1e8c50[_0xfab8('0x3f')]};return db[_0xfab8('0x31')][_0xfab8('0x22')](_0x1f2239)[_0xfab8('0x29')](function(_0x5ec917){_0x3e16e9[_0xfab8('0x22')]=_0x5ec917;if(_0x3e69a5[_0xfab8('0x37')][_0xfab8('0x47')]){_0x1e8c50[_0xfab8('0x48')]=[{'all':!![]}];}return db[_0xfab8('0x31')][_0xfab8('0x49')](_0x1e8c50);})['then'](function(_0x4829d3){_0x3e16e9['rows']=_0x4829d3;return _0x3e16e9;})[_0xfab8('0x29')](respondWithFilteredResult(_0x18ae3f,_0x1e8c50))[_0xfab8('0x4a')](handleError(_0x18ae3f,null));};exports[_0xfab8('0x4b')]=function(_0x501ccd,_0x208e59){var _0x45d4de={'raw':!![],'where':{'id':_0x501ccd[_0xfab8('0x4c')]['id']}},_0x10e6a3={};_0x10e6a3[_0xfab8('0x35')]=_[_0xfab8('0x4d')](db[_0xfab8('0x31')][_0xfab8('0x32')]);_0x10e6a3[_0xfab8('0x37')]=_[_0xfab8('0x4d')](_0x501ccd[_0xfab8('0x37')]);_0x10e6a3['filters']=_[_0xfab8('0x38')](_0x10e6a3[_0xfab8('0x35')],_0x10e6a3[_0xfab8('0x37')]);_0x45d4de['attributes']=_['intersection'](_0x10e6a3['model'],qs[_0xfab8('0x3a')](_0x501ccd['query']['fields']));_0x45d4de[_0xfab8('0x39')]=_0x45d4de[_0xfab8('0x39')][_0xfab8('0x3b')]?_0x45d4de[_0xfab8('0x39')]:_0x10e6a3[_0xfab8('0x35')];if(_0x501ccd['query'][_0xfab8('0x47')]){_0x45d4de[_0xfab8('0x48')]=[{'all':!![]}];}_0x45d4de=_['merge']({},_0x45d4de,_0x501ccd[_0xfab8('0x46')]);return db['SmsQueueReport'][_0xfab8('0x4e')](_0x45d4de)[_0xfab8('0x29')](handleEntityNotFound(_0x208e59,null))[_0xfab8('0x29')](respondWithResult(_0x208e59,null))[_0xfab8('0x4a')](handleError(_0x208e59,null));};exports['create']=function(_0x3d4e0c,_0x2b3eb4){return db[_0xfab8('0x31')]['create'](_0x3d4e0c['body'],{})[_0xfab8('0x29')](respondWithResult(_0x2b3eb4,0xc9))[_0xfab8('0x4a')](handleError(_0x2b3eb4,null));};exports[_0xfab8('0x28')]=function(_0x37baf1,_0x833150){if(_0x37baf1['body']['id']){delete _0x37baf1[_0xfab8('0x4f')]['id'];}return db[_0xfab8('0x31')][_0xfab8('0x4e')]({'where':{'id':_0x37baf1['params']['id']}})[_0xfab8('0x29')](handleEntityNotFound(_0x833150,null))['then'](saveUpdates(_0x37baf1[_0xfab8('0x4f')],null))[_0xfab8('0x29')](respondWithResult(_0x833150,null))[_0xfab8('0x4a')](handleError(_0x833150,null));};exports[_0xfab8('0x2a')]=function(_0x4a2a92,_0x45b8bf){return db[_0xfab8('0x31')][_0xfab8('0x4e')]({'where':{'id':_0x4a2a92['params']['id']}})[_0xfab8('0x29')](handleEntityNotFound(_0x45b8bf,null))[_0xfab8('0x29')](removeEntity(_0x45b8bf,null))['catch'](handleError(_0x45b8bf,null));};exports[_0xfab8('0x50')]=function(_0x2515d5,_0x4d4c18){return db['SmsQueueReport'][_0xfab8('0x50')]()[_0xfab8('0x29')](respondWithResult(_0x4d4c18,null))[_0xfab8('0x4a')](handleError(_0x4d4c18,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index dbdddcc..434e66a 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x367fb2,_0x51c67a){var _0x281962=function(_0x18bae1){while(--_0x18bae1){_0x367fb2['push'](_0x367fb2['shift']());}};_0x281962(++_0x51c67a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x24b9ea,_0x5b8e19){var _0x3c0d85=function(_0x190b46){while(--_0x190b46){_0x24b9ea['push'](_0x24b9ea['shift']());}};_0x3c0d85(++_0x5b8e19);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 4f88293..6cf081f 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 _0x4706=['body','where','attributes','limit','debug','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw','stringify','UpdateSmsQueueReport','update'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x4706,0x10e));var _0x6470=function(_0x2150cd,_0x7f1553){_0x2150cd=_0x2150cd-0x0;var _0x411a35=_0x4706[_0x2150cd];return _0x411a35;};'use strict';var _=require(_0x6470('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6470('0x1'));var rs=require(_0x6470('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6470('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6470('0x4'))(_0x6470('0x5'));var config=require(_0x6470('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6470('0x7')][_0x6470('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x457fbd,_0x511bcd,_0x360046){return new BPromise(function(_0x18c64c,_0x428b2b){return client[_0x6470('0x9')](_0x457fbd,_0x360046)[_0x6470('0xa')](function(_0x591b6b){logger[_0x6470('0xb')](_0x6470('0xc'),_0x511bcd,_0x6470('0xd'));logger['debug'](_0x6470('0xe'),_0x511bcd,_0x6470('0xd'),JSON['stringify'](_0x591b6b));if(_0x591b6b[_0x6470('0xf')]){if(_0x591b6b[_0x6470('0xf')][_0x6470('0x10')]===0x1f4){logger[_0x6470('0xf')](_0x6470('0xc'),_0x511bcd,_0x591b6b[_0x6470('0xf')][_0x6470('0x11')]);return _0x428b2b(_0x591b6b['error'][_0x6470('0x11')]);}logger['error'](_0x6470('0xc'),_0x511bcd,_0x591b6b[_0x6470('0xf')]['message']);return _0x18c64c(_0x591b6b[_0x6470('0xf')][_0x6470('0x11')]);}else{logger[_0x6470('0xb')](_0x6470('0xc'),_0x511bcd,_0x6470('0xd'));_0x18c64c(_0x591b6b[_0x6470('0x12')][_0x6470('0x11')]);}})['catch'](function(_0x4def6c){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x511bcd,_0x4def6c);_0x428b2b(_0x4def6c);});});}exports[_0x6470('0x13')]=function(_0x15fd99){var _0x45a113=this;return new Promise(function(_0x227114,_0x197657){return db[_0x6470('0x14')][_0x6470('0x15')](_0x15fd99['body'],{'raw':_0x15fd99[_0x6470('0x16')]?_0x15fd99[_0x6470('0x16')][_0x6470('0x17')]===undefined?!![]:![]:!![]})[_0x6470('0xa')](function(_0xca1780){logger['info'](_0x6470('0x13'),_0x15fd99);logger['debug']('CreateSmsQueueReport',_0x15fd99,JSON[_0x6470('0x18')](_0xca1780));_0x227114(_0xca1780);})['catch'](function(_0x59d25b){logger['error']('CreateSmsQueueReport',_0x59d25b[_0x6470('0x11')],_0x15fd99);_0x197657(_0x45a113[_0x6470('0xf')](0x1f4,_0x59d25b[_0x6470('0x11')]));});});};exports[_0x6470('0x19')]=function(_0x33161e){var _0x3ebc66=this;return new Promise(function(_0x27ca9a,_0x34c7b7){return db[_0x6470('0x14')][_0x6470('0x1a')](_0x33161e[_0x6470('0x1b')],{'raw':_0x33161e[_0x6470('0x16')]?_0x33161e[_0x6470('0x16')][_0x6470('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33161e['options']?_0x33161e[_0x6470('0x16')][_0x6470('0x1c')]||null:null,'attributes':_0x33161e['options']?_0x33161e[_0x6470('0x16')][_0x6470('0x1d')]||null:null,'limit':_0x33161e[_0x6470('0x16')]?_0x33161e['options'][_0x6470('0x1e')]||null:null})[_0x6470('0xa')](function(_0x55291a){logger['info'](_0x6470('0x19'),_0x33161e);logger[_0x6470('0x1f')](_0x6470('0x19'),_0x33161e,JSON[_0x6470('0x18')](_0x55291a));_0x27ca9a(_0x55291a);})[_0x6470('0x20')](function(_0x2c90c8){logger[_0x6470('0xf')](_0x6470('0x19'),_0x2c90c8[_0x6470('0x11')],_0x33161e);_0x34c7b7(_0x3ebc66[_0x6470('0xf')](0x1f4,_0x2c90c8[_0x6470('0x11')]));});});}; \ No newline at end of file +var _0xfacf=['info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','debug','stringify','catch','UpdateSmsQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xfacf,0x181));var _0xffac=function(_0x2306d4,_0x4b800c){_0x2306d4=_0x2306d4-0x0;var _0x30a24a=_0xfacf[_0x2306d4];return _0x30a24a;};'use strict';var _=require('lodash');var util=require(_0xffac('0x0'));var moment=require(_0xffac('0x1'));var BPromise=require(_0xffac('0x2'));var rs=require(_0xffac('0x3'));var fs=require('fs');var Redis=require(_0xffac('0x4'));var db=require(_0xffac('0x5'))['db'];var utils=require(_0xffac('0x6'));var logger=require(_0xffac('0x7'))('rpc');var config=require(_0xffac('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3619,_0x2bffd3,_0x4273ec){return new BPromise(function(_0x1f73a5,_0x4cb0ea){return client[_0xffac('0x9')](_0x2e3619,_0x4273ec)[_0xffac('0xa')](function(_0x1cd455){logger[_0xffac('0xb')](_0xffac('0xc'),_0x2bffd3,'request\x20sent');logger['debug'](_0xffac('0xd'),_0x2bffd3,'request\x20sent',JSON['stringify'](_0x1cd455));if(_0x1cd455[_0xffac('0xe')]){if(_0x1cd455[_0xffac('0xe')][_0xffac('0xf')]===0x1f4){logger[_0xffac('0xe')](_0xffac('0xc'),_0x2bffd3,_0x1cd455[_0xffac('0xe')]['message']);return _0x4cb0ea(_0x1cd455[_0xffac('0xe')][_0xffac('0x10')]);}logger[_0xffac('0xe')](_0xffac('0xc'),_0x2bffd3,_0x1cd455[_0xffac('0xe')][_0xffac('0x10')]);return _0x1f73a5(_0x1cd455[_0xffac('0xe')]['message']);}else{logger[_0xffac('0xb')](_0xffac('0xc'),_0x2bffd3,_0xffac('0x11'));_0x1f73a5(_0x1cd455[_0xffac('0x12')][_0xffac('0x10')]);}})['catch'](function(_0x598860){logger[_0xffac('0xe')](_0xffac('0xc'),_0x2bffd3,_0x598860);_0x4cb0ea(_0x598860);});});}exports[_0xffac('0x13')]=function(_0x3334a3){var _0x2a43ea=this;return new Promise(function(_0xcb7deb,_0x5175a1){return db[_0xffac('0x14')][_0xffac('0x15')](_0x3334a3[_0xffac('0x16')],{'raw':_0x3334a3[_0xffac('0x17')]?_0x3334a3[_0xffac('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xffac('0xa')](function(_0x5cc0f4){logger['info'](_0xffac('0x13'),_0x3334a3);logger[_0xffac('0x18')]('CreateSmsQueueReport',_0x3334a3,JSON[_0xffac('0x19')](_0x5cc0f4));_0xcb7deb(_0x5cc0f4);})[_0xffac('0x1a')](function(_0x34c072){logger[_0xffac('0xe')](_0xffac('0x13'),_0x34c072['message'],_0x3334a3);_0x5175a1(_0x2a43ea[_0xffac('0xe')](0x1f4,_0x34c072['message']));});});};exports[_0xffac('0x1b')]=function(_0x1a89af){var _0x310281=this;return new Promise(function(_0xaba343,_0x3082e3){return db[_0xffac('0x14')][_0xffac('0x1c')](_0x1a89af[_0xffac('0x16')],{'raw':_0x1a89af[_0xffac('0x17')]?_0x1a89af[_0xffac('0x17')][_0xffac('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a89af['options']?_0x1a89af['options'][_0xffac('0x1e')]||null:null,'attributes':_0x1a89af[_0xffac('0x17')]?_0x1a89af[_0xffac('0x17')][_0xffac('0x1f')]||null:null,'limit':_0x1a89af[_0xffac('0x17')]?_0x1a89af[_0xffac('0x17')][_0xffac('0x20')]||null:null})[_0xffac('0xa')](function(_0x22436c){logger[_0xffac('0xb')]('UpdateSmsQueueReport',_0x1a89af);logger[_0xffac('0x18')](_0xffac('0x1b'),_0x1a89af,JSON['stringify'](_0x22436c));_0xaba343(_0x22436c);})[_0xffac('0x1a')](function(_0x3031ef){logger[_0xffac('0xe')](_0xffac('0x1b'),_0x3031ef['message'],_0x1a89af);_0x3082e3(_0x310281[_0xffac('0xe')](0x1f4,_0x3031ef['message']));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index f59be94..f0956e7 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 _0xfd87=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x429003,_0x3508da){var _0x3cc0d9=function(_0x1bc27c){while(--_0x1bc27c){_0x429003['push'](_0x429003['shift']());}};_0x3cc0d9(++_0x3508da);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')](_0x7fd8('0x10'),auth['isAuthenticated'](),controller[_0x7fd8('0x11')]);router[_0x7fd8('0x12')]('/',auth[_0x7fd8('0xb')](),controller['create']);router['put']('/:id',auth[_0x7fd8('0xb')](),controller['update']);router[_0x7fd8('0x13')](_0x7fd8('0x10'),auth[_0x7fd8('0xb')](),controller['destroy']);module[_0x7fd8('0x14')]=router; \ No newline at end of file +var _0xe0c3=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x245134,_0x596efb){var _0x56671d=function(_0x3b67db){while(--_0x3b67db){_0x245134['push'](_0x245134['shift']());}};_0x56671d(++_0x596efb);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xb')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')]('/',auth[_0x3e0c('0xd')](),controller['create']);router['put'](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);router[_0x3e0c('0x13')](_0x3e0c('0xf'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a328b69..b4bcec6 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x4f2d48,_0x45758b){var _0x2eb86b=function(_0x2836c2){while(--_0x2836c2){_0x4f2d48['push'](_0x4f2d48['shift']());}};_0x2eb86b(++_0x45758b);}(_0x70e0,0x17b));var _0x070e=function(_0x358a68,_0x2a6e24){_0x358a68=_0x358a68-0x0;var _0x48c518=_0x70e0[_0x358a68];return _0x48c518;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3351ce,_0x384a86){var _0x5818f7=function(_0x57c0e6){while(--_0x57c0e6){_0x3351ce['push'](_0x3351ce['shift']());}};_0x5818f7(++_0x384a86);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0xf3cd[_0x404cde];return _0x139882;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 3e1dd5c..4f033a8 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 _0xa715=['api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa715,0x1e2));var _0x5a71=function(_0x1e6de9,_0x3d595f){_0x1e6de9=_0x1e6de9-0x0;var _0x5e3dd2=_0xa715[_0x1e6de9];return _0x5e3dd2;};'use strict';var emlformat=require(_0x5a71('0x0'));var rimraf=require(_0x5a71('0x1'));var zipdir=require(_0x5a71('0x2'));var jsonpatch=require(_0x5a71('0x3'));var rp=require(_0x5a71('0x4'));var moment=require(_0x5a71('0x5'));var BPromise=require(_0x5a71('0x6'));var Mustache=require(_0x5a71('0x7'));var util=require(_0x5a71('0x8'));var path=require('path');var sox=require(_0x5a71('0x9'));var csv=require(_0x5a71('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a71('0xb'));var _=require(_0x5a71('0xc'));var squel=require(_0x5a71('0xd'));var crypto=require(_0x5a71('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5a71('0xf'));var toCsv=require(_0x5a71('0xa'));var querystring=require(_0x5a71('0x10'));var Papa=require(_0x5a71('0x11'));var Redis=require(_0x5a71('0x12'));var authService=require(_0x5a71('0x13'));var qs=require(_0x5a71('0x14'));var as=require(_0x5a71('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a71('0x16'));var utils=require(_0x5a71('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5a71('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46dbc9,_0x3bb0c2){_0x3bb0c2=_0x3bb0c2||0xcc;return function(_0x42b97c){if(_0x42b97c){return _0x46dbc9[_0x5a71('0x19')](_0x3bb0c2);}return _0x46dbc9[_0x5a71('0x1a')](_0x3bb0c2)['end']();};}function respondWithResult(_0x3c62db,_0x46e6ed){_0x46e6ed=_0x46e6ed||0xc8;return function(_0x413ec5){if(_0x413ec5){return _0x3c62db['status'](_0x46e6ed)[_0x5a71('0x1b')](_0x413ec5);}};}function respondWithFilteredResult(_0x5ebccc,_0x1ac007){return function(_0x26f66){if(_0x26f66){var _0x43c99a=typeof _0x1ac007[_0x5a71('0x1c')]==='undefined'&&typeof _0x1ac007[_0x5a71('0x1d')]==='undefined';var _0x4d06b8=_0x26f66[_0x5a71('0x1e')];var _0x18a566=_0x43c99a?0x0:_0x1ac007['offset'];var _0x4be00e=_0x43c99a?_0x26f66[_0x5a71('0x1e')]:_0x1ac007[_0x5a71('0x1c')]+_0x1ac007['limit'];var _0x30baaf;if(_0x4be00e>=_0x4d06b8){_0x4be00e=_0x4d06b8;_0x30baaf=0xc8;}else{_0x30baaf=0xce;}_0x5ebccc[_0x5a71('0x1a')](_0x30baaf);return _0x5ebccc['set'](_0x5a71('0x1f'),_0x18a566+'-'+_0x4be00e+'/'+_0x4d06b8)[_0x5a71('0x1b')](_0x26f66);}return null;};}function patchUpdates(_0xed9eab){return function(_0x1936c6){try{jsonpatch[_0x5a71('0x20')](_0x1936c6,_0xed9eab,!![]);}catch(_0x2eb618){return BPromise[_0x5a71('0x21')](_0x2eb618);}return _0x1936c6[_0x5a71('0x22')]();};}function saveUpdates(_0xaf4cfc,_0xd00ffd){return function(_0x475e8e){if(_0x475e8e){return _0x475e8e['update'](_0xaf4cfc)[_0x5a71('0x23')](function(_0x27f69d){return _0x27f69d;});}return null;};}function removeEntity(_0x506951,_0xea6e61){return function(_0x3ef569){if(_0x3ef569){return _0x3ef569[_0x5a71('0x24')]()[_0x5a71('0x23')](function(){_0x506951[_0x5a71('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f36a5,_0xaa3be4){return function(_0xe6b419){if(!_0xe6b419){_0x5f36a5[_0x5a71('0x19')](0x194);}return _0xe6b419;};}function handleError(_0x4aed8d,_0x139982){_0x139982=_0x139982||0x1f4;return function(_0x438614){logger[_0x5a71('0x25')](_0x438614[_0x5a71('0x26')]);if(_0x438614[_0x5a71('0x27')]){delete _0x438614[_0x5a71('0x27')];}_0x4aed8d[_0x5a71('0x1a')](_0x139982)['send'](_0x438614);};}exports['index']=function(_0x5ecb46,_0xa61a88){var _0x13e914={},_0x102ff9={},_0x10e46d={'count':0x0,'rows':[]};var _0x859b55=_[_0x5a71('0x28')](db[_0x5a71('0x29')][_0x5a71('0x2a')],function(_0xe07315){return{'name':_0xe07315[_0x5a71('0x2b')],'type':_0xe07315[_0x5a71('0x2c')]['key']};});_0x102ff9[_0x5a71('0x2d')]=_[_0x5a71('0x28')](_0x859b55,_0x5a71('0x27'));_0x102ff9[_0x5a71('0x2e')]=_['keys'](_0x5ecb46[_0x5a71('0x2e')]);_0x102ff9[_0x5a71('0x2f')]=_[_0x5a71('0x30')](_0x102ff9[_0x5a71('0x2d')],_0x102ff9[_0x5a71('0x2e')]);_0x13e914['attributes']=_['intersection'](_0x102ff9[_0x5a71('0x2d')],qs[_0x5a71('0x31')](_0x5ecb46[_0x5a71('0x2e')][_0x5a71('0x31')]));_0x13e914[_0x5a71('0x32')]=_0x13e914[_0x5a71('0x32')]['length']?_0x13e914[_0x5a71('0x32')]:_0x102ff9[_0x5a71('0x2d')];if(!_0x5ecb46[_0x5a71('0x2e')]['hasOwnProperty'](_0x5a71('0x33'))){_0x13e914[_0x5a71('0x1d')]=qs['limit'](_0x5ecb46[_0x5a71('0x2e')][_0x5a71('0x1d')]);_0x13e914['offset']=qs[_0x5a71('0x1c')](_0x5ecb46['query'][_0x5a71('0x1c')]);}_0x13e914[_0x5a71('0x34')]=qs[_0x5a71('0x35')](_0x5ecb46[_0x5a71('0x2e')][_0x5a71('0x35')]);_0x13e914[_0x5a71('0x36')]=qs[_0x5a71('0x2f')](_[_0x5a71('0x37')](_0x5ecb46['query'],_0x102ff9[_0x5a71('0x2f')]),_0x859b55);if(_0x5ecb46['query'][_0x5a71('0x38')]){_0x13e914[_0x5a71('0x36')]=_[_0x5a71('0x39')](_0x13e914[_0x5a71('0x36')],{'$or':_[_0x5a71('0x28')](_0x859b55,function(_0x5f26d8){if(_0x5f26d8[_0x5a71('0x2c')]!==_0x5a71('0x3a')){var _0x3de926={};_0x3de926[_0x5f26d8['name']]={'$like':'%'+_0x5ecb46['query'][_0x5a71('0x38')]+'%'};return _0x3de926;}})});}_0x13e914=_[_0x5a71('0x39')]({},_0x13e914,_0x5ecb46[_0x5a71('0x3b')]);var _0x498113={'where':_0x13e914[_0x5a71('0x36')]};return db[_0x5a71('0x29')]['count'](_0x498113)[_0x5a71('0x23')](function(_0x5503db){_0x10e46d[_0x5a71('0x1e')]=_0x5503db;if(_0x5ecb46['query'][_0x5a71('0x3c')]){_0x13e914[_0x5a71('0x3d')]=[{'all':!![]}];}return db[_0x5a71('0x29')][_0x5a71('0x3e')](_0x13e914);})[_0x5a71('0x23')](function(_0x5606d5){_0x10e46d['rows']=_0x5606d5;return _0x10e46d;})[_0x5a71('0x23')](respondWithFilteredResult(_0xa61a88,_0x13e914))[_0x5a71('0x3f')](handleError(_0xa61a88,null));};exports[_0x5a71('0x40')]=function(_0x13f2dd,_0x508435){var _0x47e773={'raw':!![],'where':{'id':_0x13f2dd[_0x5a71('0x41')]['id']}},_0x111250={};_0x111250[_0x5a71('0x2d')]=_[_0x5a71('0x42')](db[_0x5a71('0x29')]['rawAttributes']);_0x111250[_0x5a71('0x2e')]=_[_0x5a71('0x42')](_0x13f2dd[_0x5a71('0x2e')]);_0x111250[_0x5a71('0x2f')]=_[_0x5a71('0x30')](_0x111250['model'],_0x111250[_0x5a71('0x2e')]);_0x47e773[_0x5a71('0x32')]=_[_0x5a71('0x30')](_0x111250[_0x5a71('0x2d')],qs['fields'](_0x13f2dd['query']['fields']));_0x47e773[_0x5a71('0x32')]=_0x47e773[_0x5a71('0x32')][_0x5a71('0x43')]?_0x47e773[_0x5a71('0x32')]:_0x111250[_0x5a71('0x2d')];if(_0x13f2dd[_0x5a71('0x2e')]['includeAll']){_0x47e773['include']=[{'all':!![]}];}_0x47e773=_[_0x5a71('0x39')]({},_0x47e773,_0x13f2dd['options']);return db['SmsTransferReport']['find'](_0x47e773)[_0x5a71('0x23')](handleEntityNotFound(_0x508435,null))[_0x5a71('0x23')](respondWithResult(_0x508435,null))[_0x5a71('0x3f')](handleError(_0x508435,null));};exports['create']=function(_0x10a215,_0x4c90a1){return db[_0x5a71('0x29')]['create'](_0x10a215[_0x5a71('0x44')],{})[_0x5a71('0x23')](respondWithResult(_0x4c90a1,0xc9))['catch'](handleError(_0x4c90a1,null));};exports[_0x5a71('0x45')]=function(_0x565c4b,_0x597535){if(_0x565c4b[_0x5a71('0x44')]['id']){delete _0x565c4b[_0x5a71('0x44')]['id'];}return db[_0x5a71('0x29')][_0x5a71('0x46')]({'where':{'id':_0x565c4b['params']['id']}})[_0x5a71('0x23')](handleEntityNotFound(_0x597535,null))[_0x5a71('0x23')](saveUpdates(_0x565c4b[_0x5a71('0x44')],null))[_0x5a71('0x23')](respondWithResult(_0x597535,null))[_0x5a71('0x3f')](handleError(_0x597535,null));};exports['destroy']=function(_0x48939b,_0x4ef5b3){return db[_0x5a71('0x29')][_0x5a71('0x46')]({'where':{'id':_0x48939b[_0x5a71('0x41')]['id']}})['then'](handleEntityNotFound(_0x4ef5b3,null))[_0x5a71('0x23')](removeEntity(_0x4ef5b3,null))['catch'](handleError(_0x4ef5b3,null));};exports[_0x5a71('0x47')]=function(_0x555f31,_0x3f06ab){return db[_0x5a71('0x29')][_0x5a71('0x47')]()[_0x5a71('0x23')](respondWithResult(_0x3f06ab,null))[_0x5a71('0x3f')](handleError(_0x3f06ab,null));}; \ No newline at end of file +var _0x4a15=['stack','name','map','SmsTransferReport','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','reject','update','then','destroy','error'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0x4a15,0x110));var _0x54a1=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0x4a15[_0x25fa5c];return _0x1bade2;};'use strict';var emlformat=require(_0x54a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x54a1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x54a1('0x2'));var moment=require(_0x54a1('0x3'));var BPromise=require(_0x54a1('0x4'));var Mustache=require(_0x54a1('0x5'));var util=require(_0x54a1('0x6'));var path=require(_0x54a1('0x7'));var sox=require(_0x54a1('0x8'));var csv=require(_0x54a1('0x9'));var ejs=require(_0x54a1('0xa'));var fs=require('fs');var fs_extra=require(_0x54a1('0xb'));var _=require(_0x54a1('0xc'));var squel=require('squel');var crypto=require(_0x54a1('0xd'));var jsforce=require(_0x54a1('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x54a1('0x9'));var querystring=require(_0x54a1('0xf'));var Papa=require(_0x54a1('0x10'));var Redis=require('ioredis');var authService=require(_0x54a1('0x11'));var qs=require(_0x54a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54a1('0x13'));var logger=require(_0x54a1('0x14'))(_0x54a1('0x15'));var utils=require(_0x54a1('0x16'));var config=require(_0x54a1('0x17'));var licenseUtil=require(_0x54a1('0x18'));var db=require(_0x54a1('0x19'))['db'];function respondWithStatusCode(_0x2d6038,_0x426a4f){_0x426a4f=_0x426a4f||0xcc;return function(_0x2e7d65){if(_0x2e7d65){return _0x2d6038[_0x54a1('0x1a')](_0x426a4f);}return _0x2d6038[_0x54a1('0x1b')](_0x426a4f)[_0x54a1('0x1c')]();};}function respondWithResult(_0x263859,_0x1ad1d3){_0x1ad1d3=_0x1ad1d3||0xc8;return function(_0x560d9d){if(_0x560d9d){return _0x263859[_0x54a1('0x1b')](_0x1ad1d3)[_0x54a1('0x1d')](_0x560d9d);}};}function respondWithFilteredResult(_0x5801df,_0x4d1cd3){return function(_0x3a4e5a){if(_0x3a4e5a){var _0x3cfda0=typeof _0x4d1cd3['offset']===_0x54a1('0x1e')&&typeof _0x4d1cd3['limit']===_0x54a1('0x1e');var _0x407860=_0x3a4e5a['count'];var _0x249448=_0x3cfda0?0x0:_0x4d1cd3[_0x54a1('0x1f')];var _0x4ede76=_0x3cfda0?_0x3a4e5a['count']:_0x4d1cd3['offset']+_0x4d1cd3[_0x54a1('0x20')];var _0x50f901;if(_0x4ede76>=_0x407860){_0x4ede76=_0x407860;_0x50f901=0xc8;}else{_0x50f901=0xce;}_0x5801df[_0x54a1('0x1b')](_0x50f901);return _0x5801df[_0x54a1('0x21')](_0x54a1('0x22'),_0x249448+'-'+_0x4ede76+'/'+_0x407860)[_0x54a1('0x1d')](_0x3a4e5a);}return null;};}function patchUpdates(_0x44a851){return function(_0x1cfe86){try{jsonpatch['apply'](_0x1cfe86,_0x44a851,!![]);}catch(_0xfb106a){return BPromise[_0x54a1('0x23')](_0xfb106a);}return _0x1cfe86['save']();};}function saveUpdates(_0x1c349a,_0x217994){return function(_0xc4723c){if(_0xc4723c){return _0xc4723c[_0x54a1('0x24')](_0x1c349a)[_0x54a1('0x25')](function(_0x4d7b9a){return _0x4d7b9a;});}return null;};}function removeEntity(_0x1884fc,_0x2ba033){return function(_0x250858){if(_0x250858){return _0x250858[_0x54a1('0x26')]()[_0x54a1('0x25')](function(){_0x1884fc[_0x54a1('0x1b')](0xcc)[_0x54a1('0x1c')]();});}};}function handleEntityNotFound(_0x1ab043,_0x4eb483){return function(_0x4da413){if(!_0x4da413){_0x1ab043[_0x54a1('0x1a')](0x194);}return _0x4da413;};}function handleError(_0x43b8e2,_0x529029){_0x529029=_0x529029||0x1f4;return function(_0x453319){logger[_0x54a1('0x27')](_0x453319[_0x54a1('0x28')]);if(_0x453319[_0x54a1('0x29')]){delete _0x453319[_0x54a1('0x29')];}_0x43b8e2['status'](_0x529029)['send'](_0x453319);};}exports['index']=function(_0x6cb8ca,_0x446a90){var _0x10d962={},_0x2b5c95={},_0x4665fb={'count':0x0,'rows':[]};var _0x2ed243=_[_0x54a1('0x2a')](db[_0x54a1('0x2b')][_0x54a1('0x2c')],function(_0x6b03e2){return{'name':_0x6b03e2[_0x54a1('0x2d')],'type':_0x6b03e2[_0x54a1('0x2e')][_0x54a1('0x2f')]};});_0x2b5c95['model']=_[_0x54a1('0x2a')](_0x2ed243,_0x54a1('0x29'));_0x2b5c95['query']=_[_0x54a1('0x30')](_0x6cb8ca[_0x54a1('0x31')]);_0x2b5c95['filters']=_[_0x54a1('0x32')](_0x2b5c95[_0x54a1('0x33')],_0x2b5c95[_0x54a1('0x31')]);_0x10d962[_0x54a1('0x34')]=_['intersection'](_0x2b5c95[_0x54a1('0x33')],qs[_0x54a1('0x35')](_0x6cb8ca['query'][_0x54a1('0x35')]));_0x10d962[_0x54a1('0x34')]=_0x10d962[_0x54a1('0x34')][_0x54a1('0x36')]?_0x10d962[_0x54a1('0x34')]:_0x2b5c95['model'];if(!_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x37')](_0x54a1('0x38'))){_0x10d962[_0x54a1('0x20')]=qs['limit'](_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x20')]);_0x10d962[_0x54a1('0x1f')]=qs[_0x54a1('0x1f')](_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x1f')]);}_0x10d962[_0x54a1('0x39')]=qs[_0x54a1('0x3a')](_0x6cb8ca[_0x54a1('0x31')]['sort']);_0x10d962['where']=qs[_0x54a1('0x3b')](_[_0x54a1('0x3c')](_0x6cb8ca[_0x54a1('0x31')],_0x2b5c95[_0x54a1('0x3b')]),_0x2ed243);if(_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x3d')]){_0x10d962[_0x54a1('0x3e')]=_[_0x54a1('0x3f')](_0x10d962['where'],{'$or':_[_0x54a1('0x2a')](_0x2ed243,function(_0x1d01e1){if(_0x1d01e1[_0x54a1('0x2e')]!==_0x54a1('0x40')){var _0x57a727={};_0x57a727[_0x1d01e1[_0x54a1('0x29')]]={'$like':'%'+_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x3d')]+'%'};return _0x57a727;}})});}_0x10d962=_[_0x54a1('0x3f')]({},_0x10d962,_0x6cb8ca[_0x54a1('0x41')]);var _0x466506={'where':_0x10d962[_0x54a1('0x3e')]};return db['SmsTransferReport'][_0x54a1('0x42')](_0x466506)[_0x54a1('0x25')](function(_0x22b1ca){_0x4665fb[_0x54a1('0x42')]=_0x22b1ca;if(_0x6cb8ca[_0x54a1('0x31')][_0x54a1('0x43')]){_0x10d962['include']=[{'all':!![]}];}return db[_0x54a1('0x2b')][_0x54a1('0x44')](_0x10d962);})[_0x54a1('0x25')](function(_0x31b818){_0x4665fb[_0x54a1('0x45')]=_0x31b818;return _0x4665fb;})[_0x54a1('0x25')](respondWithFilteredResult(_0x446a90,_0x10d962))['catch'](handleError(_0x446a90,null));};exports[_0x54a1('0x46')]=function(_0x28ea84,_0x15a294){var _0x58a908={'raw':!![],'where':{'id':_0x28ea84[_0x54a1('0x47')]['id']}},_0x5bc590={};_0x5bc590[_0x54a1('0x33')]=_['keys'](db[_0x54a1('0x2b')][_0x54a1('0x2c')]);_0x5bc590[_0x54a1('0x31')]=_['keys'](_0x28ea84['query']);_0x5bc590['filters']=_[_0x54a1('0x32')](_0x5bc590[_0x54a1('0x33')],_0x5bc590[_0x54a1('0x31')]);_0x58a908[_0x54a1('0x34')]=_[_0x54a1('0x32')](_0x5bc590[_0x54a1('0x33')],qs[_0x54a1('0x35')](_0x28ea84[_0x54a1('0x31')]['fields']));_0x58a908['attributes']=_0x58a908[_0x54a1('0x34')][_0x54a1('0x36')]?_0x58a908[_0x54a1('0x34')]:_0x5bc590[_0x54a1('0x33')];if(_0x28ea84[_0x54a1('0x31')][_0x54a1('0x43')]){_0x58a908[_0x54a1('0x48')]=[{'all':!![]}];}_0x58a908=_['merge']({},_0x58a908,_0x28ea84['options']);return db[_0x54a1('0x2b')][_0x54a1('0x49')](_0x58a908)['then'](handleEntityNotFound(_0x15a294,null))['then'](respondWithResult(_0x15a294,null))[_0x54a1('0x4a')](handleError(_0x15a294,null));};exports[_0x54a1('0x4b')]=function(_0x855e9b,_0x55c5be){return db['SmsTransferReport']['create'](_0x855e9b['body'],{})[_0x54a1('0x25')](respondWithResult(_0x55c5be,0xc9))[_0x54a1('0x4a')](handleError(_0x55c5be,null));};exports[_0x54a1('0x24')]=function(_0x493041,_0x214a82){if(_0x493041[_0x54a1('0x4c')]['id']){delete _0x493041[_0x54a1('0x4c')]['id'];}return db[_0x54a1('0x2b')][_0x54a1('0x49')]({'where':{'id':_0x493041[_0x54a1('0x47')]['id']}})[_0x54a1('0x25')](handleEntityNotFound(_0x214a82,null))[_0x54a1('0x25')](saveUpdates(_0x493041[_0x54a1('0x4c')],null))[_0x54a1('0x25')](respondWithResult(_0x214a82,null))[_0x54a1('0x4a')](handleError(_0x214a82,null));};exports[_0x54a1('0x26')]=function(_0x496663,_0x3101ee){return db['SmsTransferReport']['find']({'where':{'id':_0x496663[_0x54a1('0x47')]['id']}})[_0x54a1('0x25')](handleEntityNotFound(_0x3101ee,null))['then'](removeEntity(_0x3101ee,null))[_0x54a1('0x4a')](handleError(_0x3101ee,null));};exports[_0x54a1('0x4d')]=function(_0x384494,_0xaa999e){return db[_0x54a1('0x2b')][_0x54a1('0x4d')]()['then'](respondWithResult(_0xaa999e,null))[_0x54a1('0x4a')](handleError(_0xaa999e,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 93969e3..17812dc 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 _0x8cce=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x46fe86,_0xaad9){var _0x2b6312=function(_0x47d5c2){while(--_0x47d5c2){_0x46fe86['push'](_0x46fe86['shift']());}};_0x2b6312(++_0xaad9);}(_0x8cce,0xee));var _0xe8cc=function(_0x5b10fa,_0x230615){_0x5b10fa=_0x5b10fa-0x0;var _0x3c58b0=_0x8cce[_0x5b10fa];return _0x3c58b0;};'use strict';var _=require(_0xe8cc('0x0'));var util=require(_0xe8cc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe8cc('0x2'));var BPromise=require(_0xe8cc('0x3'));var rp=require(_0xe8cc('0x4'));var fs=require('fs');var path=require(_0xe8cc('0x5'));var rimraf=require(_0xe8cc('0x6'));var config=require(_0xe8cc('0x7'));var attributes=require(_0xe8cc('0x8'));module[_0xe8cc('0x9')]=function(_0x32bfd5,_0xef7166){return _0x32bfd5[_0xe8cc('0xa')](_0xe8cc('0xb'),attributes,{'tableName':_0xe8cc('0xc'),'paranoid':![],'indexes':[{'name':_0xe8cc('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e69=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x4ab8fc,_0x27e5bd){var _0x4b30fb=function(_0x481755){while(--_0x481755){_0x4ab8fc['push'](_0x4ab8fc['shift']());}};_0x4b30fb(++_0x27e5bd);}(_0x9e69,0xcf));var _0x99e6=function(_0x3729bd,_0x16d623){_0x3729bd=_0x3729bd-0x0;var _0x1ffe50=_0x9e69[_0x3729bd];return _0x1ffe50;};'use strict';var _=require(_0x99e6('0x0'));var util=require('util');var logger=require(_0x99e6('0x1'))(_0x99e6('0x2'));var moment=require(_0x99e6('0x3'));var BPromise=require(_0x99e6('0x4'));var rp=require(_0x99e6('0x5'));var fs=require('fs');var path=require(_0x99e6('0x6'));var rimraf=require(_0x99e6('0x7'));var config=require('../../config/environment');var attributes=require(_0x99e6('0x8'));module[_0x99e6('0x9')]=function(_0x1c115d,_0x5f5d85){return _0x1c115d['define'](_0x99e6('0xa'),attributes,{'tableName':_0x99e6('0xb'),'paranoid':![],'indexes':[{'name':_0x99e6('0xc'),'fields':[_0x99e6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index a103f75..17a2666 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 _0x5b5a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2f6d9b,_0x3b0af3){var _0x4536fa=function(_0x3f1cbb){while(--_0x3f1cbb){_0x2f6d9b['push'](_0x2f6d9b['shift']());}};_0x4536fa(++_0x3b0af3);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x26930f,_0x2d582e){_0x26930f=_0x26930f-0x0;var _0x22ec6e=_0x5b5a[_0x26930f];return _0x22ec6e;};'use strict';var _=require('lodash');var util=require(_0xa5b5('0x0'));var moment=require(_0xa5b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5b5('0x2'));var fs=require('fs');var Redis=require(_0xa5b5('0x3'));var db=require(_0xa5b5('0x4'))['db'];var utils=require(_0xa5b5('0x5'));var logger=require(_0xa5b5('0x6'))(_0xa5b5('0x7'));var config=require(_0xa5b5('0x8'));var jayson=require(_0xa5b5('0x9'));var client=jayson['client'][_0xa5b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29c137,_0x513641,_0x32a09a){return new BPromise(function(_0x1936d6,_0x1157ee){return client[_0xa5b5('0xb')](_0x29c137,_0x32a09a)[_0xa5b5('0xc')](function(_0x307afa){logger[_0xa5b5('0xd')](_0xa5b5('0xe'),_0x513641,_0xa5b5('0xf'));logger[_0xa5b5('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x513641,'request\x20sent',JSON['stringify'](_0x307afa));if(_0x307afa['error']){if(_0x307afa[_0xa5b5('0x11')]['code']===0x1f4){logger[_0xa5b5('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x513641,_0x307afa[_0xa5b5('0x11')][_0xa5b5('0x12')]);return _0x1157ee(_0x307afa[_0xa5b5('0x11')][_0xa5b5('0x12')]);}logger[_0xa5b5('0x11')](_0xa5b5('0xe'),_0x513641,_0x307afa[_0xa5b5('0x11')]['message']);return _0x1936d6(_0x307afa['error'][_0xa5b5('0x12')]);}else{logger['info'](_0xa5b5('0xe'),_0x513641,_0xa5b5('0xf'));_0x1936d6(_0x307afa[_0xa5b5('0x13')]['message']);}})['catch'](function(_0x4d3274){logger['error'](_0xa5b5('0xe'),_0x513641,_0x4d3274);_0x1157ee(_0x4d3274);});});} \ No newline at end of file +var _0xae53=['../../config/environment','client','request','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x434577,_0x18d180){var _0x46f066=function(_0x5158c3){while(--_0x5158c3){_0x434577['push'](_0x434577['shift']());}};_0x46f066(++_0x18d180);}(_0xae53,0x16e));var _0x3ae5=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xae53[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x3ae5('0x0'));var util=require('util');var moment=require(_0x3ae5('0x1'));var BPromise=require(_0x3ae5('0x2'));var rs=require(_0x3ae5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ae5('0x4'))['db'];var utils=require(_0x3ae5('0x5'));var logger=require(_0x3ae5('0x6'))(_0x3ae5('0x7'));var config=require(_0x3ae5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ae5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2664cd,_0x2205f7,_0x29174e){return new BPromise(function(_0x3fdf89,_0x246603){return client[_0x3ae5('0xa')](_0x2664cd,_0x29174e)[_0x3ae5('0xb')](function(_0x223594){logger['info'](_0x3ae5('0xc'),_0x2205f7,'request\x20sent');logger[_0x3ae5('0xd')](_0x3ae5('0xe'),_0x2205f7,_0x3ae5('0xf'),JSON[_0x3ae5('0x10')](_0x223594));if(_0x223594[_0x3ae5('0x11')]){if(_0x223594['error'][_0x3ae5('0x12')]===0x1f4){logger[_0x3ae5('0x11')](_0x3ae5('0xc'),_0x2205f7,_0x223594['error']['message']);return _0x246603(_0x223594[_0x3ae5('0x11')]['message']);}logger[_0x3ae5('0x11')](_0x3ae5('0xc'),_0x2205f7,_0x223594[_0x3ae5('0x11')][_0x3ae5('0x13')]);return _0x3fdf89(_0x223594[_0x3ae5('0x11')]['message']);}else{logger[_0x3ae5('0x14')](_0x3ae5('0xc'),_0x2205f7,_0x3ae5('0xf'));_0x3fdf89(_0x223594['result']['message']);}})[_0x3ae5('0x15')](function(_0x1e5e0b){logger[_0x3ae5('0x11')](_0x3ae5('0xc'),_0x2205f7,_0x1e5e0b);_0x246603(_0x1e5e0b);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 58815ae..27e2f41 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 _0xfb6b=['file','create','put','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','now','extname','post','single'];(function(_0x448629,_0x2fc594){var _0x2690ab=function(_0x49d75e){while(--_0x49d75e){_0x448629['push'](_0x448629['shift']());}};_0x2690ab(++_0x2fc594);}(_0xfb6b,0x179));var _0xbfb6=function(_0xbb64ab,_0x51b83e){_0xbb64ab=_0xbb64ab-0x0;var _0x5e4466=_0xfb6b[_0xbb64ab];return _0x5e4466;};'use strict';var multer=require(_0xbfb6('0x0'));var util=require('util');var path=require(_0xbfb6('0x1'));var timeout=require(_0xbfb6('0x2'));var express=require(_0xbfb6('0x3'));var router=express['Router']();var fs_extra=require(_0xbfb6('0x4'));var auth=require(_0xbfb6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbfb6('0x6'));var controller=require(_0xbfb6('0x7'));router['get']('/',auth[_0xbfb6('0x8')](),controller[_0xbfb6('0x9')]);router[_0xbfb6('0xa')](_0xbfb6('0xb'),auth[_0xbfb6('0x8')](),controller[_0xbfb6('0xc')]);router[_0xbfb6('0xa')](_0xbfb6('0xd'),auth[_0xbfb6('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xbfb6('0xe')]({'destination':function(_0x196125,_0x4a712d,_0x1c60b4){_0x1c60b4(null,path[_0xbfb6('0xf')](config[_0xbfb6('0x10')],_0xbfb6('0x11')));},'filename':function(_0x5673f2,_0x2aa1a2,_0x20c923){_0x2aa1a2[_0xbfb6('0x12')]=_0x2aa1a2['originalname'][_0xbfb6('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20c923(null,util[_0xbfb6('0x14')](_0xbfb6('0x15'),path['basename'](_0x2aa1a2['originalname'],path['extname'](_0x2aa1a2[_0xbfb6('0x12')])),Date[_0xbfb6('0x16')](),path[_0xbfb6('0x17')](_0x2aa1a2[_0xbfb6('0x12')])));}})});router[_0xbfb6('0x18')]('/',upload[_0xbfb6('0x19')](_0xbfb6('0x1a')),controller[_0xbfb6('0x1b')]);router[_0xbfb6('0x1c')]('/:id',auth[_0xbfb6('0x8')](),controller['update']);router[_0xbfb6('0x1d')](_0xbfb6('0xb'),auth['isAuthenticated'](),controller[_0xbfb6('0x1d')]);module[_0xbfb6('0x1e')]=router; \ No newline at end of file +var _0xb64b=['join','root','server/files/sounds/original/','originalname','replace','format','basename','now','single','file','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','/:id','show','get','/:id/download','diskStorage'];(function(_0xc5b6f,_0x171456){var _0x340076=function(_0x1fce4a){while(--_0x1fce4a){_0xc5b6f['push'](_0xc5b6f['shift']());}};_0x340076(++_0x171456);}(_0xb64b,0x11d));var _0xbb64=function(_0x48b66e,_0x461edb){_0x48b66e=_0x48b66e-0x0;var _0x151723=_0xb64b[_0x48b66e];return _0x151723;};'use strict';var multer=require(_0xbb64('0x0'));var util=require(_0xbb64('0x1'));var path=require(_0xbb64('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb64('0x3')]();var fs_extra=require(_0xbb64('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb64('0x5'));var config=require(_0xbb64('0x6'));var controller=require(_0xbb64('0x7'));router['get']('/',auth[_0xbb64('0x8')](),controller[_0xbb64('0x9')]);router['get'](_0xbb64('0xa'),auth[_0xbb64('0x8')](),controller[_0xbb64('0xb')]);router[_0xbb64('0xc')](_0xbb64('0xd'),auth[_0xbb64('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xbb64('0xe')]({'destination':function(_0x58554b,_0x434c56,_0x1a751d){_0x1a751d(null,path[_0xbb64('0xf')](config[_0xbb64('0x10')],_0xbb64('0x11')));},'filename':function(_0x141842,_0x2978f0,_0x16f08f){_0x2978f0[_0xbb64('0x12')]=_0x2978f0[_0xbb64('0x12')][_0xbb64('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x16f08f(null,util[_0xbb64('0x14')]('%s-%s%s',path[_0xbb64('0x15')](_0x2978f0[_0xbb64('0x12')],path['extname'](_0x2978f0[_0xbb64('0x12')])),Date[_0xbb64('0x16')](),path['extname'](_0x2978f0[_0xbb64('0x12')])));}})});router['post']('/',upload[_0xbb64('0x17')](_0xbb64('0x18')),controller[_0xbb64('0x19')]);router[_0xbb64('0x1a')](_0xbb64('0xa'),auth['isAuthenticated'](),controller[_0xbb64('0x1b')]);router[_0xbb64('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xbb64('0x1c')]);module[_0xbb64('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 45c05ef..e9583ea 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 _0x207f=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0x207f,0x124));var _0xf207=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x207f[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xf207('0x0'));module[_0xf207('0x1')]={'name':{'type':Sequelize[_0xf207('0x2')],'unique':_0xf207('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf207('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xf207('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xf207('0x4')]},'original_sampleCount':{'type':Sequelize[_0xf207('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xf207('0x5')]},'original_sampleRate':{'type':Sequelize[_0xf207('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0xf207('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xf207('0x5')]},'converted_channelCount':{'type':Sequelize[_0xf207('0x6')]},'converted_bitRate':{'type':Sequelize[_0xf207('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xf207('0x6')]}}; \ No newline at end of file +var _0x8445=['FLOAT','INTEGER','BIGINT','sequelize','name','STRING'];(function(_0x27d350,_0x58eada){var _0x396a0c=function(_0x23f4fb){while(--_0x23f4fb){_0x27d350['push'](_0x27d350['shift']());}};_0x396a0c(++_0x58eada);}(_0x8445,0x1a7));var _0x5844=function(_0x392284,_0x3c44c6){_0x392284=_0x392284-0x0;var _0x1738c5=_0x8445[_0x392284];return _0x1738c5;};'use strict';var Sequelize=require(_0x5844('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5844('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x5844('0x2')]},'display_name':{'type':Sequelize[_0x5844('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x5844('0x2')]},'original_format':{'type':Sequelize[_0x5844('0x2')]},'original_duration':{'type':Sequelize[_0x5844('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x5844('0x4')]},'original_bitRate':{'type':Sequelize[_0x5844('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x5844('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x5844('0x4')]},'converted_bitRate':{'type':Sequelize[_0x5844('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 2a7762c..9f5fb11 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 _0xaccb=['length','download','find','save_name','existsSync','root','server/files/sounds/converted','converted_format','Sequelize','Sound\x20not\x20found','join','format','%s.%s','basename','file','originalname','filename','extname','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','original_duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','start','description','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','Sound','rawAttributes','fieldName','type','key','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys'];(function(_0x483181,_0x1496ec){var _0x4f274f=function(_0x5d47a5){while(--_0x5d47a5){_0x483181['push'](_0x483181['shift']());}};_0x4f274f(++_0x1496ec);}(_0xaccb,0x1c2));var _0xbacc=function(_0x4567d3,_0x3114e1){_0x4567d3=_0x4567d3-0x0;var _0x2b3dae=_0xaccb[_0x4567d3];return _0x2b3dae;};'use strict';var emlformat=require(_0xbacc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbacc('0x1'));var jsonpatch=require(_0xbacc('0x2'));var rp=require(_0xbacc('0x3'));var moment=require(_0xbacc('0x4'));var BPromise=require(_0xbacc('0x5'));var Mustache=require(_0xbacc('0x6'));var util=require(_0xbacc('0x7'));var path=require(_0xbacc('0x8'));var sox=require(_0xbacc('0x9'));var csv=require(_0xbacc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbacc('0xb'));var _=require(_0xbacc('0xc'));var squel=require(_0xbacc('0xd'));var crypto=require('crypto');var jsforce=require(_0xbacc('0xe'));var deskjs=require(_0xbacc('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbacc('0x10'));var Redis=require('ioredis');var authService=require(_0xbacc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbacc('0x12'));var hardwareService=require(_0xbacc('0x13'));var logger=require(_0xbacc('0x14'))(_0xbacc('0x15'));var utils=require('../../config/utils');var config=require(_0xbacc('0x16'));var licenseUtil=require(_0xbacc('0x17'));var db=require(_0xbacc('0x18'))['db'];function respondWithStatusCode(_0x39c0ce,_0x8b111){_0x8b111=_0x8b111||0xcc;return function(_0x4b6b38){if(_0x4b6b38){return _0x39c0ce[_0xbacc('0x19')](_0x8b111);}return _0x39c0ce[_0xbacc('0x1a')](_0x8b111)[_0xbacc('0x1b')]();};}function respondWithResult(_0x23bbc7,_0x593af8){_0x593af8=_0x593af8||0xc8;return function(_0x2ff0b1){if(_0x2ff0b1){return _0x23bbc7[_0xbacc('0x1a')](_0x593af8)['json'](_0x2ff0b1);}};}function respondWithFilteredResult(_0x24f0ad,_0x17f00f){return function(_0x1c5043){if(_0x1c5043){var _0xd9e78f=typeof _0x17f00f[_0xbacc('0x1c')]==='undefined'&&typeof _0x17f00f['limit']===_0xbacc('0x1d');var _0x24763a=_0x1c5043[_0xbacc('0x1e')];var _0x4dbd1a=_0xd9e78f?0x0:_0x17f00f[_0xbacc('0x1c')];var _0x298a33=_0xd9e78f?_0x1c5043[_0xbacc('0x1e')]:_0x17f00f['offset']+_0x17f00f[_0xbacc('0x1f')];var _0x4ecce0;if(_0x298a33>=_0x24763a){_0x298a33=_0x24763a;_0x4ecce0=0xc8;}else{_0x4ecce0=0xce;}_0x24f0ad[_0xbacc('0x1a')](_0x4ecce0);return _0x24f0ad[_0xbacc('0x20')](_0xbacc('0x21'),_0x4dbd1a+'-'+_0x298a33+'/'+_0x24763a)[_0xbacc('0x22')](_0x1c5043);}return null;};}function patchUpdates(_0x50311e){return function(_0x4f93c2){try{jsonpatch[_0xbacc('0x23')](_0x4f93c2,_0x50311e,!![]);}catch(_0x294002){return BPromise[_0xbacc('0x24')](_0x294002);}return _0x4f93c2[_0xbacc('0x25')]();};}function saveUpdates(_0x1fdccb,_0x198df8){return function(_0x44c710){if(_0x44c710){return _0x44c710[_0xbacc('0x26')](_0x1fdccb)[_0xbacc('0x27')](function(_0xd61cd9){return _0xd61cd9;});}return null;};}function removeEntity(_0x4d268f,_0x126ba0){return function(_0x48e8e2){if(_0x48e8e2){return _0x48e8e2['destroy']()[_0xbacc('0x27')](function(){var _0x49d5aa=_0x48e8e2[_0xbacc('0x28')]({'plain':!![]});var _0x26a999='Sounds';return db[_0xbacc('0x29')][_0xbacc('0x2a')]({'where':{'type':_0x26a999,'resourceId':_0x49d5aa['id']}})[_0xbacc('0x27')](function(){return _0x48e8e2;});})[_0xbacc('0x27')](function(){_0x4d268f[_0xbacc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a411,_0x130137){return function(_0x56e7a4){if(!_0x56e7a4){_0x42a411['sendStatus'](0x194);}return _0x56e7a4;};}function handleError(_0x2e667f,_0x1aa2a1){_0x1aa2a1=_0x1aa2a1||0x1f4;return function(_0x22d475){logger[_0xbacc('0x2b')](_0x22d475[_0xbacc('0x2c')]);if(_0x22d475[_0xbacc('0x2d')]){delete _0x22d475[_0xbacc('0x2d')];}_0x2e667f[_0xbacc('0x1a')](_0x1aa2a1)[_0xbacc('0x2e')](_0x22d475);};}exports[_0xbacc('0x2f')]=function(_0x54c5bf,_0x53b088){var _0x30d841={},_0x402ee7={},_0x4aedc0={'count':0x0,'rows':[]};var _0x27c3d2=_['map'](db[_0xbacc('0x30')][_0xbacc('0x31')],function(_0x1f3cf0){return{'name':_0x1f3cf0[_0xbacc('0x32')],'type':_0x1f3cf0[_0xbacc('0x33')][_0xbacc('0x34')]};});_0x402ee7['model']=_['map'](_0x27c3d2,_0xbacc('0x2d'));_0x402ee7['query']=_['keys'](_0x54c5bf['query']);_0x402ee7[_0xbacc('0x35')]=_[_0xbacc('0x36')](_0x402ee7[_0xbacc('0x37')],_0x402ee7[_0xbacc('0x38')]);_0x30d841[_0xbacc('0x39')]=_[_0xbacc('0x36')](_0x402ee7[_0xbacc('0x37')],qs[_0xbacc('0x3a')](_0x54c5bf[_0xbacc('0x38')]['fields']));_0x30d841[_0xbacc('0x39')]=_0x30d841['attributes']['length']?_0x30d841[_0xbacc('0x39')]:_0x402ee7[_0xbacc('0x37')];if(!_0x54c5bf[_0xbacc('0x38')][_0xbacc('0x3b')](_0xbacc('0x3c'))){_0x30d841[_0xbacc('0x1f')]=qs[_0xbacc('0x1f')](_0x54c5bf[_0xbacc('0x38')][_0xbacc('0x1f')]);_0x30d841[_0xbacc('0x1c')]=qs[_0xbacc('0x1c')](_0x54c5bf[_0xbacc('0x38')][_0xbacc('0x1c')]);}_0x30d841[_0xbacc('0x3d')]=qs['sort'](_0x54c5bf[_0xbacc('0x38')][_0xbacc('0x3e')]);_0x30d841[_0xbacc('0x3f')]=qs[_0xbacc('0x35')](_[_0xbacc('0x40')](_0x54c5bf['query'],_0x402ee7[_0xbacc('0x35')]),_0x27c3d2);if(_0x54c5bf[_0xbacc('0x38')][_0xbacc('0x41')]){_0x30d841[_0xbacc('0x3f')]=_[_0xbacc('0x42')](_0x30d841[_0xbacc('0x3f')],{'$or':_[_0xbacc('0x43')](_0x27c3d2,function(_0x3d9d77){if(_0x3d9d77[_0xbacc('0x33')]!==_0xbacc('0x44')){var _0x51ca23={};_0x51ca23[_0x3d9d77[_0xbacc('0x2d')]]={'$like':'%'+_0x54c5bf[_0xbacc('0x38')][_0xbacc('0x41')]+'%'};return _0x51ca23;}})});}_0x30d841=_[_0xbacc('0x42')]({},_0x30d841,_0x54c5bf[_0xbacc('0x45')]);var _0x5f5c43={'where':_0x30d841[_0xbacc('0x3f')]};return db[_0xbacc('0x30')]['count'](_0x5f5c43)[_0xbacc('0x27')](function(_0x1139df){_0x4aedc0[_0xbacc('0x1e')]=_0x1139df;if(_0x54c5bf[_0xbacc('0x38')][_0xbacc('0x46')]){_0x30d841[_0xbacc('0x47')]=[{'all':!![]}];}return db[_0xbacc('0x30')][_0xbacc('0x48')](_0x30d841);})[_0xbacc('0x27')](function(_0x544023){_0x4aedc0[_0xbacc('0x49')]=_0x544023;return _0x4aedc0;})[_0xbacc('0x27')](respondWithFilteredResult(_0x53b088,_0x30d841))[_0xbacc('0x4a')](handleError(_0x53b088,null));};exports[_0xbacc('0x4b')]=function(_0x57b033,_0x256e72){var _0xf7b4ee={'raw':!![],'where':{'id':_0x57b033[_0xbacc('0x4c')]['id']}},_0xcf505b={};_0xcf505b[_0xbacc('0x37')]=_['keys'](db[_0xbacc('0x30')]['rawAttributes']);_0xcf505b[_0xbacc('0x38')]=_[_0xbacc('0x4d')](_0x57b033[_0xbacc('0x38')]);_0xcf505b[_0xbacc('0x35')]=_[_0xbacc('0x36')](_0xcf505b[_0xbacc('0x37')],_0xcf505b[_0xbacc('0x38')]);_0xf7b4ee[_0xbacc('0x39')]=_[_0xbacc('0x36')](_0xcf505b[_0xbacc('0x37')],qs[_0xbacc('0x3a')](_0x57b033['query'][_0xbacc('0x3a')]));_0xf7b4ee['attributes']=_0xf7b4ee[_0xbacc('0x39')][_0xbacc('0x4e')]?_0xf7b4ee[_0xbacc('0x39')]:_0xcf505b['model'];if(_0x57b033[_0xbacc('0x38')][_0xbacc('0x46')]){_0xf7b4ee[_0xbacc('0x47')]=[{'all':!![]}];}_0xf7b4ee=_[_0xbacc('0x42')]({},_0xf7b4ee,_0x57b033[_0xbacc('0x45')]);return db[_0xbacc('0x30')]['find'](_0xf7b4ee)[_0xbacc('0x27')](handleEntityNotFound(_0x256e72,null))['then'](respondWithResult(_0x256e72,null))[_0xbacc('0x4a')](handleError(_0x256e72,null));};exports[_0xbacc('0x4f')]=function(_0x38ea44,_0x4dffa7,_0x38e735){return db[_0xbacc('0x30')][_0xbacc('0x50')]({'where':{'id':_0x38ea44[_0xbacc('0x4c')]['id']},'attributes':[_0xbacc('0x2d'),_0xbacc('0x51'),'converted_format'],'raw':!![]})[_0xbacc('0x27')](handleEntityNotFound(_0x4dffa7,null))[_0xbacc('0x27')](function(_0x1e0bb6){if(_0x1e0bb6){if(!fs[_0xbacc('0x52')](path['join'](config[_0xbacc('0x53')],_0xbacc('0x54'),_0x1e0bb6[_0xbacc('0x51')]+'.'+_0x1e0bb6[_0xbacc('0x55')]))){throw new db[(_0xbacc('0x56'))]['ValidationError'](_0xbacc('0x57'));}return _0x4dffa7['download'](path[_0xbacc('0x58')](config['root'],_0xbacc('0x54'),util[_0xbacc('0x59')](_0xbacc('0x5a'),_0x1e0bb6[_0xbacc('0x51')],_0x1e0bb6[_0xbacc('0x55')])),util[_0xbacc('0x59')]('%s.%s',_0x1e0bb6[_0xbacc('0x2d')],_0x1e0bb6['converted_format']));}return null;})[_0xbacc('0x4a')](handleError(_0x4dffa7,null));};exports['create']=function(_0x5cf087,_0x5b8c56,_0x200138){var _0x4599ed={'name':path[_0xbacc('0x5b')](_0x5cf087[_0xbacc('0x5c')][_0xbacc('0x5d')],path['extname'](_0x5cf087[_0xbacc('0x5c')]['originalname'])),'save_name':path['basename'](_0x5cf087['file'][_0xbacc('0x5e')],path[_0xbacc('0x5f')](_0x5cf087[_0xbacc('0x5c')][_0xbacc('0x5e')])),'original_format':path[_0xbacc('0x5f')](_0x5cf087['file'][_0xbacc('0x5d')])[_0xbacc('0x60')](0x1),'converted_format':_0xbacc('0x61')};var _0x2436a9=path['join'](config[_0xbacc('0x53')],'server/files/sounds/original',_0x5cf087['file'][_0xbacc('0x5e')]);var _0x54f729=path[_0xbacc('0x58')](config['root'],'server/files/sounds/converted',util['format'](_0xbacc('0x5a'),path[_0xbacc('0x5b')](_0x5cf087[_0xbacc('0x5c')][_0xbacc('0x5e')],path['extname'](_0x5cf087['file'][_0xbacc('0x5e')])),_0x4599ed['converted_format']));logger[_0xbacc('0x62')](_0xbacc('0x63'),_0x2436a9);logger[_0xbacc('0x62')](_0xbacc('0x64'),_0x54f729);try{fs['chmodSync'](_0x2436a9,parseInt(_0xbacc('0x65'),0x8));var _0x59cc79=sox[_0xbacc('0x66')](_0x2436a9,_0x54f729,{'sampleRate':0x1f40,'format':_0xbacc('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x59cc79['on'](_0xbacc('0x2b'),function(_0x363c6f){fs[_0xbacc('0x67')](_0x2436a9);_0x5b8c56[_0xbacc('0x1a')](0x1f4)[_0xbacc('0x2e')](_0x363c6f);});_0x59cc79['on'](_0xbacc('0x68'),function(_0x3708d3){_0x4599ed[_0xbacc('0x69')]=isNaN(_0x3708d3['duration'])?null:_0x3708d3['duration']*0x3e8;_0x4599ed[_0xbacc('0x6a')]=isNaN(_0x3708d3[_0xbacc('0x6b')])?null:_0x3708d3[_0xbacc('0x6b')];_0x4599ed['original_channelCount']=isNaN(_0x3708d3['channelCount'])?null:_0x3708d3[_0xbacc('0x6c')];_0x4599ed[_0xbacc('0x6d')]=isNaN(_0x3708d3[_0xbacc('0x6e')])?null:_0x3708d3[_0xbacc('0x6e')];_0x4599ed['original_sampleRate']=isNaN(_0x3708d3['sampleRate'])?null:_0x3708d3[_0xbacc('0x6f')];});_0x59cc79['on'](_0xbacc('0x70'),function(_0x1c9eac){_0x4599ed[_0xbacc('0x71')]=isNaN(_0x1c9eac['duration'])?null:_0x1c9eac['duration']*0x3e8;_0x4599ed[_0xbacc('0x72')]=isNaN(_0x1c9eac[_0xbacc('0x6b')])?null:_0x1c9eac['sampleCount'];_0x4599ed[_0xbacc('0x73')]=isNaN(_0x1c9eac[_0xbacc('0x6c')])?null:_0x1c9eac[_0xbacc('0x6c')];_0x4599ed[_0xbacc('0x74')]=isNaN(_0x1c9eac['bitRate'])?null:_0x1c9eac[_0xbacc('0x6e')];_0x4599ed[_0xbacc('0x75')]=isNaN(_0x1c9eac[_0xbacc('0x6f')])?null:_0x1c9eac[_0xbacc('0x6f')];});_0x59cc79['on']('end',function(){fs['chmodSync'](_0x54f729,parseInt('0777',0x8));return db[_0xbacc('0x30')][_0xbacc('0x76')](_0x4599ed)[_0xbacc('0x27')](function(_0x59db4e){var _0x457103={'role':_0x5cf087[_0xbacc('0x77')][_0xbacc('0x78')],'userProfileId':_0x5cf087[_0xbacc('0x77')][_0xbacc('0x79')]};if(!_0x457103)throw new Error(_0xbacc('0x7a'));if(_0x457103[_0xbacc('0x78')]===_0xbacc('0x7b')){var _0x3cfd0b=_0x59db4e[_0xbacc('0x28')]({'plain':!![]});return db[_0xbacc('0x7c')][_0xbacc('0x50')]({'where':{'name':_0xbacc('0x7d'),'userProfileId':_0x457103['userProfileId']},'raw':!![]})['then'](function(_0x5e987c){if(_0x5e987c&&_0x5e987c[_0xbacc('0x7e')]===0x0){return db[_0xbacc('0x29')][_0xbacc('0x76')]({'name':_0x3cfd0b[_0xbacc('0x2d')],'resourceId':_0x3cfd0b['id'],'type':_0x5e987c['name'],'sectionId':_0x5e987c['id']},{})[_0xbacc('0x27')](function(){return _0x59db4e;});}else{return _0x59db4e;}})['catch'](function(_0x346a4a){logger[_0xbacc('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x346a4a);throw _0x346a4a;});}return _0x59db4e;})['then'](respondWithResult(_0x5b8c56,null))[_0xbacc('0x4a')](handleError(_0x5b8c56,null));});_0x59cc79[_0xbacc('0x7f')]();}catch(_0x4c6994){_0x5b8c56[_0xbacc('0x1a')](0x1f4)['send'](_0x4c6994);}};exports[_0xbacc('0x26')]=function(_0x11e503,_0x58dfc3,_0x55ff6b){return db[_0xbacc('0x30')]['find']({'where':{'id':_0x11e503[_0xbacc('0x4c')]['id']}})[_0xbacc('0x27')](handleEntityNotFound(_0x58dfc3,null))[_0xbacc('0x27')](saveUpdates(_[_0xbacc('0x40')](_0x11e503[_0xbacc('0x77')],[_0xbacc('0x2d'),_0xbacc('0x80')]),null))[_0xbacc('0x27')](respondWithResult(_0x58dfc3,null))[_0xbacc('0x4a')](handleError(_0x58dfc3,null));};exports[_0xbacc('0x81')]=function(_0x202ca2,_0x10a731,_0x2fa710){return db['Sound'][_0xbacc('0x50')]({'where':{'id':_0x202ca2[_0xbacc('0x4c')]['id']}})['then'](function(_0x59e3f7){if(_0x59e3f7){return _0x59e3f7[_0xbacc('0x2a')]();}})[_0xbacc('0x27')](function(_0x1dd930){var _0x5892c5=path[_0xbacc('0x58')](config['root'],_0xbacc('0x82'),util['format']('%s.%s',_0x1dd930[_0xbacc('0x51')],_0x1dd930[_0xbacc('0x83')]));var _0x1da6d0=path['join'](config[_0xbacc('0x53')],_0xbacc('0x54'),util[_0xbacc('0x59')]('%s.%s',_0x1dd930[_0xbacc('0x51')],_0x1dd930[_0xbacc('0x55')]));fs[_0xbacc('0x67')](_0x5892c5);fs['unlinkSync'](_0x1da6d0);return _0x1dd930;})[_0xbacc('0x27')](function(_0x46a40e){if(_0x46a40e){return _0x10a731['status'](0xcc)[_0xbacc('0x1b')]();}})['then'](handleEntityNotFound(_0x10a731,null))['catch'](handleError(_0x10a731,null));}; \ No newline at end of file +var _0x5581=['nolimit','pick','filter','merge','where','VIRTUAL','options','includeAll','Sound','findAll','catch','show','params','download','find','save_name','converted_format','join','root','server/files/sounds/converted','%s.%s','format','create','basename','file','originalname','extname','filename','substring','wav','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','chmodSync','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','sendStatus','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x2f6881,_0x4a308f){var _0x1b7e86=function(_0x398a8d){while(--_0x398a8d){_0x2f6881['push'](_0x2f6881['shift']());}};_0x1b7e86(++_0x4a308f);}(_0x5581,0xb4));var _0x1558=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x5581[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x1558('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1558('0x1'));var jsonpatch=require(_0x1558('0x2'));var rp=require('request-promise');var moment=require(_0x1558('0x3'));var BPromise=require(_0x1558('0x4'));var Mustache=require(_0x1558('0x5'));var util=require(_0x1558('0x6'));var path=require(_0x1558('0x7'));var sox=require('sox');var csv=require(_0x1558('0x8'));var ejs=require(_0x1558('0x9'));var fs=require('fs');var fs_extra=require(_0x1558('0xa'));var _=require('lodash');var squel=require(_0x1558('0xb'));var crypto=require(_0x1558('0xc'));var jsforce=require(_0x1558('0xd'));var deskjs=require(_0x1558('0xe'));var toCsv=require(_0x1558('0x8'));var querystring=require(_0x1558('0xf'));var Papa=require(_0x1558('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1558('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1558('0x12'))(_0x1558('0x13'));var utils=require('../../config/utils');var config=require(_0x1558('0x14'));var licenseUtil=require(_0x1558('0x15'));var db=require(_0x1558('0x16'))['db'];function respondWithStatusCode(_0x175658,_0x28445a){_0x28445a=_0x28445a||0xcc;return function(_0x5cd301){if(_0x5cd301){return _0x175658['sendStatus'](_0x28445a);}return _0x175658[_0x1558('0x17')](_0x28445a)[_0x1558('0x18')]();};}function respondWithResult(_0x307c91,_0x42fa6b){_0x42fa6b=_0x42fa6b||0xc8;return function(_0x5c297d){if(_0x5c297d){return _0x307c91[_0x1558('0x17')](_0x42fa6b)[_0x1558('0x19')](_0x5c297d);}};}function respondWithFilteredResult(_0x49e634,_0x4309ee){return function(_0x4e4998){if(_0x4e4998){var _0x118aad=typeof _0x4309ee[_0x1558('0x1a')]===_0x1558('0x1b')&&typeof _0x4309ee['limit']==='undefined';var _0x5a12ca=_0x4e4998[_0x1558('0x1c')];var _0x509500=_0x118aad?0x0:_0x4309ee[_0x1558('0x1a')];var _0x32bb43=_0x118aad?_0x4e4998[_0x1558('0x1c')]:_0x4309ee['offset']+_0x4309ee[_0x1558('0x1d')];var _0x4d0e39;if(_0x32bb43>=_0x5a12ca){_0x32bb43=_0x5a12ca;_0x4d0e39=0xc8;}else{_0x4d0e39=0xce;}_0x49e634[_0x1558('0x17')](_0x4d0e39);return _0x49e634[_0x1558('0x1e')](_0x1558('0x1f'),_0x509500+'-'+_0x32bb43+'/'+_0x5a12ca)[_0x1558('0x19')](_0x4e4998);}return null;};}function patchUpdates(_0xb7e1a0){return function(_0x1c18d5){try{jsonpatch[_0x1558('0x20')](_0x1c18d5,_0xb7e1a0,!![]);}catch(_0x191f08){return BPromise[_0x1558('0x21')](_0x191f08);}return _0x1c18d5[_0x1558('0x22')]();};}function saveUpdates(_0x4561bb,_0x6f1689){return function(_0x43286a){if(_0x43286a){return _0x43286a[_0x1558('0x23')](_0x4561bb)[_0x1558('0x24')](function(_0x4f649b){return _0x4f649b;});}return null;};}function removeEntity(_0x14e123,_0x30e10f){return function(_0x505d8d){if(_0x505d8d){return _0x505d8d[_0x1558('0x25')]()[_0x1558('0x24')](function(){var _0x5d84a8=_0x505d8d[_0x1558('0x26')]({'plain':!![]});var _0x4a214e=_0x1558('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a214e,'resourceId':_0x5d84a8['id']}})[_0x1558('0x24')](function(){return _0x505d8d;});})[_0x1558('0x24')](function(){_0x14e123[_0x1558('0x17')](0xcc)[_0x1558('0x18')]();});}};}function handleEntityNotFound(_0x211a06,_0x16e7a1){return function(_0x36f6d7){if(!_0x36f6d7){_0x211a06[_0x1558('0x28')](0x194);}return _0x36f6d7;};}function handleError(_0x5455ec,_0x3e662c){_0x3e662c=_0x3e662c||0x1f4;return function(_0x1fb7b7){logger[_0x1558('0x29')](_0x1fb7b7[_0x1558('0x2a')]);if(_0x1fb7b7[_0x1558('0x2b')]){delete _0x1fb7b7['name'];}_0x5455ec['status'](_0x3e662c)[_0x1558('0x2c')](_0x1fb7b7);};}exports['index']=function(_0x317712,_0x68bad5){var _0x1b9617={},_0x2939ae={},_0x293106={'count':0x0,'rows':[]};var _0x492c47=_[_0x1558('0x2d')](db['Sound']['rawAttributes'],function(_0x5954f1){return{'name':_0x5954f1[_0x1558('0x2e')],'type':_0x5954f1['type'][_0x1558('0x2f')]};});_0x2939ae[_0x1558('0x30')]=_['map'](_0x492c47,_0x1558('0x2b'));_0x2939ae[_0x1558('0x31')]=_[_0x1558('0x32')](_0x317712['query']);_0x2939ae[_0x1558('0x33')]=_[_0x1558('0x34')](_0x2939ae[_0x1558('0x30')],_0x2939ae[_0x1558('0x31')]);_0x1b9617[_0x1558('0x35')]=_['intersection'](_0x2939ae[_0x1558('0x30')],qs[_0x1558('0x36')](_0x317712[_0x1558('0x31')][_0x1558('0x36')]));_0x1b9617[_0x1558('0x35')]=_0x1b9617['attributes'][_0x1558('0x37')]?_0x1b9617[_0x1558('0x35')]:_0x2939ae[_0x1558('0x30')];if(!_0x317712[_0x1558('0x31')]['hasOwnProperty'](_0x1558('0x38'))){_0x1b9617[_0x1558('0x1d')]=qs[_0x1558('0x1d')](_0x317712[_0x1558('0x31')]['limit']);_0x1b9617[_0x1558('0x1a')]=qs['offset'](_0x317712['query'][_0x1558('0x1a')]);}_0x1b9617['order']=qs['sort'](_0x317712['query']['sort']);_0x1b9617['where']=qs['filters'](_[_0x1558('0x39')](_0x317712[_0x1558('0x31')],_0x2939ae[_0x1558('0x33')]),_0x492c47);if(_0x317712[_0x1558('0x31')][_0x1558('0x3a')]){_0x1b9617['where']=_[_0x1558('0x3b')](_0x1b9617[_0x1558('0x3c')],{'$or':_[_0x1558('0x2d')](_0x492c47,function(_0x1f4414){if(_0x1f4414['type']!==_0x1558('0x3d')){var _0x35fd={};_0x35fd[_0x1f4414['name']]={'$like':'%'+_0x317712['query']['filter']+'%'};return _0x35fd;}})});}_0x1b9617=_[_0x1558('0x3b')]({},_0x1b9617,_0x317712[_0x1558('0x3e')]);var _0x210330={'where':_0x1b9617['where']};return db['Sound'][_0x1558('0x1c')](_0x210330)[_0x1558('0x24')](function(_0xd3c77f){_0x293106[_0x1558('0x1c')]=_0xd3c77f;if(_0x317712[_0x1558('0x31')][_0x1558('0x3f')]){_0x1b9617['include']=[{'all':!![]}];}return db[_0x1558('0x40')][_0x1558('0x41')](_0x1b9617);})[_0x1558('0x24')](function(_0x7f375b){_0x293106['rows']=_0x7f375b;return _0x293106;})['then'](respondWithFilteredResult(_0x68bad5,_0x1b9617))[_0x1558('0x42')](handleError(_0x68bad5,null));};exports[_0x1558('0x43')]=function(_0x26a4c8,_0x300a6b){var _0x3b4a15={'raw':!![],'where':{'id':_0x26a4c8[_0x1558('0x44')]['id']}},_0x17d01f={};_0x17d01f['model']=_[_0x1558('0x32')](db[_0x1558('0x40')]['rawAttributes']);_0x17d01f[_0x1558('0x31')]=_[_0x1558('0x32')](_0x26a4c8[_0x1558('0x31')]);_0x17d01f['filters']=_[_0x1558('0x34')](_0x17d01f['model'],_0x17d01f[_0x1558('0x31')]);_0x3b4a15[_0x1558('0x35')]=_[_0x1558('0x34')](_0x17d01f[_0x1558('0x30')],qs['fields'](_0x26a4c8[_0x1558('0x31')][_0x1558('0x36')]));_0x3b4a15[_0x1558('0x35')]=_0x3b4a15['attributes'][_0x1558('0x37')]?_0x3b4a15[_0x1558('0x35')]:_0x17d01f[_0x1558('0x30')];if(_0x26a4c8[_0x1558('0x31')][_0x1558('0x3f')]){_0x3b4a15['include']=[{'all':!![]}];}_0x3b4a15=_[_0x1558('0x3b')]({},_0x3b4a15,_0x26a4c8[_0x1558('0x3e')]);return db[_0x1558('0x40')]['find'](_0x3b4a15)[_0x1558('0x24')](handleEntityNotFound(_0x300a6b,null))[_0x1558('0x24')](respondWithResult(_0x300a6b,null))[_0x1558('0x42')](handleError(_0x300a6b,null));};exports[_0x1558('0x45')]=function(_0x14c556,_0x4768cd,_0x2201c0){return db[_0x1558('0x40')][_0x1558('0x46')]({'where':{'id':_0x14c556[_0x1558('0x44')]['id']},'attributes':[_0x1558('0x2b'),_0x1558('0x47'),_0x1558('0x48')],'raw':!![]})[_0x1558('0x24')](handleEntityNotFound(_0x4768cd,null))[_0x1558('0x24')](function(_0x43b670){if(_0x43b670){if(!fs['existsSync'](path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x4b'),_0x43b670[_0x1558('0x47')]+'.'+_0x43b670[_0x1558('0x48')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x4768cd[_0x1558('0x45')](path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x4b'),util['format'](_0x1558('0x4c'),_0x43b670[_0x1558('0x47')],_0x43b670[_0x1558('0x48')])),util[_0x1558('0x4d')](_0x1558('0x4c'),_0x43b670[_0x1558('0x2b')],_0x43b670[_0x1558('0x48')]));}return null;})[_0x1558('0x42')](handleError(_0x4768cd,null));};exports[_0x1558('0x4e')]=function(_0x1e1ad1,_0x1816c0,_0x323484){var _0x1b2baa={'name':path[_0x1558('0x4f')](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x51')],path[_0x1558('0x52')](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x51')])),'save_name':path[_0x1558('0x4f')](_0x1e1ad1[_0x1558('0x50')]['filename'],path['extname'](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x53')])),'original_format':path[_0x1558('0x52')](_0x1e1ad1[_0x1558('0x50')][_0x1558('0x51')])[_0x1558('0x54')](0x1),'converted_format':_0x1558('0x55')};var _0x5e8b38=path['join'](config['root'],'server/files/sounds/original',_0x1e1ad1[_0x1558('0x50')][_0x1558('0x53')]);var _0x1360fd=path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x4b'),util[_0x1558('0x4d')](_0x1558('0x4c'),path[_0x1558('0x4f')](_0x1e1ad1['file']['filename'],path[_0x1558('0x52')](_0x1e1ad1['file']['filename'])),_0x1b2baa[_0x1558('0x48')]));logger[_0x1558('0x56')]('Sound\x20upload\x20filepath:\x20%s',_0x5e8b38);logger[_0x1558('0x56')](_0x1558('0x57'),_0x1360fd);try{fs['chmodSync'](_0x5e8b38,parseInt(_0x1558('0x58'),0x8));var _0x2d9cd3=sox[_0x1558('0x59')](_0x5e8b38,_0x1360fd,{'sampleRate':0x1f40,'format':_0x1558('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2d9cd3['on'](_0x1558('0x29'),function(_0x4e02af){fs[_0x1558('0x5a')](_0x5e8b38);_0x1816c0[_0x1558('0x17')](0x1f4)[_0x1558('0x2c')](_0x4e02af);});_0x2d9cd3['on'](_0x1558('0x5b'),function(_0x7f266a){_0x1b2baa['original_duration']=isNaN(_0x7f266a[_0x1558('0x5c')])?null:_0x7f266a[_0x1558('0x5c')]*0x3e8;_0x1b2baa[_0x1558('0x5d')]=isNaN(_0x7f266a[_0x1558('0x5e')])?null:_0x7f266a[_0x1558('0x5e')];_0x1b2baa[_0x1558('0x5f')]=isNaN(_0x7f266a['channelCount'])?null:_0x7f266a[_0x1558('0x60')];_0x1b2baa['original_bitRate']=isNaN(_0x7f266a[_0x1558('0x61')])?null:_0x7f266a[_0x1558('0x61')];_0x1b2baa[_0x1558('0x62')]=isNaN(_0x7f266a[_0x1558('0x63')])?null:_0x7f266a[_0x1558('0x63')];});_0x2d9cd3['on'](_0x1558('0x64'),function(_0x3a1144){_0x1b2baa[_0x1558('0x65')]=isNaN(_0x3a1144['duration'])?null:_0x3a1144[_0x1558('0x5c')]*0x3e8;_0x1b2baa[_0x1558('0x66')]=isNaN(_0x3a1144[_0x1558('0x5e')])?null:_0x3a1144[_0x1558('0x5e')];_0x1b2baa[_0x1558('0x67')]=isNaN(_0x3a1144[_0x1558('0x60')])?null:_0x3a1144[_0x1558('0x60')];_0x1b2baa[_0x1558('0x68')]=isNaN(_0x3a1144[_0x1558('0x61')])?null:_0x3a1144[_0x1558('0x61')];_0x1b2baa['converted_sampleRate']=isNaN(_0x3a1144['sampleRate'])?null:_0x3a1144[_0x1558('0x63')];});_0x2d9cd3['on'](_0x1558('0x18'),function(){fs[_0x1558('0x69')](_0x1360fd,parseInt('0777',0x8));return db['Sound']['create'](_0x1b2baa)[_0x1558('0x24')](function(_0x3fae94){var _0x15c46e={'role':_0x1e1ad1['body'][_0x1558('0x6a')],'userProfileId':_0x1e1ad1[_0x1558('0x6b')][_0x1558('0x6c')]};if(!_0x15c46e)throw new Error(_0x1558('0x6d'));if(_0x15c46e[_0x1558('0x6a')]===_0x1558('0x6e')){var _0x2cfdda=_0x3fae94['get']({'plain':!![]});return db[_0x1558('0x6f')]['find']({'where':{'name':_0x1558('0x27'),'userProfileId':_0x15c46e[_0x1558('0x6c')]},'raw':!![]})[_0x1558('0x24')](function(_0x184abd){if(_0x184abd&&_0x184abd['autoAssociation']===0x0){return db[_0x1558('0x70')][_0x1558('0x4e')]({'name':_0x2cfdda['name'],'resourceId':_0x2cfdda['id'],'type':_0x184abd['name'],'sectionId':_0x184abd['id']},{})[_0x1558('0x24')](function(){return _0x3fae94;});}else{return _0x3fae94;}})[_0x1558('0x42')](function(_0x22ddd2){logger[_0x1558('0x29')](_0x1558('0x71'),_0x22ddd2);throw _0x22ddd2;});}return _0x3fae94;})[_0x1558('0x24')](respondWithResult(_0x1816c0,null))[_0x1558('0x42')](handleError(_0x1816c0,null));});_0x2d9cd3['start']();}catch(_0xa3482a){_0x1816c0[_0x1558('0x17')](0x1f4)[_0x1558('0x2c')](_0xa3482a);}};exports[_0x1558('0x23')]=function(_0x500ccd,_0x148f6e,_0x54b9b6){return db[_0x1558('0x40')][_0x1558('0x46')]({'where':{'id':_0x500ccd[_0x1558('0x44')]['id']}})[_0x1558('0x24')](handleEntityNotFound(_0x148f6e,null))['then'](saveUpdates(_[_0x1558('0x39')](_0x500ccd[_0x1558('0x6b')],[_0x1558('0x2b'),_0x1558('0x72')]),null))[_0x1558('0x24')](respondWithResult(_0x148f6e,null))[_0x1558('0x42')](handleError(_0x148f6e,null));};exports[_0x1558('0x73')]=function(_0x51c24d,_0x259133,_0x2ecfad){return db[_0x1558('0x40')][_0x1558('0x46')]({'where':{'id':_0x51c24d['params']['id']}})[_0x1558('0x24')](function(_0x358311){if(_0x358311){return _0x358311[_0x1558('0x25')]();}})['then'](function(_0x99e26b){var _0x5b1af0=path[_0x1558('0x49')](config[_0x1558('0x4a')],_0x1558('0x74'),util[_0x1558('0x4d')]('%s.%s',_0x99e26b[_0x1558('0x47')],_0x99e26b[_0x1558('0x75')]));var _0x3c4679=path['join'](config[_0x1558('0x4a')],_0x1558('0x4b'),util['format'](_0x1558('0x4c'),_0x99e26b[_0x1558('0x47')],_0x99e26b['converted_format']));fs[_0x1558('0x5a')](_0x5b1af0);fs['unlinkSync'](_0x3c4679);return _0x99e26b;})[_0x1558('0x24')](function(_0xb9ae96){if(_0xb9ae96){return _0x259133[_0x1558('0x17')](0xcc)[_0x1558('0x18')]();}})[_0x1558('0x24')](handleEntityNotFound(_0x259133,null))['catch'](handleError(_0x259133,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 4c6a4a1..d08d04c 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 _0xb13a=['api','moment','bluebird','request-promise','path','rimraf','define','Sound','lodash','util'];(function(_0x5be8a0,_0x5f18ae){var _0x1ce890=function(_0xfb7e75){while(--_0xfb7e75){_0x5be8a0['push'](_0x5be8a0['shift']());}};_0x1ce890(++_0x5f18ae);}(_0xb13a,0x12a));var _0xab13=function(_0x561e7b,_0x4bcd2e){_0x561e7b=_0x561e7b-0x0;var _0x5851ed=_0xb13a[_0x561e7b];return _0x5851ed;};'use strict';var _=require(_0xab13('0x0'));var util=require(_0xab13('0x1'));var logger=require('../../config/logger')(_0xab13('0x2'));var moment=require(_0xab13('0x3'));var BPromise=require(_0xab13('0x4'));var rp=require(_0xab13('0x5'));var fs=require('fs');var path=require(_0xab13('0x6'));var rimraf=require(_0xab13('0x7'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module['exports']=function(_0x1a6488,_0x55b3f6){return _0x1a6488[_0xab13('0x8')](_0xab13('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe57b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','Sound','tools_sounds','util'];(function(_0x307012,_0xbd06b9){var _0x31703e=function(_0x15fce8){while(--_0x15fce8){_0x307012['push'](_0x307012['shift']());}};_0x31703e(++_0xbd06b9);}(_0xe57b,0x11f));var _0xbe57=function(_0x5368a1,_0x493055){_0x5368a1=_0x5368a1-0x0;var _0x326125=_0xe57b[_0x5368a1];return _0x326125;};'use strict';var _=require('lodash');var util=require(_0xbe57('0x0'));var logger=require(_0xbe57('0x1'))(_0xbe57('0x2'));var moment=require(_0xbe57('0x3'));var BPromise=require(_0xbe57('0x4'));var rp=require(_0xbe57('0x5'));var fs=require('fs');var path=require(_0xbe57('0x6'));var rimraf=require(_0xbe57('0x7'));var config=require(_0xbe57('0x8'));var attributes=require(_0xbe57('0x9'));module['exports']=function(_0x5bdc25,_0x4c687b){return _0x5bdc25['define'](_0xbe57('0xa'),attributes,{'tableName':_0xbe57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index f4b25c6..3813f3c 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 _0x5cff=['model','ShowSound','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','Sound,\x20%s,\x20%s','catch','Sound','options','raw','where','attributes','include','map'];(function(_0x25a1f2,_0x42813f){var _0x3e596d=function(_0x5b7fe6){while(--_0x5b7fe6){_0x25a1f2['push'](_0x25a1f2['shift']());}};_0x3e596d(++_0x42813f);}(_0x5cff,0x107));var _0xf5cf=function(_0x308eb3,_0x4bc21b){_0x308eb3=_0x308eb3-0x0;var _0x2fbf0a=_0x5cff[_0x308eb3];return _0x2fbf0a;};'use strict';var _=require('lodash');var util=require(_0xf5cf('0x0'));var moment=require(_0xf5cf('0x1'));var BPromise=require('bluebird');var rs=require(_0xf5cf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5cf('0x3'))['db'];var utils=require(_0xf5cf('0x4'));var logger=require('../../config/logger')(_0xf5cf('0x5'));var config=require(_0xf5cf('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf5cf('0x7')][_0xf5cf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36e2f7,_0x14de82,_0x47d518){return new BPromise(function(_0x1eb3df,_0x2c570b){return client[_0xf5cf('0x9')](_0x36e2f7,_0x47d518)[_0xf5cf('0xa')](function(_0x449c1d){logger[_0xf5cf('0xb')]('Sound,\x20%s,\x20%s',_0x14de82,_0xf5cf('0xc'));logger[_0xf5cf('0xd')](_0xf5cf('0xe'),_0x14de82,_0xf5cf('0xc'),JSON[_0xf5cf('0xf')](_0x449c1d));if(_0x449c1d[_0xf5cf('0x10')]){if(_0x449c1d[_0xf5cf('0x10')]['code']===0x1f4){logger[_0xf5cf('0x10')]('Sound,\x20%s,\x20%s',_0x14de82,_0x449c1d['error'][_0xf5cf('0x11')]);return _0x2c570b(_0x449c1d[_0xf5cf('0x10')][_0xf5cf('0x11')]);}logger['error'](_0xf5cf('0x12'),_0x14de82,_0x449c1d[_0xf5cf('0x10')][_0xf5cf('0x11')]);return _0x1eb3df(_0x449c1d['error'][_0xf5cf('0x11')]);}else{logger[_0xf5cf('0xb')](_0xf5cf('0x12'),_0x14de82,_0xf5cf('0xc'));_0x1eb3df(_0x449c1d['result'][_0xf5cf('0x11')]);}})[_0xf5cf('0x13')](function(_0x2bddf6){logger['error'](_0xf5cf('0x12'),_0x14de82,_0x2bddf6);_0x2c570b(_0x2bddf6);});});}exports['ShowSound']=function(_0x457834){var _0x137d55=this;return new Promise(function(_0xc02938,_0x4a5465){return db[_0xf5cf('0x14')]['find']({'raw':_0x457834[_0xf5cf('0x15')]?_0x457834[_0xf5cf('0x15')][_0xf5cf('0x16')]===undefined?!![]:![]:!![],'where':_0x457834[_0xf5cf('0x15')]?_0x457834[_0xf5cf('0x15')][_0xf5cf('0x17')]||null:null,'attributes':_0x457834[_0xf5cf('0x15')]?_0x457834['options'][_0xf5cf('0x18')]||null:null,'include':_0x457834[_0xf5cf('0x15')]?_0x457834[_0xf5cf('0x15')][_0xf5cf('0x19')]?_[_0xf5cf('0x1a')](_0x457834[_0xf5cf('0x15')][_0xf5cf('0x19')],function(_0x230e04){return{'model':db[_0x230e04['model']],'as':_0x230e04['as'],'attributes':_0x230e04[_0xf5cf('0x18')],'include':_0x230e04[_0xf5cf('0x19')]?_[_0xf5cf('0x1a')](_0x230e04['include'],function(_0x5573c4){return{'model':db[_0x5573c4[_0xf5cf('0x1b')]],'as':_0x5573c4['as'],'attributes':_0x5573c4['attributes'],'include':_0x5573c4[_0xf5cf('0x19')]?_['map'](_0x5573c4[_0xf5cf('0x19')],function(_0x12026d){return{'model':db[_0x12026d['model']],'as':_0x12026d['as'],'attributes':_0x12026d[_0xf5cf('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf5cf('0xa')](function(_0x5ec7d1){logger[_0xf5cf('0xb')](_0xf5cf('0x1c'),_0x457834);logger[_0xf5cf('0xd')](_0xf5cf('0x1c'),_0x457834,JSON[_0xf5cf('0xf')](_0x5ec7d1));_0xc02938(_0x5ec7d1);})[_0xf5cf('0x13')](function(_0x1a081d){logger[_0xf5cf('0x10')](_0xf5cf('0x1c'),_0x1a081d[_0xf5cf('0x11')],_0x457834);_0x4a5465(_0x137d55[_0xf5cf('0x10')](0x1f4,_0x1a081d[_0xf5cf('0x11')]));});});}; \ No newline at end of file +var _0x1b37=['model','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','options','raw','where','include','map'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b37,0x16d));var _0x71b3=function(_0x5f0e14,_0x373cbb){_0x5f0e14=_0x5f0e14-0x0;var _0x3ed494=_0x1b37[_0x5f0e14];return _0x3ed494;};'use strict';var _=require(_0x71b3('0x0'));var util=require(_0x71b3('0x1'));var moment=require(_0x71b3('0x2'));var BPromise=require(_0x71b3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71b3('0x4'));var db=require(_0x71b3('0x5'))['db'];var utils=require(_0x71b3('0x6'));var logger=require('../../config/logger')(_0x71b3('0x7'));var config=require(_0x71b3('0x8'));var jayson=require(_0x71b3('0x9'));var client=jayson[_0x71b3('0xa')][_0x71b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x317636,_0x2a958b,_0x302136){return new BPromise(function(_0x490ae4,_0x599192){return client['request'](_0x317636,_0x302136)[_0x71b3('0xc')](function(_0x34e9ed){logger[_0x71b3('0xd')](_0x71b3('0xe'),_0x2a958b,_0x71b3('0xf'));logger[_0x71b3('0x10')](_0x71b3('0x11'),_0x2a958b,_0x71b3('0xf'),JSON[_0x71b3('0x12')](_0x34e9ed));if(_0x34e9ed[_0x71b3('0x13')]){if(_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x14')]===0x1f4){logger[_0x71b3('0x13')](_0x71b3('0xe'),_0x2a958b,_0x34e9ed['error'][_0x71b3('0x15')]);return _0x599192(_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x15')]);}logger[_0x71b3('0x13')](_0x71b3('0xe'),_0x2a958b,_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x15')]);return _0x490ae4(_0x34e9ed[_0x71b3('0x13')][_0x71b3('0x15')]);}else{logger[_0x71b3('0xd')](_0x71b3('0xe'),_0x2a958b,_0x71b3('0xf'));_0x490ae4(_0x34e9ed[_0x71b3('0x16')]['message']);}})[_0x71b3('0x17')](function(_0x1dd464){logger['error'](_0x71b3('0xe'),_0x2a958b,_0x1dd464);_0x599192(_0x1dd464);});});}exports[_0x71b3('0x18')]=function(_0x5c9511){var _0x2e16eb=this;return new Promise(function(_0x1efb81,_0x45c059){return db[_0x71b3('0x19')]['find']({'raw':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511['options'][_0x71b3('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511[_0x71b3('0x1a')][_0x71b3('0x1c')]||null:null,'attributes':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511[_0x71b3('0x1a')]['attributes']||null:null,'include':_0x5c9511[_0x71b3('0x1a')]?_0x5c9511['options'][_0x71b3('0x1d')]?_[_0x71b3('0x1e')](_0x5c9511[_0x71b3('0x1a')][_0x71b3('0x1d')],function(_0x51f4b0){return{'model':db[_0x51f4b0[_0x71b3('0x1f')]],'as':_0x51f4b0['as'],'attributes':_0x51f4b0[_0x71b3('0x20')],'include':_0x51f4b0[_0x71b3('0x1d')]?_[_0x71b3('0x1e')](_0x51f4b0[_0x71b3('0x1d')],function(_0x5a2c92){return{'model':db[_0x5a2c92[_0x71b3('0x1f')]],'as':_0x5a2c92['as'],'attributes':_0x5a2c92[_0x71b3('0x20')],'include':_0x5a2c92[_0x71b3('0x1d')]?_[_0x71b3('0x1e')](_0x5a2c92[_0x71b3('0x1d')],function(_0x11551b){return{'model':db[_0x11551b[_0x71b3('0x1f')]],'as':_0x11551b['as'],'attributes':_0x11551b[_0x71b3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ac1d0){logger[_0x71b3('0xd')]('ShowSound',_0x5c9511);logger[_0x71b3('0x10')](_0x71b3('0x18'),_0x5c9511,JSON[_0x71b3('0x12')](_0x4ac1d0));_0x1efb81(_0x4ac1d0);})['catch'](function(_0x490e1c){logger[_0x71b3('0x13')]('ShowSound',_0x490e1c[_0x71b3('0x15')],_0x5c9511);_0x45c059(_0x2e16eb[_0x71b3('0x13')](0x1f4,_0x490e1c[_0x71b3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 3349bdf..a9f62ae 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 _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x187386,_0x4f7e7c){var _0x513a62=function(_0x33da76){while(--_0x33da76){_0x187386['push'](_0x187386['shift']());}};_0x513a62(++_0x4f7e7c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=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(_0x5a852b,_0x1694c2){var _0xd74d84=function(_0x170a6d){while(--_0x170a6d){_0x5a852b['push'](_0x5a852b['shift']());}};_0xd74d84(++_0x1694c2);}(_0x5eb8,0xb0));var _0x85eb=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0x5eb8[_0x257a28];return _0x13bccc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e855e1f..b4a5c31 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 _0x8798=['ENUM','out','TEXT','sequelize','exports','STRING'];(function(_0x3c99f5,_0x3c4b1a){var _0x3b958e=function(_0x18d09d){while(--_0x18d09d){_0x3c99f5['push'](_0x3c99f5['shift']());}};_0x3b958e(++_0x3c4b1a);}(_0x8798,0xcf));var _0x8879=function(_0x7c7e48,_0x2549f4){_0x7c7e48=_0x7c7e48-0x0;var _0x28c9d0=_0x8798[_0x7c7e48];return _0x28c9d0;};'use strict';var Sequelize=require(_0x8879('0x0'));module[_0x8879('0x1')]={'uniqueid':{'type':Sequelize[_0x8879('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x8879('0x3')]('in','out'),'defaultValue':_0x8879('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x8879('0x2')]},'providerResponse':{'type':Sequelize[_0x8879('0x5')]}}; \ No newline at end of file +var _0x4667=['medium','ENUM','out','sequelize','STRING','TEXT'];(function(_0x5671c6,_0x3a0619){var _0x4e86c8=function(_0x109ce7){while(--_0x109ce7){_0x5671c6['push'](_0x5671c6['shift']());}};_0x4e86c8(++_0x3a0619);}(_0x4667,0x13b));var _0x7466=function(_0x1b6617,_0x312ff5){_0x1b6617=_0x1b6617-0x0;var _0x5d02d1=_0x4667[_0x1b6617];return _0x5d02d1;};'use strict';var Sequelize=require(_0x7466('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7466('0x1')]},'body':{'type':Sequelize[_0x7466('0x2')](_0x7466('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x7466('0x4')]('in',_0x7466('0x5')),'defaultValue':_0x7466('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7466('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 997c926..a761671 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 _0x3f77=['find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','SquareMessage','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x3f77,0xa0));var _0x73f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f77[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x73f7('0x0'));var rimraf=require(_0x73f7('0x1'));var zipdir=require(_0x73f7('0x2'));var jsonpatch=require(_0x73f7('0x3'));var rp=require(_0x73f7('0x4'));var moment=require('moment');var BPromise=require(_0x73f7('0x5'));var Mustache=require(_0x73f7('0x6'));var util=require(_0x73f7('0x7'));var path=require(_0x73f7('0x8'));var sox=require('sox');var csv=require(_0x73f7('0x9'));var ejs=require(_0x73f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x73f7('0xb'));var crypto=require(_0x73f7('0xc'));var jsforce=require(_0x73f7('0xd'));var deskjs=require(_0x73f7('0xe'));var toCsv=require(_0x73f7('0x9'));var querystring=require(_0x73f7('0xf'));var Papa=require('papaparse');var Redis=require(_0x73f7('0x10'));var authService=require(_0x73f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x73f7('0x12'));var hardwareService=require(_0x73f7('0x13'));var logger=require(_0x73f7('0x14'))(_0x73f7('0x15'));var utils=require(_0x73f7('0x16'));var config=require(_0x73f7('0x17'));var licenseUtil=require(_0x73f7('0x18'));var db=require(_0x73f7('0x19'))['db'];function respondWithStatusCode(_0x586205,_0x3f9683){_0x3f9683=_0x3f9683||0xcc;return function(_0x35b5ec){if(_0x35b5ec){return _0x586205[_0x73f7('0x1a')](_0x3f9683);}return _0x586205[_0x73f7('0x1b')](_0x3f9683)[_0x73f7('0x1c')]();};}function respondWithResult(_0x1ba096,_0x48b81c){_0x48b81c=_0x48b81c||0xc8;return function(_0x5920ce){if(_0x5920ce){return _0x1ba096[_0x73f7('0x1b')](_0x48b81c)[_0x73f7('0x1d')](_0x5920ce);}};}function respondWithFilteredResult(_0x531125,_0x457444){return function(_0x5f3d20){if(_0x5f3d20){var _0x33add7=typeof _0x457444[_0x73f7('0x1e')]===_0x73f7('0x1f')&&typeof _0x457444['limit']===_0x73f7('0x1f');var _0x4efefe=_0x5f3d20[_0x73f7('0x20')];var _0x1f77b4=_0x33add7?0x0:_0x457444[_0x73f7('0x1e')];var _0x2e0b5d=_0x33add7?_0x5f3d20['count']:_0x457444[_0x73f7('0x1e')]+_0x457444[_0x73f7('0x21')];var _0x4d29b3;if(_0x2e0b5d>=_0x4efefe){_0x2e0b5d=_0x4efefe;_0x4d29b3=0xc8;}else{_0x4d29b3=0xce;}_0x531125[_0x73f7('0x1b')](_0x4d29b3);return _0x531125[_0x73f7('0x22')](_0x73f7('0x23'),_0x1f77b4+'-'+_0x2e0b5d+'/'+_0x4efefe)[_0x73f7('0x1d')](_0x5f3d20);}return null;};}function patchUpdates(_0x2642e5){return function(_0x395a47){try{jsonpatch[_0x73f7('0x24')](_0x395a47,_0x2642e5,!![]);}catch(_0x3f956a){return BPromise[_0x73f7('0x25')](_0x3f956a);}return _0x395a47[_0x73f7('0x26')]();};}function saveUpdates(_0x22741d,_0x42508c){return function(_0x4fdfe3){if(_0x4fdfe3){return _0x4fdfe3[_0x73f7('0x27')](_0x22741d)['then'](function(_0x2d9e76){return _0x2d9e76;});}return null;};}function removeEntity(_0x33b38b,_0x181319){return function(_0x59622a){if(_0x59622a){return _0x59622a[_0x73f7('0x28')]()[_0x73f7('0x29')](function(){_0x33b38b['status'](0xcc)[_0x73f7('0x1c')]();});}};}function handleEntityNotFound(_0x5a661d,_0x145b7d){return function(_0x14c1c8){if(!_0x14c1c8){_0x5a661d[_0x73f7('0x1a')](0x194);}return _0x14c1c8;};}function handleError(_0x29db80,_0x165ce9){_0x165ce9=_0x165ce9||0x1f4;return function(_0x389b03){logger[_0x73f7('0x2a')](_0x389b03[_0x73f7('0x2b')]);if(_0x389b03['name']){delete _0x389b03[_0x73f7('0x2c')];}_0x29db80[_0x73f7('0x1b')](_0x165ce9)[_0x73f7('0x2d')](_0x389b03);};}exports[_0x73f7('0x2e')]=function(_0x4318e1,_0x25445e){var _0x4a7517={},_0x1988cd={},_0xa59252={'count':0x0,'rows':[]};var _0x229eb8=_[_0x73f7('0x2f')](db[_0x73f7('0x30')]['rawAttributes'],function(_0xe4d0ab){return{'name':_0xe4d0ab[_0x73f7('0x31')],'type':_0xe4d0ab[_0x73f7('0x32')][_0x73f7('0x33')]};});_0x1988cd['model']=_[_0x73f7('0x2f')](_0x229eb8,_0x73f7('0x2c'));_0x1988cd[_0x73f7('0x34')]=_[_0x73f7('0x35')](_0x4318e1[_0x73f7('0x34')]);_0x1988cd[_0x73f7('0x36')]=_[_0x73f7('0x37')](_0x1988cd[_0x73f7('0x38')],_0x1988cd[_0x73f7('0x34')]);_0x4a7517[_0x73f7('0x39')]=_[_0x73f7('0x37')](_0x1988cd[_0x73f7('0x38')],qs[_0x73f7('0x3a')](_0x4318e1['query'][_0x73f7('0x3a')]));_0x4a7517[_0x73f7('0x39')]=_0x4a7517[_0x73f7('0x39')][_0x73f7('0x3b')]?_0x4a7517[_0x73f7('0x39')]:_0x1988cd[_0x73f7('0x38')];if(!_0x4318e1['query'][_0x73f7('0x3c')]('nolimit')){_0x4a7517[_0x73f7('0x21')]=qs[_0x73f7('0x21')](_0x4318e1[_0x73f7('0x34')]['limit']);_0x4a7517[_0x73f7('0x1e')]=qs[_0x73f7('0x1e')](_0x4318e1['query'][_0x73f7('0x1e')]);}_0x4a7517[_0x73f7('0x3d')]=qs['sort'](_0x4318e1['query'][_0x73f7('0x3e')]);_0x4a7517[_0x73f7('0x3f')]=qs[_0x73f7('0x36')](_[_0x73f7('0x40')](_0x4318e1['query'],_0x1988cd[_0x73f7('0x36')]),_0x229eb8);if(_0x4318e1['query'][_0x73f7('0x41')]){_0x4a7517['where']=_['merge'](_0x4a7517[_0x73f7('0x3f')],{'$or':_['map'](_0x229eb8,function(_0x21e0a8){if(_0x21e0a8[_0x73f7('0x32')]!=='VIRTUAL'){var _0x3a20a1={};_0x3a20a1[_0x21e0a8[_0x73f7('0x2c')]]={'$like':'%'+_0x4318e1[_0x73f7('0x34')][_0x73f7('0x41')]+'%'};return _0x3a20a1;}})});}_0x4a7517=_[_0x73f7('0x42')]({},_0x4a7517,_0x4318e1[_0x73f7('0x43')]);var _0x257bc3={'where':_0x4a7517[_0x73f7('0x3f')]};return db[_0x73f7('0x30')]['count'](_0x257bc3)[_0x73f7('0x29')](function(_0xc03662){_0xa59252['count']=_0xc03662;if(_0x4318e1[_0x73f7('0x34')][_0x73f7('0x44')]){_0x4a7517[_0x73f7('0x45')]=[{'all':!![]}];}return db['SquareMessage'][_0x73f7('0x46')](_0x4a7517);})[_0x73f7('0x29')](function(_0xe6e888){_0xa59252['rows']=_0xe6e888;return _0xa59252;})[_0x73f7('0x29')](respondWithFilteredResult(_0x25445e,_0x4a7517))['catch'](handleError(_0x25445e,null));};exports[_0x73f7('0x47')]=function(_0x409bbc,_0x297e4f){var _0x3efaf4={'raw':!![],'where':{'id':_0x409bbc[_0x73f7('0x48')]['id']}},_0x3fde05={};_0x3fde05[_0x73f7('0x38')]=_[_0x73f7('0x35')](db[_0x73f7('0x30')][_0x73f7('0x49')]);_0x3fde05[_0x73f7('0x34')]=_[_0x73f7('0x35')](_0x409bbc[_0x73f7('0x34')]);_0x3fde05[_0x73f7('0x36')]=_['intersection'](_0x3fde05[_0x73f7('0x38')],_0x3fde05[_0x73f7('0x34')]);_0x3efaf4['attributes']=_[_0x73f7('0x37')](_0x3fde05['model'],qs[_0x73f7('0x3a')](_0x409bbc[_0x73f7('0x34')]['fields']));_0x3efaf4[_0x73f7('0x39')]=_0x3efaf4[_0x73f7('0x39')][_0x73f7('0x3b')]?_0x3efaf4[_0x73f7('0x39')]:_0x3fde05[_0x73f7('0x38')];if(_0x409bbc['query']['includeAll']){_0x3efaf4[_0x73f7('0x45')]=[{'all':!![]}];}_0x3efaf4=_['merge']({},_0x3efaf4,_0x409bbc[_0x73f7('0x43')]);return db['SquareMessage'][_0x73f7('0x4a')](_0x3efaf4)['then'](handleEntityNotFound(_0x297e4f,null))[_0x73f7('0x29')](respondWithResult(_0x297e4f,null))[_0x73f7('0x4b')](handleError(_0x297e4f,null));};exports[_0x73f7('0x4c')]=function(_0x1115d3,_0x347382){return db['SquareMessage'][_0x73f7('0x4c')](_0x1115d3[_0x73f7('0x4d')],{})[_0x73f7('0x29')](respondWithResult(_0x347382,0xc9))[_0x73f7('0x4b')](handleError(_0x347382,null));};exports[_0x73f7('0x27')]=function(_0x53c1a9,_0x3c2496){if(_0x53c1a9[_0x73f7('0x4d')]['id']){delete _0x53c1a9[_0x73f7('0x4d')]['id'];}return db[_0x73f7('0x30')]['find']({'where':{'id':_0x53c1a9[_0x73f7('0x48')]['id']}})[_0x73f7('0x29')](handleEntityNotFound(_0x3c2496,null))['then'](saveUpdates(_0x53c1a9[_0x73f7('0x4d')],null))[_0x73f7('0x29')](respondWithResult(_0x3c2496,null))['catch'](handleError(_0x3c2496,null));};exports['destroy']=function(_0x2fed40,_0x3304b8){return db[_0x73f7('0x30')][_0x73f7('0x4a')]({'where':{'id':_0x2fed40[_0x73f7('0x48')]['id']}})[_0x73f7('0x29')](handleEntityNotFound(_0x3304b8,null))[_0x73f7('0x29')](removeEntity(_0x3304b8,null))['catch'](handleError(_0x3304b8,null));}; \ No newline at end of file +var _0x1aab=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x45595c,_0x35641d){var _0x37c5c3=function(_0x3948df){while(--_0x3948df){_0x45595c['push'](_0x45595c['shift']());}};_0x37c5c3(++_0x35641d);}(_0x1aab,0x122));var _0xb1aa=function(_0x50c108,_0x463625){_0x50c108=_0x50c108-0x0;var _0x1570c5=_0x1aab[_0x50c108];return _0x1570c5;};'use strict';var emlformat=require(_0xb1aa('0x0'));var rimraf=require(_0xb1aa('0x1'));var zipdir=require(_0xb1aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1aa('0x3'));var moment=require('moment');var BPromise=require(_0xb1aa('0x4'));var Mustache=require(_0xb1aa('0x5'));var util=require(_0xb1aa('0x6'));var path=require(_0xb1aa('0x7'));var sox=require(_0xb1aa('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1aa('0x9'));var _=require(_0xb1aa('0xa'));var squel=require(_0xb1aa('0xb'));var crypto=require(_0xb1aa('0xc'));var jsforce=require(_0xb1aa('0xd'));var deskjs=require(_0xb1aa('0xe'));var toCsv=require(_0xb1aa('0xf'));var querystring=require('querystring');var Papa=require(_0xb1aa('0x10'));var Redis=require(_0xb1aa('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb1aa('0x12'));var as=require(_0xb1aa('0x13'));var hardwareService=require(_0xb1aa('0x14'));var logger=require(_0xb1aa('0x15'))(_0xb1aa('0x16'));var utils=require(_0xb1aa('0x17'));var config=require(_0xb1aa('0x18'));var licenseUtil=require(_0xb1aa('0x19'));var db=require(_0xb1aa('0x1a'))['db'];function respondWithStatusCode(_0x330c54,_0x46d422){_0x46d422=_0x46d422||0xcc;return function(_0x419c79){if(_0x419c79){return _0x330c54[_0xb1aa('0x1b')](_0x46d422);}return _0x330c54[_0xb1aa('0x1c')](_0x46d422)[_0xb1aa('0x1d')]();};}function respondWithResult(_0x48543b,_0x4d9ad5){_0x4d9ad5=_0x4d9ad5||0xc8;return function(_0xc75972){if(_0xc75972){return _0x48543b['status'](_0x4d9ad5)[_0xb1aa('0x1e')](_0xc75972);}};}function respondWithFilteredResult(_0x47bdde,_0x7a3b6a){return function(_0x49bf6b){if(_0x49bf6b){var _0x24b12d=typeof _0x7a3b6a['offset']===_0xb1aa('0x1f')&&typeof _0x7a3b6a[_0xb1aa('0x20')]==='undefined';var _0x2531f2=_0x49bf6b[_0xb1aa('0x21')];var _0x1d1450=_0x24b12d?0x0:_0x7a3b6a[_0xb1aa('0x22')];var _0x2c67f3=_0x24b12d?_0x49bf6b[_0xb1aa('0x21')]:_0x7a3b6a[_0xb1aa('0x22')]+_0x7a3b6a[_0xb1aa('0x20')];var _0x36dc82;if(_0x2c67f3>=_0x2531f2){_0x2c67f3=_0x2531f2;_0x36dc82=0xc8;}else{_0x36dc82=0xce;}_0x47bdde[_0xb1aa('0x1c')](_0x36dc82);return _0x47bdde[_0xb1aa('0x23')](_0xb1aa('0x24'),_0x1d1450+'-'+_0x2c67f3+'/'+_0x2531f2)[_0xb1aa('0x1e')](_0x49bf6b);}return null;};}function patchUpdates(_0x5ca191){return function(_0x5a3ec5){try{jsonpatch[_0xb1aa('0x25')](_0x5a3ec5,_0x5ca191,!![]);}catch(_0x2e6725){return BPromise[_0xb1aa('0x26')](_0x2e6725);}return _0x5a3ec5[_0xb1aa('0x27')]();};}function saveUpdates(_0x5b9a93,_0x465630){return function(_0x143e99){if(_0x143e99){return _0x143e99['update'](_0x5b9a93)[_0xb1aa('0x28')](function(_0x17298c){return _0x17298c;});}return null;};}function removeEntity(_0x2be697,_0x5f2aa7){return function(_0x5bb543){if(_0x5bb543){return _0x5bb543[_0xb1aa('0x29')]()[_0xb1aa('0x28')](function(){_0x2be697[_0xb1aa('0x1c')](0xcc)[_0xb1aa('0x1d')]();});}};}function handleEntityNotFound(_0x3a9c9e,_0x2f1db9){return function(_0x26ec21){if(!_0x26ec21){_0x3a9c9e[_0xb1aa('0x1b')](0x194);}return _0x26ec21;};}function handleError(_0x1ba189,_0x470705){_0x470705=_0x470705||0x1f4;return function(_0x1cd714){logger[_0xb1aa('0x2a')](_0x1cd714[_0xb1aa('0x2b')]);if(_0x1cd714[_0xb1aa('0x2c')]){delete _0x1cd714[_0xb1aa('0x2c')];}_0x1ba189['status'](_0x470705)[_0xb1aa('0x2d')](_0x1cd714);};}exports[_0xb1aa('0x2e')]=function(_0x3c1b92,_0x13f92d){var _0x4b2c43={},_0xa4a319={},_0x44ac69={'count':0x0,'rows':[]};var _0x5b2cde=_[_0xb1aa('0x2f')](db[_0xb1aa('0x30')][_0xb1aa('0x31')],function(_0x505542){return{'name':_0x505542[_0xb1aa('0x32')],'type':_0x505542[_0xb1aa('0x33')]['key']};});_0xa4a319['model']=_[_0xb1aa('0x2f')](_0x5b2cde,_0xb1aa('0x2c'));_0xa4a319[_0xb1aa('0x34')]=_[_0xb1aa('0x35')](_0x3c1b92[_0xb1aa('0x34')]);_0xa4a319[_0xb1aa('0x36')]=_['intersection'](_0xa4a319[_0xb1aa('0x37')],_0xa4a319['query']);_0x4b2c43['attributes']=_['intersection'](_0xa4a319[_0xb1aa('0x37')],qs[_0xb1aa('0x38')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x38')]));_0x4b2c43[_0xb1aa('0x39')]=_0x4b2c43['attributes'][_0xb1aa('0x3a')]?_0x4b2c43[_0xb1aa('0x39')]:_0xa4a319[_0xb1aa('0x37')];if(!_0x3c1b92['query']['hasOwnProperty']('nolimit')){_0x4b2c43[_0xb1aa('0x20')]=qs[_0xb1aa('0x20')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x20')]);_0x4b2c43['offset']=qs[_0xb1aa('0x22')](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x22')]);}_0x4b2c43[_0xb1aa('0x3b')]=qs['sort'](_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3c')]);_0x4b2c43[_0xb1aa('0x3d')]=qs['filters'](_[_0xb1aa('0x3e')](_0x3c1b92[_0xb1aa('0x34')],_0xa4a319[_0xb1aa('0x36')]),_0x5b2cde);if(_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3f')]){_0x4b2c43[_0xb1aa('0x3d')]=_[_0xb1aa('0x40')](_0x4b2c43[_0xb1aa('0x3d')],{'$or':_[_0xb1aa('0x2f')](_0x5b2cde,function(_0x5069c6){if(_0x5069c6[_0xb1aa('0x33')]!=='VIRTUAL'){var _0xa79749={};_0xa79749[_0x5069c6[_0xb1aa('0x2c')]]={'$like':'%'+_0x3c1b92[_0xb1aa('0x34')][_0xb1aa('0x3f')]+'%'};return _0xa79749;}})});}_0x4b2c43=_['merge']({},_0x4b2c43,_0x3c1b92[_0xb1aa('0x41')]);var _0x125f45={'where':_0x4b2c43[_0xb1aa('0x3d')]};return db['SquareMessage'][_0xb1aa('0x21')](_0x125f45)[_0xb1aa('0x28')](function(_0x56cb5b){_0x44ac69['count']=_0x56cb5b;if(_0x3c1b92['query'][_0xb1aa('0x42')]){_0x4b2c43[_0xb1aa('0x43')]=[{'all':!![]}];}return db[_0xb1aa('0x30')][_0xb1aa('0x44')](_0x4b2c43);})['then'](function(_0xcf3f4f){_0x44ac69[_0xb1aa('0x45')]=_0xcf3f4f;return _0x44ac69;})[_0xb1aa('0x28')](respondWithFilteredResult(_0x13f92d,_0x4b2c43))[_0xb1aa('0x46')](handleError(_0x13f92d,null));};exports[_0xb1aa('0x47')]=function(_0x581ca5,_0x25da68){var _0x1f2817={'raw':!![],'where':{'id':_0x581ca5[_0xb1aa('0x48')]['id']}},_0xe5be48={};_0xe5be48[_0xb1aa('0x37')]=_[_0xb1aa('0x35')](db[_0xb1aa('0x30')][_0xb1aa('0x31')]);_0xe5be48['query']=_[_0xb1aa('0x35')](_0x581ca5[_0xb1aa('0x34')]);_0xe5be48['filters']=_[_0xb1aa('0x49')](_0xe5be48[_0xb1aa('0x37')],_0xe5be48[_0xb1aa('0x34')]);_0x1f2817[_0xb1aa('0x39')]=_['intersection'](_0xe5be48['model'],qs[_0xb1aa('0x38')](_0x581ca5[_0xb1aa('0x34')]['fields']));_0x1f2817[_0xb1aa('0x39')]=_0x1f2817[_0xb1aa('0x39')][_0xb1aa('0x3a')]?_0x1f2817['attributes']:_0xe5be48[_0xb1aa('0x37')];if(_0x581ca5[_0xb1aa('0x34')]['includeAll']){_0x1f2817['include']=[{'all':!![]}];}_0x1f2817=_[_0xb1aa('0x40')]({},_0x1f2817,_0x581ca5[_0xb1aa('0x41')]);return db[_0xb1aa('0x30')]['find'](_0x1f2817)[_0xb1aa('0x28')](handleEntityNotFound(_0x25da68,null))[_0xb1aa('0x28')](respondWithResult(_0x25da68,null))[_0xb1aa('0x46')](handleError(_0x25da68,null));};exports[_0xb1aa('0x4a')]=function(_0x12baec,_0x54d7c1){return db[_0xb1aa('0x30')][_0xb1aa('0x4a')](_0x12baec[_0xb1aa('0x4b')],{})[_0xb1aa('0x28')](respondWithResult(_0x54d7c1,0xc9))['catch'](handleError(_0x54d7c1,null));};exports['update']=function(_0x213ab2,_0xfd9d9e){if(_0x213ab2['body']['id']){delete _0x213ab2[_0xb1aa('0x4b')]['id'];}return db[_0xb1aa('0x30')][_0xb1aa('0x4c')]({'where':{'id':_0x213ab2['params']['id']}})[_0xb1aa('0x28')](handleEntityNotFound(_0xfd9d9e,null))[_0xb1aa('0x28')](saveUpdates(_0x213ab2[_0xb1aa('0x4b')],null))[_0xb1aa('0x28')](respondWithResult(_0xfd9d9e,null))[_0xb1aa('0x46')](handleError(_0xfd9d9e,null));};exports[_0xb1aa('0x29')]=function(_0x764e3a,_0x278a56){return db[_0xb1aa('0x30')]['find']({'where':{'id':_0x764e3a['params']['id']}})[_0xb1aa('0x28')](handleEntityNotFound(_0x278a56,null))[_0xb1aa('0x28')](removeEntity(_0x278a56,null))[_0xb1aa('0x46')](handleError(_0x278a56,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 145c131..d184bf3 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 _0xd97f=['rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','api','request-promise','path'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xd97f,0x1ab));var _0xfd97=function(_0x3efb9b,_0x43b6e8){_0x3efb9b=_0x3efb9b-0x0;var _0xaaa508=_0xd97f[_0x3efb9b];return _0xaaa508;};'use strict';var _=require(_0xfd97('0x0'));var util=require(_0xfd97('0x1'));var logger=require('../../config/logger')(_0xfd97('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfd97('0x3'));var fs=require('fs');var path=require(_0xfd97('0x4'));var rimraf=require(_0xfd97('0x5'));var config=require(_0xfd97('0x6'));var attributes=require(_0xfd97('0x7'));module[_0xfd97('0x8')]=function(_0xc4ce9b,_0x424eba){return _0xc4ce9b[_0xfd97('0x9')](_0xfd97('0xa'),attributes,{'tableName':_0xfd97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb97=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define','square_messages'];(function(_0x436f80,_0x439354){var _0x428681=function(_0x46fd20){while(--_0x46fd20){_0x436f80['push'](_0x436f80['shift']());}};_0x428681(++_0x439354);}(_0xdb97,0xd8));var _0x7db9=function(_0x33c6da,_0x43909f){_0x33c6da=_0x33c6da-0x0;var _0xbea0f7=_0xdb97[_0x33c6da];return _0xbea0f7;};'use strict';var _=require(_0x7db9('0x0'));var util=require('util');var logger=require(_0x7db9('0x1'))(_0x7db9('0x2'));var moment=require(_0x7db9('0x3'));var BPromise=require(_0x7db9('0x4'));var rp=require(_0x7db9('0x5'));var fs=require('fs');var path=require(_0x7db9('0x6'));var rimraf=require(_0x7db9('0x7'));var config=require(_0x7db9('0x8'));var attributes=require(_0x7db9('0x9'));module['exports']=function(_0x48a0a2,_0x10cdc7){return _0x48a0a2[_0x7db9('0xa')]('SquareMessage',attributes,{'tableName':_0x7db9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 68a0ea5..d232027 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 _0x2938=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','body','options','raw','debug','stringify','lodash','util','bluebird','ioredis'];(function(_0x17f9b8,_0x579c3e){var _0x43e7e6=function(_0x29d37d){while(--_0x29d37d){_0x17f9b8['push'](_0x17f9b8['shift']());}};_0x43e7e6(++_0x579c3e);}(_0x2938,0xe6));var _0x8293=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2938[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8293('0x0'));var util=require(_0x8293('0x1'));var moment=require('moment');var BPromise=require(_0x8293('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8293('0x3'));var db=require(_0x8293('0x4'))['db'];var utils=require(_0x8293('0x5'));var logger=require(_0x8293('0x6'))('rpc');var config=require(_0x8293('0x7'));var jayson=require(_0x8293('0x8'));var client=jayson[_0x8293('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f92f2,_0x5b82cd,_0x3f3ec5){return new BPromise(function(_0x31221b,_0x41a880){return client[_0x8293('0xa')](_0x1f92f2,_0x3f3ec5)[_0x8293('0xb')](function(_0x440d2c){logger[_0x8293('0xc')]('SquareMessage,\x20%s,\x20%s',_0x5b82cd,_0x8293('0xd'));logger['debug'](_0x8293('0xe'),_0x5b82cd,_0x8293('0xd'),JSON['stringify'](_0x440d2c));if(_0x440d2c[_0x8293('0xf')]){if(_0x440d2c['error']['code']===0x1f4){logger[_0x8293('0xf')]('SquareMessage,\x20%s,\x20%s',_0x5b82cd,_0x440d2c['error'][_0x8293('0x10')]);return _0x41a880(_0x440d2c[_0x8293('0xf')][_0x8293('0x10')]);}logger[_0x8293('0xf')](_0x8293('0x11'),_0x5b82cd,_0x440d2c[_0x8293('0xf')][_0x8293('0x10')]);return _0x31221b(_0x440d2c['error'][_0x8293('0x10')]);}else{logger['info'](_0x8293('0x11'),_0x5b82cd,_0x8293('0xd'));_0x31221b(_0x440d2c[_0x8293('0x12')][_0x8293('0x10')]);}})[_0x8293('0x13')](function(_0x1886ad){logger['error'](_0x8293('0x11'),_0x5b82cd,_0x1886ad);_0x41a880(_0x1886ad);});});}exports[_0x8293('0x14')]=function(_0x153524){var _0xb9d728=this;return new Promise(function(_0x4b8f10,_0xc155c7){return db['SquareMessage']['create'](_0x153524[_0x8293('0x15')],{'raw':_0x153524[_0x8293('0x16')]?_0x153524['options'][_0x8293('0x17')]===undefined?!![]:![]:!![]})[_0x8293('0xb')](function(_0x18ec67){logger[_0x8293('0xc')]('CreateSquareMessage',_0x153524);logger[_0x8293('0x18')](_0x8293('0x14'),_0x153524,JSON[_0x8293('0x19')](_0x18ec67));_0x4b8f10(_0x18ec67);})[_0x8293('0x13')](function(_0x1db657){logger[_0x8293('0xf')](_0x8293('0x14'),_0x1db657[_0x8293('0x10')],_0x153524);_0xc155c7(_0xb9d728[_0x8293('0xf')](0x1f4,_0x1db657[_0x8293('0x10')]));});});}; \ No newline at end of file +var _0x4a13=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','SquareMessage','create','options','then','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4a13,0x7d));var _0x34a1=function(_0x477b13,_0x183f6d){_0x477b13=_0x477b13-0x0;var _0x4986a4=_0x4a13[_0x477b13];return _0x4986a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x34a1('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34a1('0x1'));var db=require(_0x34a1('0x2'))['db'];var utils=require(_0x34a1('0x3'));var logger=require(_0x34a1('0x4'))(_0x34a1('0x5'));var config=require(_0x34a1('0x6'));var jayson=require(_0x34a1('0x7'));var client=jayson[_0x34a1('0x8')][_0x34a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ddf90,_0x5d5864,_0x2c606c){return new BPromise(function(_0x22ad59,_0x165752){return client[_0x34a1('0xa')](_0x4ddf90,_0x2c606c)['then'](function(_0x49c953){logger[_0x34a1('0xb')]('SquareMessage,\x20%s,\x20%s',_0x5d5864,_0x34a1('0xc'));logger[_0x34a1('0xd')](_0x34a1('0xe'),_0x5d5864,_0x34a1('0xc'),JSON[_0x34a1('0xf')](_0x49c953));if(_0x49c953[_0x34a1('0x10')]){if(_0x49c953['error']['code']===0x1f4){logger[_0x34a1('0x10')](_0x34a1('0x11'),_0x5d5864,_0x49c953[_0x34a1('0x10')][_0x34a1('0x12')]);return _0x165752(_0x49c953[_0x34a1('0x10')][_0x34a1('0x12')]);}logger[_0x34a1('0x10')](_0x34a1('0x11'),_0x5d5864,_0x49c953['error'][_0x34a1('0x12')]);return _0x22ad59(_0x49c953[_0x34a1('0x10')][_0x34a1('0x12')]);}else{logger[_0x34a1('0xb')](_0x34a1('0x11'),_0x5d5864,_0x34a1('0xc'));_0x22ad59(_0x49c953[_0x34a1('0x13')][_0x34a1('0x12')]);}})['catch'](function(_0x16384a){logger[_0x34a1('0x10')](_0x34a1('0x11'),_0x5d5864,_0x16384a);_0x165752(_0x16384a);});});}exports[_0x34a1('0x14')]=function(_0x5eecef){var _0x25a248=this;return new Promise(function(_0x1328c1,_0x172d95){return db[_0x34a1('0x15')][_0x34a1('0x16')](_0x5eecef['body'],{'raw':_0x5eecef[_0x34a1('0x17')]?_0x5eecef[_0x34a1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x34a1('0x18')](function(_0x1a5976){logger[_0x34a1('0xb')](_0x34a1('0x14'),_0x5eecef);logger['debug']('CreateSquareMessage',_0x5eecef,JSON[_0x34a1('0xf')](_0x1a5976));_0x1328c1(_0x1a5976);})[_0x34a1('0x19')](function(_0x290d1b){logger['error']('CreateSquareMessage',_0x290d1b[_0x34a1('0x12')],_0x5eecef);_0x172d95(_0x25a248[_0x34a1('0x10')](0x1f4,_0x290d1b[_0x34a1('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index f9ae9c3..432944b 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 _0xd1e8=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','show','/:id/test','15s','test','create','put','/:id','delete'];(function(_0x2af2f9,_0x5bd215){var _0x527f4a=function(_0x2253f1){while(--_0x2253f1){_0x2af2f9['push'](_0x2af2f9['shift']());}};_0x527f4a(++_0x5bd215);}(_0xd1e8,0x1a3));var _0x8d1e=function(_0x3a5eb3,_0x346050){_0x3a5eb3=_0x3a5eb3-0x0;var _0x4d2e43=_0xd1e8[_0x3a5eb3];return _0x4d2e43;};'use strict';var multer=require('multer');var util=require(_0x8d1e('0x0'));var path=require(_0x8d1e('0x1'));var timeout=require(_0x8d1e('0x2'));var express=require(_0x8d1e('0x3'));var router=express[_0x8d1e('0x4')]();var fs_extra=require(_0x8d1e('0x5'));var auth=require(_0x8d1e('0x6'));var interaction=require(_0x8d1e('0x7'));var config=require(_0x8d1e('0x8'));var controller=require(_0x8d1e('0x9'));router['get']('/',auth[_0x8d1e('0xa')](),controller[_0x8d1e('0xb')]);router[_0x8d1e('0xc')]('/:id',auth[_0x8d1e('0xa')](),controller[_0x8d1e('0xd')]);router[_0x8d1e('0xc')](_0x8d1e('0xe'),auth[_0x8d1e('0xa')](),timeout(_0x8d1e('0xf')),controller[_0x8d1e('0x10')]);router['post']('/',auth[_0x8d1e('0xa')](),controller[_0x8d1e('0x11')]);router[_0x8d1e('0x12')](_0x8d1e('0x13'),auth[_0x8d1e('0xa')](),controller['update']);router[_0x8d1e('0x14')]('/:id',auth[_0x8d1e('0xa')](),controller['destroy']);module[_0x8d1e('0x15')]=router; \ No newline at end of file +var _0x97af=['fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x23a74a,_0x5bd56d){var _0x4617ac=function(_0x16c677){while(--_0x16c677){_0x23a74a['push'](_0x23a74a['shift']());}};_0x4617ac(++_0x5bd56d);}(_0x97af,0x1df));var _0xf97a=function(_0xba49ca,_0x440a90){_0xba49ca=_0xba49ca-0x0;var _0x3700aa=_0x97af[_0xba49ca];return _0x3700aa;};'use strict';var multer=require(_0xf97a('0x0'));var util=require(_0xf97a('0x1'));var path=require(_0xf97a('0x2'));var timeout=require(_0xf97a('0x3'));var express=require(_0xf97a('0x4'));var router=express['Router']();var fs_extra=require(_0xf97a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf97a('0x6'));var config=require(_0xf97a('0x7'));var controller=require(_0xf97a('0x8'));router[_0xf97a('0x9')]('/',auth[_0xf97a('0xa')](),controller[_0xf97a('0xb')]);router['get'](_0xf97a('0xc'),auth[_0xf97a('0xa')](),controller['show']);router[_0xf97a('0x9')](_0xf97a('0xd'),auth[_0xf97a('0xa')](),timeout(_0xf97a('0xe')),controller[_0xf97a('0xf')]);router[_0xf97a('0x10')]('/',auth[_0xf97a('0xa')](),controller[_0xf97a('0x11')]);router[_0xf97a('0x12')](_0xf97a('0xc'),auth['isAuthenticated'](),controller[_0xf97a('0x13')]);router[_0xf97a('0x14')](_0xf97a('0xc'),auth[_0xf97a('0xa')](),controller[_0xf97a('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5d6acd1..506a007 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 _0xb7c7=['STRING','name'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xb7c7,0xef));var _0x7b7c=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0xb7c7[_0x3e0dc4];return _0x586111;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7b7c('0x0'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7b7c('0x1')]},'description':{'type':Sequelize[_0x7b7c('0x1')]}}; \ No newline at end of file +var _0x8bc4=['exports','name','STRING','sequelize'];(function(_0x3ffb6a,_0x21114){var _0xd082a0=function(_0x1d0d50){while(--_0x1d0d50){_0x3ffb6a['push'](_0x3ffb6a['shift']());}};_0xd082a0(++_0x21114);}(_0x8bc4,0x6f));var _0x48bc=function(_0x42a21d,_0x5daf52){_0x42a21d=_0x42a21d-0x0;var _0x2d523d=_0x8bc4[_0x42a21d];return _0x2d523d;};'use strict';var Sequelize=require(_0x48bc('0x0'));module[_0x48bc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x48bc('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x48bc('0x3')]},'description':{'type':Sequelize[_0x48bc('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index d05f4f5..b264700 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 _0xeccf=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','error','name','index','map','SquareOdbc','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','merge','include','catch','params','intersection','create','body','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x5e31e2,_0x273090){var _0x294e2c=function(_0x20ab82){while(--_0x20ab82){_0x5e31e2['push'](_0x5e31e2['shift']());}};_0x294e2c(++_0x273090);}(_0xeccf,0x1ed));var _0xfecc=function(_0x4f5567,_0x41d109){_0x4f5567=_0x4f5567-0x0;var _0x5c5bce=_0xeccf[_0x4f5567];return _0x5c5bce;};'use strict';var emlformat=require(_0xfecc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfecc('0x1'));var jsonpatch=require(_0xfecc('0x2'));var rp=require(_0xfecc('0x3'));var moment=require(_0xfecc('0x4'));var BPromise=require(_0xfecc('0x5'));var Mustache=require(_0xfecc('0x6'));var util=require(_0xfecc('0x7'));var path=require('path');var sox=require(_0xfecc('0x8'));var csv=require(_0xfecc('0x9'));var ejs=require(_0xfecc('0xa'));var fs=require('fs');var fs_extra=require(_0xfecc('0xb'));var _=require(_0xfecc('0xc'));var squel=require(_0xfecc('0xd'));var crypto=require(_0xfecc('0xe'));var jsforce=require(_0xfecc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfecc('0x9'));var querystring=require(_0xfecc('0x10'));var Papa=require(_0xfecc('0x11'));var Redis=require(_0xfecc('0x12'));var authService=require(_0xfecc('0x13'));var qs=require(_0xfecc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfecc('0x15'));var logger=require(_0xfecc('0x16'))(_0xfecc('0x17'));var utils=require(_0xfecc('0x18'));var config=require(_0xfecc('0x19'));var licenseUtil=require(_0xfecc('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a3eb6,_0x49a0eb){_0x49a0eb=_0x49a0eb||0xcc;return function(_0x59ef9){if(_0x59ef9){return _0x2a3eb6[_0xfecc('0x1b')](_0x49a0eb);}return _0x2a3eb6[_0xfecc('0x1c')](_0x49a0eb)[_0xfecc('0x1d')]();};}function respondWithResult(_0x1f09c5,_0xef80ca){_0xef80ca=_0xef80ca||0xc8;return function(_0x3be54e){if(_0x3be54e){return _0x1f09c5[_0xfecc('0x1c')](_0xef80ca)['json'](_0x3be54e);}};}function respondWithFilteredResult(_0x488f18,_0x1af8e4){return function(_0x5d4822){if(_0x5d4822){var _0x4efe76=typeof _0x1af8e4[_0xfecc('0x1e')]===_0xfecc('0x1f')&&typeof _0x1af8e4[_0xfecc('0x20')]===_0xfecc('0x1f');var _0x391dfc=_0x5d4822[_0xfecc('0x21')];var _0x551342=_0x4efe76?0x0:_0x1af8e4[_0xfecc('0x1e')];var _0x227b4f=_0x4efe76?_0x5d4822[_0xfecc('0x21')]:_0x1af8e4['offset']+_0x1af8e4['limit'];var _0xa6bcbd;if(_0x227b4f>=_0x391dfc){_0x227b4f=_0x391dfc;_0xa6bcbd=0xc8;}else{_0xa6bcbd=0xce;}_0x488f18[_0xfecc('0x1c')](_0xa6bcbd);return _0x488f18[_0xfecc('0x22')](_0xfecc('0x23'),_0x551342+'-'+_0x227b4f+'/'+_0x391dfc)[_0xfecc('0x24')](_0x5d4822);}return null;};}function patchUpdates(_0x5bfeac){return function(_0x295fce){try{jsonpatch[_0xfecc('0x25')](_0x295fce,_0x5bfeac,!![]);}catch(_0x14811e){return BPromise[_0xfecc('0x26')](_0x14811e);}return _0x295fce[_0xfecc('0x27')]();};}function saveUpdates(_0x5fd6f8,_0x415063){return function(_0x4a4809){if(_0x4a4809){return _0x4a4809[_0xfecc('0x28')](_0x5fd6f8)[_0xfecc('0x29')](function(_0x4cc0f2){return _0x4cc0f2;});}return null;};}function removeEntity(_0xc6665c,_0x36f6d3){return function(_0x31cc82){if(_0x31cc82){return _0x31cc82[_0xfecc('0x2a')]()[_0xfecc('0x29')](function(){var _0x5cc63f=_0x31cc82['get']({'plain':!![]});var _0x5917be=_0xfecc('0x2b');return db[_0xfecc('0x2c')][_0xfecc('0x2a')]({'where':{'type':_0x5917be,'resourceId':_0x5cc63f['id']}})[_0xfecc('0x29')](function(){return _0x31cc82;});})['then'](function(){_0xc6665c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x407f82,_0x540caf){return function(_0x1fc5e2){if(!_0x1fc5e2){_0x407f82[_0xfecc('0x1b')](0x194);}return _0x1fc5e2;};}function handleError(_0x5d49a7,_0x19d966){_0x19d966=_0x19d966||0x1f4;return function(_0xfdb854){logger[_0xfecc('0x2d')](_0xfdb854['stack']);if(_0xfdb854[_0xfecc('0x2e')]){delete _0xfdb854[_0xfecc('0x2e')];}_0x5d49a7[_0xfecc('0x1c')](_0x19d966)['send'](_0xfdb854);};}exports[_0xfecc('0x2f')]=function(_0x16f374,_0x2aacbb){var _0x272487={},_0x447321={},_0x2be189={'count':0x0,'rows':[]};var _0x53016a=_[_0xfecc('0x30')](db[_0xfecc('0x31')][_0xfecc('0x32')],function(_0x59a0b2){return{'name':_0x59a0b2[_0xfecc('0x33')],'type':_0x59a0b2['type']['key']};});_0x447321[_0xfecc('0x34')]=_[_0xfecc('0x30')](_0x53016a,_0xfecc('0x2e'));_0x447321[_0xfecc('0x35')]=_[_0xfecc('0x36')](_0x16f374[_0xfecc('0x35')]);_0x447321[_0xfecc('0x37')]=_['intersection'](_0x447321[_0xfecc('0x34')],_0x447321[_0xfecc('0x35')]);_0x272487[_0xfecc('0x38')]=_['intersection'](_0x447321['model'],qs['fields'](_0x16f374['query'][_0xfecc('0x39')]));_0x272487['attributes']=_0x272487['attributes'][_0xfecc('0x3a')]?_0x272487['attributes']:_0x447321['model'];if(!_0x16f374[_0xfecc('0x35')][_0xfecc('0x3b')]('nolimit')){_0x272487[_0xfecc('0x20')]=qs[_0xfecc('0x20')](_0x16f374[_0xfecc('0x35')][_0xfecc('0x20')]);_0x272487[_0xfecc('0x1e')]=qs['offset'](_0x16f374[_0xfecc('0x35')][_0xfecc('0x1e')]);}_0x272487[_0xfecc('0x3c')]=qs[_0xfecc('0x3d')](_0x16f374['query'][_0xfecc('0x3d')]);_0x272487['where']=qs['filters'](_[_0xfecc('0x3e')](_0x16f374[_0xfecc('0x35')],_0x447321[_0xfecc('0x37')]),_0x53016a);if(_0x16f374[_0xfecc('0x35')][_0xfecc('0x3f')]){_0x272487[_0xfecc('0x40')]=_['merge'](_0x272487[_0xfecc('0x40')],{'$or':_[_0xfecc('0x30')](_0x53016a,function(_0x385004){if(_0x385004[_0xfecc('0x41')]!==_0xfecc('0x42')){var _0x1dc232={};_0x1dc232[_0x385004['name']]={'$like':'%'+_0x16f374[_0xfecc('0x35')][_0xfecc('0x3f')]+'%'};return _0x1dc232;}})});}_0x272487=_[_0xfecc('0x43')]({},_0x272487,_0x16f374['options']);var _0x409a3d={'where':_0x272487[_0xfecc('0x40')]};return db[_0xfecc('0x31')][_0xfecc('0x21')](_0x409a3d)[_0xfecc('0x29')](function(_0xd7c9e2){_0x2be189[_0xfecc('0x21')]=_0xd7c9e2;if(_0x16f374['query']['includeAll']){_0x272487[_0xfecc('0x44')]=[{'all':!![]}];}return db[_0xfecc('0x31')]['findAll'](_0x272487);})[_0xfecc('0x29')](function(_0x4fd194){_0x2be189['rows']=_0x4fd194;return _0x2be189;})[_0xfecc('0x29')](respondWithFilteredResult(_0x2aacbb,_0x272487))[_0xfecc('0x45')](handleError(_0x2aacbb,null));};exports['show']=function(_0x1a5deb,_0x2231c2){var _0x4a3bb5={'raw':!![],'where':{'id':_0x1a5deb[_0xfecc('0x46')]['id']}},_0x675f01={};_0x675f01[_0xfecc('0x34')]=_[_0xfecc('0x36')](db[_0xfecc('0x31')][_0xfecc('0x32')]);_0x675f01[_0xfecc('0x35')]=_[_0xfecc('0x36')](_0x1a5deb[_0xfecc('0x35')]);_0x675f01['filters']=_[_0xfecc('0x47')](_0x675f01[_0xfecc('0x34')],_0x675f01[_0xfecc('0x35')]);_0x4a3bb5['attributes']=_[_0xfecc('0x47')](_0x675f01['model'],qs[_0xfecc('0x39')](_0x1a5deb['query'][_0xfecc('0x39')]));_0x4a3bb5['attributes']=_0x4a3bb5[_0xfecc('0x38')]['length']?_0x4a3bb5[_0xfecc('0x38')]:_0x675f01['model'];if(_0x1a5deb[_0xfecc('0x35')]['includeAll']){_0x4a3bb5[_0xfecc('0x44')]=[{'all':!![]}];}_0x4a3bb5=_[_0xfecc('0x43')]({},_0x4a3bb5,_0x1a5deb['options']);return db['SquareOdbc']['find'](_0x4a3bb5)[_0xfecc('0x29')](handleEntityNotFound(_0x2231c2,null))[_0xfecc('0x29')](respondWithResult(_0x2231c2,null))[_0xfecc('0x45')](handleError(_0x2231c2,null));};exports[_0xfecc('0x48')]=function(_0x209ebd,_0x4fb7e1){return db[_0xfecc('0x31')][_0xfecc('0x48')](_0x209ebd[_0xfecc('0x49')],{})['then'](function(_0x54830b){var _0x426ec0=_0x209ebd[_0xfecc('0x4a')][_0xfecc('0x4b')]({'plain':!![]});if(!_0x426ec0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x426ec0[_0xfecc('0x4c')]===_0xfecc('0x4a')){var _0xaa8d05=_0x54830b[_0xfecc('0x4b')]({'plain':!![]});var _0x556d83='ODBC';return db[_0xfecc('0x4d')][_0xfecc('0x4e')]({'where':{'name':_0x556d83,'userProfileId':_0x426ec0[_0xfecc('0x4f')]},'raw':!![]})['then'](function(_0x45744a){if(_0x45744a&&_0x45744a[_0xfecc('0x50')]===0x0){return db[_0xfecc('0x2c')][_0xfecc('0x48')]({'name':_0xaa8d05[_0xfecc('0x2e')],'resourceId':_0xaa8d05['id'],'type':_0x45744a[_0xfecc('0x2e')],'sectionId':_0x45744a['id']},{})[_0xfecc('0x29')](function(){return _0x54830b;});}else{return _0x54830b;}})['catch'](function(_0x2e60b6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e60b6);throw _0x2e60b6;});}return _0x54830b;})[_0xfecc('0x29')](respondWithResult(_0x4fb7e1,0xc9))[_0xfecc('0x45')](handleError(_0x4fb7e1,null));};exports[_0xfecc('0x28')]=function(_0x3fe85e,_0x447737){if(_0x3fe85e[_0xfecc('0x49')]['id']){delete _0x3fe85e[_0xfecc('0x49')]['id'];}return db[_0xfecc('0x31')][_0xfecc('0x4e')]({'where':{'id':_0x3fe85e[_0xfecc('0x46')]['id']}})[_0xfecc('0x29')](handleEntityNotFound(_0x447737,null))[_0xfecc('0x29')](saveUpdates(_0x3fe85e[_0xfecc('0x49')],null))[_0xfecc('0x29')](respondWithResult(_0x447737,null))[_0xfecc('0x45')](handleError(_0x447737,null));};exports[_0xfecc('0x2a')]=function(_0x11e110,_0x47ca4b){return db['SquareOdbc'][_0xfecc('0x4e')]({'where':{'id':_0x11e110[_0xfecc('0x46')]['id']}})[_0xfecc('0x29')](handleEntityNotFound(_0x47ca4b,null))[_0xfecc('0x29')](removeEntity(_0x47ca4b,null))[_0xfecc('0x45')](handleError(_0x47ca4b,null));};exports[_0xfecc('0x51')]=function(_0x31ba75,_0x204b7a,_0x1e6bc4){var _0x2ae10d;return db[_0xfecc('0x31')][_0xfecc('0x4e')]({'where':{'id':_0x31ba75[_0xfecc('0x46')]['id']},'attributes':['id',_0xfecc('0x52')]})[_0xfecc('0x29')](handleEntityNotFound(_0x204b7a,null))[_0xfecc('0x29')](function(_0x504c1d){if(_0x504c1d){var _0x5c7202=require(_0xfecc('0x53'))();_0x5c7202[_0xfecc('0x54')](_0x504c1d[_0xfecc('0x52')]);_0x5c7202[_0xfecc('0x55')]();return _0x504c1d;}})[_0xfecc('0x29')](respondWithResult(_0x204b7a,null))['catch'](handleError(_0x204b7a,null));}; \ No newline at end of file +var _0x68ee=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','send','index','SquareOdbc','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x29abca,_0x4ee067){var _0x1d6828=function(_0x4deb4a){while(--_0x4deb4a){_0x29abca['push'](_0x29abca['shift']());}};_0x1d6828(++_0x4ee067);}(_0x68ee,0xb2));var _0xe68e=function(_0x2ab16a,_0x5307aa){_0x2ab16a=_0x2ab16a-0x0;var _0x5ec6c2=_0x68ee[_0x2ab16a];return _0x5ec6c2;};'use strict';var emlformat=require(_0xe68e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe68e('0x1'));var jsonpatch=require(_0xe68e('0x2'));var rp=require(_0xe68e('0x3'));var moment=require(_0xe68e('0x4'));var BPromise=require(_0xe68e('0x5'));var Mustache=require(_0xe68e('0x6'));var util=require(_0xe68e('0x7'));var path=require('path');var sox=require(_0xe68e('0x8'));var csv=require(_0xe68e('0x9'));var ejs=require(_0xe68e('0xa'));var fs=require('fs');var fs_extra=require(_0xe68e('0xb'));var _=require(_0xe68e('0xc'));var squel=require(_0xe68e('0xd'));var crypto=require(_0xe68e('0xe'));var jsforce=require(_0xe68e('0xf'));var deskjs=require(_0xe68e('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe68e('0x11'));var authService=require(_0xe68e('0x12'));var qs=require(_0xe68e('0x13'));var as=require(_0xe68e('0x14'));var hardwareService=require(_0xe68e('0x15'));var logger=require(_0xe68e('0x16'))(_0xe68e('0x17'));var utils=require(_0xe68e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe68e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13fcc3,_0x53b1af){_0x53b1af=_0x53b1af||0xcc;return function(_0x4f04e3){if(_0x4f04e3){return _0x13fcc3['sendStatus'](_0x53b1af);}return _0x13fcc3[_0xe68e('0x1a')](_0x53b1af)[_0xe68e('0x1b')]();};}function respondWithResult(_0x1507e1,_0xe0eae0){_0xe0eae0=_0xe0eae0||0xc8;return function(_0x24e8b0){if(_0x24e8b0){return _0x1507e1[_0xe68e('0x1a')](_0xe0eae0)['json'](_0x24e8b0);}};}function respondWithFilteredResult(_0x20123d,_0x371ea0){return function(_0x332239){if(_0x332239){var _0x6ffa9a=typeof _0x371ea0[_0xe68e('0x1c')]===_0xe68e('0x1d')&&typeof _0x371ea0['limit']==='undefined';var _0x116b68=_0x332239['count'];var _0x29ad41=_0x6ffa9a?0x0:_0x371ea0['offset'];var _0x517c61=_0x6ffa9a?_0x332239[_0xe68e('0x1e')]:_0x371ea0[_0xe68e('0x1c')]+_0x371ea0[_0xe68e('0x1f')];var _0x57caed;if(_0x517c61>=_0x116b68){_0x517c61=_0x116b68;_0x57caed=0xc8;}else{_0x57caed=0xce;}_0x20123d[_0xe68e('0x1a')](_0x57caed);return _0x20123d[_0xe68e('0x20')](_0xe68e('0x21'),_0x29ad41+'-'+_0x517c61+'/'+_0x116b68)[_0xe68e('0x22')](_0x332239);}return null;};}function patchUpdates(_0x5f33c9){return function(_0x52182d){try{jsonpatch['apply'](_0x52182d,_0x5f33c9,!![]);}catch(_0x55f65e){return BPromise[_0xe68e('0x23')](_0x55f65e);}return _0x52182d[_0xe68e('0x24')]();};}function saveUpdates(_0x188ec4,_0x3e2a3d){return function(_0x35255a){if(_0x35255a){return _0x35255a['update'](_0x188ec4)[_0xe68e('0x25')](function(_0x47c8c9){return _0x47c8c9;});}return null;};}function removeEntity(_0x3f3830,_0x35025c){return function(_0xf1c3e1){if(_0xf1c3e1){return _0xf1c3e1[_0xe68e('0x26')]()['then'](function(){var _0x3c0ed9=_0xf1c3e1[_0xe68e('0x27')]({'plain':!![]});var _0xc2200c=_0xe68e('0x28');return db[_0xe68e('0x29')][_0xe68e('0x26')]({'where':{'type':_0xc2200c,'resourceId':_0x3c0ed9['id']}})[_0xe68e('0x25')](function(){return _0xf1c3e1;});})[_0xe68e('0x25')](function(){_0x3f3830[_0xe68e('0x1a')](0xcc)[_0xe68e('0x1b')]();});}};}function handleEntityNotFound(_0x17ce95,_0x43edc1){return function(_0x316e6a){if(!_0x316e6a){_0x17ce95[_0xe68e('0x2a')](0x194);}return _0x316e6a;};}function handleError(_0x3993e1,_0x22fddf){_0x22fddf=_0x22fddf||0x1f4;return function(_0x2f9732){logger[_0xe68e('0x2b')](_0x2f9732[_0xe68e('0x2c')]);if(_0x2f9732['name']){delete _0x2f9732['name'];}_0x3993e1[_0xe68e('0x1a')](_0x22fddf)[_0xe68e('0x2d')](_0x2f9732);};}exports[_0xe68e('0x2e')]=function(_0x4d2cb3,_0x2ee98a){var _0x27cffb={},_0x5928a7={},_0x1d7351={'count':0x0,'rows':[]};var _0x5f51e1=_['map'](db[_0xe68e('0x2f')][_0xe68e('0x30')],function(_0x1f4f98){return{'name':_0x1f4f98['fieldName'],'type':_0x1f4f98[_0xe68e('0x31')][_0xe68e('0x32')]};});_0x5928a7[_0xe68e('0x33')]=_[_0xe68e('0x34')](_0x5f51e1,_0xe68e('0x35'));_0x5928a7[_0xe68e('0x36')]=_[_0xe68e('0x37')](_0x4d2cb3[_0xe68e('0x36')]);_0x5928a7[_0xe68e('0x38')]=_[_0xe68e('0x39')](_0x5928a7['model'],_0x5928a7[_0xe68e('0x36')]);_0x27cffb[_0xe68e('0x3a')]=_[_0xe68e('0x39')](_0x5928a7[_0xe68e('0x33')],qs[_0xe68e('0x3b')](_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x3b')]));_0x27cffb[_0xe68e('0x3a')]=_0x27cffb[_0xe68e('0x3a')][_0xe68e('0x3c')]?_0x27cffb['attributes']:_0x5928a7[_0xe68e('0x33')];if(!_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x3d')]('nolimit')){_0x27cffb[_0xe68e('0x1f')]=qs[_0xe68e('0x1f')](_0x4d2cb3[_0xe68e('0x36')]['limit']);_0x27cffb['offset']=qs[_0xe68e('0x1c')](_0x4d2cb3[_0xe68e('0x36')]['offset']);}_0x27cffb[_0xe68e('0x3e')]=qs[_0xe68e('0x3f')](_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x3f')]);_0x27cffb[_0xe68e('0x40')]=qs[_0xe68e('0x38')](_[_0xe68e('0x41')](_0x4d2cb3[_0xe68e('0x36')],_0x5928a7[_0xe68e('0x38')]),_0x5f51e1);if(_0x4d2cb3[_0xe68e('0x36')]['filter']){_0x27cffb['where']=_[_0xe68e('0x42')](_0x27cffb[_0xe68e('0x40')],{'$or':_[_0xe68e('0x34')](_0x5f51e1,function(_0x4a992d){if(_0x4a992d['type']!==_0xe68e('0x43')){var _0x17e73e={};_0x17e73e[_0x4a992d[_0xe68e('0x35')]]={'$like':'%'+_0x4d2cb3[_0xe68e('0x36')][_0xe68e('0x44')]+'%'};return _0x17e73e;}})});}_0x27cffb=_[_0xe68e('0x42')]({},_0x27cffb,_0x4d2cb3[_0xe68e('0x45')]);var _0x421458={'where':_0x27cffb[_0xe68e('0x40')]};return db['SquareOdbc'][_0xe68e('0x1e')](_0x421458)[_0xe68e('0x25')](function(_0x5dc309){_0x1d7351[_0xe68e('0x1e')]=_0x5dc309;if(_0x4d2cb3['query'][_0xe68e('0x46')]){_0x27cffb[_0xe68e('0x47')]=[{'all':!![]}];}return db['SquareOdbc'][_0xe68e('0x48')](_0x27cffb);})['then'](function(_0x816593){_0x1d7351[_0xe68e('0x49')]=_0x816593;return _0x1d7351;})[_0xe68e('0x25')](respondWithFilteredResult(_0x2ee98a,_0x27cffb))[_0xe68e('0x4a')](handleError(_0x2ee98a,null));};exports[_0xe68e('0x4b')]=function(_0x4aeb72,_0x5ce3f0){var _0x53e3b5={'raw':!![],'where':{'id':_0x4aeb72[_0xe68e('0x4c')]['id']}},_0x562824={};_0x562824[_0xe68e('0x33')]=_[_0xe68e('0x37')](db[_0xe68e('0x2f')][_0xe68e('0x30')]);_0x562824[_0xe68e('0x36')]=_[_0xe68e('0x37')](_0x4aeb72[_0xe68e('0x36')]);_0x562824['filters']=_['intersection'](_0x562824[_0xe68e('0x33')],_0x562824[_0xe68e('0x36')]);_0x53e3b5[_0xe68e('0x3a')]=_['intersection'](_0x562824[_0xe68e('0x33')],qs['fields'](_0x4aeb72[_0xe68e('0x36')][_0xe68e('0x3b')]));_0x53e3b5[_0xe68e('0x3a')]=_0x53e3b5[_0xe68e('0x3a')]['length']?_0x53e3b5[_0xe68e('0x3a')]:_0x562824[_0xe68e('0x33')];if(_0x4aeb72['query'][_0xe68e('0x46')]){_0x53e3b5[_0xe68e('0x47')]=[{'all':!![]}];}_0x53e3b5=_[_0xe68e('0x42')]({},_0x53e3b5,_0x4aeb72['options']);return db[_0xe68e('0x2f')][_0xe68e('0x4d')](_0x53e3b5)[_0xe68e('0x25')](handleEntityNotFound(_0x5ce3f0,null))['then'](respondWithResult(_0x5ce3f0,null))[_0xe68e('0x4a')](handleError(_0x5ce3f0,null));};exports[_0xe68e('0x4e')]=function(_0x489414,_0x35b08c){return db[_0xe68e('0x2f')][_0xe68e('0x4e')](_0x489414['body'],{})[_0xe68e('0x25')](function(_0x134900){var _0x2f1096=_0x489414[_0xe68e('0x4f')]['get']({'plain':!![]});if(!_0x2f1096)throw new Error(_0xe68e('0x50'));if(_0x2f1096[_0xe68e('0x51')]===_0xe68e('0x4f')){var _0x13daad=_0x134900['get']({'plain':!![]});var _0x3f20bb=_0xe68e('0x28');return db[_0xe68e('0x52')][_0xe68e('0x4d')]({'where':{'name':_0x3f20bb,'userProfileId':_0x2f1096[_0xe68e('0x53')]},'raw':!![]})[_0xe68e('0x25')](function(_0xc64202){if(_0xc64202&&_0xc64202[_0xe68e('0x54')]===0x0){return db['UserProfileResource'][_0xe68e('0x4e')]({'name':_0x13daad[_0xe68e('0x35')],'resourceId':_0x13daad['id'],'type':_0xc64202[_0xe68e('0x35')],'sectionId':_0xc64202['id']},{})['then'](function(){return _0x134900;});}else{return _0x134900;}})[_0xe68e('0x4a')](function(_0x9897e9){logger[_0xe68e('0x2b')](_0xe68e('0x55'),_0x9897e9);throw _0x9897e9;});}return _0x134900;})[_0xe68e('0x25')](respondWithResult(_0x35b08c,0xc9))[_0xe68e('0x4a')](handleError(_0x35b08c,null));};exports[_0xe68e('0x56')]=function(_0x1f5109,_0x5ac9f1){if(_0x1f5109[_0xe68e('0x57')]['id']){delete _0x1f5109[_0xe68e('0x57')]['id'];}return db['SquareOdbc'][_0xe68e('0x4d')]({'where':{'id':_0x1f5109['params']['id']}})[_0xe68e('0x25')](handleEntityNotFound(_0x5ac9f1,null))['then'](saveUpdates(_0x1f5109['body'],null))['then'](respondWithResult(_0x5ac9f1,null))[_0xe68e('0x4a')](handleError(_0x5ac9f1,null));};exports['destroy']=function(_0x16cedf,_0x13b837){return db['SquareOdbc'][_0xe68e('0x4d')]({'where':{'id':_0x16cedf[_0xe68e('0x4c')]['id']}})[_0xe68e('0x25')](handleEntityNotFound(_0x13b837,null))[_0xe68e('0x25')](removeEntity(_0x13b837,null))[_0xe68e('0x4a')](handleError(_0x13b837,null));};exports[_0xe68e('0x58')]=function(_0x19cc92,_0x509dde,_0xd5c67){var _0x260e36;return db[_0xe68e('0x2f')][_0xe68e('0x4d')]({'where':{'id':_0x19cc92[_0xe68e('0x4c')]['id']},'attributes':['id','dsn']})[_0xe68e('0x25')](handleEntityNotFound(_0x509dde,null))[_0xe68e('0x25')](function(_0x453abd){if(_0x453abd){var _0x28ae8d=require(_0xe68e('0x59'))();_0x28ae8d[_0xe68e('0x5a')](_0x453abd[_0xe68e('0x5b')]);_0x28ae8d[_0xe68e('0x5c')]();return _0x453abd;}})[_0xe68e('0x25')](respondWithResult(_0x509dde,null))[_0xe68e('0x4a')](handleError(_0x509dde,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 10f2cd6..c46d534 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 _0xb897=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util'];(function(_0x55251a,_0x2aa2eb){var _0x1e3831=function(_0x2fdb1b){while(--_0x2fdb1b){_0x55251a['push'](_0x55251a['shift']());}};_0x1e3831(++_0x2aa2eb);}(_0xb897,0x195));var _0x7b89=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xb897[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x7b89('0x0'));var util=require(_0x7b89('0x1'));var logger=require(_0x7b89('0x2'))('api');var moment=require(_0x7b89('0x3'));var BPromise=require(_0x7b89('0x4'));var rp=require(_0x7b89('0x5'));var fs=require('fs');var path=require(_0x7b89('0x6'));var rimraf=require(_0x7b89('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b89('0x8'));module['exports']=function(_0x150a56,_0x48d154){return _0x150a56['define'](_0x7b89('0x9'),attributes,{'tableName':_0x7b89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6aa=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','SquareOdbc','square_odbc'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xc6aa,0x1f4));var _0xac6a=function(_0x3a856b,_0x5343c1){_0x3a856b=_0x3a856b-0x0;var _0x31692e=_0xc6aa[_0x3a856b];return _0x31692e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xac6a('0x0'))(_0xac6a('0x1'));var moment=require(_0xac6a('0x2'));var BPromise=require(_0xac6a('0x3'));var rp=require(_0xac6a('0x4'));var fs=require('fs');var path=require(_0xac6a('0x5'));var rimraf=require('rimraf');var config=require(_0xac6a('0x6'));var attributes=require('./squareOdbc.attributes');module[_0xac6a('0x7')]=function(_0x3dc0a8,_0x4d8530){return _0x3dc0a8['define'](_0xac6a('0x8'),attributes,{'tableName':_0xac6a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 7c6d0d0..6a7d679 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 _0xbae1=['raw','attributes','include','map','model','debug','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ShowSquareOdbc','SquareOdbc','find','options'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xbae1,0x1b9));var _0x1bae=function(_0x29a986,_0x18d77d){_0x29a986=_0x29a986-0x0;var _0xd4a8a4=_0xbae1[_0x29a986];return _0xd4a8a4;};'use strict';var _=require(_0x1bae('0x0'));var util=require('util');var moment=require(_0x1bae('0x1'));var BPromise=require(_0x1bae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bae('0x3'));var db=require(_0x1bae('0x4'))['db'];var utils=require(_0x1bae('0x5'));var logger=require(_0x1bae('0x6'))(_0x1bae('0x7'));var config=require(_0x1bae('0x8'));var jayson=require(_0x1bae('0x9'));var client=jayson[_0x1bae('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30d3ea,_0x5d1ad5,_0x4fc14a){return new BPromise(function(_0x4763c3,_0x3ed6c8){return client[_0x1bae('0xb')](_0x30d3ea,_0x4fc14a)[_0x1bae('0xc')](function(_0x51e156){logger[_0x1bae('0xd')](_0x1bae('0xe'),_0x5d1ad5,_0x1bae('0xf'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x5d1ad5,_0x1bae('0xf'),JSON[_0x1bae('0x10')](_0x51e156));if(_0x51e156[_0x1bae('0x11')]){if(_0x51e156[_0x1bae('0x11')][_0x1bae('0x12')]===0x1f4){logger['error'](_0x1bae('0xe'),_0x5d1ad5,_0x51e156[_0x1bae('0x11')][_0x1bae('0x13')]);return _0x3ed6c8(_0x51e156[_0x1bae('0x11')][_0x1bae('0x13')]);}logger[_0x1bae('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x5d1ad5,_0x51e156['error']['message']);return _0x4763c3(_0x51e156['error']['message']);}else{logger[_0x1bae('0xd')](_0x1bae('0xe'),_0x5d1ad5,_0x1bae('0xf'));_0x4763c3(_0x51e156['result']['message']);}})['catch'](function(_0x4860d5){logger[_0x1bae('0x11')](_0x1bae('0xe'),_0x5d1ad5,_0x4860d5);_0x3ed6c8(_0x4860d5);});});}exports[_0x1bae('0x14')]=function(_0x16f30e){var _0x49712b=this;return new Promise(function(_0x40329f,_0x1285de){return db[_0x1bae('0x15')][_0x1bae('0x16')]({'raw':_0x16f30e[_0x1bae('0x17')]?_0x16f30e[_0x1bae('0x17')][_0x1bae('0x18')]===undefined?!![]:![]:!![],'where':_0x16f30e[_0x1bae('0x17')]?_0x16f30e[_0x1bae('0x17')]['where']||null:null,'attributes':_0x16f30e[_0x1bae('0x17')]?_0x16f30e[_0x1bae('0x17')][_0x1bae('0x19')]||null:null,'include':_0x16f30e[_0x1bae('0x17')]?_0x16f30e[_0x1bae('0x17')][_0x1bae('0x1a')]?_[_0x1bae('0x1b')](_0x16f30e[_0x1bae('0x17')][_0x1bae('0x1a')],function(_0x518902){return{'model':db[_0x518902['model']],'as':_0x518902['as'],'attributes':_0x518902[_0x1bae('0x19')],'include':_0x518902['include']?_['map'](_0x518902['include'],function(_0x201353){return{'model':db[_0x201353[_0x1bae('0x1c')]],'as':_0x201353['as'],'attributes':_0x201353[_0x1bae('0x19')],'include':_0x201353[_0x1bae('0x1a')]?_[_0x1bae('0x1b')](_0x201353['include'],function(_0x157376){return{'model':db[_0x157376[_0x1bae('0x1c')]],'as':_0x157376['as'],'attributes':_0x157376[_0x1bae('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dac11){logger[_0x1bae('0xd')](_0x1bae('0x14'),_0x16f30e);logger[_0x1bae('0x1d')](_0x1bae('0x14'),_0x16f30e,JSON[_0x1bae('0x10')](_0x3dac11));_0x40329f(_0x3dac11);})[_0x1bae('0x1e')](function(_0x5c9ee9){logger[_0x1bae('0x11')](_0x1bae('0x14'),_0x5c9ee9[_0x1bae('0x13')],_0x16f30e);_0x1285de(_0x49712b[_0x1bae('0x11')](0x1f4,_0x5c9ee9[_0x1bae('0x13')]));});});}; \ No newline at end of file +var _0x287c=['request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','SquareOdbc','find','options','where','attributes','include','model','map','ShowSquareOdbc','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x287c,0x1d2));var _0xc287=function(_0x26bec6,_0x20d092){_0x26bec6=_0x26bec6-0x0;var _0x152140=_0x287c[_0x26bec6];return _0x152140;};'use strict';var _=require(_0xc287('0x0'));var util=require(_0xc287('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc287('0x2'));var fs=require('fs');var Redis=require(_0xc287('0x3'));var db=require(_0xc287('0x4'))['db'];var utils=require(_0xc287('0x5'));var logger=require('../../config/logger')(_0xc287('0x6'));var config=require('../../config/environment');var jayson=require(_0xc287('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49061d,_0x1c8c6c,_0x4027d8){return new BPromise(function(_0x53c41d,_0x123a51){return client['request'](_0x49061d,_0x4027d8)[_0xc287('0x8')](function(_0x485a96){logger[_0xc287('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x1c8c6c,_0xc287('0xa'));logger['debug'](_0xc287('0xb'),_0x1c8c6c,_0xc287('0xa'),JSON[_0xc287('0xc')](_0x485a96));if(_0x485a96['error']){if(_0x485a96[_0xc287('0xd')][_0xc287('0xe')]===0x1f4){logger[_0xc287('0xd')](_0xc287('0xf'),_0x1c8c6c,_0x485a96[_0xc287('0xd')]['message']);return _0x123a51(_0x485a96[_0xc287('0xd')][_0xc287('0x10')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x1c8c6c,_0x485a96['error'][_0xc287('0x10')]);return _0x53c41d(_0x485a96['error']['message']);}else{logger[_0xc287('0x9')](_0xc287('0xf'),_0x1c8c6c,'request\x20sent');_0x53c41d(_0x485a96[_0xc287('0x11')]['message']);}})['catch'](function(_0x56ae7b){logger['error'](_0xc287('0xf'),_0x1c8c6c,_0x56ae7b);_0x123a51(_0x56ae7b);});});}exports['ShowSquareOdbc']=function(_0x29e641){var _0x2f2263=this;return new Promise(function(_0x1a0a0a,_0x296a3c){return db[_0xc287('0x12')][_0xc287('0x13')]({'raw':_0x29e641['options']?_0x29e641['options']['raw']===undefined?!![]:![]:!![],'where':_0x29e641[_0xc287('0x14')]?_0x29e641[_0xc287('0x14')][_0xc287('0x15')]||null:null,'attributes':_0x29e641[_0xc287('0x14')]?_0x29e641[_0xc287('0x14')][_0xc287('0x16')]||null:null,'include':_0x29e641['options']?_0x29e641[_0xc287('0x14')]['include']?_['map'](_0x29e641[_0xc287('0x14')][_0xc287('0x17')],function(_0x5772f4){return{'model':db[_0x5772f4[_0xc287('0x18')]],'as':_0x5772f4['as'],'attributes':_0x5772f4['attributes'],'include':_0x5772f4[_0xc287('0x17')]?_[_0xc287('0x19')](_0x5772f4[_0xc287('0x17')],function(_0x4ccf47){return{'model':db[_0x4ccf47[_0xc287('0x18')]],'as':_0x4ccf47['as'],'attributes':_0x4ccf47['attributes'],'include':_0x4ccf47[_0xc287('0x17')]?_['map'](_0x4ccf47[_0xc287('0x17')],function(_0x55e191){return{'model':db[_0x55e191['model']],'as':_0x55e191['as'],'attributes':_0x55e191[_0xc287('0x16')]};}):[]};}):[]};}):[]:[]})[_0xc287('0x8')](function(_0x5e9a93){logger[_0xc287('0x9')](_0xc287('0x1a'),_0x29e641);logger[_0xc287('0x1b')]('ShowSquareOdbc',_0x29e641,JSON[_0xc287('0xc')](_0x5e9a93));_0x1a0a0a(_0x5e9a93);})['catch'](function(_0x377aa0){logger[_0xc287('0xd')]('ShowSquareOdbc',_0x377aa0[_0xc287('0x10')],_0x29e641);_0x296a3c(_0x2f2263[_0xc287('0xd')](0x1f4,_0x377aa0[_0xc287('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 34cb9a6..8deff7a 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 _0x7cb5=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','update','delete'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x7cb5,0x12e));var _0x57cb=function(_0x7a04c8,_0x455129){_0x7a04c8=_0x7a04c8-0x0;var _0x2dfe0f=_0x7cb5[_0x7a04c8];return _0x2dfe0f;};'use strict';var multer=require('multer');var util=require(_0x57cb('0x0'));var path=require(_0x57cb('0x1'));var timeout=require(_0x57cb('0x2'));var express=require(_0x57cb('0x3'));var router=express[_0x57cb('0x4')]();var fs_extra=require(_0x57cb('0x5'));var auth=require(_0x57cb('0x6'));var interaction=require(_0x57cb('0x7'));var config=require(_0x57cb('0x8'));var controller=require(_0x57cb('0x9'));router[_0x57cb('0xa')]('/',auth[_0x57cb('0xb')](),controller[_0x57cb('0xc')]);router['get'](_0x57cb('0xd'),auth[_0x57cb('0xb')](),controller[_0x57cb('0xe')]);router[_0x57cb('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x57cb('0xd'),auth[_0x57cb('0xb')](),controller[_0x57cb('0x10')]);router[_0x57cb('0x11')](_0x57cb('0xd'),auth[_0x57cb('0xb')](),controller[_0x57cb('0x12')]);module[_0x57cb('0x13')]=router; \ No newline at end of file +var _0x082f=['isAuthenticated','show','post','create','put','/:id','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x112038,_0x5cc1cf){var _0x5413ae=function(_0x2d1d55){while(--_0x2d1d55){_0x112038['push'](_0x112038['shift']());}};_0x5413ae(++_0x5cc1cf);}(_0x082f,0x17e));var _0xf082=function(_0xe52657,_0x374354){_0xe52657=_0xe52657-0x0;var _0x4f14ea=_0x082f[_0xe52657];return _0x4f14ea;};'use strict';var multer=require('multer');var util=require(_0xf082('0x0'));var path=require('path');var timeout=require(_0xf082('0x1'));var express=require(_0xf082('0x2'));var router=express['Router']();var fs_extra=require(_0xf082('0x3'));var auth=require(_0xf082('0x4'));var interaction=require(_0xf082('0x5'));var config=require(_0xf082('0x6'));var controller=require(_0xf082('0x7'));router[_0xf082('0x8')]('/',auth[_0xf082('0x9')](),controller['index']);router[_0xf082('0x8')]('/:id',auth[_0xf082('0x9')](),controller[_0xf082('0xa')]);router[_0xf082('0xb')]('/',auth[_0xf082('0x9')](),controller[_0xf082('0xc')]);router[_0xf082('0xd')]('/:id',auth[_0xf082('0x9')](),controller['update']);router['delete'](_0xf082('0xe'),auth[_0xf082('0x9')](),controller[_0xf082('0xf')]);module[_0xf082('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9421530..53604ad 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 _0xcd15=['exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x1876c7,_0x379202){var _0x2b9572=function(_0x9bf2ff){while(--_0x9bf2ff){_0x1876c7['push'](_0x1876c7['shift']());}};_0x2b9572(++_0x379202);}(_0xcd15,0xf6));var _0x5cd1=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0xcd15[_0x1ff2ec];return _0x405683;};'use strict';var Sequelize=require(_0x5cd1('0x0'));module[_0x5cd1('0x1')]={'name':{'type':Sequelize[_0x5cd1('0x2')],'unique':_0x5cd1('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5cd1('0x2')]},'notes':{'type':Sequelize[_0x5cd1('0x4')]},'preproduction':{'type':Sequelize[_0x5cd1('0x5')](_0x5cd1('0x6')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x5cd1('0x7')](_0x5cd1('0x8'))[_0x5cd1('0x9')](_0x5cd1('0xa'));}}},'production':{'type':Sequelize[_0x5cd1('0x5')](_0x5cd1('0x6')),'get':function(){if(this[_0x5cd1('0x7')](_0x5cd1('0xb'))){return this[_0x5cd1('0x7')](_0x5cd1('0xb'))['toString'](_0x5cd1('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x5cd1('0xc')]}}; \ No newline at end of file +var _0x83ff=['BLOB','production','DATE','sequelize','exports','STRING','long','getDataValue','preproduction','toString','utf8'];(function(_0x2561eb,_0x329fb1){var _0x3f2463=function(_0x362443){while(--_0x362443){_0x2561eb['push'](_0x2561eb['shift']());}};_0x3f2463(++_0x329fb1);}(_0x83ff,0x7c));var _0xf83f=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x83ff[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xf83f('0x0'));module[_0xf83f('0x1')]={'name':{'type':Sequelize[_0xf83f('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0xf83f('0x3')),'get':function(){if(this[_0xf83f('0x4')]('preproduction')){return this[_0xf83f('0x4')](_0xf83f('0x5'))[_0xf83f('0x6')](_0xf83f('0x7'));}}},'production':{'type':Sequelize[_0xf83f('0x8')]('long'),'get':function(){if(this[_0xf83f('0x4')]('production')){return this['getDataValue'](_0xf83f('0x9'))[_0xf83f('0x6')](_0xf83f('0x7'));}}},'savedAt':{'type':Sequelize[_0xf83f('0xa')]},'publishedAt':{'type':Sequelize[_0xf83f('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 8644a15..3fd29a3 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 _0x1e22=['filters','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','publish','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','agi','end','sendStatus','error','stack','name','send','index','map','SquareProject','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1c7a3a,_0x8e73d0){var _0x3eeec7=function(_0x176ad9){while(--_0x176ad9){_0x1c7a3a['push'](_0x1c7a3a['shift']());}};_0x3eeec7(++_0x8e73d0);}(_0x1e22,0x13d));var _0x21e2=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0x1e22[_0x55e839];return _0x39c61a;};'use strict';var _=require(_0x21e2('0x0'));var Redis=require(_0x21e2('0x1'));var qs=require(_0x21e2('0x2'));var logger=require(_0x21e2('0x3'))(_0x21e2('0x4'));var config=require(_0x21e2('0x5'));var db=require(_0x21e2('0x6'))['db'];config['redis']=_[_0x21e2('0x7')](config[_0x21e2('0x8')],{'host':_0x21e2('0x9'),'port':0x18eb});var socket=require(_0x21e2('0xa'))(new Redis(config['redis']));require(_0x21e2('0xb'))[_0x21e2('0xc')](socket);function respondWithResult(_0x2bf24b,_0x2f5272){_0x2f5272=_0x2f5272||0xc8;return function(_0x5128d9){if(_0x5128d9){return _0x2bf24b[_0x21e2('0xd')](_0x2f5272)[_0x21e2('0xe')](_0x5128d9);}};}function respondWithFilteredResult(_0x1f2156,_0x3a6533){return function(_0x517701){if(_0x517701){var _0x1b6b1f=typeof _0x3a6533[_0x21e2('0xf')]===_0x21e2('0x10')&&typeof _0x3a6533[_0x21e2('0x11')]===_0x21e2('0x10');var _0x26dd0f=_0x517701[_0x21e2('0x12')];var _0xcf60d2=_0x1b6b1f?0x0:_0x3a6533[_0x21e2('0xf')];var _0x14f743=_0x1b6b1f?_0x517701['count']:_0x3a6533['offset']+_0x3a6533['limit'];var _0x55483f;if(_0x14f743>=_0x26dd0f){_0x14f743=_0x26dd0f;_0x55483f=0xc8;}else{_0x55483f=0xce;}_0x1f2156[_0x21e2('0xd')](_0x55483f);return _0x1f2156[_0x21e2('0x13')](_0x21e2('0x14'),_0xcf60d2+'-'+_0x14f743+'/'+_0x26dd0f)['json'](_0x517701);}return null;};}function saveUpdates(_0x530bd1){return function(_0x18973f){if(_0x18973f){return _0x18973f[_0x21e2('0x15')](_0x530bd1)[_0x21e2('0x16')](function(_0x17cd1f){return _0x17cd1f;});}return null;};}function removeEntity(_0xe573de){return function(_0x538fad){if(_0x538fad){return _0x538fad[_0x21e2('0x17')]()[_0x21e2('0x16')](function(){var _0xc32730=_0x538fad[_0x21e2('0x18')]({'plain':!![]});var _0x41c8e4='SquareProjects';return db[_0x21e2('0x19')]['destroy']({'where':{'type':_0x41c8e4,'resourceId':_0xc32730['id']}})['then'](function(){return _0x538fad;});})[_0x21e2('0x16')](function(){var _0x4213a9=new Redis(config['redis']);_0x4213a9['publish'](_0x21e2('0x1a'),JSON['stringify']({'id':_0x538fad['id'],'deleted':!![]}));})[_0x21e2('0x16')](function(){_0xe573de['status'](0xcc)[_0x21e2('0x1b')]();});}};}function handleEntityNotFound(_0x24ea74){return function(_0x5e5d20){if(!_0x5e5d20){_0x24ea74[_0x21e2('0x1c')](0x194);}return _0x5e5d20;};}function handleError(_0x462cef,_0x2d9856){_0x2d9856=_0x2d9856||0x1f4;return function(_0x3a0036){logger[_0x21e2('0x1d')](_0x3a0036[_0x21e2('0x1e')]);if(_0x3a0036[_0x21e2('0x1f')]){delete _0x3a0036[_0x21e2('0x1f')];}_0x462cef['status'](_0x2d9856)[_0x21e2('0x20')](_0x3a0036);};}exports[_0x21e2('0x21')]=function(_0x13786a,_0x1cb915){var _0xeeecb9={},_0xfe9b76={},_0x1225f2={'count':0x0,'rows':[]};var _0x300980=_[_0x21e2('0x22')](db[_0x21e2('0x23')]['rawAttributes'],function(_0x45680c){return{'name':_0x45680c['fieldName'],'type':_0x45680c[_0x21e2('0x24')]['key']};});_0xfe9b76[_0x21e2('0x25')]=_[_0x21e2('0x22')](_0x300980,'name');_0xfe9b76[_0x21e2('0x26')]=_[_0x21e2('0x27')](_0x13786a[_0x21e2('0x26')]);_0xfe9b76['filters']=_[_0x21e2('0x28')](_0xfe9b76[_0x21e2('0x25')],_0xfe9b76[_0x21e2('0x26')]);_0xeeecb9['attributes']=_[_0x21e2('0x28')](_0xfe9b76[_0x21e2('0x25')],qs[_0x21e2('0x29')](_0x13786a[_0x21e2('0x26')][_0x21e2('0x29')]));_0xeeecb9[_0x21e2('0x2a')]=_0xeeecb9[_0x21e2('0x2a')][_0x21e2('0x2b')]?_0xeeecb9[_0x21e2('0x2a')]:_0xfe9b76[_0x21e2('0x25')];if(!_0x13786a[_0x21e2('0x26')][_0x21e2('0x2c')](_0x21e2('0x2d'))){_0xeeecb9[_0x21e2('0x11')]=qs['limit'](_0x13786a[_0x21e2('0x26')]['limit']);_0xeeecb9['offset']=qs[_0x21e2('0xf')](_0x13786a['query'][_0x21e2('0xf')]);}_0xeeecb9[_0x21e2('0x2e')]=qs[_0x21e2('0x2f')](_0x13786a[_0x21e2('0x26')][_0x21e2('0x2f')]);_0xeeecb9['where']=qs['filters'](_['pick'](_0x13786a['query'],_0xfe9b76[_0x21e2('0x30')]),_0x300980);if(_0x13786a[_0x21e2('0x26')][_0x21e2('0x31')]){_0xeeecb9[_0x21e2('0x32')]=_[_0x21e2('0x33')](_0xeeecb9['where'],{'$or':_[_0x21e2('0x22')](_0x300980,function(_0xdef74e){if(_0xdef74e[_0x21e2('0x24')]!=='VIRTUAL'){var _0x55fcb3={};_0x55fcb3[_0xdef74e['name']]={'$like':'%'+_0x13786a[_0x21e2('0x26')][_0x21e2('0x31')]+'%'};return _0x55fcb3;}})});}_0xeeecb9=_[_0x21e2('0x33')]({},_0xeeecb9,_0x13786a['options']);var _0x2289ed={'where':_0xeeecb9[_0x21e2('0x32')]};return db[_0x21e2('0x23')][_0x21e2('0x12')](_0x2289ed)[_0x21e2('0x16')](function(_0x8410be){_0x1225f2[_0x21e2('0x12')]=_0x8410be;if(_0x13786a['query'][_0x21e2('0x34')]){_0xeeecb9[_0x21e2('0x35')]=[{'all':!![]}];}return db[_0x21e2('0x23')][_0x21e2('0x36')](_0xeeecb9);})[_0x21e2('0x16')](function(_0x5ab62f){_0x1225f2[_0x21e2('0x37')]=_0x5ab62f;return _0x1225f2;})[_0x21e2('0x16')](respondWithFilteredResult(_0x1cb915,_0xeeecb9))[_0x21e2('0x38')](handleError(_0x1cb915,null));};exports[_0x21e2('0x39')]=function(_0x1a4b84,_0x40f418){var _0x57dff1={'raw':![],'where':{'id':_0x1a4b84[_0x21e2('0x3a')]['id']}},_0x3c7842={};_0x3c7842[_0x21e2('0x25')]=_[_0x21e2('0x27')](db[_0x21e2('0x23')]['rawAttributes']);_0x3c7842[_0x21e2('0x26')]=_[_0x21e2('0x27')](_0x1a4b84['query']);_0x3c7842[_0x21e2('0x30')]=_[_0x21e2('0x28')](_0x3c7842[_0x21e2('0x25')],_0x3c7842[_0x21e2('0x26')]);_0x57dff1['attributes']=_[_0x21e2('0x28')](_0x3c7842[_0x21e2('0x25')],qs['fields'](_0x1a4b84[_0x21e2('0x26')][_0x21e2('0x29')]));_0x57dff1['attributes']=_0x57dff1[_0x21e2('0x2a')][_0x21e2('0x2b')]?_0x57dff1[_0x21e2('0x2a')]:_0x3c7842[_0x21e2('0x25')];if(_0x1a4b84[_0x21e2('0x26')][_0x21e2('0x34')]){_0x57dff1[_0x21e2('0x35')]=[{'all':!![]}];}_0x57dff1=_[_0x21e2('0x33')]({},_0x57dff1,_0x1a4b84[_0x21e2('0x3b')]);return db[_0x21e2('0x23')][_0x21e2('0x3c')](_0x57dff1)[_0x21e2('0x16')](handleEntityNotFound(_0x40f418,null))['then'](respondWithResult(_0x40f418,null))[_0x21e2('0x38')](handleError(_0x40f418,null));};exports[_0x21e2('0x3d')]=function(_0x1686b5,_0x25ad96){return db['SquareProject'][_0x21e2('0x3d')](_0x1686b5['body'],{})[_0x21e2('0x16')](function(_0x29eb02){var _0x15e5a4=_0x1686b5[_0x21e2('0x3e')][_0x21e2('0x18')]({'plain':!![]});if(!_0x15e5a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15e5a4[_0x21e2('0x3f')]===_0x21e2('0x3e')){var _0x26d88d=_0x29eb02['get']({'plain':!![]});var _0x3d66e7=_0x21e2('0x40');return db[_0x21e2('0x41')][_0x21e2('0x3c')]({'where':{'name':_0x3d66e7,'userProfileId':_0x15e5a4[_0x21e2('0x42')]},'raw':!![]})[_0x21e2('0x16')](function(_0x287848){if(_0x287848&&_0x287848[_0x21e2('0x43')]===0x0){return db[_0x21e2('0x19')][_0x21e2('0x3d')]({'name':_0x26d88d[_0x21e2('0x1f')],'resourceId':_0x26d88d['id'],'type':_0x287848[_0x21e2('0x1f')],'sectionId':_0x287848['id']},{})[_0x21e2('0x16')](function(){return _0x29eb02;});}else{return _0x29eb02;}})[_0x21e2('0x38')](function(_0x38cf34){logger[_0x21e2('0x1d')](_0x21e2('0x44'),_0x38cf34);throw _0x38cf34;});}return _0x29eb02;})[_0x21e2('0x16')](respondWithResult(_0x25ad96,0xc9))[_0x21e2('0x38')](handleError(_0x25ad96,null));};exports[_0x21e2('0x15')]=function(_0x5caf0e,_0x4dea48){if(_0x5caf0e[_0x21e2('0x45')]['id']){delete _0x5caf0e[_0x21e2('0x45')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x5caf0e[_0x21e2('0x3a')]['id']}})[_0x21e2('0x16')](handleEntityNotFound(_0x4dea48,null))[_0x21e2('0x16')](saveUpdates(_0x5caf0e[_0x21e2('0x45')],null))[_0x21e2('0x16')](function(_0x25e065){if(!_0x25e065)return;var _0xd7f5d3=_0x25e065[_0x21e2('0x18')]({'plain':!![]});return _0xd7f5d3;})[_0x21e2('0x16')](function(_0x42b918){var _0x31871e=new Redis(config[_0x21e2('0x8')]);_0x31871e[_0x21e2('0x46')](_0x21e2('0x1a'),JSON[_0x21e2('0x47')](_['pick'](_0x42b918,['id','name',_0x21e2('0x48')])));return _0x42b918;})['then'](respondWithResult(_0x4dea48,null))[_0x21e2('0x38')](handleError(_0x4dea48,null));};exports[_0x21e2('0x17')]=function(_0xf438d3,_0x43aca3){return db['SquareProject'][_0x21e2('0x3c')]({'where':{'id':_0xf438d3[_0x21e2('0x3a')]['id']}})[_0x21e2('0x16')](handleEntityNotFound(_0x43aca3,null))['then'](removeEntity(_0x43aca3,null))['catch'](handleError(_0x43aca3,null));}; \ No newline at end of file +var _0xab4e=['sort','where','pick','filter','merge','type','VIRTUAL','SquareProject','include','rows','catch','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','stringify','production','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','localhost','redis','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','get','SquareProjects','UserProfileResource','destroy','then','publish','agi','end','sendStatus','send','rawAttributes','fieldName','key','model','map','name','keys','query','filters','intersection','attributes','fields','nolimit','order'];(function(_0x1b15f5,_0xeb25e7){var _0x63f8f6=function(_0x4e0fab){while(--_0x4e0fab){_0x1b15f5['push'](_0x1b15f5['shift']());}};_0x63f8f6(++_0xeb25e7);}(_0xab4e,0x1ef));var _0xeab4=function(_0x28d09d,_0x17d668){_0x28d09d=_0x28d09d-0x0;var _0x336674=_0xab4e[_0x28d09d];return _0x336674;};'use strict';var _=require('lodash');var Redis=require(_0xeab4('0x0'));var qs=require(_0xeab4('0x1'));var logger=require(_0xeab4('0x2'))('api');var config=require(_0xeab4('0x3'));var db=require(_0xeab4('0x4'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xeab4('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeab4('0x6')]));require(_0xeab4('0x7'))[_0xeab4('0x8')](socket);function respondWithResult(_0x2360d6,_0x2f696c){_0x2f696c=_0x2f696c||0xc8;return function(_0x45a25e){if(_0x45a25e){return _0x2360d6[_0xeab4('0x9')](_0x2f696c)[_0xeab4('0xa')](_0x45a25e);}};}function respondWithFilteredResult(_0x4e45b5,_0x3f1e5a){return function(_0x1a7104){if(_0x1a7104){var _0x404d92=typeof _0x3f1e5a[_0xeab4('0xb')]===_0xeab4('0xc')&&typeof _0x3f1e5a[_0xeab4('0xd')]==='undefined';var _0x13f93b=_0x1a7104[_0xeab4('0xe')];var _0x4a4868=_0x404d92?0x0:_0x3f1e5a[_0xeab4('0xb')];var _0x4633e4=_0x404d92?_0x1a7104[_0xeab4('0xe')]:_0x3f1e5a[_0xeab4('0xb')]+_0x3f1e5a['limit'];var _0xdec4e9;if(_0x4633e4>=_0x13f93b){_0x4633e4=_0x13f93b;_0xdec4e9=0xc8;}else{_0xdec4e9=0xce;}_0x4e45b5[_0xeab4('0x9')](_0xdec4e9);return _0x4e45b5[_0xeab4('0xf')](_0xeab4('0x10'),_0x4a4868+'-'+_0x4633e4+'/'+_0x13f93b)[_0xeab4('0xa')](_0x1a7104);}return null;};}function saveUpdates(_0x256ef7){return function(_0x202363){if(_0x202363){return _0x202363['update'](_0x256ef7)['then'](function(_0x5a6ba9){return _0x5a6ba9;});}return null;};}function removeEntity(_0x1c75c7){return function(_0x371765){if(_0x371765){return _0x371765['destroy']()['then'](function(){var _0xe65a93=_0x371765[_0xeab4('0x11')]({'plain':!![]});var _0x44a2bf=_0xeab4('0x12');return db[_0xeab4('0x13')][_0xeab4('0x14')]({'where':{'type':_0x44a2bf,'resourceId':_0xe65a93['id']}})[_0xeab4('0x15')](function(){return _0x371765;});})[_0xeab4('0x15')](function(){var _0x3a6f7a=new Redis(config['redis']);_0x3a6f7a[_0xeab4('0x16')](_0xeab4('0x17'),JSON['stringify']({'id':_0x371765['id'],'deleted':!![]}));})['then'](function(){_0x1c75c7[_0xeab4('0x9')](0xcc)[_0xeab4('0x18')]();});}};}function handleEntityNotFound(_0x36d07e){return function(_0x36fc35){if(!_0x36fc35){_0x36d07e[_0xeab4('0x19')](0x194);}return _0x36fc35;};}function handleError(_0x38762f,_0x27b0cf){_0x27b0cf=_0x27b0cf||0x1f4;return function(_0x5d7dd5){logger['error'](_0x5d7dd5['stack']);if(_0x5d7dd5['name']){delete _0x5d7dd5['name'];}_0x38762f[_0xeab4('0x9')](_0x27b0cf)[_0xeab4('0x1a')](_0x5d7dd5);};}exports['index']=function(_0x5aef45,_0x145fac){var _0x4337d7={},_0x2ffbe4={},_0x24c75a={'count':0x0,'rows':[]};var _0x5377ae=_['map'](db['SquareProject'][_0xeab4('0x1b')],function(_0x2af0c6){return{'name':_0x2af0c6[_0xeab4('0x1c')],'type':_0x2af0c6['type'][_0xeab4('0x1d')]};});_0x2ffbe4[_0xeab4('0x1e')]=_[_0xeab4('0x1f')](_0x5377ae,_0xeab4('0x20'));_0x2ffbe4['query']=_[_0xeab4('0x21')](_0x5aef45[_0xeab4('0x22')]);_0x2ffbe4[_0xeab4('0x23')]=_[_0xeab4('0x24')](_0x2ffbe4['model'],_0x2ffbe4[_0xeab4('0x22')]);_0x4337d7[_0xeab4('0x25')]=_[_0xeab4('0x24')](_0x2ffbe4['model'],qs[_0xeab4('0x26')](_0x5aef45['query']['fields']));_0x4337d7['attributes']=_0x4337d7[_0xeab4('0x25')]['length']?_0x4337d7[_0xeab4('0x25')]:_0x2ffbe4[_0xeab4('0x1e')];if(!_0x5aef45[_0xeab4('0x22')]['hasOwnProperty'](_0xeab4('0x27'))){_0x4337d7[_0xeab4('0xd')]=qs['limit'](_0x5aef45[_0xeab4('0x22')]['limit']);_0x4337d7[_0xeab4('0xb')]=qs[_0xeab4('0xb')](_0x5aef45['query'][_0xeab4('0xb')]);}_0x4337d7[_0xeab4('0x28')]=qs[_0xeab4('0x29')](_0x5aef45['query'][_0xeab4('0x29')]);_0x4337d7[_0xeab4('0x2a')]=qs['filters'](_[_0xeab4('0x2b')](_0x5aef45['query'],_0x2ffbe4['filters']),_0x5377ae);if(_0x5aef45[_0xeab4('0x22')][_0xeab4('0x2c')]){_0x4337d7['where']=_[_0xeab4('0x2d')](_0x4337d7[_0xeab4('0x2a')],{'$or':_[_0xeab4('0x1f')](_0x5377ae,function(_0x3ffc1a){if(_0x3ffc1a[_0xeab4('0x2e')]!==_0xeab4('0x2f')){var _0x1fc513={};_0x1fc513[_0x3ffc1a[_0xeab4('0x20')]]={'$like':'%'+_0x5aef45['query'][_0xeab4('0x2c')]+'%'};return _0x1fc513;}})});}_0x4337d7=_[_0xeab4('0x2d')]({},_0x4337d7,_0x5aef45['options']);var _0x46b5ba={'where':_0x4337d7[_0xeab4('0x2a')]};return db[_0xeab4('0x30')][_0xeab4('0xe')](_0x46b5ba)[_0xeab4('0x15')](function(_0x39ec39){_0x24c75a[_0xeab4('0xe')]=_0x39ec39;if(_0x5aef45['query']['includeAll']){_0x4337d7[_0xeab4('0x31')]=[{'all':!![]}];}return db[_0xeab4('0x30')]['findAll'](_0x4337d7);})[_0xeab4('0x15')](function(_0x460a2d){_0x24c75a[_0xeab4('0x32')]=_0x460a2d;return _0x24c75a;})[_0xeab4('0x15')](respondWithFilteredResult(_0x145fac,_0x4337d7))[_0xeab4('0x33')](handleError(_0x145fac,null));};exports['show']=function(_0x4dace3,_0x1b01c2){var _0x4f2e78={'raw':![],'where':{'id':_0x4dace3['params']['id']}},_0x37de97={};_0x37de97[_0xeab4('0x1e')]=_[_0xeab4('0x21')](db[_0xeab4('0x30')][_0xeab4('0x1b')]);_0x37de97[_0xeab4('0x22')]=_['keys'](_0x4dace3['query']);_0x37de97[_0xeab4('0x23')]=_[_0xeab4('0x24')](_0x37de97[_0xeab4('0x1e')],_0x37de97['query']);_0x4f2e78[_0xeab4('0x25')]=_[_0xeab4('0x24')](_0x37de97[_0xeab4('0x1e')],qs[_0xeab4('0x26')](_0x4dace3[_0xeab4('0x22')]['fields']));_0x4f2e78[_0xeab4('0x25')]=_0x4f2e78['attributes'][_0xeab4('0x34')]?_0x4f2e78['attributes']:_0x37de97['model'];if(_0x4dace3[_0xeab4('0x22')]['includeAll']){_0x4f2e78[_0xeab4('0x31')]=[{'all':!![]}];}_0x4f2e78=_[_0xeab4('0x2d')]({},_0x4f2e78,_0x4dace3[_0xeab4('0x35')]);return db[_0xeab4('0x30')][_0xeab4('0x36')](_0x4f2e78)[_0xeab4('0x15')](handleEntityNotFound(_0x1b01c2,null))[_0xeab4('0x15')](respondWithResult(_0x1b01c2,null))['catch'](handleError(_0x1b01c2,null));};exports[_0xeab4('0x37')]=function(_0x568422,_0x15c6bc){return db[_0xeab4('0x30')][_0xeab4('0x37')](_0x568422[_0xeab4('0x38')],{})['then'](function(_0x3d1ea9){var _0x2d09af=_0x568422[_0xeab4('0x39')][_0xeab4('0x11')]({'plain':!![]});if(!_0x2d09af)throw new Error(_0xeab4('0x3a'));if(_0x2d09af['role']===_0xeab4('0x39')){var _0x436230=_0x3d1ea9[_0xeab4('0x11')]({'plain':!![]});var _0x144225=_0xeab4('0x12');return db[_0xeab4('0x3b')][_0xeab4('0x36')]({'where':{'name':_0x144225,'userProfileId':_0x2d09af[_0xeab4('0x3c')]},'raw':!![]})[_0xeab4('0x15')](function(_0x4871ce){if(_0x4871ce&&_0x4871ce['autoAssociation']===0x0){return db[_0xeab4('0x13')][_0xeab4('0x37')]({'name':_0x436230[_0xeab4('0x20')],'resourceId':_0x436230['id'],'type':_0x4871ce[_0xeab4('0x20')],'sectionId':_0x4871ce['id']},{})[_0xeab4('0x15')](function(){return _0x3d1ea9;});}else{return _0x3d1ea9;}})[_0xeab4('0x33')](function(_0x37efba){logger[_0xeab4('0x3d')](_0xeab4('0x3e'),_0x37efba);throw _0x37efba;});}return _0x3d1ea9;})[_0xeab4('0x15')](respondWithResult(_0x15c6bc,0xc9))[_0xeab4('0x33')](handleError(_0x15c6bc,null));};exports[_0xeab4('0x3f')]=function(_0x5e1446,_0x42e529){if(_0x5e1446[_0xeab4('0x38')]['id']){delete _0x5e1446[_0xeab4('0x38')]['id'];}return db['SquareProject'][_0xeab4('0x36')]({'where':{'id':_0x5e1446[_0xeab4('0x40')]['id']}})[_0xeab4('0x15')](handleEntityNotFound(_0x42e529,null))[_0xeab4('0x15')](saveUpdates(_0x5e1446[_0xeab4('0x38')],null))[_0xeab4('0x15')](function(_0x10c210){if(!_0x10c210)return;var _0x5b4293=_0x10c210[_0xeab4('0x11')]({'plain':!![]});return _0x5b4293;})[_0xeab4('0x15')](function(_0x3d7358){var _0xac156d=new Redis(config[_0xeab4('0x6')]);_0xac156d[_0xeab4('0x16')](_0xeab4('0x17'),JSON[_0xeab4('0x41')](_[_0xeab4('0x2b')](_0x3d7358,['id','name',_0xeab4('0x42')])));return _0x3d7358;})[_0xeab4('0x15')](respondWithResult(_0x42e529,null))[_0xeab4('0x33')](handleError(_0x42e529,null));};exports[_0xeab4('0x14')]=function(_0x19d21b,_0x4028db){return db[_0xeab4('0x30')][_0xeab4('0x36')]({'where':{'id':_0x19d21b['params']['id']}})[_0xeab4('0x15')](handleEntityNotFound(_0x4028db,null))[_0xeab4('0x15')](removeEntity(_0x4028db,null))[_0xeab4('0x33')](handleError(_0x4028db,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 0d25829..0284374 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 _0x9f17=['../../mysqldb','SquareProject','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9f17,0x18b));var _0x79f1=function(_0x155fa7,_0x282870){_0x155fa7=_0x155fa7-0x0;var _0x4a73c9=_0x9f17[_0x155fa7];return _0x4a73c9;};'use strict';var EventEmitter=require(_0x79f1('0x0'));var SquareProject=require(_0x79f1('0x1'))['db'][_0x79f1('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x79f1('0x3')](0x0);var events={'afterCreate':_0x79f1('0x4'),'afterUpdate':'update','afterDestroy':_0x79f1('0x5')};function emitEvent(_0x1fddb2){return function(_0x3583f8,_0x42447f,_0x1896a5){SquareProjectEvents['emit'](_0x1fddb2+':'+_0x3583f8['id'],_0x3583f8);SquareProjectEvents[_0x79f1('0x6')](_0x1fddb2,_0x3583f8);_0x1896a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x79f1('0x7')](e,emitEvent(event));}}module[_0x79f1('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xb63b=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x43daa3,_0x1d286d){var _0x3f3c8f=function(_0x481ea8){while(--_0x481ea8){_0x43daa3['push'](_0x43daa3['shift']());}};_0x3f3c8f(++_0x1d286d);}(_0xb63b,0x1bf));var _0xbb63=function(_0x43381d,_0x46eeb2){_0x43381d=_0x43381d-0x0;var _0x25690e=_0xb63b[_0x43381d];return _0x25690e;};'use strict';var EventEmitter=require(_0xbb63('0x0'));var SquareProject=require(_0xbb63('0x1'))['db'][_0xbb63('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbb63('0x3')](0x0);var events={'afterCreate':_0xbb63('0x4'),'afterUpdate':_0xbb63('0x5'),'afterDestroy':_0xbb63('0x6')};function emitEvent(_0xe2d320){return function(_0x565d21,_0x491a45,_0x23583e){SquareProjectEvents[_0xbb63('0x7')](_0xe2d320+':'+_0x565d21['id'],_0x565d21);SquareProjectEvents[_0xbb63('0x7')](_0xe2d320,_0x565d21);_0x23583e(null);};}for(var e in events){if(events[_0xbb63('0x8')](e)){var event=events[e];SquareProject[_0xbb63('0x9')](e,emitEvent(event));}}module[_0xbb63('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 3c1d7d7..dbe01b8 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 _0x3b24=['define','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./squareProject.attributes','exports'];(function(_0x587b09,_0x35ab4b){var _0x5b0f9b=function(_0x9d27b5){while(--_0x9d27b5){_0x587b09['push'](_0x587b09['shift']());}};_0x5b0f9b(++_0x35ab4b);}(_0x3b24,0xed));var _0x43b2=function(_0x545026,_0x22d9c5){_0x545026=_0x545026-0x0;var _0x1220e0=_0x3b24[_0x545026];return _0x1220e0;};'use strict';var _=require(_0x43b2('0x0'));var util=require(_0x43b2('0x1'));var logger=require(_0x43b2('0x2'))(_0x43b2('0x3'));var moment=require(_0x43b2('0x4'));var BPromise=require('bluebird');var rp=require(_0x43b2('0x5'));var fs=require('fs');var path=require(_0x43b2('0x6'));var rimraf=require(_0x43b2('0x7'));var config=require('../../config/environment');var attributes=require(_0x43b2('0x8'));module[_0x43b2('0x9')]=function(_0x4b1840,_0x4fb131){return _0x4b1840[_0x43b2('0xa')](_0x43b2('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d652c,_0x2a6c14,_0x5709d8){if(_0x2d652c[_0x43b2('0xc')](_0x43b2('0xd'))){_0x2d652c[_0x43b2('0xe')]=moment()['format'](_0x43b2('0xf'));}if(_0x2d652c[_0x43b2('0xc')](_0x43b2('0x10'))){_0x2d652c[_0x43b2('0x11')]=moment()[_0x43b2('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5709d8(null,_0x2d652c);}}});}; \ No newline at end of file +var _0x7b09=['SquareProject','changed','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x7b09,0x1c2));var _0x97b0=function(_0x44edd2,_0x378887){_0x44edd2=_0x44edd2-0x0;var _0x255ee3=_0x7b09[_0x44edd2];return _0x255ee3;};'use strict';var _=require(_0x97b0('0x0'));var util=require(_0x97b0('0x1'));var logger=require(_0x97b0('0x2'))(_0x97b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x97b0('0x4'));var rimraf=require(_0x97b0('0x5'));var config=require(_0x97b0('0x6'));var attributes=require('./squareProject.attributes');module[_0x97b0('0x7')]=function(_0x4b0423,_0x406bff){return _0x4b0423[_0x97b0('0x8')](_0x97b0('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29d4c1,_0x2a01a9,_0x55e97b){if(_0x29d4c1[_0x97b0('0xa')](_0x97b0('0xb'))){_0x29d4c1[_0x97b0('0xc')]=moment()[_0x97b0('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x29d4c1[_0x97b0('0xa')](_0x97b0('0xe'))){_0x29d4c1[_0x97b0('0xf')]=moment()['format'](_0x97b0('0x10'));}_0x55e97b(null,_0x29d4c1);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 762fdbe..8526d5c 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 _0x28fa=['options','where','attributes','include','map','model','then','info','debug','catch','message','error','ShowSquareProject','find','raw','stringify','ioredis','../../mysqldb','rpc','../../config/environment','redis','localhost','socket.io-emitter','GetSquareProjects','SquareProject','findAll'];(function(_0x1adb25,_0xca06ef){var _0x41444e=function(_0x37b451){while(--_0x37b451){_0x1adb25['push'](_0x1adb25['shift']());}};_0x41444e(++_0xca06ef);}(_0x28fa,0xc6));var _0xa28f=function(_0x3bac25,_0x5ae592){_0x3bac25=_0x3bac25-0x0;var _0x434676=_0x28fa[_0x3bac25];return _0x434676;};'use strict';var _=require('lodash');var Redis=require(_0xa28f('0x0'));var db=require(_0xa28f('0x1'))['db'];var logger=require('../../config/logger')(_0xa28f('0x2'));var config=require(_0xa28f('0x3'));config[_0xa28f('0x4')]=_['defaults'](config['redis'],{'host':_0xa28f('0x5'),'port':0x18eb});var socket=require(_0xa28f('0x6'))(new Redis(config[_0xa28f('0x4')]));require('./squareProject.socket')['register'](socket);exports[_0xa28f('0x7')]=function(_0x5d87ff){var _0x5c4580=this;return new Promise(function(_0x44633f,_0x553b1d){return db[_0xa28f('0x8')][_0xa28f('0x9')]({'raw':_0x5d87ff[_0xa28f('0xa')]?_0x5d87ff[_0xa28f('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x5d87ff['options']?_0x5d87ff[_0xa28f('0xa')][_0xa28f('0xb')]||null:null,'attributes':_0x5d87ff[_0xa28f('0xa')]?_0x5d87ff[_0xa28f('0xa')][_0xa28f('0xc')]||null:null,'limit':_0x5d87ff['options']?_0x5d87ff[_0xa28f('0xa')]['limit']||null:null,'include':_0x5d87ff[_0xa28f('0xa')]?_0x5d87ff['options'][_0xa28f('0xd')]?_[_0xa28f('0xe')](_0x5d87ff[_0xa28f('0xa')][_0xa28f('0xd')],function(_0xd90c53){return{'model':db[_0xd90c53[_0xa28f('0xf')]],'as':_0xd90c53['as'],'attributes':_0xd90c53[_0xa28f('0xc')],'include':_0xd90c53[_0xa28f('0xd')]?_['map'](_0xd90c53[_0xa28f('0xd')],function(_0x163187){return{'model':db[_0x163187[_0xa28f('0xf')]],'as':_0x163187['as'],'attributes':_0x163187['attributes'],'include':_0x163187[_0xa28f('0xd')]?_['map'](_0x163187[_0xa28f('0xd')],function(_0x40a705){return{'model':db[_0x40a705['model']],'as':_0x40a705['as'],'attributes':_0x40a705['attributes']};}):[]};}):[]};}):[]:[]})[_0xa28f('0x10')](function(_0x5f3925){logger[_0xa28f('0x11')](_0xa28f('0x7'),_0x5d87ff);logger[_0xa28f('0x12')](_0xa28f('0x7'),_0x5d87ff,JSON['stringify'](_0x5f3925));_0x44633f(_0x5f3925);})[_0xa28f('0x13')](function(_0x51aafc){logger['error'](_0xa28f('0x7'),_0x51aafc[_0xa28f('0x14')],_0x5d87ff);_0x553b1d(_0x5c4580[_0xa28f('0x15')](0x1f4,_0x51aafc['message']));});});};exports[_0xa28f('0x16')]=function(_0x1df4f0){var _0x2943bb=this;return new Promise(function(_0x3efc28,_0x158090){return db[_0xa28f('0x8')][_0xa28f('0x17')]({'raw':_0x1df4f0['options']?_0x1df4f0[_0xa28f('0xa')][_0xa28f('0x18')]===undefined?!![]:![]:!![],'where':_0x1df4f0[_0xa28f('0xa')]?_0x1df4f0['options'][_0xa28f('0xb')]||null:null,'attributes':_0x1df4f0[_0xa28f('0xa')]?_0x1df4f0['options'][_0xa28f('0xc')]||null:null,'include':_0x1df4f0[_0xa28f('0xa')]?_0x1df4f0[_0xa28f('0xa')][_0xa28f('0xd')]?_['map'](_0x1df4f0[_0xa28f('0xa')][_0xa28f('0xd')],function(_0x56d061){return{'model':db[_0x56d061[_0xa28f('0xf')]],'as':_0x56d061['as'],'attributes':_0x56d061['attributes'],'include':_0x56d061[_0xa28f('0xd')]?_[_0xa28f('0xe')](_0x56d061[_0xa28f('0xd')],function(_0x40d316){return{'model':db[_0x40d316[_0xa28f('0xf')]],'as':_0x40d316['as'],'attributes':_0x40d316[_0xa28f('0xc')],'include':_0x40d316[_0xa28f('0xd')]?_[_0xa28f('0xe')](_0x40d316[_0xa28f('0xd')],function(_0x28780c){return{'model':db[_0x28780c['model']],'as':_0x28780c['as'],'attributes':_0x28780c[_0xa28f('0xc')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aa21d){logger['info'](_0xa28f('0x16'),_0x1df4f0);logger[_0xa28f('0x12')](_0xa28f('0x16'),_0x1df4f0,JSON[_0xa28f('0x19')](_0x4aa21d));_0x3efc28(_0x4aa21d);})[_0xa28f('0x13')](function(_0x52000b){logger[_0xa28f('0x15')](_0xa28f('0x16'),_0x52000b[_0xa28f('0x14')],_0x1df4f0);_0x158090(_0x2943bb['error'](0x1f4,_0x52000b[_0xa28f('0x14')]));});});}; \ No newline at end of file +var _0x50f8=['info','stringify','catch','error','message','ShowSquareProject','debug','ioredis','../../mysqldb','../../config/logger','rpc','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register','GetSquareProjects','findAll','options','raw','where','attributes','map','model','include','then'];(function(_0x11e2f9,_0x45c816){var _0x53310f=function(_0x460cd8){while(--_0x460cd8){_0x11e2f9['push'](_0x11e2f9['shift']());}};_0x53310f(++_0x45c816);}(_0x50f8,0x8e));var _0x850f=function(_0x5a84f8,_0x245cbe){_0x5a84f8=_0x5a84f8-0x0;var _0x247d73=_0x50f8[_0x5a84f8];return _0x247d73;};'use strict';var _=require('lodash');var Redis=require(_0x850f('0x0'));var db=require(_0x850f('0x1'))['db'];var logger=require(_0x850f('0x2'))(_0x850f('0x3'));var config=require('../../config/environment');config['redis']=_[_0x850f('0x4')](config['redis'],{'host':_0x850f('0x5'),'port':0x18eb});var socket=require(_0x850f('0x6'))(new Redis(config[_0x850f('0x7')]));require(_0x850f('0x8'))[_0x850f('0x9')](socket);exports[_0x850f('0xa')]=function(_0x5bdbf0){var _0x515fb4=this;return new Promise(function(_0x3ef8ea,_0x1b72de){return db['SquareProject'][_0x850f('0xb')]({'raw':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0['options'][_0x850f('0xd')]===undefined?!![]:![]:!![],'where':_0x5bdbf0['options']?_0x5bdbf0['options'][_0x850f('0xe')]||null:null,'attributes':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0[_0x850f('0xc')][_0x850f('0xf')]||null:null,'limit':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0['options']['limit']||null:null,'include':_0x5bdbf0[_0x850f('0xc')]?_0x5bdbf0[_0x850f('0xc')]['include']?_[_0x850f('0x10')](_0x5bdbf0[_0x850f('0xc')]['include'],function(_0x100a36){return{'model':db[_0x100a36[_0x850f('0x11')]],'as':_0x100a36['as'],'attributes':_0x100a36['attributes'],'include':_0x100a36[_0x850f('0x12')]?_['map'](_0x100a36[_0x850f('0x12')],function(_0x47f91a){return{'model':db[_0x47f91a[_0x850f('0x11')]],'as':_0x47f91a['as'],'attributes':_0x47f91a['attributes'],'include':_0x47f91a[_0x850f('0x12')]?_[_0x850f('0x10')](_0x47f91a[_0x850f('0x12')],function(_0x2bf7f9){return{'model':db[_0x2bf7f9[_0x850f('0x11')]],'as':_0x2bf7f9['as'],'attributes':_0x2bf7f9[_0x850f('0xf')]};}):[]};}):[]};}):[]:[]})[_0x850f('0x13')](function(_0x44b311){logger[_0x850f('0x14')](_0x850f('0xa'),_0x5bdbf0);logger['debug']('GetSquareProjects',_0x5bdbf0,JSON[_0x850f('0x15')](_0x44b311));_0x3ef8ea(_0x44b311);})[_0x850f('0x16')](function(_0x41c891){logger[_0x850f('0x17')](_0x850f('0xa'),_0x41c891[_0x850f('0x18')],_0x5bdbf0);_0x1b72de(_0x515fb4[_0x850f('0x17')](0x1f4,_0x41c891['message']));});});};exports['ShowSquareProject']=function(_0xbcce04){var _0x234754=this;return new Promise(function(_0x3c8cc0,_0x4f0c92){return db['SquareProject']['find']({'raw':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')][_0x850f('0xd')]===undefined?!![]:![]:!![],'where':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')][_0x850f('0xe')]||null:null,'attributes':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')][_0x850f('0xf')]||null:null,'include':_0xbcce04[_0x850f('0xc')]?_0xbcce04[_0x850f('0xc')]['include']?_['map'](_0xbcce04['options'][_0x850f('0x12')],function(_0x4b6fcd){return{'model':db[_0x4b6fcd[_0x850f('0x11')]],'as':_0x4b6fcd['as'],'attributes':_0x4b6fcd[_0x850f('0xf')],'include':_0x4b6fcd[_0x850f('0x12')]?_[_0x850f('0x10')](_0x4b6fcd[_0x850f('0x12')],function(_0x52195c){return{'model':db[_0x52195c[_0x850f('0x11')]],'as':_0x52195c['as'],'attributes':_0x52195c[_0x850f('0xf')],'include':_0x52195c[_0x850f('0x12')]?_[_0x850f('0x10')](_0x52195c[_0x850f('0x12')],function(_0x20b1c7){return{'model':db[_0x20b1c7[_0x850f('0x11')]],'as':_0x20b1c7['as'],'attributes':_0x20b1c7[_0x850f('0xf')]};}):[]};}):[]};}):[]:[]})[_0x850f('0x13')](function(_0x4b72ec){logger['info'](_0x850f('0x19'),_0xbcce04);logger[_0x850f('0x1a')](_0x850f('0x19'),_0xbcce04,JSON[_0x850f('0x15')](_0x4b72ec));_0x3c8cc0(_0x4b72ec);})[_0x850f('0x16')](function(_0x171876){logger[_0x850f('0x17')]('ShowSquareProject',_0x171876['message'],_0xbcce04);_0x4f0c92(_0x234754['error'](0x1f4,_0x171876[_0x850f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index e4b38ac..a005269 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 _0x8074=['removeListener','register','update','emit'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x8074,0x1b2));var _0x4807=function(_0x1f11e4,_0x46285f){_0x1f11e4=_0x1f11e4-0x0;var _0x41bc62=_0x8074[_0x1f11e4];return _0x41bc62;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x4807('0x0')];function createListener(_0x3e66af,_0x590c93){return function(_0x3c47e8){_0x590c93[_0x4807('0x1')](_0x3e66af,_0x3c47e8);};}function removeListener(_0x90b1e8,_0x22d5ea){return function(){SquareProjectEvents[_0x4807('0x2')](_0x90b1e8,_0x22d5ea);};}exports[_0x4807('0x3')]=function(_0x7d8b78){for(var _0x4c329f=0x0,_0x3379d1=events['length'];_0x4c329f<_0x3379d1;_0x4c329f++){var _0x2b881d=events[_0x4c329f];var _0x580f24=createListener('squareProject:'+_0x2b881d,_0x7d8b78);SquareProjectEvents['on'](_0x2b881d,_0x580f24);}}; \ No newline at end of file +var _0xef93=['length','squareProject:','update','emit'];(function(_0x1f81cc,_0x2cfcfd){var _0x4484d8=function(_0x3ea88e){while(--_0x3ea88e){_0x1f81cc['push'](_0x1f81cc['shift']());}};_0x4484d8(++_0x2cfcfd);}(_0xef93,0x8a));var _0x3ef9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xef93[_0x20a584];return _0x4b41a8;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x3ef9('0x0')];function createListener(_0xf411e3,_0x151497){return function(_0x245399){_0x151497[_0x3ef9('0x1')](_0xf411e3,_0x245399);};}function removeListener(_0x4cd1f7,_0x3a8de5){return function(){SquareProjectEvents['removeListener'](_0x4cd1f7,_0x3a8de5);};}exports['register']=function(_0x1604d0){for(var _0x18eb82=0x0,_0x6602b2=events[_0x3ef9('0x2')];_0x18eb82<_0x6602b2;_0x18eb82++){var _0x2b427e=events[_0x18eb82];var _0x57c3b7=createListener(_0x3ef9('0x3')+_0x2b427e,_0x1604d0);SquareProjectEvents['on'](_0x2b427e,_0x57c3b7);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 50562c1..e4d42cd 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x53148f,_0x49c20a){var _0x223cca=function(_0xd7e75a){while(--_0xd7e75a){_0x53148f['push'](_0x53148f['shift']());}};_0x223cca(++_0x49c20a);}(_0x5fab,0x177));var _0xb5fa=function(_0x36b5be,_0x25cbb9){_0x36b5be=_0x36b5be-0x0;var _0x186b09=_0x5fab[_0x36b5be];return _0x186b09;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x575c40,_0x15d596){var _0x527cc4=function(_0x3b2ca1){while(--_0x3b2ca1){_0x575c40['push'](_0x575c40['shift']());}};_0x527cc4(++_0x15d596);}(_0x5fab,0x177));var _0xb5fa=function(_0x23e3b0,_0x5f2901){_0x23e3b0=_0x23e3b0-0x0;var _0x13c675=_0x5fab[_0x23e3b0];return _0x13c675;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 1eacb5a..75c67b4 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 _0x3eea=['getDataValue','substring','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4ae019,_0x1a1438){_0x4ae019=_0x4ae019-0x0;var _0x511530=_0x3eea[_0x4ae019];return _0x511530;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa3ee('0x1')]},'callerid':{'type':Sequelize[_0xa3ee('0x1')]},'calleridname':{'type':Sequelize[_0xa3ee('0x1')]},'context':{'type':Sequelize[_0xa3ee('0x1')]},'extension':{'type':Sequelize[_0xa3ee('0x1')]},'priority':{'type':Sequelize[_0xa3ee('0x1')]},'accountcode':{'type':Sequelize[_0xa3ee('0x1')]},'dnid':{'type':Sequelize[_0xa3ee('0x1')]},'projectName':{'type':Sequelize[_0xa3ee('0x1')]},'saveName':{'type':Sequelize[_0xa3ee('0x1')]},'filename':{'type':Sequelize[_0xa3ee('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x4183ee='';var _0x4e4588=this[_0xa3ee('0x2')]('savePath');if(_0x4e4588){_0x4183ee=_0x4e4588[_0xa3ee('0x3')](_0x4e4588['lastIndexOf']('.'));}return _0x4183ee;}}}; \ No newline at end of file +var _0xeda8=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xeda8,0x104));var _0x8eda=function(_0x4c012f,_0x2e6efb){_0x4c012f=_0x4c012f-0x0;var _0x1f9829=_0xeda8[_0x4c012f];return _0x1f9829;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8eda('0x2')]},'calleridname':{'type':Sequelize[_0x8eda('0x2')]},'context':{'type':Sequelize[_0x8eda('0x2')]},'extension':{'type':Sequelize[_0x8eda('0x2')]},'priority':{'type':Sequelize[_0x8eda('0x2')]},'accountcode':{'type':Sequelize[_0x8eda('0x2')]},'dnid':{'type':Sequelize[_0x8eda('0x2')]},'projectName':{'type':Sequelize[_0x8eda('0x2')]},'saveName':{'type':Sequelize[_0x8eda('0x2')]},'filename':{'type':Sequelize[_0x8eda('0x2')]},'savePath':{'type':Sequelize[_0x8eda('0x2')]},'format':{'type':Sequelize[_0x8eda('0x3')],'get':function(){var _0x4e2ebb='';var _0x28b721=this[_0x8eda('0x4')](_0x8eda('0x5'));if(_0x28b721){_0x4e2ebb=_0x28b721[_0x8eda('0x6')](_0x28b721['lastIndexOf']('.'));}return _0x4e2ebb;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 536763f..4a9e40d 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 _0xf509=['Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','intersection','length','find','catch','create','body','update','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','decryptFile','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0xf509,0xc9));var _0x9f50=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xf509[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0x9f50('0x0'));var rimraf=require(_0x9f50('0x1'));var zipdir=require(_0x9f50('0x2'));var jsonpatch=require(_0x9f50('0x3'));var rp=require(_0x9f50('0x4'));var moment=require(_0x9f50('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f50('0x6'));var util=require(_0x9f50('0x7'));var path=require(_0x9f50('0x8'));var sox=require(_0x9f50('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f50('0xa'));var _=require(_0x9f50('0xb'));var squel=require('squel');var crypto=require(_0x9f50('0xc'));var jsforce=require(_0x9f50('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9f50('0xe'));var querystring=require('querystring');var Papa=require(_0x9f50('0xf'));var Redis=require('ioredis');var authService=require(_0x9f50('0x10'));var qs=require(_0x9f50('0x11'));var as=require(_0x9f50('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f50('0x13'))(_0x9f50('0x14'));var utils=require(_0x9f50('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f50('0x16'))['db'];function respondWithStatusCode(_0x404a0f,_0x445892){_0x445892=_0x445892||0xcc;return function(_0x2c0789){if(_0x2c0789){return _0x404a0f[_0x9f50('0x17')](_0x445892);}return _0x404a0f['status'](_0x445892)[_0x9f50('0x18')]();};}function respondWithResult(_0x3789ca,_0x41956f){_0x41956f=_0x41956f||0xc8;return function(_0x2712fc){if(_0x2712fc){return _0x3789ca[_0x9f50('0x19')](_0x41956f)['json'](_0x2712fc);}};}function respondWithFilteredResult(_0x583f26,_0xad06fe){return function(_0x117031){if(_0x117031){var _0xf8bb29=typeof _0xad06fe[_0x9f50('0x1a')]===_0x9f50('0x1b')&&typeof _0xad06fe['limit']==='undefined';var _0x1a63cf=_0x117031[_0x9f50('0x1c')];var _0x17d5d5=_0xf8bb29?0x0:_0xad06fe[_0x9f50('0x1a')];var _0x4e8c1e=_0xf8bb29?_0x117031['count']:_0xad06fe['offset']+_0xad06fe[_0x9f50('0x1d')];var _0x215bdc;if(_0x4e8c1e>=_0x1a63cf){_0x4e8c1e=_0x1a63cf;_0x215bdc=0xc8;}else{_0x215bdc=0xce;}_0x583f26[_0x9f50('0x19')](_0x215bdc);return _0x583f26[_0x9f50('0x1e')]('Content-Range',_0x17d5d5+'-'+_0x4e8c1e+'/'+_0x1a63cf)[_0x9f50('0x1f')](_0x117031);}return null;};}function patchUpdates(_0x336df3){return function(_0x518ff7){try{jsonpatch['apply'](_0x518ff7,_0x336df3,!![]);}catch(_0x27df94){return BPromise['reject'](_0x27df94);}return _0x518ff7['save']();};}function saveUpdates(_0x14f15e,_0x56f7b1){return function(_0x3dc295){if(_0x3dc295){return _0x3dc295['update'](_0x14f15e)[_0x9f50('0x20')](function(_0x3b0aef){return _0x3b0aef;});}return null;};}function removeEntity(_0x536710,_0x114014){return function(_0x3681c3){if(_0x3681c3){return _0x3681c3['destroy']()[_0x9f50('0x20')](function(){_0x536710[_0x9f50('0x19')](0xcc)[_0x9f50('0x18')]();});}};}function handleEntityNotFound(_0x17008b,_0x391fbd){return function(_0x33a6a6){if(!_0x33a6a6){_0x17008b['sendStatus'](0x194);}return _0x33a6a6;};}function handleError(_0x1f8c4d,_0x37e96b){_0x37e96b=_0x37e96b||0x1f4;return function(_0x2d058b){logger[_0x9f50('0x21')](_0x2d058b[_0x9f50('0x22')]);if(_0x2d058b[_0x9f50('0x23')]){delete _0x2d058b[_0x9f50('0x23')];}_0x1f8c4d[_0x9f50('0x19')](_0x37e96b)[_0x9f50('0x24')](_0x2d058b);};}exports[_0x9f50('0x25')]=function(_0x28352d,_0x156b0f){var _0x515997={},_0x54c6c1={},_0x14846b={'count':0x0,'rows':[]};var _0x2e8996=_[_0x9f50('0x26')](db[_0x9f50('0x27')][_0x9f50('0x28')],function(_0x4afea6){return{'name':_0x4afea6[_0x9f50('0x29')],'type':_0x4afea6['type'][_0x9f50('0x2a')]};});_0x54c6c1[_0x9f50('0x2b')]=_['map'](_0x2e8996,_0x9f50('0x23'));_0x54c6c1[_0x9f50('0x2c')]=_[_0x9f50('0x2d')](_0x28352d[_0x9f50('0x2c')]);_0x54c6c1[_0x9f50('0x2e')]=_['intersection'](_0x54c6c1[_0x9f50('0x2b')],_0x54c6c1[_0x9f50('0x2c')]);_0x515997[_0x9f50('0x2f')]=_['intersection'](_0x54c6c1['model'],qs[_0x9f50('0x30')](_0x28352d[_0x9f50('0x2c')]['fields']));_0x515997[_0x9f50('0x2f')]=_0x515997['attributes']['length']?_0x515997[_0x9f50('0x2f')]:_0x54c6c1['model'];if(!_0x28352d[_0x9f50('0x2c')][_0x9f50('0x31')](_0x9f50('0x32'))){_0x515997[_0x9f50('0x1d')]=qs['limit'](_0x28352d[_0x9f50('0x2c')]['limit']);_0x515997[_0x9f50('0x1a')]=qs['offset'](_0x28352d['query'][_0x9f50('0x1a')]);}_0x515997[_0x9f50('0x33')]=qs['sort'](_0x28352d[_0x9f50('0x2c')]['sort']);_0x515997[_0x9f50('0x34')]=qs[_0x9f50('0x2e')](_[_0x9f50('0x35')](_0x28352d[_0x9f50('0x2c')],_0x54c6c1[_0x9f50('0x2e')]),_0x2e8996);if(_0x28352d[_0x9f50('0x2c')][_0x9f50('0x36')]){_0x515997[_0x9f50('0x34')]=_[_0x9f50('0x37')](_0x515997['where'],{'$or':_[_0x9f50('0x26')](_0x2e8996,function(_0x2b4351){if(_0x2b4351[_0x9f50('0x38')]!==_0x9f50('0x39')){var _0xa24a4d={};_0xa24a4d[_0x2b4351[_0x9f50('0x23')]]={'$like':'%'+_0x28352d[_0x9f50('0x2c')]['filter']+'%'};return _0xa24a4d;}})});}_0x515997=_['merge']({},_0x515997,_0x28352d[_0x9f50('0x3a')]);var _0x42387f={'where':_0x515997['where']};return db[_0x9f50('0x27')][_0x9f50('0x1c')](_0x42387f)[_0x9f50('0x20')](function(_0x457086){_0x14846b[_0x9f50('0x1c')]=_0x457086;if(_0x28352d[_0x9f50('0x2c')][_0x9f50('0x3b')]){_0x515997['include']=[{'all':!![]}];}return db[_0x9f50('0x27')][_0x9f50('0x3c')](_0x515997);})[_0x9f50('0x20')](function(_0x273b16){_0x14846b[_0x9f50('0x3d')]=_0x273b16;return _0x14846b;})[_0x9f50('0x20')](respondWithFilteredResult(_0x156b0f,_0x515997))['catch'](handleError(_0x156b0f,null));};exports[_0x9f50('0x3e')]=function(_0xa7c698,_0xbf3b17){var _0x43cca5={'raw':!![],'where':{'id':_0xa7c698[_0x9f50('0x3f')]['id']}},_0x44c90a={};_0x44c90a['model']=_[_0x9f50('0x2d')](db[_0x9f50('0x27')][_0x9f50('0x28')]);_0x44c90a[_0x9f50('0x2c')]=_[_0x9f50('0x2d')](_0xa7c698[_0x9f50('0x2c')]);_0x44c90a[_0x9f50('0x2e')]=_[_0x9f50('0x40')](_0x44c90a[_0x9f50('0x2b')],_0x44c90a[_0x9f50('0x2c')]);_0x43cca5[_0x9f50('0x2f')]=_[_0x9f50('0x40')](_0x44c90a[_0x9f50('0x2b')],qs['fields'](_0xa7c698[_0x9f50('0x2c')][_0x9f50('0x30')]));_0x43cca5['attributes']=_0x43cca5[_0x9f50('0x2f')][_0x9f50('0x41')]?_0x43cca5['attributes']:_0x44c90a[_0x9f50('0x2b')];if(_0xa7c698[_0x9f50('0x2c')][_0x9f50('0x3b')]){_0x43cca5['include']=[{'all':!![]}];}_0x43cca5=_[_0x9f50('0x37')]({},_0x43cca5,_0xa7c698['options']);return db[_0x9f50('0x27')][_0x9f50('0x42')](_0x43cca5)[_0x9f50('0x20')](handleEntityNotFound(_0xbf3b17,null))[_0x9f50('0x20')](respondWithResult(_0xbf3b17,null))[_0x9f50('0x43')](handleError(_0xbf3b17,null));};exports['create']=function(_0x32f71a,_0x2956e4){return db[_0x9f50('0x27')][_0x9f50('0x44')](_0x32f71a[_0x9f50('0x45')],{})[_0x9f50('0x20')](respondWithResult(_0x2956e4,0xc9))[_0x9f50('0x43')](handleError(_0x2956e4,null));};exports[_0x9f50('0x46')]=function(_0x46f2a8,_0x41afee){if(_0x46f2a8[_0x9f50('0x45')]['id']){delete _0x46f2a8[_0x9f50('0x45')]['id'];}return db[_0x9f50('0x27')][_0x9f50('0x42')]({'where':{'id':_0x46f2a8['params']['id']}})[_0x9f50('0x20')](handleEntityNotFound(_0x41afee,null))[_0x9f50('0x20')](saveUpdates(_0x46f2a8[_0x9f50('0x45')],null))['then'](respondWithResult(_0x41afee,null))['catch'](handleError(_0x41afee,null));};exports[_0x9f50('0x47')]=function(_0x481139,_0x5d8311,_0x5edbdd){var _0x3ff599=require(_0x9f50('0x48'));var _0x4a213d=![];var _0x44fdd1={};if(_0x481139[_0x9f50('0x2c')]['type']&&_0x481139[_0x9f50('0x2c')]['type']===_0x9f50('0x49')){_0x44fdd1['uniqueid']=_0x481139[_0x9f50('0x3f')]['id'];}else{_0x44fdd1['id']=_0x481139[_0x9f50('0x3f')]['id'];}return db[_0x9f50('0x27')][_0x9f50('0x42')]({'where':_0x44fdd1,'attributes':['id',_0x9f50('0x4a'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x5d8311,null))[_0x9f50('0x20')](function(_0x9391d4){if(_0x9391d4){var _0x1e59e6=_0x9391d4[_0x9f50('0x4a')];var _0x50d9a9=util[_0x9f50('0x4b')](_0x9f50('0x4c'),_0x1e59e6);if(fs['existsSync'](_0x50d9a9)){_0x4a213d=!![];return _0x3ff599[_0x9f50('0x4d')](_0x50d9a9,_0x1e59e6,config['secrets'][_0x9f50('0x4e')])[_0x9f50('0x20')](function(){return _0x9391d4;});}return _0x9391d4;}})[_0x9f50('0x20')](function(_0x8025a6){if(_0x8025a6){var _0x3714d7=_0x8025a6[_0x9f50('0x4a')];if(!fs[_0x9f50('0x4f')](_0x3714d7)){throw new db[(_0x9f50('0x50'))][(_0x9f50('0x51'))](_0x9f50('0x52'));}if(_0x8025a6[_0x9f50('0x53')]){return _0x5d8311[_0x9f50('0x47')](_0x3714d7,_0x8025a6[_0x9f50('0x53')]+path[_0x9f50('0x54')](_0x3714d7),function(){if(_0x4a213d){fs[_0x9f50('0x55')](_0x3714d7);}});}else{return _0x5d8311[_0x9f50('0x47')](_0x3714d7,function(_0x1b0c71){if(_0x4a213d){fs['unlink'](_0x3714d7);}});}}})[_0x9f50('0x43')](function(_0x5cf454){if(_0x5cf454[_0x9f50('0x56')]==='SquareRecording\x20not\x20found'){_0x5d8311[_0x9f50('0x19')](0x194)[_0x9f50('0x24')](_0x9f50('0x57'));}else{return handleError(_0x5d8311,null);}});};exports[_0x9f50('0x58')]=function(_0x9fafdf,_0x112ab3){return db[_0x9f50('0x27')][_0x9f50('0x42')]({'where':{'id':_0x9fafdf[_0x9f50('0x3f')]['id']}})['then'](function(_0x4e9ec7){if(_[_0x9f50('0x59')](_0x4e9ec7)){throw new ReferenceError(_0x9f50('0x5a'));}return _0x4e9ec7;})['then'](function(_0x31e9d2){var _0x3ae270=_0x31e9d2[_0x9f50('0x4a')];logger[_0x9f50('0x5b')](_0x9f50('0x5c'),_0x3ae270);if(!_[_0x9f50('0x59')](_0x31e9d2[_0x9f50('0x4a')])&&fs[_0x9f50('0x4f')](_0x3ae270)){logger[_0x9f50('0x5b')](_0x9f50('0x5d')+_0x3ae270+_0x9f50('0x5e'));fs[_0x9f50('0x5f')](_0x3ae270);}_0x3ae270=_0x3ae270+'.cypher';if(!_[_0x9f50('0x59')](_0x31e9d2[_0x9f50('0x4a')])&&fs[_0x9f50('0x4f')](_0x3ae270)){logger['info'](_0x9f50('0x5d')+_0x3ae270+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9f50('0x5f')](_0x3ae270);}return _0x31e9d2;})['then'](function(_0x53f65e){if(!_0x53f65e)throw new InternalError();return _0x53f65e['destroy']();})[_0x9f50('0x20')](function(){_0x112ab3['status'](0xcc)['end']();})['catch'](handleError(_0x112ab3,null));}; \ No newline at end of file +var _0x2eb6=['Content-Range','apply','save','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','unlinkSync','.cypher','File:\x20\x22','rimraf','fast-json-patch','mustache','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set'];(function(_0x598007,_0x4de368){var _0x11e08f=function(_0x5e19b8){while(--_0x5e19b8){_0x598007['push'](_0x598007['shift']());}};_0x11e08f(++_0x4de368);}(_0x2eb6,0x15e));var _0x62eb=function(_0x4f2d15,_0x3a90de){_0x4f2d15=_0x4f2d15-0x0;var _0x143282=_0x2eb6[_0x4f2d15];return _0x143282;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62eb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62eb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x62eb('0x2'));var util=require('util');var path=require(_0x62eb('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x62eb('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62eb('0x5'));var squel=require(_0x62eb('0x6'));var crypto=require(_0x62eb('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x62eb('0x8'));var toCsv=require(_0x62eb('0x9'));var querystring=require(_0x62eb('0xa'));var Papa=require(_0x62eb('0xb'));var Redis=require(_0x62eb('0xc'));var authService=require(_0x62eb('0xd'));var qs=require(_0x62eb('0xe'));var as=require(_0x62eb('0xf'));var hardwareService=require(_0x62eb('0x10'));var logger=require(_0x62eb('0x11'))(_0x62eb('0x12'));var utils=require(_0x62eb('0x13'));var config=require(_0x62eb('0x14'));var licenseUtil=require(_0x62eb('0x15'));var db=require(_0x62eb('0x16'))['db'];function respondWithStatusCode(_0x92aecd,_0x4dcd32){_0x4dcd32=_0x4dcd32||0xcc;return function(_0x4983cc){if(_0x4983cc){return _0x92aecd['sendStatus'](_0x4dcd32);}return _0x92aecd[_0x62eb('0x17')](_0x4dcd32)[_0x62eb('0x18')]();};}function respondWithResult(_0x1864ca,_0x4f3e25){_0x4f3e25=_0x4f3e25||0xc8;return function(_0x449434){if(_0x449434){return _0x1864ca[_0x62eb('0x17')](_0x4f3e25)[_0x62eb('0x19')](_0x449434);}};}function respondWithFilteredResult(_0x391c99,_0x5ebde9){return function(_0x5b6d38){if(_0x5b6d38){var _0x3ae957=typeof _0x5ebde9[_0x62eb('0x1a')]==='undefined'&&typeof _0x5ebde9[_0x62eb('0x1b')]==='undefined';var _0x5aac2e=_0x5b6d38[_0x62eb('0x1c')];var _0x3a4745=_0x3ae957?0x0:_0x5ebde9[_0x62eb('0x1a')];var _0x2aa536=_0x3ae957?_0x5b6d38['count']:_0x5ebde9['offset']+_0x5ebde9[_0x62eb('0x1b')];var _0x4a15f8;if(_0x2aa536>=_0x5aac2e){_0x2aa536=_0x5aac2e;_0x4a15f8=0xc8;}else{_0x4a15f8=0xce;}_0x391c99[_0x62eb('0x17')](_0x4a15f8);return _0x391c99[_0x62eb('0x1d')](_0x62eb('0x1e'),_0x3a4745+'-'+_0x2aa536+'/'+_0x5aac2e)[_0x62eb('0x19')](_0x5b6d38);}return null;};}function patchUpdates(_0xaa1966){return function(_0x1bdf72){try{jsonpatch[_0x62eb('0x1f')](_0x1bdf72,_0xaa1966,!![]);}catch(_0x203c89){return BPromise['reject'](_0x203c89);}return _0x1bdf72[_0x62eb('0x20')]();};}function saveUpdates(_0x556dde,_0x2d457f){return function(_0x15d4c7){if(_0x15d4c7){return _0x15d4c7['update'](_0x556dde)[_0x62eb('0x21')](function(_0x2984d3){return _0x2984d3;});}return null;};}function removeEntity(_0x4e12d9,_0xeadfdd){return function(_0x4507b1){if(_0x4507b1){return _0x4507b1['destroy']()[_0x62eb('0x21')](function(){_0x4e12d9[_0x62eb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x396c21,_0x50cbde){return function(_0x50e3f5){if(!_0x50e3f5){_0x396c21['sendStatus'](0x194);}return _0x50e3f5;};}function handleError(_0x230ad1,_0x351dc9){_0x351dc9=_0x351dc9||0x1f4;return function(_0x18429d){logger[_0x62eb('0x22')](_0x18429d[_0x62eb('0x23')]);if(_0x18429d[_0x62eb('0x24')]){delete _0x18429d[_0x62eb('0x24')];}_0x230ad1[_0x62eb('0x17')](_0x351dc9)[_0x62eb('0x25')](_0x18429d);};}exports[_0x62eb('0x26')]=function(_0x32d871,_0x2ce0d8){var _0x15a0fc={},_0x4f1090={},_0x1f16f3={'count':0x0,'rows':[]};var _0x3a8bd0=_[_0x62eb('0x27')](db[_0x62eb('0x28')][_0x62eb('0x29')],function(_0xe047ba){return{'name':_0xe047ba['fieldName'],'type':_0xe047ba[_0x62eb('0x2a')][_0x62eb('0x2b')]};});_0x4f1090[_0x62eb('0x2c')]=_[_0x62eb('0x27')](_0x3a8bd0,_0x62eb('0x24'));_0x4f1090[_0x62eb('0x2d')]=_['keys'](_0x32d871[_0x62eb('0x2d')]);_0x4f1090[_0x62eb('0x2e')]=_[_0x62eb('0x2f')](_0x4f1090[_0x62eb('0x2c')],_0x4f1090[_0x62eb('0x2d')]);_0x15a0fc[_0x62eb('0x30')]=_[_0x62eb('0x2f')](_0x4f1090[_0x62eb('0x2c')],qs[_0x62eb('0x31')](_0x32d871[_0x62eb('0x2d')][_0x62eb('0x31')]));_0x15a0fc['attributes']=_0x15a0fc['attributes']['length']?_0x15a0fc[_0x62eb('0x30')]:_0x4f1090[_0x62eb('0x2c')];if(!_0x32d871['query'][_0x62eb('0x32')](_0x62eb('0x33'))){_0x15a0fc[_0x62eb('0x1b')]=qs['limit'](_0x32d871['query']['limit']);_0x15a0fc['offset']=qs[_0x62eb('0x1a')](_0x32d871[_0x62eb('0x2d')][_0x62eb('0x1a')]);}_0x15a0fc[_0x62eb('0x34')]=qs[_0x62eb('0x35')](_0x32d871[_0x62eb('0x2d')][_0x62eb('0x35')]);_0x15a0fc[_0x62eb('0x36')]=qs[_0x62eb('0x2e')](_[_0x62eb('0x37')](_0x32d871[_0x62eb('0x2d')],_0x4f1090[_0x62eb('0x2e')]),_0x3a8bd0);if(_0x32d871[_0x62eb('0x2d')][_0x62eb('0x38')]){_0x15a0fc['where']=_[_0x62eb('0x39')](_0x15a0fc[_0x62eb('0x36')],{'$or':_[_0x62eb('0x27')](_0x3a8bd0,function(_0x5b7ad0){if(_0x5b7ad0[_0x62eb('0x2a')]!=='VIRTUAL'){var _0x275b17={};_0x275b17[_0x5b7ad0[_0x62eb('0x24')]]={'$like':'%'+_0x32d871[_0x62eb('0x2d')]['filter']+'%'};return _0x275b17;}})});}_0x15a0fc=_[_0x62eb('0x39')]({},_0x15a0fc,_0x32d871[_0x62eb('0x3a')]);var _0x2e518b={'where':_0x15a0fc[_0x62eb('0x36')]};return db['SquareRecording'][_0x62eb('0x1c')](_0x2e518b)['then'](function(_0x4b913b){_0x1f16f3['count']=_0x4b913b;if(_0x32d871['query']['includeAll']){_0x15a0fc[_0x62eb('0x3b')]=[{'all':!![]}];}return db['SquareRecording'][_0x62eb('0x3c')](_0x15a0fc);})[_0x62eb('0x21')](function(_0x3ebf78){_0x1f16f3[_0x62eb('0x3d')]=_0x3ebf78;return _0x1f16f3;})[_0x62eb('0x21')](respondWithFilteredResult(_0x2ce0d8,_0x15a0fc))[_0x62eb('0x3e')](handleError(_0x2ce0d8,null));};exports[_0x62eb('0x3f')]=function(_0xca61ae,_0x4304e4){var _0x10c6c5={'raw':!![],'where':{'id':_0xca61ae[_0x62eb('0x40')]['id']}},_0xba8436={};_0xba8436['model']=_[_0x62eb('0x41')](db[_0x62eb('0x28')][_0x62eb('0x29')]);_0xba8436['query']=_[_0x62eb('0x41')](_0xca61ae[_0x62eb('0x2d')]);_0xba8436['filters']=_[_0x62eb('0x2f')](_0xba8436[_0x62eb('0x2c')],_0xba8436[_0x62eb('0x2d')]);_0x10c6c5[_0x62eb('0x30')]=_[_0x62eb('0x2f')](_0xba8436[_0x62eb('0x2c')],qs[_0x62eb('0x31')](_0xca61ae[_0x62eb('0x2d')][_0x62eb('0x31')]));_0x10c6c5[_0x62eb('0x30')]=_0x10c6c5['attributes'][_0x62eb('0x42')]?_0x10c6c5[_0x62eb('0x30')]:_0xba8436['model'];if(_0xca61ae[_0x62eb('0x2d')][_0x62eb('0x43')]){_0x10c6c5[_0x62eb('0x3b')]=[{'all':!![]}];}_0x10c6c5=_[_0x62eb('0x39')]({},_0x10c6c5,_0xca61ae['options']);return db[_0x62eb('0x28')][_0x62eb('0x44')](_0x10c6c5)[_0x62eb('0x21')](handleEntityNotFound(_0x4304e4,null))['then'](respondWithResult(_0x4304e4,null))[_0x62eb('0x3e')](handleError(_0x4304e4,null));};exports['create']=function(_0x4b2dcc,_0x2147bf){return db[_0x62eb('0x28')][_0x62eb('0x45')](_0x4b2dcc[_0x62eb('0x46')],{})[_0x62eb('0x21')](respondWithResult(_0x2147bf,0xc9))[_0x62eb('0x3e')](handleError(_0x2147bf,null));};exports[_0x62eb('0x47')]=function(_0x584848,_0xfe6226){if(_0x584848['body']['id']){delete _0x584848[_0x62eb('0x46')]['id'];}return db[_0x62eb('0x28')][_0x62eb('0x44')]({'where':{'id':_0x584848[_0x62eb('0x40')]['id']}})['then'](handleEntityNotFound(_0xfe6226,null))[_0x62eb('0x21')](saveUpdates(_0x584848['body'],null))[_0x62eb('0x21')](respondWithResult(_0xfe6226,null))[_0x62eb('0x3e')](handleError(_0xfe6226,null));};exports[_0x62eb('0x48')]=function(_0x47b049,_0x45e9c0,_0xe7847a){var _0x24a65c=require(_0x62eb('0x49'));var _0xdb26f5=![];var _0x4ee64c={};if(_0x47b049[_0x62eb('0x2d')][_0x62eb('0x2a')]&&_0x47b049[_0x62eb('0x2d')]['type']===_0x62eb('0x4a')){_0x4ee64c[_0x62eb('0x4a')]=_0x47b049[_0x62eb('0x40')]['id'];}else{_0x4ee64c['id']=_0x47b049['params']['id'];}return db['SquareRecording'][_0x62eb('0x44')]({'where':_0x4ee64c,'attributes':['id',_0x62eb('0x4b'),_0x62eb('0x4c')],'raw':!![]})[_0x62eb('0x21')](handleEntityNotFound(_0x45e9c0,null))[_0x62eb('0x21')](function(_0x52675b){if(_0x52675b){var _0x3bb965=_0x52675b[_0x62eb('0x4b')];var _0x3fb65d=util[_0x62eb('0x4d')]('%s.cypher',_0x3bb965);if(fs[_0x62eb('0x4e')](_0x3fb65d)){_0xdb26f5=!![];return _0x24a65c[_0x62eb('0x4f')](_0x3fb65d,_0x3bb965,config[_0x62eb('0x50')]['recording'])['then'](function(){return _0x52675b;});}return _0x52675b;}})[_0x62eb('0x21')](function(_0xc42b50){if(_0xc42b50){var _0x2e5525=_0xc42b50['savePath'];if(!fs[_0x62eb('0x4e')](_0x2e5525)){throw new db[(_0x62eb('0x51'))][(_0x62eb('0x52'))](_0x62eb('0x53'));}if(_0xc42b50['filename']){return _0x45e9c0[_0x62eb('0x48')](_0x2e5525,_0xc42b50['filename']+path[_0x62eb('0x54')](_0x2e5525),function(){if(_0xdb26f5){fs['unlink'](_0x2e5525);}});}else{return _0x45e9c0[_0x62eb('0x48')](_0x2e5525,function(_0x1e647b){if(_0xdb26f5){fs['unlink'](_0x2e5525);}});}}})[_0x62eb('0x3e')](function(_0x27cb39){if(_0x27cb39[_0x62eb('0x55')]==='SquareRecording\x20not\x20found'){_0x45e9c0[_0x62eb('0x17')](0x194)[_0x62eb('0x25')](_0x62eb('0x56'));}else{return handleError(_0x45e9c0,null);}});};exports[_0x62eb('0x57')]=function(_0x473f15,_0x3c9526){return db[_0x62eb('0x28')]['find']({'where':{'id':_0x473f15[_0x62eb('0x40')]['id']}})[_0x62eb('0x21')](function(_0x68f84b){if(_['isNil'](_0x68f84b)){throw new ReferenceError(_0x62eb('0x58'));}return _0x68f84b;})[_0x62eb('0x21')](function(_0x2a13c8){var _0x3d15bf=_0x2a13c8[_0x62eb('0x4b')];logger[_0x62eb('0x59')](_0x62eb('0x5a'),_0x3d15bf);if(!_[_0x62eb('0x5b')](_0x2a13c8[_0x62eb('0x4b')])&&fs[_0x62eb('0x4e')](_0x3d15bf)){logger[_0x62eb('0x59')]('File:\x20\x22'+_0x3d15bf+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x62eb('0x5c')](_0x3d15bf);}_0x3d15bf=_0x3d15bf+_0x62eb('0x5d');if(!_[_0x62eb('0x5b')](_0x2a13c8['savePath'])&&fs[_0x62eb('0x4e')](_0x3d15bf)){logger[_0x62eb('0x59')](_0x62eb('0x5e')+_0x3d15bf+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x62eb('0x5c')](_0x3d15bf);}return _0x2a13c8;})['then'](function(_0x337170){if(!_0x337170)throw new InternalError();return _0x337170[_0x62eb('0x57')]();})[_0x62eb('0x21')](function(){_0x3c9526[_0x62eb('0x17')](0xcc)[_0x62eb('0x18')]();})[_0x62eb('0x3e')](handleError(_0x3c9526,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 1cffb7b..4e1edd7 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 _0xe0c1=['square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','define','SquareRecording'];(function(_0x3d78d7,_0x44acea){var _0x4b6784=function(_0x284157){while(--_0x284157){_0x3d78d7['push'](_0x3d78d7['shift']());}};_0x4b6784(++_0x44acea);}(_0xe0c1,0x10f));var _0x1e0c=function(_0x3b95cb,_0x59071d){_0x3b95cb=_0x3b95cb-0x0;var _0x353129=_0xe0c1[_0x3b95cb];return _0x353129;};'use strict';var _=require(_0x1e0c('0x0'));var util=require(_0x1e0c('0x1'));var logger=require(_0x1e0c('0x2'))(_0x1e0c('0x3'));var moment=require(_0x1e0c('0x4'));var BPromise=require(_0x1e0c('0x5'));var rp=require(_0x1e0c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x57c88f,_0x935e3b){return _0x57c88f[_0x1e0c('0x7')](_0x1e0c('0x8'),attributes,{'tableName':_0x1e0c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7f0=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash'];(function(_0x58e7cd,_0x5da97b){var _0x5f41b0=function(_0x134d27){while(--_0x134d27){_0x58e7cd['push'](_0x58e7cd['shift']());}};_0x5f41b0(++_0x5da97b);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x1798cb,_0xafe39f){_0x1798cb=_0x1798cb-0x0;var _0x4a68ed=_0xb7f0[_0x1798cb];return _0x4a68ed;};'use strict';var _=require(_0x0b7f('0x0'));var util=require(_0x0b7f('0x1'));var logger=require(_0x0b7f('0x2'))(_0x0b7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0b7f('0x4'));var fs=require('fs');var path=require(_0x0b7f('0x5'));var rimraf=require(_0x0b7f('0x6'));var config=require(_0x0b7f('0x7'));var attributes=require(_0x0b7f('0x8'));module[_0x0b7f('0x9')]=function(_0x1c3c26,_0x1ba1e8){return _0x1c3c26[_0x0b7f('0xa')](_0x0b7f('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 02ee894..a5679b4 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 _0x1bb0=['info','SquareRecording,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x1bb0,0x153));var _0x01bb=function(_0x1df141,_0x313333){_0x1df141=_0x1df141-0x0;var _0x3a6df6=_0x1bb0[_0x1df141];return _0x3a6df6;};'use strict';var _=require(_0x01bb('0x0'));var util=require(_0x01bb('0x1'));var moment=require('moment');var BPromise=require(_0x01bb('0x2'));var rs=require(_0x01bb('0x3'));var fs=require('fs');var Redis=require(_0x01bb('0x4'));var db=require(_0x01bb('0x5'))['db'];var utils=require(_0x01bb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x01bb('0x7'));var jayson=require(_0x01bb('0x8'));var client=jayson[_0x01bb('0x9')][_0x01bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x199701,_0x3749f7,_0x2ab329){return new BPromise(function(_0x5b1d92,_0x8bc1e0){return client['request'](_0x199701,_0x2ab329)[_0x01bb('0xb')](function(_0x1ab394){logger[_0x01bb('0xc')](_0x01bb('0xd'),_0x3749f7,'request\x20sent');logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x3749f7,'request\x20sent',JSON['stringify'](_0x1ab394));if(_0x1ab394[_0x01bb('0xe')]){if(_0x1ab394[_0x01bb('0xe')][_0x01bb('0xf')]===0x1f4){logger[_0x01bb('0xe')](_0x01bb('0xd'),_0x3749f7,_0x1ab394[_0x01bb('0xe')][_0x01bb('0x10')]);return _0x8bc1e0(_0x1ab394['error'][_0x01bb('0x10')]);}logger[_0x01bb('0xe')](_0x01bb('0xd'),_0x3749f7,_0x1ab394[_0x01bb('0xe')]['message']);return _0x5b1d92(_0x1ab394[_0x01bb('0xe')][_0x01bb('0x10')]);}else{logger[_0x01bb('0xc')]('SquareRecording,\x20%s,\x20%s',_0x3749f7,'request\x20sent');_0x5b1d92(_0x1ab394[_0x01bb('0x11')][_0x01bb('0x10')]);}})[_0x01bb('0x12')](function(_0x4e6b89){logger[_0x01bb('0xe')]('SquareRecording,\x20%s,\x20%s',_0x3749f7,_0x4e6b89);_0x8bc1e0(_0x4e6b89);});});}exports[_0x01bb('0x13')]=function(_0x5c4388){var _0x354633=this;return new Promise(function(_0x5e13ec,_0x2f9674){return db[_0x01bb('0x14')][_0x01bb('0x15')](_0x5c4388[_0x01bb('0x16')],{'raw':_0x5c4388[_0x01bb('0x17')]?_0x5c4388[_0x01bb('0x17')][_0x01bb('0x18')]===undefined?!![]:![]:!![]})[_0x01bb('0xb')](function(_0x4777a7){logger[_0x01bb('0xc')](_0x01bb('0x13'),_0x5c4388);logger[_0x01bb('0x19')](_0x01bb('0x13'),_0x5c4388,JSON[_0x01bb('0x1a')](_0x4777a7));_0x5e13ec(_0x4777a7);})['catch'](function(_0x5e4934){logger[_0x01bb('0xe')](_0x01bb('0x13'),_0x5e4934[_0x01bb('0x10')],_0x5c4388);_0x2f9674(_0x354633[_0x01bb('0xe')](0x1f4,_0x5e4934[_0x01bb('0x10')]));});});}; \ No newline at end of file +var _0x3516=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','util','moment','bluebird','randomstring'];(function(_0x4c9316,_0x5c7f6f){var _0x146aad=function(_0x4fa179){while(--_0x4fa179){_0x4c9316['push'](_0x4c9316['shift']());}};_0x146aad(++_0x5c7f6f);}(_0x3516,0x128));var _0x6351=function(_0xd99840,_0x1734cf){_0xd99840=_0xd99840-0x0;var _0x34a786=_0x3516[_0xd99840];return _0x34a786;};'use strict';var _=require('lodash');var util=require(_0x6351('0x0'));var moment=require(_0x6351('0x1'));var BPromise=require(_0x6351('0x2'));var rs=require(_0x6351('0x3'));var fs=require('fs');var Redis=require(_0x6351('0x4'));var db=require(_0x6351('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6351('0x6'))(_0x6351('0x7'));var config=require(_0x6351('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6351('0x9')][_0x6351('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51b10e,_0x3e2696,_0x114fd3){return new BPromise(function(_0x26cefd,_0x912e5a){return client[_0x6351('0xb')](_0x51b10e,_0x114fd3)[_0x6351('0xc')](function(_0x3669b0){logger[_0x6351('0xd')](_0x6351('0xe'),_0x3e2696,_0x6351('0xf'));logger[_0x6351('0x10')](_0x6351('0x11'),_0x3e2696,_0x6351('0xf'),JSON[_0x6351('0x12')](_0x3669b0));if(_0x3669b0[_0x6351('0x13')]){if(_0x3669b0[_0x6351('0x13')][_0x6351('0x14')]===0x1f4){logger[_0x6351('0x13')](_0x6351('0xe'),_0x3e2696,_0x3669b0[_0x6351('0x13')][_0x6351('0x15')]);return _0x912e5a(_0x3669b0[_0x6351('0x13')]['message']);}logger[_0x6351('0x13')](_0x6351('0xe'),_0x3e2696,_0x3669b0[_0x6351('0x13')][_0x6351('0x15')]);return _0x26cefd(_0x3669b0['error'][_0x6351('0x15')]);}else{logger[_0x6351('0xd')](_0x6351('0xe'),_0x3e2696,_0x6351('0xf'));_0x26cefd(_0x3669b0[_0x6351('0x16')][_0x6351('0x15')]);}})[_0x6351('0x17')](function(_0x5ea20a){logger[_0x6351('0x13')](_0x6351('0xe'),_0x3e2696,_0x5ea20a);_0x912e5a(_0x5ea20a);});});}exports['CreateSquareRecording']=function(_0x33baa4){var _0x3bfd86=this;return new Promise(function(_0x2af3e4,_0x37f76e){return db[_0x6351('0x18')][_0x6351('0x19')](_0x33baa4[_0x6351('0x1a')],{'raw':_0x33baa4[_0x6351('0x1b')]?_0x33baa4[_0x6351('0x1b')][_0x6351('0x1c')]===undefined?!![]:![]:!![]})[_0x6351('0xc')](function(_0x3f14d7){logger[_0x6351('0xd')](_0x6351('0x1d'),_0x33baa4);logger['debug'](_0x6351('0x1d'),_0x33baa4,JSON[_0x6351('0x12')](_0x3f14d7));_0x2af3e4(_0x3f14d7);})['catch'](function(_0x3c099f){logger[_0x6351('0x13')](_0x6351('0x1d'),_0x3c099f[_0x6351('0x15')],_0x33baa4);_0x37f76e(_0x3bfd86[_0x6351('0x13')](0x1f4,_0x3c099f[_0x6351('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index c4d23cd..2d38e66 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x5dd45e,_0x3af0fd){var _0x492e26=function(_0x590c74){while(--_0x590c74){_0x5dd45e['push'](_0x5dd45e['shift']());}};_0x492e26(++_0x3af0fd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x269816,_0x3046b9){var _0x72af28=function(_0x3d6631){while(--_0x3d6631){_0x269816['push'](_0x269816['shift']());}};_0x72af28(++_0x3046b9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index a864535..258142f 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 _0x393a=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x393a,0x173));var _0xa393=function(_0x514c5e,_0x8c0875){_0x514c5e=_0x514c5e-0x0;var _0x34c3e6=_0x393a[_0x514c5e];return _0x34c3e6;};'use strict';var Sequelize=require(_0xa393('0x0'));module['exports']={'network':{'type':Sequelize[_0xa393('0x1')]},'network_script':{'type':Sequelize[_0xa393('0x1')]},'request':{'type':Sequelize[_0xa393('0x1')]},'channel':{'type':Sequelize[_0xa393('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa393('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa393('0x1')]},'calleridname':{'type':Sequelize[_0xa393('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa393('0x1')]},'callington':{'type':Sequelize[_0xa393('0x1')]},'callingtns':{'type':Sequelize[_0xa393('0x1')]},'dnid':{'type':Sequelize[_0xa393('0x1')]},'rdnis':{'type':Sequelize[_0xa393('0x1')]},'context':{'type':Sequelize[_0xa393('0x1')]},'extension':{'type':Sequelize[_0xa393('0x1')]},'priority':{'type':Sequelize[_0xa393('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xa393('0x1')]},'project_name':{'type':Sequelize[_0xa393('0x1')]},'joinAt':{'type':Sequelize[_0xa393('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xa393('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0427=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x52c8e8,_0x5ee20d){var _0x31bb1a=function(_0x47233a){while(--_0x47233a){_0x52c8e8['push'](_0x52c8e8['shift']());}};_0x31bb1a(++_0x5ee20d);}(_0x0427,0x16a));var _0x7042=function(_0x57fbc6,_0x30720a){_0x57fbc6=_0x57fbc6-0x0;var _0x4a807b=_0x0427[_0x57fbc6];return _0x4a807b;};'use strict';var Sequelize=require(_0x7042('0x0'));module[_0x7042('0x1')]={'network':{'type':Sequelize[_0x7042('0x2')]},'network_script':{'type':Sequelize[_0x7042('0x2')]},'request':{'type':Sequelize[_0x7042('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7042('0x2')]},'type':{'type':Sequelize[_0x7042('0x2')]},'uniqueid':{'type':Sequelize[_0x7042('0x2')]},'version':{'type':Sequelize[_0x7042('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7042('0x2')]},'callingpres':{'type':Sequelize[_0x7042('0x2')]},'callingani2':{'type':Sequelize[_0x7042('0x2')]},'callington':{'type':Sequelize[_0x7042('0x2')]},'callingtns':{'type':Sequelize[_0x7042('0x2')]},'dnid':{'type':Sequelize[_0x7042('0x2')]},'rdnis':{'type':Sequelize[_0x7042('0x2')]},'context':{'type':Sequelize[_0x7042('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7042('0x2')]},'enhanced':{'type':Sequelize[_0x7042('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x7042('0x2')]},'project_name':{'type':Sequelize[_0x7042('0x2')]},'joinAt':{'type':Sequelize[_0x7042('0x3')]},'leaveAt':{'type':Sequelize[_0x7042('0x3')]},'bot':{'type':Sequelize[_0x7042('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index e9639f2..b367775 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 _0xab46=['send','index','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','SquareReport','includeAll','include','rows','catch','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','name'];(function(_0x23d013,_0xf3e124){var _0x746063=function(_0x133212){while(--_0x133212){_0x23d013['push'](_0x23d013['shift']());}};_0x746063(++_0xf3e124);}(_0xab46,0x68));var _0x6ab4=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0xab46[_0x1e6659];return _0x4d16e4;};'use strict';var emlformat=require(_0x6ab4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ab4('0x1'));var jsonpatch=require(_0x6ab4('0x2'));var rp=require(_0x6ab4('0x3'));var moment=require(_0x6ab4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6ab4('0x5'));var util=require(_0x6ab4('0x6'));var path=require(_0x6ab4('0x7'));var sox=require('sox');var csv=require(_0x6ab4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ab4('0x9'));var squel=require('squel');var crypto=require(_0x6ab4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6ab4('0xb'));var toCsv=require(_0x6ab4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6ab4('0xc'));var authService=require(_0x6ab4('0xd'));var qs=require(_0x6ab4('0xe'));var as=require(_0x6ab4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ab4('0x10'))(_0x6ab4('0x11'));var utils=require(_0x6ab4('0x12'));var config=require(_0x6ab4('0x13'));var licenseUtil=require(_0x6ab4('0x14'));var db=require(_0x6ab4('0x15'))['db'];function respondWithStatusCode(_0x514b80,_0x3dd703){_0x3dd703=_0x3dd703||0xcc;return function(_0x4b39c9){if(_0x4b39c9){return _0x514b80[_0x6ab4('0x16')](_0x3dd703);}return _0x514b80[_0x6ab4('0x17')](_0x3dd703)[_0x6ab4('0x18')]();};}function respondWithResult(_0xb8d1df,_0x383ec9){_0x383ec9=_0x383ec9||0xc8;return function(_0x86b021){if(_0x86b021){return _0xb8d1df[_0x6ab4('0x17')](_0x383ec9)[_0x6ab4('0x19')](_0x86b021);}};}function respondWithFilteredResult(_0x39c580,_0x2bd5a){return function(_0x39ea61){if(_0x39ea61){var _0x1e61e7=typeof _0x2bd5a[_0x6ab4('0x1a')]===_0x6ab4('0x1b')&&typeof _0x2bd5a['limit']==='undefined';var _0xa619e2=_0x39ea61[_0x6ab4('0x1c')];var _0x199a81=_0x1e61e7?0x0:_0x2bd5a[_0x6ab4('0x1a')];var _0x33ce7f=_0x1e61e7?_0x39ea61['count']:_0x2bd5a[_0x6ab4('0x1a')]+_0x2bd5a[_0x6ab4('0x1d')];var _0x32ce1f;if(_0x33ce7f>=_0xa619e2){_0x33ce7f=_0xa619e2;_0x32ce1f=0xc8;}else{_0x32ce1f=0xce;}_0x39c580[_0x6ab4('0x17')](_0x32ce1f);return _0x39c580['set'](_0x6ab4('0x1e'),_0x199a81+'-'+_0x33ce7f+'/'+_0xa619e2)[_0x6ab4('0x19')](_0x39ea61);}return null;};}function patchUpdates(_0x36fafd){return function(_0x2fe576){try{jsonpatch[_0x6ab4('0x1f')](_0x2fe576,_0x36fafd,!![]);}catch(_0x12a801){return BPromise[_0x6ab4('0x20')](_0x12a801);}return _0x2fe576[_0x6ab4('0x21')]();};}function saveUpdates(_0x432933,_0x264372){return function(_0x4cf51b){if(_0x4cf51b){return _0x4cf51b[_0x6ab4('0x22')](_0x432933)[_0x6ab4('0x23')](function(_0x1f9f20){return _0x1f9f20;});}return null;};}function removeEntity(_0x123d82,_0x39ad5a){return function(_0x11b7e2){if(_0x11b7e2){return _0x11b7e2[_0x6ab4('0x24')]()['then'](function(){_0x123d82[_0x6ab4('0x17')](0xcc)[_0x6ab4('0x18')]();});}};}function handleEntityNotFound(_0xac5831,_0x4db288){return function(_0x30e9cd){if(!_0x30e9cd){_0xac5831[_0x6ab4('0x16')](0x194);}return _0x30e9cd;};}function handleError(_0x2de84b,_0x1a4b48){_0x1a4b48=_0x1a4b48||0x1f4;return function(_0x56ddb9){logger['error'](_0x56ddb9['stack']);if(_0x56ddb9[_0x6ab4('0x25')]){delete _0x56ddb9[_0x6ab4('0x25')];}_0x2de84b[_0x6ab4('0x17')](_0x1a4b48)[_0x6ab4('0x26')](_0x56ddb9);};}exports[_0x6ab4('0x27')]=function(_0x217434,_0x105307){var _0x301253={},_0x465b01={},_0x19aea3={'count':0x0,'rows':[]};var _0x5ea985=_['map'](db['SquareReport']['rawAttributes'],function(_0x2149e2){return{'name':_0x2149e2[_0x6ab4('0x28')],'type':_0x2149e2['type'][_0x6ab4('0x29')]};});_0x465b01[_0x6ab4('0x2a')]=_[_0x6ab4('0x2b')](_0x5ea985,_0x6ab4('0x25'));_0x465b01[_0x6ab4('0x2c')]=_[_0x6ab4('0x2d')](_0x217434[_0x6ab4('0x2c')]);_0x465b01[_0x6ab4('0x2e')]=_[_0x6ab4('0x2f')](_0x465b01[_0x6ab4('0x2a')],_0x465b01[_0x6ab4('0x2c')]);_0x301253[_0x6ab4('0x30')]=_['intersection'](_0x465b01[_0x6ab4('0x2a')],qs[_0x6ab4('0x31')](_0x217434[_0x6ab4('0x2c')][_0x6ab4('0x31')]));_0x301253[_0x6ab4('0x30')]=_0x301253[_0x6ab4('0x30')][_0x6ab4('0x32')]?_0x301253[_0x6ab4('0x30')]:_0x465b01['model'];if(!_0x217434[_0x6ab4('0x2c')][_0x6ab4('0x33')](_0x6ab4('0x34'))){_0x301253['limit']=qs[_0x6ab4('0x1d')](_0x217434[_0x6ab4('0x2c')][_0x6ab4('0x1d')]);_0x301253['offset']=qs['offset'](_0x217434[_0x6ab4('0x2c')][_0x6ab4('0x1a')]);}_0x301253[_0x6ab4('0x35')]=qs['sort'](_0x217434['query'][_0x6ab4('0x36')]);_0x301253[_0x6ab4('0x37')]=qs[_0x6ab4('0x2e')](_[_0x6ab4('0x38')](_0x217434[_0x6ab4('0x2c')],_0x465b01['filters']),_0x5ea985);if(_0x217434[_0x6ab4('0x2c')]['filter']){_0x301253['where']=_['merge'](_0x301253[_0x6ab4('0x37')],{'$or':_[_0x6ab4('0x2b')](_0x5ea985,function(_0x854080){if(_0x854080[_0x6ab4('0x39')]!==_0x6ab4('0x3a')){var _0x286413={};_0x286413[_0x854080[_0x6ab4('0x25')]]={'$like':'%'+_0x217434[_0x6ab4('0x2c')]['filter']+'%'};return _0x286413;}})});}_0x301253=_[_0x6ab4('0x3b')]({},_0x301253,_0x217434[_0x6ab4('0x3c')]);var _0x23d663={'where':_0x301253[_0x6ab4('0x37')]};return db[_0x6ab4('0x3d')][_0x6ab4('0x1c')](_0x23d663)[_0x6ab4('0x23')](function(_0x12b97a){_0x19aea3['count']=_0x12b97a;if(_0x217434[_0x6ab4('0x2c')][_0x6ab4('0x3e')]){_0x301253[_0x6ab4('0x3f')]=[{'all':!![]}];}return db[_0x6ab4('0x3d')]['findAll'](_0x301253);})[_0x6ab4('0x23')](function(_0x57c0a4){_0x19aea3[_0x6ab4('0x40')]=_0x57c0a4;return _0x19aea3;})[_0x6ab4('0x23')](respondWithFilteredResult(_0x105307,_0x301253))[_0x6ab4('0x41')](handleError(_0x105307,null));};exports['show']=function(_0x4b2b8f,_0x19b227){var _0x517b10={'raw':!![],'where':{'id':_0x4b2b8f['params']['id']}},_0x139a85={};_0x139a85[_0x6ab4('0x2a')]=_[_0x6ab4('0x2d')](db['SquareReport']['rawAttributes']);_0x139a85[_0x6ab4('0x2c')]=_['keys'](_0x4b2b8f[_0x6ab4('0x2c')]);_0x139a85[_0x6ab4('0x2e')]=_[_0x6ab4('0x2f')](_0x139a85[_0x6ab4('0x2a')],_0x139a85[_0x6ab4('0x2c')]);_0x517b10['attributes']=_['intersection'](_0x139a85[_0x6ab4('0x2a')],qs[_0x6ab4('0x31')](_0x4b2b8f[_0x6ab4('0x2c')][_0x6ab4('0x31')]));_0x517b10['attributes']=_0x517b10[_0x6ab4('0x30')][_0x6ab4('0x32')]?_0x517b10[_0x6ab4('0x30')]:_0x139a85['model'];if(_0x4b2b8f[_0x6ab4('0x2c')][_0x6ab4('0x3e')]){_0x517b10[_0x6ab4('0x3f')]=[{'all':!![]}];}_0x517b10=_[_0x6ab4('0x3b')]({},_0x517b10,_0x4b2b8f[_0x6ab4('0x3c')]);return db['SquareReport'][_0x6ab4('0x42')](_0x517b10)['then'](handleEntityNotFound(_0x19b227,null))[_0x6ab4('0x23')](respondWithResult(_0x19b227,null))[_0x6ab4('0x41')](handleError(_0x19b227,null));};exports[_0x6ab4('0x43')]=function(_0x34ce2f,_0x2f752c){return db[_0x6ab4('0x3d')]['create'](_0x34ce2f[_0x6ab4('0x44')],{})[_0x6ab4('0x23')](respondWithResult(_0x2f752c,0xc9))[_0x6ab4('0x41')](handleError(_0x2f752c,null));};exports[_0x6ab4('0x22')]=function(_0x11bcac,_0x53ee83){if(_0x11bcac['body']['id']){delete _0x11bcac[_0x6ab4('0x44')]['id'];}return db[_0x6ab4('0x3d')][_0x6ab4('0x42')]({'where':{'id':_0x11bcac[_0x6ab4('0x45')]['id']}})['then'](handleEntityNotFound(_0x53ee83,null))[_0x6ab4('0x23')](saveUpdates(_0x11bcac[_0x6ab4('0x44')],null))[_0x6ab4('0x23')](respondWithResult(_0x53ee83,null))[_0x6ab4('0x41')](handleError(_0x53ee83,null));};exports[_0x6ab4('0x24')]=function(_0x1ca628,_0x41b57e){return db[_0x6ab4('0x3d')]['find']({'where':{'id':_0x1ca628[_0x6ab4('0x45')]['id']}})['then'](handleEntityNotFound(_0x41b57e,null))['then'](removeEntity(_0x41b57e,null))[_0x6ab4('0x41')](handleError(_0x41b57e,null));};exports[_0x6ab4('0x46')]=function(_0x3522f6,_0x588653){return db[_0x6ab4('0x3d')]['describe']()['then'](respondWithResult(_0x588653,null))[_0x6ab4('0x41')](handleError(_0x588653,null));}; \ No newline at end of file +var _0x5d1d=['hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','intersection','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','then','error','stack','send','index','SquareReport','rawAttributes','fieldName','type','key','model','name','query','keys','fields','attributes','length'];(function(_0x471448,_0x1c0e9e){var _0x38190b=function(_0x41dd2f){while(--_0x41dd2f){_0x471448['push'](_0x471448['shift']());}};_0x38190b(++_0x1c0e9e);}(_0x5d1d,0x1d6));var _0xd5d1=function(_0x499ea5,_0x4a997a){_0x499ea5=_0x499ea5-0x0;var _0x49830b=_0x5d1d[_0x499ea5];return _0x49830b;};'use strict';var emlformat=require(_0xd5d1('0x0'));var rimraf=require(_0xd5d1('0x1'));var zipdir=require(_0xd5d1('0x2'));var jsonpatch=require(_0xd5d1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd5d1('0x4'));var Mustache=require(_0xd5d1('0x5'));var util=require(_0xd5d1('0x6'));var path=require('path');var sox=require(_0xd5d1('0x7'));var csv=require(_0xd5d1('0x8'));var ejs=require(_0xd5d1('0x9'));var fs=require('fs');var fs_extra=require(_0xd5d1('0xa'));var _=require('lodash');var squel=require(_0xd5d1('0xb'));var crypto=require(_0xd5d1('0xc'));var jsforce=require(_0xd5d1('0xd'));var deskjs=require(_0xd5d1('0xe'));var toCsv=require(_0xd5d1('0x8'));var querystring=require(_0xd5d1('0xf'));var Papa=require(_0xd5d1('0x10'));var Redis=require(_0xd5d1('0x11'));var authService=require(_0xd5d1('0x12'));var qs=require(_0xd5d1('0x13'));var as=require(_0xd5d1('0x14'));var hardwareService=require(_0xd5d1('0x15'));var logger=require(_0xd5d1('0x16'))(_0xd5d1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd5d1('0x18'));var db=require(_0xd5d1('0x19'))['db'];function respondWithStatusCode(_0x225baf,_0x4a0d47){_0x4a0d47=_0x4a0d47||0xcc;return function(_0x2f9663){if(_0x2f9663){return _0x225baf[_0xd5d1('0x1a')](_0x4a0d47);}return _0x225baf[_0xd5d1('0x1b')](_0x4a0d47)[_0xd5d1('0x1c')]();};}function respondWithResult(_0x1bc6ed,_0x92f9e6){_0x92f9e6=_0x92f9e6||0xc8;return function(_0x2ffdeb){if(_0x2ffdeb){return _0x1bc6ed['status'](_0x92f9e6)[_0xd5d1('0x1d')](_0x2ffdeb);}};}function respondWithFilteredResult(_0x2ce790,_0x1716d7){return function(_0x414090){if(_0x414090){var _0x4bdb37=typeof _0x1716d7['offset']===_0xd5d1('0x1e')&&typeof _0x1716d7['limit']==='undefined';var _0xd7b346=_0x414090[_0xd5d1('0x1f')];var _0x506d62=_0x4bdb37?0x0:_0x1716d7[_0xd5d1('0x20')];var _0x43a7eb=_0x4bdb37?_0x414090[_0xd5d1('0x1f')]:_0x1716d7[_0xd5d1('0x20')]+_0x1716d7[_0xd5d1('0x21')];var _0x5d7874;if(_0x43a7eb>=_0xd7b346){_0x43a7eb=_0xd7b346;_0x5d7874=0xc8;}else{_0x5d7874=0xce;}_0x2ce790[_0xd5d1('0x1b')](_0x5d7874);return _0x2ce790[_0xd5d1('0x22')](_0xd5d1('0x23'),_0x506d62+'-'+_0x43a7eb+'/'+_0xd7b346)[_0xd5d1('0x1d')](_0x414090);}return null;};}function patchUpdates(_0x5765d8){return function(_0x1d1022){try{jsonpatch['apply'](_0x1d1022,_0x5765d8,!![]);}catch(_0x1ffb84){return BPromise['reject'](_0x1ffb84);}return _0x1d1022['save']();};}function saveUpdates(_0x24c08b,_0x36503e){return function(_0x554733){if(_0x554733){return _0x554733[_0xd5d1('0x24')](_0x24c08b)['then'](function(_0x572d00){return _0x572d00;});}return null;};}function removeEntity(_0x4950d6,_0x3b38d0){return function(_0x1806b0){if(_0x1806b0){return _0x1806b0[_0xd5d1('0x25')]()[_0xd5d1('0x26')](function(){_0x4950d6[_0xd5d1('0x1b')](0xcc)[_0xd5d1('0x1c')]();});}};}function handleEntityNotFound(_0x23f41a,_0x1a1b3b){return function(_0x4fbd5f){if(!_0x4fbd5f){_0x23f41a[_0xd5d1('0x1a')](0x194);}return _0x4fbd5f;};}function handleError(_0x44a44f,_0x2de68f){_0x2de68f=_0x2de68f||0x1f4;return function(_0x1ff40e){logger[_0xd5d1('0x27')](_0x1ff40e[_0xd5d1('0x28')]);if(_0x1ff40e['name']){delete _0x1ff40e['name'];}_0x44a44f['status'](_0x2de68f)[_0xd5d1('0x29')](_0x1ff40e);};}exports[_0xd5d1('0x2a')]=function(_0x270d34,_0x37ec42){var _0x334f58={},_0xfbe09b={},_0x5f48d7={'count':0x0,'rows':[]};var _0x503a8f=_['map'](db[_0xd5d1('0x2b')][_0xd5d1('0x2c')],function(_0x104d6d){return{'name':_0x104d6d[_0xd5d1('0x2d')],'type':_0x104d6d[_0xd5d1('0x2e')][_0xd5d1('0x2f')]};});_0xfbe09b[_0xd5d1('0x30')]=_['map'](_0x503a8f,_0xd5d1('0x31'));_0xfbe09b[_0xd5d1('0x32')]=_[_0xd5d1('0x33')](_0x270d34[_0xd5d1('0x32')]);_0xfbe09b['filters']=_['intersection'](_0xfbe09b['model'],_0xfbe09b[_0xd5d1('0x32')]);_0x334f58['attributes']=_['intersection'](_0xfbe09b[_0xd5d1('0x30')],qs[_0xd5d1('0x34')](_0x270d34[_0xd5d1('0x32')][_0xd5d1('0x34')]));_0x334f58[_0xd5d1('0x35')]=_0x334f58[_0xd5d1('0x35')][_0xd5d1('0x36')]?_0x334f58[_0xd5d1('0x35')]:_0xfbe09b[_0xd5d1('0x30')];if(!_0x270d34[_0xd5d1('0x32')][_0xd5d1('0x37')](_0xd5d1('0x38'))){_0x334f58[_0xd5d1('0x21')]=qs[_0xd5d1('0x21')](_0x270d34[_0xd5d1('0x32')]['limit']);_0x334f58[_0xd5d1('0x20')]=qs['offset'](_0x270d34[_0xd5d1('0x32')]['offset']);}_0x334f58[_0xd5d1('0x39')]=qs['sort'](_0x270d34[_0xd5d1('0x32')]['sort']);_0x334f58[_0xd5d1('0x3a')]=qs[_0xd5d1('0x3b')](_[_0xd5d1('0x3c')](_0x270d34[_0xd5d1('0x32')],_0xfbe09b[_0xd5d1('0x3b')]),_0x503a8f);if(_0x270d34[_0xd5d1('0x32')][_0xd5d1('0x3d')]){_0x334f58[_0xd5d1('0x3a')]=_['merge'](_0x334f58[_0xd5d1('0x3a')],{'$or':_['map'](_0x503a8f,function(_0x1a95a4){if(_0x1a95a4[_0xd5d1('0x2e')]!==_0xd5d1('0x3e')){var _0x36b322={};_0x36b322[_0x1a95a4[_0xd5d1('0x31')]]={'$like':'%'+_0x270d34['query']['filter']+'%'};return _0x36b322;}})});}_0x334f58=_[_0xd5d1('0x3f')]({},_0x334f58,_0x270d34[_0xd5d1('0x40')]);var _0x17d64c={'where':_0x334f58[_0xd5d1('0x3a')]};return db['SquareReport'][_0xd5d1('0x1f')](_0x17d64c)[_0xd5d1('0x26')](function(_0x4172a2){_0x5f48d7[_0xd5d1('0x1f')]=_0x4172a2;if(_0x270d34['query']['includeAll']){_0x334f58[_0xd5d1('0x41')]=[{'all':!![]}];}return db[_0xd5d1('0x2b')]['findAll'](_0x334f58);})[_0xd5d1('0x26')](function(_0x575172){_0x5f48d7[_0xd5d1('0x42')]=_0x575172;return _0x5f48d7;})[_0xd5d1('0x26')](respondWithFilteredResult(_0x37ec42,_0x334f58))[_0xd5d1('0x43')](handleError(_0x37ec42,null));};exports[_0xd5d1('0x44')]=function(_0x412628,_0x53a080){var _0x3ea9fc={'raw':!![],'where':{'id':_0x412628[_0xd5d1('0x45')]['id']}},_0x4d7062={};_0x4d7062[_0xd5d1('0x30')]=_['keys'](db[_0xd5d1('0x2b')][_0xd5d1('0x2c')]);_0x4d7062[_0xd5d1('0x32')]=_[_0xd5d1('0x33')](_0x412628[_0xd5d1('0x32')]);_0x4d7062[_0xd5d1('0x3b')]=_[_0xd5d1('0x46')](_0x4d7062[_0xd5d1('0x30')],_0x4d7062[_0xd5d1('0x32')]);_0x3ea9fc['attributes']=_[_0xd5d1('0x46')](_0x4d7062[_0xd5d1('0x30')],qs['fields'](_0x412628[_0xd5d1('0x32')]['fields']));_0x3ea9fc[_0xd5d1('0x35')]=_0x3ea9fc[_0xd5d1('0x35')][_0xd5d1('0x36')]?_0x3ea9fc['attributes']:_0x4d7062[_0xd5d1('0x30')];if(_0x412628[_0xd5d1('0x32')]['includeAll']){_0x3ea9fc[_0xd5d1('0x41')]=[{'all':!![]}];}_0x3ea9fc=_[_0xd5d1('0x3f')]({},_0x3ea9fc,_0x412628[_0xd5d1('0x40')]);return db[_0xd5d1('0x2b')]['find'](_0x3ea9fc)[_0xd5d1('0x26')](handleEntityNotFound(_0x53a080,null))[_0xd5d1('0x26')](respondWithResult(_0x53a080,null))[_0xd5d1('0x43')](handleError(_0x53a080,null));};exports['create']=function(_0x10d42b,_0x2718f6){return db[_0xd5d1('0x2b')][_0xd5d1('0x47')](_0x10d42b['body'],{})[_0xd5d1('0x26')](respondWithResult(_0x2718f6,0xc9))[_0xd5d1('0x43')](handleError(_0x2718f6,null));};exports[_0xd5d1('0x24')]=function(_0x4256b6,_0x343358){if(_0x4256b6[_0xd5d1('0x48')]['id']){delete _0x4256b6['body']['id'];}return db['SquareReport']['find']({'where':{'id':_0x4256b6[_0xd5d1('0x45')]['id']}})['then'](handleEntityNotFound(_0x343358,null))[_0xd5d1('0x26')](saveUpdates(_0x4256b6[_0xd5d1('0x48')],null))[_0xd5d1('0x26')](respondWithResult(_0x343358,null))[_0xd5d1('0x43')](handleError(_0x343358,null));};exports[_0xd5d1('0x25')]=function(_0x440f2f,_0x3d2088){return db[_0xd5d1('0x2b')][_0xd5d1('0x49')]({'where':{'id':_0x440f2f[_0xd5d1('0x45')]['id']}})[_0xd5d1('0x26')](handleEntityNotFound(_0x3d2088,null))['then'](removeEntity(_0x3d2088,null))['catch'](handleError(_0x3d2088,null));};exports[_0xd5d1('0x4a')]=function(_0x51b02d,_0x2e44e7){return db['SquareReport'][_0xd5d1('0x4a')]()[_0xd5d1('0x26')](respondWithResult(_0x2e44e7,null))[_0xd5d1('0x43')](handleError(_0x2e44e7,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c7908f2..66405c4 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 _0xc417=['exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x157535,_0x5b0a66){var _0x4ff41b=function(_0x253562){while(--_0x253562){_0x157535['push'](_0x157535['shift']());}};_0x4ff41b(++_0x5b0a66);}(_0xc417,0x1ab));var _0x7c41=function(_0x45be3f,_0xf6330a){_0x45be3f=_0x45be3f-0x0;var _0x2118fa=_0xc417[_0x45be3f];return _0x2118fa;};'use strict';var _=require(_0x7c41('0x0'));var util=require(_0x7c41('0x1'));var logger=require(_0x7c41('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7c41('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c41('0x4'));var config=require(_0x7c41('0x5'));var attributes=require(_0x7c41('0x6'));module[_0x7c41('0x7')]=function(_0x3b84ba,_0x83634){return _0x3b84ba[_0x7c41('0x8')]('SquareReport',attributes,{'tableName':_0x7c41('0x9'),'paranoid':![],'indexes':[{'name':_0x7c41('0xa'),'fields':[_0x7c41('0xb'),_0x7c41('0xc')]},{'name':_0x7c41('0xd'),'fields':[_0x7c41('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7048=['util','moment','bluebird','./squareReport.attributes','exports','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash'];(function(_0x42136b,_0x578eb2){var _0x31fcb6=function(_0x2ebd5a){while(--_0x2ebd5a){_0x42136b['push'](_0x42136b['shift']());}};_0x31fcb6(++_0x578eb2);}(_0x7048,0x1e3));var _0x8704=function(_0x1cfec4,_0x3d32e6){_0x1cfec4=_0x1cfec4-0x0;var _0x1cec1b=_0x7048[_0x1cfec4];return _0x1cec1b;};'use strict';var _=require(_0x8704('0x0'));var util=require(_0x8704('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8704('0x2'));var BPromise=require(_0x8704('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8704('0x4'));module[_0x8704('0x5')]=function(_0x462ed6,_0x140785){return _0x462ed6['define'](_0x8704('0x6'),attributes,{'tableName':_0x8704('0x7'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x8704('0x8'),_0x8704('0x9')]},{'name':_0x8704('0xa'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 19b05ae..5152a95 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 _0x04ed=['where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','stringify','UpdateSquareReport','update'];(function(_0x36f437,_0xfdddc2){var _0x6b7944=function(_0x233dbc){while(--_0x233dbc){_0x36f437['push'](_0x36f437['shift']());}};_0x6b7944(++_0xfdddc2);}(_0x04ed,0x1e3));var _0xd04e=function(_0x47e70a,_0x1c3714){_0x47e70a=_0x47e70a-0x0;var _0x3a9900=_0x04ed[_0x47e70a];return _0x3a9900;};'use strict';var _=require(_0xd04e('0x0'));var util=require(_0xd04e('0x1'));var moment=require(_0xd04e('0x2'));var BPromise=require(_0xd04e('0x3'));var rs=require(_0xd04e('0x4'));var fs=require('fs');var Redis=require(_0xd04e('0x5'));var db=require(_0xd04e('0x6'))['db'];var utils=require(_0xd04e('0x7'));var logger=require(_0xd04e('0x8'))(_0xd04e('0x9'));var config=require(_0xd04e('0xa'));var jayson=require(_0xd04e('0xb'));var client=jayson[_0xd04e('0xc')][_0xd04e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38b1f1,_0x5e9cb6,_0x3734f1){return new BPromise(function(_0x1c0854,_0x37fe2a){return client[_0xd04e('0xe')](_0x38b1f1,_0x3734f1)[_0xd04e('0xf')](function(_0x1552af){logger[_0xd04e('0x10')](_0xd04e('0x11'),_0x5e9cb6,_0xd04e('0x12'));logger[_0xd04e('0x13')](_0xd04e('0x14'),_0x5e9cb6,_0xd04e('0x12'),JSON['stringify'](_0x1552af));if(_0x1552af[_0xd04e('0x15')]){if(_0x1552af[_0xd04e('0x15')][_0xd04e('0x16')]===0x1f4){logger[_0xd04e('0x15')](_0xd04e('0x11'),_0x5e9cb6,_0x1552af[_0xd04e('0x15')][_0xd04e('0x17')]);return _0x37fe2a(_0x1552af[_0xd04e('0x15')][_0xd04e('0x17')]);}logger['error'](_0xd04e('0x11'),_0x5e9cb6,_0x1552af[_0xd04e('0x15')][_0xd04e('0x17')]);return _0x1c0854(_0x1552af[_0xd04e('0x15')]['message']);}else{logger['info'](_0xd04e('0x11'),_0x5e9cb6,_0xd04e('0x12'));_0x1c0854(_0x1552af[_0xd04e('0x18')][_0xd04e('0x17')]);}})[_0xd04e('0x19')](function(_0x45a4e3){logger[_0xd04e('0x15')](_0xd04e('0x11'),_0x5e9cb6,_0x45a4e3);_0x37fe2a(_0x45a4e3);});});}exports[_0xd04e('0x1a')]=function(_0x7a0264){var _0x48e287=this;return new Promise(function(_0x230c95,_0x449604){return db[_0xd04e('0x1b')][_0xd04e('0x1c')](_0x7a0264[_0xd04e('0x1d')],{'raw':_0x7a0264[_0xd04e('0x1e')]?_0x7a0264[_0xd04e('0x1e')][_0xd04e('0x1f')]===undefined?!![]:![]:!![]})[_0xd04e('0xf')](function(_0x1dc0ed){logger[_0xd04e('0x10')](_0xd04e('0x1a'),_0x7a0264);logger[_0xd04e('0x13')](_0xd04e('0x1a'),_0x7a0264,JSON[_0xd04e('0x20')](_0x1dc0ed));_0x230c95(_0x1dc0ed);})[_0xd04e('0x19')](function(_0x3e0db9){logger[_0xd04e('0x15')](_0xd04e('0x1a'),_0x3e0db9[_0xd04e('0x17')],_0x7a0264);_0x449604(_0x48e287[_0xd04e('0x15')](0x1f4,_0x3e0db9['message']));});});};exports[_0xd04e('0x21')]=function(_0x5e58d7){var _0x27f8da=this;return new Promise(function(_0x4e6588,_0x35b7d7){return db[_0xd04e('0x1b')][_0xd04e('0x22')](_0x5e58d7[_0xd04e('0x1d')],{'raw':_0x5e58d7[_0xd04e('0x1e')]?_0x5e58d7[_0xd04e('0x1e')][_0xd04e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e58d7[_0xd04e('0x1e')]?_0x5e58d7['options'][_0xd04e('0x23')]||null:null,'attributes':_0x5e58d7[_0xd04e('0x1e')]?_0x5e58d7[_0xd04e('0x1e')]['attributes']||null:null,'limit':_0x5e58d7[_0xd04e('0x1e')]?_0x5e58d7[_0xd04e('0x1e')][_0xd04e('0x24')]||null:null})[_0xd04e('0xf')](function(_0x25da2d){logger[_0xd04e('0x10')]('UpdateSquareReport',_0x5e58d7);logger[_0xd04e('0x13')]('UpdateSquareReport',_0x5e58d7,JSON['stringify'](_0x25da2d));_0x4e6588(_0x25da2d);})[_0xd04e('0x19')](function(_0x2594a5){logger[_0xd04e('0x15')](_0xd04e('0x21'),_0x2594a5[_0xd04e('0x17')],_0x5e58d7);_0x35b7d7(_0x27f8da['error'](0x1f4,_0x2594a5[_0xd04e('0x17')]));});});}; \ No newline at end of file +var _0x8148=['http','then','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','info','catch','SquareReport','create','body','options','raw','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x8148,0x15b));var _0x8814=function(_0x1df3bc,_0x11bf7f){_0x1df3bc=_0x1df3bc-0x0;var _0x6f0d4c=_0x8148[_0x1df3bc];return _0x6f0d4c;};'use strict';var _=require(_0x8814('0x0'));var util=require(_0x8814('0x1'));var moment=require(_0x8814('0x2'));var BPromise=require(_0x8814('0x3'));var rs=require(_0x8814('0x4'));var fs=require('fs');var Redis=require(_0x8814('0x5'));var db=require(_0x8814('0x6'))['db'];var utils=require(_0x8814('0x7'));var logger=require(_0x8814('0x8'))(_0x8814('0x9'));var config=require(_0x8814('0xa'));var jayson=require(_0x8814('0xb'));var client=jayson[_0x8814('0xc')][_0x8814('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x340ebb,_0x5825da,_0xe39052){return new BPromise(function(_0x17429e,_0x2303da){return client['request'](_0x340ebb,_0xe39052)[_0x8814('0xe')](function(_0x3728bc){logger['info']('SquareReport,\x20%s,\x20%s',_0x5825da,'request\x20sent');logger[_0x8814('0xf')](_0x8814('0x10'),_0x5825da,_0x8814('0x11'),JSON[_0x8814('0x12')](_0x3728bc));if(_0x3728bc[_0x8814('0x13')]){if(_0x3728bc[_0x8814('0x13')][_0x8814('0x14')]===0x1f4){logger[_0x8814('0x13')](_0x8814('0x15'),_0x5825da,_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);return _0x2303da(_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);}logger['error'](_0x8814('0x15'),_0x5825da,_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);return _0x17429e(_0x3728bc[_0x8814('0x13')][_0x8814('0x16')]);}else{logger[_0x8814('0x17')](_0x8814('0x15'),_0x5825da,_0x8814('0x11'));_0x17429e(_0x3728bc['result'][_0x8814('0x16')]);}})[_0x8814('0x18')](function(_0x42720c){logger['error'](_0x8814('0x15'),_0x5825da,_0x42720c);_0x2303da(_0x42720c);});});}exports['CreateSquareReport']=function(_0xb18317){var _0x4a6d3b=this;return new Promise(function(_0x47167e,_0x4d7612){return db[_0x8814('0x19')][_0x8814('0x1a')](_0xb18317[_0x8814('0x1b')],{'raw':_0xb18317[_0x8814('0x1c')]?_0xb18317['options'][_0x8814('0x1d')]===undefined?!![]:![]:!![]})[_0x8814('0xe')](function(_0x3cd280){logger[_0x8814('0x17')](_0x8814('0x1e'),_0xb18317);logger[_0x8814('0xf')](_0x8814('0x1e'),_0xb18317,JSON[_0x8814('0x12')](_0x3cd280));_0x47167e(_0x3cd280);})['catch'](function(_0x123559){logger[_0x8814('0x13')](_0x8814('0x1e'),_0x123559[_0x8814('0x16')],_0xb18317);_0x4d7612(_0x4a6d3b[_0x8814('0x13')](0x1f4,_0x123559[_0x8814('0x16')]));});});};exports[_0x8814('0x1f')]=function(_0x5bd330){var _0x2f6f4d=this;return new Promise(function(_0x26e4b1,_0x4d81c8){return db[_0x8814('0x19')][_0x8814('0x20')](_0x5bd330[_0x8814('0x1b')],{'raw':_0x5bd330[_0x8814('0x1c')]?_0x5bd330['options'][_0x8814('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bd330['options']?_0x5bd330[_0x8814('0x1c')][_0x8814('0x21')]||null:null,'attributes':_0x5bd330[_0x8814('0x1c')]?_0x5bd330[_0x8814('0x1c')][_0x8814('0x22')]||null:null,'limit':_0x5bd330[_0x8814('0x1c')]?_0x5bd330[_0x8814('0x1c')][_0x8814('0x23')]||null:null})[_0x8814('0xe')](function(_0xacfc8a){logger[_0x8814('0x17')](_0x8814('0x1f'),_0x5bd330);logger[_0x8814('0xf')]('UpdateSquareReport',_0x5bd330,JSON[_0x8814('0x12')](_0xacfc8a));_0x26e4b1(_0xacfc8a);})['catch'](function(_0x3eb502){logger['error'](_0x8814('0x1f'),_0x3eb502[_0x8814('0x16')],_0x5bd330);_0x4d81c8(_0x2f6f4d[_0x8814('0x13')](0x1f4,_0x3eb502['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1475832..091dea7 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 _0x02c1=['post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','show'];(function(_0x41ec3b,_0x2593cd){var _0x51d99f=function(_0x48b3a7){while(--_0x48b3a7){_0x41ec3b['push'](_0x41ec3b['shift']());}};_0x51d99f(++_0x2593cd);}(_0x02c1,0xd8));var _0x102c=function(_0x28bb85,_0x23c20b){_0x28bb85=_0x28bb85-0x0;var _0x48a4eb=_0x02c1[_0x28bb85];return _0x48a4eb;};'use strict';var multer=require(_0x102c('0x0'));var util=require(_0x102c('0x1'));var path=require(_0x102c('0x2'));var timeout=require(_0x102c('0x3'));var express=require('express');var router=express[_0x102c('0x4')]();var fs_extra=require(_0x102c('0x5'));var auth=require(_0x102c('0x6'));var interaction=require(_0x102c('0x7'));var config=require('../../config/environment');var controller=require(_0x102c('0x8'));router['get']('/',auth[_0x102c('0x9')](),controller[_0x102c('0xa')]);router[_0x102c('0xb')](_0x102c('0xc'),auth[_0x102c('0x9')](),controller[_0x102c('0xd')]);router[_0x102c('0xb')]('/:id',auth[_0x102c('0x9')](),controller[_0x102c('0xe')]);router[_0x102c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x102c('0x10'),auth[_0x102c('0x9')](),controller[_0x102c('0x11')]);router[_0x102c('0x12')](_0x102c('0x10'),auth[_0x102c('0x9')](),controller[_0x102c('0x13')]);module[_0x102c('0x14')]=router; \ No newline at end of file +var _0xa32a=['./squareReportDetail.controller','isAuthenticated','index','/describe','get','/:id','post','create','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ec477,_0x1e155a){var _0x23f196=function(_0x3c3f74){while(--_0x3c3f74){_0x2ec477['push'](_0x2ec477['shift']());}};_0x23f196(++_0x1e155a);}(_0xa32a,0x14c));var _0xaa32=function(_0x58bec1,_0x42c53f){_0x58bec1=_0x58bec1-0x0;var _0x16439f=_0xa32a[_0x58bec1];return _0x16439f;};'use strict';var multer=require(_0xaa32('0x0'));var util=require(_0xaa32('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaa32('0x2'));var router=express[_0xaa32('0x3')]();var fs_extra=require(_0xaa32('0x4'));var auth=require(_0xaa32('0x5'));var interaction=require(_0xaa32('0x6'));var config=require(_0xaa32('0x7'));var controller=require(_0xaa32('0x8'));router['get']('/',auth[_0xaa32('0x9')](),controller[_0xaa32('0xa')]);router['get'](_0xaa32('0xb'),auth[_0xaa32('0x9')](),controller['describe']);router[_0xaa32('0xc')](_0xaa32('0xd'),auth[_0xaa32('0x9')](),controller['show']);router[_0xaa32('0xe')]('/',auth[_0xaa32('0x9')](),controller[_0xaa32('0xf')]);router[_0xaa32('0x10')](_0xaa32('0xd'),auth[_0xaa32('0x9')](),controller[_0xaa32('0x11')]);router['delete'](_0xaa32('0xd'),auth[_0xaa32('0x9')](),controller[_0xaa32('0x12')]);module[_0xaa32('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index e6c99b2..7351d14 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 _0xe240=['STRING','sequelize','exports'];(function(_0x3015f9,_0x6eeb0d){var _0x3390b6=function(_0x4cff57){while(--_0x4cff57){_0x3015f9['push'](_0x3015f9['shift']());}};_0x3390b6(++_0x6eeb0d);}(_0xe240,0x16f));var _0x0e24=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe240[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x0e24('0x0'));module[_0x0e24('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x0e24('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x0e24('0x2')]},'callerid':{'type':Sequelize[_0x0e24('0x2')]}}; \ No newline at end of file +var _0xaf80=['exports','STRING'];(function(_0x471bef,_0x5d881d){var _0x12de86=function(_0x621396){while(--_0x621396){_0x471bef['push'](_0x471bef['shift']());}};_0x12de86(++_0x5d881d);}(_0xaf80,0x1cc));var _0x0af8=function(_0x58e9e5,_0x1d8a77){_0x58e9e5=_0x58e9e5-0x0;var _0x249961=_0xaf80[_0x58e9e5];return _0x249961;};'use strict';var Sequelize=require('sequelize');module[_0x0af8('0x0')]={'uniqueid':{'type':Sequelize[_0x0af8('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x0af8('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x0af8('0x1')]},'callerid':{'type':Sequelize[_0x0af8('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 480cffd..747dd59 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 _0xb1d3=['jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','params','rawAttributes','include','options','catch','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xb1d3,0x8f));var _0x3b1d=function(_0x318632,_0x5c52f7){_0x318632=_0x318632-0x0;var _0x1a520b=_0xb1d3[_0x318632];return _0x1a520b;};'use strict';var emlformat=require(_0x3b1d('0x0'));var rimraf=require(_0x3b1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b1d('0x2'));var rp=require(_0x3b1d('0x3'));var moment=require(_0x3b1d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b1d('0x5'));var util=require(_0x3b1d('0x6'));var path=require(_0x3b1d('0x7'));var sox=require(_0x3b1d('0x8'));var csv=require('to-csv');var ejs=require(_0x3b1d('0x9'));var fs=require('fs');var fs_extra=require(_0x3b1d('0xa'));var _=require(_0x3b1d('0xb'));var squel=require('squel');var crypto=require(_0x3b1d('0xc'));var jsforce=require(_0x3b1d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3b1d('0xe'));var querystring=require(_0x3b1d('0xf'));var Papa=require(_0x3b1d('0x10'));var Redis=require(_0x3b1d('0x11'));var authService=require(_0x3b1d('0x12'));var qs=require(_0x3b1d('0x13'));var as=require(_0x3b1d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3b1d('0x15'));var utils=require(_0x3b1d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3b1d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e6724,_0xc9d35b){_0xc9d35b=_0xc9d35b||0xcc;return function(_0x2f6aac){if(_0x2f6aac){return _0x3e6724[_0x3b1d('0x18')](_0xc9d35b);}return _0x3e6724['status'](_0xc9d35b)['end']();};}function respondWithResult(_0x42245e,_0x2cca5f){_0x2cca5f=_0x2cca5f||0xc8;return function(_0x577a3c){if(_0x577a3c){return _0x42245e[_0x3b1d('0x19')](_0x2cca5f)[_0x3b1d('0x1a')](_0x577a3c);}};}function respondWithFilteredResult(_0x57a9d0,_0x30cb96){return function(_0x59ec43){if(_0x59ec43){var _0x210799=typeof _0x30cb96[_0x3b1d('0x1b')]===_0x3b1d('0x1c')&&typeof _0x30cb96[_0x3b1d('0x1d')]===_0x3b1d('0x1c');var _0x3b6287=_0x59ec43[_0x3b1d('0x1e')];var _0xfabc1e=_0x210799?0x0:_0x30cb96[_0x3b1d('0x1b')];var _0x330dbc=_0x210799?_0x59ec43[_0x3b1d('0x1e')]:_0x30cb96[_0x3b1d('0x1b')]+_0x30cb96[_0x3b1d('0x1d')];var _0x59a28b;if(_0x330dbc>=_0x3b6287){_0x330dbc=_0x3b6287;_0x59a28b=0xc8;}else{_0x59a28b=0xce;}_0x57a9d0['status'](_0x59a28b);return _0x57a9d0[_0x3b1d('0x1f')](_0x3b1d('0x20'),_0xfabc1e+'-'+_0x330dbc+'/'+_0x3b6287)[_0x3b1d('0x1a')](_0x59ec43);}return null;};}function patchUpdates(_0x4758f8){return function(_0x319d18){try{jsonpatch[_0x3b1d('0x21')](_0x319d18,_0x4758f8,!![]);}catch(_0x2c8552){return BPromise['reject'](_0x2c8552);}return _0x319d18[_0x3b1d('0x22')]();};}function saveUpdates(_0x167950,_0x42274e){return function(_0x59a52f){if(_0x59a52f){return _0x59a52f[_0x3b1d('0x23')](_0x167950)[_0x3b1d('0x24')](function(_0x9976){return _0x9976;});}return null;};}function removeEntity(_0x186b27,_0x19164c){return function(_0x145049){if(_0x145049){return _0x145049[_0x3b1d('0x25')]()['then'](function(){_0x186b27['status'](0xcc)[_0x3b1d('0x26')]();});}};}function handleEntityNotFound(_0x210764,_0x3a2d26){return function(_0x2cd8f1){if(!_0x2cd8f1){_0x210764[_0x3b1d('0x18')](0x194);}return _0x2cd8f1;};}function handleError(_0x583176,_0x1b1fc3){_0x1b1fc3=_0x1b1fc3||0x1f4;return function(_0x159da8){logger[_0x3b1d('0x27')](_0x159da8[_0x3b1d('0x28')]);if(_0x159da8['name']){delete _0x159da8[_0x3b1d('0x29')];}_0x583176[_0x3b1d('0x19')](_0x1b1fc3)[_0x3b1d('0x2a')](_0x159da8);};}exports[_0x3b1d('0x2b')]=function(_0x2d2795,_0x4faf23){var _0x2d1c26={},_0x5ad1e4={},_0x43a33c={'count':0x0,'rows':[]};var _0x16df74=_[_0x3b1d('0x2c')](db[_0x3b1d('0x2d')]['rawAttributes'],function(_0x338f97){return{'name':_0x338f97[_0x3b1d('0x2e')],'type':_0x338f97[_0x3b1d('0x2f')][_0x3b1d('0x30')]};});_0x5ad1e4[_0x3b1d('0x31')]=_[_0x3b1d('0x2c')](_0x16df74,_0x3b1d('0x29'));_0x5ad1e4[_0x3b1d('0x32')]=_[_0x3b1d('0x33')](_0x2d2795[_0x3b1d('0x32')]);_0x5ad1e4[_0x3b1d('0x34')]=_[_0x3b1d('0x35')](_0x5ad1e4[_0x3b1d('0x31')],_0x5ad1e4['query']);_0x2d1c26[_0x3b1d('0x36')]=_[_0x3b1d('0x35')](_0x5ad1e4[_0x3b1d('0x31')],qs[_0x3b1d('0x37')](_0x2d2795[_0x3b1d('0x32')][_0x3b1d('0x37')]));_0x2d1c26[_0x3b1d('0x36')]=_0x2d1c26[_0x3b1d('0x36')][_0x3b1d('0x38')]?_0x2d1c26[_0x3b1d('0x36')]:_0x5ad1e4[_0x3b1d('0x31')];if(!_0x2d2795[_0x3b1d('0x32')][_0x3b1d('0x39')](_0x3b1d('0x3a'))){_0x2d1c26[_0x3b1d('0x1d')]=qs[_0x3b1d('0x1d')](_0x2d2795[_0x3b1d('0x32')]['limit']);_0x2d1c26[_0x3b1d('0x1b')]=qs['offset'](_0x2d2795[_0x3b1d('0x32')]['offset']);}_0x2d1c26[_0x3b1d('0x3b')]=qs[_0x3b1d('0x3c')](_0x2d2795[_0x3b1d('0x32')][_0x3b1d('0x3c')]);_0x2d1c26[_0x3b1d('0x3d')]=qs[_0x3b1d('0x34')](_[_0x3b1d('0x3e')](_0x2d2795[_0x3b1d('0x32')],_0x5ad1e4[_0x3b1d('0x34')]),_0x16df74);if(_0x2d2795['query'][_0x3b1d('0x3f')]){_0x2d1c26[_0x3b1d('0x3d')]=_[_0x3b1d('0x40')](_0x2d1c26[_0x3b1d('0x3d')],{'$or':_['map'](_0x16df74,function(_0x9773ea){if(_0x9773ea[_0x3b1d('0x2f')]!==_0x3b1d('0x41')){var _0xdd2f0={};_0xdd2f0[_0x9773ea[_0x3b1d('0x29')]]={'$like':'%'+_0x2d2795[_0x3b1d('0x32')][_0x3b1d('0x3f')]+'%'};return _0xdd2f0;}})});}_0x2d1c26=_[_0x3b1d('0x40')]({},_0x2d1c26,_0x2d2795['options']);var _0x451cc3={'where':_0x2d1c26[_0x3b1d('0x3d')]};return db[_0x3b1d('0x2d')][_0x3b1d('0x1e')](_0x451cc3)['then'](function(_0xf5c18e){_0x43a33c[_0x3b1d('0x1e')]=_0xf5c18e;if(_0x2d2795[_0x3b1d('0x32')][_0x3b1d('0x42')]){_0x2d1c26['include']=[{'all':!![]}];}return db[_0x3b1d('0x2d')][_0x3b1d('0x43')](_0x2d1c26);})[_0x3b1d('0x24')](function(_0x5ac6f5){_0x43a33c['rows']=_0x5ac6f5;return _0x43a33c;})[_0x3b1d('0x24')](respondWithFilteredResult(_0x4faf23,_0x2d1c26))['catch'](handleError(_0x4faf23,null));};exports[_0x3b1d('0x44')]=function(_0x22a25c,_0x6cb1f9){var _0x5d2204={'raw':!![],'where':{'id':_0x22a25c[_0x3b1d('0x45')]['id']}},_0x346a64={};_0x346a64[_0x3b1d('0x31')]=_[_0x3b1d('0x33')](db[_0x3b1d('0x2d')][_0x3b1d('0x46')]);_0x346a64[_0x3b1d('0x32')]=_[_0x3b1d('0x33')](_0x22a25c[_0x3b1d('0x32')]);_0x346a64['filters']=_[_0x3b1d('0x35')](_0x346a64[_0x3b1d('0x31')],_0x346a64[_0x3b1d('0x32')]);_0x5d2204[_0x3b1d('0x36')]=_[_0x3b1d('0x35')](_0x346a64[_0x3b1d('0x31')],qs[_0x3b1d('0x37')](_0x22a25c[_0x3b1d('0x32')][_0x3b1d('0x37')]));_0x5d2204['attributes']=_0x5d2204[_0x3b1d('0x36')][_0x3b1d('0x38')]?_0x5d2204[_0x3b1d('0x36')]:_0x346a64['model'];if(_0x22a25c[_0x3b1d('0x32')][_0x3b1d('0x42')]){_0x5d2204[_0x3b1d('0x47')]=[{'all':!![]}];}_0x5d2204=_[_0x3b1d('0x40')]({},_0x5d2204,_0x22a25c[_0x3b1d('0x48')]);return db['SquareDetailsReport']['find'](_0x5d2204)[_0x3b1d('0x24')](handleEntityNotFound(_0x6cb1f9,null))[_0x3b1d('0x24')](respondWithResult(_0x6cb1f9,null))[_0x3b1d('0x49')](handleError(_0x6cb1f9,null));};exports[_0x3b1d('0x4a')]=function(_0x2acfb4,_0xd672d5){return db[_0x3b1d('0x2d')]['create'](_0x2acfb4[_0x3b1d('0x4b')],{})[_0x3b1d('0x24')](respondWithResult(_0xd672d5,0xc9))[_0x3b1d('0x49')](handleError(_0xd672d5,null));};exports[_0x3b1d('0x23')]=function(_0x33398e,_0x548e39){if(_0x33398e['body']['id']){delete _0x33398e[_0x3b1d('0x4b')]['id'];}return db['SquareDetailsReport'][_0x3b1d('0x4c')]({'where':{'id':_0x33398e[_0x3b1d('0x45')]['id']}})[_0x3b1d('0x24')](handleEntityNotFound(_0x548e39,null))[_0x3b1d('0x24')](saveUpdates(_0x33398e[_0x3b1d('0x4b')],null))[_0x3b1d('0x24')](respondWithResult(_0x548e39,null))[_0x3b1d('0x49')](handleError(_0x548e39,null));};exports[_0x3b1d('0x25')]=function(_0xf61144,_0x1f3d91){return db[_0x3b1d('0x2d')][_0x3b1d('0x4c')]({'where':{'id':_0xf61144[_0x3b1d('0x45')]['id']}})[_0x3b1d('0x24')](handleEntityNotFound(_0x1f3d91,null))[_0x3b1d('0x24')](removeEntity(_0x1f3d91,null))[_0x3b1d('0x49')](handleError(_0x1f3d91,null));};exports[_0x3b1d('0x4d')]=function(_0x1678c3,_0x6e245c){return db['SquareDetailsReport'][_0x3b1d('0x4d')]()[_0x3b1d('0x24')](respondWithResult(_0x6e245c,null))[_0x3b1d('0x49')](handleError(_0x6e245c,null));}; \ No newline at end of file +var _0xd606=['map','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','SquareDetailsReport','includeAll','include','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','undefined','limit','count','offset','set','json','apply','reject','update','then','destroy','sendStatus','error','name','send','index'];(function(_0x5baead,_0x408864){var _0x3bc0c2=function(_0xa6081d){while(--_0xa6081d){_0x5baead['push'](_0x5baead['shift']());}};_0x3bc0c2(++_0x408864);}(_0xd606,0x1dc));var _0x6d60=function(_0x2a45a1,_0x2a1b79){_0x2a45a1=_0x2a45a1-0x0;var _0xb0808e=_0xd606[_0x2a45a1];return _0xb0808e;};'use strict';var emlformat=require(_0x6d60('0x0'));var rimraf=require(_0x6d60('0x1'));var zipdir=require(_0x6d60('0x2'));var jsonpatch=require(_0x6d60('0x3'));var rp=require('request-promise');var moment=require(_0x6d60('0x4'));var BPromise=require(_0x6d60('0x5'));var Mustache=require(_0x6d60('0x6'));var util=require(_0x6d60('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6d60('0x8'));var ejs=require(_0x6d60('0x9'));var fs=require('fs');var fs_extra=require(_0x6d60('0xa'));var _=require(_0x6d60('0xb'));var squel=require(_0x6d60('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d60('0x8'));var querystring=require(_0x6d60('0xd'));var Papa=require(_0x6d60('0xe'));var Redis=require(_0x6d60('0xf'));var authService=require(_0x6d60('0x10'));var qs=require(_0x6d60('0x11'));var as=require(_0x6d60('0x12'));var hardwareService=require(_0x6d60('0x13'));var logger=require(_0x6d60('0x14'))(_0x6d60('0x15'));var utils=require('../../config/utils');var config=require(_0x6d60('0x16'));var licenseUtil=require(_0x6d60('0x17'));var db=require(_0x6d60('0x18'))['db'];function respondWithStatusCode(_0x21a72d,_0x42199a){_0x42199a=_0x42199a||0xcc;return function(_0x5b7027){if(_0x5b7027){return _0x21a72d['sendStatus'](_0x42199a);}return _0x21a72d['status'](_0x42199a)[_0x6d60('0x19')]();};}function respondWithResult(_0x4f2ac0,_0x376d0f){_0x376d0f=_0x376d0f||0xc8;return function(_0x3f0b60){if(_0x3f0b60){return _0x4f2ac0['status'](_0x376d0f)['json'](_0x3f0b60);}};}function respondWithFilteredResult(_0x3e2766,_0x4465cb){return function(_0x5aa439){if(_0x5aa439){var _0x1e3a57=typeof _0x4465cb['offset']===_0x6d60('0x1a')&&typeof _0x4465cb[_0x6d60('0x1b')]===_0x6d60('0x1a');var _0x4d2867=_0x5aa439[_0x6d60('0x1c')];var _0x2e2b33=_0x1e3a57?0x0:_0x4465cb[_0x6d60('0x1d')];var _0x2cf3fb=_0x1e3a57?_0x5aa439['count']:_0x4465cb[_0x6d60('0x1d')]+_0x4465cb['limit'];var _0x5376bb;if(_0x2cf3fb>=_0x4d2867){_0x2cf3fb=_0x4d2867;_0x5376bb=0xc8;}else{_0x5376bb=0xce;}_0x3e2766['status'](_0x5376bb);return _0x3e2766[_0x6d60('0x1e')]('Content-Range',_0x2e2b33+'-'+_0x2cf3fb+'/'+_0x4d2867)[_0x6d60('0x1f')](_0x5aa439);}return null;};}function patchUpdates(_0x2f9f7b){return function(_0x2676a6){try{jsonpatch[_0x6d60('0x20')](_0x2676a6,_0x2f9f7b,!![]);}catch(_0x2bdb94){return BPromise[_0x6d60('0x21')](_0x2bdb94);}return _0x2676a6['save']();};}function saveUpdates(_0xb7f4d4,_0x22c702){return function(_0xa5cdc4){if(_0xa5cdc4){return _0xa5cdc4[_0x6d60('0x22')](_0xb7f4d4)[_0x6d60('0x23')](function(_0x2ab684){return _0x2ab684;});}return null;};}function removeEntity(_0x3559a5,_0x1e379d){return function(_0x4f80af){if(_0x4f80af){return _0x4f80af[_0x6d60('0x24')]()[_0x6d60('0x23')](function(){_0x3559a5['status'](0xcc)[_0x6d60('0x19')]();});}};}function handleEntityNotFound(_0x475779,_0x252c7f){return function(_0x552ac3){if(!_0x552ac3){_0x475779[_0x6d60('0x25')](0x194);}return _0x552ac3;};}function handleError(_0x24a491,_0x27ac7d){_0x27ac7d=_0x27ac7d||0x1f4;return function(_0x48486a){logger[_0x6d60('0x26')](_0x48486a['stack']);if(_0x48486a['name']){delete _0x48486a[_0x6d60('0x27')];}_0x24a491['status'](_0x27ac7d)[_0x6d60('0x28')](_0x48486a);};}exports[_0x6d60('0x29')]=function(_0x4f0141,_0x589375){var _0x260095={},_0x58b6de={},_0x272661={'count':0x0,'rows':[]};var _0x24fe48=_[_0x6d60('0x2a')](db['SquareDetailsReport']['rawAttributes'],function(_0x181815){return{'name':_0x181815['fieldName'],'type':_0x181815['type'][_0x6d60('0x2b')]};});_0x58b6de[_0x6d60('0x2c')]=_['map'](_0x24fe48,_0x6d60('0x27'));_0x58b6de[_0x6d60('0x2d')]=_[_0x6d60('0x2e')](_0x4f0141[_0x6d60('0x2d')]);_0x58b6de['filters']=_[_0x6d60('0x2f')](_0x58b6de[_0x6d60('0x2c')],_0x58b6de['query']);_0x260095['attributes']=_[_0x6d60('0x2f')](_0x58b6de['model'],qs[_0x6d60('0x30')](_0x4f0141['query'][_0x6d60('0x30')]));_0x260095[_0x6d60('0x31')]=_0x260095[_0x6d60('0x31')][_0x6d60('0x32')]?_0x260095[_0x6d60('0x31')]:_0x58b6de['model'];if(!_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x33')](_0x6d60('0x34'))){_0x260095[_0x6d60('0x1b')]=qs[_0x6d60('0x1b')](_0x4f0141['query'][_0x6d60('0x1b')]);_0x260095[_0x6d60('0x1d')]=qs[_0x6d60('0x1d')](_0x4f0141['query'][_0x6d60('0x1d')]);}_0x260095[_0x6d60('0x35')]=qs[_0x6d60('0x36')](_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x36')]);_0x260095[_0x6d60('0x37')]=qs['filters'](_[_0x6d60('0x38')](_0x4f0141['query'],_0x58b6de[_0x6d60('0x39')]),_0x24fe48);if(_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x3a')]){_0x260095['where']=_[_0x6d60('0x3b')](_0x260095['where'],{'$or':_[_0x6d60('0x2a')](_0x24fe48,function(_0x2ba7e6){if(_0x2ba7e6[_0x6d60('0x3c')]!==_0x6d60('0x3d')){var _0x1d7bab={};_0x1d7bab[_0x2ba7e6[_0x6d60('0x27')]]={'$like':'%'+_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x3a')]+'%'};return _0x1d7bab;}})});}_0x260095=_[_0x6d60('0x3b')]({},_0x260095,_0x4f0141[_0x6d60('0x3e')]);var _0x4fcb4b={'where':_0x260095[_0x6d60('0x37')]};return db[_0x6d60('0x3f')][_0x6d60('0x1c')](_0x4fcb4b)[_0x6d60('0x23')](function(_0x53e7e5){_0x272661[_0x6d60('0x1c')]=_0x53e7e5;if(_0x4f0141[_0x6d60('0x2d')][_0x6d60('0x40')]){_0x260095[_0x6d60('0x41')]=[{'all':!![]}];}return db[_0x6d60('0x3f')]['findAll'](_0x260095);})[_0x6d60('0x23')](function(_0x3cd044){_0x272661['rows']=_0x3cd044;return _0x272661;})[_0x6d60('0x23')](respondWithFilteredResult(_0x589375,_0x260095))[_0x6d60('0x42')](handleError(_0x589375,null));};exports[_0x6d60('0x43')]=function(_0x938922,_0x4048fa){var _0x2c4655={'raw':!![],'where':{'id':_0x938922[_0x6d60('0x44')]['id']}},_0x57a35c={};_0x57a35c[_0x6d60('0x2c')]=_['keys'](db[_0x6d60('0x3f')][_0x6d60('0x45')]);_0x57a35c[_0x6d60('0x2d')]=_[_0x6d60('0x2e')](_0x938922[_0x6d60('0x2d')]);_0x57a35c[_0x6d60('0x39')]=_[_0x6d60('0x2f')](_0x57a35c[_0x6d60('0x2c')],_0x57a35c[_0x6d60('0x2d')]);_0x2c4655[_0x6d60('0x31')]=_[_0x6d60('0x2f')](_0x57a35c[_0x6d60('0x2c')],qs[_0x6d60('0x30')](_0x938922[_0x6d60('0x2d')][_0x6d60('0x30')]));_0x2c4655[_0x6d60('0x31')]=_0x2c4655['attributes'][_0x6d60('0x32')]?_0x2c4655[_0x6d60('0x31')]:_0x57a35c['model'];if(_0x938922[_0x6d60('0x2d')]['includeAll']){_0x2c4655[_0x6d60('0x41')]=[{'all':!![]}];}_0x2c4655=_['merge']({},_0x2c4655,_0x938922[_0x6d60('0x3e')]);return db[_0x6d60('0x3f')][_0x6d60('0x46')](_0x2c4655)[_0x6d60('0x23')](handleEntityNotFound(_0x4048fa,null))[_0x6d60('0x23')](respondWithResult(_0x4048fa,null))[_0x6d60('0x42')](handleError(_0x4048fa,null));};exports[_0x6d60('0x47')]=function(_0x574dc2,_0x20fb16){return db[_0x6d60('0x3f')]['create'](_0x574dc2[_0x6d60('0x48')],{})[_0x6d60('0x23')](respondWithResult(_0x20fb16,0xc9))[_0x6d60('0x42')](handleError(_0x20fb16,null));};exports['update']=function(_0x479809,_0x497251){if(_0x479809[_0x6d60('0x48')]['id']){delete _0x479809['body']['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x479809[_0x6d60('0x44')]['id']}})[_0x6d60('0x23')](handleEntityNotFound(_0x497251,null))[_0x6d60('0x23')](saveUpdates(_0x479809[_0x6d60('0x48')],null))['then'](respondWithResult(_0x497251,null))['catch'](handleError(_0x497251,null));};exports[_0x6d60('0x24')]=function(_0x55a187,_0x290071){return db[_0x6d60('0x3f')]['find']({'where':{'id':_0x55a187[_0x6d60('0x44')]['id']}})[_0x6d60('0x23')](handleEntityNotFound(_0x290071,null))[_0x6d60('0x23')](removeEntity(_0x290071,null))[_0x6d60('0x42')](handleError(_0x290071,null));};exports[_0x6d60('0x49')]=function(_0x461020,_0x11ca5e){return db[_0x6d60('0x3f')][_0x6d60('0x49')]()['then'](respondWithResult(_0x11ca5e,null))['catch'](handleError(_0x11ca5e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 20f7327..c07e863 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 _0x705c=['define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1e9b82,_0x149177){var _0x4afca3=function(_0x489636){while(--_0x489636){_0x1e9b82['push'](_0x1e9b82['shift']());}};_0x4afca3(++_0x149177);}(_0x705c,0x1a3));var _0xc705=function(_0x5ce101,_0x38ff61){_0x5ce101=_0x5ce101-0x0;var _0x3bcb84=_0x705c[_0x5ce101];return _0x3bcb84;};'use strict';var _=require(_0xc705('0x0'));var util=require('util');var logger=require(_0xc705('0x1'))(_0xc705('0x2'));var moment=require(_0xc705('0x3'));var BPromise=require(_0xc705('0x4'));var rp=require(_0xc705('0x5'));var fs=require('fs');var path=require(_0xc705('0x6'));var rimraf=require(_0xc705('0x7'));var config=require(_0xc705('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0xc705('0x9')]=function(_0x14ebab,_0x42174a){return _0x14ebab[_0xc705('0xa')](_0xc705('0xb'),attributes,{'tableName':_0xc705('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef24=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2d61ac,_0x18ff36){var _0x3f7d3c=function(_0x2ba7e5){while(--_0x2ba7e5){_0x2d61ac['push'](_0x2d61ac['shift']());}};_0x3f7d3c(++_0x18ff36);}(_0xef24,0x1dc));var _0x4ef2=function(_0x3e5146,_0x5f252a){_0x3e5146=_0x3e5146-0x0;var _0x13e5a5=_0xef24[_0x3e5146];return _0x13e5a5;};'use strict';var _=require(_0x4ef2('0x0'));var util=require('util');var logger=require(_0x4ef2('0x1'))(_0x4ef2('0x2'));var moment=require(_0x4ef2('0x3'));var BPromise=require(_0x4ef2('0x4'));var rp=require(_0x4ef2('0x5'));var fs=require('fs');var path=require(_0x4ef2('0x6'));var rimraf=require(_0x4ef2('0x7'));var config=require(_0x4ef2('0x8'));var attributes=require(_0x4ef2('0x9'));module['exports']=function(_0x3b698b,_0x8ba705){return _0x3b698b[_0x4ef2('0xa')](_0x4ef2('0xb'),attributes,{'tableName':_0x4ef2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 77f1f56..0492dc5 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 _0x93e6=['error','code','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','stringify','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3d43e3,_0x2a3110){var _0x4880c3=function(_0x271d6d){while(--_0x271d6d){_0x3d43e3['push'](_0x3d43e3['shift']());}};_0x4880c3(++_0x2a3110);}(_0x93e6,0x11e));var _0x693e=function(_0x186295,_0x9f2aa1){_0x186295=_0x186295-0x0;var _0x211029=_0x93e6[_0x186295];return _0x211029;};'use strict';var _=require(_0x693e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x693e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x693e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x693e('0x3'));var logger=require(_0x693e('0x4'))(_0x693e('0x5'));var config=require('../../config/environment');var jayson=require(_0x693e('0x6'));var client=jayson[_0x693e('0x7')][_0x693e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x520113,_0x577dcb,_0x57897c){return new BPromise(function(_0x155601,_0x4b30f6){return client[_0x693e('0x9')](_0x520113,_0x57897c)[_0x693e('0xa')](function(_0x14b901){logger['info'](_0x693e('0xb'),_0x577dcb,'request\x20sent');logger[_0x693e('0xc')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x577dcb,_0x693e('0xd'),JSON['stringify'](_0x14b901));if(_0x14b901['error']){if(_0x14b901[_0x693e('0xe')][_0x693e('0xf')]===0x1f4){logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0x14b901['error'][_0x693e('0x10')]);return _0x4b30f6(_0x14b901[_0x693e('0xe')][_0x693e('0x10')]);}logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0x14b901[_0x693e('0xe')][_0x693e('0x10')]);return _0x155601(_0x14b901['error'][_0x693e('0x10')]);}else{logger[_0x693e('0x11')](_0x693e('0xb'),_0x577dcb,'request\x20sent');_0x155601(_0x14b901[_0x693e('0x12')][_0x693e('0x10')]);}})[_0x693e('0x13')](function(_0xb3a90a){logger[_0x693e('0xe')](_0x693e('0xb'),_0x577dcb,_0xb3a90a);_0x4b30f6(_0xb3a90a);});});}exports[_0x693e('0x14')]=function(_0x4f4264){var _0x593916=this;return new Promise(function(_0x5e842f,_0x149325){return db[_0x693e('0x15')]['create'](_0x4f4264['body'],{'raw':_0x4f4264[_0x693e('0x16')]?_0x4f4264[_0x693e('0x16')][_0x693e('0x17')]===undefined?!![]:![]:!![]})[_0x693e('0xa')](function(_0x49614c){logger[_0x693e('0x11')](_0x693e('0x14'),_0x4f4264);logger[_0x693e('0xc')]('CreateSquareDetailsReport',_0x4f4264,JSON[_0x693e('0x18')](_0x49614c));_0x5e842f(_0x49614c);})[_0x693e('0x13')](function(_0x569646){logger[_0x693e('0xe')](_0x693e('0x14'),_0x569646['message'],_0x4f4264);_0x149325(_0x593916[_0x693e('0xe')](0x1f4,_0x569646[_0x693e('0x10')]));});});}; \ No newline at end of file +var _0xb03e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','then','util','moment'];(function(_0x59cde6,_0x245066){var _0x3e8b71=function(_0x45d090){while(--_0x45d090){_0x59cde6['push'](_0x59cde6['shift']());}};_0x3e8b71(++_0x245066);}(_0xb03e,0x1eb));var _0xeb03=function(_0x7f92fd,_0x1af189){_0x7f92fd=_0x7f92fd-0x0;var _0x3b228c=_0xb03e[_0x7f92fd];return _0x3b228c;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b58a2,_0x3d3322,_0x3a6e31){return new BPromise(function(_0x246c6e,_0x3f2c74){return client[_0xeb03('0xc')](_0x3b58a2,_0x3a6e31)['then'](function(_0x403b77){logger[_0xeb03('0xd')](_0xeb03('0xe'),_0x3d3322,'request\x20sent');logger[_0xeb03('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3d3322,_0xeb03('0x10'),JSON[_0xeb03('0x11')](_0x403b77));if(_0x403b77[_0xeb03('0x12')]){if(_0x403b77[_0xeb03('0x12')][_0xeb03('0x13')]===0x1f4){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x3f2c74(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}logger[_0xeb03('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x246c6e(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}else{logger['info'](_0xeb03('0xe'),_0x3d3322,_0xeb03('0x10'));_0x246c6e(_0x403b77[_0xeb03('0x15')]['message']);}})[_0xeb03('0x16')](function(_0x46dd1b){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x46dd1b);_0x3f2c74(_0x46dd1b);});});}exports[_0xeb03('0x17')]=function(_0x1b4cbd){var _0x167a33=this;return new Promise(function(_0x8d6725,_0x177f9c){return db[_0xeb03('0x18')][_0xeb03('0x19')](_0x1b4cbd[_0xeb03('0x1a')],{'raw':_0x1b4cbd[_0xeb03('0x1b')]?_0x1b4cbd[_0xeb03('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xeb03('0x1c')](function(_0x3855dd){logger[_0xeb03('0xd')](_0xeb03('0x17'),_0x1b4cbd);logger[_0xeb03('0xf')](_0xeb03('0x17'),_0x1b4cbd,JSON[_0xeb03('0x11')](_0x3855dd));_0x8d6725(_0x3855dd);})[_0xeb03('0x16')](function(_0x3c3d09){logger['error'](_0xeb03('0x17'),_0x3c3d09[_0xeb03('0x14')],_0x1b4cbd);_0x177f9c(_0x167a33[_0xeb03('0x12')](0x1f4,_0x3c3d09[_0xeb03('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index cbb02b3..94ab8fa 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 _0xe2af=['Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess','exports'];(function(_0x59a74c,_0x1df46b){var _0x10edf5=function(_0x461b1c){while(--_0x461b1c){_0x59a74c['push'](_0x59a74c['shift']());}};_0x10edf5(++_0x1df46b);}(_0xe2af,0xf5));var _0xfe2a=function(_0x991b1b,_0x41ffce){_0x991b1b=_0x991b1b-0x0;var _0x45e7ec=_0xe2af[_0x991b1b];return _0x45e7ec;};'use strict';var express=require('express');var router=express[_0xfe2a('0x0')]();var auth=require(_0xfe2a('0x1'));var controller=require('./system.controller');router[_0xfe2a('0x2')]('/',auth[_0xfe2a('0x3')](),controller['index']);router['get'](_0xfe2a('0x4'),auth[_0xfe2a('0x3')](),controller[_0xfe2a('0x5')]);module[_0xfe2a('0x6')]=router; \ No newline at end of file +var _0x39b7=['Router','../../components/auth/service','get','isAuthenticated','index','/process/:pid/kill','killProcess','express'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x39b7,0x15f));var _0x739b=function(_0x6e212,_0x3fd00a){_0x6e212=_0x6e212-0x0;var _0x296369=_0x39b7[_0x6e212];return _0x296369;};'use strict';var express=require(_0x739b('0x0'));var router=express[_0x739b('0x1')]();var auth=require(_0x739b('0x2'));var controller=require('./system.controller');router[_0x739b('0x3')]('/',auth[_0x739b('0x4')](),controller[_0x739b('0x5')]);router[_0x739b('0x3')](_0x739b('0x6'),auth['isAuthenticated'](),controller[_0x739b('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 6c81409..098bb1d 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 _0x1332=['status','json','catch','killProcess','components/import/cm','format','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData'];(function(_0x3984a6,_0x4adaba){var _0x2cc75f=function(_0x4a3849){while(--_0x4a3849){_0x3984a6['push'](_0x3984a6['shift']());}};_0x2cc75f(++_0x4adaba);}(_0x1332,0x97));var _0x2133=function(_0x4265a8,_0xeb4898){_0x4265a8=_0x4265a8-0x0;var _0x41ac66=_0x1332[_0x4265a8];return _0x41ac66;};'use strict';var info=require('systeminformation');var exec=require(_0x2133('0x0'))['exec'];var logger=require(_0x2133('0x1'))('api');var util=require(_0x2133('0x2'));var BPromise=require('bluebird');var _=require(_0x2133('0x3'));function handleError(_0x292417,_0x52970f,_0x7d4161){_0x52970f=_0x52970f||0x1f4;return function(_0x5bf4c4){logger[_0x2133('0x4')](_0x2133('0x5'),_0x7d4161,_0x52970f,util[_0x2133('0x6')](_0x5bf4c4,{'showHidden':![],'depth':null}));delete _0x5bf4c4[_0x2133('0x7')];_0x292417['status'](_0x52970f)[_0x2133('0x8')](_0x5bf4c4);};}exports[_0x2133('0x9')]=function(_0x53f274,_0x2f9d41){return info[_0x2133('0xa')]()['then'](function(_0x449a7c){return _0x2f9d41[_0x2133('0xb')](0xc8)[_0x2133('0xc')](_0x449a7c);})[_0x2133('0xd')](function(_0x54051c){return _0x2f9d41[_0x2133('0xb')](0x1f4)[_0x2133('0xc')](_0x54051c);});};exports[_0x2133('0xe')]=function(_0x403e75,_0x36428c){var _0x407825=[_0x2133('0xf')];return new BPromise(function(_0x250a13,_0x5cf980){return exec(util[_0x2133('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x403e75[_0x2133('0x11')][_0x2133('0x12')]),function(_0x137478,_0x5bb22b,_0x4bd932){if(_0x137478){return _0x5cf980(_0x137478);}return _0x250a13(_0x5bb22b);});})[_0x2133('0x13')](function(_0x3d1b95){var _0x4d07dc=![];var _0x2573bc=_0x3d1b95[_0x2133('0x14')](/\n/);for(var _0x18c33b=0x0,_0x163c71=_0x407825[_0x2133('0x15')];_0x18c33b<_0x163c71,_0x4d07dc===![];_0x18c33b+=0x1){if(_0x3d1b95[_0x2133('0x16')](_0x407825[_0x18c33b])>=0x0){_0x4d07dc=!![];}}if(!_0x4d07dc){throw new Error(util[_0x2133('0x10')](_0x2133('0x17'),_0x403e75[_0x2133('0x11')][_0x2133('0x12')]));}process[_0x2133('0x18')](_0x403e75[_0x2133('0x11')][_0x2133('0x12')],_0x2133('0x19'));return _0x36428c[_0x2133('0xb')](0xc8)[_0x2133('0xc')]({'message':util[_0x2133('0x10')](_0x2133('0x1a'),_0x403e75[_0x2133('0x11')][_0x2133('0x12')])});})['catch'](handleError(_0x36428c,null,_0x2133('0xe')));}; \ No newline at end of file +var _0xb0d1=['exec','error','inspect','status','getAllData','then','json','killProcess','components/import/cm','format','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation'];(function(_0x3f1b12,_0x3befaa){var _0x1c2d40=function(_0x505945){while(--_0x505945){_0x3f1b12['push'](_0x3f1b12['shift']());}};_0x1c2d40(++_0x3befaa);}(_0xb0d1,0x1f3));var _0x1b0d=function(_0x24ab0a,_0x439dd8){_0x24ab0a=_0x24ab0a-0x0;var _0x1d7fee=_0xb0d1[_0x24ab0a];return _0x1d7fee;};'use strict';var info=require(_0x1b0d('0x0'));var exec=require('child_process')[_0x1b0d('0x1')];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x1f98bb,_0x3fe934,_0x141c8b){_0x3fe934=_0x3fe934||0x1f4;return function(_0x41faa4){logger[_0x1b0d('0x2')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x141c8b,_0x3fe934,util[_0x1b0d('0x3')](_0x41faa4,{'showHidden':![],'depth':null}));delete _0x41faa4['name'];_0x1f98bb[_0x1b0d('0x4')](_0x3fe934)['send'](_0x41faa4);};}exports['index']=function(_0x4d255f,_0x1cde0b){return info[_0x1b0d('0x5')]()[_0x1b0d('0x6')](function(_0x2a4f61){return _0x1cde0b[_0x1b0d('0x4')](0xc8)[_0x1b0d('0x7')](_0x2a4f61);})['catch'](function(_0x36a06d){return _0x1cde0b[_0x1b0d('0x4')](0x1f4)[_0x1b0d('0x7')](_0x36a06d);});};exports[_0x1b0d('0x8')]=function(_0x367d94,_0x107293){var _0x255aed=[_0x1b0d('0x9')];return new BPromise(function(_0x40bcf7,_0x403d3d){return exec(util[_0x1b0d('0xa')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x367d94[_0x1b0d('0xb')][_0x1b0d('0xc')]),function(_0x56b5c6,_0x3389d6,_0x3f4741){if(_0x56b5c6){return _0x403d3d(_0x56b5c6);}return _0x40bcf7(_0x3389d6);});})['then'](function(_0x3bee0f){var _0x554213=![];var _0x40e403=_0x3bee0f['split'](/\n/);for(var _0x43d604=0x0,_0x464069=_0x255aed[_0x1b0d('0xd')];_0x43d604<_0x464069,_0x554213===![];_0x43d604+=0x1){if(_0x3bee0f[_0x1b0d('0xe')](_0x255aed[_0x43d604])>=0x0){_0x554213=!![];}}if(!_0x554213){throw new Error(util[_0x1b0d('0xa')](_0x1b0d('0xf'),_0x367d94['params'][_0x1b0d('0xc')]));}process[_0x1b0d('0x10')](_0x367d94[_0x1b0d('0xb')][_0x1b0d('0xc')],_0x1b0d('0x11'));return _0x107293[_0x1b0d('0x4')](0xc8)[_0x1b0d('0x7')]({'message':util[_0x1b0d('0xa')](_0x1b0d('0x12'),_0x367d94['params'][_0x1b0d('0xc')])});})[_0x1b0d('0x13')](handleError(_0x107293,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8fd27e3..a74a2ae 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 _0x7df3=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy'];(function(_0x1f045a,_0x2a12ea){var _0x22238b=function(_0x5aa2cd){while(--_0x5aa2cd){_0x1f045a['push'](_0x1f045a['shift']());}};_0x22238b(++_0x2a12ea);}(_0x7df3,0x109));var _0x37df=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7df3[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x37df('0x0'));var util=require(_0x37df('0x1'));var path=require('path');var timeout=require(_0x37df('0x2'));var express=require(_0x37df('0x3'));var router=express[_0x37df('0x4')]();var fs_extra=require(_0x37df('0x5'));var auth=require(_0x37df('0x6'));var interaction=require(_0x37df('0x7'));var config=require(_0x37df('0x8'));var controller=require(_0x37df('0x9'));router[_0x37df('0xa')]('/',auth['isAuthenticated'](),controller[_0x37df('0xb')]);router[_0x37df('0xa')](_0x37df('0xc'),auth['isAuthenticated'](),controller[_0x37df('0xd')]);router[_0x37df('0xe')]('/',auth[_0x37df('0xf')](),controller[_0x37df('0x10')]);router[_0x37df('0x11')]('/:id',auth[_0x37df('0xf')](),controller[_0x37df('0x12')]);router[_0x37df('0x13')](_0x37df('0xc'),auth[_0x37df('0xf')](),controller[_0x37df('0x14')]);module[_0x37df('0x15')]=router; \ No newline at end of file +var _0xbb68=['post','create','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','isAuthenticated','index','get','/:id','show'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbb68,0xad));var _0x8bb6=function(_0x4e76d3,_0x404356){_0x4e76d3=_0x4e76d3-0x0;var _0x3e6d6b=_0xbb68[_0x4e76d3];return _0x3e6d6b;};'use strict';var multer=require(_0x8bb6('0x0'));var util=require(_0x8bb6('0x1'));var path=require(_0x8bb6('0x2'));var timeout=require(_0x8bb6('0x3'));var express=require(_0x8bb6('0x4'));var router=express['Router']();var fs_extra=require(_0x8bb6('0x5'));var auth=require(_0x8bb6('0x6'));var interaction=require(_0x8bb6('0x7'));var config=require('../../config/environment');var controller=require(_0x8bb6('0x8'));router['get']('/',auth[_0x8bb6('0x9')](),controller[_0x8bb6('0xa')]);router[_0x8bb6('0xb')](_0x8bb6('0xc'),auth[_0x8bb6('0x9')](),controller[_0x8bb6('0xd')]);router[_0x8bb6('0xe')]('/',auth[_0x8bb6('0x9')](),controller[_0x8bb6('0xf')]);router['put']('/:id',auth[_0x8bb6('0x9')](),controller['update']);router[_0x8bb6('0x10')]('/:id',auth[_0x8bb6('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 7cb8e5d..c03cafa 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 _0x8caf=['STRING','name','#0091EA','exports'];(function(_0x24371d,_0x22fff0){var _0x58f9e3=function(_0x4e40f0){while(--_0x4e40f0){_0x24371d['push'](_0x24371d['shift']());}};_0x58f9e3(++_0x22fff0);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x1b1ed8,_0x2b0f38){_0x1b1ed8=_0x1b1ed8-0x0;var _0x33e1d6=_0x8caf[_0x1b1ed8];return _0x33e1d6;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'name':{'type':Sequelize[_0xf8ca('0x1')],'unique':_0xf8ca('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':_0xf8ca('0x3')},'description':{'type':Sequelize[_0xf8ca('0x1')]}}; \ No newline at end of file +var _0xa1aa=['STRING','name','#0091EA','exports'];(function(_0x26ce68,_0x2a4a2e){var _0x3c4a55=function(_0x1dd42b){while(--_0x1dd42b){_0x26ce68['push'](_0x26ce68['shift']());}};_0x3c4a55(++_0x2a4a2e);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x1050b,_0x466f66){_0x1050b=_0x1050b-0x0;var _0x27b8b2=_0xa1aa[_0x1050b];return _0x27b8b2;};'use strict';var Sequelize=require('sequelize');module[_0xaa1a('0x0')]={'name':{'type':Sequelize[_0xaa1a('0x1')],'unique':_0xaa1a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xaa1a('0x1')],'defaultValue':_0xaa1a('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index b6c9868..925b962 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 _0x9b87=['end','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Tag','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9b87,0x8e));var _0x79b8=function(_0x2f3183,_0x5998a3){_0x2f3183=_0x2f3183-0x0;var _0x87492d=_0x9b87[_0x2f3183];return _0x87492d;};'use strict';var emlformat=require(_0x79b8('0x0'));var rimraf=require(_0x79b8('0x1'));var zipdir=require(_0x79b8('0x2'));var jsonpatch=require(_0x79b8('0x3'));var rp=require(_0x79b8('0x4'));var moment=require(_0x79b8('0x5'));var BPromise=require(_0x79b8('0x6'));var Mustache=require(_0x79b8('0x7'));var util=require(_0x79b8('0x8'));var path=require(_0x79b8('0x9'));var sox=require(_0x79b8('0xa'));var csv=require(_0x79b8('0xb'));var ejs=require(_0x79b8('0xc'));var fs=require('fs');var fs_extra=require(_0x79b8('0xd'));var _=require(_0x79b8('0xe'));var squel=require(_0x79b8('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x79b8('0x10'));var Papa=require(_0x79b8('0x11'));var Redis=require(_0x79b8('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x79b8('0x13'));var as=require(_0x79b8('0x14'));var hardwareService=require(_0x79b8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x79b8('0x16'));var config=require(_0x79b8('0x17'));var licenseUtil=require(_0x79b8('0x18'));var db=require(_0x79b8('0x19'))['db'];function respondWithStatusCode(_0x21ad20,_0x33227b){_0x33227b=_0x33227b||0xcc;return function(_0x41095c){if(_0x41095c){return _0x21ad20[_0x79b8('0x1a')](_0x33227b);}return _0x21ad20[_0x79b8('0x1b')](_0x33227b)[_0x79b8('0x1c')]();};}function respondWithResult(_0x43ec09,_0x59e229){_0x59e229=_0x59e229||0xc8;return function(_0x150fb7){if(_0x150fb7){return _0x43ec09['status'](_0x59e229)['json'](_0x150fb7);}};}function respondWithFilteredResult(_0x3142e9,_0x21aae0){return function(_0x57a248){if(_0x57a248){var _0x5ddab5=typeof _0x21aae0[_0x79b8('0x1d')]==='undefined'&&typeof _0x21aae0['limit']===_0x79b8('0x1e');var _0x24c02f=_0x57a248[_0x79b8('0x1f')];var _0x2ae2d5=_0x5ddab5?0x0:_0x21aae0[_0x79b8('0x1d')];var _0x23d771=_0x5ddab5?_0x57a248['count']:_0x21aae0[_0x79b8('0x1d')]+_0x21aae0['limit'];var _0x53d386;if(_0x23d771>=_0x24c02f){_0x23d771=_0x24c02f;_0x53d386=0xc8;}else{_0x53d386=0xce;}_0x3142e9[_0x79b8('0x1b')](_0x53d386);return _0x3142e9[_0x79b8('0x20')](_0x79b8('0x21'),_0x2ae2d5+'-'+_0x23d771+'/'+_0x24c02f)[_0x79b8('0x22')](_0x57a248);}return null;};}function patchUpdates(_0x1e24cf){return function(_0x1e7507){try{jsonpatch[_0x79b8('0x23')](_0x1e7507,_0x1e24cf,!![]);}catch(_0x261c48){return BPromise[_0x79b8('0x24')](_0x261c48);}return _0x1e7507['save']();};}function saveUpdates(_0x3e9d83,_0x255207){return function(_0x4dbfcf){if(_0x4dbfcf){return _0x4dbfcf[_0x79b8('0x25')](_0x3e9d83)[_0x79b8('0x26')](function(_0x54c605){return _0x54c605;});}return null;};}function removeEntity(_0x28be4b,_0x4f543f){return function(_0x5e8228){if(_0x5e8228){return _0x5e8228[_0x79b8('0x27')]()[_0x79b8('0x26')](function(){var _0x262b48=_0x5e8228[_0x79b8('0x28')]({'plain':!![]});var _0x9deb6c='Tags';return db[_0x79b8('0x29')][_0x79b8('0x27')]({'where':{'type':_0x9deb6c,'resourceId':_0x262b48['id']}})[_0x79b8('0x26')](function(){return _0x5e8228;});})[_0x79b8('0x26')](function(){_0x28be4b['status'](0xcc)[_0x79b8('0x1c')]();});}};}function handleEntityNotFound(_0x2b6fad,_0x14a4d6){return function(_0x4aa92c){if(!_0x4aa92c){_0x2b6fad[_0x79b8('0x1a')](0x194);}return _0x4aa92c;};}function handleError(_0x4a4ef6,_0x43058e){_0x43058e=_0x43058e||0x1f4;return function(_0x2942e9){logger[_0x79b8('0x2a')](_0x2942e9[_0x79b8('0x2b')]);if(_0x2942e9['name']){delete _0x2942e9[_0x79b8('0x2c')];}_0x4a4ef6['status'](_0x43058e)[_0x79b8('0x2d')](_0x2942e9);};}exports['index']=function(_0x3b6a05,_0x1090d2){var _0x300755={},_0x55c631={},_0x1e03c1={'count':0x0,'rows':[]};var _0xc2decd=_[_0x79b8('0x2e')](db[_0x79b8('0x2f')]['rawAttributes'],function(_0x4cb644){return{'name':_0x4cb644['fieldName'],'type':_0x4cb644['type'][_0x79b8('0x30')]};});_0x55c631[_0x79b8('0x31')]=_['map'](_0xc2decd,_0x79b8('0x2c'));_0x55c631['query']=_['keys'](_0x3b6a05[_0x79b8('0x32')]);_0x55c631['filters']=_[_0x79b8('0x33')](_0x55c631[_0x79b8('0x31')],_0x55c631['query']);_0x300755[_0x79b8('0x34')]=_[_0x79b8('0x33')](_0x55c631[_0x79b8('0x31')],qs[_0x79b8('0x35')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x35')]));_0x300755['attributes']=_0x300755[_0x79b8('0x34')][_0x79b8('0x36')]?_0x300755[_0x79b8('0x34')]:_0x55c631[_0x79b8('0x31')];if(!_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x37')](_0x79b8('0x38'))){_0x300755[_0x79b8('0x39')]=qs[_0x79b8('0x39')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x39')]);_0x300755['offset']=qs[_0x79b8('0x1d')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x1d')]);}_0x300755['order']=qs[_0x79b8('0x3a')](_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x3a')]);_0x300755[_0x79b8('0x3b')]=qs[_0x79b8('0x3c')](_[_0x79b8('0x3d')](_0x3b6a05['query'],_0x55c631[_0x79b8('0x3c')]),_0xc2decd);if(_0x3b6a05['query']['filter']){_0x300755[_0x79b8('0x3b')]=_['merge'](_0x300755['where'],{'$or':_[_0x79b8('0x2e')](_0xc2decd,function(_0x1f211a){if(_0x1f211a[_0x79b8('0x3e')]!==_0x79b8('0x3f')){var _0x43d795={};_0x43d795[_0x1f211a[_0x79b8('0x2c')]]={'$like':'%'+_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x40')]+'%'};return _0x43d795;}})});}_0x300755=_[_0x79b8('0x41')]({},_0x300755,_0x3b6a05[_0x79b8('0x42')]);var _0x10f8e1={'where':_0x300755[_0x79b8('0x3b')]};return db[_0x79b8('0x2f')]['count'](_0x10f8e1)[_0x79b8('0x26')](function(_0x13b041){_0x1e03c1['count']=_0x13b041;if(_0x3b6a05[_0x79b8('0x32')][_0x79b8('0x43')]){_0x300755['include']=[{'all':!![]}];}return db[_0x79b8('0x2f')][_0x79b8('0x44')](_0x300755);})[_0x79b8('0x26')](function(_0x28d4e4){_0x1e03c1[_0x79b8('0x45')]=_0x28d4e4;return _0x1e03c1;})[_0x79b8('0x26')](respondWithFilteredResult(_0x1090d2,_0x300755))[_0x79b8('0x46')](handleError(_0x1090d2,null));};exports[_0x79b8('0x47')]=function(_0xb10351,_0x37ca43){var _0x31a1c1={'raw':!![],'where':{'id':_0xb10351['params']['id']}},_0x379217={};_0x379217['model']=_[_0x79b8('0x48')](db[_0x79b8('0x2f')][_0x79b8('0x49')]);_0x379217[_0x79b8('0x32')]=_['keys'](_0xb10351[_0x79b8('0x32')]);_0x379217[_0x79b8('0x3c')]=_[_0x79b8('0x33')](_0x379217[_0x79b8('0x31')],_0x379217['query']);_0x31a1c1[_0x79b8('0x34')]=_[_0x79b8('0x33')](_0x379217[_0x79b8('0x31')],qs[_0x79b8('0x35')](_0xb10351['query'][_0x79b8('0x35')]));_0x31a1c1[_0x79b8('0x34')]=_0x31a1c1[_0x79b8('0x34')][_0x79b8('0x36')]?_0x31a1c1[_0x79b8('0x34')]:_0x379217[_0x79b8('0x31')];if(_0xb10351['query'][_0x79b8('0x43')]){_0x31a1c1[_0x79b8('0x4a')]=[{'all':!![]}];}_0x31a1c1=_[_0x79b8('0x41')]({},_0x31a1c1,_0xb10351[_0x79b8('0x42')]);return db['Tag']['find'](_0x31a1c1)[_0x79b8('0x26')](handleEntityNotFound(_0x37ca43,null))[_0x79b8('0x26')](respondWithResult(_0x37ca43,null))[_0x79b8('0x46')](handleError(_0x37ca43,null));};exports[_0x79b8('0x4b')]=function(_0x32e7ea,_0x19272d){return db[_0x79b8('0x2f')][_0x79b8('0x4b')](_0x32e7ea[_0x79b8('0x4c')],{})['then'](function(_0x19ad75){var _0x374fe9=_0x32e7ea[_0x79b8('0x4d')]['get']({'plain':!![]});if(!_0x374fe9)throw new Error(_0x79b8('0x4e'));if(_0x374fe9['role']==='user'){var _0x24ebb2=_0x19ad75[_0x79b8('0x28')]({'plain':!![]});var _0x5b4d56=_0x79b8('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x5b4d56,'userProfileId':_0x374fe9[_0x79b8('0x50')]},'raw':!![]})[_0x79b8('0x26')](function(_0x14f722){if(_0x14f722&&_0x14f722[_0x79b8('0x51')]===0x0){return db[_0x79b8('0x29')][_0x79b8('0x4b')]({'name':_0x24ebb2[_0x79b8('0x2c')],'resourceId':_0x24ebb2['id'],'type':_0x14f722[_0x79b8('0x2c')],'sectionId':_0x14f722['id']},{})[_0x79b8('0x26')](function(){return _0x19ad75;});}else{return _0x19ad75;}})[_0x79b8('0x46')](function(_0x2455c6){logger[_0x79b8('0x2a')](_0x79b8('0x52'),_0x2455c6);throw _0x2455c6;});}return _0x19ad75;})[_0x79b8('0x26')](respondWithResult(_0x19272d,0xc9))['catch'](handleError(_0x19272d,null));};exports[_0x79b8('0x25')]=function(_0x16f272,_0x2eb440){if(_0x16f272[_0x79b8('0x4c')]['id']){delete _0x16f272['body']['id'];}return db['Tag'][_0x79b8('0x53')]({'where':{'id':_0x16f272[_0x79b8('0x54')]['id']}})[_0x79b8('0x26')](handleEntityNotFound(_0x2eb440,null))[_0x79b8('0x26')](saveUpdates(_0x16f272['body'],null))[_0x79b8('0x26')](respondWithResult(_0x2eb440,null))[_0x79b8('0x46')](handleError(_0x2eb440,null));};exports['destroy']=function(_0x8e0f70,_0x43efcf){return db[_0x79b8('0x2f')]['find']({'where':{'id':_0x8e0f70[_0x79b8('0x54')]['id']}})['then'](handleEntityNotFound(_0x43efcf,null))[_0x79b8('0x26')](removeEntity(_0x43efcf,null))[_0x79b8('0x46')](handleError(_0x43efcf,null));}; \ No newline at end of file +var _0xe739=['Tag','findAll','rows','show','params','length','includeAll','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe739,0x105));var _0x9e73=function(_0x2b2e56,_0xbaf589){_0x2b2e56=_0x2b2e56-0x0;var _0x3670cd=_0xe739[_0x2b2e56];return _0x3670cd;};'use strict';var emlformat=require(_0x9e73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9e73('0x1'));var jsonpatch=require(_0x9e73('0x2'));var rp=require(_0x9e73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e73('0x4'));var path=require(_0x9e73('0x5'));var sox=require(_0x9e73('0x6'));var csv=require(_0x9e73('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e73('0x8'));var _=require(_0x9e73('0x9'));var squel=require(_0x9e73('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e73('0xb'));var deskjs=require(_0x9e73('0xc'));var toCsv=require(_0x9e73('0x7'));var querystring=require(_0x9e73('0xd'));var Papa=require(_0x9e73('0xe'));var Redis=require(_0x9e73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e73('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e73('0x11'))('api');var utils=require(_0x9e73('0x12'));var config=require(_0x9e73('0x13'));var licenseUtil=require(_0x9e73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102bb9,_0x4696e2){_0x4696e2=_0x4696e2||0xcc;return function(_0x45c2d0){if(_0x45c2d0){return _0x102bb9[_0x9e73('0x15')](_0x4696e2);}return _0x102bb9['status'](_0x4696e2)[_0x9e73('0x16')]();};}function respondWithResult(_0x607981,_0x3a7bd5){_0x3a7bd5=_0x3a7bd5||0xc8;return function(_0x5be2fa){if(_0x5be2fa){return _0x607981[_0x9e73('0x17')](_0x3a7bd5)[_0x9e73('0x18')](_0x5be2fa);}};}function respondWithFilteredResult(_0x597492,_0x367857){return function(_0x327305){if(_0x327305){var _0x21bd3a=typeof _0x367857['offset']===_0x9e73('0x19')&&typeof _0x367857['limit']===_0x9e73('0x19');var _0x58bbaa=_0x327305[_0x9e73('0x1a')];var _0x48b1db=_0x21bd3a?0x0:_0x367857['offset'];var _0x419c5b=_0x21bd3a?_0x327305[_0x9e73('0x1a')]:_0x367857[_0x9e73('0x1b')]+_0x367857[_0x9e73('0x1c')];var _0x3e56d8;if(_0x419c5b>=_0x58bbaa){_0x419c5b=_0x58bbaa;_0x3e56d8=0xc8;}else{_0x3e56d8=0xce;}_0x597492[_0x9e73('0x17')](_0x3e56d8);return _0x597492[_0x9e73('0x1d')](_0x9e73('0x1e'),_0x48b1db+'-'+_0x419c5b+'/'+_0x58bbaa)[_0x9e73('0x18')](_0x327305);}return null;};}function patchUpdates(_0x3f56bf){return function(_0x4a5cd1){try{jsonpatch[_0x9e73('0x1f')](_0x4a5cd1,_0x3f56bf,!![]);}catch(_0x5c6bae){return BPromise[_0x9e73('0x20')](_0x5c6bae);}return _0x4a5cd1['save']();};}function saveUpdates(_0x31d354,_0x589a5d){return function(_0x2c2b32){if(_0x2c2b32){return _0x2c2b32[_0x9e73('0x21')](_0x31d354)['then'](function(_0x55704a){return _0x55704a;});}return null;};}function removeEntity(_0x127afd,_0x5c6322){return function(_0x256ea1){if(_0x256ea1){return _0x256ea1[_0x9e73('0x22')]()[_0x9e73('0x23')](function(){var _0x5117af=_0x256ea1[_0x9e73('0x24')]({'plain':!![]});var _0x3a845c='Tags';return db['UserProfileResource'][_0x9e73('0x22')]({'where':{'type':_0x3a845c,'resourceId':_0x5117af['id']}})['then'](function(){return _0x256ea1;});})['then'](function(){_0x127afd[_0x9e73('0x17')](0xcc)[_0x9e73('0x16')]();});}};}function handleEntityNotFound(_0x46991c,_0x47dcd2){return function(_0x368a70){if(!_0x368a70){_0x46991c[_0x9e73('0x15')](0x194);}return _0x368a70;};}function handleError(_0x4e77bb,_0xbbc614){_0xbbc614=_0xbbc614||0x1f4;return function(_0x24532d){logger[_0x9e73('0x25')](_0x24532d[_0x9e73('0x26')]);if(_0x24532d[_0x9e73('0x27')]){delete _0x24532d['name'];}_0x4e77bb[_0x9e73('0x17')](_0xbbc614)['send'](_0x24532d);};}exports[_0x9e73('0x28')]=function(_0x1ba338,_0xb3ef4f){var _0x15e4f3={},_0x2ef884={},_0x48d73c={'count':0x0,'rows':[]};var _0x11aaa7=_[_0x9e73('0x29')](db['Tag']['rawAttributes'],function(_0x296b93){return{'name':_0x296b93[_0x9e73('0x2a')],'type':_0x296b93[_0x9e73('0x2b')][_0x9e73('0x2c')]};});_0x2ef884[_0x9e73('0x2d')]=_[_0x9e73('0x29')](_0x11aaa7,'name');_0x2ef884[_0x9e73('0x2e')]=_[_0x9e73('0x2f')](_0x1ba338[_0x9e73('0x2e')]);_0x2ef884[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x2ef884[_0x9e73('0x2d')],_0x2ef884[_0x9e73('0x2e')]);_0x15e4f3[_0x9e73('0x32')]=_[_0x9e73('0x31')](_0x2ef884[_0x9e73('0x2d')],qs['fields'](_0x1ba338[_0x9e73('0x2e')][_0x9e73('0x33')]));_0x15e4f3[_0x9e73('0x32')]=_0x15e4f3[_0x9e73('0x32')]['length']?_0x15e4f3[_0x9e73('0x32')]:_0x2ef884[_0x9e73('0x2d')];if(!_0x1ba338['query']['hasOwnProperty'](_0x9e73('0x34'))){_0x15e4f3[_0x9e73('0x1c')]=qs[_0x9e73('0x1c')](_0x1ba338[_0x9e73('0x2e')][_0x9e73('0x1c')]);_0x15e4f3[_0x9e73('0x1b')]=qs['offset'](_0x1ba338['query']['offset']);}_0x15e4f3[_0x9e73('0x35')]=qs[_0x9e73('0x36')](_0x1ba338[_0x9e73('0x2e')]['sort']);_0x15e4f3['where']=qs['filters'](_[_0x9e73('0x37')](_0x1ba338[_0x9e73('0x2e')],_0x2ef884[_0x9e73('0x30')]),_0x11aaa7);if(_0x1ba338[_0x9e73('0x2e')]['filter']){_0x15e4f3[_0x9e73('0x38')]=_[_0x9e73('0x39')](_0x15e4f3[_0x9e73('0x38')],{'$or':_[_0x9e73('0x29')](_0x11aaa7,function(_0x28d10e){if(_0x28d10e[_0x9e73('0x2b')]!==_0x9e73('0x3a')){var _0x3431a8={};_0x3431a8[_0x28d10e[_0x9e73('0x27')]]={'$like':'%'+_0x1ba338[_0x9e73('0x2e')]['filter']+'%'};return _0x3431a8;}})});}_0x15e4f3=_['merge']({},_0x15e4f3,_0x1ba338['options']);var _0x510b69={'where':_0x15e4f3[_0x9e73('0x38')]};return db[_0x9e73('0x3b')]['count'](_0x510b69)[_0x9e73('0x23')](function(_0x2038fb){_0x48d73c['count']=_0x2038fb;if(_0x1ba338['query']['includeAll']){_0x15e4f3['include']=[{'all':!![]}];}return db['Tag'][_0x9e73('0x3c')](_0x15e4f3);})[_0x9e73('0x23')](function(_0xee1f5){_0x48d73c[_0x9e73('0x3d')]=_0xee1f5;return _0x48d73c;})['then'](respondWithFilteredResult(_0xb3ef4f,_0x15e4f3))['catch'](handleError(_0xb3ef4f,null));};exports[_0x9e73('0x3e')]=function(_0x2ad38a,_0x41c3af){var _0x37a43f={'raw':!![],'where':{'id':_0x2ad38a[_0x9e73('0x3f')]['id']}},_0x3f348f={};_0x3f348f['model']=_[_0x9e73('0x2f')](db[_0x9e73('0x3b')]['rawAttributes']);_0x3f348f[_0x9e73('0x2e')]=_[_0x9e73('0x2f')](_0x2ad38a['query']);_0x3f348f[_0x9e73('0x30')]=_[_0x9e73('0x31')](_0x3f348f['model'],_0x3f348f[_0x9e73('0x2e')]);_0x37a43f[_0x9e73('0x32')]=_[_0x9e73('0x31')](_0x3f348f[_0x9e73('0x2d')],qs[_0x9e73('0x33')](_0x2ad38a[_0x9e73('0x2e')][_0x9e73('0x33')]));_0x37a43f[_0x9e73('0x32')]=_0x37a43f[_0x9e73('0x32')][_0x9e73('0x40')]?_0x37a43f[_0x9e73('0x32')]:_0x3f348f[_0x9e73('0x2d')];if(_0x2ad38a[_0x9e73('0x2e')][_0x9e73('0x41')]){_0x37a43f[_0x9e73('0x42')]=[{'all':!![]}];}_0x37a43f=_[_0x9e73('0x39')]({},_0x37a43f,_0x2ad38a['options']);return db[_0x9e73('0x3b')]['find'](_0x37a43f)['then'](handleEntityNotFound(_0x41c3af,null))[_0x9e73('0x23')](respondWithResult(_0x41c3af,null))[_0x9e73('0x43')](handleError(_0x41c3af,null));};exports['create']=function(_0x4baaf7,_0x308e86){return db[_0x9e73('0x3b')][_0x9e73('0x44')](_0x4baaf7[_0x9e73('0x45')],{})[_0x9e73('0x23')](function(_0x4617da){var _0x2c55df=_0x4baaf7[_0x9e73('0x46')][_0x9e73('0x24')]({'plain':!![]});if(!_0x2c55df)throw new Error(_0x9e73('0x47'));if(_0x2c55df[_0x9e73('0x48')]===_0x9e73('0x46')){var _0x230249=_0x4617da[_0x9e73('0x24')]({'plain':!![]});var _0x5a5ba9=_0x9e73('0x49');return db[_0x9e73('0x4a')][_0x9e73('0x4b')]({'where':{'name':_0x5a5ba9,'userProfileId':_0x2c55df[_0x9e73('0x4c')]},'raw':!![]})[_0x9e73('0x23')](function(_0x28869a){if(_0x28869a&&_0x28869a[_0x9e73('0x4d')]===0x0){return db[_0x9e73('0x4e')]['create']({'name':_0x230249['name'],'resourceId':_0x230249['id'],'type':_0x28869a['name'],'sectionId':_0x28869a['id']},{})[_0x9e73('0x23')](function(){return _0x4617da;});}else{return _0x4617da;}})['catch'](function(_0x22f69a){logger['error'](_0x9e73('0x4f'),_0x22f69a);throw _0x22f69a;});}return _0x4617da;})['then'](respondWithResult(_0x308e86,0xc9))[_0x9e73('0x43')](handleError(_0x308e86,null));};exports[_0x9e73('0x21')]=function(_0x23e23d,_0x43c524){if(_0x23e23d[_0x9e73('0x45')]['id']){delete _0x23e23d[_0x9e73('0x45')]['id'];}return db[_0x9e73('0x3b')]['find']({'where':{'id':_0x23e23d[_0x9e73('0x3f')]['id']}})['then'](handleEntityNotFound(_0x43c524,null))[_0x9e73('0x23')](saveUpdates(_0x23e23d[_0x9e73('0x45')],null))[_0x9e73('0x23')](respondWithResult(_0x43c524,null))['catch'](handleError(_0x43c524,null));};exports[_0x9e73('0x22')]=function(_0x2e61eb,_0x50737d){return db[_0x9e73('0x3b')][_0x9e73('0x4b')]({'where':{'id':_0x2e61eb[_0x9e73('0x3f')]['id']}})[_0x9e73('0x23')](handleEntityNotFound(_0x50737d,null))[_0x9e73('0x23')](removeEntity(_0x50737d,null))['catch'](handleError(_0x50737d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0401556..532992f 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 _0x522b=['rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x11affa,_0x2d362e){var _0x1fcf40=function(_0x3c174){while(--_0x3c174){_0x11affa['push'](_0x11affa['shift']());}};_0x1fcf40(++_0x2d362e);}(_0x522b,0xf5));var _0xb522=function(_0x2b2c53,_0x4bcf9b){_0x2b2c53=_0x2b2c53-0x0;var _0x311ec2=_0x522b[_0x2b2c53];return _0x311ec2;};'use strict';var _=require(_0xb522('0x0'));var util=require(_0xb522('0x1'));var logger=require(_0xb522('0x2'))(_0xb522('0x3'));var moment=require(_0xb522('0x4'));var BPromise=require(_0xb522('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb522('0x6'));var rimraf=require(_0xb522('0x7'));var config=require(_0xb522('0x8'));var attributes=require(_0xb522('0x9'));module[_0xb522('0xa')]=function(_0x4374fd,_0xebe4ea){return _0x4374fd[_0xb522('0xb')](_0xb522('0xc'),attributes,{'tableName':_0xb522('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa9c=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x41bd4a,_0x133151){var _0x4dc9f0=function(_0x5d5f9d){while(--_0x5d5f9d){_0x41bd4a['push'](_0x41bd4a['shift']());}};_0x4dc9f0(++_0x133151);}(_0xaa9c,0x8d));var _0xcaa9=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xaa9c[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xcaa9('0x0'));var util=require(_0xcaa9('0x1'));var logger=require(_0xcaa9('0x2'))(_0xcaa9('0x3'));var moment=require('moment');var BPromise=require(_0xcaa9('0x4'));var rp=require(_0xcaa9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaa9('0x6'));var config=require(_0xcaa9('0x7'));var attributes=require(_0xcaa9('0x8'));module[_0xcaa9('0x9')]=function(_0xe4b71,_0x2d6e50){return _0xe4b71[_0xcaa9('0xa')](_0xcaa9('0xb'),attributes,{'tableName':_0xcaa9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 703500f..123f3b9 100644 --- a/server/api/tag/tag.rpc.js +++ b/server/api/tag/tag.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdd0c=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3198ac,_0x2f0549){var _0x4f3446=function(_0x9eeb64){while(--_0x9eeb64){_0x3198ac['push'](_0x3198ac['shift']());}};_0x4f3446(++_0x2f0549);}(_0xdd0c,0x165));var _0xcdd0=function(_0x5d3e85,_0xd6f856){_0x5d3e85=_0x5d3e85-0x0;var _0x32f592=_0xdd0c[_0x5d3e85];return _0x32f592;};'use strict';var _=require('lodash');var util=require(_0xcdd0('0x0'));var moment=require(_0xcdd0('0x1'));var BPromise=require(_0xcdd0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdd0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdd0('0x4'));var logger=require(_0xcdd0('0x5'))(_0xcdd0('0x6'));var config=require(_0xcdd0('0x7'));var jayson=require(_0xcdd0('0x8'));var client=jayson['client'][_0xcdd0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b6f5d,_0x1fd3f6,_0x15c402){return new BPromise(function(_0x337496,_0x557a65){return client[_0xcdd0('0xa')](_0x1b6f5d,_0x15c402)['then'](function(_0x5db720){logger[_0xcdd0('0xb')](_0xcdd0('0xc'),_0x1fd3f6,_0xcdd0('0xd'));logger[_0xcdd0('0xe')](_0xcdd0('0xf'),_0x1fd3f6,_0xcdd0('0xd'),JSON[_0xcdd0('0x10')](_0x5db720));if(_0x5db720[_0xcdd0('0x11')]){if(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x12')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x557a65(_0x5db720['error'][_0xcdd0('0x13')]);}logger[_0xcdd0('0x11')]('Tag,\x20%s,\x20%s',_0x1fd3f6,_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);return _0x337496(_0x5db720[_0xcdd0('0x11')][_0xcdd0('0x13')]);}else{logger[_0xcdd0('0xb')]('Tag,\x20%s,\x20%s',_0x1fd3f6,'request\x20sent');_0x337496(_0x5db720[_0xcdd0('0x14')][_0xcdd0('0x13')]);}})[_0xcdd0('0x15')](function(_0xf7af04){logger[_0xcdd0('0x11')](_0xcdd0('0xc'),_0x1fd3f6,_0xf7af04);_0x557a65(_0xf7af04);});});} \ No newline at end of file +var _0xfa2b=['jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x548ce0,_0x4baf45){var _0x40401a=function(_0x2abfa2){while(--_0x2abfa2){_0x548ce0['push'](_0x548ce0['shift']());}};_0x40401a(++_0x4baf45);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x2dd3b9,_0x58eb32){_0x2dd3b9=_0x2dd3b9-0x0;var _0x3f5771=_0xfa2b[_0x2dd3b9];return _0x3f5771;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Tag,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Tag,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 10d6f2a..9b27676 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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'));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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 400434f..e814a24 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x1fc7b9,_0x2b0ebb){var _0x2534a4=function(_0x54b5af){while(--_0x54b5af){_0x1fc7b9['push'](_0x1fc7b9['shift']());}};_0x2534a4(++_0x2b0ebb);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a0ca9,_0x2f952c){_0x4a0ca9=_0x4a0ca9-0x0;var _0x355a37=_0xb10b[_0x4a0ca9];return _0x355a37;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index a71736b..edf9c82 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 _0x1bd0=['capitalize','toLowerCase','sort','pick','Queues','addQueues','add','ids','removeQueues','findOne','remove','addAgents','isArray','Voice','Chat','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','Queue','findOrCreate','Queue:save','voicePause','UserVoiceQueueRt','upsert','interface','all','spread','Mail','Sms','removeAgents','emit','Queue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','map','Team','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filter','merge','includeAll','findAll','show','params','keys','length','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','UserProfileResource','catch','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','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','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','isValidChannel','channel','ValidationError','Unknown\x20channel'];(function(_0x460ade,_0x2f7635){var _0x353f20=function(_0x4cbd6a){while(--_0x4cbd6a){_0x460ade['push'](_0x460ade['shift']());}};_0x353f20(++_0x2f7635);}(_0x1bd0,0xbd));var _0x01bd=function(_0x5e2590,_0x5a6d7d){_0x5e2590=_0x5e2590-0x0;var _0x17aea4=_0x1bd0[_0x5e2590];return _0x17aea4;};'use strict';var emlformat=require(_0x01bd('0x0'));var rimraf=require(_0x01bd('0x1'));var zipdir=require(_0x01bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x01bd('0x3'));var moment=require('moment');var BPromise=require(_0x01bd('0x4'));var Mustache=require(_0x01bd('0x5'));var util=require(_0x01bd('0x6'));var path=require(_0x01bd('0x7'));var sox=require(_0x01bd('0x8'));var csv=require(_0x01bd('0x9'));var ejs=require(_0x01bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01bd('0xb'));var squel=require(_0x01bd('0xc'));var crypto=require('crypto');var jsforce=require(_0x01bd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x01bd('0x9'));var querystring=require(_0x01bd('0xe'));var Papa=require('papaparse');var Redis=require(_0x01bd('0xf'));var authService=require(_0x01bd('0x10'));var qs=require(_0x01bd('0x11'));var as=require(_0x01bd('0x12'));var hardwareService=require(_0x01bd('0x13'));var logger=require(_0x01bd('0x14'))('api');var utils=require(_0x01bd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x01bd('0x16'));var db=require('../../mysqldb')['db'];config[_0x01bd('0x17')]=_[_0x01bd('0x18')](config[_0x01bd('0x17')],{'host':_0x01bd('0x19'),'port':0x18eb});var socket=require(_0x01bd('0x1a'))(new Redis(config[_0x01bd('0x17')]));require(_0x01bd('0x1b'))[_0x01bd('0x1c')](socket);function respondWithStatusCode(_0x174da8,_0x4d2e11){_0x4d2e11=_0x4d2e11||0xcc;return function(_0x127630){if(_0x127630){return _0x174da8['sendStatus'](_0x4d2e11);}return _0x174da8[_0x01bd('0x1d')](_0x4d2e11)[_0x01bd('0x1e')]();};}function respondWithResult(_0x581e07,_0x36f17a){_0x36f17a=_0x36f17a||0xc8;return function(_0x49e21f){if(_0x49e21f){return _0x581e07[_0x01bd('0x1d')](_0x36f17a)[_0x01bd('0x1f')](_0x49e21f);}};}function respondWithFilteredResult(_0x3b265f,_0x1f2413){return function(_0x7f912f){if(_0x7f912f){var _0x3de8ed=typeof _0x1f2413[_0x01bd('0x20')]===_0x01bd('0x21')&&typeof _0x1f2413[_0x01bd('0x22')]===_0x01bd('0x21');var _0x37a36f=_0x7f912f['count'];var _0x1d8350=_0x3de8ed?0x0:_0x1f2413[_0x01bd('0x20')];var _0x146339=_0x3de8ed?_0x7f912f[_0x01bd('0x23')]:_0x1f2413[_0x01bd('0x20')]+_0x1f2413[_0x01bd('0x22')];var _0x3e8ad8;if(_0x146339>=_0x37a36f){_0x146339=_0x37a36f;_0x3e8ad8=0xc8;}else{_0x3e8ad8=0xce;}_0x3b265f[_0x01bd('0x1d')](_0x3e8ad8);return _0x3b265f['set'](_0x01bd('0x24'),_0x1d8350+'-'+_0x146339+'/'+_0x37a36f)[_0x01bd('0x1f')](_0x7f912f);}return null;};}function patchUpdates(_0x45c25e){return function(_0x3537b1){try{jsonpatch[_0x01bd('0x25')](_0x3537b1,_0x45c25e,!![]);}catch(_0x37ed72){return BPromise[_0x01bd('0x26')](_0x37ed72);}return _0x3537b1[_0x01bd('0x27')]();};}function saveUpdates(_0x1acbca,_0x1e457f){return function(_0x10c011){if(_0x10c011){return _0x10c011[_0x01bd('0x28')](_0x1acbca)[_0x01bd('0x29')](function(_0x35fd02){return _0x35fd02;});}return null;};}function handleEntityNotFound(_0x3d0882,_0x4d6d68){return function(_0x3c4491){if(!_0x3c4491){_0x3d0882[_0x01bd('0x2a')](0x194);}return _0x3c4491;};}function handleError(_0x1e89ee,_0x4c77b6){_0x4c77b6=_0x4c77b6||0x1f4;return function(_0x224997){logger[_0x01bd('0x2b')](_0x224997['stack']);if(_0x224997['name']){delete _0x224997[_0x01bd('0x2c')];}_0x1e89ee[_0x01bd('0x1d')](_0x4c77b6)[_0x01bd('0x2d')](_0x224997);};}exports['index']=function(_0x415985,_0x3fd457){var _0x44443a={},_0x11707a={},_0x1da76f={'count':0x0,'rows':[]};var _0x54f724=_[_0x01bd('0x2e')](db[_0x01bd('0x2f')][_0x01bd('0x30')],function(_0x2f390a){return{'name':_0x2f390a[_0x01bd('0x31')],'type':_0x2f390a[_0x01bd('0x32')][_0x01bd('0x33')]};});_0x11707a[_0x01bd('0x34')]=_[_0x01bd('0x2e')](_0x54f724,'name');_0x11707a[_0x01bd('0x35')]=_['keys'](_0x415985[_0x01bd('0x35')]);_0x11707a[_0x01bd('0x36')]=_[_0x01bd('0x37')](_0x11707a[_0x01bd('0x34')],_0x11707a[_0x01bd('0x35')]);_0x44443a[_0x01bd('0x38')]=_[_0x01bd('0x37')](_0x11707a[_0x01bd('0x34')],qs[_0x01bd('0x39')](_0x415985[_0x01bd('0x35')]['fields']));_0x44443a[_0x01bd('0x38')]=_0x44443a[_0x01bd('0x38')]['length']?_0x44443a[_0x01bd('0x38')]:_0x11707a['model'];if(!_0x415985[_0x01bd('0x35')][_0x01bd('0x3a')](_0x01bd('0x3b'))){_0x44443a[_0x01bd('0x22')]=qs[_0x01bd('0x22')](_0x415985[_0x01bd('0x35')][_0x01bd('0x22')]);_0x44443a[_0x01bd('0x20')]=qs[_0x01bd('0x20')](_0x415985[_0x01bd('0x35')][_0x01bd('0x20')]);}_0x44443a[_0x01bd('0x3c')]=qs['sort'](_0x415985[_0x01bd('0x35')]['sort']);_0x44443a[_0x01bd('0x3d')]=qs['filters'](_['pick'](_0x415985[_0x01bd('0x35')],_0x11707a['filters']),_0x54f724);if(_0x415985[_0x01bd('0x35')][_0x01bd('0x3e')]){_0x44443a[_0x01bd('0x3d')]=_['merge'](_0x44443a[_0x01bd('0x3d')],{'$or':_[_0x01bd('0x2e')](_0x54f724,function(_0x3878ad){if(_0x3878ad[_0x01bd('0x32')]!=='VIRTUAL'){var _0x22de7d={};_0x22de7d[_0x3878ad['name']]={'$like':'%'+_0x415985[_0x01bd('0x35')][_0x01bd('0x3e')]+'%'};return _0x22de7d;}})});}_0x44443a=_[_0x01bd('0x3f')]({},_0x44443a,_0x415985['options']);var _0x58a00a={'where':_0x44443a[_0x01bd('0x3d')]};return db['Team'][_0x01bd('0x23')](_0x58a00a)['then'](function(_0x1de9f5){_0x1da76f[_0x01bd('0x23')]=_0x1de9f5;if(_0x415985[_0x01bd('0x35')][_0x01bd('0x40')]){_0x44443a['include']=[{'all':!![]}];}return db[_0x01bd('0x2f')][_0x01bd('0x41')](_0x44443a);})['then'](function(_0x41d7fb){_0x1da76f['rows']=_0x41d7fb;return _0x1da76f;})[_0x01bd('0x29')](respondWithFilteredResult(_0x3fd457,_0x44443a))['catch'](handleError(_0x3fd457,null));};exports[_0x01bd('0x42')]=function(_0x4041ee,_0x47a25b){var _0x45d12d={'raw':![],'where':{'id':_0x4041ee[_0x01bd('0x43')]['id']}},_0x4ff269={};_0x4ff269[_0x01bd('0x34')]=_[_0x01bd('0x44')](db['Team'][_0x01bd('0x30')]);_0x4ff269[_0x01bd('0x35')]=_[_0x01bd('0x44')](_0x4041ee[_0x01bd('0x35')]);_0x4ff269[_0x01bd('0x36')]=_['intersection'](_0x4ff269[_0x01bd('0x34')],_0x4ff269[_0x01bd('0x35')]);_0x45d12d[_0x01bd('0x38')]=_[_0x01bd('0x37')](_0x4ff269[_0x01bd('0x34')],qs[_0x01bd('0x39')](_0x4041ee[_0x01bd('0x35')][_0x01bd('0x39')]));_0x45d12d[_0x01bd('0x38')]=_0x45d12d[_0x01bd('0x38')][_0x01bd('0x45')]?_0x45d12d['attributes']:_0x4ff269[_0x01bd('0x34')];if(_0x4041ee[_0x01bd('0x35')][_0x01bd('0x40')]){_0x45d12d[_0x01bd('0x46')]=[{'all':!![]}];}_0x45d12d=_[_0x01bd('0x3f')]({},_0x45d12d,_0x4041ee[_0x01bd('0x47')]);return db['Team'][_0x01bd('0x48')](_0x45d12d)[_0x01bd('0x29')](handleEntityNotFound(_0x47a25b,null))[_0x01bd('0x29')](respondWithResult(_0x47a25b,null))['catch'](handleError(_0x47a25b,null));};exports[_0x01bd('0x49')]=function(_0x532ff4,_0x161edb){return db['Team']['create'](_0x532ff4[_0x01bd('0x4a')],{})[_0x01bd('0x29')](function(_0x156a6d){var _0x53cac6=_0x532ff4['user'][_0x01bd('0x4b')]({'plain':!![]});if(!_0x53cac6)throw new Error(_0x01bd('0x4c'));if(_0x53cac6[_0x01bd('0x4d')]===_0x01bd('0x4e')){var _0x333a07=_0x156a6d[_0x01bd('0x4b')]({'plain':!![]});var _0x17d00e=_0x01bd('0x4f');return db[_0x01bd('0x50')][_0x01bd('0x48')]({'where':{'name':_0x17d00e,'userProfileId':_0x53cac6[_0x01bd('0x51')]},'raw':!![]})[_0x01bd('0x29')](function(_0x234810){if(_0x234810&&_0x234810['autoAssociation']===0x0){return db[_0x01bd('0x52')][_0x01bd('0x49')]({'name':_0x333a07[_0x01bd('0x2c')],'resourceId':_0x333a07['id'],'type':_0x234810[_0x01bd('0x2c')],'sectionId':_0x234810['id']},{})[_0x01bd('0x29')](function(){return _0x156a6d;});}else{return _0x156a6d;}})[_0x01bd('0x53')](function(_0x2232c7){logger[_0x01bd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2232c7);throw _0x2232c7;});}return _0x156a6d;})[_0x01bd('0x29')](respondWithResult(_0x161edb,0xc9))['catch'](handleError(_0x161edb,null));};exports[_0x01bd('0x28')]=function(_0x1ada3d,_0x242cc8){if(_0x1ada3d[_0x01bd('0x4a')]['id']){delete _0x1ada3d[_0x01bd('0x4a')]['id'];}return db['Team'][_0x01bd('0x48')]({'where':{'id':_0x1ada3d[_0x01bd('0x43')]['id']}})[_0x01bd('0x29')](handleEntityNotFound(_0x242cc8,null))[_0x01bd('0x29')](saveUpdates(_0x1ada3d[_0x01bd('0x4a')],null))[_0x01bd('0x29')](respondWithResult(_0x242cc8,null))[_0x01bd('0x53')](handleError(_0x242cc8,null));};exports[_0x01bd('0x54')]=function(_0x326664,_0x817702){var _0x4461e2=_0x326664[_0x01bd('0x43')]['id'];var _0x53cfba=[];return db[_0x01bd('0x55')][_0x01bd('0x56')](function(_0x45614e){var _0x38ff72='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x4461e2;return db[_0x01bd('0x55')]['query'](_0x38ff72,{'type':db[_0x01bd('0x57')][_0x01bd('0x58')][_0x01bd('0x59')],'raw':!![],'transaction':_0x45614e})[_0x01bd('0x29')](function(_0x14ce4d){_0x53cfba=_[_0x01bd('0x2e')](_0x14ce4d,function(_0x3d170d){return Number(_0x3d170d['UserId']);});})[_0x01bd('0x29')](function(){var _0x5811e9=_0x01bd('0x5a')+_0x4461e2;return db[_0x01bd('0x55')][_0x01bd('0x35')](_0x5811e9,{'type':db[_0x01bd('0x57')][_0x01bd('0x58')][_0x01bd('0x59')],'raw':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0x2d3363){var _0x3cdc62=_[_0x01bd('0x2e')](_0x2d3363,function(_0x19f41d){return Number(_0x19f41d[_0x01bd('0x5b')]);});return db[_0x01bd('0x5c')][_0x01bd('0x54')]({'where':{'UserId':{'$in':_0x53cfba},'VoiceQueueId':{'$in':_0x3cdc62}},'transaction':_0x45614e});})['then'](function(){var _0xdbc109=_0x01bd('0x5d')+_0x4461e2;return db[_0x01bd('0x55')][_0x01bd('0x35')](_0xdbc109,{'type':db['Sequelize'][_0x01bd('0x58')][_0x01bd('0x59')],'raw':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0xf6e0fb){var _0x433c2b=_[_0x01bd('0x2e')](_0xf6e0fb,function(_0x4daabd){return Number(_0x4daabd[_0x01bd('0x5e')]);});return db[_0x01bd('0x5f')][_0x01bd('0x54')]({'where':{'UserId':{'$in':_0x53cfba},'MailQueueId':{'$in':_0x433c2b}},'transaction':_0x45614e});})['then'](function(){var _0x8fdd86=_0x01bd('0x60')+_0x4461e2;return db['sequelize'][_0x01bd('0x35')](_0x8fdd86,{'type':db[_0x01bd('0x57')][_0x01bd('0x58')]['SELECT'],'raw':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0x1f607d){var _0x44e81a=_[_0x01bd('0x2e')](_0x1f607d,function(_0x387495){return Number(_0x387495[_0x01bd('0x61')]);});return db[_0x01bd('0x62')][_0x01bd('0x54')]({'where':{'UserId':{'$in':_0x53cfba},'SmsQueueId':{'$in':_0x44e81a}},'transaction':_0x45614e});})['then'](function(){var _0x5ce937=_0x01bd('0x63')+_0x4461e2;return db['sequelize']['query'](_0x5ce937,{'type':db[_0x01bd('0x57')][_0x01bd('0x58')]['SELECT'],'raw':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0x3ba091){var _0x3df1ea=_['map'](_0x3ba091,function(_0xd10443){return Number(_0xd10443[_0x01bd('0x64')]);});return db[_0x01bd('0x65')]['destroy']({'where':{'UserId':{'$in':_0x53cfba},'ChatQueueId':{'$in':_0x3df1ea}},'transaction':_0x45614e});})[_0x01bd('0x29')](function(){var _0x3df31c='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4461e2;return db[_0x01bd('0x55')]['query'](_0x3df31c,{'type':db['Sequelize'][_0x01bd('0x58')][_0x01bd('0x59')],'raw':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0x27d594){var _0x93300=_[_0x01bd('0x2e')](_0x27d594,function(_0x4cad86){return Number(_0x4cad86[_0x01bd('0x66')]);});return db[_0x01bd('0x67')]['destroy']({'where':{'UserId':{'$in':_0x53cfba},'FaxQueueId':{'$in':_0x93300}},'transaction':_0x45614e});})[_0x01bd('0x29')](function(){var _0x59da5e=_0x01bd('0x68')+_0x4461e2;return db[_0x01bd('0x55')][_0x01bd('0x35')](_0x59da5e,{'type':db[_0x01bd('0x57')]['QueryTypes'][_0x01bd('0x59')],'raw':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0xb5c5d8){var _0x4aca39=_[_0x01bd('0x2e')](_0xb5c5d8,function(_0x3937a2){return Number(_0x3937a2[_0x01bd('0x69')]);});return db[_0x01bd('0x6a')][_0x01bd('0x54')]({'where':{'UserId':{'$in':_0x53cfba},'OpenchannelQueueId':{'$in':_0x4aca39}},'transaction':_0x45614e});})[_0x01bd('0x29')](function(){var _0x3cace3='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4461e2;return db[_0x01bd('0x55')]['query'](_0x3cace3,{'type':db[_0x01bd('0x57')][_0x01bd('0x58')][_0x01bd('0x59')],'raw':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0x23710e){var _0x3141a8=_[_0x01bd('0x2e')](_0x23710e,function(_0x32e508){return Number(_0x32e508[_0x01bd('0x6b')]);});return db[_0x01bd('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x53cfba},'WhatsappQueueId':{'$in':_0x3141a8}},'transaction':_0x45614e});})[_0x01bd('0x29')](function(){return db[_0x01bd('0x6d')][_0x01bd('0x48')]({'where':{'TeamId':_0x4461e2}});})[_0x01bd('0x29')](function(_0x47f934){if(_0x47f934===null){return;}return db[_0x01bd('0x6e')][_0x01bd('0x54')]({'where':{'UserId':{'$in':_0x53cfba},'VoicePrefixId':_0x47f934[_0x01bd('0x6f')]},'transaction':_0x45614e});})[_0x01bd('0x29')](function(){return db['Team'][_0x01bd('0x54')]({'where':{'id':_0x4461e2},'cascade':!![],'transaction':_0x45614e});})[_0x01bd('0x29')](function(_0xe0b9f9){if(_0xe0b9f9===0x0){_0x817702[_0x01bd('0x2a')](0x194);}else{return db[_0x01bd('0x52')]['destroy']({'where':{'type':_0x01bd('0x4f'),'resourceId':_0x4461e2},'cascade':!![],'transaction':_0x45614e})[_0x01bd('0x29')](function(){_0x817702[_0x01bd('0x1d')](0xcc)['end']();});}})['catch'](function(_0x47a4bd){_0x817702[_0x01bd('0x1d')](0x1f4)['send'](_0x47a4bd);});});};exports[_0x01bd('0x70')]=function(_0x19d682,_0x5582cc,_0x2ed418){return db[_0x01bd('0x2f')]['findOne']({'where':{'id':_0x19d682[_0x01bd('0x43')]['id']}})[_0x01bd('0x29')](handleEntityNotFound(_0x5582cc,null))[_0x01bd('0x29')](function(_0x5ba656){if(!_0x19d682[_0x01bd('0x35')]['channel']||!utils[_0x01bd('0x71')](_0x19d682[_0x01bd('0x35')][_0x01bd('0x72')])){throw new db[(_0x01bd('0x57'))][(_0x01bd('0x73'))](_0x01bd('0x74'));}var _0x561bde={};var _0x20f2d0={};_0x20f2d0[_0x01bd('0x34')]=_[_0x01bd('0x44')](db[_[_0x01bd('0x75')](_0x19d682[_0x01bd('0x35')][_0x01bd('0x72')][_0x01bd('0x76')]())+'Queue'][_0x01bd('0x30')]);_0x20f2d0[_0x01bd('0x35')]=_[_0x01bd('0x44')](_0x19d682[_0x01bd('0x35')]);_0x20f2d0[_0x01bd('0x36')]=_[_0x01bd('0x37')](_0x20f2d0[_0x01bd('0x34')],_0x20f2d0[_0x01bd('0x35')]);_0x561bde[_0x01bd('0x38')]=_[_0x01bd('0x37')](_0x20f2d0['model'],qs[_0x01bd('0x39')](_0x19d682[_0x01bd('0x35')][_0x01bd('0x39')]));_0x561bde[_0x01bd('0x38')]=_0x561bde[_0x01bd('0x38')][_0x01bd('0x45')]?_0x561bde['attributes']:_0x20f2d0['model'];_0x561bde[_0x01bd('0x22')]=qs[_0x01bd('0x22')](_0x19d682['query']['limit']);_0x561bde[_0x01bd('0x20')]=qs[_0x01bd('0x20')](_0x19d682[_0x01bd('0x35')]['offset']);_0x561bde[_0x01bd('0x3c')]=qs['sort'](_0x19d682[_0x01bd('0x35')][_0x01bd('0x77')]);_0x561bde[_0x01bd('0x3d')]=qs['filters'](_[_0x01bd('0x78')](_0x19d682[_0x01bd('0x35')],_0x20f2d0[_0x01bd('0x36')]));_0x561bde=_['merge']({},_0x561bde,_0x19d682[_0x01bd('0x47')]);return _0x5ba656[_0x01bd('0x4b')+_[_0x01bd('0x75')](_0x19d682[_0x01bd('0x35')]['channel'][_0x01bd('0x76')]())+_0x01bd('0x79')](_0x561bde);})[_0x01bd('0x29')](respondWithResult(_0x5582cc,null))['catch'](handleError(_0x5582cc,null));};exports[_0x01bd('0x7a')]=function(_0x261066,_0x5bcdc5,_0x615176){return db[_0x01bd('0x2f')]['findOne']({'where':{'id':_0x261066['params']['id']}})[_0x01bd('0x29')](function(_0x19bd72){if(_0x19bd72){if(!_0x261066[_0x01bd('0x4a')]['channel']||!utils['isValidChannel'](_0x261066['body'][_0x01bd('0x72')])){throw new db[(_0x01bd('0x57'))]['ValidationError']('Unknown\x20channel');}return _0x19bd72[_0x01bd('0x7b')+_['capitalize'](_0x261066['body']['channel'][_0x01bd('0x76')]())+_0x01bd('0x79')](_0x261066[_0x01bd('0x4a')][_0x01bd('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x5bcdc5,null))[_0x01bd('0x29')](respondWithStatusCode(_0x5bcdc5,null))[_0x01bd('0x53')](handleError(_0x5bcdc5,null));};exports[_0x01bd('0x7d')]=function(_0x29631c,_0x5f1b24,_0x5e7242){return db[_0x01bd('0x2f')][_0x01bd('0x7e')]({'where':{'id':_0x29631c[_0x01bd('0x43')]['id']}})[_0x01bd('0x29')](function(_0x80576c){if(_0x80576c){if(!_0x29631c[_0x01bd('0x35')]['channel']||!utils[_0x01bd('0x71')](_0x29631c[_0x01bd('0x35')][_0x01bd('0x72')])){throw new db['Sequelize'][(_0x01bd('0x73'))](_0x01bd('0x74'));}return _0x80576c[_0x01bd('0x7f')+_[_0x01bd('0x75')](_0x29631c[_0x01bd('0x35')][_0x01bd('0x72')][_0x01bd('0x76')]())+_0x01bd('0x79')](_0x29631c[_0x01bd('0x35')][_0x01bd('0x7c')]);}return null;})[_0x01bd('0x29')](handleEntityNotFound(_0x5f1b24,null))[_0x01bd('0x29')](respondWithStatusCode(_0x5f1b24,null))[_0x01bd('0x53')](handleError(_0x5f1b24,null));};exports[_0x01bd('0x80')]=function(_0x3f9816,_0x51c31f){var _0xfe6ecc=_[_0x01bd('0x81')](_0x3f9816[_0x01bd('0x4a')][_0x01bd('0x7c')])?_0x3f9816[_0x01bd('0x4a')][_0x01bd('0x7c')]:[_0x3f9816[_0x01bd('0x4a')][_0x01bd('0x7c')]];var _0x51e343=_0x3f9816['params']['id'];return db[_0x01bd('0x2f')][_0x01bd('0x48')]({'where':{'id':_0x51e343}})['then'](handleEntityNotFound(_0x51c31f,null))[_0x01bd('0x29')](function(_0x21787b){if(_0x21787b){var _0x5224a6=[_0x01bd('0x82'),_0x01bd('0x83'),'Mail','Sms','Fax',_0x01bd('0x84'),_0x01bd('0x85')];return db[_0x01bd('0x55')][_0x01bd('0x56')](function(_0x579e52){var _0x53eeb0=_[_0x01bd('0x2e')](_0x5224a6,function(_0x337af3){var _0x38e3bc={'attributes':['id',_0x01bd('0x2c')]};if(_0x337af3==='Voice'){_0x38e3bc[_0x01bd('0x86')]={'attributes':[_0x01bd('0x87')]};}return _0x21787b['get'+_0x337af3+'Queues'](_0x38e3bc)[_0x01bd('0x29')](function(_0x3d0455){var _0xd30175=_[_0x01bd('0x2e')](_0x3d0455,function(_0x261368){var _0xda91a1=_[_0x01bd('0x2e')](_0xfe6ecc,function(_0x36c46d){var _0x4a2abc={'where':{'UserId':_0x36c46d,[_0x337af3+_0x01bd('0x88')]:_0x261368['id']},'transaction':_0x579e52};if(_0x337af3===_0x01bd('0x82')){_0x4a2abc[_0x01bd('0x18')]={'penalty':_0x261368[_0x01bd('0x89')][_0x01bd('0x87')]};}return db['User'+_0x337af3+_0x01bd('0x8a')][_0x01bd('0x8b')](_0x4a2abc)[_0x01bd('0x29')](function(){socket['emit'](_0x01bd('0x4e')+_0x337af3+_0x01bd('0x8c'),{'UserId':_0x36c46d,[_0x337af3+'QueueId']:_0x261368['id']});if(_0x337af3!==_0x01bd('0x82')){return;}return db['User']['findAll']({'where':{'id':_0xfe6ecc,'online':0x1},'attributes':['id','name','online',_0x01bd('0x8d'),'interface'],'raw':!![]})[_0x01bd('0x29')](function(_0x247816){var _0x8b9ea0=_[_0x01bd('0x2e')](_0x247816,function(_0x293750){return db[_0x01bd('0x8e')][_0x01bd('0x8f')]({'membername':_0x293750['name'],'UserId':_0x293750['id'],'queue_name':_0x261368[_0x01bd('0x2c')],'VoiceQueueId':_0x261368['id'],'interface':_['isNil'](_0x293750[_0x01bd('0x90')])?util['format']('SIP/%s',_0x293750[_0x01bd('0x2c')]):_0x293750[_0x01bd('0x90')],'paused':_0x293750[_0x01bd('0x8d')]||![],'penalty':_0x261368[_0x01bd('0x89')]['penalty']},{'transaction':_0x579e52});});return Promise[_0x01bd('0x91')](_0x8b9ea0);});});});return Promise[_0x01bd('0x91')](_0xda91a1);});return Promise[_0x01bd('0x91')](_0xd30175);})[_0x01bd('0x29')](function(){return db[_0x01bd('0x6d')][_0x01bd('0x7e')]({'where':{'teamId':_0x51e343}})['then'](function(_0x4cec44){if(_0x4cec44){var _0x3ddfb7=_['map'](_0xfe6ecc,function(_0x31ff40){db['UserVoicePrefix'][_0x01bd('0x8f')]({'UserId':_0x31ff40,'VoicePrefixId':_0x4cec44['VoicePrefixId']});});return Promise['all'](_0x3ddfb7);}});});});return Promise[_0x01bd('0x91')](_0x53eeb0)[_0x01bd('0x29')](function(){return _0x21787b['addAgents'](_0xfe6ecc,{'transaction':_0x579e52})[_0x01bd('0x92')](function(_0xf8f0e){return _0xf8f0e;});});});}})[_0x01bd('0x29')](respondWithResult(_0x51c31f,null))[_0x01bd('0x53')](handleError(_0x51c31f,null));};exports['removeAgents']=function(_0x2f260e,_0x348b5c){var _0x2990c9=_[_0x01bd('0x81')](_0x2f260e[_0x01bd('0x35')][_0x01bd('0x7c')])?_0x2f260e[_0x01bd('0x35')][_0x01bd('0x7c')]:[_0x2f260e[_0x01bd('0x35')][_0x01bd('0x7c')]];var _0x591b6a=_0x2f260e['params']['id'];return db[_0x01bd('0x2f')][_0x01bd('0x48')]({'where':{'id':_0x591b6a}})[_0x01bd('0x29')](handleEntityNotFound(_0x348b5c,null))[_0x01bd('0x29')](function(_0x5195d4){if(_0x5195d4){var _0x5ed4e9=[_0x01bd('0x82'),'Chat',_0x01bd('0x93'),_0x01bd('0x94'),'Fax',_0x01bd('0x84'),_0x01bd('0x85')];return db['sequelize']['transaction'](function(_0x508b1b){var _0x209737=_[_0x01bd('0x2e')](_0x5ed4e9,function(_0x1a33ed){var _0xa2574a={'attributes':['id',_0x01bd('0x2c')]};return _0x5195d4[_0x01bd('0x4b')+_0x1a33ed+_0x01bd('0x79')](_0xa2574a)[_0x01bd('0x29')](function(_0x50484a){var _0x52d928=_[_0x01bd('0x2e')](_0x50484a,function(_0x4ad865){return _0x4ad865[_0x01bd('0x95')](_0x2990c9,{'transaction':_0x508b1b})[_0x01bd('0x29')](function(){var _0x5a26e7=_[_0x01bd('0x2e')](_0x2990c9,function(_0x181788){socket[_0x01bd('0x96')](_0x01bd('0x4e')+_0x1a33ed+_0x01bd('0x97'),{'UserId':Number(_0x181788),[_0x1a33ed+_0x01bd('0x88')]:_0x4ad865['id']});if(_0x1a33ed!==_0x01bd('0x82')){return;}return db[_0x01bd('0x8e')]['destroy']({'where':{'VoiceQueueId':_0x4ad865['id'],'UserId':_0x181788},'transaction':_0x508b1b});});return Promise[_0x01bd('0x91')](_0x5a26e7);});});return Promise['all'](_0x52d928);});});return Promise[_0x01bd('0x91')](_0x209737)[_0x01bd('0x29')](function(){return _0x5195d4['removeAgents'](_0x2990c9,{'transaction':_0x508b1b});})['then'](function(){return db[_0x01bd('0x6d')]['findOne']({'where':{'teamId':_0x591b6a}})[_0x01bd('0x29')](function(_0x2f6e22){if(_0x2f6e22){var _0x4ffc2e=_[_0x01bd('0x2e')](_0x2990c9,function(_0x11c805){db[_0x01bd('0x6e')][_0x01bd('0x54')]({'where':{'UserId':_0x11c805,'VoicePrefixId':_0x2f6e22['VoicePrefixId']}});});return Promise[_0x01bd('0x91')](_0x4ffc2e);}});});});}})[_0x01bd('0x29')](respondWithStatusCode(_0x348b5c,null))[_0x01bd('0x53')](handleError(_0x348b5c,null));};exports[_0x01bd('0x98')]=function(_0x42a77e,_0x52ecb9,_0x35d574){var _0x4d5c92={};var _0x412324={};var _0x3a1bfd;var _0xbb4f20;return db['Team'][_0x01bd('0x7e')]({'where':{'id':_0x42a77e['params']['id']}})[_0x01bd('0x29')](handleEntityNotFound(_0x52ecb9,null))['then'](function(_0x480b28){if(_0x480b28){_0x3a1bfd=_0x480b28;_0x412324[_0x01bd('0x34')]=_[_0x01bd('0x44')](db['User'][_0x01bd('0x30')]);_0x412324[_0x01bd('0x35')]=_['keys'](_0x42a77e[_0x01bd('0x35')]);_0x412324['filters']=_[_0x01bd('0x37')](_0x412324['model'],_0x412324['query']);_0x4d5c92[_0x01bd('0x38')]=_[_0x01bd('0x37')](_0x412324[_0x01bd('0x34')],qs['fields'](_0x42a77e[_0x01bd('0x35')][_0x01bd('0x39')]));_0x4d5c92[_0x01bd('0x38')]=_0x4d5c92[_0x01bd('0x38')]['length']?_0x4d5c92[_0x01bd('0x38')]:_0x412324[_0x01bd('0x34')];_0x4d5c92[_0x01bd('0x3c')]=qs[_0x01bd('0x77')](_0x42a77e['query'][_0x01bd('0x77')]);_0x4d5c92[_0x01bd('0x3d')]=qs[_0x01bd('0x36')](_[_0x01bd('0x78')](_0x42a77e['query'],_0x412324[_0x01bd('0x36')]));if(_0x42a77e['query'][_0x01bd('0x3e')]){_0x4d5c92[_0x01bd('0x3d')]=_['merge'](_0x4d5c92[_0x01bd('0x3d')],{'$or':_[_0x01bd('0x2e')](_0x4d5c92[_0x01bd('0x38')],function(_0x2c5a48){var _0x20eb0f={};_0x20eb0f[_0x2c5a48]={'$like':'%'+_0x42a77e['query'][_0x01bd('0x3e')]+'%'};return _0x20eb0f;})});}_0x4d5c92=_[_0x01bd('0x3f')]({},_0x4d5c92,_0x42a77e['options']);return _0x3a1bfd[_0x01bd('0x98')](_0x4d5c92);}})[_0x01bd('0x29')](function(_0x2b0ccd){if(_0x2b0ccd){_0xbb4f20=_0x2b0ccd[_0x01bd('0x45')];if(!_0x42a77e[_0x01bd('0x35')][_0x01bd('0x3a')](_0x01bd('0x3b'))){_0x4d5c92['limit']=qs[_0x01bd('0x22')](_0x42a77e['query'][_0x01bd('0x22')]);_0x4d5c92[_0x01bd('0x20')]=qs[_0x01bd('0x20')](_0x42a77e[_0x01bd('0x35')]['offset']);}return _0x3a1bfd[_0x01bd('0x98')](_0x4d5c92);}})[_0x01bd('0x29')](function(_0xc0712e){if(_0xc0712e){return _0xc0712e?{'count':_0xbb4f20,'rows':_0xc0712e}:null;}})['then'](respondWithResult(_0x52ecb9,null))[_0x01bd('0x53')](handleError(_0x52ecb9,null));}; \ No newline at end of file +var _0xffb5=['fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','error','stack','name','send','map','Team','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','model','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','isValidChannel','channel','Unknown\x20channel','capitalize','toLowerCase','Queue','sort','pick','Queues','addQueues','findOne','ValidationError','ids','removeQueues','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','penalty','QueueId','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','isNil','format','TeamVoiceQueue','all','Mail','removeAgents','Queue:remove','TeamVoicePrefix','getAgents','rimraf','zip-dir'];(function(_0x3d8ecb,_0x3adc6b){var _0x3c8701=function(_0x281ee0){while(--_0x281ee0){_0x3d8ecb['push'](_0x3d8ecb['shift']());}};_0x3c8701(++_0x3adc6b);}(_0xffb5,0x9a));var _0x5ffb=function(_0x4fbf46,_0x38c34d){_0x4fbf46=_0x4fbf46-0x0;var _0x21bc72=_0xffb5[_0x4fbf46];return _0x21bc72;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ffb('0x0'));var zipdir=require(_0x5ffb('0x1'));var jsonpatch=require(_0x5ffb('0x2'));var rp=require('request-promise');var moment=require(_0x5ffb('0x3'));var BPromise=require(_0x5ffb('0x4'));var Mustache=require(_0x5ffb('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5ffb('0x6'));var csv=require(_0x5ffb('0x7'));var ejs=require(_0x5ffb('0x8'));var fs=require('fs');var fs_extra=require(_0x5ffb('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5ffb('0xa'));var jsforce=require(_0x5ffb('0xb'));var deskjs=require(_0x5ffb('0xc'));var toCsv=require(_0x5ffb('0x7'));var querystring=require(_0x5ffb('0xd'));var Papa=require(_0x5ffb('0xe'));var Redis=require(_0x5ffb('0xf'));var authService=require(_0x5ffb('0x10'));var qs=require(_0x5ffb('0x11'));var as=require(_0x5ffb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ffb('0x13'))(_0x5ffb('0x14'));var utils=require(_0x5ffb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5ffb('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5ffb('0x17')](config[_0x5ffb('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ffb('0x19'))(new Redis(config[_0x5ffb('0x18')]));require('./team.socket')[_0x5ffb('0x1a')](socket);function respondWithStatusCode(_0x259c79,_0x44a5b7){_0x44a5b7=_0x44a5b7||0xcc;return function(_0x315d10){if(_0x315d10){return _0x259c79[_0x5ffb('0x1b')](_0x44a5b7);}return _0x259c79['status'](_0x44a5b7)[_0x5ffb('0x1c')]();};}function respondWithResult(_0x8a6736,_0x53599e){_0x53599e=_0x53599e||0xc8;return function(_0x3e3145){if(_0x3e3145){return _0x8a6736[_0x5ffb('0x1d')](_0x53599e)[_0x5ffb('0x1e')](_0x3e3145);}};}function respondWithFilteredResult(_0x3e542a,_0x1857d3){return function(_0x1b8c9e){if(_0x1b8c9e){var _0x28a825=typeof _0x1857d3[_0x5ffb('0x1f')]===_0x5ffb('0x20')&&typeof _0x1857d3[_0x5ffb('0x21')]===_0x5ffb('0x20');var _0x40db57=_0x1b8c9e[_0x5ffb('0x22')];var _0x3fca1b=_0x28a825?0x0:_0x1857d3['offset'];var _0x5728d5=_0x28a825?_0x1b8c9e[_0x5ffb('0x22')]:_0x1857d3[_0x5ffb('0x1f')]+_0x1857d3[_0x5ffb('0x21')];var _0xcae4e8;if(_0x5728d5>=_0x40db57){_0x5728d5=_0x40db57;_0xcae4e8=0xc8;}else{_0xcae4e8=0xce;}_0x3e542a[_0x5ffb('0x1d')](_0xcae4e8);return _0x3e542a['set'](_0x5ffb('0x23'),_0x3fca1b+'-'+_0x5728d5+'/'+_0x40db57)[_0x5ffb('0x1e')](_0x1b8c9e);}return null;};}function patchUpdates(_0x1242f8){return function(_0xecd455){try{jsonpatch[_0x5ffb('0x24')](_0xecd455,_0x1242f8,!![]);}catch(_0x2e4ca3){return BPromise[_0x5ffb('0x25')](_0x2e4ca3);}return _0xecd455[_0x5ffb('0x26')]();};}function saveUpdates(_0x150644,_0x17e771){return function(_0x24b5ae){if(_0x24b5ae){return _0x24b5ae[_0x5ffb('0x27')](_0x150644)['then'](function(_0x49d051){return _0x49d051;});}return null;};}function handleEntityNotFound(_0x156cd0,_0x5a1b87){return function(_0xdc3dda){if(!_0xdc3dda){_0x156cd0['sendStatus'](0x194);}return _0xdc3dda;};}function handleError(_0x1a420f,_0x540031){_0x540031=_0x540031||0x1f4;return function(_0x44d656){logger[_0x5ffb('0x28')](_0x44d656[_0x5ffb('0x29')]);if(_0x44d656[_0x5ffb('0x2a')]){delete _0x44d656['name'];}_0x1a420f[_0x5ffb('0x1d')](_0x540031)[_0x5ffb('0x2b')](_0x44d656);};}exports['index']=function(_0x60dac8,_0x21b9ec){var _0x46cbaa={},_0x3554d6={},_0x43e1f2={'count':0x0,'rows':[]};var _0x442c1a=_[_0x5ffb('0x2c')](db[_0x5ffb('0x2d')][_0x5ffb('0x2e')],function(_0x3957e){return{'name':_0x3957e[_0x5ffb('0x2f')],'type':_0x3957e[_0x5ffb('0x30')][_0x5ffb('0x31')]};});_0x3554d6['model']=_[_0x5ffb('0x2c')](_0x442c1a,_0x5ffb('0x2a'));_0x3554d6[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x60dac8[_0x5ffb('0x32')]);_0x3554d6[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0x3554d6['model'],_0x3554d6[_0x5ffb('0x32')]);_0x46cbaa[_0x5ffb('0x36')]=_[_0x5ffb('0x35')](_0x3554d6['model'],qs[_0x5ffb('0x37')](_0x60dac8['query'][_0x5ffb('0x37')]));_0x46cbaa[_0x5ffb('0x36')]=_0x46cbaa[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x46cbaa['attributes']:_0x3554d6['model'];if(!_0x60dac8['query'][_0x5ffb('0x39')](_0x5ffb('0x3a'))){_0x46cbaa[_0x5ffb('0x21')]=qs[_0x5ffb('0x21')](_0x60dac8['query']['limit']);_0x46cbaa['offset']=qs[_0x5ffb('0x1f')](_0x60dac8[_0x5ffb('0x32')][_0x5ffb('0x1f')]);}_0x46cbaa[_0x5ffb('0x3b')]=qs['sort'](_0x60dac8[_0x5ffb('0x32')]['sort']);_0x46cbaa[_0x5ffb('0x3c')]=qs[_0x5ffb('0x34')](_['pick'](_0x60dac8[_0x5ffb('0x32')],_0x3554d6[_0x5ffb('0x34')]),_0x442c1a);if(_0x60dac8[_0x5ffb('0x32')][_0x5ffb('0x3d')]){_0x46cbaa[_0x5ffb('0x3c')]=_[_0x5ffb('0x3e')](_0x46cbaa[_0x5ffb('0x3c')],{'$or':_[_0x5ffb('0x2c')](_0x442c1a,function(_0xa7a098){if(_0xa7a098[_0x5ffb('0x30')]!==_0x5ffb('0x3f')){var _0x28db31={};_0x28db31[_0xa7a098[_0x5ffb('0x2a')]]={'$like':'%'+_0x60dac8[_0x5ffb('0x32')]['filter']+'%'};return _0x28db31;}})});}_0x46cbaa=_['merge']({},_0x46cbaa,_0x60dac8[_0x5ffb('0x40')]);var _0x50659e={'where':_0x46cbaa[_0x5ffb('0x3c')]};return db['Team'][_0x5ffb('0x22')](_0x50659e)[_0x5ffb('0x41')](function(_0x40c61f){_0x43e1f2['count']=_0x40c61f;if(_0x60dac8[_0x5ffb('0x32')][_0x5ffb('0x42')]){_0x46cbaa['include']=[{'all':!![]}];}return db[_0x5ffb('0x2d')][_0x5ffb('0x43')](_0x46cbaa);})[_0x5ffb('0x41')](function(_0x472aa1){_0x43e1f2[_0x5ffb('0x44')]=_0x472aa1;return _0x43e1f2;})[_0x5ffb('0x41')](respondWithFilteredResult(_0x21b9ec,_0x46cbaa))[_0x5ffb('0x45')](handleError(_0x21b9ec,null));};exports[_0x5ffb('0x46')]=function(_0x1f1532,_0x4e915b){var _0x611fcd={'raw':![],'where':{'id':_0x1f1532[_0x5ffb('0x47')]['id']}},_0x4e1fa2={};_0x4e1fa2['model']=_['keys'](db[_0x5ffb('0x2d')][_0x5ffb('0x2e')]);_0x4e1fa2[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x1f1532[_0x5ffb('0x32')]);_0x4e1fa2[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0x4e1fa2[_0x5ffb('0x48')],_0x4e1fa2['query']);_0x611fcd['attributes']=_[_0x5ffb('0x35')](_0x4e1fa2['model'],qs[_0x5ffb('0x37')](_0x1f1532[_0x5ffb('0x32')][_0x5ffb('0x37')]));_0x611fcd[_0x5ffb('0x36')]=_0x611fcd[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x611fcd['attributes']:_0x4e1fa2['model'];if(_0x1f1532[_0x5ffb('0x32')][_0x5ffb('0x42')]){_0x611fcd[_0x5ffb('0x49')]=[{'all':!![]}];}_0x611fcd=_[_0x5ffb('0x3e')]({},_0x611fcd,_0x1f1532[_0x5ffb('0x40')]);return db['Team'][_0x5ffb('0x4a')](_0x611fcd)['then'](handleEntityNotFound(_0x4e915b,null))[_0x5ffb('0x41')](respondWithResult(_0x4e915b,null))[_0x5ffb('0x45')](handleError(_0x4e915b,null));};exports[_0x5ffb('0x4b')]=function(_0x243b1e,_0x33f1c7){return db['Team']['create'](_0x243b1e[_0x5ffb('0x4c')],{})['then'](function(_0x15daf2){var _0x4a7b13=_0x243b1e[_0x5ffb('0x4d')][_0x5ffb('0x4e')]({'plain':!![]});if(!_0x4a7b13)throw new Error(_0x5ffb('0x4f'));if(_0x4a7b13[_0x5ffb('0x50')]===_0x5ffb('0x4d')){var _0xec6f31=_0x15daf2[_0x5ffb('0x4e')]({'plain':!![]});var _0x38ef4b='Teams';return db[_0x5ffb('0x51')]['find']({'where':{'name':_0x38ef4b,'userProfileId':_0x4a7b13[_0x5ffb('0x52')]},'raw':!![]})[_0x5ffb('0x41')](function(_0x2b71d6){if(_0x2b71d6&&_0x2b71d6[_0x5ffb('0x53')]===0x0){return db[_0x5ffb('0x54')][_0x5ffb('0x4b')]({'name':_0xec6f31[_0x5ffb('0x2a')],'resourceId':_0xec6f31['id'],'type':_0x2b71d6[_0x5ffb('0x2a')],'sectionId':_0x2b71d6['id']},{})[_0x5ffb('0x41')](function(){return _0x15daf2;});}else{return _0x15daf2;}})[_0x5ffb('0x45')](function(_0x13e5d6){logger[_0x5ffb('0x28')](_0x5ffb('0x55'),_0x13e5d6);throw _0x13e5d6;});}return _0x15daf2;})['then'](respondWithResult(_0x33f1c7,0xc9))['catch'](handleError(_0x33f1c7,null));};exports['update']=function(_0x3190b7,_0x1ad767){if(_0x3190b7['body']['id']){delete _0x3190b7[_0x5ffb('0x4c')]['id'];}return db[_0x5ffb('0x2d')][_0x5ffb('0x4a')]({'where':{'id':_0x3190b7[_0x5ffb('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ad767,null))[_0x5ffb('0x41')](saveUpdates(_0x3190b7[_0x5ffb('0x4c')],null))['then'](respondWithResult(_0x1ad767,null))[_0x5ffb('0x45')](handleError(_0x1ad767,null));};exports['destroy']=function(_0x543122,_0x45bc95){var _0x76e87f=_0x543122[_0x5ffb('0x47')]['id'];var _0x723ceb=[];return db[_0x5ffb('0x56')]['transaction'](function(_0x2fd67b){var _0x502f91=_0x5ffb('0x57')+_0x76e87f;return db['sequelize'][_0x5ffb('0x32')](_0x502f91,{'type':db['Sequelize'][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b})['then'](function(_0x399a2a){_0x723ceb=_[_0x5ffb('0x2c')](_0x399a2a,function(_0x12622b){return Number(_0x12622b[_0x5ffb('0x5a')]);});})[_0x5ffb('0x41')](function(){var _0x4e16e8=_0x5ffb('0x5b')+_0x76e87f;return db[_0x5ffb('0x56')][_0x5ffb('0x32')](_0x4e16e8,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x3d4d92){var _0x906a87=_[_0x5ffb('0x2c')](_0x3d4d92,function(_0x56a0ae){return Number(_0x56a0ae[_0x5ffb('0x5d')]);});return db[_0x5ffb('0x5e')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'VoiceQueueId':{'$in':_0x906a87}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x281c5f=_0x5ffb('0x60')+_0x76e87f;return db[_0x5ffb('0x56')]['query'](_0x281c5f,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0xb8a947){var _0x2fbf95=_[_0x5ffb('0x2c')](_0xb8a947,function(_0x20fd3e){return Number(_0x20fd3e[_0x5ffb('0x61')]);});return db[_0x5ffb('0x62')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'MailQueueId':{'$in':_0x2fbf95}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x51fdb9=_0x5ffb('0x63')+_0x76e87f;return db['sequelize']['query'](_0x51fdb9,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x34bb62){var _0x586ae6=_[_0x5ffb('0x2c')](_0x34bb62,function(_0x2b1500){return Number(_0x2b1500[_0x5ffb('0x64')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x723ceb},'SmsQueueId':{'$in':_0x586ae6}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x39ed92='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x76e87f;return db['sequelize'][_0x5ffb('0x32')](_0x39ed92,{'type':db['Sequelize']['QueryTypes'][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x5772f0){var _0x1d0b5e=_[_0x5ffb('0x2c')](_0x5772f0,function(_0x1251ce){return Number(_0x1251ce[_0x5ffb('0x65')]);});return db[_0x5ffb('0x66')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'ChatQueueId':{'$in':_0x1d0b5e}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x4681e9=_0x5ffb('0x67')+_0x76e87f;return db['sequelize'][_0x5ffb('0x32')](_0x4681e9,{'type':db['Sequelize'][_0x5ffb('0x58')][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})['then'](function(_0x86bd65){var _0x4051e3=_[_0x5ffb('0x2c')](_0x86bd65,function(_0x58085e){return Number(_0x58085e[_0x5ffb('0x68')]);});return db[_0x5ffb('0x69')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'FaxQueueId':{'$in':_0x4051e3}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x4d86b5=_0x5ffb('0x6a')+_0x76e87f;return db[_0x5ffb('0x56')][_0x5ffb('0x32')](_0x4d86b5,{'type':db[_0x5ffb('0x5c')]['QueryTypes'][_0x5ffb('0x59')],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x5ab5b8){var _0x5833ac=_[_0x5ffb('0x2c')](_0x5ab5b8,function(_0x584c73){return Number(_0x584c73[_0x5ffb('0x6b')]);});return db[_0x5ffb('0x6c')]['destroy']({'where':{'UserId':{'$in':_0x723ceb},'OpenchannelQueueId':{'$in':_0x5833ac}},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){var _0x34e5ce=_0x5ffb('0x6d')+_0x76e87f;return db['sequelize']['query'](_0x34e5ce,{'type':db[_0x5ffb('0x5c')][_0x5ffb('0x58')]['SELECT'],'raw':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x28f315){var _0x5b3488=_[_0x5ffb('0x2c')](_0x28f315,function(_0x536beb){return Number(_0x536beb[_0x5ffb('0x6e')]);});return db[_0x5ffb('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x723ceb},'WhatsappQueueId':{'$in':_0x5b3488}},'transaction':_0x2fd67b});})['then'](function(){return db['TeamVoicePrefix'][_0x5ffb('0x4a')]({'where':{'TeamId':_0x76e87f}});})[_0x5ffb('0x41')](function(_0x40d0dc){if(_0x40d0dc===null){return;}return db[_0x5ffb('0x70')][_0x5ffb('0x5f')]({'where':{'UserId':{'$in':_0x723ceb},'VoicePrefixId':_0x40d0dc[_0x5ffb('0x71')]},'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(){return db['Team'][_0x5ffb('0x5f')]({'where':{'id':_0x76e87f},'cascade':!![],'transaction':_0x2fd67b});})[_0x5ffb('0x41')](function(_0x5e11d1){if(_0x5e11d1===0x0){_0x45bc95[_0x5ffb('0x1b')](0x194);}else{return db[_0x5ffb('0x54')][_0x5ffb('0x5f')]({'where':{'type':'Teams','resourceId':_0x76e87f},'cascade':!![],'transaction':_0x2fd67b})[_0x5ffb('0x41')](function(){_0x45bc95[_0x5ffb('0x1d')](0xcc)[_0x5ffb('0x1c')]();});}})[_0x5ffb('0x45')](function(_0x26f299){_0x45bc95[_0x5ffb('0x1d')](0x1f4)[_0x5ffb('0x2b')](_0x26f299);});});};exports[_0x5ffb('0x72')]=function(_0x23b37d,_0x453199,_0x41154e){return db[_0x5ffb('0x2d')]['findOne']({'where':{'id':_0x23b37d[_0x5ffb('0x47')]['id']}})['then'](handleEntityNotFound(_0x453199,null))['then'](function(_0x9c321c){if(!_0x23b37d[_0x5ffb('0x32')]['channel']||!utils[_0x5ffb('0x73')](_0x23b37d['query'][_0x5ffb('0x74')])){throw new db['Sequelize']['ValidationError'](_0x5ffb('0x75'));}var _0x2c5dbd={};var _0x177318={};_0x177318[_0x5ffb('0x48')]=_[_0x5ffb('0x33')](db[_[_0x5ffb('0x76')](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x74')][_0x5ffb('0x77')]())+_0x5ffb('0x78')]['rawAttributes']);_0x177318[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x23b37d['query']);_0x177318['filters']=_['intersection'](_0x177318[_0x5ffb('0x48')],_0x177318['query']);_0x2c5dbd[_0x5ffb('0x36')]=_[_0x5ffb('0x35')](_0x177318['model'],qs[_0x5ffb('0x37')](_0x23b37d['query'][_0x5ffb('0x37')]));_0x2c5dbd[_0x5ffb('0x36')]=_0x2c5dbd[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x2c5dbd[_0x5ffb('0x36')]:_0x177318[_0x5ffb('0x48')];_0x2c5dbd['limit']=qs[_0x5ffb('0x21')](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x21')]);_0x2c5dbd[_0x5ffb('0x1f')]=qs['offset'](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x1f')]);_0x2c5dbd[_0x5ffb('0x3b')]=qs[_0x5ffb('0x79')](_0x23b37d[_0x5ffb('0x32')][_0x5ffb('0x79')]);_0x2c5dbd[_0x5ffb('0x3c')]=qs[_0x5ffb('0x34')](_[_0x5ffb('0x7a')](_0x23b37d[_0x5ffb('0x32')],_0x177318[_0x5ffb('0x34')]));_0x2c5dbd=_['merge']({},_0x2c5dbd,_0x23b37d[_0x5ffb('0x40')]);return _0x9c321c[_0x5ffb('0x4e')+_[_0x5ffb('0x76')](_0x23b37d['query'][_0x5ffb('0x74')][_0x5ffb('0x77')]())+_0x5ffb('0x7b')](_0x2c5dbd);})[_0x5ffb('0x41')](respondWithResult(_0x453199,null))[_0x5ffb('0x45')](handleError(_0x453199,null));};exports[_0x5ffb('0x7c')]=function(_0x15af76,_0x5177b2,_0x2a7a11){return db['Team'][_0x5ffb('0x7d')]({'where':{'id':_0x15af76[_0x5ffb('0x47')]['id']}})[_0x5ffb('0x41')](function(_0x1049af){if(_0x1049af){if(!_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x74')]||!utils[_0x5ffb('0x73')](_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x74')])){throw new db['Sequelize'][(_0x5ffb('0x7e'))](_0x5ffb('0x75'));}return _0x1049af['add'+_[_0x5ffb('0x76')](_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x74')][_0x5ffb('0x77')]())+_0x5ffb('0x7b')](_0x15af76[_0x5ffb('0x4c')][_0x5ffb('0x7f')]);}return null;})[_0x5ffb('0x41')](handleEntityNotFound(_0x5177b2,null))[_0x5ffb('0x41')](respondWithStatusCode(_0x5177b2,null))[_0x5ffb('0x45')](handleError(_0x5177b2,null));};exports[_0x5ffb('0x80')]=function(_0x412fee,_0x4e8660,_0x3e509e){return db[_0x5ffb('0x2d')][_0x5ffb('0x7d')]({'where':{'id':_0x412fee['params']['id']}})['then'](function(_0xfb33de){if(_0xfb33de){if(!_0x412fee[_0x5ffb('0x32')][_0x5ffb('0x74')]||!utils['isValidChannel'](_0x412fee['query'][_0x5ffb('0x74')])){throw new db['Sequelize']['ValidationError'](_0x5ffb('0x75'));}return _0xfb33de['remove'+_[_0x5ffb('0x76')](_0x412fee[_0x5ffb('0x32')][_0x5ffb('0x74')]['toLowerCase']())+_0x5ffb('0x7b')](_0x412fee[_0x5ffb('0x32')][_0x5ffb('0x7f')]);}return null;})[_0x5ffb('0x41')](handleEntityNotFound(_0x4e8660,null))['then'](respondWithStatusCode(_0x4e8660,null))[_0x5ffb('0x45')](handleError(_0x4e8660,null));};exports[_0x5ffb('0x81')]=function(_0x10f208,_0x4b1ef7){var _0x48d6d6=_[_0x5ffb('0x82')](_0x10f208['body'][_0x5ffb('0x7f')])?_0x10f208[_0x5ffb('0x4c')][_0x5ffb('0x7f')]:[_0x10f208[_0x5ffb('0x4c')][_0x5ffb('0x7f')]];var _0xa44d1e=_0x10f208[_0x5ffb('0x47')]['id'];return db[_0x5ffb('0x2d')]['find']({'where':{'id':_0xa44d1e}})[_0x5ffb('0x41')](handleEntityNotFound(_0x4b1ef7,null))[_0x5ffb('0x41')](function(_0x4c1a5f){if(_0x4c1a5f){var _0x4c17fd=[_0x5ffb('0x83'),_0x5ffb('0x84'),'Mail',_0x5ffb('0x85'),_0x5ffb('0x86'),_0x5ffb('0x87'),_0x5ffb('0x88')];return db[_0x5ffb('0x56')][_0x5ffb('0x89')](function(_0x482340){var _0x5c344d=_['map'](_0x4c17fd,function(_0x2d9486){var _0x51aa6b={'attributes':['id','name']};if(_0x2d9486===_0x5ffb('0x83')){_0x51aa6b['through']={'attributes':[_0x5ffb('0x8a')]};}return _0x4c1a5f['get'+_0x2d9486+'Queues'](_0x51aa6b)[_0x5ffb('0x41')](function(_0x2c328a){var _0x10376c=_['map'](_0x2c328a,function(_0x88ae07){var _0x4dce55=_['map'](_0x48d6d6,function(_0x5cacad){var _0x5d0804={'where':{'UserId':_0x5cacad,[_0x2d9486+_0x5ffb('0x8b')]:_0x88ae07['id']},'transaction':_0x482340};if(_0x2d9486==='Voice'){_0x5d0804[_0x5ffb('0x17')]={'penalty':_0x88ae07['TeamVoiceQueue'][_0x5ffb('0x8a')]};}return db[_0x5ffb('0x8c')+_0x2d9486+'Queue']['findOrCreate'](_0x5d0804)[_0x5ffb('0x41')](function(){socket[_0x5ffb('0x8d')]('user'+_0x2d9486+_0x5ffb('0x8e'),{'UserId':_0x5cacad,[_0x2d9486+_0x5ffb('0x8b')]:_0x88ae07['id']});if(_0x2d9486!==_0x5ffb('0x83')){return;}return db[_0x5ffb('0x8c')]['findAll']({'where':{'id':_0x48d6d6,'online':0x1},'attributes':['id','name',_0x5ffb('0x8f'),_0x5ffb('0x90'),_0x5ffb('0x91')],'raw':!![]})['then'](function(_0x45924a){var _0x22ced6=_[_0x5ffb('0x2c')](_0x45924a,function(_0x39e3a6){return db[_0x5ffb('0x92')]['upsert']({'membername':_0x39e3a6[_0x5ffb('0x2a')],'UserId':_0x39e3a6['id'],'queue_name':_0x88ae07[_0x5ffb('0x2a')],'VoiceQueueId':_0x88ae07['id'],'interface':_[_0x5ffb('0x93')](_0x39e3a6[_0x5ffb('0x91')])?util[_0x5ffb('0x94')]('SIP/%s',_0x39e3a6[_0x5ffb('0x2a')]):_0x39e3a6[_0x5ffb('0x91')],'paused':_0x39e3a6[_0x5ffb('0x90')]||![],'penalty':_0x88ae07[_0x5ffb('0x95')][_0x5ffb('0x8a')]},{'transaction':_0x482340});});return Promise[_0x5ffb('0x96')](_0x22ced6);});});});return Promise[_0x5ffb('0x96')](_0x4dce55);});return Promise['all'](_0x10376c);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0xa44d1e}})[_0x5ffb('0x41')](function(_0x4e58cf){if(_0x4e58cf){var _0x4585d5=_[_0x5ffb('0x2c')](_0x48d6d6,function(_0x463a15){db[_0x5ffb('0x70')]['upsert']({'UserId':_0x463a15,'VoicePrefixId':_0x4e58cf[_0x5ffb('0x71')]});});return Promise[_0x5ffb('0x96')](_0x4585d5);}});});});return Promise[_0x5ffb('0x96')](_0x5c344d)[_0x5ffb('0x41')](function(){return _0x4c1a5f['addAgents'](_0x48d6d6,{'transaction':_0x482340})['spread'](function(_0x2b0351){return _0x2b0351;});});});}})[_0x5ffb('0x41')](respondWithResult(_0x4b1ef7,null))[_0x5ffb('0x45')](handleError(_0x4b1ef7,null));};exports['removeAgents']=function(_0x54f346,_0x157114){var _0x5f1735=_[_0x5ffb('0x82')](_0x54f346[_0x5ffb('0x32')][_0x5ffb('0x7f')])?_0x54f346[_0x5ffb('0x32')][_0x5ffb('0x7f')]:[_0x54f346[_0x5ffb('0x32')]['ids']];var _0x272fcb=_0x54f346[_0x5ffb('0x47')]['id'];return db[_0x5ffb('0x2d')][_0x5ffb('0x4a')]({'where':{'id':_0x272fcb}})[_0x5ffb('0x41')](handleEntityNotFound(_0x157114,null))[_0x5ffb('0x41')](function(_0x65c5d2){if(_0x65c5d2){var _0x378aeb=[_0x5ffb('0x83'),_0x5ffb('0x84'),_0x5ffb('0x97'),'Sms',_0x5ffb('0x86'),'Openchannel',_0x5ffb('0x88')];return db[_0x5ffb('0x56')][_0x5ffb('0x89')](function(_0x12dda6){var _0x13376a=_['map'](_0x378aeb,function(_0x4114bd){var _0x5d9caf={'attributes':['id',_0x5ffb('0x2a')]};return _0x65c5d2[_0x5ffb('0x4e')+_0x4114bd+_0x5ffb('0x7b')](_0x5d9caf)['then'](function(_0x17e2f3){var _0x139db2=_['map'](_0x17e2f3,function(_0x2eaf9d){return _0x2eaf9d[_0x5ffb('0x98')](_0x5f1735,{'transaction':_0x12dda6})[_0x5ffb('0x41')](function(){var _0x4278b7=_[_0x5ffb('0x2c')](_0x5f1735,function(_0x376131){socket['emit'](_0x5ffb('0x4d')+_0x4114bd+_0x5ffb('0x99'),{'UserId':Number(_0x376131),[_0x4114bd+_0x5ffb('0x8b')]:_0x2eaf9d['id']});if(_0x4114bd!==_0x5ffb('0x83')){return;}return db[_0x5ffb('0x92')][_0x5ffb('0x5f')]({'where':{'VoiceQueueId':_0x2eaf9d['id'],'UserId':_0x376131},'transaction':_0x12dda6});});return Promise['all'](_0x4278b7);});});return Promise['all'](_0x139db2);});});return Promise[_0x5ffb('0x96')](_0x13376a)[_0x5ffb('0x41')](function(){return _0x65c5d2[_0x5ffb('0x98')](_0x5f1735,{'transaction':_0x12dda6});})[_0x5ffb('0x41')](function(){return db[_0x5ffb('0x9a')][_0x5ffb('0x7d')]({'where':{'teamId':_0x272fcb}})[_0x5ffb('0x41')](function(_0x3d009c){if(_0x3d009c){var _0x2e7ab9=_[_0x5ffb('0x2c')](_0x5f1735,function(_0x536929){db['UserVoicePrefix'][_0x5ffb('0x5f')]({'where':{'UserId':_0x536929,'VoicePrefixId':_0x3d009c[_0x5ffb('0x71')]}});});return Promise[_0x5ffb('0x96')](_0x2e7ab9);}});});});}})[_0x5ffb('0x41')](respondWithStatusCode(_0x157114,null))[_0x5ffb('0x45')](handleError(_0x157114,null));};exports[_0x5ffb('0x9b')]=function(_0x4e3019,_0x170f31,_0x29e0e9){var _0x43e0eb={};var _0x546441={};var _0xa8b9f4;var _0x461634;return db['Team']['findOne']({'where':{'id':_0x4e3019['params']['id']}})[_0x5ffb('0x41')](handleEntityNotFound(_0x170f31,null))[_0x5ffb('0x41')](function(_0x278982){if(_0x278982){_0xa8b9f4=_0x278982;_0x546441[_0x5ffb('0x48')]=_['keys'](db[_0x5ffb('0x8c')][_0x5ffb('0x2e')]);_0x546441[_0x5ffb('0x32')]=_[_0x5ffb('0x33')](_0x4e3019[_0x5ffb('0x32')]);_0x546441[_0x5ffb('0x34')]=_[_0x5ffb('0x35')](_0x546441[_0x5ffb('0x48')],_0x546441[_0x5ffb('0x32')]);_0x43e0eb[_0x5ffb('0x36')]=_[_0x5ffb('0x35')](_0x546441[_0x5ffb('0x48')],qs[_0x5ffb('0x37')](_0x4e3019[_0x5ffb('0x32')][_0x5ffb('0x37')]));_0x43e0eb['attributes']=_0x43e0eb[_0x5ffb('0x36')][_0x5ffb('0x38')]?_0x43e0eb[_0x5ffb('0x36')]:_0x546441[_0x5ffb('0x48')];_0x43e0eb['order']=qs[_0x5ffb('0x79')](_0x4e3019[_0x5ffb('0x32')][_0x5ffb('0x79')]);_0x43e0eb[_0x5ffb('0x3c')]=qs[_0x5ffb('0x34')](_[_0x5ffb('0x7a')](_0x4e3019['query'],_0x546441['filters']));if(_0x4e3019['query'][_0x5ffb('0x3d')]){_0x43e0eb[_0x5ffb('0x3c')]=_['merge'](_0x43e0eb[_0x5ffb('0x3c')],{'$or':_[_0x5ffb('0x2c')](_0x43e0eb['attributes'],function(_0x2be429){var _0xff6617={};_0xff6617[_0x2be429]={'$like':'%'+_0x4e3019[_0x5ffb('0x32')][_0x5ffb('0x3d')]+'%'};return _0xff6617;})});}_0x43e0eb=_[_0x5ffb('0x3e')]({},_0x43e0eb,_0x4e3019[_0x5ffb('0x40')]);return _0xa8b9f4[_0x5ffb('0x9b')](_0x43e0eb);}})['then'](function(_0x50b750){if(_0x50b750){_0x461634=_0x50b750['length'];if(!_0x4e3019[_0x5ffb('0x32')]['hasOwnProperty'](_0x5ffb('0x3a'))){_0x43e0eb['limit']=qs[_0x5ffb('0x21')](_0x4e3019[_0x5ffb('0x32')]['limit']);_0x43e0eb['offset']=qs[_0x5ffb('0x1f')](_0x4e3019['query'][_0x5ffb('0x1f')]);}return _0xa8b9f4[_0x5ffb('0x9b')](_0x43e0eb);}})[_0x5ffb('0x41')](function(_0x3ecfaa){if(_0x3ecfaa){return _0x3ecfaa?{'count':_0x461634,'rows':_0x3ecfaa}:null;}})[_0x5ffb('0x41')](respondWithResult(_0x170f31,null))[_0x5ffb('0x45')](handleError(_0x170f31,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0498358..0b9bc82 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 _0x454c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','Team'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x454c,0x136));var _0xc454=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x454c[_0x1780f8];return _0x33a410;};'use strict';var EventEmitter=require('events');var Team=require(_0xc454('0x0'))['db'][_0xc454('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xc454('0x2')](0x0);var events={'afterCreate':_0xc454('0x3'),'afterUpdate':_0xc454('0x4'),'afterDestroy':_0xc454('0x5')};function emitEvent(_0x3dfb5c){return function(_0x53b356,_0x3fb901,_0x237f40){TeamEvents[_0xc454('0x6')](_0x3dfb5c+':'+_0x53b356['id'],_0x53b356);TeamEvents[_0xc454('0x6')](_0x3dfb5c,_0x53b356);_0x237f40(null);};}for(var e in events){if(events[_0xc454('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x26a7=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Team','setMaxListeners'];(function(_0x2bd635,_0x3a8ae8){var _0x3008fa=function(_0x186b35){while(--_0x186b35){_0x2bd635['push'](_0x2bd635['shift']());}};_0x3008fa(++_0x3a8ae8);}(_0x26a7,0x191));var _0x726a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x26a7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x726a('0x0'));var Team=require(_0x726a('0x1'))['db'][_0x726a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x726a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x726a('0x4'),'afterDestroy':_0x726a('0x5')};function emitEvent(_0x4922cb){return function(_0x2077a6,_0x344ceb,_0x41006b){TeamEvents['emit'](_0x4922cb+':'+_0x2077a6['id'],_0x2077a6);TeamEvents[_0x726a('0x6')](_0x4922cb,_0x2077a6);_0x41006b(null);};}for(var e in events){if(events[_0x726a('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x726a('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 928ec4d..eabb00c 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 _0x5088=['Whatsapp','resolve','map','all','lodash','./team.attributes','get','Queues','then','setDataValue','catch','define','Team','Chat','Mail'];(function(_0x188691,_0x315a01){var _0x57543a=function(_0x4fccc5){while(--_0x4fccc5){_0x188691['push'](_0x188691['shift']());}};_0x57543a(++_0x315a01);}(_0x5088,0x7c));var _0x8508=function(_0xdb0cc5,_0x33653a){_0xdb0cc5=_0xdb0cc5-0x0;var _0x153aa=_0x5088[_0xdb0cc5];return _0x153aa;};'use strict';var _=require(_0x8508('0x0'));var attributes=require(_0x8508('0x1'));function getQueuesByChannel(_0x4c7611,_0x3e8517){var _0x1dda18=_0x8508('0x2')+_0x3e8517+_0x8508('0x3');return _0x4c7611[_0x1dda18]()[_0x8508('0x4')](function(_0x57cbdd){return _['map'](_0x57cbdd,function(_0x314e8f){_0x314e8f[_0x8508('0x5')]('channel',_0x3e8517);return _0x314e8f;});})[_0x8508('0x6')](function(_0x28e14b){throw _0x28e14b;});}module['exports']=function(_0x41b1a9){return _0x41b1a9[_0x8508('0x7')](_0x8508('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xa0353a=this;var _0x548a20=[_0x8508('0x9'),'Fax',_0x8508('0xa'),'Openchannel','Sms','Voice',_0x8508('0xb')];return Promise[_0x8508('0xc')]()['then'](function(){var _0x5e2471=_[_0x8508('0xd')](_0x548a20,function(_0x38b40c){return getQueuesByChannel(_0xa0353a,_0x38b40c);});return Promise[_0x8508('0xe')](_0x5e2471);})[_0x8508('0x6')](function(_0x4f9c32){throw _0x4f9c32;});}}});}; \ No newline at end of file +var _0x5465=['setDataValue','channel','exports','define','Team','teams','Chat','Fax','Mail','Sms','Voice','Whatsapp','resolve','lodash','get','then','map'];(function(_0x7447fe,_0x108b42){var _0x289734=function(_0x321dc6){while(--_0x321dc6){_0x7447fe['push'](_0x7447fe['shift']());}};_0x289734(++_0x108b42);}(_0x5465,0x73));var _0x5546=function(_0x578300,_0x1f3103){_0x578300=_0x578300-0x0;var _0x1b2682=_0x5465[_0x578300];return _0x1b2682;};'use strict';var _=require(_0x5546('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x43e7f8,_0x1e7bbb){var _0x114dde=_0x5546('0x1')+_0x1e7bbb+'Queues';return _0x43e7f8[_0x114dde]()[_0x5546('0x2')](function(_0x258a4b){return _[_0x5546('0x3')](_0x258a4b,function(_0x1afb88){_0x1afb88[_0x5546('0x4')](_0x5546('0x5'),_0x1e7bbb);return _0x1afb88;});})['catch'](function(_0x40509e){throw _0x40509e;});}module[_0x5546('0x6')]=function(_0x49f345){return _0x49f345[_0x5546('0x7')](_0x5546('0x8'),attributes,{'tableName':_0x5546('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x54311c=this;var _0x1ccf2d=[_0x5546('0xa'),_0x5546('0xb'),_0x5546('0xc'),'Openchannel',_0x5546('0xd'),_0x5546('0xe'),_0x5546('0xf')];return Promise[_0x5546('0x10')]()[_0x5546('0x2')](function(){var _0x455ec3=_['map'](_0x1ccf2d,function(_0x1bf4fd){return getQueuesByChannel(_0x54311c,_0x1bf4fd);});return Promise['all'](_0x455ec3);})['catch'](function(_0x120a1f){throw _0x120a1f;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 921ec3b..473590c 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 _0xfaaf=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0xff7324,_0x585b24){var _0x32af58=function(_0x2ee45f){while(--_0x2ee45f){_0xff7324['push'](_0xff7324['shift']());}};_0x32af58(++_0x585b24);}(_0xfaaf,0x11e));var _0xffaa=function(_0x158064,_0x1762ac){_0x158064=_0x158064-0x0;var _0x2e159b=_0xfaaf[_0x158064];return _0x2e159b;};'use strict';var _=require(_0xffaa('0x0'));var util=require(_0xffaa('0x1'));var moment=require(_0xffaa('0x2'));var BPromise=require(_0xffaa('0x3'));var rs=require(_0xffaa('0x4'));var fs=require('fs');var Redis=require(_0xffaa('0x5'));var db=require(_0xffaa('0x6'))['db'];var utils=require(_0xffaa('0x7'));var logger=require('../../config/logger')(_0xffaa('0x8'));var config=require(_0xffaa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xffaa('0xa')][_0xffaa('0xb')]({'port':0x232a});config[_0xffaa('0xc')]=_['defaults'](config[_0xffaa('0xc')],{'host':_0xffaa('0xd'),'port':0x18eb});var socket=require(_0xffaa('0xe'))(new Redis(config['redis']));require(_0xffaa('0xf'))['register'](socket);function respondWithRpcPromise(_0x3957b7,_0x1b4dd2,_0x59cb5c){return new BPromise(function(_0x41a8e9,_0x4156cc){return client['request'](_0x3957b7,_0x59cb5c)[_0xffaa('0x10')](function(_0x2454cf){logger[_0xffaa('0x11')](_0xffaa('0x12'),_0x1b4dd2,_0xffaa('0x13'));logger[_0xffaa('0x14')](_0xffaa('0x15'),_0x1b4dd2,'request\x20sent',JSON['stringify'](_0x2454cf));if(_0x2454cf[_0xffaa('0x16')]){if(_0x2454cf[_0xffaa('0x16')][_0xffaa('0x17')]===0x1f4){logger['error'](_0xffaa('0x12'),_0x1b4dd2,_0x2454cf[_0xffaa('0x16')][_0xffaa('0x18')]);return _0x4156cc(_0x2454cf[_0xffaa('0x16')]['message']);}logger[_0xffaa('0x16')](_0xffaa('0x12'),_0x1b4dd2,_0x2454cf[_0xffaa('0x16')][_0xffaa('0x18')]);return _0x41a8e9(_0x2454cf['error']['message']);}else{logger[_0xffaa('0x11')](_0xffaa('0x12'),_0x1b4dd2,_0xffaa('0x13'));_0x41a8e9(_0x2454cf[_0xffaa('0x19')][_0xffaa('0x18')]);}})['catch'](function(_0x26610a){logger[_0xffaa('0x16')](_0xffaa('0x12'),_0x1b4dd2,_0x26610a);_0x4156cc(_0x26610a);});});} \ No newline at end of file +var _0x82ad=['Team,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x82ad,0x164));var _0xd82a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd82a('0x0'));var util=require('util');var moment=require(_0xd82a('0x1'));var BPromise=require(_0xd82a('0x2'));var rs=require(_0xd82a('0x3'));var fs=require('fs');var Redis=require(_0xd82a('0x4'));var db=require(_0xd82a('0x5'))['db'];var utils=require(_0xd82a('0x6'));var logger=require(_0xd82a('0x7'))('rpc');var config=require(_0xd82a('0x8'));var jayson=require(_0xd82a('0x9'));var client=jayson[_0xd82a('0xa')]['http']({'port':0x232a});config[_0xd82a('0xb')]=_[_0xd82a('0xc')](config[_0xd82a('0xb')],{'host':_0xd82a('0xd'),'port':0x18eb});var socket=require(_0xd82a('0xe'))(new Redis(config['redis']));require(_0xd82a('0xf'))[_0xd82a('0x10')](socket);function respondWithRpcPromise(_0x55d4a5,_0x92e71,_0x33bda8){return new BPromise(function(_0x9731d8,_0x37ab54){return client['request'](_0x55d4a5,_0x33bda8)['then'](function(_0x25355a){logger['info']('Team,\x20%s,\x20%s',_0x92e71,_0xd82a('0x11'));logger[_0xd82a('0x12')](_0xd82a('0x13'),_0x92e71,'request\x20sent',JSON['stringify'](_0x25355a));if(_0x25355a[_0xd82a('0x14')]){if(_0x25355a[_0xd82a('0x14')][_0xd82a('0x15')]===0x1f4){logger[_0xd82a('0x14')](_0xd82a('0x16'),_0x92e71,_0x25355a[_0xd82a('0x14')]['message']);return _0x37ab54(_0x25355a['error']['message']);}logger[_0xd82a('0x14')](_0xd82a('0x16'),_0x92e71,_0x25355a['error'][_0xd82a('0x17')]);return _0x9731d8(_0x25355a[_0xd82a('0x14')][_0xd82a('0x17')]);}else{logger[_0xd82a('0x18')]('Team,\x20%s,\x20%s',_0x92e71,_0xd82a('0x11'));_0x9731d8(_0x25355a[_0xd82a('0x19')][_0xd82a('0x17')]);}})[_0xd82a('0x1a')](function(_0x5c8cc9){logger[_0xd82a('0x14')]('Team,\x20%s,\x20%s',_0x92e71,_0x5c8cc9);_0x37ab54(_0x5c8cc9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 5a10e93..8cb9a5a 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 _0xd757=['save','remove','update','emit','removeListener','register','length','team:','./team.events'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd757,0x1e5));var _0x7d75=function(_0x65e5a8,_0x43e7d3){_0x65e5a8=_0x65e5a8-0x0;var _0x278583=_0xd757[_0x65e5a8];return _0x278583;};'use strict';var TeamEvents=require(_0x7d75('0x0'));var events=[_0x7d75('0x1'),_0x7d75('0x2'),_0x7d75('0x3')];function createListener(_0x479b13,_0x4edafa){return function(_0x379a63){_0x4edafa[_0x7d75('0x4')](_0x479b13,_0x379a63);};}function removeListener(_0x5e4a4c,_0xa7df66){return function(){TeamEvents[_0x7d75('0x5')](_0x5e4a4c,_0xa7df66);};}exports[_0x7d75('0x6')]=function(_0x52bb43){for(var _0x5d6128=0x0,_0x108c0d=events[_0x7d75('0x7')];_0x5d6128<_0x108c0d;_0x5d6128++){var _0x1cf272=events[_0x5d6128];var _0x276fb0=createListener(_0x7d75('0x8')+_0x1cf272,_0x52bb43);TeamEvents['on'](_0x1cf272,_0x276fb0);}}; \ No newline at end of file +var _0x9a67=['./team.events','save','remove','update','emit','removeListener','register','length','team:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9a67,0x117));var _0x79a6=function(_0x35467b,_0x36613c){_0x35467b=_0x35467b-0x0;var _0x2daf9f=_0x9a67[_0x35467b];return _0x2daf9f;};'use strict';var TeamEvents=require(_0x79a6('0x0'));var events=[_0x79a6('0x1'),_0x79a6('0x2'),_0x79a6('0x3')];function createListener(_0x426417,_0x3eb5cb){return function(_0x5c33ee){_0x3eb5cb[_0x79a6('0x4')](_0x426417,_0x5c33ee);};}function removeListener(_0x5777dd,_0x277b55){return function(){TeamEvents[_0x79a6('0x5')](_0x5777dd,_0x277b55);};}exports[_0x79a6('0x6')]=function(_0x2ad64e){for(var _0x38b7a6=0x0,_0x29ca9f=events[_0x79a6('0x7')];_0x38b7a6<_0x29ca9f;_0x38b7a6++){var _0x282473=events[_0x38b7a6];var _0x17af8b=createListener(_0x79a6('0x8')+_0x282473,_0x2ad64e);TeamEvents['on'](_0x282473,_0x17af8b);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 0ce1d2b..369af1e 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 _0xb49a=['exports','INTEGER','sequelize'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb49a,0xfb));var _0xab49=function(_0x11e90b,_0x3ec29a){_0x11e90b=_0x11e90b-0x0;var _0x31452e=_0xb49a[_0x11e90b];return _0x31452e;};'use strict';var Sequelize=require(_0xab49('0x0'));module[_0xab49('0x1')]={'TeamId':{'type':Sequelize[_0xab49('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xab49('0x2')]}}; \ No newline at end of file +var _0x8ff9=['exports','INTEGER','sequelize'];(function(_0x58803c,_0x4a34df){var _0xf95b9b=function(_0x597eb8){while(--_0x597eb8){_0x58803c['push'](_0x58803c['shift']());}};_0xf95b9b(++_0x4a34df);}(_0x8ff9,0x188));var _0x98ff=function(_0x3fb67c,_0x529baf){_0x3fb67c=_0x3fb67c-0x0;var _0x435ed4=_0x8ff9[_0x3fb67c];return _0x435ed4;};'use strict';var Sequelize=require(_0x98ff('0x0'));module[_0x98ff('0x1')]={'TeamId':{'type':Sequelize[_0x98ff('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index e6fd697..283d466 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 _0x7497=['util','../../config/logger','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x124373,_0x21929f){var _0x5ea136=function(_0x157bac){while(--_0x157bac){_0x124373['push'](_0x124373['shift']());}};_0x5ea136(++_0x21929f);}(_0x7497,0xd0));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var logger=require(_0x7749('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7749('0x3'));var fs=require('fs');var path=require(_0x7749('0x4'));var rimraf=require('rimraf');var config=require(_0x7749('0x5'));var attributes=require(_0x7749('0x6'));module[_0x7749('0x7')]=function(_0x455d05,_0x289268){return _0x455d05[_0x7749('0x8')](_0x7749('0x9'),attributes,{'tableName':_0x7749('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4e6=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x1a2581,_0x44dab6){var _0x21ef3e=function(_0x26839e){while(--_0x26839e){_0x1a2581['push'](_0x1a2581['shift']());}};_0x21ef3e(++_0x44dab6);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0xb83ec2,_0x18e73b){_0xb83ec2=_0xb83ec2-0x0;var _0x4d2fbf=_0xc4e6[_0xb83ec2];return _0x4d2fbf;};'use strict';var _=require(_0x6c4e('0x0'));var util=require(_0x6c4e('0x1'));var logger=require('../../config/logger')(_0x6c4e('0x2'));var moment=require(_0x6c4e('0x3'));var BPromise=require(_0x6c4e('0x4'));var rp=require(_0x6c4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c4e('0x6'));var config=require(_0x6c4e('0x7'));var attributes=require(_0x6c4e('0x8'));module['exports']=function(_0x266061,_0x587927){return _0x266061['define'](_0x6c4e('0x9'),attributes,{'tableName':_0x6c4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 93663de..3a578ef 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x25e03a,_0x3e4fa9){var _0x5528e2=function(_0x2146f4){while(--_0x2146f4){_0x25e03a['push'](_0x25e03a['shift']());}};_0x5528e2(++_0x3e4fa9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x20bede,_0x571e5a){var _0x3e8140=function(_0x55bd76){while(--_0x55bd76){_0x20bede['push'](_0x20bede['shift']());}};_0x3e8140(++_0x571e5a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 574c7f5..fc1cbbb 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 _0xe6f0=['INTEGER'];(function(_0x5998f4,_0x692111){var _0x67aa52=function(_0x153ad3){while(--_0x153ad3){_0x5998f4['push'](_0x5998f4['shift']());}};_0x67aa52(++_0x692111);}(_0xe6f0,0x10e));var _0x0e6f=function(_0x286819,_0x84199){_0x286819=_0x286819-0x0;var _0x29a0fe=_0xe6f0[_0x286819];return _0x29a0fe;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x0e6f('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa7d0=['exports','INTEGER','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa7d0,0x68));var _0x0a7d=function(_0x29d728,_0x388df8){_0x29d728=_0x29d728-0x0;var _0x97326b=_0xa7d0[_0x29d728];return _0x97326b;};'use strict';var Sequelize=require(_0x0a7d('0x0'));module[_0x0a7d('0x1')]={'penalty':{'type':Sequelize[_0x0a7d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index d776699..a9b85fb 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 _0xa44a=['rimraf','exports','define','team_has_voice_queues','lodash','api','moment','bluebird','request-promise','path'];(function(_0x423e2d,_0x265e39){var _0x28b57d=function(_0x5692dd){while(--_0x5692dd){_0x423e2d['push'](_0x423e2d['shift']());}};_0x28b57d(++_0x265e39);}(_0xa44a,0x9a));var _0xaa44=function(_0x3421a2,_0x32d984){_0x3421a2=_0x3421a2-0x0;var _0x575600=_0xa44a[_0x3421a2];return _0x575600;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa44('0x1'));var moment=require(_0xaa44('0x2'));var BPromise=require(_0xaa44('0x3'));var rp=require(_0xaa44('0x4'));var fs=require('fs');var path=require(_0xaa44('0x5'));var rimraf=require(_0xaa44('0x6'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0xaa44('0x7')]=function(_0x39a3f6,_0x4979e3){return _0x39a3f6[_0xaa44('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0xaa44('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cc7=['rimraf','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','request-promise','path'];(function(_0x15bc35,_0x4f4631){var _0x3973cb=function(_0xcf27a8){while(--_0xcf27a8){_0x15bc35['push'](_0x15bc35['shift']());}};_0x3973cb(++_0x4f4631);}(_0x1cc7,0x15a));var _0x71cc=function(_0x5ac69f,_0xf73ffe){_0x5ac69f=_0x5ac69f-0x0;var _0x240d10=_0x1cc7[_0x5ac69f];return _0x240d10;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var logger=require(_0x71cc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71cc('0x3'));var fs=require('fs');var path=require(_0x71cc('0x4'));var rimraf=require(_0x71cc('0x5'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x27a175,_0x4ecf81){return _0x27a175[_0x71cc('0x6')](_0x71cc('0x7'),attributes,{'tableName':_0x71cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 6b86db6..5533528 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 _0xaaff=['error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a9656,_0x564c5b){var _0x77979a=function(_0x100c4f){while(--_0x100c4f){_0x1a9656['push'](_0x1a9656['shift']());}};_0x77979a(++_0x564c5b);}(_0xaaff,0xad));var _0xfaaf=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0xaaff[_0xd511d];return _0x3f148e;};'use strict';var _=require('lodash');var util=require(_0xfaaf('0x0'));var moment=require(_0xfaaf('0x1'));var BPromise=require(_0xfaaf('0x2'));var rs=require(_0xfaaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfaaf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfaaf('0x5'));var config=require(_0xfaaf('0x6'));var jayson=require(_0xfaaf('0x7'));var client=jayson[_0xfaaf('0x8')][_0xfaaf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x392c8c,_0x20bff4,_0x1fc27a){return new BPromise(function(_0x34e625,_0x357c64){return client[_0xfaaf('0xa')](_0x392c8c,_0x1fc27a)[_0xfaaf('0xb')](function(_0x3df5d5){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x20bff4,_0xfaaf('0xc'));logger[_0xfaaf('0xd')](_0xfaaf('0xe'),_0x20bff4,_0xfaaf('0xc'),JSON[_0xfaaf('0xf')](_0x3df5d5));if(_0x3df5d5[_0xfaaf('0x10')]){if(_0x3df5d5[_0xfaaf('0x10')]['code']===0x1f4){logger['error'](_0xfaaf('0x11'),_0x20bff4,_0x3df5d5[_0xfaaf('0x10')][_0xfaaf('0x12')]);return _0x357c64(_0x3df5d5[_0xfaaf('0x10')]['message']);}logger[_0xfaaf('0x10')](_0xfaaf('0x11'),_0x20bff4,_0x3df5d5[_0xfaaf('0x10')][_0xfaaf('0x12')]);return _0x34e625(_0x3df5d5[_0xfaaf('0x10')][_0xfaaf('0x12')]);}else{logger['info'](_0xfaaf('0x11'),_0x20bff4,_0xfaaf('0xc'));_0x34e625(_0x3df5d5[_0xfaaf('0x13')][_0xfaaf('0x12')]);}})[_0xfaaf('0x14')](function(_0x5566ea){logger[_0xfaaf('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x20bff4,_0x5566ea);_0x357c64(_0x5566ea);});});} \ No newline at end of file +var _0x8ca7=['rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x8ca7,0x9b));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x78ca('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x78ca('0x1'));var fs=require('fs');var Redis=require(_0x78ca('0x2'));var db=require(_0x78ca('0x3'))['db'];var utils=require(_0x78ca('0x4'));var logger=require(_0x78ca('0x5'))(_0x78ca('0x6'));var config=require('../../config/environment');var jayson=require(_0x78ca('0x7'));var client=jayson[_0x78ca('0x8')][_0x78ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46d126,_0x2d36ca,_0x11440e){return new BPromise(function(_0x1972a7,_0x101302){return client[_0x78ca('0xa')](_0x46d126,_0x11440e)[_0x78ca('0xb')](function(_0x7e4f57){logger[_0x78ca('0xc')](_0x78ca('0xd'),_0x2d36ca,_0x78ca('0xe'));logger[_0x78ca('0xf')](_0x78ca('0x10'),_0x2d36ca,_0x78ca('0xe'),JSON[_0x78ca('0x11')](_0x7e4f57));if(_0x7e4f57['error']){if(_0x7e4f57['error'][_0x78ca('0x12')]===0x1f4){logger[_0x78ca('0x13')](_0x78ca('0xd'),_0x2d36ca,_0x7e4f57[_0x78ca('0x13')][_0x78ca('0x14')]);return _0x101302(_0x7e4f57[_0x78ca('0x13')][_0x78ca('0x14')]);}logger[_0x78ca('0x13')](_0x78ca('0xd'),_0x2d36ca,_0x7e4f57[_0x78ca('0x13')][_0x78ca('0x14')]);return _0x1972a7(_0x7e4f57['error']['message']);}else{logger[_0x78ca('0xc')](_0x78ca('0xd'),_0x2d36ca,_0x78ca('0xe'));_0x1972a7(_0x7e4f57[_0x78ca('0x15')][_0x78ca('0x14')]);}})[_0x78ca('0x16')](function(_0x52bea9){logger[_0x78ca('0x13')](_0x78ca('0xd'),_0x2d36ca,_0x52bea9);_0x101302(_0x52bea9);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index e9a4664..ecea668 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 _0xbd36=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','post','update','delete','destroy','multer'];(function(_0x29ce4f,_0x691ee){var _0x8c2d3b=function(_0x4e8ff0){while(--_0x4e8ff0){_0x29ce4f['push'](_0x29ce4f['shift']());}};_0x8c2d3b(++_0x691ee);}(_0xbd36,0x65));var _0x6bd3=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xbd36[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0x6bd3('0x0'));var util=require(_0x6bd3('0x1'));var path=require(_0x6bd3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6bd3('0x3')]();var fs_extra=require(_0x6bd3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6bd3('0x5'));var config=require(_0x6bd3('0x6'));var controller=require(_0x6bd3('0x7'));router[_0x6bd3('0x8')]('/',auth['isAuthenticated'](),controller[_0x6bd3('0x9')]);router[_0x6bd3('0x8')](_0x6bd3('0xa'),auth[_0x6bd3('0xb')](),controller[_0x6bd3('0xc')]);router[_0x6bd3('0xd')]('/',auth[_0x6bd3('0xb')](),controller['create']);router['put'](_0x6bd3('0xa'),auth['isAuthenticated'](),controller[_0x6bd3('0xe')]);router[_0x6bd3('0xf')](_0x6bd3('0xa'),auth[_0x6bd3('0xb')](),controller[_0x6bd3('0x10')]);module['exports']=router; \ No newline at end of file +var _0xd2f5=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x4b2e12,_0x4d6a24){var _0x473d85=function(_0x2d0e30){while(--_0x2d0e30){_0x4b2e12['push'](_0x4b2e12['shift']());}};_0x473d85(++_0x4d6a24);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x1dfea6,_0x4a041f){_0x1dfea6=_0x1dfea6-0x0;var _0x2570c6=_0xd2f5[_0x1dfea6];return _0x2570c6;};'use strict';var multer=require(_0x5d2f('0x0'));var util=require(_0x5d2f('0x1'));var path=require(_0x5d2f('0x2'));var timeout=require(_0x5d2f('0x3'));var express=require('express');var router=express[_0x5d2f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5d2f('0x5'));var config=require(_0x5d2f('0x6'));var controller=require(_0x5d2f('0x7'));router['get']('/',auth[_0x5d2f('0x8')](),controller[_0x5d2f('0x9')]);router[_0x5d2f('0xa')]('/:id',auth[_0x5d2f('0x8')](),controller[_0x5d2f('0xb')]);router[_0x5d2f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5d2f('0xd')](_0x5d2f('0xe'),auth['isAuthenticated'](),controller[_0x5d2f('0xf')]);router[_0x5d2f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5d2f('0x11')]);module[_0x5d2f('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 7effdbf..2ddd420 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 _0x0617=['STRING','TEXT','exports'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x0617,0x1ee));var _0x7061=function(_0x1bd633,_0xd11a7f){_0x1bd633=_0x1bd633-0x0;var _0x30806c=_0x0617[_0x1bd633];return _0x30806c;};'use strict';var Sequelize=require('sequelize');module[_0x7061('0x0')]={'name':{'type':Sequelize[_0x7061('0x1')]},'description':{'type':Sequelize[_0x7061('0x1')]},'html':{'type':Sequelize[_0x7061('0x2')]}}; \ No newline at end of file +var _0xa79d=['sequelize','exports','STRING','TEXT'];(function(_0xd04dbd,_0x3d8cbd){var _0x144995=function(_0x4aff7f){while(--_0x4aff7f){_0xd04dbd['push'](_0xd04dbd['shift']());}};_0x144995(++_0x3d8cbd);}(_0xa79d,0x120));var _0xda79=function(_0x1cacdc,_0x44cb57){_0x1cacdc=_0x1cacdc-0x0;var _0x2cb433=_0xa79d[_0x1cacdc];return _0x2cb433;};'use strict';var Sequelize=require(_0xda79('0x0'));module[_0xda79('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xda79('0x2')]},'html':{'type':Sequelize[_0xda79('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index a6cc908..b1d1a9b 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 _0x3cda=['pick','VIRTUAL','filter','merge','options','includeAll','rows','show','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','where'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3cda,0xb8));var _0xa3cd=function(_0x36ae11,_0x4c334e){_0x36ae11=_0x36ae11-0x0;var _0x470b3d=_0x3cda[_0x36ae11];return _0x470b3d;};'use strict';var emlformat=require(_0xa3cd('0x0'));var rimraf=require(_0xa3cd('0x1'));var zipdir=require(_0xa3cd('0x2'));var jsonpatch=require(_0xa3cd('0x3'));var rp=require('request-promise');var moment=require(_0xa3cd('0x4'));var BPromise=require(_0xa3cd('0x5'));var Mustache=require(_0xa3cd('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa3cd('0x7'));var csv=require('to-csv');var ejs=require(_0xa3cd('0x8'));var fs=require('fs');var fs_extra=require(_0xa3cd('0x9'));var _=require(_0xa3cd('0xa'));var squel=require(_0xa3cd('0xb'));var crypto=require('crypto');var jsforce=require(_0xa3cd('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa3cd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa3cd('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa3cd('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3cd('0x10'))(_0xa3cd('0x11'));var utils=require('../../config/utils');var config=require(_0xa3cd('0x12'));var licenseUtil=require(_0xa3cd('0x13'));var db=require(_0xa3cd('0x14'))['db'];function respondWithStatusCode(_0x4bf69f,_0x1d7c8c){_0x1d7c8c=_0x1d7c8c||0xcc;return function(_0x4602a8){if(_0x4602a8){return _0x4bf69f['sendStatus'](_0x1d7c8c);}return _0x4bf69f['status'](_0x1d7c8c)[_0xa3cd('0x15')]();};}function respondWithResult(_0x562cf7,_0x450a7e){_0x450a7e=_0x450a7e||0xc8;return function(_0x53ff52){if(_0x53ff52){return _0x562cf7['status'](_0x450a7e)[_0xa3cd('0x16')](_0x53ff52);}};}function respondWithFilteredResult(_0x10a447,_0x5f1a81){return function(_0x6bf34d){if(_0x6bf34d){var _0x40591b=typeof _0x5f1a81[_0xa3cd('0x17')]===_0xa3cd('0x18')&&typeof _0x5f1a81[_0xa3cd('0x19')]===_0xa3cd('0x18');var _0x50f9ac=_0x6bf34d['count'];var _0x145323=_0x40591b?0x0:_0x5f1a81['offset'];var _0x34f7a3=_0x40591b?_0x6bf34d[_0xa3cd('0x1a')]:_0x5f1a81[_0xa3cd('0x17')]+_0x5f1a81[_0xa3cd('0x19')];var _0x2922ba;if(_0x34f7a3>=_0x50f9ac){_0x34f7a3=_0x50f9ac;_0x2922ba=0xc8;}else{_0x2922ba=0xce;}_0x10a447[_0xa3cd('0x1b')](_0x2922ba);return _0x10a447[_0xa3cd('0x1c')](_0xa3cd('0x1d'),_0x145323+'-'+_0x34f7a3+'/'+_0x50f9ac)[_0xa3cd('0x16')](_0x6bf34d);}return null;};}function patchUpdates(_0x4f945f){return function(_0x3a2dac){try{jsonpatch[_0xa3cd('0x1e')](_0x3a2dac,_0x4f945f,!![]);}catch(_0x446697){return BPromise[_0xa3cd('0x1f')](_0x446697);}return _0x3a2dac[_0xa3cd('0x20')]();};}function saveUpdates(_0x29cf05,_0x16bdf7){return function(_0x10060c){if(_0x10060c){return _0x10060c['update'](_0x29cf05)['then'](function(_0x563133){return _0x563133;});}return null;};}function removeEntity(_0x4530c4,_0x225cec){return function(_0x442fb8){if(_0x442fb8){return _0x442fb8['destroy']()[_0xa3cd('0x21')](function(){var _0xf4720=_0x442fb8[_0xa3cd('0x22')]({'plain':!![]});var _0x33b25b=_0xa3cd('0x23');return db[_0xa3cd('0x24')]['destroy']({'where':{'type':_0x33b25b,'resourceId':_0xf4720['id']}})['then'](function(){return _0x442fb8;});})['then'](function(){_0x4530c4[_0xa3cd('0x1b')](0xcc)[_0xa3cd('0x15')]();});}};}function handleEntityNotFound(_0x4102b4,_0x456156){return function(_0x4021c4){if(!_0x4021c4){_0x4102b4['sendStatus'](0x194);}return _0x4021c4;};}function handleError(_0x378b78,_0x4a06dd){_0x4a06dd=_0x4a06dd||0x1f4;return function(_0x35124a){logger[_0xa3cd('0x25')](_0x35124a[_0xa3cd('0x26')]);if(_0x35124a[_0xa3cd('0x27')]){delete _0x35124a['name'];}_0x378b78[_0xa3cd('0x1b')](_0x4a06dd)[_0xa3cd('0x28')](_0x35124a);};}exports[_0xa3cd('0x29')]=function(_0x3e623d,_0x46d14c){var _0x5c7fb5={},_0x55ee00={},_0x6c64d={'count':0x0,'rows':[]};var _0x1e290c=_[_0xa3cd('0x2a')](db[_0xa3cd('0x2b')][_0xa3cd('0x2c')],function(_0x4fe276){return{'name':_0x4fe276[_0xa3cd('0x2d')],'type':_0x4fe276[_0xa3cd('0x2e')]['key']};});_0x55ee00[_0xa3cd('0x2f')]=_[_0xa3cd('0x2a')](_0x1e290c,'name');_0x55ee00[_0xa3cd('0x30')]=_['keys'](_0x3e623d[_0xa3cd('0x30')]);_0x55ee00[_0xa3cd('0x31')]=_[_0xa3cd('0x32')](_0x55ee00[_0xa3cd('0x2f')],_0x55ee00[_0xa3cd('0x30')]);_0x5c7fb5[_0xa3cd('0x33')]=_[_0xa3cd('0x32')](_0x55ee00['model'],qs[_0xa3cd('0x34')](_0x3e623d[_0xa3cd('0x30')][_0xa3cd('0x34')]));_0x5c7fb5[_0xa3cd('0x33')]=_0x5c7fb5[_0xa3cd('0x33')][_0xa3cd('0x35')]?_0x5c7fb5['attributes']:_0x55ee00[_0xa3cd('0x2f')];if(!_0x3e623d[_0xa3cd('0x30')]['hasOwnProperty'](_0xa3cd('0x36'))){_0x5c7fb5[_0xa3cd('0x19')]=qs[_0xa3cd('0x19')](_0x3e623d[_0xa3cd('0x30')][_0xa3cd('0x19')]);_0x5c7fb5[_0xa3cd('0x17')]=qs[_0xa3cd('0x17')](_0x3e623d[_0xa3cd('0x30')][_0xa3cd('0x17')]);}_0x5c7fb5['order']=qs['sort'](_0x3e623d[_0xa3cd('0x30')]['sort']);_0x5c7fb5[_0xa3cd('0x37')]=qs[_0xa3cd('0x31')](_[_0xa3cd('0x38')](_0x3e623d[_0xa3cd('0x30')],_0x55ee00['filters']),_0x1e290c);if(_0x3e623d[_0xa3cd('0x30')]['filter']){_0x5c7fb5['where']=_['merge'](_0x5c7fb5[_0xa3cd('0x37')],{'$or':_[_0xa3cd('0x2a')](_0x1e290c,function(_0x1a8c5d){if(_0x1a8c5d['type']!==_0xa3cd('0x39')){var _0x51592a={};_0x51592a[_0x1a8c5d[_0xa3cd('0x27')]]={'$like':'%'+_0x3e623d[_0xa3cd('0x30')][_0xa3cd('0x3a')]+'%'};return _0x51592a;}})});}_0x5c7fb5=_[_0xa3cd('0x3b')]({},_0x5c7fb5,_0x3e623d[_0xa3cd('0x3c')]);var _0x431077={'where':_0x5c7fb5[_0xa3cd('0x37')]};return db[_0xa3cd('0x2b')][_0xa3cd('0x1a')](_0x431077)['then'](function(_0x58384e){_0x6c64d[_0xa3cd('0x1a')]=_0x58384e;if(_0x3e623d['query'][_0xa3cd('0x3d')]){_0x5c7fb5['include']=[{'all':!![]}];}return db[_0xa3cd('0x2b')]['findAll'](_0x5c7fb5);})[_0xa3cd('0x21')](function(_0x8460b6){_0x6c64d[_0xa3cd('0x3e')]=_0x8460b6;return _0x6c64d;})[_0xa3cd('0x21')](respondWithFilteredResult(_0x46d14c,_0x5c7fb5))['catch'](handleError(_0x46d14c,null));};exports[_0xa3cd('0x3f')]=function(_0x3963f2,_0xcce476){var _0x4b6f72={'raw':!![],'where':{'id':_0x3963f2['params']['id']}},_0x223b30={};_0x223b30[_0xa3cd('0x2f')]=_[_0xa3cd('0x40')](db['Template'][_0xa3cd('0x2c')]);_0x223b30[_0xa3cd('0x30')]=_[_0xa3cd('0x40')](_0x3963f2['query']);_0x223b30[_0xa3cd('0x31')]=_[_0xa3cd('0x32')](_0x223b30[_0xa3cd('0x2f')],_0x223b30[_0xa3cd('0x30')]);_0x4b6f72['attributes']=_[_0xa3cd('0x32')](_0x223b30['model'],qs[_0xa3cd('0x34')](_0x3963f2[_0xa3cd('0x30')]['fields']));_0x4b6f72['attributes']=_0x4b6f72[_0xa3cd('0x33')][_0xa3cd('0x35')]?_0x4b6f72[_0xa3cd('0x33')]:_0x223b30['model'];if(_0x3963f2['query'][_0xa3cd('0x3d')]){_0x4b6f72[_0xa3cd('0x41')]=[{'all':!![]}];}_0x4b6f72=_['merge']({},_0x4b6f72,_0x3963f2[_0xa3cd('0x3c')]);return db['Template'][_0xa3cd('0x42')](_0x4b6f72)[_0xa3cd('0x21')](handleEntityNotFound(_0xcce476,null))['then'](respondWithResult(_0xcce476,null))[_0xa3cd('0x43')](handleError(_0xcce476,null));};exports[_0xa3cd('0x44')]=function(_0x15db62,_0x5184fd){return db[_0xa3cd('0x2b')][_0xa3cd('0x44')](_0x15db62[_0xa3cd('0x45')],{})[_0xa3cd('0x21')](function(_0x38f3ff){var _0x26c880=_0x15db62[_0xa3cd('0x46')][_0xa3cd('0x22')]({'plain':!![]});if(!_0x26c880)throw new Error(_0xa3cd('0x47'));if(_0x26c880[_0xa3cd('0x48')]===_0xa3cd('0x46')){var _0x3561b8=_0x38f3ff[_0xa3cd('0x22')]({'plain':!![]});var _0x2f3fde=_0xa3cd('0x23');return db[_0xa3cd('0x49')][_0xa3cd('0x42')]({'where':{'name':_0x2f3fde,'userProfileId':_0x26c880[_0xa3cd('0x4a')]},'raw':!![]})['then'](function(_0x29a028){if(_0x29a028&&_0x29a028[_0xa3cd('0x4b')]===0x0){return db[_0xa3cd('0x24')][_0xa3cd('0x44')]({'name':_0x3561b8['name'],'resourceId':_0x3561b8['id'],'type':_0x29a028['name'],'sectionId':_0x29a028['id']},{})[_0xa3cd('0x21')](function(){return _0x38f3ff;});}else{return _0x38f3ff;}})[_0xa3cd('0x43')](function(_0x4d694a){logger[_0xa3cd('0x25')](_0xa3cd('0x4c'),_0x4d694a);throw _0x4d694a;});}return _0x38f3ff;})[_0xa3cd('0x21')](respondWithResult(_0x5184fd,0xc9))['catch'](handleError(_0x5184fd,null));};exports[_0xa3cd('0x4d')]=function(_0x23bd34,_0x38edea){if(_0x23bd34[_0xa3cd('0x45')]['id']){delete _0x23bd34[_0xa3cd('0x45')]['id'];}return db[_0xa3cd('0x2b')]['find']({'where':{'id':_0x23bd34[_0xa3cd('0x4e')]['id']}})[_0xa3cd('0x21')](handleEntityNotFound(_0x38edea,null))['then'](saveUpdates(_0x23bd34[_0xa3cd('0x45')],null))['then'](respondWithResult(_0x38edea,null))['catch'](handleError(_0x38edea,null));};exports[_0xa3cd('0x4f')]=function(_0x49efb5,_0x532164){return db[_0xa3cd('0x2b')]['find']({'where':{'id':_0x49efb5[_0xa3cd('0x4e')]['id']}})[_0xa3cd('0x21')](handleEntityNotFound(_0x532164,null))['then'](removeEntity(_0x532164,null))[_0xa3cd('0x43')](handleError(_0x532164,null));}; \ No newline at end of file +var _0xb8db=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','Templates','stack','name','send','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x2024ab,_0xd9e809){var _0x26e1e1=function(_0x263ea0){while(--_0x263ea0){_0x2024ab['push'](_0x2024ab['shift']());}};_0x26e1e1(++_0xd9e809);}(_0xb8db,0xa3));var _0xbb8d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb8db[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xbb8d('0x0'));var rimraf=require(_0xbb8d('0x1'));var zipdir=require(_0xbb8d('0x2'));var jsonpatch=require(_0xbb8d('0x3'));var rp=require(_0xbb8d('0x4'));var moment=require(_0xbb8d('0x5'));var BPromise=require(_0xbb8d('0x6'));var Mustache=require(_0xbb8d('0x7'));var util=require(_0xbb8d('0x8'));var path=require(_0xbb8d('0x9'));var sox=require('sox');var csv=require(_0xbb8d('0xa'));var ejs=require(_0xbb8d('0xb'));var fs=require('fs');var fs_extra=require(_0xbb8d('0xc'));var _=require('lodash');var squel=require(_0xbb8d('0xd'));var crypto=require(_0xbb8d('0xe'));var jsforce=require(_0xbb8d('0xf'));var deskjs=require(_0xbb8d('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbb8d('0x11'));var Papa=require('papaparse');var Redis=require(_0xbb8d('0x12'));var authService=require(_0xbb8d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbb8d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb8d('0x15'))('api');var utils=require(_0xbb8d('0x16'));var config=require(_0xbb8d('0x17'));var licenseUtil=require(_0xbb8d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcb7cd4,_0x5104da){_0x5104da=_0x5104da||0xcc;return function(_0x20b69a){if(_0x20b69a){return _0xcb7cd4[_0xbb8d('0x19')](_0x5104da);}return _0xcb7cd4['status'](_0x5104da)[_0xbb8d('0x1a')]();};}function respondWithResult(_0x263f9e,_0x295dec){_0x295dec=_0x295dec||0xc8;return function(_0xc04c5a){if(_0xc04c5a){return _0x263f9e[_0xbb8d('0x1b')](_0x295dec)[_0xbb8d('0x1c')](_0xc04c5a);}};}function respondWithFilteredResult(_0x23b19a,_0x453734){return function(_0x1b7562){if(_0x1b7562){var _0x4e33b6=typeof _0x453734[_0xbb8d('0x1d')]===_0xbb8d('0x1e')&&typeof _0x453734[_0xbb8d('0x1f')]==='undefined';var _0x380dd0=_0x1b7562[_0xbb8d('0x20')];var _0x116b7b=_0x4e33b6?0x0:_0x453734[_0xbb8d('0x1d')];var _0x501d0a=_0x4e33b6?_0x1b7562[_0xbb8d('0x20')]:_0x453734[_0xbb8d('0x1d')]+_0x453734[_0xbb8d('0x1f')];var _0x41690e;if(_0x501d0a>=_0x380dd0){_0x501d0a=_0x380dd0;_0x41690e=0xc8;}else{_0x41690e=0xce;}_0x23b19a['status'](_0x41690e);return _0x23b19a[_0xbb8d('0x21')](_0xbb8d('0x22'),_0x116b7b+'-'+_0x501d0a+'/'+_0x380dd0)[_0xbb8d('0x1c')](_0x1b7562);}return null;};}function patchUpdates(_0x4d2f71){return function(_0x2a6dfe){try{jsonpatch['apply'](_0x2a6dfe,_0x4d2f71,!![]);}catch(_0xfd3ffe){return BPromise['reject'](_0xfd3ffe);}return _0x2a6dfe[_0xbb8d('0x23')]();};}function saveUpdates(_0x425fa9,_0x18da33){return function(_0x368bfe){if(_0x368bfe){return _0x368bfe[_0xbb8d('0x24')](_0x425fa9)[_0xbb8d('0x25')](function(_0x6c186f){return _0x6c186f;});}return null;};}function removeEntity(_0x5ba0b0,_0x358bce){return function(_0x339beb){if(_0x339beb){return _0x339beb[_0xbb8d('0x26')]()[_0xbb8d('0x25')](function(){var _0x37178f=_0x339beb['get']({'plain':!![]});var _0x369bcc=_0xbb8d('0x27');return db['UserProfileResource'][_0xbb8d('0x26')]({'where':{'type':_0x369bcc,'resourceId':_0x37178f['id']}})[_0xbb8d('0x25')](function(){return _0x339beb;});})[_0xbb8d('0x25')](function(){_0x5ba0b0['status'](0xcc)[_0xbb8d('0x1a')]();});}};}function handleEntityNotFound(_0x5344e8,_0x4e1c41){return function(_0x2e6a97){if(!_0x2e6a97){_0x5344e8[_0xbb8d('0x19')](0x194);}return _0x2e6a97;};}function handleError(_0x30b874,_0x56beb1){_0x56beb1=_0x56beb1||0x1f4;return function(_0x577613){logger['error'](_0x577613[_0xbb8d('0x28')]);if(_0x577613[_0xbb8d('0x29')]){delete _0x577613[_0xbb8d('0x29')];}_0x30b874[_0xbb8d('0x1b')](_0x56beb1)[_0xbb8d('0x2a')](_0x577613);};}exports['index']=function(_0x1b6345,_0x5d8e90){var _0xcba6e1={},_0x5c2549={},_0x32e28b={'count':0x0,'rows':[]};var _0x4b43d6=_[_0xbb8d('0x2b')](db[_0xbb8d('0x2c')][_0xbb8d('0x2d')],function(_0x4fd2dc){return{'name':_0x4fd2dc[_0xbb8d('0x2e')],'type':_0x4fd2dc[_0xbb8d('0x2f')][_0xbb8d('0x30')]};});_0x5c2549[_0xbb8d('0x31')]=_[_0xbb8d('0x2b')](_0x4b43d6,_0xbb8d('0x29'));_0x5c2549[_0xbb8d('0x32')]=_[_0xbb8d('0x33')](_0x1b6345[_0xbb8d('0x32')]);_0x5c2549[_0xbb8d('0x34')]=_[_0xbb8d('0x35')](_0x5c2549['model'],_0x5c2549[_0xbb8d('0x32')]);_0xcba6e1[_0xbb8d('0x36')]=_[_0xbb8d('0x35')](_0x5c2549[_0xbb8d('0x31')],qs['fields'](_0x1b6345['query']['fields']));_0xcba6e1[_0xbb8d('0x36')]=_0xcba6e1[_0xbb8d('0x36')]['length']?_0xcba6e1[_0xbb8d('0x36')]:_0x5c2549[_0xbb8d('0x31')];if(!_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x37')](_0xbb8d('0x38'))){_0xcba6e1[_0xbb8d('0x1f')]=qs[_0xbb8d('0x1f')](_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x1f')]);_0xcba6e1[_0xbb8d('0x1d')]=qs['offset'](_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x1d')]);}_0xcba6e1[_0xbb8d('0x39')]=qs[_0xbb8d('0x3a')](_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x3a')]);_0xcba6e1[_0xbb8d('0x3b')]=qs[_0xbb8d('0x34')](_[_0xbb8d('0x3c')](_0x1b6345['query'],_0x5c2549[_0xbb8d('0x34')]),_0x4b43d6);if(_0x1b6345['query'][_0xbb8d('0x3d')]){_0xcba6e1[_0xbb8d('0x3b')]=_[_0xbb8d('0x3e')](_0xcba6e1[_0xbb8d('0x3b')],{'$or':_[_0xbb8d('0x2b')](_0x4b43d6,function(_0x5e9147){if(_0x5e9147[_0xbb8d('0x2f')]!==_0xbb8d('0x3f')){var _0x4f6e5a={};_0x4f6e5a[_0x5e9147[_0xbb8d('0x29')]]={'$like':'%'+_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x3d')]+'%'};return _0x4f6e5a;}})});}_0xcba6e1=_[_0xbb8d('0x3e')]({},_0xcba6e1,_0x1b6345[_0xbb8d('0x40')]);var _0x114755={'where':_0xcba6e1[_0xbb8d('0x3b')]};return db[_0xbb8d('0x2c')][_0xbb8d('0x20')](_0x114755)[_0xbb8d('0x25')](function(_0x867731){_0x32e28b[_0xbb8d('0x20')]=_0x867731;if(_0x1b6345[_0xbb8d('0x32')][_0xbb8d('0x41')]){_0xcba6e1['include']=[{'all':!![]}];}return db[_0xbb8d('0x2c')][_0xbb8d('0x42')](_0xcba6e1);})[_0xbb8d('0x25')](function(_0x3a3f1b){_0x32e28b['rows']=_0x3a3f1b;return _0x32e28b;})[_0xbb8d('0x25')](respondWithFilteredResult(_0x5d8e90,_0xcba6e1))[_0xbb8d('0x43')](handleError(_0x5d8e90,null));};exports[_0xbb8d('0x44')]=function(_0x30695b,_0x13cd07){var _0x54b8a9={'raw':!![],'where':{'id':_0x30695b[_0xbb8d('0x45')]['id']}},_0x4c09b1={};_0x4c09b1['model']=_[_0xbb8d('0x33')](db[_0xbb8d('0x2c')]['rawAttributes']);_0x4c09b1[_0xbb8d('0x32')]=_[_0xbb8d('0x33')](_0x30695b[_0xbb8d('0x32')]);_0x4c09b1[_0xbb8d('0x34')]=_[_0xbb8d('0x35')](_0x4c09b1['model'],_0x4c09b1[_0xbb8d('0x32')]);_0x54b8a9[_0xbb8d('0x36')]=_['intersection'](_0x4c09b1[_0xbb8d('0x31')],qs[_0xbb8d('0x46')](_0x30695b['query'][_0xbb8d('0x46')]));_0x54b8a9[_0xbb8d('0x36')]=_0x54b8a9['attributes'][_0xbb8d('0x47')]?_0x54b8a9['attributes']:_0x4c09b1[_0xbb8d('0x31')];if(_0x30695b['query'][_0xbb8d('0x41')]){_0x54b8a9[_0xbb8d('0x48')]=[{'all':!![]}];}_0x54b8a9=_[_0xbb8d('0x3e')]({},_0x54b8a9,_0x30695b[_0xbb8d('0x40')]);return db[_0xbb8d('0x2c')][_0xbb8d('0x49')](_0x54b8a9)['then'](handleEntityNotFound(_0x13cd07,null))[_0xbb8d('0x25')](respondWithResult(_0x13cd07,null))[_0xbb8d('0x43')](handleError(_0x13cd07,null));};exports[_0xbb8d('0x4a')]=function(_0x74dd9b,_0x47dad1){return db[_0xbb8d('0x2c')][_0xbb8d('0x4a')](_0x74dd9b[_0xbb8d('0x4b')],{})[_0xbb8d('0x25')](function(_0x3723c4){var _0x235b52=_0x74dd9b[_0xbb8d('0x4c')][_0xbb8d('0x4d')]({'plain':!![]});if(!_0x235b52)throw new Error(_0xbb8d('0x4e'));if(_0x235b52['role']===_0xbb8d('0x4c')){var _0x43540c=_0x3723c4[_0xbb8d('0x4d')]({'plain':!![]});var _0x3d2440=_0xbb8d('0x27');return db['UserProfileSection'][_0xbb8d('0x49')]({'where':{'name':_0x3d2440,'userProfileId':_0x235b52[_0xbb8d('0x4f')]},'raw':!![]})[_0xbb8d('0x25')](function(_0x3d1638){if(_0x3d1638&&_0x3d1638[_0xbb8d('0x50')]===0x0){return db[_0xbb8d('0x51')][_0xbb8d('0x4a')]({'name':_0x43540c[_0xbb8d('0x29')],'resourceId':_0x43540c['id'],'type':_0x3d1638['name'],'sectionId':_0x3d1638['id']},{})[_0xbb8d('0x25')](function(){return _0x3723c4;});}else{return _0x3723c4;}})['catch'](function(_0x689fe6){logger['error'](_0xbb8d('0x52'),_0x689fe6);throw _0x689fe6;});}return _0x3723c4;})[_0xbb8d('0x25')](respondWithResult(_0x47dad1,0xc9))['catch'](handleError(_0x47dad1,null));};exports[_0xbb8d('0x24')]=function(_0x2e40d8,_0x706feb){if(_0x2e40d8[_0xbb8d('0x4b')]['id']){delete _0x2e40d8[_0xbb8d('0x4b')]['id'];}return db[_0xbb8d('0x2c')][_0xbb8d('0x49')]({'where':{'id':_0x2e40d8['params']['id']}})[_0xbb8d('0x25')](handleEntityNotFound(_0x706feb,null))[_0xbb8d('0x25')](saveUpdates(_0x2e40d8['body'],null))[_0xbb8d('0x25')](respondWithResult(_0x706feb,null))[_0xbb8d('0x43')](handleError(_0x706feb,null));};exports[_0xbb8d('0x26')]=function(_0x5e04f9,_0x10fa08){return db['Template'][_0xbb8d('0x49')]({'where':{'id':_0x5e04f9['params']['id']}})[_0xbb8d('0x25')](handleEntityNotFound(_0x10fa08,null))[_0xbb8d('0x25')](removeEntity(_0x10fa08,null))[_0xbb8d('0x43')](handleError(_0x10fa08,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c228210..1716d33 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 _0x9c2d=['tools_templates','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','Template'];(function(_0x2d1fdb,_0x50d2de){var _0x19e74b=function(_0x30fee6){while(--_0x30fee6){_0x2d1fdb['push'](_0x2d1fdb['shift']());}};_0x19e74b(++_0x50d2de);}(_0x9c2d,0x1eb));var _0xd9c2=function(_0x3e1e53,_0x177e46){_0x3e1e53=_0x3e1e53-0x0;var _0x3ceb82=_0x9c2d[_0x3e1e53];return _0x3ceb82;};'use strict';var _=require('lodash');var util=require(_0xd9c2('0x0'));var logger=require('../../config/logger')(_0xd9c2('0x1'));var moment=require(_0xd9c2('0x2'));var BPromise=require(_0xd9c2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9c2('0x4'));var rimraf=require(_0xd9c2('0x5'));var config=require(_0xd9c2('0x6'));var attributes=require('./template.attributes');module[_0xd9c2('0x7')]=function(_0x4864cf,_0x56a174){return _0x4864cf['define'](_0xd9c2('0x8'),attributes,{'tableName':_0xd9c2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9e7=['Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x355f60,_0x482ecb){var _0x5018fa=function(_0x383d4d){while(--_0x383d4d){_0x355f60['push'](_0x355f60['shift']());}};_0x5018fa(++_0x482ecb);}(_0xf9e7,0x92));var _0x7f9e=function(_0x491ee6,_0x290b18){_0x491ee6=_0x491ee6-0x0;var _0x541e79=_0xf9e7[_0x491ee6];return _0x541e79;};'use strict';var _=require(_0x7f9e('0x0'));var util=require('util');var logger=require(_0x7f9e('0x1'))(_0x7f9e('0x2'));var moment=require(_0x7f9e('0x3'));var BPromise=require(_0x7f9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f9e('0x5'));var rimraf=require(_0x7f9e('0x6'));var config=require(_0x7f9e('0x7'));var attributes=require('./template.attributes');module[_0x7f9e('0x8')]=function(_0xccb7a4,_0x4108f4){return _0xccb7a4[_0x7f9e('0x9')](_0x7f9e('0xa'),attributes,{'tableName':_0x7f9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 501ce28..eaaebf4 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 _0x7ee4=['code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','map','model','debug','stringify','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error'];(function(_0x5b2eec,_0x208553){var _0x2f73f9=function(_0x4087a1){while(--_0x4087a1){_0x5b2eec['push'](_0x5b2eec['shift']());}};_0x2f73f9(++_0x208553);}(_0x7ee4,0xac));var _0x47ee=function(_0x14a129,_0x319fc4){_0x14a129=_0x14a129-0x0;var _0x20d46d=_0x7ee4[_0x14a129];return _0x20d46d;};'use strict';var _=require('lodash');var util=require(_0x47ee('0x0'));var moment=require(_0x47ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x47ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x47ee('0x3'));var logger=require(_0x47ee('0x4'))(_0x47ee('0x5'));var config=require(_0x47ee('0x6'));var jayson=require(_0x47ee('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x191da7,_0x1dce67,_0x5df172){return new BPromise(function(_0x419af6,_0x1989e3){return client[_0x47ee('0x8')](_0x191da7,_0x5df172)[_0x47ee('0x9')](function(_0x141d5c){logger[_0x47ee('0xa')]('Template,\x20%s,\x20%s',_0x1dce67,_0x47ee('0xb'));logger['debug'](_0x47ee('0xc'),_0x1dce67,'request\x20sent',JSON['stringify'](_0x141d5c));if(_0x141d5c['error']){if(_0x141d5c[_0x47ee('0xd')][_0x47ee('0xe')]===0x1f4){logger[_0x47ee('0xd')](_0x47ee('0xf'),_0x1dce67,_0x141d5c[_0x47ee('0xd')]['message']);return _0x1989e3(_0x141d5c[_0x47ee('0xd')][_0x47ee('0x10')]);}logger[_0x47ee('0xd')]('Template,\x20%s,\x20%s',_0x1dce67,_0x141d5c[_0x47ee('0xd')]['message']);return _0x419af6(_0x141d5c[_0x47ee('0xd')]['message']);}else{logger['info'](_0x47ee('0xf'),_0x1dce67,_0x47ee('0xb'));_0x419af6(_0x141d5c[_0x47ee('0x11')]['message']);}})[_0x47ee('0x12')](function(_0x4a1baf){logger[_0x47ee('0xd')](_0x47ee('0xf'),_0x1dce67,_0x4a1baf);_0x1989e3(_0x4a1baf);});});}exports[_0x47ee('0x13')]=function(_0x8a47ec){var _0x55a166=this;return new Promise(function(_0x2ae3e1,_0x5af995){return db[_0x47ee('0x14')][_0x47ee('0x15')]({'raw':_0x8a47ec[_0x47ee('0x16')]?_0x8a47ec[_0x47ee('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x8a47ec[_0x47ee('0x16')]?_0x8a47ec[_0x47ee('0x16')][_0x47ee('0x17')]||null:null,'attributes':_0x8a47ec[_0x47ee('0x16')]?_0x8a47ec[_0x47ee('0x16')][_0x47ee('0x18')]||null:null,'limit':_0x8a47ec[_0x47ee('0x16')]?_0x8a47ec['options'][_0x47ee('0x19')]||null:null,'include':_0x8a47ec[_0x47ee('0x16')]?_0x8a47ec[_0x47ee('0x16')][_0x47ee('0x1a')]?_[_0x47ee('0x1b')](_0x8a47ec['options'][_0x47ee('0x1a')],function(_0x26d84c){return{'model':db[_0x26d84c[_0x47ee('0x1c')]],'as':_0x26d84c['as'],'attributes':_0x26d84c['attributes'],'include':_0x26d84c[_0x47ee('0x1a')]?_['map'](_0x26d84c[_0x47ee('0x1a')],function(_0x2b8d39){return{'model':db[_0x2b8d39[_0x47ee('0x1c')]],'as':_0x2b8d39['as'],'attributes':_0x2b8d39[_0x47ee('0x18')],'include':_0x2b8d39[_0x47ee('0x1a')]?_[_0x47ee('0x1b')](_0x2b8d39[_0x47ee('0x1a')],function(_0x2a8c01){return{'model':db[_0x2a8c01[_0x47ee('0x1c')]],'as':_0x2a8c01['as'],'attributes':_0x2a8c01[_0x47ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0x47ee('0x9')](function(_0x30798f){logger[_0x47ee('0xa')](_0x47ee('0x13'),_0x8a47ec);logger[_0x47ee('0x1d')](_0x47ee('0x13'),_0x8a47ec,JSON[_0x47ee('0x1e')](_0x30798f));_0x2ae3e1(_0x30798f);})[_0x47ee('0x12')](function(_0x273d25){logger[_0x47ee('0xd')](_0x47ee('0x13'),_0x273d25[_0x47ee('0x10')],_0x8a47ec);_0x5af995(_0x55a166[_0x47ee('0xd')](0x1f4,_0x273d25[_0x47ee('0x10')]));});});}; \ No newline at end of file +var _0xbe99=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','model','map','lodash','util'];(function(_0x229c8b,_0x3fcef6){var _0x520a1b=function(_0x41bbb8){while(--_0x41bbb8){_0x229c8b['push'](_0x229c8b['shift']());}};_0x520a1b(++_0x3fcef6);}(_0xbe99,0x196));var _0x9be9=function(_0x4c742f,_0x2bd40a){_0x4c742f=_0x4c742f-0x0;var _0x2913ae=_0xbe99[_0x4c742f];return _0x2913ae;};'use strict';var _=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var moment=require(_0x9be9('0x2'));var BPromise=require(_0x9be9('0x3'));var rs=require(_0x9be9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9be9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9be9('0x6'))(_0x9be9('0x7'));var config=require(_0x9be9('0x8'));var jayson=require(_0x9be9('0x9'));var client=jayson['client'][_0x9be9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eccd7,_0x4dc53f,_0x49694d){return new BPromise(function(_0x7e0cd,_0x33f952){return client[_0x9be9('0xb')](_0x1eccd7,_0x49694d)[_0x9be9('0xc')](function(_0x178a02){logger[_0x9be9('0xd')](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));logger[_0x9be9('0x10')](_0x9be9('0x11'),_0x4dc53f,_0x9be9('0xf'),JSON[_0x9be9('0x12')](_0x178a02));if(_0x178a02[_0x9be9('0x13')]){if(_0x178a02[_0x9be9('0x13')][_0x9be9('0x14')]===0x1f4){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x33f952(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x7e0cd(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}else{logger['info'](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));_0x7e0cd(_0x178a02[_0x9be9('0x16')][_0x9be9('0x15')]);}})[_0x9be9('0x17')](function(_0x5287d9){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x5287d9);_0x33f952(_0x5287d9);});});}exports[_0x9be9('0x18')]=function(_0x5f2612){var _0x49649f=this;return new Promise(function(_0x9a37a0,_0x1b45b6){return db[_0x9be9('0x19')]['findAll']({'raw':_0x5f2612['options']?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1c')]||null:null,'attributes':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1d')]||null:null,'limit':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1e')]||null:null,'include':_0x5f2612[_0x9be9('0x1a')]?_0x5f2612['options'][_0x9be9('0x1f')]?_['map'](_0x5f2612[_0x9be9('0x1a')][_0x9be9('0x1f')],function(_0x451e60){return{'model':db[_0x451e60[_0x9be9('0x20')]],'as':_0x451e60['as'],'attributes':_0x451e60['attributes'],'include':_0x451e60[_0x9be9('0x1f')]?_[_0x9be9('0x21')](_0x451e60[_0x9be9('0x1f')],function(_0x42a486){return{'model':db[_0x42a486[_0x9be9('0x20')]],'as':_0x42a486['as'],'attributes':_0x42a486[_0x9be9('0x1d')],'include':_0x42a486[_0x9be9('0x1f')]?_[_0x9be9('0x21')](_0x42a486[_0x9be9('0x1f')],function(_0x27be52){return{'model':db[_0x27be52['model']],'as':_0x27be52['as'],'attributes':_0x27be52[_0x9be9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9be9('0xc')](function(_0x26db60){logger[_0x9be9('0xd')](_0x9be9('0x18'),_0x5f2612);logger['debug'](_0x9be9('0x18'),_0x5f2612,JSON[_0x9be9('0x12')](_0x26db60));_0x9a37a0(_0x26db60);})['catch'](function(_0x199623){logger['error'](_0x9be9('0x18'),_0x199623[_0x9be9('0x15')],_0x5f2612);_0x1b45b6(_0x49649f[_0x9be9('0x13')](0x1f4,_0x199623[_0x9be9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 63c6a95..2db15e8 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 _0xa7b0=['connect-timeout','express','Router','fs-extra','../../config/environment','./trigger.controller','index','get','/:id','isAuthenticated','show','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','/:id/any_conditions','addAnyCondition','put','update','destroy','multer','util','path'];(function(_0x78cad1,_0xe4df2a){var _0x5409c7=function(_0x483f31){while(--_0x483f31){_0x78cad1['push'](_0x78cad1['shift']());}};_0x5409c7(++_0xe4df2a);}(_0xa7b0,0x1ad));var _0x0a7b=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0xa7b0[_0x2002b3];return _0x2756f0;};'use strict';var multer=require(_0x0a7b('0x0'));var util=require(_0x0a7b('0x1'));var path=require(_0x0a7b('0x2'));var timeout=require(_0x0a7b('0x3'));var express=require(_0x0a7b('0x4'));var router=express[_0x0a7b('0x5')]();var fs_extra=require(_0x0a7b('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0a7b('0x7'));var controller=require(_0x0a7b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0a7b('0x9')]);router[_0x0a7b('0xa')](_0x0a7b('0xb'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0xd')]);router[_0x0a7b('0xa')]('/:id/all_conditions',auth[_0x0a7b('0xc')](),controller[_0x0a7b('0xe')]);router[_0x0a7b('0xa')]('/:id/any_conditions',auth[_0x0a7b('0xc')](),controller[_0x0a7b('0xf')]);router['get'](_0x0a7b('0x10'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0x11')]);router[_0x0a7b('0x12')]('/',auth['isAuthenticated'](),controller[_0x0a7b('0x13')]);router[_0x0a7b('0x12')](_0x0a7b('0x14'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0x15')]);router[_0x0a7b('0x12')](_0x0a7b('0x16'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0x17')]);router[_0x0a7b('0x12')](_0x0a7b('0x10'),auth[_0x0a7b('0xc')](),controller['addAction']);router[_0x0a7b('0x18')](_0x0a7b('0xb'),auth['isAuthenticated'](),controller[_0x0a7b('0x19')]);router['delete'](_0x0a7b('0xb'),auth['isAuthenticated'](),controller[_0x0a7b('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xd5ab=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','update','delete'];(function(_0x494965,_0x48ace5){var _0x3e682e=function(_0x463373){while(--_0x463373){_0x494965['push'](_0x494965['shift']());}};_0x3e682e(++_0x48ace5);}(_0xd5ab,0x89));var _0xbd5a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd5ab[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xbd5a('0x0'));var util=require(_0xbd5a('0x1'));var path=require(_0xbd5a('0x2'));var timeout=require(_0xbd5a('0x3'));var express=require('express');var router=express[_0xbd5a('0x4')]();var fs_extra=require(_0xbd5a('0x5'));var auth=require(_0xbd5a('0x6'));var interaction=require(_0xbd5a('0x7'));var config=require('../../config/environment');var controller=require(_0xbd5a('0x8'));router[_0xbd5a('0x9')]('/',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0xb')]);router[_0xbd5a('0x9')](_0xbd5a('0xc'),auth['isAuthenticated'](),controller[_0xbd5a('0xd')]);router[_0xbd5a('0x9')](_0xbd5a('0xe'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0xf')]);router[_0xbd5a('0x9')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xbd5a('0x10')]);router[_0xbd5a('0x9')](_0xbd5a('0x11'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x12')]);router[_0xbd5a('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xbd5a('0xe'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x14')]);router[_0xbd5a('0x13')]('/:id/any_conditions',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x15')]);router['post']('/:id/actions',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x16')]);router['put']('/:id',auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x17')]);router[_0xbd5a('0x18')](_0xbd5a('0xc'),auth[_0xbd5a('0xa')](),controller[_0xbd5a('0x19')]);module[_0xbd5a('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 390d2c3..b8ba49e 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 _0x7291=['exports','STRING','BOOLEAN','sequelize'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7291,0x1a7));var _0x1729=function(_0x2d43b,_0x306e76){_0x2d43b=_0x2d43b-0x0;var _0x210c30=_0x7291[_0x2d43b];return _0x210c30;};'use strict';var Sequelize=require(_0x1729('0x0'));module[_0x1729('0x1')]={'name':{'type':Sequelize[_0x1729('0x2')]},'channel':{'type':Sequelize[_0x1729('0x2')]},'description':{'type':Sequelize[_0x1729('0x2')]},'status':{'type':Sequelize[_0x1729('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5825=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4f11df,_0x5dafb0){var _0x2af83f=function(_0xe9c9d9){while(--_0xe9c9d9){_0x4f11df['push'](_0x4f11df['shift']());}};_0x2af83f(++_0x5dafb0);}(_0x5825,0xb5));var _0x5582=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5825[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x5582('0x0'));module[_0x5582('0x1')]={'name':{'type':Sequelize[_0x5582('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5582('0x2')]},'status':{'type':Sequelize[_0x5582('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e000f1a..52a2815 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 _0x23a3=['order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','update','destroy','get','Triggers','then','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','keys','filters','attributes','intersection','query','fields','length','hasOwnProperty','nolimit'];(function(_0x395a88,_0x5a183a){var _0x35a044=function(_0x24829a){while(--_0x24829a){_0x395a88['push'](_0x395a88['shift']());}};_0x35a044(++_0x5a183a);}(_0x23a3,0x84));var _0x323a=function(_0x3c4047,_0x26c881){_0x3c4047=_0x3c4047-0x0;var _0xea78a2=_0x23a3[_0x3c4047];return _0xea78a2;};'use strict';var emlformat=require(_0x323a('0x0'));var rimraf=require(_0x323a('0x1'));var zipdir=require(_0x323a('0x2'));var jsonpatch=require(_0x323a('0x3'));var rp=require(_0x323a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x323a('0x5'));var util=require('util');var path=require(_0x323a('0x6'));var sox=require(_0x323a('0x7'));var csv=require(_0x323a('0x8'));var ejs=require(_0x323a('0x9'));var fs=require('fs');var fs_extra=require(_0x323a('0xa'));var _=require(_0x323a('0xb'));var squel=require(_0x323a('0xc'));var crypto=require(_0x323a('0xd'));var jsforce=require(_0x323a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x323a('0x8'));var querystring=require(_0x323a('0xf'));var Papa=require(_0x323a('0x10'));var Redis=require(_0x323a('0x11'));var authService=require(_0x323a('0x12'));var qs=require(_0x323a('0x13'));var as=require(_0x323a('0x14'));var hardwareService=require(_0x323a('0x15'));var logger=require(_0x323a('0x16'))('api');var utils=require(_0x323a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x323a('0x18'))['db'];function respondWithStatusCode(_0x122462,_0x4dc274){_0x4dc274=_0x4dc274||0xcc;return function(_0x4697a3){if(_0x4697a3){return _0x122462[_0x323a('0x19')](_0x4dc274);}return _0x122462[_0x323a('0x1a')](_0x4dc274)[_0x323a('0x1b')]();};}function respondWithResult(_0x347e2b,_0x3b9236){_0x3b9236=_0x3b9236||0xc8;return function(_0x4d0cd5){if(_0x4d0cd5){return _0x347e2b['status'](_0x3b9236)[_0x323a('0x1c')](_0x4d0cd5);}};}function respondWithFilteredResult(_0x1ba0d2,_0x257f96){return function(_0x308d1e){if(_0x308d1e){var _0x38df4f=typeof _0x257f96['offset']==='undefined'&&typeof _0x257f96[_0x323a('0x1d')]===_0x323a('0x1e');var _0x4f28e8=_0x308d1e[_0x323a('0x1f')];var _0x1d432d=_0x38df4f?0x0:_0x257f96[_0x323a('0x20')];var _0x312370=_0x38df4f?_0x308d1e[_0x323a('0x1f')]:_0x257f96[_0x323a('0x20')]+_0x257f96[_0x323a('0x1d')];var _0x1c1d11;if(_0x312370>=_0x4f28e8){_0x312370=_0x4f28e8;_0x1c1d11=0xc8;}else{_0x1c1d11=0xce;}_0x1ba0d2[_0x323a('0x1a')](_0x1c1d11);return _0x1ba0d2[_0x323a('0x21')]('Content-Range',_0x1d432d+'-'+_0x312370+'/'+_0x4f28e8)[_0x323a('0x1c')](_0x308d1e);}return null;};}function patchUpdates(_0xb98e68){return function(_0x2fc7f6){try{jsonpatch[_0x323a('0x22')](_0x2fc7f6,_0xb98e68,!![]);}catch(_0x5b0ea9){return BPromise[_0x323a('0x23')](_0x5b0ea9);}return _0x2fc7f6['save']();};}function saveUpdates(_0x377d3c,_0x40d41a){return function(_0x305ac0){if(_0x305ac0){return _0x305ac0[_0x323a('0x24')](_0x377d3c)['then'](function(_0x1340aa){return _0x1340aa;});}return null;};}function removeEntity(_0x7f92f7,_0xa77adb){return function(_0x39a0bd){if(_0x39a0bd){return _0x39a0bd[_0x323a('0x25')]()['then'](function(){var _0x295e1c=_0x39a0bd[_0x323a('0x26')]({'plain':!![]});var _0x405672=_0x323a('0x27');return db['UserProfileResource'][_0x323a('0x25')]({'where':{'type':_0x405672,'resourceId':_0x295e1c['id']}})[_0x323a('0x28')](function(){return _0x39a0bd;});})[_0x323a('0x28')](function(){_0x7f92f7['status'](0xcc)[_0x323a('0x1b')]();});}};}function handleEntityNotFound(_0x55fe3d,_0x1b45a1){return function(_0x1db8aa){if(!_0x1db8aa){_0x55fe3d[_0x323a('0x19')](0x194);}return _0x1db8aa;};}function handleError(_0x3acd70,_0xd97319){_0xd97319=_0xd97319||0x1f4;return function(_0x3364b7){logger['error'](_0x3364b7[_0x323a('0x29')]);if(_0x3364b7['name']){delete _0x3364b7[_0x323a('0x2a')];}_0x3acd70[_0x323a('0x1a')](_0xd97319)[_0x323a('0x2b')](_0x3364b7);};}exports[_0x323a('0x2c')]=function(_0x584118,_0xb5420){var _0x4979e5={},_0x3f72e7={},_0x476949={'count':0x0,'rows':[]};var _0x590f00=_[_0x323a('0x2d')](db[_0x323a('0x2e')][_0x323a('0x2f')],function(_0x4de467){return{'name':_0x4de467['fieldName'],'type':_0x4de467[_0x323a('0x30')][_0x323a('0x31')]};});_0x3f72e7[_0x323a('0x32')]=_[_0x323a('0x2d')](_0x590f00,_0x323a('0x2a'));_0x3f72e7['query']=_[_0x323a('0x33')](_0x584118['query']);_0x3f72e7[_0x323a('0x34')]=_['intersection'](_0x3f72e7[_0x323a('0x32')],_0x3f72e7['query']);_0x4979e5[_0x323a('0x35')]=_[_0x323a('0x36')](_0x3f72e7[_0x323a('0x32')],qs['fields'](_0x584118[_0x323a('0x37')][_0x323a('0x38')]));_0x4979e5[_0x323a('0x35')]=_0x4979e5[_0x323a('0x35')][_0x323a('0x39')]?_0x4979e5[_0x323a('0x35')]:_0x3f72e7[_0x323a('0x32')];if(!_0x584118[_0x323a('0x37')][_0x323a('0x3a')](_0x323a('0x3b'))){_0x4979e5[_0x323a('0x1d')]=qs['limit'](_0x584118[_0x323a('0x37')][_0x323a('0x1d')]);_0x4979e5[_0x323a('0x20')]=qs[_0x323a('0x20')](_0x584118[_0x323a('0x37')]['offset']);}_0x4979e5[_0x323a('0x3c')]=qs[_0x323a('0x3d')](_0x584118['query'][_0x323a('0x3d')]);_0x4979e5[_0x323a('0x3e')]=qs['filters'](_[_0x323a('0x3f')](_0x584118['query'],_0x3f72e7[_0x323a('0x34')]),_0x590f00);if(_0x584118[_0x323a('0x37')][_0x323a('0x40')]){_0x4979e5[_0x323a('0x3e')]=_[_0x323a('0x41')](_0x4979e5['where'],{'$or':_[_0x323a('0x2d')](_0x590f00,function(_0x1f0bd3){if(_0x1f0bd3[_0x323a('0x30')]!==_0x323a('0x42')){var _0x7c052b={};_0x7c052b[_0x1f0bd3[_0x323a('0x2a')]]={'$like':'%'+_0x584118['query'][_0x323a('0x40')]+'%'};return _0x7c052b;}})});}_0x4979e5=_['merge']({},_0x4979e5,_0x584118[_0x323a('0x43')]);var _0x4d0409={'where':_0x4979e5[_0x323a('0x3e')]};return db['Trigger'][_0x323a('0x1f')](_0x4d0409)[_0x323a('0x28')](function(_0x4b2938){_0x476949['count']=_0x4b2938;if(_0x584118[_0x323a('0x37')]['includeAll']){_0x4979e5['include']=[{'all':!![]}];}return db[_0x323a('0x2e')]['findAll'](_0x4979e5);})[_0x323a('0x28')](function(_0x1e93c2){_0x476949[_0x323a('0x44')]=_0x1e93c2;return _0x476949;})[_0x323a('0x28')](respondWithFilteredResult(_0xb5420,_0x4979e5))[_0x323a('0x45')](handleError(_0xb5420,null));};exports[_0x323a('0x46')]=function(_0x4dcc75,_0x520724){var _0x2e4dd6={'raw':![],'where':{'id':_0x4dcc75['params']['id']}},_0x11c247={};_0x11c247[_0x323a('0x32')]=_[_0x323a('0x33')](db[_0x323a('0x2e')][_0x323a('0x2f')]);_0x11c247[_0x323a('0x37')]=_['keys'](_0x4dcc75[_0x323a('0x37')]);_0x11c247[_0x323a('0x34')]=_[_0x323a('0x36')](_0x11c247[_0x323a('0x32')],_0x11c247[_0x323a('0x37')]);_0x2e4dd6['attributes']=_[_0x323a('0x36')](_0x11c247[_0x323a('0x32')],qs[_0x323a('0x38')](_0x4dcc75[_0x323a('0x37')]['fields']));_0x2e4dd6[_0x323a('0x35')]=_0x2e4dd6[_0x323a('0x35')][_0x323a('0x39')]?_0x2e4dd6['attributes']:_0x11c247['model'];if(_0x4dcc75[_0x323a('0x37')][_0x323a('0x47')]){_0x2e4dd6[_0x323a('0x48')]=[{'all':!![]}];}_0x2e4dd6=_[_0x323a('0x41')]({},_0x2e4dd6,_0x4dcc75['options']);return db[_0x323a('0x2e')][_0x323a('0x49')](_0x2e4dd6)[_0x323a('0x28')](handleEntityNotFound(_0x520724,null))[_0x323a('0x28')](respondWithResult(_0x520724,null))[_0x323a('0x45')](handleError(_0x520724,null));};exports[_0x323a('0x4a')]=function(_0x14cd5c,_0x1bfcc9){return db[_0x323a('0x2e')][_0x323a('0x4a')](_0x14cd5c[_0x323a('0x4b')],{})[_0x323a('0x28')](function(_0x12bb60){var _0x566d9d=_0x14cd5c[_0x323a('0x4c')][_0x323a('0x26')]({'plain':!![]});if(!_0x566d9d)throw new Error(_0x323a('0x4d'));if(_0x566d9d[_0x323a('0x4e')]==='user'){var _0x4f612a=_0x12bb60[_0x323a('0x26')]({'plain':!![]});var _0x5cd868=_0x323a('0x27');return db[_0x323a('0x4f')][_0x323a('0x49')]({'where':{'name':_0x5cd868,'userProfileId':_0x566d9d[_0x323a('0x50')]},'raw':!![]})[_0x323a('0x28')](function(_0x32a28e){if(_0x32a28e&&_0x32a28e[_0x323a('0x51')]===0x0){return db[_0x323a('0x52')][_0x323a('0x4a')]({'name':_0x4f612a[_0x323a('0x2a')],'resourceId':_0x4f612a['id'],'type':_0x32a28e[_0x323a('0x2a')],'sectionId':_0x32a28e['id']},{})[_0x323a('0x28')](function(){return _0x12bb60;});}else{return _0x12bb60;}})['catch'](function(_0x4db18c){logger['error'](_0x323a('0x53'),_0x4db18c);throw _0x4db18c;});}return _0x12bb60;})['then'](respondWithResult(_0x1bfcc9,0xc9))['catch'](handleError(_0x1bfcc9,null));};exports[_0x323a('0x24')]=function(_0x63c6f5,_0x1b0fde){if(_0x63c6f5[_0x323a('0x4b')]['id']){delete _0x63c6f5[_0x323a('0x4b')]['id'];}return db[_0x323a('0x2e')][_0x323a('0x49')]({'where':{'id':_0x63c6f5[_0x323a('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b0fde,null))[_0x323a('0x28')](saveUpdates(_0x63c6f5[_0x323a('0x4b')],null))[_0x323a('0x28')](respondWithResult(_0x1b0fde,null))[_0x323a('0x45')](handleError(_0x1b0fde,null));};exports[_0x323a('0x25')]=function(_0x372273,_0xd5b37f){return db[_0x323a('0x2e')][_0x323a('0x49')]({'where':{'id':_0x372273[_0x323a('0x54')]['id']}})['then'](handleEntityNotFound(_0xd5b37f,null))[_0x323a('0x28')](removeEntity(_0xd5b37f,null))[_0x323a('0x45')](handleError(_0xd5b37f,null));};exports['addAllCondition']=function(_0x425b95,_0x577f6f,_0x2792cb){if(_0x425b95[_0x323a('0x4b')]['id']){delete _0x425b95['body']['id'];}return db[_0x323a('0x2e')][_0x323a('0x49')]({'where':{'id':_0x425b95['params']['id']}})[_0x323a('0x28')](handleEntityNotFound(_0x577f6f,null))[_0x323a('0x28')](function(_0x127382){if(_0x127382){_0x425b95[_0x323a('0x4b')][_0x323a('0x55')]=_0x127382['id'];return db[_0x323a('0x56')][_0x323a('0x4a')](_0x425b95[_0x323a('0x4b')]);}})[_0x323a('0x28')](respondWithResult(_0x577f6f,null))[_0x323a('0x45')](handleError(_0x577f6f,null));};exports[_0x323a('0x57')]=function(_0x2a3c60,_0x4d11bd,_0x2a99cc){if(_0x2a3c60['body']['id']){delete _0x2a3c60[_0x323a('0x4b')]['id'];}return db[_0x323a('0x2e')]['find']({'where':{'id':_0x2a3c60[_0x323a('0x54')]['id']}})['then'](handleEntityNotFound(_0x4d11bd,null))['then'](function(_0x179a02){if(_0x179a02){_0x2a3c60['body'][_0x323a('0x58')]=_0x179a02['id'];return db['Condition']['create'](_0x2a3c60[_0x323a('0x4b')]);}})[_0x323a('0x28')](respondWithResult(_0x4d11bd,null))['catch'](handleError(_0x4d11bd,null));};exports['getAllConditions']=function(_0xd52dff,_0x3cffe9,_0x10270b){var _0x531f72={};var _0x549055={};var _0x288932;var _0x407e1a;return db[_0x323a('0x2e')]['findOne']({'where':{'id':_0xd52dff[_0x323a('0x54')]['id']}})[_0x323a('0x28')](handleEntityNotFound(_0x3cffe9,null))['then'](function(_0x13896c){if(_0x13896c){_0x288932=_0x13896c;_0x549055['model']=_['keys'](db[_0x323a('0x56')][_0x323a('0x2f')]);_0x549055[_0x323a('0x37')]=_['keys'](_0xd52dff[_0x323a('0x37')]);_0x549055[_0x323a('0x34')]=_[_0x323a('0x36')](_0x549055[_0x323a('0x32')],_0x549055[_0x323a('0x37')]);_0x531f72[_0x323a('0x35')]=_['intersection'](_0x549055[_0x323a('0x32')],qs[_0x323a('0x38')](_0xd52dff[_0x323a('0x37')]['fields']));_0x531f72[_0x323a('0x35')]=_0x531f72[_0x323a('0x35')][_0x323a('0x39')]?_0x531f72[_0x323a('0x35')]:_0x549055[_0x323a('0x32')];_0x531f72[_0x323a('0x3c')]=qs[_0x323a('0x3d')](_0xd52dff[_0x323a('0x37')][_0x323a('0x3d')]);_0x531f72[_0x323a('0x3e')]=qs[_0x323a('0x34')](_['pick'](_0xd52dff[_0x323a('0x37')],_0x549055[_0x323a('0x34')]));if(_0xd52dff['query'][_0x323a('0x40')]){_0x531f72[_0x323a('0x3e')]=_[_0x323a('0x41')](_0x531f72['where'],{'$or':_[_0x323a('0x2d')](_0x531f72[_0x323a('0x35')],function(_0x2e1145){var _0x4ef239={};_0x4ef239[_0x2e1145]={'$like':'%'+_0xd52dff[_0x323a('0x37')][_0x323a('0x40')]+'%'};return _0x4ef239;})});}_0x531f72=_['merge']({},_0x531f72,_0xd52dff['options']);return _0x288932['getAllConditions'](_0x531f72);}})['then'](function(_0x1648b1){if(_0x1648b1){_0x407e1a=_0x1648b1[_0x323a('0x39')];if(!_0xd52dff[_0x323a('0x37')][_0x323a('0x3a')](_0x323a('0x3b'))){_0x531f72['limit']=qs[_0x323a('0x1d')](_0xd52dff[_0x323a('0x37')][_0x323a('0x1d')]);_0x531f72[_0x323a('0x20')]=qs[_0x323a('0x20')](_0xd52dff[_0x323a('0x37')]['offset']);}return _0x288932[_0x323a('0x59')](_0x531f72);}})[_0x323a('0x28')](function(_0x167582){if(_0x167582){return _0x167582?{'count':_0x407e1a,'rows':_0x167582}:null;}})[_0x323a('0x28')](respondWithResult(_0x3cffe9,null))['catch'](handleError(_0x3cffe9,null));};exports[_0x323a('0x5a')]=function(_0x3a1770,_0x2d4739,_0x5a4151){var _0x5273f0={};var _0x548673={};var _0x145bbb;var _0x57028b;return db[_0x323a('0x2e')][_0x323a('0x5b')]({'where':{'id':_0x3a1770[_0x323a('0x54')]['id']}})[_0x323a('0x28')](handleEntityNotFound(_0x2d4739,null))[_0x323a('0x28')](function(_0x259467){if(_0x259467){_0x145bbb=_0x259467;_0x548673[_0x323a('0x32')]=_[_0x323a('0x33')](db['Condition']['rawAttributes']);_0x548673['query']=_[_0x323a('0x33')](_0x3a1770[_0x323a('0x37')]);_0x548673['filters']=_['intersection'](_0x548673[_0x323a('0x32')],_0x548673['query']);_0x5273f0[_0x323a('0x35')]=_[_0x323a('0x36')](_0x548673['model'],qs['fields'](_0x3a1770[_0x323a('0x37')][_0x323a('0x38')]));_0x5273f0[_0x323a('0x35')]=_0x5273f0[_0x323a('0x35')][_0x323a('0x39')]?_0x5273f0[_0x323a('0x35')]:_0x548673[_0x323a('0x32')];_0x5273f0['order']=qs[_0x323a('0x3d')](_0x3a1770['query'][_0x323a('0x3d')]);_0x5273f0['where']=qs[_0x323a('0x34')](_[_0x323a('0x3f')](_0x3a1770[_0x323a('0x37')],_0x548673[_0x323a('0x34')]));if(_0x3a1770[_0x323a('0x37')][_0x323a('0x40')]){_0x5273f0[_0x323a('0x3e')]=_[_0x323a('0x41')](_0x5273f0['where'],{'$or':_[_0x323a('0x2d')](_0x5273f0[_0x323a('0x35')],function(_0x485c22){var _0x43f671={};_0x43f671[_0x485c22]={'$like':'%'+_0x3a1770[_0x323a('0x37')][_0x323a('0x40')]+'%'};return _0x43f671;})});}_0x5273f0=_['merge']({},_0x5273f0,_0x3a1770[_0x323a('0x43')]);return _0x145bbb[_0x323a('0x5a')](_0x5273f0);}})[_0x323a('0x28')](function(_0xb292a0){if(_0xb292a0){_0x57028b=_0xb292a0[_0x323a('0x39')];if(!_0x3a1770[_0x323a('0x37')][_0x323a('0x3a')](_0x323a('0x3b'))){_0x5273f0[_0x323a('0x1d')]=qs[_0x323a('0x1d')](_0x3a1770[_0x323a('0x37')][_0x323a('0x1d')]);_0x5273f0[_0x323a('0x20')]=qs['offset'](_0x3a1770[_0x323a('0x37')][_0x323a('0x20')]);}return _0x145bbb[_0x323a('0x5a')](_0x5273f0);}})['then'](function(_0x2a64a9){if(_0x2a64a9){return _0x2a64a9?{'count':_0x57028b,'rows':_0x2a64a9}:null;}})[_0x323a('0x28')](respondWithResult(_0x2d4739,null))['catch'](handleError(_0x2d4739,null));};exports[_0x323a('0x5c')]=function(_0x17c706,_0x1d9ad3,_0x29dcef){if(_0x17c706[_0x323a('0x4b')]['id']){delete _0x17c706[_0x323a('0x4b')]['id'];}return db[_0x323a('0x2e')][_0x323a('0x49')]({'where':{'id':_0x17c706['params']['id']}})[_0x323a('0x28')](handleEntityNotFound(_0x1d9ad3,null))['then'](function(_0x54eff0){if(_0x54eff0){_0x17c706['body'][_0x323a('0x5d')]=_0x54eff0['id'];return db[_0x323a('0x5e')][_0x323a('0x4a')](_0x17c706[_0x323a('0x4b')]);}})['then'](respondWithResult(_0x1d9ad3,null))[_0x323a('0x45')](handleError(_0x1d9ad3,null));};exports['getActions']=function(_0xcffd4c,_0x42c6f4,_0x36a0b5){var _0x552c19={};var _0x30be2a={};var _0x2f4f22;var _0x470def;return db[_0x323a('0x2e')]['findOne']({'where':{'id':_0xcffd4c['params']['id']}})[_0x323a('0x28')](handleEntityNotFound(_0x42c6f4,null))[_0x323a('0x28')](function(_0x4af855){if(_0x4af855){_0x2f4f22=_0x4af855;_0x30be2a[_0x323a('0x32')]=_[_0x323a('0x33')](db[_0x323a('0x5e')][_0x323a('0x2f')]);_0x30be2a[_0x323a('0x37')]=_['keys'](_0xcffd4c[_0x323a('0x37')]);_0x30be2a['filters']=_[_0x323a('0x36')](_0x30be2a[_0x323a('0x32')],_0x30be2a[_0x323a('0x37')]);_0x552c19['attributes']=_[_0x323a('0x36')](_0x30be2a[_0x323a('0x32')],qs[_0x323a('0x38')](_0xcffd4c[_0x323a('0x37')][_0x323a('0x38')]));_0x552c19[_0x323a('0x35')]=_0x552c19[_0x323a('0x35')][_0x323a('0x39')]?_0x552c19['attributes']:_0x30be2a[_0x323a('0x32')];_0x552c19[_0x323a('0x3c')]=qs[_0x323a('0x3d')](_0xcffd4c[_0x323a('0x37')][_0x323a('0x3d')]);_0x552c19[_0x323a('0x3e')]=qs[_0x323a('0x34')](_['pick'](_0xcffd4c['query'],_0x30be2a['filters']));if(_0xcffd4c[_0x323a('0x37')]['filter']){_0x552c19[_0x323a('0x3e')]=_[_0x323a('0x41')](_0x552c19[_0x323a('0x3e')],{'$or':_[_0x323a('0x2d')](_0x552c19['attributes'],function(_0x5c1d94){var _0x6ba692={};_0x6ba692[_0x5c1d94]={'$like':'%'+_0xcffd4c[_0x323a('0x37')]['filter']+'%'};return _0x6ba692;})});}_0x552c19=_['merge']({},_0x552c19,_0xcffd4c['options']);return _0x2f4f22['getActions'](_0x552c19);}})[_0x323a('0x28')](function(_0x17f666){if(_0x17f666){_0x470def=_0x17f666['length'];if(!_0xcffd4c[_0x323a('0x37')][_0x323a('0x3a')](_0x323a('0x3b'))){_0x552c19[_0x323a('0x1d')]=qs[_0x323a('0x1d')](_0xcffd4c[_0x323a('0x37')][_0x323a('0x1d')]);_0x552c19['offset']=qs['offset'](_0xcffd4c[_0x323a('0x37')][_0x323a('0x20')]);}return _0x2f4f22[_0x323a('0x5f')](_0x552c19);}})[_0x323a('0x28')](function(_0x1d5da7){if(_0x1d5da7){return _0x1d5da7?{'count':_0x470def,'rows':_0x1d5da7}:null;}})[_0x323a('0x28')](respondWithResult(_0x42c6f4,null))['catch'](handleError(_0x42c6f4,null));}; \ No newline at end of file +var _0x6b1c=['sort','where','pick','filter','merge','options','Trigger','count','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','findOne','getAnyConditions','TriggerId','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','map','fieldName','type','key','query','keys','filters','model','intersection','fields','length','attributes','nolimit','order'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x6b1c,0x183));var _0xc6b1=function(_0x29ac36,_0x3cb511){_0x29ac36=_0x29ac36-0x0;var _0x16d3a7=_0x6b1c[_0x29ac36];return _0x16d3a7;};'use strict';var emlformat=require(_0xc6b1('0x0'));var rimraf=require(_0xc6b1('0x1'));var zipdir=require(_0xc6b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc6b1('0x3'));var moment=require(_0xc6b1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc6b1('0x5'));var sox=require(_0xc6b1('0x6'));var csv=require('to-csv');var ejs=require(_0xc6b1('0x7'));var fs=require('fs');var fs_extra=require(_0xc6b1('0x8'));var _=require('lodash');var squel=require(_0xc6b1('0x9'));var crypto=require(_0xc6b1('0xa'));var jsforce=require(_0xc6b1('0xb'));var deskjs=require(_0xc6b1('0xc'));var toCsv=require(_0xc6b1('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc6b1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6b1('0xf'));var logger=require('../../config/logger')(_0xc6b1('0x10'));var utils=require(_0xc6b1('0x11'));var config=require(_0xc6b1('0x12'));var licenseUtil=require(_0xc6b1('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x160d95,_0x533c8c){_0x533c8c=_0x533c8c||0xcc;return function(_0x1d2a8a){if(_0x1d2a8a){return _0x160d95['sendStatus'](_0x533c8c);}return _0x160d95[_0xc6b1('0x14')](_0x533c8c)[_0xc6b1('0x15')]();};}function respondWithResult(_0x729622,_0x3b3164){_0x3b3164=_0x3b3164||0xc8;return function(_0x48d826){if(_0x48d826){return _0x729622[_0xc6b1('0x14')](_0x3b3164)[_0xc6b1('0x16')](_0x48d826);}};}function respondWithFilteredResult(_0x24d7c9,_0x2a5e1f){return function(_0x4ebe4d){if(_0x4ebe4d){var _0x24fe1e=typeof _0x2a5e1f['offset']==='undefined'&&typeof _0x2a5e1f[_0xc6b1('0x17')]==='undefined';var _0x54bfc2=_0x4ebe4d['count'];var _0x2a8cba=_0x24fe1e?0x0:_0x2a5e1f[_0xc6b1('0x18')];var _0x51b7ed=_0x24fe1e?_0x4ebe4d['count']:_0x2a5e1f[_0xc6b1('0x18')]+_0x2a5e1f[_0xc6b1('0x17')];var _0x114bc0;if(_0x51b7ed>=_0x54bfc2){_0x51b7ed=_0x54bfc2;_0x114bc0=0xc8;}else{_0x114bc0=0xce;}_0x24d7c9[_0xc6b1('0x14')](_0x114bc0);return _0x24d7c9[_0xc6b1('0x19')](_0xc6b1('0x1a'),_0x2a8cba+'-'+_0x51b7ed+'/'+_0x54bfc2)[_0xc6b1('0x16')](_0x4ebe4d);}return null;};}function patchUpdates(_0x11ee44){return function(_0x16dd80){try{jsonpatch[_0xc6b1('0x1b')](_0x16dd80,_0x11ee44,!![]);}catch(_0x13deb5){return BPromise[_0xc6b1('0x1c')](_0x13deb5);}return _0x16dd80[_0xc6b1('0x1d')]();};}function saveUpdates(_0x512080,_0x3aebe1){return function(_0x9520ae){if(_0x9520ae){return _0x9520ae[_0xc6b1('0x1e')](_0x512080)[_0xc6b1('0x1f')](function(_0x19929c){return _0x19929c;});}return null;};}function removeEntity(_0x4b2028,_0x159a83){return function(_0x30b117){if(_0x30b117){return _0x30b117[_0xc6b1('0x20')]()[_0xc6b1('0x1f')](function(){var _0xc7284b=_0x30b117[_0xc6b1('0x21')]({'plain':!![]});var _0x35c908=_0xc6b1('0x22');return db[_0xc6b1('0x23')]['destroy']({'where':{'type':_0x35c908,'resourceId':_0xc7284b['id']}})[_0xc6b1('0x1f')](function(){return _0x30b117;});})[_0xc6b1('0x1f')](function(){_0x4b2028[_0xc6b1('0x14')](0xcc)[_0xc6b1('0x15')]();});}};}function handleEntityNotFound(_0x49c8c0,_0x229c0b){return function(_0x5d923d){if(!_0x5d923d){_0x49c8c0['sendStatus'](0x194);}return _0x5d923d;};}function handleError(_0x2a16eb,_0x1a9c45){_0x1a9c45=_0x1a9c45||0x1f4;return function(_0x32d0bb){logger[_0xc6b1('0x24')](_0x32d0bb['stack']);if(_0x32d0bb[_0xc6b1('0x25')]){delete _0x32d0bb['name'];}_0x2a16eb[_0xc6b1('0x14')](_0x1a9c45)[_0xc6b1('0x26')](_0x32d0bb);};}exports['index']=function(_0x23d519,_0x303c2c){var _0x119618={},_0x31d4c2={},_0x267d83={'count':0x0,'rows':[]};var _0x356e45=_[_0xc6b1('0x27')](db['Trigger']['rawAttributes'],function(_0x5c939b){return{'name':_0x5c939b[_0xc6b1('0x28')],'type':_0x5c939b[_0xc6b1('0x29')][_0xc6b1('0x2a')]};});_0x31d4c2['model']=_[_0xc6b1('0x27')](_0x356e45,'name');_0x31d4c2[_0xc6b1('0x2b')]=_[_0xc6b1('0x2c')](_0x23d519[_0xc6b1('0x2b')]);_0x31d4c2[_0xc6b1('0x2d')]=_['intersection'](_0x31d4c2[_0xc6b1('0x2e')],_0x31d4c2[_0xc6b1('0x2b')]);_0x119618['attributes']=_[_0xc6b1('0x2f')](_0x31d4c2[_0xc6b1('0x2e')],qs[_0xc6b1('0x30')](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x119618['attributes']=_0x119618['attributes'][_0xc6b1('0x31')]?_0x119618[_0xc6b1('0x32')]:_0x31d4c2[_0xc6b1('0x2e')];if(!_0x23d519['query']['hasOwnProperty'](_0xc6b1('0x33'))){_0x119618[_0xc6b1('0x17')]=qs[_0xc6b1('0x17')](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x17')]);_0x119618[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x18')]);}_0x119618[_0xc6b1('0x34')]=qs['sort'](_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x35')]);_0x119618[_0xc6b1('0x36')]=qs[_0xc6b1('0x2d')](_[_0xc6b1('0x37')](_0x23d519['query'],_0x31d4c2['filters']),_0x356e45);if(_0x23d519['query'][_0xc6b1('0x38')]){_0x119618[_0xc6b1('0x36')]=_[_0xc6b1('0x39')](_0x119618[_0xc6b1('0x36')],{'$or':_['map'](_0x356e45,function(_0x53695b){if(_0x53695b[_0xc6b1('0x29')]!=='VIRTUAL'){var _0x313c05={};_0x313c05[_0x53695b['name']]={'$like':'%'+_0x23d519[_0xc6b1('0x2b')][_0xc6b1('0x38')]+'%'};return _0x313c05;}})});}_0x119618=_[_0xc6b1('0x39')]({},_0x119618,_0x23d519[_0xc6b1('0x3a')]);var _0x45dd33={'where':_0x119618['where']};return db[_0xc6b1('0x3b')][_0xc6b1('0x3c')](_0x45dd33)[_0xc6b1('0x1f')](function(_0x55807e){_0x267d83[_0xc6b1('0x3c')]=_0x55807e;if(_0x23d519[_0xc6b1('0x2b')]['includeAll']){_0x119618['include']=[{'all':!![]}];}return db['Trigger'][_0xc6b1('0x3d')](_0x119618);})[_0xc6b1('0x1f')](function(_0x4cdf10){_0x267d83[_0xc6b1('0x3e')]=_0x4cdf10;return _0x267d83;})[_0xc6b1('0x1f')](respondWithFilteredResult(_0x303c2c,_0x119618))[_0xc6b1('0x3f')](handleError(_0x303c2c,null));};exports[_0xc6b1('0x40')]=function(_0x42bdf8,_0x333d1c){var _0x3e04ed={'raw':![],'where':{'id':_0x42bdf8[_0xc6b1('0x41')]['id']}},_0x37964f={};_0x37964f['model']=_[_0xc6b1('0x2c')](db[_0xc6b1('0x3b')][_0xc6b1('0x42')]);_0x37964f['query']=_[_0xc6b1('0x2c')](_0x42bdf8['query']);_0x37964f[_0xc6b1('0x2d')]=_[_0xc6b1('0x2f')](_0x37964f[_0xc6b1('0x2e')],_0x37964f['query']);_0x3e04ed[_0xc6b1('0x32')]=_[_0xc6b1('0x2f')](_0x37964f[_0xc6b1('0x2e')],qs['fields'](_0x42bdf8[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x3e04ed['attributes']=_0x3e04ed['attributes'][_0xc6b1('0x31')]?_0x3e04ed['attributes']:_0x37964f[_0xc6b1('0x2e')];if(_0x42bdf8[_0xc6b1('0x2b')][_0xc6b1('0x43')]){_0x3e04ed[_0xc6b1('0x44')]=[{'all':!![]}];}_0x3e04ed=_['merge']({},_0x3e04ed,_0x42bdf8[_0xc6b1('0x3a')]);return db[_0xc6b1('0x3b')][_0xc6b1('0x45')](_0x3e04ed)[_0xc6b1('0x1f')](handleEntityNotFound(_0x333d1c,null))[_0xc6b1('0x1f')](respondWithResult(_0x333d1c,null))[_0xc6b1('0x3f')](handleError(_0x333d1c,null));};exports[_0xc6b1('0x46')]=function(_0x28353d,_0x10d023){return db[_0xc6b1('0x3b')][_0xc6b1('0x46')](_0x28353d[_0xc6b1('0x47')],{})['then'](function(_0x43ebf3){var _0x3c963a=_0x28353d[_0xc6b1('0x48')][_0xc6b1('0x21')]({'plain':!![]});if(!_0x3c963a)throw new Error(_0xc6b1('0x49'));if(_0x3c963a[_0xc6b1('0x4a')]==='user'){var _0x6ef7bb=_0x43ebf3['get']({'plain':!![]});var _0x2cf98c=_0xc6b1('0x22');return db['UserProfileSection'][_0xc6b1('0x45')]({'where':{'name':_0x2cf98c,'userProfileId':_0x3c963a['userProfileId']},'raw':!![]})[_0xc6b1('0x1f')](function(_0x150415){if(_0x150415&&_0x150415[_0xc6b1('0x4b')]===0x0){return db[_0xc6b1('0x23')][_0xc6b1('0x46')]({'name':_0x6ef7bb[_0xc6b1('0x25')],'resourceId':_0x6ef7bb['id'],'type':_0x150415['name'],'sectionId':_0x150415['id']},{})[_0xc6b1('0x1f')](function(){return _0x43ebf3;});}else{return _0x43ebf3;}})['catch'](function(_0x522d50){logger[_0xc6b1('0x24')](_0xc6b1('0x4c'),_0x522d50);throw _0x522d50;});}return _0x43ebf3;})[_0xc6b1('0x1f')](respondWithResult(_0x10d023,0xc9))[_0xc6b1('0x3f')](handleError(_0x10d023,null));};exports['update']=function(_0xc43c34,_0x55988c){if(_0xc43c34[_0xc6b1('0x47')]['id']){delete _0xc43c34[_0xc6b1('0x47')]['id'];}return db['Trigger'][_0xc6b1('0x45')]({'where':{'id':_0xc43c34['params']['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x55988c,null))[_0xc6b1('0x1f')](saveUpdates(_0xc43c34['body'],null))[_0xc6b1('0x1f')](respondWithResult(_0x55988c,null))['catch'](handleError(_0x55988c,null));};exports['destroy']=function(_0x50a321,_0x42f857){return db[_0xc6b1('0x3b')][_0xc6b1('0x45')]({'where':{'id':_0x50a321['params']['id']}})['then'](handleEntityNotFound(_0x42f857,null))[_0xc6b1('0x1f')](removeEntity(_0x42f857,null))[_0xc6b1('0x3f')](handleError(_0x42f857,null));};exports[_0xc6b1('0x4d')]=function(_0xa3fb1a,_0x3cb61a,_0x4d057a){if(_0xa3fb1a[_0xc6b1('0x47')]['id']){delete _0xa3fb1a[_0xc6b1('0x47')]['id'];}return db[_0xc6b1('0x3b')][_0xc6b1('0x45')]({'where':{'id':_0xa3fb1a[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x3cb61a,null))['then'](function(_0x14e73f){if(_0x14e73f){_0xa3fb1a[_0xc6b1('0x47')][_0xc6b1('0x4e')]=_0x14e73f['id'];return db['Condition'][_0xc6b1('0x46')](_0xa3fb1a[_0xc6b1('0x47')]);}})[_0xc6b1('0x1f')](respondWithResult(_0x3cb61a,null))[_0xc6b1('0x3f')](handleError(_0x3cb61a,null));};exports[_0xc6b1('0x4f')]=function(_0xdea706,_0x195710,_0x39fd4a){if(_0xdea706['body']['id']){delete _0xdea706[_0xc6b1('0x47')]['id'];}return db[_0xc6b1('0x3b')]['find']({'where':{'id':_0xdea706['params']['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x195710,null))['then'](function(_0x3b6525){if(_0x3b6525){_0xdea706[_0xc6b1('0x47')][_0xc6b1('0x50')]=_0x3b6525['id'];return db[_0xc6b1('0x51')][_0xc6b1('0x46')](_0xdea706[_0xc6b1('0x47')]);}})[_0xc6b1('0x1f')](respondWithResult(_0x195710,null))[_0xc6b1('0x3f')](handleError(_0x195710,null));};exports['getAllConditions']=function(_0x9f97ed,_0x128cd7,_0x36fb0c){var _0x5300b4={};var _0x549fff={};var _0x1f6228;var _0x11107a;return db[_0xc6b1('0x3b')]['findOne']({'where':{'id':_0x9f97ed[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x128cd7,null))[_0xc6b1('0x1f')](function(_0x4e7ffb){if(_0x4e7ffb){_0x1f6228=_0x4e7ffb;_0x549fff[_0xc6b1('0x2e')]=_[_0xc6b1('0x2c')](db[_0xc6b1('0x51')][_0xc6b1('0x42')]);_0x549fff[_0xc6b1('0x2b')]=_[_0xc6b1('0x2c')](_0x9f97ed[_0xc6b1('0x2b')]);_0x549fff[_0xc6b1('0x2d')]=_[_0xc6b1('0x2f')](_0x549fff[_0xc6b1('0x2e')],_0x549fff[_0xc6b1('0x2b')]);_0x5300b4[_0xc6b1('0x32')]=_[_0xc6b1('0x2f')](_0x549fff[_0xc6b1('0x2e')],qs[_0xc6b1('0x30')](_0x9f97ed[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x5300b4[_0xc6b1('0x32')]=_0x5300b4[_0xc6b1('0x32')][_0xc6b1('0x31')]?_0x5300b4[_0xc6b1('0x32')]:_0x549fff[_0xc6b1('0x2e')];_0x5300b4[_0xc6b1('0x34')]=qs[_0xc6b1('0x35')](_0x9f97ed['query'][_0xc6b1('0x35')]);_0x5300b4[_0xc6b1('0x36')]=qs['filters'](_[_0xc6b1('0x37')](_0x9f97ed['query'],_0x549fff[_0xc6b1('0x2d')]));if(_0x9f97ed[_0xc6b1('0x2b')]['filter']){_0x5300b4[_0xc6b1('0x36')]=_['merge'](_0x5300b4['where'],{'$or':_['map'](_0x5300b4['attributes'],function(_0x464f42){var _0x3fda54={};_0x3fda54[_0x464f42]={'$like':'%'+_0x9f97ed[_0xc6b1('0x2b')]['filter']+'%'};return _0x3fda54;})});}_0x5300b4=_[_0xc6b1('0x39')]({},_0x5300b4,_0x9f97ed[_0xc6b1('0x3a')]);return _0x1f6228['getAllConditions'](_0x5300b4);}})['then'](function(_0x1082f1){if(_0x1082f1){_0x11107a=_0x1082f1[_0xc6b1('0x31')];if(!_0x9f97ed[_0xc6b1('0x2b')]['hasOwnProperty'](_0xc6b1('0x33'))){_0x5300b4[_0xc6b1('0x17')]=qs[_0xc6b1('0x17')](_0x9f97ed[_0xc6b1('0x2b')][_0xc6b1('0x17')]);_0x5300b4[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x9f97ed['query']['offset']);}return _0x1f6228['getAllConditions'](_0x5300b4);}})[_0xc6b1('0x1f')](function(_0x4ce820){if(_0x4ce820){return _0x4ce820?{'count':_0x11107a,'rows':_0x4ce820}:null;}})[_0xc6b1('0x1f')](respondWithResult(_0x128cd7,null))['catch'](handleError(_0x128cd7,null));};exports['getAnyConditions']=function(_0x233801,_0x3fdfdc,_0x2d55a9){var _0x2bff30={};var _0x5a685b={};var _0x50d5e8;var _0xdf5c2e;return db['Trigger'][_0xc6b1('0x52')]({'where':{'id':_0x233801[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x3fdfdc,null))[_0xc6b1('0x1f')](function(_0x28ba11){if(_0x28ba11){_0x50d5e8=_0x28ba11;_0x5a685b[_0xc6b1('0x2e')]=_['keys'](db[_0xc6b1('0x51')][_0xc6b1('0x42')]);_0x5a685b[_0xc6b1('0x2b')]=_['keys'](_0x233801[_0xc6b1('0x2b')]);_0x5a685b['filters']=_[_0xc6b1('0x2f')](_0x5a685b['model'],_0x5a685b[_0xc6b1('0x2b')]);_0x2bff30[_0xc6b1('0x32')]=_[_0xc6b1('0x2f')](_0x5a685b[_0xc6b1('0x2e')],qs[_0xc6b1('0x30')](_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x2bff30[_0xc6b1('0x32')]=_0x2bff30['attributes'][_0xc6b1('0x31')]?_0x2bff30[_0xc6b1('0x32')]:_0x5a685b['model'];_0x2bff30[_0xc6b1('0x34')]=qs['sort'](_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x35')]);_0x2bff30[_0xc6b1('0x36')]=qs[_0xc6b1('0x2d')](_[_0xc6b1('0x37')](_0x233801['query'],_0x5a685b[_0xc6b1('0x2d')]));if(_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x38')]){_0x2bff30[_0xc6b1('0x36')]=_['merge'](_0x2bff30[_0xc6b1('0x36')],{'$or':_[_0xc6b1('0x27')](_0x2bff30[_0xc6b1('0x32')],function(_0x24ea24){var _0x116256={};_0x116256[_0x24ea24]={'$like':'%'+_0x233801[_0xc6b1('0x2b')]['filter']+'%'};return _0x116256;})});}_0x2bff30=_[_0xc6b1('0x39')]({},_0x2bff30,_0x233801[_0xc6b1('0x3a')]);return _0x50d5e8[_0xc6b1('0x53')](_0x2bff30);}})['then'](function(_0x461274){if(_0x461274){_0xdf5c2e=_0x461274['length'];if(!_0x233801['query']['hasOwnProperty'](_0xc6b1('0x33'))){_0x2bff30[_0xc6b1('0x17')]=qs[_0xc6b1('0x17')](_0x233801[_0xc6b1('0x2b')][_0xc6b1('0x17')]);_0x2bff30[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x233801[_0xc6b1('0x2b')]['offset']);}return _0x50d5e8[_0xc6b1('0x53')](_0x2bff30);}})[_0xc6b1('0x1f')](function(_0x274f13){if(_0x274f13){return _0x274f13?{'count':_0xdf5c2e,'rows':_0x274f13}:null;}})[_0xc6b1('0x1f')](respondWithResult(_0x3fdfdc,null))[_0xc6b1('0x3f')](handleError(_0x3fdfdc,null));};exports['addAction']=function(_0xa1c994,_0x2922c6,_0x391bff){if(_0xa1c994[_0xc6b1('0x47')]['id']){delete _0xa1c994['body']['id'];}return db[_0xc6b1('0x3b')][_0xc6b1('0x45')]({'where':{'id':_0xa1c994[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x2922c6,null))[_0xc6b1('0x1f')](function(_0x494b4f){if(_0x494b4f){_0xa1c994['body'][_0xc6b1('0x54')]=_0x494b4f['id'];return db[_0xc6b1('0x55')][_0xc6b1('0x46')](_0xa1c994['body']);}})[_0xc6b1('0x1f')](respondWithResult(_0x2922c6,null))[_0xc6b1('0x3f')](handleError(_0x2922c6,null));};exports[_0xc6b1('0x56')]=function(_0x59aded,_0x4e3962,_0x4fbf38){var _0x4e6110={};var _0x519065={};var _0x2fda7e;var _0x43716e;return db[_0xc6b1('0x3b')][_0xc6b1('0x52')]({'where':{'id':_0x59aded[_0xc6b1('0x41')]['id']}})[_0xc6b1('0x1f')](handleEntityNotFound(_0x4e3962,null))[_0xc6b1('0x1f')](function(_0x29828c){if(_0x29828c){_0x2fda7e=_0x29828c;_0x519065['model']=_['keys'](db[_0xc6b1('0x55')][_0xc6b1('0x42')]);_0x519065['query']=_[_0xc6b1('0x2c')](_0x59aded[_0xc6b1('0x2b')]);_0x519065['filters']=_['intersection'](_0x519065[_0xc6b1('0x2e')],_0x519065[_0xc6b1('0x2b')]);_0x4e6110['attributes']=_['intersection'](_0x519065[_0xc6b1('0x2e')],qs['fields'](_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x30')]));_0x4e6110[_0xc6b1('0x32')]=_0x4e6110[_0xc6b1('0x32')][_0xc6b1('0x31')]?_0x4e6110[_0xc6b1('0x32')]:_0x519065[_0xc6b1('0x2e')];_0x4e6110[_0xc6b1('0x34')]=qs[_0xc6b1('0x35')](_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x35')]);_0x4e6110[_0xc6b1('0x36')]=qs[_0xc6b1('0x2d')](_[_0xc6b1('0x37')](_0x59aded[_0xc6b1('0x2b')],_0x519065[_0xc6b1('0x2d')]));if(_0x59aded[_0xc6b1('0x2b')]['filter']){_0x4e6110[_0xc6b1('0x36')]=_[_0xc6b1('0x39')](_0x4e6110['where'],{'$or':_['map'](_0x4e6110[_0xc6b1('0x32')],function(_0x9f36f6){var _0x4f8768={};_0x4f8768[_0x9f36f6]={'$like':'%'+_0x59aded[_0xc6b1('0x2b')]['filter']+'%'};return _0x4f8768;})});}_0x4e6110=_[_0xc6b1('0x39')]({},_0x4e6110,_0x59aded['options']);return _0x2fda7e[_0xc6b1('0x56')](_0x4e6110);}})['then'](function(_0x23579c){if(_0x23579c){_0x43716e=_0x23579c[_0xc6b1('0x31')];if(!_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x57')]('nolimit')){_0x4e6110['limit']=qs[_0xc6b1('0x17')](_0x59aded[_0xc6b1('0x2b')]['limit']);_0x4e6110[_0xc6b1('0x18')]=qs[_0xc6b1('0x18')](_0x59aded[_0xc6b1('0x2b')][_0xc6b1('0x18')]);}return _0x2fda7e[_0xc6b1('0x56')](_0x4e6110);}})[_0xc6b1('0x1f')](function(_0x341073){if(_0x341073){return _0x341073?{'count':_0x43716e,'rows':_0x341073}:null;}})['then'](respondWithResult(_0x4e3962,null))['catch'](handleError(_0x4e3962,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 08bee32..330b948 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 _0x6b19=['api','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6b19,0xe8));var _0x96b1=function(_0x3ffb74,_0x436c05){_0x3ffb74=_0x3ffb74-0x0;var _0x455d34=_0x6b19[_0x3ffb74];return _0x455d34;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var logger=require('../../config/logger')(_0x96b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96b1('0x3'));var fs=require('fs');var path=require(_0x96b1('0x4'));var rimraf=require(_0x96b1('0x5'));var config=require(_0x96b1('0x6'));var attributes=require(_0x96b1('0x7'));module['exports']=function(_0x8b5ab8,_0x546193){return _0x8b5ab8[_0x96b1('0x8')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb5d=['util','../../config/logger','api','moment','path','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers'];(function(_0x50ba18,_0x4f8c2c){var _0x51883d=function(_0x3c9812){while(--_0x3c9812){_0x50ba18['push'](_0x50ba18['shift']());}};_0x51883d(++_0x4f8c2c);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xeb5d[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var logger=require(_0xdeb5('0x1'))(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb5('0x4'));var rimraf=require(_0xdeb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xdeb5('0x6'));module[_0xdeb5('0x7')]=function(_0x164ecb,_0x33af72){return _0x164ecb[_0xdeb5('0x8')](_0xdeb5('0x9'),attributes,{'tableName':_0xdeb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 999eaa7..1c2e4f8 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 _0x190c=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTrigger','findAll','options','raw','where','include','map','model','attributes','ShowTrigger','find','debug'];(function(_0x4a453d,_0x3fdf57){var _0x2d4dda=function(_0x440db1){while(--_0x440db1){_0x4a453d['push'](_0x4a453d['shift']());}};_0x2d4dda(++_0x3fdf57);}(_0x190c,0xa5));var _0xc190=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x190c[_0x52e68e];return _0x3211a4;};'use strict';var _=require(_0xc190('0x0'));var util=require(_0xc190('0x1'));var moment=require(_0xc190('0x2'));var BPromise=require(_0xc190('0x3'));var rs=require(_0xc190('0x4'));var fs=require('fs');var Redis=require(_0xc190('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc190('0x6'));var logger=require(_0xc190('0x7'))(_0xc190('0x8'));var config=require('../../config/environment');var jayson=require(_0xc190('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xaad716,_0x4af6b0,_0x447c2f){return new BPromise(function(_0x1b5005,_0x52edb8){return client['request'](_0xaad716,_0x447c2f)[_0xc190('0xa')](function(_0xf352ea){logger['info'](_0xc190('0xb'),_0x4af6b0,_0xc190('0xc'));logger['debug'](_0xc190('0xd'),_0x4af6b0,_0xc190('0xc'),JSON[_0xc190('0xe')](_0xf352ea));if(_0xf352ea[_0xc190('0xf')]){if(_0xf352ea[_0xc190('0xf')][_0xc190('0x10')]===0x1f4){logger[_0xc190('0xf')](_0xc190('0xb'),_0x4af6b0,_0xf352ea[_0xc190('0xf')]['message']);return _0x52edb8(_0xf352ea[_0xc190('0xf')][_0xc190('0x11')]);}logger['error'](_0xc190('0xb'),_0x4af6b0,_0xf352ea[_0xc190('0xf')][_0xc190('0x11')]);return _0x1b5005(_0xf352ea['error'][_0xc190('0x11')]);}else{logger[_0xc190('0x12')](_0xc190('0xb'),_0x4af6b0,_0xc190('0xc'));_0x1b5005(_0xf352ea[_0xc190('0x13')]['message']);}})[_0xc190('0x14')](function(_0x16b70b){logger['error'](_0xc190('0xb'),_0x4af6b0,_0x16b70b);_0x52edb8(_0x16b70b);});});}exports[_0xc190('0x15')]=function(_0x3f0fac){var _0x4ecf35=this;return new Promise(function(_0x4ca9ce,_0x3f8455){return db['Trigger'][_0xc190('0x16')]({'raw':_0x3f0fac[_0xc190('0x17')]?_0x3f0fac['options'][_0xc190('0x18')]===undefined?!![]:![]:!![],'where':_0x3f0fac[_0xc190('0x17')]?_0x3f0fac[_0xc190('0x17')][_0xc190('0x19')]||null:null,'attributes':_0x3f0fac[_0xc190('0x17')]?_0x3f0fac[_0xc190('0x17')]['attributes']||null:null,'limit':_0x3f0fac[_0xc190('0x17')]?_0x3f0fac[_0xc190('0x17')]['limit']||null:null,'include':_0x3f0fac[_0xc190('0x17')]?_0x3f0fac[_0xc190('0x17')][_0xc190('0x1a')]?_[_0xc190('0x1b')](_0x3f0fac[_0xc190('0x17')][_0xc190('0x1a')],function(_0x52f4ea){return{'model':db[_0x52f4ea[_0xc190('0x1c')]],'as':_0x52f4ea['as'],'attributes':_0x52f4ea[_0xc190('0x1d')],'include':_0x52f4ea[_0xc190('0x1a')]?_[_0xc190('0x1b')](_0x52f4ea['include'],function(_0x232708){return{'model':db[_0x232708[_0xc190('0x1c')]],'as':_0x232708['as'],'attributes':_0x232708['attributes'],'include':_0x232708[_0xc190('0x1a')]?_[_0xc190('0x1b')](_0x232708[_0xc190('0x1a')],function(_0x4512fc){return{'model':db[_0x4512fc['model']],'as':_0x4512fc['as'],'attributes':_0x4512fc[_0xc190('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc190('0xa')](function(_0x36e0b3){logger[_0xc190('0x12')](_0xc190('0x15'),_0x3f0fac);logger['debug'](_0xc190('0x15'),_0x3f0fac,JSON[_0xc190('0xe')](_0x36e0b3));_0x4ca9ce(_0x36e0b3);})['catch'](function(_0x23230c){logger[_0xc190('0xf')]('GetTrigger',_0x23230c['message'],_0x3f0fac);_0x3f8455(_0x4ecf35[_0xc190('0xf')](0x1f4,_0x23230c[_0xc190('0x11')]));});});};exports[_0xc190('0x1e')]=function(_0x484feb){var _0x14c7d8=this;return new Promise(function(_0x521759,_0x1a3f90){return db['Trigger'][_0xc190('0x1f')]({'raw':_0x484feb[_0xc190('0x17')]?_0x484feb['options'][_0xc190('0x18')]===undefined?!![]:![]:!![],'where':_0x484feb[_0xc190('0x17')]?_0x484feb['options'][_0xc190('0x19')]||null:null,'attributes':_0x484feb[_0xc190('0x17')]?_0x484feb['options'][_0xc190('0x1d')]||null:null,'include':_0x484feb[_0xc190('0x17')]?_0x484feb['options'][_0xc190('0x1a')]?_[_0xc190('0x1b')](_0x484feb[_0xc190('0x17')][_0xc190('0x1a')],function(_0x5d562f){return{'model':db[_0x5d562f[_0xc190('0x1c')]],'as':_0x5d562f['as'],'attributes':_0x5d562f['attributes'],'include':_0x5d562f[_0xc190('0x1a')]?_[_0xc190('0x1b')](_0x5d562f[_0xc190('0x1a')],function(_0x28effd){return{'model':db[_0x28effd[_0xc190('0x1c')]],'as':_0x28effd['as'],'attributes':_0x28effd['attributes'],'include':_0x28effd[_0xc190('0x1a')]?_[_0xc190('0x1b')](_0x28effd[_0xc190('0x1a')],function(_0x311bb5){return{'model':db[_0x311bb5['model']],'as':_0x311bb5['as'],'attributes':_0x311bb5['attributes']};}):[]};}):[]};}):[]:[]})[_0xc190('0xa')](function(_0x499943){logger[_0xc190('0x12')](_0xc190('0x1e'),_0x484feb);logger[_0xc190('0x20')]('ShowTrigger',_0x484feb,JSON['stringify'](_0x499943));_0x521759(_0x499943);})['catch'](function(_0x3d3b38){logger[_0xc190('0xf')](_0xc190('0x1e'),_0x3d3b38['message'],_0x484feb);_0x1a3f90(_0x14c7d8['error'](0x1f4,_0x3d3b38[_0xc190('0x11')]));});});}; \ No newline at end of file +var _0x7c1f=['http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTrigger','Trigger','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowTrigger','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3c0769,_0xdc3d3b){var _0x31ee62=function(_0x1ad801){while(--_0x1ad801){_0x3c0769['push'](_0x3c0769['shift']());}};_0x31ee62(++_0xdc3d3b);}(_0x7c1f,0x1e7));var _0xf7c1=function(_0x3b0dbe,_0x378ffc){_0x3b0dbe=_0x3b0dbe-0x0;var _0x2ade04=_0x7c1f[_0x3b0dbe];return _0x2ade04;};'use strict';var _=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var moment=require(_0xf7c1('0x2'));var BPromise=require('bluebird');var rs=require(_0xf7c1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7c1('0x5'))('rpc');var config=require(_0xf7c1('0x6'));var jayson=require(_0xf7c1('0x7'));var client=jayson['client'][_0xf7c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c610f,_0x5ec99a,_0x2a2d37){return new BPromise(function(_0x14e849,_0x3683e5){return client[_0xf7c1('0x9')](_0x1c610f,_0x2a2d37)[_0xf7c1('0xa')](function(_0x4dbcb0){logger[_0xf7c1('0xb')](_0xf7c1('0xc'),_0x5ec99a,_0xf7c1('0xd'));logger[_0xf7c1('0xe')](_0xf7c1('0xf'),_0x5ec99a,'request\x20sent',JSON['stringify'](_0x4dbcb0));if(_0x4dbcb0[_0xf7c1('0x10')]){if(_0x4dbcb0[_0xf7c1('0x10')][_0xf7c1('0x11')]===0x1f4){logger[_0xf7c1('0x10')]('Trigger,\x20%s,\x20%s',_0x5ec99a,_0x4dbcb0[_0xf7c1('0x10')][_0xf7c1('0x12')]);return _0x3683e5(_0x4dbcb0['error'][_0xf7c1('0x12')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x5ec99a,_0x4dbcb0['error']['message']);return _0x14e849(_0x4dbcb0[_0xf7c1('0x10')][_0xf7c1('0x12')]);}else{logger[_0xf7c1('0xb')](_0xf7c1('0xc'),_0x5ec99a,'request\x20sent');_0x14e849(_0x4dbcb0['result']['message']);}})[_0xf7c1('0x13')](function(_0x1eee15){logger['error']('Trigger,\x20%s,\x20%s',_0x5ec99a,_0x1eee15);_0x3683e5(_0x1eee15);});});}exports[_0xf7c1('0x14')]=function(_0x46174d){var _0x1970c7=this;return new Promise(function(_0x10386d,_0x2ecebc){return db[_0xf7c1('0x15')]['findAll']({'raw':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x17')]===undefined?!![]:![]:!![],'where':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x18')]||null:null,'attributes':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x19')]||null:null,'limit':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x1a')]||null:null,'include':_0x46174d[_0xf7c1('0x16')]?_0x46174d[_0xf7c1('0x16')][_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x46174d['options'][_0xf7c1('0x1b')],function(_0x4b90f5){return{'model':db[_0x4b90f5[_0xf7c1('0x1d')]],'as':_0x4b90f5['as'],'attributes':_0x4b90f5[_0xf7c1('0x19')],'include':_0x4b90f5[_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x4b90f5['include'],function(_0x7209b4){return{'model':db[_0x7209b4[_0xf7c1('0x1d')]],'as':_0x7209b4['as'],'attributes':_0x7209b4[_0xf7c1('0x19')],'include':_0x7209b4[_0xf7c1('0x1b')]?_['map'](_0x7209b4['include'],function(_0x3140fd){return{'model':db[_0x3140fd['model']],'as':_0x3140fd['as'],'attributes':_0x3140fd[_0xf7c1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf7c1('0xa')](function(_0x53c3ad){logger[_0xf7c1('0xb')](_0xf7c1('0x14'),_0x46174d);logger['debug'](_0xf7c1('0x14'),_0x46174d,JSON[_0xf7c1('0x1e')](_0x53c3ad));_0x10386d(_0x53c3ad);})[_0xf7c1('0x13')](function(_0x2386d9){logger[_0xf7c1('0x10')](_0xf7c1('0x14'),_0x2386d9[_0xf7c1('0x12')],_0x46174d);_0x2ecebc(_0x1970c7[_0xf7c1('0x10')](0x1f4,_0x2386d9[_0xf7c1('0x12')]));});});};exports['ShowTrigger']=function(_0x162fbd){var _0x1f4ad6=this;return new Promise(function(_0x5d07cc,_0x12f3aa){return db['Trigger'][_0xf7c1('0x1f')]({'raw':_0x162fbd[_0xf7c1('0x16')]?_0x162fbd['options'][_0xf7c1('0x17')]===undefined?!![]:![]:!![],'where':_0x162fbd[_0xf7c1('0x16')]?_0x162fbd['options'][_0xf7c1('0x18')]||null:null,'attributes':_0x162fbd[_0xf7c1('0x16')]?_0x162fbd[_0xf7c1('0x16')]['attributes']||null:null,'include':_0x162fbd['options']?_0x162fbd[_0xf7c1('0x16')]['include']?_[_0xf7c1('0x1c')](_0x162fbd[_0xf7c1('0x16')][_0xf7c1('0x1b')],function(_0x5020f4){return{'model':db[_0x5020f4['model']],'as':_0x5020f4['as'],'attributes':_0x5020f4[_0xf7c1('0x19')],'include':_0x5020f4[_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x5020f4[_0xf7c1('0x1b')],function(_0x1d9fb5){return{'model':db[_0x1d9fb5[_0xf7c1('0x1d')]],'as':_0x1d9fb5['as'],'attributes':_0x1d9fb5[_0xf7c1('0x19')],'include':_0x1d9fb5[_0xf7c1('0x1b')]?_[_0xf7c1('0x1c')](_0x1d9fb5[_0xf7c1('0x1b')],function(_0x213f9e){return{'model':db[_0x213f9e[_0xf7c1('0x1d')]],'as':_0x213f9e['as'],'attributes':_0x213f9e[_0xf7c1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf7c1('0xa')](function(_0x4ec390){logger['info']('ShowTrigger',_0x162fbd);logger['debug']('ShowTrigger',_0x162fbd,JSON[_0xf7c1('0x1e')](_0x4ec390));_0x5d07cc(_0x4ec390);})[_0xf7c1('0x13')](function(_0x502e91){logger['error'](_0xf7c1('0x20'),_0x502e91[_0xf7c1('0x12')],_0x162fbd);_0x12f3aa(_0x1f4ad6[_0xf7c1('0x10')](0x1f4,_0x502e91['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 72482b4..5944da7 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 _0x6450=['fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','create','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x4a5fbc,_0x518ede){var _0x4207c0=function(_0x3669e5){while(--_0x3669e5){_0x4a5fbc['push'](_0x4a5fbc['shift']());}};_0x4207c0(++_0x518ede);}(_0x6450,0x88));var _0x0645=function(_0x15866e,_0x1eafc3){_0x15866e=_0x15866e-0x0;var _0x56a44c=_0x6450[_0x15866e];return _0x56a44c;};'use strict';var multer=require('multer');var util=require(_0x0645('0x0'));var path=require('path');var timeout=require(_0x0645('0x1'));var express=require(_0x0645('0x2'));var router=express[_0x0645('0x3')]();var fs_extra=require(_0x0645('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0645('0x5'));var config=require(_0x0645('0x6'));var controller=require(_0x0645('0x7'));router[_0x0645('0x8')]('/',auth[_0x0645('0x9')](),controller[_0x0645('0xa')]);router[_0x0645('0x8')](_0x0645('0xb'),auth[_0x0645('0x9')](),controller[_0x0645('0xc')]);router[_0x0645('0xd')](_0x0645('0xe'),auth['isAuthenticated'](),controller['clone']);router['post']('/',auth[_0x0645('0x9')](),controller[_0x0645('0xf')]);router[_0x0645('0x10')](_0x0645('0xb'),auth[_0x0645('0x9')](),controller[_0x0645('0x11')]);router[_0x0645('0x12')](_0x0645('0xb'),auth[_0x0645('0x9')](),controller['destroy']);module[_0x0645('0x13')]=router; \ No newline at end of file +var _0xb06b=['post','/:id/clone','clone','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show'];(function(_0x20985a,_0x325008){var _0x49a57d=function(_0x44f6b7){while(--_0x44f6b7){_0x20985a['push'](_0x20985a['shift']());}};_0x49a57d(++_0x325008);}(_0xb06b,0xb0));var _0xbb06=function(_0xa3aafd,_0xbb1a89){_0xa3aafd=_0xa3aafd-0x0;var _0x1d8aa8=_0xb06b[_0xa3aafd];return _0x1d8aa8;};'use strict';var multer=require(_0xbb06('0x0'));var util=require('util');var path=require(_0xbb06('0x1'));var timeout=require(_0xbb06('0x2'));var express=require(_0xbb06('0x3'));var router=express[_0xbb06('0x4')]();var fs_extra=require(_0xbb06('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbb06('0x6'));var config=require(_0xbb06('0x7'));var controller=require(_0xbb06('0x8'));router[_0xbb06('0x9')]('/',auth[_0xbb06('0xa')](),controller['index']);router['get'](_0xbb06('0xb'),auth['isAuthenticated'](),controller[_0xbb06('0xc')]);router[_0xbb06('0xd')](_0xbb06('0xe'),auth[_0xbb06('0xa')](),controller[_0xbb06('0xf')]);router[_0xbb06('0xd')]('/',auth['isAuthenticated'](),controller[_0xbb06('0x10')]);router[_0xbb06('0x11')]('/:id',auth[_0xbb06('0xa')](),controller[_0xbb06('0x12')]);router['delete'](_0xbb06('0xb'),auth[_0xbb06('0xa')](),controller[_0xbb06('0x13')]);module[_0xbb06('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index a76e5bf..1c81443 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 _0x2402=['force_rport,comedia','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','certificate','active','passive','actpass','dynamic','update','update,nonat','sequelize','exports','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','nonat','outgoing','yes'];(function(_0x3f7dc7,_0x5022e0){var _0xf47427=function(_0x3a75d5){while(--_0x3a75d5){_0x3f7dc7['push'](_0x3f7dc7['shift']());}};_0xf47427(++_0x5022e0);}(_0x2402,0x184));var _0x2240=function(_0x4d08b6,_0x53db38){_0x4d08b6=_0x4d08b6-0x0;var _0x4e8c5d=_0x2402[_0x4d08b6];return _0x4e8c5d;};'use strict';var Sequelize=require(_0x2240('0x0'));module[_0x2240('0x1')]={'name':{'type':Sequelize[_0x2240('0x2')],'allowNull':![],'unique':_0x2240('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x2240('0x4'),_0x2240('0x5'),_0x2240('0x6')),'allowNull':![],'defaultValue':_0x2240('0x4')},'context':{'type':Sequelize[_0x2240('0x2')],'allowNull':![],'defaultValue':_0x2240('0x7')},'callingpres':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x9'),_0x2240('0xa'),_0x2240('0xb'),_0x2240('0xc'),_0x2240('0xd'),'PROHIB_PASSED_SCREEN',_0x2240('0xe'),_0x2240('0xf'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x2240('0x2')]},'secret':{'type':Sequelize[_0x2240('0x2')]},'md5secret':{'type':Sequelize[_0x2240('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x2240('0x2')],'defaultValue':_0x2240('0x10'),'set':function(_0x338a80){this[_0x2240('0x11')](_0x2240('0x12'),_0x338a80?_0x338a80[_0x2240('0x13')](','):null);},'get':function(){return this[_0x2240('0x14')](_0x2240('0x12'))?this['getDataValue'](_0x2240('0x12'))['split'](','):null;},'comment':_0x2240('0x15')},'dtmfmode':{'type':Sequelize['ENUM'](_0x2240('0x16'),'info',_0x2240('0x17'),'inband',_0x2240('0x18')),'defaultValue':_0x2240('0x16')},'directmedia':{'type':Sequelize[_0x2240('0x8')]('yes','no',_0x2240('0x19'),'update',_0x2240('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x2240('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2240('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x2240('0x2')],'defaultValue':_0x2240('0x1c'),'set':function(_0x5e329f){this['setDataValue']('nat',_0x5e329f?_0x5e329f[_0x2240('0x13')](','):null);},'get':function(){return this[_0x2240('0x14')]('nat')?this[_0x2240('0x14')]('nat')[_0x2240('0x1d')](','):null;},'comment':_0x2240('0x1e')},'callgroup':{'type':Sequelize[_0x2240('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2240('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2240('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2240('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2240('0x2')],'defaultValue':_0x2240('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2240('0x20'),'set':function(_0xd06129){this['setDataValue'](_0x2240('0x21'),_0xd06129?_0xd06129[_0x2240('0x13')](';'):_0x2240('0x20'));},'get':function(){return this[_0x2240('0x14')](_0x2240('0x21'))?this['getDataValue'](_0x2240('0x21'))[_0x2240('0x1d')](';'):null;},'comment':_0x2240('0x22')},'autoframing':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'insecure':{'type':Sequelize[_0x2240('0x2')],'defaultValue':'port,invite','set':function(_0x4053ee){this[_0x2240('0x11')](_0x2240('0x23'),_0x4053ee?_0x4053ee[_0x2240('0x13')](','):null);},'get':function(){return this[_0x2240('0x14')]('insecure')?this[_0x2240('0x14')](_0x2240('0x23'))[_0x2240('0x1d')](','):null;},'comment':_0x2240('0x24')},'trustrpid':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x2240('0x25'))},'promiscredir':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x2240('0x26')](0xb)},'setvar':{'type':Sequelize[_0x2240('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x2240('0x27')},'amaflags':{'type':Sequelize[_0x2240('0x2')]},'callcounter':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no'),'defaultValue':_0x2240('0x1b')},'busylevel':{'type':Sequelize[_0x2240('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x2240('0x1b'),'no')},'allowsubscribe':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'allowtransfer':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'subscribecontext':{'type':Sequelize[_0x2240('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no',_0x2240('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2240('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x2240('0x1b'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x2240('0x8')]('accept',_0x2240('0x29'),_0x2240('0x2a'))},'session_expires':{'type':Sequelize[_0x2240('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x2240('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x2b'),_0x2240('0x2c')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x2240('0x2')]},'regexten':{'type':Sequelize[_0x2240('0x2')]},'fromdomain':{'type':Sequelize[_0x2240('0x2')]},'fromuser':{'type':Sequelize[_0x2240('0x2')]},'port':{'type':Sequelize[_0x2240('0x26')](0x5)},'qualify':{'type':Sequelize[_0x2240('0x8')]('yes','no'),'defaultValue':_0x2240('0x1b')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x2240('0x2')]},'defaultuser':{'type':Sequelize[_0x2240('0x2')]},'rtptimeout':{'type':Sequelize[_0x2240('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2240('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2240('0x2')]},'callbackextension':{'type':Sequelize[_0x2240('0x2')]},'timert1':{'type':Sequelize[_0x2240('0x26')](0xb)},'timerb':{'type':Sequelize[_0x2240('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x2240('0x2')]},'contactdeny':{'type':Sequelize[_0x2240('0x2')]},'contactacl':{'type':Sequelize[_0x2240('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2240('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x2240('0x8')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x2240('0x1b'),'no')},'force_avp':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x2240('0x1b'),'no')},'dtlsenable':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'dtlsverify':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no','fingerprint',_0x2240('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x2240('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2240('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2240('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x2240('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x2240('0x2e'),_0x2240('0x2f'),_0x2240('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2240('0x2')]},'usereqphone':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2240('0x2')]},'recordofffeature':{'type':Sequelize[_0x2240('0x2')]},'call_limit':{'type':Sequelize[_0x2240('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no')},'vmexten':{'type':Sequelize[_0x2240('0x2')]},'mohinterpret':{'type':Sequelize[_0x2240('0x2')]},'mohsuggest':{'type':Sequelize[_0x2240('0x2')]},'parkinglot':{'type':Sequelize[_0x2240('0x2')]},'description':{'type':Sequelize[_0x2240('0x2')]},'host':{'type':Sequelize[_0x2240('0x2')],'defaultValue':_0x2240('0x31')},'canreinvite':{'type':Sequelize[_0x2240('0x8')](_0x2240('0x1b'),'no',_0x2240('0x19'),_0x2240('0x32'),_0x2240('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2240('0x2')]},'otherFields':{'type':Sequelize[_0x2240('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x46e1=['outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','passive','actpass','dynamic','sequelize','exports','STRING','name','friend','peer','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update'];(function(_0x917d9f,_0x143cfe){var _0x26b828=function(_0x376f53){while(--_0x376f53){_0x917d9f['push'](_0x917d9f['shift']());}};_0x26b828(++_0x143cfe);}(_0x46e1,0x1d8));var _0x146e=function(_0x35eb76,_0x5ba493){_0x35eb76=_0x35eb76-0x0;var _0x137d63=_0x46e1[_0x35eb76];return _0x137d63;};'use strict';var Sequelize=require(_0x146e('0x0'));module[_0x146e('0x1')]={'name':{'type':Sequelize[_0x146e('0x2')],'allowNull':![],'unique':_0x146e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x146e('0x4'),'user',_0x146e('0x5')),'allowNull':![],'defaultValue':_0x146e('0x4')},'context':{'type':Sequelize[_0x146e('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x7'),_0x146e('0x8'),_0x146e('0x9'),_0x146e('0xa'),_0x146e('0xb'),'PROHIB_PASSED_SCREEN',_0x146e('0xc'),_0x146e('0xd'))},'deny':{'type':Sequelize[_0x146e('0x2')]},'permit':{'type':Sequelize[_0x146e('0x2')]},'secret':{'type':Sequelize[_0x146e('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x146e('0x2')]},'transport':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0xe'),'set':function(_0x4b39a2){this[_0x146e('0xf')](_0x146e('0x10'),_0x4b39a2?_0x4b39a2[_0x146e('0x11')](','):null);},'get':function(){return this[_0x146e('0x12')](_0x146e('0x10'))?this[_0x146e('0x12')]('transport')[_0x146e('0x13')](','):null;},'comment':_0x146e('0x14')},'dtmfmode':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x15'),_0x146e('0x16'),'shortinfo',_0x146e('0x17'),_0x146e('0x18')),'defaultValue':_0x146e('0x15')},'directmedia':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no',_0x146e('0x1a'),_0x146e('0x1b'),_0x146e('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x146e('0x2')]},'nat':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x1d'),'set':function(_0x2bda31){this[_0x146e('0xf')](_0x146e('0x1e'),_0x2bda31?_0x2bda31['join'](','):null);},'get':function(){return this[_0x146e('0x12')](_0x146e('0x1e'))?this[_0x146e('0x12')](_0x146e('0x1e'))[_0x146e('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x146e('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x146e('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x146e('0x2')]},'language':{'type':Sequelize[_0x146e('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x146e('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x1f')},'allow':{'type':Sequelize[_0x146e('0x2')],'allowNull':![],'defaultValue':_0x146e('0x20'),'set':function(_0x32adbf){this[_0x146e('0xf')](_0x146e('0x21'),_0x32adbf?_0x32adbf['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x146e('0x12')](_0x146e('0x21'))?this[_0x146e('0x12')]('allow')[_0x146e('0x13')](';'):null;},'comment':_0x146e('0x22')},'autoframing':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x146e('0x23'),'set':function(_0x407f4e){this[_0x146e('0xf')](_0x146e('0x24'),_0x407f4e?_0x407f4e['join'](','):null);},'get':function(){return this['getDataValue'](_0x146e('0x24'))?this[_0x146e('0x12')](_0x146e('0x24'))['split'](','):null;},'comment':_0x146e('0x25')},'trustrpid':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no',_0x146e('0x26'))},'promiscredir':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'accountcode':{'type':Sequelize[_0x146e('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x28')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':_0x146e('0x19')},'busylevel':{'type':Sequelize[_0x146e('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x146e('0x6')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x146e('0x2')]},'template':{'type':Sequelize[_0x146e('0x2')]},'videosupport':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no',_0x146e('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x146e('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x2a'),'refuse',_0x146e('0x2b'))},'session_expires':{'type':Sequelize[_0x146e('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x146e('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x2c'),_0x146e('0x2d')),'defaultValue':_0x146e('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x146e('0x2')]},'regexten':{'type':Sequelize[_0x146e('0x2')]},'fromdomain':{'type':Sequelize[_0x146e('0x2')]},'fromuser':{'type':Sequelize[_0x146e('0x2')]},'port':{'type':Sequelize[_0x146e('0x27')](0x5)},'qualify':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x146e('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x146e('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x146e('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x146e('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x146e('0x6')]('yes','no',_0x146e('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x146e('0x2')]},'callbackextension':{'type':Sequelize[_0x146e('0x2')]},'timert1':{'type':Sequelize[_0x146e('0x27')](0xb)},'timerb':{'type':Sequelize[_0x146e('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x146e('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x146e('0x2')]},'contactdeny':{'type':Sequelize[_0x146e('0x2')]},'contactacl':{'type':Sequelize[_0x146e('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x146e('0x2')]},'use_q850_reason':{'type':Sequelize[_0x146e('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x146e('0x6')]('yes','no')},'force_avp':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'icesupport':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x146e('0x27')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x146e('0x2')]},'dtlscipher':{'type':Sequelize[_0x146e('0x2')]},'dtlscafile':{'type':Sequelize[_0x146e('0x2')]},'dtlscapath':{'type':Sequelize[_0x146e('0x2')]},'dtlssetup':{'type':Sequelize[_0x146e('0x6')]('active',_0x146e('0x2f'),_0x146e('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x146e('0x2')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x146e('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x146e('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x146e('0x19'),'no')},'vmexten':{'type':Sequelize[_0x146e('0x2')]},'mohinterpret':{'type':Sequelize[_0x146e('0x2')]},'mohsuggest':{'type':Sequelize[_0x146e('0x2')]},'parkinglot':{'type':Sequelize[_0x146e('0x2')]},'description':{'type':Sequelize[_0x146e('0x2')]},'host':{'type':Sequelize[_0x146e('0x2')],'defaultValue':_0x146e('0x31')},'canreinvite':{'type':Sequelize[_0x146e('0x6')](_0x146e('0x19'),'no','nonat',_0x146e('0x1b'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x146e('0x2')]},'otherFields':{'type':Sequelize[_0x146e('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x146e('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index d40fd11..5945b02 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','length','includeAll','clone','find','get','createdAt','body','omit','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','autoAssociation','update','utf8','server/files/templates/registry.ejs','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order'];(function(_0xaeb648,_0xaf78a4){var _0x281cfc=function(_0x3e5157){while(--_0x3e5157){_0xaeb648['push'](_0xaeb648['shift']());}};_0x281cfc(++_0xaf78a4);}(_0x6aa7,0x178));var _0x76aa=function(_0x2fa294,_0x1ef866){_0x2fa294=_0x2fa294-0x0;var _0x373d8e=_0x6aa7[_0x2fa294];return _0x373d8e;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x76aa('0x19'));var client=jayson['client'][_0x76aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12dde0,_0x3f8f6b,_0x8e44ed,_0x10432c){return new BPromise(function(_0x4e309f,_0x5f5b59){var _0x2b3b4f=_0x10432c||client;return _0x2b3b4f['request'](_0x12dde0,_0x8e44ed)[_0x76aa('0x1b')](function(_0x319bf1){logger['info'](_0x76aa('0x1c'),_0x3f8f6b,'request\x20sent');logger[_0x76aa('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f8f6b,_0x76aa('0x1e'),JSON[_0x76aa('0x1f')](_0x319bf1));if(_0x319bf1[_0x76aa('0x20')]){if(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x21')]===0x1f4){logger[_0x76aa('0x20')]('Trunk,\x20%s,\x20%s',_0x3f8f6b,_0x319bf1['error'][_0x76aa('0x22')]);return _0x5f5b59(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);return _0x4e309f(_0x319bf1[_0x76aa('0x20')][_0x76aa('0x22')]);}else{logger['info'](_0x76aa('0x1c'),_0x3f8f6b,_0x76aa('0x1e'));_0x4e309f(_0x319bf1[_0x76aa('0x23')]['message']);}})[_0x76aa('0x24')](function(_0x189cb6){logger[_0x76aa('0x20')](_0x76aa('0x1c'),_0x3f8f6b,_0x189cb6);_0x5f5b59(_0x189cb6);});});}function respondWithStatusCode(_0x29c50c,_0xc1044c){_0xc1044c=_0xc1044c||0xcc;return function(_0x3cd039){if(_0x3cd039){return _0x29c50c[_0x76aa('0x25')](_0xc1044c);}return _0x29c50c[_0x76aa('0x26')](_0xc1044c)[_0x76aa('0x27')]();};}function respondWithResult(_0x37f1ab,_0x26b75e){_0x26b75e=_0x26b75e||0xc8;return function(_0x3599a9){if(_0x3599a9){return _0x37f1ab['status'](_0x26b75e)[_0x76aa('0x28')](_0x3599a9);}};}function respondWithFilteredResult(_0x1d6d15,_0x25c614){return function(_0x2e7ab4){if(_0x2e7ab4){var _0xa1e6=typeof _0x25c614[_0x76aa('0x29')]===_0x76aa('0x2a')&&typeof _0x25c614[_0x76aa('0x2b')]===_0x76aa('0x2a');var _0x1bdc3d=_0x2e7ab4['count'];var _0x3fcb7f=_0xa1e6?0x0:_0x25c614['offset'];var _0x994550=_0xa1e6?_0x2e7ab4[_0x76aa('0x2c')]:_0x25c614[_0x76aa('0x29')]+_0x25c614[_0x76aa('0x2b')];var _0x1eecd9;if(_0x994550>=_0x1bdc3d){_0x994550=_0x1bdc3d;_0x1eecd9=0xc8;}else{_0x1eecd9=0xce;}_0x1d6d15[_0x76aa('0x26')](_0x1eecd9);return _0x1d6d15[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x3fcb7f+'-'+_0x994550+'/'+_0x1bdc3d)[_0x76aa('0x28')](_0x2e7ab4);}return null;};}function patchUpdates(_0x3ea05a){return function(_0x5edcd8){try{jsonpatch[_0x76aa('0x2f')](_0x5edcd8,_0x3ea05a,!![]);}catch(_0x5532c7){return BPromise[_0x76aa('0x30')](_0x5532c7);}return _0x5edcd8[_0x76aa('0x31')]();};}function saveUpdates(_0x458ac3,_0x38ecd1){return function(_0x35a705){if(_0x35a705){return _0x35a705['update'](_0x458ac3)[_0x76aa('0x1b')](function(_0x25a11f){return _0x25a11f;});}return null;};}function removeEntity(_0x5a0f72,_0x2ee338){return function(_0x58d860){if(_0x58d860){return _0x58d860[_0x76aa('0x32')]()['then'](function(){var _0x8479a3=_0x58d860['get']({'plain':!![]});var _0x58f135=_0x76aa('0x33');return db[_0x76aa('0x34')][_0x76aa('0x32')]({'where':{'type':_0x58f135,'resourceId':_0x8479a3['id']}})[_0x76aa('0x1b')](function(){return _0x58d860;});})['then'](function(){_0x5a0f72['status'](0xcc)[_0x76aa('0x27')]();});}};}function handleEntityNotFound(_0x1c7b6f,_0x58127c){return function(_0x23e2fd){if(!_0x23e2fd){_0x1c7b6f[_0x76aa('0x25')](0x194);}return _0x23e2fd;};}function handleError(_0x5b57d8,_0x9ce5f4){_0x9ce5f4=_0x9ce5f4||0x1f4;return function(_0x5c77f1){logger['error'](_0x5c77f1[_0x76aa('0x35')]);if(_0x5c77f1[_0x76aa('0x36')]){delete _0x5c77f1[_0x76aa('0x36')];}_0x5b57d8[_0x76aa('0x26')](_0x9ce5f4)['send'](_0x5c77f1);};}exports[_0x76aa('0x37')]=function(_0x1c22f7,_0x2eea79){var _0x4e131a={},_0x113770={},_0x1638db={'count':0x0,'rows':[]};var _0x2f7726=_[_0x76aa('0x38')](db[_0x76aa('0x39')][_0x76aa('0x3a')],function(_0x878903){return{'name':_0x878903[_0x76aa('0x3b')],'type':_0x878903[_0x76aa('0x3c')]['key']};});_0x113770[_0x76aa('0x3d')]=_[_0x76aa('0x38')](_0x2f7726,_0x76aa('0x36'));_0x113770[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x1c22f7[_0x76aa('0x3e')]);_0x113770['filters']=_['intersection'](_0x113770[_0x76aa('0x3d')],_0x113770[_0x76aa('0x3e')]);_0x4e131a[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x113770['model'],qs[_0x76aa('0x42')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x4e131a[_0x76aa('0x40')]=_0x4e131a[_0x76aa('0x40')]['length']?_0x4e131a[_0x76aa('0x40')]:_0x113770['model'];if(!_0x1c22f7[_0x76aa('0x3e')]['hasOwnProperty']('nolimit')){_0x4e131a['limit']=qs[_0x76aa('0x2b')](_0x1c22f7['query']['limit']);_0x4e131a['offset']=qs[_0x76aa('0x29')](_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x29')]);}_0x4e131a[_0x76aa('0x43')]=qs[_0x76aa('0x44')](_0x1c22f7['query'][_0x76aa('0x44')]);_0x4e131a[_0x76aa('0x45')]=qs[_0x76aa('0x46')](_[_0x76aa('0x47')](_0x1c22f7[_0x76aa('0x3e')],_0x113770['filters']),_0x2f7726);if(_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]){_0x4e131a['where']=_[_0x76aa('0x49')](_0x4e131a['where'],{'$or':_[_0x76aa('0x38')](_0x2f7726,function(_0x24ea05){if(_0x24ea05[_0x76aa('0x3c')]!==_0x76aa('0x4a')){var _0x2d0bc4={};_0x2d0bc4[_0x24ea05[_0x76aa('0x36')]]={'$like':'%'+_0x1c22f7[_0x76aa('0x3e')][_0x76aa('0x48')]+'%'};return _0x2d0bc4;}})});}_0x4e131a=_[_0x76aa('0x49')]({},_0x4e131a,_0x1c22f7[_0x76aa('0x4b')]);var _0x5e4967={'where':_0x4e131a[_0x76aa('0x45')]};return db['Trunk'][_0x76aa('0x2c')](_0x5e4967)[_0x76aa('0x1b')](function(_0x5e95f5){_0x1638db[_0x76aa('0x2c')]=_0x5e95f5;if(_0x1c22f7['query']['includeAll']){_0x4e131a[_0x76aa('0x4c')]=[{'all':!![]}];}return db['Trunk'][_0x76aa('0x4d')](_0x4e131a);})[_0x76aa('0x1b')](function(_0x4315b3){_0x1638db[_0x76aa('0x4e')]=_0x4315b3;return _0x1638db;})[_0x76aa('0x1b')](respondWithFilteredResult(_0x2eea79,_0x4e131a))[_0x76aa('0x24')](handleError(_0x2eea79,null));};exports['show']=function(_0x564546,_0x2fcf8f){var _0x1eafb2={'raw':![],'where':{'id':_0x564546[_0x76aa('0x4f')]['id']}},_0x1708d4={};_0x1708d4[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x1708d4[_0x76aa('0x3e')]=_[_0x76aa('0x3f')](_0x564546['query']);_0x1708d4[_0x76aa('0x46')]=_['intersection'](_0x1708d4[_0x76aa('0x3d')],_0x1708d4['query']);_0x1eafb2[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x1708d4[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x564546[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x1eafb2[_0x76aa('0x40')]=_0x1eafb2['attributes'][_0x76aa('0x50')]?_0x1eafb2['attributes']:_0x1708d4[_0x76aa('0x3d')];if(_0x564546[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x1eafb2[_0x76aa('0x4c')]=[{'all':!![]}];}_0x1eafb2=_[_0x76aa('0x49')]({},_0x1eafb2,_0x564546[_0x76aa('0x4b')]);return db[_0x76aa('0x39')]['find'](_0x1eafb2)[_0x76aa('0x1b')](handleEntityNotFound(_0x2fcf8f,null))[_0x76aa('0x1b')](respondWithResult(_0x2fcf8f,null))[_0x76aa('0x24')](handleError(_0x2fcf8f,null));};exports[_0x76aa('0x52')]=function(_0x5c742c,_0xb9401b){var _0x163440={'where':{'id':_0x5c742c[_0x76aa('0x4f')]['id']}},_0x8dc601={};_0x8dc601[_0x76aa('0x3d')]=_[_0x76aa('0x3f')](db['Trunk'][_0x76aa('0x3a')]);_0x163440[_0x76aa('0x40')]=_[_0x76aa('0x41')](_0x8dc601[_0x76aa('0x3d')],qs[_0x76aa('0x42')](_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x42')]));_0x163440['attributes']=_0x163440['attributes'][_0x76aa('0x50')]?_0x163440[_0x76aa('0x40')]:_0x8dc601['model'];if(_0x5c742c[_0x76aa('0x3e')][_0x76aa('0x51')]){_0x163440['include']=[{'all':!![]}];}_0x163440=_[_0x76aa('0x49')]({},_0x163440,_0x5c742c[_0x76aa('0x4b')]);return db[_0x76aa('0x39')][_0x76aa('0x53')](_0x163440)[_0x76aa('0x1b')](handleEntityNotFound(_0xb9401b,null))[_0x76aa('0x1b')](function(_0x3376ec){if(_0x3376ec){var _0x30573a=_0x3376ec[_0x76aa('0x54')]({'plain':!![]});_0x30573a=qs['omit'](_0x30573a,['id',_0x76aa('0x55'),'updatedAt']);_0x5c742c[_0x76aa('0x56')]=_[_0x76aa('0x57')](_0x5c742c[_0x76aa('0x56')],['id',_0x76aa('0x55'),_0x76aa('0x58')]);return db[_0x76aa('0x39')][_0x76aa('0x59')](_[_0x76aa('0x49')](_0x30573a,_0x5c742c[_0x76aa('0x56')]),{'include':_0x5c742c['query'][_0x76aa('0x51')]?[{'all':!![]}]:undefined})[_0x76aa('0x1b')](function(_0x5c542b){var _0xe5957d=_0x5c742c[_0x76aa('0x5a')][_0x76aa('0x54')]({'plain':!![]});if(!_0xe5957d)throw new Error(_0x76aa('0x5b'));if(_0xe5957d[_0x76aa('0x5c')]==='user'){var _0x364d05=_0x5c542b['get']({'plain':!![]});var _0x35bd2b=_0x76aa('0x33');return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':_0x35bd2b,'userProfileId':_0xe5957d[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x2bfb46){if(_0x2bfb46&&_0x2bfb46['autoAssociation']===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x364d05['name'],'resourceId':_0x364d05['id'],'type':_0x2bfb46['name'],'sectionId':_0x2bfb46['id']},{})[_0x76aa('0x1b')](function(){return _0x5c542b;});}else{return _0x5c542b;}})[_0x76aa('0x24')](function(_0x5295a7){logger[_0x76aa('0x20')](_0x76aa('0x5f'),_0x5295a7);throw _0x5295a7;});}return _0x5c542b;});}})[_0x76aa('0x1b')](respondWithResult(_0xb9401b,0xc9))['catch'](handleError(_0xb9401b,null));};exports[_0x76aa('0x59')]=function(_0x47f733,_0xf31e1f,_0x1178e5){var _0x2315cf;return db[_0x76aa('0x39')]['create'](_0x47f733['body'],{'raw':!![]})[_0x76aa('0x1b')](function(_0x4dfeb3){_0x2315cf=_0x4dfeb3;return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x43a2af){var _0x2dd320=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x63')),'utf8');var _0x7d02e7=fs[_0x76aa('0x60')](path[_0x76aa('0x61')](config[_0x76aa('0x62')],'server/files/templates/registry.ejs'),'utf8');var _0x557c11=ejs[_0x76aa('0x64')](_0x2dd320,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x65'),_0x557c11);if(_0x2315cf[_0x76aa('0x66')]){var _0x38faff=ejs[_0x76aa('0x64')](_0x7d02e7,{'trunks':_0x43a2af||[]});fs['writeFileSync'](_0x76aa('0x67'),_0x38faff);}})['then'](function(){return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x59'),{'module':_0x76aa('0x69')});})[_0x76aa('0x1b')](function(){var _0x1037fb=_0x47f733['user'][_0x76aa('0x54')]({'plain':!![]});if(!_0x1037fb)throw new Error(_0x76aa('0x5b'));if(_0x1037fb[_0x76aa('0x5c')]===_0x76aa('0x5a')){var _0x32c1de=_0x2315cf[_0x76aa('0x54')]({'plain':!![]});return db[_0x76aa('0x5d')][_0x76aa('0x53')]({'where':{'name':'Trunks','userProfileId':_0x1037fb[_0x76aa('0x5e')]},'raw':!![]})[_0x76aa('0x1b')](function(_0x48136a){if(_0x48136a&&_0x48136a[_0x76aa('0x6a')]===0x0){return db[_0x76aa('0x34')][_0x76aa('0x59')]({'name':_0x32c1de[_0x76aa('0x36')],'resourceId':_0x32c1de['id'],'type':_0x48136a[_0x76aa('0x36')],'sectionId':_0x48136a['id']},{})[_0x76aa('0x1b')](function(){return _0x2315cf;});}else{return _0x2315cf;}})[_0x76aa('0x24')](function(_0x5dc923){logger[_0x76aa('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5dc923);throw _0x5dc923;});}return _0x2315cf;})['then'](respondWithResult(_0xf31e1f,0xc9))[_0x76aa('0x24')](handleError(_0xf31e1f,null));};exports[_0x76aa('0x6b')]=function(_0x5d8947,_0x5d1de1,_0x36da4d){var _0x14b5a2;return db[_0x76aa('0x39')]['find']({'where':{'id':_0x5d8947['params']['id']}})[_0x76aa('0x1b')](handleEntityNotFound(_0x5d1de1,null))[_0x76aa('0x1b')](saveUpdates(_0x5d8947[_0x76aa('0x56')],null))['then'](function(_0xb70589){if(_0xb70589){_0x14b5a2=_0xb70589;return db['Trunk'][_0x76aa('0x4d')]({'raw':!![]});}})[_0x76aa('0x1b')](function(_0x383290){if(_0x383290){var _0x325ffa=fs[_0x76aa('0x60')](path['join'](config['root'],_0x76aa('0x63')),_0x76aa('0x6c'));var _0x19ebb7=fs['readFileSync'](path[_0x76aa('0x61')](config[_0x76aa('0x62')],_0x76aa('0x6d')),_0x76aa('0x6c'));var _0x303b78=ejs['render'](_0x325ffa,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')]('/etc/asterisk/sip_xcally_trunks.conf',_0x303b78);var _0x213f7f=ejs[_0x76aa('0x64')](_0x19ebb7,{'trunks':_0x383290||[]});fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x213f7f);return respondWithRpcPromise(_0x76aa('0x68'),_0x76aa('0x6b'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x547411){if(_0x547411){return _0x14b5a2;}})['then'](respondWithResult(_0x5d1de1,null))['catch'](handleError(_0x5d1de1,null));};exports[_0x76aa('0x32')]=function(_0x22f44f,_0x52c5be,_0x5c2c91){var _0x4f01e9;return db[_0x76aa('0x39')][_0x76aa('0x53')]({'where':{'id':_0x22f44f[_0x76aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x52c5be,null))['then'](removeEntity(_0x52c5be,null))[_0x76aa('0x1b')](function(){return db[_0x76aa('0x39')][_0x76aa('0x4d')]({'raw':!![]});})[_0x76aa('0x1b')](function(_0x354c7b){var _0x55e526=fs['readFileSync'](path[_0x76aa('0x61')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x4673e6=fs[_0x76aa('0x60')](path['join'](config[_0x76aa('0x62')],_0x76aa('0x6d')),'utf8');var _0x22063f=ejs[_0x76aa('0x64')](_0x55e526,{'trunks':_0x354c7b});var _0x11d91f=ejs[_0x76aa('0x64')](_0x4673e6,{'trunks':_0x354c7b});fs[_0x76aa('0x6e')](_0x76aa('0x65'),_0x22063f);fs[_0x76aa('0x6e')](_0x76aa('0x67'),_0x11d91f);return respondWithRpcPromise(_0x76aa('0x68'),'destroy',{'module':_0x76aa('0x69')});})[_0x76aa('0x24')](handleError(_0x52c5be,null));}; \ No newline at end of file +var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x372f0a,_0xa4cbb6){var _0x1877a5=function(_0x28785a){while(--_0x28785a){_0x372f0a['push'](_0x372f0a['shift']());}};_0x1877a5(++_0xa4cbb6);}(_0x54ef,0x112));var _0xf54e=function(_0x3205e9,_0x1cb7b8){_0x3205e9=_0x3205e9-0x0;var _0xc0fb17=_0x54ef[_0x3205e9];return _0xc0fb17;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 2bf0788..3345862 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 _0xa6b4=['rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x22cd80,_0x1036c8){var _0x119c5e=function(_0xa3b7e9){while(--_0xa3b7e9){_0x22cd80['push'](_0x22cd80['shift']());}};_0x119c5e(++_0x1036c8);}(_0xa6b4,0x84));var _0x4a6b=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0xa6b4[_0x32e649];return _0x14d386;};'use strict';var _=require(_0x4a6b('0x0'));var util=require(_0x4a6b('0x1'));var logger=require(_0x4a6b('0x2'))(_0x4a6b('0x3'));var moment=require(_0x4a6b('0x4'));var BPromise=require(_0x4a6b('0x5'));var rp=require(_0x4a6b('0x6'));var fs=require('fs');var path=require(_0x4a6b('0x7'));var rimraf=require(_0x4a6b('0x8'));var config=require(_0x4a6b('0x9'));var attributes=require(_0x4a6b('0xa'));module[_0x4a6b('0xb')]=function(_0x561c4a,_0x59d46e){return _0x561c4a[_0x4a6b('0xc')](_0x4a6b('0xd'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f8c=['Trunk','tools_trunks','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f8c,0x12e));var _0xc1f8=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x1f8c[_0x149ca0];return _0x56b6b9;};'use strict';var _=require(_0xc1f8('0x0'));var util=require(_0xc1f8('0x1'));var logger=require('../../config/logger')(_0xc1f8('0x2'));var moment=require(_0xc1f8('0x3'));var BPromise=require(_0xc1f8('0x4'));var rp=require(_0xc1f8('0x5'));var fs=require('fs');var path=require(_0xc1f8('0x6'));var rimraf=require('rimraf');var config=require(_0xc1f8('0x7'));var attributes=require('./trunk.attributes');module[_0xc1f8('0x8')]=function(_0x2af2dc,_0xba8076){return _0x2af2dc[_0xc1f8('0x9')](_0xc1f8('0xa'),attributes,{'tableName':_0xc1f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 62cd15a..28c0514 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 _0xb90d=['lodash','util','moment','bluebird','../../config/logger','../../config/environment','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trunk','options','raw','where','attributes','limit','include','model','map','GetTrunk','ShowTrunk','find'];(function(_0x10e32d,_0x525503){var _0x1b36dd=function(_0xbc5f4a){while(--_0xbc5f4a){_0x10e32d['push'](_0x10e32d['shift']());}};_0x1b36dd(++_0x525503);}(_0xb90d,0x193));var _0xdb90=function(_0x5eca6f,_0x76ec15){_0x5eca6f=_0x5eca6f-0x0;var _0x4c34b7=_0xb90d[_0x5eca6f];return _0x4c34b7;};'use strict';var _=require(_0xdb90('0x0'));var util=require(_0xdb90('0x1'));var moment=require(_0xdb90('0x2'));var BPromise=require(_0xdb90('0x3'));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(_0xdb90('0x4'))('rpc');var config=require(_0xdb90('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xdb90('0x6')][_0xdb90('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x17c3e1,_0x50c571,_0x384895){return new BPromise(function(_0x167fbe,_0x2a84d6){return client['request'](_0x17c3e1,_0x384895)[_0xdb90('0x8')](function(_0x25405f){logger[_0xdb90('0x9')](_0xdb90('0xa'),_0x50c571,_0xdb90('0xb'));logger[_0xdb90('0xc')](_0xdb90('0xd'),_0x50c571,_0xdb90('0xb'),JSON[_0xdb90('0xe')](_0x25405f));if(_0x25405f['error']){if(_0x25405f[_0xdb90('0xf')][_0xdb90('0x10')]===0x1f4){logger[_0xdb90('0xf')](_0xdb90('0xa'),_0x50c571,_0x25405f[_0xdb90('0xf')][_0xdb90('0x11')]);return _0x2a84d6(_0x25405f[_0xdb90('0xf')]['message']);}logger[_0xdb90('0xf')](_0xdb90('0xa'),_0x50c571,_0x25405f['error'][_0xdb90('0x11')]);return _0x167fbe(_0x25405f[_0xdb90('0xf')][_0xdb90('0x11')]);}else{logger['info'](_0xdb90('0xa'),_0x50c571,_0xdb90('0xb'));_0x167fbe(_0x25405f['result'][_0xdb90('0x11')]);}})[_0xdb90('0x12')](function(_0x5b1654){logger[_0xdb90('0xf')](_0xdb90('0xa'),_0x50c571,_0x5b1654);_0x2a84d6(_0x5b1654);});});}exports['GetTrunk']=function(_0x3fc383){var _0x200954=this;return new Promise(function(_0x2d2015,_0x2fa7c9){return db[_0xdb90('0x13')]['findAll']({'raw':_0x3fc383[_0xdb90('0x14')]?_0x3fc383[_0xdb90('0x14')][_0xdb90('0x15')]===undefined?!![]:![]:!![],'where':_0x3fc383[_0xdb90('0x14')]?_0x3fc383['options'][_0xdb90('0x16')]||null:null,'attributes':_0x3fc383[_0xdb90('0x14')]?_0x3fc383['options'][_0xdb90('0x17')]||null:null,'limit':_0x3fc383['options']?_0x3fc383[_0xdb90('0x14')][_0xdb90('0x18')]||null:null,'include':_0x3fc383[_0xdb90('0x14')]?_0x3fc383[_0xdb90('0x14')][_0xdb90('0x19')]?_['map'](_0x3fc383['options'][_0xdb90('0x19')],function(_0x2a36d3){return{'model':db[_0x2a36d3[_0xdb90('0x1a')]],'as':_0x2a36d3['as'],'attributes':_0x2a36d3[_0xdb90('0x17')],'include':_0x2a36d3['include']?_[_0xdb90('0x1b')](_0x2a36d3[_0xdb90('0x19')],function(_0x42459f){return{'model':db[_0x42459f['model']],'as':_0x42459f['as'],'attributes':_0x42459f[_0xdb90('0x17')],'include':_0x42459f['include']?_[_0xdb90('0x1b')](_0x42459f[_0xdb90('0x19')],function(_0xa99b6){return{'model':db[_0xa99b6[_0xdb90('0x1a')]],'as':_0xa99b6['as'],'attributes':_0xa99b6[_0xdb90('0x17')]};}):[]};}):[]};}):[]:[]})[_0xdb90('0x8')](function(_0x5a9dc5){logger['info'](_0xdb90('0x1c'),_0x3fc383);logger[_0xdb90('0xc')](_0xdb90('0x1c'),_0x3fc383,JSON[_0xdb90('0xe')](_0x5a9dc5));_0x2d2015(_0x5a9dc5);})[_0xdb90('0x12')](function(_0x1d7dc1){logger[_0xdb90('0xf')](_0xdb90('0x1c'),_0x1d7dc1[_0xdb90('0x11')],_0x3fc383);_0x2fa7c9(_0x200954[_0xdb90('0xf')](0x1f4,_0x1d7dc1[_0xdb90('0x11')]));});});};exports[_0xdb90('0x1d')]=function(_0x15b97d){var _0x1383f5=this;return new Promise(function(_0x343053,_0x4e1f7b){return db[_0xdb90('0x13')][_0xdb90('0x1e')]({'raw':_0x15b97d[_0xdb90('0x14')]?_0x15b97d['options'][_0xdb90('0x15')]===undefined?!![]:![]:!![],'where':_0x15b97d[_0xdb90('0x14')]?_0x15b97d[_0xdb90('0x14')][_0xdb90('0x16')]||null:null,'attributes':_0x15b97d['options']?_0x15b97d[_0xdb90('0x14')][_0xdb90('0x17')]||null:null,'include':_0x15b97d[_0xdb90('0x14')]?_0x15b97d[_0xdb90('0x14')][_0xdb90('0x19')]?_[_0xdb90('0x1b')](_0x15b97d[_0xdb90('0x14')]['include'],function(_0x6c5d38){return{'model':db[_0x6c5d38[_0xdb90('0x1a')]],'as':_0x6c5d38['as'],'attributes':_0x6c5d38[_0xdb90('0x17')],'include':_0x6c5d38[_0xdb90('0x19')]?_[_0xdb90('0x1b')](_0x6c5d38['include'],function(_0x40ab26){return{'model':db[_0x40ab26[_0xdb90('0x1a')]],'as':_0x40ab26['as'],'attributes':_0x40ab26['attributes'],'include':_0x40ab26[_0xdb90('0x19')]?_[_0xdb90('0x1b')](_0x40ab26[_0xdb90('0x19')],function(_0x3ba5e1){return{'model':db[_0x3ba5e1[_0xdb90('0x1a')]],'as':_0x3ba5e1['as'],'attributes':_0x3ba5e1[_0xdb90('0x17')]};}):[]};}):[]};}):[]:[]})[_0xdb90('0x8')](function(_0x2563b3){logger[_0xdb90('0x9')](_0xdb90('0x1d'),_0x15b97d);logger[_0xdb90('0xc')](_0xdb90('0x1d'),_0x15b97d,JSON[_0xdb90('0xe')](_0x2563b3));_0x343053(_0x2563b3);})[_0xdb90('0x12')](function(_0x2aefe9){logger['error'](_0xdb90('0x1d'),_0x2aefe9['message'],_0x15b97d);_0x4e1f7b(_0x1383f5[_0xdb90('0xf')](0x1f4,_0x2aefe9[_0xdb90('0x11')]));});});}; \ No newline at end of file +var _0xa85b=['GetTrunk','Trunk','options','raw','where','attributes','include','map','model','ShowTrunk','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','debug','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','info','result','catch'];(function(_0x11b541,_0x3cf0b6){var _0x5e7a62=function(_0x125b29){while(--_0x125b29){_0x11b541['push'](_0x11b541['shift']());}};_0x5e7a62(++_0x3cf0b6);}(_0xa85b,0x68));var _0xba85=function(_0x25b203,_0x416550){_0x25b203=_0x25b203-0x0;var _0x267fde=_0xa85b[_0x25b203];return _0x267fde;};'use strict';var _=require('lodash');var util=require(_0xba85('0x0'));var moment=require(_0xba85('0x1'));var BPromise=require(_0xba85('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba85('0x3'));var db=require(_0xba85('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xba85('0x5'))(_0xba85('0x6'));var config=require(_0xba85('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba85('0x8')][_0xba85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8bc7,_0x261203,_0x4909bd){return new BPromise(function(_0x475d48,_0x4cb050){return client['request'](_0x3d8bc7,_0x4909bd)[_0xba85('0xa')](function(_0x4feddd){logger['info']('Trunk,\x20%s,\x20%s',_0x261203,'request\x20sent');logger[_0xba85('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x261203,_0xba85('0xc'),JSON[_0xba85('0xd')](_0x4feddd));if(_0x4feddd['error']){if(_0x4feddd[_0xba85('0xe')]['code']===0x1f4){logger[_0xba85('0xe')]('Trunk,\x20%s,\x20%s',_0x261203,_0x4feddd['error'][_0xba85('0xf')]);return _0x4cb050(_0x4feddd['error'][_0xba85('0xf')]);}logger['error'](_0xba85('0x10'),_0x261203,_0x4feddd[_0xba85('0xe')][_0xba85('0xf')]);return _0x475d48(_0x4feddd['error']['message']);}else{logger[_0xba85('0x11')](_0xba85('0x10'),_0x261203,_0xba85('0xc'));_0x475d48(_0x4feddd[_0xba85('0x12')][_0xba85('0xf')]);}})[_0xba85('0x13')](function(_0x3282cb){logger[_0xba85('0xe')](_0xba85('0x10'),_0x261203,_0x3282cb);_0x4cb050(_0x3282cb);});});}exports[_0xba85('0x14')]=function(_0x49d24f){var _0x44b7a=this;return new Promise(function(_0x1cc6c0,_0x5f4d34){return db[_0xba85('0x15')]['findAll']({'raw':_0x49d24f['options']?_0x49d24f[_0xba85('0x16')][_0xba85('0x17')]===undefined?!![]:![]:!![],'where':_0x49d24f[_0xba85('0x16')]?_0x49d24f['options'][_0xba85('0x18')]||null:null,'attributes':_0x49d24f['options']?_0x49d24f[_0xba85('0x16')][_0xba85('0x19')]||null:null,'limit':_0x49d24f[_0xba85('0x16')]?_0x49d24f[_0xba85('0x16')]['limit']||null:null,'include':_0x49d24f[_0xba85('0x16')]?_0x49d24f[_0xba85('0x16')][_0xba85('0x1a')]?_[_0xba85('0x1b')](_0x49d24f[_0xba85('0x16')][_0xba85('0x1a')],function(_0x1a3bd5){return{'model':db[_0x1a3bd5[_0xba85('0x1c')]],'as':_0x1a3bd5['as'],'attributes':_0x1a3bd5[_0xba85('0x19')],'include':_0x1a3bd5[_0xba85('0x1a')]?_[_0xba85('0x1b')](_0x1a3bd5[_0xba85('0x1a')],function(_0x1fead6){return{'model':db[_0x1fead6[_0xba85('0x1c')]],'as':_0x1fead6['as'],'attributes':_0x1fead6[_0xba85('0x19')],'include':_0x1fead6[_0xba85('0x1a')]?_[_0xba85('0x1b')](_0x1fead6[_0xba85('0x1a')],function(_0x1cd0d6){return{'model':db[_0x1cd0d6[_0xba85('0x1c')]],'as':_0x1cd0d6['as'],'attributes':_0x1cd0d6[_0xba85('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5721c6){logger[_0xba85('0x11')](_0xba85('0x14'),_0x49d24f);logger[_0xba85('0xb')](_0xba85('0x14'),_0x49d24f,JSON[_0xba85('0xd')](_0x5721c6));_0x1cc6c0(_0x5721c6);})[_0xba85('0x13')](function(_0x4f6e8b){logger[_0xba85('0xe')]('GetTrunk',_0x4f6e8b[_0xba85('0xf')],_0x49d24f);_0x5f4d34(_0x44b7a[_0xba85('0xe')](0x1f4,_0x4f6e8b[_0xba85('0xf')]));});});};exports[_0xba85('0x1d')]=function(_0xae2c3a){var _0x3e70be=this;return new Promise(function(_0x502de4,_0x183f1d){return db[_0xba85('0x15')][_0xba85('0x1e')]({'raw':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a[_0xba85('0x16')][_0xba85('0x17')]===undefined?!![]:![]:!![],'where':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a['options'][_0xba85('0x18')]||null:null,'attributes':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a[_0xba85('0x16')]['attributes']||null:null,'include':_0xae2c3a[_0xba85('0x16')]?_0xae2c3a['options']['include']?_[_0xba85('0x1b')](_0xae2c3a[_0xba85('0x16')][_0xba85('0x1a')],function(_0x459133){return{'model':db[_0x459133['model']],'as':_0x459133['as'],'attributes':_0x459133[_0xba85('0x19')],'include':_0x459133['include']?_[_0xba85('0x1b')](_0x459133[_0xba85('0x1a')],function(_0x1e8cd3){return{'model':db[_0x1e8cd3[_0xba85('0x1c')]],'as':_0x1e8cd3['as'],'attributes':_0x1e8cd3[_0xba85('0x19')],'include':_0x1e8cd3['include']?_[_0xba85('0x1b')](_0x1e8cd3[_0xba85('0x1a')],function(_0x3353c2){return{'model':db[_0x3353c2[_0xba85('0x1c')]],'as':_0x3353c2['as'],'attributes':_0x3353c2[_0xba85('0x19')]};}):[]};}):[]};}):[]:[]})[_0xba85('0xa')](function(_0x4dee32){logger[_0xba85('0x11')](_0xba85('0x1d'),_0xae2c3a);logger[_0xba85('0xb')](_0xba85('0x1d'),_0xae2c3a,JSON[_0xba85('0xd')](_0x4dee32));_0x502de4(_0x4dee32);})[_0xba85('0x13')](function(_0x3ad1ed){logger[_0xba85('0xe')](_0xba85('0x1d'),_0x3ad1ed[_0xba85('0xf')],_0xae2c3a);_0x183f1d(_0x3e70be[_0xba85('0xe')](0x1f4,_0x3ad1ed[_0xba85('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index d239824..7697935 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 _0x1ad5=['isAuthenticated','exports','express','Router','../../components/auth/service','./user-setting.controller','put','/:id'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x1ad5,0x16a));var _0x51ad=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x1ad5[_0x2ff4bd];return _0x28edc6;};'use strict';var express=require(_0x51ad('0x0'));var router=express[_0x51ad('0x1')]();var auth=require(_0x51ad('0x2'));var controller=require(_0x51ad('0x3'));router[_0x51ad('0x4')](_0x51ad('0x5'),auth[_0x51ad('0x6')](),controller['update']);module[_0x51ad('0x7')]=router; \ No newline at end of file +var _0xa500=['../../components/auth/service','put','/:id','isAuthenticated','exports','express'];(function(_0x834ebb,_0x2c0032){var _0x41b166=function(_0x1ae6a5){while(--_0x1ae6a5){_0x834ebb['push'](_0x834ebb['shift']());}};_0x41b166(++_0x2c0032);}(_0xa500,0xcb));var _0x0a50=function(_0x23cda2,_0x2f8889){_0x23cda2=_0x23cda2-0x0;var _0x1cb723=_0xa500[_0x23cda2];return _0x1cb723;};'use strict';var express=require(_0x0a50('0x0'));var router=express['Router']();var auth=require(_0x0a50('0x1'));var controller=require('./user-setting.controller');router[_0x0a50('0x2')](_0x0a50('0x3'),auth[_0x0a50('0x4')](),controller['update']);module[_0x0a50('0x5')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index c0fb07e..a00de69 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 _0x79d7=['info','debug','exports','ENUM','BOOLEAN','TEXT','INTEGER','UserId','error','warning'];(function(_0x26ff2e,_0x8caf9c){var _0x23c0ee=function(_0x2e4a53){while(--_0x2e4a53){_0x26ff2e['push'](_0x26ff2e['shift']());}};_0x23c0ee(++_0x8caf9c);}(_0x79d7,0xbc));var _0x779d=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x79d7[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x779d('0x0'),_0x779d('0x1'),_0x779d('0x2'),_0x779d('0x3')];module[_0x779d('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x779d('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x779d('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x779d('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x779d('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x779d('0x8')],'unique':_0x779d('0x9')}}; \ No newline at end of file +var _0xa5c2=['error','warning','debug','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize'];(function(_0x186d8e,_0x3ad293){var _0x14aa2f=function(_0x2e2a12){while(--_0x2e2a12){_0x186d8e['push'](_0x186d8e['shift']());}};_0x14aa2f(++_0x3ad293);}(_0xa5c2,0x1b8));var _0x2a5c=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xa5c2[_0x1f1511];return _0x1d9ab8;};'use strict';var Sequelize=require(_0x2a5c('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x2a5c('0x1'),_0x2a5c('0x2'),'info',_0x2a5c('0x3')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x2a5c('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x2a5c('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x2a5c('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x2a5c('0x7')],'unique':_0x2a5c('0x8')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index af7cebb..775bd41 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 _0xbf5c=['defaults','redis','localhost','update','sendStatus','error','stack','name','send','user','role','params','UserSetting','then','body','catch','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register'];(function(_0x5305e9,_0x52b7d8){var _0x57bea3=function(_0x3df21b){while(--_0x3df21b){_0x5305e9['push'](_0x5305e9['shift']());}};_0x57bea3(++_0x52b7d8);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x2f6d86,_0x3ccf3e){_0x2f6d86=_0x2f6d86-0x0;var _0x56c24d=_0xbf5c[_0x2f6d86];return _0x56c24d;};'use strict';var _=require(_0xcbf5('0x0'));var Redis=require(_0xcbf5('0x1'));var logger=require(_0xcbf5('0x2'))('api');var config=require(_0xcbf5('0x3'));var db=require(_0xcbf5('0x4'))['db'];var socket=require(_0xcbf5('0x5'))(new Redis(config['redis']));require(_0xcbf5('0x6'))[_0xcbf5('0x7')](socket);config['redis']=_[_0xcbf5('0x8')](config[_0xcbf5('0x9')],{'host':_0xcbf5('0xa'),'port':0x18eb});function respondWithResult(_0x522014,_0x4504dd){_0x4504dd=_0x4504dd||0xc8;return function(_0x31b6d1){if(_0x31b6d1){return _0x522014['status'](_0x4504dd)['json'](_0x31b6d1);}};}function saveUpdates(_0x36c122){return function(_0x2f10f5){if(_0x2f10f5){return _0x2f10f5[_0xcbf5('0xb')](_0x36c122)['then'](function(_0x320554){return _0x320554;});}return null;};}function handleEntityNotFound(_0x752a2a){return function(_0x29b871){if(!_0x29b871){_0x752a2a[_0xcbf5('0xc')](0x194);}return _0x29b871;};}function handleError(_0x4352b4,_0x248575){_0x248575=_0x248575||0x1f4;return function(_0x5db829){logger[_0xcbf5('0xd')](_0x5db829[_0xcbf5('0xe')]);if(_0x5db829[_0xcbf5('0xf')]){delete _0x5db829['name'];}_0x4352b4['status'](_0x248575)[_0xcbf5('0x10')](_0x5db829);};}exports['update']=function(_0x1d4942,_0x422734){if(_0x1d4942[_0xcbf5('0x11')][_0xcbf5('0x12')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x1d4942[_0xcbf5('0x13')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xcbf5('0x14')]['find']({'where':{'id':_0x1d4942['params']['id']}})[_0xcbf5('0x15')](handleEntityNotFound(_0x422734,null))[_0xcbf5('0x15')](saveUpdates(_0x1d4942[_0xcbf5('0x16')],null))[_0xcbf5('0x15')](respondWithResult(_0x422734,null))[_0xcbf5('0x17')](handleError(_0x422734,null));}; \ No newline at end of file +var _0xeea0=['catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults','status','json','update','then','sendStatus','error','name','user','role','Invalid\x20user\x20setting\x20id','UserSetting','find','params'];(function(_0x1d6657,_0x20aec2){var _0x134587=function(_0x3fc079){while(--_0x3fc079){_0x1d6657['push'](_0x1d6657['shift']());}};_0x134587(++_0x20aec2);}(_0xeea0,0x91));var _0x0eea=function(_0xc8bec8,_0x1f1632){_0xc8bec8=_0xc8bec8-0x0;var _0x1657d6=_0xeea0[_0xc8bec8];return _0x1657d6;};'use strict';var _=require(_0x0eea('0x0'));var Redis=require(_0x0eea('0x1'));var logger=require(_0x0eea('0x2'))(_0x0eea('0x3'));var config=require(_0x0eea('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0x0eea('0x5'))(new Redis(config[_0x0eea('0x6')]));require(_0x0eea('0x7'))[_0x0eea('0x8')](socket);config[_0x0eea('0x6')]=_[_0x0eea('0x9')](config[_0x0eea('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x1f8bc9,_0x470ef5){_0x470ef5=_0x470ef5||0xc8;return function(_0x121ab1){if(_0x121ab1){return _0x1f8bc9[_0x0eea('0xa')](_0x470ef5)[_0x0eea('0xb')](_0x121ab1);}};}function saveUpdates(_0x501d00){return function(_0x186884){if(_0x186884){return _0x186884[_0x0eea('0xc')](_0x501d00)[_0x0eea('0xd')](function(_0x14d008){return _0x14d008;});}return null;};}function handleEntityNotFound(_0x550cc0){return function(_0x4fd6b1){if(!_0x4fd6b1){_0x550cc0[_0x0eea('0xe')](0x194);}return _0x4fd6b1;};}function handleError(_0x51bb8c,_0x5ab324){_0x5ab324=_0x5ab324||0x1f4;return function(_0x18e98a){logger[_0x0eea('0xf')](_0x18e98a['stack']);if(_0x18e98a[_0x0eea('0x10')]){delete _0x18e98a['name'];}_0x51bb8c[_0x0eea('0xa')](_0x5ab324)['send'](_0x18e98a);};}exports[_0x0eea('0xc')]=function(_0x56a41d,_0x4cf5a5){if(_0x56a41d[_0x0eea('0x11')][_0x0eea('0x12')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x56a41d['params']['id'])))throw new Error(_0x0eea('0x13'));return db[_0x0eea('0x14')][_0x0eea('0x15')]({'where':{'id':_0x56a41d[_0x0eea('0x16')]['id']}})[_0x0eea('0xd')](handleEntityNotFound(_0x4cf5a5,null))[_0x0eea('0xd')](saveUpdates(_0x56a41d['body'],null))[_0x0eea('0xd')](respondWithResult(_0x4cf5a5,null))[_0x0eea('0x17')](handleError(_0x4cf5a5,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index d2df39d..6a8a4a4 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 _0xfc4a=['setMaxListeners','save','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0xfc4a,0x1e1));var _0xafc4=function(_0x302c9d,_0x50ca92){_0x302c9d=_0x302c9d-0x0;var _0x4b2ee0=_0xfc4a[_0x302c9d];return _0x4b2ee0;};'use strict';var EventEmitter=require(_0xafc4('0x0'));var UserSetting=require(_0xafc4('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xafc4('0x2')](0x0);var events={'afterCreate':_0xafc4('0x3'),'afterUpdate':'update','afterDestroy':_0xafc4('0x4')};function emitEvent(_0x245050){return function(_0x1b7b36,_0x5d87f7,_0x3dfd31){UserSettingEvents[_0xafc4('0x5')](_0x245050+':'+_0x1b7b36['id'],_0x1b7b36);UserSettingEvents[_0xafc4('0x5')](_0x245050,_0x1b7b36);_0x3dfd31(null);};}for(var e in events){if(events[_0xafc4('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xc555=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0xc555,0x143));var _0x5c55=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xc555[_0x36eaaa];return _0x461349;};'use strict';var EventEmitter=require(_0x5c55('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x5c55('0x1')](0x0);var events={'afterCreate':_0x5c55('0x2'),'afterUpdate':_0x5c55('0x3'),'afterDestroy':_0x5c55('0x4')};function emitEvent(_0x3f0336){return function(_0x1d5077,_0x1e348f,_0x1afb26){UserSettingEvents['emit'](_0x3f0336+':'+_0x1d5077['id'],_0x1d5077);UserSettingEvents[_0x5c55('0x5')](_0x3f0336,_0x1d5077);_0x1afb26(null);};}for(var e in events){if(events[_0x5c55('0x6')](e)){var event=events[e];UserSetting[_0x5c55('0x7')](e,emitEvent(event));}}module[_0x5c55('0x8')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 8c32447..1bcf6d6 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 _0x93e6=['clientSideLoggingEnabledSince','./user-setting.attributes','define','user_settings','clientSideLoggingEnabled'];(function(_0x1bd0fb,_0x57320c){var _0x1d6c27=function(_0x43afe9){while(--_0x43afe9){_0x1bd0fb['push'](_0x1bd0fb['shift']());}};_0x1d6c27(++_0x57320c);}(_0x93e6,0x11e));var _0x693e=function(_0x271d2,_0x139546){_0x271d2=_0x271d2-0x0;var _0x44c3e7=_0x93e6[_0x271d2];return _0x44c3e7;};'use strict';var attributes=require(_0x693e('0x0'));module['exports']=function(_0x5f4d40){return _0x5f4d40[_0x693e('0x1')]('UserSetting',attributes,{'tableName':_0x693e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e7e48){if(!_0x4e7e48[_0x693e('0x3')])_0x4e7e48[_0x693e('0x4')]=null;else if(_0x4e7e48[_0x693e('0x4')]===null)_0x4e7e48['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xf53d=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting'];(function(_0x382acd,_0x2d880e){var _0x3c3a76=function(_0x189904){while(--_0x189904){_0x382acd['push'](_0x382acd['shift']());}};_0x3c3a76(++_0x2d880e);}(_0xf53d,0x199));var _0xdf53=function(_0x55648b,_0x3e50e9){_0x55648b=_0x55648b-0x0;var _0x483646=_0xf53d[_0x55648b];return _0x483646;};'use strict';var attributes=require(_0xdf53('0x0'));module[_0xdf53('0x1')]=function(_0x4ee8c2){return _0x4ee8c2[_0xdf53('0x2')](_0xdf53('0x3'),attributes,{'tableName':_0xdf53('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x489d77){if(!_0x489d77[_0xdf53('0x5')])_0x489d77['clientSideLoggingEnabledSince']=null;else if(_0x489d77[_0xdf53('0x6')]===null)_0x489d77['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index fad5bed..d0d45de 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 _0x08b0=['length','user-setting:','update','emit','UserId','register'];(function(_0x32d305,_0x3b7f88){var _0x31715a=function(_0x57702f){while(--_0x57702f){_0x32d305['push'](_0x32d305['shift']());}};_0x31715a(++_0x3b7f88);}(_0x08b0,0xb0));var _0x008b=function(_0x314115,_0x22f606){_0x314115=_0x314115-0x0;var _0x1347df=_0x08b0[_0x314115];return _0x1347df;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save','remove',_0x008b('0x0')];function createListener(_0x3fd4b4,_0x3e93a7){return function(_0x47f044){_0x3e93a7['emit'](_0x3fd4b4,_0x47f044);if(_0x3fd4b4==='user-setting:update'){_0x3e93a7[_0x008b('0x1')]('user-setting:update:user-'+_0x47f044[_0x008b('0x2')],_0x47f044);}};}exports[_0x008b('0x3')]=function(_0x5d1aa2){for(var _0x3ae7b9=0x0,_0xf309fc=events[_0x008b('0x4')];_0x3ae7b9<_0xf309fc;_0x3ae7b9++){var _0x502fb8=events[_0x3ae7b9];var _0x48f152=createListener(_0x008b('0x5')+_0x502fb8,_0x5d1aa2);UserSettingEvents['on'](_0x502fb8,_0x48f152);}}; \ No newline at end of file +var _0xd82e=['user-setting:update:user-','register','length','user-setting:','save','remove','update','emit'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xd82e,0x10c));var _0xed82=function(_0x4abaee,_0x4218e1){_0x4abaee=_0x4abaee-0x0;var _0x251d10=_0xd82e[_0x4abaee];return _0x251d10;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xed82('0x0'),_0xed82('0x1'),_0xed82('0x2')];function createListener(_0x4670cb,_0x3cc2d4){return function(_0x4f9af0){_0x3cc2d4['emit'](_0x4670cb,_0x4f9af0);if(_0x4670cb==='user-setting:update'){_0x3cc2d4[_0xed82('0x3')](_0xed82('0x4')+_0x4f9af0['UserId'],_0x4f9af0);}};}exports[_0xed82('0x5')]=function(_0x8f105){for(var _0x4bbd62=0x0,_0x494aba=events[_0xed82('0x6')];_0x4bbd62<_0x494aba;_0x4bbd62++){var _0x2dd32b=events[_0x4bbd62];var _0x50c68a=createListener(_0xed82('0x7')+_0x2dd32b,_0x8f105);UserSettingEvents['on'](_0x2dd32b,_0x50c68a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index e5c0a90..c49bf1c 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 _0x9341=['addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','put','/:id','update','/:id/password','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','/whoami','whoami','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','bulkCreate','join','root','server/files/images/','format','%s-%s','now','originalname','single','/:id/login','/:id/pause','pause','/:id/unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9341,0xff));var _0x1934=function(_0x49813d,_0x1c8577){_0x49813d=_0x49813d-0x0;var _0x432928=_0x9341[_0x49813d];return _0x432928;};'use strict';var multer=require(_0x1934('0x0'));var util=require(_0x1934('0x1'));var path=require('path');var timeout=require(_0x1934('0x2'));var express=require('express');var router=express[_0x1934('0x3')]();var fs_extra=require(_0x1934('0x4'));var auth=require(_0x1934('0x5'));var interaction=require(_0x1934('0x6'));var config=require(_0x1934('0x7'));var controller=require(_0x1934('0x8'));router[_0x1934('0x9')]('/',auth[_0x1934('0xa')](),controller['index']);router[_0x1934('0x9')](_0x1934('0xb'),auth[_0x1934('0xa')](),controller['describe']);router[_0x1934('0x9')](_0x1934('0xc'),auth['isAuthenticated'](),controller[_0x1934('0xd')]);router['get']('/presence',auth[_0x1934('0xa')](),controller[_0x1934('0xe')]);router[_0x1934('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1934('0xf')]);router['get'](_0x1934('0x10'),controller[_0x1934('0x11')]);router[_0x1934('0x9')](_0x1934('0x12'),auth[_0x1934('0xa')](),controller[_0x1934('0x13')]);router[_0x1934('0x9')]('/:id/contacts',auth[_0x1934('0xa')](),controller[_0x1934('0x14')]);router[_0x1934('0x9')](_0x1934('0x15'),auth[_0x1934('0xa')](),controller[_0x1934('0x16')]);router[_0x1934('0x9')](_0x1934('0x17'),auth[_0x1934('0xa')](),controller[_0x1934('0x18')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router['get'](_0x1934('0x19'),auth['isAuthenticated'](),controller[_0x1934('0x1a')]);router[_0x1934('0x9')](_0x1934('0x1b'),auth[_0x1934('0xa')](),controller[_0x1934('0x1c')]);router['get'](_0x1934('0x1d'),auth[_0x1934('0xa')](),controller[_0x1934('0x1e')]);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x1934('0x1f')]);router[_0x1934('0x9')](_0x1934('0x20'),auth[_0x1934('0xa')](),controller[_0x1934('0x21')]);router['get'](_0x1934('0x22'),auth[_0x1934('0xa')](),controller[_0x1934('0x23')]);router['get']('/:id/fax/interactions',auth[_0x1934('0xa')](),controller['getFaxInteractions']);router['get'](_0x1934('0x24'),auth[_0x1934('0xa')](),controller[_0x1934('0x25')]);router[_0x1934('0x9')](_0x1934('0x26'),auth[_0x1934('0xa')](),controller[_0x1934('0x27')]);router[_0x1934('0x9')](_0x1934('0x28'),auth[_0x1934('0xa')](),controller[_0x1934('0x29')]);router[_0x1934('0x9')](_0x1934('0x2a'),auth[_0x1934('0xa')](),controller[_0x1934('0x2b')]);router[_0x1934('0x9')](_0x1934('0x2c'),auth[_0x1934('0xa')](),controller['getVoicePrefixes']);router['get'](_0x1934('0x2d'),auth[_0x1934('0xa')](),controller['getFaxAccounts']);router['get'](_0x1934('0x2e'),auth['isAuthenticated'](),controller[_0x1934('0x2f')]);router[_0x1934('0x9')](_0x1934('0x30'),auth[_0x1934('0xa')](),controller[_0x1934('0x31')]);router[_0x1934('0x9')](_0x1934('0x32'),auth[_0x1934('0xa')](),controller[_0x1934('0x33')]);router[_0x1934('0x9')](_0x1934('0x34'),auth[_0x1934('0xa')](),controller[_0x1934('0x35')]);router[_0x1934('0x9')](_0x1934('0x36'),auth[_0x1934('0xa')](),controller[_0x1934('0x37')]);router['get'](_0x1934('0x38'),auth[_0x1934('0xa')](),controller[_0x1934('0x39')]);router[_0x1934('0x9')](_0x1934('0x3a'),auth['isAuthenticated'](),controller['getApiKey']);router[_0x1934('0x3b')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x1934('0x3c')]);router[_0x1934('0x3b')]('/',auth[_0x1934('0xa')](),controller[_0x1934('0x3d')]);router[_0x1934('0x3b')](_0x1934('0x3e'),auth[_0x1934('0xa')](),controller[_0x1934('0x3f')]);router[_0x1934('0x3b')]('/:id/queues',auth[_0x1934('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e0389,_0x2ee622,_0x21293b){_0x21293b(null,path[_0x1934('0x40')](config[_0x1934('0x41')],_0x1934('0x42')));},'filename':function(_0x2141cb,_0x5c55b0,_0x2e2a21){_0x2e2a21(null,util[_0x1934('0x43')](_0x1934('0x44'),Date[_0x1934('0x45')](),_0x5c55b0[_0x1934('0x46')]));}})});router['post'](_0x1934('0x10'),upload[_0x1934('0x47')]('file'),controller['addAvatar']);router['post'](_0x1934('0x48'),auth['isAuthenticated'](),controller['login']);router['post']('/:id/logout',auth['isAuthenticated'](),controller['logout']);router[_0x1934('0x3b')](_0x1934('0x49'),auth[_0x1934('0xa')](),controller[_0x1934('0x4a')]);router[_0x1934('0x3b')](_0x1934('0x4b'),auth[_0x1934('0xa')](),controller['unpause']);router[_0x1934('0x3b')]('/:id/teams',auth[_0x1934('0xa')](),controller['addTeams']);router[_0x1934('0x3b')]('/:id/chat_interactions',auth[_0x1934('0xa')](),controller[_0x1934('0x4c')]);router[_0x1934('0x3b')](_0x1934('0x4d'),auth[_0x1934('0xa')](),controller[_0x1934('0x4e')]);router[_0x1934('0x3b')](_0x1934('0x4f'),auth['isAuthenticated'](),controller[_0x1934('0x50')]);router[_0x1934('0x3b')]('/:id/sms_interactions',auth[_0x1934('0xa')](),controller[_0x1934('0x51')]);router['post'](_0x1934('0x52'),auth[_0x1934('0xa')](),controller[_0x1934('0x53')]);router[_0x1934('0x3b')](_0x1934('0x54'),auth['isAuthenticated'](),controller[_0x1934('0x55')]);router['post'](_0x1934('0x2d'),auth[_0x1934('0xa')](),controller[_0x1934('0x56')]);router['post'](_0x1934('0x2e'),auth[_0x1934('0xa')](),controller[_0x1934('0x57')]);router['post'](_0x1934('0x30'),auth[_0x1934('0xa')](),controller[_0x1934('0x58')]);router[_0x1934('0x3b')](_0x1934('0x32'),auth['isAuthenticated'](),controller[_0x1934('0x59')]);router[_0x1934('0x3b')]('/:id/chat_websites',auth[_0x1934('0xa')](),controller[_0x1934('0x5a')]);router['post'](_0x1934('0x36'),auth[_0x1934('0xa')](),controller[_0x1934('0x5b')]);router['post']('/:id/api_key',auth[_0x1934('0xa')](),controller['createApiKey']);router[_0x1934('0x5c')](_0x1934('0x5d'),auth[_0x1934('0xa')](),controller[_0x1934('0x5e')]);router['put'](_0x1934('0x5f'),auth[_0x1934('0xa')](),controller[_0x1934('0x60')]);router[_0x1934('0x61')](_0x1934('0x15'),auth[_0x1934('0xa')](),controller['removeQueues']);router['delete'](_0x1934('0x26'),auth[_0x1934('0xa')](),controller[_0x1934('0x62')]);router[_0x1934('0x61')](_0x1934('0x5d'),auth['isAuthenticated'](),controller[_0x1934('0x63')]);router[_0x1934('0x61')](_0x1934('0x64'),auth[_0x1934('0xa')](),controller[_0x1934('0x65')]);router[_0x1934('0x61')](_0x1934('0x4d'),auth[_0x1934('0xa')](),controller[_0x1934('0x66')]);router[_0x1934('0x61')](_0x1934('0x4f'),auth[_0x1934('0xa')](),controller[_0x1934('0x67')]);router[_0x1934('0x61')](_0x1934('0x68'),auth['isAuthenticated'](),controller[_0x1934('0x69')]);router[_0x1934('0x61')](_0x1934('0x52'),auth[_0x1934('0xa')](),controller[_0x1934('0x6a')]);router[_0x1934('0x61')](_0x1934('0x54'),auth[_0x1934('0xa')](),controller[_0x1934('0x6b')]);router[_0x1934('0x61')](_0x1934('0x2d'),auth[_0x1934('0xa')](),controller[_0x1934('0x6c')]);router[_0x1934('0x61')]('/:id/mail_accounts',auth[_0x1934('0xa')](),controller[_0x1934('0x6d')]);router[_0x1934('0x61')](_0x1934('0x30'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x1934('0x61')](_0x1934('0x32'),auth[_0x1934('0xa')](),controller[_0x1934('0x6e')]);router[_0x1934('0x61')]('/:id/chat_websites',auth[_0x1934('0xa')](),controller['removeChatWebsites']);router[_0x1934('0x61')](_0x1934('0x36'),auth[_0x1934('0xa')](),controller[_0x1934('0x6f')]);router[_0x1934('0x61')](_0x1934('0x3a'),auth[_0x1934('0xa')](),controller[_0x1934('0x70')]);router[_0x1934('0x3b')](_0x1934('0x71'),auth[_0x1934('0xa')](),controller['messengerSoundNotification']);module['exports']=router; \ No newline at end of file +var _0xd827=['logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','put','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout'];(function(_0x510866,_0x3d7247){var _0x2a494a=function(_0x133231){while(--_0x133231){_0x510866['push'](_0x510866['shift']());}};_0x2a494a(++_0x3d7247);}(_0xd827,0x1d6));var _0x7d82=function(_0x354e9d,_0x297682){_0x354e9d=_0x354e9d-0x0;var _0x56711d=_0xd827[_0x354e9d];return _0x56711d;};'use strict';var multer=require(_0x7d82('0x0'));var util=require('util');var path=require(_0x7d82('0x1'));var timeout=require(_0x7d82('0x2'));var express=require('express');var router=express[_0x7d82('0x3')]();var fs_extra=require(_0x7d82('0x4'));var auth=require(_0x7d82('0x5'));var interaction=require(_0x7d82('0x6'));var config=require(_0x7d82('0x7'));var controller=require(_0x7d82('0x8'));router[_0x7d82('0x9')]('/',auth[_0x7d82('0xa')](),controller[_0x7d82('0xb')]);router[_0x7d82('0x9')](_0x7d82('0xc'),auth[_0x7d82('0xa')](),controller[_0x7d82('0xd')]);router['get'](_0x7d82('0xe'),auth[_0x7d82('0xa')](),controller['whoami']);router[_0x7d82('0x9')](_0x7d82('0xf'),auth[_0x7d82('0xa')](),controller['getPresence']);router[_0x7d82('0x9')](_0x7d82('0x10'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x11')]);router['get'](_0x7d82('0x12'),controller[_0x7d82('0x13')]);router[_0x7d82('0x9')](_0x7d82('0x14'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x15')]);router['get'](_0x7d82('0x16'),auth[_0x7d82('0xa')](),controller['getContacts']);router['get'](_0x7d82('0x17'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x18')]);router[_0x7d82('0x9')]('/:id/queues_rt',auth[_0x7d82('0xa')](),controller[_0x7d82('0x19')]);router[_0x7d82('0x9')](_0x7d82('0x1a'),auth[_0x7d82('0xa')](),controller['getGroups']);router['get'](_0x7d82('0x1b'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x7d82('0x9')]('/:id/screen_recordings',auth[_0x7d82('0xa')](),controller[_0x7d82('0x1c')]);router['get'](_0x7d82('0x1d'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get'](_0x7d82('0x1e'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x1f')]);router['get'](_0x7d82('0x20'),auth['isAuthenticated'](),controller[_0x7d82('0x21')]);router[_0x7d82('0x9')](_0x7d82('0x22'),auth['isAuthenticated'](),controller[_0x7d82('0x23')]);router['get'](_0x7d82('0x24'),auth[_0x7d82('0xa')](),controller['getFaxInteractions']);router['get'](_0x7d82('0x25'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x26')]);router[_0x7d82('0x9')](_0x7d82('0x27'),auth[_0x7d82('0xa')](),controller['getTeams']);router[_0x7d82('0x9')](_0x7d82('0x28'),auth[_0x7d82('0xa')](),controller['getLists']);router[_0x7d82('0x9')]('/:id/agents',auth[_0x7d82('0xa')](),controller['getAgents']);router['get'](_0x7d82('0x29'),auth['isAuthenticated'](),controller[_0x7d82('0x2a')]);router[_0x7d82('0x9')](_0x7d82('0x2b'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x2c')]);router['get'](_0x7d82('0x2d'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x2e')]);router[_0x7d82('0x9')](_0x7d82('0x2f'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x30')]);router[_0x7d82('0x9')](_0x7d82('0x31'),auth[_0x7d82('0xa')](),controller['getSmsAccounts']);router[_0x7d82('0x9')](_0x7d82('0x32'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x33')]);router['get'](_0x7d82('0x34'),auth['isAuthenticated'](),controller['getWhatsappAccounts']);router['get'](_0x7d82('0x35'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x36')]);router[_0x7d82('0x9')](_0x7d82('0x37'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x38')]);router[_0x7d82('0x39')](_0x7d82('0x16'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x3a')]);router[_0x7d82('0x39')]('/',auth[_0x7d82('0xa')](),controller[_0x7d82('0x3b')]);router['post'](_0x7d82('0x3c'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x3d')]);router['post'](_0x7d82('0x17'),auth[_0x7d82('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x7d82('0x3e')]({'destination':function(_0x2605ff,_0x49673e,_0x112a96){_0x112a96(null,path[_0x7d82('0x3f')](config[_0x7d82('0x40')],_0x7d82('0x41')));},'filename':function(_0x3e4cf0,_0x38af31,_0x29f670){_0x29f670(null,util[_0x7d82('0x42')](_0x7d82('0x43'),Date[_0x7d82('0x44')](),_0x38af31[_0x7d82('0x45')]));}})});router[_0x7d82('0x39')](_0x7d82('0x12'),upload[_0x7d82('0x46')](_0x7d82('0x47')),controller[_0x7d82('0x48')]);router['post'](_0x7d82('0x49'),auth['isAuthenticated'](),controller['login']);router[_0x7d82('0x39')](_0x7d82('0x4a'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x4b')]);router[_0x7d82('0x39')]('/:id/pause',auth[_0x7d82('0xa')](),controller[_0x7d82('0x4c')]);router['post'](_0x7d82('0x4d'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x4e')]);router[_0x7d82('0x39')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7d82('0x4f')]);router['post'](_0x7d82('0x50'),auth['isAuthenticated'](),controller['addChatInteractions']);router['post'](_0x7d82('0x51'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x52')]);router[_0x7d82('0x39')](_0x7d82('0x53'),auth[_0x7d82('0xa')](),controller['addFaxInteractions']);router[_0x7d82('0x39')]('/:id/sms_interactions',auth[_0x7d82('0xa')](),controller['addSmsInteractions']);router[_0x7d82('0x39')](_0x7d82('0x54'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x55')]);router[_0x7d82('0x39')](_0x7d82('0x56'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x57')]);router[_0x7d82('0x39')](_0x7d82('0x2b'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x58')]);router[_0x7d82('0x39')](_0x7d82('0x2d'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x59')]);router['post'](_0x7d82('0x2f'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x5a')]);router[_0x7d82('0x39')](_0x7d82('0x31'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x5b')]);router[_0x7d82('0x39')](_0x7d82('0x32'),auth['isAuthenticated'](),controller[_0x7d82('0x5c')]);router[_0x7d82('0x39')](_0x7d82('0x34'),auth[_0x7d82('0xa')](),controller['addWhatsappAccounts']);router[_0x7d82('0x39')](_0x7d82('0x37'),auth[_0x7d82('0xa')](),controller['createApiKey']);router[_0x7d82('0x5d')]('/:id',auth[_0x7d82('0xa')](),controller['update']);router[_0x7d82('0x5d')]('/:id/password',auth['isAuthenticated'](),controller[_0x7d82('0x5e')]);router[_0x7d82('0x5f')]('/:id/queues',auth[_0x7d82('0xa')](),controller[_0x7d82('0x60')]);router[_0x7d82('0x5f')](_0x7d82('0x27'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x61')]);router[_0x7d82('0x5f')](_0x7d82('0x10'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x62')]);router[_0x7d82('0x5f')]('/:id/chat_interactions',auth[_0x7d82('0xa')](),controller[_0x7d82('0x63')]);router[_0x7d82('0x5f')](_0x7d82('0x51'),auth[_0x7d82('0xa')](),controller['removeMailInteractions']);router[_0x7d82('0x5f')](_0x7d82('0x53'),auth[_0x7d82('0xa')](),controller['removeFaxInteractions']);router[_0x7d82('0x5f')](_0x7d82('0x64'),auth['isAuthenticated'](),controller[_0x7d82('0x65')]);router[_0x7d82('0x5f')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x7d82('0x5f')](_0x7d82('0x56'),auth['isAuthenticated'](),controller[_0x7d82('0x66')]);router['delete'](_0x7d82('0x2b'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x67')]);router[_0x7d82('0x5f')]('/:id/mail_accounts',auth[_0x7d82('0xa')](),controller['removeMailAccounts']);router[_0x7d82('0x5f')](_0x7d82('0x2f'),auth[_0x7d82('0xa')](),controller[_0x7d82('0x68')]);router[_0x7d82('0x5f')](_0x7d82('0x31'),auth['isAuthenticated'](),controller[_0x7d82('0x69')]);router[_0x7d82('0x5f')](_0x7d82('0x32'),auth['isAuthenticated'](),controller[_0x7d82('0x6a')]);router[_0x7d82('0x5f')](_0x7d82('0x34'),auth[_0x7d82('0xa')](),controller['removeWhatsappAccounts']);router[_0x7d82('0x5f')]('/:id/api_key',auth[_0x7d82('0xa')](),controller[_0x7d82('0x6b')]);router[_0x7d82('0x39')]('/:id/messengerSoundNotification',auth[_0x7d82('0xa')](),controller['messengerSoundNotification']);module[_0x7d82('0x6c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 4229b7c..c35f08e 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 _0xffb4=['dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','telephone','STRING','local','INTEGER','format','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','accept','refuse','originate','uac','fingerprint','certificate','active','passive','update,nonat','TEXT','showWebBar','isArray','wss','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption'];(function(_0x2833db,_0x443abf){var _0x4190c0=function(_0x5d7930){while(--_0x5d7930){_0x2833db['push'](_0x2833db['shift']());}};_0x4190c0(++_0x443abf);}(_0xffb4,0x11e));var _0x4ffb=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xffb4[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0x4ffb('0x0'));var moment=require('moment');var util=require(_0x4ffb('0x1'));var _=require(_0x4ffb('0x2'));module[_0x4ffb('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4ffb('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5a62f9){this[_0x4ffb('0x5')](_0x4ffb('0x4'),_0x5a62f9);this[_0x4ffb('0x5')](_0x4ffb('0x6'),_0x5a62f9);},'comment':_0x4ffb('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5a98e1){this['setDataValue'](_0x4ffb('0x8'),_0x5a98e1);this[_0x4ffb('0x5')](_0x4ffb('0x9'),util['format'](_0x4ffb('0xa'),_0x5a98e1,this[_0x4ffb('0xb')](_0x4ffb('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4ffb('0xd'),'validate':{'isEmail':!![]},'set':function(_0x4049b5){if(_0x4049b5){this['setDataValue'](_0x4ffb('0xd'),_0x4049b5[_0x4ffb('0xe')]());}}},'role':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x10'),_0x4ffb('0x11'),'agent',_0x4ffb('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x4ffb('0x13')],'defaultValue':_0x4ffb('0x14')},'internal':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':![],'unique':'internal','set':function(_0x567978){this['setDataValue'](_0x4ffb('0xc'),_0x567978);this['setDataValue']('accountcode',_0x567978);this['setDataValue'](_0x4ffb('0x9'),util[_0x4ffb('0x16')]('\x22%s\x22\x20<%s>',this[_0x4ffb('0xb')]('fullname'),_0x567978));}},'salt':{'type':Sequelize[_0x4ffb('0x13')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x4ffb('0x13')]},'zipcode':{'type':Sequelize[_0x4ffb('0x13')]},'userpic':{'type':Sequelize[_0x4ffb('0x13')]},'city':{'type':Sequelize[_0x4ffb('0x13')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x4ffb('0x17')]},'voicePause':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4ffb('0x13')],'defaultValue':_0x4ffb('0x19')},'lastPauseAt':{'type':Sequelize[_0x4ffb('0x17')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x4ffb('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x4ffb('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'host':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![],'defaultValue':_0x4ffb('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x4ffb('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x4ffb('0x1b'),_0x4ffb('0x11'),_0x4ffb('0x1c')),'allowNull':!![],'defaultValue':_0x4ffb('0x1b')},'context':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![],'defaultValue':_0x4ffb('0x1d')},'callingpres':{'type':Sequelize['ENUM'](_0x4ffb('0x1e'),_0x4ffb('0x1f'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0x4ffb('0x20'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'permit':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'secret':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'transport':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![],'defaultValue':_0x4ffb('0x21'),'set':function(_0x5614db){this[_0x4ffb('0x5')](_0x4ffb('0x22'),_0x5614db?_0x5614db[_0x4ffb('0x23')](','):null);},'get':function(){return this[_0x4ffb('0xb')](_0x4ffb('0x22'))?this[_0x4ffb('0xb')](_0x4ffb('0x22'))[_0x4ffb('0x24')](','):null;},'comment':_0x4ffb('0x25')},'dtmfmode':{'type':Sequelize['ENUM'](_0x4ffb('0x26'),_0x4ffb('0x27'),_0x4ffb('0x28'),_0x4ffb('0x29'),_0x4ffb('0x2a')),'allowNull':!![],'defaultValue':_0x4ffb('0x26')},'directmedia':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no',_0x4ffb('0x2c'),_0x4ffb('0x2d'),_0x4ffb('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'nat':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![],'defaultValue':_0x4ffb('0x2f'),'set':function(_0x1e5c1a){this['setDataValue']('nat',_0x1e5c1a?_0x1e5c1a['join'](','):null);},'get':function(){return this['getDataValue'](_0x4ffb('0x30'))?this[_0x4ffb('0xb')]('nat')[_0x4ffb('0x24')](','):null;},'comment':_0x4ffb('0x31')},'callgroup':{'type':Sequelize[_0x4ffb('0x13')]},'namedcallgroup':{'type':Sequelize[_0x4ffb('0x13')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x4ffb('0x13')]},'language':{'type':Sequelize[_0x4ffb('0x13')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4ffb('0x13')]},'disallow':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':![],'defaultValue':_0x4ffb('0x32')},'allow':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':![],'defaultValue':_0x4ffb('0x33'),'set':function(_0x32a09b){this[_0x4ffb('0x5')]('allow',_0x32a09b?_0x32a09b[_0x4ffb('0x23')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x4ffb('0xb')]('allow')?this[_0x4ffb('0xb')]('allow')[_0x4ffb('0x24')](';'):null;},'comment':_0x4ffb('0x34')},'autoframing':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x370d70){this['setDataValue'](_0x4ffb('0x35'),_0x370d70?_0x370d70[_0x4ffb('0x23')](','):null);},'get':function(){return this[_0x4ffb('0xb')](_0x4ffb('0x35'))?this[_0x4ffb('0xb')](_0x4ffb('0x35'))[_0x4ffb('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x4ffb('0x2b'),'no',_0x4ffb('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![],'defaultValue':_0x4ffb('0x37')},'amaflags':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x4ffb('0x2b')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'template':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x38'),_0x4ffb('0x39'),_0x4ffb('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x3b'),'uas'),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x4ffb('0x2b')},'keepalive':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no',_0x4ffb('0x3c'),_0x4ffb('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x3e'),_0x4ffb('0x3f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x4ffb('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4ffb('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no',_0x4ffb('0x2c'),_0x4ffb('0x2d'),_0x4ffb('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x4ffb('0x13')]},'resetPasswordExpires':{'type':Sequelize[_0x4ffb('0x17')]},'passwordResetAt':{'type':Sequelize[_0x4ffb('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x4ffb('0x41')]},'showWebBar':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0,'set':function(_0x338479){this[_0x4ffb('0x5')](_0x4ffb('0x42'),_0x338479);var _0x184166=this['get']({'plain':!![]});switch(_0x338479){case 0x0:case 0x1:var _0x44c859=_0x184166[_0x4ffb('0x22')]?_[_0x4ffb('0x43')](_0x184166[_0x4ffb('0x22')])?_0x184166['transport'][_0x4ffb('0x23')]():_0x184166[_0x4ffb('0x22')]:_0x4ffb('0x21');if(_0x44c859===_0x4ffb('0x44')){_0x44c859=_0x4ffb('0x21');}this[_0x4ffb('0x5')](_0x4ffb('0x22'),_0x44c859);this[_0x4ffb('0x5')]('encryption','no');this[_0x4ffb('0x5')](_0x4ffb('0x45'),null);this['setDataValue'](_0x4ffb('0x46'),null);this['setDataValue'](_0x4ffb('0x47'),null);this[_0x4ffb('0x5')]('dtlsenable',null);this[_0x4ffb('0x5')](_0x4ffb('0x48'),null);this['setDataValue'](_0x4ffb('0x49'),null);this[_0x4ffb('0x5')](_0x4ffb('0x4a'),null);this[_0x4ffb('0x5')](_0x4ffb('0x4b'),null);this[_0x4ffb('0x5')](_0x4ffb('0x4c'),'no');break;case 0x2:this['setDataValue'](_0x4ffb('0x22'),'wss');this[_0x4ffb('0x5')](_0x4ffb('0x4d'),_0x4ffb('0x2b'));this[_0x4ffb('0x5')](_0x4ffb('0x45'),_0x4ffb('0x2b'));this['setDataValue'](_0x4ffb('0x46'),'yes');this[_0x4ffb('0x5')](_0x4ffb('0x47'),_0x4ffb('0x2b'));this[_0x4ffb('0x5')](_0x4ffb('0x4e'),_0x4ffb('0x2b'));this[_0x4ffb('0x5')](_0x4ffb('0x48'),'no');this['setDataValue']('dtlssetup',_0x4ffb('0x4f'));this[_0x4ffb('0x5')](_0x4ffb('0x4a'),_0x184166['dtlscertfile']||_0x4ffb('0x50'));this[_0x4ffb('0x5')]('dtlsprivatekey',_0x184166['dtlsprivatekey']||_0x4ffb('0x51'));this[_0x4ffb('0x5')](_0x4ffb('0x4c'),_0x4ffb('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0x4ffb('0x41')],'set':function(_0x329da7){this[_0x4ffb('0x5')]('permissions',_0x329da7?_0x329da7[_0x4ffb('0x23')](','):[]);},'get':function(){return this[_0x4ffb('0xb')]('permissions')?_[_0x4ffb('0x52')](this['getDataValue']('permissions')[_0x4ffb('0x24')](','),function(_0x3250b1){return parseInt(_0x3250b1,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x4ffb('0x13')]},'phoneBarBusyNumber':{'type':Sequelize[_0x4ffb('0x13')]},'phoneBarUnconditional':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x4ffb('0x13')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4ffb('0xf')](_0x4ffb('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x4ffb('0x53')],'get':function(){return this[_0x4ffb('0xb')](_0x4ffb('0x54'))?this[_0x4ffb('0xb')](_0x4ffb('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0x4ffb('0x13')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x4ffb('0x13')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![],'set':function(_0x48de56){if(typeof _0x48de56===_0x4ffb('0x55')){var _0x49d887=_0x48de56==='1'?!![]:_0x48de56==='0'?![]:_0x48de56==='true'?!![]:_0x48de56===_0x4ffb('0x56')?![]:![];this[_0x4ffb('0x5')](_0x4ffb('0x57'),_0x49d887);}else{this[_0x4ffb('0x5')](_0x4ffb('0x57'),_0x48de56);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x256e6d){this[_0x4ffb('0x5')](_0x4ffb('0x58'),_0x256e6d);if(_0x256e6d===!![]){this[_0x4ffb('0x5')](_0x4ffb('0x59'),moment());this[_0x4ffb('0x5')](_0x4ffb('0x5a'),0x0);}else{this[_0x4ffb('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x4ffb('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x4ffb('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x4ffb('0x18')],'defaultValue':![]}}; \ No newline at end of file +var _0x18da=['uas','fingerprint','active','actpass','nonat','update','TEXT','showWebBar','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlssetup','dtlsprivatekey','icesupport','dtlsverify','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','true','false','screenrecording','blockedAt','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','getDataValue','email','toLowerCase','admin','telephone','local','INTEGER','internal','accountcode','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','rfc2833','info','shortinfo','inband','auto','yes','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','uac'];(function(_0x545842,_0x511093){var _0x5a5410=function(_0xee4e34){while(--_0xee4e34){_0x545842['push'](_0x545842['shift']());}};_0x5a5410(++_0x511093);}(_0x18da,0x128));var _0xa18d=function(_0x4064e6,_0x595ecd){_0x4064e6=_0x4064e6-0x0;var _0x179152=_0x18da[_0x4064e6];return _0x179152;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa18d('0x0'));var util=require(_0xa18d('0x1'));var _=require(_0xa18d('0x2'));module[_0xa18d('0x3')]={'name':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'unique':_0xa18d('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x426895){this[_0xa18d('0x6')](_0xa18d('0x5'),_0x426895);this['setDataValue'](_0xa18d('0x7'),_0x426895);},'comment':_0xa18d('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x45a4b8){this['setDataValue']('fullname',_0x45a4b8);this[_0xa18d('0x6')](_0xa18d('0x9'),util[_0xa18d('0xa')]('\x22%s\x22\x20<%s>',_0x45a4b8,this[_0xa18d('0xb')]('internal')));}},'alias':{'type':Sequelize[_0xa18d('0x4')]},'email':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'unique':_0xa18d('0xc'),'validate':{'isEmail':!![]},'set':function(_0x223327){if(_0x223327){this[_0xa18d('0x6')](_0xa18d('0xc'),_0x223327[_0xa18d('0xd')]());}}},'role':{'type':Sequelize['ENUM'](_0xa18d('0xe'),'user','agent',_0xa18d('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':_0xa18d('0x10')},'internal':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':![],'unique':_0xa18d('0x12'),'set':function(_0x4fd417){this[_0xa18d('0x6')](_0xa18d('0x12'),_0x4fd417);this[_0xa18d('0x6')](_0xa18d('0x13'),_0x4fd417);this['setDataValue'](_0xa18d('0x9'),util[_0xa18d('0xa')](_0xa18d('0x14'),this[_0xa18d('0xb')](_0xa18d('0x15')),_0x4fd417));}},'salt':{'type':Sequelize[_0xa18d('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa18d('0x4')]},'address':{'type':Sequelize[_0xa18d('0x4')]},'zipcode':{'type':Sequelize[_0xa18d('0x4')]},'userpic':{'type':Sequelize[_0xa18d('0x4')]},'city':{'type':Sequelize[_0xa18d('0x4')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':_0xa18d('0x17')},'lastPauseAt':{'type':Sequelize[_0xa18d('0x18')]},'chatCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xa18d('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'defaultValue':_0xa18d('0x19')},'ipaddr':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x1b'),_0xa18d('0x1c'),_0xa18d('0x1d')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x1e'),_0xa18d('0x1f'),_0xa18d('0x20'),_0xa18d('0x21'),'PROHIB_NOT_SCREENED',_0xa18d('0x22'),_0xa18d('0x23'),_0xa18d('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'defaultValue':_0xa18d('0x25'),'set':function(_0x29b6a8){this[_0xa18d('0x6')](_0xa18d('0x26'),_0x29b6a8?_0x29b6a8[_0xa18d('0x27')](','):null);},'get':function(){return this[_0xa18d('0xb')](_0xa18d('0x26'))?this[_0xa18d('0xb')](_0xa18d('0x26'))[_0xa18d('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x29'),_0xa18d('0x2a'),_0xa18d('0x2b'),_0xa18d('0x2c'),_0xa18d('0x2d')),'allowNull':!![],'defaultValue':_0xa18d('0x29')},'directmedia':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no','nonat','update',_0xa18d('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa18d('0x30'),'set':function(_0x1185df){this[_0xa18d('0x6')](_0xa18d('0x31'),_0x1185df?_0x1185df['join'](','):null);},'get':function(){return this['getDataValue'](_0xa18d('0x31'))?this[_0xa18d('0xb')](_0xa18d('0x31'))[_0xa18d('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa18d('0x4')]},'namedcallgroup':{'type':Sequelize[_0xa18d('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'defaultValue':_0xa18d('0x32')},'allow':{'type':Sequelize[_0xa18d('0x4')],'allowNull':![],'defaultValue':_0xa18d('0x33'),'set':function(_0xd81729){this['setDataValue'](_0xa18d('0x34'),_0xd81729?_0xd81729[_0xa18d('0x27')](';'):_0xa18d('0x33'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue']('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![],'set':function(_0x45f046){this[_0xa18d('0x6')](_0xa18d('0x35'),_0x45f046?_0x45f046['join'](','):null);},'get':function(){return this[_0xa18d('0xb')](_0xa18d('0x35'))?this[_0xa18d('0xb')]('insecure')['split'](','):null;},'comment':_0xa18d('0x36')},'trustrpid':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xa18d('0x2e'),'no',_0xa18d('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xa18d('0x38')},'amaflags':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':_0xa18d('0x2e')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x39'),_0xa18d('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x3b'),_0xa18d('0x3c')),'allowNull':!![],'defaultValue':_0xa18d('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xa18d('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no',_0xa18d('0x3d'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0xa18d('0x3e'),'passive',_0xa18d('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa18d('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa18d('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xa18d('0x2e'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no',_0xa18d('0x40'),_0xa18d('0x41'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa18d('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xa18d('0x18')]},'passwordResetAt':{'type':Sequelize[_0xa18d('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xa18d('0x42')]},'showWebBar':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0,'set':function(_0x1a44e0){this[_0xa18d('0x6')](_0xa18d('0x43'),_0x1a44e0);var _0xf57689=this['get']({'plain':!![]});switch(_0x1a44e0){case 0x0:case 0x1:var _0x2e824b=_0xf57689[_0xa18d('0x26')]?_[_0xa18d('0x44')](_0xf57689[_0xa18d('0x26')])?_0xf57689[_0xa18d('0x26')][_0xa18d('0x27')]():_0xf57689['transport']:_0xa18d('0x25');if(_0x2e824b===_0xa18d('0x45')){_0x2e824b=_0xa18d('0x25');}this[_0xa18d('0x6')](_0xa18d('0x26'),_0x2e824b);this[_0xa18d('0x6')](_0xa18d('0x46'),'no');this[_0xa18d('0x6')](_0xa18d('0x47'),null);this['setDataValue'](_0xa18d('0x48'),null);this[_0xa18d('0x6')]('icesupport',null);this[_0xa18d('0x6')](_0xa18d('0x49'),null);this[_0xa18d('0x6')]('dtlsverify',null);this[_0xa18d('0x6')](_0xa18d('0x4a'),null);this['setDataValue']('dtlscertfile',null);this[_0xa18d('0x6')](_0xa18d('0x4b'),null);this[_0xa18d('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xa18d('0x6')](_0xa18d('0x26'),_0xa18d('0x45'));this[_0xa18d('0x6')](_0xa18d('0x46'),_0xa18d('0x2e'));this[_0xa18d('0x6')](_0xa18d('0x47'),_0xa18d('0x2e'));this[_0xa18d('0x6')](_0xa18d('0x48'),_0xa18d('0x2e'));this['setDataValue'](_0xa18d('0x4c'),_0xa18d('0x2e'));this['setDataValue'](_0xa18d('0x49'),_0xa18d('0x2e'));this[_0xa18d('0x6')](_0xa18d('0x4d'),'no');this['setDataValue'](_0xa18d('0x4a'),_0xa18d('0x3f'));this['setDataValue'](_0xa18d('0x4e'),_0xf57689[_0xa18d('0x4e')]||_0xa18d('0x4f'));this['setDataValue'](_0xa18d('0x4b'),_0xf57689[_0xa18d('0x4b')]||_0xa18d('0x50'));this[_0xa18d('0x6')](_0xa18d('0x51'),_0xa18d('0x2e'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x45aed1){this['setDataValue'](_0xa18d('0x52'),_0x45aed1?_0x45aed1[_0xa18d('0x27')](','):[]);},'get':function(){return this[_0xa18d('0xb')]('permissions')?_[_0xa18d('0x53')](this[_0xa18d('0xb')](_0xa18d('0x52'))[_0xa18d('0x28')](','),function(_0x1ed6dd){return parseInt(_0x1ed6dd,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa18d('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xa18d('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xa18d('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa18d('0x1a')](_0xa18d('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa18d('0x54')],'get':function(){return this[_0xa18d('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xa18d('0xb')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa18d('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa18d('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![],'set':function(_0x377e57){if(typeof _0x377e57==='string'){var _0x4ea515=_0x377e57==='1'?!![]:_0x377e57==='0'?![]:_0x377e57===_0xa18d('0x55')?!![]:_0x377e57===_0xa18d('0x56')?![]:![];this[_0xa18d('0x6')](_0xa18d('0x57'),_0x4ea515);}else{this[_0xa18d('0x6')](_0xa18d('0x57'),_0x377e57);}}},'blocked':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![],'set':function(_0x3a332c){this[_0xa18d('0x6')]('blocked',_0x3a332c);if(_0x3a332c===!![]){this['setDataValue'](_0xa18d('0x58'),moment());this[_0xa18d('0x6')]('loginAttempts',0x0);}else{this['setDataValue'](_0xa18d('0x58'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xa18d('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xa18d('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 53168a3..623cc22 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 _0x3759=['$like','$iLike','$contains','$contained','firstName','lastName','CmContact','Contact','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','inbound','flatten','lower','col','desc','asc','substring','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','ui.UserId\x20=\x20?','toString','OpenTabs','messengerSoundNotification','enabled','moment','util','path','lodash','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','api','../../config/utils','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','./user.socket','defaults','localhost','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','update','then','role','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','agent','Telephones','map','value','includes','find','UserProfileResource','error','stack','name','status','send','User','rawAttributes','fieldName','key','filter','password','salt','previousPasswords','resetPasswordToken','md5secret','index','where','query','includeAll','include','userSetting','true','UserSetting','attributes','findAll','rows','openTabs','chat','dataValues','push','fax','openchannel','whatsapp','catch','params','getOptions','merge','options','sms','mail','all','body','describe','addContacts','ids','internal','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','length','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','113','110','105','106','107','108','109','100','111','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','some','checkUserLimits','telephone','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','Queue:save','voice','VoiceQueue','format','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','QueueId','Queue:remove','addAvatar','file','getAvatar','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','join','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','SmsOpenTabs','SMS','getContacts','hasOwnProperty','List','Tag','Tags','color','tag','getQueues','model','keys','filters','intersection','fields','order','sort','pick','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:forcelogout','headers','connection','remoteAddress','socket','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','concat','LOGININPAUSE','isMiddleware','resolve','forEach','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','getTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','Team','CmList','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','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','omit','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','CmHopper','$and','$gt','$gte','$lte','$eq','$not','$between','$notBetween','$notIn'];(function(_0x364b32,_0x4dec35){var _0x3f3ea0=function(_0x1911a8){while(--_0x1911a8){_0x364b32['push'](_0x364b32['shift']());}};_0x3f3ea0(++_0x4dec35);}(_0x3759,0x1b7));var _0x9375=function(_0x36eef2,_0x4fb9d3){_0x36eef2=_0x36eef2-0x0;var _0x2ae992=_0x3759[_0x36eef2];return _0x2ae992;};'use strict';var moment=require(_0x9375('0x0'));var util=require(_0x9375('0x1'));var path=require(_0x9375('0x2'));var fs=require('fs');var _=require(_0x9375('0x3'));var squel=require('squel');var Redis=require(_0x9375('0x4'));var authService=require(_0x9375('0x5'));var contacts=require(_0x9375('0x6'));var qs=require(_0x9375('0x7'));var rta=require('../../components/realtime/agents');var logger=require('../../config/logger')(_0x9375('0x8'));var utils=require(_0x9375('0x9'));var config=require('../../config/environment');var licenseUtil=require(_0x9375('0xa'));var APIBadRequestError=require('../../errors/api')[_0x9375('0xb')];var APINotFoundError=require(_0x9375('0xc'))[_0x9375('0xd')];var APIHandleError=require(_0x9375('0xc'))[_0x9375('0xe')];var db=require(_0x9375('0xf'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x9375('0x10')]));require(_0x9375('0x11'))['register'](socket);config[_0x9375('0x10')]=_[_0x9375('0x12')](config['redis'],{'host':_0x9375('0x13'),'port':0x18eb});var values;function respondWithStatusCode(_0x5785a1,_0xcde13c){_0xcde13c=_0xcde13c||0xcc;return function(_0x5ad128){if(_0x5ad128){return _0x5785a1[_0x9375('0x14')](_0xcde13c);}return _0x5785a1['status'](_0xcde13c)[_0x9375('0x15')]();};}function respondWithResult(_0x52c9a3,_0x30a7b9){_0x30a7b9=_0x30a7b9||0xc8;return function(_0x4a0eb0){if(_0x4a0eb0){return _0x52c9a3['status'](_0x30a7b9)[_0x9375('0x16')](_0x4a0eb0);}};}function respondWithFilteredResult(_0x43c3d1,_0x65fd66){return function(_0x78259a){if(_0x78259a){var _0xf77b49=typeof _0x65fd66[_0x9375('0x17')]===_0x9375('0x18')&&typeof _0x65fd66[_0x9375('0x19')]===_0x9375('0x18');var _0x3727c6=_0x78259a[_0x9375('0x1a')];var _0x4025a9=_0xf77b49?0x0:_0x65fd66['offset'];var _0x2f5486=_0xf77b49?_0x78259a[_0x9375('0x1a')]:_0x65fd66[_0x9375('0x17')]+_0x65fd66['limit'];var _0x524005;if(_0x2f5486>=_0x3727c6){_0x2f5486=_0x3727c6;_0x524005=0xc8;}else{_0x524005=0xce;}_0x43c3d1['status'](_0x524005);return _0x43c3d1[_0x9375('0x1b')](_0x9375('0x1c'),_0x4025a9+'-'+_0x2f5486+'/'+_0x3727c6)[_0x9375('0x16')](_0x78259a);}return null;};}function saveUpdates(_0x3f24b3){return function(_0x588172){if(_0x588172){return _0x588172[_0x9375('0x1d')](_0x3f24b3)[_0x9375('0x1e')](function(_0x388b00){if(_0x388b00[_0x9375('0x1f')]==='agent'){socket[_0x9375('0x20')](_0x9375('0x21')+_0x388b00['id'],_0x388b00);}return _0x388b00;});}return null;};}function removeEntity(_0x416f09){return function(_0x2f42a8){if(_0x2f42a8){return _0x2f42a8[_0x9375('0x22')]()[_0x9375('0x1e')](function(){var _0x1b7039=_0x2f42a8[_0x9375('0x23')]({'plain':!![]});if(_0x1b7039[_0x9375('0x1f')]===_0x9375('0x24'))return;var _0x547a41=[{'name':_0x9375('0x25'),'value':_0x9375('0x26'),'ignore':!![]},{'name':_0x9375('0x27'),'value':_0x9375('0x28'),'ignore':![]},{'name':_0x9375('0x29'),'value':'telephone','ignore':![]}];var _0x4ce37f=_(_0x547a41)['filter']('ignore')[_0x9375('0x2a')](_0x9375('0x2b'))['value']();if(_[_0x9375('0x2c')](_0x4ce37f,_0x1b7039[_0x9375('0x1f')])){return;}var _0x50fac3=_[_0x9375('0x2d')](_0x547a41,[_0x9375('0x2b'),_0x1b7039['role']])['name'];return db[_0x9375('0x2e')][_0x9375('0x22')]({'where':{'type':_0x50fac3,'resourceId':_0x1b7039['id']}})['then'](function(){return _0x2f42a8;});})[_0x9375('0x1e')](function(){_0x416f09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17d904){return function(_0x33bcb1){if(!_0x33bcb1){_0x17d904[_0x9375('0x14')](0x194);}return _0x33bcb1;};}function handleError(_0x4b196a,_0x45fe2d){_0x45fe2d=_0x45fe2d||0x1f4;return function(_0x3707f0){logger[_0x9375('0x2f')](_0x3707f0[_0x9375('0x30')]);if(_0x3707f0[_0x9375('0x31')]){delete _0x3707f0[_0x9375('0x31')];}_0x4b196a[_0x9375('0x32')](_0x45fe2d)[_0x9375('0x33')](_0x3707f0);};}function getUserAttributes(){return _(db[_0x9375('0x34')][_0x9375('0x35')])['map'](function(_0x2eff88){return{'name':_0x2eff88[_0x9375('0x36')],'type':_0x2eff88['type'][_0x9375('0x37')]};})[_0x9375('0x38')](function(_0x2978dc){return![_0x9375('0x39'),_0x9375('0x3a'),_0x9375('0x3b'),_0x9375('0x3c'),'resetPasswordExpires',_0x9375('0x3d')][_0x9375('0x2c')](_0x2978dc[_0x9375('0x31')]);})[_0x9375('0x2b')]();}exports[_0x9375('0x3e')]=function(_0x3912c3,_0x89853a){var _0x200222={},_0x7651e5={'count':0x0,'rows':[]};var _0x2ffaa1=getUserAttributes();_0x200222=qs['getOptions'](_0x2ffaa1,_0x3912c3);var _0x1e11a7={'where':_0x200222[_0x9375('0x3f')]};return db['User'][_0x9375('0x1a')](_0x1e11a7)[_0x9375('0x1e')](function(_0x1d0637){_0x7651e5[_0x9375('0x1a')]=_0x1d0637;if(_0x3912c3[_0x9375('0x40')][_0x9375('0x41')]){_0x200222[_0x9375('0x42')]=[{'all':!![]}];}if(_0x3912c3['query'][_0x9375('0x43')]===_0x9375('0x44')){_0x200222[_0x9375('0x42')]=[{'model':db[_0x9375('0x45')],'as':_0x9375('0x43')}];}if(!_[_0x9375('0x2c')](_0x200222['attributes'],'id')){_0x200222[_0x9375('0x46')]['push']('id');}return db[_0x9375('0x34')][_0x9375('0x47')](_0x200222);})[_0x9375('0x1e')](function(_0x4507d7){_0x7651e5[_0x9375('0x48')]=_0x4507d7;if(_0x3912c3[_0x9375('0x40')][_0x9375('0x49')]===_0x9375('0x44')){var _0x3818d9=[];for(var _0x27be82=0x0;_0x27be82<_0x7651e5[_0x9375('0x48')]['length'];_0x27be82++){_0x3818d9['push'](get_open_tabs(_0x9375('0x4a'),_0x7651e5[_0x9375('0x48')][_0x27be82][_0x9375('0x4b')]));_0x3818d9[_0x9375('0x4c')](get_open_tabs('sms',_0x7651e5[_0x9375('0x48')][_0x27be82][_0x9375('0x4b')]));_0x3818d9[_0x9375('0x4c')](get_open_tabs(_0x9375('0x4d'),_0x7651e5[_0x9375('0x48')][_0x27be82]['dataValues']));_0x3818d9['push'](get_open_tabs('mail',_0x7651e5[_0x9375('0x48')][_0x27be82][_0x9375('0x4b')]));_0x3818d9[_0x9375('0x4c')](get_open_tabs(_0x9375('0x4e'),_0x7651e5[_0x9375('0x48')][_0x27be82][_0x9375('0x4b')]));_0x3818d9[_0x9375('0x4c')](get_open_tabs(_0x9375('0x4f'),_0x7651e5[_0x9375('0x48')][_0x27be82]['dataValues']));}return Promise['all'](_0x3818d9)['then'](function(){return _0x7651e5;});}else{return _0x7651e5;}})['then'](respondWithFilteredResult(_0x89853a,_0x200222))[_0x9375('0x50')](handleError(_0x89853a,null));};exports['show']=function(_0x48a202,_0x3dbdc2){var _0x5aa280=getUserAttributes();_0x48a202[_0x9375('0x40')]['id']=_0x48a202[_0x9375('0x51')]['id'];var _0x29c129=qs[_0x9375('0x52')](_0x5aa280,_0x48a202);if(_0x48a202[_0x9375('0x40')][_0x9375('0x41')]){_0x29c129[_0x9375('0x42')]=[{'all':!![]}];}if(_0x48a202[_0x9375('0x40')][_0x9375('0x43')]==='true'){_0x29c129[_0x9375('0x42')]=[{'model':db['UserSetting'],'as':_0x9375('0x43')}];}_0x29c129=_[_0x9375('0x53')]({},_0x29c129,_0x48a202[_0x9375('0x54')]);if(!_[_0x9375('0x2c')](_0x29c129[_0x9375('0x46')],'id')){_0x29c129['attributes']['push']('id');}return db[_0x9375('0x34')][_0x9375('0x2d')](_0x29c129)[_0x9375('0x1e')](handleEntityNotFound(_0x3dbdc2,null))[_0x9375('0x1e')](function(_0x179d70){var _0x16ad7d=[];values=_0x179d70;if(_0x48a202[_0x9375('0x40')][_0x9375('0x49')]===_0x9375('0x44')){_0x16ad7d[_0x9375('0x4c')](get_open_tabs(_0x9375('0x4a'),_0x179d70[_0x9375('0x4b')]));_0x16ad7d['push'](get_open_tabs(_0x9375('0x55'),_0x179d70['dataValues']));_0x16ad7d[_0x9375('0x4c')](get_open_tabs('openchannel',_0x179d70['dataValues']));_0x16ad7d['push'](get_open_tabs(_0x9375('0x4f'),_0x179d70[_0x9375('0x4b')]));_0x16ad7d['push'](get_open_tabs('fax',_0x179d70['dataValues']));_0x16ad7d[_0x9375('0x4c')](get_open_tabs(_0x9375('0x56'),_0x179d70['dataValues']));return Promise[_0x9375('0x57')](_0x16ad7d);}else{return values;}})['then'](function(){return values;})[_0x9375('0x1e')](respondWithResult(_0x3dbdc2,null))['catch'](handleError(_0x3dbdc2,null));};exports[_0x9375('0x1d')]=function(_0x12c863,_0x1e3b0c){if(_0x12c863['body']['id']){delete _0x12c863[_0x9375('0x58')]['id'];}delete _0x12c863[_0x9375('0x58')][_0x9375('0x1f')];return db[_0x9375('0x34')][_0x9375('0x2d')]({'where':{'id':_0x12c863[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x1e3b0c,null))[_0x9375('0x1e')](saveUpdates(_0x12c863['body'],null))[_0x9375('0x1e')](respondWithResult(_0x1e3b0c,null))[_0x9375('0x50')](handleError(_0x1e3b0c,null));};exports['describe']=function(_0x5dcb20,_0x8b9251){return db[_0x9375('0x34')][_0x9375('0x59')]()[_0x9375('0x1e')](respondWithResult(_0x8b9251,null))['catch'](handleError(_0x8b9251,null));};exports[_0x9375('0x5a')]=function(_0x4966bf,_0x4fb92b){return db['User'][_0x9375('0x2d')]({'where':{'id':_0x4966bf[_0x9375('0x51')]['id']}})['then'](handleEntityNotFound(_0x4fb92b,null))[_0x9375('0x1e')](function(_0x4d50ce){if(_0x4d50ce){return _0x4d50ce[_0x9375('0x5a')](_0x4966bf['body'][_0x9375('0x5b')],_['omit'](_0x4966bf[_0x9375('0x58')],[_0x9375('0x5b'),'id'])||{});}})[_0x9375('0x1e')](respondWithResult(_0x4fb92b,null))[_0x9375('0x50')](handleError(_0x4fb92b,null));};function validateUser(_0x4a11fe){return new Promise(function(_0x4edc1b,_0x2ffaa0){if(_0x4a11fe[_0x9375('0x5c')])return _0x4edc1b(_0x4a11fe);return db['Setting'][_0x9375('0x5d')](0x1)['then'](function(_0x217553){if(_0x217553[_0x9375('0x5e')])authService[_0x9375('0x5f')](_0x4a11fe[_0x9375('0x39')]);db['User'][_0x9375('0x60')](_0x9375('0x5c'))['then'](function(_0x233c11){if(_[_0x9375('0x61')](_0x233c11)){_0x4a11fe[_0x9375('0x5c')]=_0x217553[_0x9375('0x62')]||0x1;return;}if(_[_0x9375('0x61')](_0x217553[_0x9375('0x62')])||_0x217553[_0x9375('0x62')]===_0x233c11){_0x4a11fe[_0x9375('0x5c')]=_0x233c11+0x1;return;}if(_0x217553[_0x9375('0x62')]>_0x233c11){_0x4a11fe[_0x9375('0x5c')]=_0x217553[_0x9375('0x62')];return;}return db[_0x9375('0x63')]['query'](_0x9375('0x64'),{'type':db[_0x9375('0x63')][_0x9375('0x65')][_0x9375('0x66')]})[_0x9375('0x1e')](function(_0x58e8a1){if(_0x58e8a1&&_0x58e8a1['length']){for(var _0x1a0b1a=0x0,_0x41611c=_0x58e8a1[_0x9375('0x67')];_0x1a0b1a<_0x41611c&&_[_0x9375('0x61')](_0x4a11fe[_0x9375('0x5c')]);_0x1a0b1a++){if(_0x217553['min_internal']<=_0x58e8a1[_0x1a0b1a][_0x9375('0x68')]){_0x4a11fe[_0x9375('0x5c')]=_0x58e8a1[_0x1a0b1a][_0x9375('0x68')];}else if(_0x217553['min_internal']>_0x58e8a1[_0x1a0b1a][_0x9375('0x68')]&&_0x217553[_0x9375('0x62')]<=_0x58e8a1[_0x1a0b1a]['to']){_0x4a11fe['internal']=_0x217553[_0x9375('0x62')];}}}if(_[_0x9375('0x61')](_0x4a11fe[_0x9375('0x5c')])){_0x4a11fe[_0x9375('0x5c')]=_0x233c11+0x1;}return _0x4edc1b(_0x4a11fe);});});})['catch'](function(_0x11acdd){_0x2ffaa0(_0x11acdd);});});}function updateUser(_0x1ae2b4){return new Promise(function(_0x9c4452,_0x2513bb){try{if(_0x1ae2b4[_0x9375('0x69')]){_0x1ae2b4[_0x9375('0x6a')]=_0x1ae2b4[_0x9375('0x5c')];_0x1ae2b4[_0x9375('0x6b')]={'mailbox':_0x1ae2b4[_0x9375('0x5c')],'password':_0x1ae2b4['password'],'fullname':_0x1ae2b4[_0x9375('0x6c')],'email':_0x1ae2b4[_0x9375('0x6d')]};}if(_0x1ae2b4[_0x9375('0x1f')]===_0x9375('0x28')){if(!_0x1ae2b4[_0x9375('0x6e')])_0x1ae2b4[_0x9375('0x6e')]=[_0x9375('0x6f'),'102','103',_0x9375('0x70'),_0x9375('0x71'),'104',_0x9375('0x72'),_0x9375('0x73'),_0x9375('0x74'),_0x9375('0x75'),_0x9375('0x76'),_0x9375('0x77'),_0x9375('0x78'),'114',_0x9375('0x79')];}_0x9c4452(_0x1ae2b4);}catch(_0x88c66e){_0x2513bb(_0x88c66e);}});}exports[_0x9375('0x7a')]=function(_0x2e1d80,_0x318ee5){if(_0x2e1d80[_0x9375('0x26')][_0x9375('0x1f')]===_0x9375('0x28'))throw new Error(_0x9375('0x7b'));if(_0x2e1d80[_0x9375('0x58')][_0x9375('0x1f')]===_0x9375('0x26')&&_0x2e1d80[_0x9375('0x26')][_0x9375('0x1f')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x2e1d80[_0x9375('0x58')][_0x9375('0x1f')]===_0x9375('0x24')&&_0x2e1d80['user'][_0x9375('0x1f')]!==_0x9375('0x24')){throw new Error(_0x9375('0x7c'));}return licenseUtil['checkUserLimits']([_0x2e1d80[_0x9375('0x58')]])[_0x9375('0x1e')](function(){return validateUser(_0x2e1d80[_0x9375('0x58')]);})['then'](function(_0x5ae834){return updateUser(_0x5ae834)[_0x9375('0x1e')](function(_0x2bd5b4){if(_0x2bd5b4[_0x9375('0x1f')]===_0x9375('0x24')){_0x2bd5b4[_0x9375('0x7d')]=_0x2e1d80[_0x9375('0x26')]['settingsEnabled'];delete _0x2bd5b4[_0x9375('0x7e')];}return _0x2bd5b4;});})[_0x9375('0x1e')](function(_0xfab12e){return db[_0x9375('0x34')][_0x9375('0x7a')](_0xfab12e,{'include':[{'model':db[_0x9375('0x6b')],'as':_0x9375('0x6b')}]});})[_0x9375('0x1e')](function(_0x1a5c00){if(_0x2e1d80[_0x9375('0x58')][_0x9375('0x1f')]===_0x9375('0x26'))return _0x1a5c00;if(_0x2e1d80[_0x9375('0x26')][_0x9375('0x1f')]!=='user')return _0x1a5c00;return db[_0x9375('0x7f')][_0x9375('0x2d')]({'where':{'name':_0x1a5c00[_0x9375('0x1f')]===_0x9375('0x28')?_0x9375('0x27'):'Telephones','userProfileId':_0x2e1d80[_0x9375('0x26')][_0x9375('0x7e')]},'raw':!![]})[_0x9375('0x1e')](function(_0x1c7160){if(!_0x1c7160||_0x1c7160[_0x9375('0x80')]!=0x0)return _0x1a5c00;return db[_0x9375('0x2e')][_0x9375('0x7a')]({'name':_0x1a5c00['name'],'resourceId':_0x1a5c00['id'],'type':_0x1c7160[_0x9375('0x31')],'sectionId':_0x1c7160['id']},{})[_0x9375('0x1e')](function(){return _0x1a5c00;});})['catch'](function(_0x3165d8){logger[_0x9375('0x2f')](_0x9375('0x81'),_0x3165d8);throw _0x3165d8;});})[_0x9375('0x1e')](respondWithResult(_0x318ee5,0xc9))[_0x9375('0x50')](handleError(_0x318ee5,null));};exports[_0x9375('0x82')]=function(_0x117b44,_0x5d77cd){var _0x5f72ce=_0x117b44[_0x9375('0x58')];var _0x2e3eb0=[];if(_0x117b44[_0x9375('0x26')][_0x9375('0x1f')]===_0x9375('0x28'))throw new Error(_0x9375('0x7b'));if(_['some'](_0x5f72ce,[_0x9375('0x1f'),'user'])&&_0x117b44[_0x9375('0x26')][_0x9375('0x1f')]!=='admin'){throw new Error(_0x9375('0x83'));}if(_[_0x9375('0x84')](_0x5f72ce,[_0x9375('0x1f'),_0x9375('0x24')])&&_0x117b44[_0x9375('0x26')][_0x9375('0x1f')]!==_0x9375('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x9375('0x85')](_0x5f72ce)[_0x9375('0x1e')](function(){return validateUser(_0x5f72ce[0x0]);})['then'](function(){for(var _0x33906c=0x1;_0x33906c<_0x5f72ce[_0x9375('0x67')];_0x33906c++){var _0x2a672a=_0x5f72ce[_0x33906c-0x1][_0x9375('0x5c')];if(!_0x5f72ce[_0x33906c][_0x9375('0x5c')])_0x5f72ce[_0x33906c][_0x9375('0x5c')]=_0x2a672a+0x1;_0x2e3eb0[_0x9375('0x4c')](validateUser(_0x5f72ce[_0x33906c]));}return Promise[_0x9375('0x57')](_0x2e3eb0);})[_0x9375('0x1e')](function(){_0x2e3eb0=[];for(var _0x5ecbec=0x0;_0x5ecbec<_0x5f72ce[_0x9375('0x67')];_0x5ecbec++){_0x2e3eb0[_0x9375('0x4c')](updateUser(_0x5f72ce[_0x5ecbec]));}return Promise['all'](_0x2e3eb0);})['then'](function(){_0x2e3eb0=_0x5f72ce['map'](function(_0x3dc64a){return db['User'][_0x9375('0x7a')](_0x3dc64a,{'include':[{'model':db['VoiceMail'],'as':_0x9375('0x6b')}]})[_0x9375('0x1e')](function(_0x343e95){_0x3dc64a['id']=_0x343e95['id'];return _0x3dc64a;});});return Promise[_0x9375('0x57')](_0x2e3eb0);})['then'](function(_0x22de99){if(_0x117b44[_0x9375('0x58')][_0x9375('0x1f')]==='user')return _0x22de99;if(_0x117b44[_0x9375('0x26')][_0x9375('0x1f')]!==_0x9375('0x26'))return _0x22de99;var _0x45ed90=_[_0x9375('0x84')](_0x22de99,function(_0x60e243){return _0x60e243[_0x9375('0x1f')]===_0x9375('0x28')||_0x60e243[_0x9375('0x1f')]===_0x9375('0x86');});if(!_0x45ed90)return _0x22de99;return db['UserProfileSection'][_0x9375('0x47')]({'where':{'name':{'$or':[_0x9375('0x27'),_0x9375('0x29')]},'userProfileId':_0x117b44[_0x9375('0x26')][_0x9375('0x7e')]},'raw':!![]})[_0x9375('0x1e')](function(_0x4293b2){if(_[_0x9375('0x87')](_0x4293b2)||!_[_0x9375('0x84')](_0x4293b2,[_0x9375('0x80'),0x0]))return _0x22de99;_0x2e3eb0=[];var _0x1dc5d3=_(_0x4293b2)[_0x9375('0x2a')](function(_0x2da69d){if(_0x2da69d['autoAssociation']===0x1)return;return _0x2da69d[_0x9375('0x31')]===_0x9375('0x27')?_0x9375('0x28'):_0x9375('0x86');})[_0x9375('0x88')]()['value']();for(var _0x4b1bde=0x0;_0x4b1bde<_0x22de99[_0x9375('0x67')];_0x4b1bde++){if(!_[_0x9375('0x2c')](_0x1dc5d3,_0x22de99[_0x4b1bde]['role']))return;var _0x4f53c4=_0x22de99[_0x4b1bde][_0x9375('0x1f')]===_0x9375('0x28')?_0x9375('0x27'):_0x9375('0x29');_0x2e3eb0[_0x9375('0x4c')](db[_0x9375('0x2e')][_0x9375('0x7a')]({'name':_0x22de99[_0x4b1bde]['name'],'resourceId':_0x22de99[_0x4b1bde]['id'],'type':_0x4f53c4,'sectionId':_['find'](_0x4293b2,[_0x9375('0x31'),_0x4f53c4])['id']},{}));}return Promise[_0x9375('0x57')](_0x2e3eb0);});})[_0x9375('0x1e')](respondWithResult(_0x5d77cd,0xc9))[_0x9375('0x50')](handleError(_0x5d77cd,null));};exports[_0x9375('0x89')]=function(_0x25a3eb,_0x4f42f3){if(_0x25a3eb[_0x9375('0x58')]['id']){delete _0x25a3eb[_0x9375('0x58')]['id'];}return db[_0x9375('0x34')][_0x9375('0x2d')]({'where':{'id':_0x25a3eb[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](function(_0x35b8e5){if(!_0x35b8e5)return null;if(_0x35b8e5['id']===_0x25a3eb['user']['id']){if(!_0x25a3eb[_0x9375('0x58')][_0x9375('0x8a')]||!_0x25a3eb[_0x9375('0x58')][_0x9375('0x8b')]){throw new db[(_0x9375('0x8c'))][(_0x9375('0x8d'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x35b8e5[_0x9375('0x8e')](_0x25a3eb['body'][_0x9375('0x8a')])){throw new db['Sequelize'][(_0x9375('0x8d'))]('Wrong\x20credentials');}if(_0x25a3eb[_0x9375('0x58')][_0x9375('0x8a')]===_0x25a3eb[_0x9375('0x58')][_0x9375('0x8b')]){throw new db[(_0x9375('0x8c'))][(_0x9375('0x8d'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x25a3eb[_0x9375('0x26')][_0x9375('0x1f')]==='admin'){if(!_0x25a3eb[_0x9375('0x58')][_0x9375('0x8b')]){throw new db['Sequelize'][(_0x9375('0x8d'))](_0x9375('0x8f'));}}else if(_0x25a3eb[_0x9375('0x26')][_0x9375('0x1f')]==='user'){if(!_0x25a3eb[_0x9375('0x58')][_0x9375('0x8b')]){throw new db[(_0x9375('0x8c'))][(_0x9375('0x8d'))](_0x9375('0x8f'));}if(_0x35b8e5['role']!=='agent'){throw new db['Sequelize']['ValidationError'](_0x9375('0x7b'));}}else{throw new db['Sequelize']['ValidationError'](_0x9375('0x7b'));}return _0x35b8e5;})[_0x9375('0x1e')](handleEntityNotFound(_0x4f42f3,null))[_0x9375('0x1e')](function(_0x1663b0){return db['Setting'][_0x9375('0x90')]({'attributes':['id','securePassword',_0x9375('0x91'),_0x9375('0x92')]})[_0x9375('0x1e')](function(_0x554b1c){if(_0x554b1c[_0x9375('0x5e')])authService[_0x9375('0x5f')](_0x25a3eb[_0x9375('0x58')][_0x9375('0x8b')]);if(!_0x554b1c[_0x9375('0x91')]||!_0x1663b0[_0x9375('0x3b')])return _0x1663b0;authService['validatePasswordHistory'](_0x25a3eb[_0x9375('0x58')][_0x9375('0x8b')],_0x1663b0[_0x9375('0x3b')],_0x554b1c['passwordHistoryLimit']);return _0x1663b0;})[_0x9375('0x1e')](saveUpdates({'password':_0x25a3eb[_0x9375('0x58')]['newPassword'],'passwordResetAt':_0x25a3eb[_0x9375('0x26')]['id']==_0x25a3eb['params']['id']?moment():null,'previousPasswords':authService[_0x9375('0x93')](_0x25a3eb[_0x9375('0x58')][_0x9375('0x8b')],_0x1663b0[_0x9375('0x3b')])},null));})[_0x9375('0x1e')](respondWithResult(_0x4f42f3,null))[_0x9375('0x50')](handleError(_0x4f42f3,null));};exports['addQueues']=function(_0x93bf42,_0x51fd18){var _0x29b991=_0x93bf42[_0x9375('0x58')][_0x9375('0x94')];return db[_0x9375('0x34')]['find']({'where':{'id':_0x93bf42[_0x9375('0x51')]['id']},'attributes':['id','name',_0x9375('0x1f'),_0x9375('0x95'),_0x9375('0x96'),_0x9375('0x97'),_0x9375('0x98')]})[_0x9375('0x1e')](handleEntityNotFound(_0x51fd18,null))[_0x9375('0x1e')](function(_0x44f94c){if(_0x44f94c){if(!utils[_0x9375('0x99')](_0x29b991)){throw new db[(_0x9375('0x8c'))][(_0x9375('0x8d'))](_0x9375('0x9a'));}return _0x44f94c[_0x9375('0x9b')+_[_0x9375('0x9c')](_0x29b991[_0x9375('0x9d')]())+_0x9375('0x9e')](_0x93bf42[_0x9375('0x58')]['ids'],{'penalty':_0x93bf42['body'][_0x9375('0x9f')]||0x0})[_0x9375('0xa0')](function(_0x34ec07){for(var _0x27c0b8=0x0;_0x27c0b8<_0x93bf42['body']['ids'][_0x9375('0x67')];_0x27c0b8+=0x1){var _0x329c47={'UserId':Number(_0x93bf42[_0x9375('0x51')]['id'])};_0x329c47[_[_0x9375('0x9c')](_0x29b991[_0x9375('0x9d')]())+'QueueId']=Number(_0x93bf42['body']['ids'][_0x27c0b8]);socket[_0x9375('0x20')](_0x9375('0x26')+_[_0x9375('0x9c')](_0x29b991[_0x9375('0x9d')]())+_0x9375('0xa1'),_0x329c47);}return _0x34ec07;})[_0x9375('0x1e')](function(){if(_0x29b991===_0x9375('0xa2')){return db[_0x9375('0xa3')]['findAll']({'where':{'id':_0x93bf42[_0x9375('0x58')][_0x9375('0x5b')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x28565c){var _0x2485df=_0x44f94c['get']({'plain':!![]});var _0xe7788a=[];if(_0x29b991==='voice'&&_0x2485df[_0x9375('0x1f')]===_0x9375('0x28')&&_0x2485df[_0x9375('0x95')]){for(let _0x26a8ab=0x0;_0x26a8ab<_0x28565c[_0x9375('0x67')];_0x26a8ab+=0x1){_0xe7788a['push']({'membername':_0x2485df[_0x9375('0x31')],'UserId':_0x2485df['id'],'queue_name':_0x28565c[_0x26a8ab][_0x9375('0x31')],'VoiceQueueId':_0x28565c[_0x26a8ab]['id'],'interface':_[_0x9375('0x61')](_0x2485df[_0x9375('0x98')])?util[_0x9375('0xa4')]('SIP/%s',_0x2485df[_0x9375('0x31')]):_0x2485df[_0x9375('0x98')],'paused':_0x2485df[_0x9375('0x97')]||![],'penalty':_0x93bf42[_0x9375('0x58')][_0x9375('0x9f')]||0x0});}return Promise[_0x9375('0x57')](_0xe7788a[_0x9375('0x2a')](function(_0xd035f0){return db[_0x9375('0xa5')][_0x9375('0xa6')](_0xd035f0);}));}return _0x44f94c;});}})[_0x9375('0x1e')](respondWithStatusCode(_0x51fd18,null))['catch'](handleError(_0x51fd18,null));};exports[_0x9375('0xa7')]=function(_0x143891,_0x2e2501){var _0x2b0a23,_0x162ed7;return db[_0x9375('0x34')][_0x9375('0x2d')]({'where':{'id':_0x143891['params']['id']},'attributes':['id',_0x9375('0x31'),'role']})[_0x9375('0x1e')](handleEntityNotFound(_0x2e2501,null))[_0x9375('0x1e')](function(_0xd0703e){if(_0xd0703e){_0x2b0a23=_0xd0703e;if(!_0x143891[_0x9375('0x40')][_0x9375('0x94')]||!utils[_0x9375('0x99')](_0x143891[_0x9375('0x40')]['channel'])){throw new db['Sequelize'][(_0x9375('0x8d'))](_0x9375('0x9a'));}return _0xd0703e[_0x9375('0xa8')+_[_0x9375('0x9c')](_0x143891[_0x9375('0x40')][_0x9375('0x94')][_0x9375('0x9d')]())+_0x9375('0x9e')](_0x143891[_0x9375('0x40')][_0x9375('0x5b')]);}})[_0x9375('0x1e')](function(_0x4a7aac){if(_[_0x9375('0xa9')](_0x143891['query'][_0x9375('0x5b')])){for(var _0x43333e=0x0;_0x43333e<_0x143891['query'][_0x9375('0x5b')][_0x9375('0x67')];_0x43333e+=0x1){_0x162ed7={'UserId':Number(_0x143891[_0x9375('0x51')]['id'])};_0x162ed7[_[_0x9375('0x9c')](_0x143891[_0x9375('0x40')][_0x9375('0x94')][_0x9375('0x9d')]())+_0x9375('0xaa')]=Number(_0x143891[_0x9375('0x40')][_0x9375('0x5b')][_0x43333e]);socket[_0x9375('0x20')](_0x9375('0x26')+_[_0x9375('0x9c')](_0x143891['query'][_0x9375('0x94')][_0x9375('0x9d')]())+_0x9375('0xab'),_0x162ed7);}}else{_0x162ed7={'UserId':Number(_0x143891[_0x9375('0x51')]['id'])};_0x162ed7[_[_0x9375('0x9c')](_0x143891[_0x9375('0x40')]['channel'][_0x9375('0x9d')]())+_0x9375('0xaa')]=Number(_0x143891[_0x9375('0x40')][_0x9375('0x5b')]);socket['emit'](_0x9375('0x26')+_[_0x9375('0x9c')](_0x143891[_0x9375('0x40')][_0x9375('0x94')][_0x9375('0x9d')]())+_0x9375('0xab'),_0x162ed7);}return _0x4a7aac;})[_0x9375('0x1e')](function(){if(_0x143891['query'][_0x9375('0x94')]==='voice'){return db[_0x9375('0xa5')]['destroy']({'where':{'UserId':_0x143891[_0x9375('0x51')]['id'],'VoiceQueueId':_0x143891[_0x9375('0x40')]['ids']},'individualHooks':!![]})[_0x9375('0x1e')](function(){return _0x2b0a23;});}return _0x2b0a23;})[_0x9375('0x1e')](respondWithStatusCode(_0x2e2501,null))['catch'](handleError(_0x2e2501,null));};exports[_0x9375('0xac')]=function(_0x19619a,_0x25dc99){_0x19619a[_0x9375('0x58')]['userpic']=_0x19619a[_0x9375('0xad')]['filename'];return db['User'][_0x9375('0x2d')]({'where':{'id':_0x19619a['params']['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x25dc99,null))[_0x9375('0x1e')](saveUpdates(_0x19619a[_0x9375('0x58')],null))[_0x9375('0x1e')](respondWithResult(_0x25dc99,null))['catch'](handleError(_0x25dc99,null));};exports[_0x9375('0xae')]=function(_0x5e153f,_0x265bac){var _0x5f45a3=path['join'](config[_0x9375('0xaf')],_0x9375('0xb0'));return db['User'][_0x9375('0x2d')]({'where':{'id':_0x5e153f[_0x9375('0x51')]['id']},'attributes':['id',_0x9375('0xb1')],'raw':!![]})[_0x9375('0x1e')](handleEntityNotFound(_0x265bac,null))[_0x9375('0x1e')](function(_0x2661ef){if(_0x2661ef){if(_['isNil'](_0x2661ef[_0x9375('0xb1')])){return _0x265bac[_0x9375('0xb2')](_0x5f45a3);}else{if(!fs[_0x9375('0xb3')](path['join'](config[_0x9375('0xaf')],'server/files/images/',_0x2661ef[_0x9375('0xb1')]))){return _0x265bac[_0x9375('0xb2')](_0x5f45a3);}return _0x265bac['download'](path[_0x9375('0xb4')](config[_0x9375('0xaf')],_0x9375('0xb5'),_0x2661ef[_0x9375('0xb1')]));}}})[_0x9375('0x50')](handleError(_0x265bac,null));};exports[_0x9375('0xb6')]=function(_0x5ef03c,_0x2fe4bb){return db[_0x9375('0x34')]['find']({'where':{'id':_0x5ef03c[_0x9375('0x51')]['id']},'attributes':['id']})[_0x9375('0x1e')](handleEntityNotFound(_0x2fe4bb,null))[_0x9375('0x1e')](function(_0x3334a1){var _0x20a576=[];values=_0x3334a1['dataValues'];_0x20a576[_0x9375('0x4c')](get_open_tabs('chat',_0x3334a1[_0x9375('0x4b')]));_0x20a576[_0x9375('0x4c')](get_open_tabs(_0x9375('0x55'),_0x3334a1['dataValues']));_0x20a576[_0x9375('0x4c')](get_open_tabs(_0x9375('0x4e'),_0x3334a1[_0x9375('0x4b')]));_0x20a576[_0x9375('0x4c')](get_open_tabs(_0x9375('0x4f'),_0x3334a1['dataValues']));_0x20a576['push'](get_open_tabs(_0x9375('0x4d'),_0x3334a1['dataValues']));_0x20a576[_0x9375('0x4c')](get_open_tabs(_0x9375('0x56'),_0x3334a1['dataValues']));return Promise['all'](_0x20a576);})[_0x9375('0x1e')](function(_0x44171b){if(_0x44171b){var _0x461dc1=_[_0x9375('0x2a')](values[_0x9375('0xb7')],function(_0x33b54c){return{'channel':'CHAT','id':_0x33b54c['id'],'createdAt':_0x33b54c[_0x9375('0xb8')]};});var _0xa7db2f=_[_0x9375('0x2a')](values[_0x9375('0xb9')],function(_0x126360){return{'channel':_0x9375('0xba'),'id':_0x126360['id'],'createdAt':_0x126360[_0x9375('0xb8')]};});var _0x41f744=_[_0x9375('0x2a')](values[_0x9375('0xbb')],function(_0x1e6f33){return{'channel':_0x9375('0xbc'),'id':_0x1e6f33['id'],'createdAt':_0x1e6f33['createdAt']};});var _0x15c045=_[_0x9375('0x2a')](values['MailOpenTabs'],function(_0x518ddf){return{'channel':'MAIL','id':_0x518ddf['id'],'createdAt':_0x518ddf[_0x9375('0xb8')]};});var _0x28aca1=_['map'](values[_0x9375('0xbd')],function(_0xa938bc){return{'channel':_0x9375('0xbe'),'id':_0xa938bc['id'],'createdAt':_0xa938bc[_0x9375('0xb8')]};});var _0x1cbe15=_['map'](values['WhatsappOpenTabs'],function(_0x41a57d){return{'channel':'WHATSAPP','id':_0x41a57d['id'],'createdAt':_0x41a57d[_0x9375('0xb8')]};});var _0x1a2f84=_['concat'](_0x461dc1,_0xa7db2f,_0x41f744,_0x15c045,_0x28aca1,_0x1cbe15);var _0x1b49df={'count':_0x1a2f84[_0x9375('0x67')],'rows':_0x1a2f84};return _0x1b49df;}else return null;})[_0x9375('0x1e')](respondWithResult(_0x2fe4bb,null))['catch'](handleError(_0x2fe4bb,null));};exports[_0x9375('0xbf')]=function(_0x31b8a7,_0x323ab2){var _0x44ff1b={};return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x31b8a7[_0x9375('0x51')]['id']}})['then'](function(_0x3ebb61){if(!_0x3ebb61){throw new APINotFoundError(util[_0x9375('0xa4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x31b8a7['params']['id']));}return contacts['describe']();})[_0x9375('0x1e')](function(_0x515b44){_0x31b8a7[_0x9375('0x40')][_0x9375('0x34')]=_0x31b8a7['params']['id'];_0x44ff1b=qs[_0x9375('0x52')](_0x515b44,_0x31b8a7);if(_0x31b8a7[_0x9375('0x40')][_0x9375('0xc0')](_0x9375('0x41'))){_0x44ff1b[_0x9375('0x42')]=[{'model':db['CmList'],'as':_0x9375('0xc1'),'required':![]},{'model':db[_0x9375('0xc2')],'as':_0x9375('0xc3'),'attributes':['id',_0x9375('0x31'),_0x9375('0xc4')],'where':_0x31b8a7['query']['tag']?{'id':_0x31b8a7['query']['tag']}:undefined,'required':_0x31b8a7['query'][_0x9375('0xc5')]?!![]:![]}];}return contacts[_0x9375('0x47')](_0x31b8a7[_0x9375('0x40')],_0x31b8a7[_0x9375('0x26')],_0x44ff1b,_0x515b44);})[_0x9375('0x1e')](respondWithFilteredResult(_0x323ab2,_0x44ff1b))[_0x9375('0x50')](APIHandleError(_0x323ab2));};exports[_0x9375('0xc6')]=function(_0x352e17,_0x14094f){var _0x3f67e3;var _0x2a72c8={};var _0x408f25;return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x352e17[_0x9375('0x51')]['id']},'attributes':['id',_0x9375('0x31'),'role']})[_0x9375('0x1e')](handleEntityNotFound(_0x14094f,null))[_0x9375('0x1e')](function(_0x22be34){if(!utils['isValidChannel'](_0x352e17[_0x9375('0x40')][_0x9375('0x94')])){throw new db['Sequelize'][(_0x9375('0x8d'))](_0x9375('0x9a'));}_0x3f67e3=_0x22be34;var _0x55730a={};_0x55730a[_0x9375('0xc7')]=_[_0x9375('0xc8')](db[_[_0x9375('0x9c')](_0x352e17[_0x9375('0x40')]['channel'])+'Queue']['rawAttributes']);_0x55730a[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x352e17[_0x9375('0x40')]);_0x55730a[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x55730a[_0x9375('0xc7')],_0x55730a[_0x9375('0x40')]);_0x2a72c8[_0x9375('0x46')]=_[_0x9375('0xca')](_0x55730a[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x352e17[_0x9375('0x40')]['fields']));_0x2a72c8[_0x9375('0x46')]=_0x2a72c8['attributes']['length']?_0x2a72c8[_0x9375('0x46')]:_0x55730a[_0x9375('0xc7')];_0x2a72c8[_0x9375('0xcc')]=qs[_0x9375('0xcd')](_0x352e17[_0x9375('0x40')]['sort']);_0x2a72c8[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x352e17[_0x9375('0x40')],_0x55730a[_0x9375('0xc9')]));if(_0x352e17['query'][_0x9375('0x38')]){_0x2a72c8[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x2a72c8[_0x9375('0x3f')],{'$or':_['map'](_0x2a72c8[_0x9375('0x46')],function(_0x2f7879){var _0x5ceaa4={};_0x5ceaa4[_0x2f7879]={'$like':'%'+_0x352e17[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x5ceaa4;})});}_0x2a72c8=_[_0x9375('0x53')]({},_0x2a72c8,_0x352e17[_0x9375('0x54')]);switch(_0x3f67e3[_0x9375('0x1f')]){case _0x9375('0x24'):return db[_[_0x9375('0x9c')](_0x352e17['query'][_0x9375('0x94')])+_0x9375('0xcf')][_0x9375('0x47')](_0x2a72c8);case'user':case'agent':return _0x3f67e3['get'+_[_0x9375('0x9c')](_0x352e17[_0x9375('0x40')][_0x9375('0x94')])+_0x9375('0x9e')](_0x2a72c8);default:throw new db[(_0x9375('0x8c'))]['ValidationError'](_0x9375('0xd0'));}})['then'](function(_0x163be3){_0x408f25=_0x163be3[_0x9375('0x67')];if(!_0x352e17[_0x9375('0x40')][_0x9375('0xc0')]('nolimit')){_0x2a72c8[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x352e17[_0x9375('0x40')][_0x9375('0x19')]);_0x2a72c8['offset']=qs['offset'](_0x352e17[_0x9375('0x40')]['offset']);}switch(_0x3f67e3[_0x9375('0x1f')]){case _0x9375('0x24'):return db[_[_0x9375('0x9c')](_0x352e17[_0x9375('0x40')][_0x9375('0x94')])+'Queue'][_0x9375('0x47')](_0x2a72c8);case _0x9375('0x26'):case _0x9375('0x28'):return _0x3f67e3['get'+_[_0x9375('0x9c')](_0x352e17[_0x9375('0x40')]['channel'])+'Queues'](_0x2a72c8);}})[_0x9375('0x1e')](function(_0x5cd44b){return{'count':_0x408f25,'rows':_0x5cd44b};})['then'](respondWithResult(_0x14094f,null))['catch'](handleError(_0x14094f,null));};exports['getVoiceQueuesRt']=function(_0x5041e5,_0x20f7ad){var _0x87ca45={};var _0x6e0502={};var _0x2f02a9;var _0x5eb9fe;return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x5041e5['params']['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x20f7ad,null))['then'](function(_0x3d9cee){if(_0x3d9cee){_0x2f02a9=_0x3d9cee;_0x6e0502[_0x9375('0xc7')]=_['keys'](db['UserVoiceQueueRt'][_0x9375('0x35')]);_0x6e0502[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x5041e5[_0x9375('0x40')]);_0x6e0502[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x6e0502[_0x9375('0xc7')],_0x6e0502['query']);_0x87ca45['attributes']=_['intersection'](_0x6e0502['model'],qs[_0x9375('0xcb')](_0x5041e5[_0x9375('0x40')]['fields']));_0x87ca45[_0x9375('0x46')]=_0x87ca45[_0x9375('0x46')]['length']?_0x87ca45[_0x9375('0x46')]:_0x6e0502[_0x9375('0xc7')];_0x87ca45['order']=qs[_0x9375('0xcd')](_0x5041e5[_0x9375('0x40')][_0x9375('0xcd')]);_0x87ca45[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x5041e5[_0x9375('0x40')],_0x6e0502[_0x9375('0xc9')]));if(_0x5041e5['query'][_0x9375('0x38')]){_0x87ca45[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x87ca45[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x87ca45['attributes'],function(_0x57ee23){var _0x3eb73c={};_0x3eb73c[_0x57ee23]={'$like':'%'+_0x5041e5['query'][_0x9375('0x38')]+'%'};return _0x3eb73c;})});}_0x87ca45=_[_0x9375('0x53')]({},_0x87ca45,_0x5041e5[_0x9375('0x54')]);return _0x2f02a9['getVoiceQueuesRt'](_0x87ca45);}})[_0x9375('0x1e')](function(_0x197602){if(_0x197602){_0x5eb9fe=_0x197602[_0x9375('0x67')];if(!_0x5041e5['query'][_0x9375('0xc0')](_0x9375('0xd1'))){_0x87ca45[_0x9375('0x19')]=qs['limit'](_0x5041e5[_0x9375('0x40')]['limit']);_0x87ca45[_0x9375('0x17')]=qs[_0x9375('0x17')](_0x5041e5[_0x9375('0x40')][_0x9375('0x17')]);}return _0x2f02a9[_0x9375('0xd2')](_0x87ca45);}})[_0x9375('0x1e')](function(_0xb8852b){if(_0xb8852b){return _0xb8852b?{'count':_0x5eb9fe,'rows':_0xb8852b}:null;}})[_0x9375('0x1e')](respondWithResult(_0x20f7ad,null))[_0x9375('0x50')](handleError(_0x20f7ad,null));};exports[_0x9375('0xd3')]=function(_0x14a550,_0x5deee5){var _0x48b366={};var _0x5af77a={};var _0x5372a7;var _0x5afb84;return db[_0x9375('0x34')]['findOne']({'where':{'id':_0x14a550['params']['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x5deee5,null))[_0x9375('0x1e')](function(_0x331022){if(_0x331022){_0x5372a7=_0x331022;_0x5af77a[_0x9375('0xc7')]=_[_0x9375('0xc8')](db[_0x9375('0xd4')][_0x9375('0x35')]);_0x5af77a['query']=_[_0x9375('0xc8')](_0x14a550[_0x9375('0x40')]);_0x5af77a[_0x9375('0xc9')]=_['intersection'](_0x5af77a[_0x9375('0xc7')],_0x5af77a[_0x9375('0x40')]);_0x48b366[_0x9375('0x46')]=_[_0x9375('0xca')](_0x5af77a[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x14a550['query'][_0x9375('0xcb')]));_0x48b366[_0x9375('0x46')]=_0x48b366['attributes'][_0x9375('0x67')]?_0x48b366['attributes']:_0x5af77a[_0x9375('0xc7')];_0x48b366[_0x9375('0xcc')]=qs['sort'](_0x14a550[_0x9375('0x40')]['sort']);_0x48b366[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_['pick'](_0x14a550[_0x9375('0x40')],_0x5af77a['filters']));if(_0x14a550[_0x9375('0x40')][_0x9375('0x38')]){_0x48b366[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x48b366[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x48b366['attributes'],function(_0x32719e){var _0x2bf457={};_0x2bf457[_0x32719e]={'$like':'%'+_0x14a550[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x2bf457;})});}_0x48b366=_[_0x9375('0x53')]({},_0x48b366,_0x14a550[_0x9375('0x54')]);return _0x5372a7['getGroups'](_0x48b366);}})[_0x9375('0x1e')](function(_0x2b301e){if(_0x2b301e){_0x5afb84=_0x2b301e[_0x9375('0x67')];if(!_0x14a550[_0x9375('0x40')][_0x9375('0xc0')](_0x9375('0xd1'))){_0x48b366['limit']=qs[_0x9375('0x19')](_0x14a550[_0x9375('0x40')][_0x9375('0x19')]);_0x48b366['offset']=qs['offset'](_0x14a550[_0x9375('0x40')][_0x9375('0x17')]);}return _0x5372a7[_0x9375('0xd3')](_0x48b366);}})['then'](function(_0x248b40){if(_0x248b40){return _0x248b40?{'count':_0x5afb84,'rows':_0x248b40}:null;}})[_0x9375('0x1e')](respondWithResult(_0x5deee5,null))[_0x9375('0x50')](handleError(_0x5deee5,null));};exports[_0x9375('0xd5')]=function(_0x26574e,_0x330440){var _0x34cdcb={'raw':!![],'where':{}};var _0x211d13={};var _0xd2f7a7={'count':0x0,'rows':[]};return db[_0x9375('0x34')]['findOne']({'where':{'id':_0x26574e[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x330440,null))[_0x9375('0x1e')](function(_0x332bc9){if(_0x332bc9){_0x211d13[_0x9375('0xc7')]=_[_0x9375('0xc8')](db[_0x9375('0xd6')][_0x9375('0x35')]);_0x211d13[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x26574e['query']);_0x211d13[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x211d13[_0x9375('0xc7')],_0x211d13[_0x9375('0x40')]);_0x34cdcb[_0x9375('0x46')]=_[_0x9375('0xca')](_0x211d13[_0x9375('0xc7')],qs['fields'](_0x26574e['query']['fields']));_0x34cdcb[_0x9375('0x46')]=_0x34cdcb['attributes'][_0x9375('0x67')]?_0x34cdcb['attributes']:_0x211d13['model'];if(!_0x26574e[_0x9375('0x40')]['hasOwnProperty'](_0x9375('0xd1'))){_0x34cdcb[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x26574e[_0x9375('0x40')][_0x9375('0x19')]);_0x34cdcb[_0x9375('0x17')]=qs['offset'](_0x26574e[_0x9375('0x40')]['offset']);}_0x34cdcb[_0x9375('0xcc')]=qs[_0x9375('0xcd')](_0x26574e[_0x9375('0x40')][_0x9375('0xcd')]);_0x34cdcb[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x26574e[_0x9375('0x40')],_0x211d13['filters']));_0x34cdcb[_0x9375('0x3f')]['UserId']=_0x332bc9['id'];if(_0x26574e[_0x9375('0x40')]['filter']){_0x34cdcb[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x34cdcb[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x34cdcb[_0x9375('0x46')],function(_0x321a20){var _0x191246={};_0x191246[_0x321a20]={'$like':'%'+_0x26574e['query']['filter']+'%'};return _0x191246;})});}_0x34cdcb=_[_0x9375('0x53')]({},_0x34cdcb,_0x26574e['options']);return db[_0x9375('0xd6')][_0x9375('0x1a')]({'where':_0x34cdcb[_0x9375('0x3f')]})[_0x9375('0x1e')](function(_0x3bc7a4){_0xd2f7a7[_0x9375('0x1a')]=_0x3bc7a4;if(_0x26574e['query']['includeAll']){_0x34cdcb['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x9375('0x47')](_0x34cdcb);})['then'](function(_0x2500f3){_0xd2f7a7[_0x9375('0x48')]=_0x2500f3;return _0xd2f7a7;});}})[_0x9375('0x1e')](respondWithFilteredResult(_0x330440,_0x34cdcb))[_0x9375('0x50')](handleError(_0x330440,null));};exports[_0x9375('0xd7')]=function(_0x431690,_0x5a6aae){var _0x52739b={'raw':!![],'where':{}};var _0x38db89={};var _0x27a6af={'count':0x0,'rows':[]};return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x431690[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x5a6aae,null))[_0x9375('0x1e')](function(_0x2d5854){if(_0x2d5854){_0x38db89['model']=_[_0x9375('0xc8')](db['ScreenRecording'][_0x9375('0x35')]);_0x38db89[_0x9375('0x40')]=_['keys'](_0x431690[_0x9375('0x40')]);_0x38db89[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x38db89['model'],_0x38db89['query']);_0x52739b['attributes']=_[_0x9375('0xca')](_0x38db89[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x431690[_0x9375('0x40')][_0x9375('0xcb')]));_0x52739b[_0x9375('0x46')]=_0x52739b[_0x9375('0x46')][_0x9375('0x67')]?_0x52739b['attributes']:_0x38db89[_0x9375('0xc7')];if(!_0x431690[_0x9375('0x40')][_0x9375('0xc0')]('nolimit')){_0x52739b['limit']=qs[_0x9375('0x19')](_0x431690[_0x9375('0x40')][_0x9375('0x19')]);_0x52739b[_0x9375('0x17')]=qs[_0x9375('0x17')](_0x431690[_0x9375('0x40')][_0x9375('0x17')]);}_0x52739b['order']=qs[_0x9375('0xcd')](_0x431690[_0x9375('0x40')][_0x9375('0xcd')]);_0x52739b[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x431690[_0x9375('0x40')],_0x38db89[_0x9375('0xc9')]));_0x52739b[_0x9375('0x3f')][_0x9375('0xd8')]=_0x2d5854['id'];if(_0x431690[_0x9375('0x40')]['filter']){_0x52739b[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x52739b[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x52739b[_0x9375('0x46')],function(_0x2bda70){var _0x523750={};_0x523750[_0x2bda70]={'$like':'%'+_0x431690[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x523750;})});}_0x52739b=_[_0x9375('0x53')]({},_0x52739b,_0x431690['options']);return db['ScreenRecording']['count']({'where':_0x52739b[_0x9375('0x3f')]})[_0x9375('0x1e')](function(_0x34f4d8){_0x27a6af[_0x9375('0x1a')]=_0x34f4d8;if(_0x431690['query']['includeAll']){_0x52739b[_0x9375('0x42')]=[{'all':!![]}];}return db[_0x9375('0xd9')][_0x9375('0x47')](_0x52739b);})[_0x9375('0x1e')](function(_0x261e29){_0x27a6af[_0x9375('0x48')]=_0x261e29;return _0x27a6af;});}})[_0x9375('0x1e')](respondWithFilteredResult(_0x5a6aae,_0x52739b))[_0x9375('0x50')](handleError(_0x5a6aae,null));};exports[_0x9375('0xda')]=function(_0x2bb7fe,_0x58fade){var _0x53786a={};var _0x2320e1={};var _0x29021d;var _0x170858;return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x2bb7fe[_0x9375('0x51')]['id']}})['then'](handleEntityNotFound(_0x58fade,null))[_0x9375('0x1e')](function(_0x62f8ff){if(_0x62f8ff){_0x29021d=_0x62f8ff;_0x2320e1[_0x9375('0xc7')]=_['keys'](db[_0x9375('0xdb')][_0x9375('0x35')]);_0x2320e1[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x2bb7fe[_0x9375('0x40')]);_0x2320e1['filters']=_[_0x9375('0xca')](_0x2320e1['model'],_0x2320e1['query']);_0x53786a[_0x9375('0x46')]=_[_0x9375('0xca')](_0x2320e1[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x2bb7fe[_0x9375('0x40')]['fields']));_0x53786a[_0x9375('0x46')]=_0x53786a[_0x9375('0x46')]['length']?_0x53786a[_0x9375('0x46')]:_0x2320e1[_0x9375('0xc7')];_0x53786a[_0x9375('0xcc')]=qs[_0x9375('0xcd')](_0x2bb7fe[_0x9375('0x40')][_0x9375('0xcd')]);_0x53786a[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x2bb7fe[_0x9375('0x40')],_0x2320e1[_0x9375('0xc9')]));if(_0x2bb7fe[_0x9375('0x40')]['filter']){_0x53786a[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x53786a[_0x9375('0x3f')],{'$or':_['map'](_0x53786a[_0x9375('0x46')],function(_0x276f33){var _0x2ebddd={};_0x2ebddd[_0x276f33]={'$like':'%'+_0x2bb7fe[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x2ebddd;})});}_0x53786a=_[_0x9375('0x53')]({},_0x53786a,_0x2bb7fe[_0x9375('0x54')]);return _0x29021d[_0x9375('0xda')](_0x53786a);}})['then'](function(_0xf9411a){if(_0xf9411a){_0x170858=_0xf9411a['length'];if(!_0x2bb7fe['query'][_0x9375('0xc0')]('nolimit')){_0x53786a[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x2bb7fe[_0x9375('0x40')][_0x9375('0x19')]);_0x53786a['offset']=qs[_0x9375('0x17')](_0x2bb7fe['query']['offset']);}return _0x29021d[_0x9375('0xda')](_0x53786a);}})[_0x9375('0x1e')](function(_0x2a70b3){if(_0x2a70b3){return _0x2a70b3?{'count':_0x170858,'rows':_0x2a70b3}:null;}})[_0x9375('0x1e')](respondWithResult(_0x58fade,null))[_0x9375('0x50')](handleError(_0x58fade,null));};exports[_0x9375('0xdc')]=function(_0x2831ca,_0x5ea1b6){var _0x44e213={};var _0x35ad31={};var _0x23d106;var _0x2e91fb;return db[_0x9375('0x34')]['findOne']({'where':{'id':_0x2831ca['params']['id']}})['then'](handleEntityNotFound(_0x5ea1b6,null))[_0x9375('0x1e')](function(_0x3d75ad){if(_0x3d75ad){_0x23d106=_0x3d75ad;_0x35ad31[_0x9375('0xc7')]=_[_0x9375('0xc8')](db[_0x9375('0xdd')][_0x9375('0x35')]);_0x35ad31['query']=_[_0x9375('0xc8')](_0x2831ca[_0x9375('0x40')]);_0x35ad31[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x35ad31[_0x9375('0xc7')],_0x35ad31[_0x9375('0x40')]);_0x44e213[_0x9375('0x46')]=_[_0x9375('0xca')](_0x35ad31[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x2831ca['query'][_0x9375('0xcb')]));_0x44e213['attributes']=_0x44e213[_0x9375('0x46')][_0x9375('0x67')]?_0x44e213['attributes']:_0x35ad31[_0x9375('0xc7')];_0x44e213[_0x9375('0xcc')]=qs['sort'](_0x2831ca[_0x9375('0x40')][_0x9375('0xcd')]);_0x44e213[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x2831ca[_0x9375('0x40')],_0x35ad31['filters']));if(_0x2831ca['query'][_0x9375('0x38')]){_0x44e213['where']=_[_0x9375('0x53')](_0x44e213[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x44e213[_0x9375('0x46')],function(_0x2a9534){var _0x1f9074={};_0x1f9074[_0x2a9534]={'$like':'%'+_0x2831ca[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x1f9074;})});}_0x44e213=_['merge']({},_0x44e213,_0x2831ca[_0x9375('0x54')]);return _0x23d106['getOpenchannelInteractions'](_0x44e213);}})[_0x9375('0x1e')](function(_0x1504cb){if(_0x1504cb){_0x2e91fb=_0x1504cb[_0x9375('0x67')];if(!_0x2831ca['query'][_0x9375('0xc0')](_0x9375('0xd1'))){_0x44e213[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x2831ca['query'][_0x9375('0x19')]);_0x44e213[_0x9375('0x17')]=qs[_0x9375('0x17')](_0x2831ca['query'][_0x9375('0x17')]);}return _0x23d106[_0x9375('0xdc')](_0x44e213);}})['then'](function(_0x56e6f5){if(_0x56e6f5){return _0x56e6f5?{'count':_0x2e91fb,'rows':_0x56e6f5}:null;}})['then'](respondWithResult(_0x5ea1b6,null))['catch'](handleError(_0x5ea1b6,null));};exports[_0x9375('0xde')]=function(_0x68e4c7,_0x546cde){var _0x483944={'raw':!![],'where':{}};var _0x3442cc={};var _0x2feab7={'count':0x0,'rows':[]};return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x68e4c7[_0x9375('0x51')]['id']}})['then'](handleEntityNotFound(_0x546cde,null))['then'](function(_0x546352){if(_0x546352){_0x3442cc[_0x9375('0xc7')]=_[_0x9375('0xc8')](db[_0x9375('0xdf')][_0x9375('0x35')]);_0x3442cc[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x68e4c7[_0x9375('0x40')]);_0x3442cc[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x3442cc[_0x9375('0xc7')],_0x3442cc['query']);_0x483944[_0x9375('0x46')]=_[_0x9375('0xca')](_0x3442cc[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x68e4c7[_0x9375('0x40')]['fields']));_0x483944[_0x9375('0x46')]=_0x483944['attributes'][_0x9375('0x67')]?_0x483944[_0x9375('0x46')]:_0x3442cc[_0x9375('0xc7')];if(!_0x68e4c7[_0x9375('0x40')][_0x9375('0xc0')]('nolimit')){_0x483944[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x68e4c7[_0x9375('0x40')][_0x9375('0x19')]);_0x483944['offset']=qs['offset'](_0x68e4c7[_0x9375('0x40')][_0x9375('0x17')]);}_0x483944[_0x9375('0xcc')]=qs['sort'](_0x68e4c7[_0x9375('0x40')]['sort']);_0x483944[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x68e4c7[_0x9375('0x40')],_0x3442cc[_0x9375('0xc9')]));_0x483944[_0x9375('0x3f')][_0x9375('0xd8')]=_0x546352['id'];if(_0x68e4c7[_0x9375('0x40')]['filter']){_0x483944[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x483944[_0x9375('0x3f')],{'$or':_['map'](_0x483944[_0x9375('0x46')],function(_0x5aa6cb){var _0x541edd={};_0x541edd[_0x5aa6cb]={'$like':'%'+_0x68e4c7[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x541edd;})});}_0x483944=_[_0x9375('0x53')]({},_0x483944,_0x68e4c7[_0x9375('0x54')]);return db[_0x9375('0xdf')][_0x9375('0x1a')]({'where':_0x483944[_0x9375('0x3f')]})[_0x9375('0x1e')](function(_0x192c9d){_0x2feab7['count']=_0x192c9d;if(_0x68e4c7[_0x9375('0x40')][_0x9375('0x41')]){_0x483944[_0x9375('0x42')]=[{'all':!![]}];}return db[_0x9375('0xdf')][_0x9375('0x47')](_0x483944);})[_0x9375('0x1e')](function(_0x4d2be0){_0x2feab7[_0x9375('0x48')]=_0x4d2be0;return _0x2feab7;});}})[_0x9375('0x1e')](respondWithFilteredResult(_0x546cde,_0x483944))[_0x9375('0x50')](handleError(_0x546cde,null));};exports['getSmsInteractions']=function(_0x1d62ba,_0x4b3844){var _0x211d31={};var _0x1b81d6={};var _0x24eb59;var _0x4be911;return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x1d62ba[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x4b3844,null))['then'](function(_0x47d42e){if(_0x47d42e){_0x24eb59=_0x47d42e;_0x1b81d6[_0x9375('0xc7')]=_['keys'](db['SmsInteraction'][_0x9375('0x35')]);_0x1b81d6[_0x9375('0x40')]=_['keys'](_0x1d62ba[_0x9375('0x40')]);_0x1b81d6[_0x9375('0xc9')]=_['intersection'](_0x1b81d6[_0x9375('0xc7')],_0x1b81d6['query']);_0x211d31[_0x9375('0x46')]=_['intersection'](_0x1b81d6[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x1d62ba[_0x9375('0x40')][_0x9375('0xcb')]));_0x211d31[_0x9375('0x46')]=_0x211d31[_0x9375('0x46')]['length']?_0x211d31[_0x9375('0x46')]:_0x1b81d6[_0x9375('0xc7')];_0x211d31['order']=qs['sort'](_0x1d62ba[_0x9375('0x40')][_0x9375('0xcd')]);_0x211d31[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_['pick'](_0x1d62ba[_0x9375('0x40')],_0x1b81d6[_0x9375('0xc9')]));if(_0x1d62ba[_0x9375('0x40')][_0x9375('0x38')]){_0x211d31[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x211d31[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x211d31[_0x9375('0x46')],function(_0x5c3c68){var _0x5640ab={};_0x5640ab[_0x5c3c68]={'$like':'%'+_0x1d62ba[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x5640ab;})});}_0x211d31=_[_0x9375('0x53')]({},_0x211d31,_0x1d62ba[_0x9375('0x54')]);return _0x24eb59['getSmsInteractions'](_0x211d31);}})[_0x9375('0x1e')](function(_0x39b028){if(_0x39b028){_0x4be911=_0x39b028[_0x9375('0x67')];if(!_0x1d62ba[_0x9375('0x40')][_0x9375('0xc0')](_0x9375('0xd1'))){_0x211d31[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x1d62ba[_0x9375('0x40')][_0x9375('0x19')]);_0x211d31[_0x9375('0x17')]=qs['offset'](_0x1d62ba[_0x9375('0x40')][_0x9375('0x17')]);}return _0x24eb59[_0x9375('0xe0')](_0x211d31);}})['then'](function(_0x583052){if(_0x583052){return _0x583052?{'count':_0x4be911,'rows':_0x583052}:null;}})[_0x9375('0x1e')](respondWithResult(_0x4b3844,null))[_0x9375('0x50')](handleError(_0x4b3844,null));};exports[_0x9375('0xe1')]=function(_0x39c01d,_0x1ce83c){var _0x43f808={};var _0x2c8508={};var _0x177cd9;var _0x59c6b4;return db[_0x9375('0x34')]['findOne']({'where':{'id':_0x39c01d[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x1ce83c,null))[_0x9375('0x1e')](function(_0x224f1f){if(_0x224f1f){_0x177cd9=_0x224f1f;_0x2c8508[_0x9375('0xc7')]=_[_0x9375('0xc8')](db[_0x9375('0xe2')][_0x9375('0x35')]);_0x2c8508[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x39c01d[_0x9375('0x40')]);_0x2c8508['filters']=_[_0x9375('0xca')](_0x2c8508[_0x9375('0xc7')],_0x2c8508[_0x9375('0x40')]);_0x43f808[_0x9375('0x46')]=_['intersection'](_0x2c8508[_0x9375('0xc7')],qs['fields'](_0x39c01d[_0x9375('0x40')][_0x9375('0xcb')]));_0x43f808[_0x9375('0x46')]=_0x43f808[_0x9375('0x46')][_0x9375('0x67')]?_0x43f808[_0x9375('0x46')]:_0x2c8508[_0x9375('0xc7')];_0x43f808[_0x9375('0xcc')]=qs['sort'](_0x39c01d['query']['sort']);_0x43f808[_0x9375('0x3f')]=qs['filters'](_['pick'](_0x39c01d[_0x9375('0x40')],_0x2c8508[_0x9375('0xc9')]));if(_0x39c01d['query'][_0x9375('0x38')]){_0x43f808['where']=_[_0x9375('0x53')](_0x43f808[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x43f808['attributes'],function(_0x5691c4){var _0x18fd75={};_0x18fd75[_0x5691c4]={'$like':'%'+_0x39c01d[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x18fd75;})});}_0x43f808=_['merge']({},_0x43f808,_0x39c01d['options']);return _0x177cd9['getFaxInteractions'](_0x43f808);}})[_0x9375('0x1e')](function(_0x1df7ed){if(_0x1df7ed){_0x59c6b4=_0x1df7ed[_0x9375('0x67')];if(!_0x39c01d[_0x9375('0x40')][_0x9375('0xc0')](_0x9375('0xd1'))){_0x43f808[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x39c01d[_0x9375('0x40')][_0x9375('0x19')]);_0x43f808[_0x9375('0x17')]=qs[_0x9375('0x17')](_0x39c01d[_0x9375('0x40')][_0x9375('0x17')]);}return _0x177cd9[_0x9375('0xe1')](_0x43f808);}})[_0x9375('0x1e')](function(_0x5ef811){if(_0x5ef811){return _0x5ef811?{'count':_0x59c6b4,'rows':_0x5ef811}:null;}})['then'](respondWithResult(_0x1ce83c,null))['catch'](handleError(_0x1ce83c,null));};exports[_0x9375('0xe3')]=function(_0x31350a,_0x318a3d){var _0x5d17d7={};var _0x41747d={};var _0x26135a;var _0x186870;return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x31350a[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x318a3d,null))[_0x9375('0x1e')](function(_0x54a6d2){if(_0x54a6d2){_0x26135a=_0x54a6d2;_0x41747d['model']=_[_0x9375('0xc8')](db[_0x9375('0xe4')][_0x9375('0x35')]);_0x41747d['query']=_['keys'](_0x31350a[_0x9375('0x40')]);_0x41747d[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x41747d[_0x9375('0xc7')],_0x41747d[_0x9375('0x40')]);_0x5d17d7[_0x9375('0x46')]=_[_0x9375('0xca')](_0x41747d[_0x9375('0xc7')],qs['fields'](_0x31350a[_0x9375('0x40')][_0x9375('0xcb')]));_0x5d17d7[_0x9375('0x46')]=_0x5d17d7['attributes'][_0x9375('0x67')]?_0x5d17d7[_0x9375('0x46')]:_0x41747d[_0x9375('0xc7')];_0x5d17d7[_0x9375('0xcc')]=qs[_0x9375('0xcd')](_0x31350a['query']['sort']);_0x5d17d7['where']=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x31350a[_0x9375('0x40')],_0x41747d[_0x9375('0xc9')]));if(_0x31350a[_0x9375('0x40')][_0x9375('0x38')]){_0x5d17d7[_0x9375('0x3f')]=_[_0x9375('0x53')](_0x5d17d7['where'],{'$or':_[_0x9375('0x2a')](_0x5d17d7[_0x9375('0x46')],function(_0x443a01){var _0x27d61d={};_0x27d61d[_0x443a01]={'$like':'%'+_0x31350a[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x27d61d;})});}_0x5d17d7=_[_0x9375('0x53')]({},_0x5d17d7,_0x31350a[_0x9375('0x54')]);return _0x26135a[_0x9375('0xe3')](_0x5d17d7);}})['then'](function(_0x1a60de){if(_0x1a60de){_0x186870=_0x1a60de[_0x9375('0x67')];if(!_0x31350a['query'][_0x9375('0xc0')](_0x9375('0xd1'))){_0x5d17d7['limit']=qs[_0x9375('0x19')](_0x31350a['query']['limit']);_0x5d17d7[_0x9375('0x17')]=qs[_0x9375('0x17')](_0x31350a[_0x9375('0x40')][_0x9375('0x17')]);}return _0x26135a['getWhatsappInteractions'](_0x5d17d7);}})['then'](function(_0x257ce0){if(_0x257ce0){return _0x257ce0?{'count':_0x186870,'rows':_0x257ce0}:null;}})[_0x9375('0x1e')](respondWithResult(_0x318a3d,null))[_0x9375('0x50')](handleError(_0x318a3d,null));};exports[_0x9375('0xe5')]=function(_0x557fc5,_0x316bfb,_0x450794){var _0x162b8a;var _0xb2dbae;var _0x4a8c9d;var _0x3191bc=!_['isNil'](_0x557fc5[_0x9375('0x51')]['id'])?_0x557fc5[_0x9375('0x51')]['id']:!_[_0x9375('0x61')](_0x557fc5[_0x9375('0x26')]['id'])?_0x557fc5['user']['id']:null;return db['User'][_0x9375('0x2d')]({'where':{'id':_0x3191bc,'role':{'$or':[_0x9375('0x24'),_0x9375('0x26'),_0x9375('0x28')]}},'attributes':['id',_0x9375('0x31'),_0x9375('0xe6'),_0x9375('0xe7'),_0x9375('0x1f'),_0x9375('0x5c'),_0x9375('0x96')]})['then'](function(_0x54531d){if(_0x54531d){if(_0x54531d[_0x9375('0x1f')]===_0x9375('0x28')){_0x162b8a=_0x54531d;if(_0x557fc5[_0x9375('0x58')][_0x9375('0x98')]){_0x4a8c9d=util[_0x9375('0xa4')](_0x9375('0xe8'),_0x162b8a[_0x557fc5[_0x9375('0x58')][_0x9375('0x98')]]);}else if(_0x557fc5[_0x9375('0x58')][_0x9375('0xe9')]){_0x4a8c9d=util[_0x9375('0xa4')](_0x9375('0xea'),_0x557fc5[_0x9375('0x58')][_0x9375('0xe9')]);}else{_0x4a8c9d=util[_0x9375('0xa4')](_0x9375('0xea'),_0x162b8a[_0x9375('0x31')]);}socket['to'](util[_0x9375('0xa4')]('user:%s',_0x162b8a[_0x9375('0x31')]))[_0x9375('0x20')](_0x9375('0xeb'),{'user':{'id':_0x162b8a['id'],'name':_0x162b8a[_0x9375('0x31')]},'ip':_0x557fc5[_0x9375('0xec')]['x-forwarded-for']||_0x557fc5[_0x9375('0xed')][_0x9375('0xee')]||_0x557fc5[_0x9375('0xef')]['remoteAddress']||_0x557fc5[_0x9375('0xed')]['socket'][_0x9375('0xee')]});return db[_0x9375('0xa5')]['destroy']({'where':{'membername':_0x162b8a['name']},'individualHooks':!![]});}}else{throw new db[(_0x9375('0x8c'))][(_0x9375('0x8d'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x9375('0x1e')](function(){if(_0x162b8a){return _0x162b8a['getVoiceQueues']({'raw':!![]});}})[_0x9375('0x1e')](function(_0x7fb87b){if(_0x162b8a){if(_0x7fb87b){_0xb2dbae=_0x7fb87b;if(_0xb2dbae['length']){var _0x5d0c39=_0xb2dbae[_0x9375('0x2a')](function(_0x4f737d){var _0x5d6dc={'membername':_0x162b8a[_0x9375('0x31')],'UserId':_0x162b8a['id'],'queue_name':_0x4f737d['name'],'VoiceQueueId':_0x4f737d['id'],'interface':_0x4a8c9d,'paused':_0x162b8a[_0x9375('0x96')]||![],'penalty':_0x4f737d['UserVoiceQueue.penalty']||0x0};return db[_0x9375('0xa5')][_0x9375('0xa6')](_0x5d6dc);});return Promise[_0x9375('0x57')](_0x5d0c39);}}}})[_0x9375('0x1e')](function(){if(_0x162b8a){return db[_0x9375('0xf0')][_0x9375('0x47')]({'where':{'membername':_0x162b8a[_0x9375('0x31')],'exitAt':null}});}})[_0x9375('0x1e')](function(_0x34338b){if(_0x162b8a){var _0xadecc4=[];_0x34338b['forEach'](function(_0x4c8580){_0xadecc4['push'](_0x4c8580[_0x9375('0x1d')]({'exitAt':moment()[_0x9375('0xa4')](_0x9375('0xf1'))}));});return Promise[_0x9375('0x57')](_0xadecc4);}})[_0x9375('0x1e')](function(){if(_0x162b8a){var _0x8547ea=[];var _0x131f49=[];var _0x136a4c=utils[_0x9375('0xf2')]();var _0x55f58a={'membername':_0x162b8a[_0x9375('0x31')],'interface':_0x4a8c9d,'enterAt':moment()['format'](_0x9375('0xf1')),'role':_0x162b8a[_0x9375('0x1f')],'internal':_0x162b8a[_0x9375('0x5c')]};_0x136a4c['forEach'](function(_0x5104ad){_0x8547ea['push'](_[_0x9375('0x53')]({'channel':_0x5104ad,'type':'LOGIN','data1':_0x557fc5['body'][_0x9375('0xf3')],'data2':_0x4a8c9d},_0x55f58a));if(_0x162b8a[_0x9375('0x96')]){_0x131f49[_0x9375('0x4c')](_[_0x9375('0x53')]({'channel':_0x5104ad,'type':_0x9375('0xf4'),'data1':'LOGININPAUSE'},_0x55f58a));}});return db[_0x9375('0xf0')][_0x9375('0x82')](_0x8547ea[_0x9375('0xf5')](_0x131f49),{'individualHooks':!![]});}})[_0x9375('0x1e')](function(){if(_0x162b8a){return _0x162b8a[_0x9375('0x1d')]({'online':!![],'lastLoginAt':moment()[_0x9375('0xa4')](_0x9375('0xf1')),'voicePause':_0x162b8a[_0x9375('0x96')]||![],'mailPause':_0x162b8a['loginInPause']||![],'chatPause':_0x162b8a[_0x9375('0x96')]||![],'faxPause':_0x162b8a[_0x9375('0x96')]||![],'smsPause':_0x162b8a['loginInPause']||![],'openchannelPause':_0x162b8a[_0x9375('0x96')]||![],'whatsappPause':_0x162b8a[_0x9375('0x96')]||![],'pauseType':_0x162b8a[_0x9375('0x96')]?_0x9375('0xf6'):null,'interface':_0x4a8c9d,'lastPauseAt':moment()[_0x9375('0xa4')](_0x9375('0xf1'))});}})[_0x9375('0x1e')](function(_0x4387b){if(_0x557fc5[_0x9375('0xf7')]){return _0x450794();}else{return Promise[_0x9375('0xf8')](_0x4387b)[_0x9375('0x1e')](respondWithResult(_0x316bfb,null));}})[_0x9375('0x50')](handleError(_0x316bfb,null));};exports['logout']=function(_0x28f9fe,_0xa086af){var _0x10d58b;return db[_0x9375('0x34')]['find']({'where':{'id':_0x28f9fe[_0x9375('0x51')]['id'],'role':_0x9375('0x28')},'attributes':['id',_0x9375('0x31'),'role']})['then'](handleEntityNotFound(_0xa086af,null))[_0x9375('0x1e')](function(_0x1c4a61){if(_0x1c4a61){_0x10d58b=_0x1c4a61;return db[_0x9375('0xa5')]['destroy']({'where':{'membername':_0x10d58b['name']},'individualHooks':!![]});}})['then'](function(){return db[_0x9375('0xf0')][_0x9375('0x47')]({'where':{'membername':_0x10d58b[_0x9375('0x31')],'exitAt':null}});})[_0x9375('0x1e')](function(_0xb1c05e){var _0x4fb1c1=[];_0xb1c05e[_0x9375('0xf9')](function(_0xe3a49e){_0x4fb1c1[_0x9375('0x4c')](_0xe3a49e[_0x9375('0x1d')]({'exitAt':moment()[_0x9375('0xa4')](_0x9375('0xf1'))}));});return Promise[_0x9375('0x57')](_0x4fb1c1);})[_0x9375('0x1e')](function(){return _0x10d58b['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9375('0x1e')](respondWithResult(_0xa086af,null))[_0x9375('0x50')](handleError(_0xa086af,null));};exports[_0x9375('0xfa')]=function(_0x4bc56a,_0x18c2a5){var _0x53bddc;return db[_0x9375('0xa5')][_0x9375('0x1d')]({'paused':0x1},{'where':{'UserId':_0x4bc56a[_0x9375('0x51')]['id']},'individualHooks':!![]})[_0x9375('0x1e')](function(){return db['User'][_0x9375('0x2d')]({'where':{'id':_0x4bc56a[_0x9375('0x51')]['id'],'role':_0x9375('0x28')},'attributes':['id','name',_0x9375('0x1f'),'internal',_0x9375('0x98'),_0x9375('0x95')]});})[_0x9375('0x1e')](handleEntityNotFound(_0x18c2a5,null))['then'](function(_0x3184ae){if(_0x3184ae){_0x53bddc=_0x3184ae;return db['MemberReport']['findAll']({'where':{'membername':_0x53bddc[_0x9375('0x31')],'type':_0x9375('0xf4'),'exitAt':null}});}})[_0x9375('0x1e')](function(_0x3ee69d){if(_0x3ee69d[_0x9375('0x67')]){var _0x276ff6=moment()[_0x9375('0xa4')](_0x9375('0xf1'));for(var _0x3d24d2=0x0,_0x5d73ac=_0x3ee69d[_0x9375('0x67')];_0x3d24d2<_0x5d73ac;_0x3d24d2++){_0x3ee69d[_0x3d24d2][_0x9375('0xfb')]({'exitAt':_0x276ff6});}}})[_0x9375('0x1e')](function(){var _0x47b270=[];var _0x1ae162=utils[_0x9375('0xf2')]();_0x1ae162['forEach'](function(_0x147ac5){_0x47b270[_0x9375('0x4c')]({'channel':_0x147ac5,'membername':_0x53bddc[_0x9375('0x31')],'interface':_[_0x9375('0x61')](_0x53bddc[_0x9375('0x98')])?util['format'](_0x9375('0xea'),_0x53bddc[_0x9375('0x31')]):_0x53bddc[_0x9375('0x98')],'type':_0x9375('0xf4'),'enterAt':moment()['format'](_0x9375('0xf1')),'data1':_0x4bc56a['body']['type']||'DEFAULT\x20PAUSE','role':_0x53bddc['role'],'internal':_0x53bddc['internal']});});return db[_0x9375('0xf0')][_0x9375('0x82')](_0x47b270,{'individualHooks':!![]});})[_0x9375('0x1e')](function(){return _0x53bddc[_0x9375('0x1d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4bc56a['body']['type']||_0x9375('0xfc'),'lastPauseAt':moment()[_0x9375('0xa4')](_0x9375('0xf1'))});})['then'](respondWithResult(_0x18c2a5,null))['catch'](handleError(_0x18c2a5,null));};exports[_0x9375('0xfd')]=function(_0x491656,_0x32d9f4){if(_0x491656[_0x9375('0x58')][_0x9375('0x94')]&&!utils['isValidChannel'](_0x491656[_0x9375('0x58')][_0x9375('0x94')])){throw new APIBadRequestError(util[_0x9375('0xa4')](_0x9375('0xfe'),_0x491656[_0x9375('0x58')][_0x9375('0x94')]));}return db[_0x9375('0x34')][_0x9375('0x2d')]({'where':{'id':_0x491656[_0x9375('0x51')]['id']},'attributes':['id','name',_0x9375('0x1f'),_0x9375('0x5c'),'interface',_0x9375('0x95'),_0x9375('0x97'),'mailPause','chatPause',_0x9375('0xff'),_0x9375('0x100'),_0x9375('0x101'),'whatsappPause',_0x9375('0x102'),_0x9375('0x103')]})[_0x9375('0x1e')](function(_0x50ec58){if(!_0x50ec58){throw new APINotFoundError(util[_0x9375('0xa4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x491656['params']['id']));}return _0x50ec58[_0x9375('0xfd')](_0x491656[_0x9375('0x58')]['channel']);})[_0x9375('0x1e')](respondWithResult(_0x32d9f4,null))['catch'](APIHandleError(_0x32d9f4));};exports[_0x9375('0x104')]=function(_0x34c8f7,_0x371668){var _0x8f28e1={};var _0x3f4762={};var _0x53d319;var _0x46984f;return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x34c8f7[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x371668,null))[_0x9375('0x1e')](function(_0x39dc74){if(_0x39dc74){_0x53d319=_0x39dc74;_0x3f4762[_0x9375('0xc7')]=_['keys'](db['Team'][_0x9375('0x35')]);_0x3f4762[_0x9375('0x40')]=_['keys'](_0x34c8f7[_0x9375('0x40')]);_0x3f4762[_0x9375('0xc9')]=_[_0x9375('0xca')](_0x3f4762[_0x9375('0xc7')],_0x3f4762[_0x9375('0x40')]);_0x8f28e1[_0x9375('0x46')]=_[_0x9375('0xca')](_0x3f4762[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x34c8f7[_0x9375('0x40')]['fields']));_0x8f28e1['attributes']=_0x8f28e1['attributes'][_0x9375('0x67')]?_0x8f28e1[_0x9375('0x46')]:_0x3f4762[_0x9375('0xc7')];_0x8f28e1[_0x9375('0xcc')]=qs[_0x9375('0xcd')](_0x34c8f7[_0x9375('0x40')][_0x9375('0xcd')]);_0x8f28e1['where']=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x34c8f7[_0x9375('0x40')],_0x3f4762[_0x9375('0xc9')]));if(_0x34c8f7[_0x9375('0x40')][_0x9375('0x38')]){_0x8f28e1[_0x9375('0x3f')]=_['merge'](_0x8f28e1[_0x9375('0x3f')],{'$or':_[_0x9375('0x2a')](_0x8f28e1[_0x9375('0x46')],function(_0x496a68){var _0x4399d4={};_0x4399d4[_0x496a68]={'$like':'%'+_0x34c8f7[_0x9375('0x40')][_0x9375('0x38')]+'%'};return _0x4399d4;})});}_0x8f28e1=_[_0x9375('0x53')]({},_0x8f28e1,_0x34c8f7['options']);return _0x53d319[_0x9375('0x104')](_0x8f28e1);}})['then'](function(_0x4ada9e){if(_0x4ada9e){_0x46984f=_0x4ada9e[_0x9375('0x67')];if(!_0x34c8f7[_0x9375('0x40')][_0x9375('0xc0')](_0x9375('0xd1'))){_0x8f28e1[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x34c8f7['query'][_0x9375('0x19')]);_0x8f28e1[_0x9375('0x17')]=qs[_0x9375('0x17')](_0x34c8f7[_0x9375('0x40')][_0x9375('0x17')]);}return _0x53d319[_0x9375('0x104')](_0x8f28e1);}})[_0x9375('0x1e')](function(_0x2eaa9a){if(_0x2eaa9a){return _0x2eaa9a?{'count':_0x46984f,'rows':_0x2eaa9a}:null;}})[_0x9375('0x1e')](respondWithResult(_0x371668,null))[_0x9375('0x50')](handleError(_0x371668,null));};exports['addTeams']=function(_0x20031a,_0x4b9979){var _0x59f8e6=_0x20031a['params']['id'];var _0x4976bd=_0x20031a['body']?_0x20031a[_0x9375('0x58')][_0x9375('0x5b')]:null;var _0xb2c44=[];return Promise[_0x9375('0xf8')]()[_0x9375('0x1e')](function(){if(!_0x4976bd)throw new APIBadRequestError(_0x9375('0x105'));})['then'](function(){return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x59f8e6}});})[_0x9375('0x1e')](function(_0x4c0744){if(!_0x4c0744)throw new APINotFoundError(util[_0x9375('0xa4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x20031a['params']['id']));return db[_0x9375('0x63')][_0x9375('0x106')](function(_0x275141){return _0x4c0744['addTeams'](_0x4976bd,{'transaction':_0x275141})[_0x9375('0x1e')](function(){return db['Team'][_0x9375('0x47')]({'where':{'id':{'$in':_0x4976bd}}});})[_0x9375('0x1e')](function(_0x25a2db){var _0x37c775=_['map'](_0x25a2db,function(_0x44aa65){return _0x44aa65[_0x9375('0x107')]();});return Promise['all'](_0x37c775);})[_0x9375('0x1e')](function(_0x32df80){_0xb2c44=_[_0x9375('0x108')](_0x32df80);var _0x3bf035=_[_0x9375('0x2a')](_0xb2c44,function(_0xe594a){return _0xe594a[_0x9375('0x109')](_0x4c0744['id'],{'transaction':_0x275141});});return Promise['all'](_0x3bf035);})['then'](function(){if(!_0x4c0744['online'])return;var _0x30095e=_[_0x9375('0x38')](_0xb2c44,function(_0x9b7982){return _0x9b7982[_0x9375('0x10a')](_0x9375('0x94'))===_0x9375('0x10b');});var _0x45bc27=_[_0x9375('0x2a')](_0x30095e,function(_0x5415ea){return db['UserVoiceQueueRt'][_0x9375('0xa6')]({'membername':_0x4c0744[_0x9375('0x31')],'UserId':_0x4c0744['id'],'queue_name':_0x5415ea[_0x9375('0x31')],'VoiceQueueId':_0x5415ea['id'],'interface':_['isNil'](_0x4c0744['interface'])?util['format']('SIP/%s',_0x4c0744[_0x9375('0x31')]):_0x4c0744[_0x9375('0x98')],'paused':_0x4c0744['voicePause']||![],'penalty':_0x4c0744[_0x9375('0x9f')]},{'transaction':_0x275141});});return Promise[_0x9375('0x57')](_0x45bc27);})[_0x9375('0x1e')](function(){return db[_0x9375('0x10c')][_0x9375('0x47')]({'where':{'teamId':{'$in':_0x4976bd}}});})['then'](function(_0x92f689){var _0xd7f06=_[_0x9375('0x2a')](_0x92f689,function(_0x3e10d1){return db[_0x9375('0x10d')][_0x9375('0x7a')]({'UserId':_0x4c0744['id'],'VoicePrefixId':_0x3e10d1[_0x9375('0x10e')]},{'transaction':_0x275141});});return Promise[_0x9375('0x57')](_0xd7f06);});});})['then'](function(){for(var _0x20ef96=0x0;_0x20ef96<_0xb2c44['length'];_0x20ef96++){var _0xede6b0=_0xb2c44[_0x20ef96][_0x9375('0x10a')]('channel');var _0x5d0629=_0xede6b0+_0x9375('0xaa');socket['emit'](_0x9375('0x26')+_0xede6b0+_0x9375('0xa1'),{'UserId':_0x59f8e6,['queueField']:_0xb2c44[_0x20ef96]['id']});}})[_0x9375('0x1e')](respondWithStatusCode(_0x4b9979,null))['catch'](APIHandleError(_0x4b9979));};exports[_0x9375('0x10f')]=function(_0x12e1c3,_0x3f5ef2){var _0x5f50ca=_0x12e1c3[_0x9375('0x51')]['id'];var _0x5b3146=null;if(_0x12e1c3[_0x9375('0x40')]['ids']){_0x5b3146=_['isArray'](_0x12e1c3['query']['ids'])?_0x12e1c3['query'][_0x9375('0x5b')]:[_0x12e1c3[_0x9375('0x40')][_0x9375('0x5b')]];}var _0x563d83=[];return Promise[_0x9375('0xf8')]()[_0x9375('0x1e')](function(){if(!_0x5b3146)throw new APIBadRequestError(_0x9375('0x110'));})[_0x9375('0x1e')](function(){return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x5f50ca}});})[_0x9375('0x1e')](function(_0xb2b10f){if(!_0xb2b10f)throw new APINotFoundError(util[_0x9375('0xa4')]('User\x20with\x20id\x20%s\x20not\x20found',_0x12e1c3[_0x9375('0x51')]['id']));return db[_0x9375('0x63')][_0x9375('0x106')](function(_0x1408f8){return _0xb2b10f[_0x9375('0x10f')](_0x5b3146,{'transaction':_0x1408f8})[_0x9375('0x1e')](function(){return db[_0x9375('0x111')][_0x9375('0x47')]({'where':{'id':{'$in':_0x5b3146}}});})['then'](function(_0x2c487e){var _0x8695dc=_[_0x9375('0x2a')](_0x2c487e,function(_0x2fde91){return _0x2fde91[_0x9375('0x107')]();});return Promise[_0x9375('0x57')](_0x8695dc);})['then'](function(_0x4810ef){_0x563d83=_[_0x9375('0x108')](_0x4810ef);var _0x4e07de=_[_0x9375('0x2a')](_0x563d83,function(_0x585dc3){return _0x585dc3['removeAgent'](_0xb2b10f['id'],{'transaction':_0x1408f8});});return Promise[_0x9375('0x57')](_0x4e07de);})[_0x9375('0x1e')](function(){if(!_0xb2b10f[_0x9375('0x95')])return;var _0x270c76=_['filter'](_0x563d83,function(_0x4ea6a4){return _0x4ea6a4[_0x9375('0x10a')](_0x9375('0x94'))===_0x9375('0x10b');});var _0xb4ddc6=_[_0x9375('0x2a')](_0x270c76,function(_0x4b27ce){return db[_0x9375('0xa5')][_0x9375('0x22')]({'where':{'VoiceQueueId':_0x4b27ce['id'],'UserId':_0xb2b10f['id']},'transaction':_0x1408f8});});return Promise[_0x9375('0x57')](_0xb4ddc6);})['then'](function(){return db[_0x9375('0x10c')][_0x9375('0x47')]({'where':{'teamId':{'$in':_0x5b3146}}});})[_0x9375('0x1e')](function(_0x4684e2){var _0x35df18=_['map'](_0x4684e2,function(_0x27f75f){return db[_0x9375('0x10d')]['destroy']({'where':{'UserId':_0xb2b10f['id'],'VoicePrefixId':_0x27f75f[_0x9375('0x10e')]}},{'transaction':_0x1408f8});});return Promise[_0x9375('0x57')](_0x35df18);});});})[_0x9375('0x1e')](function(){for(var _0x8692ef=0x0;_0x8692ef<_0x563d83['length'];_0x8692ef++){var _0x31856a=_0x563d83[_0x8692ef]['getDataValue'](_0x9375('0x94'));var _0x36e4ea=_0x31856a+_0x9375('0xaa');socket[_0x9375('0x20')]('user'+_0x31856a+_0x9375('0xab'),{'UserId':_0x5f50ca,['queueField']:_0x563d83[_0x8692ef]['id']});}})[_0x9375('0x1e')](respondWithStatusCode(_0x3f5ef2,null))[_0x9375('0x50')](APIHandleError(_0x3f5ef2));};exports['getLists']=function(_0x5daee3,_0x33f9d1){var _0xf178c9={};var _0x27f6fe={};var _0x4065e5;var _0x58a905;return db[_0x9375('0x34')][_0x9375('0x90')]({'where':{'id':_0x5daee3[_0x9375('0x51')]['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x33f9d1,null))[_0x9375('0x1e')](function(_0x261ead){if(_0x261ead){_0x4065e5=_0x261ead;_0x27f6fe[_0x9375('0xc7')]=_[_0x9375('0xc8')](db[_0x9375('0x112')]['rawAttributes']);_0x27f6fe[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x5daee3[_0x9375('0x40')]);_0x27f6fe[_0x9375('0xc9')]=_['intersection'](_0x27f6fe[_0x9375('0xc7')],_0x27f6fe[_0x9375('0x40')]);_0xf178c9[_0x9375('0x46')]=_[_0x9375('0xca')](_0x27f6fe['model'],qs['fields'](_0x5daee3[_0x9375('0x40')][_0x9375('0xcb')]));_0xf178c9[_0x9375('0x46')]=_0xf178c9['attributes'][_0x9375('0x67')]?_0xf178c9[_0x9375('0x46')]:_0x27f6fe[_0x9375('0xc7')];_0xf178c9[_0x9375('0xcc')]=qs[_0x9375('0xcd')](_0x5daee3[_0x9375('0x40')]['sort']);_0xf178c9[_0x9375('0x3f')]=qs['filters'](_[_0x9375('0xce')](_0x5daee3['query'],_0x27f6fe[_0x9375('0xc9')]));if(_0x5daee3['query']['filter']){_0xf178c9[_0x9375('0x3f')]=_['merge'](_0xf178c9['where'],{'$or':_[_0x9375('0x2a')](_0xf178c9[_0x9375('0x46')],function(_0x31e9b9){var _0x462b29={};_0x462b29[_0x31e9b9]={'$like':'%'+_0x5daee3['query']['filter']+'%'};return _0x462b29;})});}_0xf178c9=_[_0x9375('0x53')]({},_0xf178c9,_0x5daee3['options']);return _0x4065e5[_0x9375('0x113')](_0xf178c9);}})['then'](function(_0x112b4a){if(_0x112b4a){_0x58a905=_0x112b4a[_0x9375('0x67')];if(!_0x5daee3[_0x9375('0x40')][_0x9375('0xc0')](_0x9375('0xd1'))){_0xf178c9[_0x9375('0x19')]=qs[_0x9375('0x19')](_0x5daee3[_0x9375('0x40')]['limit']);_0xf178c9[_0x9375('0x17')]=qs[_0x9375('0x17')](_0x5daee3[_0x9375('0x40')][_0x9375('0x17')]);}return _0x4065e5[_0x9375('0x113')](_0xf178c9);}})['then'](function(_0x551d5a){if(_0x551d5a){return _0x551d5a?{'count':_0x58a905,'rows':_0x551d5a}:null;}})[_0x9375('0x1e')](respondWithResult(_0x33f9d1,null))[_0x9375('0x50')](handleError(_0x33f9d1,null));};exports[_0x9375('0x114')]=function(_0x4535f1,_0x278979){var _0x5c6883={};var _0x598567={};var _0x3163ac;return db[_0x9375('0x34')]['findOne']({'where':{'id':_0x4535f1['params']['id']}})[_0x9375('0x1e')](handleEntityNotFound(_0x278979,null))[_0x9375('0x1e')](function(_0xd04765){if(_0xd04765){_0x3163ac=_0xd04765;_0x598567[_0x9375('0xc7')]=_['keys'](db[_0x9375('0x34')][_0x9375('0x35')]);_0x598567[_0x9375('0x40')]=_[_0x9375('0xc8')](_0x4535f1[_0x9375('0x40')]);_0x598567[_0x9375('0xc9')]=_['intersection'](_0x598567[_0x9375('0xc7')],_0x598567[_0x9375('0x40')]);_0x5c6883[_0x9375('0x46')]=_[_0x9375('0xca')](_0x598567[_0x9375('0xc7')],qs[_0x9375('0xcb')](_0x4535f1[_0x9375('0x40')][_0x9375('0xcb')]));_0x5c6883['attributes']=_0x5c6883[_0x9375('0x46')][_0x9375('0x67')]?_0x5c6883['attributes']:_0x598567['model'];_0x5c6883[_0x9375('0xcc')]=qs[_0x9375('0xcd')](_0x4535f1[_0x9375('0x40')][_0x9375('0xcd')]);_0x5c6883[_0x9375('0x3f')]=qs[_0x9375('0xc9')](_[_0x9375('0xce')](_0x4535f1[_0x9375('0x40')],_0x598567['filters']));if(_0x4535f1[_0x9375('0x40')]['filter']){_0x5c6883[_0x9375('0x3f')]=_['merge'](_0x5c6883[_0x9375('0x3f')],{'$or':_['map'](_0x5c6883[_0x9375('0x46')],function(_0x5d743d){var _0x4cc50d={};_0x4cc50d[_0x5d743d]={'$like':'%'+_0x4535f1[_0x9375('0x40')]['filter']+'%'};return _0x4cc50d;})});}_0x5c6883[_0x9375('0xc7')]=db['User'];_0x5c6883['as']=_0x9375('0x27');_0x5c6883=_['merge']({},_0x5c6883,_0x4535f1['options']);return _0x3163ac['getVoiceQueues']({'include':[_0x5c6883]});}})[_0x9375('0x1e')](function(_0x2b9f79){if(_0x2b9f79){var _0x2e2953={},_0x41fcff=[];for(var _0x486bff=0x0;_0x486bff<_0x2b9f79[_0x9375('0x67')];_0x486bff+=0x1){for(var _0x14e3d8=0x0,_0x5cc5e0;_0x14e3d8<_0x2b9f79[_0x486bff]['Agents'][_0x9375('0x67')];_0x14e3d8+=0x1){_0x5cc5e0=_0x2b9f79[_0x486bff][_0x9375('0x27')][_0x14e3d8]['get']({'plain':!![]});_0x2e2953[_0x5cc5e0['id']]=_0x5cc5e0;}}_0x2e2953=_[_0x9375('0x115')](_0x2e2953);for(var _0x4850e6=qs[_0x9375('0x17')](_0x4535f1[_0x9375('0x40')]['offset']);_0x4850e6<_0x2e2953[_0x9375('0x67')]&&_0x41fcff[_0x9375('0x67')]=_0x141c72){_0x5c9cd4=_0x141c72;_0x53f99e=0xc8;}else{_0x53f99e=0xce;}_0x539903[_0xa4f5('0x19')](_0x53f99e);return _0x539903[_0xa4f5('0x1a')](_0xa4f5('0x1b'),_0x2ffaac+'-'+_0x5c9cd4+'/'+_0x141c72)[_0xa4f5('0x14')](_0x54ac8a);}return null;};}function saveUpdates(_0xbca1f7){return function(_0x232780){if(_0x232780){return _0x232780['update'](_0xbca1f7)[_0xa4f5('0x1c')](function(_0x3de8b0){if(_0x3de8b0[_0xa4f5('0x1d')]===_0xa4f5('0x1e')){socket[_0xa4f5('0x1f')](_0xa4f5('0x20')+_0x3de8b0['id'],_0x3de8b0);}return _0x3de8b0;});}return null;};}function removeEntity(_0x1d43c6){return function(_0xaad0e5){if(_0xaad0e5){return _0xaad0e5['destroy']()['then'](function(){var _0x4ebebc=_0xaad0e5['get']({'plain':!![]});if(_0x4ebebc[_0xa4f5('0x1d')]===_0xa4f5('0x21'))return;var _0xebd12e=[{'name':_0xa4f5('0x22'),'value':_0xa4f5('0x23'),'ignore':!![]},{'name':_0xa4f5('0x24'),'value':_0xa4f5('0x1e'),'ignore':![]},{'name':'Telephones','value':_0xa4f5('0x25'),'ignore':![]}];var _0x5e9720=_(_0xebd12e)['filter']('ignore')['map'](_0xa4f5('0x26'))[_0xa4f5('0x26')]();if(_[_0xa4f5('0x27')](_0x5e9720,_0x4ebebc['role'])){return;}var _0x400f03=_[_0xa4f5('0x28')](_0xebd12e,[_0xa4f5('0x26'),_0x4ebebc['role']])[_0xa4f5('0x29')];return db[_0xa4f5('0x2a')][_0xa4f5('0x2b')]({'where':{'type':_0x400f03,'resourceId':_0x4ebebc['id']}})[_0xa4f5('0x1c')](function(){return _0xaad0e5;});})[_0xa4f5('0x1c')](function(){_0x1d43c6[_0xa4f5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e8cf9){return function(_0x21ed37){if(!_0x21ed37){_0x2e8cf9[_0xa4f5('0x2c')](0x194);}return _0x21ed37;};}function handleError(_0x3f8393,_0x206b0a){_0x206b0a=_0x206b0a||0x1f4;return function(_0x22dc21){logger[_0xa4f5('0x2d')](_0x22dc21['stack']);if(_0x22dc21[_0xa4f5('0x29')]){delete _0x22dc21['name'];}_0x3f8393[_0xa4f5('0x19')](_0x206b0a)[_0xa4f5('0x2e')](_0x22dc21);};}function getUserAttributes(){return _(db[_0xa4f5('0x2f')][_0xa4f5('0x30')])[_0xa4f5('0x31')](function(_0x2aa4c2){return{'name':_0x2aa4c2['fieldName'],'type':_0x2aa4c2['type'][_0xa4f5('0x32')]};})['filter'](function(_0x408a7b){return![_0xa4f5('0x33'),_0xa4f5('0x34'),_0xa4f5('0x35'),_0xa4f5('0x36'),'resetPasswordExpires',_0xa4f5('0x37')]['includes'](_0x408a7b[_0xa4f5('0x29')]);})['value']();}exports[_0xa4f5('0x38')]=function(_0x2464ac,_0x2afd7c){var _0x17d935={},_0x9a760b={'count':0x0,'rows':[]};var _0x17ca38=getUserAttributes();_0x17d935=qs[_0xa4f5('0x39')](_0x17ca38,_0x2464ac);var _0x1092f6={'where':_0x17d935['where']};return db[_0xa4f5('0x2f')][_0xa4f5('0x17')](_0x1092f6)['then'](function(_0x4f7780){_0x9a760b[_0xa4f5('0x17')]=_0x4f7780;if(_0x2464ac[_0xa4f5('0x3a')]['includeAll']){_0x17d935[_0xa4f5('0x3b')]=[{'all':!![]}];}if(_0x2464ac[_0xa4f5('0x3a')][_0xa4f5('0x3c')]===_0xa4f5('0x3d')){_0x17d935[_0xa4f5('0x3b')]=[{'model':db[_0xa4f5('0x3e')],'as':'userSetting'}];}if(!_[_0xa4f5('0x27')](_0x17d935[_0xa4f5('0x3f')],'id')){_0x17d935['attributes'][_0xa4f5('0x40')]('id');}return db['User'][_0xa4f5('0x41')](_0x17d935);})[_0xa4f5('0x1c')](function(_0x27ca0){_0x9a760b[_0xa4f5('0x42')]=_0x27ca0;if(_0x2464ac[_0xa4f5('0x3a')][_0xa4f5('0x43')]===_0xa4f5('0x3d')){var _0x27912b=[];for(var _0x2843e5=0x0;_0x2843e5<_0x9a760b['rows'][_0xa4f5('0x44')];_0x2843e5++){_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x45'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b['push'](get_open_tabs(_0xa4f5('0x47'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b[_0xa4f5('0x40')](get_open_tabs('fax',_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x48'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5]['dataValues']));_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x49'),_0x9a760b[_0xa4f5('0x42')][_0x2843e5][_0xa4f5('0x46')]));_0x27912b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x4a'),_0x9a760b['rows'][_0x2843e5][_0xa4f5('0x46')]));}return Promise[_0xa4f5('0x4b')](_0x27912b)[_0xa4f5('0x1c')](function(){return _0x9a760b;});}else{return _0x9a760b;}})[_0xa4f5('0x1c')](respondWithFilteredResult(_0x2afd7c,_0x17d935))[_0xa4f5('0x4c')](handleError(_0x2afd7c,null));};exports[_0xa4f5('0x4d')]=function(_0x444ef8,_0x1f8e47){var _0x3d8255=getUserAttributes();_0x444ef8[_0xa4f5('0x3a')]['id']=_0x444ef8[_0xa4f5('0x4e')]['id'];var _0x157ecf=qs[_0xa4f5('0x39')](_0x3d8255,_0x444ef8);if(_0x444ef8[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x157ecf[_0xa4f5('0x3b')]=[{'all':!![]}];}if(_0x444ef8[_0xa4f5('0x3a')][_0xa4f5('0x3c')]===_0xa4f5('0x3d')){_0x157ecf[_0xa4f5('0x3b')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x157ecf=_[_0xa4f5('0x50')]({},_0x157ecf,_0x444ef8[_0xa4f5('0x51')]);if(!_[_0xa4f5('0x27')](_0x157ecf[_0xa4f5('0x3f')],'id')){_0x157ecf[_0xa4f5('0x3f')][_0xa4f5('0x40')]('id');}return db['User'][_0xa4f5('0x28')](_0x157ecf)['then'](handleEntityNotFound(_0x1f8e47,null))['then'](function(_0x36af2c){var _0x58b7c4=[];values=_0x36af2c;if(_0x444ef8['query'][_0xa4f5('0x43')]===_0xa4f5('0x3d')){_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x45'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4['push'](get_open_tabs(_0xa4f5('0x47'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x49'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x4a'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x52'),_0x36af2c[_0xa4f5('0x46')]));_0x58b7c4[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x48'),_0x36af2c[_0xa4f5('0x46')]));return Promise[_0xa4f5('0x4b')](_0x58b7c4);}else{return values;}})['then'](function(){return values;})[_0xa4f5('0x1c')](respondWithResult(_0x1f8e47,null))['catch'](handleError(_0x1f8e47,null));};exports[_0xa4f5('0x53')]=function(_0x5970f4,_0x570aea){if(_0x5970f4[_0xa4f5('0x54')]['id']){delete _0x5970f4[_0xa4f5('0x54')]['id'];}delete _0x5970f4[_0xa4f5('0x54')][_0xa4f5('0x1d')];return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x5970f4[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x570aea,null))['then'](saveUpdates(_0x5970f4[_0xa4f5('0x54')],null))[_0xa4f5('0x1c')](respondWithResult(_0x570aea,null))[_0xa4f5('0x4c')](handleError(_0x570aea,null));};exports[_0xa4f5('0x55')]=function(_0x445961,_0x12c103){return db['User'][_0xa4f5('0x55')]()[_0xa4f5('0x1c')](respondWithResult(_0x12c103,null))[_0xa4f5('0x4c')](handleError(_0x12c103,null));};exports[_0xa4f5('0x56')]=function(_0x2125a8,_0x209149){return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x2125a8[_0xa4f5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x209149,null))[_0xa4f5('0x1c')](function(_0x43fa9d){if(_0x43fa9d){return _0x43fa9d[_0xa4f5('0x56')](_0x2125a8['body']['ids'],_[_0xa4f5('0x57')](_0x2125a8['body'],[_0xa4f5('0x58'),'id'])||{});}})[_0xa4f5('0x1c')](respondWithResult(_0x209149,null))[_0xa4f5('0x4c')](handleError(_0x209149,null));};function validateUser(_0x42a42e){return new Promise(function(_0x40a605,_0x52ae8e){if(_0x42a42e['internal'])return _0x40a605(_0x42a42e);return db[_0xa4f5('0x59')]['findById'](0x1)[_0xa4f5('0x1c')](function(_0x36b3a7){if(_0x36b3a7['securePassword'])authService[_0xa4f5('0x5a')](_0x42a42e[_0xa4f5('0x33')]);db[_0xa4f5('0x2f')][_0xa4f5('0x5b')](_0xa4f5('0x5c'))[_0xa4f5('0x1c')](function(_0x26a86b){if(_['isNil'](_0x26a86b)){_0x42a42e['internal']=_0x36b3a7[_0xa4f5('0x5d')]||0x1;return;}if(_[_0xa4f5('0x5e')](_0x36b3a7[_0xa4f5('0x5d')])||_0x36b3a7[_0xa4f5('0x5d')]===_0x26a86b){_0x42a42e[_0xa4f5('0x5c')]=_0x26a86b+0x1;return;}if(_0x36b3a7[_0xa4f5('0x5d')]>_0x26a86b){_0x42a42e['internal']=_0x36b3a7[_0xa4f5('0x5d')];return;}return db[_0xa4f5('0x5f')][_0xa4f5('0x3a')](_0xa4f5('0x60'),{'type':db[_0xa4f5('0x5f')][_0xa4f5('0x61')]['SELECT']})['then'](function(_0x39ae23){if(_0x39ae23&&_0x39ae23[_0xa4f5('0x44')]){for(var _0x225794=0x0,_0x683bf0=_0x39ae23['length'];_0x225794<_0x683bf0&&_['isNil'](_0x42a42e[_0xa4f5('0x5c')]);_0x225794++){if(_0x36b3a7['min_internal']<=_0x39ae23[_0x225794][_0xa4f5('0x62')]){_0x42a42e['internal']=_0x39ae23[_0x225794][_0xa4f5('0x62')];}else if(_0x36b3a7[_0xa4f5('0x5d')]>_0x39ae23[_0x225794][_0xa4f5('0x62')]&&_0x36b3a7[_0xa4f5('0x5d')]<=_0x39ae23[_0x225794]['to']){_0x42a42e[_0xa4f5('0x5c')]=_0x36b3a7[_0xa4f5('0x5d')];}}}if(_[_0xa4f5('0x5e')](_0x42a42e['internal'])){_0x42a42e['internal']=_0x26a86b+0x1;}return _0x40a605(_0x42a42e);});});})['catch'](function(_0x438150){_0x52ae8e(_0x438150);});});}function updateUser(_0x23a55e){return new Promise(function(_0x3f828c,_0x2b611d){try{if(_0x23a55e[_0xa4f5('0x63')]){_0x23a55e[_0xa4f5('0x64')]=_0x23a55e[_0xa4f5('0x5c')];_0x23a55e[_0xa4f5('0x65')]={'mailbox':_0x23a55e['internal'],'password':_0x23a55e[_0xa4f5('0x33')],'fullname':_0x23a55e['fullname'],'email':_0x23a55e['email']};}if(_0x23a55e[_0xa4f5('0x1d')]===_0xa4f5('0x1e')){if(!_0x23a55e['permissions'])_0x23a55e['permissions']=[_0xa4f5('0x66'),_0xa4f5('0x67'),_0xa4f5('0x68'),_0xa4f5('0x69'),_0xa4f5('0x6a'),_0xa4f5('0x6b'),_0xa4f5('0x6c'),'106',_0xa4f5('0x6d'),_0xa4f5('0x6e'),'109',_0xa4f5('0x6f'),_0xa4f5('0x70'),_0xa4f5('0x71'),_0xa4f5('0x72')];}_0x3f828c(_0x23a55e);}catch(_0x43db48){_0x2b611d(_0x43db48);}});}exports[_0xa4f5('0x73')]=function(_0x74cd9f,_0x1a4595){if(_0x74cd9f[_0xa4f5('0x23')]['role']===_0xa4f5('0x1e'))throw new Error(_0xa4f5('0x74'));if(_0x74cd9f[_0xa4f5('0x54')][_0xa4f5('0x1d')]===_0xa4f5('0x23')&&_0x74cd9f['user'][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x74cd9f['body'][_0xa4f5('0x1d')]===_0xa4f5('0x21')&&_0x74cd9f[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error(_0xa4f5('0x75'));}return licenseUtil[_0xa4f5('0x76')]([_0x74cd9f[_0xa4f5('0x54')]])[_0xa4f5('0x1c')](function(){return validateUser(_0x74cd9f[_0xa4f5('0x54')]);})[_0xa4f5('0x1c')](function(_0x4dff83){return updateUser(_0x4dff83)[_0xa4f5('0x1c')](function(_0x13eaac){if(_0x13eaac[_0xa4f5('0x1d')]===_0xa4f5('0x21')){_0x13eaac['settingsEnabled']=_0x74cd9f[_0xa4f5('0x23')]['settingsEnabled'];delete _0x13eaac['userProfileId'];}return _0x13eaac;});})[_0xa4f5('0x1c')](function(_0x33a2f2){return db['User'][_0xa4f5('0x73')](_0x33a2f2,{'include':[{'model':db[_0xa4f5('0x65')],'as':_0xa4f5('0x65')}]});})['then'](function(_0x2fdb83){if(_0x74cd9f[_0xa4f5('0x54')][_0xa4f5('0x1d')]==='user')return _0x2fdb83;if(_0x74cd9f[_0xa4f5('0x23')]['role']!==_0xa4f5('0x23'))return _0x2fdb83;return db[_0xa4f5('0x77')][_0xa4f5('0x28')]({'where':{'name':_0x2fdb83[_0xa4f5('0x1d')]===_0xa4f5('0x1e')?_0xa4f5('0x24'):_0xa4f5('0x78'),'userProfileId':_0x74cd9f[_0xa4f5('0x23')][_0xa4f5('0x79')]},'raw':!![]})[_0xa4f5('0x1c')](function(_0x1c7a80){if(!_0x1c7a80||_0x1c7a80[_0xa4f5('0x7a')]!=0x0)return _0x2fdb83;return db[_0xa4f5('0x2a')][_0xa4f5('0x73')]({'name':_0x2fdb83[_0xa4f5('0x29')],'resourceId':_0x2fdb83['id'],'type':_0x1c7a80[_0xa4f5('0x29')],'sectionId':_0x1c7a80['id']},{})['then'](function(){return _0x2fdb83;});})[_0xa4f5('0x4c')](function(_0x1b88c0){logger[_0xa4f5('0x2d')](_0xa4f5('0x7b'),_0x1b88c0);throw _0x1b88c0;});})[_0xa4f5('0x1c')](respondWithResult(_0x1a4595,0xc9))['catch'](handleError(_0x1a4595,null));};exports['bulkCreate']=function(_0xef06c5,_0x44664f){var _0x5476ad=_0xef06c5[_0xa4f5('0x54')];var _0x5f49b7=[];if(_0xef06c5[_0xa4f5('0x23')]['role']===_0xa4f5('0x1e'))throw new Error(_0xa4f5('0x74'));if(_[_0xa4f5('0x7c')](_0x5476ad,[_0xa4f5('0x1d'),_0xa4f5('0x23')])&&_0xef06c5[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x5476ad,[_0xa4f5('0x1d'),_0xa4f5('0x21')])&&_0xef06c5[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x21')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xa4f5('0x76')](_0x5476ad)[_0xa4f5('0x1c')](function(){return validateUser(_0x5476ad[0x0]);})[_0xa4f5('0x1c')](function(){for(var _0x22c503=0x1;_0x22c503<_0x5476ad[_0xa4f5('0x44')];_0x22c503++){var _0x284cc7=_0x5476ad[_0x22c503-0x1][_0xa4f5('0x5c')];if(!_0x5476ad[_0x22c503]['internal'])_0x5476ad[_0x22c503][_0xa4f5('0x5c')]=_0x284cc7+0x1;_0x5f49b7[_0xa4f5('0x40')](validateUser(_0x5476ad[_0x22c503]));}return Promise[_0xa4f5('0x4b')](_0x5f49b7);})[_0xa4f5('0x1c')](function(){_0x5f49b7=[];for(var _0x2fce37=0x0;_0x2fce37<_0x5476ad['length'];_0x2fce37++){_0x5f49b7[_0xa4f5('0x40')](updateUser(_0x5476ad[_0x2fce37]));}return Promise[_0xa4f5('0x4b')](_0x5f49b7);})[_0xa4f5('0x1c')](function(){_0x5f49b7=_0x5476ad[_0xa4f5('0x31')](function(_0x18e52c){return db['User'][_0xa4f5('0x73')](_0x18e52c,{'include':[{'model':db[_0xa4f5('0x65')],'as':_0xa4f5('0x65')}]})['then'](function(_0x28e08c){_0x18e52c['id']=_0x28e08c['id'];return _0x18e52c;});});return Promise[_0xa4f5('0x4b')](_0x5f49b7);})[_0xa4f5('0x1c')](function(_0x457037){if(_0xef06c5['body'][_0xa4f5('0x1d')]==='user')return _0x457037;if(_0xef06c5[_0xa4f5('0x23')][_0xa4f5('0x1d')]!==_0xa4f5('0x23'))return _0x457037;var _0x4bf2e6=_['some'](_0x457037,function(_0x146a87){return _0x146a87[_0xa4f5('0x1d')]===_0xa4f5('0x1e')||_0x146a87[_0xa4f5('0x1d')]==='telephone';});if(!_0x4bf2e6)return _0x457037;return db[_0xa4f5('0x77')]['findAll']({'where':{'name':{'$or':[_0xa4f5('0x24'),_0xa4f5('0x78')]},'userProfileId':_0xef06c5[_0xa4f5('0x23')]['userProfileId']},'raw':!![]})[_0xa4f5('0x1c')](function(_0x5cee2d){if(_[_0xa4f5('0x7d')](_0x5cee2d)||!_['some'](_0x5cee2d,[_0xa4f5('0x7a'),0x0]))return _0x457037;_0x5f49b7=[];var _0x456d79=_(_0x5cee2d)[_0xa4f5('0x31')](function(_0x205578){if(_0x205578[_0xa4f5('0x7a')]===0x1)return;return _0x205578[_0xa4f5('0x29')]===_0xa4f5('0x24')?_0xa4f5('0x1e'):'telephone';})[_0xa4f5('0x7e')]()[_0xa4f5('0x26')]();for(var _0x14c488=0x0;_0x14c488<_0x457037[_0xa4f5('0x44')];_0x14c488++){if(!_[_0xa4f5('0x27')](_0x456d79,_0x457037[_0x14c488][_0xa4f5('0x1d')]))return;var _0x10a135=_0x457037[_0x14c488][_0xa4f5('0x1d')]===_0xa4f5('0x1e')?_0xa4f5('0x24'):_0xa4f5('0x78');_0x5f49b7['push'](db[_0xa4f5('0x2a')][_0xa4f5('0x73')]({'name':_0x457037[_0x14c488][_0xa4f5('0x29')],'resourceId':_0x457037[_0x14c488]['id'],'type':_0x10a135,'sectionId':_[_0xa4f5('0x28')](_0x5cee2d,[_0xa4f5('0x29'),_0x10a135])['id']},{}));}return Promise[_0xa4f5('0x4b')](_0x5f49b7);});})[_0xa4f5('0x1c')](respondWithResult(_0x44664f,0xc9))[_0xa4f5('0x4c')](handleError(_0x44664f,null));};exports[_0xa4f5('0x7f')]=function(_0x172251,_0x1378a7){if(_0x172251[_0xa4f5('0x54')]['id']){delete _0x172251[_0xa4f5('0x54')]['id'];}return db['User']['find']({'where':{'id':_0x172251['params']['id']}})[_0xa4f5('0x1c')](function(_0x306a32){if(!_0x306a32)return null;if(_0x306a32['id']===_0x172251[_0xa4f5('0x23')]['id']){if(!_0x172251['body'][_0xa4f5('0x80')]||!_0x172251[_0xa4f5('0x54')][_0xa4f5('0x81')]){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))](_0xa4f5('0x84'));}if(!_0x306a32[_0xa4f5('0x85')](_0x172251[_0xa4f5('0x54')][_0xa4f5('0x80')])){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x86'));}if(_0x172251[_0xa4f5('0x54')][_0xa4f5('0x80')]===_0x172251['body'][_0xa4f5('0x81')]){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))](_0xa4f5('0x87'));}}else if(_0x172251[_0xa4f5('0x23')]['role']===_0xa4f5('0x21')){if(!_0x172251[_0xa4f5('0x54')]['newPassword']){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x88'));}}else if(_0x172251['user']['role']==='user'){if(!_0x172251['body'][_0xa4f5('0x81')]){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x306a32[_0xa4f5('0x1d')]!=='agent'){throw new db['Sequelize'][(_0xa4f5('0x83'))]('Unauthorized');}}else{throw new db[(_0xa4f5('0x82'))]['ValidationError'](_0xa4f5('0x74'));}return _0x306a32;})[_0xa4f5('0x1c')](handleEntityNotFound(_0x1378a7,null))['then'](function(_0x4d6ee0){return db[_0xa4f5('0x59')][_0xa4f5('0x89')]({'attributes':['id',_0xa4f5('0x8a'),_0xa4f5('0x8b'),'passwordHistoryLimit']})[_0xa4f5('0x1c')](function(_0x1aba9a){if(_0x1aba9a[_0xa4f5('0x8a')])authService[_0xa4f5('0x5a')](_0x172251[_0xa4f5('0x54')][_0xa4f5('0x81')]);if(!_0x1aba9a[_0xa4f5('0x8b')]||!_0x4d6ee0[_0xa4f5('0x35')])return _0x4d6ee0;authService['validatePasswordHistory'](_0x172251['body']['newPassword'],_0x4d6ee0[_0xa4f5('0x35')],_0x1aba9a[_0xa4f5('0x8c')]);return _0x4d6ee0;})['then'](saveUpdates({'password':_0x172251[_0xa4f5('0x54')]['newPassword'],'passwordResetAt':_0x172251['user']['id']==_0x172251['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x172251[_0xa4f5('0x54')]['newPassword'],_0x4d6ee0['previousPasswords'])},null));})[_0xa4f5('0x1c')](respondWithResult(_0x1378a7,null))[_0xa4f5('0x4c')](handleError(_0x1378a7,null));};exports[_0xa4f5('0x8d')]=function(_0xc10065,_0x10890e){var _0x33bd2f=_0xc10065[_0xa4f5('0x54')]['channel'];return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0xc10065[_0xa4f5('0x4e')]['id']},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0x1d'),_0xa4f5('0x8e'),_0xa4f5('0x8f'),_0xa4f5('0x90'),_0xa4f5('0x91')]})['then'](handleEntityNotFound(_0x10890e,null))[_0xa4f5('0x1c')](function(_0x41d274){if(_0x41d274){if(!utils[_0xa4f5('0x92')](_0x33bd2f)){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x93'));}return _0x41d274[_0xa4f5('0x94')+_['capitalize'](_0x33bd2f[_0xa4f5('0x95')]())+_0xa4f5('0x96')](_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x58')],{'penalty':_0xc10065['body'][_0xa4f5('0x97')]||0x0})['spread'](function(_0x25ea38){for(var _0x3ceb38=0x0;_0x3ceb38<_0xc10065[_0xa4f5('0x54')]['ids']['length'];_0x3ceb38+=0x1){var _0x445c82={'UserId':Number(_0xc10065[_0xa4f5('0x4e')]['id'])};_0x445c82[_[_0xa4f5('0x98')](_0x33bd2f['toLowerCase']())+_0xa4f5('0x99')]=Number(_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x58')][_0x3ceb38]);socket[_0xa4f5('0x1f')]('user'+_[_0xa4f5('0x98')](_0x33bd2f['toLowerCase']())+'Queue:save',_0x445c82);}return _0x25ea38;})[_0xa4f5('0x1c')](function(){if(_0x33bd2f==='voice'){return db[_0xa4f5('0x9a')][_0xa4f5('0x41')]({'where':{'id':_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x58')]||[]},'raw':!![],'attributes':['id',_0xa4f5('0x29')]});}})[_0xa4f5('0x1c')](function(_0x1caa2d){var _0xdff0b9=_0x41d274[_0xa4f5('0x9b')]({'plain':!![]});var _0x249306=[];if(_0x33bd2f===_0xa4f5('0x9c')&&_0xdff0b9[_0xa4f5('0x1d')]===_0xa4f5('0x1e')&&_0xdff0b9[_0xa4f5('0x8e')]){for(let _0x1a343f=0x0;_0x1a343f<_0x1caa2d['length'];_0x1a343f+=0x1){_0x249306[_0xa4f5('0x40')]({'membername':_0xdff0b9['name'],'UserId':_0xdff0b9['id'],'queue_name':_0x1caa2d[_0x1a343f][_0xa4f5('0x29')],'VoiceQueueId':_0x1caa2d[_0x1a343f]['id'],'interface':_[_0xa4f5('0x5e')](_0xdff0b9[_0xa4f5('0x91')])?util[_0xa4f5('0x9d')](_0xa4f5('0x9e'),_0xdff0b9['name']):_0xdff0b9['interface'],'paused':_0xdff0b9[_0xa4f5('0x90')]||![],'penalty':_0xc10065[_0xa4f5('0x54')][_0xa4f5('0x97')]||0x0});}return Promise[_0xa4f5('0x4b')](_0x249306['map'](function(_0x1f1cc7){return db['UserVoiceQueueRt'][_0xa4f5('0x9f')](_0x1f1cc7);}));}return _0x41d274;});}})[_0xa4f5('0x1c')](respondWithStatusCode(_0x10890e,null))[_0xa4f5('0x4c')](handleError(_0x10890e,null));};exports[_0xa4f5('0xa0')]=function(_0x2434dc,_0x30df6e){var _0x2f7f79,_0x5ac260;return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x2434dc[_0xa4f5('0x4e')]['id']},'attributes':['id','name',_0xa4f5('0x1d')]})['then'](handleEntityNotFound(_0x30df6e,null))[_0xa4f5('0x1c')](function(_0x2d374c){if(_0x2d374c){_0x2f7f79=_0x2d374c;if(!_0x2434dc[_0xa4f5('0x3a')]['channel']||!utils[_0xa4f5('0x92')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')])){throw new db['Sequelize'][(_0xa4f5('0x83'))](_0xa4f5('0x93'));}return _0x2d374c[_0xa4f5('0xa2')+_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0x96')](_0x2434dc['query'][_0xa4f5('0x58')]);}})[_0xa4f5('0x1c')](function(_0x4ba30b){if(_[_0xa4f5('0xa3')](_0x2434dc['query'][_0xa4f5('0x58')])){for(var _0x40ac07=0x0;_0x40ac07<_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0x58')][_0xa4f5('0x44')];_0x40ac07+=0x1){_0x5ac260={'UserId':Number(_0x2434dc[_0xa4f5('0x4e')]['id'])};_0x5ac260[_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')]['channel'][_0xa4f5('0x95')]())+_0xa4f5('0x99')]=Number(_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0x58')][_0x40ac07]);socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0xa4'),_0x5ac260);}}else{_0x5ac260={'UserId':Number(_0x2434dc[_0xa4f5('0x4e')]['id'])};_0x5ac260[_['capitalize'](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0x99')]=Number(_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0x58')]);socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_[_0xa4f5('0x98')](_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')][_0xa4f5('0x95')]())+_0xa4f5('0xa4'),_0x5ac260);}return _0x4ba30b;})['then'](function(){if(_0x2434dc[_0xa4f5('0x3a')][_0xa4f5('0xa1')]===_0xa4f5('0x9c')){return db[_0xa4f5('0xa5')]['destroy']({'where':{'UserId':_0x2434dc[_0xa4f5('0x4e')]['id'],'VoiceQueueId':_0x2434dc['query'][_0xa4f5('0x58')]},'individualHooks':!![]})[_0xa4f5('0x1c')](function(){return _0x2f7f79;});}return _0x2f7f79;})['then'](respondWithStatusCode(_0x30df6e,null))[_0xa4f5('0x4c')](handleError(_0x30df6e,null));};exports[_0xa4f5('0xa6')]=function(_0x4515f7,_0x532fd9){_0x4515f7[_0xa4f5('0x54')][_0xa4f5('0xa7')]=_0x4515f7[_0xa4f5('0xa8')][_0xa4f5('0xa9')];return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x4515f7[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x532fd9,null))[_0xa4f5('0x1c')](saveUpdates(_0x4515f7[_0xa4f5('0x54')],null))[_0xa4f5('0x1c')](respondWithResult(_0x532fd9,null))[_0xa4f5('0x4c')](handleError(_0x532fd9,null));};exports[_0xa4f5('0xaa')]=function(_0x582322,_0x248c84){var _0x60aea0=path['join'](config[_0xa4f5('0xab')],_0xa4f5('0xac'));return db['User'][_0xa4f5('0x28')]({'where':{'id':_0x582322[_0xa4f5('0x4e')]['id']},'attributes':['id',_0xa4f5('0xa7')],'raw':!![]})['then'](handleEntityNotFound(_0x248c84,null))[_0xa4f5('0x1c')](function(_0x2af19b){if(_0x2af19b){if(_[_0xa4f5('0x5e')](_0x2af19b[_0xa4f5('0xa7')])){return _0x248c84[_0xa4f5('0xad')](_0x60aea0);}else{if(!fs[_0xa4f5('0xae')](path[_0xa4f5('0xaf')](config[_0xa4f5('0xab')],_0xa4f5('0xb0'),_0x2af19b[_0xa4f5('0xa7')]))){return _0x248c84[_0xa4f5('0xad')](_0x60aea0);}return _0x248c84[_0xa4f5('0xad')](path['join'](config[_0xa4f5('0xab')],_0xa4f5('0xb0'),_0x2af19b[_0xa4f5('0xa7')]));}}})['catch'](handleError(_0x248c84,null));};exports[_0xa4f5('0xb1')]=function(_0x50d3d1,_0x43952e){return db['User'][_0xa4f5('0x28')]({'where':{'id':_0x50d3d1[_0xa4f5('0x4e')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x43952e,null))[_0xa4f5('0x1c')](function(_0x341239){var _0x510d0b=[];values=_0x341239[_0xa4f5('0x46')];_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x45'),_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x47'),_0x341239['dataValues']));_0x510d0b['push'](get_open_tabs('openchannel',_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x4a'),_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs('fax',_0x341239[_0xa4f5('0x46')]));_0x510d0b[_0xa4f5('0x40')](get_open_tabs(_0xa4f5('0x48'),_0x341239['dataValues']));return Promise[_0xa4f5('0x4b')](_0x510d0b);})[_0xa4f5('0x1c')](function(_0x34fa9f){if(_0x34fa9f){var _0x30b3f9=_['map'](values['ChatOpenTabs'],function(_0x13fa49){return{'channel':_0xa4f5('0xb2'),'id':_0x13fa49['id'],'createdAt':_0x13fa49[_0xa4f5('0xb3')]};});var _0x3f45bc=_[_0xa4f5('0x31')](values['FaxOpenTabs'],function(_0x57e3e5){return{'channel':'FAX','id':_0x57e3e5['id'],'createdAt':_0x57e3e5[_0xa4f5('0xb3')]};});var _0x4da081=_['map'](values[_0xa4f5('0xb4')],function(_0x5aeaef){return{'channel':_0xa4f5('0xb5'),'id':_0x5aeaef['id'],'createdAt':_0x5aeaef['createdAt']};});var _0x525c0e=_[_0xa4f5('0x31')](values['MailOpenTabs'],function(_0x41233b){return{'channel':_0xa4f5('0xb6'),'id':_0x41233b['id'],'createdAt':_0x41233b['createdAt']};});var _0x4bf931=_[_0xa4f5('0x31')](values['SmsOpenTabs'],function(_0x3daec2){return{'channel':_0xa4f5('0xb7'),'id':_0x3daec2['id'],'createdAt':_0x3daec2[_0xa4f5('0xb3')]};});var _0x3ef976=_[_0xa4f5('0x31')](values['WhatsappOpenTabs'],function(_0x5dfd9d){return{'channel':_0xa4f5('0xb8'),'id':_0x5dfd9d['id'],'createdAt':_0x5dfd9d[_0xa4f5('0xb3')]};});var _0x29252c=_[_0xa4f5('0xb9')](_0x30b3f9,_0x3f45bc,_0x4da081,_0x525c0e,_0x4bf931,_0x3ef976);var _0x889c68={'count':_0x29252c[_0xa4f5('0x44')],'rows':_0x29252c};return _0x889c68;}else return null;})[_0xa4f5('0x1c')](respondWithResult(_0x43952e,null))[_0xa4f5('0x4c')](handleError(_0x43952e,null));};exports['getContacts']=function(_0x33ef08,_0xe8f0b6){var _0x372a40={};return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x33ef08[_0xa4f5('0x4e')]['id']}})['then'](function(_0x4e9fe0){if(!_0x4e9fe0){throw new APINotFoundError(util[_0xa4f5('0x9d')](_0xa4f5('0xba'),_0x33ef08[_0xa4f5('0x4e')]['id']));}return contacts[_0xa4f5('0x55')]();})[_0xa4f5('0x1c')](function(_0x424749){_0x33ef08[_0xa4f5('0x3a')][_0xa4f5('0x2f')]=_0x33ef08[_0xa4f5('0x4e')]['id'];_0x372a40=qs[_0xa4f5('0x39')](_0x424749,_0x33ef08);if(_0x33ef08[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0x4f'))){_0x372a40[_0xa4f5('0x3b')]=[{'model':db[_0xa4f5('0xbc')],'as':'List','required':![]},{'model':db['Tag'],'as':_0xa4f5('0xbd'),'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0xbe')],'where':_0x33ef08[_0xa4f5('0x3a')][_0xa4f5('0xbf')]?{'id':_0x33ef08[_0xa4f5('0x3a')]['tag']}:undefined,'required':_0x33ef08['query']['tag']?!![]:![]}];}return contacts[_0xa4f5('0x41')](_0x33ef08['query'],_0x33ef08[_0xa4f5('0x23')],_0x372a40,_0x424749);})[_0xa4f5('0x1c')](respondWithFilteredResult(_0xe8f0b6,_0x372a40))[_0xa4f5('0x4c')](APIHandleError(_0xe8f0b6));};exports[_0xa4f5('0xc0')]=function(_0x4953af,_0x4b609f){var _0x41e1e6;var _0x205cc6={};var _0x442935;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x4953af[_0xa4f5('0x4e')]['id']},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0x1d')]})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4b609f,null))[_0xa4f5('0x1c')](function(_0x1a9262){if(!utils[_0xa4f5('0x92')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])){throw new db[(_0xa4f5('0x82'))][(_0xa4f5('0x83'))](_0xa4f5('0x93'));}_0x41e1e6=_0x1a9262;var _0x2926ad={};_0x2926ad['model']=_[_0xa4f5('0xc1')](db[_[_0xa4f5('0x98')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+'Queue'][_0xa4f5('0x30')]);_0x2926ad[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x4953af[_0xa4f5('0x3a')]);_0x2926ad[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x2926ad['model'],_0x2926ad['query']);_0x205cc6['attributes']=_['intersection'](_0x2926ad[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x205cc6['attributes']=_0x205cc6[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x205cc6[_0xa4f5('0x3f')]:_0x2926ad[_0xa4f5('0xc4')];_0x205cc6[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x205cc6[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x4953af[_0xa4f5('0x3a')],_0x2926ad[_0xa4f5('0xc2')]));if(_0x4953af[_0xa4f5('0x3a')]['filter']){_0x205cc6['where']=_[_0xa4f5('0x50')](_0x205cc6[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x205cc6['attributes'],function(_0x4142d8){var _0x49f55b={};_0x49f55b[_0x4142d8]={'$like':'%'+_0x4953af[_0xa4f5('0x3a')]['filter']+'%'};return _0x49f55b;})});}_0x205cc6=_['merge']({},_0x205cc6,_0x4953af[_0xa4f5('0x51')]);switch(_0x41e1e6[_0xa4f5('0x1d')]){case _0xa4f5('0x21'):return db[_['capitalize'](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+'Queue'][_0xa4f5('0x41')](_0x205cc6);case _0xa4f5('0x23'):case _0xa4f5('0x1e'):return _0x41e1e6[_0xa4f5('0x9b')+_[_0xa4f5('0x98')](_0x4953af['query'][_0xa4f5('0xa1')])+'Queues'](_0x205cc6);default:throw new db[(_0xa4f5('0x82'))]['ValidationError']('Unknown\x20role');}})[_0xa4f5('0x1c')](function(_0x247b99){_0x442935=_0x247b99[_0xa4f5('0x44')];if(!_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x205cc6[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x205cc6['offset']=qs['offset'](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}switch(_0x41e1e6[_0xa4f5('0x1d')]){case _0xa4f5('0x21'):return db[_[_0xa4f5('0x98')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+_0xa4f5('0xcb')][_0xa4f5('0x41')](_0x205cc6);case'user':case'agent':return _0x41e1e6[_0xa4f5('0x9b')+_[_0xa4f5('0x98')](_0x4953af[_0xa4f5('0x3a')][_0xa4f5('0xa1')])+_0xa4f5('0x96')](_0x205cc6);}})['then'](function(_0x5cf667){return{'count':_0x442935,'rows':_0x5cf667};})[_0xa4f5('0x1c')](respondWithResult(_0x4b609f,null))[_0xa4f5('0x4c')](handleError(_0x4b609f,null));};exports[_0xa4f5('0xcc')]=function(_0x8df049,_0x5e66c6){var _0xde0ea7={};var _0x2fc2bf={};var _0x415240;var _0x200dd6;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x8df049[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x5e66c6,null))[_0xa4f5('0x1c')](function(_0x1f5117){if(_0x1f5117){_0x415240=_0x1f5117;_0x2fc2bf[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db['UserVoiceQueueRt'][_0xa4f5('0x30')]);_0x2fc2bf[_0xa4f5('0x3a')]=_['keys'](_0x8df049[_0xa4f5('0x3a')]);_0x2fc2bf[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x2fc2bf['model'],_0x2fc2bf[_0xa4f5('0x3a')]);_0xde0ea7[_0xa4f5('0x3f')]=_['intersection'](_0x2fc2bf['model'],qs[_0xa4f5('0xc5')](_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0xde0ea7[_0xa4f5('0x3f')]=_0xde0ea7[_0xa4f5('0x3f')]['length']?_0xde0ea7[_0xa4f5('0x3f')]:_0x2fc2bf[_0xa4f5('0xc4')];_0xde0ea7[_0xa4f5('0xc6')]=qs['sort'](_0x8df049[_0xa4f5('0x3a')]['sort']);_0xde0ea7[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x8df049[_0xa4f5('0x3a')],_0x2fc2bf[_0xa4f5('0xc2')]));if(_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0xde0ea7[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0xde0ea7[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0xde0ea7['attributes'],function(_0x4d24fe){var _0x1e0b29={};_0x1e0b29[_0x4d24fe]={'$like':'%'+_0x8df049[_0xa4f5('0x3a')]['filter']+'%'};return _0x1e0b29;})});}_0xde0ea7=_[_0xa4f5('0x50')]({},_0xde0ea7,_0x8df049['options']);return _0x415240[_0xa4f5('0xcc')](_0xde0ea7);}})[_0xa4f5('0x1c')](function(_0x2f9196){if(_0x2f9196){_0x200dd6=_0x2f9196[_0xa4f5('0x44')];if(!_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0xde0ea7[_0xa4f5('0x15')]=qs['limit'](_0x8df049[_0xa4f5('0x3a')]['limit']);_0xde0ea7[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x8df049[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x415240[_0xa4f5('0xcc')](_0xde0ea7);}})[_0xa4f5('0x1c')](function(_0x38449f){if(_0x38449f){return _0x38449f?{'count':_0x200dd6,'rows':_0x38449f}:null;}})['then'](respondWithResult(_0x5e66c6,null))[_0xa4f5('0x4c')](handleError(_0x5e66c6,null));};exports[_0xa4f5('0xce')]=function(_0xa6b1c3,_0x4a05ec){var _0x54747a={};var _0x24ddc8={};var _0x3a7063;var _0x356b7c;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0xa6b1c3['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4a05ec,null))['then'](function(_0x892ae0){if(_0x892ae0){_0x3a7063=_0x892ae0;_0x24ddc8['model']=_[_0xa4f5('0xc1')](db[_0xa4f5('0xcf')][_0xa4f5('0x30')]);_0x24ddc8[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0xa6b1c3[_0xa4f5('0x3a')]);_0x24ddc8[_0xa4f5('0xc2')]=_['intersection'](_0x24ddc8[_0xa4f5('0xc4')],_0x24ddc8['query']);_0x54747a[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x24ddc8[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x54747a[_0xa4f5('0x3f')]=_0x54747a['attributes'][_0xa4f5('0x44')]?_0x54747a['attributes']:_0x24ddc8[_0xa4f5('0xc4')];_0x54747a[_0xa4f5('0xc6')]=qs['sort'](_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x54747a[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0xa6b1c3['query'],_0x24ddc8['filters']));if(_0xa6b1c3['query'][_0xa4f5('0xcd')]){_0x54747a['where']=_['merge'](_0x54747a[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x54747a['attributes'],function(_0x1d39da){var _0x5e039e={};_0x5e039e[_0x1d39da]={'$like':'%'+_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x5e039e;})});}_0x54747a=_[_0xa4f5('0x50')]({},_0x54747a,_0xa6b1c3[_0xa4f5('0x51')]);return _0x3a7063[_0xa4f5('0xce')](_0x54747a);}})['then'](function(_0x1c9621){if(_0x1c9621){_0x356b7c=_0x1c9621['length'];if(!_0xa6b1c3[_0xa4f5('0x3a')]['hasOwnProperty']('nolimit')){_0x54747a[_0xa4f5('0x15')]=qs['limit'](_0xa6b1c3['query'][_0xa4f5('0x15')]);_0x54747a['offset']=qs[_0xa4f5('0x18')](_0xa6b1c3[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x3a7063[_0xa4f5('0xce')](_0x54747a);}})[_0xa4f5('0x1c')](function(_0x1fade8){if(_0x1fade8){return _0x1fade8?{'count':_0x356b7c,'rows':_0x1fade8}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x4a05ec,null))[_0xa4f5('0x4c')](handleError(_0x4a05ec,null));};exports['getRecordings']=function(_0x771fb5,_0x170154){var _0x4daa22={'raw':!![],'where':{}};var _0x47ca08={};var _0x1136c6={'count':0x0,'rows':[]};return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x771fb5[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x170154,null))['then'](function(_0x3527c4){if(_0x3527c4){_0x47ca08[_0xa4f5('0xc4')]=_['keys'](db[_0xa4f5('0xd0')][_0xa4f5('0x30')]);_0x47ca08[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x771fb5[_0xa4f5('0x3a')]);_0x47ca08['filters']=_[_0xa4f5('0xc3')](_0x47ca08[_0xa4f5('0xc4')],_0x47ca08[_0xa4f5('0x3a')]);_0x4daa22[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x47ca08[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x771fb5['query'][_0xa4f5('0xc5')]));_0x4daa22[_0xa4f5('0x3f')]=_0x4daa22[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x4daa22['attributes']:_0x47ca08[_0xa4f5('0xc4')];if(!_0x771fb5['query'][_0xa4f5('0xbb')]('nolimit')){_0x4daa22[_0xa4f5('0x15')]=qs['limit'](_0x771fb5[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x4daa22[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x771fb5['query']['offset']);}_0x4daa22[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x771fb5[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x4daa22['where']=qs[_0xa4f5('0xc2')](_['pick'](_0x771fb5[_0xa4f5('0x3a')],_0x47ca08[_0xa4f5('0xc2')]));_0x4daa22[_0xa4f5('0xc8')][_0xa4f5('0xd1')]=_0x3527c4['id'];if(_0x771fb5['query']['filter']){_0x4daa22['where']=_[_0xa4f5('0x50')](_0x4daa22[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x4daa22[_0xa4f5('0x3f')],function(_0x4c2dbc){var _0x448d2d={};_0x448d2d[_0x4c2dbc]={'$like':'%'+_0x771fb5['query']['filter']+'%'};return _0x448d2d;})});}_0x4daa22=_[_0xa4f5('0x50')]({},_0x4daa22,_0x771fb5['options']);return db[_0xa4f5('0xd0')]['count']({'where':_0x4daa22[_0xa4f5('0xc8')]})[_0xa4f5('0x1c')](function(_0x5bf23e){_0x1136c6[_0xa4f5('0x17')]=_0x5bf23e;if(_0x771fb5[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x4daa22['include']=[{'all':!![]}];}return db[_0xa4f5('0xd0')][_0xa4f5('0x41')](_0x4daa22);})[_0xa4f5('0x1c')](function(_0x4d5690){_0x1136c6[_0xa4f5('0x42')]=_0x4d5690;return _0x1136c6;});}})[_0xa4f5('0x1c')](respondWithFilteredResult(_0x170154,_0x4daa22))[_0xa4f5('0x4c')](handleError(_0x170154,null));};exports['getScreenRecordings']=function(_0x3c24be,_0x50b650){var _0x327841={'raw':!![],'where':{}};var _0x2e8b6d={};var _0x471d89={'count':0x0,'rows':[]};return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x3c24be[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x50b650,null))[_0xa4f5('0x1c')](function(_0x3e385f){if(_0x3e385f){_0x2e8b6d[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd2')][_0xa4f5('0x30')]);_0x2e8b6d[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3c24be['query']);_0x2e8b6d[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x2e8b6d['model'],_0x2e8b6d['query']);_0x327841['attributes']=_[_0xa4f5('0xc3')](_0x2e8b6d[_0xa4f5('0xc4')],qs['fields'](_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x327841[_0xa4f5('0x3f')]=_0x327841[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x327841[_0xa4f5('0x3f')]:_0x2e8b6d[_0xa4f5('0xc4')];if(!_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0xbb')]('nolimit')){_0x327841[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x3c24be[_0xa4f5('0x3a')]['limit']);_0x327841[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x3c24be['query']['offset']);}_0x327841[_0xa4f5('0xc6')]=qs['sort'](_0x3c24be[_0xa4f5('0x3a')]['sort']);_0x327841[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x3c24be[_0xa4f5('0x3a')],_0x2e8b6d[_0xa4f5('0xc2')]));_0x327841[_0xa4f5('0xc8')][_0xa4f5('0xd1')]=_0x3e385f['id'];if(_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x327841[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x327841[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x327841['attributes'],function(_0x3b444b){var _0x33f47a={};_0x33f47a[_0x3b444b]={'$like':'%'+_0x3c24be[_0xa4f5('0x3a')]['filter']+'%'};return _0x33f47a;})});}_0x327841=_['merge']({},_0x327841,_0x3c24be[_0xa4f5('0x51')]);return db[_0xa4f5('0xd2')][_0xa4f5('0x17')]({'where':_0x327841[_0xa4f5('0xc8')]})[_0xa4f5('0x1c')](function(_0x22fa7f){_0x471d89[_0xa4f5('0x17')]=_0x22fa7f;if(_0x3c24be[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x327841[_0xa4f5('0x3b')]=[{'all':!![]}];}return db[_0xa4f5('0xd2')][_0xa4f5('0x41')](_0x327841);})[_0xa4f5('0x1c')](function(_0x1bbdc4){_0x471d89['rows']=_0x1bbdc4;return _0x471d89;});}})['then'](respondWithFilteredResult(_0x50b650,_0x327841))[_0xa4f5('0x4c')](handleError(_0x50b650,null));};exports[_0xa4f5('0xd3')]=function(_0x741b4b,_0x2888a1){var _0xdbe535={};var _0x18bf01={};var _0x2141ea;var _0x9fec4e;return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x741b4b[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x2888a1,null))[_0xa4f5('0x1c')](function(_0x552448){if(_0x552448){_0x2141ea=_0x552448;_0x18bf01[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd4')][_0xa4f5('0x30')]);_0x18bf01[_0xa4f5('0x3a')]=_['keys'](_0x741b4b[_0xa4f5('0x3a')]);_0x18bf01[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x18bf01[_0xa4f5('0xc4')],_0x18bf01[_0xa4f5('0x3a')]);_0xdbe535[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x18bf01[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0xdbe535['attributes']=_0xdbe535[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0xdbe535['attributes']:_0x18bf01['model'];_0xdbe535[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x741b4b[_0xa4f5('0x3a')]['sort']);_0xdbe535[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x741b4b[_0xa4f5('0x3a')],_0x18bf01[_0xa4f5('0xc2')]));if(_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0xdbe535[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0xdbe535[_0xa4f5('0xc8')],{'$or':_['map'](_0xdbe535['attributes'],function(_0x34be42){var _0x283f31={};_0x283f31[_0x34be42]={'$like':'%'+_0x741b4b[_0xa4f5('0x3a')]['filter']+'%'};return _0x283f31;})});}_0xdbe535=_[_0xa4f5('0x50')]({},_0xdbe535,_0x741b4b[_0xa4f5('0x51')]);return _0x2141ea[_0xa4f5('0xd3')](_0xdbe535);}})['then'](function(_0x38b5e8){if(_0x38b5e8){_0x9fec4e=_0x38b5e8[_0xa4f5('0x44')];if(!_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0xdbe535[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0xdbe535[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x741b4b[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x2141ea[_0xa4f5('0xd3')](_0xdbe535);}})[_0xa4f5('0x1c')](function(_0x58cfd1){if(_0x58cfd1){return _0x58cfd1?{'count':_0x9fec4e,'rows':_0x58cfd1}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x2888a1,null))[_0xa4f5('0x4c')](handleError(_0x2888a1,null));};exports[_0xa4f5('0xd5')]=function(_0x3fd302,_0x4be537){var _0x18957f={};var _0x2e4fbe={};var _0x5930a7;var _0x2cd166;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x3fd302['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4be537,null))[_0xa4f5('0x1c')](function(_0x568ac5){if(_0x568ac5){_0x5930a7=_0x568ac5;_0x2e4fbe['model']=_[_0xa4f5('0xc1')](db['OpenchannelInteraction'][_0xa4f5('0x30')]);_0x2e4fbe[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3fd302['query']);_0x2e4fbe['filters']=_[_0xa4f5('0xc3')](_0x2e4fbe[_0xa4f5('0xc4')],_0x2e4fbe[_0xa4f5('0x3a')]);_0x18957f[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x2e4fbe['model'],qs[_0xa4f5('0xc5')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x18957f[_0xa4f5('0x3f')]=_0x18957f[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x18957f[_0xa4f5('0x3f')]:_0x2e4fbe[_0xa4f5('0xc4')];_0x18957f[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x18957f[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x3fd302['query'],_0x2e4fbe['filters']));if(_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x18957f[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x18957f['where'],{'$or':_[_0xa4f5('0x31')](_0x18957f[_0xa4f5('0x3f')],function(_0x53caa3){var _0x437b77={};_0x437b77[_0x53caa3]={'$like':'%'+_0x3fd302['query'][_0xa4f5('0xcd')]+'%'};return _0x437b77;})});}_0x18957f=_[_0xa4f5('0x50')]({},_0x18957f,_0x3fd302[_0xa4f5('0x51')]);return _0x5930a7[_0xa4f5('0xd5')](_0x18957f);}})[_0xa4f5('0x1c')](function(_0x484058){if(_0x484058){_0x2cd166=_0x484058[_0xa4f5('0x44')];if(!_0x3fd302['query'][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x18957f[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x18957f[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x3fd302[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x5930a7[_0xa4f5('0xd5')](_0x18957f);}})[_0xa4f5('0x1c')](function(_0x36eadc){if(_0x36eadc){return _0x36eadc?{'count':_0x2cd166,'rows':_0x36eadc}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x4be537,null))['catch'](handleError(_0x4be537,null));};exports['getMailInteractions']=function(_0x57d302,_0x3b79ce){var _0x450fd9={'raw':!![],'where':{}};var _0x5e7e37={};var _0x9d9d94={'count':0x0,'rows':[]};return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x57d302['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x3b79ce,null))['then'](function(_0x131d71){if(_0x131d71){_0x5e7e37[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd6')][_0xa4f5('0x30')]);_0x5e7e37[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x57d302['query']);_0x5e7e37[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x5e7e37[_0xa4f5('0xc4')],_0x5e7e37[_0xa4f5('0x3a')]);_0x450fd9[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x5e7e37[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x450fd9[_0xa4f5('0x3f')]=_0x450fd9[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x450fd9[_0xa4f5('0x3f')]:_0x5e7e37[_0xa4f5('0xc4')];if(!_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x450fd9[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x450fd9[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x57d302['query']['offset']);}_0x450fd9['order']=qs[_0xa4f5('0xc7')](_0x57d302['query']['sort']);_0x450fd9['where']=qs['filters'](_['pick'](_0x57d302['query'],_0x5e7e37[_0xa4f5('0xc2')]));_0x450fd9[_0xa4f5('0xc8')]['UserId']=_0x131d71['id'];if(_0x57d302['query'][_0xa4f5('0xcd')]){_0x450fd9[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x450fd9['where'],{'$or':_[_0xa4f5('0x31')](_0x450fd9[_0xa4f5('0x3f')],function(_0x51edd6){var _0x342ff8={};_0x342ff8[_0x51edd6]={'$like':'%'+_0x57d302['query'][_0xa4f5('0xcd')]+'%'};return _0x342ff8;})});}_0x450fd9=_[_0xa4f5('0x50')]({},_0x450fd9,_0x57d302[_0xa4f5('0x51')]);return db[_0xa4f5('0xd6')][_0xa4f5('0x17')]({'where':_0x450fd9[_0xa4f5('0xc8')]})[_0xa4f5('0x1c')](function(_0x2f28e8){_0x9d9d94['count']=_0x2f28e8;if(_0x57d302[_0xa4f5('0x3a')][_0xa4f5('0x4f')]){_0x450fd9[_0xa4f5('0x3b')]=[{'all':!![]}];}return db[_0xa4f5('0xd6')][_0xa4f5('0x41')](_0x450fd9);})[_0xa4f5('0x1c')](function(_0x194df1){_0x9d9d94['rows']=_0x194df1;return _0x9d9d94;});}})['then'](respondWithFilteredResult(_0x3b79ce,_0x450fd9))[_0xa4f5('0x4c')](handleError(_0x3b79ce,null));};exports[_0xa4f5('0xd7')]=function(_0x178b43,_0x525c4e){var _0x391643={};var _0x3d5239={};var _0x332085;var _0x3905fd;return db['User'][_0xa4f5('0x89')]({'where':{'id':_0x178b43['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x525c4e,null))[_0xa4f5('0x1c')](function(_0x49d98a){if(_0x49d98a){_0x332085=_0x49d98a;_0x3d5239[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xd8')][_0xa4f5('0x30')]);_0x3d5239['query']=_[_0xa4f5('0xc1')](_0x178b43[_0xa4f5('0x3a')]);_0x3d5239['filters']=_[_0xa4f5('0xc3')](_0x3d5239[_0xa4f5('0xc4')],_0x3d5239['query']);_0x391643[_0xa4f5('0x3f')]=_['intersection'](_0x3d5239[_0xa4f5('0xc4')],qs['fields'](_0x178b43['query'][_0xa4f5('0xc5')]));_0x391643[_0xa4f5('0x3f')]=_0x391643[_0xa4f5('0x3f')]['length']?_0x391643[_0xa4f5('0x3f')]:_0x3d5239[_0xa4f5('0xc4')];_0x391643['order']=qs[_0xa4f5('0xc7')](_0x178b43[_0xa4f5('0x3a')]['sort']);_0x391643[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x178b43[_0xa4f5('0x3a')],_0x3d5239['filters']));if(_0x178b43[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x391643[_0xa4f5('0xc8')]=_['merge'](_0x391643['where'],{'$or':_['map'](_0x391643[_0xa4f5('0x3f')],function(_0x4185da){var _0x3dbf73={};_0x3dbf73[_0x4185da]={'$like':'%'+_0x178b43[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x3dbf73;})});}_0x391643=_[_0xa4f5('0x50')]({},_0x391643,_0x178b43[_0xa4f5('0x51')]);return _0x332085[_0xa4f5('0xd7')](_0x391643);}})[_0xa4f5('0x1c')](function(_0x341ee9){if(_0x341ee9){_0x3905fd=_0x341ee9['length'];if(!_0x178b43[_0xa4f5('0x3a')]['hasOwnProperty'](_0xa4f5('0xca'))){_0x391643[_0xa4f5('0x15')]=qs['limit'](_0x178b43['query'][_0xa4f5('0x15')]);_0x391643[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x178b43[_0xa4f5('0x3a')]['offset']);}return _0x332085[_0xa4f5('0xd7')](_0x391643);}})[_0xa4f5('0x1c')](function(_0x36d0cb){if(_0x36d0cb){return _0x36d0cb?{'count':_0x3905fd,'rows':_0x36d0cb}:null;}})['then'](respondWithResult(_0x525c4e,null))[_0xa4f5('0x4c')](handleError(_0x525c4e,null));};exports[_0xa4f5('0xd9')]=function(_0x3177b4,_0x5a437b){var _0x514b72={};var _0x3dfec5={};var _0x3f345e;var _0x277cac;return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x3177b4[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x5a437b,null))[_0xa4f5('0x1c')](function(_0x59e5f7){if(_0x59e5f7){_0x3f345e=_0x59e5f7;_0x3dfec5['model']=_[_0xa4f5('0xc1')](db[_0xa4f5('0xda')][_0xa4f5('0x30')]);_0x3dfec5[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3177b4[_0xa4f5('0x3a')]);_0x3dfec5[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0x3dfec5[_0xa4f5('0xc4')],_0x3dfec5[_0xa4f5('0x3a')]);_0x514b72['attributes']=_[_0xa4f5('0xc3')](_0x3dfec5[_0xa4f5('0xc4')],qs['fields'](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x514b72[_0xa4f5('0x3f')]=_0x514b72[_0xa4f5('0x3f')]['length']?_0x514b72['attributes']:_0x3dfec5[_0xa4f5('0xc4')];_0x514b72[_0xa4f5('0xc6')]=qs['sort'](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x514b72[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x3177b4[_0xa4f5('0x3a')],_0x3dfec5['filters']));if(_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x514b72[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x514b72['where'],{'$or':_[_0xa4f5('0x31')](_0x514b72[_0xa4f5('0x3f')],function(_0x3c5717){var _0xfdee59={};_0xfdee59[_0x3c5717]={'$like':'%'+_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0xfdee59;})});}_0x514b72=_[_0xa4f5('0x50')]({},_0x514b72,_0x3177b4[_0xa4f5('0x51')]);return _0x3f345e['getFaxInteractions'](_0x514b72);}})['then'](function(_0x50c7ff){if(_0x50c7ff){_0x277cac=_0x50c7ff[_0xa4f5('0x44')];if(!_0x3177b4[_0xa4f5('0x3a')]['hasOwnProperty'](_0xa4f5('0xca'))){_0x514b72['limit']=qs[_0xa4f5('0x15')](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x514b72[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x3177b4[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x3f345e['getFaxInteractions'](_0x514b72);}})[_0xa4f5('0x1c')](function(_0x9c8ec3){if(_0x9c8ec3){return _0x9c8ec3?{'count':_0x277cac,'rows':_0x9c8ec3}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x5a437b,null))[_0xa4f5('0x4c')](handleError(_0x5a437b,null));};exports[_0xa4f5('0xdb')]=function(_0x277003,_0x19725a){var _0x8e8077={};var _0x1142fb={};var _0x1edf56;var _0x36d6a4;return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x277003['params']['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x19725a,null))[_0xa4f5('0x1c')](function(_0x19ac3c){if(_0x19ac3c){_0x1edf56=_0x19ac3c;_0x1142fb[_0xa4f5('0xc4')]=_[_0xa4f5('0xc1')](db[_0xa4f5('0xdc')][_0xa4f5('0x30')]);_0x1142fb[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x277003[_0xa4f5('0x3a')]);_0x1142fb[_0xa4f5('0xc2')]=_['intersection'](_0x1142fb[_0xa4f5('0xc4')],_0x1142fb[_0xa4f5('0x3a')]);_0x8e8077['attributes']=_['intersection'](_0x1142fb[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x8e8077[_0xa4f5('0x3f')]=_0x8e8077['attributes']['length']?_0x8e8077[_0xa4f5('0x3f')]:_0x1142fb[_0xa4f5('0xc4')];_0x8e8077[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x277003[_0xa4f5('0x3a')]['sort']);_0x8e8077[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x277003[_0xa4f5('0x3a')],_0x1142fb[_0xa4f5('0xc2')]));if(_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x8e8077[_0xa4f5('0xc8')]=_['merge'](_0x8e8077[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x8e8077['attributes'],function(_0x5e4bb9){var _0x3fbffa={};_0x3fbffa[_0x5e4bb9]={'$like':'%'+_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x3fbffa;})});}_0x8e8077=_[_0xa4f5('0x50')]({},_0x8e8077,_0x277003[_0xa4f5('0x51')]);return _0x1edf56['getWhatsappInteractions'](_0x8e8077);}})[_0xa4f5('0x1c')](function(_0x5e8a78){if(_0x5e8a78){_0x36d6a4=_0x5e8a78[_0xa4f5('0x44')];if(!_0x277003[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x8e8077['limit']=qs[_0xa4f5('0x15')](_0x277003[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x8e8077[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x277003[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x1edf56[_0xa4f5('0xdb')](_0x8e8077);}})[_0xa4f5('0x1c')](function(_0x50fb26){if(_0x50fb26){return _0x50fb26?{'count':_0x36d6a4,'rows':_0x50fb26}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x19725a,null))[_0xa4f5('0x4c')](handleError(_0x19725a,null));};exports[_0xa4f5('0xdd')]=function(_0x9d62ec,_0x49a994,_0x51732d){var _0x374394;var _0x5058ee;var _0x11cb93;var _0x8bd602=!_[_0xa4f5('0x5e')](_0x9d62ec[_0xa4f5('0x4e')]['id'])?_0x9d62ec[_0xa4f5('0x4e')]['id']:!_[_0xa4f5('0x5e')](_0x9d62ec[_0xa4f5('0x23')]['id'])?_0x9d62ec['user']['id']:null;return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x8bd602,'role':{'$or':[_0xa4f5('0x21'),_0xa4f5('0x23'),_0xa4f5('0x1e')]}},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0xde'),_0xa4f5('0xdf'),_0xa4f5('0x1d'),_0xa4f5('0x5c'),_0xa4f5('0x8f')]})[_0xa4f5('0x1c')](function(_0x47364e){if(_0x47364e){if(_0x47364e[_0xa4f5('0x1d')]==='agent'){_0x374394=_0x47364e;if(_0x9d62ec[_0xa4f5('0x54')][_0xa4f5('0x91')]){_0x11cb93=util[_0xa4f5('0x9d')]('LOCAL/%s@from-sip/n',_0x374394[_0x9d62ec[_0xa4f5('0x54')]['interface']]);}else if(_0x9d62ec[_0xa4f5('0x54')][_0xa4f5('0xe0')]){_0x11cb93=util['format']('SIP/%s',_0x9d62ec[_0xa4f5('0x54')][_0xa4f5('0xe0')]);}else{_0x11cb93=util['format'](_0xa4f5('0x9e'),_0x374394[_0xa4f5('0x29')]);}socket['to'](util[_0xa4f5('0x9d')]('user:%s',_0x374394[_0xa4f5('0x29')]))[_0xa4f5('0x1f')](_0xa4f5('0xe1'),{'user':{'id':_0x374394['id'],'name':_0x374394[_0xa4f5('0x29')]},'ip':_0x9d62ec[_0xa4f5('0xe2')][_0xa4f5('0xe3')]||_0x9d62ec[_0xa4f5('0xe4')][_0xa4f5('0xe5')]||_0x9d62ec[_0xa4f5('0xe6')][_0xa4f5('0xe5')]||_0x9d62ec[_0xa4f5('0xe4')][_0xa4f5('0xe6')][_0xa4f5('0xe5')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x374394[_0xa4f5('0x29')]},'individualHooks':!![]});}}else{throw new db[(_0xa4f5('0x82'))]['ValidationError'](_0xa4f5('0xe7'));}})[_0xa4f5('0x1c')](function(){if(_0x374394){return _0x374394[_0xa4f5('0xe8')]({'raw':!![]});}})[_0xa4f5('0x1c')](function(_0x2a779b){if(_0x374394){if(_0x2a779b){_0x5058ee=_0x2a779b;if(_0x5058ee['length']){var _0x450cec=_0x5058ee[_0xa4f5('0x31')](function(_0xf6fe02){var _0x5ce1ac={'membername':_0x374394['name'],'UserId':_0x374394['id'],'queue_name':_0xf6fe02['name'],'VoiceQueueId':_0xf6fe02['id'],'interface':_0x11cb93,'paused':_0x374394[_0xa4f5('0x8f')]||![],'penalty':_0xf6fe02[_0xa4f5('0xe9')]||0x0};return db['UserVoiceQueueRt'][_0xa4f5('0x9f')](_0x5ce1ac);});return Promise['all'](_0x450cec);}}}})[_0xa4f5('0x1c')](function(){if(_0x374394){return db[_0xa4f5('0xea')][_0xa4f5('0x41')]({'where':{'membername':_0x374394[_0xa4f5('0x29')],'exitAt':null}});}})[_0xa4f5('0x1c')](function(_0x158010){if(_0x374394){var _0x2526cc=[];_0x158010['forEach'](function(_0x4c8822){_0x2526cc[_0xa4f5('0x40')](_0x4c8822[_0xa4f5('0x53')]({'exitAt':moment()['format'](_0xa4f5('0xeb'))}));});return Promise[_0xa4f5('0x4b')](_0x2526cc);}})['then'](function(){if(_0x374394){var _0x54a30f=[];var _0x18f285=[];var _0x37a74a=utils[_0xa4f5('0xec')]();var _0x394b21={'membername':_0x374394[_0xa4f5('0x29')],'interface':_0x11cb93,'enterAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb')),'role':_0x374394[_0xa4f5('0x1d')],'internal':_0x374394[_0xa4f5('0x5c')]};_0x37a74a[_0xa4f5('0xed')](function(_0x275054){_0x54a30f[_0xa4f5('0x40')](_[_0xa4f5('0x50')]({'channel':_0x275054,'type':_0xa4f5('0xee'),'data1':_0x9d62ec['body'][_0xa4f5('0xef')],'data2':_0x11cb93},_0x394b21));if(_0x374394[_0xa4f5('0x8f')]){_0x18f285[_0xa4f5('0x40')](_['merge']({'channel':_0x275054,'type':_0xa4f5('0xf0'),'data1':_0xa4f5('0xf1')},_0x394b21));}});return db[_0xa4f5('0xea')]['bulkCreate'](_0x54a30f[_0xa4f5('0xb9')](_0x18f285),{'individualHooks':!![]});}})[_0xa4f5('0x1c')](function(){if(_0x374394){return _0x374394[_0xa4f5('0x53')]({'online':!![],'lastLoginAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb')),'voicePause':_0x374394['loginInPause']||![],'mailPause':_0x374394[_0xa4f5('0x8f')]||![],'chatPause':_0x374394['loginInPause']||![],'faxPause':_0x374394[_0xa4f5('0x8f')]||![],'smsPause':_0x374394[_0xa4f5('0x8f')]||![],'openchannelPause':_0x374394[_0xa4f5('0x8f')]||![],'whatsappPause':_0x374394[_0xa4f5('0x8f')]||![],'pauseType':_0x374394[_0xa4f5('0x8f')]?_0xa4f5('0xf1'):null,'interface':_0x11cb93,'lastPauseAt':moment()['format'](_0xa4f5('0xeb'))});}})[_0xa4f5('0x1c')](function(_0x44f0d4){if(_0x9d62ec[_0xa4f5('0xf2')]){return _0x51732d();}else{return Promise['resolve'](_0x44f0d4)[_0xa4f5('0x1c')](respondWithResult(_0x49a994,null));}})[_0xa4f5('0x4c')](handleError(_0x49a994,null));};exports[_0xa4f5('0xf3')]=function(_0x59c925,_0x29bc9a){var _0x147d8c;return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x59c925[_0xa4f5('0x4e')]['id'],'role':_0xa4f5('0x1e')},'attributes':['id',_0xa4f5('0x29'),'role']})[_0xa4f5('0x1c')](handleEntityNotFound(_0x29bc9a,null))[_0xa4f5('0x1c')](function(_0x3f1029){if(_0x3f1029){_0x147d8c=_0x3f1029;return db[_0xa4f5('0xa5')][_0xa4f5('0x2b')]({'where':{'membername':_0x147d8c['name']},'individualHooks':!![]});}})[_0xa4f5('0x1c')](function(){return db[_0xa4f5('0xea')][_0xa4f5('0x41')]({'where':{'membername':_0x147d8c[_0xa4f5('0x29')],'exitAt':null}});})[_0xa4f5('0x1c')](function(_0x6c4910){var _0x3c2bc2=[];_0x6c4910[_0xa4f5('0xed')](function(_0xcc13cd){_0x3c2bc2[_0xa4f5('0x40')](_0xcc13cd[_0xa4f5('0x53')]({'exitAt':moment()['format'](_0xa4f5('0xeb'))}));});return Promise[_0xa4f5('0x4b')](_0x3c2bc2);})[_0xa4f5('0x1c')](function(){return _0x147d8c[_0xa4f5('0x53')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xa4f5('0x1c')](respondWithResult(_0x29bc9a,null))[_0xa4f5('0x4c')](handleError(_0x29bc9a,null));};exports[_0xa4f5('0xf4')]=function(_0x3f7534,_0x4606fa){var _0xba6316;return db[_0xa4f5('0xa5')]['update']({'paused':0x1},{'where':{'UserId':_0x3f7534['params']['id']},'individualHooks':!![]})[_0xa4f5('0x1c')](function(){return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x3f7534[_0xa4f5('0x4e')]['id'],'role':_0xa4f5('0x1e')},'attributes':['id',_0xa4f5('0x29'),_0xa4f5('0x1d'),_0xa4f5('0x5c'),'interface',_0xa4f5('0x8e')]});})[_0xa4f5('0x1c')](handleEntityNotFound(_0x4606fa,null))[_0xa4f5('0x1c')](function(_0xf4ada3){if(_0xf4ada3){_0xba6316=_0xf4ada3;return db[_0xa4f5('0xea')][_0xa4f5('0x41')]({'where':{'membername':_0xba6316[_0xa4f5('0x29')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x3a0a63){if(_0x3a0a63[_0xa4f5('0x44')]){var _0xdf50d2=moment()[_0xa4f5('0x9d')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2234ca=0x0,_0x172da5=_0x3a0a63[_0xa4f5('0x44')];_0x2234ca<_0x172da5;_0x2234ca++){_0x3a0a63[_0x2234ca][_0xa4f5('0xf5')]({'exitAt':_0xdf50d2});}}})[_0xa4f5('0x1c')](function(){var _0x5e0818=[];var _0x2e4f1d=utils[_0xa4f5('0xec')]();_0x2e4f1d['forEach'](function(_0x3cc173){_0x5e0818[_0xa4f5('0x40')]({'channel':_0x3cc173,'membername':_0xba6316[_0xa4f5('0x29')],'interface':_['isNil'](_0xba6316[_0xa4f5('0x91')])?util[_0xa4f5('0x9d')](_0xa4f5('0x9e'),_0xba6316[_0xa4f5('0x29')]):_0xba6316['interface'],'type':_0xa4f5('0xf0'),'enterAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb')),'data1':_0x3f7534[_0xa4f5('0x54')][_0xa4f5('0xf6')]||_0xa4f5('0xf7'),'role':_0xba6316[_0xa4f5('0x1d')],'internal':_0xba6316[_0xa4f5('0x5c')]});});return db[_0xa4f5('0xea')][_0xa4f5('0xf8')](_0x5e0818,{'individualHooks':!![]});})[_0xa4f5('0x1c')](function(){return _0xba6316[_0xa4f5('0x53')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3f7534[_0xa4f5('0x54')][_0xa4f5('0xf6')]||_0xa4f5('0xf7'),'lastPauseAt':moment()[_0xa4f5('0x9d')](_0xa4f5('0xeb'))});})[_0xa4f5('0x1c')](respondWithResult(_0x4606fa,null))['catch'](handleError(_0x4606fa,null));};exports[_0xa4f5('0xf9')]=function(_0x495678,_0x4e4a58){if(_0x495678[_0xa4f5('0x54')][_0xa4f5('0xa1')]&&!utils[_0xa4f5('0x92')](_0x495678['body']['channel'])){throw new APIBadRequestError(util[_0xa4f5('0x9d')](_0xa4f5('0xfa'),_0x495678[_0xa4f5('0x54')]['channel']));}return db[_0xa4f5('0x2f')][_0xa4f5('0x28')]({'where':{'id':_0x495678[_0xa4f5('0x4e')]['id']},'attributes':['id','name',_0xa4f5('0x1d'),_0xa4f5('0x5c'),_0xa4f5('0x91'),_0xa4f5('0x8e'),'voicePause',_0xa4f5('0xfb'),'chatPause',_0xa4f5('0xfc'),'openchannelPause',_0xa4f5('0xfd'),_0xa4f5('0xfe'),_0xa4f5('0xff'),_0xa4f5('0x100')]})[_0xa4f5('0x1c')](function(_0x2fda4b){if(!_0x2fda4b){throw new APINotFoundError(util[_0xa4f5('0x9d')](_0xa4f5('0xba'),_0x495678[_0xa4f5('0x4e')]['id']));}return _0x2fda4b[_0xa4f5('0xf9')](_0x495678[_0xa4f5('0x54')]['channel']);})[_0xa4f5('0x1c')](respondWithResult(_0x4e4a58,null))[_0xa4f5('0x4c')](APIHandleError(_0x4e4a58));};exports['getTeams']=function(_0x31eb25,_0x3214f1){var _0x94f253={};var _0x293505={};var _0x67ce1e;var _0x4dbd41;return db['User'][_0xa4f5('0x89')]({'where':{'id':_0x31eb25[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x3214f1,null))[_0xa4f5('0x1c')](function(_0x1a4e98){if(_0x1a4e98){_0x67ce1e=_0x1a4e98;_0x293505['model']=_['keys'](db[_0xa4f5('0x101')]['rawAttributes']);_0x293505[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x31eb25[_0xa4f5('0x3a')]);_0x293505['filters']=_[_0xa4f5('0xc3')](_0x293505[_0xa4f5('0xc4')],_0x293505[_0xa4f5('0x3a')]);_0x94f253[_0xa4f5('0x3f')]=_[_0xa4f5('0xc3')](_0x293505['model'],qs[_0xa4f5('0xc5')](_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x94f253[_0xa4f5('0x3f')]=_0x94f253[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x94f253['attributes']:_0x293505['model'];_0x94f253['order']=qs['sort'](_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x94f253[_0xa4f5('0xc8')]=qs['filters'](_[_0xa4f5('0xc9')](_0x31eb25[_0xa4f5('0x3a')],_0x293505[_0xa4f5('0xc2')]));if(_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x94f253['where']=_[_0xa4f5('0x50')](_0x94f253[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x94f253['attributes'],function(_0x306365){var _0x5ad7b4={};_0x5ad7b4[_0x306365]={'$like':'%'+_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x5ad7b4;})});}_0x94f253=_[_0xa4f5('0x50')]({},_0x94f253,_0x31eb25[_0xa4f5('0x51')]);return _0x67ce1e[_0xa4f5('0x102')](_0x94f253);}})['then'](function(_0x496a08){if(_0x496a08){_0x4dbd41=_0x496a08['length'];if(!_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x94f253['limit']=qs['limit'](_0x31eb25['query'][_0xa4f5('0x15')]);_0x94f253[_0xa4f5('0x18')]=qs[_0xa4f5('0x18')](_0x31eb25[_0xa4f5('0x3a')][_0xa4f5('0x18')]);}return _0x67ce1e[_0xa4f5('0x102')](_0x94f253);}})[_0xa4f5('0x1c')](function(_0x33541f){if(_0x33541f){return _0x33541f?{'count':_0x4dbd41,'rows':_0x33541f}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x3214f1,null))[_0xa4f5('0x4c')](handleError(_0x3214f1,null));};exports['addTeams']=function(_0x120971,_0x3c2942){var _0x368450=_0x120971[_0xa4f5('0x4e')]['id'];var _0x2ada33=_0x120971[_0xa4f5('0x54')]?_0x120971['body'][_0xa4f5('0x58')]:null;var _0x43e28f=[];return Promise[_0xa4f5('0x103')]()[_0xa4f5('0x1c')](function(){if(!_0x2ada33)throw new APIBadRequestError(_0xa4f5('0x104'));})['then'](function(){return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x368450}});})['then'](function(_0x48967d){if(!_0x48967d)throw new APINotFoundError(util[_0xa4f5('0x9d')](_0xa4f5('0xba'),_0x120971[_0xa4f5('0x4e')]['id']));return db['sequelize'][_0xa4f5('0x105')](function(_0x5bf983){return _0x48967d['addTeams'](_0x2ada33,{'transaction':_0x5bf983})[_0xa4f5('0x1c')](function(){return db['Team'][_0xa4f5('0x41')]({'where':{'id':{'$in':_0x2ada33}}});})['then'](function(_0x541254){var _0x348c0a=_[_0xa4f5('0x31')](_0x541254,function(_0x4bde8d){return _0x4bde8d[_0xa4f5('0x106')]();});return Promise['all'](_0x348c0a);})[_0xa4f5('0x1c')](function(_0x3d91ea){_0x43e28f=_[_0xa4f5('0x107')](_0x3d91ea);var _0x573971=_['map'](_0x43e28f,function(_0x5c7d95){return _0x5c7d95[_0xa4f5('0x108')](_0x48967d['id'],{'transaction':_0x5bf983});});return Promise[_0xa4f5('0x4b')](_0x573971);})[_0xa4f5('0x1c')](function(){if(!_0x48967d[_0xa4f5('0x8e')])return;var _0x243edf=_[_0xa4f5('0xcd')](_0x43e28f,function(_0xde8ed1){return _0xde8ed1[_0xa4f5('0x109')](_0xa4f5('0xa1'))===_0xa4f5('0x10a');});var _0x1ca004=_[_0xa4f5('0x31')](_0x243edf,function(_0xcae710){return db['UserVoiceQueueRt'][_0xa4f5('0x9f')]({'membername':_0x48967d['name'],'UserId':_0x48967d['id'],'queue_name':_0xcae710[_0xa4f5('0x29')],'VoiceQueueId':_0xcae710['id'],'interface':_[_0xa4f5('0x5e')](_0x48967d['interface'])?util[_0xa4f5('0x9d')](_0xa4f5('0x9e'),_0x48967d['name']):_0x48967d[_0xa4f5('0x91')],'paused':_0x48967d['voicePause']||![],'penalty':_0x48967d[_0xa4f5('0x97')]},{'transaction':_0x5bf983});});return Promise[_0xa4f5('0x4b')](_0x1ca004);})['then'](function(){return db[_0xa4f5('0x10b')][_0xa4f5('0x41')]({'where':{'teamId':{'$in':_0x2ada33}}});})[_0xa4f5('0x1c')](function(_0x9d7f73){var _0x1b03e8=_['map'](_0x9d7f73,function(_0xe07819){return db[_0xa4f5('0x10c')][_0xa4f5('0x73')]({'UserId':_0x48967d['id'],'VoicePrefixId':_0xe07819['VoicePrefixId']},{'transaction':_0x5bf983});});return Promise[_0xa4f5('0x4b')](_0x1b03e8);});});})[_0xa4f5('0x1c')](function(){for(var _0x1bc065=0x0;_0x1bc065<_0x43e28f['length'];_0x1bc065++){var _0x258d51=_0x43e28f[_0x1bc065][_0xa4f5('0x109')](_0xa4f5('0xa1'));var _0x1a633f=_0x258d51+_0xa4f5('0x99');socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_0x258d51+_0xa4f5('0x10d'),{'UserId':_0x368450,['queueField']:_0x43e28f[_0x1bc065]['id']});}})[_0xa4f5('0x1c')](respondWithStatusCode(_0x3c2942,null))[_0xa4f5('0x4c')](APIHandleError(_0x3c2942));};exports['removeTeams']=function(_0xff26d6,_0x3c8da1){var _0x4fe45e=_0xff26d6['params']['id'];var _0x4c11a1=null;if(_0xff26d6[_0xa4f5('0x3a')][_0xa4f5('0x58')]){_0x4c11a1=_['isArray'](_0xff26d6[_0xa4f5('0x3a')][_0xa4f5('0x58')])?_0xff26d6[_0xa4f5('0x3a')][_0xa4f5('0x58')]:[_0xff26d6[_0xa4f5('0x3a')]['ids']];}var _0x5dd67f=[];return Promise[_0xa4f5('0x103')]()['then'](function(){if(!_0x4c11a1)throw new APIBadRequestError(_0xa4f5('0x10e'));})[_0xa4f5('0x1c')](function(){return db[_0xa4f5('0x2f')][_0xa4f5('0x89')]({'where':{'id':_0x4fe45e}});})['then'](function(_0x545c54){if(!_0x545c54)throw new APINotFoundError(util[_0xa4f5('0x9d')]('User\x20with\x20id\x20%s\x20not\x20found',_0xff26d6['params']['id']));return db[_0xa4f5('0x5f')][_0xa4f5('0x105')](function(_0x2aa79e){return _0x545c54[_0xa4f5('0x10f')](_0x4c11a1,{'transaction':_0x2aa79e})[_0xa4f5('0x1c')](function(){return db['Team'][_0xa4f5('0x41')]({'where':{'id':{'$in':_0x4c11a1}}});})[_0xa4f5('0x1c')](function(_0x57e133){var _0x445a3b=_[_0xa4f5('0x31')](_0x57e133,function(_0x30c93e){return _0x30c93e[_0xa4f5('0x106')]();});return Promise[_0xa4f5('0x4b')](_0x445a3b);})[_0xa4f5('0x1c')](function(_0x46b915){_0x5dd67f=_['flattenDeep'](_0x46b915);var _0x49087c=_[_0xa4f5('0x31')](_0x5dd67f,function(_0x1beb5e){return _0x1beb5e[_0xa4f5('0x110')](_0x545c54['id'],{'transaction':_0x2aa79e});});return Promise[_0xa4f5('0x4b')](_0x49087c);})[_0xa4f5('0x1c')](function(){if(!_0x545c54[_0xa4f5('0x8e')])return;var _0x14b0a5=_[_0xa4f5('0xcd')](_0x5dd67f,function(_0x4b01b9){return _0x4b01b9[_0xa4f5('0x109')]('channel')===_0xa4f5('0x10a');});var _0x28c302=_[_0xa4f5('0x31')](_0x14b0a5,function(_0x55509e){return db[_0xa4f5('0xa5')]['destroy']({'where':{'VoiceQueueId':_0x55509e['id'],'UserId':_0x545c54['id']},'transaction':_0x2aa79e});});return Promise['all'](_0x28c302);})[_0xa4f5('0x1c')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x4c11a1}}});})[_0xa4f5('0x1c')](function(_0x391a0e){var _0x6dedeb=_[_0xa4f5('0x31')](_0x391a0e,function(_0x1207b2){return db['UserVoicePrefix'][_0xa4f5('0x2b')]({'where':{'UserId':_0x545c54['id'],'VoicePrefixId':_0x1207b2['VoicePrefixId']}},{'transaction':_0x2aa79e});});return Promise[_0xa4f5('0x4b')](_0x6dedeb);});});})[_0xa4f5('0x1c')](function(){for(var _0x20d777=0x0;_0x20d777<_0x5dd67f[_0xa4f5('0x44')];_0x20d777++){var _0x13dca1=_0x5dd67f[_0x20d777]['getDataValue'](_0xa4f5('0xa1'));var _0x2a9dbd=_0x13dca1+_0xa4f5('0x99');socket[_0xa4f5('0x1f')](_0xa4f5('0x23')+_0x13dca1+_0xa4f5('0xa4'),{'UserId':_0x4fe45e,['queueField']:_0x5dd67f[_0x20d777]['id']});}})[_0xa4f5('0x1c')](respondWithStatusCode(_0x3c8da1,null))[_0xa4f5('0x4c')](APIHandleError(_0x3c8da1));};exports[_0xa4f5('0x111')]=function(_0x5e9bc9,_0x11f6a8){var _0x8c62bd={};var _0x34fbeb={};var _0x2ad3ff;var _0x139d1d;return db['User'][_0xa4f5('0x89')]({'where':{'id':_0x5e9bc9[_0xa4f5('0x4e')]['id']}})[_0xa4f5('0x1c')](handleEntityNotFound(_0x11f6a8,null))[_0xa4f5('0x1c')](function(_0x2f947c){if(_0x2f947c){_0x2ad3ff=_0x2f947c;_0x34fbeb[_0xa4f5('0xc4')]=_['keys'](db[_0xa4f5('0xbc')][_0xa4f5('0x30')]);_0x34fbeb[_0xa4f5('0x3a')]=_['keys'](_0x5e9bc9[_0xa4f5('0x3a')]);_0x34fbeb[_0xa4f5('0xc2')]=_['intersection'](_0x34fbeb[_0xa4f5('0xc4')],_0x34fbeb[_0xa4f5('0x3a')]);_0x8c62bd[_0xa4f5('0x3f')]=_['intersection'](_0x34fbeb['model'],qs[_0xa4f5('0xc5')](_0x5e9bc9[_0xa4f5('0x3a')][_0xa4f5('0xc5')]));_0x8c62bd['attributes']=_0x8c62bd[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x8c62bd[_0xa4f5('0x3f')]:_0x34fbeb[_0xa4f5('0xc4')];_0x8c62bd['order']=qs[_0xa4f5('0xc7')](_0x5e9bc9[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x8c62bd['where']=qs[_0xa4f5('0xc2')](_[_0xa4f5('0xc9')](_0x5e9bc9['query'],_0x34fbeb[_0xa4f5('0xc2')]));if(_0x5e9bc9[_0xa4f5('0x3a')]['filter']){_0x8c62bd[_0xa4f5('0xc8')]=_[_0xa4f5('0x50')](_0x8c62bd[_0xa4f5('0xc8')],{'$or':_[_0xa4f5('0x31')](_0x8c62bd['attributes'],function(_0x326107){var _0x263499={};_0x263499[_0x326107]={'$like':'%'+_0x5e9bc9[_0xa4f5('0x3a')]['filter']+'%'};return _0x263499;})});}_0x8c62bd=_[_0xa4f5('0x50')]({},_0x8c62bd,_0x5e9bc9['options']);return _0x2ad3ff[_0xa4f5('0x111')](_0x8c62bd);}})['then'](function(_0xa9f9b1){if(_0xa9f9b1){_0x139d1d=_0xa9f9b1['length'];if(!_0x5e9bc9['query'][_0xa4f5('0xbb')](_0xa4f5('0xca'))){_0x8c62bd[_0xa4f5('0x15')]=qs[_0xa4f5('0x15')](_0x5e9bc9[_0xa4f5('0x3a')][_0xa4f5('0x15')]);_0x8c62bd[_0xa4f5('0x18')]=qs['offset'](_0x5e9bc9['query'][_0xa4f5('0x18')]);}return _0x2ad3ff[_0xa4f5('0x111')](_0x8c62bd);}})[_0xa4f5('0x1c')](function(_0x5a1f60){if(_0x5a1f60){return _0x5a1f60?{'count':_0x139d1d,'rows':_0x5a1f60}:null;}})[_0xa4f5('0x1c')](respondWithResult(_0x11f6a8,null))[_0xa4f5('0x4c')](handleError(_0x11f6a8,null));};exports[_0xa4f5('0x112')]=function(_0x3cbafd,_0x3ff4ff){var _0x34c834={};var _0xbd6194={};var _0x9e1d97;return db[_0xa4f5('0x2f')]['findOne']({'where':{'id':_0x3cbafd['params']['id']}})['then'](handleEntityNotFound(_0x3ff4ff,null))[_0xa4f5('0x1c')](function(_0x592bb6){if(_0x592bb6){_0x9e1d97=_0x592bb6;_0xbd6194['model']=_[_0xa4f5('0xc1')](db['User']['rawAttributes']);_0xbd6194[_0xa4f5('0x3a')]=_[_0xa4f5('0xc1')](_0x3cbafd[_0xa4f5('0x3a')]);_0xbd6194[_0xa4f5('0xc2')]=_[_0xa4f5('0xc3')](_0xbd6194['model'],_0xbd6194[_0xa4f5('0x3a')]);_0x34c834['attributes']=_[_0xa4f5('0xc3')](_0xbd6194[_0xa4f5('0xc4')],qs[_0xa4f5('0xc5')](_0x3cbafd[_0xa4f5('0x3a')]['fields']));_0x34c834['attributes']=_0x34c834[_0xa4f5('0x3f')][_0xa4f5('0x44')]?_0x34c834[_0xa4f5('0x3f')]:_0xbd6194[_0xa4f5('0xc4')];_0x34c834[_0xa4f5('0xc6')]=qs[_0xa4f5('0xc7')](_0x3cbafd[_0xa4f5('0x3a')][_0xa4f5('0xc7')]);_0x34c834[_0xa4f5('0xc8')]=qs[_0xa4f5('0xc2')](_['pick'](_0x3cbafd[_0xa4f5('0x3a')],_0xbd6194[_0xa4f5('0xc2')]));if(_0x3cbafd[_0xa4f5('0x3a')][_0xa4f5('0xcd')]){_0x34c834[_0xa4f5('0xc8')]=_['merge'](_0x34c834[_0xa4f5('0xc8')],{'$or':_['map'](_0x34c834[_0xa4f5('0x3f')],function(_0x14aa91){var _0x23b3ba={};_0x23b3ba[_0x14aa91]={'$like':'%'+_0x3cbafd[_0xa4f5('0x3a')][_0xa4f5('0xcd')]+'%'};return _0x23b3ba;})});}_0x34c834[_0xa4f5('0xc4')]=db['User'];_0x34c834['as']='Agents';_0x34c834=_[_0xa4f5('0x50')]({},_0x34c834,_0x3cbafd[_0xa4f5('0x51')]);return _0x9e1d97[_0xa4f5('0xe8')]({'include':[_0x34c834]});}})[_0xa4f5('0x1c')](function(_0x1f1648){if(_0x1f1648){var _0x5ddc13={},_0x27ceaf=[];for(var _0x23e490=0x0;_0x23e490<_0x1f1648[_0xa4f5('0x44')];_0x23e490+=0x1){for(var _0x39dd62=0x0,_0x228b7f;_0x39dd62<_0x1f1648[_0x23e490]['Agents']['length'];_0x39dd62+=0x1){_0x228b7f=_0x1f1648[_0x23e490][_0xa4f5('0x24')][_0x39dd62][_0xa4f5('0x9b')]({'plain':!![]});_0x5ddc13[_0x228b7f['id']]=_0x228b7f;}}_0x5ddc13=_[_0xa4f5('0x113')](_0x5ddc13);for(var _0xc9975c=qs[_0xa4f5('0x18')](_0x3cbafd['query']['offset']);_0xc9975c<_0x5ddc13['length']&&_0x27ceaf[_0xa4f5('0x44')]=_0x30ee6b[_0x07b5('0x4c')]){throw new Error(_0x07b5('0x4d'));}})[_0x07b5('0x16')](function(){if(_0xe0360e){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xe0360e[_0x07b5('0x1f')]},'individualHooks':!![]});}})['then'](function(){if(_0xe0360e){return _0xe0360e['getVoiceQueues']({'raw':!![]});}})[_0x07b5('0x16')](function(_0x427134){if(_0xe0360e){if(_0x427134){var _0x43050c=[];_0x4fed1c=_0x427134;if(_0x4fed1c['length']){for(var _0x3c6ccb=0x0;_0x3c6ccb<_0x4fed1c['length'];_0x3c6ccb++){_0x43050c[_0x07b5('0x2a')](db['UserVoiceQueueRt'][_0x07b5('0x4e')]({'membername':_0xe0360e[_0x07b5('0x1f')],'UserId':_0xe0360e['id'],'queue_name':_0x4fed1c[_0x3c6ccb][_0x07b5('0x1f')],'VoiceQueueId':_0x4fed1c[_0x3c6ccb]['id'],'interface':_0x337900,'paused':_0xe0360e[_0x07b5('0x47')]||![],'penalty':_0x4fed1c[_0x3c6ccb][_0x07b5('0x4f')]||0x0}));}return BPromise[_0x07b5('0x44')](_0x43050c);}}}})[_0x07b5('0x16')](function(){if(_0xe0360e){return db[_0x07b5('0x24')][_0x07b5('0xe')]({'where':{'membername':_0xe0360e[_0x07b5('0x1f')],'exitAt':null}});}})[_0x07b5('0x16')](function(_0x259c36){if(_0xe0360e){if(_0x259c36&&_0x259c36[_0x07b5('0x25')]){var _0x2140ad=[];_0x259c36[_0x07b5('0x29')](function(_0xbf9eb9){_0x2140ad[_0x07b5('0x2a')](_0xbf9eb9[_0x07b5('0x23')]({'exitAt':moment()[_0x07b5('0x2b')](_0x07b5('0x26'))}));});return BPromise[_0x07b5('0x44')](_0x2140ad);}}})[_0x07b5('0x16')](function(){if(_0xe0360e){var _0x4d0676=[];var _0x5588ce=[];var _0x2ffde8=utils[_0x07b5('0x28')]();var _0x29ce8b={'membername':_0xe0360e[_0x07b5('0x1f')],'interface':_0x337900,'enterAt':moment()[_0x07b5('0x2b')](_0x07b5('0x26')),'role':_0xe0360e[_0x07b5('0x20')],'internal':_0xe0360e['internal']};_0x2ffde8[_0x07b5('0x29')](function(_0x4d7ed0){_0x4d0676[_0x07b5('0x2a')](_[_0x07b5('0x50')]({'channel':_0x4d7ed0,'type':_0x07b5('0x51'),'data1':'callysquare','data2':_0x337900},_0x29ce8b));if(_0xe0360e[_0x07b5('0x47')]){_0x5588ce[_0x07b5('0x2a')](_[_0x07b5('0x50')]({'channel':_0x4d7ed0,'type':_0x07b5('0x52'),'data1':_0x07b5('0x53')},_0x29ce8b));}});return db[_0x07b5('0x24')]['bulkCreate'](_0x4d0676[_0x07b5('0x54')](_0x5588ce),{'individualHooks':!![]});}})[_0x07b5('0x16')](function(){if(_0xe0360e){return _0xe0360e[_0x07b5('0x23')]({'online':!![],'lastLoginAt':moment()[_0x07b5('0x2b')](_0x07b5('0x26')),'voicePause':_0xe0360e['loginInPause']||![],'mailPause':_0xe0360e['loginInPause']||![],'chatPause':_0xe0360e['loginInPause']||![],'faxPause':_0xe0360e['loginInPause']||![],'smsPause':_0xe0360e[_0x07b5('0x47')]||![],'openchannelPause':_0xe0360e[_0x07b5('0x47')]||![],'pauseType':_0xe0360e['loginInPause']?_0x07b5('0x53'):null,'lastPauseAt':moment()[_0x07b5('0x2b')](_0x07b5('0x26')),'interface':_0x337900});}})[_0x07b5('0x16')](function(_0x45b033){_0x89992e(_0x45b033);})[_0x07b5('0x18')](function(_0x37ed5b){_0x333e12(_0x4eda6[_0x07b5('0x19')](0x1f4,_0x37ed5b[_0x07b5('0x1d')]));});});}; \ No newline at end of file +var _0xc030=['bulkCreate','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','faxPause','openchannelPause','whatsappPause','lastPauseAt','unpause','findOne','findAll','mobile','phone','loginInPause','SIP/%s','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','upsert','UserVoiceQueue.penalty','all','forEach','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','register','GetUser','User','options','raw','where','attributes','limit','map','model','include','then','info','debug','stringify','catch','error','message','ShowUser','find','name','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','push','body','type','DEFAULT\x20PAUSE','role','uniqueid','MemberReport'];(function(_0x3f0fee,_0x555486){var _0x263917=function(_0x489653){while(--_0x489653){_0x3f0fee['push'](_0x3f0fee['shift']());}};_0x263917(++_0x555486);}(_0xc030,0x1d6));var _0x0c03=function(_0x2c0124,_0x1e8ea3){_0x2c0124=_0x2c0124-0x0;var _0x5f4dca=_0xc030[_0x2c0124];return _0x5f4dca;};'use strict';var _=require(_0x0c03('0x0'));var util=require(_0x0c03('0x1'));var moment=require(_0x0c03('0x2'));var BPromise=require(_0x0c03('0x3'));var Redis=require(_0x0c03('0x4'));var db=require(_0x0c03('0x5'))['db'];var utils=require(_0x0c03('0x6'));var logger=require(_0x0c03('0x7'))(_0x0c03('0x8'));var config=require(_0x0c03('0x9'));config[_0x0c03('0xa')]=_[_0x0c03('0xb')](config[_0x0c03('0xa')],{'host':_0x0c03('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0x0c03('0xd')](socket);exports[_0x0c03('0xe')]=function(_0x2f625d){var _0x5d67f7=this;return new Promise(function(_0x5b164e,_0x5d682a){return db[_0x0c03('0xf')]['findAll']({'raw':_0x2f625d[_0x0c03('0x10')]?_0x2f625d[_0x0c03('0x10')][_0x0c03('0x11')]===undefined?!![]:![]:!![],'where':_0x2f625d['options']?_0x2f625d[_0x0c03('0x10')][_0x0c03('0x12')]||null:null,'attributes':_0x2f625d[_0x0c03('0x10')]?_0x2f625d['options'][_0x0c03('0x13')]||null:null,'limit':_0x2f625d[_0x0c03('0x10')]?_0x2f625d[_0x0c03('0x10')][_0x0c03('0x14')]||null:null,'include':_0x2f625d[_0x0c03('0x10')]?_0x2f625d[_0x0c03('0x10')]['include']?_[_0x0c03('0x15')](_0x2f625d[_0x0c03('0x10')]['include'],function(_0x27399c){return{'model':db[_0x27399c['model']],'as':_0x27399c['as'],'attributes':_0x27399c[_0x0c03('0x13')],'include':_0x27399c['include']?_[_0x0c03('0x15')](_0x27399c['include'],function(_0x17f240){return{'model':db[_0x17f240[_0x0c03('0x16')]],'as':_0x17f240['as'],'attributes':_0x17f240[_0x0c03('0x13')],'include':_0x17f240['include']?_['map'](_0x17f240[_0x0c03('0x17')],function(_0x3c5ee2){return{'model':db[_0x3c5ee2[_0x0c03('0x16')]],'as':_0x3c5ee2['as'],'attributes':_0x3c5ee2[_0x0c03('0x13')]};}):[]};}):[]};}):[]:[]})[_0x0c03('0x18')](function(_0x57776a){logger[_0x0c03('0x19')]('GetUser',_0x2f625d);logger[_0x0c03('0x1a')]('GetUser',_0x2f625d,JSON[_0x0c03('0x1b')](_0x57776a));_0x5b164e(_0x57776a);})[_0x0c03('0x1c')](function(_0x11cd97){logger[_0x0c03('0x1d')](_0x0c03('0xe'),_0x11cd97[_0x0c03('0x1e')],_0x2f625d);_0x5d682a(_0x5d67f7['error'](0x1f4,_0x11cd97[_0x0c03('0x1e')]));});});};exports[_0x0c03('0x1f')]=function(_0x1db3a4){var _0x4a38e5=this;return new Promise(function(_0x1dc822,_0x743f21){return db[_0x0c03('0xf')][_0x0c03('0x20')]({'raw':_0x1db3a4[_0x0c03('0x10')]?_0x1db3a4[_0x0c03('0x10')][_0x0c03('0x11')]===undefined?!![]:![]:!![],'where':_0x1db3a4[_0x0c03('0x10')]?_0x1db3a4[_0x0c03('0x10')]['where']||null:null,'attributes':_0x1db3a4[_0x0c03('0x10')]?_0x1db3a4[_0x0c03('0x10')][_0x0c03('0x13')]||null:null,'include':_0x1db3a4['options']?_0x1db3a4['options'][_0x0c03('0x17')]?_[_0x0c03('0x15')](_0x1db3a4[_0x0c03('0x10')][_0x0c03('0x17')],function(_0x3bb248){return{'model':db[_0x3bb248['model']],'as':_0x3bb248['as'],'attributes':_0x3bb248['attributes'],'include':_0x3bb248[_0x0c03('0x17')]?_[_0x0c03('0x15')](_0x3bb248[_0x0c03('0x17')],function(_0x14ae0e){return{'model':db[_0x14ae0e[_0x0c03('0x16')]],'as':_0x14ae0e['as'],'attributes':_0x14ae0e[_0x0c03('0x13')],'include':_0x14ae0e[_0x0c03('0x17')]?_['map'](_0x14ae0e[_0x0c03('0x17')],function(_0x19a41b){return{'model':db[_0x19a41b[_0x0c03('0x16')]],'as':_0x19a41b['as'],'attributes':_0x19a41b[_0x0c03('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b7eb4){logger[_0x0c03('0x19')](_0x0c03('0x1f'),_0x1db3a4);logger[_0x0c03('0x1a')](_0x0c03('0x1f'),_0x1db3a4,JSON[_0x0c03('0x1b')](_0x4b7eb4));_0x1dc822(_0x4b7eb4);})[_0x0c03('0x1c')](function(_0x38b4ae){logger[_0x0c03('0x1d')](_0x0c03('0x1f'),_0x38b4ae[_0x0c03('0x1e')],_0x1db3a4);_0x743f21(_0x4a38e5['error'](0x1f4,_0x38b4ae[_0x0c03('0x1e')]));});});};exports['PauseUser']=function(_0x1fef5d){var _0x51427d;return db[_0x0c03('0xf')]['find']({'where':_0x1fef5d[_0x0c03('0x10')][_0x0c03('0x12')]||{},'attributes':['id',_0x0c03('0x21'),'role',_0x0c03('0x22'),_0x0c03('0x23')]})[_0x0c03('0x18')](function(_0x170818){if(!_0x170818){throw new Error(util[_0x0c03('0x24')](_0x0c03('0x25'),_0x1fef5d[_0x0c03('0x26')]['id']));}_0x51427d=_0x170818;return db[_0x0c03('0x27')][_0x0c03('0x28')]({'paused':0x1},{'where':{'UserId':_0x51427d['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x51427d[_0x0c03('0x21')],'type':_0x0c03('0x29'),'exitAt':null}});})[_0x0c03('0x18')](function(_0x566a93){if(_0x566a93&&_0x566a93[_0x0c03('0x2a')]){var _0x4a6590=moment()[_0x0c03('0x24')](_0x0c03('0x2b'));for(var _0x169e8d=0x0,_0x2536a5=_0x566a93[_0x0c03('0x2a')];_0x169e8d<_0x2536a5;_0x169e8d++){_0x566a93[_0x169e8d]['updateAttributes']({'exitAt':_0x4a6590});}}})['then'](function(){var _0x321168=[];var _0x28402b=utils[_0x0c03('0x2c')]();_0x28402b['forEach'](function(_0x924538){_0x321168[_0x0c03('0x2d')]({'channel':_0x924538,'membername':_0x51427d[_0x0c03('0x21')],'interface':_['isNil'](_0x51427d['interface'])?util['format']('SIP/%s',_0x51427d[_0x0c03('0x21')]):_0x51427d['interface'],'type':_0x0c03('0x29'),'enterAt':moment()[_0x0c03('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1fef5d[_0x0c03('0x2e')][_0x0c03('0x2f')]||_0x0c03('0x30'),'role':_0x51427d[_0x0c03('0x31')],'internal':_0x51427d[_0x0c03('0x22')],'uniqueid':_0x1fef5d[_0x0c03('0x2e')][_0x0c03('0x32')]||null});});return db[_0x0c03('0x33')][_0x0c03('0x34')](_0x321168,{'individualHooks':!![]});})[_0x0c03('0x18')](function(){return _0x51427d[_0x0c03('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1fef5d['body'][_0x0c03('0x2f')]||_0x0c03('0x30'),'lastPauseAt':moment()[_0x0c03('0x24')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0c03('0x1c')](function(_0x43867b){throw _0x43867b;});};exports[_0x0c03('0x35')]=function(_0x5dd757){return Promise[_0x0c03('0x36')]()[_0x0c03('0x18')](function(){if(_0x5dd757[_0x0c03('0x2e')][_0x0c03('0x37')]&&!utils['isValidChannel'](_0x5dd757[_0x0c03('0x2e')][_0x0c03('0x37')])){throw new Error(util[_0x0c03('0x24')](_0x0c03('0x38'),_0x5dd757[_0x0c03('0x2e')][_0x0c03('0x37')]));}return db[_0x0c03('0xf')]['findOne']({'where':_0x5dd757[_0x0c03('0x10')][_0x0c03('0x12')]||{},'attributes':['id','name','role',_0x0c03('0x22'),_0x0c03('0x23'),_0x0c03('0x39'),_0x0c03('0x3a'),_0x0c03('0x3b'),'chatPause',_0x0c03('0x3c'),_0x0c03('0x3d'),'smsPause',_0x0c03('0x3e'),'pauseType',_0x0c03('0x3f')]});})[_0x0c03('0x18')](function(_0x347d2a){if(!_0x347d2a){throw new Error(util['format'](_0x0c03('0x25'),_0x5dd757['params']['id']));}return _0x347d2a[_0x0c03('0x40')](_0x5dd757['body'][_0x0c03('0x37')],'system');})[_0x0c03('0x1c')](function(_0x546049){throw _0x546049;});};exports['LogoutUser']=function(_0x2f9eab){var _0x572075=this;return new Promise(function(_0x2b3104,_0xef5944){var _0x3c266a;return db[_0x0c03('0xf')][_0x0c03('0x41')]({'where':_0x2f9eab[_0x0c03('0x10')][_0x0c03('0x12')]||{},'attributes':['id','name']})['then'](function(_0x16496f){if(_0x16496f){_0x3c266a=_0x16496f;return db[_0x0c03('0x27')]['destroy']({'where':{'membername':_0x3c266a['name']},'individualHooks':!![]});}})['then'](function(){if(_0x3c266a){return db[_0x0c03('0x33')][_0x0c03('0x42')]({'where':{'membername':_0x3c266a[_0x0c03('0x21')],'exitAt':null}});}})[_0x0c03('0x18')](function(_0x180a9c){if(_0x3c266a){if(_0x180a9c&&_0x180a9c[_0x0c03('0x2a')]){var _0x93abad=[];_0x180a9c['forEach'](function(_0xd3e145){_0x93abad['push'](_0xd3e145['update']({'exitAt':moment()[_0x0c03('0x24')](_0x0c03('0x2b'))}));});return BPromise['all'](_0x93abad);}}})[_0x0c03('0x18')](function(){if(_0x3c266a){return _0x3c266a[_0x0c03('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x0c03('0x18')](function(_0xba9a2){_0x2b3104(_0xba9a2);})[_0x0c03('0x1c')](function(_0x25d274){_0xef5944(_0x572075[_0x0c03('0x1d')](0x1f4,_0x25d274[_0x0c03('0x1e')]));});});};exports['LoginUser']=function(_0x38e8f4){var _0xedf41b=this;return new Promise(function(_0x4c7903,_0x5e09e3){var _0x3366a6;var _0x11c0c3;var _0x1d27f3;var _0x19a250;return db[_0x0c03('0xf')][_0x0c03('0x41')]({'where':_0x38e8f4[_0x0c03('0x10')]['where']||{},'attributes':['id',_0x0c03('0x21'),'role',_0x0c03('0x43'),_0x0c03('0x44'),'internal',_0x0c03('0x45'),_0x0c03('0x23')]})[_0x0c03('0x18')](function(_0xe7f0ee){if(_0xe7f0ee){_0x3366a6=_0xe7f0ee;_0x19a250=_0x38e8f4[_0x0c03('0x2e')]['interface']?_0x38e8f4[_0x0c03('0x2e')][_0x0c03('0x23')]:util[_0x0c03('0x24')](_0x0c03('0x46'),_0x3366a6[_0x0c03('0x21')]);return db[_0x0c03('0xf')][_0x0c03('0x47')]({'where':{'role':_0x0c03('0x48'),'online':!![],'id':{'$ne':_0x3366a6['id']}}});}})['then'](function(_0x3ef5b5){if(_0x3ef5b5){_0x1d27f3=_0x3ef5b5;return require('../../config/license/util')[_0x0c03('0x49')]();}})[_0x0c03('0x18')](function(_0x39d145){if(_0x39d145&&_0x39d145[_0x0c03('0x4a')]&&_0x1d27f3>=_0x39d145[_0x0c03('0x4a')]){throw new Error(_0x0c03('0x4b'));}})['then'](function(){if(_0x3366a6){return db[_0x0c03('0x27')][_0x0c03('0x4c')]({'where':{'membername':_0x3366a6[_0x0c03('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x3366a6){return _0x3366a6[_0x0c03('0x4d')]({'raw':!![]});}})[_0x0c03('0x18')](function(_0x2e2313){if(_0x3366a6){if(_0x2e2313){var _0x9acb6a=[];_0x11c0c3=_0x2e2313;if(_0x11c0c3['length']){for(var _0x37cdb0=0x0;_0x37cdb0<_0x11c0c3[_0x0c03('0x2a')];_0x37cdb0++){_0x9acb6a[_0x0c03('0x2d')](db[_0x0c03('0x27')][_0x0c03('0x4e')]({'membername':_0x3366a6[_0x0c03('0x21')],'UserId':_0x3366a6['id'],'queue_name':_0x11c0c3[_0x37cdb0][_0x0c03('0x21')],'VoiceQueueId':_0x11c0c3[_0x37cdb0]['id'],'interface':_0x19a250,'paused':_0x3366a6[_0x0c03('0x45')]||![],'penalty':_0x11c0c3[_0x37cdb0][_0x0c03('0x4f')]||0x0}));}return BPromise[_0x0c03('0x50')](_0x9acb6a);}}}})[_0x0c03('0x18')](function(){if(_0x3366a6){return db[_0x0c03('0x33')]['findAll']({'where':{'membername':_0x3366a6[_0x0c03('0x21')],'exitAt':null}});}})[_0x0c03('0x18')](function(_0xbff9d2){if(_0x3366a6){if(_0xbff9d2&&_0xbff9d2[_0x0c03('0x2a')]){var _0x4e0dd9=[];_0xbff9d2[_0x0c03('0x51')](function(_0x221ab4){_0x4e0dd9[_0x0c03('0x2d')](_0x221ab4[_0x0c03('0x28')]({'exitAt':moment()[_0x0c03('0x24')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0c03('0x50')](_0x4e0dd9);}}})[_0x0c03('0x18')](function(){if(_0x3366a6){var _0x2af560=[];var _0x2a729c=[];var _0x13f4aa=utils[_0x0c03('0x2c')]();var _0x19761a={'membername':_0x3366a6[_0x0c03('0x21')],'interface':_0x19a250,'enterAt':moment()[_0x0c03('0x24')](_0x0c03('0x2b')),'role':_0x3366a6[_0x0c03('0x31')],'internal':_0x3366a6[_0x0c03('0x22')]};_0x13f4aa['forEach'](function(_0x5c4d13){_0x2af560[_0x0c03('0x2d')](_['merge']({'channel':_0x5c4d13,'type':_0x0c03('0x52'),'data1':_0x0c03('0x53'),'data2':_0x19a250},_0x19761a));if(_0x3366a6[_0x0c03('0x45')]){_0x2a729c[_0x0c03('0x2d')](_[_0x0c03('0x54')]({'channel':_0x5c4d13,'type':_0x0c03('0x29'),'data1':_0x0c03('0x55')},_0x19761a));}});return db[_0x0c03('0x33')][_0x0c03('0x34')](_0x2af560[_0x0c03('0x56')](_0x2a729c),{'individualHooks':!![]});}})[_0x0c03('0x18')](function(){if(_0x3366a6){return _0x3366a6['update']({'online':!![],'lastLoginAt':moment()[_0x0c03('0x24')](_0x0c03('0x2b')),'voicePause':_0x3366a6[_0x0c03('0x45')]||![],'mailPause':_0x3366a6[_0x0c03('0x45')]||![],'chatPause':_0x3366a6[_0x0c03('0x45')]||![],'faxPause':_0x3366a6[_0x0c03('0x45')]||![],'smsPause':_0x3366a6[_0x0c03('0x45')]||![],'openchannelPause':_0x3366a6['loginInPause']||![],'pauseType':_0x3366a6[_0x0c03('0x45')]?_0x0c03('0x55'):null,'lastPauseAt':moment()[_0x0c03('0x24')](_0x0c03('0x2b')),'interface':_0x19a250});}})[_0x0c03('0x18')](function(_0x28fe56){_0x4c7903(_0x28fe56);})['catch'](function(_0x4b4214){_0x5e09e3(_0xedf41b[_0x0c03('0x1d')](0x1f4,_0x4b4214[_0x0c03('0x1e')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 37cd98b..7ea689b 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 _0xa6cb=['removeListener','register','user:','./user.events','save','emit'];(function(_0x3d6b37,_0xfcf4cf){var _0x25be72=function(_0x47705b){while(--_0x47705b){_0x3d6b37['push'](_0x3d6b37['shift']());}};_0x25be72(++_0xfcf4cf);}(_0xa6cb,0x1e3));var _0xba6c=function(_0x6bf34,_0x1726f1){_0x6bf34=_0x6bf34-0x0;var _0x38f05c=_0xa6cb[_0x6bf34];return _0x38f05c;};'use strict';var UserEvents=require(_0xba6c('0x0'));var events=[_0xba6c('0x1'),'remove','update'];function createListener(_0x37acc7,_0x417b12){return function(_0xa6dd80){_0x417b12[_0xba6c('0x2')](_0x37acc7,_0xa6dd80);};}function removeListener(_0x43b28c,_0x2169dd){return function(){UserEvents[_0xba6c('0x3')](_0x43b28c,_0x2169dd);};}exports[_0xba6c('0x4')]=function(_0xb1655){for(var _0xb42738=0x0,_0x38c6a0=events['length'];_0xb42738<_0x38c6a0;_0xb42738++){var _0x44b7fd=events[_0xb42738];var _0x48b1da=createListener(_0xba6c('0x5')+_0x44b7fd,_0xb1655);UserEvents['on'](_0x44b7fd,_0x48b1da);}}; \ No newline at end of file +var _0x1410=['./user.events','save','update','user:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1410,0x1bc));var _0x0141=function(_0x114218,_0x1c2f74){_0x114218=_0x114218-0x0;var _0x545e6c=_0x1410[_0x114218];return _0x545e6c;};'use strict';var UserEvents=require(_0x0141('0x0'));var events=[_0x0141('0x1'),'remove',_0x0141('0x2')];function createListener(_0x595b4a,_0x5e9b69){return function(_0xba0cc3){_0x5e9b69['emit'](_0x595b4a,_0xba0cc3);};}function removeListener(_0x30352e,_0x482bb0){return function(){UserEvents['removeListener'](_0x30352e,_0x482bb0);};}exports['register']=function(_0x4516da){for(var _0x130d14=0x0,_0x355658=events['length'];_0x130d14<_0x355658;_0x130d14++){var _0x484d24=events[_0x130d14];var _0x2b9208=createListener(_0x0141('0x3')+_0x484d24,_0x4516da);UserEvents['on'](_0x484d24,_0x2b9208);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index f1cebb9..81d425c 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5f27aa,_0x8d0e3c){var _0x2bcd87=function(_0x3f6c54){while(--_0x3f6c54){_0x5f27aa['push'](_0x5f27aa['shift']());}};_0x2bcd87(++_0x8d0e3c);}(_0x70e0,0x17b));var _0x070e=function(_0x54f5e8,_0x2f61ad){_0x54f5e8=_0x54f5e8-0x0;var _0x5f452b=_0x70e0[_0x54f5e8];return _0x5f452b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3a0633,_0x120c59){var _0x58341e=function(_0x1ecb29){while(--_0x1ecb29){_0x3a0633['push'](_0x3a0633['shift']());}};_0x58341e(++_0x120c59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index ea0ef75..148be77 100644 --- a/server/api/userChatQueue/userChatQueue.attributes.js +++ b/server/api/userChatQueue/userChatQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13b3=['INTEGER','sequelize','exports'];(function(_0x589086,_0x14fbec){var _0x4316dd=function(_0x15ee08){while(--_0x15ee08){_0x589086['push'](_0x589086['shift']());}};_0x4316dd(++_0x14fbec);}(_0x13b3,0x6a));var _0x313b=function(_0xa9b067,_0x2047eb){_0xa9b067=_0xa9b067-0x0;var _0x492156=_0x13b3[_0xa9b067];return _0x492156;};'use strict';var Sequelize=require(_0x313b('0x0'));module[_0x313b('0x1')]={'penalty':{'type':Sequelize[_0x313b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2c53=['sequelize','exports','INTEGER'];(function(_0x2945bf,_0x4b9ab4){var _0x1c78bb=function(_0xff0f4){while(--_0xff0f4){_0x2945bf['push'](_0x2945bf['shift']());}};_0x1c78bb(++_0x4b9ab4);}(_0x2c53,0x17a));var _0x32c5=function(_0x4ae58a,_0x72bd08){_0x4ae58a=_0x4ae58a-0x0;var _0x3c0445=_0x2c53[_0x4ae58a];return _0x3c0445;};'use strict';var Sequelize=require(_0x32c5('0x0'));module[_0x32c5('0x1')]={'penalty':{'type':Sequelize[_0x32c5('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index ef95da9..b43c3ef 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 _0x50cf=['path','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2831eb,_0x126248){var _0x117220=function(_0x113038){while(--_0x113038){_0x2831eb['push'](_0x2831eb['shift']());}};_0x117220(++_0x126248);}(_0x50cf,0x10d));var _0xf50c=function(_0x387e7a,_0x20349c){_0x387e7a=_0x387e7a-0x0;var _0x179558=_0x50cf[_0x387e7a];return _0x179558;};'use strict';var _=require(_0xf50c('0x0'));var util=require(_0xf50c('0x1'));var logger=require(_0xf50c('0x2'))(_0xf50c('0x3'));var moment=require(_0xf50c('0x4'));var BPromise=require(_0xf50c('0x5'));var rp=require(_0xf50c('0x6'));var fs=require('fs');var path=require(_0xf50c('0x7'));var rimraf=require('rimraf');var config=require(_0xf50c('0x8'));var attributes=require(_0xf50c('0x9'));module[_0xf50c('0xa')]=function(_0x37ac90,_0x3539b7){return _0x37ac90['define'](_0xf50c('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc086=['api','moment','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','user_has_chat_queues','lodash','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc086,0x116));var _0x6c08=function(_0x1df236,_0x58557a){_0x1df236=_0x1df236-0x0;var _0x5d8aa1=_0xc086[_0x1df236];return _0x5d8aa1;};'use strict';var _=require(_0x6c08('0x0'));var util=require(_0x6c08('0x1'));var logger=require('../../config/logger')(_0x6c08('0x2'));var moment=require(_0x6c08('0x3'));var BPromise=require(_0x6c08('0x4'));var rp=require(_0x6c08('0x5'));var fs=require('fs');var path=require(_0x6c08('0x6'));var rimraf=require(_0x6c08('0x7'));var config=require('../../config/environment');var attributes=require(_0x6c08('0x8'));module['exports']=function(_0x2a8475,_0x559ec4){return _0x2a8475['define']('UserChatQueue',attributes,{'tableName':_0x6c08('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index ee9dafb..71d4d07 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 _0x8472=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request','then','info'];(function(_0x28d6c0,_0x23864c){var _0x19cc03=function(_0x293ab3){while(--_0x293ab3){_0x28d6c0['push'](_0x28d6c0['shift']());}};_0x19cc03(++_0x23864c);}(_0x8472,0x1c2));var _0x2847=function(_0xfbc78a,_0x55ba87){_0xfbc78a=_0xfbc78a-0x0;var _0x1ae9b7=_0x8472[_0xfbc78a];return _0x1ae9b7;};'use strict';var _=require(_0x2847('0x0'));var util=require('util');var moment=require(_0x2847('0x1'));var BPromise=require(_0x2847('0x2'));var rs=require(_0x2847('0x3'));var fs=require('fs');var Redis=require(_0x2847('0x4'));var db=require(_0x2847('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2847('0x6'));var client=jayson[_0x2847('0x7')][_0x2847('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x736a3f,_0x1af9ac,_0x5731f3){return new BPromise(function(_0x268e75,_0x3adce9){return client[_0x2847('0x9')](_0x736a3f,_0x5731f3)[_0x2847('0xa')](function(_0x409047){logger[_0x2847('0xb')](_0x2847('0xc'),_0x1af9ac,_0x2847('0xd'));logger[_0x2847('0xe')](_0x2847('0xf'),_0x1af9ac,_0x2847('0xd'),JSON[_0x2847('0x10')](_0x409047));if(_0x409047[_0x2847('0x11')]){if(_0x409047['error'][_0x2847('0x12')]===0x1f4){logger[_0x2847('0x11')](_0x2847('0xc'),_0x1af9ac,_0x409047[_0x2847('0x11')][_0x2847('0x13')]);return _0x3adce9(_0x409047[_0x2847('0x11')][_0x2847('0x13')]);}logger[_0x2847('0x11')](_0x2847('0xc'),_0x1af9ac,_0x409047[_0x2847('0x11')][_0x2847('0x13')]);return _0x268e75(_0x409047[_0x2847('0x11')]['message']);}else{logger[_0x2847('0xb')](_0x2847('0xc'),_0x1af9ac,_0x2847('0xd'));_0x268e75(_0x409047[_0x2847('0x14')][_0x2847('0x13')]);}})[_0x2847('0x15')](function(_0x2d5e01){logger[_0x2847('0x11')](_0x2847('0xc'),_0x1af9ac,_0x2d5e01);_0x3adce9(_0x2d5e01);});});} \ No newline at end of file +var _0x69ae=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x69ae,0xc1));var _0xe69a=function(_0x412a1b,_0x20d145){_0x412a1b=_0x412a1b-0x0;var _0x16926c=_0x69ae[_0x412a1b];return _0x16926c;};'use strict';var _=require(_0xe69a('0x0'));var util=require(_0xe69a('0x1'));var moment=require(_0xe69a('0x2'));var BPromise=require(_0xe69a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe69a('0x4'));var db=require(_0xe69a('0x5'))['db'];var utils=require(_0xe69a('0x6'));var logger=require(_0xe69a('0x7'))(_0xe69a('0x8'));var config=require(_0xe69a('0x9'));var jayson=require(_0xe69a('0xa'));var client=jayson[_0xe69a('0xb')][_0xe69a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf642b4,_0x53752f,_0xdcc6de){return new BPromise(function(_0x49f1c3,_0x480389){return client[_0xe69a('0xd')](_0xf642b4,_0xdcc6de)['then'](function(_0x4cd15c){logger[_0xe69a('0xe')](_0xe69a('0xf'),_0x53752f,_0xe69a('0x10'));logger[_0xe69a('0x11')](_0xe69a('0x12'),_0x53752f,_0xe69a('0x10'),JSON[_0xe69a('0x13')](_0x4cd15c));if(_0x4cd15c['error']){if(_0x4cd15c[_0xe69a('0x14')]['code']===0x1f4){logger[_0xe69a('0x14')](_0xe69a('0xf'),_0x53752f,_0x4cd15c['error'][_0xe69a('0x15')]);return _0x480389(_0x4cd15c[_0xe69a('0x14')][_0xe69a('0x15')]);}logger['error'](_0xe69a('0xf'),_0x53752f,_0x4cd15c['error'][_0xe69a('0x15')]);return _0x49f1c3(_0x4cd15c[_0xe69a('0x14')][_0xe69a('0x15')]);}else{logger[_0xe69a('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x53752f,_0xe69a('0x10'));_0x49f1c3(_0x4cd15c[_0xe69a('0x16')][_0xe69a('0x15')]);}})[_0xe69a('0x17')](function(_0x930563){logger['error'](_0xe69a('0xf'),_0x53752f,_0x930563);_0x480389(_0x930563);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 7d66bba..7037145 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x49d7c8,_0x52d9a3){var _0x450089=function(_0x1ed0d7){while(--_0x1ed0d7){_0x49d7c8['push'](_0x49d7c8['shift']());}};_0x450089(++_0x52d9a3);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1dcc5e,_0x500eb7){var _0x1cc7c8=function(_0x366247){while(--_0x366247){_0x1dcc5e['push'](_0x1dcc5e['shift']());}};_0x1cc7c8(++_0x500eb7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xcb91[_0x872b02];return _0x1a6b24;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f5547a3..cbdf6b7 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 _0xfce1=['exports','INTEGER','STRING'];(function(_0x3c7dcd,_0x2109e2){var _0x3d73fe=function(_0x4d1a25){while(--_0x4d1a25){_0x3c7dcd['push'](_0x3c7dcd['shift']());}};_0x3d73fe(++_0x2109e2);}(_0xfce1,0x111));var _0x1fce=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xfce1[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require('sequelize');module[_0x1fce('0x0')]={'penalty':{'type':Sequelize[_0x1fce('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1fce('0x2')]}}; \ No newline at end of file +var _0x4ab5=['INTEGER','STRING','exports'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0x4ab5,0x95));var _0x54ab=function(_0x9ab282,_0x224526){_0x9ab282=_0x9ab282-0x0;var _0x3ae406=_0x4ab5[_0x9ab282];return _0x3ae406;};'use strict';var Sequelize=require('sequelize');module[_0x54ab('0x0')]={'penalty':{'type':Sequelize[_0x54ab('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x54ab('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x54ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 4151d19..54a53b5 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 _0xa9b2=['define','user_has_fax_queues','lodash','util','bluebird','path'];(function(_0x208162,_0x2dd393){var _0x26618a=function(_0x26843c){while(--_0x26843c){_0x208162['push'](_0x208162['shift']());}};_0x26618a(++_0x2dd393);}(_0xa9b2,0xe0));var _0x2a9b=function(_0x29cb61,_0x494484){_0x29cb61=_0x29cb61-0x0;var _0x21d3e0=_0xa9b2[_0x29cb61];return _0x21d3e0;};'use strict';var _=require(_0x2a9b('0x0'));var util=require(_0x2a9b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2a9b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a9b('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0xe040da,_0x47066e){return _0xe040da[_0x2a9b('0x4')]('UserFaxQueue',attributes,{'tableName':_0x2a9b('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf708=['../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0xf708,0x1b1));var _0x8f70=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf708[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8f70('0x0'));var util=require(_0x8f70('0x1'));var logger=require(_0x8f70('0x2'))(_0x8f70('0x3'));var moment=require(_0x8f70('0x4'));var BPromise=require(_0x8f70('0x5'));var rp=require(_0x8f70('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8f70('0x7'));var attributes=require(_0x8f70('0x8'));module['exports']=function(_0x194d16,_0x41b30d){return _0x194d16['define'](_0x8f70('0x9'),attributes,{'tableName':_0x8f70('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 6fe5a55..920d534 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 _0x947b=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x947b,0x171));var _0xb947=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x947b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb947('0x0'));var util=require(_0xb947('0x1'));var moment=require(_0xb947('0x2'));var BPromise=require(_0xb947('0x3'));var rs=require(_0xb947('0x4'));var fs=require('fs');var Redis=require(_0xb947('0x5'));var db=require(_0xb947('0x6'))['db'];var utils=require(_0xb947('0x7'));var logger=require(_0xb947('0x8'))(_0xb947('0x9'));var config=require(_0xb947('0xa'));var jayson=require(_0xb947('0xb'));var client=jayson[_0xb947('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x482f00,_0x4f2b0e,_0x43dc43){return new BPromise(function(_0x4b4fec,_0x53dc74){return client['request'](_0x482f00,_0x43dc43)[_0xb947('0xd')](function(_0x271807){logger[_0xb947('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4f2b0e,_0xb947('0xf'));logger[_0xb947('0x10')](_0xb947('0x11'),_0x4f2b0e,_0xb947('0xf'),JSON[_0xb947('0x12')](_0x271807));if(_0x271807['error']){if(_0x271807[_0xb947('0x13')][_0xb947('0x14')]===0x1f4){logger[_0xb947('0x13')](_0xb947('0x15'),_0x4f2b0e,_0x271807[_0xb947('0x13')]['message']);return _0x53dc74(_0x271807[_0xb947('0x13')][_0xb947('0x16')]);}logger[_0xb947('0x13')](_0xb947('0x15'),_0x4f2b0e,_0x271807[_0xb947('0x13')][_0xb947('0x16')]);return _0x4b4fec(_0x271807[_0xb947('0x13')]['message']);}else{logger[_0xb947('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x4f2b0e,'request\x20sent');_0x4b4fec(_0x271807[_0xb947('0x17')][_0xb947('0x16')]);}})['catch'](function(_0x300452){logger['error'](_0xb947('0x15'),_0x4f2b0e,_0x300452);_0x53dc74(_0x300452);});});} \ No newline at end of file +var _0xebdc=['../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4843cf,_0x480cb5){var _0x52ad78=function(_0xc6def3){while(--_0xc6def3){_0x4843cf['push'](_0x4843cf['shift']());}};_0x52ad78(++_0x480cb5);}(_0xebdc,0x163));var _0xcebd=function(_0x39591a,_0x30c9f4){_0x39591a=_0x39591a-0x0;var _0x4becc2=_0xebdc[_0x39591a];return _0x4becc2;};'use strict';var _=require(_0xcebd('0x0'));var util=require('util');var moment=require(_0xcebd('0x1'));var BPromise=require('bluebird');var rs=require(_0xcebd('0x2'));var fs=require('fs');var Redis=require(_0xcebd('0x3'));var db=require(_0xcebd('0x4'))['db'];var utils=require(_0xcebd('0x5'));var logger=require(_0xcebd('0x6'))(_0xcebd('0x7'));var config=require('../../config/environment');var jayson=require(_0xcebd('0x8'));var client=jayson[_0xcebd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fa197,_0x2dd635,_0x51721f){return new BPromise(function(_0x163a27,_0x2c9b28){return client['request'](_0x1fa197,_0x51721f)[_0xcebd('0xa')](function(_0x605225){logger[_0xcebd('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x2dd635,_0xcebd('0xc'));logger[_0xcebd('0xd')](_0xcebd('0xe'),_0x2dd635,_0xcebd('0xc'),JSON[_0xcebd('0xf')](_0x605225));if(_0x605225[_0xcebd('0x10')]){if(_0x605225['error']['code']===0x1f4){logger[_0xcebd('0x10')](_0xcebd('0x11'),_0x2dd635,_0x605225[_0xcebd('0x10')][_0xcebd('0x12')]);return _0x2c9b28(_0x605225[_0xcebd('0x10')]['message']);}logger[_0xcebd('0x10')](_0xcebd('0x11'),_0x2dd635,_0x605225[_0xcebd('0x10')][_0xcebd('0x12')]);return _0x163a27(_0x605225[_0xcebd('0x10')][_0xcebd('0x12')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x2dd635,_0xcebd('0xc'));_0x163a27(_0x605225['result']['message']);}})['catch'](function(_0xa4d8fb){logger['error'](_0xcebd('0x11'),_0x2dd635,_0xa4d8fb);_0x2c9b28(_0xa4d8fb);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 0f71252..69452ae 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2db9d2,_0x360ca1){var _0xbea496=function(_0x44717d){while(--_0x44717d){_0x2db9d2['push'](_0x2db9d2['shift']());}};_0xbea496(++_0x360ca1);}(_0x70e0,0x17b));var _0x070e=function(_0x521ef0,_0x4562de){_0x521ef0=_0x521ef0-0x0;var _0x425039=_0x70e0[_0x521ef0];return _0x425039;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4a7125,_0x247ae8){var _0x1032ad=function(_0x5b57c9){while(--_0x5b57c9){_0x4a7125['push'](_0x4a7125['shift']());}};_0x1032ad(++_0x247ae8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2c3255,_0x4e00ae){_0x2c3255=_0x2c3255-0x0;var _0x282aba=_0xcb91[_0x2c3255];return _0x282aba;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 8d2c35a..e9a8a3a 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 _0x70e1=['exports'];(function(_0x15fc3a,_0x5c6f46){var _0x29fdf7=function(_0x393615){while(--_0x393615){_0x15fc3a['push'](_0x15fc3a['shift']());}};_0x29fdf7(++_0x5c6f46);}(_0x70e1,0x101));var _0x170e=function(_0x3cebff,_0x20b43d){_0x3cebff=_0x3cebff-0x0;var _0x6e5423=_0x70e1[_0x3cebff];return _0x6e5423;};'use strict';var Sequelize=require('sequelize');module[_0x170e('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xeb74=['exports','INTEGER','sequelize'];(function(_0x1dd975,_0x153134){var _0xb0d8f2=function(_0x2e0567){while(--_0x2e0567){_0x1dd975['push'](_0x1dd975['shift']());}};_0xb0d8f2(++_0x153134);}(_0xeb74,0x143));var _0x4eb7=function(_0x27f42e,_0x208c57){_0x27f42e=_0x27f42e-0x0;var _0x497e27=_0xeb74[_0x27f42e];return _0x497e27;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'penalty':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index bdc88cf..6b27117 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 _0x36ef=['request-promise','path','../../config/environment','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x36ef,0x6a));var _0xf36e=function(_0x8214b7,_0x55ce93){_0x8214b7=_0x8214b7-0x0;var _0x46520b=_0x36ef[_0x8214b7];return _0x46520b;};'use strict';var _=require(_0xf36e('0x0'));var util=require(_0xf36e('0x1'));var logger=require(_0xf36e('0x2'))(_0xf36e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf36e('0x4'));var fs=require('fs');var path=require(_0xf36e('0x5'));var rimraf=require('rimraf');var config=require(_0xf36e('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x184b9b,_0x19d094){return _0x184b9b[_0xf36e('0x7')](_0xf36e('0x8'),attributes,{'tableName':_0xf36e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6fa8=['exports','UserMailQueue','user_has_mail_queues','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x228893,_0x344ba8){var _0x401e54=function(_0x56b6e2){while(--_0x56b6e2){_0x228893['push'](_0x228893['shift']());}};_0x401e54(++_0x344ba8);}(_0x6fa8,0x193));var _0x86fa=function(_0x17a329,_0x5d2f43){_0x17a329=_0x17a329-0x0;var _0x761387=_0x6fa8[_0x17a329];return _0x761387;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x86fa('0x0'));var rp=require(_0x86fa('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86fa('0x2'));var config=require(_0x86fa('0x3'));var attributes=require(_0x86fa('0x4'));module[_0x86fa('0x5')]=function(_0x43c913,_0x4d4209){return _0x43c913['define'](_0x86fa('0x6'),attributes,{'tableName':_0x86fa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 4c7d587..ba3701b 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5e1b88,_0xcbae5f){var _0x3a278b=function(_0x509ec7){while(--_0x509ec7){_0x5e1b88['push'](_0x5e1b88['shift']());}};_0x3a278b(++_0xcbae5f);}(_0x00bb,0x1d8));var _0xb00b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x00bb[_0x24237f];return _0x48298e;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3fd43a,_0xc996b){_0x3fd43a=_0x3fd43a-0x0;var _0xcdfbbe=_0x1cb9[_0x3fd43a];return _0xcdfbbe;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 4b7dee2..26efa50 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 _0x013c=['isAuthenticated','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','post'];(function(_0x409237,_0xe36701){var _0x2b3e72=function(_0x9c719f){while(--_0x9c719f){_0x409237['push'](_0x409237['shift']());}};_0x2b3e72(++_0xe36701);}(_0x013c,0xa1));var _0xc013=function(_0x77fd25,_0x226ea2){_0x77fd25=_0x77fd25-0x0;var _0xe14528=_0x013c[_0x77fd25];return _0xe14528;};'use strict';var multer=require(_0xc013('0x0'));var util=require(_0xc013('0x1'));var path=require('path');var timeout=require(_0xc013('0x2'));var express=require(_0xc013('0x3'));var router=express[_0xc013('0x4')]();var fs_extra=require(_0xc013('0x5'));var auth=require(_0xc013('0x6'));var interaction=require(_0xc013('0x7'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0xc013('0x8')]('/',auth[_0xc013('0x9')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0xa1bb=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','util'];(function(_0x425755,_0x16e311){var _0x38c60b=function(_0x22a7fa){while(--_0x22a7fa){_0x425755['push'](_0x425755['shift']());}};_0x38c60b(++_0x16e311);}(_0xa1bb,0x133));var _0xba1b=function(_0x3e2dcc,_0x1d1bbc){_0x3e2dcc=_0x3e2dcc-0x0;var _0x2a512c=_0xa1bb[_0x3e2dcc];return _0x2a512c;};'use strict';var multer=require('multer');var util=require(_0xba1b('0x0'));var path=require('path');var timeout=require(_0xba1b('0x1'));var express=require(_0xba1b('0x2'));var router=express[_0xba1b('0x3')]();var fs_extra=require(_0xba1b('0x4'));var auth=require(_0xba1b('0x5'));var interaction=require(_0xba1b('0x6'));var config=require(_0xba1b('0x7'));var controller=require(_0xba1b('0x8'));router['post']('/',auth[_0xba1b('0x9')](),controller[_0xba1b('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index f8de0b2..6d86856 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 _0xe770=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x5d10db,_0x438ddb){var _0x3c4d71=function(_0x23fdb3){while(--_0x23fdb3){_0x5d10db['push'](_0x5d10db['shift']());}};_0x3c4d71(++_0x438ddb);}(_0xe770,0x71));var _0x0e77=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe770[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x0e77('0x0'));module[_0x0e77('0x1')]={'body':{'type':Sequelize[_0x0e77('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x0e77('0x3')]},'beep':{'type':Sequelize[_0x0e77('0x4')]}}; \ No newline at end of file +var _0x779d=['STRING','sequelize','exports','TEXT'];(function(_0x24afaa,_0x19e02c){var _0x2dda49=function(_0x2ae629){while(--_0x2ae629){_0x24afaa['push'](_0x24afaa['shift']());}};_0x2dda49(++_0x19e02c);}(_0x779d,0xd1));var _0xd779=function(_0x65f242,_0x1abc83){_0x65f242=_0x65f242-0x0;var _0x2cd082=_0x779d[_0x65f242];return _0x2cd082;};'use strict';var Sequelize=require(_0xd779('0x0'));module[_0xd779('0x1')]={'body':{'type':Sequelize[_0xd779('0x2')]},'senderName':{'type':Sequelize[_0xd779('0x3')]},'recipientsId':{'type':Sequelize[_0xd779('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 16cdd73..a7bd5a9 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 _0x2f02=['mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','recipientsDescription','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','model','User','union','replace','queue','Queue','ids','all','flatten','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue'];(function(_0x47a1a6,_0xc94b73){var _0x25a378=function(_0x49edb0){while(--_0x49edb0){_0x47a1a6['push'](_0x47a1a6['shift']());}};_0x25a378(++_0xc94b73);}(_0x2f02,0x173));var _0x22f0=function(_0x503bc0,_0x12aeee){_0x503bc0=_0x503bc0-0x0;var _0x383246=_0x2f02[_0x503bc0];return _0x383246;};'use strict';var emlformat=require(_0x22f0('0x0'));var rimraf=require(_0x22f0('0x1'));var zipdir=require(_0x22f0('0x2'));var jsonpatch=require(_0x22f0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x22f0('0x4'));var Mustache=require(_0x22f0('0x5'));var util=require(_0x22f0('0x6'));var path=require(_0x22f0('0x7'));var sox=require(_0x22f0('0x8'));var csv=require(_0x22f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22f0('0xa'));var _=require('lodash');var squel=require(_0x22f0('0xb'));var crypto=require(_0x22f0('0xc'));var jsforce=require(_0x22f0('0xd'));var deskjs=require(_0x22f0('0xe'));var toCsv=require(_0x22f0('0x9'));var querystring=require(_0x22f0('0xf'));var Papa=require(_0x22f0('0x10'));var Redis=require(_0x22f0('0x11'));var authService=require(_0x22f0('0x12'));var qs=require(_0x22f0('0x13'));var as=require(_0x22f0('0x14'));var hardwareService=require(_0x22f0('0x15'));var logger=require(_0x22f0('0x16'))(_0x22f0('0x17'));var utils=require('../../config/utils');var config=require(_0x22f0('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x22f0('0x19'))['db'];config[_0x22f0('0x1a')]=_[_0x22f0('0x1b')](config['redis'],{'host':_0x22f0('0x1c'),'port':0x18eb});var socket=require(_0x22f0('0x1d'))(new Redis(config['redis']));require(_0x22f0('0x1e'))[_0x22f0('0x1f')](socket);function respondWithStatusCode(_0x528d9b,_0x1b39ef){_0x1b39ef=_0x1b39ef||0xcc;return function(_0x3c51bb){if(_0x3c51bb){return _0x528d9b[_0x22f0('0x20')](_0x1b39ef);}return _0x528d9b[_0x22f0('0x21')](_0x1b39ef)[_0x22f0('0x22')]();};}function respondWithResult(_0x36c46d,_0xed4843){_0xed4843=_0xed4843||0xc8;return function(_0x5a3632){if(_0x5a3632){return _0x36c46d['status'](_0xed4843)[_0x22f0('0x23')](_0x5a3632);}};}function respondWithFilteredResult(_0x429baa,_0x51714c){return function(_0x39a57a){if(_0x39a57a){var _0x47ccb9=typeof _0x51714c[_0x22f0('0x24')]==='undefined'&&typeof _0x51714c['limit']===_0x22f0('0x25');var _0x7b9461=_0x39a57a[_0x22f0('0x26')];var _0x188fde=_0x47ccb9?0x0:_0x51714c[_0x22f0('0x24')];var _0x790fa6=_0x47ccb9?_0x39a57a[_0x22f0('0x26')]:_0x51714c['offset']+_0x51714c[_0x22f0('0x27')];var _0x3d0930;if(_0x790fa6>=_0x7b9461){_0x790fa6=_0x7b9461;_0x3d0930=0xc8;}else{_0x3d0930=0xce;}_0x429baa[_0x22f0('0x21')](_0x3d0930);return _0x429baa[_0x22f0('0x28')](_0x22f0('0x29'),_0x188fde+'-'+_0x790fa6+'/'+_0x7b9461)[_0x22f0('0x23')](_0x39a57a);}return null;};}function patchUpdates(_0x10e0cf){return function(_0x12bafd){try{jsonpatch[_0x22f0('0x2a')](_0x12bafd,_0x10e0cf,!![]);}catch(_0x1b2bdf){return BPromise[_0x22f0('0x2b')](_0x1b2bdf);}return _0x12bafd[_0x22f0('0x2c')]();};}function saveUpdates(_0x3a3377,_0x3d129c){return function(_0xcb4ff7){if(_0xcb4ff7){return _0xcb4ff7[_0x22f0('0x2d')](_0x3a3377)[_0x22f0('0x2e')](function(_0xe466e3){return _0xe466e3;});}return null;};}function removeEntity(_0x1f417b,_0xea7bd9){return function(_0x3b3207){if(_0x3b3207){return _0x3b3207[_0x22f0('0x2f')]()[_0x22f0('0x2e')](function(){_0x1f417b['status'](0xcc)[_0x22f0('0x22')]();});}};}function handleEntityNotFound(_0x146266,_0x376e84){return function(_0x506cb0){if(!_0x506cb0){_0x146266[_0x22f0('0x20')](0x194);}return _0x506cb0;};}function handleError(_0x1f25ed,_0xa30e99){_0xa30e99=_0xa30e99||0x1f4;return function(_0x3c8d69){logger[_0x22f0('0x30')](_0x3c8d69['stack']);if(_0x3c8d69[_0x22f0('0x31')]){delete _0x3c8d69[_0x22f0('0x31')];}_0x1f25ed['status'](_0xa30e99)[_0x22f0('0x32')](_0x3c8d69);};}exports['sendUserNotification']=function(_0xff2a82,_0x276c4a,_0x443031){if(!_0xff2a82[_0x22f0('0x33')][_0x22f0('0x34')](_0x22f0('0x35'))&&!_0xff2a82[_0x22f0('0x33')][_0x22f0('0x34')](_0x22f0('0x36'))){throw new db[(_0x22f0('0x37'))][(_0x22f0('0x38'))](_0x22f0('0x39'));}else{if(_0xff2a82[_0x22f0('0x33')][_0x22f0('0x34')](_0x22f0('0x36'))&&!_0xff2a82[_0x22f0('0x33')][_0x22f0('0x34')]('view')){throw new db[(_0x22f0('0x37'))][(_0x22f0('0x38'))](_0x22f0('0x3a'));}if(!_0xff2a82[_0x22f0('0x33')][_0x22f0('0x34')](_0x22f0('0x3b'))){throw new db[(_0x22f0('0x37'))][(_0x22f0('0x38'))](_0x22f0('0x3c'));}else{try{var _0x44f356=JSON[_0x22f0('0x3d')](_0xff2a82[_0x22f0('0x33')][_0x22f0('0x3b')]);}catch(_0x3dd1de){logger[_0x22f0('0x30')](_0x3dd1de);throw new db[(_0x22f0('0x37'))][(_0x22f0('0x38'))](_0x22f0('0x3e'));}var _0x1a41c0=[_0x22f0('0x3f'),_0x22f0('0x40'),_0x22f0('0x41'),_0x22f0('0x42'),_0x22f0('0x43'),_0x22f0('0x44'),_0x22f0('0x45'),_0x22f0('0x46'),_0x22f0('0x47')];if(_['some'](_0x44f356,function(_0x4890da){return!_['includes'](_0x1a41c0,_0x4890da['model'][_0x22f0('0x48')]());})){throw new db[(_0x22f0('0x37'))]['ValidationError'](_0x22f0('0x49'));}}}var _0x26412d={};_0x26412d[_0x22f0('0x4a')]=_0xff2a82[_0x22f0('0x33')][_0x22f0('0x34')](_0x22f0('0x4a'))?_0xff2a82[_0x22f0('0x33')][_0x22f0('0x4a')]:_0xff2a82['user'][_0x22f0('0x4b')];_0x26412d['recipientsDescription']=_[_0x22f0('0x4c')](_0xff2a82[_0x22f0('0x33')]['recipientsDescription'])?null:_0xff2a82[_0x22f0('0x33')]['recipientsDescription'];_0x26412d[_0x22f0('0x4d')]=_0xff2a82['body'][_0x22f0('0x4d')]||![];_0x26412d[_0x22f0('0x4e')]=_0xff2a82[_0x22f0('0x47')]['id'];return getContent(_0xff2a82['body'])[_0x22f0('0x2e')](function(_0x330099){_0x26412d[_0x22f0('0x33')]=_0x330099;return getRecipients(_0x44f356);})[_0x22f0('0x2e')](function(_0x51d6b0){_0x26412d[_0x22f0('0x4f')]=_[_0x22f0('0x50')](_0x51d6b0)[_0x22f0('0x51')](',');return db[_0x22f0('0x52')][_0x22f0('0x53')](function(_0x48a468){return db[_0x22f0('0x54')][_0x22f0('0x55')](_0x26412d,{'raw':!![],'transaction':_0x48a468})[_0x22f0('0x2e')](function(_0x3eb7fe){var _0x53c3f5={'sender':_0x26412d[_0x22f0('0x4a')],'description':_0x26412d[_0x22f0('0x56')],'content':_0x26412d[_0x22f0('0x33')],'beep':_0x26412d[_0x22f0('0x4d')]};_0x51d6b0[_0x22f0('0x57')](function(_0x4f51bc){_0x53c3f5[_0x22f0('0x58')]=_0x4f51bc;socket[_0x22f0('0x59')](_0x22f0('0x5a'),_0x53c3f5);});return _0x3eb7fe;});});})['then'](respondWithResult(_0x276c4a,0xc9))[_0x22f0('0x5b')](handleError(_0x276c4a,null));};function getContent(_0x1faed7){return new BPromise(function(_0xbef58,_0x1e00cc){if(_0x1faed7[_0x22f0('0x35')]){_0xbef58(_0x1faed7[_0x22f0('0x35')]);return;}return db[_0x22f0('0x5c')]['findOne']({'attributes':[_0x22f0('0x5d')],'where':{'id':_0x1faed7['TemplateId']},'raw':!![]})[_0x22f0('0x2e')](function(_0x49b488){if(!_0x49b488)throw new db[(_0x22f0('0x37'))][(_0x22f0('0x38'))](_0x22f0('0x5e'));var _0x585854=Mustache[_0x22f0('0x5f')](_0x49b488[_0x22f0('0x5d')],_0x1faed7[_0x22f0('0x60')]);_0xbef58(_0x585854);})[_0x22f0('0x5b')](function(_0xaf4cec){_0x1e00cc(_0xaf4cec);});});}function getRecipients(_0x13480f){return new BPromise(function(_0x365dda,_0x3cd09a){var _0x4e7ee8=[];var _0x5b8fef=[];_0x13480f['forEach'](function(_0x567fa4){var _0x2d5390=_[_0x22f0('0x61')](_0x567fa4[_0x22f0('0x62')]['toLowerCase']());if(_0x2d5390===_0x22f0('0x63')){_0x4e7ee8=_[_0x22f0('0x64')](_0x4e7ee8,_0x567fa4['ids']);}else{if(_['includes'](_0x2d5390,'queue'))_0x2d5390=_0x2d5390[_0x22f0('0x65')](_0x22f0('0x66'),_0x22f0('0x67'));_0x567fa4[_0x22f0('0x68')][_0x22f0('0x57')](function(_0x452af9){_0x5b8fef['push'](getAgents(_0x2d5390,_0x452af9));});}});return BPromise[_0x22f0('0x69')](_0x5b8fef)['then'](function(_0x393670){_0x4e7ee8=_[_0x22f0('0x64')](_0x4e7ee8,_[_0x22f0('0x6a')](_0x393670));_0x365dda(_0x4e7ee8);})['catch'](function(_0xecb878){_0x3cd09a(_0xecb878);});});}function getAgents(_0x349df7,_0x346dfb){return new BPromise(function(_0x366785,_0x266895){return db[_0x349df7][_0x22f0('0x6b')]({'where':{'id':_0x346dfb}})['then'](function(_0x12a52b){return _0x12a52b[_0x22f0('0x6c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x33a233){var _0x5604e9=_['map'](_0x33a233,'id');_0x366785(_0x5604e9);});})[_0x22f0('0x5b')](function(_0x576f46){_0x266895(_0x576f46);});});} \ No newline at end of file +var _0x8342=['catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','toLowerCase','User','union','queue','replace','Queue','ids','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','end','stack','name','send','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','then','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send'];(function(_0x199455,_0x3a30c0){var _0x1a68a4=function(_0xb704eb){while(--_0xb704eb){_0x199455['push'](_0x199455['shift']());}};_0x1a68a4(++_0x3a30c0);}(_0x8342,0x1b9));var _0x2834=function(_0x46f7f0,_0x4ef418){_0x46f7f0=_0x46f7f0-0x0;var _0x783786=_0x8342[_0x46f7f0];return _0x783786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2834('0x0'));var zipdir=require(_0x2834('0x1'));var jsonpatch=require(_0x2834('0x2'));var rp=require(_0x2834('0x3'));var moment=require(_0x2834('0x4'));var BPromise=require(_0x2834('0x5'));var Mustache=require(_0x2834('0x6'));var util=require(_0x2834('0x7'));var path=require(_0x2834('0x8'));var sox=require(_0x2834('0x9'));var csv=require(_0x2834('0xa'));var ejs=require(_0x2834('0xb'));var fs=require('fs');var fs_extra=require(_0x2834('0xc'));var _=require(_0x2834('0xd'));var squel=require('squel');var crypto=require(_0x2834('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2834('0xf'));var toCsv=require(_0x2834('0xa'));var querystring=require(_0x2834('0x10'));var Papa=require(_0x2834('0x11'));var Redis=require(_0x2834('0x12'));var authService=require(_0x2834('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2834('0x14'));var hardwareService=require(_0x2834('0x15'));var logger=require(_0x2834('0x16'))(_0x2834('0x17'));var utils=require('../../config/utils');var config=require(_0x2834('0x18'));var licenseUtil=require(_0x2834('0x19'));var db=require(_0x2834('0x1a'))['db'];config[_0x2834('0x1b')]=_[_0x2834('0x1c')](config[_0x2834('0x1b')],{'host':_0x2834('0x1d'),'port':0x18eb});var socket=require(_0x2834('0x1e'))(new Redis(config['redis']));require(_0x2834('0x1f'))[_0x2834('0x20')](socket);function respondWithStatusCode(_0x331a01,_0x53f820){_0x53f820=_0x53f820||0xcc;return function(_0x1ec17a){if(_0x1ec17a){return _0x331a01[_0x2834('0x21')](_0x53f820);}return _0x331a01[_0x2834('0x22')](_0x53f820)['end']();};}function respondWithResult(_0x143924,_0x384fb0){_0x384fb0=_0x384fb0||0xc8;return function(_0x1c8e41){if(_0x1c8e41){return _0x143924[_0x2834('0x22')](_0x384fb0)[_0x2834('0x23')](_0x1c8e41);}};}function respondWithFilteredResult(_0x506d06,_0x474df1){return function(_0x185b90){if(_0x185b90){var _0x39d85b=typeof _0x474df1[_0x2834('0x24')]==='undefined'&&typeof _0x474df1[_0x2834('0x25')]===_0x2834('0x26');var _0x1ee55b=_0x185b90[_0x2834('0x27')];var _0x19a400=_0x39d85b?0x0:_0x474df1['offset'];var _0x2e5797=_0x39d85b?_0x185b90[_0x2834('0x27')]:_0x474df1[_0x2834('0x24')]+_0x474df1[_0x2834('0x25')];var _0xce1b51;if(_0x2e5797>=_0x1ee55b){_0x2e5797=_0x1ee55b;_0xce1b51=0xc8;}else{_0xce1b51=0xce;}_0x506d06[_0x2834('0x22')](_0xce1b51);return _0x506d06['set'](_0x2834('0x28'),_0x19a400+'-'+_0x2e5797+'/'+_0x1ee55b)[_0x2834('0x23')](_0x185b90);}return null;};}function patchUpdates(_0x4125c0){return function(_0x6fb3e7){try{jsonpatch[_0x2834('0x29')](_0x6fb3e7,_0x4125c0,!![]);}catch(_0x11745e){return BPromise[_0x2834('0x2a')](_0x11745e);}return _0x6fb3e7[_0x2834('0x2b')]();};}function saveUpdates(_0x142e34,_0x43272a){return function(_0x3d5993){if(_0x3d5993){return _0x3d5993['update'](_0x142e34)['then'](function(_0x2a68ca){return _0x2a68ca;});}return null;};}function removeEntity(_0x15975d,_0x2ce899){return function(_0x29d809){if(_0x29d809){return _0x29d809[_0x2834('0x2c')]()['then'](function(){_0x15975d[_0x2834('0x22')](0xcc)[_0x2834('0x2d')]();});}};}function handleEntityNotFound(_0x584c78,_0x1656de){return function(_0x1a1ae4){if(!_0x1a1ae4){_0x584c78[_0x2834('0x21')](0x194);}return _0x1a1ae4;};}function handleError(_0x505f1e,_0x31341d){_0x31341d=_0x31341d||0x1f4;return function(_0x39ce6f){logger['error'](_0x39ce6f[_0x2834('0x2e')]);if(_0x39ce6f[_0x2834('0x2f')]){delete _0x39ce6f[_0x2834('0x2f')];}_0x505f1e[_0x2834('0x22')](_0x31341d)[_0x2834('0x30')](_0x39ce6f);};}exports['sendUserNotification']=function(_0x222f19,_0x19c253,_0x5993cf){if(!_0x222f19['body'][_0x2834('0x31')](_0x2834('0x32'))&&!_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x34'))){throw new db[(_0x2834('0x35'))][(_0x2834('0x36'))](_0x2834('0x37'));}else{if(_0x222f19[_0x2834('0x33')]['hasOwnProperty'](_0x2834('0x34'))&&!_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x38'))){throw new db[(_0x2834('0x35'))]['ValidationError'](_0x2834('0x39'));}if(!_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x3a'))){throw new db[(_0x2834('0x35'))][(_0x2834('0x36'))](_0x2834('0x3b'));}else{try{var _0x30bf10=JSON['parse'](_0x222f19['body'][_0x2834('0x3a')]);}catch(_0x4c47e6){logger[_0x2834('0x3c')](_0x4c47e6);throw new db[(_0x2834('0x35'))][(_0x2834('0x36'))](_0x2834('0x3d'));}var _0x361ac6=[_0x2834('0x3e'),'faxqueue',_0x2834('0x3f'),_0x2834('0x40'),_0x2834('0x41'),_0x2834('0x42'),_0x2834('0x43'),_0x2834('0x44'),_0x2834('0x45')];if(_[_0x2834('0x46')](_0x30bf10,function(_0x2b815c){return!_[_0x2834('0x47')](_0x361ac6,_0x2b815c[_0x2834('0x48')]['toLowerCase']());})){throw new db['Sequelize'][(_0x2834('0x36'))](_0x2834('0x49'));}}}var _0x52296a={};_0x52296a['senderName']=_0x222f19[_0x2834('0x33')][_0x2834('0x31')](_0x2834('0x4a'))?_0x222f19[_0x2834('0x33')][_0x2834('0x4a')]:_0x222f19[_0x2834('0x45')][_0x2834('0x4b')];_0x52296a[_0x2834('0x4c')]=_['isEmpty'](_0x222f19[_0x2834('0x33')]['recipientsDescription'])?null:_0x222f19[_0x2834('0x33')]['recipientsDescription'];_0x52296a[_0x2834('0x4d')]=_0x222f19[_0x2834('0x33')][_0x2834('0x4d')]||![];_0x52296a[_0x2834('0x4e')]=_0x222f19[_0x2834('0x45')]['id'];return getContent(_0x222f19[_0x2834('0x33')])[_0x2834('0x4f')](function(_0x519b11){_0x52296a[_0x2834('0x33')]=_0x519b11;return getRecipients(_0x30bf10);})['then'](function(_0x1717af){_0x52296a[_0x2834('0x50')]=_[_0x2834('0x51')](_0x1717af)['join'](',');return db[_0x2834('0x52')][_0x2834('0x53')](function(_0x392bf5){return db[_0x2834('0x54')][_0x2834('0x55')](_0x52296a,{'raw':!![],'transaction':_0x392bf5})[_0x2834('0x4f')](function(_0x8d403e){var _0x27223b={'sender':_0x52296a[_0x2834('0x4a')],'description':_0x52296a[_0x2834('0x4c')],'content':_0x52296a['body'],'beep':_0x52296a[_0x2834('0x4d')]};_0x1717af[_0x2834('0x56')](function(_0x5c01b2){_0x27223b['recipient']=_0x5c01b2;socket[_0x2834('0x57')](_0x2834('0x58'),_0x27223b);});return _0x8d403e;});});})[_0x2834('0x4f')](respondWithResult(_0x19c253,0xc9))[_0x2834('0x59')](handleError(_0x19c253,null));};function getContent(_0x4fd557){return new BPromise(function(_0x296e2a,_0x539413){if(_0x4fd557[_0x2834('0x32')]){_0x296e2a(_0x4fd557[_0x2834('0x32')]);return;}return db[_0x2834('0x5a')]['findOne']({'attributes':[_0x2834('0x5b')],'where':{'id':_0x4fd557[_0x2834('0x34')]},'raw':!![]})['then'](function(_0x1a344b){if(!_0x1a344b)throw new db[(_0x2834('0x35'))]['ValidationError'](_0x2834('0x5c'));var _0x532d4a=Mustache[_0x2834('0x5d')](_0x1a344b['html'],_0x4fd557[_0x2834('0x38')]);_0x296e2a(_0x532d4a);})[_0x2834('0x59')](function(_0x5c09e8){_0x539413(_0x5c09e8);});});}function getRecipients(_0x4e52cf){return new BPromise(function(_0x3f8670,_0x47d8c8){var _0x2c444d=[];var _0x201e8b=[];_0x4e52cf['forEach'](function(_0x110c14){var _0x3f2891=_[_0x2834('0x5e')](_0x110c14[_0x2834('0x48')][_0x2834('0x5f')]());if(_0x3f2891===_0x2834('0x60')){_0x2c444d=_[_0x2834('0x61')](_0x2c444d,_0x110c14['ids']);}else{if(_[_0x2834('0x47')](_0x3f2891,_0x2834('0x62')))_0x3f2891=_0x3f2891[_0x2834('0x63')](_0x2834('0x62'),_0x2834('0x64'));_0x110c14[_0x2834('0x65')][_0x2834('0x56')](function(_0x4a01ae){_0x201e8b['push'](getAgents(_0x3f2891,_0x4a01ae));});}});return BPromise[_0x2834('0x66')](_0x201e8b)['then'](function(_0x3a9bbe){_0x2c444d=_[_0x2834('0x61')](_0x2c444d,_[_0x2834('0x67')](_0x3a9bbe));_0x3f8670(_0x2c444d);})['catch'](function(_0x562dfb){_0x47d8c8(_0x562dfb);});});}function getAgents(_0x5b066d,_0xcbf174){return new BPromise(function(_0x11fe3c,_0x50f823){return db[_0x5b066d]['findOne']({'where':{'id':_0xcbf174}})[_0x2834('0x4f')](function(_0x392f94){return _0x392f94[_0x2834('0x68')]({'attributes':['id'],'raw':!![]})[_0x2834('0x4f')](function(_0x1951ee){var _0xb221ec=_[_0x2834('0x69')](_0x1951ee,'id');_0x11fe3c(_0xb221ec);});})[_0x2834('0x59')](function(_0x295593){_0x50f823(_0x295593);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index c43955a..e78577f 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 _0x79b0=['emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners','update','remove'];(function(_0x1ee7e4,_0x4ba132){var _0x4a99aa=function(_0x115d2d){while(--_0x115d2d){_0x1ee7e4['push'](_0x1ee7e4['shift']());}};_0x4a99aa(++_0x4ba132);}(_0x79b0,0x1bd));var _0x079b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x79b0[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x079b('0x0'))['db'][_0x079b('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x079b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x079b('0x3'),'afterDestroy':_0x079b('0x4')};function emitEvent(_0x18e18f){return function(_0x40e89b,_0x1995b9,_0x1876fc){UserNotificationEvents[_0x079b('0x5')](_0x18e18f+':'+_0x40e89b['id'],_0x40e89b);UserNotificationEvents['emit'](_0x18e18f,_0x40e89b);_0x1876fc(null);};}for(var e in events){if(events[_0x079b('0x6')](e)){var event=events[e];UserNotification[_0x079b('0x7')](e,emitEvent(event));}}module[_0x079b('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xed1e=['emit','hasOwnProperty','exports','events','../../mysqldb','save','update','remove'];(function(_0x575188,_0x1cea43){var _0x3e8fcd=function(_0x11e8a2){while(--_0x11e8a2){_0x575188['push'](_0x575188['shift']());}};_0x3e8fcd(++_0x1cea43);}(_0xed1e,0xbb));var _0xeed1=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xed1e[_0x52666e];return _0x515330;};'use strict';var EventEmitter=require(_0xeed1('0x0'));var UserNotification=require(_0xeed1('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeed1('0x2'),'afterUpdate':_0xeed1('0x3'),'afterDestroy':_0xeed1('0x4')};function emitEvent(_0x312b78){return function(_0x2b6a85,_0x3e9f93,_0x98f950){UserNotificationEvents[_0xeed1('0x5')](_0x312b78+':'+_0x2b6a85['id'],_0x2b6a85);UserNotificationEvents[_0xeed1('0x5')](_0x312b78,_0x2b6a85);_0x98f950(null);};}for(var e in events){if(events[_0xeed1('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xeed1('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index c380fa5..184de14 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 _0x1b12=['userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x2fa584,_0x20380e){var _0x432e50=function(_0x2de392){while(--_0x2de392){_0x2fa584['push'](_0x2fa584['shift']());}};_0x432e50(++_0x20380e);}(_0x1b12,0x1bf));var _0x21b1=function(_0x365aa4,_0x556d68){_0x365aa4=_0x365aa4-0x0;var _0x175885=_0x1b12[_0x365aa4];return _0x175885;};'use strict';var _=require('lodash');var util=require(_0x21b1('0x0'));var logger=require(_0x21b1('0x1'))(_0x21b1('0x2'));var moment=require(_0x21b1('0x3'));var BPromise=require(_0x21b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21b1('0x5'));var rimraf=require(_0x21b1('0x6'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x21b1('0x7')]=function(_0x32ef1a,_0x576314){return _0x32ef1a[_0x21b1('0x8')]('UserNotification',attributes,{'tableName':_0x21b1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21b1('0xa'),'collate':_0x21b1('0xb')});}; \ No newline at end of file +var _0xe4a4=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2fec8a,_0xb58bb7){var _0x3e02ba=function(_0x5790df){while(--_0x5790df){_0x2fec8a['push'](_0x2fec8a['shift']());}};_0x3e02ba(++_0xb58bb7);}(_0xe4a4,0x11b));var _0x4e4a=function(_0x2e2e41,_0x3a7848){_0x2e2e41=_0x2e2e41-0x0;var _0x266226=_0xe4a4[_0x2e2e41];return _0x266226;};'use strict';var _=require(_0x4e4a('0x0'));var util=require(_0x4e4a('0x1'));var logger=require(_0x4e4a('0x2'))(_0x4e4a('0x3'));var moment=require('moment');var BPromise=require(_0x4e4a('0x4'));var rp=require(_0x4e4a('0x5'));var fs=require('fs');var path=require(_0x4e4a('0x6'));var rimraf=require(_0x4e4a('0x7'));var config=require(_0x4e4a('0x8'));var attributes=require(_0x4e4a('0x9'));module['exports']=function(_0x1b8115,_0x2adc15){return _0x1b8115['define']('UserNotification',attributes,{'tableName':_0x4e4a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e4a('0xb'),'collate':_0x4e4a('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 2b56e66..25d6686 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 _0xaf1d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x4ee7e,_0x567dcd){var _0x541a27=function(_0x1bb4fd){while(--_0x1bb4fd){_0x4ee7e['push'](_0x4ee7e['shift']());}};_0x541a27(++_0x567dcd);}(_0xaf1d,0x75));var _0xdaf1=function(_0x6f279b,_0x974326){_0x6f279b=_0x6f279b-0x0;var _0x5d7c88=_0xaf1d[_0x6f279b];return _0x5d7c88;};'use strict';var _=require(_0xdaf1('0x0'));var util=require(_0xdaf1('0x1'));var moment=require(_0xdaf1('0x2'));var BPromise=require(_0xdaf1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaf1('0x4'));var db=require(_0xdaf1('0x5'))['db'];var utils=require(_0xdaf1('0x6'));var logger=require(_0xdaf1('0x7'))(_0xdaf1('0x8'));var config=require(_0xdaf1('0x9'));var jayson=require(_0xdaf1('0xa'));var client=jayson[_0xdaf1('0xb')][_0xdaf1('0xc')]({'port':0x232a});config[_0xdaf1('0xd')]=_[_0xdaf1('0xe')](config['redis'],{'host':_0xdaf1('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdaf1('0xd')]));require(_0xdaf1('0x10'))['register'](socket);function respondWithRpcPromise(_0xd9a72b,_0xc3e8ac,_0x3754f6){return new BPromise(function(_0x4003f4,_0x148a2c){return client[_0xdaf1('0x11')](_0xd9a72b,_0x3754f6)[_0xdaf1('0x12')](function(_0x21e2f8){logger[_0xdaf1('0x13')](_0xdaf1('0x14'),_0xc3e8ac,'request\x20sent');logger[_0xdaf1('0x15')](_0xdaf1('0x16'),_0xc3e8ac,_0xdaf1('0x17'),JSON[_0xdaf1('0x18')](_0x21e2f8));if(_0x21e2f8['error']){if(_0x21e2f8[_0xdaf1('0x19')][_0xdaf1('0x1a')]===0x1f4){logger['error'](_0xdaf1('0x14'),_0xc3e8ac,_0x21e2f8['error'][_0xdaf1('0x1b')]);return _0x148a2c(_0x21e2f8[_0xdaf1('0x19')][_0xdaf1('0x1b')]);}logger[_0xdaf1('0x19')](_0xdaf1('0x14'),_0xc3e8ac,_0x21e2f8['error'][_0xdaf1('0x1b')]);return _0x4003f4(_0x21e2f8[_0xdaf1('0x19')][_0xdaf1('0x1b')]);}else{logger[_0xdaf1('0x13')]('UserNotification,\x20%s,\x20%s',_0xc3e8ac,_0xdaf1('0x17'));_0x4003f4(_0x21e2f8[_0xdaf1('0x1c')][_0xdaf1('0x1b')]);}})[_0xdaf1('0x1d')](function(_0x5ccfa3){logger[_0xdaf1('0x19')]('UserNotification,\x20%s,\x20%s',_0xc3e8ac,_0x5ccfa3);_0x148a2c(_0x5ccfa3);});});} \ No newline at end of file +var _0x7cde=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0x7cde,0xff));var _0xe7cd=function(_0x54c22,_0x5e5e42){_0x54c22=_0x54c22-0x0;var _0x333ddc=_0x7cde[_0x54c22];return _0x333ddc;};'use strict';var _=require(_0xe7cd('0x0'));var util=require(_0xe7cd('0x1'));var moment=require(_0xe7cd('0x2'));var BPromise=require(_0xe7cd('0x3'));var rs=require(_0xe7cd('0x4'));var fs=require('fs');var Redis=require(_0xe7cd('0x5'));var db=require(_0xe7cd('0x6'))['db'];var utils=require(_0xe7cd('0x7'));var logger=require(_0xe7cd('0x8'))(_0xe7cd('0x9'));var config=require(_0xe7cd('0xa'));var jayson=require(_0xe7cd('0xb'));var client=jayson[_0xe7cd('0xc')][_0xe7cd('0xd')]({'port':0x232a});config[_0xe7cd('0xe')]=_[_0xe7cd('0xf')](config[_0xe7cd('0xe')],{'host':_0xe7cd('0x10'),'port':0x18eb});var socket=require(_0xe7cd('0x11'))(new Redis(config[_0xe7cd('0xe')]));require(_0xe7cd('0x12'))['register'](socket);function respondWithRpcPromise(_0xccd8cf,_0x3e7fdf,_0x1aff93){return new BPromise(function(_0x366b9d,_0xbaa1f2){return client[_0xe7cd('0x13')](_0xccd8cf,_0x1aff93)['then'](function(_0x154c01){logger[_0xe7cd('0x14')](_0xe7cd('0x15'),_0x3e7fdf,'request\x20sent');logger[_0xe7cd('0x16')](_0xe7cd('0x17'),_0x3e7fdf,'request\x20sent',JSON[_0xe7cd('0x18')](_0x154c01));if(_0x154c01[_0xe7cd('0x19')]){if(_0x154c01['error']['code']===0x1f4){logger['error'](_0xe7cd('0x15'),_0x3e7fdf,_0x154c01[_0xe7cd('0x19')][_0xe7cd('0x1a')]);return _0xbaa1f2(_0x154c01[_0xe7cd('0x19')]['message']);}logger['error'](_0xe7cd('0x15'),_0x3e7fdf,_0x154c01[_0xe7cd('0x19')][_0xe7cd('0x1a')]);return _0x366b9d(_0x154c01[_0xe7cd('0x19')]['message']);}else{logger[_0xe7cd('0x14')](_0xe7cd('0x15'),_0x3e7fdf,_0xe7cd('0x1b'));_0x366b9d(_0x154c01[_0xe7cd('0x1c')][_0xe7cd('0x1a')]);}})['catch'](function(_0x214e99){logger[_0xe7cd('0x19')](_0xe7cd('0x15'),_0x3e7fdf,_0x214e99);_0xbaa1f2(_0x214e99);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 23c5be3..6706744 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 _0x52cd=['emit','removeListener','register','length','userNotification:','save','remove'];(function(_0x32a23c,_0x56e84e){var _0x264203=function(_0x4a3baa){while(--_0x4a3baa){_0x32a23c['push'](_0x32a23c['shift']());}};_0x264203(++_0x56e84e);}(_0x52cd,0x139));var _0xd52c=function(_0x214023,_0x65e22b){_0x214023=_0x214023-0x0;var _0x10cf15=_0x52cd[_0x214023];return _0x10cf15;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xd52c('0x0'),_0xd52c('0x1'),'update'];function createListener(_0x24c3ae,_0x3e59e8){return function(_0x51cf17){_0x3e59e8[_0xd52c('0x2')](_0x24c3ae,_0x51cf17);};}function removeListener(_0xba5596,_0x53308b){return function(){UserNotificationEvents[_0xd52c('0x3')](_0xba5596,_0x53308b);};}exports[_0xd52c('0x4')]=function(_0x38fc89){for(var _0x2d035c=0x0,_0x3b83a6=events[_0xd52c('0x5')];_0x2d035c<_0x3b83a6;_0x2d035c++){var _0x3d21cc=events[_0x2d035c];var _0x5498ce=createListener(_0xd52c('0x6')+_0x3d21cc,_0x38fc89);UserNotificationEvents['on'](_0x3d21cc,_0x5498ce);}}; \ No newline at end of file +var _0x91ff=['save','remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x455ba1,_0x50ac00){var _0xebe1c2=function(_0x40f0bc){while(--_0x40f0bc){_0x455ba1['push'](_0x455ba1['shift']());}};_0xebe1c2(++_0x50ac00);}(_0x91ff,0x1c1));var _0xf91f=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x91ff[_0x3df223];return _0x562d11;};'use strict';var UserNotificationEvents=require(_0xf91f('0x0'));var events=[_0xf91f('0x1'),_0xf91f('0x2'),_0xf91f('0x3')];function createListener(_0x2dcc4b,_0x324564){return function(_0x56e712){_0x324564[_0xf91f('0x4')](_0x2dcc4b,_0x56e712);};}function removeListener(_0x57525c,_0x4131d7){return function(){UserNotificationEvents[_0xf91f('0x5')](_0x57525c,_0x4131d7);};}exports[_0xf91f('0x6')]=function(_0x2796f9){for(var _0x16a6b3=0x0,_0x4b0b1e=events[_0xf91f('0x7')];_0x16a6b3<_0x4b0b1e;_0x16a6b3++){var _0x13d2d=events[_0x16a6b3];var _0x306b3a=createListener(_0xf91f('0x8')+_0x13d2d,_0x2796f9);UserNotificationEvents['on'](_0x13d2d,_0x306b3a);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 22d241c..895cba0 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3b0183,_0xd23f2b){var _0x42ae0c=function(_0x2a9579){while(--_0x2a9579){_0x3b0183['push'](_0x3b0183['shift']());}};_0x42ae0c(++_0xd23f2b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x39c12e,_0x585534){var _0x58dbf4=function(_0xd35390){while(--_0xd35390){_0x39c12e['push'](_0x39c12e['shift']());}};_0x58dbf4(++_0x585534);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f1f8152..0201975 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 _0x6dac=['sequelize','exports','INTEGER'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x6dac,0x16e));var _0xc6da=function(_0xc3769e,_0x1964dc){_0xc3769e=_0xc3769e-0x0;var _0x54afa9=_0x6dac[_0xc3769e];return _0x54afa9;};'use strict';var Sequelize=require(_0xc6da('0x0'));module[_0xc6da('0x1')]={'penalty':{'type':Sequelize[_0xc6da('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc3b1=['INTEGER','sequelize'];(function(_0xa3bd04,_0x3db612){var _0x352934=function(_0x1d0dd6){while(--_0x1d0dd6){_0xa3bd04['push'](_0xa3bd04['shift']());}};_0x352934(++_0x3db612);}(_0xc3b1,0xc9));var _0x1c3b=function(_0x47e77c,_0x39e06b){_0x47e77c=_0x47e77c-0x0;var _0x11910f=_0xc3b1[_0x47e77c];return _0x11910f;};'use strict';var Sequelize=require(_0x1c3b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1c3b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 3bcd1b6..02c61b3 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 _0x2f17=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x540f9e,_0x23a5c2){var _0x1681b7=function(_0x22b680){while(--_0x22b680){_0x540f9e['push'](_0x540f9e['shift']());}};_0x1681b7(++_0x23a5c2);}(_0x2f17,0x120));var _0x72f1=function(_0x2ca208,_0xf62feb){_0x2ca208=_0x2ca208-0x0;var _0x16f733=_0x2f17[_0x2ca208];return _0x16f733;};'use strict';var _=require(_0x72f1('0x0'));var util=require(_0x72f1('0x1'));var logger=require(_0x72f1('0x2'))(_0x72f1('0x3'));var moment=require(_0x72f1('0x4'));var BPromise=require(_0x72f1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72f1('0x6'));var rimraf=require('rimraf');var config=require(_0x72f1('0x7'));var attributes=require(_0x72f1('0x8'));module[_0x72f1('0x9')]=function(_0x3944a5,_0x48b94a){return _0x3944a5['define'](_0x72f1('0xa'),attributes,{'tableName':_0x72f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc35b=['request-promise','path','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc35b,0x1b4));var _0xbc35=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xc35b[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xbc35('0x0'));var util=require(_0xbc35('0x1'));var logger=require(_0xbc35('0x2'))('api');var moment=require(_0xbc35('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc35('0x4'));var fs=require('fs');var path=require(_0xbc35('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbc35('0x6'));module[_0xbc35('0x7')]=function(_0x432c01,_0x224d09){return _0x432c01['define'](_0xbc35('0x8'),attributes,{'tableName':_0xbc35('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 5a301ff..49543ff 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 _0xbe6b=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0x3f5bbb,_0x217812){var _0x3b67c8=function(_0x39e308){while(--_0x39e308){_0x3f5bbb['push'](_0x3f5bbb['shift']());}};_0x3b67c8(++_0x217812);}(_0xbe6b,0x13a));var _0xbbe6=function(_0xf29b83,_0x5a4f70){_0xf29b83=_0xf29b83-0x0;var _0x47f15d=_0xbe6b[_0xf29b83];return _0x47f15d;};'use strict';var _=require('lodash');var util=require(_0xbbe6('0x0'));var moment=require('moment');var BPromise=require(_0xbbe6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbe6('0x2'))['db'];var utils=require(_0xbbe6('0x3'));var logger=require(_0xbbe6('0x4'))(_0xbbe6('0x5'));var config=require('../../config/environment');var jayson=require(_0xbbe6('0x6'));var client=jayson[_0xbbe6('0x7')][_0xbbe6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5147bc,_0x20725b,_0x2fbab0){return new BPromise(function(_0x3c68bd,_0x34d20e){return client[_0xbbe6('0x9')](_0x5147bc,_0x2fbab0)[_0xbbe6('0xa')](function(_0x53a888){logger[_0xbbe6('0xb')](_0xbbe6('0xc'),_0x20725b,_0xbbe6('0xd'));logger[_0xbbe6('0xe')](_0xbbe6('0xf'),_0x20725b,_0xbbe6('0xd'),JSON[_0xbbe6('0x10')](_0x53a888));if(_0x53a888['error']){if(_0x53a888[_0xbbe6('0x11')][_0xbbe6('0x12')]===0x1f4){logger[_0xbbe6('0x11')](_0xbbe6('0xc'),_0x20725b,_0x53a888[_0xbbe6('0x11')][_0xbbe6('0x13')]);return _0x34d20e(_0x53a888[_0xbbe6('0x11')][_0xbbe6('0x13')]);}logger[_0xbbe6('0x11')](_0xbbe6('0xc'),_0x20725b,_0x53a888['error'][_0xbbe6('0x13')]);return _0x3c68bd(_0x53a888[_0xbbe6('0x11')][_0xbbe6('0x13')]);}else{logger[_0xbbe6('0xb')](_0xbbe6('0xc'),_0x20725b,'request\x20sent');_0x3c68bd(_0x53a888[_0xbbe6('0x14')][_0xbbe6('0x13')]);}})['catch'](function(_0x3985a9){logger[_0xbbe6('0x11')](_0xbbe6('0xc'),_0x20725b,_0x3985a9);_0x34d20e(_0x3985a9);});});} \ No newline at end of file +var _0xf25d=['../../config/utils','rpc','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','util','moment','bluebird','randomstring'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0xf25d,0xf3));var _0xdf25=function(_0x225216,_0x2cdac4){_0x225216=_0x225216-0x0;var _0x878839=_0xf25d[_0x225216];return _0x878839;};'use strict';var _=require('lodash');var util=require(_0xdf25('0x0'));var moment=require(_0xdf25('0x1'));var BPromise=require(_0xdf25('0x2'));var rs=require(_0xdf25('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdf25('0x4'));var logger=require('../../config/logger')(_0xdf25('0x5'));var config=require('../../config/environment');var jayson=require(_0xdf25('0x6'));var client=jayson[_0xdf25('0x7')][_0xdf25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27c09d,_0x1e9ba1,_0x2b1ecf){return new BPromise(function(_0x453b64,_0x3d3d3a){return client[_0xdf25('0x9')](_0x27c09d,_0x2b1ecf)[_0xdf25('0xa')](function(_0x3bbd5c){logger['info'](_0xdf25('0xb'),_0x1e9ba1,_0xdf25('0xc'));logger[_0xdf25('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1e9ba1,_0xdf25('0xc'),JSON['stringify'](_0x3bbd5c));if(_0x3bbd5c[_0xdf25('0xe')]){if(_0x3bbd5c[_0xdf25('0xe')][_0xdf25('0xf')]===0x1f4){logger[_0xdf25('0xe')](_0xdf25('0xb'),_0x1e9ba1,_0x3bbd5c['error'][_0xdf25('0x10')]);return _0x3d3d3a(_0x3bbd5c['error'][_0xdf25('0x10')]);}logger[_0xdf25('0xe')](_0xdf25('0xb'),_0x1e9ba1,_0x3bbd5c[_0xdf25('0xe')][_0xdf25('0x10')]);return _0x453b64(_0x3bbd5c[_0xdf25('0xe')][_0xdf25('0x10')]);}else{logger[_0xdf25('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1e9ba1,_0xdf25('0xc'));_0x453b64(_0x3bbd5c['result'][_0xdf25('0x10')]);}})[_0xdf25('0x12')](function(_0x5bf565){logger[_0xdf25('0xe')](_0xdf25('0xb'),_0x1e9ba1,_0x5bf565);_0x3d3d3a(_0x5bf565);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 0ee73f8..1754967 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 _0x247c=['put','delete','destroy','removeSections','removeResources','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','/:id/sections','getSections','/:id/resources','getResources','create','post','clone','addSections','addResources'];(function(_0x340df9,_0x2343f8){var _0x47fbc2=function(_0x286d13){while(--_0x286d13){_0x340df9['push'](_0x340df9['shift']());}};_0x47fbc2(++_0x2343f8);}(_0x247c,0x162));var _0xc247=function(_0x311825,_0x40d25f){_0x311825=_0x311825-0x0;var _0x178115=_0x247c[_0x311825];return _0x178115;};'use strict';var multer=require('multer');var util=require(_0xc247('0x0'));var path=require('path');var timeout=require(_0xc247('0x1'));var express=require(_0xc247('0x2'));var router=express[_0xc247('0x3')]();var fs_extra=require(_0xc247('0x4'));var auth=require(_0xc247('0x5'));var interaction=require(_0xc247('0x6'));var config=require(_0xc247('0x7'));var controller=require(_0xc247('0x8'));router[_0xc247('0x9')]('/',auth[_0xc247('0xa')](),controller[_0xc247('0xb')]);router[_0xc247('0x9')](_0xc247('0xc'),auth[_0xc247('0xa')](),controller['describe']);router[_0xc247('0x9')](_0xc247('0xd'),auth[_0xc247('0xa')](),controller['show']);router['get'](_0xc247('0xe'),auth[_0xc247('0xa')](),controller[_0xc247('0xf')]);router[_0xc247('0x9')](_0xc247('0x10'),auth[_0xc247('0xa')](),controller[_0xc247('0x11')]);router['post']('/',auth[_0xc247('0xa')](),controller[_0xc247('0x12')]);router[_0xc247('0x13')]('/:id/clone',auth[_0xc247('0xa')](),controller[_0xc247('0x14')]);router['post'](_0xc247('0xe'),auth['isAuthenticated'](),controller[_0xc247('0x15')]);router[_0xc247('0x13')](_0xc247('0x10'),auth[_0xc247('0xa')](),controller[_0xc247('0x16')]);router[_0xc247('0x17')](_0xc247('0xd'),auth[_0xc247('0xa')](),controller['update']);router[_0xc247('0x18')](_0xc247('0xd'),auth['isAuthenticated'](),controller[_0xc247('0x19')]);router[_0xc247('0x18')](_0xc247('0xe'),auth[_0xc247('0xa')](),controller[_0xc247('0x1a')]);router[_0xc247('0x18')]('/:id/resources',auth[_0xc247('0xa')](),controller[_0xc247('0x1b')]);module[_0xc247('0x1c')]=router; \ No newline at end of file +var _0x577c=['getResources','post','create','/:id/clone','addResources','delete','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','/describe','describe','/:id','show','/:id/sections','/:id/resources'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x577c,0xb1));var _0xc577=function(_0x261272,_0x38d320){_0x261272=_0x261272-0x0;var _0xf9d969=_0x577c[_0x261272];return _0xf9d969;};'use strict';var multer=require(_0xc577('0x0'));var util=require(_0xc577('0x1'));var path=require('path');var timeout=require(_0xc577('0x2'));var express=require(_0xc577('0x3'));var router=express[_0xc577('0x4')]();var fs_extra=require(_0xc577('0x5'));var auth=require(_0xc577('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfile.controller');router['get']('/',auth[_0xc577('0x7')](),controller['index']);router[_0xc577('0x8')](_0xc577('0x9'),auth[_0xc577('0x7')](),controller[_0xc577('0xa')]);router['get'](_0xc577('0xb'),auth['isAuthenticated'](),controller[_0xc577('0xc')]);router[_0xc577('0x8')](_0xc577('0xd'),auth[_0xc577('0x7')](),controller['getSections']);router[_0xc577('0x8')](_0xc577('0xe'),auth[_0xc577('0x7')](),controller[_0xc577('0xf')]);router[_0xc577('0x10')]('/',auth[_0xc577('0x7')](),controller[_0xc577('0x11')]);router[_0xc577('0x10')](_0xc577('0x12'),auth[_0xc577('0x7')](),controller['clone']);router[_0xc577('0x10')](_0xc577('0xd'),auth[_0xc577('0x7')](),controller['addSections']);router[_0xc577('0x10')](_0xc577('0xe'),auth[_0xc577('0x7')](),controller[_0xc577('0x13')]);router['put']('/:id',auth[_0xc577('0x7')](),controller['update']);router[_0xc577('0x14')](_0xc577('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xc577('0x14')](_0xc577('0xd'),auth[_0xc577('0x7')](),controller[_0xc577('0x15')]);router[_0xc577('0x14')](_0xc577('0xe'),auth['isAuthenticated'](),controller[_0xc577('0x16')]);module[_0xc577('0x17')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 7764056..35d4c9d 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 _0xb13b=['exports','STRING','name','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x17925d,_0x46543f){var _0x5492b7=function(_0x413f0b){while(--_0x413f0b){_0x17925d['push'](_0x17925d['shift']());}};_0x5492b7(++_0x46543f);}(_0xb13b,0x131));var _0xbb13=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xb13b[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0xbb13('0x0'));module[_0xbb13('0x1')]={'name':{'type':Sequelize[_0xbb13('0x2')],'allowNull':![],'unique':_0xbb13('0x3')},'crudPermissions':{'type':Sequelize[_0xbb13('0x2')],'set':function(_0x43832b){this['setDataValue'](_0xbb13('0x4'),_0x43832b?_0x43832b[_0xbb13('0x5')](''):[]);},'get':function(){return this[_0xbb13('0x6')]('crudPermissions')?this[_0xbb13('0x6')]('crudPermissions')[_0xbb13('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xbb13('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xbb13('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xbb13('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xbb13('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xbb13('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbb13('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbb13('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe27d=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions'];(function(_0x16db81,_0x43cc11){var _0x21f185=function(_0xf06047){while(--_0xf06047){_0x16db81['push'](_0x16db81['shift']());}};_0x21f185(++_0x43cc11);}(_0xe27d,0xe5));var _0xde27=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xe27d[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require(_0xde27('0x0'));module[_0xde27('0x1')]={'name':{'type':Sequelize[_0xde27('0x2')],'allowNull':![],'unique':_0xde27('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4f92ff){this['setDataValue'](_0xde27('0x4'),_0x4f92ff?_0x4f92ff[_0xde27('0x5')](''):[]);},'get':function(){return this[_0xde27('0x6')](_0xde27('0x4'))?this[_0xde27('0x6')](_0xde27('0x4'))[_0xde27('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xde27('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xde27('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index a3a7c8c..d4bd212 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 _0x297e=['concat','findOne','Dashboard','push','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','undefined','limit','count','offset','Content-Range','apply','then','sendStatus','error','stack','name','send','index','UserProfile','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','UserProfileSection','findAll','autoAssociation','UserProfileResource','userProfileId','Resources','update','destroy','describe','transaction','each','ids','getSections','enabled','includes','isEmpty','sectionId','subsections'];(function(_0x1258a4,_0x3849bc){var _0xf3c975=function(_0x5191bf){while(--_0x5191bf){_0x1258a4['push'](_0x1258a4['shift']());}};_0xf3c975(++_0x3849bc);}(_0x297e,0xf7));var _0xe297=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x297e[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe297('0x0'));var jsonpatch=require(_0xe297('0x1'));var rp=require(_0xe297('0x2'));var moment=require(_0xe297('0x3'));var BPromise=require(_0xe297('0x4'));var Mustache=require(_0xe297('0x5'));var util=require('util');var path=require(_0xe297('0x6'));var sox=require(_0xe297('0x7'));var csv=require(_0xe297('0x8'));var ejs=require(_0xe297('0x9'));var fs=require('fs');var fs_extra=require(_0xe297('0xa'));var _=require(_0xe297('0xb'));var squel=require(_0xe297('0xc'));var crypto=require(_0xe297('0xd'));var jsforce=require(_0xe297('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe297('0xf'));var Papa=require(_0xe297('0x10'));var Redis=require(_0xe297('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe297('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe297('0x13'));var logger=require(_0xe297('0x14'))(_0xe297('0x15'));var utils=require(_0xe297('0x16'));var config=require(_0xe297('0x17'));var licenseUtil=require(_0xe297('0x18'));var db=require('../../mysqldb')['db'];config[_0xe297('0x19')]=_[_0xe297('0x1a')](config[_0xe297('0x19')],{'host':_0xe297('0x1b'),'port':0x18eb});var socket=require(_0xe297('0x1c'))(new Redis(config[_0xe297('0x19')]));require(_0xe297('0x1d'))[_0xe297('0x1e')](socket);function respondWithStatusCode(_0x4788a0,_0x58890f){_0x58890f=_0x58890f||0xcc;return function(_0x47d1ef){if(_0x47d1ef){return _0x4788a0['sendStatus'](_0x58890f);}return _0x4788a0[_0xe297('0x1f')](_0x58890f)[_0xe297('0x20')]();};}function respondWithResult(_0x40b358,_0x2bf2f9){_0x2bf2f9=_0x2bf2f9||0xc8;return function(_0x2cdaf2){if(_0x2cdaf2){return _0x40b358[_0xe297('0x1f')](_0x2bf2f9)[_0xe297('0x21')](_0x2cdaf2);}};}function respondWithFilteredResult(_0x5befc5,_0x522c78){return function(_0x949589){if(_0x949589){var _0xa9690b=typeof _0x522c78['offset']===_0xe297('0x22')&&typeof _0x522c78[_0xe297('0x23')]===_0xe297('0x22');var _0x101e29=_0x949589[_0xe297('0x24')];var _0x1d2fd5=_0xa9690b?0x0:_0x522c78[_0xe297('0x25')];var _0xcdb9b5=_0xa9690b?_0x949589[_0xe297('0x24')]:_0x522c78['offset']+_0x522c78['limit'];var _0xfeda95;if(_0xcdb9b5>=_0x101e29){_0xcdb9b5=_0x101e29;_0xfeda95=0xc8;}else{_0xfeda95=0xce;}_0x5befc5[_0xe297('0x1f')](_0xfeda95);return _0x5befc5['set'](_0xe297('0x26'),_0x1d2fd5+'-'+_0xcdb9b5+'/'+_0x101e29)[_0xe297('0x21')](_0x949589);}return null;};}function patchUpdates(_0x53a422){return function(_0x189cb7){try{jsonpatch[_0xe297('0x27')](_0x189cb7,_0x53a422,!![]);}catch(_0x2ead3e){return BPromise['reject'](_0x2ead3e);}return _0x189cb7['save']();};}function saveUpdates(_0x7a01cf,_0x4e2ab4){return function(_0x4c1140){if(_0x4c1140){return _0x4c1140['update'](_0x7a01cf)[_0xe297('0x28')](function(_0x37ee2a){return _0x37ee2a;});}return null;};}function removeEntity(_0x4194cc,_0x3f86c7){return function(_0x121b2b){if(_0x121b2b){return _0x121b2b['destroy']()[_0xe297('0x28')](function(){_0x4194cc[_0xe297('0x1f')](0xcc)[_0xe297('0x20')]();});}};}function handleEntityNotFound(_0x1b1b5a,_0x128cae){return function(_0x15c60c){if(!_0x15c60c){_0x1b1b5a[_0xe297('0x29')](0x194);}return _0x15c60c;};}function handleError(_0x315bfa,_0xc2af74){_0xc2af74=_0xc2af74||0x1f4;return function(_0x4e7614){logger[_0xe297('0x2a')](_0x4e7614[_0xe297('0x2b')]);if(_0x4e7614[_0xe297('0x2c')]){delete _0x4e7614[_0xe297('0x2c')];}_0x315bfa[_0xe297('0x1f')](_0xc2af74)[_0xe297('0x2d')](_0x4e7614);};}exports[_0xe297('0x2e')]=function(_0x3a2230,_0x3d88fc){var _0x227f75={},_0x43a837={},_0x27fb3a={'count':0x0,'rows':[]};var _0x1b8c84=_['map'](db[_0xe297('0x2f')]['rawAttributes'],function(_0x2d43ae){return{'name':_0x2d43ae[_0xe297('0x30')],'type':_0x2d43ae[_0xe297('0x31')]['key']};});_0x43a837[_0xe297('0x32')]=_['map'](_0x1b8c84,_0xe297('0x2c'));_0x43a837[_0xe297('0x33')]=_[_0xe297('0x34')](_0x3a2230[_0xe297('0x33')]);_0x43a837[_0xe297('0x35')]=_[_0xe297('0x36')](_0x43a837[_0xe297('0x32')],_0x43a837[_0xe297('0x33')]);_0x227f75[_0xe297('0x37')]=_[_0xe297('0x36')](_0x43a837[_0xe297('0x32')],qs['fields'](_0x3a2230[_0xe297('0x33')][_0xe297('0x38')]));_0x227f75['attributes']=_0x227f75[_0xe297('0x37')][_0xe297('0x39')]?_0x227f75[_0xe297('0x37')]:_0x43a837[_0xe297('0x32')];if(!_0x3a2230[_0xe297('0x33')][_0xe297('0x3a')](_0xe297('0x3b'))){_0x227f75[_0xe297('0x23')]=qs['limit'](_0x3a2230[_0xe297('0x33')][_0xe297('0x23')]);_0x227f75[_0xe297('0x25')]=qs[_0xe297('0x25')](_0x3a2230[_0xe297('0x33')][_0xe297('0x25')]);}_0x227f75[_0xe297('0x3c')]=qs['sort'](_0x3a2230['query'][_0xe297('0x3d')]);_0x227f75[_0xe297('0x3e')]=qs['filters'](_[_0xe297('0x3f')](_0x3a2230[_0xe297('0x33')],_0x43a837[_0xe297('0x35')]),_0x1b8c84);if(_0x3a2230['query'][_0xe297('0x40')]){_0x227f75['where']=_[_0xe297('0x41')](_0x227f75[_0xe297('0x3e')],{'$or':_[_0xe297('0x42')](_0x1b8c84,function(_0x45754b){if(_0x45754b[_0xe297('0x31')]!==_0xe297('0x43')){var _0x5e47c9={};_0x5e47c9[_0x45754b[_0xe297('0x2c')]]={'$like':'%'+_0x3a2230[_0xe297('0x33')][_0xe297('0x40')]+'%'};return _0x5e47c9;}})});}_0x227f75=_[_0xe297('0x41')]({},_0x227f75,_0x3a2230[_0xe297('0x44')]);var _0x3b72d0={'where':_0x227f75[_0xe297('0x3e')]};return db['UserProfile'][_0xe297('0x24')](_0x3b72d0)[_0xe297('0x28')](function(_0x1e7039){_0x27fb3a['count']=_0x1e7039;if(_0x3a2230['query'][_0xe297('0x45')]){_0x227f75[_0xe297('0x46')]=[{'all':!![]}];}return db[_0xe297('0x2f')]['findAll'](_0x227f75);})[_0xe297('0x28')](function(_0x30cb0d){_0x27fb3a[_0xe297('0x47')]=_0x30cb0d;return _0x27fb3a;})[_0xe297('0x28')](respondWithFilteredResult(_0x3d88fc,_0x227f75))[_0xe297('0x48')](handleError(_0x3d88fc,null));};exports[_0xe297('0x49')]=function(_0x53b851,_0x3c0e00){var _0x12de9b={'raw':![],'where':{'id':_0x53b851[_0xe297('0x4a')]['id']}},_0x27fd13={};_0x27fd13[_0xe297('0x32')]=_['keys'](db['UserProfile'][_0xe297('0x4b')]);_0x27fd13[_0xe297('0x33')]=_['keys'](_0x53b851[_0xe297('0x33')]);_0x27fd13[_0xe297('0x35')]=_[_0xe297('0x36')](_0x27fd13[_0xe297('0x32')],_0x27fd13[_0xe297('0x33')]);_0x12de9b[_0xe297('0x37')]=_[_0xe297('0x36')](_0x27fd13[_0xe297('0x32')],qs[_0xe297('0x38')](_0x53b851[_0xe297('0x33')]['fields']));_0x12de9b[_0xe297('0x37')]=_0x12de9b[_0xe297('0x37')][_0xe297('0x39')]?_0x12de9b[_0xe297('0x37')]:_0x27fd13[_0xe297('0x32')];if(_0x53b851[_0xe297('0x33')][_0xe297('0x45')]){_0x12de9b[_0xe297('0x46')]=[{'all':!![]}];}_0x12de9b=_['merge']({},_0x12de9b,_0x53b851[_0xe297('0x44')]);return db['UserProfile'][_0xe297('0x4c')](_0x12de9b)[_0xe297('0x28')](handleEntityNotFound(_0x3c0e00,null))['then'](respondWithResult(_0x3c0e00,null))[_0xe297('0x48')](handleError(_0x3c0e00,null));};exports[_0xe297('0x4d')]=function(_0x55c53c,_0x5e837b){return db[_0xe297('0x2f')][_0xe297('0x4d')](_0x55c53c[_0xe297('0x4e')],{})[_0xe297('0x28')](respondWithResult(_0x5e837b,0xc9))[_0xe297('0x48')](handleError(_0x5e837b,null));};exports[_0xe297('0x4f')]=function(_0x2dad99,_0x21dca5){var _0x4d5afa={'where':{'id':_0x2dad99[_0xe297('0x4a')]['id']}},_0x1c1cfe={};_0x1c1cfe[_0xe297('0x32')]=_['keys'](db['UserProfile'][_0xe297('0x4b')]);_0x4d5afa[_0xe297('0x37')]=_[_0xe297('0x36')](_0x1c1cfe['model'],qs[_0xe297('0x38')](_0x2dad99[_0xe297('0x33')][_0xe297('0x38')]));_0x4d5afa[_0xe297('0x37')]=_0x4d5afa['attributes'][_0xe297('0x39')]?_0x4d5afa['attributes']:_0x1c1cfe['model'];if(_0x2dad99[_0xe297('0x33')][_0xe297('0x45')]){_0x4d5afa['include']=[{'all':!![]}];}_0x4d5afa=_[_0xe297('0x41')]({},_0x4d5afa,_0x2dad99['options']);return db[_0xe297('0x2f')]['find'](_0x4d5afa)[_0xe297('0x28')](handleEntityNotFound(_0x21dca5,null))['then'](function(_0x118910){if(_0x118910){var _0x3d4450=_0x118910[_0xe297('0x50')]({'plain':!![]});_0x3d4450=qs[_0xe297('0x51')](_0x3d4450,['id',_0xe297('0x52'),_0xe297('0x53'),_0xe297('0x54')]);_0x2dad99[_0xe297('0x4e')]=_['omit'](_0x2dad99[_0xe297('0x4e')],['id','createdAt',_0xe297('0x53')]);return db[_0xe297('0x55')]['transaction'](function(_0x3106f1){return db[_0xe297('0x2f')][_0xe297('0x4d')](_[_0xe297('0x41')](_0x3d4450,_0x2dad99[_0xe297('0x4e')]),{'include':_0x2dad99[_0xe297('0x33')][_0xe297('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x3106f1})[_0xe297('0x28')](function(_0x131840){var _0x15fdf8=_0x131840[_0xe297('0x50')]({'plain':!![]});return db[_0xe297('0x56')][_0xe297('0x57')]({'where':{'userProfileId':_0x2dad99[_0xe297('0x4a')]['id']},'raw':!![]})[_0xe297('0x28')](function(_0x3631a8){if(_0x3631a8){return BPromise['each'](_0x3631a8,function(_0x289ba2){return new BPromise(function(_0x37e1f9,_0x303a3b){if(_0x289ba2[_0xe297('0x58')]===null||_0x289ba2[_0xe297('0x58')]===0x1)_0x37e1f9(null);return db[_0xe297('0x59')][_0xe297('0x57')]({'where':{'sectionId':_0x289ba2['id']},'raw':!![]})[_0xe297('0x28')](function(_0x5a26b5){var _0x412606=_[_0xe297('0x42')](_0x5a26b5,function(_0x53806b){return qs['omit'](_0x53806b,['id',_0xe297('0x52'),_0xe297('0x53'),'sectionId']);});_0x37e1f9(_0x412606);})['catch'](function(_0x4102aa){_0x303a3b(_0x4102aa);});})[_0xe297('0x28')](function(_0x440d45){var _0x3d2767=qs['omit'](_0x289ba2,['id','createdAt',_0xe297('0x53')]);_0x3d2767[_0xe297('0x5a')]=_0x15fdf8['id'];if(_0x440d45)_0x3d2767[_0xe297('0x5b')]=_0x440d45;return _0x3d2767;})[_0xe297('0x28')](function(_0x501d94){return db[_0xe297('0x56')][_0xe297('0x4d')](_0x501d94,{'include':[{'model':db[_0xe297('0x59')],'as':_0xe297('0x5b')}],'raw':!![],'transaction':_0x3106f1});});})[_0xe297('0x28')](function(){return _0x15fdf8;});}});});});}})[_0xe297('0x28')](respondWithResult(_0x21dca5,0xc9))[_0xe297('0x48')](handleError(_0x21dca5,null));};exports[_0xe297('0x5c')]=function(_0x4a30b8,_0x183ae2){if(_0x4a30b8[_0xe297('0x4e')]['id']){delete _0x4a30b8[_0xe297('0x4e')]['id'];}return db['UserProfile'][_0xe297('0x4c')]({'where':{'id':_0x4a30b8[_0xe297('0x4a')]['id']}})[_0xe297('0x28')](handleEntityNotFound(_0x183ae2,null))[_0xe297('0x28')](saveUpdates(_0x4a30b8[_0xe297('0x4e')],null))[_0xe297('0x28')](respondWithResult(_0x183ae2,null))[_0xe297('0x48')](handleError(_0x183ae2,null));};exports[_0xe297('0x5d')]=function(_0x38cf8a,_0x3af43e){return db[_0xe297('0x2f')][_0xe297('0x4c')]({'where':{'id':_0x38cf8a[_0xe297('0x4a')]['id']}})[_0xe297('0x28')](handleEntityNotFound(_0x3af43e,null))['then'](removeEntity(_0x3af43e,null))[_0xe297('0x48')](handleError(_0x3af43e,null));};exports[_0xe297('0x5e')]=function(_0x202d63,_0x305be9){return db[_0xe297('0x2f')][_0xe297('0x5e')]()[_0xe297('0x28')](respondWithResult(_0x305be9,null))[_0xe297('0x48')](handleError(_0x305be9,null));};exports['addSections']=function(_0x33242e,_0xbeca54){var _0x3106be=_0x33242e['body'];return db[_0xe297('0x2f')][_0xe297('0x4c')]({'where':{'id':_0x33242e[_0xe297('0x4a')]['id']}})[_0xe297('0x28')](handleEntityNotFound(_0xbeca54,null))['then'](function(_0x5d3e09){if(_0x5d3e09){return db[_0xe297('0x55')][_0xe297('0x5f')](function(_0x28f17e){return db[_0xe297('0x56')]['destroy']({'where':{'userProfileId':_0x33242e['params']['id'],'sectionId':_[_0xe297('0x42')](_0x3106be,function(_0x36bbbb){return _0x36bbbb['sectionId'];})},'transaction':_0x28f17e})['then'](function(){var _0x21cf34=_[_0xe297('0x42')](_0x3106be,function(_0x110d5b){_0x110d5b['userProfileId']=_0x33242e[_0xe297('0x4a')]['id'];return _0x110d5b;});var _0xf0a8ca=[];return BPromise[_0xe297('0x60')](_0x21cf34,function(_0x36b945){return db['UserProfileSection'][_0xe297('0x4d')](_0x36b945,{'include':[{'model':db[_0xe297('0x59')],'as':_0xe297('0x5b')}],'raw':!![],'transaction':_0x28f17e})[_0xe297('0x28')](function(_0x37d105){_0xf0a8ca['push'](_0x37d105[_0xe297('0x50')]({'plain':!![]}));});})[_0xe297('0x28')](function(){return _0xf0a8ca;});});});}})[_0xe297('0x28')](function(_0xbc0090){return _0xbc0090;})[_0xe297('0x28')](respondWithResult(_0xbeca54,null))[_0xe297('0x48')](handleError(_0xbeca54,null));};exports['removeSections']=function(_0x11b7e5,_0xbb5915){var _0x3b322a;return db['UserProfile'][_0xe297('0x4c')]({'where':{'id':_0x11b7e5['params']['id']},'attributes':['id',_0xe297('0x2c')]})[_0xe297('0x28')](handleEntityNotFound(_0xbb5915,null))[_0xe297('0x28')](function(_0x287eb4){if(_0x287eb4){_0x3b322a=_0x287eb4;return db[_0xe297('0x56')][_0xe297('0x5d')]({'where':{'userProfileId':_0x11b7e5['params']['id'],'sectionId':_0x11b7e5[_0xe297('0x33')][_0xe297('0x61')]}});}})[_0xe297('0x28')](function(){return _0x3b322a;})['then'](respondWithStatusCode(_0xbb5915,null))[_0xe297('0x48')](handleError(_0xbb5915,null));};exports[_0xe297('0x62')]=function(_0x12e431,_0xf1a2b8){var _0x311d07=[];var _0x3dbe46=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x12e431[_0xe297('0x4a')]['id']},'raw':!![]})['then'](function(_0x1a4099){_0x311d07=_[_0xe297('0x40')](_0x1a4099,function(_0x2638fb){return _0x2638fb[_0xe297('0x63')]===0x1||_[_0xe297('0x64')]([0x3eb,0x709],_0x2638fb['sectionId']);});if(!_[_0xe297('0x65')](_0x311d07)){return _[_0xe297('0x42')](_0x311d07,function(_0x5ec8bd){return _0x5ec8bd[_0xe297('0x66')];});}else{return;}})['then'](function(_0x2112bd){if(_0x2112bd)_0x3dbe46=_0x2112bd;if(_[_0xe297('0x64')](_0x3dbe46,0x64)){var _0xaa8b34=_['find'](_0x311d07,{'sectionId':0x64});return hasDefaultDashboard(_0xaa8b34)[_0xe297('0x28')](function(_0x1c2ed2){return _['map'](_0x311d07,function(_0x170eca){if(_0x170eca[_0xe297('0x66')]===0x64){_0x170eca[_0xe297('0x67')]=_0x1c2ed2;}return _0x170eca;});});}else{return;}})[_0xe297('0x28')](function(_0x589615){if(_0x589615)_0x311d07=_0x589615;if(_['includes'](_0x3dbe46,0x3eb)){var _0x45c2f0=_[_0xe297('0x4c')](_0x311d07,{'sectionId':0x3eb});return getCustomDashboards(_0x45c2f0)['then'](function(_0x35f7a7){return _[_0xe297('0x42')](_0x311d07,function(_0x2e5e81){if(_0x45c2f0[_0xe297('0x63')]){if(_0x2e5e81[_0xe297('0x66')]===0x3eb){_0x2e5e81[_0xe297('0x67')]=_0x35f7a7;}}else{if(_0x2e5e81[_0xe297('0x66')]===0x64){if(!_0x2e5e81[_0xe297('0x67')]){_0x2e5e81[_0xe297('0x67')]=[];}_0x2e5e81[_0xe297('0x67')]=_0x2e5e81[_0xe297('0x67')][_0xe297('0x68')](_0x35f7a7);}}return _0x2e5e81;});});}else{return;}})[_0xe297('0x28')](function(_0x3a6241){if(_0x3a6241)_0x311d07=_0x3a6241;if(_['includes'](_0x3dbe46,0x709)){var _0x571d5e=_[_0xe297('0x4c')](_0x311d07,{'sectionId':0x709});return getPlugins(_0x571d5e)[_0xe297('0x28')](function(_0x253e9f){if(_0x571d5e[_0xe297('0x63')]){return _[_0xe297('0x42')](_0x311d07,function(_0x2de3fa){if(_0x2de3fa[_0xe297('0x66')]===0x709){_0x2de3fa['subsections']=_0x253e9f;}return _0x2de3fa;});}else{var _0x48f6a6={'sectionId':0x76c,'enabled':0x1,'subsections':_0x253e9f};var _0x404b9a=_[_0xe297('0x42')](_0x311d07);_0x404b9a['push'](_0x48f6a6);return _0x404b9a;}});}else{return;}})[_0xe297('0x28')](function(_0x41c581){if(_0x41c581)_0x311d07=_0x41c581;return _[_0xe297('0x40')](_0x311d07,[_0xe297('0x63'),0x1]);})[_0xe297('0x28')](respondWithResult(_0xf1a2b8,null))[_0xe297('0x48')](handleError(_0xf1a2b8,null));};function hasDefaultDashboard(_0x5f1e19){var _0x490e1d=[0x65];return new BPromise(function(_0x45df9c,_0x203ff5){try{if(_0x5f1e19[_0xe297('0x58')]){_0x45df9c(_0x490e1d);}else{return db[_0xe297('0x59')][_0xe297('0x69')]({'where':{'sectionId':_0x5f1e19['id']},'raw':!![]})[_0xe297('0x28')](function(_0x407aa7){_0x407aa7?_0x45df9c(_0x490e1d):_0x45df9c();});}}catch(_0x3e6095){_0x203ff5(_0x3e6095);}});}function getCustomDashboards(_0x3a9a8b){var _0x578af5=[];return new BPromise(function(_0x52ef18,_0x4b20c8){try{if(_0x3a9a8b[_0xe297('0x58')]){return db[_0xe297('0x6a')][_0xe297('0x57')]({'raw':!![]})[_0xe297('0x28')](function(_0x5f4327){_0x5f4327['forEach'](function(_0x3717b2){_0x578af5[_0xe297('0x6b')](_0x3717b2['id']+0x1869f);});_0x52ef18(_0x578af5);});}else{return db[_0xe297('0x59')]['findAll']({'where':{'sectionId':_0x3a9a8b['id']},'raw':!![]})[_0xe297('0x28')](function(_0x52af29){_0x52af29[_0xe297('0x6c')](function(_0xa5e8fb){_0x578af5[_0xe297('0x6b')](_0xa5e8fb[_0xe297('0x6d')]+0x1869f);});_0x52ef18(_0x578af5);});}}catch(_0x21fc6c){_0x4b20c8(_0x21fc6c);}});}function getPlugins(_0xd48ec0){var _0x513b4e=[];return new BPromise(function(_0x4d518e,_0x945d46){try{if(_0xd48ec0[_0xe297('0x58')]){return db[_0xe297('0x6e')][_0xe297('0x57')]({'raw':!![]})[_0xe297('0x28')](function(_0x3efb9e){_0x3efb9e['forEach'](function(_0x4dea3f){_0x513b4e[_0xe297('0x6b')](_0x4dea3f['id']+0x15b38);});_0x4d518e(_0x513b4e);});}else{return db['UserProfileResource'][_0xe297('0x57')]({'where':{'sectionId':_0xd48ec0['id']},'raw':!![]})['then'](function(_0x1c5f9b){_0x1c5f9b[_0xe297('0x6c')](function(_0x15b76d){_0x513b4e[_0xe297('0x6b')](_0x15b76d[_0xe297('0x6d')]+0x15b38);});_0x4d518e(_0x513b4e);});}}catch(_0x5bd5e3){_0x945d46(_0x5bd5e3);}});}exports['addResources']=function(_0x473bf9,_0x3262af){return db[_0xe297('0x2f')][_0xe297('0x4c')]({'where':{'id':_0x473bf9['params']['id']}})[_0xe297('0x28')](handleEntityNotFound(_0x3262af,null))[_0xe297('0x28')](function(_0x2203b5){if(_0x2203b5){return db['sequelize'][_0xe297('0x5f')](function(_0x589624){return db['UserProfileSection'][_0xe297('0x57')]({'where':{'userProfileId':_0x473bf9['params']['id']},'attributes':['id'],'raw':!![]})[_0xe297('0x28')](function(_0x5781b6){if(_0x5781b6){return db[_0xe297('0x56')]['destroy']({'where':{'userProfileId':_0x473bf9['params']['id'],'id':_['map'](_0x5781b6,function(_0x51536b){return _0x51536b['id'];})},'transaction':_0x589624});}})[_0xe297('0x28')](function(_0x2498b9){var _0x244724=_[_0xe297('0x42')](_0x473bf9[_0xe297('0x4e')],function(_0xa6344d){_0xa6344d[_0xe297('0x5a')]=_0x473bf9['params']['id'];return _0xa6344d;});return db[_0xe297('0x56')][_0xe297('0x6f')](_0x244724,{'raw':!![],'transaction':_0x589624});})[_0xe297('0x28')](function(_0x6b34f3){var _0x2fe6a1=_[_0xe297('0x40')](_[_0xe297('0x42')](_0x6b34f3,function(_0x4b6d39){return _0x4b6d39[_0xe297('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x2fe6a1){return db['UserProfileSection'][_0xe297('0x57')]({'where':{'userProfileId':_0x473bf9[_0xe297('0x4a')]['id'],'sectionId':_[_0xe297('0x42')](_0x2fe6a1,function(_0x240464){return _0x240464[_0xe297('0x66')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xe297('0x28')](function(_0x18aa5a){var _0x14f59a=_[_0xe297('0x42')](_0x473bf9[_0xe297('0x4e')],function(_0x52bc48){_0x52bc48[_0xe297('0x5a')]=_0x473bf9[_0xe297('0x4a')]['id'];return _0x52bc48;});return db[_0xe297('0x59')][_0xe297('0x6f')](_0x14f59a,{'raw':!![],'transaction':_0x589624});});}})[_0xe297('0x48')](handleError(_0x3262af,null));});}})[_0xe297('0x28')](function(_0x4f4996){var _0x539ca2=_[_0xe297('0x42')](_0x4f4996,function(_0x31cdc7){return _0x31cdc7[_0xe297('0x50')]({'plain':!![]});});})[_0xe297('0x28')](respondWithResult(_0x3262af,null))[_0xe297('0x48')](handleError(_0x3262af,null));};exports[_0xe297('0x70')]=function(_0x538a31,_0x4bd426,_0x1240ad){return db[_0xe297('0x2f')][_0xe297('0x4c')]({'where':{'id':_0x538a31['params']['id']}})[_0xe297('0x28')](handleEntityNotFound(_0x4bd426,null))[_0xe297('0x28')](function(_0x4c3ebd){if(_0x4c3ebd){return _0x4c3ebd[_0xe297('0x70')](_0x538a31[_0xe297('0x33')]['ids']);}})[_0xe297('0x28')](respondWithStatusCode(_0x4bd426,null))[_0xe297('0x48')](handleError(_0x4bd426,null));};exports[_0xe297('0x71')]=function(_0x5902cd,_0x278e99){var _0x5d6acf={};if(!_0x5902cd[_0xe297('0x33')][_0xe297('0x72')])throw new Error(_0xe297('0x73'));if(!_0x5902cd[_0xe297('0x33')][_0xe297('0x3a')](_0xe297('0x3b'))){_0x5d6acf['limit']=qs[_0xe297('0x23')](_0x5902cd[_0xe297('0x33')][_0xe297('0x23')]);_0x5d6acf['offset']=qs['offset'](_0x5902cd[_0xe297('0x33')][_0xe297('0x25')]);}return db['UserProfile']['find']({'where':{'id':_0x5902cd[_0xe297('0x4a')]['id']}})[_0xe297('0x28')](function(_0x16bcb9){if(!_0x16bcb9)throw new Error(_0xe297('0x74')+_0x5902cd['params']['id']);return db[_0xe297('0x2f')][_0xe297('0x71')](_0x5902cd);})[_0xe297('0x28')](respondWithFilteredResult(_0x278e99,_0x5d6acf))[_0xe297('0x48')](handleError(_0x278e99,null));}; \ No newline at end of file +var _0x80b0=['No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create','body','clone','length','include','get','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','Resources','update','describe','sectionId','userProfileId','push','removeSections','ids','enabled','includes','subsections','concat','findOne','Dashboard','resourceId','Plugin','forEach','bulkCreate','removeResources','section'];(function(_0x40eec0,_0x12ed0c){var _0x233e50=function(_0x921eb5){while(--_0x921eb5){_0x40eec0['push'](_0x40eec0['shift']());}};_0x233e50(++_0x12ed0c);}(_0x80b0,0x152));var _0x080b=function(_0x127a10,_0x57b1be){_0x127a10=_0x127a10-0x0;var _0x2dbb6d=_0x80b0[_0x127a10];return _0x2dbb6d;};'use strict';var emlformat=require(_0x080b('0x0'));var rimraf=require(_0x080b('0x1'));var zipdir=require(_0x080b('0x2'));var jsonpatch=require(_0x080b('0x3'));var rp=require(_0x080b('0x4'));var moment=require(_0x080b('0x5'));var BPromise=require(_0x080b('0x6'));var Mustache=require('mustache');var util=require(_0x080b('0x7'));var path=require('path');var sox=require(_0x080b('0x8'));var csv=require(_0x080b('0x9'));var ejs=require(_0x080b('0xa'));var fs=require('fs');var fs_extra=require(_0x080b('0xb'));var _=require(_0x080b('0xc'));var squel=require(_0x080b('0xd'));var crypto=require('crypto');var jsforce=require(_0x080b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x080b('0x9'));var querystring=require('querystring');var Papa=require(_0x080b('0xf'));var Redis=require(_0x080b('0x10'));var authService=require(_0x080b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x080b('0x12'));var hardwareService=require(_0x080b('0x13'));var logger=require(_0x080b('0x14'))(_0x080b('0x15'));var utils=require(_0x080b('0x16'));var config=require(_0x080b('0x17'));var licenseUtil=require(_0x080b('0x18'));var db=require(_0x080b('0x19'))['db'];config[_0x080b('0x1a')]=_['defaults'](config['redis'],{'host':_0x080b('0x1b'),'port':0x18eb});var socket=require(_0x080b('0x1c'))(new Redis(config['redis']));require('./userProfile.socket')[_0x080b('0x1d')](socket);function respondWithStatusCode(_0x3f705f,_0x3aad9b){_0x3aad9b=_0x3aad9b||0xcc;return function(_0x1f04b8){if(_0x1f04b8){return _0x3f705f[_0x080b('0x1e')](_0x3aad9b);}return _0x3f705f[_0x080b('0x1f')](_0x3aad9b)[_0x080b('0x20')]();};}function respondWithResult(_0x407932,_0x28212b){_0x28212b=_0x28212b||0xc8;return function(_0x102bba){if(_0x102bba){return _0x407932[_0x080b('0x1f')](_0x28212b)[_0x080b('0x21')](_0x102bba);}};}function respondWithFilteredResult(_0x4fc7a2,_0x5f2fc3){return function(_0x2e8a0f){if(_0x2e8a0f){var _0x2e7885=typeof _0x5f2fc3[_0x080b('0x22')]===_0x080b('0x23')&&typeof _0x5f2fc3[_0x080b('0x24')]===_0x080b('0x23');var _0x2b9817=_0x2e8a0f[_0x080b('0x25')];var _0x1f77cc=_0x2e7885?0x0:_0x5f2fc3[_0x080b('0x22')];var _0x1760f9=_0x2e7885?_0x2e8a0f[_0x080b('0x25')]:_0x5f2fc3[_0x080b('0x22')]+_0x5f2fc3['limit'];var _0x297eb1;if(_0x1760f9>=_0x2b9817){_0x1760f9=_0x2b9817;_0x297eb1=0xc8;}else{_0x297eb1=0xce;}_0x4fc7a2[_0x080b('0x1f')](_0x297eb1);return _0x4fc7a2[_0x080b('0x26')](_0x080b('0x27'),_0x1f77cc+'-'+_0x1760f9+'/'+_0x2b9817)['json'](_0x2e8a0f);}return null;};}function patchUpdates(_0x78190d){return function(_0x41c248){try{jsonpatch[_0x080b('0x28')](_0x41c248,_0x78190d,!![]);}catch(_0x1b7e9a){return BPromise['reject'](_0x1b7e9a);}return _0x41c248['save']();};}function saveUpdates(_0x3ec34d,_0x14e44e){return function(_0x4dd16d){if(_0x4dd16d){return _0x4dd16d['update'](_0x3ec34d)[_0x080b('0x29')](function(_0x18f835){return _0x18f835;});}return null;};}function removeEntity(_0x23c7de,_0x3e0430){return function(_0x1d4f20){if(_0x1d4f20){return _0x1d4f20[_0x080b('0x2a')]()[_0x080b('0x29')](function(){_0x23c7de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fd99,_0x9d09f0){return function(_0x26cf2f){if(!_0x26cf2f){_0x39fd99['sendStatus'](0x194);}return _0x26cf2f;};}function handleError(_0x3d9360,_0x527b44){_0x527b44=_0x527b44||0x1f4;return function(_0x381806){logger[_0x080b('0x2b')](_0x381806['stack']);if(_0x381806[_0x080b('0x2c')]){delete _0x381806[_0x080b('0x2c')];}_0x3d9360[_0x080b('0x1f')](_0x527b44)[_0x080b('0x2d')](_0x381806);};}exports['index']=function(_0x29f47a,_0x27e0f8){var _0x370db3={},_0x66c124={},_0x346bd0={'count':0x0,'rows':[]};var _0x336bf0=_[_0x080b('0x2e')](db[_0x080b('0x2f')][_0x080b('0x30')],function(_0x30d6e3){return{'name':_0x30d6e3[_0x080b('0x31')],'type':_0x30d6e3[_0x080b('0x32')][_0x080b('0x33')]};});_0x66c124[_0x080b('0x34')]=_[_0x080b('0x2e')](_0x336bf0,_0x080b('0x2c'));_0x66c124[_0x080b('0x35')]=_[_0x080b('0x36')](_0x29f47a[_0x080b('0x35')]);_0x66c124[_0x080b('0x37')]=_['intersection'](_0x66c124[_0x080b('0x34')],_0x66c124['query']);_0x370db3['attributes']=_[_0x080b('0x38')](_0x66c124[_0x080b('0x34')],qs[_0x080b('0x39')](_0x29f47a[_0x080b('0x35')]['fields']));_0x370db3[_0x080b('0x3a')]=_0x370db3['attributes']['length']?_0x370db3[_0x080b('0x3a')]:_0x66c124[_0x080b('0x34')];if(!_0x29f47a[_0x080b('0x35')][_0x080b('0x3b')](_0x080b('0x3c'))){_0x370db3[_0x080b('0x24')]=qs['limit'](_0x29f47a[_0x080b('0x35')][_0x080b('0x24')]);_0x370db3['offset']=qs[_0x080b('0x22')](_0x29f47a[_0x080b('0x35')][_0x080b('0x22')]);}_0x370db3[_0x080b('0x3d')]=qs['sort'](_0x29f47a[_0x080b('0x35')][_0x080b('0x3e')]);_0x370db3[_0x080b('0x3f')]=qs[_0x080b('0x37')](_['pick'](_0x29f47a['query'],_0x66c124[_0x080b('0x37')]),_0x336bf0);if(_0x29f47a[_0x080b('0x35')][_0x080b('0x40')]){_0x370db3['where']=_[_0x080b('0x41')](_0x370db3[_0x080b('0x3f')],{'$or':_['map'](_0x336bf0,function(_0x349cef){if(_0x349cef['type']!==_0x080b('0x42')){var _0x2cf397={};_0x2cf397[_0x349cef[_0x080b('0x2c')]]={'$like':'%'+_0x29f47a[_0x080b('0x35')]['filter']+'%'};return _0x2cf397;}})});}_0x370db3=_[_0x080b('0x41')]({},_0x370db3,_0x29f47a[_0x080b('0x43')]);var _0x5a651d={'where':_0x370db3['where']};return db[_0x080b('0x2f')][_0x080b('0x25')](_0x5a651d)[_0x080b('0x29')](function(_0x238e13){_0x346bd0[_0x080b('0x25')]=_0x238e13;if(_0x29f47a['query'][_0x080b('0x44')]){_0x370db3['include']=[{'all':!![]}];}return db[_0x080b('0x2f')][_0x080b('0x45')](_0x370db3);})[_0x080b('0x29')](function(_0x2a113f){_0x346bd0['rows']=_0x2a113f;return _0x346bd0;})[_0x080b('0x29')](respondWithFilteredResult(_0x27e0f8,_0x370db3))[_0x080b('0x46')](handleError(_0x27e0f8,null));};exports[_0x080b('0x47')]=function(_0xdf2e9a,_0x18cf57){var _0x6085d5={'raw':![],'where':{'id':_0xdf2e9a[_0x080b('0x48')]['id']}},_0x45d5c0={};_0x45d5c0[_0x080b('0x34')]=_[_0x080b('0x36')](db['UserProfile'][_0x080b('0x30')]);_0x45d5c0['query']=_['keys'](_0xdf2e9a[_0x080b('0x35')]);_0x45d5c0[_0x080b('0x37')]=_[_0x080b('0x38')](_0x45d5c0[_0x080b('0x34')],_0x45d5c0[_0x080b('0x35')]);_0x6085d5['attributes']=_[_0x080b('0x38')](_0x45d5c0[_0x080b('0x34')],qs[_0x080b('0x39')](_0xdf2e9a['query'][_0x080b('0x39')]));_0x6085d5[_0x080b('0x3a')]=_0x6085d5[_0x080b('0x3a')]['length']?_0x6085d5[_0x080b('0x3a')]:_0x45d5c0[_0x080b('0x34')];if(_0xdf2e9a[_0x080b('0x35')][_0x080b('0x44')]){_0x6085d5['include']=[{'all':!![]}];}_0x6085d5=_['merge']({},_0x6085d5,_0xdf2e9a[_0x080b('0x43')]);return db[_0x080b('0x2f')][_0x080b('0x49')](_0x6085d5)[_0x080b('0x29')](handleEntityNotFound(_0x18cf57,null))[_0x080b('0x29')](respondWithResult(_0x18cf57,null))[_0x080b('0x46')](handleError(_0x18cf57,null));};exports[_0x080b('0x4a')]=function(_0x64d72e,_0x1bc5a9){return db[_0x080b('0x2f')]['create'](_0x64d72e[_0x080b('0x4b')],{})[_0x080b('0x29')](respondWithResult(_0x1bc5a9,0xc9))['catch'](handleError(_0x1bc5a9,null));};exports[_0x080b('0x4c')]=function(_0xe2c018,_0x20f725){var _0x375dd8={'where':{'id':_0xe2c018['params']['id']}},_0x2e6673={};_0x2e6673[_0x080b('0x34')]=_[_0x080b('0x36')](db[_0x080b('0x2f')][_0x080b('0x30')]);_0x375dd8[_0x080b('0x3a')]=_[_0x080b('0x38')](_0x2e6673['model'],qs[_0x080b('0x39')](_0xe2c018['query'][_0x080b('0x39')]));_0x375dd8['attributes']=_0x375dd8[_0x080b('0x3a')][_0x080b('0x4d')]?_0x375dd8[_0x080b('0x3a')]:_0x2e6673[_0x080b('0x34')];if(_0xe2c018[_0x080b('0x35')]['includeAll']){_0x375dd8[_0x080b('0x4e')]=[{'all':!![]}];}_0x375dd8=_[_0x080b('0x41')]({},_0x375dd8,_0xe2c018[_0x080b('0x43')]);return db[_0x080b('0x2f')][_0x080b('0x49')](_0x375dd8)['then'](handleEntityNotFound(_0x20f725,null))['then'](function(_0x4b09bd){if(_0x4b09bd){var _0x799f9f=_0x4b09bd[_0x080b('0x4f')]({'plain':!![]});_0x799f9f=qs['omit'](_0x799f9f,['id',_0x080b('0x50'),_0x080b('0x51'),_0x080b('0x52')]);_0xe2c018['body']=_[_0x080b('0x53')](_0xe2c018[_0x080b('0x4b')],['id','createdAt',_0x080b('0x51')]);return db[_0x080b('0x54')][_0x080b('0x55')](function(_0x370204){return db[_0x080b('0x2f')][_0x080b('0x4a')](_[_0x080b('0x41')](_0x799f9f,_0xe2c018[_0x080b('0x4b')]),{'include':_0xe2c018[_0x080b('0x35')][_0x080b('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x370204})[_0x080b('0x29')](function(_0x48222c){var _0x45bae6=_0x48222c[_0x080b('0x4f')]({'plain':!![]});return db[_0x080b('0x56')][_0x080b('0x45')]({'where':{'userProfileId':_0xe2c018['params']['id']},'raw':!![]})[_0x080b('0x29')](function(_0x36cfb4){if(_0x36cfb4){return BPromise[_0x080b('0x57')](_0x36cfb4,function(_0x1fa792){return new BPromise(function(_0x6e43eb,_0x2658ca){if(_0x1fa792[_0x080b('0x58')]===null||_0x1fa792[_0x080b('0x58')]===0x1)_0x6e43eb(null);return db[_0x080b('0x59')]['findAll']({'where':{'sectionId':_0x1fa792['id']},'raw':!![]})[_0x080b('0x29')](function(_0x3be5ee){var _0x2ceac3=_['map'](_0x3be5ee,function(_0xbb3c81){return qs[_0x080b('0x53')](_0xbb3c81,['id',_0x080b('0x50'),_0x080b('0x51'),'sectionId']);});_0x6e43eb(_0x2ceac3);})[_0x080b('0x46')](function(_0x5bb6ca){_0x2658ca(_0x5bb6ca);});})[_0x080b('0x29')](function(_0x5afd20){var _0x467a67=qs[_0x080b('0x53')](_0x1fa792,['id',_0x080b('0x50'),'updatedAt']);_0x467a67['userProfileId']=_0x45bae6['id'];if(_0x5afd20)_0x467a67[_0x080b('0x5a')]=_0x5afd20;return _0x467a67;})[_0x080b('0x29')](function(_0x169817){return db['UserProfileSection'][_0x080b('0x4a')](_0x169817,{'include':[{'model':db[_0x080b('0x59')],'as':_0x080b('0x5a')}],'raw':!![],'transaction':_0x370204});});})['then'](function(){return _0x45bae6;});}});});});}})[_0x080b('0x29')](respondWithResult(_0x20f725,0xc9))[_0x080b('0x46')](handleError(_0x20f725,null));};exports[_0x080b('0x5b')]=function(_0x1b2a53,_0x19e460){if(_0x1b2a53['body']['id']){delete _0x1b2a53[_0x080b('0x4b')]['id'];}return db[_0x080b('0x2f')]['find']({'where':{'id':_0x1b2a53['params']['id']}})['then'](handleEntityNotFound(_0x19e460,null))[_0x080b('0x29')](saveUpdates(_0x1b2a53[_0x080b('0x4b')],null))[_0x080b('0x29')](respondWithResult(_0x19e460,null))[_0x080b('0x46')](handleError(_0x19e460,null));};exports['destroy']=function(_0x9f6c1d,_0x355680){return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0x9f6c1d[_0x080b('0x48')]['id']}})[_0x080b('0x29')](handleEntityNotFound(_0x355680,null))[_0x080b('0x29')](removeEntity(_0x355680,null))[_0x080b('0x46')](handleError(_0x355680,null));};exports[_0x080b('0x5c')]=function(_0xd96c2d,_0x480b1b){return db['UserProfile'][_0x080b('0x5c')]()[_0x080b('0x29')](respondWithResult(_0x480b1b,null))['catch'](handleError(_0x480b1b,null));};exports['addSections']=function(_0x20f98c,_0x4d272b){var _0x15b763=_0x20f98c[_0x080b('0x4b')];return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0x20f98c['params']['id']}})[_0x080b('0x29')](handleEntityNotFound(_0x4d272b,null))[_0x080b('0x29')](function(_0x370958){if(_0x370958){return db['sequelize']['transaction'](function(_0xdb64b7){return db[_0x080b('0x56')][_0x080b('0x2a')]({'where':{'userProfileId':_0x20f98c['params']['id'],'sectionId':_['map'](_0x15b763,function(_0x333436){return _0x333436[_0x080b('0x5d')];})},'transaction':_0xdb64b7})[_0x080b('0x29')](function(){var _0x413229=_[_0x080b('0x2e')](_0x15b763,function(_0x445b0b){_0x445b0b[_0x080b('0x5e')]=_0x20f98c[_0x080b('0x48')]['id'];return _0x445b0b;});var _0x259a6b=[];return BPromise[_0x080b('0x57')](_0x413229,function(_0xd49c5c){return db['UserProfileSection']['create'](_0xd49c5c,{'include':[{'model':db['UserProfileResource'],'as':_0x080b('0x5a')}],'raw':!![],'transaction':_0xdb64b7})[_0x080b('0x29')](function(_0x3459a7){_0x259a6b[_0x080b('0x5f')](_0x3459a7[_0x080b('0x4f')]({'plain':!![]}));});})[_0x080b('0x29')](function(){return _0x259a6b;});});});}})[_0x080b('0x29')](function(_0x40339d){return _0x40339d;})['then'](respondWithResult(_0x4d272b,null))[_0x080b('0x46')](handleError(_0x4d272b,null));};exports[_0x080b('0x60')]=function(_0xa52c4,_0xbd0db2){var _0x2d195f;return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0xa52c4['params']['id']},'attributes':['id',_0x080b('0x2c')]})[_0x080b('0x29')](handleEntityNotFound(_0xbd0db2,null))[_0x080b('0x29')](function(_0x59dfe6){if(_0x59dfe6){_0x2d195f=_0x59dfe6;return db[_0x080b('0x56')]['destroy']({'where':{'userProfileId':_0xa52c4[_0x080b('0x48')]['id'],'sectionId':_0xa52c4[_0x080b('0x35')][_0x080b('0x61')]}});}})[_0x080b('0x29')](function(){return _0x2d195f;})[_0x080b('0x29')](respondWithStatusCode(_0xbd0db2,null))[_0x080b('0x46')](handleError(_0xbd0db2,null));};exports['getSections']=function(_0x473e6f,_0x2eee65){var _0x32046f=[];var _0x24b782=[];return db[_0x080b('0x56')][_0x080b('0x45')]({'where':{'userProfileId':_0x473e6f[_0x080b('0x48')]['id']},'raw':!![]})[_0x080b('0x29')](function(_0x4addfc){_0x32046f=_[_0x080b('0x40')](_0x4addfc,function(_0xe0f70f){return _0xe0f70f[_0x080b('0x62')]===0x1||_[_0x080b('0x63')]([0x3eb,0x709],_0xe0f70f[_0x080b('0x5d')]);});if(!_['isEmpty'](_0x32046f)){return _[_0x080b('0x2e')](_0x32046f,function(_0x1eb0c4){return _0x1eb0c4[_0x080b('0x5d')];});}else{return;}})[_0x080b('0x29')](function(_0x2dbe75){if(_0x2dbe75)_0x24b782=_0x2dbe75;if(_[_0x080b('0x63')](_0x24b782,0x64)){var _0x5c88cd=_[_0x080b('0x49')](_0x32046f,{'sectionId':0x64});return hasDefaultDashboard(_0x5c88cd)[_0x080b('0x29')](function(_0x56f7f5){return _[_0x080b('0x2e')](_0x32046f,function(_0x36d029){if(_0x36d029[_0x080b('0x5d')]===0x64){_0x36d029['subsections']=_0x56f7f5;}return _0x36d029;});});}else{return;}})[_0x080b('0x29')](function(_0x2977aa){if(_0x2977aa)_0x32046f=_0x2977aa;if(_[_0x080b('0x63')](_0x24b782,0x3eb)){var _0x299f2b=_[_0x080b('0x49')](_0x32046f,{'sectionId':0x3eb});return getCustomDashboards(_0x299f2b)['then'](function(_0xc7a7af){return _[_0x080b('0x2e')](_0x32046f,function(_0x5f18bc){if(_0x299f2b[_0x080b('0x62')]){if(_0x5f18bc[_0x080b('0x5d')]===0x3eb){_0x5f18bc['subsections']=_0xc7a7af;}}else{if(_0x5f18bc[_0x080b('0x5d')]===0x64){if(!_0x5f18bc[_0x080b('0x64')]){_0x5f18bc['subsections']=[];}_0x5f18bc['subsections']=_0x5f18bc[_0x080b('0x64')][_0x080b('0x65')](_0xc7a7af);}}return _0x5f18bc;});});}else{return;}})[_0x080b('0x29')](function(_0x4b6097){if(_0x4b6097)_0x32046f=_0x4b6097;if(_[_0x080b('0x63')](_0x24b782,0x709)){var _0x4b01f5=_[_0x080b('0x49')](_0x32046f,{'sectionId':0x709});return getPlugins(_0x4b01f5)['then'](function(_0x3f83a0){if(_0x4b01f5[_0x080b('0x62')]){return _['map'](_0x32046f,function(_0x55119c){if(_0x55119c[_0x080b('0x5d')]===0x709){_0x55119c['subsections']=_0x3f83a0;}return _0x55119c;});}else{var _0x92395b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3f83a0};var _0x4938ee=_['map'](_0x32046f);_0x4938ee[_0x080b('0x5f')](_0x92395b);return _0x4938ee;}});}else{return;}})[_0x080b('0x29')](function(_0xe3900a){if(_0xe3900a)_0x32046f=_0xe3900a;return _[_0x080b('0x40')](_0x32046f,[_0x080b('0x62'),0x1]);})[_0x080b('0x29')](respondWithResult(_0x2eee65,null))['catch'](handleError(_0x2eee65,null));};function hasDefaultDashboard(_0x9e83ea){var _0xc84df6=[0x65];return new BPromise(function(_0x80b47a,_0x8e8935){try{if(_0x9e83ea['autoAssociation']){_0x80b47a(_0xc84df6);}else{return db[_0x080b('0x59')][_0x080b('0x66')]({'where':{'sectionId':_0x9e83ea['id']},'raw':!![]})[_0x080b('0x29')](function(_0x5dd0ac){_0x5dd0ac?_0x80b47a(_0xc84df6):_0x80b47a();});}}catch(_0x187e8a){_0x8e8935(_0x187e8a);}});}function getCustomDashboards(_0x23375e){var _0x2b5e69=[];return new BPromise(function(_0x1d0149,_0x23c287){try{if(_0x23375e[_0x080b('0x58')]){return db[_0x080b('0x67')][_0x080b('0x45')]({'raw':!![]})[_0x080b('0x29')](function(_0x43f42a){_0x43f42a['forEach'](function(_0x65086e){_0x2b5e69[_0x080b('0x5f')](_0x65086e['id']+0x1869f);});_0x1d0149(_0x2b5e69);});}else{return db[_0x080b('0x59')][_0x080b('0x45')]({'where':{'sectionId':_0x23375e['id']},'raw':!![]})['then'](function(_0x330793){_0x330793['forEach'](function(_0x3a259a){_0x2b5e69[_0x080b('0x5f')](_0x3a259a[_0x080b('0x68')]+0x1869f);});_0x1d0149(_0x2b5e69);});}}catch(_0xdebf34){_0x23c287(_0xdebf34);}});}function getPlugins(_0x440491){var _0x504f70=[];return new BPromise(function(_0x4ba795,_0x255b40){try{if(_0x440491[_0x080b('0x58')]){return db[_0x080b('0x69')][_0x080b('0x45')]({'raw':!![]})[_0x080b('0x29')](function(_0x1be58e){_0x1be58e[_0x080b('0x6a')](function(_0x466b01){_0x504f70['push'](_0x466b01['id']+0x15b38);});_0x4ba795(_0x504f70);});}else{return db[_0x080b('0x59')][_0x080b('0x45')]({'where':{'sectionId':_0x440491['id']},'raw':!![]})['then'](function(_0x203046){_0x203046[_0x080b('0x6a')](function(_0x12a547){_0x504f70[_0x080b('0x5f')](_0x12a547['resourceId']+0x15b38);});_0x4ba795(_0x504f70);});}}catch(_0x1fb507){_0x255b40(_0x1fb507);}});}exports['addResources']=function(_0x1c3b6f,_0xb892dd){return db[_0x080b('0x2f')][_0x080b('0x49')]({'where':{'id':_0x1c3b6f[_0x080b('0x48')]['id']}})[_0x080b('0x29')](handleEntityNotFound(_0xb892dd,null))[_0x080b('0x29')](function(_0x52c3ce){if(_0x52c3ce){return db['sequelize'][_0x080b('0x55')](function(_0x57d7df){return db[_0x080b('0x56')][_0x080b('0x45')]({'where':{'userProfileId':_0x1c3b6f[_0x080b('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0x080b('0x29')](function(_0x1f383f){if(_0x1f383f){return db[_0x080b('0x56')]['destroy']({'where':{'userProfileId':_0x1c3b6f[_0x080b('0x48')]['id'],'id':_[_0x080b('0x2e')](_0x1f383f,function(_0x388e32){return _0x388e32['id'];})},'transaction':_0x57d7df});}})[_0x080b('0x29')](function(_0x184c03){var _0x40afc0=_[_0x080b('0x2e')](_0x1c3b6f[_0x080b('0x4b')],function(_0x2dabdb){_0x2dabdb[_0x080b('0x5e')]=_0x1c3b6f[_0x080b('0x48')]['id'];return _0x2dabdb;});return db[_0x080b('0x56')]['bulkCreate'](_0x40afc0,{'raw':!![],'transaction':_0x57d7df});})[_0x080b('0x29')](function(_0x57a016){var _0x15bfb4=_[_0x080b('0x40')](_['map'](_0x57a016,function(_0x4e9f27){return _0x4e9f27[_0x080b('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x15bfb4){return db[_0x080b('0x56')]['findAll']({'where':{'userProfileId':_0x1c3b6f[_0x080b('0x48')]['id'],'sectionId':_[_0x080b('0x2e')](_0x15bfb4,function(_0x2a0cdd){return _0x2a0cdd[_0x080b('0x5d')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x080b('0x29')](function(_0x394587){var _0x1f5f22=_[_0x080b('0x2e')](_0x1c3b6f[_0x080b('0x4b')],function(_0x561ba3){_0x561ba3[_0x080b('0x5e')]=_0x1c3b6f[_0x080b('0x48')]['id'];return _0x561ba3;});return db[_0x080b('0x59')][_0x080b('0x6b')](_0x1f5f22,{'raw':!![],'transaction':_0x57d7df});});}})[_0x080b('0x46')](handleError(_0xb892dd,null));});}})[_0x080b('0x29')](function(_0x425b7b){var _0x1b990f=_[_0x080b('0x2e')](_0x425b7b,function(_0x33395d){return _0x33395d[_0x080b('0x4f')]({'plain':!![]});});})['then'](respondWithResult(_0xb892dd,null))[_0x080b('0x46')](handleError(_0xb892dd,null));};exports[_0x080b('0x6c')]=function(_0x169e7f,_0x32890e,_0x3f36a7){return db[_0x080b('0x2f')]['find']({'where':{'id':_0x169e7f[_0x080b('0x48')]['id']}})[_0x080b('0x29')](handleEntityNotFound(_0x32890e,null))['then'](function(_0x484be6){if(_0x484be6){return _0x484be6[_0x080b('0x6c')](_0x169e7f[_0x080b('0x35')][_0x080b('0x61')]);}})[_0x080b('0x29')](respondWithStatusCode(_0x32890e,null))['catch'](handleError(_0x32890e,null));};exports['getResources']=function(_0x1ecf52,_0x11b48a){var _0x545f5={};if(!_0x1ecf52[_0x080b('0x35')][_0x080b('0x6d')])throw new Error('Missing\x20section\x20parameter');if(!_0x1ecf52[_0x080b('0x35')][_0x080b('0x3b')](_0x080b('0x3c'))){_0x545f5[_0x080b('0x24')]=qs[_0x080b('0x24')](_0x1ecf52[_0x080b('0x35')]['limit']);_0x545f5[_0x080b('0x22')]=qs[_0x080b('0x22')](_0x1ecf52[_0x080b('0x35')][_0x080b('0x22')]);}return db['UserProfile']['find']({'where':{'id':_0x1ecf52['params']['id']}})[_0x080b('0x29')](function(_0x4aa9f5){if(!_0x4aa9f5)throw new Error(_0x080b('0x6e')+_0x1ecf52['params']['id']);return db['UserProfile'][_0x080b('0x6f')](_0x1ecf52);})[_0x080b('0x29')](respondWithFilteredResult(_0x11b48a,_0x545f5))[_0x080b('0x46')](handleError(_0x11b48a,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index decfbe8..25d588a 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 _0x3e0c=['exports','events','../../mysqldb','UserProfile','save','update','remove'];(function(_0x351814,_0x1434ce){var _0x1ab949=function(_0x53447f){while(--_0x53447f){_0x351814['push'](_0x351814['shift']());}};_0x1ab949(++_0x1434ce);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x100459,_0x4d4893){_0x100459=_0x100459-0x0;var _0x2c9d9e=_0x3e0c[_0x100459];return _0x2c9d9e;};'use strict';var EventEmitter=require(_0xc3e0('0x0'));var UserProfile=require(_0xc3e0('0x1'))['db'][_0xc3e0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e0('0x3'),'afterUpdate':_0xc3e0('0x4'),'afterDestroy':_0xc3e0('0x5')};function emitEvent(_0x2ba135){return function(_0xba1d4c,_0x49e5b7,_0x88cddb){UserProfileEvents['emit'](_0x2ba135+':'+_0xba1d4c['id'],_0xba1d4c);UserProfileEvents['emit'](_0x2ba135,_0xba1d4c);_0x88cddb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xc3e0('0x6')]=UserProfileEvents; \ No newline at end of file +var _0xb7f0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x1fa3e2,_0x58020c){var _0x1261fc=function(_0x439e3b){while(--_0x439e3b){_0x1fa3e2['push'](_0x1fa3e2['shift']());}};_0x1261fc(++_0x58020c);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x4635e5,_0x5590a9){_0x4635e5=_0x4635e5-0x0;var _0x5a187b=_0xb7f0[_0x4635e5];return _0x5a187b;};'use strict';var EventEmitter=require(_0x0b7f('0x0'));var UserProfile=require(_0x0b7f('0x1'))['db'][_0x0b7f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0b7f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0b7f('0x4')};function emitEvent(_0xa1285e){return function(_0x228377,_0x188ea8,_0x34e188){UserProfileEvents[_0x0b7f('0x5')](_0xa1285e+':'+_0x228377['id'],_0x228377);UserProfileEvents[_0x0b7f('0x5')](_0xa1285e,_0x228377);_0x34e188(null);};}for(var e in events){if(events[_0x0b7f('0x6')](e)){var event=events[e];UserProfile[_0x0b7f('0x7')](e,emitEvent(event));}}module[_0x0b7f('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 7843725..52bf921 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 _0xa518=['squel','exports','filter','value','then','catch','field','model','findAll','map','name','UserProfileResource','associatedResources','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','squarerecordings','SquareRecording','parentSections','projectName','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','whatsappqueues','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','dispositions','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Variable','Plugin','extractedreports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','params','all','ignore','union','find','push','autoAssociation','rawAttributes','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filters','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','default','DefaultReports','count','rows','ids','order','customSorting','Tag','Tags','tag','ThroughTags','color','Agents','chat','dataValues','fax','mail','openchannel','./userProfile.attributes'];(function(_0x5b9168,_0x203c8a){var _0x1c8403=function(_0x59b381){while(--_0x59b381){_0x5b9168['push'](_0x5b9168['shift']());}};_0x1c8403(++_0x203c8a);}(_0xa518,0x16d));var _0x8a51=function(_0xf61586,_0x56b0c4){_0xf61586=_0xf61586-0x0;var _0x2b6eb3=_0xa518[_0xf61586];return _0x2b6eb3;};'use strict';var _=require('lodash');var attributes=require(_0x8a51('0x0'));var squel=require(_0x8a51('0x1'));module[_0x8a51('0x2')]=function(_0x3cba47){var _0x38596d=_0x3cba47['models'];function _0x4e9c3f(_0x3c202b,_0x4906c2){return new Promise(function(_0x5b4d97,_0x4d5eaa){if(!_0x4906c2)return _0x5b4d97(null);var _0x3360fc=_0x4906c2[_0x8a51('0x3')]?{[_0x4906c2['filter']['field']]:_0x4906c2[_0x8a51('0x3')][_0x8a51('0x4')]}:undefined;return _0x38596d[_0x3c202b]['findAll']({'where':_0x3360fc,'raw':!![]})[_0x8a51('0x5')](function(_0x2e55fd){_0x4906c2['associatedResources']=_['map'](_0x2e55fd,'id');_0x5b4d97(_0x4906c2);})[_0x8a51('0x6')](function(_0x579252){_0x4d5eaa(_0x579252);});});}function _0x4a3ed3(_0x1526c8,_0x8c0b5b){return new Promise(function(_0x553f54,_0xd0c9b6){var _0x3c096c=_0x1526c8[_0x8a51('0x3')]?{[_0x1526c8[_0x8a51('0x3')][_0x8a51('0x7')]]:_0x1526c8[_0x8a51('0x3')]['value']}:undefined;return _0x38596d[_0x1526c8[_0x8a51('0x8')]][_0x8a51('0x9')]({'where':_0x3c096c,'raw':!![]})[_0x8a51('0x5')](function(_0x1a44bc){_0x8c0b5b['associatedResources']=_[_0x8a51('0xa')](_0x1a44bc,function(_0x389d4d){return _0x389d4d[_0x8a51('0xb')];});_0x553f54(_0x8c0b5b);})[_0x8a51('0x6')](function(_0x445ce7){_0xd0c9b6(_0x445ce7);});});}function _0x227138(_0x2901cc,_0x4e7110,_0x14591c){if(!_0x4e7110)return Promise['resolve'](null);return new Promise(function(_0x4b1d15,_0x39bd26){return _0x38596d[_0x8a51('0xc')]['findAll']({'where':{'sectionId':_0x4e7110['id']},'raw':!![]})[_0x8a51('0x5')](function(_0x454dc9){if(_0x2901cc[_0x8a51('0x7')]&&_0x2901cc[_0x8a51('0x7')]!=='id'){_0x4e7110[_0x8a51('0xd')]=_[_0x8a51('0xa')](_0x454dc9,function(_0x1fc156){return _0x1fc156[_0x2901cc[_0x8a51('0x7')]];});}else{if(_0x14591c===_0x8a51('0xe')){_0x4e7110['associatedResources']=_[_0x8a51('0xa')](_0x454dc9,function(_0x2fc528){return{'id':_0x2fc528[_0x8a51('0xf')],'type':_0x2fc528['type']};});}else{_0x4e7110[_0x8a51('0xd')]=_['map'](_0x454dc9,function(_0x380e6a){return _0x380e6a[_0x8a51('0xf')];});}}_0x4b1d15(_0x4e7110);})['catch'](function(_0x40bbc9){_0x39bd26(_0x40bbc9);});});}function _0x1d9cdc(_0x2f8d3e,_0x367d64){var _0x3680b2={'parentSections':[]};switch(_0x2f8d3e[_0x8a51('0x10')]()){case _0x8a51('0x11'):_0x3680b2['childModel']=_0x8a51('0x12');break;case _0x8a51('0x13'):_0x3680b2[_0x8a51('0x14')]='SquareOdbc';break;case _0x8a51('0x15'):_0x3680b2['childModel']=_0x8a51('0x16');_0x3680b2[_0x8a51('0x17')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x8a51('0x18')}];break;case _0x8a51('0x19'):_0x3680b2[_0x8a51('0x14')]='JscriptyProject';break;case _0x8a51('0x1a'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x1b');_0x3680b2[_0x8a51('0x17')]=[{'name':_0x8a51('0x1c'),'field':'id','foreignKey':_0x8a51('0x1d')}];break;case _0x8a51('0x1e'):_0x3680b2['childModel']=_0x8a51('0x1f');break;case _0x8a51('0x20'):_0x3680b2[_0x8a51('0x14')]='CmCompany';break;case _0x8a51('0x21'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x22');break;case _0x8a51('0x23'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x24');break;case'chatwebsites':_0x3680b2[_0x8a51('0x14')]='ChatWebsite';break;case'faxqueues':_0x3680b2[_0x8a51('0x14')]='FaxQueue';break;case'faxaccounts':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x25');break;case _0x8a51('0x26'):case _0x8a51('0x27'):case'outboundroutes':_0x3680b2['childModel']=_0x8a51('0x28');break;case _0x8a51('0x29'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x2a');break;case _0x8a51('0x2b'):_0x3680b2['childModel']=_0x8a51('0x2c');break;case _0x8a51('0x2d'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x2e');_0x3680b2[_0x8a51('0x17')]=[{'name':'Agents','field':_0x8a51('0xb'),'foreignKey':'membername','model':_0x8a51('0x2f'),'filter':{'field':_0x8a51('0x30'),'value':[_0x8a51('0x31')]}},{'name':_0x8a51('0x32'),'field':_0x8a51('0xb'),'foreignKey':'membername','model':_0x8a51('0x2f'),'filter':{'field':_0x8a51('0x30'),'value':[_0x8a51('0x33')]}},{'name':_0x8a51('0x34'),'field':_0x8a51('0xb'),'foreignKey':_0x8a51('0x35'),'model':_0x8a51('0x36'),'filter':{'field':_0x8a51('0x37'),'value':[_0x8a51('0x38')]}},{'name':_0x8a51('0x39'),'field':_0x8a51('0xb'),'foreignKey':'queue','model':_0x8a51('0x36'),'filter':{'field':_0x8a51('0x37'),'value':['outbound']}}];break;case _0x8a51('0x3a'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x3b');break;case _0x8a51('0x3c'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x3d');break;case _0x8a51('0x3e'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x3f');break;case _0x8a51('0x40'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x41');break;case _0x8a51('0x42'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x43');break;case _0x8a51('0x44'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x45');break;case _0x8a51('0x46'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x47');break;case'openchannelqueues':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x48');break;case'openchannelaccounts':_0x3680b2[_0x8a51('0x14')]='OpenchannelAccount';break;case _0x8a51('0x49'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x4a');break;case _0x8a51('0x4b'):_0x3680b2[_0x8a51('0x14')]='SmsAccount';break;case _0x8a51('0x4c'):_0x3680b2[_0x8a51('0x14')]='WhatsappQueue';break;case'whatsappaccounts':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x4d');break;case _0x8a51('0x4e'):_0x3680b2[_0x8a51('0x14')]='Team';break;case _0x8a51('0x4f'):case _0x8a51('0x50'):_0x3680b2[_0x8a51('0x14')]='VoiceQueue';if(_0x367d64){_0x3680b2[_0x8a51('0x17')]=[{'name':_0x8a51('0x34')},{'name':_0x8a51('0x39')}];}break;case _0x8a51('0x51'):case _0x8a51('0x52'):case'telephones':_0x3680b2[_0x8a51('0x14')]='User';if(_0x367d64){_0x3680b2['parentSections']=[{'name':'Users','filter':{'field':_0x8a51('0x30'),'value':['admin',_0x8a51('0x53')]},'ignore':!![]},{'name':'Agents'},{'name':_0x8a51('0x32')}];}break;case'zendeskaccounts':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x54');break;case'salesforceaccounts':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x55');break;case _0x8a51('0x56'):_0x3680b2['childModel']=_0x8a51('0x57');break;case _0x8a51('0x58'):_0x3680b2[_0x8a51('0x14')]='SugarcrmAccount';break;case _0x8a51('0x59'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x5a');break;case _0x8a51('0x5b'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x5c');break;case'vtigeraccounts':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x2f');break;case _0x8a51('0x5d'):_0x3680b2['childModel']='CannedAnswer';break;case _0x8a51('0x5e'):_0x3680b2[_0x8a51('0x14')]='Disposition';break;case _0x8a51('0x5f'):_0x3680b2['childModel']=_0x8a51('0x60');break;case'intervals':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x61');break;case _0x8a51('0x62'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x63');break;case _0x8a51('0x64'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x65');break;case _0x8a51('0x66'):_0x3680b2['childModel']=_0x8a51('0x67');break;case _0x8a51('0x68'):_0x3680b2[_0x8a51('0x14')]='Tag';break;case _0x8a51('0x69'):_0x3680b2[_0x8a51('0x14')]='Template';break;case'triggers':_0x3680b2['childModel']='Trigger';break;case'trunks':_0x3680b2[_0x8a51('0x14')]='Trunk';break;case'variables':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x6a');break;case'plugins':_0x3680b2['childModel']=_0x8a51('0x6b');break;case _0x8a51('0x6c'):_0x3680b2[_0x8a51('0x14')]=_0x8a51('0xe');_0x3680b2[_0x8a51('0x17')]=[{'name':'Reports','field':'id','foreignKey':_0x8a51('0x6d')}];break;case'metrics':_0x3680b2[_0x8a51('0x14')]=_0x8a51('0x6e');break;}return _0x3680b2;}function _0x446bdc(_0x36eb83,_0x1a8937){var _0x9484ab=_0x36eb83[_0x8a51('0x6f')](0x0)[_0x8a51('0x70')]()+_0x36eb83[_0x8a51('0x71')](0x1);var _0x5336ce={'type':_0x38596d[_0x8a51('0x72')][_0x8a51('0x73')][_0x8a51('0x74')],'raw':!![]};return new Promise(function(_0x55f268,_0xa1d168){var _0x18932f=squel[_0x8a51('0x75')]()[_0x8a51('0x7')](_0x8a51('0x76')+_0x9484ab+_0x8a51('0x77'),'id')[_0x8a51('0x7')](_0x8a51('0x78'))[_0x8a51('0x79')]('user_has_'+_0x36eb83+'_interactions','ui')['where'](_0x8a51('0x7a'),_0x1a8937['id']);return _0x38596d[_0x8a51('0x7b')][_0x8a51('0x7c')](_0x18932f[_0x8a51('0x7d')](),_0x5336ce)[_0x8a51('0x5')](function(_0x386f8b){_0x1a8937[_0x9484ab+_0x8a51('0x7e')]=_0x386f8b;_0x55f268(_0x386f8b);})[_0x8a51('0x6')](function(_0x36b058){_0xa1d168(_0x36b058);});});}return _0x3cba47[_0x8a51('0x7f')](_0x8a51('0x80'),attributes,{'tableName':_0x8a51('0x81'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3a8d32){var _0x48c63c=require('../../components/parsers/qs');var _0x178c42={'raw':_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0x82')],'where':{}};var _0x134afd={};var _0x3850c4={'count':0x0,'rows':[]};var _0x129740=_0x3a8d32['query'][_0x8a51('0x83')];var _0xc3753d=_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0x84')]||![];var _0x1bb071=_0x1d9cdc(_0x129740,_0xc3753d);if(!_0x1bb071[_0x8a51('0x14')])throw new Error(_0x8a51('0x85')+_0x129740+'\x27');var _0x22122a=[{'name':_0x129740}];if(!_[_0x8a51('0x86')](_0x1bb071[_0x8a51('0x17')]))_0x22122a=_0x1bb071['parentSections'];var _0x47556e=[];for(var _0x2e26cc=0x0;_0x2e26cc<_0x22122a[_0x8a51('0x87')];_0x2e26cc++){_0x47556e['push'](_0x38596d[_0x8a51('0x88')]['find']({'where':{'userProfileId':_0x3a8d32[_0x8a51('0x89')]['id'],'name':_0x22122a[_0x2e26cc][_0x8a51('0xb')]},'raw':!![]}));}return Promise[_0x8a51('0x8a')](_0x47556e)[_0x8a51('0x5')](function(_0x16e906){var _0x28f944=_[_0x8a51('0x3')](_0x16e906,function(_0x96d458){return _0x96d458?_0x96d458:undefined;});var _0x104d1d=_[_0x8a51('0x3')](_0x22122a,[_0x8a51('0x8b'),!![]]);var _0x41ea0c=_[_0x8a51('0x86')](_0x28f944)&&_[_0x8a51('0x86')](_0x104d1d)?null:_[_0x8a51('0x8c')](_0x104d1d,_0x28f944);if(!_0x41ea0c)return null;var _0x426c71=[];for(var _0x3dfb3c=0x0;_0x3dfb3c<_0x41ea0c[_0x8a51('0x87')];_0x3dfb3c++){var _0x36944c=_[_0x8a51('0x8d')](_0x22122a,function(_0x1b1e53){return _0x41ea0c[_0x3dfb3c]?_0x1b1e53[_0x8a51('0xb')]===_0x41ea0c[_0x3dfb3c][_0x8a51('0xb')]:null;});if(_0x36944c){if(_0x41ea0c[_0x3dfb3c]['ignore']){_0x426c71[_0x8a51('0x8e')](_0x4e9c3f(_0x1bb071[_0x8a51('0x14')],_0x41ea0c[_0x3dfb3c]));}else{if(!_0x41ea0c[_0x3dfb3c][_0x8a51('0x8f')]){_0x426c71[_0x8a51('0x8e')](_0x227138(_0x36944c,_0x41ea0c[_0x3dfb3c],_0x1bb071[_0x8a51('0x14')]));}else{if(_0x36944c[_0x8a51('0x8')]){_0x426c71[_0x8a51('0x8e')](_0x4a3ed3(_0x36944c,_0x41ea0c[_0x3dfb3c]));}}}}}return Promise[_0x8a51('0x8a')](_0x426c71);})[_0x8a51('0x5')](function(_0x612ea8){var _0x233cfe=_0x612ea8;var _0x48fb0e=null;if(_0x233cfe){_0x48fb0e=_0x233cfe['length']===0x1?_0x233cfe[0x0]:null;}if(!_0x48fb0e&&!_0x233cfe)return _0x3850c4;var _0x3439fe=_0x38596d[_0x1bb071[_0x8a51('0x14')]][_0x8a51('0x90')];_0x134afd[_0x8a51('0x8')]=_[_0x8a51('0x91')](_0x3439fe);_0x134afd[_0x8a51('0x7c')]=_[_0x8a51('0x91')](_0x3a8d32[_0x8a51('0x7c')]);_0x134afd['filters']=_[_0x8a51('0x92')](_0x134afd[_0x8a51('0x8')],_0x134afd[_0x8a51('0x7c')]);_0x178c42['attributes']=_[_0x8a51('0x92')](_0x134afd[_0x8a51('0x8')],_0x48c63c[_0x8a51('0x93')](_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0x93')]));_0x178c42['attributes']=_0x178c42['attributes']['length']?_0x178c42[_0x8a51('0x94')]:_0x134afd[_0x8a51('0x8')];if(!_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0x95')](_0x8a51('0x96'))){_0x178c42[_0x8a51('0x97')]=_0x48c63c['limit'](_0x3a8d32[_0x8a51('0x7c')]['limit']);_0x178c42[_0x8a51('0x98')]=_0x48c63c[_0x8a51('0x98')](_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0x98')]);}_0x178c42['order']=_0x48c63c['sort'](_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0x99')]);_0x178c42[_0x8a51('0x9a')]=_0x48c63c['filters'](_[_0x8a51('0x9b')](_0x3a8d32[_0x8a51('0x7c')],_0x134afd[_0x8a51('0x9c')]));if(_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0x3')]){_0x178c42[_0x8a51('0x9a')]=_[_0x8a51('0x9d')](_0x178c42['where'],{'$or':_[_0x8a51('0xa')](_0x3439fe,function(_0x3e8fd3){if(_0x3e8fd3[_0x8a51('0x37')][_0x8a51('0x9e')]!==_0x8a51('0x9f')){var _0x322377={};_0x322377[_0x3e8fd3[_0x8a51('0x7')]]={'$like':'%'+_0x3a8d32['query'][_0x8a51('0x3')]+'%'};return _0x322377;}})});}var _0x284891=[];var _0xd60a22=null;var _0x4b254b={};if(_0x48fb0e){_0xd60a22=_[_0x8a51('0x8d')](_0x22122a,[_0x8a51('0xb'),_0x48fb0e[_0x8a51('0xb')]]);if(_0xd60a22['field']){_0x4b254b={};if(_0x1bb071[_0x8a51('0x14')]===_0x8a51('0xe')){_0x4b254b[_0xd60a22[_0x8a51('0xa0')]]=_[_0x8a51('0xa')](_0x48fb0e[_0x8a51('0xd')],'id');}else{_0x4b254b[_0xd60a22[_0x8a51('0xa0')]]=_0x48fb0e['associatedResources'];}_0x284891['push'](_0x4b254b);}else{_0x178c42[_0x8a51('0x9a')]['id']=_0x48fb0e['associatedResources'];}}else{for(var _0x474674=0x0;_0x474674<_0x233cfe[_0x8a51('0x87')];_0x474674++){_0xd60a22=_['find'](_0x22122a,['name',_0x233cfe[_0x474674][_0x8a51('0xb')]]);if(_0xd60a22[_0x8a51('0x7')]){_0x4b254b={};_0x4b254b[_0xd60a22[_0x8a51('0xa0')]]=_0x233cfe[_0x474674][_0x8a51('0xd')];_0x284891[_0x8a51('0x8e')](_0x4b254b);}else{if(!_0x178c42[_0x8a51('0x9a')]['id'])_0x178c42[_0x8a51('0x9a')]['id']=[];_0x233cfe[_0x474674][_0x8a51('0xd')][_0x8a51('0xa1')](function(_0x3dde40){_0x178c42[_0x8a51('0x9a')]['id'][_0x8a51('0x8e')](_0x3dde40);});}}}if(!_[_0x8a51('0x86')](_0x284891)){_0x178c42[_0x8a51('0x9a')]=_['merge'](_0x178c42[_0x8a51('0x9a')],{'$and':{'$or':_0x284891}});}_0x178c42=_['merge']({},_0x178c42,_0x3a8d32[_0x8a51('0xa2')]);if(_0x48fb0e&&!_0x48fb0e[_0x8a51('0x8f')]&&_0x1bb071['childModel']===_0x8a51('0xe')){if(_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0xa3')]){_0x178c42[_0x8a51('0xa4')]=[{'all':!![]}];}return _0x38596d[_0x1bb071['childModel']]['findAll'](_0x178c42)['then'](function(_0x337519){var _0x3ca53c=[];_0x337519[_0x8a51('0xa1')](function(_0x273b3b){var _0x23940d;switch(_0x273b3b['reportType']){case _0x8a51('0xa5'):_0x23940d=_[_0x8a51('0x8d')](_0x48fb0e['associatedResources'],function(_0x4d4afc){return _0x4d4afc['id']===_0x273b3b['reportId']&&_0x4d4afc[_0x8a51('0x37')]===_0x8a51('0xa6');});break;case'custom':_0x23940d=_[_0x8a51('0x8d')](_0x48fb0e[_0x8a51('0xd')],function(_0x418563){return _0x418563['id']===_0x273b3b[_0x8a51('0x6d')]&&_0x418563[_0x8a51('0x37')]==='CustomReports';});break;}if(_0x23940d)_0x3ca53c[_0x8a51('0x8e')](_0x273b3b);});_0x3850c4[_0x8a51('0xa7')]=_0x3ca53c[_0x8a51('0x87')];_0x3850c4[_0x8a51('0xa8')]=_0x3ca53c;return _0x3850c4;});}else{if(!_['isEmpty'](_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0xa9')])){_0x178c42[_0x8a51('0x9a')]['id']=_0x178c42[_0x8a51('0x9a')]['id']?_[_0x8a51('0x92')](_0x178c42[_0x8a51('0x9a')]['id'],_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0xa9')]):_0x3a8d32['query'][_0x8a51('0xa9')];if(_0x3a8d32[_0x8a51('0x7c')]['customSorting']){_0x178c42[_0x8a51('0xaa')]=_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0xab')];}}if(_0x3a8d32[_0x8a51('0x7c')]['extraQueryConditions']){_0x178c42['where']=_[_0x8a51('0x9d')](_0x178c42['where'],{'$and':_0x3a8d32[_0x8a51('0x7c')]['extraQueryConditions']});}return _0x38596d[_0x1bb071[_0x8a51('0x14')]]['count']({'where':_0x178c42[_0x8a51('0x9a')]})['then'](function(_0x414770){_0x3850c4[_0x8a51('0xa7')]=_0x414770;if(_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0xa3')]){if(_0x1bb071[_0x8a51('0x14')]==='CmContact'){_0x178c42[_0x8a51('0xa4')]=[{'model':_0x38596d[_0x8a51('0xac')],'as':_0x8a51('0xad'),'attributes':['id',_0x8a51('0xb'),'color'],'required':_0x3a8d32[_0x8a51('0x7c')][_0x8a51('0xae')]?!![]:![]},{'model':_0x38596d['Tag'],'as':_0x8a51('0xaf'),'attributes':['id',_0x8a51('0xb'),_0x8a51('0xb0')],'through':_0x3a8d32['query']['tag']?{'attributes':[],'where':{'TagId':_0x3a8d32[_0x8a51('0x7c')]['tag']||undefined}}:{},'required':_0x3a8d32['query'][_0x8a51('0xae')]?!![]:![]}];}else{_0x178c42['include']=[{'all':!![]}];}}return _0x38596d[_0x1bb071[_0x8a51('0x14')]][_0x8a51('0x9')](_0x178c42);})[_0x8a51('0x5')](function(_0x5117d1){_0x3850c4[_0x8a51('0xa8')]=_0x5117d1;if(_0x129740===_0x8a51('0xb1')&&_0x3a8d32[_0x8a51('0x7c')]['openTabs']==='true'){var _0x5dc15c=[];for(var _0x19176b=0x0;_0x19176b<_0x3850c4[_0x8a51('0xa8')][_0x8a51('0x87')];_0x19176b++){_0x5dc15c['push'](_0x446bdc(_0x8a51('0xb2'),_0x3850c4[_0x8a51('0xa8')][_0x19176b][_0x8a51('0xb3')]));_0x5dc15c[_0x8a51('0x8e')](_0x446bdc('sms',_0x3850c4[_0x8a51('0xa8')][_0x19176b]['dataValues']));_0x5dc15c[_0x8a51('0x8e')](_0x446bdc(_0x8a51('0xb4'),_0x3850c4[_0x8a51('0xa8')][_0x19176b][_0x8a51('0xb3')]));_0x5dc15c['push'](_0x446bdc(_0x8a51('0xb5'),_0x3850c4[_0x8a51('0xa8')][_0x19176b][_0x8a51('0xb3')]));_0x5dc15c['push'](_0x446bdc(_0x8a51('0xb6'),_0x3850c4[_0x8a51('0xa8')][_0x19176b]['dataValues']));_0x5dc15c[_0x8a51('0x8e')](_0x446bdc('whatsapp',_0x3850c4['rows'][_0x19176b][_0x8a51('0xb3')]));}return Promise[_0x8a51('0x8a')](_0x5dc15c)[_0x8a51('0x5')](function(){return _0x3850c4;});}return _0x3850c4;});}});}}});}; \ No newline at end of file +var _0xba46=['mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','then','associatedResources','map','catch','model','findAll','resolve','UserProfileResource','AnalyticExtractedReport','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','JscriptyProject','contacts','parentSections','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','name','User','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','MailQueue','mailaccounts','mailsubstatuses','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','variables','Variable','extractedreports','Reports','reportId','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','query','raw','section','Invalid\x20section\x20\x27','isEmpty','length','push','find','ignore','union','autoAssociation','all','keys','filters','intersection','fields','attributes','nolimit','limit','offset','order','sort','merge','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','CmContact','Tags','color','tag','Tag','ThroughTags','true','chat','dataValues','sms','fax'];(function(_0x1f17e6,_0xe766b6){var _0x491087=function(_0x11436e){while(--_0x11436e){_0x1f17e6['push'](_0x1f17e6['shift']());}};_0x491087(++_0xe766b6);}(_0xba46,0xc4));var _0x6ba4=function(_0x35df86,_0xb254ce){_0x35df86=_0x35df86-0x0;var _0x25d40e=_0xba46[_0x35df86];return _0x25d40e;};'use strict';var _=require(_0x6ba4('0x0'));var attributes=require(_0x6ba4('0x1'));var squel=require(_0x6ba4('0x2'));module[_0x6ba4('0x3')]=function(_0x5bae3f){var _0x4eb155=_0x5bae3f[_0x6ba4('0x4')];function _0x379d75(_0x40aaa8,_0x4922eb){return new Promise(function(_0x1f33b4,_0x30cb7b){if(!_0x4922eb)return _0x1f33b4(null);var _0x39e76a=_0x4922eb[_0x6ba4('0x5')]?{[_0x4922eb[_0x6ba4('0x5')][_0x6ba4('0x6')]]:_0x4922eb['filter'][_0x6ba4('0x7')]}:undefined;return _0x4eb155[_0x40aaa8]['findAll']({'where':_0x39e76a,'raw':!![]})[_0x6ba4('0x8')](function(_0x327fa4){_0x4922eb[_0x6ba4('0x9')]=_[_0x6ba4('0xa')](_0x327fa4,'id');_0x1f33b4(_0x4922eb);})[_0x6ba4('0xb')](function(_0xa3487b){_0x30cb7b(_0xa3487b);});});}function _0x41aaef(_0xa543bd,_0x4f6e86){return new Promise(function(_0x391e4a,_0x35f517){var _0x1d51d3=_0xa543bd[_0x6ba4('0x5')]?{[_0xa543bd['filter'][_0x6ba4('0x6')]]:_0xa543bd[_0x6ba4('0x5')][_0x6ba4('0x7')]}:undefined;return _0x4eb155[_0xa543bd[_0x6ba4('0xc')]][_0x6ba4('0xd')]({'where':_0x1d51d3,'raw':!![]})[_0x6ba4('0x8')](function(_0x5c70d2){_0x4f6e86[_0x6ba4('0x9')]=_[_0x6ba4('0xa')](_0x5c70d2,function(_0x255c86){return _0x255c86['name'];});_0x391e4a(_0x4f6e86);})[_0x6ba4('0xb')](function(_0x5c8a4f){_0x35f517(_0x5c8a4f);});});}function _0x171c5a(_0x5b5bb2,_0x4b08df,_0x590bb9){if(!_0x4b08df)return Promise[_0x6ba4('0xe')](null);return new Promise(function(_0x18adc6,_0x41fc0a){return _0x4eb155[_0x6ba4('0xf')]['findAll']({'where':{'sectionId':_0x4b08df['id']},'raw':!![]})[_0x6ba4('0x8')](function(_0x1f2138){if(_0x5b5bb2['field']&&_0x5b5bb2[_0x6ba4('0x6')]!=='id'){_0x4b08df['associatedResources']=_[_0x6ba4('0xa')](_0x1f2138,function(_0x393174){return _0x393174[_0x5b5bb2[_0x6ba4('0x6')]];});}else{if(_0x590bb9===_0x6ba4('0x10')){_0x4b08df[_0x6ba4('0x9')]=_[_0x6ba4('0xa')](_0x1f2138,function(_0x343fbd){return{'id':_0x343fbd['resourceId'],'type':_0x343fbd[_0x6ba4('0x11')]};});}else{_0x4b08df['associatedResources']=_['map'](_0x1f2138,function(_0x503897){return _0x503897['resourceId'];});}}_0x18adc6(_0x4b08df);})[_0x6ba4('0xb')](function(_0xfceac3){_0x41fc0a(_0xfceac3);});});}function _0xd805de(_0x5b0a85,_0x1021da){var _0x14ce7c={'parentSections':[]};switch(_0x5b0a85[_0x6ba4('0x12')]()){case _0x6ba4('0x13'):_0x14ce7c['childModel']=_0x6ba4('0x14');break;case _0x6ba4('0x15'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x17');break;case _0x6ba4('0x18'):_0x14ce7c['childModel']=_0x6ba4('0x19');_0x14ce7c['parentSections']=[{'name':_0x6ba4('0x1a'),'field':'name','foreignKey':'projectName'}];break;case'projects':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x1b');break;case _0x6ba4('0x1c'):_0x14ce7c[_0x6ba4('0x16')]='CmContact';_0x14ce7c[_0x6ba4('0x1d')]=[{'name':'Lists','field':'id','foreignKey':_0x6ba4('0x1e')}];break;case _0x6ba4('0x1f'):_0x14ce7c['childModel']='CmList';break;case'companies':_0x14ce7c['childModel']=_0x6ba4('0x20');break;case _0x6ba4('0x21'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x22');break;case _0x6ba4('0x23'):_0x14ce7c[_0x6ba4('0x16')]='ChatQueue';break;case'chatwebsites':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x24');break;case _0x6ba4('0x25'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x26');break;case _0x6ba4('0x27'):_0x14ce7c['childModel']='FaxAccount';break;case _0x6ba4('0x28'):case _0x6ba4('0x29'):case'outboundroutes':_0x14ce7c['childModel']=_0x6ba4('0x2a');break;case _0x6ba4('0x2b'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x2c');break;case _0x6ba4('0x2d'):_0x14ce7c['childModel']='VoiceMail';break;case _0x6ba4('0x2e'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x2f');_0x14ce7c[_0x6ba4('0x1d')]=[{'name':_0x6ba4('0x30'),'field':_0x6ba4('0x31'),'foreignKey':'membername','model':_0x6ba4('0x32'),'filter':{'field':_0x6ba4('0x33'),'value':[_0x6ba4('0x34')]}},{'name':_0x6ba4('0x35'),'field':_0x6ba4('0x31'),'foreignKey':_0x6ba4('0x36'),'model':_0x6ba4('0x32'),'filter':{'field':_0x6ba4('0x33'),'value':[_0x6ba4('0x37')]}},{'name':_0x6ba4('0x38'),'field':'name','foreignKey':'queue','model':_0x6ba4('0x39'),'filter':{'field':'type','value':[_0x6ba4('0x3a')]}},{'name':_0x6ba4('0x3b'),'field':_0x6ba4('0x31'),'foreignKey':_0x6ba4('0x3c'),'model':_0x6ba4('0x39'),'filter':{'field':_0x6ba4('0x11'),'value':['outbound']}}];break;case _0x6ba4('0x3d'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x3e');break;case _0x6ba4('0x3f'):_0x14ce7c['childModel']=_0x6ba4('0x40');break;case'voiceprefixes':_0x14ce7c['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x14ce7c[_0x6ba4('0x16')]='Campaign';break;case'mailqueues':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x41');break;case _0x6ba4('0x42'):_0x14ce7c[_0x6ba4('0x16')]='MailAccount';break;case _0x6ba4('0x43'):_0x14ce7c[_0x6ba4('0x16')]='MailSubstatus';break;case'openchannelqueues':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x44');break;case'openchannelaccounts':_0x14ce7c['childModel']=_0x6ba4('0x45');break;case _0x6ba4('0x46'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x47');break;case _0x6ba4('0x48'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x49');break;case'whatsappqueues':_0x14ce7c['childModel']=_0x6ba4('0x4a');break;case _0x6ba4('0x4b'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x4c');break;case _0x6ba4('0x4d'):_0x14ce7c['childModel']='Team';break;case _0x6ba4('0x4e'):case _0x6ba4('0x4f'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x39');if(_0x1021da){_0x14ce7c['parentSections']=[{'name':_0x6ba4('0x38')},{'name':'QueueCampaigns'}];}break;case _0x6ba4('0x50'):case _0x6ba4('0x51'):case _0x6ba4('0x52'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x32');if(_0x1021da){_0x14ce7c[_0x6ba4('0x1d')]=[{'name':_0x6ba4('0x53'),'filter':{'field':_0x6ba4('0x33'),'value':['admin',_0x6ba4('0x54')]},'ignore':!![]},{'name':_0x6ba4('0x30')},{'name':_0x6ba4('0x35')}];}break;case'zendeskaccounts':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x55');break;case _0x6ba4('0x56'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x57');break;case _0x6ba4('0x58'):_0x14ce7c['childModel']='FreshdeskAccount';break;case _0x6ba4('0x59'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x5a');break;case _0x6ba4('0x5b'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x5c');break;case'zohoaccounts':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x5d');break;case _0x6ba4('0x5e'):_0x14ce7c['childModel']=_0x6ba4('0x32');break;case _0x6ba4('0x5f'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x60');break;case _0x6ba4('0x61'):_0x14ce7c['childModel']=_0x6ba4('0x62');break;case'customdashboards':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x63');break;case _0x6ba4('0x64'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x65');break;case _0x6ba4('0x66'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x67');break;case _0x6ba4('0x68'):_0x14ce7c['childModel']=_0x6ba4('0x69');break;case _0x6ba4('0x6a'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x6b');break;case _0x6ba4('0x6c'):_0x14ce7c[_0x6ba4('0x16')]='Tag';break;case _0x6ba4('0x6d'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x6e');break;case _0x6ba4('0x6f'):_0x14ce7c['childModel']='Trigger';break;case _0x6ba4('0x70'):_0x14ce7c[_0x6ba4('0x16')]='Trunk';break;case _0x6ba4('0x71'):_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x72');break;case'plugins':_0x14ce7c[_0x6ba4('0x16')]='Plugin';break;case _0x6ba4('0x73'):_0x14ce7c['childModel']='AnalyticExtractedReport';_0x14ce7c[_0x6ba4('0x1d')]=[{'name':_0x6ba4('0x74'),'field':'id','foreignKey':_0x6ba4('0x75')}];break;case'metrics':_0x14ce7c[_0x6ba4('0x16')]=_0x6ba4('0x76');break;}return _0x14ce7c;}function _0x358c7c(_0x47fe71,_0x50cb79){var _0x398414=_0x47fe71[_0x6ba4('0x77')](0x0)[_0x6ba4('0x78')]()+_0x47fe71[_0x6ba4('0x79')](0x1);var _0x1e9bf3={'type':_0x4eb155[_0x6ba4('0x7a')][_0x6ba4('0x7b')][_0x6ba4('0x7c')],'raw':!![]};return new Promise(function(_0x25c2de,_0x22d478){var _0x19bde3=squel[_0x6ba4('0x7d')]()[_0x6ba4('0x6')](_0x6ba4('0x7e')+_0x398414+_0x6ba4('0x7f'),'id')[_0x6ba4('0x6')](_0x6ba4('0x80'))[_0x6ba4('0x81')](_0x6ba4('0x82')+_0x47fe71+_0x6ba4('0x83'),'ui')[_0x6ba4('0x84')](_0x6ba4('0x85'),_0x50cb79['id']);return _0x4eb155[_0x6ba4('0x86')]['query'](_0x19bde3[_0x6ba4('0x87')](),_0x1e9bf3)[_0x6ba4('0x8')](function(_0x836019){_0x50cb79[_0x398414+_0x6ba4('0x88')]=_0x836019;_0x25c2de(_0x836019);})[_0x6ba4('0xb')](function(_0x521286){_0x22d478(_0x521286);});});}return _0x5bae3f[_0x6ba4('0x89')](_0x6ba4('0x8a'),attributes,{'tableName':_0x6ba4('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x63b181){var _0x2ba4eb=require(_0x6ba4('0x8c'));var _0x35d77f={'raw':_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x8e')],'where':{}};var _0x136d71={};var _0x50b463={'count':0x0,'rows':[]};var _0x28b36b=_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x8f')];var _0x35d6ab=_0x63b181['query']['mergeResources']||![];var _0x5e1525=_0xd805de(_0x28b36b,_0x35d6ab);if(!_0x5e1525['childModel'])throw new Error(_0x6ba4('0x90')+_0x28b36b+'\x27');var _0xd0d799=[{'name':_0x28b36b}];if(!_[_0x6ba4('0x91')](_0x5e1525[_0x6ba4('0x1d')]))_0xd0d799=_0x5e1525[_0x6ba4('0x1d')];var _0x4b9226=[];for(var _0x13d933=0x0;_0x13d933<_0xd0d799[_0x6ba4('0x92')];_0x13d933++){_0x4b9226[_0x6ba4('0x93')](_0x4eb155['UserProfileSection'][_0x6ba4('0x94')]({'where':{'userProfileId':_0x63b181['params']['id'],'name':_0xd0d799[_0x13d933][_0x6ba4('0x31')]},'raw':!![]}));}return Promise['all'](_0x4b9226)[_0x6ba4('0x8')](function(_0x30c82e){var _0x3c3214=_['filter'](_0x30c82e,function(_0x58883b){return _0x58883b?_0x58883b:undefined;});var _0x1430ef=_[_0x6ba4('0x5')](_0xd0d799,[_0x6ba4('0x95'),!![]]);var _0xa5a7c3=_[_0x6ba4('0x91')](_0x3c3214)&&_[_0x6ba4('0x91')](_0x1430ef)?null:_[_0x6ba4('0x96')](_0x1430ef,_0x3c3214);if(!_0xa5a7c3)return null;var _0x4c7a10=[];for(var _0x4cef5c=0x0;_0x4cef5c<_0xa5a7c3[_0x6ba4('0x92')];_0x4cef5c++){var _0xc5ac6b=_[_0x6ba4('0x94')](_0xd0d799,function(_0x2bd48e){return _0xa5a7c3[_0x4cef5c]?_0x2bd48e[_0x6ba4('0x31')]===_0xa5a7c3[_0x4cef5c][_0x6ba4('0x31')]:null;});if(_0xc5ac6b){if(_0xa5a7c3[_0x4cef5c][_0x6ba4('0x95')]){_0x4c7a10[_0x6ba4('0x93')](_0x379d75(_0x5e1525[_0x6ba4('0x16')],_0xa5a7c3[_0x4cef5c]));}else{if(!_0xa5a7c3[_0x4cef5c][_0x6ba4('0x97')]){_0x4c7a10[_0x6ba4('0x93')](_0x171c5a(_0xc5ac6b,_0xa5a7c3[_0x4cef5c],_0x5e1525['childModel']));}else{if(_0xc5ac6b[_0x6ba4('0xc')]){_0x4c7a10[_0x6ba4('0x93')](_0x41aaef(_0xc5ac6b,_0xa5a7c3[_0x4cef5c]));}}}}}return Promise[_0x6ba4('0x98')](_0x4c7a10);})['then'](function(_0x5b0550){var _0x375d20=_0x5b0550;var _0x4c2b71=null;if(_0x375d20){_0x4c2b71=_0x375d20[_0x6ba4('0x92')]===0x1?_0x375d20[0x0]:null;}if(!_0x4c2b71&&!_0x375d20)return _0x50b463;var _0xc71a3a=_0x4eb155[_0x5e1525[_0x6ba4('0x16')]]['rawAttributes'];_0x136d71['model']=_[_0x6ba4('0x99')](_0xc71a3a);_0x136d71[_0x6ba4('0x8d')]=_[_0x6ba4('0x99')](_0x63b181[_0x6ba4('0x8d')]);_0x136d71[_0x6ba4('0x9a')]=_[_0x6ba4('0x9b')](_0x136d71[_0x6ba4('0xc')],_0x136d71[_0x6ba4('0x8d')]);_0x35d77f['attributes']=_[_0x6ba4('0x9b')](_0x136d71[_0x6ba4('0xc')],_0x2ba4eb[_0x6ba4('0x9c')](_0x63b181['query']['fields']));_0x35d77f[_0x6ba4('0x9d')]=_0x35d77f[_0x6ba4('0x9d')][_0x6ba4('0x92')]?_0x35d77f['attributes']:_0x136d71[_0x6ba4('0xc')];if(!_0x63b181[_0x6ba4('0x8d')]['hasOwnProperty'](_0x6ba4('0x9e'))){_0x35d77f[_0x6ba4('0x9f')]=_0x2ba4eb[_0x6ba4('0x9f')](_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x9f')]);_0x35d77f[_0x6ba4('0xa0')]=_0x2ba4eb[_0x6ba4('0xa0')](_0x63b181[_0x6ba4('0x8d')]['offset']);}_0x35d77f[_0x6ba4('0xa1')]=_0x2ba4eb[_0x6ba4('0xa2')](_0x63b181['query'][_0x6ba4('0xa2')]);_0x35d77f[_0x6ba4('0x84')]=_0x2ba4eb['filters'](_['pick'](_0x63b181[_0x6ba4('0x8d')],_0x136d71[_0x6ba4('0x9a')]));if(_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x5')]){_0x35d77f['where']=_[_0x6ba4('0xa3')](_0x35d77f[_0x6ba4('0x84')],{'$or':_[_0x6ba4('0xa')](_0xc71a3a,function(_0x2e740a){if(_0x2e740a[_0x6ba4('0x11')]['key']!==_0x6ba4('0xa4')){var _0x158662={};_0x158662[_0x2e740a[_0x6ba4('0x6')]]={'$like':'%'+_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0x5')]+'%'};return _0x158662;}})});}var _0x4af2d8=[];var _0x212dee=null;var _0x3c4cdc={};if(_0x4c2b71){_0x212dee=_[_0x6ba4('0x94')](_0xd0d799,[_0x6ba4('0x31'),_0x4c2b71[_0x6ba4('0x31')]]);if(_0x212dee[_0x6ba4('0x6')]){_0x3c4cdc={};if(_0x5e1525['childModel']==='AnalyticExtractedReport'){_0x3c4cdc[_0x212dee[_0x6ba4('0xa5')]]=_[_0x6ba4('0xa')](_0x4c2b71[_0x6ba4('0x9')],'id');}else{_0x3c4cdc[_0x212dee[_0x6ba4('0xa5')]]=_0x4c2b71[_0x6ba4('0x9')];}_0x4af2d8[_0x6ba4('0x93')](_0x3c4cdc);}else{_0x35d77f['where']['id']=_0x4c2b71[_0x6ba4('0x9')];}}else{for(var _0x35c9e4=0x0;_0x35c9e4<_0x375d20[_0x6ba4('0x92')];_0x35c9e4++){_0x212dee=_['find'](_0xd0d799,[_0x6ba4('0x31'),_0x375d20[_0x35c9e4][_0x6ba4('0x31')]]);if(_0x212dee[_0x6ba4('0x6')]){_0x3c4cdc={};_0x3c4cdc[_0x212dee[_0x6ba4('0xa5')]]=_0x375d20[_0x35c9e4][_0x6ba4('0x9')];_0x4af2d8['push'](_0x3c4cdc);}else{if(!_0x35d77f[_0x6ba4('0x84')]['id'])_0x35d77f[_0x6ba4('0x84')]['id']=[];_0x375d20[_0x35c9e4][_0x6ba4('0x9')][_0x6ba4('0xa6')](function(_0x134d7b){_0x35d77f['where']['id'][_0x6ba4('0x93')](_0x134d7b);});}}}if(!_[_0x6ba4('0x91')](_0x4af2d8)){_0x35d77f['where']=_[_0x6ba4('0xa3')](_0x35d77f[_0x6ba4('0x84')],{'$and':{'$or':_0x4af2d8}});}_0x35d77f=_[_0x6ba4('0xa3')]({},_0x35d77f,_0x63b181['options']);if(_0x4c2b71&&!_0x4c2b71[_0x6ba4('0x97')]&&_0x5e1525[_0x6ba4('0x16')]===_0x6ba4('0x10')){if(_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xa7')]){_0x35d77f[_0x6ba4('0xa8')]=[{'all':!![]}];}return _0x4eb155[_0x5e1525['childModel']][_0x6ba4('0xd')](_0x35d77f)[_0x6ba4('0x8')](function(_0x56ac18){var _0x127ee9=[];_0x56ac18[_0x6ba4('0xa6')](function(_0x4d069d){var _0xbfd479;switch(_0x4d069d[_0x6ba4('0xa9')]){case _0x6ba4('0xaa'):_0xbfd479=_[_0x6ba4('0x94')](_0x4c2b71[_0x6ba4('0x9')],function(_0x30c389){return _0x30c389['id']===_0x4d069d['reportId']&&_0x30c389[_0x6ba4('0x11')]===_0x6ba4('0xab');});break;case _0x6ba4('0xac'):_0xbfd479=_[_0x6ba4('0x94')](_0x4c2b71[_0x6ba4('0x9')],function(_0x4e6dc4){return _0x4e6dc4['id']===_0x4d069d[_0x6ba4('0x75')]&&_0x4e6dc4[_0x6ba4('0x11')]===_0x6ba4('0xad');});break;}if(_0xbfd479)_0x127ee9[_0x6ba4('0x93')](_0x4d069d);});_0x50b463['count']=_0x127ee9[_0x6ba4('0x92')];_0x50b463[_0x6ba4('0xae')]=_0x127ee9;return _0x50b463;});}else{if(!_[_0x6ba4('0x91')](_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xaf')])){_0x35d77f[_0x6ba4('0x84')]['id']=_0x35d77f['where']['id']?_[_0x6ba4('0x9b')](_0x35d77f[_0x6ba4('0x84')]['id'],_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xaf')]):_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xaf')];if(_0x63b181[_0x6ba4('0x8d')]['customSorting']){_0x35d77f[_0x6ba4('0xa1')]=_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xb0')];}}if(_0x63b181['query'][_0x6ba4('0xb1')]){_0x35d77f['where']=_[_0x6ba4('0xa3')](_0x35d77f[_0x6ba4('0x84')],{'$and':_0x63b181['query'][_0x6ba4('0xb1')]});}return _0x4eb155[_0x5e1525[_0x6ba4('0x16')]]['count']({'where':_0x35d77f[_0x6ba4('0x84')]})[_0x6ba4('0x8')](function(_0x2c9a8e){_0x50b463[_0x6ba4('0xb2')]=_0x2c9a8e;if(_0x63b181['query'][_0x6ba4('0xa7')]){if(_0x5e1525[_0x6ba4('0x16')]===_0x6ba4('0xb3')){_0x35d77f[_0x6ba4('0xa8')]=[{'model':_0x4eb155['Tag'],'as':_0x6ba4('0xb4'),'attributes':['id',_0x6ba4('0x31'),_0x6ba4('0xb5')],'required':_0x63b181['query'][_0x6ba4('0xb6')]?!![]:![]},{'model':_0x4eb155[_0x6ba4('0xb7')],'as':_0x6ba4('0xb8'),'attributes':['id','name',_0x6ba4('0xb5')],'through':_0x63b181[_0x6ba4('0x8d')]['tag']?{'attributes':[],'where':{'TagId':_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xb6')]||undefined}}:{},'required':_0x63b181[_0x6ba4('0x8d')][_0x6ba4('0xb6')]?!![]:![]}];}else{_0x35d77f['include']=[{'all':!![]}];}}return _0x4eb155[_0x5e1525[_0x6ba4('0x16')]][_0x6ba4('0xd')](_0x35d77f);})[_0x6ba4('0x8')](function(_0x5422ed){_0x50b463['rows']=_0x5422ed;if(_0x28b36b==='Agents'&&_0x63b181[_0x6ba4('0x8d')]['openTabs']===_0x6ba4('0xb9')){var _0x5de9f8=[];for(var _0x30dbfd=0x0;_0x30dbfd<_0x50b463[_0x6ba4('0xae')][_0x6ba4('0x92')];_0x30dbfd++){_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xba'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd][_0x6ba4('0xbb')]));_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xbc'),_0x50b463['rows'][_0x30dbfd]['dataValues']));_0x5de9f8[_0x6ba4('0x93')](_0x358c7c(_0x6ba4('0xbd'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd][_0x6ba4('0xbb')]));_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xbe'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd]['dataValues']));_0x5de9f8['push'](_0x358c7c(_0x6ba4('0xbf'),_0x50b463['rows'][_0x30dbfd][_0x6ba4('0xbb')]));_0x5de9f8[_0x6ba4('0x93')](_0x358c7c(_0x6ba4('0xc0'),_0x50b463[_0x6ba4('0xae')][_0x30dbfd][_0x6ba4('0xbb')]));}return Promise[_0x6ba4('0x98')](_0x5de9f8)[_0x6ba4('0x8')](function(){return _0x50b463;});}return _0x50b463;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 0552fa2..9612c55 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 _0x8ff3=['../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','UserProfile,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8ff3,0x72));var _0x38ff=function(_0x4307d0,_0x31ae0){_0x4307d0=_0x4307d0-0x0;var _0x4bb86f=_0x8ff3[_0x4307d0];return _0x4bb86f;};'use strict';var _=require(_0x38ff('0x0'));var util=require(_0x38ff('0x1'));var moment=require('moment');var BPromise=require(_0x38ff('0x2'));var rs=require(_0x38ff('0x3'));var fs=require('fs');var Redis=require(_0x38ff('0x4'));var db=require(_0x38ff('0x5'))['db'];var utils=require(_0x38ff('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x38ff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38ff('0x8')]['http']({'port':0x232a});config[_0x38ff('0x9')]=_[_0x38ff('0xa')](config[_0x38ff('0x9')],{'host':_0x38ff('0xb'),'port':0x18eb});var socket=require(_0x38ff('0xc'))(new Redis(config[_0x38ff('0x9')]));require(_0x38ff('0xd'))[_0x38ff('0xe')](socket);function respondWithRpcPromise(_0x17820a,_0x3a701b,_0x261325){return new BPromise(function(_0x217abf,_0x11058d){return client['request'](_0x17820a,_0x261325)[_0x38ff('0xf')](function(_0x9d5d77){logger[_0x38ff('0x10')]('UserProfile,\x20%s,\x20%s',_0x3a701b,_0x38ff('0x11'));logger[_0x38ff('0x12')](_0x38ff('0x13'),_0x3a701b,_0x38ff('0x11'),JSON['stringify'](_0x9d5d77));if(_0x9d5d77[_0x38ff('0x14')]){if(_0x9d5d77[_0x38ff('0x14')]['code']===0x1f4){logger[_0x38ff('0x14')](_0x38ff('0x15'),_0x3a701b,_0x9d5d77[_0x38ff('0x14')]['message']);return _0x11058d(_0x9d5d77[_0x38ff('0x14')]['message']);}logger[_0x38ff('0x14')]('UserProfile,\x20%s,\x20%s',_0x3a701b,_0x9d5d77[_0x38ff('0x14')]['message']);return _0x217abf(_0x9d5d77['error'][_0x38ff('0x16')]);}else{logger[_0x38ff('0x10')](_0x38ff('0x15'),_0x3a701b,_0x38ff('0x11'));_0x217abf(_0x9d5d77[_0x38ff('0x17')][_0x38ff('0x16')]);}})['catch'](function(_0x2f9a29){logger[_0x38ff('0x14')]('UserProfile,\x20%s,\x20%s',_0x3a701b,_0x2f9a29);_0x11058d(_0x2f9a29);});});} \ No newline at end of file +var _0x5a43=['moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a43,0xf1));var _0x35a4=function(_0x1e5d8e,_0x143a25){_0x1e5d8e=_0x1e5d8e-0x0;var _0x9eee2b=_0x5a43[_0x1e5d8e];return _0x9eee2b;};'use strict';var _=require(_0x35a4('0x0'));var util=require(_0x35a4('0x1'));var moment=require(_0x35a4('0x2'));var BPromise=require(_0x35a4('0x3'));var rs=require(_0x35a4('0x4'));var fs=require('fs');var Redis=require(_0x35a4('0x5'));var db=require(_0x35a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x35a4('0x7'));var client=jayson[_0x35a4('0x8')][_0x35a4('0x9')]({'port':0x232a});config[_0x35a4('0xa')]=_[_0x35a4('0xb')](config[_0x35a4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x35a4('0xc'))(new Redis(config[_0x35a4('0xa')]));require(_0x35a4('0xd'))[_0x35a4('0xe')](socket);function respondWithRpcPromise(_0x43df6d,_0x351402,_0x4acf73){return new BPromise(function(_0x501e7e,_0x55910f){return client[_0x35a4('0xf')](_0x43df6d,_0x4acf73)['then'](function(_0x3d777f){logger[_0x35a4('0x10')](_0x35a4('0x11'),_0x351402,'request\x20sent');logger[_0x35a4('0x12')](_0x35a4('0x13'),_0x351402,_0x35a4('0x14'),JSON[_0x35a4('0x15')](_0x3d777f));if(_0x3d777f['error']){if(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x17')]===0x1f4){logger['error'](_0x35a4('0x11'),_0x351402,_0x3d777f['error'][_0x35a4('0x18')]);return _0x55910f(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);return _0x501e7e(_0x3d777f[_0x35a4('0x16')][_0x35a4('0x18')]);}else{logger['info'](_0x35a4('0x11'),_0x351402,_0x35a4('0x14'));_0x501e7e(_0x3d777f[_0x35a4('0x19')][_0x35a4('0x18')]);}})[_0x35a4('0x1a')](function(_0x1197b0){logger[_0x35a4('0x16')](_0x35a4('0x11'),_0x351402,_0x1197b0);_0x55910f(_0x1197b0);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3569880..931b4eb 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 _0xe3c8=['removeListener','length','userProfile:','./userProfile.events','emit'];(function(_0x46eed4,_0x23d556){var _0x1a6d1b=function(_0x19a25a){while(--_0x19a25a){_0x46eed4['push'](_0x46eed4['shift']());}};_0x1a6d1b(++_0x23d556);}(_0xe3c8,0xad));var _0x8e3c=function(_0x1bdeaa,_0x43d898){_0x1bdeaa=_0x1bdeaa-0x0;var _0xfda613=_0xe3c8[_0x1bdeaa];return _0xfda613;};'use strict';var UserProfileEvents=require(_0x8e3c('0x0'));var events=['save','remove','update'];function createListener(_0x2ae89d,_0xd303eb){return function(_0x2a9335){_0xd303eb[_0x8e3c('0x1')](_0x2ae89d,_0x2a9335);};}function removeListener(_0xc05ab5,_0x3fd461){return function(){UserProfileEvents[_0x8e3c('0x2')](_0xc05ab5,_0x3fd461);};}exports['register']=function(_0x41f753){for(var _0x49d7a1=0x0,_0x5c0619=events[_0x8e3c('0x3')];_0x49d7a1<_0x5c0619;_0x49d7a1++){var _0x1a44bf=events[_0x49d7a1];var _0x467527=createListener(_0x8e3c('0x4')+_0x1a44bf,_0x41f753);UserProfileEvents['on'](_0x1a44bf,_0x467527);}}; \ No newline at end of file +var _0xa49e=['userProfile:','./userProfile.events','save','update','emit','length'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa49e,0x1bd));var _0xea49=function(_0x41159b,_0x18ae88){_0x41159b=_0x41159b-0x0;var _0x5bea4e=_0xa49e[_0x41159b];return _0x5bea4e;};'use strict';var UserProfileEvents=require(_0xea49('0x0'));var events=[_0xea49('0x1'),'remove',_0xea49('0x2')];function createListener(_0x4ccea0,_0x44e4e8){return function(_0x2e8093){_0x44e4e8[_0xea49('0x3')](_0x4ccea0,_0x2e8093);};}function removeListener(_0x20d82e,_0x26baea){return function(){UserProfileEvents['removeListener'](_0x20d82e,_0x26baea);};}exports['register']=function(_0x56f6b2){for(var _0x506ee4=0x0,_0x39029b=events[_0xea49('0x4')];_0x506ee4<_0x39029b;_0x506ee4++){var _0x457e67=events[_0x506ee4];var _0x357839=createListener(_0xea49('0x5')+_0x457e67,_0x56f6b2);UserProfileEvents['on'](_0x457e67,_0x357839);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index cba94bd..280fd53 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 _0xc5d8=['describe','isAuthenticated','show','post','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','/describe'];(function(_0x3bf0f5,_0x29210c){var _0x3baa96=function(_0x461676){while(--_0x461676){_0x3bf0f5['push'](_0x3bf0f5['shift']());}};_0x3baa96(++_0x29210c);}(_0xc5d8,0x10d));var _0x8c5d=function(_0x46759d,_0x13e994){_0x46759d=_0x46759d-0x0;var _0x3e7fe0=_0xc5d8[_0x46759d];return _0x3e7fe0;};'use strict';var multer=require(_0x8c5d('0x0'));var util=require(_0x8c5d('0x1'));var path=require('path');var timeout=require(_0x8c5d('0x2'));var express=require(_0x8c5d('0x3'));var router=express[_0x8c5d('0x4')]();var fs_extra=require(_0x8c5d('0x5'));var auth=require(_0x8c5d('0x6'));var interaction=require(_0x8c5d('0x7'));var config=require('../../config/environment');var controller=require(_0x8c5d('0x8'));router[_0x8c5d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8c5d('0xa'),auth['isAuthenticated'](),controller[_0x8c5d('0xb')]);router[_0x8c5d('0x9')]('/:id',auth[_0x8c5d('0xc')](),controller[_0x8c5d('0xd')]);router[_0x8c5d('0xe')]('/',auth[_0x8c5d('0xc')](),controller[_0x8c5d('0xf')]);router[_0x8c5d('0x10')]('/:id',auth[_0x8c5d('0xc')](),controller['update']);router['delete'](_0x8c5d('0x11'),auth['isAuthenticated'](),controller[_0x8c5d('0x12')]);module[_0x8c5d('0x13')]=router; \ No newline at end of file +var _0x23ec=['../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','index','describe','isAuthenticated','show','post','create','put','update','/:id','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3adbae,_0x1a6e96){var _0xcb7316=function(_0x3fb628){while(--_0x3fb628){_0x3adbae['push'](_0x3adbae['shift']());}};_0xcb7316(++_0x1a6e96);}(_0x23ec,0x19e));var _0xc23e=function(_0x23efa3,_0x2ee0ef){_0x23efa3=_0x23efa3-0x0;var _0x236df0=_0x23ec[_0x23efa3];return _0x236df0;};'use strict';var multer=require(_0xc23e('0x0'));var util=require(_0xc23e('0x1'));var path=require(_0xc23e('0x2'));var timeout=require('connect-timeout');var express=require(_0xc23e('0x3'));var router=express[_0xc23e('0x4')]();var fs_extra=require(_0xc23e('0x5'));var auth=require(_0xc23e('0x6'));var interaction=require(_0xc23e('0x7'));var config=require('../../config/environment');var controller=require(_0xc23e('0x8'));router[_0xc23e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc23e('0xa')]);router[_0xc23e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc23e('0xb')]);router[_0xc23e('0x9')]('/:id',auth[_0xc23e('0xc')](),controller[_0xc23e('0xd')]);router[_0xc23e('0xe')]('/',auth[_0xc23e('0xc')](),controller[_0xc23e('0xf')]);router[_0xc23e('0x10')]('/:id',auth[_0xc23e('0xc')](),controller[_0xc23e('0x11')]);router['delete'](_0xc23e('0x12'),auth[_0xc23e('0xc')](),controller[_0xc23e('0x13')]);module[_0xc23e('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 17b143b..0c54557 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 _0x20cb=['INTEGER','sequelize','exports'];(function(_0x215ef7,_0x590e45){var _0x40a37b=function(_0x13fd4c){while(--_0x13fd4c){_0x215ef7['push'](_0x215ef7['shift']());}};_0x40a37b(++_0x590e45);}(_0x20cb,0x199));var _0xb20c=function(_0x181c73,_0x1c6026){_0x181c73=_0x181c73-0x0;var _0x45fee5=_0x20cb[_0x181c73];return _0x45fee5;};'use strict';var Sequelize=require(_0xb20c('0x0'));module[_0xb20c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xb20c('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x5675=['STRING','INTEGER','sequelize','exports'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x5675,0x1b2));var _0x5567=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x5675[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x5567('0x0'));module[_0x5567('0x1')]={'name':{'type':Sequelize[_0x5567('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5567('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6b6aa62..f99b259 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 _0x6d38=['findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','UserProfileResource','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['UserProfileResource'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));};exports['describe']=function(_0x5bedc6,_0x159253){return db[_0x86d3('0x26')][_0x86d3('0x44')]()[_0x86d3('0x20')](respondWithResult(_0x159253,null))[_0x86d3('0x40')](handleError(_0x159253,null));}; \ No newline at end of file +var _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','UserProfileResource','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x465e84,_0x40dacc){var _0x511c5d=function(_0x477e0e){while(--_0x477e0e){_0x465e84['push'](_0x465e84['shift']());}};_0x511c5d(++_0x40dacc);}(_0x1261,0x144));var _0x1126=function(_0x30f395,_0x3629b5){_0x30f395=_0x30f395-0x0;var _0x2ea0ee=_0x1261[_0x30f395];return _0x2ea0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['UserProfileResource'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['UserProfileResource']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 8a40b22..125e5b5 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 _0x5cb4=['util','../../config/logger','moment','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','lodash'];(function(_0x4c7bad,_0x362b7a){var _0x196bcb=function(_0x5432f5){while(--_0x5432f5){_0x4c7bad['push'](_0x4c7bad['shift']());}};_0x196bcb(++_0x362b7a);}(_0x5cb4,0xf6));var _0x45cb=function(_0x1380e2,_0x343182){_0x1380e2=_0x1380e2-0x0;var _0xe04562=_0x5cb4[_0x1380e2];return _0xe04562;};'use strict';var _=require(_0x45cb('0x0'));var util=require(_0x45cb('0x1'));var logger=require(_0x45cb('0x2'))('api');var moment=require(_0x45cb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x45cb('0x4'));var rimraf=require(_0x45cb('0x5'));var config=require(_0x45cb('0x6'));var attributes=require(_0x45cb('0x7'));module[_0x45cb('0x8')]=function(_0xa77fbc,_0x276195){return _0xa77fbc[_0x45cb('0x9')]('UserProfileResource',attributes,{'tableName':_0x45cb('0xa'),'paranoid':![],'indexes':[{'name':_0x45cb('0xb'),'fields':[_0x45cb('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x47f7=['bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','moment'];(function(_0x3da1f4,_0x5a337c){var _0x153a99=function(_0x13a2bf){while(--_0x13a2bf){_0x3da1f4['push'](_0x3da1f4['shift']());}};_0x153a99(++_0x5a337c);}(_0x47f7,0x7a));var _0x747f=function(_0x4d04fa,_0x35ad63){_0x4d04fa=_0x4d04fa-0x0;var _0xfa49cd=_0x47f7[_0x4d04fa];return _0xfa49cd;};'use strict';var _=require(_0x747f('0x0'));var util=require(_0x747f('0x1'));var logger=require(_0x747f('0x2'))('api');var moment=require(_0x747f('0x3'));var BPromise=require(_0x747f('0x4'));var rp=require(_0x747f('0x5'));var fs=require('fs');var path=require(_0x747f('0x6'));var rimraf=require('rimraf');var config=require(_0x747f('0x7'));var attributes=require(_0x747f('0x8'));module['exports']=function(_0x4905a3,_0x4266af){return _0x4905a3[_0x747f('0x9')](_0x747f('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x747f('0xb'),'fields':[_0x747f('0xc'),_0x747f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 22fb04c..4106fcf 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 _0x5a69=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x5a69,0x1c0));var _0x95a6=function(_0x9a8a0d,_0x29b5cd){_0x9a8a0d=_0x9a8a0d-0x0;var _0x30807a=_0x5a69[_0x9a8a0d];return _0x30807a;};'use strict';var _=require(_0x95a6('0x0'));var util=require(_0x95a6('0x1'));var moment=require('moment');var BPromise=require(_0x95a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95a6('0x3'))['db'];var utils=require(_0x95a6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x95a6('0x5'));var jayson=require(_0x95a6('0x6'));var client=jayson[_0x95a6('0x7')][_0x95a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e9e6a,_0x462328,_0x5749b8){return new BPromise(function(_0x289f3a,_0x4efb8d){return client['request'](_0x2e9e6a,_0x5749b8)[_0x95a6('0x9')](function(_0x1e7934){logger[_0x95a6('0xa')](_0x95a6('0xb'),_0x462328,'request\x20sent');logger[_0x95a6('0xc')](_0x95a6('0xd'),_0x462328,_0x95a6('0xe'),JSON[_0x95a6('0xf')](_0x1e7934));if(_0x1e7934[_0x95a6('0x10')]){if(_0x1e7934[_0x95a6('0x10')][_0x95a6('0x11')]===0x1f4){logger[_0x95a6('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x462328,_0x1e7934[_0x95a6('0x10')]['message']);return _0x4efb8d(_0x1e7934[_0x95a6('0x10')][_0x95a6('0x12')]);}logger[_0x95a6('0x10')](_0x95a6('0xb'),_0x462328,_0x1e7934['error'][_0x95a6('0x12')]);return _0x289f3a(_0x1e7934[_0x95a6('0x10')][_0x95a6('0x12')]);}else{logger[_0x95a6('0xa')](_0x95a6('0xb'),_0x462328,_0x95a6('0xe'));_0x289f3a(_0x1e7934[_0x95a6('0x13')]['message']);}})[_0x95a6('0x14')](function(_0x19dbcb){logger[_0x95a6('0x10')](_0x95a6('0xb'),_0x462328,_0x19dbcb);_0x4efb8d(_0x19dbcb);});});} \ No newline at end of file +var _0xaeb3=['message','request\x20sent','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s'];(function(_0x18cdcc,_0x52c867){var _0x497c03=function(_0x122bcf){while(--_0x122bcf){_0x18cdcc['push'](_0x18cdcc['shift']());}};_0x497c03(++_0x52c867);}(_0xaeb3,0x12e));var _0x3aeb=function(_0x1833cd,_0x369128){_0x1833cd=_0x1833cd-0x0;var _0x4360ac=_0xaeb3[_0x1833cd];return _0x4360ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3aeb('0x0'));var BPromise=require(_0x3aeb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3aeb('0x2'));var db=require(_0x3aeb('0x3'))['db'];var utils=require(_0x3aeb('0x4'));var logger=require(_0x3aeb('0x5'))(_0x3aeb('0x6'));var config=require(_0x3aeb('0x7'));var jayson=require(_0x3aeb('0x8'));var client=jayson[_0x3aeb('0x9')][_0x3aeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x203405,_0x1be4d4,_0x19e17e){return new BPromise(function(_0x14f814,_0x41c14d){return client[_0x3aeb('0xb')](_0x203405,_0x19e17e)[_0x3aeb('0xc')](function(_0x2b0625){logger[_0x3aeb('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x1be4d4,'request\x20sent');logger[_0x3aeb('0xe')](_0x3aeb('0xf'),_0x1be4d4,'request\x20sent',JSON[_0x3aeb('0x10')](_0x2b0625));if(_0x2b0625[_0x3aeb('0x11')]){if(_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x12')]===0x1f4){logger[_0x3aeb('0x11')](_0x3aeb('0x13'),_0x1be4d4,_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x14')]);return _0x41c14d(_0x2b0625['error'][_0x3aeb('0x14')]);}logger[_0x3aeb('0x11')](_0x3aeb('0x13'),_0x1be4d4,_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x14')]);return _0x14f814(_0x2b0625[_0x3aeb('0x11')][_0x3aeb('0x14')]);}else{logger[_0x3aeb('0xd')](_0x3aeb('0x13'),_0x1be4d4,_0x3aeb('0x15'));_0x14f814(_0x2b0625['result'][_0x3aeb('0x14')]);}})[_0x3aeb('0x16')](function(_0x493a75){logger['error'](_0x3aeb('0x13'),_0x1be4d4,_0x493a75);_0x41c14d(_0x493a75);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 3ff8a7a..c5c155f 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 _0x91a8=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x256aab,_0x2f2056){var _0x18126=function(_0x4063da){while(--_0x4063da){_0x256aab['push'](_0x256aab['shift']());}};_0x18126(++_0x2f2056);}(_0x91a8,0xe3));var _0x891a=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x91a8[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x891a('0x0'));var util=require(_0x891a('0x1'));var path=require(_0x891a('0x2'));var timeout=require(_0x891a('0x3'));var express=require(_0x891a('0x4'));var router=express[_0x891a('0x5')]();var fs_extra=require(_0x891a('0x6'));var auth=require(_0x891a('0x7'));var interaction=require(_0x891a('0x8'));var config=require(_0x891a('0x9'));var controller=require(_0x891a('0xa'));router['get']('/',auth[_0x891a('0xb')](),controller[_0x891a('0xc')]);router[_0x891a('0xd')](_0x891a('0xe'),auth[_0x891a('0xb')](),controller[_0x891a('0xf')]);router[_0x891a('0xd')](_0x891a('0x10'),auth['isAuthenticated'](),controller[_0x891a('0x11')]);router[_0x891a('0x12')]('/',auth[_0x891a('0xb')](),controller[_0x891a('0x13')]);router[_0x891a('0x14')](_0x891a('0x10'),auth[_0x891a('0xb')](),controller[_0x891a('0x15')]);router[_0x891a('0x16')](_0x891a('0x10'),auth[_0x891a('0xb')](),controller[_0x891a('0x17')]);module[_0x891a('0x18')]=router; \ No newline at end of file +var _0x3f0a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','multer','util','path'];(function(_0x22f12f,_0x348375){var _0x4b5fea=function(_0x21caac){while(--_0x21caac){_0x22f12f['push'](_0x22f12f['shift']());}};_0x4b5fea(++_0x348375);}(_0x3f0a,0xbd));var _0xa3f0=function(_0x59e1de,_0x3be68d){_0x59e1de=_0x59e1de-0x0;var _0x49d797=_0x3f0a[_0x59e1de];return _0x49d797;};'use strict';var multer=require(_0xa3f0('0x0'));var util=require(_0xa3f0('0x1'));var path=require(_0xa3f0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa3f0('0x3')]();var fs_extra=require(_0xa3f0('0x4'));var auth=require(_0xa3f0('0x5'));var interaction=require(_0xa3f0('0x6'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0xa3f0('0x7')]('/',auth[_0xa3f0('0x8')](),controller['index']);router[_0xa3f0('0x7')](_0xa3f0('0x9'),auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xa')]);router['get'](_0xa3f0('0xb'),auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xc')]);router['post']('/',auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xd')]);router[_0xa3f0('0xe')]('/:id',auth[_0xa3f0('0x8')](),controller[_0xa3f0('0xf')]);router['delete'](_0xa3f0('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 823d14f..1f83135 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 _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x2573b,_0x91cff){var _0x451081=function(_0x2db78e){while(--_0x2db78e){_0x2573b['push'](_0x2573b['shift']());}};_0x451081(++_0x91cff);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}}; \ No newline at end of file +var _0xab40=['STRING','setDataValue','getDataValue','crudPermissions','split','sequelize','exports','BOOLEAN'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0xab40,0xcd));var _0x0ab4=function(_0x6d3304,_0x1f70e1){_0x6d3304=_0x6d3304-0x0;var _0x53ff27=_0xab40[_0x6d3304];return _0x53ff27;};'use strict';var Sequelize=require(_0x0ab4('0x0'));module[_0x0ab4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0ab4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0ab4('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0ab4('0x3')],'set':function(_0x2bf1ba){this[_0x0ab4('0x4')]('crudPermissions',_0x2bf1ba?_0x2bf1ba['join'](''):[]);},'get':function(){return this[_0x0ab4('0x5')]('crudPermissions')?this[_0x0ab4('0x5')](_0x0ab4('0x6'))[_0x0ab4('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 021e6f4..53a22fd 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 _0x1f40=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','includeAll','rows','catch','attributes','include','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x51cc8e,_0x2a72a9){var _0x37b3f8=function(_0x159d11){while(--_0x159d11){_0x51cc8e['push'](_0x51cc8e['shift']());}};_0x37b3f8(++_0x2a72a9);}(_0x1f40,0x11f));var _0x01f4=function(_0xbb1b63,_0x3602db){_0xbb1b63=_0xbb1b63-0x0;var _0x25d9a6=_0x1f40[_0xbb1b63];return _0x25d9a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01f4('0x0'));var zipdir=require(_0x01f4('0x1'));var jsonpatch=require(_0x01f4('0x2'));var rp=require('request-promise');var moment=require(_0x01f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x01f4('0x4'));var util=require(_0x01f4('0x5'));var path=require(_0x01f4('0x6'));var sox=require('sox');var csv=require(_0x01f4('0x7'));var ejs=require(_0x01f4('0x8'));var fs=require('fs');var fs_extra=require(_0x01f4('0x9'));var _=require(_0x01f4('0xa'));var squel=require('squel');var crypto=require(_0x01f4('0xb'));var jsforce=require(_0x01f4('0xc'));var deskjs=require(_0x01f4('0xd'));var toCsv=require(_0x01f4('0x7'));var querystring=require(_0x01f4('0xe'));var Papa=require('papaparse');var Redis=require(_0x01f4('0xf'));var authService=require(_0x01f4('0x10'));var qs=require(_0x01f4('0x11'));var as=require(_0x01f4('0x12'));var hardwareService=require(_0x01f4('0x13'));var logger=require(_0x01f4('0x14'))(_0x01f4('0x15'));var utils=require(_0x01f4('0x16'));var config=require(_0x01f4('0x17'));var licenseUtil=require(_0x01f4('0x18'));var db=require(_0x01f4('0x19'))['db'];function respondWithStatusCode(_0x391b66,_0x522dea){_0x522dea=_0x522dea||0xcc;return function(_0x4d4130){if(_0x4d4130){return _0x391b66['sendStatus'](_0x522dea);}return _0x391b66[_0x01f4('0x1a')](_0x522dea)[_0x01f4('0x1b')]();};}function respondWithResult(_0x2734ac,_0x38d811){_0x38d811=_0x38d811||0xc8;return function(_0x46f2e4){if(_0x46f2e4){return _0x2734ac['status'](_0x38d811)[_0x01f4('0x1c')](_0x46f2e4);}};}function respondWithFilteredResult(_0x5ea3ac,_0x57c044){return function(_0x54574f){if(_0x54574f){var _0x115b07=typeof _0x57c044['offset']==='undefined'&&typeof _0x57c044[_0x01f4('0x1d')]===_0x01f4('0x1e');var _0x398adf=_0x54574f[_0x01f4('0x1f')];var _0xc077cf=_0x115b07?0x0:_0x57c044[_0x01f4('0x20')];var _0x171859=_0x115b07?_0x54574f['count']:_0x57c044[_0x01f4('0x20')]+_0x57c044['limit'];var _0x2ffca0;if(_0x171859>=_0x398adf){_0x171859=_0x398adf;_0x2ffca0=0xc8;}else{_0x2ffca0=0xce;}_0x5ea3ac[_0x01f4('0x1a')](_0x2ffca0);return _0x5ea3ac['set'](_0x01f4('0x21'),_0xc077cf+'-'+_0x171859+'/'+_0x398adf)[_0x01f4('0x1c')](_0x54574f);}return null;};}function patchUpdates(_0x35b4fb){return function(_0x34f4d1){try{jsonpatch[_0x01f4('0x22')](_0x34f4d1,_0x35b4fb,!![]);}catch(_0x2ee68b){return BPromise[_0x01f4('0x23')](_0x2ee68b);}return _0x34f4d1[_0x01f4('0x24')]();};}function saveUpdates(_0x23a00f,_0x9cffd2){return function(_0x46e8a4){if(_0x46e8a4){return _0x46e8a4[_0x01f4('0x25')](_0x23a00f)[_0x01f4('0x26')](function(_0x37d07f){return _0x37d07f;});}return null;};}function removeEntity(_0x3b3382,_0x1a9c80){return function(_0x4d1e19){if(_0x4d1e19){return _0x4d1e19[_0x01f4('0x27')]()['then'](function(){_0x3b3382[_0x01f4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb9ef7,_0x4b94e8){return function(_0x2cf350){if(!_0x2cf350){_0xdb9ef7[_0x01f4('0x28')](0x194);}return _0x2cf350;};}function handleError(_0x40ce08,_0x3ef48b){_0x3ef48b=_0x3ef48b||0x1f4;return function(_0x509239){logger[_0x01f4('0x29')](_0x509239[_0x01f4('0x2a')]);if(_0x509239[_0x01f4('0x2b')]){delete _0x509239[_0x01f4('0x2b')];}_0x40ce08['status'](_0x3ef48b)['send'](_0x509239);};}exports[_0x01f4('0x2c')]=function(_0x379075,_0x8577a){var _0x56057e={},_0xe85f22={},_0x423fc9={'count':0x0,'rows':[]};var _0x1536f3=_[_0x01f4('0x2d')](db[_0x01f4('0x2e')][_0x01f4('0x2f')],function(_0x310070){return{'name':_0x310070[_0x01f4('0x30')],'type':_0x310070[_0x01f4('0x31')][_0x01f4('0x32')]};});_0xe85f22[_0x01f4('0x33')]=_[_0x01f4('0x2d')](_0x1536f3,'name');_0xe85f22[_0x01f4('0x34')]=_[_0x01f4('0x35')](_0x379075[_0x01f4('0x34')]);_0xe85f22[_0x01f4('0x36')]=_[_0x01f4('0x37')](_0xe85f22[_0x01f4('0x33')],_0xe85f22[_0x01f4('0x34')]);_0x56057e['attributes']=_[_0x01f4('0x37')](_0xe85f22['model'],qs[_0x01f4('0x38')](_0x379075[_0x01f4('0x34')][_0x01f4('0x38')]));_0x56057e['attributes']=_0x56057e['attributes'][_0x01f4('0x39')]?_0x56057e['attributes']:_0xe85f22[_0x01f4('0x33')];if(!_0x379075[_0x01f4('0x34')][_0x01f4('0x3a')](_0x01f4('0x3b'))){_0x56057e['limit']=qs['limit'](_0x379075['query'][_0x01f4('0x1d')]);_0x56057e[_0x01f4('0x20')]=qs[_0x01f4('0x20')](_0x379075['query']['offset']);}_0x56057e[_0x01f4('0x3c')]=qs['sort'](_0x379075[_0x01f4('0x34')]['sort']);_0x56057e['where']=qs[_0x01f4('0x36')](_[_0x01f4('0x3d')](_0x379075[_0x01f4('0x34')],_0xe85f22[_0x01f4('0x36')]),_0x1536f3);if(_0x379075[_0x01f4('0x34')][_0x01f4('0x3e')]){_0x56057e['where']=_[_0x01f4('0x3f')](_0x56057e[_0x01f4('0x40')],{'$or':_[_0x01f4('0x2d')](_0x1536f3,function(_0x461e37){if(_0x461e37[_0x01f4('0x31')]!==_0x01f4('0x41')){var _0x38ab58={};_0x38ab58[_0x461e37[_0x01f4('0x2b')]]={'$like':'%'+_0x379075[_0x01f4('0x34')][_0x01f4('0x3e')]+'%'};return _0x38ab58;}})});}_0x56057e=_['merge']({},_0x56057e,_0x379075['options']);var _0x44c530={'where':_0x56057e[_0x01f4('0x40')]};return db[_0x01f4('0x2e')][_0x01f4('0x1f')](_0x44c530)[_0x01f4('0x26')](function(_0xc6d9bc){_0x423fc9[_0x01f4('0x1f')]=_0xc6d9bc;if(_0x379075[_0x01f4('0x34')][_0x01f4('0x42')]){_0x56057e['include']=[{'all':!![]}];}return db[_0x01f4('0x2e')]['findAll'](_0x56057e);})[_0x01f4('0x26')](function(_0x426b16){_0x423fc9[_0x01f4('0x43')]=_0x426b16;return _0x423fc9;})[_0x01f4('0x26')](respondWithFilteredResult(_0x8577a,_0x56057e))[_0x01f4('0x44')](handleError(_0x8577a,null));};exports['show']=function(_0x28c62d,_0x2765c0){var _0x2b7283={'raw':![],'where':{'id':_0x28c62d['params']['id']}},_0x377cd6={};_0x377cd6[_0x01f4('0x33')]=_[_0x01f4('0x35')](db[_0x01f4('0x2e')][_0x01f4('0x2f')]);_0x377cd6[_0x01f4('0x34')]=_['keys'](_0x28c62d[_0x01f4('0x34')]);_0x377cd6[_0x01f4('0x36')]=_[_0x01f4('0x37')](_0x377cd6[_0x01f4('0x33')],_0x377cd6['query']);_0x2b7283[_0x01f4('0x45')]=_[_0x01f4('0x37')](_0x377cd6[_0x01f4('0x33')],qs[_0x01f4('0x38')](_0x28c62d[_0x01f4('0x34')][_0x01f4('0x38')]));_0x2b7283['attributes']=_0x2b7283[_0x01f4('0x45')][_0x01f4('0x39')]?_0x2b7283['attributes']:_0x377cd6[_0x01f4('0x33')];if(_0x28c62d[_0x01f4('0x34')][_0x01f4('0x42')]){_0x2b7283[_0x01f4('0x46')]=[{'all':!![]}];}_0x2b7283=_[_0x01f4('0x3f')]({},_0x2b7283,_0x28c62d[_0x01f4('0x47')]);return db[_0x01f4('0x2e')][_0x01f4('0x48')](_0x2b7283)[_0x01f4('0x26')](handleEntityNotFound(_0x2765c0,null))[_0x01f4('0x26')](respondWithResult(_0x2765c0,null))['catch'](handleError(_0x2765c0,null));};exports['create']=function(_0x527c44,_0xac4f68){return db['UserProfileSection'][_0x01f4('0x49')](_0x527c44['body'],{})[_0x01f4('0x26')](respondWithResult(_0xac4f68,0xc9))[_0x01f4('0x44')](handleError(_0xac4f68,null));};exports[_0x01f4('0x25')]=function(_0x2cd609,_0x22c624){if(_0x2cd609[_0x01f4('0x4a')]['id']){delete _0x2cd609['body']['id'];}return db[_0x01f4('0x2e')][_0x01f4('0x48')]({'where':{'id':_0x2cd609[_0x01f4('0x4b')]['id']}})[_0x01f4('0x26')](handleEntityNotFound(_0x22c624,null))[_0x01f4('0x26')](saveUpdates(_0x2cd609['body'],null))[_0x01f4('0x26')](respondWithResult(_0x22c624,null))[_0x01f4('0x44')](handleError(_0x22c624,null));};exports[_0x01f4('0x27')]=function(_0xa8e9ea,_0x2e3b09){return db['UserProfileSection'][_0x01f4('0x48')]({'where':{'id':_0xa8e9ea['params']['id']}})[_0x01f4('0x26')](handleEntityNotFound(_0x2e3b09,null))[_0x01f4('0x26')](removeEntity(_0x2e3b09,null))[_0x01f4('0x44')](handleError(_0x2e3b09,null));};exports['describe']=function(_0x18abe6,_0x1a7ba8){return db['UserProfileSection']['describe']()[_0x01f4('0x26')](respondWithResult(_0x1a7ba8,null))[_0x01f4('0x44')](handleError(_0x1a7ba8,null));}; \ No newline at end of file +var _0x6649=['rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','index','map','UserProfileSection'];(function(_0x2a2e62,_0x54ccc3){var _0x6ae6af=function(_0x2dff19){while(--_0x2dff19){_0x2a2e62['push'](_0x2a2e62['shift']());}};_0x6ae6af(++_0x54ccc3);}(_0x6649,0xf0));var _0x9664=function(_0x31adc3,_0x3c5a5b){_0x31adc3=_0x31adc3-0x0;var _0x34bcbb=_0x6649[_0x31adc3];return _0x34bcbb;};'use strict';var emlformat=require(_0x9664('0x0'));var rimraf=require(_0x9664('0x1'));var zipdir=require(_0x9664('0x2'));var jsonpatch=require(_0x9664('0x3'));var rp=require(_0x9664('0x4'));var moment=require('moment');var BPromise=require(_0x9664('0x5'));var Mustache=require(_0x9664('0x6'));var util=require('util');var path=require(_0x9664('0x7'));var sox=require(_0x9664('0x8'));var csv=require(_0x9664('0x9'));var ejs=require(_0x9664('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9664('0xb'));var squel=require(_0x9664('0xc'));var crypto=require(_0x9664('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9664('0xe'));var toCsv=require(_0x9664('0x9'));var querystring=require(_0x9664('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9664('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9664('0x11'));var logger=require(_0x9664('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9664('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9664('0x14'))['db'];function respondWithStatusCode(_0x55b06a,_0x492299){_0x492299=_0x492299||0xcc;return function(_0x4dbcb7){if(_0x4dbcb7){return _0x55b06a[_0x9664('0x15')](_0x492299);}return _0x55b06a[_0x9664('0x16')](_0x492299)[_0x9664('0x17')]();};}function respondWithResult(_0x30a11a,_0x473db2){_0x473db2=_0x473db2||0xc8;return function(_0x328806){if(_0x328806){return _0x30a11a[_0x9664('0x16')](_0x473db2)[_0x9664('0x18')](_0x328806);}};}function respondWithFilteredResult(_0x4aa5f,_0x1b1b4f){return function(_0x465cad){if(_0x465cad){var _0x566d6f=typeof _0x1b1b4f[_0x9664('0x19')]===_0x9664('0x1a')&&typeof _0x1b1b4f[_0x9664('0x1b')]===_0x9664('0x1a');var _0x22ca95=_0x465cad[_0x9664('0x1c')];var _0x17e268=_0x566d6f?0x0:_0x1b1b4f[_0x9664('0x19')];var _0x220f2b=_0x566d6f?_0x465cad[_0x9664('0x1c')]:_0x1b1b4f[_0x9664('0x19')]+_0x1b1b4f[_0x9664('0x1b')];var _0xc86ff4;if(_0x220f2b>=_0x22ca95){_0x220f2b=_0x22ca95;_0xc86ff4=0xc8;}else{_0xc86ff4=0xce;}_0x4aa5f[_0x9664('0x16')](_0xc86ff4);return _0x4aa5f['set'](_0x9664('0x1d'),_0x17e268+'-'+_0x220f2b+'/'+_0x22ca95)[_0x9664('0x18')](_0x465cad);}return null;};}function patchUpdates(_0x4298ef){return function(_0x2c4b22){try{jsonpatch[_0x9664('0x1e')](_0x2c4b22,_0x4298ef,!![]);}catch(_0x515f7f){return BPromise[_0x9664('0x1f')](_0x515f7f);}return _0x2c4b22[_0x9664('0x20')]();};}function saveUpdates(_0x2f610b,_0x37adec){return function(_0x554f4){if(_0x554f4){return _0x554f4[_0x9664('0x21')](_0x2f610b)[_0x9664('0x22')](function(_0x45ed2e){return _0x45ed2e;});}return null;};}function removeEntity(_0xe97433,_0x383feb){return function(_0x27f2bb){if(_0x27f2bb){return _0x27f2bb['destroy']()[_0x9664('0x22')](function(){_0xe97433['status'](0xcc)[_0x9664('0x17')]();});}};}function handleEntityNotFound(_0xc9b109,_0x44ede8){return function(_0x1992b8){if(!_0x1992b8){_0xc9b109['sendStatus'](0x194);}return _0x1992b8;};}function handleError(_0x197389,_0x19c967){_0x19c967=_0x19c967||0x1f4;return function(_0x38da73){logger['error'](_0x38da73[_0x9664('0x23')]);if(_0x38da73[_0x9664('0x24')]){delete _0x38da73[_0x9664('0x24')];}_0x197389[_0x9664('0x16')](_0x19c967)['send'](_0x38da73);};}exports[_0x9664('0x25')]=function(_0x11ae2e,_0xd3b00c){var _0x4fb046={},_0x1b52b5={},_0x2e6252={'count':0x0,'rows':[]};var _0x4412b9=_[_0x9664('0x26')](db[_0x9664('0x27')][_0x9664('0x28')],function(_0x53cab4){return{'name':_0x53cab4['fieldName'],'type':_0x53cab4['type'][_0x9664('0x29')]};});_0x1b52b5[_0x9664('0x2a')]=_[_0x9664('0x26')](_0x4412b9,_0x9664('0x24'));_0x1b52b5[_0x9664('0x2b')]=_[_0x9664('0x2c')](_0x11ae2e[_0x9664('0x2b')]);_0x1b52b5[_0x9664('0x2d')]=_['intersection'](_0x1b52b5[_0x9664('0x2a')],_0x1b52b5['query']);_0x4fb046[_0x9664('0x2e')]=_[_0x9664('0x2f')](_0x1b52b5[_0x9664('0x2a')],qs[_0x9664('0x30')](_0x11ae2e['query'][_0x9664('0x30')]));_0x4fb046['attributes']=_0x4fb046[_0x9664('0x2e')]['length']?_0x4fb046[_0x9664('0x2e')]:_0x1b52b5[_0x9664('0x2a')];if(!_0x11ae2e['query'][_0x9664('0x31')](_0x9664('0x32'))){_0x4fb046[_0x9664('0x1b')]=qs[_0x9664('0x1b')](_0x11ae2e[_0x9664('0x2b')][_0x9664('0x1b')]);_0x4fb046[_0x9664('0x19')]=qs[_0x9664('0x19')](_0x11ae2e[_0x9664('0x2b')][_0x9664('0x19')]);}_0x4fb046[_0x9664('0x33')]=qs['sort'](_0x11ae2e[_0x9664('0x2b')][_0x9664('0x34')]);_0x4fb046[_0x9664('0x35')]=qs[_0x9664('0x2d')](_[_0x9664('0x36')](_0x11ae2e['query'],_0x1b52b5[_0x9664('0x2d')]),_0x4412b9);if(_0x11ae2e[_0x9664('0x2b')][_0x9664('0x37')]){_0x4fb046[_0x9664('0x35')]=_[_0x9664('0x38')](_0x4fb046[_0x9664('0x35')],{'$or':_[_0x9664('0x26')](_0x4412b9,function(_0x51e5df){if(_0x51e5df[_0x9664('0x39')]!==_0x9664('0x3a')){var _0x230639={};_0x230639[_0x51e5df[_0x9664('0x24')]]={'$like':'%'+_0x11ae2e[_0x9664('0x2b')]['filter']+'%'};return _0x230639;}})});}_0x4fb046=_[_0x9664('0x38')]({},_0x4fb046,_0x11ae2e['options']);var _0x827d78={'where':_0x4fb046[_0x9664('0x35')]};return db[_0x9664('0x27')][_0x9664('0x1c')](_0x827d78)[_0x9664('0x22')](function(_0x7d10){_0x2e6252[_0x9664('0x1c')]=_0x7d10;if(_0x11ae2e[_0x9664('0x2b')][_0x9664('0x3b')]){_0x4fb046[_0x9664('0x3c')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x4fb046);})[_0x9664('0x22')](function(_0x207dfd){_0x2e6252[_0x9664('0x3d')]=_0x207dfd;return _0x2e6252;})[_0x9664('0x22')](respondWithFilteredResult(_0xd3b00c,_0x4fb046))['catch'](handleError(_0xd3b00c,null));};exports[_0x9664('0x3e')]=function(_0x21bd23,_0x9ffbb4){var _0x5af71e={'raw':![],'where':{'id':_0x21bd23[_0x9664('0x3f')]['id']}},_0x3db683={};_0x3db683[_0x9664('0x2a')]=_['keys'](db[_0x9664('0x27')][_0x9664('0x28')]);_0x3db683[_0x9664('0x2b')]=_[_0x9664('0x2c')](_0x21bd23[_0x9664('0x2b')]);_0x3db683['filters']=_[_0x9664('0x2f')](_0x3db683[_0x9664('0x2a')],_0x3db683[_0x9664('0x2b')]);_0x5af71e[_0x9664('0x2e')]=_[_0x9664('0x2f')](_0x3db683[_0x9664('0x2a')],qs[_0x9664('0x30')](_0x21bd23[_0x9664('0x2b')]['fields']));_0x5af71e[_0x9664('0x2e')]=_0x5af71e[_0x9664('0x2e')]['length']?_0x5af71e['attributes']:_0x3db683['model'];if(_0x21bd23[_0x9664('0x2b')][_0x9664('0x3b')]){_0x5af71e[_0x9664('0x3c')]=[{'all':!![]}];}_0x5af71e=_[_0x9664('0x38')]({},_0x5af71e,_0x21bd23['options']);return db[_0x9664('0x27')][_0x9664('0x40')](_0x5af71e)[_0x9664('0x22')](handleEntityNotFound(_0x9ffbb4,null))[_0x9664('0x22')](respondWithResult(_0x9ffbb4,null))['catch'](handleError(_0x9ffbb4,null));};exports[_0x9664('0x41')]=function(_0x5a435a,_0x343fd0){return db['UserProfileSection'][_0x9664('0x41')](_0x5a435a[_0x9664('0x42')],{})['then'](respondWithResult(_0x343fd0,0xc9))[_0x9664('0x43')](handleError(_0x343fd0,null));};exports['update']=function(_0x37329e,_0x5ec009){if(_0x37329e[_0x9664('0x42')]['id']){delete _0x37329e['body']['id'];}return db[_0x9664('0x27')][_0x9664('0x40')]({'where':{'id':_0x37329e[_0x9664('0x3f')]['id']}})[_0x9664('0x22')](handleEntityNotFound(_0x5ec009,null))['then'](saveUpdates(_0x37329e[_0x9664('0x42')],null))[_0x9664('0x22')](respondWithResult(_0x5ec009,null))[_0x9664('0x43')](handleError(_0x5ec009,null));};exports[_0x9664('0x44')]=function(_0x5ef5ea,_0x568297){return db['UserProfileSection'][_0x9664('0x40')]({'where':{'id':_0x5ef5ea[_0x9664('0x3f')]['id']}})[_0x9664('0x22')](handleEntityNotFound(_0x568297,null))['then'](removeEntity(_0x568297,null))[_0x9664('0x43')](handleError(_0x568297,null));};exports[_0x9664('0x45')]=function(_0x405e46,_0x1fb1ce){return db[_0x9664('0x27')][_0x9664('0x45')]()[_0x9664('0x22')](respondWithResult(_0x1fb1ce,null))[_0x9664('0x43')](handleError(_0x1fb1ce,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 6f9e0cf..ea467bd 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 _0x1b6f=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x1b6f,0xb3));var _0xf1b6=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0x1b6f[_0x4f0e62];return _0x117ab8;};'use strict';var _=require(_0xf1b6('0x0'));var util=require(_0xf1b6('0x1'));var logger=require(_0xf1b6('0x2'))(_0xf1b6('0x3'));var moment=require(_0xf1b6('0x4'));var BPromise=require(_0xf1b6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1b6('0x6'));var rimraf=require('rimraf');var config=require(_0xf1b6('0x7'));var attributes=require(_0xf1b6('0x8'));module[_0xf1b6('0x9')]=function(_0x5d87c4,_0x55b45a){return _0x5d87c4[_0xf1b6('0xa')](_0xf1b6('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xf1b6('0xc'),'fields':[_0xf1b6('0xd'),_0xf1b6('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc49e=['request-promise','path','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment'];(function(_0xea937e,_0x5642f2){var _0x3a2fb4=function(_0xdc215e){while(--_0xdc215e){_0xea937e['push'](_0xea937e['shift']());}};_0x3a2fb4(++_0x5642f2);}(_0xc49e,0x1bd));var _0xec49=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xc49e[_0x1ae5ab];return _0x1ce001;};'use strict';var _=require(_0xec49('0x0'));var util=require(_0xec49('0x1'));var logger=require(_0xec49('0x2'))(_0xec49('0x3'));var moment=require(_0xec49('0x4'));var BPromise=require('bluebird');var rp=require(_0xec49('0x5'));var fs=require('fs');var path=require(_0xec49('0x6'));var rimraf=require(_0xec49('0x7'));var config=require(_0xec49('0x8'));var attributes=require('./userProfileSection.attributes');module[_0xec49('0x9')]=function(_0x29579e,_0x4b34ef){return _0x29579e[_0xec49('0xa')](_0xec49('0xb'),attributes,{'tableName':_0xec49('0xc'),'paranoid':![],'indexes':[{'name':_0xec49('0xd'),'fields':[_0xec49('0xe'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fade5bc..17da188 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 _0x0094=['info','UserProfileSection,\x20%s,\x20%s','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x22243f,_0x275a2f){var _0x3c057b=function(_0x3ca183){while(--_0x3ca183){_0x22243f['push'](_0x22243f['shift']());}};_0x3c057b(++_0x275a2f);}(_0x0094,0x184));var _0x4009=function(_0x308425,_0x4876b4){_0x308425=_0x308425-0x0;var _0x351d53=_0x0094[_0x308425];return _0x351d53;};'use strict';var _=require(_0x4009('0x0'));var util=require(_0x4009('0x1'));var moment=require('moment');var BPromise=require(_0x4009('0x2'));var rs=require(_0x4009('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4009('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4009('0x5'))(_0x4009('0x6'));var config=require(_0x4009('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4009('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1990cf,_0x100e3b,_0x1a3d94){return new BPromise(function(_0x211603,_0x147b24){return client[_0x4009('0x9')](_0x1990cf,_0x1a3d94)[_0x4009('0xa')](function(_0x374682){logger[_0x4009('0xb')](_0x4009('0xc'),_0x100e3b,'request\x20sent');logger['debug'](_0x4009('0xd'),_0x100e3b,'request\x20sent',JSON[_0x4009('0xe')](_0x374682));if(_0x374682['error']){if(_0x374682['error'][_0x4009('0xf')]===0x1f4){logger[_0x4009('0x10')](_0x4009('0xc'),_0x100e3b,_0x374682[_0x4009('0x10')][_0x4009('0x11')]);return _0x147b24(_0x374682[_0x4009('0x10')]['message']);}logger['error'](_0x4009('0xc'),_0x100e3b,_0x374682[_0x4009('0x10')][_0x4009('0x11')]);return _0x211603(_0x374682[_0x4009('0x10')][_0x4009('0x11')]);}else{logger['info'](_0x4009('0xc'),_0x100e3b,_0x4009('0x12'));_0x211603(_0x374682[_0x4009('0x13')][_0x4009('0x11')]);}})[_0x4009('0x14')](function(_0x3392e0){logger[_0x4009('0x10')](_0x4009('0xc'),_0x100e3b,_0x3392e0);_0x147b24(_0x3392e0);});});} \ No newline at end of file +var _0xba77=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xc80b70,_0x2ea72a){var _0x11679f=function(_0x244c64){while(--_0x244c64){_0xc80b70['push'](_0xc80b70['shift']());}};_0x11679f(++_0x2ea72a);}(_0xba77,0x133));var _0x7ba7=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xba77[_0x1e6db3];return _0x1de886;};'use strict';var _=require(_0x7ba7('0x0'));var util=require(_0x7ba7('0x1'));var moment=require(_0x7ba7('0x2'));var BPromise=require(_0x7ba7('0x3'));var rs=require(_0x7ba7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ba7('0x5'))['db'];var utils=require(_0x7ba7('0x6'));var logger=require(_0x7ba7('0x7'))(_0x7ba7('0x8'));var config=require(_0x7ba7('0x9'));var jayson=require(_0x7ba7('0xa'));var client=jayson[_0x7ba7('0xb')][_0x7ba7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1425d7,_0x1f6427,_0x21331f){return new BPromise(function(_0x3a47a9,_0x488e73){return client[_0x7ba7('0xd')](_0x1425d7,_0x21331f)[_0x7ba7('0xe')](function(_0x5b968d){logger[_0x7ba7('0xf')](_0x7ba7('0x10'),_0x1f6427,_0x7ba7('0x11'));logger[_0x7ba7('0x12')](_0x7ba7('0x13'),_0x1f6427,_0x7ba7('0x11'),JSON[_0x7ba7('0x14')](_0x5b968d));if(_0x5b968d[_0x7ba7('0x15')]){if(_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x16')]===0x1f4){logger[_0x7ba7('0x15')](_0x7ba7('0x10'),_0x1f6427,_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);return _0x488e73(_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);}logger[_0x7ba7('0x15')](_0x7ba7('0x10'),_0x1f6427,_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);return _0x3a47a9(_0x5b968d[_0x7ba7('0x15')][_0x7ba7('0x17')]);}else{logger[_0x7ba7('0xf')](_0x7ba7('0x10'),_0x1f6427,_0x7ba7('0x11'));_0x3a47a9(_0x5b968d[_0x7ba7('0x18')]['message']);}})[_0x7ba7('0x19')](function(_0x2e5d7e){logger[_0x7ba7('0x15')](_0x7ba7('0x10'),_0x1f6427,_0x2e5d7e);_0x488e73(_0x2e5d7e);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 9b91004..3050a2b 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x530eb4,_0x2900cd){var _0x4c0982=function(_0x2912a5){while(--_0x2912a5){_0x530eb4['push'](_0x530eb4['shift']());}};_0x4c0982(++_0x2900cd);}(_0x70e0,0x17b));var _0x070e=function(_0x230500,_0x27f006){_0x230500=_0x230500-0x0;var _0x4b2604=_0x70e0[_0x230500];return _0x4b2604;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e33f758..baf4d77 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 _0x55a8=['INTEGER','sequelize','exports'];(function(_0x29ecbc,_0x2929d9){var _0x5709b0=function(_0x277721){while(--_0x277721){_0x29ecbc['push'](_0x29ecbc['shift']());}};_0x5709b0(++_0x2929d9);}(_0x55a8,0x148));var _0x855a=function(_0x56c17b,_0x1b241e){_0x56c17b=_0x56c17b-0x0;var _0x5a3082=_0x55a8[_0x56c17b];return _0x5a3082;};'use strict';var Sequelize=require(_0x855a('0x0'));module[_0x855a('0x1')]={'penalty':{'type':Sequelize[_0x855a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9963=['INTEGER','sequelize','exports'];(function(_0x16e1ed,_0x177714){var _0xef3e0a=function(_0xe8e638){while(--_0xe8e638){_0x16e1ed['push'](_0x16e1ed['shift']());}};_0xef3e0a(++_0x177714);}(_0x9963,0x1c0));var _0x3996=function(_0x397bfb,_0x589665){_0x397bfb=_0x397bfb-0x0;var _0x16c9b9=_0x9963[_0x397bfb];return _0x16c9b9;};'use strict';var Sequelize=require(_0x3996('0x0'));module[_0x3996('0x1')]={'penalty':{'type':Sequelize[_0x3996('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 5c86551..507b698 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 _0xdf55=['util','api','moment','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xdf55,0x83));var _0x5df5=function(_0x4dcef2,_0x52845d){_0x4dcef2=_0x4dcef2-0x0;var _0xe80f33=_0xdf55[_0x4dcef2];return _0xe80f33;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var logger=require('../../config/logger')(_0x5df5('0x2'));var moment=require(_0x5df5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5df5('0x4'));var fs=require('fs');var path=require(_0x5df5('0x5'));var rimraf=require(_0x5df5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5df5('0x7'));module[_0x5df5('0x8')]=function(_0x27ec86,_0x476e21){return _0x27ec86[_0x5df5('0x9')](_0x5df5('0xa'),attributes,{'tableName':_0x5df5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb511=['rimraf','../../config/environment','exports','define','UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb511,0x165));var _0x1b51=function(_0x458f56,_0x3c646e){_0x458f56=_0x458f56-0x0;var _0x582c1c=_0xb511[_0x458f56];return _0x582c1c;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 60fcacd..bcbeef4 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 _0x5c75=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x487502,_0x3f04fc){var _0x10e55d=function(_0x503b20){while(--_0x503b20){_0x487502['push'](_0x487502['shift']());}};_0x10e55d(++_0x3f04fc);}(_0x5c75,0xc8));var _0x55c7=function(_0x11dee9,_0x500fad){_0x11dee9=_0x11dee9-0x0;var _0x4fdcad=_0x5c75[_0x11dee9];return _0x4fdcad;};'use strict';var _=require('lodash');var util=require(_0x55c7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55c7('0x1'));var db=require(_0x55c7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x55c7('0x3'))(_0x55c7('0x4'));var config=require(_0x55c7('0x5'));var jayson=require(_0x55c7('0x6'));var client=jayson[_0x55c7('0x7')][_0x55c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x484b02,_0x48c859,_0x2bdd7f){return new BPromise(function(_0x49cf63,_0x490653){return client[_0x55c7('0x9')](_0x484b02,_0x2bdd7f)['then'](function(_0x50fa74){logger[_0x55c7('0xa')](_0x55c7('0xb'),_0x48c859,_0x55c7('0xc'));logger[_0x55c7('0xd')](_0x55c7('0xe'),_0x48c859,_0x55c7('0xc'),JSON[_0x55c7('0xf')](_0x50fa74));if(_0x50fa74[_0x55c7('0x10')]){if(_0x50fa74[_0x55c7('0x10')][_0x55c7('0x11')]===0x1f4){logger[_0x55c7('0x10')](_0x55c7('0xb'),_0x48c859,_0x50fa74[_0x55c7('0x10')][_0x55c7('0x12')]);return _0x490653(_0x50fa74['error'][_0x55c7('0x12')]);}logger[_0x55c7('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x48c859,_0x50fa74[_0x55c7('0x10')][_0x55c7('0x12')]);return _0x49cf63(_0x50fa74[_0x55c7('0x10')][_0x55c7('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x48c859,'request\x20sent');_0x49cf63(_0x50fa74[_0x55c7('0x13')]['message']);}})[_0x55c7('0x14')](function(_0x4e55ce){logger[_0x55c7('0x10')](_0x55c7('0xb'),_0x48c859,_0x4e55ce);_0x490653(_0x4e55ce);});});} \ No newline at end of file +var _0x3cf9=['../../config/utils','../../config/logger','../../config/environment','http','then','info','UserSmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2e250f,_0x163411){var _0x3c4935=function(_0x35bfb5){while(--_0x35bfb5){_0x2e250f['push'](_0x2e250f['shift']());}};_0x3c4935(++_0x163411);}(_0x3cf9,0xea));var _0x93cf=function(_0x514c24,_0x4f0170){_0x514c24=_0x514c24-0x0;var _0x4db7e5=_0x3cf9[_0x514c24];return _0x4db7e5;};'use strict';var _=require(_0x93cf('0x0'));var util=require(_0x93cf('0x1'));var moment=require(_0x93cf('0x2'));var BPromise=require('bluebird');var rs=require(_0x93cf('0x3'));var fs=require('fs');var Redis=require(_0x93cf('0x4'));var db=require(_0x93cf('0x5'))['db'];var utils=require(_0x93cf('0x6'));var logger=require(_0x93cf('0x7'))('rpc');var config=require(_0x93cf('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x93cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50493b,_0x5b4289,_0x4dbf8b){return new BPromise(function(_0x285988,_0x5b13b4){return client['request'](_0x50493b,_0x4dbf8b)[_0x93cf('0xa')](function(_0x636574){logger[_0x93cf('0xb')](_0x93cf('0xc'),_0x5b4289,'request\x20sent');logger[_0x93cf('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5b4289,_0x93cf('0xe'),JSON[_0x93cf('0xf')](_0x636574));if(_0x636574[_0x93cf('0x10')]){if(_0x636574[_0x93cf('0x10')][_0x93cf('0x11')]===0x1f4){logger[_0x93cf('0x10')](_0x93cf('0xc'),_0x5b4289,_0x636574[_0x93cf('0x10')][_0x93cf('0x12')]);return _0x5b13b4(_0x636574[_0x93cf('0x10')]['message']);}logger['error'](_0x93cf('0xc'),_0x5b4289,_0x636574[_0x93cf('0x10')][_0x93cf('0x12')]);return _0x285988(_0x636574[_0x93cf('0x10')][_0x93cf('0x12')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x5b4289,'request\x20sent');_0x285988(_0x636574[_0x93cf('0x13')][_0x93cf('0x12')]);}})['catch'](function(_0x149801){logger[_0x93cf('0x10')](_0x93cf('0xc'),_0x5b4289,_0x149801);_0x5b13b4(_0x149801);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 7e2c499..4c6ce86 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 _0x2d07=['INTEGER','sequelize','exports'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x2d07,0x199));var _0x72d0=function(_0x216008,_0x2d1023){_0x216008=_0x216008-0x0;var _0x4d384f=_0x2d07[_0x216008];return _0x4d384f;};'use strict';var Sequelize=require(_0x72d0('0x0'));module[_0x72d0('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x72d0('0x2')]}}; \ No newline at end of file +var _0xc825=['exports','INTEGER','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc825,0x104));var _0x5c82=function(_0x16be84,_0x12fc54){_0x16be84=_0x16be84-0x0;var _0x228aa8=_0xc825[_0x16be84];return _0x228aa8;};'use strict';var Sequelize=require(_0x5c82('0x0'));module[_0x5c82('0x1')]={'UserId':{'type':Sequelize[_0x5c82('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x5c82('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index f850f96..9b5b5a5 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(_0x1e48af,_0x11d956){var _0x1d1f36=function(_0x4dd1fd){while(--_0x4dd1fd){_0x1e48af['push'](_0x1e48af['shift']());}};_0x1d1f36(++_0x11d956);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x10f869,_0x4a83d5){var _0x2e9bdf=function(_0x1c5021){while(--_0x1c5021){_0x10f869['push'](_0x10f869['shift']());}};_0x2e9bdf(++_0x4a83d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index f59c7eb..0378c2f 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2ba00c,_0x182642){var _0x21712b=function(_0x1bcf8e){while(--_0x1bcf8e){_0x2ba00c['push'](_0x2ba00c['shift']());}};_0x21712b(++_0x182642);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1f6a87,_0x31aa8d){var _0x4db6f0=function(_0x46321a){while(--_0x46321a){_0x1f6a87['push'](_0x1f6a87['shift']());}};_0x4db6f0(++_0x31aa8d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 50bbf2c..ff02120 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 _0x8853=['INTEGER','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8853,0x1a8));var _0x3885=function(_0x1ae06f,_0x5b7a6c){_0x1ae06f=_0x1ae06f-0x0;var _0x429688=_0x8853[_0x1ae06f];return _0x429688;};'use strict';var Sequelize=require(_0x3885('0x0'));module[_0x3885('0x1')]={'penalty':{'type':Sequelize[_0x3885('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc3ec=['exports','INTEGER'];(function(_0x53f0db,_0x35c67c){var _0xae0a5c=function(_0x4bd6fb){while(--_0x4bd6fb){_0x53f0db['push'](_0x53f0db['shift']());}};_0xae0a5c(++_0x35c67c);}(_0xc3ec,0x74));var _0xcc3e=function(_0x428765,_0x57800a){_0x428765=_0x428765-0x0;var _0x4644b3=_0xc3ec[_0x428765];return _0x4644b3;};'use strict';var Sequelize=require('sequelize');module[_0xcc3e('0x0')]={'penalty':{'type':Sequelize[_0xcc3e('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 0f0f943..b24b6b4 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 _0xe6fa=['user_has_voice_queues','lodash','util','bluebird','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x530a18,_0x46b804){var _0x56191c=function(_0xc735ff){while(--_0xc735ff){_0x530a18['push'](_0x530a18['shift']());}};_0x56191c(++_0x46b804);}(_0xe6fa,0x19b));var _0xae6f=function(_0x53a629,_0x1d0e1c){_0x53a629=_0x53a629-0x0;var _0x37a5fc=_0xe6fa[_0x53a629];return _0x37a5fc;};'use strict';var _=require(_0xae6f('0x0'));var util=require(_0xae6f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae6f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xae6f('0x3'));var config=require(_0xae6f('0x4'));var attributes=require(_0xae6f('0x5'));module[_0xae6f('0x6')]=function(_0x1b1034,_0x2df1aa){return _0x1b1034[_0xae6f('0x7')](_0xae6f('0x8'),attributes,{'tableName':_0xae6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ca5=['util','../../config/logger','api','path','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x5d2d9c,_0x56b942){var _0x25b6b8=function(_0x984a93){while(--_0x984a93){_0x5d2d9c['push'](_0x5d2d9c['shift']());}};_0x25b6b8(++_0x56b942);}(_0x0ca5,0x1a3));var _0x50ca=function(_0x278864,_0x2fffd9){_0x278864=_0x278864-0x0;var _0x3260c6=_0x0ca5[_0x278864];return _0x3260c6;};'use strict';var _=require(_0x50ca('0x0'));var util=require(_0x50ca('0x1'));var logger=require(_0x50ca('0x2'))(_0x50ca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x50ca('0x4'));var rimraf=require('rimraf');var config=require(_0x50ca('0x5'));var attributes=require(_0x50ca('0x6'));module[_0x50ca('0x7')]=function(_0x136b32,_0x16d737){return _0x136b32['define'](_0x50ca('0x8'),attributes,{'tableName':_0x50ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 20d3ecf..086afd2 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 _0x1f36=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3e665d,_0xef863d){var _0x24a155=function(_0x1343e7){while(--_0x1343e7){_0x3e665d['push'](_0x3e665d['shift']());}};_0x24a155(++_0xef863d);}(_0x1f36,0x129));var _0x61f3=function(_0x193685,_0x2802b5){_0x193685=_0x193685-0x0;var _0x159aaa=_0x1f36[_0x193685];return _0x159aaa;};'use strict';var _=require(_0x61f3('0x0'));var util=require(_0x61f3('0x1'));var moment=require(_0x61f3('0x2'));var BPromise=require(_0x61f3('0x3'));var rs=require(_0x61f3('0x4'));var fs=require('fs');var Redis=require(_0x61f3('0x5'));var db=require(_0x61f3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x61f3('0x7'))(_0x61f3('0x8'));var config=require(_0x61f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x61f3('0xa')][_0x61f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5905ef,_0x5959a2,_0xbcc617){return new BPromise(function(_0x456f8f,_0x34ebaa){return client[_0x61f3('0xc')](_0x5905ef,_0xbcc617)['then'](function(_0xec3ed3){logger['info'](_0x61f3('0xd'),_0x5959a2,_0x61f3('0xe'));logger[_0x61f3('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5959a2,_0x61f3('0xe'),JSON[_0x61f3('0x10')](_0xec3ed3));if(_0xec3ed3['error']){if(_0xec3ed3[_0x61f3('0x11')][_0x61f3('0x12')]===0x1f4){logger[_0x61f3('0x11')](_0x61f3('0xd'),_0x5959a2,_0xec3ed3[_0x61f3('0x11')]['message']);return _0x34ebaa(_0xec3ed3[_0x61f3('0x11')][_0x61f3('0x13')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x5959a2,_0xec3ed3[_0x61f3('0x11')]['message']);return _0x456f8f(_0xec3ed3[_0x61f3('0x11')][_0x61f3('0x13')]);}else{logger['info'](_0x61f3('0xd'),_0x5959a2,_0x61f3('0xe'));_0x456f8f(_0xec3ed3[_0x61f3('0x14')][_0x61f3('0x13')]);}})['catch'](function(_0x4cadc4){logger[_0x61f3('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x5959a2,_0x4cadc4);_0x34ebaa(_0x4cadc4);});});} \ No newline at end of file +var _0xd1f5=['../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x3b57d2,_0x440aa9){var _0x5a133f=function(_0x1844a9){while(--_0x1844a9){_0x3b57d2['push'](_0x3b57d2['shift']());}};_0x5a133f(++_0x440aa9);}(_0xd1f5,0x6c));var _0x5d1f=function(_0x521825,_0x34b368){_0x521825=_0x521825-0x0;var _0x140d49=_0xd1f5[_0x521825];return _0x140d49;};'use strict';var _=require('lodash');var util=require(_0x5d1f('0x0'));var moment=require(_0x5d1f('0x1'));var BPromise=require(_0x5d1f('0x2'));var rs=require(_0x5d1f('0x3'));var fs=require('fs');var Redis=require(_0x5d1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d1f('0x5'));var logger=require('../../config/logger')(_0x5d1f('0x6'));var config=require(_0x5d1f('0x7'));var jayson=require(_0x5d1f('0x8'));var client=jayson[_0x5d1f('0x9')][_0x5d1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x334317,_0x21a30,_0x5ea3d9){return new BPromise(function(_0x3c06eb,_0x4c85b4){return client[_0x5d1f('0xb')](_0x334317,_0x5ea3d9)[_0x5d1f('0xc')](function(_0x561964){logger['info'](_0x5d1f('0xd'),_0x21a30,_0x5d1f('0xe'));logger[_0x5d1f('0xf')](_0x5d1f('0x10'),_0x21a30,_0x5d1f('0xe'),JSON[_0x5d1f('0x11')](_0x561964));if(_0x561964[_0x5d1f('0x12')]){if(_0x561964['error']['code']===0x1f4){logger[_0x5d1f('0x12')](_0x5d1f('0xd'),_0x21a30,_0x561964[_0x5d1f('0x12')][_0x5d1f('0x13')]);return _0x4c85b4(_0x561964[_0x5d1f('0x12')][_0x5d1f('0x13')]);}logger['error'](_0x5d1f('0xd'),_0x21a30,_0x561964[_0x5d1f('0x12')]['message']);return _0x3c06eb(_0x561964['error'][_0x5d1f('0x13')]);}else{logger[_0x5d1f('0x14')](_0x5d1f('0xd'),_0x21a30,'request\x20sent');_0x3c06eb(_0x561964[_0x5d1f('0x15')][_0x5d1f('0x13')]);}})[_0x5d1f('0x16')](function(_0x188350){logger[_0x5d1f('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x21a30,_0x188350);_0x4c85b4(_0x188350);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 59e8c1b..3e12dfa 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x238d90,_0x55ab60){var _0x46388a=function(_0x1ea450){while(--_0x1ea450){_0x238d90['push'](_0x238d90['shift']());}};_0x46388a(++_0x55ab60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fa7da,_0x82cb97){var _0x809b2f=function(_0x8fb22a){while(--_0x8fb22a){_0x1fa7da['push'](_0x1fa7da['shift']());}};_0x809b2f(++_0x82cb97);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d2faad5..4ad08d6 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 _0x170a=['STRING','queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0x170a,0xed));var _0xa170=function(_0x135dcb,_0x26ca64){_0x135dcb=_0x135dcb-0x0;var _0x2a0efb=_0x170a[_0x135dcb];return _0x2a0efb;};'use strict';var Sequelize=require(_0xa170('0x0'));module[_0xa170('0x1')]={'uniqueid':{'type':Sequelize[_0xa170('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xa170('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xa170('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa170('0x4'),'comment':_0xa170('0x5')},'VoiceQueueId':{'type':Sequelize[_0xa170('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xa170('0x3')],'allowNull':![],'unique':_0xa170('0x4'),'comment':_0xa170('0x5')},'penalty':{'type':Sequelize[_0xa170('0x2')](0xb),'defaultValue':0x0,'comment':_0xa170('0x5')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa170('0x5')}}; \ No newline at end of file +var _0x556a=['Required\x20by\x20Asterisk','queue_interface','INTEGER','STRING'];(function(_0x2fc739,_0x51e04f){var _0xb1753=function(_0x4af380){while(--_0x4af380){_0x2fc739['push'](_0x2fc739['shift']());}};_0xb1753(++_0x51e04f);}(_0x556a,0x14e));var _0xa556=function(_0x2febde,_0x3fbc16){_0x2febde=_0x2febde-0x0;var _0x41cab8=_0x556a[_0x2febde];return _0x41cab8;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa556('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xa556('0x1')],'allowNull':![],'comment':_0xa556('0x2')},'UserId':{'type':Sequelize[_0xa556('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa556('0x1')],'allowNull':![],'unique':_0xa556('0x3'),'comment':_0xa556('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa556('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xa556('0x0')](0xb),'defaultValue':0x0,'comment':_0xa556('0x2')},'paused':{'type':Sequelize[_0xa556('0x0')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index fe462dc..b36112f 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 _0x7c83=['setMaxListeners','update','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x316cf,_0x32210c){var _0x513863=function(_0x1ae58b){while(--_0x1ae58b){_0x316cf['push'](_0x316cf['shift']());}};_0x513863(++_0x32210c);}(_0x7c83,0x7c));var _0x37c8=function(_0x176003,_0x2c5488){_0x176003=_0x176003-0x0;var _0x1210fe=_0x7c83[_0x176003];return _0x1210fe;};'use strict';var EventEmitter=require(_0x37c8('0x0'));var UserVoiceQueueRt=require(_0x37c8('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x37c8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x37c8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3e1bf2){return function(_0x42cfc5,_0x21e052,_0x8580d5){UserVoiceQueueRtEvents['emit'](_0x3e1bf2+':'+_0x42cfc5['id'],_0x42cfc5);UserVoiceQueueRtEvents['emit'](_0x3e1bf2,_0x42cfc5);_0x8580d5(null);};}for(var e in events){if(events[_0x37c8('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0x37c8('0x5')](e,emitEvent(event));}}module[_0x37c8('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x630a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x1be69f,_0x29e787){var _0x1d70d0=function(_0x1e6b17){while(--_0x1e6b17){_0x1be69f['push'](_0x1be69f['shift']());}};_0x1d70d0(++_0x29e787);}(_0x630a,0x147));var _0xa630=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x630a[_0x308213];return _0x2e1619;};'use strict';var EventEmitter=require(_0xa630('0x0'));var UserVoiceQueueRt=require(_0xa630('0x1'))['db'][_0xa630('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa630('0x3')](0x0);var events={'afterCreate':_0xa630('0x4'),'afterUpdate':_0xa630('0x5'),'afterDestroy':_0xa630('0x6')};function emitEvent(_0x475dd3){return function(_0x4bae42,_0x187193,_0x5271ca){UserVoiceQueueRtEvents[_0xa630('0x7')](_0x475dd3+':'+_0x4bae42['id'],_0x4bae42);UserVoiceQueueRtEvents[_0xa630('0x7')](_0x475dd3,_0x4bae42);_0x5271ca(null);};}for(var e in events){if(events[_0xa630('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xa630('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 5572692..84bca31 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 _0x2603=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','lodash','util','moment','bluebird','path'];(function(_0x9babe0,_0x454b48){var _0xfe2032=function(_0x20adc4){while(--_0x20adc4){_0x9babe0['push'](_0x9babe0['shift']());}};_0xfe2032(++_0x454b48);}(_0x2603,0x19f));var _0x3260=function(_0x2b60bd,_0x49418d){_0x2b60bd=_0x2b60bd-0x0;var _0x3d9523=_0x2603[_0x2b60bd];return _0x3d9523;};'use strict';var _=require(_0x3260('0x0'));var util=require(_0x3260('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3260('0x2'));var BPromise=require(_0x3260('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3260('0x4'));var rimraf=require(_0x3260('0x5'));var config=require(_0x3260('0x6'));var attributes=require(_0x3260('0x7'));module['exports']=function(_0x460de5,_0x2746b5){return _0x460de5[_0x3260('0x8')](_0x3260('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x028e=['./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','util','api','bluebird','request-promise','../../config/environment'];(function(_0x361c9f,_0x22d180){var _0x4c74a4=function(_0x12d73f){while(--_0x12d73f){_0x361c9f['push'](_0x361c9f['shift']());}};_0x4c74a4(++_0x22d180);}(_0x028e,0x79));var _0xe028=function(_0x40eb86,_0x35fd71){_0x40eb86=_0x40eb86-0x0;var _0x187e1c=_0x028e[_0x40eb86];return _0x187e1c;};'use strict';var _=require('lodash');var util=require(_0xe028('0x0'));var logger=require('../../config/logger')(_0xe028('0x1'));var moment=require('moment');var BPromise=require(_0xe028('0x2'));var rp=require(_0xe028('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe028('0x4'));var attributes=require(_0xe028('0x5'));module[_0xe028('0x6')]=function(_0xb231b2,_0x5a8f53){return _0xb231b2[_0xe028('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xe028('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 15272e1..f1f7bef 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 _0x6a1c=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','localhost','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x521e05,_0x57b759){var _0x2790ff=function(_0x412403){while(--_0x412403){_0x521e05['push'](_0x521e05['shift']());}};_0x2790ff(++_0x57b759);}(_0x6a1c,0x161));var _0xc6a1=function(_0x480898,_0x4b7474){_0x480898=_0x480898-0x0;var _0x2e74a3=_0x6a1c[_0x480898];return _0x2e74a3;};'use strict';var _=require(_0xc6a1('0x0'));var util=require(_0xc6a1('0x1'));var moment=require('moment');var BPromise=require(_0xc6a1('0x2'));var rs=require(_0xc6a1('0x3'));var fs=require('fs');var Redis=require(_0xc6a1('0x4'));var db=require(_0xc6a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6a1('0x6'))('rpc');var config=require(_0xc6a1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc6a1('0x8')][_0xc6a1('0x9')]({'port':0x232a});config[_0xc6a1('0xa')]=_['defaults'](config[_0xc6a1('0xa')],{'host':_0xc6a1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc6a1('0xa')]));require(_0xc6a1('0xc'))['register'](socket);function respondWithRpcPromise(_0x3ca402,_0x264a59,_0x445ced){return new BPromise(function(_0x233eea,_0x483b32){return client[_0xc6a1('0xd')](_0x3ca402,_0x445ced)[_0xc6a1('0xe')](function(_0x574e0e){logger[_0xc6a1('0xf')](_0xc6a1('0x10'),_0x264a59,_0xc6a1('0x11'));logger[_0xc6a1('0x12')](_0xc6a1('0x13'),_0x264a59,_0xc6a1('0x11'),JSON[_0xc6a1('0x14')](_0x574e0e));if(_0x574e0e[_0xc6a1('0x15')]){if(_0x574e0e[_0xc6a1('0x15')]['code']===0x1f4){logger['error'](_0xc6a1('0x10'),_0x264a59,_0x574e0e['error']['message']);return _0x483b32(_0x574e0e['error'][_0xc6a1('0x16')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x264a59,_0x574e0e[_0xc6a1('0x15')]['message']);return _0x233eea(_0x574e0e[_0xc6a1('0x15')][_0xc6a1('0x16')]);}else{logger[_0xc6a1('0xf')](_0xc6a1('0x10'),_0x264a59,_0xc6a1('0x11'));_0x233eea(_0x574e0e['result']['message']);}})['catch'](function(_0x409880){logger[_0xc6a1('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x264a59,_0x409880);_0x483b32(_0x409880);});});}exports[_0xc6a1('0x17')]=function(_0x23b4a6){var _0x3ffd3d=this;return new Promise(function(_0x39549d,_0x18e122){return db[_0xc6a1('0x18')]['findAll']({'raw':_0x23b4a6[_0xc6a1('0x19')]?_0x23b4a6['options']['raw']===undefined?!![]:![]:!![],'where':_0x23b4a6[_0xc6a1('0x19')]?_0x23b4a6['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xc6a1('0x1a'),db[_0xc6a1('0x1b')]['fn']('IF',db[_0xc6a1('0x1b')][_0xc6a1('0x1c')](_0xc6a1('0x1d')))),_0xc6a1('0x1e')]]})[_0xc6a1('0xe')](function(_0x94f991){logger[_0xc6a1('0xf')](_0xc6a1('0x17'),_0x23b4a6);logger['debug'](_0xc6a1('0x17'),_0x23b4a6,JSON[_0xc6a1('0x14')](_0x94f991));_0x39549d(_0x94f991);})[_0xc6a1('0x1f')](function(_0x220f38){logger[_0xc6a1('0x15')](_0xc6a1('0x17'),_0x220f38['message'],_0x23b4a6);_0x18e122(_0x3ffd3d[_0xc6a1('0x15')](0x1f4,_0x220f38[_0xc6a1('0x16')]));});});}; \ No newline at end of file +var _0x791c=['outboundQueuePauses','info','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null'];(function(_0xef607f,_0x158ce5){var _0x12394d=function(_0x24c098){while(--_0x24c098){_0xef607f['push'](_0xef607f['shift']());}};_0x12394d(++_0x158ce5);}(_0x791c,0x1bc));var _0xc791=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0x791c[_0x3f3bad];return _0x4f0801;};'use strict';var _=require('lodash');var util=require(_0xc791('0x0'));var moment=require(_0xc791('0x1'));var BPromise=require(_0xc791('0x2'));var rs=require(_0xc791('0x3'));var fs=require('fs');var Redis=require(_0xc791('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc791('0x5'));var logger=require(_0xc791('0x6'))(_0xc791('0x7'));var config=require(_0xc791('0x8'));var jayson=require(_0xc791('0x9'));var client=jayson[_0xc791('0xa')][_0xc791('0xb')]({'port':0x232a});config[_0xc791('0xc')]=_['defaults'](config[_0xc791('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc791('0xc')]));require('./userVoiceQueueRt.socket')[_0xc791('0xd')](socket);function respondWithRpcPromise(_0x30d66b,_0x2fb1d7,_0x5633fe){return new BPromise(function(_0x9909df,_0x1aa0f1){return client['request'](_0x30d66b,_0x5633fe)[_0xc791('0xe')](function(_0x2aa820){logger['info'](_0xc791('0xf'),_0x2fb1d7,'request\x20sent');logger[_0xc791('0x10')](_0xc791('0x11'),_0x2fb1d7,'request\x20sent',JSON[_0xc791('0x12')](_0x2aa820));if(_0x2aa820[_0xc791('0x13')]){if(_0x2aa820['error'][_0xc791('0x14')]===0x1f4){logger[_0xc791('0x13')](_0xc791('0xf'),_0x2fb1d7,_0x2aa820['error']['message']);return _0x1aa0f1(_0x2aa820[_0xc791('0x13')][_0xc791('0x15')]);}logger[_0xc791('0x13')](_0xc791('0xf'),_0x2fb1d7,_0x2aa820[_0xc791('0x13')]['message']);return _0x9909df(_0x2aa820[_0xc791('0x13')]['message']);}else{logger['info'](_0xc791('0xf'),_0x2fb1d7,'request\x20sent');_0x9909df(_0x2aa820[_0xc791('0x16')][_0xc791('0x15')]);}})[_0xc791('0x17')](function(_0xa12953){logger[_0xc791('0x13')](_0xc791('0xf'),_0x2fb1d7,_0xa12953);_0x1aa0f1(_0xa12953);});});}exports[_0xc791('0x18')]=function(_0xa5bda7){var _0x1e29f0=this;return new Promise(function(_0x4e6d4e,_0x172202){return db['UserVoiceQueueRt'][_0xc791('0x19')]({'raw':_0xa5bda7[_0xc791('0x1a')]?_0xa5bda7[_0xc791('0x1a')][_0xc791('0x1b')]===undefined?!![]:![]:!![],'where':_0xa5bda7[_0xc791('0x1a')]?_0xa5bda7[_0xc791('0x1a')][_0xc791('0x1c')]||null:null,'attributes':[[db[_0xc791('0x1d')]['fn'](_0xc791('0x1e'),db[_0xc791('0x1d')]['fn']('IF',db[_0xc791('0x1d')]['literal'](_0xc791('0x1f')))),_0xc791('0x20')]]})[_0xc791('0xe')](function(_0x404982){logger[_0xc791('0x21')](_0xc791('0x18'),_0xa5bda7);logger['debug'](_0xc791('0x18'),_0xa5bda7,JSON['stringify'](_0x404982));_0x4e6d4e(_0x404982);})['catch'](function(_0x254e0d){logger[_0xc791('0x13')](_0xc791('0x18'),_0x254e0d[_0xc791('0x15')],_0xa5bda7);_0x172202(_0x1e29f0['error'](0x1f4,_0x254e0d[_0xc791('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 4d40079..b6b1258 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 _0x814b=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x814b,0x1a2));var _0xb814=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x814b[_0xd0a847];return _0x2536ec;};'use strict';var UserVoiceQueueRtEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){UserVoiceQueueRtEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);UserVoiceQueueRtEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x1939=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit'];(function(_0x1ac8d3,_0x31c1cc){var _0x2613fe=function(_0x2fbd09){while(--_0x2fbd09){_0x1ac8d3['push'](_0x1ac8d3['shift']());}};_0x2613fe(++_0x31c1cc);}(_0x1939,0x1d1));var _0x9193=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0x1939[_0x14eb9e];return _0x4c59c4;};'use strict';var UserVoiceQueueRtEvents=require(_0x9193('0x0'));var events=['save',_0x9193('0x1'),_0x9193('0x2')];function createListener(_0x3628d4,_0x538b4c){return function(_0x12643a){_0x538b4c[_0x9193('0x3')](_0x3628d4,_0x12643a);};}function removeListener(_0x31aa3c,_0x35b1c4){return function(){UserVoiceQueueRtEvents['removeListener'](_0x31aa3c,_0x35b1c4);};}exports[_0x9193('0x4')]=function(_0x20ab2b){for(var _0x5186dc=0x0,_0x5f7087=events[_0x9193('0x5')];_0x5186dc<_0x5f7087;_0x5186dc++){var _0x488d01=events[_0x5186dc];var _0x327de5=createListener(_0x9193('0x6')+_0x488d01,_0x20ab2b);UserVoiceQueueRtEvents['on'](_0x488d01,_0x327de5);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d95fc3b..06b202e 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4fab73,_0x6c1609){var _0x17f5d7=function(_0x275b48){while(--_0x275b48){_0x4fab73['push'](_0x4fab73['shift']());}};_0x17f5d7(++_0x6c1609);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x430993,_0x8c8cda){var _0x23e71f=function(_0x1c6dc6){while(--_0x1c6dc6){_0x430993['push'](_0x430993['shift']());}};_0x23e71f(++_0x8c8cda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index b43408b..715f405 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 _0x9837=['sequelize'];(function(_0x25c5a4,_0x1922b9){var _0x3f191b=function(_0x4931f0){while(--_0x4931f0){_0x25c5a4['push'](_0x25c5a4['shift']());}};_0x3f191b(++_0x1922b9);}(_0x9837,0x84));var _0x7983=function(_0x371f76,_0x1b3065){_0x371f76=_0x371f76-0x0;var _0x536ec8=_0x9837[_0x371f76];return _0x536ec8;};'use strict';var Sequelize=require(_0x7983('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc0e1=['sequelize','exports','INTEGER'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xc0e1,0x147));var _0x1c0e=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0xc0e1[_0x3818c0];return _0x55ec33;};'use strict';var Sequelize=require(_0x1c0e('0x0'));module[_0x1c0e('0x1')]={'penalty':{'type':Sequelize[_0x1c0e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index da365f4..87ecca1 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 _0x2ab8=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports'];(function(_0x48f0ce,_0x1897f5){var _0x338961=function(_0x15294c){while(--_0x15294c){_0x48f0ce['push'](_0x48f0ce['shift']());}};_0x338961(++_0x1897f5);}(_0x2ab8,0x114));var _0x82ab=function(_0x48dc08,_0x508b5f){_0x48dc08=_0x48dc08-0x0;var _0x3b8bed=_0x2ab8[_0x48dc08];return _0x3b8bed;};'use strict';var _=require(_0x82ab('0x0'));var util=require(_0x82ab('0x1'));var logger=require(_0x82ab('0x2'))('api');var moment=require(_0x82ab('0x3'));var BPromise=require(_0x82ab('0x4'));var rp=require(_0x82ab('0x5'));var fs=require('fs');var path=require(_0x82ab('0x6'));var rimraf=require(_0x82ab('0x7'));var config=require('../../config/environment');var attributes=require(_0x82ab('0x8'));module[_0x82ab('0x9')]=function(_0x36e8dc,_0xc560fb){return _0x36e8dc[_0x82ab('0xa')](_0x82ab('0xb'),attributes,{'tableName':_0x82ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbdd=['bluebird','path','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0xd31b4e,_0x3eae5d){var _0x308965=function(_0x46e200){while(--_0x46e200){_0xd31b4e['push'](_0xd31b4e['shift']());}};_0x308965(++_0x3eae5d);}(_0xfbdd,0x11b));var _0xdfbd=function(_0x2a443f,_0x198f3d){_0x2a443f=_0x2a443f-0x0;var _0x203565=_0xfbdd[_0x2a443f];return _0x203565;};'use strict';var _=require(_0xdfbd('0x0'));var util=require(_0xdfbd('0x1'));var logger=require(_0xdfbd('0x2'))(_0xdfbd('0x3'));var moment=require(_0xdfbd('0x4'));var BPromise=require(_0xdfbd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfbd('0x6'));var rimraf=require('rimraf');var config=require(_0xdfbd('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xdfbd('0x8')]=function(_0x3b6ae5,_0x43def2){return _0x3b6ae5[_0xdfbd('0x9')](_0xdfbd('0xa'),attributes,{'tableName':_0xdfbd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 231db68..8c5986f 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 _0xbb6c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird'];(function(_0x35517c,_0x17c03f){var _0x4c9d3f=function(_0x5055a1){while(--_0x5055a1){_0x35517c['push'](_0x35517c['shift']());}};_0x4c9d3f(++_0x17c03f);}(_0xbb6c,0xee));var _0xcbb6=function(_0x5ee823,_0x24650b){_0x5ee823=_0x5ee823-0x0;var _0x209bd2=_0xbb6c[_0x5ee823];return _0x209bd2;};'use strict';var _=require('lodash');var util=require(_0xcbb6('0x0'));var moment=require('moment');var BPromise=require(_0xcbb6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbb6('0x2'));var db=require(_0xcbb6('0x3'))['db'];var utils=require(_0xcbb6('0x4'));var logger=require(_0xcbb6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcbb6('0x6')][_0xcbb6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b8406,_0x18f2db,_0x2d5975){return new BPromise(function(_0x227322,_0x28c332){return client[_0xcbb6('0x8')](_0x1b8406,_0x2d5975)[_0xcbb6('0x9')](function(_0x28e79c){logger['info'](_0xcbb6('0xa'),_0x18f2db,_0xcbb6('0xb'));logger[_0xcbb6('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x18f2db,_0xcbb6('0xb'),JSON[_0xcbb6('0xd')](_0x28e79c));if(_0x28e79c[_0xcbb6('0xe')]){if(_0x28e79c[_0xcbb6('0xe')][_0xcbb6('0xf')]===0x1f4){logger[_0xcbb6('0xe')](_0xcbb6('0xa'),_0x18f2db,_0x28e79c[_0xcbb6('0xe')][_0xcbb6('0x10')]);return _0x28c332(_0x28e79c[_0xcbb6('0xe')][_0xcbb6('0x10')]);}logger['error'](_0xcbb6('0xa'),_0x18f2db,_0x28e79c['error'][_0xcbb6('0x10')]);return _0x227322(_0x28e79c[_0xcbb6('0xe')]['message']);}else{logger[_0xcbb6('0x11')](_0xcbb6('0xa'),_0x18f2db,_0xcbb6('0xb'));_0x227322(_0x28e79c[_0xcbb6('0x12')]['message']);}})[_0xcbb6('0x13')](function(_0x4208fb){logger['error'](_0xcbb6('0xa'),_0x18f2db,_0x4208fb);_0x28c332(_0x4208fb);});});} \ No newline at end of file +var _0xa1cc=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x2588b8,_0x185f45){var _0x528595=function(_0x57d1e1){while(--_0x57d1e1){_0x2588b8['push'](_0x2588b8['shift']());}};_0x528595(++_0x185f45);}(_0xa1cc,0x1d1));var _0xca1c=function(_0x367614,_0x1543ba){_0x367614=_0x367614-0x0;var _0x352f18=_0xa1cc[_0x367614];return _0x352f18;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var moment=require(_0xca1c('0x2'));var BPromise=require(_0xca1c('0x3'));var rs=require(_0xca1c('0x4'));var fs=require('fs');var Redis=require(_0xca1c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xca1c('0x6'));var logger=require(_0xca1c('0x7'))(_0xca1c('0x8'));var config=require(_0xca1c('0x9'));var jayson=require(_0xca1c('0xa'));var client=jayson[_0xca1c('0xb')][_0xca1c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x596077,_0x507305,_0x4b6d07){return new BPromise(function(_0x2e9743,_0x364f75){return client[_0xca1c('0xd')](_0x596077,_0x4b6d07)[_0xca1c('0xe')](function(_0x51711a){logger[_0xca1c('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x507305,_0xca1c('0x10'));logger[_0xca1c('0x11')](_0xca1c('0x12'),_0x507305,'request\x20sent',JSON[_0xca1c('0x13')](_0x51711a));if(_0x51711a['error']){if(_0x51711a[_0xca1c('0x14')][_0xca1c('0x15')]===0x1f4){logger[_0xca1c('0x14')](_0xca1c('0x16'),_0x507305,_0x51711a[_0xca1c('0x14')][_0xca1c('0x17')]);return _0x364f75(_0x51711a[_0xca1c('0x14')][_0xca1c('0x17')]);}logger[_0xca1c('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x507305,_0x51711a['error'][_0xca1c('0x17')]);return _0x2e9743(_0x51711a[_0xca1c('0x14')]['message']);}else{logger['info'](_0xca1c('0x16'),_0x507305,_0xca1c('0x10'));_0x2e9743(_0x51711a[_0xca1c('0x18')][_0xca1c('0x17')]);}})[_0xca1c('0x19')](function(_0x431b1c){logger[_0xca1c('0x14')](_0xca1c('0x16'),_0x507305,_0x431b1c);_0x364f75(_0x431b1c);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index fe74718..505383c 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 _0xf3be=['exports','multer','util','path','connect-timeout','Router','./variable.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x3d78ce,_0x83c8a9){var _0x150489=function(_0x16a53b){while(--_0x16a53b){_0x3d78ce['push'](_0x3d78ce['shift']());}};_0x150489(++_0x83c8a9);}(_0xf3be,0x1e1));var _0xef3b=function(_0x3502b2,_0x50af10){_0x3502b2=_0x3502b2-0x0;var _0x53c57a=_0xf3be[_0x3502b2];return _0x53c57a;};'use strict';var multer=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var path=require(_0xef3b('0x2'));var timeout=require(_0xef3b('0x3'));var express=require('express');var router=express[_0xef3b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef3b('0x5'));router[_0xef3b('0x6')]('/',auth['isAuthenticated'](),controller[_0xef3b('0x7')]);router[_0xef3b('0x6')](_0xef3b('0x8'),auth[_0xef3b('0x9')](),controller[_0xef3b('0xa')]);router[_0xef3b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xef3b('0xc')]('/:id',auth[_0xef3b('0x9')](),controller[_0xef3b('0xd')]);router[_0xef3b('0xe')]('/:id',auth[_0xef3b('0x9')](),controller['destroy']);module[_0xef3b('0xf')]=router; \ No newline at end of file +var _0x6108=['isAuthenticated','index','post','create','/:id','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1a0032,_0x5402e5){var _0x1c3d6b=function(_0x28e0f3){while(--_0x28e0f3){_0x1a0032['push'](_0x1a0032['shift']());}};_0x1c3d6b(++_0x5402e5);}(_0x6108,0xbc));var _0x8610=function(_0x44059a,_0x55e414){_0x44059a=_0x44059a-0x0;var _0x2fe09f=_0x6108[_0x44059a];return _0x2fe09f;};'use strict';var multer=require(_0x8610('0x0'));var util=require('util');var path=require(_0x8610('0x1'));var timeout=require(_0x8610('0x2'));var express=require(_0x8610('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8610('0x4'));var interaction=require(_0x8610('0x5'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x8610('0x6')]('/',auth[_0x8610('0x7')](),controller[_0x8610('0x8')]);router[_0x8610('0x6')]('/:id',auth[_0x8610('0x7')](),controller['show']);router[_0x8610('0x9')]('/',auth[_0x8610('0x7')](),controller[_0x8610('0xa')]);router['put'](_0x8610('0xb'),auth[_0x8610('0x7')](),controller[_0x8610('0xc')]);router[_0x8610('0xd')](_0x8610('0xb'),auth[_0x8610('0x7')](),controller['destroy']);module[_0x8610('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 1a040a8..4130a26 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 _0xfdcb=['sequelize','exports','STRING','name'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xfdcb,0x134));var _0xbfdc=function(_0x5cd2ab,_0x2d162b){_0x5cd2ab=_0x5cd2ab-0x0;var _0x4663db=_0xfdcb[_0x5cd2ab];return _0x4663db;};'use strict';var Sequelize=require(_0xbfdc('0x0'));module[_0xbfdc('0x1')]={'name':{'type':Sequelize[_0xbfdc('0x2')],'unique':_0xbfdc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbfdc('0x2')]}}; \ No newline at end of file +var _0xd6a8=['exports','STRING','name','sequelize'];(function(_0x24ca1f,_0x3d2164){var _0x5f4222=function(_0x37b651){while(--_0x37b651){_0x24ca1f['push'](_0x24ca1f['shift']());}};_0x5f4222(++_0x3d2164);}(_0xd6a8,0x9b));var _0x8d6a=function(_0x5caf2b,_0x2ba42f){_0x5caf2b=_0x5caf2b-0x0;var _0x217a0b=_0xd6a8[_0x5caf2b];return _0x217a0b;};'use strict';var Sequelize=require(_0x8d6a('0x0'));module[_0x8d6a('0x1')]={'name':{'type':Sequelize[_0x8d6a('0x2')],'unique':_0x8d6a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index dc43b7c..0bf4843 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 _0x8e76=['UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/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','limit','count','Content-Range','apply','reject','save','then','destroy','get','Variables','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','Variable','includeAll','rows','catch','show','keys','find','create','body','user','role'];(function(_0x3510bf,_0x5479bc){var _0xd187b9=function(_0x3ebc15){while(--_0x3ebc15){_0x3510bf['push'](_0x3510bf['shift']());}};_0xd187b9(++_0x5479bc);}(_0x8e76,0xb3));var _0x68e7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8e76[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x68e7('0x0'));var rimraf=require(_0x68e7('0x1'));var zipdir=require(_0x68e7('0x2'));var jsonpatch=require(_0x68e7('0x3'));var rp=require(_0x68e7('0x4'));var moment=require(_0x68e7('0x5'));var BPromise=require(_0x68e7('0x6'));var Mustache=require(_0x68e7('0x7'));var util=require(_0x68e7('0x8'));var path=require(_0x68e7('0x9'));var sox=require(_0x68e7('0xa'));var csv=require(_0x68e7('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68e7('0xc'));var _=require('lodash');var squel=require(_0x68e7('0xd'));var crypto=require(_0x68e7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x68e7('0xf'));var toCsv=require(_0x68e7('0xb'));var querystring=require(_0x68e7('0x10'));var Papa=require(_0x68e7('0x11'));var Redis=require(_0x68e7('0x12'));var authService=require(_0x68e7('0x13'));var qs=require(_0x68e7('0x14'));var as=require(_0x68e7('0x15'));var hardwareService=require(_0x68e7('0x16'));var logger=require(_0x68e7('0x17'))(_0x68e7('0x18'));var utils=require(_0x68e7('0x19'));var config=require(_0x68e7('0x1a'));var licenseUtil=require(_0x68e7('0x1b'));var db=require(_0x68e7('0x1c'))['db'];function respondWithStatusCode(_0x5b3140,_0x43c018){_0x43c018=_0x43c018||0xcc;return function(_0x25ffc9){if(_0x25ffc9){return _0x5b3140[_0x68e7('0x1d')](_0x43c018);}return _0x5b3140[_0x68e7('0x1e')](_0x43c018)['end']();};}function respondWithResult(_0x527e8b,_0x45fd14){_0x45fd14=_0x45fd14||0xc8;return function(_0x3f44fe){if(_0x3f44fe){return _0x527e8b[_0x68e7('0x1e')](_0x45fd14)[_0x68e7('0x1f')](_0x3f44fe);}};}function respondWithFilteredResult(_0x319f81,_0x5dc1c7){return function(_0x1c638b){if(_0x1c638b){var _0x14d406=typeof _0x5dc1c7[_0x68e7('0x20')]==='undefined'&&typeof _0x5dc1c7[_0x68e7('0x21')]==='undefined';var _0xceff03=_0x1c638b[_0x68e7('0x22')];var _0x4981af=_0x14d406?0x0:_0x5dc1c7[_0x68e7('0x20')];var _0x443f9e=_0x14d406?_0x1c638b['count']:_0x5dc1c7[_0x68e7('0x20')]+_0x5dc1c7['limit'];var _0x2797b3;if(_0x443f9e>=_0xceff03){_0x443f9e=_0xceff03;_0x2797b3=0xc8;}else{_0x2797b3=0xce;}_0x319f81[_0x68e7('0x1e')](_0x2797b3);return _0x319f81['set'](_0x68e7('0x23'),_0x4981af+'-'+_0x443f9e+'/'+_0xceff03)['json'](_0x1c638b);}return null;};}function patchUpdates(_0x498cd9){return function(_0x5c0e11){try{jsonpatch[_0x68e7('0x24')](_0x5c0e11,_0x498cd9,!![]);}catch(_0x48e508){return BPromise[_0x68e7('0x25')](_0x48e508);}return _0x5c0e11[_0x68e7('0x26')]();};}function saveUpdates(_0x5eb4ea,_0x2c2a65){return function(_0x4cea6d){if(_0x4cea6d){return _0x4cea6d['update'](_0x5eb4ea)[_0x68e7('0x27')](function(_0x2f168c){return _0x2f168c;});}return null;};}function removeEntity(_0x3e3917,_0x3e9438){return function(_0x5e3be4){if(_0x5e3be4){return _0x5e3be4[_0x68e7('0x28')]()[_0x68e7('0x27')](function(){var _0x419703=_0x5e3be4[_0x68e7('0x29')]({'plain':!![]});var _0x4517f2=_0x68e7('0x2a');return db[_0x68e7('0x2b')][_0x68e7('0x28')]({'where':{'type':_0x4517f2,'resourceId':_0x419703['id']}})['then'](function(){return _0x5e3be4;});})[_0x68e7('0x27')](function(){_0x3e3917[_0x68e7('0x1e')](0xcc)[_0x68e7('0x2c')]();});}};}function handleEntityNotFound(_0xcc68c7,_0x46c030){return function(_0x1eacd5){if(!_0x1eacd5){_0xcc68c7['sendStatus'](0x194);}return _0x1eacd5;};}function handleError(_0x8c481,_0x125d1a){_0x125d1a=_0x125d1a||0x1f4;return function(_0x5da5e9){logger[_0x68e7('0x2d')](_0x5da5e9[_0x68e7('0x2e')]);if(_0x5da5e9[_0x68e7('0x2f')]){delete _0x5da5e9['name'];}_0x8c481[_0x68e7('0x1e')](_0x125d1a)[_0x68e7('0x30')](_0x5da5e9);};}exports[_0x68e7('0x31')]=function(_0x2bd359,_0x2566a9){var _0x317b20={},_0x1c99f7={},_0x22b7ec={'count':0x0,'rows':[]};var _0x338aca=_[_0x68e7('0x32')](db['Variable'][_0x68e7('0x33')],function(_0x46c419){return{'name':_0x46c419['fieldName'],'type':_0x46c419[_0x68e7('0x34')][_0x68e7('0x35')]};});_0x1c99f7[_0x68e7('0x36')]=_[_0x68e7('0x32')](_0x338aca,'name');_0x1c99f7['query']=_['keys'](_0x2bd359['query']);_0x1c99f7['filters']=_[_0x68e7('0x37')](_0x1c99f7[_0x68e7('0x36')],_0x1c99f7[_0x68e7('0x38')]);_0x317b20[_0x68e7('0x39')]=_[_0x68e7('0x37')](_0x1c99f7[_0x68e7('0x36')],qs[_0x68e7('0x3a')](_0x2bd359[_0x68e7('0x38')]['fields']));_0x317b20[_0x68e7('0x39')]=_0x317b20[_0x68e7('0x39')][_0x68e7('0x3b')]?_0x317b20['attributes']:_0x1c99f7[_0x68e7('0x36')];if(!_0x2bd359[_0x68e7('0x38')][_0x68e7('0x3c')](_0x68e7('0x3d'))){_0x317b20[_0x68e7('0x21')]=qs[_0x68e7('0x21')](_0x2bd359['query'][_0x68e7('0x21')]);_0x317b20[_0x68e7('0x20')]=qs[_0x68e7('0x20')](_0x2bd359[_0x68e7('0x38')][_0x68e7('0x20')]);}_0x317b20[_0x68e7('0x3e')]=qs['sort'](_0x2bd359[_0x68e7('0x38')][_0x68e7('0x3f')]);_0x317b20[_0x68e7('0x40')]=qs['filters'](_[_0x68e7('0x41')](_0x2bd359[_0x68e7('0x38')],_0x1c99f7[_0x68e7('0x42')]),_0x338aca);if(_0x2bd359[_0x68e7('0x38')][_0x68e7('0x43')]){_0x317b20['where']=_[_0x68e7('0x44')](_0x317b20[_0x68e7('0x40')],{'$or':_[_0x68e7('0x32')](_0x338aca,function(_0x3fdf1e){if(_0x3fdf1e[_0x68e7('0x34')]!==_0x68e7('0x45')){var _0x24e58f={};_0x24e58f[_0x3fdf1e[_0x68e7('0x2f')]]={'$like':'%'+_0x2bd359[_0x68e7('0x38')][_0x68e7('0x43')]+'%'};return _0x24e58f;}})});}_0x317b20=_[_0x68e7('0x44')]({},_0x317b20,_0x2bd359[_0x68e7('0x46')]);var _0x2f4dfd={'where':_0x317b20['where']};return db[_0x68e7('0x47')][_0x68e7('0x22')](_0x2f4dfd)[_0x68e7('0x27')](function(_0x5e8ccb){_0x22b7ec[_0x68e7('0x22')]=_0x5e8ccb;if(_0x2bd359[_0x68e7('0x38')][_0x68e7('0x48')]){_0x317b20['include']=[{'all':!![]}];}return db['Variable']['findAll'](_0x317b20);})[_0x68e7('0x27')](function(_0x4a729e){_0x22b7ec[_0x68e7('0x49')]=_0x4a729e;return _0x22b7ec;})[_0x68e7('0x27')](respondWithFilteredResult(_0x2566a9,_0x317b20))[_0x68e7('0x4a')](handleError(_0x2566a9,null));};exports[_0x68e7('0x4b')]=function(_0x5e47f8,_0x5df2ae){var _0x2ee0ed={'raw':!![],'where':{'id':_0x5e47f8['params']['id']}},_0x4cb47f={};_0x4cb47f['model']=_[_0x68e7('0x4c')](db[_0x68e7('0x47')]['rawAttributes']);_0x4cb47f[_0x68e7('0x38')]=_[_0x68e7('0x4c')](_0x5e47f8[_0x68e7('0x38')]);_0x4cb47f[_0x68e7('0x42')]=_['intersection'](_0x4cb47f[_0x68e7('0x36')],_0x4cb47f['query']);_0x2ee0ed['attributes']=_[_0x68e7('0x37')](_0x4cb47f[_0x68e7('0x36')],qs[_0x68e7('0x3a')](_0x5e47f8['query'][_0x68e7('0x3a')]));_0x2ee0ed['attributes']=_0x2ee0ed[_0x68e7('0x39')][_0x68e7('0x3b')]?_0x2ee0ed['attributes']:_0x4cb47f[_0x68e7('0x36')];if(_0x5e47f8[_0x68e7('0x38')][_0x68e7('0x48')]){_0x2ee0ed['include']=[{'all':!![]}];}_0x2ee0ed=_['merge']({},_0x2ee0ed,_0x5e47f8['options']);return db[_0x68e7('0x47')][_0x68e7('0x4d')](_0x2ee0ed)[_0x68e7('0x27')](handleEntityNotFound(_0x5df2ae,null))['then'](respondWithResult(_0x5df2ae,null))['catch'](handleError(_0x5df2ae,null));};exports[_0x68e7('0x4e')]=function(_0x18cf66,_0x4c00aa){return db['Variable'][_0x68e7('0x4e')](_0x18cf66[_0x68e7('0x4f')],{})[_0x68e7('0x27')](function(_0x5377e4){var _0x49a213=_0x18cf66[_0x68e7('0x50')][_0x68e7('0x29')]({'plain':!![]});if(!_0x49a213)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49a213[_0x68e7('0x51')]===_0x68e7('0x50')){var _0x4d5a9f=_0x5377e4['get']({'plain':!![]});var _0x528f2c='Variables';return db[_0x68e7('0x52')][_0x68e7('0x4d')]({'where':{'name':_0x528f2c,'userProfileId':_0x49a213[_0x68e7('0x53')]},'raw':!![]})[_0x68e7('0x27')](function(_0x4d82e1){if(_0x4d82e1&&_0x4d82e1['autoAssociation']===0x0){return db[_0x68e7('0x2b')][_0x68e7('0x4e')]({'name':_0x4d5a9f[_0x68e7('0x2f')],'resourceId':_0x4d5a9f['id'],'type':_0x4d82e1[_0x68e7('0x2f')],'sectionId':_0x4d82e1['id']},{})[_0x68e7('0x27')](function(){return _0x5377e4;});}else{return _0x5377e4;}})[_0x68e7('0x4a')](function(_0x3f8876){logger[_0x68e7('0x2d')](_0x68e7('0x54'),_0x3f8876);throw _0x3f8876;});}return _0x5377e4;})['then'](respondWithResult(_0x4c00aa,0xc9))[_0x68e7('0x4a')](handleError(_0x4c00aa,null));};exports[_0x68e7('0x55')]=function(_0x2c0ab3,_0x869fbb){if(_0x2c0ab3['body']['id']){delete _0x2c0ab3[_0x68e7('0x4f')]['id'];}return db[_0x68e7('0x47')]['find']({'where':{'id':_0x2c0ab3[_0x68e7('0x56')]['id']}})[_0x68e7('0x27')](handleEntityNotFound(_0x869fbb,null))[_0x68e7('0x27')](saveUpdates(_0x2c0ab3['body'],null))[_0x68e7('0x27')](respondWithResult(_0x869fbb,null))['catch'](handleError(_0x869fbb,null));};exports[_0x68e7('0x28')]=function(_0x21b739,_0x2f0037){return db[_0x68e7('0x47')][_0x68e7('0x4d')]({'where':{'id':_0x21b739[_0x68e7('0x56')]['id']}})[_0x68e7('0x27')](handleEntityNotFound(_0x2f0037,null))[_0x68e7('0x27')](removeEntity(_0x2f0037,null))[_0x68e7('0x4a')](handleError(_0x2f0037,null));}; \ No newline at end of file +var _0xb563=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','index','map','Variable','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb563,0x92));var _0x3b56=function(_0x4b83fa,_0x3e9c78){_0x4b83fa=_0x4b83fa-0x0;var _0x30fe3b=_0xb563[_0x4b83fa];return _0x30fe3b;};'use strict';var emlformat=require(_0x3b56('0x0'));var rimraf=require(_0x3b56('0x1'));var zipdir=require(_0x3b56('0x2'));var jsonpatch=require(_0x3b56('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b56('0x4'));var util=require('util');var path=require(_0x3b56('0x5'));var sox=require(_0x3b56('0x6'));var csv=require(_0x3b56('0x7'));var ejs=require(_0x3b56('0x8'));var fs=require('fs');var fs_extra=require(_0x3b56('0x9'));var _=require('lodash');var squel=require(_0x3b56('0xa'));var crypto=require(_0x3b56('0xb'));var jsforce=require(_0x3b56('0xc'));var deskjs=require(_0x3b56('0xd'));var toCsv=require(_0x3b56('0x7'));var querystring=require(_0x3b56('0xe'));var Papa=require(_0x3b56('0xf'));var Redis=require(_0x3b56('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b56('0x11'));var as=require(_0x3b56('0x12'));var hardwareService=require(_0x3b56('0x13'));var logger=require(_0x3b56('0x14'))(_0x3b56('0x15'));var utils=require(_0x3b56('0x16'));var config=require(_0x3b56('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2dca54,_0x1ceed2){_0x1ceed2=_0x1ceed2||0xcc;return function(_0xcece75){if(_0xcece75){return _0x2dca54['sendStatus'](_0x1ceed2);}return _0x2dca54[_0x3b56('0x18')](_0x1ceed2)[_0x3b56('0x19')]();};}function respondWithResult(_0x337314,_0x37dea0){_0x37dea0=_0x37dea0||0xc8;return function(_0x334b36){if(_0x334b36){return _0x337314[_0x3b56('0x18')](_0x37dea0)[_0x3b56('0x1a')](_0x334b36);}};}function respondWithFilteredResult(_0x572718,_0x3ec131){return function(_0x3c14ef){if(_0x3c14ef){var _0x30f7f7=typeof _0x3ec131[_0x3b56('0x1b')]===_0x3b56('0x1c')&&typeof _0x3ec131['limit']===_0x3b56('0x1c');var _0x53e476=_0x3c14ef[_0x3b56('0x1d')];var _0x20c7e0=_0x30f7f7?0x0:_0x3ec131[_0x3b56('0x1b')];var _0x4bebf3=_0x30f7f7?_0x3c14ef[_0x3b56('0x1d')]:_0x3ec131[_0x3b56('0x1b')]+_0x3ec131[_0x3b56('0x1e')];var _0x2adb4;if(_0x4bebf3>=_0x53e476){_0x4bebf3=_0x53e476;_0x2adb4=0xc8;}else{_0x2adb4=0xce;}_0x572718[_0x3b56('0x18')](_0x2adb4);return _0x572718[_0x3b56('0x1f')](_0x3b56('0x20'),_0x20c7e0+'-'+_0x4bebf3+'/'+_0x53e476)['json'](_0x3c14ef);}return null;};}function patchUpdates(_0x4383b8){return function(_0x467e03){try{jsonpatch[_0x3b56('0x21')](_0x467e03,_0x4383b8,!![]);}catch(_0x5cb2b4){return BPromise['reject'](_0x5cb2b4);}return _0x467e03[_0x3b56('0x22')]();};}function saveUpdates(_0x3d9371,_0x516044){return function(_0x5d97f3){if(_0x5d97f3){return _0x5d97f3[_0x3b56('0x23')](_0x3d9371)[_0x3b56('0x24')](function(_0x49e725){return _0x49e725;});}return null;};}function removeEntity(_0x141445,_0x4a3d7f){return function(_0x57c2e9){if(_0x57c2e9){return _0x57c2e9[_0x3b56('0x25')]()[_0x3b56('0x24')](function(){var _0xbf7d5b=_0x57c2e9[_0x3b56('0x26')]({'plain':!![]});var _0x47b1ca=_0x3b56('0x27');return db[_0x3b56('0x28')][_0x3b56('0x25')]({'where':{'type':_0x47b1ca,'resourceId':_0xbf7d5b['id']}})[_0x3b56('0x24')](function(){return _0x57c2e9;});})['then'](function(){_0x141445[_0x3b56('0x18')](0xcc)[_0x3b56('0x19')]();});}};}function handleEntityNotFound(_0x49f18e,_0x2a3fe8){return function(_0x53b3c4){if(!_0x53b3c4){_0x49f18e['sendStatus'](0x194);}return _0x53b3c4;};}function handleError(_0xc419cd,_0x353ec6){_0x353ec6=_0x353ec6||0x1f4;return function(_0x40d270){logger[_0x3b56('0x29')](_0x40d270[_0x3b56('0x2a')]);if(_0x40d270[_0x3b56('0x2b')]){delete _0x40d270[_0x3b56('0x2b')];}_0xc419cd[_0x3b56('0x18')](_0x353ec6)['send'](_0x40d270);};}exports[_0x3b56('0x2c')]=function(_0x32c5dd,_0x4bcf50){var _0x37754d={},_0x2891ef={},_0x117d97={'count':0x0,'rows':[]};var _0x1f93d3=_[_0x3b56('0x2d')](db[_0x3b56('0x2e')][_0x3b56('0x2f')],function(_0x222611){return{'name':_0x222611[_0x3b56('0x30')],'type':_0x222611['type']['key']};});_0x2891ef[_0x3b56('0x31')]=_[_0x3b56('0x2d')](_0x1f93d3,_0x3b56('0x2b'));_0x2891ef['query']=_[_0x3b56('0x32')](_0x32c5dd[_0x3b56('0x33')]);_0x2891ef[_0x3b56('0x34')]=_['intersection'](_0x2891ef[_0x3b56('0x31')],_0x2891ef['query']);_0x37754d[_0x3b56('0x35')]=_[_0x3b56('0x36')](_0x2891ef[_0x3b56('0x31')],qs[_0x3b56('0x37')](_0x32c5dd[_0x3b56('0x33')]['fields']));_0x37754d[_0x3b56('0x35')]=_0x37754d['attributes'][_0x3b56('0x38')]?_0x37754d['attributes']:_0x2891ef[_0x3b56('0x31')];if(!_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x39')](_0x3b56('0x3a'))){_0x37754d[_0x3b56('0x1e')]=qs[_0x3b56('0x1e')](_0x32c5dd[_0x3b56('0x33')]['limit']);_0x37754d[_0x3b56('0x1b')]=qs[_0x3b56('0x1b')](_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x1b')]);}_0x37754d[_0x3b56('0x3b')]=qs['sort'](_0x32c5dd[_0x3b56('0x33')]['sort']);_0x37754d[_0x3b56('0x3c')]=qs[_0x3b56('0x34')](_[_0x3b56('0x3d')](_0x32c5dd['query'],_0x2891ef['filters']),_0x1f93d3);if(_0x32c5dd[_0x3b56('0x33')]['filter']){_0x37754d['where']=_['merge'](_0x37754d[_0x3b56('0x3c')],{'$or':_[_0x3b56('0x2d')](_0x1f93d3,function(_0x3ccef5){if(_0x3ccef5[_0x3b56('0x3e')]!==_0x3b56('0x3f')){var _0x5bcc6a={};_0x5bcc6a[_0x3ccef5[_0x3b56('0x2b')]]={'$like':'%'+_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x40')]+'%'};return _0x5bcc6a;}})});}_0x37754d=_[_0x3b56('0x41')]({},_0x37754d,_0x32c5dd[_0x3b56('0x42')]);var _0x13e540={'where':_0x37754d['where']};return db['Variable'][_0x3b56('0x1d')](_0x13e540)[_0x3b56('0x24')](function(_0xa912fe){_0x117d97[_0x3b56('0x1d')]=_0xa912fe;if(_0x32c5dd[_0x3b56('0x33')][_0x3b56('0x43')]){_0x37754d[_0x3b56('0x44')]=[{'all':!![]}];}return db[_0x3b56('0x2e')][_0x3b56('0x45')](_0x37754d);})[_0x3b56('0x24')](function(_0x344ac5){_0x117d97['rows']=_0x344ac5;return _0x117d97;})[_0x3b56('0x24')](respondWithFilteredResult(_0x4bcf50,_0x37754d))[_0x3b56('0x46')](handleError(_0x4bcf50,null));};exports['show']=function(_0x5a3056,_0x30f864){var _0x2f74c9={'raw':!![],'where':{'id':_0x5a3056[_0x3b56('0x47')]['id']}},_0x48ec2e={};_0x48ec2e[_0x3b56('0x31')]=_[_0x3b56('0x32')](db[_0x3b56('0x2e')]['rawAttributes']);_0x48ec2e[_0x3b56('0x33')]=_[_0x3b56('0x32')](_0x5a3056[_0x3b56('0x33')]);_0x48ec2e['filters']=_[_0x3b56('0x36')](_0x48ec2e[_0x3b56('0x31')],_0x48ec2e['query']);_0x2f74c9[_0x3b56('0x35')]=_['intersection'](_0x48ec2e['model'],qs[_0x3b56('0x37')](_0x5a3056[_0x3b56('0x33')]['fields']));_0x2f74c9[_0x3b56('0x35')]=_0x2f74c9[_0x3b56('0x35')][_0x3b56('0x38')]?_0x2f74c9[_0x3b56('0x35')]:_0x48ec2e[_0x3b56('0x31')];if(_0x5a3056[_0x3b56('0x33')][_0x3b56('0x43')]){_0x2f74c9[_0x3b56('0x44')]=[{'all':!![]}];}_0x2f74c9=_[_0x3b56('0x41')]({},_0x2f74c9,_0x5a3056[_0x3b56('0x42')]);return db[_0x3b56('0x2e')][_0x3b56('0x48')](_0x2f74c9)[_0x3b56('0x24')](handleEntityNotFound(_0x30f864,null))[_0x3b56('0x24')](respondWithResult(_0x30f864,null))['catch'](handleError(_0x30f864,null));};exports[_0x3b56('0x49')]=function(_0x28bf09,_0x4ba0a9){return db[_0x3b56('0x2e')][_0x3b56('0x49')](_0x28bf09[_0x3b56('0x4a')],{})[_0x3b56('0x24')](function(_0x2192c3){var _0x31210b=_0x28bf09['user'][_0x3b56('0x26')]({'plain':!![]});if(!_0x31210b)throw new Error(_0x3b56('0x4b'));if(_0x31210b[_0x3b56('0x4c')]===_0x3b56('0x4d')){var _0x1a72c2=_0x2192c3[_0x3b56('0x26')]({'plain':!![]});var _0x368361=_0x3b56('0x27');return db[_0x3b56('0x4e')][_0x3b56('0x48')]({'where':{'name':_0x368361,'userProfileId':_0x31210b[_0x3b56('0x4f')]},'raw':!![]})[_0x3b56('0x24')](function(_0x863bdb){if(_0x863bdb&&_0x863bdb[_0x3b56('0x50')]===0x0){return db[_0x3b56('0x28')][_0x3b56('0x49')]({'name':_0x1a72c2[_0x3b56('0x2b')],'resourceId':_0x1a72c2['id'],'type':_0x863bdb[_0x3b56('0x2b')],'sectionId':_0x863bdb['id']},{})[_0x3b56('0x24')](function(){return _0x2192c3;});}else{return _0x2192c3;}})['catch'](function(_0x468b64){logger['error'](_0x3b56('0x51'),_0x468b64);throw _0x468b64;});}return _0x2192c3;})[_0x3b56('0x24')](respondWithResult(_0x4ba0a9,0xc9))[_0x3b56('0x46')](handleError(_0x4ba0a9,null));};exports['update']=function(_0x3ba1ac,_0x4fc699){if(_0x3ba1ac[_0x3b56('0x4a')]['id']){delete _0x3ba1ac['body']['id'];}return db[_0x3b56('0x2e')][_0x3b56('0x48')]({'where':{'id':_0x3ba1ac[_0x3b56('0x47')]['id']}})[_0x3b56('0x24')](handleEntityNotFound(_0x4fc699,null))[_0x3b56('0x24')](saveUpdates(_0x3ba1ac[_0x3b56('0x4a')],null))['then'](respondWithResult(_0x4fc699,null))[_0x3b56('0x46')](handleError(_0x4fc699,null));};exports[_0x3b56('0x25')]=function(_0x306262,_0x10054c){return db['Variable']['find']({'where':{'id':_0x306262[_0x3b56('0x47')]['id']}})[_0x3b56('0x24')](handleEntityNotFound(_0x10054c,null))[_0x3b56('0x24')](removeEntity(_0x10054c,null))[_0x3b56('0x46')](handleError(_0x10054c,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index eee5ea2..1c719e3 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 _0x55fe=['util','../../config/logger','api','moment','bluebird','request-promise','path','./variable.attributes','exports','Variable'];(function(_0x4e074e,_0x35a42e){var _0x1fb96a=function(_0x432263){while(--_0x432263){_0x4e074e['push'](_0x4e074e['shift']());}};_0x1fb96a(++_0x35a42e);}(_0x55fe,0x1cc));var _0xe55f=function(_0x2ea457,_0x25db24){_0x2ea457=_0x2ea457-0x0;var _0x2773f7=_0x55fe[_0x2ea457];return _0x2773f7;};'use strict';var _=require('lodash');var util=require(_0xe55f('0x0'));var logger=require(_0xe55f('0x1'))(_0xe55f('0x2'));var moment=require(_0xe55f('0x3'));var BPromise=require(_0xe55f('0x4'));var rp=require(_0xe55f('0x5'));var fs=require('fs');var path=require(_0xe55f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe55f('0x7'));module[_0xe55f('0x8')]=function(_0x553865,_0x41ac73){return _0x553865['define'](_0xe55f('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55bf=['exports','define','Variable','tools_variables','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes'];(function(_0x54f844,_0x42e52a){var _0x492c33=function(_0x56bbb6){while(--_0x56bbb6){_0x54f844['push'](_0x54f844['shift']());}};_0x492c33(++_0x42e52a);}(_0x55bf,0x156));var _0xf55b=function(_0x149a14,_0x71e0f4){_0x149a14=_0x149a14-0x0;var _0x3e2d79=_0x55bf[_0x149a14];return _0x3e2d79;};'use strict';var _=require('lodash');var util=require(_0xf55b('0x0'));var logger=require(_0xf55b('0x1'))(_0xf55b('0x2'));var moment=require(_0xf55b('0x3'));var BPromise=require(_0xf55b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf55b('0x5'));var rimraf=require(_0xf55b('0x6'));var config=require(_0xf55b('0x7'));var attributes=require(_0xf55b('0x8'));module[_0xf55b('0x9')]=function(_0x80d950,_0x4c0248){return _0x80d950[_0xf55b('0xa')](_0xf55b('0xb'),attributes,{'tableName':_0xf55b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 97fece9..6594669 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 _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x45096e,_0x17e82d){var _0xba1fa3=function(_0x29f43c){while(--_0x29f43c){_0x45096e['push'](_0x45096e['shift']());}};_0xba1fa3(++_0x17e82d);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3c25d7,_0x6a5119){_0x3c25d7=_0x3c25d7-0x0;var _0x4e323b=_0x8ef6[_0x3c25d7];return _0x4e323b;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});}; \ No newline at end of file +var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x5141a4,_0x30ca29){var _0x6e1a6=function(_0x4fd8f1){while(--_0x4fd8f1){_0x5141a4['push'](_0x5141a4['shift']());}};_0x6e1a6(++_0x30ca29);}(_0x6aa7,0x178));var _0x76aa=function(_0x58e5b7,_0x230532){_0x58e5b7=_0x58e5b7-0x0;var _0xd74063=_0x6aa7[_0x58e5b7];return _0xd74063;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 1824ee2..70e3f9c 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 _0xe336=['Router','../../components/auth/service','./version.controller','index','get','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express'];(function(_0x94b856,_0x1edd2d){var _0xc9e983=function(_0x444f54){while(--_0x444f54){_0x94b856['push'](_0x94b856['shift']());}};_0xc9e983(++_0x1edd2d);}(_0xe336,0x76));var _0x6e33=function(_0x20b9c0,_0x329d22){_0x20b9c0=_0x20b9c0-0x0;var _0x15002d=_0xe336[_0x20b9c0];return _0x15002d;};'use strict';var express=require(_0x6e33('0x0'));var router=express[_0x6e33('0x1')]();var auth=require(_0x6e33('0x2'));var controller=require(_0x6e33('0x3'));router['get']('/',controller[_0x6e33('0x4')]);router[_0x6e33('0x5')]('/fetch',auth[_0x6e33('0x6')](),auth[_0x6e33('0x7')](),controller[_0x6e33('0x8')]);router[_0x6e33('0x5')](_0x6e33('0x9'),auth[_0x6e33('0x6')](),auth['canUpdate'](),controller['reset']);router[_0x6e33('0x5')](_0x6e33('0xa'),auth[_0x6e33('0x6')](),auth[_0x6e33('0x7')](),controller[_0x6e33('0xb')]);router['get'](_0x6e33('0xc'),auth['isAuthenticated'](),controller[_0x6e33('0xd')]);router[_0x6e33('0x5')](_0x6e33('0xe'),controller[_0x6e33('0xf')]);module[_0x6e33('0x10')]=router; \ No newline at end of file +var _0xd215=['restart','migrations','exports','express','Router','../../components/auth/service','get','index','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','pull','/restart'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd215,0xf3));var _0x5d21=function(_0x22fbdd,_0x4ed06a){_0x22fbdd=_0x22fbdd-0x0;var _0x56dfbf=_0xd215[_0x22fbdd];return _0x56dfbf;};'use strict';var express=require(_0x5d21('0x0'));var router=express[_0x5d21('0x1')]();var auth=require(_0x5d21('0x2'));var controller=require('./version.controller');router[_0x5d21('0x3')]('/',controller[_0x5d21('0x4')]);router['get']('/fetch',auth[_0x5d21('0x5')](),auth[_0x5d21('0x6')](),controller[_0x5d21('0x7')]);router['get'](_0x5d21('0x8'),auth[_0x5d21('0x5')](),auth['canUpdate'](),controller[_0x5d21('0x9')]);router[_0x5d21('0x3')](_0x5d21('0xa'),auth[_0x5d21('0x5')](),auth[_0x5d21('0x6')](),controller[_0x5d21('0xb')]);router[_0x5d21('0x3')](_0x5d21('0xc'),auth[_0x5d21('0x5')](),controller[_0x5d21('0xd')]);router[_0x5d21('0x3')]('/migrations',controller[_0x5d21('0xe')]);module[_0x5d21('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 0007916..ea8078a 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 _0x5cdf=['then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','query','latest','fetch','exports','status','json','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','motion2'];(function(_0x275752,_0x2bb209){var _0x10f0f2=function(_0x393db3){while(--_0x393db3){_0x275752['push'](_0x275752['shift']());}};_0x10f0f2(++_0x2bb209);}(_0x5cdf,0xe7));var _0xf5cd=function(_0x5b6e23,_0x10403d){_0x5b6e23=_0x5b6e23-0x0;var _0x2b1aa5=_0x5cdf[_0x5b6e23];return _0x2b1aa5;};'use strict';var Umzug=require(_0xf5cd('0x0'));var path=require(_0xf5cd('0x1'));var fs=require('fs');var _=require(_0xf5cd('0x2'));var pkginfo=require('pkginfo')(module,_0xf5cd('0x3'));var compareVersions=require(_0xf5cd('0x4'));var exec=require('child_process')[_0xf5cd('0x5')];var db=require(_0xf5cd('0x6'))['db'];var config=require(_0xf5cd('0x7'));var pm2=require(_0xf5cd('0x8'));var logger=require('../../config/logger')(_0xf5cd('0x9'));var git=require('simple-git')(config[_0xf5cd('0xa')]);exports[_0xf5cd('0xb')]=function(_0x3826ab,_0x58d792){var _0x16acbb={'current':module['exports'][_0xf5cd('0x3')],'phonebar':0x2};if(_0x3826ab[_0xf5cd('0xc')]&&_0x3826ab[_0xf5cd('0xc')][_0xf5cd('0xd')]){return git[_0xf5cd('0xe')]()['tags'](function(_0x3ce38f,_0x1b761a){_0x16acbb[_0xf5cd('0xd')]=(_0x3ce38f?module[_0xf5cd('0xf')][_0xf5cd('0x3')]:_0x1b761a['latest'])||'2.0.0';return _0x58d792[_0xf5cd('0x10')](0xc8)['json'](_0x16acbb);});}else{return _0x58d792[_0xf5cd('0x10')](0xc8)[_0xf5cd('0x11')](_0x16acbb);}};exports[_0xf5cd('0xe')]=function(_0x3eb4ad,_0x12797e){return git['fetch']([_0xf5cd('0x12'),'master'],function(_0x55d4e4){if(_0x55d4e4){logger[_0xf5cd('0x13')](_0x55d4e4);return _0x12797e[_0xf5cd('0x10')](0x1f4)[_0xf5cd('0x11')](_0x55d4e4);}logger[_0xf5cd('0x14')](_0xf5cd('0x15'));return _0x12797e['status'](0xc8)[_0xf5cd('0x11')]({'output':_0xf5cd('0x16')});});};exports[_0xf5cd('0x17')]=function(_0x48b578,_0x18ff92){return git['reset']([_0xf5cd('0x18'),_0xf5cd('0x19')],function(_0x59cced){if(_0x59cced){logger['error'](_0x59cced);return _0x18ff92[_0xf5cd('0x10')](0x1f4)[_0xf5cd('0x11')](_0x59cced);}logger['info'](_0xf5cd('0x1a'));return _0x18ff92['status'](0xc8)[_0xf5cd('0x11')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x2056bb,_0x2f593d){exec(_0xf5cd('0x1b'),function(_0x2f9587,_0x5ef015,_0x385225){logger['info'](_0x5ef015);logger[_0xf5cd('0x14')](_0x385225);if(_0x2f9587){logger['error'](_0x2f9587);return _0x2f593d[_0xf5cd('0x10')](0x1f4)[_0xf5cd('0x11')](_0x2f9587);}return _0x2f593d[_0xf5cd('0x10')](0xc8)[_0xf5cd('0x11')]({'output':_0x5ef015});});};exports['restart']=function(_0x4fe9bd,_0x297dba){return pm2['restart'](_0xf5cd('0x1c'))[_0xf5cd('0x1d')](function(_0x18c80d){logger[_0xf5cd('0x14')](_0xf5cd('0x1e'),_0x18c80d);return _0x297dba[_0xf5cd('0x10')](0xc8)[_0xf5cd('0x11')]({'output':_0xf5cd('0x1f')});})['catch'](function(_0x287356){logger[_0xf5cd('0x13')](_0x287356);return _0x297dba['status'](0x1f4)[_0xf5cd('0x11')](_0x287356);});};exports[_0xf5cd('0x20')]=function(_0x18a501,_0x3f1d1d){var _0x12fd03=fs[_0xf5cd('0x21')](path['join'](config[_0xf5cd('0xa')],_0xf5cd('0x22'),_0xf5cd('0x20')));var _0x4658e9=[];for(var _0x5b875e=0x0;_0x5b875e<_0x12fd03[_0xf5cd('0x23')];_0x5b875e++){var _0x5a18c4=_0x12fd03[_0x5b875e][_0xf5cd('0x24')](_0xf5cd('0x25'),'');if(compareVersions(module[_0xf5cd('0xf')][_0xf5cd('0x3')],_0x5a18c4)===-0x1){_0x4658e9[_0xf5cd('0x26')](_0x5a18c4);}}if(_0x4658e9[_0xf5cd('0x23')]){var _0x5ad80b=_0x4658e9[_0xf5cd('0x27')](compareVersions);var _0x2a65fe=new Umzug({'storage':_0xf5cd('0x28'),'storageOptions':{'model':db[_0xf5cd('0x29')],'modelName':_0xf5cd('0x29'),'columnName':'version'},'migrations':{'params':[db[_0xf5cd('0x28')][_0xf5cd('0x2a')](),db['sequelize'][_0xf5cd('0x2b')],function(){throw new Error(_0xf5cd('0x2c'));}],'path':path[_0xf5cd('0x2d')](config[_0xf5cd('0xa')],_0xf5cd('0x22'),'migrations'),'pattern':/\.js$/}});_0x2a65fe['up']({'migrations':_[_0xf5cd('0x2e')](_0x5ad80b,function(_0x80169c){return _0x80169c+_0xf5cd('0x25');})})['then'](function(){return _0x3f1d1d[_0xf5cd('0x10')](0xc8)[_0xf5cd('0x11')]({'output':_0xf5cd('0x2f')+module[_0xf5cd('0xf')]['version']+_0xf5cd('0x30')+_['last'](_0x5ad80b),'migrations':_[_0xf5cd('0x2d')](_0x5ad80b)});})[_0xf5cd('0x31')](function(_0x2c2924){if(_0x2c2924 instanceof db[_0xf5cd('0x28')][_0xf5cd('0x32')]){return _0x3f1d1d[_0xf5cd('0x10')](0xc8)[_0xf5cd('0x11')]({'output':_0xf5cd('0x33')});}else{return _0x3f1d1d[_0xf5cd('0x10')](0x1f4)[_0xf5cd('0x11')](_0x2c2924);}});}else{return _0x3f1d1d['status'](0xc8)[_0xf5cd('0x11')]({'output':_0xf5cd('0x33')});}}; \ No newline at end of file +var _0x620a=['exports','query','latest','tags','json','status','fetch','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','child_process','../../mysqldb','../../config/environment','update','root','index'];(function(_0x3e550c,_0x5432e2){var _0x89e6e6=function(_0x3ca762){while(--_0x3ca762){_0x3e550c['push'](_0x3e550c['shift']());}};_0x89e6e6(++_0x5432e2);}(_0x620a,0xc2));var _0xa620=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x620a[_0x9cd4c3];return _0x4c9025;};'use strict';var Umzug=require(_0xa620('0x0'));var path=require(_0xa620('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xa620('0x2'))(module,_0xa620('0x3'));var compareVersions=require('compare-versions');var exec=require(_0xa620('0x4'))['exec'];var db=require(_0xa620('0x5'))['db'];var config=require(_0xa620('0x6'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xa620('0x7'));var git=require('simple-git')(config[_0xa620('0x8')]);exports[_0xa620('0x9')]=function(_0x1aecc9,_0x1e0fbb){var _0x2c8fce={'current':module[_0xa620('0xa')]['version'],'phonebar':0x2};if(_0x1aecc9[_0xa620('0xb')]&&_0x1aecc9[_0xa620('0xb')][_0xa620('0xc')]){return git['fetch']()[_0xa620('0xd')](function(_0x56357f,_0x2e35c9){_0x2c8fce['latest']=(_0x56357f?module[_0xa620('0xa')][_0xa620('0x3')]:_0x2e35c9[_0xa620('0xc')])||'2.0.0';return _0x1e0fbb['status'](0xc8)[_0xa620('0xe')](_0x2c8fce);});}else{return _0x1e0fbb[_0xa620('0xf')](0xc8)['json'](_0x2c8fce);}};exports[_0xa620('0x10')]=function(_0x35446e,_0x114fbf){return git[_0xa620('0x10')](['origin','master'],function(_0x1aa523){if(_0x1aa523){logger['error'](_0x1aa523);return _0x114fbf[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x1aa523);}logger[_0xa620('0x11')](_0xa620('0x12'));return _0x114fbf[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x13')});});};exports['reset']=function(_0x46f218,_0x1edb41){return git[_0xa620('0x14')]([_0xa620('0x15'),_0xa620('0x16')],function(_0xcffefb){if(_0xcffefb){logger['error'](_0xcffefb);return _0x1edb41[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0xcffefb);}logger['info'](_0xa620('0x17'));return _0x1edb41[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':'git\x20reset\x20--hard'});});};exports[_0xa620('0x18')]=function(_0x1b8e6c,_0xe7d941){exec('npm\x20install\x20--production',function(_0x5ae938,_0x28b941,_0x4de207){logger['info'](_0x28b941);logger[_0xa620('0x11')](_0x4de207);if(_0x5ae938){logger[_0xa620('0x19')](_0x5ae938);return _0xe7d941[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x5ae938);}return _0xe7d941[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0x28b941});});};exports[_0xa620('0x1a')]=function(_0x3b2549,_0x1a7ef6){return pm2[_0xa620('0x1a')](_0xa620('0x1b'))[_0xa620('0x1c')](function(_0x27c86d){logger['info'](_0xa620('0x1d'),_0x27c86d);return _0x1a7ef6[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x1e')});})[_0xa620('0x1f')](function(_0x355d0a){logger['error'](_0x355d0a);return _0x1a7ef6[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x355d0a);});};exports[_0xa620('0x20')]=function(_0x32237f,_0x459bdd){var _0x23aad1=fs[_0xa620('0x21')](path[_0xa620('0x22')](config[_0xa620('0x8')],_0xa620('0x23'),_0xa620('0x20')));var _0x5a9f88=[];for(var _0x471d4b=0x0;_0x471d4b<_0x23aad1[_0xa620('0x24')];_0x471d4b++){var _0xabd3d5=_0x23aad1[_0x471d4b][_0xa620('0x25')](_0xa620('0x26'),'');if(compareVersions(module['exports']['version'],_0xabd3d5)===-0x1){_0x5a9f88[_0xa620('0x27')](_0xabd3d5);}}if(_0x5a9f88[_0xa620('0x24')]){var _0x1379f7=_0x5a9f88[_0xa620('0x28')](compareVersions);var _0x4d4faa=new Umzug({'storage':_0xa620('0x29'),'storageOptions':{'model':db[_0xa620('0x2a')],'modelName':_0xa620('0x2a'),'columnName':_0xa620('0x3')},'migrations':{'params':[db[_0xa620('0x29')][_0xa620('0x2b')](),db[_0xa620('0x29')][_0xa620('0x2c')],function(){throw new Error(_0xa620('0x2d'));}],'path':path[_0xa620('0x22')](config['root'],'server',_0xa620('0x20')),'pattern':/\.js$/}});_0x4d4faa['up']({'migrations':_['map'](_0x1379f7,function(_0x2878ea){return _0x2878ea+_0xa620('0x26');})})[_0xa620('0x1c')](function(){return _0x459bdd['status'](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x2e')+module[_0xa620('0xa')][_0xa620('0x3')]+_0xa620('0x2f')+_[_0xa620('0x30')](_0x1379f7),'migrations':_[_0xa620('0x22')](_0x1379f7)});})['catch'](function(_0x4ef65e){if(_0x4ef65e instanceof db[_0xa620('0x29')][_0xa620('0x31')]){return _0x459bdd['status'](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x32')});}else{return _0x459bdd[_0xa620('0xf')](0x1f4)[_0xa620('0xe')](_0x4ef65e);}});}else{return _0x459bdd[_0xa620('0xf')](0xc8)[_0xa620('0xe')]({'output':_0xa620('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 656eee9..d833e30 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 _0x9272=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9272,0x153));var _0x2927=function(_0x529a7c,_0x5c5590){_0x529a7c=_0x529a7c-0x0;var _0x47c344=_0x9272[_0x529a7c];return _0x47c344;};'use strict';var multer=require(_0x2927('0x0'));var util=require(_0x2927('0x1'));var path=require(_0x2927('0x2'));var timeout=require('connect-timeout');var express=require(_0x2927('0x3'));var router=express[_0x2927('0x4')]();var fs_extra=require(_0x2927('0x5'));var auth=require(_0x2927('0x6'));var interaction=require(_0x2927('0x7'));var config=require(_0x2927('0x8'));var controller=require('./voiceAgentReport.controller');router[_0x2927('0x9')]('/',auth['isAuthenticated'](),controller[_0x2927('0xa')]);router[_0x2927('0x9')]('/describe',auth[_0x2927('0xb')](),controller[_0x2927('0xc')]);router[_0x2927('0x9')](_0x2927('0xd'),auth[_0x2927('0xb')](),controller[_0x2927('0xe')]);router[_0x2927('0xf')]('/',auth['isAuthenticated'](),controller[_0x2927('0x10')]);router[_0x2927('0x11')](_0x2927('0xd'),auth['isAuthenticated'](),controller[_0x2927('0x12')]);router[_0x2927('0x13')]('/:id',auth[_0x2927('0xb')](),controller[_0x2927('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa224=['update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put'];(function(_0x1805c0,_0x4707b5){var _0xd2c505=function(_0x240838){while(--_0x240838){_0x1805c0['push'](_0x1805c0['shift']());}};_0xd2c505(++_0x4707b5);}(_0xa224,0x6f));var _0x4a22=function(_0x799ac4,_0x223f8e){_0x799ac4=_0x799ac4-0x0;var _0x16deae=_0xa224[_0x799ac4];return _0x16deae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4a22('0x0'));var timeout=require(_0x4a22('0x1'));var express=require('express');var router=express[_0x4a22('0x2')]();var fs_extra=require(_0x4a22('0x3'));var auth=require(_0x4a22('0x4'));var interaction=require(_0x4a22('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x4a22('0x6')]('/',auth[_0x4a22('0x7')](),controller[_0x4a22('0x8')]);router[_0x4a22('0x6')](_0x4a22('0x9'),auth[_0x4a22('0x7')](),controller[_0x4a22('0xa')]);router['get'](_0x4a22('0xb'),auth[_0x4a22('0x7')](),controller[_0x4a22('0xc')]);router['post']('/',auth[_0x4a22('0x7')](),controller[_0x4a22('0xd')]);router[_0x4a22('0xe')](_0x4a22('0xb'),auth['isAuthenticated'](),controller[_0x4a22('0xf')]);router['delete']('/:id',auth[_0x4a22('0x7')](),controller[_0x4a22('0x10')]);module[_0x4a22('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 035326c..513a941 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 _0x282b=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x282b,0xec));var _0xb282=function(_0x4d0720,_0x550697){_0x4d0720=_0x4d0720-0x0;var _0x25b27c=_0x282b[_0x4d0720];return _0x25b27c;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'type':{'type':Sequelize[_0xb282('0x2')]},'uniqueid':{'type':Sequelize[_0xb282('0x2')]},'calleridnum':{'type':Sequelize[_0xb282('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb282('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xb282('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb282('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xb282('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xb282('0x3')]},'agentdumpAt':{'type':Sequelize[_0xb282('0x3')]},'holdtime':{'type':Sequelize[_0xb282('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb282('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb282('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb282('0x4')]},'reason':{'type':Sequelize[_0xb282('0x2')]},'lastevent':{'type':Sequelize[_0xb282('0x2')]},'channel':{'type':Sequelize[_0xb282('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb282('0x2')]},'connectedlinename':{'type':Sequelize[_0xb282('0x2')]},'language':{'type':Sequelize[_0xb282('0x2')]},'accountcode':{'type':Sequelize[_0xb282('0x2')]},'context':{'type':Sequelize[_0xb282('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb282('0x2')]},'destchannelstate':{'type':Sequelize[_0xb282('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xb282('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb282('0x2')]},'destcalleridname':{'type':Sequelize[_0xb282('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xb282('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb282('0x2')]},'destcontext':{'type':Sequelize[_0xb282('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb282('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xb282('0x2')]},'transfer':{'type':Sequelize[_0xb282('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb282('0x2')],'comment':_0xb282('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb282('0x2')]},'agententerreason':{'type':Sequelize[_0xb282('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x01d3=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x01d3,0xa2));var _0x301d=function(_0x289f9c,_0x4fb5c9){_0x289f9c=_0x289f9c-0x0;var _0x54e021=_0x01d3[_0x289f9c];return _0x54e021;};'use strict';var Sequelize=require(_0x301d('0x0'));module[_0x301d('0x1')]={'type':{'type':Sequelize[_0x301d('0x2')]},'uniqueid':{'type':Sequelize[_0x301d('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x301d('0x2')]},'queue':{'type':Sequelize[_0x301d('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x301d('0x2')]},'agentcalledAt':{'type':Sequelize[_0x301d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x301d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x301d('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x301d('0x3')]},'holdtime':{'type':Sequelize[_0x301d('0x4')]},'agentcomplete':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x301d('0x4')]},'agentacw':{'type':Sequelize[_0x301d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x301d('0x4')]},'reason':{'type':Sequelize[_0x301d('0x2')]},'lastevent':{'type':Sequelize[_0x301d('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x301d('0x4')]},'channelstatedesc':{'type':Sequelize[_0x301d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x301d('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x301d('0x2')]},'accountcode':{'type':Sequelize[_0x301d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x301d('0x2')]},'destchannelstate':{'type':Sequelize[_0x301d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x301d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x301d('0x2')]},'destcalleridname':{'type':Sequelize[_0x301d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x301d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x301d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x301d('0x2')]},'destexten':{'type':Sequelize[_0x301d('0x2')]},'destpriority':{'type':Sequelize[_0x301d('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x301d('0x2')],'comment':_0x301d('0x6')},'transferexten':{'type':Sequelize[_0x301d('0x2')]},'transferuniqueid':{'type':Sequelize[_0x301d('0x2')]},'agententerreason':{'type':Sequelize[_0x301d('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index adc15a5..b040522 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(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 4fa8e20..ffddfeb 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 _0x5ad3=['uniqueid','destuniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x477c0c,_0x48b400){_0x477c0c=_0x477c0c-0x0;var _0x37d540=_0x5ad3[_0x477c0c];return _0x37d540;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));module[_0x35ad('0xa')]=function(_0x436dcb,_0x36c606){return _0x436dcb[_0x35ad('0xb')]('VoiceAgentReport',attributes,{'tableName':_0x35ad('0xc'),'paranoid':![],'indexes':[{'fields':[_0x35ad('0xd'),_0x35ad('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc18a=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xc18a,0x1cf));var _0xac18=function(_0x46a394,_0xc74b03){_0x46a394=_0x46a394-0x0;var _0x1b7534=_0xc18a[_0x46a394];return _0x1b7534;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var logger=require(_0xac18('0x2'))(_0xac18('0x3'));var moment=require('moment');var BPromise=require(_0xac18('0x4'));var rp=require(_0xac18('0x5'));var fs=require('fs');var path=require(_0xac18('0x6'));var rimraf=require(_0xac18('0x7'));var config=require(_0xac18('0x8'));var attributes=require(_0xac18('0x9'));module[_0xac18('0xa')]=function(_0x395493,_0x49136f){return _0x395493[_0xac18('0xb')](_0xac18('0xc'),attributes,{'tableName':_0xac18('0xd'),'paranoid':![],'indexes':[{'fields':[_0xac18('0xe'),_0xac18('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 5ae1a6e..d672038 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 _0x52e9=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','create','body','options','raw','info','CreateVoiceAgentReport','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','where','attributes','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x52056e,_0x263459){var _0x18efa1=function(_0x4ebb75){while(--_0x4ebb75){_0x52056e['push'](_0x52056e['shift']());}};_0x18efa1(++_0x263459);}(_0x52e9,0x1c0));var _0x952e=function(_0x3358ee,_0x4385dd){_0x3358ee=_0x3358ee-0x0;var _0x37cd98=_0x52e9[_0x3358ee];return _0x37cd98;};'use strict';var _=require('lodash');var util=require(_0x952e('0x0'));var moment=require(_0x952e('0x1'));var BPromise=require(_0x952e('0x2'));var rs=require(_0x952e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x952e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x952e('0x5'))(_0x952e('0x6'));var config=require(_0x952e('0x7'));var jayson=require(_0x952e('0x8'));var client=jayson[_0x952e('0x9')][_0x952e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41023f,_0x5ae512,_0x413b2f){return new BPromise(function(_0x492b96,_0x46fdd4){return client[_0x952e('0xb')](_0x41023f,_0x413b2f)[_0x952e('0xc')](function(_0x2c4179){logger['info'](_0x952e('0xd'),_0x5ae512,'request\x20sent');logger[_0x952e('0xe')](_0x952e('0xf'),_0x5ae512,_0x952e('0x10'),JSON['stringify'](_0x2c4179));if(_0x2c4179[_0x952e('0x11')]){if(_0x2c4179[_0x952e('0x11')][_0x952e('0x12')]===0x1f4){logger[_0x952e('0x11')](_0x952e('0xd'),_0x5ae512,_0x2c4179['error'][_0x952e('0x13')]);return _0x46fdd4(_0x2c4179['error']['message']);}logger[_0x952e('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x5ae512,_0x2c4179[_0x952e('0x11')][_0x952e('0x13')]);return _0x492b96(_0x2c4179[_0x952e('0x11')][_0x952e('0x13')]);}else{logger['info'](_0x952e('0xd'),_0x5ae512,_0x952e('0x10'));_0x492b96(_0x2c4179['result'][_0x952e('0x13')]);}})[_0x952e('0x14')](function(_0x2f374c){logger['error'](_0x952e('0xd'),_0x5ae512,_0x2f374c);_0x46fdd4(_0x2f374c);});});}exports['CreateVoiceAgentReport']=function(_0x1d76c6){var _0xe33479=this;return new Promise(function(_0x36fd82,_0x5db786){return db['VoiceAgentReport'][_0x952e('0x15')](_0x1d76c6[_0x952e('0x16')],{'raw':_0x1d76c6[_0x952e('0x17')]?_0x1d76c6[_0x952e('0x17')][_0x952e('0x18')]===undefined?!![]:![]:!![]})[_0x952e('0xc')](function(_0x3c5cda){logger[_0x952e('0x19')]('CreateVoiceAgentReport',_0x1d76c6);logger['debug'](_0x952e('0x1a'),_0x1d76c6,JSON[_0x952e('0x1b')](_0x3c5cda));_0x36fd82(_0x3c5cda);})[_0x952e('0x14')](function(_0x4c9cf3){logger['error'](_0x952e('0x1a'),_0x4c9cf3[_0x952e('0x13')],_0x1d76c6);_0x5db786(_0xe33479[_0x952e('0x11')](0x1f4,_0x4c9cf3[_0x952e('0x13')]));});});};exports[_0x952e('0x1c')]=function(_0x33b766){var _0x5bce38=this;return new Promise(function(_0x3eaf2e,_0x276ee7){return db[_0x952e('0x1d')][_0x952e('0x1e')](_0x33b766[_0x952e('0x16')],{'raw':_0x33b766[_0x952e('0x17')]?_0x33b766[_0x952e('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33b766[_0x952e('0x17')]?_0x33b766[_0x952e('0x17')][_0x952e('0x1f')]||null:null,'attributes':_0x33b766[_0x952e('0x17')]?_0x33b766[_0x952e('0x17')][_0x952e('0x20')]||null:null,'limit':_0x33b766['options']?_0x33b766[_0x952e('0x17')]['limit']||null:null})[_0x952e('0xc')](function(_0x23b8bd){logger[_0x952e('0x19')](_0x952e('0x1c'),_0x33b766);logger['debug'](_0x952e('0x1c'),_0x33b766,JSON[_0x952e('0x1b')](_0x23b8bd));_0x3eaf2e(_0x23b8bd);})[_0x952e('0x14')](function(_0x121c57){logger[_0x952e('0x11')](_0x952e('0x1c'),_0x121c57['message'],_0x33b766);_0x276ee7(_0x5bce38[_0x952e('0x11')](0x1f4,_0x121c57[_0x952e('0x13')]));});});}; \ No newline at end of file +var _0x0b82=['request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','update','where','attributes','lodash','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x424e11,_0x4a88f8){var _0x348260=function(_0x46a5c5){while(--_0x46a5c5){_0x424e11['push'](_0x424e11['shift']());}};_0x348260(++_0x4a88f8);}(_0x0b82,0x188));var _0x20b8=function(_0x25f448,_0x2c9729){_0x25f448=_0x25f448-0x0;var _0x150561=_0x0b82[_0x25f448];return _0x150561;};'use strict';var _=require(_0x20b8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x20b8('0x1'));var rs=require(_0x20b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20b8('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x20b8('0x4'));var config=require(_0x20b8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x20b8('0x6')][_0x20b8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbb0,_0xf23803,_0x593eda){return new BPromise(function(_0x3fe81a,_0x1000aa){return client[_0x20b8('0x8')](_0x5ecbb0,_0x593eda)[_0x20b8('0x9')](function(_0x2d6439){logger['info'](_0x20b8('0xa'),_0xf23803,_0x20b8('0xb'));logger['debug'](_0x20b8('0xc'),_0xf23803,_0x20b8('0xb'),JSON[_0x20b8('0xd')](_0x2d6439));if(_0x2d6439[_0x20b8('0xe')]){if(_0x2d6439[_0x20b8('0xe')][_0x20b8('0xf')]===0x1f4){logger[_0x20b8('0xe')](_0x20b8('0xa'),_0xf23803,_0x2d6439[_0x20b8('0xe')][_0x20b8('0x10')]);return _0x1000aa(_0x2d6439['error'][_0x20b8('0x10')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0xf23803,_0x2d6439[_0x20b8('0xe')][_0x20b8('0x10')]);return _0x3fe81a(_0x2d6439[_0x20b8('0xe')][_0x20b8('0x10')]);}else{logger[_0x20b8('0x11')](_0x20b8('0xa'),_0xf23803,_0x20b8('0xb'));_0x3fe81a(_0x2d6439[_0x20b8('0x12')]['message']);}})[_0x20b8('0x13')](function(_0x3a25d6){logger[_0x20b8('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0xf23803,_0x3a25d6);_0x1000aa(_0x3a25d6);});});}exports[_0x20b8('0x14')]=function(_0x1f5842){var _0x21934f=this;return new Promise(function(_0x223611,_0xefe102){return db[_0x20b8('0x15')][_0x20b8('0x16')](_0x1f5842[_0x20b8('0x17')],{'raw':_0x1f5842[_0x20b8('0x18')]?_0x1f5842[_0x20b8('0x18')][_0x20b8('0x19')]===undefined?!![]:![]:!![]})[_0x20b8('0x9')](function(_0x41643a){logger['info']('CreateVoiceAgentReport',_0x1f5842);logger[_0x20b8('0x1a')](_0x20b8('0x14'),_0x1f5842,JSON[_0x20b8('0xd')](_0x41643a));_0x223611(_0x41643a);})[_0x20b8('0x13')](function(_0x116c94){logger[_0x20b8('0xe')](_0x20b8('0x14'),_0x116c94['message'],_0x1f5842);_0xefe102(_0x21934f['error'](0x1f4,_0x116c94[_0x20b8('0x10')]));});});};exports[_0x20b8('0x1b')]=function(_0x2f57fe){var _0x4a45cd=this;return new Promise(function(_0x4377bd,_0x2c86e4){return db[_0x20b8('0x15')][_0x20b8('0x1c')](_0x2f57fe['body'],{'raw':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe[_0x20b8('0x18')][_0x20b8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe[_0x20b8('0x18')][_0x20b8('0x1d')]||null:null,'attributes':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe['options'][_0x20b8('0x1e')]||null:null,'limit':_0x2f57fe[_0x20b8('0x18')]?_0x2f57fe[_0x20b8('0x18')]['limit']||null:null})[_0x20b8('0x9')](function(_0x32d2f3){logger[_0x20b8('0x11')](_0x20b8('0x1b'),_0x2f57fe);logger[_0x20b8('0x1a')]('UpdateVoiceAgentReport',_0x2f57fe,JSON[_0x20b8('0xd')](_0x32d2f3));_0x4377bd(_0x32d2f3);})['catch'](function(_0x1734dc){logger['error']('UpdateVoiceAgentReport',_0x1734dc['message'],_0x2f57fe);_0x2c86e4(_0x4a45cd['error'](0x1f4,_0x1734dc[_0x20b8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 9507d57..117a8fb 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 _0xe5b3=['../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xb86669,_0x1d5ba4){var _0x1e7e75=function(_0x1f2530){while(--_0x1f2530){_0xb86669['push'](_0xb86669['shift']());}};_0x1e7e75(++_0x1d5ba4);}(_0xe5b3,0x133));var _0x3e5b=function(_0x986575,_0x15385d){_0x986575=_0x986575-0x0;var _0x16c1ae=_0xe5b3[_0x986575];return _0x16c1ae;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/describe',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xa')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3e5b('0xf')]('/',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0x11')](_0x3e5b('0xe'),auth['isAuthenticated'](),controller[_0x3e5b('0x12')]);router['delete'](_0x3e5b('0xe'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x13')]);module[_0x3e5b('0x14')]=router; \ No newline at end of file +var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','delete','destroy'];(function(_0x4c9eea,_0x296295){var _0x21f20c=function(_0x51cc14){while(--_0x51cc14){_0x4c9eea['push'](_0x4c9eea['shift']());}};_0x21f20c(++_0x296295);}(_0x2bd8,0x130));var _0x82bd=function(_0x27a8cf,_0x37ad37){_0x27a8cf=_0x27a8cf-0x0;var _0x1b0e6e=_0x2bd8[_0x27a8cf];return _0x1b0e6e;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')]('/',auth[_0x82bd('0xa')](),controller['index']);router[_0x82bd('0x9')](_0x82bd('0xb'),auth[_0x82bd('0xa')](),controller[_0x82bd('0xc')]);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x82bd('0xa')](),controller['create']);router['put'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x82bd('0xe')](_0x82bd('0xd'),auth['isAuthenticated'](),controller[_0x82bd('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 8b8f3f4..8794111 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 _0xa6ee=['inbound','outbound-fax','dialer','DATE','INTEGER','exports','STRING'];(function(_0x3476bb,_0x39ec58){var _0x12151b=function(_0x585dcf){while(--_0x585dcf){_0x3476bb['push'](_0x3476bb['shift']());}};_0x12151b(++_0x39ec58);}(_0xa6ee,0x1a9));var _0xea6e=function(_0x248161,_0x35bc54){_0x248161=_0x248161-0x0;var _0x410709=_0xa6ee[_0x248161];return _0x410709;};'use strict';var Sequelize=require('sequelize');module[_0xea6e('0x0')]={'uniqueid':{'type':Sequelize[_0xea6e('0x1')]},'type':{'type':Sequelize['ENUM'](_0xea6e('0x2'),'internal','outbound','inbound-fax',_0xea6e('0x3'),_0xea6e('0x4'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xea6e('0x1')]},'source':{'type':Sequelize[_0xea6e('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xea6e('0x1')]},'destinationchannel':{'type':Sequelize[_0xea6e('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xea6e('0x5')]},'systemanswertime':{'type':Sequelize[_0xea6e('0x5')]},'answertime':{'type':Sequelize[_0xea6e('0x5')]},'endtime':{'type':Sequelize[_0xea6e('0x5')]},'duration':{'type':Sequelize[_0xea6e('0x6')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xea6e('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xea6e('0x1')]},'userDisposition':{'type':Sequelize[_0xea6e('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xea6e('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xea6e('0x1')]},'prefix':{'type':Sequelize[_0xea6e('0x1')]},'routeid':{'type':Sequelize[_0xea6e('0x6')]},'sipcallid':{'type':Sequelize[_0xea6e('0x1')]}}; \ No newline at end of file +var _0x6ff6=['outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','STRING','ENUM','inbound','internal'];(function(_0x42defa,_0x2691fd){var _0x18eba1=function(_0x278bd1){while(--_0x278bd1){_0x42defa['push'](_0x42defa['shift']());}};_0x18eba1(++_0x2691fd);}(_0x6ff6,0x182));var _0x66ff=function(_0x4da5d7,_0x55aa3c){_0x4da5d7=_0x4da5d7-0x0;var _0xc1b2ee=_0x6ff6[_0x4da5d7];return _0xc1b2ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x66ff('0x0')]},'type':{'type':Sequelize[_0x66ff('0x1')](_0x66ff('0x2'),_0x66ff('0x3'),_0x66ff('0x4'),_0x66ff('0x5'),_0x66ff('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x66ff('0x0')]},'source':{'type':Sequelize[_0x66ff('0x0')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x66ff('0x0')]},'channel':{'type':Sequelize[_0x66ff('0x0')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x66ff('0x0')]},'lastdata':{'type':Sequelize[_0x66ff('0x7')]},'starttime':{'type':Sequelize[_0x66ff('0x8')]},'systemanswertime':{'type':Sequelize[_0x66ff('0x8')]},'answertime':{'type':Sequelize[_0x66ff('0x8')]},'endtime':{'type':Sequelize[_0x66ff('0x8')]},'duration':{'type':Sequelize[_0x66ff('0x9')]},'billableseconds':{'type':Sequelize[_0x66ff('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x66ff('0x0')]},'userSecondDisposition':{'type':Sequelize[_0x66ff('0x0')]},'userThirdDisposition':{'type':Sequelize[_0x66ff('0x0')]},'note':{'type':Sequelize[_0x66ff('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x66ff('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 6eaade0..a24b2cb 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x1e0910,_0x37b7ce){var _0x10645a=function(_0x4095e4){while(--_0x4095e4){_0x1e0910['push'](_0x1e0910['shift']());}};_0x10645a(++_0x37b7ce);}(_0xb10b,0x12a));var _0xbb10=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0xb10b[_0x27c25f];return _0x2da4c4;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0xadb5,0xad));var _0x5adb=function(_0x5db89b,_0x1c0df3){_0x5db89b=_0x5db89b-0x0;var _0x461cbe=_0xadb5[_0x5db89b];return _0x461cbe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index a5674b9..dc76dee 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 _0x9baa=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','uniqueid','util','moment','bluebird','request-promise','path'];(function(_0x5b1f78,_0x1d30b2){var _0x1903d8=function(_0x41a256){while(--_0x41a256){_0x5b1f78['push'](_0x5b1f78['shift']());}};_0x1903d8(++_0x1d30b2);}(_0x9baa,0x187));var _0xa9ba=function(_0x597eb2,_0x165f5c){_0x597eb2=_0x597eb2-0x0;var _0x56875f=_0x9baa[_0x597eb2];return _0x56875f;};'use strict';var _=require('lodash');var util=require(_0xa9ba('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa9ba('0x1'));var BPromise=require(_0xa9ba('0x2'));var rp=require(_0xa9ba('0x3'));var fs=require('fs');var path=require(_0xa9ba('0x4'));var rimraf=require(_0xa9ba('0x5'));var config=require(_0xa9ba('0x6'));var attributes=require(_0xa9ba('0x7'));module[_0xa9ba('0x8')]=function(_0x10526a,_0x3a43e3){return _0x10526a[_0xa9ba('0x9')]('VoiceCallReport',attributes,{'tableName':_0xa9ba('0xa'),'paranoid':![],'indexes':[{'fields':[_0xa9ba('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7181=['../../config/environment','exports','define','VoiceCallReport','report_call','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x7181,0x125));var _0x1718=function(_0x49a57c,_0x2eb02c){_0x49a57c=_0x49a57c-0x0;var _0x4e0316=_0x7181[_0x49a57c];return _0x4e0316;};'use strict';var _=require(_0x1718('0x0'));var util=require(_0x1718('0x1'));var logger=require(_0x1718('0x2'))(_0x1718('0x3'));var moment=require('moment');var BPromise=require(_0x1718('0x4'));var rp=require(_0x1718('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1718('0x6'));var config=require(_0x1718('0x7'));var attributes=require('./voiceCallReport.attributes');module[_0x1718('0x8')]=function(_0x36e3ac,_0x39e68c){return _0x36e3ac[_0x1718('0x9')](_0x1718('0xa'),attributes,{'tableName':_0x1718('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f757ea8..9b4573a 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 _0x28de=['where','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','options','raw'];(function(_0x22b8bc,_0x4c70ef){var _0x5a8dff=function(_0x304f33){while(--_0x304f33){_0x22b8bc['push'](_0x22b8bc['shift']());}};_0x5a8dff(++_0x4c70ef);}(_0x28de,0x16c));var _0xe28d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x28de[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe28d('0x0'));var util=require(_0xe28d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe28d('0x2'));var fs=require('fs');var Redis=require(_0xe28d('0x3'));var db=require(_0xe28d('0x4'))['db'];var utils=require(_0xe28d('0x5'));var logger=require('../../config/logger')(_0xe28d('0x6'));var config=require(_0xe28d('0x7'));var jayson=require(_0xe28d('0x8'));var client=jayson[_0xe28d('0x9')][_0xe28d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3432be,_0x5b8ba9,_0x5bcf17){return new BPromise(function(_0x4fdc8e,_0x3db73c){return client[_0xe28d('0xb')](_0x3432be,_0x5bcf17)[_0xe28d('0xc')](function(_0x2cd741){logger[_0xe28d('0xd')](_0xe28d('0xe'),_0x5b8ba9,'request\x20sent');logger[_0xe28d('0xf')](_0xe28d('0x10'),_0x5b8ba9,'request\x20sent',JSON[_0xe28d('0x11')](_0x2cd741));if(_0x2cd741['error']){if(_0x2cd741[_0xe28d('0x12')]['code']===0x1f4){logger['error'](_0xe28d('0xe'),_0x5b8ba9,_0x2cd741[_0xe28d('0x12')]['message']);return _0x3db73c(_0x2cd741[_0xe28d('0x12')][_0xe28d('0x13')]);}logger[_0xe28d('0x12')](_0xe28d('0xe'),_0x5b8ba9,_0x2cd741['error'][_0xe28d('0x13')]);return _0x4fdc8e(_0x2cd741[_0xe28d('0x12')][_0xe28d('0x13')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x5b8ba9,_0xe28d('0x14'));_0x4fdc8e(_0x2cd741[_0xe28d('0x15')][_0xe28d('0x13')]);}})[_0xe28d('0x16')](function(_0x2f7022){logger['error'](_0xe28d('0xe'),_0x5b8ba9,_0x2f7022);_0x3db73c(_0x2f7022);});});}exports['GetVoiceCallReport']=function(_0x518183){var _0x5b8728=this;return new Promise(function(_0x293e00,_0x541eda){return db['VoiceCallReport'][_0xe28d('0x17')]({'raw':_0x518183[_0xe28d('0x18')]?_0x518183['options'][_0xe28d('0x19')]===undefined?!![]:![]:!![],'where':_0x518183['options']?_0x518183[_0xe28d('0x18')][_0xe28d('0x1a')]||null:null,'attributes':_0x518183[_0xe28d('0x18')]?_0x518183[_0xe28d('0x18')][_0xe28d('0x1b')]||null:null,'limit':_0x518183[_0xe28d('0x18')]?_0x518183['options'][_0xe28d('0x1c')]||null:null,'include':_0x518183[_0xe28d('0x18')]?_0x518183[_0xe28d('0x18')][_0xe28d('0x1d')]?_['map'](_0x518183['options'][_0xe28d('0x1d')],function(_0x29a56c){return{'model':db[_0x29a56c['model']],'as':_0x29a56c['as'],'attributes':_0x29a56c['attributes'],'include':_0x29a56c[_0xe28d('0x1d')]?_[_0xe28d('0x1e')](_0x29a56c[_0xe28d('0x1d')],function(_0x153ff7){return{'model':db[_0x153ff7[_0xe28d('0x1f')]],'as':_0x153ff7['as'],'attributes':_0x153ff7[_0xe28d('0x1b')],'include':_0x153ff7[_0xe28d('0x1d')]?_[_0xe28d('0x1e')](_0x153ff7[_0xe28d('0x1d')],function(_0x7b73){return{'model':db[_0x7b73[_0xe28d('0x1f')]],'as':_0x7b73['as'],'attributes':_0x7b73[_0xe28d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe28d('0xc')](function(_0x153e1f){logger['info']('GetVoiceCallReport',_0x518183);logger[_0xe28d('0xf')](_0xe28d('0x20'),_0x518183,JSON[_0xe28d('0x11')](_0x153e1f));_0x293e00(_0x153e1f);})[_0xe28d('0x16')](function(_0x139639){logger['error'](_0xe28d('0x20'),_0x139639[_0xe28d('0x13')],_0x518183);_0x541eda(_0x5b8728['error'](0x1f4,_0x139639[_0xe28d('0x13')]));});});};exports[_0xe28d('0x21')]=function(_0x1ba5d5){var _0x341f07=this;return new Promise(function(_0x5ef501,_0x11fec){return db[_0xe28d('0x22')][_0xe28d('0x23')](_0x1ba5d5[_0xe28d('0x24')],{'raw':_0x1ba5d5[_0xe28d('0x18')]?_0x1ba5d5['options'][_0xe28d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x434d72){logger[_0xe28d('0xd')](_0xe28d('0x21'),_0x1ba5d5);logger[_0xe28d('0xf')](_0xe28d('0x21'),_0x1ba5d5,JSON[_0xe28d('0x11')](_0x434d72));_0x5ef501(_0x434d72);})[_0xe28d('0x16')](function(_0x1d817c){logger[_0xe28d('0x12')](_0xe28d('0x21'),_0x1d817c[_0xe28d('0x13')],_0x1ba5d5);_0x11fec(_0x341f07[_0xe28d('0x12')](0x1f4,_0x1d817c['message']));});});};exports[_0xe28d('0x25')]=function(_0x39e1be){var _0x5fddb2=this;return new Promise(function(_0x2ef276,_0x52d21f){return db[_0xe28d('0x22')][_0xe28d('0x26')](_0x39e1be[_0xe28d('0x24')],{'raw':_0x39e1be[_0xe28d('0x18')]?_0x39e1be['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39e1be[_0xe28d('0x18')]?_0x39e1be[_0xe28d('0x18')][_0xe28d('0x1a')]||null:null,'attributes':_0x39e1be[_0xe28d('0x18')]?_0x39e1be[_0xe28d('0x18')][_0xe28d('0x1b')]||null:null,'limit':_0x39e1be[_0xe28d('0x18')]?_0x39e1be['options'][_0xe28d('0x1c')]||null:null})['then'](function(_0x1ee7ef){logger[_0xe28d('0xd')]('UpdateVoiceCallReport',_0x39e1be);logger[_0xe28d('0xf')](_0xe28d('0x25'),_0x39e1be,JSON[_0xe28d('0x11')](_0x1ee7ef));_0x2ef276(_0x1ee7ef);})[_0xe28d('0x16')](function(_0x314ae8){logger['error'](_0xe28d('0x25'),_0x314ae8['message'],_0x39e1be);_0x52d21f(_0x5fddb2[_0xe28d('0x12')](0x1f4,_0x314ae8[_0xe28d('0x13')]));});});}; \ No newline at end of file +var _0xcad4=['where','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','attributes','limit','include','map','model','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcad4,0x17d));var _0x4cad=function(_0x3d3ea7,_0x44658c){_0x3d3ea7=_0x3d3ea7-0x0;var _0x17f988=_0xcad4[_0x3d3ea7];return _0x17f988;};'use strict';var _=require(_0x4cad('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4cad('0x1'));var fs=require('fs');var Redis=require(_0x4cad('0x2'));var db=require(_0x4cad('0x3'))['db'];var utils=require(_0x4cad('0x4'));var logger=require(_0x4cad('0x5'))(_0x4cad('0x6'));var config=require(_0x4cad('0x7'));var jayson=require(_0x4cad('0x8'));var client=jayson[_0x4cad('0x9')][_0x4cad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x411411,_0x14a71c,_0x4cc0a7){return new BPromise(function(_0x481c4c,_0x50fea9){return client[_0x4cad('0xb')](_0x411411,_0x4cc0a7)[_0x4cad('0xc')](function(_0x37a8be){logger[_0x4cad('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x14a71c,_0x4cad('0xe'));logger[_0x4cad('0xf')](_0x4cad('0x10'),_0x14a71c,_0x4cad('0xe'),JSON['stringify'](_0x37a8be));if(_0x37a8be[_0x4cad('0x11')]){if(_0x37a8be['error'][_0x4cad('0x12')]===0x1f4){logger[_0x4cad('0x11')](_0x4cad('0x13'),_0x14a71c,_0x37a8be[_0x4cad('0x11')][_0x4cad('0x14')]);return _0x50fea9(_0x37a8be[_0x4cad('0x11')][_0x4cad('0x14')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x14a71c,_0x37a8be['error'][_0x4cad('0x14')]);return _0x481c4c(_0x37a8be[_0x4cad('0x11')][_0x4cad('0x14')]);}else{logger[_0x4cad('0xd')](_0x4cad('0x13'),_0x14a71c,'request\x20sent');_0x481c4c(_0x37a8be[_0x4cad('0x15')][_0x4cad('0x14')]);}})[_0x4cad('0x16')](function(_0x30febf){logger[_0x4cad('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x14a71c,_0x30febf);_0x50fea9(_0x30febf);});});}exports[_0x4cad('0x17')]=function(_0x330001){var _0x304265=this;return new Promise(function(_0x5668d2,_0x4c3641){return db[_0x4cad('0x18')]['findAll']({'raw':_0x330001[_0x4cad('0x19')]?_0x330001[_0x4cad('0x19')][_0x4cad('0x1a')]===undefined?!![]:![]:!![],'where':_0x330001[_0x4cad('0x19')]?_0x330001[_0x4cad('0x19')]['where']||null:null,'attributes':_0x330001[_0x4cad('0x19')]?_0x330001[_0x4cad('0x19')][_0x4cad('0x1b')]||null:null,'limit':_0x330001[_0x4cad('0x19')]?_0x330001['options'][_0x4cad('0x1c')]||null:null,'include':_0x330001['options']?_0x330001[_0x4cad('0x19')][_0x4cad('0x1d')]?_[_0x4cad('0x1e')](_0x330001['options']['include'],function(_0x586ee5){return{'model':db[_0x586ee5['model']],'as':_0x586ee5['as'],'attributes':_0x586ee5[_0x4cad('0x1b')],'include':_0x586ee5[_0x4cad('0x1d')]?_[_0x4cad('0x1e')](_0x586ee5[_0x4cad('0x1d')],function(_0x2754e6){return{'model':db[_0x2754e6['model']],'as':_0x2754e6['as'],'attributes':_0x2754e6[_0x4cad('0x1b')],'include':_0x2754e6[_0x4cad('0x1d')]?_['map'](_0x2754e6[_0x4cad('0x1d')],function(_0x4d7d41){return{'model':db[_0x4d7d41[_0x4cad('0x1f')]],'as':_0x4d7d41['as'],'attributes':_0x4d7d41[_0x4cad('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4cad('0xc')](function(_0x53cde8){logger[_0x4cad('0xd')]('GetVoiceCallReport',_0x330001);logger[_0x4cad('0xf')](_0x4cad('0x17'),_0x330001,JSON['stringify'](_0x53cde8));_0x5668d2(_0x53cde8);})[_0x4cad('0x16')](function(_0x2d224b){logger[_0x4cad('0x11')]('GetVoiceCallReport',_0x2d224b[_0x4cad('0x14')],_0x330001);_0x4c3641(_0x304265['error'](0x1f4,_0x2d224b[_0x4cad('0x14')]));});});};exports[_0x4cad('0x20')]=function(_0x4f7d40){var _0x332d99=this;return new Promise(function(_0x25b43c,_0x56df4b){return db[_0x4cad('0x18')]['create'](_0x4f7d40['body'],{'raw':_0x4f7d40['options']?_0x4f7d40[_0x4cad('0x19')][_0x4cad('0x1a')]===undefined?!![]:![]:!![]})[_0x4cad('0xc')](function(_0x3b912d){logger[_0x4cad('0xd')](_0x4cad('0x20'),_0x4f7d40);logger[_0x4cad('0xf')]('CreateVoiceCallReport',_0x4f7d40,JSON[_0x4cad('0x21')](_0x3b912d));_0x25b43c(_0x3b912d);})[_0x4cad('0x16')](function(_0x4400c0){logger['error']('CreateVoiceCallReport',_0x4400c0['message'],_0x4f7d40);_0x56df4b(_0x332d99[_0x4cad('0x11')](0x1f4,_0x4400c0[_0x4cad('0x14')]));});});};exports[_0x4cad('0x22')]=function(_0x1c78f3){var _0x2c2b9c=this;return new Promise(function(_0x1a2f9e,_0x52fb7c){return db[_0x4cad('0x18')][_0x4cad('0x23')](_0x1c78f3[_0x4cad('0x24')],{'raw':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3['options'][_0x4cad('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3[_0x4cad('0x19')][_0x4cad('0x25')]||null:null,'attributes':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3[_0x4cad('0x19')][_0x4cad('0x1b')]||null:null,'limit':_0x1c78f3[_0x4cad('0x19')]?_0x1c78f3[_0x4cad('0x19')][_0x4cad('0x1c')]||null:null})['then'](function(_0x3ede67){logger[_0x4cad('0xd')]('UpdateVoiceCallReport',_0x1c78f3);logger[_0x4cad('0xf')](_0x4cad('0x22'),_0x1c78f3,JSON[_0x4cad('0x21')](_0x3ede67));_0x1a2f9e(_0x3ede67);})[_0x4cad('0x16')](function(_0x469a2c){logger[_0x4cad('0x11')](_0x4cad('0x22'),_0x469a2c[_0x4cad('0x14')],_0x1c78f3);_0x52fb7c(_0x2c2b9c[_0x4cad('0x11')](0x1f4,_0x469a2c[_0x4cad('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index bc19fcd..bf429f2 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 _0x6ad2=['show','post','update','delete','destroy','exports','util','path','connect-timeout','express','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id'];(function(_0xb6c24b,_0x34d65f){var _0x9a4123=function(_0xeba66e){while(--_0xeba66e){_0xb6c24b['push'](_0xb6c24b['shift']());}};_0x9a4123(++_0x34d65f);}(_0x6ad2,0x156));var _0x26ad=function(_0xdbf14f,_0x4bfcc4){_0xdbf14f=_0xdbf14f-0x0;var _0x3e58a2=_0x6ad2[_0xdbf14f];return _0x3e58a2;};'use strict';var multer=require('multer');var util=require(_0x26ad('0x0'));var path=require(_0x26ad('0x1'));var timeout=require(_0x26ad('0x2'));var express=require(_0x26ad('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(_0x26ad('0x4'));var controller=require(_0x26ad('0x5'));router[_0x26ad('0x6')]('/',auth[_0x26ad('0x7')](),controller[_0x26ad('0x8')]);router[_0x26ad('0x6')](_0x26ad('0x9'),auth['isAuthenticated'](),controller[_0x26ad('0xa')]);router[_0x26ad('0xb')]('/',auth[_0x26ad('0x7')](),controller['create']);router['put'](_0x26ad('0x9'),auth['isAuthenticated'](),controller[_0x26ad('0xc')]);router[_0x26ad('0xd')](_0x26ad('0x9'),auth[_0x26ad('0x7')](),controller[_0x26ad('0xe')]);module[_0x26ad('0xf')]=router; \ No newline at end of file +var _0x9665=['index','/:id','update','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9665,0x7c));var _0x5966=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9665[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5966('0x0'));var util=require(_0x5966('0x1'));var path=require(_0x5966('0x2'));var timeout=require('connect-timeout');var express=require(_0x5966('0x3'));var router=express['Router']();var fs_extra=require(_0x5966('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5966('0x5'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x5966('0x6')]('/',auth[_0x5966('0x7')](),controller[_0x5966('0x8')]);router[_0x5966('0x6')](_0x5966('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5966('0x7')](),controller['create']);router['put'](_0x5966('0x9'),auth[_0x5966('0x7')](),controller[_0x5966('0xa')]);router['delete'](_0x5966('0x9'),auth['isAuthenticated'](),controller[_0x5966('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index e3794d2..5fbb36d 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 _0x4719=['join','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x3090ba,_0x3307dc){var _0x5b560c=function(_0x298f70){while(--_0x298f70){_0x3090ba['push'](_0x3090ba['shift']());}};_0x5b560c(++_0x3307dc);}(_0x4719,0x137));var _0x9471=function(_0x4dfacb,_0x7e46f){_0x4dfacb=_0x4dfacb-0x0;var _0x4456f5=_0x4719[_0x4dfacb];return _0x4456f5;};'use strict';var Sequelize=require(_0x9471('0x0'));module[_0x9471('0x1')]={'name':{'type':Sequelize[_0x9471('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x9471('0x2')],'set':function(_0x22ddff){this[_0x9471('0x3')]('options',_0x22ddff?_0x22ddff[_0x9471('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x9471('0x5'))?this[_0x9471('0x6')]('options')[_0x9471('0x7')](''):[];}},'auth':{'type':Sequelize[_0x9471('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x9471('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x9471('0x2')]},'description':{'type':Sequelize[_0x9471('0x2')]}}; \ No newline at end of file +var _0xa995=['join','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','options'];(function(_0x3d2b6d,_0x1c710e){var _0x268764=function(_0x3777d5){while(--_0x3777d5){_0x3d2b6d['push'](_0x3d2b6d['shift']());}};_0x268764(++_0x1c710e);}(_0xa995,0x1c5));var _0x5a99=function(_0x39e35a,_0x4e6d78){_0x39e35a=_0x39e35a-0x0;var _0x413fda=_0xa995[_0x39e35a];return _0x413fda;};'use strict';var Sequelize=require(_0x5a99('0x0'));module[_0x5a99('0x1')]={'name':{'type':Sequelize[_0x5a99('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x5a99('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x5a99('0x2')],'set':function(_0x4e8a2c){this[_0x5a99('0x4')](_0x5a99('0x5'),_0x4e8a2c?_0x4e8a2c[_0x5a99('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x5a99('0x5'))?this['getDataValue'](_0x5a99('0x5'))[_0x5a99('0x7')](''):[];}},'auth':{'type':Sequelize[_0x5a99('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x5a99('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5a99('0x2')]},'description':{'type':Sequelize[_0x5a99('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index b608d09..8d4420b 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 _0x07c3=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','then','destroy','get','ChanSpies','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type'];(function(_0x24ad3b,_0x404f9f){var _0x218419=function(_0x25aa50){while(--_0x25aa50){_0x24ad3b['push'](_0x24ad3b['shift']());}};_0x218419(++_0x404f9f);}(_0x07c3,0x1bf));var _0x307c=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x07c3[_0x22377a];return _0x36f105;};'use strict';var emlformat=require(_0x307c('0x0'));var rimraf=require(_0x307c('0x1'));var zipdir=require(_0x307c('0x2'));var jsonpatch=require(_0x307c('0x3'));var rp=require(_0x307c('0x4'));var moment=require(_0x307c('0x5'));var BPromise=require(_0x307c('0x6'));var Mustache=require(_0x307c('0x7'));var util=require('util');var path=require(_0x307c('0x8'));var sox=require(_0x307c('0x9'));var csv=require(_0x307c('0xa'));var ejs=require(_0x307c('0xb'));var fs=require('fs');var fs_extra=require(_0x307c('0xc'));var _=require(_0x307c('0xd'));var squel=require(_0x307c('0xe'));var crypto=require(_0x307c('0xf'));var jsforce=require(_0x307c('0x10'));var deskjs=require(_0x307c('0x11'));var toCsv=require(_0x307c('0xa'));var querystring=require(_0x307c('0x12'));var Papa=require(_0x307c('0x13'));var Redis=require(_0x307c('0x14'));var authService=require(_0x307c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x307c('0x16'));var hardwareService=require(_0x307c('0x17'));var logger=require(_0x307c('0x18'))(_0x307c('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x307c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c21fb,_0x1a00ec){_0x1a00ec=_0x1a00ec||0xcc;return function(_0x4d2559){if(_0x4d2559){return _0x3c21fb[_0x307c('0x1b')](_0x1a00ec);}return _0x3c21fb[_0x307c('0x1c')](_0x1a00ec)[_0x307c('0x1d')]();};}function respondWithResult(_0x45ef78,_0x4193d8){_0x4193d8=_0x4193d8||0xc8;return function(_0x2ea8c3){if(_0x2ea8c3){return _0x45ef78[_0x307c('0x1c')](_0x4193d8)[_0x307c('0x1e')](_0x2ea8c3);}};}function respondWithFilteredResult(_0x65678e,_0x38f028){return function(_0x405273){if(_0x405273){var _0x424a74=typeof _0x38f028['offset']===_0x307c('0x1f')&&typeof _0x38f028[_0x307c('0x20')]===_0x307c('0x1f');var _0x2f44ce=_0x405273[_0x307c('0x21')];var _0x2e21a6=_0x424a74?0x0:_0x38f028[_0x307c('0x22')];var _0x13f03b=_0x424a74?_0x405273[_0x307c('0x21')]:_0x38f028['offset']+_0x38f028['limit'];var _0x3bbb1e;if(_0x13f03b>=_0x2f44ce){_0x13f03b=_0x2f44ce;_0x3bbb1e=0xc8;}else{_0x3bbb1e=0xce;}_0x65678e['status'](_0x3bbb1e);return _0x65678e[_0x307c('0x23')]('Content-Range',_0x2e21a6+'-'+_0x13f03b+'/'+_0x2f44ce)['json'](_0x405273);}return null;};}function patchUpdates(_0x4bcc1a){return function(_0x25a503){try{jsonpatch['apply'](_0x25a503,_0x4bcc1a,!![]);}catch(_0x2b07da){return BPromise[_0x307c('0x24')](_0x2b07da);}return _0x25a503['save']();};}function saveUpdates(_0x1cdc48,_0x45fe2){return function(_0x574622){if(_0x574622){return _0x574622[_0x307c('0x25')](_0x1cdc48)[_0x307c('0x26')](function(_0x9a66a0){return _0x9a66a0;});}return null;};}function removeEntity(_0x519985,_0x36802c){return function(_0x2b5f2f){if(_0x2b5f2f){return _0x2b5f2f[_0x307c('0x27')]()[_0x307c('0x26')](function(){var _0xa278fc=_0x2b5f2f[_0x307c('0x28')]({'plain':!![]});var _0x5da864=_0x307c('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x5da864,'resourceId':_0xa278fc['id']}})[_0x307c('0x26')](function(){return _0x2b5f2f;});})[_0x307c('0x26')](function(){_0x519985[_0x307c('0x1c')](0xcc)[_0x307c('0x1d')]();});}};}function handleEntityNotFound(_0x25dede,_0x1591d1){return function(_0x4fd125){if(!_0x4fd125){_0x25dede[_0x307c('0x1b')](0x194);}return _0x4fd125;};}function handleError(_0x181fa2,_0x2ebab3){_0x2ebab3=_0x2ebab3||0x1f4;return function(_0x54da33){logger[_0x307c('0x2a')](_0x54da33[_0x307c('0x2b')]);if(_0x54da33[_0x307c('0x2c')]){delete _0x54da33[_0x307c('0x2c')];}_0x181fa2[_0x307c('0x1c')](_0x2ebab3)[_0x307c('0x2d')](_0x54da33);};}exports['index']=function(_0x1203f6,_0x1e448e){var _0x27dba3={},_0x313fcf={},_0x912246={'count':0x0,'rows':[]};var _0x80a20c=_[_0x307c('0x2e')](db[_0x307c('0x2f')][_0x307c('0x30')],function(_0x55f4c0){return{'name':_0x55f4c0[_0x307c('0x31')],'type':_0x55f4c0[_0x307c('0x32')][_0x307c('0x33')]};});_0x313fcf[_0x307c('0x34')]=_[_0x307c('0x2e')](_0x80a20c,_0x307c('0x2c'));_0x313fcf[_0x307c('0x35')]=_[_0x307c('0x36')](_0x1203f6[_0x307c('0x35')]);_0x313fcf[_0x307c('0x37')]=_[_0x307c('0x38')](_0x313fcf['model'],_0x313fcf[_0x307c('0x35')]);_0x27dba3[_0x307c('0x39')]=_['intersection'](_0x313fcf[_0x307c('0x34')],qs[_0x307c('0x3a')](_0x1203f6['query'][_0x307c('0x3a')]));_0x27dba3['attributes']=_0x27dba3[_0x307c('0x39')][_0x307c('0x3b')]?_0x27dba3[_0x307c('0x39')]:_0x313fcf[_0x307c('0x34')];if(!_0x1203f6[_0x307c('0x35')][_0x307c('0x3c')](_0x307c('0x3d'))){_0x27dba3['limit']=qs[_0x307c('0x20')](_0x1203f6[_0x307c('0x35')][_0x307c('0x20')]);_0x27dba3[_0x307c('0x22')]=qs[_0x307c('0x22')](_0x1203f6[_0x307c('0x35')][_0x307c('0x22')]);}_0x27dba3['order']=qs['sort'](_0x1203f6['query'][_0x307c('0x3e')]);_0x27dba3[_0x307c('0x3f')]=qs[_0x307c('0x37')](_['pick'](_0x1203f6[_0x307c('0x35')],_0x313fcf['filters']),_0x80a20c);if(_0x1203f6[_0x307c('0x35')][_0x307c('0x40')]){_0x27dba3[_0x307c('0x3f')]=_[_0x307c('0x41')](_0x27dba3[_0x307c('0x3f')],{'$or':_[_0x307c('0x2e')](_0x80a20c,function(_0x34fea9){if(_0x34fea9[_0x307c('0x32')]!=='VIRTUAL'){var _0x2d7544={};_0x2d7544[_0x34fea9['name']]={'$like':'%'+_0x1203f6[_0x307c('0x35')]['filter']+'%'};return _0x2d7544;}})});}_0x27dba3=_[_0x307c('0x41')]({},_0x27dba3,_0x1203f6[_0x307c('0x42')]);var _0x25f65e={'where':_0x27dba3[_0x307c('0x3f')]};return db[_0x307c('0x2f')][_0x307c('0x21')](_0x25f65e)[_0x307c('0x26')](function(_0x45cc33){_0x912246[_0x307c('0x21')]=_0x45cc33;if(_0x1203f6[_0x307c('0x35')][_0x307c('0x43')]){_0x27dba3[_0x307c('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x27dba3);})[_0x307c('0x26')](function(_0x264aa8){_0x912246[_0x307c('0x45')]=_0x264aa8;return _0x912246;})[_0x307c('0x26')](respondWithFilteredResult(_0x1e448e,_0x27dba3))[_0x307c('0x46')](handleError(_0x1e448e,null));};exports[_0x307c('0x47')]=function(_0x4a7f36,_0x492f8d){var _0x104aa4={'raw':![],'where':{'id':_0x4a7f36[_0x307c('0x48')]['id']}},_0x5d7d0d={};_0x5d7d0d[_0x307c('0x34')]=_[_0x307c('0x36')](db['VoiceChanSpy'][_0x307c('0x30')]);_0x5d7d0d[_0x307c('0x35')]=_[_0x307c('0x36')](_0x4a7f36[_0x307c('0x35')]);_0x5d7d0d[_0x307c('0x37')]=_['intersection'](_0x5d7d0d[_0x307c('0x34')],_0x5d7d0d[_0x307c('0x35')]);_0x104aa4['attributes']=_[_0x307c('0x38')](_0x5d7d0d[_0x307c('0x34')],qs[_0x307c('0x3a')](_0x4a7f36[_0x307c('0x35')][_0x307c('0x3a')]));_0x104aa4[_0x307c('0x39')]=_0x104aa4[_0x307c('0x39')]['length']?_0x104aa4[_0x307c('0x39')]:_0x5d7d0d[_0x307c('0x34')];if(_0x4a7f36[_0x307c('0x35')]['includeAll']){_0x104aa4[_0x307c('0x44')]=[{'all':!![]}];}_0x104aa4=_[_0x307c('0x41')]({},_0x104aa4,_0x4a7f36[_0x307c('0x42')]);return db[_0x307c('0x2f')]['find'](_0x104aa4)[_0x307c('0x26')](handleEntityNotFound(_0x492f8d,null))['then'](respondWithResult(_0x492f8d,null))['catch'](handleError(_0x492f8d,null));};exports['create']=function(_0x26081b,_0x9820dc){return db[_0x307c('0x2f')][_0x307c('0x49')](_0x26081b['body'],{})[_0x307c('0x26')](function(_0x42263f){var _0x398ef5=_0x26081b[_0x307c('0x4a')][_0x307c('0x28')]({'plain':!![]});if(!_0x398ef5)throw new Error(_0x307c('0x4b'));if(_0x398ef5[_0x307c('0x4c')]==='user'){var _0x50876a=_0x42263f[_0x307c('0x28')]({'plain':!![]});var _0x424a92=_0x307c('0x29');return db[_0x307c('0x4d')][_0x307c('0x4e')]({'where':{'name':_0x424a92,'userProfileId':_0x398ef5[_0x307c('0x4f')]},'raw':!![]})[_0x307c('0x26')](function(_0x58e3ff){if(_0x58e3ff&&_0x58e3ff['autoAssociation']===0x0){return db[_0x307c('0x50')][_0x307c('0x49')]({'name':_0x50876a[_0x307c('0x2c')],'resourceId':_0x50876a['id'],'type':_0x58e3ff[_0x307c('0x2c')],'sectionId':_0x58e3ff['id']},{})[_0x307c('0x26')](function(){return _0x42263f;});}else{return _0x42263f;}})['catch'](function(_0x4792a7){logger['error'](_0x307c('0x51'),_0x4792a7);throw _0x4792a7;});}return _0x42263f;})[_0x307c('0x26')](respondWithResult(_0x9820dc,0xc9))['catch'](handleError(_0x9820dc,null));};exports[_0x307c('0x25')]=function(_0x1ce41a,_0x68b3ba){if(_0x1ce41a['body']['id']){delete _0x1ce41a['body']['id'];}return db['VoiceChanSpy'][_0x307c('0x4e')]({'where':{'id':_0x1ce41a[_0x307c('0x48')]['id']}})['then'](handleEntityNotFound(_0x68b3ba,null))['then'](saveUpdates(_0x1ce41a[_0x307c('0x52')],null))[_0x307c('0x26')](respondWithResult(_0x68b3ba,null))['catch'](handleError(_0x68b3ba,null));};exports[_0x307c('0x27')]=function(_0x383260,_0xd27876){return db[_0x307c('0x2f')]['find']({'where':{'id':_0x383260[_0x307c('0x48')]['id']}})[_0x307c('0x26')](handleEntityNotFound(_0xd27876,null))[_0x307c('0x26')](removeEntity(_0xd27876,null))[_0x307c('0x46')](handleError(_0xd27876,null));}; \ No newline at end of file +var _0x1152=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','ChanSpies','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','show','keys','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x1152,0x182));var _0x2115=function(_0x1fa38a,_0x4fbe90){_0x1fa38a=_0x1fa38a-0x0;var _0x262fd0=_0x1152[_0x1fa38a];return _0x262fd0;};'use strict';var emlformat=require(_0x2115('0x0'));var rimraf=require(_0x2115('0x1'));var zipdir=require(_0x2115('0x2'));var jsonpatch=require(_0x2115('0x3'));var rp=require(_0x2115('0x4'));var moment=require(_0x2115('0x5'));var BPromise=require(_0x2115('0x6'));var Mustache=require(_0x2115('0x7'));var util=require('util');var path=require(_0x2115('0x8'));var sox=require('sox');var csv=require(_0x2115('0x9'));var ejs=require(_0x2115('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2115('0xb'));var toCsv=require(_0x2115('0x9'));var querystring=require(_0x2115('0xc'));var Papa=require('papaparse');var Redis=require(_0x2115('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2115('0xe'));var hardwareService=require(_0x2115('0xf'));var logger=require(_0x2115('0x10'))('api');var utils=require(_0x2115('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2115('0x12'));var db=require(_0x2115('0x13'))['db'];function respondWithStatusCode(_0x2bb885,_0x33d38b){_0x33d38b=_0x33d38b||0xcc;return function(_0x22475e){if(_0x22475e){return _0x2bb885['sendStatus'](_0x33d38b);}return _0x2bb885[_0x2115('0x14')](_0x33d38b)['end']();};}function respondWithResult(_0x3727a3,_0x38e406){_0x38e406=_0x38e406||0xc8;return function(_0x17028e){if(_0x17028e){return _0x3727a3[_0x2115('0x14')](_0x38e406)[_0x2115('0x15')](_0x17028e);}};}function respondWithFilteredResult(_0x113ce2,_0x350969){return function(_0x5e8f81){if(_0x5e8f81){var _0xdf3e24=typeof _0x350969[_0x2115('0x16')]===_0x2115('0x17')&&typeof _0x350969[_0x2115('0x18')]===_0x2115('0x17');var _0x1bdef9=_0x5e8f81[_0x2115('0x19')];var _0x77e2c6=_0xdf3e24?0x0:_0x350969['offset'];var _0x154f69=_0xdf3e24?_0x5e8f81[_0x2115('0x19')]:_0x350969[_0x2115('0x16')]+_0x350969['limit'];var _0x2dfb3c;if(_0x154f69>=_0x1bdef9){_0x154f69=_0x1bdef9;_0x2dfb3c=0xc8;}else{_0x2dfb3c=0xce;}_0x113ce2[_0x2115('0x14')](_0x2dfb3c);return _0x113ce2[_0x2115('0x1a')](_0x2115('0x1b'),_0x77e2c6+'-'+_0x154f69+'/'+_0x1bdef9)[_0x2115('0x15')](_0x5e8f81);}return null;};}function patchUpdates(_0xcc2d7b){return function(_0x21d079){try{jsonpatch[_0x2115('0x1c')](_0x21d079,_0xcc2d7b,!![]);}catch(_0x464af4){return BPromise[_0x2115('0x1d')](_0x464af4);}return _0x21d079[_0x2115('0x1e')]();};}function saveUpdates(_0x8b7304,_0x8e37c){return function(_0x13fde1){if(_0x13fde1){return _0x13fde1['update'](_0x8b7304)[_0x2115('0x1f')](function(_0x340c42){return _0x340c42;});}return null;};}function removeEntity(_0x40d19f,_0x4ac436){return function(_0x27c2f5){if(_0x27c2f5){return _0x27c2f5[_0x2115('0x20')]()['then'](function(){var _0x485092=_0x27c2f5['get']({'plain':!![]});var _0x201c94=_0x2115('0x21');return db[_0x2115('0x22')]['destroy']({'where':{'type':_0x201c94,'resourceId':_0x485092['id']}})[_0x2115('0x1f')](function(){return _0x27c2f5;});})[_0x2115('0x1f')](function(){_0x40d19f[_0x2115('0x14')](0xcc)[_0x2115('0x23')]();});}};}function handleEntityNotFound(_0x3ca0ef,_0x57acd4){return function(_0xc329ec){if(!_0xc329ec){_0x3ca0ef[_0x2115('0x24')](0x194);}return _0xc329ec;};}function handleError(_0x4f3e8d,_0x358bf5){_0x358bf5=_0x358bf5||0x1f4;return function(_0x33d81c){logger[_0x2115('0x25')](_0x33d81c[_0x2115('0x26')]);if(_0x33d81c['name']){delete _0x33d81c[_0x2115('0x27')];}_0x4f3e8d[_0x2115('0x14')](_0x358bf5)[_0x2115('0x28')](_0x33d81c);};}exports[_0x2115('0x29')]=function(_0x21e6b9,_0x27969d){var _0x5ae269={},_0x4a5eca={},_0x2c293d={'count':0x0,'rows':[]};var _0x354820=_[_0x2115('0x2a')](db[_0x2115('0x2b')][_0x2115('0x2c')],function(_0x5bcc07){return{'name':_0x5bcc07[_0x2115('0x2d')],'type':_0x5bcc07[_0x2115('0x2e')][_0x2115('0x2f')]};});_0x4a5eca['model']=_[_0x2115('0x2a')](_0x354820,'name');_0x4a5eca[_0x2115('0x30')]=_['keys'](_0x21e6b9[_0x2115('0x30')]);_0x4a5eca[_0x2115('0x31')]=_[_0x2115('0x32')](_0x4a5eca['model'],_0x4a5eca['query']);_0x5ae269[_0x2115('0x33')]=_[_0x2115('0x32')](_0x4a5eca['model'],qs[_0x2115('0x34')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x34')]));_0x5ae269[_0x2115('0x33')]=_0x5ae269['attributes'][_0x2115('0x35')]?_0x5ae269[_0x2115('0x33')]:_0x4a5eca[_0x2115('0x36')];if(!_0x21e6b9[_0x2115('0x30')]['hasOwnProperty'](_0x2115('0x37'))){_0x5ae269[_0x2115('0x18')]=qs[_0x2115('0x18')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x18')]);_0x5ae269[_0x2115('0x16')]=qs['offset'](_0x21e6b9[_0x2115('0x30')][_0x2115('0x16')]);}_0x5ae269[_0x2115('0x38')]=qs[_0x2115('0x39')](_0x21e6b9[_0x2115('0x30')][_0x2115('0x39')]);_0x5ae269['where']=qs[_0x2115('0x31')](_['pick'](_0x21e6b9['query'],_0x4a5eca[_0x2115('0x31')]),_0x354820);if(_0x21e6b9[_0x2115('0x30')][_0x2115('0x3a')]){_0x5ae269[_0x2115('0x3b')]=_[_0x2115('0x3c')](_0x5ae269[_0x2115('0x3b')],{'$or':_['map'](_0x354820,function(_0xe19201){if(_0xe19201[_0x2115('0x2e')]!==_0x2115('0x3d')){var _0x19c159={};_0x19c159[_0xe19201[_0x2115('0x27')]]={'$like':'%'+_0x21e6b9[_0x2115('0x30')][_0x2115('0x3a')]+'%'};return _0x19c159;}})});}_0x5ae269=_[_0x2115('0x3c')]({},_0x5ae269,_0x21e6b9[_0x2115('0x3e')]);var _0x5e30a5={'where':_0x5ae269['where']};return db['VoiceChanSpy'][_0x2115('0x19')](_0x5e30a5)['then'](function(_0xa652de){_0x2c293d['count']=_0xa652de;if(_0x21e6b9['query']['includeAll']){_0x5ae269[_0x2115('0x3f')]=[{'all':!![]}];}return db[_0x2115('0x2b')][_0x2115('0x40')](_0x5ae269);})[_0x2115('0x1f')](function(_0x16f022){_0x2c293d['rows']=_0x16f022;return _0x2c293d;})[_0x2115('0x1f')](respondWithFilteredResult(_0x27969d,_0x5ae269))['catch'](handleError(_0x27969d,null));};exports[_0x2115('0x41')]=function(_0x459028,_0x56bae6){var _0x23711d={'raw':![],'where':{'id':_0x459028['params']['id']}},_0x309f46={};_0x309f46['model']=_[_0x2115('0x42')](db[_0x2115('0x2b')]['rawAttributes']);_0x309f46['query']=_[_0x2115('0x42')](_0x459028[_0x2115('0x30')]);_0x309f46['filters']=_['intersection'](_0x309f46[_0x2115('0x36')],_0x309f46[_0x2115('0x30')]);_0x23711d[_0x2115('0x33')]=_['intersection'](_0x309f46[_0x2115('0x36')],qs['fields'](_0x459028[_0x2115('0x30')][_0x2115('0x34')]));_0x23711d[_0x2115('0x33')]=_0x23711d[_0x2115('0x33')][_0x2115('0x35')]?_0x23711d['attributes']:_0x309f46[_0x2115('0x36')];if(_0x459028['query']['includeAll']){_0x23711d[_0x2115('0x3f')]=[{'all':!![]}];}_0x23711d=_[_0x2115('0x3c')]({},_0x23711d,_0x459028['options']);return db[_0x2115('0x2b')][_0x2115('0x43')](_0x23711d)[_0x2115('0x1f')](handleEntityNotFound(_0x56bae6,null))[_0x2115('0x1f')](respondWithResult(_0x56bae6,null))[_0x2115('0x44')](handleError(_0x56bae6,null));};exports[_0x2115('0x45')]=function(_0x41d1a4,_0x347f16){return db[_0x2115('0x2b')]['create'](_0x41d1a4[_0x2115('0x46')],{})[_0x2115('0x1f')](function(_0xdf9fa7){var _0x537ba7=_0x41d1a4[_0x2115('0x47')]['get']({'plain':!![]});if(!_0x537ba7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x537ba7['role']===_0x2115('0x47')){var _0x24d601=_0xdf9fa7['get']({'plain':!![]});var _0x4c0e49=_0x2115('0x21');return db[_0x2115('0x48')][_0x2115('0x43')]({'where':{'name':_0x4c0e49,'userProfileId':_0x537ba7[_0x2115('0x49')]},'raw':!![]})[_0x2115('0x1f')](function(_0x384b2b){if(_0x384b2b&&_0x384b2b[_0x2115('0x4a')]===0x0){return db[_0x2115('0x22')]['create']({'name':_0x24d601[_0x2115('0x27')],'resourceId':_0x24d601['id'],'type':_0x384b2b[_0x2115('0x27')],'sectionId':_0x384b2b['id']},{})['then'](function(){return _0xdf9fa7;});}else{return _0xdf9fa7;}})[_0x2115('0x44')](function(_0x6de4e7){logger[_0x2115('0x25')](_0x2115('0x4b'),_0x6de4e7);throw _0x6de4e7;});}return _0xdf9fa7;})[_0x2115('0x1f')](respondWithResult(_0x347f16,0xc9))[_0x2115('0x44')](handleError(_0x347f16,null));};exports['update']=function(_0x2a388a,_0x392132){if(_0x2a388a['body']['id']){delete _0x2a388a['body']['id'];}return db[_0x2115('0x2b')][_0x2115('0x43')]({'where':{'id':_0x2a388a[_0x2115('0x4c')]['id']}})[_0x2115('0x1f')](handleEntityNotFound(_0x392132,null))['then'](saveUpdates(_0x2a388a[_0x2115('0x46')],null))[_0x2115('0x1f')](respondWithResult(_0x392132,null))[_0x2115('0x44')](handleError(_0x392132,null));};exports[_0x2115('0x20')]=function(_0xedd07f,_0x1bd210){return db['VoiceChanSpy'][_0x2115('0x43')]({'where':{'id':_0xedd07f[_0x2115('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1bd210,null))[_0x2115('0x1f')](removeEntity(_0x1bd210,null))[_0x2115('0x44')](handleError(_0x1bd210,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a5c7777..aa6725e 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 _0x63a7=['password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','User','findAll','agent','catch','exports','models','voice_chanspy','then','VoiceExtension','bulkCreate','length','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate'];(function(_0x54124d,_0x5212f8){var _0x5d1f70=function(_0x12ebcc){while(--_0x12ebcc){_0x54124d['push'](_0x54124d['shift']());}};_0x5d1f70(++_0x5212f8);}(_0x63a7,0x12c));var _0x763a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x63a7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x763a('0x0'));var util=require(_0x763a('0x1'));var BPromise=require(_0x763a('0x2'));var attributes=require(_0x763a('0x3'));var getUserApplications=function(_0xbbd224,_0x200b63,_0x509f3d){var _0xfb4dae=0x1;var _0x2f83bc=[];var _0x44b124={'context':_0x200b63[_0x763a('0x4')]||_0x763a('0x5'),'exten':util[_0x763a('0x6')](_0x763a('0x7'),_0xbbd224[_0x763a('0x8')],_0x509f3d),'type':_0x763a('0x9'),'isApp':![],'ChanSpyId':_0xbbd224['id'],'UserId':_0x200b63['id']};_0x2f83bc[_0x763a('0xa')](_[_0x763a('0xb')]({'app':_0x763a('0xc'),'appdata':util['format'](_0x763a('0xd'),_0x763a('0xe')),'priority':_0xfb4dae++},_0x44b124));if(_0xbbd224[_0x763a('0xf')]){_0x2f83bc[_0x763a('0xa')](_[_0x763a('0xb')]({'app':_0x763a('0x10'),'appdata':util['format'](_0x763a('0x11'),_0xbbd224['recordingFormat']),'priority':_0xfb4dae++},_0x44b124));}if(_0xbbd224[_0x763a('0x12')]){_0x2f83bc[_0x763a('0xa')](_[_0x763a('0xb')]({'app':_0x763a('0x13'),'appdata':_0xbbd224[_0x763a('0x14')],'priority':_0xfb4dae++},_0x44b124));}_0x2f83bc[_0x763a('0xa')](_['merge']({'app':_0x763a('0x15'),'appdata':util[_0x763a('0x6')](_0x763a('0x16'),_0x200b63['name'],_0xbbd224[_0x763a('0x17')]?_0xbbd224[_0x763a('0x17')][_0x763a('0x18')](''):''),'priority':_0xfb4dae++},_0x44b124));if(_0xbbd224['record']){_0x2f83bc[_0x763a('0xa')](_[_0x763a('0xb')]({'app':_0x763a('0x19'),'priority':_0xfb4dae++},_0x44b124));}return _0x2f83bc;};var getChanSpyApplications=function(_0x44412f,_0x48eea8){var _0x1ff0bb=[];for(var _0xabb1ed=0x0,_0xd3b71e=0x1;_0xabb1ed<_0x48eea8['length'];_0xabb1ed++,_0xd3b71e=0x1){_0x1ff0bb=_0x1ff0bb[_0x763a('0x1a')](getUserApplications(_0x44412f,_0x48eea8[_0xabb1ed],_0x48eea8[_0xabb1ed][_0x763a('0x1b')]));if(_0x48eea8[_0xabb1ed][_0x763a('0x1b')]!=_0x48eea8[_0xabb1ed][_0x763a('0x1c')]){_0x1ff0bb=_0x1ff0bb[_0x763a('0x1a')](getUserApplications(_0x44412f,_0x48eea8[_0xabb1ed],_0x48eea8[_0xabb1ed][_0x763a('0x1c')]));}}return _0x1ff0bb;};var getChanSpyPromise=function(_0x15a5e1,_0x48f3ea){return new BPromise(function(_0x592c99,_0x2aec57){return _0x15a5e1[_0x763a('0x1d')][_0x763a('0x1e')]({'attributes':['id',_0x763a('0x1c'),_0x763a('0x1b')],'where':{'role':_0x763a('0x1f'),'chanspy':!![]},'raw':!![]})['then'](function(_0x12bb0d){if(_0x12bb0d){return _0x592c99(getChanSpyApplications(_0x48f3ea,_0x12bb0d));}return _0x592c99([]);})[_0x763a('0x20')](function(_0x7402e7){_0x2aec57(_0x7402e7);});});};module[_0x763a('0x21')]=function(_0x182a22,_0x6b3224){var _0x53f55b=_0x182a22[_0x763a('0x22')];return _0x182a22['define']('VoiceChanSpy',attributes,{'tableName':_0x763a('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3af400,_0x445cb4,_0x5d8ba5){return getChanSpyPromise(_0x53f55b,_0x3af400)[_0x763a('0x24')](function(_0x2b2cbf){if(_0x2b2cbf&&_0x2b2cbf['length']){return _0x53f55b[_0x763a('0x25')][_0x763a('0x26')](_0x2b2cbf);}})[_0x763a('0x24')](function(){_0x5d8ba5();})['catch'](function(_0x30f34b){_0x5d8ba5(_0x30f34b);});},'afterUpdate':function(_0x5bb826,_0xb8bb0c,_0x1f67d9){return _0x53f55b[_0x763a('0x25')]['destroy']({'where':{'ChanSpyId':_0x5bb826['id']}})['then'](function(){return getChanSpyPromise(_0x53f55b,_0x5bb826);})[_0x763a('0x24')](function(_0x55228e){if(_0x55228e&&_0x55228e[_0x763a('0x27')]){return _0x53f55b[_0x763a('0x25')][_0x763a('0x26')](_0x55228e);}})['then'](function(){_0x1f67d9();})[_0x763a('0x20')](function(_0x38f28a){_0x1f67d9(_0x38f28a);});},'afterDestroy':function(_0x412971,_0x4cef17,_0x2ab108){return _0x53f55b['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x412971['id']}})[_0x763a('0x24')](function(){_0x2ab108();})[_0x763a('0x20')](function(_0x189f5e){_0x2ab108(_0x189f5e);});}}});}; \ No newline at end of file +var _0x8d5c=['context','from-sip','format','%s%s','merge','CDR(type)=%s','record','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','SIP/%s,%s','name','options','join','length','concat','internal','findAll','then','catch','exports','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes'];(function(_0x3afd62,_0xcf0997){var _0x33091d=function(_0x498d91){while(--_0x498d91){_0x3afd62['push'](_0x3afd62['shift']());}};_0x33091d(++_0xcf0997);}(_0x8d5c,0x7c));var _0xc8d5=function(_0x9cc1d7,_0x126bd4){_0x9cc1d7=_0x9cc1d7-0x0;var _0x294e87=_0x8d5c[_0x9cc1d7];return _0x294e87;};'use strict';var _=require(_0xc8d5('0x0'));var util=require(_0xc8d5('0x1'));var BPromise=require(_0xc8d5('0x2'));var attributes=require(_0xc8d5('0x3'));var getUserApplications=function(_0x34d101,_0x16e653,_0x55d959){var _0xa502b0=0x1;var _0x517424=[];var _0x141ce0={'context':_0x16e653[_0xc8d5('0x4')]||_0xc8d5('0x5'),'exten':util[_0xc8d5('0x6')](_0xc8d5('0x7'),_0x34d101['prefix'],_0x55d959),'type':'system','isApp':![],'ChanSpyId':_0x34d101['id'],'UserId':_0x16e653['id']};_0x517424['push'](_[_0xc8d5('0x8')]({'app':'Set','appdata':util[_0xc8d5('0x6')](_0xc8d5('0x9'),'chanspy'),'priority':_0xa502b0++},_0x141ce0));if(_0x34d101[_0xc8d5('0xa')]){_0x517424[_0xc8d5('0xb')](_['merge']({'app':_0xc8d5('0xc'),'appdata':util[_0xc8d5('0x6')](_0xc8d5('0xd'),_0x34d101[_0xc8d5('0xe')]),'priority':_0xa502b0++},_0x141ce0));}if(_0x34d101['auth']){_0x517424[_0xc8d5('0xb')](_[_0xc8d5('0x8')]({'app':_0xc8d5('0xf'),'appdata':_0x34d101[_0xc8d5('0x10')],'priority':_0xa502b0++},_0x141ce0));}_0x517424[_0xc8d5('0xb')](_[_0xc8d5('0x8')]({'app':'ChanSpy','appdata':util[_0xc8d5('0x6')](_0xc8d5('0x11'),_0x16e653[_0xc8d5('0x12')],_0x34d101[_0xc8d5('0x13')]?_0x34d101[_0xc8d5('0x13')][_0xc8d5('0x14')](''):''),'priority':_0xa502b0++},_0x141ce0));if(_0x34d101[_0xc8d5('0xa')]){_0x517424[_0xc8d5('0xb')](_[_0xc8d5('0x8')]({'app':'StopMixMonitor','priority':_0xa502b0++},_0x141ce0));}return _0x517424;};var getChanSpyApplications=function(_0x3330d7,_0x59dcd5){var _0x4831c8=[];for(var _0x4de438=0x0,_0x586893=0x1;_0x4de438<_0x59dcd5[_0xc8d5('0x15')];_0x4de438++,_0x586893=0x1){_0x4831c8=_0x4831c8[_0xc8d5('0x16')](getUserApplications(_0x3330d7,_0x59dcd5[_0x4de438],_0x59dcd5[_0x4de438]['internal']));if(_0x59dcd5[_0x4de438][_0xc8d5('0x17')]!=_0x59dcd5[_0x4de438][_0xc8d5('0x12')]){_0x4831c8=_0x4831c8[_0xc8d5('0x16')](getUserApplications(_0x3330d7,_0x59dcd5[_0x4de438],_0x59dcd5[_0x4de438][_0xc8d5('0x12')]));}}return _0x4831c8;};var getChanSpyPromise=function(_0x21ab12,_0x20bbb1){return new BPromise(function(_0x2ad676,_0x536207){return _0x21ab12['User'][_0xc8d5('0x18')]({'attributes':['id','name',_0xc8d5('0x17')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xc8d5('0x19')](function(_0x37bd5a){if(_0x37bd5a){return _0x2ad676(getChanSpyApplications(_0x20bbb1,_0x37bd5a));}return _0x2ad676([]);})[_0xc8d5('0x1a')](function(_0x5cb8d9){_0x536207(_0x5cb8d9);});});};module[_0xc8d5('0x1b')]=function(_0xf34eb2,_0x1ebf8c){var _0xca3039=_0xf34eb2['models'];return _0xf34eb2['define']('VoiceChanSpy',attributes,{'tableName':_0xc8d5('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3489df,_0x2582df,_0x250049){return getChanSpyPromise(_0xca3039,_0x3489df)[_0xc8d5('0x19')](function(_0x5ca1cd){if(_0x5ca1cd&&_0x5ca1cd['length']){return _0xca3039[_0xc8d5('0x1d')][_0xc8d5('0x1e')](_0x5ca1cd);}})[_0xc8d5('0x19')](function(){_0x250049();})['catch'](function(_0x1b4c44){_0x250049(_0x1b4c44);});},'afterUpdate':function(_0x215cdf,_0x58b279,_0xfaf61d){return _0xca3039[_0xc8d5('0x1d')]['destroy']({'where':{'ChanSpyId':_0x215cdf['id']}})['then'](function(){return getChanSpyPromise(_0xca3039,_0x215cdf);})[_0xc8d5('0x19')](function(_0x1a172a){if(_0x1a172a&&_0x1a172a['length']){return _0xca3039[_0xc8d5('0x1d')][_0xc8d5('0x1e')](_0x1a172a);}})[_0xc8d5('0x19')](function(){_0xfaf61d();})[_0xc8d5('0x1a')](function(_0x388ca0){_0xfaf61d(_0x388ca0);});},'afterDestroy':function(_0x2c3654,_0x234dbf,_0x525ec8){return _0xca3039[_0xc8d5('0x1d')][_0xc8d5('0x1f')]({'where':{'ChanSpyId':_0x2c3654['id']}})['then'](function(){_0x525ec8();})[_0xc8d5('0x1a')](function(_0x99abfc){_0x525ec8(_0x99abfc);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4d475a3..ccfcbdc 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x832516,_0x3cf44c){var _0x1bc833=function(_0x345002){while(--_0x345002){_0x832516['push'](_0x832516['shift']());}};_0x1bc833(++_0x3cf44c);}(_0xb688,0xcf));var _0x8b68=function(_0x1c5f54,_0x39561e){_0x1c5f54=_0x1c5f54-0x0;var _0x25cebe=_0xb688[_0x1c5f54];return _0x25cebe;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ee56,_0x37677d,_0x2bbffd){return new BPromise(function(_0x130892,_0xa5571b){return client[_0x8b68('0xb')](_0x57ee56,_0x2bbffd)[_0x8b68('0xc')](function(_0x261753){logger[_0x8b68('0xd')](_0x8b68('0xe'),_0x37677d,_0x8b68('0xf'));logger[_0x8b68('0x10')](_0x8b68('0x11'),_0x37677d,_0x8b68('0xf'),JSON['stringify'](_0x261753));if(_0x261753[_0x8b68('0x12')]){if(_0x261753[_0x8b68('0x12')][_0x8b68('0x13')]===0x1f4){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);return _0xa5571b(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}logger['error'](_0x8b68('0xe'),_0x37677d,_0x261753['error']['message']);return _0x130892(_0x261753[_0x8b68('0x12')][_0x8b68('0x14')]);}else{logger[_0x8b68('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x37677d,'request\x20sent');_0x130892(_0x261753[_0x8b68('0x15')]['message']);}})[_0x8b68('0x16')](function(_0xb44923){logger[_0x8b68('0x12')](_0x8b68('0xe'),_0x37677d,_0xb44923);_0xa5571b(_0xb44923);});});} \ No newline at end of file +var _0x55e0=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x55e0,0xdc));var _0x055e=function(_0x329e18,_0x360a88){_0x329e18=_0x329e18-0x0;var _0x4f7cce=_0x55e0[_0x329e18];return _0x4f7cce;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4384ff,_0x4a442e,_0x8e7824){return new BPromise(function(_0x3c4cf,_0x376618){return client[_0x055e('0xa')](_0x4384ff,_0x8e7824)[_0x055e('0xb')](function(_0x49540c){logger[_0x055e('0xc')](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));logger[_0x055e('0xf')](_0x055e('0x10'),_0x4a442e,'request\x20sent',JSON['stringify'](_0x49540c));if(_0x49540c[_0x055e('0x11')]){if(_0x49540c['error'][_0x055e('0x12')]===0x1f4){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x376618(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}logger['error'](_0x055e('0xd'),_0x4a442e,_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);return _0x3c4cf(_0x49540c[_0x055e('0x11')][_0x055e('0x13')]);}else{logger['info'](_0x055e('0xd'),_0x4a442e,_0x055e('0xe'));_0x3c4cf(_0x49540c[_0x055e('0x14')]['message']);}})[_0x055e('0x15')](function(_0x2c377c){logger[_0x055e('0x11')](_0x055e('0xd'),_0x4a442e,_0x2c377c);_0x376618(_0x2c377c);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 2531373..9a36570 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 _0x7bf5=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','/:id','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x7bf5,0xf9));var _0x57bf=function(_0x4dd27b,_0x12e87b){_0x4dd27b=_0x4dd27b-0x0;var _0x171af0=_0x7bf5[_0x4dd27b];return _0x171af0;};'use strict';var multer=require(_0x57bf('0x0'));var util=require(_0x57bf('0x1'));var path=require('path');var timeout=require(_0x57bf('0x2'));var express=require(_0x57bf('0x3'));var router=express[_0x57bf('0x4')]();var fs_extra=require(_0x57bf('0x5'));var auth=require(_0x57bf('0x6'));var interaction=require(_0x57bf('0x7'));var config=require(_0x57bf('0x8'));var controller=require('./voiceContext.controller');router[_0x57bf('0x9')]('/',auth['isAuthenticated'](),controller[_0x57bf('0xa')]);router['get']('/:id',auth[_0x57bf('0xb')](),controller[_0x57bf('0xc')]);router[_0x57bf('0xd')]('/',auth[_0x57bf('0xb')](),controller['create']);router['put'](_0x57bf('0xe'),auth[_0x57bf('0xb')](),controller['update']);router['delete'](_0x57bf('0xe'),auth[_0x57bf('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbcbf=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','post','isAuthenticated','put','/:id','update','delete','destroy'];(function(_0x451a7e,_0x5176d5){var _0x43ea66=function(_0x380c4b){while(--_0x380c4b){_0x451a7e['push'](_0x451a7e['shift']());}};_0x43ea66(++_0x5176d5);}(_0xbcbf,0x155));var _0xfbcb=function(_0x575435,_0x2b31c6){_0x575435=_0x575435-0x0;var _0xe5dca8=_0xbcbf[_0x575435];return _0xe5dca8;};'use strict';var multer=require('multer');var util=require(_0xfbcb('0x0'));var path=require(_0xfbcb('0x1'));var timeout=require(_0xfbcb('0x2'));var express=require(_0xfbcb('0x3'));var router=express[_0xfbcb('0x4')]();var fs_extra=require(_0xfbcb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfbcb('0x6'));var config=require(_0xfbcb('0x7'));var controller=require('./voiceContext.controller');router[_0xfbcb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfbcb('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfbcb('0x9')]('/',auth[_0xfbcb('0xa')](),controller['create']);router[_0xfbcb('0xb')](_0xfbcb('0xc'),auth[_0xfbcb('0xa')](),controller[_0xfbcb('0xd')]);router[_0xfbcb('0xe')](_0xfbcb('0xc'),auth[_0xfbcb('0xa')](),controller[_0xfbcb('0xf')]);module[_0xfbcb('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 4054a38..e170e8a 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 _0xdbb5=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x15cbc7,_0x186e17){var _0x5fdf24=function(_0x4b210e){while(--_0x4b210e){_0x15cbc7['push'](_0x15cbc7['shift']());}};_0x5fdf24(++_0x186e17);}(_0xdbb5,0x16f));var _0x5dbb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdbb5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5dbb('0x0'));module[_0x5dbb('0x1')]={'name':{'type':Sequelize[_0x5dbb('0x2')],'unique':_0x5dbb('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5dbb('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc455=['BOOLEAN','sequelize','exports','STRING'];(function(_0x11feff,_0x3728e6){var _0x42e95d=function(_0x1eea5a){while(--_0x1eea5a){_0x11feff['push'](_0x11feff['shift']());}};_0x42e95d(++_0x3728e6);}(_0xc455,0xcd));var _0x5c45=function(_0x78b883,_0x3d4443){_0x78b883=_0x78b883-0x0;var _0x34c9f4=_0xc455[_0x78b883];return _0x34c9f4;};'use strict';var Sequelize=require(_0x5c45('0x0'));module[_0x5c45('0x1')]={'name':{'type':Sequelize[_0x5c45('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x5c45('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5c45('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 62b2785..9101f1c 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 _0x48df=['catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','Contexts','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','VoiceContext','rows','params','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','join','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','http','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','VoiceContext,\x20%s,\x20%s','message','result'];(function(_0x33bfdc,_0x2b91c5){var _0x495264=function(_0x273d68){while(--_0x273d68){_0x33bfdc['push'](_0x33bfdc['shift']());}};_0x495264(++_0x2b91c5);}(_0x48df,0x162));var _0xf48d=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x48df[_0x590a38];return _0xf36626;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf48d('0x0'));var jsonpatch=require(_0xf48d('0x1'));var rp=require('request-promise');var moment=require(_0xf48d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf48d('0x3'));var util=require(_0xf48d('0x4'));var path=require(_0xf48d('0x5'));var sox=require('sox');var csv=require(_0xf48d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf48d('0x7'));var _=require(_0xf48d('0x8'));var squel=require(_0xf48d('0x9'));var crypto=require(_0xf48d('0xa'));var jsforce=require(_0xf48d('0xb'));var deskjs=require(_0xf48d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf48d('0xd'));var qs=require(_0xf48d('0xe'));var as=require(_0xf48d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf48d('0x10'))(_0xf48d('0x11'));var utils=require(_0xf48d('0x12'));var config=require(_0xf48d('0x13'));var licenseUtil=require(_0xf48d('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf48d('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x56f323,_0x40a552,_0x429003,_0x54b828){return new BPromise(function(_0x43575b,_0x2a3e96){var _0x9c15f7=_0x54b828||client;return _0x9c15f7['request'](_0x56f323,_0x429003)[_0xf48d('0x16')](function(_0x11f4de){logger[_0xf48d('0x17')]('VoiceContext,\x20%s,\x20%s',_0x40a552,_0xf48d('0x18'));logger['debug'](_0xf48d('0x19'),_0x40a552,'request\x20sent',JSON['stringify'](_0x11f4de));if(_0x11f4de['error']){if(_0x11f4de[_0xf48d('0x1a')]['code']===0x1f4){logger[_0xf48d('0x1a')](_0xf48d('0x1b'),_0x40a552,_0x11f4de[_0xf48d('0x1a')][_0xf48d('0x1c')]);return _0x2a3e96(_0x11f4de[_0xf48d('0x1a')][_0xf48d('0x1c')]);}logger[_0xf48d('0x1a')](_0xf48d('0x1b'),_0x40a552,_0x11f4de[_0xf48d('0x1a')][_0xf48d('0x1c')]);return _0x43575b(_0x11f4de[_0xf48d('0x1a')][_0xf48d('0x1c')]);}else{logger['info'](_0xf48d('0x1b'),_0x40a552,_0xf48d('0x18'));_0x43575b(_0x11f4de[_0xf48d('0x1d')][_0xf48d('0x1c')]);}})[_0xf48d('0x1e')](function(_0x3dcd93){logger[_0xf48d('0x1a')](_0xf48d('0x1b'),_0x40a552,_0x3dcd93);_0x2a3e96(_0x3dcd93);});});}function respondWithStatusCode(_0x5393e4,_0x2f2e3d){_0x2f2e3d=_0x2f2e3d||0xcc;return function(_0x12a258){if(_0x12a258){return _0x5393e4[_0xf48d('0x1f')](_0x2f2e3d);}return _0x5393e4[_0xf48d('0x20')](_0x2f2e3d)[_0xf48d('0x21')]();};}function respondWithResult(_0x3cbf21,_0x512f0a){_0x512f0a=_0x512f0a||0xc8;return function(_0x41dbef){if(_0x41dbef){return _0x3cbf21[_0xf48d('0x20')](_0x512f0a)[_0xf48d('0x22')](_0x41dbef);}};}function respondWithFilteredResult(_0x593d56,_0x1235b1){return function(_0x4ff29d){if(_0x4ff29d){var _0x336db8=typeof _0x1235b1[_0xf48d('0x23')]===_0xf48d('0x24')&&typeof _0x1235b1['limit']===_0xf48d('0x24');var _0x58c1d5=_0x4ff29d['count'];var _0x1bfe3e=_0x336db8?0x0:_0x1235b1[_0xf48d('0x23')];var _0x2be408=_0x336db8?_0x4ff29d[_0xf48d('0x25')]:_0x1235b1['offset']+_0x1235b1[_0xf48d('0x26')];var _0x5b0303;if(_0x2be408>=_0x58c1d5){_0x2be408=_0x58c1d5;_0x5b0303=0xc8;}else{_0x5b0303=0xce;}_0x593d56[_0xf48d('0x20')](_0x5b0303);return _0x593d56[_0xf48d('0x27')](_0xf48d('0x28'),_0x1bfe3e+'-'+_0x2be408+'/'+_0x58c1d5)[_0xf48d('0x22')](_0x4ff29d);}return null;};}function patchUpdates(_0x25f914){return function(_0x69c53d){try{jsonpatch[_0xf48d('0x29')](_0x69c53d,_0x25f914,!![]);}catch(_0x540da1){return BPromise[_0xf48d('0x2a')](_0x540da1);}return _0x69c53d[_0xf48d('0x2b')]();};}function saveUpdates(_0x49a5d8,_0x3567eb){return function(_0x2af2f2){if(_0x2af2f2){return _0x2af2f2[_0xf48d('0x2c')](_0x49a5d8)[_0xf48d('0x16')](function(_0x52de66){return _0x52de66;});}return null;};}function removeEntity(_0x8cf797,_0x3881c1){return function(_0x3e88b5){if(_0x3e88b5){return _0x3e88b5[_0xf48d('0x2d')]()[_0xf48d('0x16')](function(){var _0x30f451=_0x3e88b5['get']({'plain':!![]});var _0x30c2c1=_0xf48d('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x30c2c1,'resourceId':_0x30f451['id']}})['then'](function(){return _0x3e88b5;});})[_0xf48d('0x16')](function(){_0x8cf797[_0xf48d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a673,_0x7960e4){return function(_0x4cbd16){if(!_0x4cbd16){_0x28a673['sendStatus'](0x194);}return _0x4cbd16;};}function handleError(_0x14d9c8,_0x579913){_0x579913=_0x579913||0x1f4;return function(_0x5edf62){logger[_0xf48d('0x1a')](_0x5edf62[_0xf48d('0x2f')]);if(_0x5edf62['name']){delete _0x5edf62[_0xf48d('0x30')];}_0x14d9c8[_0xf48d('0x20')](_0x579913)['send'](_0x5edf62);};}exports[_0xf48d('0x31')]=function(_0x1a469d,_0x44fe5c){var _0x1dc1b1={},_0x61fb7e={},_0x40a373={'count':0x0,'rows':[]};var _0x1475a0=_[_0xf48d('0x32')](db['VoiceContext'][_0xf48d('0x33')],function(_0x1b8b42){return{'name':_0x1b8b42[_0xf48d('0x34')],'type':_0x1b8b42[_0xf48d('0x35')][_0xf48d('0x36')]};});_0x61fb7e[_0xf48d('0x37')]=_[_0xf48d('0x32')](_0x1475a0,'name');_0x61fb7e[_0xf48d('0x38')]=_[_0xf48d('0x39')](_0x1a469d['query']);_0x61fb7e[_0xf48d('0x3a')]=_[_0xf48d('0x3b')](_0x61fb7e[_0xf48d('0x37')],_0x61fb7e[_0xf48d('0x38')]);_0x1dc1b1[_0xf48d('0x3c')]=_[_0xf48d('0x3b')](_0x61fb7e[_0xf48d('0x37')],qs[_0xf48d('0x3d')](_0x1a469d[_0xf48d('0x38')][_0xf48d('0x3d')]));_0x1dc1b1[_0xf48d('0x3c')]=_0x1dc1b1['attributes'][_0xf48d('0x3e')]?_0x1dc1b1['attributes']:_0x61fb7e['model'];if(!_0x1a469d[_0xf48d('0x38')][_0xf48d('0x3f')](_0xf48d('0x40'))){_0x1dc1b1[_0xf48d('0x26')]=qs[_0xf48d('0x26')](_0x1a469d[_0xf48d('0x38')][_0xf48d('0x26')]);_0x1dc1b1['offset']=qs[_0xf48d('0x23')](_0x1a469d[_0xf48d('0x38')][_0xf48d('0x23')]);}_0x1dc1b1['order']=qs[_0xf48d('0x41')](_0x1a469d['query'][_0xf48d('0x41')]);_0x1dc1b1[_0xf48d('0x42')]=qs[_0xf48d('0x3a')](_[_0xf48d('0x43')](_0x1a469d[_0xf48d('0x38')],_0x61fb7e[_0xf48d('0x3a')]),_0x1475a0);if(_0x1a469d['query'][_0xf48d('0x44')]){_0x1dc1b1['where']=_['merge'](_0x1dc1b1[_0xf48d('0x42')],{'$or':_[_0xf48d('0x32')](_0x1475a0,function(_0x1489ca){if(_0x1489ca[_0xf48d('0x35')]!==_0xf48d('0x45')){var _0x567036={};_0x567036[_0x1489ca[_0xf48d('0x30')]]={'$like':'%'+_0x1a469d[_0xf48d('0x38')][_0xf48d('0x44')]+'%'};return _0x567036;}})});}_0x1dc1b1=_[_0xf48d('0x46')]({},_0x1dc1b1,_0x1a469d[_0xf48d('0x47')]);var _0x1388c4={'where':_0x1dc1b1[_0xf48d('0x42')]};return db['VoiceContext'][_0xf48d('0x25')](_0x1388c4)['then'](function(_0x5b90bb){_0x40a373['count']=_0x5b90bb;if(_0x1a469d['query'][_0xf48d('0x48')]){_0x1dc1b1[_0xf48d('0x49')]=[{'all':!![]}];}return db[_0xf48d('0x4a')]['findAll'](_0x1dc1b1);})[_0xf48d('0x16')](function(_0x4d9563){_0x40a373[_0xf48d('0x4b')]=_0x4d9563;return _0x40a373;})[_0xf48d('0x16')](respondWithFilteredResult(_0x44fe5c,_0x1dc1b1))[_0xf48d('0x1e')](handleError(_0x44fe5c,null));};exports['show']=function(_0x262166,_0x3c75f3){var _0x197597={'raw':![],'where':{'id':_0x262166[_0xf48d('0x4c')]['id']}},_0x26bb58={};_0x26bb58[_0xf48d('0x37')]=_[_0xf48d('0x39')](db[_0xf48d('0x4a')][_0xf48d('0x33')]);_0x26bb58[_0xf48d('0x38')]=_[_0xf48d('0x39')](_0x262166[_0xf48d('0x38')]);_0x26bb58[_0xf48d('0x3a')]=_[_0xf48d('0x3b')](_0x26bb58[_0xf48d('0x37')],_0x26bb58['query']);_0x197597[_0xf48d('0x3c')]=_[_0xf48d('0x3b')](_0x26bb58[_0xf48d('0x37')],qs[_0xf48d('0x3d')](_0x262166['query']['fields']));_0x197597[_0xf48d('0x3c')]=_0x197597[_0xf48d('0x3c')][_0xf48d('0x3e')]?_0x197597[_0xf48d('0x3c')]:_0x26bb58[_0xf48d('0x37')];if(_0x262166[_0xf48d('0x38')][_0xf48d('0x48')]){_0x197597[_0xf48d('0x49')]=[{'all':!![]}];}_0x197597=_[_0xf48d('0x46')]({},_0x197597,_0x262166[_0xf48d('0x47')]);return db[_0xf48d('0x4a')][_0xf48d('0x4d')](_0x197597)['then'](handleEntityNotFound(_0x3c75f3,null))[_0xf48d('0x16')](respondWithResult(_0x3c75f3,null))[_0xf48d('0x1e')](handleError(_0x3c75f3,null));};exports[_0xf48d('0x4e')]=function(_0x29285d,_0x38e889,_0x5773e0){var _0x1e8d2a;return db[_0xf48d('0x4a')]['create'](_0x29285d[_0xf48d('0x4f')],{'raw':!![]})['then'](function(_0x577397){_0x1e8d2a=_0x577397;return db[_0xf48d('0x4a')]['findAll']({'raw':!![]});})['then'](function(_0x1f3284){var _0x20d6e0=fs[_0xf48d('0x50')](path['join'](config[_0xf48d('0x51')],_0xf48d('0x52')),_0xf48d('0x53'));var _0x1ceaf6=ejs[_0xf48d('0x54')](_0x20d6e0,{'contexts':_0x1f3284||[]});fs['writeFileSync'](_0xf48d('0x55'),_0x1ceaf6);})[_0xf48d('0x16')](function(){return respondWithRpcPromise(_0xf48d('0x56'),'create',{'module':_0xf48d('0x57')});})['then'](function(){var _0x1e60a4=_0x29285d[_0xf48d('0x58')]['get']({'plain':!![]});if(!_0x1e60a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e60a4['role']===_0xf48d('0x58')){var _0x5f0590=_0x1e8d2a[_0xf48d('0x59')]({'plain':!![]});return db[_0xf48d('0x5a')][_0xf48d('0x4d')]({'where':{'name':_0xf48d('0x2e'),'userProfileId':_0x1e60a4[_0xf48d('0x5b')]},'raw':!![]})[_0xf48d('0x16')](function(_0x4c0b95){if(_0x4c0b95&&_0x4c0b95[_0xf48d('0x5c')]===0x0){return db['UserProfileResource'][_0xf48d('0x4e')]({'name':_0x5f0590[_0xf48d('0x30')],'resourceId':_0x5f0590['id'],'type':_0x4c0b95[_0xf48d('0x30')],'sectionId':_0x4c0b95['id']},{})[_0xf48d('0x16')](function(){return _0x1e8d2a;});}else{return _0x1e8d2a;}})[_0xf48d('0x1e')](function(_0x36e9b6){logger[_0xf48d('0x1a')](_0xf48d('0x5d'),_0x36e9b6);throw _0x36e9b6;});}return _0x1e8d2a;})[_0xf48d('0x16')](respondWithResult(_0x38e889,0xc9))[_0xf48d('0x1e')](handleError(_0x38e889,null));};exports[_0xf48d('0x2c')]=function(_0x46e80f,_0x39123e,_0x313527){var _0x2f76dd;return db[_0xf48d('0x4a')][_0xf48d('0x4d')]({'where':{'id':_0x46e80f[_0xf48d('0x4c')]['id']}})[_0xf48d('0x16')](handleEntityNotFound(_0x39123e,null))[_0xf48d('0x16')](saveUpdates(_0x46e80f['body'],null))[_0xf48d('0x16')](function(_0x44008d){if(_0x44008d){_0x2f76dd=_0x44008d;return db[_0xf48d('0x4a')][_0xf48d('0x5e')]({'raw':!![]});}})[_0xf48d('0x16')](function(_0x381cab){var _0x2d3f82=fs[_0xf48d('0x50')](path[_0xf48d('0x5f')](config[_0xf48d('0x51')],_0xf48d('0x52')),_0xf48d('0x53'));var _0x365418=ejs[_0xf48d('0x54')](_0x2d3f82,{'contexts':_0x381cab||[]});fs['writeFileSync'](_0xf48d('0x55'),_0x365418);})['then'](function(){return respondWithRpcPromise(_0xf48d('0x56'),_0xf48d('0x2c'),{'module':'chan_sip.so'});})[_0xf48d('0x16')](function(){return _0x2f76dd;})['then'](respondWithResult(_0x39123e,null))[_0xf48d('0x1e')](handleError(_0x39123e,null));};exports['destroy']=function(_0x4b83fe,_0x10a631,_0x38619e){var _0x49fb8c;return db['VoiceContext'][_0xf48d('0x4d')]({'where':{'id':_0x4b83fe[_0xf48d('0x4c')]['id']}})[_0xf48d('0x16')](handleEntityNotFound(_0x10a631,null))[_0xf48d('0x16')](removeEntity(_0x10a631,null))[_0xf48d('0x16')](function(){return db['VoiceContext'][_0xf48d('0x5e')]({'raw':!![]});})[_0xf48d('0x16')](function(_0x20cbb3){var _0x20c0a6=fs[_0xf48d('0x50')](path[_0xf48d('0x5f')](config[_0xf48d('0x51')],_0xf48d('0x52')),'utf8');var _0x2c234b=ejs[_0xf48d('0x54')](_0x20c0a6,{'contexts':_0x20cbb3});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2c234b);return respondWithRpcPromise(_0xf48d('0x56'),_0xf48d('0x2d'),{'module':_0xf48d('0x57')});})['catch'](handleError(_0x10a631,null));}; \ No newline at end of file +var _0x7870=['readFileSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','destroy','get','Contexts','UserProfileResource','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','include','findAll','show','params','includeAll','options','find','create','body','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join'];(function(_0x5aa73b,_0x3f5f8b){var _0x55f11d=function(_0x112b45){while(--_0x112b45){_0x5aa73b['push'](_0x5aa73b['shift']());}};_0x55f11d(++_0x3f5f8b);}(_0x7870,0x66));var _0x0787=function(_0x2ae9fb,_0x4a727c){_0x2ae9fb=_0x2ae9fb-0x0;var _0x37aec2=_0x7870[_0x2ae9fb];return _0x37aec2;};'use strict';var emlformat=require(_0x0787('0x0'));var rimraf=require(_0x0787('0x1'));var zipdir=require(_0x0787('0x2'));var jsonpatch=require(_0x0787('0x3'));var rp=require('request-promise');var moment=require(_0x0787('0x4'));var BPromise=require(_0x0787('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0787('0x6'));var csv=require(_0x0787('0x7'));var ejs=require(_0x0787('0x8'));var fs=require('fs');var fs_extra=require(_0x0787('0x9'));var _=require(_0x0787('0xa'));var squel=require(_0x0787('0xb'));var crypto=require(_0x0787('0xc'));var jsforce=require(_0x0787('0xd'));var deskjs=require(_0x0787('0xe'));var toCsv=require(_0x0787('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0787('0xf'));var hardwareService=require(_0x0787('0x10'));var logger=require(_0x0787('0x11'))(_0x0787('0x12'));var utils=require(_0x0787('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x0787('0x14'));var client=jayson['client'][_0x0787('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x38236d,_0x19518d,_0x591ddb,_0x2e7a08){return new BPromise(function(_0x2d27f6,_0x3155a5){var _0x4c233d=_0x2e7a08||client;return _0x4c233d['request'](_0x38236d,_0x591ddb)[_0x0787('0x16')](function(_0x149e0d){logger[_0x0787('0x17')](_0x0787('0x18'),_0x19518d,_0x0787('0x19'));logger[_0x0787('0x1a')](_0x0787('0x1b'),_0x19518d,_0x0787('0x19'),JSON[_0x0787('0x1c')](_0x149e0d));if(_0x149e0d[_0x0787('0x1d')]){if(_0x149e0d[_0x0787('0x1d')][_0x0787('0x1e')]===0x1f4){logger[_0x0787('0x1d')](_0x0787('0x18'),_0x19518d,_0x149e0d[_0x0787('0x1d')]['message']);return _0x3155a5(_0x149e0d[_0x0787('0x1d')][_0x0787('0x1f')]);}logger[_0x0787('0x1d')](_0x0787('0x18'),_0x19518d,_0x149e0d[_0x0787('0x1d')]['message']);return _0x2d27f6(_0x149e0d[_0x0787('0x1d')]['message']);}else{logger[_0x0787('0x17')](_0x0787('0x18'),_0x19518d,_0x0787('0x19'));_0x2d27f6(_0x149e0d[_0x0787('0x20')]['message']);}})[_0x0787('0x21')](function(_0xdddc3e){logger[_0x0787('0x1d')](_0x0787('0x18'),_0x19518d,_0xdddc3e);_0x3155a5(_0xdddc3e);});});}function respondWithStatusCode(_0x1a8edf,_0x378c36){_0x378c36=_0x378c36||0xcc;return function(_0xc5d192){if(_0xc5d192){return _0x1a8edf[_0x0787('0x22')](_0x378c36);}return _0x1a8edf[_0x0787('0x23')](_0x378c36)[_0x0787('0x24')]();};}function respondWithResult(_0xb6f0c2,_0x858552){_0x858552=_0x858552||0xc8;return function(_0x11eb44){if(_0x11eb44){return _0xb6f0c2[_0x0787('0x23')](_0x858552)[_0x0787('0x25')](_0x11eb44);}};}function respondWithFilteredResult(_0x2561d6,_0x58df60){return function(_0x2d8d99){if(_0x2d8d99){var _0x2fba24=typeof _0x58df60['offset']===_0x0787('0x26')&&typeof _0x58df60[_0x0787('0x27')]===_0x0787('0x26');var _0x1422a6=_0x2d8d99[_0x0787('0x28')];var _0xa88e20=_0x2fba24?0x0:_0x58df60[_0x0787('0x29')];var _0x2817b7=_0x2fba24?_0x2d8d99[_0x0787('0x28')]:_0x58df60[_0x0787('0x29')]+_0x58df60[_0x0787('0x27')];var _0x11bbee;if(_0x2817b7>=_0x1422a6){_0x2817b7=_0x1422a6;_0x11bbee=0xc8;}else{_0x11bbee=0xce;}_0x2561d6[_0x0787('0x23')](_0x11bbee);return _0x2561d6[_0x0787('0x2a')]('Content-Range',_0xa88e20+'-'+_0x2817b7+'/'+_0x1422a6)[_0x0787('0x25')](_0x2d8d99);}return null;};}function patchUpdates(_0x516e03){return function(_0x449554){try{jsonpatch[_0x0787('0x2b')](_0x449554,_0x516e03,!![]);}catch(_0x3542e4){return BPromise[_0x0787('0x2c')](_0x3542e4);}return _0x449554[_0x0787('0x2d')]();};}function saveUpdates(_0x4cb237,_0x865707){return function(_0x57d825){if(_0x57d825){return _0x57d825['update'](_0x4cb237)['then'](function(_0x5996a7){return _0x5996a7;});}return null;};}function removeEntity(_0x459cce,_0x35e320){return function(_0x24a1e4){if(_0x24a1e4){return _0x24a1e4[_0x0787('0x2e')]()[_0x0787('0x16')](function(){var _0x535a32=_0x24a1e4[_0x0787('0x2f')]({'plain':!![]});var _0x30e7ec=_0x0787('0x30');return db[_0x0787('0x31')][_0x0787('0x2e')]({'where':{'type':_0x30e7ec,'resourceId':_0x535a32['id']}})['then'](function(){return _0x24a1e4;});})[_0x0787('0x16')](function(){_0x459cce[_0x0787('0x23')](0xcc)[_0x0787('0x24')]();});}};}function handleEntityNotFound(_0x26609c,_0x20cff9){return function(_0x1e2e55){if(!_0x1e2e55){_0x26609c[_0x0787('0x22')](0x194);}return _0x1e2e55;};}function handleError(_0x312c1f,_0x502ca8){_0x502ca8=_0x502ca8||0x1f4;return function(_0x382f0c){logger[_0x0787('0x1d')](_0x382f0c['stack']);if(_0x382f0c['name']){delete _0x382f0c[_0x0787('0x32')];}_0x312c1f[_0x0787('0x23')](_0x502ca8)[_0x0787('0x33')](_0x382f0c);};}exports[_0x0787('0x34')]=function(_0x13c20a,_0x465175){var _0x4b048d={},_0x3b83dc={},_0x4e7b46={'count':0x0,'rows':[]};var _0x30c711=_[_0x0787('0x35')](db[_0x0787('0x36')][_0x0787('0x37')],function(_0x448544){return{'name':_0x448544[_0x0787('0x38')],'type':_0x448544[_0x0787('0x39')]['key']};});_0x3b83dc[_0x0787('0x3a')]=_['map'](_0x30c711,'name');_0x3b83dc[_0x0787('0x3b')]=_[_0x0787('0x3c')](_0x13c20a[_0x0787('0x3b')]);_0x3b83dc['filters']=_[_0x0787('0x3d')](_0x3b83dc[_0x0787('0x3a')],_0x3b83dc['query']);_0x4b048d[_0x0787('0x3e')]=_[_0x0787('0x3d')](_0x3b83dc[_0x0787('0x3a')],qs[_0x0787('0x3f')](_0x13c20a[_0x0787('0x3b')][_0x0787('0x3f')]));_0x4b048d['attributes']=_0x4b048d[_0x0787('0x3e')]['length']?_0x4b048d[_0x0787('0x3e')]:_0x3b83dc['model'];if(!_0x13c20a['query'][_0x0787('0x40')](_0x0787('0x41'))){_0x4b048d['limit']=qs[_0x0787('0x27')](_0x13c20a[_0x0787('0x3b')][_0x0787('0x27')]);_0x4b048d[_0x0787('0x29')]=qs[_0x0787('0x29')](_0x13c20a['query'][_0x0787('0x29')]);}_0x4b048d[_0x0787('0x42')]=qs[_0x0787('0x43')](_0x13c20a[_0x0787('0x3b')][_0x0787('0x43')]);_0x4b048d[_0x0787('0x44')]=qs['filters'](_[_0x0787('0x45')](_0x13c20a['query'],_0x3b83dc[_0x0787('0x46')]),_0x30c711);if(_0x13c20a[_0x0787('0x3b')]['filter']){_0x4b048d[_0x0787('0x44')]=_[_0x0787('0x47')](_0x4b048d['where'],{'$or':_[_0x0787('0x35')](_0x30c711,function(_0x2924fe){if(_0x2924fe[_0x0787('0x39')]!==_0x0787('0x48')){var _0x42a1d3={};_0x42a1d3[_0x2924fe[_0x0787('0x32')]]={'$like':'%'+_0x13c20a['query'][_0x0787('0x49')]+'%'};return _0x42a1d3;}})});}_0x4b048d=_[_0x0787('0x47')]({},_0x4b048d,_0x13c20a['options']);var _0x11529c={'where':_0x4b048d['where']};return db[_0x0787('0x36')][_0x0787('0x28')](_0x11529c)[_0x0787('0x16')](function(_0x474224){_0x4e7b46[_0x0787('0x28')]=_0x474224;if(_0x13c20a[_0x0787('0x3b')]['includeAll']){_0x4b048d[_0x0787('0x4a')]=[{'all':!![]}];}return db['VoiceContext'][_0x0787('0x4b')](_0x4b048d);})[_0x0787('0x16')](function(_0x49e22c){_0x4e7b46['rows']=_0x49e22c;return _0x4e7b46;})['then'](respondWithFilteredResult(_0x465175,_0x4b048d))['catch'](handleError(_0x465175,null));};exports[_0x0787('0x4c')]=function(_0x399bd3,_0x5b43c4){var _0x5be243={'raw':![],'where':{'id':_0x399bd3[_0x0787('0x4d')]['id']}},_0x2956a5={};_0x2956a5[_0x0787('0x3a')]=_['keys'](db[_0x0787('0x36')][_0x0787('0x37')]);_0x2956a5[_0x0787('0x3b')]=_[_0x0787('0x3c')](_0x399bd3['query']);_0x2956a5[_0x0787('0x46')]=_[_0x0787('0x3d')](_0x2956a5['model'],_0x2956a5[_0x0787('0x3b')]);_0x5be243[_0x0787('0x3e')]=_[_0x0787('0x3d')](_0x2956a5[_0x0787('0x3a')],qs[_0x0787('0x3f')](_0x399bd3[_0x0787('0x3b')][_0x0787('0x3f')]));_0x5be243[_0x0787('0x3e')]=_0x5be243[_0x0787('0x3e')]['length']?_0x5be243[_0x0787('0x3e')]:_0x2956a5[_0x0787('0x3a')];if(_0x399bd3[_0x0787('0x3b')][_0x0787('0x4e')]){_0x5be243[_0x0787('0x4a')]=[{'all':!![]}];}_0x5be243=_['merge']({},_0x5be243,_0x399bd3[_0x0787('0x4f')]);return db[_0x0787('0x36')][_0x0787('0x50')](_0x5be243)['then'](handleEntityNotFound(_0x5b43c4,null))[_0x0787('0x16')](respondWithResult(_0x5b43c4,null))['catch'](handleError(_0x5b43c4,null));};exports['create']=function(_0x545296,_0xe79439,_0xb45433){var _0x2f4048;return db[_0x0787('0x36')][_0x0787('0x51')](_0x545296[_0x0787('0x52')],{'raw':!![]})[_0x0787('0x16')](function(_0xf24e7b){_0x2f4048=_0xf24e7b;return db[_0x0787('0x36')]['findAll']({'raw':!![]});})['then'](function(_0x39b825){var _0x2ae5ab=fs['readFileSync'](path['join'](config[_0x0787('0x53')],_0x0787('0x54')),_0x0787('0x55'));var _0x5938ca=ejs[_0x0787('0x56')](_0x2ae5ab,{'contexts':_0x39b825||[]});fs[_0x0787('0x57')](_0x0787('0x58'),_0x5938ca);})[_0x0787('0x16')](function(){return respondWithRpcPromise(_0x0787('0x59'),_0x0787('0x51'),{'module':_0x0787('0x5a')});})['then'](function(){var _0x4b965a=_0x545296['user'][_0x0787('0x2f')]({'plain':!![]});if(!_0x4b965a)throw new Error(_0x0787('0x5b'));if(_0x4b965a[_0x0787('0x5c')]===_0x0787('0x5d')){var _0x344616=_0x2f4048[_0x0787('0x2f')]({'plain':!![]});return db[_0x0787('0x5e')][_0x0787('0x50')]({'where':{'name':_0x0787('0x30'),'userProfileId':_0x4b965a[_0x0787('0x5f')]},'raw':!![]})['then'](function(_0x56e2c8){if(_0x56e2c8&&_0x56e2c8[_0x0787('0x60')]===0x0){return db[_0x0787('0x31')]['create']({'name':_0x344616['name'],'resourceId':_0x344616['id'],'type':_0x56e2c8[_0x0787('0x32')],'sectionId':_0x56e2c8['id']},{})['then'](function(){return _0x2f4048;});}else{return _0x2f4048;}})[_0x0787('0x21')](function(_0x186c1b){logger[_0x0787('0x1d')](_0x0787('0x61'),_0x186c1b);throw _0x186c1b;});}return _0x2f4048;})['then'](respondWithResult(_0xe79439,0xc9))['catch'](handleError(_0xe79439,null));};exports[_0x0787('0x62')]=function(_0x19991b,_0x156b14,_0x402c24){var _0x5d9d79;return db[_0x0787('0x36')][_0x0787('0x50')]({'where':{'id':_0x19991b[_0x0787('0x4d')]['id']}})['then'](handleEntityNotFound(_0x156b14,null))[_0x0787('0x16')](saveUpdates(_0x19991b[_0x0787('0x52')],null))[_0x0787('0x16')](function(_0x51d991){if(_0x51d991){_0x5d9d79=_0x51d991;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x0787('0x16')](function(_0x4228d2){var _0x24a232=fs['readFileSync'](path[_0x0787('0x63')](config['root'],_0x0787('0x54')),_0x0787('0x55'));var _0x2a2ee5=ejs['render'](_0x24a232,{'contexts':_0x4228d2||[]});fs[_0x0787('0x57')](_0x0787('0x58'),_0x2a2ee5);})[_0x0787('0x16')](function(){return respondWithRpcPromise(_0x0787('0x59'),'update',{'module':_0x0787('0x5a')});})['then'](function(){return _0x5d9d79;})[_0x0787('0x16')](respondWithResult(_0x156b14,null))[_0x0787('0x21')](handleError(_0x156b14,null));};exports[_0x0787('0x2e')]=function(_0x4768cd,_0x6408b4,_0x4d7dbb){var _0x41f800;return db[_0x0787('0x36')]['find']({'where':{'id':_0x4768cd[_0x0787('0x4d')]['id']}})[_0x0787('0x16')](handleEntityNotFound(_0x6408b4,null))['then'](removeEntity(_0x6408b4,null))[_0x0787('0x16')](function(){return db[_0x0787('0x36')][_0x0787('0x4b')]({'raw':!![]});})[_0x0787('0x16')](function(_0x14e7fd){var _0x36b9f7=fs[_0x0787('0x64')](path['join'](config['root'],_0x0787('0x54')),_0x0787('0x55'));var _0x37395b=ejs[_0x0787('0x56')](_0x36b9f7,{'contexts':_0x14e7fd});fs[_0x0787('0x57')](_0x0787('0x58'),_0x37395b);return respondWithRpcPromise('Reload',_0x0787('0x2e'),{'module':_0x0787('0x5a')});})[_0x0787('0x21')](handleError(_0x6408b4,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3c61cf8..6200179 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 _0xed22=['../../config/environment','./voiceContext.attributes','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a5bb2,_0x36ce56){var _0x38c97a=function(_0x4d1990){while(--_0x4d1990){_0x4a5bb2['push'](_0x4a5bb2['shift']());}};_0x38c97a(++_0x36ce56);}(_0xed22,0x87));var _0x2ed2=function(_0xb04032,_0x5e0cad){_0xb04032=_0xb04032-0x0;var _0x2b0248=_0xed22[_0xb04032];return _0x2b0248;};'use strict';var _=require(_0x2ed2('0x0'));var util=require(_0x2ed2('0x1'));var logger=require(_0x2ed2('0x2'))(_0x2ed2('0x3'));var moment=require(_0x2ed2('0x4'));var BPromise=require(_0x2ed2('0x5'));var rp=require(_0x2ed2('0x6'));var fs=require('fs');var path=require(_0x2ed2('0x7'));var rimraf=require(_0x2ed2('0x8'));var config=require(_0x2ed2('0x9'));var attributes=require(_0x2ed2('0xa'));module['exports']=function(_0x1d8a36,_0x15ee88){return _0x1d8a36['define']('VoiceContext',attributes,{'tableName':_0x2ed2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x099b=['VoiceContext','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','define'];(function(_0x10fbc4,_0x21236d){var _0xbe4b3=function(_0x1eceec){while(--_0x1eceec){_0x10fbc4['push'](_0x10fbc4['shift']());}};_0xbe4b3(++_0x21236d);}(_0x099b,0xe8));var _0xb099=function(_0x438fd5,_0x3b3ebe){_0x438fd5=_0x438fd5-0x0;var _0x47033f=_0x099b[_0x438fd5];return _0x47033f;};'use strict';var _=require(_0xb099('0x0'));var util=require(_0xb099('0x1'));var logger=require('../../config/logger')(_0xb099('0x2'));var moment=require(_0xb099('0x3'));var BPromise=require(_0xb099('0x4'));var rp=require(_0xb099('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb099('0x6'));var config=require(_0xb099('0x7'));var attributes=require(_0xb099('0x8'));module['exports']=function(_0x3d987b,_0x1e28c2){return _0x3d987b[_0xb099('0x9')](_0xb099('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 6a31552..2526eb3 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 _0xa9cd=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0xa9cd,0x187));var _0xda9c=function(_0x3c72c4,_0x507632){_0x3c72c4=_0x3c72c4-0x0;var _0x24645f=_0xa9cd[_0x3c72c4];return _0x24645f;};'use strict';var _=require(_0xda9c('0x0'));var util=require(_0xda9c('0x1'));var moment=require(_0xda9c('0x2'));var BPromise=require(_0xda9c('0x3'));var rs=require(_0xda9c('0x4'));var fs=require('fs');var Redis=require(_0xda9c('0x5'));var db=require(_0xda9c('0x6'))['db'];var utils=require(_0xda9c('0x7'));var logger=require('../../config/logger')(_0xda9c('0x8'));var config=require(_0xda9c('0x9'));var jayson=require(_0xda9c('0xa'));var client=jayson[_0xda9c('0xb')][_0xda9c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38349b,_0x52e9fb,_0x59b7c3){return new BPromise(function(_0x5a401e,_0x9bbe75){return client[_0xda9c('0xd')](_0x38349b,_0x59b7c3)[_0xda9c('0xe')](function(_0x208997){logger['info'](_0xda9c('0xf'),_0x52e9fb,_0xda9c('0x10'));logger[_0xda9c('0x11')](_0xda9c('0x12'),_0x52e9fb,_0xda9c('0x10'),JSON['stringify'](_0x208997));if(_0x208997[_0xda9c('0x13')]){if(_0x208997[_0xda9c('0x13')]['code']===0x1f4){logger['error'](_0xda9c('0xf'),_0x52e9fb,_0x208997[_0xda9c('0x13')][_0xda9c('0x14')]);return _0x9bbe75(_0x208997[_0xda9c('0x13')]['message']);}logger[_0xda9c('0x13')]('VoiceContext,\x20%s,\x20%s',_0x52e9fb,_0x208997['error'][_0xda9c('0x14')]);return _0x5a401e(_0x208997[_0xda9c('0x13')][_0xda9c('0x14')]);}else{logger[_0xda9c('0x15')](_0xda9c('0xf'),_0x52e9fb,'request\x20sent');_0x5a401e(_0x208997[_0xda9c('0x16')][_0xda9c('0x14')]);}})[_0xda9c('0x17')](function(_0x1db4f7){logger[_0xda9c('0x13')](_0xda9c('0xf'),_0x52e9fb,_0x1db4f7);_0x9bbe75(_0x1db4f7);});});} \ No newline at end of file +var _0xd5e5=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x324a52,_0x450d80){var _0x2b62e7=function(_0x6f0287){while(--_0x6f0287){_0x324a52['push'](_0x324a52['shift']());}};_0x2b62e7(++_0x450d80);}(_0xd5e5,0x187));var _0x5d5e=function(_0x549a2c,_0x13bd03){_0x549a2c=_0x549a2c-0x0;var _0x16b56b=_0xd5e5[_0x549a2c];return _0x16b56b;};'use strict';var _=require('lodash');var util=require(_0x5d5e('0x0'));var moment=require('moment');var BPromise=require(_0x5d5e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d5e('0x2'));var db=require(_0x5d5e('0x3'))['db'];var utils=require(_0x5d5e('0x4'));var logger=require(_0x5d5e('0x5'))(_0x5d5e('0x6'));var config=require(_0x5d5e('0x7'));var jayson=require(_0x5d5e('0x8'));var client=jayson['client'][_0x5d5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x82e1c0,_0x232f1b,_0x2a6202){return new BPromise(function(_0x308f82,_0x39917c){return client[_0x5d5e('0xa')](_0x82e1c0,_0x2a6202)[_0x5d5e('0xb')](function(_0x35c3f1){logger['info'](_0x5d5e('0xc'),_0x232f1b,_0x5d5e('0xd'));logger[_0x5d5e('0xe')](_0x5d5e('0xf'),_0x232f1b,_0x5d5e('0xd'),JSON[_0x5d5e('0x10')](_0x35c3f1));if(_0x35c3f1[_0x5d5e('0x11')]){if(_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x12')]===0x1f4){logger[_0x5d5e('0x11')](_0x5d5e('0xc'),_0x232f1b,_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x13')]);return _0x39917c(_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x13')]);}logger[_0x5d5e('0x11')](_0x5d5e('0xc'),_0x232f1b,_0x35c3f1[_0x5d5e('0x11')][_0x5d5e('0x13')]);return _0x308f82(_0x35c3f1['error']['message']);}else{logger[_0x5d5e('0x14')]('VoiceContext,\x20%s,\x20%s',_0x232f1b,'request\x20sent');_0x308f82(_0x35c3f1[_0x5d5e('0x15')]['message']);}})['catch'](function(_0x2d2bd8){logger[_0x5d5e('0x11')](_0x5d5e('0xc'),_0x232f1b,_0x2d2bd8);_0x39917c(_0x2d2bd8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f830f95..6fe37f7 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 _0xa8a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x1ceafa,_0x252713){var _0x2cb283=function(_0x3b68c9){while(--_0x3b68c9){_0x1ceafa['push'](_0x1ceafa['shift']());}};_0x2cb283(++_0x252713);}(_0xa8a8,0xec));var _0x8a8a=function(_0x42d9ce,_0x2f157f){_0x42d9ce=_0x42d9ce-0x0;var _0xb8cdc8=_0xa8a8[_0x42d9ce];return _0xb8cdc8;};'use strict';var multer=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var path=require(_0x8a8a('0x2'));var timeout=require(_0x8a8a('0x3'));var express=require('express');var router=express[_0x8a8a('0x4')]();var fs_extra=require(_0x8a8a('0x5'));var auth=require(_0x8a8a('0x6'));var interaction=require(_0x8a8a('0x7'));var config=require(_0x8a8a('0x8'));var controller=require(_0x8a8a('0x9'));router[_0x8a8a('0xa')]('/',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xc')]);router[_0x8a8a('0xa')](_0x8a8a('0xd'),auth[_0x8a8a('0xb')](),controller[_0x8a8a('0xe')]);router[_0x8a8a('0xa')](_0x8a8a('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x8a8a('0x10')]('/',auth['isAuthenticated'](),controller[_0x8a8a('0x11')]);router[_0x8a8a('0x12')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x13')]);router[_0x8a8a('0x14')]('/:id',auth[_0x8a8a('0xb')](),controller[_0x8a8a('0x15')]);module[_0x8a8a('0x16')]=router; \ No newline at end of file +var _0x5a52=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','post','update','delete','destroy','multer','util','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a52,0xc3));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x25a5('0x0'));var util=require(_0x25a5('0x1'));var path=require('path');var timeout=require(_0x25a5('0x2'));var express=require(_0x25a5('0x3'));var router=express[_0x25a5('0x4')]();var fs_extra=require(_0x25a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x25a5('0x6'));var config=require(_0x25a5('0x7'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x25a5('0x8')](),controller[_0x25a5('0x9')]);router['get'](_0x25a5('0xa'),auth[_0x25a5('0x8')](),controller[_0x25a5('0xb')]);router[_0x25a5('0xc')](_0x25a5('0xd'),auth[_0x25a5('0x8')](),controller['show']);router[_0x25a5('0xe')]('/',auth[_0x25a5('0x8')](),controller['create']);router['put']('/:id',auth[_0x25a5('0x8')](),controller[_0x25a5('0xf')]);router[_0x25a5('0x10')](_0x25a5('0xd'),auth[_0x25a5('0x8')](),controller[_0x25a5('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ae50e5f..5741898 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2ca=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x5daa69,_0x528fe9){var _0x1908c3=function(_0x47b226){while(--_0x47b226){_0x5daa69['push'](_0x5daa69['shift']());}};_0x1908c3(++_0x528fe9);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0xf2ca[_0x503564];return _0x4be9fd;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'privilege':{'type':Sequelize[_0xaf2c('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaf2c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'destlinkedid':{'type':Sequelize[_0xaf2c('0x2')]},'dialstring':{'type':Sequelize[_0xaf2c('0x2')]},'dialstatus':{'type':Sequelize[_0xaf2c('0x2')]},'starttime':{'type':Sequelize[_0xaf2c('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x5')},'routeId':{'type':Sequelize[_0xaf2c('0x3')]},'duration':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x3')]},'billableseconds':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file +var _0xdace=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x3388d8,_0x256024){var _0x2bbe73=function(_0x3c0cb2){while(--_0x3c0cb2){_0x3388d8['push'](_0x3388d8['shift']());}};_0x2bbe73(++_0x256024);}(_0xdace,0xc5));var _0xedac=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xdace[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xedac('0x1')]},'channel':{'type':Sequelize[_0xedac('0x1')]},'channelstate':{'type':Sequelize[_0xedac('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xedac('0x1')]},'calleridname':{'type':Sequelize[_0xedac('0x1')]},'connectedlinenum':{'type':Sequelize[_0xedac('0x1')]},'connectedlinename':{'type':Sequelize[_0xedac('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xedac('0x1')]},'context':{'type':Sequelize[_0xedac('0x1')]},'exten':{'type':Sequelize[_0xedac('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xedac('0x1')]},'linkedid':{'type':Sequelize[_0xedac('0x1')]},'destchannel':{'type':Sequelize[_0xedac('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xedac('0x1')]},'destcalleridnum':{'type':Sequelize[_0xedac('0x1')]},'destcalleridname':{'type':Sequelize[_0xedac('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xedac('0x1')]},'destaccountcode':{'type':Sequelize[_0xedac('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xedac('0x2')]},'destuniqueid':{'type':Sequelize[_0xedac('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xedac('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xedac('0x3')]},'answertime':{'type':Sequelize[_0xedac('0x3')]},'endtime':{'type':Sequelize[_0xedac('0x3')]},'lastevent':{'type':Sequelize[_0xedac('0x1')],'comment':_0xedac('0x4')},'routeId':{'type':Sequelize[_0xedac('0x2')]},'duration':{'type':Sequelize[_0xedac('0x2')]},'holdtime':{'type':Sequelize[_0xedac('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 5ef7ff8..322ae8c 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 _0xe616=['fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','VoiceDialReport','rawAttributes','key','model','keys','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3ec5e9,_0x2a667c){var _0x518254=function(_0x877b56){while(--_0x877b56){_0x3ec5e9['push'](_0x3ec5e9['shift']());}};_0x518254(++_0x2a667c);}(_0xe616,0x8a));var _0x6e61=function(_0x51f357,_0x58d147){_0x51f357=_0x51f357-0x0;var _0x186473=_0xe616[_0x51f357];return _0x186473;};'use strict';var emlformat=require(_0x6e61('0x0'));var rimraf=require(_0x6e61('0x1'));var zipdir=require(_0x6e61('0x2'));var jsonpatch=require(_0x6e61('0x3'));var rp=require('request-promise');var moment=require(_0x6e61('0x4'));var BPromise=require(_0x6e61('0x5'));var Mustache=require(_0x6e61('0x6'));var util=require(_0x6e61('0x7'));var path=require(_0x6e61('0x8'));var sox=require(_0x6e61('0x9'));var csv=require(_0x6e61('0xa'));var ejs=require(_0x6e61('0xb'));var fs=require('fs');var fs_extra=require(_0x6e61('0xc'));var _=require(_0x6e61('0xd'));var squel=require(_0x6e61('0xe'));var crypto=require('crypto');var jsforce=require(_0x6e61('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6e61('0xa'));var querystring=require(_0x6e61('0x10'));var Papa=require(_0x6e61('0x11'));var Redis=require(_0x6e61('0x12'));var authService=require(_0x6e61('0x13'));var qs=require(_0x6e61('0x14'));var as=require(_0x6e61('0x15'));var hardwareService=require(_0x6e61('0x16'));var logger=require(_0x6e61('0x17'))(_0x6e61('0x18'));var utils=require(_0x6e61('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f633,_0x42cf6f){_0x42cf6f=_0x42cf6f||0xcc;return function(_0x554fe6){if(_0x554fe6){return _0x51f633[_0x6e61('0x1a')](_0x42cf6f);}return _0x51f633[_0x6e61('0x1b')](_0x42cf6f)[_0x6e61('0x1c')]();};}function respondWithResult(_0x1cf801,_0x484e4e){_0x484e4e=_0x484e4e||0xc8;return function(_0x32f828){if(_0x32f828){return _0x1cf801['status'](_0x484e4e)[_0x6e61('0x1d')](_0x32f828);}};}function respondWithFilteredResult(_0x1d8b93,_0x2499eb){return function(_0x3dfbb2){if(_0x3dfbb2){var _0x5302b7=typeof _0x2499eb['offset']===_0x6e61('0x1e')&&typeof _0x2499eb[_0x6e61('0x1f')]===_0x6e61('0x1e');var _0x4fd08c=_0x3dfbb2[_0x6e61('0x20')];var _0x1154d7=_0x5302b7?0x0:_0x2499eb[_0x6e61('0x21')];var _0xbd271=_0x5302b7?_0x3dfbb2['count']:_0x2499eb['offset']+_0x2499eb[_0x6e61('0x1f')];var _0x30e3b5;if(_0xbd271>=_0x4fd08c){_0xbd271=_0x4fd08c;_0x30e3b5=0xc8;}else{_0x30e3b5=0xce;}_0x1d8b93[_0x6e61('0x1b')](_0x30e3b5);return _0x1d8b93[_0x6e61('0x22')](_0x6e61('0x23'),_0x1154d7+'-'+_0xbd271+'/'+_0x4fd08c)['json'](_0x3dfbb2);}return null;};}function patchUpdates(_0x16d5b8){return function(_0x5bd6b4){try{jsonpatch['apply'](_0x5bd6b4,_0x16d5b8,!![]);}catch(_0x4abd04){return BPromise[_0x6e61('0x24')](_0x4abd04);}return _0x5bd6b4[_0x6e61('0x25')]();};}function saveUpdates(_0x213792,_0x230a3d){return function(_0x3cfe9d){if(_0x3cfe9d){return _0x3cfe9d[_0x6e61('0x26')](_0x213792)[_0x6e61('0x27')](function(_0x278d7f){return _0x278d7f;});}return null;};}function removeEntity(_0x53e3d2,_0x5baed1){return function(_0x128eb3){if(_0x128eb3){return _0x128eb3[_0x6e61('0x28')]()['then'](function(){_0x53e3d2[_0x6e61('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5db26c,_0x4e5f37){return function(_0x21e8e1){if(!_0x21e8e1){_0x5db26c[_0x6e61('0x1a')](0x194);}return _0x21e8e1;};}function handleError(_0x559c2d,_0x2b50f4){_0x2b50f4=_0x2b50f4||0x1f4;return function(_0x4e8890){logger[_0x6e61('0x29')](_0x4e8890['stack']);if(_0x4e8890[_0x6e61('0x2a')]){delete _0x4e8890[_0x6e61('0x2a')];}_0x559c2d[_0x6e61('0x1b')](_0x2b50f4)[_0x6e61('0x2b')](_0x4e8890);};}exports['index']=function(_0x53c0e3,_0x36c87a){var _0x26e4c5={},_0x2a2d8d={},_0x4e21b6={'count':0x0,'rows':[]};var _0x497bd3=_[_0x6e61('0x2c')](db[_0x6e61('0x2d')][_0x6e61('0x2e')],function(_0x5f5b8f){return{'name':_0x5f5b8f['fieldName'],'type':_0x5f5b8f['type'][_0x6e61('0x2f')]};});_0x2a2d8d[_0x6e61('0x30')]=_[_0x6e61('0x2c')](_0x497bd3,_0x6e61('0x2a'));_0x2a2d8d['query']=_[_0x6e61('0x31')](_0x53c0e3[_0x6e61('0x32')]);_0x2a2d8d['filters']=_['intersection'](_0x2a2d8d[_0x6e61('0x30')],_0x2a2d8d[_0x6e61('0x32')]);_0x26e4c5['attributes']=_[_0x6e61('0x33')](_0x2a2d8d['model'],qs[_0x6e61('0x34')](_0x53c0e3['query']['fields']));_0x26e4c5[_0x6e61('0x35')]=_0x26e4c5['attributes'][_0x6e61('0x36')]?_0x26e4c5['attributes']:_0x2a2d8d[_0x6e61('0x30')];if(!_0x53c0e3['query']['hasOwnProperty'](_0x6e61('0x37'))){_0x26e4c5[_0x6e61('0x1f')]=qs[_0x6e61('0x1f')](_0x53c0e3[_0x6e61('0x32')]['limit']);_0x26e4c5[_0x6e61('0x21')]=qs[_0x6e61('0x21')](_0x53c0e3[_0x6e61('0x32')][_0x6e61('0x21')]);}_0x26e4c5['order']=qs[_0x6e61('0x38')](_0x53c0e3[_0x6e61('0x32')][_0x6e61('0x38')]);_0x26e4c5[_0x6e61('0x39')]=qs[_0x6e61('0x3a')](_[_0x6e61('0x3b')](_0x53c0e3[_0x6e61('0x32')],_0x2a2d8d[_0x6e61('0x3a')]),_0x497bd3);if(_0x53c0e3['query'][_0x6e61('0x3c')]){_0x26e4c5[_0x6e61('0x39')]=_[_0x6e61('0x3d')](_0x26e4c5[_0x6e61('0x39')],{'$or':_[_0x6e61('0x2c')](_0x497bd3,function(_0x523a7a){if(_0x523a7a[_0x6e61('0x3e')]!==_0x6e61('0x3f')){var _0x47aaf7={};_0x47aaf7[_0x523a7a[_0x6e61('0x2a')]]={'$like':'%'+_0x53c0e3['query'][_0x6e61('0x3c')]+'%'};return _0x47aaf7;}})});}_0x26e4c5=_[_0x6e61('0x3d')]({},_0x26e4c5,_0x53c0e3['options']);var _0x956717={'where':_0x26e4c5[_0x6e61('0x39')]};return db[_0x6e61('0x2d')]['count'](_0x956717)[_0x6e61('0x27')](function(_0x4cf8d){_0x4e21b6[_0x6e61('0x20')]=_0x4cf8d;if(_0x53c0e3['query'][_0x6e61('0x40')]){_0x26e4c5['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x6e61('0x41')](_0x26e4c5);})[_0x6e61('0x27')](function(_0x296b86){_0x4e21b6[_0x6e61('0x42')]=_0x296b86;return _0x4e21b6;})[_0x6e61('0x27')](respondWithFilteredResult(_0x36c87a,_0x26e4c5))[_0x6e61('0x43')](handleError(_0x36c87a,null));};exports[_0x6e61('0x44')]=function(_0x4c2ce2,_0x4df71b){var _0x1bc589={'raw':!![],'where':{'id':_0x4c2ce2['params']['id']}},_0x1653be={};_0x1653be[_0x6e61('0x30')]=_['keys'](db[_0x6e61('0x2d')][_0x6e61('0x2e')]);_0x1653be[_0x6e61('0x32')]=_[_0x6e61('0x31')](_0x4c2ce2[_0x6e61('0x32')]);_0x1653be[_0x6e61('0x3a')]=_[_0x6e61('0x33')](_0x1653be['model'],_0x1653be[_0x6e61('0x32')]);_0x1bc589[_0x6e61('0x35')]=_[_0x6e61('0x33')](_0x1653be[_0x6e61('0x30')],qs[_0x6e61('0x34')](_0x4c2ce2[_0x6e61('0x32')][_0x6e61('0x34')]));_0x1bc589['attributes']=_0x1bc589[_0x6e61('0x35')][_0x6e61('0x36')]?_0x1bc589['attributes']:_0x1653be['model'];if(_0x4c2ce2[_0x6e61('0x32')][_0x6e61('0x40')]){_0x1bc589[_0x6e61('0x45')]=[{'all':!![]}];}_0x1bc589=_[_0x6e61('0x3d')]({},_0x1bc589,_0x4c2ce2[_0x6e61('0x46')]);return db[_0x6e61('0x2d')][_0x6e61('0x47')](_0x1bc589)[_0x6e61('0x27')](handleEntityNotFound(_0x4df71b,null))[_0x6e61('0x27')](respondWithResult(_0x4df71b,null))[_0x6e61('0x43')](handleError(_0x4df71b,null));};exports[_0x6e61('0x48')]=function(_0x4f57c3,_0x445b8d){return db[_0x6e61('0x2d')][_0x6e61('0x48')](_0x4f57c3['body'],{})[_0x6e61('0x27')](respondWithResult(_0x445b8d,0xc9))[_0x6e61('0x43')](handleError(_0x445b8d,null));};exports['update']=function(_0x2e96f0,_0x11f94d){if(_0x2e96f0['body']['id']){delete _0x2e96f0['body']['id'];}return db['VoiceDialReport'][_0x6e61('0x47')]({'where':{'id':_0x2e96f0['params']['id']}})[_0x6e61('0x27')](handleEntityNotFound(_0x11f94d,null))['then'](saveUpdates(_0x2e96f0[_0x6e61('0x49')],null))[_0x6e61('0x27')](respondWithResult(_0x11f94d,null))[_0x6e61('0x43')](handleError(_0x11f94d,null));};exports['destroy']=function(_0x4c4974,_0x756c6e){return db[_0x6e61('0x2d')][_0x6e61('0x47')]({'where':{'id':_0x4c4974['params']['id']}})[_0x6e61('0x27')](handleEntityNotFound(_0x756c6e,null))[_0x6e61('0x27')](removeEntity(_0x756c6e,null))[_0x6e61('0x43')](handleError(_0x756c6e,null));};exports[_0x6e61('0x4a')]=function(_0x5ba7b7,_0x31e946){return db[_0x6e61('0x2d')][_0x6e61('0x4a')]()[_0x6e61('0x27')](respondWithResult(_0x31e946,null))[_0x6e61('0x43')](handleError(_0x31e946,null));}; \ No newline at end of file +var _0xd629=['ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceDialReport','includeAll','findAll','rows','catch','params','rawAttributes','include','options','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv'];(function(_0xbeab56,_0x3b37ff){var _0x203be1=function(_0x4aadc6){while(--_0x4aadc6){_0xbeab56['push'](_0xbeab56['shift']());}};_0x203be1(++_0x3b37ff);}(_0xd629,0x11b));var _0x9d62=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xd629[_0x34843e];return _0x598f7f;};'use strict';var emlformat=require(_0x9d62('0x0'));var rimraf=require(_0x9d62('0x1'));var zipdir=require(_0x9d62('0x2'));var jsonpatch=require(_0x9d62('0x3'));var rp=require(_0x9d62('0x4'));var moment=require(_0x9d62('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9d62('0x6'));var path=require(_0x9d62('0x7'));var sox=require('sox');var csv=require(_0x9d62('0x8'));var ejs=require(_0x9d62('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d62('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9d62('0xb'));var deskjs=require(_0x9d62('0xc'));var toCsv=require(_0x9d62('0x8'));var querystring=require(_0x9d62('0xd'));var Papa=require(_0x9d62('0xe'));var Redis=require(_0x9d62('0xf'));var authService=require(_0x9d62('0x10'));var qs=require(_0x9d62('0x11'));var as=require(_0x9d62('0x12'));var hardwareService=require(_0x9d62('0x13'));var logger=require('../../config/logger')(_0x9d62('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9d62('0x15'))['db'];function respondWithStatusCode(_0x24c4c5,_0x18d539){_0x18d539=_0x18d539||0xcc;return function(_0x37f746){if(_0x37f746){return _0x24c4c5[_0x9d62('0x16')](_0x18d539);}return _0x24c4c5[_0x9d62('0x17')](_0x18d539)[_0x9d62('0x18')]();};}function respondWithResult(_0x336005,_0x1ef747){_0x1ef747=_0x1ef747||0xc8;return function(_0x51f746){if(_0x51f746){return _0x336005[_0x9d62('0x17')](_0x1ef747)['json'](_0x51f746);}};}function respondWithFilteredResult(_0x4b203b,_0x20c158){return function(_0x15615f){if(_0x15615f){var _0x4cefa0=typeof _0x20c158[_0x9d62('0x19')]===_0x9d62('0x1a')&&typeof _0x20c158[_0x9d62('0x1b')]===_0x9d62('0x1a');var _0x568a25=_0x15615f[_0x9d62('0x1c')];var _0x4b75a7=_0x4cefa0?0x0:_0x20c158[_0x9d62('0x19')];var _0x556da5=_0x4cefa0?_0x15615f[_0x9d62('0x1c')]:_0x20c158[_0x9d62('0x19')]+_0x20c158[_0x9d62('0x1b')];var _0x494c5e;if(_0x556da5>=_0x568a25){_0x556da5=_0x568a25;_0x494c5e=0xc8;}else{_0x494c5e=0xce;}_0x4b203b['status'](_0x494c5e);return _0x4b203b[_0x9d62('0x1d')](_0x9d62('0x1e'),_0x4b75a7+'-'+_0x556da5+'/'+_0x568a25)[_0x9d62('0x1f')](_0x15615f);}return null;};}function patchUpdates(_0x5a1ba9){return function(_0x4976a7){try{jsonpatch[_0x9d62('0x20')](_0x4976a7,_0x5a1ba9,!![]);}catch(_0x324bd3){return BPromise[_0x9d62('0x21')](_0x324bd3);}return _0x4976a7[_0x9d62('0x22')]();};}function saveUpdates(_0x3050bf,_0xa4926a){return function(_0x567b74){if(_0x567b74){return _0x567b74[_0x9d62('0x23')](_0x3050bf)[_0x9d62('0x24')](function(_0x477933){return _0x477933;});}return null;};}function removeEntity(_0x3be79a,_0x2c7750){return function(_0x5d8218){if(_0x5d8218){return _0x5d8218[_0x9d62('0x25')]()[_0x9d62('0x24')](function(){_0x3be79a[_0x9d62('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10134d,_0x4473e1){return function(_0x592c3c){if(!_0x592c3c){_0x10134d['sendStatus'](0x194);}return _0x592c3c;};}function handleError(_0x3aaaa4,_0x414f9f){_0x414f9f=_0x414f9f||0x1f4;return function(_0x41b26d){logger[_0x9d62('0x26')](_0x41b26d[_0x9d62('0x27')]);if(_0x41b26d[_0x9d62('0x28')]){delete _0x41b26d[_0x9d62('0x28')];}_0x3aaaa4[_0x9d62('0x17')](_0x414f9f)[_0x9d62('0x29')](_0x41b26d);};}exports[_0x9d62('0x2a')]=function(_0x295f18,_0x2efbb0){var _0x3d3bbe={},_0x3188b8={},_0x8b2116={'count':0x0,'rows':[]};var _0x381a23=_[_0x9d62('0x2b')](db['VoiceDialReport']['rawAttributes'],function(_0x3a3c52){return{'name':_0x3a3c52['fieldName'],'type':_0x3a3c52['type']['key']};});_0x3188b8['model']=_[_0x9d62('0x2b')](_0x381a23,'name');_0x3188b8['query']=_[_0x9d62('0x2c')](_0x295f18[_0x9d62('0x2d')]);_0x3188b8['filters']=_[_0x9d62('0x2e')](_0x3188b8[_0x9d62('0x2f')],_0x3188b8['query']);_0x3d3bbe[_0x9d62('0x30')]=_[_0x9d62('0x2e')](_0x3188b8['model'],qs[_0x9d62('0x31')](_0x295f18[_0x9d62('0x2d')][_0x9d62('0x31')]));_0x3d3bbe[_0x9d62('0x30')]=_0x3d3bbe[_0x9d62('0x30')][_0x9d62('0x32')]?_0x3d3bbe[_0x9d62('0x30')]:_0x3188b8[_0x9d62('0x2f')];if(!_0x295f18['query'][_0x9d62('0x33')](_0x9d62('0x34'))){_0x3d3bbe[_0x9d62('0x1b')]=qs[_0x9d62('0x1b')](_0x295f18[_0x9d62('0x2d')]['limit']);_0x3d3bbe[_0x9d62('0x19')]=qs[_0x9d62('0x19')](_0x295f18[_0x9d62('0x2d')][_0x9d62('0x19')]);}_0x3d3bbe[_0x9d62('0x35')]=qs[_0x9d62('0x36')](_0x295f18[_0x9d62('0x2d')][_0x9d62('0x36')]);_0x3d3bbe['where']=qs[_0x9d62('0x37')](_[_0x9d62('0x38')](_0x295f18[_0x9d62('0x2d')],_0x3188b8['filters']),_0x381a23);if(_0x295f18[_0x9d62('0x2d')][_0x9d62('0x39')]){_0x3d3bbe[_0x9d62('0x3a')]=_[_0x9d62('0x3b')](_0x3d3bbe['where'],{'$or':_[_0x9d62('0x2b')](_0x381a23,function(_0x2f9f57){if(_0x2f9f57['type']!==_0x9d62('0x3c')){var _0x40fbba={};_0x40fbba[_0x2f9f57[_0x9d62('0x28')]]={'$like':'%'+_0x295f18['query'][_0x9d62('0x39')]+'%'};return _0x40fbba;}})});}_0x3d3bbe=_[_0x9d62('0x3b')]({},_0x3d3bbe,_0x295f18['options']);var _0x11aec8={'where':_0x3d3bbe[_0x9d62('0x3a')]};return db[_0x9d62('0x3d')][_0x9d62('0x1c')](_0x11aec8)[_0x9d62('0x24')](function(_0x5904ee){_0x8b2116['count']=_0x5904ee;if(_0x295f18[_0x9d62('0x2d')][_0x9d62('0x3e')]){_0x3d3bbe['include']=[{'all':!![]}];}return db[_0x9d62('0x3d')][_0x9d62('0x3f')](_0x3d3bbe);})[_0x9d62('0x24')](function(_0x2d8af4){_0x8b2116[_0x9d62('0x40')]=_0x2d8af4;return _0x8b2116;})[_0x9d62('0x24')](respondWithFilteredResult(_0x2efbb0,_0x3d3bbe))[_0x9d62('0x41')](handleError(_0x2efbb0,null));};exports['show']=function(_0x17199a,_0x376e91){var _0x5640e1={'raw':!![],'where':{'id':_0x17199a[_0x9d62('0x42')]['id']}},_0x40d53d={};_0x40d53d['model']=_[_0x9d62('0x2c')](db[_0x9d62('0x3d')][_0x9d62('0x43')]);_0x40d53d[_0x9d62('0x2d')]=_[_0x9d62('0x2c')](_0x17199a[_0x9d62('0x2d')]);_0x40d53d[_0x9d62('0x37')]=_['intersection'](_0x40d53d[_0x9d62('0x2f')],_0x40d53d[_0x9d62('0x2d')]);_0x5640e1[_0x9d62('0x30')]=_[_0x9d62('0x2e')](_0x40d53d[_0x9d62('0x2f')],qs[_0x9d62('0x31')](_0x17199a[_0x9d62('0x2d')]['fields']));_0x5640e1['attributes']=_0x5640e1[_0x9d62('0x30')][_0x9d62('0x32')]?_0x5640e1['attributes']:_0x40d53d[_0x9d62('0x2f')];if(_0x17199a['query']['includeAll']){_0x5640e1[_0x9d62('0x44')]=[{'all':!![]}];}_0x5640e1=_[_0x9d62('0x3b')]({},_0x5640e1,_0x17199a[_0x9d62('0x45')]);return db[_0x9d62('0x3d')]['find'](_0x5640e1)[_0x9d62('0x24')](handleEntityNotFound(_0x376e91,null))['then'](respondWithResult(_0x376e91,null))[_0x9d62('0x41')](handleError(_0x376e91,null));};exports['create']=function(_0x7248a7,_0x193ed3){return db['VoiceDialReport']['create'](_0x7248a7[_0x9d62('0x46')],{})[_0x9d62('0x24')](respondWithResult(_0x193ed3,0xc9))['catch'](handleError(_0x193ed3,null));};exports[_0x9d62('0x23')]=function(_0x48699c,_0x298994){if(_0x48699c['body']['id']){delete _0x48699c[_0x9d62('0x46')]['id'];}return db['VoiceDialReport'][_0x9d62('0x47')]({'where':{'id':_0x48699c[_0x9d62('0x42')]['id']}})['then'](handleEntityNotFound(_0x298994,null))[_0x9d62('0x24')](saveUpdates(_0x48699c['body'],null))[_0x9d62('0x24')](respondWithResult(_0x298994,null))[_0x9d62('0x41')](handleError(_0x298994,null));};exports[_0x9d62('0x25')]=function(_0x23e5f8,_0x2cd267){return db[_0x9d62('0x3d')]['find']({'where':{'id':_0x23e5f8[_0x9d62('0x42')]['id']}})[_0x9d62('0x24')](handleEntityNotFound(_0x2cd267,null))[_0x9d62('0x24')](removeEntity(_0x2cd267,null))[_0x9d62('0x41')](handleError(_0x2cd267,null));};exports[_0x9d62('0x48')]=function(_0x336997,_0x14d88b){return db['VoiceDialReport'][_0x9d62('0x48')]()[_0x9d62('0x24')](respondWithResult(_0x14d88b,null))[_0x9d62('0x41')](handleError(_0x14d88b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 1f4145c..93cee84 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 _0xe167=['../../config/logger','api','bluebird','request-promise','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','util'];(function(_0x4a2e9b,_0x1f492f){var _0x2bd464=function(_0x908968){while(--_0x908968){_0x4a2e9b['push'](_0x4a2e9b['shift']());}};_0x2bd464(++_0x1f492f);}(_0xe167,0xb3));var _0x7e16=function(_0x37e8b2,_0x17ed02){_0x37e8b2=_0x37e8b2-0x0;var _0x1525c5=_0xe167[_0x37e8b2];return _0x1525c5;};'use strict';var _=require('lodash');var util=require(_0x7e16('0x0'));var logger=require(_0x7e16('0x1'))(_0x7e16('0x2'));var moment=require('moment');var BPromise=require(_0x7e16('0x3'));var rp=require(_0x7e16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7e16('0x5'));var attributes=require(_0x7e16('0x6'));module[_0x7e16('0x7')]=function(_0x41fe6e,_0x354e9c){return _0x41fe6e[_0x7e16('0x8')](_0x7e16('0x9'),attributes,{'tableName':_0x7e16('0xa'),'paranoid':![],'indexes':[{'fields':[_0x7e16('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46fe=['bluebird','request-promise','path','rimraf','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x577f71,_0x3a8951){var _0xfec7c2=function(_0x440797){while(--_0x440797){_0x577f71['push'](_0x577f71['shift']());}};_0xfec7c2(++_0x3a8951);}(_0x46fe,0x1c3));var _0xe46f=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x46fe[_0x4a93bb];return _0x208468;};'use strict';var _=require(_0xe46f('0x0'));var util=require(_0xe46f('0x1'));var logger=require(_0xe46f('0x2'))('api');var moment=require(_0xe46f('0x3'));var BPromise=require(_0xe46f('0x4'));var rp=require(_0xe46f('0x5'));var fs=require('fs');var path=require(_0xe46f('0x6'));var rimraf=require(_0xe46f('0x7'));var config=require('../../config/environment');var attributes=require(_0xe46f('0x8'));module[_0xe46f('0x9')]=function(_0x54d3e7,_0x1a1b0c){return _0x54d3e7[_0xe46f('0xa')]('VoiceDialReport',attributes,{'tableName':_0xe46f('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe46f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 3c16849..c73b711 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 _0xd43c=['../../config/environment','jayson/promise','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','catch','where','attributes','UpdateVoiceDialReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd43c,0x98));var _0xcd43=function(_0xe9fca1,_0x5ba251){_0xe9fca1=_0xe9fca1-0x0;var _0x55ae32=_0xd43c[_0xe9fca1];return _0x55ae32;};'use strict';var _=require(_0xcd43('0x0'));var util=require(_0xcd43('0x1'));var moment=require(_0xcd43('0x2'));var BPromise=require(_0xcd43('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd43('0x4'));var db=require(_0xcd43('0x5'))['db'];var utils=require(_0xcd43('0x6'));var logger=require('../../config/logger')(_0xcd43('0x7'));var config=require(_0xcd43('0x8'));var jayson=require(_0xcd43('0x9'));var client=jayson['client'][_0xcd43('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1589c6,_0x163bb1,_0x453460){return new BPromise(function(_0xad9eb1,_0x3fe4bb){return client['request'](_0x1589c6,_0x453460)[_0xcd43('0xb')](function(_0x1d1fac){logger[_0xcd43('0xc')](_0xcd43('0xd'),_0x163bb1,_0xcd43('0xe'));logger[_0xcd43('0xf')](_0xcd43('0x10'),_0x163bb1,_0xcd43('0xe'),JSON[_0xcd43('0x11')](_0x1d1fac));if(_0x1d1fac[_0xcd43('0x12')]){if(_0x1d1fac[_0xcd43('0x12')][_0xcd43('0x13')]===0x1f4){logger['error'](_0xcd43('0xd'),_0x163bb1,_0x1d1fac[_0xcd43('0x12')]['message']);return _0x3fe4bb(_0x1d1fac[_0xcd43('0x12')]['message']);}logger[_0xcd43('0x12')](_0xcd43('0xd'),_0x163bb1,_0x1d1fac[_0xcd43('0x12')]['message']);return _0xad9eb1(_0x1d1fac[_0xcd43('0x12')][_0xcd43('0x14')]);}else{logger[_0xcd43('0xc')](_0xcd43('0xd'),_0x163bb1,_0xcd43('0xe'));_0xad9eb1(_0x1d1fac[_0xcd43('0x15')]['message']);}})['catch'](function(_0x52569d){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x163bb1,_0x52569d);_0x3fe4bb(_0x52569d);});});}exports[_0xcd43('0x16')]=function(_0x513aee){var _0x3da19b=this;return new Promise(function(_0x506091,_0x103bdf){return db[_0xcd43('0x17')][_0xcd43('0x18')](_0x513aee[_0xcd43('0x19')],{'raw':_0x513aee[_0xcd43('0x1a')]?_0x513aee[_0xcd43('0x1a')][_0xcd43('0x1b')]===undefined?!![]:![]:!![]})[_0xcd43('0xb')](function(_0x27cc1a){logger[_0xcd43('0xc')](_0xcd43('0x16'),_0x513aee);logger['debug'](_0xcd43('0x16'),_0x513aee,JSON['stringify'](_0x27cc1a));_0x506091(_0x27cc1a);})[_0xcd43('0x1c')](function(_0x17cae8){logger[_0xcd43('0x12')]('CreateVoiceDialReport',_0x17cae8['message'],_0x513aee);_0x103bdf(_0x3da19b['error'](0x1f4,_0x17cae8[_0xcd43('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x4b6c29){var _0x2845d1=this;return new Promise(function(_0x2074f7,_0x534681){return db[_0xcd43('0x17')]['update'](_0x4b6c29[_0xcd43('0x19')],{'raw':_0x4b6c29['options']?_0x4b6c29['options'][_0xcd43('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6c29[_0xcd43('0x1a')]?_0x4b6c29[_0xcd43('0x1a')][_0xcd43('0x1d')]||null:null,'attributes':_0x4b6c29[_0xcd43('0x1a')]?_0x4b6c29[_0xcd43('0x1a')][_0xcd43('0x1e')]||null:null,'limit':_0x4b6c29['options']?_0x4b6c29[_0xcd43('0x1a')]['limit']||null:null})[_0xcd43('0xb')](function(_0x4ad1f5){logger[_0xcd43('0xc')](_0xcd43('0x1f'),_0x4b6c29);logger[_0xcd43('0xf')](_0xcd43('0x1f'),_0x4b6c29,JSON[_0xcd43('0x11')](_0x4ad1f5));_0x2074f7(_0x4ad1f5);})[_0xcd43('0x1c')](function(_0x6f6273){logger[_0xcd43('0x12')](_0xcd43('0x1f'),_0x6f6273[_0xcd43('0x14')],_0x4b6c29);_0x534681(_0x2845d1[_0xcd43('0x12')](0x1f4,_0x6f6273[_0xcd43('0x14')]));});});}; \ No newline at end of file +var _0x754f=['request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x754f,0x1d6));var _0xf754=function(_0x4d8dc7,_0x2a5575){_0x4d8dc7=_0x4d8dc7-0x0;var _0x496f2b=_0x754f[_0x4d8dc7];return _0x496f2b;};'use strict';var _=require(_0xf754('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf754('0x1'));var rs=require(_0xf754('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf754('0x3'))['db'];var utils=require(_0xf754('0x4'));var logger=require(_0xf754('0x5'))(_0xf754('0x6'));var config=require(_0xf754('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf754('0x8')][_0xf754('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fb898,_0x357a55,_0x2acfea){return new BPromise(function(_0x272ffa,_0x4af2d4){return client[_0xf754('0xa')](_0x3fb898,_0x2acfea)[_0xf754('0xb')](function(_0x50020d){logger[_0xf754('0xc')](_0xf754('0xd'),_0x357a55,'request\x20sent');logger[_0xf754('0xe')](_0xf754('0xf'),_0x357a55,_0xf754('0x10'),JSON[_0xf754('0x11')](_0x50020d));if(_0x50020d['error']){if(_0x50020d[_0xf754('0x12')]['code']===0x1f4){logger[_0xf754('0x12')](_0xf754('0xd'),_0x357a55,_0x50020d['error']['message']);return _0x4af2d4(_0x50020d[_0xf754('0x12')][_0xf754('0x13')]);}logger[_0xf754('0x12')](_0xf754('0xd'),_0x357a55,_0x50020d[_0xf754('0x12')]['message']);return _0x272ffa(_0x50020d[_0xf754('0x12')]['message']);}else{logger[_0xf754('0xc')](_0xf754('0xd'),_0x357a55,_0xf754('0x10'));_0x272ffa(_0x50020d[_0xf754('0x14')]['message']);}})['catch'](function(_0x40920a){logger[_0xf754('0x12')](_0xf754('0xd'),_0x357a55,_0x40920a);_0x4af2d4(_0x40920a);});});}exports[_0xf754('0x15')]=function(_0x11588f){var _0x4c6207=this;return new Promise(function(_0x3a038c,_0xe8c086){return db[_0xf754('0x16')][_0xf754('0x17')](_0x11588f[_0xf754('0x18')],{'raw':_0x11588f[_0xf754('0x19')]?_0x11588f[_0xf754('0x19')][_0xf754('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x14f295){logger[_0xf754('0xc')](_0xf754('0x15'),_0x11588f);logger['debug'](_0xf754('0x15'),_0x11588f,JSON[_0xf754('0x11')](_0x14f295));_0x3a038c(_0x14f295);})['catch'](function(_0x3892c8){logger[_0xf754('0x12')]('CreateVoiceDialReport',_0x3892c8[_0xf754('0x13')],_0x11588f);_0xe8c086(_0x4c6207['error'](0x1f4,_0x3892c8[_0xf754('0x13')]));});});};exports[_0xf754('0x1b')]=function(_0x19d114){var _0x3857e4=this;return new Promise(function(_0x1ae511,_0x394fda){return db[_0xf754('0x16')][_0xf754('0x1c')](_0x19d114['body'],{'raw':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')]['where']||null:null,'attributes':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')][_0xf754('0x1d')]||null:null,'limit':_0x19d114[_0xf754('0x19')]?_0x19d114[_0xf754('0x19')]['limit']||null:null})[_0xf754('0xb')](function(_0x2cf65d){logger[_0xf754('0xc')]('UpdateVoiceDialReport',_0x19d114);logger[_0xf754('0xe')](_0xf754('0x1b'),_0x19d114,JSON[_0xf754('0x11')](_0x2cf65d));_0x1ae511(_0x2cf65d);})['catch'](function(_0x207665){logger[_0xf754('0x12')]('UpdateVoiceDialReport',_0x207665[_0xf754('0x13')],_0x19d114);_0x394fda(_0x3857e4[_0xf754('0x12')](0x1f4,_0x207665[_0xf754('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index bb14443..202c86a 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 _0x4423=['index','get','/:id','show','post','/:id/applications','addApplications','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceExtension.controller','isAuthenticated'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x4423,0x1af));var _0x3442=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x4423[_0x57add2];return _0x4e3670;};'use strict';var multer=require(_0x3442('0x0'));var util=require(_0x3442('0x1'));var path=require(_0x3442('0x2'));var timeout=require(_0x3442('0x3'));var express=require(_0x3442('0x4'));var router=express[_0x3442('0x5')]();var fs_extra=require(_0x3442('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3442('0x7'));var config=require('../../config/environment');var controller=require(_0x3442('0x8'));router['get']('/',auth[_0x3442('0x9')](),controller[_0x3442('0xa')]);router[_0x3442('0xb')](_0x3442('0xc'),auth[_0x3442('0x9')](),controller[_0x3442('0xd')]);router[_0x3442('0xe')]('/',auth[_0x3442('0x9')](),controller['create']);router['post'](_0x3442('0xf'),auth[_0x3442('0x9')](),controller[_0x3442('0x10')]);router[_0x3442('0x11')](_0x3442('0xc'),auth[_0x3442('0x9')](),controller[_0x3442('0x12')]);router[_0x3442('0x13')](_0x3442('0xc'),auth[_0x3442('0x9')](),controller[_0x3442('0x14')]);module['exports']=router; \ No newline at end of file +var _0xea40=['/:id','isAuthenticated','show','post','addApplications','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x24ae68,_0x3badb5){var _0x200af9=function(_0x54c85f){while(--_0x54c85f){_0x24ae68['push'](_0x24ae68['shift']());}};_0x200af9(++_0x3badb5);}(_0xea40,0x1ad));var _0x0ea4=function(_0x1a9b87,_0x4b9987){_0x1a9b87=_0x1a9b87-0x0;var _0x3e5a50=_0xea40[_0x1a9b87];return _0x3e5a50;};'use strict';var multer=require(_0x0ea4('0x0'));var util=require(_0x0ea4('0x1'));var path=require(_0x0ea4('0x2'));var timeout=require(_0x0ea4('0x3'));var express=require(_0x0ea4('0x4'));var router=express[_0x0ea4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0ea4('0x6'));var interaction=require(_0x0ea4('0x7'));var config=require(_0x0ea4('0x8'));var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0ea4('0x9')]);router[_0x0ea4('0xa')](_0x0ea4('0xb'),auth[_0x0ea4('0xc')](),controller[_0x0ea4('0xd')]);router[_0x0ea4('0xe')]('/',auth[_0x0ea4('0xc')](),controller['create']);router[_0x0ea4('0xe')]('/:id/applications',auth['isAuthenticated'](),controller[_0x0ea4('0xf')]);router['put'](_0x0ea4('0xb'),auth['isAuthenticated'](),controller[_0x0ea4('0x10')]);router[_0x0ea4('0x11')]('/:id',auth[_0x0ea4('0xc')](),controller[_0x0ea4('0x12')]);module[_0x0ea4('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index c2680dc..07f12a1 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 _0x8b14=['outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','exten','exports','STRING','compositeIndex','NoOp','outbound','internal','inbound-fax'];(function(_0x2bda8c,_0x29a2f6){var _0x2df89c=function(_0x15828a){while(--_0x15828a){_0x2bda8c['push'](_0x2bda8c['shift']());}};_0x2df89c(++_0x29a2f6);}(_0x8b14,0x116));var _0x48b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8b14[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x48b1('0x0')]={'context':{'type':Sequelize[_0x48b1('0x1')],'allowNull':![],'unique':_0x48b1('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x48b1('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x48b1('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x48b1('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x48b1('0x1')],'allowNull':![],'defaultValue':_0x48b1('0x3')},'appdata':{'type':Sequelize[_0x48b1('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0x48b1('0x4'),_0x48b1('0x5'),_0x48b1('0x6'),_0x48b1('0x7'),_0x48b1('0x8'),_0x48b1('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x48b1('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x48b1('0xa')]},'isApp':{'type':Sequelize[_0x48b1('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x48b1('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x48b1('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x48b1('0xa')]},'recordingFormat':{'type':Sequelize[_0x48b1('0x1')],'defaultValue':_0x48b1('0xc')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x48b1('0xd')],'get':function(_0x1b8f4a){return this['getDataValue'](_0x48b1('0xe'));}},'alias':{'type':Sequelize[_0x48b1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xaded=['outbound-fax','any','*,*,*,*','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','compositeIndex','STRING','NoOp','outbound'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xaded,0x125));var _0xdade=function(_0x287b93,_0x435e46){_0x287b93=_0x287b93-0x0;var _0x338b28=_0xaded[_0x287b93];return _0x338b28;};'use strict';var Sequelize=require(_0xdade('0x0'));module[_0xdade('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdade('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdade('0x2')},'priority':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':_0xdade('0x4')},'appdata':{'type':Sequelize[_0xdade('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xdade('0x5'),'internal','inbound-fax',_0xdade('0x6'),'system',_0xdade('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xdade('0x3')]},'interval':{'type':Sequelize[_0xdade('0x3')],'allowNull':![],'defaultValue':_0xdade('0x8')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xdade('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xdade('0x3')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xdade('0x3')],'defaultValue':_0xdade('0xa')},'answer':{'type':Sequelize[_0xdade('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0xdade('0xb')],'get':function(_0x195a99){return this['getDataValue'](_0xdade('0xc'));}},'alias':{'type':Sequelize[_0xdade('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 736a421..df0c01a 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 _0x9973=['include','catch','show','params','keys','find','create','startsWith','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','status','end','json','offset','limit','undefined','count','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','filter','ignore','map','value','includes','type','UserProfileResource','sendStatus','error','stack','name','send','index','VoiceExtension','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll'];(function(_0x25ad30,_0x4d9cb8){var _0x97c45e=function(_0x2f3b62){while(--_0x2f3b62){_0x25ad30['push'](_0x25ad30['shift']());}};_0x97c45e(++_0x4d9cb8);}(_0x9973,0x12d));var _0x3997=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9973[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x3997('0x0'));var Redis=require(_0x3997('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3997('0x2'));var config=require(_0x3997('0x3'));var db=require(_0x3997('0x4'))['db'];config[_0x3997('0x5')]=_[_0x3997('0x6')](config[_0x3997('0x5')],{'host':_0x3997('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3997('0x5')]));require(_0x3997('0x8'))['register'](socket);function respondWithStatusCode(_0x2ab8cf,_0x5d49e0){_0x5d49e0=_0x5d49e0||0xcc;return function(_0x2a3221){if(_0x2a3221){return _0x2ab8cf['sendStatus'](_0x5d49e0);}return _0x2ab8cf[_0x3997('0x9')](_0x5d49e0)[_0x3997('0xa')]();};}function respondWithResult(_0x424cdb,_0x281a19){_0x281a19=_0x281a19||0xc8;return function(_0x482ae9){if(_0x482ae9){return _0x424cdb[_0x3997('0x9')](_0x281a19)[_0x3997('0xb')](_0x482ae9);}};}function respondWithFilteredResult(_0x478a17,_0x50c69e){return function(_0x345e99){if(_0x345e99){var _0x439d0c=typeof _0x50c69e[_0x3997('0xc')]==='undefined'&&typeof _0x50c69e[_0x3997('0xd')]===_0x3997('0xe');var _0x52e616=_0x345e99[_0x3997('0xf')];var _0x5cb664=_0x439d0c?0x0:_0x50c69e[_0x3997('0xc')];var _0x44360d=_0x439d0c?_0x345e99[_0x3997('0xf')]:_0x50c69e[_0x3997('0xc')]+_0x50c69e[_0x3997('0xd')];var _0xf52930;if(_0x44360d>=_0x52e616){_0x44360d=_0x52e616;_0xf52930=0xc8;}else{_0xf52930=0xce;}_0x478a17[_0x3997('0x9')](_0xf52930);return _0x478a17['set'](_0x3997('0x10'),_0x5cb664+'-'+_0x44360d+'/'+_0x52e616)[_0x3997('0xb')](_0x345e99);}return null;};}function removeEntity(_0x4b8122){return function(_0x1e4178){if(_0x1e4178){return _0x1e4178[_0x3997('0x11')]()[_0x3997('0x12')](function(){var _0x439075=_0x1e4178[_0x3997('0x13')]({'plain':!![]});var _0x51a9f9=[{'name':_0x3997('0x14'),'value':_0x3997('0x15'),'ignore':![]},{'name':_0x3997('0x16'),'value':_0x3997('0x17'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x1fd8c9=_(_0x51a9f9)[_0x3997('0x18')](_0x3997('0x19'))[_0x3997('0x1a')](_0x3997('0x1b'))[_0x3997('0x1b')]();if(_[_0x3997('0x1c')](_0x1fd8c9,_0x439075['type'])){return;}var _0x202d86=_['find'](_0x51a9f9,['value',_0x439075[_0x3997('0x1d')]])['name'];return db[_0x3997('0x1e')][_0x3997('0x11')]({'where':{'type':_0x202d86,'resourceId':_0x439075['id']}})['then'](function(){return _0x1e4178;});})['then'](function(){_0x4b8122[_0x3997('0x9')](0xcc)[_0x3997('0xa')]();});}};}function handleEntityNotFound(_0x12dcf0){return function(_0x12ede2){if(!_0x12ede2){_0x12dcf0[_0x3997('0x1f')](0x194);}return _0x12ede2;};}function handleError(_0x45061b,_0x5512ad){_0x5512ad=_0x5512ad||0x1f4;return function(_0x423639){logger[_0x3997('0x20')](_0x423639[_0x3997('0x21')]);if(_0x423639[_0x3997('0x22')]){delete _0x423639[_0x3997('0x22')];}_0x45061b[_0x3997('0x9')](_0x5512ad)[_0x3997('0x23')](_0x423639);};}exports[_0x3997('0x24')]=function(_0x1b534a,_0x4899d6){var _0x28696d={},_0x560977={},_0x1da361={'count':0x0,'rows':[]};var _0x85d7c0=_[_0x3997('0x1a')](db[_0x3997('0x25')][_0x3997('0x26')],function(_0x513f70){return{'name':_0x513f70['fieldName'],'type':_0x513f70[_0x3997('0x1d')][_0x3997('0x27')]};});_0x560977[_0x3997('0x28')]=_[_0x3997('0x1a')](_0x85d7c0,_0x3997('0x22'));_0x560977[_0x3997('0x29')]=_['keys'](_0x1b534a[_0x3997('0x29')]);_0x560977[_0x3997('0x2a')]=_['intersection'](_0x560977[_0x3997('0x28')],_0x560977[_0x3997('0x29')]);_0x28696d[_0x3997('0x2b')]=_[_0x3997('0x2c')](_0x560977['model'],qs['fields'](_0x1b534a['query'][_0x3997('0x2d')]));_0x28696d['attributes']=_0x28696d[_0x3997('0x2b')][_0x3997('0x2e')]?_0x28696d['attributes']:_0x560977['model'];if(!_0x1b534a[_0x3997('0x29')][_0x3997('0x2f')]('nolimit')){_0x28696d[_0x3997('0xd')]=qs[_0x3997('0xd')](_0x1b534a[_0x3997('0x29')][_0x3997('0xd')]);_0x28696d[_0x3997('0xc')]=qs['offset'](_0x1b534a[_0x3997('0x29')][_0x3997('0xc')]);}_0x28696d[_0x3997('0x30')]=qs[_0x3997('0x31')](_0x1b534a[_0x3997('0x29')]['sort']);_0x28696d[_0x3997('0x32')]=qs['filters'](_['pick'](_0x1b534a[_0x3997('0x29')],_0x560977[_0x3997('0x2a')]),_0x85d7c0);if(_0x1b534a[_0x3997('0x29')][_0x3997('0x18')]){_0x28696d[_0x3997('0x32')]=_[_0x3997('0x33')](_0x28696d[_0x3997('0x32')],{'$or':_['map'](_0x85d7c0,function(_0x4cb47a){if(_0x4cb47a[_0x3997('0x1d')]!==_0x3997('0x34')){var _0x560c0e={};_0x560c0e[_0x4cb47a['name']]={'$like':'%'+_0x1b534a[_0x3997('0x29')][_0x3997('0x18')]+'%'};return _0x560c0e;}})});}_0x28696d=_[_0x3997('0x33')]({},_0x28696d,_0x1b534a[_0x3997('0x35')]);var _0x3e73b5={'where':_0x28696d[_0x3997('0x32')]};return db['VoiceExtension']['count'](_0x3e73b5)[_0x3997('0x12')](function(_0x419597){_0x1da361[_0x3997('0xf')]=_0x419597;if(_0x1b534a[_0x3997('0x29')][_0x3997('0x36')]){_0x28696d[_0x3997('0x37')]=[{'all':!![]}];}return db[_0x3997('0x25')]['findAll'](_0x28696d);})['then'](function(_0x2f519f){_0x1da361['rows']=_0x2f519f;return _0x1da361;})[_0x3997('0x12')](respondWithFilteredResult(_0x4899d6,_0x28696d))[_0x3997('0x38')](handleError(_0x4899d6,null));};exports[_0x3997('0x39')]=function(_0x230d91,_0x2cecdb){var _0x558237={'raw':![],'where':{'id':_0x230d91[_0x3997('0x3a')]['id']}},_0x5f38c8={};_0x5f38c8[_0x3997('0x28')]=_[_0x3997('0x3b')](db[_0x3997('0x25')]['rawAttributes']);_0x5f38c8['query']=_[_0x3997('0x3b')](_0x230d91[_0x3997('0x29')]);_0x5f38c8[_0x3997('0x2a')]=_[_0x3997('0x2c')](_0x5f38c8[_0x3997('0x28')],_0x5f38c8[_0x3997('0x29')]);_0x558237[_0x3997('0x2b')]=_['intersection'](_0x5f38c8[_0x3997('0x28')],qs[_0x3997('0x2d')](_0x230d91[_0x3997('0x29')][_0x3997('0x2d')]));_0x558237[_0x3997('0x2b')]=_0x558237[_0x3997('0x2b')]['length']?_0x558237['attributes']:_0x5f38c8[_0x3997('0x28')];if(_0x230d91[_0x3997('0x29')][_0x3997('0x36')]){_0x558237[_0x3997('0x37')]=[{'all':!![]}];}_0x558237=_[_0x3997('0x33')]({},_0x558237,_0x230d91[_0x3997('0x35')]);return db['VoiceExtension'][_0x3997('0x3c')](_0x558237)['then'](handleEntityNotFound(_0x2cecdb,null))[_0x3997('0x12')](respondWithResult(_0x2cecdb,null))[_0x3997('0x38')](handleError(_0x2cecdb,null));};exports[_0x3997('0x11')]=function(_0x5965a2,_0x5c5fcd){return db[_0x3997('0x25')][_0x3997('0x3c')]({'where':{'id':_0x5965a2['params']['id']}})[_0x3997('0x12')](handleEntityNotFound(_0x5c5fcd,null))['then'](removeEntity(_0x5c5fcd,null))['catch'](handleError(_0x5c5fcd,null));};exports[_0x3997('0x3d')]=function(_0x58b1e9,_0x14a129){if(_0x58b1e9['body'][_0x3997('0x1d')]===_0x3997('0x17')&&!_[_0x3997('0x3e')](_0x58b1e9[_0x3997('0x3f')][_0x3997('0x40')],'_')){_0x58b1e9[_0x3997('0x3f')][_0x3997('0x40')]='_'[_0x3997('0x41')](_0x58b1e9[_0x3997('0x3f')][_0x3997('0x40')]);}return db[_0x3997('0x25')]['create'](_0x58b1e9[_0x3997('0x3f')],{'raw':![]})[_0x3997('0x12')](function(_0xe1e998){var _0x4ca52c=_0x58b1e9[_0x3997('0x42')]['get']({'plain':!![]});if(!_0x4ca52c)throw new Error(_0x3997('0x43'));if(_0x4ca52c[_0x3997('0x44')]==='user'){var _0x35d6d7=_0xe1e998[_0x3997('0x13')]({'plain':!![]});var _0x2674ff=[{'name':_0x3997('0x14'),'value':'inbound'},{'name':'OutboundRoutes','value':_0x3997('0x17')},{'name':'InternalRoutes','value':'internal'}];var _0x52a95c=_[_0x3997('0x3c')](_0x2674ff,[_0x3997('0x1b'),_0x35d6d7[_0x3997('0x1d')]])['name'];return db[_0x3997('0x45')][_0x3997('0x3c')]({'where':{'name':_0x52a95c,'userProfileId':_0x4ca52c['userProfileId']},'raw':!![]})[_0x3997('0x12')](function(_0x4a5493){if(_0x4a5493&&_0x4a5493[_0x3997('0x46')]===0x0){return db[_0x3997('0x1e')][_0x3997('0x3d')]({'name':_0x35d6d7[_0x3997('0x22')],'resourceId':_0x35d6d7['id'],'type':_0x4a5493[_0x3997('0x22')],'sectionId':_0x4a5493['id']},{})[_0x3997('0x12')](function(){return _0xe1e998;});}else{return _0xe1e998;}})[_0x3997('0x38')](function(_0x2bfde3){logger[_0x3997('0x20')](_0x3997('0x47'),_0x2bfde3);throw _0x2bfde3;});}return _0xe1e998;})['then'](respondWithResult(_0x14a129,0xc9))[_0x3997('0x38')](handleError(_0x14a129,null));};exports[_0x3997('0x48')]=function(_0x1f7e72,_0x4814a1){if(_0x1f7e72['body']['id']){delete _0x1f7e72[_0x3997('0x3f')]['id'];}return db[_0x3997('0x25')][_0x3997('0x3c')]({'where':{'id':_0x1f7e72[_0x3997('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4814a1,null))[_0x3997('0x12')](function(_0x37f6be){if(_0x37f6be){return db[_0x3997('0x25')]['update'](_[_0x3997('0x49')](_0x1f7e72['body'],[_0x3997('0x40'),'context',_0x3997('0x4a'),_0x3997('0x4b'),_0x3997('0x4c'),_0x3997('0x4d'),_0x3997('0x4e')]),{'where':{'context':_0x37f6be[_0x3997('0x4f')],'exten':_0x37f6be['exten']},'individualHooks':!![]})[_0x3997('0x12')](function(_0x4a0479){return _0x4a0479;});}return null;})[_0x3997('0x12')](respondWithStatusCode(_0x4814a1,null))['catch'](handleError(_0x4814a1,null));};exports[_0x3997('0x50')]=function(_0x16379d,_0x2f0f8b){var _0x4505b8=_0x16379d['params']['id'];var _0x14d181=_0x16379d[_0x3997('0x3f')];var _0x33a350=0xc8;var _0x234382=null;return db[_0x3997('0x51')][_0x3997('0x52')]({'isolationLevel':db[_0x3997('0x51')][_0x3997('0x53')][_0x3997('0x54')]['READ_COMMITTED']},function(_0x1d418c){return db[_0x3997('0x25')]['findOne']({'where':{'id':_0x4505b8},'transaction':_0x1d418c})['then'](function(_0x3cd643){if(_0x3cd643){return db[_0x3997('0x25')][_0x3997('0x11')]({'where':{'VoiceExtensionId':_0x4505b8},'transaction':_0x1d418c})[_0x3997('0x12')](function(){var _0x2c63e3=_['map'](_0x14d181,function(_0x27cb4c){_0x27cb4c['VoiceExtensionId']=_0x4505b8;_0x27cb4c[_0x3997('0x55')]=!![];return _0x27cb4c;});return _0x3cd643[_0x3997('0x56')](_0x2c63e3);})[_0x3997('0x12')](function(_0x5478f1){return db[_0x3997('0x25')]['bulkCreate'](_0x5478f1,{'transaction':_0x1d418c});});}else{_0x33a350=0x194;_0x234382=[];}});})[_0x3997('0x12')](function(){if(_0x33a350!==0x194){return db['VoiceExtension'][_0x3997('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4505b8},'order':_0x3997('0x58')})[_0x3997('0x12')](function(_0x8f4c60){_0x234382=_0x8f4c60;});}})[_0x3997('0x38')](function(_0x54b912){_0x33a350=0x1f4;logger[_0x3997('0x20')](_0x54b912[_0x3997('0x21')]);if(_0x54b912[_0x3997('0x22')]){delete _0x54b912[_0x3997('0x22')];}_0x234382=_0x54b912;})['finally'](function(){if(_0x234382===null){_0x2f0f8b[_0x3997('0x1f')](_0x33a350);}else{if(_0x33a350===0x1f4){_0x2f0f8b[_0x3997('0x9')](_0x33a350)[_0x3997('0x23')](_0x234382);}else{_0x2f0f8b[_0x3997('0x9')](_0x33a350)['json'](_0x234382);}}});}; \ No newline at end of file +var _0x41db=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','isApp','createRouting','bulkCreate','findAndCountAll','stack','finally','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceExtension','key','keys','query','model','intersection','fields','attributes','nolimit','order','filters','where','merge'];(function(_0x3eafe1,_0x598a6b){var _0x4f065d=function(_0x28bd2f){while(--_0x28bd2f){_0x3eafe1['push'](_0x3eafe1['shift']());}};_0x4f065d(++_0x598a6b);}(_0x41db,0x13f));var _0xb41d=function(_0x12722d,_0x38cb77){_0x12722d=_0x12722d-0x0;var _0x450224=_0x41db[_0x12722d];return _0x450224;};'use strict';var _=require('lodash');var Redis=require(_0xb41d('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xb41d('0x1'))(_0xb41d('0x2'));var config=require(_0xb41d('0x3'));var db=require(_0xb41d('0x4'))['db'];config[_0xb41d('0x5')]=_['defaults'](config[_0xb41d('0x5')],{'host':_0xb41d('0x6'),'port':0x18eb});var socket=require(_0xb41d('0x7'))(new Redis(config[_0xb41d('0x5')]));require(_0xb41d('0x8'))[_0xb41d('0x9')](socket);function respondWithStatusCode(_0x485553,_0x253d4f){_0x253d4f=_0x253d4f||0xcc;return function(_0x4a518b){if(_0x4a518b){return _0x485553[_0xb41d('0xa')](_0x253d4f);}return _0x485553[_0xb41d('0xb')](_0x253d4f)[_0xb41d('0xc')]();};}function respondWithResult(_0xc3a000,_0x54da3b){_0x54da3b=_0x54da3b||0xc8;return function(_0x17655b){if(_0x17655b){return _0xc3a000['status'](_0x54da3b)[_0xb41d('0xd')](_0x17655b);}};}function respondWithFilteredResult(_0x3e9d7b,_0x7b6366){return function(_0x5458ef){if(_0x5458ef){var _0xe754ee=typeof _0x7b6366[_0xb41d('0xe')]===_0xb41d('0xf')&&typeof _0x7b6366[_0xb41d('0x10')]===_0xb41d('0xf');var _0x31f52f=_0x5458ef[_0xb41d('0x11')];var _0x56584f=_0xe754ee?0x0:_0x7b6366[_0xb41d('0xe')];var _0x282cbc=_0xe754ee?_0x5458ef[_0xb41d('0x11')]:_0x7b6366['offset']+_0x7b6366[_0xb41d('0x10')];var _0x140400;if(_0x282cbc>=_0x31f52f){_0x282cbc=_0x31f52f;_0x140400=0xc8;}else{_0x140400=0xce;}_0x3e9d7b[_0xb41d('0xb')](_0x140400);return _0x3e9d7b[_0xb41d('0x12')](_0xb41d('0x13'),_0x56584f+'-'+_0x282cbc+'/'+_0x31f52f)['json'](_0x5458ef);}return null;};}function removeEntity(_0x23fffe){return function(_0x50881a){if(_0x50881a){return _0x50881a[_0xb41d('0x14')]()[_0xb41d('0x15')](function(){var _0x29a031=_0x50881a[_0xb41d('0x16')]({'plain':!![]});var _0x278b23=[{'name':_0xb41d('0x17'),'value':_0xb41d('0x18'),'ignore':![]},{'name':_0xb41d('0x19'),'value':_0xb41d('0x1a'),'ignore':![]},{'name':_0xb41d('0x1b'),'value':_0xb41d('0x1c'),'ignore':![]}];var _0x34e5c9=_(_0x278b23)[_0xb41d('0x1d')](_0xb41d('0x1e'))[_0xb41d('0x1f')](_0xb41d('0x20'))[_0xb41d('0x20')]();if(_[_0xb41d('0x21')](_0x34e5c9,_0x29a031[_0xb41d('0x22')])){return;}var _0x1d6f0d=_['find'](_0x278b23,[_0xb41d('0x20'),_0x29a031['type']])[_0xb41d('0x23')];return db[_0xb41d('0x24')]['destroy']({'where':{'type':_0x1d6f0d,'resourceId':_0x29a031['id']}})[_0xb41d('0x15')](function(){return _0x50881a;});})[_0xb41d('0x15')](function(){_0x23fffe['status'](0xcc)[_0xb41d('0xc')]();});}};}function handleEntityNotFound(_0x5a8b34){return function(_0x38ebdd){if(!_0x38ebdd){_0x5a8b34['sendStatus'](0x194);}return _0x38ebdd;};}function handleError(_0x5808df,_0x2e85ed){_0x2e85ed=_0x2e85ed||0x1f4;return function(_0x12b0ec){logger[_0xb41d('0x25')](_0x12b0ec['stack']);if(_0x12b0ec['name']){delete _0x12b0ec[_0xb41d('0x23')];}_0x5808df[_0xb41d('0xb')](_0x2e85ed)[_0xb41d('0x26')](_0x12b0ec);};}exports[_0xb41d('0x27')]=function(_0x51dd49,_0x1e816c){var _0x15e62b={},_0x574f08={},_0x56ed03={'count':0x0,'rows':[]};var _0x39081a=_['map'](db[_0xb41d('0x28')]['rawAttributes'],function(_0x5e36cf){return{'name':_0x5e36cf['fieldName'],'type':_0x5e36cf[_0xb41d('0x22')][_0xb41d('0x29')]};});_0x574f08['model']=_['map'](_0x39081a,_0xb41d('0x23'));_0x574f08['query']=_[_0xb41d('0x2a')](_0x51dd49[_0xb41d('0x2b')]);_0x574f08['filters']=_['intersection'](_0x574f08[_0xb41d('0x2c')],_0x574f08[_0xb41d('0x2b')]);_0x15e62b['attributes']=_[_0xb41d('0x2d')](_0x574f08[_0xb41d('0x2c')],qs[_0xb41d('0x2e')](_0x51dd49[_0xb41d('0x2b')][_0xb41d('0x2e')]));_0x15e62b[_0xb41d('0x2f')]=_0x15e62b['attributes']['length']?_0x15e62b['attributes']:_0x574f08['model'];if(!_0x51dd49[_0xb41d('0x2b')]['hasOwnProperty'](_0xb41d('0x30'))){_0x15e62b['limit']=qs['limit'](_0x51dd49[_0xb41d('0x2b')][_0xb41d('0x10')]);_0x15e62b['offset']=qs[_0xb41d('0xe')](_0x51dd49['query'][_0xb41d('0xe')]);}_0x15e62b[_0xb41d('0x31')]=qs['sort'](_0x51dd49[_0xb41d('0x2b')]['sort']);_0x15e62b['where']=qs[_0xb41d('0x32')](_['pick'](_0x51dd49[_0xb41d('0x2b')],_0x574f08[_0xb41d('0x32')]),_0x39081a);if(_0x51dd49['query'][_0xb41d('0x1d')]){_0x15e62b[_0xb41d('0x33')]=_[_0xb41d('0x34')](_0x15e62b[_0xb41d('0x33')],{'$or':_[_0xb41d('0x1f')](_0x39081a,function(_0x5ed1af){if(_0x5ed1af[_0xb41d('0x22')]!==_0xb41d('0x35')){var _0x10dde4={};_0x10dde4[_0x5ed1af[_0xb41d('0x23')]]={'$like':'%'+_0x51dd49['query'][_0xb41d('0x1d')]+'%'};return _0x10dde4;}})});}_0x15e62b=_[_0xb41d('0x34')]({},_0x15e62b,_0x51dd49[_0xb41d('0x36')]);var _0x5ac0dd={'where':_0x15e62b[_0xb41d('0x33')]};return db[_0xb41d('0x28')][_0xb41d('0x11')](_0x5ac0dd)[_0xb41d('0x15')](function(_0x20ae4a){_0x56ed03['count']=_0x20ae4a;if(_0x51dd49[_0xb41d('0x2b')][_0xb41d('0x37')]){_0x15e62b[_0xb41d('0x38')]=[{'all':!![]}];}return db[_0xb41d('0x28')][_0xb41d('0x39')](_0x15e62b);})['then'](function(_0x4fada2){_0x56ed03[_0xb41d('0x3a')]=_0x4fada2;return _0x56ed03;})[_0xb41d('0x15')](respondWithFilteredResult(_0x1e816c,_0x15e62b))['catch'](handleError(_0x1e816c,null));};exports[_0xb41d('0x3b')]=function(_0x227c7b,_0x3aecec){var _0x133c68={'raw':![],'where':{'id':_0x227c7b[_0xb41d('0x3c')]['id']}},_0x3033ba={};_0x3033ba[_0xb41d('0x2c')]=_[_0xb41d('0x2a')](db[_0xb41d('0x28')][_0xb41d('0x3d')]);_0x3033ba[_0xb41d('0x2b')]=_[_0xb41d('0x2a')](_0x227c7b[_0xb41d('0x2b')]);_0x3033ba[_0xb41d('0x32')]=_['intersection'](_0x3033ba[_0xb41d('0x2c')],_0x3033ba[_0xb41d('0x2b')]);_0x133c68[_0xb41d('0x2f')]=_[_0xb41d('0x2d')](_0x3033ba[_0xb41d('0x2c')],qs[_0xb41d('0x2e')](_0x227c7b[_0xb41d('0x2b')][_0xb41d('0x2e')]));_0x133c68[_0xb41d('0x2f')]=_0x133c68[_0xb41d('0x2f')]['length']?_0x133c68[_0xb41d('0x2f')]:_0x3033ba['model'];if(_0x227c7b[_0xb41d('0x2b')][_0xb41d('0x37')]){_0x133c68[_0xb41d('0x38')]=[{'all':!![]}];}_0x133c68=_['merge']({},_0x133c68,_0x227c7b[_0xb41d('0x36')]);return db['VoiceExtension'][_0xb41d('0x3e')](_0x133c68)[_0xb41d('0x15')](handleEntityNotFound(_0x3aecec,null))[_0xb41d('0x15')](respondWithResult(_0x3aecec,null))['catch'](handleError(_0x3aecec,null));};exports[_0xb41d('0x14')]=function(_0x59b8e2,_0x4c4e0b){return db[_0xb41d('0x28')]['find']({'where':{'id':_0x59b8e2['params']['id']}})[_0xb41d('0x15')](handleEntityNotFound(_0x4c4e0b,null))['then'](removeEntity(_0x4c4e0b,null))[_0xb41d('0x3f')](handleError(_0x4c4e0b,null));};exports[_0xb41d('0x40')]=function(_0x2d3ed6,_0x12d441){if(_0x2d3ed6['body'][_0xb41d('0x22')]==='outbound'&&!_[_0xb41d('0x41')](_0x2d3ed6[_0xb41d('0x42')][_0xb41d('0x43')],'_')){_0x2d3ed6['body'][_0xb41d('0x43')]='_'['concat'](_0x2d3ed6[_0xb41d('0x42')][_0xb41d('0x43')]);}return db[_0xb41d('0x28')]['create'](_0x2d3ed6[_0xb41d('0x42')],{'raw':![]})['then'](function(_0xcadd44){var _0x46eb8b=_0x2d3ed6[_0xb41d('0x44')][_0xb41d('0x16')]({'plain':!![]});if(!_0x46eb8b)throw new Error(_0xb41d('0x45'));if(_0x46eb8b[_0xb41d('0x46')]==='user'){var _0x4b0d9a=_0xcadd44['get']({'plain':!![]});var _0x3db9a5=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xb41d('0x19'),'value':_0xb41d('0x1a')},{'name':_0xb41d('0x1b'),'value':'internal'}];var _0x54cbcc=_[_0xb41d('0x3e')](_0x3db9a5,[_0xb41d('0x20'),_0x4b0d9a['type']])[_0xb41d('0x23')];return db[_0xb41d('0x47')]['find']({'where':{'name':_0x54cbcc,'userProfileId':_0x46eb8b[_0xb41d('0x48')]},'raw':!![]})['then'](function(_0x1634a1){if(_0x1634a1&&_0x1634a1[_0xb41d('0x49')]===0x0){return db[_0xb41d('0x24')][_0xb41d('0x40')]({'name':_0x4b0d9a[_0xb41d('0x23')],'resourceId':_0x4b0d9a['id'],'type':_0x1634a1[_0xb41d('0x23')],'sectionId':_0x1634a1['id']},{})[_0xb41d('0x15')](function(){return _0xcadd44;});}else{return _0xcadd44;}})[_0xb41d('0x3f')](function(_0x119035){logger['error'](_0xb41d('0x4a'),_0x119035);throw _0x119035;});}return _0xcadd44;})[_0xb41d('0x15')](respondWithResult(_0x12d441,0xc9))[_0xb41d('0x3f')](handleError(_0x12d441,null));};exports[_0xb41d('0x4b')]=function(_0x506fb6,_0x246ef5){if(_0x506fb6[_0xb41d('0x42')]['id']){delete _0x506fb6[_0xb41d('0x42')]['id'];}return db['VoiceExtension'][_0xb41d('0x3e')]({'where':{'id':_0x506fb6[_0xb41d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x246ef5,null))[_0xb41d('0x15')](function(_0x4f4a8d){if(_0x4f4a8d){return db[_0xb41d('0x28')][_0xb41d('0x4b')](_[_0xb41d('0x4c')](_0x506fb6[_0xb41d('0x42')],['exten',_0xb41d('0x4d'),_0xb41d('0x4e'),_0xb41d('0x4f'),_0xb41d('0x50'),_0xb41d('0x51'),'alias']),{'where':{'context':_0x4f4a8d[_0xb41d('0x4d')],'exten':_0x4f4a8d[_0xb41d('0x43')]},'individualHooks':!![]})[_0xb41d('0x15')](function(_0x280ffe){return _0x280ffe;});}return null;})['then'](respondWithStatusCode(_0x246ef5,null))['catch'](handleError(_0x246ef5,null));};exports[_0xb41d('0x52')]=function(_0x59c66e,_0x2807d5){var _0x4bf45c=_0x59c66e[_0xb41d('0x3c')]['id'];var _0xfe4b02=_0x59c66e[_0xb41d('0x42')];var _0x4ebc8c=0xc8;var _0x24a8e9=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xb41d('0x53')][_0xb41d('0x54')][_0xb41d('0x55')][_0xb41d('0x56')]},function(_0x24dd3e){return db[_0xb41d('0x28')]['findOne']({'where':{'id':_0x4bf45c},'transaction':_0x24dd3e})[_0xb41d('0x15')](function(_0x6fed3a){if(_0x6fed3a){return db['VoiceExtension'][_0xb41d('0x14')]({'where':{'VoiceExtensionId':_0x4bf45c},'transaction':_0x24dd3e})['then'](function(){var _0x13807e=_[_0xb41d('0x1f')](_0xfe4b02,function(_0x1dfd13){_0x1dfd13['VoiceExtensionId']=_0x4bf45c;_0x1dfd13[_0xb41d('0x57')]=!![];return _0x1dfd13;});return _0x6fed3a[_0xb41d('0x58')](_0x13807e);})[_0xb41d('0x15')](function(_0x3bbc4e){return db['VoiceExtension'][_0xb41d('0x59')](_0x3bbc4e,{'transaction':_0x24dd3e});});}else{_0x4ebc8c=0x194;_0x24a8e9=[];}});})[_0xb41d('0x15')](function(){if(_0x4ebc8c!==0x194){return db[_0xb41d('0x28')][_0xb41d('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4bf45c},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x46bd47){_0x24a8e9=_0x46bd47;});}})[_0xb41d('0x3f')](function(_0x46cd44){_0x4ebc8c=0x1f4;logger[_0xb41d('0x25')](_0x46cd44[_0xb41d('0x5b')]);if(_0x46cd44[_0xb41d('0x23')]){delete _0x46cd44[_0xb41d('0x23')];}_0x24a8e9=_0x46cd44;})[_0xb41d('0x5c')](function(){if(_0x24a8e9===null){_0x2807d5[_0xb41d('0xa')](_0x4ebc8c);}else{if(_0x4ebc8c===0x1f4){_0x2807d5[_0xb41d('0xb')](_0x4ebc8c)[_0xb41d('0x26')](_0x24a8e9);}else{_0x2807d5['status'](_0x4ebc8c)[_0xb41d('0xd')](_0x24a8e9);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 6e94b1b..9bf69f6 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 _0xc422=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x164a40,_0xb704f7){var _0x2a551a=function(_0x8c0588){while(--_0x8c0588){_0x164a40['push'](_0x164a40['shift']());}};_0x2a551a(++_0xb704f7);}(_0xc422,0x185));var _0x2c42=function(_0x72234a,_0x518936){_0x72234a=_0x72234a-0x0;var _0x434020=_0xc422[_0x72234a];return _0x434020;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x2c42('0x0'))['db'][_0x2c42('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2c42('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c42('0x3'),'afterDestroy':_0x2c42('0x4')};function emitEvent(_0x4372c5){return function(_0x59c642,_0x1cbfa0,_0x9cf0ad){VoiceExtensionEvents[_0x2c42('0x5')](_0x4372c5+':'+_0x59c642['id'],_0x59c642);VoiceExtensionEvents[_0x2c42('0x5')](_0x4372c5,_0x59c642);_0x9cf0ad(null);};}for(var e in events){if(events[_0x2c42('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x2c42('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x2b2d=['update','remove','emit','hasOwnProperty','hook','setMaxListeners','save'];(function(_0xdc5664,_0x4eef5a){var _0xd65a92=function(_0x73d50){while(--_0x73d50){_0xdc5664['push'](_0xdc5664['shift']());}};_0xd65a92(++_0x4eef5a);}(_0x2b2d,0x19b));var _0xd2b2=function(_0x376866,_0x58b7f7){_0x376866=_0x376866-0x0;var _0x201d5b=_0x2b2d[_0x376866];return _0x201d5b;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd2b2('0x0')](0x0);var events={'afterCreate':_0xd2b2('0x1'),'afterUpdate':_0xd2b2('0x2'),'afterDestroy':_0xd2b2('0x3')};function emitEvent(_0x549b53){return function(_0x46f698,_0x479adb,_0x346b21){VoiceExtensionEvents['emit'](_0x549b53+':'+_0x46f698['id'],_0x46f698);VoiceExtensionEvents[_0xd2b2('0x4')](_0x549b53,_0x46f698);_0x346b21(null);};}for(var e in events){if(events[_0xd2b2('0x5')](e)){var event=events[e];VoiceExtension[_0xd2b2('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2329f73..1d68e61 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 _0xdead=['toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','type','Set','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','split','name','param','prefix','phone','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter'];(function(_0x9eb88a,_0x272296){var _0x1f0277=function(_0x42aece){while(--_0x42aece){_0x9eb88a['push'](_0x9eb88a['shift']());}};_0x1f0277(++_0x272296);}(_0xdead,0x172));var _0xddea=function(_0x5d3394,_0x5e5dce){_0x5d3394=_0x5d3394-0x0;var _0x102ca5=_0xdead[_0x5d3394];return _0x102ca5;};'use strict';var _=require(_0xddea('0x0'));var attributes=require(_0xddea('0x1'));module[_0xddea('0x2')]=function(_0x514836){var _0x2a631d=_0x514836['models'];function _0x53421d(_0x4e51ea){var _0x40db33=0x2;var _0x5ef74c=[{'type':_0x4e51ea[_0xddea('0x3')],'app':_0xddea('0x4'),'appdata':'CDR(type)='+_0x4e51ea[_0xddea('0x3')],'context':_0x4e51ea[_0xddea('0x5')],'exten':_0x4e51ea[_0xddea('0x6')],'priority':_0x40db33++,'VoiceExtensionId':_0x4e51ea['id']},{'type':_0x4e51ea[_0xddea('0x3')],'app':_0x4e51ea[_0xddea('0x7')]?'Set':_0xddea('0x8'),'appdata':_0x4e51ea['alias']?_0xddea('0x9')+_0x4e51ea[_0xddea('0x7')]:'No\x20alias\x20set','context':_0x4e51ea[_0xddea('0x5')],'exten':_0x4e51ea[_0xddea('0x6')],'priority':_0x40db33++,'VoiceExtensionId':_0x4e51ea['id']}];if(_0x4e51ea[_0xddea('0x3')]===_0xddea('0xa')){_0x5ef74c[_0xddea('0xb')]({'type':_0xddea('0xa'),'app':'Set','appdata':_0xddea('0xc')+_0x4e51ea['id'],'context':_0x4e51ea[_0xddea('0x5')],'exten':_0x4e51ea[_0xddea('0x6')],'priority':_0x40db33++,'VoiceExtensionId':_0x4e51ea['id']});}_0x5ef74c[_0xddea('0xb')]({'type':_0x4e51ea[_0xddea('0x3')],'app':_0xddea('0x4'),'appdata':_0xddea('0xd'),'context':_0x4e51ea[_0xddea('0x5')],'exten':_0x4e51ea[_0xddea('0x6')],'priority':_0x40db33++,'VoiceExtensionId':_0x4e51ea['id']},{'type':_0x4e51ea[_0xddea('0x3')],'app':'Set','appdata':_0xddea('0xe'),'context':_0x4e51ea['context'],'exten':_0x4e51ea[_0xddea('0x6')],'priority':_0x40db33++,'VoiceExtensionId':_0x4e51ea['id']},{'type':_0x4e51ea[_0xddea('0x3')],'app':_0xddea('0x4'),'appdata':_0xddea('0xf'),'context':_0x4e51ea[_0xddea('0x5')],'exten':_0x4e51ea[_0xddea('0x6')],'priority':_0x40db33++,'VoiceExtensionId':_0x4e51ea['id']});return _0x5ef74c;}function _0x4c6812(_0x210255){var _0x5eca3e=0x2;var _0x4a3ee3=[{'type':_0xddea('0x10'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':'outbound','app':_0x210255[_0xddea('0x7')]?'Set':_0xddea('0x8'),'appdata':_0x210255[_0xddea('0x7')]?_0xddea('0x9')+_0x210255['alias']:_0xddea('0x11'),'context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':'outbound','app':_0xddea('0x4'),'appdata':_0xddea('0x12')+(_0x210255[_0xddea('0x13')]?_0xddea('0x14')+_0x210255[_0xddea('0x13')]+'}':_0xddea('0x15')),'context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':'outbound','app':_0xddea('0x4'),'appdata':_0xddea('0xc')+_0x210255['id'],'context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':'outbound','app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x5eca3e+0x2)+_0xddea('0x16')+(_0x5eca3e+0x1)+')','context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':_0xddea('0x10'),'app':_0xddea('0x4'),'appdata':_0x210255[_0xddea('0x13')]?_0xddea('0x17')+_0x210255[_0xddea('0x13')]+'}':_0xddea('0x18'),'context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':_0xddea('0x10'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x210255[_0xddea('0x5')],'exten':_0x210255['exten'],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':_0xddea('0x10'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':_0xddea('0x10'),'app':'Set','appdata':_0xddea('0xf'),'context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':_0xddea('0x10'),'app':_0xddea('0x4'),'appdata':_0xddea('0x19')+_0x210255['id'],'context':_0x210255[_0xddea('0x5')],'exten':_0x210255['exten'],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']}];if(_0x210255[_0xddea('0x1a')](_0xddea('0x1b'))&&_0x210255['recordingFormat']!==_0xddea('0x1c')){_0x4a3ee3[_0xddea('0xb')]({'type':_0xddea('0x10'),'app':_0xddea('0x4'),'appdata':_0xddea('0x1d'),'context':_0x210255[_0xddea('0x5')],'exten':_0x210255[_0xddea('0x6')],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']},{'type':_0xddea('0x10'),'app':_0xddea('0x4'),'appdata':_0xddea('0x1e')+_0x210255['recordingFormat']||_0xddea('0x1f'),'context':_0x210255['context'],'exten':_0x210255['exten'],'priority':_0x5eca3e++,'VoiceExtensionId':_0x210255['id']});}return _0x4a3ee3;}function _0x4f2b50(_0x19242c,_0x2b72fd){var _0x46d2dd=[{'name':_0xddea('0x20'),'param':0x0},{'name':_0xddea('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0xc72e32={};var _0x69b429=_0x2b72fd[_0xddea('0x22')](',');var _0x1383ea=[];for(var _0x39c8e4=0x0;_0x39c8e4<_0x46d2dd['length'];_0x39c8e4++){switch(_0x46d2dd[_0x39c8e4][_0xddea('0x23')]){case'trunk':_0xc72e32[_0xddea('0x20')]=_0x69b429[_0x46d2dd[_0x39c8e4]['param']][_0xddea('0x22')]('/')[0x1];_0xc72e32['phone']=_0x69b429[_0x46d2dd[_0x39c8e4][_0xddea('0x24')]]['split']('/')[0x2];_0xc72e32[_0xddea('0x25')]=_0xc72e32[_0xddea('0x26')]?_0xc72e32[_0xddea('0x26')]['split']('$')[0x0]:undefined;_0xc72e32[_0xddea('0x26')]=_0x19242c[_0xddea('0x13')]?(_0xc72e32[_0xddea('0x25')]||'')+_0xddea('0x14')+_0x19242c[_0xddea('0x13')]+'}':(_0xc72e32[_0xddea('0x25')]||'')+_0xddea('0x15');_0x1383ea[_0x46d2dd[_0x39c8e4]['param']]=[_0xddea('0x27'),_0xc72e32[_0xddea('0x20')],_0xc72e32['phone']][_0xddea('0x28')]('/');break;case _0xddea('0x29'):_0xc72e32[_0xddea('0x29')]=_0x69b429[_0x46d2dd[_0x39c8e4][_0xddea('0x24')]];if(_0x19242c[_0xddea('0x1b')]!=='none'){if(_0xc72e32['options'][_0xddea('0x2a')]('U(xcally-mixmonitor-context)')<0x0){_0xc72e32['options']+=_0xddea('0x2b');}}else{_0xc72e32[_0xddea('0x29')]=_0xc72e32[_0xddea('0x29')][_0xddea('0x2c')](_0xddea('0x2b'),'');}_0x1383ea[_0x46d2dd[_0x39c8e4][_0xddea('0x24')]]=_0xc72e32[_0xddea('0x29')];break;default:_0x1383ea[_0x46d2dd[_0x39c8e4][_0xddea('0x24')]]=_0x69b429[_0x46d2dd[_0x39c8e4][_0xddea('0x24')]];}}return _0x1383ea['join'](',');}function _0x5f05c8(_0x345d65,_0x5a966b,_0x555e5b){return new Promise(function(_0x1cbe52,_0x3594b5){var _0x483654=[];if(_[_0xddea('0x2d')](_0x5a966b))return _0x1cbe52(_0x483654);_0x2a631d[_0xddea('0x2e')]['findAll']({'attributes':['id',_0xddea('0x2f'),_0xddea('0x30')],'raw':!![]})[_0xddea('0x31')](function(_0x3764cf){for(var _0x143ca4=0x0,_0x5589bf=0x0;_0x143ca4<_0x5a966b[_0xddea('0x32')];_0x143ca4++,_0x5589bf=0x0){var _0x26bf45=_0x5a966b[_0x143ca4];var _0x45bf8a=[];var _0x512a9f=[];delete _0x26bf45['id'];if(_0x26bf45[_0xddea('0x2f')]!==_0xddea('0x33')){_0x26bf45[_0xddea('0x34')]=[_0x26bf45['interval']];}else{_0x26bf45[_0xddea('0x34')]=_0x26bf45[_0xddea('0x30')]?_[_0xddea('0x35')](_[_0xddea('0x36')](_0x3764cf,{'IntervalId':_0x26bf45[_0xddea('0x30')]}),'interval'):[];}_0x26bf45['context']=_0x345d65[_0xddea('0x5')];_0x26bf45[_0xddea('0x6')]=_0x345d65['exten'];if(_0x26bf45[_0xddea('0x3')])_0x26bf45[_0xddea('0x3')]=_0x26bf45[_0xddea('0x3')][_0xddea('0x37')]();if(_0x345d65[_0xddea('0x3')]==='outbound'){if(_0x26bf45[_0xddea('0x1a')]('tag')&&_0x26bf45[_0xddea('0x38')]&&_0x26bf45[_0xddea('0x38')]!=='--'){_0x45bf8a[_0xddea('0xb')]({'type':_0x26bf45[_0xddea('0x3')][_0xddea('0x37')](),'app':_0xddea('0x4'),'appdata':_0xddea('0x39')+_0x26bf45['tag'],'context':_0x345d65['context'],'exten':_0x345d65[_0xddea('0x6')],'priority':_0x26bf45['intervals'][_0xddea('0x32')]+_0x555e5b+_0x5589bf++,'VoiceExtensionId':_0x345d65['id']});}_0x45bf8a[_0xddea('0xb')]({'type':_0x26bf45[_0xddea('0x3')][_0xddea('0x37')](),'app':_0xddea('0x3a'),'appdata':_0xddea('0x3b')+(_0x26bf45[_0xddea('0x3c')]?'Set(CALLERID(all)='+_0x26bf45[_0xddea('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x345d65[_0xddea('0x5')],'exten':_0x345d65[_0xddea('0x6')],'priority':_0x26bf45[_0xddea('0x34')][_0xddea('0x32')]+_0x555e5b+_0x5589bf++,'VoiceExtensionId':_0x345d65['id']});}else{if(_0x26bf45[_0xddea('0x1a')](_0xddea('0x3d'))){if([_0xddea('0x3e'),_0xddea('0x3f')][_0xddea('0x40')](_0x26bf45['app'][_0xddea('0x37')]())&&_0x26bf45[_0xddea('0x41')]!==_0xddea('0x42')){if(_0x26bf45[_0xddea('0x3d')]){_0x45bf8a['push']({'type':_0x26bf45['type']['toLowerCase'](),'app':_0xddea('0x3a'),'appdata':_0xddea('0x43'),'context':_0x345d65[_0xddea('0x5')],'exten':_0x345d65[_0xddea('0x6')],'priority':_0x26bf45[_0xddea('0x34')][_0xddea('0x32')]+_0x555e5b+_0x5589bf++,'VoiceExtensionId':_0x345d65['id']});_0x45bf8a[_0xddea('0xb')]({'type':_0x26bf45[_0xddea('0x3')][_0xddea('0x37')](),'app':_0xddea('0x4'),'appdata':_0xddea('0x44'),'context':_0x345d65[_0xddea('0x5')],'exten':_0x345d65['exten'],'priority':_0x26bf45[_0xddea('0x34')][_0xddea('0x32')]+_0x555e5b+_0x5589bf++,'VoiceExtensionId':_0x345d65['id']});}else{_0x45bf8a[_0xddea('0xb')]({'type':_0x26bf45['type'][_0xddea('0x37')](),'app':'ExecIf','appdata':_0xddea('0x45'),'context':_0x345d65['context'],'exten':_0x345d65['exten'],'priority':_0x26bf45['intervals']['length']+_0x555e5b+_0x5589bf++,'VoiceExtensionId':_0x345d65['id']});_0x45bf8a[_0xddea('0xb')]({'type':_0x26bf45[_0xddea('0x3')][_0xddea('0x37')](),'app':_0xddea('0x4'),'appdata':_0xddea('0x46'),'context':_0x345d65[_0xddea('0x5')],'exten':_0x345d65[_0xddea('0x6')],'priority':_0x26bf45[_0xddea('0x34')][_0xddea('0x32')]+_0x555e5b+_0x5589bf++,'VoiceExtensionId':_0x345d65['id']});}}}}for(var _0x3602f2=0x0;_0x3602f2<_0x26bf45[_0xddea('0x34')][_0xddea('0x32')];_0x3602f2++){var _0x3375b1=_0x555e5b+_0x26bf45[_0xddea('0x34')]['length'];var _0x4e566c=_0x3602f2===_0x26bf45[_0xddea('0x34')]['length']-0x1?_0x555e5b+_0x45bf8a[_0xddea('0x32')]+_0x512a9f['length']+0x2:_0x555e5b+_0x3602f2+0x1;_0x45bf8a[_0xddea('0x47')](_0x3602f2,0x0,{'type':_0x345d65[_0xddea('0x3')],'app':'GotoIfTime','appdata':_0x26bf45[_0xddea('0x34')][_0x3602f2]+'?'+_0x345d65['context']+',${EXTEN},'+_0x3375b1+':'+_0x345d65[_0xddea('0x5')]+_0xddea('0x48')+_0x4e566c,'exten':_0x345d65[_0xddea('0x6')],'context':_0x345d65['context'],'priority':_0x555e5b+_0x3602f2,'VoiceExtensionId':_0x345d65['id']});}if(_0x26bf45[_0xddea('0x41')]==='outboundDial'){_0x26bf45[_0xddea('0x49')]=_0x4f2b50(_0x345d65,_0x26bf45['appdata']);}if(_0x26bf45[_0xddea('0x41')]===_0xddea('0x4a')){_0x45bf8a['push']({'type':_0x26bf45[_0xddea('0x3')][_0xddea('0x37')](),'app':'Set','appdata':_0xddea('0x4b'),'context':_0x345d65[_0xddea('0x5')],'exten':_0x345d65[_0xddea('0x6')],'priority':_0x26bf45[_0xddea('0x34')][_0xddea('0x32')]+_0x555e5b+_0x5589bf++,'VoiceExtensionId':_0x345d65['id']});}_0x26bf45[_0xddea('0x4c')]=_0x45bf8a['length']?_[_0xddea('0x4d')](_0x45bf8a)[_0xddea('0x4c')]+0x1:_0x555e5b;_0x483654=_[_0xddea('0x4e')](_0x483654,_0x45bf8a,[_0x26bf45],_0x512a9f);_0x555e5b=_[_0xddea('0x4d')](_0x483654)[_0xddea('0x4c')]+0x1;}return _0x1cbe52(_0x483654);})[_0xddea('0x4f')](function(_0x212b22){_0x3594b5(_0x212b22);});});}return _0x514836[_0xddea('0x50')](_0xddea('0x51'),attributes,{'tableName':_0xddea('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4b6be8){var _0x2e3ea8=this[_0xddea('0x53')]({'plain':!![]});var _0x3a01c2=_0x2e3ea8['type']===_0xddea('0x10')?_0x4c6812(_0x2e3ea8):_0x53421d(_0x2e3ea8);return _0x5f05c8(_0x2e3ea8,_0x4b6be8,_[_0xddea('0x4d')](_0x3a01c2)[_0xddea('0x4c')]+0x1)['then'](function(_0x163585){var _0x553d5d=_[_0xddea('0x4e')](_0x3a01c2,_0x163585);_0x553d5d[_0xddea('0xb')]({'type':_0x2e3ea8[_0xddea('0x3')],'app':_0xddea('0x54'),'exten':_0x2e3ea8['exten'],'context':_0x2e3ea8[_0xddea('0x5')],'priority':_[_0xddea('0x4d')](_0x553d5d)[_0xddea('0x4c')]+0x1,'VoiceExtensionId':_0x2e3ea8['id']});return _0x553d5d;});}}});}; \ No newline at end of file +var _0xd53c=['CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority','last','catch','define','voice_extensions','get','then','Hangup','./voiceExtension.attributes','exports','CDR(type)=','type','context','exten','alias','Set','NoOp','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','options','url','split','length','name','param','prefix','phone','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','*,*,*,*','intervals','filter','IntervalId','hasOwnProperty','tag','toLowerCase'];(function(_0x565c4e,_0x1e77f9){var _0x4a167f=function(_0x537269){while(--_0x537269){_0x565c4e['push'](_0x565c4e['shift']());}};_0x4a167f(++_0x1e77f9);}(_0xd53c,0x6f));var _0xcd53=function(_0x556b3c,_0x222254){_0x556b3c=_0x556b3c-0x0;var _0xc599a=_0xd53c[_0x556b3c];return _0xc599a;};'use strict';var _=require('lodash');var attributes=require(_0xcd53('0x0'));module[_0xcd53('0x1')]=function(_0x3695a2){var _0x2ea8c0=_0x3695a2['models'];function _0x5ebb17(_0x331d5e){var _0xedfa37=0x2;var _0x214a49=[{'type':_0x331d5e['type'],'app':'Set','appdata':_0xcd53('0x2')+_0x331d5e[_0xcd53('0x3')],'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']},{'type':_0x331d5e['type'],'app':_0x331d5e[_0xcd53('0x6')]?_0xcd53('0x7'):_0xcd53('0x8'),'appdata':_0x331d5e[_0xcd53('0x6')]?'CDR(routeAlias)='+_0x331d5e[_0xcd53('0x6')]:_0xcd53('0x9'),'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e['exten'],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']}];if(_0x331d5e[_0xcd53('0x3')]===_0xcd53('0xa')){_0x214a49[_0xcd53('0xb')]({'type':_0xcd53('0xa'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0xc')+_0x331d5e['id'],'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e['exten'],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']});}_0x214a49[_0xcd53('0xb')]({'type':_0x331d5e['type'],'app':'Set','appdata':_0xcd53('0xd'),'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']},{'type':_0x331d5e[_0xcd53('0x3')],'app':'Set','appdata':_0xcd53('0xe'),'context':_0x331d5e[_0xcd53('0x4')],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']},{'type':_0x331d5e[_0xcd53('0x3')],'app':_0xcd53('0x7'),'appdata':'MONITOR_OPTIONS=ab','context':_0x331d5e['context'],'exten':_0x331d5e[_0xcd53('0x5')],'priority':_0xedfa37++,'VoiceExtensionId':_0x331d5e['id']});return _0x214a49;}function _0x54c327(_0xcb25c5){var _0x2fe4f5=0x2;var _0x40e489=[{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x10'),'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcb25c5[_0xcd53('0x6')]?_0xcd53('0x7'):_0xcd53('0x8'),'appdata':_0xcb25c5[_0xcd53('0x6')]?_0xcd53('0x11')+_0xcb25c5[_0xcd53('0x6')]:_0xcd53('0x9'),'context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x12')+(_0xcb25c5[_0xcd53('0x13')]?_0xcd53('0x14')+_0xcb25c5['cutdigits']+'}':_0xcd53('0x15')),'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':'Set','appdata':_0xcd53('0xc')+_0xcb25c5['id'],'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2fe4f5+0x2)+_0xcd53('0x17')+(_0x2fe4f5+0x1)+')','context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcb25c5[_0xcd53('0x13')]?_0xcd53('0x18')+_0xcb25c5[_0xcd53('0x13')]+'}':'CDR(prefix)=noprefix','context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0xd'),'context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5['exten'],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':'outbound','app':_0xcd53('0x7'),'appdata':_0xcd53('0x19'),'context':_0xcb25c5['context'],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':'Set','appdata':_0xcd53('0x1a')+_0xcb25c5['id'],'context':_0xcb25c5[_0xcd53('0x4')],'exten':_0xcb25c5[_0xcd53('0x5')],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']}];if(_0xcb25c5['hasOwnProperty'](_0xcd53('0x1b'))&&_0xcb25c5['recordingFormat']!==_0xcd53('0x1c')){_0x40e489[_0xcd53('0xb')]({'type':_0xcd53('0xf'),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x1d'),'context':_0xcb25c5['context'],'exten':_0xcb25c5['exten'],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']},{'type':_0xcd53('0xf'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xcb25c5[_0xcd53('0x1b')]||'wav','context':_0xcb25c5['context'],'exten':_0xcb25c5['exten'],'priority':_0x2fe4f5++,'VoiceExtensionId':_0xcb25c5['id']});}return _0x40e489;}function _0x17872f(_0x4e7947,_0x1be590){var _0x1505ca=[{'name':_0xcd53('0x1e'),'param':0x0},{'name':_0xcd53('0x1f'),'param':0x1},{'name':_0xcd53('0x20'),'param':0x2},{'name':_0xcd53('0x21'),'param':0x3}];var _0x17b9ab={};var _0xb4b7ba=_0x1be590[_0xcd53('0x22')](',');var _0x385963=[];for(var _0x1c2ab4=0x0;_0x1c2ab4<_0x1505ca[_0xcd53('0x23')];_0x1c2ab4++){switch(_0x1505ca[_0x1c2ab4][_0xcd53('0x24')]){case _0xcd53('0x1e'):_0x17b9ab[_0xcd53('0x1e')]=_0xb4b7ba[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]]['split']('/')[0x1];_0x17b9ab['phone']=_0xb4b7ba[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]][_0xcd53('0x22')]('/')[0x2];_0x17b9ab[_0xcd53('0x26')]=_0x17b9ab[_0xcd53('0x27')]?_0x17b9ab['phone'][_0xcd53('0x22')]('$')[0x0]:undefined;_0x17b9ab['phone']=_0x4e7947['cutdigits']?(_0x17b9ab[_0xcd53('0x26')]||'')+_0xcd53('0x14')+_0x4e7947[_0xcd53('0x13')]+'}':(_0x17b9ab[_0xcd53('0x26')]||'')+'${EXTEN}';_0x385963[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]]=[_0xcd53('0x28'),_0x17b9ab['trunk'],_0x17b9ab[_0xcd53('0x27')]][_0xcd53('0x29')]('/');break;case'options':_0x17b9ab[_0xcd53('0x20')]=_0xb4b7ba[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]];if(_0x4e7947[_0xcd53('0x1b')]!==_0xcd53('0x1c')){if(_0x17b9ab['options'][_0xcd53('0x2a')](_0xcd53('0x2b'))<0x0){_0x17b9ab[_0xcd53('0x20')]+=_0xcd53('0x2b');}}else{_0x17b9ab[_0xcd53('0x20')]=_0x17b9ab[_0xcd53('0x20')]['replace'](_0xcd53('0x2b'),'');}_0x385963[_0x1505ca[_0x1c2ab4][_0xcd53('0x25')]]=_0x17b9ab[_0xcd53('0x20')];break;default:_0x385963[_0x1505ca[_0x1c2ab4]['param']]=_0xb4b7ba[_0x1505ca[_0x1c2ab4]['param']];}}return _0x385963[_0xcd53('0x29')](',');}function _0x2f95f7(_0x536a02,_0x28cb67,_0x20fe13){return new Promise(function(_0x383e54,_0xf458e){var _0x52e78f=[];if(_[_0xcd53('0x2c')](_0x28cb67))return _0x383e54(_0x52e78f);_0x2ea8c0[_0xcd53('0x2d')][_0xcd53('0x2e')]({'attributes':['id',_0xcd53('0x2f'),'IntervalId'],'raw':!![]})['then'](function(_0x4d5d7b){for(var _0x4f0cf5=0x0,_0x583973=0x0;_0x4f0cf5<_0x28cb67[_0xcd53('0x23')];_0x4f0cf5++,_0x583973=0x0){var _0x44b51b=_0x28cb67[_0x4f0cf5];var _0x1cf45f=[];var _0x2e9393=[];delete _0x44b51b['id'];if(_0x44b51b[_0xcd53('0x2f')]!==_0xcd53('0x30')){_0x44b51b['intervals']=[_0x44b51b['interval']];}else{_0x44b51b[_0xcd53('0x31')]=_0x44b51b['IntervalId']?_['map'](_[_0xcd53('0x32')](_0x4d5d7b,{'IntervalId':_0x44b51b[_0xcd53('0x33')]}),_0xcd53('0x2f')):[];}_0x44b51b[_0xcd53('0x4')]=_0x536a02[_0xcd53('0x4')];_0x44b51b['exten']=_0x536a02[_0xcd53('0x5')];if(_0x44b51b[_0xcd53('0x3')])_0x44b51b['type']=_0x44b51b[_0xcd53('0x3')]['toLowerCase']();if(_0x536a02[_0xcd53('0x3')]==='outbound'){if(_0x44b51b[_0xcd53('0x34')](_0xcd53('0x35'))&&_0x44b51b['tag']&&_0x44b51b[_0xcd53('0x35')]!=='--'){_0x1cf45f['push']({'type':_0x44b51b['type'][_0xcd53('0x36')](),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x37')+_0x44b51b[_0xcd53('0x35')],'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b['type']['toLowerCase'](),'app':_0xcd53('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x44b51b[_0xcd53('0x38')]?_0xcd53('0x39')+_0x44b51b['callerID']+')':_0xcd53('0x3a')),'context':_0x536a02[_0xcd53('0x4')],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b['intervals'][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}else{if(_0x44b51b[_0xcd53('0x34')](_0xcd53('0x3b'))){if([_0xcd53('0x3c'),_0xcd53('0x3d')][_0xcd53('0x3e')](_0x44b51b['app'][_0xcd53('0x36')]())&&_0x44b51b[_0xcd53('0x3f')]!==_0xcd53('0x40')){if(_0x44b51b[_0xcd53('0x3b')]){_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':'ExecIf','appdata':_0xcd53('0x41'),'context':_0x536a02[_0xcd53('0x4')],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x42'),'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}else{_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')]['toLowerCase'](),'app':_0xcd53('0x16'),'appdata':_0xcd53('0x43'),'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':_0xcd53('0x7'),'appdata':_0xcd53('0x44'),'context':_0x536a02['context'],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')]+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}}}}for(var _0x2cb371=0x0;_0x2cb371<_0x44b51b['intervals'][_0xcd53('0x23')];_0x2cb371++){var _0x4ef1f5=_0x20fe13+_0x44b51b[_0xcd53('0x31')][_0xcd53('0x23')];var _0x4b5a55=_0x2cb371===_0x44b51b['intervals'][_0xcd53('0x23')]-0x1?_0x20fe13+_0x1cf45f['length']+_0x2e9393[_0xcd53('0x23')]+0x2:_0x20fe13+_0x2cb371+0x1;_0x1cf45f[_0xcd53('0x45')](_0x2cb371,0x0,{'type':_0x536a02[_0xcd53('0x3')],'app':_0xcd53('0x46'),'appdata':_0x44b51b[_0xcd53('0x31')][_0x2cb371]+'?'+_0x536a02[_0xcd53('0x4')]+_0xcd53('0x47')+_0x4ef1f5+':'+_0x536a02[_0xcd53('0x4')]+_0xcd53('0x47')+_0x4b5a55,'exten':_0x536a02[_0xcd53('0x5')],'context':_0x536a02[_0xcd53('0x4')],'priority':_0x20fe13+_0x2cb371,'VoiceExtensionId':_0x536a02['id']});}if(_0x44b51b['appType']===_0xcd53('0x48')){_0x44b51b[_0xcd53('0x49')]=_0x17872f(_0x536a02,_0x44b51b['appdata']);}if(_0x44b51b[_0xcd53('0x3f')]===_0xcd53('0x4a')){_0x1cf45f[_0xcd53('0xb')]({'type':_0x44b51b[_0xcd53('0x3')][_0xcd53('0x36')](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x536a02[_0xcd53('0x4')],'exten':_0x536a02[_0xcd53('0x5')],'priority':_0x44b51b[_0xcd53('0x31')]['length']+_0x20fe13+_0x583973++,'VoiceExtensionId':_0x536a02['id']});}_0x44b51b[_0xcd53('0x4b')]=_0x1cf45f[_0xcd53('0x23')]?_[_0xcd53('0x4c')](_0x1cf45f)[_0xcd53('0x4b')]+0x1:_0x20fe13;_0x52e78f=_['concat'](_0x52e78f,_0x1cf45f,[_0x44b51b],_0x2e9393);_0x20fe13=_[_0xcd53('0x4c')](_0x52e78f)['priority']+0x1;}return _0x383e54(_0x52e78f);})[_0xcd53('0x4d')](function(_0x35cc54){_0xf458e(_0x35cc54);});});}return _0x3695a2[_0xcd53('0x4e')]('VoiceExtension',attributes,{'tableName':_0xcd53('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x115305){var _0x5da0ad=this[_0xcd53('0x50')]({'plain':!![]});var _0x404cfb=_0x5da0ad[_0xcd53('0x3')]===_0xcd53('0xf')?_0x54c327(_0x5da0ad):_0x5ebb17(_0x5da0ad);return _0x2f95f7(_0x5da0ad,_0x115305,_[_0xcd53('0x4c')](_0x404cfb)[_0xcd53('0x4b')]+0x1)[_0xcd53('0x51')](function(_0x5f0895){var _0x2057b2=_['concat'](_0x404cfb,_0x5f0895);_0x2057b2[_0xcd53('0xb')]({'type':_0x5da0ad[_0xcd53('0x3')],'app':_0xcd53('0x52'),'exten':_0x5da0ad[_0xcd53('0x5')],'context':_0x5da0ad[_0xcd53('0x4')],'priority':_[_0xcd53('0x4c')](_0x2057b2)[_0xcd53('0x4b')]+0x1,'VoiceExtensionId':_0x5da0ad['id']});return _0x2057b2;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 6f5b071..fa6baba 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 _0xdd68=['VoiceExtension','findAll','options','where','attributes','limit','include','map','model','GetVoiceExtension','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0xfa4a79,_0x3fc1f2){var _0x6350eb=function(_0x55dc84){while(--_0x55dc84){_0xfa4a79['push'](_0xfa4a79['shift']());}};_0x6350eb(++_0x3fc1f2);}(_0xdd68,0x196));var _0x8dd6=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0xdd68[_0x1558ab];return _0x53b64a;};'use strict';var _=require(_0x8dd6('0x0'));var util=require('util');var moment=require(_0x8dd6('0x1'));var BPromise=require(_0x8dd6('0x2'));var rs=require(_0x8dd6('0x3'));var fs=require('fs');var Redis=require(_0x8dd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8dd6('0x5'));var logger=require(_0x8dd6('0x6'))('rpc');var config=require(_0x8dd6('0x7'));var jayson=require(_0x8dd6('0x8'));var client=jayson['client'][_0x8dd6('0x9')]({'port':0x232a});config['redis']=_[_0x8dd6('0xa')](config['redis'],{'host':_0x8dd6('0xb'),'port':0x18eb});var socket=require(_0x8dd6('0xc'))(new Redis(config[_0x8dd6('0xd')]));require('./voiceExtension.socket')[_0x8dd6('0xe')](socket);function respondWithRpcPromise(_0x7ef2a7,_0x1ef33d,_0x2dc6ea){return new BPromise(function(_0x34bd4e,_0x19e423){return client[_0x8dd6('0xf')](_0x7ef2a7,_0x2dc6ea)[_0x8dd6('0x10')](function(_0x84f828){logger[_0x8dd6('0x11')](_0x8dd6('0x12'),_0x1ef33d,_0x8dd6('0x13'));logger[_0x8dd6('0x14')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x1ef33d,_0x8dd6('0x13'),JSON[_0x8dd6('0x15')](_0x84f828));if(_0x84f828[_0x8dd6('0x16')]){if(_0x84f828['error']['code']===0x1f4){logger[_0x8dd6('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x1ef33d,_0x84f828['error'][_0x8dd6('0x17')]);return _0x19e423(_0x84f828[_0x8dd6('0x16')][_0x8dd6('0x17')]);}logger[_0x8dd6('0x16')](_0x8dd6('0x12'),_0x1ef33d,_0x84f828[_0x8dd6('0x16')][_0x8dd6('0x17')]);return _0x34bd4e(_0x84f828[_0x8dd6('0x16')][_0x8dd6('0x17')]);}else{logger['info'](_0x8dd6('0x12'),_0x1ef33d,_0x8dd6('0x13'));_0x34bd4e(_0x84f828[_0x8dd6('0x18')][_0x8dd6('0x17')]);}})[_0x8dd6('0x19')](function(_0x36bcdc){logger[_0x8dd6('0x16')](_0x8dd6('0x12'),_0x1ef33d,_0x36bcdc);_0x19e423(_0x36bcdc);});});}exports['GetVoiceExtension']=function(_0xa363b6){var _0x1d6123=this;return new Promise(function(_0x54b996,_0x40d5a5){return db[_0x8dd6('0x1a')][_0x8dd6('0x1b')]({'raw':_0xa363b6[_0x8dd6('0x1c')]?_0xa363b6['options']['raw']===undefined?!![]:![]:!![],'where':_0xa363b6['options']?_0xa363b6[_0x8dd6('0x1c')][_0x8dd6('0x1d')]||null:null,'attributes':_0xa363b6['options']?_0xa363b6[_0x8dd6('0x1c')][_0x8dd6('0x1e')]||null:null,'limit':_0xa363b6[_0x8dd6('0x1c')]?_0xa363b6[_0x8dd6('0x1c')][_0x8dd6('0x1f')]||null:null,'include':_0xa363b6['options']?_0xa363b6[_0x8dd6('0x1c')][_0x8dd6('0x20')]?_['map'](_0xa363b6[_0x8dd6('0x1c')][_0x8dd6('0x20')],function(_0xeeda3){return{'model':db[_0xeeda3['model']],'as':_0xeeda3['as'],'attributes':_0xeeda3[_0x8dd6('0x1e')],'include':_0xeeda3[_0x8dd6('0x20')]?_[_0x8dd6('0x21')](_0xeeda3[_0x8dd6('0x20')],function(_0x35f35d){return{'model':db[_0x35f35d['model']],'as':_0x35f35d['as'],'attributes':_0x35f35d[_0x8dd6('0x1e')],'include':_0x35f35d[_0x8dd6('0x20')]?_['map'](_0x35f35d['include'],function(_0x25eba7){return{'model':db[_0x25eba7[_0x8dd6('0x22')]],'as':_0x25eba7['as'],'attributes':_0x25eba7[_0x8dd6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8dd6('0x10')](function(_0x2bbe93){logger[_0x8dd6('0x11')](_0x8dd6('0x23'),_0xa363b6);logger[_0x8dd6('0x14')](_0x8dd6('0x23'),_0xa363b6,JSON[_0x8dd6('0x15')](_0x2bbe93));_0x54b996(_0x2bbe93);})[_0x8dd6('0x19')](function(_0x3592d7){logger[_0x8dd6('0x16')](_0x8dd6('0x23'),_0x3592d7[_0x8dd6('0x17')],_0xa363b6);_0x40d5a5(_0x1d6123[_0x8dd6('0x16')](0x1f4,_0x3592d7[_0x8dd6('0x17')]));});});}; \ No newline at end of file +var _0x36c3=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','VoiceExtension','findAll','options','where','attributes','limit','include','model','map','GetVoiceExtension','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c0c8d,_0x4a86c7){var _0x114e7a=function(_0x5ef296){while(--_0x5ef296){_0x2c0c8d['push'](_0x2c0c8d['shift']());}};_0x114e7a(++_0x4a86c7);}(_0x36c3,0x1a6));var _0x336c=function(_0x972b32,_0x56ea80){_0x972b32=_0x972b32-0x0;var _0x6e8e75=_0x36c3[_0x972b32];return _0x6e8e75;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var moment=require('moment');var BPromise=require(_0x336c('0x2'));var rs=require(_0x336c('0x3'));var fs=require('fs');var Redis=require(_0x336c('0x4'));var db=require(_0x336c('0x5'))['db'];var utils=require(_0x336c('0x6'));var logger=require(_0x336c('0x7'))(_0x336c('0x8'));var config=require('../../config/environment');var jayson=require(_0x336c('0x9'));var client=jayson[_0x336c('0xa')][_0x336c('0xb')]({'port':0x232a});config[_0x336c('0xc')]=_[_0x336c('0xd')](config['redis'],{'host':_0x336c('0xe'),'port':0x18eb});var socket=require(_0x336c('0xf'))(new Redis(config[_0x336c('0xc')]));require(_0x336c('0x10'))[_0x336c('0x11')](socket);function respondWithRpcPromise(_0x243984,_0x33ced0,_0x1a4503){return new BPromise(function(_0x179247,_0x31cee7){return client[_0x336c('0x12')](_0x243984,_0x1a4503)[_0x336c('0x13')](function(_0x1d896b){logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,_0x336c('0x16'));logger[_0x336c('0x17')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x33ced0,'request\x20sent',JSON[_0x336c('0x18')](_0x1d896b));if(_0x1d896b['error']){if(_0x1d896b[_0x336c('0x19')][_0x336c('0x1a')]===0x1f4){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d896b['error'][_0x336c('0x1b')]);return _0x31cee7(_0x1d896b[_0x336c('0x19')]['message']);}logger[_0x336c('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x33ced0,_0x1d896b[_0x336c('0x19')]['message']);return _0x179247(_0x1d896b[_0x336c('0x19')]['message']);}else{logger[_0x336c('0x14')](_0x336c('0x15'),_0x33ced0,'request\x20sent');_0x179247(_0x1d896b['result'][_0x336c('0x1b')]);}})[_0x336c('0x1c')](function(_0x1d306c){logger[_0x336c('0x19')](_0x336c('0x15'),_0x33ced0,_0x1d306c);_0x31cee7(_0x1d306c);});});}exports['GetVoiceExtension']=function(_0x327e10){var _0x532e12=this;return new Promise(function(_0x4dcdce,_0x5f401e){return db[_0x336c('0x1d')][_0x336c('0x1e')]({'raw':_0x327e10[_0x336c('0x1f')]?_0x327e10['options']['raw']===undefined?!![]:![]:!![],'where':_0x327e10[_0x336c('0x1f')]?_0x327e10[_0x336c('0x1f')][_0x336c('0x20')]||null:null,'attributes':_0x327e10['options']?_0x327e10[_0x336c('0x1f')][_0x336c('0x21')]||null:null,'limit':_0x327e10[_0x336c('0x1f')]?_0x327e10['options'][_0x336c('0x22')]||null:null,'include':_0x327e10[_0x336c('0x1f')]?_0x327e10[_0x336c('0x1f')][_0x336c('0x23')]?_['map'](_0x327e10[_0x336c('0x1f')][_0x336c('0x23')],function(_0x412a00){return{'model':db[_0x412a00[_0x336c('0x24')]],'as':_0x412a00['as'],'attributes':_0x412a00[_0x336c('0x21')],'include':_0x412a00[_0x336c('0x23')]?_['map'](_0x412a00[_0x336c('0x23')],function(_0x3d2442){return{'model':db[_0x3d2442[_0x336c('0x24')]],'as':_0x3d2442['as'],'attributes':_0x3d2442[_0x336c('0x21')],'include':_0x3d2442['include']?_[_0x336c('0x25')](_0x3d2442[_0x336c('0x23')],function(_0x54b06b){return{'model':db[_0x54b06b['model']],'as':_0x54b06b['as'],'attributes':_0x54b06b['attributes']};}):[]};}):[]};}):[]:[]})[_0x336c('0x13')](function(_0x1c7a34){logger['info']('GetVoiceExtension',_0x327e10);logger['debug'](_0x336c('0x26'),_0x327e10,JSON[_0x336c('0x18')](_0x1c7a34));_0x4dcdce(_0x1c7a34);})[_0x336c('0x1c')](function(_0x424712){logger[_0x336c('0x19')](_0x336c('0x26'),_0x424712[_0x336c('0x1b')],_0x327e10);_0x5f401e(_0x532e12['error'](0x1f4,_0x424712[_0x336c('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 1ce10af..24c8bde 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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x41ec9b,_0x5bc5eb){var _0x323d79=function(_0x442189){while(--_0x442189){_0x41ec9b['push'](_0x41ec9b['shift']());}};_0x323d79(++_0x5bc5eb);}(_0xabce,0x103));var _0xeabc=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xabce[_0x6131cd];return _0x47e916;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x3d5b76,_0x55f6f8){var _0x1a1d13=function(_0x23cc2c){while(--_0x23cc2c){_0x3d5b76['push'](_0x3d5b76['shift']());}};_0x1a1d13(++_0x55f6f8);}(_0xe14b,0x93));var _0xbe14=function(_0x4262aa,_0x3b8d35){_0x4262aa=_0x4262aa-0x0;var _0x662813=_0xe14b[_0x4262aa];return _0x662813;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index b12356f..ccaf0ed 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 _0x2da6=['fs-extra','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2724f7,_0xdab58f){var _0x3b930f=function(_0x10fb83){while(--_0x10fb83){_0x2724f7['push'](_0x2724f7['shift']());}};_0x3b930f(++_0xdab58f);}(_0x2da6,0x1dd));var _0x62da=function(_0x4c4a7d,_0x5034c8){_0x4c4a7d=_0x4c4a7d-0x0;var _0x1ff52f=_0x2da6[_0x4c4a7d];return _0x1ff52f;};'use strict';var multer=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var path=require(_0x62da('0x2'));var timeout=require(_0x62da('0x3'));var express=require(_0x62da('0x4'));var router=express[_0x62da('0x5')]();var fs_extra=require(_0x62da('0x6'));var auth=require(_0x62da('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x62da('0x8'));router[_0x62da('0x9')]('/',auth[_0x62da('0xa')](),controller[_0x62da('0xb')]);router[_0x62da('0x9')](_0x62da('0xc'),auth[_0x62da('0xa')](),controller[_0x62da('0xd')]);router[_0x62da('0x9')]('/:id/messages',auth[_0x62da('0xa')](),controller[_0x62da('0xe')]);router[_0x62da('0xf')]('/',auth[_0x62da('0xa')](),controller['create']);router[_0x62da('0x10')](_0x62da('0xc'),auth[_0x62da('0xa')](),controller[_0x62da('0x11')]);router[_0x62da('0x12')]('/:id',auth[_0x62da('0xa')](),controller[_0x62da('0x13')]);module[_0x62da('0x14')]=router; \ No newline at end of file +var _0x57ca=['create','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post'];(function(_0xc5878f,_0x3f5372){var _0x430039=function(_0x4ebb2f){while(--_0x4ebb2f){_0xc5878f['push'](_0xc5878f['shift']());}};_0x430039(++_0x3f5372);}(_0x57ca,0x108));var _0xa57c=function(_0x2c9e98,_0x399466){_0x2c9e98=_0x2c9e98-0x0;var _0xbe0e92=_0x57ca[_0x2c9e98];return _0xbe0e92;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/',auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['put'](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x11')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);module[_0xa57c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index b773421..4eb2d93 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 _0x73b9=['exports','STRING','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','\x20-\x20','mailbox','sequelize'];(function(_0x14c720,_0x4a44bf){var _0x5b7d40=function(_0x17aa0c){while(--_0x17aa0c){_0x14c720['push'](_0x14c720['shift']());}};_0x5b7d40(++_0x4a44bf);}(_0x73b9,0x12b));var _0x973b=function(_0x3a1b0d,_0x143c53){_0x3a1b0d=_0x3a1b0d-0x0;var _0xf9de11=_0x73b9[_0x3a1b0d];return _0xf9de11;};'use strict';var Sequelize=require(_0x973b('0x0'));module[_0x973b('0x1')]={'customer_id':{'type':Sequelize[_0x973b('0x2')]},'context':{'type':Sequelize[_0x973b('0x2')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x973b('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x973b('0x2')]},'fullname':{'type':Sequelize[_0x973b('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x1bbb49){this[_0x973b('0x3')]('email',typeof _0x1bbb49===_0x973b('0x4')&&_0x1bbb49[_0x973b('0x5')]()?_0x1bbb49['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x973b('0x2')],'defaultValue':_0x973b('0x6')},'attach':{'type':Sequelize[_0x973b('0x7')]('yes','no'),'defaultValue':_0x973b('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x973b('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x973b('0x2')]},'review':{'type':Sequelize[_0x973b('0x7')](_0x973b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x973b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x973b('0x7')](_0x973b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x973b('0x7')](_0x973b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x973b('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x973b('0x7')](_0x973b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x973b('0x7')](_0x973b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x973b('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x973b('0x7')](_0x973b('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x973b('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x973b('0x7')](_0x973b('0x8'),'no'),'defaultValue':_0x973b('0x8'),'allowNull':![]},'stamp':{'type':_0x973b('0xa')},'emailsubject':{'type':Sequelize[_0x973b('0x2')]},'emailbody':{'type':Sequelize[_0x973b('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x973b('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x973b('0xc')]('fullname')+_0x973b('0xd')+this[_0x973b('0xc')](_0x973b('0xe'));}}}; \ No newline at end of file +var _0xc850=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','sequelize','exports','from-voicemail','contest_mailbox','STRING','setDataValue','string','trim','central'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xc850,0x13b));var _0x0c85=function(_0x45938a,_0x5b590a){_0x45938a=_0x45938a-0x0;var _0x46b755=_0xc850[_0x45938a];return _0x46b755;};'use strict';var Sequelize=require(_0x0c85('0x0'));module[_0x0c85('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x0c85('0x2'),'unique':_0x0c85('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x0c85('0x3')},'password':{'type':Sequelize[_0x0c85('0x4')]},'fullname':{'type':Sequelize[_0x0c85('0x4')]},'email':{'type':Sequelize[_0x0c85('0x4')],'validate':{'isEmail':!![]},'set':function(_0x33de23){this[_0x0c85('0x5')]('email',typeof _0x33de23===_0x0c85('0x6')&&_0x33de23['trim']()?_0x33de23[_0x0c85('0x7')]():null);}},'pager':{'type':Sequelize[_0x0c85('0x4')]},'tz':{'type':Sequelize[_0x0c85('0x4')],'defaultValue':_0x0c85('0x8')},'attach':{'type':Sequelize[_0x0c85('0x9')]('yes','no'),'defaultValue':_0x0c85('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':_0x0c85('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0c85('0x4')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0c85('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0c85('0x9')](_0x0c85('0xa'),'no'),'defaultValue':_0x0c85('0xa'),'allowNull':![]},'stamp':{'type':_0x0c85('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x0c85('0x4')]},'maxsecs':{'type':Sequelize[_0x0c85('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0c85('0xe')],'get':function(){return this['getDataValue'](_0x0c85('0xf'))+_0x0c85('0x10')+this['getDataValue'](_0x0c85('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 58158d4..6a0691a 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 _0xf45e=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource','error','stack','name','send','map','VoiceMail','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir'];(function(_0x4195d8,_0x246ebd){var _0x4b3a94=function(_0x7f41f6){while(--_0x7f41f6){_0x4195d8['push'](_0x4195d8['shift']());}};_0x4b3a94(++_0x246ebd);}(_0xf45e,0x115));var _0xef45=function(_0x15c397,_0x48a1ed){_0x15c397=_0x15c397-0x0;var _0x5e5feb=_0xf45e[_0x15c397];return _0x5e5feb;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){var _0x315777=_0x7817d0['get']({'plain':!![]});var _0x208b35='Voicemails';return db[_0xef45('0x2a')][_0xef45('0x28')]({'where':{'type':_0x208b35,'resourceId':_0x315777['id']}})['then'](function(){return _0x7817d0;});})[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1096af,_0x4f8c9b){return function(_0x550e18){if(!_0x550e18){_0x1096af['sendStatus'](0x194);}return _0x550e18;};}function handleError(_0x53690e,_0x1f636f){_0x1f636f=_0x1f636f||0x1f4;return function(_0x2f72ef){logger[_0xef45('0x2b')](_0x2f72ef[_0xef45('0x2c')]);if(_0x2f72ef['name']){delete _0x2f72ef[_0xef45('0x2d')];}_0x53690e['status'](_0x1f636f)[_0xef45('0x2e')](_0x2f72ef);};}exports['index']=function(_0x3e6922,_0x5bfd2d){var _0x575734={},_0x14ce5a={},_0x3e45de={'count':0x0,'rows':[]};var _0x390a7a=_[_0xef45('0x2f')](db[_0xef45('0x30')]['rawAttributes'],function(_0x5551ce){return{'name':_0x5551ce['fieldName'],'type':_0x5551ce[_0xef45('0x31')][_0xef45('0x32')]};});_0x14ce5a[_0xef45('0x33')]=_[_0xef45('0x2f')](_0x390a7a,_0xef45('0x2d'));_0x14ce5a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x3e6922['query']);_0x14ce5a['filters']=_[_0xef45('0x36')](_0x14ce5a['model'],_0x14ce5a[_0xef45('0x34')]);_0x575734['attributes']=_[_0xef45('0x36')](_0x14ce5a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x3e6922[_0xef45('0x34')][_0xef45('0x37')]));_0x575734['attributes']=_0x575734[_0xef45('0x38')][_0xef45('0x39')]?_0x575734[_0xef45('0x38')]:_0x14ce5a['model'];if(!_0x3e6922['query'][_0xef45('0x3a')](_0xef45('0x3b'))){_0x575734['limit']=qs[_0xef45('0x20')](_0x3e6922['query']['limit']);_0x575734[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x3e6922[_0xef45('0x34')]['offset']);}_0x575734[_0xef45('0x3c')]=qs[_0xef45('0x3d')](_0x3e6922[_0xef45('0x34')][_0xef45('0x3d')]);_0x575734['where']=qs['filters'](_[_0xef45('0x3e')](_0x3e6922[_0xef45('0x34')],_0x14ce5a[_0xef45('0x3f')]),_0x390a7a);if(_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]){_0x575734[_0xef45('0x41')]=_[_0xef45('0x42')](_0x575734[_0xef45('0x41')],{'$or':_['map'](_0x390a7a,function(_0x4f5877){if(_0x4f5877[_0xef45('0x31')]!==_0xef45('0x43')){var _0x154e72={};_0x154e72[_0x4f5877[_0xef45('0x2d')]]={'$like':'%'+_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]+'%'};return _0x154e72;}})});}_0x575734=_[_0xef45('0x42')]({},_0x575734,_0x3e6922[_0xef45('0x44')]);var _0x3a5082={'where':_0x575734[_0xef45('0x41')]};return db[_0xef45('0x30')][_0xef45('0x21')](_0x3a5082)[_0xef45('0x29')](function(_0xd7d217){_0x3e45de[_0xef45('0x21')]=_0xd7d217;if(_0x3e6922[_0xef45('0x34')]['includeAll']){_0x575734[_0xef45('0x45')]=[{'all':!![]}];}return db[_0xef45('0x30')][_0xef45('0x46')](_0x575734);})[_0xef45('0x29')](function(_0x54ccb8){_0x3e45de[_0xef45('0x47')]=_0x54ccb8;return _0x3e45de;})['then'](respondWithFilteredResult(_0x5bfd2d,_0x575734))[_0xef45('0x48')](handleError(_0x5bfd2d,null));};exports['show']=function(_0x5faf67,_0x2d086f){var _0x2236d9={'raw':!![],'where':{'id':_0x5faf67[_0xef45('0x49')]['id']}},_0x36e81a={};_0x36e81a[_0xef45('0x33')]=_[_0xef45('0x35')](db['VoiceMail'][_0xef45('0x4a')]);_0x36e81a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5faf67[_0xef45('0x34')]);_0x36e81a[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],_0x36e81a[_0xef45('0x34')]);_0x2236d9[_0xef45('0x38')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x5faf67[_0xef45('0x34')][_0xef45('0x37')]));_0x2236d9[_0xef45('0x38')]=_0x2236d9['attributes'][_0xef45('0x39')]?_0x2236d9[_0xef45('0x38')]:_0x36e81a[_0xef45('0x33')];if(_0x5faf67['query']['includeAll']){_0x2236d9['include']=[{'all':!![]}];}_0x2236d9=_[_0xef45('0x42')]({},_0x2236d9,_0x5faf67[_0xef45('0x44')]);return db[_0xef45('0x30')][_0xef45('0x4b')](_0x2236d9)[_0xef45('0x29')](handleEntityNotFound(_0x2d086f,null))[_0xef45('0x29')](respondWithResult(_0x2d086f,null))['catch'](handleError(_0x2d086f,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){return db['VoiceMail']['create'](_0x463796[_0xef45('0x4d')],{})[_0xef45('0x29')](function(_0x4feeb1){var _0x1a56ae=_0x463796[_0xef45('0x4e')][_0xef45('0x4f')]({'plain':!![]});if(!_0x1a56ae)throw new Error(_0xef45('0x50'));if(_0x1a56ae[_0xef45('0x51')]===_0xef45('0x4e')){var _0x23581f=_0x4feeb1[_0xef45('0x4f')]({'plain':!![]});var _0x1961b4=_0xef45('0x52');return db[_0xef45('0x53')][_0xef45('0x4b')]({'where':{'name':_0x1961b4,'userProfileId':_0x1a56ae[_0xef45('0x54')]},'raw':!![]})[_0xef45('0x29')](function(_0x48a391){if(_0x48a391&&_0x48a391[_0xef45('0x55')]===0x0){return db[_0xef45('0x2a')][_0xef45('0x4c')]({'name':_0x23581f['name'],'resourceId':_0x23581f['id'],'type':_0x48a391[_0xef45('0x2d')],'sectionId':_0x48a391['id']},{})[_0xef45('0x29')](function(){return _0x4feeb1;});}else{return _0x4feeb1;}})[_0xef45('0x48')](function(_0x1531ea){logger['error'](_0xef45('0x56'),_0x1531ea);throw _0x1531ea;});}return _0x4feeb1;})[_0xef45('0x29')](respondWithResult(_0x2b2419,0xc9))[_0xef45('0x48')](handleError(_0x2b2419,null));};exports[_0xef45('0x57')]=function(_0x67d57b,_0x41f575){if(_0x67d57b[_0xef45('0x4d')]['id']){delete _0x67d57b[_0xef45('0x4d')]['id'];}return db[_0xef45('0x30')][_0xef45('0x4b')]({'where':{'id':_0x67d57b[_0xef45('0x49')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x41f575,null))['then'](saveUpdates(_0x67d57b[_0xef45('0x4d')],null))[_0xef45('0x29')](respondWithResult(_0x41f575,null))[_0xef45('0x48')](handleError(_0x41f575,null));};exports[_0xef45('0x28')]=function(_0x2fe9cf,_0x32232f){return db['VoiceMail']['find']({'where':{'id':_0x2fe9cf[_0xef45('0x49')]['id']}})['then'](handleEntityNotFound(_0x32232f,null))[_0xef45('0x29')](removeEntity(_0x32232f,null))[_0xef45('0x48')](handleError(_0x32232f,null));};exports[_0xef45('0x58')]=function(_0x5676fb,_0x16b04e,_0x398dc0){return db['VoiceMail'][_0xef45('0x59')]({'where':{'id':_0x5676fb['params']['id']}})['then'](handleEntityNotFound(_0x16b04e,null))[_0xef45('0x29')](function(_0x4f78ac){var _0x189f22;var _0x3fbc26={},_0x22fd64={};_0x22fd64['model']=_[_0xef45('0x35')](db[_0xef45('0x5a')]['rawAttributes']);_0x22fd64[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5676fb[_0xef45('0x34')]);_0x22fd64[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x22fd64[_0xef45('0x33')],_0x22fd64[_0xef45('0x34')]);_0x3fbc26[_0xef45('0x38')]=_['intersection'](_0x22fd64[_0xef45('0x33')],qs['fields'](_0x5676fb['query'][_0xef45('0x37')]));_0x3fbc26['attributes']=_0x3fbc26[_0xef45('0x38')][_0xef45('0x39')]?_0x3fbc26['attributes']:_0x22fd64[_0xef45('0x33')];if(!_0x5676fb[_0xef45('0x34')][_0xef45('0x3a')](_0xef45('0x3b'))){_0x3fbc26[_0xef45('0x20')]=qs[_0xef45('0x20')](_0x5676fb['query'][_0xef45('0x20')]);_0x3fbc26[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x5676fb[_0xef45('0x34')][_0xef45('0x1e')]);}_0x3fbc26['order']=qs[_0xef45('0x3d')](_0x5676fb['query'][_0xef45('0x3d')]);_0x3fbc26[_0xef45('0x41')]=qs['filters'](_[_0xef45('0x3e')](_0x5676fb[_0xef45('0x34')],_0x22fd64[_0xef45('0x3f')]));if(_0x5676fb['query']['filter']){_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'$or':_['map'](_0x3fbc26[_0xef45('0x38')],function(_0x3956b0){var _0x49131e={};_0x49131e[_0x3956b0]={'$like':'%'+_0x5676fb[_0xef45('0x34')]['filter']+'%'};return _0x49131e;})});}_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'mailboxuser':_0x4f78ac[_0xef45('0x5b')]});_0x3fbc26=_[_0xef45('0x42')]({},_0x3fbc26,_0x5676fb[_0xef45('0x44')]);return db[_0xef45('0x5a')][_0xef45('0x5c')](_0x3fbc26)['then'](respondWithFilteredResult(_0x16b04e,_0x3fbc26));})[_0xef45('0x48')](handleError(_0x16b04e,null));}; \ No newline at end of file +var _0x0bb5=['error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Voicemails'];(function(_0x2991ea,_0x4a0231){var _0x4e1c51=function(_0x59ed64){while(--_0x59ed64){_0x2991ea['push'](_0x2991ea['shift']());}};_0x4e1c51(++_0x4a0231);}(_0x0bb5,0x148));var _0x50bb=function(_0x471b65,_0x172e62){_0x471b65=_0x471b65-0x0;var _0x41e6d1=_0x0bb5[_0x471b65];return _0x41e6d1;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226370,_0x58837d){_0x58837d=_0x58837d||0xcc;return function(_0x283f04){if(_0x283f04){return _0x226370[_0x50bb('0x19')](_0x58837d);}return _0x226370[_0x50bb('0x1a')](_0x58837d)['end']();};}function respondWithResult(_0x17007f,_0x309986){_0x309986=_0x309986||0xc8;return function(_0x3094f2){if(_0x3094f2){return _0x17007f['status'](_0x309986)[_0x50bb('0x1b')](_0x3094f2);}};}function respondWithFilteredResult(_0x5e8478,_0x21befa){return function(_0x3e1a51){if(_0x3e1a51){var _0x253073=typeof _0x21befa[_0x50bb('0x1c')]===_0x50bb('0x1d')&&typeof _0x21befa['limit']===_0x50bb('0x1d');var _0x174065=_0x3e1a51['count'];var _0x24ba19=_0x253073?0x0:_0x21befa['offset'];var _0x301f61=_0x253073?_0x3e1a51[_0x50bb('0x1e')]:_0x21befa['offset']+_0x21befa['limit'];var _0x43465b;if(_0x301f61>=_0x174065){_0x301f61=_0x174065;_0x43465b=0xc8;}else{_0x43465b=0xce;}_0x5e8478[_0x50bb('0x1a')](_0x43465b);return _0x5e8478[_0x50bb('0x1f')](_0x50bb('0x20'),_0x24ba19+'-'+_0x301f61+'/'+_0x174065)['json'](_0x3e1a51);}return null;};}function patchUpdates(_0x19dc5d){return function(_0x32bfc3){try{jsonpatch[_0x50bb('0x21')](_0x32bfc3,_0x19dc5d,!![]);}catch(_0x597e95){return BPromise[_0x50bb('0x22')](_0x597e95);}return _0x32bfc3[_0x50bb('0x23')]();};}function saveUpdates(_0x1344ec,_0x4825f8){return function(_0x1dbba2){if(_0x1dbba2){return _0x1dbba2['update'](_0x1344ec)[_0x50bb('0x24')](function(_0x3391da){return _0x3391da;});}return null;};}function removeEntity(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(_0x846311){return _0x846311[_0x50bb('0x25')]()['then'](function(){var _0xad17ac=_0x846311[_0x50bb('0x26')]({'plain':!![]});var _0x284a76=_0x50bb('0x27');return db['UserProfileResource'][_0x50bb('0x25')]({'where':{'type':_0x284a76,'resourceId':_0xad17ac['id']}})['then'](function(){return _0x846311;});})['then'](function(){_0x1a2a0b[_0x50bb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cfe4b,_0x41fd89){return function(_0x12ee2c){if(!_0x12ee2c){_0x5cfe4b[_0x50bb('0x19')](0x194);}return _0x12ee2c;};}function handleError(_0x1b74f9,_0x17c158){_0x17c158=_0x17c158||0x1f4;return function(_0x269479){logger[_0x50bb('0x28')](_0x269479[_0x50bb('0x29')]);if(_0x269479['name']){delete _0x269479[_0x50bb('0x2a')];}_0x1b74f9[_0x50bb('0x1a')](_0x17c158)[_0x50bb('0x2b')](_0x269479);};}exports[_0x50bb('0x2c')]=function(_0x560b07,_0x13dc3c){var _0x1a62fb={},_0xc38da5={},_0xb3c3ba={'count':0x0,'rows':[]};var _0x3fd5f6=_[_0x50bb('0x2d')](db[_0x50bb('0x2e')][_0x50bb('0x2f')],function(_0x5cfdd5){return{'name':_0x5cfdd5[_0x50bb('0x30')],'type':_0x5cfdd5[_0x50bb('0x31')][_0x50bb('0x32')]};});_0xc38da5['model']=_[_0x50bb('0x2d')](_0x3fd5f6,_0x50bb('0x2a'));_0xc38da5[_0x50bb('0x33')]=_[_0x50bb('0x34')](_0x560b07[_0x50bb('0x33')]);_0xc38da5[_0x50bb('0x35')]=_[_0x50bb('0x36')](_0xc38da5[_0x50bb('0x37')],_0xc38da5[_0x50bb('0x33')]);_0x1a62fb[_0x50bb('0x38')]=_[_0x50bb('0x36')](_0xc38da5['model'],qs[_0x50bb('0x39')](_0x560b07[_0x50bb('0x33')][_0x50bb('0x39')]));_0x1a62fb[_0x50bb('0x38')]=_0x1a62fb[_0x50bb('0x38')][_0x50bb('0x3a')]?_0x1a62fb['attributes']:_0xc38da5['model'];if(!_0x560b07[_0x50bb('0x33')]['hasOwnProperty'](_0x50bb('0x3b'))){_0x1a62fb[_0x50bb('0x3c')]=qs[_0x50bb('0x3c')](_0x560b07[_0x50bb('0x33')][_0x50bb('0x3c')]);_0x1a62fb['offset']=qs[_0x50bb('0x1c')](_0x560b07['query'][_0x50bb('0x1c')]);}_0x1a62fb[_0x50bb('0x3d')]=qs[_0x50bb('0x3e')](_0x560b07['query']['sort']);_0x1a62fb[_0x50bb('0x3f')]=qs[_0x50bb('0x35')](_[_0x50bb('0x40')](_0x560b07[_0x50bb('0x33')],_0xc38da5['filters']),_0x3fd5f6);if(_0x560b07[_0x50bb('0x33')]['filter']){_0x1a62fb['where']=_[_0x50bb('0x41')](_0x1a62fb['where'],{'$or':_[_0x50bb('0x2d')](_0x3fd5f6,function(_0x3d94b8){if(_0x3d94b8[_0x50bb('0x31')]!==_0x50bb('0x42')){var _0x3a9fe4={};_0x3a9fe4[_0x3d94b8[_0x50bb('0x2a')]]={'$like':'%'+_0x560b07[_0x50bb('0x33')][_0x50bb('0x43')]+'%'};return _0x3a9fe4;}})});}_0x1a62fb=_[_0x50bb('0x41')]({},_0x1a62fb,_0x560b07[_0x50bb('0x44')]);var _0x594f16={'where':_0x1a62fb['where']};return db[_0x50bb('0x2e')][_0x50bb('0x1e')](_0x594f16)[_0x50bb('0x24')](function(_0x1d929d){_0xb3c3ba['count']=_0x1d929d;if(_0x560b07[_0x50bb('0x33')]['includeAll']){_0x1a62fb[_0x50bb('0x45')]=[{'all':!![]}];}return db[_0x50bb('0x2e')][_0x50bb('0x46')](_0x1a62fb);})[_0x50bb('0x24')](function(_0x1c438b){_0xb3c3ba[_0x50bb('0x47')]=_0x1c438b;return _0xb3c3ba;})[_0x50bb('0x24')](respondWithFilteredResult(_0x13dc3c,_0x1a62fb))[_0x50bb('0x48')](handleError(_0x13dc3c,null));};exports[_0x50bb('0x49')]=function(_0x46c1c3,_0x349474){var _0x24e375={'raw':!![],'where':{'id':_0x46c1c3[_0x50bb('0x4a')]['id']}},_0x85b0ff={};_0x85b0ff[_0x50bb('0x37')]=_[_0x50bb('0x34')](db['VoiceMail'][_0x50bb('0x2f')]);_0x85b0ff['query']=_[_0x50bb('0x34')](_0x46c1c3[_0x50bb('0x33')]);_0x85b0ff[_0x50bb('0x35')]=_[_0x50bb('0x36')](_0x85b0ff[_0x50bb('0x37')],_0x85b0ff[_0x50bb('0x33')]);_0x24e375[_0x50bb('0x38')]=_[_0x50bb('0x36')](_0x85b0ff[_0x50bb('0x37')],qs[_0x50bb('0x39')](_0x46c1c3[_0x50bb('0x33')][_0x50bb('0x39')]));_0x24e375[_0x50bb('0x38')]=_0x24e375[_0x50bb('0x38')]['length']?_0x24e375[_0x50bb('0x38')]:_0x85b0ff['model'];if(_0x46c1c3[_0x50bb('0x33')][_0x50bb('0x4b')]){_0x24e375[_0x50bb('0x45')]=[{'all':!![]}];}_0x24e375=_[_0x50bb('0x41')]({},_0x24e375,_0x46c1c3[_0x50bb('0x44')]);return db[_0x50bb('0x2e')][_0x50bb('0x4c')](_0x24e375)[_0x50bb('0x24')](handleEntityNotFound(_0x349474,null))['then'](respondWithResult(_0x349474,null))[_0x50bb('0x48')](handleError(_0x349474,null));};exports[_0x50bb('0x4d')]=function(_0xf52a22,_0x13afe2){return db[_0x50bb('0x2e')]['create'](_0xf52a22[_0x50bb('0x4e')],{})[_0x50bb('0x24')](function(_0x2a411d){var _0x154ff8=_0xf52a22[_0x50bb('0x4f')]['get']({'plain':!![]});if(!_0x154ff8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x154ff8[_0x50bb('0x50')]==='user'){var _0x357d08=_0x2a411d['get']({'plain':!![]});var _0x4316e4=_0x50bb('0x27');return db[_0x50bb('0x51')]['find']({'where':{'name':_0x4316e4,'userProfileId':_0x154ff8[_0x50bb('0x52')]},'raw':!![]})[_0x50bb('0x24')](function(_0x588dfe){if(_0x588dfe&&_0x588dfe[_0x50bb('0x53')]===0x0){return db[_0x50bb('0x54')][_0x50bb('0x4d')]({'name':_0x357d08[_0x50bb('0x2a')],'resourceId':_0x357d08['id'],'type':_0x588dfe['name'],'sectionId':_0x588dfe['id']},{})[_0x50bb('0x24')](function(){return _0x2a411d;});}else{return _0x2a411d;}})[_0x50bb('0x48')](function(_0x2e0032){logger[_0x50bb('0x28')](_0x50bb('0x55'),_0x2e0032);throw _0x2e0032;});}return _0x2a411d;})['then'](respondWithResult(_0x13afe2,0xc9))[_0x50bb('0x48')](handleError(_0x13afe2,null));};exports['update']=function(_0x38a775,_0x50216f){if(_0x38a775['body']['id']){delete _0x38a775[_0x50bb('0x4e')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x38a775[_0x50bb('0x4a')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x50216f,null))[_0x50bb('0x24')](saveUpdates(_0x38a775[_0x50bb('0x4e')],null))[_0x50bb('0x24')](respondWithResult(_0x50216f,null))[_0x50bb('0x48')](handleError(_0x50216f,null));};exports[_0x50bb('0x25')]=function(_0x1408fa,_0x57d749){return db['VoiceMail'][_0x50bb('0x4c')]({'where':{'id':_0x1408fa[_0x50bb('0x4a')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x57d749,null))[_0x50bb('0x24')](removeEntity(_0x57d749,null))[_0x50bb('0x48')](handleError(_0x57d749,null));};exports[_0x50bb('0x56')]=function(_0x287bc7,_0x4bf426,_0x3be83b){return db[_0x50bb('0x2e')][_0x50bb('0x57')]({'where':{'id':_0x287bc7[_0x50bb('0x4a')]['id']}})[_0x50bb('0x24')](handleEntityNotFound(_0x4bf426,null))['then'](function(_0x33ebe6){var _0x1d8b85;var _0x1da5cd={},_0x507f26={};_0x507f26[_0x50bb('0x37')]=_['keys'](db[_0x50bb('0x58')]['rawAttributes']);_0x507f26['query']=_[_0x50bb('0x34')](_0x287bc7[_0x50bb('0x33')]);_0x507f26[_0x50bb('0x35')]=_[_0x50bb('0x36')](_0x507f26[_0x50bb('0x37')],_0x507f26[_0x50bb('0x33')]);_0x1da5cd[_0x50bb('0x38')]=_[_0x50bb('0x36')](_0x507f26[_0x50bb('0x37')],qs[_0x50bb('0x39')](_0x287bc7[_0x50bb('0x33')]['fields']));_0x1da5cd[_0x50bb('0x38')]=_0x1da5cd['attributes'][_0x50bb('0x3a')]?_0x1da5cd[_0x50bb('0x38')]:_0x507f26['model'];if(!_0x287bc7[_0x50bb('0x33')][_0x50bb('0x59')](_0x50bb('0x3b'))){_0x1da5cd[_0x50bb('0x3c')]=qs[_0x50bb('0x3c')](_0x287bc7[_0x50bb('0x33')][_0x50bb('0x3c')]);_0x1da5cd[_0x50bb('0x1c')]=qs['offset'](_0x287bc7[_0x50bb('0x33')][_0x50bb('0x1c')]);}_0x1da5cd[_0x50bb('0x3d')]=qs['sort'](_0x287bc7[_0x50bb('0x33')][_0x50bb('0x3e')]);_0x1da5cd[_0x50bb('0x3f')]=qs[_0x50bb('0x35')](_[_0x50bb('0x40')](_0x287bc7[_0x50bb('0x33')],_0x507f26['filters']));if(_0x287bc7[_0x50bb('0x33')][_0x50bb('0x43')]){_0x1da5cd[_0x50bb('0x3f')]=_[_0x50bb('0x41')](_0x1da5cd[_0x50bb('0x3f')],{'$or':_[_0x50bb('0x2d')](_0x1da5cd['attributes'],function(_0x40257b){var _0xa85833={};_0xa85833[_0x40257b]={'$like':'%'+_0x287bc7[_0x50bb('0x33')][_0x50bb('0x43')]+'%'};return _0xa85833;})});}_0x1da5cd[_0x50bb('0x3f')]=_[_0x50bb('0x41')](_0x1da5cd[_0x50bb('0x3f')],{'mailboxuser':_0x33ebe6[_0x50bb('0x5a')]});_0x1da5cd=_[_0x50bb('0x41')]({},_0x1da5cd,_0x287bc7['options']);return db[_0x50bb('0x58')][_0x50bb('0x5b')](_0x1da5cd)[_0x50bb('0x24')](respondWithFilteredResult(_0x4bf426,_0x1da5cd));})[_0x50bb('0x48')](handleError(_0x4bf426,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 2a5e0fe..fd550b4 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 _0xf338=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox','context'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0xf338,0xc3));var _0x8f33=function(_0x1a458a,_0x4b141d){_0x1a458a=_0x1a458a-0x0;var _0x39a3dd=_0xf338[_0x1a458a];return _0x39a3dd;};'use strict';var _=require(_0x8f33('0x0'));var util=require(_0x8f33('0x1'));var logger=require(_0x8f33('0x2'))(_0x8f33('0x3'));var moment=require(_0x8f33('0x4'));var BPromise=require(_0x8f33('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f33('0x6'));var rimraf=require(_0x8f33('0x7'));var config=require(_0x8f33('0x8'));var attributes=require(_0x8f33('0x9'));module[_0x8f33('0xa')]=function(_0x33b579,_0x2198bf){return _0x33b579['define'](_0x8f33('0xb'),attributes,{'tableName':_0x8f33('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x8f33('0xd'),_0x8f33('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x86ac=['util','moment','request-promise','../../config/environment','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x86ac,0x78));var _0xc86a=function(_0x2e43f6,_0x5bb9db){_0x2e43f6=_0x2e43f6-0x0;var _0xff88fa=_0x86ac[_0x2e43f6];return _0xff88fa;};'use strict';var _=require(_0xc86a('0x0'));var util=require(_0xc86a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc86a('0x2'));var BPromise=require('bluebird');var rp=require(_0xc86a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc86a('0x4'));var attributes=require('./voiceMail.attributes');module[_0xc86a('0x5')]=function(_0x361713,_0x393129){return _0x361713[_0xc86a('0x6')](_0xc86a('0x7'),attributes,{'tableName':_0xc86a('0x8'),'paranoid':![],'indexes':[{'name':_0xc86a('0x9'),'fields':[_0xc86a('0xa'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 96b198e..866c28c 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 _0x4451=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1e7137,_0x566ac9){var _0x536c0a=function(_0x2d8e6b){while(--_0x2d8e6b){_0x1e7137['push'](_0x1e7137['shift']());}};_0x536c0a(++_0x566ac9);}(_0x4451,0x15e));var _0x1445=function(_0x2600ee,_0x2073fd){_0x2600ee=_0x2600ee-0x0;var _0x2f9049=_0x4451[_0x2600ee];return _0x2f9049;};'use strict';var _=require(_0x1445('0x0'));var util=require(_0x1445('0x1'));var moment=require(_0x1445('0x2'));var BPromise=require(_0x1445('0x3'));var rs=require(_0x1445('0x4'));var fs=require('fs');var Redis=require(_0x1445('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1445('0x6'));var logger=require(_0x1445('0x7'))(_0x1445('0x8'));var config=require(_0x1445('0x9'));var jayson=require(_0x1445('0xa'));var client=jayson[_0x1445('0xb')][_0x1445('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3fb1ad,_0x36ec88,_0x38238c){return new BPromise(function(_0x41d720,_0x250900){return client[_0x1445('0xd')](_0x3fb1ad,_0x38238c)[_0x1445('0xe')](function(_0x175b0e){logger[_0x1445('0xf')](_0x1445('0x10'),_0x36ec88,_0x1445('0x11'));logger['debug'](_0x1445('0x12'),_0x36ec88,_0x1445('0x11'),JSON[_0x1445('0x13')](_0x175b0e));if(_0x175b0e[_0x1445('0x14')]){if(_0x175b0e[_0x1445('0x14')][_0x1445('0x15')]===0x1f4){logger[_0x1445('0x14')](_0x1445('0x10'),_0x36ec88,_0x175b0e[_0x1445('0x14')][_0x1445('0x16')]);return _0x250900(_0x175b0e[_0x1445('0x14')]['message']);}logger['error'](_0x1445('0x10'),_0x36ec88,_0x175b0e[_0x1445('0x14')][_0x1445('0x16')]);return _0x41d720(_0x175b0e[_0x1445('0x14')]['message']);}else{logger[_0x1445('0xf')](_0x1445('0x10'),_0x36ec88,'request\x20sent');_0x41d720(_0x175b0e[_0x1445('0x17')][_0x1445('0x16')]);}})[_0x1445('0x18')](function(_0x2cc0d3){logger[_0x1445('0x14')](_0x1445('0x10'),_0x36ec88,_0x2cc0d3);_0x250900(_0x2cc0d3);});});} \ No newline at end of file +var _0xd3c7=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x241ac3,_0x310f15){var _0x487476=function(_0x1131f4){while(--_0x1131f4){_0x241ac3['push'](_0x241ac3['shift']());}};_0x487476(++_0x310f15);}(_0xd3c7,0x190));var _0x7d3c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd3c7[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x7d3c('0x0'));var moment=require(_0x7d3c('0x1'));var BPromise=require(_0x7d3c('0x2'));var rs=require(_0x7d3c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d3c('0x4'))['db'];var utils=require(_0x7d3c('0x5'));var logger=require(_0x7d3c('0x6'))(_0x7d3c('0x7'));var config=require(_0x7d3c('0x8'));var jayson=require(_0x7d3c('0x9'));var client=jayson[_0x7d3c('0xa')][_0x7d3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fbde4,_0x3799f1,_0x2e97ce){return new BPromise(function(_0x4cd1e6,_0x475163){return client[_0x7d3c('0xc')](_0x4fbde4,_0x2e97ce)[_0x7d3c('0xd')](function(_0x119075){logger[_0x7d3c('0xe')](_0x7d3c('0xf'),_0x3799f1,'request\x20sent');logger[_0x7d3c('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x3799f1,'request\x20sent',JSON[_0x7d3c('0x11')](_0x119075));if(_0x119075[_0x7d3c('0x12')]){if(_0x119075[_0x7d3c('0x12')][_0x7d3c('0x13')]===0x1f4){logger[_0x7d3c('0x12')](_0x7d3c('0xf'),_0x3799f1,_0x119075[_0x7d3c('0x12')][_0x7d3c('0x14')]);return _0x475163(_0x119075[_0x7d3c('0x12')][_0x7d3c('0x14')]);}logger[_0x7d3c('0x12')]('VoiceMail,\x20%s,\x20%s',_0x3799f1,_0x119075['error'][_0x7d3c('0x14')]);return _0x4cd1e6(_0x119075[_0x7d3c('0x12')][_0x7d3c('0x14')]);}else{logger[_0x7d3c('0xe')](_0x7d3c('0xf'),_0x3799f1,_0x7d3c('0x15'));_0x4cd1e6(_0x119075[_0x7d3c('0x16')][_0x7d3c('0x14')]);}})[_0x7d3c('0x17')](function(_0x33eb58){logger[_0x7d3c('0x12')]('VoiceMail,\x20%s,\x20%s',_0x3799f1,_0x33eb58);_0x475163(_0x33eb58);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 57bb121..dc1ae6d 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 _0x8ac2=['index','/:id','isAuthenticated','/:id/download','post','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x8ac2,0x14d));var _0x28ac=function(_0x73740d,_0x483311){_0x73740d=_0x73740d-0x0;var _0x3e2fb4=_0x8ac2[_0x73740d];return _0x3e2fb4;};'use strict';var multer=require(_0x28ac('0x0'));var util=require(_0x28ac('0x1'));var path=require(_0x28ac('0x2'));var timeout=require(_0x28ac('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x28ac('0x4'));var interaction=require(_0x28ac('0x5'));var config=require(_0x28ac('0x6'));var controller=require(_0x28ac('0x7'));router[_0x28ac('0x8')]('/',auth['isAuthenticated'](),controller[_0x28ac('0x9')]);router[_0x28ac('0x8')](_0x28ac('0xa'),auth[_0x28ac('0xb')](),controller['show']);router['get'](_0x28ac('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x28ac('0xd')]('/',auth[_0x28ac('0xb')](),controller['create']);router[_0x28ac('0xe')](_0x28ac('0xa'),auth[_0x28ac('0xb')](),controller[_0x28ac('0xf')]);router[_0x28ac('0x10')](_0x28ac('0xa'),auth[_0x28ac('0xb')](),controller['destroy']);module[_0x28ac('0x11')]=router; \ No newline at end of file +var _0xd1f9=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/download','download','post','create','put','update'];(function(_0x3fbf93,_0x297b11){var _0x5662c0=function(_0x3b789c){while(--_0x3b789c){_0x3fbf93['push'](_0x3fbf93['shift']());}};_0x5662c0(++_0x297b11);}(_0xd1f9,0xc9));var _0x9d1f=function(_0x2a8d0f,_0x42983b){_0x2a8d0f=_0x2a8d0f-0x0;var _0xf4cc50=_0xd1f9[_0x2a8d0f];return _0xf4cc50;};'use strict';var multer=require(_0x9d1f('0x0'));var util=require(_0x9d1f('0x1'));var path=require(_0x9d1f('0x2'));var timeout=require(_0x9d1f('0x3'));var express=require(_0x9d1f('0x4'));var router=express[_0x9d1f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9d1f('0x6'));var interaction=require(_0x9d1f('0x7'));var config=require(_0x9d1f('0x8'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0x9d1f('0x9')](),controller[_0x9d1f('0xa')]);router[_0x9d1f('0xb')](_0x9d1f('0xc'),auth[_0x9d1f('0x9')](),controller['show']);router[_0x9d1f('0xb')](_0x9d1f('0xd'),auth['isAuthenticated'](),controller[_0x9d1f('0xe')]);router[_0x9d1f('0xf')]('/',auth['isAuthenticated'](),controller[_0x9d1f('0x10')]);router[_0x9d1f('0x11')](_0x9d1f('0xc'),auth['isAuthenticated'](),controller[_0x9d1f('0x12')]);router[_0x9d1f('0x13')](_0x9d1f('0xc'),auth['isAuthenticated'](),controller[_0x9d1f('0x14')]);module[_0x9d1f('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index b992fcd..6da7c80 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 _0x32bb=['TIMESTAMP','literal','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x3f32ce,_0x44c8d7){var _0x5a3dc4=function(_0x3e0d18){while(--_0x3e0d18){_0x3f32ce['push'](_0x3f32ce['shift']());}};_0x5a3dc4(++_0x44c8d7);}(_0x32bb,0xdb));var _0xb32b=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x32bb[_0x16db8b];return _0x5ba017;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ba465){return this[_0xb32b('0x0')]('id');}},'msgnum':{'type':Sequelize[_0xb32b('0x1')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xb32b('0x3')](_0xb32b('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb32b('0x2')],'defaultValue':''},'stamp':{'type':_0xb32b('0x5'),'defaultValue':Sequelize[_0xb32b('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x435a=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP'];(function(_0x17f668,_0x47d4a2){var _0x3e314d=function(_0x2e0d26){while(--_0x2e0d26){_0x17f668['push'](_0x17f668['shift']());}};_0x3e314d(++_0x47d4a2);}(_0x435a,0x16a));var _0xa435=function(_0x45f8ae,_0x341d6b){_0x45f8ae=_0x45f8ae-0x0;var _0x489129=_0x435a[_0x45f8ae];return _0x489129;};'use strict';var Sequelize=require(_0xa435('0x0'));module[_0xa435('0x1')]={'name':{'type':Sequelize[_0xa435('0x2')],'get':function(_0x1528a5){return this[_0xa435('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xa435('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xa435('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa435('0x5')],'defaultValue':''},'stamp':{'type':_0xa435('0x7'),'defaultValue':Sequelize[_0xa435('0x8')](_0xa435('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 3c0d967..1486854 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 _0x878d=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','sendStatus','error','name','index','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','then','includeAll','include','findAll','catch','show','params','find','create','body','update','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','send','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x58494b,_0x192380){var _0xe5f7c8=function(_0x4600d4){while(--_0x4600d4){_0x58494b['push'](_0x58494b['shift']());}};_0xe5f7c8(++_0x192380);}(_0x878d,0x1f1));var _0xd878=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x878d[_0x2786ea];return _0x5c38e5;};'use strict';var emlformat=require(_0xd878('0x0'));var rimraf=require(_0xd878('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd878('0x2'));var rp=require(_0xd878('0x3'));var moment=require(_0xd878('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd878('0x5'));var util=require(_0xd878('0x6'));var path=require(_0xd878('0x7'));var sox=require(_0xd878('0x8'));var csv=require('to-csv');var ejs=require(_0xd878('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd878('0xa'));var crypto=require(_0xd878('0xb'));var jsforce=require(_0xd878('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd878('0xd'));var querystring=require(_0xd878('0xe'));var Papa=require(_0xd878('0xf'));var Redis=require(_0xd878('0x10'));var authService=require(_0xd878('0x11'));var qs=require(_0xd878('0x12'));var as=require(_0xd878('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd878('0x14'))(_0xd878('0x15'));var utils=require(_0xd878('0x16'));var config=require(_0xd878('0x17'));var licenseUtil=require(_0xd878('0x18'));var db=require(_0xd878('0x19'))['db'];function respondWithStatusCode(_0x1fa8c4,_0x158f7d){_0x158f7d=_0x158f7d||0xcc;return function(_0x234260){if(_0x234260){return _0x1fa8c4['sendStatus'](_0x158f7d);}return _0x1fa8c4[_0xd878('0x1a')](_0x158f7d)[_0xd878('0x1b')]();};}function respondWithResult(_0xb9c451,_0x2f863d){_0x2f863d=_0x2f863d||0xc8;return function(_0x326e8b){if(_0x326e8b){return _0xb9c451[_0xd878('0x1a')](_0x2f863d)[_0xd878('0x1c')](_0x326e8b);}};}function respondWithFilteredResult(_0x4317db,_0x311941){return function(_0x1471ac){if(_0x1471ac){var _0x1ccc25=typeof _0x311941[_0xd878('0x1d')]===_0xd878('0x1e')&&typeof _0x311941[_0xd878('0x1f')]===_0xd878('0x1e');var _0xac6fea=_0x1471ac[_0xd878('0x20')];var _0x1c6320=_0x1ccc25?0x0:_0x311941[_0xd878('0x1d')];var _0x331500=_0x1ccc25?_0x1471ac['count']:_0x311941[_0xd878('0x1d')]+_0x311941[_0xd878('0x1f')];var _0x19427b;if(_0x331500>=_0xac6fea){_0x331500=_0xac6fea;_0x19427b=0xc8;}else{_0x19427b=0xce;}_0x4317db[_0xd878('0x1a')](_0x19427b);return _0x4317db['set']('Content-Range',_0x1c6320+'-'+_0x331500+'/'+_0xac6fea)[_0xd878('0x1c')](_0x1471ac);}return null;};}function patchUpdates(_0x27d261){return function(_0x230f37){try{jsonpatch[_0xd878('0x21')](_0x230f37,_0x27d261,!![]);}catch(_0x5cb652){return BPromise[_0xd878('0x22')](_0x5cb652);}return _0x230f37[_0xd878('0x23')]();};}function saveUpdates(_0x97e43e,_0x340af0){return function(_0x1a7bb5){if(_0x1a7bb5){return _0x1a7bb5['update'](_0x97e43e)['then'](function(_0x365d30){return _0x365d30;});}return null;};}function removeEntity(_0xc7ce39,_0x4efcea){return function(_0x46d7b2){if(_0x46d7b2){return _0x46d7b2[_0xd878('0x24')]()['then'](function(){_0xc7ce39[_0xd878('0x1a')](0xcc)[_0xd878('0x1b')]();});}};}function handleEntityNotFound(_0x588566,_0x223434){return function(_0xab96b2){if(!_0xab96b2){_0x588566[_0xd878('0x25')](0x194);}return _0xab96b2;};}function handleError(_0x24d5d6,_0x3be823){_0x3be823=_0x3be823||0x1f4;return function(_0x10a630){logger[_0xd878('0x26')](_0x10a630['stack']);if(_0x10a630[_0xd878('0x27')]){delete _0x10a630[_0xd878('0x27')];}_0x24d5d6[_0xd878('0x1a')](_0x3be823)['send'](_0x10a630);};}exports[_0xd878('0x28')]=function(_0x472aef,_0xccf049){var _0x335d90={},_0xdeb304={},_0x174698={'count':0x0,'rows':[]};var _0xa6bc97=_['map'](db[_0xd878('0x29')][_0xd878('0x2a')],function(_0x359477){return{'name':_0x359477[_0xd878('0x2b')],'type':_0x359477['type'][_0xd878('0x2c')]};});_0xdeb304[_0xd878('0x2d')]=_[_0xd878('0x2e')](_[_0xd878('0x2f')](_0xa6bc97,_0xd878('0x27')),['name']);_0xdeb304[_0xd878('0x30')]=_[_0xd878('0x31')](_0x472aef[_0xd878('0x30')]);_0xdeb304[_0xd878('0x32')]=_[_0xd878('0x33')](_0xdeb304[_0xd878('0x2d')],_0xdeb304[_0xd878('0x30')]);_0x335d90[_0xd878('0x34')]=_[_0xd878('0x33')](_0xdeb304[_0xd878('0x2d')],qs[_0xd878('0x35')](_0x472aef['query'][_0xd878('0x35')]));_0x335d90[_0xd878('0x34')]=_0x335d90[_0xd878('0x34')][_0xd878('0x36')]?_0x335d90[_0xd878('0x34')]:_0xdeb304[_0xd878('0x2d')];if(!_0x472aef[_0xd878('0x30')][_0xd878('0x37')]('nolimit')){_0x335d90[_0xd878('0x1f')]=qs[_0xd878('0x1f')](_0x472aef[_0xd878('0x30')]['limit']);_0x335d90['offset']=qs['offset'](_0x472aef[_0xd878('0x30')][_0xd878('0x1d')]);}_0x335d90[_0xd878('0x38')]=qs[_0xd878('0x39')](_0x472aef[_0xd878('0x30')]['sort']);_0x335d90['where']=qs['filters'](_['pick'](_0x472aef[_0xd878('0x30')],_0xdeb304[_0xd878('0x32')]),_0xa6bc97);if(_0x472aef['query'][_0xd878('0x3a')]){_0x335d90[_0xd878('0x3b')]=_['merge'](_0x335d90[_0xd878('0x3b')],{'$or':_[_0xd878('0x2f')](_0xa6bc97,function(_0x5bbea8){if(_0x5bbea8[_0xd878('0x3c')]!==_0xd878('0x3d')){var _0x46d423={};_0x46d423[_0x5bbea8[_0xd878('0x27')]]={'$like':'%'+_0x472aef[_0xd878('0x30')][_0xd878('0x3a')]+'%'};return _0x46d423;}})});}_0x335d90=_[_0xd878('0x3e')]({},_0x335d90,_0x472aef['options']);var _0x14a6e9={'where':_0x335d90[_0xd878('0x3b')]};return db[_0xd878('0x29')][_0xd878('0x20')](_0x14a6e9)[_0xd878('0x3f')](function(_0x326617){_0x174698['count']=_0x326617;if(_0x472aef[_0xd878('0x30')][_0xd878('0x40')]){_0x335d90[_0xd878('0x41')]=[{'all':!![]}];}return db[_0xd878('0x29')][_0xd878('0x42')](_0x335d90);})[_0xd878('0x3f')](function(_0x2b1536){_0x174698['rows']=_0x2b1536;return _0x174698;})[_0xd878('0x3f')](respondWithFilteredResult(_0xccf049,_0x335d90))[_0xd878('0x43')](handleError(_0xccf049,null));};exports[_0xd878('0x44')]=function(_0x2b0fd8,_0x1697f1){var _0x47c25f={'raw':!![],'where':{'id':_0x2b0fd8[_0xd878('0x45')]['id']}},_0x21474a={};_0x21474a['model']=_['keys'](db[_0xd878('0x29')][_0xd878('0x2a')]);_0x21474a[_0xd878('0x30')]=_['keys'](_0x2b0fd8['query']);_0x21474a[_0xd878('0x32')]=_['intersection'](_0x21474a[_0xd878('0x2d')],_0x21474a[_0xd878('0x30')]);_0x47c25f[_0xd878('0x34')]=_[_0xd878('0x33')](_0x21474a[_0xd878('0x2d')],qs['fields'](_0x2b0fd8['query']['fields']));_0x47c25f[_0xd878('0x34')]=_0x47c25f['attributes'][_0xd878('0x36')]?_0x47c25f['attributes']:_0x21474a[_0xd878('0x2d')];if(_0x2b0fd8[_0xd878('0x30')][_0xd878('0x40')]){_0x47c25f[_0xd878('0x41')]=[{'all':!![]}];}_0x47c25f=_[_0xd878('0x3e')]({},_0x47c25f,_0x2b0fd8['options']);return db[_0xd878('0x29')][_0xd878('0x46')](_0x47c25f)[_0xd878('0x3f')](handleEntityNotFound(_0x1697f1,null))[_0xd878('0x3f')](respondWithResult(_0x1697f1,null))[_0xd878('0x43')](handleError(_0x1697f1,null));};exports[_0xd878('0x47')]=function(_0x2e474c,_0x4e1077){return db[_0xd878('0x29')][_0xd878('0x47')](_0x2e474c[_0xd878('0x48')],{})[_0xd878('0x3f')](respondWithResult(_0x4e1077,0xc9))[_0xd878('0x43')](handleError(_0x4e1077,null));};exports[_0xd878('0x49')]=function(_0x2968a4,_0x375aa3){if(_0x2968a4[_0xd878('0x48')]['id']){delete _0x2968a4[_0xd878('0x48')]['id'];}return db['VoiceMailMessage'][_0xd878('0x46')]({'where':{'id':_0x2968a4[_0xd878('0x45')]['id']}})[_0xd878('0x3f')](handleEntityNotFound(_0x375aa3,null))[_0xd878('0x3f')](saveUpdates(_0x2968a4['body'],null))[_0xd878('0x3f')](respondWithResult(_0x375aa3,null))[_0xd878('0x43')](handleError(_0x375aa3,null));};exports[_0xd878('0x24')]=function(_0x14cbae,_0x46a651){return db['VoiceMailMessage'][_0xd878('0x46')]({'where':{'id':_0x14cbae[_0xd878('0x45')]['id']}})['then'](handleEntityNotFound(_0x46a651,null))[_0xd878('0x3f')](removeEntity(_0x46a651,null))['catch'](handleError(_0x46a651,null));};exports[_0xd878('0x4a')]=function(_0x47a4a8,_0x45ab97,_0x1330b7){return db[_0xd878('0x29')]['find']({'where':{'id':_0x47a4a8['params']['id']},'attributes':['id',_0xd878('0x4b'),_0xd878('0x4c')]})[_0xd878('0x3f')](handleEntityNotFound(_0x45ab97,null))[_0xd878('0x3f')](function(_0xf8e292){if(_0xf8e292){if(!_0xf8e292['recording']){throw new db[(_0xd878('0x4d'))][(_0xd878('0x4e'))](_0xd878('0x4f'));}var _0x4d8b64={'Content-Type':_0xd878('0x50'),'Content-Disposition':'attachment'};if(_0xf8e292[_0xd878('0x4c')]){_0x4d8b64[_0xd878('0x51')]=_0xd878('0x52')+_0xf8e292[_0xd878('0x4c')]+_0xd878('0x53');}_0x45ab97[_0xd878('0x54')](_0x4d8b64);return _0x45ab97[_0xd878('0x55')](new Buffer(_0xf8e292[_0xd878('0x4b')]));}})[_0xd878('0x43')](handleError(_0x45ab97,null));}; \ No newline at end of file +var _0x3876=['include','findAll','rows','catch','show','params','find','create','body','update','download','recording','msg_id','ValidationError','attachment','attachment;\x20filename=\x22','eml-format','rimraf','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x2f2da3,_0x3d2ffd){var _0x5a973=function(_0x2d6af6){while(--_0x2d6af6){_0x2f2da3['push'](_0x2f2da3['shift']());}};_0x5a973(++_0x3d2ffd);}(_0x3876,0xb4));var _0x6387=function(_0x1e4afd,_0x17882e){_0x1e4afd=_0x1e4afd-0x0;var _0x1a7891=_0x3876[_0x1e4afd];return _0x1a7891;};'use strict';var emlformat=require(_0x6387('0x0'));var rimraf=require(_0x6387('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6387('0x2'));var moment=require(_0x6387('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6387('0x4'));var util=require('util');var path=require(_0x6387('0x5'));var sox=require('sox');var csv=require(_0x6387('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6387('0x7'));var _=require(_0x6387('0x8'));var squel=require('squel');var crypto=require(_0x6387('0x9'));var jsforce=require(_0x6387('0xa'));var deskjs=require(_0x6387('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6387('0xc'));var Papa=require(_0x6387('0xd'));var Redis=require(_0x6387('0xe'));var authService=require(_0x6387('0xf'));var qs=require(_0x6387('0x10'));var as=require(_0x6387('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6387('0x12'))('api');var utils=require(_0x6387('0x13'));var config=require(_0x6387('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6387('0x15'))['db'];function respondWithStatusCode(_0x3a5629,_0x28fe87){_0x28fe87=_0x28fe87||0xcc;return function(_0x2744b8){if(_0x2744b8){return _0x3a5629[_0x6387('0x16')](_0x28fe87);}return _0x3a5629['status'](_0x28fe87)[_0x6387('0x17')]();};}function respondWithResult(_0x31d3d9,_0x13b837){_0x13b837=_0x13b837||0xc8;return function(_0x10d1e3){if(_0x10d1e3){return _0x31d3d9[_0x6387('0x18')](_0x13b837)[_0x6387('0x19')](_0x10d1e3);}};}function respondWithFilteredResult(_0x3b22c4,_0x195c84){return function(_0x53b54c){if(_0x53b54c){var _0x1d929a=typeof _0x195c84[_0x6387('0x1a')]==='undefined'&&typeof _0x195c84[_0x6387('0x1b')]===_0x6387('0x1c');var _0x5a62a5=_0x53b54c[_0x6387('0x1d')];var _0x33c2c1=_0x1d929a?0x0:_0x195c84['offset'];var _0x588e35=_0x1d929a?_0x53b54c[_0x6387('0x1d')]:_0x195c84['offset']+_0x195c84[_0x6387('0x1b')];var _0x48f1fd;if(_0x588e35>=_0x5a62a5){_0x588e35=_0x5a62a5;_0x48f1fd=0xc8;}else{_0x48f1fd=0xce;}_0x3b22c4[_0x6387('0x18')](_0x48f1fd);return _0x3b22c4[_0x6387('0x1e')](_0x6387('0x1f'),_0x33c2c1+'-'+_0x588e35+'/'+_0x5a62a5)[_0x6387('0x19')](_0x53b54c);}return null;};}function patchUpdates(_0x48e571){return function(_0x4d839f){try{jsonpatch[_0x6387('0x20')](_0x4d839f,_0x48e571,!![]);}catch(_0xee475e){return BPromise['reject'](_0xee475e);}return _0x4d839f[_0x6387('0x21')]();};}function saveUpdates(_0x4267c4,_0x5dc4bc){return function(_0x146109){if(_0x146109){return _0x146109['update'](_0x4267c4)[_0x6387('0x22')](function(_0x530af2){return _0x530af2;});}return null;};}function removeEntity(_0x250b0d,_0x93bea1){return function(_0x31aff6){if(_0x31aff6){return _0x31aff6[_0x6387('0x23')]()[_0x6387('0x22')](function(){_0x250b0d[_0x6387('0x18')](0xcc)[_0x6387('0x17')]();});}};}function handleEntityNotFound(_0x116e6e,_0x4e405a){return function(_0x377592){if(!_0x377592){_0x116e6e[_0x6387('0x16')](0x194);}return _0x377592;};}function handleError(_0x4191a0,_0x1e901a){_0x1e901a=_0x1e901a||0x1f4;return function(_0x5ab01c){logger[_0x6387('0x24')](_0x5ab01c[_0x6387('0x25')]);if(_0x5ab01c[_0x6387('0x26')]){delete _0x5ab01c['name'];}_0x4191a0[_0x6387('0x18')](_0x1e901a)[_0x6387('0x27')](_0x5ab01c);};}exports[_0x6387('0x28')]=function(_0x40273c,_0x2cd6ee){var _0x32b697={},_0x2630b8={},_0x4af183={'count':0x0,'rows':[]};var _0x5c95ff=_[_0x6387('0x29')](db[_0x6387('0x2a')][_0x6387('0x2b')],function(_0x3daa12){return{'name':_0x3daa12[_0x6387('0x2c')],'type':_0x3daa12[_0x6387('0x2d')][_0x6387('0x2e')]};});_0x2630b8[_0x6387('0x2f')]=_[_0x6387('0x30')](_[_0x6387('0x29')](_0x5c95ff,'name'),['name']);_0x2630b8[_0x6387('0x31')]=_[_0x6387('0x32')](_0x40273c[_0x6387('0x31')]);_0x2630b8['filters']=_[_0x6387('0x33')](_0x2630b8[_0x6387('0x2f')],_0x2630b8[_0x6387('0x31')]);_0x32b697[_0x6387('0x34')]=_[_0x6387('0x33')](_0x2630b8[_0x6387('0x2f')],qs[_0x6387('0x35')](_0x40273c[_0x6387('0x31')][_0x6387('0x35')]));_0x32b697['attributes']=_0x32b697[_0x6387('0x34')][_0x6387('0x36')]?_0x32b697[_0x6387('0x34')]:_0x2630b8[_0x6387('0x2f')];if(!_0x40273c['query']['hasOwnProperty'](_0x6387('0x37'))){_0x32b697['limit']=qs['limit'](_0x40273c[_0x6387('0x31')][_0x6387('0x1b')]);_0x32b697[_0x6387('0x1a')]=qs['offset'](_0x40273c[_0x6387('0x31')][_0x6387('0x1a')]);}_0x32b697[_0x6387('0x38')]=qs[_0x6387('0x39')](_0x40273c['query'][_0x6387('0x39')]);_0x32b697['where']=qs[_0x6387('0x3a')](_[_0x6387('0x3b')](_0x40273c[_0x6387('0x31')],_0x2630b8[_0x6387('0x3a')]),_0x5c95ff);if(_0x40273c[_0x6387('0x31')][_0x6387('0x3c')]){_0x32b697[_0x6387('0x3d')]=_[_0x6387('0x3e')](_0x32b697[_0x6387('0x3d')],{'$or':_[_0x6387('0x29')](_0x5c95ff,function(_0x5c265d){if(_0x5c265d['type']!==_0x6387('0x3f')){var _0x4e5735={};_0x4e5735[_0x5c265d[_0x6387('0x26')]]={'$like':'%'+_0x40273c[_0x6387('0x31')][_0x6387('0x3c')]+'%'};return _0x4e5735;}})});}_0x32b697=_[_0x6387('0x3e')]({},_0x32b697,_0x40273c[_0x6387('0x40')]);var _0x14671a={'where':_0x32b697[_0x6387('0x3d')]};return db['VoiceMailMessage'][_0x6387('0x1d')](_0x14671a)['then'](function(_0x395e81){_0x4af183[_0x6387('0x1d')]=_0x395e81;if(_0x40273c['query'][_0x6387('0x41')]){_0x32b697[_0x6387('0x42')]=[{'all':!![]}];}return db[_0x6387('0x2a')][_0x6387('0x43')](_0x32b697);})[_0x6387('0x22')](function(_0x4ef294){_0x4af183[_0x6387('0x44')]=_0x4ef294;return _0x4af183;})['then'](respondWithFilteredResult(_0x2cd6ee,_0x32b697))[_0x6387('0x45')](handleError(_0x2cd6ee,null));};exports[_0x6387('0x46')]=function(_0x20292a,_0x2e2db5){var _0x24beea={'raw':!![],'where':{'id':_0x20292a[_0x6387('0x47')]['id']}},_0x7423f1={};_0x7423f1[_0x6387('0x2f')]=_[_0x6387('0x32')](db[_0x6387('0x2a')][_0x6387('0x2b')]);_0x7423f1[_0x6387('0x31')]=_[_0x6387('0x32')](_0x20292a[_0x6387('0x31')]);_0x7423f1[_0x6387('0x3a')]=_['intersection'](_0x7423f1[_0x6387('0x2f')],_0x7423f1['query']);_0x24beea[_0x6387('0x34')]=_[_0x6387('0x33')](_0x7423f1[_0x6387('0x2f')],qs['fields'](_0x20292a[_0x6387('0x31')]['fields']));_0x24beea['attributes']=_0x24beea['attributes'][_0x6387('0x36')]?_0x24beea[_0x6387('0x34')]:_0x7423f1[_0x6387('0x2f')];if(_0x20292a['query'][_0x6387('0x41')]){_0x24beea['include']=[{'all':!![]}];}_0x24beea=_[_0x6387('0x3e')]({},_0x24beea,_0x20292a[_0x6387('0x40')]);return db[_0x6387('0x2a')][_0x6387('0x48')](_0x24beea)[_0x6387('0x22')](handleEntityNotFound(_0x2e2db5,null))[_0x6387('0x22')](respondWithResult(_0x2e2db5,null))[_0x6387('0x45')](handleError(_0x2e2db5,null));};exports[_0x6387('0x49')]=function(_0x97692e,_0x3997af){return db[_0x6387('0x2a')]['create'](_0x97692e[_0x6387('0x4a')],{})[_0x6387('0x22')](respondWithResult(_0x3997af,0xc9))[_0x6387('0x45')](handleError(_0x3997af,null));};exports[_0x6387('0x4b')]=function(_0x1858c9,_0xe240e0){if(_0x1858c9[_0x6387('0x4a')]['id']){delete _0x1858c9[_0x6387('0x4a')]['id'];}return db[_0x6387('0x2a')][_0x6387('0x48')]({'where':{'id':_0x1858c9[_0x6387('0x47')]['id']}})[_0x6387('0x22')](handleEntityNotFound(_0xe240e0,null))['then'](saveUpdates(_0x1858c9[_0x6387('0x4a')],null))[_0x6387('0x22')](respondWithResult(_0xe240e0,null))[_0x6387('0x45')](handleError(_0xe240e0,null));};exports[_0x6387('0x23')]=function(_0x227b2e,_0x2dfc5f){return db['VoiceMailMessage'][_0x6387('0x48')]({'where':{'id':_0x227b2e[_0x6387('0x47')]['id']}})[_0x6387('0x22')](handleEntityNotFound(_0x2dfc5f,null))[_0x6387('0x22')](removeEntity(_0x2dfc5f,null))['catch'](handleError(_0x2dfc5f,null));};exports[_0x6387('0x4c')]=function(_0x4a2153,_0x2d3222,_0x30e42d){return db[_0x6387('0x2a')][_0x6387('0x48')]({'where':{'id':_0x4a2153[_0x6387('0x47')]['id']},'attributes':['id',_0x6387('0x4d'),_0x6387('0x4e')]})[_0x6387('0x22')](handleEntityNotFound(_0x2d3222,null))[_0x6387('0x22')](function(_0x595ac8){if(_0x595ac8){if(!_0x595ac8['recording']){throw new db['Sequelize'][(_0x6387('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x54602a={'Content-Type':'audio/wav','Content-Disposition':_0x6387('0x50')};if(_0x595ac8['msg_id']){_0x54602a['Content-Disposition']=_0x6387('0x51')+_0x595ac8[_0x6387('0x4e')]+'.wav\x22';}_0x2d3222[_0x6387('0x1e')](_0x54602a);return _0x2d3222[_0x6387('0x27')](new Buffer(_0x595ac8[_0x6387('0x4d')]));}})[_0x6387('0x45')](handleError(_0x2d3222,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index b39531c..5ace7f9 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 _0xe8a3=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','VoiceMailMessage','dir'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0xe8a3,0x1cb));var _0x3e8a=function(_0x5c4f56,_0x3c12ad){_0x5c4f56=_0x5c4f56-0x0;var _0x4d917a=_0xe8a3[_0x5c4f56];return _0x4d917a;};'use strict';var _=require('lodash');var util=require(_0x3e8a('0x0'));var logger=require(_0x3e8a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3e8a('0x2'));var rp=require(_0x3e8a('0x3'));var fs=require('fs');var path=require(_0x3e8a('0x4'));var rimraf=require('rimraf');var config=require(_0x3e8a('0x5'));var attributes=require('./voiceMailMessage.attributes');module[_0x3e8a('0x6')]=function(_0x57ad5c,_0x175901){return _0x57ad5c['define'](_0x3e8a('0x7'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x3e8a('0x8'),'fields':[_0x3e8a('0x8')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3eeb=['voice_voicemail_messages','dir','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x421592,_0x615ee8){var _0x31efaf=function(_0x57919a){while(--_0x57919a){_0x421592['push'](_0x421592['shift']());}};_0x31efaf(++_0x615ee8);}(_0x3eeb,0x16e));var _0xb3ee=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3eeb[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xb3ee('0x0'));var logger=require('../../config/logger')(_0xb3ee('0x1'));var moment=require(_0xb3ee('0x2'));var BPromise=require(_0xb3ee('0x3'));var rp=require(_0xb3ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb3ee('0x5'));var config=require(_0xb3ee('0x6'));var attributes=require(_0xb3ee('0x7'));module[_0xb3ee('0x8')]=function(_0x5e5464,_0x4f1194){return _0x5e5464[_0xb3ee('0x9')](_0xb3ee('0xa'),attributes,{'tableName':_0xb3ee('0xb'),'paranoid':![],'indexes':[{'name':_0xb3ee('0xc'),'fields':[_0xb3ee('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index f2dddde..cf006b1 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 _0x6b0e=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x6b0e,0x1ba));var _0xe6b0=function(_0xcda34d,_0x2e196f){_0xcda34d=_0xcda34d-0x0;var _0x4bc776=_0x6b0e[_0xcda34d];return _0x4bc776;};'use strict';var _=require('lodash');var util=require(_0xe6b0('0x0'));var moment=require(_0xe6b0('0x1'));var BPromise=require(_0xe6b0('0x2'));var rs=require(_0xe6b0('0x3'));var fs=require('fs');var Redis=require(_0xe6b0('0x4'));var db=require(_0xe6b0('0x5'))['db'];var utils=require(_0xe6b0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe6b0('0x7'));var jayson=require(_0xe6b0('0x8'));var client=jayson[_0xe6b0('0x9')][_0xe6b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f419c,_0x2fccfb,_0x3f7891){return new BPromise(function(_0x57dcd1,_0xc0c58d){return client['request'](_0x1f419c,_0x3f7891)[_0xe6b0('0xb')](function(_0x28a6d6){logger[_0xe6b0('0xc')](_0xe6b0('0xd'),_0x2fccfb,_0xe6b0('0xe'));logger[_0xe6b0('0xf')](_0xe6b0('0x10'),_0x2fccfb,_0xe6b0('0xe'),JSON['stringify'](_0x28a6d6));if(_0x28a6d6[_0xe6b0('0x11')]){if(_0x28a6d6['error']['code']===0x1f4){logger['error'](_0xe6b0('0xd'),_0x2fccfb,_0x28a6d6['error'][_0xe6b0('0x12')]);return _0xc0c58d(_0x28a6d6[_0xe6b0('0x11')][_0xe6b0('0x12')]);}logger[_0xe6b0('0x11')](_0xe6b0('0xd'),_0x2fccfb,_0x28a6d6[_0xe6b0('0x11')][_0xe6b0('0x12')]);return _0x57dcd1(_0x28a6d6['error']['message']);}else{logger[_0xe6b0('0xc')](_0xe6b0('0xd'),_0x2fccfb,_0xe6b0('0xe'));_0x57dcd1(_0x28a6d6[_0xe6b0('0x13')][_0xe6b0('0x12')]);}})[_0xe6b0('0x14')](function(_0x25b971){logger[_0xe6b0('0x11')](_0xe6b0('0xd'),_0x2fccfb,_0x25b971);_0xc0c58d(_0x25b971);});});} \ No newline at end of file +var _0x4232=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2087f7,_0x1b0ffe){var _0x309a92=function(_0x4abb26){while(--_0x4abb26){_0x2087f7['push'](_0x2087f7['shift']());}};_0x309a92(++_0x1b0ffe);}(_0x4232,0x17a));var _0x2423=function(_0x1df170,_0x5b9a15){_0x1df170=_0x1df170-0x0;var _0x38d4df=_0x4232[_0x1df170];return _0x38d4df;};'use strict';var _=require(_0x2423('0x0'));var util=require(_0x2423('0x1'));var moment=require(_0x2423('0x2'));var BPromise=require(_0x2423('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2423('0x4'));var db=require(_0x2423('0x5'))['db'];var utils=require(_0x2423('0x6'));var logger=require(_0x2423('0x7'))(_0x2423('0x8'));var config=require('../../config/environment');var jayson=require(_0x2423('0x9'));var client=jayson[_0x2423('0xa')][_0x2423('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52360d,_0x4db946,_0x5a8e52){return new BPromise(function(_0x38e4d7,_0x5e6672){return client[_0x2423('0xc')](_0x52360d,_0x5a8e52)[_0x2423('0xd')](function(_0x4b3e01){logger[_0x2423('0xe')](_0x2423('0xf'),_0x4db946,'request\x20sent');logger['debug'](_0x2423('0x10'),_0x4db946,'request\x20sent',JSON[_0x2423('0x11')](_0x4b3e01));if(_0x4b3e01[_0x2423('0x12')]){if(_0x4b3e01[_0x2423('0x12')][_0x2423('0x13')]===0x1f4){logger[_0x2423('0x12')](_0x2423('0xf'),_0x4db946,_0x4b3e01['error'][_0x2423('0x14')]);return _0x5e6672(_0x4b3e01['error'][_0x2423('0x14')]);}logger[_0x2423('0x12')](_0x2423('0xf'),_0x4db946,_0x4b3e01['error'][_0x2423('0x14')]);return _0x38e4d7(_0x4b3e01[_0x2423('0x12')]['message']);}else{logger[_0x2423('0xe')](_0x2423('0xf'),_0x4db946,_0x2423('0x15'));_0x38e4d7(_0x4b3e01[_0x2423('0x16')][_0x2423('0x14')]);}})[_0x2423('0x17')](function(_0x18f077){logger['error'](_0x2423('0xf'),_0x4db946,_0x18f077);_0x5e6672(_0x18f077);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 27435bd..99eaeca 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 _0x757a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/sounds','getSounds','create','post','isAuthenticated','update','delete','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express'];(function(_0x32a74e,_0x5b3443){var _0x1aad7d=function(_0x3c29bc){while(--_0x3c29bc){_0x32a74e['push'](_0x32a74e['shift']());}};_0x1aad7d(++_0x5b3443);}(_0x757a,0xee));var _0xa757=function(_0x210b20,_0x17be34){_0x210b20=_0x210b20-0x0;var _0x372951=_0x757a[_0x210b20];return _0x372951;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require(_0xa757('0x2'));var express=require(_0xa757('0x3'));var router=express[_0xa757('0x4')]();var fs_extra=require(_0xa757('0x5'));var auth=require(_0xa757('0x6'));var interaction=require(_0xa757('0x7'));var config=require(_0xa757('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0xa757('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa757('0x9')](_0xa757('0xa'),auth['isAuthenticated'](),controller[_0xa757('0xb')]);router[_0xa757('0x9')](_0xa757('0xc'),auth['isAuthenticated'](),controller[_0xa757('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xc'),auth[_0xa757('0x10')](),controller['addSound']);router['put'](_0xa757('0xa'),auth[_0xa757('0x10')](),controller[_0xa757('0x11')]);router[_0xa757('0x12')](_0xa757('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xa757('0x12')](_0xa757('0x13'),auth[_0xa757('0x10')](),controller[_0xa757('0x14')]);module[_0xa757('0x15')]=router; \ No newline at end of file +var _0xd5f4=['connect-timeout','express','fs-extra','../../components/auth/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','post','addSound','put','/:id','update','delete','/:id/sounds/:id2','removeSound','exports','multer','path'];(function(_0x3e1dfd,_0x3b2cf3){var _0x5e1e83=function(_0x6dc8f5){while(--_0x6dc8f5){_0x3e1dfd['push'](_0x3e1dfd['shift']());}};_0x5e1e83(++_0x3b2cf3);}(_0xd5f4,0x9e));var _0x4d5f=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd5f4[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0x4d5f('0x0'));var util=require('util');var path=require(_0x4d5f('0x1'));var timeout=require(_0x4d5f('0x2'));var express=require(_0x4d5f('0x3'));var router=express['Router']();var fs_extra=require(_0x4d5f('0x4'));var auth=require(_0x4d5f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4d5f('0x6'));router[_0x4d5f('0x7')]('/',auth[_0x4d5f('0x8')](),controller[_0x4d5f('0x9')]);router[_0x4d5f('0x7')]('/:id',auth[_0x4d5f('0x8')](),controller[_0x4d5f('0xa')]);router['get']('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router[_0x4d5f('0xb')]('/',auth[_0x4d5f('0x8')](),controller['create']);router[_0x4d5f('0xb')]('/:id/sounds',auth[_0x4d5f('0x8')](),controller[_0x4d5f('0xc')]);router[_0x4d5f('0xd')](_0x4d5f('0xe'),auth[_0x4d5f('0x8')](),controller[_0x4d5f('0xf')]);router[_0x4d5f('0x10')](_0x4d5f('0xe'),auth[_0x4d5f('0x8')](),controller['destroy']);router[_0x4d5f('0x10')](_0x4d5f('0x11'),auth[_0x4d5f('0x8')](),controller[_0x4d5f('0x12')]);module[_0x4d5f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 1a6fd1f..e62b991 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 _0xadd2=['files','STRING','alpha','BOOLEAN','exports','name','ENUM','quietmp3nb','quietmp3','mp3'];(function(_0x374af3,_0x7ed8f1){var _0x1dc982=function(_0x530538){while(--_0x530538){_0x374af3['push'](_0x374af3['shift']());}};_0x1dc982(++_0x7ed8f1);}(_0xadd2,0x9a));var _0x2add=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xadd2[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x2add('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2add('0x1')},'mode':{'type':Sequelize[_0x2add('0x2')]('custom','files','mp3nb',_0x2add('0x3'),_0x2add('0x4'),_0x2add('0x5')),'allowNull':!![],'defaultValue':_0x2add('0x6')},'directory':{'type':Sequelize[_0x2add('0x7')],'allowNull':!![]},'application':{'type':Sequelize[_0x2add('0x7')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2add('0x7')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2add('0x7')],'allowNull':!![],'defaultValue':_0x2add('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2add('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb358=['name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING'];(function(_0x4e1bb6,_0x26f900){var _0x9a5d9b=function(_0x5df370){while(--_0x5df370){_0x4e1bb6['push'](_0x4e1bb6['shift']());}};_0x9a5d9b(++_0x26f900);}(_0xb358,0xb3));var _0x8b35=function(_0x1616f3,_0x5a277f){_0x1616f3=_0x1616f3-0x0;var _0x4abaa1=_0xb358[_0x1616f3];return _0x4abaa1;};'use strict';var Sequelize=require(_0x8b35('0x0'));module[_0x8b35('0x1')]={'name':{'type':Sequelize[_0x8b35('0x2')],'allowNull':![],'unique':_0x8b35('0x3')},'mode':{'type':Sequelize[_0x8b35('0x4')](_0x8b35('0x5'),'files',_0x8b35('0x6'),_0x8b35('0x7'),_0x8b35('0x8'),_0x8b35('0x9')),'allowNull':!![],'defaultValue':_0x8b35('0xa')},'directory':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![],'defaultValue':_0x8b35('0xb')},'format':{'type':Sequelize[_0x8b35('0x2')],'allowNull':!![]},'stamp':{'type':_0x8b35('0xc')},'defaultEntry':{'type':Sequelize[_0x8b35('0xd')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 24a7841..c9cb939 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 _0xbf0d=['server/files/moh','symlinkSync','removeSound','sequelize','findOne','id2','unlinkSync','getSounds','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','count','status','apply','reject','update','then','destroy','get','end','error','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','intersection','options','body','find','create','transaction','mode','files','directory','mkdirSync','0777','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','join','server/files/sounds/converted','format','%s.%s','basename','extname','root'];(function(_0x2edd19,_0x27900c){var _0x527edb=function(_0x21fcfb){while(--_0x21fcfb){_0x2edd19['push'](_0x2edd19['shift']());}};_0x527edb(++_0x27900c);}(_0xbf0d,0x1c8));var _0xdbf0=function(_0xa1924e,_0x4a70ce){_0xa1924e=_0xa1924e-0x0;var _0x529341=_0xbf0d[_0xa1924e];return _0x529341;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdbf0('0x0'));var zipdir=require(_0xdbf0('0x1'));var jsonpatch=require(_0xdbf0('0x2'));var rp=require('request-promise');var moment=require(_0xdbf0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdbf0('0x4'));var util=require(_0xdbf0('0x5'));var path=require(_0xdbf0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdbf0('0x7'));var fs=require('fs');var fs_extra=require(_0xdbf0('0x8'));var _=require(_0xdbf0('0x9'));var squel=require(_0xdbf0('0xa'));var crypto=require(_0xdbf0('0xb'));var jsforce=require(_0xdbf0('0xc'));var deskjs=require(_0xdbf0('0xd'));var toCsv=require(_0xdbf0('0xe'));var querystring=require(_0xdbf0('0xf'));var Papa=require(_0xdbf0('0x10'));var Redis=require(_0xdbf0('0x11'));var authService=require(_0xdbf0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdbf0('0x13'));var hardwareService=require(_0xdbf0('0x14'));var logger=require(_0xdbf0('0x15'))('api');var utils=require(_0xdbf0('0x16'));var config=require(_0xdbf0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdbf0('0x18'))['db'];function respondWithStatusCode(_0x1fd489,_0x12fcb1){_0x12fcb1=_0x12fcb1||0xcc;return function(_0x1f1279){if(_0x1f1279){return _0x1fd489[_0xdbf0('0x19')](_0x12fcb1);}return _0x1fd489['status'](_0x12fcb1)['end']();};}function respondWithResult(_0x22449f,_0x224bb8){_0x224bb8=_0x224bb8||0xc8;return function(_0x209359){if(_0x209359){return _0x22449f['status'](_0x224bb8)[_0xdbf0('0x1a')](_0x209359);}};}function respondWithFilteredResult(_0x486c6b,_0x37b00d){return function(_0x14529b){if(_0x14529b){var _0x520c94=typeof _0x37b00d[_0xdbf0('0x1b')]===_0xdbf0('0x1c')&&typeof _0x37b00d['limit']===_0xdbf0('0x1c');var _0x1a5cfd=_0x14529b[_0xdbf0('0x1d')];var _0x62bba0=_0x520c94?0x0:_0x37b00d['offset'];var _0x41ca8b=_0x520c94?_0x14529b[_0xdbf0('0x1d')]:_0x37b00d[_0xdbf0('0x1b')]+_0x37b00d['limit'];var _0x1b988a;if(_0x41ca8b>=_0x1a5cfd){_0x41ca8b=_0x1a5cfd;_0x1b988a=0xc8;}else{_0x1b988a=0xce;}_0x486c6b[_0xdbf0('0x1e')](_0x1b988a);return _0x486c6b['set']('Content-Range',_0x62bba0+'-'+_0x41ca8b+'/'+_0x1a5cfd)['json'](_0x14529b);}return null;};}function patchUpdates(_0x24bfe9){return function(_0xdc837d){try{jsonpatch[_0xdbf0('0x1f')](_0xdc837d,_0x24bfe9,!![]);}catch(_0x47c6af){return BPromise[_0xdbf0('0x20')](_0x47c6af);}return _0xdc837d['save']();};}function saveUpdates(_0x54a0c2,_0x557ea1){return function(_0x29a1e9){if(_0x29a1e9){return _0x29a1e9[_0xdbf0('0x21')](_0x54a0c2)[_0xdbf0('0x22')](function(_0x4c2c27){return _0x4c2c27;});}return null;};}function removeEntity(_0x4f69b5,_0x443d6b){return function(_0x300fdb){if(_0x300fdb){return _0x300fdb[_0xdbf0('0x23')]()[_0xdbf0('0x22')](function(){var _0x34408f=_0x300fdb[_0xdbf0('0x24')]({'plain':!![]});var _0x265c3f='MusicOnHolds';return db['UserProfileResource'][_0xdbf0('0x23')]({'where':{'type':_0x265c3f,'resourceId':_0x34408f['id']}})[_0xdbf0('0x22')](function(){return _0x300fdb;});})[_0xdbf0('0x22')](function(){_0x4f69b5[_0xdbf0('0x1e')](0xcc)[_0xdbf0('0x25')]();});}};}function handleEntityNotFound(_0x487da8,_0xfe2553){return function(_0x2647ae){if(!_0x2647ae){_0x487da8[_0xdbf0('0x19')](0x194);}return _0x2647ae;};}function handleError(_0x494f00,_0x126b16){_0x126b16=_0x126b16||0x1f4;return function(_0x90abf5){logger[_0xdbf0('0x26')](_0x90abf5['stack']);if(_0x90abf5[_0xdbf0('0x27')]){delete _0x90abf5[_0xdbf0('0x27')];}_0x494f00['status'](_0x126b16)[_0xdbf0('0x28')](_0x90abf5);};}exports['index']=function(_0x3b9d29,_0x6ba583){var _0x5696b9={},_0x42d4c7={},_0x1a6458={'count':0x0,'rows':[]};var _0x2ec2f8=_['map'](db[_0xdbf0('0x29')][_0xdbf0('0x2a')],function(_0x3ee02e){return{'name':_0x3ee02e[_0xdbf0('0x2b')],'type':_0x3ee02e[_0xdbf0('0x2c')][_0xdbf0('0x2d')]};});_0x42d4c7[_0xdbf0('0x2e')]=_[_0xdbf0('0x2f')](_0x2ec2f8,'name');_0x42d4c7[_0xdbf0('0x30')]=_['keys'](_0x3b9d29[_0xdbf0('0x30')]);_0x42d4c7[_0xdbf0('0x31')]=_['intersection'](_0x42d4c7[_0xdbf0('0x2e')],_0x42d4c7[_0xdbf0('0x30')]);_0x5696b9[_0xdbf0('0x32')]=_['intersection'](_0x42d4c7[_0xdbf0('0x2e')],qs[_0xdbf0('0x33')](_0x3b9d29[_0xdbf0('0x30')][_0xdbf0('0x33')]));_0x5696b9[_0xdbf0('0x32')]=_0x5696b9[_0xdbf0('0x32')][_0xdbf0('0x34')]?_0x5696b9[_0xdbf0('0x32')]:_0x42d4c7[_0xdbf0('0x2e')];if(!_0x3b9d29['query'][_0xdbf0('0x35')](_0xdbf0('0x36'))){_0x5696b9[_0xdbf0('0x37')]=qs['limit'](_0x3b9d29[_0xdbf0('0x30')]['limit']);_0x5696b9[_0xdbf0('0x1b')]=qs[_0xdbf0('0x1b')](_0x3b9d29['query']['offset']);}_0x5696b9[_0xdbf0('0x38')]=qs[_0xdbf0('0x39')](_0x3b9d29[_0xdbf0('0x30')][_0xdbf0('0x39')]);delete _0x3b9d29['query']['sort'];_0x5696b9['where']=qs[_0xdbf0('0x31')](_[_0xdbf0('0x3a')](_0x3b9d29['query'],_0x42d4c7[_0xdbf0('0x31')]),_0x2ec2f8);if(_0x3b9d29[_0xdbf0('0x30')][_0xdbf0('0x3b')]){_0x5696b9[_0xdbf0('0x3c')]=_[_0xdbf0('0x3d')](_0x5696b9[_0xdbf0('0x3c')],{'$or':_[_0xdbf0('0x2f')](_0x2ec2f8,function(_0x23d462){if(_0x23d462['type']!==_0xdbf0('0x3e')){var _0x5d5c59={};_0x5d5c59[_0x23d462['name']]={'$like':'%'+_0x3b9d29[_0xdbf0('0x30')][_0xdbf0('0x3b')]+'%'};return _0x5d5c59;}})});}_0x5696b9=_[_0xdbf0('0x3d')]({},_0x5696b9,_0x3b9d29['options']);var _0x4e4d12={'where':_0x5696b9[_0xdbf0('0x3c')]};return db[_0xdbf0('0x29')]['count'](_0x4e4d12)[_0xdbf0('0x22')](function(_0x1e4f15){_0x1a6458[_0xdbf0('0x1d')]=_0x1e4f15;if(_0x3b9d29['query'][_0xdbf0('0x3f')]){_0x5696b9[_0xdbf0('0x40')]=[{'all':!![]}];}return db[_0xdbf0('0x29')][_0xdbf0('0x41')](_0x5696b9);})['then'](function(_0x359256){_0x1a6458[_0xdbf0('0x42')]=_0x359256;return _0x1a6458;})['then'](respondWithFilteredResult(_0x6ba583,_0x5696b9))[_0xdbf0('0x43')](handleError(_0x6ba583,null));};exports['show']=function(_0x293f6c,_0x56c628){var _0x5b0957={'raw':![],'where':{'id':_0x293f6c[_0xdbf0('0x44')]['id']}},_0x1a8cbb={};_0x1a8cbb[_0xdbf0('0x2e')]=_[_0xdbf0('0x45')](db[_0xdbf0('0x29')]['rawAttributes']);_0x1a8cbb['query']=_['keys'](_0x293f6c[_0xdbf0('0x30')]);_0x1a8cbb['filters']=_['intersection'](_0x1a8cbb[_0xdbf0('0x2e')],_0x1a8cbb[_0xdbf0('0x30')]);_0x5b0957[_0xdbf0('0x32')]=_[_0xdbf0('0x46')](_0x1a8cbb[_0xdbf0('0x2e')],qs[_0xdbf0('0x33')](_0x293f6c['query'][_0xdbf0('0x33')]));_0x5b0957['attributes']=_0x5b0957[_0xdbf0('0x32')]['length']?_0x5b0957[_0xdbf0('0x32')]:_0x1a8cbb[_0xdbf0('0x2e')];if(_0x293f6c['query'][_0xdbf0('0x3f')]){_0x5b0957[_0xdbf0('0x40')]=[{'all':!![]}];}_0x5b0957=_['merge']({},_0x5b0957,_0x293f6c[_0xdbf0('0x47')]);return db[_0xdbf0('0x29')]['find'](_0x5b0957)[_0xdbf0('0x22')](handleEntityNotFound(_0x56c628,null))[_0xdbf0('0x22')](respondWithResult(_0x56c628,null))['catch'](handleError(_0x56c628,null));};exports[_0xdbf0('0x21')]=function(_0x2cb09b,_0x4119ad){if(_0x2cb09b[_0xdbf0('0x48')]['id']){delete _0x2cb09b[_0xdbf0('0x48')]['id'];}return db['VoiceMusicOnHold'][_0xdbf0('0x49')]({'where':{'id':_0x2cb09b[_0xdbf0('0x44')]['id']}})['then'](handleEntityNotFound(_0x4119ad,null))[_0xdbf0('0x22')](saveUpdates(_0x2cb09b['body'],null))['then'](respondWithResult(_0x4119ad,null))[_0xdbf0('0x43')](handleError(_0x4119ad,null));};exports[_0xdbf0('0x4a')]=function(_0x4c8926,_0xc37955,_0x4bde36){return db['sequelize'][_0xdbf0('0x4b')](function(_0x485e97){if(_0x4c8926[_0xdbf0('0x48')][_0xdbf0('0x4c')]===_0xdbf0('0x4d')){_0x4c8926[_0xdbf0('0x48')][_0xdbf0('0x4e')]=path['join'](config['root'],'server/files/moh',_0x4c8926[_0xdbf0('0x48')]['name']);}return db[_0xdbf0('0x29')][_0xdbf0('0x4a')](_0x4c8926[_0xdbf0('0x48')],{'transaction':_0x485e97})[_0xdbf0('0x22')](function(_0x24c72d){if(_0x4c8926['body'][_0xdbf0('0x4c')]==='files'){fs[_0xdbf0('0x4f')](_0x24c72d[_0xdbf0('0x4e')],parseInt(_0xdbf0('0x50'),0x8));}var _0x4fd3c7=_0x4c8926[_0xdbf0('0x51')][_0xdbf0('0x24')]({'plain':!![]});if(!_0x4fd3c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fd3c7['role']==='user'){var _0xe936f0=_0x24c72d[_0xdbf0('0x24')]({'plain':!![]});return db[_0xdbf0('0x52')][_0xdbf0('0x49')]({'where':{'name':_0xdbf0('0x53'),'userProfileId':_0x4fd3c7[_0xdbf0('0x54')]},'raw':!![]})[_0xdbf0('0x22')](function(_0x1ff474){if(_0x1ff474&&_0x1ff474[_0xdbf0('0x55')]===0x0){return db[_0xdbf0('0x56')][_0xdbf0('0x4a')]({'name':_0xe936f0[_0xdbf0('0x27')],'resourceId':_0xe936f0['id'],'type':_0x1ff474['name'],'sectionId':_0x1ff474['id']},{})['then'](function(){return _0x24c72d;});}else{return _0x24c72d;}})['catch'](function(_0x24e9dc){logger[_0xdbf0('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24e9dc);});}return _0x24c72d;});})[_0xdbf0('0x22')](respondWithResult(_0xc37955,0xc9))[_0xdbf0('0x43')](handleError(_0xc37955,null));};exports[_0xdbf0('0x23')]=function(_0x208b16,_0x2e3cfe,_0x2c709a){var _0x34fe58;return db[_0xdbf0('0x29')][_0xdbf0('0x49')]({'where':{'id':_0x208b16[_0xdbf0('0x44')]['id']}})[_0xdbf0('0x22')](function(_0x47b267){if(_0x47b267){return db['sequelize'][_0xdbf0('0x4b')](function(_0x62c228){return _0x47b267[_0xdbf0('0x23')]({'transaction':_0x62c228,'raw':!![]})['then'](function(_0x5c5c33){if(_0x5c5c33[_0xdbf0('0x4e')]){fs['readdirSync'](_0x5c5c33[_0xdbf0('0x4e')])[_0xdbf0('0x57')](function(_0x2b8cec){fs['unlinkSync'](path['join'](_0x5c5c33['directory'],_0x2b8cec));});fs[_0xdbf0('0x58')](_0x5c5c33[_0xdbf0('0x4e')]);}return _0x5c5c33;});})[_0xdbf0('0x43')](function(_0xce1c9b){throw new db[(_0xdbf0('0x59'))][(_0xdbf0('0x5a'))](_0xce1c9b[_0xdbf0('0x5b')]);});}})[_0xdbf0('0x22')](handleEntityNotFound(_0x2e3cfe,null))[_0xdbf0('0x22')](removeEntity(_0x2e3cfe,null))[_0xdbf0('0x43')](handleError(_0x2e3cfe,null));};exports[_0xdbf0('0x5c')]=function(_0x2124e1,_0xa7a02e,_0x369a3d){return db['sequelize'][_0xdbf0('0x4b')](function(_0x3e5a1f){var _0x264cfe;return db[_0xdbf0('0x29')][_0xdbf0('0x49')]({'where':{'id':_0x2124e1[_0xdbf0('0x44')]['id']}})['then'](function(_0x121ee5){if(_0x121ee5){_0x264cfe=_0x121ee5;return _0x121ee5[_0xdbf0('0x5c')](_0x2124e1[_0xdbf0('0x48')]['id'],{'transaction':_0x3e5a1f});}})['then'](function(_0x2ade6c){if(_0x2ade6c){return db[_0xdbf0('0x5d')]['findOne']({'where':{'id':_0x2124e1[_0xdbf0('0x48')]['id']},'attributes':['id',_0xdbf0('0x27'),_0xdbf0('0x5e'),_0xdbf0('0x5f'),_0xdbf0('0x60')],'raw':!![]});}})['then'](function(_0x399e82){if(_0x399e82){var _0x1a0119=path[_0xdbf0('0x61')](config['root'],_0xdbf0('0x62'),util[_0xdbf0('0x63')](_0xdbf0('0x64'),path[_0xdbf0('0x65')](_0x399e82[_0xdbf0('0x5e')],path[_0xdbf0('0x66')](_0x399e82[_0xdbf0('0x5e')])),_0x399e82[_0xdbf0('0x5f')]));var _0x330d56=path[_0xdbf0('0x61')](config[_0xdbf0('0x67')],_0xdbf0('0x68'),_0x264cfe[_0xdbf0('0x27')],util[_0xdbf0('0x63')]('%s.%s',_0x399e82[_0xdbf0('0x27')],_0x399e82[_0xdbf0('0x5f')]));fs[_0xdbf0('0x69')](_0x1a0119,_0x330d56);return _0x399e82;}})[_0xdbf0('0x43')](function(_0x193c41){throw new db[(_0xdbf0('0x59'))][(_0xdbf0('0x5a'))](_0x193c41[_0xdbf0('0x5b')]);});})[_0xdbf0('0x22')](handleEntityNotFound(_0xa7a02e,null))['then'](respondWithResult(_0xa7a02e,0xc9))[_0xdbf0('0x43')](handleError(_0xa7a02e,null));};exports[_0xdbf0('0x6a')]=function(_0x11523d,_0x36d868,_0xf805f5){return db[_0xdbf0('0x6b')]['transaction'](function(_0x3e7934){var _0x4a78c7;return db[_0xdbf0('0x29')][_0xdbf0('0x6c')]({'where':{'id':_0x11523d[_0xdbf0('0x44')]['id']}})[_0xdbf0('0x22')](handleEntityNotFound(_0x36d868,null))[_0xdbf0('0x22')](function(_0x5a8b09){if(_0x5a8b09){_0x4a78c7=_0x5a8b09;return _0x5a8b09[_0xdbf0('0x6a')](_0x11523d[_0xdbf0('0x44')][_0xdbf0('0x6d')]);}})[_0xdbf0('0x22')](function(_0x49c37f){if(_0x49c37f){return db[_0xdbf0('0x5d')]['findOne']({'where':{'id':_0x11523d[_0xdbf0('0x44')][_0xdbf0('0x6d')]},'attributes':['id',_0xdbf0('0x27'),_0xdbf0('0x5e'),_0xdbf0('0x5f'),'createdAt'],'raw':!![]});}})['then'](function(_0x29a2b9){if(_0x29a2b9){fs[_0xdbf0('0x6e')](path[_0xdbf0('0x61')](_0x4a78c7['directory'],util[_0xdbf0('0x63')]('%s.%s',_0x29a2b9['name'],_0x29a2b9['converted_format'])));return _0x29a2b9;}})[_0xdbf0('0x43')](function(_0x2d6fb4){throw new db['Sequelize'][(_0xdbf0('0x5a'))](_0x2d6fb4[_0xdbf0('0x5b')]);});})[_0xdbf0('0x22')](handleEntityNotFound(_0x36d868,null))[_0xdbf0('0x22')](respondWithStatusCode(_0x36d868,0xcc))[_0xdbf0('0x43')](handleError(_0x36d868,null));};exports[_0xdbf0('0x6f')]=function(_0xcd7381,_0x54e388,_0x2603cd){var _0x4ddf47={};var _0x20c999={};var _0x222674;var _0x4deb69;return db[_0xdbf0('0x29')][_0xdbf0('0x6c')]({'where':{'id':_0xcd7381[_0xdbf0('0x44')]['id']}})['then'](handleEntityNotFound(_0x54e388,null))[_0xdbf0('0x22')](function(_0x5696f6){if(_0x5696f6){_0x222674=_0x5696f6;_0x20c999[_0xdbf0('0x2e')]=_[_0xdbf0('0x45')](db[_0xdbf0('0x5d')]['rawAttributes']);_0x20c999[_0xdbf0('0x30')]=_[_0xdbf0('0x45')](_0xcd7381[_0xdbf0('0x30')]);_0x20c999[_0xdbf0('0x31')]=_[_0xdbf0('0x46')](_0x20c999[_0xdbf0('0x2e')],_0x20c999[_0xdbf0('0x30')]);_0x4ddf47[_0xdbf0('0x32')]=_[_0xdbf0('0x46')](_0x20c999[_0xdbf0('0x2e')],qs[_0xdbf0('0x33')](_0xcd7381[_0xdbf0('0x30')][_0xdbf0('0x33')]));_0x4ddf47['attributes']=_0x4ddf47[_0xdbf0('0x32')][_0xdbf0('0x34')]?_0x4ddf47[_0xdbf0('0x32')]:_0x20c999[_0xdbf0('0x2e')];_0x4ddf47[_0xdbf0('0x38')]=qs[_0xdbf0('0x39')](_0xcd7381['query'][_0xdbf0('0x39')]);_0x4ddf47[_0xdbf0('0x3c')]=qs[_0xdbf0('0x31')](_[_0xdbf0('0x3a')](_0xcd7381[_0xdbf0('0x30')],_0x20c999[_0xdbf0('0x31')]));if(_0xcd7381['query'][_0xdbf0('0x3b')]){_0x4ddf47['where']=_[_0xdbf0('0x3d')](_0x4ddf47['where'],{'$or':_[_0xdbf0('0x2f')](_0x4ddf47[_0xdbf0('0x32')],function(_0x10662f){var _0x4396ef={};_0x4396ef[_0x10662f]={'$like':'%'+_0xcd7381['query']['filter']+'%'};return _0x4396ef;})});}_0x4ddf47=_[_0xdbf0('0x3d')]({},_0x4ddf47,_0xcd7381[_0xdbf0('0x47')]);return _0x222674['getSounds'](_0x4ddf47);}})[_0xdbf0('0x22')](function(_0x36dc67){if(_0x36dc67){_0x4deb69=_0x36dc67[_0xdbf0('0x34')];if(!_0xcd7381['query'][_0xdbf0('0x35')](_0xdbf0('0x36'))){_0x4ddf47[_0xdbf0('0x37')]=qs[_0xdbf0('0x37')](_0xcd7381[_0xdbf0('0x30')][_0xdbf0('0x37')]);_0x4ddf47['offset']=qs[_0xdbf0('0x1b')](_0xcd7381[_0xdbf0('0x30')][_0xdbf0('0x1b')]);}return _0x222674[_0xdbf0('0x6f')](_0x4ddf47);}})[_0xdbf0('0x22')](function(_0x2c904a){if(_0x2c904a){return _0x2c904a?{'count':_0x4deb69,'rows':_0x2c904a}:null;}})[_0xdbf0('0x22')](respondWithResult(_0x54e388,null))['catch'](handleError(_0x54e388,null));}; \ No newline at end of file +var _0x3415=['directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','forEach','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','transaction','Sound','findOne','save_name','converted_format','format','basename','extname','%s.%s','symlinkSync','removeSound','id2','createdAt','getSounds','pick','hasOwnProperty','eml-format','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','MusicOnHolds','UserProfileResource','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','merge','VIRTUAL','filter','options','VoiceMusicOnHold','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','create','sequelize','mode','files','root','server/files/moh','mkdirSync'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x3415,0x1d1));var _0x5341=function(_0x5913b9,_0x601273){_0x5913b9=_0x5913b9-0x0;var _0x48a050=_0x3415[_0x5913b9];return _0x48a050;};'use strict';var emlformat=require(_0x5341('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5341('0x1'));var moment=require('moment');var BPromise=require(_0x5341('0x2'));var Mustache=require(_0x5341('0x3'));var util=require(_0x5341('0x4'));var path=require(_0x5341('0x5'));var sox=require(_0x5341('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5341('0x7'));var _=require('lodash');var squel=require(_0x5341('0x8'));var crypto=require(_0x5341('0x9'));var jsforce=require(_0x5341('0xa'));var deskjs=require(_0x5341('0xb'));var toCsv=require(_0x5341('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5341('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5341('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5341('0xf'))('api');var utils=require(_0x5341('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x5341('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x573c2d,_0x541064){_0x541064=_0x541064||0xcc;return function(_0x2bdd02){if(_0x2bdd02){return _0x573c2d[_0x5341('0x12')](_0x541064);}return _0x573c2d[_0x5341('0x13')](_0x541064)[_0x5341('0x14')]();};}function respondWithResult(_0x1721b8,_0x5d4a0d){_0x5d4a0d=_0x5d4a0d||0xc8;return function(_0x1b9961){if(_0x1b9961){return _0x1721b8[_0x5341('0x13')](_0x5d4a0d)[_0x5341('0x15')](_0x1b9961);}};}function respondWithFilteredResult(_0x960636,_0x32c85c){return function(_0x18fad6){if(_0x18fad6){var _0x20ef09=typeof _0x32c85c[_0x5341('0x16')]===_0x5341('0x17')&&typeof _0x32c85c[_0x5341('0x18')]===_0x5341('0x17');var _0x70900e=_0x18fad6['count'];var _0x3bd519=_0x20ef09?0x0:_0x32c85c[_0x5341('0x16')];var _0x4a89eb=_0x20ef09?_0x18fad6[_0x5341('0x19')]:_0x32c85c[_0x5341('0x16')]+_0x32c85c[_0x5341('0x18')];var _0x322d04;if(_0x4a89eb>=_0x70900e){_0x4a89eb=_0x70900e;_0x322d04=0xc8;}else{_0x322d04=0xce;}_0x960636[_0x5341('0x13')](_0x322d04);return _0x960636[_0x5341('0x1a')](_0x5341('0x1b'),_0x3bd519+'-'+_0x4a89eb+'/'+_0x70900e)['json'](_0x18fad6);}return null;};}function patchUpdates(_0x787bb){return function(_0x44f056){try{jsonpatch[_0x5341('0x1c')](_0x44f056,_0x787bb,!![]);}catch(_0x2caed1){return BPromise[_0x5341('0x1d')](_0x2caed1);}return _0x44f056['save']();};}function saveUpdates(_0x39ab50,_0xe22b38){return function(_0xc0fddd){if(_0xc0fddd){return _0xc0fddd[_0x5341('0x1e')](_0x39ab50)[_0x5341('0x1f')](function(_0xbe03de){return _0xbe03de;});}return null;};}function removeEntity(_0x440822,_0x2079a0){return function(_0x1ba7d1){if(_0x1ba7d1){return _0x1ba7d1[_0x5341('0x20')]()[_0x5341('0x1f')](function(){var _0x3dc7c1=_0x1ba7d1['get']({'plain':!![]});var _0x324078=_0x5341('0x21');return db[_0x5341('0x22')][_0x5341('0x20')]({'where':{'type':_0x324078,'resourceId':_0x3dc7c1['id']}})[_0x5341('0x1f')](function(){return _0x1ba7d1;});})[_0x5341('0x1f')](function(){_0x440822[_0x5341('0x13')](0xcc)[_0x5341('0x14')]();});}};}function handleEntityNotFound(_0x1816c9,_0x4016bc){return function(_0x29bbe8){if(!_0x29bbe8){_0x1816c9[_0x5341('0x12')](0x194);}return _0x29bbe8;};}function handleError(_0x52b1bd,_0x73b19e){_0x73b19e=_0x73b19e||0x1f4;return function(_0x2ec2d1){logger[_0x5341('0x23')](_0x2ec2d1['stack']);if(_0x2ec2d1[_0x5341('0x24')]){delete _0x2ec2d1[_0x5341('0x24')];}_0x52b1bd['status'](_0x73b19e)[_0x5341('0x25')](_0x2ec2d1);};}exports[_0x5341('0x26')]=function(_0x4060d1,_0x49448b){var _0x62e301={},_0x236103={},_0x496aac={'count':0x0,'rows':[]};var _0x484dd6=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x14ed0e){return{'name':_0x14ed0e[_0x5341('0x27')],'type':_0x14ed0e[_0x5341('0x28')][_0x5341('0x29')]};});_0x236103[_0x5341('0x2a')]=_[_0x5341('0x2b')](_0x484dd6,'name');_0x236103[_0x5341('0x2c')]=_[_0x5341('0x2d')](_0x4060d1[_0x5341('0x2c')]);_0x236103[_0x5341('0x2e')]=_['intersection'](_0x236103[_0x5341('0x2a')],_0x236103[_0x5341('0x2c')]);_0x62e301[_0x5341('0x2f')]=_[_0x5341('0x30')](_0x236103['model'],qs[_0x5341('0x31')](_0x4060d1[_0x5341('0x2c')]['fields']));_0x62e301['attributes']=_0x62e301[_0x5341('0x2f')][_0x5341('0x32')]?_0x62e301['attributes']:_0x236103[_0x5341('0x2a')];if(!_0x4060d1[_0x5341('0x2c')]['hasOwnProperty']('nolimit')){_0x62e301['limit']=qs[_0x5341('0x18')](_0x4060d1[_0x5341('0x2c')][_0x5341('0x18')]);_0x62e301[_0x5341('0x16')]=qs[_0x5341('0x16')](_0x4060d1[_0x5341('0x2c')][_0x5341('0x16')]);}_0x62e301[_0x5341('0x33')]=qs[_0x5341('0x34')](_0x4060d1[_0x5341('0x2c')]['sort']);delete _0x4060d1[_0x5341('0x2c')]['sort'];_0x62e301[_0x5341('0x35')]=qs[_0x5341('0x2e')](_['pick'](_0x4060d1[_0x5341('0x2c')],_0x236103[_0x5341('0x2e')]),_0x484dd6);if(_0x4060d1[_0x5341('0x2c')]['filter']){_0x62e301[_0x5341('0x35')]=_[_0x5341('0x36')](_0x62e301[_0x5341('0x35')],{'$or':_[_0x5341('0x2b')](_0x484dd6,function(_0x15006d){if(_0x15006d[_0x5341('0x28')]!==_0x5341('0x37')){var _0x3853f9={};_0x3853f9[_0x15006d[_0x5341('0x24')]]={'$like':'%'+_0x4060d1[_0x5341('0x2c')][_0x5341('0x38')]+'%'};return _0x3853f9;}})});}_0x62e301=_[_0x5341('0x36')]({},_0x62e301,_0x4060d1[_0x5341('0x39')]);var _0x2b8847={'where':_0x62e301[_0x5341('0x35')]};return db[_0x5341('0x3a')][_0x5341('0x19')](_0x2b8847)[_0x5341('0x1f')](function(_0x47e5b0){_0x496aac['count']=_0x47e5b0;if(_0x4060d1['query']['includeAll']){_0x62e301['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x5341('0x3b')](_0x62e301);})[_0x5341('0x1f')](function(_0x13f2af){_0x496aac[_0x5341('0x3c')]=_0x13f2af;return _0x496aac;})['then'](respondWithFilteredResult(_0x49448b,_0x62e301))[_0x5341('0x3d')](handleError(_0x49448b,null));};exports[_0x5341('0x3e')]=function(_0x5f5b8d,_0xbd5649){var _0x41a961={'raw':![],'where':{'id':_0x5f5b8d[_0x5341('0x3f')]['id']}},_0x21d0b4={};_0x21d0b4[_0x5341('0x2a')]=_[_0x5341('0x2d')](db['VoiceMusicOnHold'][_0x5341('0x40')]);_0x21d0b4['query']=_['keys'](_0x5f5b8d['query']);_0x21d0b4['filters']=_['intersection'](_0x21d0b4['model'],_0x21d0b4['query']);_0x41a961[_0x5341('0x2f')]=_[_0x5341('0x30')](_0x21d0b4[_0x5341('0x2a')],qs[_0x5341('0x31')](_0x5f5b8d[_0x5341('0x2c')][_0x5341('0x31')]));_0x41a961[_0x5341('0x2f')]=_0x41a961[_0x5341('0x2f')]['length']?_0x41a961[_0x5341('0x2f')]:_0x21d0b4[_0x5341('0x2a')];if(_0x5f5b8d[_0x5341('0x2c')][_0x5341('0x41')]){_0x41a961['include']=[{'all':!![]}];}_0x41a961=_['merge']({},_0x41a961,_0x5f5b8d[_0x5341('0x39')]);return db[_0x5341('0x3a')][_0x5341('0x42')](_0x41a961)['then'](handleEntityNotFound(_0xbd5649,null))['then'](respondWithResult(_0xbd5649,null))[_0x5341('0x3d')](handleError(_0xbd5649,null));};exports[_0x5341('0x1e')]=function(_0x3ee3e1,_0x5c031a){if(_0x3ee3e1['body']['id']){delete _0x3ee3e1[_0x5341('0x43')]['id'];}return db[_0x5341('0x3a')]['find']({'where':{'id':_0x3ee3e1[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](handleEntityNotFound(_0x5c031a,null))['then'](saveUpdates(_0x3ee3e1['body'],null))[_0x5341('0x1f')](respondWithResult(_0x5c031a,null))[_0x5341('0x3d')](handleError(_0x5c031a,null));};exports[_0x5341('0x44')]=function(_0x50b578,_0x2a6e4e,_0x369021){return db[_0x5341('0x45')]['transaction'](function(_0x13e3cc){if(_0x50b578['body'][_0x5341('0x46')]===_0x5341('0x47')){_0x50b578[_0x5341('0x43')]['directory']=path['join'](config[_0x5341('0x48')],_0x5341('0x49'),_0x50b578[_0x5341('0x43')][_0x5341('0x24')]);}return db[_0x5341('0x3a')]['create'](_0x50b578[_0x5341('0x43')],{'transaction':_0x13e3cc})[_0x5341('0x1f')](function(_0x4f7bf8){if(_0x50b578[_0x5341('0x43')]['mode']===_0x5341('0x47')){fs[_0x5341('0x4a')](_0x4f7bf8[_0x5341('0x4b')],parseInt(_0x5341('0x4c'),0x8));}var _0x1f7e53=_0x50b578[_0x5341('0x4d')][_0x5341('0x4e')]({'plain':!![]});if(!_0x1f7e53)throw new Error(_0x5341('0x4f'));if(_0x1f7e53[_0x5341('0x50')]===_0x5341('0x4d')){var _0x5ced4e=_0x4f7bf8[_0x5341('0x4e')]({'plain':!![]});return db[_0x5341('0x51')]['find']({'where':{'name':_0x5341('0x21'),'userProfileId':_0x1f7e53[_0x5341('0x52')]},'raw':!![]})[_0x5341('0x1f')](function(_0x390512){if(_0x390512&&_0x390512[_0x5341('0x53')]===0x0){return db['UserProfileResource'][_0x5341('0x44')]({'name':_0x5ced4e[_0x5341('0x24')],'resourceId':_0x5ced4e['id'],'type':_0x390512[_0x5341('0x24')],'sectionId':_0x390512['id']},{})[_0x5341('0x1f')](function(){return _0x4f7bf8;});}else{return _0x4f7bf8;}})[_0x5341('0x3d')](function(_0x341ccf){logger[_0x5341('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x341ccf);});}return _0x4f7bf8;});})[_0x5341('0x1f')](respondWithResult(_0x2a6e4e,0xc9))[_0x5341('0x3d')](handleError(_0x2a6e4e,null));};exports[_0x5341('0x20')]=function(_0x101fc6,_0x40ffac,_0x4075e6){var _0x200393;return db[_0x5341('0x3a')][_0x5341('0x42')]({'where':{'id':_0x101fc6[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](function(_0x1b955d){if(_0x1b955d){return db[_0x5341('0x45')]['transaction'](function(_0x7f5f58){return _0x1b955d[_0x5341('0x20')]({'transaction':_0x7f5f58,'raw':!![]})['then'](function(_0x2cb7fc){if(_0x2cb7fc[_0x5341('0x4b')]){fs['readdirSync'](_0x2cb7fc[_0x5341('0x4b')])[_0x5341('0x54')](function(_0xdf3ae6){fs[_0x5341('0x55')](path[_0x5341('0x56')](_0x2cb7fc[_0x5341('0x4b')],_0xdf3ae6));});fs[_0x5341('0x57')](_0x2cb7fc['directory']);}return _0x2cb7fc;});})['catch'](function(_0x2d7412){throw new db[(_0x5341('0x58'))][(_0x5341('0x59'))](_0x2d7412[_0x5341('0x5a')]);});}})[_0x5341('0x1f')](handleEntityNotFound(_0x40ffac,null))[_0x5341('0x1f')](removeEntity(_0x40ffac,null))['catch'](handleError(_0x40ffac,null));};exports[_0x5341('0x5b')]=function(_0x86349b,_0x2fa377,_0x4a1845){return db['sequelize'][_0x5341('0x5c')](function(_0x42b327){var _0xd0fabd;return db[_0x5341('0x3a')][_0x5341('0x42')]({'where':{'id':_0x86349b[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](function(_0x1afccc){if(_0x1afccc){_0xd0fabd=_0x1afccc;return _0x1afccc[_0x5341('0x5b')](_0x86349b[_0x5341('0x43')]['id'],{'transaction':_0x42b327});}})[_0x5341('0x1f')](function(_0x2c1d6c){if(_0x2c1d6c){return db[_0x5341('0x5d')][_0x5341('0x5e')]({'where':{'id':_0x86349b[_0x5341('0x43')]['id']},'attributes':['id',_0x5341('0x24'),_0x5341('0x5f'),_0x5341('0x60'),'createdAt'],'raw':!![]});}})[_0x5341('0x1f')](function(_0x7d8197){if(_0x7d8197){var _0x4668e9=path[_0x5341('0x56')](config[_0x5341('0x48')],'server/files/sounds/converted',util[_0x5341('0x61')]('%s.%s',path[_0x5341('0x62')](_0x7d8197[_0x5341('0x5f')],path[_0x5341('0x63')](_0x7d8197[_0x5341('0x5f')])),_0x7d8197[_0x5341('0x60')]));var _0x5be76f=path[_0x5341('0x56')](config[_0x5341('0x48')],_0x5341('0x49'),_0xd0fabd[_0x5341('0x24')],util[_0x5341('0x61')](_0x5341('0x64'),_0x7d8197[_0x5341('0x24')],_0x7d8197['converted_format']));fs[_0x5341('0x65')](_0x4668e9,_0x5be76f);return _0x7d8197;}})['catch'](function(_0x426520){throw new db['Sequelize'][(_0x5341('0x59'))](_0x426520['message']);});})['then'](handleEntityNotFound(_0x2fa377,null))[_0x5341('0x1f')](respondWithResult(_0x2fa377,0xc9))[_0x5341('0x3d')](handleError(_0x2fa377,null));};exports['removeSound']=function(_0x55db35,_0x285344,_0x395279){return db[_0x5341('0x45')]['transaction'](function(_0x443f79){var _0x2449d7;return db[_0x5341('0x3a')][_0x5341('0x5e')]({'where':{'id':_0x55db35[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](handleEntityNotFound(_0x285344,null))[_0x5341('0x1f')](function(_0xf9d79a){if(_0xf9d79a){_0x2449d7=_0xf9d79a;return _0xf9d79a[_0x5341('0x66')](_0x55db35[_0x5341('0x3f')][_0x5341('0x67')]);}})[_0x5341('0x1f')](function(_0x584684){if(_0x584684){return db[_0x5341('0x5d')]['findOne']({'where':{'id':_0x55db35[_0x5341('0x3f')]['id2']},'attributes':['id','name',_0x5341('0x5f'),_0x5341('0x60'),_0x5341('0x68')],'raw':!![]});}})[_0x5341('0x1f')](function(_0x324d9b){if(_0x324d9b){fs[_0x5341('0x55')](path[_0x5341('0x56')](_0x2449d7[_0x5341('0x4b')],util[_0x5341('0x61')](_0x5341('0x64'),_0x324d9b[_0x5341('0x24')],_0x324d9b[_0x5341('0x60')])));return _0x324d9b;}})[_0x5341('0x3d')](function(_0x98d455){throw new db[(_0x5341('0x58'))][(_0x5341('0x59'))](_0x98d455['message']);});})[_0x5341('0x1f')](handleEntityNotFound(_0x285344,null))[_0x5341('0x1f')](respondWithStatusCode(_0x285344,0xcc))[_0x5341('0x3d')](handleError(_0x285344,null));};exports[_0x5341('0x69')]=function(_0x1e0979,_0x5c4b0a,_0x387084){var _0x477193={};var _0x479c7b={};var _0x7d21fa;var _0x5713c2;return db[_0x5341('0x3a')][_0x5341('0x5e')]({'where':{'id':_0x1e0979[_0x5341('0x3f')]['id']}})[_0x5341('0x1f')](handleEntityNotFound(_0x5c4b0a,null))[_0x5341('0x1f')](function(_0x260eb3){if(_0x260eb3){_0x7d21fa=_0x260eb3;_0x479c7b[_0x5341('0x2a')]=_[_0x5341('0x2d')](db[_0x5341('0x5d')][_0x5341('0x40')]);_0x479c7b[_0x5341('0x2c')]=_[_0x5341('0x2d')](_0x1e0979[_0x5341('0x2c')]);_0x479c7b[_0x5341('0x2e')]=_['intersection'](_0x479c7b['model'],_0x479c7b[_0x5341('0x2c')]);_0x477193[_0x5341('0x2f')]=_[_0x5341('0x30')](_0x479c7b[_0x5341('0x2a')],qs[_0x5341('0x31')](_0x1e0979[_0x5341('0x2c')][_0x5341('0x31')]));_0x477193[_0x5341('0x2f')]=_0x477193[_0x5341('0x2f')][_0x5341('0x32')]?_0x477193['attributes']:_0x479c7b[_0x5341('0x2a')];_0x477193[_0x5341('0x33')]=qs[_0x5341('0x34')](_0x1e0979['query'][_0x5341('0x34')]);_0x477193[_0x5341('0x35')]=qs[_0x5341('0x2e')](_[_0x5341('0x6a')](_0x1e0979[_0x5341('0x2c')],_0x479c7b['filters']));if(_0x1e0979[_0x5341('0x2c')][_0x5341('0x38')]){_0x477193[_0x5341('0x35')]=_['merge'](_0x477193[_0x5341('0x35')],{'$or':_['map'](_0x477193[_0x5341('0x2f')],function(_0x48c55e){var _0x42b95b={};_0x42b95b[_0x48c55e]={'$like':'%'+_0x1e0979['query']['filter']+'%'};return _0x42b95b;})});}_0x477193=_[_0x5341('0x36')]({},_0x477193,_0x1e0979[_0x5341('0x39')]);return _0x7d21fa[_0x5341('0x69')](_0x477193);}})['then'](function(_0x479595){if(_0x479595){_0x5713c2=_0x479595[_0x5341('0x32')];if(!_0x1e0979[_0x5341('0x2c')][_0x5341('0x6b')]('nolimit')){_0x477193[_0x5341('0x18')]=qs['limit'](_0x1e0979[_0x5341('0x2c')]['limit']);_0x477193[_0x5341('0x16')]=qs[_0x5341('0x16')](_0x1e0979['query'][_0x5341('0x16')]);}return _0x7d21fa['getSounds'](_0x477193);}})[_0x5341('0x1f')](function(_0x55ef9a){if(_0x55ef9a){return _0x55ef9a?{'count':_0x5713c2,'rows':_0x55ef9a}:null;}})[_0x5341('0x1f')](respondWithResult(_0x5c4b0a,null))[_0x5341('0x3d')](handleError(_0x5c4b0a,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 138a08c..9efd3fb 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 _0x2daf=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment'];(function(_0x59a549,_0x2fe2bb){var _0x12adbe=function(_0x2ccd1e){while(--_0x2ccd1e){_0x59a549['push'](_0x59a549['shift']());}};_0x12adbe(++_0x2fe2bb);}(_0x2daf,0x121));var _0xf2da=function(_0x1811e0,_0x487da0){_0x1811e0=_0x1811e0-0x0;var _0x3ce439=_0x2daf[_0x1811e0];return _0x3ce439;};'use strict';var _=require(_0xf2da('0x0'));var util=require(_0xf2da('0x1'));var logger=require(_0xf2da('0x2'))(_0xf2da('0x3'));var moment=require(_0xf2da('0x4'));var BPromise=require(_0xf2da('0x5'));var rp=require(_0xf2da('0x6'));var fs=require('fs');var path=require(_0xf2da('0x7'));var rimraf=require(_0xf2da('0x8'));var config=require(_0xf2da('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xf2da('0xa')]=function(_0x50b9f9,_0x1dc083){return _0x50b9f9[_0xf2da('0xb')](_0xf2da('0xc'),attributes,{'tableName':_0xf2da('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f68=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8f68,0xdd));var _0x88f6=function(_0x39fc11,_0x2de90b){_0x39fc11=_0x39fc11-0x0;var _0x45f1d3=_0x8f68[_0x39fc11];return _0x45f1d3;};'use strict';var _=require('lodash');var util=require(_0x88f6('0x0'));var logger=require('../../config/logger')(_0x88f6('0x1'));var moment=require(_0x88f6('0x2'));var BPromise=require(_0x88f6('0x3'));var rp=require(_0x88f6('0x4'));var fs=require('fs');var path=require(_0x88f6('0x5'));var rimraf=require('rimraf');var config=require(_0x88f6('0x6'));var attributes=require(_0x88f6('0x7'));module[_0x88f6('0x8')]=function(_0xd03dfa,_0x331fd8){return _0xd03dfa[_0x88f6('0x9')](_0x88f6('0xa'),attributes,{'tableName':_0x88f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index ecd3354..7135e1c 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0xd66229,_0x1f9154){var _0x4f84cc=function(_0x1d7589){while(--_0x1d7589){_0xd66229['push'](_0xd66229['shift']());}};_0x4f84cc(++_0x1f9154);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0xcb91[_0x152449];return _0x5b58b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1edd2d,_0x7503d){var _0x5468a9=function(_0x3463f9){while(--_0x3463f9){_0x1edd2d['push'](_0x1edd2d['shift']());}};_0x5468a9(++_0x7503d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 44f5280..82276ce 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 _0x2029=['addAgents','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create'];(function(_0x4947e3,_0x21f2ee){var _0x1911e5=function(_0x193c1b){while(--_0x193c1b){_0x4947e3['push'](_0x4947e3['shift']());}};_0x1911e5(++_0x21f2ee);}(_0x2029,0x171));var _0x9202=function(_0x5c200c,_0x491763){_0x5c200c=_0x5c200c-0x0;var _0x35748b=_0x2029[_0x5c200c];return _0x35748b;};'use strict';var multer=require(_0x9202('0x0'));var util=require(_0x9202('0x1'));var path=require('path');var timeout=require(_0x9202('0x2'));var express=require(_0x9202('0x3'));var router=express[_0x9202('0x4')]();var fs_extra=require(_0x9202('0x5'));var auth=require(_0x9202('0x6'));var interaction=require(_0x9202('0x7'));var config=require(_0x9202('0x8'));var controller=require(_0x9202('0x9'));router[_0x9202('0xa')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0xc')]);router[_0x9202('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x9202('0xd')]);router['get'](_0x9202('0xe'),auth[_0x9202('0xb')](),controller['show']);router[_0x9202('0xa')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x10')]);router[_0x9202('0xa')](_0x9202('0x11'),auth[_0x9202('0xb')](),controller[_0x9202('0x12')]);router[_0x9202('0x13')]('/',auth[_0x9202('0xb')](),controller[_0x9202('0x14')]);router[_0x9202('0x13')](_0x9202('0xf'),auth[_0x9202('0xb')](),controller[_0x9202('0x15')]);router[_0x9202('0x13')](_0x9202('0x11'),auth['isAuthenticated'](),controller[_0x9202('0x16')]);router[_0x9202('0x17')](_0x9202('0xe'),auth[_0x9202('0xb')](),controller[_0x9202('0x18')]);router[_0x9202('0x19')](_0x9202('0xe'),auth[_0x9202('0xb')](),controller[_0x9202('0x1a')]);router[_0x9202('0x19')]('/:id/users',auth[_0x9202('0xb')](),controller[_0x9202('0x1b')]);router[_0x9202('0x19')](_0x9202('0x11'),auth[_0x9202('0xb')](),controller[_0x9202('0x1c')]);module[_0x9202('0x1d')]=router; \ No newline at end of file +var _0x423b=['update','delete','destroy','removeAgents','removeTeams','util','connect-timeout','Router','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getAgents','/:id/teams','post','/:id/users'];(function(_0x59043b,_0x4e60cb){var _0xb27806=function(_0x25746b){while(--_0x25746b){_0x59043b['push'](_0x59043b['shift']());}};_0xb27806(++_0x4e60cb);}(_0x423b,0x12b));var _0xb423=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x423b[_0x39e283];return _0x7de89f;};'use strict';var multer=require('multer');var util=require(_0xb423('0x0'));var path=require('path');var timeout=require(_0xb423('0x1'));var express=require('express');var router=express[_0xb423('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb423('0x3'));var controller=require(_0xb423('0x4'));router['get']('/',auth[_0xb423('0x5')](),controller[_0xb423('0x6')]);router[_0xb423('0x7')](_0xb423('0x8'),auth['isAuthenticated'](),controller[_0xb423('0x9')]);router[_0xb423('0x7')](_0xb423('0xa'),auth[_0xb423('0x5')](),controller[_0xb423('0xb')]);router['get']('/:id/users',auth[_0xb423('0x5')](),controller[_0xb423('0xc')]);router[_0xb423('0x7')](_0xb423('0xd'),auth[_0xb423('0x5')](),controller['getTeams']);router[_0xb423('0xe')]('/',auth[_0xb423('0x5')](),controller['create']);router[_0xb423('0xe')](_0xb423('0xf'),auth[_0xb423('0x5')](),controller['addAgents']);router[_0xb423('0xe')]('/:id/teams',auth[_0xb423('0x5')](),controller['addTeams']);router['put']('/:id',auth[_0xb423('0x5')](),controller[_0xb423('0x10')]);router[_0xb423('0x11')]('/:id',auth[_0xb423('0x5')](),controller[_0xb423('0x12')]);router[_0xb423('0x11')](_0xb423('0xf'),auth['isAuthenticated'](),controller[_0xb423('0x13')]);router[_0xb423('0x11')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb423('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a9ba1f2..7834af1 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 _0xfe97=['exports','STRING','name','system-','getDataValue','INTEGER','sequelize'];(function(_0x38c91f,_0x55f3f8){var _0x5c29b6=function(_0x2c13d1){while(--_0x2c13d1){_0x38c91f['push'](_0x38c91f['shift']());}};_0x5c29b6(++_0x55f3f8);}(_0xfe97,0xae));var _0x7fe9=function(_0x4f1f4a,_0xe07a65){_0x4f1f4a=_0x4f1f4a-0x0;var _0x1079b7=_0xfe97[_0x4f1f4a];return _0x1079b7;};'use strict';var Sequelize=require(_0x7fe9('0x0'));module[_0x7fe9('0x1')]={'name':{'type':Sequelize[_0x7fe9('0x2')],'allowNull':![],'unique':_0x7fe9('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5477b2){return _0x7fe9('0x4')+this[_0x7fe9('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x7fe9('0x2')]},'callerIdAll':{'type':Sequelize[_0x7fe9('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x7fe9('0x6')]}}; \ No newline at end of file +var _0xce0f=['name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x4f7339,_0x1dc41e){var _0x241781=function(_0x50d5f2){while(--_0x50d5f2){_0x4f7339['push'](_0x4f7339['shift']());}};_0x241781(++_0x1dc41e);}(_0xce0f,0x1ad));var _0xfce0=function(_0x44be2a,_0x4aa94a){_0x44be2a=_0x44be2a-0x0;var _0x22de05=_0xce0f[_0x44be2a];return _0x22de05;};'use strict';var Sequelize=require(_0xfce0('0x0'));module[_0xfce0('0x1')]={'name':{'type':Sequelize[_0xfce0('0x2')],'allowNull':![],'unique':_0xfce0('0x3')},'prefix':{'type':Sequelize[_0xfce0('0x4')],'get':function(_0xc338ee){return _0xfce0('0x5')+this[_0xfce0('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xfce0('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xfce0('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index b21546b..340c09b 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 _0xb9be=['addAgents','emit','userVoicePrefix:save','ids','isArray','userVoicePrefix:remove','getAgents','findOne','order','Team','pick','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','User','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','union','compact','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','name','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','sequelize','transaction','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','prefix','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-'];(function(_0x3fd073,_0x32931f){var _0x40d7b1=function(_0x379467){while(--_0x379467){_0x3fd073['push'](_0x3fd073['shift']());}};_0x40d7b1(++_0x32931f);}(_0xb9be,0xc5));var _0xeb9b=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0xb9be[_0x289e64];return _0x30246c;};'use strict';var emlformat=require(_0xeb9b('0x0'));var rimraf=require(_0xeb9b('0x1'));var zipdir=require(_0xeb9b('0x2'));var jsonpatch=require(_0xeb9b('0x3'));var rp=require(_0xeb9b('0x4'));var moment=require(_0xeb9b('0x5'));var BPromise=require(_0xeb9b('0x6'));var Mustache=require(_0xeb9b('0x7'));var util=require(_0xeb9b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xeb9b('0x9'));var ejs=require(_0xeb9b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb9b('0xb'));var _=require('lodash');var squel=require(_0xeb9b('0xc'));var crypto=require(_0xeb9b('0xd'));var jsforce=require(_0xeb9b('0xe'));var deskjs=require(_0xeb9b('0xf'));var toCsv=require(_0xeb9b('0x9'));var querystring=require(_0xeb9b('0x10'));var Papa=require(_0xeb9b('0x11'));var Redis=require(_0xeb9b('0x12'));var authService=require(_0xeb9b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeb9b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb9b('0x15'));var utils=require(_0xeb9b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeb9b('0x17'));var db=require(_0xeb9b('0x18'))['db'];config[_0xeb9b('0x19')]=_[_0xeb9b('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb9b('0x19')]));require(_0xeb9b('0x1b'))[_0xeb9b('0x1c')](socket);function respondWithStatusCode(_0x4ec46d,_0x5926e1){_0x5926e1=_0x5926e1||0xcc;return function(_0x4f8182){if(_0x4f8182){return _0x4ec46d[_0xeb9b('0x1d')](_0x5926e1);}return _0x4ec46d[_0xeb9b('0x1e')](_0x5926e1)[_0xeb9b('0x1f')]();};}function respondWithResult(_0x3fa308,_0x2c9aa6){_0x2c9aa6=_0x2c9aa6||0xc8;return function(_0x10da6e){if(_0x10da6e){return _0x3fa308[_0xeb9b('0x1e')](_0x2c9aa6)['json'](_0x10da6e);}};}function respondWithFilteredResult(_0x2e8645,_0x36e871){return function(_0x21aca6){if(_0x21aca6){var _0x3a11e3=typeof _0x36e871[_0xeb9b('0x20')]===_0xeb9b('0x21')&&typeof _0x36e871[_0xeb9b('0x22')]===_0xeb9b('0x21');var _0x2c199f=_0x21aca6[_0xeb9b('0x23')];var _0x4f436e=_0x3a11e3?0x0:_0x36e871[_0xeb9b('0x20')];var _0x5a7ffd=_0x3a11e3?_0x21aca6['count']:_0x36e871[_0xeb9b('0x20')]+_0x36e871[_0xeb9b('0x22')];var _0x4ab4b8;if(_0x5a7ffd>=_0x2c199f){_0x5a7ffd=_0x2c199f;_0x4ab4b8=0xc8;}else{_0x4ab4b8=0xce;}_0x2e8645[_0xeb9b('0x1e')](_0x4ab4b8);return _0x2e8645[_0xeb9b('0x24')](_0xeb9b('0x25'),_0x4f436e+'-'+_0x5a7ffd+'/'+_0x2c199f)[_0xeb9b('0x26')](_0x21aca6);}return null;};}function patchUpdates(_0x3c8be7){return function(_0x43dab8){try{jsonpatch[_0xeb9b('0x27')](_0x43dab8,_0x3c8be7,!![]);}catch(_0x15e5b8){return BPromise[_0xeb9b('0x28')](_0x15e5b8);}return _0x43dab8[_0xeb9b('0x29')]();};}function saveUpdates(_0x61c86d,_0x296f95){return function(_0x1a4faf){if(_0x1a4faf){return _0x1a4faf[_0xeb9b('0x2a')](_0x61c86d)[_0xeb9b('0x2b')](function(_0x434461){return _0x434461;});}return null;};}function removeEntity(_0x4c997e,_0xd57390){return function(_0x4ed960){if(_0x4ed960){return _0x4ed960[_0xeb9b('0x2c')]()['then'](function(){var _0x347ec1=_0x4ed960[_0xeb9b('0x2d')]({'plain':!![]});var _0x7e0134=_0xeb9b('0x2e');return db['UserProfileResource'][_0xeb9b('0x2c')]({'where':{'type':_0x7e0134,'resourceId':_0x347ec1['id']}})[_0xeb9b('0x2b')](function(){return _0x4ed960;});})['then'](function(){_0x4c997e[_0xeb9b('0x1e')](0xcc)[_0xeb9b('0x1f')]();});}};}function handleEntityNotFound(_0x5ce745,_0x2a4b51){return function(_0x2ea20f){if(!_0x2ea20f){_0x5ce745[_0xeb9b('0x1d')](0x194);}return _0x2ea20f;};}function handleError(_0x48c5f4,_0x309bad){_0x309bad=_0x309bad||0x1f4;return function(_0x5336f2){logger[_0xeb9b('0x2f')](_0x5336f2['stack']);if(_0x5336f2[_0xeb9b('0x30')]){delete _0x5336f2['name'];}_0x48c5f4[_0xeb9b('0x1e')](_0x309bad)['send'](_0x5336f2);};}exports[_0xeb9b('0x31')]=function(_0x4c8e4c,_0x25b8da){var _0x370dbe={},_0x20e577={},_0x2e6034={'count':0x0,'rows':[]};var _0x112129=_[_0xeb9b('0x32')](db[_0xeb9b('0x33')][_0xeb9b('0x34')],function(_0x41e6c4){return{'name':_0x41e6c4[_0xeb9b('0x35')],'type':_0x41e6c4['type'][_0xeb9b('0x36')]};});_0x20e577[_0xeb9b('0x37')]=_[_0xeb9b('0x32')](_0x112129,_0xeb9b('0x30'));_0x20e577[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x4c8e4c[_0xeb9b('0x38')]);_0x20e577['filters']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],_0x20e577[_0xeb9b('0x38')]);_0x370dbe['attributes']=_[_0xeb9b('0x3a')](_0x20e577[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x370dbe[_0xeb9b('0x3c')]=_0x370dbe['attributes'][_0xeb9b('0x3d')]?_0x370dbe[_0xeb9b('0x3c')]:_0x20e577['model'];if(!_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x370dbe[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x370dbe['offset']=qs[_0xeb9b('0x20')](_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x20')]);}_0x370dbe['order']=qs['sort'](_0x4c8e4c['query'][_0xeb9b('0x40')]);_0x370dbe[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_['pick'](_0x4c8e4c[_0xeb9b('0x38')],_0x20e577[_0xeb9b('0x42')]),_0x112129);if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x370dbe[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x370dbe[_0xeb9b('0x41')],{'$or':_['map'](_0x112129,function(_0x5e597a){if(_0x5e597a[_0xeb9b('0x45')]!==_0xeb9b('0x46')){var _0x4ee3cd={};_0x4ee3cd[_0x5e597a['name']]={'$like':'%'+_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x43')]+'%'};return _0x4ee3cd;}})});}_0x370dbe=_['merge']({},_0x370dbe,_0x4c8e4c[_0xeb9b('0x47')]);var _0x535e73={'where':_0x370dbe[_0xeb9b('0x41')]};return db[_0xeb9b('0x33')][_0xeb9b('0x23')](_0x535e73)[_0xeb9b('0x2b')](function(_0xbee63e){_0x2e6034[_0xeb9b('0x23')]=_0xbee63e;if(_0x4c8e4c[_0xeb9b('0x38')][_0xeb9b('0x48')]){_0x370dbe[_0xeb9b('0x49')]=[{'all':!![]}];}return db[_0xeb9b('0x33')][_0xeb9b('0x4a')](_0x370dbe);})[_0xeb9b('0x2b')](function(_0x5e270a){_0x2e6034['rows']=_0x5e270a;return _0x2e6034;})[_0xeb9b('0x2b')](respondWithFilteredResult(_0x25b8da,_0x370dbe))['catch'](handleError(_0x25b8da,null));};exports[_0xeb9b('0x4b')]=function(_0x232731,_0x2c00ed){var _0x5eee9b={'raw':![],'where':{'id':_0x232731[_0xeb9b('0x4c')]['id']}},_0x1e2d25={};_0x1e2d25['model']=_[_0xeb9b('0x39')](db[_0xeb9b('0x33')][_0xeb9b('0x34')]);_0x1e2d25[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x232731[_0xeb9b('0x38')]);_0x1e2d25[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x1e2d25['model'],_0x1e2d25['query']);_0x5eee9b[_0xeb9b('0x3c')]=_['intersection'](_0x1e2d25['model'],qs[_0xeb9b('0x3b')](_0x232731[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x5eee9b[_0xeb9b('0x3c')]=_0x5eee9b[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x5eee9b['attributes']:_0x1e2d25['model'];if(_0x232731['query'][_0xeb9b('0x48')]){_0x5eee9b['include']=[{'all':!![]}];}_0x5eee9b=_[_0xeb9b('0x44')]({},_0x5eee9b,_0x232731[_0xeb9b('0x47')]);return db[_0xeb9b('0x33')][_0xeb9b('0x4d')](_0x5eee9b)[_0xeb9b('0x2b')](handleEntityNotFound(_0x2c00ed,null))[_0xeb9b('0x2b')](respondWithResult(_0x2c00ed,null))[_0xeb9b('0x4e')](handleError(_0x2c00ed,null));};exports[_0xeb9b('0x2c')]=function(_0x34755f,_0x28968b){return db['VoicePrefix']['find']({'where':{'id':_0x34755f[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x28968b,null))['then'](removeEntity(_0x28968b,null))[_0xeb9b('0x4e')](handleError(_0x28968b,null));};exports['describe']=function(_0x2ceb23,_0x1f7b31){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x1f7b31,null))[_0xeb9b('0x4e')](handleError(_0x1f7b31,null));};exports[_0xeb9b('0x4f')]=function(_0x263453,_0x4fe9d0){var _0x4ded40;return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3e6e73){return db[_0xeb9b('0x33')][_0xeb9b('0x4f')](_0x263453[_0xeb9b('0x52')],{'transaction':_0x3e6e73})['then'](function(_0x20dbea){_0x4ded40=_0x20dbea[_0xeb9b('0x2d')]({'plain':!![]});return db['VoiceExtension'][_0xeb9b('0x4d')]({'where':{'id':_0x4ded40['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x12f8d6){return createVoicePrefixExtensions(_0x4ded40,_0x12f8d6,_0x3e6e73);});});})['then'](function(){var _0x396aa9=_0x263453['user'][_0xeb9b('0x2d')]({'plain':!![]});if(!_0x396aa9)throw new Error(_0xeb9b('0x53'));if(_0x396aa9[_0xeb9b('0x54')]===_0xeb9b('0x55')){var _0x5c769e=_0x4ded40;return db['UserProfileSection'][_0xeb9b('0x4d')]({'where':{'name':_0xeb9b('0x2e'),'userProfileId':_0x396aa9[_0xeb9b('0x56')]},'raw':!![]})['then'](function(_0x3126d9){if(_0x3126d9&&_0x3126d9[_0xeb9b('0x57')]===0x0){return db[_0xeb9b('0x58')][_0xeb9b('0x4f')]({'name':_0x5c769e[_0xeb9b('0x30')],'resourceId':_0x5c769e['id'],'type':_0x3126d9[_0xeb9b('0x30')],'sectionId':_0x3126d9['id']},{})[_0xeb9b('0x2b')](function(){return _0x4ded40;});}else{return _0x4ded40;}})[_0xeb9b('0x4e')](function(_0x2f8b0f){logger[_0xeb9b('0x2f')](_0xeb9b('0x59'),_0x2f8b0f);throw _0x2f8b0f;});}return _0x4ded40;})['then'](respondWithResult(_0x4fe9d0,null))['catch'](handleError(_0x4fe9d0,null));};function Extension(_0x4b2506,_0x83d48a,_0x4cf8bf,_0x34ff5f){this[_0xeb9b('0x5a')]=_0xeb9b('0x5b');this['exten']=_0x4b2506;this[_0xeb9b('0x5c')]=_0x4cf8bf;this[_0xeb9b('0x45')]=_0xeb9b('0x5d');this[_0xeb9b('0x5e')]=_0xeb9b('0x5f');this[_0xeb9b('0x60')]=_0x83d48a;this[_0xeb9b('0x61')]=_0x34ff5f;}function createVoicePrefixExtensions(_0x295d81,_0x58a3e2,_0x5b55a6){return new BPromise(function(_0x27a445,_0x37f20c){var _0xa0146b=new Extension(formatPrefixName(_0x295d81['prefix']),0x1,_0xeb9b('0x62'),'Voice\x20Prefix');_0xa0146b[_0xeb9b('0x63')]=_0x295d81['id'];return db['VoiceExtension'][_0xeb9b('0x4f')](_0xa0146b,{'transaction':_0x5b55a6})[_0xeb9b('0x2b')](function(_0x3d223f){var _0x1b2a7a=_0x3d223f[_0xeb9b('0x2d')]({'plain':!![]});var _0x4be938=_[_0xeb9b('0x32')](addVoicePrefixExtensions(_0x295d81,_0x58a3e2),function(_0x1c7569){_0x1c7569['VoiceExtensionId']=_0x1b2a7a['id'];_0x1c7569['VoicePrefixId']=_0x295d81['id'];return _0x1c7569;});return db[_0xeb9b('0x64')][_0xeb9b('0x65')](_0x4be938,{'transaction':_0x5b55a6})['then'](function(_0xeb81b9){if(!_0xeb81b9){return _0x37f20c('Extensions\x20creation\x20failed');}else{return _0x27a445(_0xeb81b9);}})[_0xeb9b('0x4e')](function(_0x515a97){return _0x37f20c(_0x515a97);});});;});};function addVoicePrefixExtensions(_0x36376f,_0x382d3a){var _0x417221=[];var _0x1fea34=formatPrefixName(_0x36376f[_0xeb9b('0x66')]);_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x2,'Set',_0xeb9b('0x68')+_0x36376f[_0xeb9b('0x30')]));if(_0x36376f['callerIdAll']){_0x417221[_0xeb9b('0x67')](new Extension(_0x1fea34,0x3,_0xeb9b('0x69'),_0xeb9b('0x6a')+_0x36376f[_0xeb9b('0x6b')]));}else{_0x417221['push'](new Extension(_0x1fea34,0x3,_0xeb9b('0x62'),_0xeb9b('0x6c')));}_0x417221['push'](new Extension(_0x1fea34,0x4,_0xeb9b('0x6d'),_0x382d3a[_0xeb9b('0x5a')]+','+_0xeb9b('0x6e')+(0x8+_0x36376f[_0xeb9b('0x30')][_0xeb9b('0x3d')])+'}'+','+0x1));return _0x417221;}function formatPrefixName(_0x48b0ec){var _0x3f9ce0='_';for(var _0x4a48f6=0x0;_0x4a48f6<_0x48b0ec[_0xeb9b('0x3d')];_0x4a48f6++){if(_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)=='-'){_0x3f9ce0+=_0x48b0ec['charAt'](_0x4a48f6);}else{_0x3f9ce0+='['+_0x48b0ec[_0xeb9b('0x6f')](_0x4a48f6)+']';}}_0x3f9ce0+='.';return _0x3f9ce0;}exports[_0xeb9b('0x2a')]=function(_0x2fb07e,_0x25398e,_0x51de75){var _0xb0080f=_0x2fb07e[_0xeb9b('0x52')];_0xb0080f[_0xeb9b('0x66')]=_0xeb9b('0x70')+_0xb0080f[_0xeb9b('0x30')]+'-';return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x3836bd){return db[_0xeb9b('0x33')][_0xeb9b('0x2a')](_0xb0080f,{'where':{'id':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x2c')]({'where':{'VoicePrefixId':_0xb0080f['id']},'transaction':_0x3836bd})[_0xeb9b('0x2b')](function(){return db[_0xeb9b('0x64')][_0xeb9b('0x4d')]({'where':{'id':_0xb0080f['VoiceExtensionId']},'raw':!![]})[_0xeb9b('0x2b')](function(_0x3e4ef2){return createVoicePrefixExtensions(_0xb0080f,_0x3e4ef2,_0x3836bd);});});});})[_0xeb9b('0x2b')](function(){return db['VoicePrefix']['findById'](_0xb0080f['id']);})[_0xeb9b('0x2b')](respondWithResult(_0x25398e,null))['catch'](handleError(_0x25398e,null));};exports[_0xeb9b('0x71')]=function(_0x463767,_0x279f71,_0x12a271){return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x463767[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x279f71,null))[_0xeb9b('0x2b')](function(_0x46ce60){if(_0x46ce60){return _0x46ce60[_0xeb9b('0x71')](_0x463767[_0xeb9b('0x52')]['ids'],_['omit'](_0x463767[_0xeb9b('0x52')],['ids','id'])||{})['spread'](function(_0x95e1d0){for(var _0x4bdaf5=0x0;_0x4bdaf5<_0x463767['body']['ids'][_0xeb9b('0x3d')];_0x4bdaf5+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x73'),{'UserId':Number(_0x463767[_0xeb9b('0x52')]['ids'][_0x4bdaf5]),'VoicePrefixId':Number(_0x463767[_0xeb9b('0x4c')]['id'])});}return _0x95e1d0;});}})[_0xeb9b('0x2b')](respondWithResult(_0x279f71,null))[_0xeb9b('0x4e')](handleError(_0x279f71,null));};exports['removeAgents']=function(_0x5c010d,_0x3ea644,_0x4ffa9e){return db[_0xeb9b('0x33')]['find']({'where':{'id':_0x5c010d['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3ea644,null))['then'](function(_0x3aca78){if(_0x3aca78){return _0x3aca78['removeAgents'](_0x5c010d['query'][_0xeb9b('0x74')])[_0xeb9b('0x2b')](function(){if(_[_0xeb9b('0x75')](_0x5c010d[_0xeb9b('0x38')]['ids'])){for(var _0x193ffc=0x0;_0x193ffc<_0x5c010d[_0xeb9b('0x38')][_0xeb9b('0x74')][_0xeb9b('0x3d')];_0x193ffc+=0x1){socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')][_0x193ffc]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}}else{socket[_0xeb9b('0x72')](_0xeb9b('0x76'),{'UserId':Number(_0x5c010d['query'][_0xeb9b('0x74')]),'VoicePrefixId':Number(_0x5c010d['params']['id'])});}});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3ea644,null))['catch'](handleError(_0x3ea644,null));};exports[_0xeb9b('0x77')]=function(_0x36af5a,_0x41af31,_0x14db1d){var _0x31b0c5={};var _0x24bac5={};var _0x462fa2;var _0x5bf4a4;return db[_0xeb9b('0x33')][_0xeb9b('0x78')]({'where':{'id':_0x36af5a['params']['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x41af31,null))[_0xeb9b('0x2b')](function(_0x16f500){if(_0x16f500){_0x462fa2=_0x16f500;_0x24bac5['model']=_['keys'](db['User'][_0xeb9b('0x34')]);_0x24bac5[_0xeb9b('0x38')]=_['keys'](_0x36af5a[_0xeb9b('0x38')]);_0x24bac5[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x24bac5[_0xeb9b('0x37')],_0x24bac5[_0xeb9b('0x38')]);_0x31b0c5[_0xeb9b('0x3c')]=_['intersection'](_0x24bac5[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x31b0c5[_0xeb9b('0x3c')]=_0x31b0c5[_0xeb9b('0x3c')][_0xeb9b('0x3d')]?_0x31b0c5[_0xeb9b('0x3c')]:_0x24bac5[_0xeb9b('0x37')];_0x31b0c5[_0xeb9b('0x79')]=qs[_0xeb9b('0x40')](_0x36af5a['query'][_0xeb9b('0x40')]);_0x31b0c5[_0xeb9b('0x41')]=qs['filters'](_['pick'](_0x36af5a[_0xeb9b('0x38')],_0x24bac5[_0xeb9b('0x42')]));if(_0x36af5a['query'][_0xeb9b('0x43')]){_0x31b0c5[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x31b0c5[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x31b0c5[_0xeb9b('0x3c')],function(_0x3cb938){var _0x44562a={};_0x44562a[_0x3cb938]={'$like':'%'+_0x36af5a[_0xeb9b('0x38')]['filter']+'%'};return _0x44562a;})});}_0x31b0c5=_[_0xeb9b('0x44')]({},_0x31b0c5,_0x36af5a[_0xeb9b('0x47')]);return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x4d894e){if(_0x4d894e){_0x5bf4a4=_0x4d894e[_0xeb9b('0x3d')];if(!_0x36af5a['query']['hasOwnProperty'](_0xeb9b('0x3f'))){_0x31b0c5[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x36af5a[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x31b0c5['offset']=qs[_0xeb9b('0x20')](_0x36af5a['query'][_0xeb9b('0x20')]);}return _0x462fa2[_0xeb9b('0x77')](_0x31b0c5);}})[_0xeb9b('0x2b')](function(_0x51628d){if(_0x51628d){return _0x51628d?{'count':_0x5bf4a4,'rows':_0x51628d}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x41af31,null))['catch'](handleError(_0x41af31,null));};exports['getTeams']=function(_0x3f9806,_0x3332ba,_0x25e684){var _0x841fc6={};var _0x175afe={};var _0x57a99e;var _0x2ee62d;return db[_0xeb9b('0x33')]['findOne']({'where':{'id':_0x3f9806[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](handleEntityNotFound(_0x3332ba,null))[_0xeb9b('0x2b')](function(_0x4c303d){if(_0x4c303d){_0x57a99e=_0x4c303d;_0x175afe[_0xeb9b('0x37')]=_[_0xeb9b('0x39')](db[_0xeb9b('0x7a')][_0xeb9b('0x34')]);_0x175afe[_0xeb9b('0x38')]=_[_0xeb9b('0x39')](_0x3f9806['query']);_0x175afe[_0xeb9b('0x42')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],_0x175afe[_0xeb9b('0x38')]);_0x841fc6[_0xeb9b('0x3c')]=_[_0xeb9b('0x3a')](_0x175afe[_0xeb9b('0x37')],qs[_0xeb9b('0x3b')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x3b')]));_0x841fc6[_0xeb9b('0x3c')]=_0x841fc6['attributes'][_0xeb9b('0x3d')]?_0x841fc6[_0xeb9b('0x3c')]:_0x175afe[_0xeb9b('0x37')];_0x841fc6[_0xeb9b('0x79')]=qs['sort'](_0x3f9806['query'][_0xeb9b('0x40')]);_0x841fc6[_0xeb9b('0x41')]=qs[_0xeb9b('0x42')](_[_0xeb9b('0x7b')](_0x3f9806[_0xeb9b('0x38')],_0x175afe[_0xeb9b('0x42')]));if(_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x43')]){_0x841fc6[_0xeb9b('0x41')]=_[_0xeb9b('0x44')](_0x841fc6[_0xeb9b('0x41')],{'$or':_[_0xeb9b('0x32')](_0x841fc6[_0xeb9b('0x3c')],function(_0x5b456a){var _0x13db61={};_0x13db61[_0x5b456a]={'$like':'%'+_0x3f9806[_0xeb9b('0x38')]['filter']+'%'};return _0x13db61;})});}_0x841fc6=_[_0xeb9b('0x44')]({},_0x841fc6,_0x3f9806[_0xeb9b('0x47')]);return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})['then'](function(_0x5c0da1){if(_0x5c0da1){_0x2ee62d=_0x5c0da1[_0xeb9b('0x3d')];if(!_0x3f9806['query'][_0xeb9b('0x3e')](_0xeb9b('0x3f'))){_0x841fc6[_0xeb9b('0x22')]=qs[_0xeb9b('0x22')](_0x3f9806[_0xeb9b('0x38')][_0xeb9b('0x22')]);_0x841fc6[_0xeb9b('0x20')]=qs[_0xeb9b('0x20')](_0x3f9806['query'][_0xeb9b('0x20')]);}return _0x57a99e[_0xeb9b('0x7c')](_0x841fc6);}})[_0xeb9b('0x2b')](function(_0x5e7146){if(_0x5e7146){return _0x5e7146?{'count':_0x2ee62d,'rows':_0x5e7146}:null;}})[_0xeb9b('0x2b')](respondWithResult(_0x3332ba,null))['catch'](handleError(_0x3332ba,null));};exports[_0xeb9b('0x7d')]=function(_0x26d380,_0x3d3b2c,_0x50dae3){var _0x461392=_0x26d380[_0xeb9b('0x52')]['ids'];var _0x33adad;return db[_0xeb9b('0x7a')]['findAll']({'where':{'id':_0x461392},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeb9b('0x7e'),'attributes':['id',_0xeb9b('0x30'),_0xeb9b('0x7f'),_0xeb9b('0x80'),_0xeb9b('0x81')],'raw':!![]}]})[_0xeb9b('0x2b')](function(_0x1a49a7){if(_0x1a49a7){_0x33adad=_0x1a49a7;var _0x40c30f=_[_0xeb9b('0x82')](_0x1a49a7,function(_0xcda621){var _0xb409e0=_0xcda621[_0xeb9b('0x2d')]({'plain':!![]});return _0xb409e0[_0xeb9b('0x7e')];});return db['VoicePrefix'][_0xeb9b('0x4d')]({'where':{'id':_0x26d380[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x52bd7a){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x33e5c3){return _0x52bd7a[_0xeb9b('0x7d')](_0x461392,{'transaction':_0x33e5c3})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x33adad,function(_0x45b94f){return db[_0xeb9b('0x84')]['upsert']({'TeamId':_0x45b94f['id'],'VoicePrefixId':_0x26d380[_0xeb9b('0x4c')]['id']},{'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){return BPromise[_0xeb9b('0x83')](_0x40c30f,function(_0x193304){return db[_0xeb9b('0x85')][_0xeb9b('0x86')]({'where':{'UserId':_0x193304['id'],'VoicePrefixId':_0x26d380['params']['id']},'transaction':_0x33e5c3});});})[_0xeb9b('0x2b')](function(){_0x40c30f[_0xeb9b('0x87')](function(_0xe7dcc5){socket['emit']('userVoicePrefix:save',{'UserId':_0xe7dcc5['id'],'VoicePrefixId':_0x52bd7a['id']});});});});});}})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3d3b2c,null))[_0xeb9b('0x4e')](handleError(_0x3d3b2c,null));};exports[_0xeb9b('0x88')]=function(_0x122550,_0x3e804b,_0x41659f){return db[_0xeb9b('0x7a')][_0xeb9b('0x4a')]({'where':{'id':_0x122550[_0xeb9b('0x38')][_0xeb9b('0x74')]},'attributes':['id'],'include':[{'model':db[_0xeb9b('0x89')],'as':_0xeb9b('0x7e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3e804b,null))[_0xeb9b('0x2b')](function(_0x4b273d){var _0x16c4a5=_['map'](_0x4b273d,'id');var _0x4d39a7=[];var _0x384fba=[];var _0x23893b=squel[_0xeb9b('0x8a')]();_0x23893b[_0xeb9b('0x8b')](_0xeb9b('0x8c'))['from'](_0xeb9b('0x8d'),'tq')['join'](_0xeb9b('0x8e'),'ut',_0xeb9b('0x8f'))[_0xeb9b('0x41')](_0xeb9b('0x90'),_0x122550['params']['id']);for(var _0x1a9933=0x0;_0x1a9933<_0x4b273d[_0xeb9b('0x3d')];_0x1a9933+=0x1){let _0x2bc3b5=_0x4b273d[_0x1a9933];for(var _0x3b28ef=0x0;_0x3b28ef<_0x2bc3b5[_0xeb9b('0x7e')][_0xeb9b('0x3d')];_0x3b28ef+=0x1){let _0x427672=_0x2bc3b5['Agents'][_0x3b28ef];var _0x276e1f=_0x23893b[_0xeb9b('0x91')]();_0x276e1f[_0xeb9b('0x41')](_0xeb9b('0x92'),_0x427672['id']);_0x384fba['push'](db[_0xeb9b('0x50')][_0xeb9b('0x38')](_0x276e1f[_0xeb9b('0x93')](),{'type':db[_0xeb9b('0x50')]['QueryTypes'][_0xeb9b('0x94')]})[_0xeb9b('0x2b')](function(_0x519eff){if(_0x519eff['length']===0x1){return _0x427672['id'];}else{var _0x564125=_[_0xeb9b('0x95')](_['map'](_0x519eff,_0xeb9b('0x96')),function(_0x44ba4b){return _['includes'](_0x16c4a5,_0x44ba4b);});if(_0x564125){return _0x427672['id'];}}}));}}return BPromise['all'](_0x384fba)[_0xeb9b('0x2b')](function(_0x245892){_0x4d39a7=_(_0x4d39a7)[_0xeb9b('0x97')](_0x245892)[_0xeb9b('0x98')]()[_0xeb9b('0x99')]();return db[_0xeb9b('0x33')][_0xeb9b('0x4d')]({'where':{'id':_0x122550[_0xeb9b('0x4c')]['id']}})[_0xeb9b('0x2b')](function(_0x4d5919){return db[_0xeb9b('0x50')][_0xeb9b('0x51')](function(_0x5d3fdf){return _0x4d5919[_0xeb9b('0x88')](_0x122550['query'][_0xeb9b('0x74')],{'transaction':_0x5d3fdf})[_0xeb9b('0x2b')](function(){if(!_[_0xeb9b('0x9a')](_0x4d39a7)){return _0x4d5919['removeAgents'](_0x4d39a7,{'transaction':_0x5d3fdf});}})['then'](function(){_0x4d39a7['forEach'](function(_0x8680da){socket[_0xeb9b('0x72')]('userVoicePrefix:remove',{'UserId':_0x8680da,'VoicePrefixId':_0x4d5919['id']});});});});});});})[_0xeb9b('0x2b')](respondWithStatusCode(_0x3e804b,null))[_0xeb9b('0x4e')](handleError(_0x3e804b,null));}; \ No newline at end of file +var _0x0b0e=['length','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','params','find','describe','sequelize','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','prefix','push','Set','CDR(prefix)=','callerIdAll','goto','charAt','findById','addAgents','omit','ids','spread','emit','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','nolimit','Team','getTeams','addTeams','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','value','isEmpty','removeAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','json','undefined','offset','limit','status','set','apply','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x59e2df,_0x34b599){var _0x913ac7=function(_0x2b2327){while(--_0x2b2327){_0x59e2df['push'](_0x59e2df['shift']());}};_0x913ac7(++_0x34b599);}(_0x0b0e,0x187));var _0xe0b0=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x0b0e[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];config[_0xe0b0('0x18')]=_[_0xe0b0('0x19')](config[_0xe0b0('0x18')],{'host':_0xe0b0('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0b0('0x18')]));require(_0xe0b0('0x1b'))[_0xe0b0('0x1c')](socket);function respondWithStatusCode(_0x24babd,_0x177c24){_0x177c24=_0x177c24||0xcc;return function(_0x55d884){if(_0x55d884){return _0x24babd[_0xe0b0('0x1d')](_0x177c24);}return _0x24babd['status'](_0x177c24)[_0xe0b0('0x1e')]();};}function respondWithResult(_0xadee6e,_0x519ae8){_0x519ae8=_0x519ae8||0xc8;return function(_0x11fdca){if(_0x11fdca){return _0xadee6e['status'](_0x519ae8)[_0xe0b0('0x1f')](_0x11fdca);}};}function respondWithFilteredResult(_0x100204,_0x56bcc7){return function(_0x54a3eb){if(_0x54a3eb){var _0x46bb44=typeof _0x56bcc7['offset']==='undefined'&&typeof _0x56bcc7['limit']===_0xe0b0('0x20');var _0x50fa4a=_0x54a3eb['count'];var _0x10cde1=_0x46bb44?0x0:_0x56bcc7['offset'];var _0x472286=_0x46bb44?_0x54a3eb['count']:_0x56bcc7[_0xe0b0('0x21')]+_0x56bcc7[_0xe0b0('0x22')];var _0x3e10b3;if(_0x472286>=_0x50fa4a){_0x472286=_0x50fa4a;_0x3e10b3=0xc8;}else{_0x3e10b3=0xce;}_0x100204[_0xe0b0('0x23')](_0x3e10b3);return _0x100204[_0xe0b0('0x24')]('Content-Range',_0x10cde1+'-'+_0x472286+'/'+_0x50fa4a)['json'](_0x54a3eb);}return null;};}function patchUpdates(_0x2fa820){return function(_0x5512bb){try{jsonpatch[_0xe0b0('0x25')](_0x5512bb,_0x2fa820,!![]);}catch(_0x31b5f8){return BPromise['reject'](_0x31b5f8);}return _0x5512bb[_0xe0b0('0x26')]();};}function saveUpdates(_0x503883,_0x2208d0){return function(_0x49a727){if(_0x49a727){return _0x49a727[_0xe0b0('0x27')](_0x503883)['then'](function(_0x3e5c88){return _0x3e5c88;});}return null;};}function removeEntity(_0x4de537,_0x4700cc){return function(_0x4aafbe){if(_0x4aafbe){return _0x4aafbe[_0xe0b0('0x28')]()['then'](function(){var _0x362aba=_0x4aafbe[_0xe0b0('0x29')]({'plain':!![]});var _0x1f1ebd=_0xe0b0('0x2a');return db[_0xe0b0('0x2b')][_0xe0b0('0x28')]({'where':{'type':_0x1f1ebd,'resourceId':_0x362aba['id']}})['then'](function(){return _0x4aafbe;});})[_0xe0b0('0x2c')](function(){_0x4de537[_0xe0b0('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e13b,_0x419b1f){return function(_0x36d137){if(!_0x36d137){_0x15e13b[_0xe0b0('0x1d')](0x194);}return _0x36d137;};}function handleError(_0x3cdbd5,_0x254cad){_0x254cad=_0x254cad||0x1f4;return function(_0x136bd4){logger['error'](_0x136bd4[_0xe0b0('0x2d')]);if(_0x136bd4[_0xe0b0('0x2e')]){delete _0x136bd4['name'];}_0x3cdbd5['status'](_0x254cad)[_0xe0b0('0x2f')](_0x136bd4);};}exports[_0xe0b0('0x30')]=function(_0x422575,_0x3f81d5){var _0x2ab1b1={},_0x5866e5={},_0x32acfe={'count':0x0,'rows':[]};var _0x3231fc=_[_0xe0b0('0x31')](db[_0xe0b0('0x32')][_0xe0b0('0x33')],function(_0x4fe835){return{'name':_0x4fe835[_0xe0b0('0x34')],'type':_0x4fe835[_0xe0b0('0x35')][_0xe0b0('0x36')]};});_0x5866e5[_0xe0b0('0x37')]=_[_0xe0b0('0x31')](_0x3231fc,_0xe0b0('0x2e'));_0x5866e5[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x422575[_0xe0b0('0x38')]);_0x5866e5[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x5866e5[_0xe0b0('0x37')],_0x5866e5[_0xe0b0('0x38')]);_0x2ab1b1[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x5866e5['model'],qs[_0xe0b0('0x3d')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x2ab1b1[_0xe0b0('0x3c')]=_0x2ab1b1[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x2ab1b1[_0xe0b0('0x3c')]:_0x5866e5['model'];if(!_0x422575['query']['hasOwnProperty']('nolimit')){_0x2ab1b1[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x422575[_0xe0b0('0x38')]['limit']);_0x2ab1b1[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x21')]);}_0x2ab1b1['order']=qs[_0xe0b0('0x3f')](_0x422575[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x2ab1b1[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x422575[_0xe0b0('0x38')],_0x5866e5[_0xe0b0('0x3a')]),_0x3231fc);if(_0x422575[_0xe0b0('0x38')]['filter']){_0x2ab1b1[_0xe0b0('0x40')]=_['merge'](_0x2ab1b1[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x3231fc,function(_0x46c4ea){if(_0x46c4ea[_0xe0b0('0x35')]!=='VIRTUAL'){var _0x3e1b6b={};_0x3e1b6b[_0x46c4ea[_0xe0b0('0x2e')]]={'$like':'%'+_0x422575[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x3e1b6b;}})});}_0x2ab1b1=_[_0xe0b0('0x43')]({},_0x2ab1b1,_0x422575[_0xe0b0('0x44')]);var _0x3ad564={'where':_0x2ab1b1[_0xe0b0('0x40')]};return db['VoicePrefix'][_0xe0b0('0x45')](_0x3ad564)[_0xe0b0('0x2c')](function(_0x528818){_0x32acfe['count']=_0x528818;if(_0x422575[_0xe0b0('0x38')][_0xe0b0('0x46')]){_0x2ab1b1['include']=[{'all':!![]}];}return db[_0xe0b0('0x32')][_0xe0b0('0x47')](_0x2ab1b1);})[_0xe0b0('0x2c')](function(_0x1c869d){_0x32acfe[_0xe0b0('0x48')]=_0x1c869d;return _0x32acfe;})['then'](respondWithFilteredResult(_0x3f81d5,_0x2ab1b1))['catch'](handleError(_0x3f81d5,null));};exports['show']=function(_0xc3235b,_0x38e715){var _0x5c2f3b={'raw':![],'where':{'id':_0xc3235b[_0xe0b0('0x49')]['id']}},_0x9f7459={};_0x9f7459[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x32')]['rawAttributes']);_0x9f7459['query']=_[_0xe0b0('0x39')](_0xc3235b[_0xe0b0('0x38')]);_0x9f7459[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x9f7459[_0xe0b0('0x37')],_0x9f7459['query']);_0x5c2f3b[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x9f7459['model'],qs['fields'](_0xc3235b['query'][_0xe0b0('0x3d')]));_0x5c2f3b[_0xe0b0('0x3c')]=_0x5c2f3b[_0xe0b0('0x3c')][_0xe0b0('0x3e')]?_0x5c2f3b['attributes']:_0x9f7459[_0xe0b0('0x37')];if(_0xc3235b[_0xe0b0('0x38')]['includeAll']){_0x5c2f3b['include']=[{'all':!![]}];}_0x5c2f3b=_[_0xe0b0('0x43')]({},_0x5c2f3b,_0xc3235b[_0xe0b0('0x44')]);return db['VoicePrefix'][_0xe0b0('0x4a')](_0x5c2f3b)[_0xe0b0('0x2c')](handleEntityNotFound(_0x38e715,null))['then'](respondWithResult(_0x38e715,null))['catch'](handleError(_0x38e715,null));};exports[_0xe0b0('0x28')]=function(_0x511679,_0x165dc8){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x511679[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0x165dc8,null))[_0xe0b0('0x2c')](removeEntity(_0x165dc8,null))['catch'](handleError(_0x165dc8,null));};exports['describe']=function(_0x2ef908,_0x5d380a){return db['VoicePrefix'][_0xe0b0('0x4b')]()[_0xe0b0('0x2c')](respondWithResult(_0x5d380a,null))['catch'](handleError(_0x5d380a,null));};exports['create']=function(_0x13adfb,_0x10b5a6){var _0x17b09f;return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x24115f){return db[_0xe0b0('0x32')]['create'](_0x13adfb[_0xe0b0('0x4e')],{'transaction':_0x24115f})['then'](function(_0x17b3d4){_0x17b09f=_0x17b3d4['get']({'plain':!![]});return db['VoiceExtension'][_0xe0b0('0x4a')]({'where':{'id':_0x17b09f[_0xe0b0('0x4f')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x2f1712){return createVoicePrefixExtensions(_0x17b09f,_0x2f1712,_0x24115f);});});})[_0xe0b0('0x2c')](function(){var _0x2a588d=_0x13adfb[_0xe0b0('0x50')][_0xe0b0('0x29')]({'plain':!![]});if(!_0x2a588d)throw new Error(_0xe0b0('0x51'));if(_0x2a588d['role']===_0xe0b0('0x50')){var _0x57ccc9=_0x17b09f;return db[_0xe0b0('0x52')][_0xe0b0('0x4a')]({'where':{'name':_0xe0b0('0x2a'),'userProfileId':_0x2a588d[_0xe0b0('0x53')]},'raw':!![]})[_0xe0b0('0x2c')](function(_0x3bdb25){if(_0x3bdb25&&_0x3bdb25['autoAssociation']===0x0){return db[_0xe0b0('0x2b')][_0xe0b0('0x54')]({'name':_0x57ccc9[_0xe0b0('0x2e')],'resourceId':_0x57ccc9['id'],'type':_0x3bdb25[_0xe0b0('0x2e')],'sectionId':_0x3bdb25['id']},{})[_0xe0b0('0x2c')](function(){return _0x17b09f;});}else{return _0x17b09f;}})[_0xe0b0('0x55')](function(_0x234cb7){logger[_0xe0b0('0x56')](_0xe0b0('0x57'),_0x234cb7);throw _0x234cb7;});}return _0x17b09f;})[_0xe0b0('0x2c')](respondWithResult(_0x10b5a6,null))[_0xe0b0('0x55')](handleError(_0x10b5a6,null));};function Extension(_0x18ab99,_0xc719d2,_0x10eb99,_0xcdf97){this[_0xe0b0('0x58')]=_0xe0b0('0x59');this[_0xe0b0('0x5a')]=_0x18ab99;this['app']=_0x10eb99;this[_0xe0b0('0x35')]=_0xe0b0('0x5b');this[_0xe0b0('0x5c')]=_0xe0b0('0x5d');this[_0xe0b0('0x5e')]=_0xc719d2;this[_0xe0b0('0x5f')]=_0xcdf97;}function createVoicePrefixExtensions(_0x2bdb59,_0x4f818b,_0x47dcc4){return new BPromise(function(_0x139014,_0x2a0415){var _0x157556=new Extension(formatPrefixName(_0x2bdb59['prefix']),0x1,_0xe0b0('0x60'),_0xe0b0('0x61'));_0x157556[_0xe0b0('0x62')]=_0x2bdb59['id'];return db[_0xe0b0('0x63')][_0xe0b0('0x54')](_0x157556,{'transaction':_0x47dcc4})['then'](function(_0x370f8c){var _0x242120=_0x370f8c[_0xe0b0('0x29')]({'plain':!![]});var _0x54b5d6=_[_0xe0b0('0x31')](addVoicePrefixExtensions(_0x2bdb59,_0x4f818b),function(_0x30b3ae){_0x30b3ae['VoiceExtensionId']=_0x242120['id'];_0x30b3ae[_0xe0b0('0x62')]=_0x2bdb59['id'];return _0x30b3ae;});return db['VoiceExtension']['bulkCreate'](_0x54b5d6,{'transaction':_0x47dcc4})[_0xe0b0('0x2c')](function(_0x57b51e){if(!_0x57b51e){return _0x2a0415('Extensions\x20creation\x20failed');}else{return _0x139014(_0x57b51e);}})[_0xe0b0('0x55')](function(_0xd750b4){return _0x2a0415(_0xd750b4);});});;});};function addVoicePrefixExtensions(_0x2d91f1,_0x1a4fad){var _0x5a7913=[];var _0x3679e0=formatPrefixName(_0x2d91f1[_0xe0b0('0x64')]);_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x2,_0xe0b0('0x66'),_0xe0b0('0x67')+_0x2d91f1[_0xe0b0('0x2e')]));if(_0x2d91f1[_0xe0b0('0x68')]){_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,'Set','PREFIX-CALLERIDALL='+_0x2d91f1[_0xe0b0('0x68')]));}else{_0x5a7913[_0xe0b0('0x65')](new Extension(_0x3679e0,0x3,_0xe0b0('0x60'),'No\x20callerid\x20available'));}_0x5a7913['push'](new Extension(_0x3679e0,0x4,_0xe0b0('0x69'),_0x1a4fad[_0xe0b0('0x58')]+','+'${EXTEN:'+(0x8+_0x2d91f1['name'][_0xe0b0('0x3e')])+'}'+','+0x1));return _0x5a7913;}function formatPrefixName(_0x42b2d3){var _0x38eb8e='_';for(var _0x29175a=0x0;_0x29175a<_0x42b2d3[_0xe0b0('0x3e')];_0x29175a++){if(_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)=='-'){_0x38eb8e+=_0x42b2d3[_0xe0b0('0x6a')](_0x29175a);}else{_0x38eb8e+='['+_0x42b2d3[_0xe0b0('0x6a')](_0x29175a)+']';}}_0x38eb8e+='.';return _0x38eb8e;}exports['update']=function(_0x1daff7,_0x12e245,_0x1673bc){var _0x494420=_0x1daff7['body'];_0x494420['prefix']='system-'+_0x494420['name']+'-';return db['sequelize'][_0xe0b0('0x4d')](function(_0x51b492){return db['VoicePrefix'][_0xe0b0('0x27')](_0x494420,{'where':{'id':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x28')]({'where':{'VoicePrefixId':_0x494420['id']},'transaction':_0x51b492})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0x4a')]({'where':{'id':_0x494420[_0xe0b0('0x4f')]},'raw':!![]})['then'](function(_0x3097fb){return createVoicePrefixExtensions(_0x494420,_0x3097fb,_0x51b492);});});});})[_0xe0b0('0x2c')](function(){return db[_0xe0b0('0x32')][_0xe0b0('0x6b')](_0x494420['id']);})[_0xe0b0('0x2c')](respondWithResult(_0x12e245,null))[_0xe0b0('0x55')](handleError(_0x12e245,null));};exports[_0xe0b0('0x6c')]=function(_0x5e3e28,_0xaf2607,_0x5981a3){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x5e3e28[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xaf2607,null))['then'](function(_0x311f79){if(_0x311f79){return _0x311f79[_0xe0b0('0x6c')](_0x5e3e28['body']['ids'],_[_0xe0b0('0x6d')](_0x5e3e28[_0xe0b0('0x4e')],[_0xe0b0('0x6e'),'id'])||{})[_0xe0b0('0x6f')](function(_0x8b1390){for(var _0x31dd21=0x0;_0x31dd21<_0x5e3e28[_0xe0b0('0x4e')][_0xe0b0('0x6e')][_0xe0b0('0x3e')];_0x31dd21+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:save',{'UserId':Number(_0x5e3e28['body'][_0xe0b0('0x6e')][_0x31dd21]),'VoicePrefixId':Number(_0x5e3e28['params']['id'])});}return _0x8b1390;});}})['then'](respondWithResult(_0xaf2607,null))['catch'](handleError(_0xaf2607,null));};exports['removeAgents']=function(_0x55f064,_0x584350,_0x654d2b){return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x55f064[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x584350,null))[_0xe0b0('0x2c')](function(_0x948708){if(_0x948708){return _0x948708['removeAgents'](_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')])[_0xe0b0('0x2c')](function(){if(_[_0xe0b0('0x71')](_0x55f064[_0xe0b0('0x38')]['ids'])){for(var _0x55d3f8=0x0;_0x55d3f8<_0x55f064['query']['ids']['length'];_0x55d3f8+=0x1){socket[_0xe0b0('0x70')]('userVoicePrefix:remove',{'UserId':Number(_0x55f064[_0xe0b0('0x38')]['ids'][_0x55d3f8]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}}else{socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':Number(_0x55f064[_0xe0b0('0x38')][_0xe0b0('0x6e')]),'VoicePrefixId':Number(_0x55f064[_0xe0b0('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x584350,null))['catch'](handleError(_0x584350,null));};exports['getAgents']=function(_0x58e0e3,_0xc1919f,_0x261381){var _0x264363={};var _0x4377f7={};var _0x2c1149;var _0x534881;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x58e0e3[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](handleEntityNotFound(_0xc1919f,null))[_0xe0b0('0x2c')](function(_0x2a5082){if(_0x2a5082){_0x2c1149=_0x2a5082;_0x4377f7[_0xe0b0('0x37')]=_[_0xe0b0('0x39')](db[_0xe0b0('0x74')]['rawAttributes']);_0x4377f7['query']=_[_0xe0b0('0x39')](_0x58e0e3[_0xe0b0('0x38')]);_0x4377f7['filters']=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],_0x4377f7[_0xe0b0('0x38')]);_0x264363[_0xe0b0('0x3c')]=_[_0xe0b0('0x3b')](_0x4377f7[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x58e0e3[_0xe0b0('0x38')]['fields']));_0x264363['attributes']=_0x264363['attributes'][_0xe0b0('0x3e')]?_0x264363[_0xe0b0('0x3c')]:_0x4377f7['model'];_0x264363[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x264363['where']=qs['filters'](_['pick'](_0x58e0e3[_0xe0b0('0x38')],_0x4377f7[_0xe0b0('0x3a')]));if(_0x58e0e3['query'][_0xe0b0('0x42')]){_0x264363[_0xe0b0('0x40')]=_['merge'](_0x264363['where'],{'$or':_[_0xe0b0('0x31')](_0x264363['attributes'],function(_0x251195){var _0x5f06c0={};_0x5f06c0[_0x251195]={'$like':'%'+_0x58e0e3[_0xe0b0('0x38')][_0xe0b0('0x42')]+'%'};return _0x5f06c0;})});}_0x264363=_[_0xe0b0('0x43')]({},_0x264363,_0x58e0e3[_0xe0b0('0x44')]);return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})[_0xe0b0('0x2c')](function(_0x434dfa){if(_0x434dfa){_0x534881=_0x434dfa[_0xe0b0('0x3e')];if(!_0x58e0e3[_0xe0b0('0x38')]['hasOwnProperty'](_0xe0b0('0x77'))){_0x264363[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x58e0e3['query'][_0xe0b0('0x22')]);_0x264363['offset']=qs[_0xe0b0('0x21')](_0x58e0e3[_0xe0b0('0x38')]['offset']);}return _0x2c1149[_0xe0b0('0x76')](_0x264363);}})['then'](function(_0x528932){if(_0x528932){return _0x528932?{'count':_0x534881,'rows':_0x528932}:null;}})[_0xe0b0('0x2c')](respondWithResult(_0xc1919f,null))['catch'](handleError(_0xc1919f,null));};exports['getTeams']=function(_0x4f027c,_0x1e4bfb,_0x238979){var _0x9e8b9c={};var _0x42b591={};var _0x3da0ce;var _0x4e0429;return db[_0xe0b0('0x32')][_0xe0b0('0x73')]({'where':{'id':_0x4f027c[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e4bfb,null))[_0xe0b0('0x2c')](function(_0x447641){if(_0x447641){_0x3da0ce=_0x447641;_0x42b591['model']=_['keys'](db[_0xe0b0('0x78')]['rawAttributes']);_0x42b591[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x4f027c[_0xe0b0('0x38')]);_0x42b591[_0xe0b0('0x3a')]=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],_0x42b591[_0xe0b0('0x38')]);_0x9e8b9c['attributes']=_[_0xe0b0('0x3b')](_0x42b591[_0xe0b0('0x37')],qs[_0xe0b0('0x3d')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3d')]));_0x9e8b9c['attributes']=_0x9e8b9c['attributes'][_0xe0b0('0x3e')]?_0x9e8b9c[_0xe0b0('0x3c')]:_0x42b591[_0xe0b0('0x37')];_0x9e8b9c[_0xe0b0('0x75')]=qs[_0xe0b0('0x3f')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x3f')]);_0x9e8b9c[_0xe0b0('0x40')]=qs[_0xe0b0('0x3a')](_[_0xe0b0('0x41')](_0x4f027c['query'],_0x42b591[_0xe0b0('0x3a')]));if(_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x42')]){_0x9e8b9c[_0xe0b0('0x40')]=_['merge'](_0x9e8b9c[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x9e8b9c[_0xe0b0('0x3c')],function(_0x116c16){var _0x476763={};_0x476763[_0x116c16]={'$like':'%'+_0x4f027c['query'][_0xe0b0('0x42')]+'%'};return _0x476763;})});}_0x9e8b9c=_['merge']({},_0x9e8b9c,_0x4f027c[_0xe0b0('0x44')]);return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x23c448){if(_0x23c448){_0x4e0429=_0x23c448[_0xe0b0('0x3e')];if(!_0x4f027c['query']['hasOwnProperty'](_0xe0b0('0x77'))){_0x9e8b9c['limit']=qs[_0xe0b0('0x22')](_0x4f027c['query'][_0xe0b0('0x22')]);_0x9e8b9c[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x4f027c[_0xe0b0('0x38')][_0xe0b0('0x21')]);}return _0x3da0ce[_0xe0b0('0x79')](_0x9e8b9c);}})[_0xe0b0('0x2c')](function(_0x5d7cee){if(_0x5d7cee){return _0x5d7cee?{'count':_0x4e0429,'rows':_0x5d7cee}:null;}})['then'](respondWithResult(_0x1e4bfb,null))[_0xe0b0('0x55')](handleError(_0x1e4bfb,null));};exports[_0xe0b0('0x7a')]=function(_0x184938,_0x20d6bd,_0xd83992){var _0x2b4d49=_0x184938[_0xe0b0('0x4e')][_0xe0b0('0x6e')];var _0x1bbb0d;return db[_0xe0b0('0x78')]['findAll']({'where':{'id':_0x2b4d49},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x7b'),'attributes':['id',_0xe0b0('0x2e'),_0xe0b0('0x7c'),_0xe0b0('0x7d'),_0xe0b0('0x7e')],'raw':!![]}]})[_0xe0b0('0x2c')](function(_0x33b67a){if(_0x33b67a){_0x1bbb0d=_0x33b67a;var _0x51995b=_['flatMap'](_0x33b67a,function(_0x302f9f){var _0x1ea4d5=_0x302f9f[_0xe0b0('0x29')]({'plain':!![]});return _0x1ea4d5[_0xe0b0('0x7b')];});return db[_0xe0b0('0x32')][_0xe0b0('0x4a')]({'where':{'id':_0x184938[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x6ef3b2){return db[_0xe0b0('0x4c')]['transaction'](function(_0x46b247){return _0x6ef3b2[_0xe0b0('0x7a')](_0x2b4d49,{'transaction':_0x46b247})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x1bbb0d,function(_0x4250f4){return db[_0xe0b0('0x80')][_0xe0b0('0x81')]({'TeamId':_0x4250f4['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},{'transaction':_0x46b247});});})['then'](function(){return BPromise[_0xe0b0('0x7f')](_0x51995b,function(_0x38f9af){return db[_0xe0b0('0x82')][_0xe0b0('0x83')]({'where':{'UserId':_0x38f9af['id'],'VoicePrefixId':_0x184938[_0xe0b0('0x49')]['id']},'transaction':_0x46b247});});})['then'](function(){_0x51995b[_0xe0b0('0x84')](function(_0x58d61b){socket[_0xe0b0('0x70')](_0xe0b0('0x85'),{'UserId':_0x58d61b['id'],'VoicePrefixId':_0x6ef3b2['id']});});});});});}})[_0xe0b0('0x2c')](respondWithStatusCode(_0x20d6bd,null))['catch'](handleError(_0x20d6bd,null));};exports['removeTeams']=function(_0x45ae1a,_0x2349df,_0x619226){return db['Team']['findAll']({'where':{'id':_0x45ae1a['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe0b0('0x2c')](handleEntityNotFound(_0x2349df,null))[_0xe0b0('0x2c')](function(_0x5ac132){var _0x121257=_[_0xe0b0('0x31')](_0x5ac132,'id');var _0xfd746a=[];var _0xd73b8a=[];var _0x437588=squel['select']();_0x437588['field'](_0xe0b0('0x86'))[_0xe0b0('0x87')](_0xe0b0('0x88'),'tq')['join'](_0xe0b0('0x89'),'ut',_0xe0b0('0x8a'))[_0xe0b0('0x40')](_0xe0b0('0x8b'),_0x45ae1a[_0xe0b0('0x49')]['id']);for(var _0x1b8d4a=0x0;_0x1b8d4a<_0x5ac132['length'];_0x1b8d4a+=0x1){let _0x581848=_0x5ac132[_0x1b8d4a];for(var _0x495635=0x0;_0x495635<_0x581848[_0xe0b0('0x7b')][_0xe0b0('0x3e')];_0x495635+=0x1){let _0x9f9d8d=_0x581848[_0xe0b0('0x7b')][_0x495635];var _0x266cb5=_0x437588[_0xe0b0('0x8c')]();_0x266cb5[_0xe0b0('0x40')](_0xe0b0('0x8d'),_0x9f9d8d['id']);_0xd73b8a['push'](db['sequelize'][_0xe0b0('0x38')](_0x266cb5[_0xe0b0('0x8e')](),{'type':db[_0xe0b0('0x4c')]['QueryTypes'][_0xe0b0('0x8f')]})[_0xe0b0('0x2c')](function(_0x9f1fb){if(_0x9f1fb['length']===0x1){return _0x9f9d8d['id'];}else{var _0x36fa1f=_['every'](_[_0xe0b0('0x31')](_0x9f1fb,_0xe0b0('0x90')),function(_0x1e74a0){return _[_0xe0b0('0x91')](_0x121257,_0x1e74a0);});if(_0x36fa1f){return _0x9f9d8d['id'];}}}));}}return BPromise[_0xe0b0('0x92')](_0xd73b8a)[_0xe0b0('0x2c')](function(_0x12e46f){_0xfd746a=_(_0xfd746a)['union'](_0x12e46f)[_0xe0b0('0x93')]()[_0xe0b0('0x94')]();return db['VoicePrefix'][_0xe0b0('0x4a')]({'where':{'id':_0x45ae1a[_0xe0b0('0x49')]['id']}})[_0xe0b0('0x2c')](function(_0x4dbb7b){return db[_0xe0b0('0x4c')][_0xe0b0('0x4d')](function(_0x221e96){return _0x4dbb7b['removeTeams'](_0x45ae1a[_0xe0b0('0x38')][_0xe0b0('0x6e')],{'transaction':_0x221e96})[_0xe0b0('0x2c')](function(){if(!_[_0xe0b0('0x95')](_0xfd746a)){return _0x4dbb7b[_0xe0b0('0x96')](_0xfd746a,{'transaction':_0x221e96});}})[_0xe0b0('0x2c')](function(){_0xfd746a['forEach'](function(_0x44da91){socket[_0xe0b0('0x70')](_0xe0b0('0x72'),{'UserId':_0x44da91,'VoicePrefixId':_0x4dbb7b['id']});});});});});});})[_0xe0b0('0x2c')](respondWithStatusCode(_0x2349df,null))[_0xe0b0('0x55')](handleError(_0x2349df,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 110b3c5..4563da5 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 _0x46a7=['hasOwnProperty','exports','events','VoicePrefix','setMaxListeners','update','remove','emit'];(function(_0x1031e6,_0x3e5b64){var _0x224542=function(_0x539a1c){while(--_0x539a1c){_0x1031e6['push'](_0x1031e6['shift']());}};_0x224542(++_0x3e5b64);}(_0x46a7,0x1ba));var _0x746a=function(_0x20faff,_0x2b444a){_0x20faff=_0x20faff-0x0;var _0x3799b0=_0x46a7[_0x20faff];return _0x3799b0;};'use strict';var EventEmitter=require(_0x746a('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x746a('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x746a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x746a('0x3'),'afterDestroy':_0x746a('0x4')};function emitEvent(_0x11a255){return function(_0x19b3dc,_0x5bbbf4,_0x11f306){VoicePrefixEvents[_0x746a('0x5')](_0x11a255+':'+_0x19b3dc['id'],_0x19b3dc);VoicePrefixEvents['emit'](_0x11a255,_0x19b3dc);_0x11f306(null);};}for(var e in events){if(events[_0x746a('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x746a('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xd587=['save','update','remove','emit','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x444e8b,_0x3524cc){var _0x35eb37=function(_0x17e1a3){while(--_0x17e1a3){_0x444e8b['push'](_0x444e8b['shift']());}};_0x35eb37(++_0x3524cc);}(_0xd587,0x74));var _0x7d58=function(_0x567236,_0x5d46f1){_0x567236=_0x567236-0x0;var _0x353de4=_0xd587[_0x567236];return _0x353de4;};'use strict';var EventEmitter=require(_0x7d58('0x0'));var VoicePrefix=require(_0x7d58('0x1'))['db'][_0x7d58('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7d58('0x3')](0x0);var events={'afterCreate':_0x7d58('0x4'),'afterUpdate':_0x7d58('0x5'),'afterDestroy':_0x7d58('0x6')};function emitEvent(_0x1aefff){return function(_0x5d5c9b,_0x55cb1b,_0x303df5){VoicePrefixEvents[_0x7d58('0x7')](_0x1aefff+':'+_0x5d5c9b['id'],_0x5d5c9b);VoicePrefixEvents[_0x7d58('0x7')](_0x1aefff,_0x5d5c9b);_0x303df5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x7d58('0x8')](e,emitEvent(event));}}module[_0x7d58('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 51c45f1..1201081 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 _0x960f=['request-promise','path','rimraf','../../config/environment','define','VoicePrefix','voice_prefixes','util','moment','bluebird'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x960f,0x13d));var _0xf960=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x960f[_0x2e6c19];return _0x52885d;};'use strict';var _=require('lodash');var util=require(_0xf960('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf960('0x1'));var BPromise=require(_0xf960('0x2'));var rp=require(_0xf960('0x3'));var fs=require('fs');var path=require(_0xf960('0x4'));var rimraf=require(_0xf960('0x5'));var config=require(_0xf960('0x6'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x59aff5,_0x23f4f1){return _0x59aff5[_0xf960('0x7')](_0xf960('0x8'),attributes,{'tableName':_0xf960('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c65=['lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7c65,0xfa));var _0x57c6=function(_0xb521cf,_0x1adfcc){_0xb521cf=_0xb521cf-0x0;var _0x9bed9=_0x7c65[_0xb521cf];return _0x9bed9;};'use strict';var _=require(_0x57c6('0x0'));var util=require(_0x57c6('0x1'));var logger=require(_0x57c6('0x2'))('api');var moment=require(_0x57c6('0x3'));var BPromise=require(_0x57c6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x57c6('0x5'));var config=require(_0x57c6('0x6'));var attributes=require(_0x57c6('0x7'));module[_0x57c6('0x8')]=function(_0x30be45,_0xd9c736){return _0x30be45[_0x57c6('0x9')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index fb39420..14ba3d3 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 _0x47c5=['VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent'];(function(_0xfe06b2,_0x396b76){var _0x4760f3=function(_0x422fcc){while(--_0x422fcc){_0xfe06b2['push'](_0xfe06b2['shift']());}};_0x4760f3(++_0x396b76);}(_0x47c5,0x165));var _0x547c=function(_0x58a3da,_0x4bb384){_0x58a3da=_0x58a3da-0x0;var _0x2612a2=_0x47c5[_0x58a3da];return _0x2612a2;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});config[_0x547c('0xb')]=_[_0x547c('0xc')](config[_0x547c('0xb')],{'host':_0x547c('0xd'),'port':0x18eb});var socket=require(_0x547c('0xe'))(new Redis(config[_0x547c('0xb')]));require(_0x547c('0xf'))[_0x547c('0x10')](socket);function respondWithRpcPromise(_0x44a581,_0x72828d,_0x2c54e){return new BPromise(function(_0x111457,_0x2455e9){return client[_0x547c('0x11')](_0x44a581,_0x2c54e)[_0x547c('0x12')](function(_0x44ab17){logger['info'](_0x547c('0x13'),_0x72828d,_0x547c('0x14'));logger['debug'](_0x547c('0x15'),_0x72828d,_0x547c('0x14'),JSON[_0x547c('0x16')](_0x44ab17));if(_0x44ab17[_0x547c('0x17')]){if(_0x44ab17[_0x547c('0x17')][_0x547c('0x18')]===0x1f4){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x2455e9(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x111457(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x72828d,_0x547c('0x14'));_0x111457(_0x44ab17[_0x547c('0x1a')][_0x547c('0x19')]);}})['catch'](function(_0x248aca){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x248aca);_0x2455e9(_0x248aca);});});} \ No newline at end of file +var _0x1c01=['jayson/promise','client','redis','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x7ead1,_0x1652d7){var _0x4cd421=function(_0x26cbd3){while(--_0x26cbd3){_0x7ead1['push'](_0x7ead1['shift']());}};_0x4cd421(++_0x1652d7);}(_0x1c01,0x190));var _0x11c0=function(_0x114fa8,_0x648cdf){_0x114fa8=_0x114fa8-0x0;var _0x9fef6e=_0x1c01[_0x114fa8];return _0x9fef6e;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var moment=require(_0x11c0('0x2'));var BPromise=require(_0x11c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11c0('0x5'))(_0x11c0('0x6'));var config=require(_0x11c0('0x7'));var jayson=require(_0x11c0('0x8'));var client=jayson[_0x11c0('0x9')]['http']({'port':0x232a});config[_0x11c0('0xa')]=_['defaults'](config[_0x11c0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x11c0('0xb'))(new Redis(config['redis']));require(_0x11c0('0xc'))['register'](socket);function respondWithRpcPromise(_0x5de14e,_0xba38f,_0x5e8002){return new BPromise(function(_0x426122,_0x39b2ac){return client[_0x11c0('0xd')](_0x5de14e,_0x5e8002)[_0x11c0('0xe')](function(_0x3cc04b){logger['info'](_0x11c0('0xf'),_0xba38f,_0x11c0('0x10'));logger[_0x11c0('0x11')](_0x11c0('0x12'),_0xba38f,'request\x20sent',JSON['stringify'](_0x3cc04b));if(_0x3cc04b[_0x11c0('0x13')]){if(_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x14')]===0x1f4){logger[_0x11c0('0x13')](_0x11c0('0xf'),_0xba38f,_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x15')]);return _0x39b2ac(_0x3cc04b['error'][_0x11c0('0x15')]);}logger['error'](_0x11c0('0xf'),_0xba38f,_0x3cc04b['error'][_0x11c0('0x15')]);return _0x426122(_0x3cc04b[_0x11c0('0x13')][_0x11c0('0x15')]);}else{logger['info'](_0x11c0('0xf'),_0xba38f,_0x11c0('0x10'));_0x426122(_0x3cc04b[_0x11c0('0x16')][_0x11c0('0x15')]);}})[_0x11c0('0x17')](function(_0x3d0a2e){logger['error']('VoicePrefix,\x20%s,\x20%s',_0xba38f,_0x3d0a2e);_0x39b2ac(_0x3d0a2e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 0ffe986..67720f6 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 _0xf151=['length','remove','update','emit','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf151,0xab));var _0x1f15=function(_0x327f3b,_0x1c6659){_0x327f3b=_0x327f3b-0x0;var _0x256f88=_0xf151[_0x327f3b];return _0x256f88;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x1f15('0x0'),_0x1f15('0x1')];function createListener(_0x246eb6,_0x338be9){return function(_0x24018f){_0x338be9[_0x1f15('0x2')](_0x246eb6,_0x24018f);};}function removeListener(_0x24c89c,_0x2fbef0){return function(){VoicePrefixEvents['removeListener'](_0x24c89c,_0x2fbef0);};}exports[_0x1f15('0x3')]=function(_0x5548bb){for(var _0x4cfc7b=0x0,_0x5ecda5=events[_0x1f15('0x4')];_0x4cfc7b<_0x5ecda5;_0x4cfc7b++){var _0x166156=events[_0x4cfc7b];var _0xc7ae4b=createListener('voicePrefix:'+_0x166156,_0x5548bb);VoicePrefixEvents['on'](_0x166156,_0xc7ae4b);}}; \ No newline at end of file +var _0xb58b=['save','remove','update','removeListener','register','length','voicePrefix:'];(function(_0x1d04b3,_0x2dfd11){var _0x1cf900=function(_0x34a7d9){while(--_0x34a7d9){_0x1d04b3['push'](_0x1d04b3['shift']());}};_0x1cf900(++_0x2dfd11);}(_0xb58b,0x1f1));var _0xbb58=function(_0x505507,_0x43ef96){_0x505507=_0x505507-0x0;var _0x4cf336=_0xb58b[_0x505507];return _0x4cf336;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xbb58('0x0'),_0xbb58('0x1'),_0xbb58('0x2')];function createListener(_0x4f5d42,_0x340c23){return function(_0x4e6d6c){_0x340c23['emit'](_0x4f5d42,_0x4e6d6c);};}function removeListener(_0x226363,_0x546510){return function(){VoicePrefixEvents[_0xbb58('0x3')](_0x226363,_0x546510);};}exports[_0xbb58('0x4')]=function(_0x33fe85){for(var _0x5cf8b1=0x0,_0x27cbda=events[_0xbb58('0x5')];_0x5cf8b1<_0x27cbda;_0x5cf8b1++){var _0xe874f2=events[_0x5cf8b1];var _0x5d7fe8=createListener(_0xbb58('0x6')+_0xe874f2,_0x33fe85);VoicePrefixEvents['on'](_0xe874f2,_0x5d7fe8);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index dbde4df..5467234 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(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0xb10b,0x12a));var _0xbb10=function(_0xd46333,_0x1b05c1){_0xd46333=_0xd46333-0x0;var _0x336108=_0xb10b[_0xd46333];return _0x336108;};'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(_0x52cc68,_0x440163){var _0x572cd4=function(_0xdd8786){while(--_0xdd8786){_0x52cc68['push'](_0x52cc68['shift']());}};_0x572cd4(++_0x440163);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index bae6ee0..648106b 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 _0xa9e0=['yes','all','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','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\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)','07:00-22:00,*,*,*','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','outbound','inbound','ENUM','fewestcalls','random','wrandom','rrordered','ringall','setDataValue','rrmemory','getDataValue','type','dialMethod','strategy','preview','roundrobin','includes','INTEGER'];(function(_0x576e92,_0x165314){var _0x24c32e=function(_0x1648b1){while(--_0x1648b1){_0x576e92['push'](_0x576e92['shift']());}};_0x24c32e(++_0x165314);}(_0xa9e0,0x88));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')],'allowNull':![],'unique':_0x0a9e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x6')]('rr','ringall','leastrecent',_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),_0x0a9e('0xa')),'allowNull':![],'defaultValue':_0x0a9e('0xb'),'set':function(_0x519edd){this[_0x0a9e('0xc')]('strategy',_0x519edd?_0x519edd:_0x0a9e('0xd'));},'get':function(){var _0x322810=this[_0x0a9e('0xe')](_0x0a9e('0xf'));var _0x64155d=this[_0x0a9e('0xe')](_0x0a9e('0x10'));var _0x3cfc31=this[_0x0a9e('0xe')](_0x0a9e('0x11'));if(_0x322810===_0x0a9e('0x4')){if(_0x64155d===_0x0a9e('0x12')){return null;}if(_0x64155d==='booked'&&!['rrmemory',_0x0a9e('0x13')][_0x0a9e('0x14')](_0x3cfc31)){this[_0x0a9e('0xc')]('strategy',_0x0a9e('0xd'));}}return _0x3cfc31;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0a9e('0x15')](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize[_0x0a9e('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x6')]('yes','no'),'defaultValue':_0x0a9e('0x16')},'autopause':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no',_0x0a9e('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x0a9e('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0a9e('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x0a9e('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x47b32c){this[_0x0a9e('0xc')]('periodic_announce',_0x47b32c?_0x47b32c['join'](','):[]);},'get':function(){return this[_0x0a9e('0xe')]('periodic_announce')?this[_0x0a9e('0xe')](_0x0a9e('0x18'))[_0x0a9e('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x16'),'set':function(_0x32eae4){this[_0x0a9e('0xc')](_0x0a9e('0x1a'),_0x32eae4?_0x32eae4[_0x0a9e('0x1b')](','):undefined);},'get':function(){return this[_0x0a9e('0xe')](_0x0a9e('0x1a'))?this['getDataValue'](_0x0a9e('0x1a'))[_0x0a9e('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x5790bb){this[_0x0a9e('0xc')](_0x0a9e('0x1c'),_0x5790bb?_0x5790bb[_0x0a9e('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1c'))?this[_0x0a9e('0xe')](_0x0a9e('0x1c'))[_0x0a9e('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0a9e('0x6')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0a9e('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x0a9e('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x0a9e('0x1d')],'defaultValue':0x0,'set':function(_0x6dee02){this[_0x0a9e('0xc')](_0x0a9e('0x1e'),_0x6dee02);if(_0x6dee02){if(this[_0x0a9e('0xe')](_0x0a9e('0x1f'))<0x2){this[_0x0a9e('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1d')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0x0a9e('0x20'),_0x0a9e('0x21'),'predictive',_0x0a9e('0x22')),'defaultValue':'progressive','comment':_0x0a9e('0x23')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x15')](0x4)[_0x0a9e('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x25')},'dialLimitQueue':{'type':Sequelize[_0x0a9e('0x15')](0x4)[_0x0a9e('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x0a9e('0x26')](0x2)[_0x0a9e('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor','dropRate'),'defaultValue':_0x0a9e('0x28'),'comment':_0x0a9e('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x26')](0x2)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0a9e('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'tTxX','comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)[_0x0a9e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)[_0x0a9e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0a9e('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)[_0x0a9e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0a9e('0x33')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0a9e('0x6')]('always','never','onlyIfOpen'),'defaultValue':_0x0a9e('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x35')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0a9e('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x15')](0x9)[_0x0a9e('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x15')](0x9)[_0x0a9e('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x37')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x15')](0x9)[_0x0a9e('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x15')](0x9)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x15')](0x9)[_0x0a9e('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x15')](0x5)[_0x0a9e('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3d')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1d')],'defaultValue':0x0,'comment':_0x0a9e('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a9e('0x6')](_0x0a9e('0x3f'),_0x0a9e('0x40')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x42')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)[_0x0a9e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)[_0x0a9e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x47')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)[_0x0a9e('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x48')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x15')],'allowNull':!![],'comment':_0x0a9e('0x4b')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1d')],'defaultValue':![],'comment':_0x0a9e('0x4c'),'set':function(_0x26d61e){if(!_0x26d61e)this[_0x0a9e('0xc')](_0x0a9e('0x4d'),null);this['setDataValue'](_0x0a9e('0x4e'),_0x26d61e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0a9e('0x15')](0x3)[_0x0a9e('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0a9e('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0a9e('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0xe0c5=['mandatoryDisposition','STRING','name','ENUM','inbound','outbound','default','ringall','random','rrmemory','linear','wrandom','rrordered','strategy','type','dialMethod','getDataValue','preview','booked','roundrobin','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1e2283,_0x4b2249){var _0x51c6e0=function(_0x425fe4){while(--_0x425fe4){_0x1e2283['push'](_0x1e2283['shift']());}};_0x51c6e0(++_0x4b2249);}(_0xe0c5,0x19b));var _0x5e0c=function(_0x3410f2,_0x251306){_0x3410f2=_0x3410f2-0x0;var _0x2da4cc=_0xe0c5[_0x3410f2];return _0x2da4cc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5e0c('0x0')],'allowNull':![],'unique':_0x5e0c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x3'),_0x5e0c('0x4')),'allowNull':![],'defaultValue':_0x5e0c('0x3')},'musiconhold':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':_0x5e0c('0x5')},'announce':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5e0c('0x2')]('rr',_0x5e0c('0x6'),'leastrecent','fewestcalls',_0x5e0c('0x7'),_0x5e0c('0x8'),_0x5e0c('0x9'),_0x5e0c('0xa'),_0x5e0c('0xb')),'allowNull':![],'defaultValue':'ringall','set':function(_0x527bcd){this['setDataValue'](_0x5e0c('0xc'),_0x527bcd?_0x527bcd:_0x5e0c('0x8'));},'get':function(){var _0x20a987=this['getDataValue'](_0x5e0c('0xd'));var _0x5bc21c=this['getDataValue'](_0x5e0c('0xe'));var _0x32be8a=this[_0x5e0c('0xf')](_0x5e0c('0xc'));if(_0x20a987===_0x5e0c('0x4')){if(_0x5bc21c===_0x5e0c('0x10')){return null;}if(_0x5bc21c===_0x5e0c('0x11')&&![_0x5e0c('0x8'),_0x5e0c('0x12')]['includes'](_0x32be8a)){this['setDataValue']('strategy','rrmemory');}}return _0x32be8a;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5e0c('0x13')](0xb)},'timeout':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5e0c('0x0')]},'weight':{'type':Sequelize[_0x5e0c('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x5e0c('0x2')]('yes','no',_0x5e0c('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5e0c('0x13')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5e0c('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5e0c('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x5e0c('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5e0c('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5e0c('0x14')},'announce_holdtime':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no',_0x5e0c('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x5e0c('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5e0c('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5e0c('0x0')]},'queue_youarenext':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5e0c('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x5e0c('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x5e0c('0x0')]},'queue_less_than':{'type':Sequelize[_0x5e0c('0x0')]},'periodic_announce':{'type':Sequelize[_0x5e0c('0x17')],'set':function(_0x52251f){this[_0x5e0c('0x18')](_0x5e0c('0x19'),_0x52251f?_0x52251f[_0x5e0c('0x1a')](','):[]);},'get':function(){return this[_0x5e0c('0xf')](_0x5e0c('0x19'))?this[_0x5e0c('0xf')](_0x5e0c('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x5e0c('0x14'),'set':function(_0x1140ef){this['setDataValue'](_0x5e0c('0x1b'),_0x1140ef?_0x1140ef[_0x5e0c('0x1a')](','):undefined);},'get':function(){return this[_0x5e0c('0xf')](_0x5e0c('0x1b'))?this[_0x5e0c('0xf')](_0x5e0c('0x1b'))[_0x5e0c('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':'no','set':function(_0xf29bb6){this[_0x5e0c('0x18')]('leavewhenempty',_0xf29bb6?_0xf29bb6['join'](','):undefined);},'get':function(){return this[_0x5e0c('0xf')](_0x5e0c('0x1d'))?this[_0x5e0c('0xf')](_0x5e0c('0x1d'))[_0x5e0c('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5e0c('0x0')]},'description':{'type':Sequelize[_0x5e0c('0x0')]},'acw':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':0x0,'set':function(_0x2cea3e){this[_0x5e0c('0x18')](_0x5e0c('0x1f'),_0x2cea3e);if(_0x2cea3e){if(this[_0x5e0c('0xf')](_0x5e0c('0x20'))<0x2){this[_0x5e0c('0x18')](_0x5e0c('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5e0c('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5e0c('0x21')},'dialMethod':{'type':Sequelize['ENUM'](_0x5e0c('0x10'),'progressive','power',_0x5e0c('0x22'),'booked'),'defaultValue':_0x5e0c('0x23'),'comment':_0x5e0c('0x24')},'dialLimitChannel':{'type':Sequelize[_0x5e0c('0x13')](0x4)[_0x5e0c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5e0c('0x26')},'dialLimitQueue':{'type':Sequelize[_0x5e0c('0x13')](0x4)[_0x5e0c('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5e0c('0x27')},'dialPowerLevel':{'type':Sequelize[_0x5e0c('0x28')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x5e0c('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x2a'),'dropRate'),'defaultValue':_0x5e0c('0x2b'),'comment':_0x5e0c('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5e0c('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5e0c('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5e0c('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':_0x5e0c('0x2f'),'comment':_0x5e0c('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x31')},'dialQueueProject':{'type':Sequelize[_0x5e0c('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'comment':_0x5e0c('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5e0c('0x36')},'dialTimezone':{'type':Sequelize[_0x5e0c('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5e0c('0x37')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5e0c('0x2')]('always','never',_0x5e0c('0x38')),'defaultValue':_0x5e0c('0x39')},'dialAMDActive':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':0x0,'comment':_0x5e0c('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x5e0c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5e0c('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x5e0c('0x13')](0x9)[_0x5e0c('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5e0c('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5e0c('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5e0c('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5e0c('0x13')](0x9)[_0x5e0c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e0c('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x5e0c('0x13')](0x9)[_0x5e0c('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5e0c('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5e0c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5e0c('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5e0c('0x13')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5e0c('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5e0c('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e0c('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5e0c('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':0x0,'comment':_0x5e0c('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5e0c('0x2')](_0x5e0c('0x45'),'ASC'),'defaultValue':_0x5e0c('0x45')},'dialQueueProject2':{'type':Sequelize[_0x5e0c('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e0c('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e0c('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e0c('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5e0c('0x13')](0x5)[_0x5e0c('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5e0c('0x13')],'allowNull':!![],'comment':_0x5e0c('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5e0c('0x4f'),'set':function(_0x3d877e){if(!_0x3d877e)this[_0x5e0c('0x18')](_0x5e0c('0x50'),null);this[_0x5e0c('0x18')](_0x5e0c('0x51'),_0x3d877e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x5e0c('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x5e0c('0x13')](0x3)[_0x5e0c('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x5e0c('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 1c3893f..58286bf 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(_0x419628,_0x421ece){var _0x57a110=function(_0x596e9a){while(--_0x596e9a){_0x419628['push'](_0x419628['shift']());}};_0x57a110(++_0x421ece);}(_0xe14b,0x93));var _0xbe14=function(_0x15990b,_0x54e348){_0x15990b=_0x15990b-0x0;var _0x3201ce=_0xe14b[_0x15990b];return _0x3201ce;};'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 _0x7fbe=['send','VoiceQueue','rawAttributes','fieldName','key','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','inbound','outbound','update','getHoppers','findOne','hasOwnProperty','nolimit','order','sort','VoiceQueueId','CmHopper','CmHopperHistory','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','forEach','penalty','sequelize','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','interface','format','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','emit','online','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','cm_contacts','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','VoiceQueues','QueueCampaigns','filter','map','value','type','name','sendStatus','error'];(function(_0x4f66c2,_0x47d4ed){var _0x447633=function(_0x3205d4){while(--_0x3205d4){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x447633(++_0x47d4ed);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2d604d,_0x51a1f5){_0x2d604d=_0x2d604d-0x0;var _0x159761=_0x7fbe[_0x2d604d];return _0x159761;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xe7fb('0x0'));var _=require(_0xe7fb('0x1'));var squel=require(_0xe7fb('0x2'));var Redis=require(_0xe7fb('0x3'));var qs=require(_0xe7fb('0x4'));var logger=require(_0xe7fb('0x5'))(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var db=require(_0xe7fb('0x8'))['db'];config[_0xe7fb('0x9')]=_[_0xe7fb('0xa')](config[_0xe7fb('0x9')],{'host':_0xe7fb('0xb'),'port':0x18eb});var socket=require(_0xe7fb('0xc'))(new Redis(config['redis']));require(_0xe7fb('0xd'))[_0xe7fb('0xe')](socket);function respondWithStatusCode(_0x1d0741,_0x190a7a){_0x190a7a=_0x190a7a||0xcc;return function(_0x4ba197){if(_0x4ba197){return _0x1d0741['sendStatus'](_0x190a7a);}return _0x1d0741[_0xe7fb('0xf')](_0x190a7a)[_0xe7fb('0x10')]();};}function respondWithResult(_0x41a514,_0x348a73){_0x348a73=_0x348a73||0xc8;return function(_0x2a2223){if(_0x2a2223){return _0x41a514[_0xe7fb('0xf')](_0x348a73)[_0xe7fb('0x11')](_0x2a2223);}};}function respondWithFilteredResult(_0x3c07f3,_0x325035){return function(_0x2fe8ab){if(_0x2fe8ab){var _0x2437d4=typeof _0x325035[_0xe7fb('0x12')]===_0xe7fb('0x13')&&typeof _0x325035[_0xe7fb('0x14')]===_0xe7fb('0x13');var _0x598729=_0x2fe8ab[_0xe7fb('0x15')];var _0x2225e5=_0x2437d4?0x0:_0x325035['offset'];var _0x30015a=_0x2437d4?_0x2fe8ab[_0xe7fb('0x15')]:_0x325035['offset']+_0x325035[_0xe7fb('0x14')];var _0x559129;if(_0x30015a>=_0x598729){_0x30015a=_0x598729;_0x559129=0xc8;}else{_0x559129=0xce;}_0x3c07f3[_0xe7fb('0xf')](_0x559129);return _0x3c07f3[_0xe7fb('0x16')](_0xe7fb('0x17'),_0x2225e5+'-'+_0x30015a+'/'+_0x598729)[_0xe7fb('0x11')](_0x2fe8ab);}return null;};}function saveUpdates(_0x562262){return function(_0x892b0f){if(_0x892b0f){return _0x892b0f['update'](_0x562262)[_0xe7fb('0x18')](function(_0x546463){return _0x546463;});}return null;};}function removeEntity(_0x1e77fd){return function(_0x4708f7){if(_0x4708f7){return _0x4708f7[_0xe7fb('0x19')]()[_0xe7fb('0x18')](function(){var _0x5df1a1=_0x4708f7[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d1c87=[{'name':_0xe7fb('0x1b'),'value':'inbound','ignore':![]},{'name':_0xe7fb('0x1c'),'value':'outbound','ignore':![]}];var _0xa5af01=_(_0x5d1c87)[_0xe7fb('0x1d')]('ignore')[_0xe7fb('0x1e')](_0xe7fb('0x1f'))[_0xe7fb('0x1f')]();if(_['includes'](_0xa5af01,_0x5df1a1[_0xe7fb('0x20')])){return;}var _0x469ead=_['find'](_0x5d1c87,['value',_0x5df1a1['type']])[_0xe7fb('0x21')];return db['UserProfileResource']['destroy']({'where':{'type':_0x469ead,'resourceId':_0x5df1a1['id']}})[_0xe7fb('0x18')](function(){return _0x4708f7;});})[_0xe7fb('0x18')](function(){_0x1e77fd[_0xe7fb('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6c930){return function(_0x2b69c4){if(!_0x2b69c4){_0x6c930[_0xe7fb('0x22')](0x194);}return _0x2b69c4;};}function handleError(_0x1ceed8,_0x392d75){_0x392d75=_0x392d75||0x1f4;return function(_0x16237a){logger[_0xe7fb('0x23')](_0x16237a['stack']);if(_0x16237a['name']){delete _0x16237a[_0xe7fb('0x21')];}_0x1ceed8[_0xe7fb('0xf')](_0x392d75)[_0xe7fb('0x24')](_0x16237a);};}exports['index']=function(_0xb1f2f4,_0x251807){var _0xd3fffe={};var _0x5f265f={'count':0x0,'rows':[]};var _0x219554=_[_0xe7fb('0x1e')](db[_0xe7fb('0x25')][_0xe7fb('0x26')],function(_0x4ce993){return{'name':_0x4ce993[_0xe7fb('0x27')],'type':_0x4ce993[_0xe7fb('0x20')][_0xe7fb('0x28')]};});_0xd3fffe=qs['getOptions'](_0x219554,_0xb1f2f4);var _0x517d70={'where':_0xd3fffe[_0xe7fb('0x29')]};return db['VoiceQueue'][_0xe7fb('0x15')](_0x517d70)[_0xe7fb('0x18')](function(_0xe49053){_0x5f265f[_0xe7fb('0x15')]=_0xe49053;_0xd3fffe['include']=qs[_0xe7fb('0x2a')](_0xb1f2f4[_0xe7fb('0x2b')]);return db[_0xe7fb('0x25')][_0xe7fb('0x2c')](_0xd3fffe);})[_0xe7fb('0x18')](function(_0x480819){_0x5f265f[_0xe7fb('0x2d')]=_0x480819;return _0x5f265f;})[_0xe7fb('0x18')](respondWithFilteredResult(_0x251807,_0xd3fffe))[_0xe7fb('0x2e')](handleError(_0x251807,null));};exports[_0xe7fb('0x2f')]=function(_0x46f430,_0x25e925){var _0x1bc72d={'raw':![],'where':{'id':_0x46f430[_0xe7fb('0x30')]['id']}},_0x147eb1={};_0x147eb1['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')][_0xe7fb('0x26')]);_0x147eb1['query']=_[_0xe7fb('0x31')](_0x46f430[_0xe7fb('0x2b')]);_0x147eb1[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],_0x147eb1[_0xe7fb('0x2b')]);_0x1bc72d[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x147eb1[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x1bc72d[_0xe7fb('0x35')]=_0x1bc72d[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x1bc72d[_0xe7fb('0x35')]:_0x147eb1[_0xe7fb('0x34')];if(_0x46f430[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x1bc72d['include']=[{'all':!![]}];}_0x1bc72d=_[_0xe7fb('0x39')]({},_0x1bc72d,_0x46f430[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x1bc72d)['then'](handleEntityNotFound(_0x25e925,null))[_0xe7fb('0x18')](respondWithResult(_0x25e925,null))[_0xe7fb('0x2e')](handleError(_0x25e925,null));};exports[_0xe7fb('0x3c')]=function(_0x413a13,_0x49fe9d){return db[_0xe7fb('0x25')][_0xe7fb('0x3c')](_0x413a13[_0xe7fb('0x3d')],{})[_0xe7fb('0x18')](function(_0x468d16){var _0xb729fc=_0x413a13['user'][_0xe7fb('0x1a')]({'plain':!![]});if(!_0xb729fc)throw new Error(_0xe7fb('0x3e'));if(_0xb729fc[_0xe7fb('0x3f')]==='user'){var _0x36a341=_0x468d16[_0xe7fb('0x1a')]({'plain':!![]});var _0x5d42ac=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x900d67=_[_0xe7fb('0x3b')](_0x5d42ac,[_0xe7fb('0x1f'),_0x36a341['type']])[_0xe7fb('0x21')];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x900d67,'userProfileId':_0xb729fc[_0xe7fb('0x40')]},'raw':!![]})['then'](function(_0x108a16){if(_0x108a16&&_0x108a16[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x36a341['name'],'resourceId':_0x36a341['id'],'type':_0x108a16[_0xe7fb('0x21')],'sectionId':_0x108a16['id']},{})[_0xe7fb('0x18')](function(){return _0x468d16;});}else{return _0x468d16;}})[_0xe7fb('0x2e')](function(_0x56a84f){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x56a84f);throw _0x56a84f;});}return _0x468d16;})[_0xe7fb('0x18')](respondWithResult(_0x49fe9d,0xc9))[_0xe7fb('0x2e')](handleError(_0x49fe9d,null));};exports[_0xe7fb('0x44')]=function(_0x5a1ce1,_0x2eb999){var _0x4df4aa={'where':{'id':_0x5a1ce1[_0xe7fb('0x30')]['id']}},_0x2c72dd={};_0x2c72dd[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x25')]['rawAttributes']);_0x4df4aa[_0xe7fb('0x35')]=_['intersection'](_0x2c72dd['model'],qs[_0xe7fb('0x36')](_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4df4aa['attributes']=_0x4df4aa[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x4df4aa['attributes']:_0x2c72dd['model'];if(_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4df4aa[_0xe7fb('0x2a')]=[{'all':!![]}];}_0x4df4aa=_[_0xe7fb('0x39')]({},_0x4df4aa,_0x5a1ce1[_0xe7fb('0x3a')]);return db[_0xe7fb('0x25')][_0xe7fb('0x3b')](_0x4df4aa)[_0xe7fb('0x18')](handleEntityNotFound(_0x2eb999,null))['then'](function(_0x925a5e){if(_0x925a5e){var _0x5cc28f=_0x925a5e[_0xe7fb('0x1a')]({'plain':!![]});_0x5cc28f=qs[_0xe7fb('0x45')](_0x5cc28f,['id','createdAt',_0xe7fb('0x46')]);_0x5a1ce1['body']=_[_0xe7fb('0x45')](_0x5a1ce1['body'],['id',_0xe7fb('0x47'),'updatedAt']);return db[_0xe7fb('0x25')]['create'](_[_0xe7fb('0x39')](_0x5cc28f,_0x5a1ce1[_0xe7fb('0x3d')]),{'include':_0x5a1ce1[_0xe7fb('0x2b')][_0xe7fb('0x38')]?[{'all':!![]}]:undefined})[_0xe7fb('0x18')](function(_0x2f959d){var _0x2f4760=_0x5a1ce1['user']['get']({'plain':!![]});if(!_0x2f4760)throw new Error(_0xe7fb('0x3e'));if(_0x2f4760['role']==='user'){var _0x4c3eb7=_0x2f959d['get']({'plain':!![]});var _0x539252=[{'name':_0xe7fb('0x1b'),'value':_0xe7fb('0x48')},{'name':_0xe7fb('0x1c'),'value':_0xe7fb('0x49')}];var _0x59c92d=_[_0xe7fb('0x3b')](_0x539252,[_0xe7fb('0x1f'),_0x4c3eb7[_0xe7fb('0x20')]])['name'];return db['UserProfileSection'][_0xe7fb('0x3b')]({'where':{'name':_0x59c92d,'userProfileId':_0x2f4760[_0xe7fb('0x40')]},'raw':!![]})[_0xe7fb('0x18')](function(_0x4f4ba3){if(_0x4f4ba3&&_0x4f4ba3[_0xe7fb('0x41')]===0x0){return db[_0xe7fb('0x42')][_0xe7fb('0x3c')]({'name':_0x4c3eb7[_0xe7fb('0x21')],'resourceId':_0x4c3eb7['id'],'type':_0x4f4ba3['name'],'sectionId':_0x4f4ba3['id']},{})['then'](function(){return _0x2f959d;});}else{return _0x2f959d;}})[_0xe7fb('0x2e')](function(_0x3104c2){logger[_0xe7fb('0x23')](_0xe7fb('0x43'),_0x3104c2);throw _0x3104c2;});}return _0x2f959d;});}})[_0xe7fb('0x18')](respondWithResult(_0x2eb999,0xc9))['catch'](handleError(_0x2eb999,null));};exports[_0xe7fb('0x4a')]=function(_0x349a2a,_0x23755b){if(_0x349a2a['body']['id']){delete _0x349a2a['body']['id'];}return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x349a2a[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23755b,null))[_0xe7fb('0x18')](saveUpdates(_0x349a2a[_0xe7fb('0x3d')],null))['then'](respondWithResult(_0x23755b,null))[_0xe7fb('0x2e')](handleError(_0x23755b,null));};exports[_0xe7fb('0x19')]=function(_0x2cd4e5,_0x1aef59){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x2cd4e5['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1aef59,null))['then'](removeEntity(_0x1aef59,null))[_0xe7fb('0x2e')](handleError(_0x1aef59,null));};exports[_0xe7fb('0x4b')]=function(_0x116c7e,_0x1b24fd){var _0x5925e6={'raw':![],'where':{}};var _0x47ac92={};var _0x2789a4={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x116c7e[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x1b24fd,null))['then'](function(_0x4096d4){if(_0x4096d4){_0x47ac92['model']=_[_0xe7fb('0x31')](db['CmHopper']['rawAttributes']);_0x47ac92[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x116c7e[_0xe7fb('0x2b')]);_0x47ac92['filters']=_[_0xe7fb('0x33')](_0x47ac92[_0xe7fb('0x34')],_0x47ac92[_0xe7fb('0x2b')]);_0x5925e6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x47ac92['model'],qs[_0xe7fb('0x36')](_0x116c7e[_0xe7fb('0x2b')]['fields']));_0x5925e6[_0xe7fb('0x35')]=_0x5925e6[_0xe7fb('0x35')]['length']?_0x5925e6[_0xe7fb('0x35')]:_0x47ac92['model'];if(!_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x5925e6['limit']=qs[_0xe7fb('0x14')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x5925e6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0x5925e6[_0xe7fb('0x4f')]=qs['sort'](_0x116c7e['query'][_0xe7fb('0x50')]);_0x5925e6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x116c7e['query'],_0x47ac92[_0xe7fb('0x32')]));_0x5925e6[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4096d4['id'];if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x5925e6[_0xe7fb('0x29')]=_[_0xe7fb('0x39')](_0x5925e6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x5925e6[_0xe7fb('0x35')],function(_0x1ff5e7){var _0xf423ab={};_0xf423ab[_0x1ff5e7]={'$like':'%'+_0x116c7e[_0xe7fb('0x2b')]['filter']+'%'};return _0xf423ab;})});}_0x5925e6=_['merge']({},_0x5925e6,_0x116c7e[_0xe7fb('0x3a')]);return db[_0xe7fb('0x52')][_0xe7fb('0x15')]({'where':_0x5925e6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x562493){_0x2789a4[_0xe7fb('0x15')]=_0x562493;if(_0x116c7e[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x5925e6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x52')][_0xe7fb('0x2c')](_0x5925e6);})[_0xe7fb('0x18')](function(_0x1e6256){_0x2789a4[_0xe7fb('0x2d')]=_0x1e6256;return _0x2789a4;});}})['then'](respondWithFilteredResult(_0x1b24fd,_0x5925e6))[_0xe7fb('0x2e')](handleError(_0x1b24fd,null));};exports['getHopperHistories']=function(_0x279663,_0x2f13f2){var _0x2a2079={'raw':!![],'where':{}};var _0x31c159={};var _0x318d06={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x279663[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x2f13f2,null))[_0xe7fb('0x18')](function(_0x15d881){if(_0x15d881){_0x31c159[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x53')][_0xe7fb('0x26')]);_0x31c159[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x279663[_0xe7fb('0x2b')]);_0x31c159[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x31c159['model'],_0x31c159['query']);_0x2a2079['attributes']=_[_0xe7fb('0x33')](_0x31c159[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x279663[_0xe7fb('0x2b')]['fields']));_0x2a2079[_0xe7fb('0x35')]=_0x2a2079[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2a2079[_0xe7fb('0x35')]:_0x31c159['model'];if(!_0x279663[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2a2079[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2a2079['offset']=qs[_0xe7fb('0x12')](_0x279663['query'][_0xe7fb('0x12')]);}_0x2a2079['order']=qs[_0xe7fb('0x50')](_0x279663[_0xe7fb('0x2b')]['sort']);_0x2a2079[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x279663[_0xe7fb('0x2b')],_0x31c159['filters']));_0x2a2079[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x15d881['id'];if(_0x279663[_0xe7fb('0x2b')]['filter']){_0x2a2079[_0xe7fb('0x29')]=_['merge'](_0x2a2079['where'],{'$or':_['map'](_0x2a2079[_0xe7fb('0x35')],function(_0x27019a){var _0x4a8a65={};_0x4a8a65[_0x27019a]={'$like':'%'+_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4a8a65;})});}_0x2a2079=_[_0xe7fb('0x39')]({},_0x2a2079,_0x279663[_0xe7fb('0x3a')]);return db[_0xe7fb('0x53')][_0xe7fb('0x15')]({'where':_0x2a2079[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x42190e){_0x318d06[_0xe7fb('0x15')]=_0x42190e;if(_0x279663[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x2a2079[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x53')][_0xe7fb('0x2c')](_0x2a2079);})[_0xe7fb('0x18')](function(_0x3c5bd9){_0x318d06[_0xe7fb('0x2d')]=_0x3c5bd9;return _0x318d06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x2f13f2,_0x2a2079))[_0xe7fb('0x2e')](handleError(_0x2f13f2,null));};exports['getHopperFinals']=function(_0x47568c,_0x185ac0){var _0xc3958f={'raw':!![],'where':{}};var _0x1b8fdb={};var _0x19fe06={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x47568c['params']['id']}})['then'](handleEntityNotFound(_0x185ac0,null))[_0xe7fb('0x18')](function(_0x4e1865){if(_0x4e1865){_0x1b8fdb[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['CmHopperFinal'][_0xe7fb('0x26')]);_0x1b8fdb[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x47568c[_0xe7fb('0x2b')]);_0x1b8fdb[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x1b8fdb['model'],_0x1b8fdb[_0xe7fb('0x2b')]);_0xc3958f[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x1b8fdb[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x47568c[_0xe7fb('0x2b')]['fields']));_0xc3958f['attributes']=_0xc3958f['attributes'][_0xe7fb('0x37')]?_0xc3958f[_0xe7fb('0x35')]:_0x1b8fdb[_0xe7fb('0x34')];if(!_0x47568c['query'][_0xe7fb('0x4d')]('nolimit')){_0xc3958f[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0xc3958f['offset']=qs[_0xe7fb('0x12')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}_0xc3958f[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0xc3958f[_0xe7fb('0x29')]=qs['filters'](_['pick'](_0x47568c[_0xe7fb('0x2b')],_0x1b8fdb['filters']));_0xc3958f[_0xe7fb('0x29')][_0xe7fb('0x51')]=_0x4e1865['id'];if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0xc3958f['where']=_['merge'](_0xc3958f[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0xc3958f['attributes'],function(_0x21cb12){var _0x431d21={};_0x431d21[_0x21cb12]={'$like':'%'+_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x431d21;})});}_0xc3958f=_[_0xe7fb('0x39')]({},_0xc3958f,_0x47568c[_0xe7fb('0x3a')]);return db['CmHopperFinal'][_0xe7fb('0x15')]({'where':_0xc3958f[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x2607b9){_0x19fe06[_0xe7fb('0x15')]=_0x2607b9;if(_0x47568c[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0xc3958f[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x55')][_0xe7fb('0x2c')](_0xc3958f);})[_0xe7fb('0x18')](function(_0x3b1a90){_0x19fe06[_0xe7fb('0x2d')]=_0x3b1a90;return _0x19fe06;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x185ac0,_0xc3958f))[_0xe7fb('0x2e')](handleError(_0x185ac0,null));};exports[_0xe7fb('0x56')]=function(_0x27c100,_0x19e86f){var _0x4b4cf6={'raw':!![],'where':{}};var _0x173d85={};var _0xa1368a={'count':0x0,'rows':[]};return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x27c100['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x19e86f,null))[_0xe7fb('0x18')](function(_0x4ca09c){if(_0x4ca09c){_0x173d85[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x57')]['rawAttributes']);_0x173d85[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x27c100['query']);_0x173d85['filters']=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],_0x173d85[_0xe7fb('0x2b')]);_0x4b4cf6[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x173d85[_0xe7fb('0x34')],qs['fields'](_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x4b4cf6[_0xe7fb('0x35')]=_0x4b4cf6['attributes'][_0xe7fb('0x37')]?_0x4b4cf6[_0xe7fb('0x35')]:_0x173d85[_0xe7fb('0x34')];if(!_0x27c100[_0xe7fb('0x2b')]['hasOwnProperty'](_0xe7fb('0x4e'))){_0x4b4cf6[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x27c100['query'][_0xe7fb('0x14')]);_0x4b4cf6[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x27c100[_0xe7fb('0x2b')]['offset']);}_0x4b4cf6[_0xe7fb('0x4f')]=qs['sort'](_0x27c100[_0xe7fb('0x2b')]['sort']);_0x4b4cf6[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_['pick'](_0x27c100['query'],_0x173d85[_0xe7fb('0x32')]));_0x4b4cf6['where'][_0xe7fb('0x51')]=_0x4ca09c['id'];if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x4b4cf6[_0xe7fb('0x29')]=_['merge'](_0x4b4cf6[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x4b4cf6[_0xe7fb('0x35')],function(_0x27a822){var _0x5505e5={};_0x5505e5[_0x27a822]={'$like':'%'+_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x5505e5;})});}_0x4b4cf6=_[_0xe7fb('0x39')]({},_0x4b4cf6,_0x27c100[_0xe7fb('0x3a')]);return db[_0xe7fb('0x57')]['count']({'where':_0x4b4cf6[_0xe7fb('0x29')]})[_0xe7fb('0x18')](function(_0x54233){_0xa1368a[_0xe7fb('0x15')]=_0x54233;if(_0x27c100[_0xe7fb('0x2b')][_0xe7fb('0x38')]){_0x4b4cf6[_0xe7fb('0x2a')]=[{'all':!![]}];}return db[_0xe7fb('0x57')][_0xe7fb('0x2c')](_0x4b4cf6);})['then'](function(_0x795e32){_0xa1368a[_0xe7fb('0x2d')]=_0x795e32;return _0xa1368a;});}})[_0xe7fb('0x18')](respondWithFilteredResult(_0x19e86f,_0x4b4cf6))[_0xe7fb('0x2e')](handleError(_0x19e86f,null));};exports[_0xe7fb('0x58')]=function(_0x16f2b1,_0x3a8154){var _0x51335c={};var _0x4f4772={};var _0x4ef7b4;var _0x1bcee7;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x16f2b1['params']['id']}})['then'](handleEntityNotFound(_0x3a8154,null))[_0xe7fb('0x18')](function(_0x5bd869){if(_0x5bd869){_0x4ef7b4=_0x5bd869;_0x4f4772[_0xe7fb('0x34')]=_['keys'](db[_0xe7fb('0x59')][_0xe7fb('0x26')]);_0x4f4772[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x16f2b1[_0xe7fb('0x2b')]);_0x4f4772[_0xe7fb('0x32')]=_['intersection'](_0x4f4772[_0xe7fb('0x34')],_0x4f4772[_0xe7fb('0x2b')]);_0x51335c[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x4f4772[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x16f2b1[_0xe7fb('0x2b')]['fields']));_0x51335c[_0xe7fb('0x35')]=_0x51335c[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x51335c[_0xe7fb('0x35')]:_0x4f4772['model'];_0x51335c[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x51335c[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x16f2b1['query'],_0x4f4772['filters']));if(_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x51335c['where']=_[_0xe7fb('0x39')](_0x51335c['where'],{'$or':_[_0xe7fb('0x1e')](_0x51335c[_0xe7fb('0x35')],function(_0x220d72){var _0x5ea91d={};_0x5ea91d[_0x220d72]={'$like':'%'+_0x16f2b1['query'][_0xe7fb('0x1d')]+'%'};return _0x5ea91d;})});}_0x51335c=_['merge']({},_0x51335c,_0x16f2b1['options']);return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x3b073e){if(_0x3b073e){_0x1bcee7=_0x3b073e[_0xe7fb('0x37')];if(!_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x51335c[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x51335c[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x16f2b1[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x4ef7b4[_0xe7fb('0x58')](_0x51335c);}})[_0xe7fb('0x18')](function(_0x249d6f){if(_0x249d6f){return _0x249d6f?{'count':_0x1bcee7,'rows':_0x249d6f}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x3a8154,null))['catch'](handleError(_0x3a8154,null));};exports[_0xe7fb('0x5a')]=function(_0x19ebe2,_0x3406ed){var _0x1631cc=_0x19ebe2['body'][_0xe7fb('0x5b')];var _0x21ee89=_[_0xe7fb('0x1e')](_0x1631cc,'id');return db[_0xe7fb('0x59')][_0xe7fb('0x2c')]({'where':{'id':_0x21ee89},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe7fb('0x21'),'online','voicePause','interface'],'raw':!![]}]})[_0xe7fb('0x18')](function(_0x5a97c8){if(_0x5a97c8){var _0x503ae2=_['flatMap'](_0x5a97c8,function(_0x2ccf71){var _0x35be16=_0x2ccf71[_0xe7fb('0x1a')]({'plain':!![]});_0x35be16[_0xe7fb('0x5c')][_0xe7fb('0x5d')](function(_0x1db971){_0x1db971['penalty']=_['find'](_0x1631cc,{'id':_0x35be16['id']})[_0xe7fb('0x5e')];});return _0x35be16['Agents'];});return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x19ebe2[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x3891ed){return db[_0xe7fb('0x5f')]['transaction'](function(_0x4aa499){return _0x3891ed[_0xe7fb('0x5a')](_0x21ee89,{'transaction':_0x4aa499})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x1631cc,function(_0x7a7a6b){return db[_0xe7fb('0x61')][_0xe7fb('0x62')]({'TeamId':_0x7a7a6b['id'],'VoiceQueueId':_0x19ebe2['params']['id'],'penalty':_0x7a7a6b[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise[_0xe7fb('0x60')](_0x503ae2,function(_0x33d638){return db[_0xe7fb('0x63')]['findOrCreate']({'where':{'UserId':_0x33d638['id'],'VoiceQueueId':_0x19ebe2[_0xe7fb('0x30')]['id']},'defaults':{'penalty':_0x33d638[_0xe7fb('0x5e')]},'transaction':_0x4aa499});});})[_0xe7fb('0x18')](function(){return BPromise['each'](_['filter'](_0x503ae2,{'online':!![]}),function(_0x5d30ef){return db[_0xe7fb('0x64')]['upsert']({'membername':_0x5d30ef['name'],'UserId':_0x5d30ef['id'],'queue_name':_0x3891ed[_0xe7fb('0x21')],'VoiceQueueId':_0x3891ed['id'],'interface':_['isNil'](_0x5d30ef[_0xe7fb('0x65')])?util[_0xe7fb('0x66')](_0xe7fb('0x67'),_0x5d30ef[_0xe7fb('0x21')]):_0x5d30ef[_0xe7fb('0x65')],'paused':_0x5d30ef[_0xe7fb('0x68')]||![],'penalty':_0x5d30ef[_0xe7fb('0x5e')]},{'transaction':_0x4aa499});});})['then'](function(){_0x503ae2[_0xe7fb('0x5d')](function(_0x16e9d4){socket['emit'](_0xe7fb('0x69'),{'UserId':_0x16e9d4['id'],'VoiceQueueId':_0x3891ed['id']});});});});});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x3406ed,null))[_0xe7fb('0x2e')](handleError(_0x3406ed,null));};exports[_0xe7fb('0x6a')]=function(_0x366acb,_0x4d2c92){return db['Team'][_0xe7fb('0x2c')]({'where':{'id':_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe7fb('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe7fb('0x18')](handleEntityNotFound(_0x4d2c92,null))[_0xe7fb('0x18')](function(_0x2e276c){var _0x4efcdc=_[_0xe7fb('0x1e')](_0x2e276c,'id');var _0x146fc9=[];var _0x470718=[];var _0x55048c=squel[_0xe7fb('0x6d')]();_0x55048c[_0xe7fb('0x6e')]('tq.TeamId')[_0xe7fb('0x6f')](_0xe7fb('0x70'),'tq')['join'](_0xe7fb('0x71'),'ut',_0xe7fb('0x72'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x366acb[_0xe7fb('0x30')]['id']);for(var _0x5d9b58=0x0;_0x5d9b58<_0x2e276c['length'];_0x5d9b58+=0x1){let _0x5986f1=_0x2e276c[_0x5d9b58];for(var _0x23ec12=0x0;_0x23ec12<_0x5986f1[_0xe7fb('0x5c')][_0xe7fb('0x37')];_0x23ec12+=0x1){let _0x36be03=_0x5986f1['Agents'][_0x23ec12];var _0x29de1e=_0x55048c[_0xe7fb('0x44')]();_0x29de1e['where']('ut.UserId\x20=\x20?',_0x36be03['id']);_0x470718[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x29de1e[_0xe7fb('0x75')](),{'type':db[_0xe7fb('0x5f')]['QueryTypes'][_0xe7fb('0x76')]})[_0xe7fb('0x18')](function(_0xe52155){if(_0xe52155['length']===0x1){return _0x36be03['id'];}else{var _0x20b1fc=_[_0xe7fb('0x77')](_['map'](_0xe52155,_0xe7fb('0x78')),function(_0x6ec6b6){return _[_0xe7fb('0x79')](_0x4efcdc,_0x6ec6b6);});if(_0x20b1fc){return _0x36be03['id'];}}}));}}return BPromise[_0xe7fb('0x7a')](_0x470718)['then'](function(_0x4ed327){_0x146fc9=_(_0x146fc9)[_0xe7fb('0x7b')](_0x4ed327)[_0xe7fb('0x7c')]()[_0xe7fb('0x1f')]();return db['VoiceQueue'][_0xe7fb('0x3b')]({'where':{'id':_0x366acb[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(_0x49fb4b){return db[_0xe7fb('0x5f')][_0xe7fb('0x7d')](function(_0x362fe1){return _0x49fb4b['removeTeams'](_0x366acb[_0xe7fb('0x2b')][_0xe7fb('0x6b')],{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){if(!_[_0xe7fb('0x7e')](_0x146fc9)){return _0x49fb4b[_0xe7fb('0x7f')](_0x146fc9,{'transaction':_0x362fe1})[_0xe7fb('0x18')](function(){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x366acb['params']['id'],'UserId':_0x146fc9},'transaction':_0x362fe1});});}})[_0xe7fb('0x18')](function(){_0x146fc9[_0xe7fb('0x5d')](function(_0x5dadac){socket['emit'](_0xe7fb('0x80'),{'UserId':_0x5dadac,'VoiceQueueId':_0x49fb4b['id']});});});});});});})[_0xe7fb('0x18')](respondWithStatusCode(_0x4d2c92,null))[_0xe7fb('0x2e')](handleError(_0x4d2c92,null));};exports[_0xe7fb('0x81')]=function(_0x4b58de,_0x4386ea){var _0x41c771,_0x489c9d;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4b58de[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x4386ea,null))[_0xe7fb('0x18')](function(_0x39fef6){if(_0x39fef6){_0x489c9d=_0x39fef6;return _0x39fef6[_0xe7fb('0x81')](_0x4b58de['body'][_0xe7fb('0x6b')],_['omit'](_0x4b58de[_0xe7fb('0x3d')],['ids','id'])||{})['spread'](function(_0x260067){for(var _0xed4af4=0x0;_0xed4af4<_0x4b58de[_0xe7fb('0x3d')][_0xe7fb('0x6b')][_0xe7fb('0x37')];_0xed4af4+=0x1){socket[_0xe7fb('0x82')](_0xe7fb('0x69'),{'UserId':Number(_0x4b58de['body'][_0xe7fb('0x6b')][_0xed4af4]),'VoiceQueueId':Number(_0x4b58de[_0xe7fb('0x30')]['id'])});}return _0x260067;});}})[_0xe7fb('0x18')](function(_0x19a7ec){_0x41c771=_0x19a7ec||[];if(_0x489c9d){return db[_0xe7fb('0x6c')][_0xe7fb('0x2c')]({'where':{'id':_0x4b58de[_0xe7fb('0x3d')]['ids']},'attributes':['id',_0xe7fb('0x21'),_0xe7fb('0x83'),_0xe7fb('0x68'),'interface'],'raw':!![]});}})[_0xe7fb('0x18')](function(_0x52c758){if(!_['isEmpty'](_0x52c758)){var _0x4930c6=[];for(var _0x1a3d44=0x0;_0x1a3d44<_0x52c758[_0xe7fb('0x37')];_0x1a3d44++){if(_0x52c758[_0x1a3d44]['online']){_0x4930c6[_0xe7fb('0x74')](db[_0xe7fb('0x64')]['upsert']({'membername':_0x52c758[_0x1a3d44]['name'],'UserId':_0x52c758[_0x1a3d44]['id'],'queue_name':_0x489c9d[_0xe7fb('0x21')],'VoiceQueueId':_0x489c9d['id'],'interface':_[_0xe7fb('0x84')](_0x52c758[_0x1a3d44][_0xe7fb('0x65')])?util['format'](_0xe7fb('0x67'),_0x52c758[_0x1a3d44][_0xe7fb('0x21')]):_0x52c758[_0x1a3d44]['interface'],'paused':_0x52c758[_0x1a3d44]['voicePause']||![],'penalty':_0x4b58de[_0xe7fb('0x3d')]['penalty']||0x0}));}}return BPromise['all'](_0x4930c6);}})['then'](function(){return _0x41c771;})[_0xe7fb('0x18')](respondWithResult(_0x4386ea,null))[_0xe7fb('0x2e')](handleError(_0x4386ea,null));};exports['removeAgents']=function(_0x35b5ad,_0x55c935){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x35b5ad[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x55c935,null))[_0xe7fb('0x18')](function(_0x4736bf){if(_0x4736bf){return _0x4736bf[_0xe7fb('0x7f')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])[_0xe7fb('0x18')](function(){if(_[_0xe7fb('0x85')](_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')])){for(var _0x5744a8=0x0;_0x5744a8<_0x35b5ad[_0xe7fb('0x2b')][_0xe7fb('0x6b')]['length'];_0x5744a8+=0x1){socket['emit'](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad['query'][_0xe7fb('0x6b')][_0x5744a8]),'VoiceQueueId':Number(_0x35b5ad[_0xe7fb('0x30')]['id'])});}}else{socket[_0xe7fb('0x82')](_0xe7fb('0x80'),{'UserId':Number(_0x35b5ad[_0xe7fb('0x2b')]['ids']),'VoiceQueueId':Number(_0x35b5ad['params']['id'])});}});}})[_0xe7fb('0x18')](function(_0x27b153){return db[_0xe7fb('0x64')][_0xe7fb('0x19')]({'where':{'VoiceQueueId':_0x35b5ad[_0xe7fb('0x30')]['id'],'UserId':_0x35b5ad['query'][_0xe7fb('0x6b')]}})['then'](function(){return _0x27b153;});})[_0xe7fb('0x18')](respondWithStatusCode(_0x55c935,null))[_0xe7fb('0x2e')](handleError(_0x55c935,null));};exports['getAgents']=function(_0x5d0f05,_0x519e35){var _0x16ae95={};var _0xb1a3fa={};var _0x59e676;var _0x577895;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x5d0f05['params']['id']}})['then'](handleEntityNotFound(_0x519e35,null))[_0xe7fb('0x18')](function(_0xe1613c){if(_0xe1613c){_0x59e676=_0xe1613c;_0xb1a3fa[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db['User'][_0xe7fb('0x26')]);_0xb1a3fa[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x5d0f05[_0xe7fb('0x2b')]);_0xb1a3fa[_0xe7fb('0x32')]=_['intersection'](_0xb1a3fa['model'],_0xb1a3fa[_0xe7fb('0x2b')]);_0x16ae95[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0xb1a3fa[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x5d0f05['query'][_0xe7fb('0x36')]));_0x16ae95['attributes']=_0x16ae95['attributes'][_0xe7fb('0x37')]?_0x16ae95[_0xe7fb('0x35')]:_0xb1a3fa[_0xe7fb('0x34')];_0x16ae95[_0xe7fb('0x4f')]=qs['sort'](_0x5d0f05[_0xe7fb('0x2b')]['sort']);_0x16ae95['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x5d0f05[_0xe7fb('0x2b')],_0xb1a3fa[_0xe7fb('0x32')]));if(_0x5d0f05[_0xe7fb('0x2b')]['filter']){_0x16ae95['where']=_[_0xe7fb('0x39')](_0x16ae95['where'],{'$or':_['map'](_0x16ae95[_0xe7fb('0x35')],function(_0x5763dd){var _0x4cab2f={};_0x4cab2f[_0x5763dd]={'$like':'%'+_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x4cab2f;})});}_0x16ae95=_[_0xe7fb('0x39')]({},_0x16ae95,_0x5d0f05[_0xe7fb('0x3a')]);return _0x59e676[_0xe7fb('0x86')](_0x16ae95);}})['then'](function(_0xcf6d2){if(_0xcf6d2){_0x577895=_0xcf6d2['length'];if(!_0x5d0f05['query'][_0xe7fb('0x4d')](_0xe7fb('0x4e'))){_0x16ae95[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x5d0f05[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x16ae95[_0xe7fb('0x12')]=qs['offset'](_0x5d0f05['query'][_0xe7fb('0x12')]);}return _0x59e676['getAgents'](_0x16ae95);}})[_0xe7fb('0x18')](function(_0x51ff1e){if(_0x51ff1e){return _0x51ff1e?{'count':_0x577895,'rows':_0x51ff1e}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x519e35,null))['catch'](handleError(_0x519e35,null));};exports[_0xe7fb('0x87')]=function(_0x4407ee,_0x56869b){var _0x2139e3={};var _0x2e0e13={};var _0x23e1db;var _0x2a2fa6;return db['VoiceQueue'][_0xe7fb('0x4c')]({'where':{'id':_0x4407ee[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x56869b,null))[_0xe7fb('0x18')](function(_0x454ef0){if(_0x454ef0){_0x23e1db=_0x454ef0;_0x2e0e13['model']=_[_0xe7fb('0x31')](db[_0xe7fb('0x64')][_0xe7fb('0x26')]);_0x2e0e13[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4407ee[_0xe7fb('0x2b')]);_0x2e0e13[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],_0x2e0e13[_0xe7fb('0x2b')]);_0x2139e3[_0xe7fb('0x35')]=_[_0xe7fb('0x33')](_0x2e0e13[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0x4407ee[_0xe7fb('0x2b')]['fields']));_0x2139e3['attributes']=_0x2139e3[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x2139e3[_0xe7fb('0x35')]:_0x2e0e13[_0xe7fb('0x34')];_0x2139e3[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x2139e3['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4407ee[_0xe7fb('0x2b')],_0x2e0e13[_0xe7fb('0x32')]));if(_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x2139e3['where']=_[_0xe7fb('0x39')](_0x2139e3[_0xe7fb('0x29')],{'$or':_['map'](_0x2139e3[_0xe7fb('0x35')],function(_0x5dde83){var _0x21d86e={};_0x21d86e[_0x5dde83]={'$like':'%'+_0x4407ee['query'][_0xe7fb('0x1d')]+'%'};return _0x21d86e;})});}_0x2139e3=_[_0xe7fb('0x39')]({},_0x2139e3,_0x4407ee['options']);return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})[_0xe7fb('0x18')](function(_0x5892cd){if(_0x5892cd){_0x2a2fa6=_0x5892cd['length'];if(!_0x4407ee['query']['hasOwnProperty'](_0xe7fb('0x4e'))){_0x2139e3[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x2139e3[_0xe7fb('0x12')]=qs['offset'](_0x4407ee[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x23e1db[_0xe7fb('0x87')](_0x2139e3);}})['then'](function(_0x3c56ad){return _0x3c56ad?{'count':_0x2a2fa6,'rows':_0x3c56ad}:null;})['then'](respondWithResult(_0x56869b,null))[_0xe7fb('0x2e')](handleError(_0x56869b,null));};exports['getLists']=function(_0x4880a7,_0x27669f){var _0x3d8b9a={};var _0x3503ac={};var _0x413843;var _0x55ce0f;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0x4880a7[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x27669f,null))[_0xe7fb('0x18')](function(_0x21d9b0){if(_0x21d9b0){_0x413843=_0x21d9b0;_0x3503ac[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x3503ac[_0xe7fb('0x2b')]=_[_0xe7fb('0x31')](_0x4880a7[_0xe7fb('0x2b')]);_0x3503ac[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],_0x3503ac[_0xe7fb('0x2b')]);_0x3d8b9a['attributes']=_[_0xe7fb('0x33')](_0x3503ac[_0xe7fb('0x34')],qs['fields'](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x36')]));_0x3d8b9a[_0xe7fb('0x35')]=_0x3d8b9a['attributes'][_0xe7fb('0x37')]?_0x3d8b9a[_0xe7fb('0x35')]:_0x3503ac[_0xe7fb('0x34')];_0x3d8b9a[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0x4880a7[_0xe7fb('0x2b')]['sort']);_0x3d8b9a[_0xe7fb('0x29')]=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0x4880a7['query'],_0x3503ac[_0xe7fb('0x32')]));if(_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x1d')]){_0x3d8b9a[_0xe7fb('0x29')]=_['merge'](_0x3d8b9a[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x3d8b9a[_0xe7fb('0x35')],function(_0x39ffed){var _0x47e833={};_0x47e833[_0x39ffed]={'$like':'%'+_0x4880a7['query'][_0xe7fb('0x1d')]+'%'};return _0x47e833;})});}_0x3d8b9a=_[_0xe7fb('0x39')]({},_0x3d8b9a,_0x4880a7[_0xe7fb('0x3a')]);return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})['then'](function(_0x57750a){if(_0x57750a){_0x55ce0f=_0x57750a[_0xe7fb('0x37')];if(!_0x4880a7['query'][_0xe7fb('0x4d')]('nolimit')){_0x3d8b9a[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x3d8b9a[_0xe7fb('0x12')]=qs[_0xe7fb('0x12')](_0x4880a7[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x413843[_0xe7fb('0x89')](_0x3d8b9a);}})[_0xe7fb('0x18')](function(_0x14014d){if(_0x14014d){return _0x14014d?{'count':_0x55ce0f,'rows':_0x14014d}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x27669f,null))[_0xe7fb('0x2e')](handleError(_0x27669f,null));};exports[_0xe7fb('0x8a')]=function(_0x4d9a76,_0x23a49e){var _0x30651f=moment()[_0xe7fb('0x66')](_0xe7fb('0x8b'));var _0x582862,_0x5b6da5;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x4d9a76[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x23a49e,null))['then'](function(_0x4e09d8){if(_0x4e09d8){_0x5b6da5=_0x4e09d8;return _0x4e09d8[_0xe7fb('0x8a')](_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x6b')],_[_0xe7fb('0x45')](_0x4d9a76[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x2e2167){var _0xd7f440;_0x582862=_0x2e2167||[];var _0xc8055f=[];if(_0x2e2167){for(var _0x45b449=0x0;_0x45b449<_0x2e2167['length'];_0x45b449+=0x1){var _0x366c06=_0x2e2167[_0x45b449][_0xe7fb('0x1a')]({'plain':!![]});_0x5b6da5[_0xe7fb('0x8d')]=_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]?_0x4d9a76[_0xe7fb('0x3d')][_0xe7fb('0x8d')]:_0x5b6da5[_0xe7fb('0x8d')];switch(_0x5b6da5['dialCheckDuplicateType']){case _0xe7fb('0x8e'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))['fromQuery']([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()['field'](_0xe7fb('0x92'),_0xe7fb('0x92'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))['field']('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x4d9a76[_0xe7fb('0x30')]['id']['toString'](),'VoiceQueueId')[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27','createdAt')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')]('cm_contacts')[_0xe7fb('0x29')](_0xe7fb('0x97'))['where'](_0xe7fb('0x98'),_0x366c06['CmListId'][_0xe7fb('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe7fb('0x29')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe7fb('0x6e')](_0xe7fb('0x99'))['from'](_0xe7fb('0x9a'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')]()))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel['select']()['field'](_0xe7fb('0x9c'))['from']('cm_hopper')[_0xe7fb('0x29')]('VoiceQueueId\x20=\x20?',_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;case _0xe7fb('0x9d'):_0xd7f440=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),'scheduledAt',_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x92'),_0xe7fb('0x92'))['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))['field'](_0x4d9a76['params']['id']['toString'](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06['CmListId']['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0'))[_0xe7fb('0x29')](_0xe7fb('0x9b'),squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0x9c'))['from'](_0xe7fb('0x91'))[_0xe7fb('0x29')](_0xe7fb('0x73'),_0x4d9a76['params']['id'][_0xe7fb('0x75')]())))['toString']();break;default:_0xd7f440=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0x91'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x93'),_0xe7fb('0x94'),'ListId',_0xe7fb('0x51'),'createdAt','updatedAt'],squel['select']()[_0xe7fb('0x6e')]('phone','phone')['field']('\x27'+_0x30651f+'\x27',_0xe7fb('0x93'))[_0xe7fb('0x6e')]('id','ContactId')[_0xe7fb('0x6e')](_0x366c06[_0xe7fb('0x96')]['toString'](),_0xe7fb('0x95'))['field'](_0x4d9a76[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),_0xe7fb('0x51'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))['where'](_0xe7fb('0x97'))[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x366c06[_0xe7fb('0x96')]['toString']())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();}_0xc8055f['push'](db[_0xe7fb('0x5f')]['query'](_0xd7f440));}return BPromise[_0xe7fb('0x7a')](_0xc8055f);}})[_0xe7fb('0x18')](function(){var _0x20b22f=[];var _0x2e22c1=squel[_0xe7fb('0x8f')]()['into'](_0xe7fb('0xa1'))['fromQuery']([_0xe7fb('0xa2'),_0xe7fb('0x92'),_0xe7fb('0xa3'),'createdAt',_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')](_0xe7fb('0xa4'))[_0xe7fb('0x6e')]('ci.item')[_0xe7fb('0x6e')](_0xe7fb('0xa5'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x47'))[_0xe7fb('0x6e')]('\x27'+_0x30651f+'\x27',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0xa6'),'ci')[_0xe7fb('0xa7')]('cm_hopper','h',_0xe7fb('0xa8'))[_0xe7fb('0x29')]('h.scheduledat=?',_0x30651f)[_0xe7fb('0x29')]('ci.ItemClass=?',_0xe7fb('0xa9')))[_0xe7fb('0x75')]();_0x20b22f[_0xe7fb('0x74')](db[_0xe7fb('0x5f')][_0xe7fb('0x2b')](_0x2e22c1));return BPromise[_0xe7fb('0x7a')](_0x20b22f);})[_0xe7fb('0x18')](function(){return _0x582862;})['then'](respondWithResult(_0x23a49e,null))[_0xe7fb('0x2e')](handleError(_0x23a49e,null));};exports[_0xe7fb('0xaa')]=function(_0x3c04f4,_0x290cc3){return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x3c04f4['params']['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x290cc3,null))[_0xe7fb('0x18')](function(_0x3ed48f){if(_0x3ed48f){return _0x3ed48f['removeLists'](_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')]);}})[_0xe7fb('0x18')](function(_0x2eeff4){if(_0x2eeff4){return db[_0xe7fb('0x52')]['destroy']({'where':{'ListId':_0x3c04f4[_0xe7fb('0x2b')][_0xe7fb('0x6b')],'VoiceQueueId':_0x3c04f4[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x2eeff4;});}})[_0xe7fb('0x18')](respondWithStatusCode(_0x290cc3,null))[_0xe7fb('0x2e')](handleError(_0x290cc3,null));};exports[_0xe7fb('0xab')]=function(_0xcaad94,_0x5b88bd){var _0x143dbb={};var _0x715444={};var _0x92a316;var _0x30a834;return db[_0xe7fb('0x25')][_0xe7fb('0x4c')]({'where':{'id':_0xcaad94[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](handleEntityNotFound(_0x5b88bd,null))[_0xe7fb('0x18')](function(_0x1b1818){if(_0x1b1818){_0x92a316=_0x1b1818;_0x715444[_0xe7fb('0x34')]=_[_0xe7fb('0x31')](db[_0xe7fb('0x88')][_0xe7fb('0x26')]);_0x715444[_0xe7fb('0x2b')]=_['keys'](_0xcaad94[_0xe7fb('0x2b')]);_0x715444[_0xe7fb('0x32')]=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],_0x715444[_0xe7fb('0x2b')]);_0x143dbb['attributes']=_[_0xe7fb('0x33')](_0x715444[_0xe7fb('0x34')],qs[_0xe7fb('0x36')](_0xcaad94['query']['fields']));_0x143dbb[_0xe7fb('0x35')]=_0x143dbb[_0xe7fb('0x35')][_0xe7fb('0x37')]?_0x143dbb[_0xe7fb('0x35')]:_0x715444['model'];_0x143dbb[_0xe7fb('0x4f')]=qs[_0xe7fb('0x50')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x50')]);_0x143dbb['where']=qs[_0xe7fb('0x32')](_[_0xe7fb('0x54')](_0xcaad94['query'],_0x715444[_0xe7fb('0x32')]));if(_0xcaad94[_0xe7fb('0x2b')]['filter']){_0x143dbb['where']=_[_0xe7fb('0x39')](_0x143dbb[_0xe7fb('0x29')],{'$or':_[_0xe7fb('0x1e')](_0x143dbb['attributes'],function(_0x3b2375){var _0x170347={};_0x170347[_0x3b2375]={'$like':'%'+_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x1d')]+'%'};return _0x170347;})});}_0x143dbb=_['merge']({},_0x143dbb,_0xcaad94[_0xe7fb('0x3a')]);return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x2a984e){if(_0x2a984e){_0x30a834=_0x2a984e[_0xe7fb('0x37')];if(!_0xcaad94[_0xe7fb('0x2b')]['hasOwnProperty']('nolimit')){_0x143dbb[_0xe7fb('0x14')]=qs[_0xe7fb('0x14')](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x14')]);_0x143dbb[_0xe7fb('0x12')]=qs['offset'](_0xcaad94[_0xe7fb('0x2b')][_0xe7fb('0x12')]);}return _0x92a316[_0xe7fb('0xab')](_0x143dbb);}})[_0xe7fb('0x18')](function(_0x286382){if(_0x286382){return _0x286382?{'count':_0x30a834,'rows':_0x286382}:null;}})[_0xe7fb('0x18')](respondWithResult(_0x5b88bd,null))[_0xe7fb('0x2e')](handleError(_0x5b88bd,null));};exports[_0xe7fb('0xac')]=function(_0x325c7b,_0x38472b){var _0x1a33f8;return db[_0xe7fb('0x25')][_0xe7fb('0x3b')]({'where':{'id':_0x325c7b[_0xe7fb('0x30')]['id']}})['then'](handleEntityNotFound(_0x38472b,null))[_0xe7fb('0x18')](function(_0x291a8d){if(_0x291a8d){return _0x291a8d['addBlackLists'](_0x325c7b[_0xe7fb('0x3d')]['ids'],_[_0xe7fb('0x45')](_0x325c7b[_0xe7fb('0x3d')],[_0xe7fb('0x6b'),'id'])||{});}return null;})[_0xe7fb('0x8c')](function(_0x3ade81){var _0x1b9ea2;_0x1a33f8=_0x3ade81||[];var _0x418561=[];if(_0x3ade81){for(var _0x3ec66a=0x0;_0x3ec66a<_0x3ade81[_0xe7fb('0x37')];_0x3ec66a+=0x1){var _0x1c76a1=_0x3ade81[_0x3ec66a][_0xe7fb('0x1a')]({'plain':!![]});_0x1b9ea2=squel[_0xe7fb('0x8f')]()[_0xe7fb('0x90')](_0xe7fb('0xad'))[_0xe7fb('0x9e')]([_0xe7fb('0x92'),_0xe7fb('0x94'),_0xe7fb('0x95'),_0xe7fb('0x51'),_0xe7fb('0x47'),_0xe7fb('0x46')],squel[_0xe7fb('0x6d')]()[_0xe7fb('0x6e')]('phone',_0xe7fb('0x92'))[_0xe7fb('0x6e')]('id',_0xe7fb('0x94'))['field'](_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')](),_0xe7fb('0x95'))[_0xe7fb('0x6e')](_0x325c7b[_0xe7fb('0x30')]['id'][_0xe7fb('0x75')](),'VoiceQueueId')[_0xe7fb('0x6e')](_0xe7fb('0xae'),_0xe7fb('0x47'))[_0xe7fb('0x6e')]('NOW()',_0xe7fb('0x46'))[_0xe7fb('0x6f')](_0xe7fb('0x9f'))[_0xe7fb('0x29')]('deletedAt\x20IS\x20NULL')[_0xe7fb('0x29')](_0xe7fb('0x98'),_0x1c76a1[_0xe7fb('0x96')][_0xe7fb('0x75')]())[_0xe7fb('0x29')](_0xe7fb('0xa0')))['toString']();_0x418561[_0xe7fb('0x74')](db[_0xe7fb('0x5f')]['query'](_0x1b9ea2));}return BPromise[_0xe7fb('0x7a')](_0x418561);}})[_0xe7fb('0x18')](function(){return _0x1a33f8;})['then'](respondWithResult(_0x38472b,null))[_0xe7fb('0x2e')](handleError(_0x38472b,null));};exports['removeBlackLists']=function(_0x127051,_0x4d9376){return db[_0xe7fb('0x25')]['find']({'where':{'id':_0x127051['params']['id']}})['then'](handleEntityNotFound(_0x4d9376,null))['then'](function(_0x547d29){if(_0x547d29){return _0x547d29[_0xe7fb('0xaf')](_0x127051[_0xe7fb('0x2b')]['ids']);}})[_0xe7fb('0x18')](function(_0x5c0baf){if(_0x5c0baf){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x127051['query'][_0xe7fb('0x6b')],'VoiceQueueId':_0x127051[_0xe7fb('0x30')]['id']}})[_0xe7fb('0x18')](function(){return _0x5c0baf;});}})['then'](respondWithStatusCode(_0x4d9376,null))[_0xe7fb('0x2e')](handleError(_0x4d9376,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 550efe8..28c34cd 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 _0x61ef=['../../mysqldb','VoiceQueue','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x4eb2eb,_0x4e130a){var _0x27317c=function(_0x402538){while(--_0x402538){_0x4eb2eb['push'](_0x4eb2eb['shift']());}};_0x27317c(++_0x4e130a);}(_0x61ef,0x11f));var _0xf61e=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x61ef[_0x88cd7b];return _0x56fcc8;};'use strict';var EventEmitter=require(_0xf61e('0x0'));var VoiceQueue=require(_0xf61e('0x1'))['db'][_0xf61e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf61e('0x3'),'afterUpdate':'update','afterDestroy':_0xf61e('0x4')};function emitEvent(_0x2ec4c3){return function(_0x24f058,_0x147f24,_0x7d3fbd){VoiceQueueEvents[_0xf61e('0x5')](_0x2ec4c3+':'+_0x24f058['id'],_0x24f058);VoiceQueueEvents[_0xf61e('0x5')](_0x2ec4c3,_0x24f058);_0x7d3fbd(null);};}for(var e in events){if(events[_0xf61e('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xf61e('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xe2a9=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x4561d8,_0x300cdc){var _0x5e3777=function(_0x49dd64){while(--_0x49dd64){_0x4561d8['push'](_0x4561d8['shift']());}};_0x5e3777(++_0x300cdc);}(_0xe2a9,0x96));var _0x9e2a=function(_0x396f85,_0x452914){_0x396f85=_0x396f85-0x0;var _0xaae33b=_0xe2a9[_0x396f85];return _0xaae33b;};'use strict';var EventEmitter=require(_0x9e2a('0x0'));var VoiceQueue=require(_0x9e2a('0x1'))['db'][_0x9e2a('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9e2a('0x3')](0x0);var events={'afterCreate':_0x9e2a('0x4'),'afterUpdate':_0x9e2a('0x5'),'afterDestroy':_0x9e2a('0x6')};function emitEvent(_0xffc99a){return function(_0x314a53,_0x4082f9,_0x5ee37f){VoiceQueueEvents[_0x9e2a('0x7')](_0xffc99a+':'+_0x314a53['id'],_0x314a53);VoiceQueueEvents['emit'](_0xffc99a,_0x314a53);_0x5ee37f(null);};}for(var e in events){if(events[_0x9e2a('0x8')](e)){var event=events[e];VoiceQueue[_0x9e2a('0x9')](e,emitEvent(event));}}module[_0x9e2a('0xa')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 88eb8ac..bf2166f 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(_0x4a8514,_0x1eae9b){var _0x5657ba=function(_0x2558a3){while(--_0x2558a3){_0x4a8514['push'](_0x4a8514['shift']());}};_0x5657ba(++_0x1eae9b);}(_0x34e8,0x12c));var _0x834e=function(_0x4a3f84,_0x30a3a3){_0x4a3f84=_0x4a3f84-0x0;var _0x159b4a=_0x34e8[_0x4a3f84];return _0x159b4a;};'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 _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1d83db,_0x89d115){var _0x2dc1d1=function(_0x13fdc3){while(--_0x13fdc3){_0x1d83db['push'](_0x1d83db['shift']());}};_0x2dc1d1(++_0x89d115);}(_0x55ca,0x126));var _0xa55c=function(_0x365a40,_0x5c073e){_0x365a40=_0x365a40-0x0;var _0x1dd6d5=_0x55ca[_0x365a40];return _0x1dd6d5;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index d88b765..79a3b7f 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 _0xb592=['redis','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','VoiceQueue','options','raw','where','attributes','include','map','model','then','GetVoiceQueue','find','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3bb70e,_0x3f990c){var _0x21906a=function(_0x438dde){while(--_0x438dde){_0x3bb70e['push'](_0x3bb70e['shift']());}};_0x21906a(++_0x3f990c);}(_0xb592,0x1ec));var _0x2b59=function(_0x4279e1,_0x39cda4){_0x4279e1=_0x4279e1-0x0;var _0x1e33ea=_0xb592[_0x4279e1];return _0x1e33ea;};'use strict';var _=require(_0x2b59('0x0'));var util=require(_0x2b59('0x1'));var moment=require(_0x2b59('0x2'));var BPromise=require(_0x2b59('0x3'));var rs=require(_0x2b59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b59('0x5'))['db'];var utils=require(_0x2b59('0x6'));var logger=require(_0x2b59('0x7'))(_0x2b59('0x8'));var config=require(_0x2b59('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2b59('0xa')][_0x2b59('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2b59('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b59('0xc')]));require('./voiceQueue.socket')[_0x2b59('0xd')](socket);function respondWithRpcPromise(_0x351f49,_0x26b537,_0x596170){return new BPromise(function(_0x1ceb0e,_0x3b559e){return client[_0x2b59('0xe')](_0x351f49,_0x596170)['then'](function(_0xd7f23e){logger[_0x2b59('0xf')](_0x2b59('0x10'),_0x26b537,_0x2b59('0x11'));logger[_0x2b59('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x26b537,_0x2b59('0x11'),JSON[_0x2b59('0x13')](_0xd7f23e));if(_0xd7f23e[_0x2b59('0x14')]){if(_0xd7f23e[_0x2b59('0x14')]['code']===0x1f4){logger['error'](_0x2b59('0x10'),_0x26b537,_0xd7f23e[_0x2b59('0x14')][_0x2b59('0x15')]);return _0x3b559e(_0xd7f23e[_0x2b59('0x14')][_0x2b59('0x15')]);}logger['error'](_0x2b59('0x10'),_0x26b537,_0xd7f23e[_0x2b59('0x14')]['message']);return _0x1ceb0e(_0xd7f23e[_0x2b59('0x14')][_0x2b59('0x15')]);}else{logger['info']('VoiceQueue,\x20%s,\x20%s',_0x26b537,'request\x20sent');_0x1ceb0e(_0xd7f23e[_0x2b59('0x16')][_0x2b59('0x15')]);}})[_0x2b59('0x17')](function(_0x451587){logger['error'](_0x2b59('0x10'),_0x26b537,_0x451587);_0x3b559e(_0x451587);});});}exports['GetVoiceQueue']=function(_0xe35a79){var _0xd17ad1=this;return new Promise(function(_0x2fdab2,_0x245847){return db[_0x2b59('0x18')]['findAll']({'raw':_0xe35a79[_0x2b59('0x19')]?_0xe35a79['options'][_0x2b59('0x1a')]===undefined?!![]:![]:!![],'where':_0xe35a79[_0x2b59('0x19')]?_0xe35a79[_0x2b59('0x19')][_0x2b59('0x1b')]||null:null,'attributes':_0xe35a79[_0x2b59('0x19')]?_0xe35a79[_0x2b59('0x19')][_0x2b59('0x1c')]||null:null,'limit':_0xe35a79[_0x2b59('0x19')]?_0xe35a79[_0x2b59('0x19')]['limit']||null:null,'include':_0xe35a79['options']?_0xe35a79['options'][_0x2b59('0x1d')]?_[_0x2b59('0x1e')](_0xe35a79[_0x2b59('0x19')][_0x2b59('0x1d')],function(_0x16eb95){return{'model':db[_0x16eb95[_0x2b59('0x1f')]],'as':_0x16eb95['as'],'attributes':_0x16eb95[_0x2b59('0x1c')],'include':_0x16eb95[_0x2b59('0x1d')]?_[_0x2b59('0x1e')](_0x16eb95[_0x2b59('0x1d')],function(_0x3b8eea){return{'model':db[_0x3b8eea[_0x2b59('0x1f')]],'as':_0x3b8eea['as'],'attributes':_0x3b8eea[_0x2b59('0x1c')],'include':_0x3b8eea[_0x2b59('0x1d')]?_[_0x2b59('0x1e')](_0x3b8eea[_0x2b59('0x1d')],function(_0x3ca698){return{'model':db[_0x3ca698['model']],'as':_0x3ca698['as'],'attributes':_0x3ca698[_0x2b59('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2b59('0x20')](function(_0x155d4d){logger[_0x2b59('0xf')]('GetVoiceQueue',_0xe35a79);logger[_0x2b59('0x12')](_0x2b59('0x21'),_0xe35a79,JSON['stringify'](_0x155d4d));_0x2fdab2(_0x155d4d);})[_0x2b59('0x17')](function(_0x55fc96){logger[_0x2b59('0x14')](_0x2b59('0x21'),_0x55fc96['message'],_0xe35a79);_0x245847(_0xd17ad1['error'](0x1f4,_0x55fc96[_0x2b59('0x15')]));});});};exports['ShowVoiceQueue']=function(_0x7c13ca){var _0x91be19=this;return new Promise(function(_0x5ed5db,_0x248198){return db[_0x2b59('0x18')][_0x2b59('0x22')]({'raw':_0x7c13ca['options']?_0x7c13ca['options'][_0x2b59('0x1a')]===undefined?!![]:![]:!![],'where':_0x7c13ca[_0x2b59('0x19')]?_0x7c13ca[_0x2b59('0x19')]['where']||null:null,'attributes':_0x7c13ca['options']?_0x7c13ca[_0x2b59('0x19')]['attributes']||null:null,'include':_0x7c13ca[_0x2b59('0x19')]?_0x7c13ca[_0x2b59('0x19')][_0x2b59('0x1d')]?_[_0x2b59('0x1e')](_0x7c13ca[_0x2b59('0x19')][_0x2b59('0x1d')],function(_0x357756){return{'model':db[_0x357756['model']],'as':_0x357756['as'],'attributes':_0x357756[_0x2b59('0x1c')],'include':_0x357756['include']?_[_0x2b59('0x1e')](_0x357756[_0x2b59('0x1d')],function(_0x5a588e){return{'model':db[_0x5a588e['model']],'as':_0x5a588e['as'],'attributes':_0x5a588e[_0x2b59('0x1c')],'include':_0x5a588e['include']?_[_0x2b59('0x1e')](_0x5a588e['include'],function(_0x275b8b){return{'model':db[_0x275b8b[_0x2b59('0x1f')]],'as':_0x275b8b['as'],'attributes':_0x275b8b[_0x2b59('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2b59('0x20')](function(_0x2a2c31){logger[_0x2b59('0xf')](_0x2b59('0x23'),_0x7c13ca);logger[_0x2b59('0x12')](_0x2b59('0x23'),_0x7c13ca,JSON[_0x2b59('0x13')](_0x2a2c31));_0x5ed5db(_0x2a2c31);})[_0x2b59('0x17')](function(_0x19779e){logger['error'](_0x2b59('0x23'),_0x19779e['message'],_0x7c13ca);_0x248198(_0x91be19[_0x2b59('0x14')](0x1f4,_0x19779e[_0x2b59('0x15')]));});});}; \ No newline at end of file +var _0x2273=['model','attributes','debug','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','map','include'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x2273,0x195));var _0x3227=function(_0x1471ba,_0x2e95f9){_0x1471ba=_0x1471ba-0x0;var _0x48deaa=_0x2273[_0x1471ba];return _0x48deaa;};'use strict';var _=require(_0x3227('0x0'));var util=require(_0x3227('0x1'));var moment=require(_0x3227('0x2'));var BPromise=require(_0x3227('0x3'));var rs=require(_0x3227('0x4'));var fs=require('fs');var Redis=require(_0x3227('0x5'));var db=require(_0x3227('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3227('0x7'))(_0x3227('0x8'));var config=require(_0x3227('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3227('0xa')]({'port':0x232a});config[_0x3227('0xb')]=_['defaults'](config[_0x3227('0xb')],{'host':_0x3227('0xc'),'port':0x18eb});var socket=require(_0x3227('0xd'))(new Redis(config['redis']));require(_0x3227('0xe'))[_0x3227('0xf')](socket);function respondWithRpcPromise(_0x262aac,_0x1ff374,_0x587d6d){return new BPromise(function(_0x5e7e3b,_0x25067a){return client[_0x3227('0x10')](_0x262aac,_0x587d6d)[_0x3227('0x11')](function(_0x4acb4d){logger[_0x3227('0x12')](_0x3227('0x13'),_0x1ff374,'request\x20sent');logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x1ff374,_0x3227('0x14'),JSON[_0x3227('0x15')](_0x4acb4d));if(_0x4acb4d['error']){if(_0x4acb4d[_0x3227('0x16')][_0x3227('0x17')]===0x1f4){logger[_0x3227('0x16')](_0x3227('0x13'),_0x1ff374,_0x4acb4d[_0x3227('0x16')]['message']);return _0x25067a(_0x4acb4d[_0x3227('0x16')][_0x3227('0x18')]);}logger[_0x3227('0x16')](_0x3227('0x13'),_0x1ff374,_0x4acb4d[_0x3227('0x16')][_0x3227('0x18')]);return _0x5e7e3b(_0x4acb4d[_0x3227('0x16')]['message']);}else{logger[_0x3227('0x12')](_0x3227('0x13'),_0x1ff374,_0x3227('0x14'));_0x5e7e3b(_0x4acb4d[_0x3227('0x19')][_0x3227('0x18')]);}})[_0x3227('0x1a')](function(_0xfa4815){logger[_0x3227('0x16')](_0x3227('0x13'),_0x1ff374,_0xfa4815);_0x25067a(_0xfa4815);});});}exports[_0x3227('0x1b')]=function(_0x21e7f4){var _0x51aa45=this;return new Promise(function(_0x59aab7,_0x25a0a5){return db[_0x3227('0x1c')][_0x3227('0x1d')]({'raw':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')][_0x3227('0x1f')]===undefined?!![]:![]:!![],'where':_0x21e7f4['options']?_0x21e7f4[_0x3227('0x1e')][_0x3227('0x20')]||null:null,'attributes':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')]['attributes']||null:null,'limit':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')]['limit']||null:null,'include':_0x21e7f4[_0x3227('0x1e')]?_0x21e7f4[_0x3227('0x1e')]['include']?_[_0x3227('0x21')](_0x21e7f4[_0x3227('0x1e')][_0x3227('0x22')],function(_0x16a43d){return{'model':db[_0x16a43d[_0x3227('0x23')]],'as':_0x16a43d['as'],'attributes':_0x16a43d[_0x3227('0x24')],'include':_0x16a43d[_0x3227('0x22')]?_[_0x3227('0x21')](_0x16a43d[_0x3227('0x22')],function(_0x87cf8){return{'model':db[_0x87cf8[_0x3227('0x23')]],'as':_0x87cf8['as'],'attributes':_0x87cf8['attributes'],'include':_0x87cf8[_0x3227('0x22')]?_[_0x3227('0x21')](_0x87cf8['include'],function(_0x526848){return{'model':db[_0x526848['model']],'as':_0x526848['as'],'attributes':_0x526848['attributes']};}):[]};}):[]};}):[]:[]})[_0x3227('0x11')](function(_0xe1c0e9){logger[_0x3227('0x12')](_0x3227('0x1b'),_0x21e7f4);logger[_0x3227('0x25')](_0x3227('0x1b'),_0x21e7f4,JSON[_0x3227('0x15')](_0xe1c0e9));_0x59aab7(_0xe1c0e9);})['catch'](function(_0x424426){logger['error'](_0x3227('0x1b'),_0x424426['message'],_0x21e7f4);_0x25a0a5(_0x51aa45[_0x3227('0x16')](0x1f4,_0x424426[_0x3227('0x18')]));});});};exports[_0x3227('0x26')]=function(_0x40fbe1){var _0x3de37b=this;return new Promise(function(_0x1af2d8,_0x407078){return db[_0x3227('0x1c')][_0x3227('0x27')]({'raw':_0x40fbe1[_0x3227('0x1e')]?_0x40fbe1[_0x3227('0x1e')][_0x3227('0x1f')]===undefined?!![]:![]:!![],'where':_0x40fbe1[_0x3227('0x1e')]?_0x40fbe1['options']['where']||null:null,'attributes':_0x40fbe1[_0x3227('0x1e')]?_0x40fbe1['options'][_0x3227('0x24')]||null:null,'include':_0x40fbe1['options']?_0x40fbe1['options'][_0x3227('0x22')]?_[_0x3227('0x21')](_0x40fbe1[_0x3227('0x1e')][_0x3227('0x22')],function(_0x49ef86){return{'model':db[_0x49ef86[_0x3227('0x23')]],'as':_0x49ef86['as'],'attributes':_0x49ef86[_0x3227('0x24')],'include':_0x49ef86[_0x3227('0x22')]?_['map'](_0x49ef86[_0x3227('0x22')],function(_0x4001fe){return{'model':db[_0x4001fe['model']],'as':_0x4001fe['as'],'attributes':_0x4001fe[_0x3227('0x24')],'include':_0x4001fe[_0x3227('0x22')]?_['map'](_0x4001fe[_0x3227('0x22')],function(_0x5db59){return{'model':db[_0x5db59[_0x3227('0x23')]],'as':_0x5db59['as'],'attributes':_0x5db59[_0x3227('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3227('0x11')](function(_0x40ca02){logger[_0x3227('0x12')](_0x3227('0x26'),_0x40fbe1);logger['debug'](_0x3227('0x26'),_0x40fbe1,JSON[_0x3227('0x15')](_0x40ca02));_0x1af2d8(_0x40ca02);})[_0x3227('0x1a')](function(_0x3ca86a){logger[_0x3227('0x16')](_0x3227('0x26'),_0x3ca86a[_0x3227('0x18')],_0x40fbe1);_0x407078(_0x3de37b['error'](0x1f4,_0x3ca86a[_0x3227('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1ca9d3c..44b71ce 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 _0x15d7=['length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x15d7,0xbf));var _0x715d=function(_0x286969,_0x343699){_0x286969=_0x286969-0x0;var _0x175780=_0x15d7[_0x286969];return _0x175780;};'use strict';var VoiceQueueEvents=require(_0x715d('0x0'));var events=[_0x715d('0x1'),_0x715d('0x2'),_0x715d('0x3')];function createListener(_0x2d8ae8,_0x549f81){return function(_0x549cfb){_0x549f81[_0x715d('0x4')](_0x2d8ae8,_0x549cfb);};}function removeListener(_0x171463,_0x579933){return function(){VoiceQueueEvents[_0x715d('0x5')](_0x171463,_0x579933);};}exports[_0x715d('0x6')]=function(_0x12b2a1){for(var _0x1ce2d1=0x0,_0x22b9b4=events[_0x715d('0x7')];_0x1ce2d1<_0x22b9b4;_0x1ce2d1++){var _0x415cfa=events[_0x1ce2d1];var _0x1a30b7=createListener(_0x715d('0x8')+_0x415cfa,_0x12b2a1);VoiceQueueEvents['on'](_0x415cfa,_0x1a30b7);}}; \ No newline at end of file +var _0xcbea=['register','length','voiceQueue:','./voiceQueue.events','update','removeListener'];(function(_0x18a7d6,_0x70da9f){var _0x484b85=function(_0x47be78){while(--_0x47be78){_0x18a7d6['push'](_0x18a7d6['shift']());}};_0x484b85(++_0x70da9f);}(_0xcbea,0xa5));var _0xacbe=function(_0x5af780,_0x58dcd2){_0x5af780=_0x5af780-0x0;var _0x37c2ad=_0xcbea[_0x5af780];return _0x37c2ad;};'use strict';var VoiceQueueEvents=require(_0xacbe('0x0'));var events=['save','remove',_0xacbe('0x1')];function createListener(_0x1c48ee,_0x15310e){return function(_0x28076a){_0x15310e['emit'](_0x1c48ee,_0x28076a);};}function removeListener(_0x427fa6,_0x331eb6){return function(){VoiceQueueEvents[_0xacbe('0x2')](_0x427fa6,_0x331eb6);};}exports[_0xacbe('0x3')]=function(_0x4582bc){for(var _0x3e66dd=0x0,_0xab7748=events[_0xacbe('0x4')];_0x3e66dd<_0xab7748;_0x3e66dd++){var _0x3d037f=events[_0x3e66dd];var _0x252c8f=createListener(_0xacbe('0x5')+_0x3d037f,_0x4582bc);VoiceQueueEvents['on'](_0x3d037f,_0x252c8f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index d1e70ee..585826f 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 _0x5204=['create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','/:id'];(function(_0x4bef8c,_0x57ab3b){var _0x51e1df=function(_0x54d917){while(--_0x54d917){_0x4bef8c['push'](_0x4bef8c['shift']());}};_0x51e1df(++_0x57ab3b);}(_0x5204,0x12c));var _0x4520=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0x5204[_0x4f08dd];return _0x3017ee;};'use strict';var multer=require(_0x4520('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4520('0x1'));var express=require(_0x4520('0x2'));var router=express[_0x4520('0x3')]();var fs_extra=require(_0x4520('0x4'));var auth=require(_0x4520('0x5'));var interaction=require(_0x4520('0x6'));var config=require(_0x4520('0x7'));var controller=require(_0x4520('0x8'));router[_0x4520('0x9')]('/',auth[_0x4520('0xa')](),controller[_0x4520('0xb')]);router[_0x4520('0x9')](_0x4520('0xc'),auth[_0x4520('0xa')](),controller['describe']);router[_0x4520('0x9')](_0x4520('0xd'),auth[_0x4520('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0x4520('0xe'),auth[_0x4520('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4520('0xf')]);router[_0x4520('0x10')](_0x4520('0xe'),auth[_0x4520('0xa')](),controller[_0x4520('0x11')]);router[_0x4520('0x12')](_0x4520('0xe'),auth[_0x4520('0xa')](),controller[_0x4520('0x13')]);module[_0x4520('0x14')]=router; \ No newline at end of file +var _0xaef7=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','put','update','delete','destroy','multer'];(function(_0x3fd373,_0x1913ca){var _0x58ff7e=function(_0x3bb091){while(--_0x3bb091){_0x3fd373['push'](_0x3fd373['shift']());}};_0x58ff7e(++_0x1913ca);}(_0xaef7,0x11d));var _0x7aef=function(_0x1648d7,_0x1a877f){_0x1648d7=_0x1648d7-0x0;var _0x8c6c7f=_0xaef7[_0x1648d7];return _0x8c6c7f;};'use strict';var multer=require(_0x7aef('0x0'));var util=require('util');var path=require(_0x7aef('0x1'));var timeout=require(_0x7aef('0x2'));var express=require(_0x7aef('0x3'));var router=express[_0x7aef('0x4')]();var fs_extra=require(_0x7aef('0x5'));var auth=require(_0x7aef('0x6'));var interaction=require(_0x7aef('0x7'));var config=require(_0x7aef('0x8'));var controller=require(_0x7aef('0x9'));router[_0x7aef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7aef('0xb'),auth[_0x7aef('0xc')](),controller[_0x7aef('0xd')]);router[_0x7aef('0xa')](_0x7aef('0xe'),auth[_0x7aef('0xc')](),controller[_0x7aef('0xf')]);router['get'](_0x7aef('0x10'),auth['isAuthenticated'](),controller[_0x7aef('0x11')]);router['post']('/',auth[_0x7aef('0xc')](),controller['create']);router[_0x7aef('0x12')](_0x7aef('0x10'),auth[_0x7aef('0xc')](),controller[_0x7aef('0x13')]);router[_0x7aef('0x14')](_0x7aef('0x10'),auth['isAuthenticated'](),controller[_0x7aef('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 61f62d9..67ef2e0 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 _0x5a4b=['format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0x5a4b,0x181));var _0xb5a4=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5a4b[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb5a4('0x0'));module['exports']={'type':{'type':Sequelize[_0xb5a4('0x1')]},'uniqueid':{'type':Sequelize[_0xb5a4('0x1')]},'calleridnum':{'type':Sequelize[_0xb5a4('0x1')]},'calleridname':{'type':Sequelize[_0xb5a4('0x1')]},'queue':{'type':Sequelize[_0xb5a4('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xb5a4('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x59cd36){var _0x4c7f54=moment(_0x59cd36);var _0x1cd8d2=moment(this[_0xb5a4('0x3')](_0xb5a4('0x4')))[_0xb5a4('0x5')](_0xb5a4('0x6'));var _0x5c302c=_0x4c7f54['diff'](_0x1cd8d2,_0xb5a4('0x7'));this[_0xb5a4('0x8')]('queuecallerleaveAt',_0x59cd36);this['setDataValue'](_0xb5a4('0x9'),_0x5c302c||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xb5a4('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xb5a4('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb5a4('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xb5a4('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb5a4('0x2')]},'queuecallerexit':{'type':Sequelize[_0xb5a4('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb5a4('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xb5a4('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xb5a4('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb5a4('0x1')]},'accountcode':{'type':Sequelize[_0xb5a4('0x1')]},'context':{'type':Sequelize[_0xb5a4('0x1')]},'exten':{'type':Sequelize[_0xb5a4('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xb5a4('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb5a4('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xb5a4('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb5a4('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb5a4('0x1')]},'disposition':{'type':Sequelize[_0xb5a4('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb5a4('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xb5a4('0xa')],'defaultValue':0x0},'note':{'type':Sequelize[_0xb5a4('0x1')]}}; \ No newline at end of file +var _0xa42d=['STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x5e28af,_0x54bbba){var _0x7be8f0=function(_0x45bca6){while(--_0x45bca6){_0x5e28af['push'](_0x5e28af['shift']());}};_0x7be8f0(++_0x54bbba);}(_0xa42d,0x6d));var _0xda42=function(_0x48e63e,_0x477f6d){_0x48e63e=_0x48e63e-0x0;var _0x41a1aa=_0xa42d[_0x48e63e];return _0x41a1aa;};'use strict';var Sequelize=require(_0xda42('0x0'));var moment=require(_0xda42('0x1'));module[_0xda42('0x2')]={'type':{'type':Sequelize[_0xda42('0x3')]},'uniqueid':{'type':Sequelize[_0xda42('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xda42('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xda42('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xda42('0x4')],'set':function(_0x8fbf85){var _0x18061b=moment(_0x8fbf85);var _0x3eacb8=moment(this[_0xda42('0x5')](_0xda42('0x6')))['format'](_0xda42('0x7'));var _0x1db5f1=_0x18061b[_0xda42('0x8')](_0x3eacb8,_0xda42('0x9'));this[_0xda42('0xa')](_0xda42('0xb'),_0x8fbf85);this[_0xda42('0xa')](_0xda42('0xc'),_0x1db5f1||null);}},'position':{'type':Sequelize[_0xda42('0xd')]},'count':{'type':Sequelize[_0xda42('0xd')]},'queuecallerabandon':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xda42('0x4')]},'queuecallerexit':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xda42('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xda42('0xd')]},'channel':{'type':Sequelize[_0xda42('0x3')]},'connectedlinenum':{'type':Sequelize[_0xda42('0x3')]},'connectedlinename':{'type':Sequelize[_0xda42('0x3')]},'accountcode':{'type':Sequelize[_0xda42('0x3')]},'context':{'type':Sequelize[_0xda42('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xda42('0x3')]},'holdtime':{'type':Sequelize[_0xda42('0xd')]},'mohtime':{'type':Sequelize[_0xda42('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xda42('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xda42('0x3')],'comment':_0xda42('0xf')},'transferexten':{'type':Sequelize[_0xda42('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xda42('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xda42('0xd')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index e32c7dd..61a7320 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 _0x7be5=['rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','./voiceQueueReport.socket','register','status','offset','count','limit','set','json','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','VoiceQueueReport'];(function(_0x495984,_0x20ff45){var _0x93c24c=function(_0x48015b){while(--_0x48015b){_0x495984['push'](_0x495984['shift']());}};_0x93c24c(++_0x20ff45);}(_0x7be5,0x1b7));var _0x57be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7be5[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x57be('0x0'));var rimraf=require(_0x57be('0x1'));var zipdir=require(_0x57be('0x2'));var jsonpatch=require(_0x57be('0x3'));var rp=require(_0x57be('0x4'));var moment=require('moment');var BPromise=require(_0x57be('0x5'));var Mustache=require(_0x57be('0x6'));var util=require(_0x57be('0x7'));var path=require(_0x57be('0x8'));var sox=require(_0x57be('0x9'));var csv=require(_0x57be('0xa'));var ejs=require(_0x57be('0xb'));var fs=require('fs');var fs_extra=require(_0x57be('0xc'));var _=require(_0x57be('0xd'));var squel=require(_0x57be('0xe'));var crypto=require(_0x57be('0xf'));var jsforce=require(_0x57be('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x57be('0xa'));var querystring=require(_0x57be('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x57be('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x57be('0x13'));var config=require(_0x57be('0x14'));var licenseUtil=require(_0x57be('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x57be('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x57be('0x17'))(new Redis(config[_0x57be('0x18')]));require(_0x57be('0x19'))[_0x57be('0x1a')](socket);function respondWithStatusCode(_0x3a06eb,_0x594688){_0x594688=_0x594688||0xcc;return function(_0x396ff1){if(_0x396ff1){return _0x3a06eb['sendStatus'](_0x594688);}return _0x3a06eb['status'](_0x594688)['end']();};}function respondWithResult(_0x22576f,_0xc8ea19){_0xc8ea19=_0xc8ea19||0xc8;return function(_0x3ef47a){if(_0x3ef47a){return _0x22576f[_0x57be('0x1b')](_0xc8ea19)['json'](_0x3ef47a);}};}function respondWithFilteredResult(_0x50c5d7,_0x17d5b7){return function(_0x4fc4cb){if(_0x4fc4cb){var _0x37ca29=typeof _0x17d5b7[_0x57be('0x1c')]==='undefined'&&typeof _0x17d5b7['limit']==='undefined';var _0x371579=_0x4fc4cb[_0x57be('0x1d')];var _0x18e9bd=_0x37ca29?0x0:_0x17d5b7[_0x57be('0x1c')];var _0xf6f023=_0x37ca29?_0x4fc4cb[_0x57be('0x1d')]:_0x17d5b7[_0x57be('0x1c')]+_0x17d5b7[_0x57be('0x1e')];var _0xdd2177;if(_0xf6f023>=_0x371579){_0xf6f023=_0x371579;_0xdd2177=0xc8;}else{_0xdd2177=0xce;}_0x50c5d7['status'](_0xdd2177);return _0x50c5d7[_0x57be('0x1f')]('Content-Range',_0x18e9bd+'-'+_0xf6f023+'/'+_0x371579)[_0x57be('0x20')](_0x4fc4cb);}return null;};}function patchUpdates(_0x2fe9d9){return function(_0x165add){try{jsonpatch[_0x57be('0x21')](_0x165add,_0x2fe9d9,!![]);}catch(_0x1a6cc8){return BPromise['reject'](_0x1a6cc8);}return _0x165add[_0x57be('0x22')]();};}function saveUpdates(_0x373d9a,_0x23264c){return function(_0x131b72){if(_0x131b72){return _0x131b72[_0x57be('0x23')](_0x373d9a)[_0x57be('0x24')](function(_0x313369){return _0x313369;});}return null;};}function removeEntity(_0x64d064,_0x259218){return function(_0x2580dc){if(_0x2580dc){return _0x2580dc[_0x57be('0x25')]()[_0x57be('0x24')](function(){_0x64d064[_0x57be('0x1b')](0xcc)[_0x57be('0x26')]();});}};}function handleEntityNotFound(_0x4e4df5,_0x443052){return function(_0xccfc6e){if(!_0xccfc6e){_0x4e4df5[_0x57be('0x27')](0x194);}return _0xccfc6e;};}function handleError(_0x399377,_0x355b74){_0x355b74=_0x355b74||0x1f4;return function(_0x4b2068){logger[_0x57be('0x28')](_0x4b2068[_0x57be('0x29')]);if(_0x4b2068[_0x57be('0x2a')]){delete _0x4b2068[_0x57be('0x2a')];}_0x399377[_0x57be('0x1b')](_0x355b74)[_0x57be('0x2b')](_0x4b2068);};}exports[_0x57be('0x2c')]=function(_0xc58ed8,_0x32fc4e){var _0x52c644={},_0x78ec5c={},_0x12ac05={'count':0x0,'rows':[]};var _0x1f0f23=_[_0x57be('0x2d')](db[_0x57be('0x2e')][_0x57be('0x2f')],function(_0x38b7b9){return{'name':_0x38b7b9[_0x57be('0x30')],'type':_0x38b7b9[_0x57be('0x31')][_0x57be('0x32')]};});_0x78ec5c[_0x57be('0x33')]=_[_0x57be('0x2d')](_0x1f0f23,_0x57be('0x2a'));_0x78ec5c[_0x57be('0x34')]=_['keys'](_0xc58ed8[_0x57be('0x34')]);_0x78ec5c[_0x57be('0x35')]=_[_0x57be('0x36')](_0x78ec5c[_0x57be('0x33')],_0x78ec5c[_0x57be('0x34')]);_0x52c644[_0x57be('0x37')]=_[_0x57be('0x36')](_0x78ec5c[_0x57be('0x33')],qs[_0x57be('0x38')](_0xc58ed8['query'][_0x57be('0x38')]));_0x52c644[_0x57be('0x37')]=_0x52c644[_0x57be('0x37')][_0x57be('0x39')]?_0x52c644[_0x57be('0x37')]:_0x78ec5c['model'];if(!_0xc58ed8[_0x57be('0x34')][_0x57be('0x3a')](_0x57be('0x3b'))){_0x52c644[_0x57be('0x1e')]=qs[_0x57be('0x1e')](_0xc58ed8['query'][_0x57be('0x1e')]);_0x52c644['offset']=qs['offset'](_0xc58ed8[_0x57be('0x34')][_0x57be('0x1c')]);}_0x52c644[_0x57be('0x3c')]=qs[_0x57be('0x3d')](_0xc58ed8[_0x57be('0x34')]['sort']);_0x52c644[_0x57be('0x3e')]=qs[_0x57be('0x35')](_[_0x57be('0x3f')](_0xc58ed8[_0x57be('0x34')],_0x78ec5c[_0x57be('0x35')]),_0x1f0f23);if(_0xc58ed8[_0x57be('0x34')][_0x57be('0x40')]){_0x52c644['where']=_['merge'](_0x52c644[_0x57be('0x3e')],{'$or':_[_0x57be('0x2d')](_0x1f0f23,function(_0x1da376){if(_0x1da376[_0x57be('0x31')]!==_0x57be('0x41')){var _0x234257={};_0x234257[_0x1da376[_0x57be('0x2a')]]={'$like':'%'+_0xc58ed8[_0x57be('0x34')][_0x57be('0x40')]+'%'};return _0x234257;}})});}_0x52c644=_[_0x57be('0x42')]({},_0x52c644,_0xc58ed8[_0x57be('0x43')]);var _0x2159e0={'where':_0x52c644[_0x57be('0x3e')]};return db[_0x57be('0x2e')]['count'](_0x2159e0)['then'](function(_0x9addde){_0x12ac05[_0x57be('0x1d')]=_0x9addde;if(_0xc58ed8[_0x57be('0x34')]['includeAll']){_0x52c644[_0x57be('0x44')]=[{'all':!![]}];}return db[_0x57be('0x2e')][_0x57be('0x45')](_0x52c644);})[_0x57be('0x24')](function(_0x39fd26){_0x12ac05[_0x57be('0x46')]=_0x39fd26;return _0x12ac05;})[_0x57be('0x24')](respondWithFilteredResult(_0x32fc4e,_0x52c644))[_0x57be('0x47')](handleError(_0x32fc4e,null));};exports[_0x57be('0x48')]=function(_0x300052,_0x4235a6){var _0x1557e5={'raw':![],'where':{'id':_0x300052[_0x57be('0x49')]['id']}},_0x57dfa4={};_0x57dfa4[_0x57be('0x33')]=_[_0x57be('0x4a')](db[_0x57be('0x2e')][_0x57be('0x2f')]);_0x57dfa4[_0x57be('0x34')]=_['keys'](_0x300052[_0x57be('0x34')]);_0x57dfa4[_0x57be('0x35')]=_[_0x57be('0x36')](_0x57dfa4['model'],_0x57dfa4[_0x57be('0x34')]);_0x1557e5[_0x57be('0x37')]=_['intersection'](_0x57dfa4[_0x57be('0x33')],qs[_0x57be('0x38')](_0x300052[_0x57be('0x34')][_0x57be('0x38')]));_0x1557e5[_0x57be('0x37')]=_0x1557e5['attributes'][_0x57be('0x39')]?_0x1557e5[_0x57be('0x37')]:_0x57dfa4[_0x57be('0x33')];if(_0x300052['query'][_0x57be('0x4b')]){_0x1557e5['include']=[{'all':!![]}];}_0x1557e5=_['merge']({},_0x1557e5,_0x300052[_0x57be('0x43')]);return db[_0x57be('0x2e')]['find'](_0x1557e5)[_0x57be('0x24')](handleEntityNotFound(_0x4235a6,null))['then'](respondWithResult(_0x4235a6,null))[_0x57be('0x47')](handleError(_0x4235a6,null));};exports[_0x57be('0x4c')]=function(_0x177087,_0x38c12f){return db[_0x57be('0x2e')][_0x57be('0x4c')](_0x177087['body'],{})[_0x57be('0x24')](respondWithResult(_0x38c12f,0xc9))[_0x57be('0x47')](handleError(_0x38c12f,null));};exports[_0x57be('0x23')]=function(_0x5becd8,_0xca2982){if(_0x5becd8[_0x57be('0x4d')]['id']){delete _0x5becd8[_0x57be('0x4d')]['id'];}return db['VoiceQueueReport'][_0x57be('0x4e')]({'where':{'id':_0x5becd8[_0x57be('0x49')]['id']}})[_0x57be('0x24')](handleEntityNotFound(_0xca2982,null))[_0x57be('0x24')](saveUpdates(_0x5becd8[_0x57be('0x4d')],null))[_0x57be('0x24')](respondWithResult(_0xca2982,null))[_0x57be('0x47')](handleError(_0xca2982,null));};exports['destroy']=function(_0x2ad0ca,_0x16eb7e){return db['VoiceQueueReport']['find']({'where':{'id':_0x2ad0ca[_0x57be('0x49')]['id']}})[_0x57be('0x24')](handleEntityNotFound(_0x16eb7e,null))[_0x57be('0x24')](removeEntity(_0x16eb7e,null))[_0x57be('0x47')](handleError(_0x16eb7e,null));};exports[_0x57be('0x4f')]=function(_0x34a2e5,_0x2285e7){return db[_0x57be('0x2e')]['describe']()[_0x57be('0x24')](respondWithResult(_0x2285e7,null))[_0x57be('0x47')](handleError(_0x2285e7,null));};exports[_0x57be('0x50')]=function(_0x8023e6,_0x551650){var _0x3e448d={},_0x4b6342={},_0x2e8c98={'count':0x0,'rows':[]};_0x4b6342['model']=_['keys'](db[_0x57be('0x2e')]['rawAttributes']);_0x4b6342[_0x57be('0x34')]=_[_0x57be('0x4a')](_0x8023e6[_0x57be('0x34')]);_0x4b6342[_0x57be('0x35')]=_['intersection'](_0x4b6342['model'],_0x4b6342[_0x57be('0x34')]);_0x3e448d[_0x57be('0x37')]=_[_0x57be('0x36')](_0x4b6342['model'],qs[_0x57be('0x38')](_0x8023e6[_0x57be('0x34')][_0x57be('0x38')]));_0x3e448d[_0x57be('0x37')]=_0x3e448d[_0x57be('0x37')]['length']?_0x3e448d[_0x57be('0x37')]:_0x4b6342['model'];if(!_0x8023e6[_0x57be('0x34')][_0x57be('0x3a')]('nolimit')){_0x3e448d[_0x57be('0x1e')]=qs['limit'](_0x8023e6[_0x57be('0x34')][_0x57be('0x1e')]);_0x3e448d[_0x57be('0x1c')]=qs[_0x57be('0x1c')](_0x8023e6[_0x57be('0x34')][_0x57be('0x1c')]);}_0x3e448d['order']=qs[_0x57be('0x3d')](_0x8023e6[_0x57be('0x34')]['sort']);_0x3e448d['where']=qs[_0x57be('0x35')](_[_0x57be('0x3f')](_0x8023e6[_0x57be('0x34')],_0x4b6342[_0x57be('0x35')]));if(_0x8023e6['query'][_0x57be('0x40')]){_0x3e448d[_0x57be('0x3e')]=_['merge'](_0x3e448d[_0x57be('0x3e')],{'$or':_[_0x57be('0x2d')](_0x3e448d[_0x57be('0x37')],function(_0x4f90e8){var _0x2641ed={};_0x2641ed[_0x4f90e8]={'$like':'%'+_0x8023e6['query'][_0x57be('0x40')]+'%'};return _0x2641ed;})});}_0x3e448d=_[_0x57be('0x42')]({},_0x3e448d,_0x8023e6[_0x57be('0x43')]);var _0x50e493={'where':_0x3e448d[_0x57be('0x3e')]};return db['VoiceQueueReport'][_0x57be('0x1d')](_0x50e493)['then'](function(_0x45fdad){_0x2e8c98[_0x57be('0x1d')]=_0x45fdad;if(_0x8023e6[_0x57be('0x34')][_0x57be('0x4b')]){_0x3e448d[_0x57be('0x44')]=[{'all':!![]}];}return db[_0x57be('0x2e')][_0x57be('0x45')](_0x3e448d);})['then'](function(_0x278bb0){_0x2e8c98[_0x57be('0x46')]=_0x278bb0;return _0x2e8c98;})[_0x57be('0x24')](respondWithFilteredResult(_0x551650,_0x3e448d,'getVoiceQueuesReport'))[_0x57be('0x47')](handleError(_0x551650,null,_0x57be('0x50')));}; \ No newline at end of file +var _0x331b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','rows','catch','show','params','keys','includeAll','options','find','create','body','update','describe','getVoiceQueuesReport','nolimit','findAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x331b,0x148));var _0xb331=function(_0x45c518,_0x48d0a7){_0x45c518=_0x45c518-0x0;var _0x498809=_0x331b[_0x45c518];return _0x498809;};'use strict';var emlformat=require(_0xb331('0x0'));var rimraf=require(_0xb331('0x1'));var zipdir=require(_0xb331('0x2'));var jsonpatch=require(_0xb331('0x3'));var rp=require(_0xb331('0x4'));var moment=require(_0xb331('0x5'));var BPromise=require(_0xb331('0x6'));var Mustache=require('mustache');var util=require(_0xb331('0x7'));var path=require(_0xb331('0x8'));var sox=require(_0xb331('0x9'));var csv=require(_0xb331('0xa'));var ejs=require(_0xb331('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb331('0xc'));var squel=require(_0xb331('0xd'));var crypto=require(_0xb331('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb331('0xf'));var toCsv=require(_0xb331('0xa'));var querystring=require('querystring');var Papa=require(_0xb331('0x10'));var Redis=require('ioredis');var authService=require(_0xb331('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb331('0x12'));var hardwareService=require(_0xb331('0x13'));var logger=require('../../config/logger')(_0xb331('0x14'));var utils=require(_0xb331('0x15'));var config=require(_0xb331('0x16'));var licenseUtil=require(_0xb331('0x17'));var db=require('../../mysqldb')['db'];config[_0xb331('0x18')]=_[_0xb331('0x19')](config[_0xb331('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb331('0x1a'))(new Redis(config[_0xb331('0x18')]));require(_0xb331('0x1b'))[_0xb331('0x1c')](socket);function respondWithStatusCode(_0x5ad108,_0x25746b){_0x25746b=_0x25746b||0xcc;return function(_0x2f0347){if(_0x2f0347){return _0x5ad108[_0xb331('0x1d')](_0x25746b);}return _0x5ad108['status'](_0x25746b)[_0xb331('0x1e')]();};}function respondWithResult(_0x20a7dd,_0x6da9ca){_0x6da9ca=_0x6da9ca||0xc8;return function(_0xc77568){if(_0xc77568){return _0x20a7dd['status'](_0x6da9ca)[_0xb331('0x1f')](_0xc77568);}};}function respondWithFilteredResult(_0x274828,_0x29b956){return function(_0x1ddb20){if(_0x1ddb20){var _0x2df3e5=typeof _0x29b956[_0xb331('0x20')]===_0xb331('0x21')&&typeof _0x29b956['limit']===_0xb331('0x21');var _0x74a29f=_0x1ddb20[_0xb331('0x22')];var _0x24c7c9=_0x2df3e5?0x0:_0x29b956['offset'];var _0x12080c=_0x2df3e5?_0x1ddb20[_0xb331('0x22')]:_0x29b956[_0xb331('0x20')]+_0x29b956['limit'];var _0x42f8f7;if(_0x12080c>=_0x74a29f){_0x12080c=_0x74a29f;_0x42f8f7=0xc8;}else{_0x42f8f7=0xce;}_0x274828[_0xb331('0x23')](_0x42f8f7);return _0x274828[_0xb331('0x24')](_0xb331('0x25'),_0x24c7c9+'-'+_0x12080c+'/'+_0x74a29f)[_0xb331('0x1f')](_0x1ddb20);}return null;};}function patchUpdates(_0x239a3e){return function(_0x13cce3){try{jsonpatch[_0xb331('0x26')](_0x13cce3,_0x239a3e,!![]);}catch(_0x4af6fb){return BPromise[_0xb331('0x27')](_0x4af6fb);}return _0x13cce3['save']();};}function saveUpdates(_0x3633da,_0x4f6431){return function(_0x448506){if(_0x448506){return _0x448506['update'](_0x3633da)[_0xb331('0x28')](function(_0x64e418){return _0x64e418;});}return null;};}function removeEntity(_0x19a9d0,_0x474ce7){return function(_0x6afe5a){if(_0x6afe5a){return _0x6afe5a[_0xb331('0x29')]()[_0xb331('0x28')](function(){_0x19a9d0[_0xb331('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26af88,_0x423cfe){return function(_0xd50c16){if(!_0xd50c16){_0x26af88[_0xb331('0x1d')](0x194);}return _0xd50c16;};}function handleError(_0x55e38f,_0x2444ce){_0x2444ce=_0x2444ce||0x1f4;return function(_0x1559e7){logger[_0xb331('0x2a')](_0x1559e7['stack']);if(_0x1559e7[_0xb331('0x2b')]){delete _0x1559e7[_0xb331('0x2b')];}_0x55e38f[_0xb331('0x23')](_0x2444ce)[_0xb331('0x2c')](_0x1559e7);};}exports[_0xb331('0x2d')]=function(_0x433683,_0x52f503){var _0x552dc7={},_0x16c23d={},_0x24ccc9={'count':0x0,'rows':[]};var _0x193081=_[_0xb331('0x2e')](db[_0xb331('0x2f')][_0xb331('0x30')],function(_0x4cd5b3){return{'name':_0x4cd5b3['fieldName'],'type':_0x4cd5b3[_0xb331('0x31')][_0xb331('0x32')]};});_0x16c23d[_0xb331('0x33')]=_[_0xb331('0x2e')](_0x193081,_0xb331('0x2b'));_0x16c23d[_0xb331('0x34')]=_['keys'](_0x433683['query']);_0x16c23d[_0xb331('0x35')]=_[_0xb331('0x36')](_0x16c23d['model'],_0x16c23d[_0xb331('0x34')]);_0x552dc7[_0xb331('0x37')]=_['intersection'](_0x16c23d[_0xb331('0x33')],qs['fields'](_0x433683['query'][_0xb331('0x38')]));_0x552dc7[_0xb331('0x37')]=_0x552dc7['attributes'][_0xb331('0x39')]?_0x552dc7['attributes']:_0x16c23d[_0xb331('0x33')];if(!_0x433683[_0xb331('0x34')][_0xb331('0x3a')]('nolimit')){_0x552dc7['limit']=qs[_0xb331('0x3b')](_0x433683[_0xb331('0x34')]['limit']);_0x552dc7['offset']=qs[_0xb331('0x20')](_0x433683[_0xb331('0x34')][_0xb331('0x20')]);}_0x552dc7[_0xb331('0x3c')]=qs[_0xb331('0x3d')](_0x433683['query']['sort']);_0x552dc7['where']=qs[_0xb331('0x35')](_[_0xb331('0x3e')](_0x433683[_0xb331('0x34')],_0x16c23d[_0xb331('0x35')]),_0x193081);if(_0x433683[_0xb331('0x34')][_0xb331('0x3f')]){_0x552dc7[_0xb331('0x40')]=_[_0xb331('0x41')](_0x552dc7[_0xb331('0x40')],{'$or':_[_0xb331('0x2e')](_0x193081,function(_0x10bcd8){if(_0x10bcd8['type']!==_0xb331('0x42')){var _0x594c13={};_0x594c13[_0x10bcd8['name']]={'$like':'%'+_0x433683[_0xb331('0x34')]['filter']+'%'};return _0x594c13;}})});}_0x552dc7=_[_0xb331('0x41')]({},_0x552dc7,_0x433683['options']);var _0x22afe0={'where':_0x552dc7[_0xb331('0x40')]};return db[_0xb331('0x2f')]['count'](_0x22afe0)[_0xb331('0x28')](function(_0x16d7f8){_0x24ccc9[_0xb331('0x22')]=_0x16d7f8;if(_0x433683[_0xb331('0x34')]['includeAll']){_0x552dc7['include']=[{'all':!![]}];}return db[_0xb331('0x2f')]['findAll'](_0x552dc7);})[_0xb331('0x28')](function(_0x5dcd53){_0x24ccc9[_0xb331('0x43')]=_0x5dcd53;return _0x24ccc9;})[_0xb331('0x28')](respondWithFilteredResult(_0x52f503,_0x552dc7))[_0xb331('0x44')](handleError(_0x52f503,null));};exports[_0xb331('0x45')]=function(_0x329126,_0x951305){var _0x364ee8={'raw':![],'where':{'id':_0x329126[_0xb331('0x46')]['id']}},_0x14aa31={};_0x14aa31[_0xb331('0x33')]=_[_0xb331('0x47')](db[_0xb331('0x2f')][_0xb331('0x30')]);_0x14aa31[_0xb331('0x34')]=_[_0xb331('0x47')](_0x329126[_0xb331('0x34')]);_0x14aa31[_0xb331('0x35')]=_[_0xb331('0x36')](_0x14aa31[_0xb331('0x33')],_0x14aa31[_0xb331('0x34')]);_0x364ee8[_0xb331('0x37')]=_[_0xb331('0x36')](_0x14aa31[_0xb331('0x33')],qs[_0xb331('0x38')](_0x329126[_0xb331('0x34')][_0xb331('0x38')]));_0x364ee8[_0xb331('0x37')]=_0x364ee8['attributes'][_0xb331('0x39')]?_0x364ee8[_0xb331('0x37')]:_0x14aa31[_0xb331('0x33')];if(_0x329126[_0xb331('0x34')][_0xb331('0x48')]){_0x364ee8['include']=[{'all':!![]}];}_0x364ee8=_['merge']({},_0x364ee8,_0x329126[_0xb331('0x49')]);return db[_0xb331('0x2f')][_0xb331('0x4a')](_0x364ee8)[_0xb331('0x28')](handleEntityNotFound(_0x951305,null))[_0xb331('0x28')](respondWithResult(_0x951305,null))[_0xb331('0x44')](handleError(_0x951305,null));};exports[_0xb331('0x4b')]=function(_0x1e3208,_0x48f468){return db[_0xb331('0x2f')][_0xb331('0x4b')](_0x1e3208[_0xb331('0x4c')],{})[_0xb331('0x28')](respondWithResult(_0x48f468,0xc9))[_0xb331('0x44')](handleError(_0x48f468,null));};exports[_0xb331('0x4d')]=function(_0x5bb899,_0x1ba981){if(_0x5bb899['body']['id']){delete _0x5bb899[_0xb331('0x4c')]['id'];}return db[_0xb331('0x2f')][_0xb331('0x4a')]({'where':{'id':_0x5bb899[_0xb331('0x46')]['id']}})[_0xb331('0x28')](handleEntityNotFound(_0x1ba981,null))['then'](saveUpdates(_0x5bb899[_0xb331('0x4c')],null))[_0xb331('0x28')](respondWithResult(_0x1ba981,null))[_0xb331('0x44')](handleError(_0x1ba981,null));};exports[_0xb331('0x29')]=function(_0x2cee21,_0x5e1397){return db[_0xb331('0x2f')][_0xb331('0x4a')]({'where':{'id':_0x2cee21[_0xb331('0x46')]['id']}})[_0xb331('0x28')](handleEntityNotFound(_0x5e1397,null))[_0xb331('0x28')](removeEntity(_0x5e1397,null))[_0xb331('0x44')](handleError(_0x5e1397,null));};exports[_0xb331('0x4e')]=function(_0x454da9,_0x240630){return db[_0xb331('0x2f')][_0xb331('0x4e')]()['then'](respondWithResult(_0x240630,null))[_0xb331('0x44')](handleError(_0x240630,null));};exports[_0xb331('0x4f')]=function(_0x1d90e8,_0x318097){var _0x393589={},_0x3a8df2={},_0xf25d09={'count':0x0,'rows':[]};_0x3a8df2[_0xb331('0x33')]=_[_0xb331('0x47')](db[_0xb331('0x2f')][_0xb331('0x30')]);_0x3a8df2[_0xb331('0x34')]=_[_0xb331('0x47')](_0x1d90e8[_0xb331('0x34')]);_0x3a8df2['filters']=_[_0xb331('0x36')](_0x3a8df2[_0xb331('0x33')],_0x3a8df2[_0xb331('0x34')]);_0x393589[_0xb331('0x37')]=_[_0xb331('0x36')](_0x3a8df2[_0xb331('0x33')],qs[_0xb331('0x38')](_0x1d90e8[_0xb331('0x34')][_0xb331('0x38')]));_0x393589[_0xb331('0x37')]=_0x393589['attributes']['length']?_0x393589[_0xb331('0x37')]:_0x3a8df2[_0xb331('0x33')];if(!_0x1d90e8['query'][_0xb331('0x3a')](_0xb331('0x50'))){_0x393589['limit']=qs[_0xb331('0x3b')](_0x1d90e8[_0xb331('0x34')]['limit']);_0x393589['offset']=qs[_0xb331('0x20')](_0x1d90e8[_0xb331('0x34')][_0xb331('0x20')]);}_0x393589[_0xb331('0x3c')]=qs[_0xb331('0x3d')](_0x1d90e8['query'][_0xb331('0x3d')]);_0x393589[_0xb331('0x40')]=qs['filters'](_[_0xb331('0x3e')](_0x1d90e8[_0xb331('0x34')],_0x3a8df2['filters']));if(_0x1d90e8[_0xb331('0x34')][_0xb331('0x3f')]){_0x393589['where']=_[_0xb331('0x41')](_0x393589[_0xb331('0x40')],{'$or':_[_0xb331('0x2e')](_0x393589[_0xb331('0x37')],function(_0x1515dc){var _0x32c588={};_0x32c588[_0x1515dc]={'$like':'%'+_0x1d90e8[_0xb331('0x34')]['filter']+'%'};return _0x32c588;})});}_0x393589=_[_0xb331('0x41')]({},_0x393589,_0x1d90e8[_0xb331('0x49')]);var _0xa60597={'where':_0x393589[_0xb331('0x40')]};return db['VoiceQueueReport']['count'](_0xa60597)[_0xb331('0x28')](function(_0x50a42e){_0xf25d09['count']=_0x50a42e;if(_0x1d90e8['query']['includeAll']){_0x393589['include']=[{'all':!![]}];}return db[_0xb331('0x2f')][_0xb331('0x51')](_0x393589);})['then'](function(_0x1f159b){_0xf25d09['rows']=_0x1f159b;return _0xf25d09;})[_0xb331('0x28')](respondWithFilteredResult(_0x318097,_0x393589,_0xb331('0x4f')))[_0xb331('0x44')](handleError(_0x318097,null,_0xb331('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a8142e3..a437180 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 _0x5934=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x3405f6,_0x2d8255){var _0x4eb8eb=function(_0x18d3d1){while(--_0x18d3d1){_0x3405f6['push'](_0x3405f6['shift']());}};_0x4eb8eb(++_0x2d8255);}(_0x5934,0x14f));var _0x4593=function(_0x39ce74,_0x4fc373){_0x39ce74=_0x39ce74-0x0;var _0x57248e=_0x5934[_0x39ce74];return _0x57248e;};'use strict';var EventEmitter=require(_0x4593('0x0'));var VoiceQueueReport=require(_0x4593('0x1'))['db'][_0x4593('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4593('0x3')](0x0);var events={'afterCreate':_0x4593('0x4'),'afterUpdate':_0x4593('0x5'),'afterDestroy':_0x4593('0x6')};function emitEvent(_0x15290e){return function(_0x2c6831,_0x2c59d9,_0x333db3){VoiceQueueReportEvents[_0x4593('0x7')](_0x15290e+':'+_0x2c6831['id'],_0x2c6831);VoiceQueueReportEvents[_0x4593('0x7')](_0x15290e,_0x2c6831);_0x333db3(null);};}for(var e in events){if(events[_0x4593('0x8')](e)){var event=events[e];VoiceQueueReport[_0x4593('0x9')](e,emitEvent(event));}}module[_0x4593('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7836=['update','remove','emit','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x4917df,_0x51bfc0){var _0x2b4568=function(_0x46fa87){while(--_0x46fa87){_0x4917df['push'](_0x4917df['shift']());}};_0x2b4568(++_0x51bfc0);}(_0x7836,0xfc));var _0x6783=function(_0x184e69,_0x39af04){_0x184e69=_0x184e69-0x0;var _0x57d8ad=_0x7836[_0x184e69];return _0x57d8ad;};'use strict';var EventEmitter=require(_0x6783('0x0'));var VoiceQueueReport=require(_0x6783('0x1'))['db'][_0x6783('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6783('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6783('0x4'),'afterDestroy':_0x6783('0x5')};function emitEvent(_0x14fc76){return function(_0x325a7b,_0x49ec5b,_0x4e37ea){VoiceQueueReportEvents['emit'](_0x14fc76+':'+_0x325a7b['id'],_0x325a7b);VoiceQueueReportEvents[_0x6783('0x6')](_0x14fc76,_0x325a7b);_0x4e37ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x6783('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 3c06cb5..9df7efe 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 _0xb0c3=['path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','calleridnum','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xb0c3,0x1f3));var _0x3b0c=function(_0x55c41e,_0x3abd75){_0x55c41e=_0x55c41e-0x0;var _0x5cd08a=_0xb0c3[_0x55c41e];return _0x5cd08a;};'use strict';var _=require('lodash');var util=require(_0x3b0c('0x0'));var logger=require(_0x3b0c('0x1'))(_0x3b0c('0x2'));var moment=require('moment');var BPromise=require(_0x3b0c('0x3'));var rp=require(_0x3b0c('0x4'));var fs=require('fs');var path=require(_0x3b0c('0x5'));var rimraf=require(_0x3b0c('0x6'));var config=require(_0x3b0c('0x7'));var attributes=require(_0x3b0c('0x8'));module[_0x3b0c('0x9')]=function(_0x134c90,_0x46331b){return _0x134c90['define'](_0x3b0c('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x3b0c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x06c5=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','VoiceQueueReport','report_queue','calleridnum','lodash'];(function(_0x358e1c,_0x2c215b){var _0x3e3efb=function(_0x12f313){while(--_0x12f313){_0x358e1c['push'](_0x358e1c['shift']());}};_0x3e3efb(++_0x2c215b);}(_0x06c5,0x19f));var _0x506c=function(_0x4220d7,_0x476dd8){_0x4220d7=_0x4220d7-0x0;var _0xf54e0f=_0x06c5[_0x4220d7];return _0xf54e0f;};'use strict';var _=require(_0x506c('0x0'));var util=require(_0x506c('0x1'));var logger=require(_0x506c('0x2'))(_0x506c('0x3'));var moment=require(_0x506c('0x4'));var BPromise=require(_0x506c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x506c('0x6'));var rimraf=require('rimraf');var config=require(_0x506c('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x506c('0x8')]=function(_0x1c5311,_0x5c7e2d){return _0x1c5311[_0x506c('0x9')](_0x506c('0xa'),attributes,{'tableName':_0x506c('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x506c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index e59ac34..ce0224f 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 _0x0e48=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','then','stringify','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','where','lodash','util'];(function(_0x2ff8af,_0xd48e8){var _0x1d7758=function(_0x262c89){while(--_0x262c89){_0x2ff8af['push'](_0x2ff8af['shift']());}};_0x1d7758(++_0xd48e8);}(_0x0e48,0x19c));var _0x80e4=function(_0x215a5c,_0xa79b49){_0x215a5c=_0x215a5c-0x0;var _0x33e1a6=_0x0e48[_0x215a5c];return _0x33e1a6;};'use strict';var _=require(_0x80e4('0x0'));var util=require(_0x80e4('0x1'));var moment=require(_0x80e4('0x2'));var BPromise=require('bluebird');var rs=require(_0x80e4('0x3'));var fs=require('fs');var Redis=require(_0x80e4('0x4'));var db=require(_0x80e4('0x5'))['db'];var utils=require(_0x80e4('0x6'));var logger=require('../../config/logger')(_0x80e4('0x7'));var config=require(_0x80e4('0x8'));var jayson=require(_0x80e4('0x9'));var client=jayson[_0x80e4('0xa')][_0x80e4('0xb')]({'port':0x232a});config[_0x80e4('0xc')]=_[_0x80e4('0xd')](config[_0x80e4('0xc')],{'host':_0x80e4('0xe'),'port':0x18eb});var socket=require(_0x80e4('0xf'))(new Redis(config['redis']));require(_0x80e4('0x10'))[_0x80e4('0x11')](socket);function respondWithRpcPromise(_0x5d0362,_0x156b27,_0x1e33af){return new BPromise(function(_0x5f489c,_0x56c236){return client[_0x80e4('0x12')](_0x5d0362,_0x1e33af)['then'](function(_0x542b89){logger[_0x80e4('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x156b27,_0x80e4('0x14'));logger[_0x80e4('0x15')](_0x80e4('0x16'),_0x156b27,_0x80e4('0x14'),JSON['stringify'](_0x542b89));if(_0x542b89[_0x80e4('0x17')]){if(_0x542b89[_0x80e4('0x17')][_0x80e4('0x18')]===0x1f4){logger[_0x80e4('0x17')](_0x80e4('0x19'),_0x156b27,_0x542b89[_0x80e4('0x17')]['message']);return _0x56c236(_0x542b89[_0x80e4('0x17')]['message']);}logger[_0x80e4('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x156b27,_0x542b89[_0x80e4('0x17')][_0x80e4('0x1a')]);return _0x5f489c(_0x542b89[_0x80e4('0x17')][_0x80e4('0x1a')]);}else{logger[_0x80e4('0x13')](_0x80e4('0x19'),_0x156b27,_0x80e4('0x14'));_0x5f489c(_0x542b89[_0x80e4('0x1b')][_0x80e4('0x1a')]);}})[_0x80e4('0x1c')](function(_0xafd6eb){logger['error'](_0x80e4('0x19'),_0x156b27,_0xafd6eb);_0x56c236(_0xafd6eb);});});}exports[_0x80e4('0x1d')]=function(_0x495e3a){var _0x5727d3=this;return new Promise(function(_0x5833bb,_0x451238){return db[_0x80e4('0x1e')][_0x80e4('0x1f')]({'raw':_0x495e3a[_0x80e4('0x20')]?_0x495e3a['options'][_0x80e4('0x21')]===undefined?!![]:![]:!![],'where':_0x495e3a[_0x80e4('0x20')]?_0x495e3a[_0x80e4('0x20')]['where']||null:null,'attributes':_0x495e3a['options']?_0x495e3a[_0x80e4('0x20')][_0x80e4('0x22')]||null:null,'limit':_0x495e3a[_0x80e4('0x20')]?_0x495e3a['options'][_0x80e4('0x23')]||null:null,'include':_0x495e3a[_0x80e4('0x20')]?_0x495e3a[_0x80e4('0x20')][_0x80e4('0x24')]?_[_0x80e4('0x25')](_0x495e3a[_0x80e4('0x20')]['include'],function(_0x597f17){return{'model':db[_0x597f17[_0x80e4('0x26')]],'as':_0x597f17['as'],'attributes':_0x597f17[_0x80e4('0x22')],'include':_0x597f17[_0x80e4('0x24')]?_[_0x80e4('0x25')](_0x597f17['include'],function(_0x658951){return{'model':db[_0x658951[_0x80e4('0x26')]],'as':_0x658951['as'],'attributes':_0x658951['attributes'],'include':_0x658951['include']?_[_0x80e4('0x25')](_0x658951['include'],function(_0x53741f){return{'model':db[_0x53741f[_0x80e4('0x26')]],'as':_0x53741f['as'],'attributes':_0x53741f[_0x80e4('0x22')]};}):[]};}):[]};}):[]:[]})[_0x80e4('0x27')](function(_0x36c48b){logger[_0x80e4('0x13')](_0x80e4('0x1d'),_0x495e3a);logger[_0x80e4('0x15')](_0x80e4('0x1d'),_0x495e3a,JSON[_0x80e4('0x28')](_0x36c48b));_0x5833bb(_0x36c48b);})[_0x80e4('0x1c')](function(_0x4811d0){logger[_0x80e4('0x17')](_0x80e4('0x1d'),_0x4811d0[_0x80e4('0x1a')],_0x495e3a);_0x451238(_0x5727d3[_0x80e4('0x17')](0x1f4,_0x4811d0[_0x80e4('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x1754f4){var _0x416165=this;return new Promise(function(_0x182ff1,_0x2b19c8){return db[_0x80e4('0x1e')][_0x80e4('0x29')](_0x1754f4[_0x80e4('0x2a')],{'raw':_0x1754f4['options']?_0x1754f4[_0x80e4('0x20')][_0x80e4('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x4ba3ab){logger['info']('CreateVoiceQueueReport',_0x1754f4);logger[_0x80e4('0x15')](_0x80e4('0x2b'),_0x1754f4,JSON[_0x80e4('0x28')](_0x4ba3ab));_0x182ff1(_0x4ba3ab);})['catch'](function(_0x4af92b){logger['error'](_0x80e4('0x2b'),_0x4af92b['message'],_0x1754f4);_0x2b19c8(_0x416165[_0x80e4('0x17')](0x1f4,_0x4af92b['message']));});});};exports[_0x80e4('0x2c')]=function(_0x5a58d1){var _0xf26d9d=this;return new Promise(function(_0x518493,_0x3ba60a){return db[_0x80e4('0x1e')]['update'](_0x5a58d1[_0x80e4('0x2a')],{'raw':_0x5a58d1[_0x80e4('0x20')]?_0x5a58d1[_0x80e4('0x20')][_0x80e4('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a58d1['options']?_0x5a58d1[_0x80e4('0x20')][_0x80e4('0x2d')]||null:null,'attributes':_0x5a58d1[_0x80e4('0x20')]?_0x5a58d1[_0x80e4('0x20')][_0x80e4('0x22')]||null:null,'limit':_0x5a58d1[_0x80e4('0x20')]?_0x5a58d1[_0x80e4('0x20')]['limit']||null:null})['then'](function(_0x1ce96c){logger['info']('UpdateVoiceQueueReport',_0x5a58d1);logger[_0x80e4('0x15')]('UpdateVoiceQueueReport',_0x5a58d1,JSON[_0x80e4('0x28')](_0x1ce96c));_0x518493(_0x1ce96c);})[_0x80e4('0x1c')](function(_0x5bb092){logger[_0x80e4('0x17')]('UpdateVoiceQueueReport',_0x5bb092[_0x80e4('0x1a')],_0x5a58d1);_0x3ba60a(_0xf26d9d[_0x80e4('0x17')](0x1f4,_0x5bb092[_0x80e4('0x1a')]));});});}; \ No newline at end of file +var _0xae00=['VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','CreateVoiceQueueReport','create','body','debug','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./voiceQueueReport.socket','register','request','then','info'];(function(_0x2070f5,_0x53733e){var _0x37e82c=function(_0x50afce){while(--_0x50afce){_0x2070f5['push'](_0x2070f5['shift']());}};_0x37e82c(++_0x53733e);}(_0xae00,0xc9));var _0x0ae0=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0xae00[_0x303064];return _0x5a1d3d;};'use strict';var _=require(_0x0ae0('0x0'));var util=require(_0x0ae0('0x1'));var moment=require(_0x0ae0('0x2'));var BPromise=require(_0x0ae0('0x3'));var rs=require(_0x0ae0('0x4'));var fs=require('fs');var Redis=require(_0x0ae0('0x5'));var db=require(_0x0ae0('0x6'))['db'];var utils=require(_0x0ae0('0x7'));var logger=require(_0x0ae0('0x8'))('rpc');var config=require(_0x0ae0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0ae0('0xa')][_0x0ae0('0xb')]({'port':0x232a});config[_0x0ae0('0xc')]=_[_0x0ae0('0xd')](config[_0x0ae0('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ae0('0xc')]));require(_0x0ae0('0xe'))[_0x0ae0('0xf')](socket);function respondWithRpcPromise(_0x4de532,_0x1cfa3a,_0x42e9e3){return new BPromise(function(_0x1e03c1,_0x4485f4){return client[_0x0ae0('0x10')](_0x4de532,_0x42e9e3)[_0x0ae0('0x11')](function(_0x394a7e){logger[_0x0ae0('0x12')](_0x0ae0('0x13'),_0x1cfa3a,_0x0ae0('0x14'));logger['debug'](_0x0ae0('0x15'),_0x1cfa3a,'request\x20sent',JSON[_0x0ae0('0x16')](_0x394a7e));if(_0x394a7e[_0x0ae0('0x17')]){if(_0x394a7e[_0x0ae0('0x17')][_0x0ae0('0x18')]===0x1f4){logger[_0x0ae0('0x17')](_0x0ae0('0x13'),_0x1cfa3a,_0x394a7e['error'][_0x0ae0('0x19')]);return _0x4485f4(_0x394a7e[_0x0ae0('0x17')][_0x0ae0('0x19')]);}logger[_0x0ae0('0x17')](_0x0ae0('0x13'),_0x1cfa3a,_0x394a7e['error'][_0x0ae0('0x19')]);return _0x1e03c1(_0x394a7e[_0x0ae0('0x17')][_0x0ae0('0x19')]);}else{logger[_0x0ae0('0x12')](_0x0ae0('0x13'),_0x1cfa3a,'request\x20sent');_0x1e03c1(_0x394a7e[_0x0ae0('0x1a')][_0x0ae0('0x19')]);}})[_0x0ae0('0x1b')](function(_0x2c29b9){logger[_0x0ae0('0x17')](_0x0ae0('0x13'),_0x1cfa3a,_0x2c29b9);_0x4485f4(_0x2c29b9);});});}exports['GetVoiceQueueReport']=function(_0x178e7d){var _0x5dca6b=this;return new Promise(function(_0x5cff70,_0x19e07b){return db[_0x0ae0('0x1c')][_0x0ae0('0x1d')]({'raw':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x1f')]===undefined?!![]:![]:!![],'where':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x20')]||null:null,'attributes':_0x178e7d['options']?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x21')]||null:null,'limit':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x22')]||null:null,'include':_0x178e7d[_0x0ae0('0x1e')]?_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x23')]?_[_0x0ae0('0x24')](_0x178e7d[_0x0ae0('0x1e')][_0x0ae0('0x23')],function(_0x385310){return{'model':db[_0x385310[_0x0ae0('0x25')]],'as':_0x385310['as'],'attributes':_0x385310['attributes'],'include':_0x385310[_0x0ae0('0x23')]?_[_0x0ae0('0x24')](_0x385310['include'],function(_0x7454b9){return{'model':db[_0x7454b9[_0x0ae0('0x25')]],'as':_0x7454b9['as'],'attributes':_0x7454b9[_0x0ae0('0x21')],'include':_0x7454b9['include']?_[_0x0ae0('0x24')](_0x7454b9['include'],function(_0x2002ae){return{'model':db[_0x2002ae['model']],'as':_0x2002ae['as'],'attributes':_0x2002ae[_0x0ae0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0ae0('0x11')](function(_0xd9fbd){logger['info'](_0x0ae0('0x26'),_0x178e7d);logger['debug'](_0x0ae0('0x26'),_0x178e7d,JSON[_0x0ae0('0x16')](_0xd9fbd));_0x5cff70(_0xd9fbd);})[_0x0ae0('0x1b')](function(_0x1964ec){logger[_0x0ae0('0x17')](_0x0ae0('0x26'),_0x1964ec['message'],_0x178e7d);_0x19e07b(_0x5dca6b['error'](0x1f4,_0x1964ec[_0x0ae0('0x19')]));});});};exports[_0x0ae0('0x27')]=function(_0x26c873){var _0x262808=this;return new Promise(function(_0x3c8f1e,_0x2df415){return db[_0x0ae0('0x1c')][_0x0ae0('0x28')](_0x26c873[_0x0ae0('0x29')],{'raw':_0x26c873['options']?_0x26c873[_0x0ae0('0x1e')][_0x0ae0('0x1f')]===undefined?!![]:![]:!![]})[_0x0ae0('0x11')](function(_0x274718){logger[_0x0ae0('0x12')](_0x0ae0('0x27'),_0x26c873);logger[_0x0ae0('0x2a')](_0x0ae0('0x27'),_0x26c873,JSON['stringify'](_0x274718));_0x3c8f1e(_0x274718);})[_0x0ae0('0x1b')](function(_0xf84147){logger[_0x0ae0('0x17')](_0x0ae0('0x27'),_0xf84147[_0x0ae0('0x19')],_0x26c873);_0x2df415(_0x262808[_0x0ae0('0x17')](0x1f4,_0xf84147[_0x0ae0('0x19')]));});});};exports[_0x0ae0('0x2b')]=function(_0x310cb9){var _0x5d52b2=this;return new Promise(function(_0x21d8f7,_0x193637){return db[_0x0ae0('0x1c')]['update'](_0x310cb9[_0x0ae0('0x29')],{'raw':_0x310cb9[_0x0ae0('0x1e')]?_0x310cb9[_0x0ae0('0x1e')][_0x0ae0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310cb9[_0x0ae0('0x1e')]?_0x310cb9[_0x0ae0('0x1e')][_0x0ae0('0x20')]||null:null,'attributes':_0x310cb9['options']?_0x310cb9['options']['attributes']||null:null,'limit':_0x310cb9[_0x0ae0('0x1e')]?_0x310cb9['options'][_0x0ae0('0x22')]||null:null})[_0x0ae0('0x11')](function(_0x1f576f){logger['info'](_0x0ae0('0x2b'),_0x310cb9);logger['debug'](_0x0ae0('0x2b'),_0x310cb9,JSON['stringify'](_0x1f576f));_0x21d8f7(_0x1f576f);})['catch'](function(_0x787c86){logger['error'](_0x0ae0('0x2b'),_0x787c86[_0x0ae0('0x19')],_0x310cb9);_0x193637(_0x5d52b2[_0x0ae0('0x17')](0x1f4,_0x787c86[_0x0ae0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 4998921..b8cfb61 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 _0xb453=['./voiceQueueReport.events','save','update','emit','removeListener','register','length','voiceQueueReport:'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0xb453,0x1e8));var _0x3b45=function(_0x175cdf,_0x231703){_0x175cdf=_0x175cdf-0x0;var _0x51260e=_0xb453[_0x175cdf];return _0x51260e;};'use strict';var VoiceQueueReportEvents=require(_0x3b45('0x0'));var events=[_0x3b45('0x1'),'remove',_0x3b45('0x2')];function createListener(_0x19c429,_0x48ecf8){return function(_0x4a6ac4){_0x48ecf8[_0x3b45('0x3')](_0x19c429,_0x4a6ac4);};}function removeListener(_0x471768,_0x10029d){return function(){VoiceQueueReportEvents[_0x3b45('0x4')](_0x471768,_0x10029d);};}exports[_0x3b45('0x5')]=function(_0x210775){for(var _0x2f4baa=0x0,_0x39c77c=events[_0x3b45('0x6')];_0x2f4baa<_0x39c77c;_0x2f4baa++){var _0x1b529a=events[_0x2f4baa];var _0x59da08=createListener(_0x3b45('0x7')+_0x1b529a,_0x210775);VoiceQueueReportEvents['on'](_0x1b529a,_0x59da08);}}; \ No newline at end of file +var _0xca9e=['remove','update','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xca9e,0x136));var _0xeca9=function(_0x2e7ae7,_0x1221a5){_0x2e7ae7=_0x2e7ae7-0x0;var _0x2ad99f=_0xca9e[_0x2e7ae7];return _0x2ad99f;};'use strict';var VoiceQueueReportEvents=require(_0xeca9('0x0'));var events=[_0xeca9('0x1'),_0xeca9('0x2'),_0xeca9('0x3')];function createListener(_0x2df937,_0x1443e3){return function(_0x8dbabb){_0x1443e3[_0xeca9('0x4')](_0x2df937,_0x8dbabb);};}function removeListener(_0x1b2864,_0x1e0a18){return function(){VoiceQueueReportEvents[_0xeca9('0x5')](_0x1b2864,_0x1e0a18);};}exports[_0xeca9('0x6')]=function(_0x186a47){for(var _0x305dc5=0x0,_0x483e41=events[_0xeca9('0x7')];_0x305dc5<_0x483e41;_0x305dc5++){var _0x1774f3=events[_0x305dc5];var _0x4d57ee=createListener('voiceQueueReport:'+_0x1774f3,_0x186a47);VoiceQueueReportEvents['on'](_0x1774f3,_0x4d57ee);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index efc9413..5e0351f 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 _0x2dde=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x154c72,_0x205607){var _0x13f71e=function(_0x2c10ef){while(--_0x2c10ef){_0x154c72['push'](_0x154c72['shift']());}};_0x13f71e(++_0x205607);}(_0x2dde,0x19a));var _0xe2dd=function(_0x4e2ce6,_0x5d0c3b){_0x4e2ce6=_0x4e2ce6-0x0;var _0x5a3e83=_0x2dde[_0x4e2ce6];return _0x5a3e83;};'use strict';var multer=require(_0xe2dd('0x0'));var util=require(_0xe2dd('0x1'));var path=require(_0xe2dd('0x2'));var timeout=require(_0xe2dd('0x3'));var express=require(_0xe2dd('0x4'));var router=express['Router']();var fs_extra=require(_0xe2dd('0x5'));var auth=require(_0xe2dd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe2dd('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0xe2dd('0x8')]('/',auth[_0xe2dd('0x9')](),controller[_0xe2dd('0xa')]);router[_0xe2dd('0x8')](_0xe2dd('0xb'),auth[_0xe2dd('0x9')](),controller[_0xe2dd('0xc')]);router[_0xe2dd('0xd')]('/',auth[_0xe2dd('0x9')](),controller[_0xe2dd('0xe')]);router[_0xe2dd('0xf')]('/:id',auth[_0xe2dd('0x9')](),controller['update']);router[_0xe2dd('0x10')]('/:id',auth[_0xe2dd('0x9')](),controller['destroy']);module[_0xe2dd('0x11')]=router; \ No newline at end of file +var _0x6523=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete'];(function(_0x43d0e6,_0x3c1489){var _0x51d841=function(_0x3e8559){while(--_0x3e8559){_0x43d0e6['push'](_0x43d0e6['shift']());}};_0x51d841(++_0x3c1489);}(_0x6523,0x1a6));var _0x3652=function(_0x2d398b,_0x5e98f8){_0x2d398b=_0x2d398b-0x0;var _0x5d8b9d=_0x6523[_0x2d398b];return _0x5d8b9d;};'use strict';var multer=require(_0x3652('0x0'));var util=require(_0x3652('0x1'));var path=require('path');var timeout=require(_0x3652('0x2'));var express=require(_0x3652('0x3'));var router=express[_0x3652('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3652('0x5'));var interaction=require(_0x3652('0x6'));var config=require(_0x3652('0x7'));var controller=require(_0x3652('0x8'));router['get']('/',auth[_0x3652('0x9')](),controller[_0x3652('0xa')]);router[_0x3652('0xb')](_0x3652('0xc'),auth[_0x3652('0x9')](),controller[_0x3652('0xd')]);router[_0x3652('0xe')]('/',auth[_0x3652('0x9')](),controller[_0x3652('0xf')]);router[_0x3652('0x10')](_0x3652('0xc'),auth[_0x3652('0x9')](),controller['update']);router[_0x3652('0x11')](_0x3652('0xc'),auth[_0x3652('0x9')](),controller[_0x3652('0x12')]);module[_0x3652('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 527b5c0..8f574c0 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 _0x31f2=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','STRING','DATE'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x31f2,0x158));var _0x231f=function(_0x2a3eee,_0x105878){_0x2a3eee=_0x2a3eee-0x0;var _0x2ef377=_0x31f2[_0x2a3eee];return _0x2ef377;};'use strict';var Sequelize=require(_0x231f('0x0'));var moment=require('moment');module[_0x231f('0x1')]={'time':{'type':Sequelize[_0x231f('0x2')]},'callid':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x231f('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x231f('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x231f('0x4')](_0x231f('0x5'))}}; \ No newline at end of file +var _0x5069=['DATE','sequelize','moment','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5069,0x65));var _0x9506=function(_0x3bb6b3,_0x2225dd){_0x3bb6b3=_0x3bb6b3-0x0;var _0x105626=_0x5069[_0x3bb6b3];return _0x105626;};'use strict';var Sequelize=require(_0x9506('0x0'));var moment=require(_0x9506('0x1'));module['exports']={'time':{'type':Sequelize[_0x9506('0x2')]},'callid':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9506('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9506('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 6e316bd..a621fce 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 _0xfc3f=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','status','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','includeAll','rows','catch','keys','include','find','create','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc3f,0x193));var _0xffc3=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xfc3f[_0x934425];return _0x31d596;};'use strict';var emlformat=require(_0xffc3('0x0'));var rimraf=require(_0xffc3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffc3('0x2'));var rp=require(_0xffc3('0x3'));var moment=require(_0xffc3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xffc3('0x5'));var path=require('path');var sox=require(_0xffc3('0x6'));var csv=require(_0xffc3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffc3('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xffc3('0x9'));var deskjs=require(_0xffc3('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xffc3('0xb'));var Redis=require(_0xffc3('0xc'));var authService=require(_0xffc3('0xd'));var qs=require(_0xffc3('0xe'));var as=require(_0xffc3('0xf'));var hardwareService=require(_0xffc3('0x10'));var logger=require('../../config/logger')(_0xffc3('0x11'));var utils=require(_0xffc3('0x12'));var config=require(_0xffc3('0x13'));var licenseUtil=require(_0xffc3('0x14'));var db=require(_0xffc3('0x15'))['db'];function respondWithStatusCode(_0x17a925,_0x21171f){_0x21171f=_0x21171f||0xcc;return function(_0x343733){if(_0x343733){return _0x17a925[_0xffc3('0x16')](_0x21171f);}return _0x17a925['status'](_0x21171f)[_0xffc3('0x17')]();};}function respondWithResult(_0xaa62fc,_0x5625a6){_0x5625a6=_0x5625a6||0xc8;return function(_0x588ea2){if(_0x588ea2){return _0xaa62fc['status'](_0x5625a6)['json'](_0x588ea2);}};}function respondWithFilteredResult(_0x124278,_0x275ac2){return function(_0x20c527){if(_0x20c527){var _0x119f7a=typeof _0x275ac2[_0xffc3('0x18')]===_0xffc3('0x19')&&typeof _0x275ac2[_0xffc3('0x1a')]===_0xffc3('0x19');var _0x36f2c2=_0x20c527[_0xffc3('0x1b')];var _0x2dc653=_0x119f7a?0x0:_0x275ac2[_0xffc3('0x18')];var _0x474842=_0x119f7a?_0x20c527[_0xffc3('0x1b')]:_0x275ac2[_0xffc3('0x18')]+_0x275ac2[_0xffc3('0x1a')];var _0x244743;if(_0x474842>=_0x36f2c2){_0x474842=_0x36f2c2;_0x244743=0xc8;}else{_0x244743=0xce;}_0x124278['status'](_0x244743);return _0x124278[_0xffc3('0x1c')](_0xffc3('0x1d'),_0x2dc653+'-'+_0x474842+'/'+_0x36f2c2)[_0xffc3('0x1e')](_0x20c527);}return null;};}function patchUpdates(_0x41ee3a){return function(_0x4cd6bb){try{jsonpatch[_0xffc3('0x1f')](_0x4cd6bb,_0x41ee3a,!![]);}catch(_0x1af0b2){return BPromise[_0xffc3('0x20')](_0x1af0b2);}return _0x4cd6bb['save']();};}function saveUpdates(_0x2f5f0a,_0xd9479e){return function(_0x340e2e){if(_0x340e2e){return _0x340e2e['update'](_0x2f5f0a)[_0xffc3('0x21')](function(_0x4558a0){return _0x4558a0;});}return null;};}function removeEntity(_0x4973f5,_0x368c13){return function(_0x26bd34){if(_0x26bd34){return _0x26bd34[_0xffc3('0x22')]()[_0xffc3('0x21')](function(){_0x4973f5[_0xffc3('0x23')](0xcc)[_0xffc3('0x17')]();});}};}function handleEntityNotFound(_0x428842,_0x238339){return function(_0x12437a){if(!_0x12437a){_0x428842[_0xffc3('0x16')](0x194);}return _0x12437a;};}function handleError(_0x43ba0f,_0x2a196b){_0x2a196b=_0x2a196b||0x1f4;return function(_0x14f732){logger[_0xffc3('0x24')](_0x14f732[_0xffc3('0x25')]);if(_0x14f732[_0xffc3('0x26')]){delete _0x14f732[_0xffc3('0x26')];}_0x43ba0f[_0xffc3('0x23')](_0x2a196b)[_0xffc3('0x27')](_0x14f732);};}exports[_0xffc3('0x28')]=function(_0x2c2c26,_0x2d2d19){var _0x4c7216={},_0x2ae9fa={},_0x1aa01f={'count':0x0,'rows':[]};var _0x21ca50=_[_0xffc3('0x29')](db[_0xffc3('0x2a')][_0xffc3('0x2b')],function(_0x512436){return{'name':_0x512436[_0xffc3('0x2c')],'type':_0x512436['type'][_0xffc3('0x2d')]};});_0x2ae9fa['model']=_[_0xffc3('0x29')](_0x21ca50,_0xffc3('0x26'));_0x2ae9fa['query']=_['keys'](_0x2c2c26[_0xffc3('0x2e')]);_0x2ae9fa[_0xffc3('0x2f')]=_[_0xffc3('0x30')](_0x2ae9fa[_0xffc3('0x31')],_0x2ae9fa[_0xffc3('0x2e')]);_0x4c7216[_0xffc3('0x32')]=_[_0xffc3('0x30')](_0x2ae9fa[_0xffc3('0x31')],qs[_0xffc3('0x33')](_0x2c2c26[_0xffc3('0x2e')]['fields']));_0x4c7216[_0xffc3('0x32')]=_0x4c7216[_0xffc3('0x32')][_0xffc3('0x34')]?_0x4c7216[_0xffc3('0x32')]:_0x2ae9fa[_0xffc3('0x31')];if(!_0x2c2c26[_0xffc3('0x2e')][_0xffc3('0x35')]('nolimit')){_0x4c7216['limit']=qs[_0xffc3('0x1a')](_0x2c2c26[_0xffc3('0x2e')][_0xffc3('0x1a')]);_0x4c7216[_0xffc3('0x18')]=qs[_0xffc3('0x18')](_0x2c2c26[_0xffc3('0x2e')][_0xffc3('0x18')]);}_0x4c7216[_0xffc3('0x36')]=qs[_0xffc3('0x37')](_0x2c2c26[_0xffc3('0x2e')][_0xffc3('0x37')]);_0x4c7216['where']=qs[_0xffc3('0x2f')](_['pick'](_0x2c2c26[_0xffc3('0x2e')],_0x2ae9fa[_0xffc3('0x2f')]),_0x21ca50);if(_0x2c2c26[_0xffc3('0x2e')][_0xffc3('0x38')]){_0x4c7216['where']=_['merge'](_0x4c7216[_0xffc3('0x39')],{'$or':_[_0xffc3('0x29')](_0x21ca50,function(_0x5e3c9d){if(_0x5e3c9d['type']!==_0xffc3('0x3a')){var _0x1a0ffd={};_0x1a0ffd[_0x5e3c9d['name']]={'$like':'%'+_0x2c2c26[_0xffc3('0x2e')][_0xffc3('0x38')]+'%'};return _0x1a0ffd;}})});}_0x4c7216=_[_0xffc3('0x3b')]({},_0x4c7216,_0x2c2c26[_0xffc3('0x3c')]);var _0x8c9e10={'where':_0x4c7216['where']};return db[_0xffc3('0x2a')][_0xffc3('0x1b')](_0x8c9e10)['then'](function(_0x1bfc68){_0x1aa01f[_0xffc3('0x1b')]=_0x1bfc68;if(_0x2c2c26[_0xffc3('0x2e')][_0xffc3('0x3d')]){_0x4c7216['include']=[{'all':!![]}];}return db[_0xffc3('0x2a')]['findAll'](_0x4c7216);})['then'](function(_0x5c18e8){_0x1aa01f[_0xffc3('0x3e')]=_0x5c18e8;return _0x1aa01f;})[_0xffc3('0x21')](respondWithFilteredResult(_0x2d2d19,_0x4c7216))[_0xffc3('0x3f')](handleError(_0x2d2d19,null));};exports['show']=function(_0x10a59d,_0x46e0f7){var _0x1969a7={'raw':!![],'where':{'id':_0x10a59d['params']['id']}},_0x508484={};_0x508484[_0xffc3('0x31')]=_[_0xffc3('0x40')](db['VoiceQueuesLog']['rawAttributes']);_0x508484['query']=_[_0xffc3('0x40')](_0x10a59d['query']);_0x508484[_0xffc3('0x2f')]=_[_0xffc3('0x30')](_0x508484[_0xffc3('0x31')],_0x508484[_0xffc3('0x2e')]);_0x1969a7['attributes']=_[_0xffc3('0x30')](_0x508484[_0xffc3('0x31')],qs['fields'](_0x10a59d['query']['fields']));_0x1969a7[_0xffc3('0x32')]=_0x1969a7[_0xffc3('0x32')]['length']?_0x1969a7[_0xffc3('0x32')]:_0x508484[_0xffc3('0x31')];if(_0x10a59d[_0xffc3('0x2e')]['includeAll']){_0x1969a7[_0xffc3('0x41')]=[{'all':!![]}];}_0x1969a7=_['merge']({},_0x1969a7,_0x10a59d[_0xffc3('0x3c')]);return db[_0xffc3('0x2a')][_0xffc3('0x42')](_0x1969a7)[_0xffc3('0x21')](handleEntityNotFound(_0x46e0f7,null))[_0xffc3('0x21')](respondWithResult(_0x46e0f7,null))['catch'](handleError(_0x46e0f7,null));};exports[_0xffc3('0x43')]=function(_0x45be41,_0x2df01a){return db[_0xffc3('0x2a')]['create'](_0x45be41['body'],{})[_0xffc3('0x21')](respondWithResult(_0x2df01a,0xc9))[_0xffc3('0x3f')](handleError(_0x2df01a,null));};exports[_0xffc3('0x44')]=function(_0xd6a401,_0xf92421){if(_0xd6a401[_0xffc3('0x45')]['id']){delete _0xd6a401[_0xffc3('0x45')]['id'];}return db[_0xffc3('0x2a')]['find']({'where':{'id':_0xd6a401['params']['id']}})[_0xffc3('0x21')](handleEntityNotFound(_0xf92421,null))[_0xffc3('0x21')](saveUpdates(_0xd6a401[_0xffc3('0x45')],null))[_0xffc3('0x21')](respondWithResult(_0xf92421,null))[_0xffc3('0x3f')](handleError(_0xf92421,null));};exports[_0xffc3('0x22')]=function(_0x4725d8,_0xcdd5){return db[_0xffc3('0x2a')][_0xffc3('0x42')]({'where':{'id':_0x4725d8['params']['id']}})[_0xffc3('0x21')](handleEntityNotFound(_0xcdd5,null))[_0xffc3('0x21')](removeEntity(_0xcdd5,null))[_0xffc3('0x3f')](handleError(_0xcdd5,null));}; \ No newline at end of file +var _0xe8c0=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x1f47a4,_0x4c40da){var _0x5643f1=function(_0x13977d){while(--_0x13977d){_0x1f47a4['push'](_0x1f47a4['shift']());}};_0x5643f1(++_0x4c40da);}(_0xe8c0,0xcf));var _0x0e8c=function(_0x469581,_0x4e408e){_0x469581=_0x469581-0x0;var _0x506e50=_0xe8c0[_0x469581];return _0x506e50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e8c('0x0'));var zipdir=require(_0x0e8c('0x1'));var jsonpatch=require(_0x0e8c('0x2'));var rp=require('request-promise');var moment=require(_0x0e8c('0x3'));var BPromise=require(_0x0e8c('0x4'));var Mustache=require(_0x0e8c('0x5'));var util=require('util');var path=require(_0x0e8c('0x6'));var sox=require(_0x0e8c('0x7'));var csv=require(_0x0e8c('0x8'));var ejs=require(_0x0e8c('0x9'));var fs=require('fs');var fs_extra=require(_0x0e8c('0xa'));var _=require('lodash');var squel=require(_0x0e8c('0xb'));var crypto=require(_0x0e8c('0xc'));var jsforce=require(_0x0e8c('0xd'));var deskjs=require(_0x0e8c('0xe'));var toCsv=require(_0x0e8c('0x8'));var querystring=require(_0x0e8c('0xf'));var Papa=require(_0x0e8c('0x10'));var Redis=require('ioredis');var authService=require(_0x0e8c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0e8c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e8c('0x13'))(_0x0e8c('0x14'));var utils=require(_0x0e8c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e8c('0x16'));var db=require(_0x0e8c('0x17'))['db'];function respondWithStatusCode(_0x4a86c8,_0x182af1){_0x182af1=_0x182af1||0xcc;return function(_0x138f8b){if(_0x138f8b){return _0x4a86c8[_0x0e8c('0x18')](_0x182af1);}return _0x4a86c8[_0x0e8c('0x19')](_0x182af1)[_0x0e8c('0x1a')]();};}function respondWithResult(_0x312f6b,_0x57d665){_0x57d665=_0x57d665||0xc8;return function(_0x4e7522){if(_0x4e7522){return _0x312f6b['status'](_0x57d665)['json'](_0x4e7522);}};}function respondWithFilteredResult(_0x5bac8f,_0x25dba2){return function(_0x4f7cec){if(_0x4f7cec){var _0x2161f0=typeof _0x25dba2[_0x0e8c('0x1b')]===_0x0e8c('0x1c')&&typeof _0x25dba2['limit']===_0x0e8c('0x1c');var _0x2c6924=_0x4f7cec['count'];var _0x37c5ac=_0x2161f0?0x0:_0x25dba2[_0x0e8c('0x1b')];var _0x22b284=_0x2161f0?_0x4f7cec[_0x0e8c('0x1d')]:_0x25dba2['offset']+_0x25dba2[_0x0e8c('0x1e')];var _0x355307;if(_0x22b284>=_0x2c6924){_0x22b284=_0x2c6924;_0x355307=0xc8;}else{_0x355307=0xce;}_0x5bac8f[_0x0e8c('0x19')](_0x355307);return _0x5bac8f['set'](_0x0e8c('0x1f'),_0x37c5ac+'-'+_0x22b284+'/'+_0x2c6924)['json'](_0x4f7cec);}return null;};}function patchUpdates(_0x1dcf10){return function(_0x43c7f3){try{jsonpatch['apply'](_0x43c7f3,_0x1dcf10,!![]);}catch(_0x39fa3e){return BPromise['reject'](_0x39fa3e);}return _0x43c7f3[_0x0e8c('0x20')]();};}function saveUpdates(_0x4b7f88,_0x58c33f){return function(_0x384a09){if(_0x384a09){return _0x384a09[_0x0e8c('0x21')](_0x4b7f88)[_0x0e8c('0x22')](function(_0x150a98){return _0x150a98;});}return null;};}function removeEntity(_0x326393,_0x42e420){return function(_0xfc0763){if(_0xfc0763){return _0xfc0763[_0x0e8c('0x23')]()[_0x0e8c('0x22')](function(){_0x326393[_0x0e8c('0x19')](0xcc)[_0x0e8c('0x1a')]();});}};}function handleEntityNotFound(_0x177d52,_0x2675b2){return function(_0x7022e5){if(!_0x7022e5){_0x177d52[_0x0e8c('0x18')](0x194);}return _0x7022e5;};}function handleError(_0x2c07dc,_0x15ad5e){_0x15ad5e=_0x15ad5e||0x1f4;return function(_0x1d9253){logger[_0x0e8c('0x24')](_0x1d9253[_0x0e8c('0x25')]);if(_0x1d9253[_0x0e8c('0x26')]){delete _0x1d9253[_0x0e8c('0x26')];}_0x2c07dc[_0x0e8c('0x19')](_0x15ad5e)[_0x0e8c('0x27')](_0x1d9253);};}exports[_0x0e8c('0x28')]=function(_0x121251,_0x54db50){var _0x328fbc={},_0x2184cd={},_0x3dce45={'count':0x0,'rows':[]};var _0x464bf2=_[_0x0e8c('0x29')](db[_0x0e8c('0x2a')]['rawAttributes'],function(_0x33d4d2){return{'name':_0x33d4d2[_0x0e8c('0x2b')],'type':_0x33d4d2[_0x0e8c('0x2c')][_0x0e8c('0x2d')]};});_0x2184cd[_0x0e8c('0x2e')]=_[_0x0e8c('0x29')](_0x464bf2,_0x0e8c('0x26'));_0x2184cd[_0x0e8c('0x2f')]=_[_0x0e8c('0x30')](_0x121251['query']);_0x2184cd[_0x0e8c('0x31')]=_[_0x0e8c('0x32')](_0x2184cd[_0x0e8c('0x2e')],_0x2184cd['query']);_0x328fbc[_0x0e8c('0x33')]=_[_0x0e8c('0x32')](_0x2184cd['model'],qs[_0x0e8c('0x34')](_0x121251[_0x0e8c('0x2f')][_0x0e8c('0x34')]));_0x328fbc[_0x0e8c('0x33')]=_0x328fbc[_0x0e8c('0x33')][_0x0e8c('0x35')]?_0x328fbc[_0x0e8c('0x33')]:_0x2184cd['model'];if(!_0x121251[_0x0e8c('0x2f')]['hasOwnProperty'](_0x0e8c('0x36'))){_0x328fbc['limit']=qs[_0x0e8c('0x1e')](_0x121251['query']['limit']);_0x328fbc[_0x0e8c('0x1b')]=qs[_0x0e8c('0x1b')](_0x121251['query'][_0x0e8c('0x1b')]);}_0x328fbc[_0x0e8c('0x37')]=qs[_0x0e8c('0x38')](_0x121251[_0x0e8c('0x2f')][_0x0e8c('0x38')]);_0x328fbc[_0x0e8c('0x39')]=qs['filters'](_['pick'](_0x121251[_0x0e8c('0x2f')],_0x2184cd['filters']),_0x464bf2);if(_0x121251['query'][_0x0e8c('0x3a')]){_0x328fbc[_0x0e8c('0x39')]=_[_0x0e8c('0x3b')](_0x328fbc[_0x0e8c('0x39')],{'$or':_[_0x0e8c('0x29')](_0x464bf2,function(_0x3225d7){if(_0x3225d7[_0x0e8c('0x2c')]!==_0x0e8c('0x3c')){var _0x145523={};_0x145523[_0x3225d7[_0x0e8c('0x26')]]={'$like':'%'+_0x121251[_0x0e8c('0x2f')][_0x0e8c('0x3a')]+'%'};return _0x145523;}})});}_0x328fbc=_[_0x0e8c('0x3b')]({},_0x328fbc,_0x121251[_0x0e8c('0x3d')]);var _0x32937d={'where':_0x328fbc['where']};return db['VoiceQueuesLog'][_0x0e8c('0x1d')](_0x32937d)['then'](function(_0x252b0f){_0x3dce45[_0x0e8c('0x1d')]=_0x252b0f;if(_0x121251['query'][_0x0e8c('0x3e')]){_0x328fbc[_0x0e8c('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x0e8c('0x40')](_0x328fbc);})[_0x0e8c('0x22')](function(_0x1cf92f){_0x3dce45[_0x0e8c('0x41')]=_0x1cf92f;return _0x3dce45;})[_0x0e8c('0x22')](respondWithFilteredResult(_0x54db50,_0x328fbc))['catch'](handleError(_0x54db50,null));};exports[_0x0e8c('0x42')]=function(_0x3ba07d,_0x549042){var _0x2efe99={'raw':!![],'where':{'id':_0x3ba07d[_0x0e8c('0x43')]['id']}},_0x149c28={};_0x149c28[_0x0e8c('0x2e')]=_['keys'](db[_0x0e8c('0x2a')][_0x0e8c('0x44')]);_0x149c28['query']=_[_0x0e8c('0x30')](_0x3ba07d[_0x0e8c('0x2f')]);_0x149c28[_0x0e8c('0x31')]=_[_0x0e8c('0x32')](_0x149c28[_0x0e8c('0x2e')],_0x149c28[_0x0e8c('0x2f')]);_0x2efe99['attributes']=_[_0x0e8c('0x32')](_0x149c28[_0x0e8c('0x2e')],qs['fields'](_0x3ba07d[_0x0e8c('0x2f')]['fields']));_0x2efe99[_0x0e8c('0x33')]=_0x2efe99[_0x0e8c('0x33')]['length']?_0x2efe99['attributes']:_0x149c28[_0x0e8c('0x2e')];if(_0x3ba07d[_0x0e8c('0x2f')][_0x0e8c('0x3e')]){_0x2efe99[_0x0e8c('0x3f')]=[{'all':!![]}];}_0x2efe99=_[_0x0e8c('0x3b')]({},_0x2efe99,_0x3ba07d['options']);return db[_0x0e8c('0x2a')][_0x0e8c('0x45')](_0x2efe99)[_0x0e8c('0x22')](handleEntityNotFound(_0x549042,null))[_0x0e8c('0x22')](respondWithResult(_0x549042,null))['catch'](handleError(_0x549042,null));};exports[_0x0e8c('0x46')]=function(_0x1a046c,_0x34521a){return db[_0x0e8c('0x2a')][_0x0e8c('0x46')](_0x1a046c[_0x0e8c('0x47')],{})[_0x0e8c('0x22')](respondWithResult(_0x34521a,0xc9))[_0x0e8c('0x48')](handleError(_0x34521a,null));};exports[_0x0e8c('0x21')]=function(_0x35b01e,_0x58ec49){if(_0x35b01e[_0x0e8c('0x47')]['id']){delete _0x35b01e[_0x0e8c('0x47')]['id'];}return db[_0x0e8c('0x2a')][_0x0e8c('0x45')]({'where':{'id':_0x35b01e['params']['id']}})[_0x0e8c('0x22')](handleEntityNotFound(_0x58ec49,null))[_0x0e8c('0x22')](saveUpdates(_0x35b01e[_0x0e8c('0x47')],null))['then'](respondWithResult(_0x58ec49,null))[_0x0e8c('0x48')](handleError(_0x58ec49,null));};exports[_0x0e8c('0x23')]=function(_0x373e48,_0x3ecbd0){return db[_0x0e8c('0x2a')]['find']({'where':{'id':_0x373e48[_0x0e8c('0x43')]['id']}})[_0x0e8c('0x22')](handleEntityNotFound(_0x3ecbd0,null))[_0x0e8c('0x22')](removeEntity(_0x3ecbd0,null))[_0x0e8c('0x48')](handleError(_0x3ecbd0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 1ef7aaf..63d6053 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 _0x2aaa=['define','VoiceQueuesLog','event','dtm','lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x20bee6,_0x36fc3e){var _0x2a6b86=function(_0x2aa511){while(--_0x2aa511){_0x20bee6['push'](_0x20bee6['shift']());}};_0x2a6b86(++_0x36fc3e);}(_0x2aaa,0x1d8));var _0xa2aa=function(_0x1b39eb,_0xe33080){_0x1b39eb=_0x1b39eb-0x0;var _0x4fe80e=_0x2aaa[_0x1b39eb];return _0x4fe80e;};'use strict';var _=require(_0xa2aa('0x0'));var util=require('util');var logger=require(_0xa2aa('0x1'))(_0xa2aa('0x2'));var moment=require(_0xa2aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xa2aa('0x4'));var fs=require('fs');var path=require(_0xa2aa('0x5'));var rimraf=require(_0xa2aa('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0xa2aa('0x7')]=function(_0x1e722e,_0x2c378f){return _0x1e722e[_0xa2aa('0x8')](_0xa2aa('0x9'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xa2aa('0xa'),_0xa2aa('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xac65=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm'];(function(_0x14d1b5,_0x99cfd7){var _0x1ce6e2=function(_0x4be3c1){while(--_0x4be3c1){_0x14d1b5['push'](_0x14d1b5['shift']());}};_0x1ce6e2(++_0x99cfd7);}(_0xac65,0x11d));var _0x5ac6=function(_0x35baed,_0x3c5adb){_0x35baed=_0x35baed-0x0;var _0x4b4a26=_0xac65[_0x35baed];return _0x4b4a26;};'use strict';var _=require(_0x5ac6('0x0'));var util=require(_0x5ac6('0x1'));var logger=require(_0x5ac6('0x2'))('api');var moment=require(_0x5ac6('0x3'));var BPromise=require(_0x5ac6('0x4'));var rp=require(_0x5ac6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ac6('0x6'));var config=require(_0x5ac6('0x7'));var attributes=require(_0x5ac6('0x8'));module['exports']=function(_0x2da747,_0x38711d){return _0x2da747[_0x5ac6('0x9')](_0x5ac6('0xa'),attributes,{'tableName':_0x5ac6('0xb'),'paranoid':![],'indexes':[{'name':_0x5ac6('0xc'),'fields':[_0x5ac6('0xd'),_0x5ac6('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 1345b56..7be051b 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 _0xbe99=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5abcd1,_0x5390e4){var _0x3c1063=function(_0x2850a8){while(--_0x2850a8){_0x5abcd1['push'](_0x5abcd1['shift']());}};_0x3c1063(++_0x5390e4);}(_0xbe99,0x196));var _0x9be9=function(_0x1bd1a7,_0x5025c4){_0x1bd1a7=_0x1bd1a7-0x0;var _0x33a9cc=_0xbe99[_0x1bd1a7];return _0x33a9cc;};'use strict';var _=require(_0x9be9('0x0'));var util=require(_0x9be9('0x1'));var moment=require(_0x9be9('0x2'));var BPromise=require(_0x9be9('0x3'));var rs=require(_0x9be9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9be9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9be9('0x6'))(_0x9be9('0x7'));var config=require(_0x9be9('0x8'));var jayson=require(_0x9be9('0x9'));var client=jayson['client'][_0x9be9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eccd7,_0x4dc53f,_0x49694d){return new BPromise(function(_0x7e0cd,_0x33f952){return client[_0x9be9('0xb')](_0x1eccd7,_0x49694d)[_0x9be9('0xc')](function(_0x178a02){logger[_0x9be9('0xd')](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));logger[_0x9be9('0x10')](_0x9be9('0x11'),_0x4dc53f,_0x9be9('0xf'),JSON[_0x9be9('0x12')](_0x178a02));if(_0x178a02[_0x9be9('0x13')]){if(_0x178a02[_0x9be9('0x13')][_0x9be9('0x14')]===0x1f4){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x33f952(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x178a02['error'][_0x9be9('0x15')]);return _0x7e0cd(_0x178a02[_0x9be9('0x13')][_0x9be9('0x15')]);}else{logger['info'](_0x9be9('0xe'),_0x4dc53f,_0x9be9('0xf'));_0x7e0cd(_0x178a02[_0x9be9('0x16')][_0x9be9('0x15')]);}})[_0x9be9('0x17')](function(_0x5287d9){logger[_0x9be9('0x13')](_0x9be9('0xe'),_0x4dc53f,_0x5287d9);_0x33f952(_0x5287d9);});});} \ No newline at end of file +var _0x6611=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x197e91,_0x414896){var _0x14bcb7=function(_0x2de849){while(--_0x2de849){_0x197e91['push'](_0x197e91['shift']());}};_0x14bcb7(++_0x414896);}(_0x6611,0xdd));var _0x1661=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6611[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x1661('0x0'));var moment=require(_0x1661('0x1'));var BPromise=require(_0x1661('0x2'));var rs=require(_0x1661('0x3'));var fs=require('fs');var Redis=require(_0x1661('0x4'));var db=require(_0x1661('0x5'))['db'];var utils=require(_0x1661('0x6'));var logger=require(_0x1661('0x7'))(_0x1661('0x8'));var config=require(_0x1661('0x9'));var jayson=require(_0x1661('0xa'));var client=jayson[_0x1661('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x516d22,_0x3f32f3,_0x3be60f){return new BPromise(function(_0x57e4b8,_0x49d57a){return client[_0x1661('0xc')](_0x516d22,_0x3be60f)[_0x1661('0xd')](function(_0x28026e){logger[_0x1661('0xe')](_0x1661('0xf'),_0x3f32f3,_0x1661('0x10'));logger[_0x1661('0x11')](_0x1661('0x12'),_0x3f32f3,'request\x20sent',JSON[_0x1661('0x13')](_0x28026e));if(_0x28026e[_0x1661('0x14')]){if(_0x28026e['error'][_0x1661('0x15')]===0x1f4){logger['error'](_0x1661('0xf'),_0x3f32f3,_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);return _0x49d57a(_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);}logger[_0x1661('0x14')](_0x1661('0xf'),_0x3f32f3,_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);return _0x57e4b8(_0x28026e[_0x1661('0x14')][_0x1661('0x16')]);}else{logger[_0x1661('0xe')](_0x1661('0xf'),_0x3f32f3,'request\x20sent');_0x57e4b8(_0x28026e['result'][_0x1661('0x16')]);}})[_0x1661('0x17')](function(_0x55ef62){logger[_0x1661('0x14')](_0x1661('0xf'),_0x3f32f3,_0x55ef62);_0x49d57a(_0x55ef62);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 52233da..7f4c695 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 _0xbab8=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','/:id/downloads','downloadTranscribe','create','post','/:id/transcribe','runTranscribe','update','destroy'];(function(_0x29fd31,_0x5acf19){var _0x2e8e14=function(_0x4fca9c){while(--_0x4fca9c){_0x29fd31['push'](_0x29fd31['shift']());}};_0x2e8e14(++_0x5acf19);}(_0xbab8,0x11f));var _0x8bab=function(_0x27edb1,_0x49b445){_0x27edb1=_0x27edb1-0x0;var _0x2deb9f=_0xbab8[_0x27edb1];return _0x2deb9f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8bab('0x0'));var timeout=require(_0x8bab('0x1'));var express=require(_0x8bab('0x2'));var router=express[_0x8bab('0x3')]();var fs_extra=require(_0x8bab('0x4'));var auth=require(_0x8bab('0x5'));var interaction=require(_0x8bab('0x6'));var config=require(_0x8bab('0x7'));var controller=require(_0x8bab('0x8'));router[_0x8bab('0x9')]('/',auth[_0x8bab('0xa')](),controller[_0x8bab('0xb')]);router[_0x8bab('0x9')](_0x8bab('0xc'),auth[_0x8bab('0xa')](),controller[_0x8bab('0xd')]);router[_0x8bab('0x9')](_0x8bab('0xe'),auth['isAuthenticated'](),controller[_0x8bab('0xf')]);router['get']('/:id/download',auth[_0x8bab('0xa')](),controller[_0x8bab('0x10')]);router[_0x8bab('0x9')](_0x8bab('0x11'),controller['downloads']);router[_0x8bab('0x9')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x8bab('0x12')]);router['post']('/',auth[_0x8bab('0xa')](),controller[_0x8bab('0x13')]);router[_0x8bab('0x14')](_0x8bab('0x15'),auth['isAuthenticated'](),controller[_0x8bab('0x16')]);router['put'](_0x8bab('0xe'),auth[_0x8bab('0xa')](),controller[_0x8bab('0x17')]);router['delete'](_0x8bab('0xe'),auth[_0x8bab('0xa')](),controller[_0x8bab('0x18')]);module[_0x8bab('0x19')]=router; \ No newline at end of file +var _0x0e6e=['downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','update','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','/:id/downloads'];(function(_0x495fe9,_0x1349d3){var _0x2bd94c=function(_0xbd3590){while(--_0xbd3590){_0x495fe9['push'](_0x495fe9['shift']());}};_0x2bd94c(++_0x1349d3);}(_0x0e6e,0x170));var _0xe0e6=function(_0x36dda7,_0x2f5b03){_0x36dda7=_0x36dda7-0x0;var _0x1c1502=_0x0e6e[_0x36dda7];return _0x1c1502;};'use strict';var multer=require(_0xe0e6('0x0'));var util=require(_0xe0e6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe0e6('0x2')]();var fs_extra=require(_0xe0e6('0x3'));var auth=require(_0xe0e6('0x4'));var interaction=require(_0xe0e6('0x5'));var config=require('../../config/environment');var controller=require(_0xe0e6('0x6'));router[_0xe0e6('0x7')]('/',auth[_0xe0e6('0x8')](),controller[_0xe0e6('0x9')]);router[_0xe0e6('0x7')](_0xe0e6('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe0e6('0x7')](_0xe0e6('0xb'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0xc')]);router[_0xe0e6('0x7')](_0xe0e6('0xd'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0xe')]);router['get'](_0xe0e6('0xf'),controller[_0xe0e6('0x10')]);router[_0xe0e6('0x7')](_0xe0e6('0x11'),auth['isAuthenticated'](),controller[_0xe0e6('0x12')]);router[_0xe0e6('0x13')]('/',auth['isAuthenticated'](),controller[_0xe0e6('0x14')]);router[_0xe0e6('0x13')](_0xe0e6('0x11'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0x15')]);router['put'](_0xe0e6('0xb'),auth[_0xe0e6('0x8')](),controller[_0xe0e6('0x16')]);router['delete'](_0xe0e6('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xe0e6('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index f2b74b1..75bb730 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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 05659a7..39189f3 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 _0x0469=['root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','stack','name','send','map','VoiceRecording','rawAttributes','type','differenceBy','format','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','options','rows','catch','show','params','include','create','body','find','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','col','$and','push','secrets','destroy','Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','listBuckets','createBucket','TranscribeService','basename','readFileSync','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText'];(function(_0x10cddc,_0x2a5e3b){var _0xc58788=function(_0x3ff031){while(--_0x3ff031){_0x10cddc['push'](_0x10cddc['shift']());}};_0xc58788(++_0x2a5e3b);}(_0x0469,0x12d));var _0x9046=function(_0x1e9497,_0x3697ab){_0x1e9497=_0x1e9497-0x0;var _0x28bc70=_0x0469[_0x1e9497];return _0x28bc70;};'use strict';var emlformat=require(_0x9046('0x0'));var rimraf=require(_0x9046('0x1'));var zipdir=require(_0x9046('0x2'));var jsonpatch=require(_0x9046('0x3'));var rp=require('request-promise');var moment=require(_0x9046('0x4'));var BPromise=require(_0x9046('0x5'));var Mustache=require(_0x9046('0x6'));var util=require(_0x9046('0x7'));var path=require(_0x9046('0x8'));var sox=require(_0x9046('0x9'));var csv=require(_0x9046('0xa'));var ejs=require(_0x9046('0xb'));var fs=require('fs');var fs_extra=require(_0x9046('0xc'));var _=require(_0x9046('0xd'));var squel=require('squel');var crypto=require(_0x9046('0xe'));var jsforce=require(_0x9046('0xf'));var deskjs=require(_0x9046('0x10'));var toCsv=require(_0x9046('0xa'));var querystring=require(_0x9046('0x11'));var Papa=require('papaparse');var AWS=require(_0x9046('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0x9046('0x13'));var authService=require(_0x9046('0x14'));var qs=require(_0x9046('0x15'));var as=require(_0x9046('0x16'));var hardwareService=require(_0x9046('0x17'));var logger=require(_0x9046('0x18'))(_0x9046('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9046('0x1a'))['db'];function respondWithStatusCode(_0x12cd80,_0x2451b3){_0x2451b3=_0x2451b3||0xcc;return function(_0x41c5cc){if(_0x41c5cc){return _0x12cd80[_0x9046('0x1b')](_0x2451b3);}return _0x12cd80[_0x9046('0x1c')](_0x2451b3)[_0x9046('0x1d')]();};}function respondWithResult(_0x5cd8d9,_0x2131f5){_0x2131f5=_0x2131f5||0xc8;return function(_0x3a94a9){if(_0x3a94a9){return _0x5cd8d9[_0x9046('0x1c')](_0x2131f5)[_0x9046('0x1e')](_0x3a94a9);}};}function respondWithFilteredResult(_0x3133c3,_0x197298){return function(_0x30186f){if(_0x30186f){var _0x329675=typeof _0x197298['offset']===_0x9046('0x1f')&&typeof _0x197298[_0x9046('0x20')]===_0x9046('0x1f');var _0x5365de=_0x30186f['count'];var _0x681c49=_0x329675?0x0:_0x197298[_0x9046('0x21')];var _0x36774d=_0x329675?_0x30186f[_0x9046('0x22')]:_0x197298['offset']+_0x197298['limit'];var _0x587ddb;if(_0x36774d>=_0x5365de){_0x36774d=_0x5365de;_0x587ddb=0xc8;}else{_0x587ddb=0xce;}_0x3133c3[_0x9046('0x1c')](_0x587ddb);return _0x3133c3[_0x9046('0x23')](_0x9046('0x24'),_0x681c49+'-'+_0x36774d+'/'+_0x5365de)['json'](_0x30186f);}return null;};}function patchUpdates(_0x1b5c6c){return function(_0x4de715){try{jsonpatch[_0x9046('0x25')](_0x4de715,_0x1b5c6c,!![]);}catch(_0x5d4b4f){return BPromise[_0x9046('0x26')](_0x5d4b4f);}return _0x4de715['save']();};}function saveUpdates(_0x42a792,_0x3bbf6b){return function(_0x2f8ff6){if(_0x2f8ff6){return _0x2f8ff6[_0x9046('0x27')](_0x42a792)[_0x9046('0x28')](function(_0x2ccd05){return _0x2ccd05;});}return null;};}function removeEntity(_0x175945,_0xc0ba00){return function(_0x27a5f9){if(_0x27a5f9){return _0x27a5f9['destroy']()[_0x9046('0x28')](function(){_0x175945[_0x9046('0x1c')](0xcc)[_0x9046('0x1d')]();});}};}function handleEntityNotFound(_0x369e54,_0x360d16){return function(_0x3fa867){if(!_0x3fa867){_0x369e54[_0x9046('0x1b')](0x194);}return _0x3fa867;};}function handleError(_0x177489,_0x3880cd){_0x3880cd=_0x3880cd||0x1f4;return function(_0x1a273a){logger['error'](_0x1a273a[_0x9046('0x29')]);if(_0x1a273a[_0x9046('0x2a')]){delete _0x1a273a[_0x9046('0x2a')];}_0x177489[_0x9046('0x1c')](_0x3880cd)[_0x9046('0x2b')](_0x1a273a);};}exports['index']=function(_0x4741b5,_0x456293){var _0x1afb69={},_0x20a257={},_0x765764={'count':0x0,'rows':[]};var _0x28ba7f=_[_0x9046('0x2c')](db[_0x9046('0x2d')][_0x9046('0x2e')],function(_0x4e1928){return{'name':_0x4e1928['fieldName'],'type':_0x4e1928[_0x9046('0x2f')]['key']};});_0x20a257['model']=_[_0x9046('0x30')](_['map'](_0x28ba7f,_0x9046('0x2a')),[_0x9046('0x31')]);_0x20a257[_0x9046('0x32')]=_[_0x9046('0x33')](_0x4741b5['query']);_0x20a257['filters']=_[_0x9046('0x34')](_0x20a257['model'],_0x20a257[_0x9046('0x32')]);_0x1afb69[_0x9046('0x35')]=_[_0x9046('0x34')](_0x20a257['model'],qs[_0x9046('0x36')](_0x4741b5[_0x9046('0x32')]['fields']));_0x1afb69['attributes']=_0x1afb69['attributes'][_0x9046('0x37')]?_0x1afb69[_0x9046('0x35')]:_0x20a257[_0x9046('0x38')];if(!_0x4741b5[_0x9046('0x32')][_0x9046('0x39')](_0x9046('0x3a'))){_0x1afb69['limit']=qs[_0x9046('0x20')](_0x4741b5[_0x9046('0x32')][_0x9046('0x20')]);_0x1afb69['offset']=qs[_0x9046('0x21')](_0x4741b5[_0x9046('0x32')][_0x9046('0x21')]);}_0x1afb69[_0x9046('0x3b')]=qs[_0x9046('0x3c')](_0x4741b5[_0x9046('0x32')][_0x9046('0x3c')]);_0x1afb69['where']=qs[_0x9046('0x3d')](_['pick'](_0x4741b5[_0x9046('0x32')],_0x20a257[_0x9046('0x3d')]),_0x28ba7f);if(_0x4741b5[_0x9046('0x32')][_0x9046('0x3e')]){_0x1afb69['where']=_[_0x9046('0x3f')](_0x1afb69[_0x9046('0x40')],{'$or':_[_0x9046('0x2c')](_0x28ba7f,function(_0xd65058){if(_0xd65058[_0x9046('0x2f')]!=='VIRTUAL'){var _0x54d51e={};_0x54d51e[_0xd65058['name']]={'$like':'%'+_0x4741b5[_0x9046('0x32')][_0x9046('0x3e')]+'%'};return _0x54d51e;}})});}_0x1afb69=_[_0x9046('0x3f')]({},_0x1afb69,_0x4741b5[_0x9046('0x41')]);var _0x1bcd3a={'where':_0x1afb69[_0x9046('0x40')]};return db[_0x9046('0x2d')][_0x9046('0x22')](_0x1bcd3a)[_0x9046('0x28')](function(_0x413344){_0x765764['count']=_0x413344;if(_0x4741b5['query']['includeAll']){_0x1afb69['include']=[{'all':!![]}];}return db[_0x9046('0x2d')]['findAll'](_0x1afb69);})[_0x9046('0x28')](function(_0x1bc011){_0x765764[_0x9046('0x42')]=_0x1bc011;return _0x765764;})['then'](respondWithFilteredResult(_0x456293,_0x1afb69))[_0x9046('0x43')](handleError(_0x456293,null));};exports[_0x9046('0x44')]=function(_0x3cc827,_0x38b9aa){var _0x2d9f18={'raw':![],'where':{'id':_0x3cc827[_0x9046('0x45')]['id']}},_0x612e2b={};_0x612e2b[_0x9046('0x38')]=_[_0x9046('0x33')](db[_0x9046('0x2d')][_0x9046('0x2e')]);_0x612e2b[_0x9046('0x32')]=_['keys'](_0x3cc827['query']);_0x612e2b[_0x9046('0x3d')]=_[_0x9046('0x34')](_0x612e2b[_0x9046('0x38')],_0x612e2b[_0x9046('0x32')]);_0x2d9f18['attributes']=_[_0x9046('0x34')](_0x612e2b[_0x9046('0x38')],qs[_0x9046('0x36')](_0x3cc827[_0x9046('0x32')][_0x9046('0x36')]));_0x2d9f18['attributes']=_0x2d9f18[_0x9046('0x35')]['length']?_0x2d9f18[_0x9046('0x35')]:_0x612e2b[_0x9046('0x38')];if(_0x3cc827['query']['includeAll']){_0x2d9f18[_0x9046('0x46')]=[{'all':!![]}];}_0x2d9f18=_[_0x9046('0x3f')]({},_0x2d9f18,_0x3cc827[_0x9046('0x41')]);return db['VoiceRecording']['find'](_0x2d9f18)[_0x9046('0x28')](handleEntityNotFound(_0x38b9aa,null))[_0x9046('0x28')](respondWithResult(_0x38b9aa,null))[_0x9046('0x43')](handleError(_0x38b9aa,null));};exports[_0x9046('0x47')]=function(_0x2ddf57,_0x592fb3){return db[_0x9046('0x2d')]['create'](_0x2ddf57[_0x9046('0x48')],{})[_0x9046('0x28')](respondWithResult(_0x592fb3,0xc9))['catch'](handleError(_0x592fb3,null));};exports[_0x9046('0x27')]=function(_0x3c3117,_0x21df32){if(_0x3c3117[_0x9046('0x48')]['id']){delete _0x3c3117[_0x9046('0x48')]['id'];}return db['VoiceRecording'][_0x9046('0x49')]({'where':{'id':_0x3c3117['params']['id']}})['then'](handleEntityNotFound(_0x21df32,null))[_0x9046('0x28')](saveUpdates(_0x3c3117['body'],null))[_0x9046('0x28')](respondWithResult(_0x21df32,null))[_0x9046('0x43')](handleError(_0x21df32,null));};exports['describe']=function(_0x1311e5,_0x4e4571){return db[_0x9046('0x2d')][_0x9046('0x4a')]()[_0x9046('0x28')](respondWithResult(_0x4e4571,null))['catch'](handleError(_0x4e4571,null));};exports[_0x9046('0x4b')]=function(_0x1524a6,_0x2c27e8,_0x4b66a4){var _0x32b654=require(_0x9046('0x4c'));var _0x519cd5=![];var _0x5b4ecf={};if(_0x1524a6[_0x9046('0x32')][_0x9046('0x2f')]&&_0x1524a6[_0x9046('0x32')][_0x9046('0x2f')]===_0x9046('0x4d')){_0x5b4ecf[_0x9046('0x4d')]=_0x1524a6[_0x9046('0x45')]['id'];}else{_0x5b4ecf['id']=_0x1524a6[_0x9046('0x45')]['id'];}return db[_0x9046('0x2d')][_0x9046('0x49')]({'where':_0x5b4ecf,'attributes':['id','value'],'raw':!![]})[_0x9046('0x28')](handleEntityNotFound(_0x2c27e8,null))[_0x9046('0x28')](function(_0x2b9586){if(_0x2b9586){var _0x5bc260=_0x2b9586[_0x9046('0x4e')];var _0x336d9f=util['format'](_0x9046('0x4f'),_0x5bc260);if(fs[_0x9046('0x50')](_0x336d9f)){_0x519cd5=!![];return _0x32b654[_0x9046('0x51')](_0x336d9f,_0x5bc260,config['secrets'][_0x9046('0x52')])[_0x9046('0x28')](function(){return _0x2b9586;});}return _0x2b9586;}})[_0x9046('0x28')](function(_0x1f8304){if(_0x1f8304){var _0x5b70e0=_0x1f8304[_0x9046('0x4e')];if(!fs[_0x9046('0x50')](_0x5b70e0)){throw new db[(_0x9046('0x53'))][(_0x9046('0x54'))](_0x9046('0x55'));}if(_0x1f8304['filename']){return _0x2c27e8[_0x9046('0x4b')](_0x5b70e0,_0x1f8304[_0x9046('0x56')]+path[_0x9046('0x57')](_0x5b70e0),function(){if(_0x519cd5){fs[_0x9046('0x58')](_0x5b70e0);}});}else{return _0x2c27e8[_0x9046('0x4b')](_0x5b70e0,function(_0x1c082c){if(_0x519cd5){fs[_0x9046('0x58')](_0x5b70e0);}});}}})[_0x9046('0x43')](function(_0x226f09){if(_0x226f09['message']==='VoiceRecording\x20not\x20found'){_0x2c27e8[_0x9046('0x1c')](0x194)[_0x9046('0x2b')](_0x9046('0x59'));}else{return handleError(_0x2c27e8,null);}});};exports[_0x9046('0x5a')]=function(_0x32e54d,_0x402014,_0xce6cce){var _0x13eec8=require(_0x9046('0x4c'));var _0x21da60=![];var _0x5aea22={'$and':[db[_0x9046('0x5b')]['where'](db[_0x9046('0x5b')]['fn'](_0x9046('0x5c'),db['sequelize'][_0x9046('0x5d')]('uniqueid')),_0x32e54d[_0x9046('0x32')]['token'])]};if(_0x32e54d['query'][_0x9046('0x2f')]&&_0x32e54d[_0x9046('0x32')][_0x9046('0x2f')]===_0x9046('0x4d')){_0x5aea22['$and']['push']({'uniqueid':_0x32e54d[_0x9046('0x45')]['id']});}else{_0x5aea22[_0x9046('0x5e')][_0x9046('0x5f')]({'id':_0x32e54d[_0x9046('0x45')]['id']});}return db[_0x9046('0x2d')]['find']({'where':_0x5aea22,'attributes':['id','value'],'raw':!![]})[_0x9046('0x28')](handleEntityNotFound(_0x402014,null))[_0x9046('0x28')](function(_0x5db031){if(_0x5db031){var _0x7d5bb2=util[_0x9046('0x31')](_0x9046('0x4f'),_0x5db031[_0x9046('0x4e')]);if(fs['existsSync'](_0x7d5bb2)){_0x21da60=!![];return _0x13eec8[_0x9046('0x51')](_0x7d5bb2,_0x5db031[_0x9046('0x4e')],config[_0x9046('0x60')][_0x9046('0x52')])['then'](function(){return _0x5db031;});}return _0x5db031;}})[_0x9046('0x28')](function(_0x13460a){if(_0x13460a){if(!fs[_0x9046('0x50')](_0x13460a[_0x9046('0x4e')])){throw new db[(_0x9046('0x53'))][(_0x9046('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x13460a['filename']){return _0x402014[_0x9046('0x4b')](_0x13460a[_0x9046('0x4e')],_0x13460a[_0x9046('0x56')]+path['extname'](_0x13460a[_0x9046('0x4e')]),function(){if(_0x21da60){fs[_0x9046('0x58')](_0x13460a[_0x9046('0x4e')]);}});}else{return _0x402014[_0x9046('0x4b')](_0x13460a[_0x9046('0x4e')],function(_0x43999c){if(_0x21da60){fs[_0x9046('0x58')](_0x13460a[_0x9046('0x4e')]);}});}}})[_0x9046('0x43')](handleError(_0x402014,null));};exports[_0x9046('0x61')]=function(_0x2884ba,_0x5dda6a){return db[_0x9046('0x2d')][_0x9046('0x49')]({'where':{'id':_0x2884ba['params']['id']}})[_0x9046('0x28')](function(_0x51bcde){if(_['isNil'](_0x51bcde)){throw new ReferenceError(_0x9046('0x62'));}return _0x51bcde;})[_0x9046('0x28')](function(_0x4c118e){var _0x42e4bc=_0x4c118e[_0x9046('0x4e')];logger[_0x9046('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x42e4bc);if(!_[_0x9046('0x64')](_0x4c118e[_0x9046('0x4e')])&&fs[_0x9046('0x50')](_0x42e4bc)){logger[_0x9046('0x63')]('File:\x20\x22'+_0x42e4bc+_0x9046('0x65'));fs['unlinkSync'](_0x42e4bc);}_0x42e4bc=_0x42e4bc+_0x9046('0x66');if(!_[_0x9046('0x64')](_0x4c118e[_0x9046('0x4e')])&&fs[_0x9046('0x50')](_0x42e4bc)){logger[_0x9046('0x63')](_0x9046('0x67')+_0x42e4bc+_0x9046('0x65'));fs[_0x9046('0x68')](_0x42e4bc);}return _0x4c118e;})['then'](function(_0x3eed63){if(!_0x3eed63)throw new InternalError();return _0x3eed63[_0x9046('0x61')]();})[_0x9046('0x28')](function(){_0x5dda6a[_0x9046('0x1c')](0xcc)[_0x9046('0x1d')]();})[_0x9046('0x43')](handleError(_0x5dda6a,null));};function getBucketslist(_0x9d9cbd,_0x2596d5,_0x1ccb57){return new Promise(function(_0x10647c,_0x47ea0b){var _0x1c8547=new AWS['S3']({'accessKeyId':_0x2596d5,'secretAccessKey':_0x9d9cbd,'region':_0x1ccb57});_0x1c8547[_0x9046('0x69')]({},function(_0x42b940,_0x4cda93){if(_0x42b940){return _0x47ea0b(_0x42b940);}else{return _0x10647c(_0x4cda93);}});});}function createBucket(_0x45a4fb,_0x1fb89b,_0x5a4434,_0x2aa8f1){return new Promise(function(_0xbfcaaa,_0xd3b63c){var _0x30f8e5=new AWS['S3']({'accessKeyId':_0x1fb89b,'secretAccessKey':_0x45a4fb,'region':_0x5a4434});_0x30f8e5[_0x9046('0x6a')]({'Bucket':_0x2aa8f1},function(_0x1c17f5,_0xf1af44){if(_0x1c17f5){return _0xd3b63c(_0x1c17f5);}else{return _0xbfcaaa(_0xf1af44);}});});}function uploadFile(_0x3ff2c5,_0x3b869f,_0x516bb2,_0x7230e4,_0xddf717,_0x4397de){return new Promise(function(_0x240717,_0x8daa89){var _0x4265be=new AWS['S3']({'accessKeyId':_0x3b869f,'secretAccessKey':_0x3ff2c5,'region':_0x516bb2});_0x4265be['upload']({'Bucket':_0x7230e4,'Key':_0xddf717,'Body':_0x4397de},function(_0x2ac189,_0x2b2724){if(_0x2ac189){return _0x8daa89(_0x2ac189);}else{return _0x240717(_0x2b2724);}});});}function startTranscribe(_0x110514,_0x1629bc,_0x5b41e3,_0x1b0e55,_0x275ca5,_0x3f61f4){return new Promise(function(_0x4a1a8a,_0x493dda){var _0x1ebcb2=new AWS[(_0x9046('0x6b'))]({'accessKeyId':_0x1629bc,'secretAccessKey':_0x110514,'region':_0x5b41e3});_0x1ebcb2['startTranscriptionJob']({'TranscriptionJobName':_0x1b0e55,'LanguageCode':_0x275ca5,'Media':{'MediaFileUri':_0x3f61f4}},function(_0x54a5f3,_0x35fbfe){if(_0x54a5f3){return _0x493dda(_0x54a5f3);}else{return _0x4a1a8a(_0x35fbfe);}});});}function transcribe(_0x422c0e,_0x46dc31,_0x2d7a4c,_0x31ce10,_0x2232ea,_0x29cb17,_0x2bed49){return new Promise(function(_0x7ae33b,_0x490e86){var _0x46b589={};logger[_0x9046('0x63')](util[_0x9046('0x31')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x422c0e,_0x2232ea));return uploadFile(_0x46dc31,_0x2d7a4c,_0x31ce10,_0x2232ea,path[_0x9046('0x6c')](_0x29cb17),fs[_0x9046('0x6d')](_0x29cb17))[_0x9046('0x28')](function(_0x3a1752){logger['info'](util[_0x9046('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x422c0e,_0x2232ea,_0x3a1752['Location']));_0x46b589['bucket']=_0x3a1752[_0x9046('0x6e')];_0x46b589[_0x9046('0x6f')]=_0x3a1752['Location'];logger[_0x9046('0x63')](util[_0x9046('0x31')](_0x9046('0x70'),_0x422c0e));return startTranscribe(_0x46dc31,_0x2d7a4c,_0x31ce10,uuidv4(),_0x2bed49,_0x3a1752[_0x9046('0x71')]);})[_0x9046('0x28')](function(_0x42a25e){logger[_0x9046('0x63')](util['format'](_0x9046('0x72'),_0x422c0e,_0x42a25e[_0x9046('0x73')][_0x9046('0x74')]));_0x46b589[_0x9046('0x75')]=_0x42a25e[_0x9046('0x73')][_0x9046('0x74')];_0x46b589[_0x9046('0x76')]=_0x42a25e[_0x9046('0x73')][_0x9046('0x77')];return _0x7ae33b(_0x46b589);})[_0x9046('0x43')](function(_0x4c0fdd){return _0x490e86(_0x4c0fdd);});});}exports[_0x9046('0x78')]=function(_0x20c750,_0x3c520b,_0x249b52){var _0x31e410;var _0x513735;var _0x1000ce;var _0x5cb28c=require('../../components/encryptor');return db[_0x9046('0x2d')][_0x9046('0x79')]({'where':{'id':_0x20c750[_0x9046('0x45')]['id']}})['then'](function(_0x3b64e1){if(_0x3b64e1){var _0x64dba1=util[_0x9046('0x31')](_0x9046('0x4f'),_0x3b64e1[_0x9046('0x4e')]);if(fs[_0x9046('0x50')](_0x64dba1)){cypher=!![];return _0x5cb28c[_0x9046('0x51')](_0x64dba1,_0x3b64e1[_0x9046('0x4e')],config[_0x9046('0x60')][_0x9046('0x52')])[_0x9046('0x28')](function(){return _0x3b64e1;});}return _0x3b64e1;}})['then'](function(_0xfc1e00){if(!_0xfc1e00){throw new db[(_0x9046('0x53'))][(_0x9046('0x54'))](_0x9046('0x7a'));}_0x513735=_0xfc1e00;return db['Setting'][_0x9046('0x79')]({'where':{'id':0x1}});})[_0x9046('0x28')](handleEntityNotFound(_0x3c520b,null))['then'](function(_0x3c8027){if(_0x3c8027){_0x31e410=_0x3c8027;if(!_0x31e410['transcribe']||!_0x31e410[_0x9046('0x7b')]||!_0x31e410[_0x9046('0x7c')]||!_0x31e410['language']||!_0x31e410[_0x9046('0x7d')]){throw new db[(_0x9046('0x53'))][(_0x9046('0x54'))](_0x9046('0x7e'));}if(_0x20c750[_0x9046('0x48')][_0x9046('0x7f')]&&(!_0x31e410[_0x9046('0x80')]||!_0x31e410[_0x9046('0x81')]||!_0x31e410[_0x9046('0x82')]||!_0x31e410[_0x9046('0x83')]||!_0x31e410['bucket'])){throw new db['Sequelize'][(_0x9046('0x54'))](_0x9046('0x84'));}return db['CloudProvider'][_0x9046('0x79')]({'where':{'id':_0x31e410[_0x9046('0x7b')]}});}})[_0x9046('0x28')](function(_0x5450e8){if(!_0x5450e8){throw new db[(_0x9046('0x53'))][(_0x9046('0x54'))](_0x9046('0x85'));}if(!_0x5450e8[_0x9046('0x86')]||!_0x5450e8[_0x9046('0x87')]){throw new db[(_0x9046('0x53'))][(_0x9046('0x54'))]('Cloud\x20Provider\x20not\x20configured');}_0x1000ce=_0x5450e8;return getBucketslist(_0x1000ce[_0x9046('0x86')],_0x1000ce[_0x9046('0x87')],_0x31e410[_0x9046('0x7c')]);})[_0x9046('0x28')](function(_0x4f799d){if(_0x4f799d&&_0x4f799d['Buckets']){var _0x581282=_[_0x9046('0x49')](_0x4f799d[_0x9046('0x88')],function(_0x1010a6){return _0x1010a6[_0x9046('0x89')]===_0x31e410['bucket'];});if(!_0x581282){logger[_0x9046('0x63')](util[_0x9046('0x31')](_0x9046('0x8a'),_0x20c750[_0x9046('0x45')]['id'],_0x31e410['bucket']));return createBucket(_0x1000ce[_0x9046('0x86')],_0x1000ce['data2'],_0x31e410[_0x9046('0x7c')],_0x31e410[_0x9046('0x7d')]);}logger[_0x9046('0x63')](util[_0x9046('0x31')](_0x9046('0x8b'),_0x20c750['params']['id'],_0x31e410[_0x9046('0x7d')]));return;}})[_0x9046('0x28')](function(_0x16180b){if(_0x513735['transcribeStatus']===_0x9046('0x8c')){return transcribe(_0x20c750['params']['id'],_0x1000ce['data1'],_0x1000ce['data2'],_0x31e410[_0x9046('0x7c')],_0x31e410[_0x9046('0x7d')],_0x513735[_0x9046('0x4e')],_0x31e410[_0x9046('0x83')]);}else{logger[_0x9046('0x63')](util[_0x9046('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x20c750['params']['id']));return{'transcribeStatus':_0x9046('0x8d')};}})[_0x9046('0x28')](function(_0x1795d9){if(_0x1795d9){_0x1795d9[_0x9046('0x8e')]=_0x20c750[_0x9046('0x48')]['runSentiment'];return _0x513735['updateAttributes'](_0x1795d9);}})[_0x9046('0x28')](respondWithResult(_0x3c520b,null))[_0x9046('0x43')](handleError(_0x3c520b,null));};function writeFile(_0x5b7fa0,_0x435aac){return new Promise(function(_0x1bd245,_0xd85462){fs[_0x9046('0x8f')](_0x435aac,_0x5b7fa0,function(_0x4ea785,_0x6124b0){if(_0x4ea785){return _0xd85462(_0x4ea785);}else{return _0x1bd245(_0x6124b0);}});});}exports[_0x9046('0x90')]=function(_0x5b70c,_0x1d796b,_0x9eec62){return db['VoiceRecording']['findOne']({'where':{'id':_0x5b70c[_0x9046('0x45')]['id']}})[_0x9046('0x28')](handleEntityNotFound(_0x1d796b))[_0x9046('0x28')](function(_0x1f29d7){if(_0x1f29d7&&_0x1f29d7[_0x9046('0x91')]){var _0x2cbf15=_0x1f29d7[_0x9046('0x91')];var _0x359836=config[_0x9046('0x92')]+_0x9046('0x93')+_0x1f29d7['id']+'.txt';if(fs[_0x9046('0x50')](_0x359836)){return _0x359836;}return writeFile(_0x2cbf15,_0x359836)[_0x9046('0x28')](function(){return _0x359836;});}else{throw new db[(_0x9046('0x53'))][(_0x9046('0x54'))](_0x9046('0x94'));}})[_0x9046('0x28')](function(_0x2eecc9){return _0x1d796b[_0x9046('0x4b')](_0x2eecc9);})[_0x9046('0x43')](handleError(_0x1d796b));}; \ No newline at end of file +var _0x17bd=['secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Sequelize','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','aws-sdk','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','index','map','VoiceRecording','fieldName','type','model','differenceBy','format','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','findAll','catch','show','params','rawAttributes','options','update','body','find','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0x17bd,0xda));var _0xd17b=function(_0x287254,_0x12f7bb){_0x287254=_0x287254-0x0;var _0xe47e9c=_0x17bd[_0x287254];return _0xe47e9c;};'use strict';var emlformat=require(_0xd17b('0x0'));var rimraf=require(_0xd17b('0x1'));var zipdir=require(_0xd17b('0x2'));var jsonpatch=require(_0xd17b('0x3'));var rp=require(_0xd17b('0x4'));var moment=require(_0xd17b('0x5'));var BPromise=require(_0xd17b('0x6'));var Mustache=require(_0xd17b('0x7'));var util=require(_0xd17b('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd17b('0x9'));var fs=require('fs');var fs_extra=require(_0xd17b('0xa'));var _=require(_0xd17b('0xb'));var squel=require(_0xd17b('0xc'));var crypto=require(_0xd17b('0xd'));var jsforce=require(_0xd17b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd17b('0xf'));var querystring=require(_0xd17b('0x10'));var Papa=require(_0xd17b('0x11'));var AWS=require(_0xd17b('0x12'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xd17b('0x13'));var qs=require(_0xd17b('0x14'));var as=require(_0xd17b('0x15'));var hardwareService=require(_0xd17b('0x16'));var logger=require(_0xd17b('0x17'))(_0xd17b('0x18'));var utils=require(_0xd17b('0x19'));var config=require(_0xd17b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd17b('0x1b'))['db'];function respondWithStatusCode(_0x300a10,_0x40c858){_0x40c858=_0x40c858||0xcc;return function(_0xc87805){if(_0xc87805){return _0x300a10['sendStatus'](_0x40c858);}return _0x300a10[_0xd17b('0x1c')](_0x40c858)[_0xd17b('0x1d')]();};}function respondWithResult(_0x3951f1,_0x547cba){_0x547cba=_0x547cba||0xc8;return function(_0x2ad7aa){if(_0x2ad7aa){return _0x3951f1[_0xd17b('0x1c')](_0x547cba)[_0xd17b('0x1e')](_0x2ad7aa);}};}function respondWithFilteredResult(_0x12114d,_0x3b7ed1){return function(_0x55fe9c){if(_0x55fe9c){var _0x18aeb2=typeof _0x3b7ed1[_0xd17b('0x1f')]===_0xd17b('0x20')&&typeof _0x3b7ed1[_0xd17b('0x21')]===_0xd17b('0x20');var _0x27acff=_0x55fe9c[_0xd17b('0x22')];var _0x31e932=_0x18aeb2?0x0:_0x3b7ed1[_0xd17b('0x1f')];var _0xb385fe=_0x18aeb2?_0x55fe9c[_0xd17b('0x22')]:_0x3b7ed1[_0xd17b('0x1f')]+_0x3b7ed1[_0xd17b('0x21')];var _0x5c4f8e;if(_0xb385fe>=_0x27acff){_0xb385fe=_0x27acff;_0x5c4f8e=0xc8;}else{_0x5c4f8e=0xce;}_0x12114d[_0xd17b('0x1c')](_0x5c4f8e);return _0x12114d[_0xd17b('0x23')](_0xd17b('0x24'),_0x31e932+'-'+_0xb385fe+'/'+_0x27acff)[_0xd17b('0x1e')](_0x55fe9c);}return null;};}function patchUpdates(_0xe0ec76){return function(_0x4a16d6){try{jsonpatch['apply'](_0x4a16d6,_0xe0ec76,!![]);}catch(_0x4c36a4){return BPromise[_0xd17b('0x25')](_0x4c36a4);}return _0x4a16d6[_0xd17b('0x26')]();};}function saveUpdates(_0x4b35dc,_0x4498d2){return function(_0x55bc57){if(_0x55bc57){return _0x55bc57['update'](_0x4b35dc)[_0xd17b('0x27')](function(_0x13706f){return _0x13706f;});}return null;};}function removeEntity(_0xdd02a6,_0x533709){return function(_0x4b276d){if(_0x4b276d){return _0x4b276d[_0xd17b('0x28')]()[_0xd17b('0x27')](function(){_0xdd02a6[_0xd17b('0x1c')](0xcc)[_0xd17b('0x1d')]();});}};}function handleEntityNotFound(_0x517853,_0x4f64d1){return function(_0x25a875){if(!_0x25a875){_0x517853[_0xd17b('0x29')](0x194);}return _0x25a875;};}function handleError(_0x475a03,_0x4bacb7){_0x4bacb7=_0x4bacb7||0x1f4;return function(_0x4b47b8){logger[_0xd17b('0x2a')](_0x4b47b8['stack']);if(_0x4b47b8[_0xd17b('0x2b')]){delete _0x4b47b8['name'];}_0x475a03['status'](_0x4bacb7)[_0xd17b('0x2c')](_0x4b47b8);};}exports[_0xd17b('0x2d')]=function(_0x15b297,_0x186592){var _0x4014b3={},_0x9acfa3={},_0x4de9d1={'count':0x0,'rows':[]};var _0x37edf4=_[_0xd17b('0x2e')](db[_0xd17b('0x2f')]['rawAttributes'],function(_0x246648){return{'name':_0x246648[_0xd17b('0x30')],'type':_0x246648[_0xd17b('0x31')]['key']};});_0x9acfa3[_0xd17b('0x32')]=_[_0xd17b('0x33')](_[_0xd17b('0x2e')](_0x37edf4,_0xd17b('0x2b')),[_0xd17b('0x34')]);_0x9acfa3[_0xd17b('0x35')]=_[_0xd17b('0x36')](_0x15b297[_0xd17b('0x35')]);_0x9acfa3['filters']=_['intersection'](_0x9acfa3[_0xd17b('0x32')],_0x9acfa3['query']);_0x4014b3[_0xd17b('0x37')]=_[_0xd17b('0x38')](_0x9acfa3[_0xd17b('0x32')],qs[_0xd17b('0x39')](_0x15b297[_0xd17b('0x35')][_0xd17b('0x39')]));_0x4014b3[_0xd17b('0x37')]=_0x4014b3[_0xd17b('0x37')]['length']?_0x4014b3[_0xd17b('0x37')]:_0x9acfa3[_0xd17b('0x32')];if(!_0x15b297[_0xd17b('0x35')][_0xd17b('0x3a')](_0xd17b('0x3b'))){_0x4014b3['limit']=qs[_0xd17b('0x21')](_0x15b297[_0xd17b('0x35')][_0xd17b('0x21')]);_0x4014b3[_0xd17b('0x1f')]=qs[_0xd17b('0x1f')](_0x15b297[_0xd17b('0x35')][_0xd17b('0x1f')]);}_0x4014b3['order']=qs['sort'](_0x15b297['query'][_0xd17b('0x3c')]);_0x4014b3[_0xd17b('0x3d')]=qs[_0xd17b('0x3e')](_['pick'](_0x15b297[_0xd17b('0x35')],_0x9acfa3[_0xd17b('0x3e')]),_0x37edf4);if(_0x15b297[_0xd17b('0x35')][_0xd17b('0x3f')]){_0x4014b3[_0xd17b('0x3d')]=_[_0xd17b('0x40')](_0x4014b3[_0xd17b('0x3d')],{'$or':_[_0xd17b('0x2e')](_0x37edf4,function(_0x3dbf67){if(_0x3dbf67[_0xd17b('0x31')]!==_0xd17b('0x41')){var _0x1d3302={};_0x1d3302[_0x3dbf67[_0xd17b('0x2b')]]={'$like':'%'+_0x15b297['query'][_0xd17b('0x3f')]+'%'};return _0x1d3302;}})});}_0x4014b3=_[_0xd17b('0x40')]({},_0x4014b3,_0x15b297['options']);var _0x531057={'where':_0x4014b3[_0xd17b('0x3d')]};return db[_0xd17b('0x2f')][_0xd17b('0x22')](_0x531057)['then'](function(_0x30f53b){_0x4de9d1[_0xd17b('0x22')]=_0x30f53b;if(_0x15b297[_0xd17b('0x35')]['includeAll']){_0x4014b3['include']=[{'all':!![]}];}return db[_0xd17b('0x2f')][_0xd17b('0x42')](_0x4014b3);})['then'](function(_0x5e7b46){_0x4de9d1['rows']=_0x5e7b46;return _0x4de9d1;})['then'](respondWithFilteredResult(_0x186592,_0x4014b3))[_0xd17b('0x43')](handleError(_0x186592,null));};exports[_0xd17b('0x44')]=function(_0xa6a524,_0x309b71){var _0x67b549={'raw':![],'where':{'id':_0xa6a524[_0xd17b('0x45')]['id']}},_0x2e27f5={};_0x2e27f5[_0xd17b('0x32')]=_[_0xd17b('0x36')](db[_0xd17b('0x2f')][_0xd17b('0x46')]);_0x2e27f5[_0xd17b('0x35')]=_[_0xd17b('0x36')](_0xa6a524['query']);_0x2e27f5[_0xd17b('0x3e')]=_[_0xd17b('0x38')](_0x2e27f5['model'],_0x2e27f5[_0xd17b('0x35')]);_0x67b549[_0xd17b('0x37')]=_['intersection'](_0x2e27f5['model'],qs[_0xd17b('0x39')](_0xa6a524['query'][_0xd17b('0x39')]));_0x67b549['attributes']=_0x67b549[_0xd17b('0x37')]['length']?_0x67b549[_0xd17b('0x37')]:_0x2e27f5[_0xd17b('0x32')];if(_0xa6a524['query']['includeAll']){_0x67b549['include']=[{'all':!![]}];}_0x67b549=_[_0xd17b('0x40')]({},_0x67b549,_0xa6a524[_0xd17b('0x47')]);return db['VoiceRecording']['find'](_0x67b549)['then'](handleEntityNotFound(_0x309b71,null))[_0xd17b('0x27')](respondWithResult(_0x309b71,null))[_0xd17b('0x43')](handleError(_0x309b71,null));};exports['create']=function(_0x3ffe83,_0x46165c){return db[_0xd17b('0x2f')]['create'](_0x3ffe83['body'],{})['then'](respondWithResult(_0x46165c,0xc9))[_0xd17b('0x43')](handleError(_0x46165c,null));};exports[_0xd17b('0x48')]=function(_0x1cee13,_0x549a64){if(_0x1cee13[_0xd17b('0x49')]['id']){delete _0x1cee13[_0xd17b('0x49')]['id'];}return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':{'id':_0x1cee13[_0xd17b('0x45')]['id']}})['then'](handleEntityNotFound(_0x549a64,null))['then'](saveUpdates(_0x1cee13['body'],null))[_0xd17b('0x27')](respondWithResult(_0x549a64,null))['catch'](handleError(_0x549a64,null));};exports[_0xd17b('0x4b')]=function(_0x3c069e,_0x306cec){return db[_0xd17b('0x2f')][_0xd17b('0x4b')]()[_0xd17b('0x27')](respondWithResult(_0x306cec,null))['catch'](handleError(_0x306cec,null));};exports[_0xd17b('0x4c')]=function(_0x40b852,_0x242fed,_0x23b763){var _0x50047a=require(_0xd17b('0x4d'));var _0x4597b6=![];var _0x25224e={};if(_0x40b852[_0xd17b('0x35')]['type']&&_0x40b852['query']['type']===_0xd17b('0x4e')){_0x25224e[_0xd17b('0x4e')]=_0x40b852[_0xd17b('0x45')]['id'];}else{_0x25224e['id']=_0x40b852[_0xd17b('0x45')]['id'];}return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':_0x25224e,'attributes':['id',_0xd17b('0x4f')],'raw':!![]})[_0xd17b('0x27')](handleEntityNotFound(_0x242fed,null))['then'](function(_0x2b2bcc){if(_0x2b2bcc){var _0x3153e7=_0x2b2bcc[_0xd17b('0x4f')];var _0x2569d2=util[_0xd17b('0x34')]('%s.cypher',_0x3153e7);if(fs[_0xd17b('0x50')](_0x2569d2)){_0x4597b6=!![];return _0x50047a[_0xd17b('0x51')](_0x2569d2,_0x3153e7,config[_0xd17b('0x52')][_0xd17b('0x53')])[_0xd17b('0x27')](function(){return _0x2b2bcc;});}return _0x2b2bcc;}})[_0xd17b('0x27')](function(_0x130c89){if(_0x130c89){var _0x10f5c6=_0x130c89[_0xd17b('0x4f')];if(!fs[_0xd17b('0x50')](_0x10f5c6)){throw new db['Sequelize'][(_0xd17b('0x54'))](_0xd17b('0x55'));}if(_0x130c89[_0xd17b('0x56')]){return _0x242fed[_0xd17b('0x4c')](_0x10f5c6,_0x130c89[_0xd17b('0x56')]+path[_0xd17b('0x57')](_0x10f5c6),function(){if(_0x4597b6){fs[_0xd17b('0x58')](_0x10f5c6);}});}else{return _0x242fed[_0xd17b('0x4c')](_0x10f5c6,function(_0x2105df){if(_0x4597b6){fs[_0xd17b('0x58')](_0x10f5c6);}});}}})[_0xd17b('0x43')](function(_0xd98fd7){if(_0xd98fd7[_0xd17b('0x59')]===_0xd17b('0x55')){_0x242fed['status'](0x194)[_0xd17b('0x2c')]('Not\x20found');}else{return handleError(_0x242fed,null);}});};exports[_0xd17b('0x5a')]=function(_0x4daa2e,_0x3304ac,_0x602862){var _0x41f1a2=require('../../components/encryptor');var _0x4092db=![];var _0x4953e3={'$and':[db[_0xd17b('0x5b')][_0xd17b('0x3d')](db[_0xd17b('0x5b')]['fn'](_0xd17b('0x5c'),db[_0xd17b('0x5b')]['col'](_0xd17b('0x4e'))),_0x4daa2e[_0xd17b('0x35')]['token'])]};if(_0x4daa2e[_0xd17b('0x35')][_0xd17b('0x31')]&&_0x4daa2e[_0xd17b('0x35')][_0xd17b('0x31')]===_0xd17b('0x4e')){_0x4953e3['$and']['push']({'uniqueid':_0x4daa2e['params']['id']});}else{_0x4953e3[_0xd17b('0x5d')][_0xd17b('0x5e')]({'id':_0x4daa2e[_0xd17b('0x45')]['id']});}return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':_0x4953e3,'attributes':['id',_0xd17b('0x4f')],'raw':!![]})[_0xd17b('0x27')](handleEntityNotFound(_0x3304ac,null))[_0xd17b('0x27')](function(_0x55f0dc){if(_0x55f0dc){var _0x2592bb=util[_0xd17b('0x34')](_0xd17b('0x5f'),_0x55f0dc['value']);if(fs[_0xd17b('0x50')](_0x2592bb)){_0x4092db=!![];return _0x41f1a2['decryptFile'](_0x2592bb,_0x55f0dc['value'],config['secrets']['recording'])[_0xd17b('0x27')](function(){return _0x55f0dc;});}return _0x55f0dc;}})[_0xd17b('0x27')](function(_0x26ba49){if(_0x26ba49){if(!fs[_0xd17b('0x50')](_0x26ba49[_0xd17b('0x4f')])){throw new db['Sequelize'][(_0xd17b('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x26ba49[_0xd17b('0x56')]){return _0x3304ac[_0xd17b('0x4c')](_0x26ba49['value'],_0x26ba49[_0xd17b('0x56')]+path[_0xd17b('0x57')](_0x26ba49[_0xd17b('0x4f')]),function(){if(_0x4092db){fs[_0xd17b('0x58')](_0x26ba49[_0xd17b('0x4f')]);}});}else{return _0x3304ac[_0xd17b('0x4c')](_0x26ba49[_0xd17b('0x4f')],function(_0x496e14){if(_0x4092db){fs[_0xd17b('0x58')](_0x26ba49[_0xd17b('0x4f')]);}});}}})[_0xd17b('0x43')](handleError(_0x3304ac,null));};exports['destroy']=function(_0x42f7f1,_0x4d8877){return db[_0xd17b('0x2f')][_0xd17b('0x4a')]({'where':{'id':_0x42f7f1['params']['id']}})[_0xd17b('0x27')](function(_0x345223){if(_[_0xd17b('0x60')](_0x345223)){throw new ReferenceError(_0xd17b('0x61'));}return _0x345223;})[_0xd17b('0x27')](function(_0x3ff1e7){var _0xdd62bc=_0x3ff1e7[_0xd17b('0x4f')];logger[_0xd17b('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0xdd62bc);if(!_['isNil'](_0x3ff1e7['value'])&&fs['existsSync'](_0xdd62bc)){logger['info'](_0xd17b('0x63')+_0xdd62bc+_0xd17b('0x64'));fs[_0xd17b('0x65')](_0xdd62bc);}_0xdd62bc=_0xdd62bc+_0xd17b('0x66');if(!_['isNil'](_0x3ff1e7[_0xd17b('0x4f')])&&fs['existsSync'](_0xdd62bc)){logger[_0xd17b('0x62')]('File:\x20\x22'+_0xdd62bc+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd17b('0x65')](_0xdd62bc);}return _0x3ff1e7;})[_0xd17b('0x27')](function(_0x2438ba){if(!_0x2438ba)throw new InternalError();return _0x2438ba[_0xd17b('0x28')]();})[_0xd17b('0x27')](function(){_0x4d8877['status'](0xcc)[_0xd17b('0x1d')]();})['catch'](handleError(_0x4d8877,null));};function getBucketslist(_0x12ca7a,_0x401315,_0x333fdd){return new Promise(function(_0x275c21,_0x23d039){var _0x45ed3b=new AWS['S3']({'accessKeyId':_0x401315,'secretAccessKey':_0x12ca7a,'region':_0x333fdd});_0x45ed3b[_0xd17b('0x67')]({},function(_0xe1694,_0x5aaf07){if(_0xe1694){return _0x23d039(_0xe1694);}else{return _0x275c21(_0x5aaf07);}});});}function createBucket(_0x51ac67,_0x3b23fd,_0x579f14,_0x4048bc){return new Promise(function(_0x27dcee,_0x5d2b06){var _0x32af1a=new AWS['S3']({'accessKeyId':_0x3b23fd,'secretAccessKey':_0x51ac67,'region':_0x579f14});_0x32af1a[_0xd17b('0x68')]({'Bucket':_0x4048bc},function(_0x2fbeee,_0x186181){if(_0x2fbeee){return _0x5d2b06(_0x2fbeee);}else{return _0x27dcee(_0x186181);}});});}function uploadFile(_0x66ccf7,_0x3f412c,_0x403277,_0x29f367,_0x42da63,_0x5e171a){return new Promise(function(_0x5b9f22,_0x150cdb){var _0x257656=new AWS['S3']({'accessKeyId':_0x3f412c,'secretAccessKey':_0x66ccf7,'region':_0x403277});_0x257656['upload']({'Bucket':_0x29f367,'Key':_0x42da63,'Body':_0x5e171a},function(_0x1103d1,_0x47b5c4){if(_0x1103d1){return _0x150cdb(_0x1103d1);}else{return _0x5b9f22(_0x47b5c4);}});});}function startTranscribe(_0x50f434,_0x2a84d5,_0x49c30d,_0x272ac0,_0x5124b2,_0x481fd6){return new Promise(function(_0x31e97f,_0x2a7a7f){var _0x390b68=new AWS['TranscribeService']({'accessKeyId':_0x2a84d5,'secretAccessKey':_0x50f434,'region':_0x49c30d});_0x390b68[_0xd17b('0x69')]({'TranscriptionJobName':_0x272ac0,'LanguageCode':_0x5124b2,'Media':{'MediaFileUri':_0x481fd6}},function(_0x53f0d1,_0x5c4be0){if(_0x53f0d1){return _0x2a7a7f(_0x53f0d1);}else{return _0x31e97f(_0x5c4be0);}});});}function transcribe(_0x15574b,_0x3fc92e,_0x227036,_0x4d21c6,_0x221956,_0x28dd50,_0x395f7a){return new Promise(function(_0x453992,_0x3f46f5){var _0xaae8ee={};logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x6a'),_0x15574b,_0x221956));return uploadFile(_0x3fc92e,_0x227036,_0x4d21c6,_0x221956,path['basename'](_0x28dd50),fs[_0xd17b('0x6b')](_0x28dd50))['then'](function(_0x3214f2){logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x6c'),_0x15574b,_0x221956,_0x3214f2[_0xd17b('0x6d')]));_0xaae8ee[_0xd17b('0x6e')]=_0x3214f2[_0xd17b('0x6f')];_0xaae8ee['location']=_0x3214f2[_0xd17b('0x6d')];logger[_0xd17b('0x62')](util['format'](_0xd17b('0x70'),_0x15574b));return startTranscribe(_0x3fc92e,_0x227036,_0x4d21c6,uuidv4(),_0x395f7a,_0x3214f2[_0xd17b('0x6d')]);})[_0xd17b('0x27')](function(_0x2e938d){logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x71'),_0x15574b,_0x2e938d[_0xd17b('0x72')][_0xd17b('0x73')]));_0xaae8ee[_0xd17b('0x74')]=_0x2e938d[_0xd17b('0x72')][_0xd17b('0x73')];_0xaae8ee[_0xd17b('0x75')]=_0x2e938d[_0xd17b('0x72')]['TranscriptionJobStatus'];return _0x453992(_0xaae8ee);})[_0xd17b('0x43')](function(_0x493f40){return _0x3f46f5(_0x493f40);});});}exports[_0xd17b('0x76')]=function(_0x1af444,_0x2050a2,_0x34fb5f){var _0x1d1d3c;var _0xccd027;var _0x43b93e;var _0x3dac4c=require(_0xd17b('0x4d'));return db['VoiceRecording'][_0xd17b('0x77')]({'where':{'id':_0x1af444['params']['id']}})['then'](function(_0x241aa3){if(_0x241aa3){var _0x471eda=util[_0xd17b('0x34')]('%s.cypher',_0x241aa3[_0xd17b('0x4f')]);if(fs[_0xd17b('0x50')](_0x471eda)){cypher=!![];return _0x3dac4c[_0xd17b('0x51')](_0x471eda,_0x241aa3[_0xd17b('0x4f')],config['secrets'][_0xd17b('0x53')])[_0xd17b('0x27')](function(){return _0x241aa3;});}return _0x241aa3;}})[_0xd17b('0x27')](function(_0x576aaa){if(!_0x576aaa){throw new db['Sequelize'][(_0xd17b('0x54'))](_0xd17b('0x78'));}_0xccd027=_0x576aaa;return db[_0xd17b('0x79')][_0xd17b('0x77')]({'where':{'id':0x1}});})[_0xd17b('0x27')](handleEntityNotFound(_0x2050a2,null))[_0xd17b('0x27')](function(_0x9d041d){if(_0x9d041d){_0x1d1d3c=_0x9d041d;if(!_0x1d1d3c[_0xd17b('0x7a')]||!_0x1d1d3c[_0xd17b('0x7b')]||!_0x1d1d3c[_0xd17b('0x7c')]||!_0x1d1d3c[_0xd17b('0x7d')]||!_0x1d1d3c[_0xd17b('0x6e')]){throw new db[(_0xd17b('0x7e'))][(_0xd17b('0x54'))](_0xd17b('0x7f'));}if(_0x1af444[_0xd17b('0x49')]['runSentiment']&&(!_0x1d1d3c[_0xd17b('0x80')]||!_0x1d1d3c[_0xd17b('0x81')]||!_0x1d1d3c[_0xd17b('0x82')]||!_0x1d1d3c[_0xd17b('0x7d')]||!_0x1d1d3c[_0xd17b('0x6e')])){throw new db['Sequelize']['ValidationError'](_0xd17b('0x83'));}return db[_0xd17b('0x84')][_0xd17b('0x77')]({'where':{'id':_0x1d1d3c[_0xd17b('0x7b')]}});}})[_0xd17b('0x27')](function(_0x1c1072){if(!_0x1c1072){throw new db[(_0xd17b('0x7e'))][(_0xd17b('0x54'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1c1072['data1']||!_0x1c1072[_0xd17b('0x85')]){throw new db[(_0xd17b('0x7e'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x43b93e=_0x1c1072;return getBucketslist(_0x43b93e['data1'],_0x43b93e[_0xd17b('0x85')],_0x1d1d3c[_0xd17b('0x7c')]);})[_0xd17b('0x27')](function(_0x43b801){if(_0x43b801&&_0x43b801[_0xd17b('0x86')]){var _0x232776=_[_0xd17b('0x4a')](_0x43b801[_0xd17b('0x86')],function(_0x598e58){return _0x598e58[_0xd17b('0x87')]===_0x1d1d3c[_0xd17b('0x6e')];});if(!_0x232776){logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x88'),_0x1af444[_0xd17b('0x45')]['id'],_0x1d1d3c[_0xd17b('0x6e')]));return createBucket(_0x43b93e[_0xd17b('0x89')],_0x43b93e['data2'],_0x1d1d3c['transcribeRegion'],_0x1d1d3c[_0xd17b('0x6e')]);}logger[_0xd17b('0x62')](util[_0xd17b('0x34')](_0xd17b('0x8a'),_0x1af444['params']['id'],_0x1d1d3c[_0xd17b('0x6e')]));return;}})[_0xd17b('0x27')](function(_0x1720c2){if(_0xccd027[_0xd17b('0x75')]===_0xd17b('0x8b')){return transcribe(_0x1af444[_0xd17b('0x45')]['id'],_0x43b93e[_0xd17b('0x89')],_0x43b93e[_0xd17b('0x85')],_0x1d1d3c[_0xd17b('0x7c')],_0x1d1d3c['bucket'],_0xccd027['value'],_0x1d1d3c['language']);}else{logger['info'](util[_0xd17b('0x34')](_0xd17b('0x8c'),_0x1af444[_0xd17b('0x45')]['id']));return{'transcribeStatus':_0xd17b('0x8d')};}})['then'](function(_0x426095){if(_0x426095){_0x426095[_0xd17b('0x8e')]=_0x1af444['body'][_0xd17b('0x8f')];return _0xccd027['updateAttributes'](_0x426095);}})['then'](respondWithResult(_0x2050a2,null))[_0xd17b('0x43')](handleError(_0x2050a2,null));};function writeFile(_0xf1e1,_0x31bf92){return new Promise(function(_0xf9a2ff,_0x3b9d03){fs[_0xd17b('0x90')](_0x31bf92,_0xf1e1,function(_0x34661b,_0x5e5b20){if(_0x34661b){return _0x3b9d03(_0x34661b);}else{return _0xf9a2ff(_0x5e5b20);}});});}exports[_0xd17b('0x91')]=function(_0x1affab,_0x2091d7,_0x4041a1){return db[_0xd17b('0x2f')]['findOne']({'where':{'id':_0x1affab['params']['id']}})[_0xd17b('0x27')](handleEntityNotFound(_0x2091d7))[_0xd17b('0x27')](function(_0x5dd83e){if(_0x5dd83e&&_0x5dd83e[_0xd17b('0x92')]){var _0x1dfcfd=_0x5dd83e[_0xd17b('0x92')];var _0xd8dcbd=config[_0xd17b('0x93')]+'/server/files/transcribes/transcribe_'+_0x5dd83e['id']+_0xd17b('0x94');if(fs[_0xd17b('0x50')](_0xd8dcbd)){return _0xd8dcbd;}return writeFile(_0x1dfcfd,_0xd8dcbd)[_0xd17b('0x27')](function(){return _0xd8dcbd;});}else{throw new db[(_0xd17b('0x7e'))][(_0xd17b('0x54'))](_0xd17b('0x95'));}})['then'](function(_0x5cdc39){return _0x2091d7[_0xd17b('0x4c')](_0x5cdc39);})[_0xd17b('0x43')](handleError(_0x2091d7));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 6ccbec5..01e3fd2 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 _0x765b=['VoiceRecording','uniqueid','transcribeStatus'];(function(_0xe5c2c0,_0x4edb52){var _0x1c38d7=function(_0x56507f){while(--_0x56507f){_0xe5c2c0['push'](_0xe5c2c0['shift']());}};_0x1c38d7(++_0x4edb52);}(_0x765b,0x18c));var _0xb765=function(_0x5090d4,_0x1950a7){_0x5090d4=_0x5090d4-0x0;var _0x56c310=_0x765b[_0x5090d4];return _0x56c310;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x49c5f5,_0x14e5bd){return _0x49c5f5['define'](_0xb765('0x0'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xb765('0x1'),'fields':[_0xb765('0x1')]},{'name':_0xb765('0x2'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x644a=['transcribeStatus','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid'];(function(_0x770a81,_0x1737bc){var _0x5223ad=function(_0x16c892){while(--_0x16c892){_0x770a81['push'](_0x770a81['shift']());}};_0x5223ad(++_0x1737bc);}(_0x644a,0xfd));var _0xa644=function(_0xfa716b,_0x1fa236){_0xfa716b=_0xfa716b-0x0;var _0xe946ab=_0x644a[_0xfa716b];return _0xe946ab;};'use strict';var attributes=require(_0xa644('0x0'));module[_0xa644('0x1')]=function(_0x32ada1,_0x286d20){return _0x32ada1[_0xa644('0x2')]('VoiceRecording',attributes,{'tableName':_0xa644('0x3'),'paranoid':![],'indexes':[{'name':_0xa644('0x4'),'fields':['uniqueid']},{'name':'transcribeStatus','fields':[_0xa644('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index e623893..231b3c8 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 _0xbbbc=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','error','message','result','catch','UpdateVoiceRecording','update','body','options','raw','where','limit','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','secrets','CreateVoiceRecording\x20file\x20encrypted','stringify'];(function(_0x4d5c36,_0x2250da){var _0x5e74bd=function(_0x276403){while(--_0x276403){_0x4d5c36['push'](_0x4d5c36['shift']());}};_0x5e74bd(++_0x2250da);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x4a33ca,_0x54bf02){_0x4a33ca=_0x4a33ca-0x0;var _0x394f13=_0xbbbc[_0x4a33ca];return _0x394f13;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388197,_0x1796b4,_0x32ec9c){return new BPromise(function(_0x6f4fd8,_0x356249){return client[_0xcbbb('0xc')](_0x388197,_0x32ec9c)[_0xcbbb('0xd')](function(_0x4ec90a){logger[_0xcbbb('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x1796b4,'request\x20sent');logger[_0xcbbb('0xf')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'),JSON['stringify'](_0x4ec90a));if(_0x4ec90a[_0xcbbb('0x11')]){if(_0x4ec90a[_0xcbbb('0x11')]['code']===0x1f4){logger[_0xcbbb('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')]['message']);return _0x356249(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}logger[_0xcbbb('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);return _0x6f4fd8(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'));_0x6f4fd8(_0x4ec90a[_0xcbbb('0x13')][_0xcbbb('0x12')]);}})[_0xcbbb('0x14')](function(_0x5e25ca){logger[_0xcbbb('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x1796b4,_0x5e25ca);_0x356249(_0x5e25ca);});});}exports[_0xcbbb('0x15')]=function(_0x3436af){var _0x3572bb=this;return new Promise(function(_0x5052df,_0x57c5e9){return db['VoiceRecording'][_0xcbbb('0x16')](_0x3436af[_0xcbbb('0x17')],{'raw':_0x3436af[_0xcbbb('0x18')]?_0x3436af[_0xcbbb('0x18')][_0xcbbb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3436af[_0xcbbb('0x18')]?_0x3436af[_0xcbbb('0x18')][_0xcbbb('0x1a')]||null:null,'attributes':_0x3436af[_0xcbbb('0x18')]?_0x3436af[_0xcbbb('0x18')]['attributes']||null:null,'limit':_0x3436af[_0xcbbb('0x18')]?_0x3436af[_0xcbbb('0x18')][_0xcbbb('0x1b')]||null:null})[_0xcbbb('0xd')](function(_0x258d1f){logger[_0xcbbb('0xe')](_0xcbbb('0x15'),_0x3436af);logger[_0xcbbb('0xf')](_0xcbbb('0x15'),_0x3436af,JSON['stringify'](_0x258d1f));_0x5052df(_0x258d1f);})[_0xcbbb('0x14')](function(_0x4490c1){logger['error'](_0xcbbb('0x15'),_0x4490c1['message'],_0x3436af);_0x57c5e9(_0x3572bb['error'](0x1f4,_0x4490c1[_0xcbbb('0x12')]));});});};exports[_0xcbbb('0x1c')]=function(_0x548440){var _0x59c422=this;return new Promise(function(_0x5499a1,_0x4439ea){var _0x55e1d8=require('../../components/encryptor');var _0x21e3b1;return db[_0xcbbb('0x1d')][_0xcbbb('0x1e')]({'attributes':['id',_0xcbbb('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xcbbb('0xd')](function(_0x39ba8b){_0x21e3b1=_0x39ba8b;return db[_0xcbbb('0x20')][_0xcbbb('0x21')](_0x548440[_0xcbbb('0x17')]);})[_0xcbbb('0xd')](function(_0x1c2ac9){if(_0x21e3b1[_0xcbbb('0x1f')]&&fs[_0xcbbb('0x22')](_0x1c2ac9[_0xcbbb('0x23')])){var _0x2a9639=util[_0xcbbb('0x24')](_0xcbbb('0x25'),_0x1c2ac9[_0xcbbb('0x23')]);return _0x55e1d8['encryptFile'](_0x1c2ac9[_0xcbbb('0x23')],_0x2a9639,config[_0xcbbb('0x26')]['recording'])[_0xcbbb('0xd')](function(){fs['unlink'](_0x1c2ac9[_0xcbbb('0x23')]);logger[_0xcbbb('0xe')](_0xcbbb('0x27'));return _0x1c2ac9;});}return _0x1c2ac9;})['then'](function(_0x38ee99){logger[_0xcbbb('0xe')](_0xcbbb('0x1c'),_0x548440);logger[_0xcbbb('0xf')](_0xcbbb('0x1c'),_0x548440,JSON[_0xcbbb('0x28')](_0x38ee99));_0x5499a1(_0x38ee99);})[_0xcbbb('0x14')](function(_0x1ac1a2){logger[_0xcbbb('0x11')](_0xcbbb('0x1c'),_0x1ac1a2['message'],_0x548440);_0x4439ea(_0x59c422['error'](0x1f4,_0x1ac1a2['message']));});});}; \ No newline at end of file +var _0x4975=['catch','VoiceRecording','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','create','value','format','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5a7fbc,_0xa081de){var _0xcba0fc=function(_0x4f083b){while(--_0x4f083b){_0x5a7fbc['push'](_0x5a7fbc['shift']());}};_0xcba0fc(++_0xa081de);}(_0x4975,0x86));var _0x5497=function(_0x24ddec,_0x1afc7f){_0x24ddec=_0x24ddec-0x0;var _0x3caaba=_0x4975[_0x24ddec];return _0x3caaba;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['UpdateVoiceRecording']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')](_0x3f4d20[_0x5497('0x19')],{'raw':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')][_0x5497('0x1c')]||null:null,'attributes':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20[_0x5497('0x1a')]['attributes']||null:null,'limit':_0x3f4d20[_0x5497('0x1a')]?_0x3f4d20['options'][_0x5497('0x1d')]||null:null})[_0x5497('0x1e')](function(_0x44265c){logger[_0x5497('0xd')](_0x5497('0x1f'),_0x3f4d20);logger[_0x5497('0x10')]('UpdateVoiceRecording',_0x3f4d20,JSON['stringify'](_0x44265c));_0x3a47fd(_0x44265c);})[_0x5497('0x16')](function(_0x34b97f){logger[_0x5497('0x13')](_0x5497('0x1f'),_0x34b97f['message'],_0x3f4d20);_0x5d9e24(_0x1bf442[_0x5497('0x13')](0x1f4,_0x34b97f['message']));});});};exports[_0x5497('0x20')]=function(_0x16a2b4){var _0x429d36=this;return new Promise(function(_0x34a1a5,_0x163a30){var _0x31cd01=require('../../components/encryptor');var _0x4af5f4;return db['Setting']['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5497('0x1e')](function(_0x48d146){_0x4af5f4=_0x48d146;return db['VoiceRecording'][_0x5497('0x21')](_0x16a2b4[_0x5497('0x19')]);})[_0x5497('0x1e')](function(_0x4c442a){if(_0x4af5f4['callRecordingEncryption']&&fs['existsSync'](_0x4c442a[_0x5497('0x22')])){var _0x471e0b=util[_0x5497('0x23')]('%s.cypher',_0x4c442a['value']);return _0x31cd01['encryptFile'](_0x4c442a[_0x5497('0x22')],_0x471e0b,config['secrets'][_0x5497('0x24')])[_0x5497('0x1e')](function(){fs[_0x5497('0x25')](_0x4c442a['value']);logger[_0x5497('0xd')](_0x5497('0x26'));return _0x4c442a;});}return _0x4c442a;})['then'](function(_0xce7cb2){logger[_0x5497('0xd')](_0x5497('0x20'),_0x16a2b4);logger['debug'](_0x5497('0x20'),_0x16a2b4,JSON[_0x5497('0x12')](_0xce7cb2));_0x34a1a5(_0xce7cb2);})[_0x5497('0x16')](function(_0x362b96){logger[_0x5497('0x13')]('CreateVoiceRecording',_0x362b96[_0x5497('0x14')],_0x16a2b4);_0x163a30(_0x429d36[_0x5497('0x13')](0x1f4,_0x362b96['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 83806dd..c0a84ff 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 _0x39b8=['update','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x1163a0,_0xfed5f4){var _0x1af53e=function(_0x47b447){while(--_0x47b447){_0x1163a0['push'](_0x1163a0['shift']());}};_0x1af53e(++_0xfed5f4);}(_0x39b8,0x17e));var _0x839b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x39b8[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x839b('0x0'));var path=require(_0x839b('0x1'));var timeout=require(_0x839b('0x2'));var express=require('express');var router=express[_0x839b('0x3')]();var fs_extra=require(_0x839b('0x4'));var auth=require(_0x839b('0x5'));var interaction=require(_0x839b('0x6'));var config=require(_0x839b('0x7'));var controller=require(_0x839b('0x8'));router[_0x839b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x839b('0xa'),auth[_0x839b('0xb')](),controller[_0x839b('0xc')]);router[_0x839b('0x9')](_0x839b('0xd'),auth[_0x839b('0xb')](),controller[_0x839b('0xe')]);router[_0x839b('0xf')]('/',auth[_0x839b('0xb')](),controller[_0x839b('0x10')]);router['put']('/:id',auth[_0x839b('0xb')](),controller[_0x839b('0x11')]);router[_0x839b('0x12')](_0x839b('0xd'),auth[_0x839b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6b5b=['create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0x6b5b,0x1bc));var _0xb6b5=function(_0x230754,_0x68aa94){_0x230754=_0x230754-0x0;var _0x12c3cf=_0x6b5b[_0x230754];return _0x12c3cf;};'use strict';var multer=require(_0xb6b5('0x0'));var util=require(_0xb6b5('0x1'));var path=require(_0xb6b5('0x2'));var timeout=require(_0xb6b5('0x3'));var express=require(_0xb6b5('0x4'));var router=express[_0xb6b5('0x5')]();var fs_extra=require(_0xb6b5('0x6'));var auth=require(_0xb6b5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb6b5('0x8'));var controller=require('./voiceTransferReport.controller');router[_0xb6b5('0x9')]('/',auth[_0xb6b5('0xa')](),controller[_0xb6b5('0xb')]);router[_0xb6b5('0x9')]('/describe',auth[_0xb6b5('0xa')](),controller[_0xb6b5('0xc')]);router[_0xb6b5('0x9')](_0xb6b5('0xd'),auth[_0xb6b5('0xa')](),controller[_0xb6b5('0xe')]);router[_0xb6b5('0xf')]('/',auth[_0xb6b5('0xa')](),controller[_0xb6b5('0x10')]);router[_0xb6b5('0x11')](_0xb6b5('0xd'),auth[_0xb6b5('0xa')](),controller[_0xb6b5('0x12')]);router['delete'](_0xb6b5('0xd'),auth[_0xb6b5('0xa')](),controller['destroy']);module[_0xb6b5('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index e6a0eea..672ce48 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 _0x9be5=['blind','attended','STRING','ENUM','Yes'];(function(_0x164297,_0x7ccc1b){var _0x3ab221=function(_0x5c11fe){while(--_0x5c11fe){_0x164297['push'](_0x164297['shift']());}};_0x3ab221(++_0x7ccc1b);}(_0x9be5,0x168));var _0x59be=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x9be5[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize['ENUM'](_0x59be('0x0'),_0x59be('0x1'))},'result':{'type':Sequelize[_0x59be('0x2')]},'transfererchannel':{'type':Sequelize[_0x59be('0x2')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x59be('0x2')]},'transfererconnectedlinenum':{'type':Sequelize[_0x59be('0x2')]},'transfererconnectedlinename':{'type':Sequelize[_0x59be('0x2')]},'transfereraccountcode':{'type':Sequelize[_0x59be('0x2')]},'transferercontext':{'type':Sequelize[_0x59be('0x2')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x59be('0x2')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x59be('0x2')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x59be('0x2')]},'transfereeconnectedlinename':{'type':Sequelize[_0x59be('0x2')]},'transfereeaccountcode':{'type':Sequelize[_0x59be('0x2')]},'transfereecontext':{'type':Sequelize[_0x59be('0x2')]},'transfereeexten':{'type':Sequelize[_0x59be('0x2')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x59be('0x3')](_0x59be('0x4'),'No')},'context':{'type':Sequelize[_0x59be('0x2')]},'extension':{'type':Sequelize[_0x59be('0x2')]}}; \ No newline at end of file +var _0xd1d1=['moment','exports','ENUM','attended','STRING','Yes','sequelize'];(function(_0x2dfb25,_0x358b90){var _0x5947a6=function(_0x412cf8){while(--_0x412cf8){_0x2dfb25['push'](_0x2dfb25['shift']());}};_0x5947a6(++_0x358b90);}(_0xd1d1,0xbc));var _0x1d1d=function(_0x1a686b,_0x5e26a5){_0x1a686b=_0x1a686b-0x0;var _0x256f01=_0xd1d1[_0x1a686b];return _0x256f01;};'use strict';var Sequelize=require(_0x1d1d('0x0'));var moment=require(_0x1d1d('0x1'));module[_0x1d1d('0x2')]={'type':{'type':Sequelize[_0x1d1d('0x3')]('blind',_0x1d1d('0x4'))},'result':{'type':Sequelize[_0x1d1d('0x5')]},'transfererchannel':{'type':Sequelize[_0x1d1d('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x1d1d('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1d1d('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1d1d('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x1d1d('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x1d1d('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x1d1d('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x1d1d('0x5')]},'transfereechannel':{'type':Sequelize[_0x1d1d('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x1d1d('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x1d1d('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1d1d('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1d1d('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1d1d('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x1d1d('0x5')]},'isexternal':{'type':Sequelize[_0x1d1d('0x3')](_0x1d1d('0x6'),'No')},'context':{'type':Sequelize[_0x1d1d('0x5')]},'extension':{'type':Sequelize[_0x1d1d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index eb519e7..6fb50bb 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 _0xb750=['keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','query'];(function(_0x2b6e32,_0x44356e){var _0x59959f=function(_0x1d96e4){while(--_0x1d96e4){_0x2b6e32['push'](_0x2b6e32['shift']());}};_0x59959f(++_0x44356e);}(_0xb750,0xf5));var _0x0b75=function(_0x24976b,_0x55e81a){_0x24976b=_0x24976b-0x0;var _0x1d7da5=_0xb750[_0x24976b];return _0x1d7da5;};'use strict';var emlformat=require(_0x0b75('0x0'));var rimraf=require(_0x0b75('0x1'));var zipdir=require(_0x0b75('0x2'));var jsonpatch=require(_0x0b75('0x3'));var rp=require(_0x0b75('0x4'));var moment=require(_0x0b75('0x5'));var BPromise=require(_0x0b75('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0b75('0x7'));var sox=require('sox');var csv=require(_0x0b75('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0b75('0x9'));var crypto=require(_0x0b75('0xa'));var jsforce=require(_0x0b75('0xb'));var deskjs=require(_0x0b75('0xc'));var toCsv=require(_0x0b75('0x8'));var querystring=require(_0x0b75('0xd'));var Papa=require(_0x0b75('0xe'));var Redis=require(_0x0b75('0xf'));var authService=require(_0x0b75('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b75('0x11'));var logger=require('../../config/logger')(_0x0b75('0x12'));var utils=require(_0x0b75('0x13'));var config=require(_0x0b75('0x14'));var licenseUtil=require(_0x0b75('0x15'));var db=require(_0x0b75('0x16'))['db'];function respondWithStatusCode(_0x20bf9c,_0x3fda17){_0x3fda17=_0x3fda17||0xcc;return function(_0xc43185){if(_0xc43185){return _0x20bf9c[_0x0b75('0x17')](_0x3fda17);}return _0x20bf9c['status'](_0x3fda17)[_0x0b75('0x18')]();};}function respondWithResult(_0x1f5395,_0x5c4e77){_0x5c4e77=_0x5c4e77||0xc8;return function(_0x5b50bf){if(_0x5b50bf){return _0x1f5395[_0x0b75('0x19')](_0x5c4e77)[_0x0b75('0x1a')](_0x5b50bf);}};}function respondWithFilteredResult(_0x3e4993,_0x4e10b0){return function(_0x2c1156){if(_0x2c1156){var _0x275ce7=typeof _0x4e10b0[_0x0b75('0x1b')]==='undefined'&&typeof _0x4e10b0[_0x0b75('0x1c')]===_0x0b75('0x1d');var _0x49cd23=_0x2c1156[_0x0b75('0x1e')];var _0xe094f6=_0x275ce7?0x0:_0x4e10b0[_0x0b75('0x1b')];var _0x4be220=_0x275ce7?_0x2c1156['count']:_0x4e10b0['offset']+_0x4e10b0['limit'];var _0x40e6ae;if(_0x4be220>=_0x49cd23){_0x4be220=_0x49cd23;_0x40e6ae=0xc8;}else{_0x40e6ae=0xce;}_0x3e4993[_0x0b75('0x19')](_0x40e6ae);return _0x3e4993[_0x0b75('0x1f')](_0x0b75('0x20'),_0xe094f6+'-'+_0x4be220+'/'+_0x49cd23)[_0x0b75('0x1a')](_0x2c1156);}return null;};}function patchUpdates(_0x291bb4){return function(_0x421921){try{jsonpatch['apply'](_0x421921,_0x291bb4,!![]);}catch(_0x275c4f){return BPromise[_0x0b75('0x21')](_0x275c4f);}return _0x421921['save']();};}function saveUpdates(_0x128c44,_0x4fcaff){return function(_0x315820){if(_0x315820){return _0x315820[_0x0b75('0x22')](_0x128c44)[_0x0b75('0x23')](function(_0x379522){return _0x379522;});}return null;};}function removeEntity(_0x5733a0,_0x12c740){return function(_0xfa2317){if(_0xfa2317){return _0xfa2317[_0x0b75('0x24')]()[_0x0b75('0x23')](function(){_0x5733a0[_0x0b75('0x19')](0xcc)[_0x0b75('0x18')]();});}};}function handleEntityNotFound(_0x89ba9c,_0x539de9){return function(_0x12c176){if(!_0x12c176){_0x89ba9c[_0x0b75('0x17')](0x194);}return _0x12c176;};}function handleError(_0x5e3a6d,_0x188707){_0x188707=_0x188707||0x1f4;return function(_0x4b7e9a){logger[_0x0b75('0x25')](_0x4b7e9a['stack']);if(_0x4b7e9a[_0x0b75('0x26')]){delete _0x4b7e9a[_0x0b75('0x26')];}_0x5e3a6d['status'](_0x188707)[_0x0b75('0x27')](_0x4b7e9a);};}exports[_0x0b75('0x28')]=function(_0x33f771,_0x35c8f0){var _0x170007={},_0x3ee9a5={},_0x6049c={'count':0x0,'rows':[]};var _0x369381=_[_0x0b75('0x29')](db[_0x0b75('0x2a')][_0x0b75('0x2b')],function(_0x2cabf7){return{'name':_0x2cabf7[_0x0b75('0x2c')],'type':_0x2cabf7['type'][_0x0b75('0x2d')]};});_0x3ee9a5['model']=_[_0x0b75('0x29')](_0x369381,_0x0b75('0x26'));_0x3ee9a5[_0x0b75('0x2e')]=_[_0x0b75('0x2f')](_0x33f771['query']);_0x3ee9a5['filters']=_['intersection'](_0x3ee9a5[_0x0b75('0x30')],_0x3ee9a5[_0x0b75('0x2e')]);_0x170007[_0x0b75('0x31')]=_[_0x0b75('0x32')](_0x3ee9a5[_0x0b75('0x30')],qs['fields'](_0x33f771[_0x0b75('0x2e')][_0x0b75('0x33')]));_0x170007[_0x0b75('0x31')]=_0x170007[_0x0b75('0x31')][_0x0b75('0x34')]?_0x170007[_0x0b75('0x31')]:_0x3ee9a5[_0x0b75('0x30')];if(!_0x33f771[_0x0b75('0x2e')][_0x0b75('0x35')](_0x0b75('0x36'))){_0x170007[_0x0b75('0x1c')]=qs['limit'](_0x33f771[_0x0b75('0x2e')][_0x0b75('0x1c')]);_0x170007[_0x0b75('0x1b')]=qs[_0x0b75('0x1b')](_0x33f771[_0x0b75('0x2e')][_0x0b75('0x1b')]);}_0x170007[_0x0b75('0x37')]=qs[_0x0b75('0x38')](_0x33f771[_0x0b75('0x2e')][_0x0b75('0x38')]);_0x170007[_0x0b75('0x39')]=qs[_0x0b75('0x3a')](_['pick'](_0x33f771[_0x0b75('0x2e')],_0x3ee9a5['filters']),_0x369381);if(_0x33f771[_0x0b75('0x2e')][_0x0b75('0x3b')]){_0x170007[_0x0b75('0x39')]=_[_0x0b75('0x3c')](_0x170007['where'],{'$or':_[_0x0b75('0x29')](_0x369381,function(_0x5ac80e){if(_0x5ac80e['type']!==_0x0b75('0x3d')){var _0x10d1f1={};_0x10d1f1[_0x5ac80e[_0x0b75('0x26')]]={'$like':'%'+_0x33f771[_0x0b75('0x2e')][_0x0b75('0x3b')]+'%'};return _0x10d1f1;}})});}_0x170007=_['merge']({},_0x170007,_0x33f771[_0x0b75('0x3e')]);var _0x5bf6d7={'where':_0x170007[_0x0b75('0x39')]};return db['VoiceTransferReport'][_0x0b75('0x1e')](_0x5bf6d7)[_0x0b75('0x23')](function(_0x710bd8){_0x6049c['count']=_0x710bd8;if(_0x33f771[_0x0b75('0x2e')]['includeAll']){_0x170007[_0x0b75('0x3f')]=[{'all':!![]}];}return db[_0x0b75('0x2a')][_0x0b75('0x40')](_0x170007);})[_0x0b75('0x23')](function(_0x4ecad7){_0x6049c[_0x0b75('0x41')]=_0x4ecad7;return _0x6049c;})['then'](respondWithFilteredResult(_0x35c8f0,_0x170007))['catch'](handleError(_0x35c8f0,null));};exports['show']=function(_0x3c0859,_0xf98695){var _0x207fc2={'raw':!![],'where':{'id':_0x3c0859[_0x0b75('0x42')]['id']}},_0x203343={};_0x203343['model']=_[_0x0b75('0x2f')](db['VoiceTransferReport'][_0x0b75('0x2b')]);_0x203343[_0x0b75('0x2e')]=_[_0x0b75('0x2f')](_0x3c0859['query']);_0x203343[_0x0b75('0x3a')]=_[_0x0b75('0x32')](_0x203343[_0x0b75('0x30')],_0x203343[_0x0b75('0x2e')]);_0x207fc2[_0x0b75('0x31')]=_['intersection'](_0x203343[_0x0b75('0x30')],qs[_0x0b75('0x33')](_0x3c0859[_0x0b75('0x2e')][_0x0b75('0x33')]));_0x207fc2[_0x0b75('0x31')]=_0x207fc2[_0x0b75('0x31')]['length']?_0x207fc2['attributes']:_0x203343['model'];if(_0x3c0859[_0x0b75('0x2e')][_0x0b75('0x43')]){_0x207fc2[_0x0b75('0x3f')]=[{'all':!![]}];}_0x207fc2=_[_0x0b75('0x3c')]({},_0x207fc2,_0x3c0859[_0x0b75('0x3e')]);return db[_0x0b75('0x2a')][_0x0b75('0x44')](_0x207fc2)[_0x0b75('0x23')](handleEntityNotFound(_0xf98695,null))[_0x0b75('0x23')](respondWithResult(_0xf98695,null))[_0x0b75('0x45')](handleError(_0xf98695,null));};exports['create']=function(_0x530a98,_0x2739e0){return db[_0x0b75('0x2a')][_0x0b75('0x46')](_0x530a98['body'],{})[_0x0b75('0x23')](respondWithResult(_0x2739e0,0xc9))[_0x0b75('0x45')](handleError(_0x2739e0,null));};exports['update']=function(_0x57cfca,_0x40854a){if(_0x57cfca[_0x0b75('0x47')]['id']){delete _0x57cfca[_0x0b75('0x47')]['id'];}return db[_0x0b75('0x2a')]['find']({'where':{'id':_0x57cfca[_0x0b75('0x42')]['id']}})['then'](handleEntityNotFound(_0x40854a,null))['then'](saveUpdates(_0x57cfca[_0x0b75('0x47')],null))[_0x0b75('0x23')](respondWithResult(_0x40854a,null))[_0x0b75('0x45')](handleError(_0x40854a,null));};exports['destroy']=function(_0x50a46e,_0x2cf0da){return db[_0x0b75('0x2a')][_0x0b75('0x44')]({'where':{'id':_0x50a46e['params']['id']}})[_0x0b75('0x23')](handleEntityNotFound(_0x2cf0da,null))[_0x0b75('0x23')](removeEntity(_0x2cf0da,null))[_0x0b75('0x45')](handleError(_0x2cf0da,null));};exports[_0x0b75('0x48')]=function(_0x468a3d,_0x52856f){return db[_0x0b75('0x2a')]['describe']()[_0x0b75('0x23')](respondWithResult(_0x52856f,null))['catch'](handleError(_0x52856f,null));}; \ No newline at end of file +var _0x14e9=['keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x1ee0cc,_0x445f9d){var _0x1e8f71=function(_0x2246bf){while(--_0x2246bf){_0x1ee0cc['push'](_0x1ee0cc['shift']());}};_0x1e8f71(++_0x445f9d);}(_0x14e9,0xfc));var _0x914e=function(_0x41e3e5,_0x441240){_0x41e3e5=_0x41e3e5-0x0;var _0x4b5b5c=_0x14e9[_0x41e3e5];return _0x4b5b5c;};'use strict';var emlformat=require(_0x914e('0x0'));var rimraf=require(_0x914e('0x1'));var zipdir=require(_0x914e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x914e('0x3'));var moment=require(_0x914e('0x4'));var BPromise=require(_0x914e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x914e('0x6'));var sox=require('sox');var csv=require(_0x914e('0x7'));var ejs=require(_0x914e('0x8'));var fs=require('fs');var fs_extra=require(_0x914e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x914e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x914e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x914e('0xc'));var Redis=require(_0x914e('0xd'));var authService=require(_0x914e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x914e('0xf'));var hardwareService=require(_0x914e('0x10'));var logger=require(_0x914e('0x11'))(_0x914e('0x12'));var utils=require(_0x914e('0x13'));var config=require(_0x914e('0x14'));var licenseUtil=require(_0x914e('0x15'));var db=require(_0x914e('0x16'))['db'];function respondWithStatusCode(_0xe0598e,_0x16233f){_0x16233f=_0x16233f||0xcc;return function(_0x192733){if(_0x192733){return _0xe0598e[_0x914e('0x17')](_0x16233f);}return _0xe0598e[_0x914e('0x18')](_0x16233f)[_0x914e('0x19')]();};}function respondWithResult(_0x34db77,_0x500e89){_0x500e89=_0x500e89||0xc8;return function(_0x2e96df){if(_0x2e96df){return _0x34db77[_0x914e('0x18')](_0x500e89)[_0x914e('0x1a')](_0x2e96df);}};}function respondWithFilteredResult(_0x2d1e94,_0x40c815){return function(_0xebc4c9){if(_0xebc4c9){var _0x1efb58=typeof _0x40c815[_0x914e('0x1b')]===_0x914e('0x1c')&&typeof _0x40c815['limit']===_0x914e('0x1c');var _0x4d5bd6=_0xebc4c9[_0x914e('0x1d')];var _0x4c86da=_0x1efb58?0x0:_0x40c815['offset'];var _0x12f9ae=_0x1efb58?_0xebc4c9['count']:_0x40c815[_0x914e('0x1b')]+_0x40c815['limit'];var _0x327260;if(_0x12f9ae>=_0x4d5bd6){_0x12f9ae=_0x4d5bd6;_0x327260=0xc8;}else{_0x327260=0xce;}_0x2d1e94[_0x914e('0x18')](_0x327260);return _0x2d1e94['set'](_0x914e('0x1e'),_0x4c86da+'-'+_0x12f9ae+'/'+_0x4d5bd6)[_0x914e('0x1a')](_0xebc4c9);}return null;};}function patchUpdates(_0xbdba69){return function(_0x1d5cd9){try{jsonpatch['apply'](_0x1d5cd9,_0xbdba69,!![]);}catch(_0x5425eb){return BPromise[_0x914e('0x1f')](_0x5425eb);}return _0x1d5cd9[_0x914e('0x20')]();};}function saveUpdates(_0xcee452,_0x202b6d){return function(_0x4067ac){if(_0x4067ac){return _0x4067ac[_0x914e('0x21')](_0xcee452)['then'](function(_0x1bcecd){return _0x1bcecd;});}return null;};}function removeEntity(_0x3780c6,_0x49ade5){return function(_0x1aa72e){if(_0x1aa72e){return _0x1aa72e[_0x914e('0x22')]()[_0x914e('0x23')](function(){_0x3780c6[_0x914e('0x18')](0xcc)[_0x914e('0x19')]();});}};}function handleEntityNotFound(_0xc09b7e,_0x396d51){return function(_0x2a067f){if(!_0x2a067f){_0xc09b7e[_0x914e('0x17')](0x194);}return _0x2a067f;};}function handleError(_0x4f29fe,_0x44ba78){_0x44ba78=_0x44ba78||0x1f4;return function(_0x214a7e){logger[_0x914e('0x24')](_0x214a7e[_0x914e('0x25')]);if(_0x214a7e[_0x914e('0x26')]){delete _0x214a7e[_0x914e('0x26')];}_0x4f29fe['status'](_0x44ba78)[_0x914e('0x27')](_0x214a7e);};}exports[_0x914e('0x28')]=function(_0x3bb4de,_0x2192b8){var _0x17fe34={},_0x3e6344={},_0x1b08f4={'count':0x0,'rows':[]};var _0xb1d3b9=_['map'](db[_0x914e('0x29')][_0x914e('0x2a')],function(_0xf469a2){return{'name':_0xf469a2[_0x914e('0x2b')],'type':_0xf469a2[_0x914e('0x2c')][_0x914e('0x2d')]};});_0x3e6344[_0x914e('0x2e')]=_['map'](_0xb1d3b9,_0x914e('0x26'));_0x3e6344[_0x914e('0x2f')]=_[_0x914e('0x30')](_0x3bb4de[_0x914e('0x2f')]);_0x3e6344['filters']=_['intersection'](_0x3e6344[_0x914e('0x2e')],_0x3e6344['query']);_0x17fe34[_0x914e('0x31')]=_[_0x914e('0x32')](_0x3e6344[_0x914e('0x2e')],qs[_0x914e('0x33')](_0x3bb4de[_0x914e('0x2f')]['fields']));_0x17fe34[_0x914e('0x31')]=_0x17fe34[_0x914e('0x31')][_0x914e('0x34')]?_0x17fe34['attributes']:_0x3e6344[_0x914e('0x2e')];if(!_0x3bb4de[_0x914e('0x2f')][_0x914e('0x35')](_0x914e('0x36'))){_0x17fe34[_0x914e('0x37')]=qs[_0x914e('0x37')](_0x3bb4de[_0x914e('0x2f')][_0x914e('0x37')]);_0x17fe34[_0x914e('0x1b')]=qs['offset'](_0x3bb4de[_0x914e('0x2f')][_0x914e('0x1b')]);}_0x17fe34['order']=qs[_0x914e('0x38')](_0x3bb4de[_0x914e('0x2f')][_0x914e('0x38')]);_0x17fe34[_0x914e('0x39')]=qs[_0x914e('0x3a')](_[_0x914e('0x3b')](_0x3bb4de[_0x914e('0x2f')],_0x3e6344[_0x914e('0x3a')]),_0xb1d3b9);if(_0x3bb4de[_0x914e('0x2f')][_0x914e('0x3c')]){_0x17fe34[_0x914e('0x39')]=_['merge'](_0x17fe34[_0x914e('0x39')],{'$or':_['map'](_0xb1d3b9,function(_0x3f12bf){if(_0x3f12bf[_0x914e('0x2c')]!==_0x914e('0x3d')){var _0x471212={};_0x471212[_0x3f12bf[_0x914e('0x26')]]={'$like':'%'+_0x3bb4de['query'][_0x914e('0x3c')]+'%'};return _0x471212;}})});}_0x17fe34=_[_0x914e('0x3e')]({},_0x17fe34,_0x3bb4de[_0x914e('0x3f')]);var _0x533420={'where':_0x17fe34[_0x914e('0x39')]};return db[_0x914e('0x29')][_0x914e('0x1d')](_0x533420)[_0x914e('0x23')](function(_0xadd2b7){_0x1b08f4[_0x914e('0x1d')]=_0xadd2b7;if(_0x3bb4de[_0x914e('0x2f')][_0x914e('0x40')]){_0x17fe34[_0x914e('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x914e('0x42')](_0x17fe34);})[_0x914e('0x23')](function(_0x3dcff0){_0x1b08f4[_0x914e('0x43')]=_0x3dcff0;return _0x1b08f4;})[_0x914e('0x23')](respondWithFilteredResult(_0x2192b8,_0x17fe34))[_0x914e('0x44')](handleError(_0x2192b8,null));};exports[_0x914e('0x45')]=function(_0x496cad,_0x59edb0){var _0x2f8ca3={'raw':!![],'where':{'id':_0x496cad[_0x914e('0x46')]['id']}},_0x562b00={};_0x562b00[_0x914e('0x2e')]=_[_0x914e('0x30')](db[_0x914e('0x29')]['rawAttributes']);_0x562b00['query']=_[_0x914e('0x30')](_0x496cad[_0x914e('0x2f')]);_0x562b00[_0x914e('0x3a')]=_['intersection'](_0x562b00['model'],_0x562b00[_0x914e('0x2f')]);_0x2f8ca3['attributes']=_[_0x914e('0x32')](_0x562b00['model'],qs[_0x914e('0x33')](_0x496cad[_0x914e('0x2f')][_0x914e('0x33')]));_0x2f8ca3[_0x914e('0x31')]=_0x2f8ca3[_0x914e('0x31')]['length']?_0x2f8ca3['attributes']:_0x562b00[_0x914e('0x2e')];if(_0x496cad['query'][_0x914e('0x40')]){_0x2f8ca3[_0x914e('0x41')]=[{'all':!![]}];}_0x2f8ca3=_[_0x914e('0x3e')]({},_0x2f8ca3,_0x496cad[_0x914e('0x3f')]);return db[_0x914e('0x29')][_0x914e('0x47')](_0x2f8ca3)[_0x914e('0x23')](handleEntityNotFound(_0x59edb0,null))[_0x914e('0x23')](respondWithResult(_0x59edb0,null))[_0x914e('0x44')](handleError(_0x59edb0,null));};exports['create']=function(_0x4a7b33,_0x3c6c98){return db[_0x914e('0x29')][_0x914e('0x48')](_0x4a7b33[_0x914e('0x49')],{})[_0x914e('0x23')](respondWithResult(_0x3c6c98,0xc9))[_0x914e('0x44')](handleError(_0x3c6c98,null));};exports[_0x914e('0x21')]=function(_0x6e9f11,_0x16368b){if(_0x6e9f11[_0x914e('0x49')]['id']){delete _0x6e9f11['body']['id'];}return db[_0x914e('0x29')][_0x914e('0x47')]({'where':{'id':_0x6e9f11[_0x914e('0x46')]['id']}})['then'](handleEntityNotFound(_0x16368b,null))['then'](saveUpdates(_0x6e9f11[_0x914e('0x49')],null))[_0x914e('0x23')](respondWithResult(_0x16368b,null))[_0x914e('0x44')](handleError(_0x16368b,null));};exports['destroy']=function(_0xb8bff2,_0x1e2840){return db[_0x914e('0x29')][_0x914e('0x47')]({'where':{'id':_0xb8bff2[_0x914e('0x46')]['id']}})[_0x914e('0x23')](handleEntityNotFound(_0x1e2840,null))[_0x914e('0x23')](removeEntity(_0x1e2840,null))[_0x914e('0x44')](handleError(_0x1e2840,null));};exports['describe']=function(_0x59a362,_0x2b3d2e){return db[_0x914e('0x29')][_0x914e('0x4a')]()[_0x914e('0x23')](respondWithResult(_0x2b3d2e,null))[_0x914e('0x44')](handleError(_0x2b3d2e,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 22fb2a2..b9a9a63 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 _0x7c8d=['../../config/environment','exports','define','report_call_transfer','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x340f11,_0x83ea42){var _0x43e813=function(_0x12de30){while(--_0x12de30){_0x340f11['push'](_0x340f11['shift']());}};_0x43e813(++_0x83ea42);}(_0x7c8d,0xb8));var _0xd7c8=function(_0x3b1566,_0x4bfc27){_0x3b1566=_0x3b1566-0x0;var _0x43b4a1=_0x7c8d[_0x3b1566];return _0x43b4a1;};'use strict';var _=require('lodash');var util=require(_0xd7c8('0x0'));var logger=require(_0xd7c8('0x1'))('api');var moment=require(_0xd7c8('0x2'));var BPromise=require('bluebird');var rp=require(_0xd7c8('0x3'));var fs=require('fs');var path=require(_0xd7c8('0x4'));var rimraf=require(_0xd7c8('0x5'));var config=require(_0xd7c8('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0xd7c8('0x7')]=function(_0x5b3592,_0x395af0){return _0x5b3592[_0xd7c8('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xd7c8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75cb=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x75cb,0x103));var _0xb75c=function(_0x5f5dd3,_0x2ce595){_0x5f5dd3=_0x5f5dd3-0x0;var _0x7ec6bf=_0x75cb[_0x5f5dd3];return _0x7ec6bf;};'use strict';var _=require(_0xb75c('0x0'));var util=require(_0xb75c('0x1'));var logger=require(_0xb75c('0x2'))(_0xb75c('0x3'));var moment=require('moment');var BPromise=require(_0xb75c('0x4'));var rp=require(_0xb75c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb75c('0x6'));var config=require(_0xb75c('0x7'));var attributes=require(_0xb75c('0x8'));module[_0xb75c('0x9')]=function(_0x1a9c7c,_0x3e8dda){return _0x1a9c7c[_0xb75c('0xa')](_0xb75c('0xb'),attributes,{'tableName':_0xb75c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 066e44f..1b4d69a 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 _0x9c5b=['error','code','message','VoiceTransferReport,\x20%s,\x20%s','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17e9aa,_0x5cac17){var _0x44972e=function(_0x4522ac){while(--_0x4522ac){_0x17e9aa['push'](_0x17e9aa['shift']());}};_0x44972e(++_0x5cac17);}(_0x9c5b,0x111));var _0xb9c5=function(_0x3bd4a5,_0x2597bd){_0x3bd4a5=_0x3bd4a5-0x0;var _0x41d843=_0x9c5b[_0x3bd4a5];return _0x41d843;};'use strict';var _=require(_0xb9c5('0x0'));var util=require(_0xb9c5('0x1'));var moment=require(_0xb9c5('0x2'));var BPromise=require(_0xb9c5('0x3'));var rs=require(_0xb9c5('0x4'));var fs=require('fs');var Redis=require(_0xb9c5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9c5('0x6'));var logger=require('../../config/logger')(_0xb9c5('0x7'));var config=require(_0xb9c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb9c5('0x9')][_0xb9c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d68d5,_0x582500,_0x5305dd){return new BPromise(function(_0x3baaac,_0x18510c){return client[_0xb9c5('0xb')](_0x4d68d5,_0x5305dd)[_0xb9c5('0xc')](function(_0x8317b2){logger[_0xb9c5('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x582500,_0xb9c5('0xe'));logger['debug'](_0xb9c5('0xf'),_0x582500,_0xb9c5('0xe'),JSON[_0xb9c5('0x10')](_0x8317b2));if(_0x8317b2[_0xb9c5('0x11')]){if(_0x8317b2[_0xb9c5('0x11')][_0xb9c5('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x582500,_0x8317b2[_0xb9c5('0x11')][_0xb9c5('0x13')]);return _0x18510c(_0x8317b2[_0xb9c5('0x11')][_0xb9c5('0x13')]);}logger[_0xb9c5('0x11')](_0xb9c5('0x14'),_0x582500,_0x8317b2[_0xb9c5('0x11')][_0xb9c5('0x13')]);return _0x3baaac(_0x8317b2['error']['message']);}else{logger[_0xb9c5('0xd')](_0xb9c5('0x14'),_0x582500,_0xb9c5('0xe'));_0x3baaac(_0x8317b2[_0xb9c5('0x15')][_0xb9c5('0x13')]);}})[_0xb9c5('0x16')](function(_0x426c95){logger[_0xb9c5('0x11')](_0xb9c5('0x14'),_0x582500,_0x426c95);_0x18510c(_0x426c95);});});}exports[_0xb9c5('0x17')]=function(_0x585249){var _0x9499c7=this;return new Promise(function(_0x223ee7,_0x83489){return db[_0xb9c5('0x18')]['create'](_0x585249[_0xb9c5('0x19')],{'raw':_0x585249['options']?_0x585249[_0xb9c5('0x1a')][_0xb9c5('0x1b')]===undefined?!![]:![]:!![]})[_0xb9c5('0xc')](function(_0x208574){logger[_0xb9c5('0xd')]('CreateVoiceTransferReport',_0x585249);logger[_0xb9c5('0x1c')](_0xb9c5('0x17'),_0x585249,JSON[_0xb9c5('0x10')](_0x208574));_0x223ee7(_0x208574);})[_0xb9c5('0x16')](function(_0x406730){logger[_0xb9c5('0x11')](_0xb9c5('0x17'),_0x406730[_0xb9c5('0x13')],_0x585249);_0x83489(_0x9499c7[_0xb9c5('0x11')](0x1f4,_0x406730[_0xb9c5('0x13')]));});});}; \ No newline at end of file +var _0x40fc=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceTransferReport','create','options','debug','CreateVoiceTransferReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x54fc74,_0x53bf32){var _0x4b7a5d=function(_0x262b7d){while(--_0x262b7d){_0x54fc74['push'](_0x54fc74['shift']());}};_0x4b7a5d(++_0x53bf32);}(_0x40fc,0xe5));var _0xc40f=function(_0x239786,_0x471f27){_0x239786=_0x239786-0x0;var _0x3f15e2=_0x40fc[_0x239786];return _0x3f15e2;};'use strict';var _=require('lodash');var util=require(_0xc40f('0x0'));var moment=require(_0xc40f('0x1'));var BPromise=require('bluebird');var rs=require(_0xc40f('0x2'));var fs=require('fs');var Redis=require(_0xc40f('0x3'));var db=require(_0xc40f('0x4'))['db'];var utils=require(_0xc40f('0x5'));var logger=require(_0xc40f('0x6'))(_0xc40f('0x7'));var config=require(_0xc40f('0x8'));var jayson=require(_0xc40f('0x9'));var client=jayson[_0xc40f('0xa')][_0xc40f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b7b24,_0x2b36cd,_0x49e5ca){return new BPromise(function(_0x3e85ad,_0x2655c2){return client[_0xc40f('0xc')](_0x4b7b24,_0x49e5ca)['then'](function(_0x2b8ed2){logger[_0xc40f('0xd')](_0xc40f('0xe'),_0x2b36cd,_0xc40f('0xf'));logger['debug'](_0xc40f('0x10'),_0x2b36cd,_0xc40f('0xf'),JSON[_0xc40f('0x11')](_0x2b8ed2));if(_0x2b8ed2[_0xc40f('0x12')]){if(_0x2b8ed2[_0xc40f('0x12')]['code']===0x1f4){logger[_0xc40f('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x2b36cd,_0x2b8ed2[_0xc40f('0x12')]['message']);return _0x2655c2(_0x2b8ed2['error'][_0xc40f('0x13')]);}logger[_0xc40f('0x12')](_0xc40f('0xe'),_0x2b36cd,_0x2b8ed2[_0xc40f('0x12')][_0xc40f('0x13')]);return _0x3e85ad(_0x2b8ed2[_0xc40f('0x12')][_0xc40f('0x13')]);}else{logger[_0xc40f('0xd')](_0xc40f('0xe'),_0x2b36cd,'request\x20sent');_0x3e85ad(_0x2b8ed2[_0xc40f('0x14')][_0xc40f('0x13')]);}})[_0xc40f('0x15')](function(_0x3c2e69){logger['error'](_0xc40f('0xe'),_0x2b36cd,_0x3c2e69);_0x2655c2(_0x3c2e69);});});}exports['CreateVoiceTransferReport']=function(_0x230c4c){var _0x37d551=this;return new Promise(function(_0x31737f,_0x20be11){return db[_0xc40f('0x16')][_0xc40f('0x17')](_0x230c4c['body'],{'raw':_0x230c4c[_0xc40f('0x18')]?_0x230c4c[_0xc40f('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x857169){logger[_0xc40f('0xd')]('CreateVoiceTransferReport',_0x230c4c);logger[_0xc40f('0x19')]('CreateVoiceTransferReport',_0x230c4c,JSON[_0xc40f('0x11')](_0x857169));_0x31737f(_0x857169);})[_0xc40f('0x15')](function(_0x575fab){logger['error'](_0xc40f('0x1a'),_0x575fab[_0xc40f('0x13')],_0x230c4c);_0x20be11(_0x37d551[_0xc40f('0x12')](0x1f4,_0x575fab['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ca734dd..ee0ba7a 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 _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0xcdccfe,_0x3eb855){var _0x2d6d89=function(_0x3f3076){while(--_0x3f3076){_0xcdccfe['push'](_0xcdccfe['shift']());}};_0x2d6d89(++_0x3eb855);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file +var _0xedd9=['unhold','/calls','calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','answer','/hold','/unhold'];(function(_0x5c5f2a,_0x324c91){var _0x3e9f1a=function(_0x3788f6){while(--_0x3788f6){_0x5c5f2a['push'](_0x5c5f2a['shift']());}};_0x3e9f1a(++_0x324c91);}(_0xedd9,0xfc));var _0x9edd=function(_0x1ddcd0,_0x35557d){_0x1ddcd0=_0x1ddcd0-0x0;var _0x23f108=_0xedd9[_0x1ddcd0];return _0x23f108;};'use strict';var express=require('express');var router=express[_0x9edd('0x0')]();var auth=require(_0x9edd('0x1'));var controller=require(_0x9edd('0x2'));router[_0x9edd('0x3')](_0x9edd('0x4'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x7')]);router['post'](_0x9edd('0x8'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x9')]);router['post'](_0x9edd('0xa'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xb')]);router[_0x9edd('0x3')](_0x9edd('0xc'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller['hold']);router[_0x9edd('0x3')](_0x9edd('0xd'),auth['isAuthenticated'](),auth[_0x9edd('0x6')](),controller[_0x9edd('0xe')]);router['post'](_0x9edd('0xf'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x3')](_0x9edd('0x11'),auth[_0x9edd('0x5')](),auth[_0x9edd('0x6')](),controller['transfer']);module[_0x9edd('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index bc290b4..bf3a59e 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 _0xb2b3=['rows','sessionId','\x20not\x20found!','originate','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','all','UserId','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','name','status','send','NotFound','request','then','code','message','catch','User','findOne','agent','filter'];(function(_0x714e4e,_0x220d25){var _0x10552a=function(_0xffcb35){while(--_0xffcb35){_0x714e4e['push'](_0x714e4e['shift']());}};_0x10552a(++_0x220d25);}(_0xb2b3,0x71));var _0x3b2b=function(_0x27d5a3,_0x37678a){_0x27d5a3=_0x27d5a3-0x0;var _0x50c297=_0xb2b3[_0x27d5a3];return _0x50c297;};'use strict';var path=require(_0x3b2b('0x0'));var fs=require('fs');var _=require(_0x3b2b('0x1'));var db=require(_0x3b2b('0x2'))['db'];var config=require(_0x3b2b('0x3'));var util=require(_0x3b2b('0x4'));var BPromise=require(_0x3b2b('0x5'));var jayson=require(_0x3b2b('0x6'));var amiClient=jayson['client'][_0x3b2b('0x7')]({'port':0x232a});var logger=require(_0x3b2b('0x8'))(_0x3b2b('0x9'));var Redis=require(_0x3b2b('0xa'));config[_0x3b2b('0xb')]=_[_0x3b2b('0xc')](config[_0x3b2b('0xb')],{'host':_0x3b2b('0xd'),'port':0x18eb});var io=require(_0x3b2b('0xe'))(new Redis(config[_0x3b2b('0xb')]));var Schema=require(_0x3b2b('0xf'));var originateValidation=new Schema({'userId':{'type':_0x3b2b('0x10'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x3b2b('0x11'),'required':[!![],_0x3b2b('0x12')]},'callerId':{'type':_0x3b2b('0x11')},'callbackUrl':{'type':_0x3b2b('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x3b2b('0x10'),'required':[!![],_0x3b2b('0x13')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3b2b('0x13')]},'sessionId':{'type':_0x3b2b('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x3b2b('0x10'),'required':[!![],_0x3b2b('0x13')]},'sessionId':{'type':'string','required':[!![],_0x3b2b('0x14')]},'transferNumber':{'type':_0x3b2b('0x11'),'required':[!![],_0x3b2b('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0x3b2b('0x10'),'required':[!![],_0x3b2b('0x13')]},'sessionId':{'type':_0x3b2b('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3b2b('0x13')]},'sessionId':{'type':_0x3b2b('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x3b2b('0x13')]}});var conferenceValidation=new Schema({'userId':{'type':_0x3b2b('0x10'),'required':[!![],_0x3b2b('0x13')]}});function emit(_0x5593e4,_0x2ab175,_0x4d17c5){logger[_0x3b2b('0x16')](_0x5593e4,_0x2ab175,JSON[_0x3b2b('0x17')](_0x4d17c5));io['to'](_0x5593e4)['emit'](_0x2ab175,_0x4d17c5);}function handleError(_0x4a04e4){return function(_0x1a3bfb){console['log'](_0x3b2b('0x18'),_0x1a3bfb,_0x1a3bfb instanceof RangeError);logger[_0x3b2b('0x19')](_0x1a3bfb['stack']);if(_0x1a3bfb instanceof RangeError){if(_0x1a3bfb[_0x3b2b('0x1a')]){delete _0x1a3bfb['name'];}_0x4a04e4[_0x3b2b('0x1b')](0x194)[_0x3b2b('0x1c')](_0x1a3bfb);}else{if(_0x1a3bfb['name']){delete _0x1a3bfb['name'];}_0x4a04e4[_0x3b2b('0x1b')](0x1f4)[_0x3b2b('0x1c')](_0x1a3bfb);}};}function checkError(){return function(_0x21479e){if(!_0x21479e){throw new RangeError(_0x3b2b('0x1d'));}return _0x21479e;};}function respondWithRpcPromise(_0x3ad0b1,_0x330cd2){return new BPromise(function(_0x14a181,_0xc5b0bf){var _0x1273e7=amiClient;return _0x1273e7[_0x3b2b('0x1e')](_0x3ad0b1,_0x330cd2)[_0x3b2b('0x1f')](function(_0x4d5f70){if(_0x4d5f70[_0x3b2b('0x19')]){if(_0x4d5f70[_0x3b2b('0x19')][_0x3b2b('0x20')]===0x1f4){return _0xc5b0bf(_0x4d5f70['error'][_0x3b2b('0x21')]);}return _0x14a181(_0x4d5f70['error'][_0x3b2b('0x21')]);}else{_0x14a181(_0x4d5f70['result']);}})[_0x3b2b('0x22')](function(_0x5df93e){_0xc5b0bf(_0x5df93e);});});}function getAgent(_0x52da06){return db[_0x3b2b('0x23')][_0x3b2b('0x24')]({'where':{'id':_0x52da06,'role':_0x3b2b('0x25')}})[_0x3b2b('0x1f')](checkError());}function getAgentCheckSession(_0x73967,_0x156a3c){return new BPromise(function(_0x30574a,_0x185830){var _0x3c603a=respondWithRpcPromise('VoiceChannels');var _0x4ed952=getAgent(_0x73967);Promise['all']([_0x3c603a,_0x4ed952])['then'](function(_0x3e2177){var _0x2e4bc7=_0x3e2177[0x0];var _0x3a1ff8=_0x3e2177[0x1];var _0x4656df=_[_0x3b2b('0x26')](_0x2e4bc7[_0x3b2b('0x27')],function(_0x3acb5b){return _0x3acb5b['UserId']==_0x3a1ff8['id']&&_0x3acb5b[_0x3b2b('0x28')]==_0x156a3c;});if(_0x4656df['length']==0x1){_0x30574a(_0x3a1ff8);}else{_0x185830(new RangeError('sessionId\x20'+_0x156a3c+_0x3b2b('0x29')));}});});}exports[_0x3b2b('0x2a')]=function(_0x281f1a,_0x107285){logger['info']('originate\x20fired:',_0x281f1a[_0x3b2b('0x2b')]);var _0x3a7b4b=originateValidation[_0x3b2b('0xf')](_0x281f1a[_0x3b2b('0x2b')]);if(_0x3a7b4b[_0x3b2b('0x2c')]>0x0){return _0x107285['status'](0x190)[_0x3b2b('0x2d')](_0x3a7b4b);}var _0x5dde72=_0x281f1a[_0x3b2b('0x2b')][_0x3b2b('0x2e')];var _0x134e84=_0x281f1a[_0x3b2b('0x2b')][_0x3b2b('0x2f')];var _0x3fd26f=_0x281f1a[_0x3b2b('0x2b')][_0x3b2b('0x30')];var _0x5aa5e6=_0x281f1a['body'][_0x3b2b('0x31')];return getAgent(_0x5dde72)['then'](function(_0x186e39){logger[_0x3b2b('0x16')](_0x3b2b('0x32'),_0x186e39[_0x3b2b('0x1a')]);emit(util[_0x3b2b('0x33')](_0x3b2b('0x34'),_0x186e39[_0x3b2b('0x1a')]),_0x3b2b('0x35'),{'callNumber':_0x134e84,'callerId':_0x3fd26f,'callbackUrl':_0x5aa5e6});return _0x107285[_0x3b2b('0x1b')](0xc8)[_0x3b2b('0x2d')]({'error':![],'message':'originate\x20executed!'});})[_0x3b2b('0x22')](handleError(_0x107285));};exports[_0x3b2b('0x36')]=function(_0x423421,_0x41a6f1){logger[_0x3b2b('0x16')](_0x3b2b('0x37'),_0x423421[_0x3b2b('0x2b')]);var _0x3f38a7=hangupValidation[_0x3b2b('0xf')](_0x423421[_0x3b2b('0x2b')]);if(_0x3f38a7[_0x3b2b('0x2c')]>0x0){return _0x41a6f1[_0x3b2b('0x1b')](0x190)[_0x3b2b('0x2d')](_0x3f38a7);}var _0x2a06c4=_0x423421['body'][_0x3b2b('0x2e')];var _0x3abf66=_0x423421[_0x3b2b('0x2b')][_0x3b2b('0x28')];return getAgent(_0x2a06c4)[_0x3b2b('0x1f')](function(_0x25d693){logger[_0x3b2b('0x16')]('entityFound:',_0x25d693['name']);emit(util[_0x3b2b('0x33')]('user:%s',_0x25d693[_0x3b2b('0x1a')]),_0x3b2b('0x38'),{'sessionId':_0x3abf66});return _0x41a6f1[_0x3b2b('0x1b')](0xc8)[_0x3b2b('0x2d')]({'error':![],'message':_0x3b2b('0x39')});})[_0x3b2b('0x22')](handleError(_0x41a6f1));};exports[_0x3b2b('0x3a')]=function(_0x18de93,_0x580177){logger['info']('answer\x20fired:',_0x18de93[_0x3b2b('0x2b')]);var _0x3dd5c8=answerValidation[_0x3b2b('0xf')](_0x18de93[_0x3b2b('0x2b')]);if(_0x3dd5c8[_0x3b2b('0x2c')]>0x0){return _0x580177[_0x3b2b('0x1b')](0x190)['json'](_0x3dd5c8);}var _0x26064c=_0x18de93['body'][_0x3b2b('0x2e')];var _0xece0c7=_0x18de93[_0x3b2b('0x2b')][_0x3b2b('0x28')];return getAgent(_0x26064c)[_0x3b2b('0x1f')](function(_0x4832c9){logger[_0x3b2b('0x16')]('entityFound:',_0x4832c9[_0x3b2b('0x1a')]);emit(util['format'](_0x3b2b('0x34'),_0x4832c9[_0x3b2b('0x1a')]),_0x3b2b('0x3b'),{'sessionId':_0xece0c7});return _0x580177[_0x3b2b('0x1b')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x3b2b('0x22')](handleError(_0x580177));};exports['hold']=function(_0x39c8dc,_0x1eb25e){logger['info'](_0x3b2b('0x3c'),_0x39c8dc['body']);var _0x3db4a4=holdValidation[_0x3b2b('0xf')](_0x39c8dc[_0x3b2b('0x2b')]);if(_0x3db4a4[_0x3b2b('0x2c')]>0x0){return _0x1eb25e[_0x3b2b('0x1b')](0x190)['json'](_0x3db4a4);}var _0x533b74=_0x39c8dc[_0x3b2b('0x2b')][_0x3b2b('0x2e')];var _0x4d73b9=_0x39c8dc[_0x3b2b('0x2b')][_0x3b2b('0x28')];return getAgent(_0x533b74)[_0x3b2b('0x1f')](function(_0x25a6d1){logger[_0x3b2b('0x16')](_0x3b2b('0x32'),_0x25a6d1[_0x3b2b('0x1a')]);emit(util[_0x3b2b('0x33')](_0x3b2b('0x34'),_0x25a6d1[_0x3b2b('0x1a')]),_0x3b2b('0x3d'),{'sessionId':_0x4d73b9});return _0x1eb25e[_0x3b2b('0x1b')](0xc8)[_0x3b2b('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0x3b2b('0x22')](handleError(_0x1eb25e));};exports[_0x3b2b('0x3e')]=function(_0x4c46db,_0xc6d4c7){logger[_0x3b2b('0x16')](_0x3b2b('0x3f'),_0x4c46db[_0x3b2b('0x2b')]);var _0x595b5b=unholdValidation[_0x3b2b('0xf')](_0x4c46db[_0x3b2b('0x2b')]);if(_0x595b5b[_0x3b2b('0x2c')]>0x0){return _0xc6d4c7[_0x3b2b('0x1b')](0x190)[_0x3b2b('0x2d')](_0x595b5b);}var _0x200b5d=_0x4c46db[_0x3b2b('0x2b')][_0x3b2b('0x2e')];var _0x196404=_0x4c46db[_0x3b2b('0x2b')][_0x3b2b('0x28')];return getAgent(_0x200b5d)[_0x3b2b('0x1f')](function(_0x2d72de){logger['info'](_0x3b2b('0x32'),_0x2d72de[_0x3b2b('0x1a')]);emit(util['format'](_0x3b2b('0x34'),_0x2d72de[_0x3b2b('0x1a')]),_0x3b2b('0x40'),{'sessionId':_0x196404});return _0xc6d4c7[_0x3b2b('0x1b')](0xc8)[_0x3b2b('0x2d')]({'error':![],'message':_0x3b2b('0x41')});})['catch'](handleError(_0xc6d4c7));};exports['calls']=function(_0x3210ae,_0x3582db){logger[_0x3b2b('0x16')]('calls\x20fired:',_0x3582db[_0x3b2b('0x2b')]);var _0x187d6f=callsValidation[_0x3b2b('0xf')](_0x3210ae[_0x3b2b('0x2b')]);if(_0x187d6f['length']>0x0){return _0x3582db[_0x3b2b('0x1b')](0x190)[_0x3b2b('0x2d')](_0x187d6f);}var _0x725269=_0x3210ae[_0x3b2b('0x2b')][_0x3b2b('0x2e')];var _0x3de4ad=respondWithRpcPromise('VoiceChannels');var _0x9ec07f=getAgent(_0x725269);return Promise[_0x3b2b('0x42')]([_0x3de4ad,_0x9ec07f])['then'](function(_0x4ee27e){var _0x45d910=_0x4ee27e[0x0];var _0x5d5dce=_0x4ee27e[0x1];var _0x2e63ae=_[_0x3b2b('0x26')](_0x45d910[_0x3b2b('0x27')],function(_0x426593){return _0x426593[_0x3b2b('0x43')]==_0x5d5dce['id'];});return _0x3582db[_0x3b2b('0x1b')](0xc8)[_0x3b2b('0x2d')]({'count':_0x2e63ae[_0x3b2b('0x2c')],'rows':_0x2e63ae});})['catch'](handleError(_0x3582db));};exports[_0x3b2b('0x44')]=function(_0x5bb885,_0x21dc26){logger[_0x3b2b('0x16')]('conference\x20fired:',_0x5bb885['body']);var _0x175d0b=conferenceValidation['validate'](_0x5bb885['body']);if(_0x175d0b[_0x3b2b('0x2c')]>0x0){return _0x21dc26['status'](0x190)[_0x3b2b('0x2d')](_0x175d0b);}var _0x583b52=_0x5bb885[_0x3b2b('0x2b')][_0x3b2b('0x2e')];return getAgent(_0x583b52)[_0x3b2b('0x1f')](function(_0x162708){logger['info']('entityFound:',_0x162708[_0x3b2b('0x1a')]);emit(util[_0x3b2b('0x33')]('user:%s',_0x162708[_0x3b2b('0x1a')]),_0x3b2b('0x45'));return _0x21dc26['status'](0xc8)[_0x3b2b('0x2d')]({'error':![],'message':_0x3b2b('0x46')});})['catch'](handleError(_0x21dc26));};exports[_0x3b2b('0x47')]=function(_0x18e0e4,_0x1db938){logger[_0x3b2b('0x16')](_0x3b2b('0x48'),_0x18e0e4[_0x3b2b('0x2b')]);var _0x380a78=transferValidation['validate'](_0x18e0e4[_0x3b2b('0x2b')]);if(_0x380a78[_0x3b2b('0x2c')]>0x0){return _0x1db938['status'](0x190)['json'](_0x380a78);}var _0x1fd556=_0x18e0e4['body'][_0x3b2b('0x2e')];var _0x191c6c=_0x18e0e4[_0x3b2b('0x2b')][_0x3b2b('0x28')];var _0x32f21d=_0x18e0e4[_0x3b2b('0x2b')][_0x3b2b('0x49')];return getAgent(_0x1fd556)[_0x3b2b('0x1f')](function(_0x427a16){logger[_0x3b2b('0x16')](_0x3b2b('0x32'),_0x427a16['name']);emit(util[_0x3b2b('0x33')](_0x3b2b('0x34'),_0x427a16[_0x3b2b('0x1a')]),_0x3b2b('0x4a'),{'sessionId':_0x191c6c,'transferNumber':_0x32f21d});return _0x1db938[_0x3b2b('0x1b')](0xc8)[_0x3b2b('0x2d')]({'error':![],'message':_0x3b2b('0x4b')});})['catch'](handleError(_0x1db938));}; \ No newline at end of file +var _0x1b73=['unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','VoiceChannels','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','code','message','result','User','findOne','agent','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate','body','length','callerId','callbackUrl','entityFound:','format','user:%s','json','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','userId','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!'];(function(_0x357243,_0x5778f8){var _0x308fb6=function(_0x3f7e3a){while(--_0x3f7e3a){_0x357243['push'](_0x357243['shift']());}};_0x308fb6(++_0x5778f8);}(_0x1b73,0x1d5));var _0x31b7=function(_0x46a897,_0x51a2f9){_0x46a897=_0x46a897-0x0;var _0x42c2b3=_0x1b73[_0x46a897];return _0x42c2b3;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x31b7('0x0'));var db=require(_0x31b7('0x1'))['db'];var config=require(_0x31b7('0x2'));var util=require(_0x31b7('0x3'));var BPromise=require('bluebird');var jayson=require(_0x31b7('0x4'));var amiClient=jayson['client'][_0x31b7('0x5')]({'port':0x232a});var logger=require(_0x31b7('0x6'))('webbarapi');var Redis=require(_0x31b7('0x7'));config[_0x31b7('0x8')]=_[_0x31b7('0x9')](config['redis'],{'host':_0x31b7('0xa'),'port':0x18eb});var io=require(_0x31b7('0xb'))(new Redis(config[_0x31b7('0x8')]));var Schema=require(_0x31b7('0xc'));var originateValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'callNumber':{'type':_0x31b7('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x31b7('0xf')},'callbackUrl':{'type':_0x31b7('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':'string','required':[!![],_0x31b7('0x10')]},'transferNumber':{'type':_0x31b7('0xf'),'required':[!![],_0x31b7('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x31b7('0xd'),'required':[!![],_0x31b7('0xe')]},'sessionId':{'type':_0x31b7('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x31b7('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x31b7('0xe')]}});function emit(_0xf213c9,_0x48f733,_0x15df1d){logger[_0x31b7('0x12')](_0xf213c9,_0x48f733,JSON[_0x31b7('0x13')](_0x15df1d));io['to'](_0xf213c9)[_0x31b7('0x14')](_0x48f733,_0x15df1d);}function handleError(_0x3daf67){return function(_0x5f3245){console[_0x31b7('0x15')](_0x31b7('0x16'),_0x5f3245,_0x5f3245 instanceof RangeError);logger[_0x31b7('0x17')](_0x5f3245[_0x31b7('0x18')]);if(_0x5f3245 instanceof RangeError){if(_0x5f3245[_0x31b7('0x19')]){delete _0x5f3245['name'];}_0x3daf67[_0x31b7('0x1a')](0x194)[_0x31b7('0x1b')](_0x5f3245);}else{if(_0x5f3245[_0x31b7('0x19')]){delete _0x5f3245[_0x31b7('0x19')];}_0x3daf67['status'](0x1f4)[_0x31b7('0x1b')](_0x5f3245);}};}function checkError(){return function(_0x15a20c){if(!_0x15a20c){throw new RangeError(_0x31b7('0x1c'));}return _0x15a20c;};}function respondWithRpcPromise(_0x2e4a56,_0x4d4368){return new BPromise(function(_0x33dd04,_0x20cb03){var _0x250574=amiClient;return _0x250574[_0x31b7('0x1d')](_0x2e4a56,_0x4d4368)[_0x31b7('0x1e')](function(_0x2d24bf){if(_0x2d24bf[_0x31b7('0x17')]){if(_0x2d24bf[_0x31b7('0x17')][_0x31b7('0x1f')]===0x1f4){return _0x20cb03(_0x2d24bf['error'][_0x31b7('0x20')]);}return _0x33dd04(_0x2d24bf[_0x31b7('0x17')][_0x31b7('0x20')]);}else{_0x33dd04(_0x2d24bf[_0x31b7('0x21')]);}})['catch'](function(_0xb8a998){_0x20cb03(_0xb8a998);});});}function getAgent(_0x516b89){return db[_0x31b7('0x22')][_0x31b7('0x23')]({'where':{'id':_0x516b89,'role':_0x31b7('0x24')}})[_0x31b7('0x1e')](checkError());}function getAgentCheckSession(_0xffacb,_0x128865){return new BPromise(function(_0x21ab03,_0x554a66){var _0x4e58e5=respondWithRpcPromise('VoiceChannels');var _0x503549=getAgent(_0xffacb);Promise[_0x31b7('0x25')]([_0x4e58e5,_0x503549])[_0x31b7('0x1e')](function(_0x2a7c54){var _0x4f5e1d=_0x2a7c54[0x0];var _0x169238=_0x2a7c54[0x1];var _0x6ba73c=_[_0x31b7('0x26')](_0x4f5e1d[_0x31b7('0x27')],function(_0x58a87e){return _0x58a87e[_0x31b7('0x28')]==_0x169238['id']&&_0x58a87e[_0x31b7('0x29')]==_0x128865;});if(_0x6ba73c['length']==0x1){_0x21ab03(_0x169238);}else{_0x554a66(new RangeError('sessionId\x20'+_0x128865+_0x31b7('0x2a')));}});});}exports[_0x31b7('0x2b')]=function(_0xdde2de,_0x35f83c){logger['info']('originate\x20fired:',_0xdde2de[_0x31b7('0x2c')]);var _0x345393=originateValidation[_0x31b7('0xc')](_0xdde2de[_0x31b7('0x2c')]);if(_0x345393[_0x31b7('0x2d')]>0x0){return _0x35f83c['status'](0x190)['json'](_0x345393);}var _0x36fe4e=_0xdde2de[_0x31b7('0x2c')]['userId'];var _0x2cd807=_0xdde2de[_0x31b7('0x2c')]['callNumber'];var _0x267691=_0xdde2de[_0x31b7('0x2c')][_0x31b7('0x2e')];var _0x23d84b=_0xdde2de[_0x31b7('0x2c')][_0x31b7('0x2f')];return getAgent(_0x36fe4e)[_0x31b7('0x1e')](function(_0x200314){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x200314[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x200314['name']),'webbar:originate',{'callNumber':_0x2cd807,'callerId':_0x267691,'callbackUrl':_0x23d84b});return _0x35f83c[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x34')});})[_0x31b7('0x35')](handleError(_0x35f83c));};exports[_0x31b7('0x36')]=function(_0x37dc32,_0x15a42b){logger[_0x31b7('0x12')](_0x31b7('0x37'),_0x37dc32[_0x31b7('0x2c')]);var _0x5849ad=hangupValidation[_0x31b7('0xc')](_0x37dc32[_0x31b7('0x2c')]);if(_0x5849ad[_0x31b7('0x2d')]>0x0){return _0x15a42b[_0x31b7('0x1a')](0x190)['json'](_0x5849ad);}var _0x20e865=_0x37dc32[_0x31b7('0x2c')]['userId'];var _0x3f8a6b=_0x37dc32['body']['sessionId'];return getAgent(_0x20e865)[_0x31b7('0x1e')](function(_0x10e82c){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x10e82c[_0x31b7('0x19')]);emit(util['format'](_0x31b7('0x32'),_0x10e82c['name']),'webbar:hangup',{'sessionId':_0x3f8a6b});return _0x15a42b['status'](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x38')});})[_0x31b7('0x35')](handleError(_0x15a42b));};exports[_0x31b7('0x39')]=function(_0x17c2d9,_0x4ccea9){logger[_0x31b7('0x12')]('answer\x20fired:',_0x17c2d9[_0x31b7('0x2c')]);var _0x3caab0=answerValidation[_0x31b7('0xc')](_0x17c2d9[_0x31b7('0x2c')]);if(_0x3caab0['length']>0x0){return _0x4ccea9[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x3caab0);}var _0x1046fb=_0x17c2d9['body'][_0x31b7('0x3a')];var _0x51918d=_0x17c2d9[_0x31b7('0x2c')][_0x31b7('0x29')];return getAgent(_0x1046fb)['then'](function(_0x152b88){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x152b88[_0x31b7('0x19')]);emit(util['format'](_0x31b7('0x32'),_0x152b88['name']),'webbar:answer',{'sessionId':_0x51918d});return _0x4ccea9[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x3b')});})[_0x31b7('0x35')](handleError(_0x4ccea9));};exports['hold']=function(_0x6014e,_0x2be7d6){logger['info'](_0x31b7('0x3c'),_0x6014e[_0x31b7('0x2c')]);var _0x2d313b=holdValidation['validate'](_0x6014e[_0x31b7('0x2c')]);if(_0x2d313b[_0x31b7('0x2d')]>0x0){return _0x2be7d6[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x2d313b);}var _0x345059=_0x6014e[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0x40aead=_0x6014e['body'][_0x31b7('0x29')];return getAgent(_0x345059)['then'](function(_0x5a72ee){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x5a72ee[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')]('user:%s',_0x5a72ee[_0x31b7('0x19')]),_0x31b7('0x3d'),{'sessionId':_0x40aead});return _0x2be7d6[_0x31b7('0x1a')](0xc8)['json']({'error':![],'message':_0x31b7('0x3e')});})[_0x31b7('0x35')](handleError(_0x2be7d6));};exports[_0x31b7('0x3f')]=function(_0x3b5868,_0x2bf59c){logger[_0x31b7('0x12')](_0x31b7('0x40'),_0x3b5868[_0x31b7('0x2c')]);var _0x4d1fd6=unholdValidation['validate'](_0x3b5868[_0x31b7('0x2c')]);if(_0x4d1fd6[_0x31b7('0x2d')]>0x0){return _0x2bf59c[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x4d1fd6);}var _0x4920e0=_0x3b5868['body'][_0x31b7('0x3a')];var _0x413bb0=_0x3b5868[_0x31b7('0x2c')][_0x31b7('0x29')];return getAgent(_0x4920e0)[_0x31b7('0x1e')](function(_0x12b713){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x12b713['name']);emit(util['format'](_0x31b7('0x32'),_0x12b713[_0x31b7('0x19')]),_0x31b7('0x41'),{'sessionId':_0x413bb0});return _0x2bf59c[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x42')});})[_0x31b7('0x35')](handleError(_0x2bf59c));};exports[_0x31b7('0x43')]=function(_0x1ec95f,_0x3e1c4f){logger['info']('calls\x20fired:',_0x3e1c4f[_0x31b7('0x2c')]);var _0x954c=callsValidation[_0x31b7('0xc')](_0x1ec95f[_0x31b7('0x2c')]);if(_0x954c['length']>0x0){return _0x3e1c4f[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x954c);}var _0x316175=_0x1ec95f[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0x23ffad=respondWithRpcPromise(_0x31b7('0x44'));var _0x3a8b87=getAgent(_0x316175);return Promise[_0x31b7('0x25')]([_0x23ffad,_0x3a8b87])[_0x31b7('0x1e')](function(_0x29ef38){var _0x4cd34e=_0x29ef38[0x0];var _0x4c77e0=_0x29ef38[0x1];var _0x2cf8ec=_[_0x31b7('0x26')](_0x4cd34e[_0x31b7('0x27')],function(_0x3f25d7){return _0x3f25d7[_0x31b7('0x28')]==_0x4c77e0['id'];});return _0x3e1c4f[_0x31b7('0x1a')](0xc8)['json']({'count':_0x2cf8ec[_0x31b7('0x2d')],'rows':_0x2cf8ec});})['catch'](handleError(_0x3e1c4f));};exports['conference']=function(_0x531bcd,_0x3686b8){logger[_0x31b7('0x12')](_0x31b7('0x45'),_0x531bcd[_0x31b7('0x2c')]);var _0x44934f=conferenceValidation[_0x31b7('0xc')](_0x531bcd[_0x31b7('0x2c')]);if(_0x44934f[_0x31b7('0x2d')]>0x0){return _0x3686b8[_0x31b7('0x1a')](0x190)[_0x31b7('0x33')](_0x44934f);}var _0x40d54b=_0x531bcd[_0x31b7('0x2c')][_0x31b7('0x3a')];return getAgent(_0x40d54b)[_0x31b7('0x1e')](function(_0x2598d5){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x2598d5[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x2598d5[_0x31b7('0x19')]),_0x31b7('0x46'));return _0x3686b8[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':'conference\x20executed!'});})[_0x31b7('0x35')](handleError(_0x3686b8));};exports[_0x31b7('0x47')]=function(_0x47f5f7,_0x2900ff){logger['info'](_0x31b7('0x48'),_0x47f5f7[_0x31b7('0x2c')]);var _0x318746=transferValidation[_0x31b7('0xc')](_0x47f5f7['body']);if(_0x318746[_0x31b7('0x2d')]>0x0){return _0x2900ff['status'](0x190)[_0x31b7('0x33')](_0x318746);}var _0x4b368c=_0x47f5f7[_0x31b7('0x2c')][_0x31b7('0x3a')];var _0xfeb4e2=_0x47f5f7[_0x31b7('0x2c')]['sessionId'];var _0xb4be25=_0x47f5f7[_0x31b7('0x2c')][_0x31b7('0x49')];return getAgent(_0x4b368c)[_0x31b7('0x1e')](function(_0x3c0cf8){logger[_0x31b7('0x12')](_0x31b7('0x30'),_0x3c0cf8[_0x31b7('0x19')]);emit(util[_0x31b7('0x31')](_0x31b7('0x32'),_0x3c0cf8[_0x31b7('0x19')]),_0x31b7('0x4a'),{'sessionId':_0xfeb4e2,'transferNumber':_0xb4be25});return _0x2900ff[_0x31b7('0x1a')](0xc8)[_0x31b7('0x33')]({'error':![],'message':_0x31b7('0x4b')});})[_0x31b7('0x35')](handleError(_0x2900ff));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 27a83d9..863f723 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 _0x2795=['delete','/:id','destroy','removeAnswers','removeAgents','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','/:id/dispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','put','update'];(function(_0x2f3467,_0x33b18c){var _0x33b1de=function(_0x4fccf3){while(--_0x4fccf3){_0x2f3467['push'](_0x2f3467['shift']());}};_0x33b1de(++_0x33b18c);}(_0x2795,0x1e6));var _0x5279=function(_0x1cb554,_0x5c0f19){_0x1cb554=_0x1cb554-0x0;var _0x36917e=_0x2795[_0x1cb554];return _0x36917e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5279('0x0'));var timeout=require(_0x5279('0x1'));var express=require(_0x5279('0x2'));var router=express['Router']();var fs_extra=require(_0x5279('0x3'));var auth=require(_0x5279('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5279('0x5'));var controller=require('./whatsappAccount.controller');router[_0x5279('0x6')]('/',auth['isAuthenticated'](),controller[_0x5279('0x7')]);router[_0x5279('0x6')]('/describe',auth[_0x5279('0x8')](),controller[_0x5279('0x9')]);router[_0x5279('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x5279('0xa')]);router[_0x5279('0x6')](_0x5279('0xb'),auth[_0x5279('0x8')](),controller['getDispositions']);router['get'](_0x5279('0xc'),auth[_0x5279('0x8')](),controller['getAnswers']);router['get'](_0x5279('0xd'),auth[_0x5279('0x8')](),controller[_0x5279('0xe')]);router[_0x5279('0x6')](_0x5279('0xf'),auth[_0x5279('0x8')](),controller[_0x5279('0x10')]);router[_0x5279('0x11')]('/',auth[_0x5279('0x8')](),controller[_0x5279('0x12')]);router[_0x5279('0x11')](_0x5279('0xb'),auth[_0x5279('0x8')](),controller[_0x5279('0x13')]);router[_0x5279('0x11')]('/:id/canned_answers',auth[_0x5279('0x8')](),controller[_0x5279('0x14')]);router[_0x5279('0x11')]('/:id/users',auth[_0x5279('0x8')](),controller[_0x5279('0x15')]);router[_0x5279('0x11')](_0x5279('0xf'),auth[_0x5279('0x8')](),controller[_0x5279('0x16')]);router['post'](_0x5279('0x17'),controller['notify']);router['post']('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x5279('0x18')]('/:id',auth[_0x5279('0x8')](),controller[_0x5279('0x19')]);router[_0x5279('0x1a')](_0x5279('0x1b'),auth[_0x5279('0x8')](),controller[_0x5279('0x1c')]);router[_0x5279('0x1a')](_0x5279('0xb'),auth[_0x5279('0x8')](),controller['removeDispositions']);router[_0x5279('0x1a')](_0x5279('0xc'),auth[_0x5279('0x8')](),controller[_0x5279('0x1d')]);router['delete'](_0x5279('0xd'),auth[_0x5279('0x8')](),controller[_0x5279('0x1e')]);module[_0x5279('0x1f')]=router; \ No newline at end of file +var _0x92d7=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','/:id/send','update','delete','destroy','removeDispositions','removeAgents','multer'];(function(_0x193aa3,_0x43aa53){var _0x10a85d=function(_0x493c0b){while(--_0x493c0b){_0x193aa3['push'](_0x193aa3['shift']());}};_0x10a85d(++_0x43aa53);}(_0x92d7,0xdd));var _0x792d=function(_0x396e23,_0x3024eb){_0x396e23=_0x396e23-0x0;var _0x4226db=_0x92d7[_0x396e23];return _0x4226db;};'use strict';var multer=require(_0x792d('0x0'));var util=require(_0x792d('0x1'));var path=require(_0x792d('0x2'));var timeout=require(_0x792d('0x3'));var express=require(_0x792d('0x4'));var router=express[_0x792d('0x5')]();var fs_extra=require(_0x792d('0x6'));var auth=require(_0x792d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x792d('0x8'));var controller=require(_0x792d('0x9'));router[_0x792d('0xa')]('/',auth[_0x792d('0xb')](),controller[_0x792d('0xc')]);router['get'](_0x792d('0xd'),auth[_0x792d('0xb')](),controller[_0x792d('0xe')]);router['get'](_0x792d('0xf'),auth[_0x792d('0xb')](),controller[_0x792d('0x10')]);router[_0x792d('0xa')](_0x792d('0x11'),auth[_0x792d('0xb')](),controller[_0x792d('0x12')]);router[_0x792d('0xa')](_0x792d('0x13'),auth[_0x792d('0xb')](),controller[_0x792d('0x14')]);router[_0x792d('0xa')](_0x792d('0x15'),auth[_0x792d('0xb')](),controller[_0x792d('0x16')]);router[_0x792d('0xa')](_0x792d('0x17'),auth[_0x792d('0xb')](),controller['getApplications']);router['post']('/',auth[_0x792d('0xb')](),controller[_0x792d('0x18')]);router[_0x792d('0x19')](_0x792d('0x11'),auth[_0x792d('0xb')](),controller[_0x792d('0x1a')]);router[_0x792d('0x19')](_0x792d('0x13'),auth[_0x792d('0xb')](),controller[_0x792d('0x1b')]);router[_0x792d('0x19')]('/:id/users',auth[_0x792d('0xb')](),controller[_0x792d('0x1c')]);router[_0x792d('0x19')](_0x792d('0x17'),auth[_0x792d('0xb')](),controller[_0x792d('0x1d')]);router[_0x792d('0x19')](_0x792d('0x1e'),controller['notify']);router[_0x792d('0x19')](_0x792d('0x1f'),auth[_0x792d('0xb')](),controller['send']);router['put'](_0x792d('0xf'),auth[_0x792d('0xb')](),controller[_0x792d('0x20')]);router[_0x792d('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x792d('0x22')]);router[_0x792d('0x21')](_0x792d('0x11'),auth['isAuthenticated'](),controller[_0x792d('0x23')]);router[_0x792d('0x21')](_0x792d('0x13'),auth[_0x792d('0xb')](),controller['removeAnswers']);router[_0x792d('0x21')](_0x792d('0x15'),auth['isAuthenticated'](),controller[_0x792d('0x24')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 828ffbc..a1a68b0 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 _0x3d3d=['TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch'];(function(_0x50e51a,_0x39e949){var _0xe02402=function(_0xbc177a){while(--_0xbc177a){_0x50e51a['push'](_0x50e51a['shift']());}};_0xe02402(++_0x39e949);}(_0x3d3d,0x12c));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd3d3('0x0'));module[_0xd3d3('0x1')]={'name':{'type':Sequelize[_0xd3d3('0x2')],'unique':_0xd3d3('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xd3d3('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xd3d3('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xd3d3('0x2')],'defaultValue':function(){return rs[_0xd3d3('0x4')]();}},'phone':{'type':Sequelize[_0xd3d3('0x2')]},'type':{'type':Sequelize[_0xd3d3('0x5')](_0xd3d3('0x6'),_0xd3d3('0x7'))},'accountSid':{'type':Sequelize[_0xd3d3('0x2')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xd3d3('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd3d3('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xd3d3('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd3d3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd3d3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd3d3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd3d3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd3d3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd3d3('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xd3d3('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x30a2aa){if(!_0x30a2aa){this['setDataValue'](_0xd3d3('0xc'),null);}this[_0xd3d3('0xd')]('mandatoryDisposition',_0x30a2aa);}},'description':{'type':Sequelize[_0xd3d3('0x2')]}}; \ No newline at end of file +var _0x0946=['sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x5d1d5e,_0x4ac3f8){var _0x28436c=function(_0x286ac0){while(--_0x286ac0){_0x5d1d5e['push'](_0x5d1d5e['shift']());}};_0x28436c(++_0x4ac3f8);}(_0x0946,0x130));var _0x6094=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x0946[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0x6094('0x0'));var rs=require(_0x6094('0x1'));module[_0x6094('0x2')]={'name':{'type':Sequelize[_0x6094('0x3')],'unique':_0x6094('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x6094('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x6094('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x6094('0x3')],'defaultValue':function(){return rs[_0x6094('0x5')]();}},'phone':{'type':Sequelize[_0x6094('0x3')]},'type':{'type':Sequelize[_0x6094('0x6')](_0x6094('0x7'),_0x6094('0x8'))},'accountSid':{'type':Sequelize[_0x6094('0x3')]},'baseUrl':{'type':Sequelize[_0x6094('0x3')]},'authToken':{'type':Sequelize[_0x6094('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6094('0x9')],'defaultValue':function(){return _0x6094('0xa');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6094('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6094('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6094('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6094('0xc')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6094('0xb')],'defaultValue':![],'comment':_0x6094('0xd'),'set':function(_0x438527){if(!_0x438527){this[_0x6094('0xe')](_0x6094('0xf'),null);}this['setDataValue']('mandatoryDisposition',_0x438527);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 94fe76d..b1d0c7b 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 _0xf0b0=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','pick','Disposition','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','orderBy','asc','Applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','twilio','from','From','whatsapp:','Body','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','defaults','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','applications','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5714e2,_0x1cd5fa){var _0x215fdc=function(_0x2cc3ab){while(--_0x2cc3ab){_0x5714e2['push'](_0x5714e2['shift']());}};_0x215fdc(++_0x1cd5fa);}(_0xf0b0,0x143));var _0x0f0b=function(_0x305f0e,_0x264cbf){_0x305f0e=_0x305f0e-0x0;var _0x596f63=_0xf0b0[_0x305f0e];return _0x596f63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f0b('0x0'));var zipdir=require(_0x0f0b('0x1'));var jsonpatch=require(_0x0f0b('0x2'));var rp=require('request-promise');var moment=require(_0x0f0b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0f0b('0x4'));var util=require('util');var path=require(_0x0f0b('0x5'));var sox=require(_0x0f0b('0x6'));var csv=require(_0x0f0b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f0b('0x8'));var _=require(_0x0f0b('0x9'));var squel=require('squel');var crypto=require(_0x0f0b('0xa'));var jsforce=require(_0x0f0b('0xb'));var deskjs=require(_0x0f0b('0xc'));var toCsv=require(_0x0f0b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0f0b('0xd'));var as=require(_0x0f0b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0f0b('0xf'));var utils=require(_0x0f0b('0x10'));var config=require(_0x0f0b('0x11'));var licenseUtil=require(_0x0f0b('0x12'));var db=require(_0x0f0b('0x13'))['db'];config[_0x0f0b('0x14')]=_['defaults'](config[_0x0f0b('0x14')],{'host':_0x0f0b('0x15'),'port':0x18eb});var socket=require(_0x0f0b('0x16'))(new Redis(config[_0x0f0b('0x14')]));require(_0x0f0b('0x17'))[_0x0f0b('0x18')](socket);var jayson=require(_0x0f0b('0x19'));var client=jayson[_0x0f0b('0x1a')][_0x0f0b('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0xc14bf1,_0x2f3913,_0x169124,_0x4f6d6b){return new BPromise(function(_0x595bee,_0x40c3a5){var _0x3be5a2=_0x4f6d6b||client;return _0x3be5a2[_0x0f0b('0x1c')](_0xc14bf1,_0x169124)[_0x0f0b('0x1d')](function(_0x293b62){logger[_0x0f0b('0x1e')](_0x0f0b('0x1f'),_0x2f3913,_0x0f0b('0x20'));logger['debug'](_0x0f0b('0x21'),_0x2f3913,_0x0f0b('0x20'),JSON[_0x0f0b('0x22')](_0x293b62));if(_0x293b62[_0x0f0b('0x23')]){if(_0x293b62[_0x0f0b('0x23')][_0x0f0b('0x24')]===0x1f4){logger['error'](_0x0f0b('0x1f'),_0x2f3913,_0x293b62[_0x0f0b('0x23')][_0x0f0b('0x25')]);return _0x40c3a5(_0x293b62[_0x0f0b('0x23')][_0x0f0b('0x25')]);}logger[_0x0f0b('0x23')](_0x0f0b('0x1f'),_0x2f3913,_0x293b62[_0x0f0b('0x23')]['message']);return _0x595bee(_0x293b62[_0x0f0b('0x23')][_0x0f0b('0x25')]);}else{logger[_0x0f0b('0x1e')](_0x0f0b('0x1f'),_0x2f3913,_0x0f0b('0x20'));_0x595bee(_0x293b62[_0x0f0b('0x26')][_0x0f0b('0x25')]);}})[_0x0f0b('0x27')](function(_0x5e9307){logger['error'](_0x0f0b('0x1f'),_0x2f3913,_0x5e9307);_0x40c3a5(_0x5e9307);});});}function respondWithStatusCode(_0x911d16,_0x19fb2b){_0x19fb2b=_0x19fb2b||0xcc;return function(_0x84bac1){if(_0x84bac1){return _0x911d16[_0x0f0b('0x28')](_0x19fb2b);}return _0x911d16[_0x0f0b('0x29')](_0x19fb2b)[_0x0f0b('0x2a')]();};}function respondWithResult(_0x395203,_0x28c7f9){_0x28c7f9=_0x28c7f9||0xc8;return function(_0xf50023){if(_0xf50023){return _0x395203[_0x0f0b('0x29')](_0x28c7f9)['json'](_0xf50023);}};}function respondWithFilteredResult(_0x3efd4b,_0x329200){return function(_0x6fded9){if(_0x6fded9){var _0x4eee46=typeof _0x329200[_0x0f0b('0x2b')]===_0x0f0b('0x2c')&&typeof _0x329200['limit']===_0x0f0b('0x2c');var _0x59ad4a=_0x6fded9[_0x0f0b('0x2d')];var _0x185d5c=_0x4eee46?0x0:_0x329200[_0x0f0b('0x2b')];var _0x57d327=_0x4eee46?_0x6fded9[_0x0f0b('0x2d')]:_0x329200[_0x0f0b('0x2b')]+_0x329200[_0x0f0b('0x2e')];var _0x57ce6f;if(_0x57d327>=_0x59ad4a){_0x57d327=_0x59ad4a;_0x57ce6f=0xc8;}else{_0x57ce6f=0xce;}_0x3efd4b[_0x0f0b('0x29')](_0x57ce6f);return _0x3efd4b['set'](_0x0f0b('0x2f'),_0x185d5c+'-'+_0x57d327+'/'+_0x59ad4a)[_0x0f0b('0x30')](_0x6fded9);}return null;};}function patchUpdates(_0xf13918){return function(_0x5d0ea7){try{jsonpatch[_0x0f0b('0x31')](_0x5d0ea7,_0xf13918,!![]);}catch(_0xee9ec1){return BPromise[_0x0f0b('0x32')](_0xee9ec1);}return _0x5d0ea7['save']();};}function saveUpdates(_0x34b48c,_0x13cb43){return function(_0x44d0c4){if(_0x44d0c4){return _0x44d0c4[_0x0f0b('0x33')](_0x34b48c)['then'](function(_0x204570){return _0x204570;});}return null;};}function removeEntity(_0x1b7a9c,_0x3270e8){return function(_0x376b51){if(_0x376b51){return _0x376b51[_0x0f0b('0x34')]()['then'](function(){var _0x585de3=_0x376b51['get']({'plain':!![]});var _0x1627e6=_0x0f0b('0x35');return db[_0x0f0b('0x36')][_0x0f0b('0x34')]({'where':{'type':_0x1627e6,'resourceId':_0x585de3['id']}})[_0x0f0b('0x1d')](function(){return _0x376b51;});})[_0x0f0b('0x1d')](function(){_0x1b7a9c[_0x0f0b('0x29')](0xcc)[_0x0f0b('0x2a')]();});}};}function handleEntityNotFound(_0x3deb2d,_0x43b66c){return function(_0xfce742){if(!_0xfce742){_0x3deb2d[_0x0f0b('0x28')](0x194);}return _0xfce742;};}function handleError(_0x3724a4,_0x3eed6d){_0x3eed6d=_0x3eed6d||0x1f4;return function(_0x3c631f){logger[_0x0f0b('0x23')](_0x3c631f[_0x0f0b('0x37')]);if(_0x3c631f['name']){delete _0x3c631f[_0x0f0b('0x38')];}_0x3724a4['status'](_0x3eed6d)[_0x0f0b('0x39')](_0x3c631f);};}exports[_0x0f0b('0x3a')]=function(_0x10b2cf,_0x2487f9){var _0x19c451={'include':[{'model':db[_0x0f0b('0x3b')],'as':_0x0f0b('0x3c')}]},_0x3aaa42={},_0xa5269a={'count':0x0,'rows':[]};var _0x27fe12=_[_0x0f0b('0x3d')](db[_0x0f0b('0x3e')][_0x0f0b('0x3f')],function(_0xf9e317){return{'name':_0xf9e317[_0x0f0b('0x40')],'type':_0xf9e317[_0x0f0b('0x41')][_0x0f0b('0x42')]};});_0x3aaa42[_0x0f0b('0x43')]=_['map'](_0x27fe12,_0x0f0b('0x38'));_0x3aaa42[_0x0f0b('0x44')]=_[_0x0f0b('0x45')](_0x10b2cf[_0x0f0b('0x44')]);_0x3aaa42[_0x0f0b('0x46')]=_[_0x0f0b('0x47')](_0x3aaa42[_0x0f0b('0x43')],_0x3aaa42[_0x0f0b('0x44')]);_0x19c451[_0x0f0b('0x48')]=_[_0x0f0b('0x47')](_0x3aaa42['model'],qs[_0x0f0b('0x49')](_0x10b2cf[_0x0f0b('0x44')][_0x0f0b('0x49')]));_0x19c451[_0x0f0b('0x48')]=_0x19c451['attributes'][_0x0f0b('0x4a')]?_0x19c451[_0x0f0b('0x48')]:_0x3aaa42[_0x0f0b('0x43')];if(!_0x10b2cf[_0x0f0b('0x44')][_0x0f0b('0x4b')](_0x0f0b('0x4c'))){_0x19c451[_0x0f0b('0x2e')]=qs[_0x0f0b('0x2e')](_0x10b2cf[_0x0f0b('0x44')]['limit']);_0x19c451[_0x0f0b('0x2b')]=qs[_0x0f0b('0x2b')](_0x10b2cf[_0x0f0b('0x44')]['offset']);}_0x19c451[_0x0f0b('0x4d')]=qs['sort'](_0x10b2cf['query'][_0x0f0b('0x4e')]);_0x19c451[_0x0f0b('0x4f')]=qs[_0x0f0b('0x46')](_['pick'](_0x10b2cf['query'],_0x3aaa42[_0x0f0b('0x46')]),_0x27fe12);if(_0x10b2cf[_0x0f0b('0x44')][_0x0f0b('0x50')]){_0x19c451[_0x0f0b('0x4f')]=_['merge'](_0x19c451['where'],{'$or':_[_0x0f0b('0x3d')](_0x27fe12,function(_0x32c915){if(_0x32c915[_0x0f0b('0x41')]!==_0x0f0b('0x51')){var _0x38d7d9={};_0x38d7d9[_0x32c915['name']]={'$like':'%'+_0x10b2cf[_0x0f0b('0x44')][_0x0f0b('0x50')]+'%'};return _0x38d7d9;}})});}_0x19c451=_[_0x0f0b('0x52')]({},_0x19c451,_0x10b2cf[_0x0f0b('0x53')]);var _0x23eb68={'where':_0x19c451[_0x0f0b('0x4f')]};return db[_0x0f0b('0x3e')][_0x0f0b('0x2d')](_0x23eb68)['then'](function(_0x3fdcb5){_0xa5269a[_0x0f0b('0x2d')]=_0x3fdcb5;if(_0x10b2cf[_0x0f0b('0x44')][_0x0f0b('0x54')]){_0x19c451[_0x0f0b('0x55')]=[{'all':!![]}];}return db[_0x0f0b('0x3e')][_0x0f0b('0x56')](_0x19c451);})[_0x0f0b('0x1d')](function(_0x8a028c){_0xa5269a[_0x0f0b('0x57')]=_0x8a028c;return _0xa5269a;})[_0x0f0b('0x1d')](respondWithFilteredResult(_0x2487f9,_0x19c451))[_0x0f0b('0x27')](handleError(_0x2487f9,null));};exports[_0x0f0b('0x58')]=function(_0x3909a6,_0x5cbcea){var _0x32cef5={'raw':![],'where':{'id':_0x3909a6[_0x0f0b('0x59')]['id']},'include':[{'model':db[_0x0f0b('0x3b')],'as':_0x0f0b('0x3c')}]},_0x10e379={};_0x10e379[_0x0f0b('0x43')]=_['keys'](db[_0x0f0b('0x3e')][_0x0f0b('0x3f')]);_0x10e379[_0x0f0b('0x44')]=_[_0x0f0b('0x45')](_0x3909a6[_0x0f0b('0x44')]);_0x10e379[_0x0f0b('0x46')]=_[_0x0f0b('0x47')](_0x10e379[_0x0f0b('0x43')],_0x10e379[_0x0f0b('0x44')]);_0x32cef5[_0x0f0b('0x48')]=_['intersection'](_0x10e379[_0x0f0b('0x43')],qs[_0x0f0b('0x49')](_0x3909a6['query']['fields']));_0x32cef5[_0x0f0b('0x48')]=_0x32cef5[_0x0f0b('0x48')]['length']?_0x32cef5[_0x0f0b('0x48')]:_0x10e379[_0x0f0b('0x43')];if(_0x3909a6[_0x0f0b('0x44')]['includeAll']){_0x32cef5[_0x0f0b('0x55')]=[{'all':!![]}];}_0x32cef5=_['merge']({},_0x32cef5,_0x3909a6[_0x0f0b('0x53')]);return db[_0x0f0b('0x3e')][_0x0f0b('0x5a')](_0x32cef5)[_0x0f0b('0x1d')](handleEntityNotFound(_0x5cbcea,null))[_0x0f0b('0x1d')](respondWithResult(_0x5cbcea,null))[_0x0f0b('0x27')](handleError(_0x5cbcea,null));};exports[_0x0f0b('0x5b')]=function(_0x734ca8,_0x3c5829){return db[_0x0f0b('0x3e')][_0x0f0b('0x5b')](_0x734ca8[_0x0f0b('0x5c')],{})['then'](function(_0x299ef7){var _0x4d88d5=_0x734ca8[_0x0f0b('0x5d')]['get']({'plain':!![]});if(!_0x4d88d5)throw new Error(_0x0f0b('0x5e'));if(_0x4d88d5[_0x0f0b('0x5f')]===_0x0f0b('0x5d')){var _0x49161c=_0x299ef7[_0x0f0b('0x60')]({'plain':!![]});var _0x28f023='WhatsappAccounts';return db[_0x0f0b('0x61')][_0x0f0b('0x5a')]({'where':{'name':_0x28f023,'userProfileId':_0x4d88d5[_0x0f0b('0x62')]},'raw':!![]})['then'](function(_0x5bf5a6){if(_0x5bf5a6&&_0x5bf5a6[_0x0f0b('0x63')]===0x0){return db[_0x0f0b('0x36')]['create']({'name':_0x49161c[_0x0f0b('0x38')],'resourceId':_0x49161c['id'],'type':_0x5bf5a6[_0x0f0b('0x38')],'sectionId':_0x5bf5a6['id']},{})[_0x0f0b('0x1d')](function(){return _0x299ef7;});}else{return _0x299ef7;}})[_0x0f0b('0x27')](function(_0x30d20a){logger[_0x0f0b('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30d20a);throw _0x30d20a;});}return _0x299ef7;})[_0x0f0b('0x1d')](respondWithResult(_0x3c5829,0xc9))['catch'](handleError(_0x3c5829,null));};exports['update']=function(_0x17beb6,_0xe559d5){if(_0x17beb6[_0x0f0b('0x5c')]['id']){delete _0x17beb6['body']['id'];}return db['WhatsappAccount'][_0x0f0b('0x5a')]({'where':{'id':_0x17beb6[_0x0f0b('0x59')]['id']},'include':[{'model':db[_0x0f0b('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x0f0b('0x1d')](handleEntityNotFound(_0xe559d5,null))['then'](saveUpdates(_0x17beb6[_0x0f0b('0x5c')],null))[_0x0f0b('0x1d')](respondWithResult(_0xe559d5,null))[_0x0f0b('0x27')](handleError(_0xe559d5,null));};exports['destroy']=function(_0x5c9d6f,_0x176318){return db['WhatsappAccount']['find']({'where':{'id':_0x5c9d6f[_0x0f0b('0x59')]['id']}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x176318,null))[_0x0f0b('0x1d')](removeEntity(_0x176318,null))[_0x0f0b('0x27')](handleError(_0x176318,null));};exports[_0x0f0b('0x64')]=function(_0x16f1f5,_0x12b0dd){return db[_0x0f0b('0x3e')][_0x0f0b('0x64')]()['then'](respondWithResult(_0x12b0dd,null))[_0x0f0b('0x27')](handleError(_0x12b0dd,null));};exports[_0x0f0b('0x65')]=function(_0x39e2d0,_0x3b6246,_0x301754){if(_0x39e2d0['body']['id']){delete _0x39e2d0[_0x0f0b('0x5c')]['id'];}return db[_0x0f0b('0x3e')]['find']({'where':{'id':_0x39e2d0[_0x0f0b('0x59')]['id']}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x3b6246,null))[_0x0f0b('0x1d')](function(_0xf77bb6){if(_0xf77bb6){_0x39e2d0[_0x0f0b('0x5c')][_0x0f0b('0x66')]=_0xf77bb6['id'];return db['Disposition'][_0x0f0b('0x5b')](_0x39e2d0[_0x0f0b('0x5c')]);}})[_0x0f0b('0x1d')](respondWithResult(_0x3b6246,null))[_0x0f0b('0x27')](handleError(_0x3b6246,null));};exports['getDispositions']=function(_0x197f12,_0x1b93d5,_0x246091){var _0x17c24f={'raw':![],'where':{}};var _0x36c0ae={};var _0x2c8463={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x197f12[_0x0f0b('0x59')]['id']}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x1b93d5,null))[_0x0f0b('0x1d')](function(_0x5382b5){if(_0x5382b5){_0x36c0ae[_0x0f0b('0x43')]=_[_0x0f0b('0x45')](db['Disposition']['rawAttributes']);_0x36c0ae[_0x0f0b('0x44')]=_[_0x0f0b('0x45')](_0x197f12[_0x0f0b('0x44')]);_0x36c0ae[_0x0f0b('0x46')]=_[_0x0f0b('0x47')](_0x36c0ae[_0x0f0b('0x43')],_0x36c0ae[_0x0f0b('0x44')]);_0x17c24f['attributes']=_[_0x0f0b('0x47')](_0x36c0ae[_0x0f0b('0x43')],qs[_0x0f0b('0x49')](_0x197f12[_0x0f0b('0x44')][_0x0f0b('0x49')]));_0x17c24f[_0x0f0b('0x48')]=_0x17c24f[_0x0f0b('0x48')]['length']?_0x17c24f[_0x0f0b('0x48')]:_0x36c0ae['model'];if(!_0x197f12['query'][_0x0f0b('0x4b')]('nolimit')){_0x17c24f['limit']=qs[_0x0f0b('0x2e')](_0x197f12[_0x0f0b('0x44')]['limit']);_0x17c24f[_0x0f0b('0x2b')]=qs[_0x0f0b('0x2b')](_0x197f12[_0x0f0b('0x44')][_0x0f0b('0x2b')]);}_0x17c24f[_0x0f0b('0x4d')]=qs[_0x0f0b('0x4e')](_0x197f12['query']['sort']);_0x17c24f[_0x0f0b('0x4f')]=qs[_0x0f0b('0x46')](_[_0x0f0b('0x67')](_0x197f12[_0x0f0b('0x44')],_0x36c0ae[_0x0f0b('0x46')]));_0x17c24f['where'][_0x0f0b('0x66')]=_0x5382b5['id'];if(_0x197f12['query']['filter']){_0x17c24f[_0x0f0b('0x4f')]=_[_0x0f0b('0x52')](_0x17c24f[_0x0f0b('0x4f')],{'$or':_[_0x0f0b('0x3d')](_0x17c24f[_0x0f0b('0x48')],function(_0x286ac9){var _0x4899b7={};_0x4899b7[_0x286ac9]={'$like':'%'+_0x197f12[_0x0f0b('0x44')][_0x0f0b('0x50')]+'%'};return _0x4899b7;})});}_0x17c24f=_[_0x0f0b('0x52')]({},_0x17c24f,_0x197f12['options']);return db[_0x0f0b('0x68')][_0x0f0b('0x2d')]({'where':_0x17c24f['where']})['then'](function(_0x3b6022){_0x2c8463[_0x0f0b('0x2d')]=_0x3b6022;if(_0x197f12['query'][_0x0f0b('0x54')]){_0x17c24f[_0x0f0b('0x55')]=[{'all':!![]}];}return db[_0x0f0b('0x68')][_0x0f0b('0x56')](_0x17c24f);})[_0x0f0b('0x1d')](function(_0x45cebf){_0x2c8463[_0x0f0b('0x57')]=_0x45cebf;return _0x2c8463;});}})[_0x0f0b('0x1d')](respondWithFilteredResult(_0x1b93d5,_0x17c24f))[_0x0f0b('0x27')](handleError(_0x1b93d5,null));};exports[_0x0f0b('0x69')]=function(_0x3a64f8,_0x48480e,_0x4220de){return db[_0x0f0b('0x3e')][_0x0f0b('0x5a')]({'where':{'id':_0x3a64f8[_0x0f0b('0x59')]['id']}})['then'](handleEntityNotFound(_0x48480e,null))[_0x0f0b('0x1d')](function(_0x4c3766){if(_0x4c3766){return _0x4c3766['removeDispositions'](_0x3a64f8[_0x0f0b('0x44')][_0x0f0b('0x6a')]);}})['then'](respondWithStatusCode(_0x48480e,null))[_0x0f0b('0x27')](handleError(_0x48480e,null));};exports[_0x0f0b('0x6b')]=function(_0x59879f,_0x15d083,_0x526489){if(_0x59879f[_0x0f0b('0x5c')]['id']){delete _0x59879f[_0x0f0b('0x5c')]['id'];}return db[_0x0f0b('0x3e')]['find']({'where':{'id':_0x59879f[_0x0f0b('0x59')]['id']}})['then'](handleEntityNotFound(_0x15d083,null))[_0x0f0b('0x1d')](function(_0x35a972){if(_0x35a972){_0x59879f[_0x0f0b('0x5c')][_0x0f0b('0x66')]=_0x35a972['id'];return db['CannedAnswer']['create'](_0x59879f['body']);}})['then'](respondWithResult(_0x15d083,null))[_0x0f0b('0x27')](handleError(_0x15d083,null));};exports[_0x0f0b('0x6c')]=function(_0x1d8a21,_0x400aea,_0x2a25a7){var _0x394c94={'raw':![],'where':{}};var _0x54aa9b={};var _0x3b85ba={'count':0x0,'rows':[]};return db[_0x0f0b('0x3e')][_0x0f0b('0x6d')]({'where':{'id':_0x1d8a21[_0x0f0b('0x59')]['id']}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x400aea,null))[_0x0f0b('0x1d')](function(_0x4a7126){if(_0x4a7126){_0x54aa9b['model']=_[_0x0f0b('0x45')](db[_0x0f0b('0x6e')][_0x0f0b('0x3f')]);_0x54aa9b[_0x0f0b('0x44')]=_[_0x0f0b('0x45')](_0x1d8a21['query']);_0x54aa9b['filters']=_[_0x0f0b('0x47')](_0x54aa9b['model'],_0x54aa9b[_0x0f0b('0x44')]);_0x394c94[_0x0f0b('0x48')]=_[_0x0f0b('0x47')](_0x54aa9b[_0x0f0b('0x43')],qs[_0x0f0b('0x49')](_0x1d8a21[_0x0f0b('0x44')][_0x0f0b('0x49')]));_0x394c94[_0x0f0b('0x48')]=_0x394c94[_0x0f0b('0x48')]['length']?_0x394c94[_0x0f0b('0x48')]:_0x54aa9b[_0x0f0b('0x43')];if(!_0x1d8a21[_0x0f0b('0x44')][_0x0f0b('0x4b')](_0x0f0b('0x4c'))){_0x394c94['limit']=qs[_0x0f0b('0x2e')](_0x1d8a21['query']['limit']);_0x394c94['offset']=qs['offset'](_0x1d8a21[_0x0f0b('0x44')]['offset']);}_0x394c94[_0x0f0b('0x4d')]=qs[_0x0f0b('0x4e')](_0x1d8a21['query'][_0x0f0b('0x4e')]);_0x394c94[_0x0f0b('0x4f')]=qs[_0x0f0b('0x46')](_['pick'](_0x1d8a21['query'],_0x54aa9b[_0x0f0b('0x46')]));_0x394c94[_0x0f0b('0x4f')][_0x0f0b('0x66')]=_0x4a7126['id'];if(_0x1d8a21[_0x0f0b('0x44')][_0x0f0b('0x50')]){_0x394c94[_0x0f0b('0x4f')]=_['merge'](_0x394c94[_0x0f0b('0x4f')],{'$or':_[_0x0f0b('0x3d')](_0x394c94['attributes'],function(_0x596c5e){var _0x9f0651={};_0x9f0651[_0x596c5e]={'$like':'%'+_0x1d8a21[_0x0f0b('0x44')][_0x0f0b('0x50')]+'%'};return _0x9f0651;})});}_0x394c94=_[_0x0f0b('0x52')]({},_0x394c94,_0x1d8a21[_0x0f0b('0x53')]);return db[_0x0f0b('0x6e')][_0x0f0b('0x2d')]({'where':_0x394c94[_0x0f0b('0x4f')]})[_0x0f0b('0x1d')](function(_0x3ab599){_0x3b85ba[_0x0f0b('0x2d')]=_0x3ab599;if(_0x1d8a21['query'][_0x0f0b('0x54')]){_0x394c94[_0x0f0b('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0f0b('0x56')](_0x394c94);})[_0x0f0b('0x1d')](function(_0x34e627){_0x3b85ba['rows']=_0x34e627;return _0x3b85ba;});}})[_0x0f0b('0x1d')](respondWithFilteredResult(_0x400aea,_0x394c94))[_0x0f0b('0x27')](handleError(_0x400aea,null));};exports[_0x0f0b('0x6f')]=function(_0x5ba93b,_0x24f102,_0x717be2){return db['WhatsappAccount'][_0x0f0b('0x5a')]({'where':{'id':_0x5ba93b[_0x0f0b('0x59')]['id']}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x24f102,null))[_0x0f0b('0x1d')](function(_0x5972b5){if(_0x5972b5){return _0x5972b5[_0x0f0b('0x6f')](_0x5ba93b[_0x0f0b('0x44')][_0x0f0b('0x6a')]);}})[_0x0f0b('0x1d')](respondWithStatusCode(_0x24f102,null))[_0x0f0b('0x27')](handleError(_0x24f102,null));};exports[_0x0f0b('0x70')]=function(_0x1f5e03,_0x209236,_0x123104){return db[_0x0f0b('0x3e')]['find']({'where':{'id':_0x1f5e03['params']['id']}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x209236,null))[_0x0f0b('0x1d')](function(_0x465b3d){if(_0x465b3d){return _0x465b3d[_0x0f0b('0x70')](_0x1f5e03[_0x0f0b('0x5c')][_0x0f0b('0x6a')],_[_0x0f0b('0x71')](_0x1f5e03[_0x0f0b('0x5c')],[_0x0f0b('0x6a'),'id'])||{})[_0x0f0b('0x72')](function(_0x2561e6){for(var _0x40c121=0x0;_0x40c121<_0x1f5e03[_0x0f0b('0x5c')][_0x0f0b('0x6a')][_0x0f0b('0x4a')];_0x40c121+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x1f5e03[_0x0f0b('0x5c')]['ids'][_0x40c121]),'WhatsappAccountId':Number(_0x1f5e03[_0x0f0b('0x59')]['id'])});}return _0x2561e6;});}})[_0x0f0b('0x1d')](respondWithResult(_0x209236,null))['catch'](handleError(_0x209236,null));};exports['removeAgents']=function(_0x3c3f00,_0x54fe4d,_0x43248e){return db[_0x0f0b('0x3e')][_0x0f0b('0x5a')]({'where':{'id':_0x3c3f00[_0x0f0b('0x59')]['id']}})['then'](handleEntityNotFound(_0x54fe4d,null))[_0x0f0b('0x1d')](function(_0x2ccb21){if(_0x2ccb21){return _0x2ccb21[_0x0f0b('0x73')](_0x3c3f00['query'][_0x0f0b('0x6a')])[_0x0f0b('0x1d')](function(){if(_[_0x0f0b('0x74')](_0x3c3f00['query'][_0x0f0b('0x6a')])){for(var _0x246681=0x0;_0x246681<_0x3c3f00['query']['ids']['length'];_0x246681+=0x1){socket[_0x0f0b('0x75')](_0x0f0b('0x76'),{'UserId':Number(_0x3c3f00[_0x0f0b('0x44')][_0x0f0b('0x6a')][_0x246681]),'WhatsappAccountId':Number(_0x3c3f00[_0x0f0b('0x59')]['id'])});}}else{socket['emit'](_0x0f0b('0x76'),{'UserId':Number(_0x3c3f00[_0x0f0b('0x44')][_0x0f0b('0x6a')]),'WhatsappAccountId':Number(_0x3c3f00[_0x0f0b('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x54fe4d,null))[_0x0f0b('0x27')](handleError(_0x54fe4d,null));};exports[_0x0f0b('0x77')]=function(_0x2518b4,_0x12f8eb,_0x261598){var _0x5c206c={};var _0x175fe2={};var _0x41b980;var _0x359d36;return db['WhatsappAccount'][_0x0f0b('0x6d')]({'where':{'id':_0x2518b4[_0x0f0b('0x59')]['id']}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x12f8eb,null))[_0x0f0b('0x1d')](function(_0x763fd){if(_0x763fd){_0x41b980=_0x763fd;_0x175fe2['model']=_['keys'](db[_0x0f0b('0x78')][_0x0f0b('0x3f')]);_0x175fe2[_0x0f0b('0x44')]=_[_0x0f0b('0x45')](_0x2518b4['query']);_0x175fe2[_0x0f0b('0x46')]=_[_0x0f0b('0x47')](_0x175fe2[_0x0f0b('0x43')],_0x175fe2['query']);_0x5c206c[_0x0f0b('0x48')]=_['intersection'](_0x175fe2['model'],qs[_0x0f0b('0x49')](_0x2518b4[_0x0f0b('0x44')][_0x0f0b('0x49')]));_0x5c206c['attributes']=_0x5c206c[_0x0f0b('0x48')][_0x0f0b('0x4a')]?_0x5c206c[_0x0f0b('0x48')]:_0x175fe2['model'];_0x5c206c['order']=qs[_0x0f0b('0x4e')](_0x2518b4[_0x0f0b('0x44')][_0x0f0b('0x4e')]);_0x5c206c[_0x0f0b('0x4f')]=qs[_0x0f0b('0x46')](_[_0x0f0b('0x67')](_0x2518b4[_0x0f0b('0x44')],_0x175fe2[_0x0f0b('0x46')]));if(_0x2518b4[_0x0f0b('0x44')][_0x0f0b('0x50')]){_0x5c206c[_0x0f0b('0x4f')]=_['merge'](_0x5c206c[_0x0f0b('0x4f')],{'$or':_['map'](_0x5c206c[_0x0f0b('0x48')],function(_0x2e6243){var _0x5b5c52={};_0x5b5c52[_0x2e6243]={'$like':'%'+_0x2518b4[_0x0f0b('0x44')][_0x0f0b('0x50')]+'%'};return _0x5b5c52;})});}_0x5c206c=_[_0x0f0b('0x52')]({},_0x5c206c,_0x2518b4[_0x0f0b('0x53')]);return _0x41b980['getAgents'](_0x5c206c);}})[_0x0f0b('0x1d')](function(_0x5c44b4){if(_0x5c44b4){_0x359d36=_0x5c44b4[_0x0f0b('0x4a')];if(!_0x2518b4[_0x0f0b('0x44')][_0x0f0b('0x4b')](_0x0f0b('0x4c'))){_0x5c206c[_0x0f0b('0x2e')]=qs[_0x0f0b('0x2e')](_0x2518b4['query'][_0x0f0b('0x2e')]);_0x5c206c['offset']=qs[_0x0f0b('0x2b')](_0x2518b4['query'][_0x0f0b('0x2b')]);}return _0x41b980[_0x0f0b('0x77')](_0x5c206c);}})[_0x0f0b('0x1d')](function(_0x113921){if(_0x113921){return _0x113921?{'count':_0x359d36,'rows':_0x113921}:null;}})[_0x0f0b('0x1d')](respondWithResult(_0x12f8eb,null))[_0x0f0b('0x27')](handleError(_0x12f8eb,null));};exports[_0x0f0b('0x79')]=function(_0x483e9b,_0x8629){var _0x4ed2fd=_0x483e9b[_0x0f0b('0x59')]['id'];var _0x3a843f=_0x483e9b['body'];var _0x4d2319=0xc8;var _0x531579=null;return db[_0x0f0b('0x7a')][_0x0f0b('0x7b')]({'isolationLevel':db[_0x0f0b('0x7a')]['Transaction'][_0x0f0b('0x7c')][_0x0f0b('0x7d')]},function(_0x5d4860){return db[_0x0f0b('0x3e')]['findOne']({'where':{'id':_0x4ed2fd},'transaction':_0x5d4860})[_0x0f0b('0x1d')](function(_0x2ebe31){if(_0x2ebe31){return db[_0x0f0b('0x7e')][_0x0f0b('0x34')]({'where':{'WhatsappAccountId':_0x4ed2fd},'transaction':_0x5d4860})[_0x0f0b('0x1d')](function(){var _0x8f5a2e=_[_0x0f0b('0x3d')](_0x3a843f,function(_0x28909c){_0x28909c[_0x0f0b('0x66')]=_0x4ed2fd;return _0x28909c;});return db[_0x0f0b('0x7e')]['bulkCreate'](_0x8f5a2e,{'transaction':_0x5d4860});});}else{_0x4d2319=0x194;_0x531579=[];}});})['then'](function(){if(_0x4d2319!==0x194){return db['WhatsappApplication'][_0x0f0b('0x7f')]({'where':{'WhatsappAccountId':_0x4ed2fd},'order':_0x0f0b('0x80')})['then'](function(_0x281b43){_0x531579=_0x281b43;});}})['catch'](function(_0x435362){_0x4d2319=0x1f4;logger['error'](_0x435362[_0x0f0b('0x37')]);if(_0x435362[_0x0f0b('0x38')]){delete _0x435362[_0x0f0b('0x38')];}_0x531579=_0x435362;})[_0x0f0b('0x81')](function(){if(_0x531579===null){_0x8629[_0x0f0b('0x28')](_0x4d2319);}else{if(_0x4d2319===0x1f4){_0x8629[_0x0f0b('0x29')](_0x4d2319)['send'](_0x531579);}else{_0x8629[_0x0f0b('0x29')](_0x4d2319)[_0x0f0b('0x30')](_0x531579);}}});};exports['getApplications']=function(_0x275c71,_0x2e2fa9,_0x1d3bd1){var _0x39ba2c={};var _0x3ace58={};var _0x1bc7dc;var _0x3341af;return db['WhatsappAccount'][_0x0f0b('0x6d')]({'where':{'id':_0x275c71[_0x0f0b('0x59')]['id']}})['then'](handleEntityNotFound(_0x2e2fa9,null))[_0x0f0b('0x1d')](function(_0x24eed0){if(_0x24eed0){_0x1bc7dc=_0x24eed0;_0x3ace58[_0x0f0b('0x43')]=_[_0x0f0b('0x45')](db['WhatsappApplication'][_0x0f0b('0x3f')]);_0x3ace58[_0x0f0b('0x44')]=_['keys'](_0x275c71['query']);_0x3ace58[_0x0f0b('0x46')]=_['intersection'](_0x3ace58[_0x0f0b('0x43')],_0x3ace58['query']);_0x39ba2c['attributes']=_[_0x0f0b('0x47')](_0x3ace58['model'],qs[_0x0f0b('0x49')](_0x275c71['query'][_0x0f0b('0x49')]));_0x39ba2c[_0x0f0b('0x48')]=_0x39ba2c[_0x0f0b('0x48')]['length']?_0x39ba2c['attributes']:_0x3ace58[_0x0f0b('0x43')];_0x39ba2c['order']=qs[_0x0f0b('0x4e')](_0x275c71[_0x0f0b('0x44')][_0x0f0b('0x4e')]);_0x39ba2c[_0x0f0b('0x4f')]=qs['filters'](_[_0x0f0b('0x67')](_0x275c71['query'],_0x3ace58[_0x0f0b('0x46')]));if(_0x275c71[_0x0f0b('0x44')][_0x0f0b('0x50')]){_0x39ba2c[_0x0f0b('0x4f')]=_[_0x0f0b('0x52')](_0x39ba2c['where'],{'$or':_[_0x0f0b('0x3d')](_0x39ba2c[_0x0f0b('0x48')],function(_0x2f54f7){var _0xb09c68={};_0xb09c68[_0x2f54f7]={'$like':'%'+_0x275c71[_0x0f0b('0x44')][_0x0f0b('0x50')]+'%'};return _0xb09c68;})});}_0x39ba2c=_[_0x0f0b('0x52')]({},_0x39ba2c,_0x275c71[_0x0f0b('0x53')]);return _0x1bc7dc[_0x0f0b('0x82')](_0x39ba2c);}})['then'](function(_0x47fa36){if(_0x47fa36){_0x3341af=_0x47fa36['length'];if(!_0x275c71[_0x0f0b('0x44')]['hasOwnProperty'](_0x0f0b('0x4c'))){_0x39ba2c[_0x0f0b('0x2e')]=qs[_0x0f0b('0x2e')](_0x275c71[_0x0f0b('0x44')][_0x0f0b('0x2e')]);_0x39ba2c[_0x0f0b('0x2b')]=qs[_0x0f0b('0x2b')](_0x275c71[_0x0f0b('0x44')][_0x0f0b('0x2b')]);}return _0x1bc7dc['getApplications'](_0x39ba2c);}})['then'](function(_0x20ee42){if(_0x20ee42){return _0x20ee42?{'count':_0x3341af,'rows':_0x20ee42}:null;}})[_0x0f0b('0x1d')](respondWithResult(_0x2e2fa9,null))[_0x0f0b('0x27')](handleError(_0x2e2fa9,null));};exports[_0x0f0b('0x83')]=function(_0x21f8e7,_0x1476a7,_0x1f0eec){var _0x38b5ba={'channel':_0x0f0b('0x84')};var _0x26e06b=[];var _0x387000=[];var _0x233aa8={};return db[_0x0f0b('0x3e')][_0x0f0b('0x5a')]({'where':{'id':_0x21f8e7[_0x0f0b('0x59')]['id']},'include':[{'model':db[_0x0f0b('0x7e')],'as':'Applications'}]})[_0x0f0b('0x1d')](handleEntityNotFound(_0x1476a7,null))[_0x0f0b('0x1d')](function(_0x207d78){_0x38b5ba['account']=_0x207d78;if(_0x38b5ba[_0x0f0b('0x85')]&&_0x38b5ba[_0x0f0b('0x85')][_0x0f0b('0x41')]===_0x0f0b('0x86')&&_0x21f8e7[_0x0f0b('0x5c')][_0x0f0b('0x87')]){if(_0x21f8e7[_0x0f0b('0x5c')][_0x0f0b('0x87')][_0x0f0b('0x4a')]===0x0)return;if(_0x21f8e7[_0x0f0b('0x5c')]['statuses'][0x0][_0x0f0b('0x88')]!==_0x0f0b('0x89'))return;return db[_0x0f0b('0x8a')][_0x0f0b('0x33')]({'read':!![],'readAt':_0x21f8e7[_0x0f0b('0x5c')]['statuses'][0x0][_0x0f0b('0x8b')]},{'where':{'messageId':_0x21f8e7['body']['statuses'][0x0][_0x0f0b('0x8c')]},'individualHooks':!![]})['then'](function(_0x5cac7a){return _0x1476a7[_0x0f0b('0x29')](0xc8)['json'](_0x5cac7a);});}_0x38b5ba['applications']=_[_0x0f0b('0x8d')](_0x207d78['Applications'],['priority'],[_0x0f0b('0x8e')]);if(_0x38b5ba[_0x0f0b('0x85')][_0x0f0b('0x8f')]){delete _0x38b5ba[_0x0f0b('0x85')][_0x0f0b('0x8f')];}return db[_0x0f0b('0x90')][_0x0f0b('0x64')]()[_0x0f0b('0x1d')](function(_0x160fbc){if(!_0x160fbc){throw new db[(_0x0f0b('0x91'))][(_0x0f0b('0x92'))](_0x0f0b('0x93'));}_0x26e06b=_['difference'](_[_0x0f0b('0x45')](_0x160fbc),[_0x0f0b('0x94'),_0x0f0b('0x95')]);_0x387000=_[_0x0f0b('0x96')](_[_0x0f0b('0x45')](_0x160fbc),[_0x0f0b('0x94'),_0x0f0b('0x95'),'CompanyId',_0x0f0b('0x97')]);_0x38b5ba[_0x0f0b('0x5c')]={'mapKey':'mobile'};if(_0x38b5ba[_0x0f0b('0x85')]&&_0x38b5ba[_0x0f0b('0x85')][_0x0f0b('0x41')]===_0x0f0b('0x98')){_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x99')]=_0x21f8e7[_0x0f0b('0x5c')][_0x0f0b('0x9a')]['replace'](_0x0f0b('0x9b'),'');_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x5c')]=_0x21f8e7[_0x0f0b('0x5c')][_0x0f0b('0x9c')];_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x9d')]=_0x21f8e7['body'][_0x0f0b('0x9e')];}if(_0x38b5ba[_0x0f0b('0x85')]&&_0x38b5ba[_0x0f0b('0x85')][_0x0f0b('0x41')]===_0x0f0b('0x86')){_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x99')]=_0x21f8e7[_0x0f0b('0x5c')]['notifications'][0x0][_0x0f0b('0x99')];_0x38b5ba[_0x0f0b('0x5c')]['body']=_0x21f8e7[_0x0f0b('0x5c')][_0x0f0b('0x9f')][0x0][_0x0f0b('0x25')]['body'];_0x38b5ba[_0x0f0b('0x5c')]['messageId']=_0x21f8e7[_0x0f0b('0x5c')][_0x0f0b('0x9f')][0x0][_0x0f0b('0x8c')];}if(_0x38b5ba[_0x0f0b('0x5c')]['id']){delete _0x38b5ba[_0x0f0b('0x5c')]['id'];}if(_[_0x0f0b('0xa0')](_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x99')])){throw new db['Sequelize'][(_0x0f0b('0x92'))](_0x0f0b('0xa1'));}if(_[_0x0f0b('0xa0')](_0x38b5ba[_0x0f0b('0x5c')]['body'])||_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x5c')]===''){throw new db[(_0x0f0b('0x91'))][(_0x0f0b('0x92'))](_0x0f0b('0xa2'));}if(_[_0x0f0b('0xa0')](_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0xa3')])){throw new db[(_0x0f0b('0x91'))][(_0x0f0b('0x92'))](_0x0f0b('0xa4')+_0x387000);}if(!_[_0x0f0b('0xa5')](_0x387000,_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0xa3')])){throw new db[(_0x0f0b('0x91'))]['ValidationError'](_0x0f0b('0xa6')+_0x387000);}_0x233aa8[_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0xa3')]]=_0x38b5ba[_0x0f0b('0x5c')]['from'];return db[_0x0f0b('0xa7')][_0x0f0b('0x5a')]({'where':{'id':_0x38b5ba[_0x0f0b('0x85')]['ListId']},'include':[{'model':db[_0x0f0b('0x90')],'as':_0x0f0b('0xa8'),'where':_0x233aa8,'limit':0x1,'order':[[_0x0f0b('0x95'),_0x0f0b('0xa9')]]}]});})[_0x0f0b('0x1d')](handleEntityNotFound(_0x1476a7,null))[_0x0f0b('0x1d')](function(_0x376504){if(_0x376504){_0x38b5ba['list']=_[_0x0f0b('0x71')](_0x376504,[_0x0f0b('0xa8')]);if(_0x376504['Contacts'][_0x0f0b('0x4a')]){return _0x376504['Contacts'][0x0];}var _0x47b52d=_[_0x0f0b('0xaa')](_0x38b5ba['body'],{'firstName':_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x99')],'ListId':_0x376504['id']});_0x47b52d[_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0xa3')]]=_0x38b5ba['body'][_0x0f0b('0x99')];return db[_0x0f0b('0x90')][_0x0f0b('0x5b')](_0x47b52d,{'fields':_0x26e06b,'raw':!![]});}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x1476a7,null))[_0x0f0b('0x1d')](function(_0x3095b2){if(_0x3095b2){_0x38b5ba['contact']=_0x3095b2;var _0x1d2c72={'ContactId':_0x3095b2['id'],'phone':_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x99')],'WhatsappAccountId':_0x21f8e7[_0x0f0b('0x59')]['id']};var _0x3fdf17={'ContactId':_0x3095b2['id'],'WhatsappAccountId':_0x21f8e7['params']['id'],'closed':![]};return db['WhatsappInteraction'][_0x0f0b('0x5a')]({'where':_0x3fdf17})[_0x0f0b('0x1d')](function(_0x5019d8){if(_0x5019d8){return[_0x5019d8,![]];}return db[_0x0f0b('0xab')]['create'](_0x1d2c72)[_0x0f0b('0x1d')](function(_0xc74188){return[_0xc74188,!![]];});});}})['spread'](function(_0x2a8e88,_0x39d411){_0x38b5ba[_0x0f0b('0xac')]=_0x2a8e88[_0x0f0b('0x60')]({'plain':!![]});_0x38b5ba[_0x0f0b('0xac')][_0x0f0b('0xad')]=![];if(_0x39d411){if(_0x38b5ba['account'][_0x0f0b('0xae')]){_0x38b5ba['applications'][_0x0f0b('0xaf')]({'id':0x0,'priority':_0x38b5ba['applications'][_0x0f0b('0x4a')]+0x1,'app':_0x0f0b('0xb0'),'appdata':_0x0f0b('0xb1'),'interval':'*,*,*,*'});}_0x38b5ba[_0x0f0b('0xac')][_0x0f0b('0xad')]=!![];}return db[_0x0f0b('0x8a')][_0x0f0b('0x5b')]({'phone':_0x38b5ba['body'][_0x0f0b('0x99')],'messageId':_0x38b5ba[_0x0f0b('0x5c')]['messageId'],'body':_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0x5c')],'WhatsappAccountId':_0x21f8e7['params']['id'],'WhatsappInteractionId':_0x2a8e88['id'],'direction':'in','ContactId':_0x2a8e88['ContactId'],'AttachmentId':_0x38b5ba[_0x0f0b('0x5c')][_0x0f0b('0xb2')]});})['then'](function(_0x537eb5){_0x38b5ba['message']=_0x537eb5;if(!_0x38b5ba[_0x0f0b('0xac')][_0x0f0b('0xb3')])return;return db[_0x0f0b('0x78')][_0x0f0b('0x5a')]({'attributes':['id',_0x0f0b('0x38')],'where':{'id':_0x38b5ba[_0x0f0b('0xac')]['UserId']}});})[_0x0f0b('0x1d')](function(_0x1a4af6){if(_0x1a4af6){_0x38b5ba['applications'][_0x0f0b('0xb4')]({'id':0x0,'priority':0x0,'app':_0x0f0b('0xb5'),'appdata':_0x1a4af6[_0x0f0b('0x38')]+','+(_0x38b5ba[_0x0f0b('0x85')][_0x0f0b('0xb6')]||0xa),'interval':'*,*,*,*'});}if(!_0x38b5ba[_0x0f0b('0xac')][_0x0f0b('0xb7')])return;return db[_0x0f0b('0xb8')][_0x0f0b('0x5a')]({'attributes':['id',_0x0f0b('0x38')],'where':{'id':_0x38b5ba[_0x0f0b('0xac')][_0x0f0b('0xb7')]}});})[_0x0f0b('0x1d')](function(_0x2a35fb){if(_0x2a35fb){_0x38b5ba[_0x0f0b('0xb9')][_0x0f0b('0xb4')]({'id':0x0,'priority':0x1,'app':_0x0f0b('0xba'),'appdata':_0x2a35fb['name']+','+(_0x38b5ba['account'][_0x0f0b('0xbb')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0f0b('0xbc'),_0x0f0b('0xbd'),_0x38b5ba);})[_0x0f0b('0x1d')](function(_0x29f990){if(_0x29f990){var _0x1520e5=0xc8;var _0x59ea16=_0x0f0b('0xbe');logger[_0x0f0b('0x1e')](_0x0f0b('0x21'),_0x59ea16,_0x1520e5,_0x0f0b('0xbf'));logger[_0x0f0b('0xc0')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x59ea16,_0x1520e5,_0x0f0b('0xbf'),JSON[_0x0f0b('0x22')](_0x29f990));if(_0x38b5ba['account'][_0x0f0b('0x41')]==='twilio'){return _0x1476a7[_0x0f0b('0x29')](_0x1520e5)['set'](_0x0f0b('0xc1'),_0x0f0b('0xc2'))[_0x0f0b('0x39')](_0x0f0b('0xc3'));}else{return _0x1476a7[_0x0f0b('0x29')](_0x1520e5)[_0x0f0b('0x30')](_0x29f990);}}});})[_0x0f0b('0x27')](handleError(_0x1476a7,null));};exports['send']=function(_0x285563,_0x42d6b5,_0x4714cb){var _0x29555f,_0x3a7037,_0x3f52d6;if(_[_0x0f0b('0xa0')](_0x285563[_0x0f0b('0x5c')][_0x0f0b('0x5c')])||_0x285563['body']['body']===''){throw new db[(_0x0f0b('0x91'))][(_0x0f0b('0x92'))](_0x0f0b('0xa2'));}if(_['isNil'](_0x285563[_0x0f0b('0x5c')]['to'])){throw new db['Sequelize'][(_0x0f0b('0x92'))](_0x0f0b('0xc4'));}_0x29555f=_0x285563[_0x0f0b('0x5c')]['to'];return db[_0x0f0b('0x3e')][_0x0f0b('0x5a')]({'where':{'id':_0x285563[_0x0f0b('0x59')]['id']},'include':[{'model':db[_0x0f0b('0xa7')],'as':_0x0f0b('0xc5'),'include':[{'model':db['CmContact'],'as':_0x0f0b('0xa8'),'where':{'mobile':_0x29555f},'limit':0x1,'order':[[_0x0f0b('0x95'),_0x0f0b('0xa9')]]}]}]})[_0x0f0b('0x1d')](handleEntityNotFound(_0x42d6b5,null))['then'](function(_0x1a1026){if(_0x1a1026&&_0x1a1026[_0x0f0b('0xc5')]){_0x3a7037=_0x1a1026[_0x0f0b('0x60')]({'plain':!![]});if(_0x3a7037['List']&&_0x3a7037[_0x0f0b('0xc5')][_0x0f0b('0xa8')][_0x0f0b('0x4a')]){return _0x3a7037[_0x0f0b('0xc5')][_0x0f0b('0xa8')][0x0];}return db[_0x0f0b('0x90')][_0x0f0b('0x5b')](_[_0x0f0b('0xaa')](_0x285563[_0x0f0b('0x5c')],{'firstName':_0x29555f,'mobile':_0x29555f,'phone':_0x29555f,'ListId':_0x3a7037[_0x0f0b('0x97')]}));}})[_0x0f0b('0x1d')](handleEntityNotFound(_0x42d6b5,null))['then'](function(_0x47ca83){if(_0x47ca83){_0x3f52d6=_0x47ca83;return db[_0x0f0b('0xab')][_0x0f0b('0x5a')]({'where':{'ContactId':_0x3f52d6['id'],'closed':![],'WhatsappAccountId':_0x3a7037['id']}})[_0x0f0b('0x1d')](function(_0x1af766){if(_0x1af766){return[_0x1af766,![]];}return db['WhatsappInteraction'][_0x0f0b('0x5b')]({'UserId':_0x285563[_0x0f0b('0x5d')]['id'],'ContactId':_0x3f52d6['id'],'WhatsappAccountId':_0x3a7037['id'],'phone':_0x29555f,'firstMsgDirection':_0x0f0b('0xc6'),'Messages':[_['merge'](_0x285563[_0x0f0b('0x5c')],{'read':![],'body':_0x285563[_0x0f0b('0x5c')][_0x0f0b('0x5c')],'phone':_0x29555f,'WhatsappAccountId':_0x3a7037['id'],'UserId':_0x285563[_0x0f0b('0x5d')]['id'],'ContactId':_0x3f52d6['id']})]},{'include':[{'model':db[_0x0f0b('0x8a')],'as':_0x0f0b('0xc7')}]})['then'](function(_0x201643){return[_0x201643,!![]];});});}})[_0x0f0b('0x72')](function(_0x1637ac,_0x9cab6a){if(_0x9cab6a){return _0x1637ac;}return db[_0x0f0b('0x8a')][_0x0f0b('0x5b')](_[_0x0f0b('0x52')](_0x285563[_0x0f0b('0x5c')],{'read':![],'body':_0x285563[_0x0f0b('0x5c')][_0x0f0b('0x5c')],'phone':_0x29555f,'WhatsappAccountId':_0x3a7037['id'],'WhatsappInteractionId':_0x1637ac['id'],'UserId':_0x285563['user']['id'],'ContactId':_0x3f52d6['id']}))[_0x0f0b('0x1d')](function(_0x51fe71){_0x1637ac['dataValues'][_0x0f0b('0xc7')]=[];_0x1637ac[_0x0f0b('0xc8')][_0x0f0b('0xc7')]['push'](_0x51fe71[_0x0f0b('0xc8')]);return _0x1637ac;});})[_0x0f0b('0x1d')](respondWithResult(_0x42d6b5,null))[_0x0f0b('0x27')](handleError(_0x42d6b5,null));}; \ No newline at end of file +var _0x8101=['moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','request','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','sinch','statuses','timestamp','message_id','orderBy','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','replace','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','applications','push','close','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','WhatsappQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','set','text/xml','\x0a','to\x20is\x20mandatory','List','Messages','WhatsappMessage','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x38b163,_0x483c7a){var _0x5475e0=function(_0x1b487f){while(--_0x1b487f){_0x38b163['push'](_0x38b163['shift']());}};_0x5475e0(++_0x483c7a);}(_0x8101,0xc0));var _0x1810=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x8101[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x1810('0x0'));var rimraf=require(_0x1810('0x1'));var zipdir=require(_0x1810('0x2'));var jsonpatch=require(_0x1810('0x3'));var rp=require(_0x1810('0x4'));var moment=require(_0x1810('0x5'));var BPromise=require(_0x1810('0x6'));var Mustache=require(_0x1810('0x7'));var util=require(_0x1810('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x1810('0x9'));var ejs=require(_0x1810('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1810('0xb'));var squel=require(_0x1810('0xc'));var crypto=require(_0x1810('0xd'));var jsforce=require(_0x1810('0xe'));var deskjs=require(_0x1810('0xf'));var toCsv=require(_0x1810('0x9'));var querystring=require(_0x1810('0x10'));var Papa=require(_0x1810('0x11'));var Redis=require(_0x1810('0x12'));var authService=require(_0x1810('0x13'));var qs=require(_0x1810('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1810('0x15'));var logger=require(_0x1810('0x16'))('api');var utils=require(_0x1810('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1810('0x18'))['db'];config[_0x1810('0x19')]=_[_0x1810('0x1a')](config[_0x1810('0x19')],{'host':_0x1810('0x1b'),'port':0x18eb});var socket=require(_0x1810('0x1c'))(new Redis(config['redis']));require(_0x1810('0x1d'))[_0x1810('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1810('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x49d637,_0x187dca,_0xbdebf5,_0x282e1c){return new BPromise(function(_0x175025,_0x840343){var _0x2f08dd=_0x282e1c||client;return _0x2f08dd[_0x1810('0x20')](_0x49d637,_0xbdebf5)['then'](function(_0x5aea81){logger['info'](_0x1810('0x21'),_0x187dca,'request\x20sent');logger[_0x1810('0x22')](_0x1810('0x23'),_0x187dca,_0x1810('0x24'),JSON[_0x1810('0x25')](_0x5aea81));if(_0x5aea81['error']){if(_0x5aea81[_0x1810('0x26')]['code']===0x1f4){logger[_0x1810('0x26')](_0x1810('0x21'),_0x187dca,_0x5aea81['error'][_0x1810('0x27')]);return _0x840343(_0x5aea81[_0x1810('0x26')][_0x1810('0x27')]);}logger[_0x1810('0x26')](_0x1810('0x21'),_0x187dca,_0x5aea81[_0x1810('0x26')]['message']);return _0x175025(_0x5aea81[_0x1810('0x26')][_0x1810('0x27')]);}else{logger[_0x1810('0x28')](_0x1810('0x21'),_0x187dca,'request\x20sent');_0x175025(_0x5aea81[_0x1810('0x29')]['message']);}})['catch'](function(_0x788796){logger[_0x1810('0x26')](_0x1810('0x21'),_0x187dca,_0x788796);_0x840343(_0x788796);});});}function respondWithStatusCode(_0x23704c,_0x2b6da6){_0x2b6da6=_0x2b6da6||0xcc;return function(_0x543c65){if(_0x543c65){return _0x23704c[_0x1810('0x2a')](_0x2b6da6);}return _0x23704c[_0x1810('0x2b')](_0x2b6da6)[_0x1810('0x2c')]();};}function respondWithResult(_0x3b93c7,_0x523bb2){_0x523bb2=_0x523bb2||0xc8;return function(_0x4b3953){if(_0x4b3953){return _0x3b93c7[_0x1810('0x2b')](_0x523bb2)[_0x1810('0x2d')](_0x4b3953);}};}function respondWithFilteredResult(_0x302005,_0x9d0a22){return function(_0x2d387a){if(_0x2d387a){var _0xbac7da=typeof _0x9d0a22[_0x1810('0x2e')]===_0x1810('0x2f')&&typeof _0x9d0a22[_0x1810('0x30')]===_0x1810('0x2f');var _0x255c5a=_0x2d387a[_0x1810('0x31')];var _0x8f6e99=_0xbac7da?0x0:_0x9d0a22['offset'];var _0x380b00=_0xbac7da?_0x2d387a[_0x1810('0x31')]:_0x9d0a22[_0x1810('0x2e')]+_0x9d0a22[_0x1810('0x30')];var _0x2183cf;if(_0x380b00>=_0x255c5a){_0x380b00=_0x255c5a;_0x2183cf=0xc8;}else{_0x2183cf=0xce;}_0x302005[_0x1810('0x2b')](_0x2183cf);return _0x302005['set'](_0x1810('0x32'),_0x8f6e99+'-'+_0x380b00+'/'+_0x255c5a)[_0x1810('0x2d')](_0x2d387a);}return null;};}function patchUpdates(_0xb30cab){return function(_0x2958c0){try{jsonpatch[_0x1810('0x33')](_0x2958c0,_0xb30cab,!![]);}catch(_0x49ee34){return BPromise[_0x1810('0x34')](_0x49ee34);}return _0x2958c0[_0x1810('0x35')]();};}function saveUpdates(_0x440607,_0x49ad0f){return function(_0x1d2938){if(_0x1d2938){return _0x1d2938[_0x1810('0x36')](_0x440607)[_0x1810('0x37')](function(_0xb46b04){return _0xb46b04;});}return null;};}function removeEntity(_0x3c3d0a,_0x287181){return function(_0xaecd29){if(_0xaecd29){return _0xaecd29[_0x1810('0x38')]()[_0x1810('0x37')](function(){var _0x2ee69d=_0xaecd29[_0x1810('0x39')]({'plain':!![]});var _0x3b6606=_0x1810('0x3a');return db[_0x1810('0x3b')][_0x1810('0x38')]({'where':{'type':_0x3b6606,'resourceId':_0x2ee69d['id']}})['then'](function(){return _0xaecd29;});})[_0x1810('0x37')](function(){_0x3c3d0a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xbb39c2,_0x202888){return function(_0x509ea9){if(!_0x509ea9){_0xbb39c2[_0x1810('0x2a')](0x194);}return _0x509ea9;};}function handleError(_0x40ff54,_0x3f5e4c){_0x3f5e4c=_0x3f5e4c||0x1f4;return function(_0x345da0){logger[_0x1810('0x26')](_0x345da0[_0x1810('0x3c')]);if(_0x345da0[_0x1810('0x3d')]){delete _0x345da0['name'];}_0x40ff54[_0x1810('0x2b')](_0x3f5e4c)[_0x1810('0x3e')](_0x345da0);};}exports['index']=function(_0x560419,_0x2ccaad){var _0x569d55={'include':[{'model':db[_0x1810('0x3f')],'as':_0x1810('0x40')}]},_0x24e174={},_0x293d3e={'count':0x0,'rows':[]};var _0x3af7d2=_[_0x1810('0x41')](db[_0x1810('0x42')][_0x1810('0x43')],function(_0xc059d4){return{'name':_0xc059d4['fieldName'],'type':_0xc059d4[_0x1810('0x44')]['key']};});_0x24e174[_0x1810('0x45')]=_[_0x1810('0x41')](_0x3af7d2,_0x1810('0x3d'));_0x24e174[_0x1810('0x46')]=_[_0x1810('0x47')](_0x560419[_0x1810('0x46')]);_0x24e174[_0x1810('0x48')]=_[_0x1810('0x49')](_0x24e174[_0x1810('0x45')],_0x24e174[_0x1810('0x46')]);_0x569d55['attributes']=_[_0x1810('0x49')](_0x24e174[_0x1810('0x45')],qs[_0x1810('0x4a')](_0x560419['query'][_0x1810('0x4a')]));_0x569d55[_0x1810('0x4b')]=_0x569d55[_0x1810('0x4b')][_0x1810('0x4c')]?_0x569d55[_0x1810('0x4b')]:_0x24e174[_0x1810('0x45')];if(!_0x560419['query'][_0x1810('0x4d')](_0x1810('0x4e'))){_0x569d55[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x560419[_0x1810('0x46')]['limit']);_0x569d55[_0x1810('0x2e')]=qs[_0x1810('0x2e')](_0x560419[_0x1810('0x46')][_0x1810('0x2e')]);}_0x569d55[_0x1810('0x4f')]=qs[_0x1810('0x50')](_0x560419[_0x1810('0x46')][_0x1810('0x50')]);_0x569d55[_0x1810('0x51')]=qs[_0x1810('0x48')](_[_0x1810('0x52')](_0x560419['query'],_0x24e174[_0x1810('0x48')]),_0x3af7d2);if(_0x560419['query'][_0x1810('0x53')]){_0x569d55['where']=_[_0x1810('0x54')](_0x569d55[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x3af7d2,function(_0x2f3c21){if(_0x2f3c21[_0x1810('0x44')]!==_0x1810('0x55')){var _0x40b011={};_0x40b011[_0x2f3c21[_0x1810('0x3d')]]={'$like':'%'+_0x560419[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x40b011;}})});}_0x569d55=_[_0x1810('0x54')]({},_0x569d55,_0x560419[_0x1810('0x56')]);var _0x4bb93f={'where':_0x569d55['where']};return db[_0x1810('0x42')]['count'](_0x4bb93f)[_0x1810('0x37')](function(_0x3d6688){_0x293d3e['count']=_0x3d6688;if(_0x560419['query'][_0x1810('0x57')]){_0x569d55[_0x1810('0x58')]=[{'all':!![]}];}return db[_0x1810('0x42')][_0x1810('0x59')](_0x569d55);})[_0x1810('0x37')](function(_0x49e1f7){_0x293d3e[_0x1810('0x5a')]=_0x49e1f7;return _0x293d3e;})[_0x1810('0x37')](respondWithFilteredResult(_0x2ccaad,_0x569d55))[_0x1810('0x5b')](handleError(_0x2ccaad,null));};exports[_0x1810('0x5c')]=function(_0x425f2f,_0x3ece6d){var _0x27a8b1={'raw':![],'where':{'id':_0x425f2f[_0x1810('0x5d')]['id']},'include':[{'model':db[_0x1810('0x3f')],'as':_0x1810('0x40')}]},_0x25d609={};_0x25d609['model']=_[_0x1810('0x47')](db[_0x1810('0x42')][_0x1810('0x43')]);_0x25d609[_0x1810('0x46')]=_['keys'](_0x425f2f[_0x1810('0x46')]);_0x25d609[_0x1810('0x48')]=_['intersection'](_0x25d609[_0x1810('0x45')],_0x25d609['query']);_0x27a8b1['attributes']=_[_0x1810('0x49')](_0x25d609['model'],qs[_0x1810('0x4a')](_0x425f2f[_0x1810('0x46')][_0x1810('0x4a')]));_0x27a8b1[_0x1810('0x4b')]=_0x27a8b1[_0x1810('0x4b')][_0x1810('0x4c')]?_0x27a8b1[_0x1810('0x4b')]:_0x25d609[_0x1810('0x45')];if(_0x425f2f[_0x1810('0x46')][_0x1810('0x57')]){_0x27a8b1[_0x1810('0x58')]=[{'all':!![]}];}_0x27a8b1=_['merge']({},_0x27a8b1,_0x425f2f['options']);return db['WhatsappAccount'][_0x1810('0x5e')](_0x27a8b1)[_0x1810('0x37')](handleEntityNotFound(_0x3ece6d,null))[_0x1810('0x37')](respondWithResult(_0x3ece6d,null))['catch'](handleError(_0x3ece6d,null));};exports[_0x1810('0x5f')]=function(_0xf7b311,_0x555b5d){return db[_0x1810('0x42')][_0x1810('0x5f')](_0xf7b311[_0x1810('0x60')],{})['then'](function(_0x51873e){var _0x1450d5=_0xf7b311[_0x1810('0x61')][_0x1810('0x39')]({'plain':!![]});if(!_0x1450d5)throw new Error(_0x1810('0x62'));if(_0x1450d5[_0x1810('0x63')]==='user'){var _0x399ae2=_0x51873e['get']({'plain':!![]});var _0xa6b963='WhatsappAccounts';return db[_0x1810('0x64')][_0x1810('0x5e')]({'where':{'name':_0xa6b963,'userProfileId':_0x1450d5['userProfileId']},'raw':!![]})[_0x1810('0x37')](function(_0x59bea6){if(_0x59bea6&&_0x59bea6[_0x1810('0x65')]===0x0){return db[_0x1810('0x3b')][_0x1810('0x5f')]({'name':_0x399ae2[_0x1810('0x3d')],'resourceId':_0x399ae2['id'],'type':_0x59bea6[_0x1810('0x3d')],'sectionId':_0x59bea6['id']},{})['then'](function(){return _0x51873e;});}else{return _0x51873e;}})[_0x1810('0x5b')](function(_0x39c360){logger['error'](_0x1810('0x66'),_0x39c360);throw _0x39c360;});}return _0x51873e;})['then'](respondWithResult(_0x555b5d,0xc9))[_0x1810('0x5b')](handleError(_0x555b5d,null));};exports[_0x1810('0x36')]=function(_0x116287,_0x378a0a){if(_0x116287[_0x1810('0x60')]['id']){delete _0x116287['body']['id'];}return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x116287['params']['id']},'include':[{'model':db[_0x1810('0x3f')],'as':_0x1810('0x40')}]})[_0x1810('0x37')](handleEntityNotFound(_0x378a0a,null))[_0x1810('0x37')](saveUpdates(_0x116287[_0x1810('0x60')],null))[_0x1810('0x37')](respondWithResult(_0x378a0a,null))[_0x1810('0x5b')](handleError(_0x378a0a,null));};exports[_0x1810('0x38')]=function(_0x29ac7e,_0x41eaef){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x29ac7e[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x41eaef,null))[_0x1810('0x37')](removeEntity(_0x41eaef,null))['catch'](handleError(_0x41eaef,null));};exports[_0x1810('0x67')]=function(_0x21150c,_0x463074){return db[_0x1810('0x42')][_0x1810('0x67')]()[_0x1810('0x37')](respondWithResult(_0x463074,null))['catch'](handleError(_0x463074,null));};exports[_0x1810('0x68')]=function(_0x35c92a,_0x3f2e45,_0x5d74b8){if(_0x35c92a[_0x1810('0x60')]['id']){delete _0x35c92a['body']['id'];}return db[_0x1810('0x42')]['find']({'where':{'id':_0x35c92a[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x3f2e45,null))['then'](function(_0x39051b){if(_0x39051b){_0x35c92a[_0x1810('0x60')][_0x1810('0x69')]=_0x39051b['id'];return db[_0x1810('0x6a')][_0x1810('0x5f')](_0x35c92a[_0x1810('0x60')]);}})[_0x1810('0x37')](respondWithResult(_0x3f2e45,null))['catch'](handleError(_0x3f2e45,null));};exports[_0x1810('0x6b')]=function(_0x4ca1ac,_0x4b7067,_0x45efe3){var _0x5c59f9={'raw':![],'where':{}};var _0x3dba05={};var _0xc86140={'count':0x0,'rows':[]};return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x4ca1ac[_0x1810('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4b7067,null))['then'](function(_0x3a93ec){if(_0x3a93ec){_0x3dba05[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x6a')]['rawAttributes']);_0x3dba05[_0x1810('0x46')]=_[_0x1810('0x47')](_0x4ca1ac['query']);_0x3dba05[_0x1810('0x48')]=_['intersection'](_0x3dba05[_0x1810('0x45')],_0x3dba05[_0x1810('0x46')]);_0x5c59f9['attributes']=_['intersection'](_0x3dba05['model'],qs[_0x1810('0x4a')](_0x4ca1ac['query'][_0x1810('0x4a')]));_0x5c59f9['attributes']=_0x5c59f9['attributes'][_0x1810('0x4c')]?_0x5c59f9[_0x1810('0x4b')]:_0x3dba05[_0x1810('0x45')];if(!_0x4ca1ac[_0x1810('0x46')][_0x1810('0x4d')](_0x1810('0x4e'))){_0x5c59f9[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x4ca1ac['query'][_0x1810('0x30')]);_0x5c59f9[_0x1810('0x2e')]=qs['offset'](_0x4ca1ac[_0x1810('0x46')][_0x1810('0x2e')]);}_0x5c59f9[_0x1810('0x4f')]=qs[_0x1810('0x50')](_0x4ca1ac['query'][_0x1810('0x50')]);_0x5c59f9['where']=qs[_0x1810('0x48')](_[_0x1810('0x52')](_0x4ca1ac[_0x1810('0x46')],_0x3dba05['filters']));_0x5c59f9['where'][_0x1810('0x69')]=_0x3a93ec['id'];if(_0x4ca1ac[_0x1810('0x46')][_0x1810('0x53')]){_0x5c59f9[_0x1810('0x51')]=_[_0x1810('0x54')](_0x5c59f9[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x5c59f9[_0x1810('0x4b')],function(_0x46062e){var _0x17e02b={};_0x17e02b[_0x46062e]={'$like':'%'+_0x4ca1ac['query'][_0x1810('0x53')]+'%'};return _0x17e02b;})});}_0x5c59f9=_['merge']({},_0x5c59f9,_0x4ca1ac[_0x1810('0x56')]);return db[_0x1810('0x6a')][_0x1810('0x31')]({'where':_0x5c59f9[_0x1810('0x51')]})[_0x1810('0x37')](function(_0x2b1abe){_0xc86140['count']=_0x2b1abe;if(_0x4ca1ac[_0x1810('0x46')][_0x1810('0x57')]){_0x5c59f9[_0x1810('0x58')]=[{'all':!![]}];}return db[_0x1810('0x6a')][_0x1810('0x59')](_0x5c59f9);})[_0x1810('0x37')](function(_0x162546){_0xc86140[_0x1810('0x5a')]=_0x162546;return _0xc86140;});}})[_0x1810('0x37')](respondWithFilteredResult(_0x4b7067,_0x5c59f9))[_0x1810('0x5b')](handleError(_0x4b7067,null));};exports[_0x1810('0x6d')]=function(_0xbb25a0,_0x29c9b6,_0x43235d){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0xbb25a0[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x29c9b6,null))['then'](function(_0x2b2303){if(_0x2b2303){return _0x2b2303[_0x1810('0x6d')](_0xbb25a0['query'][_0x1810('0x6e')]);}})[_0x1810('0x37')](respondWithStatusCode(_0x29c9b6,null))[_0x1810('0x5b')](handleError(_0x29c9b6,null));};exports['addAnswer']=function(_0x420869,_0x55b6b4,_0x4e63e1){if(_0x420869[_0x1810('0x60')]['id']){delete _0x420869[_0x1810('0x60')]['id'];}return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x420869['params']['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x55b6b4,null))[_0x1810('0x37')](function(_0x336c63){if(_0x336c63){_0x420869['body']['WhatsappAccountId']=_0x336c63['id'];return db[_0x1810('0x6f')]['create'](_0x420869[_0x1810('0x60')]);}})[_0x1810('0x37')](respondWithResult(_0x55b6b4,null))['catch'](handleError(_0x55b6b4,null));};exports[_0x1810('0x70')]=function(_0x179e9d,_0x22375a,_0x3bd68f){var _0x53d358={'raw':![],'where':{}};var _0x2981b6={};var _0x5e1122={'count':0x0,'rows':[]};return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x179e9d[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x22375a,null))[_0x1810('0x37')](function(_0x4595c6){if(_0x4595c6){_0x2981b6[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x6f')][_0x1810('0x43')]);_0x2981b6[_0x1810('0x46')]=_['keys'](_0x179e9d[_0x1810('0x46')]);_0x2981b6['filters']=_['intersection'](_0x2981b6['model'],_0x2981b6[_0x1810('0x46')]);_0x53d358[_0x1810('0x4b')]=_['intersection'](_0x2981b6['model'],qs[_0x1810('0x4a')](_0x179e9d[_0x1810('0x46')]['fields']));_0x53d358[_0x1810('0x4b')]=_0x53d358[_0x1810('0x4b')][_0x1810('0x4c')]?_0x53d358['attributes']:_0x2981b6['model'];if(!_0x179e9d[_0x1810('0x46')][_0x1810('0x4d')]('nolimit')){_0x53d358[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x179e9d[_0x1810('0x46')][_0x1810('0x30')]);_0x53d358[_0x1810('0x2e')]=qs[_0x1810('0x2e')](_0x179e9d[_0x1810('0x46')]['offset']);}_0x53d358[_0x1810('0x4f')]=qs[_0x1810('0x50')](_0x179e9d[_0x1810('0x46')][_0x1810('0x50')]);_0x53d358[_0x1810('0x51')]=qs[_0x1810('0x48')](_[_0x1810('0x52')](_0x179e9d['query'],_0x2981b6['filters']));_0x53d358[_0x1810('0x51')][_0x1810('0x69')]=_0x4595c6['id'];if(_0x179e9d[_0x1810('0x46')]['filter']){_0x53d358[_0x1810('0x51')]=_[_0x1810('0x54')](_0x53d358[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x53d358['attributes'],function(_0x3dd290){var _0x5cdad6={};_0x5cdad6[_0x3dd290]={'$like':'%'+_0x179e9d[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x5cdad6;})});}_0x53d358=_[_0x1810('0x54')]({},_0x53d358,_0x179e9d[_0x1810('0x56')]);return db[_0x1810('0x6f')]['count']({'where':_0x53d358[_0x1810('0x51')]})[_0x1810('0x37')](function(_0x58ffcf){_0x5e1122[_0x1810('0x31')]=_0x58ffcf;if(_0x179e9d['query']['includeAll']){_0x53d358[_0x1810('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1810('0x59')](_0x53d358);})[_0x1810('0x37')](function(_0x1cfd42){_0x5e1122[_0x1810('0x5a')]=_0x1cfd42;return _0x5e1122;});}})['then'](respondWithFilteredResult(_0x22375a,_0x53d358))[_0x1810('0x5b')](handleError(_0x22375a,null));};exports[_0x1810('0x71')]=function(_0x543b0a,_0x151631,_0x19e0b8){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x543b0a['params']['id']}})['then'](handleEntityNotFound(_0x151631,null))[_0x1810('0x37')](function(_0x45cb84){if(_0x45cb84){return _0x45cb84[_0x1810('0x71')](_0x543b0a[_0x1810('0x46')][_0x1810('0x6e')]);}})[_0x1810('0x37')](respondWithStatusCode(_0x151631,null))[_0x1810('0x5b')](handleError(_0x151631,null));};exports[_0x1810('0x72')]=function(_0x1dc707,_0x56bc45,_0xf92cdc){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x1dc707['params']['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x56bc45,null))[_0x1810('0x37')](function(_0xb0e795){if(_0xb0e795){return _0xb0e795['addAgents'](_0x1dc707[_0x1810('0x60')][_0x1810('0x6e')],_[_0x1810('0x73')](_0x1dc707[_0x1810('0x60')],[_0x1810('0x6e'),'id'])||{})[_0x1810('0x74')](function(_0x5ed96a){for(var _0x4999e3=0x0;_0x4999e3<_0x1dc707[_0x1810('0x60')][_0x1810('0x6e')]['length'];_0x4999e3+=0x1){socket[_0x1810('0x75')](_0x1810('0x76'),{'UserId':Number(_0x1dc707[_0x1810('0x60')][_0x1810('0x6e')][_0x4999e3]),'WhatsappAccountId':Number(_0x1dc707[_0x1810('0x5d')]['id'])});}return _0x5ed96a;});}})[_0x1810('0x37')](respondWithResult(_0x56bc45,null))[_0x1810('0x5b')](handleError(_0x56bc45,null));};exports[_0x1810('0x77')]=function(_0x1a3297,_0x3a7b16,_0x306e66){return db[_0x1810('0x42')][_0x1810('0x5e')]({'where':{'id':_0x1a3297[_0x1810('0x5d')]['id']}})[_0x1810('0x37')](handleEntityNotFound(_0x3a7b16,null))['then'](function(_0xcc643b){if(_0xcc643b){return _0xcc643b[_0x1810('0x77')](_0x1a3297[_0x1810('0x46')][_0x1810('0x6e')])['then'](function(){if(_[_0x1810('0x78')](_0x1a3297[_0x1810('0x46')][_0x1810('0x6e')])){for(var _0x39c40b=0x0;_0x39c40b<_0x1a3297[_0x1810('0x46')]['ids'][_0x1810('0x4c')];_0x39c40b+=0x1){socket[_0x1810('0x75')](_0x1810('0x79'),{'UserId':Number(_0x1a3297['query'][_0x1810('0x6e')][_0x39c40b]),'WhatsappAccountId':Number(_0x1a3297[_0x1810('0x5d')]['id'])});}}else{socket[_0x1810('0x75')](_0x1810('0x79'),{'UserId':Number(_0x1a3297[_0x1810('0x46')][_0x1810('0x6e')]),'WhatsappAccountId':Number(_0x1a3297[_0x1810('0x5d')]['id'])});}});}})[_0x1810('0x37')](respondWithStatusCode(_0x3a7b16,null))[_0x1810('0x5b')](handleError(_0x3a7b16,null));};exports[_0x1810('0x7a')]=function(_0x409ef3,_0x483c0c,_0x2cbe0b){var _0x2e0ac2={};var _0x9c9d50={};var _0x3f4a9a;var _0x460b03;return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x409ef3[_0x1810('0x5d')]['id']}})['then'](handleEntityNotFound(_0x483c0c,null))[_0x1810('0x37')](function(_0x5a86a9){if(_0x5a86a9){_0x3f4a9a=_0x5a86a9;_0x9c9d50[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x7b')][_0x1810('0x43')]);_0x9c9d50[_0x1810('0x46')]=_[_0x1810('0x47')](_0x409ef3['query']);_0x9c9d50[_0x1810('0x48')]=_[_0x1810('0x49')](_0x9c9d50['model'],_0x9c9d50[_0x1810('0x46')]);_0x2e0ac2[_0x1810('0x4b')]=_[_0x1810('0x49')](_0x9c9d50[_0x1810('0x45')],qs['fields'](_0x409ef3['query'][_0x1810('0x4a')]));_0x2e0ac2[_0x1810('0x4b')]=_0x2e0ac2[_0x1810('0x4b')]['length']?_0x2e0ac2[_0x1810('0x4b')]:_0x9c9d50[_0x1810('0x45')];_0x2e0ac2[_0x1810('0x4f')]=qs['sort'](_0x409ef3['query']['sort']);_0x2e0ac2['where']=qs[_0x1810('0x48')](_['pick'](_0x409ef3[_0x1810('0x46')],_0x9c9d50[_0x1810('0x48')]));if(_0x409ef3[_0x1810('0x46')][_0x1810('0x53')]){_0x2e0ac2['where']=_[_0x1810('0x54')](_0x2e0ac2[_0x1810('0x51')],{'$or':_[_0x1810('0x41')](_0x2e0ac2[_0x1810('0x4b')],function(_0x440ed3){var _0x1eaa3b={};_0x1eaa3b[_0x440ed3]={'$like':'%'+_0x409ef3[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x1eaa3b;})});}_0x2e0ac2=_[_0x1810('0x54')]({},_0x2e0ac2,_0x409ef3[_0x1810('0x56')]);return _0x3f4a9a[_0x1810('0x7a')](_0x2e0ac2);}})[_0x1810('0x37')](function(_0x4c4c5d){if(_0x4c4c5d){_0x460b03=_0x4c4c5d[_0x1810('0x4c')];if(!_0x409ef3[_0x1810('0x46')][_0x1810('0x4d')](_0x1810('0x4e'))){_0x2e0ac2[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x409ef3[_0x1810('0x46')][_0x1810('0x30')]);_0x2e0ac2[_0x1810('0x2e')]=qs[_0x1810('0x2e')](_0x409ef3[_0x1810('0x46')][_0x1810('0x2e')]);}return _0x3f4a9a['getAgents'](_0x2e0ac2);}})['then'](function(_0x24823b){if(_0x24823b){return _0x24823b?{'count':_0x460b03,'rows':_0x24823b}:null;}})[_0x1810('0x37')](respondWithResult(_0x483c0c,null))['catch'](handleError(_0x483c0c,null));};exports['addApplications']=function(_0x2cc979,_0x213398){var _0x443bc6=_0x2cc979[_0x1810('0x5d')]['id'];var _0x4e25d4=_0x2cc979[_0x1810('0x60')];var _0x339b72=0xc8;var _0x3fbb79=null;return db[_0x1810('0x7c')][_0x1810('0x7d')]({'isolationLevel':db[_0x1810('0x7c')][_0x1810('0x7e')][_0x1810('0x7f')][_0x1810('0x80')]},function(_0x299f6d){return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x443bc6},'transaction':_0x299f6d})[_0x1810('0x37')](function(_0x3a0c06){if(_0x3a0c06){return db[_0x1810('0x81')]['destroy']({'where':{'WhatsappAccountId':_0x443bc6},'transaction':_0x299f6d})[_0x1810('0x37')](function(){var _0x3f65f4=_[_0x1810('0x41')](_0x4e25d4,function(_0x234836){_0x234836['WhatsappAccountId']=_0x443bc6;return _0x234836;});return db['WhatsappApplication'][_0x1810('0x82')](_0x3f65f4,{'transaction':_0x299f6d});});}else{_0x339b72=0x194;_0x3fbb79=[];}});})[_0x1810('0x37')](function(){if(_0x339b72!==0x194){return db['WhatsappApplication'][_0x1810('0x83')]({'where':{'WhatsappAccountId':_0x443bc6},'order':_0x1810('0x84')})[_0x1810('0x37')](function(_0x489c10){_0x3fbb79=_0x489c10;});}})['catch'](function(_0x20a2e1){_0x339b72=0x1f4;logger[_0x1810('0x26')](_0x20a2e1[_0x1810('0x3c')]);if(_0x20a2e1[_0x1810('0x3d')]){delete _0x20a2e1[_0x1810('0x3d')];}_0x3fbb79=_0x20a2e1;})['finally'](function(){if(_0x3fbb79===null){_0x213398[_0x1810('0x2a')](_0x339b72);}else{if(_0x339b72===0x1f4){_0x213398[_0x1810('0x2b')](_0x339b72)[_0x1810('0x3e')](_0x3fbb79);}else{_0x213398[_0x1810('0x2b')](_0x339b72)[_0x1810('0x2d')](_0x3fbb79);}}});};exports[_0x1810('0x85')]=function(_0x1ade05,_0x1ce16a,_0x40df9d){var _0x15854a={};var _0x151e6e={};var _0x5d7d3f;var _0x4dd720;return db[_0x1810('0x42')][_0x1810('0x6c')]({'where':{'id':_0x1ade05['params']['id']}})['then'](handleEntityNotFound(_0x1ce16a,null))[_0x1810('0x37')](function(_0x26f5d2){if(_0x26f5d2){_0x5d7d3f=_0x26f5d2;_0x151e6e[_0x1810('0x45')]=_[_0x1810('0x47')](db[_0x1810('0x81')]['rawAttributes']);_0x151e6e[_0x1810('0x46')]=_[_0x1810('0x47')](_0x1ade05['query']);_0x151e6e[_0x1810('0x48')]=_['intersection'](_0x151e6e['model'],_0x151e6e[_0x1810('0x46')]);_0x15854a[_0x1810('0x4b')]=_['intersection'](_0x151e6e[_0x1810('0x45')],qs[_0x1810('0x4a')](_0x1ade05[_0x1810('0x46')][_0x1810('0x4a')]));_0x15854a[_0x1810('0x4b')]=_0x15854a[_0x1810('0x4b')][_0x1810('0x4c')]?_0x15854a[_0x1810('0x4b')]:_0x151e6e['model'];_0x15854a[_0x1810('0x4f')]=qs['sort'](_0x1ade05['query'][_0x1810('0x50')]);_0x15854a[_0x1810('0x51')]=qs['filters'](_[_0x1810('0x52')](_0x1ade05[_0x1810('0x46')],_0x151e6e[_0x1810('0x48')]));if(_0x1ade05[_0x1810('0x46')][_0x1810('0x53')]){_0x15854a[_0x1810('0x51')]=_[_0x1810('0x54')](_0x15854a[_0x1810('0x51')],{'$or':_['map'](_0x15854a[_0x1810('0x4b')],function(_0x42e871){var _0x3d95f1={};_0x3d95f1[_0x42e871]={'$like':'%'+_0x1ade05[_0x1810('0x46')][_0x1810('0x53')]+'%'};return _0x3d95f1;})});}_0x15854a=_[_0x1810('0x54')]({},_0x15854a,_0x1ade05['options']);return _0x5d7d3f['getApplications'](_0x15854a);}})[_0x1810('0x37')](function(_0x6a3c18){if(_0x6a3c18){_0x4dd720=_0x6a3c18[_0x1810('0x4c')];if(!_0x1ade05[_0x1810('0x46')]['hasOwnProperty'](_0x1810('0x4e'))){_0x15854a[_0x1810('0x30')]=qs[_0x1810('0x30')](_0x1ade05[_0x1810('0x46')]['limit']);_0x15854a['offset']=qs[_0x1810('0x2e')](_0x1ade05[_0x1810('0x46')][_0x1810('0x2e')]);}return _0x5d7d3f[_0x1810('0x85')](_0x15854a);}})[_0x1810('0x37')](function(_0x329e12){if(_0x329e12){return _0x329e12?{'count':_0x4dd720,'rows':_0x329e12}:null;}})[_0x1810('0x37')](respondWithResult(_0x1ce16a,null))[_0x1810('0x5b')](handleError(_0x1ce16a,null));};exports[_0x1810('0x86')]=function(_0xbeea65,_0x1eba46,_0x3acd4c){var _0x1e197c={'channel':'whatsapp'};var _0x1ba26d=[];var _0x62c78d=[];var _0x38999e={};return db[_0x1810('0x42')]['find']({'where':{'id':_0xbeea65[_0x1810('0x5d')]['id']},'include':[{'model':db[_0x1810('0x81')],'as':_0x1810('0x87')}]})[_0x1810('0x37')](handleEntityNotFound(_0x1eba46,null))[_0x1810('0x37')](function(_0x38752f){_0x1e197c[_0x1810('0x88')]=_0x38752f;if(_0x1e197c[_0x1810('0x88')]&&_0x1e197c[_0x1810('0x88')]['type']===_0x1810('0x89')&&_0xbeea65[_0x1810('0x60')][_0x1810('0x8a')]){if(_0xbeea65[_0x1810('0x60')][_0x1810('0x8a')]['length']===0x0)return;if(_0xbeea65[_0x1810('0x60')]['statuses'][0x0]['state']!=='read')return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0xbeea65[_0x1810('0x60')][_0x1810('0x8a')][0x0][_0x1810('0x8b')]},{'where':{'messageId':_0xbeea65[_0x1810('0x60')]['statuses'][0x0][_0x1810('0x8c')]},'individualHooks':!![]})[_0x1810('0x37')](function(_0x499bff){return _0x1eba46[_0x1810('0x2b')](0xc8)[_0x1810('0x2d')](_0x499bff);});}_0x1e197c['applications']=_[_0x1810('0x8d')](_0x38752f['Applications'],[_0x1810('0x84')],['asc']);if(_0x1e197c[_0x1810('0x88')]['Applications']){delete _0x1e197c[_0x1810('0x88')]['Applications'];}return db['CmContact'][_0x1810('0x67')]()[_0x1810('0x37')](function(_0x36d090){if(!_0x36d090){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))]('no\x20available\x20attributes');}_0x1ba26d=_[_0x1810('0x90')](_['keys'](_0x36d090),['createdAt',_0x1810('0x91')]);_0x62c78d=_['difference'](_['keys'](_0x36d090),[_0x1810('0x92'),_0x1810('0x91'),_0x1810('0x93'),_0x1810('0x94')]);_0x1e197c[_0x1810('0x60')]={'mapKey':_0x1810('0x95')};if(_0x1e197c['account']&&_0x1e197c[_0x1810('0x88')]['type']===_0x1810('0x96')){_0x1e197c['body'][_0x1810('0x97')]=_0xbeea65['body']['From'][_0x1810('0x98')]('whatsapp:','');_0x1e197c[_0x1810('0x60')][_0x1810('0x60')]=_0xbeea65['body']['Body'];_0x1e197c[_0x1810('0x60')][_0x1810('0x99')]=_0xbeea65[_0x1810('0x60')][_0x1810('0x9a')];}if(_0x1e197c[_0x1810('0x88')]&&_0x1e197c[_0x1810('0x88')][_0x1810('0x44')]===_0x1810('0x89')){_0x1e197c['body'][_0x1810('0x97')]=_0xbeea65[_0x1810('0x60')][_0x1810('0x9b')][0x0][_0x1810('0x97')];_0x1e197c[_0x1810('0x60')][_0x1810('0x60')]=_0xbeea65['body'][_0x1810('0x9b')][0x0][_0x1810('0x27')][_0x1810('0x60')];_0x1e197c[_0x1810('0x60')]['messageId']=_0xbeea65[_0x1810('0x60')][_0x1810('0x9b')][0x0][_0x1810('0x8c')];}if(_0x1e197c[_0x1810('0x60')]['id']){delete _0x1e197c[_0x1810('0x60')]['id'];}if(_[_0x1810('0x9c')](_0x1e197c[_0x1810('0x60')]['from'])){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0x9d'));}if(_['isNil'](_0x1e197c[_0x1810('0x60')][_0x1810('0x60')])||_0x1e197c[_0x1810('0x60')][_0x1810('0x60')]===''){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0x9e'));}if(_[_0x1810('0x9c')](_0x1e197c[_0x1810('0x60')][_0x1810('0x9f')])){throw new db['Sequelize'][(_0x1810('0x8f'))](_0x1810('0xa0')+_0x62c78d);}if(!_['includes'](_0x62c78d,_0x1e197c['body'][_0x1810('0x9f')])){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0xa1')+_0x62c78d);}_0x38999e[_0x1e197c['body']['mapKey']]=_0x1e197c[_0x1810('0x60')][_0x1810('0x97')];return db[_0x1810('0xa2')]['find']({'where':{'id':_0x1e197c['account'][_0x1810('0x94')]},'include':[{'model':db[_0x1810('0xa3')],'as':_0x1810('0xa4'),'where':_0x38999e,'limit':0x1,'order':[[_0x1810('0x91'),_0x1810('0xa5')]]}]});})['then'](handleEntityNotFound(_0x1eba46,null))[_0x1810('0x37')](function(_0x386eb1){if(_0x386eb1){_0x1e197c[_0x1810('0xa6')]=_[_0x1810('0x73')](_0x386eb1,[_0x1810('0xa4')]);if(_0x386eb1['Contacts'][_0x1810('0x4c')]){return _0x386eb1[_0x1810('0xa4')][0x0];}var _0x42bf2d=_['defaults'](_0x1e197c[_0x1810('0x60')],{'firstName':_0x1e197c['body'][_0x1810('0x97')],'ListId':_0x386eb1['id']});_0x42bf2d[_0x1e197c[_0x1810('0x60')]['mapKey']]=_0x1e197c[_0x1810('0x60')]['from'];return db['CmContact'][_0x1810('0x5f')](_0x42bf2d,{'fields':_0x1ba26d,'raw':!![]});}})[_0x1810('0x37')](handleEntityNotFound(_0x1eba46,null))[_0x1810('0x37')](function(_0x108d0a){if(_0x108d0a){_0x1e197c[_0x1810('0xa7')]=_0x108d0a;var _0x33e415={'ContactId':_0x108d0a['id'],'phone':_0x1e197c['body'][_0x1810('0x97')],'WhatsappAccountId':_0xbeea65[_0x1810('0x5d')]['id']};var _0x5998fd={'ContactId':_0x108d0a['id'],'WhatsappAccountId':_0xbeea65[_0x1810('0x5d')]['id'],'closed':![]};return db[_0x1810('0xa8')][_0x1810('0x5e')]({'where':_0x5998fd})[_0x1810('0x37')](function(_0x509cf5){if(_0x509cf5){return[_0x509cf5,![]];}return db['WhatsappInteraction'][_0x1810('0x5f')](_0x33e415)[_0x1810('0x37')](function(_0x5c1cf2){return[_0x5c1cf2,!![]];});});}})[_0x1810('0x74')](function(_0x2bab18,_0x3dae41){_0x1e197c['interaction']=_0x2bab18[_0x1810('0x39')]({'plain':!![]});_0x1e197c[_0x1810('0xa9')][_0x1810('0xaa')]=![];if(_0x3dae41){if(_0x1e197c[_0x1810('0x88')][_0x1810('0xab')]){_0x1e197c[_0x1810('0xac')][_0x1810('0xad')]({'id':0x0,'priority':_0x1e197c[_0x1810('0xac')][_0x1810('0x4c')]+0x1,'app':_0x1810('0xae'),'appdata':'unmanaged','interval':_0x1810('0xaf')});}_0x1e197c[_0x1810('0xa9')][_0x1810('0xaa')]=!![];}return db['WhatsappMessage'][_0x1810('0x5f')]({'phone':_0x1e197c[_0x1810('0x60')][_0x1810('0x97')],'messageId':_0x1e197c[_0x1810('0x60')][_0x1810('0x99')],'body':_0x1e197c[_0x1810('0x60')]['body'],'WhatsappAccountId':_0xbeea65[_0x1810('0x5d')]['id'],'WhatsappInteractionId':_0x2bab18['id'],'direction':'in','ContactId':_0x2bab18[_0x1810('0xb0')],'AttachmentId':_0x1e197c[_0x1810('0x60')][_0x1810('0xb1')]});})[_0x1810('0x37')](function(_0x459f36){_0x1e197c[_0x1810('0x27')]=_0x459f36;if(!_0x1e197c[_0x1810('0xa9')][_0x1810('0xb2')])return;return db[_0x1810('0x7b')][_0x1810('0x5e')]({'attributes':['id','name'],'where':{'id':_0x1e197c[_0x1810('0xa9')][_0x1810('0xb2')]}});})[_0x1810('0x37')](function(_0x337e9f){if(_0x337e9f){_0x1e197c['applications'][_0x1810('0xb3')]({'id':0x0,'priority':0x0,'app':_0x1810('0xb4'),'appdata':_0x337e9f[_0x1810('0x3d')]+','+(_0x1e197c[_0x1810('0x88')][_0x1810('0xb5')]||0xa),'interval':_0x1810('0xaf')});}if(!_0x1e197c[_0x1810('0xa9')]['queueId'])return;return db[_0x1810('0xb6')]['find']({'attributes':['id',_0x1810('0x3d')],'where':{'id':_0x1e197c['interaction'][_0x1810('0xb7')]}});})[_0x1810('0x37')](function(_0x5ed7d7){if(_0x5ed7d7){_0x1e197c[_0x1810('0xac')][_0x1810('0xb3')]({'id':0x0,'priority':0x1,'app':_0x1810('0xb8'),'appdata':_0x5ed7d7[_0x1810('0x3d')]+','+(_0x1e197c[_0x1810('0x88')][_0x1810('0xb9')]||0x12c),'interval':_0x1810('0xaf')});}return respondWithRpcPromise(_0x1810('0xba'),_0x1810('0xbb'),_0x1e197c);})['then'](function(_0x1ec7c9){if(_0x1ec7c9){var _0xf0edbd=0xc8;var _0x109672='receiveMessage';logger[_0x1810('0x28')](_0x1810('0x23'),_0x109672,_0xf0edbd,_0x1810('0xbc'));logger[_0x1810('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x109672,_0xf0edbd,_0x1810('0xbc'),JSON['stringify'](_0x1ec7c9));if(_0x1e197c[_0x1810('0x88')]['type']===_0x1810('0x96')){return _0x1eba46[_0x1810('0x2b')](_0xf0edbd)[_0x1810('0xbd')]('Content-Type',_0x1810('0xbe'))[_0x1810('0x3e')](_0x1810('0xbf'));}else{return _0x1eba46[_0x1810('0x2b')](_0xf0edbd)[_0x1810('0x2d')](_0x1ec7c9);}}});})['catch'](handleError(_0x1eba46,null));};exports[_0x1810('0x3e')]=function(_0x214e9a,_0x7ad75f,_0x8dd8c0){var _0x3c185a,_0x3263b4,_0x1d1c8e;if(_[_0x1810('0x9c')](_0x214e9a['body'][_0x1810('0x60')])||_0x214e9a[_0x1810('0x60')][_0x1810('0x60')]===''){throw new db['Sequelize'][(_0x1810('0x8f'))](_0x1810('0x9e'));}if(_[_0x1810('0x9c')](_0x214e9a['body']['to'])){throw new db[(_0x1810('0x8e'))][(_0x1810('0x8f'))](_0x1810('0xc0'));}_0x3c185a=_0x214e9a['body']['to'];return db['WhatsappAccount'][_0x1810('0x5e')]({'where':{'id':_0x214e9a[_0x1810('0x5d')]['id']},'include':[{'model':db[_0x1810('0xa2')],'as':'List','include':[{'model':db[_0x1810('0xa3')],'as':_0x1810('0xa4'),'where':{'mobile':_0x3c185a},'limit':0x1,'order':[[_0x1810('0x91'),_0x1810('0xa5')]]}]}]})[_0x1810('0x37')](handleEntityNotFound(_0x7ad75f,null))[_0x1810('0x37')](function(_0x4114fe){if(_0x4114fe&&_0x4114fe[_0x1810('0xc1')]){_0x3263b4=_0x4114fe['get']({'plain':!![]});if(_0x3263b4[_0x1810('0xc1')]&&_0x3263b4[_0x1810('0xc1')][_0x1810('0xa4')]['length']){return _0x3263b4[_0x1810('0xc1')][_0x1810('0xa4')][0x0];}return db[_0x1810('0xa3')][_0x1810('0x5f')](_[_0x1810('0x1a')](_0x214e9a[_0x1810('0x60')],{'firstName':_0x3c185a,'mobile':_0x3c185a,'phone':_0x3c185a,'ListId':_0x3263b4['ListId']}));}})['then'](handleEntityNotFound(_0x7ad75f,null))[_0x1810('0x37')](function(_0x3e79ce){if(_0x3e79ce){_0x1d1c8e=_0x3e79ce;return db['WhatsappInteraction'][_0x1810('0x5e')]({'where':{'ContactId':_0x1d1c8e['id'],'closed':![],'WhatsappAccountId':_0x3263b4['id']}})[_0x1810('0x37')](function(_0x185bd9){if(_0x185bd9){return[_0x185bd9,![]];}return db[_0x1810('0xa8')]['create']({'UserId':_0x214e9a[_0x1810('0x61')]['id'],'ContactId':_0x1d1c8e['id'],'WhatsappAccountId':_0x3263b4['id'],'phone':_0x3c185a,'firstMsgDirection':'out','Messages':[_[_0x1810('0x54')](_0x214e9a[_0x1810('0x60')],{'read':![],'body':_0x214e9a[_0x1810('0x60')][_0x1810('0x60')],'phone':_0x3c185a,'WhatsappAccountId':_0x3263b4['id'],'UserId':_0x214e9a[_0x1810('0x61')]['id'],'ContactId':_0x1d1c8e['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x1810('0xc2')}]})[_0x1810('0x37')](function(_0x4905a1){return[_0x4905a1,!![]];});});}})['spread'](function(_0x3a87ec,_0x328bd8){if(_0x328bd8){return _0x3a87ec;}return db[_0x1810('0xc3')][_0x1810('0x5f')](_[_0x1810('0x54')](_0x214e9a[_0x1810('0x60')],{'read':![],'body':_0x214e9a['body'][_0x1810('0x60')],'phone':_0x3c185a,'WhatsappAccountId':_0x3263b4['id'],'WhatsappInteractionId':_0x3a87ec['id'],'UserId':_0x214e9a[_0x1810('0x61')]['id'],'ContactId':_0x1d1c8e['id']}))['then'](function(_0x1c6da2){_0x3a87ec[_0x1810('0xc4')][_0x1810('0xc2')]=[];_0x3a87ec[_0x1810('0xc4')][_0x1810('0xc2')]['push'](_0x1c6da2[_0x1810('0xc4')]);return _0x3a87ec;});})[_0x1810('0x37')](respondWithResult(_0x7ad75f,null))[_0x1810('0x5b')](handleError(_0x7ad75f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 9ff5ccc..b58dbaf 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 _0xff0a=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','WhatsappAccount'];(function(_0x1a4fc5,_0x35d717){var _0x3156b7=function(_0x1ce4de){while(--_0x1ce4de){_0x1a4fc5['push'](_0x1a4fc5['shift']());}};_0x3156b7(++_0x35d717);}(_0xff0a,0x1d6));var _0xaff0=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xff0a[_0x16d10f];return _0x50c823;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xaff0('0x0'))['db'][_0xaff0('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xaff0('0x2')](0x0);var events={'afterCreate':_0xaff0('0x3'),'afterUpdate':_0xaff0('0x4'),'afterDestroy':_0xaff0('0x5')};function emitEvent(_0x30c881){return function(_0x3bec22,_0x1f16f0,_0x56de4c){WhatsappAccountEvents[_0xaff0('0x6')](_0x30c881+':'+_0x3bec22['id'],_0x3bec22);WhatsappAccountEvents[_0xaff0('0x6')](_0x30c881,_0x3bec22);_0x56de4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xaff0('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x136f=['WhatsappAccount','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x386b1b,_0x10b035){var _0x5d0645=function(_0x2523bd){while(--_0x2523bd){_0x386b1b['push'](_0x386b1b['shift']());}};_0x5d0645(++_0x10b035);}(_0x136f,0x6f));var _0xf136=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x136f[_0x172747];return _0x509692;};'use strict';var EventEmitter=require(_0xf136('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xf136('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf136('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf136('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37baea){return function(_0x54765d,_0x503935,_0x54ccfb){WhatsappAccountEvents['emit'](_0x37baea+':'+_0x54765d['id'],_0x54765d);WhatsappAccountEvents[_0xf136('0x4')](_0x37baea,_0x54765d);_0x54ccfb(null);};}for(var e in events){if(events[_0xf136('0x5')](e)){var event=events[e];WhatsappAccount[_0xf136('0x6')](e,emitEvent(event));}}module[_0xf136('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 0467ac0..3a780af 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 _0x2fbf=['api','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger'];(function(_0x51d300,_0x41204e){var _0x396f1f=function(_0x5aa22e){while(--_0x5aa22e){_0x51d300['push'](_0x51d300['shift']());}};_0x396f1f(++_0x41204e);}(_0x2fbf,0x172));var _0xf2fb=function(_0x361bdb,_0x14abf4){_0x361bdb=_0x361bdb-0x0;var _0x80c75f=_0x2fbf[_0x361bdb];return _0x80c75f;};'use strict';var _=require(_0xf2fb('0x0'));var util=require('util');var logger=require(_0xf2fb('0x1'))(_0xf2fb('0x2'));var moment=require('moment');var BPromise=require(_0xf2fb('0x3'));var rp=require(_0xf2fb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2fb('0x5'));var config=require(_0xf2fb('0x6'));var attributes=require(_0xf2fb('0x7'));module[_0xf2fb('0x8')]=function(_0x418bf4,_0x1b15ae){return _0x418bf4[_0xf2fb('0x9')](_0xf2fb('0xa'),attributes,{'tableName':_0xf2fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bb0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','lodash','util','../../config/logger','api'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0x1bb0,0x1d0));var _0x01bb=function(_0x11a104,_0x5d6ef1){_0x11a104=_0x11a104-0x0;var _0xea9b65=_0x1bb0[_0x11a104];return _0xea9b65;};'use strict';var _=require(_0x01bb('0x0'));var util=require(_0x01bb('0x1'));var logger=require(_0x01bb('0x2'))(_0x01bb('0x3'));var moment=require(_0x01bb('0x4'));var BPromise=require(_0x01bb('0x5'));var rp=require(_0x01bb('0x6'));var fs=require('fs');var path=require(_0x01bb('0x7'));var rimraf=require(_0x01bb('0x8'));var config=require(_0x01bb('0x9'));var attributes=require(_0x01bb('0xa'));module[_0x01bb('0xb')]=function(_0x1a1994,_0x2787eb){return _0x1a1994['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index bf6885b..cb4b316 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 _0x6f24=['options','raw','attributes','include','model','map','ShowWhatsappAccount','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappAccount','find'];(function(_0x2af338,_0x3058ca){var _0x204f4e=function(_0x45ef76){while(--_0x45ef76){_0x2af338['push'](_0x2af338['shift']());}};_0x204f4e(++_0x3058ca);}(_0x6f24,0x76));var _0x46f2=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0x6f24[_0x47604d];return _0x388e4c;};'use strict';var _=require(_0x46f2('0x0'));var util=require(_0x46f2('0x1'));var moment=require('moment');var BPromise=require(_0x46f2('0x2'));var rs=require(_0x46f2('0x3'));var fs=require('fs');var Redis=require(_0x46f2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46f2('0x5'));var logger=require('../../config/logger')(_0x46f2('0x6'));var config=require(_0x46f2('0x7'));var jayson=require(_0x46f2('0x8'));var client=jayson[_0x46f2('0x9')][_0x46f2('0xa')]({'port':0x232a});config['redis']=_[_0x46f2('0xb')](config[_0x46f2('0xc')],{'host':_0x46f2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46f2('0xc')]));require(_0x46f2('0xe'))[_0x46f2('0xf')](socket);function respondWithRpcPromise(_0x1504b5,_0x588630,_0x49e81a){return new BPromise(function(_0x42d435,_0x3267d4){return client[_0x46f2('0x10')](_0x1504b5,_0x49e81a)[_0x46f2('0x11')](function(_0x52b5ca){logger[_0x46f2('0x12')](_0x46f2('0x13'),_0x588630,_0x46f2('0x14'));logger[_0x46f2('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x588630,_0x46f2('0x14'),JSON[_0x46f2('0x16')](_0x52b5ca));if(_0x52b5ca[_0x46f2('0x17')]){if(_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x18')]===0x1f4){logger[_0x46f2('0x17')](_0x46f2('0x13'),_0x588630,_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);return _0x3267d4(_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);}logger[_0x46f2('0x17')](_0x46f2('0x13'),_0x588630,_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);return _0x42d435(_0x52b5ca[_0x46f2('0x17')][_0x46f2('0x19')]);}else{logger[_0x46f2('0x12')](_0x46f2('0x13'),_0x588630,_0x46f2('0x14'));_0x42d435(_0x52b5ca[_0x46f2('0x1a')]['message']);}})[_0x46f2('0x1b')](function(_0x5a1380){logger[_0x46f2('0x17')](_0x46f2('0x13'),_0x588630,_0x5a1380);_0x3267d4(_0x5a1380);});});}exports['ShowWhatsappAccount']=function(_0x5970a1){var _0x45ea96=this;return new Promise(function(_0x1fac0d,_0x170b5e){return db[_0x46f2('0x1c')][_0x46f2('0x1d')]({'raw':_0x5970a1[_0x46f2('0x1e')]?_0x5970a1['options'][_0x46f2('0x1f')]===undefined?!![]:![]:!![],'where':_0x5970a1['options']?_0x5970a1[_0x46f2('0x1e')]['where']||null:null,'attributes':_0x5970a1[_0x46f2('0x1e')]?_0x5970a1[_0x46f2('0x1e')][_0x46f2('0x20')]||null:null,'include':_0x5970a1[_0x46f2('0x1e')]?_0x5970a1[_0x46f2('0x1e')][_0x46f2('0x21')]?_['map'](_0x5970a1[_0x46f2('0x1e')][_0x46f2('0x21')],function(_0x3d3767){return{'model':db[_0x3d3767[_0x46f2('0x22')]],'as':_0x3d3767['as'],'attributes':_0x3d3767['attributes'],'include':_0x3d3767[_0x46f2('0x21')]?_[_0x46f2('0x23')](_0x3d3767[_0x46f2('0x21')],function(_0x5c97b0){return{'model':db[_0x5c97b0[_0x46f2('0x22')]],'as':_0x5c97b0['as'],'attributes':_0x5c97b0['attributes'],'include':_0x5c97b0['include']?_[_0x46f2('0x23')](_0x5c97b0['include'],function(_0x2de742){return{'model':db[_0x2de742[_0x46f2('0x22')]],'as':_0x2de742['as'],'attributes':_0x2de742['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e4b64){logger[_0x46f2('0x12')](_0x46f2('0x24'),_0x5970a1);logger['debug'](_0x46f2('0x24'),_0x5970a1,JSON['stringify'](_0x1e4b64));_0x1fac0d(_0x1e4b64);})[_0x46f2('0x1b')](function(_0x58a95b){logger[_0x46f2('0x17')](_0x46f2('0x24'),_0x58a95b[_0x46f2('0x19')],_0x5970a1);_0x170b5e(_0x45ea96[_0x46f2('0x17')](0x1f4,_0x58a95b[_0x46f2('0x19')]));});});}; \ No newline at end of file +var _0xf4ad=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','options','raw','where','include','map','model','attributes','then','stringify','util','moment','bluebird'];(function(_0x35dea7,_0x1f7e22){var _0x3ddd9f=function(_0x1cdffd){while(--_0x1cdffd){_0x35dea7['push'](_0x35dea7['shift']());}};_0x3ddd9f(++_0x1f7e22);}(_0xf4ad,0x6f));var _0xdf4a=function(_0x54f695,_0x17e578){_0x54f695=_0x54f695-0x0;var _0x5d8f73=_0xf4ad[_0x54f695];return _0x5d8f73;};'use strict';var _=require('lodash');var util=require(_0xdf4a('0x0'));var moment=require(_0xdf4a('0x1'));var BPromise=require(_0xdf4a('0x2'));var rs=require(_0xdf4a('0x3'));var fs=require('fs');var Redis=require(_0xdf4a('0x4'));var db=require(_0xdf4a('0x5'))['db'];var utils=require(_0xdf4a('0x6'));var logger=require('../../config/logger')(_0xdf4a('0x7'));var config=require('../../config/environment');var jayson=require(_0xdf4a('0x8'));var client=jayson[_0xdf4a('0x9')][_0xdf4a('0xa')]({'port':0x232a});config[_0xdf4a('0xb')]=_[_0xdf4a('0xc')](config[_0xdf4a('0xb')],{'host':_0xdf4a('0xd'),'port':0x18eb});var socket=require(_0xdf4a('0xe'))(new Redis(config['redis']));require(_0xdf4a('0xf'))['register'](socket);function respondWithRpcPromise(_0x1bd0ac,_0x5cdacc,_0xe3563b){return new BPromise(function(_0x26e319,_0x2ac901){return client[_0xdf4a('0x10')](_0x1bd0ac,_0xe3563b)['then'](function(_0x395e86){logger[_0xdf4a('0x11')](_0xdf4a('0x12'),_0x5cdacc,_0xdf4a('0x13'));logger[_0xdf4a('0x14')](_0xdf4a('0x15'),_0x5cdacc,_0xdf4a('0x13'),JSON['stringify'](_0x395e86));if(_0x395e86[_0xdf4a('0x16')]){if(_0x395e86[_0xdf4a('0x16')][_0xdf4a('0x17')]===0x1f4){logger[_0xdf4a('0x16')](_0xdf4a('0x12'),_0x5cdacc,_0x395e86[_0xdf4a('0x16')][_0xdf4a('0x18')]);return _0x2ac901(_0x395e86['error'][_0xdf4a('0x18')]);}logger[_0xdf4a('0x16')](_0xdf4a('0x12'),_0x5cdacc,_0x395e86[_0xdf4a('0x16')][_0xdf4a('0x18')]);return _0x26e319(_0x395e86['error'][_0xdf4a('0x18')]);}else{logger['info'](_0xdf4a('0x12'),_0x5cdacc,_0xdf4a('0x13'));_0x26e319(_0x395e86[_0xdf4a('0x19')][_0xdf4a('0x18')]);}})[_0xdf4a('0x1a')](function(_0x19b9df){logger[_0xdf4a('0x16')](_0xdf4a('0x12'),_0x5cdacc,_0x19b9df);_0x2ac901(_0x19b9df);});});}exports[_0xdf4a('0x1b')]=function(_0x3b2eea){var _0x5c9fe7=this;return new Promise(function(_0x3e39aa,_0x35f22a){return db[_0xdf4a('0x1c')]['find']({'raw':_0x3b2eea['options']?_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b2eea[_0xdf4a('0x1d')]?_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x1f')]||null:null,'attributes':_0x3b2eea[_0xdf4a('0x1d')]?_0x3b2eea['options']['attributes']||null:null,'include':_0x3b2eea[_0xdf4a('0x1d')]?_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x20')]?_[_0xdf4a('0x21')](_0x3b2eea[_0xdf4a('0x1d')][_0xdf4a('0x20')],function(_0x13b4c1){return{'model':db[_0x13b4c1[_0xdf4a('0x22')]],'as':_0x13b4c1['as'],'attributes':_0x13b4c1[_0xdf4a('0x23')],'include':_0x13b4c1[_0xdf4a('0x20')]?_[_0xdf4a('0x21')](_0x13b4c1[_0xdf4a('0x20')],function(_0x10f55c){return{'model':db[_0x10f55c[_0xdf4a('0x22')]],'as':_0x10f55c['as'],'attributes':_0x10f55c[_0xdf4a('0x23')],'include':_0x10f55c[_0xdf4a('0x20')]?_[_0xdf4a('0x21')](_0x10f55c[_0xdf4a('0x20')],function(_0x280c91){return{'model':db[_0x280c91['model']],'as':_0x280c91['as'],'attributes':_0x280c91[_0xdf4a('0x23')]};}):[]};}):[]};}):[]:[]})[_0xdf4a('0x24')](function(_0x1b3d16){logger[_0xdf4a('0x11')](_0xdf4a('0x1b'),_0x3b2eea);logger[_0xdf4a('0x14')]('ShowWhatsappAccount',_0x3b2eea,JSON[_0xdf4a('0x25')](_0x1b3d16));_0x3e39aa(_0x1b3d16);})[_0xdf4a('0x1a')](function(_0x49982f){logger[_0xdf4a('0x16')](_0xdf4a('0x1b'),_0x49982f['message'],_0x3b2eea);_0x35f22a(_0x5c9fe7[_0xdf4a('0x16')](0x1f4,_0x49982f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index be12e6d..37f6e9c 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 _0xc60f=['length','./whatsappAccount.events','save','remove','update','emit'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc60f,0xfd));var _0xfc60=function(_0x184842,_0x522104){_0x184842=_0x184842-0x0;var _0x574731=_0xc60f[_0x184842];return _0x574731;};'use strict';var WhatsappAccountEvents=require(_0xfc60('0x0'));var events=[_0xfc60('0x1'),_0xfc60('0x2'),_0xfc60('0x3')];function createListener(_0x49b81c,_0x48a75c){return function(_0x25a618){_0x48a75c[_0xfc60('0x4')](_0x49b81c,_0x25a618);};}function removeListener(_0x3afb2c,_0x5d3941){return function(){WhatsappAccountEvents['removeListener'](_0x3afb2c,_0x5d3941);};}exports['register']=function(_0x452c2f){for(var _0x351ce6=0x0,_0x5c1101=events[_0xfc60('0x5')];_0x351ce6<_0x5c1101;_0x351ce6++){var _0x2256e1=events[_0x351ce6];var _0x30487e=createListener('whatsappAccount:'+_0x2256e1,_0x452c2f);WhatsappAccountEvents['on'](_0x2256e1,_0x30487e);}}; \ No newline at end of file +var _0x0942=['removeListener','register','length','whatsappAccount:','save','remove','update'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x0942,0x107));var _0x2094=function(_0x59aa2d,_0xa831e1){_0x59aa2d=_0x59aa2d-0x0;var _0x589dc3=_0x0942[_0x59aa2d];return _0x589dc3;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x2094('0x0'),_0x2094('0x1'),_0x2094('0x2')];function createListener(_0x27e85e,_0xf9071f){return function(_0x20df17){_0xf9071f['emit'](_0x27e85e,_0x20df17);};}function removeListener(_0x4ba007,_0x308944){return function(){WhatsappAccountEvents[_0x2094('0x3')](_0x4ba007,_0x308944);};}exports[_0x2094('0x4')]=function(_0x11cdaa){for(var _0x4cc971=0x0,_0x5eb647=events[_0x2094('0x5')];_0x4cc971<_0x5eb647;_0x4cc971++){var _0x1b1f84=events[_0x4cc971];var _0x4d5a5d=createListener(_0x2094('0x6')+_0x1b1f84,_0x11cdaa);WhatsappAccountEvents['on'](_0x1b1f84,_0x4d5a5d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 7d5240e..50ba70d 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 _0xb6a3=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3406b2,_0x3ddf5c){var _0x2c0e4b=function(_0x421c8f){while(--_0x421c8f){_0x3406b2['push'](_0x3406b2['shift']());}};_0x2c0e4b(++_0x3ddf5c);}(_0xb6a3,0x16c));var _0x3b6a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb6a3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3b6a('0x0'));var util=require(_0x3b6a('0x1'));var path=require(_0x3b6a('0x2'));var timeout=require(_0x3b6a('0x3'));var express=require(_0x3b6a('0x4'));var router=express['Router']();var fs_extra=require(_0x3b6a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3b6a('0x6'));var config=require(_0x3b6a('0x7'));var controller=require(_0x3b6a('0x8'));router[_0x3b6a('0x9')]('/',auth[_0x3b6a('0xa')](),controller[_0x3b6a('0xb')]);router[_0x3b6a('0x9')](_0x3b6a('0xc'),auth[_0x3b6a('0xa')](),controller[_0x3b6a('0xd')]);router[_0x3b6a('0xe')]('/',auth[_0x3b6a('0xa')](),controller[_0x3b6a('0xf')]);router[_0x3b6a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3b6a('0x11')]);router[_0x3b6a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3b6a('0x13')]);module[_0x3b6a('0x14')]=router; \ No newline at end of file +var _0xa335=['/:id','post','put','update','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index'];(function(_0x58a833,_0x16c3cb){var _0x14f27b=function(_0x217e0f){while(--_0x217e0f){_0x58a833['push'](_0x58a833['shift']());}};_0x14f27b(++_0x16c3cb);}(_0xa335,0xe3));var _0x5a33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa335[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5a33('0x0'));var express=require(_0x5a33('0x1'));var router=express[_0x5a33('0x2')]();var fs_extra=require(_0x5a33('0x3'));var auth=require(_0x5a33('0x4'));var interaction=require(_0x5a33('0x5'));var config=require(_0x5a33('0x6'));var controller=require(_0x5a33('0x7'));router[_0x5a33('0x8')]('/',auth[_0x5a33('0x9')](),controller[_0x5a33('0xa')]);router[_0x5a33('0x8')](_0x5a33('0xb'),auth[_0x5a33('0x9')](),controller['show']);router[_0x5a33('0xc')]('/',auth[_0x5a33('0x9')](),controller['create']);router[_0x5a33('0xd')]('/:id',auth[_0x5a33('0x9')](),controller[_0x5a33('0xe')]);router['delete'](_0x5a33('0xb'),auth[_0x5a33('0x9')](),controller[_0x5a33('0xf')]);module[_0x5a33('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 363aa07..8cac67e 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 _0x8cfb=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x41cb86,_0x2b7e0f){var _0x564c41=function(_0x54b055){while(--_0x54b055){_0x41cb86['push'](_0x41cb86['shift']());}};_0x564c41(++_0x2b7e0f);}(_0x8cfb,0xed));var _0xb8cf=function(_0x232cf2,_0x4ffb79){_0x232cf2=_0x232cf2-0x0;var _0x463cec=_0x8cfb[_0x232cf2];return _0x463cec;};'use strict';var Sequelize=require(_0xb8cf('0x0'));module[_0xb8cf('0x1')]={'priority':{'type':Sequelize[_0xb8cf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb8cf('0x3')],'allowNull':![],'defaultValue':_0xb8cf('0x4')},'appdata':{'type':Sequelize[_0xb8cf('0x5')]()},'description':{'type':Sequelize[_0xb8cf('0x3')]},'interval':{'type':Sequelize[_0xb8cf('0x3')],'defaultValue':_0xb8cf('0x6')}}; \ No newline at end of file +var _0x7fb5=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x5cd225,_0xa478f7){var _0x15f16a=function(_0x4a294f){while(--_0x4a294f){_0x5cd225['push'](_0x5cd225['shift']());}};_0x15f16a(++_0xa478f7);}(_0x7fb5,0x189));var _0x57fb=function(_0x36f72e,_0x1b492d){_0x36f72e=_0x36f72e-0x0;var _0x5b9b60=_0x7fb5[_0x36f72e];return _0x5b9b60;};'use strict';var Sequelize=require(_0x57fb('0x0'));module[_0x57fb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x57fb('0x2')],'allowNull':![],'defaultValue':_0x57fb('0x3')},'appdata':{'type':Sequelize[_0x57fb('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x57fb('0x2')],'defaultValue':_0x57fb('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 2264b5a..bf1e295 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 _0x8710=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x5dd0f7,_0x14873c){var _0x115793=function(_0x39928d){while(--_0x39928d){_0x5dd0f7['push'](_0x5dd0f7['shift']());}};_0x115793(++_0x14873c);}(_0x8710,0x68));var _0x0871=function(_0x5386f8,_0x5db228){_0x5386f8=_0x5386f8-0x0;var _0x1cd006=_0x8710[_0x5386f8];return _0x1cd006;};'use strict';var emlformat=require(_0x0871('0x0'));var rimraf=require(_0x0871('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0871('0x2'));var rp=require(_0x0871('0x3'));var moment=require(_0x0871('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0871('0x5'));var util=require(_0x0871('0x6'));var path=require('path');var sox=require(_0x0871('0x7'));var csv=require('to-csv');var ejs=require(_0x0871('0x8'));var fs=require('fs');var fs_extra=require(_0x0871('0x9'));var _=require(_0x0871('0xa'));var squel=require(_0x0871('0xb'));var crypto=require(_0x0871('0xc'));var jsforce=require(_0x0871('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0871('0xe'));var querystring=require(_0x0871('0xf'));var Papa=require(_0x0871('0x10'));var Redis=require(_0x0871('0x11'));var authService=require(_0x0871('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0871('0x13'));var hardwareService=require(_0x0871('0x14'));var logger=require(_0x0871('0x15'))(_0x0871('0x16'));var utils=require(_0x0871('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0871('0x18'));var db=require(_0x0871('0x19'))['db'];function respondWithStatusCode(_0xc94c7b,_0x4759f2){_0x4759f2=_0x4759f2||0xcc;return function(_0x2b0031){if(_0x2b0031){return _0xc94c7b[_0x0871('0x1a')](_0x4759f2);}return _0xc94c7b[_0x0871('0x1b')](_0x4759f2)[_0x0871('0x1c')]();};}function respondWithResult(_0x552807,_0x4e1ad4){_0x4e1ad4=_0x4e1ad4||0xc8;return function(_0x34a51a){if(_0x34a51a){return _0x552807[_0x0871('0x1b')](_0x4e1ad4)[_0x0871('0x1d')](_0x34a51a);}};}function respondWithFilteredResult(_0xcba761,_0x153f30){return function(_0x2dde49){if(_0x2dde49){var _0x43ccae=typeof _0x153f30[_0x0871('0x1e')]===_0x0871('0x1f')&&typeof _0x153f30['limit']===_0x0871('0x1f');var _0x5f49b1=_0x2dde49[_0x0871('0x20')];var _0x238d3a=_0x43ccae?0x0:_0x153f30['offset'];var _0x6036b0=_0x43ccae?_0x2dde49[_0x0871('0x20')]:_0x153f30[_0x0871('0x1e')]+_0x153f30[_0x0871('0x21')];var _0x4d2033;if(_0x6036b0>=_0x5f49b1){_0x6036b0=_0x5f49b1;_0x4d2033=0xc8;}else{_0x4d2033=0xce;}_0xcba761['status'](_0x4d2033);return _0xcba761[_0x0871('0x22')](_0x0871('0x23'),_0x238d3a+'-'+_0x6036b0+'/'+_0x5f49b1)[_0x0871('0x1d')](_0x2dde49);}return null;};}function patchUpdates(_0x1c7426){return function(_0x1b4917){try{jsonpatch[_0x0871('0x24')](_0x1b4917,_0x1c7426,!![]);}catch(_0x360dd2){return BPromise[_0x0871('0x25')](_0x360dd2);}return _0x1b4917[_0x0871('0x26')]();};}function saveUpdates(_0x10ecb6,_0xb1df80){return function(_0x1ba14d){if(_0x1ba14d){return _0x1ba14d[_0x0871('0x27')](_0x10ecb6)['then'](function(_0x292e57){return _0x292e57;});}return null;};}function removeEntity(_0xe92246,_0x20ca39){return function(_0x3290dd){if(_0x3290dd){return _0x3290dd['destroy']()[_0x0871('0x28')](function(){_0xe92246[_0x0871('0x1b')](0xcc)[_0x0871('0x1c')]();});}};}function handleEntityNotFound(_0x34bea0,_0x49a37b){return function(_0x4d7a7f){if(!_0x4d7a7f){_0x34bea0['sendStatus'](0x194);}return _0x4d7a7f;};}function handleError(_0x29bdbc,_0x296f87){_0x296f87=_0x296f87||0x1f4;return function(_0x128720){logger[_0x0871('0x29')](_0x128720[_0x0871('0x2a')]);if(_0x128720[_0x0871('0x2b')]){delete _0x128720[_0x0871('0x2b')];}_0x29bdbc[_0x0871('0x1b')](_0x296f87)['send'](_0x128720);};}exports[_0x0871('0x2c')]=function(_0xf1dbc9,_0x283268){var _0x3e0d69={},_0x35d1f9={},_0x3e58bc={'count':0x0,'rows':[]};var _0x42c264=_[_0x0871('0x2d')](db[_0x0871('0x2e')][_0x0871('0x2f')],function(_0x5995be){return{'name':_0x5995be[_0x0871('0x30')],'type':_0x5995be[_0x0871('0x31')][_0x0871('0x32')]};});_0x35d1f9[_0x0871('0x33')]=_['map'](_0x42c264,_0x0871('0x2b'));_0x35d1f9[_0x0871('0x34')]=_[_0x0871('0x35')](_0xf1dbc9[_0x0871('0x34')]);_0x35d1f9['filters']=_['intersection'](_0x35d1f9[_0x0871('0x33')],_0x35d1f9['query']);_0x3e0d69[_0x0871('0x36')]=_[_0x0871('0x37')](_0x35d1f9[_0x0871('0x33')],qs[_0x0871('0x38')](_0xf1dbc9['query'][_0x0871('0x38')]));_0x3e0d69[_0x0871('0x36')]=_0x3e0d69[_0x0871('0x36')][_0x0871('0x39')]?_0x3e0d69[_0x0871('0x36')]:_0x35d1f9[_0x0871('0x33')];if(!_0xf1dbc9[_0x0871('0x34')][_0x0871('0x3a')](_0x0871('0x3b'))){_0x3e0d69['limit']=qs[_0x0871('0x21')](_0xf1dbc9[_0x0871('0x34')]['limit']);_0x3e0d69[_0x0871('0x1e')]=qs[_0x0871('0x1e')](_0xf1dbc9[_0x0871('0x34')][_0x0871('0x1e')]);}_0x3e0d69[_0x0871('0x3c')]=qs[_0x0871('0x3d')](_0xf1dbc9[_0x0871('0x34')][_0x0871('0x3d')]);_0x3e0d69[_0x0871('0x3e')]=qs[_0x0871('0x3f')](_[_0x0871('0x40')](_0xf1dbc9[_0x0871('0x34')],_0x35d1f9[_0x0871('0x3f')]),_0x42c264);if(_0xf1dbc9[_0x0871('0x34')][_0x0871('0x41')]){_0x3e0d69[_0x0871('0x3e')]=_[_0x0871('0x42')](_0x3e0d69[_0x0871('0x3e')],{'$or':_['map'](_0x42c264,function(_0x38db9d){if(_0x38db9d[_0x0871('0x31')]!==_0x0871('0x43')){var _0x453088={};_0x453088[_0x38db9d[_0x0871('0x2b')]]={'$like':'%'+_0xf1dbc9['query'][_0x0871('0x41')]+'%'};return _0x453088;}})});}_0x3e0d69=_['merge']({},_0x3e0d69,_0xf1dbc9[_0x0871('0x44')]);var _0x435e57={'where':_0x3e0d69[_0x0871('0x3e')]};return db[_0x0871('0x2e')]['count'](_0x435e57)[_0x0871('0x28')](function(_0x28d6da){_0x3e58bc[_0x0871('0x20')]=_0x28d6da;if(_0xf1dbc9['query'][_0x0871('0x45')]){_0x3e0d69[_0x0871('0x46')]=[{'all':!![]}];}return db[_0x0871('0x2e')][_0x0871('0x47')](_0x3e0d69);})[_0x0871('0x28')](function(_0x1a84cb){_0x3e58bc[_0x0871('0x48')]=_0x1a84cb;return _0x3e58bc;})['then'](respondWithFilteredResult(_0x283268,_0x3e0d69))[_0x0871('0x49')](handleError(_0x283268,null));};exports[_0x0871('0x4a')]=function(_0x3e9bf3,_0x13d0d9){var _0x35c83b={'raw':!![],'where':{'id':_0x3e9bf3[_0x0871('0x4b')]['id']}},_0x17b7eb={};_0x17b7eb[_0x0871('0x33')]=_[_0x0871('0x35')](db[_0x0871('0x2e')][_0x0871('0x2f')]);_0x17b7eb[_0x0871('0x34')]=_['keys'](_0x3e9bf3[_0x0871('0x34')]);_0x17b7eb['filters']=_[_0x0871('0x37')](_0x17b7eb['model'],_0x17b7eb['query']);_0x35c83b[_0x0871('0x36')]=_[_0x0871('0x37')](_0x17b7eb[_0x0871('0x33')],qs[_0x0871('0x38')](_0x3e9bf3[_0x0871('0x34')][_0x0871('0x38')]));_0x35c83b[_0x0871('0x36')]=_0x35c83b[_0x0871('0x36')][_0x0871('0x39')]?_0x35c83b[_0x0871('0x36')]:_0x17b7eb[_0x0871('0x33')];if(_0x3e9bf3['query']['includeAll']){_0x35c83b[_0x0871('0x46')]=[{'all':!![]}];}_0x35c83b=_[_0x0871('0x42')]({},_0x35c83b,_0x3e9bf3[_0x0871('0x44')]);return db[_0x0871('0x2e')]['find'](_0x35c83b)[_0x0871('0x28')](handleEntityNotFound(_0x13d0d9,null))['then'](respondWithResult(_0x13d0d9,null))[_0x0871('0x49')](handleError(_0x13d0d9,null));};exports[_0x0871('0x4c')]=function(_0x5292a1,_0x3171a9){return db[_0x0871('0x2e')]['create'](_0x5292a1[_0x0871('0x4d')],{})['then'](respondWithResult(_0x3171a9,0xc9))[_0x0871('0x49')](handleError(_0x3171a9,null));};exports[_0x0871('0x27')]=function(_0x2cfa7d,_0x1799fe){if(_0x2cfa7d[_0x0871('0x4d')]['id']){delete _0x2cfa7d['body']['id'];}return db[_0x0871('0x2e')]['find']({'where':{'id':_0x2cfa7d['params']['id']}})[_0x0871('0x28')](handleEntityNotFound(_0x1799fe,null))[_0x0871('0x28')](saveUpdates(_0x2cfa7d[_0x0871('0x4d')],null))[_0x0871('0x28')](respondWithResult(_0x1799fe,null))[_0x0871('0x49')](handleError(_0x1799fe,null));};exports['destroy']=function(_0x2b9a5d,_0x584e04){return db[_0x0871('0x2e')][_0x0871('0x4e')]({'where':{'id':_0x2b9a5d[_0x0871('0x4b')]['id']}})[_0x0871('0x28')](handleEntityNotFound(_0x584e04,null))[_0x0871('0x28')](removeEntity(_0x584e04,null))[_0x0871('0x49')](handleError(_0x584e04,null));}; \ No newline at end of file +var _0x5942=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','destroy','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service'];(function(_0x270205,_0x4c6435){var _0x40ea04=function(_0x461a39){while(--_0x461a39){_0x270205['push'](_0x270205['shift']());}};_0x40ea04(++_0x4c6435);}(_0x5942,0x16a));var _0x2594=function(_0x2e8a4e,_0xd03324){_0x2e8a4e=_0x2e8a4e-0x0;var _0x43fb76=_0x5942[_0x2e8a4e];return _0x43fb76;};'use strict';var emlformat=require(_0x2594('0x0'));var rimraf=require(_0x2594('0x1'));var zipdir=require(_0x2594('0x2'));var jsonpatch=require(_0x2594('0x3'));var rp=require(_0x2594('0x4'));var moment=require(_0x2594('0x5'));var BPromise=require(_0x2594('0x6'));var Mustache=require(_0x2594('0x7'));var util=require(_0x2594('0x8'));var path=require(_0x2594('0x9'));var sox=require(_0x2594('0xa'));var csv=require(_0x2594('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2594('0xc'));var squel=require(_0x2594('0xd'));var crypto=require(_0x2594('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2594('0xf'));var toCsv=require(_0x2594('0xb'));var querystring=require('querystring');var Papa=require(_0x2594('0x10'));var Redis=require('ioredis');var authService=require(_0x2594('0x11'));var qs=require(_0x2594('0x12'));var as=require(_0x2594('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2594('0x14'))(_0x2594('0x15'));var utils=require(_0x2594('0x16'));var config=require(_0x2594('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2594('0x18'))['db'];function respondWithStatusCode(_0x1ba533,_0x371ff3){_0x371ff3=_0x371ff3||0xcc;return function(_0x3aa70e){if(_0x3aa70e){return _0x1ba533[_0x2594('0x19')](_0x371ff3);}return _0x1ba533[_0x2594('0x1a')](_0x371ff3)[_0x2594('0x1b')]();};}function respondWithResult(_0xa26e3a,_0x271894){_0x271894=_0x271894||0xc8;return function(_0x5da604){if(_0x5da604){return _0xa26e3a[_0x2594('0x1a')](_0x271894)[_0x2594('0x1c')](_0x5da604);}};}function respondWithFilteredResult(_0x587bad,_0x1cbb20){return function(_0x4cc124){if(_0x4cc124){var _0x192f3d=typeof _0x1cbb20[_0x2594('0x1d')]===_0x2594('0x1e')&&typeof _0x1cbb20[_0x2594('0x1f')]===_0x2594('0x1e');var _0x59a199=_0x4cc124[_0x2594('0x20')];var _0x457beb=_0x192f3d?0x0:_0x1cbb20[_0x2594('0x1d')];var _0x31f24a=_0x192f3d?_0x4cc124[_0x2594('0x20')]:_0x1cbb20[_0x2594('0x1d')]+_0x1cbb20[_0x2594('0x1f')];var _0x3f022d;if(_0x31f24a>=_0x59a199){_0x31f24a=_0x59a199;_0x3f022d=0xc8;}else{_0x3f022d=0xce;}_0x587bad[_0x2594('0x1a')](_0x3f022d);return _0x587bad['set']('Content-Range',_0x457beb+'-'+_0x31f24a+'/'+_0x59a199)[_0x2594('0x1c')](_0x4cc124);}return null;};}function patchUpdates(_0x40a1f2){return function(_0x266cb9){try{jsonpatch[_0x2594('0x21')](_0x266cb9,_0x40a1f2,!![]);}catch(_0x3b68eb){return BPromise[_0x2594('0x22')](_0x3b68eb);}return _0x266cb9['save']();};}function saveUpdates(_0x44766c,_0x3bbebd){return function(_0x121a8e){if(_0x121a8e){return _0x121a8e[_0x2594('0x23')](_0x44766c)['then'](function(_0x39fb25){return _0x39fb25;});}return null;};}function removeEntity(_0x5685fd,_0x281987){return function(_0x5eed6f){if(_0x5eed6f){return _0x5eed6f[_0x2594('0x24')]()[_0x2594('0x25')](function(){_0x5685fd['status'](0xcc)[_0x2594('0x1b')]();});}};}function handleEntityNotFound(_0x48a306,_0x2a01a9){return function(_0x12258e){if(!_0x12258e){_0x48a306[_0x2594('0x19')](0x194);}return _0x12258e;};}function handleError(_0x38feeb,_0x1b2820){_0x1b2820=_0x1b2820||0x1f4;return function(_0xf60655){logger[_0x2594('0x26')](_0xf60655[_0x2594('0x27')]);if(_0xf60655['name']){delete _0xf60655[_0x2594('0x28')];}_0x38feeb['status'](_0x1b2820)['send'](_0xf60655);};}exports[_0x2594('0x29')]=function(_0x21339d,_0x4dc1a5){var _0x36fdf4={},_0xa8ee54={},_0x590123={'count':0x0,'rows':[]};var _0x273e04=_[_0x2594('0x2a')](db[_0x2594('0x2b')][_0x2594('0x2c')],function(_0x587af2){return{'name':_0x587af2[_0x2594('0x2d')],'type':_0x587af2[_0x2594('0x2e')][_0x2594('0x2f')]};});_0xa8ee54[_0x2594('0x30')]=_[_0x2594('0x2a')](_0x273e04,'name');_0xa8ee54[_0x2594('0x31')]=_[_0x2594('0x32')](_0x21339d['query']);_0xa8ee54['filters']=_[_0x2594('0x33')](_0xa8ee54[_0x2594('0x30')],_0xa8ee54[_0x2594('0x31')]);_0x36fdf4[_0x2594('0x34')]=_['intersection'](_0xa8ee54[_0x2594('0x30')],qs[_0x2594('0x35')](_0x21339d['query']['fields']));_0x36fdf4['attributes']=_0x36fdf4['attributes']['length']?_0x36fdf4[_0x2594('0x34')]:_0xa8ee54[_0x2594('0x30')];if(!_0x21339d[_0x2594('0x31')][_0x2594('0x36')](_0x2594('0x37'))){_0x36fdf4[_0x2594('0x1f')]=qs[_0x2594('0x1f')](_0x21339d[_0x2594('0x31')][_0x2594('0x1f')]);_0x36fdf4[_0x2594('0x1d')]=qs[_0x2594('0x1d')](_0x21339d[_0x2594('0x31')][_0x2594('0x1d')]);}_0x36fdf4[_0x2594('0x38')]=qs[_0x2594('0x39')](_0x21339d['query']['sort']);_0x36fdf4[_0x2594('0x3a')]=qs[_0x2594('0x3b')](_[_0x2594('0x3c')](_0x21339d[_0x2594('0x31')],_0xa8ee54[_0x2594('0x3b')]),_0x273e04);if(_0x21339d[_0x2594('0x31')][_0x2594('0x3d')]){_0x36fdf4[_0x2594('0x3a')]=_[_0x2594('0x3e')](_0x36fdf4['where'],{'$or':_['map'](_0x273e04,function(_0x1754f5){if(_0x1754f5['type']!==_0x2594('0x3f')){var _0x2b3887={};_0x2b3887[_0x1754f5[_0x2594('0x28')]]={'$like':'%'+_0x21339d[_0x2594('0x31')]['filter']+'%'};return _0x2b3887;}})});}_0x36fdf4=_['merge']({},_0x36fdf4,_0x21339d['options']);var _0x6df7f1={'where':_0x36fdf4[_0x2594('0x3a')]};return db[_0x2594('0x2b')][_0x2594('0x20')](_0x6df7f1)[_0x2594('0x25')](function(_0xc866c2){_0x590123['count']=_0xc866c2;if(_0x21339d[_0x2594('0x31')][_0x2594('0x40')]){_0x36fdf4[_0x2594('0x41')]=[{'all':!![]}];}return db[_0x2594('0x2b')][_0x2594('0x42')](_0x36fdf4);})['then'](function(_0x5d9268){_0x590123[_0x2594('0x43')]=_0x5d9268;return _0x590123;})[_0x2594('0x25')](respondWithFilteredResult(_0x4dc1a5,_0x36fdf4))[_0x2594('0x44')](handleError(_0x4dc1a5,null));};exports[_0x2594('0x45')]=function(_0x5e6bad,_0x582e5f){var _0x5b2aa9={'raw':!![],'where':{'id':_0x5e6bad[_0x2594('0x46')]['id']}},_0x4906f8={};_0x4906f8[_0x2594('0x30')]=_['keys'](db[_0x2594('0x2b')][_0x2594('0x2c')]);_0x4906f8['query']=_[_0x2594('0x32')](_0x5e6bad['query']);_0x4906f8[_0x2594('0x3b')]=_[_0x2594('0x33')](_0x4906f8[_0x2594('0x30')],_0x4906f8[_0x2594('0x31')]);_0x5b2aa9[_0x2594('0x34')]=_[_0x2594('0x33')](_0x4906f8['model'],qs[_0x2594('0x35')](_0x5e6bad['query']['fields']));_0x5b2aa9[_0x2594('0x34')]=_0x5b2aa9['attributes'][_0x2594('0x47')]?_0x5b2aa9[_0x2594('0x34')]:_0x4906f8[_0x2594('0x30')];if(_0x5e6bad[_0x2594('0x31')][_0x2594('0x40')]){_0x5b2aa9[_0x2594('0x41')]=[{'all':!![]}];}_0x5b2aa9=_[_0x2594('0x3e')]({},_0x5b2aa9,_0x5e6bad[_0x2594('0x48')]);return db[_0x2594('0x2b')][_0x2594('0x49')](_0x5b2aa9)[_0x2594('0x25')](handleEntityNotFound(_0x582e5f,null))[_0x2594('0x25')](respondWithResult(_0x582e5f,null))['catch'](handleError(_0x582e5f,null));};exports[_0x2594('0x4a')]=function(_0x4b0ce5,_0x1a49b7){return db[_0x2594('0x2b')][_0x2594('0x4a')](_0x4b0ce5[_0x2594('0x4b')],{})['then'](respondWithResult(_0x1a49b7,0xc9))[_0x2594('0x44')](handleError(_0x1a49b7,null));};exports[_0x2594('0x23')]=function(_0x2de34e,_0x5dcbe1){if(_0x2de34e[_0x2594('0x4b')]['id']){delete _0x2de34e[_0x2594('0x4b')]['id'];}return db[_0x2594('0x2b')][_0x2594('0x49')]({'where':{'id':_0x2de34e[_0x2594('0x46')]['id']}})[_0x2594('0x25')](handleEntityNotFound(_0x5dcbe1,null))[_0x2594('0x25')](saveUpdates(_0x2de34e[_0x2594('0x4b')],null))['then'](respondWithResult(_0x5dcbe1,null))[_0x2594('0x44')](handleError(_0x5dcbe1,null));};exports[_0x2594('0x24')]=function(_0x45e1eb,_0x8719e0){return db[_0x2594('0x2b')]['find']({'where':{'id':_0x45e1eb[_0x2594('0x46')]['id']}})[_0x2594('0x25')](handleEntityNotFound(_0x8719e0,null))['then'](removeEntity(_0x8719e0,null))['catch'](handleError(_0x8719e0,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 5b2eb87..8d38eb2 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 _0xa37e=['bluebird','path','../../config/environment','./whatsappApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x35a22f,_0x4f99bd){var _0x5964e3=function(_0x3814b0){while(--_0x3814b0){_0x35a22f['push'](_0x35a22f['shift']());}};_0x5964e3(++_0x4f99bd);}(_0xa37e,0x97));var _0xea37=function(_0x56eb8d,_0x19f51a){_0x56eb8d=_0x56eb8d-0x0;var _0x2f29e1=_0xa37e[_0x56eb8d];return _0x2f29e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xea37('0x0'))(_0xea37('0x1'));var moment=require(_0xea37('0x2'));var BPromise=require(_0xea37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea37('0x4'));var rimraf=require('rimraf');var config=require(_0xea37('0x5'));var attributes=require(_0xea37('0x6'));module[_0xea37('0x7')]=function(_0x4d380b,_0x57135b){return _0x4d380b[_0xea37('0x8')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xea37('0x9'),'collate':_0xea37('0xa')});}; \ No newline at end of file +var _0x17c4=['rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44d36b,_0xe42dd7){var _0x942f84=function(_0x164274){while(--_0x164274){_0x44d36b['push'](_0x44d36b['shift']());}};_0x942f84(++_0xe42dd7);}(_0x17c4,0x102));var _0x417c=function(_0x282536,_0x3ba66a){_0x282536=_0x282536-0x0;var _0x76aa80=_0x17c4[_0x282536];return _0x76aa80;};'use strict';var _=require(_0x417c('0x0'));var util=require(_0x417c('0x1'));var logger=require(_0x417c('0x2'))(_0x417c('0x3'));var moment=require(_0x417c('0x4'));var BPromise=require(_0x417c('0x5'));var rp=require(_0x417c('0x6'));var fs=require('fs');var path=require(_0x417c('0x7'));var rimraf=require(_0x417c('0x8'));var config=require(_0x417c('0x9'));var attributes=require(_0x417c('0xa'));module['exports']=function(_0x24e681,_0x117c5d){return _0x24e681[_0x417c('0xb')](_0x417c('0xc'),attributes,{'tableName':_0x417c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 5ef949c..e7b2c64 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x492bdc,_0x5633a1){var _0x1f4fa0=function(_0x22434e){while(--_0x22434e){_0x492bdc['push'](_0x492bdc['shift']());}};_0x1f4fa0(++_0x5633a1);}(_0x81bd,0x7c));var _0xd81b=function(_0x356005,_0x411466){_0x356005=_0x356005-0x0;var _0x2bb35b=_0x81bd[_0x356005];return _0x2bb35b;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});} \ No newline at end of file +var _0x5636=['code','WhatsappApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5636,0x102));var _0x6563=function(_0x10b737,_0x47be85){_0x10b737=_0x10b737-0x0;var _0x1ec9d3=_0x5636[_0x10b737];return _0x1ec9d3;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index f49a969..e08ffb6 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 _0x6596=['whatsappinteraction:destroy','delete','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update'];(function(_0x1d60cf,_0x38f82e){var _0x4e8d37=function(_0x5a298f){while(--_0x5a298f){_0x1d60cf['push'](_0x1d60cf['shift']());}};_0x4e8d37(++_0x38f82e);}(_0x6596,0x1d3));var _0x6659=function(_0x1979ee,_0x5aae8c){_0x1979ee=_0x1979ee-0x0;var _0x113f7a=_0x6596[_0x1979ee];return _0x113f7a;};'use strict';var multer=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var path=require('path');var timeout=require(_0x6659('0x2'));var express=require(_0x6659('0x3'));var router=express[_0x6659('0x4')]();var fs_extra=require(_0x6659('0x5'));var auth=require(_0x6659('0x6'));var interaction=require(_0x6659('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x6659('0x8')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0xa')]);router[_0x6659('0x8')](_0x6659('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6659('0x8')](_0x6659('0xc'),auth[_0x6659('0x9')](),controller[_0x6659('0xd')]);router[_0x6659('0x8')](_0x6659('0xe'),auth['isAuthenticated'](),controller[_0x6659('0xf')]);router['get']('/:id/download',auth[_0x6659('0x9')](),controller['download']);router[_0x6659('0x10')]('/',auth[_0x6659('0x9')](),controller[_0x6659('0x11')]);router[_0x6659('0x10')]('/:id/messages',auth[_0x6659('0x9')](),controller[_0x6659('0x12')]);router['post'](_0x6659('0x13'),auth[_0x6659('0x9')](),interaction[_0x6659('0x14')](_0x6659('0x15'),_0x6659('0x16')),controller[_0x6659('0x17')]);router['put'](_0x6659('0xc'),auth[_0x6659('0x9')](),interaction[_0x6659('0x14')](_0x6659('0x15'),_0x6659('0x18')),controller[_0x6659('0x19')]);router['delete']('/:id',auth[_0x6659('0x9')](),interaction['tracked'](_0x6659('0x15'),_0x6659('0x1a')),controller['destroy']);router[_0x6659('0x1b')]('/:id/tags',auth[_0x6659('0x9')](),controller[_0x6659('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xfd87=['index','/describe','describe','get','/:id','show','/:id/messages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated'];(function(_0x249c5b,_0x5b1b7e){var _0x15bf73=function(_0xc9e1c6){while(--_0xc9e1c6){_0x249c5b['push'](_0x249c5b['shift']());}};_0x15bf73(++_0x5b1b7e);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')](_0x7fd8('0x10'),auth['isAuthenticated'](),controller[_0x7fd8('0x11')]);router[_0x7fd8('0xf')](_0x7fd8('0x12'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x7fd8('0x13'),auth['isAuthenticated'](),controller[_0x7fd8('0x14')]);router[_0x7fd8('0x15')]('/',auth[_0x7fd8('0xb')](),controller['create']);router[_0x7fd8('0x15')](_0x7fd8('0x12'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0x16')]);router[_0x7fd8('0x15')]('/:id/tags',auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')](_0x7fd8('0x18'),_0x7fd8('0x19')),controller[_0x7fd8('0x1a')]);router[_0x7fd8('0x1b')](_0x7fd8('0x10'),auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')](_0x7fd8('0x18'),_0x7fd8('0x1c')),controller['update']);router['delete']('/:id',auth[_0x7fd8('0xb')](),interaction[_0x7fd8('0x17')]('whatsapp',_0x7fd8('0x1d')),controller[_0x7fd8('0x1e')]);router[_0x7fd8('0x1f')](_0x7fd8('0x20'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0x21')]);module[_0x7fd8('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 8819720..39e3aa3 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 _0x6629=['sequelize','BOOLEAN','DATE','STRING','out','ENUM'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x6629,0x1c2));var _0x9662=function(_0x3e3081,_0x52294a){_0x3e3081=_0x3e3081-0x0;var _0x138e17=_0x6629[_0x3e3081];return _0x138e17;};'use strict';var Sequelize=require(_0x9662('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x9662('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9662('0x2')]},'disposition':{'type':Sequelize[_0x9662('0x3')]},'secondDisposition':{'type':Sequelize[_0x9662('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9662('0x3')]},'phone':{'type':Sequelize[_0x9662('0x3')]},'read1stAt':{'type':Sequelize[_0x9662('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x9662('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9662('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9662('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9662('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5ba3=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x27755a,_0x307a31){var _0x11d399=function(_0x36b229){while(--_0x36b229){_0x27755a['push'](_0x27755a['shift']());}};_0x11d399(++_0x307a31);}(_0x5ba3,0x140));var _0x35ba=function(_0x3d89e0,_0x329b7d){_0x3d89e0=_0x3d89e0-0x0;var _0x5a2354=_0x5ba3[_0x3d89e0];return _0x5a2354;};'use strict';var Sequelize=require(_0x35ba('0x0'));var moment=require('moment');module[_0x35ba('0x1')]={'closed':{'type':Sequelize[_0x35ba('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x35ba('0x3')]},'secondDisposition':{'type':Sequelize[_0x35ba('0x3')]},'thirdDisposition':{'type':Sequelize[_0x35ba('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x35ba('0x3')]},'read1stAt':{'type':Sequelize[_0x35ba('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x35ba('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x35ba('0x5')]('in',_0x35ba('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x35ba('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index d196175..b0a110d 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 _0x547c=['getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','push','User','fullname','Contact','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','createdAt','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','out','System','firstName','value','renderFile','views','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','then','end','sendStatus','error','stack','name','index','WhatsappInteraction','fieldName','type','key','getOptions','findAll','whatsapp','query','show','params','keys','filters','model','attributes','intersection','fields','includeAll','include','merge','options','find','catch','body','update','describe','addMessage','WhatsappMessage','ids'];(function(_0x5399dd,_0x352e11){var _0x4d2570=function(_0x3f1644){while(--_0x3f1644){_0x5399dd['push'](_0x5399dd['shift']());}};_0x4d2570(++_0x352e11);}(_0x547c,0x143));var _0xc547=function(_0x242355,_0x3fc5de){_0x242355=_0x242355-0x0;var _0x351b20=_0x547c[_0x242355];return _0x351b20;};'use strict';var rimraf=require(_0xc547('0x0'));var zipdir=require(_0xc547('0x1'));var moment=require(_0xc547('0x2'));var BPromise=require(_0xc547('0x3'));var util=require(_0xc547('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc547('0x5'));var Redis=require(_0xc547('0x6'));var interaction=require(_0xc547('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc547('0x8'));var logger=require('../../config/logger')(_0xc547('0x9'));var config=require(_0xc547('0xa'));var db=require(_0xc547('0xb'))['db'];config['redis']=_[_0xc547('0xc')](config[_0xc547('0xd')],{'host':_0xc547('0xe'),'port':0x18eb});var socket=require(_0xc547('0xf'))(new Redis(config[_0xc547('0xd')]));require(_0xc547('0x10'))[_0xc547('0x11')](socket);function respondWithStatusCode(_0x2056b8,_0x55f519){_0x55f519=_0x55f519||0xcc;return function(_0x1d0ebc){if(_0x1d0ebc){return _0x2056b8['sendStatus'](_0x55f519);}return _0x2056b8['status'](_0x55f519)['end']();};}function respondWithResult(_0x5098b8,_0x213fe1){_0x213fe1=_0x213fe1||0xc8;return function(_0x593d87){if(_0x593d87){return _0x5098b8[_0xc547('0x12')](_0x213fe1)[_0xc547('0x13')](_0x593d87);}};}function respondWithFilteredResult(_0x491ab8,_0xe87040){return function(_0x1462d8){if(_0x1462d8){var _0x296a77=typeof _0xe87040[_0xc547('0x14')]===_0xc547('0x15')&&typeof _0xe87040[_0xc547('0x16')]===_0xc547('0x15');var _0x30f8c8=_0x1462d8[_0xc547('0x17')];var _0x2d5b48=_0x296a77?0x0:_0xe87040[_0xc547('0x14')];var _0x403584=_0x296a77?_0x1462d8[_0xc547('0x17')]:_0xe87040[_0xc547('0x14')]+_0xe87040[_0xc547('0x16')];var _0x21affe;if(_0x403584>=_0x30f8c8){_0x403584=_0x30f8c8;_0x21affe=0xc8;}else{_0x21affe=0xce;}_0x491ab8['status'](_0x21affe);return _0x491ab8[_0xc547('0x18')](_0xc547('0x19'),_0x2d5b48+'-'+_0x403584+'/'+_0x30f8c8)['json'](_0x1462d8);}return null;};}function saveUpdates(_0x2e1e83){return function(_0x4ef718){if(_0x4ef718){return _0x4ef718['update'](_0x2e1e83)[_0xc547('0x1a')](function(_0xccf72){return _0xccf72;});}return null;};}function removeEntity(_0x222925){return function(_0x7bc0bd){if(_0x7bc0bd){return _0x7bc0bd['destroy']()[_0xc547('0x1a')](function(){_0x222925[_0xc547('0x12')](0xcc)[_0xc547('0x1b')]();});}};}function handleEntityNotFound(_0x1cfe04){return function(_0x3e8795){if(!_0x3e8795){_0x1cfe04[_0xc547('0x1c')](0x194);}return _0x3e8795;};}function handleError(_0x287c9a,_0x42cb61){_0x42cb61=_0x42cb61||0x1f4;return function(_0x3fb8a7){logger[_0xc547('0x1d')](_0x3fb8a7[_0xc547('0x1e')]);if(_0x3fb8a7[_0xc547('0x1f')]){delete _0x3fb8a7[_0xc547('0x1f')];}_0x287c9a[_0xc547('0x12')](_0x42cb61)['send'](_0x3fb8a7);};}exports[_0xc547('0x20')]=function(_0x30e8cd,_0xa9df0e){var _0x22bea4={};var _0x2350dd=_['map'](db[_0xc547('0x21')]['rawAttributes'],function(_0x524b94){return{'name':_0x524b94[_0xc547('0x22')],'type':_0x524b94[_0xc547('0x23')][_0xc547('0x24')]};});_0x22bea4=qs[_0xc547('0x25')](_0x2350dd,_0x30e8cd);return interaction[_0xc547('0x26')](_0xc547('0x27'),_0x30e8cd[_0xc547('0x28')],_0x30e8cd['user'],_0x22bea4,_0x2350dd)[_0xc547('0x1a')](respondWithFilteredResult(_0xa9df0e,_0x22bea4))['catch'](handleError(_0xa9df0e,null));};exports[_0xc547('0x29')]=function(_0x50c5f7,_0x3e26d6){var _0x4b8105={'raw':![],'where':{'id':_0x50c5f7[_0xc547('0x2a')]['id']}},_0x3d9db2={};_0x3d9db2['model']=_['keys'](db[_0xc547('0x21')]['rawAttributes']);_0x3d9db2['query']=_[_0xc547('0x2b')](_0x50c5f7[_0xc547('0x28')]);_0x3d9db2[_0xc547('0x2c')]=_['intersection'](_0x3d9db2[_0xc547('0x2d')],_0x3d9db2[_0xc547('0x28')]);_0x4b8105[_0xc547('0x2e')]=_[_0xc547('0x2f')](_0x3d9db2[_0xc547('0x2d')],qs[_0xc547('0x30')](_0x50c5f7[_0xc547('0x28')][_0xc547('0x30')]));_0x4b8105[_0xc547('0x2e')]=_0x4b8105['attributes']['length']?_0x4b8105['attributes']:_0x3d9db2[_0xc547('0x2d')];if(_0x50c5f7[_0xc547('0x28')][_0xc547('0x31')]){_0x4b8105[_0xc547('0x32')]=[{'all':!![]}];}_0x4b8105=_[_0xc547('0x33')]({},_0x4b8105,_0x50c5f7[_0xc547('0x34')]);return db['WhatsappInteraction'][_0xc547('0x35')](_0x4b8105)[_0xc547('0x1a')](handleEntityNotFound(_0x3e26d6,null))[_0xc547('0x1a')](respondWithResult(_0x3e26d6,null))[_0xc547('0x36')](handleError(_0x3e26d6,null));};exports['create']=function(_0x323d03,_0x28d019){return db['WhatsappInteraction']['create'](_0x323d03[_0xc547('0x37')],{})[_0xc547('0x1a')](respondWithResult(_0x28d019,0xc9))[_0xc547('0x36')](handleError(_0x28d019,null));};exports[_0xc547('0x38')]=function(_0x52f7ca,_0x284a54){if(_0x52f7ca[_0xc547('0x37')]['id']){delete _0x52f7ca['body']['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x52f7ca[_0xc547('0x2a')]['id']}})[_0xc547('0x1a')](handleEntityNotFound(_0x284a54,null))['then'](saveUpdates(_0x52f7ca[_0xc547('0x37')],null))[_0xc547('0x1a')](respondWithResult(_0x284a54,null))[_0xc547('0x36')](handleError(_0x284a54,null));};exports['destroy']=function(_0x3ba68d,_0x440ef9){return db[_0xc547('0x21')][_0xc547('0x35')]({'where':{'id':_0x3ba68d[_0xc547('0x2a')]['id']}})[_0xc547('0x1a')](handleEntityNotFound(_0x440ef9,null))['then'](removeEntity(_0x440ef9,null))[_0xc547('0x36')](handleError(_0x440ef9,null));};exports['describe']=function(_0x2f276e,_0x4dbefd){return db[_0xc547('0x21')][_0xc547('0x39')]()[_0xc547('0x1a')](respondWithResult(_0x4dbefd,null))[_0xc547('0x36')](handleError(_0x4dbefd,null));};exports[_0xc547('0x3a')]=function(_0x4c89d7,_0x4eb66d){return db[_0xc547('0x3b')][_0xc547('0x35')]({'where':{'id':_0x4c89d7[_0xc547('0x2a')]['id']}})[_0xc547('0x1a')](handleEntityNotFound(_0x4eb66d,null))['then'](function(_0x2c22da){if(_0x2c22da){return _0x2c22da[_0xc547('0x3a')](_0x4c89d7[_0xc547('0x37')][_0xc547('0x3c')],_['omit'](_0x4c89d7[_0xc547('0x37')],[_0xc547('0x3c'),'id'])||{});}})[_0xc547('0x1a')](respondWithResult(_0x4eb66d,null))[_0xc547('0x36')](handleError(_0x4eb66d,null));};exports[_0xc547('0x3d')]=function(_0x4592a4,_0x36af48){var _0x4c3c87={'raw':![],'where':{}};var _0x33b44c={};var _0x3b659e={'count':0x0,'rows':[]};return db[_0xc547('0x21')][_0xc547('0x3e')]({'where':{'id':_0x4592a4['params']['id']}})['then'](handleEntityNotFound(_0x36af48,null))[_0xc547('0x1a')](function(_0x2576a7){if(_0x2576a7){_0x33b44c[_0xc547('0x2d')]=_['keys'](db[_0xc547('0x3b')]['rawAttributes']);_0x33b44c[_0xc547('0x28')]=_[_0xc547('0x2b')](_0x4592a4[_0xc547('0x28')]);_0x33b44c[_0xc547('0x2c')]=_[_0xc547('0x2f')](_0x33b44c[_0xc547('0x2d')],_0x33b44c['query']);_0x4c3c87[_0xc547('0x2e')]=_[_0xc547('0x2f')](_0x33b44c['model'],qs[_0xc547('0x30')](_0x4592a4[_0xc547('0x28')][_0xc547('0x30')]));_0x4c3c87['attributes']=_0x4c3c87['attributes']['length']?_0x4c3c87[_0xc547('0x2e')]:_0x33b44c['model'];if(!_0x4592a4['query'][_0xc547('0x3f')](_0xc547('0x40'))){_0x4c3c87[_0xc547('0x16')]=qs['limit'](_0x4592a4['query'][_0xc547('0x16')]);_0x4c3c87[_0xc547('0x14')]=qs['offset'](_0x4592a4['query'][_0xc547('0x14')]);}_0x4c3c87[_0xc547('0x41')]=qs[_0xc547('0x42')](_0x4592a4['query']['sort']);_0x4c3c87[_0xc547('0x43')]=qs[_0xc547('0x2c')](_[_0xc547('0x44')](_0x4592a4[_0xc547('0x28')],_0x33b44c[_0xc547('0x2c')]));_0x4c3c87[_0xc547('0x43')][_0xc547('0x45')]=_0x2576a7['id'];if(_0x4592a4[_0xc547('0x28')][_0xc547('0x46')]){_0x4c3c87[_0xc547('0x43')]=_[_0xc547('0x33')](_0x4c3c87[_0xc547('0x43')],{'$or':_[_0xc547('0x47')](_0x4c3c87[_0xc547('0x2e')],function(_0x2b905a){var _0x1d5acb={};_0x1d5acb[_0x2b905a]={'$like':'%'+_0x4592a4[_0xc547('0x28')][_0xc547('0x46')]+'%'};return _0x1d5acb;})});}if(_0x4592a4['query']['$gte']){var _0x1f2bf8=_0x4592a4['query'][_0xc547('0x48')][_0xc547('0x49')](',');var _0x2d8838={};_0x2d8838[_0x1f2bf8[0x0]]={'$gte':moment(_0x1f2bf8[0x1])[_0xc547('0x4a')](_0xc547('0x4b'))};_0x4c3c87[_0xc547('0x43')]=_['merge'](_0x4c3c87[_0xc547('0x43')],_0x2d8838);}_0x4c3c87=_[_0xc547('0x33')]({},_0x4c3c87,_0x4592a4[_0xc547('0x34')]);return db[_0xc547('0x3b')][_0xc547('0x17')]({'where':_0x4c3c87['where']})[_0xc547('0x1a')](function(_0x4d4725){_0x3b659e['count']=_0x4d4725;if(_0x4592a4[_0xc547('0x28')]['includeAll']){_0x4c3c87[_0xc547('0x32')]=[{'all':!![]}];}return db[_0xc547('0x3b')][_0xc547('0x26')](_0x4c3c87);})[_0xc547('0x1a')](function(_0x367b00){_0x3b659e[_0xc547('0x4c')]=_0x367b00;return _0x3b659e;});}})[_0xc547('0x1a')](respondWithFilteredResult(_0x36af48,_0x4c3c87))[_0xc547('0x36')](handleError(_0x36af48,null));};exports[_0xc547('0x4d')]=function(_0x55908d,_0x4802cb){return db[_0xc547('0x21')][_0xc547('0x35')]({'where':{'id':_0x55908d[_0xc547('0x2a')]['id']}})[_0xc547('0x1a')](handleEntityNotFound(_0x4802cb,null))[_0xc547('0x1a')](function(_0x96b9e2){if(_0x96b9e2){return _0x96b9e2[_0xc547('0x4e')](_0x55908d[_0xc547('0x37')][_0xc547('0x3c')],_['omit'](_0x55908d[_0xc547('0x37')],[_0xc547('0x3c'),'id'])||{})[_0xc547('0x4f')](function(){return db[_0xc547('0x50')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x55908d[_0xc547('0x37')][_0xc547('0x3c')]}});})[_0xc547('0x1a')](function(_0x3d259e){socket[_0xc547('0x51')](_0xc547('0x52'),{'id':Number(_0x55908d[_0xc547('0x2a')]['id']),'tags':_0x3d259e||[]});return{'id':Number(_0x55908d[_0xc547('0x2a')]['id']),'tags':_0x3d259e||[]};});}})[_0xc547('0x1a')](respondWithResult(_0x4802cb,null))[_0xc547('0x36')](handleError(_0x4802cb,null));};exports[_0xc547('0x53')]=function(_0x597e4c,_0x38edf6){return db[_0xc547('0x21')][_0xc547('0x35')]({'where':{'id':_0x597e4c['params']['id']}})[_0xc547('0x1a')](handleEntityNotFound(_0x38edf6,null))[_0xc547('0x1a')](function(_0x39a3c1){if(_0x39a3c1){return _0x39a3c1[_0xc547('0x53')](_0x597e4c['query']['ids']);}})[_0xc547('0x1a')](respondWithStatusCode(_0x38edf6,null))['catch'](handleError(_0x38edf6,null));};exports[_0xc547('0x54')]=function(_0x421b9d,_0x20d90e){var _0x4d1dcd=moment()[_0xc547('0x55')]()[_0xc547('0x56')]();var _0x20ff9c=path[_0xc547('0x57')](config[_0xc547('0x58')],'server',_0xc547('0x59'),_0xc547('0x5a'));var _0x123c97=path[_0xc547('0x57')](config[_0xc547('0x58')],_0xc547('0x5b'),_0xc547('0x59'),_0xc547('0x5c'));var _0x237d3b=path[_0xc547('0x57')](_0x20ff9c,_0x4d1dcd);var _0xadc31a=util[_0xc547('0x4a')]('transcript-%d-%s.zip',_0x421b9d[_0xc547('0x2a')]['id'],_0x4d1dcd);var _0x24f787=path[_0xc547('0x57')](_0x20ff9c,_0xadc31a);var _0x28d944=[];_0x28d944[_0xc547('0x5d')]({'model':db['User'],'as':_0xc547('0x5e'),'attributes':['id',_0xc547('0x5f')],'raw':!![]});_0x28d944['push']({'model':db['CmContact'],'as':_0xc547('0x60'),'attributes':['id','firstName',_0xc547('0x61')],'raw':!![]});if(_0x421b9d[_0xc547('0x28')]['attachments']){_0x28d944[_0xc547('0x5d')]({'model':db['Attachment'],'as':_0xc547('0x62'),'raw':!![]});}var _0x23e7f9=[{'model':db[_0xc547('0x3b')],'as':_0xc547('0x63'),'attributes':['id','body','createdAt',_0xc547('0x64'),_0xc547('0x65'),_0xc547('0x66')],'include':_0x28d944}];_0x23e7f9[_0xc547('0x5d')]({'model':db[_0xc547('0x67')],'as':_0xc547('0x68'),'attributes':['id',_0xc547('0x1f')]});_0x23e7f9[_0xc547('0x5d')]({'model':db[_0xc547('0x5e')],'as':_0xc547('0x69'),'attributes':['id',_0xc547('0x5f')]});return db['WhatsappInteraction']['find']({'where':{'id':_0x421b9d['params']['id']},'include':_0x23e7f9})[_0xc547('0x1a')](handleEntityNotFound(_0x20d90e,null))[_0xc547('0x1a')](function(_0x8a9808){if(_0x8a9808){var _0x314217=_0x8a9808[_0xc547('0x6a')]({'plain':!![]});fs[_0xc547('0x6b')](_0x237d3b);var _0x17d244={'channel':_0xc547('0x6c'),'account':_0x314217['Account']['name'],'agent':_0x314217[_0xc547('0x69')]?_0x314217['Owner'][_0xc547('0x5f')]:_0xc547('0x6d'),'createdAt':moment(_0x314217[_0xc547('0x6e')])[_0xc547('0x4a')](_0xc547('0x4b'))[_0xc547('0x56')](),'closedAt':_0x314217[_0xc547('0x6f')]?moment(_0x314217[_0xc547('0x70')])['format'](_0xc547('0x4b'))['toString']():'','disposition':_0x314217[_0xc547('0x71')],'messages':_(_0x314217['Messages'])[_0xc547('0x46')]({'secret':![]})['map'](function(_0x335764){if(_0x335764[_0xc547('0x62')]){var _0x3b5190=path['join'](_0x123c97,_0x335764[_0xc547('0x62')][_0xc547('0x72')]);if(fs[_0xc547('0x73')](_0x3b5190)){fs[_0xc547('0x74')](_0x3b5190)[_0xc547('0x75')](fs['createWriteStream'](path[_0xc547('0x57')](_0x237d3b,_0x335764[_0xc547('0x62')]['basename'])));}}return{'date':moment(_0x335764['createdAt'])[_0xc547('0x4a')](_0xc547('0x4b'))['toString'](),'sender':_0x335764[_0xc547('0x64')]===_0xc547('0x76')?_0x335764[_0xc547('0x5e')]?_0x335764[_0xc547('0x5e')][_0xc547('0x5f')]:_0xc547('0x77'):_0x335764[_0xc547('0x60')][_0xc547('0x78')]+(_0x335764['Contact'][_0xc547('0x61')]?'\x20'+_0x335764['Contact'][_0xc547('0x61')]:''),'body':_0x335764[_0xc547('0x62')]?_0x335764[_0xc547('0x62')][_0xc547('0x72')]:_0x335764[_0xc547('0x37')],'direction':_0x335764[_0xc547('0x64')]===_0xc547('0x76')?'A':'C','secret':_0x335764[_0xc547('0x65')],'read':_0x335764['read'],'attachment':_0x335764['Attachment']};})[_0xc547('0x79')]()};return ejs[_0xc547('0x7a')](path[_0xc547('0x57')](config[_0xc547('0x58')],_0xc547('0x5b'),_0xc547('0x7b'),'downloadInteraction.ejs'),{'interaction':_0x17d244})[_0xc547('0x1a')](function(_0x42ba9e){var _0x50fb97=path[_0xc547('0x57')](_0x237d3b,'transcript-'+_0x314217['id']+'-'+_0x4d1dcd+_0xc547('0x7c'));var _0x45cf45={'path':_0x50fb97,'channel':_0xc547('0x6c'),'interactionId':_0x314217['id']};return pdf[_0xc547('0x7d')](_0x42ba9e,_0x45cf45);})[_0xc547('0x1a')](function(){return new BPromise(function(_0x927f1e,_0x1a457f){zipdir(_0x237d3b,{'saveTo':_0x24f787},function(_0x18ff81,_0x560818){if(_0x18ff81)return _0x1a457f(_0x18ff81);return _0x927f1e(_0x560818);});})[_0xc547('0x1a')](function(){return new BPromise(function(_0x1e0612,_0x4903c0){rimraf(_0x237d3b,function(_0x4d19a0){if(_0x4d19a0)_0x4903c0(_0x4d19a0);return _0x1e0612();});});})[_0xc547('0x1a')](function(){return _0x20d90e[_0xc547('0x54')](_0x24f787,_0xadc31a,function(_0x3fc33e){if(_0x3fc33e){console[_0xc547('0x7e')]('err',_0x3fc33e);}else{fs[_0xc547('0x7f')](_0x24f787);}});});});}else{return _0x20d90e[_0xc547('0x1c')](0xc8);}})[_0xc547('0x36')](handleError(_0x20d90e,null));}; \ No newline at end of file +var _0x6a3c=['read','value','renderFile','views','transcript-','Whatsapp','createPdfFromHTML','download','log','err','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','name','send','index','rawAttributes','fieldName','key','getOptions','whatsapp','query','user','catch','model','WhatsappInteraction','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','WhatsappMessage','ids','getMessages','keys','hasOwnProperty','nolimit','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','findAll','rows','setTags','omit','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','push','User','fullname','Contact','lastName','Attachment','Messages','createdAt','direction','secret','Owner','get','mkdirSync','Account','N.A.','closedAt','toString','disposition','basename','existsSync','createReadStream','createWriteStream','out','System','firstName'];(function(_0x1d5864,_0x49fba3){var _0x205a6b=function(_0x1edb69){while(--_0x1edb69){_0x1d5864['push'](_0x1d5864['shift']());}};_0x205a6b(++_0x49fba3);}(_0x6a3c,0x106));var _0xc6a3=function(_0x12a391,_0xe75184){_0x12a391=_0x12a391-0x0;var _0x3e91cb=_0x6a3c[_0x12a391];return _0x3e91cb;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc6a3('0x0'));var moment=require(_0xc6a3('0x1'));var BPromise=require(_0xc6a3('0x2'));var util=require(_0xc6a3('0x3'));var path=require(_0xc6a3('0x4'));var ejs=require(_0xc6a3('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xc6a3('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xc6a3('0x7'));var pdf=require(_0xc6a3('0x8'));var logger=require(_0xc6a3('0x9'))('api');var config=require(_0xc6a3('0xa'));var db=require(_0xc6a3('0xb'))['db'];config[_0xc6a3('0xc')]=_['defaults'](config[_0xc6a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6a3('0xd'))(new Redis(config['redis']));require(_0xc6a3('0xe'))[_0xc6a3('0xf')](socket);function respondWithStatusCode(_0x3a7fb8,_0x2723a4){_0x2723a4=_0x2723a4||0xcc;return function(_0x3530b4){if(_0x3530b4){return _0x3a7fb8[_0xc6a3('0x10')](_0x2723a4);}return _0x3a7fb8[_0xc6a3('0x11')](_0x2723a4)[_0xc6a3('0x12')]();};}function respondWithResult(_0x185968,_0x581fce){_0x581fce=_0x581fce||0xc8;return function(_0x4f1d6d){if(_0x4f1d6d){return _0x185968['status'](_0x581fce)[_0xc6a3('0x13')](_0x4f1d6d);}};}function respondWithFilteredResult(_0x238993,_0x36c02f){return function(_0x391f52){if(_0x391f52){var _0x50fcbe=typeof _0x36c02f[_0xc6a3('0x14')]===_0xc6a3('0x15')&&typeof _0x36c02f[_0xc6a3('0x16')]==='undefined';var _0x1a2777=_0x391f52['count'];var _0x2df236=_0x50fcbe?0x0:_0x36c02f[_0xc6a3('0x14')];var _0x57ac25=_0x50fcbe?_0x391f52['count']:_0x36c02f[_0xc6a3('0x14')]+_0x36c02f['limit'];var _0x18ec05;if(_0x57ac25>=_0x1a2777){_0x57ac25=_0x1a2777;_0x18ec05=0xc8;}else{_0x18ec05=0xce;}_0x238993['status'](_0x18ec05);return _0x238993[_0xc6a3('0x17')](_0xc6a3('0x18'),_0x2df236+'-'+_0x57ac25+'/'+_0x1a2777)[_0xc6a3('0x13')](_0x391f52);}return null;};}function saveUpdates(_0x37a21a){return function(_0x317d56){if(_0x317d56){return _0x317d56[_0xc6a3('0x19')](_0x37a21a)[_0xc6a3('0x1a')](function(_0x40d6eb){return _0x40d6eb;});}return null;};}function removeEntity(_0x48634b){return function(_0xbabcd4){if(_0xbabcd4){return _0xbabcd4[_0xc6a3('0x1b')]()[_0xc6a3('0x1a')](function(){_0x48634b[_0xc6a3('0x11')](0xcc)[_0xc6a3('0x12')]();});}};}function handleEntityNotFound(_0x3c8a46){return function(_0x17bc06){if(!_0x17bc06){_0x3c8a46[_0xc6a3('0x10')](0x194);}return _0x17bc06;};}function handleError(_0x448bd5,_0x13cb57){_0x13cb57=_0x13cb57||0x1f4;return function(_0x39c22c){logger[_0xc6a3('0x1c')](_0x39c22c['stack']);if(_0x39c22c['name']){delete _0x39c22c[_0xc6a3('0x1d')];}_0x448bd5[_0xc6a3('0x11')](_0x13cb57)[_0xc6a3('0x1e')](_0x39c22c);};}exports[_0xc6a3('0x1f')]=function(_0xd6db16,_0xc2ab8a){var _0x52b184={};var _0x3cf3a7=_['map'](db['WhatsappInteraction'][_0xc6a3('0x20')],function(_0x1125b0){return{'name':_0x1125b0[_0xc6a3('0x21')],'type':_0x1125b0['type'][_0xc6a3('0x22')]};});_0x52b184=qs[_0xc6a3('0x23')](_0x3cf3a7,_0xd6db16);return interaction['findAll'](_0xc6a3('0x24'),_0xd6db16[_0xc6a3('0x25')],_0xd6db16[_0xc6a3('0x26')],_0x52b184,_0x3cf3a7)['then'](respondWithFilteredResult(_0xc2ab8a,_0x52b184))[_0xc6a3('0x27')](handleError(_0xc2ab8a,null));};exports['show']=function(_0x1e8fed,_0xba2a5b){var _0x3c8e74={'raw':![],'where':{'id':_0x1e8fed['params']['id']}},_0x24848e={};_0x24848e[_0xc6a3('0x28')]=_['keys'](db[_0xc6a3('0x29')]['rawAttributes']);_0x24848e[_0xc6a3('0x25')]=_['keys'](_0x1e8fed[_0xc6a3('0x25')]);_0x24848e[_0xc6a3('0x2a')]=_[_0xc6a3('0x2b')](_0x24848e['model'],_0x24848e['query']);_0x3c8e74[_0xc6a3('0x2c')]=_[_0xc6a3('0x2b')](_0x24848e['model'],qs[_0xc6a3('0x2d')](_0x1e8fed[_0xc6a3('0x25')][_0xc6a3('0x2d')]));_0x3c8e74['attributes']=_0x3c8e74[_0xc6a3('0x2c')][_0xc6a3('0x2e')]?_0x3c8e74[_0xc6a3('0x2c')]:_0x24848e[_0xc6a3('0x28')];if(_0x1e8fed[_0xc6a3('0x25')][_0xc6a3('0x2f')]){_0x3c8e74[_0xc6a3('0x30')]=[{'all':!![]}];}_0x3c8e74=_[_0xc6a3('0x31')]({},_0x3c8e74,_0x1e8fed[_0xc6a3('0x32')]);return db[_0xc6a3('0x29')][_0xc6a3('0x33')](_0x3c8e74)['then'](handleEntityNotFound(_0xba2a5b,null))[_0xc6a3('0x1a')](respondWithResult(_0xba2a5b,null))[_0xc6a3('0x27')](handleError(_0xba2a5b,null));};exports[_0xc6a3('0x34')]=function(_0x291eea,_0x3f8b7f){return db['WhatsappInteraction'][_0xc6a3('0x34')](_0x291eea[_0xc6a3('0x35')],{})[_0xc6a3('0x1a')](respondWithResult(_0x3f8b7f,0xc9))[_0xc6a3('0x27')](handleError(_0x3f8b7f,null));};exports['update']=function(_0x22993c,_0x4868e8){if(_0x22993c[_0xc6a3('0x35')]['id']){delete _0x22993c[_0xc6a3('0x35')]['id'];}return db[_0xc6a3('0x29')][_0xc6a3('0x33')]({'where':{'id':_0x22993c[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x4868e8,null))['then'](saveUpdates(_0x22993c[_0xc6a3('0x35')],null))['then'](respondWithResult(_0x4868e8,null))[_0xc6a3('0x27')](handleError(_0x4868e8,null));};exports[_0xc6a3('0x1b')]=function(_0x5958ac,_0x7b19ff){return db['WhatsappInteraction']['find']({'where':{'id':_0x5958ac[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x7b19ff,null))[_0xc6a3('0x1a')](removeEntity(_0x7b19ff,null))[_0xc6a3('0x27')](handleError(_0x7b19ff,null));};exports[_0xc6a3('0x37')]=function(_0x39c0a9,_0x4ab481){return db[_0xc6a3('0x29')][_0xc6a3('0x37')]()['then'](respondWithResult(_0x4ab481,null))[_0xc6a3('0x27')](handleError(_0x4ab481,null));};exports[_0xc6a3('0x38')]=function(_0x4daa6a,_0x34b4fa){return db[_0xc6a3('0x39')][_0xc6a3('0x33')]({'where':{'id':_0x4daa6a[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x34b4fa,null))[_0xc6a3('0x1a')](function(_0x34024d){if(_0x34024d){return _0x34024d[_0xc6a3('0x38')](_0x4daa6a['body'][_0xc6a3('0x3a')],_['omit'](_0x4daa6a[_0xc6a3('0x35')],[_0xc6a3('0x3a'),'id'])||{});}})[_0xc6a3('0x1a')](respondWithResult(_0x34b4fa,null))['catch'](handleError(_0x34b4fa,null));};exports[_0xc6a3('0x3b')]=function(_0x3398ca,_0x5750c9){var _0x4d5993={'raw':![],'where':{}};var _0x2ba689={};var _0x381957={'count':0x0,'rows':[]};return db[_0xc6a3('0x29')]['findOne']({'where':{'id':_0x3398ca[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x5750c9,null))[_0xc6a3('0x1a')](function(_0x433a04){if(_0x433a04){_0x2ba689[_0xc6a3('0x28')]=_[_0xc6a3('0x3c')](db['WhatsappMessage'][_0xc6a3('0x20')]);_0x2ba689[_0xc6a3('0x25')]=_[_0xc6a3('0x3c')](_0x3398ca[_0xc6a3('0x25')]);_0x2ba689[_0xc6a3('0x2a')]=_[_0xc6a3('0x2b')](_0x2ba689[_0xc6a3('0x28')],_0x2ba689[_0xc6a3('0x25')]);_0x4d5993[_0xc6a3('0x2c')]=_[_0xc6a3('0x2b')](_0x2ba689[_0xc6a3('0x28')],qs[_0xc6a3('0x2d')](_0x3398ca['query'][_0xc6a3('0x2d')]));_0x4d5993[_0xc6a3('0x2c')]=_0x4d5993[_0xc6a3('0x2c')][_0xc6a3('0x2e')]?_0x4d5993[_0xc6a3('0x2c')]:_0x2ba689[_0xc6a3('0x28')];if(!_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x3d')](_0xc6a3('0x3e'))){_0x4d5993[_0xc6a3('0x16')]=qs[_0xc6a3('0x16')](_0x3398ca['query'][_0xc6a3('0x16')]);_0x4d5993[_0xc6a3('0x14')]=qs['offset'](_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x14')]);}_0x4d5993['order']=qs[_0xc6a3('0x3f')](_0x3398ca['query'][_0xc6a3('0x3f')]);_0x4d5993[_0xc6a3('0x40')]=qs[_0xc6a3('0x2a')](_[_0xc6a3('0x41')](_0x3398ca[_0xc6a3('0x25')],_0x2ba689['filters']));_0x4d5993[_0xc6a3('0x40')][_0xc6a3('0x42')]=_0x433a04['id'];if(_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x43')]){_0x4d5993[_0xc6a3('0x40')]=_[_0xc6a3('0x31')](_0x4d5993['where'],{'$or':_[_0xc6a3('0x44')](_0x4d5993['attributes'],function(_0x562c16){var _0x1ea492={};_0x1ea492[_0x562c16]={'$like':'%'+_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x43')]+'%'};return _0x1ea492;})});}if(_0x3398ca['query'][_0xc6a3('0x45')]){var _0x37b577=_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x45')][_0xc6a3('0x46')](',');var _0x46474a={};_0x46474a[_0x37b577[0x0]]={'$gte':moment(_0x37b577[0x1])[_0xc6a3('0x47')](_0xc6a3('0x48'))};_0x4d5993[_0xc6a3('0x40')]=_[_0xc6a3('0x31')](_0x4d5993[_0xc6a3('0x40')],_0x46474a);}_0x4d5993=_[_0xc6a3('0x31')]({},_0x4d5993,_0x3398ca[_0xc6a3('0x32')]);return db[_0xc6a3('0x39')][_0xc6a3('0x49')]({'where':_0x4d5993['where']})[_0xc6a3('0x1a')](function(_0x4c1aad){_0x381957['count']=_0x4c1aad;if(_0x3398ca[_0xc6a3('0x25')][_0xc6a3('0x2f')]){_0x4d5993['include']=[{'all':!![]}];}return db[_0xc6a3('0x39')][_0xc6a3('0x4a')](_0x4d5993);})[_0xc6a3('0x1a')](function(_0x19efb8){_0x381957[_0xc6a3('0x4b')]=_0x19efb8;return _0x381957;});}})['then'](respondWithFilteredResult(_0x5750c9,_0x4d5993))[_0xc6a3('0x27')](handleError(_0x5750c9,null));};exports['addTags']=function(_0x2e17d3,_0x3a5e18){return db['WhatsappInteraction']['find']({'where':{'id':_0x2e17d3[_0xc6a3('0x36')]['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x3a5e18,null))['then'](function(_0x228120){if(_0x228120){return _0x228120[_0xc6a3('0x4c')](_0x2e17d3[_0xc6a3('0x35')][_0xc6a3('0x3a')],_[_0xc6a3('0x4d')](_0x2e17d3[_0xc6a3('0x35')],[_0xc6a3('0x3a'),'id'])||{})[_0xc6a3('0x4e')](function(){return db[_0xc6a3('0x4f')][_0xc6a3('0x4a')]({'attributes':['id',_0xc6a3('0x1d'),_0xc6a3('0x50')],'where':{'id':_0x2e17d3[_0xc6a3('0x35')][_0xc6a3('0x3a')]}});})['then'](function(_0x2dff81){socket[_0xc6a3('0x51')](_0xc6a3('0x52'),{'id':Number(_0x2e17d3['params']['id']),'tags':_0x2dff81||[]});return{'id':Number(_0x2e17d3[_0xc6a3('0x36')]['id']),'tags':_0x2dff81||[]};});}})['then'](respondWithResult(_0x3a5e18,null))[_0xc6a3('0x27')](handleError(_0x3a5e18,null));};exports[_0xc6a3('0x53')]=function(_0x1176ac,_0x58f291){return db[_0xc6a3('0x29')]['find']({'where':{'id':_0x1176ac['params']['id']}})[_0xc6a3('0x1a')](handleEntityNotFound(_0x58f291,null))[_0xc6a3('0x1a')](function(_0x203c3b){if(_0x203c3b){return _0x203c3b['removeTags'](_0x1176ac['query'][_0xc6a3('0x3a')]);}})[_0xc6a3('0x1a')](respondWithStatusCode(_0x58f291,null))[_0xc6a3('0x27')](handleError(_0x58f291,null));};exports['download']=function(_0x4e8ef2,_0x2f86f3){var _0x5c26c9=moment()[_0xc6a3('0x54')]()['toString']();var _0x2c8247=path[_0xc6a3('0x55')](config[_0xc6a3('0x56')],_0xc6a3('0x57'),_0xc6a3('0x58'),_0xc6a3('0x59'));var _0x43dda7=path[_0xc6a3('0x55')](config[_0xc6a3('0x56')],_0xc6a3('0x57'),_0xc6a3('0x58'),_0xc6a3('0x5a'));var _0x133cc5=path['join'](_0x2c8247,_0x5c26c9);var _0x3fd452=util[_0xc6a3('0x47')]('transcript-%d-%s.zip',_0x4e8ef2['params']['id'],_0x5c26c9);var _0xed93f5=path[_0xc6a3('0x55')](_0x2c8247,_0x3fd452);var _0x8dcd0c=[];_0x8dcd0c[_0xc6a3('0x5b')]({'model':db[_0xc6a3('0x5c')],'as':'User','attributes':['id',_0xc6a3('0x5d')],'raw':!![]});_0x8dcd0c[_0xc6a3('0x5b')]({'model':db['CmContact'],'as':_0xc6a3('0x5e'),'attributes':['id','firstName',_0xc6a3('0x5f')],'raw':!![]});if(_0x4e8ef2[_0xc6a3('0x25')][_0xc6a3('0x5a')]){_0x8dcd0c['push']({'model':db[_0xc6a3('0x60')],'as':'Attachment','raw':!![]});}var _0x2b31bd=[{'model':db[_0xc6a3('0x39')],'as':_0xc6a3('0x61'),'attributes':['id',_0xc6a3('0x35'),_0xc6a3('0x62'),_0xc6a3('0x63'),_0xc6a3('0x64'),'read'],'include':_0x8dcd0c}];_0x2b31bd[_0xc6a3('0x5b')]({'model':db['WhatsappAccount'],'as':'Account','attributes':['id',_0xc6a3('0x1d')]});_0x2b31bd[_0xc6a3('0x5b')]({'model':db[_0xc6a3('0x5c')],'as':_0xc6a3('0x65'),'attributes':['id',_0xc6a3('0x5d')]});return db['WhatsappInteraction'][_0xc6a3('0x33')]({'where':{'id':_0x4e8ef2[_0xc6a3('0x36')]['id']},'include':_0x2b31bd})[_0xc6a3('0x1a')](handleEntityNotFound(_0x2f86f3,null))['then'](function(_0x4d1fd5){if(_0x4d1fd5){var _0x4c6ee9=_0x4d1fd5[_0xc6a3('0x66')]({'plain':!![]});fs[_0xc6a3('0x67')](_0x133cc5);var _0x23c0a2={'channel':'Whatsapp','account':_0x4c6ee9[_0xc6a3('0x68')][_0xc6a3('0x1d')],'agent':_0x4c6ee9['Owner']?_0x4c6ee9[_0xc6a3('0x65')][_0xc6a3('0x5d')]:_0xc6a3('0x69'),'createdAt':moment(_0x4c6ee9[_0xc6a3('0x62')])[_0xc6a3('0x47')](_0xc6a3('0x48'))['toString'](),'closedAt':_0x4c6ee9['closed']?moment(_0x4c6ee9[_0xc6a3('0x6a')])[_0xc6a3('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc6a3('0x6b')]():'','disposition':_0x4c6ee9[_0xc6a3('0x6c')],'messages':_(_0x4c6ee9[_0xc6a3('0x61')])[_0xc6a3('0x43')]({'secret':![]})[_0xc6a3('0x44')](function(_0x2346c4){if(_0x2346c4[_0xc6a3('0x60')]){var _0x28a627=path[_0xc6a3('0x55')](_0x43dda7,_0x2346c4[_0xc6a3('0x60')][_0xc6a3('0x6d')]);if(fs[_0xc6a3('0x6e')](_0x28a627)){fs[_0xc6a3('0x6f')](_0x28a627)['pipe'](fs[_0xc6a3('0x70')](path[_0xc6a3('0x55')](_0x133cc5,_0x2346c4[_0xc6a3('0x60')]['basename'])));}}return{'date':moment(_0x2346c4[_0xc6a3('0x62')])[_0xc6a3('0x47')](_0xc6a3('0x48'))[_0xc6a3('0x6b')](),'sender':_0x2346c4[_0xc6a3('0x63')]===_0xc6a3('0x71')?_0x2346c4[_0xc6a3('0x5c')]?_0x2346c4['User'][_0xc6a3('0x5d')]:_0xc6a3('0x72'):_0x2346c4[_0xc6a3('0x5e')][_0xc6a3('0x73')]+(_0x2346c4['Contact'][_0xc6a3('0x5f')]?'\x20'+_0x2346c4['Contact'][_0xc6a3('0x5f')]:''),'body':_0x2346c4['Attachment']?_0x2346c4[_0xc6a3('0x60')][_0xc6a3('0x6d')]:_0x2346c4['body'],'direction':_0x2346c4[_0xc6a3('0x63')]===_0xc6a3('0x71')?'A':'C','secret':_0x2346c4[_0xc6a3('0x64')],'read':_0x2346c4[_0xc6a3('0x74')],'attachment':_0x2346c4['Attachment']};})[_0xc6a3('0x75')]()};return ejs[_0xc6a3('0x76')](path['join'](config[_0xc6a3('0x56')],'server',_0xc6a3('0x77'),'downloadInteraction.ejs'),{'interaction':_0x23c0a2})['then'](function(_0x5c7a06){var _0x4e78a0=path['join'](_0x133cc5,_0xc6a3('0x78')+_0x4c6ee9['id']+'-'+_0x5c26c9+'.pdf');var _0x2c12f9={'path':_0x4e78a0,'channel':_0xc6a3('0x79'),'interactionId':_0x4c6ee9['id']};return pdf[_0xc6a3('0x7a')](_0x5c7a06,_0x2c12f9);})[_0xc6a3('0x1a')](function(){return new BPromise(function(_0x36012c,_0x3b55a1){zipdir(_0x133cc5,{'saveTo':_0xed93f5},function(_0x2db311,_0x181345){if(_0x2db311)return _0x3b55a1(_0x2db311);return _0x36012c(_0x181345);});})[_0xc6a3('0x1a')](function(){return new BPromise(function(_0x1fca2c,_0x3c07d3){rimraf(_0x133cc5,function(_0x5b7f44){if(_0x5b7f44)_0x3c07d3(_0x5b7f44);return _0x1fca2c();});});})['then'](function(){return _0x2f86f3[_0xc6a3('0x7b')](_0xed93f5,_0x3fd452,function(_0x813b73){if(_0x813b73){console[_0xc6a3('0x7c')](_0xc6a3('0x7d'),_0x813b73);}else{fs['unlinkSync'](_0xed93f5);}});});});}else{return _0x2f86f3['sendStatus'](0xc8);}})['catch'](handleError(_0x2f86f3,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 69a0043..d9388a6 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 _0x0cee=['WhatsappMessage','setMaxListeners','remove','getUsers','then','Users','map','findAll','setDataValue','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction'];(function(_0x3ad72e,_0x2ac1f0){var _0x1bda29=function(_0x56d28b){while(--_0x56d28b){_0x3ad72e['push'](_0x3ad72e['shift']());}};_0x1bda29(++_0x2ac1f0);}(_0x0cee,0x12f));var _0xe0ce=function(_0x4c8502,_0x435d31){_0x4c8502=_0x4c8502-0x0;var _0x75b6be=_0x0cee[_0x4c8502];return _0x75b6be;};'use strict';var EventEmitter=require(_0xe0ce('0x0'));var WhatsappInteraction=require(_0xe0ce('0x1'))['db'][_0xe0ce('0x2')];var WhatsappMessage=require(_0xe0ce('0x1'))['db'][_0xe0ce('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe0ce('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe0ce('0x5')};function emitEvent(_0x3e377b){return function(_0xe84b07,_0x3184bc,_0x1cfee1){_0xe84b07[_0xe0ce('0x6')]({'attributes':['id'],'raw':!![]})[_0xe0ce('0x7')](function(_0x415f34){_0xe84b07['setDataValue'](_0xe0ce('0x8'),_0x415f34[_0xe0ce('0x9')](function(_0x52f779){return{'id':_0x52f779['id']};}));return WhatsappMessage[_0xe0ce('0xa')]({'where':{'WhatsappInteractionId':_0xe84b07['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe0ce('0x7')](function(_0x4532e3){_0xe84b07[_0xe0ce('0xb')]('unreadMessages',_0x4532e3['length']);WhatsappInteractionEvents['emit'](_0x3e377b+':'+_0xe84b07['id'],_0xe84b07);WhatsappInteractionEvents[_0xe0ce('0xc')](_0x3e377b,_0xe84b07);_0x1cfee1(null);})[_0xe0ce('0xd')](_0x1cfee1(null));};}for(var e in events){if(events[_0xe0ce('0xe')](e)){var event=events[e];WhatsappInteraction[_0xe0ce('0xf')](e,emitEvent(event));}}module[_0xe0ce('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x851d=['emit','catch','exports','events','WhatsappInteraction','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd851('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xd851('0x1')];var WhatsappMessage=require(_0xd851('0x2'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xd851('0x3')](0x0);var events={'afterCreate':_0xd851('0x4'),'afterUpdate':_0xd851('0x5'),'afterDestroy':_0xd851('0x6')};function emitEvent(_0x36eb20){return function(_0x456821,_0x4812ec,_0x578809){_0x456821[_0xd851('0x7')]({'attributes':['id'],'raw':!![]})[_0xd851('0x8')](function(_0x3d2383){_0x456821[_0xd851('0x9')](_0xd851('0xa'),_0x3d2383[_0xd851('0xb')](function(_0x599973){return{'id':_0x599973['id']};}));return WhatsappMessage[_0xd851('0xc')]({'where':{'WhatsappInteractionId':_0x456821['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x33e66a){_0x456821[_0xd851('0x9')]('unreadMessages',_0x33e66a[_0xd851('0xd')]);WhatsappInteractionEvents[_0xd851('0xe')](_0x36eb20+':'+_0x456821['id'],_0x456821);WhatsappInteractionEvents[_0xd851('0xe')](_0x36eb20,_0x456821);_0x578809(null);})[_0xd851('0xf')](_0x578809(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xd851('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 89f6080..c77da19 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 _0x6b35=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x285b48,_0x41b4c6){var _0x5020e9=function(_0x537f18){while(--_0x537f18){_0x285b48['push'](_0x285b48['shift']());}};_0x5020e9(++_0x41b4c6);}(_0x6b35,0x6e));var _0x56b3=function(_0x1bbf8c,_0x31ebfa){_0x1bbf8c=_0x1bbf8c-0x0;var _0x260e8f=_0x6b35[_0x1bbf8c];return _0x260e8f;};'use strict';var _=require('lodash');var util=require(_0x56b3('0x0'));var logger=require(_0x56b3('0x1'))(_0x56b3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x56b3('0x3'));var fs=require('fs');var path=require(_0x56b3('0x4'));var rimraf=require(_0x56b3('0x5'));var config=require(_0x56b3('0x6'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x49c8ca,_0x5dc45b){return _0x49c8ca[_0x56b3('0x7')](_0x56b3('0x8'),attributes,{'tableName':_0x56b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ca183,_0x48a098,_0x38eceb){if(_0x1ca183[_0x56b3('0xa')](_0x56b3('0xb'))){_0x1ca183[_0x56b3('0xc')]=moment()[_0x56b3('0xd')](_0x56b3('0xe'));}_0x38eceb(null,_0x1ca183);}}});}; \ No newline at end of file +var _0xecaa=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x7d6eb8,_0x1b15ce){var _0x523e61=function(_0x2cbe6a){while(--_0x2cbe6a){_0x7d6eb8['push'](_0x7d6eb8['shift']());}};_0x523e61(++_0x1b15ce);}(_0xecaa,0x173));var _0xaeca=function(_0x4b0fea,_0x296e0b){_0x4b0fea=_0x4b0fea-0x0;var _0x2db8b0=_0xecaa[_0x4b0fea];return _0x2db8b0;};'use strict';var _=require('lodash');var util=require(_0xaeca('0x0'));var logger=require(_0xaeca('0x1'))(_0xaeca('0x2'));var moment=require(_0xaeca('0x3'));var BPromise=require(_0xaeca('0x4'));var rp=require(_0xaeca('0x5'));var fs=require('fs');var path=require(_0xaeca('0x6'));var rimraf=require(_0xaeca('0x7'));var config=require(_0xaeca('0x8'));var attributes=require(_0xaeca('0x9'));module[_0xaeca('0xa')]=function(_0x414542,_0x2039c9){return _0x414542[_0xaeca('0xb')](_0xaeca('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a8e5c,_0x30d6fb,_0x11ee86){if(_0x5a8e5c['changed']('closed')){_0x5a8e5c[_0xaeca('0xd')]=moment()['format'](_0xaeca('0xe'));}_0x11ee86(null,_0x5a8e5c);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 67aee1c..b43758f 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 _0xb042=['socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','catch','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','AddTags','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost'];(function(_0x559746,_0x9f479a){var _0x1f9779=function(_0x26523f){while(--_0x26523f){_0x559746['push'](_0x559746['shift']());}};_0x1f9779(++_0x9f479a);}(_0xb042,0x13c));var _0x2b04=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xb042[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require(_0x2b04('0x0'));var moment=require(_0x2b04('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b04('0x2'))['db'];var utils=require(_0x2b04('0x3'));var logger=require(_0x2b04('0x4'))(_0x2b04('0x5'));var config=require(_0x2b04('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2b04('0x7')][_0x2b04('0x8')]({'port':0x232a});config['redis']=_[_0x2b04('0x9')](config[_0x2b04('0xa')],{'host':_0x2b04('0xb'),'port':0x18eb});var socket=require(_0x2b04('0xc'))(new Redis(config[_0x2b04('0xa')]));require(_0x2b04('0xd'))['register'](socket);function respondWithRpcPromise(_0xb27e80,_0x1418b8,_0x453f95){return new BPromise(function(_0x27e416,_0xa2580f){return client[_0x2b04('0xe')](_0xb27e80,_0x453f95)[_0x2b04('0xf')](function(_0x14d478){logger[_0x2b04('0x10')](_0x2b04('0x11'),_0x1418b8,'request\x20sent');logger[_0x2b04('0x12')](_0x2b04('0x13'),_0x1418b8,_0x2b04('0x14'),JSON[_0x2b04('0x15')](_0x14d478));if(_0x14d478['error']){if(_0x14d478[_0x2b04('0x16')][_0x2b04('0x17')]===0x1f4){logger[_0x2b04('0x16')](_0x2b04('0x11'),_0x1418b8,_0x14d478[_0x2b04('0x16')]['message']);return _0xa2580f(_0x14d478[_0x2b04('0x16')][_0x2b04('0x18')]);}logger[_0x2b04('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x1418b8,_0x14d478[_0x2b04('0x16')][_0x2b04('0x18')]);return _0x27e416(_0x14d478[_0x2b04('0x16')][_0x2b04('0x18')]);}else{logger['info'](_0x2b04('0x11'),_0x1418b8,_0x2b04('0x14'));_0x27e416(_0x14d478[_0x2b04('0x19')][_0x2b04('0x18')]);}})['catch'](function(_0x33762c){logger[_0x2b04('0x16')](_0x2b04('0x11'),_0x1418b8,_0x33762c);_0xa2580f(_0x33762c);});});}exports[_0x2b04('0x1a')]=function(_0x591316){var _0x3c2f7d=this;return new Promise(function(_0x1a0ff3,_0x1c1be6){return db[_0x2b04('0x1b')][_0x2b04('0x1c')](_0x591316[_0x2b04('0x1d')],{'raw':_0x591316['options']?_0x591316[_0x2b04('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591316[_0x2b04('0x1e')]?_0x591316[_0x2b04('0x1e')][_0x2b04('0x1f')]||null:null,'attributes':_0x591316[_0x2b04('0x1e')]?_0x591316[_0x2b04('0x1e')][_0x2b04('0x20')]||null:null,'limit':_0x591316['options']?_0x591316[_0x2b04('0x1e')][_0x2b04('0x21')]||null:null})['then'](function(_0x8bc6ae){logger[_0x2b04('0x10')](_0x2b04('0x1a'),_0x591316);logger[_0x2b04('0x12')]('UpdateWhatsappInteraction',_0x591316,JSON[_0x2b04('0x15')](_0x8bc6ae));_0x1a0ff3(_0x8bc6ae);})[_0x2b04('0x22')](function(_0x4c08d4){logger[_0x2b04('0x16')](_0x2b04('0x1a'),_0x4c08d4[_0x2b04('0x18')],_0x591316);_0x1c1be6(_0x3c2f7d[_0x2b04('0x16')](0x1f4,_0x4c08d4[_0x2b04('0x18')]));});});};exports[_0x2b04('0x23')]=function(_0x438e21){return new Promise(function(_0x537de,_0x5a775f){return db[_0x2b04('0x1b')]['find']({'where':_0x438e21['options']?_0x438e21['options'][_0x2b04('0x1f')]||null:null})['then'](function(_0x3b7efd){if(_0x3b7efd){return _0x3b7efd[_0x2b04('0x24')](_0x438e21['body'][_0x2b04('0x25')],_[_0x2b04('0x26')](_0x438e21[_0x2b04('0x1d')],[_0x2b04('0x25'),'id'])||{});}})[_0x2b04('0x27')](function(_0x1ef36d){logger[_0x2b04('0x10')](_0x2b04('0x28'),_0x438e21);logger[_0x2b04('0x12')]('AddTags',_0x438e21,JSON[_0x2b04('0x15')](_0x1ef36d));_0x537de(_0x1ef36d);})['catch'](function(_0x37b6b0){logger['error'](_0x2b04('0x28'),_0x37b6b0[_0x2b04('0x18')],_0x438e21);_0x5a775f(_this[_0x2b04('0x16')](0x1f4,_0x37b6b0[_0x2b04('0x18')]));});});}; \ No newline at end of file +var _0x46e6=['ids','omit','spread','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags'];(function(_0x4f51b9,_0x57bffa){var _0x4127e=function(_0xc8c19){while(--_0xc8c19){_0x4f51b9['push'](_0x4f51b9['shift']());}};_0x4127e(++_0x57bffa);}(_0x46e6,0x154));var _0x646e=function(_0x23e88b,_0x17737f){_0x23e88b=_0x23e88b-0x0;var _0x35db96=_0x46e6[_0x23e88b];return _0x35db96;};'use strict';var _=require(_0x646e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x646e('0x1'));var fs=require('fs');var Redis=require(_0x646e('0x2'));var db=require(_0x646e('0x3'))['db'];var utils=require(_0x646e('0x4'));var logger=require(_0x646e('0x5'))(_0x646e('0x6'));var config=require('../../config/environment');var jayson=require(_0x646e('0x7'));var client=jayson[_0x646e('0x8')][_0x646e('0x9')]({'port':0x232a});config[_0x646e('0xa')]=_[_0x646e('0xb')](config[_0x646e('0xa')],{'host':_0x646e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x646e('0xa')]));require(_0x646e('0xd'))[_0x646e('0xe')](socket);function respondWithRpcPromise(_0xe50a8a,_0x56941b,_0x23c2a3){return new BPromise(function(_0xf282ea,_0x48871b){return client[_0x646e('0xf')](_0xe50a8a,_0x23c2a3)[_0x646e('0x10')](function(_0x139f6f){logger[_0x646e('0x11')](_0x646e('0x12'),_0x56941b,_0x646e('0x13'));logger[_0x646e('0x14')](_0x646e('0x15'),_0x56941b,_0x646e('0x13'),JSON[_0x646e('0x16')](_0x139f6f));if(_0x139f6f[_0x646e('0x17')]){if(_0x139f6f['error']['code']===0x1f4){logger['error'](_0x646e('0x12'),_0x56941b,_0x139f6f[_0x646e('0x17')]['message']);return _0x48871b(_0x139f6f[_0x646e('0x17')][_0x646e('0x18')]);}logger[_0x646e('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x56941b,_0x139f6f[_0x646e('0x17')]['message']);return _0xf282ea(_0x139f6f[_0x646e('0x17')][_0x646e('0x18')]);}else{logger['info'](_0x646e('0x12'),_0x56941b,_0x646e('0x13'));_0xf282ea(_0x139f6f[_0x646e('0x19')]['message']);}})[_0x646e('0x1a')](function(_0x70641b){logger[_0x646e('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x56941b,_0x70641b);_0x48871b(_0x70641b);});});}exports[_0x646e('0x1b')]=function(_0x35180a){var _0xd7c2be=this;return new Promise(function(_0xf8193e,_0x611eab){return db[_0x646e('0x1c')]['update'](_0x35180a[_0x646e('0x1d')],{'raw':_0x35180a[_0x646e('0x1e')]?_0x35180a['options'][_0x646e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35180a[_0x646e('0x1e')]?_0x35180a[_0x646e('0x1e')][_0x646e('0x20')]||null:null,'attributes':_0x35180a[_0x646e('0x1e')]?_0x35180a['options'][_0x646e('0x21')]||null:null,'limit':_0x35180a['options']?_0x35180a[_0x646e('0x1e')][_0x646e('0x22')]||null:null})[_0x646e('0x10')](function(_0x3ca3ac){logger['info'](_0x646e('0x1b'),_0x35180a);logger['debug'](_0x646e('0x1b'),_0x35180a,JSON[_0x646e('0x16')](_0x3ca3ac));_0xf8193e(_0x3ca3ac);})[_0x646e('0x1a')](function(_0x5648d6){logger[_0x646e('0x17')](_0x646e('0x1b'),_0x5648d6['message'],_0x35180a);_0x611eab(_0xd7c2be[_0x646e('0x17')](0x1f4,_0x5648d6['message']));});});};exports[_0x646e('0x23')]=function(_0x33ac7c){return new Promise(function(_0x4dc7d6,_0x2f5875){return db['WhatsappInteraction'][_0x646e('0x24')]({'where':_0x33ac7c[_0x646e('0x1e')]?_0x33ac7c[_0x646e('0x1e')]['where']||null:null})[_0x646e('0x10')](function(_0x28bab6){if(_0x28bab6){return _0x28bab6[_0x646e('0x25')](_0x33ac7c['body'][_0x646e('0x26')],_[_0x646e('0x27')](_0x33ac7c[_0x646e('0x1d')],[_0x646e('0x26'),'id'])||{});}})[_0x646e('0x28')](function(_0x101d64){logger['info']('AddTags',_0x33ac7c);logger[_0x646e('0x14')]('AddTags',_0x33ac7c,JSON[_0x646e('0x16')](_0x101d64));_0x4dc7d6(_0x101d64);})['catch'](function(_0x3743a9){logger[_0x646e('0x17')](_0x646e('0x29'),_0x3743a9[_0x646e('0x18')],_0x33ac7c);_0x2f5875(_this[_0x646e('0x17')](0x1f4,_0x3743a9[_0x646e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 07f21ea..0264328 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 _0x0e50=['register','length','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener'];(function(_0x3a3030,_0x30cba4){var _0x26c39b=function(_0x4f50ba){while(--_0x4f50ba){_0x3a3030['push'](_0x3a3030['shift']());}};_0x26c39b(++_0x30cba4);}(_0x0e50,0x93));var _0x00e5=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0e50[_0x1b2ff7];return _0x31656a;};'use strict';var WhatsappInteractionEvents=require(_0x00e5('0x0'));var events=['save',_0x00e5('0x1'),_0x00e5('0x2')];function createListener(_0xe149dc,_0x5f02f1){return function(_0x207f48){_0x5f02f1[_0x00e5('0x3')](_0xe149dc,_0x207f48);};}function removeListener(_0x808500,_0x225a34){return function(){WhatsappInteractionEvents[_0x00e5('0x4')](_0x808500,_0x225a34);};}exports[_0x00e5('0x5')]=function(_0xe6f4dd){for(var _0x440545=0x0,_0x1b3c88=events[_0x00e5('0x6')];_0x440545<_0x1b3c88;_0x440545++){var _0x314355=events[_0x440545];var _0x3b9ef1=createListener(_0x00e5('0x7')+_0x314355,_0xe6f4dd);WhatsappInteractionEvents['on'](_0x314355,_0x3b9ef1);}}; \ No newline at end of file +var _0xdef0=['whatsappInteraction:','./whatsappInteraction.events','save','remove','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdef0,0xa6));var _0x0def=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdef0[_0x2dafbe];return _0x58a45a;};'use strict';var WhatsappInteractionEvents=require(_0x0def('0x0'));var events=[_0x0def('0x1'),_0x0def('0x2'),'update'];function createListener(_0x3f8928,_0x1aaa7a){return function(_0x32c324){_0x1aaa7a['emit'](_0x3f8928,_0x32c324);};}function removeListener(_0x2387a8,_0x1b160d){return function(){WhatsappInteractionEvents[_0x0def('0x3')](_0x2387a8,_0x1b160d);};}exports['register']=function(_0x76de58){for(var _0x59d2c7=0x0,_0x382b9f=events['length'];_0x59d2c7<_0x382b9f;_0x59d2c7++){var _0x2f4a66=events[_0x59d2c7];var _0x739651=createListener(_0x0def('0x4')+_0x2f4a66,_0x76de58);WhatsappInteractionEvents['on'](_0x2f4a66,_0x739651);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 0517e46..f740c1b 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 _0x17e4=['/:id','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','/describe','describe'];(function(_0x1b8f16,_0x42772b){var _0xc3e3ae=function(_0x380e42){while(--_0x380e42){_0x1b8f16['push'](_0x1b8f16['shift']());}};_0xc3e3ae(++_0x42772b);}(_0x17e4,0xa5));var _0x417e=function(_0x235c2c,_0x171db4){_0x235c2c=_0x235c2c-0x0;var _0x6b8f58=_0x17e4[_0x235c2c];return _0x6b8f58;};'use strict';var multer=require(_0x417e('0x0'));var util=require(_0x417e('0x1'));var path=require(_0x417e('0x2'));var timeout=require(_0x417e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x417e('0x4'));var config=require('../../config/environment');var controller=require(_0x417e('0x5'));router[_0x417e('0x6')]('/',auth[_0x417e('0x7')](),controller['index']);router[_0x417e('0x6')](_0x417e('0x8'),auth[_0x417e('0x7')](),controller[_0x417e('0x9')]);router[_0x417e('0x6')](_0x417e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x417e('0xb')]('/',auth['isAuthenticated'](),interaction[_0x417e('0xc')](_0x417e('0xd'),_0x417e('0xe')),controller['create']);router[_0x417e('0xb')](_0x417e('0xf'),controller[_0x417e('0x10')]);router[_0x417e('0x11')](_0x417e('0xa'),auth[_0x417e('0x7')](),controller[_0x417e('0x12')]);router['put'](_0x417e('0x13'),auth[_0x417e('0x7')](),controller[_0x417e('0x14')]);router[_0x417e('0x11')](_0x417e('0x15'),auth[_0x417e('0x7')](),controller[_0x417e('0x16')]);router[_0x417e('0x17')](_0x417e('0xa'),auth[_0x417e('0x7')](),controller[_0x417e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x9839=['whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','whatsapp'];(function(_0x33eb16,_0x59dd1d){var _0x54387a=function(_0x3ca190){while(--_0x3ca190){_0x33eb16['push'](_0x33eb16['shift']());}};_0x54387a(++_0x59dd1d);}(_0x9839,0xea));var _0x9983=function(_0x4dba8a,_0x1b7347){_0x4dba8a=_0x4dba8a-0x0;var _0x14cee4=_0x9839[_0x4dba8a];return _0x14cee4;};'use strict';var multer=require(_0x9983('0x0'));var util=require(_0x9983('0x1'));var path=require(_0x9983('0x2'));var timeout=require(_0x9983('0x3'));var express=require(_0x9983('0x4'));var router=express[_0x9983('0x5')]();var fs_extra=require(_0x9983('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9983('0x7'));var config=require('../../config/environment');var controller=require(_0x9983('0x8'));router[_0x9983('0x9')]('/',auth[_0x9983('0xa')](),controller[_0x9983('0xb')]);router[_0x9983('0x9')]('/describe',auth[_0x9983('0xa')](),controller[_0x9983('0xc')]);router[_0x9983('0x9')](_0x9983('0xd'),auth[_0x9983('0xa')](),controller[_0x9983('0xe')]);router[_0x9983('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9983('0x10')](_0x9983('0x11'),_0x9983('0x12')),controller['create']);router[_0x9983('0xf')](_0x9983('0x13'),controller[_0x9983('0x14')]);router[_0x9983('0x15')](_0x9983('0xd'),auth[_0x9983('0xa')](),controller['update']);router[_0x9983('0x15')](_0x9983('0x16'),auth[_0x9983('0xa')](),controller[_0x9983('0x17')]);router[_0x9983('0x15')](_0x9983('0x18'),auth[_0x9983('0xa')](),controller[_0x9983('0x19')]);router[_0x9983('0x1a')](_0x9983('0xd'),auth['isAuthenticated'](),controller[_0x9983('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 5e1615d..696c4b4 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 _0x0d65=['out','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x57113e,_0xe663d){var _0x84b3d2=function(_0x40c723){while(--_0x40c723){_0x57113e['push'](_0x57113e['shift']());}};_0x84b3d2(++_0xe663d);}(_0x0d65,0x81));var _0x50d6=function(_0x4477a3,_0x4d08c7){_0x4477a3=_0x4477a3-0x0;var _0x3f5938=_0x0d65[_0x4477a3];return _0x3f5938;};'use strict';var Sequelize=require(_0x50d6('0x0'));module[_0x50d6('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x50d6('0x2')]('in',_0x50d6('0x3')),'defaultValue':_0x50d6('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x50d6('0x4')](0xbe)},'phone':{'type':Sequelize[_0x50d6('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x50d6('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x50d6('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9664=['BOOLEAN','ENUM','out','STRING','DATE','TEXT','sequelize','medium'];(function(_0x584291,_0x24b5b3){var _0x4e7d08=function(_0x59e0b1){while(--_0x59e0b1){_0x584291['push'](_0x584291['shift']());}};_0x4e7d08(++_0x24b5b3);}(_0x9664,0x126));var _0x4966=function(_0x5a06d9,_0x17e4ff){_0x5a06d9=_0x5a06d9-0x0;var _0x5ee5bf=_0x9664[_0x5a06d9];return _0x5ee5bf;};'use strict';var Sequelize=require(_0x4966('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x4966('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x4966('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4966('0x3')]('in',_0x4966('0x4')),'defaultValue':_0x4966('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4966('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x4966('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4966('0x5')]},'providerResponse':{'type':Sequelize[_0x4966('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 73fa887..ed55854 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 _0x062c=['register','jayson/promise','client','http','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','request\x20sent','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','send','index','map','WhatsappMessage','type','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','find','create','body','update','describe','whatsapp-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','agent','UserId','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','User','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','fullname','motionChannel','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x062c,0xf0));var _0xc062=function(_0x4aa554,_0x5d8d98){_0x4aa554=_0x4aa554-0x0;var _0x23ffec=_0x062c[_0x4aa554];return _0x23ffec;};'use strict';var emlformat=require(_0xc062('0x0'));var rimraf=require(_0xc062('0x1'));var zipdir=require(_0xc062('0x2'));var jsonpatch=require(_0xc062('0x3'));var rp=require('request-promise');var moment=require(_0xc062('0x4'));var BPromise=require(_0xc062('0x5'));var Mustache=require(_0xc062('0x6'));var util=require(_0xc062('0x7'));var path=require('path');var sox=require(_0xc062('0x8'));var csv=require(_0xc062('0x9'));var ejs=require(_0xc062('0xa'));var fs=require('fs');var fs_extra=require(_0xc062('0xb'));var _=require(_0xc062('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc062('0xd'));var deskjs=require(_0xc062('0xe'));var toCsv=require(_0xc062('0x9'));var querystring=require(_0xc062('0xf'));var Papa=require(_0xc062('0x10'));var Redis=require(_0xc062('0x11'));var authService=require(_0xc062('0x12'));var qs=require(_0xc062('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc062('0x14'));var logger=require(_0xc062('0x15'))(_0xc062('0x16'));var utils=require(_0xc062('0x17'));var config=require(_0xc062('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc062('0x19'))['db'];config[_0xc062('0x1a')]=_['defaults'](config[_0xc062('0x1a')],{'host':_0xc062('0x1b'),'port':0x18eb});var socket=require(_0xc062('0x1c'))(new Redis(config['redis']));require(_0xc062('0x1d'))[_0xc062('0x1e')](socket);var jayson=require(_0xc062('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc062('0x20')][_0xc062('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x164e21,_0x3f6d5c,_0xc1c147,_0x4cda60){return new BPromise(function(_0x511db9,_0x4b53d2){var _0x41f61a=_0x4cda60||client;return _0x41f61a['request'](_0x164e21,_0xc1c147)[_0xc062('0x22')](function(_0x3f23eb){logger[_0xc062('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3f6d5c,'request\x20sent');logger[_0xc062('0x24')](_0xc062('0x25'),_0x3f6d5c,'request\x20sent',JSON['stringify'](_0x3f23eb));if(_0x3f23eb[_0xc062('0x26')]){if(_0x3f23eb[_0xc062('0x26')][_0xc062('0x27')]===0x1f4){logger[_0xc062('0x26')](_0xc062('0x28'),_0x3f6d5c,_0x3f23eb[_0xc062('0x26')][_0xc062('0x29')]);return _0x4b53d2(_0x3f23eb[_0xc062('0x26')][_0xc062('0x29')]);}logger[_0xc062('0x26')](_0xc062('0x28'),_0x3f6d5c,_0x3f23eb[_0xc062('0x26')][_0xc062('0x29')]);return _0x511db9(_0x3f23eb[_0xc062('0x26')][_0xc062('0x29')]);}else{logger[_0xc062('0x23')](_0xc062('0x28'),_0x3f6d5c,_0xc062('0x2a'));_0x511db9(_0x3f23eb['result'][_0xc062('0x29')]);}})['catch'](function(_0x267960){logger[_0xc062('0x26')](_0xc062('0x28'),_0x3f6d5c,_0x267960);_0x4b53d2(_0x267960);});});}function respondWithStatusCode(_0xc74ef6,_0xdf04d1){_0xdf04d1=_0xdf04d1||0xcc;return function(_0x2eb5a7){if(_0x2eb5a7){return _0xc74ef6[_0xc062('0x2b')](_0xdf04d1);}return _0xc74ef6[_0xc062('0x2c')](_0xdf04d1)[_0xc062('0x2d')]();};}function respondWithResult(_0x4622ff,_0x54282a){_0x54282a=_0x54282a||0xc8;return function(_0x3665bb){if(_0x3665bb){return _0x4622ff[_0xc062('0x2c')](_0x54282a)[_0xc062('0x2e')](_0x3665bb);}};}function respondWithFilteredResult(_0x100f9b,_0x2636e0){return function(_0x21e84e){if(_0x21e84e){var _0x16f245=typeof _0x2636e0[_0xc062('0x2f')]===_0xc062('0x30')&&typeof _0x2636e0[_0xc062('0x31')]===_0xc062('0x30');var _0x49e5e0=_0x21e84e[_0xc062('0x32')];var _0x15b357=_0x16f245?0x0:_0x2636e0[_0xc062('0x2f')];var _0x5ef86c=_0x16f245?_0x21e84e['count']:_0x2636e0[_0xc062('0x2f')]+_0x2636e0[_0xc062('0x31')];var _0x36f057;if(_0x5ef86c>=_0x49e5e0){_0x5ef86c=_0x49e5e0;_0x36f057=0xc8;}else{_0x36f057=0xce;}_0x100f9b[_0xc062('0x2c')](_0x36f057);return _0x100f9b['set']('Content-Range',_0x15b357+'-'+_0x5ef86c+'/'+_0x49e5e0)[_0xc062('0x2e')](_0x21e84e);}return null;};}function patchUpdates(_0x89d2bd){return function(_0x5a444f){try{jsonpatch[_0xc062('0x33')](_0x5a444f,_0x89d2bd,!![]);}catch(_0x551ca9){return BPromise[_0xc062('0x34')](_0x551ca9);}return _0x5a444f['save']();};}function saveUpdates(_0x2f4eea,_0x54c34a){return function(_0x41fb34){if(_0x41fb34){return _0x41fb34['update'](_0x2f4eea)['then'](function(_0x5ab2eb){return _0x5ab2eb;});}return null;};}function removeEntity(_0x7ac577,_0xd7612e){return function(_0x40943a){if(_0x40943a){return _0x40943a['destroy']()[_0xc062('0x22')](function(){_0x7ac577[_0xc062('0x2c')](0xcc)[_0xc062('0x2d')]();});}};}function handleEntityNotFound(_0x2f18e0,_0x1a34f5){return function(_0x367c04){if(!_0x367c04){_0x2f18e0[_0xc062('0x2b')](0x194);}return _0x367c04;};}function handleError(_0x5e79a6,_0x43d70a){_0x43d70a=_0x43d70a||0x1f4;return function(_0x128b87){logger[_0xc062('0x26')](_0x128b87['stack']);if(_0x128b87['name']){delete _0x128b87['name'];}_0x5e79a6['status'](_0x43d70a)[_0xc062('0x35')](_0x128b87);};}exports[_0xc062('0x36')]=function(_0x5e41af,_0x113f58){var _0x3ef343={},_0x26c0c2={},_0x32c817={'count':0x0,'rows':[]};var _0x1acba8=_[_0xc062('0x37')](db[_0xc062('0x38')]['rawAttributes'],function(_0x2bfb48){return{'name':_0x2bfb48['fieldName'],'type':_0x2bfb48[_0xc062('0x39')][_0xc062('0x3a')]};});_0x26c0c2['model']=_[_0xc062('0x37')](_0x1acba8,_0xc062('0x3b'));_0x26c0c2[_0xc062('0x3c')]=_[_0xc062('0x3d')](_0x5e41af[_0xc062('0x3c')]);_0x26c0c2[_0xc062('0x3e')]=_[_0xc062('0x3f')](_0x26c0c2[_0xc062('0x40')],_0x26c0c2['query']);_0x3ef343[_0xc062('0x41')]=_[_0xc062('0x3f')](_0x26c0c2['model'],qs[_0xc062('0x42')](_0x5e41af[_0xc062('0x3c')][_0xc062('0x42')]));_0x3ef343[_0xc062('0x41')]=_0x3ef343[_0xc062('0x41')]['length']?_0x3ef343[_0xc062('0x41')]:_0x26c0c2[_0xc062('0x40')];if(!_0x5e41af[_0xc062('0x3c')][_0xc062('0x43')](_0xc062('0x44'))){_0x3ef343[_0xc062('0x31')]=qs[_0xc062('0x31')](_0x5e41af[_0xc062('0x3c')][_0xc062('0x31')]);_0x3ef343[_0xc062('0x2f')]=qs['offset'](_0x5e41af[_0xc062('0x3c')]['offset']);}_0x3ef343[_0xc062('0x45')]=qs[_0xc062('0x46')](_0x5e41af[_0xc062('0x3c')][_0xc062('0x46')]);_0x3ef343[_0xc062('0x47')]=qs[_0xc062('0x3e')](_['pick'](_0x5e41af['query'],_0x26c0c2[_0xc062('0x3e')]),_0x1acba8);if(_0x5e41af[_0xc062('0x3c')][_0xc062('0x48')]){_0x3ef343['where']=_[_0xc062('0x49')](_0x3ef343['where'],{'$or':_[_0xc062('0x37')](_0x1acba8,function(_0x5f9731){if(_0x5f9731['type']!==_0xc062('0x4a')){var _0x219e1d={};_0x219e1d[_0x5f9731[_0xc062('0x3b')]]={'$like':'%'+_0x5e41af['query']['filter']+'%'};return _0x219e1d;}})});}_0x3ef343=_[_0xc062('0x49')]({},_0x3ef343,_0x5e41af['options']);var _0x3e6184={'where':_0x3ef343['where']};return db[_0xc062('0x38')][_0xc062('0x32')](_0x3e6184)['then'](function(_0x556d90){_0x32c817[_0xc062('0x32')]=_0x556d90;if(_0x5e41af[_0xc062('0x3c')][_0xc062('0x4b')]){_0x3ef343[_0xc062('0x4c')]=[{'all':!![]}];}return db[_0xc062('0x38')]['findAll'](_0x3ef343);})[_0xc062('0x22')](function(_0x187cbd){_0x32c817['rows']=_0x187cbd;return _0x32c817;})['then'](respondWithFilteredResult(_0x113f58,_0x3ef343))[_0xc062('0x4d')](handleError(_0x113f58,null));};exports[_0xc062('0x4e')]=function(_0x25042b,_0x3b416e){var _0x2de645={'raw':!![],'where':{'id':_0x25042b[_0xc062('0x4f')]['id']}},_0x207f5f={};_0x207f5f['model']=_[_0xc062('0x3d')](db[_0xc062('0x38')][_0xc062('0x50')]);_0x207f5f[_0xc062('0x3c')]=_[_0xc062('0x3d')](_0x25042b[_0xc062('0x3c')]);_0x207f5f['filters']=_[_0xc062('0x3f')](_0x207f5f[_0xc062('0x40')],_0x207f5f[_0xc062('0x3c')]);_0x2de645['attributes']=_['intersection'](_0x207f5f['model'],qs[_0xc062('0x42')](_0x25042b[_0xc062('0x3c')]['fields']));_0x2de645['attributes']=_0x2de645[_0xc062('0x41')]['length']?_0x2de645[_0xc062('0x41')]:_0x207f5f[_0xc062('0x40')];if(_0x25042b[_0xc062('0x3c')][_0xc062('0x4b')]){_0x2de645[_0xc062('0x4c')]=[{'all':!![]}];}_0x2de645=_[_0xc062('0x49')]({},_0x2de645,_0x25042b['options']);return db['WhatsappMessage'][_0xc062('0x51')](_0x2de645)[_0xc062('0x22')](handleEntityNotFound(_0x3b416e,null))['then'](respondWithResult(_0x3b416e,null))['catch'](handleError(_0x3b416e,null));};exports['create']=function(_0x4829f2,_0x2d0873){return db[_0xc062('0x38')][_0xc062('0x52')](_0x4829f2[_0xc062('0x53')],{})[_0xc062('0x22')](respondWithResult(_0x2d0873,0xc9))[_0xc062('0x4d')](handleError(_0x2d0873,null));};exports[_0xc062('0x54')]=function(_0x936a0e,_0x5b1629){if(_0x936a0e['body']['id']){delete _0x936a0e['body']['id'];}return db[_0xc062('0x38')][_0xc062('0x51')]({'where':{'id':_0x936a0e['params']['id']}})['then'](handleEntityNotFound(_0x5b1629,null))[_0xc062('0x22')](saveUpdates(_0x936a0e['body'],null))[_0xc062('0x22')](respondWithResult(_0x5b1629,null))[_0xc062('0x4d')](handleError(_0x5b1629,null));};exports['destroy']=function(_0x45498d,_0x531d87){return db[_0xc062('0x38')][_0xc062('0x51')]({'where':{'id':_0x45498d[_0xc062('0x4f')]['id']}})['then'](handleEntityNotFound(_0x531d87,null))[_0xc062('0x22')](removeEntity(_0x531d87,null))['catch'](handleError(_0x531d87,null));};exports[_0xc062('0x55')]=function(_0x3c1574,_0x30229c){return db[_0xc062('0x38')]['describe']()[_0xc062('0x22')](respondWithResult(_0x30229c,null))[_0xc062('0x4d')](handleError(_0x30229c,null));};var interaction_log=require(_0xc062('0x15'))(_0xc062('0x56'));exports['accept']=function(_0x17f2e6,_0x3b3064,_0x6eb26){var _0x227b5d={'agent':{},'channel':'whatsapp'};if(_0x17f2e6[_0xc062('0x53')]['id']){delete _0x17f2e6[_0xc062('0x53')]['id'];}_0x17f2e6['body'][_0xc062('0x57')]=!![];_0x17f2e6[_0xc062('0x53')][_0xc062('0x58')]=moment()['format'](_0xc062('0x59'));_0x17f2e6[_0xc062('0x53')]['UserId']=_0x17f2e6[_0xc062('0x53')]['UserId']||_0x17f2e6['user']['id'];_0x227b5d[_0xc062('0x5a')]['id']=_0x17f2e6[_0xc062('0x53')][_0xc062('0x5b')];return db[_0xc062('0x38')][_0xc062('0x51')]({'where':{'id':_0x17f2e6[_0xc062('0x4f')]['id'],'UserId':null}})[_0xc062('0x22')](handleEntityNotFound(_0x3b3064,null))[_0xc062('0x22')](saveUpdates(_0x17f2e6[_0xc062('0x53')],null))[_0xc062('0x22')](function(_0x439946){if(_0x439946){_0x227b5d['message']=_0x439946[_0xc062('0x5c')]({'plain':!![]});return db[_0xc062('0x5d')][_0xc062('0x51')]({'where':{'id':_0x439946[_0xc062('0x5e')]}});}return null;})[_0xc062('0x22')](handleEntityNotFound(_0x3b3064,null))[_0xc062('0x22')](function(_0x5bd8ce){if(_0x5bd8ce){return _0x5bd8ce['update']({'UserId':_0x17f2e6['body'][_0xc062('0x5b')],'read1stAt':_['isNil'](_0x5bd8ce[_0xc062('0x5f')])?moment()['format'](_0xc062('0x59')):undefined});}return null;})['then'](function(_0x261b79){if(_0x261b79){_0x227b5d[_0xc062('0x60')]=_0x261b79[_0xc062('0x5c')]({'plain':!![]});interaction_log[_0xc062('0x23')](_0xc062('0x61'),_0x17f2e6['user']['id'],_0x17f2e6['user'][_0xc062('0x3b')],_0x17f2e6[_0xc062('0x62')][_0xc062('0x63')],_0x227b5d[_0xc062('0x60')]['id'],_0x17f2e6[_0xc062('0x53')]?JSON[_0xc062('0x64')](_0x17f2e6[_0xc062('0x53')]):'null');return respondWithRpcPromise(_0xc062('0x65'),_0xc062('0x66'),_0x227b5d);}return null;})['then'](function(_0x104f34){var _0x2ec3eb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x104f34['message'][_0xc062('0x67')];return db[_0xc062('0x68')][_0xc062('0x3c')](_0x2ec3eb,{'type':db[_0xc062('0x69')]['QueryTypes'][_0xc062('0x6a')],'raw':!![]})[_0xc062('0x22')](function(_0x18853c){return _0x18853c;});})[_0xc062('0x22')](function(_0x3172e5){if(_0x3172e5){_0x227b5d['message']['contact']=_0x3172e5[0x0];if(!_0x17f2e6['body']['UserId'])return;return db[_0xc062('0x6b')][_0xc062('0x51')]({'where':{'id':_0x17f2e6['body'][_0xc062('0x5b')],'role':_0xc062('0x5a')},'attributes':['id',_0xc062('0x3b'),'fullname',_0xc062('0x6c'),_0xc062('0x6d')],'raw':!![]});}return null;})[_0xc062('0x22')](function(_0x5f1156){if(!_0x5f1156)return null;_0x227b5d[_0xc062('0x29')][_0xc062('0x5a')]=_0x5f1156;return _0x227b5d;})[_0xc062('0x22')](function(_0x1aa3b0){if(_0x1aa3b0){if(_0x17f2e6[_0xc062('0x53')][_0xc062('0x6e')]){_0x227b5d[_0xc062('0x29')][_0xc062('0x6f')]=util['format'](_0xc062('0x70'),_0x17f2e6[_0xc062('0x62')][_0xc062('0x3b')]);_0x227b5d[_0xc062('0x29')][_0xc062('0x71')]=_0x227b5d[_0xc062('0x71')];_0x227b5d[_0xc062('0x29')]['motionChannel']=_0x227b5d['channel'];_0x227b5d[_0xc062('0x29')]['event']='accept';return respondWithRpcPromise(_0xc062('0x72'),_0xc062('0x72'),{'event':_0xc062('0x73'),'message':_0x227b5d['message']},client9002)[_0xc062('0x22')](function(){return _0x227b5d;});}return _0x227b5d;}return null;})[_0xc062('0x22')](respondWithResult(_0x3b3064,null))['catch'](handleError(_0x3b3064,null));};var interaction_log=require(_0xc062('0x15'))('whatsapp-interactions');exports[_0xc062('0x34')]=function(_0x586aff,_0x4b3a26,_0x41235c){var _0x2d3383={'agent':{},'channel':_0xc062('0x74')};if(_0x586aff[_0xc062('0x53')]['id']){delete _0x586aff[_0xc062('0x53')]['id'];}_0x586aff[_0xc062('0x53')][_0xc062('0x5b')]=_0x586aff['body'][_0xc062('0x5b')]||_0x586aff[_0xc062('0x62')]['id'];_0x2d3383[_0xc062('0x5a')]['id']=_0x586aff[_0xc062('0x53')]['UserId'];return db[_0xc062('0x38')][_0xc062('0x51')]({'where':{'id':_0x586aff[_0xc062('0x4f')]['id'],'UserId':null}})[_0xc062('0x22')](handleEntityNotFound(_0x4b3a26,null))['then'](function(_0x4078f4){if(_0x4078f4){_0x2d3383['message']=_0x4078f4['get']({'plain':!![]});return db[_0xc062('0x5d')][_0xc062('0x51')]({'where':{'id':_0x4078f4['WhatsappInteractionId']}});}return null;})[_0xc062('0x22')](handleEntityNotFound(_0x4b3a26,null))['then'](function(_0x579096){if(_0x579096){_0x2d3383['interaction']=_0x579096[_0xc062('0x5c')]({'plain':!![]});interaction_log[_0xc062('0x23')](_0xc062('0x75'),_0x586aff[_0xc062('0x62')]['id'],_0x586aff[_0xc062('0x62')][_0xc062('0x3b')],_0x586aff['user'][_0xc062('0x63')],_0x2d3383[_0xc062('0x60')]['id'],_0x586aff[_0xc062('0x53')]?JSON[_0xc062('0x64')](_0x586aff['body']):_0xc062('0x76'));return respondWithRpcPromise(_0xc062('0x77'),'rejectMessage',_0x2d3383);}return null;})[_0xc062('0x22')](function(_0xe4b20d){var _0xf5e348=_0xc062('0x78')+_0xe4b20d[_0xc062('0x29')][_0xc062('0x67')];return db[_0xc062('0x68')][_0xc062('0x3c')](_0xf5e348,{'type':db[_0xc062('0x69')]['QueryTypes'][_0xc062('0x6a')],'raw':!![]})['then'](function(_0x438e14){return _0x438e14;});})[_0xc062('0x22')](function(_0x36d6d4){if(_0x36d6d4){_0x2d3383[_0xc062('0x29')][_0xc062('0x79')]=_0x36d6d4[0x0];if(!_0x586aff[_0xc062('0x53')][_0xc062('0x5b')])return;return db[_0xc062('0x6b')]['find']({'where':{'id':_0x586aff[_0xc062('0x53')]['UserId'],'role':'agent'},'attributes':['id',_0xc062('0x3b'),_0xc062('0x7a'),_0xc062('0x6c'),_0xc062('0x6d')],'raw':!![]});}return null;})[_0xc062('0x22')](function(_0xfdcfa){if(!_0xfdcfa)return null;_0x2d3383['message']['agent']=_0xfdcfa;return _0x2d3383;})['then'](function(_0x24749f){if(_0x24749f){_0x24749f[_0xc062('0x29')][_0xc062('0x6f')]=util['format']('SIP/%s',_0x586aff[_0xc062('0x62')][_0xc062('0x3b')]);_0x24749f[_0xc062('0x29')]['channel']=_0x2d3383[_0xc062('0x71')];_0x24749f[_0xc062('0x29')][_0xc062('0x7b')]=_0x2d3383[_0xc062('0x71')];_0x24749f[_0xc062('0x29')][_0xc062('0x7c')]='reject';respondWithRpcPromise('EventManager',_0xc062('0x72'),{'event':_0xc062('0x7d'),'message':_0x24749f[_0xc062('0x29')]},client9002);return _0x2d3383;}return null;})[_0xc062('0x22')](respondWithResult(_0x4b3a26,null))['catch'](handleError(_0x4b3a26,null));};exports[_0xc062('0x2c')]=function(_0x3609d2,_0x298571,_0x4c268f){if(_0x3609d2['body']['id']){delete _0x3609d2[_0xc062('0x53')]['id'];}var _0x2e3965;return db[_0xc062('0x38')]['find']({'where':{'id':_0x3609d2['params']['id']}})[_0xc062('0x22')](handleEntityNotFound(_0x298571,null))['then'](function(_0x49541d){if(_0x49541d){_0x2e3965=_0x49541d;return db[_0xc062('0x7e')][_0xc062('0x51')]({'where':{'id':_0x49541d[_0xc062('0x7f')]}});}})[_0xc062('0x22')](handleEntityNotFound(_0x298571,null))[_0xc062('0x22')](function(_0x484848){if(_0x484848){logger[_0xc062('0x24')](_0xc062('0x80'),_0xc062('0x2c'),'received\x20delivery\x20report\x20from',_0x484848['type'],util[_0xc062('0x81')](_0x3609d2[_0xc062('0x53')],{'showHidden':![],'depth':null}));switch(_0x484848['type']){case _0xc062('0x82'):if(_0x3609d2[_0xc062('0x53')][_0xc062('0x83')]&&_0x3609d2[_0xc062('0x53')][_0xc062('0x83')]===_0x2e3965[_0xc062('0x84')]&&_0x3609d2[_0xc062('0x53')][_0xc062('0x85')]&&_0x3609d2[_0xc062('0x53')][_0xc062('0x85')]===_0xc062('0x57')){return _0x2e3965[_0xc062('0x54')]({'read':!![]});}else{logger[_0xc062('0x26')](_0xc062('0x86'),_0xc062('0x2c'),'twilio',util['inspect'](_0x3609d2['body'],{'showHidden':![],'depth':null}));}break;}return _0x2e3965;}})[_0xc062('0x22')](respondWithResult(_0x298571,null))[_0xc062('0x4d')](handleError(_0x298571,null));}; \ No newline at end of file +var _0x61c3=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','fullname','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','update','body','describe','accept','whatsapp','read','readAt'];(function(_0x3b2293,_0x298937){var _0x3820cd=function(_0x431035){while(--_0x431035){_0x3b2293['push'](_0x3b2293['shift']());}};_0x3820cd(++_0x298937);}(_0x61c3,0xb7));var _0x361c=function(_0x3d6c41,_0x599e83){_0x3d6c41=_0x3d6c41-0x0;var _0x9e5b0e=_0x61c3[_0x3d6c41];return _0x9e5b0e;};'use strict';var emlformat=require(_0x361c('0x0'));var rimraf=require(_0x361c('0x1'));var zipdir=require(_0x361c('0x2'));var jsonpatch=require(_0x361c('0x3'));var rp=require('request-promise');var moment=require(_0x361c('0x4'));var BPromise=require(_0x361c('0x5'));var Mustache=require('mustache');var util=require(_0x361c('0x6'));var path=require(_0x361c('0x7'));var sox=require(_0x361c('0x8'));var csv=require(_0x361c('0x9'));var ejs=require(_0x361c('0xa'));var fs=require('fs');var fs_extra=require(_0x361c('0xb'));var _=require(_0x361c('0xc'));var squel=require(_0x361c('0xd'));var crypto=require(_0x361c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x361c('0x9'));var querystring=require('querystring');var Papa=require(_0x361c('0xf'));var Redis=require('ioredis');var authService=require(_0x361c('0x10'));var qs=require(_0x361c('0x11'));var as=require(_0x361c('0x12'));var hardwareService=require(_0x361c('0x13'));var logger=require(_0x361c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x361c('0x15'));var db=require(_0x361c('0x16'))['db'];config[_0x361c('0x17')]=_['defaults'](config[_0x361c('0x17')],{'host':_0x361c('0x18'),'port':0x18eb});var socket=require(_0x361c('0x19'))(new Redis(config[_0x361c('0x17')]));require('./whatsappMessage.socket')[_0x361c('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x361c('0x1b')][_0x361c('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x361c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x446750,_0x583547,_0x365adb,_0xf0367b){return new BPromise(function(_0x3a1482,_0x132e24){var _0x122106=_0xf0367b||client;return _0x122106['request'](_0x446750,_0x365adb)[_0x361c('0x1d')](function(_0xfe080){logger[_0x361c('0x1e')](_0x361c('0x1f'),_0x583547,_0x361c('0x20'));logger[_0x361c('0x21')](_0x361c('0x22'),_0x583547,_0x361c('0x20'),JSON[_0x361c('0x23')](_0xfe080));if(_0xfe080[_0x361c('0x24')]){if(_0xfe080[_0x361c('0x24')][_0x361c('0x25')]===0x1f4){logger['error'](_0x361c('0x1f'),_0x583547,_0xfe080[_0x361c('0x24')]['message']);return _0x132e24(_0xfe080[_0x361c('0x24')][_0x361c('0x26')]);}logger[_0x361c('0x24')](_0x361c('0x1f'),_0x583547,_0xfe080[_0x361c('0x24')]['message']);return _0x3a1482(_0xfe080[_0x361c('0x24')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x583547,'request\x20sent');_0x3a1482(_0xfe080[_0x361c('0x27')][_0x361c('0x26')]);}})['catch'](function(_0x4e4a8c){logger[_0x361c('0x24')](_0x361c('0x1f'),_0x583547,_0x4e4a8c);_0x132e24(_0x4e4a8c);});});}function respondWithStatusCode(_0x2f824e,_0x562f41){_0x562f41=_0x562f41||0xcc;return function(_0x45639e){if(_0x45639e){return _0x2f824e[_0x361c('0x28')](_0x562f41);}return _0x2f824e[_0x361c('0x29')](_0x562f41)[_0x361c('0x2a')]();};}function respondWithResult(_0x3a7902,_0x37dd0a){_0x37dd0a=_0x37dd0a||0xc8;return function(_0x9a4730){if(_0x9a4730){return _0x3a7902['status'](_0x37dd0a)[_0x361c('0x2b')](_0x9a4730);}};}function respondWithFilteredResult(_0x4d340c,_0x1363be){return function(_0x26f080){if(_0x26f080){var _0x18252d=typeof _0x1363be[_0x361c('0x2c')]===_0x361c('0x2d')&&typeof _0x1363be[_0x361c('0x2e')]===_0x361c('0x2d');var _0x3493fa=_0x26f080[_0x361c('0x2f')];var _0x423406=_0x18252d?0x0:_0x1363be['offset'];var _0x3afd87=_0x18252d?_0x26f080[_0x361c('0x2f')]:_0x1363be['offset']+_0x1363be[_0x361c('0x2e')];var _0x4f2ac5;if(_0x3afd87>=_0x3493fa){_0x3afd87=_0x3493fa;_0x4f2ac5=0xc8;}else{_0x4f2ac5=0xce;}_0x4d340c[_0x361c('0x29')](_0x4f2ac5);return _0x4d340c['set']('Content-Range',_0x423406+'-'+_0x3afd87+'/'+_0x3493fa)[_0x361c('0x2b')](_0x26f080);}return null;};}function patchUpdates(_0x467282){return function(_0x5580f4){try{jsonpatch['apply'](_0x5580f4,_0x467282,!![]);}catch(_0x4c186a){return BPromise[_0x361c('0x30')](_0x4c186a);}return _0x5580f4[_0x361c('0x31')]();};}function saveUpdates(_0x1ff58f,_0x1fa0e9){return function(_0x6c90e2){if(_0x6c90e2){return _0x6c90e2['update'](_0x1ff58f)[_0x361c('0x1d')](function(_0x8345a5){return _0x8345a5;});}return null;};}function removeEntity(_0x31c555,_0x1875c7){return function(_0x21656a){if(_0x21656a){return _0x21656a[_0x361c('0x32')]()[_0x361c('0x1d')](function(){_0x31c555[_0x361c('0x29')](0xcc)[_0x361c('0x2a')]();});}};}function handleEntityNotFound(_0xcaf8b0,_0x210ff4){return function(_0x3a4852){if(!_0x3a4852){_0xcaf8b0[_0x361c('0x28')](0x194);}return _0x3a4852;};}function handleError(_0x372439,_0x5f170e){_0x5f170e=_0x5f170e||0x1f4;return function(_0x2d9ff1){logger[_0x361c('0x24')](_0x2d9ff1[_0x361c('0x33')]);if(_0x2d9ff1[_0x361c('0x34')]){delete _0x2d9ff1[_0x361c('0x34')];}_0x372439['status'](_0x5f170e)[_0x361c('0x35')](_0x2d9ff1);};}exports[_0x361c('0x36')]=function(_0x41a99d,_0x3a2df5){var _0x29b196={},_0x11cbf6={},_0x1bcaf0={'count':0x0,'rows':[]};var _0xe8bcca=_[_0x361c('0x37')](db[_0x361c('0x38')]['rawAttributes'],function(_0xa24fee){return{'name':_0xa24fee[_0x361c('0x39')],'type':_0xa24fee['type'][_0x361c('0x3a')]};});_0x11cbf6[_0x361c('0x3b')]=_[_0x361c('0x37')](_0xe8bcca,_0x361c('0x34'));_0x11cbf6[_0x361c('0x3c')]=_['keys'](_0x41a99d['query']);_0x11cbf6[_0x361c('0x3d')]=_[_0x361c('0x3e')](_0x11cbf6[_0x361c('0x3b')],_0x11cbf6[_0x361c('0x3c')]);_0x29b196[_0x361c('0x3f')]=_[_0x361c('0x3e')](_0x11cbf6[_0x361c('0x3b')],qs[_0x361c('0x40')](_0x41a99d[_0x361c('0x3c')][_0x361c('0x40')]));_0x29b196[_0x361c('0x3f')]=_0x29b196[_0x361c('0x3f')][_0x361c('0x41')]?_0x29b196[_0x361c('0x3f')]:_0x11cbf6[_0x361c('0x3b')];if(!_0x41a99d['query'][_0x361c('0x42')](_0x361c('0x43'))){_0x29b196[_0x361c('0x2e')]=qs[_0x361c('0x2e')](_0x41a99d[_0x361c('0x3c')]['limit']);_0x29b196[_0x361c('0x2c')]=qs[_0x361c('0x2c')](_0x41a99d[_0x361c('0x3c')][_0x361c('0x2c')]);}_0x29b196['order']=qs[_0x361c('0x44')](_0x41a99d[_0x361c('0x3c')][_0x361c('0x44')]);_0x29b196['where']=qs[_0x361c('0x3d')](_[_0x361c('0x45')](_0x41a99d[_0x361c('0x3c')],_0x11cbf6['filters']),_0xe8bcca);if(_0x41a99d[_0x361c('0x3c')][_0x361c('0x46')]){_0x29b196['where']=_['merge'](_0x29b196[_0x361c('0x47')],{'$or':_['map'](_0xe8bcca,function(_0x56e645){if(_0x56e645[_0x361c('0x48')]!==_0x361c('0x49')){var _0x20ebdf={};_0x20ebdf[_0x56e645[_0x361c('0x34')]]={'$like':'%'+_0x41a99d[_0x361c('0x3c')]['filter']+'%'};return _0x20ebdf;}})});}_0x29b196=_['merge']({},_0x29b196,_0x41a99d[_0x361c('0x4a')]);var _0x4c9289={'where':_0x29b196[_0x361c('0x47')]};return db[_0x361c('0x38')]['count'](_0x4c9289)[_0x361c('0x1d')](function(_0x1ba2d0){_0x1bcaf0[_0x361c('0x2f')]=_0x1ba2d0;if(_0x41a99d[_0x361c('0x3c')][_0x361c('0x4b')]){_0x29b196[_0x361c('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x361c('0x4d')](_0x29b196);})[_0x361c('0x1d')](function(_0x19ac98){_0x1bcaf0[_0x361c('0x4e')]=_0x19ac98;return _0x1bcaf0;})['then'](respondWithFilteredResult(_0x3a2df5,_0x29b196))[_0x361c('0x4f')](handleError(_0x3a2df5,null));};exports[_0x361c('0x50')]=function(_0x1c0d2c,_0x5b6acc){var _0x469335={'raw':!![],'where':{'id':_0x1c0d2c[_0x361c('0x51')]['id']}},_0x4a2939={};_0x4a2939[_0x361c('0x3b')]=_[_0x361c('0x52')](db[_0x361c('0x38')][_0x361c('0x53')]);_0x4a2939['query']=_[_0x361c('0x52')](_0x1c0d2c[_0x361c('0x3c')]);_0x4a2939[_0x361c('0x3d')]=_[_0x361c('0x3e')](_0x4a2939[_0x361c('0x3b')],_0x4a2939[_0x361c('0x3c')]);_0x469335[_0x361c('0x3f')]=_[_0x361c('0x3e')](_0x4a2939[_0x361c('0x3b')],qs[_0x361c('0x40')](_0x1c0d2c['query']['fields']));_0x469335[_0x361c('0x3f')]=_0x469335[_0x361c('0x3f')][_0x361c('0x41')]?_0x469335[_0x361c('0x3f')]:_0x4a2939[_0x361c('0x3b')];if(_0x1c0d2c['query'][_0x361c('0x4b')]){_0x469335[_0x361c('0x4c')]=[{'all':!![]}];}_0x469335=_['merge']({},_0x469335,_0x1c0d2c['options']);return db[_0x361c('0x38')][_0x361c('0x54')](_0x469335)[_0x361c('0x1d')](handleEntityNotFound(_0x5b6acc,null))[_0x361c('0x1d')](respondWithResult(_0x5b6acc,null))[_0x361c('0x4f')](handleError(_0x5b6acc,null));};exports['create']=function(_0x307703,_0x445987){return db[_0x361c('0x38')][_0x361c('0x55')](_0x307703['body'],{})[_0x361c('0x1d')](respondWithResult(_0x445987,0xc9))[_0x361c('0x4f')](handleError(_0x445987,null));};exports[_0x361c('0x56')]=function(_0x4849a0,_0x39db7a){if(_0x4849a0[_0x361c('0x57')]['id']){delete _0x4849a0['body']['id'];}return db[_0x361c('0x38')][_0x361c('0x54')]({'where':{'id':_0x4849a0[_0x361c('0x51')]['id']}})[_0x361c('0x1d')](handleEntityNotFound(_0x39db7a,null))[_0x361c('0x1d')](saveUpdates(_0x4849a0[_0x361c('0x57')],null))['then'](respondWithResult(_0x39db7a,null))[_0x361c('0x4f')](handleError(_0x39db7a,null));};exports[_0x361c('0x32')]=function(_0x5a0d77,_0x3bbf0e){return db[_0x361c('0x38')]['find']({'where':{'id':_0x5a0d77[_0x361c('0x51')]['id']}})[_0x361c('0x1d')](handleEntityNotFound(_0x3bbf0e,null))[_0x361c('0x1d')](removeEntity(_0x3bbf0e,null))[_0x361c('0x4f')](handleError(_0x3bbf0e,null));};exports[_0x361c('0x58')]=function(_0x3857a0,_0x1373d5){return db[_0x361c('0x38')]['describe']()['then'](respondWithResult(_0x1373d5,null))[_0x361c('0x4f')](handleError(_0x1373d5,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x361c('0x59')]=function(_0xf49b6,_0x35054e,_0x551e7a){var _0x10de58={'agent':{},'channel':_0x361c('0x5a')};if(_0xf49b6['body']['id']){delete _0xf49b6[_0x361c('0x57')]['id'];}_0xf49b6[_0x361c('0x57')][_0x361c('0x5b')]=!![];_0xf49b6[_0x361c('0x57')][_0x361c('0x5c')]=moment()[_0x361c('0x5d')](_0x361c('0x5e'));_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')]=_0xf49b6[_0x361c('0x57')]['UserId']||_0xf49b6[_0x361c('0x60')]['id'];_0x10de58[_0x361c('0x61')]['id']=_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')];return db[_0x361c('0x38')][_0x361c('0x54')]({'where':{'id':_0xf49b6['params']['id'],'UserId':null}})[_0x361c('0x1d')](handleEntityNotFound(_0x35054e,null))[_0x361c('0x1d')](saveUpdates(_0xf49b6[_0x361c('0x57')],null))[_0x361c('0x1d')](function(_0x143280){if(_0x143280){_0x10de58['message']=_0x143280[_0x361c('0x62')]({'plain':!![]});return db[_0x361c('0x63')][_0x361c('0x54')]({'where':{'id':_0x143280[_0x361c('0x64')]}});}return null;})[_0x361c('0x1d')](handleEntityNotFound(_0x35054e,null))[_0x361c('0x1d')](function(_0xb4ea16){if(_0xb4ea16){return _0xb4ea16['update']({'UserId':_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')],'read1stAt':_[_0x361c('0x65')](_0xb4ea16['read1stAt'])?moment()['format'](_0x361c('0x5e')):undefined});}return null;})['then'](function(_0x5e06f0){if(_0x5e06f0){_0x10de58[_0x361c('0x66')]=_0x5e06f0[_0x361c('0x62')]({'plain':!![]});interaction_log[_0x361c('0x1e')](_0x361c('0x67'),_0xf49b6[_0x361c('0x60')]['id'],_0xf49b6[_0x361c('0x60')][_0x361c('0x34')],_0xf49b6['user'][_0x361c('0x68')],_0x10de58['interaction']['id'],_0xf49b6[_0x361c('0x57')]?JSON['stringify'](_0xf49b6[_0x361c('0x57')]):'null');return respondWithRpcPromise(_0x361c('0x69'),_0x361c('0x6a'),_0x10de58);}return null;})[_0x361c('0x1d')](function(_0x1169f7){var _0x4414bf=_0x361c('0x6b')+_0x1169f7['message'][_0x361c('0x6c')];return db[_0x361c('0x6d')][_0x361c('0x3c')](_0x4414bf,{'type':db[_0x361c('0x6e')][_0x361c('0x6f')][_0x361c('0x70')],'raw':!![]})[_0x361c('0x1d')](function(_0x19f37){return _0x19f37;});})['then'](function(_0x550da0){if(_0x550da0){_0x10de58['message'][_0x361c('0x71')]=_0x550da0[0x0];if(!_0xf49b6[_0x361c('0x57')]['UserId'])return;return db[_0x361c('0x72')][_0x361c('0x54')]({'where':{'id':_0xf49b6[_0x361c('0x57')][_0x361c('0x5f')],'role':'agent'},'attributes':['id',_0x361c('0x34'),'fullname',_0x361c('0x73'),_0x361c('0x74')],'raw':!![]});}return null;})[_0x361c('0x1d')](function(_0x2666b3){if(!_0x2666b3)return null;_0x10de58[_0x361c('0x26')][_0x361c('0x61')]=_0x2666b3;return _0x10de58;})[_0x361c('0x1d')](function(_0x31df54){if(_0x31df54){if(_0xf49b6[_0x361c('0x57')][_0x361c('0x75')]){_0x10de58[_0x361c('0x26')][_0x361c('0x76')]=util[_0x361c('0x5d')](_0x361c('0x77'),_0xf49b6[_0x361c('0x60')][_0x361c('0x34')]);_0x10de58[_0x361c('0x26')][_0x361c('0x78')]=_0x10de58[_0x361c('0x78')];_0x10de58[_0x361c('0x26')][_0x361c('0x79')]=_0x10de58[_0x361c('0x78')];_0x10de58[_0x361c('0x26')][_0x361c('0x7a')]=_0x361c('0x59');return respondWithRpcPromise('EventManager',_0x361c('0x7b'),{'event':_0x361c('0x7c'),'message':_0x10de58[_0x361c('0x26')]},client9002)[_0x361c('0x1d')](function(){return _0x10de58;});}return _0x10de58;}return null;})['then'](respondWithResult(_0x35054e,null))[_0x361c('0x4f')](handleError(_0x35054e,null));};var interaction_log=require('../../config/logger')(_0x361c('0x7d'));exports[_0x361c('0x30')]=function(_0x1c6345,_0x104595,_0x2bb429){var _0x402885={'agent':{},'channel':_0x361c('0x5a')};if(_0x1c6345[_0x361c('0x57')]['id']){delete _0x1c6345[_0x361c('0x57')]['id'];}_0x1c6345[_0x361c('0x57')][_0x361c('0x5f')]=_0x1c6345['body'][_0x361c('0x5f')]||_0x1c6345[_0x361c('0x60')]['id'];_0x402885[_0x361c('0x61')]['id']=_0x1c6345['body']['UserId'];return db[_0x361c('0x38')]['find']({'where':{'id':_0x1c6345['params']['id'],'UserId':null}})[_0x361c('0x1d')](handleEntityNotFound(_0x104595,null))['then'](function(_0x3b8e32){if(_0x3b8e32){_0x402885[_0x361c('0x26')]=_0x3b8e32[_0x361c('0x62')]({'plain':!![]});return db[_0x361c('0x63')][_0x361c('0x54')]({'where':{'id':_0x3b8e32['WhatsappInteractionId']}});}return null;})[_0x361c('0x1d')](handleEntityNotFound(_0x104595,null))[_0x361c('0x1d')](function(_0x1a811b){if(_0x1a811b){_0x402885[_0x361c('0x66')]=_0x1a811b['get']({'plain':!![]});interaction_log['info'](_0x361c('0x7e'),_0x1c6345[_0x361c('0x60')]['id'],_0x1c6345[_0x361c('0x60')][_0x361c('0x34')],_0x1c6345[_0x361c('0x60')]['role'],_0x402885[_0x361c('0x66')]['id'],_0x1c6345[_0x361c('0x57')]?JSON[_0x361c('0x23')](_0x1c6345[_0x361c('0x57')]):'null');return respondWithRpcPromise(_0x361c('0x7f'),'rejectMessage',_0x402885);}return null;})[_0x361c('0x1d')](function(_0x280368){var _0x54982c=_0x361c('0x6b')+_0x280368[_0x361c('0x26')][_0x361c('0x6c')];return db['sequelize']['query'](_0x54982c,{'type':db[_0x361c('0x6e')][_0x361c('0x6f')][_0x361c('0x70')],'raw':!![]})[_0x361c('0x1d')](function(_0x190787){return _0x190787;});})[_0x361c('0x1d')](function(_0x329f2a){if(_0x329f2a){_0x402885['message'][_0x361c('0x71')]=_0x329f2a[0x0];if(!_0x1c6345[_0x361c('0x57')][_0x361c('0x5f')])return;return db[_0x361c('0x72')][_0x361c('0x54')]({'where':{'id':_0x1c6345[_0x361c('0x57')][_0x361c('0x5f')],'role':_0x361c('0x61')},'attributes':['id',_0x361c('0x34'),_0x361c('0x80'),_0x361c('0x73'),_0x361c('0x74')],'raw':!![]});}return null;})[_0x361c('0x1d')](function(_0x256135){if(!_0x256135)return null;_0x402885[_0x361c('0x26')]['agent']=_0x256135;return _0x402885;})[_0x361c('0x1d')](function(_0x3e1692){if(_0x3e1692){_0x3e1692['message'][_0x361c('0x76')]=util[_0x361c('0x5d')](_0x361c('0x77'),_0x1c6345[_0x361c('0x60')][_0x361c('0x34')]);_0x3e1692['message'][_0x361c('0x78')]=_0x402885[_0x361c('0x78')];_0x3e1692[_0x361c('0x26')][_0x361c('0x79')]=_0x402885[_0x361c('0x78')];_0x3e1692[_0x361c('0x26')][_0x361c('0x7a')]=_0x361c('0x30');respondWithRpcPromise(_0x361c('0x7b'),_0x361c('0x7b'),{'event':'rejectmessage','message':_0x3e1692[_0x361c('0x26')]},client9002);return _0x402885;}return null;})['then'](respondWithResult(_0x104595,null))['catch'](handleError(_0x104595,null));};exports[_0x361c('0x29')]=function(_0x26f0f1,_0x533448,_0x5e83cd){if(_0x26f0f1[_0x361c('0x57')]['id']){delete _0x26f0f1['body']['id'];}var _0x22d02e;return db['WhatsappMessage'][_0x361c('0x54')]({'where':{'id':_0x26f0f1[_0x361c('0x51')]['id']}})['then'](handleEntityNotFound(_0x533448,null))['then'](function(_0x5cacf8){if(_0x5cacf8){_0x22d02e=_0x5cacf8;return db[_0x361c('0x81')][_0x361c('0x54')]({'where':{'id':_0x5cacf8[_0x361c('0x82')]}});}})['then'](handleEntityNotFound(_0x533448,null))[_0x361c('0x1d')](function(_0x2c1619){if(_0x2c1619){logger[_0x361c('0x21')](_0x361c('0x83'),_0x361c('0x29'),'received\x20delivery\x20report\x20from',_0x2c1619[_0x361c('0x48')],util[_0x361c('0x84')](_0x26f0f1[_0x361c('0x57')],{'showHidden':![],'depth':null}));switch(_0x2c1619['type']){case _0x361c('0x85'):if(_0x26f0f1['body'][_0x361c('0x86')]&&_0x26f0f1['body'][_0x361c('0x86')]===_0x22d02e[_0x361c('0x87')]&&_0x26f0f1['body'][_0x361c('0x88')]&&_0x26f0f1[_0x361c('0x57')][_0x361c('0x88')]===_0x361c('0x5b')){return _0x22d02e[_0x361c('0x56')]({'read':!![]});}else{logger[_0x361c('0x24')](_0x361c('0x89'),_0x361c('0x29'),_0x361c('0x85'),util[_0x361c('0x84')](_0x26f0f1['body'],{'showHidden':![],'depth':null}));}break;}return _0x22d02e;}})[_0x361c('0x1d')](respondWithResult(_0x533448,null))[_0x361c('0x4f')](handleError(_0x533448,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 3384313..458248f 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaaa2=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0xaaa2,0xac));var _0x2aaa=function(_0xfe4ecd,_0xd2f09){_0xfe4ecd=_0xfe4ecd-0x0;var _0x52f6d5=_0xaaa2[_0xfe4ecd];return _0x52f6d5;};'use strict';var EventEmitter=require(_0x2aaa('0x0'));var WhatsappMessage=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2aaa('0x3')](0x0);var events={'afterCreate':_0x2aaa('0x4'),'afterUpdate':_0x2aaa('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfc076){return function(_0x482489,_0x35b5c8,_0x340071){WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076+':'+_0x482489['id'],_0x482489);WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076,_0x482489);_0x340071(null);};}for(var e in events){if(events[_0x2aaa('0x7')](e)){var event=events[e];WhatsappMessage[_0x2aaa('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x657b=['../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x657b,0x131));var _0xb657=function(_0x2bf155,_0x3981f6){_0x2bf155=_0x2bf155-0x0;var _0x543850=_0x657b[_0x2bf155];return _0x543850;};'use strict';var EventEmitter=require(_0xb657('0x0'));var WhatsappMessage=require(_0xb657('0x1'))['db'][_0xb657('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb657('0x3')](0x0);var events={'afterCreate':_0xb657('0x4'),'afterUpdate':'update','afterDestroy':_0xb657('0x5')};function emitEvent(_0xa41497){return function(_0x5da1bc,_0x175072,_0x322e57){WhatsappMessageEvents[_0xb657('0x6')](_0xa41497+':'+_0x5da1bc['id'],_0x5da1bc);WhatsappMessageEvents[_0xb657('0x6')](_0xa41497,_0x5da1bc);_0x322e57(null);};}for(var e in events){if(events[_0xb657('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xb657('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index cb8736d..5e39ff6 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 _0x10d1=['bluebird','request-promise','node-fetch','path','rimraf','exports','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/whatsapp/v1/','text','POST','Bearer\x20','application/json','statuses','message_id','update','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3dba56,_0x5928ff){var _0x1caa36=function(_0x453120){while(--_0x453120){_0x3dba56['push'](_0x3dba56['shift']());}};_0x1caa36(++_0x5928ff);}(_0x10d1,0xec));var _0x110d=function(_0x57a464,_0xca6f3b){_0x57a464=_0x57a464-0x0;var _0x4514ef=_0x10d1[_0x57a464];return _0x4514ef;};'use strict';var _=require(_0x110d('0x0'));var util=require(_0x110d('0x1'));var logger=require(_0x110d('0x2'))(_0x110d('0x3'));var moment=require('moment');var BPromise=require(_0x110d('0x4'));var rp=require(_0x110d('0x5'));var fetch=require(_0x110d('0x6'));var fs=require('fs');var path=require(_0x110d('0x7'));var rimraf=require(_0x110d('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x110d('0x9')]=function(_0x319484,_0x947940){return _0x319484['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x110d('0xa'),'fields':['messageId']},{'name':_0x110d('0xb'),'fields':[_0x110d('0xc')],'type':_0x110d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5eb1f3,_0xb37e28,_0x1d0ab0){var _0x5564d9=_0x319484[_0x110d('0xe')];var _0x2e13cc=_0x5eb1f3[_0x110d('0xf')]({'plain':!![]});if(_0x2e13cc[_0x110d('0x10')][_0x110d('0x11')]()==='in'||_0x2e13cc[_0x110d('0x10')][_0x110d('0x11')]()==='out'&&!_0x2e13cc[_0x110d('0x12')]&&!_[_0x110d('0x13')](_0x2e13cc[_0x110d('0x14')])){_0x5564d9[_0x110d('0x15')][_0x110d('0x16')]({'where':{'id':_0x2e13cc[_0x110d('0x17')]}})[_0x110d('0x18')](function(_0x325507){if(_0x325507){_0x325507['update']({'lastMsgAt':_0x2e13cc[_0x110d('0x19')],'lastMsgDirection':_0x2e13cc['direction'][_0x110d('0x11')]()});}})[_0x110d('0x1a')](function(_0xfb57d8){console[_0x110d('0x1b')](_0xfb57d8);});}if(_0x2e13cc['direction']==='out'&&!_0x2e13cc['secret']){var _0x120691;_0x5564d9[_0x110d('0x1c')][_0x110d('0x1d')]({'where':{'id':_0x2e13cc[_0x110d('0x1e')]},'raw':!![]})[_0x110d('0x18')](function(_0x59305b){_0x120691=_0x59305b;if(_0x120691&&_0x120691[_0x110d('0x1f')]){switch(_0x120691[_0x110d('0x1f')]){case _0x110d('0x20'):var _0x4fd8cf=require('twilio');if(_0x120691[_0x110d('0x21')]&&_0x120691[_0x110d('0x22')]&&_0x120691[_0x110d('0x23')]){var _0x49ee2b=new _0x4fd8cf(_0x120691[_0x110d('0x21')],_0x120691[_0x110d('0x22')]);_0x49ee2b[_0x110d('0x24')][_0x110d('0x25')]({'body':_0x2e13cc[_0x110d('0xc')],'to':_0x110d('0x26')+_0x2e13cc['phone'],'from':_0x110d('0x26')+_0x120691[_0x110d('0x23')],'statusCallback':_0x120691['remote']+_0x110d('0x27')+_0x2e13cc['id']+_0x110d('0x28')+_0x120691[_0x110d('0x29')]})[_0x110d('0x18')](function(_0x335df7){if(_0x335df7['sid']){return _0x5eb1f3['update']({'messageId':_0x335df7[_0x110d('0x2a')]});}})[_0x110d('0x1a')](function(_0x29df03){logger[_0x110d('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x110d('0x2b'),_0x110d('0x20'),util[_0x110d('0x2c')](_0x29df03,{'showHidden':![],'depth':null}));});}else{logger[_0x110d('0x1b')](_0x110d('0x2d'),_0x110d('0x2b'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x110d('0x2e'):var _0x307899=_0x120691[_0x110d('0x21')];var _0x332292=_0x120691[_0x110d('0x22')];var _0x4578e4=_0x120691[_0x110d('0x2f')]+_0x110d('0x30')+_0x307899+'/messages/';var _0x5a3662={'to':[_0x2e13cc[_0x110d('0x23')]],'message':{'type':_0x110d('0x31'),'text':_0x2e13cc[_0x110d('0xc')]}};var _0xd5f5db={'method':_0x110d('0x32'),'uri':_0x4578e4,'headers':{'Authorization':_0x110d('0x33')+_0x332292,'Content-Type':_0x110d('0x34')},'body':_0x5a3662,'json':!![]};rp(_0xd5f5db)['then'](function(_0x559c34){if(_0x559c34[_0x110d('0x35')][0x0][_0x110d('0x36')]){return _0x5eb1f3[_0x110d('0x37')]({'messageId':_0x559c34[_0x110d('0x35')][0x0][_0x110d('0x36')]});}})[_0x110d('0x1a')](function(_0x4149d0){logger[_0x110d('0x38')]('WhatsappMessage,\x20%s',_0x4149d0);});break;}}})[_0x110d('0x39')](function(){_0x1d0ab0();});}else{_0x1d0ab0();}}},'charset':_0x110d('0x3a'),'collate':_0x110d('0x3b')});}; \ No newline at end of file +var _0xdaff=['request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','WhatsappInteractionId','then','error','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','messages','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','update','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','finally','lodash','util','../../config/logger','api','bluebird'];(function(_0x4bd885,_0x57a6d4){var _0x6dda0a=function(_0x4a6794){while(--_0x4a6794){_0x4bd885['push'](_0x4bd885['shift']());}};_0x6dda0a(++_0x57a6d4);}(_0xdaff,0x151));var _0xfdaf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdaff[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xfdaf('0x0'));var util=require(_0xfdaf('0x1'));var logger=require(_0xfdaf('0x2'))(_0xfdaf('0x3'));var moment=require('moment');var BPromise=require(_0xfdaf('0x4'));var rp=require(_0xfdaf('0x5'));var fetch=require(_0xfdaf('0x6'));var fs=require('fs');var path=require(_0xfdaf('0x7'));var rimraf=require(_0xfdaf('0x8'));var config=require(_0xfdaf('0x9'));var attributes=require(_0xfdaf('0xa'));module[_0xfdaf('0xb')]=function(_0x3bc9ee,_0x347c21){return _0x3bc9ee['define'](_0xfdaf('0xc'),attributes,{'tableName':_0xfdaf('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfdaf('0xe')]},{'name':_0xfdaf('0xf'),'fields':['body'],'type':_0xfdaf('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dc42c,_0x1ec2a6,_0x11fc0a){var _0x4d0afe=_0x3bc9ee[_0xfdaf('0x11')];var _0x5c23f6=_0x5dc42c['get']({'plain':!![]});if(_0x5c23f6[_0xfdaf('0x12')]['toLowerCase']()==='in'||_0x5c23f6[_0xfdaf('0x12')][_0xfdaf('0x13')]()===_0xfdaf('0x14')&&!_0x5c23f6[_0xfdaf('0x15')]&&!_['isNil'](_0x5c23f6[_0xfdaf('0x16')])){_0x4d0afe[_0xfdaf('0x17')]['findOne']({'where':{'id':_0x5c23f6[_0xfdaf('0x18')]}})[_0xfdaf('0x19')](function(_0x424c8f){if(_0x424c8f){_0x424c8f['update']({'lastMsgAt':_0x5c23f6['createdAt'],'lastMsgDirection':_0x5c23f6['direction'][_0xfdaf('0x13')]()});}})['catch'](function(_0x163107){console[_0xfdaf('0x1a')](_0x163107);});}if(_0x5c23f6['direction']===_0xfdaf('0x14')&&!_0x5c23f6[_0xfdaf('0x15')]){var _0x54b8e5;_0x4d0afe[_0xfdaf('0x1b')][_0xfdaf('0x1c')]({'where':{'id':_0x5c23f6['WhatsappAccountId']},'raw':!![]})[_0xfdaf('0x19')](function(_0xc63dee){_0x54b8e5=_0xc63dee;if(_0x54b8e5&&_0x54b8e5[_0xfdaf('0x1d')]){switch(_0x54b8e5[_0xfdaf('0x1d')]){case _0xfdaf('0x1e'):var _0x61a207=require('twilio');if(_0x54b8e5[_0xfdaf('0x1f')]&&_0x54b8e5[_0xfdaf('0x20')]&&_0x54b8e5[_0xfdaf('0x21')]){var _0x179ef3=new _0x61a207(_0x54b8e5[_0xfdaf('0x1f')],_0x54b8e5[_0xfdaf('0x20')]);_0x179ef3[_0xfdaf('0x22')]['create']({'body':_0x5c23f6[_0xfdaf('0x23')],'to':_0xfdaf('0x24')+_0x5c23f6[_0xfdaf('0x21')],'from':_0xfdaf('0x24')+_0x54b8e5[_0xfdaf('0x21')],'statusCallback':_0x54b8e5[_0xfdaf('0x25')]+_0xfdaf('0x26')+_0x5c23f6['id']+_0xfdaf('0x27')+_0x54b8e5['token']})[_0xfdaf('0x19')](function(_0x544363){if(_0x544363['sid']){return _0x5dc42c[_0xfdaf('0x28')]({'messageId':_0x544363[_0xfdaf('0x29')]});}})[_0xfdaf('0x2a')](function(_0x322797){logger[_0xfdaf('0x1a')](_0xfdaf('0x2b'),_0xfdaf('0x2c'),'twilio',util[_0xfdaf('0x2d')](_0x322797,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xfdaf('0x1e'),_0xfdaf('0x2e'));}break;case _0xfdaf('0x2f'):var _0x193add=_0x54b8e5['accountSid'];var _0x172d46=_0x54b8e5['authToken'];var _0x12e26d=_0x54b8e5['baseUrl']+_0xfdaf('0x30')+_0x193add+_0xfdaf('0x31');var _0x2bcfda={'to':[_0x5c23f6[_0xfdaf('0x21')]],'message':{'type':_0xfdaf('0x32'),'text':_0x5c23f6[_0xfdaf('0x23')]}};var _0x9bf9d3={'method':'POST','uri':_0x12e26d,'headers':{'Authorization':_0xfdaf('0x33')+_0x172d46,'Content-Type':_0xfdaf('0x34')},'body':_0x2bcfda,'json':!![]};rp(_0x9bf9d3)[_0xfdaf('0x19')](function(_0x6e6970){if(_0x6e6970[_0xfdaf('0x35')][0x0][_0xfdaf('0x36')]){return _0x5dc42c[_0xfdaf('0x28')]({'messageId':_0x6e6970['statuses'][0x0][_0xfdaf('0x36')]});}})['catch'](function(_0x4bd72e){logger[_0xfdaf('0x37')]('WhatsappMessage,\x20%s',_0x4bd72e);});break;}}})[_0xfdaf('0x38')](function(){_0x11fc0a();});}else{_0x11fc0a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index b75a2a3..646371b 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 _0x7935=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x7935,0x185));var _0x5793=function(_0x1499ed,_0x31884c){_0x1499ed=_0x1499ed-0x0;var _0x821a34=_0x7935[_0x1499ed];return _0x821a34;};'use strict';var _=require(_0x5793('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5793('0x1'));var rs=require(_0x5793('0x2'));var fs=require('fs');var Redis=require(_0x5793('0x3'));var db=require(_0x5793('0x4'))['db'];var utils=require(_0x5793('0x5'));var logger=require(_0x5793('0x6'))(_0x5793('0x7'));var config=require(_0x5793('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5793('0x9')][_0x5793('0xa')]({'port':0x232a});config[_0x5793('0xb')]=_[_0x5793('0xc')](config[_0x5793('0xb')],{'host':_0x5793('0xd'),'port':0x18eb});var socket=require(_0x5793('0xe'))(new Redis(config[_0x5793('0xb')]));require(_0x5793('0xf'))[_0x5793('0x10')](socket);function respondWithRpcPromise(_0x2632a9,_0x13c100,_0x17fb77){return new BPromise(function(_0xb87043,_0x364f38){return client['request'](_0x2632a9,_0x17fb77)[_0x5793('0x11')](function(_0x3af9bb){logger['info'](_0x5793('0x12'),_0x13c100,'request\x20sent');logger[_0x5793('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x13c100,_0x5793('0x14'),JSON[_0x5793('0x15')](_0x3af9bb));if(_0x3af9bb[_0x5793('0x16')]){if(_0x3af9bb['error'][_0x5793('0x17')]===0x1f4){logger[_0x5793('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x13c100,_0x3af9bb[_0x5793('0x16')][_0x5793('0x18')]);return _0x364f38(_0x3af9bb[_0x5793('0x16')][_0x5793('0x18')]);}logger[_0x5793('0x16')](_0x5793('0x12'),_0x13c100,_0x3af9bb[_0x5793('0x16')]['message']);return _0xb87043(_0x3af9bb[_0x5793('0x16')][_0x5793('0x18')]);}else{logger[_0x5793('0x19')](_0x5793('0x12'),_0x13c100,_0x5793('0x14'));_0xb87043(_0x3af9bb[_0x5793('0x1a')][_0x5793('0x18')]);}})[_0x5793('0x1b')](function(_0x288fc0){logger[_0x5793('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x13c100,_0x288fc0);_0x364f38(_0x288fc0);});});}exports[_0x5793('0x1c')]=function(_0x44cc7c){var _0x340321=this;return new Promise(function(_0x83bd4c,_0x562df3){return db[_0x5793('0x1d')][_0x5793('0x1e')](_0x44cc7c['body'],{'raw':_0x44cc7c[_0x5793('0x1f')]?_0x44cc7c['options'][_0x5793('0x20')]===undefined?!![]:![]:!![]})[_0x5793('0x11')](function(_0x5c8dac){logger['info']('CreateWhatsappMessage',_0x44cc7c);logger[_0x5793('0x13')](_0x5793('0x1c'),_0x44cc7c,JSON[_0x5793('0x15')](_0x5c8dac));_0x83bd4c(_0x5c8dac);})['catch'](function(_0x122b0c){logger[_0x5793('0x16')](_0x5793('0x1c'),_0x122b0c['message'],_0x44cc7c);_0x562df3(_0x340321[_0x5793('0x16')](0x1f4,_0x122b0c['message']));});});}; \ No newline at end of file +var _0xb803=['result','WhatsappMessage','options','raw','then','CreateWhatsappMessage','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappMessage.socket','request','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x7afacc,_0x59a0b4){var _0x2c5b61=function(_0x4f8b27){while(--_0x4f8b27){_0x7afacc['push'](_0x7afacc['shift']());}};_0x2c5b61(++_0x59a0b4);}(_0xb803,0xdf));var _0x3b80=function(_0xd1931c,_0xb984eb){_0xd1931c=_0xd1931c-0x0;var _0x59b915=_0xb803[_0xd1931c];return _0x59b915;};'use strict';var _=require(_0x3b80('0x0'));var util=require('util');var moment=require(_0x3b80('0x1'));var BPromise=require(_0x3b80('0x2'));var rs=require(_0x3b80('0x3'));var fs=require('fs');var Redis=require(_0x3b80('0x4'));var db=require(_0x3b80('0x5'))['db'];var utils=require(_0x3b80('0x6'));var logger=require('../../config/logger')(_0x3b80('0x7'));var config=require(_0x3b80('0x8'));var jayson=require(_0x3b80('0x9'));var client=jayson[_0x3b80('0xa')][_0x3b80('0xb')]({'port':0x232a});config['redis']=_[_0x3b80('0xc')](config[_0x3b80('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x3b80('0xe'))(new Redis(config[_0x3b80('0xd')]));require(_0x3b80('0xf'))['register'](socket);function respondWithRpcPromise(_0x44b704,_0x3d7105,_0x15944a){return new BPromise(function(_0x1b668b,_0x369b38){return client[_0x3b80('0x10')](_0x44b704,_0x15944a)['then'](function(_0xf72ece){logger[_0x3b80('0x11')](_0x3b80('0x12'),_0x3d7105,'request\x20sent');logger[_0x3b80('0x13')](_0x3b80('0x14'),_0x3d7105,_0x3b80('0x15'),JSON[_0x3b80('0x16')](_0xf72ece));if(_0xf72ece[_0x3b80('0x17')]){if(_0xf72ece[_0x3b80('0x17')]['code']===0x1f4){logger[_0x3b80('0x17')](_0x3b80('0x12'),_0x3d7105,_0xf72ece['error']['message']);return _0x369b38(_0xf72ece[_0x3b80('0x17')][_0x3b80('0x18')]);}logger[_0x3b80('0x17')](_0x3b80('0x12'),_0x3d7105,_0xf72ece[_0x3b80('0x17')][_0x3b80('0x18')]);return _0x1b668b(_0xf72ece[_0x3b80('0x17')][_0x3b80('0x18')]);}else{logger[_0x3b80('0x11')](_0x3b80('0x12'),_0x3d7105,_0x3b80('0x15'));_0x1b668b(_0xf72ece[_0x3b80('0x19')][_0x3b80('0x18')]);}})['catch'](function(_0x5ad054){logger[_0x3b80('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x3d7105,_0x5ad054);_0x369b38(_0x5ad054);});});}exports['CreateWhatsappMessage']=function(_0x2199a3){var _0x5da86b=this;return new Promise(function(_0x198318,_0x3fbb5f){return db[_0x3b80('0x1a')]['create'](_0x2199a3['body'],{'raw':_0x2199a3[_0x3b80('0x1b')]?_0x2199a3[_0x3b80('0x1b')][_0x3b80('0x1c')]===undefined?!![]:![]:!![]})[_0x3b80('0x1d')](function(_0x46a681){logger[_0x3b80('0x11')](_0x3b80('0x1e'),_0x2199a3);logger['debug'](_0x3b80('0x1e'),_0x2199a3,JSON['stringify'](_0x46a681));_0x198318(_0x46a681);})['catch'](function(_0x49cf5c){logger[_0x3b80('0x17')](_0x3b80('0x1e'),_0x49cf5c[_0x3b80('0x18')],_0x2199a3);_0x3fbb5f(_0x5da86b['error'](0x1f4,_0x49cf5c[_0x3b80('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 58c4c16..bca87e2 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 _0x45e2=['remove','update','emit','register','length','./whatsappMessage.events','save'];(function(_0x2b5c60,_0xddad37){var _0x40ef50=function(_0x103b03){while(--_0x103b03){_0x2b5c60['push'](_0x2b5c60['shift']());}};_0x40ef50(++_0xddad37);}(_0x45e2,0x1a9));var _0x245e=function(_0x490614,_0x33dd55){_0x490614=_0x490614-0x0;var _0x3ba320=_0x45e2[_0x490614];return _0x3ba320;};'use strict';var WhatsappMessageEvents=require(_0x245e('0x0'));var events=[_0x245e('0x1'),_0x245e('0x2'),_0x245e('0x3')];function createListener(_0x2e0051,_0x208cd6){return function(_0x28fa8c){_0x208cd6[_0x245e('0x4')](_0x2e0051,_0x28fa8c);};}function removeListener(_0xf73dd5,_0x5841e5){return function(){WhatsappMessageEvents['removeListener'](_0xf73dd5,_0x5841e5);};}exports[_0x245e('0x5')]=function(_0x397483){for(var _0x1d84d7=0x0,_0x428dab=events[_0x245e('0x6')];_0x1d84d7<_0x428dab;_0x1d84d7++){var _0x10d708=events[_0x1d84d7];var _0x3bdc7d=createListener('whatsappMessage:'+_0x10d708,_0x397483);WhatsappMessageEvents['on'](_0x10d708,_0x3bdc7d);}}; \ No newline at end of file +var _0x0050=['whatsappMessage:','remove','update','emit','removeListener','register','length'];(function(_0x24b877,_0x40ddcd){var _0x16929d=function(_0x6c727f){while(--_0x6c727f){_0x24b877['push'](_0x24b877['shift']());}};_0x16929d(++_0x40ddcd);}(_0x0050,0x86));var _0x0005=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0050[_0x42cae2];return _0x5f256f;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x0005('0x0'),_0x0005('0x1')];function createListener(_0x326633,_0x5e1823){return function(_0x21d13f){_0x5e1823[_0x0005('0x2')](_0x326633,_0x21d13f);};}function removeListener(_0x49fb48,_0x66f7e){return function(){WhatsappMessageEvents[_0x0005('0x3')](_0x49fb48,_0x66f7e);};}exports[_0x0005('0x4')]=function(_0x3f284e){for(var _0x244970=0x0,_0x842cce=events[_0x0005('0x5')];_0x244970<_0x842cce;_0x244970++){var _0x366c8f=events[_0x244970];var _0x1a782b=createListener(_0x0005('0x6')+_0x366c8f,_0x3f284e);WhatsappMessageEvents['on'](_0x366c8f,_0x1a782b);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a0bf4e3..231b825 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 _0x3d1a=['/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','/:id/teams'];(function(_0x20f181,_0x210422){var _0x1ca20a=function(_0x50c94b){while(--_0x50c94b){_0x20f181['push'](_0x20f181['shift']());}};_0x1ca20a(++_0x210422);}(_0x3d1a,0x1ec));var _0xa3d1=function(_0x37ba88,_0x3ce576){_0x37ba88=_0x37ba88-0x0;var _0x356382=_0x3d1a[_0x37ba88];return _0x356382;};'use strict';var multer=require(_0xa3d1('0x0'));var util=require('util');var path=require(_0xa3d1('0x1'));var timeout=require(_0xa3d1('0x2'));var express=require('express');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(_0xa3d1('0x3'));var controller=require('./whatsappQueue.controller');router[_0xa3d1('0x4')]('/',auth[_0xa3d1('0x5')](),controller[_0xa3d1('0x6')]);router[_0xa3d1('0x4')](_0xa3d1('0x7'),auth[_0xa3d1('0x5')](),controller[_0xa3d1('0x8')]);router['get'](_0xa3d1('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xa3d1('0x4')](_0xa3d1('0xa'),auth[_0xa3d1('0x5')](),controller['getMembers']);router[_0xa3d1('0x4')](_0xa3d1('0xb'),auth[_0xa3d1('0x5')](),controller['getTeams']);router[_0xa3d1('0x4')](_0xa3d1('0xc'),auth['isAuthenticated'](),controller[_0xa3d1('0xd')]);router[_0xa3d1('0xe')]('/',auth[_0xa3d1('0x5')](),controller['create']);router[_0xa3d1('0xe')](_0xa3d1('0xb'),auth[_0xa3d1('0x5')](),controller[_0xa3d1('0xf')]);router[_0xa3d1('0xe')](_0xa3d1('0xc'),auth[_0xa3d1('0x5')](),controller[_0xa3d1('0x10')]);router[_0xa3d1('0x11')](_0xa3d1('0x9'),auth[_0xa3d1('0x5')](),controller[_0xa3d1('0x12')]);router[_0xa3d1('0x13')](_0xa3d1('0x9'),auth[_0xa3d1('0x5')](),controller[_0xa3d1('0x14')]);router[_0xa3d1('0x13')](_0xa3d1('0xb'),auth[_0xa3d1('0x5')](),controller[_0xa3d1('0x15')]);router[_0xa3d1('0x13')](_0xa3d1('0xc'),auth[_0xa3d1('0x5')](),controller[_0xa3d1('0x16')]);module[_0xa3d1('0x17')]=router; \ No newline at end of file +var _0x43c9=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x1476ba,_0x446421){var _0x5e7bc1=function(_0x4aa99c){while(--_0x4aa99c){_0x1476ba['push'](_0x1476ba['shift']());}};_0x5e7bc1(++_0x446421);}(_0x43c9,0xfd));var _0x943c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x43c9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x943c('0x0'));var util=require('util');var path=require(_0x943c('0x1'));var timeout=require(_0x943c('0x2'));var express=require(_0x943c('0x3'));var router=express[_0x943c('0x4')]();var fs_extra=require(_0x943c('0x5'));var auth=require(_0x943c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x943c('0x7'));var controller=require(_0x943c('0x8'));router[_0x943c('0x9')]('/',auth[_0x943c('0xa')](),controller[_0x943c('0xb')]);router[_0x943c('0x9')](_0x943c('0xc'),auth['isAuthenticated'](),controller[_0x943c('0xd')]);router['get'](_0x943c('0xe'),auth[_0x943c('0xa')](),controller[_0x943c('0xf')]);router[_0x943c('0x9')](_0x943c('0x10'),auth[_0x943c('0xa')](),controller[_0x943c('0x11')]);router[_0x943c('0x9')](_0x943c('0x12'),auth[_0x943c('0xa')](),controller[_0x943c('0x13')]);router['get'](_0x943c('0x14'),auth['isAuthenticated'](),controller[_0x943c('0x15')]);router[_0x943c('0x16')]('/',auth[_0x943c('0xa')](),controller[_0x943c('0x17')]);router['post'](_0x943c('0x12'),auth['isAuthenticated'](),controller['addTeams']);router[_0x943c('0x16')]('/:id/users',auth[_0x943c('0xa')](),controller['addAgents']);router[_0x943c('0x18')](_0x943c('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x943c('0x19')]('/:id',auth[_0x943c('0xa')](),controller[_0x943c('0x1a')]);router[_0x943c('0x19')](_0x943c('0x12'),auth[_0x943c('0xa')](),controller[_0x943c('0x1b')]);router[_0x943c('0x19')](_0x943c('0x14'),auth[_0x943c('0xa')](),controller[_0x943c('0x1c')]);module[_0x943c('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 4243278..ed77c4f 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 _0x6584=['rrmemory','beepall','sequelize','exports','STRING','name','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6584,0x175));var _0x4658=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x6584[_0x58965a];return _0x254efc;};'use strict';var Sequelize=require(_0x4658('0x0'));module[_0x4658('0x1')]={'name':{'type':Sequelize[_0x4658('0x2')],'unique':_0x4658('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4658('0x4')](_0x4658('0x5'),_0x4658('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x81a5=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x81a5,0x1c8));var _0x581a=function(_0x31635c,_0x6f9e7c){_0x31635c=_0x31635c-0x0;var _0x32e158=_0x81a5[_0x31635c];return _0x32e158;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'name':{'type':Sequelize[_0x581a('0x2')],'unique':_0x581a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x581a('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x581a('0x5')]('rrmemory',_0x581a('0x6'),'roundrobin')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index bc673d6..f2d5e21 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 _0xc57f=['pick','where','filter','User','UserId','whatsappPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','nolimit','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','select','tq.TeamId','from','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','every','TeamId','includes','union','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','order','util','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','get','WhatsappQueues','destroy','error','stack','send','map','WhatsappQueue','fieldName','type','key','getOptions','include','query','findAll','rows','catch','show','params','keys','filters','intersection','attributes','model','fields','length','merge','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','rawAttributes','hasOwnProperty','sort'];(function(_0x38aeed,_0x34d1ca){var _0x3b0fa3=function(_0x37f684){while(--_0x37f684){_0x38aeed['push'](_0x38aeed['shift']());}};_0x3b0fa3(++_0x34d1ca);}(_0xc57f,0x1a1));var _0xfc57=function(_0x23cc28,_0x357303){_0x23cc28=_0x23cc28-0x0;var _0x31402c=_0xc57f[_0x23cc28];return _0x31402c;};'use strict';var BPromise=require('bluebird');var util=require(_0xfc57('0x0'));var _=require('lodash');var squel=require(_0xfc57('0x1'));var Redis=require(_0xfc57('0x2'));var qs=require(_0xfc57('0x3'));var logger=require('../../config/logger')('api');var config=require(_0xfc57('0x4'));var db=require(_0xfc57('0x5'))['db'];config['redis']=_[_0xfc57('0x6')](config[_0xfc57('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc57('0x8'))(new Redis(config[_0xfc57('0x7')]));require(_0xfc57('0x9'))[_0xfc57('0xa')](socket);function respondWithStatusCode(_0x772d21,_0x8ae7d2){_0x8ae7d2=_0x8ae7d2||0xcc;return function(_0x2092c3){if(_0x2092c3){return _0x772d21[_0xfc57('0xb')](_0x8ae7d2);}return _0x772d21[_0xfc57('0xc')](_0x8ae7d2)[_0xfc57('0xd')]();};}function respondWithResult(_0x47b3c8,_0x516fc6){_0x516fc6=_0x516fc6||0xc8;return function(_0x4ad0c1){if(_0x4ad0c1){return _0x47b3c8[_0xfc57('0xc')](_0x516fc6)[_0xfc57('0xe')](_0x4ad0c1);}};}function respondWithFilteredResult(_0x1e0c8b,_0x4b4104){return function(_0x3284f6){if(_0x3284f6){var _0x51edbd=typeof _0x4b4104[_0xfc57('0xf')]===_0xfc57('0x10')&&typeof _0x4b4104[_0xfc57('0x11')]===_0xfc57('0x10');var _0x18b197=_0x3284f6['count'];var _0x153d2e=_0x51edbd?0x0:_0x4b4104['offset'];var _0x32151c=_0x51edbd?_0x3284f6[_0xfc57('0x12')]:_0x4b4104[_0xfc57('0xf')]+_0x4b4104[_0xfc57('0x11')];var _0x109b16;if(_0x32151c>=_0x18b197){_0x32151c=_0x18b197;_0x109b16=0xc8;}else{_0x109b16=0xce;}_0x1e0c8b[_0xfc57('0xc')](_0x109b16);return _0x1e0c8b[_0xfc57('0x13')](_0xfc57('0x14'),_0x153d2e+'-'+_0x32151c+'/'+_0x18b197)['json'](_0x3284f6);}return null;};}function saveUpdates(_0x24e5a0){return function(_0x240273){if(_0x240273){return _0x240273[_0xfc57('0x15')](_0x24e5a0)[_0xfc57('0x16')](function(_0x54a291){return _0x54a291;});}return null;};}function removeEntity(_0x2b16f2){return function(_0x2afeb9){if(_0x2afeb9){return _0x2afeb9['destroy']()[_0xfc57('0x16')](function(){var _0x5e9cbf=_0x2afeb9[_0xfc57('0x17')]({'plain':!![]});var _0x2e5c55=_0xfc57('0x18');return db['UserProfileResource'][_0xfc57('0x19')]({'where':{'type':_0x2e5c55,'resourceId':_0x5e9cbf['id']}})[_0xfc57('0x16')](function(){return _0x2afeb9;});})[_0xfc57('0x16')](function(){_0x2b16f2[_0xfc57('0xc')](0xcc)[_0xfc57('0xd')]();});}};}function handleEntityNotFound(_0x14b860){return function(_0x5399c9){if(!_0x5399c9){_0x14b860[_0xfc57('0xb')](0x194);}return _0x5399c9;};}function handleError(_0x87c423,_0x3d529c){_0x3d529c=_0x3d529c||0x1f4;return function(_0x7b3c82){logger[_0xfc57('0x1a')](_0x7b3c82[_0xfc57('0x1b')]);if(_0x7b3c82['name']){delete _0x7b3c82['name'];}_0x87c423[_0xfc57('0xc')](_0x3d529c)[_0xfc57('0x1c')](_0x7b3c82);};}exports['index']=function(_0x348d6e,_0x4c9944){var _0x46942f={};var _0x2deb93={'count':0x0,'rows':[]};var _0x108601=_[_0xfc57('0x1d')](db[_0xfc57('0x1e')]['rawAttributes'],function(_0x5c980f){return{'name':_0x5c980f[_0xfc57('0x1f')],'type':_0x5c980f[_0xfc57('0x20')][_0xfc57('0x21')]};});_0x46942f=qs[_0xfc57('0x22')](_0x108601,_0x348d6e);var _0x2404b9={'where':_0x46942f['where']};return db['WhatsappQueue'][_0xfc57('0x12')](_0x2404b9)[_0xfc57('0x16')](function(_0x44b6cf){_0x2deb93[_0xfc57('0x12')]=_0x44b6cf;_0x46942f[_0xfc57('0x23')]=qs[_0xfc57('0x23')](_0x348d6e[_0xfc57('0x24')]);return db[_0xfc57('0x1e')][_0xfc57('0x25')](_0x46942f);})[_0xfc57('0x16')](function(_0x16de9d){_0x2deb93[_0xfc57('0x26')]=_0x16de9d;return _0x2deb93;})[_0xfc57('0x16')](respondWithFilteredResult(_0x4c9944,_0x46942f))[_0xfc57('0x27')](handleError(_0x4c9944,null));};exports[_0xfc57('0x28')]=function(_0x40bc9d,_0x330fc9){var _0x5ded03={'raw':!![],'where':{'id':_0x40bc9d[_0xfc57('0x29')]['id']}},_0x26c7b1={};_0x26c7b1['model']=_['keys'](db[_0xfc57('0x1e')]['rawAttributes']);_0x26c7b1[_0xfc57('0x24')]=_[_0xfc57('0x2a')](_0x40bc9d[_0xfc57('0x24')]);_0x26c7b1[_0xfc57('0x2b')]=_[_0xfc57('0x2c')](_0x26c7b1['model'],_0x26c7b1['query']);_0x5ded03[_0xfc57('0x2d')]=_[_0xfc57('0x2c')](_0x26c7b1[_0xfc57('0x2e')],qs[_0xfc57('0x2f')](_0x40bc9d[_0xfc57('0x24')]['fields']));_0x5ded03[_0xfc57('0x2d')]=_0x5ded03[_0xfc57('0x2d')][_0xfc57('0x30')]?_0x5ded03[_0xfc57('0x2d')]:_0x26c7b1['model'];if(_0x40bc9d[_0xfc57('0x24')]['includeAll']){_0x5ded03[_0xfc57('0x23')]=[{'all':!![]}];}_0x5ded03=_[_0xfc57('0x31')]({},_0x5ded03,_0x40bc9d[_0xfc57('0x32')]);return db['WhatsappQueue']['find'](_0x5ded03)[_0xfc57('0x16')](handleEntityNotFound(_0x330fc9,null))[_0xfc57('0x16')](respondWithResult(_0x330fc9,null))['catch'](handleError(_0x330fc9,null));};exports[_0xfc57('0x33')]=function(_0x44985c,_0x4464d9){return db[_0xfc57('0x1e')]['create'](_0x44985c['body'],{})[_0xfc57('0x16')](function(_0x6c3943){var _0x34c78f=_0x44985c[_0xfc57('0x34')][_0xfc57('0x17')]({'plain':!![]});if(!_0x34c78f)throw new Error(_0xfc57('0x35'));if(_0x34c78f['role']===_0xfc57('0x34')){var _0x8a8934=_0x6c3943[_0xfc57('0x17')]({'plain':!![]});var _0x2d37ae=_0xfc57('0x18');return db['UserProfileSection'][_0xfc57('0x36')]({'where':{'name':_0x2d37ae,'userProfileId':_0x34c78f[_0xfc57('0x37')]},'raw':!![]})[_0xfc57('0x16')](function(_0x152ea8){if(_0x152ea8&&_0x152ea8[_0xfc57('0x38')]===0x0){return db['UserProfileResource'][_0xfc57('0x33')]({'name':_0x8a8934[_0xfc57('0x39')],'resourceId':_0x8a8934['id'],'type':_0x152ea8[_0xfc57('0x39')],'sectionId':_0x152ea8['id']},{})[_0xfc57('0x16')](function(){return _0x6c3943;});}else{return _0x6c3943;}})[_0xfc57('0x27')](function(_0x29139d){logger['error'](_0xfc57('0x3a'),_0x29139d);throw _0x29139d;});}return _0x6c3943;})['then'](respondWithResult(_0x4464d9,0xc9))['catch'](handleError(_0x4464d9,null));};exports['update']=function(_0x12cab5,_0xc5d842){if(_0x12cab5[_0xfc57('0x3b')]['id']){delete _0x12cab5[_0xfc57('0x3b')]['id'];}return db['WhatsappQueue'][_0xfc57('0x36')]({'where':{'id':_0x12cab5[_0xfc57('0x29')]['id']}})[_0xfc57('0x16')](handleEntityNotFound(_0xc5d842,null))[_0xfc57('0x16')](saveUpdates(_0x12cab5[_0xfc57('0x3b')],null))[_0xfc57('0x16')](respondWithResult(_0xc5d842,null))[_0xfc57('0x27')](handleError(_0xc5d842,null));};exports[_0xfc57('0x19')]=function(_0x15724d,_0x582105){return db[_0xfc57('0x1e')][_0xfc57('0x36')]({'where':{'id':_0x15724d[_0xfc57('0x29')]['id']}})[_0xfc57('0x16')](handleEntityNotFound(_0x582105,null))[_0xfc57('0x16')](removeEntity(_0x582105,null))['catch'](handleError(_0x582105,null));};exports['describe']=function(_0x3929de,_0xe0297f){return db[_0xfc57('0x1e')][_0xfc57('0x3c')]()[_0xfc57('0x16')](respondWithResult(_0xe0297f,null))[_0xfc57('0x27')](handleError(_0xe0297f,null));};exports[_0xfc57('0x3d')]=function(_0x45b5cc,_0x609447){var _0x2a0936={'raw':!![],'where':{}},_0x4db188={},_0x23f93e;return db[_0xfc57('0x1e')][_0xfc57('0x3e')]({'where':{'id':_0x45b5cc['params']['id']}})[_0xfc57('0x16')](handleEntityNotFound(_0x609447,null))[_0xfc57('0x16')](function(_0x185948){if(_0x185948){_0x23f93e=_0x185948[_0xfc57('0x17')]({'plain':!![]});_0x4db188[_0xfc57('0x2e')]=_['keys'](db[_0xfc57('0x3f')][_0xfc57('0x40')]);_0x4db188[_0xfc57('0x24')]=_[_0xfc57('0x2a')](_0x45b5cc[_0xfc57('0x24')]);_0x4db188[_0xfc57('0x2b')]=_[_0xfc57('0x2c')](_0x4db188[_0xfc57('0x2e')],_0x4db188['query']);_0x2a0936[_0xfc57('0x2d')]=_[_0xfc57('0x2c')](_0x4db188[_0xfc57('0x2e')],qs[_0xfc57('0x2f')](_0x45b5cc['query'][_0xfc57('0x2f')]));_0x2a0936[_0xfc57('0x2d')]=_0x2a0936[_0xfc57('0x2d')][_0xfc57('0x30')]?_0x2a0936['attributes']:_0x4db188['model'];if(!_0x45b5cc[_0xfc57('0x24')][_0xfc57('0x41')]('nolimit')){_0x2a0936[_0xfc57('0x11')]=qs[_0xfc57('0x11')](_0x45b5cc[_0xfc57('0x24')][_0xfc57('0x11')]);_0x2a0936[_0xfc57('0xf')]=qs[_0xfc57('0xf')](_0x45b5cc[_0xfc57('0x24')]['offset']);}_0x2a0936['order']=qs[_0xfc57('0x42')](_0x45b5cc['query'][_0xfc57('0x42')]);_0x2a0936['where']=qs[_0xfc57('0x2b')](_[_0xfc57('0x43')](_0x45b5cc[_0xfc57('0x24')],_0x4db188[_0xfc57('0x2b')]));_0x2a0936[_0xfc57('0x44')]['WhatsappQueueId']=_0x185948['id'];if(_0x45b5cc[_0xfc57('0x24')][_0xfc57('0x45')]){_0x2a0936[_0xfc57('0x44')]=_[_0xfc57('0x31')](_0x2a0936['where'],{'$or':_[_0xfc57('0x1d')](_0x2a0936[_0xfc57('0x2d')],function(_0x1b149f){var _0x8f202d={};_0x8f202d[_0x1b149f]={'$like':'%'+_0x45b5cc[_0xfc57('0x24')][_0xfc57('0x45')]+'%'};return _0x8f202d;})});}_0x2a0936=_[_0xfc57('0x31')]({},_0x2a0936,_0x45b5cc[_0xfc57('0x32')]);return db['UserWhatsappQueue'][_0xfc57('0x25')](_0x2a0936);}})[_0xfc57('0x16')](function(_0x3f7ea5){if(_0x3f7ea5){return db[_0xfc57('0x46')]['findAndCountAll']({'where':{'id':_[_0xfc57('0x1d')](_0x3f7ea5,_0xfc57('0x47')),'role':'agent'},'attributes':['id',_0xfc57('0x39'),_0xfc57('0x48'),_0xfc57('0x49'),_0xfc57('0x4a')]});}})[_0xfc57('0x16')](function(_0x14cc40){if(_0x14cc40){return{'count':_0x14cc40[_0xfc57('0x12')],'rows':_[_0xfc57('0x1d')](_0x14cc40[_0xfc57('0x26')],function(_0x4fcbbf){return{'membername':_0x4fcbbf[_0xfc57('0x39')],'UserId':_0x4fcbbf['id'],'queue_name':_0x23f93e['name'],'WhatsappQueueId':_0x23f93e['id'],'interface':util['format'](_0xfc57('0x4b'),_0xfc57('0x4c'),_0x4fcbbf[_0xfc57('0x39')]),'penalty':0x0,'paused':_0x4fcbbf[_0xfc57('0x48')],'createdAt':_0x4fcbbf[_0xfc57('0x4a')],'updatedAt':_0x4fcbbf['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x609447,_0x2a0936))[_0xfc57('0x27')](handleError(_0x609447,null));};exports['getTeams']=function(_0xcc5e26,_0x44f66a){var _0x551418={};var _0x3ace79={};var _0x10b338;var _0x47235d;return db[_0xfc57('0x1e')]['findOne']({'where':{'id':_0xcc5e26[_0xfc57('0x29')]['id']}})['then'](handleEntityNotFound(_0x44f66a,null))[_0xfc57('0x16')](function(_0x347345){if(_0x347345){_0x10b338=_0x347345;_0x3ace79[_0xfc57('0x2e')]=_[_0xfc57('0x2a')](db[_0xfc57('0x4d')][_0xfc57('0x40')]);_0x3ace79['query']=_[_0xfc57('0x2a')](_0xcc5e26['query']);_0x3ace79[_0xfc57('0x2b')]=_['intersection'](_0x3ace79[_0xfc57('0x2e')],_0x3ace79[_0xfc57('0x24')]);_0x551418[_0xfc57('0x2d')]=_[_0xfc57('0x2c')](_0x3ace79[_0xfc57('0x2e')],qs['fields'](_0xcc5e26['query']['fields']));_0x551418[_0xfc57('0x2d')]=_0x551418['attributes'][_0xfc57('0x30')]?_0x551418[_0xfc57('0x2d')]:_0x3ace79[_0xfc57('0x2e')];_0x551418['order']=qs['sort'](_0xcc5e26[_0xfc57('0x24')][_0xfc57('0x42')]);_0x551418['where']=qs[_0xfc57('0x2b')](_[_0xfc57('0x43')](_0xcc5e26[_0xfc57('0x24')],_0x3ace79['filters']));if(_0xcc5e26[_0xfc57('0x24')][_0xfc57('0x45')]){_0x551418[_0xfc57('0x44')]=_[_0xfc57('0x31')](_0x551418[_0xfc57('0x44')],{'$or':_[_0xfc57('0x1d')](_0x551418['attributes'],function(_0x3e9f85){var _0x211415={};_0x211415[_0x3e9f85]={'$like':'%'+_0xcc5e26[_0xfc57('0x24')][_0xfc57('0x45')]+'%'};return _0x211415;})});}_0x551418=_[_0xfc57('0x31')]({},_0x551418,_0xcc5e26[_0xfc57('0x32')]);return _0x10b338[_0xfc57('0x4e')](_0x551418);}})[_0xfc57('0x16')](function(_0xa8d32d){if(_0xa8d32d){_0x47235d=_0xa8d32d['length'];if(!_0xcc5e26[_0xfc57('0x24')][_0xfc57('0x41')](_0xfc57('0x4f'))){_0x551418[_0xfc57('0x11')]=qs[_0xfc57('0x11')](_0xcc5e26['query']['limit']);_0x551418[_0xfc57('0xf')]=qs[_0xfc57('0xf')](_0xcc5e26[_0xfc57('0x24')][_0xfc57('0xf')]);}return _0x10b338[_0xfc57('0x4e')](_0x551418);}})[_0xfc57('0x16')](function(_0x56f0d8){if(_0x56f0d8){return _0x56f0d8?{'count':_0x47235d,'rows':_0x56f0d8}:null;}})['then'](respondWithResult(_0x44f66a,null))[_0xfc57('0x27')](handleError(_0x44f66a,null));};exports['addTeams']=function(_0x54eba2,_0x4035f4){var _0x4cc2e9=_0x54eba2[_0xfc57('0x3b')]['ids'];return db['Team'][_0xfc57('0x25')]({'where':{'id':_0x4cc2e9},'attributes':['id'],'include':[{'model':db[_0xfc57('0x46')],'as':_0xfc57('0x50'),'attributes':['id',_0xfc57('0x39'),_0xfc57('0x51'),'voicePause',_0xfc57('0x52')],'raw':!![]}]})[_0xfc57('0x16')](function(_0x582878){if(_0x582878){var _0x59d891=_[_0xfc57('0x53')](_0x582878,function(_0x9cfaff){var _0x53812f=_0x9cfaff[_0xfc57('0x17')]({'plain':!![]});return _0x53812f['Agents'];});return db[_0xfc57('0x1e')][_0xfc57('0x36')]({'where':{'id':_0x54eba2['params']['id']}})[_0xfc57('0x16')](function(_0x3d03d9){return db[_0xfc57('0x54')][_0xfc57('0x55')](function(_0x3379c9){return _0x3d03d9[_0xfc57('0x56')](_0x4cc2e9,{'transaction':_0x3379c9})[_0xfc57('0x16')](function(){return BPromise[_0xfc57('0x57')](_0x59d891,function(_0x3fe04c){return db[_0xfc57('0x3f')][_0xfc57('0x58')]({'where':{'UserId':_0x3fe04c['id'],'WhatsappQueueId':_0x54eba2[_0xfc57('0x29')]['id']},'transaction':_0x3379c9});});})[_0xfc57('0x16')](function(){_0x59d891[_0xfc57('0x59')](function(_0x399c1c){socket[_0xfc57('0x5a')](_0xfc57('0x5b'),{'UserId':_0x399c1c['id'],'WhatsappQueueId':_0x3d03d9['id']});});});});});}})['then'](respondWithStatusCode(_0x4035f4,null))['catch'](handleError(_0x4035f4,null));};exports['removeTeams']=function(_0x53825a,_0x5a67b0){return db[_0xfc57('0x4d')]['findAll']({'where':{'id':_0x53825a[_0xfc57('0x24')][_0xfc57('0x5c')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfc57('0x50'),'attributes':['id'],'raw':!![]}]})[_0xfc57('0x16')](handleEntityNotFound(_0x5a67b0,null))[_0xfc57('0x16')](function(_0x3b38e3){var _0x307324=_[_0xfc57('0x1d')](_0x3b38e3,'id');var _0xc9351f=[];var _0x20f0bf=[];var _0x1fd4c0=squel[_0xfc57('0x5d')]();_0x1fd4c0['field'](_0xfc57('0x5e'))[_0xfc57('0x5f')](_0xfc57('0x60'),'tq')[_0xfc57('0x61')](_0xfc57('0x62'),'ut',_0xfc57('0x63'))[_0xfc57('0x44')](_0xfc57('0x64'),_0x53825a['params']['id']);for(var _0x5a1643=0x0;_0x5a1643<_0x3b38e3[_0xfc57('0x30')];_0x5a1643+=0x1){let _0x25c56f=_0x3b38e3[_0x5a1643];for(var _0x1b07cf=0x0;_0x1b07cf<_0x25c56f[_0xfc57('0x50')][_0xfc57('0x30')];_0x1b07cf+=0x1){let _0x9fc78f=_0x25c56f[_0xfc57('0x50')][_0x1b07cf];var _0x3fbcb8=_0x1fd4c0[_0xfc57('0x65')]();_0x3fbcb8['where'](_0xfc57('0x66'),_0x9fc78f['id']);_0x20f0bf[_0xfc57('0x67')](db[_0xfc57('0x54')][_0xfc57('0x24')](_0x3fbcb8[_0xfc57('0x68')](),{'type':db[_0xfc57('0x54')][_0xfc57('0x69')][_0xfc57('0x6a')]})[_0xfc57('0x16')](function(_0x58bada){if(_0x58bada[_0xfc57('0x30')]===0x1){return _0x9fc78f['id'];}else{var _0x1b071a=_[_0xfc57('0x6b')](_['map'](_0x58bada,_0xfc57('0x6c')),function(_0xbe904e){return _[_0xfc57('0x6d')](_0x307324,_0xbe904e);});if(_0x1b071a){return _0x9fc78f['id'];}}}));}}return BPromise['all'](_0x20f0bf)[_0xfc57('0x16')](function(_0x1c72d2){_0xc9351f=_(_0xc9351f)[_0xfc57('0x6e')](_0x1c72d2)['compact']()[_0xfc57('0x6f')]();return db[_0xfc57('0x1e')][_0xfc57('0x36')]({'where':{'id':_0x53825a['params']['id']}})[_0xfc57('0x16')](function(_0x3da590){return db[_0xfc57('0x54')][_0xfc57('0x55')](function(_0x139b33){return _0x3da590[_0xfc57('0x70')](_0x53825a[_0xfc57('0x24')][_0xfc57('0x5c')],{'transaction':_0x139b33})[_0xfc57('0x16')](function(){if(!_[_0xfc57('0x71')](_0xc9351f)){return _0x3da590[_0xfc57('0x72')](_0xc9351f,{'transaction':_0x139b33});}})[_0xfc57('0x16')](function(){_0xc9351f['forEach'](function(_0x302c24){socket[_0xfc57('0x5a')](_0xfc57('0x73'),{'UserId':_0x302c24,'WhatsappQueueId':_0x3da590['id']});});});});});});})[_0xfc57('0x16')](respondWithStatusCode(_0x5a67b0,null))['catch'](handleError(_0x5a67b0,null));};exports[_0xfc57('0x74')]=function(_0x366a3e,_0xbd191d){return db[_0xfc57('0x1e')][_0xfc57('0x36')]({'where':{'id':_0x366a3e[_0xfc57('0x29')]['id']}})[_0xfc57('0x16')](handleEntityNotFound(_0xbd191d,null))[_0xfc57('0x16')](function(_0x341abe){if(_0x341abe){return _0x341abe[_0xfc57('0x74')](_0x366a3e[_0xfc57('0x3b')][_0xfc57('0x5c')],_['omit'](_0x366a3e[_0xfc57('0x3b')],['ids','id'])||{})[_0xfc57('0x75')](function(_0x3ac060){for(var _0x1a27df=0x0;_0x1a27df<_0x366a3e[_0xfc57('0x3b')][_0xfc57('0x5c')][_0xfc57('0x30')];_0x1a27df+=0x1){socket[_0xfc57('0x5a')](_0xfc57('0x5b'),{'UserId':Number(_0x366a3e[_0xfc57('0x3b')][_0xfc57('0x5c')][_0x1a27df]),'WhatsappQueueId':Number(_0x366a3e[_0xfc57('0x29')]['id'])});}return _0x3ac060;});}})['then'](respondWithResult(_0xbd191d,null))[_0xfc57('0x27')](handleError(_0xbd191d,null));};exports[_0xfc57('0x72')]=function(_0x102e83,_0x3c84c1){return db[_0xfc57('0x1e')][_0xfc57('0x36')]({'where':{'id':_0x102e83[_0xfc57('0x29')]['id']}})['then'](handleEntityNotFound(_0x3c84c1,null))[_0xfc57('0x16')](function(_0x459208){if(_0x459208){return _0x459208[_0xfc57('0x72')](_0x102e83[_0xfc57('0x24')][_0xfc57('0x5c')])[_0xfc57('0x16')](function(){if(_[_0xfc57('0x76')](_0x102e83[_0xfc57('0x24')][_0xfc57('0x5c')])){for(var _0xac812c=0x0;_0xac812c<_0x102e83[_0xfc57('0x24')][_0xfc57('0x5c')][_0xfc57('0x30')];_0xac812c+=0x1){socket[_0xfc57('0x5a')](_0xfc57('0x73'),{'UserId':Number(_0x102e83[_0xfc57('0x24')][_0xfc57('0x5c')][_0xac812c]),'WhatsappQueueId':Number(_0x102e83[_0xfc57('0x29')]['id'])});}}else{socket['emit'](_0xfc57('0x73'),{'UserId':Number(_0x102e83[_0xfc57('0x24')]['ids']),'WhatsappQueueId':Number(_0x102e83[_0xfc57('0x29')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c84c1,null))['catch'](handleError(_0x3c84c1,null));};exports[_0xfc57('0x77')]=function(_0x444d1c,_0x2cf231){var _0x1d9496={};var _0xf96a1d={};var _0x50c24d;var _0x471162;return db['WhatsappQueue'][_0xfc57('0x3e')]({'where':{'id':_0x444d1c[_0xfc57('0x29')]['id']}})['then'](handleEntityNotFound(_0x2cf231,null))[_0xfc57('0x16')](function(_0xe290a6){if(_0xe290a6){_0x50c24d=_0xe290a6;_0xf96a1d[_0xfc57('0x2e')]=_[_0xfc57('0x2a')](db[_0xfc57('0x46')]['rawAttributes']);_0xf96a1d['query']=_[_0xfc57('0x2a')](_0x444d1c[_0xfc57('0x24')]);_0xf96a1d['filters']=_[_0xfc57('0x2c')](_0xf96a1d['model'],_0xf96a1d[_0xfc57('0x24')]);_0x1d9496[_0xfc57('0x2d')]=_[_0xfc57('0x2c')](_0xf96a1d[_0xfc57('0x2e')],qs[_0xfc57('0x2f')](_0x444d1c[_0xfc57('0x24')][_0xfc57('0x2f')]));_0x1d9496[_0xfc57('0x2d')]=_0x1d9496['attributes'][_0xfc57('0x30')]?_0x1d9496[_0xfc57('0x2d')]:_0xf96a1d['model'];_0x1d9496[_0xfc57('0x78')]=qs[_0xfc57('0x42')](_0x444d1c[_0xfc57('0x24')][_0xfc57('0x42')]);_0x1d9496[_0xfc57('0x44')]=qs['filters'](_[_0xfc57('0x43')](_0x444d1c['query'],_0xf96a1d[_0xfc57('0x2b')]));if(_0x444d1c[_0xfc57('0x24')][_0xfc57('0x45')]){_0x1d9496[_0xfc57('0x44')]=_[_0xfc57('0x31')](_0x1d9496[_0xfc57('0x44')],{'$or':_[_0xfc57('0x1d')](_0x1d9496[_0xfc57('0x2d')],function(_0x56acc8){var _0x2a5b60={};_0x2a5b60[_0x56acc8]={'$like':'%'+_0x444d1c[_0xfc57('0x24')][_0xfc57('0x45')]+'%'};return _0x2a5b60;})});}_0x1d9496=_[_0xfc57('0x31')]({},_0x1d9496,_0x444d1c[_0xfc57('0x32')]);return _0x50c24d['getAgents'](_0x1d9496);}})[_0xfc57('0x16')](function(_0x5c5b85){if(_0x5c5b85){_0x471162=_0x5c5b85[_0xfc57('0x30')];if(!_0x444d1c[_0xfc57('0x24')][_0xfc57('0x41')](_0xfc57('0x4f'))){_0x1d9496[_0xfc57('0x11')]=qs[_0xfc57('0x11')](_0x444d1c[_0xfc57('0x24')]['limit']);_0x1d9496[_0xfc57('0xf')]=qs[_0xfc57('0xf')](_0x444d1c[_0xfc57('0x24')]['offset']);}return _0x50c24d[_0xfc57('0x77')](_0x1d9496);}})[_0xfc57('0x16')](function(_0x563d48){if(_0x563d48){return _0x563d48?{'count':_0x471162,'rows':_0x563d48}:null;}})[_0xfc57('0x16')](respondWithResult(_0x2cf231,null))[_0xfc57('0x27')](handleError(_0x2cf231,null));}; \ No newline at end of file +var _0xac6e=['isArray','userWhatsappQueue:remove','getAgents','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','count','set','update','then','get','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','getOptions','WhatsappQueue','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappQueueId','filter','User','findAndCountAll','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','from','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','compact','value','removeAgents','addAgents','omit','spread'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0xac6e,0x7d));var _0xeac6=function(_0x10a6c5,_0x3b8168){_0x10a6c5=_0x10a6c5-0x0;var _0x79e4b8=_0xac6e[_0x10a6c5];return _0x79e4b8;};'use strict';var BPromise=require('bluebird');var util=require(_0xeac6('0x0'));var _=require(_0xeac6('0x1'));var squel=require(_0xeac6('0x2'));var Redis=require(_0xeac6('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xeac6('0x4'))(_0xeac6('0x5'));var config=require(_0xeac6('0x6'));var db=require(_0xeac6('0x7'))['db'];config[_0xeac6('0x8')]=_[_0xeac6('0x9')](config[_0xeac6('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeac6('0x8')]));require(_0xeac6('0xa'))[_0xeac6('0xb')](socket);function respondWithStatusCode(_0x38d784,_0x3edafd){_0x3edafd=_0x3edafd||0xcc;return function(_0x12dc30){if(_0x12dc30){return _0x38d784['sendStatus'](_0x3edafd);}return _0x38d784[_0xeac6('0xc')](_0x3edafd)[_0xeac6('0xd')]();};}function respondWithResult(_0x547bec,_0x92128b){_0x92128b=_0x92128b||0xc8;return function(_0x531c4e){if(_0x531c4e){return _0x547bec[_0xeac6('0xc')](_0x92128b)[_0xeac6('0xe')](_0x531c4e);}};}function respondWithFilteredResult(_0x29e27a,_0x370f0c){return function(_0x23b8b0){if(_0x23b8b0){var _0x4b6915=typeof _0x370f0c[_0xeac6('0xf')]===_0xeac6('0x10')&&typeof _0x370f0c[_0xeac6('0x11')]===_0xeac6('0x10');var _0x52c098=_0x23b8b0[_0xeac6('0x12')];var _0x2bd2aa=_0x4b6915?0x0:_0x370f0c[_0xeac6('0xf')];var _0x1a8521=_0x4b6915?_0x23b8b0['count']:_0x370f0c[_0xeac6('0xf')]+_0x370f0c[_0xeac6('0x11')];var _0x3c5cc6;if(_0x1a8521>=_0x52c098){_0x1a8521=_0x52c098;_0x3c5cc6=0xc8;}else{_0x3c5cc6=0xce;}_0x29e27a[_0xeac6('0xc')](_0x3c5cc6);return _0x29e27a[_0xeac6('0x13')]('Content-Range',_0x2bd2aa+'-'+_0x1a8521+'/'+_0x52c098)['json'](_0x23b8b0);}return null;};}function saveUpdates(_0x3a031e){return function(_0x902a94){if(_0x902a94){return _0x902a94[_0xeac6('0x14')](_0x3a031e)[_0xeac6('0x15')](function(_0x3fb377){return _0x3fb377;});}return null;};}function removeEntity(_0x2c7b14){return function(_0x5a65ad){if(_0x5a65ad){return _0x5a65ad['destroy']()[_0xeac6('0x15')](function(){var _0x2b557c=_0x5a65ad[_0xeac6('0x16')]({'plain':!![]});var _0x205ac0='WhatsappQueues';return db[_0xeac6('0x17')][_0xeac6('0x18')]({'where':{'type':_0x205ac0,'resourceId':_0x2b557c['id']}})[_0xeac6('0x15')](function(){return _0x5a65ad;});})[_0xeac6('0x15')](function(){_0x2c7b14[_0xeac6('0xc')](0xcc)[_0xeac6('0xd')]();});}};}function handleEntityNotFound(_0x1c3888){return function(_0xd81030){if(!_0xd81030){_0x1c3888['sendStatus'](0x194);}return _0xd81030;};}function handleError(_0x2d4d12,_0x2c5194){_0x2c5194=_0x2c5194||0x1f4;return function(_0xeee94f){logger[_0xeac6('0x19')](_0xeee94f[_0xeac6('0x1a')]);if(_0xeee94f[_0xeac6('0x1b')]){delete _0xeee94f[_0xeac6('0x1b')];}_0x2d4d12[_0xeac6('0xc')](_0x2c5194)[_0xeac6('0x1c')](_0xeee94f);};}exports['index']=function(_0x4dd40,_0x16b609){var _0xaf31ed={};var _0x2929ce={'count':0x0,'rows':[]};var _0x29be3f=_[_0xeac6('0x1d')](db['WhatsappQueue'][_0xeac6('0x1e')],function(_0x1c192d){return{'name':_0x1c192d[_0xeac6('0x1f')],'type':_0x1c192d[_0xeac6('0x20')][_0xeac6('0x21')]};});_0xaf31ed=qs[_0xeac6('0x22')](_0x29be3f,_0x4dd40);var _0x3f2a73={'where':_0xaf31ed['where']};return db[_0xeac6('0x23')][_0xeac6('0x12')](_0x3f2a73)[_0xeac6('0x15')](function(_0x3f9c51){_0x2929ce['count']=_0x3f9c51;_0xaf31ed['include']=qs[_0xeac6('0x24')](_0x4dd40[_0xeac6('0x25')]);return db[_0xeac6('0x23')][_0xeac6('0x26')](_0xaf31ed);})[_0xeac6('0x15')](function(_0x14d2de){_0x2929ce[_0xeac6('0x27')]=_0x14d2de;return _0x2929ce;})[_0xeac6('0x15')](respondWithFilteredResult(_0x16b609,_0xaf31ed))[_0xeac6('0x28')](handleError(_0x16b609,null));};exports[_0xeac6('0x29')]=function(_0x49df78,_0x8f818d){var _0x515dcd={'raw':!![],'where':{'id':_0x49df78[_0xeac6('0x2a')]['id']}},_0x1af757={};_0x1af757[_0xeac6('0x2b')]=_[_0xeac6('0x2c')](db['WhatsappQueue'][_0xeac6('0x1e')]);_0x1af757['query']=_['keys'](_0x49df78[_0xeac6('0x25')]);_0x1af757[_0xeac6('0x2d')]=_[_0xeac6('0x2e')](_0x1af757[_0xeac6('0x2b')],_0x1af757[_0xeac6('0x25')]);_0x515dcd[_0xeac6('0x2f')]=_[_0xeac6('0x2e')](_0x1af757['model'],qs[_0xeac6('0x30')](_0x49df78['query'][_0xeac6('0x30')]));_0x515dcd[_0xeac6('0x2f')]=_0x515dcd[_0xeac6('0x2f')][_0xeac6('0x31')]?_0x515dcd[_0xeac6('0x2f')]:_0x1af757[_0xeac6('0x2b')];if(_0x49df78[_0xeac6('0x25')][_0xeac6('0x32')]){_0x515dcd[_0xeac6('0x24')]=[{'all':!![]}];}_0x515dcd=_[_0xeac6('0x33')]({},_0x515dcd,_0x49df78[_0xeac6('0x34')]);return db[_0xeac6('0x23')][_0xeac6('0x35')](_0x515dcd)['then'](handleEntityNotFound(_0x8f818d,null))[_0xeac6('0x15')](respondWithResult(_0x8f818d,null))[_0xeac6('0x28')](handleError(_0x8f818d,null));};exports[_0xeac6('0x36')]=function(_0xe74a48,_0x57e576){return db['WhatsappQueue']['create'](_0xe74a48[_0xeac6('0x37')],{})[_0xeac6('0x15')](function(_0x12e889){var _0x2ed434=_0xe74a48[_0xeac6('0x38')][_0xeac6('0x16')]({'plain':!![]});if(!_0x2ed434)throw new Error(_0xeac6('0x39'));if(_0x2ed434[_0xeac6('0x3a')]===_0xeac6('0x38')){var _0x1571fd=_0x12e889['get']({'plain':!![]});var _0x380e57=_0xeac6('0x3b');return db[_0xeac6('0x3c')][_0xeac6('0x35')]({'where':{'name':_0x380e57,'userProfileId':_0x2ed434[_0xeac6('0x3d')]},'raw':!![]})[_0xeac6('0x15')](function(_0x1ce9b4){if(_0x1ce9b4&&_0x1ce9b4[_0xeac6('0x3e')]===0x0){return db[_0xeac6('0x17')][_0xeac6('0x36')]({'name':_0x1571fd[_0xeac6('0x1b')],'resourceId':_0x1571fd['id'],'type':_0x1ce9b4[_0xeac6('0x1b')],'sectionId':_0x1ce9b4['id']},{})[_0xeac6('0x15')](function(){return _0x12e889;});}else{return _0x12e889;}})[_0xeac6('0x28')](function(_0x5847d0){logger[_0xeac6('0x19')](_0xeac6('0x3f'),_0x5847d0);throw _0x5847d0;});}return _0x12e889;})[_0xeac6('0x15')](respondWithResult(_0x57e576,0xc9))[_0xeac6('0x28')](handleError(_0x57e576,null));};exports[_0xeac6('0x14')]=function(_0x410492,_0x5e71b0){if(_0x410492['body']['id']){delete _0x410492[_0xeac6('0x37')]['id'];}return db[_0xeac6('0x23')]['find']({'where':{'id':_0x410492[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x5e71b0,null))[_0xeac6('0x15')](saveUpdates(_0x410492[_0xeac6('0x37')],null))['then'](respondWithResult(_0x5e71b0,null))[_0xeac6('0x28')](handleError(_0x5e71b0,null));};exports[_0xeac6('0x18')]=function(_0x1eb68a,_0x2dc240){return db[_0xeac6('0x23')]['find']({'where':{'id':_0x1eb68a[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x2dc240,null))[_0xeac6('0x15')](removeEntity(_0x2dc240,null))[_0xeac6('0x28')](handleError(_0x2dc240,null));};exports[_0xeac6('0x40')]=function(_0x4fc7f2,_0x1af677){return db['WhatsappQueue'][_0xeac6('0x40')]()['then'](respondWithResult(_0x1af677,null))[_0xeac6('0x28')](handleError(_0x1af677,null));};exports[_0xeac6('0x41')]=function(_0x2f0a00,_0x4809b8){var _0x88be73={'raw':!![],'where':{}},_0x136020={},_0x37592d;return db[_0xeac6('0x23')][_0xeac6('0x42')]({'where':{'id':_0x2f0a00[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x4809b8,null))[_0xeac6('0x15')](function(_0x851d97){if(_0x851d97){_0x37592d=_0x851d97[_0xeac6('0x16')]({'plain':!![]});_0x136020[_0xeac6('0x2b')]=_[_0xeac6('0x2c')](db[_0xeac6('0x43')][_0xeac6('0x1e')]);_0x136020[_0xeac6('0x25')]=_['keys'](_0x2f0a00[_0xeac6('0x25')]);_0x136020[_0xeac6('0x2d')]=_['intersection'](_0x136020[_0xeac6('0x2b')],_0x136020['query']);_0x88be73['attributes']=_['intersection'](_0x136020[_0xeac6('0x2b')],qs[_0xeac6('0x30')](_0x2f0a00['query'][_0xeac6('0x30')]));_0x88be73[_0xeac6('0x2f')]=_0x88be73[_0xeac6('0x2f')][_0xeac6('0x31')]?_0x88be73[_0xeac6('0x2f')]:_0x136020[_0xeac6('0x2b')];if(!_0x2f0a00[_0xeac6('0x25')][_0xeac6('0x44')](_0xeac6('0x45'))){_0x88be73[_0xeac6('0x11')]=qs['limit'](_0x2f0a00[_0xeac6('0x25')][_0xeac6('0x11')]);_0x88be73[_0xeac6('0xf')]=qs[_0xeac6('0xf')](_0x2f0a00[_0xeac6('0x25')][_0xeac6('0xf')]);}_0x88be73[_0xeac6('0x46')]=qs[_0xeac6('0x47')](_0x2f0a00[_0xeac6('0x25')]['sort']);_0x88be73[_0xeac6('0x48')]=qs[_0xeac6('0x2d')](_[_0xeac6('0x49')](_0x2f0a00[_0xeac6('0x25')],_0x136020[_0xeac6('0x2d')]));_0x88be73[_0xeac6('0x48')][_0xeac6('0x4a')]=_0x851d97['id'];if(_0x2f0a00[_0xeac6('0x25')]['filter']){_0x88be73[_0xeac6('0x48')]=_[_0xeac6('0x33')](_0x88be73['where'],{'$or':_[_0xeac6('0x1d')](_0x88be73[_0xeac6('0x2f')],function(_0x56f0c7){var _0x3ec923={};_0x3ec923[_0x56f0c7]={'$like':'%'+_0x2f0a00['query'][_0xeac6('0x4b')]+'%'};return _0x3ec923;})});}_0x88be73=_[_0xeac6('0x33')]({},_0x88be73,_0x2f0a00[_0xeac6('0x34')]);return db[_0xeac6('0x43')][_0xeac6('0x26')](_0x88be73);}})['then'](function(_0x39ca99){if(_0x39ca99){return db[_0xeac6('0x4c')][_0xeac6('0x4d')]({'where':{'id':_[_0xeac6('0x1d')](_0x39ca99,'UserId'),'role':_0xeac6('0x4e')},'attributes':['id',_0xeac6('0x1b'),_0xeac6('0x4f'),'updatedAt',_0xeac6('0x50')]});}})[_0xeac6('0x15')](function(_0x3fa3cd){if(_0x3fa3cd){return{'count':_0x3fa3cd[_0xeac6('0x12')],'rows':_['map'](_0x3fa3cd[_0xeac6('0x27')],function(_0x4c06be){return{'membername':_0x4c06be[_0xeac6('0x1b')],'UserId':_0x4c06be['id'],'queue_name':_0x37592d[_0xeac6('0x1b')],'WhatsappQueueId':_0x37592d['id'],'interface':util[_0xeac6('0x51')](_0xeac6('0x52'),_0xeac6('0x53'),_0x4c06be[_0xeac6('0x1b')]),'penalty':0x0,'paused':_0x4c06be['whatsappPause'],'createdAt':_0x4c06be['createdAt'],'updatedAt':_0x4c06be[_0xeac6('0x54')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeac6('0x15')](respondWithFilteredResult(_0x4809b8,_0x88be73))[_0xeac6('0x28')](handleError(_0x4809b8,null));};exports[_0xeac6('0x55')]=function(_0x2e4161,_0x5d65af){var _0x1671e9={};var _0x468912={};var _0x1ae17b;var _0x400cc3;return db[_0xeac6('0x23')][_0xeac6('0x42')]({'where':{'id':_0x2e4161[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x5d65af,null))[_0xeac6('0x15')](function(_0x2b5697){if(_0x2b5697){_0x1ae17b=_0x2b5697;_0x468912[_0xeac6('0x2b')]=_[_0xeac6('0x2c')](db[_0xeac6('0x56')]['rawAttributes']);_0x468912[_0xeac6('0x25')]=_['keys'](_0x2e4161[_0xeac6('0x25')]);_0x468912['filters']=_[_0xeac6('0x2e')](_0x468912[_0xeac6('0x2b')],_0x468912[_0xeac6('0x25')]);_0x1671e9[_0xeac6('0x2f')]=_['intersection'](_0x468912[_0xeac6('0x2b')],qs['fields'](_0x2e4161[_0xeac6('0x25')][_0xeac6('0x30')]));_0x1671e9['attributes']=_0x1671e9[_0xeac6('0x2f')][_0xeac6('0x31')]?_0x1671e9['attributes']:_0x468912[_0xeac6('0x2b')];_0x1671e9[_0xeac6('0x46')]=qs['sort'](_0x2e4161[_0xeac6('0x25')][_0xeac6('0x47')]);_0x1671e9[_0xeac6('0x48')]=qs[_0xeac6('0x2d')](_[_0xeac6('0x49')](_0x2e4161[_0xeac6('0x25')],_0x468912[_0xeac6('0x2d')]));if(_0x2e4161['query'][_0xeac6('0x4b')]){_0x1671e9['where']=_[_0xeac6('0x33')](_0x1671e9[_0xeac6('0x48')],{'$or':_[_0xeac6('0x1d')](_0x1671e9[_0xeac6('0x2f')],function(_0x295e4d){var _0x4bcd3d={};_0x4bcd3d[_0x295e4d]={'$like':'%'+_0x2e4161['query'][_0xeac6('0x4b')]+'%'};return _0x4bcd3d;})});}_0x1671e9=_[_0xeac6('0x33')]({},_0x1671e9,_0x2e4161[_0xeac6('0x34')]);return _0x1ae17b[_0xeac6('0x55')](_0x1671e9);}})['then'](function(_0xc8c2b6){if(_0xc8c2b6){_0x400cc3=_0xc8c2b6['length'];if(!_0x2e4161[_0xeac6('0x25')][_0xeac6('0x44')](_0xeac6('0x45'))){_0x1671e9[_0xeac6('0x11')]=qs[_0xeac6('0x11')](_0x2e4161[_0xeac6('0x25')][_0xeac6('0x11')]);_0x1671e9[_0xeac6('0xf')]=qs[_0xeac6('0xf')](_0x2e4161[_0xeac6('0x25')][_0xeac6('0xf')]);}return _0x1ae17b['getTeams'](_0x1671e9);}})[_0xeac6('0x15')](function(_0x231bff){if(_0x231bff){return _0x231bff?{'count':_0x400cc3,'rows':_0x231bff}:null;}})['then'](respondWithResult(_0x5d65af,null))[_0xeac6('0x28')](handleError(_0x5d65af,null));};exports['addTeams']=function(_0x57c1d1,_0xece679){var _0x4685ab=_0x57c1d1[_0xeac6('0x37')][_0xeac6('0x57')];return db[_0xeac6('0x56')]['findAll']({'where':{'id':_0x4685ab},'attributes':['id'],'include':[{'model':db[_0xeac6('0x4c')],'as':_0xeac6('0x58'),'attributes':['id','name','online',_0xeac6('0x59'),'interface'],'raw':!![]}]})[_0xeac6('0x15')](function(_0x9af4fb){if(_0x9af4fb){var _0x12851a=_[_0xeac6('0x5a')](_0x9af4fb,function(_0x33e2c8){var _0x42db3c=_0x33e2c8[_0xeac6('0x16')]({'plain':!![]});return _0x42db3c['Agents'];});return db[_0xeac6('0x23')]['find']({'where':{'id':_0x57c1d1['params']['id']}})[_0xeac6('0x15')](function(_0x2d6adf){return db[_0xeac6('0x5b')][_0xeac6('0x5c')](function(_0x413b24){return _0x2d6adf[_0xeac6('0x5d')](_0x4685ab,{'transaction':_0x413b24})[_0xeac6('0x15')](function(){return BPromise[_0xeac6('0x5e')](_0x12851a,function(_0x17b49c){return db['UserWhatsappQueue'][_0xeac6('0x5f')]({'where':{'UserId':_0x17b49c['id'],'WhatsappQueueId':_0x57c1d1['params']['id']},'transaction':_0x413b24});});})[_0xeac6('0x15')](function(){_0x12851a[_0xeac6('0x60')](function(_0x40ddb0){socket[_0xeac6('0x61')]('userWhatsappQueue:save',{'UserId':_0x40ddb0['id'],'WhatsappQueueId':_0x2d6adf['id']});});});});});}})[_0xeac6('0x15')](respondWithStatusCode(_0xece679,null))[_0xeac6('0x28')](handleError(_0xece679,null));};exports[_0xeac6('0x62')]=function(_0x50cd51,_0x347845){return db[_0xeac6('0x56')][_0xeac6('0x26')]({'where':{'id':_0x50cd51['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xeac6('0x4c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeac6('0x15')](handleEntityNotFound(_0x347845,null))['then'](function(_0x541081){var _0x124557=_[_0xeac6('0x1d')](_0x541081,'id');var _0x93353e=[];var _0x150d1=[];var _0x48f23c=squel[_0xeac6('0x63')]();_0x48f23c['field']('tq.TeamId')[_0xeac6('0x64')](_0xeac6('0x65'),'tq')[_0xeac6('0x66')](_0xeac6('0x67'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xeac6('0x48')]('WhatsappQueueId\x20=\x20?',_0x50cd51[_0xeac6('0x2a')]['id']);for(var _0x4cb04a=0x0;_0x4cb04a<_0x541081[_0xeac6('0x31')];_0x4cb04a+=0x1){let _0x2fd182=_0x541081[_0x4cb04a];for(var _0x5b98d8=0x0;_0x5b98d8<_0x2fd182['Agents'][_0xeac6('0x31')];_0x5b98d8+=0x1){let _0x42ba25=_0x2fd182['Agents'][_0x5b98d8];var _0x497f5e=_0x48f23c[_0xeac6('0x68')]();_0x497f5e[_0xeac6('0x48')](_0xeac6('0x69'),_0x42ba25['id']);_0x150d1[_0xeac6('0x6a')](db['sequelize'][_0xeac6('0x25')](_0x497f5e[_0xeac6('0x6b')](),{'type':db[_0xeac6('0x5b')][_0xeac6('0x6c')]['SELECT']})[_0xeac6('0x15')](function(_0x385561){if(_0x385561[_0xeac6('0x31')]===0x1){return _0x42ba25['id'];}else{var _0x424bb3=_[_0xeac6('0x6d')](_[_0xeac6('0x1d')](_0x385561,_0xeac6('0x6e')),function(_0x144202){return _[_0xeac6('0x6f')](_0x124557,_0x144202);});if(_0x424bb3){return _0x42ba25['id'];}}}));}}return BPromise[_0xeac6('0x70')](_0x150d1)['then'](function(_0x4e9cf1){_0x93353e=_(_0x93353e)['union'](_0x4e9cf1)[_0xeac6('0x71')]()[_0xeac6('0x72')]();return db['WhatsappQueue']['find']({'where':{'id':_0x50cd51[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](function(_0x3bffb2){return db['sequelize']['transaction'](function(_0x4b3571){return _0x3bffb2[_0xeac6('0x62')](_0x50cd51[_0xeac6('0x25')]['ids'],{'transaction':_0x4b3571})[_0xeac6('0x15')](function(){if(!_['isEmpty'](_0x93353e)){return _0x3bffb2[_0xeac6('0x73')](_0x93353e,{'transaction':_0x4b3571});}})['then'](function(){_0x93353e['forEach'](function(_0x2ed768){socket[_0xeac6('0x61')]('userWhatsappQueue:remove',{'UserId':_0x2ed768,'WhatsappQueueId':_0x3bffb2['id']});});});});});});})[_0xeac6('0x15')](respondWithStatusCode(_0x347845,null))['catch'](handleError(_0x347845,null));};exports[_0xeac6('0x74')]=function(_0x478d11,_0x4f84dc){return db[_0xeac6('0x23')][_0xeac6('0x35')]({'where':{'id':_0x478d11[_0xeac6('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4f84dc,null))[_0xeac6('0x15')](function(_0x2d65ab){if(_0x2d65ab){return _0x2d65ab[_0xeac6('0x74')](_0x478d11[_0xeac6('0x37')][_0xeac6('0x57')],_[_0xeac6('0x75')](_0x478d11[_0xeac6('0x37')],[_0xeac6('0x57'),'id'])||{})[_0xeac6('0x76')](function(_0x1a4d63){for(var _0x358ad9=0x0;_0x358ad9<_0x478d11[_0xeac6('0x37')]['ids'][_0xeac6('0x31')];_0x358ad9+=0x1){socket[_0xeac6('0x61')]('userWhatsappQueue:save',{'UserId':Number(_0x478d11[_0xeac6('0x37')][_0xeac6('0x57')][_0x358ad9]),'WhatsappQueueId':Number(_0x478d11[_0xeac6('0x2a')]['id'])});}return _0x1a4d63;});}})[_0xeac6('0x15')](respondWithResult(_0x4f84dc,null))[_0xeac6('0x28')](handleError(_0x4f84dc,null));};exports['removeAgents']=function(_0x1e9aff,_0x57d530){return db[_0xeac6('0x23')][_0xeac6('0x35')]({'where':{'id':_0x1e9aff[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0x57d530,null))[_0xeac6('0x15')](function(_0x116192){if(_0x116192){return _0x116192[_0xeac6('0x73')](_0x1e9aff['query'][_0xeac6('0x57')])[_0xeac6('0x15')](function(){if(_[_0xeac6('0x77')](_0x1e9aff[_0xeac6('0x25')]['ids'])){for(var _0x1b25f5=0x0;_0x1b25f5<_0x1e9aff[_0xeac6('0x25')]['ids'][_0xeac6('0x31')];_0x1b25f5+=0x1){socket[_0xeac6('0x61')](_0xeac6('0x78'),{'UserId':Number(_0x1e9aff[_0xeac6('0x25')][_0xeac6('0x57')][_0x1b25f5]),'WhatsappQueueId':Number(_0x1e9aff[_0xeac6('0x2a')]['id'])});}}else{socket['emit'](_0xeac6('0x78'),{'UserId':Number(_0x1e9aff['query'][_0xeac6('0x57')]),'WhatsappQueueId':Number(_0x1e9aff[_0xeac6('0x2a')]['id'])});}});}})[_0xeac6('0x15')](respondWithStatusCode(_0x57d530,null))[_0xeac6('0x28')](handleError(_0x57d530,null));};exports[_0xeac6('0x79')]=function(_0x9c05a,_0xe58d5e){var _0x13bd37={};var _0x57572f={};var _0x163b4e;var _0x11679c;return db[_0xeac6('0x23')][_0xeac6('0x42')]({'where':{'id':_0x9c05a[_0xeac6('0x2a')]['id']}})[_0xeac6('0x15')](handleEntityNotFound(_0xe58d5e,null))[_0xeac6('0x15')](function(_0x5c8b43){if(_0x5c8b43){_0x163b4e=_0x5c8b43;_0x57572f[_0xeac6('0x2b')]=_['keys'](db[_0xeac6('0x4c')][_0xeac6('0x1e')]);_0x57572f['query']=_[_0xeac6('0x2c')](_0x9c05a[_0xeac6('0x25')]);_0x57572f[_0xeac6('0x2d')]=_['intersection'](_0x57572f['model'],_0x57572f[_0xeac6('0x25')]);_0x13bd37[_0xeac6('0x2f')]=_[_0xeac6('0x2e')](_0x57572f[_0xeac6('0x2b')],qs[_0xeac6('0x30')](_0x9c05a[_0xeac6('0x25')]['fields']));_0x13bd37['attributes']=_0x13bd37['attributes']['length']?_0x13bd37[_0xeac6('0x2f')]:_0x57572f[_0xeac6('0x2b')];_0x13bd37[_0xeac6('0x46')]=qs[_0xeac6('0x47')](_0x9c05a['query'][_0xeac6('0x47')]);_0x13bd37[_0xeac6('0x48')]=qs['filters'](_['pick'](_0x9c05a[_0xeac6('0x25')],_0x57572f[_0xeac6('0x2d')]));if(_0x9c05a[_0xeac6('0x25')][_0xeac6('0x4b')]){_0x13bd37[_0xeac6('0x48')]=_['merge'](_0x13bd37[_0xeac6('0x48')],{'$or':_[_0xeac6('0x1d')](_0x13bd37[_0xeac6('0x2f')],function(_0x37897d){var _0x5a1012={};_0x5a1012[_0x37897d]={'$like':'%'+_0x9c05a[_0xeac6('0x25')][_0xeac6('0x4b')]+'%'};return _0x5a1012;})});}_0x13bd37=_[_0xeac6('0x33')]({},_0x13bd37,_0x9c05a['options']);return _0x163b4e[_0xeac6('0x79')](_0x13bd37);}})['then'](function(_0x591307){if(_0x591307){_0x11679c=_0x591307[_0xeac6('0x31')];if(!_0x9c05a[_0xeac6('0x25')][_0xeac6('0x44')](_0xeac6('0x45'))){_0x13bd37[_0xeac6('0x11')]=qs[_0xeac6('0x11')](_0x9c05a['query'][_0xeac6('0x11')]);_0x13bd37['offset']=qs['offset'](_0x9c05a[_0xeac6('0x25')][_0xeac6('0xf')]);}return _0x163b4e[_0xeac6('0x79')](_0x13bd37);}})[_0xeac6('0x15')](function(_0x725d0d){if(_0x725d0d){return _0x725d0d?{'count':_0x11679c,'rows':_0x725d0d}:null;}})[_0xeac6('0x15')](respondWithResult(_0xe58d5e,null))[_0xeac6('0x28')](handleError(_0xe58d5e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 41e8132..3c99b34 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 _0xf5b0=['remove','emit','hasOwnProperty','hook','../../mysqldb','WhatsappQueue','save','update'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xf5b0,0x12c));var _0x0f5b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf5b0[_0x160c73];return _0xd9302;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x0f5b('0x0'))['db'][_0x0f5b('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0f5b('0x2'),'afterUpdate':_0x0f5b('0x3'),'afterDestroy':_0x0f5b('0x4')};function emitEvent(_0x1b694f){return function(_0x42a26e,_0x4333c2,_0x2a2b18){WhatsappQueueEvents[_0x0f5b('0x5')](_0x1b694f+':'+_0x42a26e['id'],_0x42a26e);WhatsappQueueEvents[_0x0f5b('0x5')](_0x1b694f,_0x42a26e);_0x2a2b18(null);};}for(var e in events){if(events[_0x0f5b('0x6')](e)){var event=events[e];WhatsappQueue[_0x0f5b('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x9bc0=['update','remove','emit','hasOwnProperty','hook','exports','events','save'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x9bc0,0x1c6));var _0x09bc=function(_0x4bcbc9,_0x59c051){_0x4bcbc9=_0x4bcbc9-0x0;var _0xe486f1=_0x9bc0[_0x4bcbc9];return _0xe486f1;};'use strict';var EventEmitter=require(_0x09bc('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09bc('0x1'),'afterUpdate':_0x09bc('0x2'),'afterDestroy':_0x09bc('0x3')};function emitEvent(_0x12670b){return function(_0x22dedf,_0x1ffede,_0x404f32){WhatsappQueueEvents[_0x09bc('0x4')](_0x12670b+':'+_0x22dedf['id'],_0x22dedf);WhatsappQueueEvents[_0x09bc('0x4')](_0x12670b,_0x22dedf);_0x404f32(null);};}for(var e in events){if(events[_0x09bc('0x5')](e)){var event=events[e];WhatsappQueue[_0x09bc('0x6')](e,emitEvent(event));}}module[_0x09bc('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index f317e68..3cad5f6 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 _0xebb0=['request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','lodash','api','bluebird'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0xebb0,0x189));var _0x0ebb=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xebb0[_0x95411e];return _0x2c8718;};'use strict';var _=require(_0x0ebb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ebb('0x1'));var moment=require('moment');var BPromise=require(_0x0ebb('0x2'));var rp=require(_0x0ebb('0x3'));var fs=require('fs');var path=require(_0x0ebb('0x4'));var rimraf=require(_0x0ebb('0x5'));var config=require(_0x0ebb('0x6'));var attributes=require(_0x0ebb('0x7'));module[_0x0ebb('0x8')]=function(_0x42902c,_0x243eed){return _0x42902c[_0x0ebb('0x9')](_0x0ebb('0xa'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8bbf=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','WhatsappQueue','lodash'];(function(_0x414f6e,_0x50f3df){var _0x1b8564=function(_0x5e14d7){while(--_0x5e14d7){_0x414f6e['push'](_0x414f6e['shift']());}};_0x1b8564(++_0x50f3df);}(_0x8bbf,0xef));var _0xf8bb=function(_0x3ce7bf,_0x73c3af){_0x3ce7bf=_0x3ce7bf-0x0;var _0x453a37=_0x8bbf[_0x3ce7bf];return _0x453a37;};'use strict';var _=require(_0xf8bb('0x0'));var util=require(_0xf8bb('0x1'));var logger=require(_0xf8bb('0x2'))(_0xf8bb('0x3'));var moment=require(_0xf8bb('0x4'));var BPromise=require(_0xf8bb('0x5'));var rp=require(_0xf8bb('0x6'));var fs=require('fs');var path=require(_0xf8bb('0x7'));var rimraf=require(_0xf8bb('0x8'));var config=require(_0xf8bb('0x9'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x493c85,_0x5f9f49){return _0x493c85[_0xf8bb('0xa')](_0xf8bb('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index a9298b0..558031b 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 _0xb1de=['ShowWhatsappQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','findAll','options','raw','attributes','include','map','model','then','WhatsappQueue','find'];(function(_0x3e2f37,_0x139acc){var _0x1a74f7=function(_0x383c14){while(--_0x383c14){_0x3e2f37['push'](_0x3e2f37['shift']());}};_0x1a74f7(++_0x139acc);}(_0xb1de,0x119));var _0xeb1d=function(_0x301074,_0x111e1e){_0x301074=_0x301074-0x0;var _0x1b5b8e=_0xb1de[_0x301074];return _0x1b5b8e;};'use strict';var _=require(_0xeb1d('0x0'));var util=require(_0xeb1d('0x1'));var moment=require(_0xeb1d('0x2'));var BPromise=require(_0xeb1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb1d('0x4'));var db=require(_0xeb1d('0x5'))['db'];var utils=require(_0xeb1d('0x6'));var logger=require(_0xeb1d('0x7'))('rpc');var config=require(_0xeb1d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xeb1d('0x9')][_0xeb1d('0xa')]({'port':0x232a});config[_0xeb1d('0xb')]=_[_0xeb1d('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xeb1d('0xd'))(new Redis(config[_0xeb1d('0xb')]));require(_0xeb1d('0xe'))[_0xeb1d('0xf')](socket);function respondWithRpcPromise(_0xa447c8,_0x5f38a7,_0x508090){return new BPromise(function(_0x499357,_0x4511b7){return client[_0xeb1d('0x10')](_0xa447c8,_0x508090)['then'](function(_0x22529e){logger[_0xeb1d('0x11')](_0xeb1d('0x12'),_0x5f38a7,_0xeb1d('0x13'));logger[_0xeb1d('0x14')](_0xeb1d('0x15'),_0x5f38a7,_0xeb1d('0x13'),JSON[_0xeb1d('0x16')](_0x22529e));if(_0x22529e[_0xeb1d('0x17')]){if(_0x22529e[_0xeb1d('0x17')][_0xeb1d('0x18')]===0x1f4){logger[_0xeb1d('0x17')](_0xeb1d('0x12'),_0x5f38a7,_0x22529e['error'][_0xeb1d('0x19')]);return _0x4511b7(_0x22529e[_0xeb1d('0x17')]['message']);}logger[_0xeb1d('0x17')](_0xeb1d('0x12'),_0x5f38a7,_0x22529e[_0xeb1d('0x17')]['message']);return _0x499357(_0x22529e[_0xeb1d('0x17')]['message']);}else{logger['info'](_0xeb1d('0x12'),_0x5f38a7,_0xeb1d('0x13'));_0x499357(_0x22529e[_0xeb1d('0x1a')][_0xeb1d('0x19')]);}})[_0xeb1d('0x1b')](function(_0x3d2d2c){logger['error'](_0xeb1d('0x12'),_0x5f38a7,_0x3d2d2c);_0x4511b7(_0x3d2d2c);});});}exports[_0xeb1d('0x1c')]=function(_0x2e6427){var _0x4b2cb1=this;return new Promise(function(_0x48edee,_0x3eb4d5){return db['WhatsappQueue'][_0xeb1d('0x1d')]({'raw':_0x2e6427[_0xeb1d('0x1e')]?_0x2e6427[_0xeb1d('0x1e')][_0xeb1d('0x1f')]===undefined?!![]:![]:!![],'where':_0x2e6427[_0xeb1d('0x1e')]?_0x2e6427[_0xeb1d('0x1e')]['where']||null:null,'attributes':_0x2e6427['options']?_0x2e6427[_0xeb1d('0x1e')][_0xeb1d('0x20')]||null:null,'limit':_0x2e6427[_0xeb1d('0x1e')]?_0x2e6427[_0xeb1d('0x1e')]['limit']||null:null,'include':_0x2e6427[_0xeb1d('0x1e')]?_0x2e6427[_0xeb1d('0x1e')][_0xeb1d('0x21')]?_[_0xeb1d('0x22')](_0x2e6427[_0xeb1d('0x1e')][_0xeb1d('0x21')],function(_0x419c93){return{'model':db[_0x419c93[_0xeb1d('0x23')]],'as':_0x419c93['as'],'attributes':_0x419c93[_0xeb1d('0x20')],'include':_0x419c93[_0xeb1d('0x21')]?_[_0xeb1d('0x22')](_0x419c93[_0xeb1d('0x21')],function(_0x12387c){return{'model':db[_0x12387c['model']],'as':_0x12387c['as'],'attributes':_0x12387c[_0xeb1d('0x20')],'include':_0x12387c['include']?_[_0xeb1d('0x22')](_0x12387c[_0xeb1d('0x21')],function(_0xe055b4){return{'model':db[_0xe055b4[_0xeb1d('0x23')]],'as':_0xe055b4['as'],'attributes':_0xe055b4[_0xeb1d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeb1d('0x24')](function(_0xbab99a){logger['info']('GetWhatsappQueue',_0x2e6427);logger[_0xeb1d('0x14')](_0xeb1d('0x1c'),_0x2e6427,JSON[_0xeb1d('0x16')](_0xbab99a));_0x48edee(_0xbab99a);})[_0xeb1d('0x1b')](function(_0x9c29b1){logger['error'](_0xeb1d('0x1c'),_0x9c29b1[_0xeb1d('0x19')],_0x2e6427);_0x3eb4d5(_0x4b2cb1[_0xeb1d('0x17')](0x1f4,_0x9c29b1[_0xeb1d('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x3af7cf){var _0x2fa6fb=this;return new Promise(function(_0x2e249b,_0x5f00d3){return db[_0xeb1d('0x25')][_0xeb1d('0x26')]({'raw':_0x3af7cf[_0xeb1d('0x1e')]?_0x3af7cf[_0xeb1d('0x1e')][_0xeb1d('0x1f')]===undefined?!![]:![]:!![],'where':_0x3af7cf[_0xeb1d('0x1e')]?_0x3af7cf[_0xeb1d('0x1e')]['where']||null:null,'attributes':_0x3af7cf['options']?_0x3af7cf['options'][_0xeb1d('0x20')]||null:null,'include':_0x3af7cf[_0xeb1d('0x1e')]?_0x3af7cf[_0xeb1d('0x1e')][_0xeb1d('0x21')]?_[_0xeb1d('0x22')](_0x3af7cf['options'][_0xeb1d('0x21')],function(_0x104942){return{'model':db[_0x104942[_0xeb1d('0x23')]],'as':_0x104942['as'],'attributes':_0x104942['attributes'],'include':_0x104942['include']?_['map'](_0x104942[_0xeb1d('0x21')],function(_0x154083){return{'model':db[_0x154083[_0xeb1d('0x23')]],'as':_0x154083['as'],'attributes':_0x154083[_0xeb1d('0x20')],'include':_0x154083['include']?_[_0xeb1d('0x22')](_0x154083[_0xeb1d('0x21')],function(_0x2abe19){return{'model':db[_0x2abe19[_0xeb1d('0x23')]],'as':_0x2abe19['as'],'attributes':_0x2abe19[_0xeb1d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeb1d('0x24')](function(_0x38801f){logger[_0xeb1d('0x11')](_0xeb1d('0x27'),_0x3af7cf);logger[_0xeb1d('0x14')](_0xeb1d('0x27'),_0x3af7cf,JSON[_0xeb1d('0x16')](_0x38801f));_0x2e249b(_0x38801f);})[_0xeb1d('0x1b')](function(_0x280694){logger[_0xeb1d('0x17')](_0xeb1d('0x27'),_0x280694[_0xeb1d('0x19')],_0x3af7cf);_0x5f00d3(_0x2fa6fb[_0xeb1d('0x17')](0x1f4,_0x280694[_0xeb1d('0x19')]));});});}; \ No newline at end of file +var _0x81e8=['ShowWhatsappQueue','WhatsappQueue','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./whatsappQueue.socket','register','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetWhatsappQueue','findAll','options','where','attributes','limit','include','map','model','info','stringify'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x81e8,0x134));var _0x881e=function(_0x30d9d1,_0x14a4f9){_0x30d9d1=_0x30d9d1-0x0;var _0x3da7be=_0x81e8[_0x30d9d1];return _0x3da7be;};'use strict';var _=require(_0x881e('0x0'));var util=require(_0x881e('0x1'));var moment=require('moment');var BPromise=require(_0x881e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x881e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x881e('0x4'));var logger=require(_0x881e('0x5'))('rpc');var config=require(_0x881e('0x6'));var jayson=require(_0x881e('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x881e('0x8')]=_[_0x881e('0x9')](config['redis'],{'host':_0x881e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x881e('0xb'))[_0x881e('0xc')](socket);function respondWithRpcPromise(_0x4db6a0,_0xd8c131,_0x23e66b){return new BPromise(function(_0x51a495,_0x23348c){return client['request'](_0x4db6a0,_0x23e66b)[_0x881e('0xd')](function(_0x315426){logger['info'](_0x881e('0xe'),_0xd8c131,_0x881e('0xf'));logger[_0x881e('0x10')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0xd8c131,'request\x20sent',JSON['stringify'](_0x315426));if(_0x315426[_0x881e('0x11')]){if(_0x315426[_0x881e('0x11')]['code']===0x1f4){logger[_0x881e('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0xd8c131,_0x315426['error'][_0x881e('0x12')]);return _0x23348c(_0x315426['error'][_0x881e('0x12')]);}logger[_0x881e('0x11')](_0x881e('0xe'),_0xd8c131,_0x315426['error']['message']);return _0x51a495(_0x315426[_0x881e('0x11')][_0x881e('0x12')]);}else{logger['info'](_0x881e('0xe'),_0xd8c131,_0x881e('0xf'));_0x51a495(_0x315426[_0x881e('0x13')][_0x881e('0x12')]);}})[_0x881e('0x14')](function(_0x2c50fc){logger[_0x881e('0x11')](_0x881e('0xe'),_0xd8c131,_0x2c50fc);_0x23348c(_0x2c50fc);});});}exports[_0x881e('0x15')]=function(_0x3e1b8a){var _0x3a70c9=this;return new Promise(function(_0x25a26a,_0x2bf7e0){return db['WhatsappQueue'][_0x881e('0x16')]({'raw':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a[_0x881e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a[_0x881e('0x17')][_0x881e('0x18')]||null:null,'attributes':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a['options'][_0x881e('0x19')]||null:null,'limit':_0x3e1b8a['options']?_0x3e1b8a[_0x881e('0x17')][_0x881e('0x1a')]||null:null,'include':_0x3e1b8a[_0x881e('0x17')]?_0x3e1b8a[_0x881e('0x17')][_0x881e('0x1b')]?_[_0x881e('0x1c')](_0x3e1b8a['options']['include'],function(_0x54b604){return{'model':db[_0x54b604[_0x881e('0x1d')]],'as':_0x54b604['as'],'attributes':_0x54b604[_0x881e('0x19')],'include':_0x54b604['include']?_[_0x881e('0x1c')](_0x54b604['include'],function(_0x790cf9){return{'model':db[_0x790cf9['model']],'as':_0x790cf9['as'],'attributes':_0x790cf9[_0x881e('0x19')],'include':_0x790cf9[_0x881e('0x1b')]?_[_0x881e('0x1c')](_0x790cf9['include'],function(_0x1591e9){return{'model':db[_0x1591e9[_0x881e('0x1d')]],'as':_0x1591e9['as'],'attributes':_0x1591e9[_0x881e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x881e('0xd')](function(_0x4d6af0){logger[_0x881e('0x1e')](_0x881e('0x15'),_0x3e1b8a);logger[_0x881e('0x10')](_0x881e('0x15'),_0x3e1b8a,JSON[_0x881e('0x1f')](_0x4d6af0));_0x25a26a(_0x4d6af0);})[_0x881e('0x14')](function(_0xf22878){logger[_0x881e('0x11')](_0x881e('0x15'),_0xf22878[_0x881e('0x12')],_0x3e1b8a);_0x2bf7e0(_0x3a70c9[_0x881e('0x11')](0x1f4,_0xf22878[_0x881e('0x12')]));});});};exports[_0x881e('0x20')]=function(_0xa26814){var _0x2ce39f=this;return new Promise(function(_0x1e3297,_0x135945){return db[_0x881e('0x21')]['find']({'raw':_0xa26814[_0x881e('0x17')]?_0xa26814[_0x881e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xa26814[_0x881e('0x17')]?_0xa26814[_0x881e('0x17')][_0x881e('0x18')]||null:null,'attributes':_0xa26814[_0x881e('0x17')]?_0xa26814[_0x881e('0x17')][_0x881e('0x19')]||null:null,'include':_0xa26814['options']?_0xa26814[_0x881e('0x17')]['include']?_[_0x881e('0x1c')](_0xa26814[_0x881e('0x17')]['include'],function(_0x193839){return{'model':db[_0x193839[_0x881e('0x1d')]],'as':_0x193839['as'],'attributes':_0x193839[_0x881e('0x19')],'include':_0x193839['include']?_[_0x881e('0x1c')](_0x193839[_0x881e('0x1b')],function(_0x4ff1df){return{'model':db[_0x4ff1df[_0x881e('0x1d')]],'as':_0x4ff1df['as'],'attributes':_0x4ff1df[_0x881e('0x19')],'include':_0x4ff1df['include']?_[_0x881e('0x1c')](_0x4ff1df['include'],function(_0x8682d6){return{'model':db[_0x8682d6[_0x881e('0x1d')]],'as':_0x8682d6['as'],'attributes':_0x8682d6[_0x881e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x881e('0xd')](function(_0x49efc7){logger[_0x881e('0x1e')](_0x881e('0x20'),_0xa26814);logger['debug'](_0x881e('0x20'),_0xa26814,JSON[_0x881e('0x1f')](_0x49efc7));_0x1e3297(_0x49efc7);})[_0x881e('0x14')](function(_0x467b53){logger[_0x881e('0x11')](_0x881e('0x20'),_0x467b53[_0x881e('0x12')],_0xa26814);_0x135945(_0x2ce39f['error'](0x1f4,_0x467b53['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a20e707..e256a61 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 _0x26b3=['whatsappQueue:','save','remove','emit','removeListener','length'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x26b3,0xcd));var _0x326b=function(_0x38f478,_0x347902){_0x38f478=_0x38f478-0x0;var _0x547d4e=_0x26b3[_0x38f478];return _0x547d4e;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x326b('0x0'),_0x326b('0x1'),'update'];function createListener(_0x311c5d,_0x3d3794){return function(_0x467dbf){_0x3d3794[_0x326b('0x2')](_0x311c5d,_0x467dbf);};}function removeListener(_0x494b00,_0x3e67e8){return function(){WhatsappQueueEvents[_0x326b('0x3')](_0x494b00,_0x3e67e8);};}exports['register']=function(_0x3eaca7){for(var _0xa7d314=0x0,_0x5c0a07=events[_0x326b('0x4')];_0xa7d314<_0x5c0a07;_0xa7d314++){var _0x49b07e=events[_0xa7d314];var _0x3080d1=createListener(_0x326b('0x5')+_0x49b07e,_0x3eaca7);WhatsappQueueEvents['on'](_0x49b07e,_0x3080d1);}}; \ No newline at end of file +var _0x3170=['save','remove','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x174d8b,_0x30ed1c){var _0x2d271d=function(_0x425dac){while(--_0x425dac){_0x174d8b['push'](_0x174d8b['shift']());}};_0x2d271d(++_0x30ed1c);}(_0x3170,0x117));var _0x0317=function(_0x348eaf,_0x1d72a2){_0x348eaf=_0x348eaf-0x0;var _0x1eba1a=_0x3170[_0x348eaf];return _0x1eba1a;};'use strict';var WhatsappQueueEvents=require(_0x0317('0x0'));var events=[_0x0317('0x1'),_0x0317('0x2'),'update'];function createListener(_0x544c7,_0x27e7bd){return function(_0x205414){_0x27e7bd[_0x0317('0x3')](_0x544c7,_0x205414);};}function removeListener(_0x42021a,_0x209cd5){return function(){WhatsappQueueEvents[_0x0317('0x4')](_0x42021a,_0x209cd5);};}exports[_0x0317('0x5')]=function(_0x49e104){for(var _0x52a3d4=0x0,_0xb44946=events[_0x0317('0x6')];_0x52a3d4<_0xb44946;_0x52a3d4++){var _0x1653ce=events[_0x52a3d4];var _0x2406ac=createListener(_0x0317('0x7')+_0x1653ce,_0x49e104);WhatsappQueueEvents['on'](_0x1653ce,_0x2406ac);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 799f7da..1de8ac5 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 _0xae7d=['update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','./whatsappQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create'];(function(_0x19e441,_0x4cc66b){var _0x4f7b3e=function(_0x24bb0b){while(--_0x24bb0b){_0x19e441['push'](_0x19e441['shift']());}};_0x4f7b3e(++_0x4cc66b);}(_0xae7d,0x83));var _0xdae7=function(_0x10f982,_0x2869f8){_0x10f982=_0x10f982-0x0;var _0x3cefe1=_0xae7d[_0x10f982];return _0x3cefe1;};'use strict';var multer=require(_0xdae7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdae7('0x1'));var express=require(_0xdae7('0x2'));var router=express[_0xdae7('0x3')]();var fs_extra=require(_0xdae7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdae7('0x5'));router[_0xdae7('0x6')]('/',auth[_0xdae7('0x7')](),controller['index']);router[_0xdae7('0x6')]('/describe',auth[_0xdae7('0x7')](),controller[_0xdae7('0x8')]);router[_0xdae7('0x6')](_0xdae7('0x9'),auth[_0xdae7('0x7')](),controller[_0xdae7('0xa')]);router[_0xdae7('0xb')]('/',auth[_0xdae7('0x7')](),controller[_0xdae7('0xc')]);router['put']('/:id',auth[_0xdae7('0x7')](),controller[_0xdae7('0xd')]);router[_0xdae7('0xe')](_0xdae7('0x9'),auth[_0xdae7('0x7')](),controller[_0xdae7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe130=['/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x667166,_0x3544ea){var _0x14b87d=function(_0x294ee6){while(--_0x294ee6){_0x667166['push'](_0x667166['shift']());}};_0x14b87d(++_0x3544ea);}(_0xe130,0x127));var _0x0e13=function(_0x170cca,_0x201ae7){_0x170cca=_0x170cca-0x0;var _0x34984c=_0xe130[_0x170cca];return _0x34984c;};'use strict';var multer=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var path=require('path');var timeout=require(_0x0e13('0x2'));var express=require(_0x0e13('0x3'));var router=express[_0x0e13('0x4')]();var fs_extra=require(_0x0e13('0x5'));var auth=require(_0x0e13('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0e13('0x7'));var controller=require(_0x0e13('0x8'));router[_0x0e13('0x9')]('/',auth[_0x0e13('0xa')](),controller['index']);router[_0x0e13('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x0e13('0x9')](_0x0e13('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0e13('0xc')]('/',auth[_0x0e13('0xa')](),controller[_0x0e13('0xd')]);router[_0x0e13('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0e13('0xf')]);router[_0x0e13('0x10')](_0x0e13('0xb'),auth[_0x0e13('0xa')](),controller['destroy']);module[_0x0e13('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 2990e20..17e0982 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(_0x4ff1a0,_0x132df4){var _0x347fb8=function(_0x5b8227){while(--_0x5b8227){_0x4ff1a0['push'](_0x4ff1a0['shift']());}};_0x347fb8(++_0x132df4);}(_0x7a54,0x106));var _0x47a5=function(_0x25a165,_0x2ddc4a){_0x25a165=_0x25a165-0x0;var _0x3732e7=_0x7a54[_0x25a165];return _0x3732e7;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x13fa87,_0xd2ea7d){var _0x2d5a35=function(_0x1fbf2c){while(--_0x1fbf2c){_0x13fa87['push'](_0x13fa87['shift']());}};_0x2d5a35(++_0xd2ea7d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 92fa89d..403b250 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(_0x5e2475,_0x28bedf){var _0x535b9b=function(_0x595296){while(--_0x595296){_0x5e2475['push'](_0x5e2475['shift']());}};_0x535b9b(++_0x28bedf);}(_0x5b12,0xa3));var _0x25b1=function(_0x5110ce,_0x2f93e6){_0x5110ce=_0x5110ce-0x0;var _0x4b70ef=_0x5b12[_0x5110ce];return _0x4b70ef;};'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 _0x28f2=['where','pick','filter','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','merge','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x28f2,0x193));var _0x228f=function(_0x1decb9,_0x1de278){_0x1decb9=_0x1decb9-0x0;var _0xa209b3=_0x28f2[_0x1decb9];return _0xa209b3;};'use strict';var emlformat=require(_0x228f('0x0'));var rimraf=require(_0x228f('0x1'));var zipdir=require(_0x228f('0x2'));var jsonpatch=require(_0x228f('0x3'));var rp=require(_0x228f('0x4'));var moment=require('moment');var BPromise=require(_0x228f('0x5'));var Mustache=require(_0x228f('0x6'));var util=require(_0x228f('0x7'));var path=require(_0x228f('0x8'));var sox=require(_0x228f('0x9'));var csv=require(_0x228f('0xa'));var ejs=require(_0x228f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x228f('0xc'));var squel=require('squel');var crypto=require(_0x228f('0xd'));var jsforce=require(_0x228f('0xe'));var deskjs=require(_0x228f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x228f('0x10'));var Papa=require('papaparse');var Redis=require(_0x228f('0x11'));var authService=require(_0x228f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x228f('0x13'));var hardwareService=require(_0x228f('0x14'));var logger=require(_0x228f('0x15'))(_0x228f('0x16'));var utils=require(_0x228f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x228f('0x18'));var db=require(_0x228f('0x19'))['db'];function respondWithStatusCode(_0x24f69c,_0x14073a){_0x14073a=_0x14073a||0xcc;return function(_0x2e1a43){if(_0x2e1a43){return _0x24f69c[_0x228f('0x1a')](_0x14073a);}return _0x24f69c[_0x228f('0x1b')](_0x14073a)[_0x228f('0x1c')]();};}function respondWithResult(_0x572535,_0x2fab95){_0x2fab95=_0x2fab95||0xc8;return function(_0xfb6aff){if(_0xfb6aff){return _0x572535[_0x228f('0x1b')](_0x2fab95)[_0x228f('0x1d')](_0xfb6aff);}};}function respondWithFilteredResult(_0x2a4d87,_0x21a913){return function(_0x272723){if(_0x272723){var _0x5b5abb=typeof _0x21a913[_0x228f('0x1e')]==='undefined'&&typeof _0x21a913[_0x228f('0x1f')]===_0x228f('0x20');var _0x195e65=_0x272723['count'];var _0x2d4819=_0x5b5abb?0x0:_0x21a913['offset'];var _0x33e32e=_0x5b5abb?_0x272723['count']:_0x21a913[_0x228f('0x1e')]+_0x21a913['limit'];var _0x5aa203;if(_0x33e32e>=_0x195e65){_0x33e32e=_0x195e65;_0x5aa203=0xc8;}else{_0x5aa203=0xce;}_0x2a4d87[_0x228f('0x1b')](_0x5aa203);return _0x2a4d87['set'](_0x228f('0x21'),_0x2d4819+'-'+_0x33e32e+'/'+_0x195e65)[_0x228f('0x1d')](_0x272723);}return null;};}function patchUpdates(_0x1294a8){return function(_0x3a623a){try{jsonpatch[_0x228f('0x22')](_0x3a623a,_0x1294a8,!![]);}catch(_0x313cf2){return BPromise[_0x228f('0x23')](_0x313cf2);}return _0x3a623a[_0x228f('0x24')]();};}function saveUpdates(_0x15d54f,_0x4ee0c9){return function(_0x1e96d4){if(_0x1e96d4){return _0x1e96d4[_0x228f('0x25')](_0x15d54f)[_0x228f('0x26')](function(_0x3c00ad){return _0x3c00ad;});}return null;};}function removeEntity(_0x1dad27,_0x194d1a){return function(_0x33e882){if(_0x33e882){return _0x33e882[_0x228f('0x27')]()[_0x228f('0x26')](function(){_0x1dad27['status'](0xcc)[_0x228f('0x1c')]();});}};}function handleEntityNotFound(_0x306928,_0x2b3553){return function(_0x272c7d){if(!_0x272c7d){_0x306928[_0x228f('0x1a')](0x194);}return _0x272c7d;};}function handleError(_0x539faa,_0xe8aac){_0xe8aac=_0xe8aac||0x1f4;return function(_0x49efe9){logger[_0x228f('0x28')](_0x49efe9['stack']);if(_0x49efe9['name']){delete _0x49efe9[_0x228f('0x29')];}_0x539faa[_0x228f('0x1b')](_0xe8aac)[_0x228f('0x2a')](_0x49efe9);};}exports[_0x228f('0x2b')]=function(_0x34c735,_0x2c964e){var _0x2eaf4f={},_0x2511e5={},_0xe67c83={'count':0x0,'rows':[]};var _0x2f13d9=_[_0x228f('0x2c')](db[_0x228f('0x2d')][_0x228f('0x2e')],function(_0xc6921f){return{'name':_0xc6921f[_0x228f('0x2f')],'type':_0xc6921f['type'][_0x228f('0x30')]};});_0x2511e5[_0x228f('0x31')]=_[_0x228f('0x2c')](_0x2f13d9,'name');_0x2511e5[_0x228f('0x32')]=_[_0x228f('0x33')](_0x34c735['query']);_0x2511e5[_0x228f('0x34')]=_[_0x228f('0x35')](_0x2511e5[_0x228f('0x31')],_0x2511e5[_0x228f('0x32')]);_0x2eaf4f['attributes']=_[_0x228f('0x35')](_0x2511e5['model'],qs[_0x228f('0x36')](_0x34c735[_0x228f('0x32')][_0x228f('0x36')]));_0x2eaf4f[_0x228f('0x37')]=_0x2eaf4f['attributes'][_0x228f('0x38')]?_0x2eaf4f[_0x228f('0x37')]:_0x2511e5['model'];if(!_0x34c735['query']['hasOwnProperty'](_0x228f('0x39'))){_0x2eaf4f[_0x228f('0x1f')]=qs[_0x228f('0x1f')](_0x34c735[_0x228f('0x32')][_0x228f('0x1f')]);_0x2eaf4f[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0x34c735[_0x228f('0x32')][_0x228f('0x1e')]);}_0x2eaf4f['order']=qs['sort'](_0x34c735[_0x228f('0x32')][_0x228f('0x3a')]);_0x2eaf4f[_0x228f('0x3b')]=qs[_0x228f('0x34')](_[_0x228f('0x3c')](_0x34c735[_0x228f('0x32')],_0x2511e5[_0x228f('0x34')]),_0x2f13d9);if(_0x34c735[_0x228f('0x32')][_0x228f('0x3d')]){_0x2eaf4f[_0x228f('0x3b')]=_['merge'](_0x2eaf4f['where'],{'$or':_[_0x228f('0x2c')](_0x2f13d9,function(_0x29a250){if(_0x29a250[_0x228f('0x3e')]!==_0x228f('0x3f')){var _0x5b7b44={};_0x5b7b44[_0x29a250[_0x228f('0x29')]]={'$like':'%'+_0x34c735[_0x228f('0x32')]['filter']+'%'};return _0x5b7b44;}})});}_0x2eaf4f=_['merge']({},_0x2eaf4f,_0x34c735[_0x228f('0x40')]);var _0x2f6f54={'where':_0x2eaf4f['where']};return db[_0x228f('0x2d')][_0x228f('0x41')](_0x2f6f54)['then'](function(_0x536166){_0xe67c83[_0x228f('0x41')]=_0x536166;if(_0x34c735['query'][_0x228f('0x42')]){_0x2eaf4f[_0x228f('0x43')]=[{'all':!![]}];}return db[_0x228f('0x2d')][_0x228f('0x44')](_0x2eaf4f);})[_0x228f('0x26')](function(_0x20c178){_0xe67c83['rows']=_0x20c178;return _0xe67c83;})[_0x228f('0x26')](respondWithFilteredResult(_0x2c964e,_0x2eaf4f))['catch'](handleError(_0x2c964e,null));};exports[_0x228f('0x45')]=function(_0xc59d9b,_0x285af1){var _0x96126c={'raw':!![],'where':{'id':_0xc59d9b[_0x228f('0x46')]['id']}},_0x41cba5={};_0x41cba5[_0x228f('0x31')]=_[_0x228f('0x33')](db[_0x228f('0x2d')][_0x228f('0x2e')]);_0x41cba5[_0x228f('0x32')]=_[_0x228f('0x33')](_0xc59d9b[_0x228f('0x32')]);_0x41cba5['filters']=_['intersection'](_0x41cba5[_0x228f('0x31')],_0x41cba5[_0x228f('0x32')]);_0x96126c[_0x228f('0x37')]=_[_0x228f('0x35')](_0x41cba5[_0x228f('0x31')],qs[_0x228f('0x36')](_0xc59d9b[_0x228f('0x32')][_0x228f('0x36')]));_0x96126c[_0x228f('0x37')]=_0x96126c[_0x228f('0x37')]['length']?_0x96126c[_0x228f('0x37')]:_0x41cba5[_0x228f('0x31')];if(_0xc59d9b['query'][_0x228f('0x42')]){_0x96126c['include']=[{'all':!![]}];}_0x96126c=_[_0x228f('0x47')]({},_0x96126c,_0xc59d9b['options']);return db[_0x228f('0x2d')]['find'](_0x96126c)[_0x228f('0x26')](handleEntityNotFound(_0x285af1,null))[_0x228f('0x26')](respondWithResult(_0x285af1,null))[_0x228f('0x48')](handleError(_0x285af1,null));};exports[_0x228f('0x49')]=function(_0x3dea4e,_0x2e0054){return db[_0x228f('0x2d')][_0x228f('0x49')](_0x3dea4e[_0x228f('0x4a')],{})[_0x228f('0x26')](respondWithResult(_0x2e0054,0xc9))[_0x228f('0x48')](handleError(_0x2e0054,null));};exports[_0x228f('0x25')]=function(_0x4099d4,_0x250345){if(_0x4099d4[_0x228f('0x4a')]['id']){delete _0x4099d4[_0x228f('0x4a')]['id'];}return db[_0x228f('0x2d')][_0x228f('0x4b')]({'where':{'id':_0x4099d4[_0x228f('0x46')]['id']}})['then'](handleEntityNotFound(_0x250345,null))['then'](saveUpdates(_0x4099d4[_0x228f('0x4a')],null))[_0x228f('0x26')](respondWithResult(_0x250345,null))[_0x228f('0x48')](handleError(_0x250345,null));};exports['destroy']=function(_0x17bcd9,_0x9750ca){return db[_0x228f('0x2d')]['find']({'where':{'id':_0x17bcd9['params']['id']}})['then'](handleEntityNotFound(_0x9750ca,null))[_0x228f('0x26')](removeEntity(_0x9750ca,null))[_0x228f('0x48')](handleError(_0x9750ca,null));};exports[_0x228f('0x4c')]=function(_0x466a2b,_0x42036c){return db[_0x228f('0x2d')][_0x228f('0x4c')]()[_0x228f('0x26')](respondWithResult(_0x42036c,null))[_0x228f('0x48')](handleError(_0x42036c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index af19770..e87c242 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 _0xf9be=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x428a10,_0x3d945c){var _0x2c1cb7=function(_0x386102){while(--_0x386102){_0x428a10['push'](_0x428a10['shift']());}};_0x2c1cb7(++_0x3d945c);}(_0xf9be,0x192));var _0xef9b=function(_0x16bfae,_0x36ed25){_0x16bfae=_0x16bfae-0x0;var _0x3870f5=_0xf9be[_0x16bfae];return _0x3870f5;};'use strict';var _=require('lodash');var util=require(_0xef9b('0x0'));var logger=require(_0xef9b('0x1'))(_0xef9b('0x2'));var moment=require(_0xef9b('0x3'));var BPromise=require(_0xef9b('0x4'));var rp=require(_0xef9b('0x5'));var fs=require('fs');var path=require(_0xef9b('0x6'));var rimraf=require(_0xef9b('0x7'));var config=require(_0xef9b('0x8'));var attributes=require(_0xef9b('0x9'));module['exports']=function(_0x477cf3,_0x4006d7){return _0x477cf3[_0xef9b('0xa')](_0xef9b('0xb'),attributes,{'tableName':_0xef9b('0xc'),'paranoid':![],'indexes':[{'name':_0xef9b('0xd'),'fields':[_0xef9b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f19=['bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','moment'];(function(_0x345126,_0xebc855){var _0x426178=function(_0x28119e){while(--_0x28119e){_0x345126['push'](_0x345126['shift']());}};_0x426178(++_0xebc855);}(_0x6f19,0x195));var _0x96f1=function(_0x32a311,_0x495aa8){_0x32a311=_0x32a311-0x0;var _0x23a7f=_0x6f19[_0x32a311];return _0x23a7f;};'use strict';var _=require(_0x96f1('0x0'));var util=require(_0x96f1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x96f1('0x2'));var BPromise=require(_0x96f1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96f1('0x4'));var rimraf=require(_0x96f1('0x5'));var config=require(_0x96f1('0x6'));var attributes=require(_0x96f1('0x7'));module['exports']=function(_0x2cb3ce,_0x78ac18){return _0x2cb3ce[_0x96f1('0x8')](_0x96f1('0x9'),attributes,{'tableName':_0x96f1('0xa'),'paranoid':![],'indexes':[{'name':_0x96f1('0xb'),'fields':[_0x96f1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 7601389..d3dc4e0 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 _0x95ba=['info','request\x20sent','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','WhatsappQueueReport','create','options','raw','then','CreateWhatsappQueueReport','debug','body','attributes','UpdateWhatsappQueueReport','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x95ba,0x113));var _0xa95b=function(_0x19e79f,_0x4fa9d1){_0x19e79f=_0x19e79f-0x0;var _0xa76de7=_0x95ba[_0x19e79f];return _0xa76de7;};'use strict';var _=require(_0xa95b('0x0'));var util=require(_0xa95b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa95b('0x2'));var fs=require('fs');var Redis=require(_0xa95b('0x3'));var db=require(_0xa95b('0x4'))['db'];var utils=require(_0xa95b('0x5'));var logger=require(_0xa95b('0x6'))(_0xa95b('0x7'));var config=require(_0xa95b('0x8'));var jayson=require(_0xa95b('0x9'));var client=jayson[_0xa95b('0xa')][_0xa95b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cf102,_0x48e00,_0xd8e213){return new BPromise(function(_0x520f9a,_0x57dc2c){return client[_0xa95b('0xc')](_0x5cf102,_0xd8e213)['then'](function(_0x17cf94){logger[_0xa95b('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x48e00,_0xa95b('0xe'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x48e00,_0xa95b('0xe'),JSON['stringify'](_0x17cf94));if(_0x17cf94[_0xa95b('0xf')]){if(_0x17cf94[_0xa95b('0xf')][_0xa95b('0x10')]===0x1f4){logger[_0xa95b('0xf')](_0xa95b('0x11'),_0x48e00,_0x17cf94[_0xa95b('0xf')]['message']);return _0x57dc2c(_0x17cf94[_0xa95b('0xf')]['message']);}logger[_0xa95b('0xf')](_0xa95b('0x11'),_0x48e00,_0x17cf94[_0xa95b('0xf')]['message']);return _0x520f9a(_0x17cf94[_0xa95b('0xf')][_0xa95b('0x12')]);}else{logger[_0xa95b('0xd')](_0xa95b('0x11'),_0x48e00,_0xa95b('0xe'));_0x520f9a(_0x17cf94[_0xa95b('0x13')][_0xa95b('0x12')]);}})[_0xa95b('0x14')](function(_0x3f5228){logger[_0xa95b('0xf')](_0xa95b('0x11'),_0x48e00,_0x3f5228);_0x57dc2c(_0x3f5228);});});}exports['CreateWhatsappQueueReport']=function(_0x1dfd8e){var _0x344a99=this;return new Promise(function(_0x5ee75e,_0x200e10){return db[_0xa95b('0x15')][_0xa95b('0x16')](_0x1dfd8e['body'],{'raw':_0x1dfd8e[_0xa95b('0x17')]?_0x1dfd8e['options'][_0xa95b('0x18')]===undefined?!![]:![]:!![]})[_0xa95b('0x19')](function(_0x591b98){logger[_0xa95b('0xd')](_0xa95b('0x1a'),_0x1dfd8e);logger[_0xa95b('0x1b')]('CreateWhatsappQueueReport',_0x1dfd8e,JSON['stringify'](_0x591b98));_0x5ee75e(_0x591b98);})['catch'](function(_0x2cff47){logger[_0xa95b('0xf')](_0xa95b('0x1a'),_0x2cff47['message'],_0x1dfd8e);_0x200e10(_0x344a99[_0xa95b('0xf')](0x1f4,_0x2cff47[_0xa95b('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1d51bf){var _0x194d61=this;return new Promise(function(_0xe080ed,_0x5cf5ed){return db[_0xa95b('0x15')]['update'](_0x1d51bf[_0xa95b('0x1c')],{'raw':_0x1d51bf['options']?_0x1d51bf[_0xa95b('0x17')][_0xa95b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d51bf[_0xa95b('0x17')]?_0x1d51bf[_0xa95b('0x17')]['where']||null:null,'attributes':_0x1d51bf['options']?_0x1d51bf[_0xa95b('0x17')][_0xa95b('0x1d')]||null:null,'limit':_0x1d51bf[_0xa95b('0x17')]?_0x1d51bf['options']['limit']||null:null})[_0xa95b('0x19')](function(_0x2742a3){logger[_0xa95b('0xd')]('UpdateWhatsappQueueReport',_0x1d51bf);logger[_0xa95b('0x1b')](_0xa95b('0x1e'),_0x1d51bf,JSON[_0xa95b('0x1f')](_0x2742a3));_0xe080ed(_0x2742a3);})['catch'](function(_0x3d619f){logger[_0xa95b('0xf')](_0xa95b('0x1e'),_0x3d619f[_0xa95b('0x12')],_0x1d51bf);_0x5cf5ed(_0x194d61[_0xa95b('0xf')](0x1f4,_0x3d619f[_0xa95b('0x12')]));});});}; \ No newline at end of file +var _0x5453=['CreateWhatsappQueueReport','create','body','options','raw','then','WhatsappQueueReport','update','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x5453,0x18b));var _0x3545=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5453[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var moment=require(_0x3545('0x2'));var BPromise=require(_0x3545('0x3'));var rs=require(_0x3545('0x4'));var fs=require('fs');var Redis=require(_0x3545('0x5'));var db=require(_0x3545('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3545('0x7'));var config=require(_0x3545('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3545('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x290aa5,_0x496d6b,_0x5d5808){return new BPromise(function(_0x2974ae,_0x3cf0cc){return client[_0x3545('0xa')](_0x290aa5,_0x5d5808)['then'](function(_0x21dc51){logger[_0x3545('0xb')](_0x3545('0xc'),_0x496d6b,_0x3545('0xd'));logger[_0x3545('0xe')](_0x3545('0xf'),_0x496d6b,_0x3545('0xd'),JSON['stringify'](_0x21dc51));if(_0x21dc51['error']){if(_0x21dc51[_0x3545('0x10')][_0x3545('0x11')]===0x1f4){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x21dc51['error']['message']);return _0x3cf0cc(_0x21dc51['error'][_0x3545('0x12')]);}logger[_0x3545('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x496d6b,_0x21dc51[_0x3545('0x10')]['message']);return _0x2974ae(_0x21dc51['error'][_0x3545('0x12')]);}else{logger[_0x3545('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x496d6b,_0x3545('0xd'));_0x2974ae(_0x21dc51[_0x3545('0x13')]['message']);}})[_0x3545('0x14')](function(_0x51f69b){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x51f69b);_0x3cf0cc(_0x51f69b);});});}exports[_0x3545('0x15')]=function(_0x2c008a){var _0x4e3c95=this;return new Promise(function(_0x573970,_0x34a7f3){return db['WhatsappQueueReport'][_0x3545('0x16')](_0x2c008a[_0x3545('0x17')],{'raw':_0x2c008a[_0x3545('0x18')]?_0x2c008a[_0x3545('0x18')][_0x3545('0x19')]===undefined?!![]:![]:!![]})[_0x3545('0x1a')](function(_0x10037f){logger[_0x3545('0xb')](_0x3545('0x15'),_0x2c008a);logger[_0x3545('0xe')](_0x3545('0x15'),_0x2c008a,JSON['stringify'](_0x10037f));_0x573970(_0x10037f);})['catch'](function(_0x20800f){logger['error'](_0x3545('0x15'),_0x20800f[_0x3545('0x12')],_0x2c008a);_0x34a7f3(_0x4e3c95['error'](0x1f4,_0x20800f[_0x3545('0x12')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x5de099){var _0x447bb2=this;return new Promise(function(_0x3b421e,_0x5bb284){return db[_0x3545('0x1b')][_0x3545('0x1c')](_0x5de099[_0x3545('0x17')],{'raw':_0x5de099[_0x3545('0x18')]?_0x5de099[_0x3545('0x18')][_0x3545('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de099['options']?_0x5de099[_0x3545('0x18')][_0x3545('0x1d')]||null:null,'attributes':_0x5de099[_0x3545('0x18')]?_0x5de099[_0x3545('0x18')][_0x3545('0x1e')]||null:null,'limit':_0x5de099[_0x3545('0x18')]?_0x5de099[_0x3545('0x18')]['limit']||null:null})[_0x3545('0x1a')](function(_0x500080){logger['info']('UpdateWhatsappQueueReport',_0x5de099);logger['debug'](_0x3545('0x1f'),_0x5de099,JSON['stringify'](_0x500080));_0x3b421e(_0x500080);})[_0x3545('0x14')](function(_0x900e88){logger[_0x3545('0x10')](_0x3545('0x1f'),_0x900e88[_0x3545('0x12')],_0x5de099);_0x5bb284(_0x447bb2[_0x3545('0x10')](0x1f4,_0x900e88[_0x3545('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 9dcf56f..7630956 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 _0x6c52=['./whatsappTransferReport.controller','get','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c192f,_0x282b5a){var _0xfd843=function(_0x5725d5){while(--_0x5725d5){_0x3c192f['push'](_0x3c192f['shift']());}};_0xfd843(++_0x282b5a);}(_0x6c52,0x6e));var _0x26c5=function(_0x3166fc,_0x26cc6b){_0x3166fc=_0x3166fc-0x0;var _0x5d198b=_0x6c52[_0x3166fc];return _0x5d198b;};'use strict';var multer=require(_0x26c5('0x0'));var util=require(_0x26c5('0x1'));var path=require(_0x26c5('0x2'));var timeout=require(_0x26c5('0x3'));var express=require(_0x26c5('0x4'));var router=express[_0x26c5('0x5')]();var fs_extra=require(_0x26c5('0x6'));var auth=require(_0x26c5('0x7'));var interaction=require(_0x26c5('0x8'));var config=require(_0x26c5('0x9'));var controller=require(_0x26c5('0xa'));router[_0x26c5('0xb')]('/',auth['isAuthenticated'](),controller[_0x26c5('0xc')]);router['get'](_0x26c5('0xd'),auth['isAuthenticated'](),controller[_0x26c5('0xe')]);router[_0x26c5('0xb')](_0x26c5('0xf'),auth['isAuthenticated'](),controller[_0x26c5('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x26c5('0x11')](_0x26c5('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x26c5('0x12')](_0x26c5('0xf'),auth['isAuthenticated'](),controller[_0x26c5('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe6e1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','exports','multer','path'];(function(_0x5cb4f0,_0xb16665){var _0x22208=function(_0xa6ac92){while(--_0xa6ac92){_0x5cb4f0['push'](_0x5cb4f0['shift']());}};_0x22208(++_0xb16665);}(_0xe6e1,0x18d));var _0x1e6e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xe6e1[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x1e6e('0x0'));var util=require('util');var path=require(_0x1e6e('0x1'));var timeout=require(_0x1e6e('0x2'));var express=require(_0x1e6e('0x3'));var router=express[_0x1e6e('0x4')]();var fs_extra=require(_0x1e6e('0x5'));var auth=require(_0x1e6e('0x6'));var interaction=require(_0x1e6e('0x7'));var config=require(_0x1e6e('0x8'));var controller=require(_0x1e6e('0x9'));router[_0x1e6e('0xa')]('/',auth[_0x1e6e('0xb')](),controller[_0x1e6e('0xc')]);router[_0x1e6e('0xa')](_0x1e6e('0xd'),auth[_0x1e6e('0xb')](),controller['describe']);router['get'](_0x1e6e('0xe'),auth['isAuthenticated'](),controller[_0x1e6e('0xf')]);router[_0x1e6e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e6e('0x11')](_0x1e6e('0xe'),auth[_0x1e6e('0xb')](),controller['update']);router['delete'](_0x1e6e('0xe'),auth[_0x1e6e('0xb')](),controller['destroy']);module[_0x1e6e('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index e821ff5..97f439d 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 _0x0ffc=['account','queue','DATE','exports','STRING'];(function(_0xe74ea6,_0x461881){var _0x133ecd=function(_0x5d9796){while(--_0x5d9796){_0xe74ea6['push'](_0xe74ea6['shift']());}};_0x133ecd(++_0x461881);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x3d47eb,_0x57b1ef){_0x3d47eb=_0x3d47eb-0x0;var _0x4532e2=_0x0ffc[_0x3d47eb];return _0x4532e2;};'use strict';var Sequelize=require('sequelize');module[_0xc0ff('0x0')]={'uniqueid':{'type':Sequelize[_0xc0ff('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc0ff('0x2'),'agent',_0xc0ff('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xc0ff('0x4')]}}; \ No newline at end of file +var _0xd26f=['exports','account','agent','queue','DATE','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd26f,0x113));var _0xfd26=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xd26f[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfd26('0x2'),_0xfd26('0x3'),_0xfd26('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfd26('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f5ab26c..ffd8ce9 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 _0x3cdd=['sort','filters','pick','filter','where','merge','options','WhatsappTransferReport','includeAll','include','findAll','then','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','end','error','name','index','rawAttributes','type','key','map','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x2692f9,_0x51138a){var _0x9831c8=function(_0x112bbd){while(--_0x112bbd){_0x2692f9['push'](_0x2692f9['shift']());}};_0x9831c8(++_0x51138a);}(_0x3cdd,0xb5));var _0xd3cd=function(_0x405142,_0x5525c4){_0x405142=_0x405142-0x0;var _0x2a57b2=_0x3cdd[_0x405142];return _0x2a57b2;};'use strict';var emlformat=require(_0xd3cd('0x0'));var rimraf=require(_0xd3cd('0x1'));var zipdir=require(_0xd3cd('0x2'));var jsonpatch=require(_0xd3cd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd3cd('0x4'));var Mustache=require(_0xd3cd('0x5'));var util=require(_0xd3cd('0x6'));var path=require(_0xd3cd('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd3cd('0x8'));var fs=require('fs');var fs_extra=require(_0xd3cd('0x9'));var _=require('lodash');var squel=require(_0xd3cd('0xa'));var crypto=require(_0xd3cd('0xb'));var jsforce=require(_0xd3cd('0xc'));var deskjs=require(_0xd3cd('0xd'));var toCsv=require(_0xd3cd('0xe'));var querystring=require(_0xd3cd('0xf'));var Papa=require(_0xd3cd('0x10'));var Redis=require(_0xd3cd('0x11'));var authService=require(_0xd3cd('0x12'));var qs=require(_0xd3cd('0x13'));var as=require(_0xd3cd('0x14'));var hardwareService=require(_0xd3cd('0x15'));var logger=require(_0xd3cd('0x16'))(_0xd3cd('0x17'));var utils=require(_0xd3cd('0x18'));var config=require(_0xd3cd('0x19'));var licenseUtil=require(_0xd3cd('0x1a'));var db=require(_0xd3cd('0x1b'))['db'];function respondWithStatusCode(_0x307cc2,_0x1580b9){_0x1580b9=_0x1580b9||0xcc;return function(_0x4c5d66){if(_0x4c5d66){return _0x307cc2[_0xd3cd('0x1c')](_0x1580b9);}return _0x307cc2[_0xd3cd('0x1d')](_0x1580b9)['end']();};}function respondWithResult(_0x5dcfd7,_0x390ee4){_0x390ee4=_0x390ee4||0xc8;return function(_0x1deb88){if(_0x1deb88){return _0x5dcfd7[_0xd3cd('0x1d')](_0x390ee4)[_0xd3cd('0x1e')](_0x1deb88);}};}function respondWithFilteredResult(_0x3f4a73,_0x3e2b15){return function(_0x474dcc){if(_0x474dcc){var _0x159683=typeof _0x3e2b15[_0xd3cd('0x1f')]===_0xd3cd('0x20')&&typeof _0x3e2b15[_0xd3cd('0x21')]===_0xd3cd('0x20');var _0x1c7af8=_0x474dcc['count'];var _0x56fdba=_0x159683?0x0:_0x3e2b15['offset'];var _0x861d67=_0x159683?_0x474dcc[_0xd3cd('0x22')]:_0x3e2b15[_0xd3cd('0x1f')]+_0x3e2b15[_0xd3cd('0x21')];var _0x1ef6d1;if(_0x861d67>=_0x1c7af8){_0x861d67=_0x1c7af8;_0x1ef6d1=0xc8;}else{_0x1ef6d1=0xce;}_0x3f4a73[_0xd3cd('0x1d')](_0x1ef6d1);return _0x3f4a73[_0xd3cd('0x23')](_0xd3cd('0x24'),_0x56fdba+'-'+_0x861d67+'/'+_0x1c7af8)[_0xd3cd('0x1e')](_0x474dcc);}return null;};}function patchUpdates(_0x2e43ac){return function(_0x2ea280){try{jsonpatch[_0xd3cd('0x25')](_0x2ea280,_0x2e43ac,!![]);}catch(_0x1063f6){return BPromise[_0xd3cd('0x26')](_0x1063f6);}return _0x2ea280[_0xd3cd('0x27')]();};}function saveUpdates(_0x115a2,_0x5e354d){return function(_0x293f4e){if(_0x293f4e){return _0x293f4e[_0xd3cd('0x28')](_0x115a2)['then'](function(_0x152c17){return _0x152c17;});}return null;};}function removeEntity(_0x182e72,_0x511bbb){return function(_0x4f24b6){if(_0x4f24b6){return _0x4f24b6['destroy']()['then'](function(){_0x182e72[_0xd3cd('0x1d')](0xcc)[_0xd3cd('0x29')]();});}};}function handleEntityNotFound(_0x55a3cf,_0x2b7e69){return function(_0x28ceac){if(!_0x28ceac){_0x55a3cf['sendStatus'](0x194);}return _0x28ceac;};}function handleError(_0x4679b3,_0x2598a3){_0x2598a3=_0x2598a3||0x1f4;return function(_0x2e183c){logger[_0xd3cd('0x2a')](_0x2e183c['stack']);if(_0x2e183c[_0xd3cd('0x2b')]){delete _0x2e183c[_0xd3cd('0x2b')];}_0x4679b3[_0xd3cd('0x1d')](_0x2598a3)['send'](_0x2e183c);};}exports[_0xd3cd('0x2c')]=function(_0x483bf1,_0x2364ab){var _0x292977={},_0x5dbccf={},_0x2b3ea5={'count':0x0,'rows':[]};var _0x5dcbe8=_['map'](db['WhatsappTransferReport'][_0xd3cd('0x2d')],function(_0x8b03f9){return{'name':_0x8b03f9['fieldName'],'type':_0x8b03f9[_0xd3cd('0x2e')][_0xd3cd('0x2f')]};});_0x5dbccf['model']=_[_0xd3cd('0x30')](_0x5dcbe8,_0xd3cd('0x2b'));_0x5dbccf['query']=_[_0xd3cd('0x31')](_0x483bf1[_0xd3cd('0x32')]);_0x5dbccf['filters']=_[_0xd3cd('0x33')](_0x5dbccf[_0xd3cd('0x34')],_0x5dbccf['query']);_0x292977['attributes']=_[_0xd3cd('0x33')](_0x5dbccf['model'],qs[_0xd3cd('0x35')](_0x483bf1[_0xd3cd('0x32')][_0xd3cd('0x35')]));_0x292977[_0xd3cd('0x36')]=_0x292977[_0xd3cd('0x36')][_0xd3cd('0x37')]?_0x292977[_0xd3cd('0x36')]:_0x5dbccf[_0xd3cd('0x34')];if(!_0x483bf1[_0xd3cd('0x32')][_0xd3cd('0x38')](_0xd3cd('0x39'))){_0x292977['limit']=qs['limit'](_0x483bf1[_0xd3cd('0x32')][_0xd3cd('0x21')]);_0x292977[_0xd3cd('0x1f')]=qs['offset'](_0x483bf1[_0xd3cd('0x32')]['offset']);}_0x292977[_0xd3cd('0x3a')]=qs[_0xd3cd('0x3b')](_0x483bf1['query'][_0xd3cd('0x3b')]);_0x292977['where']=qs[_0xd3cd('0x3c')](_[_0xd3cd('0x3d')](_0x483bf1['query'],_0x5dbccf[_0xd3cd('0x3c')]),_0x5dcbe8);if(_0x483bf1[_0xd3cd('0x32')][_0xd3cd('0x3e')]){_0x292977[_0xd3cd('0x3f')]=_['merge'](_0x292977[_0xd3cd('0x3f')],{'$or':_[_0xd3cd('0x30')](_0x5dcbe8,function(_0x21824d){if(_0x21824d[_0xd3cd('0x2e')]!=='VIRTUAL'){var _0x2aad88={};_0x2aad88[_0x21824d[_0xd3cd('0x2b')]]={'$like':'%'+_0x483bf1[_0xd3cd('0x32')]['filter']+'%'};return _0x2aad88;}})});}_0x292977=_[_0xd3cd('0x40')]({},_0x292977,_0x483bf1[_0xd3cd('0x41')]);var _0x450e31={'where':_0x292977[_0xd3cd('0x3f')]};return db[_0xd3cd('0x42')]['count'](_0x450e31)['then'](function(_0x1e6ae1){_0x2b3ea5[_0xd3cd('0x22')]=_0x1e6ae1;if(_0x483bf1[_0xd3cd('0x32')][_0xd3cd('0x43')]){_0x292977[_0xd3cd('0x44')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xd3cd('0x45')](_0x292977);})[_0xd3cd('0x46')](function(_0x547950){_0x2b3ea5[_0xd3cd('0x47')]=_0x547950;return _0x2b3ea5;})[_0xd3cd('0x46')](respondWithFilteredResult(_0x2364ab,_0x292977))[_0xd3cd('0x48')](handleError(_0x2364ab,null));};exports[_0xd3cd('0x49')]=function(_0x7903cd,_0x41fdd6){var _0x3a01e0={'raw':!![],'where':{'id':_0x7903cd[_0xd3cd('0x4a')]['id']}},_0x2b2789={};_0x2b2789['model']=_['keys'](db[_0xd3cd('0x42')][_0xd3cd('0x2d')]);_0x2b2789[_0xd3cd('0x32')]=_['keys'](_0x7903cd[_0xd3cd('0x32')]);_0x2b2789['filters']=_[_0xd3cd('0x33')](_0x2b2789[_0xd3cd('0x34')],_0x2b2789[_0xd3cd('0x32')]);_0x3a01e0[_0xd3cd('0x36')]=_[_0xd3cd('0x33')](_0x2b2789['model'],qs['fields'](_0x7903cd[_0xd3cd('0x32')][_0xd3cd('0x35')]));_0x3a01e0['attributes']=_0x3a01e0['attributes'][_0xd3cd('0x37')]?_0x3a01e0[_0xd3cd('0x36')]:_0x2b2789[_0xd3cd('0x34')];if(_0x7903cd['query']['includeAll']){_0x3a01e0[_0xd3cd('0x44')]=[{'all':!![]}];}_0x3a01e0=_[_0xd3cd('0x40')]({},_0x3a01e0,_0x7903cd[_0xd3cd('0x41')]);return db[_0xd3cd('0x42')]['find'](_0x3a01e0)[_0xd3cd('0x46')](handleEntityNotFound(_0x41fdd6,null))[_0xd3cd('0x46')](respondWithResult(_0x41fdd6,null))[_0xd3cd('0x48')](handleError(_0x41fdd6,null));};exports['create']=function(_0x59537a,_0x258123){return db['WhatsappTransferReport'][_0xd3cd('0x4b')](_0x59537a['body'],{})[_0xd3cd('0x46')](respondWithResult(_0x258123,0xc9))[_0xd3cd('0x48')](handleError(_0x258123,null));};exports[_0xd3cd('0x28')]=function(_0x50d96d,_0x520a29){if(_0x50d96d[_0xd3cd('0x4c')]['id']){delete _0x50d96d[_0xd3cd('0x4c')]['id'];}return db[_0xd3cd('0x42')][_0xd3cd('0x4d')]({'where':{'id':_0x50d96d[_0xd3cd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x520a29,null))[_0xd3cd('0x46')](saveUpdates(_0x50d96d['body'],null))['then'](respondWithResult(_0x520a29,null))[_0xd3cd('0x48')](handleError(_0x520a29,null));};exports[_0xd3cd('0x4e')]=function(_0x4ffdde,_0x52d734){return db[_0xd3cd('0x42')]['find']({'where':{'id':_0x4ffdde[_0xd3cd('0x4a')]['id']}})[_0xd3cd('0x46')](handleEntityNotFound(_0x52d734,null))[_0xd3cd('0x46')](removeEntity(_0x52d734,null))[_0xd3cd('0x48')](handleError(_0x52d734,null));};exports[_0xd3cd('0x4f')]=function(_0xee9238,_0xe50480){return db[_0xd3cd('0x42')][_0xd3cd('0x4f')]()[_0xd3cd('0x46')](respondWithResult(_0xe50480,null))[_0xd3cd('0x48')](handleError(_0xe50480,null));}; \ No newline at end of file +var _0xf1a2=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','save','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','then','includeAll','include','WhatsappTransferReport','catch','show','params','create','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0xf1a2,0x1f0));var _0x2f1a=function(_0x3e00c7,_0x1f696f){_0x3e00c7=_0x3e00c7-0x0;var _0x22526a=_0xf1a2[_0x3e00c7];return _0x22526a;};'use strict';var emlformat=require(_0x2f1a('0x0'));var rimraf=require(_0x2f1a('0x1'));var zipdir=require(_0x2f1a('0x2'));var jsonpatch=require(_0x2f1a('0x3'));var rp=require(_0x2f1a('0x4'));var moment=require(_0x2f1a('0x5'));var BPromise=require(_0x2f1a('0x6'));var Mustache=require(_0x2f1a('0x7'));var util=require(_0x2f1a('0x8'));var path=require('path');var sox=require(_0x2f1a('0x9'));var csv=require(_0x2f1a('0xa'));var ejs=require(_0x2f1a('0xb'));var fs=require('fs');var fs_extra=require(_0x2f1a('0xc'));var _=require(_0x2f1a('0xd'));var squel=require(_0x2f1a('0xe'));var crypto=require('crypto');var jsforce=require(_0x2f1a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2f1a('0xa'));var querystring=require('querystring');var Papa=require(_0x2f1a('0x10'));var Redis=require(_0x2f1a('0x11'));var authService=require(_0x2f1a('0x12'));var qs=require(_0x2f1a('0x13'));var as=require(_0x2f1a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f1a('0x15'))(_0x2f1a('0x16'));var utils=require(_0x2f1a('0x17'));var config=require(_0x2f1a('0x18'));var licenseUtil=require(_0x2f1a('0x19'));var db=require(_0x2f1a('0x1a'))['db'];function respondWithStatusCode(_0x1083e9,_0xcb6ee){_0xcb6ee=_0xcb6ee||0xcc;return function(_0x51827b){if(_0x51827b){return _0x1083e9[_0x2f1a('0x1b')](_0xcb6ee);}return _0x1083e9[_0x2f1a('0x1c')](_0xcb6ee)[_0x2f1a('0x1d')]();};}function respondWithResult(_0x261db9,_0x4301cf){_0x4301cf=_0x4301cf||0xc8;return function(_0x2905e2){if(_0x2905e2){return _0x261db9[_0x2f1a('0x1c')](_0x4301cf)['json'](_0x2905e2);}};}function respondWithFilteredResult(_0x458929,_0xd9a9a){return function(_0x1b7785){if(_0x1b7785){var _0x57467e=typeof _0xd9a9a[_0x2f1a('0x1e')]===_0x2f1a('0x1f')&&typeof _0xd9a9a[_0x2f1a('0x20')]===_0x2f1a('0x1f');var _0x1d4efa=_0x1b7785[_0x2f1a('0x21')];var _0x2cb7af=_0x57467e?0x0:_0xd9a9a[_0x2f1a('0x1e')];var _0x4537f9=_0x57467e?_0x1b7785[_0x2f1a('0x21')]:_0xd9a9a['offset']+_0xd9a9a[_0x2f1a('0x20')];var _0x440f68;if(_0x4537f9>=_0x1d4efa){_0x4537f9=_0x1d4efa;_0x440f68=0xc8;}else{_0x440f68=0xce;}_0x458929[_0x2f1a('0x1c')](_0x440f68);return _0x458929['set'](_0x2f1a('0x22'),_0x2cb7af+'-'+_0x4537f9+'/'+_0x1d4efa)['json'](_0x1b7785);}return null;};}function patchUpdates(_0x1b8016){return function(_0x1c00c3){try{jsonpatch[_0x2f1a('0x23')](_0x1c00c3,_0x1b8016,!![]);}catch(_0x3da4a2){return BPromise['reject'](_0x3da4a2);}return _0x1c00c3[_0x2f1a('0x24')]();};}function saveUpdates(_0x39ddc8,_0x488b7d){return function(_0x3f7c84){if(_0x3f7c84){return _0x3f7c84['update'](_0x39ddc8)['then'](function(_0x1100b3){return _0x1100b3;});}return null;};}function removeEntity(_0x393781,_0x39f3d1){return function(_0x3c8d9b){if(_0x3c8d9b){return _0x3c8d9b['destroy']()['then'](function(){_0x393781[_0x2f1a('0x1c')](0xcc)[_0x2f1a('0x1d')]();});}};}function handleEntityNotFound(_0x2bf848,_0x37bf46){return function(_0x3bc430){if(!_0x3bc430){_0x2bf848['sendStatus'](0x194);}return _0x3bc430;};}function handleError(_0xa3311a,_0x5a3580){_0x5a3580=_0x5a3580||0x1f4;return function(_0x182357){logger['error'](_0x182357[_0x2f1a('0x25')]);if(_0x182357[_0x2f1a('0x26')]){delete _0x182357['name'];}_0xa3311a[_0x2f1a('0x1c')](_0x5a3580)[_0x2f1a('0x27')](_0x182357);};}exports['index']=function(_0x4b677a,_0x2ab0ed){var _0x24c267={},_0x22d28d={},_0x109a47={'count':0x0,'rows':[]};var _0x47dbfc=_[_0x2f1a('0x28')](db['WhatsappTransferReport'][_0x2f1a('0x29')],function(_0x3fe710){return{'name':_0x3fe710['fieldName'],'type':_0x3fe710[_0x2f1a('0x2a')][_0x2f1a('0x2b')]};});_0x22d28d[_0x2f1a('0x2c')]=_['map'](_0x47dbfc,_0x2f1a('0x26'));_0x22d28d[_0x2f1a('0x2d')]=_[_0x2f1a('0x2e')](_0x4b677a[_0x2f1a('0x2d')]);_0x22d28d[_0x2f1a('0x2f')]=_['intersection'](_0x22d28d['model'],_0x22d28d[_0x2f1a('0x2d')]);_0x24c267[_0x2f1a('0x30')]=_[_0x2f1a('0x31')](_0x22d28d[_0x2f1a('0x2c')],qs[_0x2f1a('0x32')](_0x4b677a[_0x2f1a('0x2d')]['fields']));_0x24c267['attributes']=_0x24c267[_0x2f1a('0x30')][_0x2f1a('0x33')]?_0x24c267[_0x2f1a('0x30')]:_0x22d28d[_0x2f1a('0x2c')];if(!_0x4b677a[_0x2f1a('0x2d')][_0x2f1a('0x34')](_0x2f1a('0x35'))){_0x24c267[_0x2f1a('0x20')]=qs[_0x2f1a('0x20')](_0x4b677a['query'][_0x2f1a('0x20')]);_0x24c267[_0x2f1a('0x1e')]=qs[_0x2f1a('0x1e')](_0x4b677a[_0x2f1a('0x2d')]['offset']);}_0x24c267['order']=qs[_0x2f1a('0x36')](_0x4b677a[_0x2f1a('0x2d')]['sort']);_0x24c267['where']=qs[_0x2f1a('0x2f')](_[_0x2f1a('0x37')](_0x4b677a[_0x2f1a('0x2d')],_0x22d28d['filters']),_0x47dbfc);if(_0x4b677a[_0x2f1a('0x2d')]['filter']){_0x24c267['where']=_[_0x2f1a('0x38')](_0x24c267[_0x2f1a('0x39')],{'$or':_[_0x2f1a('0x28')](_0x47dbfc,function(_0x2a6a57){if(_0x2a6a57[_0x2f1a('0x2a')]!==_0x2f1a('0x3a')){var _0x29d6d4={};_0x29d6d4[_0x2a6a57[_0x2f1a('0x26')]]={'$like':'%'+_0x4b677a[_0x2f1a('0x2d')][_0x2f1a('0x3b')]+'%'};return _0x29d6d4;}})});}_0x24c267=_[_0x2f1a('0x38')]({},_0x24c267,_0x4b677a[_0x2f1a('0x3c')]);var _0x16e66e={'where':_0x24c267[_0x2f1a('0x39')]};return db['WhatsappTransferReport'][_0x2f1a('0x21')](_0x16e66e)[_0x2f1a('0x3d')](function(_0x544695){_0x109a47[_0x2f1a('0x21')]=_0x544695;if(_0x4b677a['query'][_0x2f1a('0x3e')]){_0x24c267[_0x2f1a('0x3f')]=[{'all':!![]}];}return db[_0x2f1a('0x40')]['findAll'](_0x24c267);})[_0x2f1a('0x3d')](function(_0x237bdb){_0x109a47['rows']=_0x237bdb;return _0x109a47;})[_0x2f1a('0x3d')](respondWithFilteredResult(_0x2ab0ed,_0x24c267))[_0x2f1a('0x41')](handleError(_0x2ab0ed,null));};exports[_0x2f1a('0x42')]=function(_0x41d2c6,_0xa459da){var _0x429a7e={'raw':!![],'where':{'id':_0x41d2c6[_0x2f1a('0x43')]['id']}},_0x42146e={};_0x42146e['model']=_['keys'](db[_0x2f1a('0x40')][_0x2f1a('0x29')]);_0x42146e[_0x2f1a('0x2d')]=_[_0x2f1a('0x2e')](_0x41d2c6[_0x2f1a('0x2d')]);_0x42146e[_0x2f1a('0x2f')]=_[_0x2f1a('0x31')](_0x42146e[_0x2f1a('0x2c')],_0x42146e['query']);_0x429a7e[_0x2f1a('0x30')]=_['intersection'](_0x42146e[_0x2f1a('0x2c')],qs[_0x2f1a('0x32')](_0x41d2c6['query'][_0x2f1a('0x32')]));_0x429a7e['attributes']=_0x429a7e[_0x2f1a('0x30')][_0x2f1a('0x33')]?_0x429a7e[_0x2f1a('0x30')]:_0x42146e[_0x2f1a('0x2c')];if(_0x41d2c6[_0x2f1a('0x2d')]['includeAll']){_0x429a7e['include']=[{'all':!![]}];}_0x429a7e=_[_0x2f1a('0x38')]({},_0x429a7e,_0x41d2c6[_0x2f1a('0x3c')]);return db[_0x2f1a('0x40')]['find'](_0x429a7e)[_0x2f1a('0x3d')](handleEntityNotFound(_0xa459da,null))[_0x2f1a('0x3d')](respondWithResult(_0xa459da,null))[_0x2f1a('0x41')](handleError(_0xa459da,null));};exports[_0x2f1a('0x44')]=function(_0x319fa1,_0x1c454d){return db['WhatsappTransferReport'][_0x2f1a('0x44')](_0x319fa1['body'],{})['then'](respondWithResult(_0x1c454d,0xc9))[_0x2f1a('0x41')](handleError(_0x1c454d,null));};exports[_0x2f1a('0x45')]=function(_0x39fcd4,_0x363f02){if(_0x39fcd4[_0x2f1a('0x46')]['id']){delete _0x39fcd4[_0x2f1a('0x46')]['id'];}return db[_0x2f1a('0x40')][_0x2f1a('0x47')]({'where':{'id':_0x39fcd4[_0x2f1a('0x43')]['id']}})['then'](handleEntityNotFound(_0x363f02,null))[_0x2f1a('0x3d')](saveUpdates(_0x39fcd4[_0x2f1a('0x46')],null))[_0x2f1a('0x3d')](respondWithResult(_0x363f02,null))['catch'](handleError(_0x363f02,null));};exports[_0x2f1a('0x48')]=function(_0x4c65de,_0x47a01e){return db['WhatsappTransferReport']['find']({'where':{'id':_0x4c65de[_0x2f1a('0x43')]['id']}})['then'](handleEntityNotFound(_0x47a01e,null))['then'](removeEntity(_0x47a01e,null))[_0x2f1a('0x41')](handleError(_0x47a01e,null));};exports[_0x2f1a('0x49')]=function(_0x4cbefe,_0xbb5336){return db[_0x2f1a('0x40')]['describe']()[_0x2f1a('0x3d')](respondWithResult(_0xbb5336,null))[_0x2f1a('0x41')](handleError(_0xbb5336,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 508d597..7c2aa6a 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 _0x5481=['uniqueid','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x5094fc,_0x161ded){var _0x1fe781=function(_0x1fb984){while(--_0x1fb984){_0x5094fc['push'](_0x5094fc['shift']());}};_0x1fe781(++_0x161ded);}(_0x5481,0x6f));var _0x1548=function(_0x534462,_0x502972){_0x534462=_0x534462-0x0;var _0x41c5dd=_0x5481[_0x534462];return _0x41c5dd;};'use strict';var _=require('lodash');var util=require(_0x1548('0x0'));var logger=require(_0x1548('0x1'))(_0x1548('0x2'));var moment=require(_0x1548('0x3'));var BPromise=require('bluebird');var rp=require(_0x1548('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1548('0x5'));var config=require(_0x1548('0x6'));var attributes=require(_0x1548('0x7'));module[_0x1548('0x8')]=function(_0x49d320,_0x4a2a47){return _0x49d320['define']('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1548('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01e1=['request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','bluebird'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x01e1,0x8c));var _0x101e=function(_0x57d863,_0x4f77a1){_0x57d863=_0x57d863-0x0;var _0x1bbdb5=_0x01e1[_0x57d863];return _0x1bbdb5;};'use strict';var _=require('lodash');var util=require(_0x101e('0x0'));var logger=require(_0x101e('0x1'))(_0x101e('0x2'));var moment=require('moment');var BPromise=require(_0x101e('0x3'));var rp=require(_0x101e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x101e('0x5'));var config=require(_0x101e('0x6'));var attributes=require(_0x101e('0x7'));module['exports']=function(_0x41d720,_0x542eb0){return _0x41d720[_0x101e('0x8')](_0x101e('0x9'),attributes,{'tableName':_0x101e('0xa'),'paranoid':![],'indexes':[{'name':_0x101e('0xb'),'fields':[_0x101e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 732e214..4a6ef92 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 _0xea5f=['../../config/environment','jayson/promise','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x65f116,_0x55f9b5){var _0x3a08c6=function(_0x3ae98f){while(--_0x3ae98f){_0x65f116['push'](_0x65f116['shift']());}};_0x3a08c6(++_0x55f9b5);}(_0xea5f,0xf1));var _0xfea5=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xea5f[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xfea5('0x0'));var util=require(_0xfea5('0x1'));var moment=require('moment');var BPromise=require(_0xfea5('0x2'));var rs=require(_0xfea5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfea5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfea5('0x5'));var config=require(_0xfea5('0x6'));var jayson=require(_0xfea5('0x7'));var client=jayson['client'][_0xfea5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37a906,_0x1c5c47,_0x23a488){return new BPromise(function(_0x3b3798,_0x545074){return client[_0xfea5('0x9')](_0x37a906,_0x23a488)['then'](function(_0x4cbedf){logger[_0xfea5('0xa')](_0xfea5('0xb'),_0x1c5c47,_0xfea5('0xc'));logger[_0xfea5('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x1c5c47,'request\x20sent',JSON[_0xfea5('0xe')](_0x4cbedf));if(_0x4cbedf[_0xfea5('0xf')]){if(_0x4cbedf[_0xfea5('0xf')][_0xfea5('0x10')]===0x1f4){logger['error'](_0xfea5('0xb'),_0x1c5c47,_0x4cbedf[_0xfea5('0xf')]['message']);return _0x545074(_0x4cbedf['error']['message']);}logger[_0xfea5('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1c5c47,_0x4cbedf[_0xfea5('0xf')]['message']);return _0x3b3798(_0x4cbedf[_0xfea5('0xf')]['message']);}else{logger[_0xfea5('0xa')](_0xfea5('0xb'),_0x1c5c47,_0xfea5('0xc'));_0x3b3798(_0x4cbedf['result'][_0xfea5('0x11')]);}})[_0xfea5('0x12')](function(_0x2c41b8){logger[_0xfea5('0xf')](_0xfea5('0xb'),_0x1c5c47,_0x2c41b8);_0x545074(_0x2c41b8);});});} \ No newline at end of file +var _0x275c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x20e9fe,_0x56b18d){var _0x16c8de=function(_0x1fbd12){while(--_0x1fbd12){_0x20e9fe['push'](_0x20e9fe['shift']());}};_0x16c8de(++_0x56b18d);}(_0x275c,0x7e));var _0xc275=function(_0x403c2f,_0x2f8a78){_0x403c2f=_0x403c2f-0x0;var _0x5f3be2=_0x275c[_0x403c2f];return _0x5f3be2;};'use strict';var _=require(_0xc275('0x0'));var util=require(_0xc275('0x1'));var moment=require(_0xc275('0x2'));var BPromise=require('bluebird');var rs=require(_0xc275('0x3'));var fs=require('fs');var Redis=require(_0xc275('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc275('0x5'));var logger=require(_0xc275('0x6'))(_0xc275('0x7'));var config=require(_0xc275('0x8'));var jayson=require(_0xc275('0x9'));var client=jayson[_0xc275('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28e2f4,_0x21dbef,_0x1dbfb5){return new BPromise(function(_0x516eb8,_0x58fdae){return client[_0xc275('0xb')](_0x28e2f4,_0x1dbfb5)['then'](function(_0x3e9cb3){logger[_0xc275('0xc')](_0xc275('0xd'),_0x21dbef,'request\x20sent');logger[_0xc275('0xe')](_0xc275('0xf'),_0x21dbef,_0xc275('0x10'),JSON['stringify'](_0x3e9cb3));if(_0x3e9cb3[_0xc275('0x11')]){if(_0x3e9cb3['error'][_0xc275('0x12')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x21dbef,_0x3e9cb3[_0xc275('0x11')][_0xc275('0x13')]);return _0x58fdae(_0x3e9cb3['error']['message']);}logger[_0xc275('0x11')](_0xc275('0xd'),_0x21dbef,_0x3e9cb3[_0xc275('0x11')][_0xc275('0x13')]);return _0x516eb8(_0x3e9cb3[_0xc275('0x11')][_0xc275('0x13')]);}else{logger[_0xc275('0xc')](_0xc275('0xd'),_0x21dbef,'request\x20sent');_0x516eb8(_0x3e9cb3[_0xc275('0x14')][_0xc275('0x13')]);}})[_0xc275('0x15')](function(_0x435c8c){logger[_0xc275('0x11')](_0xc275('0xd'),_0x21dbef,_0x435c8c);_0x58fdae(_0x435c8c);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 03324d3..a1c496c 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1ffe=['catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','online','join','Offline\x20apps:','status','name','None','log','App\x20Ready!'];(function(_0x442418,_0x3a39d1){var _0x5c4a8a=function(_0x15364e){while(--_0x15364e){_0x442418['push'](_0x442418['shift']());}};_0x5c4a8a(++_0x3a39d1);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x4fb375,_0x9b1bea){_0x4fb375=_0x4fb375-0x0;var _0x304fa8=_0x1ffe[_0x4fb375];return _0x304fa8;};'use strict';var _=require(_0xe1ff('0x0'));var db=require(_0xe1ff('0x1'))['db'];var seedDb=require(_0xe1ff('0x2'));var checkLicense=require(_0xe1ff('0x3'));var rpc=require(_0xe1ff('0x4'));var config=require(_0xe1ff('0x5'));var logger=require(_0xe1ff('0x6'))(_0xe1ff('0x7'));var pm2=require(_0xe1ff('0x8'));var pm2Config=require(_0xe1ff('0x9'));var schedule=require(_0xe1ff('0xa'));var chat=require(_0xe1ff('0xb'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');var provider=require(_0xe1ff('0xc'));function main(){return db[_0xe1ff('0xd')][_0xe1ff('0xe')]()[_0xe1ff('0xf')](function(){if(config[_0xe1ff('0x10')]){return seedDb[_0xe1ff('0x11')]();}})[_0xe1ff('0xf')](function(){return checkLicense[_0xe1ff('0x11')]();})[_0xe1ff('0xf')](function(){return rpc[_0xe1ff('0x12')]();})[_0xe1ff('0xf')](function(_0x5f51d3){logger[_0xe1ff('0x13')](_0x5f51d3);return chat[_0xe1ff('0x14')]();})[_0xe1ff('0xf')](function(){return whatsapp[_0xe1ff('0x14')]();})[_0xe1ff('0xf')](function(){return schedule[_0xe1ff('0x14')]();})[_0xe1ff('0xf')](function(){return transcribe[_0xe1ff('0x14')]();})[_0xe1ff('0xf')](function(){return provider[_0xe1ff('0x14')]();})[_0xe1ff('0xf')](function(_0x1010ef){logger['info'](_0x1010ef);return pm2[_0xe1ff('0x14')](pm2Config);})[_0xe1ff('0xf')](function(_0x26511f){var _0x486942=_0x26511f[_0xe1ff('0x15')](function(_0x45597a){return typeof _0x45597a['exitCode']==='number'&&_0x45597a['exitCode']>=0x0;});if(_0x486942[_0xe1ff('0x16')]>0x0){throw new Error(_0x486942[_0xe1ff('0x16')]+_0xe1ff('0x17')+_[_0xe1ff('0x18')](_0x486942,function(_0x45c3be){return'\x22'+_0x45c3be[_0xe1ff('0x19')]['name']+'\x22';}));}logger['info'](_0xe1ff('0x1a'),_[_0xe1ff('0x18')](_[_0xe1ff('0x15')](_0x26511f,{'status':_0xe1ff('0x1b')}),'name')[_0xe1ff('0x1c')]());logger[_0xe1ff('0x13')](_0xe1ff('0x1d'),_[_0xe1ff('0x18')](_[_0xe1ff('0x15')](_0x26511f,function(_0x149cd7){return _0x149cd7[_0xe1ff('0x1e')]!==_0xe1ff('0x1b');}),_0xe1ff('0x1f'))[_0xe1ff('0x1c')]()||_0xe1ff('0x20'));console[_0xe1ff('0x21')](_0xe1ff('0x22'));})[_0xe1ff('0x23')](function(_0x37face){console[_0xe1ff('0x21')](_0xe1ff('0x24'),_0x37face);logger[_0xe1ff('0x25')](_0xe1ff('0x26'),_0x37face);process[_0xe1ff('0x27')](0x1);});}main(); \ No newline at end of file +var _0x7250=['./config/schedule/transcribe','sequelize','sync','seedDB','default','then','listen','info','start','filter','exitCode','number','length','map','Online\x20apps:','online','name','join','Offline\x20apps:','status','None','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule'];(function(_0x127d0b,_0x29299d){var _0x23577e=function(_0x46c41a){while(--_0x46c41a){_0x127d0b['push'](_0x127d0b['shift']());}};_0x23577e(++_0x29299d);}(_0x7250,0x1b1));var _0x0725=function(_0x32f105,_0x44ae06){_0x32f105=_0x32f105-0x0;var _0x10d559=_0x7250[_0x32f105];return _0x10d559;};'use strict';var _=require(_0x0725('0x0'));var db=require(_0x0725('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x0725('0x2'));var rpc=require(_0x0725('0x3'));var config=require(_0x0725('0x4'));var logger=require(_0x0725('0x5'))(_0x0725('0x6'));var pm2=require(_0x0725('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x0725('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x0725('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x0725('0xa')][_0x0725('0xb')]()['then'](function(){if(config[_0x0725('0xc')]){return seedDb[_0x0725('0xd')]();}})[_0x0725('0xe')](function(){return checkLicense[_0x0725('0xd')]();})[_0x0725('0xe')](function(){return rpc[_0x0725('0xf')]();})[_0x0725('0xe')](function(_0x4c2f6a){logger[_0x0725('0x10')](_0x4c2f6a);return chat[_0x0725('0x11')]();})[_0x0725('0xe')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x0725('0x11')]();})[_0x0725('0xe')](function(){return transcribe[_0x0725('0x11')]();})[_0x0725('0xe')](function(){return provider[_0x0725('0x11')]();})[_0x0725('0xe')](function(_0x1dc8b8){logger[_0x0725('0x10')](_0x1dc8b8);return pm2[_0x0725('0x11')](pm2Config);})['then'](function(_0x180021){var _0x685ce=_0x180021[_0x0725('0x12')](function(_0x163d77){return typeof _0x163d77[_0x0725('0x13')]===_0x0725('0x14')&&_0x163d77['exitCode']>=0x0;});if(_0x685ce['length']>0x0){throw new Error(_0x685ce[_0x0725('0x15')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x0725('0x16')](_0x685ce,function(_0x4dfc36){return'\x22'+_0x4dfc36['pm2_env']['name']+'\x22';}));}logger[_0x0725('0x10')](_0x0725('0x17'),_[_0x0725('0x16')](_[_0x0725('0x12')](_0x180021,{'status':_0x0725('0x18')}),_0x0725('0x19'))[_0x0725('0x1a')]());logger[_0x0725('0x10')](_0x0725('0x1b'),_[_0x0725('0x16')](_[_0x0725('0x12')](_0x180021,function(_0x4b04a3){return _0x4b04a3[_0x0725('0x1c')]!==_0x0725('0x18');}),_0x0725('0x19'))[_0x0725('0x1a')]()||_0x0725('0x1d'));console['log']('App\x20Ready!');})[_0x0725('0x1e')](function(_0x3167a3){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3167a3);logger[_0x0725('0x1f')](_0x0725('0x20'),_0x3167a3);process[_0x0725('0x21')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 90248d7..8d136ae 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 _0x1775=['isEqual','apiKeyNonce','nonce','status','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','use','User\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','apiKeyIat','generateApiKey','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','closed','disposition','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','User','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','find','sub','then','Setting','allowedLoginAttempts','blockDuration'];(function(_0x4a50a0,_0x471185){var _0x597f2b=function(_0x17faff){while(--_0x17faff){_0x4a50a0['push'](_0x4a50a0['shift']());}};_0x597f2b(++_0x471185);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x5177('0x0'));var hardwareConf=require(_0x5177('0x1'));var licenseUtil=require(_0x5177('0x2'));var encryptor=require(_0x5177('0x3'));var _=require(_0x5177('0x4'));var jwt=require(_0x5177('0x5'));var expressJwt=require(_0x5177('0x6'));var compose=require(_0x5177('0x7'));var basicAuth=require(_0x5177('0x8'));var crypto=require(_0x5177('0x9'));var BPromise=require(_0x5177('0xa'));var util=require(_0x5177('0xb'));var moment=require(_0x5177('0xc'));var validateJwt=expressJwt({'secret':config[_0x5177('0xd')][_0x5177('0xe')]});var userAttributes=['id',_0x5177('0xf'),_0x5177('0x10'),_0x5177('0x11'),_0x5177('0x12'),_0x5177('0x13'),_0x5177('0x14'),_0x5177('0x15'),'md5secret','voicePause',_0x5177('0x16'),_0x5177('0x17'),_0x5177('0x18'),_0x5177('0x19'),_0x5177('0x1a'),'pauseType',_0x5177('0x1b'),_0x5177('0x1c'),_0x5177('0x1d'),_0x5177('0x1e'),_0x5177('0x1f'),_0x5177('0x20'),_0x5177('0x21'),_0x5177('0x22'),_0x5177('0x23'),_0x5177('0x24'),_0x5177('0x25'),_0x5177('0x26'),_0x5177('0x27'),_0x5177('0x28'),_0x5177('0x29'),_0x5177('0x2a'),_0x5177('0x2b'),_0x5177('0x2c'),_0x5177('0x2d'),'userProfileId',_0x5177('0x2e'),_0x5177('0x2f'),_0x5177('0x30'),_0x5177('0x31'),'downloadOmnichannelInteractions',_0x5177('0x32'),_0x5177('0x33'),_0x5177('0x34'),'chatAutoanswer',_0x5177('0x35'),'emailAutoanswer',_0x5177('0x36'),_0x5177('0x37'),_0x5177('0x38'),_0x5177('0x39'),_0x5177('0x3a'),_0x5177('0x3b'),_0x5177('0x3c'),_0x5177('0x3d'),_0x5177('0x3e'),_0x5177('0x3f')];exports[_0x5177('0x40')]=function(){return this[_0x5177('0x41')](!![])['use'](function(_0x3dcea1,_0x556f96,_0x30b60f){if(_0x3dcea1[_0x5177('0x42')]){_0x30b60f();}else{return db[_0x5177('0x43')][_0x5177('0x44')]({'where':{'id':_0x3dcea1['params']['id']},'attributes':['id',_0x5177('0x45'),'disposition'],'raw':!![]})['then'](function(_0x19a0c2){if(_0x19a0c2&&_0x19a0c2[_0x5177('0x45')]){return _0x556f96['status'](_0x19a0c2[_0x5177('0x46')]==='unmanaged'?0x195:0x193)[_0x5177('0x47')]({'message':_0x19a0c2[_0x5177('0x46')]==='unmanaged'?_0x5177('0x48'):_0x5177('0x49')});}else{_0x30b60f();}})[_0x5177('0x4a')](function(_0x7f86e){_0x30b60f(_0x7f86e);});}});};exports[_0x5177('0x41')]=function isAuthenticated(_0x1cef5d){return compose()['use'](function(_0x498fcd,_0x45cf20,_0x1c660e){var _0x7dae59;if(_0x498fcd[_0x5177('0x4b')][_0x5177('0x4c')]){if(_[_0x5177('0x4d')](_0x498fcd[_0x5177('0x4b')][_0x5177('0x4c')],'Basic')){var _0x42e1db=basicAuth(_0x498fcd);db[_0x5177('0x4e')]['find']({'where':{'name':_0x42e1db[_0x5177('0x11')]}})['then'](function(_0x172b36){if(!_0x172b36||!_0x172b36[_0x5177('0x4f')](_0x42e1db[_0x5177('0x50')])){return _0x45cf20['status'](0x191)['json']({'message':_0x5177('0x51')});}_0x498fcd[_0x5177('0x42')]={'id':_0x172b36['id']};_0x1c660e();})[_0x5177('0x4a')](function(_0x3735e9){_0x1c660e(_0x3735e9);});}else if(_[_0x5177('0x4d')](_0x498fcd[_0x5177('0x4b')][_0x5177('0x4c')],_0x5177('0x52'))){validateJwt(_0x498fcd,_0x45cf20,_0x1c660e);}else{if(_0x1cef5d){_0x1c660e();}else{return _0x45cf20['status'](0x193)[_0x5177('0x47')]({'message':_0x5177('0x53')});}}}else if(_0x498fcd['query'][_0x5177('0x54')]){try{var _0x2a26fc={'audience':hardwareConf[_0x5177('0x55')](),'issuer':hardwareConf[_0x5177('0x55')]()};verifyJwt(_0x498fcd[_0x5177('0x56')][_0x5177('0x54')],_0x2a26fc)['then'](function(_0x40c607){return db[_0x5177('0x4e')][_0x5177('0x57')]({'where':{'id':_0x40c607[_0x5177('0x58')]}})[_0x5177('0x59')](function(_0xacaa96){_0x7dae59=_0xacaa96;return db[_0x5177('0x5a')]['findOne']({'where':{'id':0x1},'attributes':[_0x5177('0x5b'),_0x5177('0x5c')],'raw':!![]});})['then'](function(_0x486dd5){if(!_0x7dae59||!_[_0x5177('0x5d')](_0x7dae59[_0x5177('0x5e')],_0x40c607[_0x5177('0x5f')])){return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x61')});}if(_0x7dae59[_0x5177('0x62')]){return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x63')});}if(_0x7dae59[_0x5177('0x64')]){if(_0x486dd5[_0x5177('0x5c')]>0x0){if(moment(_0x7dae59[_0x5177('0x65')])['add'](_0x486dd5[_0x5177('0x5c')],_0x5177('0x66'))>moment()){return _0x45cf20['status'](0x191)[_0x5177('0x47')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x63')});}}_0x498fcd['user']={'id':_0x7dae59['id']};_0x1c660e();});})['catch'](function(){return _0x45cf20[_0x5177('0x60')](0x191)[_0x5177('0x47')]({'message':_0x5177('0x63')});});}catch(_0x177c4b){_0x1c660e(_0x177c4b);}}else if(_0x1cef5d){_0x1c660e();}else{return _0x45cf20[_0x5177('0x60')](0x193)[_0x5177('0x47')]({'message':_0x5177('0x53')});}})[_0x5177('0x67')](function(_0x4e287e,_0xe1c75c,_0x51ecc0){if(_0x4e287e['user']){db[_0x5177('0x4e')][_0x5177('0x57')]({'where':{'id':_0x4e287e['user']['id']},'attributes':userAttributes})[_0x5177('0x59')](function(_0x508178){if(!_0x508178){return _0xe1c75c['status'](0x194)[_0x5177('0x47')]({'message':_0x5177('0x68')});}_0x4e287e[_0x5177('0x42')]=_0x508178;_0x51ecc0();})[_0x5177('0x4a')](function(_0x191973){_0x51ecc0(_0x191973);});}else if(_0x1cef5d){_0x51ecc0();}else{return _0xe1c75c[_0x5177('0x60')](0x194)[_0x5177('0x47')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x5177('0x67')](function(_0x511dc0,_0x23be2a,_0x3476d3){return licenseUtil[_0x5177('0x69')]()[_0x5177('0x59')](function(_0x570812){if(_0x570812[_0x5177('0x6a')]){_0x3476d3();}else{return _0x23be2a[_0x5177('0x60')](0x193)[_0x5177('0x47')]({'message':_0x5177('0x6b')});}})[_0x5177('0x4a')](function(_0x10b370){_0x3476d3(_0x10b370);});});};exports[_0x5177('0x6c')]=function isWebrtcLicence(){return compose()[_0x5177('0x67')](function(_0x1ada68,_0x296a98,_0x3fec49){return licenseUtil['getLicense']()[_0x5177('0x59')](function(_0x481bda){if(_0x481bda['webrtc']){_0x3fec49();}else{return _0x296a98['status'](0x193)[_0x5177('0x47')]({'message':_0x5177('0x6b')});}})['catch'](function(_0x326405){_0x3fec49(_0x326405);});});};exports[_0x5177('0x6d')]=function(_0x208483,_0x4891fe,_0x1d4ae4){_0x208483['isMiddleware']=!![];return _0x1d4ae4();};exports['signToken']=function signToken(_0x5bd97b){return signJwt(_0x5bd97b);};exports[_0x5177('0x6e')]=function(_0x37d5dd,_0x1300d7){if(!_0x37d5dd['user']){return _0x1300d7['status'](0x194)[_0x5177('0x47')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x262ac4={'payload':{'id':_0x37d5dd[_0x5177('0x42')]['id'],'role':_0x37d5dd[_0x5177('0x42')][_0x5177('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0x262ac4)[_0x5177('0x59')](function(_0xa0edd7){_0x1300d7[_0x5177('0x6f')](_0x5177('0x70'),_0xa0edd7);_0x1300d7[_0x5177('0x71')](_0x5177('0x72'));})[_0x5177('0x4a')](function(_0xb08267){return _0x1300d7[_0x5177('0x60')](0x1f4)['send'](_0xb08267);});};exports['retrieveApiKey']=function(_0x29ff0f){if(_['isNil'](_0x29ff0f[_0x5177('0x5e')])||_['isNil'](_0x29ff0f[_0x5177('0x73')])){return null;}else{return createJwt(_0x29ff0f);}};exports[_0x5177('0x74')]=function(_0x1e838a){_0x1e838a['apiKeyNonce']=generateNonce();_0x1e838a['apiKeyIat']=generateIssuedAt();return createJwt(_0x1e838a);};exports[_0x5177('0x75')]=function(_0x43b5b9,_0x2eb560){var _0xcc37fb=_0x43b5b9['query']['apikey'];if(_0xcc37fb){var _0x3f0e89={'nonce':_0x2eb560[_0x5177('0x5e')],'iat':_0x2eb560[_0x5177('0x73')],'audience':hardwareConf[_0x5177('0x55')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xcc37fb,_0x3f0e89)[_0x5177('0x59')](function(){return generateApiKey(_0x2eb560);});}else{throw{'message':_0x5177('0x76')};}};exports[_0x5177('0x77')]=function(_0x589da8){var _0x2b39ba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2b39ba[_0x5177('0x78')](_0x589da8))throw new db[(_0x5177('0x79'))]['ValidationError'](_0x5177('0x7a'));return;};exports['validatePasswordHistory']=function(_0x40dfd6,_0x39fb92,_0x3268bd){var _0x5101fc=encryptor[_0x5177('0x7b')](_0x39fb92)[_0x5177('0x7c')](',');for(var _0xea44e=0x0;_0xea44e<_0x3268bd;_0xea44e++){if(!_0x5101fc[_0xea44e])break;if(_0x40dfd6[_0x5177('0x7d')]()===_0x5101fc[_0xea44e][_0x5177('0x7d')]()){var _0x74589e=util[_0x5177('0x7e')](_0x5177('0x7f'),_0x3268bd);if(_0x3268bd===0x1){_0x74589e='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize']['ValidationError'](_0x74589e);}}return;};exports[_0x5177('0x80')]=function(_0x18222f,_0x35aa22){var _0x75cc0e=_0x35aa22?encryptor[_0x5177('0x7b')](_0x35aa22)[_0x5177('0x7c')](','):[];if(_0x75cc0e['length']===0x5){_0x75cc0e['splice'](-0x1,0x1);}_0x75cc0e[_0x5177('0x81')](_0x18222f);return encryptor[_0x5177('0x82')](_0x75cc0e[_0x5177('0x83')](','));};function signJwt(_0x336017){var _0x123d40=BPromise[_0x5177('0x84')](jwt[_0x5177('0x85')],{'context':jwt});var _0xd9c1db=_0x336017[_0x5177('0x86')]||config['secrets'][_0x5177('0xe')];return new BPromise(function(_0x25a0be,_0x57e199){_0x123d40(_0x336017[_0x5177('0x87')],_0xd9c1db,_0x336017[_0x5177('0x88')])['then'](function(_0x69c264){_0x25a0be(_0x69c264);})[_0x5177('0x4a')](function(_0x11a63c){_0x57e199(_0x11a63c);});});}function verifyJwt(_0x4be4b2,_0x23b246,_0x400e27){var _0x5f5bd5=BPromise['promisify'](jwt[_0x5177('0x89')],{'context':jwt});var _0x4f76d7=_0x400e27||config[_0x5177('0xd')]['session'];return new BPromise(function(_0x2771fa,_0x16f17c){_0x5f5bd5(_0x4be4b2,_0x4f76d7,_0x23b246)['then'](function(_0x2af938){_0x2771fa(_0x2af938);})[_0x5177('0x4a')](function(_0x1975a3){_0x16f17c(_0x1975a3);});});}function generateNonce(){return crypto[_0x5177('0x8a')](0x10)[_0x5177('0x8b')](_0x5177('0x8c'));}function generateIssuedAt(){return Math[_0x5177('0x8d')](Date['now']()/0x3e8)[_0x5177('0x8b')]();}function createJwt(_0x54aabd){var _0x54c301={'payload':{'iat':_0x54aabd[_0x5177('0x73')],'nonce':_0x54aabd[_0x5177('0x5e')]},'options':{'algorithm':'HS512','subject':_0x54aabd['id'][_0x5177('0x8b')](),'issuer':hardwareConf[_0x5177('0x55')](),'audience':hardwareConf[_0x5177('0x55')]()}};return signJwt(_0x54c301)[_0x5177('0x59')](function(_0x19b587){return{'iat':_0x54aabd[_0x5177('0x73')],'nonce':_0x54aabd[_0x5177('0x5e')],'token':_0x19b587};});} \ No newline at end of file +var _0x2032=['interface','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','use','headers','authorization','Basic','find','authenticate','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockedAt','add','blockDuration','minutes','Invalid\x20API\x20access\x20key','User','User\x20not\x20found.','User\x20object\x20not\x20found.','Forbidden','isWebrtcLicence','getLicense','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','test','ValidationError','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','promisify','sign','secret','payload','verify','randomBytes','hex','floor','now','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','userpic','md5secret','voicePause','chatPause','faxPause','openchannelPause','showWebBar','lastLoginAt','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk'];(function(_0x56c9d3,_0x489b12){var _0x3c5cd7=function(_0x3f8bfa){while(--_0x3f8bfa){_0x56c9d3['push'](_0x56c9d3['shift']());}};_0x3c5cd7(++_0x489b12);}(_0x2032,0xd9));var _0x2203=function(_0x25e04c,_0x59201e){_0x25e04c=_0x25e04c-0x0;var _0xf61ec0=_0x2032[_0x25e04c];return _0xf61ec0;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x2203('0x0'));var hardwareConf=require(_0x2203('0x1'));var licenseUtil=require(_0x2203('0x2'));var encryptor=require('../encryptor');var _=require(_0x2203('0x3'));var jwt=require(_0x2203('0x4'));var expressJwt=require('express-jwt');var compose=require(_0x2203('0x5'));var basicAuth=require(_0x2203('0x6'));var crypto=require(_0x2203('0x7'));var BPromise=require(_0x2203('0x8'));var util=require(_0x2203('0x9'));var moment=require(_0x2203('0xa'));var validateJwt=expressJwt({'secret':config[_0x2203('0xb')][_0x2203('0xc')]});var userAttributes=['id',_0x2203('0xd'),_0x2203('0xe'),_0x2203('0xf'),'internal','email',_0x2203('0x10'),'permissions',_0x2203('0x11'),_0x2203('0x12'),_0x2203('0x13'),'mailPause',_0x2203('0x14'),'smsPause',_0x2203('0x15'),'pauseType',_0x2203('0x16'),_0x2203('0x17'),'lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias',_0x2203('0x18'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0x2203('0x19'),_0x2203('0x1a'),_0x2203('0x1b'),_0x2203('0x1c'),_0x2203('0x1d'),_0x2203('0x1e'),_0x2203('0x1f'),_0x2203('0x20'),_0x2203('0x21'),_0x2203('0x22'),'privacyEnabled',_0x2203('0x23'),_0x2203('0x24'),'downloadVoiceRecordings',_0x2203('0x25'),_0x2203('0x26'),'ignorePauseForPreviewCalls',_0x2203('0x27'),'chatAutoanswer',_0x2203('0x28'),_0x2203('0x29'),_0x2203('0x2a'),_0x2203('0x2b'),_0x2203('0x2c'),_0x2203('0x2d'),'openchannelAutoanswerDelay',_0x2203('0x2e'),'faxAutoanswerDelay','whatsappAutoanswer',_0x2203('0x2f'),'messengerSoundNotification'];exports[_0x2203('0x30')]=function(){return this[_0x2203('0x31')](!![])['use'](function(_0x3ee25b,_0x5e29cd,_0x5c8da9){if(_0x3ee25b[_0x2203('0x32')]){_0x5c8da9();}else{return db[_0x2203('0x33')][_0x2203('0x34')]({'where':{'id':_0x3ee25b[_0x2203('0x35')]['id']},'attributes':['id',_0x2203('0x36'),_0x2203('0x37')],'raw':!![]})[_0x2203('0x38')](function(_0x250349){if(_0x250349&&_0x250349['closed']){return _0x5e29cd[_0x2203('0x39')](_0x250349[_0x2203('0x37')]===_0x2203('0x3a')?0x195:0x193)['json']({'message':_0x250349[_0x2203('0x37')]===_0x2203('0x3a')?'Unmanaged.':_0x2203('0x3b')});}else{_0x5c8da9();}})[_0x2203('0x3c')](function(_0x1c6a77){_0x5c8da9(_0x1c6a77);});}});};exports[_0x2203('0x31')]=function isAuthenticated(_0x28ae02){return compose()[_0x2203('0x3d')](function(_0x9c53f,_0x5a95c1,_0x34b8ba){var _0x616ed8;if(_0x9c53f[_0x2203('0x3e')][_0x2203('0x3f')]){if(_['startsWith'](_0x9c53f[_0x2203('0x3e')][_0x2203('0x3f')],_0x2203('0x40'))){var _0xf59954=basicAuth(_0x9c53f);db['User'][_0x2203('0x41')]({'where':{'name':_0xf59954[_0x2203('0xf')]}})['then'](function(_0x5c0157){if(!_0x5c0157||!_0x5c0157[_0x2203('0x42')](_0xf59954['pass'])){return _0x5a95c1['status'](0x191)[_0x2203('0x43')]({'message':_0x2203('0x44')});}_0x9c53f[_0x2203('0x32')]={'id':_0x5c0157['id']};_0x34b8ba();})[_0x2203('0x3c')](function(_0xf2801d){_0x34b8ba(_0xf2801d);});}else if(_['startsWith'](_0x9c53f[_0x2203('0x3e')][_0x2203('0x3f')],'Bearer')){validateJwt(_0x9c53f,_0x5a95c1,_0x34b8ba);}else{if(_0x28ae02){_0x34b8ba();}else{return _0x5a95c1[_0x2203('0x39')](0x193)[_0x2203('0x43')]({'message':_0x2203('0x45')});}}}else if(_0x9c53f[_0x2203('0x46')][_0x2203('0x47')]){try{var _0x24d138={'audience':hardwareConf[_0x2203('0x48')](),'issuer':hardwareConf[_0x2203('0x48')]()};verifyJwt(_0x9c53f[_0x2203('0x46')]['apikey'],_0x24d138)[_0x2203('0x38')](function(_0x347d3e){return db['User']['find']({'where':{'id':_0x347d3e[_0x2203('0x49')]}})['then'](function(_0x25cc97){_0x616ed8=_0x25cc97;return db[_0x2203('0x4a')][_0x2203('0x34')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0x2203('0x38')](function(_0x47c93a){if(!_0x616ed8||!_[_0x2203('0x4b')](_0x616ed8['apiKeyNonce'],_0x347d3e[_0x2203('0x4c')])){return _0x5a95c1['status'](0x191)[_0x2203('0x43')]({'message':_0x2203('0x4d')});}if(_0x616ed8[_0x2203('0x4e')]){return _0x5a95c1[_0x2203('0x39')](0x191)[_0x2203('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x616ed8['blocked']){if(_0x47c93a['blockDuration']>0x0){if(moment(_0x616ed8[_0x2203('0x4f')])[_0x2203('0x50')](_0x47c93a[_0x2203('0x51')],_0x2203('0x52'))>moment()){return _0x5a95c1[_0x2203('0x39')](0x191)[_0x2203('0x43')]({'message':_0x2203('0x53')});}}else{return _0x5a95c1['status'](0x191)[_0x2203('0x43')]({'message':_0x2203('0x53')});}}_0x9c53f[_0x2203('0x32')]={'id':_0x616ed8['id']};_0x34b8ba();});})[_0x2203('0x3c')](function(){return _0x5a95c1['status'](0x191)['json']({'message':_0x2203('0x53')});});}catch(_0x5494a1){_0x34b8ba(_0x5494a1);}}else if(_0x28ae02){_0x34b8ba();}else{return _0x5a95c1[_0x2203('0x39')](0x193)[_0x2203('0x43')]({'message':_0x2203('0x45')});}})['use'](function(_0x5bba52,_0x1e7ebc,_0x3739f6){if(_0x5bba52[_0x2203('0x32')]){db[_0x2203('0x54')][_0x2203('0x41')]({'where':{'id':_0x5bba52[_0x2203('0x32')]['id']},'attributes':userAttributes})['then'](function(_0x15d3b6){if(!_0x15d3b6){return _0x1e7ebc[_0x2203('0x39')](0x194)[_0x2203('0x43')]({'message':_0x2203('0x55')});}_0x5bba52[_0x2203('0x32')]=_0x15d3b6;_0x3739f6();})[_0x2203('0x3c')](function(_0x5b4842){_0x3739f6(_0x5b4842);});}else if(_0x28ae02){_0x3739f6();}else{return _0x1e7ebc[_0x2203('0x39')](0x194)[_0x2203('0x43')]({'message':_0x2203('0x56')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x2203('0x3d')](function(_0x24e773,_0x4aab80,_0x3b9981){return licenseUtil['getLicense']()['then'](function(_0x1c6661){if(_0x1c6661['update']){_0x3b9981();}else{return _0x4aab80[_0x2203('0x39')](0x193)[_0x2203('0x43')]({'message':_0x2203('0x57')});}})[_0x2203('0x3c')](function(_0x594148){_0x3b9981(_0x594148);});});};exports[_0x2203('0x58')]=function isWebrtcLicence(){return compose()[_0x2203('0x3d')](function(_0x5cd8c6,_0x29bd91,_0x381b3e){return licenseUtil[_0x2203('0x59')]()[_0x2203('0x38')](function(_0x5a71a5){if(_0x5a71a5['webrtc']){_0x381b3e();}else{return _0x29bd91[_0x2203('0x39')](0x193)['json']({'message':'Forbidden'});}})[_0x2203('0x3c')](function(_0x33b7b5){_0x381b3e(_0x33b7b5);});});};exports[_0x2203('0x5a')]=function(_0x49823a,_0x4c1496,_0x131aec){_0x49823a[_0x2203('0x5a')]=!![];return _0x131aec();};exports[_0x2203('0x5b')]=function signToken(_0x21d2d7){return signJwt(_0x21d2d7);};exports[_0x2203('0x5c')]=function(_0x21fd78,_0x4a7f4e){if(!_0x21fd78[_0x2203('0x32')]){return _0x4a7f4e['status'](0x194)[_0x2203('0x43')]({'message':_0x2203('0x5d')});}var _0x246aff={'payload':{'id':_0x21fd78[_0x2203('0x32')]['id'],'role':_0x21fd78['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x246aff)[_0x2203('0x38')](function(_0x1f772d){_0x4a7f4e[_0x2203('0x5e')](_0x2203('0x5f'),_0x1f772d);_0x4a7f4e['redirect']('/dashboards/general');})['catch'](function(_0x4064d5){return _0x4a7f4e[_0x2203('0x39')](0x1f4)['send'](_0x4064d5);});};exports[_0x2203('0x60')]=function(_0x267627){if(_['isNil'](_0x267627[_0x2203('0x61')])||_[_0x2203('0x62')](_0x267627[_0x2203('0x63')])){return null;}else{return createJwt(_0x267627);}};exports[_0x2203('0x64')]=function(_0x4bb6f1){_0x4bb6f1[_0x2203('0x61')]=generateNonce();_0x4bb6f1['apiKeyIat']=generateIssuedAt();return createJwt(_0x4bb6f1);};exports[_0x2203('0x65')]=function(_0x1de713,_0x4ee8cf){var _0x428b18=_0x1de713[_0x2203('0x46')][_0x2203('0x47')];if(_0x428b18){var _0x378132={'nonce':_0x4ee8cf[_0x2203('0x61')],'iat':_0x4ee8cf[_0x2203('0x63')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x428b18,_0x378132)[_0x2203('0x38')](function(){return generateApiKey(_0x4ee8cf);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0xfddc3b){var _0x33e5eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x33e5eb[_0x2203('0x66')](_0xfddc3b))throw new db['Sequelize'][(_0x2203('0x67'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0xeb6b44,_0x5be4b6,_0x54ec71){var _0x5efc59=encryptor[_0x2203('0x68')](_0x5be4b6)[_0x2203('0x69')](',');for(var _0x367122=0x0;_0x367122<_0x54ec71;_0x367122++){if(!_0x5efc59[_0x367122])break;if(_0xeb6b44[_0x2203('0x6a')]()===_0x5efc59[_0x367122][_0x2203('0x6a')]()){var _0x32f593=util[_0x2203('0x6b')](_0x2203('0x6c'),_0x54ec71);if(_0x54ec71===0x1){_0x32f593=_0x2203('0x6d');}throw new db[(_0x2203('0x6e'))][(_0x2203('0x67'))](_0x32f593);}}return;};exports[_0x2203('0x6f')]=function(_0x58ff57,_0x585bde){var _0x2cd752=_0x585bde?encryptor[_0x2203('0x68')](_0x585bde)[_0x2203('0x69')](','):[];if(_0x2cd752[_0x2203('0x70')]===0x5){_0x2cd752[_0x2203('0x71')](-0x1,0x1);}_0x2cd752[_0x2203('0x72')](_0x58ff57);return encryptor['encryptString'](_0x2cd752['join'](','));};function signJwt(_0xb49120){var _0x34358e=BPromise[_0x2203('0x73')](jwt[_0x2203('0x74')],{'context':jwt});var _0xcab922=_0xb49120[_0x2203('0x75')]||config[_0x2203('0xb')][_0x2203('0xc')];return new BPromise(function(_0x2c6bcc,_0x135272){_0x34358e(_0xb49120[_0x2203('0x76')],_0xcab922,_0xb49120['options'])[_0x2203('0x38')](function(_0x3ae12e){_0x2c6bcc(_0x3ae12e);})[_0x2203('0x3c')](function(_0x407fc2){_0x135272(_0x407fc2);});});}function verifyJwt(_0x41a938,_0x44e7ab,_0x52c159){var _0x544756=BPromise[_0x2203('0x73')](jwt[_0x2203('0x77')],{'context':jwt});var _0x49e795=_0x52c159||config[_0x2203('0xb')][_0x2203('0xc')];return new BPromise(function(_0x24179a,_0xc193b7){_0x544756(_0x41a938,_0x49e795,_0x44e7ab)[_0x2203('0x38')](function(_0x1e44c){_0x24179a(_0x1e44c);})[_0x2203('0x3c')](function(_0x8a9282){_0xc193b7(_0x8a9282);});});}function generateNonce(){return crypto[_0x2203('0x78')](0x10)['toString'](_0x2203('0x79'));}function generateIssuedAt(){return Math[_0x2203('0x7a')](Date[_0x2203('0x7b')]()/0x3e8)['toString']();}function createJwt(_0x68855d){var _0x3f73e1={'payload':{'iat':_0x68855d[_0x2203('0x63')],'nonce':_0x68855d[_0x2203('0x61')]},'options':{'algorithm':_0x2203('0x7c'),'subject':_0x68855d['id']['toString'](),'issuer':hardwareConf[_0x2203('0x48')](),'audience':hardwareConf[_0x2203('0x48')]()}};return signJwt(_0x3f73e1)[_0x2203('0x38')](function(_0x4dde80){return{'iat':_0x68855d['apiKeyIat'],'nonce':_0x68855d['apiKeyNonce'],'token':_0x4dde80};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index e39a563..e0fded6 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 _0x1838=['tags','user','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','clause','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','type','lodash','../../mysqldb','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','fields','filter'];(function(_0x597ae3,_0x7e4dc6){var _0x2c30cf=function(_0x46bd96){while(--_0x46bd96){_0x597ae3['push'](_0x597ae3['shift']());}};_0x2c30cf(++_0x7e4dc6);}(_0x1838,0x85));var _0x8183=function(_0x5b2d9a,_0x82571f){_0x5b2d9a=_0x5b2d9a-0x0;var _0x19412b=_0x1838[_0x5b2d9a];return _0x19412b;};'use strict';var _=require(_0x8183('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x8183('0x1'))['db'];exports['findAll']=function(_0x5e370f,_0x178674,_0x51f818,_0x4f54c5){var _0x501eec={'count':0x0,'rows':[]};var _0x131559=sqlUtils['skipContactsQuery'](_0x178674,_0x5e370f);if(_0x131559){return Promise[_0x8183('0x2')](_0x501eec);}var _0x2b6478=sqlUtils[_0x8183('0x3')]();var _0x2111c3={};var _0x4149cd=![];var _0x1c7fe9=![];return Promise['resolve']()[_0x8183('0x4')](function(){if(_0x5e370f[_0x8183('0x5')]){return sqlUtils[_0x8183('0x6')](_0x5e370f[_0x8183('0x5')],_0x4f54c5);}else{return sqlUtils[_0x8183('0x7')](_0x5e370f,_0x4f54c5);}})['then'](function(_0x29fbf7){_0x2b6478['where'](_0x29fbf7['default']);_0x2b6478[_0x8183('0x8')](_0x29fbf7[_0x8183('0x9')]);_0x2b6478[_0x8183('0x8')](_0x29fbf7[_0x8183('0xa')]);_0x2b6478[_0x8183('0x8')](_0x29fbf7['user']['clause']);_0x2111c3=_0x29fbf7[_0x8183('0xb')];_0x1c7fe9=_0x29fbf7[_0x8183('0xc')][_0x8183('0xd')];return sqlUtils[_0x8183('0xe')](_0x178674,_0x5e370f,_0x1c7fe9);})[_0x8183('0x4')](function(_0x35dca2){_0x2b6478[_0x8183('0x8')](_0x35dca2);var _0x489818=_0x5e370f['search']?_0x2111c3[_0x8183('0xf')]:_0x5e370f[_0x8183('0x10')];_0x4149cd=_0x489818?!![]:![];return sqlUtils[_0x8183('0x11')](_0x2b6478,_0x489818);})[_0x8183('0x4')](function(_0x1bc996){_0x501eec[_0x8183('0x12')]=_0x1bc996;if(_0x501eec[_0x8183('0x12')]===0x0){return;}if(_0x5e370f['User']){_0x1c7fe9=!![];}return sqlUtils[_0x8183('0x13')](_0x2b6478,_0x5e370f[_0x8183('0x9')],_0x51f818,_0x4149cd,_0x2111c3[_0x8183('0x14')],_0x1c7fe9);})[_0x8183('0x4')](function(_0x464a88){if(!_0x464a88){return[];}return sqlUtils[_0x8183('0x15')](_0x464a88,_0x5e370f,_0x51f818);})[_0x8183('0x4')](function(_0x48a189){_0x501eec[_0x8183('0x16')]=_0x48a189;return _0x501eec;})[_0x8183('0x17')](function(_0x3d2f7d){throw _0x3d2f7d;});};exports[_0x8183('0x18')]=function(){var _0xd77887={};var _0xe253b7=[];return db[_0x8183('0x19')][_0x8183('0x18')]()[_0x8183('0x4')](function(_0x1668f2){_0xd77887=_0x1668f2;var _0xbcd709=Object['keys'](_0xd77887)[_0x8183('0xa')](function(_0x46ff8a){return _[_0x8183('0x1a')](_0x46ff8a,_0x8183('0x1b'))?_0x46ff8a:undefined;});var _0x1fa23f=_0xbcd709[_0x8183('0x1c')](function(_0x5514fa){return db[_0x8183('0x1d')][_0x8183('0x1e')]({'where':{'id':_0x5514fa[_0x8183('0x1f')](0x3)},'raw':!![]});});return Promise[_0x8183('0x20')](_0x1fa23f);})[_0x8183('0x4')](function(_0x1b9c36){for(var _0x2ef6f8=0x0;_0x2ef6f8<_0x1b9c36[_0x8183('0x21')];_0x2ef6f8++){if(_0x1b9c36[_0x2ef6f8]){var _0x6f6cbd=_0x8183('0x1b')+_0x1b9c36[_0x2ef6f8]['id'];_0xd77887[_0x6f6cbd][_0x8183('0x22')]=_0x1b9c36[_0x2ef6f8]['type'];}}_0xe253b7=_[_0x8183('0x1c')](Object['keys'](_0xd77887),function(_0x17f786){return{'name':_0x17f786,'type':_0xd77887[_0x17f786][_0x8183('0x23')]};});return _0xe253b7;})[_0x8183('0x17')](function(_0x5cad6b){throw _0x5cad6b;});}; \ No newline at end of file +var _0x0620=['CmContact','keys','startsWith','cf_','CmCustomField','findOne','length','type','map','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','ids','countFilteredContacts','count','User','buildContactsQuery','rows','describe'];(function(_0x5875a5,_0x274b05){var _0x704a70=function(_0x5bba29){while(--_0x5bba29){_0x5875a5['push'](_0x5875a5['shift']());}};_0x704a70(++_0x274b05);}(_0x0620,0x167));var _0x0062=function(_0x41fbdd,_0x271cf3){_0x41fbdd=_0x41fbdd-0x0;var _0x521d84=_0x0620[_0x41fbdd];return _0x521d84;};'use strict';var _=require(_0x0062('0x0'));var sqlUtils=require(_0x0062('0x1'));var db=require(_0x0062('0x2'))['db'];exports[_0x0062('0x3')]=function(_0x584260,_0xad98ff,_0x233ac2,_0x252686){var _0x20e856={'count':0x0,'rows':[]};var _0x2c9eed=sqlUtils[_0x0062('0x4')](_0xad98ff,_0x584260);if(_0x2c9eed){return Promise[_0x0062('0x5')](_0x20e856);}var _0x11fea7=sqlUtils[_0x0062('0x6')]();var _0x282b47={};var _0x3bceda=![];var _0x3854cf=![];return Promise[_0x0062('0x5')]()[_0x0062('0x7')](function(){if(_0x584260[_0x0062('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x584260[_0x0062('0x8')],_0x252686);}else{return sqlUtils[_0x0062('0x9')](_0x584260,_0x252686);}})['then'](function(_0x4b96ee){_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xb')]);_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xc')]);_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xd')]);_0x11fea7[_0x0062('0xa')](_0x4b96ee[_0x0062('0xe')][_0x0062('0xf')]);_0x282b47=_0x4b96ee[_0x0062('0x10')];_0x3854cf=_0x4b96ee[_0x0062('0xe')][_0x0062('0x11')];return sqlUtils[_0x0062('0x12')](_0xad98ff,_0x584260,_0x3854cf);})[_0x0062('0x7')](function(_0x12cb71){_0x11fea7['where'](_0x12cb71);var _0x2c2ec2=_0x584260[_0x0062('0x8')]?_0x282b47[_0x0062('0x13')]:_0x584260['tag'];_0x3bceda=_0x2c2ec2?!![]:![];return sqlUtils[_0x0062('0x14')](_0x11fea7,_0x2c2ec2);})['then'](function(_0x1aa86c){_0x20e856['count']=_0x1aa86c;if(_0x20e856[_0x0062('0x15')]===0x0){return;}if(_0x584260[_0x0062('0x16')]){_0x3854cf=!![];}return sqlUtils[_0x0062('0x17')](_0x11fea7,_0x584260['fields'],_0x233ac2,_0x3bceda,_0x282b47[_0x0062('0xf')],_0x3854cf);})[_0x0062('0x7')](function(_0x38945c){if(!_0x38945c){return[];}return sqlUtils['getFilteredContacts'](_0x38945c,_0x584260,_0x233ac2);})[_0x0062('0x7')](function(_0x3408df){_0x20e856[_0x0062('0x18')]=_0x3408df;return _0x20e856;})['catch'](function(_0x388dfe){throw _0x388dfe;});};exports[_0x0062('0x19')]=function(){var _0x448b05={};var _0x1c40e5=[];return db[_0x0062('0x1a')][_0x0062('0x19')]()[_0x0062('0x7')](function(_0xbbfe0b){_0x448b05=_0xbbfe0b;var _0x35b9a7=Object[_0x0062('0x1b')](_0x448b05)[_0x0062('0xd')](function(_0x37aa8e){return _[_0x0062('0x1c')](_0x37aa8e,_0x0062('0x1d'))?_0x37aa8e:undefined;});var _0x71adb1=_0x35b9a7['map'](function(_0x13adde){return db[_0x0062('0x1e')][_0x0062('0x1f')]({'where':{'id':_0x13adde['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x71adb1);})[_0x0062('0x7')](function(_0x40a611){for(var _0x2a3156=0x0;_0x2a3156<_0x40a611[_0x0062('0x20')];_0x2a3156++){if(_0x40a611[_0x2a3156]){var _0x447540=_0x0062('0x1d')+_0x40a611[_0x2a3156]['id'];_0x448b05[_0x447540]['fieldType']=_0x40a611[_0x2a3156][_0x0062('0x21')];}}_0x1c40e5=_[_0x0062('0x22')](Object['keys'](_0x448b05),function(_0x350ca1){return{'name':_0x350ca1,'type':_0x448b05[_0x350ca1][_0x0062('0x21')]};});return _0x1c40e5;})['catch'](function(_0x3178a1){throw _0x3178a1;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 0ace8ff..ed15db6 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 _0x59ba=['Tags','clone','COUNT(*)','c.id','isEmpty','where','t.id\x20IN\x20?','query','toString','exports','lodash','squel','../parsers/qs','../../mysqldb','role','search','ListId','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','email','CompanyId','createdAt','updatedAt','TagIds','includes','push','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','datetime','DATE','buildExpression','type','default','text','value','end','Tag','map','tags','and','ids','User','user','clause','uc.UserId\x20=\x20?','skip','some','Contact','forEach','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','getLists','length','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x59ba,0xde));var _0xa59b=function(_0x1f700c,_0x1f93f4){_0x1f700c=_0x1f700c-0x0;var _0xe63654=_0x59ba[_0x1f700c];return _0xe63654;};'use strict';var _=require(_0xa59b('0x0'));var squel=require(_0xa59b('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0xa59b('0x2'));var utils=require('../interaction/utils');var db=require(_0xa59b('0x3'))['db'];function skipContactsQuery(_0x19d287,_0x1a300c){var _0x3c832c=![];if(_0x19d287[_0xa59b('0x4')]==='agent'&&!_0x1a300c[_0xa59b('0x5')]&&!_0x1a300c[_0xa59b('0x6')]&&_0x1a300c[_0xa59b('0x7')]!==_0xa59b('0x8')){_0x3c832c=!![];}return _0x3c832c;}function getContactsSubquery(){return squel[_0xa59b('0x9')]()[_0xa59b('0xa')](_0xa59b('0xb'),'c')['where'](_0xa59b('0xc'));}function applyJoinClauses(_0x4f7013,_0x41917c){var _0x505e0e=_0x41917c?'c':'subqry';_0x4f7013[_0xa59b('0xd')](_0xa59b('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x505e0e+_0xa59b('0xf'))['left_join'](_0xa59b('0x10'),'ct',_0xa59b('0x11')+_0x505e0e+_0xa59b('0xf'))[_0xa59b('0xd')](_0xa59b('0x12'),'t',_0xa59b('0x13'));return _0x4f7013;}function addFieldsToQuery(_0x44e3d1,_0x5ebd65,_0x56e8a4,_0x426f28,_0x599c4a){var _0x6b87bb=_0x599c4a?'c':_0xa59b('0x14');if(!_0x5ebd65){_0x5ebd65=['id',_0xa59b('0x15'),_0xa59b('0x16'),_0xa59b('0x17'),_0xa59b('0x18'),'fax',_0xa59b('0x19'),_0xa59b('0x6'),_0xa59b('0x1a'),_0xa59b('0x1b'),_0xa59b('0x1c'),'deletedAt',_0xa59b('0x1d')];}else if(!_0x5ebd65[_0xa59b('0x1e')]('id')){_0x5ebd65[_0xa59b('0x1f')]('id');}var _0x4db9ca=_0x56e8a4&&_0x599c4a||!_0x56e8a4&&!_0x599c4a;if(_0x426f28){_0x4db9ca=_0x426f28&&_0x599c4a||!_0x426f28&&!_0x599c4a;}_0x5ebd65['forEach'](function(_0x1bc854){if(_0x1bc854===_0xa59b('0x1d')){if(_0x4db9ca){_0x44e3d1[_0xa59b('0x20')](_0xa59b('0x21'),_0x1bc854);}else if(_0x56e8a4||_0x426f28){_0x44e3d1[_0xa59b('0x20')](_0x6b87bb+'.'+_0x1bc854);}}else{_0x44e3d1[_0xa59b('0x20')](_0x6b87bb+'.'+_0x1bc854);}});return _0x44e3d1;}function getSqlClauses(){var _0x44b13c={'default':squel['expr'](),'fields':squel[_0xa59b('0x22')](),'filter':squel[_0xa59b('0x22')](),'tags':{'clause':squel[_0xa59b('0x22')](),'ids':null},'user':{'clause':squel[_0xa59b('0x22')](),'skip':![]}};return _0x44b13c;}function parseTagParameter(_0x3c8e9a){var _0x22c762=squel[_0xa59b('0x22')]();if(_0x3c8e9a){var _0x17d4fb=utils[_0xa59b('0x23')](_0x3c8e9a);_0x17d4fb['forEach'](function(_0x4ea64d){_0x22c762['or'](_0xa59b('0x24'),'%,'+_0x4ea64d+',%');});}return _0x22c762;}function parseSearchFilter(_0x2ffc14){var _0xda87a6=squel[_0xa59b('0x22')]();if(_0x2ffc14){var _0x23d101=_0x2ffc14['replace']('\x5c','\x5c\x5c')[_0xa59b('0x25')](/'/g,'\x27\x27');if(_0x23d101[_0xa59b('0x26')]('\x20')['length']>0x1){_0xda87a6['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x23d101,!![]),null);}else{if(qs['isNumeric'](_0x23d101)){_0xda87a6['or'](_0xa59b('0x27'),_0x23d101+'%');_0xda87a6['or'](_0xa59b('0x28'),_0x23d101+'%');_0xda87a6['or'](_0xa59b('0x29'),_0x23d101+'%');_0xda87a6['or'](_0xa59b('0x2a'),_0x23d101+'%');}else if(qs['isEmail'](_0x23d101)){_0xda87a6['or'](_0xa59b('0x2b'),_0x23d101+'%');}else{_0xda87a6['or']('c.firstName\x20LIKE\x20?','%'+_0x23d101+'%');_0xda87a6['or'](_0xa59b('0x2c'),'%'+_0x23d101+'%');_0xda87a6['or']('c.email\x20LIKE\x20?','%'+_0x23d101+'%');}}}return _0xda87a6;}function parseAdvancedSearchFilter(_0x41fef8,_0x19622b){var _0x330166=getSqlClauses();var _0x2a9d57=as['parseSearch'](_0x41fef8);var _0x4e41db=_0x2a9d57[_0xa59b('0x2d')];for(var _0x27234c=0x0;_0x27234c<_0x2a9d57['conditions']['length'];_0x27234c++){var _0x2b1f63=_0x2a9d57[_0xa59b('0x2e')][_0x27234c];var _0x2445af='c';var _0x46fda0=_[_0xa59b('0x2f')](_0x19622b,[_0xa59b('0x30'),_0x2b1f63[_0xa59b('0x20')]]);if(_0x46fda0){if(_0x2b1f63[_0xa59b('0x20')]===_0xa59b('0x31')||_0x46fda0['fieldType']===_0xa59b('0x32')){_0x2b1f63['castTo']=_0xa59b('0x33');}var _0x12392e=as[_0xa59b('0x34')](_0x2445af,_0x46fda0[_0xa59b('0x35')],_0x2b1f63);_0x330166[_0xa59b('0x36')][_0x4e41db](_0x12392e[_0xa59b('0x37')],_0x12392e['value']['start'],_0x12392e[_0xa59b('0x38')][_0xa59b('0x39')]);}else{if(_0x2b1f63['field']===_0xa59b('0x3a')){var _0xfb1733=_0x2b1f63[_0xa59b('0x38')]['split'](',')[_0xa59b('0x3b')](function(_0x4b0e64){return Number(_0x4b0e64);});var _0xa7caac=parseTagParameter(_0xfb1733);_0x330166[_0xa59b('0x3c')]['clause'][_0xa59b('0x3d')](_0xa7caac);_0x330166[_0xa59b('0x3c')][_0xa59b('0x3e')]=_0xfb1733;}else if(_0x2b1f63[_0xa59b('0x20')]===_0xa59b('0x3f')){_0x330166[_0xa59b('0x40')][_0xa59b('0x41')][_0xa59b('0x3d')](_0xa59b('0x42'),_0x2b1f63['value']);_0x330166[_0xa59b('0x40')][_0xa59b('0x43')]=!![];}}}return _0x330166;}function parseModelFields(_0x476d3c,_0x4a7f9f){var _0x2444a3=squel[_0xa59b('0x22')]();var _0x59d3f6=_(_0x476d3c)['keys']()[_0xa59b('0x3b')](function(_0x3be87e){return _[_0xa59b('0x44')](_0x4a7f9f,[_0xa59b('0x30'),_0x3be87e])?_0x3be87e:undefined;})['compact']()[_0xa59b('0x38')]();if(_0x476d3c[_0xa59b('0x45')]){_0x59d3f6[_0xa59b('0x1f')](_0xa59b('0x45'));}if(_0x476d3c[_0xa59b('0x3f')]){_0x59d3f6[_0xa59b('0x1f')](_0xa59b('0x3f'));}if(_0x59d3f6['length']>0x0){_0x59d3f6[_0xa59b('0x46')](function(_0x5e141a){if(_0x5e141a==='ListId'){_0x2444a3['and'](_0xa59b('0x47'),[][_0xa59b('0x48')](_0x476d3c[_0x5e141a]));}else if(_0x5e141a==='Contact'){var _0x278c3d='%'+_0x476d3c[_0x5e141a]+'%';_0x2444a3[_0xa59b('0x3d')](_0xa59b('0x49'),_0x278c3d);}else if(_0x5e141a===_0xa59b('0x3f')){_0x2444a3[_0xa59b('0x3d')](_0xa59b('0x42'),_0x476d3c[_0x5e141a]);}else{_0x2444a3[_0xa59b('0x3d')]('c.'+_0x5e141a+'\x20=\x20?',_0x476d3c[_0x5e141a]);}});}return _0x2444a3;}function parseQueryParameters(_0x56b2e5,_0x1a54b9){var _0x1d221f=getSqlClauses();return Promise[_0xa59b('0x4a')]()[_0xa59b('0x4b')](function(){return parseModelFields(_0x56b2e5,_0x1a54b9);})[_0xa59b('0x4b')](function(_0x299bb0){_0x1d221f[_0xa59b('0x4c')]['and'](_0x299bb0);return parseTagParameter(_0x56b2e5[_0xa59b('0x4d')]);})['then'](function(_0x510b9f){_0x1d221f['tags']['clause'][_0xa59b('0x3d')](_0x510b9f);return parseSearchFilter(_0x56b2e5[_0xa59b('0x4e')]);})[_0xa59b('0x4b')](function(_0x15ef99){_0x1d221f[_0xa59b('0x4e')]=_0x15ef99;return _0x1d221f;});}function checkListsRestrictions(_0x49fcd2,_0x5b7cb0,_0x5e7e9a){var _0x503fa1=squel[_0xa59b('0x22')]();return Promise[_0xa59b('0x4a')]()[_0xa59b('0x4b')](function(){if(_0x5b7cb0[_0xa59b('0x5')]&&_0x49fcd2[_0xa59b('0x4')]==='agent'&&!_0x5e7e9a){return _0x49fcd2[_0xa59b('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0xa59b('0x4b')](function(_0x4551a0){if(_0x4551a0){if(_0x4551a0[_0xa59b('0x50')]===0x0){_0x503fa1[_0xa59b('0x3d')](_0xa59b('0x51'));}else{_0x503fa1['and'](_0xa59b('0x47'),_['map'](_0x4551a0,'id'));}}})['then'](function(){return _0x503fa1;});}function buildContactsQuery(_0x4569e3,_0x34875b,_0x4554a3,_0xd9d682,_0x4290f6,_0x4d80c6){if(_0x34875b){_0x34875b=_0x4554a3[_0xa59b('0x52')];}_0x4569e3=addFieldsToQuery(_0x4569e3,_0x34875b,_0xd9d682,_0x4d80c6,!![]);var _0x22e117=squel[_0xa59b('0x9')]();_0x22e117=addFieldsToQuery(_0x22e117,_0x34875b,_0xd9d682,_0x4d80c6,![]);if(_0xd9d682||_0x4d80c6){_0x4569e3=applyJoinClauses(_0x4569e3,!![]);_0x4569e3[_0xa59b('0x53')]('c.id');if(_0x4554a3[_0xa59b('0x54')]){_0x22e117[_0xa59b('0x54')](_0x4554a3[_0xa59b('0x54')]);}if(_0x4554a3['offset']){_0x22e117[_0xa59b('0x55')](_0x4554a3[_0xa59b('0x55')]);}}else{_0x22e117=applyJoinClauses(_0x22e117,![]);_0x22e117[_0xa59b('0x53')](_0xa59b('0x56'));if(_0x4554a3[_0xa59b('0x54')]){_0x4569e3['limit'](_0x4554a3['limit']);}if(_0x4554a3[_0xa59b('0x55')]){_0x4569e3[_0xa59b('0x55')](_0x4554a3[_0xa59b('0x55')]);}}_0x22e117['having'](_0x4290f6);if(_0x4554a3['order']){_0x4554a3[_0xa59b('0x57')][_0xa59b('0x46')](function(_0x4b3f3e){_0x4569e3['order']('c.'+_0x4b3f3e[0x0],_0x4b3f3e[0x1]==='DESC'?![]:!![]);_0x22e117[_0xa59b('0x57')]('subqry.'+_0x4b3f3e[0x0],_0x4b3f3e[0x1]===_0xa59b('0x58')?![]:!![]);});}_0x22e117[_0xa59b('0xa')](_0x4569e3,'subqry');return _0x22e117;}function getFilteredContacts(_0x571191){var _0x3a12fc=[];return db[_0xa59b('0x3a')][_0xa59b('0x59')]({'attributes':['id',_0xa59b('0x30'),_0xa59b('0x5a')],'raw':!![]})[_0xa59b('0x4b')](function(_0xdebaa6){_0x3a12fc=_[_0xa59b('0x5b')](_0xdebaa6,'id');var _0x19feaa={'type':db[_0xa59b('0x5c')][_0xa59b('0x5d')]['SELECT'],'model':db[_0xa59b('0x5e')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xa59b('0x5f')]['query'](_0x571191['toString'](),_0x19feaa);})[_0xa59b('0x4b')](function(_0x366b4b){_0x366b4b[_0xa59b('0x46')](function(_0x56cd50){if(_0x56cd50['TagIds']){_0x56cd50[_0xa59b('0x60')]=[];_0x56cd50[_0xa59b('0x1d')][_0xa59b('0x26')](',')['forEach'](function(_0x22173b){_0x56cd50[_0xa59b('0x60')]['push'](_0x3a12fc[_0x22173b]);});}delete _0x56cd50[_0xa59b('0x1d')];});return _0x366b4b;});}function countFilteredContacts(_0x564882,_0x451de2){var _0x217d35=_0x564882[_0xa59b('0x61')]();_0x217d35[_0xa59b('0x20')](_0xa59b('0x62'));_0x217d35=applyJoinClauses(_0x217d35,!![]);_0x564882[_0xa59b('0x53')](_0xa59b('0x63'));var _0x318f6a=utils[_0xa59b('0x23')](_0x451de2);if(!_[_0xa59b('0x64')](_0x318f6a)){_0x217d35[_0xa59b('0x65')](_0xa59b('0x66'),_0x318f6a);}var _0x18803d={'type':db[_0xa59b('0x5c')][_0xa59b('0x5d')]['SELECT'],'raw':!![]};return db['sequelize'][_0xa59b('0x67')](_0x217d35[_0xa59b('0x68')](),_0x18803d)['then'](function(_0x1a789b){return _0x1a789b[0x0][_0xa59b('0x62')];});}module[_0xa59b('0x69')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x1503=['c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','name','fieldType','datetime','castTo','type','text','value','start','end','Tag','tags','and','User','user','clause','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','SELECT','CmContact','sequelize','query','toString','Tags','split','clone','group','t.id\x20IN\x20?','QueryTypes','COUNT(*)','exports','lodash','squel','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','ListId','autocomplete','select','from','cm_contacts','where','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','mobile','fax','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x1503,0xab));var _0x3150=function(_0x300159,_0x4edf8d){_0x300159=_0x300159-0x0;var _0x4af516=_0x1503[_0x300159];return _0x4af516;};'use strict';var _=require(_0x3150('0x0'));var squel=require(_0x3150('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x3150('0x2'));var utils=require(_0x3150('0x3'));var db=require(_0x3150('0x4'))['db'];function skipContactsQuery(_0x435e7e,_0x50a719){var _0x159f73=![];if(_0x435e7e['role']===_0x3150('0x5')&&!_0x50a719[_0x3150('0x6')]&&!_0x50a719[_0x3150('0x7')]&&_0x50a719[_0x3150('0x8')]!=='true'){_0x159f73=!![];}return _0x159f73;}function getContactsSubquery(){return squel[_0x3150('0x9')]()[_0x3150('0xa')](_0x3150('0xb'),'c')[_0x3150('0xc')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x2b79bf,_0x3418e1){var _0x125d88=_0x3418e1?'c':'subqry';_0x2b79bf[_0x3150('0xd')](_0x3150('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x125d88+'.id')['left_join'](_0x3150('0xf'),'ct',_0x3150('0x10')+_0x125d88+_0x3150('0x11'))[_0x3150('0xd')]('tools_tags','t',_0x3150('0x12'));return _0x2b79bf;}function addFieldsToQuery(_0x1dfd2a,_0x4c7594,_0x460aa4,_0x35549b,_0x86ddce){var _0x31dca3=_0x86ddce?'c':_0x3150('0x13');if(!_0x4c7594){_0x4c7594=['id',_0x3150('0x14'),_0x3150('0x15'),'phone',_0x3150('0x16'),_0x3150('0x17'),_0x3150('0x18'),_0x3150('0x7'),_0x3150('0x19'),_0x3150('0x1a'),_0x3150('0x1b'),_0x3150('0x1c'),_0x3150('0x1d')];}else if(!_0x4c7594[_0x3150('0x1e')]('id')){_0x4c7594[_0x3150('0x1f')]('id');}var _0x5b03af=_0x460aa4&&_0x86ddce||!_0x460aa4&&!_0x86ddce;if(_0x35549b){_0x5b03af=_0x35549b&&_0x86ddce||!_0x35549b&&!_0x86ddce;}_0x4c7594[_0x3150('0x20')](function(_0x4292c5){if(_0x4292c5===_0x3150('0x1d')){if(_0x5b03af){_0x1dfd2a[_0x3150('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x4292c5);}else if(_0x460aa4||_0x35549b){_0x1dfd2a[_0x3150('0x21')](_0x31dca3+'.'+_0x4292c5);}}else{_0x1dfd2a[_0x3150('0x21')](_0x31dca3+'.'+_0x4292c5);}});return _0x1dfd2a;}function getSqlClauses(){var _0x121986={'default':squel[_0x3150('0x22')](),'fields':squel[_0x3150('0x22')](),'filter':squel[_0x3150('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x3150('0x22')](),'skip':![]}};return _0x121986;}function parseTagParameter(_0x3e7795){var _0x5f1299=squel[_0x3150('0x22')]();if(_0x3e7795){var _0x3d2338=utils[_0x3150('0x23')](_0x3e7795);_0x3d2338[_0x3150('0x20')](function(_0x567650){_0x5f1299['or'](_0x3150('0x24'),'%,'+_0x567650+',%');});}return _0x5f1299;}function parseSearchFilter(_0x397620){var _0x5b9971=squel[_0x3150('0x22')]();if(_0x397620){var _0x141924=_0x397620[_0x3150('0x25')]('\x5c','\x5c\x5c')[_0x3150('0x25')](/'/g,'\x27\x27');if(_0x141924['split']('\x20')[_0x3150('0x26')]>0x1){_0x5b9971['or'](_0x3150('0x27'),qs['getFullTextValue'](_0x141924,!![]),null);}else{if(qs[_0x3150('0x28')](_0x141924)){_0x5b9971['or'](_0x3150('0x29'),_0x141924+'%');_0x5b9971['or'](_0x3150('0x2a'),_0x141924+'%');_0x5b9971['or'](_0x3150('0x2b'),_0x141924+'%');_0x5b9971['or'](_0x3150('0x2c'),_0x141924+'%');}else if(qs[_0x3150('0x2d')](_0x141924)){_0x5b9971['or'](_0x3150('0x2e'),_0x141924+'%');}else{_0x5b9971['or']('c.firstName\x20LIKE\x20?','%'+_0x141924+'%');_0x5b9971['or'](_0x3150('0x2f'),'%'+_0x141924+'%');_0x5b9971['or'](_0x3150('0x2e'),'%'+_0x141924+'%');}}}return _0x5b9971;}function parseAdvancedSearchFilter(_0x3d1ff7,_0xbc8bf5){var _0x811d47=getSqlClauses();var _0x57117e=as[_0x3150('0x30')](_0x3d1ff7);var _0x1e0158=_0x57117e['sqlOperator'];for(var _0x4338c1=0x0;_0x4338c1<_0x57117e[_0x3150('0x31')]['length'];_0x4338c1++){var _0x58a006=_0x57117e[_0x3150('0x31')][_0x4338c1];var _0x1f4815='c';var _0x3df9c5=_[_0x3150('0x32')](_0xbc8bf5,[_0x3150('0x33'),_0x58a006[_0x3150('0x21')]]);if(_0x3df9c5){if(_0x58a006[_0x3150('0x21')]==='dateOfBirth'||_0x3df9c5[_0x3150('0x34')]===_0x3150('0x35')){_0x58a006[_0x3150('0x36')]='DATE';}var _0x1481d8=as['buildExpression'](_0x1f4815,_0x3df9c5[_0x3150('0x37')],_0x58a006);_0x811d47['default'][_0x1e0158](_0x1481d8[_0x3150('0x38')],_0x1481d8[_0x3150('0x39')][_0x3150('0x3a')],_0x1481d8['value'][_0x3150('0x3b')]);}else{if(_0x58a006['field']===_0x3150('0x3c')){var _0x489530=_0x58a006[_0x3150('0x39')]['split'](',')['map'](function(_0x5993ea){return Number(_0x5993ea);});var _0x35d3d=parseTagParameter(_0x489530);_0x811d47[_0x3150('0x3d')]['clause'][_0x3150('0x3e')](_0x35d3d);_0x811d47[_0x3150('0x3d')]['ids']=_0x489530;}else if(_0x58a006[_0x3150('0x21')]===_0x3150('0x3f')){_0x811d47[_0x3150('0x40')][_0x3150('0x41')][_0x3150('0x3e')](_0x3150('0x42'),_0x58a006[_0x3150('0x39')]);_0x811d47[_0x3150('0x40')][_0x3150('0x43')]=!![];}}}return _0x811d47;}function parseModelFields(_0x2a35c3,_0x10f25b){var _0x2e8298=squel[_0x3150('0x22')]();var _0x41b370=_(_0x2a35c3)[_0x3150('0x44')]()['map'](function(_0x438c63){return _[_0x3150('0x45')](_0x10f25b,[_0x3150('0x33'),_0x438c63])?_0x438c63:undefined;})[_0x3150('0x46')]()[_0x3150('0x39')]();if(_0x2a35c3[_0x3150('0x47')]){_0x41b370[_0x3150('0x1f')]('Contact');}if(_0x2a35c3[_0x3150('0x3f')]){_0x41b370[_0x3150('0x1f')]('User');}if(_0x41b370[_0x3150('0x26')]>0x0){_0x41b370[_0x3150('0x20')](function(_0x540186){if(_0x540186==='ListId'){_0x2e8298['and']('c.ListId\x20IN\x20?',[]['concat'](_0x2a35c3[_0x540186]));}else if(_0x540186===_0x3150('0x47')){var _0x5b6e75='%'+_0x2a35c3[_0x540186]+'%';_0x2e8298[_0x3150('0x3e')](_0x3150('0x48'),_0x5b6e75);}else if(_0x540186==='User'){_0x2e8298[_0x3150('0x3e')](_0x3150('0x42'),_0x2a35c3[_0x540186]);}else{_0x2e8298[_0x3150('0x3e')]('c.'+_0x540186+_0x3150('0x49'),_0x2a35c3[_0x540186]);}});}return _0x2e8298;}function parseQueryParameters(_0x3e9c54,_0x153182){var _0x12f71a=getSqlClauses();return Promise[_0x3150('0x4a')]()[_0x3150('0x4b')](function(){return parseModelFields(_0x3e9c54,_0x153182);})['then'](function(_0x2c14ae){_0x12f71a['fields'][_0x3150('0x3e')](_0x2c14ae);return parseTagParameter(_0x3e9c54[_0x3150('0x4c')]);})['then'](function(_0x9e4836){_0x12f71a[_0x3150('0x3d')][_0x3150('0x41')][_0x3150('0x3e')](_0x9e4836);return parseSearchFilter(_0x3e9c54['filter']);})['then'](function(_0x4a734a){_0x12f71a[_0x3150('0x4d')]=_0x4a734a;return _0x12f71a;});}function checkListsRestrictions(_0x2e555c,_0x171d69,_0x358237){var _0x31ab83=squel[_0x3150('0x22')]();return Promise[_0x3150('0x4a')]()[_0x3150('0x4b')](function(){if(_0x171d69[_0x3150('0x6')]&&_0x2e555c[_0x3150('0x4e')]===_0x3150('0x5')&&!_0x358237){return _0x2e555c[_0x3150('0x4f')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x280b1b){if(_0x280b1b){if(_0x280b1b[_0x3150('0x26')]===0x0){_0x31ab83[_0x3150('0x3e')](_0x3150('0x50'));}else{_0x31ab83[_0x3150('0x3e')](_0x3150('0x51'),_['map'](_0x280b1b,'id'));}}})[_0x3150('0x4b')](function(){return _0x31ab83;});}function buildContactsQuery(_0x3d5324,_0x298587,_0xc43120,_0x376024,_0xe8d8d4,_0x2ff907){if(_0x298587){_0x298587=_0xc43120['attributes'];}_0x3d5324=addFieldsToQuery(_0x3d5324,_0x298587,_0x376024,_0x2ff907,!![]);var _0x12c5b8=squel[_0x3150('0x9')]();_0x12c5b8=addFieldsToQuery(_0x12c5b8,_0x298587,_0x376024,_0x2ff907,![]);if(_0x376024||_0x2ff907){_0x3d5324=applyJoinClauses(_0x3d5324,!![]);_0x3d5324['group'](_0x3150('0x52'));if(_0xc43120[_0x3150('0x53')]){_0x12c5b8[_0x3150('0x53')](_0xc43120[_0x3150('0x53')]);}if(_0xc43120[_0x3150('0x54')]){_0x12c5b8[_0x3150('0x54')](_0xc43120[_0x3150('0x54')]);}}else{_0x12c5b8=applyJoinClauses(_0x12c5b8,![]);_0x12c5b8['group'](_0x3150('0x55'));if(_0xc43120['limit']){_0x3d5324[_0x3150('0x53')](_0xc43120[_0x3150('0x53')]);}if(_0xc43120[_0x3150('0x54')]){_0x3d5324[_0x3150('0x54')](_0xc43120['offset']);}}_0x12c5b8[_0x3150('0x56')](_0xe8d8d4);if(_0xc43120[_0x3150('0x57')]){_0xc43120[_0x3150('0x57')]['forEach'](function(_0x3ed4ba){_0x3d5324[_0x3150('0x57')]('c.'+_0x3ed4ba[0x0],_0x3ed4ba[0x1]===_0x3150('0x58')?![]:!![]);_0x12c5b8[_0x3150('0x57')](_0x3150('0x59')+_0x3ed4ba[0x0],_0x3ed4ba[0x1]===_0x3150('0x58')?![]:!![]);});}_0x12c5b8['from'](_0x3d5324,_0x3150('0x13'));return _0x12c5b8;}function getFilteredContacts(_0x3669cd){var _0x4ed0c2=[];return db[_0x3150('0x3c')][_0x3150('0x5a')]({'attributes':['id','name',_0x3150('0x5b')],'raw':!![]})['then'](function(_0x57b4fc){_0x4ed0c2=_[_0x3150('0x5c')](_0x57b4fc,'id');var _0x3662dc={'type':db[_0x3150('0x5d')]['QueryTypes'][_0x3150('0x5e')],'model':db[_0x3150('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3150('0x60')][_0x3150('0x61')](_0x3669cd[_0x3150('0x62')](),_0x3662dc);})[_0x3150('0x4b')](function(_0x3a4828){_0x3a4828[_0x3150('0x20')](function(_0x5186d6){if(_0x5186d6[_0x3150('0x1d')]){_0x5186d6[_0x3150('0x63')]=[];_0x5186d6[_0x3150('0x1d')][_0x3150('0x64')](',')[_0x3150('0x20')](function(_0xadb513){_0x5186d6[_0x3150('0x63')][_0x3150('0x1f')](_0x4ed0c2[_0xadb513]);});}delete _0x5186d6['TagIds'];});return _0x3a4828;});}function countFilteredContacts(_0x55faed,_0x33b179){var _0x343248=_0x55faed[_0x3150('0x65')]();_0x343248[_0x3150('0x21')]('COUNT(*)');_0x343248=applyJoinClauses(_0x343248,!![]);_0x55faed[_0x3150('0x66')](_0x3150('0x52'));var _0x4c781a=utils[_0x3150('0x23')](_0x33b179);if(!_['isEmpty'](_0x4c781a)){_0x343248[_0x3150('0xc')](_0x3150('0x67'),_0x4c781a);}var _0xbff397={'type':db['Sequelize'][_0x3150('0x68')][_0x3150('0x5e')],'raw':!![]};return db['sequelize']['query'](_0x343248[_0x3150('0x62')](),_0xbff397)[_0x3150('0x4b')](function(_0xfc736e){return _0xfc736e[0x0][_0x3150('0x69')];});}module[_0x3150('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 18c00be..a43adcc 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 _0x0965=['encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','final','close','unlink','decryptFile','createReadStream','createDecipher','write','end','secret','createCipher','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','aes192'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0965,0xa2));var _0x5096=function(_0x3d39d6,_0x2890f5){_0x3d39d6=_0x3d39d6-0x0;var _0x16b16f=_0x0965[_0x3d39d6];return _0x16b16f;};'use strict';var crypto=require(_0x5096('0x0'));var fs=require('fs');var BPromise=require(_0x5096('0x1'));var _=require(_0x5096('0x2'));var config=require(_0x5096('0x3'));var logger=require(_0x5096('0x4'))(_0x5096('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x5096('0x6')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x5096('0x7')};if(config[_0x5096('0x8')]&&config[_0x5096('0x8')][_0x5096('0x9')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x5096('0x9')]);if(isSupported){fileOptions[_0x5096('0x9')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x5096('0xa')](config['encrypt'][_0x5096('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x524971){return AES_SUPPORTED_RX[_0x5096('0xb')](_0x524971);}function getSupportedCiphers(){return crypto[_0x5096('0xc')]()[_0x5096('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x14c081){return getSupportedCiphers()[_0x5096('0xe')](_0x14c081)>-0x1;}function combineOptions(_0x42ef7a){var _0x310a3c={};for(var _0x5d9602 in fileOptions){if(fileOptions['hasOwnProperty'](_0x5d9602)){_0x310a3c[_0x5d9602]=fileOptions[_0x5d9602];}}if(_0x42ef7a){for(var _0x2fe2ca in _0x42ef7a){if(_0x42ef7a[_0x5096('0xf')](_0x2fe2ca)){_0x310a3c[_0x2fe2ca]=_0x42ef7a[_0x2fe2ca];}}}return _0x310a3c;}exports[_0x5096('0x10')]=function(_0x40e555,_0x47021b,_0x27e9f6,_0x43e416){return new BPromise(function(_0xa312c7,_0x1a9e25){_0x43e416=combineOptions(_0x43e416);var _0x47762f=new Buffer(_0x27e9f6);var _0x1859c1=fs['createReadStream'](_0x40e555);var _0x3c0bb9=fs[_0x5096('0x11')](_0x47021b);var _0x523345=crypto['createCipher'](_0x43e416[_0x5096('0x9')],_0x47762f);_0x1859c1['on'](_0x5096('0x12'),function(_0x208d32){var _0x5da118=new Buffer(_0x523345[_0x5096('0x13')](_0x208d32),_0x5096('0x14'));_0x3c0bb9['write'](_0x5da118);});_0x1859c1['on']('end',function(){try{var _0x1d4e53=new Buffer(_0x523345[_0x5096('0x15')](_0x5096('0x14')),_0x5096('0x14'));_0x3c0bb9['write'](_0x1d4e53);_0x3c0bb9['end']();_0x3c0bb9['on'](_0x5096('0x16'),function(){return _0xa312c7(_0x47021b);});}catch(_0x3492af){fs[_0x5096('0x17')](_0x47021b);return _0x1a9e25(_0x3492af);}});});};exports[_0x5096('0x18')]=function(_0x47dd2f,_0x176d0c,_0x435aea,_0x564c28){return new BPromise(function(_0x230431,_0x1b6dde){_0x564c28=combineOptions(_0x564c28);var _0x3e80be=new Buffer(_0x435aea);var _0x3726eb=fs[_0x5096('0x19')](_0x47dd2f);var _0x128f7c=fs['createWriteStream'](_0x176d0c);var _0x57d532=crypto[_0x5096('0x1a')](_0x564c28[_0x5096('0x9')],_0x3e80be);_0x3726eb['on']('data',function(_0x48f536){var _0xb8d8ac=new Buffer(_0x57d532[_0x5096('0x13')](_0x48f536),_0x5096('0x14'));_0x128f7c[_0x5096('0x1b')](_0xb8d8ac);});_0x3726eb['on'](_0x5096('0x1c'),function(){try{var _0x51ce1d=new Buffer(_0x57d532[_0x5096('0x15')](_0x5096('0x14')),_0x5096('0x14'));_0x128f7c['write'](_0x51ce1d);_0x128f7c[_0x5096('0x1c')]();_0x128f7c['on']('close',function(){return _0x230431(_0x176d0c);});}catch(_0xe46efb){fs['unlink'](_0x176d0c);return _0x1b6dde(_0xe46efb);}});});};exports['encryptString']=function(_0x5312b2,_0x3044ab,_0x573e13){var _0x14e1a0=_0x573e13||stringOptions[_0x5096('0x9')];var _0x3e3de4=_0x3044ab||stringOptions[_0x5096('0x1d')];var _0x3823de=crypto[_0x5096('0x1e')](_0x14e1a0,_0x3e3de4);var _0x10d52d=_0x3823de['update'](_0x5312b2,_0x5096('0x1f'),_0x5096('0x20'));_0x10d52d+=_0x3823de[_0x5096('0x15')](_0x5096('0x20'));return _0x10d52d;};exports[_0x5096('0x21')]=function(_0x27fd3e,_0x40409a,_0x5e3340){var _0x4c980d=_0x5e3340||stringOptions[_0x5096('0x9')];var _0x4a32f1=_0x40409a||stringOptions[_0x5096('0x1d')];var _0xf7806d=crypto[_0x5096('0x1a')](_0x4c980d,_0x4a32f1);var _0x527fec=_0xf7806d[_0x5096('0x13')](_0x27fd3e,_0x5096('0x20'),_0x5096('0x1f'));_0x527fec+=_0xf7806d[_0x5096('0x15')](_0x5096('0x1f'));return _0x527fec;}; \ No newline at end of file +var _0xfad6=['lodash','../../config/environment','../../config/logger','app','secrets','aes192','encrypt','algorithm','error','test','getCiphers','indexOf','encryptFile','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','data','secret','utf8','base64','decryptString','createDecipher','bluebird'];(function(_0x5986fa,_0x14f120){var _0x44a886=function(_0x54eae8){while(--_0x54eae8){_0x5986fa['push'](_0x5986fa['shift']());}};_0x44a886(++_0x14f120);}(_0xfad6,0xf7));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x6fad('0x0'));var _=require(_0x6fad('0x1'));var config=require(_0x6fad('0x2'));var logger=require(_0x6fad('0x3'))(_0x6fad('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6fad('0x5')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x6fad('0x6')};if(config[_0x6fad('0x7')]&&config['encrypt'][_0x6fad('0x8')]){var isSupported=isAlgorithmSupported(config[_0x6fad('0x7')]['algorithm']);if(isSupported){fileOptions['algorithm']=config[_0x6fad('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x6fad('0x9')](config[_0x6fad('0x7')][_0x6fad('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x3e495b){return AES_SUPPORTED_RX[_0x6fad('0xa')](_0x3e495b);}function getSupportedCiphers(){return crypto[_0x6fad('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x5bca08){return getSupportedCiphers()[_0x6fad('0xc')](_0x5bca08)>-0x1;}function combineOptions(_0x3ca791){var _0xd69c5a={};for(var _0x2bf266 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2bf266)){_0xd69c5a[_0x2bf266]=fileOptions[_0x2bf266];}}if(_0x3ca791){for(var _0x5b1bf8 in _0x3ca791){if(_0x3ca791['hasOwnProperty'](_0x5b1bf8)){_0xd69c5a[_0x5b1bf8]=_0x3ca791[_0x5b1bf8];}}}return _0xd69c5a;}exports[_0x6fad('0xd')]=function(_0x155755,_0x519bc2,_0x27ec81,_0xa90b15){return new BPromise(function(_0x52d32c,_0x4e390a){_0xa90b15=combineOptions(_0xa90b15);var _0x43ca4f=new Buffer(_0x27ec81);var _0x197224=fs['createReadStream'](_0x155755);var _0x5bb1d1=fs[_0x6fad('0xe')](_0x519bc2);var _0x36b33d=crypto[_0x6fad('0xf')](_0xa90b15[_0x6fad('0x8')],_0x43ca4f);_0x197224['on']('data',function(_0x47aa24){var _0xb9831f=new Buffer(_0x36b33d[_0x6fad('0x10')](_0x47aa24),_0x6fad('0x11'));_0x5bb1d1[_0x6fad('0x12')](_0xb9831f);});_0x197224['on'](_0x6fad('0x13'),function(){try{var _0x5ecc96=new Buffer(_0x36b33d[_0x6fad('0x14')](_0x6fad('0x11')),_0x6fad('0x11'));_0x5bb1d1[_0x6fad('0x12')](_0x5ecc96);_0x5bb1d1[_0x6fad('0x13')]();_0x5bb1d1['on'](_0x6fad('0x15'),function(){return _0x52d32c(_0x519bc2);});}catch(_0x1d89ac){fs[_0x6fad('0x16')](_0x519bc2);return _0x4e390a(_0x1d89ac);}});});};exports[_0x6fad('0x17')]=function(_0x178236,_0x5e079a,_0x35bf84,_0x308f26){return new BPromise(function(_0x6e8ced,_0x48b881){_0x308f26=combineOptions(_0x308f26);var _0x384790=new Buffer(_0x35bf84);var _0xa0fe5b=fs[_0x6fad('0x18')](_0x178236);var _0x337476=fs[_0x6fad('0xe')](_0x5e079a);var _0x49c163=crypto['createDecipher'](_0x308f26['algorithm'],_0x384790);_0xa0fe5b['on'](_0x6fad('0x19'),function(_0x5e62f0){var _0x186468=new Buffer(_0x49c163[_0x6fad('0x10')](_0x5e62f0),_0x6fad('0x11'));_0x337476[_0x6fad('0x12')](_0x186468);});_0xa0fe5b['on']('end',function(){try{var _0xddbba5=new Buffer(_0x49c163[_0x6fad('0x14')](_0x6fad('0x11')),_0x6fad('0x11'));_0x337476[_0x6fad('0x12')](_0xddbba5);_0x337476[_0x6fad('0x13')]();_0x337476['on'](_0x6fad('0x15'),function(){return _0x6e8ced(_0x5e079a);});}catch(_0x3ea5b4){fs[_0x6fad('0x16')](_0x5e079a);return _0x48b881(_0x3ea5b4);}});});};exports['encryptString']=function(_0x4453f7,_0x4a668b,_0x20031f){var _0x1dd3f=_0x20031f||stringOptions[_0x6fad('0x8')];var _0x5df2f3=_0x4a668b||stringOptions[_0x6fad('0x1a')];var _0x3542f7=crypto['createCipher'](_0x1dd3f,_0x5df2f3);var _0x4ff916=_0x3542f7[_0x6fad('0x10')](_0x4453f7,_0x6fad('0x1b'),'base64');_0x4ff916+=_0x3542f7[_0x6fad('0x14')](_0x6fad('0x1c'));return _0x4ff916;};exports[_0x6fad('0x1d')]=function(_0x464fcf,_0xc62f8e,_0x302c89){var _0x525319=_0x302c89||stringOptions[_0x6fad('0x8')];var _0x289429=_0xc62f8e||stringOptions[_0x6fad('0x1a')];var _0x37b477=crypto[_0x6fad('0x1e')](_0x525319,_0x289429);var _0x16c5a9=_0x37b477[_0x6fad('0x10')](_0x464fcf,_0x6fad('0x1c'),_0x6fad('0x1b'));_0x16c5a9+=_0x37b477[_0x6fad('0x14')](_0x6fad('0x1b'));return _0x16c5a9;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 67c861e..7487e9c 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 _0x6103=['Completed','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','analytics','argv','savename','AnalyticExtractedReport','update','info','format','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','isInteger','num','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','csv','%s.%s','writeFileSync','zip','zip\x20finished','CSV'];(function(_0x4817a0,_0x1040ae){var _0x48e0e8=function(_0x3872c6){while(--_0x3872c6){_0x4817a0['push'](_0x4817a0['shift']());}};_0x48e0e8(++_0x1040ae);}(_0x6103,0x196));var _0x3610=function(_0x6765c2,_0x1c4f41){_0x6765c2=_0x6765c2-0x0;var _0x3d1105=_0x6103[_0x6765c2];return _0x3d1105;};'use strict';var util=require(_0x3610('0x0'));var path=require(_0x3610('0x1'));var _=require(_0x3610('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x3610('0x3'));var zipdir=require(_0x3610('0x4'));var rimraf=require(_0x3610('0x5'));var db=require(_0x3610('0x6'))['db'];var dbH=require(_0x3610('0x6'))[_0x3610('0x7')];var logger=require('../../config/logger')(_0x3610('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3610('0x9')][0x3];var PATH=process[_0x3610('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x317178,_0xba2e7c){var _0x33c9aa={'status':_0x317178};var _0x613d28={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xba2e7c){_0x33c9aa[_0x3610('0xa')]=_0xba2e7c;}return db[_0x3610('0xb')][_0x3610('0xc')](_0x33c9aa,_0x613d28);}function main(){var _0x46e72f=0x1388;var _0x261c1d;logger[_0x3610('0xd')](util[_0x3610('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x3610('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3610('0x10'),'splitSizeCsv']})['then'](function(_0x30f1d1){if(_0x30f1d1){_0x261c1d=_0x30f1d1;_0x46e72f=_0x261c1d[_0x3610('0x11')]||0x1388;}})[_0x3610('0x12')](function(){return dbH[_0x3610('0x13')][_0x3610('0x14')](util['format'](_0x3610('0x15'),QUERY),{'type':dbH[_0x3610('0x13')][_0x3610('0x16')][_0x3610('0x17')]});})[_0x3610('0x12')](function(_0x264d19){if(!_0x264d19[0x0]['num']){return analyticExtractedReport(_0x3610('0x18'));}var _0x179567=[];var _0x829a27=0x0;if(_0x261c1d[_0x3610('0x10')]){if(_0x264d19&&_0x264d19[_0x3610('0x19')]){var _0x301505=_[_0x3610('0x1a')](_0x264d19[0x0]['num']/_0x46e72f);var _0x2d94f7=Number[_0x3610('0x1b')](_0x264d19[0x0][_0x3610('0x1c')]/_0x46e72f)?_0x264d19[0x0]['num']%_0x46e72f:0x0;_0x301505[_0x3610('0x1d')](function(_0xacc53f){if(_0xacc53f>0x0){_0x829a27+=_0x46e72f;}_0x179567[_0x3610('0x1e')](dbH[_0x3610('0x13')][_0x3610('0x14')](util[_0x3610('0xe')](_0x3610('0x1f'),QUERY,_0x46e72f,_0x829a27),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));});if(_0x2d94f7>0x0){_0x829a27+=_0x46e72f;_0x179567[_0x3610('0x1e')](dbH[_0x3610('0x13')][_0x3610('0x14')](util[_0x3610('0xe')](_0x3610('0x1f'),QUERY,_0x2d94f7,_0x829a27),{'type':dbH[_0x3610('0x13')]['QueryTypes']['SELECT']}));}}}else{_0x179567[_0x3610('0x1e')](dbH[_0x3610('0x13')][_0x3610('0x14')](QUERY,{'type':dbH['sequelize'][_0x3610('0x16')][_0x3610('0x17')]}));}var _0x2186e7=path[_0x3610('0x20')](PATH);var _0x57e7e9=path[_0x3610('0x21')](PATH,_0x3610('0x22'));var _0x411f75=_0x261c1d['split']&&_0x179567[_0x3610('0x19')]>0x1;var _0x3943ef=[];if(!fs[_0x3610('0x23')](path[_0x3610('0x24')](_0x2186e7,_0x57e7e9))&&_0x411f75){fs[_0x3610('0x25')](path[_0x3610('0x24')](_0x2186e7,_0x57e7e9));}return BPromise['each'](_0x179567,function(_0x3a90f1){_0x3943ef['push'](_0x3a90f1);})[_0x3610('0x12')](function(){for(var _0x4d4717=0x0;_0x4d4717<_0x3943ef[_0x3610('0x19')];_0x4d4717+=0x1){var _0x4334fd;var _0x46da07=_0x3943ef[_0x4d4717];if(_0x411f75){_0x4334fd=path['join'](_0x2186e7,_0x57e7e9,util[_0x3610('0xe')]('%s%d.%s',_0x57e7e9,_0x4d4717,_0x3610('0x26')));}else{_0x4334fd=path[_0x3610('0x24')](_0x2186e7,util['format'](_0x3610('0x27'),_0x57e7e9,'csv'));}fs[_0x3610('0x28')](_0x4334fd,csv(_0x46da07));}})['then'](function(){if(_0x411f75){return new Promise(function(_0x5a10ac){zipdir(path['join'](_0x2186e7,_0x57e7e9),{'saveTo':path['join'](_0x2186e7,util[_0x3610('0xe')](_0x3610('0x27'),_0x57e7e9,_0x3610('0x29')))},function(_0x499ecc,_0x2aff6d){rimraf(path[_0x3610('0x24')](_0x2186e7,_0x57e7e9),function(){});_0x5a10ac(_0x3610('0x2a'));});});}})[_0x3610('0x12')](function(){logger[_0x3610('0xd')](util[_0x3610('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3610('0x2b')));return analyticExtractedReport(_0x3610('0x2c'),_0x411f75?util['format'](_0x3610('0x27'),_0x57e7e9,_0x411f75?'zip':_0x3610('0x26')):null);});})[_0x3610('0x2d')](function(_0x558d5f){logger['info'](util[_0x3610('0xe')](_0x3610('0x2e'),EXTRACTED_REPORT_ID,_0x3610('0x2b')),util['inspect'](_0x558d5f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3610('0x2f'));})[_0x3610('0x30')](function(){process[_0x3610('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x9246=['range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','dirname','.csv','length','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','Failed','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','CSV','Setting','find','split','splitSizeCsv','then','sequelize','format','QueryTypes','num'];(function(_0x25e1a2,_0x8d3307){var _0x40a473=function(_0x5f1201){while(--_0x5f1201){_0x25e1a2['push'](_0x25e1a2['shift']());}};_0x40a473(++_0x8d3307);}(_0x9246,0x1c7));var _0x6924=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x9246[_0x5a95fa];return _0x1a61b8;};'use strict';var util=require(_0x6924('0x0'));var path=require(_0x6924('0x1'));var _=require(_0x6924('0x2'));var csv=require(_0x6924('0x3'));var fs=require('fs');var BPromise=require(_0x6924('0x4'));var zipdir=require(_0x6924('0x5'));var rimraf=require(_0x6924('0x6'));var db=require(_0x6924('0x7'))['db'];var dbH=require(_0x6924('0x7'))[_0x6924('0x8')];var logger=require(_0x6924('0x9'))(_0x6924('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x6924('0xb')][0x3];var PATH=process[_0x6924('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2d4389,_0x32edf0){var _0x20295d={'status':_0x2d4389};var _0x4b55e8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x32edf0){_0x20295d['savename']=_0x32edf0;}return db[_0x6924('0xc')][_0x6924('0xd')](_0x20295d,_0x4b55e8);}function main(){var _0x3ee282=0x1388;var _0x442c20;logger[_0x6924('0xe')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6924('0xf')));return db[_0x6924('0x10')][_0x6924('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6924('0x12'),_0x6924('0x13')]})[_0x6924('0x14')](function(_0xd4f2e6){if(_0xd4f2e6){_0x442c20=_0xd4f2e6;_0x3ee282=_0x442c20['splitSizeCsv']||0x1388;}})[_0x6924('0x14')](function(){return dbH[_0x6924('0x15')]['query'](util[_0x6924('0x16')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6924('0x15')][_0x6924('0x17')]['SELECT']});})[_0x6924('0x14')](function(_0x5e009b){if(!_0x5e009b[0x0][_0x6924('0x18')]){return analyticExtractedReport('Empty');}var _0x484d74=[];var _0x389bd1=0x0;if(_0x442c20['split']){if(_0x5e009b&&_0x5e009b['length']){var _0x67ae0e=_[_0x6924('0x19')](_0x5e009b[0x0]['num']/_0x3ee282);var _0xe56ecd=Number['isInteger'](_0x5e009b[0x0][_0x6924('0x18')]/_0x3ee282)?_0x5e009b[0x0]['num']%_0x3ee282:0x0;_0x67ae0e[_0x6924('0x1a')](function(_0x35b4f1){if(_0x35b4f1>0x0){_0x389bd1+=_0x3ee282;}_0x484d74[_0x6924('0x1b')](dbH['sequelize']['query'](util[_0x6924('0x16')](_0x6924('0x1c'),QUERY,_0x3ee282,_0x389bd1),{'type':dbH['sequelize'][_0x6924('0x17')][_0x6924('0x1d')]}));});if(_0xe56ecd>0x0){_0x389bd1+=_0x3ee282;_0x484d74[_0x6924('0x1b')](dbH[_0x6924('0x15')]['query'](util[_0x6924('0x16')](_0x6924('0x1c'),QUERY,_0xe56ecd,_0x389bd1),{'type':dbH['sequelize'][_0x6924('0x17')][_0x6924('0x1d')]}));}}}else{_0x484d74[_0x6924('0x1b')](dbH[_0x6924('0x15')][_0x6924('0x1e')](QUERY,{'type':dbH[_0x6924('0x15')][_0x6924('0x17')][_0x6924('0x1d')]}));}var _0x51934e=path[_0x6924('0x1f')](PATH);var _0x58e456=path['basename'](PATH,_0x6924('0x20'));var _0x836ed6=_0x442c20[_0x6924('0x12')]&&_0x484d74[_0x6924('0x21')]>0x1;var _0x2f93ba=[];if(!fs[_0x6924('0x22')](path['join'](_0x51934e,_0x58e456))&&_0x836ed6){fs['mkdirSync'](path[_0x6924('0x23')](_0x51934e,_0x58e456));}return BPromise[_0x6924('0x24')](_0x484d74,function(_0x696c01){_0x2f93ba[_0x6924('0x1b')](_0x696c01);})[_0x6924('0x14')](function(){for(var _0x3600d9=0x0;_0x3600d9<_0x2f93ba[_0x6924('0x21')];_0x3600d9+=0x1){var _0x4ba58f;var _0x5a3031=_0x2f93ba[_0x3600d9];if(_0x836ed6){_0x4ba58f=path[_0x6924('0x23')](_0x51934e,_0x58e456,util[_0x6924('0x16')](_0x6924('0x25'),_0x58e456,_0x3600d9,_0x6924('0x26')));}else{_0x4ba58f=path[_0x6924('0x23')](_0x51934e,util[_0x6924('0x16')](_0x6924('0x27'),_0x58e456,_0x6924('0x26')));}fs[_0x6924('0x28')](_0x4ba58f,csv(_0x5a3031));}})['then'](function(){if(_0x836ed6){return new Promise(function(_0x42939a){zipdir(path['join'](_0x51934e,_0x58e456),{'saveTo':path[_0x6924('0x23')](_0x51934e,util[_0x6924('0x16')](_0x6924('0x27'),_0x58e456,'zip'))},function(_0x10f938,_0xd4fc26){rimraf(path['join'](_0x51934e,_0x58e456),function(){});_0x42939a(_0x6924('0x29'));});});}})[_0x6924('0x14')](function(){logger[_0x6924('0xe')](util[_0x6924('0x16')](_0x6924('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x6924('0x2b'),_0x836ed6?util[_0x6924('0x16')](_0x6924('0x27'),_0x58e456,_0x836ed6?_0x6924('0x2c'):_0x6924('0x26')):null);});})[_0x6924('0x2d')](function(_0x27770d){logger[_0x6924('0xe')](util[_0x6924('0x16')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6924('0xf')),util[_0x6924('0x2e')](_0x27770d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6924('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index acc2325..537f02a 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 _0x08e6=['startDate','endDate','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','right','num','Setting','split','splitSizePdf','then','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','query','QueryTypes','basename','.pdf','existsSync','mkdirSync','each','join','%s.%s','pdf','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','toString','center','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','path','lodash','moment','html-to-pdfmake','pdfmake/src/printer','JSDOM','window','bluebird','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','value','fill','length','auto','body','push','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x08e6,0xe8));var _0x608e=function(_0x448398,_0x3b8be){_0x448398=_0x448398-0x0;var _0x2afefc=_0x08e6[_0x448398];return _0x2afefc;};'use strict';var _=require(_0x608e('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0x608e('0x1'));var htmlToPdfmake=require(_0x608e('0x2'));var PdfPrinter=require(_0x608e('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x608e('0x4')];var window=new JSDOM('')[_0x608e('0x5')];var BPromise=require(_0x608e('0x6'));var db=require(_0x608e('0x7'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x608e('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x608e('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x608e('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4f0db7,_0x194f47){var _0x23a9f8={'status':_0x4f0db7};var _0x46f849={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x194f47){_0x23a9f8[_0x608e('0xb')]=_0x194f47;}return db[_0x608e('0xc')][_0x608e('0xd')](_0x23a9f8,_0x46f849);}function getHeaders(_0x55eb54){return _[_0x608e('0xe')](_0x55eb54,function(_0x4890eb){return{'text':_0x4890eb,'style':_0x608e('0xf')};});}function getRows(_0x34346f,_0x1e0dbc){return _['map'](_0x1e0dbc,function(_0x3fde90){return _(_0x3fde90)['pick'](_0x34346f)[_0x608e('0xe')](function(_0x2b9452){return _0x2b9452?_['toString'](_0x2b9452):'';})[_0x608e('0x10')]();});}function createTable(_0x5999b1,_0x4fe125){var _0x13df6f={'widths':_[_0x608e('0x11')](Array(_0x5999b1[_0x608e('0x12')]),0x91),'heights':function(_0x4c6c62){return _0x4c6c62===0x0?_0x608e('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x31f64a=getHeaders(_0x5999b1);_0x13df6f[_0x608e('0x14')][_0x608e('0x15')](_0x31f64a);var _0x5450c4=getRows(_0x5999b1,_0x4fe125);_0x13df6f[_0x608e('0x14')]=_0x13df6f[_0x608e('0x14')]['concat'](_0x5450c4);return _0x13df6f;}function createTables(_0x11872b){var _0x46d35b=[];var _0x579fe8=_[_0x608e('0x16')](Object['keys'](_0x11872b[0x0]),0x5);_0x579fe8[_0x608e('0x17')](function(_0x201303){_0x46d35b[_0x608e('0x15')](createTable(_0x201303,_0x11872b));});return _0x46d35b;}function getPDFDocDefinition(_0x3dc705){var _0x42f028=util[_0x608e('0x18')](_0x608e('0x19'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x608e('0x1a')])[_0x608e('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x608e('0x1b')])[_0x608e('0x18')](FORMAT));var _0x37507d=[];for(var _0x4728fd=0x0;_0x4728fd<_0x3dc705['length'];_0x4728fd++){var _0x102781=[];if(_0x4728fd===0x0){_0x102781['push']({'text':_0x42f028,'style':'header'});}var _0x4354c5={'table':_0x3dc705[_0x4728fd]};if(_0x4728fd>0x0){_0x4354c5[_0x608e('0x1c')]=_0x608e('0x1d');_0x4354c5[_0x608e('0x1e')]=[0x0,0x46,0x0,0x0];}_0x102781['push'](_0x4354c5);_0x37507d[_0x608e('0x15')](_0x102781);}return{'pageSize':'A4','pageOrientation':_0x608e('0x1f'),'content':_0x37507d,'footer':function(_0x271f6e,_0xb4556){return{'text':_0x271f6e['toString']()+_0x608e('0x20')+_0xb4556,'style':_0x608e('0x21')};},'defaultStyle':{'font':_0x608e('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x608e('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x19f35d){var _0x5316af=0x1388;var _0x9023f8;if(!_0x19f35d[0x0][_0x608e('0x24')]){return analyticExtractedReport('Empty');}return db[_0x608e('0x25')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x608e('0x26'),_0x608e('0x27')]})[_0x608e('0x28')](function(_0x41af44){if(_0x41af44){_0x9023f8=_0x41af44;_0x5316af=_0x9023f8['splitSizePdf']||0x3e8;}})['then'](function(){var _0x5a251c=[];var _0x46cf4c=0x0;if(_0x9023f8[_0x608e('0x26')]){if(_0x19f35d&&_0x19f35d[_0x608e('0x12')]){var _0x45b23f=_[_0x608e('0x29')](_0x19f35d[0x0]['num']/_0x5316af);var _0x3304a3=Number[_0x608e('0x2a')](_0x19f35d[0x0][_0x608e('0x24')]/_0x5316af)?_0x19f35d[0x0][_0x608e('0x24')]%_0x5316af:0x0;_0x45b23f['forEach'](function(_0x5475b9){if(_0x5475b9>0x0){_0x46cf4c+=_0x5316af;}_0x5a251c['push'](dbH[_0x608e('0x2b')]['query'](util[_0x608e('0x18')](_0x608e('0x2c'),QUERY,_0x5316af,_0x46cf4c),{'type':dbH[_0x608e('0x2b')]['QueryTypes'][_0x608e('0x2d')]}));});if(_0x3304a3>0x0){_0x46cf4c+=_0x5316af;_0x5a251c[_0x608e('0x15')](dbH['sequelize'][_0x608e('0x2e')](util[_0x608e('0x18')](_0x608e('0x2c'),QUERY,_0x3304a3,_0x46cf4c),{'type':dbH[_0x608e('0x2b')][_0x608e('0x2f')][_0x608e('0x2d')]}));}}}else{_0x5a251c[_0x608e('0x15')](dbH['sequelize'][_0x608e('0x2e')](QUERY,{'type':dbH[_0x608e('0x2b')][_0x608e('0x2f')][_0x608e('0x2d')]}));}var _0x404e43=path['dirname'](PATH);var _0x32f350=path[_0x608e('0x30')](PATH,_0x608e('0x31'));var _0x4fc196=_0x9023f8[_0x608e('0x26')]&&_0x5a251c['length']>0x1;var _0x5d61e0=[];if(!fs[_0x608e('0x32')](path['join'](_0x404e43,_0x32f350))&&_0x4fc196){fs[_0x608e('0x33')](path['join'](_0x404e43,_0x32f350));}return BPromise[_0x608e('0x34')](_0x5a251c,function(_0x18ad0a){_0x5d61e0[_0x608e('0x15')](_0x18ad0a);})[_0x608e('0x28')](function(){var _0x55df6e=[];for(var _0x2fbc63=0x0;_0x2fbc63<_0x5d61e0[_0x608e('0x12')];_0x2fbc63+=0x1){var _0x353f95=_0x5d61e0[_0x2fbc63];var _0x5dce1f=createTables(_['flatten'](_0x353f95));var _0x56ef0a;var _0x243f86=getPDFDocDefinition(_0x5dce1f);var _0x45e7c0=getPDFPrinter();var _0x51d557=_0x45e7c0['createPdfKitDocument'](_0x243f86);if(_0x4fc196){_0x56ef0a=path['join'](_0x404e43,_0x32f350,util['format']('%s%d.%s',_0x32f350,_0x2fbc63,'pdf'));}else{_0x56ef0a=path[_0x608e('0x35')](_0x404e43,util[_0x608e('0x18')](_0x608e('0x36'),_0x32f350,_0x608e('0x37')));}_0x55df6e['push'](writePDFDocument(_0x51d557,_0x56ef0a));}return Promise[_0x608e('0x38')](_0x55df6e);})[_0x608e('0x28')](function(){if(_0x4fc196){return new Promise(function(_0x25cff7){zipdir(path[_0x608e('0x35')](_0x404e43,_0x32f350),{'saveTo':path['join'](_0x404e43,util[_0x608e('0x18')]('%s.%s',_0x32f350,_0x608e('0x39')))},function(){rimraf(path[_0x608e('0x35')](_0x404e43,_0x32f350),function(){});_0x25cff7(_0x608e('0x3a'));});});}})[_0x608e('0x28')](function(){if(!_0x4fc196)return;rimraf(path['join'](_0x404e43,_0x32f350),function(){});})[_0x608e('0x28')](function(){logger['info'](util['format'](_0x608e('0x3b'),EXTRACTED_REPORT_ID,_0x608e('0x3c')));return analyticExtractedReport(_0x608e('0x3d'),_0x4fc196?util[_0x608e('0x18')]('%s.%s',_0x32f350,_0x4fc196?_0x608e('0x39'):_0x608e('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x608e('0x18')](_0x608e('0x3e'),EXTRACTED_REPORT_ID,_0x608e('0x3c')));return db[_0x608e('0xc')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x608e('0x28')](function(_0x3c7a35){EXTRACTED_REPORT=_0x3c7a35;return dbH[_0x608e('0x2b')][_0x608e('0x2e')](util[_0x608e('0x18')](_0x608e('0x3f'),QUERY),{'type':dbH[_0x608e('0x2b')]['QueryTypes'][_0x608e('0x2d')]});})['then'](extractReport)[_0x608e('0x40')](function(_0x882b52){logger[_0x608e('0x41')](util[_0x608e('0x18')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x608e('0x3c')),util[_0x608e('0x42')](_0x882b52,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x608e('0x43'));})[_0x608e('0x44')](function(){process[_0x608e('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x15bca0=new PdfPrinter({'Arial':{'normal':__dirname+_0x608e('0x46'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x608e('0x47'),'bolditalics':__dirname+_0x608e('0x48')}});return _0x15bca0;}function getPDFDocDefinitionFromHTML(_0x330145,_0x365e5f){var _0x35d22a=util[_0x608e('0x18')](_0x608e('0x49'),_0x365e5f[_0x608e('0x4a')],_0x365e5f[_0x608e('0x4b')]);var _0x35bfc6=moment()[_0x608e('0x18')](_0x608e('0x4c'))[_0x608e('0x4d')]();var _0x39cc0e=htmlToPdfmake(_0x330145,{'window':window,'tableAutoSize':!![]});return{'content':[_0x39cc0e],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x608e('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x608e('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x608e('0x4e')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x608e('0x4f')}];},'footer':function(_0x1fa5aa,_0x395a34){return[{'text':util['format'](_0x608e('0x50'),_0x35d22a,_0x1fa5aa,_0x395a34,_0x35bfc6),'style':'footer'}];}};}function writePDFDocument(_0x978be3,_0x506266){return new Promise(function(_0x3f8f34,_0x2448f6){var _0x3a27ae=_0x978be3[_0x608e('0x51')](fs['createWriteStream'](_0x506266));_0x3a27ae['on'](_0x608e('0x52'),function(){_0x3f8f34('finish');});_0x3a27ae['on'](_0x608e('0x53'),function(_0x49ab1b){_0x2448f6(_0x49ab1b);});_0x978be3[_0x608e('0x54')]();});}exports['createPdfFromHTML']=function(_0x9d7250,_0x48b0ef){var _0x556dce=getPDFPrinter();var _0x141908=getPDFDocDefinitionFromHTML(_0x9d7250,_0x48b0ef);var _0x5cc7a0=_0x556dce['createPdfKitDocument'](_0x141908);return writePDFDocument(_0x5cc7a0,_0x48b0ef[_0x608e('0x55')])[_0x608e('0x40')](function(_0x264cd0){throw _0x264cd0;});}; \ No newline at end of file +var _0x3d5e=['startDate','endDate','header','pageBreak','before','landscape','\x20/\x20','Arial','right','num','Empty','find','split','splitSizePdf','then','range','forEach','query','sequelize','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','existsSync','mkdirSync','join','flatten','createPdfKitDocument','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','catch','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','dbH','analytics','argv','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','body','concat','chunk','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name'];(function(_0x42b21d,_0x466185){var _0x444319=function(_0x2cadbf){while(--_0x2cadbf){_0x42b21d['push'](_0x42b21d['shift']());}};_0x444319(++_0x466185);}(_0x3d5e,0x90));var _0xe3d5=function(_0x34d22a,_0x441d18){_0x34d22a=_0x34d22a-0x0;var _0x1bd7d8=_0x3d5e[_0x34d22a];return _0x1bd7d8;};'use strict';var _=require(_0xe3d5('0x0'));var fs=require('fs');var util=require(_0xe3d5('0x1'));var path=require(_0xe3d5('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xe3d5('0x3'));var PdfPrinter=require(_0xe3d5('0x4'));var zipdir=require(_0xe3d5('0x5'));var rimraf=require(_0xe3d5('0x6'));var JSDOM=require(_0xe3d5('0x7'))[_0xe3d5('0x8')];var window=new JSDOM('')[_0xe3d5('0x9')];var BPromise=require(_0xe3d5('0xa'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xe3d5('0xb')];var logger=require('../../config/logger')(_0xe3d5('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0xe3d5('0xd')][0x2]);var QUERY=process[_0xe3d5('0xd')][0x3];var PATH=process[_0xe3d5('0xd')][0x4];var NAME=process[_0xe3d5('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e0dac,_0x264e86){var _0xfa21b5={'status':_0x2e0dac};var _0x329d21={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x264e86){_0xfa21b5['savename']=_0x264e86;}return db[_0xe3d5('0xe')][_0xe3d5('0xf')](_0xfa21b5,_0x329d21);}function getHeaders(_0x1b4f0c){return _[_0xe3d5('0x10')](_0x1b4f0c,function(_0x3809e3){return{'text':_0x3809e3,'style':'tableHeader'};});}function getRows(_0x2ae808,_0x4ab6d6){return _[_0xe3d5('0x10')](_0x4ab6d6,function(_0x482b83){return _(_0x482b83)[_0xe3d5('0x11')](_0x2ae808)[_0xe3d5('0x10')](function(_0x554966){return _0x554966?_[_0xe3d5('0x12')](_0x554966):'';})[_0xe3d5('0x13')]();});}function createTable(_0x4bff1c,_0x3acc94){var _0x226cb8={'widths':_[_0xe3d5('0x14')](Array(_0x4bff1c[_0xe3d5('0x15')]),0x91),'heights':function(_0x4327d9){return _0x4327d9===0x0?_0xe3d5('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x18cff1=getHeaders(_0x4bff1c);_0x226cb8[_0xe3d5('0x17')]['push'](_0x18cff1);var _0x545d57=getRows(_0x4bff1c,_0x3acc94);_0x226cb8['body']=_0x226cb8[_0xe3d5('0x17')][_0xe3d5('0x18')](_0x545d57);return _0x226cb8;}function createTables(_0x1bd0da){var _0x101f19=[];var _0x42c1c6=_[_0xe3d5('0x19')](Object['keys'](_0x1bd0da[0x0]),0x5);_0x42c1c6['forEach'](function(_0x3dda60){_0x101f19[_0xe3d5('0x1a')](createTable(_0x3dda60,_0x1bd0da));});return _0x101f19;}function getPDFDocDefinition(_0x4473cc){var _0x54d4c4=util[_0xe3d5('0x1b')](_0xe3d5('0x1c'),NAME,EXTRACTED_REPORT[_0xe3d5('0x1d')],moment(EXTRACTED_REPORT[_0xe3d5('0x1e')])[_0xe3d5('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xe3d5('0x1f')])[_0xe3d5('0x1b')](FORMAT));var _0x223a43=[];for(var _0x540e33=0x0;_0x540e33<_0x4473cc['length'];_0x540e33++){var _0x364a02=[];if(_0x540e33===0x0){_0x364a02['push']({'text':_0x54d4c4,'style':_0xe3d5('0x20')});}var _0x3f95cb={'table':_0x4473cc[_0x540e33]};if(_0x540e33>0x0){_0x3f95cb[_0xe3d5('0x21')]=_0xe3d5('0x22');_0x3f95cb['margin']=[0x0,0x46,0x0,0x0];}_0x364a02[_0xe3d5('0x1a')](_0x3f95cb);_0x223a43[_0xe3d5('0x1a')](_0x364a02);}return{'pageSize':'A4','pageOrientation':_0xe3d5('0x23'),'content':_0x223a43,'footer':function(_0x6ba194,_0x194d6d){return{'text':_0x6ba194[_0xe3d5('0x12')]()+_0xe3d5('0x24')+_0x194d6d,'style':'footer'};},'defaultStyle':{'font':_0xe3d5('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xe3d5('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4fa73c){var _0x18198f=0x1388;var _0x581b50;if(!_0x4fa73c[0x0][_0xe3d5('0x27')]){return analyticExtractedReport(_0xe3d5('0x28'));}return db['Setting'][_0xe3d5('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe3d5('0x2a'),_0xe3d5('0x2b')]})[_0xe3d5('0x2c')](function(_0x225e8c){if(_0x225e8c){_0x581b50=_0x225e8c;_0x18198f=_0x581b50['splitSizePdf']||0x3e8;}})[_0xe3d5('0x2c')](function(){var _0x1688d0=[];var _0x10fa74=0x0;if(_0x581b50[_0xe3d5('0x2a')]){if(_0x4fa73c&&_0x4fa73c[_0xe3d5('0x15')]){var _0x40fb98=_[_0xe3d5('0x2d')](_0x4fa73c[0x0][_0xe3d5('0x27')]/_0x18198f);var _0x107261=Number['isInteger'](_0x4fa73c[0x0]['num']/_0x18198f)?_0x4fa73c[0x0][_0xe3d5('0x27')]%_0x18198f:0x0;_0x40fb98[_0xe3d5('0x2e')](function(_0x400b9d){if(_0x400b9d>0x0){_0x10fa74+=_0x18198f;}_0x1688d0[_0xe3d5('0x1a')](dbH['sequelize'][_0xe3d5('0x2f')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x18198f,_0x10fa74),{'type':dbH[_0xe3d5('0x30')][_0xe3d5('0x31')][_0xe3d5('0x32')]}));});if(_0x107261>0x0){_0x10fa74+=_0x18198f;_0x1688d0[_0xe3d5('0x1a')](dbH['sequelize'][_0xe3d5('0x2f')](util[_0xe3d5('0x1b')](_0xe3d5('0x33'),QUERY,_0x107261,_0x10fa74),{'type':dbH[_0xe3d5('0x30')][_0xe3d5('0x31')][_0xe3d5('0x32')]}));}}}else{_0x1688d0[_0xe3d5('0x1a')](dbH[_0xe3d5('0x30')]['query'](QUERY,{'type':dbH[_0xe3d5('0x30')]['QueryTypes'][_0xe3d5('0x32')]}));}var _0x1b7f66=path[_0xe3d5('0x34')](PATH);var _0x4ec7d9=path[_0xe3d5('0x35')](PATH,_0xe3d5('0x36'));var _0x8802d1=_0x581b50['split']&&_0x1688d0['length']>0x1;var _0x57f96a=[];if(!fs[_0xe3d5('0x37')](path['join'](_0x1b7f66,_0x4ec7d9))&&_0x8802d1){fs[_0xe3d5('0x38')](path[_0xe3d5('0x39')](_0x1b7f66,_0x4ec7d9));}return BPromise['each'](_0x1688d0,function(_0x3d85b5){_0x57f96a[_0xe3d5('0x1a')](_0x3d85b5);})[_0xe3d5('0x2c')](function(){var _0x25cf68=[];for(var _0x150dc6=0x0;_0x150dc6<_0x57f96a[_0xe3d5('0x15')];_0x150dc6+=0x1){var _0x491073=_0x57f96a[_0x150dc6];var _0x41614e=createTables(_[_0xe3d5('0x3a')](_0x491073));var _0x2c4106;var _0x856b24=getPDFDocDefinition(_0x41614e);var _0x4240e8=getPDFPrinter();var _0x4c82d3=_0x4240e8[_0xe3d5('0x3b')](_0x856b24);if(_0x8802d1){_0x2c4106=path['join'](_0x1b7f66,_0x4ec7d9,util[_0xe3d5('0x1b')](_0xe3d5('0x3c'),_0x4ec7d9,_0x150dc6,'pdf'));}else{_0x2c4106=path['join'](_0x1b7f66,util['format'](_0xe3d5('0x3d'),_0x4ec7d9,_0xe3d5('0x3e')));}_0x25cf68[_0xe3d5('0x1a')](writePDFDocument(_0x4c82d3,_0x2c4106));}return Promise[_0xe3d5('0x3f')](_0x25cf68);})[_0xe3d5('0x2c')](function(){if(_0x8802d1){return new Promise(function(_0x283005){zipdir(path[_0xe3d5('0x39')](_0x1b7f66,_0x4ec7d9),{'saveTo':path[_0xe3d5('0x39')](_0x1b7f66,util['format'](_0xe3d5('0x3d'),_0x4ec7d9,_0xe3d5('0x40')))},function(){rimraf(path[_0xe3d5('0x39')](_0x1b7f66,_0x4ec7d9),function(){});_0x283005(_0xe3d5('0x41'));});});}})['then'](function(){if(!_0x8802d1)return;rimraf(path['join'](_0x1b7f66,_0x4ec7d9),function(){});})[_0xe3d5('0x2c')](function(){logger[_0xe3d5('0x42')](util[_0xe3d5('0x1b')](_0xe3d5('0x43'),EXTRACTED_REPORT_ID,_0xe3d5('0x44')));return analyticExtractedReport(_0xe3d5('0x45'),_0x8802d1?util[_0xe3d5('0x1b')](_0xe3d5('0x3d'),_0x4ec7d9,_0x8802d1?_0xe3d5('0x40'):_0xe3d5('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xe3d5('0x42')](util[_0xe3d5('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe3d5('0x44')));return db[_0xe3d5('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xe3d5('0x2c')](function(_0x3e0927){EXTRACTED_REPORT=_0x3e0927;return dbH[_0xe3d5('0x30')][_0xe3d5('0x2f')](util[_0xe3d5('0x1b')](_0xe3d5('0x46'),QUERY),{'type':dbH[_0xe3d5('0x30')]['QueryTypes'][_0xe3d5('0x32')]});})[_0xe3d5('0x2c')](extractReport)['catch'](function(_0x1a4007){logger[_0xe3d5('0x42')](util['format'](_0xe3d5('0x47'),EXTRACTED_REPORT_ID,_0xe3d5('0x44')),util[_0xe3d5('0x48')](_0x1a4007,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xe3d5('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x312207=new PdfPrinter({'Arial':{'normal':__dirname+_0xe3d5('0x4a'),'bold':__dirname+_0xe3d5('0x4b'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xe3d5('0x4c')}});return _0x312207;}function getPDFDocDefinitionFromHTML(_0x401fa0,_0x49ef68){var _0x1628d8=util[_0xe3d5('0x1b')](_0xe3d5('0x4d'),_0x49ef68[_0xe3d5('0x4e')],_0x49ef68[_0xe3d5('0x4f')]);var _0x6b95d8=moment()[_0xe3d5('0x1b')]('YYYY-MM-DD')['toString']();var _0xc282f4=htmlToPdfmake(_0x401fa0,{'window':window,'tableAutoSize':!![]});return{'content':[_0xc282f4],'defaultStyle':{'font':_0xe3d5('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xe3d5('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x40f12e,_0x5b044e){return[{'text':util[_0xe3d5('0x1b')](_0xe3d5('0x51'),_0x1628d8,_0x40f12e,_0x5b044e,_0x6b95d8),'style':'footer'}];}};}function writePDFDocument(_0x482d77,_0x48131f){return new Promise(function(_0x577919,_0x69938d){var _0x446e12=_0x482d77[_0xe3d5('0x52')](fs['createWriteStream'](_0x48131f));_0x446e12['on'](_0xe3d5('0x53'),function(){_0x577919('finish');});_0x446e12['on'](_0xe3d5('0x54'),function(_0xa861c1){_0x69938d(_0xa861c1);});_0x482d77['end']();});}exports[_0xe3d5('0x55')]=function(_0x43bafa,_0x5f04bd){var _0x15ae35=getPDFPrinter();var _0x342d34=getPDFDocDefinitionFromHTML(_0x43bafa,_0x5f04bd);var _0x361dba=_0x15ae35[_0xe3d5('0x3b')](_0x342d34);return writePDFDocument(_0x361dba,_0x5f04bd['path'])[_0xe3d5('0x56')](function(_0x3f2837){throw _0x3f2837;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index e1e574f..b0cc6dc 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 _0xf4a3=['dbH','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','xlsx','%s.%s','writeFileSync','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','json2xls','zip-dir','../../mysqldb'];(function(_0x48f1a9,_0xfa54ff){var _0x4b9ec4=function(_0x4bc923){while(--_0x4bc923){_0x48f1a9['push'](_0x48f1a9['shift']());}};_0x4b9ec4(++_0xfa54ff);}(_0xf4a3,0xb8));var _0x3f4a=function(_0x25d913,_0x3dee16){_0x25d913=_0x25d913-0x0;var _0x437e1b=_0xf4a3[_0x25d913];return _0x437e1b;};'use strict';var util=require('util');var path=require(_0x3f4a('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x3f4a('0x1'));var BPromise=require('bluebird');var zipdir=require(_0x3f4a('0x2'));var rimraf=require('rimraf');var db=require(_0x3f4a('0x3'))['db'];var dbH=require(_0x3f4a('0x3'))[_0x3f4a('0x4')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3f4a('0x5')][0x3];var PATH=process[_0x3f4a('0x5')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5eca91,_0x5087fc){var _0x1c371f={'status':_0x5eca91};var _0x4da65e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5087fc){_0x1c371f[_0x3f4a('0x6')]=_0x5087fc;}return db[_0x3f4a('0x7')][_0x3f4a('0x8')](_0x1c371f,_0x4da65e);}function main(){var _0x164db9=0x1388;var _0x9819e1;logger['info'](util[_0x3f4a('0x9')](_0x3f4a('0xa'),EXTRACTED_REPORT_ID,_0x3f4a('0xb')));return db[_0x3f4a('0xc')][_0x3f4a('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x3f4a('0xe')]})[_0x3f4a('0xf')](function(_0x4123c9){if(_0x4123c9){_0x9819e1=_0x4123c9;_0x164db9=_0x9819e1[_0x3f4a('0xe')]||0x1388;}})[_0x3f4a('0xf')](function(){return dbH[_0x3f4a('0x10')]['query'](util[_0x3f4a('0x9')](_0x3f4a('0x11'),QUERY),{'type':dbH[_0x3f4a('0x10')][_0x3f4a('0x12')][_0x3f4a('0x13')]});})[_0x3f4a('0xf')](function(_0x58c299){if(!_0x58c299[0x0][_0x3f4a('0x14')]){return analyticExtractedReport('Empty');}var _0x34f91c=[];var _0x3843af=0x0;if(_0x9819e1['split']){if(_0x58c299&&_0x58c299[_0x3f4a('0x15')]){var _0x415342=_[_0x3f4a('0x16')](_0x58c299[0x0][_0x3f4a('0x14')]/_0x164db9);var _0x2ea6fe=Number[_0x3f4a('0x17')](_0x58c299[0x0]['num']/_0x164db9)?_0x58c299[0x0][_0x3f4a('0x14')]%_0x164db9:0x0;_0x415342[_0x3f4a('0x18')](function(_0x5e71cc){if(_0x5e71cc>0x0){_0x3843af+=_0x164db9;}_0x34f91c[_0x3f4a('0x19')](dbH[_0x3f4a('0x10')][_0x3f4a('0x1a')](util[_0x3f4a('0x9')](_0x3f4a('0x1b'),QUERY,_0x164db9,_0x3843af),{'type':dbH['sequelize'][_0x3f4a('0x12')]['SELECT']}));});if(_0x2ea6fe>0x0){_0x3843af+=_0x164db9;_0x34f91c['push'](dbH[_0x3f4a('0x10')][_0x3f4a('0x1a')](util[_0x3f4a('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2ea6fe,_0x3843af),{'type':dbH[_0x3f4a('0x10')][_0x3f4a('0x12')][_0x3f4a('0x13')]}));}}}else{_0x34f91c[_0x3f4a('0x19')](dbH[_0x3f4a('0x10')][_0x3f4a('0x1a')](QUERY,{'type':dbH[_0x3f4a('0x10')]['QueryTypes'][_0x3f4a('0x13')]}));}var _0x2ff4c4=path[_0x3f4a('0x1c')](PATH);var _0x50578b=path[_0x3f4a('0x1d')](PATH,_0x3f4a('0x1e'));var _0x43b77b=_0x9819e1['split']&&_0x34f91c[_0x3f4a('0x15')]>0x1;var _0x1ccd73=[];if(!fs[_0x3f4a('0x1f')](path[_0x3f4a('0x20')](_0x2ff4c4,_0x50578b))&&_0x43b77b){fs[_0x3f4a('0x21')](path['join'](_0x2ff4c4,_0x50578b));}return BPromise[_0x3f4a('0x22')](_0x34f91c,function(_0x2bd651){_0x1ccd73[_0x3f4a('0x19')](_0x2bd651);})[_0x3f4a('0xf')](function(){for(var _0x5d58d1=0x0;_0x5d58d1<_0x1ccd73[_0x3f4a('0x15')];_0x5d58d1+=0x1){var _0x4ae969;var _0x59af5e=_0x1ccd73[_0x5d58d1];if(_0x43b77b){_0x4ae969=path['join'](_0x2ff4c4,_0x50578b,util[_0x3f4a('0x9')]('%s%d.%s',_0x50578b,_0x5d58d1,_0x3f4a('0x23')));}else{_0x4ae969=path[_0x3f4a('0x20')](_0x2ff4c4,util[_0x3f4a('0x9')](_0x3f4a('0x24'),_0x50578b,'xlsx'));}fs[_0x3f4a('0x25')](_0x4ae969,json2xls(_0x59af5e),'binary');}})['then'](function(){if(_0x43b77b){return new Promise(function(_0x50469d){zipdir(path[_0x3f4a('0x20')](_0x2ff4c4,_0x50578b),{'saveTo':path['join'](_0x2ff4c4,util['format'](_0x3f4a('0x24'),_0x50578b,_0x3f4a('0x26')))},function(_0x456413,_0x48e36a){rimraf(path[_0x3f4a('0x20')](_0x2ff4c4,_0x50578b),function(){});_0x50469d(_0x3f4a('0x27'));});});}})[_0x3f4a('0xf')](function(){logger['info'](util[_0x3f4a('0x9')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3f4a('0xb')));return analyticExtractedReport(_0x3f4a('0x28'),_0x43b77b?util[_0x3f4a('0x9')](_0x3f4a('0x24'),_0x50578b,_0x43b77b?_0x3f4a('0x26'):_0x3f4a('0x23')):null);});})[_0x3f4a('0x29')](function(_0xf9c82b){logger['info'](util[_0x3f4a('0x9')](_0x3f4a('0x2a'),EXTRACTED_REPORT_ID,_0x3f4a('0xb')),util[_0x3f4a('0x2b')](_0xf9c82b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3f4a('0x2c'));})[_0x3f4a('0x2d')](function(){process[_0x3f4a('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xbc95=['query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','join','each','%s%d.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','XLSX','Completed','%s.%s','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','format','Setting','split','splitSizeXlsx','then','sequelize'];(function(_0x2f7e39,_0x3f178f){var _0xe20481=function(_0x1ffb55){while(--_0x1ffb55){_0x2f7e39['push'](_0x2f7e39['shift']());}};_0xe20481(++_0x3f178f);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xbc95[_0x5ddaac];return _0x2a9c58;};'use strict';var util=require(_0x5bc9('0x0'));var path=require(_0x5bc9('0x1'));var _=require(_0x5bc9('0x2'));var fs=require('fs');var json2xls=require(_0x5bc9('0x3'));var BPromise=require(_0x5bc9('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x5bc9('0x5'))[_0x5bc9('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5bc9('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2fb0a2,_0x4bdc20){var _0x49ab1a={'status':_0x2fb0a2};var _0x6cc9f1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bdc20){_0x49ab1a[_0x5bc9('0x8')]=_0x4bdc20;}return db[_0x5bc9('0x9')][_0x5bc9('0xa')](_0x49ab1a,_0x6cc9f1);}function main(){var _0x24d4b3=0x1388;var _0x2caa35;logger['info'](util[_0x5bc9('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5bc9('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5bc9('0xd'),_0x5bc9('0xe')]})[_0x5bc9('0xf')](function(_0x3d60bc){if(_0x3d60bc){_0x2caa35=_0x3d60bc;_0x24d4b3=_0x2caa35[_0x5bc9('0xe')]||0x1388;}})['then'](function(){return dbH[_0x5bc9('0x10')][_0x5bc9('0x11')](util['format'](_0x5bc9('0x12'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x5bc9('0x13')]});})[_0x5bc9('0xf')](function(_0x298800){if(!_0x298800[0x0][_0x5bc9('0x14')]){return analyticExtractedReport(_0x5bc9('0x15'));}var _0x33053f=[];var _0x5db036=0x0;if(_0x2caa35['split']){if(_0x298800&&_0x298800[_0x5bc9('0x16')]){var _0x2db6af=_['range'](_0x298800[0x0][_0x5bc9('0x14')]/_0x24d4b3);var _0x46963b=Number[_0x5bc9('0x17')](_0x298800[0x0]['num']/_0x24d4b3)?_0x298800[0x0][_0x5bc9('0x14')]%_0x24d4b3:0x0;_0x2db6af[_0x5bc9('0x18')](function(_0x3a9007){if(_0x3a9007>0x0){_0x5db036+=_0x24d4b3;}_0x33053f['push'](dbH[_0x5bc9('0x10')]['query'](util[_0x5bc9('0xb')](_0x5bc9('0x19'),QUERY,_0x24d4b3,_0x5db036),{'type':dbH[_0x5bc9('0x10')][_0x5bc9('0x1a')][_0x5bc9('0x13')]}));});if(_0x46963b>0x0){_0x5db036+=_0x24d4b3;_0x33053f['push'](dbH['sequelize'][_0x5bc9('0x11')](util[_0x5bc9('0xb')](_0x5bc9('0x19'),QUERY,_0x46963b,_0x5db036),{'type':dbH[_0x5bc9('0x10')][_0x5bc9('0x1a')][_0x5bc9('0x13')]}));}}}else{_0x33053f[_0x5bc9('0x1b')](dbH[_0x5bc9('0x10')][_0x5bc9('0x11')](QUERY,{'type':dbH['sequelize'][_0x5bc9('0x1a')][_0x5bc9('0x13')]}));}var _0x25b70e=path[_0x5bc9('0x1c')](PATH);var _0x4f6e4b=path[_0x5bc9('0x1d')](PATH,'.xlsx');var _0x358ae1=_0x2caa35[_0x5bc9('0xd')]&&_0x33053f[_0x5bc9('0x16')]>0x1;var _0x15da5d=[];if(!fs['existsSync'](path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b))&&_0x358ae1){fs['mkdirSync'](path['join'](_0x25b70e,_0x4f6e4b));}return BPromise[_0x5bc9('0x1f')](_0x33053f,function(_0x5124db){_0x15da5d[_0x5bc9('0x1b')](_0x5124db);})['then'](function(){for(var _0x5e16a9=0x0;_0x5e16a9<_0x15da5d[_0x5bc9('0x16')];_0x5e16a9+=0x1){var _0x3982e4;var _0x17d53d=_0x15da5d[_0x5e16a9];if(_0x358ae1){_0x3982e4=path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b,util[_0x5bc9('0xb')](_0x5bc9('0x20'),_0x4f6e4b,_0x5e16a9,'xlsx'));}else{_0x3982e4=path['join'](_0x25b70e,util['format']('%s.%s',_0x4f6e4b,_0x5bc9('0x21')));}fs[_0x5bc9('0x22')](_0x3982e4,json2xls(_0x17d53d),_0x5bc9('0x23'));}})[_0x5bc9('0xf')](function(){if(_0x358ae1){return new Promise(function(_0x160c60){zipdir(path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b),{'saveTo':path[_0x5bc9('0x1e')](_0x25b70e,util[_0x5bc9('0xb')]('%s.%s',_0x4f6e4b,_0x5bc9('0x24')))},function(_0x59c5cc,_0x4def17){rimraf(path[_0x5bc9('0x1e')](_0x25b70e,_0x4f6e4b),function(){});_0x160c60(_0x5bc9('0x25'));});});}})[_0x5bc9('0xf')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5bc9('0x26')));return analyticExtractedReport(_0x5bc9('0x27'),_0x358ae1?util[_0x5bc9('0xb')](_0x5bc9('0x28'),_0x4f6e4b,_0x358ae1?_0x5bc9('0x24'):_0x5bc9('0x21')):null);});})[_0x5bc9('0x29')](function(_0x2219d5){logger['info'](util[_0x5bc9('0xb')](_0x5bc9('0x2a'),EXTRACTED_REPORT_ID,_0x5bc9('0x26')),util[_0x5bc9('0x2b')](_0x2219d5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5bc9('0x2c'));})[_0x5bc9('0x2d')](function(){process[_0x5bc9('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 2621f0b..a0d1e63 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 _0x38ce=['models','findAll','then','VoiceExtension','IntervalId','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','extensions','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','intervals','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','appType','$[${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','sortBy','catch','rewrite','util'];(function(_0x17c656,_0x181d7b){var _0x516422=function(_0x2c7079){while(--_0x2c7079){_0x17c656['push'](_0x17c656['shift']());}};_0x516422(++_0x181d7b);}(_0x38ce,0x15d));var _0xe38c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x38ce[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xe38c('0x0'));function rewrite(_0x21f411,_0x25693b){var _0x4433f3=this;return _0x21f411[_0xe38c('0x1')]['Interval'][_0xe38c('0x2')]({'raw':!![]})[_0xe38c('0x3')](function(_0x5842b1){_0x4433f3['intervals']=_0x5842b1;return _0x21f411[_0xe38c('0x1')][_0xe38c('0x4')][_0xe38c('0x2')]({'where':{'IntervalId':_0x25693b[_0xe38c('0x5')]},'raw':!![]});})['then'](function(_0x23f51d){return _0x21f411[_0xe38c('0x1')]['VoiceExtension'][_0xe38c('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0xe38c('0x6')](_0x23f51d,'exten'))}},'order':[{'raw':_0xe38c('0x7')}],'raw':!![]});})[_0xe38c('0x3')](function(_0x252c72){var _0x79b0ce=_[_0xe38c('0x8')](_0x252c72,{'priority':'1'});var _0x920f47=_[_0xe38c('0x8')](_0x252c72,{'isApp':0x1});var _0x337a21=_[_0xe38c('0x9')](_0x920f47,_0xe38c('0xa'));var _0x1a84f0=[_0xe38c('0xb'),_0xe38c('0xc')];var _0x1e188e=[];var _0x536723=[];for(var _0x38dad2 in _0x337a21){if(_0x337a21['hasOwnProperty'](_0x38dad2)){_0x4433f3['priority']=0x2;_0x4433f3[_0xe38c('0xd')]=[];_0x4433f3['extension']=_['find'](_0x79b0ce,{'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')]});_0x4433f3[_0xe38c('0xd')][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':util[_0xe38c('0x11')](_0xe38c('0x12'),_0x337a21[_0x38dad2][0x0]['type']),'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3[_0xe38c('0x14')]++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});if(_0x337a21[_0x38dad2][0x0]['type']===_0xe38c('0x16')){_0x4433f3[_0xe38c('0xd')][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':'Set','appdata':'CDR(routeid)='+_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')],'context':_0x337a21[_0x38dad2][0x0]['context'],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3[_0xe38c('0x14')]++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0]['VoiceExtensionId']});}else if(_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')]===_0xe38c('0x17')){if(_0x4433f3[_0xe38c('0x18')]){_0x4433f3[_0xe38c('0xd')][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x19')+(_0x4433f3[_0xe38c('0x18')][_0xe38c('0x1a')]?_0xe38c('0x1b')+_0x4433f3[_0xe38c('0x18')]['cutdigits']+'}':_0xe38c('0x1c')),'context':_0x337a21[_0x38dad2][0x0]['context'],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3[_0xe38c('0x14')]++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});}_0x4433f3['extensions'][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0]['type'],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x1d')+_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')],'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3['priority']++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0]['VoiceExtensionId']});var _0x61db3c=_0x4433f3['priority']++;_0x4433f3[_0xe38c('0xd')]['push']({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x61db3c+0x2)+_0xe38c('0x1e')+(_0x61db3c+0x1)+')','context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x61db3c,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0]['VoiceExtensionId']});if(_0x4433f3[_0xe38c('0x18')]){_0x4433f3['extensions'][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':_0x4433f3[_0xe38c('0x18')][_0xe38c('0x1a')]?_0xe38c('0x1f')+_0x4433f3[_0xe38c('0x18')]['cutdigits']+'}':_0xe38c('0x20'),'context':_0x337a21[_0x38dad2][0x0]['context'],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3['priority']++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});}_0x4433f3[_0xe38c('0xd')][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0]['type'],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x21')+_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')],'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3[_0xe38c('0x14')]++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});if(_0x4433f3[_0xe38c('0x18')]&&_0x4433f3['extension'][_0xe38c('0x22')]('recordingFormat')&&_0x4433f3[_0xe38c('0x18')][_0xe38c('0x23')]!==_0xe38c('0x24')){_0x4433f3[_0xe38c('0xd')][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x25'),'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3['priority']++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0]['VoiceExtensionId']});_0x4433f3[_0xe38c('0xd')]['push']({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x26')+_0x4433f3[_0xe38c('0x18')][_0xe38c('0x23')]||'wav','context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3['priority']++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});}}_0x4433f3[_0xe38c('0xd')][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x27'),'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3[_0xe38c('0x14')]++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});_0x4433f3[_0xe38c('0xd')][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x28'),'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3[_0xe38c('0x14')]++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});_0x4433f3[_0xe38c('0xd')]['push']({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x29'),'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'priority':_0x4433f3[_0xe38c('0x14')]++,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0]['VoiceExtensionId']});for(var _0x3c6ef1=0x0,_0x46049e=0x0;_0x3c6ef1<_0x337a21[_0x38dad2][_0xe38c('0x2a')];_0x3c6ef1+=0x1,_0x46049e=0x0){var _0x38b729=_0x337a21[_0x38dad2][_0x3c6ef1];if(_0x38b729[_0xe38c('0xf')]){_0x38b729[_0xe38c('0xf')]=_0x38b729['type'][_0xe38c('0x2b')]();}var _0x565f99=[];var _0x4d7e24=[];delete _0x38b729['id'];delete _0x38b729[_0xe38c('0x2c')];delete _0x38b729[_0xe38c('0x2d')];var _0x135560=_0x38b729[_0xe38c('0x2e')]!=='*,*,*,*'?[_0x38b729['interval']]:_0x38b729[_0xe38c('0x5')]?_['map'](_[_0xe38c('0x8')](_0x4433f3[_0xe38c('0x2f')],{'IntervalId':_0x38b729[_0xe38c('0x5')]}),_0xe38c('0x2e')):[];if(_0x38b729[_0xe38c('0x22')](_0xe38c('0x30'))){if(_0x38b729['tag']&&_0x38b729['tag']!=='--'){_0x565f99[_0xe38c('0xe')]({'type':_0x38b729[_0xe38c('0xf')],'app':'Set','appdata':_0xe38c('0x31')+_0x38b729[_0xe38c('0x30')],'context':_0x38b729['context'],'exten':_0x38b729['exten'],'priority':_0x135560[_0xe38c('0x2a')]+_0x4433f3[_0xe38c('0x14')]+_0x46049e++,'VoiceExtensionId':_0x38b729[_0xe38c('0x15')]});}}if(_0x38b729[_0xe38c('0xf')]===_0xe38c('0x17')&&_0x38b729['hasOwnProperty'](_0xe38c('0x32'))){if(_0x38b729[_0xe38c('0x32')]){_0x565f99['push']({'type':_0x38b729[_0xe38c('0xf')],'app':_0xe38c('0x33'),'appdata':_0xe38c('0x34')+_0x38b729[_0xe38c('0x32')]+')','context':_0x38b729['context'],'exten':_0x38b729[_0xe38c('0xa')],'priority':_0x135560[_0xe38c('0x2a')]+_0x4433f3[_0xe38c('0x14')]+_0x46049e++,'VoiceExtensionId':_0x38b729[_0xe38c('0x15')]});}else{_0x565f99[_0xe38c('0xe')]({'type':_0x38b729[_0xe38c('0xf')],'app':_0xe38c('0x33'),'appdata':_0xe38c('0x35'),'context':_0x38b729['context'],'exten':_0x38b729[_0xe38c('0xa')],'priority':_0x135560['length']+_0x4433f3[_0xe38c('0x14')]+_0x46049e++,'VoiceExtensionId':_0x38b729[_0xe38c('0x15')]});}}if(_0x38b729['hasOwnProperty'](_0xe38c('0x36'))){if(_0x1a84f0['indexOf'](_0x38b729['app'][_0xe38c('0x2b')]())>=0x0&&_0x38b729[_0xe38c('0x37')]!=='custom'){if(_0x38b729['answer']){_0x565f99[_0xe38c('0xe')]({'type':_0x38b729[_0xe38c('0xf')],'app':_0xe38c('0x33'),'appdata':_0xe38c('0x38'),'context':_0x38b729['context'],'exten':_0x38b729['exten'],'priority':_0x135560[_0xe38c('0x2a')]+_0x4433f3[_0xe38c('0x14')]+_0x46049e++,'VoiceExtensionId':_0x38b729[_0xe38c('0x15')]});_0x565f99['push']({'type':_0x38b729['type'],'app':'Set','appdata':_0xe38c('0x39'),'context':_0x38b729[_0xe38c('0x13')],'exten':_0x38b729[_0xe38c('0xa')],'priority':_0x135560[_0xe38c('0x2a')]+_0x4433f3[_0xe38c('0x14')]+_0x46049e++,'VoiceExtensionId':_0x38b729['VoiceExtensionId']});}else{_0x565f99['push']({'type':_0x38b729[_0xe38c('0xf')],'app':_0xe38c('0x33'),'appdata':_0xe38c('0x3a'),'context':_0x38b729[_0xe38c('0x13')],'exten':_0x38b729[_0xe38c('0xa')],'priority':_0x135560['length']+_0x4433f3[_0xe38c('0x14')]+_0x46049e++,'VoiceExtensionId':_0x38b729[_0xe38c('0x15')]});_0x565f99[_0xe38c('0xe')]({'type':_0x38b729['type'],'app':_0xe38c('0x10'),'appdata':_0xe38c('0x3b'),'context':_0x38b729[_0xe38c('0x13')],'exten':_0x38b729[_0xe38c('0xa')],'priority':_0x135560[_0xe38c('0x2a')]+_0x4433f3['priority']+_0x46049e++,'VoiceExtensionId':_0x38b729[_0xe38c('0x15')]});}}}for(var _0x3f5e85=0x0;_0x3f5e85<_0x135560[_0xe38c('0x2a')];_0x3f5e85+=0x1){var _0xfc01f4=_0x4433f3[_0xe38c('0x14')]+_0x135560[_0xe38c('0x2a')];var _0x8f7d5d=_0x3f5e85===_0x135560[_0xe38c('0x2a')]-0x1?_0x4433f3['priority']+_0x565f99[_0xe38c('0x2a')]+_0x4d7e24['length']+0x2:_0x4433f3[_0xe38c('0x14')]+_0x3f5e85+0x1;_0x565f99[_0xe38c('0x3c')](_0x3f5e85,0x0,{'type':_0x38b729[_0xe38c('0xf')],'app':'GotoIfTime','appdata':_0x135560[_0x3f5e85]+'?'+_0x38b729[_0xe38c('0x13')]+_0xe38c('0x3d')+_0xfc01f4+':'+_0x38b729[_0xe38c('0x13')]+_0xe38c('0x3d')+_0x8f7d5d,'exten':_0x38b729[_0xe38c('0xa')],'context':_0x38b729[_0xe38c('0x13')],'priority':_0x4433f3[_0xe38c('0x14')]+_0x3f5e85,'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});}_0x38b729[_0xe38c('0x14')]=_0x565f99[_0xe38c('0x2a')]?_[_0xe38c('0x3e')](_0x565f99)[_0xe38c('0x14')]+0x1:_0x4433f3[_0xe38c('0x14')];_0x4433f3[_0xe38c('0x14')]=(_0x4d7e24[_0xe38c('0x2a')]?_[_0xe38c('0x3e')](_0x4d7e24)[_0xe38c('0x14')]:_0x38b729[_0xe38c('0x14')])+0x1;_0x4433f3['extensions']=_['concat'](_0x4433f3[_0xe38c('0xd')],_0x565f99,[_0x38b729],_0x4d7e24);}_0x4433f3['extensions'][_0xe38c('0xe')]({'type':_0x337a21[_0x38dad2][0x0][_0xe38c('0xf')],'app':'Hangup','exten':_0x337a21[_0x38dad2][0x0][_0xe38c('0xa')],'context':_0x337a21[_0x38dad2][0x0][_0xe38c('0x13')],'priority':_0x4433f3['priority'],'VoiceExtensionId':_0x337a21[_0x38dad2][0x0][_0xe38c('0x15')]});_0x1e188e[_0xe38c('0xe')](_0x337a21[_0x38dad2][0x0]['VoiceExtensionId']);_0x536723=_[_0xe38c('0x3f')](_0x536723,_0x4433f3['extensions']);}}return _0x21f411[_0xe38c('0x40')](function(_0x3be34c){return _0x21f411['models'][_0xe38c('0x4')][_0xe38c('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x1e188e}},'transaction':_0x3be34c})[_0xe38c('0x3')](function(_0x2970c3){return _0x21f411['models']['VoiceExtension'][_0xe38c('0x42')](_[_0xe38c('0x43')](_0x536723,_0xe38c('0x14')),{'transaction':_0x3be34c});});});})[_0xe38c('0x44')](function(_0xab4853){console['error'](_0xab4853);});}exports[_0xe38c('0x45')]=rewrite; \ No newline at end of file +var _0xd312=['Hangup','transaction','VoiceExtension','destroy','bulkCreate','sortBy','catch','lodash','util','models','Interval','then','intervals','findAll','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','push','Set','format','CDR(type)=%s','type','VoiceExtensionId','inbound','CDR(routeid)=','context','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','tag','outbound','callerID','answer','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat'];(function(_0x57105b,_0xc60612){var _0x1f971f=function(_0x5510da){while(--_0x5510da){_0x57105b['push'](_0x57105b['shift']());}};_0x1f971f(++_0xc60612);}(_0xd312,0x127));var _0x2d31=function(_0x31d82a,_0x50c485){_0x31d82a=_0x31d82a-0x0;var _0x50abe3=_0xd312[_0x31d82a];return _0x50abe3;};'use strict';var _=require(_0x2d31('0x0'));var util=require(_0x2d31('0x1'));function rewrite(_0x212292,_0x3433ed){var _0xe419e4=this;return _0x212292[_0x2d31('0x2')][_0x2d31('0x3')]['findAll']({'raw':!![]})[_0x2d31('0x4')](function(_0xde5e6b){_0xe419e4[_0x2d31('0x5')]=_0xde5e6b;return _0x212292[_0x2d31('0x2')]['VoiceExtension'][_0x2d31('0x6')]({'where':{'IntervalId':_0x3433ed[_0x2d31('0x7')]},'raw':!![]});})[_0x2d31('0x4')](function(_0x15ac0b){return _0x212292['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x2d31('0x8')](_[_0x2d31('0x9')](_0x15ac0b,_0x2d31('0xa')))}},'order':[{'raw':_0x2d31('0xb')}],'raw':!![]});})[_0x2d31('0x4')](function(_0x56925b){var _0x436914=_[_0x2d31('0xc')](_0x56925b,{'priority':'1'});var _0x5431c4=_[_0x2d31('0xc')](_0x56925b,{'isApp':0x1});var _0x6ed205=_[_0x2d31('0xd')](_0x5431c4,_0x2d31('0xa'));var _0x4dd8d9=[_0x2d31('0xe'),_0x2d31('0xf')];var _0x515845=[];var _0x7e11b1=[];for(var _0x422af6 in _0x6ed205){if(_0x6ed205[_0x2d31('0x10')](_0x422af6)){_0xe419e4[_0x2d31('0x11')]=0x2;_0xe419e4[_0x2d31('0x12')]=[];_0xe419e4['extension']=_[_0x2d31('0x13')](_0x436914,{'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':util[_0x2d31('0x16')](_0x2d31('0x17'),_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')]),'context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});if(_0x6ed205[_0x422af6][0x0]['type']===_0x2d31('0x1a')){_0xe419e4['extensions'][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x1b')+_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')],'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}else if(_0x6ed205[_0x422af6][0x0]['type']==='outbound'){if(_0xe419e4[_0x2d31('0x1d')]){_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x1e')+(_0xe419e4[_0x2d31('0x1d')]['cutdigits']?_0x2d31('0x1f')+_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x20')]+'}':_0x2d31('0x21')),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}_0xe419e4['extensions'][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x1b')+_0x6ed205[_0x422af6][0x0]['VoiceExtensionId'],'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0]['VoiceExtensionId']});var _0x26a75e=_0xe419e4[_0x2d31('0x11')]++;_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x22'),'appdata':_0x2d31('0x23')+(_0x26a75e+0x2)+_0x2d31('0x24')+(_0x26a75e+0x1)+')','context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0]['exten'],'priority':_0x26a75e,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});if(_0xe419e4['extension']){_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0xe419e4[_0x2d31('0x1d')]['cutdigits']?_0x2d31('0x25')+_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x20')]+'}':_0x2d31('0x26'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0]['VoiceExtensionId']});}_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x27')+_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')],'context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0]['VoiceExtensionId']});if(_0xe419e4[_0x2d31('0x1d')]&&_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x10')](_0x2d31('0x28'))&&_0xe419e4[_0x2d31('0x1d')][_0x2d31('0x28')]!==_0x2d31('0x29')){_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x2a'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x2b')+_0xe419e4['extension'][_0x2d31('0x28')]||_0x2d31('0x2c'),'context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0]['exten'],'priority':_0xe419e4['priority']++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}}_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0]['type'],'app':_0x2d31('0x15'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x6ed205[_0x422af6][0x0]['context'],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x2d'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0]['exten'],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0xe419e4[_0x2d31('0x12')][_0x2d31('0x14')]({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x2e'),'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'priority':_0xe419e4[_0x2d31('0x11')]++,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});for(var _0x4225d5=0x0,_0x21c5f5=0x0;_0x4225d5<_0x6ed205[_0x422af6][_0x2d31('0x2f')];_0x4225d5+=0x1,_0x21c5f5=0x0){var _0x5d4d8f=_0x6ed205[_0x422af6][_0x4225d5];if(_0x5d4d8f['type']){_0x5d4d8f[_0x2d31('0x18')]=_0x5d4d8f[_0x2d31('0x18')][_0x2d31('0x30')]();}var _0x4abe9d=[];var _0x53059f=[];delete _0x5d4d8f['id'];delete _0x5d4d8f[_0x2d31('0x31')];delete _0x5d4d8f['updatedAt'];var _0x251fa3=_0x5d4d8f[_0x2d31('0x32')]!==_0x2d31('0x33')?[_0x5d4d8f[_0x2d31('0x32')]]:_0x5d4d8f[_0x2d31('0x7')]?_[_0x2d31('0x9')](_[_0x2d31('0xc')](_0xe419e4['intervals'],{'IntervalId':_0x5d4d8f['IntervalId']}),_0x2d31('0x32')):[];if(_0x5d4d8f[_0x2d31('0x10')](_0x2d31('0x34'))){if(_0x5d4d8f[_0x2d31('0x34')]&&_0x5d4d8f[_0x2d31('0x34')]!=='--'){_0x4abe9d['push']({'type':_0x5d4d8f[_0x2d31('0x18')],'app':'Set','appdata':'CDR(tag)='+_0x5d4d8f[_0x2d31('0x34')],'context':_0x5d4d8f['context'],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}}if(_0x5d4d8f[_0x2d31('0x18')]===_0x2d31('0x35')&&_0x5d4d8f[_0x2d31('0x10')]('callerID')){if(_0x5d4d8f['callerID']){_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x5d4d8f[_0x2d31('0x36')]+')','context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4['priority']+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}else{_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':_0x2d31('0x22'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3['length']+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}}if(_0x5d4d8f['hasOwnProperty'](_0x2d31('0x37'))){if(_0x4dd8d9['indexOf'](_0x5d4d8f[_0x2d31('0x38')][_0x2d31('0x30')]())>=0x0&&_0x5d4d8f[_0x2d31('0x39')]!=='custom'){if(_0x5d4d8f[_0x2d31('0x37')]){_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':'ExecIf','appdata':_0x2d31('0x3a'),'context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f['exten'],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':'Set','appdata':_0x2d31('0x3b'),'context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f['exten'],'priority':_0x251fa3['length']+_0xe419e4['priority']+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}else{_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f['type'],'app':_0x2d31('0x22'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4[_0x2d31('0x11')]+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});_0x4abe9d[_0x2d31('0x14')]({'type':_0x5d4d8f[_0x2d31('0x18')],'app':_0x2d31('0x15'),'appdata':_0x2d31('0x3c'),'context':_0x5d4d8f[_0x2d31('0x1c')],'exten':_0x5d4d8f[_0x2d31('0xa')],'priority':_0x251fa3[_0x2d31('0x2f')]+_0xe419e4['priority']+_0x21c5f5++,'VoiceExtensionId':_0x5d4d8f[_0x2d31('0x19')]});}}}for(var _0x195ff7=0x0;_0x195ff7<_0x251fa3[_0x2d31('0x2f')];_0x195ff7+=0x1){var _0x21e843=_0xe419e4[_0x2d31('0x11')]+_0x251fa3['length'];var _0x4cfa45=_0x195ff7===_0x251fa3[_0x2d31('0x2f')]-0x1?_0xe419e4[_0x2d31('0x11')]+_0x4abe9d[_0x2d31('0x2f')]+_0x53059f[_0x2d31('0x2f')]+0x2:_0xe419e4[_0x2d31('0x11')]+_0x195ff7+0x1;_0x4abe9d[_0x2d31('0x3d')](_0x195ff7,0x0,{'type':_0x5d4d8f['type'],'app':'GotoIfTime','appdata':_0x251fa3[_0x195ff7]+'?'+_0x5d4d8f[_0x2d31('0x1c')]+_0x2d31('0x3e')+_0x21e843+':'+_0x5d4d8f[_0x2d31('0x1c')]+',${EXTEN},'+_0x4cfa45,'exten':_0x5d4d8f[_0x2d31('0xa')],'context':_0x5d4d8f['context'],'priority':_0xe419e4[_0x2d31('0x11')]+_0x195ff7,'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});}_0x5d4d8f[_0x2d31('0x11')]=_0x4abe9d[_0x2d31('0x2f')]?_[_0x2d31('0x3f')](_0x4abe9d)[_0x2d31('0x11')]+0x1:_0xe419e4['priority'];_0xe419e4[_0x2d31('0x11')]=(_0x53059f[_0x2d31('0x2f')]?_[_0x2d31('0x3f')](_0x53059f)[_0x2d31('0x11')]:_0x5d4d8f['priority'])+0x1;_0xe419e4[_0x2d31('0x12')]=_[_0x2d31('0x40')](_0xe419e4['extensions'],_0x4abe9d,[_0x5d4d8f],_0x53059f);}_0xe419e4[_0x2d31('0x12')]['push']({'type':_0x6ed205[_0x422af6][0x0][_0x2d31('0x18')],'app':_0x2d31('0x41'),'exten':_0x6ed205[_0x422af6][0x0][_0x2d31('0xa')],'context':_0x6ed205[_0x422af6][0x0][_0x2d31('0x1c')],'priority':_0xe419e4[_0x2d31('0x11')],'VoiceExtensionId':_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]});_0x515845[_0x2d31('0x14')](_0x6ed205[_0x422af6][0x0][_0x2d31('0x19')]);_0x7e11b1=_[_0x2d31('0x40')](_0x7e11b1,_0xe419e4[_0x2d31('0x12')]);}}return _0x212292[_0x2d31('0x42')](function(_0xede158){return _0x212292[_0x2d31('0x2')][_0x2d31('0x43')][_0x2d31('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x515845}},'transaction':_0xede158})[_0x2d31('0x4')](function(_0x6be523){return _0x212292['models'][_0x2d31('0x43')][_0x2d31('0x45')](_[_0x2d31('0x46')](_0x7e11b1,'priority'),{'transaction':_0xede158});});});})[_0x2d31('0x47')](function(_0x45bf1f){console['error'](_0x45bf1f);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index e825969..547572d 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 _0x2ede=['birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','from','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_black','str','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','BlackLists','Campaign','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','resume','resolve','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CmContact','createReadStream','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2ede,0x12a));var _0xe2ed=function(_0x56caf4,_0x4f289c){_0x56caf4=_0x56caf4-0x0;var _0x43ad12=_0x2ede[_0x56caf4];return _0x43ad12;};'use strict';var BPromise=require(_0xe2ed('0x0'));var util=require(_0xe2ed('0x1'));var _=require(_0xe2ed('0x2'));var fs=require('fs');var squel=require(_0xe2ed('0x3'));var Papa=require(_0xe2ed('0x4'));var Redis=require(_0xe2ed('0x5'));var db=require(_0xe2ed('0x6'))['db'];var config=require(_0xe2ed('0x7'));var logger=require(_0xe2ed('0x8'))(_0xe2ed('0x9'));config[_0xe2ed('0xa')]=_[_0xe2ed('0xb')](config[_0xe2ed('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe2ed('0xc'))(new Redis(config[_0xe2ed('0xa')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xe2ed('0xd')][0x2]||process[_0xe2ed('0xd')][0x2]===_0xe2ed('0xe')||process['argv'][0x2]===_0xe2ed('0xf')){throw new Error(_0xe2ed('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0xe2ed('0xd')][0x3]||process['argv'][0x3]==='undefined'||process[_0xe2ed('0xd')][0x3]===_0xe2ed('0xf')||!process['argv'][0x4]||process[_0xe2ed('0xd')][0x4]===_0xe2ed('0xe')||process[_0xe2ed('0xd')][0x4]==='null'){throw new Error(_0xe2ed('0x11'));}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process['argv'][0x4][_0xe2ed('0x12')](','));if(!process[_0xe2ed('0xd')][0x5]||process['argv'][0x5]===_0xe2ed('0xe')||process[_0xe2ed('0xd')][0x5]===_0xe2ed('0xf')){throw new Error(_0xe2ed('0x13'));}var LISTID=process[_0xe2ed('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xe2ed('0xd')][0x6]!==_0xe2ed('0xe')&&process[_0xe2ed('0xd')][0x6]!==_0xe2ed('0xf')?process[_0xe2ed('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xe2ed('0xd')][0x7]!=='undefined'&&process[_0xe2ed('0xd')][0x7]!==_0xe2ed('0xf')?process['argv'][0x7]:null;if(!process[_0xe2ed('0xd')][0x8]||process[_0xe2ed('0xd')][0x8]===_0xe2ed('0xe')||process[_0xe2ed('0xd')][0x8]===_0xe2ed('0xf')){throw new Error(_0xe2ed('0x14'));}var SOCKET_TIMESTAMP=process[_0xe2ed('0xd')][0x8];}catch(_0x29e561){logger[_0xe2ed('0x15')](_0x29e561);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(_0x22348b,_0x508277,_0x1c92cb,_0x27e67a){var _0x4b3081={'message':_0x508277};_0x4b3081[_0x22348b]=!![];if(_0x1c92cb){_0x4b3081[_0xe2ed('0x16')]=_0x1c92cb;}if(_0x27e67a){_0x4b3081[_0xe2ed('0x17')]=_0x27e67a;}return _0x4b3081;}function isEmail(_0x12e740){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'](_0x12e740);}function checkRow(_0x4d9f4e,_0x24dc5b,_0x49748b){return new BPromise(function(_0x596a43,_0x5e046d){if(_['isNil'](_0x4d9f4e)){return _0x5e046d(handleCheckRowError(_0xe2ed('0x15'),_0xe2ed('0x18'),null,_0x49748b));}if(_0x4d9f4e['errors']&&_0x4d9f4e[_0xe2ed('0x19')][_0xe2ed('0x1a')]){var _0x2182ee=_[_0xe2ed('0x1b')](_0x4d9f4e[_0xe2ed('0x19')],_0xe2ed('0x1c'))[_0xe2ed('0x1d')](';');return _0x5e046d(handleCheckRowError(_0xe2ed('0x15'),_0x2182ee,null,_0x49748b));}var _0x4f8925={};for(var _0xa53439 in FIELDS){if(FIELDS[_0xe2ed('0x1e')](_0xa53439)&&FIELDS[_0xa53439]){_0x4f8925[_0xa53439]=_0x4d9f4e[_0xe2ed('0x1f')][0x0][FIELDS[_0xa53439]]||_0x4d9f4e[_0xe2ed('0x1f')][0x0]['\ufeff'+FIELDS[_0xa53439]];}}if(!_0x4f8925[_0xe2ed('0x20')]){return _0x5e046d(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x49748b));}if(!_0x4f8925[_0xe2ed('0x21')]){return _0x5e046d(handleCheckRowError('error',_0xe2ed('0x22'),null,_0x49748b));}if(_0x4f8925[_0xe2ed('0x23')]){var _0x483c3a=moment(_0x4f8925[_0xe2ed('0x23')],_0xe2ed('0x24'));if(!_0x483c3a[_0xe2ed('0x25')]()){return _0x5e046d(handleCheckRowError(_0xe2ed('0x15'),_0xe2ed('0x26'),null,_0x49748b));}}if(_0x4f8925['email']){if(!isEmail(_0x4f8925[_0xe2ed('0x27')])){return _0x5e046d(handleCheckRowError(_0xe2ed('0x15'),_0xe2ed('0x28'),null,_0x49748b));}}_0x4f8925[_0xe2ed('0x29')]=LISTID;_0x4f8925[_0xe2ed('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe2ed('0x1a')]&&_0x24dc5b){var _0x206a3a={};for(var _0x3331ee=0x0,_0x4ed394=DUPLICATES['length'];_0x3331ee<_0x4ed394;_0x3331ee+=0x1){_0x206a3a[DUPLICATES[_0x3331ee]]=_0x4f8925[DUPLICATES[_0x3331ee]];}var _0x2b0520=_[_0xe2ed('0x2b')](_0x24dc5b,_0x206a3a);if(_0x2b0520){return _0x5e046d(handleCheckRowError(_0xe2ed('0x2c'),_0xe2ed('0x2d'),_0x2b0520,_0x49748b));}}return db['CmContact'][_0xe2ed('0x2e')](_0x4f8925,{'raw':!![],'hooks':![],'fields':_['keys'](_0x4f8925)})[_0xe2ed('0x2f')](function(_0x140087){if(DUPLICATES&&DUPLICATES['length']&&_0x24dc5b){_0x24dc5b[_0xe2ed('0x30')](_[_0xe2ed('0x31')](_0x4f8925,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x140087['id'];return _0x596a43();})[_0xe2ed('0x32')](function(_0xf4eb21){return _0x5e046d(handleCheckRowError(_0xe2ed('0x15'),_0xe2ed('0x33')+(_0xf4eb21[_0xe2ed('0x1c')]||JSON[_0xe2ed('0x34')](_0xf4eb21)),null,_0x49748b));});});}function checkHopper(){function _0x1e249f(){return function(_0xdc2729){logger[_0xe2ed('0x15')]('cmContact','checkHopper',util[_0xe2ed('0x35')](_0xdc2729,{'showHidden':![],'depth':null}));};}var _0x332e49=function(_0x4082e8,_0x43ae9b){var _0x426994=squel[_0xe2ed('0x36')]()[_0xe2ed('0x37')](_0xe2ed('0x38'))[_0xe2ed('0x39')]([_0xe2ed('0x21'),_0xe2ed('0x3a'),_0xe2ed('0x3b'),'ListId',_0x43ae9b,_0xe2ed('0x3c'),_0xe2ed('0x3d')],squel[_0xe2ed('0x3e')]()[_0xe2ed('0x3f')](_0xe2ed('0x21'),_0xe2ed('0x21'))['field'](_0xe2ed('0x40'),_0xe2ed('0x3a'))[_0xe2ed('0x3f')]('id',_0xe2ed('0x3b'))[_0xe2ed('0x3f')](LISTID[_0xe2ed('0x41')](),_0xe2ed('0x29'))[_0xe2ed('0x3f')](_0x4082e8['id'][_0xe2ed('0x41')](),_0x43ae9b)[_0xe2ed('0x3f')](_0xe2ed('0x40'),_0xe2ed('0x3c'))[_0xe2ed('0x3f')]('NOW()',_0xe2ed('0x3d'))['from'](_0xe2ed('0x42'))[_0xe2ed('0x43')](_0xe2ed('0x44'))[_0xe2ed('0x43')](_0xe2ed('0x45'),LISTID[_0xe2ed('0x41')]())[_0xe2ed('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0xe2ed('0x43')](_0xe2ed('0x46'),squel['select']()[_0xe2ed('0x3f')](_0xe2ed('0x21'))['from'](_0xe2ed('0x38'))[_0xe2ed('0x43')](_0x43ae9b+_0xe2ed('0x47'),_0x4082e8['id']['toString']())))['toString']();return _0x426994;};var _0x1b4d17=function(_0xf0166,_0x4ae30a){var _0xbc99c6=squel[_0xe2ed('0x36')]()[_0xe2ed('0x37')](_0xe2ed('0x38'))[_0xe2ed('0x39')]([_0xe2ed('0x21'),_0xe2ed('0x3a'),_0xe2ed('0x3b'),_0xe2ed('0x29'),_0x4ae30a,_0xe2ed('0x3c'),_0xe2ed('0x3d')],squel[_0xe2ed('0x3e')]()['field'](_0xe2ed('0x21'),_0xe2ed('0x21'))['field']('NOW()',_0xe2ed('0x3a'))[_0xe2ed('0x3f')]('id',_0xe2ed('0x3b'))['field'](LISTID[_0xe2ed('0x41')](),_0xe2ed('0x29'))['field'](_0xf0166['id'][_0xe2ed('0x41')](),_0x4ae30a)[_0xe2ed('0x3f')](_0xe2ed('0x40'),_0xe2ed('0x3c'))[_0xe2ed('0x3f')](_0xe2ed('0x40'),_0xe2ed('0x3d'))[_0xe2ed('0x48')](_0xe2ed('0x42'))[_0xe2ed('0x43')](_0xe2ed('0x44'))['where'](_0xe2ed('0x45'),LISTID[_0xe2ed('0x41')]())['where'](_0xe2ed('0x49'),squel['str'](hopperContacts))[_0xe2ed('0x43')](_0xe2ed('0x4a'))[_0xe2ed('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe2ed('0x3e')]()[_0xe2ed('0x3f')](_0xe2ed('0x4b'))[_0xe2ed('0x48')]('cm_hopper_final')[_0xe2ed('0x43')](_0x4ae30a+'\x20=\x20?',_0xf0166['id'][_0xe2ed('0x41')]()))[_0xe2ed('0x43')](_0xe2ed('0x46'),squel[_0xe2ed('0x3e')]()[_0xe2ed('0x3f')](_0xe2ed('0x21'))[_0xe2ed('0x48')]('cm_hopper')[_0xe2ed('0x43')](_0x4ae30a+_0xe2ed('0x47'),_0xf0166['id'][_0xe2ed('0x41')]())))['toString']();return _0xbc99c6;};function _0x3a23cb(_0x1cf5e7,_0x3e8de2){var _0x38dbec=squel[_0xe2ed('0x36')]()[_0xe2ed('0x37')](_0xe2ed('0x38'))[_0xe2ed('0x39')](['phone','scheduledAt',_0xe2ed('0x3b'),'ListId',_0x3e8de2,_0xe2ed('0x3c'),_0xe2ed('0x3d')],squel[_0xe2ed('0x3e')]()[_0xe2ed('0x3f')](_0xe2ed('0x21'),'phone')[_0xe2ed('0x3f')](_0xe2ed('0x40'),'scheduledAt')['field']('id','ContactId')[_0xe2ed('0x3f')](LISTID[_0xe2ed('0x41')](),'ListId')[_0xe2ed('0x3f')](_0x1cf5e7['id'][_0xe2ed('0x41')](),_0x3e8de2)[_0xe2ed('0x3f')](_0xe2ed('0x40'),_0xe2ed('0x3c'))[_0xe2ed('0x3f')](_0xe2ed('0x40'),_0xe2ed('0x3d'))['from'](_0xe2ed('0x42'))[_0xe2ed('0x43')]('deletedAt\x20IS\x20NULL')[_0xe2ed('0x43')](_0xe2ed('0x45'),LISTID[_0xe2ed('0x41')]())[_0xe2ed('0x43')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xe2ed('0x43')](_0xe2ed('0x4a')))[_0xe2ed('0x41')]();return _0x38dbec;}function _0x234d62(_0x42911c,_0x4b3e7a){var _0x1fb39d=squel[_0xe2ed('0x36')]()[_0xe2ed('0x37')](_0xe2ed('0x4c'))['fromQuery']([_0xe2ed('0x21'),_0xe2ed('0x3b'),'ListId',_0x4b3e7a,_0xe2ed('0x3c'),_0xe2ed('0x3d')],squel['select']()[_0xe2ed('0x3f')]('phone',_0xe2ed('0x21'))[_0xe2ed('0x3f')]('id',_0xe2ed('0x3b'))[_0xe2ed('0x3f')](LISTID['toString'](),_0xe2ed('0x29'))['field'](_0x42911c['id']['toString'](),_0x4b3e7a)[_0xe2ed('0x3f')](_0xe2ed('0x40'),_0xe2ed('0x3c'))[_0xe2ed('0x3f')](_0xe2ed('0x40'),_0xe2ed('0x3d'))[_0xe2ed('0x48')]('cm_contacts')[_0xe2ed('0x43')]('deletedAt\x20IS\x20NULL')[_0xe2ed('0x43')]('ListId\x20=\x20?',LISTID[_0xe2ed('0x41')]())['where']('id\x20IN\x20?',squel[_0xe2ed('0x4d')](hopperContacts))[_0xe2ed('0x43')](_0xe2ed('0x4a')))[_0xe2ed('0x41')]();return _0x1fb39d;}return db[_0xe2ed('0x4e')]['findAll']({'where':{'type':_0xe2ed('0x4f')},'attributes':['id',_0xe2ed('0x50')],'include':[{'model':db[_0xe2ed('0x51')],'as':_0xe2ed('0x52'),'where':{'id':LISTID}}]})[_0xe2ed('0x2f')](function(_0x46da45){var _0x471f1d=[];if(_0x46da45){var _0xe037be;for(var _0x2e5460=0x0,_0x32eb3d;_0x2e5460<_0x46da45['length'];_0x2e5460+=0x1){_0x32eb3d=_0x46da45[_0x2e5460][_0xe2ed('0x53')]({'plain':!![]});switch(_0x32eb3d['dialCheckDuplicateType']){case'always':_0x471f1d[_0xe2ed('0x30')](db[_0xe2ed('0x54')][_0xe2ed('0x55')](_0x1b4d17(_0x32eb3d,_0xe2ed('0x56')))['then'](function(){})[_0xe2ed('0x32')](_0x1e249f()));break;case _0xe2ed('0x57'):_0x471f1d[_0xe2ed('0x30')](db[_0xe2ed('0x54')][_0xe2ed('0x55')](_0x332e49(_0x32eb3d,_0xe2ed('0x56')))[_0xe2ed('0x2f')](function(){})['catch'](_0x1e249f()));break;default:_0x471f1d['push'](db[_0xe2ed('0x54')][_0xe2ed('0x55')](_0x3a23cb(_0x32eb3d,_0xe2ed('0x56')))[_0xe2ed('0x2f')](function(){})[_0xe2ed('0x32')](_0x1e249f()));}}}return _0x471f1d;})[_0xe2ed('0x58')]()['then'](function(){return db[_0xe2ed('0x4e')][_0xe2ed('0x59')]({'where':{'type':_0xe2ed('0x4f')},'attributes':['id'],'include':[{'model':db[_0xe2ed('0x51')],'as':_0xe2ed('0x5a'),'where':{'id':LISTID}}]})[_0xe2ed('0x2f')](function(_0x3daae2){var _0x2b89d1=[];if(_0x3daae2){var _0xc0dc9d;for(var _0x43e748=0x0,_0x51e0d9;_0x43e748<_0x3daae2[_0xe2ed('0x1a')];_0x43e748+=0x1){_0x51e0d9=_0x3daae2[_0x43e748]['get']({'plain':!![]});_0x2b89d1[_0xe2ed('0x30')](db[_0xe2ed('0x54')][_0xe2ed('0x55')](_0x234d62(_0x51e0d9,_0xe2ed('0x56')))[_0xe2ed('0x2f')](function(){})[_0xe2ed('0x32')](_0x1e249f()));}}return _0x2b89d1;})['all']();})[_0xe2ed('0x2f')](function(){return db[_0xe2ed('0x5b')]['findAll']({'attributes':['id',_0xe2ed('0x50')],'include':[{'model':db[_0xe2ed('0x51')],'as':_0xe2ed('0x52'),'where':{'id':LISTID}}]})[_0xe2ed('0x2f')](function(_0x5c16e7){var _0x4b963c=[];if(_0x5c16e7){for(var _0x520239=0x0,_0x1ad5d9;_0x520239<_0x5c16e7[_0xe2ed('0x1a')];_0x520239+=0x1){_0x1ad5d9=_0x5c16e7[_0x520239]['get']({'plain':!![]});switch(_0x1ad5d9['dialCheckDuplicateType']){case _0xe2ed('0x5c'):_0x4b963c[_0xe2ed('0x30')](db[_0xe2ed('0x54')][_0xe2ed('0x55')](_0x1b4d17(_0x1ad5d9,'CampaignId'))[_0xe2ed('0x2f')](function(){})['catch'](_0x1e249f()));break;case _0xe2ed('0x57'):_0x4b963c[_0xe2ed('0x30')](db[_0xe2ed('0x54')][_0xe2ed('0x55')](_0x332e49(_0x1ad5d9,_0xe2ed('0x5d')))[_0xe2ed('0x2f')](function(){})[_0xe2ed('0x32')](_0x1e249f()));break;default:_0x4b963c[_0xe2ed('0x30')](db[_0xe2ed('0x54')]['query'](_0x3a23cb(_0x1ad5d9,_0xe2ed('0x5d')))[_0xe2ed('0x2f')](function(){})[_0xe2ed('0x32')](_0x1e249f()));}}}return _0x4b963c;})[_0xe2ed('0x58')]();})[_0xe2ed('0x2f')](function(){return db[_0xe2ed('0x5b')][_0xe2ed('0x59')]({'attributes':['id'],'include':[{'model':db[_0xe2ed('0x51')],'as':_0xe2ed('0x5a'),'where':{'id':LISTID}}]})[_0xe2ed('0x2f')](function(_0x25de38){var _0x22af43=[];if(_0x25de38){for(var _0x5c5523=0x0,_0x2dc49b;_0x5c5523<_0x25de38[_0xe2ed('0x1a')];_0x5c5523+=0x1){_0x2dc49b=_0x25de38[_0x5c5523][_0xe2ed('0x53')]({'plain':!![]});_0x22af43[_0xe2ed('0x30')](db[_0xe2ed('0x54')][_0xe2ed('0x55')](_0x234d62(_0x2dc49b,_0xe2ed('0x5d')))[_0xe2ed('0x2f')](function(){})[_0xe2ed('0x32')](_0x1e249f()));}}return _0x22af43;})[_0xe2ed('0x58')]();})['catch'](function(_0x32a6f0){logger[_0xe2ed('0x15')](_0xe2ed('0x5e'),_0xe2ed('0x5f'),_0x32a6f0['message']);});}var processPromises=function(_0x21e91b){return BPromise[_0xe2ed('0x58')](promises)[_0xe2ed('0x2f')](function(_0x54ae6e){})[_0xe2ed('0x32')](function(_0x41ecbb){logger[_0xe2ed('0x15')](_0xe2ed('0x60'),JSON[_0xe2ed('0x34')](_0x41ecbb));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x21e91b){return _0x21e91b[_0xe2ed('0x61')]();}});};var endCsv=function(){return BPromise[_0xe2ed('0x62')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xe2ed('0x2f')](function(){socket[_0xe2ed('0x63')](_0xe2ed('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xe2ed('0x65')](FILEPATH);}catch(_0x22c214){logger[_0xe2ed('0x15')](_0xe2ed('0x66'),JSON[_0xe2ed('0x34')](_0x22c214));}finally{process[_0xe2ed('0x67')](0x0);}});};process['on'](_0xe2ed('0x68'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe2ed('0x12')](',');return db[_0xe2ed('0x69')][_0xe2ed('0x59')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4c8e20){var _0x10e104=fs[_0xe2ed('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x10e104,{'header':!![],'skipEmptyLines':!![],'step':function(_0x34cf0e,_0x5097f6){total+=0x1;var _0x250ec3=total;promises['push'](checkRow(_0x34cf0e,_0x4c8e20,_0x250ec3)[_0xe2ed('0x2f')](function(){success+=0x1;})[_0xe2ed('0x32')](function(_0x1c9a3a){if(_0x1c9a3a[_0xe2ed('0x15')]){errors+=0x1;delete _0x1c9a3a[_0xe2ed('0x15')];}else if(_0x1c9a3a[_0xe2ed('0x2c')]){duplicates+=0x1;delete _0x1c9a3a[_0xe2ed('0x2c')];}rows[_0xe2ed('0x30')](_0x1c9a3a);}));if(total%0xc8===0x0){_0x5097f6[_0xe2ed('0x6b')]();return processPromises(_0x5097f6);}},'complete':function(){return processPromises()[_0xe2ed('0x2f')](function(){logger[_0xe2ed('0x6c')](_0xe2ed('0x6d'));endCsv();});},'error':function(_0x1ad1bd,_0x4ecb4f){logger[_0xe2ed('0x6c')]('CSV\x20parse\x20error',JSON[_0xe2ed('0x34')](_0x1ad1bd));endCsv();}});})[_0xe2ed('0x32')](function(_0x3b9eb9){logger[_0xe2ed('0x15')](_0xe2ed('0x6e'),JSON[_0xe2ed('0x34')](_0x3b9eb9));});}main(); \ No newline at end of file +var _0xa8df=['checkHopper','inspect','insert','into','cm_hopper','fromQuery','createdAt','updatedAt','select','field','NOW()','scheduledAt','ContactId','toString','ListId','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','ListId\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_contacts','phone\x20IS\x20NOT\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','defaults','redis','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','map','errors','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact'];(function(_0x52c2f4,_0xff60b0){var _0x5d6579=function(_0x1effba){while(--_0x1effba){_0x52c2f4['push'](_0x52c2f4['shift']());}};_0x5d6579(++_0xff60b0);}(_0xa8df,0x184));var _0xfa8d=function(_0x25c370,_0x101f9c){_0x25c370=_0x25c370-0x0;var _0x32dacb=_0xa8df[_0x25c370];return _0x32dacb;};'use strict';var BPromise=require(_0xfa8d('0x0'));var util=require(_0xfa8d('0x1'));var _=require(_0xfa8d('0x2'));var fs=require('fs');var squel=require(_0xfa8d('0x3'));var Papa=require('papaparse');var Redis=require(_0xfa8d('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xfa8d('0x5'));var logger=require(_0xfa8d('0x6'))(_0xfa8d('0x7'));config['redis']=_[_0xfa8d('0x8')](config[_0xfa8d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa8d('0xa'))(new Redis(config[_0xfa8d('0x9')]));require(_0xfa8d('0xb'))[_0xfa8d('0xc')](socket);try{if(!process[_0xfa8d('0xd')][0x2]||process[_0xfa8d('0xd')][0x2]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x2]===_0xfa8d('0xf')){throw new Error(_0xfa8d('0x10'));}var FILEPATH=process[_0xfa8d('0xd')][0x2];if(!process['argv'][0x3]||process[_0xfa8d('0xd')][0x3]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x3]===_0xfa8d('0xf')||!process[_0xfa8d('0xd')][0x4]||process[_0xfa8d('0xd')][0x4]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x4]===_0xfa8d('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xfa8d('0x11')](process[_0xfa8d('0xd')][0x3]['split'](','),process[_0xfa8d('0xd')][0x4][_0xfa8d('0x12')](','));if(!process[_0xfa8d('0xd')][0x5]||process[_0xfa8d('0xd')][0x5]==='undefined'||process[_0xfa8d('0xd')][0x5]===_0xfa8d('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xfa8d('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xfa8d('0xd')][0x6]!==_0xfa8d('0xe')&&process['argv'][0x6]!==_0xfa8d('0xf')?process[_0xfa8d('0xd')][0x6]:null;var DUPLICATES=process[_0xfa8d('0xd')][0x7]&&process[_0xfa8d('0xd')][0x7]!==_0xfa8d('0xe')&&process[_0xfa8d('0xd')][0x7]!==_0xfa8d('0xf')?process[_0xfa8d('0xd')][0x7]:null;if(!process[_0xfa8d('0xd')][0x8]||process['argv'][0x8]===_0xfa8d('0xe')||process[_0xfa8d('0xd')][0x8]==='null'){throw new Error(_0xfa8d('0x13'));}var SOCKET_TIMESTAMP=process[_0xfa8d('0xd')][0x8];}catch(_0x1f810e){logger[_0xfa8d('0x14')](_0x1f810e);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x47c14c,_0x5a7954,_0x364c59,_0x128426){var _0x4ffe79={'message':_0x5a7954};_0x4ffe79[_0x47c14c]=!![];if(_0x364c59){_0x4ffe79['contact']=_0x364c59;}if(_0x128426){_0x4ffe79[_0xfa8d('0x15')]=_0x128426;}return _0x4ffe79;}function isEmail(_0x915f0d){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xfa8d('0x16')](_0x915f0d);}function checkRow(_0x5428a1,_0x3c32be,_0x1c6ca0){return new BPromise(function(_0x64108c,_0x4c772c){if(_[_0xfa8d('0x17')](_0x5428a1)){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1c6ca0));}if(_0x5428a1['errors']&&_0x5428a1['errors']['length']){var _0x58011d=_[_0xfa8d('0x18')](_0x5428a1[_0xfa8d('0x19')],'message')['join'](';');return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0x58011d,null,_0x1c6ca0));}var _0xa55ec0={};for(var _0x863d90 in FIELDS){if(FIELDS[_0xfa8d('0x1a')](_0x863d90)&&FIELDS[_0x863d90]){_0xa55ec0[_0x863d90]=_0x5428a1[_0xfa8d('0x1b')][0x0][FIELDS[_0x863d90]]||_0x5428a1[_0xfa8d('0x1b')][0x0]['\ufeff'+FIELDS[_0x863d90]];}}if(!_0xa55ec0[_0xfa8d('0x1c')]){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x1d'),null,_0x1c6ca0));}if(!_0xa55ec0[_0xfa8d('0x1e')]){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x1f'),null,_0x1c6ca0));}if(_0xa55ec0['birthDate']){var _0x2dec5f=moment(_0xa55ec0[_0xfa8d('0x20')],_0xfa8d('0x21'));if(!_0x2dec5f[_0xfa8d('0x22')]()){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x23'),null,_0x1c6ca0));}}if(_0xa55ec0[_0xfa8d('0x24')]){if(!isEmail(_0xa55ec0[_0xfa8d('0x24')])){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x25'),null,_0x1c6ca0));}}_0xa55ec0['ListId']=LISTID;_0xa55ec0[_0xfa8d('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xfa8d('0x27')]&&_0x3c32be){var _0x40f7c3={};for(var _0x158bac=0x0,_0x753c0=DUPLICATES['length'];_0x158bac<_0x753c0;_0x158bac+=0x1){_0x40f7c3[DUPLICATES[_0x158bac]]=_0xa55ec0[DUPLICATES[_0x158bac]];}var _0x4b23cd=_[_0xfa8d('0x28')](_0x3c32be,_0x40f7c3);if(_0x4b23cd){return _0x4c772c(handleCheckRowError(_0xfa8d('0x29'),_0xfa8d('0x2a'),_0x4b23cd,_0x1c6ca0));}}return db[_0xfa8d('0x2b')][_0xfa8d('0x2c')](_0xa55ec0,{'raw':!![],'hooks':![],'fields':_['keys'](_0xa55ec0)})['then'](function(_0x1581c3){if(DUPLICATES&&DUPLICATES[_0xfa8d('0x27')]&&_0x3c32be){_0x3c32be[_0xfa8d('0x2d')](_[_0xfa8d('0x2e')](_0xa55ec0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1581c3['id'];return _0x64108c();})[_0xfa8d('0x2f')](function(_0x146d63){return _0x4c772c(handleCheckRowError(_0xfa8d('0x14'),_0xfa8d('0x30')+(_0x146d63[_0xfa8d('0x31')]||JSON[_0xfa8d('0x32')](_0x146d63)),null,_0x1c6ca0));});});}function checkHopper(){function _0x4cdd29(){return function(_0x450025){logger[_0xfa8d('0x14')](_0xfa8d('0x33'),_0xfa8d('0x34'),util[_0xfa8d('0x35')](_0x450025,{'showHidden':![],'depth':null}));};}var _0x3b4ffc=function(_0x4f6da3,_0x24422e){var _0x330a4e=squel[_0xfa8d('0x36')]()[_0xfa8d('0x37')](_0xfa8d('0x38'))[_0xfa8d('0x39')]([_0xfa8d('0x1e'),'scheduledAt','ContactId','ListId',_0x24422e,_0xfa8d('0x3a'),_0xfa8d('0x3b')],squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')]('phone','phone')[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3f'))[_0xfa8d('0x3d')]('id',_0xfa8d('0x40'))[_0xfa8d('0x3d')](LISTID[_0xfa8d('0x41')](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x4f6da3['id'][_0xfa8d('0x41')](),_0x24422e)[_0xfa8d('0x3d')]('NOW()',_0xfa8d('0x3a'))[_0xfa8d('0x3d')](_0xfa8d('0x3e'),'updatedAt')['from']('cm_contacts')[_0xfa8d('0x43')](_0xfa8d('0x44'))['where']('ListId\x20=\x20?',LISTID[_0xfa8d('0x41')]())[_0xfa8d('0x43')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xfa8d('0x45'),squel[_0xfa8d('0x3c')]()['field']('phone')[_0xfa8d('0x46')](_0xfa8d('0x38'))[_0xfa8d('0x43')](_0x24422e+_0xfa8d('0x47'),_0x4f6da3['id'][_0xfa8d('0x41')]())))[_0xfa8d('0x41')]();return _0x330a4e;};var _0x3cd522=function(_0x20ec74,_0x1d6d26){var _0x110001=squel['insert']()[_0xfa8d('0x37')](_0xfa8d('0x38'))['fromQuery']([_0xfa8d('0x1e'),_0xfa8d('0x3f'),_0xfa8d('0x40'),_0xfa8d('0x42'),_0x1d6d26,'createdAt',_0xfa8d('0x3b')],squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')](_0xfa8d('0x1e'),'phone')[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3f'))[_0xfa8d('0x3d')]('id','ContactId')[_0xfa8d('0x3d')](LISTID['toString'](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x20ec74['id'][_0xfa8d('0x41')](),_0x1d6d26)['field'](_0xfa8d('0x3e'),_0xfa8d('0x3a'))[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3b'))[_0xfa8d('0x46')]('cm_contacts')['where'](_0xfa8d('0x44'))[_0xfa8d('0x43')](_0xfa8d('0x48'),LISTID[_0xfa8d('0x41')]())[_0xfa8d('0x43')](_0xfa8d('0x49'),squel[_0xfa8d('0x4a')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xfa8d('0x43')](_0xfa8d('0x45'),squel['select']()[_0xfa8d('0x3d')](_0xfa8d('0x4b'))[_0xfa8d('0x46')]('cm_hopper_final')[_0xfa8d('0x43')](_0x1d6d26+_0xfa8d('0x47'),_0x20ec74['id'][_0xfa8d('0x41')]()))[_0xfa8d('0x43')](_0xfa8d('0x45'),squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')](_0xfa8d('0x1e'))[_0xfa8d('0x46')](_0xfa8d('0x38'))[_0xfa8d('0x43')](_0x1d6d26+_0xfa8d('0x47'),_0x20ec74['id'][_0xfa8d('0x41')]())))['toString']();return _0x110001;};function _0x517a3c(_0x35c346,_0x12a55c){var _0x167658=squel[_0xfa8d('0x36')]()[_0xfa8d('0x37')](_0xfa8d('0x38'))[_0xfa8d('0x39')]([_0xfa8d('0x1e'),_0xfa8d('0x3f'),_0xfa8d('0x40'),'ListId',_0x12a55c,'createdAt','updatedAt'],squel[_0xfa8d('0x3c')]()[_0xfa8d('0x3d')](_0xfa8d('0x1e'),'phone')[_0xfa8d('0x3d')]('NOW()',_0xfa8d('0x3f'))[_0xfa8d('0x3d')]('id','ContactId')['field'](LISTID[_0xfa8d('0x41')](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x35c346['id'][_0xfa8d('0x41')](),_0x12a55c)[_0xfa8d('0x3d')](_0xfa8d('0x3e'),'createdAt')[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3b'))['from'](_0xfa8d('0x4c'))[_0xfa8d('0x43')]('deletedAt\x20IS\x20NULL')[_0xfa8d('0x43')](_0xfa8d('0x48'),LISTID[_0xfa8d('0x41')]())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0xfa8d('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x167658;}function _0x32b42c(_0x321354,_0x245e51){var _0x241b38=squel[_0xfa8d('0x36')]()[_0xfa8d('0x37')]('cm_hopper_black')['fromQuery']([_0xfa8d('0x1e'),_0xfa8d('0x40'),_0xfa8d('0x42'),_0x245e51,_0xfa8d('0x3a'),_0xfa8d('0x3b')],squel[_0xfa8d('0x3c')]()['field'](_0xfa8d('0x1e'),_0xfa8d('0x1e'))[_0xfa8d('0x3d')]('id',_0xfa8d('0x40'))[_0xfa8d('0x3d')](LISTID[_0xfa8d('0x41')](),_0xfa8d('0x42'))[_0xfa8d('0x3d')](_0x321354['id'][_0xfa8d('0x41')](),_0x245e51)[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3a'))[_0xfa8d('0x3d')](_0xfa8d('0x3e'),_0xfa8d('0x3b'))['from'](_0xfa8d('0x4c'))[_0xfa8d('0x43')](_0xfa8d('0x44'))[_0xfa8d('0x43')](_0xfa8d('0x48'),LISTID[_0xfa8d('0x41')]())[_0xfa8d('0x43')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0xfa8d('0x43')](_0xfa8d('0x4d')))[_0xfa8d('0x41')]();return _0x241b38;}return db[_0xfa8d('0x4e')][_0xfa8d('0x4f')]({'where':{'type':_0xfa8d('0x50')},'attributes':['id',_0xfa8d('0x51')],'include':[{'model':db[_0xfa8d('0x52')],'as':_0xfa8d('0x53'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x49b79c){var _0x1ea504=[];if(_0x49b79c){var _0x51c380;for(var _0x11f922=0x0,_0x5dbd3e;_0x11f922<_0x49b79c[_0xfa8d('0x27')];_0x11f922+=0x1){_0x5dbd3e=_0x49b79c[_0x11f922][_0xfa8d('0x55')]({'plain':!![]});switch(_0x5dbd3e[_0xfa8d('0x51')]){case _0xfa8d('0x56'):_0x1ea504['push'](db['sequelize'][_0xfa8d('0x57')](_0x3cd522(_0x5dbd3e,_0xfa8d('0x58')))[_0xfa8d('0x54')](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));break;case _0xfa8d('0x59'):_0x1ea504[_0xfa8d('0x2d')](db['sequelize'][_0xfa8d('0x57')](_0x3b4ffc(_0x5dbd3e,'VoiceQueueId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));break;default:_0x1ea504[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x517a3c(_0x5dbd3e,_0xfa8d('0x58')))[_0xfa8d('0x54')](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}}return _0x1ea504;})[_0xfa8d('0x5b')]()[_0xfa8d('0x54')](function(){return db[_0xfa8d('0x4e')][_0xfa8d('0x4f')]({'where':{'type':_0xfa8d('0x50')},'attributes':['id'],'include':[{'model':db[_0xfa8d('0x52')],'as':_0xfa8d('0x5c'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x4d493d){var _0x49f4bf=[];if(_0x4d493d){var _0xedbce0;for(var _0x1e929e=0x0,_0x1deb86;_0x1e929e<_0x4d493d[_0xfa8d('0x27')];_0x1e929e+=0x1){_0x1deb86=_0x4d493d[_0x1e929e][_0xfa8d('0x55')]({'plain':!![]});_0x49f4bf[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x32b42c(_0x1deb86,'VoiceQueueId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}return _0x49f4bf;})['all']();})[_0xfa8d('0x54')](function(){return db[_0xfa8d('0x5d')][_0xfa8d('0x4f')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xfa8d('0x53'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x1bd833){var _0x1c323c=[];if(_0x1bd833){for(var _0x11345e=0x0,_0x582255;_0x11345e<_0x1bd833[_0xfa8d('0x27')];_0x11345e+=0x1){_0x582255=_0x1bd833[_0x11345e][_0xfa8d('0x55')]({'plain':!![]});switch(_0x582255[_0xfa8d('0x51')]){case _0xfa8d('0x56'):_0x1c323c['push'](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x3cd522(_0x582255,_0xfa8d('0x5e')))[_0xfa8d('0x54')](function(){})['catch'](_0x4cdd29()));break;case _0xfa8d('0x59'):_0x1c323c[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x3b4ffc(_0x582255,_0xfa8d('0x5e')))[_0xfa8d('0x54')](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));break;default:_0x1c323c[_0xfa8d('0x2d')](db[_0xfa8d('0x5a')][_0xfa8d('0x57')](_0x517a3c(_0x582255,'CampaignId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}}return _0x1c323c;})[_0xfa8d('0x5b')]();})[_0xfa8d('0x54')](function(){return db[_0xfa8d('0x5d')][_0xfa8d('0x4f')]({'attributes':['id'],'include':[{'model':db[_0xfa8d('0x52')],'as':_0xfa8d('0x5c'),'where':{'id':LISTID}}]})[_0xfa8d('0x54')](function(_0x30ddbc){var _0xf69375=[];if(_0x30ddbc){for(var _0x39a550=0x0,_0x3a0bfe;_0x39a550<_0x30ddbc[_0xfa8d('0x27')];_0x39a550+=0x1){_0x3a0bfe=_0x30ddbc[_0x39a550]['get']({'plain':!![]});_0xf69375['push'](db[_0xfa8d('0x5a')]['query'](_0x32b42c(_0x3a0bfe,'CampaignId'))['then'](function(){})[_0xfa8d('0x2f')](_0x4cdd29()));}}return _0xf69375;})['all']();})[_0xfa8d('0x2f')](function(_0x1177de){logger[_0xfa8d('0x14')](_0xfa8d('0x5f'),_0xfa8d('0x60'),_0x1177de[_0xfa8d('0x31')]);});}var processPromises=function(_0x1dda65){return BPromise[_0xfa8d('0x5b')](promises)['then'](function(_0x5fbcbb){})[_0xfa8d('0x2f')](function(_0xf90bb){logger[_0xfa8d('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0xfa8d('0x32')](_0xf90bb));})['finally'](function(){socket[_0xfa8d('0x61')](_0xfa8d('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1dda65){return _0x1dda65[_0xfa8d('0x63')]();}});};var endCsv=function(){return BPromise[_0xfa8d('0x64')]()[_0xfa8d('0x54')](function(){if(hopperContacts){return checkHopper();}})[_0xfa8d('0x54')](function(){socket[_0xfa8d('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x24499b){logger[_0xfa8d('0x14')](_0xfa8d('0x65'),JSON['stringify'](_0x24499b));}finally{process[_0xfa8d('0x66')](0x0);}});};process['on'](_0xfa8d('0x67'),function(){logger[_0xfa8d('0x68')](_0xfa8d('0x69'));endCsv();});function main(){return BPromise[_0xfa8d('0x64')]()[_0xfa8d('0x54')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xfa8d('0x12')](',');return db[_0xfa8d('0x2b')][_0xfa8d('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5aa10d){var _0x50e036=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xfa8d('0x6a')](_0x50e036,{'header':!![],'skipEmptyLines':!![],'step':function(_0x40a563,_0x5c8698){total+=0x1;var _0x372481=total;promises[_0xfa8d('0x2d')](checkRow(_0x40a563,_0x5aa10d,_0x372481)[_0xfa8d('0x54')](function(){success+=0x1;})[_0xfa8d('0x2f')](function(_0x3cdad4){if(_0x3cdad4[_0xfa8d('0x14')]){errors+=0x1;delete _0x3cdad4[_0xfa8d('0x14')];}else if(_0x3cdad4[_0xfa8d('0x29')]){duplicates+=0x1;delete _0x3cdad4[_0xfa8d('0x29')];}rows['push'](_0x3cdad4);}));if(total%0xc8===0x0){_0x5c8698[_0xfa8d('0x6b')]();return processPromises(_0x5c8698);}},'complete':function(){return processPromises()[_0xfa8d('0x54')](function(){logger[_0xfa8d('0x68')](_0xfa8d('0x6c'));endCsv();});},'error':function(_0x121625,_0x59bd3f){logger[_0xfa8d('0x68')](_0xfa8d('0x6d'),JSON[_0xfa8d('0x32')](_0x121625));endCsv();}});})[_0xfa8d('0x2f')](function(_0x4298a1){logger[_0xfa8d('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x4298a1));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 290bf19..4766995 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 _0xa8bd=['\x22always\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_hopper_black','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','priority','UserId','\x22onlyIfOpen\x22','ListId\x20=\x20?','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','OrderBy','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','info','Received\x20SIGINT','error','message','exit','errors','sequelize','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','query','catch','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','set','offset','dialTimezone','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','writeFileSync','parse','createReadStream','data','find','_description','isNil','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','description','appendFileSync','rows','emit','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','CmContact','findAll','AdditionalPhones','then','push','all','split','length','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper'];(function(_0x2a1426,_0x3ed908){var _0x3a988e=function(_0x3240b5){while(--_0x3240b5){_0x2a1426['push'](_0x2a1426['shift']());}};_0x3a988e(++_0x3ed908);}(_0xa8bd,0x139));var _0xda8b=function(_0x67a3a6,_0x48c601){_0x67a3a6=_0x67a3a6-0x0;var _0x2fc8b5=_0xa8bd[_0x67a3a6];return _0x2fc8b5;};'use strict';var fs=require('fs');var path=require(_0xda8b('0x0'));var _=require(_0xda8b('0x1'));var Papa=require('papaparse');var util=require(_0xda8b('0x2'));var BPromise=require(_0xda8b('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0xda8b('0x4'));var db=require(_0xda8b('0x5'))['db'];var config=require(_0xda8b('0x6'));var shared=require(_0xda8b('0x7'));var logger=require('../../../config/logger')(_0xda8b('0x8'));config[_0xda8b('0x9')]=_[_0xda8b('0xa')](config['redis'],{'host':_0xda8b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda8b('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xda8b('0xc')](_0xda8b('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xda8b('0xd'));function isEmail(_0x250f93){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))*$/[_0xda8b('0xe')](_0x250f93);}function selectNotIn(_0x1d6ff7,_0x4dd2a1,_0x3f8ade,_0x120846,_0x14d199){return squel[_0xda8b('0xf')]()[_0xda8b('0x10')](_0xda8b('0x11'))[_0xda8b('0x12')](_0x120846)[_0xda8b('0x13')](_0x4dd2a1,null,_0x4dd2a1+_0xda8b('0x14')+_0x120846+'.'+_0x3f8ade)[_0xda8b('0x15')](_0x120846+'.'+_0x3f8ade+_0xda8b('0x16')+_0x1d6ff7+'.'+_0x3f8ade)[_0xda8b('0x15')](_0x4dd2a1+'.dialCheckDuplicateType\x20IN\x20('+_0x14d199[_0xda8b('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4e9115,_0x222dfd){promisesAdditionalPhones=[];return db[_0xda8b('0x17')][_0xda8b('0x18')]({'raw':!![],'attributes':['id',_0xda8b('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xda8b('0x1a')](function(_0x44b094){if(_0x44b094!==null){var _0x1f1cb7=[];for(var _0x354347=0x0;_0x354347<_0x44b094['length'];_0x354347++){var _0x50e815=_0x44b094[_0x354347];_0x1f1cb7[_0xda8b('0x1b')](insertAdditionalPhones(_0x50e815));}}Promise[_0xda8b('0x1c')](_0x1f1cb7)[_0xda8b('0x1a')](function(){_0x4e9115({'val':0x1});});});});}function insertAdditionalPhones(_0x188d86){return new Promise(function(_0x410199,_0x169134){var _0x33f1a6=_0x188d86[_0xda8b('0x19')];var _0x15adec=_0x33f1a6[_0xda8b('0x1d')](';');var _0x267727=[];orderBy=0x0;for(var _0x35cd95=0x0;_0x35cd95<_0x15adec[_0xda8b('0x1e')];_0x35cd95++){_0x267727[_0xda8b('0x1b')](splitAdditionalPhone(_0x188d86['id'],_0x15adec[_0x35cd95]));}Promise['all'](_0x267727)[_0xda8b('0x1a')](function(){_0x410199({'val':_0x15adec['length']});});});}function splitAdditionalPhone(_0x266ee6,_0x1780f5){return new Promise(function(_0x371bb2,_0x956596){var _0x802c69=_0x1780f5[_0xda8b('0x1d')](':');var _0x30c6f1=_0x802c69[0x0];var _0x22da2b=_0x802c69[0x1];if(!_['isNil'](_0x22da2b)){var _0x13056c=_0x22da2b[_0xda8b('0x1d')]('|');var _0x58c024=[];for(var _0x473b61=0x0;_0x473b61<_0x13056c[_0xda8b('0x1e')];_0x473b61++){if(_0x13056c[_0x473b61]!==''){var _0x14fe34=_['filter'](promisesAdditionalPhones,{'contactId':_0x266ee6,'phone':_0x13056c[_0x473b61]});if(_0x14fe34[_0xda8b('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0xda8b('0x1b')]({'contactId':_0x266ee6,'contactTypeId':_0x30c6f1,'phone':_0x13056c[_0x473b61],'orderBy':orderBy});}}}_0x371bb2({'ok':0x1});}else _0x371bb2({'res':0x0});});}function createAdditionalPhone(_0x39a0cc,_0x4b6d9d,_0x50b1fd,_0x53dbf5){var _0x2405ac='';var _0x1eabc9='';var _0x3e0172=_0x50b1fd['split']('§');_0x2405ac=_0x3e0172[0x0];if(_0x3e0172[_0xda8b('0x1e')]==0x2)_0x1eabc9=_0x3e0172[0x1];return new Promise(function(_0x5ec7cd,_0x236a63){return db[_0xda8b('0x1f')][_0xda8b('0x20')]({'where':{'CmContactId':_0x39a0cc,'item':_0x2405ac}})['then'](function(_0x1b84cc){if(_0x1b84cc){return db[_0xda8b('0x1f')][_0xda8b('0x21')]({'ItemTypeId':_0x4b6d9d,'description':_0x1eabc9,'OrderBy':_0x53dbf5},{'where':{'CmContactId':_0x39a0cc,'item':_0x2405ac}})[_0xda8b('0x1a')](function(_0x4023ca){_0x5ec7cd({'res':_0xda8b('0x22')});});}else{return db[_0xda8b('0x1f')][_0xda8b('0x23')]({'CmContactId':_0x39a0cc,'item':_0x2405ac,'description':_0x1eabc9,'ItemTypeId':_0x4b6d9d,'OrderBy':_0x53dbf5,'ItemClass':_0xda8b('0x24')})[_0xda8b('0x1a')](function(_0x1d9ee5){_0x5ec7cd({'res':_0xda8b('0x25')});});}});});}function insertCmHopper(_0xd90fad,_0x370ee1,_0x1d559d,_0x4d2bef,_0x14144a){var _0x23a440=[_0xda8b('0x26'),_0xda8b('0x27'),'cm_contacts.id','cm_contacts.ListId',_0x370ee1+'.'+_0x4d2bef,_0xda8b('0x28'),_0xda8b('0x29'),_0xda8b('0x2a'),_0xda8b('0x2b'),'\x22'+_0x14144a+'\x22'];return squel[_0xda8b('0x2c')]()[_0xda8b('0x2d')]('cm_hopper')[_0xda8b('0x2e')]([_0xda8b('0x11'),_0xda8b('0x2f'),_0xda8b('0x30'),_0xda8b('0x31'),_0x4d2bef,_0xda8b('0x32'),_0xda8b('0x33'),'priority','UserId',_0xda8b('0x34')],squel[_0xda8b('0xf')]()[_0xda8b('0x35')](_0x23a440)[_0xda8b('0x12')](_0x370ee1)['join'](_0xda8b('0x36'),null,_0xda8b('0x37')+_0x370ee1+_0xda8b('0x38'))[_0xda8b('0x13')](_0x1d559d,null,_0x1d559d+_0xda8b('0x14')+_0x370ee1+'.'+_0x4d2bef)['where'](_0x370ee1+_0xda8b('0x39'),_0xd90fad)[_0xda8b('0x15')](_0xda8b('0x3a'),NOW)[_0xda8b('0x15')](_0xda8b('0x3b'),selectNotIn(_0x370ee1,_0x1d559d,_0x4d2bef,_0xda8b('0x3c'),[_0xda8b('0x3d'),'\x22onlyIfOpen\x22']))[_0xda8b('0x15')](_0xda8b('0x3b'),selectNotIn(_0x370ee1,_0x1d559d,_0x4d2bef,'cm_hopper',['\x22always\x22'])))[_0xda8b('0x3e')]();}function insertCmHopperBlack(_0x21e291,_0x663416,_0x2d759d,_0x3b1329){var _0x4cf365=[_0xda8b('0x26'),_0xda8b('0x3f'),_0xda8b('0x40'),_0x663416+'.'+_0x3b1329,'cm_contacts.createdAt',_0xda8b('0x29')];return squel['insert']()[_0xda8b('0x2d')](_0xda8b('0x41'))[_0xda8b('0x2e')]([_0xda8b('0x11'),_0xda8b('0x30'),_0xda8b('0x31'),_0x3b1329,_0xda8b('0x32'),'updatedAt'],squel['select']()[_0xda8b('0x35')](_0x4cf365)[_0xda8b('0x12')](_0x663416)[_0xda8b('0x13')](_0xda8b('0x36'),null,_0xda8b('0x37')+_0x663416+_0xda8b('0x38'))[_0xda8b('0x13')](_0x2d759d,null,_0x2d759d+_0xda8b('0x14')+_0x663416+'.'+_0x3b1329)[_0xda8b('0x15')](_0x663416+'.CmListId\x20=\x20?',_0x21e291)[_0xda8b('0x15')](_0xda8b('0x3a'),NOW)[_0xda8b('0x15')](_0xda8b('0x3b'),squel[_0xda8b('0xf')]()[_0xda8b('0x10')]('phone')[_0xda8b('0x12')](_0xda8b('0x41'))[_0xda8b('0x15')]('ListId\x20=\x20?',_0x21e291)[_0xda8b('0x15')](_0x3b1329+_0xda8b('0x16')+_0x663416+'.'+_0x3b1329)))[_0xda8b('0x3e')]();}function insertTzCmHopper(_0x2e59e7,_0x7fa720,_0x29eff4,_0x474fe2,_0x5d453d,_0x33fe7e){var _0x4cce07=[_0xda8b('0x26'),_0xda8b('0x42')+_0x33fe7e+_0xda8b('0x43'),'cm_contacts.id',_0xda8b('0x40'),_0x7fa720+'.'+_0x474fe2,_0xda8b('0x28'),_0xda8b('0x29'),_0xda8b('0x2a'),'cm_contacts.UserId','\x22'+_0x5d453d+'\x22'];var _0x3bd9c8=squel[_0xda8b('0x2c')]()[_0xda8b('0x2d')](_0xda8b('0x3c'))[_0xda8b('0x2e')]([_0xda8b('0x11'),_0xda8b('0x2f'),_0xda8b('0x30'),_0xda8b('0x31'),_0x474fe2,'createdAt',_0xda8b('0x33'),_0xda8b('0x44'),_0xda8b('0x45'),_0xda8b('0x34')],squel[_0xda8b('0xf')]()[_0xda8b('0x35')](_0x4cce07)[_0xda8b('0x12')](_0x7fa720)['join'](_0xda8b('0x36'),null,_0xda8b('0x37')+_0x7fa720+'.CmListId')['join'](_0x29eff4,null,_0x29eff4+'.id\x20=\x20'+_0x7fa720+'.'+_0x474fe2)[_0xda8b('0x13')](_0x33fe7e,null,_0x33fe7e+'.id\x20=\x20'+_0x7fa720+'.'+_0x474fe2)[_0xda8b('0x15')](_0x7fa720+_0xda8b('0x39'),_0x2e59e7)[_0xda8b('0x15')](_0xda8b('0x3a'),NOW)[_0xda8b('0x15')](_0xda8b('0x3b'),selectNotIn(_0x7fa720,_0x29eff4,_0x474fe2,_0xda8b('0x3c'),['\x22always\x22',_0xda8b('0x46')]))['where'](_0xda8b('0x3b'),selectNotIn(_0x7fa720,_0x29eff4,_0x474fe2,_0xda8b('0x3c'),[_0xda8b('0x3d')])))[_0xda8b('0x3e')]();return _0x3bd9c8;}function insertTzCmHopperBlack(_0x2ea55b,_0x42d23b,_0x544ad7,_0x572d8c){var _0x33d766=['cm_contacts.phone','cm_contacts.id',_0xda8b('0x40'),_0x42d23b+'.'+_0x572d8c,'cm_contacts.createdAt',_0xda8b('0x29')];return squel['insert']()[_0xda8b('0x2d')](_0xda8b('0x41'))[_0xda8b('0x2e')]([_0xda8b('0x11'),_0xda8b('0x30'),_0xda8b('0x31'),_0x572d8c,_0xda8b('0x32'),_0xda8b('0x33')],squel[_0xda8b('0xf')]()[_0xda8b('0x35')](_0x33d766)[_0xda8b('0x12')](_0x42d23b)[_0xda8b('0x13')](_0xda8b('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x42d23b+_0xda8b('0x38'))['join'](_0x544ad7,null,_0x544ad7+_0xda8b('0x14')+_0x42d23b+'.'+_0x572d8c)['where'](_0x42d23b+_0xda8b('0x39'),_0x2ea55b)[_0xda8b('0x15')](_0xda8b('0x3a'),NOW)[_0xda8b('0x15')](_0xda8b('0x3b'),squel[_0xda8b('0xf')]()['field'](_0xda8b('0x11'))[_0xda8b('0x12')](_0xda8b('0x41'))[_0xda8b('0x15')](_0xda8b('0x47'),_0x2ea55b)[_0xda8b('0x15')](_0x572d8c+_0xda8b('0x16')+_0x42d23b+'.'+_0x572d8c)))['toString']();}function insertCmHopperAdditionalPhones(_0x532d13){var _0x499cfd=['cm_hopper.id',_0xda8b('0x48'),_0xda8b('0x49'),_0xda8b('0x4a'),_0xda8b('0x4b')];return squel[_0xda8b('0x2c')]()[_0xda8b('0x2d')](_0xda8b('0x4c'))[_0xda8b('0x2e')]([_0xda8b('0x4d'),_0xda8b('0x11'),_0xda8b('0x4e'),_0xda8b('0x32'),_0xda8b('0x33')],squel[_0xda8b('0xf')]()['fields'](_0x499cfd)[_0xda8b('0x12')](_0xda8b('0x3c'))[_0xda8b('0x13')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xda8b('0x13')](_0xda8b('0x4f'),null,_0xda8b('0x50'))[_0xda8b('0x15')](_0xda8b('0x51'),_0x532d13)['where'](_0xda8b('0x3a'),NOW))[_0xda8b('0x3e')]();}function insertCmContact(_0x2a3c8c,_0x276385,_0x2b0f91,_0x2af7b7){var _0x3238a1=_['concat'](_[_0xda8b('0x52')](_0x2af7b7),[_0xda8b('0x31'),_0xda8b('0x53'),_0xda8b('0x32'),_0xda8b('0x33'),_0xda8b('0x54')]);return squel['insert']()['into'](_0xda8b('0x36'))[_0xda8b('0x2e')](_0x3238a1,squel[_0xda8b('0xf')]()[_0xda8b('0x35')](_0x3238a1)[_0xda8b('0x12')](_0x276385)[_0xda8b('0x15')]('('+_0x2b0f91[_0xda8b('0x13')](',')+_0xda8b('0x55'),squel[_0xda8b('0xf')]()[_0xda8b('0x35')](_0x2b0f91)[_0xda8b('0x12')]('cm_contacts')[_0xda8b('0x15')](_0xda8b('0x47'),_0x2a3c8c)[_0xda8b('0x15')](_0xda8b('0x56')))['where'](_0xda8b('0x57'),squel[_0xda8b('0xf')]()[_0xda8b('0x10')]('MIN(id)',_0xda8b('0x58'))[_0xda8b('0x12')](_0x276385)['group'](_0x2b0f91[_0xda8b('0x13')](','))))[_0xda8b('0x3e')]();}function handleStop(){logger[_0xda8b('0x59')](_0xda8b('0x5a'));stopped=!![];}function handleUncaughtException(_0x422764){logger[_0xda8b('0x5b')](_0x422764[_0xda8b('0x5c')]);process[_0xda8b('0x5d')](0x1);}function handleError(_0x484d9d,_0x24dd35){stats[_0xda8b('0x5e')][_0xda8b('0x1b')]({'name':_0x24dd35['code'],'message':_0x24dd35[_0xda8b('0x5c')],'row':_0x484d9d});}function handleQuery(_0x3b1475){logger[_0xda8b('0x59')](_0x3b1475);return db[_0xda8b('0x5f')]['query'](_0x3b1475)[_0xda8b('0x60')](function(_0x2dcceb){results[_0xda8b('0x1b')](_0x2dcceb);})['catch'](function(_0x780ee){logger[_0xda8b('0x5b')](_0x780ee['message']);});}function updateTzCampaigns(_0x25bebb){return new Promise(function(_0x5ea473,_0x189d6e){var _0x4270b3=squel[_0xda8b('0xf')]()[_0xda8b('0x35')]([_0xda8b('0x61'),_0xda8b('0x62')])['from'](_0xda8b('0x63'))[_0xda8b('0x13')](_0xda8b('0x64'),null,_0xda8b('0x65'))[_0xda8b('0x15')]('campaigns_has_cm_lists.CmListId='+_0x25bebb);db[_0xda8b('0x5f')][_0xda8b('0x66')](_0x4270b3[_0xda8b('0x3e')]())[_0xda8b('0x60')](function(_0x3e3bfd){var _0x565b38=[];for(var _0x274d92=0x0;_0x274d92<_0x3e3bfd['length'];_0x274d92++){_0x565b38[_0xda8b('0x1b')](getTimezoneData(_0x3e3bfd[_0x274d92],tmp_campaigns));}BPromise[_0xda8b('0x1c')](_0x565b38)[_0xda8b('0x1a')](function(){_0x5ea473({'val':0x1});});})[_0xda8b('0x67')](function(_0x17ab2a){logger[_0xda8b('0x5b')](_0x17ab2a[_0xda8b('0x5c')]);_0x5ea473({'val':0x0});});});}function updateTzVoiceQueues(_0xf07bce){return new Promise(function(_0x6301e6,_0x177aab){var _0x391e39=squel[_0xda8b('0xf')]()[_0xda8b('0x35')]([_0xda8b('0x68'),_0xda8b('0x69')])['from'](_0xda8b('0x6a'))[_0xda8b('0x13')](_0xda8b('0x6b'),null,_0xda8b('0x6c'))[_0xda8b('0x15')](_0xda8b('0x6d')+_0xf07bce);db[_0xda8b('0x5f')]['query'](_0x391e39[_0xda8b('0x3e')]())[_0xda8b('0x60')](function(_0x541f24){var _0x140900=[];for(var _0x205547=0x0;_0x205547<_0x541f24[_0xda8b('0x1e')];_0x205547++){_0x140900[_0xda8b('0x1b')](getTimezoneData(_0x541f24[_0x205547],tmp_voice_queues));}BPromise[_0xda8b('0x1c')](_0x140900)[_0xda8b('0x1a')](function(){_0x6301e6({'val':0x1});});})[_0xda8b('0x67')](function(_0x3f5b7d){logger[_0xda8b('0x5b')](_0x3f5b7d[_0xda8b('0x5c')]);_0x6301e6({'val':0x0});});});}function getTimezoneData(_0x284124,_0x3be723){return new Promise(function(_0x22f710,_0x59c1e0){var _0x561565=shared[_0xda8b('0x6e')];var _0x503825=_0x561565[_0x284124['dialTimezone']];if(_['isNil'](_0x503825)){_0x22f710({'ret':0x1});}else{var _0x191164=_0x503825['utcOffset'];var _0x494f48=squel[_0xda8b('0x2c')]()[_0xda8b('0x2d')](_0x3be723)[_0xda8b('0x6f')]('id',_0x284124['id'])[_0xda8b('0x6f')](_0xda8b('0x70'),_0x191164)[_0xda8b('0x6f')](_0xda8b('0x71'),_0x284124[_0xda8b('0x71')])['toString']();return db['sequelize'][_0xda8b('0x66')](_0x494f48)[_0xda8b('0x60')](function(_0x1363e4){_0x22f710({'ret':0x1});})['catch'](function(_0x28bdde){logger['error'](_0x28bdde['message']);_0x59c1e0({'ret':0x1});});}});}function handleTZQuery(_0x339bfa){logger[_0xda8b('0x59')](_0x339bfa);return db['sequelize'][_0xda8b('0x66')](_0x339bfa)[_0xda8b('0x60')](function(_0x37d786){})[_0xda8b('0x67')](function(_0x4a9acc){logger[_0xda8b('0x5b')](_0x4a9acc[_0xda8b('0x5c')]);});}function main(_0x3bdb49,_0x4c4eb7,_0x479bab,_0x792ee0){logger[_0xda8b('0x59')](_0xda8b('0x72'),_0x3bdb49,JSON[_0xda8b('0x73')](_0x4c4eb7));process[_0xda8b('0x74')](_0xda8b('0x75'));var _0x24e8ef=_0x4c4eb7[_0xda8b('0x76')];var _0x299af8=_['clone'](_0x24e8ef);var _0x43d257=_0x4c4eb7[_0xda8b('0x77')];var _0x2229d7=path[_0xda8b('0x13')](config[_0xda8b('0x78')],_0xda8b('0x79'),_0x43d257+_0xda8b('0x7a'));hasTZ=_[_0xda8b('0x52')](_0x24e8ef)[_0xda8b('0x7b')](_0xda8b('0x71'));var _0x2d850d=_[_0xda8b('0x52')](_0x24e8ef)[_0xda8b('0x13')]();logger[_0xda8b('0x59')](_0xda8b('0x7c'),_0x2d850d);db[_0xda8b('0x7d')]['findAll']({'raw':!![],'attributes':['id',_0xda8b('0x7e')]})['then'](function(_0x1ca3da){for(var _0x3973f2=0x0;_0x3973f2<_0x1ca3da[_0xda8b('0x1e')];_0x3973f2++){if(_0x1ca3da[_0x3973f2][_0xda8b('0x7e')]in _0x24e8ef){contactItemTypes[_0xda8b('0x1b')](_0x1ca3da[_0x3973f2]);delete _0x299af8[_0x1ca3da[_0x3973f2][_0xda8b('0x7e')]];hasAdditionalPhones=!![];}for(var _0x1ddda3 in _0x24e8ef){if(_0x1ca3da[_0x3973f2]['name']+'_description'===_0x1ddda3){phoneDescriptions[_0xda8b('0x1b')]({'itemTypeId':_0x1ca3da[_0x3973f2]['id'],'description':_0x1ddda3});delete _0x299af8[_0x1ddda3];}}}if(hasAdditionalPhones)_0x299af8[_0xda8b('0x19')]='';var _0x170cff=_['keys'](_0x299af8)[_0xda8b('0x13')]();logger[_0xda8b('0x59')]('header',_0x170cff);fs[_0xda8b('0x7f')](_0x2229d7,_0x170cff+'\x0a');Papa[_0xda8b('0x80')](fs[_0xda8b('0x81')](_0x3bdb49),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e5113,_0x12b389){try{for(var _0x2b5186=0x0,_0x5229b8=[];_0x2b5186<_0x5e5113[_0xda8b('0x82')][_0xda8b('0x1e')];_0x2b5186++){stats['rows']+=0x1;if(_0x5e5113['errors'][_0x2b5186]){handleError(_0x5e5113['data'][_0x2b5186],_0x5e5113['errors'][_0x2b5186]);}else{var _0x567ee1=[];var _0x3c1ced=[];var _0x170d0d={};for(var _0x3b8037 in _0x24e8ef){let _0x5b9659=contactItemTypes[_0xda8b('0x83')](_0x1e06ec=>_0x1e06ec[_0xda8b('0x7e')]===_0x3b8037);let _0x1336d0=contactItemTypes[_0xda8b('0x83')](_0x4007a0=>_0x4007a0['name']+_0xda8b('0x84')===_0x3b8037);if(_['isNil'](_0x5b9659)&&_[_0xda8b('0x85')](_0x1336d0)){if(_0x24e8ef[_0xda8b('0x86')](_0x3b8037)){if(_0x5e5113[_0xda8b('0x82')][_0x2b5186][_0x24e8ef[_0x3b8037]]){var _0x53aa29=_[_0xda8b('0x87')](_0x5e5113['data'][_0x2b5186][_0x24e8ef[_0x3b8037]][_0xda8b('0x88')](/"/g,'\x27'));switch(_0x3b8037){case _0xda8b('0x2f'):var _0x17a93f=moment(_0x53aa29,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x17a93f[_0xda8b('0x89')]()){_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x53aa29+'\x22');}else{_0x567ee1[_0xda8b('0x1b')](_0xda8b('0x8a'));}break;case _0xda8b('0x44'):var _0x3dddc2=parseInt(_0x53aa29);_0x53aa29=_[_0xda8b('0x8b')](_0x3dddc2)||_0x3dddc2<0x0||_0x3dddc2>0x4?_0x792ee0?0x3:0x2:_0x3dddc2;_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x53aa29+'\x22');break;case'UserId':var _0x273f3f=parseInt(_0x53aa29);if(_[_0xda8b('0x8c')](_0x273f3f)&&_['includes'](_0x479bab,_0x273f3f)){_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x273f3f+'\x22');}else{_0x567ee1['push'](_0xda8b('0x8d'));}break;case _0xda8b('0x8e'):if(isEmail(_0x53aa29)){_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x53aa29+'\x22');}else{_0x567ee1[_0xda8b('0x1b')](_0xda8b('0x8f'));}break;case _0xda8b('0x90'):var _0x163832=moment(_0x53aa29,'YYYY-MM-DD',!![]);if(_0x163832[_0xda8b('0x89')]()){_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x53aa29+'\x22');}else{_0x567ee1[_0xda8b('0x1b')](_0xda8b('0x91'));}break;case _0xda8b('0x71'):var _0x579372=shared[_0xda8b('0x6e')];var _0x3698b2=_0x579372[_0x53aa29];if(!_[_0xda8b('0x85')](_0x3698b2)){var _0x41d75d=_0x3698b2[_0xda8b('0x92')];_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x53aa29+'\x22');_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x41d75d+'\x22');}break;default:_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x53aa29+'\x22');}}else{switch(_0x3b8037){case _0xda8b('0x93'):case'phone':_0x567ee1['push'](_0x3b8037+_0xda8b('0x94'));break;default:_0x5229b8[_0xda8b('0x1b')]('\x22\x22');}}}}else{var _0x4908cb='';if(!_['isNil'](_0x5b9659)){if(!_0x170d0d['hasOwnProperty'](_0x5b9659['id'])){if(!_['isNil'](_0x5e5113[_0xda8b('0x82')][_0x2b5186][_0x24e8ef[_0x3b8037]])){var _0x53aa29=_['trim'](_0x5e5113[_0xda8b('0x82')][_0x2b5186][_0x24e8ef[_0x3b8037]][_0xda8b('0x88')](/"/g,'\x27'));var _0x4bebb3=phoneDescriptions[_0xda8b('0x83')](_0x426765=>_0x426765['itemTypeId']===_0x5b9659['id']);if(!_['isNil'](_0x4bebb3)){var _0x401664=_[_0xda8b('0x87')](_0x5e5113['data'][_0x2b5186][_0x24e8ef[_0x4bebb3[_0xda8b('0x95')]]][_0xda8b('0x88')](/"/g,'\x27'));if(!_[_0xda8b('0x85')](_0x401664))_0x53aa29=_0x53aa29+'§'+_0x401664;}if(_0x4908cb=='')_0x4908cb=_0x53aa29;else _0x4908cb+='|'+_0x53aa29;}_0x3c1ced[_0xda8b('0x1b')](_0x5b9659['id']+':'+_0x4908cb);_0x170d0d[_0x5b9659['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5229b8[_0xda8b('0x1b')]('\x22'+_0x3c1ced[_0xda8b('0x13')](';')+'\x22');}if(_0x567ee1[_0xda8b('0x1e')]){handleError(_0x5e5113[_0xda8b('0x82')][_0x2b5186],{'code':'SystemRow','message':_0x567ee1[_0xda8b('0x13')]()});}else{fs[_0xda8b('0x96')](_0x2229d7,_0x5229b8['join']()+'\x0a');}_0x5229b8=[];}if(!(stats[_0xda8b('0x97')]%0xc8)){socket[_0xda8b('0x98')](_0xda8b('0x99')+_0x43d257,stats);stats['errors']=[];}}if(stopped){logger[_0xda8b('0x59')]('Abort\x20parser');_0x12b389['abort']();}}catch(_0xa3f64a){handleError(_0x5e5113[_0xda8b('0x82')][_0x2b5186],{'code':_0xda8b('0x9a'),'message':_0xa3f64a['message']});logger[_0xda8b('0x5b')](_0xda8b('0x9b'),_0xa3f64a[_0xda8b('0x5c')]);}},'complete':function(){try{var _0x13696a=[];var _0x2eb01f=[];var _0x5031f8=_0xda8b('0x36');if(_0x4c4eb7[_0xda8b('0x9c')]&&_0x4c4eb7[_0xda8b('0x9c')]['length']){_0x5031f8=_0xda8b('0x9d')+_0x43d257;_0x13696a['push'](_0xda8b('0x9e')+_0x5031f8+_0xda8b('0x9f'));}tmp_campaigns=_0xda8b('0xa0')+_0x43d257;tmp_voice_queues='voice_queues_'+_0x43d257;_0x2eb01f[_0xda8b('0x1b')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xda8b('0xa1'));_0x2eb01f[_0xda8b('0x1b')](_0xda8b('0x9e')+tmp_voice_queues+_0xda8b('0xa1'));BPromise['each'](_0x2eb01f,handleTZQuery)['then'](function(_0x55570b){updateTzCampaigns(_0x4c4eb7[_0xda8b('0x31')])[_0xda8b('0x1a')](function(_0xb7f4d){updateTzVoiceQueues(_0x4c4eb7[_0xda8b('0x31')])[_0xda8b('0x1a')](function(_0xd20dfb){if(hasTZ)_0x170cff=_0x170cff[_0xda8b('0x88')](_0xda8b('0x71'),'dialTimezone,utcOffset');var _0x52067a=util[_0xda8b('0xc')](_0xda8b('0xa2'),_0x2229d7,_0x5031f8,_0x170cff,_0x4c4eb7[_0xda8b('0x31')],_0x4c4eb7[_0xda8b('0x53')]||null,NOW,NOW);if(_['isNil'](_0x24e8ef[_0xda8b('0x2f')])){_0x52067a+=',\x20scheduledAt\x20=\x20NOW()';}_0x13696a['push'](_0x52067a);if(_0x4c4eb7[_0xda8b('0x9c')]&&_0x4c4eb7['duplicates'][_0xda8b('0x1e')]){_0x13696a[_0xda8b('0x1b')](insertCmContact(_0x4c4eb7[_0xda8b('0x31')],_0x5031f8,_0x4c4eb7[_0xda8b('0x9c')],_0x24e8ef));_0x13696a[_0xda8b('0x1b')](_0xda8b('0xa3')+_0x5031f8+';');}BPromise[_0xda8b('0xa4')](_0x13696a,handleQuery)[_0xda8b('0x1a')](function(_0x2f2ae9){BPromise['all']([handleAdditionalPhones()])[_0xda8b('0x1a')](function(){_0x13696a=[];for(var _0x501784=0x0;_0x501784\x20\x20','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','push','AdditionalPhones','split','length','filter','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','.CmListId\x20=\x20?'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa66e,0x1d8));var _0xea66=function(_0x3f8419,_0x16225d){_0x3f8419=_0x3f8419-0x0;var _0x400365=_0xa66e[_0x3f8419];return _0x400365;};'use strict';var fs=require('fs');var path=require(_0xea66('0x0'));var _=require(_0xea66('0x1'));var Papa=require(_0xea66('0x2'));var util=require(_0xea66('0x3'));var BPromise=require(_0xea66('0x4'));var moment=require(_0xea66('0x5'));var squel=require(_0xea66('0x6'));var Redis=require(_0xea66('0x7'));var db=require(_0xea66('0x8'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xea66('0x9'))(_0xea66('0xa'));config[_0xea66('0xb')]=_[_0xea66('0xc')](config[_0xea66('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xea66('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xea66('0xe')](_0xea66('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0xea66('0xf'));function isEmail(_0x2edfe7){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xea66('0x10')](_0x2edfe7);}function selectNotIn(_0x3a9187,_0x4550fa,_0x63bbb5,_0x1b1ea6,_0x5c29f3){return squel[_0xea66('0x11')]()[_0xea66('0x12')](_0xea66('0x13'))[_0xea66('0x14')](_0x1b1ea6)[_0xea66('0x15')](_0x4550fa,null,_0x4550fa+_0xea66('0x16')+_0x1b1ea6+'.'+_0x63bbb5)[_0xea66('0x17')](_0x1b1ea6+'.'+_0x63bbb5+_0xea66('0x18')+_0x3a9187+'.'+_0x63bbb5)[_0xea66('0x17')](_0x4550fa+_0xea66('0x19')+_0x5c29f3[_0xea66('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xb61b6b,_0x9f5a95){promisesAdditionalPhones=[];return db[_0xea66('0x1a')][_0xea66('0x1b')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xea66('0x1c')](function(_0xb24d45){if(_0xb24d45!==null){var _0x5ba976=[];for(var _0x3f2ceb=0x0;_0x3f2ceb<_0xb24d45['length'];_0x3f2ceb++){var _0x254563=_0xb24d45[_0x3f2ceb];_0x5ba976[_0xea66('0x1d')](insertAdditionalPhones(_0x254563));}}Promise['all'](_0x5ba976)[_0xea66('0x1c')](function(){_0xb61b6b({'val':0x1});});});});}function insertAdditionalPhones(_0x18e7ce){return new Promise(function(_0x2a4322,_0x7d5953){var _0x32a6cb=_0x18e7ce[_0xea66('0x1e')];var _0x2ddf94=_0x32a6cb[_0xea66('0x1f')](';');var _0xd3fc59=[];orderBy=0x0;for(var _0x32777f=0x0;_0x32777f<_0x2ddf94['length'];_0x32777f++){_0xd3fc59[_0xea66('0x1d')](splitAdditionalPhone(_0x18e7ce['id'],_0x2ddf94[_0x32777f]));}Promise['all'](_0xd3fc59)[_0xea66('0x1c')](function(){_0x2a4322({'val':_0x2ddf94[_0xea66('0x20')]});});});}function splitAdditionalPhone(_0x3b84b3,_0x58bbea){return new Promise(function(_0x270dc1,_0x35cc49){var _0x288ba6=_0x58bbea[_0xea66('0x1f')](':');var _0x577ace=_0x288ba6[0x0];var _0x387132=_0x288ba6[0x1];if(!_['isNil'](_0x387132)){var _0x5809d9=_0x387132[_0xea66('0x1f')]('|');var _0x41b1af=[];for(var _0x56be31=0x0;_0x56be31<_0x5809d9[_0xea66('0x20')];_0x56be31++){if(_0x5809d9[_0x56be31]!==''){var _0x396908=_[_0xea66('0x21')](promisesAdditionalPhones,{'contactId':_0x3b84b3,'phone':_0x5809d9[_0x56be31]});if(_0x396908['length']==0x0){orderBy++;promisesAdditionalPhones[_0xea66('0x1d')]({'contactId':_0x3b84b3,'contactTypeId':_0x577ace,'phone':_0x5809d9[_0x56be31],'orderBy':orderBy});}}}_0x270dc1({'ok':0x1});}else _0x270dc1({'res':0x0});});}function createAdditionalPhone(_0x2eee6b,_0x44e977,_0x2f12b0,_0x5f1906){var _0x879f0='';var _0x41da5b='';var _0x49ac7b=_0x2f12b0[_0xea66('0x1f')]('§');_0x879f0=_0x49ac7b[0x0];if(_0x49ac7b[_0xea66('0x20')]==0x2)_0x41da5b=_0x49ac7b[0x1];return new Promise(function(_0x10b938,_0x350f5f){return db[_0xea66('0x22')][_0xea66('0x23')]({'where':{'CmContactId':_0x2eee6b,'item':_0x879f0}})[_0xea66('0x1c')](function(_0x555314){if(_0x555314){return db[_0xea66('0x22')][_0xea66('0x24')]({'ItemTypeId':_0x44e977,'description':_0x41da5b,'OrderBy':_0x5f1906},{'where':{'CmContactId':_0x2eee6b,'item':_0x879f0}})[_0xea66('0x1c')](function(_0x9c3a03){_0x10b938({'res':_0xea66('0x25')});});}else{return db[_0xea66('0x22')][_0xea66('0x26')]({'CmContactId':_0x2eee6b,'item':_0x879f0,'description':_0x41da5b,'ItemTypeId':_0x44e977,'OrderBy':_0x5f1906,'ItemClass':_0xea66('0x27')})['then'](function(_0x1b6fa8){_0x10b938({'res':_0xea66('0x28')});});}});});}function insertCmHopper(_0x165e02,_0x1c5816,_0x4bb45f,_0x3e1a36,_0x50ec50){var _0x274b50=[_0xea66('0x29'),'cm_contacts.scheduledat',_0xea66('0x2a'),_0xea66('0x2b'),_0x1c5816+'.'+_0x3e1a36,_0xea66('0x2c'),_0xea66('0x2d'),_0xea66('0x2e'),_0xea66('0x2f'),'\x22'+_0x50ec50+'\x22'];return squel[_0xea66('0x30')]()[_0xea66('0x31')](_0xea66('0x32'))[_0xea66('0x33')]([_0xea66('0x13'),'scheduledat',_0xea66('0x34'),_0xea66('0x35'),_0x3e1a36,_0xea66('0x36'),_0xea66('0x37'),_0xea66('0x38'),_0xea66('0x39'),_0xea66('0x3a')],squel[_0xea66('0x11')]()[_0xea66('0x3b')](_0x274b50)['from'](_0x1c5816)[_0xea66('0x15')](_0xea66('0x3c'),null,_0xea66('0x3d')+_0x1c5816+_0xea66('0x3e'))[_0xea66('0x15')](_0x4bb45f,null,_0x4bb45f+_0xea66('0x16')+_0x1c5816+'.'+_0x3e1a36)[_0xea66('0x17')](_0x1c5816+'.CmListId\x20=\x20?',_0x165e02)[_0xea66('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1c5816,_0x4bb45f,_0x3e1a36,'cm_hopper',[_0xea66('0x40'),'\x22onlyIfOpen\x22']))[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1c5816,_0x4bb45f,_0x3e1a36,'cm_hopper',[_0xea66('0x40')])))[_0xea66('0x41')]();}function insertCmHopperBlack(_0x2d88f5,_0x34ed97,_0x257cd6,_0xd7a28d){var _0x53e5c5=[_0xea66('0x29'),_0xea66('0x2a'),_0xea66('0x2b'),_0x34ed97+'.'+_0xd7a28d,_0xea66('0x2c'),_0xea66('0x2d')];return squel['insert']()[_0xea66('0x31')](_0xea66('0x42'))['fromQuery']([_0xea66('0x13'),_0xea66('0x34'),_0xea66('0x35'),_0xd7a28d,'createdAt',_0xea66('0x37')],squel['select']()[_0xea66('0x3b')](_0x53e5c5)['from'](_0x34ed97)[_0xea66('0x15')](_0xea66('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x34ed97+_0xea66('0x3e'))[_0xea66('0x15')](_0x257cd6,null,_0x257cd6+_0xea66('0x16')+_0x34ed97+'.'+_0xd7a28d)[_0xea66('0x17')](_0x34ed97+_0xea66('0x43'),_0x2d88f5)['where'](_0xea66('0x44'),NOW)[_0xea66('0x17')](_0xea66('0x3f'),squel[_0xea66('0x11')]()['field'](_0xea66('0x13'))[_0xea66('0x14')](_0xea66('0x42'))[_0xea66('0x17')](_0xea66('0x45'),_0x2d88f5)[_0xea66('0x17')](_0xd7a28d+'\x20=\x20'+_0x34ed97+'.'+_0xd7a28d)))[_0xea66('0x41')]();}function insertTzCmHopper(_0x4b642c,_0x1ae822,_0x41199f,_0x44dd11,_0x42771e,_0x34ab2b){var _0x911b12=[_0xea66('0x29'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x34ab2b+_0xea66('0x46'),_0xea66('0x2a'),'cm_contacts.ListId',_0x1ae822+'.'+_0x44dd11,_0xea66('0x2c'),'cm_contacts.updatedAt',_0xea66('0x2e'),_0xea66('0x2f'),'\x22'+_0x42771e+'\x22'];var _0x991ae8=squel[_0xea66('0x30')]()[_0xea66('0x31')](_0xea66('0x32'))[_0xea66('0x33')](['phone',_0xea66('0x47'),_0xea66('0x34'),_0xea66('0x35'),_0x44dd11,'createdAt',_0xea66('0x37'),_0xea66('0x38'),_0xea66('0x39'),_0xea66('0x3a')],squel[_0xea66('0x11')]()[_0xea66('0x3b')](_0x911b12)['from'](_0x1ae822)[_0xea66('0x15')](_0xea66('0x3c'),null,_0xea66('0x3d')+_0x1ae822+'.CmListId')[_0xea66('0x15')](_0x41199f,null,_0x41199f+_0xea66('0x16')+_0x1ae822+'.'+_0x44dd11)[_0xea66('0x15')](_0x34ab2b,null,_0x34ab2b+_0xea66('0x16')+_0x1ae822+'.'+_0x44dd11)['where'](_0x1ae822+_0xea66('0x43'),_0x4b642c)[_0xea66('0x17')](_0xea66('0x44'),NOW)[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1ae822,_0x41199f,_0x44dd11,'cm_hopper',[_0xea66('0x40'),'\x22onlyIfOpen\x22']))[_0xea66('0x17')](_0xea66('0x3f'),selectNotIn(_0x1ae822,_0x41199f,_0x44dd11,'cm_hopper',[_0xea66('0x40')])))[_0xea66('0x41')]();return _0x991ae8;}function insertTzCmHopperBlack(_0x28b7aa,_0x5ada24,_0x23b903,_0x288165){var _0x1b305d=['cm_contacts.phone',_0xea66('0x2a'),_0xea66('0x2b'),_0x5ada24+'.'+_0x288165,'cm_contacts.createdAt',_0xea66('0x2d')];return squel[_0xea66('0x30')]()['into'](_0xea66('0x42'))['fromQuery']([_0xea66('0x13'),'ContactId',_0xea66('0x35'),_0x288165,'createdAt',_0xea66('0x37')],squel[_0xea66('0x11')]()[_0xea66('0x3b')](_0x1b305d)[_0xea66('0x14')](_0x5ada24)[_0xea66('0x15')](_0xea66('0x3c'),null,'cm_contacts.ListId\x20=\x20'+_0x5ada24+_0xea66('0x3e'))[_0xea66('0x15')](_0x23b903,null,_0x23b903+_0xea66('0x16')+_0x5ada24+'.'+_0x288165)['where'](_0x5ada24+_0xea66('0x43'),_0x28b7aa)[_0xea66('0x17')](_0xea66('0x44'),NOW)[_0xea66('0x17')](_0xea66('0x3f'),squel[_0xea66('0x11')]()[_0xea66('0x12')]('phone')['from'](_0xea66('0x42'))[_0xea66('0x17')](_0xea66('0x45'),_0x28b7aa)[_0xea66('0x17')](_0x288165+'\x20=\x20'+_0x5ada24+'.'+_0x288165)))[_0xea66('0x41')]();}function insertCmHopperAdditionalPhones(_0x4cff2f){var _0xa60f6f=['cm_hopper.id',_0xea66('0x48'),_0xea66('0x49'),_0xea66('0x4a'),_0xea66('0x4b')];return squel[_0xea66('0x30')]()['into']('cm_hopper_additional_phones')['fromQuery'](['CmHopperId',_0xea66('0x13'),_0xea66('0x4c'),'createdAt',_0xea66('0x37')],squel['select']()[_0xea66('0x3b')](_0xa60f6f)[_0xea66('0x14')](_0xea66('0x32'))[_0xea66('0x15')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xea66('0x15')](_0xea66('0x4d'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xea66('0x17')](_0xea66('0x4e'),_0x4cff2f)[_0xea66('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xea66('0x41')]();}function insertCmContact(_0x21162d,_0x193070,_0x22af8f,_0x463d24){var _0xbc846f=_['concat'](_[_0xea66('0x4f')](_0x463d24),['ListId',_0xea66('0x50'),'createdAt',_0xea66('0x37'),_0xea66('0x51')]);return squel[_0xea66('0x30')]()[_0xea66('0x31')]('cm_contacts')[_0xea66('0x33')](_0xbc846f,squel[_0xea66('0x11')]()['fields'](_0xbc846f)[_0xea66('0x14')](_0x193070)[_0xea66('0x17')]('('+_0x22af8f['join'](',')+_0xea66('0x52'),squel[_0xea66('0x11')]()['fields'](_0x22af8f)['from'](_0xea66('0x3c'))['where'](_0xea66('0x45'),_0x21162d)[_0xea66('0x17')](_0xea66('0x53')))['where'](_0xea66('0x54'),squel[_0xea66('0x11')]()['field']('MIN(id)','min_id')[_0xea66('0x14')](_0x193070)[_0xea66('0x55')](_0x22af8f[_0xea66('0x15')](','))))[_0xea66('0x41')]();}function handleStop(){logger['info'](_0xea66('0x56'));stopped=!![];}function handleUncaughtException(_0x25abe2){logger[_0xea66('0x57')](_0x25abe2[_0xea66('0x58')]);process[_0xea66('0x59')](0x1);}function handleError(_0x281da4,_0x431b3f){stats[_0xea66('0x5a')][_0xea66('0x1d')]({'name':_0x431b3f['code'],'message':_0x431b3f[_0xea66('0x58')],'row':_0x281da4});}function handleQuery(_0x5312a2){logger[_0xea66('0x5b')](_0x5312a2);return db[_0xea66('0x5c')]['query'](_0x5312a2)[_0xea66('0x5d')](function(_0x4cb6a2){results[_0xea66('0x1d')](_0x4cb6a2);})[_0xea66('0x5e')](function(_0x384695){logger[_0xea66('0x57')](_0x384695[_0xea66('0x58')]);});}function updateTzCampaigns(_0x476e61){return new Promise(function(_0x25060f,_0x13625f){var _0x304720=squel[_0xea66('0x11')]()[_0xea66('0x3b')]([_0xea66('0x5f'),'campaigns.dialTimezone'])['from'](_0xea66('0x60'))[_0xea66('0x15')](_0xea66('0x61'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0xea66('0x17')](_0xea66('0x62')+_0x476e61);db[_0xea66('0x5c')][_0xea66('0x63')](_0x304720[_0xea66('0x41')]())[_0xea66('0x5d')](function(_0x163d7f){var _0x22495a=[];for(var _0x3a74f8=0x0;_0x3a74f8<_0x163d7f[_0xea66('0x20')];_0x3a74f8++){_0x22495a['push'](getTimezoneData(_0x163d7f[_0x3a74f8],tmp_campaigns));}BPromise[_0xea66('0x64')](_0x22495a)[_0xea66('0x1c')](function(){_0x25060f({'val':0x1});});})[_0xea66('0x5e')](function(_0x256ee3){logger[_0xea66('0x57')](_0x256ee3[_0xea66('0x58')]);_0x25060f({'val':0x0});});});}function updateTzVoiceQueues(_0x32e0f4){return new Promise(function(_0x5bdfff,_0x27763f){var _0x5bbbbb=squel[_0xea66('0x11')]()[_0xea66('0x3b')](['voice_queues.id',_0xea66('0x65')])[_0xea66('0x14')](_0xea66('0x66'))['join'](_0xea66('0x67'),null,_0xea66('0x68'))[_0xea66('0x17')]('voice_queues_has_cm_lists.CmListId='+_0x32e0f4);db['sequelize'][_0xea66('0x63')](_0x5bbbbb[_0xea66('0x41')]())['spread'](function(_0x594677){var _0x4e767f=[];for(var _0x4f463b=0x0;_0x4f463b<_0x594677[_0xea66('0x20')];_0x4f463b++){_0x4e767f[_0xea66('0x1d')](getTimezoneData(_0x594677[_0x4f463b],tmp_voice_queues));}BPromise[_0xea66('0x64')](_0x4e767f)[_0xea66('0x1c')](function(){_0x5bdfff({'val':0x1});});})[_0xea66('0x5e')](function(_0x31a54e){logger[_0xea66('0x57')](_0x31a54e[_0xea66('0x58')]);_0x5bdfff({'val':0x0});});});}function getTimezoneData(_0x4d9105,_0x56c77a){return new Promise(function(_0x2dfbfd,_0x2bc881){var _0x552420=shared[_0xea66('0x69')];var _0xe447c5=_0x552420[_0x4d9105['dialTimezone']];if(_[_0xea66('0x6a')](_0xe447c5)){_0x2dfbfd({'ret':0x1});}else{var _0x1660bf=_0xe447c5[_0xea66('0x6b')];var _0x49bdcc=squel[_0xea66('0x30')]()[_0xea66('0x31')](_0x56c77a)[_0xea66('0x6c')]('id',_0x4d9105['id'])[_0xea66('0x6c')]('offset',_0x1660bf)[_0xea66('0x6c')](_0xea66('0x6d'),_0x4d9105['dialTimezone'])[_0xea66('0x41')]();return db['sequelize'][_0xea66('0x63')](_0x49bdcc)['spread'](function(_0x308df0){_0x2dfbfd({'ret':0x1});})[_0xea66('0x5e')](function(_0x1d0609){logger[_0xea66('0x57')](_0x1d0609[_0xea66('0x58')]);_0x2bc881({'ret':0x1});});}});}function handleTZQuery(_0x5c0552){logger['info'](_0x5c0552);return db['sequelize']['query'](_0x5c0552)[_0xea66('0x5d')](function(_0x5efb8f){})[_0xea66('0x5e')](function(_0x26a6fb){logger['error'](_0x26a6fb['message']);});}function main(_0x5205c1,_0x3e0f5f,_0x28e283,_0x19bca2){logger['info'](_0xea66('0x6e'),_0x5205c1,JSON[_0xea66('0x6f')](_0x3e0f5f));process['send'](_0xea66('0x70'));var _0x3ae486=_0x3e0f5f['binding'];var _0x3721b4=_[_0xea66('0x71')](_0x3ae486);var _0x3c70da=_0x3e0f5f['socket_timestamp'];var _0x3e9af5=path['join'](config[_0xea66('0x72')],_0xea66('0x73'),_0x3c70da+_0xea66('0x74'));hasTZ=_[_0xea66('0x4f')](_0x3ae486)[_0xea66('0x75')](_0xea66('0x6d'));var _0x2a4357=_[_0xea66('0x4f')](_0x3ae486)[_0xea66('0x15')]();logger['info'](_0xea66('0x76'),_0x2a4357);db[_0xea66('0x77')]['findAll']({'raw':!![],'attributes':['id',_0xea66('0x78')]})[_0xea66('0x1c')](function(_0x33e8c4){for(var _0x2a0a5f=0x0;_0x2a0a5f<_0x33e8c4['length'];_0x2a0a5f++){if(_0x33e8c4[_0x2a0a5f]['name']in _0x3ae486){contactItemTypes[_0xea66('0x1d')](_0x33e8c4[_0x2a0a5f]);delete _0x3721b4[_0x33e8c4[_0x2a0a5f][_0xea66('0x78')]];hasAdditionalPhones=!![];}for(var _0x37617d in _0x3ae486){if(_0x33e8c4[_0x2a0a5f][_0xea66('0x78')]+_0xea66('0x79')===_0x37617d){phoneDescriptions[_0xea66('0x1d')]({'itemTypeId':_0x33e8c4[_0x2a0a5f]['id'],'description':_0x37617d});delete _0x3721b4[_0x37617d];}}}if(hasAdditionalPhones)_0x3721b4[_0xea66('0x1e')]='';var _0x30a66a=_[_0xea66('0x4f')](_0x3721b4)[_0xea66('0x15')]();logger[_0xea66('0x5b')](_0xea66('0x76'),_0x30a66a);fs[_0xea66('0x7a')](_0x3e9af5,_0x30a66a+'\x0a');Papa[_0xea66('0x7b')](fs[_0xea66('0x7c')](_0x5205c1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1f776b,_0x487d4c){try{for(var _0x5090b6=0x0,_0x267858=[];_0x5090b6<_0x1f776b[_0xea66('0x7d')][_0xea66('0x20')];_0x5090b6++){stats[_0xea66('0x7e')]+=0x1;if(_0x1f776b[_0xea66('0x5a')][_0x5090b6]){handleError(_0x1f776b[_0xea66('0x7d')][_0x5090b6],_0x1f776b['errors'][_0x5090b6]);}else{var _0x1b3b85=[];var _0x461164=[];var _0x256622={};for(var _0x21a814 in _0x3ae486){let _0x11f9d3=contactItemTypes[_0xea66('0x7f')](_0x2ab78d=>_0x2ab78d[_0xea66('0x78')]===_0x21a814);let _0x11b2e7=contactItemTypes['find'](_0x222581=>_0x222581[_0xea66('0x78')]+_0xea66('0x79')===_0x21a814);if(_[_0xea66('0x6a')](_0x11f9d3)&&_[_0xea66('0x6a')](_0x11b2e7)){if(_0x3ae486[_0xea66('0x80')](_0x21a814)){if(_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]]){var _0x409ccf=_[_0xea66('0x81')](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]][_0xea66('0x82')](/"/g,'\x27'));switch(_0x21a814){case _0xea66('0x47'):var _0x3b3419=moment(_0x409ccf,_0xea66('0xf'),!![]);if(_0x3b3419[_0xea66('0x83')]()){_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}else{_0x1b3b85['push'](_0xea66('0x84'));}break;case _0xea66('0x38'):var _0x265f43=parseInt(_0x409ccf);_0x409ccf=_[_0xea66('0x85')](_0x265f43)||_0x265f43<0x0||_0x265f43>0x4?_0x19bca2?0x3:0x2:_0x265f43;_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');break;case _0xea66('0x39'):var _0x183ce1=parseInt(_0x409ccf);if(_[_0xea66('0x86')](_0x183ce1)&&_[_0xea66('0x75')](_0x28e283,_0x183ce1)){_0x267858[_0xea66('0x1d')]('\x22'+_0x183ce1+'\x22');}else{_0x1b3b85[_0xea66('0x1d')](_0xea66('0x87'));}break;case _0xea66('0x88'):if(isEmail(_0x409ccf)){_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}else{_0x1b3b85[_0xea66('0x1d')](_0xea66('0x89'));}break;case'dateOfBirth':var _0x2d6ad6=moment(_0x409ccf,'YYYY-MM-DD',!![]);if(_0x2d6ad6[_0xea66('0x83')]()){_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}else{_0x1b3b85[_0xea66('0x1d')](_0xea66('0x8a'));}break;case'dialTimezone':var _0x1d0c81=shared['timezones'];var _0xcc32b6=_0x1d0c81[_0x409ccf];if(!_[_0xea66('0x6a')](_0xcc32b6)){var _0x26b786=_0xcc32b6[_0xea66('0x6b')];_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');_0x267858['push']('\x22'+_0x26b786+'\x22');}break;default:_0x267858[_0xea66('0x1d')]('\x22'+_0x409ccf+'\x22');}}else{switch(_0x21a814){case _0xea66('0x8b'):case'phone':_0x1b3b85[_0xea66('0x1d')](_0x21a814+_0xea66('0x8c'));break;default:_0x267858['push']('\x22\x22');}}}}else{var _0xd03e3e='';if(!_[_0xea66('0x6a')](_0x11f9d3)){if(!_0x256622['hasOwnProperty'](_0x11f9d3['id'])){if(!_[_0xea66('0x6a')](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]])){var _0x409ccf=_['trim'](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x21a814]][_0xea66('0x82')](/"/g,'\x27'));var _0x43b489=phoneDescriptions[_0xea66('0x7f')](_0x3be70f=>_0x3be70f['itemTypeId']===_0x11f9d3['id']);if(!_[_0xea66('0x6a')](_0x43b489)){var _0x3cd8ab=_[_0xea66('0x81')](_0x1f776b[_0xea66('0x7d')][_0x5090b6][_0x3ae486[_0x43b489['description']]]['replace'](/"/g,'\x27'));if(!_[_0xea66('0x6a')](_0x3cd8ab))_0x409ccf=_0x409ccf+'§'+_0x3cd8ab;}if(_0xd03e3e=='')_0xd03e3e=_0x409ccf;else _0xd03e3e+='|'+_0x409ccf;}_0x461164[_0xea66('0x1d')](_0x11f9d3['id']+':'+_0xd03e3e);_0x256622[_0x11f9d3['id']]=0x1;}}}}if(hasAdditionalPhones){_0x267858[_0xea66('0x1d')]('\x22'+_0x461164[_0xea66('0x15')](';')+'\x22');}if(_0x1b3b85[_0xea66('0x20')]){handleError(_0x1f776b['data'][_0x5090b6],{'code':_0xea66('0x8d'),'message':_0x1b3b85[_0xea66('0x15')]()});}else{fs[_0xea66('0x8e')](_0x3e9af5,_0x267858['join']()+'\x0a');}_0x267858=[];}if(!(stats[_0xea66('0x7e')]%0xc8)){socket[_0xea66('0x8f')](_0xea66('0x90')+_0x3c70da,stats);stats['errors']=[];}}if(stopped){logger[_0xea66('0x5b')]('Abort\x20parser');_0x487d4c[_0xea66('0x91')]();}}catch(_0x22cef0){handleError(_0x1f776b['data'][_0x5090b6],{'code':_0xea66('0x92'),'message':_0x22cef0['message']});logger[_0xea66('0x57')](_0xea66('0x93'),_0x22cef0[_0xea66('0x58')]);}},'complete':function(){try{var _0x4d0c22=[];var _0x2965b5=[];var _0x2155d0=_0xea66('0x3c');if(_0x3e0f5f[_0xea66('0x94')]&&_0x3e0f5f['duplicates']['length']){_0x2155d0=_0xea66('0x95')+_0x3c70da;_0x4d0c22[_0xea66('0x1d')]('CREATE\x20TABLE\x20'+_0x2155d0+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xea66('0x96')+_0x3c70da;tmp_voice_queues=_0xea66('0x97')+_0x3c70da;_0x2965b5[_0xea66('0x1d')]('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x2965b5[_0xea66('0x1d')](_0xea66('0x98')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xea66('0x99')](_0x2965b5,handleTZQuery)[_0xea66('0x1c')](function(_0x38e8b6){updateTzCampaigns(_0x3e0f5f[_0xea66('0x35')])[_0xea66('0x1c')](function(_0x266ed0){updateTzVoiceQueues(_0x3e0f5f[_0xea66('0x35')])[_0xea66('0x1c')](function(_0x7af8c3){if(hasTZ)_0x30a66a=_0x30a66a[_0xea66('0x82')](_0xea66('0x6d'),'dialTimezone,utcOffset');var _0x1f1f07=util[_0xea66('0xe')](_0xea66('0x9a'),_0x3e9af5,_0x2155d0,_0x30a66a,_0x3e0f5f[_0xea66('0x35')],_0x3e0f5f['CompanyId']||null,NOW,NOW);if(_[_0xea66('0x6a')](_0x3ae486[_0xea66('0x47')])){_0x1f1f07+=_0xea66('0x9b');}_0x4d0c22[_0xea66('0x1d')](_0x1f1f07);if(_0x3e0f5f['duplicates']&&_0x3e0f5f[_0xea66('0x94')][_0xea66('0x20')]){_0x4d0c22['push'](insertCmContact(_0x3e0f5f[_0xea66('0x35')],_0x2155d0,_0x3e0f5f[_0xea66('0x94')],_0x3ae486));_0x4d0c22[_0xea66('0x1d')](_0xea66('0x9c')+_0x2155d0+';');}BPromise[_0xea66('0x99')](_0x4d0c22,handleQuery)['then'](function(_0x3bc989){BPromise[_0xea66('0x64')]([handleAdditionalPhones()])[_0xea66('0x1c')](function(){_0x4d0c22=[];for(var _0x4a9a53=0x0;_0x4a9a53\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','query','length','isNil'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1226,0x1c1));var _0x6122=function(_0x22dc8b,_0x556b84){_0x22dc8b=_0x22dc8b-0x0;var _0x5ba336=_0x1226[_0x22dc8b];return _0x5ba336;};'use strict';var fs=require('fs');var path=require(_0x6122('0x0'));var _=require(_0x6122('0x1'));var Papa=require(_0x6122('0x2'));var util=require(_0x6122('0x3'));var BPromise=require(_0x6122('0x4'));var moment=require(_0x6122('0x5'));var squel=require(_0x6122('0x6'));var Redis=require(_0x6122('0x7'));var db=require(_0x6122('0x8'))['db'];var config=require('../../../config/environment');var logger=require(_0x6122('0x9'))(_0x6122('0xa'));config[_0x6122('0xb')]=_[_0x6122('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6122('0xd'))(new Redis(config[_0x6122('0xb')]));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()[_0x6122('0xe')](_0x6122('0xf'));var tempTableName=_0x6122('0x10')+moment()[_0x6122('0xe')](_0x6122('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x7f19a6){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'](_0x7f19a6);}function selectNotIn(_0x3dcea8,_0x414391,_0x4f4250,_0x190d8e,_0x44c993){return squel['select']()[_0x6122('0x12')](_0x6122('0x13'))[_0x6122('0x14')](_0x190d8e)[_0x6122('0x15')](_0x414391,null,_0x414391+_0x6122('0x16')+_0x190d8e+'.'+_0x4f4250)[_0x6122('0x17')](_0x190d8e+'.'+_0x4f4250+'\x20=\x20'+_0x3dcea8+'.'+_0x4f4250)[_0x6122('0x17')](_0x414391+_0x6122('0x18')+_0x44c993[_0x6122('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x320b46,_0x223d20){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x6122('0x19')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x7dd3fe){if(_0x7dd3fe!==null){var _0x216076=[];for(var _0x1f765a=0x0;_0x1f765a<_0x7dd3fe[_0x6122('0x1a')];_0x1f765a++){var _0x9958e5=_0x7dd3fe[_0x1f765a];if(!_[_0x6122('0x1b')](_0x9958e5[_0x6122('0x13')])){if(!_[_0x6122('0x1b')](_0x9958e5['AdditionalPhones']))_0x216076[_0x6122('0x1c')](insertAdditionalPhones(_0x9958e5));promisesContact[_0x6122('0x1c')]({'contact':_0x9958e5});}}}Promise['all'](_0x216076)[_0x6122('0x1d')](function(){_0x320b46({'val':0x1});});})[_0x6122('0x1e')](function(_0xcbf31a){logger[_0x6122('0x1f')](_0xcbf31a[_0x6122('0x20')]);});});}function insertAdditionalPhones(_0x5d7b08){return new Promise(function(_0x3f6cd2,_0x5bd8ff){var _0x41e3f2=_0x5d7b08[_0x6122('0x21')];if(_[_0x6122('0x1b')](_0x41e3f2))_0x5bd8ff({'val':0x0});else{var _0x352355=_0x41e3f2[_0x6122('0x22')](';');var _0x194357=[];orderBy=0x0;for(var _0x2980e8=0x0;_0x2980e8<_0x352355[_0x6122('0x1a')];_0x2980e8++){_0x194357['push'](splitAdditionalPhone(_0x5d7b08['id'],_0x352355[_0x2980e8]));}Promise[_0x6122('0x23')](_0x194357)['then'](function(){_0x3f6cd2({'val':_0x352355[_0x6122('0x1a')]});});}});}function splitAdditionalPhone(_0x3a3efa,_0xb36f06){return new Promise(function(_0x5cfa37,_0x4ea2fb){var _0x5a9b4d=_0xb36f06[_0x6122('0x22')](':');var _0x5a26ac=_0x5a9b4d[0x0];var _0x26c417=_0x5a9b4d[0x1];if(_0x26c417!==''){var _0x1e4ef2=_0x26c417[_0x6122('0x22')]('|');var _0x489e06=[];for(var _0x519f63=0x0;_0x519f63<_0x1e4ef2[_0x6122('0x1a')];_0x519f63++){if(_0x1e4ef2[_0x519f63]!==''){var _0x472411=_['filter'](promisesAdditionalPhones,{'contactId':_0x3a3efa,'phone':_0x1e4ef2[_0x519f63]});if(_0x472411['length']==0x0){orderBy++;promisesAdditionalPhones[_0x6122('0x1c')]({'contactId':_0x3a3efa,'contactTypeId':_0x5a26ac,'phone':_0x1e4ef2[_0x519f63],'orderBy':orderBy});}}}_0x5cfa37({'ok':0x1});}else _0x5cfa37({'res':0x0});});}function createAdditionalPhone(_0x5ee15a,_0x19487c,_0x549c0e,_0x5ee825){var _0x655ae0='';var _0x395796='';var _0x3e9e75=_0x549c0e[_0x6122('0x22')]('§');_0x655ae0=_0x3e9e75[0x0];if(_0x3e9e75[_0x6122('0x1a')]==0x2)_0x395796=_0x3e9e75[0x1];return new Promise(function(_0x1dced4,_0x45b1df){return db[_0x6122('0x24')][_0x6122('0x25')]({'where':{'CmContactId':_0x5ee15a,'item':_0x655ae0}})['then'](function(_0x5ba87e){if(_0x5ba87e){return db[_0x6122('0x24')][_0x6122('0x26')]({'ItemTypeId':_0x19487c,'description':_0x395796,'OrderBy':_0x5ee825},{'where':{'CmContactId':_0x5ee15a,'item':_0x655ae0}})[_0x6122('0x1d')](function(_0x1795f4){_0x1dced4({'res':_0x6122('0x27')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x5ee15a,'item':_0x655ae0,'ItemTypeId':_0x19487c,'description':_0x395796,'OrderBy':_0x5ee825,'ItemClass':_0x6122('0x28')})[_0x6122('0x1d')](function(_0x178020){_0x1dced4({'res':_0x6122('0x29')});});}});});}function updateContact(_0xb00fdb){return new Promise(function(_0x213e0e,_0x4e6c5e){var _0x4ed9c2=_0xb00fdb['id'];delete _0xb00fdb['id'];return db[_0x6122('0x2a')][_0x6122('0x26')](_0xb00fdb,{'where':{'id':_0x4ed9c2}})[_0x6122('0x1d')](function(_0x17a691){updatedRows+=0x1;return db['CmHopper'][_0x6122('0x26')]({'phone':_0xb00fdb[_0x6122('0x13')]},{'where':{'ContactId':_0x4ed9c2}})[_0x6122('0x1d')](function(_0x1f9f7b){_0x213e0e({'ret':'OK'});});});});}function insertCmHopper(_0xd92b45,_0x49c8be,_0x3cd38e,_0x3e476b,_0x13ad69){var _0x2ef3bf=[_0x6122('0x2b'),_0x6122('0x2c'),_0x6122('0x2d'),_0x6122('0x2e'),_0x49c8be+'.'+_0x3e476b,_0x6122('0x2f'),'cm_contacts.updatedAt',_0x6122('0x30'),_0x6122('0x31'),'\x22'+_0x13ad69+'\x22'];return squel[_0x6122('0x32')]()[_0x6122('0x33')](_0x6122('0x34'))['fromQuery']([_0x6122('0x13'),_0x6122('0x35'),_0x6122('0x36'),'ListId',_0x3e476b,_0x6122('0x37'),_0x6122('0x38'),_0x6122('0x39'),'UserId','recallme'],squel[_0x6122('0x3a')]()['fields'](_0x2ef3bf)[_0x6122('0x14')](_0x49c8be)[_0x6122('0x15')]('cm_contacts',null,_0x6122('0x3b')+_0x49c8be+'.CmListId')['join'](_0x3cd38e,null,_0x3cd38e+_0x6122('0x16')+_0x49c8be+'.'+_0x3e476b)['where'](_0x49c8be+_0x6122('0x3c'),_0xd92b45)[_0x6122('0x17')](_0x6122('0x3d'),NOW)['where'](_0x6122('0x3e'),selectNotIn(_0x49c8be,_0x3cd38e,_0x3e476b,'cm_hopper',[_0x6122('0x3f'),'\x22onlyIfOpen\x22']))[_0x6122('0x17')](_0x6122('0x3e'),selectNotIn(_0x49c8be,_0x3cd38e,_0x3e476b,_0x6122('0x34'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x22e97d,_0x4e2508,_0x8b1286,_0x5463e4){var _0x1c2086=[_0x6122('0x2b'),_0x6122('0x2d'),_0x6122('0x2e'),_0x4e2508+'.'+_0x5463e4,_0x6122('0x2f'),_0x6122('0x40')];return squel['insert']()[_0x6122('0x33')](_0x6122('0x41'))['fromQuery']([_0x6122('0x13'),_0x6122('0x36'),_0x6122('0x42'),_0x5463e4,_0x6122('0x37'),'updatedAt'],squel[_0x6122('0x3a')]()[_0x6122('0x43')](_0x1c2086)[_0x6122('0x14')](_0x4e2508)['join'](_0x6122('0x44'),null,'cm_contacts.ListId\x20=\x20'+_0x4e2508+_0x6122('0x45'))['join'](_0x8b1286,null,_0x8b1286+_0x6122('0x16')+_0x4e2508+'.'+_0x5463e4)['where'](_0x4e2508+_0x6122('0x3c'),_0x22e97d)[_0x6122('0x17')](_0x6122('0x3d'),NOW)['where'](_0x6122('0x3e'),squel[_0x6122('0x3a')]()['field']('phone')[_0x6122('0x14')](_0x6122('0x41'))['where'](_0x6122('0x46'),_0x22e97d)[_0x6122('0x17')](_0x5463e4+_0x6122('0x47'),_0x4e2508+'.'+_0x5463e4)))[_0x6122('0x48')]();}function insertCmHopperAdditionalPhones(_0x8ca611){var _0x1842da=[_0x6122('0x49'),_0x6122('0x4a'),_0x6122('0x4b'),_0x6122('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0x6122('0x32')]()['into']('cm_hopper_additional_phones')[_0x6122('0x4d')]([_0x6122('0x4e'),_0x6122('0x13'),'OrderBy',_0x6122('0x37'),_0x6122('0x38')],squel[_0x6122('0x3a')]()[_0x6122('0x43')](_0x1842da)[_0x6122('0x14')]('cm_hopper')[_0x6122('0x15')](_0x6122('0x44'),null,_0x6122('0x4f'))['join'](_0x6122('0x50'),null,_0x6122('0x51'))[_0x6122('0x17')]('cm_hopper.ListId\x20=\x20?',_0x8ca611)[_0x6122('0x17')](_0x6122('0x3d'),NOW))['toString']();}function insertCmContact(_0x371b74,_0x367bda,_0x59dece,_0x57416d){var _0x56984b=_['concat'](_[_0x6122('0x52')](_0x57416d),['ListId','CompanyId','createdAt',_0x6122('0x38')]);return squel[_0x6122('0x32')]()[_0x6122('0x33')](_0x6122('0x44'))[_0x6122('0x4d')](_0x56984b,squel['select']()['fields'](_0x56984b)[_0x6122('0x14')](_0x367bda)[_0x6122('0x17')]('('+_0x59dece[_0x6122('0x15')](',')+_0x6122('0x53'),squel[_0x6122('0x3a')]()['fields'](_0x59dece)[_0x6122('0x14')]('cm_contacts')['where']('ListId\x20=\x20?',_0x371b74))[_0x6122('0x17')](_0x6122('0x54'),squel[_0x6122('0x3a')]()[_0x6122('0x12')](_0x6122('0x55'),_0x6122('0x56'))['from'](_0x367bda)['group'](_0x59dece[_0x6122('0x15')](','))))['toString']();}function handleStop(){logger[_0x6122('0x57')](_0x6122('0x58'));stopped=!![];}function handleUncaughtException(_0x22c055){logger[_0x6122('0x1f')](_0x22c055[_0x6122('0x20')]);process[_0x6122('0x59')](0x1);}function handleError(_0x84f06e,_0x436694){stats[_0x6122('0x5a')][_0x6122('0x1c')]({'name':_0x436694[_0x6122('0x5b')],'message':_0x436694[_0x6122('0x20')],'row':_0x84f06e});}function handleQuery(_0x45c871){logger[_0x6122('0x57')](_0x45c871);return db[_0x6122('0x5c')][_0x6122('0x19')](_0x45c871)[_0x6122('0x5d')](function(_0x5d05f7){results[_0x6122('0x1c')](_0x5d05f7);})[_0x6122('0x1e')](function(_0x393282){logger['error'](_0x393282['message']);});}function main(_0x1bee71,_0x80ed8b,_0x244168,_0x16bff7){logger[_0x6122('0x57')](_0x6122('0x5e'),_0x1bee71,JSON['stringify'](_0x80ed8b));process[_0x6122('0x5f')](_0x6122('0x60'));var _0x8f9318=_0x80ed8b[_0x6122('0x61')];var _0x1799ae=_[_0x6122('0x62')](_0x8f9318);var _0x45427c=_0x80ed8b['socket_timestamp'];var _0x2656c0=path['join'](config[_0x6122('0x63')],_0x6122('0x64'),_0x45427c+_0x6122('0x65'));logger[_0x6122('0x57')](_0x6122('0x66'),_0x80ed8b);db['ContactItemType'][_0x6122('0x67')]({'raw':!![],'attributes':['id',_0x6122('0x68')]})[_0x6122('0x1d')](function(_0x6354ee){for(var _0x5a58f8=0x0;_0x5a58f8<_0x6354ee[_0x6122('0x1a')];_0x5a58f8++){if(_0x6354ee[_0x5a58f8]['name']in _0x8f9318){contactItemTypes[_0x6122('0x1c')](_0x6354ee[_0x5a58f8]);delete _0x1799ae[_0x6354ee[_0x5a58f8][_0x6122('0x68')]];hasAdditionalPhones=!![];}for(var _0x1ed6ee in _0x8f9318){if(_0x6354ee[_0x5a58f8][_0x6122('0x68')]+_0x6122('0x69')===_0x1ed6ee){phoneDescriptions['push']({'itemTypeId':_0x6354ee[_0x5a58f8]['id'],'description':_0x1ed6ee});delete _0x1799ae[_0x1ed6ee];}}}if(hasAdditionalPhones)_0x1799ae[_0x6122('0x21')]='';var _0x11ecd5=_[_0x6122('0x52')](_0x1799ae)['join']();logger[_0x6122('0x57')](_0x6122('0x6a'),_0x11ecd5);fs[_0x6122('0x6b')](_0x2656c0,_0x11ecd5+'\x0a');Papa['parse'](fs[_0x6122('0x6c')](_0x1bee71),{'header':!![],'skipEmptyLines':!![],'step':function(_0x71a8f2,_0x45fd5c){try{for(var _0x1b5b81=0x0,_0x459a3b=[];_0x1b5b81<_0x71a8f2[_0x6122('0x6d')][_0x6122('0x1a')];_0x1b5b81++){stats['rows']+=0x1;if(_0x71a8f2['errors'][_0x1b5b81]){handleError(_0x71a8f2['data'][_0x1b5b81],_0x71a8f2[_0x6122('0x5a')][_0x1b5b81]);}else{var _0x5e101e=[];var _0x602080=[];var _0x471115={};for(var _0x1ff5ee in _0x8f9318){let _0x15f641=contactItemTypes[_0x6122('0x6e')](_0xa92bf=>_0xa92bf[_0x6122('0x68')]===_0x1ff5ee);let _0x3ab9c3=contactItemTypes[_0x6122('0x6e')](_0x297cfb=>_0x297cfb[_0x6122('0x68')]+'_description'===_0x1ff5ee);if(_[_0x6122('0x1b')](_0x15f641)&&_['isNil'](_0x3ab9c3)){if(_0x8f9318[_0x6122('0x6f')](_0x1ff5ee)){if(_0x71a8f2[_0x6122('0x6d')][_0x1b5b81][_0x8f9318[_0x1ff5ee]]){var _0x1d6ea2=_[_0x6122('0x70')](_0x71a8f2['data'][_0x1b5b81][_0x8f9318[_0x1ff5ee]][_0x6122('0x71')](/"/g,'\x27'));switch(_0x1ff5ee){case _0x6122('0x35'):var _0x490ec9=moment(_0x1d6ea2,_0x6122('0xf'),!![]);if(_0x490ec9[_0x6122('0x72')]()){_0x459a3b['push']('\x22'+_0x1d6ea2+'\x22');}else{_0x5e101e[_0x6122('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x409173=parseInt(_0x1d6ea2);_0x1d6ea2=_[_0x6122('0x73')](_0x409173)||_0x409173<0x0||_0x409173>0x4?_0x16bff7?0x3:0x2:_0x409173;_0x459a3b['push']('\x22'+_0x1d6ea2+'\x22');break;case'UserId':var _0x13e6c0=parseInt(_0x1d6ea2);if(_[_0x6122('0x74')](_0x13e6c0)&&_[_0x6122('0x75')](_0x244168,_0x13e6c0)){_0x459a3b[_0x6122('0x1c')]('\x22'+_0x13e6c0+'\x22');}else{_0x5e101e[_0x6122('0x1c')](_0x6122('0x76'));}break;case _0x6122('0x77'):if(isEmail(_0x1d6ea2)){_0x459a3b['push']('\x22'+_0x1d6ea2+'\x22');}else{_0x5e101e[_0x6122('0x1c')](_0x6122('0x78'));}break;case _0x6122('0x79'):var _0x3401af=moment(_0x1d6ea2,'YYYY-MM-DD',!![]);if(_0x3401af[_0x6122('0x72')]()){_0x459a3b[_0x6122('0x1c')]('\x22'+_0x1d6ea2+'\x22');}else{_0x5e101e[_0x6122('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x459a3b[_0x6122('0x1c')]('\x22'+_0x1d6ea2+'\x22');}}else{switch(_0x1ff5ee){case _0x6122('0x7a'):case _0x6122('0x13'):_0x5e101e[_0x6122('0x1c')](_0x1ff5ee+_0x6122('0x7b'));break;default:_0x459a3b[_0x6122('0x1c')]('\x22\x22');}}}}else{var _0xbd71c5='';if(!_[_0x6122('0x1b')](_0x15f641)){if(!_0x471115[_0x6122('0x6f')](_0x15f641['id'])){for(var _0x50dd45=0x0;_0x50dd45<_0x8f9318[_0x1ff5ee][_0x6122('0x1a')];_0x50dd45++){var _0x1d6ea2=_[_0x6122('0x70')](_0x71a8f2['data'][_0x1b5b81][_0x8f9318[_0x1ff5ee][_0x50dd45]][_0x6122('0x71')](/"/g,'\x27'));var _0x2de435=phoneDescriptions[_0x6122('0x6e')](_0x3afcf3=>_0x3afcf3[_0x6122('0x7c')]===_0x15f641['id']);if(!_[_0x6122('0x1b')](_0x2de435)){var _0x255221=_[_0x6122('0x70')](_0x71a8f2[_0x6122('0x6d')][_0x1b5b81][_0x8f9318[_0x2de435[_0x6122('0x7d')]][0x0]][_0x6122('0x71')](/"/g,'\x27'));if(!_[_0x6122('0x1b')](_0x255221))_0x1d6ea2=_0x1d6ea2+'§'+_0x255221;}if(_0xbd71c5=='')_0xbd71c5=_0x1d6ea2;else _0xbd71c5+='|'+_0x1d6ea2;}_0x602080['push'](_0x15f641['id']+':'+_0xbd71c5);_0x471115[_0x15f641['id']]=0x1;}}}}if(hasAdditionalPhones){_0x459a3b[_0x6122('0x1c')]('\x22'+_0x602080[_0x6122('0x15')](';')+'\x22');}if(_0x5e101e[_0x6122('0x1a')]){handleError(_0x71a8f2[_0x6122('0x6d')][_0x1b5b81],{'code':_0x6122('0x7e'),'message':_0x5e101e[_0x6122('0x15')]()});}else{fs[_0x6122('0x7f')](_0x2656c0,_0x459a3b[_0x6122('0x15')]()+'\x0a');}_0x459a3b=[];}if(!(stats[_0x6122('0x80')]%0xc8)){socket[_0x6122('0x81')](_0x6122('0x82')+_0x45427c,stats);stats[_0x6122('0x5a')]=[];}}if(stopped){logger['info'](_0x6122('0x83'));_0x45fd5c[_0x6122('0x84')]();}}catch(_0x836092){handleError(_0x71a8f2[_0x6122('0x6d')][_0x1b5b81],{'code':_0x6122('0x85'),'message':_0x836092[_0x6122('0x20')]});logger[_0x6122('0x1f')](_0x6122('0x86'),_0x836092['message']);}},'complete':function(){try{var _0x5b6a07=[];var _0xda3a68=tempTableName;_0x5b6a07[_0x6122('0x1c')](_0x6122('0x87')+_0xda3a68+'\x20LIKE\x20cm_contacts;');logger['info']('CIS\x20len',contactItemTypes[_0x6122('0x1a')]);var _0x7d930c=util[_0x6122('0xe')](_0x6122('0x88'),_0x2656c0,_0xda3a68,_0x11ecd5,_0x80ed8b[_0x6122('0x42')],_0x80ed8b[_0x6122('0x89')]||null,NOW,NOW);if(_['isNil'](_0x8f9318[_0x6122('0x35')])){_0x7d930c+=',\x20scheduledAt\x20=\x20NOW()';}_0x5b6a07[_0x6122('0x1c')](_0x7d930c);BPromise[_0x6122('0x8a')](_0x5b6a07,handleQuery)[_0x6122('0x1d')](function(_0x5228a7){BPromise[_0x6122('0x23')]([handleAdditionalPhones()])[_0x6122('0x1d')](function(){_0x5b6a07=[];for(var _0x5b9c85=0x0;_0x5b9c85\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','SIGINT','uncaughtException','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','then','catch','error','message','split','push','all','update','updated','CmContactHasItem','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','cm_hopper_black'];(function(_0x5c7f24,_0xadf13){var _0x2ca339=function(_0x3d762d){while(--_0x3d762d){_0x5c7f24['push'](_0x5c7f24['shift']());}};_0x2ca339(++_0xadf13);}(_0x56bd,0xe9));var _0xd56b=function(_0x2aad0f,_0x1344fd){_0x2aad0f=_0x2aad0f-0x0;var _0x9d56f9=_0x56bd[_0x2aad0f];return _0x9d56f9;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xd56b('0x0'));var Papa=require(_0xd56b('0x1'));var util=require(_0xd56b('0x2'));var BPromise=require('bluebird');var moment=require(_0xd56b('0x3'));var squel=require(_0xd56b('0x4'));var Redis=require(_0xd56b('0x5'));var db=require(_0xd56b('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0xd56b('0x7'))(_0xd56b('0x8'));config[_0xd56b('0x9')]=_[_0xd56b('0xa')](config[_0xd56b('0x9')],{'host':_0xd56b('0xb'),'port':0x18eb});var socket=require(_0xd56b('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xd56b('0xd')](_0xd56b('0xe'));var tempTableName=_0xd56b('0xf')+moment()[_0xd56b('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5b5abd){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xd56b('0x10')](_0x5b5abd);}function selectNotIn(_0x3271bc,_0x5a8959,_0x3364af,_0x1e6fcd,_0x3bfaf9){return squel[_0xd56b('0x11')]()[_0xd56b('0x12')](_0xd56b('0x13'))[_0xd56b('0x14')](_0x1e6fcd)[_0xd56b('0x15')](_0x5a8959,null,_0x5a8959+_0xd56b('0x16')+_0x1e6fcd+'.'+_0x3364af)[_0xd56b('0x17')](_0x1e6fcd+'.'+_0x3364af+_0xd56b('0x18')+_0x3271bc+'.'+_0x3364af)[_0xd56b('0x17')](_0x5a8959+_0xd56b('0x19')+_0x3bfaf9[_0xd56b('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x37f528,_0x5a6eb6){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd56b('0x1a')]['query'](_0xd56b('0x1b')+tempTableName)[_0xd56b('0x1c')](function(_0x3f8775){if(_0x3f8775!==null){var _0x1dbdc6=[];for(var _0x209442=0x0;_0x209442<_0x3f8775[_0xd56b('0x1d')];_0x209442++){var _0x667877=_0x3f8775[_0x209442];if(!_[_0xd56b('0x1e')](_0x667877[_0xd56b('0x13')])){if(!_[_0xd56b('0x1e')](_0x667877[_0xd56b('0x1f')]))_0x1dbdc6['push'](insertAdditionalPhones(_0x667877));promisesContact['push']({'contact':_0x667877});}}}Promise['all'](_0x1dbdc6)[_0xd56b('0x20')](function(){_0x37f528({'val':0x1});});})[_0xd56b('0x21')](function(_0xf32afd){logger[_0xd56b('0x22')](_0xf32afd[_0xd56b('0x23')]);});});}function insertAdditionalPhones(_0x106aa4){return new Promise(function(_0x477212,_0x547a7a){var _0x2335cd=_0x106aa4[_0xd56b('0x1f')];if(_[_0xd56b('0x1e')](_0x2335cd))_0x547a7a({'val':0x0});else{var _0x13140b=_0x2335cd[_0xd56b('0x24')](';');var _0x32160b=[];orderBy=0x0;for(var _0x5498b0=0x0;_0x5498b0<_0x13140b['length'];_0x5498b0++){_0x32160b[_0xd56b('0x25')](splitAdditionalPhone(_0x106aa4['id'],_0x13140b[_0x5498b0]));}Promise[_0xd56b('0x26')](_0x32160b)['then'](function(){_0x477212({'val':_0x13140b[_0xd56b('0x1d')]});});}});}function splitAdditionalPhone(_0x5c9cfe,_0xdaf42a){return new Promise(function(_0x543aaf,_0xc9027d){var _0x30e936=_0xdaf42a[_0xd56b('0x24')](':');var _0x5ab429=_0x30e936[0x0];var _0x42e907=_0x30e936[0x1];if(_0x42e907!==''){var _0x1a2f0c=_0x42e907[_0xd56b('0x24')]('|');var _0x6980a8=[];for(var _0x34166c=0x0;_0x34166c<_0x1a2f0c[_0xd56b('0x1d')];_0x34166c++){if(_0x1a2f0c[_0x34166c]!==''){var _0x3c9730=_['filter'](promisesAdditionalPhones,{'contactId':_0x5c9cfe,'phone':_0x1a2f0c[_0x34166c]});if(_0x3c9730['length']==0x0){orderBy++;promisesAdditionalPhones[_0xd56b('0x25')]({'contactId':_0x5c9cfe,'contactTypeId':_0x5ab429,'phone':_0x1a2f0c[_0x34166c],'orderBy':orderBy});}}}_0x543aaf({'ok':0x1});}else _0x543aaf({'res':0x0});});}function createAdditionalPhone(_0x4393a9,_0x241e95,_0x171ca5,_0x45a45d){var _0x3c76d6='';var _0x1cbb85='';var _0x18dece=_0x171ca5[_0xd56b('0x24')]('§');_0x3c76d6=_0x18dece[0x0];if(_0x18dece[_0xd56b('0x1d')]==0x2)_0x1cbb85=_0x18dece[0x1];return new Promise(function(_0x1446da,_0x8737b4){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x4393a9,'item':_0x3c76d6}})[_0xd56b('0x20')](function(_0x4d54c4){if(_0x4d54c4){return db['CmContactHasItem'][_0xd56b('0x27')]({'ItemTypeId':_0x241e95,'description':_0x1cbb85,'OrderBy':_0x45a45d},{'where':{'CmContactId':_0x4393a9,'item':_0x3c76d6}})[_0xd56b('0x20')](function(_0x193c7f){_0x1446da({'res':_0xd56b('0x28')});});}else{return db[_0xd56b('0x29')][_0xd56b('0x2a')]({'CmContactId':_0x4393a9,'item':_0x3c76d6,'ItemTypeId':_0x241e95,'description':_0x1cbb85,'OrderBy':_0x45a45d,'ItemClass':_0xd56b('0x2b')})[_0xd56b('0x20')](function(_0x53f4d3){_0x1446da({'res':_0xd56b('0x2c')});});}});});}function updateContact(_0x519638){return new Promise(function(_0x1b30aa,_0x333102){var _0x38c3a4=_0x519638['id'];delete _0x519638['id'];return db[_0xd56b('0x2d')][_0xd56b('0x27')](_0x519638,{'where':{'id':_0x38c3a4}})['then'](function(_0xa84b74){updatedRows+=0x1;return db[_0xd56b('0x2e')]['update']({'phone':_0x519638[_0xd56b('0x13')]},{'where':{'ContactId':_0x38c3a4}})[_0xd56b('0x20')](function(_0x56be53){_0x1b30aa({'ret':'OK'});});});});}function insertCmHopper(_0x509c35,_0x308ff5,_0x576dff,_0x208b44,_0x2ca2bf){var _0xda8f1a=[_0xd56b('0x2f'),_0xd56b('0x30'),_0xd56b('0x31'),'cm_contacts.ListId',_0x308ff5+'.'+_0x208b44,_0xd56b('0x32'),_0xd56b('0x33'),'cm_contacts.priority',_0xd56b('0x34'),'\x22'+_0x2ca2bf+'\x22'];return squel[_0xd56b('0x35')]()[_0xd56b('0x36')](_0xd56b('0x37'))[_0xd56b('0x38')]([_0xd56b('0x13'),_0xd56b('0x39'),'ContactId',_0xd56b('0x3a'),_0x208b44,_0xd56b('0x3b'),_0xd56b('0x3c'),_0xd56b('0x3d'),'UserId',_0xd56b('0x3e')],squel[_0xd56b('0x11')]()[_0xd56b('0x3f')](_0xda8f1a)[_0xd56b('0x14')](_0x308ff5)[_0xd56b('0x15')](_0xd56b('0x40'),null,_0xd56b('0x41')+_0x308ff5+_0xd56b('0x42'))[_0xd56b('0x15')](_0x576dff,null,_0x576dff+_0xd56b('0x16')+_0x308ff5+'.'+_0x208b44)[_0xd56b('0x17')](_0x308ff5+_0xd56b('0x43'),_0x509c35)[_0xd56b('0x17')](_0xd56b('0x44'),NOW)[_0xd56b('0x17')](_0xd56b('0x45'),selectNotIn(_0x308ff5,_0x576dff,_0x208b44,'cm_hopper',['\x22always\x22',_0xd56b('0x46')]))[_0xd56b('0x17')](_0xd56b('0x45'),selectNotIn(_0x308ff5,_0x576dff,_0x208b44,'cm_hopper',[_0xd56b('0x47')])))['toString']();}function insertCmHopperBlack(_0x265cad,_0x62ba88,_0x189df6,_0x17e74d){var _0x2613e2=['cm_contacts.phone',_0xd56b('0x31'),'cm_contacts.ListId',_0x62ba88+'.'+_0x17e74d,_0xd56b('0x32'),_0xd56b('0x33')];return squel[_0xd56b('0x35')]()[_0xd56b('0x36')](_0xd56b('0x48'))['fromQuery']([_0xd56b('0x13'),_0xd56b('0x49'),'ListId',_0x17e74d,_0xd56b('0x3b'),_0xd56b('0x3c')],squel['select']()[_0xd56b('0x3f')](_0x2613e2)[_0xd56b('0x14')](_0x62ba88)[_0xd56b('0x15')](_0xd56b('0x40'),null,_0xd56b('0x41')+_0x62ba88+_0xd56b('0x42'))[_0xd56b('0x15')](_0x189df6,null,_0x189df6+_0xd56b('0x16')+_0x62ba88+'.'+_0x17e74d)[_0xd56b('0x17')](_0x62ba88+'.CmListId\x20=\x20?',_0x265cad)[_0xd56b('0x17')](_0xd56b('0x44'),NOW)[_0xd56b('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xd56b('0x11')]()[_0xd56b('0x12')]('phone')[_0xd56b('0x14')](_0xd56b('0x48'))[_0xd56b('0x17')](_0xd56b('0x4a'),_0x265cad)[_0xd56b('0x17')](_0x17e74d+_0xd56b('0x4b'),_0x62ba88+'.'+_0x17e74d)))['toString']();}function insertCmHopperAdditionalPhones(_0x3e587a){var _0x2ca2e5=[_0xd56b('0x4c'),'cm_contact_has_items.item',_0xd56b('0x4d'),_0xd56b('0x4e'),_0xd56b('0x4f')];return squel[_0xd56b('0x35')]()[_0xd56b('0x36')]('cm_hopper_additional_phones')[_0xd56b('0x38')]([_0xd56b('0x50'),_0xd56b('0x13'),_0xd56b('0x51'),_0xd56b('0x3b'),_0xd56b('0x3c')],squel['select']()[_0xd56b('0x3f')](_0x2ca2e5)[_0xd56b('0x14')](_0xd56b('0x37'))['join'](_0xd56b('0x40'),null,_0xd56b('0x52'))[_0xd56b('0x15')](_0xd56b('0x53'),null,_0xd56b('0x54'))[_0xd56b('0x17')](_0xd56b('0x55'),_0x3e587a)[_0xd56b('0x17')](_0xd56b('0x44'),NOW))['toString']();}function insertCmContact(_0x1900a9,_0x3552ab,_0x582a8a,_0x1d2810){var _0x95def=_['concat'](_[_0xd56b('0x56')](_0x1d2810),['ListId',_0xd56b('0x57'),_0xd56b('0x3b'),'updatedAt']);return squel[_0xd56b('0x35')]()['into'](_0xd56b('0x40'))['fromQuery'](_0x95def,squel['select']()[_0xd56b('0x3f')](_0x95def)[_0xd56b('0x14')](_0x3552ab)['where']('('+_0x582a8a[_0xd56b('0x15')](',')+_0xd56b('0x58'),squel['select']()[_0xd56b('0x3f')](_0x582a8a)[_0xd56b('0x14')]('cm_contacts')[_0xd56b('0x17')](_0xd56b('0x4a'),_0x1900a9))[_0xd56b('0x17')](_0xd56b('0x59'),squel['select']()[_0xd56b('0x12')]('MIN(id)',_0xd56b('0x5a'))[_0xd56b('0x14')](_0x3552ab)[_0xd56b('0x5b')](_0x582a8a['join'](','))))[_0xd56b('0x5c')]();}function handleStop(){logger[_0xd56b('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x360376){logger[_0xd56b('0x22')](_0x360376['message']);process[_0xd56b('0x5e')](0x1);}function handleError(_0x3cdb6c,_0x2f827e){stats[_0xd56b('0x5f')][_0xd56b('0x25')]({'name':_0x2f827e[_0xd56b('0x60')],'message':_0x2f827e['message'],'row':_0x3cdb6c});}function handleQuery(_0x5a44b9){logger[_0xd56b('0x5d')](_0x5a44b9);return db[_0xd56b('0x1a')][_0xd56b('0x61')](_0x5a44b9)[_0xd56b('0x1c')](function(_0xf4c175){results[_0xd56b('0x25')](_0xf4c175);})[_0xd56b('0x21')](function(_0x2a81f1){logger['error'](_0x2a81f1[_0xd56b('0x23')]);});}function main(_0x2fec4,_0x4ca57e,_0x2c1b7b,_0x3f993f){logger[_0xd56b('0x5d')](_0xd56b('0x62'),_0x2fec4,JSON[_0xd56b('0x63')](_0x4ca57e));process['send'](_0xd56b('0x64'));var _0x298f16=_0x4ca57e[_0xd56b('0x65')];var _0x52849d=_['clone'](_0x298f16);var _0x3c6f0a=_0x4ca57e['socket_timestamp'];var _0x197529=path[_0xd56b('0x15')](config['root'],_0xd56b('0x66'),_0x3c6f0a+'.csv');logger['info'](_0xd56b('0x67'),_0x4ca57e);db[_0xd56b('0x68')][_0xd56b('0x69')]({'raw':!![],'attributes':['id',_0xd56b('0x6a')]})['then'](function(_0x10090b){for(var _0x247a68=0x0;_0x247a68<_0x10090b[_0xd56b('0x1d')];_0x247a68++){if(_0x10090b[_0x247a68]['name']in _0x298f16){contactItemTypes[_0xd56b('0x25')](_0x10090b[_0x247a68]);delete _0x52849d[_0x10090b[_0x247a68][_0xd56b('0x6a')]];hasAdditionalPhones=!![];}for(var _0x10c4d9 in _0x298f16){if(_0x10090b[_0x247a68][_0xd56b('0x6a')]+'_description'===_0x10c4d9){phoneDescriptions[_0xd56b('0x25')]({'itemTypeId':_0x10090b[_0x247a68]['id'],'description':_0x10c4d9});delete _0x52849d[_0x10c4d9];}}}if(hasAdditionalPhones)_0x52849d['AdditionalPhones']='';var _0x1103e6=_[_0xd56b('0x56')](_0x52849d)[_0xd56b('0x15')]();logger['info'](_0xd56b('0x6b'),_0x1103e6);fs[_0xd56b('0x6c')](_0x197529,_0x1103e6+'\x0a');Papa['parse'](fs['createReadStream'](_0x2fec4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x133877,_0x3bd5fe){try{for(var _0x319701=0x0,_0x17740c=[];_0x319701<_0x133877[_0xd56b('0x6d')]['length'];_0x319701++){stats['rows']+=0x1;if(_0x133877[_0xd56b('0x5f')][_0x319701]){handleError(_0x133877[_0xd56b('0x6d')][_0x319701],_0x133877[_0xd56b('0x5f')][_0x319701]);}else{var _0x36d1b8=[];var _0x5e6edc=[];var _0x5954b1={};for(var _0x350cf5 in _0x298f16){let _0x250582=contactItemTypes[_0xd56b('0x6e')](_0x36c67b=>_0x36c67b[_0xd56b('0x6a')]===_0x350cf5);let _0x47a6ee=contactItemTypes[_0xd56b('0x6e')](_0x492d01=>_0x492d01[_0xd56b('0x6a')]+'_description'===_0x350cf5);if(_[_0xd56b('0x1e')](_0x250582)&&_['isNil'](_0x47a6ee)){if(_0x298f16['hasOwnProperty'](_0x350cf5)){if(_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x350cf5]]){var _0x3e9b66=_[_0xd56b('0x6f')](_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x350cf5]][_0xd56b('0x70')](/"/g,'\x27'));switch(_0x350cf5){case _0xd56b('0x39'):var _0x5e0cb6=moment(_0x3e9b66,_0xd56b('0xe'),!![]);if(_0x5e0cb6['isValid']()){_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}else{_0x36d1b8['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xd56b('0x3d'):var _0x356bbf=parseInt(_0x3e9b66);_0x3e9b66=_[_0xd56b('0x71')](_0x356bbf)||_0x356bbf<0x0||_0x356bbf>0x4?_0x3f993f?0x3:0x2:_0x356bbf;_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');break;case _0xd56b('0x72'):var _0x4cdf98=parseInt(_0x3e9b66);if(_[_0xd56b('0x73')](_0x4cdf98)&&_[_0xd56b('0x74')](_0x2c1b7b,_0x4cdf98)){_0x17740c[_0xd56b('0x25')]('\x22'+_0x4cdf98+'\x22');}else{_0x36d1b8['push'](_0xd56b('0x75'));}break;case'email':if(isEmail(_0x3e9b66)){_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}else{_0x36d1b8[_0xd56b('0x25')](_0xd56b('0x76'));}break;case _0xd56b('0x77'):var _0x18ceb1=moment(_0x3e9b66,_0xd56b('0x78'),!![]);if(_0x18ceb1['isValid']()){_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}else{_0x36d1b8[_0xd56b('0x25')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x17740c[_0xd56b('0x25')]('\x22'+_0x3e9b66+'\x22');}}else{switch(_0x350cf5){case _0xd56b('0x79'):case _0xd56b('0x13'):_0x36d1b8[_0xd56b('0x25')](_0x350cf5+_0xd56b('0x7a'));break;default:_0x17740c[_0xd56b('0x25')]('\x22\x22');}}}}else{var _0x59ba0a='';if(!_['isNil'](_0x250582)){if(!_0x5954b1[_0xd56b('0x7b')](_0x250582['id'])){for(var _0x8d6e3f=0x0;_0x8d6e3f<_0x298f16[_0x350cf5][_0xd56b('0x1d')];_0x8d6e3f++){var _0x3e9b66=_[_0xd56b('0x6f')](_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x350cf5][_0x8d6e3f]]['replace'](/"/g,'\x27'));var _0x55ef03=phoneDescriptions[_0xd56b('0x6e')](_0x4b36c2=>_0x4b36c2['itemTypeId']===_0x250582['id']);if(!_[_0xd56b('0x1e')](_0x55ef03)){var _0x3b9c38=_['trim'](_0x133877[_0xd56b('0x6d')][_0x319701][_0x298f16[_0x55ef03[_0xd56b('0x7c')]][0x0]][_0xd56b('0x70')](/"/g,'\x27'));if(!_[_0xd56b('0x1e')](_0x3b9c38))_0x3e9b66=_0x3e9b66+'§'+_0x3b9c38;}if(_0x59ba0a=='')_0x59ba0a=_0x3e9b66;else _0x59ba0a+='|'+_0x3e9b66;}_0x5e6edc['push'](_0x250582['id']+':'+_0x59ba0a);_0x5954b1[_0x250582['id']]=0x1;}}}}if(hasAdditionalPhones){_0x17740c[_0xd56b('0x25')]('\x22'+_0x5e6edc[_0xd56b('0x15')](';')+'\x22');}if(_0x36d1b8[_0xd56b('0x1d')]){handleError(_0x133877[_0xd56b('0x6d')][_0x319701],{'code':_0xd56b('0x7d'),'message':_0x36d1b8[_0xd56b('0x15')]()});}else{fs[_0xd56b('0x7e')](_0x197529,_0x17740c[_0xd56b('0x15')]()+'\x0a');}_0x17740c=[];}if(!(stats[_0xd56b('0x7f')]%0xc8)){socket[_0xd56b('0x80')](_0xd56b('0x81')+_0x3c6f0a,stats);stats[_0xd56b('0x5f')]=[];}}if(stopped){logger[_0xd56b('0x5d')]('Abort\x20parser');_0x3bd5fe[_0xd56b('0x82')]();}}catch(_0x191ca8){handleError(_0x133877[_0xd56b('0x6d')][_0x319701],{'code':_0xd56b('0x83'),'message':_0x191ca8[_0xd56b('0x23')]});logger[_0xd56b('0x22')]('step',_0x191ca8[_0xd56b('0x23')]);}},'complete':function(){try{var _0x10bc95=[];var _0x3c945c=tempTableName;_0x10bc95[_0xd56b('0x25')](_0xd56b('0x84')+_0x3c945c+'\x20LIKE\x20cm_contacts;');logger[_0xd56b('0x5d')](_0xd56b('0x85'),contactItemTypes[_0xd56b('0x1d')]);var _0x5b2fc8=util[_0xd56b('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x197529,_0x3c945c,_0x1103e6,_0x4ca57e[_0xd56b('0x3a')],_0x4ca57e[_0xd56b('0x57')]||null,NOW,NOW);if(_[_0xd56b('0x1e')](_0x298f16['scheduledat'])){_0x5b2fc8+=_0xd56b('0x86');}_0x10bc95['push'](_0x5b2fc8);BPromise[_0xd56b('0x87')](_0x10bc95,handleQuery)[_0xd56b('0x20')](function(_0x5ea669){BPromise[_0xd56b('0x26')]([handleAdditionalPhones()])[_0xd56b('0x20')](function(){_0x10bc95=[];for(var _0x540e64=0x0;_0x540e64\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closed','i.attach','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','openchannel','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','select','field','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','fax','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','conditions','find','name','buildExpression','type','text','start','value','end','unreadMessages','read','operator','$substring','split','contact','ContactId','tags','and','ids','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','plainBody','compact','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','get','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','sequelize','query','toString','merge','attributes'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x346b,0x171));var _0xb346=function(_0x365046,_0x17d398){_0x365046=_0x365046-0x0;var _0x117548=_0x346b[_0x365046];return _0x117548;};'use strict';var _=require(_0xb346('0x0'));var squel=require(_0xb346('0x1'));var as=require(_0xb346('0x2'));var qs=require(_0xb346('0x3'));var updateInteraction=require(_0xb346('0x4'))[_0xb346('0x5')];var utils=require(_0xb346('0x6'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x16e49b,_0xede466,_0x2e8da3){var _0x359c6e=![];var _0x1b4ec9=utils[_0xb346('0x7')](_0x16e49b);if(_0xede466[_0xb346('0x8')]===_0xb346('0x9')&&!_0x2e8da3[_0xb346('0xa')]&&!_0x2e8da3[_0x1b4ec9]){_0x359c6e=!![];}return _0x359c6e;}function getTagsQuery(){return squel[_0xb346('0xb')]()[_0xb346('0xc')]('id')['field']('name')[_0xb346('0xc')](_0xb346('0xd'))[_0xb346('0xe')](_0xb346('0xf'));}function getUsersQuery(_0xc09366,_0x369f27){var _0x15fe2f=utils[_0xb346('0x10')](_0xc09366);var _0x542715=_0xb346('0x11')+_0xc09366+_0xb346('0x12');var _0x5c375d=squel['select']()[_0xb346('0xc')](_0xb346('0x13'))[_0xb346('0xc')](_0xb346('0x14'))['field']('ui.'+_0x15fe2f)[_0xb346('0xe')](_0x542715,'ui')[_0xb346('0x15')](_0xb346('0x16'),'u',_0xb346('0x17'));if(_0x369f27[_0xb346('0x18')]>0x0){_0x5c375d[_0xb346('0x19')](_0xb346('0x1a')+_0x15fe2f+_0xb346('0x1b'),_[_0xb346('0x1c')](_0x369f27,'id'));}return _0x5c375d;}function getInteractionsQuery(_0x3899bd){var _0x253dd6=utils[_0xb346('0x1d')](_0x3899bd);var _0x517165=utils['getAccountFK'](_0x3899bd);var _0x387d8f=utils[_0xb346('0x10')](_0x3899bd);return squel['select']()[_0xb346('0xe')](_0x253dd6[_0xb346('0x1e')],'i')[_0xb346('0x15')](_0xb346('0x1f'),'c',_0xb346('0x20'))['left_join'](_0xb346('0x16'),'o',_0xb346('0x21'))[_0xb346('0x15')](_0x253dd6[_0xb346('0x22')],'a',_0xb346('0x23')+_0x517165)[_0xb346('0x15')](_0x253dd6[_0xb346('0x24')],'me','me.'+_0x387d8f+_0xb346('0x25'))[_0xb346('0x15')](_0x253dd6[_0xb346('0x26')],'it',_0xb346('0x27')+_0x387d8f+_0xb346('0x25'))[_0xb346('0x15')](_0xb346('0xf'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x5af83c={'body':squel[_0xb346('0x28')](),'contact':squel['expr'](),'default':squel[_0xb346('0x28')](),'fields':squel[_0xb346('0x28')](),'filter':squel[_0xb346('0x28')](),'read':squel[_0xb346('0x28')](),'tags':{'clause':squel[_0xb346('0x28')](),'ids':null},'user':squel[_0xb346('0x28')]()};return _0x5af83c;}function parseTagParameter(_0x1c3f9e){var _0x3e7494=squel[_0xb346('0x28')]();if(_0x1c3f9e){var _0x42953e=utils[_0xb346('0x29')](_0x1c3f9e);_0x42953e[_0xb346('0x2a')](function(_0x37603c){_0x3e7494['or'](_0xb346('0x2b'),'%,'+_0x37603c+',%');});}return _0x3e7494;}function parseReadParameter(_0x5d47c4){var _0x4d29f9='';if(_0x5d47c4){_0x4d29f9='unreadMessages\x20{OPERATOR}\x200';if(_0x5d47c4==='1'){_0x4d29f9=_0x4d29f9[_0xb346('0x2c')](_0xb346('0x2d'),'=');}else{_0x4d29f9=_0x4d29f9['replace'](_0xb346('0x2d'),'>');}}return _0x4d29f9;}function parseSearchFilter(_0x3709fd,_0x2e682e){var _0xe1cd26=squel[_0xb346('0x28')]();if(_0x2e682e){var _0x1a82aa=_0x2e682e[_0xb346('0x2c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1a82aa)){_0xe1cd26['or'](_0xb346('0x2e'),_0x1a82aa+'%');if([_0xb346('0x2f'),_0xb346('0x30')][_0xb346('0x31')](_0x3709fd)){_0xe1cd26['or']('i.phone\x20LIKE\x20?',_0x1a82aa+'%');}else if(_0x3709fd===_0xb346('0x32')){_0xe1cd26['or'](_0xb346('0x33'),_0x1a82aa+'%');}else if(_0x3709fd==='openchannel'){_0xe1cd26['or'](_0xb346('0x34'),_0x1a82aa+'%');}}else if(_0x3709fd===_0xb346('0x35')&&qs[_0xb346('0x36')](_0x1a82aa)){_0xe1cd26['or'](_0xb346('0x37'),_0x1a82aa+'%');}else{if(_0x3709fd==='mail'){_0xe1cd26['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1a82aa,!![]))['or'](_0xb346('0x38'),qs['getFullTextValue'](_0x1a82aa));}else if(_0x3709fd!=='fax'){_0xe1cd26['or'](_0xb346('0x39'),qs[_0xb346('0x3a')](_0x1a82aa));}_0xe1cd26['or'](_0xb346('0x3b'),qs[_0xb346('0x3a')](_0x1a82aa,!![]),null);}}return _0xe1cd26;}function parseAdvancedSearchFilter(_0x2229a7,_0x416e4d){var _0x16e90e=getSqlClauses();var _0x472ea6=as['parseSearch'](_0x2229a7);var _0x321222=_0x472ea6['sqlOperator'];for(var _0x40c761=0x0;_0x40c761<_0x472ea6[_0xb346('0x3c')][_0xb346('0x18')];_0x40c761++){var _0x53d8d8=_0x472ea6['conditions'][_0x40c761];var _0x52657a='i';var _0x1cd462=_[_0xb346('0x3d')](_0x416e4d,[_0xb346('0x3e'),_0x53d8d8[_0xb346('0xc')]]);if(_0x1cd462){var _0x2713ac=as[_0xb346('0x3f')](_0x52657a,_0x1cd462[_0xb346('0x40')],_0x53d8d8);_0x16e90e['default'][_0x321222](_0x2713ac[_0xb346('0x41')],_0x2713ac['value'][_0xb346('0x42')],_0x2713ac[_0xb346('0x43')][_0xb346('0x44')]);}else{switch(_0x53d8d8[_0xb346('0xc')]){case _0xb346('0x45'):var _0x4d0214=parseReadParameter(_0x53d8d8[_0xb346('0x43')]);_0x16e90e[_0xb346('0x46')]['and'](_0x4d0214);break;case'Contact':if(_0x53d8d8[_0xb346('0x47')]===_0xb346('0x48')){if(_0x53d8d8[_0xb346('0x43')][_0xb346('0x49')]('\x20')[_0xb346('0x18')]>0x1){_0x16e90e['contact'][_0x321222](_0xb346('0x3b'),qs['getFullTextValue'](_0x53d8d8[_0xb346('0x43')],!![]),null);}else{var _0x286573='%'+_0x53d8d8[_0xb346('0x43')]+'%';_0x16e90e[_0xb346('0x4a')][_0x321222]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x286573,_0x286573,_0x286573);}}else{_0x1cd462=_[_0xb346('0x3d')](_0x416e4d,['name',_0xb346('0x4b')]);_0x53d8d8[_0xb346('0xc')]=_0xb346('0x4b');_0x2713ac=as[_0xb346('0x3f')](_0x52657a,_0x1cd462[_0xb346('0x40')],_0x53d8d8);_0x16e90e[_0xb346('0x4a')][_0x321222](_0x2713ac[_0xb346('0x41')],_0x2713ac[_0xb346('0x43')]['start'],_0x2713ac[_0xb346('0x43')][_0xb346('0x44')]);}break;case'Tag':var _0x1da3ab=_0x53d8d8[_0xb346('0x43')][_0xb346('0x49')](',')[_0xb346('0x1c')](function(_0x2717f3){return Number(_0x2717f3);});var _0x490f1b=parseTagParameter(_0x1da3ab);_0x16e90e[_0xb346('0x4c')]['clause'][_0xb346('0x4d')](_0x490f1b);_0x16e90e[_0xb346('0x4c')][_0xb346('0x4e')]=_0x1da3ab;break;case _0xb346('0x4f'):if(_0x53d8d8[_0xb346('0x47')]===_0xb346('0x48')){_0x16e90e['user'][_0x321222](_0xb346('0x50'),'%'+_0x53d8d8['value']+'%',null);}else{_0x1cd462=_['find'](_0x416e4d,[_0xb346('0x3e'),_0xb346('0x51')]);_0x53d8d8[_0xb346('0xc')]='UserId';_0x2713ac=as[_0xb346('0x3f')](_0x52657a,_0x1cd462[_0xb346('0x40')],_0x53d8d8);_0x16e90e[_0xb346('0x52')][_0x321222](_0x2713ac[_0xb346('0x41')],_0x2713ac['value'][_0xb346('0x42')],_0x2713ac['value']['end']);}break;case'body':case _0xb346('0x53'):_0x2713ac=as[_0xb346('0x3f')]('me',null,_0x53d8d8);_0x16e90e['body'][_0x321222](_0x2713ac['text'],_0x2713ac[_0xb346('0x43')][_0xb346('0x42')],_0x2713ac[_0xb346('0x43')][_0xb346('0x44')]);break;}}}return _0x16e90e;}function parseModelFields(_0x41d995,_0x3b5fed,_0x462a4f){var _0x12bdce=utils[_0xb346('0x7')](_0x41d995);var _0x400831=squel[_0xb346('0x28')]();var _0x2e061a=_(_0x3b5fed)['keys']()[_0xb346('0x1c')](function(_0x1edec2){return _['some'](_0x462a4f,[_0xb346('0x3e'),_0x1edec2])?_0x1edec2:undefined;})[_0xb346('0x54')]()[_0xb346('0x43')]();if(_0x2e061a[_0xb346('0x18')]>0x0){_0x2e061a['forEach'](function(_0x30e7d4){if(_0x30e7d4===_0x12bdce){_0x400831[_0xb346('0x4d')]('i.'+_0x12bdce+'\x20IN\x20?',[][_0xb346('0x55')](_0x3b5fed[_0x30e7d4]));}else if(_0x30e7d4===_0xb346('0x56')){var _0x542e64=JSON['parse'](_0x3b5fed[_0x30e7d4])[_0xb346('0x57')];var _0x1dbf71=JSON['parse'](_0x3b5fed[_0x30e7d4])[_0xb346('0x58')];_0x400831[_0xb346('0x4d')](_0xb346('0x59'),_0x542e64,_0x1dbf71);}else{if(_0x3b5fed[_0x30e7d4]==='null'){_0x400831[_0xb346('0x4d')]('i.'+_0x30e7d4+_0xb346('0x5a'));}else{_0x400831[_0xb346('0x4d')]('i.'+_0x30e7d4+_0xb346('0x5b'),_0x3b5fed[_0x30e7d4]);}}});}return _0x400831;}function parseQueryParameters(_0x564fa0,_0x11b4a0,_0x33005f){var _0x35f1f0=getSqlClauses();return Promise[_0xb346('0x5c')]()[_0xb346('0x5d')](function(){return parseModelFields(_0x564fa0,_0x11b4a0,_0x33005f);})['then'](function(_0x4b79c2){_0x35f1f0[_0xb346('0x5e')][_0xb346('0x4d')](_0x4b79c2);return parseReadParameter(_0x11b4a0[_0xb346('0x46')]);})[_0xb346('0x5d')](function(_0x1ab9d9){_0x35f1f0['read'][_0xb346('0x4d')](_0x1ab9d9);return parseTagParameter(_0x11b4a0['tag']);})[_0xb346('0x5d')](function(_0x462530){_0x35f1f0[_0xb346('0x4c')]['clause']['and'](_0x462530);return parseSearchFilter(_0x564fa0,_0x11b4a0[_0xb346('0x5f')]);})[_0xb346('0x5d')](function(_0x1ec6be){_0x35f1f0[_0xb346('0x5f')]=_0x1ec6be;return _0x35f1f0;});}function checkAccountsRestrictions(_0x2bdd3c,_0x35f4b0,_0x38b239){var _0x212638=utils[_0xb346('0x7')](_0x2bdd3c);var _0x974fd6=_0xb346('0x60')+_['capitalize'](_0x2bdd3c)+(_0x2bdd3c===_0xb346('0x61')?_0xb346('0x62'):_0xb346('0x63'));var _0x49db7d=squel[_0xb346('0x28')]();return Promise[_0xb346('0x5c')]()[_0xb346('0x5d')](function(){if(_0x38b239[_0xb346('0xa')]&&_0x35f4b0[_0xb346('0x8')]===_0xb346('0x9')){return _0x35f4b0[_0x974fd6]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x15fe75){if(_0x15fe75){if(_0x15fe75['length']===0x0){_0x49db7d[_0xb346('0x4d')]('i.'+_0x212638+_0xb346('0x5a'));}else{_0x49db7d[_0xb346('0x4d')]('i.'+_0x212638+_0xb346('0x1b'),_['map'](_0x15fe75,'id'));}}else if(!_0x38b239[_0x212638]){_0x49db7d[_0xb346('0x4d')]('i.'+_0x212638+_0xb346('0x64'));}})[_0xb346('0x5d')](function(){return _0x49db7d;});}function getClosedOrderClause(_0x3b7908,_0x5a99e8){var _0x2f12d4='';var _0x1cf984=[_0xb346('0x65'),'i.secondDisposition',_0xb346('0x66')];if(_0x3b7908===_0xb346('0x35')){_0x1cf984[_0xb346('0x67')](_0xb346('0x68'));}if(_0x5a99e8[_0xb346('0x69')]==='0'&&_0x3b7908===_0xb346('0x35')){_0x2f12d4=_0xb346('0x68');}else{if(_0x5a99e8['closed']==='1'){_0x1cf984[_0xb346('0x6a')]();}_0x2f12d4=_0xb346('0x6b')+_0x1cf984[_0xb346('0x6c')](',\x20')+')';}return _0x2f12d4;}function getFilteredInteractions(_0x528dc7,_0x4a0c78,_0x3924b3,_0x439b52){var _0x1093c3=utils['getInteractionFK'](_0x528dc7);var _0x378807=_['capitalize'](_0x528dc7)+_0xb346('0x6d');var _0x4df3d2=[];var _0x4209f4=getTagsQuery();var _0x477408={'type':db[_0xb346('0x6e')][_0xb346('0x6f')]['SELECT'],'raw':!![]};var _0x16b5a0=[];var _0x9a892d=[];return db[_0xb346('0x70')][_0xb346('0x71')](_0x4209f4[_0xb346('0x72')](),_0x477408)[_0xb346('0x5d')](function(_0x3be7b1){_0x4df3d2=_['keyBy'](_0x3be7b1,'id');_0x477408=_[_0xb346('0x73')](_0x477408,{'model':db[_0x378807],'mapToModel':!![],'nest':!![]});if(_0x3924b3[_0xb346('0x5e')]){_0x439b52[_0xb346('0x74')][_0xb346('0x2a')](function(_0x33f5cd){_0x4a0c78[_0xb346('0xc')]('i.'+_0x33f5cd);});}else{_0x4a0c78[_0xb346('0xc')](_0xb346('0x75'),_0xb346('0x45'));_0x4a0c78['field']('a.key',_0xb346('0x76'));_0x4a0c78[_0xb346('0xc')]('a.mandatoryDisposition',_0xb346('0x77'));if(_0x528dc7===_0xb346('0x35')){_0x4a0c78[_0xb346('0xc')](_0xb346('0x78'),_0xb346('0x79'));_0x4a0c78['field'](_0xb346('0x7a'),_0xb346('0x7b'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x7c'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x7d'));_0x4a0c78[_0xb346('0xc')]('i.updatedAt');_0x4a0c78[_0xb346('0xc')](_0xb346('0x7e'));_0x4a0c78['field']('i.closedAt');_0x4a0c78[_0xb346('0xc')](_0xb346('0x7f'));_0x4a0c78[_0xb346('0xc')]('i.lastMsgAt');_0x4a0c78['field'](_0xb346('0x80'));_0x4a0c78['field'](_0xb346('0x81'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x66'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x82'));_0x4a0c78['field']('i.thirdDisposition');_0x4a0c78['field'](_0xb346('0x68'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x83'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x84'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x85'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x86'));}else if(_0x528dc7===_0xb346('0x87')){_0x4a0c78[_0xb346('0xc')]('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',_0xb346('0x7b'));}else{_0x4a0c78[_0xb346('0xc')]('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',_0xb346('0x7b'));}if(_0x528dc7!==_0xb346('0x35')){_0x4a0c78['field'](_0xb346('0x88'));}_0x4a0c78['field'](_0xb346('0x89'),_0xb346('0x8a'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x8b'),_0xb346('0x8c'));_0x4a0c78[_0xb346('0xc')]('c.email',_0xb346('0x8d'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x8e'),_0xb346('0x8f'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x90'),'Contact.mobile');_0x4a0c78['field'](_0xb346('0x91'),'Contact.fax');_0x4a0c78[_0xb346('0xc')](_0xb346('0x92'),_0xb346('0x93'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x94'),_0xb346('0x95'));_0x4a0c78[_0xb346('0xc')](_0xb346('0x96'),_0xb346('0x97'));}if(_0x439b52['limit']){_0x4a0c78[_0xb346('0x98')](_0x439b52['limit']);}if(_0x439b52[_0xb346('0x99')]){_0x4a0c78[_0xb346('0x99')](_0x439b52[_0xb346('0x99')]);}return db[_0xb346('0x70')][_0xb346('0x71')](_0x4a0c78[_0xb346('0x72')](),_0x477408);})[_0xb346('0x5d')](function(_0x17912f){_0x16b5a0=_0x17912f;var _0x32894e=getUsersQuery(_0x528dc7,_0x16b5a0);return db[_0xb346('0x70')][_0xb346('0x71')](_0x32894e[_0xb346('0x72')](),_0x477408);})[_0xb346('0x5d')](function(_0x3a7cc5){_0x9a892d=_[_0xb346('0x9a')](_0x3a7cc5,_0x1093c3);if(_0x528dc7==='mail'){return db['Setting'][_0xb346('0x9b')]({'attributes':[_0xb346('0x9c')],'raw':!![]});}})[_0xb346('0x5d')](function(_0x4a28a1){var _0x38dc0f=_0x4a28a1?_0x4a28a1['enableEmailPreview']:undefined;var _0xece2d=_0x16b5a0[_0xb346('0x1c')](function(_0x4153a6){return updateInteraction(_0x4153a6,_0x4df3d2,_0x9a892d,_0x38dc0f);});return Promise[_0xb346('0x9d')](_0xece2d);});}function countFilteredInteractions(_0x3133fe,_0x4c4d67){var _0x1ca02b=_0x3133fe[_0xb346('0x9e')]();_0x1ca02b[_0xb346('0xc')](_0xb346('0x9f'));_0x1ca02b[_0xb346('0xc')](_0xb346('0x75'),_0xb346('0x45'));var _0x31e2d9=utils['getSelectedTags'](_0x4c4d67);if(!_[_0xb346('0xa0')](_0x31e2d9)){_0x1ca02b[_0xb346('0x19')](_0xb346('0xa1'),_0x31e2d9);}var _0x31a230={'type':db[_0xb346('0x6e')][_0xb346('0x6f')]['SELECT'],'raw':!![]};return db[_0xb346('0x70')][_0xb346('0x71')](_0x1ca02b[_0xb346('0x72')](),_0x31a230);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x3f96=['interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','\x20=\x20i.id','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','mail','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','start','value','read','and','Contact','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','split','map','tags','clause','ids','User','operator','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','end','body','plainBody','some','compact','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','resolve','then','tag','filter','get','capitalize','Websites','Accounts','\x20IS\x20NULL','\x20IN\x20?','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','Sequelize','SELECT','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','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.id','i.updatedAt','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','Owner.internal','TagIds','limit','offset','sequelize','Setting','enableEmailPreview','clone','COUNT(*)','unreadMessages','isEmpty','t.id\x20IN\x20?','QueryTypes','../parsers/advancedSearch','../parsers/qs','updateInteraction','../../mysqldb','role','agent','search','select','field','name','from','tools_tags','_interactions','u.id','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','getInteractionsTables','getAccountFK','getInteractionFK'];(function(_0x25202d,_0xebd61b){var _0x2a1b45=function(_0x58e30f){while(--_0x58e30f){_0x25202d['push'](_0x25202d['shift']());}};_0x2a1b45(++_0xebd61b);}(_0x3f96,0x129));var _0x63f9=function(_0x551b04,_0x185dc7){_0x551b04=_0x551b04-0x0;var _0x195756=_0x3f96[_0x551b04];return _0x195756;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0x63f9('0x0'));var qs=require(_0x63f9('0x1'));var updateInteraction=require('./update-interaction')[_0x63f9('0x2')];var utils=require('./utils');var db=require(_0x63f9('0x3'))['db'];function skipInteractionsQuery(_0x3c32da,_0x330fa7,_0x2e4c00){var _0x2a53c7=![];var _0x48512a=utils['getAccountFK'](_0x3c32da);if(_0x330fa7[_0x63f9('0x4')]===_0x63f9('0x5')&&!_0x2e4c00[_0x63f9('0x6')]&&!_0x2e4c00[_0x48512a]){_0x2a53c7=!![];}return _0x2a53c7;}function getTagsQuery(){return squel[_0x63f9('0x7')]()['field']('id')[_0x63f9('0x8')](_0x63f9('0x9'))[_0x63f9('0x8')]('color')[_0x63f9('0xa')](_0x63f9('0xb'));}function getUsersQuery(_0x39a66c,_0x1081ec){var _0x67a0e6=utils['getInteractionFK'](_0x39a66c);var _0x4c5802='user_has_'+_0x39a66c+_0x63f9('0xc');var _0xff71a8=squel[_0x63f9('0x7')]()['field'](_0x63f9('0xd'))[_0x63f9('0x8')]('u.fullname')[_0x63f9('0x8')](_0x63f9('0xe')+_0x67a0e6)[_0x63f9('0xa')](_0x4c5802,'ui')[_0x63f9('0xf')](_0x63f9('0x10'),'u',_0x63f9('0x11'));if(_0x1081ec[_0x63f9('0x12')]>0x0){_0xff71a8[_0x63f9('0x13')](_0x63f9('0xe')+_0x67a0e6+'\x20IN\x20?',_['map'](_0x1081ec,'id'));}return _0xff71a8;}function getInteractionsQuery(_0x30f084){var _0x49db2c=utils[_0x63f9('0x14')](_0x30f084);var _0x3c2533=utils[_0x63f9('0x15')](_0x30f084);var _0xc846c6=utils[_0x63f9('0x16')](_0x30f084);return squel[_0x63f9('0x7')]()[_0x63f9('0xa')](_0x49db2c[_0x63f9('0x17')],'i')[_0x63f9('0xf')](_0x63f9('0x18'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x63f9('0xf')](_0x63f9('0x10'),'o',_0x63f9('0x19'))[_0x63f9('0xf')](_0x49db2c['accounts'],'a',_0x63f9('0x1a')+_0x3c2533)[_0x63f9('0xf')](_0x49db2c[_0x63f9('0x1b')],'me','me.'+_0xc846c6+_0x63f9('0x1c'))[_0x63f9('0xf')](_0x49db2c['interactionsTags'],'it',_0x63f9('0x1d')+_0xc846c6+_0x63f9('0x1c'))[_0x63f9('0xf')](_0x63f9('0xb'),'t',_0x63f9('0x1e'));}function getSqlClauses(){var _0x3a1a49={'body':squel[_0x63f9('0x1f')](),'contact':squel[_0x63f9('0x1f')](),'default':squel['expr'](),'fields':squel[_0x63f9('0x1f')](),'filter':squel[_0x63f9('0x1f')](),'read':squel[_0x63f9('0x1f')](),'tags':{'clause':squel[_0x63f9('0x1f')](),'ids':null},'user':squel[_0x63f9('0x1f')]()};return _0x3a1a49;}function parseTagParameter(_0xd18691){var _0x3b2afc=squel[_0x63f9('0x1f')]();if(_0xd18691){var _0x5a2010=utils[_0x63f9('0x20')](_0xd18691);_0x5a2010[_0x63f9('0x21')](function(_0x10ff16){_0x3b2afc['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x10ff16+',%');});}return _0x3b2afc;}function parseReadParameter(_0x1a141e){var _0xc4cb70='';if(_0x1a141e){_0xc4cb70=_0x63f9('0x22');if(_0x1a141e==='1'){_0xc4cb70=_0xc4cb70[_0x63f9('0x23')](_0x63f9('0x24'),'=');}else{_0xc4cb70=_0xc4cb70['replace']('{OPERATOR}','>');}}return _0xc4cb70;}function parseSearchFilter(_0x104ac7,_0x1e4a1f){var _0x4322e8=squel[_0x63f9('0x1f')]();if(_0x1e4a1f){var _0x543719=_0x1e4a1f['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x543719)){_0x4322e8['or'](_0x63f9('0x25'),_0x543719+'%');if([_0x63f9('0x26'),_0x63f9('0x27')][_0x63f9('0x28')](_0x104ac7)){_0x4322e8['or'](_0x63f9('0x29'),_0x543719+'%');}else if(_0x104ac7===_0x63f9('0x2a')){_0x4322e8['or']('i.fax\x20LIKE\x20?',_0x543719+'%');}else if(_0x104ac7===_0x63f9('0x2b')){_0x4322e8['or'](_0x63f9('0x2c'),_0x543719+'%');}}else if(_0x104ac7===_0x63f9('0x2d')&&qs[_0x63f9('0x2e')](_0x543719)){_0x4322e8['or']('c.email\x20LIKE\x20?',_0x543719+'%');}else{if(_0x104ac7===_0x63f9('0x2d')){_0x4322e8['or'](_0x63f9('0x2f'),qs[_0x63f9('0x30')](_0x543719,!![]))['or'](_0x63f9('0x31'),qs[_0x63f9('0x30')](_0x543719));}else if(_0x104ac7!==_0x63f9('0x2a')){_0x4322e8['or'](_0x63f9('0x32'),qs[_0x63f9('0x30')](_0x543719));}_0x4322e8['or'](_0x63f9('0x33'),qs[_0x63f9('0x30')](_0x543719,!![]),null);}}return _0x4322e8;}function parseAdvancedSearchFilter(_0x18ceb6,_0x464648){var _0x3c8668=getSqlClauses();var _0xbe7361=as[_0x63f9('0x34')](_0x18ceb6);var _0x491b7b=_0xbe7361[_0x63f9('0x35')];for(var _0x288ed8=0x0;_0x288ed8<_0xbe7361[_0x63f9('0x36')][_0x63f9('0x12')];_0x288ed8++){var _0x16cb80=_0xbe7361[_0x63f9('0x36')][_0x288ed8];var _0x208b5a='i';var _0x38f38c=_[_0x63f9('0x37')](_0x464648,[_0x63f9('0x9'),_0x16cb80[_0x63f9('0x8')]]);if(_0x38f38c){var _0x40e333=as[_0x63f9('0x38')](_0x208b5a,_0x38f38c[_0x63f9('0x39')],_0x16cb80);_0x3c8668[_0x63f9('0x3a')][_0x491b7b](_0x40e333[_0x63f9('0x3b')],_0x40e333['value'][_0x63f9('0x3c')],_0x40e333['value']['end']);}else{switch(_0x16cb80[_0x63f9('0x8')]){case'unreadMessages':var _0x527d28=parseReadParameter(_0x16cb80[_0x63f9('0x3d')]);_0x3c8668[_0x63f9('0x3e')][_0x63f9('0x3f')](_0x527d28);break;case _0x63f9('0x40'):if(_0x16cb80['operator']===_0x63f9('0x41')){if(_0x16cb80[_0x63f9('0x3d')]['split']('\x20')[_0x63f9('0x12')]>0x1){_0x3c8668[_0x63f9('0x42')][_0x491b7b](_0x63f9('0x33'),qs['getFullTextValue'](_0x16cb80['value'],!![]),null);}else{var _0x2cd5d4='%'+_0x16cb80[_0x63f9('0x3d')]+'%';_0x3c8668['contact'][_0x491b7b](_0x63f9('0x43'),_0x2cd5d4,_0x2cd5d4,_0x2cd5d4);}}else{_0x38f38c=_[_0x63f9('0x37')](_0x464648,[_0x63f9('0x9'),_0x63f9('0x44')]);_0x16cb80[_0x63f9('0x8')]=_0x63f9('0x44');_0x40e333=as[_0x63f9('0x38')](_0x208b5a,_0x38f38c[_0x63f9('0x39')],_0x16cb80);_0x3c8668[_0x63f9('0x42')][_0x491b7b](_0x40e333[_0x63f9('0x3b')],_0x40e333[_0x63f9('0x3d')][_0x63f9('0x3c')],_0x40e333[_0x63f9('0x3d')]['end']);}break;case'Tag':var _0x3508b1=_0x16cb80[_0x63f9('0x3d')][_0x63f9('0x45')](',')[_0x63f9('0x46')](function(_0xed1d67){return Number(_0xed1d67);});var _0x13c20f=parseTagParameter(_0x3508b1);_0x3c8668[_0x63f9('0x47')][_0x63f9('0x48')][_0x63f9('0x3f')](_0x13c20f);_0x3c8668[_0x63f9('0x47')][_0x63f9('0x49')]=_0x3508b1;break;case _0x63f9('0x4a'):if(_0x16cb80[_0x63f9('0x4b')]===_0x63f9('0x41')){_0x3c8668[_0x63f9('0x4c')][_0x491b7b](_0x63f9('0x4d'),'%'+_0x16cb80[_0x63f9('0x3d')]+'%',null);}else{_0x38f38c=_[_0x63f9('0x37')](_0x464648,[_0x63f9('0x9'),'UserId']);_0x16cb80[_0x63f9('0x8')]=_0x63f9('0x4e');_0x40e333=as[_0x63f9('0x38')](_0x208b5a,_0x38f38c[_0x63f9('0x39')],_0x16cb80);_0x3c8668[_0x63f9('0x4c')][_0x491b7b](_0x40e333[_0x63f9('0x3b')],_0x40e333[_0x63f9('0x3d')]['start'],_0x40e333[_0x63f9('0x3d')][_0x63f9('0x4f')]);}break;case _0x63f9('0x50'):case _0x63f9('0x51'):_0x40e333=as[_0x63f9('0x38')]('me',null,_0x16cb80);_0x3c8668[_0x63f9('0x50')][_0x491b7b](_0x40e333['text'],_0x40e333[_0x63f9('0x3d')]['start'],_0x40e333['value']['end']);break;}}}return _0x3c8668;}function parseModelFields(_0x559937,_0x1fc791,_0x338183){var _0x217f2f=utils[_0x63f9('0x15')](_0x559937);var _0x1a398e=squel[_0x63f9('0x1f')]();var _0x2b1c1e=_(_0x1fc791)['keys']()[_0x63f9('0x46')](function(_0x30e58a){return _[_0x63f9('0x52')](_0x338183,[_0x63f9('0x9'),_0x30e58a])?_0x30e58a:undefined;})[_0x63f9('0x53')]()['value']();if(_0x2b1c1e['length']>0x0){_0x2b1c1e['forEach'](function(_0x5bfcd9){if(_0x5bfcd9===_0x217f2f){_0x1a398e['and']('i.'+_0x217f2f+'\x20IN\x20?',[]['concat'](_0x1fc791[_0x5bfcd9]));}else if(_0x5bfcd9==='createdAt'){var _0x17dedc=JSON[_0x63f9('0x54')](_0x1fc791[_0x5bfcd9])[_0x63f9('0x55')];var _0x2f160b=JSON[_0x63f9('0x54')](_0x1fc791[_0x5bfcd9])['$lte'];_0x1a398e[_0x63f9('0x3f')](_0x63f9('0x56'),_0x17dedc,_0x2f160b);}else{if(_0x1fc791[_0x5bfcd9]===_0x63f9('0x57')){_0x1a398e[_0x63f9('0x3f')]('i.'+_0x5bfcd9+'\x20IS\x20NULL');}else{_0x1a398e[_0x63f9('0x3f')]('i.'+_0x5bfcd9+_0x63f9('0x58'),_0x1fc791[_0x5bfcd9]);}}});}return _0x1a398e;}function parseQueryParameters(_0x750e56,_0x1eb5d9,_0x52e4f6){var _0x4c7e02=getSqlClauses();return Promise[_0x63f9('0x59')]()['then'](function(){return parseModelFields(_0x750e56,_0x1eb5d9,_0x52e4f6);})[_0x63f9('0x5a')](function(_0x3686bd){_0x4c7e02['fields'][_0x63f9('0x3f')](_0x3686bd);return parseReadParameter(_0x1eb5d9['read']);})[_0x63f9('0x5a')](function(_0x7dc15b){_0x4c7e02[_0x63f9('0x3e')][_0x63f9('0x3f')](_0x7dc15b);return parseTagParameter(_0x1eb5d9[_0x63f9('0x5b')]);})[_0x63f9('0x5a')](function(_0x4dc44e){_0x4c7e02[_0x63f9('0x47')][_0x63f9('0x48')][_0x63f9('0x3f')](_0x4dc44e);return parseSearchFilter(_0x750e56,_0x1eb5d9[_0x63f9('0x5c')]);})[_0x63f9('0x5a')](function(_0x33e0c1){_0x4c7e02[_0x63f9('0x5c')]=_0x33e0c1;return _0x4c7e02;});}function checkAccountsRestrictions(_0x4099f4,_0x18ffb5,_0x330efe){var _0x547542=utils['getAccountFK'](_0x4099f4);var _0x22783=_0x63f9('0x5d')+_[_0x63f9('0x5e')](_0x4099f4)+(_0x4099f4==='chat'?_0x63f9('0x5f'):_0x63f9('0x60'));var _0x47cd96=squel[_0x63f9('0x1f')]();return Promise[_0x63f9('0x59')]()[_0x63f9('0x5a')](function(){if(_0x330efe[_0x63f9('0x6')]&&_0x18ffb5[_0x63f9('0x4')]===_0x63f9('0x5')){return _0x18ffb5[_0x22783]({'attributes':['id'],'raw':!![]});}})[_0x63f9('0x5a')](function(_0x9ad225){if(_0x9ad225){if(_0x9ad225[_0x63f9('0x12')]===0x0){_0x47cd96['and']('i.'+_0x547542+_0x63f9('0x61'));}else{_0x47cd96[_0x63f9('0x3f')]('i.'+_0x547542+_0x63f9('0x62'),_['map'](_0x9ad225,'id'));}}else if(!_0x330efe[_0x547542]){_0x47cd96[_0x63f9('0x3f')]('i.'+_0x547542+_0x63f9('0x63'));}})[_0x63f9('0x5a')](function(){return _0x47cd96;});}function getClosedOrderClause(_0x936fd4,_0x4da708){var _0xb36d97='';var _0x161718=['i.thirdDisposition',_0x63f9('0x64'),_0x63f9('0x65')];if(_0x936fd4===_0x63f9('0x2d')){_0x161718[_0x63f9('0x66')](_0x63f9('0x67'));}if(_0x4da708[_0x63f9('0x68')]==='0'&&_0x936fd4===_0x63f9('0x2d')){_0xb36d97=_0x63f9('0x67');}else{if(_0x4da708[_0x63f9('0x68')]==='1'){_0x161718[_0x63f9('0x69')]();}_0xb36d97=_0x63f9('0x6a')+_0x161718['join'](',\x20')+')';}return _0xb36d97;}function getFilteredInteractions(_0x199132,_0x143c71,_0x2b198d,_0x513cfa){var _0xe89cc4=utils['getInteractionFK'](_0x199132);var _0x5a01ff=_[_0x63f9('0x5e')](_0x199132)+'Interaction';var _0x476eea=[];var _0x16e851=getTagsQuery();var _0x272058={'type':db[_0x63f9('0x6b')]['QueryTypes'][_0x63f9('0x6c')],'raw':!![]};var _0x513442=[];var _0x4dc2f4=[];return db['sequelize'][_0x63f9('0x6d')](_0x16e851[_0x63f9('0x6e')](),_0x272058)[_0x63f9('0x5a')](function(_0x12d272){_0x476eea=_[_0x63f9('0x6f')](_0x12d272,'id');_0x272058=_[_0x63f9('0x70')](_0x272058,{'model':db[_0x5a01ff],'mapToModel':!![],'nest':!![]});if(_0x2b198d['fields']){_0x513cfa[_0x63f9('0x71')][_0x63f9('0x21')](function(_0xa26f72){_0x143c71[_0x63f9('0x8')]('i.'+_0xa26f72);});}else{_0x143c71['field'](_0x63f9('0x72'),'unreadMessages');_0x143c71[_0x63f9('0x8')](_0x63f9('0x73'),_0x63f9('0x74'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x75'),_0x63f9('0x76'));if(_0x199132===_0x63f9('0x2d')){_0x143c71[_0x63f9('0x8')](_0x63f9('0x77'),_0x63f9('0x78'));_0x143c71['field'](_0x63f9('0x79'),_0x63f9('0x7a'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x7b'));_0x143c71[_0x63f9('0x8')]('i.createdAt');_0x143c71[_0x63f9('0x8')](_0x63f9('0x7c'));_0x143c71[_0x63f9('0x8')]('i.closed');_0x143c71[_0x63f9('0x8')](_0x63f9('0x7d'));_0x143c71[_0x63f9('0x8')]('i.attach');_0x143c71[_0x63f9('0x8')](_0x63f9('0x7e'));_0x143c71['field'](_0x63f9('0x7f'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x80'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x65'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x64'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x81'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x67'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x82'));_0x143c71['field'](_0x63f9('0x83'));_0x143c71['field'](_0x63f9('0x84'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x85'));}else if(_0x199132===_0x63f9('0x2b')){_0x143c71['field'](_0x63f9('0x86'),_0x63f9('0x7a'));}else{_0x143c71[_0x63f9('0x8')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x63f9('0x7a'));}if(_0x199132!==_0x63f9('0x2d')){_0x143c71['field'](_0x63f9('0x87'));}_0x143c71[_0x63f9('0x8')](_0x63f9('0x88'),_0x63f9('0x89'));_0x143c71['field'](_0x63f9('0x8a'),_0x63f9('0x8b'));_0x143c71['field'](_0x63f9('0x8c'),_0x63f9('0x8d'));_0x143c71[_0x63f9('0x8')](_0x63f9('0x8e'),'Contact.phone');_0x143c71[_0x63f9('0x8')](_0x63f9('0x8f'),_0x63f9('0x90'));_0x143c71['field']('c.fax',_0x63f9('0x91'));_0x143c71[_0x63f9('0x8')]('o.fullname',_0x63f9('0x92'));_0x143c71[_0x63f9('0x8')]('o.internal',_0x63f9('0x93'));_0x143c71[_0x63f9('0x8')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x63f9('0x94'));}if(_0x513cfa['limit']){_0x143c71[_0x63f9('0x95')](_0x513cfa[_0x63f9('0x95')]);}if(_0x513cfa[_0x63f9('0x96')]){_0x143c71[_0x63f9('0x96')](_0x513cfa[_0x63f9('0x96')]);}return db[_0x63f9('0x97')][_0x63f9('0x6d')](_0x143c71[_0x63f9('0x6e')](),_0x272058);})[_0x63f9('0x5a')](function(_0x56a253){_0x513442=_0x56a253;var _0xb1428a=getUsersQuery(_0x199132,_0x513442);return db['sequelize'][_0x63f9('0x6d')](_0xb1428a[_0x63f9('0x6e')](),_0x272058);})['then'](function(_0x22d88b){_0x4dc2f4=_['groupBy'](_0x22d88b,_0xe89cc4);if(_0x199132===_0x63f9('0x2d')){return db[_0x63f9('0x98')]['findOne']({'attributes':[_0x63f9('0x99')],'raw':!![]});}})[_0x63f9('0x5a')](function(_0x5e7608){var _0x855f85=_0x5e7608?_0x5e7608[_0x63f9('0x99')]:undefined;var _0x39789e=_0x513442['map'](function(_0xb5c302){return updateInteraction(_0xb5c302,_0x476eea,_0x4dc2f4,_0x855f85);});return Promise['all'](_0x39789e);});}function countFilteredInteractions(_0x187314,_0x432db5){var _0x2682a9=_0x187314[_0x63f9('0x9a')]();_0x2682a9[_0x63f9('0x8')](_0x63f9('0x9b'));_0x2682a9[_0x63f9('0x8')](_0x63f9('0x72'),_0x63f9('0x9c'));var _0x5a8556=utils['getSelectedTags'](_0x432db5);if(!_[_0x63f9('0x9d')](_0x5a8556)){_0x2682a9['where'](_0x63f9('0x9e'),_0x5a8556);}var _0x401779={'type':db[_0x63f9('0x6b')][_0x63f9('0x9f')][_0x63f9('0x6c')],'raw':!![]};return db['sequelize'][_0x63f9('0x6d')](_0x2682a9[_0x63f9('0x6e')](),_0x401779);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 124133c..ae42522 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 _0x88b3=['push','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','then','Users','TagIds','Tags','lodash','../../mysqldb','map','split','forEach'];(function(_0x44166f,_0x3e71e2){var _0x5f390a=function(_0x4876fb){while(--_0x4876fb){_0x44166f['push'](_0x44166f['shift']());}};_0x5f390a(++_0x3e71e2);}(_0x88b3,0x67));var _0x388b=function(_0x4face7,_0x329177){_0x4face7=_0x4face7-0x0;var _0x159b31=_0x88b3[_0x4face7];return _0x159b31;};'use strict';var _=require(_0x388b('0x0'));var db=require(_0x388b('0x1'))['db'];function getInteractionUsers(_0x46860c,_0x3e9bd7){return new Promise(function(_0x29527c,_0x20c493){try{var _0x531bcb=[];if(_0x3e9bd7[_0x46860c]){_0x531bcb=_0x3e9bd7[_0x46860c][_0x388b('0x2')](function(_0x1e44aa){return{'id':_0x1e44aa['id'],'fullname':_0x1e44aa['fullname']};});}return _0x29527c(_0x531bcb);}catch(_0x5e2bcf){_0x20c493(_0x5e2bcf);}});}function getInteractionTags(_0x595384,_0x472b57){var _0x4013f0=[];if(_0x595384){_0x595384[_0x388b('0x3')](',')[_0x388b('0x4')](function(_0x3780ba){_0x4013f0[_0x388b('0x5')](_0x472b57[_0x3780ba]);});}return _0x4013f0;}function updateWaitingCounter(_0x13a0b5){if(_0x13a0b5[_0x388b('0x6')]){_0x13a0b5['waiting']-=0x1;}}function updateInteractionCounters(_0x52f01a){_0x52f01a[_0x388b('0x6')]=0x0;_0x52f01a[_0x388b('0x7')]=0x0;_0x52f01a[_0x388b('0x8')]=0x0;_0x52f01a[_0x388b('0x9')]=0x0;_0x52f01a[_0x388b('0xa')]=0x0;_0x52f01a[_0x388b('0xb')]=0x0;if(_0x52f01a[_0x388b('0xc')]){if(_0x52f01a[_0x388b('0xd')]===_0x388b('0xa')){_0x52f01a[_0x388b('0xa')]+=0x1;updateWaitingCounter(_0x52f01a);}if(_0x52f01a[_0x388b('0xe')]){_0x52f01a[_0x388b('0x8')]+=0x1;if(_0x52f01a[_0x388b('0x7')]){_0x52f01a['talking']-=0x1;}}else{if(_0x52f01a[_0x388b('0xd')]){_0x52f01a[_0x388b('0x9')]+=0x1;updateWaitingCounter(_0x52f01a);}}}else{if(!_0x52f01a['UserId']){_0x52f01a[_0x388b('0x6')]+=0x1;}if(_0x52f01a[_0x388b('0xe')]){_0x52f01a[_0x388b('0x7')]+=0x1;updateWaitingCounter(_0x52f01a);}}_0x52f01a[_0x388b('0xb')]+=0x1;return _0x52f01a;}function getLastMessageText(_0x5ad5b7){return db[_0x388b('0xf')][_0x388b('0x10')]({'where':{'$and':[{'MailInteractionId':_0x5ad5b7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x388b('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x388b('0x12')],'order':_0x388b('0x13'),'raw':!![]})['then'](function(_0x5c8def){if(_0x5c8def&&_0x5c8def[_0x388b('0x12')]){_0x5ad5b7[_0x388b('0x14')]=_[_0x388b('0x15')](_0x5c8def[_0x388b('0x12')]);}return _0x5ad5b7;})[_0x388b('0x16')](function(_0x380789){throw _0x380789;});}exports['updateInteraction']=function(_0x458c47,_0x4e8cac,_0xfde9d,_0x534a69){return new Promise(function(_0x38cb4d,_0x55543a){return getInteractionUsers(_0x458c47['id'],_0xfde9d)[_0x388b('0x17')](function(_0x50a63f){_0x458c47[_0x388b('0x18')]=_0x50a63f;return getInteractionTags(_0x458c47[_0x388b('0x19')],_0x4e8cac);})['then'](function(_0x3d1660){_0x458c47[_0x388b('0x1a')]=_0x3d1660;delete _0x458c47['TagIds'];return updateInteractionCounters(_0x458c47);})['then'](function(_0x2b7fe0){if(_0x534a69){return getLastMessageText(_0x2b7fe0);}else{return _0x2b7fe0;}})['then'](function(_0x51365d){_0x38cb4d(_0x51365d);})[_0x388b('0x16')](function(_0xb8b508){_0x55543a(_0xb8b508);});});}; \ No newline at end of file +var _0x58b9=['waiting','talking','answered','unmanaged','abandoned','total','UserId','out','then','plainBody','lastMsgText','trimStart','catch','Users','TagIds','Tags','lodash','../../mysqldb','map','split','push'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x58b9,0xb8));var _0x958b=function(_0x539841,_0x52e491){_0x539841=_0x539841-0x0;var _0x91ad8f=_0x58b9[_0x539841];return _0x91ad8f;};'use strict';var _=require(_0x958b('0x0'));var db=require(_0x958b('0x1'))['db'];function getInteractionUsers(_0x38ba50,_0x2d1a35){return new Promise(function(_0x10a751,_0x2d5a8c){try{var _0x50fad9=[];if(_0x2d1a35[_0x38ba50]){_0x50fad9=_0x2d1a35[_0x38ba50][_0x958b('0x2')](function(_0x598597){return{'id':_0x598597['id'],'fullname':_0x598597['fullname']};});}return _0x10a751(_0x50fad9);}catch(_0xe8c5cd){_0x2d5a8c(_0xe8c5cd);}});}function getInteractionTags(_0x50194b,_0x3030a5){var _0x130547=[];if(_0x50194b){_0x50194b[_0x958b('0x3')](',')['forEach'](function(_0x5a654c){_0x130547[_0x958b('0x4')](_0x3030a5[_0x5a654c]);});}return _0x130547;}function updateWaitingCounter(_0x4e9d7a){if(_0x4e9d7a[_0x958b('0x5')]){_0x4e9d7a[_0x958b('0x5')]-=0x1;}}function updateInteractionCounters(_0x1e7126){_0x1e7126[_0x958b('0x5')]=0x0;_0x1e7126[_0x958b('0x6')]=0x0;_0x1e7126[_0x958b('0x7')]=0x0;_0x1e7126[_0x958b('0x8')]=0x0;_0x1e7126[_0x958b('0x9')]=0x0;_0x1e7126[_0x958b('0xa')]=0x0;if(_0x1e7126['closed']){if(_0x1e7126['disposition']===_0x958b('0x9')){_0x1e7126[_0x958b('0x9')]+=0x1;updateWaitingCounter(_0x1e7126);}if(_0x1e7126[_0x958b('0xb')]){_0x1e7126['answered']+=0x1;if(_0x1e7126[_0x958b('0x6')]){_0x1e7126[_0x958b('0x6')]-=0x1;}}else{if(_0x1e7126['disposition']){_0x1e7126[_0x958b('0x8')]+=0x1;updateWaitingCounter(_0x1e7126);}}}else{if(!_0x1e7126[_0x958b('0xb')]){_0x1e7126[_0x958b('0x5')]+=0x1;}if(_0x1e7126[_0x958b('0xb')]){_0x1e7126['talking']+=0x1;updateWaitingCounter(_0x1e7126);}}_0x1e7126['total']+=0x1;return _0x1e7126;}function getLastMessageText(_0x3c723f){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x3c723f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x958b('0xc')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x958b('0xd')](function(_0x2812a2){if(_0x2812a2&&_0x2812a2[_0x958b('0xe')]){_0x3c723f[_0x958b('0xf')]=_[_0x958b('0x10')](_0x2812a2[_0x958b('0xe')]);}return _0x3c723f;})[_0x958b('0x11')](function(_0x133b41){throw _0x133b41;});}exports['updateInteraction']=function(_0x1bba1b,_0x31e828,_0x54246c,_0x193997){return new Promise(function(_0x317410,_0x474558){return getInteractionUsers(_0x1bba1b['id'],_0x54246c)[_0x958b('0xd')](function(_0x4fbd1e){_0x1bba1b[_0x958b('0x12')]=_0x4fbd1e;return getInteractionTags(_0x1bba1b[_0x958b('0x13')],_0x31e828);})[_0x958b('0xd')](function(_0x441035){_0x1bba1b[_0x958b('0x14')]=_0x441035;delete _0x1bba1b[_0x958b('0x13')];return updateInteractionCounters(_0x1bba1b);})[_0x958b('0xd')](function(_0x48858a){if(_0x193997){return getLastMessageText(_0x48858a);}else{return _0x48858a;}})[_0x958b('0xd')](function(_0x7780da){_0x317410(_0x7780da);})[_0x958b('0x11')](function(_0x376dbf){_0x474558(_0x376dbf);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 2d3dab4..069897c 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 _0xd6ca=['sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','_interaction_has_tags','_messages','_interactions','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','findOne','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xd6ca,0x1bb));var _0xad6c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xd6ca[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xad6c('0x0'));var db=require(_0xad6c('0x1'))['db'];var loggers={'openchannel':require(_0xad6c('0x2'))('openchannel-interactions'),'mail':require(_0xad6c('0x2'))(_0xad6c('0x3')),'fax':require('../../config/logger')(_0xad6c('0x4')),'sms':require(_0xad6c('0x2'))(_0xad6c('0x5')),'chat':require(_0xad6c('0x2'))(_0xad6c('0x6')),'whatsapp':require('../../config/logger')(_0xad6c('0x7'))};function getAccountFK(_0x265a99){return _[_0xad6c('0x8')](_0x265a99)+(_0x265a99===_0xad6c('0x9')?_0xad6c('0xa'):_0xad6c('0xb'))+'Id';}function getInteractionFK(_0x53186d){return _[_0xad6c('0x8')](_0x53186d)+_0xad6c('0xc');}function getInteractionId(_0x68b7c7,_0x38a1fe,_0x341bb1){if(_0x68b7c7&&_0x68b7c7[_[_0xad6c('0xd')](_0x341bb1)+_0xad6c('0xc')]){return _0x68b7c7[_[_0xad6c('0xd')](_0x341bb1)+_0xad6c('0xc')];}else if(_0x68b7c7&&_0x68b7c7['id']){return _0x68b7c7['id'];}else if(_0x38a1fe&&_0x38a1fe['id']){return _0x38a1fe['id'];}else{return _0xad6c('0xe');}}function getInteractionsTables(_0x310e76){return{'accounts':_0x310e76+'_'+(_0x310e76==='chat'?_0xad6c('0xf'):'accounts'),'interactions':_0x310e76+'_interactions','interactionsTags':_0x310e76+_0xad6c('0x10'),'messages':_0x310e76+_0xad6c('0x11'),'userInteractions':'user_has_'+_0x310e76+_0xad6c('0x12')};}function getSelectedTags(_0x57fd6e){var _0x535bfb=[];if(_0x57fd6e){_0x535bfb=Array[_0xad6c('0x13')](_0x57fd6e)?_0x57fd6e:[_0x57fd6e];}return _0x535bfb;}function log(_0x32812e,_0x2903a6,_0x2f4e34,_0x35c298,_0x26880d,_0x4a6f53){loggers[_0x26880d['toLowerCase']()][_0x32812e](_0xad6c('0x14'),_0x4a6f53[_0xad6c('0x15')](),_0x2903a6?_0x2903a6['id']:null,_0x2903a6?_0x2903a6['name']:null,_0x2903a6?_0x2903a6[_0xad6c('0x16')]:null,getInteractionId(_0x2f4e34,_0x35c298,_0x26880d),_0x2f4e34?JSON[_0xad6c('0x17')](_0x2f4e34):_0xad6c('0x18'));}function updateUser(_0x28815e,_0x1d5783,_0x5060dc,_0x44471c,_0x5944fd){db[_[_0xad6c('0xd')](_0x44471c)+_0xad6c('0x19')][_0xad6c('0x1a')]({'where':{'id':getInteractionId(_0x1d5783,_0x5060dc,_0x44471c)}})['then'](function(_0x553dfb){if(_0x553dfb){return _0x553dfb[_0xad6c('0x1b')]({'UserId':_0x28815e?_0x28815e['id']:null});}})['then'](function(_0x37b0b1){if(_0x37b0b1){log(_0xad6c('0x1c'),_0x28815e,_0x1d5783,_0x5060dc,_0x44471c,_0x5944fd);}})[_0xad6c('0x1d')](function(){log(_0xad6c('0x1e'),_0x28815e,_0x1d5783,_0x5060dc,_0x44471c,_0x5944fd);});}module[_0xad6c('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x5e09=['update','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','chat','Account','capitalize','InteractionId','unknown','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase','toUpperCase','role','stringify','upperFirst','Interaction','findOne','then'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x5e09,0x125));var _0x95e0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5e09[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x95e0('0x0'));var db=require(_0x95e0('0x1'))['db'];var loggers={'openchannel':require(_0x95e0('0x2'))(_0x95e0('0x3')),'mail':require(_0x95e0('0x2'))(_0x95e0('0x4')),'fax':require('../../config/logger')(_0x95e0('0x5')),'sms':require('../../config/logger')(_0x95e0('0x6')),'chat':require('../../config/logger')(_0x95e0('0x7')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0xae7274){return _['capitalize'](_0xae7274)+(_0xae7274===_0x95e0('0x8')?'Website':_0x95e0('0x9'))+'Id';}function getInteractionFK(_0x48a641){return _[_0x95e0('0xa')](_0x48a641)+_0x95e0('0xb');}function getInteractionId(_0x4e2d54,_0x3fc6a4,_0x33f9ba){if(_0x4e2d54&&_0x4e2d54[_['upperFirst'](_0x33f9ba)+_0x95e0('0xb')]){return _0x4e2d54[_['upperFirst'](_0x33f9ba)+_0x95e0('0xb')];}else if(_0x4e2d54&&_0x4e2d54['id']){return _0x4e2d54['id'];}else if(_0x3fc6a4&&_0x3fc6a4['id']){return _0x3fc6a4['id'];}else{return _0x95e0('0xc');}}function getInteractionsTables(_0x1fa923){return{'accounts':_0x1fa923+'_'+(_0x1fa923===_0x95e0('0x8')?'websites':_0x95e0('0xd')),'interactions':_0x1fa923+_0x95e0('0xe'),'interactionsTags':_0x1fa923+_0x95e0('0xf'),'messages':_0x1fa923+'_messages','userInteractions':_0x95e0('0x10')+_0x1fa923+'_interactions'};}function getSelectedTags(_0x325e5b){var _0x19e1f5=[];if(_0x325e5b){_0x19e1f5=Array[_0x95e0('0x11')](_0x325e5b)?_0x325e5b:[_0x325e5b];}return _0x19e1f5;}function log(_0x75ad70,_0x221319,_0x4df64a,_0x1f090a,_0x353ecb,_0x402811){loggers[_0x353ecb[_0x95e0('0x12')]()][_0x75ad70]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x402811[_0x95e0('0x13')](),_0x221319?_0x221319['id']:null,_0x221319?_0x221319['name']:null,_0x221319?_0x221319[_0x95e0('0x14')]:null,getInteractionId(_0x4df64a,_0x1f090a,_0x353ecb),_0x4df64a?JSON[_0x95e0('0x15')](_0x4df64a):'null');}function updateUser(_0x2717ba,_0x4e1811,_0x22aa73,_0x19fb19,_0x3135eb){db[_[_0x95e0('0x16')](_0x19fb19)+_0x95e0('0x17')][_0x95e0('0x18')]({'where':{'id':getInteractionId(_0x4e1811,_0x22aa73,_0x19fb19)}})[_0x95e0('0x19')](function(_0x464148){if(_0x464148){return _0x464148[_0x95e0('0x1a')]({'UserId':_0x2717ba?_0x2717ba['id']:null});}})[_0x95e0('0x19')](function(_0x213241){if(_0x213241){log('info',_0x2717ba,_0x4e1811,_0x22aa73,_0x19fb19,_0x3135eb);}})['catch'](function(){log(_0x95e0('0x1b'),_0x2717ba,_0x4e1811,_0x22aa73,_0x19fb19,_0x3135eb);});}module[_0x95e0('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index b3cf370..6987a44 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 _0xdc76=['parse','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','isUserLimit','composable-middleware','../../config/environment','data1','license','createDecipher','format','base64','utf8'];(function(_0x1ec235,_0x359459){var _0x367d2c=function(_0x2f18a5){while(--_0x2f18a5){_0x1ec235['push'](_0x1ec235['shift']());}};_0x367d2c(++_0x359459);}(_0xdc76,0x1ec));var _0x6dc7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdc76[_0x2dafbe];return _0x58a45a;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x6dc7('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x6dc7('0x1'));function getValueFromLicense(_0x1e0c18,_0x5ec79d){if(_0x1e0c18&&_0x5ec79d){if(_0x5ec79d[_0x6dc7('0x2')]&&_0x5ec79d[_0x6dc7('0x3')]){var _0x8e65dc=_0x5ec79d['data1'];var _0x45e9a4=_0x5ec79d['license'];var _0x1ca254=_0x8e65dc['split']('-')[0x4];var _0x458e04=_0x8e65dc['split']('-')[0x0];var _0x17fa57=crypto[_0x6dc7('0x4')]('aes-256-ctr',util[_0x6dc7('0x5')]('%s:%s:%s',_0x1ca254,_0x8e65dc,_0x458e04));var _0x2df98b=_0x17fa57['update'](_0x45e9a4,_0x6dc7('0x6'),'utf8');_0x2df98b+=_0x17fa57['final'](_0x6dc7('0x7'));var _0x2a2e7f=JSON[_0x6dc7('0x8')](_0x2df98b);return _0x2a2e7f['hasOwnProperty'](_0x1e0c18)?_0x2a2e7f[_0x1e0c18]:null;}}return null;}function isLimit(_0x1e7639,_0x592512,_0x14148b,_0x49f343){var _0xa3ccc8=_0x592512;return compose()[_0x6dc7('0x9')](function(_0x2fa5dc,_0x416269,_0x8325ae){return db[_0x6dc7('0xa')][_0x6dc7('0xb')]({'where':{'id':0x1},'raw':!![]})[_0x6dc7('0xc')](function(_0xecd0e9){var _0x3b4d3b=getValueFromLicense(_0x1e7639,_0xecd0e9);return _0x3b4d3b?_0x3b4d3b:_0xa3ccc8;})[_0x6dc7('0xc')](function(_0x5addff){_0xa3ccc8=_0x5addff;return _0x14148b['count'](_0x49f343);})[_0x6dc7('0xc')](function(_0x32f0bb){if(_0x32f0bb>=_0xa3ccc8){return _0x416269[_0x6dc7('0xd')](0x193)[_0x6dc7('0xe')]({'message':util[_0x6dc7('0x5')](_0x6dc7('0xf'),_0x1e7639)});}_0x8325ae();})[_0x6dc7('0x10')](function(_0x1608f3){_0x8325ae(_0x1608f3);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x6dc7('0x11')},{'role':_0x6dc7('0x12')}]}});}exports[_0x6dc7('0x13')]=isUserLimit; \ No newline at end of file +var _0x2e64=['hasOwnProperty','License','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','license','data1','split','createDecipher','%s:%s:%s','update','utf8'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e64,0xc4));var _0x42e6=function(_0x1ef267,_0x144b78){_0x1ef267=_0x1ef267-0x0;var _0x3c8422=_0x2e64[_0x1ef267];return _0x3c8422;};'use strict';var crypto=require(_0x42e6('0x0'));var util=require(_0x42e6('0x1'));var compose=require(_0x42e6('0x2'));var db=require(_0x42e6('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x396fec,_0x6e1284){if(_0x396fec&&_0x6e1284){if(_0x6e1284['data1']&&_0x6e1284[_0x42e6('0x4')]){var _0xa4c295=_0x6e1284[_0x42e6('0x5')];var _0x21c024=_0x6e1284[_0x42e6('0x4')];var _0x4f9bf3=_0xa4c295[_0x42e6('0x6')]('-')[0x4];var _0x27264d=_0xa4c295[_0x42e6('0x6')]('-')[0x0];var _0x3604ca=crypto[_0x42e6('0x7')]('aes-256-ctr',util['format'](_0x42e6('0x8'),_0x4f9bf3,_0xa4c295,_0x27264d));var _0x4ffdd2=_0x3604ca[_0x42e6('0x9')](_0x21c024,'base64',_0x42e6('0xa'));_0x4ffdd2+=_0x3604ca['final'](_0x42e6('0xa'));var _0x4054b9=JSON['parse'](_0x4ffdd2);return _0x4054b9[_0x42e6('0xb')](_0x396fec)?_0x4054b9[_0x396fec]:null;}}return null;}function isLimit(_0x43bf7b,_0x509f1b,_0x4d54f9,_0x220705){var _0xeaf78d=_0x509f1b;return compose()['use'](function(_0x4d83f7,_0x34b988,_0x4c0c45){return db[_0x42e6('0xc')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x42e6('0xd')](function(_0x628d9f){var _0x588911=getValueFromLicense(_0x43bf7b,_0x628d9f);return _0x588911?_0x588911:_0xeaf78d;})[_0x42e6('0xd')](function(_0x5ca104){_0xeaf78d=_0x5ca104;return _0x4d54f9[_0x42e6('0xe')](_0x220705);})[_0x42e6('0xd')](function(_0x2e582e){if(_0x2e582e>=_0xeaf78d){return _0x34b988[_0x42e6('0xf')](0x193)[_0x42e6('0x10')]({'message':util[_0x42e6('0x11')](_0x42e6('0x12'),_0x43bf7b)});}_0x4c0c45();})['catch'](function(_0x1c2c08){_0x4c0c45(_0x1c2c08);});});}function isUserLimit(){return isLimit(_0x42e6('0x13'),0x1,db[_0x42e6('0x14')],{'where':{'$or':[{'role':_0x42e6('0x15')},{'role':_0x42e6('0x16')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 45cfbe8..8f7c437 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 _0x43c9=['pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','[$and]','replace','split','length','slice','shift','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','LIKE\x20?','$lt','<\x20?','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$startsWith'];(function(_0x580238,_0x2adec2){var _0x3d5608=function(_0x281c35){while(--_0x281c35){_0x580238['push'](_0x580238['shift']());}};_0x3d5608(++_0x2adec2);}(_0x43c9,0x118));var _0x943c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x43c9[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x943c('0x0'));var moment=require(_0x943c('0x1'));exports[_0x943c('0x2')]=function(_0xc596e){var _0x438389={'conditions':[]};_0x438389[_0x943c('0x3')]=_[_0x943c('0x4')](_0xc596e,_0x943c('0x5'))?'or':'and';var _0x33bcd4=_0xc596e['replace'](_0x943c('0x6'),'')[_0x943c('0x7')]('[$or]','')[_0x943c('0x8')]('||');for(var _0x25ed8c=0x0;_0x25ed8c<_0x33bcd4[_0x943c('0x9')];_0x25ed8c++){var _0x3e9fa4=_0x33bcd4[_0x25ed8c]['split'](':=');var _0x523dcb=_0x3e9fa4[0x0];var _0xe9dfb3=_0x3e9fa4[_0x943c('0xa')](0x1);_0xe9dfb3['forEach'](function(_0x206d43){var _0xe64542=_0x206d43[_0x943c('0x8')]('[')[_0x943c('0xb')]();var _0x4c76d8=_0x206d43[_0x943c('0xc')](/\[(.*?)\]/g);_0x4c76d8['forEach'](function(_0x3fedb5){var _0x3e3dad=_0x3fedb5[_0x943c('0x8')]('[')[_0x943c('0xd')](function(_0x28b9cc){return _0x28b9cc[_0x943c('0xe')](']')>-0x1;})[_0x943c('0xf')](function(_0x39c6db){return _0x39c6db[_0x943c('0x8')](']')[0x0];})[0x0];_0x438389[_0x943c('0x10')]['push']({'field':_0x523dcb,'operator':_0xe64542,'value':_0x3e3dad});});});}return _0x438389;};exports[_0x943c('0x11')]=function(_0x37c1f0,_0x524027,_0x3aec40){var _0x442923={};if(_0x524027===_0x943c('0x12')){if(_0x3aec40[_0x943c('0x13')]===_0x943c('0x14')){_0x3aec40['operator']='$between';_0x3aec40[_0x943c('0x15')]+=','+_0x3aec40[_0x943c('0x15')];}else if(_[_0x943c('0x16')]([_0x943c('0x17'),_0x943c('0x18')],_0x3aec40[_0x943c('0x13')])){_0x3aec40[_0x943c('0x15')]=moment(_0x3aec40[_0x943c('0x15')])[_0x943c('0x19')](0x1,'days')[_0x943c('0x1a')](_0x943c('0x1b'));}}if(_0x3aec40['castTo']){_0x524027=_0x3aec40[_0x943c('0x1c')];_0x442923['text']=_0x943c('0x1d')+_0x37c1f0+'.'+_0x3aec40[_0x943c('0x1e')]+_0x943c('0x1f')+_0x3aec40[_0x943c('0x1c')]+')\x20'+parseOperator(_0x3aec40[_0x943c('0x13')]);}else{_0x442923[_0x943c('0x20')]=_0x37c1f0+'.'+_0x3aec40['field']+'\x20'+parseOperator(_0x3aec40['operator']);}if(_[_0x943c('0x16')]([_0x943c('0x21'),'$notIn'],_0x3aec40['operator']))_0x442923[_0x943c('0x20')]='('+_0x442923[_0x943c('0x20')]+_0x943c('0x22')+_0x37c1f0+'.'+_0x3aec40[_0x943c('0x1e')]+_0x943c('0x23');_0x442923['value']=parseValue(_0x524027,_0x3aec40[_0x943c('0x13')],_0x3aec40[_0x943c('0x15')]);return _0x442923;};function parseOperator(_0xf59246){var _0x516408;switch(_0xf59246){case _0x943c('0x24'):_0x516408=_0x943c('0x25');break;case _0x943c('0x26'):_0x516408=_0x943c('0x27');break;case _0x943c('0x14'):_0x516408=_0x943c('0x28');break;case _0x943c('0x21'):_0x516408='<>\x20?';break;case _0x943c('0x29'):case'$startsWith':case'$endsWith':_0x516408=_0x943c('0x2a');break;case _0x943c('0x2b'):_0x516408=_0x943c('0x2c');break;case _0x943c('0x17'):_0x516408='>\x20?';break;case'$lte':_0x516408='<=\x20?';break;case'$gte':_0x516408=_0x943c('0x2d');break;case _0x943c('0x2e'):_0x516408=_0x943c('0x2f');break;}return _0x516408;}function parseValue(_0x200cbe,_0x42955d,_0x9fede1){var _0x54ac26={'start':undefined,'end':undefined};switch(_0x42955d){case'$in':case _0x943c('0x26'):_0x54ac26['start']=_0x9fede1[_0x943c('0x8')](',');break;case'$substring':_0x54ac26[_0x943c('0x30')]='%'+_0x9fede1+'%';break;case _0x943c('0x31'):_0x54ac26[_0x943c('0x30')]=_0x9fede1+'%';break;case'$endsWith':_0x54ac26['start']='%'+_0x9fede1;break;case'$between':var _0x16836a=_0x9fede1['split'](',');var _0x9fede1=_0x16836a[_0x943c('0xb')]();var _0x49b25c=_0x16836a[_0x943c('0x32')]();if(_0x200cbe===_0x943c('0x12')){_0x9fede1=moment(_0x9fede1)['utcOffset'](0x0,!![])['format']();_0x49b25c=moment(_0x49b25c)[_0x943c('0x33')](0x0,!![])[_0x943c('0x19')](0x17,_0x943c('0x34'))[_0x943c('0x19')](0x3b,_0x943c('0x35'))['add'](0x3b,_0x943c('0x36'))[_0x943c('0x1a')]();}_0x54ac26={'start':_0x9fede1,'end':_0x49b25c};break;default:_0x54ac26[_0x943c('0x30')]=_0x9fede1;break;}return _0x54ac26;} \ No newline at end of file +var _0x80ed=['<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','forEach','shift','match','filter','indexOf','map','conditions','DATE','operator','$eq','$between','value','includes','$lte','add','format','YYYY-MM-DD','field','\x20AS\x20','castTo','text','$ne','\x20OR\x20','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','<\x20?','$gt','>\x20?'];(function(_0x25e177,_0xbc5097){var _0x4c9340=function(_0x252ae4){while(--_0x252ae4){_0x25e177['push'](_0x25e177['shift']());}};_0x4c9340(++_0xbc5097);}(_0x80ed,0x1dd));var _0xd80e=function(_0x1b18f6,_0xbfba0e){_0x1b18f6=_0x1b18f6-0x0;var _0x4fc11f=_0x80ed[_0x1b18f6];return _0x4fc11f;};'use strict';var _=require('lodash');var moment=require(_0xd80e('0x0'));exports[_0xd80e('0x1')]=function(_0x12b492){var _0x2e30ee={'conditions':[]};_0x2e30ee[_0xd80e('0x2')]=_[_0xd80e('0x3')](_0x12b492,_0xd80e('0x4'))?'or':_0xd80e('0x5');var _0xbb5e00=_0x12b492[_0xd80e('0x6')](_0xd80e('0x7'),'')['replace'](_0xd80e('0x4'),'')['split']('||');for(var _0x4e88c5=0x0;_0x4e88c5<_0xbb5e00['length'];_0x4e88c5++){var _0x38dd44=_0xbb5e00[_0x4e88c5][_0xd80e('0x8')](':=');var _0x136dcf=_0x38dd44[0x0];var _0x4b44f1=_0x38dd44['slice'](0x1);_0x4b44f1[_0xd80e('0x9')](function(_0x59052d){var _0x14c9c3=_0x59052d[_0xd80e('0x8')]('[')[_0xd80e('0xa')]();var _0x246352=_0x59052d[_0xd80e('0xb')](/\[(.*?)\]/g);_0x246352[_0xd80e('0x9')](function(_0x48ae65){var _0xceb1ed=_0x48ae65[_0xd80e('0x8')]('[')[_0xd80e('0xc')](function(_0xd3076c){return _0xd3076c[_0xd80e('0xd')](']')>-0x1;})[_0xd80e('0xe')](function(_0x4cf9b1){return _0x4cf9b1[_0xd80e('0x8')](']')[0x0];})[0x0];_0x2e30ee[_0xd80e('0xf')]['push']({'field':_0x136dcf,'operator':_0x14c9c3,'value':_0xceb1ed});});});}return _0x2e30ee;};exports['buildExpression']=function(_0x223ff6,_0x365346,_0x4e2766){var _0x2030e7={};if(_0x365346===_0xd80e('0x10')){if(_0x4e2766[_0xd80e('0x11')]===_0xd80e('0x12')){_0x4e2766[_0xd80e('0x11')]=_0xd80e('0x13');_0x4e2766[_0xd80e('0x14')]+=','+_0x4e2766[_0xd80e('0x14')];}else if(_[_0xd80e('0x15')](['$gt',_0xd80e('0x16')],_0x4e2766[_0xd80e('0x11')])){_0x4e2766[_0xd80e('0x14')]=moment(_0x4e2766[_0xd80e('0x14')])[_0xd80e('0x17')](0x1,'days')[_0xd80e('0x18')](_0xd80e('0x19'));}}if(_0x4e2766['castTo']){_0x365346=_0x4e2766['castTo'];_0x2030e7['text']='CAST('+_0x223ff6+'.'+_0x4e2766[_0xd80e('0x1a')]+_0xd80e('0x1b')+_0x4e2766[_0xd80e('0x1c')]+')\x20'+parseOperator(_0x4e2766[_0xd80e('0x11')]);}else{_0x2030e7[_0xd80e('0x1d')]=_0x223ff6+'.'+_0x4e2766['field']+'\x20'+parseOperator(_0x4e2766['operator']);}if(_['includes']([_0xd80e('0x1e'),'$notIn'],_0x4e2766[_0xd80e('0x11')]))_0x2030e7['text']='('+_0x2030e7[_0xd80e('0x1d')]+_0xd80e('0x1f')+_0x223ff6+'.'+_0x4e2766[_0xd80e('0x1a')]+'\x20IS\x20NULL)';_0x2030e7[_0xd80e('0x14')]=parseValue(_0x365346,_0x4e2766['operator'],_0x4e2766[_0xd80e('0x14')]);return _0x2030e7;};function parseOperator(_0x23f935){var _0x2c511c;switch(_0x23f935){case _0xd80e('0x20'):_0x2c511c=_0xd80e('0x21');break;case _0xd80e('0x22'):_0x2c511c=_0xd80e('0x23');break;case _0xd80e('0x12'):_0x2c511c=_0xd80e('0x24');break;case _0xd80e('0x1e'):_0x2c511c='<>\x20?';break;case _0xd80e('0x25'):case _0xd80e('0x26'):case _0xd80e('0x27'):_0x2c511c='LIKE\x20?';break;case'$lt':_0x2c511c=_0xd80e('0x28');break;case _0xd80e('0x29'):_0x2c511c=_0xd80e('0x2a');break;case _0xd80e('0x16'):_0x2c511c=_0xd80e('0x2b');break;case _0xd80e('0x2c'):_0x2c511c='>=\x20?';break;case'$between':_0x2c511c=_0xd80e('0x2d');break;}return _0x2c511c;}function parseValue(_0x36413f,_0x173889,_0x3b121f){var _0x31c150={'start':undefined,'end':undefined};switch(_0x173889){case _0xd80e('0x20'):case _0xd80e('0x22'):_0x31c150[_0xd80e('0x2e')]=_0x3b121f['split'](',');break;case _0xd80e('0x25'):_0x31c150['start']='%'+_0x3b121f+'%';break;case _0xd80e('0x26'):_0x31c150[_0xd80e('0x2e')]=_0x3b121f+'%';break;case _0xd80e('0x27'):_0x31c150[_0xd80e('0x2e')]='%'+_0x3b121f;break;case _0xd80e('0x13'):var _0x354713=_0x3b121f[_0xd80e('0x8')](',');var _0x3b121f=_0x354713['shift']();var _0x40747=_0x354713[_0xd80e('0x2f')]();if(_0x36413f===_0xd80e('0x10')){_0x3b121f=moment(_0x3b121f)[_0xd80e('0x30')](0x0,!![])[_0xd80e('0x18')]();_0x40747=moment(_0x40747)[_0xd80e('0x30')](0x0,!![])['add'](0x17,_0xd80e('0x31'))[_0xd80e('0x17')](0x3b,_0xd80e('0x32'))[_0xd80e('0x17')](0x3b,_0xd80e('0x33'))[_0xd80e('0x18')]();}_0x31c150={'start':_0x3b121f,'end':_0x40747};break;default:_0x31c150[_0xd80e('0x2e')]=_0x3b121f;break;}return _0x31c150;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index ca66434..90f7e7b 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 _0x89c9=['limit','offset','sort','map','priority','cast','col','unsigned','ASC','isEmpty','length','omit','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','split','forEach','replace','push','query','$id','model','name','intersection','attributes','nolimit','order','where','filters','pick','filter','object','includes','value','merge','VIRTUAL','options','include','includeAll','lodash','sequelize','moment','../../mysqldb','parse','keys','fields','raw','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','uniqueid','isArray'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x89c9,0xb0));var _0x989c=function(_0x4fadb8,_0x11b539){_0x4fadb8=_0x4fadb8-0x0;var _0x3c9e20=_0x89c9[_0x4fadb8];return _0x3c9e20;};'use strict';var _=require(_0x989c('0x0'));var sequelize=require(_0x989c('0x1'));var moment=require(_0x989c('0x2'));var db=require(_0x989c('0x3'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3edea2){var _0x1d5ece=['ne'];try{var _0x44f38d=JSON[_0x989c('0x4')](_0x3edea2);var _0x2996f1=Object['keys'](_0x44f38d)[0x0];return _0x1d5ece['includes'](_0x2996f1);}catch(_0x56fcd7){return![];}}function getOperatorValue(_0x468096){var _0x45871e=JSON[_0x989c('0x4')](_0x468096);var _0x415bad=Object[_0x989c('0x5')](_0x45871e)[0x0];var _0x15bd83=_0x45871e[_0x415bad];return{['$'+_0x415bad]:_0x15bd83};}function parseIncludeModel(_0x5aa575){var _0x3aca65=JSON[_0x989c('0x4')](_0x5aa575);return{'model':db[_0x3aca65['model']],'as':_0x3aca65['alias'],'attributes':_0x3aca65[_0x989c('0x6')],'raw':_0x3aca65[_0x989c('0x7')]};}exports[_0x989c('0x6')]=function(_0x11d1b4){var _0x25cd8b=null;if(_0x11d1b4){_0x25cd8b=_0x11d1b4['split'](',');}return _0x25cd8b;};exports['filters']=function(_0xe4370d,_0x4837ff){var _0x522433={};if(!_['isEmpty'](_0xe4370d)){_[_0x989c('0x8')](_0xe4370d,function(_0x459101,_0x2db6c0){try{if(_0x4837ff){var _0x784fd3=_[_0x989c('0x9')](_0x4837ff,{'name':_0x2db6c0})||{};if(hasSequelizeOperator(_0x459101)){_0x522433[_0x2db6c0]=getOperatorValue(_0x459101);}else if(_0x784fd3[_0x989c('0xa')]===_0x989c('0xb')&&_['isPlainObject'](_0x459101)){var _0x4db588=JSON[_0x989c('0x4')](_0x459101);var _0x40259c={'$gte':moment(moment(_0x4db588[_0x989c('0xc')])[_0x989c('0xd')](_0x989c('0xe')))[_0x989c('0xf')]()[_0x989c('0xd')](),'$lte':moment(moment(_0x4db588[_0x989c('0x10')])[_0x989c('0xd')](_0x989c('0xe')))[_0x989c('0xf')]()['subtract'](0x1,'s')['format']()};_0x522433[_0x2db6c0]=_0x40259c;}else if(_0x784fd3['name']===_0x989c('0x11')){_0x522433[_0x2db6c0]=_0x459101;}else{_0x522433[_0x2db6c0]=_['isArray'](_0x459101)?_0x459101:JSON['parse'](_0x459101);}}else{_0x522433[_0x2db6c0]=_[_0x989c('0x12')](_0x459101)?_0x459101:JSON['parse'](_0x459101);}}catch(_0x156492){_0x522433[_0x2db6c0]=_0x459101['split'](',');}});}return _0x522433;};exports[_0x989c('0x13')]=function(_0x4011d7){_0x4011d7=parseInt(_0x4011d7,0xa);if(!_0x4011d7||_0x4011d7<0x0){_0x4011d7=LIMIT_VALUE;}return _0x4011d7;};exports[_0x989c('0x14')]=function(_0x14c37e){_0x14c37e=parseInt(_0x14c37e,0xa);if(!_0x14c37e||_0x14c37e<0x0){_0x14c37e=0x0;}return _0x14c37e;};exports[_0x989c('0x15')]=function(_0x38f9f3){var _0xdb13fc,_0x4ed901=null;if(_0x38f9f3){_0xdb13fc=_0x38f9f3['split'](',');_0x4ed901=_[_0x989c('0x16')](_0xdb13fc,function(_0x1ebded){if(_0x1ebded['indexOf']('-')===0x0){return[_0x1ebded===_0x989c('0x17')?sequelize[_0x989c('0x18')](sequelize[_0x989c('0x19')](_0x989c('0x17')),_0x989c('0x1a')):_0x1ebded['substr'](0x1),'DESC'];}else{return[_0x1ebded===_0x989c('0x17')?sequelize['cast'](sequelize[_0x989c('0x19')]('priority'),_0x989c('0x1a')):_0x1ebded,_0x989c('0x1b')];}});}return _0x4ed901;};exports['omit']=function(_0x3faec3,_0x3a50cc){if(_[_0x989c('0x1c')](_0x3faec3)){return _0x3faec3;}if(_[_0x989c('0x12')](_0x3faec3)){for(var _0x32cef8=0x0;_0x32cef8<_0x3faec3[_0x989c('0x1d')];_0x32cef8+=0x1){_0x3faec3[_0x32cef8]=this[_0x989c('0x1e')](_0x3faec3[_0x32cef8],_0x3a50cc);}return _0x3faec3;}if(!_[_0x989c('0x1f')](_0x3faec3)){return _0x3faec3;}if(_[_0x989c('0x20')](_0x3a50cc)){_0x3a50cc=[_0x3a50cc];}if(!_[_0x989c('0x12')](_0x3a50cc)){return _0x3faec3;}for(var _0x2812d4=0x0;_0x2812d4<_0x3a50cc['length'];_0x2812d4+=0x1){_['unset'](_0x3faec3,_0x3a50cc[_0x2812d4]);}for(var _0x557c7c in _0x3faec3){if(_0x3faec3[_0x989c('0x21')](_0x557c7c)){_0x3faec3[_0x557c7c]=this[_0x989c('0x1e')](_0x3faec3[_0x557c7c],_0x3a50cc);}}return _0x3faec3;};exports[_0x989c('0x22')]=function(_0x3306c8){return _0x3306c8[_0x989c('0x23')](RegExp(_0x989c('0x24')))?!![]:![];};exports[_0x989c('0x25')]=function(_0x311433){return _0x311433['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x989c('0x26')]=function(_0x27b309,_0x20530a){var _0x3b9bac=[];var _0x2c3b18=/[ `!@#$%^&*()_\-?~]/;var _0x3df2d4=_0x20530a?_0x989c('0x27'):_0x989c('0x28');_0x27b309[_0x989c('0x29')](/[ ,]+/)[_0x989c('0x2a')](function(_0x451e61){_0x451e61=_0x451e61[_0x989c('0x2b')](/([^:]")"+/g,'$1');_0x451e61='+'+_0x451e61+'*';var _0x216863=_0x451e61[_0x989c('0x23')](_0x2c3b18);if(_0x216863){_0x451e61='\x22'+_0x451e61+'\x22';}_0x3b9bac[_0x989c('0x2c')](_0x451e61);});_0x3df2d4=_0x3df2d4[_0x989c('0x2b')](_0x989c('0x28'),_0x3b9bac['join']('\x20'));return _0x3df2d4;};exports['getOptions']=function(_0x57309a,_0x95e2a3,_0x3b30c9){var _0x28cba5={},_0x50431a={};if(_0x95e2a3[_0x989c('0x2d')][_0x989c('0x2e')]){_0x95e2a3[_0x989c('0x2d')]['id']=_0x95e2a3[_0x989c('0x2d')][_0x989c('0x2e')];delete _0x95e2a3[_0x989c('0x2d')][_0x989c('0x2e')];}_0x28cba5[_0x989c('0x2f')]=_[_0x989c('0x16')](_0x57309a,_0x989c('0x30'));_0x28cba5[_0x989c('0x2d')]=_[_0x989c('0x5')](_0x95e2a3[_0x989c('0x2d')]);_0x28cba5['filters']=_[_0x989c('0x31')](_0x28cba5[_0x989c('0x2f')],_0x28cba5[_0x989c('0x2d')]);_0x50431a[_0x989c('0x32')]=_[_0x989c('0x31')](_0x28cba5[_0x989c('0x2f')],this[_0x989c('0x6')](_0x95e2a3['query'][_0x989c('0x6')]));_0x50431a[_0x989c('0x32')]=_0x50431a[_0x989c('0x32')][_0x989c('0x1d')]?_0x50431a['attributes']:_0x28cba5[_0x989c('0x2f')];if(!_0x95e2a3['query'][_0x989c('0x21')](_0x989c('0x33'))){_0x50431a['limit']=this[_0x989c('0x13')](_0x95e2a3[_0x989c('0x2d')][_0x989c('0x13')]);_0x50431a[_0x989c('0x14')]=this[_0x989c('0x14')](_0x95e2a3['query'][_0x989c('0x14')]);}_0x50431a[_0x989c('0x34')]=this[_0x989c('0x15')](_0x95e2a3[_0x989c('0x2d')][_0x989c('0x15')]);_0x50431a[_0x989c('0x35')]=this[_0x989c('0x36')](_[_0x989c('0x37')](_0x95e2a3[_0x989c('0x2d')],_0x28cba5[_0x989c('0x36')]),_0x57309a);if(_0x95e2a3[_0x989c('0x2d')][_0x989c('0x38')]){var _0x4cd4e4=_0x57309a;var _0x5bca11=_0x95e2a3[_0x989c('0x2d')][_0x989c('0x38')];if(typeof _0x5bca11===_0x989c('0x39')){_0x4cd4e4=_[_0x989c('0x38')](_0x57309a,function(_0x44b936){return _[_0x989c('0x3a')](_0x5bca11['columns'],_0x44b936[_0x989c('0x30')]);});_0x5bca11=_0x5bca11[_0x989c('0x3b')];}_0x50431a['where']=_[_0x989c('0x3c')](_0x50431a[_0x989c('0x35')],{'$or':_[_0x989c('0x16')](_0x4cd4e4,function(_0x2d1498){if(_0x2d1498[_0x989c('0xa')]!==_0x989c('0x3d')){if(_0x3b30c9){return sequelize['where'](sequelize['fn']('lower',sequelize[_0x989c('0x19')](_0x2d1498[_0x989c('0x30')])),{'$like':sequelize['fn']('lower','%'+_0x95e2a3[_0x989c('0x2d')][_0x989c('0x38')]+'%')});}else{var _0x5a1955={};_0x5a1955[_0x2d1498[_0x989c('0x30')]]={'$like':'%'+_0x95e2a3[_0x989c('0x2d')]['filter']+'%'};return _0x5a1955;}}})});}_0x50431a=_[_0x989c('0x3c')]({},_0x50431a,_0x95e2a3[_0x989c('0x3e')]);return _0x50431a;};exports[_0x989c('0x3f')]=function(_0x135b89){var _0x8934d0=[];if(_0x135b89[_0x989c('0x40')]){_0x8934d0['push']({'all':!![]});}else if(_0x135b89[_0x989c('0x3f')]){if(Array[_0x989c('0x12')](_0x135b89[_0x989c('0x3f')])){_0x8934d0=Object[_0x989c('0x5')](_0x135b89['include'])[_0x989c('0x16')](function(_0x49fca5){return parseIncludeModel(_0x135b89[_0x989c('0x3f')][_0x49fca5]);});}else{var _0x39db14=parseIncludeModel(_0x135b89[_0x989c('0x3f')]);_0x8934d0[_0x989c('0x2c')](_0x39db14);}}return _0x8934d0;}; \ No newline at end of file +var _0x7f05=['match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','getOptions','query','$id','model','filters','intersection','attributes','nolimit','limit','order','sort','where','pick','filter','object','columns','value','merge','type','lower','options','include','push','lodash','sequelize','moment','parse','keys','includes','alias','fields','raw','split','find','isPlainObject','$gte','format','subtract','name','isArray','offset','map','cast','priority','unsigned','substr','DESC','col','ASC','omit','isObject','isString','length','unset','hasOwnProperty'];(function(_0x4ab52d,_0x51ff1d){var _0x4e42d4=function(_0x51cca7){while(--_0x51cca7){_0x4ab52d['push'](_0x4ab52d['shift']());}};_0x4e42d4(++_0x51ff1d);}(_0x7f05,0xdc));var _0x57f0=function(_0x3bb4c9,_0x44300b){_0x3bb4c9=_0x3bb4c9-0x0;var _0x591f2f=_0x7f05[_0x3bb4c9];return _0x591f2f;};'use strict';var _=require(_0x57f0('0x0'));var sequelize=require(_0x57f0('0x1'));var moment=require(_0x57f0('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xc52af3){var _0x49238d=['ne'];try{var _0x2f3707=JSON[_0x57f0('0x3')](_0xc52af3);var _0x52bde5=Object[_0x57f0('0x4')](_0x2f3707)[0x0];return _0x49238d[_0x57f0('0x5')](_0x52bde5);}catch(_0x4c3a58){return![];}}function getOperatorValue(_0x27b8f6){var _0x295ad5=JSON['parse'](_0x27b8f6);var _0x434121=Object[_0x57f0('0x4')](_0x295ad5)[0x0];var _0x3f7ebc=_0x295ad5[_0x434121];return{['$'+_0x434121]:_0x3f7ebc};}function parseIncludeModel(_0x55d417){var _0x5b8d32=JSON[_0x57f0('0x3')](_0x55d417);return{'model':db[_0x5b8d32['model']],'as':_0x5b8d32[_0x57f0('0x6')],'attributes':_0x5b8d32[_0x57f0('0x7')],'raw':_0x5b8d32[_0x57f0('0x8')]};}exports[_0x57f0('0x7')]=function(_0x5a715b){var _0x4f61d3=null;if(_0x5a715b){_0x4f61d3=_0x5a715b[_0x57f0('0x9')](',');}return _0x4f61d3;};exports['filters']=function(_0x4b6aef,_0x50afee){var _0x523715={};if(!_['isEmpty'](_0x4b6aef)){_['forOwn'](_0x4b6aef,function(_0x1aa9c8,_0x148978){try{if(_0x50afee){var _0x5987ed=_[_0x57f0('0xa')](_0x50afee,{'name':_0x148978})||{};if(hasSequelizeOperator(_0x1aa9c8)){_0x523715[_0x148978]=getOperatorValue(_0x1aa9c8);}else if(_0x5987ed['type']==='DATE'&&_[_0x57f0('0xb')](_0x1aa9c8)){var _0x380859=JSON[_0x57f0('0x3')](_0x1aa9c8);var _0x2e57df={'$gte':moment(moment(_0x380859[_0x57f0('0xc')])[_0x57f0('0xd')]('YYYY-MM-DD'))['utc']()[_0x57f0('0xd')](),'$lte':moment(moment(_0x380859['$lte'])['format']('YYYY-MM-DD'))['utc']()[_0x57f0('0xe')](0x1,'s')[_0x57f0('0xd')]()};_0x523715[_0x148978]=_0x2e57df;}else if(_0x5987ed[_0x57f0('0xf')]==='uniqueid'){_0x523715[_0x148978]=_0x1aa9c8;}else{_0x523715[_0x148978]=_[_0x57f0('0x10')](_0x1aa9c8)?_0x1aa9c8:JSON[_0x57f0('0x3')](_0x1aa9c8);}}else{_0x523715[_0x148978]=_[_0x57f0('0x10')](_0x1aa9c8)?_0x1aa9c8:JSON['parse'](_0x1aa9c8);}}catch(_0x2e3d15){_0x523715[_0x148978]=_0x1aa9c8[_0x57f0('0x9')](',');}});}return _0x523715;};exports['limit']=function(_0x589c18){_0x589c18=parseInt(_0x589c18,0xa);if(!_0x589c18||_0x589c18<0x0){_0x589c18=LIMIT_VALUE;}return _0x589c18;};exports[_0x57f0('0x11')]=function(_0x1ce318){_0x1ce318=parseInt(_0x1ce318,0xa);if(!_0x1ce318||_0x1ce318<0x0){_0x1ce318=0x0;}return _0x1ce318;};exports['sort']=function(_0x28e659){var _0x558de7,_0x3a5b6f=null;if(_0x28e659){_0x558de7=_0x28e659[_0x57f0('0x9')](',');_0x3a5b6f=_[_0x57f0('0x12')](_0x558de7,function(_0x202dcb){if(_0x202dcb['indexOf']('-')===0x0){return[_0x202dcb==='priority'?sequelize[_0x57f0('0x13')](sequelize['col'](_0x57f0('0x14')),_0x57f0('0x15')):_0x202dcb[_0x57f0('0x16')](0x1),_0x57f0('0x17')];}else{return[_0x202dcb===_0x57f0('0x14')?sequelize[_0x57f0('0x13')](sequelize[_0x57f0('0x18')](_0x57f0('0x14')),'unsigned'):_0x202dcb,_0x57f0('0x19')];}});}return _0x3a5b6f;};exports['omit']=function(_0x563fa5,_0x43c975){if(_['isEmpty'](_0x563fa5)){return _0x563fa5;}if(_[_0x57f0('0x10')](_0x563fa5)){for(var _0x50347e=0x0;_0x50347e<_0x563fa5['length'];_0x50347e+=0x1){_0x563fa5[_0x50347e]=this[_0x57f0('0x1a')](_0x563fa5[_0x50347e],_0x43c975);}return _0x563fa5;}if(!_[_0x57f0('0x1b')](_0x563fa5)){return _0x563fa5;}if(_[_0x57f0('0x1c')](_0x43c975)){_0x43c975=[_0x43c975];}if(!_[_0x57f0('0x10')](_0x43c975)){return _0x563fa5;}for(var _0x1858ea=0x0;_0x1858ea<_0x43c975[_0x57f0('0x1d')];_0x1858ea+=0x1){_[_0x57f0('0x1e')](_0x563fa5,_0x43c975[_0x1858ea]);}for(var _0x43699b in _0x563fa5){if(_0x563fa5[_0x57f0('0x1f')](_0x43699b)){_0x563fa5[_0x43699b]=this[_0x57f0('0x1a')](_0x563fa5[_0x43699b],_0x43c975);}}return _0x563fa5;};exports['isNumeric']=function(_0x2c61af){return _0x2c61af[_0x57f0('0x20')](RegExp(_0x57f0('0x21')))?!![]:![];};exports[_0x57f0('0x22')]=function(_0x25c09e){return _0x25c09e[_0x57f0('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0x57f0('0x23')]=function(_0x40c45a,_0x43b97b){var _0x12da92=[];var _0x2c13cf=/[ `!@#$%^&*()_\-?~]/;var _0x249557=_0x43b97b?_0x57f0('0x24'):_0x57f0('0x25');_0x40c45a['split'](/[ ,]+/)[_0x57f0('0x26')](function(_0x31006a){_0x31006a=_0x31006a[_0x57f0('0x27')](/([^:]")"+/g,'$1');_0x31006a='+'+_0x31006a+'*';var _0x3751d7=_0x31006a['match'](_0x2c13cf);if(_0x3751d7){_0x31006a='\x22'+_0x31006a+'\x22';}_0x12da92['push'](_0x31006a);});_0x249557=_0x249557['replace'](_0x57f0('0x25'),_0x12da92['join']('\x20'));return _0x249557;};exports[_0x57f0('0x28')]=function(_0x29587a,_0x2f3f1b,_0x4d55b6){var _0x207668={},_0x277edf={};if(_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x2a')]){_0x2f3f1b[_0x57f0('0x29')]['id']=_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x2a')];delete _0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x2a')];}_0x207668[_0x57f0('0x2b')]=_[_0x57f0('0x12')](_0x29587a,_0x57f0('0xf'));_0x207668[_0x57f0('0x29')]=_[_0x57f0('0x4')](_0x2f3f1b[_0x57f0('0x29')]);_0x207668[_0x57f0('0x2c')]=_[_0x57f0('0x2d')](_0x207668[_0x57f0('0x2b')],_0x207668[_0x57f0('0x29')]);_0x277edf['attributes']=_['intersection'](_0x207668[_0x57f0('0x2b')],this[_0x57f0('0x7')](_0x2f3f1b[_0x57f0('0x29')]['fields']));_0x277edf[_0x57f0('0x2e')]=_0x277edf[_0x57f0('0x2e')][_0x57f0('0x1d')]?_0x277edf[_0x57f0('0x2e')]:_0x207668[_0x57f0('0x2b')];if(!_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x1f')](_0x57f0('0x2f'))){_0x277edf[_0x57f0('0x30')]=this['limit'](_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x30')]);_0x277edf[_0x57f0('0x11')]=this[_0x57f0('0x11')](_0x2f3f1b['query'][_0x57f0('0x11')]);}_0x277edf[_0x57f0('0x31')]=this['sort'](_0x2f3f1b[_0x57f0('0x29')][_0x57f0('0x32')]);_0x277edf[_0x57f0('0x33')]=this[_0x57f0('0x2c')](_[_0x57f0('0x34')](_0x2f3f1b[_0x57f0('0x29')],_0x207668[_0x57f0('0x2c')]),_0x29587a);if(_0x2f3f1b['query'][_0x57f0('0x35')]){var _0x4e0abe=_0x29587a;var _0x3dd680=_0x2f3f1b['query'][_0x57f0('0x35')];if(typeof _0x3dd680===_0x57f0('0x36')){_0x4e0abe=_[_0x57f0('0x35')](_0x29587a,function(_0x3564ef){return _[_0x57f0('0x5')](_0x3dd680[_0x57f0('0x37')],_0x3564ef[_0x57f0('0xf')]);});_0x3dd680=_0x3dd680[_0x57f0('0x38')];}_0x277edf[_0x57f0('0x33')]=_[_0x57f0('0x39')](_0x277edf[_0x57f0('0x33')],{'$or':_['map'](_0x4e0abe,function(_0x16cb8d){if(_0x16cb8d[_0x57f0('0x3a')]!=='VIRTUAL'){if(_0x4d55b6){return sequelize['where'](sequelize['fn'](_0x57f0('0x3b'),sequelize['col'](_0x16cb8d[_0x57f0('0xf')])),{'$like':sequelize['fn'](_0x57f0('0x3b'),'%'+_0x2f3f1b[_0x57f0('0x29')]['filter']+'%')});}else{var _0x4069cd={};_0x4069cd[_0x16cb8d[_0x57f0('0xf')]]={'$like':'%'+_0x2f3f1b['query'][_0x57f0('0x35')]+'%'};return _0x4069cd;}}})});}_0x277edf=_[_0x57f0('0x39')]({},_0x277edf,_0x2f3f1b[_0x57f0('0x3c')]);return _0x277edf;};exports[_0x57f0('0x3d')]=function(_0x478246){var _0x2f9dcb=[];if(_0x478246['includeAll']){_0x2f9dcb[_0x57f0('0x3e')]({'all':!![]});}else if(_0x478246[_0x57f0('0x3d')]){if(Array['isArray'](_0x478246[_0x57f0('0x3d')])){_0x2f9dcb=Object['keys'](_0x478246[_0x57f0('0x3d')])['map'](function(_0x242189){return parseIncludeModel(_0x478246['include'][_0x242189]);});}else{var _0x4c6eb1=parseIncludeModel(_0x478246[_0x57f0('0x3d')]);_0x2f9dcb[_0x57f0('0x3e')](_0x4c6eb1);}}return _0x2f9dcb;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 6f39f09..6476af8 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 _0x8852=['fullname','internal','substring','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','mailPause','omit','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','smsPause','voicePause','every','length','unknown','unavailable','ringing','isNil','voiceStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','all','flatten','uniq','value','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','User','findAll','name','openchannelPause','whatsappPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','DESC','ASC','getUpdatedSortOptions'];(function(_0x124e8c,_0x28b175){var _0x311c78=function(_0xb1dda5){while(--_0xb1dda5){_0x124e8c['push'](_0x124e8c['shift']());}};_0x311c78(++_0x28b175);}(_0x8852,0x84));var _0x2885=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x8852[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x2885('0x0'));var jayson=require(_0x2885('0x1'));var db=require(_0x2885('0x2'))['db'];var amiClient=jayson[_0x2885('0x3')][_0x2885('0x4')]({'port':0x232a});var routingClient=jayson[_0x2885('0x3')][_0x2885('0x4')]({'port':0x232c});function isAgentPaused(_0x86ac8c,_0x296395){var _0x341636=[_0x86ac8c[_0x2885('0x5')],_0x86ac8c[_0x2885('0x6')],_0x86ac8c['mailPause'],_0x86ac8c['openchannelPause'],_0x86ac8c[_0x2885('0x7')],_0x86ac8c[_0x2885('0x8')],_0x86ac8c['whatsappPause']];if(!_0x296395)return _[_0x2885('0x9')](_0x341636);var _0x39e443=_['filter'](_0x341636);return _0x39e443[_0x2885('0xa')]>0x0&&_0x39e443[_0x2885('0xa')]<_0x341636[_0x2885('0xa')]?!![]:![];}function isIdle(_0x263b9c){return _0x263b9c==='idle'||_0x263b9c===_0x2885('0xb')||_0x263b9c===_0x2885('0xc')||_0x263b9c===_0x2885('0xd')||_[_0x2885('0xe')](_0x263b9c);}function isAgentIdle(_0x4fe982){if(_0x4fe982['voiceStatus']!=='idle'&&_0x4fe982[_0x2885('0x8')]){_0x4fe982[_0x2885('0xf')]='pause';return![];}return _[_0x2885('0x9')]([_0x4fe982['chatStatus'],_0x4fe982[_0x2885('0x10')],_0x4fe982[_0x2885('0x11')],_0x4fe982[_0x2885('0x12')],_0x4fe982[_0x2885('0x13')],_0x4fe982[_0x2885('0xf')],_0x4fe982['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0x2885('0x14')](_0x2885('0x15'),{})[_0x2885('0x16')](function(_0x21d606){if(_0x21d606[_0x2885('0x17')]){throw new Error(_0x2885('0x18'));}var _0x102fb2=_0x21d606['result'];return routingClient['request']('Agents',{})['then'](function(_0x434938){if(_0x434938['error']){throw new Error(_0x2885('0x19'));}var _0x1d0141=_0x434938[_0x2885('0x1a')];return _[_0x2885('0x1b')]({},_0x102fb2,_0x1d0141);});})[_0x2885('0x1c')](function(_0x21a2e8){throw _0x21a2e8;});}exports[_0x2885('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x3a925a){var _0x191b16='unknown';if(isAgentPaused(_0x3a925a))_0x191b16=_0x2885('0x1e');else if(isAgentPaused(_0x3a925a,!![]))_0x191b16=_0x2885('0x1f');else if(isAgentIdle(_0x3a925a))_0x191b16='idle';else _0x191b16=_0x2885('0x20');return _0x191b16;}exports[_0x2885('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x49e6b7,_0xf0266c){var _0x120d70=_[_0x2885('0x22')](_0x49e6b7)?_0x49e6b7:[_0x49e6b7];var _0x2e1561=_[_0x2885('0x23')](_0xf0266c)+_0x2885('0x24');var _0x30deb5=_[_0x2885('0x25')](_0x120d70,function(_0xba565b){return db[_0x2e1561]['findOne']({'where':{'id':_0xba565b}})[_0x2885('0x16')](function(_0x2a9de4){if(!_0x2a9de4)return[];return _0x2a9de4['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x2885('0x26')](_0x30deb5)[_0x2885('0x16')](function(_0x96fa54){var _0x1e778d=_(_0x96fa54)[_0x2885('0x27')]()[_0x2885('0x25')]('id')[_0x2885('0x28')]()[_0x2885('0x29')]();return _0x1e778d;});}exports[_0x2885('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x52e88f,_0x5d65d5,_0x24f72c){try{if(_0x5d65d5[_0x2885('0xa')]>0x0){_0x52e88f=_0x52e88f[_0x2885('0x2b')](function(_0x272222){return _0x5d65d5[_0x2885('0x2c')](_0x272222['id']);});}var _0x5dc0fb=_0x52e88f[_0x2885('0x2b')](function(_0x6f296e){var _0x5e01f6='busy';if(isAgentIdle(_0x6f296e)){_0x5e01f6='idle';}return _0x5e01f6===_0x24f72c;});return _[_0x2885('0x25')](_0x5dc0fb,'id');}catch(_0x4ff255){throw _0x4ff255;}}exports[_0x2885('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x511211,_0x18ba9b,_0x41c4e4){return Promise[_0x2885('0x2e')]()['then'](function(){if(_0x18ba9b[_0x2885('0xa')]>0x0){_0x511211=_0x511211[_0x2885('0x2b')](function(_0x1f922d){return _0x18ba9b['includes'](_0x1f922d['id']);});}return _0x511211;})['then'](function(){return db[_0x2885('0x2f')][_0x2885('0x30')]({'attributes':['id',_0x2885('0x31'),'fullname',_0x2885('0x5'),'faxPause','mailPause',_0x2885('0x32'),_0x2885('0x7'),'voicePause',_0x2885('0x33'),_0x2885('0x34')],'where':{'id':{'$in':_[_0x2885('0x25')](_0x511211,'id')}},'raw':!![]});})[_0x2885('0x16')](function(_0x56ccad){return _0x56ccad[_0x2885('0x25')](function(_0x102af2){var _0x4e93a1=_[_0x2885('0x35')](_0x511211,['id',_0x102af2['id']]);var _0x5a5583=filterAgentAttributes(_0x4e93a1);_[_0x2885('0x1b')](_0x102af2,_0x5a5583);_0x102af2[_0x2885('0x36')]=getAgentStatus(_0x102af2);return _0x102af2;});})[_0x2885('0x16')](function(_0x50fe3c){var _0xf02def=sortAgentsByStatus(_0x50fe3c,_0x41c4e4);return _[_0x2885('0x25')](_0xf02def,'id');})['catch'](function(_0x56b631){throw _0x56b631;});}exports[_0x2885('0x37')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x34d3b2){var _0x80a69={'fields':[],'order':null};var _0x383e9d=_0x34d3b2[_0x2885('0x38')](',');_0x80a69[_0x2885('0x39')]=_[_0x2885('0x2b')](_0x383e9d,function(_0x34c190){if(!_0x34c190[_0x2885('0x2c')]('globalStatus')){return!![];}_0x80a69[_0x2885('0x3a')]=_['startsWith'](_0x34c190,'-')?_0x2885('0x3b'):_0x2885('0x3c');return![];});return _0x80a69;}exports[_0x2885('0x3d')]=getUpdatedSortOptions;function validateSortParameter(_0x552a0a){if(!_0x552a0a){_0x552a0a='fullname,internal';}if(_0x552a0a['includes'](_0x2885('0x3e'))&&!_0x552a0a['includes'](_0x2885('0x3f'))){var _0x529d89=_0x552a0a[_0x2885('0x40')](0x0,_0x552a0a['indexOf'](_0x2885('0x3e')));_0x552a0a+=','+_0x529d89+'internal';}return _0x552a0a;}exports[_0x2885('0x41')]=validateSortParameter;function sortAgentsByStatus(_0x2f10e5,_0x2210d0){var _0x5219ea=_0x2f10e5['sort'](function(_0x35ef18,_0x4cb058){if(_0x35ef18['globalStatus']===_0x4cb058['globalStatus']){if(_0x35ef18[_0x2885('0x36')]===_0x2885('0x1e')){if(_0x2210d0===_0x2885('0x3b')){return(_0x35ef18[_0x2885('0x34')]||'')<(_0x4cb058[_0x2885('0x34')]||'')||_0x35ef18[_0x2885('0x3e')][_0x2885('0x42')]()>_0x4cb058[_0x2885('0x3e')][_0x2885('0x42')]()?0x1:-0x1;}else{return(_0x35ef18[_0x2885('0x34')]||'')<(_0x4cb058[_0x2885('0x34')]||'')||_0x35ef18[_0x2885('0x3e')][_0x2885('0x42')]()>_0x4cb058[_0x2885('0x3e')][_0x2885('0x42')]()?-0x1:0x1;}}else{if(_0x2210d0===_0x2885('0x3b')){return _0x35ef18[_0x2885('0x3e')][_0x2885('0x42')]()<_0x4cb058[_0x2885('0x3e')][_0x2885('0x42')]()?0x1:-0x1;}else{return _0x35ef18[_0x2885('0x3e')]['toLowerCase']()<_0x4cb058[_0x2885('0x3e')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x2210d0===_0x2885('0x3b')){return _0x35ef18[_0x2885('0x36')]<_0x4cb058[_0x2885('0x36')]?0x1:-0x1;}else{return _0x35ef18[_0x2885('0x36')]<_0x4cb058[_0x2885('0x36')]?-0x1:0x1;}}});return _0x5219ea;}exports[_0x2885('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x262153){var _0x30df47=[_0x2885('0x44'),_0x2885('0x45'),_0x2885('0x46'),'lastPauseAt',_0x2885('0x34'),_0x2885('0x47'),'internal','address',_0x2885('0x5'),_0x2885('0x32'),'mailPause',_0x2885('0x7'),_0x2885('0x33'),_0x2885('0x6'),_0x2885('0x8'),_0x2885('0x48'),'openchannelCapacity','mailCapacity',_0x2885('0x49'),_0x2885('0x4a'),'faxCapacity',_0x2885('0x4b'),_0x2885('0x4c'),_0x2885('0x4d'),_0x2885('0x4e'),_0x2885('0x4f'),_0x2885('0x50'),_0x2885('0x51'),_0x2885('0x12'),'mailStatus','smsStatus',_0x2885('0x52'),'faxStatus',_0x2885('0xf'),_0x2885('0x53'),_0x2885('0x54'),_0x2885('0x55'),'smsStatusTime',_0x2885('0x56'),_0x2885('0x57'),_0x2885('0x58'),'queue','destconnectedlinenum',_0x2885('0x59'),_0x2885('0x5a'),_0x2885('0x5b'),_0x2885('0x5c')];var _0x3fa2a8=[_0x2885('0x5'),_0x2885('0x32'),_0x2885('0x5d'),_0x2885('0x7'),_0x2885('0x33'),_0x2885('0x6'),_0x2885('0x8'),_0x2885('0x45')];var _0x240de=_(_0x262153)[_0x2885('0x5e')](_0x3fa2a8)[_0x2885('0x5f')](_0x30df47)[_0x2885('0x29')]();return _0x240de;}exports[_0x2885('0x60')]=filterAgentAttributes; \ No newline at end of file +var _0x19b7=['Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','unknown','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','smsPause','whatsappPause','pauseType','merge','split','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','validateSortParameter','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','jayson/promise','client','http','chatPause','faxPause','mailPause','voicePause','every','filter','length','unavailable','ringing','isNil','voiceStatus','idle','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x19b7,0xfc));var _0x719b=function(_0x299ca8,_0x4e74fa){_0x299ca8=_0x299ca8-0x0;var _0x5dbd44=_0x19b7[_0x299ca8];return _0x5dbd44;};'use strict';var _=require('lodash');var jayson=require(_0x719b('0x0'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x719b('0x1')][_0x719b('0x2')]({'port':0x232a});var routingClient=jayson[_0x719b('0x1')][_0x719b('0x2')]({'port':0x232c});function isAgentPaused(_0x354e20,_0x4bfa57){var _0x2a7cb2=[_0x354e20[_0x719b('0x3')],_0x354e20[_0x719b('0x4')],_0x354e20[_0x719b('0x5')],_0x354e20['openchannelPause'],_0x354e20['smsPause'],_0x354e20[_0x719b('0x6')],_0x354e20['whatsappPause']];if(!_0x4bfa57)return _[_0x719b('0x7')](_0x2a7cb2);var _0x544ada=_[_0x719b('0x8')](_0x2a7cb2);return _0x544ada['length']>0x0&&_0x544ada[_0x719b('0x9')]<_0x2a7cb2['length']?!![]:![];}function isIdle(_0x240fc6){return _0x240fc6==='idle'||_0x240fc6==='unknown'||_0x240fc6===_0x719b('0xa')||_0x240fc6===_0x719b('0xb')||_[_0x719b('0xc')](_0x240fc6);}function isAgentIdle(_0x4bdaea){if(_0x4bdaea[_0x719b('0xd')]!==_0x719b('0xe')&&_0x4bdaea[_0x719b('0x6')]){_0x4bdaea[_0x719b('0xd')]=_0x719b('0xf');return![];}return _[_0x719b('0x7')]([_0x4bdaea[_0x719b('0x10')],_0x4bdaea['faxStatus'],_0x4bdaea[_0x719b('0x11')],_0x4bdaea[_0x719b('0x12')],_0x4bdaea[_0x719b('0x13')],_0x4bdaea[_0x719b('0xd')],_0x4bdaea[_0x719b('0x14')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x719b('0x15')](_0x719b('0x16'),{})[_0x719b('0x17')](function(_0x246fd0){if(_0x246fd0[_0x719b('0x18')]){throw new Error(_0x719b('0x19'));}var _0x9d610c=_0x246fd0[_0x719b('0x1a')];return routingClient['request']('Agents',{})[_0x719b('0x17')](function(_0x392f71){if(_0x392f71[_0x719b('0x18')]){throw new Error(_0x719b('0x1b'));}var _0x1e4a62=_0x392f71[_0x719b('0x1a')];return _['merge']({},_0x9d610c,_0x1e4a62);});})[_0x719b('0x1c')](function(_0x5eec99){throw _0x5eec99;});}exports[_0x719b('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x386667){var _0x5adef4=_0x719b('0x1e');if(isAgentPaused(_0x386667))_0x5adef4='pause';else if(isAgentPaused(_0x386667,!![]))_0x5adef4='*pause';else if(isAgentIdle(_0x386667))_0x5adef4='idle';else _0x5adef4=_0x719b('0x1f');return _0x5adef4;}exports[_0x719b('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x470d62,_0x437462){var _0x48d70e=_[_0x719b('0x21')](_0x470d62)?_0x470d62:[_0x470d62];var _0x5ca405=_['startCase'](_0x437462)+_0x719b('0x22');var _0x471bc4=_[_0x719b('0x23')](_0x48d70e,function(_0x5033f6){return db[_0x5ca405][_0x719b('0x24')]({'where':{'id':_0x5033f6}})[_0x719b('0x17')](function(_0x270dd0){if(!_0x270dd0)return[];return _0x270dd0[_0x719b('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x719b('0x26')](_0x471bc4)[_0x719b('0x17')](function(_0x432cb5){var _0x5e9f3d=_(_0x432cb5)[_0x719b('0x27')]()['map']('id')['uniq']()[_0x719b('0x28')]();return _0x5e9f3d;});}exports[_0x719b('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x8e00ea,_0x1cf2c7,_0x2ed1b1){try{if(_0x1cf2c7[_0x719b('0x9')]>0x0){_0x8e00ea=_0x8e00ea['filter'](function(_0x21ab15){return _0x1cf2c7[_0x719b('0x2a')](_0x21ab15['id']);});}var _0x341c29=_0x8e00ea['filter'](function(_0x3599c5){var _0x26d4f1=_0x719b('0x1f');if(isAgentIdle(_0x3599c5)){_0x26d4f1='idle';}return _0x26d4f1===_0x2ed1b1;});return _[_0x719b('0x23')](_0x341c29,'id');}catch(_0x5dcaba){throw _0x5dcaba;}}exports[_0x719b('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xfcf4ec,_0x21a458,_0x45e435){return Promise[_0x719b('0x2c')]()[_0x719b('0x17')](function(){if(_0x21a458[_0x719b('0x9')]>0x0){_0xfcf4ec=_0xfcf4ec[_0x719b('0x8')](function(_0x371df5){return _0x21a458[_0x719b('0x2a')](_0x371df5['id']);});}return _0xfcf4ec;})[_0x719b('0x17')](function(){return db[_0x719b('0x2d')][_0x719b('0x2e')]({'attributes':['id',_0x719b('0x2f'),_0x719b('0x30'),_0x719b('0x3'),_0x719b('0x4'),_0x719b('0x5'),'openchannelPause',_0x719b('0x31'),_0x719b('0x6'),_0x719b('0x32'),_0x719b('0x33')],'where':{'id':{'$in':_[_0x719b('0x23')](_0xfcf4ec,'id')}},'raw':!![]});})[_0x719b('0x17')](function(_0xfa76f8){return _0xfa76f8[_0x719b('0x23')](function(_0x349c7d){var _0xc000dc=_['find'](_0xfcf4ec,['id',_0x349c7d['id']]);var _0x58c774=filterAgentAttributes(_0xc000dc);_[_0x719b('0x34')](_0x349c7d,_0x58c774);_0x349c7d['globalStatus']=getAgentStatus(_0x349c7d);return _0x349c7d;});})['then'](function(_0x1d6c73){var _0x829bd6=sortAgentsByStatus(_0x1d6c73,_0x45e435);return _['map'](_0x829bd6,'id');})[_0x719b('0x1c')](function(_0x347e51){throw _0x347e51;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2e5c36){var _0x1fb7ac={'fields':[],'order':null};var _0x3fab09=_0x2e5c36[_0x719b('0x35')](',');_0x1fb7ac['fields']=_[_0x719b('0x8')](_0x3fab09,function(_0x5016c6){if(!_0x5016c6[_0x719b('0x2a')]('globalStatus')){return!![];}_0x1fb7ac[_0x719b('0x36')]=_[_0x719b('0x37')](_0x5016c6,'-')?_0x719b('0x38'):_0x719b('0x39');return![];});return _0x1fb7ac;}exports[_0x719b('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x51f800){if(!_0x51f800){_0x51f800=_0x719b('0x3b');}if(_0x51f800['includes']('fullname')&&!_0x51f800['includes'](_0x719b('0x3c'))){var _0x23048d=_0x51f800[_0x719b('0x3d')](0x0,_0x51f800['indexOf'](_0x719b('0x30')));_0x51f800+=','+_0x23048d+_0x719b('0x3c');}return _0x51f800;}exports[_0x719b('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x35f250,_0x597bca){var _0xb47d28=_0x35f250[_0x719b('0x3f')](function(_0x297d39,_0x574858){if(_0x297d39[_0x719b('0x40')]===_0x574858[_0x719b('0x40')]){if(_0x297d39[_0x719b('0x40')]===_0x719b('0xf')){if(_0x597bca==='DESC'){return(_0x297d39[_0x719b('0x33')]||'')<(_0x574858[_0x719b('0x33')]||'')||_0x297d39['fullname']['toLowerCase']()>_0x574858['fullname'][_0x719b('0x41')]()?0x1:-0x1;}else{return(_0x297d39[_0x719b('0x33')]||'')<(_0x574858[_0x719b('0x33')]||'')||_0x297d39['fullname'][_0x719b('0x41')]()>_0x574858[_0x719b('0x30')][_0x719b('0x41')]()?-0x1:0x1;}}else{if(_0x597bca===_0x719b('0x38')){return _0x297d39[_0x719b('0x30')][_0x719b('0x41')]()<_0x574858[_0x719b('0x30')][_0x719b('0x41')]()?0x1:-0x1;}else{return _0x297d39[_0x719b('0x30')][_0x719b('0x41')]()<_0x574858[_0x719b('0x30')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x597bca===_0x719b('0x38')){return _0x297d39[_0x719b('0x40')]<_0x574858['globalStatus']?0x1:-0x1;}else{return _0x297d39[_0x719b('0x40')]<_0x574858['globalStatus']?-0x1:0x1;}}});return _0xb47d28;}exports[_0x719b('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x4a5b7d){var _0x120a5a=[_0x719b('0x43'),_0x719b('0x44'),_0x719b('0x45'),_0x719b('0x46'),'pauseType','lastPauseAt','internal',_0x719b('0x47'),_0x719b('0x3'),'openchannelPause',_0x719b('0x5'),_0x719b('0x31'),_0x719b('0x32'),_0x719b('0x4'),_0x719b('0x6'),'chatCapacity','openchannelCapacity','mailCapacity',_0x719b('0x48'),_0x719b('0x49'),_0x719b('0x4a'),_0x719b('0x4b'),_0x719b('0x4c'),_0x719b('0x4d'),_0x719b('0x4e'),_0x719b('0x4f'),'faxCurrentCapacity','chatStatus',_0x719b('0x12'),_0x719b('0x11'),_0x719b('0x13'),_0x719b('0x14'),'faxStatus',_0x719b('0xd'),_0x719b('0x50'),_0x719b('0x51'),_0x719b('0x52'),_0x719b('0x53'),_0x719b('0x54'),_0x719b('0x55'),'voiceStatusTime',_0x719b('0x56'),_0x719b('0x57'),'screenrecording',_0x719b('0x58'),_0x719b('0x59'),'routealias'];var _0x25142d=[_0x719b('0x3'),'openchannelPause',_0x719b('0x5'),_0x719b('0x31'),'whatsappPause',_0x719b('0x4'),_0x719b('0x6'),'online'];var _0x3a255e=_(_0x4a5b7d)[_0x719b('0x5a')](_0x25142d)[_0x719b('0x5b')](_0x120a5a)[_0x719b('0x28')]();return _0x3a255e;}exports[_0x719b('0x5c')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 86827ba..17716c7 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 _0x22e1=['talking','unavailable','unknown','originated','message','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','getRealtimeQueues','voice','inbound','concat','outbound','map','get','loggedInDb','available','merge','pick','lodash','http','client','loggedIn','paused','waiting','busy','notInUse','onHold','ringInUse'];(function(_0x699871,_0x2b7b43){var _0x1de521=function(_0x115dab){while(--_0x115dab){_0x699871['push'](_0x699871['shift']());}};_0x1de521(++_0x2b7b43);}(_0x22e1,0x179));var _0x122e=function(_0x451cca,_0x2f5278){_0x451cca=_0x451cca-0x0;var _0x340d9c=_0x22e1[_0x451cca];return _0x340d9c;};'use strict';var _=require(_0x122e('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson['client'][_0x122e('0x1')]({'port':0x232a});var routingClient=jayson[_0x122e('0x2')][_0x122e('0x1')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x122e('0x3'),_0x122e('0x4'),_0x122e('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x122e('0x6'),'inUse','invalid','loggedInDb',_0x122e('0x7'),_0x122e('0x8'),'ringing',_0x122e('0x9'),_0x122e('0xa'),_0x122e('0xb'),_0x122e('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x122e('0xd'),_0x122e('0xe'),'statusMessage',_0x122e('0xf'),'dialMethod',_0x122e('0x10'),_0x122e('0x11'),_0x122e('0x12'),_0x122e('0x13'),'erlangCallToSecond',_0x122e('0x14'),_0x122e('0x15'),_0x122e('0x16'),'dialPredictiveIntervalMaxThreshold',_0x122e('0x17'),_0x122e('0x18'),_0x122e('0x19'),'predictiveIntervalAnsweredCalls',_0x122e('0x1a'),_0x122e('0x1b'),_0x122e('0x1c'),_0x122e('0x1d')];function getRealtimeQueues(_0x3b9dab,_0x397850){var _0x295598=_0x397850==='voice'?amiClient:routingClient;return _0x295598[_0x122e('0x1e')](_[_0x122e('0x1f')](_0x397850)+'Queues',_0x3b9dab)['then'](function(_0x3abeca){if(_0x3abeca['error'])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x397850));return _0x3abeca['result'];})['catch'](function(_0x1dab10){throw _0x1dab10;});}exports[_0x122e('0x20')]=getRealtimeQueues;function initializeQueues(_0x4c6314,_0xcc6172,_0xac9f29,_0x4d6481){var _0x42a855=DEFAULT_QUEUE_ATTRIBUTES;if(_0xac9f29===_0x122e('0x21')){if(_0x4d6481===_0x122e('0x22')){_0x42a855=_0x42a855[_0x122e('0x23')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4d6481===_0x122e('0x24')){_0x42a855=_0x42a855[_0x122e('0x23')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4c6314[_0x122e('0x25')](function(_0x2f8d57){var _0x1f1267=_0x2f8d57[_0x122e('0x26')]({'plain':!![]});_0x1f1267[_0x122e('0x4')]=0x0;_0x1f1267[_0x122e('0x27')]=0x0;_0x1f1267[_0x122e('0x3')]=0x0;_0x1f1267[_0x122e('0x28')]=0x0;_0x1f1267[_0x122e('0x5')]=0x0;if(_0xac9f29==='voice'){_0x1f1267['talking']=0x0;_0x1f1267['busy']=0x0;if(_0x4d6481==='outbound'){_0x1f1267['pTalking']=0x0;_0x1f1267[_0x122e('0xd')]=0x0;}}var _0x473c81=_['find'](_0xcc6172,['id',_0x1f1267['id']]);if(_0x473c81){_[_0x122e('0x29')](_0x1f1267,_[_0x122e('0x2a')](_0x473c81,_0x42a855));}return _0x1f1267;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file +var _0xe045=['predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','get','waiting','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','busy','inUse','invalid','loggedInDb','onHold','ringing','ringInUse','talking','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xe045,0xb2));var _0x5e04=function(_0x46479c,_0x38b4b0){_0x46479c=_0x46479c-0x0;var _0x583767=_0xe045[_0x46479c];return _0x583767;};'use strict';var _=require(_0x5e04('0x0'));var jayson=require(_0x5e04('0x1'));var util=require(_0x5e04('0x2'));var amiClient=jayson[_0x5e04('0x3')][_0x5e04('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x5e04('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x5e04('0x5'),'loggedIn','paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x5e04('0x6'),_0x5e04('0x7'),_0x5e04('0x8'),_0x5e04('0x9'),'notInUse',_0x5e04('0xa'),_0x5e04('0xb'),_0x5e04('0xc'),_0x5e04('0xd'),'unavailable',_0x5e04('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x5e04('0xf'),_0x5e04('0x10'),_0x5e04('0x11'),_0x5e04('0x12'),_0x5e04('0x13'),_0x5e04('0x14'),_0x5e04('0x15'),_0x5e04('0x16'),_0x5e04('0x17'),_0x5e04('0x18'),'erlangCallToSecond',_0x5e04('0x19'),_0x5e04('0x1a'),_0x5e04('0x1b'),_0x5e04('0x1c'),'dialPredictiveIntervalMinThreshold',_0x5e04('0x1d'),'predictiveIntervalTotalCalls',_0x5e04('0x1e'),_0x5e04('0x1f'),_0x5e04('0x20'),_0x5e04('0x21'),_0x5e04('0x22')];function getRealtimeQueues(_0x248885,_0x21658b){var _0x417eb9=_0x21658b===_0x5e04('0x23')?amiClient:routingClient;return _0x417eb9[_0x5e04('0x24')](_['startCase'](_0x21658b)+'Queues',_0x248885)['then'](function(_0x43018){if(_0x43018[_0x5e04('0x25')])throw new Error(util[_0x5e04('0x26')](_0x5e04('0x27'),_0x21658b));return _0x43018[_0x5e04('0x28')];})['catch'](function(_0x549064){throw _0x549064;});}exports[_0x5e04('0x29')]=getRealtimeQueues;function initializeQueues(_0x5f01a0,_0x502083,_0x5e30e1,_0x50a71e){var _0x34a933=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5e30e1===_0x5e04('0x23')){if(_0x50a71e===_0x5e04('0x2a')){_0x34a933=_0x34a933[_0x5e04('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x50a71e===_0x5e04('0x2c')){_0x34a933=_0x34a933['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5f01a0[_0x5e04('0x2d')](function(_0x489913){var _0x13fd30=_0x489913[_0x5e04('0x2e')]({'plain':!![]});_0x13fd30['paused']=0x0;_0x13fd30[_0x5e04('0x9')]=0x0;_0x13fd30['loggedIn']=0x0;_0x13fd30[_0x5e04('0x5')]=0x0;_0x13fd30[_0x5e04('0x2f')]=0x0;if(_0x5e30e1==='voice'){_0x13fd30[_0x5e04('0xd')]=0x0;_0x13fd30['busy']=0x0;if(_0x50a71e===_0x5e04('0x2c')){_0x13fd30[_0x5e04('0xf')]=0x0;_0x13fd30['originated']=0x0;}}var _0x231e88=_[_0x5e04('0x30')](_0x502083,['id',_0x13fd30['id']]);if(_0x231e88){_[_0x5e04('0x31')](_0x13fd30,_[_0x5e04('0x32')](_0x231e88,_0x34a933));}return _0x13fd30;});}exports[_0x5e04('0x33')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 35fe84c..bb5db8a 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(_0x1bda6c,_0x5440b1){var _0x501a86=function(_0x1de54c){while(--_0x1de54c){_0x1bda6c['push'](_0x1bda6c['shift']());}};_0x501a86(++_0x5440b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 1611733..66a503b 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 _0x4335=['getFirstInterface','cpus','map','join','md5','update','digest','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x4335,0x1e7));var _0x5433=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x4335[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x5433('0x0'));var os=require('os');var crypto=require(_0x5433('0x1'));var machine=require(_0x5433('0x2'));var exec=require(_0x5433('0x3'))[_0x5433('0x4')];var config=require(_0x5433('0x5'));function getInterfaces(){var _0x1ddd00=[];var _0x4e9da8=os[_0x5433('0x6')]();var _0x3c2ba4=_[_0x5433('0x7')](_[_0x5433('0x8')](_0x4e9da8));for(var _0x4ac69a=0x0;_0x4ac69a<_0x3c2ba4[_0x5433('0x9')];_0x4ac69a++){var _0x3b9b74=_0x4e9da8[_0x3c2ba4[_0x4ac69a]][_0x5433('0xa')](function(_0x20a638){return _0x20a638[_0x5433('0xb')]===_0x5433('0xc')&&_0x20a638[_0x5433('0xd')]===![];});_0x1ddd00=_0x1ddd00[_0x5433('0xe')](_0x3b9b74);}return _0x1ddd00;}function getFirstInterface(){var _0x4cca31=_[_0x5433('0xf')](getInterfaces());return{'macAddress':_0x4cca31&&_0x4cca31[_0x5433('0x10')]?_0x4cca31[_0x5433('0x10')]:_0x5433('0x11'),'ipAddress':_0x4cca31&&_0x4cca31[_0x5433('0x12')]?_0x4cca31[_0x5433('0x12')]:_0x5433('0x13')};}exports[_0x5433('0x14')]=getFirstInterface;function getCPUhash(){var _0x19da74=_['orderBy'](os[_0x5433('0x15')]()[_0x5433('0x16')](function(_0x5cbc30){return _0x5cbc30['model'];}))[_0x5433('0x17')](':');return crypto['createHash'](_0x5433('0x18'))[_0x5433('0x19')](_0x19da74)[_0x5433('0x1a')]('hex');}exports[_0x5433('0x1b')]=function(){var _0x4d6ced=os[_0x5433('0x1c')]();var _0x56e58f=/[0-9a-f-]{36}/;if(config[_0x5433('0x1d')]&&_0x56e58f[_0x5433('0x1e')](config['licenseToken'])){return config[_0x5433('0x1d')];}else if(_0x4d6ced===_0x5433('0x1f')){return exec(_0x5433('0x20'),{'encoding':_0x5433('0x21')})[_0x5433('0x22')]('\x0d\x0a','');}else{var _0x1da913=getFirstInterface();var _0x4f665b=getCPUhash();var _0x33b55f=_0x4f665b+'|'+os[_0x5433('0x23')]()+'|'+_0x1da913['macAddress']+'|'+_0x1da913[_0x5433('0x24')];var _0x5c683c=crypto['createHash']('md5')[_0x5433('0x19')](_0x33b55f)[_0x5433('0x1a')](_0x5433('0x25'));return _0x5c683c[_0x5433('0x26')](0x0,0x8)+'-'+_0x5c683c[_0x5433('0x26')](0x8,0xc)+'-'+_0x5c683c[_0x5433('0x26')](0xc,0x10)+'-'+_0x5c683c[_0x5433('0x26')](0x10,0x14)+'-'+_0x5c683c[_0x5433('0x26')](0x14);}}; \ No newline at end of file +var _0x3262=['utf8','replace','hostname','macAddress','ipAddress','substring','lodash','bimedia-machine-uuid','child_process','execSync','keys','length','filter','family','internal','concat','head','mac','address','127.0.0.1','getFirstInterface','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x3d8ac2,_0x5be1d6){var _0x3d8672=function(_0xab9c35){while(--_0xab9c35){_0x3d8ac2['push'](_0x3d8ac2['shift']());}};_0x3d8672(++_0x5be1d6);}(_0x3262,0x86));var _0x2326=function(_0x602436,_0xbf433){_0x602436=_0x602436-0x0;var _0x504c33=_0x3262[_0x602436];return _0x504c33;};'use strict';var _=require(_0x2326('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x2326('0x1'));var exec=require(_0x2326('0x2'))[_0x2326('0x3')];var config=require('../environment');function getInterfaces(){var _0x255010=[];var _0x26bf69=os['networkInterfaces']();var _0x59fbc8=_['orderBy'](_[_0x2326('0x4')](_0x26bf69));for(var _0x3da97b=0x0;_0x3da97b<_0x59fbc8[_0x2326('0x5')];_0x3da97b++){var _0x2b500c=_0x26bf69[_0x59fbc8[_0x3da97b]][_0x2326('0x6')](function(_0x11d981){return _0x11d981[_0x2326('0x7')]==='IPv4'&&_0x11d981[_0x2326('0x8')]===![];});_0x255010=_0x255010[_0x2326('0x9')](_0x2b500c);}return _0x255010;}function getFirstInterface(){var _0x1dcc6e=_[_0x2326('0xa')](getInterfaces());return{'macAddress':_0x1dcc6e&&_0x1dcc6e[_0x2326('0xb')]?_0x1dcc6e[_0x2326('0xb')]:'00:00:00:00:00:00','ipAddress':_0x1dcc6e&&_0x1dcc6e[_0x2326('0xc')]?_0x1dcc6e['address']:_0x2326('0xd')};}exports[_0x2326('0xe')]=getFirstInterface;function getCPUhash(){var _0x9c3e5d=_['orderBy'](os['cpus']()['map'](function(_0x1b2b85){return _0x1b2b85['model'];}))[_0x2326('0xf')](':');return crypto[_0x2326('0x10')](_0x2326('0x11'))[_0x2326('0x12')](_0x9c3e5d)[_0x2326('0x13')](_0x2326('0x14'));}exports[_0x2326('0x15')]=function(){var _0x50462b=os[_0x2326('0x16')]();var _0x498297=/[0-9a-f-]{36}/;if(config[_0x2326('0x17')]&&_0x498297['test'](config[_0x2326('0x17')])){return config[_0x2326('0x17')];}else if(_0x50462b===_0x2326('0x18')){return exec(_0x2326('0x19'),{'encoding':_0x2326('0x1a')})[_0x2326('0x1b')]('\x0d\x0a','');}else{var _0x6f99b3=getFirstInterface();var _0x1cae91=getCPUhash();var _0x2ee0d7=_0x1cae91+'|'+os[_0x2326('0x1c')]()+'|'+_0x6f99b3[_0x2326('0x1d')]+'|'+_0x6f99b3[_0x2326('0x1e')];var _0x2bddb1=crypto[_0x2326('0x10')](_0x2326('0x11'))[_0x2326('0x12')](_0x2ee0d7)[_0x2326('0x13')]('hex');return _0x2bddb1['substring'](0x0,0x8)+'-'+_0x2bddb1['substring'](0x8,0xc)+'-'+_0x2bddb1[_0x2326('0x1f')](0xc,0x10)+'-'+_0x2bddb1[_0x2326('0x1f')](0x10,0x14)+'-'+_0x2bddb1['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 422438d..cb61f2d 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 _0xac63=['%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','data2','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','format','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','bluebird','pkginfo','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','version'];(function(_0x8250fc,_0x6099c5){var _0x9e37c4=function(_0x5858ae){while(--_0x5858ae){_0x8250fc['push'](_0x8250fc['shift']());}};_0x9e37c4(++_0x6099c5);}(_0xac63,0x1b8));var _0x3ac6=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0xac63[_0x43d16c];return _0x208cce;};'use strict';var util=require(_0x3ac6('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x3ac6('0x1'));var pkginfo=require(_0x3ac6('0x2'))(module,'version');var db=require(_0x3ac6('0x3'))['db'];var encryptor=require(_0x3ac6('0x4'));var hardware=require(_0x3ac6('0x5'));var logger=require(_0x3ac6('0x6'))(_0x3ac6('0x7'));var HOST=_0x3ac6('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x472c0d){return new BPromise(function(_0x105e8d,_0x1cf1fc){var _0x532848=util['format'](_0x3ac6('0x9'),HOST,_0x472c0d,module['exports'][_0x3ac6('0xa')]);if(oldToken){_0x532848=util['format'](_0x3ac6('0xb'),HOST,_0x472c0d,module[_0x3ac6('0xc')]['version'],oldToken);}var _0x54d2e4={'uri':_0x532848,'method':_0x3ac6('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x54d2e4)[_0x3ac6('0xe')](function(_0x4583d0){_0x105e8d(_0x4583d0);})['catch'](function(_0x3223df){_0x1cf1fc(_0x3223df);});});}function manageLicense(_0x17ff10,_0x365dd7){var _0x25875c=_0x365dd7['get']({'plain':!![]});if(!isOldTokenSent&&_0x25875c['data1']!==_0x17ff10&&!_0x25875c[_0x3ac6('0xf')]){oldToken=_0x25875c[_0x3ac6('0x10')];}httpRequest(_0x17ff10)['then'](function(_0x4c2f52){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4c2f52[_0x3ac6('0x11')]){isOldTokenSent=![];if(!_0x25875c[_0x3ac6('0x7')]&&_0x25875c[_0x3ac6('0x7')]!=_0x4c2f52[_0x3ac6('0x7')]||_0x25875c[_0x3ac6('0x7')]&&_0x25875c[_0x3ac6('0xf')]){logger['info'](_0x3ac6('0x12'));}if(_0x25875c[_0x3ac6('0x7')]&&!_0x25875c['data2']&&_0x25875c[_0x3ac6('0x7')]!=_0x4c2f52[_0x3ac6('0x7')]){logger[_0x3ac6('0x13')](_0x3ac6('0x14'));}if(_0x25875c[_0x3ac6('0x7')]&&!_0x25875c['data2']&&_0x25875c[_0x3ac6('0x7')]==_0x4c2f52[_0x3ac6('0x7')]){return _0x365dd7;}return _0x365dd7[_0x3ac6('0x15')]({'data1':_0x17ff10,'data2':null,'license':_0x4c2f52[_0x3ac6('0x7')]});}else{if(_0x4c2f52[_0x3ac6('0x7')]||_0x25875c[_0x3ac6('0x7')]){if(!_0x25875c[_0x3ac6('0xf')]){if(_0x25875c[_0x3ac6('0x10')]==_0x17ff10){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x3ac6('0x16');logger[_0x3ac6('0x13')](_0x3ac6('0x17'),_0x25875c[_0x3ac6('0x10')],_0x17ff10);}logger[_0x3ac6('0x13')](_0x3ac6('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x3ac6('0x19')](_0x3ac6('0x1a')));return _0x365dd7['update']({'data2':encryptor[_0x3ac6('0x1b')](moment()['format'](_0x3ac6('0x1a')))});}else{if(moment()[_0x3ac6('0x1c')](encryptor[_0x3ac6('0x1d')](_0x25875c[_0x3ac6('0xf')]),_0x3ac6('0x1e'))>DAYS){logger[_0x3ac6('0x13')](_0x3ac6('0x1f'),moment()[_0x3ac6('0x19')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x365dd7[_0x3ac6('0x15')]({'data1':_0x17ff10,'data2':null,'license':null});}}}else{if(_0x25875c['data1']!=_0x17ff10){logger[_0x3ac6('0x13')](_0x3ac6('0x17'),_0x25875c[_0x3ac6('0x10')],_0x17ff10);return _0x365dd7['update']({'data1':_0x17ff10,'data2':null,'license':null});}}}return _0x365dd7;})[_0x3ac6('0xe')](function(_0x3b8f67){_0x365dd7=_0x3b8f67;})[_0x3ac6('0x20')](function(_0x20533f){logger[_0x3ac6('0x21')](_0x20533f['message']);})[_0x3ac6('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x3ac6('0x23')](),_0x365dd7);},TIME);});}function defaultLicense(){var _0x4f3c8f=hardware[_0x3ac6('0x23')]();if(_0x4f3c8f){return db[_0x3ac6('0x24')][_0x3ac6('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x4f3c8f}})[_0x3ac6('0x26')](function(_0x547288,_0x1d34a6){logger[_0x3ac6('0x13')](_0x3ac6('0x27'),_0x4f3c8f);manageLicense(_0x4f3c8f,_0x547288);})[_0x3ac6('0x20')](function(_0x185749){logger[_0x3ac6('0x21')](_0x185749['message']);});}}exports[_0x3ac6('0x28')]=defaultLicense; \ No newline at end of file +var _0x050b=['License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','exports','then','catch','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0x050b,0x115));var _0xb050=function(_0x5dbe93,_0x34703e){_0x5dbe93=_0x5dbe93-0x0;var _0x4267e5=_0x050b[_0x5dbe93];return _0x4267e5;};'use strict';var util=require(_0xb050('0x0'));var moment=require(_0xb050('0x1'));var rp=require(_0xb050('0x2'));var BPromise=require(_0xb050('0x3'));var pkginfo=require(_0xb050('0x4'))(module,_0xb050('0x5'));var db=require(_0xb050('0x6'))['db'];var encryptor=require(_0xb050('0x7'));var hardware=require('./hardware');var logger=require(_0xb050('0x8'))(_0xb050('0x9'));var HOST=_0xb050('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x11b1b0){return new BPromise(function(_0x38a320,_0x5b4afb){var _0x3d42e3=util[_0xb050('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x11b1b0,module[_0xb050('0xc')][_0xb050('0x5')]);if(oldToken){_0x3d42e3=util[_0xb050('0xb')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x11b1b0,module['exports'][_0xb050('0x5')],oldToken);}var _0x176bf7={'uri':_0x3d42e3,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x176bf7)[_0xb050('0xd')](function(_0x34b236){_0x38a320(_0x34b236);})[_0xb050('0xe')](function(_0x32f3ee){_0x5b4afb(_0x32f3ee);});});}function manageLicense(_0x45853e,_0x19c3f8){var _0x27bdcc=_0x19c3f8[_0xb050('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x27bdcc[_0xb050('0x10')]!==_0x45853e&&!_0x27bdcc[_0xb050('0x11')]){oldToken=_0x27bdcc[_0xb050('0x10')];}httpRequest(_0x45853e)['then'](function(_0x18b795){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x18b795['active']){isOldTokenSent=![];if(!_0x27bdcc[_0xb050('0x9')]&&_0x27bdcc[_0xb050('0x9')]!=_0x18b795[_0xb050('0x9')]||_0x27bdcc['license']&&_0x27bdcc['data2']){logger[_0xb050('0x12')](_0xb050('0x13'));}if(_0x27bdcc[_0xb050('0x9')]&&!_0x27bdcc[_0xb050('0x11')]&&_0x27bdcc[_0xb050('0x9')]!=_0x18b795[_0xb050('0x9')]){logger[_0xb050('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x27bdcc[_0xb050('0x9')]&&!_0x27bdcc[_0xb050('0x11')]&&_0x27bdcc[_0xb050('0x9')]==_0x18b795[_0xb050('0x9')]){return _0x19c3f8;}return _0x19c3f8[_0xb050('0x14')]({'data1':_0x45853e,'data2':null,'license':_0x18b795[_0xb050('0x9')]});}else{if(_0x18b795[_0xb050('0x9')]||_0x27bdcc['license']){if(!_0x27bdcc[_0xb050('0x11')]){if(_0x27bdcc[_0xb050('0x10')]==_0x45853e){GRAY_PERIOD_REASON=_0xb050('0x15');logger[_0xb050('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xb050('0x16');logger[_0xb050('0x12')](_0xb050('0x17'),_0x27bdcc[_0xb050('0x10')],_0x45853e);}logger[_0xb050('0x12')](_0xb050('0x18'),GRAY_PERIOD_REASON[_0xb050('0x19')](),moment()['format'](_0xb050('0x1a')));return _0x19c3f8[_0xb050('0x14')]({'data2':encryptor[_0xb050('0x1b')](moment()[_0xb050('0xb')](_0xb050('0x1a')))});}else{if(moment()[_0xb050('0x1c')](encryptor[_0xb050('0x1d')](_0x27bdcc[_0xb050('0x11')]),_0xb050('0x1e'))>DAYS){logger[_0xb050('0x12')](_0xb050('0x1f'),moment()[_0xb050('0xb')](_0xb050('0x1a')));isOldTokenSent=![];return _0x19c3f8[_0xb050('0x14')]({'data1':_0x45853e,'data2':null,'license':null});}}}else{if(_0x27bdcc[_0xb050('0x10')]!=_0x45853e){logger[_0xb050('0x12')](_0xb050('0x17'),_0x27bdcc[_0xb050('0x10')],_0x45853e);return _0x19c3f8[_0xb050('0x14')]({'data1':_0x45853e,'data2':null,'license':null});}}}return _0x19c3f8;})['then'](function(_0x26e2cc){_0x19c3f8=_0x26e2cc;})[_0xb050('0xe')](function(_0x2169f1){logger[_0xb050('0x20')](_0x2169f1[_0xb050('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb050('0x22')](),_0x19c3f8);},TIME);});}function defaultLicense(){var _0x39569a=hardware[_0xb050('0x22')]();if(_0x39569a){return db[_0xb050('0x23')][_0xb050('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x39569a}})[_0xb050('0x25')](function(_0x1dc9cc,_0x54397b){logger[_0xb050('0x12')](_0xb050('0x26'),_0x39569a);manageLicense(_0x39569a,_0x1dc9cc);})[_0xb050('0xe')](function(_0x999fa8){logger[_0xb050('0x20')](_0x999fa8[_0xb050('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index cedac7f..588ea6f 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 _0x1168=['License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','machineUuid','decryptString','days','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','count','telephone','users','telephones','forEach','admin','user','pick','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','then','catch','uuid','data1','license','isEmpty'];(function(_0x389a4d,_0x271a9d){var _0x3df3d1=function(_0x5a0def){while(--_0x5a0def){_0x389a4d['push'](_0x389a4d['shift']());}};_0x3df3d1(++_0x271a9d);}(_0x1168,0xf7));var _0x8116=function(_0x3805e9,_0x33a4ed){_0x3805e9=_0x3805e9-0x0;var _0x207e20=_0x1168[_0x3805e9];return _0x207e20;};'use strict';var util=require(_0x8116('0x0'));var _=require('lodash');var moment=require(_0x8116('0x1'));var BPromise=require(_0x8116('0x2'));var hardware=require(_0x8116('0x3'));var encryptor=require(_0x8116('0x4'));var db=require(_0x8116('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[_0x8116('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8116('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8116('0x8'),'machineUuid':hardware[_0x8116('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3372ac){return new BPromise(function(_0x2446d1,_0x4c555d){return db[_0x8116('0x9')][_0x8116('0xa')](_['defaults'](_0x3372ac,{'raw':!![],'where':{'id':0x1}}))[_0x8116('0xb')](function(_0x578277){return checkLicense(_0x578277,null);})[_0x8116('0xb')](function(_0x34d328){_0x2446d1(_0x34d328);return;})[_0x8116('0xc')](function(_0x513cbd){_0x4c555d(_0x513cbd);});});}function checkLicense(_0x59479a,_0x1bf739){if(!_0x59479a){demoLicense[_0x8116('0xd')]=_0x59479a[_0x8116('0xe')];return demoLicense;}try{var _0x3f42b9=_0x1bf739||_0x59479a[_0x8116('0xf')];if(_[_0x8116('0x10')](_0x3f42b9)){throw new Error(_0x8116('0x11'));}var _0x36666e=_0x59479a[_0x8116('0xe')];var _0x20335f=_0x59479a[_0x8116('0x12')];var _0x27301b=_0x36666e[_0x8116('0x13')]('-')[0x4];var _0x306eeb=_0x36666e[_0x8116('0x13')]('-')[0x0];var _0x5e6c80=encryptor['decryptString'](_0x3f42b9,util[_0x8116('0x14')](_0x8116('0x15'),_0x27301b,_0x36666e,_0x306eeb));var _0x39fbdb=JSON['parse'](_0x5e6c80);_0x39fbdb['demo']=![];_0x39fbdb['uuid']=_0x36666e;_0x39fbdb[_0x8116('0x16')]=hardware[_0x8116('0x6')]();if(_0x20335f){var _0x315f74=encryptor[_0x8116('0x17')](_0x20335f);_0x39fbdb['gray']=_0x315f74;_0x39fbdb['deadline']=moment(_0x315f74)['add'](0x7,_0x8116('0x18'))[_0x8116('0x14')]();_0x39fbdb[_0x8116('0x19')]=_0x39fbdb[_0x8116('0xd')]!=_0x39fbdb[_0x8116('0x16')]?_0x8116('0x1a'):_0x8116('0x1b');}return _0x39fbdb;}catch(_0x260a4f){breakingLicense[_0x8116('0xd')]=_0x59479a[_0x8116('0xe')];breakingLicense['message']=_0x260a4f[_0x8116('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x37d437,_0x48eb47){getLicense()[_0x8116('0xb')](function(_0x5d98f1){return db[_0x8116('0x1d')][_0x8116('0x1e')]({'attributes':[_0x8116('0x1f'),[db[_0x8116('0x20')]['fn'](_0x8116('0x21'),db['sequelize']['col'](_0x8116('0x1f'))),_0x8116('0x22')]],'group':_0x8116('0x1f'),'where':{'role':{'$or':['admin','user',_0x8116('0x23')]}},'raw':!![]})[_0x8116('0xb')](function(_0x4ced2e){var _0x7f28b1={'user':_0x5d98f1[_0x8116('0x24')]||0x0,'telephone':_0x5d98f1[_0x8116('0x25')]||0x0};_0x4ced2e[_0x8116('0x26')](function(_0x50ee27){var _0x455c6b=_0x50ee27['role']===_0x8116('0x27')?_0x8116('0x28'):_0x50ee27[_0x8116('0x1f')];_0x7f28b1[_0x455c6b]-=_0x50ee27[_0x8116('0x22')];if(_0x7f28b1[_0x455c6b]<0x0)_0x7f28b1[_0x455c6b]=0x0;});_0x37d437(_0x7f28b1);return;});})['catch'](function(_0x1f127b){_0x48eb47(_0x1f127b);});});}function checkUserLimits(_0x91dd1b){return new BPromise(function(_0x5d387d,_0x5a5870){getLimits()['then'](function(_0x2785e3){var _0x340521=_[_0x8116('0x29')](_['countBy'](_0x91dd1b,'role'),['admin',_0x8116('0x28'),_0x8116('0x23')]);var _0x528e01=(_0x340521[_0x8116('0x27')]||0x0)+(_0x340521['user']||0x0);var _0x50329c=_0x340521[_0x8116('0x23')]||0x0;if(_0x528e01>_0x2785e3[_0x8116('0x28')])return _0x5a5870('License\x20limit\x20reached\x20for\x20users');if(_0x50329c>_0x2785e3['telephone'])return _0x5a5870(_0x8116('0x2a'));return _0x5d387d();})['catch'](function(_0x196256){_0x5a5870(_0x196256);});});}module[_0x8116('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xdda4=['lodash','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','deadline','add','days','changed','disabled','message','findAll','role','sequelize','COUNT','count','admin','user','users','telephones','forEach','pick','telephone','License\x20limit\x20reached\x20for\x20users','exports','util'];(function(_0x267e53,_0x5c3e18){var _0x525fcd=function(_0x15dcde){while(--_0x15dcde){_0x267e53['push'](_0x267e53['shift']());}};_0x525fcd(++_0x5c3e18);}(_0xdda4,0x157));var _0x4dda=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xdda4[_0x295314];return _0x584b0c;};'use strict';var util=require(_0x4dda('0x0'));var _=require(_0x4dda('0x1'));var moment=require('moment');var BPromise=require(_0x4dda('0x2'));var hardware=require('./hardware');var encryptor=require(_0x4dda('0x3'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4dda('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4dda('0x5'),'machineUuid':hardware[_0x4dda('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x4dda('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x4dda('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x52b3aa){return new BPromise(function(_0x44bf73,_0x5c6b14){return db[_0x4dda('0x8')]['find'](_[_0x4dda('0x9')](_0x52b3aa,{'raw':!![],'where':{'id':0x1}}))[_0x4dda('0xa')](function(_0x3c0261){return checkLicense(_0x3c0261,null);})[_0x4dda('0xa')](function(_0x922375){_0x44bf73(_0x922375);return;})[_0x4dda('0xb')](function(_0x247792){_0x5c6b14(_0x247792);});});}function checkLicense(_0x2fc75c,_0x5715e4){if(!_0x2fc75c){demoLicense[_0x4dda('0xc')]=_0x2fc75c[_0x4dda('0xd')];return demoLicense;}try{var _0x137380=_0x5715e4||_0x2fc75c['license'];if(_[_0x4dda('0xe')](_0x137380)){throw new Error(_0x4dda('0xf'));}var _0x215fcd=_0x2fc75c[_0x4dda('0xd')];var _0x15e4ff=_0x2fc75c[_0x4dda('0x10')];var _0xde2bef=_0x215fcd[_0x4dda('0x11')]('-')[0x4];var _0x21dce6=_0x215fcd[_0x4dda('0x11')]('-')[0x0];var _0x452eb2=encryptor[_0x4dda('0x12')](_0x137380,util[_0x4dda('0x13')]('%s:%s:%s',_0xde2bef,_0x215fcd,_0x21dce6));var _0x4a0d95=JSON[_0x4dda('0x14')](_0x452eb2);_0x4a0d95[_0x4dda('0x15')]=![];_0x4a0d95[_0x4dda('0xc')]=_0x215fcd;_0x4a0d95[_0x4dda('0x16')]=hardware[_0x4dda('0x6')]();if(_0x15e4ff){var _0x421d26=encryptor[_0x4dda('0x12')](_0x15e4ff);_0x4a0d95['gray']=_0x421d26;_0x4a0d95[_0x4dda('0x17')]=moment(_0x421d26)[_0x4dda('0x18')](0x7,_0x4dda('0x19'))['format']();_0x4a0d95['grayReason']=_0x4a0d95[_0x4dda('0xc')]!=_0x4a0d95[_0x4dda('0x16')]?_0x4dda('0x1a'):_0x4dda('0x1b');}return _0x4a0d95;}catch(_0x1942bc){breakingLicense[_0x4dda('0xc')]=_0x2fc75c[_0x4dda('0xd')];breakingLicense[_0x4dda('0x1c')]=_0x1942bc['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x47d5f3,_0x47a50e){getLicense()[_0x4dda('0xa')](function(_0x10a3ae){return db['User'][_0x4dda('0x1d')]({'attributes':[_0x4dda('0x1e'),[db[_0x4dda('0x1f')]['fn'](_0x4dda('0x20'),db[_0x4dda('0x1f')]['col'](_0x4dda('0x1e'))),_0x4dda('0x21')]],'group':_0x4dda('0x1e'),'where':{'role':{'$or':[_0x4dda('0x22'),_0x4dda('0x23'),'telephone']}},'raw':!![]})[_0x4dda('0xa')](function(_0x36c117){var _0x48f77d={'user':_0x10a3ae[_0x4dda('0x24')]||0x0,'telephone':_0x10a3ae[_0x4dda('0x25')]||0x0};_0x36c117[_0x4dda('0x26')](function(_0x75a8b0){var _0x10108d=_0x75a8b0[_0x4dda('0x1e')]===_0x4dda('0x22')?'user':_0x75a8b0['role'];_0x48f77d[_0x10108d]-=_0x75a8b0['count'];if(_0x48f77d[_0x10108d]<0x0)_0x48f77d[_0x10108d]=0x0;});_0x47d5f3(_0x48f77d);return;});})[_0x4dda('0xb')](function(_0x1d5ac5){_0x47a50e(_0x1d5ac5);});});}function checkUserLimits(_0x5921bf){return new BPromise(function(_0x36f8ee,_0x3a5a88){getLimits()[_0x4dda('0xa')](function(_0x33d7ab){var _0x135771=_[_0x4dda('0x27')](_['countBy'](_0x5921bf,_0x4dda('0x1e')),[_0x4dda('0x22'),_0x4dda('0x23'),_0x4dda('0x28')]);var _0x2768d7=(_0x135771[_0x4dda('0x22')]||0x0)+(_0x135771[_0x4dda('0x23')]||0x0);var _0x169004=_0x135771['telephone']||0x0;if(_0x2768d7>_0x33d7ab[_0x4dda('0x23')])return _0x3a5a88(_0x4dda('0x29'));if(_0x169004>_0x33d7ab['telephone'])return _0x3a5a88('License\x20limit\x20reached\x20for\x20telephones');return _0x36f8ee();})[_0x4dda('0xb')](function(_0x41ff78){_0x3a5a88(_0x41ff78);});});}module[_0x4dda('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index d5cb14e..f21d7f3 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 _0x0972=['http://localhost:9000','app-id'];(function(_0x5db12e,_0x35cf78){var _0x5c98f5=function(_0x4186bf){while(--_0x4186bf){_0x5db12e['push'](_0x5db12e['shift']());}};_0x5c98f5(++_0x35cf78);}(_0x0972,0x64));var _0x2097=function(_0x15258a,_0x30cd1e){_0x15258a=_0x15258a-0x0;var _0x54cbd2=_0x0972[_0x15258a];return _0x54cbd2;};'use strict';module['exports']={'DOMAIN':_0x2097('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2097('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x7880=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x581d09,_0x2f7c54){var _0x8c67d0=function(_0x5ce642){while(--_0x5ce642){_0x581d09['push'](_0x581d09['shift']());}};_0x8c67d0(++_0x2f7c54);}(_0x7880,0x1f4));var _0x0788=function(_0x3cb9eb,_0x3fd4b9){_0x3cb9eb=_0x3cb9eb-0x0;var _0x4d5970=_0x7880[_0x3cb9eb];return _0x4d5970;};'use strict';module['exports']={'DOMAIN':_0x0788('0x0'),'SESSION_SECRET':_0x0788('0x1'),'GOOGLE_ID':_0x0788('0x2'),'GOOGLE_SECRET':_0x0788('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index e71799d..d2c9df5 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57f4=['fileLogger','exports','../utils/loggers'];(function(_0xcdd89b,_0x40b13f){var _0x1c525d=function(_0x39138c){while(--_0x39138c){_0xcdd89b['push'](_0xcdd89b['shift']());}};_0x1c525d(++_0x40b13f);}(_0x57f4,0xd1));var _0x457f=function(_0x530853,_0x4a579e){_0x530853=_0x530853-0x0;var _0x5cedfa=_0x57f4[_0x530853];return _0x5cedfa;};'use strict';var fileLogger=require(_0x457f('0x0'))[_0x457f('0x1')];module[_0x457f('0x2')]=fileLogger; \ No newline at end of file +var _0x1a7e=['exports','../utils/loggers','fileLogger'];(function(_0x35e9a4,_0x40b178){var _0x575b90=function(_0x18e931){while(--_0x18e931){_0x35e9a4['push'](_0x35e9a4['shift']());}};_0x575b90(++_0x40b178);}(_0x1a7e,0x190));var _0xe1a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a7e[_0x3dd15e];return _0x231fd0;};'use strict';var fileLogger=require(_0xe1a7('0x0'))[_0xe1a7('0x1')];module[_0xe1a7('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 5f48638..e929e4f 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 _0xedd2=['email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','../../config/environment','join','root','legacy-libs','express','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xedd2,0x1c8));var _0x2edd=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xedd2[_0x199572];return _0x13cfa3;};'use strict';var path=require(_0x2edd('0x0'));var cfg=require(_0x2edd('0x1'));var env={'NODE_PATH':path['resolve'](path[_0x2edd('0x2')](cfg[_0x2edd('0x3')],_0x2edd('0x4')))};var pm2config={'apps':[{'name':_0x2edd('0x5'),'script':path[_0x2edd('0x2')](__dirname,'../../services/express/index.js'),'env':env},{'name':'ami','script':path[_0x2edd('0x2')](__dirname,_0x2edd('0x6')),'env':env},{'name':_0x2edd('0x7'),'script':path[_0x2edd('0x2')](__dirname,_0x2edd('0x8')),'env':env},{'name':_0x2edd('0x9'),'script':path[_0x2edd('0x2')](__dirname,_0x2edd('0xa')),'env':env},{'name':_0x2edd('0xb'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x2edd('0xc'),'script':path[_0x2edd('0x2')](__dirname,_0x2edd('0xd')),'env':env}]};module[_0x2edd('0xe')]=pm2config; \ No newline at end of file +var _0xfc94=['resolve','join','root','express','../../services/express/index.js','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x5a5aa2,_0x1cdd47){var _0x5906b1=function(_0x4777b7){while(--_0x4777b7){_0x5a5aa2['push'](_0x5a5aa2['shift']());}};_0x5906b1(++_0x1cdd47);}(_0xfc94,0x70));var _0x4fc9=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xfc94[_0x1deb03];return _0x189fe7;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x4fc9('0x0')](path[_0x4fc9('0x1')](cfg[_0x4fc9('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':_0x4fc9('0x3'),'script':path[_0x4fc9('0x1')](__dirname,_0x4fc9('0x4')),'env':env},{'name':'ami','script':path['join'](__dirname,_0x4fc9('0x5')),'env':env},{'name':_0x4fc9('0x6'),'script':path[_0x4fc9('0x1')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x4fc9('0x7'),'script':path['join'](__dirname,_0x4fc9('0x8')),'env':env},{'name':_0x4fc9('0x9'),'script':path[_0x4fc9('0x1')](__dirname,_0x4fc9('0xa')),'env':env},{'name':_0x4fc9('0xb'),'script':path['join'](__dirname,_0x4fc9('0xc')),'env':env}]};module[_0x4fc9('0xd')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index d013165..712dc29 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 _0xdd4a=['dump','saved','pm2','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x430678,_0x50ccc2){var _0xca6e8b=function(_0x24c4f2){while(--_0x24c4f2){_0x430678['push'](_0x430678['shift']());}};_0xca6e8b(++_0x50ccc2);}(_0xdd4a,0x195));var _0xadd4=function(_0x23b106,_0x50acec){_0x23b106=_0x23b106-0x0;var _0x3c88e5=_0xdd4a[_0x23b106];return _0x3c88e5;};'use strict';var pm2=require(_0xadd4('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x3b30b2,_0x2ded9d){return pm2[_0xadd4('0x1')](function(_0x510554){if(_0x510554){return _0x2ded9d(_0x510554);}return _0x3b30b2(_0xadd4('0x2'));});});};exports[_0xadd4('0x3')]=function(_0x1a9b0e){return connect()[_0xadd4('0x4')](function(){return new BPromise(function(_0x15a56f,_0xce39cd){return pm2[_0xadd4('0x3')](_0x1a9b0e,function(_0x3713a4,_0x414508){if(_0x3713a4){return _0xce39cd(_0x3713a4);}pm2[_0xadd4('0x5')]();return _0x15a56f(_0x414508);});});});};exports[_0xadd4('0x6')]=function(_0x17f316){return connect()[_0xadd4('0x4')](function(){return new BPromise(function(_0x5a2722,_0x20625f){return pm2[_0xadd4('0x6')](_0x17f316,function(_0x52b7ea,_0x387363){if(_0x52b7ea){return _0x20625f(_0x52b7ea);}pm2[_0xadd4('0x5')]();return _0x5a2722(_0x387363);});});});};exports[_0xadd4('0x7')]=function(_0x10e5e2){return connect()[_0xadd4('0x4')](function(){return new BPromise(function(_0x2ac678,_0x4212c5){return pm2[_0xadd4('0x7')](_0x10e5e2,function(_0x5b0da4,_0xbdedf6){if(_0x5b0da4){return _0x4212c5(_0x5b0da4);}pm2['disconnect']();return _0x2ac678(_0xbdedf6);});});});};exports['list']=function(){return connect()[_0xadd4('0x4')](function(){return new BPromise(function(_0xf33ed6,_0x53aecf){return pm2[_0xadd4('0x8')](function(_0x39ba8f,_0x52bd47){if(_0x39ba8f){return _0x53aecf(_0x39ba8f);}pm2[_0xadd4('0x5')]();return _0xf33ed6(_0x52bd47);});});});};exports[_0xadd4('0x9')]=function(_0xa9d8d8){return connect()[_0xadd4('0x4')](function(){return new BPromise(function(_0x5e2d5b,_0xb2f212){return pm2[_0xadd4('0x9')](_0xa9d8d8,function(_0x109efa,_0x47250a){if(_0x109efa){return _0xb2f212(_0x109efa);}pm2[_0xadd4('0x5')]();return _0x5e2d5b(_0x47250a);});});});};exports[_0xadd4('0xa')]=function(_0x3e10e8){return connect()[_0xadd4('0x4')](function(){return new BPromise(function(_0x387d39,_0x503506){return pm2[_0xadd4('0xa')](_0x3e10e8,function(_0x59c51a,_0x4a4395){if(_0x59c51a){return _0x503506(_0x59c51a);}pm2[_0xadd4('0x5')]();return _0x387d39(_0x4a4395);});});});};exports[_0xadd4('0xb')]=function(){return connect()[_0xadd4('0x4')](function(){return new BPromise(function(_0x11dc5d,_0x49a0da){return pm2[_0xadd4('0xb')](function(_0x4dea9f){if(_0x4dea9f){return _0x49a0da(_0x4dea9f);}return _0x11dc5d(_0xadd4('0xc'));});});});}; \ No newline at end of file +var _0x9286=['describe','delete','dump','saved','bluebird','connect','start','then','disconnect','stop','restart','list'];(function(_0x3fd440,_0x588f38){var _0x48d1b5=function(_0x1b8dd2){while(--_0x1b8dd2){_0x3fd440['push'](_0x3fd440['shift']());}};_0x48d1b5(++_0x588f38);}(_0x9286,0x178));var _0x6928=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0x9286[_0x2726ad];return _0xd87993;};'use strict';var pm2=require('pm2');var BPromise=require(_0x6928('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x1d0127,_0x2fc491){return pm2[_0x6928('0x1')](function(_0x5acb73){if(_0x5acb73){return _0x2fc491(_0x5acb73);}return _0x1d0127('connected');});});};exports[_0x6928('0x2')]=function(_0x4141f9){return connect()[_0x6928('0x3')](function(){return new BPromise(function(_0x1be803,_0x5b98ce){return pm2[_0x6928('0x2')](_0x4141f9,function(_0x98e6c,_0x33a137){if(_0x98e6c){return _0x5b98ce(_0x98e6c);}pm2[_0x6928('0x4')]();return _0x1be803(_0x33a137);});});});};exports[_0x6928('0x5')]=function(_0x1f24ef){return connect()['then'](function(){return new BPromise(function(_0x1fe802,_0x474256){return pm2['stop'](_0x1f24ef,function(_0x4dfbb6,_0x580458){if(_0x4dfbb6){return _0x474256(_0x4dfbb6);}pm2[_0x6928('0x4')]();return _0x1fe802(_0x580458);});});});};exports['restart']=function(_0x1d7a5d){return connect()[_0x6928('0x3')](function(){return new BPromise(function(_0x324c01,_0x4a0b27){return pm2[_0x6928('0x6')](_0x1d7a5d,function(_0x5c74f0,_0xc60baf){if(_0x5c74f0){return _0x4a0b27(_0x5c74f0);}pm2[_0x6928('0x4')]();return _0x324c01(_0xc60baf);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x5857ef,_0x891fc){return pm2[_0x6928('0x7')](function(_0x18ccd1,_0x499c74){if(_0x18ccd1){return _0x891fc(_0x18ccd1);}pm2[_0x6928('0x4')]();return _0x5857ef(_0x499c74);});});});};exports[_0x6928('0x8')]=function(_0x25c7e7){return connect()['then'](function(){return new BPromise(function(_0x267bdb,_0x17dfe1){return pm2[_0x6928('0x8')](_0x25c7e7,function(_0xabb2ac,_0x62eb7f){if(_0xabb2ac){return _0x17dfe1(_0xabb2ac);}pm2['disconnect']();return _0x267bdb(_0x62eb7f);});});});};exports[_0x6928('0x9')]=function(_0x47996a){return connect()['then'](function(){return new BPromise(function(_0x3e5c99,_0xc040c6){return pm2[_0x6928('0x9')](_0x47996a,function(_0x25d131,_0x11c130){if(_0x25d131){return _0xc040c6(_0x25d131);}pm2[_0x6928('0x4')]();return _0x3e5c99(_0x11c130);});});});};exports[_0x6928('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x245a8f,_0x1b89f5){return pm2[_0x6928('0xa')](function(_0x8e13b1){if(_0x8e13b1){return _0x1b89f5(_0x8e13b1);}return _0x245a8f(_0x6928('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f2c8f03..e8b9590 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 _0x9f6f=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt','subtract','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length'];(function(_0x69868d,_0x1c2e1f){var _0x41c281=function(_0x338278){while(--_0x338278){_0x69868d['push'](_0x69868d['shift']());}};_0x41c281(++_0x1c2e1f);}(_0x9f6f,0xf6));var _0xf9f6=function(_0x16d39d,_0x380d39){_0x16d39d=_0x16d39d-0x0;var _0x4a2775=_0x9f6f[_0x16d39d];return _0x4a2775;};'use strict';var _=require(_0xf9f6('0x0'));var moment=require(_0xf9f6('0x1'));var Redis=require('ioredis');var util=require(_0xf9f6('0x2'));var config=require(_0xf9f6('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xf9f6('0x4'))(_0xf9f6('0x5'));config[_0xf9f6('0x6')]=_[_0xf9f6('0x7')](config[_0xf9f6('0x6')],{'host':_0xf9f6('0x8'),'port':0x18eb});var io=require(_0xf9f6('0x9'))(new Redis(config[_0xf9f6('0x6')]));function closeInteractions(){var _0x4c0603=0x0;var _0x32fbcb=[];return db[_0xf9f6('0xa')][_0xf9f6('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xf9f6('0xc')](function(_0x50c152){_0x4c0603=_0x50c152[_0xf9f6('0xd')];if(_0x4c0603){return db[_0xf9f6('0xe')]['findAll']({'raw':!![],'attributes':['id',_0xf9f6('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf9f6('0x10')](_0x50c152[_0xf9f6('0xd')],_0xf9f6('0x11'))}}});}else{return[];}})[_0xf9f6('0xc')](function(_0x2c8854){if(_0x2c8854&&_0x2c8854['length']){_0x32fbcb=_['map'](_0x2c8854||[],'id');logger[_0xf9f6('0x12')](_0xf9f6('0x13'),_0x32fbcb['join']());return db[_0xf9f6('0xe')][_0xf9f6('0x14')]({'closeReason':_0xf9f6('0x15'),'disposition':_0xf9f6('0x16'),'closed':!![],'closedAt':moment()[_0xf9f6('0x17')](_0xf9f6('0x18'))},{'where':{'id':_0x32fbcb}});}})[_0xf9f6('0xc')](function(){if(_0x32fbcb&&_0x32fbcb[_0xf9f6('0x19')]){logger[_0xf9f6('0x12')](_0xf9f6('0x1a'),_0x32fbcb[_0xf9f6('0x1b')]());for(var _0x22d95e=0x0;_0x22d95e<_0x32fbcb['length'];_0x22d95e++){io[_0xf9f6('0x1c')](_0xf9f6('0x1d'),{'id':_0x32fbcb[_0x22d95e],'closed':!![]});}}})[_0xf9f6('0x1e')](function(_0x11804b){logger[_0xf9f6('0x1f')](_0xf9f6('0x20'),_0x11804b?util[_0xf9f6('0x21')](_0x11804b,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x5c39=['schedule','redis','defaults','localhost','Setting','find','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch','error','inspect','start','moment','util','../../config/environment','../../mysqldb','../logger'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x5c39,0xd4));var _0x95c3=function(_0x1bfc25,_0x49cde8){_0x1bfc25=_0x1bfc25-0x0;var _0x3efea6=_0x5c39[_0x1bfc25];return _0x3efea6;};'use strict';var _=require('lodash');var moment=require(_0x95c3('0x0'));var Redis=require('ioredis');var util=require(_0x95c3('0x1'));var config=require(_0x95c3('0x2'));var db=require(_0x95c3('0x3'))['db'];var logger=require(_0x95c3('0x4'))(_0x95c3('0x5'));config[_0x95c3('0x6')]=_[_0x95c3('0x7')](config[_0x95c3('0x6')],{'host':_0x95c3('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x95c3('0x6')]));function closeInteractions(){var _0x5c0a63=0x0;var _0x74de65=[];return db[_0x95c3('0x9')][_0x95c3('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x95c3('0xb')](function(_0x1fda08){_0x5c0a63=_0x1fda08['chatTimeout'];if(_0x5c0a63){return db[_0x95c3('0xc')][_0x95c3('0xd')]({'raw':!![],'attributes':['id',_0x95c3('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x95c3('0xf')](_0x1fda08['chatTimeout'],'minutes')}}});}else{return[];}})[_0x95c3('0xb')](function(_0x308005){if(_0x308005&&_0x308005[_0x95c3('0x10')]){_0x74de65=_[_0x95c3('0x11')](_0x308005||[],'id');logger[_0x95c3('0x12')](_0x95c3('0x13'),_0x74de65[_0x95c3('0x14')]());return db[_0x95c3('0xc')][_0x95c3('0x15')]({'closeReason':_0x95c3('0x16'),'disposition':_0x95c3('0x17'),'closed':!![],'closedAt':moment()[_0x95c3('0x18')](_0x95c3('0x19'))},{'where':{'id':_0x74de65}});}})[_0x95c3('0xb')](function(){if(_0x74de65&&_0x74de65['length']){logger[_0x95c3('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x74de65[_0x95c3('0x14')]());for(var _0x3c3cca=0x0;_0x3c3cca<_0x74de65['length'];_0x3c3cca++){io['emit'](_0x95c3('0x1a'),{'id':_0x74de65[_0x3c3cca],'closed':!![]});}}})[_0x95c3('0x1b')](function(_0x3ce2ac){logger[_0x95c3('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x3ce2ac?util[_0x95c3('0x1d')](_0x3ce2ac,{'showHidden':![],'depth':null}):'');});}exports[_0x95c3('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 3eca20b..a6d4aa1 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 _0xf366=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x3c5e45,_0x122a0e){var _0x5d6525=function(_0x287c68){while(--_0x287c68){_0x3c5e45['push'](_0x3c5e45['shift']());}};_0x5d6525(++_0x122a0e);}(_0xf366,0x9b));var _0x6f36=function(_0x5a3c8a,_0x458ddd){_0x5a3c8a=_0x5a3c8a-0x0;var _0x460a8a=_0xf366[_0x5a3c8a];return _0x460a8a;};'use strict';function start(){var _0xa84558=require(_0x6f36('0x0'));return _0xa84558['startAllRefreshIntervals']();}module[_0x6f36('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x2b72=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b72,0x1ef));var _0x22b7=function(_0x334c50,_0x1f11d0){_0x334c50=_0x334c50-0x0;var _0x524766=_0x2b72[_0x334c50];return _0x524766;};'use strict';function start(){var _0x2bf9f0=require(_0x22b7('0x0'));return _0x2bf9f0[_0x22b7('0x1')]();}module[_0x22b7('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 01ecd2d..88b5379 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 _0x9bad=['moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','email','MailAccount','getSmtpOptions','format','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','%s.%s','basename','savename','extname','zip','join','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','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','toRun','length','my\x20id','resolve','run\x20job','cron','isBetween','endAt','add','start','active','startAt','update\x20cron','stop\x20cron','util','lodash'];(function(_0x35efe7,_0x47b903){var _0x2fd9e0=function(_0x302211){while(--_0x302211){_0x35efe7['push'](_0x35efe7['shift']());}};_0x2fd9e0(++_0x47b903);}(_0x9bad,0xa2));var _0xd9ba=function(_0xfbbc02,_0x2e2b49){_0xfbbc02=_0xfbbc02-0x0;var _0x333d7c=_0x9bad[_0xfbbc02];return _0x333d7c;};'use strict';var fs=require('fs');var util=require(_0xd9ba('0x0'));var path=require('path');var _=require(_0xd9ba('0x1'));var moment=require(_0xd9ba('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xd9ba('0x3'));var BPromise=require(_0xd9ba('0x4'));var logger=require(_0xd9ba('0x5'))(_0xd9ba('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xd9ba('0x7'));var analyticDefaultReportController=require(_0xd9ba('0x8'));var client=jayson[_0xd9ba('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x214832,_0x242dc1){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x214832[_0xd9ba('0xa')]);var _0x63eb28=!![];var _0x2fa88a=_0x214832[_0xd9ba('0xb')][_0xd9ba('0xc')]();var _0x324e53={'account':_0x2fa88a,'message':{'from':util[_0xd9ba('0xd')]('\x22%s\x22\x20<%s>',_0x214832[_0xd9ba('0xb')][_0xd9ba('0xe')],_0x214832[_0xd9ba('0xb')]['email']||_0x214832[_0xd9ba('0xb')][_0xd9ba('0xf')]['user']),'to':_0x214832['email'],'cc':_0x214832['cc'],'bcc':_0x214832[_0xd9ba('0x10')],'subject':util[_0xd9ba('0xd')](_0xd9ba('0x11'),_0x242dc1['name'],_0x214832[_0xd9ba('0x12')],_0x214832[_0xd9ba('0x13')])}};var _0x3c0e38=path['join'](__dirname,'../../files/reports');var _0x386a5f=_0x242dc1['savename'];var _0x431569=util[_0xd9ba('0xd')](_0xd9ba('0x14'),path[_0xd9ba('0x15')](_0x242dc1[_0xd9ba('0x16')],path[_0xd9ba('0x17')](_0x242dc1[_0xd9ba('0x16')])),_0xd9ba('0x18'));var _0x7694a3=path[_0xd9ba('0x19')](_0x3c0e38,_0x386a5f);var _0x763e79=path[_0xd9ba('0x19')](_0x3c0e38,_0x431569);if(fs[_0xd9ba('0x1a')](_0x7694a3)){_0x242dc1[_0xd9ba('0x1b')]=_0xd9ba('0x1c');_0x324e53[_0xd9ba('0x1d')][_0xd9ba('0x1e')]=[{'filename':_0x386a5f,'path':_0x7694a3}];_0x324e53[_0xd9ba('0x1d')][_0xd9ba('0x1f')]=util[_0xd9ba('0xd')](_0xd9ba('0x20'),JSON['stringify'](_0x242dc1,null,0x2));}else if(fs['existsSync'](_0x763e79)){_0x242dc1[_0xd9ba('0x1b')]=_0xd9ba('0x1c');_0x324e53[_0xd9ba('0x1d')][_0xd9ba('0x1e')]=[{'filename':_0x431569,'path':_0x763e79}];}else{_0x324e53[_0xd9ba('0x1d')][_0xd9ba('0x1f')]=_0xd9ba('0x21');if(!_0x214832[_0xd9ba('0x22')]){_0x63eb28=![];logger[_0xd9ba('0x23')](_0xd9ba('0x24'));}}if(_0x63eb28){return client[_0xd9ba('0x25')](_0xd9ba('0x26'),_0x324e53)[_0xd9ba('0x27')](function(_0x1cc904){if(_0x1cc904['error']){return logger[_0xd9ba('0x28')](_0xd9ba('0x29'),JSON[_0xd9ba('0x2a')](_0x1cc904));}return logger[_0xd9ba('0x23')]('email\x20sent');})[_0xd9ba('0x2b')](function(_0x23ab44){return logger[_0xd9ba('0x28')](_0xd9ba('0x29'),JSON['stringify'](_0x23ab44));});}};}function handleError(){return function(_0x1e1e49){return logger[_0xd9ba('0x28')](JSON['stringify'](_0x1e1e49));};}function handleResult(_0x26e57d){return function(_0x274b2b){logger[_0xd9ba('0x23')]('data',JSON[_0xd9ba('0x2a')](_0x274b2b));if(_0x26e57d[_0xd9ba('0xb')]&&_0x26e57d['MailAccount'][_0xd9ba('0xf')]&&!_[_0xd9ba('0x2c')](_0x26e57d[_0xd9ba('0xa')])){setTimeout(handleSendEmail(_0x26e57d,_0x274b2b),0x3c*0x3e8);}};}function handleJob(_0xf16e5){return function(){try{if(_['isNil'](_0xf16e5[_0xd9ba('0x12')])){return logger[_0xd9ba('0x23')](_0xd9ba('0x2d'));}if(_[_0xd9ba('0x2c')](_0xf16e5['subtractUnit'])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x33eb9c={'startDate':moment()[_0xd9ba('0x2e')](_0xf16e5[_0xd9ba('0x12')],_0xf16e5[_0xd9ba('0x13')])[_0xd9ba('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xd9ba('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xd9ba('0x2f'),'output':_0xf16e5['output'],'name':_0xf16e5[_0xd9ba('0xe')]};if(!_[_0xd9ba('0x2c')](_0xf16e5[_0xd9ba('0x30')])){logger[_0xd9ba('0x23')](_0xd9ba('0x31'),_0xf16e5[_0xd9ba('0x30')]);return analyticDefaultReportController[_0xd9ba('0x32')]({'id':_0xf16e5[_0xd9ba('0x30')]},_0x33eb9c)[_0xd9ba('0x27')](handleResult(_0xf16e5))[_0xd9ba('0x2b')](handleError());}if(!_[_0xd9ba('0x2c')](_0xf16e5[_0xd9ba('0x33')])){logger['info'](_0xd9ba('0x34'),_0xf16e5[_0xd9ba('0x33')]);return analyticCustomReportController[_0xd9ba('0x32')]({'id':_0xf16e5['CustomReportId']},_0x33eb9c)['then'](handleResult(_0xf16e5))[_0xd9ba('0x2b')](handleError());}}catch(_0x4ff8f0){logger[_0xd9ba('0x28')](JSON[_0xd9ba('0x2a')](_0x4ff8f0));}return logger[_0xd9ba('0x23')](_0xd9ba('0x35'));};}function getJobs(_0x2fd75b){var _0x1edfd8={};if(_0x2fd75b){_0x1edfd8['id']=_0x2fd75b;}return db[_0xd9ba('0x36')]['findAll']({'where':_0x1edfd8,'include':[{'model':db[_0xd9ba('0xb')],'attributes':['id','name',_0xd9ba('0xa')],'include':[{'model':db[_0xd9ba('0x37')],'as':_0xd9ba('0xf'),'include':[{'model':db[_0xd9ba('0x38')],'as':_0xd9ba('0x38')}]}]}]})[_0xd9ba('0x27')](function(_0x4f5bd9){var _0x5e9271=_[_0xd9ba('0x39')](manager[_0xd9ba('0x3a')]);var _0x39598d=_[_0xd9ba('0x3b')](_0x4f5bd9,function(_0x232856){return _0x232856['id']['toString']();});var _0x67a821=_[_0xd9ba('0x3c')](_0x4f5bd9,function(_0x312011){return _0x312011['id'][_0xd9ba('0x3d')]();});var _0x2833d6=_0x2fd75b?_0x39598d:_[_0xd9ba('0x3e')](_0x39598d,_0x5e9271);var _0x3f83df=_[_0xd9ba('0x3f')](_0x39598d,_0x5e9271);var _0x6e6e28=_['difference'](_0x5e9271,_0x39598d);var _0x4a17ec;var _0x225438;for(_0x4a17ec=0x0;_0x4a17ec<_0x6e6e28['length']&&!_0x2fd75b;_0x4a17ec+=0x1){_0x225438=_0x6e6e28[_0x4a17ec][_0xd9ba('0x3d')]();if(manager[_0xd9ba('0x40')](_0x225438)){manager[_0xd9ba('0x41')](_0x225438);manager[_0xd9ba('0x42')](_0x225438);logger[_0xd9ba('0x23')](_0xd9ba('0x43'),_0x225438);}}logger['info'](_0xd9ba('0x44'),JSON['stringify'](_0x2833d6));for(_0x4a17ec=0x0;_0x4a17ec<_0x2833d6[_0xd9ba('0x45')];_0x4a17ec+=0x1){_0x225438=_0x2833d6[_0x4a17ec][_0xd9ba('0x3d')]();logger[_0xd9ba('0x23')]('index',_0x225438);if(_0x2fd75b){logger['info'](_0xd9ba('0x46'),_0x2fd75b);logger[_0xd9ba('0x23')](JSON[_0xd9ba('0x2a')](_0x67a821[_0x225438]));BPromise[_0xd9ba('0x47')]()[_0xd9ba('0x27')](handleJob(_0x67a821[_0x225438]));logger[_0xd9ba('0x23')](_0xd9ba('0x48'),_0x67a821[_0x225438][_0xd9ba('0xe')],_0x67a821[_0x225438]['cron']);}else if(_0x67a821[_0x225438][_0xd9ba('0x49')]&&_0x67a821[_0x225438]['active']&&moment()[_0xd9ba('0x4a')](_0x67a821[_0x225438]['startAt'],_0x67a821[_0x225438][_0xd9ba('0x4b')])){manager[_0xd9ba('0x4c')](_0x225438,_0x67a821[_0x225438][_0xd9ba('0x49')],handleJob(_0x67a821[_0x225438]));manager[_0xd9ba('0x4d')](_0x225438);logger['info']('add\x20cron',_0x67a821[_0x225438][_0xd9ba('0xe')],_0x67a821[_0x225438][_0xd9ba('0x49')]);}else if(manager[_0xd9ba('0x40')](_0x225438)){manager[_0xd9ba('0x41')](_0x225438);manager[_0xd9ba('0x42')](_0x225438);logger[_0xd9ba('0x23')]('stop\x20cron',_0x67a821[_0x225438][_0xd9ba('0xe')],_0x67a821[_0x225438]['cron']);}}for(_0x4a17ec=0x0,_0x225438;_0x4a17ec<_0x3f83df[_0xd9ba('0x45')]&&!_0x2fd75b;_0x4a17ec+=0x1){_0x225438=_0x3f83df[_0x4a17ec][_0xd9ba('0x3d')]();if(manager['exists'](_0x225438)){if(_0x67a821[_0x225438]['cron']&&_0x67a821[_0x225438][_0xd9ba('0x4e')]&&moment()[_0xd9ba('0x4a')](_0x67a821[_0x225438][_0xd9ba('0x4f')],_0x67a821[_0x225438]['endAt'])){manager['update'](_0x225438,_0x67a821[_0x225438][_0xd9ba('0x49')],handleJob(_0x67a821[_0x225438]));logger[_0xd9ba('0x23')](_0xd9ba('0x50'),_0x67a821[_0x225438][_0xd9ba('0xe')],_0x67a821[_0x225438][_0xd9ba('0x49')]);}else{manager['stop'](_0x225438);manager[_0xd9ba('0x42')](_0x225438);logger['info'](_0xd9ba('0x51'),_0x67a821[_0x225438][_0xd9ba('0xe')],_0x67a821[_0x225438][_0xd9ba('0x49')]);}}}})[_0xd9ba('0x2b')](function(_0x34a921){logger[_0xd9ba('0x28')](JSON[_0xd9ba('0x2a')](_0x34a921));});}exports['run']=function(_0x144243){return getJobs(_0x144243);};exports[_0xd9ba('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x3fba=['lodash','moment','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','format','\x22%s\x22\x20<%s>','MailAccount','user','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','status','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','error','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','Smtp','CloudProvider','keys','jobs','map','keyBy','toString','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','isBetween','startAt','endAt','add\x20cron','stop\x20cron','active','update','update\x20cron','start','util','path'];(function(_0x5b8e88,_0x588c4b){var _0x4141f4=function(_0x5c3c9b){while(--_0x5c3c9b){_0x5b8e88['push'](_0x5b8e88['shift']());}};_0x4141f4(++_0x588c4b);}(_0x3fba,0x15a));var _0xa3fb=function(_0x5756c6,_0x58290a){_0x5756c6=_0x5756c6-0x0;var _0x4b5806=_0x3fba[_0x5756c6];return _0x4b5806;};'use strict';var fs=require('fs');var util=require(_0xa3fb('0x0'));var path=require(_0xa3fb('0x1'));var _=require(_0xa3fb('0x2'));var moment=require(_0xa3fb('0x3'));var CronJobManager=require(_0xa3fb('0x4'));var jayson=require(_0xa3fb('0x5'));var BPromise=require(_0xa3fb('0x6'));var logger=require('../logger')('schedule');var db=require(_0xa3fb('0x7'))['db'];var analyticCustomReportController=require(_0xa3fb('0x8'));var analyticDefaultReportController=require(_0xa3fb('0x9'));var client=jayson[_0xa3fb('0xa')][_0xa3fb('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4c1a6a,_0x55c473){return function(){logger[_0xa3fb('0xc')](_0xa3fb('0xd'),_0x4c1a6a[_0xa3fb('0xe')]);var _0x444224=!![];var _0x98f40d=_0x4c1a6a['MailAccount']['getSmtpOptions']();var _0x59d321={'account':_0x98f40d,'message':{'from':util[_0xa3fb('0xf')](_0xa3fb('0x10'),_0x4c1a6a[_0xa3fb('0x11')]['name'],_0x4c1a6a['MailAccount'][_0xa3fb('0xe')]||_0x4c1a6a[_0xa3fb('0x11')]['Smtp'][_0xa3fb('0x12')]),'to':_0x4c1a6a[_0xa3fb('0xe')],'cc':_0x4c1a6a['cc'],'bcc':_0x4c1a6a[_0xa3fb('0x13')],'subject':util['format'](_0xa3fb('0x14'),_0x55c473[_0xa3fb('0x15')],_0x4c1a6a[_0xa3fb('0x16')],_0x4c1a6a[_0xa3fb('0x17')])}};var _0x11c22b=path[_0xa3fb('0x18')](__dirname,_0xa3fb('0x19'));var _0x432703=_0x55c473[_0xa3fb('0x1a')];var _0x205464=util[_0xa3fb('0xf')]('%s.%s',path[_0xa3fb('0x1b')](_0x55c473[_0xa3fb('0x1a')],path[_0xa3fb('0x1c')](_0x55c473[_0xa3fb('0x1a')])),_0xa3fb('0x1d'));var _0x3a2a77=path[_0xa3fb('0x18')](_0x11c22b,_0x432703);var _0x4ed006=path[_0xa3fb('0x18')](_0x11c22b,_0x205464);if(fs[_0xa3fb('0x1e')](_0x3a2a77)){_0x55c473[_0xa3fb('0x1f')]='Sent';_0x59d321['message'][_0xa3fb('0x20')]=[{'filename':_0x432703,'path':_0x3a2a77}];_0x59d321['message'][_0xa3fb('0x21')]=util['format'](_0xa3fb('0x22'),JSON[_0xa3fb('0x23')](_0x55c473,null,0x2));}else if(fs['existsSync'](_0x4ed006)){_0x55c473[_0xa3fb('0x1f')]=_0xa3fb('0x24');_0x59d321[_0xa3fb('0x25')][_0xa3fb('0x20')]=[{'filename':_0x205464,'path':_0x4ed006}];}else{_0x59d321[_0xa3fb('0x25')]['text']=_0xa3fb('0x26');if(!_0x4c1a6a[_0xa3fb('0x27')]){_0x444224=![];logger[_0xa3fb('0xc')](_0xa3fb('0x28'));}}if(_0x444224){return client['request'](_0xa3fb('0x29'),_0x59d321)['then'](function(_0x1f4dce){if(_0x1f4dce['error']){return logger[_0xa3fb('0x2a')]('error\x20mail',JSON[_0xa3fb('0x23')](_0x1f4dce));}return logger[_0xa3fb('0xc')]('email\x20sent');})[_0xa3fb('0x2b')](function(_0x2cbb36){return logger['error'](_0xa3fb('0x2c'),JSON['stringify'](_0x2cbb36));});}};}function handleError(){return function(_0x4890b5){return logger['error'](JSON['stringify'](_0x4890b5));};}function handleResult(_0x9593a6){return function(_0x55e201){logger['info'](_0xa3fb('0x2d'),JSON[_0xa3fb('0x23')](_0x55e201));if(_0x9593a6[_0xa3fb('0x11')]&&_0x9593a6[_0xa3fb('0x11')]['Smtp']&&!_['isNil'](_0x9593a6[_0xa3fb('0xe')])){setTimeout(handleSendEmail(_0x9593a6,_0x55e201),0x3c*0x3e8);}};}function handleJob(_0x369fbf){return function(){try{if(_[_0xa3fb('0x2e')](_0x369fbf[_0xa3fb('0x16')])){return logger[_0xa3fb('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xa3fb('0x2e')](_0x369fbf['subtractUnit'])){return logger[_0xa3fb('0xc')](_0xa3fb('0x2f'));}var _0x1273d7={'startDate':moment()[_0xa3fb('0x30')](_0x369fbf[_0xa3fb('0x16')],_0x369fbf[_0xa3fb('0x17')])['format'](_0xa3fb('0x31')),'endDate':moment()[_0xa3fb('0xf')](_0xa3fb('0x31')),'type':_0xa3fb('0x32'),'output':_0x369fbf['output'],'name':_0x369fbf[_0xa3fb('0x15')]};if(!_['isNil'](_0x369fbf[_0xa3fb('0x33')])){logger[_0xa3fb('0xc')](_0xa3fb('0x34'),_0x369fbf['DefaultReportId']);return analyticDefaultReportController[_0xa3fb('0x35')]({'id':_0x369fbf[_0xa3fb('0x33')]},_0x1273d7)[_0xa3fb('0x36')](handleResult(_0x369fbf))[_0xa3fb('0x2b')](handleError());}if(!_[_0xa3fb('0x2e')](_0x369fbf[_0xa3fb('0x37')])){logger[_0xa3fb('0xc')]('exec\x20custom\x20report\x20id:%s',_0x369fbf['CustomReportId']);return analyticCustomReportController[_0xa3fb('0x35')]({'id':_0x369fbf['CustomReportId']},_0x1273d7)[_0xa3fb('0x36')](handleResult(_0x369fbf))[_0xa3fb('0x2b')](handleError());}}catch(_0x327a32){logger[_0xa3fb('0x2a')](JSON[_0xa3fb('0x23')](_0x327a32));}return logger[_0xa3fb('0xc')](_0xa3fb('0x38'));};}function getJobs(_0x336460){var _0x143a08={};if(_0x336460){_0x143a08['id']=_0x336460;}return db[_0xa3fb('0x39')][_0xa3fb('0x3a')]({'where':_0x143a08,'include':[{'model':db[_0xa3fb('0x11')],'attributes':['id',_0xa3fb('0x15'),_0xa3fb('0xe')],'include':[{'model':db[_0xa3fb('0x3b')],'as':_0xa3fb('0x3c'),'include':[{'model':db[_0xa3fb('0x3d')],'as':'CloudProvider'}]}]}]})[_0xa3fb('0x36')](function(_0x3fc65b){var _0x241f4d=_[_0xa3fb('0x3e')](manager[_0xa3fb('0x3f')]);var _0x4b233e=_[_0xa3fb('0x40')](_0x3fc65b,function(_0x3ed7cb){return _0x3ed7cb['id']['toString']();});var _0xfe96fa=_[_0xa3fb('0x41')](_0x3fc65b,function(_0x5a0fdb){return _0x5a0fdb['id'][_0xa3fb('0x42')]();});var _0x12bacf=_0x336460?_0x4b233e:_[_0xa3fb('0x43')](_0x4b233e,_0x241f4d);var _0x1c0d36=_['intersection'](_0x4b233e,_0x241f4d);var _0x6d2afb=_[_0xa3fb('0x43')](_0x241f4d,_0x4b233e);var _0x1068cf;var _0xe2192e;for(_0x1068cf=0x0;_0x1068cf<_0x6d2afb[_0xa3fb('0x44')]&&!_0x336460;_0x1068cf+=0x1){_0xe2192e=_0x6d2afb[_0x1068cf][_0xa3fb('0x42')]();if(manager[_0xa3fb('0x45')](_0xe2192e)){manager[_0xa3fb('0x46')](_0xe2192e);manager[_0xa3fb('0x47')](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x48'),_0xe2192e);}}logger[_0xa3fb('0xc')](_0xa3fb('0x49'),JSON[_0xa3fb('0x23')](_0x12bacf));for(_0x1068cf=0x0;_0x1068cf<_0x12bacf[_0xa3fb('0x44')];_0x1068cf+=0x1){_0xe2192e=_0x12bacf[_0x1068cf]['toString']();logger[_0xa3fb('0xc')](_0xa3fb('0x4a'),_0xe2192e);if(_0x336460){logger[_0xa3fb('0xc')](_0xa3fb('0x4b'),_0x336460);logger[_0xa3fb('0xc')](JSON[_0xa3fb('0x23')](_0xfe96fa[_0xe2192e]));BPromise[_0xa3fb('0x4c')]()['then'](handleJob(_0xfe96fa[_0xe2192e]));logger[_0xa3fb('0xc')]('run\x20job',_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e]['cron']);}else if(_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]&&_0xfe96fa[_0xe2192e]['active']&&moment()[_0xa3fb('0x4e')](_0xfe96fa[_0xe2192e][_0xa3fb('0x4f')],_0xfe96fa[_0xe2192e][_0xa3fb('0x50')])){manager['add'](_0xe2192e,_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')],handleJob(_0xfe96fa[_0xe2192e]));manager['start'](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x51'),_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}else if(manager['exists'](_0xe2192e)){manager[_0xa3fb('0x46')](_0xe2192e);manager[_0xa3fb('0x47')](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x52'),_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}}for(_0x1068cf=0x0,_0xe2192e;_0x1068cf<_0x1c0d36[_0xa3fb('0x44')]&&!_0x336460;_0x1068cf+=0x1){_0xe2192e=_0x1c0d36[_0x1068cf][_0xa3fb('0x42')]();if(manager[_0xa3fb('0x45')](_0xe2192e)){if(_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]&&_0xfe96fa[_0xe2192e][_0xa3fb('0x53')]&&moment()[_0xa3fb('0x4e')](_0xfe96fa[_0xe2192e][_0xa3fb('0x4f')],_0xfe96fa[_0xe2192e][_0xa3fb('0x50')])){manager[_0xa3fb('0x54')](_0xe2192e,_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')],handleJob(_0xfe96fa[_0xe2192e]));logger[_0xa3fb('0xc')](_0xa3fb('0x55'),_0xfe96fa[_0xe2192e][_0xa3fb('0x15')],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}else{manager[_0xa3fb('0x46')](_0xe2192e);manager[_0xa3fb('0x47')](_0xe2192e);logger[_0xa3fb('0xc')](_0xa3fb('0x52'),_0xfe96fa[_0xe2192e]['name'],_0xfe96fa[_0xe2192e][_0xa3fb('0x4d')]);}}}})[_0xa3fb('0x2b')](function(_0x3e0474){logger[_0xa3fb('0x2a')](JSON['stringify'](_0x3e0474));});}exports['run']=function(_0x198d33){return getJobs(_0x198d33);};exports[_0xa3fb('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 304bd84..12008f4 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 _0x30fc=['Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','Sentiment','Neutral','COMPLETED','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','Settings\x20not\x20available','transcribe','forEach','push','all','error','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','bucket','Sequelize','Transcript\x20not\x20available','CloudProvider','findOne','ValidationError','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive'];(function(_0x49f374,_0x2b504d){var _0x23ff88=function(_0x277925){while(--_0x277925){_0x49f374['push'](_0x49f374['shift']());}};_0x23ff88(++_0x2b504d);}(_0x30fc,0x64));var _0xc30f=function(_0x535c2b,_0x13368b){_0x535c2b=_0x535c2b-0x0;var _0x347f9d=_0x30fc[_0x535c2b];return _0x347f9d;};var _=require(_0xc30f('0x0'));var AWS=require(_0xc30f('0x1'));var rp=require('request-promise');var util=require(_0xc30f('0x2'));var BPromise=require(_0xc30f('0x3'));var db=require(_0xc30f('0x4'))['db'];var logger=require(_0xc30f('0x5'))('transcribe');function getTranscriptionJob(_0xa8299e,_0x16c57d,_0x342b94,_0x22a3a7){return new Promise(function(_0x2948cb,_0x293391){var _0x54c174=new AWS[(_0xc30f('0x6'))]({'accessKeyId':_0x16c57d,'secretAccessKey':_0xa8299e,'region':_0x342b94});_0x54c174[_0xc30f('0x7')]({'TranscriptionJobName':_0x22a3a7},function(_0x33a769,_0x3d2167){if(_0x33a769){return _0x293391(_0x33a769);}else{return _0x2948cb(_0x3d2167);}});});}function sentiment(_0x2e328e,_0x25a9f1,_0x436059,_0x29a9df,_0x25f066){return new Promise(function(_0x597d99,_0x1c3a1b){var _0x5e1429=new AWS[(_0xc30f('0x8'))]({'accessKeyId':_0x25a9f1,'secretAccessKey':_0x2e328e,'region':_0x436059});_0x5e1429[_0xc30f('0x9')]({'Text':_0x29a9df,'LanguageCode':_0x25f066[_0xc30f('0xa')](0x0,0x2)},function(_0x1ccb60,_0x1bf15a){if(_0x1ccb60){return _0x1c3a1b(_0x1ccb60);}else{return _0x597d99(_0x1bf15a);}});});}function checkTranscribeJob(_0x3cd910,_0x4f6d18,_0x524998){var _0x3bc956;return new BPromise(function(_0x101bc4,_0x38fbc4){logger[_0xc30f('0xb')](util['format'](_0xc30f('0xc'),_0x3cd910['id'],_0x3cd910[_0xc30f('0xd')]));return getTranscriptionJob(_0x524998[_0xc30f('0xe')],_0x524998[_0xc30f('0xf')],_0x4f6d18[_0xc30f('0x10')],_0x3cd910[_0xc30f('0xd')])[_0xc30f('0x11')](function(_0x4fbdcd){logger['info'](util[_0xc30f('0x12')](_0xc30f('0x13'),_0x3cd910['id'],_0x3cd910[_0xc30f('0xd')],_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x15')]));if(!_0x3cd910[_0xc30f('0x16')]){switch(_0x4fbdcd['TranscriptionJob'][_0xc30f('0x15')]){case'COMPLETED':var _0xce9c9={'transcribeStatus':_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x15')],'fileUri':_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x17')][_0xc30f('0x18')]};logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x19'),_0x3cd910['id']));return rp({'uri':_0x4fbdcd['TranscriptionJob'][_0xc30f('0x17')][_0xc30f('0x18')],'json':!![]})['then'](function(_0x218e5b){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x1a'),_0x3cd910['id']));if(_0x218e5b&&_0x218e5b[_0xc30f('0x1b')]&&_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')]&&_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')]['length']){_0xce9c9[_0xc30f('0x16')]='';for(var _0x50122e=0x0;_0x50122e<_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')][_0xc30f('0x1d')];_0x50122e++){_0xce9c9[_0xc30f('0x16')]+=_0x218e5b[_0xc30f('0x1b')][_0xc30f('0x1c')][_0x50122e][_0xc30f('0x1e')]+'';}}return _0x3cd910[_0xc30f('0x1f')](_0xce9c9);})[_0xc30f('0x11')](function(){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x20'),_0x3cd910['id']));if(!_0x3cd910[_0xc30f('0x21')]){throw new db['Sequelize']['ValidationError'](_0xc30f('0x22'));}if(!_0x4f6d18[_0xc30f('0x23')]||!_0x4f6d18[_0xc30f('0x24')]||!_0x4f6d18[_0xc30f('0x25')]||!_0x4f6d18['language']||!_0x4f6d18[_0xc30f('0x26')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0xce9c9[_0xc30f('0x16')]){throw new Error(_0xc30f('0x28'));}if(_0x4f6d18[_0xc30f('0x24')]===_0x524998['id']){return _0x524998;}else{return db[_0xc30f('0x29')][_0xc30f('0x2a')]({'where':{'id':_settings[_0xc30f('0x24')]}});}})['then'](function(_0x2cf0b2){if(!_0x2cf0b2){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))](_0xc30f('0x2c'));}if(!_0x2cf0b2[_0xc30f('0xe')]||!_0x2cf0b2[_0xc30f('0xf')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x3bc956=_0x2cf0b2;logger[_0xc30f('0xb')](util[_0xc30f('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3cd910['id']));return sentiment(_0x3bc956[_0xc30f('0xe')],_0x3bc956['data2'],_0x4f6d18['sentimentRegion'],_0xce9c9[_0xc30f('0x16')],_0x4f6d18['language']);})['then'](function(_0x432b18){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x2d'),_0x3cd910['id']));return _0x3cd910['update']({'sentiment':_0x432b18['Sentiment'],'sPositive':_0x432b18[_0xc30f('0x2e')][_0xc30f('0x2f')],'sNegative':_0x432b18['SentimentScore'][_0xc30f('0x30')],'sMixed':_0x432b18[_0xc30f('0x2e')][_0xc30f('0x31')],'sNeutral':_0x432b18['SentimentScore']['Neutral']});})['then'](function(){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x20'),_0x3cd910['id']));_0x101bc4();});case _0xc30f('0x32'):return _0x3cd910[_0xc30f('0x1f')]({'transcribeStatus':_0xc30f('0x32'),'failureReason':_0x4fbdcd[_0xc30f('0x14')][_0xc30f('0x33')]})[_0xc30f('0x11')](function(){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x20'),_0x3cd910['id']));_0x101bc4();});default:logger['info'](util[_0xc30f('0x12')](_0xc30f('0x34'),_0x3cd910['id']));break;}}else{return BPromise[_0xc30f('0x35')]()[_0xc30f('0x11')](function(){if(!_0x3cd910[_0xc30f('0x21')]){throw new db['Sequelize'][(_0xc30f('0x2b'))](_0xc30f('0x22'));}if(!_0x4f6d18['sentiment']||!_0x4f6d18[_0xc30f('0x24')]||!_0x4f6d18[_0xc30f('0x25')]||!_0x4f6d18[_0xc30f('0x36')]||!_0x4f6d18[_0xc30f('0x26')]){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))](_0xc30f('0x37'));}if(!_0x3cd910[_0xc30f('0x16')]){throw new Error(_0xc30f('0x28'));}if(_0x4f6d18[_0xc30f('0x24')]===_0x524998['id']){return _0x524998;}else{return db[_0xc30f('0x29')][_0xc30f('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xc30f('0x11')](function(_0x20d0dd){if(!_0x20d0dd){throw new db['Sequelize'][(_0xc30f('0x2b'))](_0xc30f('0x2c'));}if(!_0x20d0dd[_0xc30f('0xe')]||!_0x20d0dd[_0xc30f('0xf')]){throw new db[(_0xc30f('0x27'))]['ValidationError'](_0xc30f('0x38'));}_0x3bc956=_0x20d0dd;logger[_0xc30f('0xb')](util[_0xc30f('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3cd910['id']));return sentiment(_0x3bc956[_0xc30f('0xe')],_0x3bc956[_0xc30f('0xf')],_0x4f6d18[_0xc30f('0x25')],_0x3cd910['fileText'],_0x4f6d18[_0xc30f('0x36')]);})[_0xc30f('0x11')](function(_0x35acc3){logger[_0xc30f('0xb')](util[_0xc30f('0x12')](_0xc30f('0x2d'),_0x3cd910['id']));return _0x3cd910['update']({'sentiment':_0x35acc3[_0xc30f('0x39')],'sPositive':_0x35acc3['SentimentScore'][_0xc30f('0x2f')],'sNegative':_0x35acc3[_0xc30f('0x2e')][_0xc30f('0x30')],'sMixed':_0x35acc3[_0xc30f('0x2e')]['Mixed'],'sNeutral':_0x35acc3['SentimentScore'][_0xc30f('0x3a')],'transcribeStatus':_0xc30f('0x3b')});})[_0xc30f('0x11')](function(){logger[_0xc30f('0xb')](util['format'](_0xc30f('0x20'),_0x3cd910['id']));_0x101bc4();});}})[_0xc30f('0x3c')](function(_0x2da350){if(_0x2da350){if(!_0x2da350[_0xc30f('0x3d')]||_0x2da350[_0xc30f('0x3d')]!==_0xc30f('0x3e')){logger['error'](util[_0xc30f('0x12')](_0xc30f('0x3f'),_0x3cd910['id']),util[_0xc30f('0x40')](_0x2da350,{'showHidden':![],'depth':null}));}}_0x101bc4();});});}function checkTranscribe(){var _0x5dc074;var _0x507316;var _0x23d9dc;return db[_0xc30f('0x41')][_0xc30f('0x42')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xc30f('0x11')](function(_0x24b3de){if(!_0x24b3de||!_0x24b3de[_0xc30f('0x1d')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x5dc074=_0x24b3de;return db['Setting'][_0xc30f('0x2a')]({'where':{'id':0x1}});})[_0xc30f('0x11')](function(_0x3ddda2){if(!_0x3ddda2){throw new db[(_0xc30f('0x27'))]['ValidationError'](_0xc30f('0x43'));}_0x507316=_0x3ddda2;if(!_0x507316[_0xc30f('0x44')]||!_0x507316['transcribeAccountId']||!_0x507316[_0xc30f('0x10')]||!_0x507316[_0xc30f('0x36')]||!_0x507316[_0xc30f('0x26')]){throw new db[(_0xc30f('0x27'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0xc30f('0x29')]['findOne']({'where':{'id':_0x507316['transcribeAccountId']}});})[_0xc30f('0x11')](function(_0x20bc25){if(!_0x20bc25){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))](_0xc30f('0x2c'));}if(!_0x20bc25['data1']||!_0x20bc25[_0xc30f('0xf')]){throw new db[(_0xc30f('0x27'))][(_0xc30f('0x2b'))]('Cloud\x20Provider\x20not\x20configured');}_0x23d9dc=_0x20bc25;var _0x3593a6=[];_0x5dc074[_0xc30f('0x45')](function(_0x4166bf){_0x3593a6[_0xc30f('0x46')](checkTranscribeJob(_0x4166bf,_0x507316,_0x23d9dc));});return BPromise[_0xc30f('0x47')](_0x3593a6);})['catch'](function(_0x2e692e){if(_0x2e692e){if(!_0x2e692e['name']||_0x2e692e[_0xc30f('0x3d')]!==_0xc30f('0x3e')){logger[_0xc30f('0x48')](util[_0xc30f('0x40')](_0x2e692e,{'showHidden':![],'depth':null}));}}});}exports[_0xc30f('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xe1e3=['tempSentiment','ValidationError','sentiment','sentimentAccountId','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','then','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','data2','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Positive','Neutral','catch','name','error','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','findOne','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','forEach','push','lodash','aws-sdk','util','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated'];(function(_0x16d7a6,_0x4dac64){var _0x397bc1=function(_0x60f652){while(--_0x60f652){_0x16d7a6['push'](_0x16d7a6['shift']());}};_0x397bc1(++_0x4dac64);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x140ad6,_0x1e9c2f){_0x140ad6=_0x140ad6-0x0;var _0x433b42=_0xe1e3[_0x140ad6];return _0x433b42;};var _=require(_0x3e1e('0x0'));var AWS=require(_0x3e1e('0x1'));var rp=require('request-promise');var util=require(_0x3e1e('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x3e1e('0x3'))('transcribe');function getTranscriptionJob(_0x3bacc,_0x5a11ef,_0x1abd25,_0x397376){return new Promise(function(_0x40d6d8,_0x25701f){var _0x55cfba=new AWS[(_0x3e1e('0x4'))]({'accessKeyId':_0x5a11ef,'secretAccessKey':_0x3bacc,'region':_0x1abd25});_0x55cfba[_0x3e1e('0x5')]({'TranscriptionJobName':_0x397376},function(_0x2f0e12,_0xa67e35){if(_0x2f0e12){return _0x25701f(_0x2f0e12);}else{return _0x40d6d8(_0xa67e35);}});});}function sentiment(_0x3f085b,_0x1e5173,_0x5e7d1f,_0x5c4c25,_0x5060e8){return new Promise(function(_0x31d205,_0x5b0df8){var _0x349460=new AWS[(_0x3e1e('0x6'))]({'accessKeyId':_0x1e5173,'secretAccessKey':_0x3f085b,'region':_0x5e7d1f});_0x349460[_0x3e1e('0x7')]({'Text':_0x5c4c25,'LanguageCode':_0x5060e8['substring'](0x0,0x2)},function(_0x4bf92d,_0x4e6eee){if(_0x4bf92d){return _0x5b0df8(_0x4bf92d);}else{return _0x31d205(_0x4e6eee);}});});}function checkTranscribeJob(_0x4fcd4f,_0x4e47b9,_0x536129){var _0x5c09a2;return new BPromise(function(_0x14ad58,_0x595660){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x9'),_0x4fcd4f['id'],_0x4fcd4f[_0x3e1e('0xa')]));return getTranscriptionJob(_0x536129['data1'],_0x536129['data2'],_0x4e47b9[_0x3e1e('0xb')],_0x4fcd4f[_0x3e1e('0xa')])['then'](function(_0x26cb35){logger[_0x3e1e('0xc')](util['format'](_0x3e1e('0xd'),_0x4fcd4f['id'],_0x4fcd4f['transcribeName'],_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0xf')]));if(!_0x4fcd4f[_0x3e1e('0x10')]){switch(_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0xf')]){case _0x3e1e('0x11'):var _0x569f49={'transcribeStatus':_0x26cb35['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x12')][_0x3e1e('0x13')]};logger['info'](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Get\x20transcript',_0x4fcd4f['id']));return rp({'uri':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x12')][_0x3e1e('0x13')],'json':!![]})['then'](function(_0x53e051){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4fcd4f['id']));if(_0x53e051&&_0x53e051['results']&&_0x53e051[_0x3e1e('0x14')][_0x3e1e('0x15')]&&_0x53e051['results'][_0x3e1e('0x15')][_0x3e1e('0x16')]){_0x569f49[_0x3e1e('0x10')]='';for(var _0x33bf0f=0x0;_0x33bf0f<_0x53e051[_0x3e1e('0x14')][_0x3e1e('0x15')][_0x3e1e('0x16')];_0x33bf0f++){_0x569f49[_0x3e1e('0x10')]+=_0x53e051['results']['transcripts'][_0x33bf0f][_0x3e1e('0x17')]+'';}}return _0x4fcd4f[_0x3e1e('0x18')](_0x569f49);})['then'](function(){logger['info'](util['format'](_0x3e1e('0x19'),_0x4fcd4f['id']));if(!_0x4fcd4f[_0x3e1e('0x1a')]){throw new db['Sequelize'][(_0x3e1e('0x1b'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4e47b9[_0x3e1e('0x1c')]||!_0x4e47b9[_0x3e1e('0x1d')]||!_0x4e47b9['sentimentRegion']||!_0x4e47b9[_0x3e1e('0x1e')]||!_0x4e47b9[_0x3e1e('0x1f')]){throw new db[(_0x3e1e('0x20'))]['ValidationError'](_0x3e1e('0x21'));}if(!_0x569f49['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x4e47b9['sentimentAccountId']===_0x536129['id']){return _0x536129;}else{return db[_0x3e1e('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3e1e('0x23')](function(_0x468336){if(!_0x468336){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x24'));}if(!_0x468336['data1']||!_0x468336['data2']){throw new db['Sequelize']['ValidationError'](_0x3e1e('0x25'));}_0x5c09a2=_0x468336;logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x26'),_0x4fcd4f['id']));return sentiment(_0x5c09a2[_0x3e1e('0x27')],_0x5c09a2[_0x3e1e('0x28')],_0x4e47b9[_0x3e1e('0x29')],_0x569f49[_0x3e1e('0x10')],_0x4e47b9['language']);})[_0x3e1e('0x23')](function(_0x348ef5){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x2a'),_0x4fcd4f['id']));return _0x4fcd4f[_0x3e1e('0x18')]({'sentiment':_0x348ef5[_0x3e1e('0x2b')],'sPositive':_0x348ef5['SentimentScore']['Positive'],'sNegative':_0x348ef5[_0x3e1e('0x2c')][_0x3e1e('0x2d')],'sMixed':_0x348ef5['SentimentScore'][_0x3e1e('0x2e')],'sNeutral':_0x348ef5[_0x3e1e('0x2c')]['Neutral']});})[_0x3e1e('0x23')](function(){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});case _0x3e1e('0x2f'):return _0x4fcd4f['update']({'transcribeStatus':_0x3e1e('0x2f'),'failureReason':_0x26cb35[_0x3e1e('0xe')][_0x3e1e('0x30')]})[_0x3e1e('0x23')](function(){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});default:logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')](_0x3e1e('0x31'),_0x4fcd4f['id']));break;}}else{return BPromise[_0x3e1e('0x32')]()[_0x3e1e('0x23')](function(){if(!_0x4fcd4f['tempSentiment']){throw new db[(_0x3e1e('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4e47b9[_0x3e1e('0x1c')]||!_0x4e47b9[_0x3e1e('0x1d')]||!_0x4e47b9[_0x3e1e('0x29')]||!_0x4e47b9['language']||!_0x4e47b9[_0x3e1e('0x1f')]){throw new db[(_0x3e1e('0x20'))]['ValidationError'](_0x3e1e('0x21'));}if(!_0x4fcd4f[_0x3e1e('0x10')]){throw new Error('Transcript\x20not\x20available');}if(_0x4e47b9['sentimentAccountId']===_0x536129['id']){return _0x536129;}else{return db[_0x3e1e('0x22')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3e1e('0x23')](function(_0x3d4a8d){if(!_0x3d4a8d){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x24'));}if(!_0x3d4a8d['data1']||!_0x3d4a8d['data2']){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x25'));}_0x5c09a2=_0x3d4a8d;logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x26'),_0x4fcd4f['id']));return sentiment(_0x5c09a2[_0x3e1e('0x27')],_0x5c09a2['data2'],_0x4e47b9[_0x3e1e('0x29')],_0x4fcd4f['fileText'],_0x4e47b9['language']);})[_0x3e1e('0x23')](function(_0x9053cd){logger[_0x3e1e('0xc')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4fcd4f['id']));return _0x4fcd4f['update']({'sentiment':_0x9053cd['Sentiment'],'sPositive':_0x9053cd['SentimentScore'][_0x3e1e('0x33')],'sNegative':_0x9053cd[_0x3e1e('0x2c')]['Negative'],'sMixed':_0x9053cd['SentimentScore'][_0x3e1e('0x2e')],'sNeutral':_0x9053cd[_0x3e1e('0x2c')][_0x3e1e('0x34')],'transcribeStatus':'COMPLETED'});})[_0x3e1e('0x23')](function(){logger['info'](util[_0x3e1e('0x8')](_0x3e1e('0x19'),_0x4fcd4f['id']));_0x14ad58();});}})[_0x3e1e('0x35')](function(_0xb03215){if(_0xb03215){if(!_0xb03215[_0x3e1e('0x36')]||_0xb03215[_0x3e1e('0x36')]!=='SequelizeValidationError'){logger[_0x3e1e('0x37')](util[_0x3e1e('0x8')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4fcd4f['id']),util[_0x3e1e('0x38')](_0xb03215,{'showHidden':![],'depth':null}));}}_0x14ad58();});});}function checkTranscribe(){var _0x24d320;var _0x551573;var _0x1cc820;return db[_0x3e1e('0x39')][_0x3e1e('0x3a')]({'where':{'transcribeStatus':_0x3e1e('0x3b')}})['then'](function(_0x108b79){if(!_0x108b79||!_0x108b79[_0x3e1e('0x16')]){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))]('No\x20transcribe\x20job\x20to\x20check');}_0x24d320=_0x108b79;return db[_0x3e1e('0x3c')][_0x3e1e('0x3d')]({'where':{'id':0x1}});})[_0x3e1e('0x23')](function(_0x25ddf7){if(!_0x25ddf7){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x3e'));}_0x551573=_0x25ddf7;if(!_0x551573[_0x3e1e('0x3f')]||!_0x551573['transcribeAccountId']||!_0x551573[_0x3e1e('0xb')]||!_0x551573['language']||!_0x551573['bucket']){throw new db['Sequelize'][(_0x3e1e('0x1b'))](_0x3e1e('0x40'));}return db['CloudProvider'][_0x3e1e('0x3d')]({'where':{'id':_0x551573['transcribeAccountId']}});})['then'](function(_0x3eaf76){if(!_0x3eaf76){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3eaf76[_0x3e1e('0x27')]||!_0x3eaf76[_0x3e1e('0x28')]){throw new db[(_0x3e1e('0x20'))][(_0x3e1e('0x1b'))](_0x3e1e('0x25'));}_0x1cc820=_0x3eaf76;var _0xe18f8a=[];_0x24d320[_0x3e1e('0x41')](function(_0x5b71a6){_0xe18f8a[_0x3e1e('0x42')](checkTranscribeJob(_0x5b71a6,_0x551573,_0x1cc820));});return BPromise['all'](_0xe18f8a);})[_0x3e1e('0x35')](function(_0x286fef){if(_0x286fef){if(!_0x286fef[_0x3e1e('0x36')]||_0x286fef['name']!=='SequelizeValidationError'){logger[_0x3e1e('0x37')](util[_0x3e1e('0x38')](_0x286fef,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 6346798..c7230d5 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 _0xfd7c=['start','lodash','moment','ioredis','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','lastMsgAt','subtract','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','format','length','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect'];(function(_0x30d15f,_0x46059d){var _0x5aefaa=function(_0x130181){while(--_0x130181){_0x30d15f['push'](_0x30d15f['shift']());}};_0x5aefaa(++_0x46059d);}(_0xfd7c,0xe2));var _0xcfd7=function(_0x505776,_0x5d2be8){_0x505776=_0x505776-0x0;var _0x4e9c98=_0xfd7c[_0x505776];return _0x4e9c98;};'use strict';var _=require(_0xcfd7('0x0'));var moment=require(_0xcfd7('0x1'));var Redis=require(_0xcfd7('0x2'));var util=require('util');var config=require(_0xcfd7('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xcfd7('0x4'))(_0xcfd7('0x5'));config['redis']=_['defaults'](config[_0xcfd7('0x6')],{'host':_0xcfd7('0x7'),'port':0x18eb});var io=require(_0xcfd7('0x8'))(new Redis(config[_0xcfd7('0x6')]));function closeInteractions(){var _0x508531=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0xcfd7('0x9')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xcfd7('0xa')](0x18,'hours')}}})['then'](function(_0x549ebd){if(_0x549ebd&&_0x549ebd['length']){_0x508531=_[_0xcfd7('0xb')](_0x549ebd||[],'id');logger[_0xcfd7('0xc')](_0xcfd7('0xd'),_0x508531[_0xcfd7('0xe')]());return db['WhatsappInteraction'][_0xcfd7('0xf')]({'closeReason':_0xcfd7('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xcfd7('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x508531}});}})['then'](function(){if(_0x508531&&_0x508531['length']){logger[_0xcfd7('0xc')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x508531[_0xcfd7('0xe')]());for(var _0x2471c5=0x0;_0x2471c5<_0x508531[_0xcfd7('0x12')];_0x2471c5++){io[_0xcfd7('0x13')]('whatsappInteraction:update',{'id':_0x508531[_0x2471c5],'closed':!![]});}}})[_0xcfd7('0x14')](function(_0x1642e1){logger[_0xcfd7('0x15')](_0xcfd7('0x16'),_0x1642e1?util[_0xcfd7('0x17')](_0x1642e1,{'showHidden':![],'depth':null}):'');});}exports[_0xcfd7('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfb60=['catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update'];(function(_0x4a2b47,_0x406acd){var _0x3c5e11=function(_0x2e5be6){while(--_0x2e5be6){_0x4a2b47['push'](_0x4a2b47['shift']());}};_0x3c5e11(++_0x406acd);}(_0xfb60,0x1f3));var _0x0fb6=function(_0x2a70be,_0x490f9d){_0x2a70be=_0x2a70be-0x0;var _0x8f42cd=_0xfb60[_0x2a70be];return _0x8f42cd;};'use strict';var _=require(_0x0fb6('0x0'));var moment=require('moment');var Redis=require(_0x0fb6('0x1'));var util=require(_0x0fb6('0x2'));var config=require(_0x0fb6('0x3'));var db=require(_0x0fb6('0x4'))['db'];var logger=require(_0x0fb6('0x5'))(_0x0fb6('0x6'));config[_0x0fb6('0x7')]=_[_0x0fb6('0x8')](config['redis'],{'host':_0x0fb6('0x9'),'port':0x18eb});var io=require(_0x0fb6('0xa'))(new Redis(config[_0x0fb6('0x7')]));function closeInteractions(){var _0x3df66c=[];return db[_0x0fb6('0xb')][_0x0fb6('0xc')]({'raw':!![],'attributes':['id',_0x0fb6('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0fb6('0xe')](0x18,'hours')}}})['then'](function(_0xf73247){if(_0xf73247&&_0xf73247[_0x0fb6('0xf')]){_0x3df66c=_[_0x0fb6('0x10')](_0xf73247||[],'id');logger[_0x0fb6('0x11')](_0x0fb6('0x12'),_0x3df66c[_0x0fb6('0x13')]());return db[_0x0fb6('0xb')][_0x0fb6('0x14')]({'closeReason':_0x0fb6('0x15'),'disposition':_0x0fb6('0x16'),'closed':!![],'closedAt':moment()[_0x0fb6('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3df66c}});}})[_0x0fb6('0x18')](function(){if(_0x3df66c&&_0x3df66c[_0x0fb6('0xf')]){logger['info'](_0x0fb6('0x19'),_0x3df66c[_0x0fb6('0x13')]());for(var _0x51ff55=0x0;_0x51ff55<_0x3df66c['length'];_0x51ff55++){io[_0x0fb6('0x1a')](_0x0fb6('0x1b'),{'id':_0x3df66c[_0x51ff55],'closed':!![]});}}})[_0x0fb6('0x1c')](function(_0x13086f){logger['error'](_0x0fb6('0x1d'),_0x13086f?util['inspect'](_0x13086f,{'showHidden':![],'depth':null}):'');});}exports[_0x0fb6('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 2218396..0b7f2f4 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c03=['then','hopper1','CmHopper','../mysqldb','push','Innocenzo','innocenzo.biondo','now','Biondo','@xcally.com','CmContact','destroy','bulkCreate','log','finished\x20populating','contacts1'];(function(_0x549535,_0x4e0805){var _0x2a069e=function(_0x1cbff2){while(--_0x1cbff2){_0x549535['push'](_0x549535['shift']());}};_0x2a069e(++_0x4e0805);}(_0x4c03,0x1e3));var _0x34c0=function(_0x2e4090,_0xdd468b){_0x2e4090=_0x2e4090-0x0;var _0x4ef5f8=_0x4c03[_0x2e4090];return _0x4ef5f8;};'use strict';var util=require('util');var db=require(_0x34c0('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x34c0('0x1')]({'id':i,'firstName':_0x34c0('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x34c0('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x34c0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x34c0('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x34c0('0x4')](),'updatedAt':Date[_0x34c0('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x34c0('0x5')+i,'phone':0xf879fb460+i,'email':_0x34c0('0x3')+i+_0x34c0('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x34c0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x34c0('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x34c0('0x4')](),'updatedAt':Date[_0x34c0('0x4')]()});}db[_0x34c0('0x7')][_0x34c0('0x8')]({'where':{}})['then'](function(){return db[_0x34c0('0x7')][_0x34c0('0x9')](contacts);})['then'](function(){console[_0x34c0('0xa')](_0x34c0('0xb'),_0x34c0('0xc'));return db['CmHopper'][_0x34c0('0x8')]({'where':{}});})[_0x34c0('0xd')](function(){return db['CmHopper'][_0x34c0('0x9')](hopper);})['then'](function(){console[_0x34c0('0xa')](_0x34c0('0xb'),_0x34c0('0xe'));return db[_0x34c0('0x7')][_0x34c0('0x9')](contacts2);})['then'](function(){console['log']('finished\x20populating','contacts2');return db[_0x34c0('0xf')][_0x34c0('0x9')](hopper2);})[_0x34c0('0xd')](function(){console[_0x34c0('0xa')]('finished\x20populating','hopper2');})['catch'](function(_0x13fd5a){console[_0x34c0('0xa')](_0x13fd5a);}); \ No newline at end of file +var _0x28c2=['contacts1','CmHopper','contacts2','hopper2','util','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0xb2c3c2,_0x1d0ff7){var _0x42ff7c=function(_0x2eaddf){while(--_0x2eaddf){_0xb2c3c2['push'](_0xb2c3c2['shift']());}};_0x42ff7c(++_0x1d0ff7);}(_0x28c2,0x190));var _0x228c=function(_0x3e0d2c,_0x4ecde4){_0x3e0d2c=_0x3e0d2c-0x0;var _0x51340c=_0x28c2[_0x3e0d2c];return _0x51340c;};'use strict';var util=require(_0x228c('0x0'));var db=require(_0x228c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x228c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x228c('0x3')+i,'phone':0xf879fb460+i,'email':_0x228c('0x4')+i+_0x228c('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x228c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x228c('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x228c('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x228c('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x228c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x228c('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x228c('0x6')](),'updatedAt':Date[_0x228c('0x6')]()});}db[_0x228c('0x8')][_0x228c('0x9')]({'where':{}})[_0x228c('0xa')](function(){return db[_0x228c('0x8')][_0x228c('0xb')](contacts);})[_0x228c('0xa')](function(){console[_0x228c('0xc')](_0x228c('0xd'),_0x228c('0xe'));return db['CmHopper'][_0x228c('0x9')]({'where':{}});})[_0x228c('0xa')](function(){return db[_0x228c('0xf')][_0x228c('0xb')](hopper);})['then'](function(){console[_0x228c('0xc')](_0x228c('0xd'),'hopper1');return db[_0x228c('0x8')][_0x228c('0xb')](contacts2);})[_0x228c('0xa')](function(){console['log'](_0x228c('0xd'),_0x228c('0x10'));return db[_0x228c('0xf')][_0x228c('0xb')](hopper2);})[_0x228c('0xa')](function(){console[_0x228c('0xc')](_0x228c('0xd'),_0x228c('0x11'));})['catch'](function(_0x1ac53f){console[_0x228c('0xc')](_0x1ac53f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c9de58b..f73fa31 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e00=['agent','format','%s%s@xcally.com','password','friend','wss','ulaw','yes','/etc/pki/tls/private/motion.key','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5e00,0xba));var _0x05e0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5e00[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x05e0('0x0'));var db=require(_0x05e0('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x05e0('0x2')]({'name':util['format'](_0x05e0('0x3'),_0x05e0('0x4'),i),'fullname':util['format'](_0x05e0('0x3'),'agent',i),'email':util[_0x05e0('0x5')](_0x05e0('0x6'),_0x05e0('0x4'),i),'role':_0x05e0('0x4'),'password':_0x05e0('0x7'),'internal':0xfa0+i,'type':_0x05e0('0x8'),'transport':['udp','ws',_0x05e0('0x9')],'disallow':['all'],'allow':[_0x05e0('0xa')],'defaultuser':util[_0x05e0('0x5')](_0x05e0('0x3'),_0x05e0('0x4'),i),'encryption':_0x05e0('0xb'),'avpf':_0x05e0('0xb'),'force_avp':'yes','icesupport':_0x05e0('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x05e0('0xc'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x05e0('0x5')]('%s%s',_0x05e0('0x4'),i),0xfa0+i)});}db[_0x05e0('0xd')][_0x05e0('0xe')](users)[_0x05e0('0xf')](function(){console[_0x05e0('0x10')](_0x05e0('0x11'));})[_0x05e0('0x12')](function(_0x16ec24){console['log'](_0x16ec24);}); \ No newline at end of file +var _0x48e5=['then','log','add\x20user','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate'];(function(_0x2c4c45,_0x2e1b10){var _0x1d96e7=function(_0x5417ba){while(--_0x5417ba){_0x2c4c45['push'](_0x2c4c45['shift']());}};_0x1d96e7(++_0x2e1b10);}(_0x48e5,0x12f));var _0x548e=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0x48e5[_0x2f87cd];return _0x5d7eda;};'use strict';var util=require(_0x548e('0x0'));var db=require(_0x548e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x548e('0x2')]({'name':util[_0x548e('0x3')]('%s%s','agent',i),'fullname':util['format'](_0x548e('0x4'),'agent',i),'email':util[_0x548e('0x3')]('%s%s@xcally.com',_0x548e('0x5'),i),'role':_0x548e('0x5'),'password':_0x548e('0x6'),'internal':0xfa0+i,'type':_0x548e('0x7'),'transport':[_0x548e('0x8'),'ws',_0x548e('0x9')],'disallow':['all'],'allow':[_0x548e('0xa')],'defaultuser':util[_0x548e('0x3')](_0x548e('0x4'),_0x548e('0x5'),i),'encryption':_0x548e('0xb'),'avpf':_0x548e('0xb'),'force_avp':_0x548e('0xb'),'icesupport':_0x548e('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x548e('0xc'),'dtlsprivatekey':_0x548e('0xd'),'dtlssetup':_0x548e('0xe'),'callerid':util['format']('\x22%s\x22\x20<%s>',util['format']('%s%s','agent',i),0xfa0+i)});}db[_0x548e('0xf')][_0x548e('0x10')](users)[_0x548e('0x11')](function(){console[_0x548e('0x12')](_0x548e('0x13'));})['catch'](function(_0x21e60a){console[_0x548e('0x12')](_0x21e60a);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 61aa112..86e97f1 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc58=['Campaign','format','find','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','WhatsappQueue','user','VoiceQueue','ChatQueues','userProfileId','SmsQueues','SmsQueue','OpenchannelQueues','OpenchannelQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','findOne','then','VoiceQueues','FaxQueues','MailQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where'];(function(_0x25af3a,_0x4b9989){var _0x1d012b=function(_0x2b8d14){while(--_0x2b8d14){_0x25af3a['push'](_0x25af3a['shift']());}};_0x1d012b(++_0x4b9989);}(_0xcc58,0xab));var _0x8cc5=function(_0x12919e,_0x2cbd0b){_0x12919e=_0x12919e-0x0;var _0x26c230=_0xcc58[_0x12919e];return _0x26c230;};'use strict';var _=require(_0x8cc5('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x8cc5('0x1'))['db'];var config=require(_0x8cc5('0x2'));var queryQueues={'attributes':['id',_0x8cc5('0x3')],'include':[{'as':_0x8cc5('0x4'),'model':db['User'],'attributes':['id','name',_0x8cc5('0x5')],'raw':!![],'where':{'role':_0x8cc5('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8cc5('0x3')],'where':{'role':_0x8cc5('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x8cc5('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x8cc5('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8cc5('0x3'),_0x8cc5('0x8')],'where':{'type':_0x8cc5('0x9')}};function getAssociatedResources(_0x244203,_0x11fce6,_0x1c4dea){return db['UserProfileSection'][_0x8cc5('0xa')]({'where':{'name':_0x244203,'userProfileId':_0x11fce6},'raw':!![]})[_0x8cc5('0xb')](function(_0x3315d5){if(_0x3315d5){if(_0x3315d5['autoAssociation']){switch(_0x244203){case _0x8cc5('0xc'):case'ChatQueues':case _0x8cc5('0xd'):case'SmsQueues':case _0x8cc5('0xe'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x1c4dea][_0x8cc5('0xf')](queryQueues);case'Telephones':return db[_0x1c4dea][_0x8cc5('0xf')](queryTelephones);case _0x8cc5('0x10'):return db[_0x1c4dea]['findAll'](queryTrunks);case _0x8cc5('0x11'):return db[_0x1c4dea][_0x8cc5('0xf')](queryCampaigns);}}else{return db[_0x8cc5('0x12')][_0x8cc5('0xf')]({'attributes':[_0x8cc5('0x13')],'where':{'sectionId':_0x3315d5['id']},'raw':!![]})[_0x8cc5('0xb')](function(_0x10bbd7){if(_0x10bbd7){var _0x5a28c8={'where':{'id':_[_0x8cc5('0x14')](_0x10bbd7,_0x8cc5('0x13'))},'raw':!![]};switch(_0x1c4dea){case _0x8cc5('0x15'):_0x5a28c8[_0x8cc5('0x16')][_0x8cc5('0x5')]='telephone';break;case _0x8cc5('0x17'):_0x5a28c8[_0x8cc5('0x16')]['type']=_0x8cc5('0x9');break;}return db[_0x1c4dea][_0x8cc5('0xf')](_0x5a28c8);}else{return[];}});}}else{return[];}})[_0x8cc5('0xb')](function(_0xab691a){return _0xab691a;});}function joinOrLeaveQueues(_0x221c57,_0x323bab,_0x4f643e,_0x3a5b14){_0x221c57[_0x323bab](util[_0x8cc5('0x18')]('%s:queue:%s',_0x4f643e,_0x3a5b14[_0x8cc5('0x3')]));if(_0x3a5b14[_0x8cc5('0x4')]){for(var _0x7e91b8=0x0;_0x7e91b8<_0x3a5b14[_0x8cc5('0x4')]['length'];_0x7e91b8+=0x1){_0x221c57[_0x323bab](util[_0x8cc5('0x18')]('user:%s',_0x3a5b14[_0x8cc5('0x4')][_0x7e91b8][_0x8cc5('0x3')]));}}}function joinOrLeave(_0x35a471,_0x104f9f,_0x43cad3){var _0x2246f6;if(_0x35a471['handshake']['query']['id']){db[_0x8cc5('0x15')][_0x8cc5('0x19')]({'attributes':['id',_0x8cc5('0x3'),_0x8cc5('0x5'),'userProfileId'],'where':{'id':_0x35a471[_0x8cc5('0x1a')]['query']['id']},'include':[{'model':db[_0x8cc5('0x1b')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x1c')],'as':_0x8cc5('0x1d'),'attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x1e')],'as':_0x8cc5('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x20')],'as':_0x8cc5('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x8cc5('0x22')],'as':_0x8cc5('0x23'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x8cc5('0x24'),'attributes':['id'],'raw':!![]}]})[_0x8cc5('0xb')](function(_0x1e8da5){if(_0x1e8da5){_0x2246f6=_0x1e8da5;_0x35a471[_0x104f9f](util[_0x8cc5('0x18')](_0x8cc5('0x25'),_0x1e8da5[_0x8cc5('0x3')]));var _0x5b9d92=[];switch(_0x1e8da5[_0x8cc5('0x5')]){case'admin':_0x35a471[_0x104f9f](_0x8cc5('0x26'));_0x35a471[_0x104f9f](_0x8cc5('0x27'));if(queryQueues[_0x8cc5('0x28')](_0x8cc5('0x29'))){delete queryQueues[_0x8cc5('0x29')];}_0x5b9d92[_0x8cc5('0x2a')](db['VoiceQueue'][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2b')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2c')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db['SmsQueue'][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2d')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db['OpenchannelQueue']['findAll'](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x2e')][_0x8cc5('0xf')](queryQueues));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x15')][_0x8cc5('0xf')](queryTelephones));_0x5b9d92[_0x8cc5('0x2a')](db['Trunk'][_0x8cc5('0xf')](queryTrunks));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x17')][_0x8cc5('0xf')](queryCampaigns));_0x5b9d92[_0x8cc5('0x2a')](db[_0x8cc5('0x15')][_0x8cc5('0xf')](queryAgents));break;case _0x8cc5('0x2f'):_0x35a471[_0x104f9f](_0x8cc5('0x26'));_0x35a471[_0x104f9f](_0x8cc5('0x27'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0xc'),_0x1e8da5['userProfileId'],_0x8cc5('0x30')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0x31'),_0x1e8da5[_0x8cc5('0x32')],'ChatQueue'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0xd'),_0x1e8da5[_0x8cc5('0x32')],'FaxQueue'));_0x5b9d92['push'](getAssociatedResources(_0x8cc5('0x33'),_0x1e8da5[_0x8cc5('0x32')],_0x8cc5('0x34')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0xe'),_0x1e8da5['userProfileId'],'MailQueue'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0x35'),_0x1e8da5[_0x8cc5('0x32')],_0x8cc5('0x36')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources('WhatsappQueues',_0x1e8da5['userProfileId'],_0x8cc5('0x2e')));_0x5b9d92['push'](getAssociatedResources(_0x8cc5('0x37'),_0x1e8da5[_0x8cc5('0x32')],_0x8cc5('0x15')));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources('Trunks',_0x1e8da5[_0x8cc5('0x32')],'Trunk'));_0x5b9d92[_0x8cc5('0x2a')](getAssociatedResources(_0x8cc5('0x11'),_0x1e8da5['userProfileId'],'Campaign'));_0x5b9d92['push'](db[_0x8cc5('0x15')]['findAll'](queryAgents));break;case _0x8cc5('0x6'):_0x35a471[_0x104f9f](_0x8cc5('0x26'));_0x35a471[_0x104f9f]('voice:outbound');_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5[_0x8cc5('0x38')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5[_0x8cc5('0x39')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5[_0x8cc5('0x3a')]({'attributes':['id','name']}));_0x5b9d92['push'](_0x1e8da5[_0x8cc5('0x3b')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92[_0x8cc5('0x2a')](_0x1e8da5['getMailQueues']({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92['push'](_0x1e8da5[_0x8cc5('0x3c')]({'attributes':['id',_0x8cc5('0x3')]}));_0x5b9d92['push'](_0x1e8da5[_0x8cc5('0x3d')]({'attributes':['id',_0x8cc5('0x3')]}));break;}return BPromise[_0x8cc5('0x3e')](_0x5b9d92);}})[_0x8cc5('0xb')](function(_0x289e6c){if(_0x289e6c&&_0x289e6c[_0x8cc5('0x3f')]){for(var _0x533b54=0x0;_0x533b54<_0x289e6c[_0x8cc5('0x3f')];_0x533b54+=0x1){for(var _0x2eb765=0x0;_0x2eb765<_0x289e6c[_0x533b54][_0x8cc5('0x3f')];_0x2eb765+=0x1){switch(_0x533b54){case 0x0:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x40'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x1:joinOrLeaveQueues(_0x35a471,_0x104f9f,'chat',_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x2:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x41'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x3:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x42'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x4:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x43'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x5:joinOrLeaveQueues(_0x35a471,_0x104f9f,_0x8cc5('0x44'),_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x6:joinOrLeaveQueues(_0x35a471,_0x104f9f,'whatsapp',_0x289e6c[_0x533b54][_0x2eb765]);break;case 0x7:if(_0x2246f6[_0x8cc5('0x5')]!==_0x8cc5('0x6'))_0x35a471[_0x104f9f](util[_0x8cc5('0x18')]('telephone:%s',_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;case 0x8:if(_0x2246f6[_0x8cc5('0x5')]!==_0x8cc5('0x6'))_0x35a471[_0x104f9f](util[_0x8cc5('0x18')](_0x8cc5('0x45'),_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;case 0x9:if(_0x2246f6[_0x8cc5('0x5')]!==_0x8cc5('0x6'))_0x35a471[_0x104f9f](util['format'](_0x8cc5('0x46'),_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x8')],_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;case 0xa:_0x35a471[_0x104f9f](util[_0x8cc5('0x18')]('user:%s',_0x289e6c[_0x533b54][_0x2eb765][_0x8cc5('0x3')]));break;}}}}})['then'](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x52ac4c=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x48')],'id');return _0x2246f6[_0x8cc5('0x49')](_0x52ac4c)[_0x8cc5('0xb')](function(){for(var _0x56d739=0x0;_0x56d739<_0x52ac4c['length'];_0x56d739+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x4b'),{'ChatInteractionId':Number(_0x52ac4c[_0x56d739]),'UserId':Number(_0x2246f6['id'])});}});}})[_0x8cc5('0xb')](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x5809e3=_['map'](_0x2246f6['MailInteractions'],'id');return _0x2246f6[_0x8cc5('0x4c')](_0x5809e3)[_0x8cc5('0xb')](function(){for(var _0x533c4d=0x0;_0x533c4d<_0x5809e3[_0x8cc5('0x3f')];_0x533c4d+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x4d'),{'MailInteractionId':Number(_0x5809e3[_0x533c4d]),'UserId':Number(_0x2246f6['id'])});}});}})['then'](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x5a523b=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x1f')],'id');return _0x2246f6[_0x8cc5('0x4e')](_0x5a523b)[_0x8cc5('0xb')](function(){for(var _0x2a2469=0x0;_0x2a2469<_0x5a523b[_0x8cc5('0x3f')];_0x2a2469+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x4f'),{'FaxInteractionId':Number(_0x5a523b[_0x2a2469]),'UserId':Number(_0x2246f6['id'])});}});}})[_0x8cc5('0xb')](function(){if(_0x104f9f==='leave'){var _0x4d69a5=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x21')],'id');return _0x2246f6[_0x8cc5('0x50')](_0x4d69a5)['then'](function(){for(var _0x3e2904=0x0;_0x3e2904<_0x4d69a5[_0x8cc5('0x3f')];_0x3e2904+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x51'),{'SmsInteractionId':Number(_0x4d69a5[_0x3e2904]),'UserId':Number(_0x2246f6['id'])});}});}})['then'](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x2372a3=_[_0x8cc5('0x14')](_0x2246f6[_0x8cc5('0x23')],'id');return _0x2246f6['removeOpenchannelInteractions'](_0x2372a3)[_0x8cc5('0xb')](function(){for(var _0xe24a8c=0x0;_0xe24a8c<_0x2372a3[_0x8cc5('0x3f')];_0xe24a8c+=0x1){_0x43cad3['emit'](_0x8cc5('0x52'),{'OpenchannelInteractionId':Number(_0x2372a3[_0xe24a8c]),'UserId':Number(_0x2246f6['id'])});}});}})[_0x8cc5('0xb')](function(){if(_0x104f9f===_0x8cc5('0x47')){var _0x3045cb=_['map'](_0x2246f6[_0x8cc5('0x24')],'id');return _0x2246f6[_0x8cc5('0x53')](_0x3045cb)[_0x8cc5('0xb')](function(){for(var _0x2ceda5=0x0;_0x2ceda5<_0x3045cb[_0x8cc5('0x3f')];_0x2ceda5+=0x1){_0x43cad3[_0x8cc5('0x4a')](_0x8cc5('0x54'),{'WhatsappInteractionId':Number(_0x3045cb[_0x2ceda5]),'UserId':Number(_0x2246f6['id'])});}});}})['catch'](function(_0x26db3f){_0x35a471[_0x8cc5('0x55')](_0x26db3f);});}}function onDisconnect(_0x338675,_0x4de0e1){joinOrLeave(_0x338675,_0x8cc5('0x47'),_0x4de0e1);}function onConnect(_0x3b7f85){joinOrLeave(_0x3b7f85,_0x8cc5('0x56'));}exports[_0x8cc5('0x57')]=function(_0x17c5a6){_0x17c5a6['on'](_0x8cc5('0x58'),function(_0x3b134b){_0x3b134b['setMaxListeners'](0x0);_0x3b134b[_0x8cc5('0x59')]=_0x3b134b[_0x8cc5('0x5a')][_0x8cc5('0x58')][_0x8cc5('0x5b')]+':'+_0x3b134b['request']['connection'][_0x8cc5('0x5c')];_0x3b134b['connectedAt']=new Date();_0x3b134b[_0x8cc5('0x55')]=function(_0x68cf4e){console[_0x8cc5('0x55')](_0x8cc5('0x5d')+_0x3b134b[_0x8cc5('0x5e')][_0x8cc5('0x3')]+'['+_0x3b134b[_0x8cc5('0x59')]+']',_0x68cf4e);};_0x3b134b['on'](_0x8cc5('0x5f'),function(){onDisconnect(_0x3b134b,_0x17c5a6);_0x3b134b['log'](_0x8cc5('0x60'));});onConnect(_0x3b134b);_0x3b134b[_0x8cc5('0x55')]('CONNECTED');});}; \ No newline at end of file +var _0x06f1=['request','remoteAddress','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','Agents','role','agent','name','telephone','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Trunks','UserProfileResource','resourceId','where','Campaign','type','format','length','handshake','query','User','find','userProfileId','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueue','ChatQueue','OpenchannelQueues','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','map','FaxInteractions','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address'];(function(_0x2564e6,_0x467065){var _0x39be09=function(_0x121570){while(--_0x121570){_0x2564e6['push'](_0x2564e6['shift']());}};_0x39be09(++_0x467065);}(_0x06f1,0x6e));var _0x106f=function(_0x2b2b87,_0xc71e84){_0x2b2b87=_0x2b2b87-0x0;var _0x31e57c=_0x06f1[_0x2b2b87];return _0x31e57c;};'use strict';var _=require(_0x106f('0x0'));var util=require(_0x106f('0x1'));var BPromise=require(_0x106f('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x106f('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x106f('0x4'),'model':db['User'],'attributes':['id','name',_0x106f('0x5')],'raw':!![],'where':{'role':_0x106f('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x106f('0x7')],'where':{'role':_0x106f('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x106f('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x106f('0x7')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x106f('0x7'),'type'],'where':{'type':_0x106f('0x9')}};function getAssociatedResources(_0x2e683c,_0x164dd5,_0x59e36f){return db[_0x106f('0xa')][_0x106f('0xb')]({'where':{'name':_0x2e683c,'userProfileId':_0x164dd5},'raw':!![]})[_0x106f('0xc')](function(_0x3e667d){if(_0x3e667d){if(_0x3e667d[_0x106f('0xd')]){switch(_0x2e683c){case _0x106f('0xe'):case _0x106f('0xf'):case _0x106f('0x10'):case _0x106f('0x11'):case _0x106f('0x12'):case'OpenchannelQueues':case _0x106f('0x13'):return db[_0x59e36f][_0x106f('0x14')](queryQueues);case'Telephones':return db[_0x59e36f][_0x106f('0x14')](queryTelephones);case _0x106f('0x15'):return db[_0x59e36f][_0x106f('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x59e36f]['findAll'](queryCampaigns);}}else{return db[_0x106f('0x16')][_0x106f('0x14')]({'attributes':[_0x106f('0x17')],'where':{'sectionId':_0x3e667d['id']},'raw':!![]})[_0x106f('0xc')](function(_0x422461){if(_0x422461){var _0x378483={'where':{'id':_['map'](_0x422461,'resourceId')},'raw':!![]};switch(_0x59e36f){case'User':_0x378483[_0x106f('0x18')][_0x106f('0x5')]='telephone';break;case _0x106f('0x19'):_0x378483[_0x106f('0x18')][_0x106f('0x1a')]='ivr';break;}return db[_0x59e36f]['findAll'](_0x378483);}else{return[];}});}}else{return[];}})[_0x106f('0xc')](function(_0x3f2cd6){return _0x3f2cd6;});}function joinOrLeaveQueues(_0x25d759,_0x37fab2,_0x1980e5,_0x8d54c8){_0x25d759[_0x37fab2](util[_0x106f('0x1b')]('%s:queue:%s',_0x1980e5,_0x8d54c8[_0x106f('0x7')]));if(_0x8d54c8[_0x106f('0x4')]){for(var _0x54bbb=0x0;_0x54bbb<_0x8d54c8['Agents'][_0x106f('0x1c')];_0x54bbb+=0x1){_0x25d759[_0x37fab2](util['format']('user:%s',_0x8d54c8[_0x106f('0x4')][_0x54bbb][_0x106f('0x7')]));}}}function joinOrLeave(_0x348614,_0x50093b,_0x18fd98){var _0x41dfdb;if(_0x348614[_0x106f('0x1d')][_0x106f('0x1e')]['id']){db[_0x106f('0x1f')][_0x106f('0x20')]({'attributes':['id',_0x106f('0x7'),_0x106f('0x5'),_0x106f('0x21')],'where':{'id':_0x348614['handshake']['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x106f('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x24')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x25')],'as':_0x106f('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x27')],'as':_0x106f('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x106f('0x29')],'as':_0x106f('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0xefc734){if(_0xefc734){_0x41dfdb=_0xefc734;_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x2b'),_0xefc734[_0x106f('0x7')]));var _0x57ebc0=[];switch(_0xefc734['role']){case _0x106f('0x2c'):_0x348614[_0x50093b](_0x106f('0x2d'));_0x348614[_0x50093b](_0x106f('0x2e'));if(queryQueues[_0x106f('0x2f')](_0x106f('0x30'))){delete queryQueues[_0x106f('0x30')];}_0x57ebc0[_0x106f('0x31')](db['VoiceQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db['ChatQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x32')][_0x106f('0x14')](queryQueues));_0x57ebc0['push'](db['SmsQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x33')][_0x106f('0x14')](queryQueues));_0x57ebc0['push'](db[_0x106f('0x34')][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db['WhatsappQueue'][_0x106f('0x14')](queryQueues));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x1f')][_0x106f('0x14')](queryTelephones));_0x57ebc0['push'](db[_0x106f('0x35')][_0x106f('0x14')](queryTrunks));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x19')]['findAll'](queryCampaigns));_0x57ebc0[_0x106f('0x31')](db[_0x106f('0x1f')]['findAll'](queryAgents));break;case _0x106f('0x36'):_0x348614[_0x50093b](_0x106f('0x2d'));_0x348614[_0x50093b](_0x106f('0x2e'));_0x57ebc0['push'](getAssociatedResources(_0x106f('0xe'),_0xefc734['userProfileId'],_0x106f('0x37')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0xf'),_0xefc734[_0x106f('0x21')],_0x106f('0x38')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources('FaxQueues',_0xefc734['userProfileId'],_0x106f('0x32')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x11'),_0xefc734['userProfileId'],'SmsQueue'));_0x57ebc0[_0x106f('0x31')](getAssociatedResources('MailQueues',_0xefc734[_0x106f('0x21')],_0x106f('0x33')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x39'),_0xefc734[_0x106f('0x21')],_0x106f('0x34')));_0x57ebc0['push'](getAssociatedResources(_0x106f('0x13'),_0xefc734['userProfileId'],'WhatsappQueue'));_0x57ebc0[_0x106f('0x31')](getAssociatedResources('Telephones',_0xefc734[_0x106f('0x21')],_0x106f('0x1f')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x15'),_0xefc734[_0x106f('0x21')],_0x106f('0x35')));_0x57ebc0[_0x106f('0x31')](getAssociatedResources(_0x106f('0x3a'),_0xefc734[_0x106f('0x21')],'Campaign'));_0x57ebc0[_0x106f('0x31')](db['User']['findAll'](queryAgents));break;case _0x106f('0x6'):_0x348614[_0x50093b](_0x106f('0x2d'));_0x348614[_0x50093b](_0x106f('0x2e'));_0x57ebc0[_0x106f('0x31')](_0xefc734['getVoiceQueues']({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0[_0x106f('0x31')](_0xefc734[_0x106f('0x3b')]({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0[_0x106f('0x31')](_0xefc734[_0x106f('0x3c')]({'attributes':['id','name']}));_0x57ebc0[_0x106f('0x31')](_0xefc734[_0x106f('0x3d')]({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0['push'](_0xefc734[_0x106f('0x3e')]({'attributes':['id',_0x106f('0x7')]}));_0x57ebc0['push'](_0xefc734[_0x106f('0x3f')]({'attributes':['id','name']}));_0x57ebc0['push'](_0xefc734['getWhatsappQueues']({'attributes':['id',_0x106f('0x7')]}));break;}return BPromise[_0x106f('0x40')](_0x57ebc0);}})[_0x106f('0xc')](function(_0x4c24b2){if(_0x4c24b2&&_0x4c24b2[_0x106f('0x1c')]){for(var _0x381b0d=0x0;_0x381b0d<_0x4c24b2[_0x106f('0x1c')];_0x381b0d+=0x1){for(var _0x3f62b6=0x0;_0x3f62b6<_0x4c24b2[_0x381b0d][_0x106f('0x1c')];_0x3f62b6+=0x1){switch(_0x381b0d){case 0x0:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x41'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x1:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x42'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x2:joinOrLeaveQueues(_0x348614,_0x50093b,'fax',_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x3:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x43'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x4:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x44'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x5:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x45'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x6:joinOrLeaveQueues(_0x348614,_0x50093b,_0x106f('0x46'),_0x4c24b2[_0x381b0d][_0x3f62b6]);break;case 0x7:if(_0x41dfdb[_0x106f('0x5')]!==_0x106f('0x6'))_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x47'),_0x4c24b2[_0x381b0d][_0x3f62b6]['name']));break;case 0x8:if(_0x41dfdb['role']!==_0x106f('0x6'))_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x48'),_0x4c24b2[_0x381b0d][_0x3f62b6]['name']));break;case 0x9:if(_0x41dfdb[_0x106f('0x5')]!==_0x106f('0x6'))_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x49'),_0x4c24b2[_0x381b0d][_0x3f62b6][_0x106f('0x1a')],_0x4c24b2[_0x381b0d][_0x3f62b6][_0x106f('0x7')]));break;case 0xa:_0x348614[_0x50093b](util[_0x106f('0x1b')](_0x106f('0x2b'),_0x4c24b2[_0x381b0d][_0x3f62b6]['name']));break;}}}}})['then'](function(){if(_0x50093b===_0x106f('0x4a')){var _0x5394b3=_['map'](_0x41dfdb[_0x106f('0x22')],'id');return _0x41dfdb[_0x106f('0x4b')](_0x5394b3)[_0x106f('0xc')](function(){for(var _0x24d20b=0x0;_0x24d20b<_0x5394b3[_0x106f('0x1c')];_0x24d20b+=0x1){_0x18fd98[_0x106f('0x4c')](_0x106f('0x4d'),{'ChatInteractionId':Number(_0x5394b3[_0x24d20b]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b==='leave'){var _0x18b755=_['map'](_0x41dfdb[_0x106f('0x4e')],'id');return _0x41dfdb['removeMailInteractions'](_0x18b755)['then'](function(){for(var _0x36ba8b=0x0;_0x36ba8b<_0x18b755[_0x106f('0x1c')];_0x36ba8b+=0x1){_0x18fd98['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x18b755[_0x36ba8b]),'UserId':Number(_0x41dfdb['id'])});}});}})['then'](function(){if(_0x50093b==='leave'){var _0x5672ed=_[_0x106f('0x4f')](_0x41dfdb[_0x106f('0x50')],'id');return _0x41dfdb[_0x106f('0x51')](_0x5672ed)[_0x106f('0xc')](function(){for(var _0x1ef7bc=0x0;_0x1ef7bc<_0x5672ed[_0x106f('0x1c')];_0x1ef7bc+=0x1){_0x18fd98[_0x106f('0x4c')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5672ed[_0x1ef7bc]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b===_0x106f('0x4a')){var _0x4255a1=_['map'](_0x41dfdb['SmsInteractions'],'id');return _0x41dfdb[_0x106f('0x52')](_0x4255a1)[_0x106f('0xc')](function(){for(var _0xeecb61=0x0;_0xeecb61<_0x4255a1[_0x106f('0x1c')];_0xeecb61+=0x1){_0x18fd98['emit'](_0x106f('0x53'),{'SmsInteractionId':Number(_0x4255a1[_0xeecb61]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b==='leave'){var _0x36b189=_[_0x106f('0x4f')](_0x41dfdb['OpenchannelInteractions'],'id');return _0x41dfdb[_0x106f('0x54')](_0x36b189)['then'](function(){for(var _0x4fdf90=0x0;_0x4fdf90<_0x36b189[_0x106f('0x1c')];_0x4fdf90+=0x1){_0x18fd98[_0x106f('0x4c')](_0x106f('0x55'),{'OpenchannelInteractionId':Number(_0x36b189[_0x4fdf90]),'UserId':Number(_0x41dfdb['id'])});}});}})[_0x106f('0xc')](function(){if(_0x50093b===_0x106f('0x4a')){var _0x5ee884=_[_0x106f('0x4f')](_0x41dfdb[_0x106f('0x2a')],'id');return _0x41dfdb[_0x106f('0x56')](_0x5ee884)['then'](function(){for(var _0x36f6c8=0x0;_0x36f6c8<_0x5ee884[_0x106f('0x1c')];_0x36f6c8+=0x1){_0x18fd98[_0x106f('0x4c')](_0x106f('0x57'),{'WhatsappInteractionId':Number(_0x5ee884[_0x36f6c8]),'UserId':Number(_0x41dfdb['id'])});}});}})['catch'](function(_0x12a799){_0x348614[_0x106f('0x58')](_0x12a799);});}}function onDisconnect(_0x4f8125,_0x227179){joinOrLeave(_0x4f8125,_0x106f('0x4a'),_0x227179);}function onConnect(_0x578f2e){joinOrLeave(_0x578f2e,_0x106f('0x59'));}exports[_0x106f('0x5a')]=function(_0x24cd76){_0x24cd76['on'](_0x106f('0x5b'),function(_0x37f877){_0x37f877[_0x106f('0x5c')](0x0);_0x37f877[_0x106f('0x5d')]=_0x37f877[_0x106f('0x5e')]['connection'][_0x106f('0x5f')]+':'+_0x37f877['request'][_0x106f('0x5b')][_0x106f('0x60')];_0x37f877[_0x106f('0x61')]=new Date();_0x37f877[_0x106f('0x58')]=function(_0x44ac61){console[_0x106f('0x58')]('SocketIO\x20'+_0x37f877[_0x106f('0x62')][_0x106f('0x7')]+'['+_0x37f877[_0x106f('0x5d')]+']',_0x44ac61);};_0x37f877['on'](_0x106f('0x63'),function(){onDisconnect(_0x37f877,_0x24cd76);_0x37f877[_0x106f('0x58')](_0x106f('0x64'));});onConnect(_0x37f877);_0x37f877['log'](_0x106f('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 3d3a67a..feec998 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 _0x6311=['interface','format','SIP/%s','name','incomingmessage','offlineMessage','motionChannel','agent','changed','closed','substatus','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','ChatOfflineMessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','newinteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','catch','get','channel','event','resolve','then','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId'];(function(_0x11814e,_0x28b9d7){var _0x5c687=function(_0x596ba3){while(--_0x596ba3){_0x11814e['push'](_0x11814e['shift']());}};_0x5c687(++_0x28b9d7);}(_0x6311,0x18a));var _0x1631=function(_0x4e00d4,_0xdb24a3){_0x4e00d4=_0x4e00d4-0x0;var _0x335d2c=_0x6311[_0x4e00d4];return _0x335d2c;};'use strict';var util=require(_0x1631('0x0'));var db=require(_0x1631('0x1'))['db'];var jayson=require(_0x1631('0x2'));var logger=require(_0x1631('0x3'))(_0x1631('0x4'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0x1631('0x5'),'model':_0x1631('0x6'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0x1631('0x6'),'event':_0x1631('0x7'),'condition':_0x1631('0x8'),'callback':afterUpdate},{'channel':_0x1631('0x5'),'model':_0x1631('0x9'),'event':_0x1631('0xa'),'condition':_0x1631('0xb'),'callback':afterCreateMessage},{'channel':'Chat','model':_0x1631('0xc'),'event':_0x1631('0xa'),'condition':_0x1631('0xb'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x1631('0xd'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':'afterUpdate','condition':_0x1631('0x8'),'callback':afterUpdate},{'channel':_0x1631('0xe'),'model':_0x1631('0xf'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1631('0x10'),'model':_0x1631('0x11'),'event':_0x1631('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x1631('0x10'),'model':_0x1631('0x11'),'event':_0x1631('0x7'),'condition':_0x1631('0x8'),'callback':afterUpdate},{'channel':_0x1631('0x10'),'model':_0x1631('0x12'),'event':_0x1631('0xa'),'condition':_0x1631('0xb'),'callback':afterCreateMessage},{'channel':_0x1631('0x13'),'model':_0x1631('0x14'),'event':_0x1631('0xa'),'condition':_0x1631('0x15'),'callback':afterCreate},{'channel':_0x1631('0x13'),'model':_0x1631('0x14'),'event':_0x1631('0x7'),'condition':_0x1631('0x8'),'callback':afterUpdate},{'channel':_0x1631('0x13'),'model':_0x1631('0x16'),'event':_0x1631('0xa'),'condition':_0x1631('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x1631('0x17'),'event':_0x1631('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x1631('0x18'),'model':_0x1631('0x17'),'event':_0x1631('0x7'),'condition':_0x1631('0x8'),'callback':afterUpdate},{'channel':'Mail','model':_0x1631('0x19'),'event':_0x1631('0xa'),'condition':_0x1631('0xb'),'callback':afterCreateMessage},{'channel':_0x1631('0x1a'),'model':'OpenchannelInteraction','event':_0x1631('0xa'),'condition':_0x1631('0x15'),'callback':afterCreate},{'channel':_0x1631('0x1a'),'model':_0x1631('0x1b'),'event':_0x1631('0x7'),'condition':_0x1631('0x8'),'callback':afterUpdate},{'channel':_0x1631('0x1a'),'model':_0x1631('0x1c'),'event':_0x1631('0xa'),'condition':_0x1631('0xb'),'callback':afterCreateMessage}];function request(_0x368cbd){return client[_0x1631('0x1d')](_0x1631('0x1e'),_0x368cbd)['then'](function(_0x122b96){logger[_0x1631('0x1f')](_0x1631('0x20'),'EventManager',_0x122b96);if(_0x122b96['error']){if(_0x122b96[_0x1631('0x21')]['code']===0x1f4){logger['error'](_0x1631('0x20'),_0x1631('0x1e'),_0x122b96[_0x1631('0x21')]);}}})[_0x1631('0x22')](function(_0x2a6a6e){logger['error']('Trigger,\x20%s','EventManager',_0x2a6a6e);});}function afterCreateMessage(_0x219f7e){return function(_0x2bee7b){_0x2bee7b=_0x2bee7b[_0x1631('0x23')]({'plain':!![]});_0x2bee7b[_0x1631('0x24')]=_0x219f7e;_0x2bee7b['motionChannel']=_0x219f7e;_0x2bee7b[_0x1631('0x25')]=_0x2bee7b['direction'];Promise[_0x1631('0x26')]()[_0x1631('0x27')](function(){if(typeof _0x2bee7b[_0x1631('0x28')]===_0x1631('0x29'))return null;var _0x227bad=_0x1631('0x2a')+_0x2bee7b['ContactId'];return db[_0x1631('0x2b')][_0x1631('0x2c')](_0x227bad,{'type':db[_0x1631('0x2d')][_0x1631('0x2e')][_0x1631('0x2f')],'raw':!![]});})[_0x1631('0x27')](function(_0x3d63f4){if(_0x3d63f4){_0x2bee7b[_0x1631('0x30')]=_0x3d63f4[0x0];}if(typeof _0x2bee7b['UserId']===_0x1631('0x29'))return;return getAgent(_0x2bee7b[_0x1631('0x31')]);})[_0x1631('0x27')](function(_0x4e826c){if(_0x4e826c){_0x2bee7b[_0x1631('0x32')]=util[_0x1631('0x33')](_0x1631('0x34'),_0x4e826c[_0x1631('0x35')]);_0x2bee7b['agent']=_0x4e826c;_0x2bee7b[_0x1631('0x24')]=_0x219f7e;return request({'event':_0x1631('0x36'),'message':_0x2bee7b});}else{return request({'event':'outgoingmessage','message':_0x2bee7b});}})[_0x1631('0x22')](function(_0x55186c){logger[_0x1631('0x21')](_0x1631('0x20'),'AfterCreateMessage',_0x55186c);});};}function afterCreateOfflineMessage(_0x1030b7){return function(_0x197af8){_0x197af8=_0x197af8[_0x1631('0x23')]({'plain':!![]});_0x197af8[_0x1631('0x24')]=_0x1030b7;_0x197af8['motionChannel']=_0x1030b7;_0x197af8[_0x1631('0x25')]=_0x1631('0x37');return request({'event':_0x197af8[_0x1631('0x25')],'message':_0x197af8});};}function afterCreate(_0x4e19a2,_0x3be4ec){return function(_0x4f95c5){_0x4f95c5=_0x4f95c5[_0x1631('0x23')]({'plain':!![]});_0x4f95c5['channel']=_0x4e19a2;_0x4f95c5[_0x1631('0x38')]=_0x4e19a2;_0x4f95c5['event']='opened';Promise[_0x1631('0x26')]()['then'](function(){var _0xc27a9b=_0x1631('0x2a')+_0x4f95c5[_0x1631('0x28')];return db[_0x1631('0x2b')][_0x1631('0x2c')](_0xc27a9b,{'type':db[_0x1631('0x2d')][_0x1631('0x2e')]['SELECT'],'raw':!![]});})['then'](function(_0x17d2f9){if(_0x17d2f9){_0x4f95c5['contact']=_0x17d2f9[0x0];}if(typeof _0x4f95c5[_0x1631('0x31')]==='undefined')return;return getAgent(_0x4f95c5[_0x1631('0x31')]);})['then'](function(_0x53b15f){if(_0x53b15f){_0x4f95c5[_0x1631('0x32')]=util[_0x1631('0x33')](_0x1631('0x34'),_0x53b15f[_0x1631('0x35')]);_0x4f95c5[_0x1631('0x39')]=_0x53b15f;}return request({'event':_0x3be4ec,'message':_0x4f95c5});})['catch'](function(_0x5c267b){logger[_0x1631('0x21')](_0x1631('0x20'),'AfterCreate',_0x5c267b);});};}function afterUpdate(_0x580cda){return function(_0x55173d){var _0x309aee=_0x55173d[_0x1631('0x3a')](_0x1631('0x3b'))&&_0x55173d[_0x1631('0x3b')];var _0x36041a=_0x55173d[_0x1631('0x3a')](_0x1631('0x3c'));if(_0x309aee||_0x36041a){var _0x553682=_0x309aee?_0x1631('0x8'):_0x1631('0x3c');var _0x5b09a9=_0x55173d[_0x1631('0x23')]({'plain':!![]});_0x5b09a9[_0x1631('0x24')]=_0x580cda;_0x5b09a9[_0x1631('0x38')]=_0x580cda;_0x5b09a9[_0x1631('0x25')]=_0x309aee?_0x1631('0x3b'):'substatus';var _0x56befa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b09a9[_0x1631('0x28')];return db[_0x1631('0x2b')][_0x1631('0x2c')](_0x56befa,{'type':db[_0x1631('0x2d')][_0x1631('0x2e')][_0x1631('0x2f')],'raw':!![]})[_0x1631('0x27')](function(_0x455440){if(_0x455440){_0x5b09a9[_0x1631('0x30')]=_0x455440[0x0];}if(typeof _0x5b09a9[_0x1631('0x31')]===_0x1631('0x29'))return;return getAgent(_0x5b09a9[_0x1631('0x31')]);})[_0x1631('0x27')](function(_0x990053){if(_0x990053){_0x5b09a9['interface']=util['format'](_0x1631('0x34'),_0x990053[_0x1631('0x35')]);_0x5b09a9[_0x1631('0x39')]=_0x990053;}return request({'event':_0x553682,'message':_0x5b09a9});})[_0x1631('0x22')](function(_0x5384e8){logger[_0x1631('0x21')](_0x1631('0x20'),_0x1631('0x3d'),_0x5384e8);});}};}function getAgent(_0x32d99f){return db[_0x1631('0x3e')][_0x1631('0x3f')]({'where':{'id':_0x32d99f},'attributes':['id','name',_0x1631('0x40'),_0x1631('0x41'),_0x1631('0x42')],'raw':!![]})[_0x1631('0x27')](function(_0x1c4a66){return _0x1c4a66;});}exports[_0x1631('0x43')]=function(){for(var _0x440c2e=0x0;_0x440c2e=_0x1cd598[_0x4b94('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4b6c64(_0x59969a);})['catch'](function(_0x4cd55d){_0x1aa19b(_0x4cd55d);});});}; \ No newline at end of file +var _0xc02c=['count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','chat','whatsapp','openchannel','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','User'];(function(_0x686b09,_0x449192){var _0x3d2f83=function(_0x2d9ccc){while(--_0x2d9ccc){_0x686b09['push'](_0x686b09['shift']());}};_0x3d2f83(++_0x449192);}(_0xc02c,0x13a));var _0xcc02=function(_0x446186,_0x116e31){_0x446186=_0x446186-0x0;var _0x63b564=_0xc02c[_0x446186];return _0x63b564;};'use strict';var _=require(_0xcc02('0x0'));var BPromise=require(_0xcc02('0x1'));var db=require('../mysqldb')['db'];var util=require(_0xcc02('0x2'));var channels=['voice','mail',_0xcc02('0x3'),'fax','sms',_0xcc02('0x4'),_0xcc02('0x5')];exports[_0xcc02('0x6')]=function(){return channels;};exports[_0xcc02('0x7')]=function(_0x6e0872){_0x6e0872=_0x6e0872['toLowerCase']();return _[_0xcc02('0x8')](channels,_0x6e0872);};exports[_0xcc02('0x9')]=function(_0x3f40fd,_0x4bc112,_0x4463d8,_0x2ed636){var _0x46d292={'loginAttempts':_0x4bc112,'blocked':_0x4463d8};if(!_[_0xcc02('0xa')](_0x2ed636)){_0x46d292[_0xcc02('0xb')]=_0x2ed636;}return _0x3f40fd[_0xcc02('0xc')](_0x46d292);};exports[_0xcc02('0xd')]=function(_0x3c60c3){return new BPromise(function(_0x2243a4,_0x2d9114){var _0x248b83=0x0;if(_0x3c60c3[_0xcc02('0xe')]!=='agent'){_0x2243a4(_0x3c60c3);}db[_0xcc02('0xf')][_0xcc02('0x10')]({'where':{'role':_0xcc02('0x11'),'online':!![],'id':{'$ne':_0x3c60c3['id']}}})[_0xcc02('0x12')](function(_0x26bb54){_0x248b83=_0x26bb54;return util['getLicense']();})[_0xcc02('0x12')](function(_0x33fabc){if(_0x33fabc&&_0x33fabc['agents']&&_0x248b83>=_0x33fabc[_0xcc02('0x13')]){throw Error(_0xcc02('0x14'));}_0x2243a4(_0x3c60c3);})[_0xcc02('0x15')](function(_0x4e7828){_0x2d9114(_0x4e7828);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 3233657..5c913de 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Bad\x20Request','Forbidden','Out\x20Of\x20Interval','Not\x20Found','error','stack','statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Entity\x20not\x20found'];(function(_0x364831,_0xafd989){var _0x1b3f9e=function(_0x11c3ed){while(--_0x11c3ed){_0x364831['push'](_0x364831['shift']());}};_0x1b3f9e(++_0xafd989);}(_0x7a54,0x106));var _0x47a5=function(_0x5a8d85,_0x5787ff){_0x5a8d85=_0x5a8d85-0x0;var _0x1cab8a=_0x7a54[_0x5a8d85];return _0x1cab8a;};'use strict';var util=require(_0x47a5('0x0'));var logger=require(_0x47a5('0x1'))(_0x47a5('0x2'));var APIError=function(_0x58157c,_0x1d33e){this[_0x47a5('0x3')]=_0x58157c||'Internal\x20Server\x20Error';this[_0x47a5('0x4')]=_0x1d33e||_0x47a5('0x5');util[_0x47a5('0x6')](APIError,Error);};var APIBadRequestError=function(_0x3717e1){this[_0x47a5('0x3')]=_0x3717e1||'Bad\x20Request';this[_0x47a5('0x4')]='Bad\x20Request';util[_0x47a5('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x30e405){this['message']=_0x30e405||_0x47a5('0x7');this['name']='Not\x20Found';util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x2a0e98){this[_0x47a5('0x3')]=_0x2a0e98||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x47a5('0x4')]='Out\x20Of\x20Interval';util['inherits'](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1f47f4){switch(_0x1f47f4){case _0x47a5('0x8'):return 0x190;case _0x47a5('0x9'),_0x47a5('0xa'):return 0x193;case _0x47a5('0xb'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0xd308b8){if(_0xd308b8===_0x47a5('0xa'))return _0xd308b8;return null;}function handleError(_0x5beb89){return function(_0x44bd3e){logger[_0x47a5('0xc')](_0x44bd3e[_0x47a5('0xd')]);var _0x711793=getStatusCode(_0x44bd3e[_0x47a5('0x4')]);var _0x620ee9=getCustomStatusMessage(_0x44bd3e[_0x47a5('0x4')]);if(_0x44bd3e[_0x47a5('0x4')])delete _0x44bd3e['name'];if(_0x620ee9)_0x5beb89[_0x47a5('0xe')]=_0x620ee9;return _0x5beb89[_0x47a5('0xf')](_0x711793)[_0x47a5('0x10')](_0x44bd3e);};}module[_0x47a5('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xadb5=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','statusMessage','status','send','exports','../config/logger','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found'];(function(_0x442801,_0x406ee2){var _0x51cb59=function(_0x1d468d){while(--_0x1d468d){_0x442801['push'](_0x442801['shift']());}};_0x51cb59(++_0x406ee2);}(_0xadb5,0xad));var _0x5adb=function(_0x2a0655,_0x2d0edf){_0x2a0655=_0x2a0655-0x0;var _0x3a0848=_0xadb5[_0x2a0655];return _0x3a0848;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('api');var APIError=function(_0x3d6340,_0x38f67f){this[_0x5adb('0x1')]=_0x3d6340||'Internal\x20Server\x20Error';this[_0x5adb('0x2')]=_0x38f67f||_0x5adb('0x3');util[_0x5adb('0x4')](APIError,Error);};var APIBadRequestError=function(_0x4cb1d1){this[_0x5adb('0x1')]=_0x4cb1d1||_0x5adb('0x5');this[_0x5adb('0x2')]=_0x5adb('0x5');util[_0x5adb('0x4')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x353885){this[_0x5adb('0x1')]=_0x353885||_0x5adb('0x6');this[_0x5adb('0x2')]=_0x5adb('0x7');util[_0x5adb('0x4')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x336bad){this[_0x5adb('0x1')]=_0x336bad||_0x5adb('0x8');this['name']='Out\x20Of\x20Interval';util[_0x5adb('0x4')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x1ea238){switch(_0x1ea238){case _0x5adb('0x5'):return 0x190;case'Forbidden',_0x5adb('0x9'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x2a0b70){if(_0x2a0b70==='Out\x20Of\x20Interval')return _0x2a0b70;return null;}function handleError(_0x8cfcc6){return function(_0x39a0b3){logger[_0x5adb('0xa')](_0x39a0b3['stack']);var _0x2a545b=getStatusCode(_0x39a0b3[_0x5adb('0x2')]);var _0xf82f72=getCustomStatusMessage(_0x39a0b3['name']);if(_0x39a0b3[_0x5adb('0x2')])delete _0x39a0b3['name'];if(_0xf82f72)_0x8cfcc6[_0x5adb('0xb')]=_0xf82f72;return _0x8cfcc6[_0x5adb('0xc')](_0x2a545b)[_0x5adb('0xd')](_0x39a0b3);};}module[_0x5adb('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 6c47162..455d8f3 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8166=['json','exports','status'];(function(_0x420ae4,_0x2f5b21){var _0x53b3bf=function(_0x2718cf){while(--_0x2718cf){_0x420ae4['push'](_0x420ae4['shift']());}};_0x53b3bf(++_0x2f5b21);}(_0x8166,0x100));var _0x6816=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0x8166[_0x119280];return _0x481797;};'use strict';module[_0x6816('0x0')][0x194]=function pageNotFound(_0x4cbe91,_0x1a09c8){var _0x2ee5bd='404';var _0x1461e6=0x194;var _0x3b45d2={'status':_0x1461e6};_0x1a09c8[_0x6816('0x1')](_0x3b45d2[_0x6816('0x1')]);_0x1a09c8['render'](_0x2ee5bd,{},function(_0xf648f0,_0xf65343){if(_0xf648f0){return _0x1a09c8[_0x6816('0x1')](_0x3b45d2[_0x6816('0x1')])[_0x6816('0x2')](_0x3b45d2);}_0x1a09c8['send'](_0xf65343);});}; \ No newline at end of file +var _0xa316=['status','json','send','404'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa316,0x1af));var _0x6a31=function(_0x496260,_0x154c1d){_0x496260=_0x496260-0x0;var _0x9696ef=_0xa316[_0x496260];return _0x9696ef;};'use strict';module['exports'][0x194]=function pageNotFound(_0x53c492,_0x2f7a34){var _0x2f472d=_0x6a31('0x0');var _0x19ae27=0x194;var _0x18e2c1={'status':_0x19ae27};_0x2f7a34[_0x6a31('0x1')](_0x18e2c1[_0x6a31('0x1')]);_0x2f7a34['render'](_0x2f472d,{},function(_0x22baee,_0xa0b9e2){if(_0x22baee){return _0x2f7a34[_0x6a31('0x1')](_0x18e2c1[_0x6a31('0x1')])[_0x6a31('0x2')](_0x18e2c1);}_0x2f7a34[_0x6a31('0x3')](_0xa0b9e2);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 0c3f3a3..4e62303 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa9e0=['SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','UserProfile','UserProfileSection','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','userSetting','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','WhatsappQueues','CmList','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','CloudProviderId','MailServerOut','restrict','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','Agents','team_has_mail_queues','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','ChatWebsiteId','Interval','MailQueueReport','Dashboard','CannedAnswer','FaxAccountId','Exntensions','TagId','FaxInteractionId','Account','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CmContactId','HopperHistories','CmCompany','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','Campaign','OwnerId','CampaignId','All','OneAll','OneAny','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','CmContactHasItem','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','AnalyticCustomReport','Fields','MetricId','Configurations','Subjects','DescriptionId','FieldId','AccountId','Subject','SubjectId','Description','Field','SugarcrmField','Descriptions','VariableId','DeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToQueue','FromSmsAccountId','CmCustomField','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','UserSetting','user','../config/environment','sequelize','lodash','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8','defaultsDeep','mysql','username','password','options','database','sequelizeHistory','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var config=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x0a9e('0x1')]=_['defaultsDeep'](config[_0x0a9e('0x1')],{'database':_0x0a9e('0x3'),'username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':_0x0a9e('0x9'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x0a9e('0xa')](config['sequelizeHistory'],{'database':'motion2','username':_0x0a9e('0x4'),'password':_0x0a9e('0x5'),'options':{'host':_0x0a9e('0x6'),'port':0xcea,'dialect':_0x0a9e('0xb'),'dialectOptions':{'charset':_0x0a9e('0x7')},'logging':![],'timezone':timezone[_0x0a9e('0x8')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x0a9e('0x1')][_0x0a9e('0xc')],config[_0x0a9e('0x1')][_0x0a9e('0xd')],config[_0x0a9e('0x1')][_0x0a9e('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x0a9e('0xf')],config[_0x0a9e('0x10')][_0x0a9e('0xc')],config[_0x0a9e('0x10')][_0x0a9e('0xd')],config[_0x0a9e('0x10')]['options'])};db[_0x0a9e('0x11')]=db['sequelize'][_0x0a9e('0x12')]('../api/user/user.model');db[_0x0a9e('0x13')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x14'));db['VoiceContext']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x15'));db[_0x0a9e('0x16')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x17'));db[_0x0a9e('0x18')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x19'));db[_0x0a9e('0x1a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x1b'));db['VoiceRecording']=db[_0x0a9e('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db[_0x0a9e('0x1c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1d'));db['VoiceMail']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x1e'));db[_0x0a9e('0x1f')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x20'));db['VoiceCallReport']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x21'));db[_0x0a9e('0x22')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x23'));db['VoiceAgentReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x24'));db[_0x0a9e('0x25')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x26'));db[_0x0a9e('0x27')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/memberReport/memberReport.model');db[_0x0a9e('0x28')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x29'));db['VoiceTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2a'));db[_0x0a9e('0x2b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2c'));db[_0x0a9e('0x2d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x2e'));db['UserChatQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x2f'));db[_0x0a9e('0x30')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x31'));db[_0x0a9e('0x32')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x33'));db[_0x0a9e('0x34')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x0a9e('0x35')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x36'));db[_0x0a9e('0x37')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x38'));db[_0x0a9e('0x39')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x3a'));db[_0x0a9e('0x3b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x0a9e('0x3c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailQueue/mailQueue.model');db[_0x0a9e('0x3d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x0a9e('0x3e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x3f'));db['MailApplication']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x40'));db['MailQueueReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x41'));db['Dashboard']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x42'));db[_0x0a9e('0x43')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x44'));db[_0x0a9e('0x45')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x46'));db[_0x0a9e('0x47')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x48'));db['FaxInteraction']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x49'));db[_0x0a9e('0x4a')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4b'));db[_0x0a9e('0x4c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x4d'));db[_0x0a9e('0x4e')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x4f'));db[_0x0a9e('0x50')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x51'));db[_0x0a9e('0x52')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/smsApplication/smsApplication.model');db[_0x0a9e('0x53')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x54'));db[_0x0a9e('0x55')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x56'));db[_0x0a9e('0x57')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x58'));db[_0x0a9e('0x59')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x5a'));db[_0x0a9e('0x5b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5c'));db[_0x0a9e('0x5d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x0a9e('0x5e')]=db[_0x0a9e('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x5f'));db[_0x0a9e('0x60')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x61'));db[_0x0a9e('0x62')]=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x0a9e('0x63')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatApplication/chatApplication.model');db[_0x0a9e('0x64')]=db[_0x0a9e('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x0a9e('0x65')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatMessage/chatMessage.model');db[_0x0a9e('0x66')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x0a9e('0x67')]=db[_0x0a9e('0x1')]['import']('../api/chatQueue/chatQueue.model');db[_0x0a9e('0x68')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x69'));db['ChatProactiveAction']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x6a'));db['CmCompany']=db['sequelize']['import'](_0x0a9e('0x6b'));db['CmContact']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6c'));db[_0x0a9e('0x6d')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x6e'));db[_0x0a9e('0x6f')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x70'));db[_0x0a9e('0x71')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x72'));db['CmHopperHistory']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x0a9e('0x73')]=db['sequelize'][_0x0a9e('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db['sequelize'][_0x0a9e('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x0a9e('0x74')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x75'));db[_0x0a9e('0x76')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x77'));db['CannedAnswer']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x78'));db['Disposition']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x79'));db[_0x0a9e('0x7a')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x7b'));db['Interval']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x7c'));db[_0x0a9e('0x7d')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x7e'));db[_0x0a9e('0x7f')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x80'));db['VoiceQueuesLog']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x81'));db[_0x0a9e('0x82')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x83'));db[_0x0a9e('0x84')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x85'));db[_0x0a9e('0x86')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x87'));db[_0x0a9e('0x88')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x89'));db['CmContactHasItem']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8a'));db['CmHopperAdditionalPhone']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x0a9e('0x8b')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8c'));db[_0x0a9e('0x8d')]=db['sequelize']['import']('../api/trigger/trigger.model');db[_0x0a9e('0x8e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x8f'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['IntegrationReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x92'));db['AnalyticCustomReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x93'));db[_0x0a9e('0x94')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x95'));db[_0x0a9e('0x96')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x97'));db[_0x0a9e('0x98')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0x0a9e('0x99')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9a'));db['AnalyticTreeReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9b'));db[_0x0a9e('0x9c')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9d'));db[_0x0a9e('0x9e')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x9f'));db[_0x0a9e('0xa0')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x0a9e('0xa1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x0a9e('0xa2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa3'));db['SugarcrmField']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa4'));db['DeskAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xa5'));db[_0x0a9e('0xa6')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xa7'));db[_0x0a9e('0xa8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xa9'));db[_0x0a9e('0xaa')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xab'));db[_0x0a9e('0xac')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xad'));db[_0x0a9e('0xae')]=db['sequelize'][_0x0a9e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x0a9e('0xaf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb0'));db['ZendeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb1'));db[_0x0a9e('0xb2')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0x0a9e('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xb4'));db[_0x0a9e('0xb5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xb6'));db['VtigerAccount']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xb7'));db[_0x0a9e('0xb8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x0a9e('0xb9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0x0a9e('0xba')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbb'));db[_0x0a9e('0xbc')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xbd'));db['ServicenowField']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x0a9e('0xbe')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x0a9e('0xbf')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xc0'));db[_0x0a9e('0xc1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc2'));db[_0x0a9e('0xc3')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xc4'));db[_0x0a9e('0xc5')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc6'));db[_0x0a9e('0xc7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc8'));db[_0x0a9e('0x90')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x91'));db['Network']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xc9'));db[_0x0a9e('0xca')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcb'));db[_0x0a9e('0xcc')]=db['sequelize'][_0x0a9e('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x0a9e('0xcd')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xce'));db['JscriptyQuestionReport']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xcf'));db[_0x0a9e('0xd0')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xd1'));db[_0x0a9e('0xd2')]=db['sequelize']['import'](_0x0a9e('0xd3'));db[_0x0a9e('0xd4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd5'));db[_0x0a9e('0xd6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xd7'));db['JscriptyProject']=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xd8'));db[_0x0a9e('0xd9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xda'));db['SquareOdbc']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xdb'));db[_0x0a9e('0xdc')]=db[_0x0a9e('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x0a9e('0xdd')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xde'));db[_0x0a9e('0xdf')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe0'));db['Team']=db['sequelize'][_0x0a9e('0x12')]('../api/team/team.model');db[_0x0a9e('0xe1')]=db['sequelize'][_0x0a9e('0x12')]('../api/license/license.model');db['Campaign']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/campaign/campaign.model');db[_0x0a9e('0xe2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe3'));db[_0x0a9e('0xe4')]=db['sequelize']['import'](_0x0a9e('0xe5'));db[_0x0a9e('0xe6')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe7'));db['MailTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/mailTransferReport/mailTransferReport.model');db[_0x0a9e('0xe8')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xe9'));db[_0x0a9e('0xea')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xeb'));db[_0x0a9e('0xec')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0xed'));db[_0x0a9e('0xee')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xef'));db['CmList']=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf0'));db[_0x0a9e('0xf1')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x0a9e('0xf2')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfile/userProfile.model');db[_0x0a9e('0xf3')]=db['sequelize'][_0x0a9e('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0x0a9e('0xf4')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x0a9e('0xf5')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xf6'));db[_0x0a9e('0xf7')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xf8'));db[_0x0a9e('0xf9')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfa'));db[_0x0a9e('0xfb')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0xfc'));db[_0x0a9e('0xfd')]=db[_0x0a9e('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0x0a9e('0xfe')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0xff'));db['WhatsappTransferReport']=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x100'));db[_0x0a9e('0x101')]=db['sequelize'][_0x0a9e('0x12')](_0x0a9e('0x102'));db[_0x0a9e('0x103')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x104'));db[_0x0a9e('0x105')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x106'));db[_0x0a9e('0x107')]=db[_0x0a9e('0x1')]['import'](_0x0a9e('0x108'));db[_0x0a9e('0x109')]=db[_0x0a9e('0x1')][_0x0a9e('0x12')](_0x0a9e('0x10a'));db['UserSetting']=db[_0x0a9e('0x1')][_0x0a9e('0x12')]('../api/user-setting/user-setting.model');db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db[_0x0a9e('0x10c')],{'as':'VoiceMail','onDelete':'cascade','foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x10b')](db['UserSetting'],{'as':_0x0a9e('0x10d'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x111')],{'as':_0x0a9e('0x112'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x113'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x117'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x118'),'foreignKey':_0x0a9e('0x10f')});db['User'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x11a'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xfb')],{'as':_0x0a9e('0x11e'),'foreignKey':'UserId'});db[_0x0a9e('0x11')][_0x0a9e('0x110')](db[_0x0a9e('0xf5')],{'as':_0x0a9e('0x11f'),'foreignKey':_0x0a9e('0x120')});db[_0x0a9e('0x11')]['belongsTo'](db[_0x0a9e('0xf2')],{'as':'UserProfile','foreignKey':'userProfileId'});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x68')],{'as':_0x0a9e('0x122'),'through':_0x0a9e('0x123')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x125'),'through':_0x0a9e('0x126')});db[_0x0a9e('0x11')]['belongsToMany'](db['CmList'],{'as':_0x0a9e('0x127'),'through':_0x0a9e('0x128')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x12a')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x11d'),'through':_0x0a9e('0x12b')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'through':'user_has_chat_interactions'});db['User']['belongsToMany'](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x12c'),'through':_0x0a9e('0x12d')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x53')],{'as':'SmsInteractions','through':_0x0a9e('0x12e')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'as':_0x0a9e('0x118'),'through':_0x0a9e('0x12f')});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0xfb')],{'as':'WhatsappInteractions','through':_0x0a9e('0x130')});db['User'][_0x0a9e('0x121')](db['VoiceQueue'],{'as':_0x0a9e('0x131'),'through':_0x0a9e('0x2d'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0xf1')],{'as':_0x0a9e('0x132'),'through':_0x0a9e('0x109'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x3c')],{'as':'MailQueues','through':_0x0a9e('0x30'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x133'),'through':_0x0a9e('0x134'),'required':![],'hooks':!![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x4c')],{'as':_0x0a9e('0x135'),'through':_0x0a9e('0x32'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'as':_0x0a9e('0x136'),'through':_0x0a9e('0x34'),'required':![]});db[_0x0a9e('0x11')]['belongsToMany'](db[_0x0a9e('0x137')],{'as':'OpenchannelQueues','through':_0x0a9e('0x35'),'required':![]});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'as':_0x0a9e('0x138'),'through':_0x0a9e('0x37'),'required':![]});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'through':_0x0a9e('0x128')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x13a'),'through':_0x0a9e('0x13b')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x45')],{'as':'FaxAccounts','through':_0x0a9e('0x13c')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x13d'),'through':_0x0a9e('0x13e')});db[_0x0a9e('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x0a9e('0x13f'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x11')][_0x0a9e('0x121')](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x141'),'through':_0x0a9e('0x142')});db['User'][_0x0a9e('0x121')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x143'),'through':_0x0a9e('0x144')});db[_0x0a9e('0x13')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':'SpiedAgents','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x145')});db[_0x0a9e('0x146')]['hasMany'](db[_0x0a9e('0x16')],{'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x16')][_0x0a9e('0x110')](db['VoiceExtension'],{'as':_0x0a9e('0x147'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x18')][_0x0a9e('0x121')](db[_0x0a9e('0x84')],{'as':_0x0a9e('0x148'),'through':_0x0a9e('0x149')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x2b')],{'as':_0x0a9e('0x14a'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':'VoiceQueueId'});db[_0x0a9e('0x1a')]['hasMany'](db[_0x0a9e('0x116')],{'as':'HopperHistories','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db['CmHopperBlack'],{'as':_0x0a9e('0x14d'),'foreignKey':_0x0a9e('0x14b')});db[_0x0a9e('0x1a')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':_0x0a9e('0x14e'),'foreignKey':_0x0a9e('0x14b')});db['VoiceQueue']['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a')][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':_0x0a9e('0x151'),'foreignKey':_0x0a9e('0x152')});db['VoiceQueue'][_0x0a9e('0x150')](db['Interval'],{'as':'Interval','foreignKey':_0x0a9e('0x153')});db['VoiceQueue'][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db['VoiceQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'as':_0x0a9e('0x155'),'through':_0x0a9e('0x105')});db[_0x0a9e('0x1a')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x1c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x10c')]['hasMany'](db['VoiceMailMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'mailboxuser','sourceKey':_0x0a9e('0x159')});db[_0x0a9e('0x1f')][_0x0a9e('0x150')](db[_0x0a9e('0x10c')],{'foreignKey':_0x0a9e('0x15a'),'targetKey':_0x0a9e('0x159')});db[_0x0a9e('0x15b')][_0x0a9e('0x110')](db[_0x0a9e('0x25')],{'as':_0x0a9e('0x15c'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')]['hasMany'](db[_0x0a9e('0x15e')],{'as':_0x0a9e('0x15f'),'foreignKey':_0x0a9e('0x15d'),'constraints':![]});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x15b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db['MailServerIn'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x39')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':'CloudProvider','foreignKey':_0x0a9e('0x162'),'onDelete':'restrict'});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x163')][_0x0a9e('0x150')](db[_0x0a9e('0x103')],{'as':_0x0a9e('0x103'),'foreignKey':_0x0a9e('0x162'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x3b')][_0x0a9e('0x10b')](db[_0x0a9e('0x39')],{'as':_0x0a9e('0x165'),'onDelete':_0x0a9e('0x10e')});db['MailAccount']['hasOne'](db[_0x0a9e('0x163')],{'as':_0x0a9e('0x166'),'onDelete':'cascade'});db['MailAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'MailAccountId','onDelete':_0x0a9e('0x10e')});db['MailAccount'][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':'MailAccountId'});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x3e')],{'as':'Messages','foreignKey':_0x0a9e('0x161')});db['MailAccount']['hasMany'](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x3b')][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x161'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x3b')][_0x0a9e('0x150')](db[_0x0a9e('0x8b')],{'as':_0x0a9e('0x8b'),'foreignKey':_0x0a9e('0x16e')});db[_0x0a9e('0x3b')]['belongsTo'](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x3b')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x0a9e('0x13e')});db['MailQueue'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x30')});db[_0x0a9e('0x3c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x11c')]['hasMany'](db[_0x0a9e('0x3e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':'MailInteractionId'});db[_0x0a9e('0x11c')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x11c')]['belongsTo'](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11c')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x173'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x11c')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12b'),'foreignKey':_0x0a9e('0x177')});db[_0x0a9e('0x3e')]['hasMany'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0x178'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':'User'});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x3e')][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{'as':_0x0a9e('0x179'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'as':'Account','foreignKey':_0x0a9e('0x161')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x60')],{'as':'ChatWebsite','foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x3e')]['belongsTo'](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':'ChatOfflineMessageId'});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x16b')]['belongsTo'](db[_0x0a9e('0x3b')],{'onDelete':_0x0a9e('0x164')});db['MailApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x16b')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':_0x0a9e('0x16d')});db['MailQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailInteraction'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db['MailMessage'],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x17c')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{});db[_0x0a9e('0x17d')]['hasMany'](db[_0x0a9e('0x43')],{'as':'Items','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')]['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':'Answers','foreignKey':_0x0a9e('0x17f')});db['FaxAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x147'),'foreignKey':'FaxAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x45')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x180'),'onDelete':'cascade'});db[_0x0a9e('0x45')]['hasMany'](db['FaxMessage'],{'as':_0x0a9e('0x158')});db['FaxAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x28')],{'as':'Trunk'});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x45')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x0a9e('0x45')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_fax_accounts'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'restrict'});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x4c')],{'onDelete':'restrict'});db[_0x0a9e('0x47')]['belongsTo'](db[_0x0a9e('0x45')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x47')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['FaxInteraction'][_0x0a9e('0x110')](db[_0x0a9e('0x4a')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x11b')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':'fax_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x185'),'as':'ThroughTags'});db[_0x0a9e('0x11b')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x12d'),'foreignKey':_0x0a9e('0x182')});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x11')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{'as':_0x0a9e('0x179'),'foreignKey':'FaxInteractionId'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':'Contact'});db[_0x0a9e('0x4a')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['FaxMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'as':'Account','foreignKey':_0x0a9e('0x17f')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db['User'],{'as':'Agents','through':_0x0a9e('0x32')});db[_0x0a9e('0x4c')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x187'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['FaxAccount'],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxInteraction'],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x4a')],{});db[_0x0a9e('0x4e')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['FaxQueueReport'][_0x0a9e('0x150')](db['FaxQueue'],{});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x188'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db['SmsMessage'],{'as':_0x0a9e('0x158'),'foreignKey':_0x0a9e('0x188')});db['SmsAccount']['hasMany'](db[_0x0a9e('0x53')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x50')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x147'),'foreignKey':'SmsAccountId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x50')][_0x0a9e('0x150')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x50')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x142')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db['User'],{'onDelete':_0x0a9e('0x164')});db['SmsApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{'onDelete':_0x0a9e('0x164')});db['SmsApplication']['belongsTo'](db[_0x0a9e('0x50')],{'onDelete':'restrict'});db[_0x0a9e('0x52')]['belongsTo'](db['Interval'],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x52')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x53')][_0x0a9e('0x110')](db[_0x0a9e('0x55')],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x189')});db['SmsInteraction']['belongsTo'](db[_0x0a9e('0x50')],{'as':'Account','foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x53')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'sms_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x53')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x18a'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x53')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Users','through':_0x0a9e('0x12e'),'foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x55')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x0a9e('0x189')});db[_0x0a9e('0x55')]['belongsTo'](db[_0x0a9e('0x50')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x188')});db[_0x0a9e('0x57')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x34'),'foreignKey':_0x0a9e('0x18b')});db[_0x0a9e('0x57')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x155')});db[_0x0a9e('0x59')]['hasMany'](db['Disposition'],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x59')][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':_0x0a9e('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','foreignKey':_0x0a9e('0x18d')});db['OpenchannelAccount'][_0x0a9e('0x110')](db[_0x0a9e('0x5b')],{'as':'Applications','foreignKey':_0x0a9e('0x18d'),'onDelete':_0x0a9e('0x10e')});db['OpenchannelAccount'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x59')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0x59')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x140')});db[_0x0a9e('0x5b')]['belongsTo'](db['User'],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x0a9e('0x18e')});db['OpenchannelApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x5b')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x153')});db['OpenchannelApplication']['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x5d')][_0x0a9e('0x110')](db[_0x0a9e('0x5e')],{'as':'Messages','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x18f')});db[_0x0a9e('0x5d')]['belongsTo'](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db['OpenchannelInteraction'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x5d')][_0x0a9e('0x150')](db['User'],{'as':'Owner','foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x174')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x0a9e('0x175')});db[_0x0a9e('0x5d')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x0a9e('0x18f')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160')});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0x5d')],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x179'),'foreignKey':'OpenchannelInteractionId'});db[_0x0a9e('0x5e')]['belongsTo'](db[_0x0a9e('0xe4')],{'as':_0x0a9e('0xe4'),'foreignKey':_0x0a9e('0x186')});db['OpenchannelMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x18d')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x35'),'foreignKey':_0x0a9e('0x18e')});db[_0x0a9e('0x137')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x155')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x17e')],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x17a')});db['ChatWebsite'][_0x0a9e('0x110')](db[_0x0a9e('0x191')],{'as':_0x0a9e('0x192')});db[_0x0a9e('0x60')]['hasMany'](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x16a')});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x63')],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x17a'),'onDelete':'cascade'});db[_0x0a9e('0x60')][_0x0a9e('0x110')](db[_0x0a9e('0x65')],{'as':_0x0a9e('0x158')});db['ChatWebsite'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x60')][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db['ChatWebsite'][_0x0a9e('0x150')](db['MailAccount'],{'as':_0x0a9e('0x3b'),'foreignKey':_0x0a9e('0x161')});db['ChatWebsite'][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':_0x0a9e('0x16f'),'foreignKey':_0x0a9e('0x154')});db['ChatWebsite'][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x5d')],{});db['OpenchannelQueueReport'][_0x0a9e('0x150')](db['OpenchannelMessage'],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0x62')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{});db['ChatApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x193'),'foreignKey':'UserId','onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{'as':_0x0a9e('0x194'),'foreignKey':_0x0a9e('0x195'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':_0x0a9e('0x17a'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x63')][_0x0a9e('0x150')](db[_0x0a9e('0x86')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x181')});db[_0x0a9e('0x64')][_0x0a9e('0x110')](db['ChatMessage'],{'as':_0x0a9e('0x158'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x64')]['belongsTo'](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x64')]['belongsTo'](db['User'],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x174')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x198'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x64')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x199'),'foreignKey':_0x0a9e('0x197')});db['ChatMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':'cascade','as':_0x0a9e('0x11')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x197')});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0xe4')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x0a9e('0x65')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x17a')});db[_0x0a9e('0x66')][_0x0a9e('0x110')](db['Attachment'],{'as':_0x0a9e('0x178'),'foreignKey':_0x0a9e('0x19a'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x0a9e('0x10e'),'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0x66')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x0a9e('0x67')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserChatQueue','hooks':!![]});db[_0x0a9e('0x67')]['belongsToMany'](db['Team'],{'through':_0x0a9e('0x19b'),'as':'Teams'});db[_0x0a9e('0x68')][_0x0a9e('0x110')](db[_0x0a9e('0xcc')],{'as':'Messages','foreignKey':_0x0a9e('0x19c'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x68')]['belongsToMany'](db['User'],{'as':_0x0a9e('0x14a'),'through':_0x0a9e('0x123')});db[_0x0a9e('0x191')][_0x0a9e('0x150')](db[_0x0a9e('0x60')],{'as':_0x0a9e('0x196'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x0a9e('0x110')](db[_0x0a9e('0x124')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact']['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x0a9e('0x19d')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':'HopperFinals','foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'as':'JscriptySessions','foreignKey':_0x0a9e('0x172')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x5d')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db[_0x0a9e('0x64')],{'as':_0x0a9e('0x119'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db['CmContact'][_0x0a9e('0x110')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db[_0x0a9e('0x11b')],{'as':'FaxInteractions','foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x124')][_0x0a9e('0x110')](db['MailInteraction'],{'as':_0x0a9e('0x11d'),'foreignKey':_0x0a9e('0x172'),'onDelete':'restrict'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x19f')],{'as':_0x0a9e('0x1a0'),'foreignKey':'CompanyId'});db[_0x0a9e('0x124')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':'cascade'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db['User'],{'as':_0x0a9e('0x176'),'through':'cm_user_has_contacts'});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'as':_0x0a9e('0x174'),'through':_0x0a9e('0x1a1')});db[_0x0a9e('0x124')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1a1'),'as':_0x0a9e('0x175')});db[_0x0a9e('0x6d')][_0x0a9e('0x110')](db[_0x0a9e('0x1a2')],{'as':_0x0a9e('0x1a3'),'foreignKey':_0x0a9e('0x1a4')});db['CmHopper'][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopper'][_0x0a9e('0x150')](db['User'],{'as':'Agent','foreignKey':'UserId'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':_0x0a9e('0x194'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':'CampaignId','onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6d')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x1a6')});db['CmHopperBlack'][_0x0a9e('0x150')](db['CmContact'],{'as':'Contact','foreignKey':_0x0a9e('0x172'),'onDelete':'cascade'});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x6f')][_0x0a9e('0x150')](db[_0x0a9e('0x1a')],{'as':'Queue','foreignKey':_0x0a9e('0x14b'),'onDelete':_0x0a9e('0x10e')});db['CmHopperBlack'][_0x0a9e('0x150')](db[_0x0a9e('0x1a5')],{'as':_0x0a9e('0x1a5'),'foreignKey':_0x0a9e('0x1a7'),'onDelete':'cascade'});db[_0x0a9e('0x76')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1a8'),'singular':_0x0a9e('0x1a9')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x76')]['hasMany'](db[_0x0a9e('0x7a')],{'as':{'plural':'Any','singular':_0x0a9e('0x1aa')},'foreignKey':'AutomationAnyId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db['Automation'][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x167')]['hasMany'](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1ac'),'onDelete':'cascade'});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db['Interval'],{'as':_0x0a9e('0x1ad'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x10e'),'hooks':!![],'required':![]});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'foreignKey':_0x0a9e('0x153'),'onDelete':_0x0a9e('0x164')});db['Interval'][_0x0a9e('0x110')](db[_0x0a9e('0x16b')],{'as':_0x0a9e('0x1ae'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')]['hasMany'](db['ChatApplication'],{'as':_0x0a9e('0x1af'),'foreignKey':'IntervalId'});db[_0x0a9e('0x17b')]['hasMany'](db[_0x0a9e('0x47')],{'as':_0x0a9e('0x1b0'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x17b')][_0x0a9e('0x110')](db[_0x0a9e('0x52')],{'as':_0x0a9e('0x1b1'),'foreignKey':'IntervalId'});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{});db['Schedule'][_0x0a9e('0x150')](db[_0x0a9e('0x94')],{'foreignKey':_0x0a9e('0x1b2')});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x0a9e('0x1b3')});db[_0x0a9e('0x84')][_0x0a9e('0x121')](db[_0x0a9e('0x18')],{'as':'Mohs','through':_0x0a9e('0x149'),'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0x124')],{'through':'cm_contact_has_tags'});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x64')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x0a9e('0x121')](db['MailInteraction'],{'through':_0x0a9e('0x173')});db['Tag'][_0x0a9e('0x121')](db[_0x0a9e('0x53')],{'through':_0x0a9e('0x18a')});db['Tag']['belongsToMany'](db[_0x0a9e('0x11b')],{'through':_0x0a9e('0x185')});db[_0x0a9e('0x86')][_0x0a9e('0x121')](db['OpenchannelInteraction'],{'through':_0x0a9e('0x1b4')});db[_0x0a9e('0x86')]['belongsToMany'](db[_0x0a9e('0xfb')],{'through':_0x0a9e('0x1b5')});db[_0x0a9e('0x1b6')]['belongsTo'](db[_0x0a9e('0x88')],{'as':_0x0a9e('0x1b7'),'foreignKey':_0x0a9e('0x1b8')});db[_0x0a9e('0x1a2')][_0x0a9e('0x150')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x1b9'),'foreignKey':_0x0a9e('0x1a4')});db[_0x0a9e('0x1b6')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x19d')});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x7a')],{'as':{'plural':_0x0a9e('0x1ba'),'singular':_0x0a9e('0x1bb')},'foreignKey':_0x0a9e('0x1bc'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db['Condition'],{'as':{'plural':_0x0a9e('0x1bd'),'singular':_0x0a9e('0x1be')},'foreignKey':_0x0a9e('0x1bf'),'onDelete':'cascade','hooks':!![]});db[_0x0a9e('0x8d')][_0x0a9e('0x110')](db[_0x0a9e('0x74')],{'as':_0x0a9e('0x1ab'),'foreignKey':'TriggerId','onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x1c0')]['hasMany'](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x0a9e('0x98')][_0x0a9e('0x110')](db[_0x0a9e('0x99')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c2')});db['AnalyticFieldReport']['belongsTo'](db[_0x0a9e('0x98')],{'foreignKey':_0x0a9e('0x1c2')});db[_0x0a9e('0x9c')]['hasMany'](db[_0x0a9e('0x9e')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c4'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0x9e')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x9e')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db['SalesforceConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x9c')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa0')][_0x0a9e('0x110')](db['SalesforceField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa0')]['hasMany'](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['SalesforceField'][_0x0a9e('0x110')](db[_0x0a9e('0xa0')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa0')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xa1')][_0x0a9e('0x110')](db[_0x0a9e('0xa2')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa2')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa2')][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['SugarcrmConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0xa1')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db['SugarcrmField'][_0x0a9e('0x110')](db[_0x0a9e('0x1cc')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1cc')]['hasMany'](db[_0x0a9e('0x1cc')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['SugarcrmField'][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1cf')]['hasMany'](db[_0x0a9e('0xa6')],{'as':'Configurations','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xa6')]['hasMany'](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':'FieldId'});db[_0x0a9e('0xa6')][_0x0a9e('0x150')](db[_0x0a9e('0x1cf')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xa6')]['belongsToMany'](db[_0x0a9e('0x86')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x0a9e('0x110')](db['DeskField'],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xa8')][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['DeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xa8')],{'as':'Field','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xa8')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xaa')][_0x0a9e('0x110')](db[_0x0a9e('0xac')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Subjects','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xac')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cd'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c5')});db['ZohoConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c1'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xac')][_0x0a9e('0x150')](db[_0x0a9e('0xaa')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1c8'),'foreignKey':'SubjectId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x0a9e('0xae')][_0x0a9e('0x110')](db[_0x0a9e('0xae')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xae')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xaf')][_0x0a9e('0x110')](db['ZendeskConfiguration'],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d0')]['hasMany'](db[_0x0a9e('0xb2')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x0a9e('0x1d0')][_0x0a9e('0x150')](db[_0x0a9e('0xaf')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0x1d0')]['belongsToMany'](db['Tag'],{'through':_0x0a9e('0x1d1')});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db['ZendeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x0a9e('0xb2')][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['ZendeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb2')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb2')][_0x0a9e('0x150')](db['Variable'],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d2')][_0x0a9e('0x110')](db[_0x0a9e('0x1d3')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1c4'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d3')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d3')]['hasMany'](db['FreshdeskField'],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db['FreshdeskConfiguration'][_0x0a9e('0x150')](db[_0x0a9e('0x1d2')],{'as':'Account','foreignKey':_0x0a9e('0x1c7')});db['FreshdeskConfiguration'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1d4')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xb5')][_0x0a9e('0x110')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['FreshdeskField'][_0x0a9e('0x110')](db[_0x0a9e('0xb5')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb5')]['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0x1d5')]['hasMany'](db[_0x0a9e('0xb8')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xb8')]['hasMany'](db[_0x0a9e('0xb9')],{'as':_0x0a9e('0x1c4'),'foreignKey':_0x0a9e('0x1c9')});db['VtigerConfiguration'][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb8')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Fields','foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb8')][_0x0a9e('0x150')](db[_0x0a9e('0x1d5')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db[_0x0a9e('0xb9')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db['VtigerField']['hasMany'](db[_0x0a9e('0xb9')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xb9')][_0x0a9e('0x110')](db['VtigerField'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xb9')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db[_0x0a9e('0xba')]['hasMany'](db[_0x0a9e('0xbc')],{'as':_0x0a9e('0x1c3'),'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x0a9e('0x1c4'),'foreignKey':'SubjectId'});db[_0x0a9e('0xbc')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cd'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xbc')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c1'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbc')][_0x0a9e('0x150')](db[_0x0a9e('0xba')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['ServicenowField'][_0x0a9e('0x110')](db[_0x0a9e('0x1d6')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0x1d6')]['hasMany'](db[_0x0a9e('0x1d6')],{'as':'Description','foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0x1d6')][_0x0a9e('0x110')](db['ServicenowField'],{'as':_0x0a9e('0x1cb'),'foreignKey':'FieldId'});db[_0x0a9e('0x1d6')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':'VariableId'});db[_0x0a9e('0xbe')]['hasMany'](db[_0x0a9e('0xbf')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xbe')][_0x0a9e('0x150')](db['CloudProvider'],{'as':_0x0a9e('0x103'),'foreignKey':'CloudProviderId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x0a9e('0xbf')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1cd'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c5')});db['Dynamics365Configuration'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':'Fields','onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xbf')][_0x0a9e('0x150')](db[_0x0a9e('0xbe')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1c7')});db['Dynamics365Field'][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1c8'),'foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db[_0x0a9e('0xc1')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db[_0x0a9e('0xc1')][_0x0a9e('0x110')](db['Dynamics365Field'],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db[_0x0a9e('0xc1')][_0x0a9e('0x150')](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['FreshsalesAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xc5')],{'as':_0x0a9e('0x1c3'),'onDelete':'cascade','foreignKey':_0x0a9e('0x1c7')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc5')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cd'),'foreignKey':'DescriptionId'});db[_0x0a9e('0xc5')]['hasMany'](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1c1'),'foreignKey':'FieldId'});db[_0x0a9e('0xc5')]['belongsTo'](db[_0x0a9e('0xc3')],{'as':_0x0a9e('0x183'),'foreignKey':'AccountId'});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':'Subject','foreignKey':_0x0a9e('0x1c9')});db[_0x0a9e('0xc7')][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1ca'),'foreignKey':_0x0a9e('0x1c5')});db['FreshsalesField'][_0x0a9e('0x110')](db[_0x0a9e('0xc7')],{'as':_0x0a9e('0x1cb'),'foreignKey':_0x0a9e('0x1c6')});db['FreshsalesField']['belongsTo'](db[_0x0a9e('0x8e')],{'as':_0x0a9e('0x8e'),'foreignKey':_0x0a9e('0x1ce')});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x60')],{});db['ChatQueueReport']['belongsTo'](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':'ListId'});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x64')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xca')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db['ChatQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x67')],{});db['ChatInternalMessage']['belongsTo'](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x10e'),'foreignKey':_0x0a9e('0x1d7')});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0x1d8')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x0a9e('0xd0')]['hasMany'](db[_0x0a9e('0xcd')],{'foreignKey':'SessionId','onDelete':_0x0a9e('0x10e')});db['SmsQueueReport']['belongsTo'](db[_0x0a9e('0x50')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db['CmContact'],{'as':_0x0a9e('0x160'),'foreignKey':'ContactId'});db[_0x0a9e('0xd2')]['belongsTo'](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xd2')]['belongsTo'](db['SmsMessage'],{});db['SmsQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{});db[_0x0a9e('0xd2')][_0x0a9e('0x150')](db[_0x0a9e('0x57')],{});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0xd0')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db[_0x0a9e('0x1d8')],{'foreignKey':_0x0a9e('0x1da')});db[_0x0a9e('0x1d9')][_0x0a9e('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'user_has_teams'});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0x1a')],{'through':'TeamVoiceQueue','as':_0x0a9e('0x131')});db['Team']['belongsToMany'](db[_0x0a9e('0x3c')],{'through':_0x0a9e('0x171'),'as':_0x0a9e('0x1db')});db[_0x0a9e('0x129')]['belongsToMany'](db['ChatQueue'],{'through':_0x0a9e('0x19b'),'as':'ChatQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db['FaxQueue'],{'through':_0x0a9e('0x187'),'as':'FaxQueues'});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x57')],{'through':_0x0a9e('0x18c'),'as':_0x0a9e('0x136')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x137')],{'through':_0x0a9e('0x190'),'as':_0x0a9e('0x1dc')});db[_0x0a9e('0x129')][_0x0a9e('0x121')](db[_0x0a9e('0x101')],{'through':_0x0a9e('0x1dd'),'as':_0x0a9e('0x138')});db[_0x0a9e('0x129')]['belongsToMany'](db[_0x0a9e('0xf1')],{'through':_0x0a9e('0x107'),'as':_0x0a9e('0x132')});db['Campaign'][_0x0a9e('0x110')](db[_0x0a9e('0x6d')],{'as':_0x0a9e('0x14c'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')][_0x0a9e('0x110')](db['CmHopperHistory'],{'as':_0x0a9e('0x19e'),'foreignKey':_0x0a9e('0x1a7')});db[_0x0a9e('0x1a5')]['hasMany'](db[_0x0a9e('0x6f')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x0a9e('0x1a5')]['belongsTo'](db[_0x0a9e('0x28')],{'as':'Trunk','foreignKey':_0x0a9e('0x14f')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['Trunk'],{'as':_0x0a9e('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'as':_0x0a9e('0x17b'),'foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0x1a5')][_0x0a9e('0x150')](db['SquareProject'],{'as':_0x0a9e('0xdc'),'foreignKey':_0x0a9e('0x1de')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':'Lists','through':_0x0a9e('0x1df')});db[_0x0a9e('0x1a5')][_0x0a9e('0x121')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x156'),'through':_0x0a9e('0x1e0')});db[_0x0a9e('0xe4')][_0x0a9e('0x150')](db[_0x0a9e('0x66')],{'as':_0x0a9e('0x66'),'foreignKey':_0x0a9e('0x19a')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db['MailMessage'],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x11c')],{});db['MailTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e2'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0x1e1')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x0a9e('0x1e1')][_0x0a9e('0x150')](db[_0x0a9e('0x3b')],{'foreignKey':_0x0a9e('0x1e7'),'as':_0x0a9e('0x1e8')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x65')],{});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['ChatInteraction'],{});db[_0x0a9e('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1e9'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xe8')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xe8')]['belongsTo'](db[_0x0a9e('0x67')],{'foreignKey':_0x0a9e('0x1eb'),'as':'ToQueue'});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x0a9e('0x1ec'),'as':_0x0a9e('0x1e8')});db['FaxTransferReport'][_0x0a9e('0x150')](db['FaxMessage'],{});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11b')],{});db['FaxTransferReport']['belongsTo'](db[_0x0a9e('0x45')],{'foreignKey':_0x0a9e('0x1ed'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xea')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x0a9e('0x1ee'),'as':_0x0a9e('0x1ef')});db[_0x0a9e('0xea')][_0x0a9e('0x150')](db[_0x0a9e('0x45')],{'foreignKey':'ToFaxAccountId','as':_0x0a9e('0x1e8')});db[_0x0a9e('0xec')]['belongsTo'](db[_0x0a9e('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x0a9e('0x1e3')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'FromUserId','as':_0x0a9e('0x1e4')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1e5'),'as':_0x0a9e('0x1e6')});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x137')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x0a9e('0xec')][_0x0a9e('0x150')](db[_0x0a9e('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x0a9e('0x55')],{});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x53')],{});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':_0x0a9e('0x1f0'),'as':_0x0a9e('0x1e3')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':_0x0a9e('0x1e4')});db[_0x0a9e('0xee')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0xee')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x0a9e('0x1ef')});db[_0x0a9e('0xee')]['belongsTo'](db[_0x0a9e('0x50')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x0a9e('0x167')],{'as':_0x0a9e('0x168'),'foreignKey':_0x0a9e('0x16d'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x1f1')],{'as':_0x0a9e('0x1f2'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db['CmContact'],{'as':_0x0a9e('0x125'),'onDelete':'cascade','foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x71')],{'as':_0x0a9e('0x115'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0x139')][_0x0a9e('0x110')](db[_0x0a9e('0x116')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList'][_0x0a9e('0x110')](db[_0x0a9e('0x73')],{'as':_0x0a9e('0x73'),'foreignKey':'ListId'});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x1a')],{'as':'Queues','through':_0x0a9e('0x1f3')});db[_0x0a9e('0x139')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':'Agents','through':_0x0a9e('0x128')});db[_0x0a9e('0xf1')][_0x0a9e('0x110')](db[_0x0a9e('0x16')],{'as':_0x0a9e('0x114'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf1')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':'UserVoicePrefix'});db[_0x0a9e('0xf1')]['belongsToMany'](db[_0x0a9e('0x129')],{'through':'TeamVoicePrefix','as':_0x0a9e('0x155')});db[_0x0a9e('0xf2')][_0x0a9e('0x110')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'foreignKey':_0x0a9e('0x1f4')});db['UserProfile'][_0x0a9e('0x110')](db['UserProfileSection'],{'as':_0x0a9e('0x1f5'),'foreignKey':_0x0a9e('0x1f4'),'onDelete':_0x0a9e('0x10e')});db['UserProfileSection']['hasMany'](db['UserProfileResource'],{'as':_0x0a9e('0x1f6'),'foreignKey':_0x0a9e('0x1f7'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db[_0x0a9e('0x167')],{'as':'Dispositions','foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['CannedAnswer'],{'as':_0x0a9e('0x169'),'foreignKey':_0x0a9e('0x1f8')});db['WhatsappAccount'][_0x0a9e('0x110')](db[_0x0a9e('0xfd')],{'as':_0x0a9e('0x158'),'foreignKey':'WhatsappAccountId'});db[_0x0a9e('0xf7')]['hasMany'](db[_0x0a9e('0xfb')],{'as':'Interactions'});db[_0x0a9e('0xf7')][_0x0a9e('0x110')](db['WhatsappApplication'],{'as':_0x0a9e('0x147'),'foreignKey':_0x0a9e('0x1f8'),'onDelete':_0x0a9e('0x10e')});db['WhatsappAccount'][_0x0a9e('0x150')](db['CmList'],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xf7')][_0x0a9e('0x150')](db[_0x0a9e('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0x0a9e('0x154')});db[_0x0a9e('0xf7')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x144')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db[_0x0a9e('0x101')],{'onDelete':_0x0a9e('0x164')});db[_0x0a9e('0xf9')][_0x0a9e('0x150')](db['WhatsappAccount'],{'onDelete':_0x0a9e('0x164')});db['WhatsappApplication'][_0x0a9e('0x150')](db[_0x0a9e('0x17b')],{'onDelete':'restrict','foreignKey':_0x0a9e('0x153')});db[_0x0a9e('0xf9')]['belongsTo'](db[_0x0a9e('0x86')],{'onDelete':_0x0a9e('0x164'),'foreignKey':_0x0a9e('0x181')});db['WhatsappInteraction'][_0x0a9e('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfb')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x184'),'foreignKey':_0x0a9e('0x10f')});db[_0x0a9e('0xfb')][_0x0a9e('0x121')](db[_0x0a9e('0x86')],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x174')});db['WhatsappInteraction'][_0x0a9e('0x121')](db['Tag'],{'through':_0x0a9e('0x1b5'),'as':_0x0a9e('0x175')});db[_0x0a9e('0xfb')]['belongsToMany'](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x176'),'through':_0x0a9e('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x11')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'onDelete':'cascade','as':_0x0a9e('0x160')});db[_0x0a9e('0xfd')][_0x0a9e('0x150')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0x0a9e('0x179'),'foreignKey':_0x0a9e('0x1f9')});db[_0x0a9e('0xfd')]['belongsTo'](db[_0x0a9e('0xf7')],{'as':_0x0a9e('0x183'),'foreignKey':_0x0a9e('0x1f8')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0xf7')],{});db['WhatsappQueueReport'][_0x0a9e('0x150')](db[_0x0a9e('0x139')],{'as':_0x0a9e('0x16c'),'foreignKey':_0x0a9e('0x16d')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db[_0x0a9e('0x124')],{'as':_0x0a9e('0x160'),'foreignKey':_0x0a9e('0x172')});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x0a9e('0x101')],{});db[_0x0a9e('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db[_0x0a9e('0xfe')][_0x0a9e('0x150')](db['User'],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfd')],{});db['WhatsappTransferReport'][_0x0a9e('0x150')](db[_0x0a9e('0xfb')],{});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x0a9e('0x1fb'),'as':_0x0a9e('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db[_0x0a9e('0xf7')],{'foreignKey':_0x0a9e('0x1fc'),'as':'ToAccount'});db[_0x0a9e('0x1fa')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x0a9e('0x1fd'),'as':_0x0a9e('0x1ef')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x0a9e('0x1ea'),'as':'FromAgent'});db[_0x0a9e('0x1fa')][_0x0a9e('0x150')](db['User'],{'foreignKey':'ToUserId','as':_0x0a9e('0x1e6')});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x170'),'through':_0x0a9e('0x37'),'foreignKey':'WhatsappQueueId'});db[_0x0a9e('0x101')][_0x0a9e('0x121')](db[_0x0a9e('0x129')],{'through':_0x0a9e('0x1dd'),'as':'Teams'});db[_0x0a9e('0x1fe')][_0x0a9e('0x150')](db[_0x0a9e('0x11')],{'as':_0x0a9e('0x1ff'),'foreignKey':_0x0a9e('0x10f'),'onDelete':_0x0a9e('0x10e'),'hooks':!![]});db[_0x0a9e('0x103')][_0x0a9e('0x10b')](db['Dynamics365Account'],{'as':_0x0a9e('0xbe'),'onDelete':_0x0a9e('0x164')});db['CloudProvider'][_0x0a9e('0x10b')](db['MailServerIn'],{'as':'Imap','onDelete':_0x0a9e('0x164')});db['CloudProvider']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x0a9e('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 3924cac..d870908 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dc2=['./api/integrationReport','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','/api/analytics/tree_reports','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/setting','/api/square/recordings','./api/squareRecording','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./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/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','./api/authActiveDirectory','./api/jira','./api/rpc','/api/version','/api/system','./api/system','/api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.5.0','/plugins','/server/files/plugins','route','resolve','get','appPath','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','use','/api/users','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./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/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/cmHopperAdditionalPhone','./api/template','/api/variables','/api/integrations','./api/integration'];(function(_0x3b58d9,_0x3e02ec){var _0x28f2d4=function(_0x963ce3){while(--_0x963ce3){_0x3b58d9['push'](_0x3b58d9['shift']());}};_0x28f2d4(++_0x3e02ec);}(_0x7dc2,0x19d));var _0x27dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7dc2[_0x20a584];return _0x4b41a8;};'use strict';var path=require('path');var express=require('express');var errors=require(_0x27dc('0x0'));var config=require(_0x27dc('0x1'));var setupLoggers=require(_0x27dc('0x2'))[_0x27dc('0x3')];var clientSideLogs=require('./api/client-side-logs');exports[_0x27dc('0x4')]=function(_0x29ba23){return setupLoggers(_0x29ba23)['then'](function(){_0x29ba23[_0x27dc('0x5')](_0x27dc('0x6'),require('./api/user'));_0x29ba23[_0x27dc('0x5')]('/api/voice/chanspy',require(_0x27dc('0x7')));_0x29ba23[_0x27dc('0x5')]('/api/voice/contexts',require(_0x27dc('0x8')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x9'),require(_0x27dc('0xa')));_0x29ba23['use'](_0x27dc('0xb'),require('./api/voiceMusicOnHold'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xc'),require(_0x27dc('0xd')));_0x29ba23['use']('/api/voice/recordings',require(_0x27dc('0xe')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xf'),require(_0x27dc('0x10')));_0x29ba23['use'](_0x27dc('0x11'),require('./api/voiceMail'));_0x29ba23[_0x27dc('0x5')]('/api/voice/mails/messages',require(_0x27dc('0x12')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x13'),require(_0x27dc('0x14')));_0x29ba23['use'](_0x27dc('0x15'),require(_0x27dc('0x16')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x17'),require(_0x27dc('0x18')));_0x29ba23['use'](_0x27dc('0x19'),require(_0x27dc('0x1a')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x1b'),require('./api/memberReport'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x1c'),require(_0x27dc('0x1d')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x1e'),require(_0x27dc('0x1f')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x20'),require(_0x27dc('0x21')));_0x29ba23[_0x27dc('0x5')]('/api/mail/accounts',require(_0x27dc('0x22')));_0x29ba23[_0x27dc('0x5')]('/api/mail/queues',require(_0x27dc('0x23')));_0x29ba23['use']('/api/mail/substatuses',require(_0x27dc('0x24')));_0x29ba23['use'](_0x27dc('0x25'),require('./api/mailInteraction'));_0x29ba23['use'](_0x27dc('0x26'),require('./api/mailMessage'));_0x29ba23[_0x27dc('0x5')]('/api/mail/applications',require(_0x27dc('0x27')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x28'),require(_0x27dc('0x29')));_0x29ba23['use'](_0x27dc('0x2a'),require('./api/dashboard'));_0x29ba23['use'](_0x27dc('0x2b'),require(_0x27dc('0x2c')));_0x29ba23['use'](_0x27dc('0x2d'),require(_0x27dc('0x2e')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x2f'),require(_0x27dc('0x30')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x31'),require(_0x27dc('0x32')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x33'),require(_0x27dc('0x34')));_0x29ba23['use'](_0x27dc('0x35'),require(_0x27dc('0x36')));_0x29ba23['use'](_0x27dc('0x37'),require(_0x27dc('0x38')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x39'),require('./api/smsAccount'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x3a'),require(_0x27dc('0x3b')));_0x29ba23['use'](_0x27dc('0x3c'),require(_0x27dc('0x3d')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x3e'),require('./api/smsMessage'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x3f'),require(_0x27dc('0x40')));_0x29ba23['use'](_0x27dc('0x41'),require(_0x27dc('0x42')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x43'),require(_0x27dc('0x44')));_0x29ba23['use'](_0x27dc('0x45'),require(_0x27dc('0x46')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x47'),require(_0x27dc('0x48')));_0x29ba23['use']('/api/openchannel/queues',require(_0x27dc('0x49')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x4a'),require(_0x27dc('0x4b')));_0x29ba23['use']('/api/openchannel/reports/queue',require(_0x27dc('0x4c')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x4d'),require('./api/chatApplication'));_0x29ba23[_0x27dc('0x5')]('/api/chat/interactions',require(_0x27dc('0x4e')));_0x29ba23['use'](_0x27dc('0x4f'),require(_0x27dc('0x50')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x51'),require(_0x27dc('0x52')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x53'),require(_0x27dc('0x54')));_0x29ba23['use'](_0x27dc('0x55'),require(_0x27dc('0x56')));_0x29ba23['use'](_0x27dc('0x57'),require(_0x27dc('0x58')));_0x29ba23[_0x27dc('0x5')]('/api/cm/companies',require(_0x27dc('0x59')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x5a'),require(_0x27dc('0x5b')));_0x29ba23['use'](_0x27dc('0x5c'),require(_0x27dc('0x5d')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x5e'),require(_0x27dc('0x5f')));_0x29ba23[_0x27dc('0x5')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x29ba23['use'](_0x27dc('0x60'),require(_0x27dc('0x61')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x62'),require('./api/cmCustomField'));_0x29ba23['use'](_0x27dc('0x63'),require('./api/action'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x64'),require(_0x27dc('0x65')));_0x29ba23['use'](_0x27dc('0x66'),require(_0x27dc('0x67')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x68'),require('./api/disposition'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x69'),require('./api/condition'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x6a'),require(_0x27dc('0x6b')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x6c'),require(_0x27dc('0x6d')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x6e'),require(_0x27dc('0x6f')));_0x29ba23['use'](_0x27dc('0x70'),require('./api/voiceQueuesLog'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x71'),require(_0x27dc('0x72')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x73'),require('./api/sound'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x74'),require(_0x27dc('0x75')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x76'),require(_0x27dc('0x77')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x78'),require(_0x27dc('0x79')));_0x29ba23['use']('/api/cm_hopper_additional_phones',require(_0x27dc('0x7a')));_0x29ba23[_0x27dc('0x5')]('/api/templates',require(_0x27dc('0x7b')));_0x29ba23[_0x27dc('0x5')]('/api/triggers',require('./api/trigger'));_0x29ba23['use'](_0x27dc('0x7c'),require('./api/variable'));_0x29ba23['use'](_0x27dc('0x7d'),require(_0x27dc('0x7e')));_0x29ba23[_0x27dc('0x5')]('/api/integrations/reports',require(_0x27dc('0x7f')));_0x29ba23[_0x27dc('0x5')]('/api/analytics/custom_reports',require(_0x27dc('0x80')));_0x29ba23[_0x27dc('0x5')]('/api/analytics/default_reports',require(_0x27dc('0x81')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x82'),require(_0x27dc('0x83')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x84'),require('./api/analyticMetric'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x85'),require('./api/analyticFieldReport'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x86'),require('./api/analyticTreeReport'));_0x29ba23[_0x27dc('0x5')]('/api/integrations/salesforce/accounts',require(_0x27dc('0x87')));_0x29ba23[_0x27dc('0x5')]('/api/integrations/salesforce/configurations',require(_0x27dc('0x88')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x89'),require(_0x27dc('0x8a')));_0x29ba23['use']('/api/integrations/sugarcrm/accounts',require(_0x27dc('0x8b')));_0x29ba23[_0x27dc('0x5')]('/api/integrations/sugarcrm/configurations',require(_0x27dc('0x8c')));_0x29ba23['use'](_0x27dc('0x8d'),require(_0x27dc('0x8e')));_0x29ba23['use'](_0x27dc('0x8f'),require(_0x27dc('0x90')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x91'),require('./api/intDeskConfiguration'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x92'),require(_0x27dc('0x93')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x94'),require(_0x27dc('0x95')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x96'),require(_0x27dc('0x97')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x98'),require(_0x27dc('0x99')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x9a'),require(_0x27dc('0x9b')));_0x29ba23[_0x27dc('0x5')]('/api/integrations/zendesk/configurations',require(_0x27dc('0x9c')));_0x29ba23['use'](_0x27dc('0x9d'),require(_0x27dc('0x9e')));_0x29ba23['use'](_0x27dc('0x9f'),require('./api/intFreshdeskAccount'));_0x29ba23['use'](_0x27dc('0xa0'),require(_0x27dc('0xa1')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xa2'),require(_0x27dc('0xa3')));_0x29ba23['use'](_0x27dc('0xa4'),require(_0x27dc('0xa5')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xa6'),require(_0x27dc('0xa7')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xa8'),require('./api/intVtigerField'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xa9'),require('./api/intServicenowAccount'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xaa'),require(_0x27dc('0xab')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xac'),require('./api/intServicenowField'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xad'),require(_0x27dc('0xae')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xaf'),require(_0x27dc('0xb0')));_0x29ba23[_0x27dc('0x5')]('/api/integrations/dynamics365/fields',require(_0x27dc('0xb1')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xb2'),require(_0x27dc('0xb3')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xb4'),require(_0x27dc('0xb5')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xb6'),require(_0x27dc('0xb7')));_0x29ba23[_0x27dc('0x5')]('/api/networks',require(_0x27dc('0xb8')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xb9'),require('./api/chatQueueReport'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xba'),require(_0x27dc('0xbb')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xbc'),require(_0x27dc('0xbd')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xbe'),require(_0x27dc('0xbf')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xc0'),require(_0x27dc('0xc1')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xc2'),require(_0x27dc('0xc3')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xc4'),require(_0x27dc('0xc5')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xc6'),require(_0x27dc('0xc7')));_0x29ba23[_0x27dc('0x5')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x29ba23[_0x27dc('0x5')]('/api/settings',require(_0x27dc('0xc8')));_0x29ba23[_0x27dc('0x5')]('/api/square/odbc',require('./api/squareOdbc'));_0x29ba23[_0x27dc('0x5')]('/api/square/projects',require('./api/squareProject'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xc9'),require(_0x27dc('0xca')));_0x29ba23[_0x27dc('0x5')]('/api/square/messages',require('./api/squareMessage'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xcb'),require('./api/team'));_0x29ba23['use'](_0x27dc('0xcc'),require(_0x27dc('0xcd')));_0x29ba23['use'](_0x27dc('0xce'),require(_0x27dc('0xcf')));_0x29ba23['use'](_0x27dc('0xd0'),require(_0x27dc('0xd1')));_0x29ba23[_0x27dc('0x5')]('/api/attachments',require('./api/attachment'));_0x29ba23[_0x27dc('0x5')]('/api/plugins',require(_0x27dc('0xd2')));_0x29ba23['use'](_0x27dc('0xd3'),require('./api/mailTransferReport'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xd4'),require('./api/chatTransferReport'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xd5'),require(_0x27dc('0xd6')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xd7'),require(_0x27dc('0xd8')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xd9'),require(_0x27dc('0xda')));_0x29ba23['use'](_0x27dc('0xdb'),require('./api/cmList'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xdc'),require(_0x27dc('0xdd')));_0x29ba23['use'](_0x27dc('0xde'),require('./api/userProfile'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xdf'),require(_0x27dc('0xe0')));_0x29ba23['use'](_0x27dc('0xe1'),require(_0x27dc('0xe2')));_0x29ba23['use'](_0x27dc('0xe3'),require(_0x27dc('0xe4')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xe5'),require(_0x27dc('0xe6')));_0x29ba23['use'](_0x27dc('0xe7'),require('./api/whatsappApplication'));_0x29ba23['use'](_0x27dc('0xe8'),require(_0x27dc('0xe9')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xea'),require('./api/whatsappMessage'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xeb'),require(_0x27dc('0xec')));_0x29ba23['use'](_0x27dc('0xed'),require(_0x27dc('0xee')));_0x29ba23[_0x27dc('0x5')]('/api/whatsapp/queues',require(_0x27dc('0xef')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xf0'),require(_0x27dc('0xf1')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xf2'),require('./api/realtime'));_0x29ba23['use'](_0x27dc('0xf3'),require(_0x27dc('0xf4')));_0x29ba23['use'](_0x27dc('0xf5'),require(_0x27dc('0xf6')));_0x29ba23[_0x27dc('0x5')]('/api/auth/google',require(_0x27dc('0xf7')));_0x29ba23['use']('/api/auth/activedirectory',require(_0x27dc('0xf8')));_0x29ba23[_0x27dc('0x5')]('/api/jira',require(_0x27dc('0xf9')));_0x29ba23['use']('/api/rpc',require(_0x27dc('0xfa')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xfb'),require('./api/version'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xfc'),require(_0x27dc('0xfd')));_0x29ba23[_0x27dc('0x5')]('/api/pm2',require('./api/pm2'));_0x29ba23[_0x27dc('0x5')](_0x27dc('0xfe'),require('./api/webbar'));_0x29ba23[_0x27dc('0x5')]('/api/logs',clientSideLogs);_0x29ba23[_0x27dc('0x5')](_0x27dc('0xff'),express[_0x27dc('0x100')](path['join'](config[_0x27dc('0x101')],'/apidoc')));_0x29ba23['use'](_0x27dc('0x102'),express[_0x27dc('0x100')](path[_0x27dc('0x103')](config[_0x27dc('0x101')],'/www')));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x104'),express[_0x27dc('0x100')](path[_0x27dc('0x103')](config[_0x27dc('0x101')],_0x27dc('0x104'))));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x105'),express[_0x27dc('0x100')](path['join'](config[_0x27dc('0x101')],_0x27dc('0x106'),_0x27dc('0x107'))));_0x29ba23[_0x27dc('0x5')](_0x27dc('0x108'),express[_0x27dc('0x100')](path[_0x27dc('0x103')](config['root'],_0x27dc('0x109'))));_0x29ba23[_0x27dc('0x10a')]('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x29ba23[_0x27dc('0x10a')]('/*')['get'](function(_0x2345ae,_0x1f0832){_0x1f0832['sendFile'](path[_0x27dc('0x10b')](_0x29ba23[_0x27dc('0x10c')](_0x27dc('0x10d'))+'/index.html'));});return _0x29ba23;});}; \ No newline at end of file +var _0xea1a=['/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','/snippet','snippet','3.5.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/smsAccount','/api/sms/applications','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0xea1a,0x158));var _0xaea1=function(_0x3f98af,_0xd3f14f){_0x3f98af=_0x3f98af-0x0;var _0x3f3e76=_0xea1a[_0x3f98af];return _0x3f3e76;};'use strict';var path=require(_0xaea1('0x0'));var express=require(_0xaea1('0x1'));var errors=require(_0xaea1('0x2'));var config=require(_0xaea1('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0xaea1('0x4')];var clientSideLogs=require(_0xaea1('0x5'));exports[_0xaea1('0x6')]=function(_0x4584dd){return setupLoggers(_0x4584dd)[_0xaea1('0x7')](function(){_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9'),require(_0xaea1('0xa')));_0x4584dd['use'](_0xaea1('0xb'),require(_0xaea1('0xc')));_0x4584dd[_0xaea1('0x8')]('/api/voice/contexts',require(_0xaea1('0xd')));_0x4584dd['use'](_0xaea1('0xe'),require('./api/voiceExtension'));_0x4584dd[_0xaea1('0x8')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x4584dd['use'](_0xaea1('0xf'),require('./api/voiceQueue'));_0x4584dd['use'](_0xaea1('0x10'),require(_0xaea1('0x11')));_0x4584dd['use'](_0xaea1('0x12'),require(_0xaea1('0x13')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x14'),require(_0xaea1('0x15')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x16'),require('./api/voiceMailMessage'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x17'),require(_0xaea1('0x18')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x19'),require(_0xaea1('0x1a')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x1b'),require(_0xaea1('0x1c')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x1d'),require(_0xaea1('0x1e')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x1f'),require(_0xaea1('0x20')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x21'),require(_0xaea1('0x22')));_0x4584dd['use'](_0xaea1('0x23'),require('./api/voiceTransferReport'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x24'),require(_0xaea1('0x25')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x26'),require(_0xaea1('0x27')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x28'),require(_0xaea1('0x29')));_0x4584dd[_0xaea1('0x8')]('/api/mail/substatuses',require(_0xaea1('0x2a')));_0x4584dd['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x4584dd['use'](_0xaea1('0x2b'),require('./api/mailMessage'));_0x4584dd['use'](_0xaea1('0x2c'),require(_0xaea1('0x2d')));_0x4584dd[_0xaea1('0x8')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x2e'),require(_0xaea1('0x2f')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x30'),require('./api/dashboardItem'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x31'),require(_0xaea1('0x32')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x33'),require(_0xaea1('0x34')));_0x4584dd[_0xaea1('0x8')]('/api/fax/interactions',require(_0xaea1('0x35')));_0x4584dd['use'](_0xaea1('0x36'),require(_0xaea1('0x37')));_0x4584dd['use'](_0xaea1('0x38'),require(_0xaea1('0x39')));_0x4584dd['use'](_0xaea1('0x3a'),require('./api/faxQueueReport'));_0x4584dd['use']('/api/sms/accounts',require(_0xaea1('0x3b')));_0x4584dd['use'](_0xaea1('0x3c'),require('./api/smsApplication'));_0x4584dd[_0xaea1('0x8')]('/api/sms/interactions',require(_0xaea1('0x3d')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x3e'),require(_0xaea1('0x3f')));_0x4584dd[_0xaea1('0x8')]('/api/sms/queues',require(_0xaea1('0x40')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x41'),require(_0xaea1('0x42')));_0x4584dd['use'](_0xaea1('0x43'),require(_0xaea1('0x44')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x45'),require(_0xaea1('0x46')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x47'),require(_0xaea1('0x48')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x49'),require(_0xaea1('0x4a')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x4b'),require(_0xaea1('0x4c')));_0x4584dd['use']('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x4584dd[_0xaea1('0x8')]('/api/chat/applications',require(_0xaea1('0x4d')));_0x4584dd[_0xaea1('0x8')]('/api/chat/interactions',require(_0xaea1('0x4e')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x4f'),require(_0xaea1('0x50')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x51'),require(_0xaea1('0x52')));_0x4584dd[_0xaea1('0x8')]('/api/chat/queues',require(_0xaea1('0x53')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x54'),require(_0xaea1('0x55')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x56'),require(_0xaea1('0x57')));_0x4584dd['use'](_0xaea1('0x58'),require(_0xaea1('0x59')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x5a'),require(_0xaea1('0x5b')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x5c'),require(_0xaea1('0x5d')));_0x4584dd[_0xaea1('0x8')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4584dd[_0xaea1('0x8')]('/api/cm/hopper_final',require(_0xaea1('0x5e')));_0x4584dd['use'](_0xaea1('0x5f'),require(_0xaea1('0x60')));_0x4584dd[_0xaea1('0x8')]('/api/cm/custom_fields',require(_0xaea1('0x61')));_0x4584dd['use'](_0xaea1('0x62'),require(_0xaea1('0x63')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x64'),require(_0xaea1('0x65')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x66'),require(_0xaea1('0x67')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x68'),require(_0xaea1('0x69')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x6a'),require(_0xaea1('0x6b')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x6c'),require(_0xaea1('0x6d')));_0x4584dd[_0xaea1('0x8')]('/api/pauses',require('./api/pause'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x6e'),require(_0xaea1('0x6f')));_0x4584dd[_0xaea1('0x8')]('/api/voiceQueuesLog',require(_0xaea1('0x70')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x71'),require(_0xaea1('0x72')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x73'),require(_0xaea1('0x74')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x75'),require('./api/tag'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x76'),require('./api/contactItemType'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x77'),require(_0xaea1('0x78')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x79'),require(_0xaea1('0x7a')));_0x4584dd['use'](_0xaea1('0x7b'),require(_0xaea1('0x7c')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x7d'),require(_0xaea1('0x7e')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x7f'),require('./api/variable'));_0x4584dd['use'](_0xaea1('0x80'),require(_0xaea1('0x81')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x82'),require(_0xaea1('0x83')));_0x4584dd['use'](_0xaea1('0x84'),require('./api/analyticCustomReport'));_0x4584dd[_0xaea1('0x8')]('/api/analytics/default_reports',require(_0xaea1('0x85')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x86'),require(_0xaea1('0x87')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x88'),require(_0xaea1('0x89')));_0x4584dd[_0xaea1('0x8')]('/api/analytics/field_reports',require(_0xaea1('0x8a')));_0x4584dd['use'](_0xaea1('0x8b'),require(_0xaea1('0x8c')));_0x4584dd[_0xaea1('0x8')]('/api/integrations/salesforce/accounts',require(_0xaea1('0x8d')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x8e'),require('./api/intSalesforceConfiguration'));_0x4584dd['use'](_0xaea1('0x8f'),require(_0xaea1('0x90')));_0x4584dd[_0xaea1('0x8')]('/api/integrations/sugarcrm/accounts',require(_0xaea1('0x91')));_0x4584dd['use'](_0xaea1('0x92'),require(_0xaea1('0x93')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x94'),require(_0xaea1('0x95')));_0x4584dd['use']('/api/integrations/desk/accounts',require(_0xaea1('0x96')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x97'),require(_0xaea1('0x98')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x99'),require(_0xaea1('0x9a')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9b'),require(_0xaea1('0x9c')));_0x4584dd[_0xaea1('0x8')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x4584dd[_0xaea1('0x8')]('/api/integrations/zoho/fields',require(_0xaea1('0x9d')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9e'),require('./api/intZendeskAccount'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x9f'),require(_0xaea1('0xa0')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa1'),require('./api/intZendeskField'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa2'),require(_0xaea1('0xa3')));_0x4584dd['use'](_0xaea1('0xa4'),require('./api/intFreshdeskConfiguration'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa5'),require(_0xaea1('0xa6')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa7'),require(_0xaea1('0xa8')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xa9'),require(_0xaea1('0xaa')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xab'),require(_0xaea1('0xac')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xad'),require(_0xaea1('0xae')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xaf'),require(_0xaea1('0xb0')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb1'),require(_0xaea1('0xb2')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb3'),require(_0xaea1('0xb4')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb5'),require(_0xaea1('0xb6')));_0x4584dd['use'](_0xaea1('0xb7'),require(_0xaea1('0xb8')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xb9'),require(_0xaea1('0xba')));_0x4584dd['use'](_0xaea1('0xbb'),require(_0xaea1('0xbc')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xbd'),require(_0xaea1('0xbe')));_0x4584dd['use'](_0xaea1('0xbf'),require('./api/network'));_0x4584dd['use'](_0xaea1('0xc0'),require(_0xaea1('0xc1')));_0x4584dd[_0xaea1('0x8')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xc2'),require(_0xaea1('0xc3')));_0x4584dd['use'](_0xaea1('0xc4'),require(_0xaea1('0xc5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xc6'),require(_0xaea1('0xc7')));_0x4584dd['use'](_0xaea1('0xc8'),require(_0xaea1('0xc9')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xca'),require('./api/squareReport'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xcb'),require('./api/squareReportDetail'));_0x4584dd[_0xaea1('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x4584dd[_0xaea1('0x8')]('/api/settings',require('./api/setting'));_0x4584dd['use'](_0xaea1('0xcc'),require(_0xaea1('0xcd')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xce'),require('./api/squareProject'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xcf'),require(_0xaea1('0xd0')));_0x4584dd[_0xaea1('0x8')]('/api/square/messages',require(_0xaea1('0xd1')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xd2'),require('./api/team'));_0x4584dd[_0xaea1('0x8')]('/api/license',require(_0xaea1('0xd3')));_0x4584dd['use'](_0xaea1('0xd4'),require(_0xaea1('0xd5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xd6'),require('./api/migration'));_0x4584dd[_0xaea1('0x8')]('/api/attachments',require(_0xaea1('0xd7')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xd8'),require(_0xaea1('0xd9')));_0x4584dd['use']('/api/mail/reports/transfer',require(_0xaea1('0xda')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xdb'),require(_0xaea1('0xdc')));_0x4584dd[_0xaea1('0x8')]('/api/fax/reports/transfer',require(_0xaea1('0xdd')));_0x4584dd['use'](_0xaea1('0xde'),require(_0xaea1('0xdf')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe0'),require(_0xaea1('0xe1')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe2'),require(_0xaea1('0xe3')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe4'),require(_0xaea1('0xe5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe6'),require('./api/userProfile'));_0x4584dd[_0xaea1('0x8')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xe7'),require(_0xaea1('0xe8')));_0x4584dd['use'](_0xaea1('0xe9'),require('./api/userNotification'));_0x4584dd[_0xaea1('0x8')]('/api/whatsapp/accounts',require(_0xaea1('0xea')));_0x4584dd['use'](_0xaea1('0xeb'),require(_0xaea1('0xec')));_0x4584dd['use'](_0xaea1('0xed'),require(_0xaea1('0xee')));_0x4584dd[_0xaea1('0x8')]('/api/whatsapp/messages',require(_0xaea1('0xef')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xf0'),require(_0xaea1('0xf1')));_0x4584dd['use'](_0xaea1('0xf2'),require(_0xaea1('0xf3')));_0x4584dd['use'](_0xaea1('0xf4'),require(_0xaea1('0xf5')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xf6'),require(_0xaea1('0xf7')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xf8'),require(_0xaea1('0xf9')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xfa'),require('./api/user-setting'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xfb'),require(_0xaea1('0xfc')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0xfd'),require('./api/authGoogle'));_0x4584dd['use'](_0xaea1('0xfe'),require(_0xaea1('0xff')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x100'),require(_0xaea1('0x101')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x102'),require(_0xaea1('0x103')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x104'),require(_0xaea1('0x105')));_0x4584dd[_0xaea1('0x8')]('/api/system',require(_0xaea1('0x106')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x107'),require('./api/pm2'));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x108'),require(_0xaea1('0x109')));_0x4584dd['use'](_0xaea1('0x10a'),clientSideLogs);_0x4584dd[_0xaea1('0x8')](_0xaea1('0x10b'),express[_0xaea1('0x10c')](path[_0xaea1('0x10d')](config['root'],'/apidoc')));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x10e'),express[_0xaea1('0x10c')](path[_0xaea1('0x10d')](config[_0xaea1('0x10f')],_0xaea1('0x10e'))));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x110'),express[_0xaea1('0x10c')](path['join'](config[_0xaea1('0x10f')],_0xaea1('0x110'))));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x111'),express['static'](path[_0xaea1('0x10d')](config[_0xaea1('0x10f')],_0xaea1('0x112'),_0xaea1('0x113'))));_0x4584dd[_0xaea1('0x8')](_0xaea1('0x114'),express[_0xaea1('0x10c')](path[_0xaea1('0x10d')](config[_0xaea1('0x10f')],_0xaea1('0x115'))));_0x4584dd[_0xaea1('0x116')](_0xaea1('0x117'))['get'](errors[0x194]);_0x4584dd[_0xaea1('0x116')]('/*')[_0xaea1('0x118')](function(_0x3d4072,_0x397aff){_0x397aff[_0xaea1('0x119')](path[_0xaea1('0x11a')](_0x4584dd['get'](_0xaea1('0x11b'))+_0xaea1('0x11c')));});return _0x4584dd;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9a9c5f5..6635a2a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa680=['../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','listen','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc'];(function(_0x5d1448,_0x2868e2){var _0x1b320b=function(_0x6bfd9c){while(--_0x6bfd9c){_0x5d1448['push'](_0x5d1448['shift']());}};_0x1b320b(++_0x2868e2);}(_0xa680,0xb0));var _0x0a68=function(_0x2fc8e7,_0x170aba){_0x2fc8e7=_0x2fc8e7-0x0;var _0x493e8c=_0xa680[_0x2fc8e7];return _0x493e8c;};'use strict';var jayson=require(_0x0a68('0x0'));var _=require(_0x0a68('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x343b4b,_0x25c259){var _0x29c430={};_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/user/user.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/voiceExtension/voiceExtension.rpc'));_0x29c430=_['merge'](_0x29c430,require('../api/voiceQueue/voiceQueue.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x3')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x4')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x5')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x6')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x7')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x8')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x9')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0xa')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0xb')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0xc')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0xd')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0xe')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/mailMessage/mailMessage.rpc'));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0xf')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x10')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x11')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x12')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/faxInteraction/faxInteraction.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x13')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x14')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x15')));_0x29c430=_['merge'](_0x29c430,require('../api/smsAccount/smsAccount.rpc'));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x16')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x17')));_0x29c430=_['merge'](_0x29c430,require('../api/smsQueue/smsQueue.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x18')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x19')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x1a')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x1b')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x1c')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/chatInteraction/chatInteraction.rpc'));_0x29c430=_['merge'](_0x29c430,require('../api/chatMessage/chatMessage.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x1d')));_0x29c430=_['merge'](_0x29c430,require('../api/cmContact/cmContact.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/cmHopper/cmHopper.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x1e')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x1f')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x20')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/pause/pause.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x21')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x22')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/template/template.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x23')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x24')));_0x29c430=_['merge'](_0x29c430,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x25')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x26')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x27')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x28')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x29')));_0x29c430=_['merge'](_0x29c430,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x2a')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x2b')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x2c')));_0x29c430=_['merge'](_0x29c430,require('../api/squareReport/squareReport.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x2d')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x2e')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x2f')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x30')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x31')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x32')));_0x29c430=_['merge'](_0x29c430,require(_0x0a68('0x33')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x34')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x35')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x36')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x37')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x38')));_0x29c430=_[_0x0a68('0x2')](_0x29c430,require(_0x0a68('0x39')));var _0x5e1eb1=jayson[_0x0a68('0x3a')](_0x29c430)[_0x0a68('0x3b')]();var _0x1fba26=config[_0x0a68('0x3c')][_0x0a68('0x3d')]||config[_0x0a68('0x3d')]+0x1;var _0x992a27=config[_0x0a68('0x3c')]['ip']||_0x0a68('0x3e');_0x5e1eb1['on'](_0x0a68('0x3f'),function(_0x593add){return _0x25c259(_0x593add);});_0x5e1eb1[_0x0a68('0x40')](_0x1fba26,_0x992a27,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x992a27,_0x1fba26);require(_0x0a68('0x41'))['default']();return _0x343b4b(_0x0a68('0x42')+_0x992a27+':'+_0x1fba26);});});}; \ No newline at end of file +var _0x7c1f=['../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','log','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc'];(function(_0x1a0557,_0x2a0db7){var _0x1ad015=function(_0x34316){while(--_0x34316){_0x1a0557['push'](_0x1a0557['shift']());}};_0x1ad015(++_0x2a0db7);}(_0x7c1f,0x194));var _0xf7c1=function(_0x30a196,_0xd20c7d){_0x30a196=_0x30a196-0x0;var _0x4b089b=_0x7c1f[_0x30a196];return _0x4b089b;};'use strict';var jayson=require(_0xf7c1('0x0'));var _=require(_0xf7c1('0x1'));var config=require(_0xf7c1('0x2'));exports[_0xf7c1('0x3')]=function(){return new Promise(function(_0x3ca7b6,_0x568116){var _0x1e3254={};_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x5')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x6')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x7')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/voiceRecording/voiceRecording.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x8')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x9')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xa')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xb')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xc')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xd')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0xe')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0xf')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x10')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/mailAccount/mailAccount.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x11')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x12')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/mailMessage/mailMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/mailApplication/mailApplication.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x13')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x14')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/faxApplication/faxApplication.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/faxInteraction/faxInteraction.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/faxMessage/faxMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x15')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x16')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x17')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x18')));_0x1e3254=_['merge'](_0x1e3254,require('../api/smsMessage/smsMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x19')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x1a')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x1e3254=_['merge'](_0x1e3254,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1b')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x1c')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1d')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1e')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x1f')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/cmHopper/cmHopper.rpc'));_0x1e3254=_['merge'](_0x1e3254,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x20')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x21')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x22')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x23')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/pause/pause.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x24')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x25')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x26')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x27')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x28')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x29')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x2a')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x2b')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x2c')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x2d')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x2e')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x2f')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x30')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x31')));_0x1e3254=_['merge'](_0x1e3254,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x32')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x33')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x34')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x35')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/squareProject/squareProject.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/squareRecording/squareRecording.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x36')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x37')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require(_0xf7c1('0x38')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/plugin/plugin.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x39')));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x3a')));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1e3254=_[_0xf7c1('0x4')](_0x1e3254,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x1e3254=_['merge'](_0x1e3254,require(_0xf7c1('0x3b')));var _0x2a9a03=jayson[_0xf7c1('0x3c')](_0x1e3254)[_0xf7c1('0x3d')]();var _0x4f9fd4=config['rpc'][_0xf7c1('0x3e')]||config[_0xf7c1('0x3e')]+0x1;var _0x251bdc=config[_0xf7c1('0x3f')]['ip']||_0xf7c1('0x40');_0x2a9a03['on'](_0xf7c1('0x41'),function(_0x5bad53){return _0x568116(_0x5bad53);});_0x2a9a03[_0xf7c1('0x3')](_0x4f9fd4,_0x251bdc,function(){console[_0xf7c1('0x42')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x251bdc,_0x4f9fd4);require('../config/triggers')[_0xf7c1('0x43')]();return _0x3ca7b6(_0xf7c1('0x44')+_0x251bdc+':'+_0x4f9fd4);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 38312b3..1574a3e 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 _0xb1ef=['./reply','./error','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xfb1e('0x0'));var _=require(_0xfb1e('0x1'));var EventEmitter=require('events')[_0xfb1e('0x2')];var AGIReply=require(_0xfb1e('0x3'));var AGIError=require(_0xfb1e('0x4'));function AGIChannel(_0x2c7116){var _0xb70c57=this,_0x1ce096=new AGIReply(),_0x477ee0=![],_0x4b7622={};EventEmitter['call'](_0xb70c57);_0x2c7116[_0xfb1e('0x5')](_0xfb1e('0x6'));_0x2c7116[_0xfb1e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1ce096[_0xfb1e('0x5')]('utf8');_0x1ce096['on']('headers',function(_0x3c7643){for(var _0x106367 in _0x3c7643){_0xb70c57[_0x106367]=_0x3c7643[_0x106367];}_0xb70c57[_0xfb1e('0x8')](_0xfb1e('0x9'));});_0x1ce096['on'](_0xfb1e('0xa'),function(_0x2fbf8d){if(_0x2fbf8d[_0xfb1e('0xb')]()==_0xfb1e('0xc')){_0xb70c57['emit'](_0xfb1e('0xc'));return;}if(_0x2fbf8d[_0xfb1e('0xd')](0x0,0xb)==_0xfb1e('0xe')){_0x477ee0=!![];}if(_0x477ee0){_0x4b7622['rx']+=_0x2fbf8d+'\x0a';if(_0x2fbf8d[_0xfb1e('0xf')](_0xfb1e('0x10'))!=-0x1){_0x477ee0=![];}}else{_0x4b7622['rx']=_0x2fbf8d;}if(_0x477ee0){return;}if(typeof _0x4b7622['cb']==_0xfb1e('0x11')){var _0x2f7b2e=_0x4b7622['rx'][_0xfb1e('0xd')](0x0,0x3),_0x4f33f8=null,_0x30b991=null;_0x2f7b2e=parseInt(_0x2f7b2e);if(isNaN(_0x2f7b2e)){_0x4b7622['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2f7b2e!=0xc8){_0x4b7622['cb'](null,{'code':_0x2f7b2e,'result':-0x1,'extra':'KO'});return;}_0x4f33f8=_0x4b7622['rx'][_0xfb1e('0xd')](0x4)[_0xfb1e('0x12')](_0xfb1e('0x13'),'');if(_0x4f33f8[_0xfb1e('0x14')]('\x20')!=-0x1){_0x4f33f8=_0x4f33f8[_0xfb1e('0x15')](0x0,_0x4f33f8['indexOf']('\x20'));}if(_[_0xfb1e('0x16')](_0x4f33f8,'-1')){_0x4f33f8=parseInt(_0x4f33f8);}_0x30b991=_0x4b7622['rx'][_0xfb1e('0x17')]('\x20');if(_0x30b991[_0xfb1e('0x18')]==0x3){_0x30b991=_0x30b991[0x2][_0xfb1e('0xd')](0x1,_0x30b991[0x2][_0xfb1e('0x18')]-0x1);}else if(_0x30b991['length']>0x3){var _0x2f3d7e=/\((.+)\)/;var _0x3cf40c=_0x4b7622['rx'][_0xfb1e('0x19')](_0x2f3d7e);if(_0x3cf40c){_0x30b991=_0x3cf40c[0x1];}else{_0x30b991=null;}}else{_0x30b991=null;}_0x4b7622['cb'](null,{'code':_0x2f7b2e,'result':_0x4f33f8,'extra':_0x30b991});}});_0x2c7116['on'](_0xfb1e('0x1a'),function(_0x2b0116){_0xb70c57['emit'](_0xfb1e('0x1a'),new AGIError(_0xfb1e('0x1b'),_0x2b0116[_0xfb1e('0x1c')]));});_0x2c7116['on'](_0xfb1e('0x1d'),function(){_0xb70c57[_0xfb1e('0x8')]('close',new AGIError(_0xfb1e('0x1e')));});_0x2c7116['on']('timeout',function(){_0xb70c57['emit'](_0xfb1e('0x1f'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2c7116[_0xfb1e('0x20')]();});_0x2c7116[_0xfb1e('0x21')](_0x1ce096);this[_0xfb1e('0x22')]=function(_0x484d67,_0x548dc0){var _0x484d67=_0x484d67||'',_0x548dc0=typeof _0x548dc0==_0xfb1e('0x11')?_0x548dc0:new Function();_0x4b7622={'tx':_0x484d67,'rx':'','cb':_0x548dc0};_0x2c7116[_0xfb1e('0x23')](_0x484d67+'\x0a');},this[_0xfb1e('0x1d')]=function(){_0x2c7116[_0xfb1e('0x20')]();};}util[_0xfb1e('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x26')]=function(_0x4e24e3){return this[_0xfb1e('0x22')][_0xfb1e('0x27')](this,_0x4e24e3);};AGIChannel[_0xfb1e('0x25')]['answer']=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x28')]=function(_0x20826c,_0x4412d0,_0x3108b6){_0x20826c=_0x20826c===undefined?_0xfb1e('0x29'):_0x20826c;_0x4412d0=_0x4412d0===undefined?'5':_0x4412d0;_0x3108b6=_0x3108b6===undefined?'1':_0x3108b6;return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x2b'),_0x20826c,_0x4412d0*0x3e8,_0x3108b6));};AGIChannel['prototype'][_0xfb1e('0x2c')]=function(_0x2dfa98){_0x2dfa98=_0x2dfa98||_0xfb1e('0x2d');return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x2e'),_0x2dfa98));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x2f')]=function(_0x55a618,_0x35f2f3){if(_[_0xfb1e('0x30')](_0x35f2f3)){return this[_0xfb1e('0x26')](util['format'](_0xfb1e('0x31'),_0x55a618,_0x35f2f3['join'](',')));}return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x31'),_0x55a618,_0x35f2f3));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x32')]=function(_0x3fff90){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x33'),_0x3fff90));};AGIChannel['prototype'][_0xfb1e('0x34')]=function(_0x13b590){return this['sendRequest'](util[_0xfb1e('0x2a')](_0xfb1e('0x35'),_0x13b590));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x36')]=function(_0x8c628f){return this[_0xfb1e('0x26')](util['format']('SET\x20PRIORITY\x20%s',_0x8c628f));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0xc')]=function(){return this['sendRequest'](_0xfb1e('0x37'));};AGIChannel['prototype'][_0xfb1e('0x38')]=function(_0x3fc4de,_0x573bcc){var _0x2b375a=_['isBoolean'](_0x573bcc)||_[_0xfb1e('0x39')](_0x573bcc)?_0x573bcc[_0xfb1e('0x3a')]():_0x573bcc;return this[_0xfb1e('0x26')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3fc4de,_0x2b375a?_0x2b375a[_0xfb1e('0x3a')]()[_0xfb1e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfb1e('0x25')]['sayNumber']=function(_0x54e3d2,_0x33514d){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x3b'),_0x54e3d2,_0x33514d));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x3c')]=function(_0x35c2ae,_0x4eb62c){return this['sendRequest'](util[_0xfb1e('0x2a')](_0xfb1e('0x3d'),_0x35c2ae,_0x4eb62c));};AGIChannel[_0xfb1e('0x25')]['sayPhonetic']=function(_0x220512,_0x166558){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x220512,_0x166558));};AGIChannel[_0xfb1e('0x25')]['continueAt']=function(_0x371a1e,_0x4800a3,_0x4787a0){_0x4800a3=_0x4800a3||this[_0xfb1e('0x3e')];_0x4787a0=_0x4787a0||0x1;this['setContext'](_0x371a1e);this[_0xfb1e('0x34')](_0x4800a3);this[_0xfb1e('0x36')](_0x4787a0);return this[_0xfb1e('0x2c')](util[_0xfb1e('0x2a')](_0xfb1e('0x3f'),_0x371a1e,_0x4800a3,_0x4787a0));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x40')]=function(_0xa8f62d){return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x41'),_0xa8f62d));};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x42')]=function(_0x5c423b,_0x3a935e,_0x366f46,_0x310655,_0x5c7bf3,_0x2770fd){_0x3a935e=_0x3a935e||'wav';_0x366f46=_0x366f46||'';_0x310655=_0x310655===undefined?-0x1:_0x310655==='-1'?-0x1:_0x310655*0x3e8;_0x5c7bf3=_0x5c7bf3===undefined?'':'s='+_0x5c7bf3;_0x2770fd=_0x2770fd?_0xfb1e('0x43'):'';return this[_0xfb1e('0x26')](util[_0xfb1e('0x2a')](_0xfb1e('0x44'),_0x5c423b,_0x3a935e,_0x366f46,_0x310655,_0x2770fd,_0x5c7bf3));};AGIChannel[_0xfb1e('0x25')]['streamFile']=function(_0x2c80b7,_0x54d3e7){_0x54d3e7=_0x54d3e7||'';return this[_0xfb1e('0x26')](util['format'](_0xfb1e('0x45'),_0x2c80b7,_0x54d3e7));};AGIChannel[_0xfb1e('0x25')]['agi']=function(_0x2ff83e){return this[_0xfb1e('0x2f')]('AGI',_0x2ff83e);};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x46')]=function(_0x3da297){return this[_0xfb1e('0x2f')](_0xfb1e('0x47'),_0x3da297);};AGIChannel[_0xfb1e('0x25')][_0xfb1e('0x1a')]=function(_0x364b37,_0x51d055){this[_0xfb1e('0x2c')](util[_0xfb1e('0x2a')](_0xfb1e('0x48'),_0x364b37['id'],_0x364b37[_0xfb1e('0x49')],_0x51d055));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xfb1e('0x4a')]=AGIChannel; \ No newline at end of file +var _0x9bd9=['AGI','wait','WAIT','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','function','substring','replace','result=','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','sendRequest','getData','beep','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi'];(function(_0x3c15bd,_0x1139a1){var _0x2b9fe4=function(_0x4c17d1){while(--_0x4c17d1){_0x3c15bd['push'](_0x3c15bd['shift']());}};_0x2b9fe4(++_0x1139a1);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x2b0d88,_0x5b5ef2){_0x2b0d88=_0x2b0d88-0x0;var _0x1c9256=_0x9bd9[_0x2b0d88];return _0x1c9256;};'use strict';var util=require(_0x99bd('0x0'));var _=require(_0x99bd('0x1'));var EventEmitter=require(_0x99bd('0x2'))[_0x99bd('0x3')];var AGIReply=require(_0x99bd('0x4'));var AGIError=require(_0x99bd('0x5'));function AGIChannel(_0x502917){var _0x34aff7=this,_0x4a0491=new AGIReply(),_0x204fbb=![],_0x1b3141={};EventEmitter['call'](_0x34aff7);_0x502917[_0x99bd('0x6')](_0x99bd('0x7'));_0x502917[_0x99bd('0x8')](0x8*0x3c*0x3c*0x3e8);_0x4a0491[_0x99bd('0x6')](_0x99bd('0x7'));_0x4a0491['on'](_0x99bd('0x9'),function(_0x3814eb){for(var _0x2c34b8 in _0x3814eb){_0x34aff7[_0x2c34b8]=_0x3814eb[_0x2c34b8];}_0x34aff7[_0x99bd('0xa')](_0x99bd('0xb'));});_0x4a0491['on'](_0x99bd('0xc'),function(_0x468b6e){if(_0x468b6e[_0x99bd('0xd')]()==_0x99bd('0xe')){_0x34aff7['emit'](_0x99bd('0xe'));return;}if(_0x468b6e['substring'](0x0,0xb)==_0x99bd('0xf')){_0x204fbb=!![];}if(_0x204fbb){_0x1b3141['rx']+=_0x468b6e+'\x0a';if(_0x468b6e['search'](_0x99bd('0x10'))!=-0x1){_0x204fbb=![];}}else{_0x1b3141['rx']=_0x468b6e;}if(_0x204fbb){return;}if(typeof _0x1b3141['cb']==_0x99bd('0x11')){var _0x4a8bd9=_0x1b3141['rx'][_0x99bd('0x12')](0x0,0x3),_0x22237c=null,_0x500cd2=null;_0x4a8bd9=parseInt(_0x4a8bd9);if(isNaN(_0x4a8bd9)){_0x1b3141['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4a8bd9!=0xc8){_0x1b3141['cb'](null,{'code':_0x4a8bd9,'result':-0x1,'extra':'KO'});return;}_0x22237c=_0x1b3141['rx'][_0x99bd('0x12')](0x4)[_0x99bd('0x13')](_0x99bd('0x14'),'');if(_0x22237c['indexOf']('\x20')!=-0x1){_0x22237c=_0x22237c[_0x99bd('0x15')](0x0,_0x22237c[_0x99bd('0x16')]('\x20'));}if(_[_0x99bd('0x17')](_0x22237c,'-1')){_0x22237c=parseInt(_0x22237c);}_0x500cd2=_0x1b3141['rx'][_0x99bd('0x18')]('\x20');if(_0x500cd2[_0x99bd('0x19')]==0x3){_0x500cd2=_0x500cd2[0x2][_0x99bd('0x12')](0x1,_0x500cd2[0x2][_0x99bd('0x19')]-0x1);}else if(_0x500cd2[_0x99bd('0x19')]>0x3){var _0x3d3d3e=/\((.+)\)/;var _0x53a4ff=_0x1b3141['rx'][_0x99bd('0x1a')](_0x3d3d3e);if(_0x53a4ff){_0x500cd2=_0x53a4ff[0x1];}else{_0x500cd2=null;}}else{_0x500cd2=null;}_0x1b3141['cb'](null,{'code':_0x4a8bd9,'result':_0x22237c,'extra':_0x500cd2});}});_0x502917['on'](_0x99bd('0x1b'),function(_0x2fe078){_0x34aff7['emit']('error',new AGIError(_0x99bd('0x1c'),_0x2fe078[_0x99bd('0x1d')]));});_0x502917['on'](_0x99bd('0x1e'),function(){_0x34aff7[_0x99bd('0xa')](_0x99bd('0x1e'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x502917['on'](_0x99bd('0x1f'),function(){_0x34aff7['emit'](_0x99bd('0x1f'),new AGIError(_0x99bd('0x20')));_0x502917[_0x99bd('0x21')]();});_0x502917[_0x99bd('0x22')](_0x4a0491);this[_0x99bd('0x23')]=function(_0x57136d,_0x27c551){var _0x57136d=_0x57136d||'',_0x27c551=typeof _0x27c551=='function'?_0x27c551:new Function();_0x1b3141={'tx':_0x57136d,'rx':'','cb':_0x27c551};_0x502917[_0x99bd('0x24')](_0x57136d+'\x0a');},this['close']=function(){_0x502917['destroy']();};}util[_0x99bd('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x99bd('0x26')]['sendRequest']=function(_0x1958bc){return this[_0x99bd('0x23')][_0x99bd('0x27')](this,_0x1958bc);};AGIChannel[_0x99bd('0x26')]['answer']=function(){return this[_0x99bd('0x28')]('ANSWER');};AGIChannel['prototype'][_0x99bd('0x29')]=function(_0x5ebeeb,_0x52521e,_0x5a910b){_0x5ebeeb=_0x5ebeeb===undefined?_0x99bd('0x2a'):_0x5ebeeb;_0x52521e=_0x52521e===undefined?'5':_0x52521e;_0x5a910b=_0x5a910b===undefined?'1':_0x5a910b;return this[_0x99bd('0x28')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x5ebeeb,_0x52521e*0x3e8,_0x5a910b));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x2b')]=function(_0x1eabb9){_0x1eabb9=_0x1eabb9||'NO\x20MESSAGE';return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x2d'),_0x1eabb9));};AGIChannel['prototype'][_0x99bd('0x2e')]=function(_0x222b67,_0x4c5493){if(_[_0x99bd('0x2f')](_0x4c5493)){return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x30'),_0x222b67,_0x4c5493['join'](',')));}return this[_0x99bd('0x28')](util[_0x99bd('0x2c')]('EXEC\x20%s\x20%s',_0x222b67,_0x4c5493));};AGIChannel[_0x99bd('0x26')]['setContext']=function(_0x4f52a6){return this['sendRequest'](util[_0x99bd('0x2c')](_0x99bd('0x31'),_0x4f52a6));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x32')]=function(_0x6ef22b){return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x33'),_0x6ef22b));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x34')]=function(_0x589c65){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x35'),_0x589c65));};AGIChannel['prototype']['hangup']=function(){return this['sendRequest'](_0x99bd('0x36'));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x37')]=function(_0xbc705f,_0x5d3a07){var _0x26a1aa=_[_0x99bd('0x38')](_0x5d3a07)||_[_0x99bd('0x39')](_0x5d3a07)?_0x5d3a07[_0x99bd('0x3a')]():_0x5d3a07;return this['sendRequest'](util[_0x99bd('0x2c')](_0x99bd('0x3b'),_0xbc705f,_0x26a1aa?_0x26a1aa[_0x99bd('0x3a')]()[_0x99bd('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x99bd('0x3c')]=function(_0x2bafd6,_0x431a14){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x3d'),_0x2bafd6,_0x431a14));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x3e')]=function(_0x3e67e7,_0x7e29ec){return this[_0x99bd('0x28')](util[_0x99bd('0x2c')](_0x99bd('0x3f'),_0x3e67e7,_0x7e29ec));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x40')]=function(_0x2fcf71,_0x3cf047){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x41'),_0x2fcf71,_0x3cf047));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x42')]=function(_0x1cd890,_0x60ccde,_0x34624c){_0x60ccde=_0x60ccde||this[_0x99bd('0x43')];_0x34624c=_0x34624c||0x1;this[_0x99bd('0x44')](_0x1cd890);this[_0x99bd('0x32')](_0x60ccde);this[_0x99bd('0x34')](_0x34624c);return this[_0x99bd('0x2b')](util[_0x99bd('0x2c')](_0x99bd('0x45'),_0x1cd890,_0x60ccde,_0x34624c));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x46')]=function(_0x2d91be){return this[_0x99bd('0x28')](util['format'](_0x99bd('0x47'),_0x2d91be));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x48')]=function(_0x3be91f,_0x81cbb1,_0x31f6d7,_0x1ee803,_0x143cf1,_0x5cc942){_0x81cbb1=_0x81cbb1||_0x99bd('0x49');_0x31f6d7=_0x31f6d7||'';_0x1ee803=_0x1ee803===undefined?-0x1:_0x1ee803==='-1'?-0x1:_0x1ee803*0x3e8;_0x143cf1=_0x143cf1===undefined?'':'s='+_0x143cf1;_0x5cc942=_0x5cc942?_0x99bd('0x4a'):'';return this[_0x99bd('0x28')](util['format'](_0x99bd('0x4b'),_0x3be91f,_0x81cbb1,_0x31f6d7,_0x1ee803,_0x5cc942,_0x143cf1));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x4c')]=function(_0x50aca9,_0x32e942){_0x32e942=_0x32e942||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x50aca9,_0x32e942));};AGIChannel[_0x99bd('0x26')][_0x99bd('0x4d')]=function(_0x32f8b7){return this['exec'](_0x99bd('0x4e'),_0x32f8b7);};AGIChannel[_0x99bd('0x26')][_0x99bd('0x4f')]=function(_0x4d216c){return this[_0x99bd('0x2e')](_0x99bd('0x50'),_0x4d216c);};AGIChannel['prototype']['error']=function(_0x2222e7,_0x1d7ec0){this[_0x99bd('0x2b')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2222e7['id'],_0x2222e7[_0x99bd('0x51')],_0x1d7ec0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x99bd('0x52')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 45f5afa..71796a2 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 _0xadb1=['E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xadb1,0xfe));var _0x1adb=function(_0xc69222,_0x3ecaf9){_0xc69222=_0xc69222-0x0;var _0x68ca08=_0xadb1[_0xc69222];return _0x68ca08;};'use strict';var util=require(_0x1adb('0x0'));var error={'E_AGI_UNDEFINED':_0x1adb('0x1'),'E_AGI_ARGUMENT_PORT':_0x1adb('0x2'),'E_AGI_SERVER_ERROR':_0x1adb('0x3'),'E_AGI_SERVER_CLOSE':_0x1adb('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x1adb('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x1adb('0x6'),'E_AGI_SOCKET_CLOSE':_0x1adb('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x1adb('0x8'),'E_AGI_COMMAND_EMPTY':_0x1adb('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1adb('0xa'),'E_AGI_IVR_ENTRY':_0x1adb('0xb')};function AGIError(_0x56adcd){var _0x56adcd=_0x56adcd||null,_0x1cc5a8=_0x1cc5a8||[],_0x1b178e=0x1,_0x26023e='';if(!error[_0x56adcd]){_0x56adcd=_0x1adb('0xc');}_0x1cc5a8[_0x1adb('0xd')](error[_0x56adcd]);while(arguments[_0x1b178e]){_0x1cc5a8['push'](arguments[_0x1b178e]);_0x1b178e++;}_0x26023e=util[_0x1adb('0xe')][_0x1adb('0xf')](util,_0x1cc5a8);this[_0x1adb('0x10')]=_0x26023e;this[_0x1adb('0x11')]=_0x56adcd;}module[_0x1adb('0x12')]=AGIError; \ No newline at end of file +var _0xfd75=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfd75,0xa5));var _0x5fd7=function(_0x5423f0,_0x3f4e38){_0x5423f0=_0x5423f0-0x0;var _0x6a312e=_0xfd75[_0x5423f0];return _0x6a312e;};'use strict';var util=require(_0x5fd7('0x0'));var error={'E_AGI_UNDEFINED':_0x5fd7('0x1'),'E_AGI_ARGUMENT_PORT':_0x5fd7('0x2'),'E_AGI_SERVER_ERROR':_0x5fd7('0x3'),'E_AGI_SERVER_CLOSE':_0x5fd7('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x5fd7('0x5'),'E_AGI_SOCKET_ERROR':_0x5fd7('0x6'),'E_AGI_SOCKET_CLOSE':_0x5fd7('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x5fd7('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x5fd7('0x9'),'E_AGI_IVR_ENTRY':_0x5fd7('0xa')};function AGIError(_0x2fdbc4){var _0x2fdbc4=_0x2fdbc4||null,_0x16b193=_0x16b193||[],_0x3a4765=0x1,_0x253e35='';if(!error[_0x2fdbc4]){_0x2fdbc4=_0x5fd7('0xb');}_0x16b193['push'](error[_0x2fdbc4]);while(arguments[_0x3a4765]){_0x16b193[_0x5fd7('0xc')](arguments[_0x3a4765]);_0x3a4765++;}_0x253e35=util[_0x5fd7('0xd')][_0x5fd7('0xe')](util,_0x16b193);this[_0x5fd7('0xf')]=_0x253e35;this['name']=_0x2fdbc4;}module[_0x5fd7('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index b5d188c..1c6ccc8 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 _0xd45c=['../../config/environment','redis','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','projectUpdate','error','exports','lodash','events','EventEmitter','ioredis','./error'];(function(_0x5631ee,_0x183e33){var _0x5701f6=function(_0x412254){while(--_0x412254){_0x5631ee['push'](_0x5631ee['shift']());}};_0x5701f6(++_0x183e33);}(_0xd45c,0xcb));var _0xcd45=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd45c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xcd45('0x0'));var EventEmitter=require(_0xcd45('0x1'))[_0xcd45('0x2')];var Redis=require(_0xcd45('0x3'));var AGIError=require(_0xcd45('0x4'));var config=require(_0xcd45('0x5'));config[_0xcd45('0x6')]=_['defaults'](config[_0xcd45('0x6')],{'host':_0xcd45('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xcd45('0x6')]);sub[_0xcd45('0x8')](_0xcd45('0x9'),function(_0x14f4aa){if(_0x14f4aa)return eventEmitter[_0xcd45('0xa')]('error',new AGIError(_0xcd45('0xb'),_0x14f4aa));});sub['on'](_0xcd45('0xc'),function(_0x4e1cf1,_0x310070){if(_0x4e1cf1!=='agi')return;try{var _0x518659=JSON['parse'](_0x310070);eventEmitter[_0xcd45('0xa')](_0xcd45('0xd'),_0x518659);}catch(_0x5703c2){eventEmitter[_0xcd45('0xa')](_0xcd45('0xe'),new AGIError(_0xcd45('0xb'),_0x5703c2));}});module[_0xcd45('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x1d43=['./error','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','events','ioredis'];(function(_0x261153,_0x174df0){var _0x5402f9=function(_0x5c7269){while(--_0x5c7269){_0x261153['push'](_0x261153['shift']());}};_0x5402f9(++_0x174df0);}(_0x1d43,0xd0));var _0x31d4=function(_0x229ef2,_0x3448d6){_0x229ef2=_0x229ef2-0x0;var _0x3630dc=_0x1d43[_0x229ef2];return _0x3630dc;};'use strict';var _=require('lodash');var EventEmitter=require(_0x31d4('0x0'))['EventEmitter'];var Redis=require(_0x31d4('0x1'));var AGIError=require(_0x31d4('0x2'));var config=require(_0x31d4('0x3'));config[_0x31d4('0x4')]=_[_0x31d4('0x5')](config['redis'],{'host':_0x31d4('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x31d4('0x4')]);sub[_0x31d4('0x7')](_0x31d4('0x8'),function(_0x15f004){if(_0x15f004)return eventEmitter[_0x31d4('0x9')]('error',new AGIError(_0x31d4('0xa'),_0x15f004));});sub['on'](_0x31d4('0xb'),function(_0x47e65a,_0x4ca488){if(_0x47e65a!==_0x31d4('0x8'))return;try{var _0x5ea243=JSON[_0x31d4('0xc')](_0x4ca488);eventEmitter[_0x31d4('0x9')](_0x31d4('0xd'),_0x5ea243);}catch(_0x53724c){eventEmitter[_0x31d4('0x9')]('error',new AGIError(_0x31d4('0xa'),_0x53724c));}});module[_0x31d4('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index b92db96..c2ad2f3 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 _0x8880=['edges','numberOfEdges','addVertex','prototype','addEdge','size','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','agicommand','target','default','invalid','traverseBFS','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices'];(function(_0x1af46c,_0x409a9f){var _0x191fd8=function(_0x2be4de){while(--_0x2be4de){_0x1af46c['push'](_0x1af46c['shift']());}};_0x191fd8(++_0x409a9f);}(_0x8880,0x72));var _0x0888=function(_0x2179f1,_0x21c653){_0x2179f1=_0x2179f1-0x0;var _0x176ec9=_0x8880[_0x2179f1];return _0x176ec9;};'use strict';var _=require(_0x0888('0x0'));var logger=require(_0x0888('0x1'))('agi');var verticesWithRetry=[_0x0888('0x2'),_0x0888('0x3'),_0x0888('0x4')];var Graph=function(){this[_0x0888('0x5')]={};this[_0x0888('0x6')]={};this[_0x0888('0x7')]=0x0;};Graph['prototype'][_0x0888('0x8')]=function(_0xa96d70){this[_0x0888('0x5')][_0xa96d70['id']]=_0xa96d70;this['edges'][_0xa96d70['id']]=[];};Graph[_0x0888('0x9')][_0x0888('0xa')]=function(_0x3c9e07,_0xcfcb78,_0x19679a){this[_0x0888('0x6')][_0x3c9e07]['push']({'target':_0xcfcb78,'condition':_0x19679a});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0x0888('0xb')](this[_0x0888('0x5')]);};Graph[_0x0888('0x9')]['relations']=function(){return this['numberOfEdges'];};Graph[_0x0888('0x9')][_0x0888('0xc')]=function(_0x70a64c){return this[_0x0888('0x5')][_0x70a64c];};Graph['prototype']['traverseBFS']=function(_0x111f24,_0x7d57e4){if(!this['vertices'][_0x111f24]){return logger[_0x0888('0xd')](_0x0888('0xe'));}var _0x434068=_0x7d57e4(this[_0x0888('0x5')][_0x111f24]);if(!_0x434068){return logger['info'](_0x0888('0xf'));}if(this['edges'][_0x111f24]['length']===0x0){return logger[_0x0888('0xd')]('no\x20edge/s\x20available');}for(var _0x123c52=0x0,_0x45a43c=[],_0x142ca9=![];_0x123c52\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','lodash','syncho','../../config/environment','../../config/logger','../../config/license/util','./project','agi','defaults','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables'];(function(_0x1da46b,_0x109ac4){var _0x3a94ef=function(_0x31a2b4){while(--_0x31a2b4){_0x1da46b['push'](_0x1da46b['shift']());}};_0x3a94ef(++_0x109ac4);}(_0x3c5d,0x179));var _0xd3c5=function(_0x2704b1,_0x40755c){_0x2704b1=_0x2704b1-0x0;var _0x143d08=_0x3c5d[_0x2704b1];return _0x143d08;};'use strict';var _=require(_0xd3c5('0x0'));var syncho=require(_0xd3c5('0x1'));var util=require('util');var config=require(_0xd3c5('0x2'));var logger=require(_0xd3c5('0x3'))('agi');var utilLicense=require(_0xd3c5('0x4'));var rpc=require('./rpc');var Project=require(_0xd3c5('0x5'));var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0xd3c5('0x6')]=_[_0xd3c5('0x7')](config[_0xd3c5('0x6')],{'ip':_0xd3c5('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x3652c6){process[_0xd3c5('0x9')](function(){syncho(function(){try{setChannelVariables(_0x3652c6);agiHandler(_0x3652c6);}catch(_0x2cdd5b){logger[_0xd3c5('0xa')](_0x2cdd5b[_0xd3c5('0xb')]);}});});}function projectUpdateHandler(_0x52fcb3){try{var _0x405d35=_[_0xd3c5('0xc')](projects,['id',_0x52fcb3['id']]);if(_0x405d35>-0x1){if(_0x52fcb3[_0xd3c5('0xd')]===!![]){projects[_0xd3c5('0xe')](_0x405d35,0x1);}else{projects[_0x405d35]=_0x52fcb3;}}else{projects[_0xd3c5('0xf')](_0x52fcb3);}}catch(_0x5bed47){logger[_0xd3c5('0xa')](_0x5bed47['stack']);}}function listeningHandler(){console['log'](_0xd3c5('0x10'),config[_0xd3c5('0x6')][_0xd3c5('0x11')]);logger[_0xd3c5('0x12')](util['format'](_0xd3c5('0x13'),config[_0xd3c5('0x6')]['ip'],config[_0xd3c5('0x6')]['port']));}function errorHandler(_0x156533){if(_0x156533&&_0x156533[_0xd3c5('0x14')]&&_0x156533[_0xd3c5('0x15')]){logger[_0xd3c5('0xa')](util[_0xd3c5('0x16')](_0xd3c5('0x17'),_0x156533[_0xd3c5('0x14')],_0x156533['message']));}else{logger['error'](util['format'](_0xd3c5('0x18'),_0x156533[_0xd3c5('0xb')]));}}function closeHandler(){logger['info'](util[_0xd3c5('0x16')](_0xd3c5('0x19'),this[_0xd3c5('0x1a')],this[_0xd3c5('0x1b')],this[_0xd3c5('0x1c')],this['dnid'],this[_0xd3c5('0x1d')]));try{createSquareReport(this);}catch(_0x4e3dbe){logger[_0xd3c5('0xa')](_0x4e3dbe['stack']);}}function timeoutHandler(){logger[_0xd3c5('0x12')](util[_0xd3c5('0x16')](_0xd3c5('0x1e'),this[_0xd3c5('0x1a')],this[_0xd3c5('0x1b')],this[_0xd3c5('0x1c')],this[_0xd3c5('0x1f')],this[_0xd3c5('0x1d')]));}function hangupHandler(){logger[_0xd3c5('0x12')](util['format'](_0xd3c5('0x20'),this['arg_1'],this['calleridname'],this[_0xd3c5('0x1c')],this[_0xd3c5('0x1f')],this[_0xd3c5('0x1d')]));this[_0xd3c5('0x21')]=!![];}function createSquareReport(_0x5c5ea9,_0x4b55e2){rpc[_0xd3c5('0x22')](_0x5c5ea9)[_0xd3c5('0x23')](function(_0x3db867){if(_0x4b55e2){_0x4b55e2(null,_0x3db867);}})[_0xd3c5('0x24')](function(_0xab2e88){if(_0x4b55e2){_0x4b55e2(null,_0xab2e88);}});}function setChannelVariables(_0x4ea64c){for(var _0x12276f in _0x4ea64c){if(_0x4ea64c[_0xd3c5('0x25')](_0x12276f)){if(_0x12276f[_0xd3c5('0x26')](_0xd3c5('0x27'))===0x0){_0x4ea64c[_0x12276f[_0xd3c5('0x28')](0x4)]=_0x4ea64c[_0x12276f];delete _0x4ea64c[_0x12276f];}}}}function agiHandler(_0x58124b){logger[_0xd3c5('0x29')](_0xd3c5('0x2a'),JSON[_0xd3c5('0x2b')](_0x58124b,null,0x2));logger[_0xd3c5('0x12')](util[_0xd3c5('0x16')](_0xd3c5('0x2c'),_0x58124b[_0xd3c5('0x1a')],_0x58124b['calleridname'],_0x58124b[_0xd3c5('0x1c')],_0x58124b[_0xd3c5('0x1f')],_0x58124b['uniqueid']));_0x58124b['on'](_0xd3c5('0xa'),errorHandler);_0x58124b['on'](_0xd3c5('0x2d'),closeHandler);_0x58124b['on']('timeout',timeoutHandler);_0x58124b[_0xd3c5('0x21')]=![];_0x58124b['on'](_0xd3c5('0x2e'),hangupHandler);var _0x31f7ff=_[_0xd3c5('0x2f')](projects,['name',_0x58124b['arg_1']]);if(!_0x31f7ff)return Project[_0xd3c5('0x30')](_0x58124b);if(!_0x31f7ff['production'])return Project[_0xd3c5('0x31')](_0x58124b);return Project[_0xd3c5('0x32')](_0x31f7ff,_0x58124b);}function main(){var _0x258f6c;return utilLicense[_0xd3c5('0x33')]()[_0xd3c5('0x23')](function(_0x3b8190){if(!_0x3b8190)return;if(_0x3b8190['voice']){if(_0x3b8190[_0xd3c5('0x34')]&&_0x3b8190[_0xd3c5('0x34')]>0x0){logger['info'](util[_0xd3c5('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x3b8190['callysquare']));_0x258f6c=_0x3b8190[_0xd3c5('0x34')];}else{logger['info'](_0xd3c5('0x35'));}}else{logger[_0xd3c5('0x12')](_0xd3c5('0x36'));_0x258f6c=-0x1;}})['then'](function(){return Project[_0xd3c5('0x37')]();})[_0xd3c5('0x23')](function(_0x5d6397){projects=_0x5d6397;return;})[_0xd3c5('0x24')](function(_0x1f7872){logger['error'](_0xd3c5('0x38'),_0x1f7872['stack']);})[_0xd3c5('0x39')](function(){var _0x29693d=require('./server')(config[_0xd3c5('0x6')][_0xd3c5('0x11')],config[_0xd3c5('0x6')]['ip'],_0x258f6c);_0x29693d['on'](_0xd3c5('0xa'),errorHandler);_0x29693d['on'](_0xd3c5('0x3a'),listeningHandler);_0x29693d['on'](_0xd3c5('0x3b'),connectionHandler);_0x29693d['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x943d=['getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','./events','projectUpdate','nextTick','error','stack','findIndex','deleted','push','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','close','timeout','hangup','find','production','handleUnpublished'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x943d,0xb4));var _0xd943=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x943d[_0x13187a];return _0x65b85f;};'use strict';var _=require(_0xd943('0x0'));var syncho=require(_0xd943('0x1'));var util=require(_0xd943('0x2'));var config=require(_0xd943('0x3'));var logger=require(_0xd943('0x4'))(_0xd943('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0xd943('0x6'));var Project=require(_0xd943('0x7'));var AGIEmitter=require(_0xd943('0x8'))['EventEmitter'];var projects=[];config[_0xd943('0x5')]=_['defaults'](config[_0xd943('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0xd943('0x9'),projectUpdateHandler);function connectionHandler(_0x5494b3){process[_0xd943('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5494b3);agiHandler(_0x5494b3);}catch(_0x512c6a){logger[_0xd943('0xb')](_0x512c6a[_0xd943('0xc')]);}});});}function projectUpdateHandler(_0x4278b8){try{var _0x1d44d5=_[_0xd943('0xd')](projects,['id',_0x4278b8['id']]);if(_0x1d44d5>-0x1){if(_0x4278b8[_0xd943('0xe')]===!![]){projects['splice'](_0x1d44d5,0x1);}else{projects[_0x1d44d5]=_0x4278b8;}}else{projects[_0xd943('0xf')](_0x4278b8);}}catch(_0x227015){logger[_0xd943('0xb')](_0x227015[_0xd943('0xc')]);}}function listeningHandler(){console[_0xd943('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xd943('0x5')]['port']);logger[_0xd943('0x11')](util[_0xd943('0x12')](_0xd943('0x13'),config[_0xd943('0x5')]['ip'],config[_0xd943('0x5')][_0xd943('0x14')]));}function errorHandler(_0x4a5b11){if(_0x4a5b11&&_0x4a5b11[_0xd943('0x15')]&&_0x4a5b11[_0xd943('0x16')]){logger[_0xd943('0xb')](util['format'](_0xd943('0x17'),_0x4a5b11['name'],_0x4a5b11[_0xd943('0x16')]));}else{logger[_0xd943('0xb')](util[_0xd943('0x12')](_0xd943('0x18'),_0x4a5b11[_0xd943('0xc')]));}}function closeHandler(){logger[_0xd943('0x11')](util['format'](_0xd943('0x19'),this['arg_1'],this[_0xd943('0x1a')],this['callerid'],this[_0xd943('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2eb88c){logger[_0xd943('0xb')](_0x2eb88c[_0xd943('0xc')]);}}function timeoutHandler(){logger[_0xd943('0x11')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0xd943('0x1c')],this[_0xd943('0x1b')],this[_0xd943('0x1d')]));}function hangupHandler(){logger['info'](util[_0xd943('0x12')](_0xd943('0x1e'),this['arg_1'],this[_0xd943('0x1a')],this['callerid'],this['dnid'],this['uniqueid']));this[_0xd943('0x1f')]=!![];}function createSquareReport(_0x346c48,_0x46d300){rpc['createSquareReport'](_0x346c48)[_0xd943('0x20')](function(_0x248a46){if(_0x46d300){_0x46d300(null,_0x248a46);}})[_0xd943('0x21')](function(_0x487a57){if(_0x46d300){_0x46d300(null,_0x487a57);}});}function setChannelVariables(_0x5ecadc){for(var _0x122795 in _0x5ecadc){if(_0x5ecadc[_0xd943('0x22')](_0x122795)){if(_0x122795[_0xd943('0x23')](_0xd943('0x24'))===0x0){_0x5ecadc[_0x122795[_0xd943('0x25')](0x4)]=_0x5ecadc[_0x122795];delete _0x5ecadc[_0x122795];}}}}function agiHandler(_0x2ed868){logger[_0xd943('0x26')]('variables',JSON[_0xd943('0x27')](_0x2ed868,null,0x2));logger[_0xd943('0x11')](util['format'](_0xd943('0x28'),_0x2ed868[_0xd943('0x29')],_0x2ed868['calleridname'],_0x2ed868[_0xd943('0x1c')],_0x2ed868[_0xd943('0x1b')],_0x2ed868[_0xd943('0x1d')]));_0x2ed868['on'](_0xd943('0xb'),errorHandler);_0x2ed868['on'](_0xd943('0x2a'),closeHandler);_0x2ed868['on'](_0xd943('0x2b'),timeoutHandler);_0x2ed868[_0xd943('0x1f')]=![];_0x2ed868['on'](_0xd943('0x2c'),hangupHandler);var _0x1de033=_[_0xd943('0x2d')](projects,['name',_0x2ed868[_0xd943('0x29')]]);if(!_0x1de033)return Project['handleNotFound'](_0x2ed868);if(!_0x1de033[_0xd943('0x2e')])return Project[_0xd943('0x2f')](_0x2ed868);return Project['initialize'](_0x1de033,_0x2ed868);}function main(){var _0x5b17fb;return utilLicense[_0xd943('0x30')]()[_0xd943('0x20')](function(_0x5c3056){if(!_0x5c3056)return;if(_0x5c3056[_0xd943('0x31')]){if(_0x5c3056[_0xd943('0x32')]&&_0x5c3056[_0xd943('0x32')]>0x0){logger[_0xd943('0x11')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x5c3056['callysquare']));_0x5b17fb=_0x5c3056['callysquare'];}else{logger[_0xd943('0x11')](_0xd943('0x33'));}}else{logger[_0xd943('0x11')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x5b17fb=-0x1;}})[_0xd943('0x20')](function(){return Project['getAll']();})[_0xd943('0x20')](function(_0x306d71){projects=_0x306d71;return;})[_0xd943('0x21')](function(_0x3e9d9a){logger['error'](_0xd943('0x34'),_0x3e9d9a[_0xd943('0xc')]);})[_0xd943('0x35')](function(){var _0x4dc4e8=require(_0xd943('0x36'))(config[_0xd943('0x5')][_0xd943('0x14')],config['agi']['ip'],_0x5b17fb);_0x4dc4e8['on']('error',errorHandler);_0x4dc4e8['on'](_0xd943('0x37'),listeningHandler);_0x4dc4e8['on'](_0xd943('0x38'),connectionHandler);_0x4dc4e8['on'](_0xd943('0x2a'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 19e2082..9926391 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 _0x9895=['then','error','message','result','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0x1a3a5d,_0x5db8f9){var _0x1c8fe5=function(_0x43f3d5){while(--_0x43f3d5){_0x1a3a5d['push'](_0x1a3a5d['shift']());}};_0x1c8fe5(++_0x5db8f9);}(_0x9895,0x15a));var _0x5989=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9895[_0xfae23b];return _0x200640;};'use strict';var BPromise=require(_0x5989('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x5989('0x1')][_0x5989('0x2')]({'port':0x232b});function request(_0x261519,_0x138f37){return new BPromise(function(_0x3528bb,_0x538ec4){return client[_0x5989('0x3')](_0x261519,_0x138f37)[_0x5989('0x4')](function(_0xeae5a4){if(_0xeae5a4[_0x5989('0x5')]){return _0x538ec4(_0xeae5a4[_0x5989('0x5')][_0x5989('0x6')]);}else{return _0x3528bb(_0xeae5a4[_0x5989('0x7')]);}})['catch'](function(_0x1c04cc){return _0x538ec4(_0x1c04cc);});});}exports[_0x5989('0x8')]=function(_0x56e289,_0x16a72e){return request(_0x5989('0x9'),{'account':_0x56e289,'message':_0x16a72e});}; \ No newline at end of file +var _0x9b24=['request','then','error','result','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x6fc28e,_0x230bfe){var _0x4901f4=function(_0x3864e7){while(--_0x3864e7){_0x6fc28e['push'](_0x6fc28e['shift']());}};_0x4901f4(++_0x230bfe);}(_0x9b24,0xc3));var _0x49b2=function(_0x34322d,_0x15e744){_0x34322d=_0x34322d-0x0;var _0x25275f=_0x9b24[_0x34322d];return _0x25275f;};'use strict';var BPromise=require(_0x49b2('0x0'));var jayson=require(_0x49b2('0x1'));var client=jayson[_0x49b2('0x2')]['http']({'port':0x232b});function request(_0x1050a5,_0x507258){return new BPromise(function(_0x2c939e,_0x58ee2f){return client[_0x49b2('0x3')](_0x1050a5,_0x507258)[_0x49b2('0x4')](function(_0x1a9e62){if(_0x1a9e62[_0x49b2('0x5')]){return _0x58ee2f(_0x1a9e62[_0x49b2('0x5')]['message']);}else{return _0x2c939e(_0x1a9e62[_0x49b2('0x6')]);}})['catch'](function(_0x45903a){return _0x58ee2f(_0x45903a);});});}exports[_0x49b2('0x7')]=function(_0x216b53,_0x959889){return request(_0x49b2('0x8'),{'account':_0x216b53,'message':_0x959889});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 1e8bbac..891dd23 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 _0x7b5a=['clear','isUndefined','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','close','moment','xml2json','../../config/logger','agi','./rpc','./vertices','catch','stack','hasOwnProperty','maxRetry','retry','mxCell','isArray','length','source','target','addEdge','value','mxGraphModel','root','inspect','production','start','debug','stringify','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','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','error','finally'];(function(_0x5d097f,_0x2c5421){var _0x455378=function(_0x517998){while(--_0x517998){_0x5d097f['push'](_0x5d097f['shift']());}};_0x455378(++_0x2c5421);}(_0x7b5a,0xe9));var _0xa7b5=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x7b5a[_0x1bb58c];return _0x277586;};'use strict';var _=require('lodash');var moment=require(_0xa7b5('0x0'));var parser=require(_0xa7b5('0x1'));var util=require('util');var logger=require(_0xa7b5('0x2'))(_0xa7b5('0x3'));var rpc=require(_0xa7b5('0x4'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0xa7b5('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0xa7b5('0x6')](function(_0x3cd0b9){logger['error']('Unable\x20to\x20download\x20CallySquare\x20projects',_0x3cd0b9[_0xa7b5('0x7')]);return[];});}function addVertex(_0x857ba3,_0x447608,_0x3a3e6e){_0x447608['agicommand']=_0x3a3e6e;if(_0x447608[_0xa7b5('0x8')]('retry')){_0x447608[_0xa7b5('0x9')]=parseInt(_0x447608[_0xa7b5('0xa')],0xa);}_0x857ba3['addVertex'](_['omit'](_0x447608,_0xa7b5('0xb')));}function initGraph(_0x594e5f,_0x1892fb){var _0x16a8fe=new Graph();for(var _0x3cce05 in _0x594e5f){if(_0x594e5f[_0xa7b5('0x8')](_0x3cce05)){if(_[_0xa7b5('0xc')](_0x594e5f[_0x3cce05])){for(var _0x3c7917=0x0;_0x3c7917<_0x594e5f[_0x3cce05][_0xa7b5('0xd')];_0x3c7917+=0x1){addVertex(_0x16a8fe,_0x594e5f[_0x3cce05][_0x3c7917],_0x3cce05);}}else{addVertex(_0x16a8fe,_0x594e5f[_0x3cce05],_0x3cce05);}}}for(var _0x4dcf6a=0x0;_0x4dcf6a<_0x1892fb[_0xa7b5('0xd')];_0x4dcf6a+=0x1){if(_0x1892fb[_0x4dcf6a][_0xa7b5('0xe')]&&_0x1892fb[_0x4dcf6a][_0xa7b5('0xf')]){_0x16a8fe[_0xa7b5('0x10')](_0x1892fb[_0x4dcf6a]['source'],_0x1892fb[_0x4dcf6a][_0xa7b5('0xf')],_0x1892fb[_0x4dcf6a][_0xa7b5('0x11')]);}}return _0x16a8fe;}function getRoot(_0x569aeb){return parser['toJson'](_0x569aeb,{'object':!![]})[_0xa7b5('0x12')][_0xa7b5('0x13')];}function inspect(_0x288b6a){return util[_0xa7b5('0x14')](_0x288b6a,{'showHidden':![],'depth':null});}function initialize(_0x4b3ea3,_0x76264f){var _0x4555d5=getRoot(_0x4b3ea3[_0xa7b5('0x15')]);if(!_0x4555d5||!_0x4555d5[_0xa7b5('0x16')])return;var _0x442c24,_0x2cf3e2,_0x3929f8;logger[_0xa7b5('0x17')](_0xa7b5('0x13'),JSON[_0xa7b5('0x18')](_0x4555d5,null,0x2));_0x76264f['joinAt']=moment()[_0xa7b5('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0x442c24=initGraph(_['omit'](_0x4555d5,_0xa7b5('0xb')),_0x4555d5['mxCell']);_0x2cf3e2=new Vertices(_0x76264f,rpc,mailRpc);logger[_0xa7b5('0x1a')](util['format'](_0xa7b5('0x1b'),_0x76264f[_0xa7b5('0x1c')],_0x76264f[_0xa7b5('0x1d')],_0x76264f[_0xa7b5('0x1e')],_0x76264f[_0xa7b5('0x1f')],_0x76264f[_0xa7b5('0x20')]));_0x442c24[_0xa7b5('0x21')](_0x4555d5[_0xa7b5('0x16')]['id'],function(_0xce3477){try{_0xce3477=_0x2cf3e2['clear'](_0xce3477);logger[_0xa7b5('0x17')](_0xa7b5('0x22'),JSON[_0xa7b5('0x18')](_0xce3477,null,0x2));if(_0xce3477[_0xa7b5('0x23')]===_0xa7b5('0x24')){logger[_0xa7b5('0x1a')](_0xa7b5('0x25'));_0x76264f['context']=_0xce3477[_0xa7b5('0x26')]||_0x76264f[_0xa7b5('0x26')];_0x76264f[_0xa7b5('0x27')]=_0xce3477[_0xa7b5('0x27')];_0x76264f[_0xa7b5('0x28')]=_0xce3477[_0xa7b5('0x28')]?_0xce3477[_0xa7b5('0x28')]-0x1:0x1;return null;}else if(_0xce3477&&_0x2cf3e2[_0xce3477[_0xa7b5('0x23')]]){_0x3929f8=_0x2cf3e2[_0xce3477['agicommand']](_0xce3477);logger[_0xa7b5('0x1a')](_0xa7b5('0x29'),JSON[_0xa7b5('0x18')](_0x3929f8,null,0x2));if(_0x3929f8&&_0x3929f8[_0xa7b5('0x2a')]===AGI_CODE_SUCCESS&&_0x3929f8['result']!==AGI_RESULT_ERROR&&!_0x76264f['evtHangup']){logger['debug'](_0xa7b5('0x29'),inspect(_0x3929f8));return _['isUndefined'](_0x3929f8[_0xa7b5('0x2b')])?null:_0x3929f8[_0xa7b5('0x2b')][_0xa7b5('0x2c')]();}else{logger[_0xa7b5('0x2d')](_0xa7b5('0x29'),inspect(_0x3929f8));return null;}}else{logger[_0xa7b5('0x2d')]('agicommand\x20not\x20found');return null;}}catch(_0x31ce4c){logger[_0xa7b5('0x2d')](_0x31ce4c[_0xa7b5('0x7')]);return null;}});if(_0x4555d5[_0xa7b5('0x2e')]){logger[_0xa7b5('0x1a')](util[_0xa7b5('0x19')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x76264f[_0xa7b5('0x1c')],_0x76264f[_0xa7b5('0x1d')],_0x76264f[_0xa7b5('0x1e')],_0x76264f[_0xa7b5('0x1f')],_0x76264f['uniqueid']));_0x442c24['traverseBFS'](_0x4555d5[_0xa7b5('0x2e')]['id'],function(_0x5ed51f){try{_0x5ed51f=_0x2cf3e2[_0xa7b5('0x2f')](_0x5ed51f);logger[_0xa7b5('0x17')]('vertex',JSON[_0xa7b5('0x18')](_0x5ed51f,null,0x2));if(_0x5ed51f&&_0x2cf3e2[_0x5ed51f[_0xa7b5('0x23')]]){_0x3929f8=_0x2cf3e2[_0x5ed51f['agicommand']](_0x5ed51f);if(_0x3929f8){logger['debug'](_0xa7b5('0x29'),inspect(_0x3929f8));return _[_0xa7b5('0x30')](_0x3929f8[_0xa7b5('0x2b')])?null:_0x3929f8[_0xa7b5('0x2b')][_0xa7b5('0x2c')]();}else{logger[_0xa7b5('0x2d')]('response',inspect(_0x3929f8));return null;}}else{logger[_0xa7b5('0x2d')](_0xa7b5('0x31'));return null;}}catch(_0x891ef1){logger['error'](_0x891ef1[_0xa7b5('0x7')]);return null;}});}logger['info'](util[_0xa7b5('0x19')](_0xa7b5('0x32'),_0x76264f[_0xa7b5('0x1c')],_0x76264f[_0xa7b5('0x1d')],_0x76264f[_0xa7b5('0x1e')],_0x76264f[_0xa7b5('0x1f')],_0x76264f[_0xa7b5('0x20')]));logger['info'](util['format'](_0xa7b5('0x33'),_0x76264f[_0xa7b5('0x26')],_0x76264f['extension'],parseInt(_0x76264f[_0xa7b5('0x28')],0xa)+0x1));_0x76264f[_0xa7b5('0x34')](_0x76264f[_0xa7b5('0x26')],_0x76264f[_0xa7b5('0x27')],parseInt(_0x76264f[_0xa7b5('0x28')],0xa)+0x1);_0x76264f['close']();}function handleNotFound(_0x192ccd){logger[_0xa7b5('0x2d')](util['format'](_0xa7b5('0x35'),_0x192ccd[_0xa7b5('0x1c')]));_0x192ccd[_0xa7b5('0x34')](_0x192ccd[_0xa7b5('0x26')],_0x192ccd['extension'],parseInt(_0x192ccd['priority'],0xa)+0x1);_0x192ccd['close']();}function handleUnpublished(_0x2178f1){logger[_0xa7b5('0x2d')](util[_0xa7b5('0x19')](_0xa7b5('0x36'),_0x2178f1['arg_1']));_0x2178f1['continueAt'](_0x2178f1[_0xa7b5('0x26')],_0x2178f1[_0xa7b5('0x27')],parseInt(_0x2178f1['priority'],0xa)+0x1);_0x2178f1[_0xa7b5('0x37')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xf0d8=['priority','response','result','evtHangup','toString','agicommand\x20not\x20found','stack','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','clear','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','agi','./mailRpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','isArray','length','target','source','value','mxGraphModel','root','inspect','production','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','start','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension'];(function(_0x288055,_0x3125a5){var _0x491f0a=function(_0x312009){while(--_0x312009){_0x288055['push'](_0x288055['shift']());}};_0x491f0a(++_0x3125a5);}(_0xf0d8,0x8a));var _0x8f0d=function(_0x2945df,_0x35a145){_0x2945df=_0x2945df-0x0;var _0x2f0be5=_0xf0d8[_0x2945df];return _0x2f0be5;};'use strict';var _=require(_0x8f0d('0x0'));var moment=require('moment');var parser=require(_0x8f0d('0x1'));var util=require(_0x8f0d('0x2'));var logger=require('../../config/logger')(_0x8f0d('0x3'));var rpc=require('./rpc');var mailRpc=require(_0x8f0d('0x4'));var Graph=require(_0x8f0d('0x5'));var Vertices=require(_0x8f0d('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x8f0d('0x7')]()['catch'](function(_0x13e489){logger[_0x8f0d('0x8')](_0x8f0d('0x9'),_0x13e489['stack']);return[];});}function addVertex(_0x4fc762,_0x4f8973,_0x36c3ac){_0x4f8973[_0x8f0d('0xa')]=_0x36c3ac;if(_0x4f8973[_0x8f0d('0xb')]('retry')){_0x4f8973[_0x8f0d('0xc')]=parseInt(_0x4f8973[_0x8f0d('0xd')],0xa);}_0x4fc762[_0x8f0d('0xe')](_[_0x8f0d('0xf')](_0x4f8973,'mxCell'));}function initGraph(_0x59a71e,_0x26c302){var _0x10cbe1=new Graph();for(var _0x58c792 in _0x59a71e){if(_0x59a71e['hasOwnProperty'](_0x58c792)){if(_[_0x8f0d('0x10')](_0x59a71e[_0x58c792])){for(var _0x2786ad=0x0;_0x2786ad<_0x59a71e[_0x58c792][_0x8f0d('0x11')];_0x2786ad+=0x1){addVertex(_0x10cbe1,_0x59a71e[_0x58c792][_0x2786ad],_0x58c792);}}else{addVertex(_0x10cbe1,_0x59a71e[_0x58c792],_0x58c792);}}}for(var _0x4da943=0x0;_0x4da943<_0x26c302['length'];_0x4da943+=0x1){if(_0x26c302[_0x4da943]['source']&&_0x26c302[_0x4da943][_0x8f0d('0x12')]){_0x10cbe1['addEdge'](_0x26c302[_0x4da943][_0x8f0d('0x13')],_0x26c302[_0x4da943][_0x8f0d('0x12')],_0x26c302[_0x4da943][_0x8f0d('0x14')]);}}return _0x10cbe1;}function getRoot(_0x1c12a5){return parser['toJson'](_0x1c12a5,{'object':!![]})[_0x8f0d('0x15')][_0x8f0d('0x16')];}function inspect(_0x5ce033){return util[_0x8f0d('0x17')](_0x5ce033,{'showHidden':![],'depth':null});}function initialize(_0x266c24,_0x1586b3){var _0x193d07=getRoot(_0x266c24[_0x8f0d('0x18')]);if(!_0x193d07||!_0x193d07['start'])return;var _0x4d6e61,_0x6303b4,_0x51b1a9;logger[_0x8f0d('0x19')](_0x8f0d('0x16'),JSON[_0x8f0d('0x1a')](_0x193d07,null,0x2));_0x1586b3['joinAt']=moment()[_0x8f0d('0x1b')](_0x8f0d('0x1c'));_0x4d6e61=initGraph(_[_0x8f0d('0xf')](_0x193d07,'mxCell'),_0x193d07['mxCell']);_0x6303b4=new Vertices(_0x1586b3,rpc,mailRpc);logger[_0x8f0d('0x1d')](util[_0x8f0d('0x1b')](_0x8f0d('0x1e'),_0x1586b3[_0x8f0d('0x1f')],_0x1586b3[_0x8f0d('0x20')],_0x1586b3[_0x8f0d('0x21')],_0x1586b3['dnid'],_0x1586b3[_0x8f0d('0x22')]));_0x4d6e61[_0x8f0d('0x23')](_0x193d07[_0x8f0d('0x24')]['id'],function(_0x18e1ad){try{_0x18e1ad=_0x6303b4['clear'](_0x18e1ad);logger['debug'](_0x8f0d('0x25'),JSON[_0x8f0d('0x1a')](_0x18e1ad,null,0x2));if(_0x18e1ad[_0x8f0d('0xa')]===_0x8f0d('0x26')){logger[_0x8f0d('0x1d')](_0x8f0d('0x27'));_0x1586b3[_0x8f0d('0x28')]=_0x18e1ad['context']||_0x1586b3[_0x8f0d('0x28')];_0x1586b3[_0x8f0d('0x29')]=_0x18e1ad['extension'];_0x1586b3['priority']=_0x18e1ad[_0x8f0d('0x2a')]?_0x18e1ad[_0x8f0d('0x2a')]-0x1:0x1;return null;}else if(_0x18e1ad&&_0x6303b4[_0x18e1ad[_0x8f0d('0xa')]]){_0x51b1a9=_0x6303b4[_0x18e1ad['agicommand']](_0x18e1ad);logger[_0x8f0d('0x1d')](_0x8f0d('0x2b'),JSON[_0x8f0d('0x1a')](_0x51b1a9,null,0x2));if(_0x51b1a9&&_0x51b1a9['code']===AGI_CODE_SUCCESS&&_0x51b1a9[_0x8f0d('0x2c')]!==AGI_RESULT_ERROR&&!_0x1586b3[_0x8f0d('0x2d')]){logger[_0x8f0d('0x19')](_0x8f0d('0x2b'),inspect(_0x51b1a9));return _['isUndefined'](_0x51b1a9[_0x8f0d('0x2c')])?null:_0x51b1a9['result'][_0x8f0d('0x2e')]();}else{logger[_0x8f0d('0x8')]('response',inspect(_0x51b1a9));return null;}}else{logger[_0x8f0d('0x8')](_0x8f0d('0x2f'));return null;}}catch(_0x35d232){logger[_0x8f0d('0x8')](_0x35d232[_0x8f0d('0x30')]);return null;}});if(_0x193d07[_0x8f0d('0x31')]){logger[_0x8f0d('0x1d')](util[_0x8f0d('0x1b')](_0x8f0d('0x32'),_0x1586b3['arg_1'],_0x1586b3[_0x8f0d('0x20')],_0x1586b3['callerid'],_0x1586b3[_0x8f0d('0x33')],_0x1586b3[_0x8f0d('0x22')]));_0x4d6e61['traverseBFS'](_0x193d07[_0x8f0d('0x31')]['id'],function(_0x456224){try{_0x456224=_0x6303b4[_0x8f0d('0x34')](_0x456224);logger[_0x8f0d('0x19')](_0x8f0d('0x25'),JSON['stringify'](_0x456224,null,0x2));if(_0x456224&&_0x6303b4[_0x456224[_0x8f0d('0xa')]]){_0x51b1a9=_0x6303b4[_0x456224[_0x8f0d('0xa')]](_0x456224);if(_0x51b1a9){logger['debug'](_0x8f0d('0x2b'),inspect(_0x51b1a9));return _[_0x8f0d('0x35')](_0x51b1a9[_0x8f0d('0x2c')])?null:_0x51b1a9[_0x8f0d('0x2c')][_0x8f0d('0x2e')]();}else{logger[_0x8f0d('0x8')](_0x8f0d('0x2b'),inspect(_0x51b1a9));return null;}}else{logger['error'](_0x8f0d('0x2f'));return null;}}catch(_0x5a4535){logger[_0x8f0d('0x8')](_0x5a4535[_0x8f0d('0x30')]);return null;}});}logger['info'](util[_0x8f0d('0x1b')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1586b3['arg_1'],_0x1586b3['calleridname'],_0x1586b3[_0x8f0d('0x21')],_0x1586b3['dnid'],_0x1586b3[_0x8f0d('0x22')]));logger['info'](util[_0x8f0d('0x1b')](_0x8f0d('0x36'),_0x1586b3[_0x8f0d('0x28')],_0x1586b3[_0x8f0d('0x29')],parseInt(_0x1586b3['priority'],0xa)+0x1));_0x1586b3[_0x8f0d('0x37')](_0x1586b3[_0x8f0d('0x28')],_0x1586b3[_0x8f0d('0x29')],parseInt(_0x1586b3[_0x8f0d('0x2a')],0xa)+0x1);_0x1586b3[_0x8f0d('0x38')]();}function handleNotFound(_0x3828d7){logger[_0x8f0d('0x8')](util[_0x8f0d('0x1b')](_0x8f0d('0x39'),_0x3828d7[_0x8f0d('0x1f')]));_0x3828d7[_0x8f0d('0x37')](_0x3828d7[_0x8f0d('0x28')],_0x3828d7['extension'],parseInt(_0x3828d7['priority'],0xa)+0x1);_0x3828d7[_0x8f0d('0x38')]();}function handleUnpublished(_0x4059ea){logger[_0x8f0d('0x8')](util[_0x8f0d('0x1b')](_0x8f0d('0x3a'),_0x4059ea[_0x8f0d('0x1f')]));_0x4059ea[_0x8f0d('0x37')](_0x4059ea[_0x8f0d('0x28')],_0x4059ea[_0x8f0d('0x29')],parseInt(_0x4059ea[_0x8f0d('0x2a')],0xa)+0x1);_0x4059ea[_0x8f0d('0x38')]();}module[_0x8f0d('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index f33a3c7..8e132e4 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 _0x1c81=['_localBuffer','toString','_inBody','indexOf','substring','split','slice','trim','emit','length','exports','util','call','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x160373,_0x56264e){var _0x37bea8=function(_0x339016){while(--_0x339016){_0x160373['push'](_0x160373['shift']());}};_0x37bea8(++_0x56264e);}(_0x1c81,0x8b));var _0x11c8=function(_0x3fa1ee,_0x1744ca){_0x3fa1ee=_0x3fa1ee-0x0;var _0x24996d=_0x1c81[_0x3fa1ee];return _0x24996d;};'use strict';var util=require(_0x11c8('0x0'));var Transform=require('stream')['Transform'];function AGIReply(_0x3f6ff5){Transform[_0x11c8('0x1')](this,_0x3f6ff5);this['_localBuffer']='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x11c8('0x2')][_0x11c8('0x3')]=function(_0x4da349,_0x34d2b2,_0x318930){var _0xa530f3='\x0a',_0xb42d50=['\x0a\x0a',_0x11c8('0x4')],_0x396d8e=-0x1,_0x118b5d=-0x1,_0x4504b7='',_0x116f13=0x0,_0x2621f4='',_0x17138e='';this[_0x11c8('0x5')]+=_0x4da349[_0x11c8('0x6')]();_0x2621f4=this[_0x11c8('0x5')];if(!this[_0x11c8('0x7')]){_0x116f13=0x0;while(_0xb42d50[_0x116f13]){while((_0x118b5d=_0x2621f4[_0x11c8('0x8')](_0xb42d50[_0x116f13]))!=-0x1){_0x4504b7=_0xb42d50[_0x116f13];_0x17138e=_0x2621f4[_0x11c8('0x9')](0x0,_0x118b5d);_0x2621f4=_0x2621f4[_0x11c8('0x9')](_0x118b5d+_0x4504b7['length']);var _0x5d1155=_0x17138e[_0x11c8('0xa')](_0xa530f3),_0x16c011=0x0,_0x3a90ec={},_0x4710f3='',_0x9fe0d6='',_0xc2b528=-0x1;while(_0x5d1155[_0x16c011]){_0xc2b528=_0x5d1155[_0x16c011][_0x11c8('0x8')](':');if(_0xc2b528!=-0x1){_0x4710f3=_0x5d1155[_0x16c011][_0x11c8('0xb')](0x0,_0xc2b528)['trim']();_0x9fe0d6=_0x5d1155[_0x16c011][_0x11c8('0xb')](_0xc2b528+0x1)[_0x11c8('0xc')]();if(_0x4710f3['length']>0x0){_0x3a90ec[_0x4710f3]=_0x9fe0d6;}}else{}_0x16c011++;}this[_0x11c8('0xd')]('headers',_0x3a90ec);this[_0x11c8('0x7')]=!![];}_0x116f13++;}this[_0x11c8('0x5')]=_0x2621f4;}else{while((_0x396d8e=_0x2621f4[_0x11c8('0x8')](_0xa530f3))!=-0x1){_0x17138e=_0x2621f4[_0x11c8('0x9')](0x0,_0x396d8e);this['emit']('line',_0x17138e);_0x2621f4=_0x2621f4[_0x11c8('0x9')](_0x396d8e+_0xa530f3[_0x11c8('0xe')]);}this[_0x11c8('0x5')]=_0x2621f4;}_0x318930();};module[_0x11c8('0xf')]=AGIReply; \ No newline at end of file +var _0x841e=['indexOf','substring','length','split','slice','trim','emit','line','exports','util','Transform','call','_localBuffer','_inBody','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x40d5de,_0x30a489){var _0x445071=function(_0x5d7fc0){while(--_0x5d7fc0){_0x40d5de['push'](_0x40d5de['shift']());}};_0x445071(++_0x30a489);}(_0x841e,0x1c3));var _0xe841=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x841e[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0xe841('0x0'));var Transform=require('stream')[_0xe841('0x1')];function AGIReply(_0x1508b0){Transform[_0xe841('0x2')](this,_0x1508b0);this[_0xe841('0x3')]='';this[_0xe841('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply['prototype'][_0xe841('0x5')]=function(_0x52b4df,_0x4ced57,_0x553c91){var _0x250231='\x0a',_0xe4af9=['\x0a\x0a',_0xe841('0x6')],_0x1a2141=-0x1,_0x286a7c=-0x1,_0x1c0904='',_0x5aecce=0x0,_0x381eef='',_0x2070a6='';this['_localBuffer']+=_0x52b4df[_0xe841('0x7')]();_0x381eef=this[_0xe841('0x3')];if(!this[_0xe841('0x4')]){_0x5aecce=0x0;while(_0xe4af9[_0x5aecce]){while((_0x286a7c=_0x381eef[_0xe841('0x8')](_0xe4af9[_0x5aecce]))!=-0x1){_0x1c0904=_0xe4af9[_0x5aecce];_0x2070a6=_0x381eef[_0xe841('0x9')](0x0,_0x286a7c);_0x381eef=_0x381eef[_0xe841('0x9')](_0x286a7c+_0x1c0904[_0xe841('0xa')]);var _0x2eb50c=_0x2070a6[_0xe841('0xb')](_0x250231),_0x20b909=0x0,_0x57ef7c={},_0x21c6f4='',_0xf7d5f9='',_0x46260c=-0x1;while(_0x2eb50c[_0x20b909]){_0x46260c=_0x2eb50c[_0x20b909]['indexOf'](':');if(_0x46260c!=-0x1){_0x21c6f4=_0x2eb50c[_0x20b909][_0xe841('0xc')](0x0,_0x46260c)[_0xe841('0xd')]();_0xf7d5f9=_0x2eb50c[_0x20b909]['slice'](_0x46260c+0x1)[_0xe841('0xd')]();if(_0x21c6f4[_0xe841('0xa')]>0x0){_0x57ef7c[_0x21c6f4]=_0xf7d5f9;}}else{}_0x20b909++;}this[_0xe841('0xe')]('headers',_0x57ef7c);this[_0xe841('0x4')]=!![];}_0x5aecce++;}this[_0xe841('0x3')]=_0x381eef;}else{while((_0x1a2141=_0x381eef[_0xe841('0x8')](_0x250231))!=-0x1){_0x2070a6=_0x381eef[_0xe841('0x9')](0x0,_0x1a2141);this[_0xe841('0xe')](_0xe841('0xf'),_0x2070a6);_0x381eef=_0x381eef['substring'](_0x1a2141+_0x250231[_0xe841('0xa')]);}this[_0xe841('0x3')]=_0x381eef;}_0x553c91();};module[_0xe841('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index dd0f870..04a8500 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 _0xf873=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','LogoutUser','moment','jayson/promise','client','http','request','error','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production'];(function(_0x498870,_0x5bee43){var _0xe32076=function(_0x28b1f7){while(--_0x28b1f7){_0x498870['push'](_0x498870['shift']());}};_0xe32076(++_0x5bee43);}(_0xf873,0xb2));var _0x3f87=function(_0x378331,_0x545782){_0x378331=_0x378331-0x0;var _0x2374dc=_0xf873[_0x378331];return _0x2374dc;};'use strict';var _=require('lodash');var moment=require(_0x3f87('0x0'));var jayson=require(_0x3f87('0x1'));var client=jayson[_0x3f87('0x2')][_0x3f87('0x3')]({'port':0x2329});function request(_0x1c56a3,_0xd4592c){return new Promise(function(_0x2fbb4f,_0x1d68dd){return client[_0x3f87('0x4')](_0x1c56a3,_0xd4592c)['then'](function(_0x2e2177){if(_0x2e2177[_0x3f87('0x5')]){return _0x1d68dd(_0x2e2177[_0x3f87('0x5')]['message']);}else{return _0x2fbb4f(_0x2e2177[_0x3f87('0x6')]);}})[_0x3f87('0x7')](function(_0x3b8e92){return _0x1d68dd(_0x3b8e92);});});}exports[_0x3f87('0x8')]=function(){return request(_0x3f87('0x9'),{'options':{'raw':![],'attributes':['id',_0x3f87('0xa'),'production']}});};exports[_0x3f87('0xb')]=function(_0x435ca8){return request(_0x3f87('0xc'),{'options':{'raw':![],'where':{'name':_0x435ca8},'attributes':[_0x3f87('0xd')]}});};exports[_0x3f87('0xe')]=function(_0xd41ca0){return request(_0x3f87('0xf'),{'options':{'raw':![],'where':{'id':_0xd41ca0},'include':[{'model':_0x3f87('0x10'),'as':_0x3f87('0x11'),'include':[{'model':_0x3f87('0x12'),'as':_0x3f87('0x12')}]}],'attributes':['id',_0x3f87('0xa'),_0x3f87('0x13')],'smtp':!![]}});};exports[_0x3f87('0x14')]=function(_0x5aff02){return request(_0x3f87('0xc'),{'options':{'where':{'id':_0x5aff02},'attributes':[_0x3f87('0xa')]}});};exports['getVoiceQueueById']=function(_0x1cfba3){return request(_0x3f87('0x15'),{'options':{'where':{'id':_0x1cfba3},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x16')]=function(_0x3f192a){return request(_0x3f87('0x17'),{'options':{'where':{'id':_0x3f192a},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x18')]=function(_0x5f0b2b){return request(_0x3f87('0x19'),{'options':{'where':{'id':_0x5f0b2b},'attributes':[_0x3f87('0x1a')]}});};exports[_0x3f87('0x1b')]=function(_0x4e1df8){return request(_0x3f87('0x1c'),{'options':{'where':{'id':_0x4e1df8},'attributes':['name']}});};exports[_0x3f87('0x1d')]=function(_0x13550c){return request(_0x3f87('0x1e'),{'options':{'where':{'phone':_0x13550c[_0x3f87('0x1f')]},'attributes':['id']}});};exports[_0x3f87('0x20')]=function(_0x4fe75c){return request(_0x3f87('0x21'),{'options':{'where':{'id':_0x4fe75c},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x22')]=function(_0x3a602a){return request('ShowSound',{'options':{'where':{'id':_0x3a602a},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x73aba6){return request(_0x3f87('0x23'),{'options':{'raw':![],'where':{'id':_0x73aba6},'include':[{'model':_0x3f87('0x24'),'as':'Intervals'}]}});};exports[_0x3f87('0x25')]=function(_0xb01673){return request(_0x3f87('0x26'),{'options':{'where':{'id':_0xb01673},'attributes':['id',_0x3f87('0xa')]}});};exports[_0x3f87('0x27')]=function(_0x46d773){return request(_0x3f87('0x28'),{'body':_0x46d773});};exports[_0x3f87('0x29')]=function(_0x197ff4){return request(_0x3f87('0x2a'),{'body':_0x197ff4});};exports[_0x3f87('0x2b')]=function(_0x37b8b9){return request('CreateSquareReport',{'body':_[_0x3f87('0x2c')](_0x37b8b9,{'project_name':_0x37b8b9[_0x3f87('0x2d')],'prev_project_name':_0x37b8b9[_0x3f87('0x2e')]||'','is_subproject':_0x37b8b9['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x3f87('0x2f'))})});};exports[_0x3f87('0x30')]=function(_0x18df70){return request(_0x3f87('0x31'),{'body':_0x18df70});};exports[_0x3f87('0x32')]=function(_0x148d8e){return request(_0x3f87('0x33'),{'body':_0x148d8e});};exports[_0x3f87('0x34')]=function(_0x113e40){return request(_0x3f87('0x35'),{'options':{'raw':![],'where':{'phone':_0x113e40[_0x3f87('0x1f')],'ListId':_0x113e40[_0x3f87('0x36')]}}})[_0x3f87('0x37')](function(_0x241d88){if(_0x241d88){return _0x241d88;}return request(_0x3f87('0x38'),{'body':_0x113e40});});};exports[_0x3f87('0x39')]=function(_0x5d6fc2){return request(_0x3f87('0x3a'),{'options':{'where':{'id':_0x5d6fc2},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x3b')]=function(_0x2f0f05,_0x5495ed){return request('LoginUser',{'body':{'interface':_0x5495ed},'options':{'where':_0x2f0f05}});};exports['agentPause']=function(_0x221800,_0xcafb7d,_0x1d90d4){return request(_0x3f87('0x3c'),{'body':{'type':_0xcafb7d,'uniqueid':_0x1d90d4},'options':{'where':_0x221800}});};exports[_0x3f87('0x3d')]=function(_0x5e4570){return request(_0x3f87('0x3e'),{'body':{},'options':{'where':_0x5e4570}});};exports['agentLogout']=function(_0x2e4bc7){return request(_0x3f87('0x3f'),{'body':{},'options':{'where':_0x2e4bc7}});}; \ No newline at end of file +var _0x295f=['email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Intervals','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','getPauseById','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','moment','jayson/promise','client','request','then','error','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider'];(function(_0x25fe20,_0x5c4098){var _0x5684d0=function(_0x221f80){while(--_0x221f80){_0x25fe20['push'](_0x25fe20['shift']());}};_0x5684d0(++_0x5c4098);}(_0x295f,0x168));var _0xf295=function(_0x2b223d,_0x40c145){_0x2b223d=_0x2b223d-0x0;var _0x2e0158=_0x295f[_0x2b223d];return _0x2e0158;};'use strict';var _=require('lodash');var moment=require(_0xf295('0x0'));var jayson=require(_0xf295('0x1'));var client=jayson[_0xf295('0x2')]['http']({'port':0x2329});function request(_0x45a403,_0x1c653b){return new Promise(function(_0x59a1c5,_0x511ab5){return client[_0xf295('0x3')](_0x45a403,_0x1c653b)[_0xf295('0x4')](function(_0x262f76){if(_0x262f76[_0xf295('0x5')]){return _0x511ab5(_0x262f76[_0xf295('0x5')]['message']);}else{return _0x59a1c5(_0x262f76[_0xf295('0x6')]);}})[_0xf295('0x7')](function(_0x1f3320){return _0x511ab5(_0x1f3320);});});}exports[_0xf295('0x8')]=function(){return request(_0xf295('0x9'),{'options':{'raw':![],'attributes':['id',_0xf295('0xa'),_0xf295('0xb')]}});};exports[_0xf295('0xc')]=function(_0x168437){return request(_0xf295('0xd'),{'options':{'raw':![],'where':{'name':_0x168437},'attributes':[_0xf295('0xb')]}});};exports[_0xf295('0xe')]=function(_0x5ae127){return request(_0xf295('0xf'),{'options':{'raw':![],'where':{'id':_0x5ae127},'include':[{'model':_0xf295('0x10'),'as':'Smtp','include':[{'model':_0xf295('0x11'),'as':_0xf295('0x11')}]}],'attributes':['id',_0xf295('0xa'),_0xf295('0x12')],'smtp':!![]}});};exports[_0xf295('0x13')]=function(_0x50c4ba){return request(_0xf295('0xd'),{'options':{'where':{'id':_0x50c4ba},'attributes':[_0xf295('0xa')]}});};exports[_0xf295('0x14')]=function(_0x3f0981){return request(_0xf295('0x15'),{'options':{'where':{'id':_0x3f0981},'attributes':[_0xf295('0xa')]}});};exports[_0xf295('0x16')]=function(_0x26a3d5){return request(_0xf295('0x17'),{'options':{'where':{'id':_0x26a3d5},'attributes':[_0xf295('0xa')]}});};exports[_0xf295('0x18')]=function(_0x42d8c8){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x42d8c8},'attributes':['dsn']}});};exports[_0xf295('0x19')]=function(_0x129a9e){return request('ShowUser',{'options':{'where':{'id':_0x129a9e},'attributes':[_0xf295('0xa')]}});};exports['getContactByPhone']=function(_0x30ad22){return request('GetContactByPhone',{'options':{'where':{'phone':_0x30ad22['phone']},'attributes':['id']}});};exports[_0xf295('0x1a')]=function(_0x458d55){return request('ShowTrunk',{'options':{'where':{'id':_0x458d55},'attributes':['name']}});};exports[_0xf295('0x1b')]=function(_0x2d731b){return request(_0xf295('0x1c'),{'options':{'where':{'id':_0x2d731b},'attributes':[_0xf295('0x1d')]}});};exports[_0xf295('0x1e')]=function(_0x158f6){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x158f6},'include':[{'model':'Interval','as':_0xf295('0x1f')}]}});};exports['getSmsAccountById']=function(_0x2ef08a){return request(_0xf295('0x20'),{'options':{'where':{'id':_0x2ef08a},'attributes':['id',_0xf295('0xa')]}});};exports['createSmsMessage']=function(_0x3c1be4){return request(_0xf295('0x21'),{'body':_0x3c1be4});};exports['createSquareDetailsReport']=function(_0x250939){return request(_0xf295('0x22'),{'body':_0x250939});};exports[_0xf295('0x23')]=function(_0x3431a4){return request(_0xf295('0x24'),{'body':_['merge'](_0x3431a4,{'project_name':_0x3431a4[_0xf295('0x25')],'prev_project_name':_0x3431a4[_0xf295('0x26')]||'','is_subproject':_0x3431a4['arg_2']?!![]:![],'leaveAt':moment()['format'](_0xf295('0x27'))})});};exports[_0xf295('0x28')]=function(_0x402ca4){return request(_0xf295('0x29'),{'body':_0x402ca4});};exports[_0xf295('0x2a')]=function(_0x2c47e7){return request(_0xf295('0x2b'),{'body':_0x2c47e7});};exports[_0xf295('0x2c')]=function(_0x13fe67){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x13fe67[_0xf295('0x2d')],'ListId':_0x13fe67[_0xf295('0x2e')]}}})[_0xf295('0x4')](function(_0x41aa44){if(_0x41aa44){return _0x41aa44;}return request(_0xf295('0x2f'),{'body':_0x13fe67});});};exports[_0xf295('0x30')]=function(_0x5b2801){return request('ShowPause',{'options':{'where':{'id':_0x5b2801},'attributes':['name']}});};exports['agentLogin']=function(_0x590749,_0x2670f8){return request(_0xf295('0x31'),{'body':{'interface':_0x2670f8},'options':{'where':_0x590749}});};exports[_0xf295('0x32')]=function(_0x515007,_0x13e684,_0x489e72){return request(_0xf295('0x33'),{'body':{'type':_0x13e684,'uniqueid':_0x489e72},'options':{'where':_0x515007}});};exports['agentUnpause']=function(_0x4cd8c1){return request(_0xf295('0x34'),{'body':{},'options':{'where':_0x4cd8c1}});};exports[_0xf295('0x35')]=function(_0x33b7f4){return request('LogoutUser',{'body':{},'options':{'where':_0x33b7f4}});}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index e30ba83..33c1143 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 _0x2d2c=['./polly','./lex','exports'];(function(_0x515028,_0x30dfcc){var _0x133701=function(_0x1993c1){while(--_0x1993c1){_0x515028['push'](_0x515028['shift']());}};_0x133701(++_0x30dfcc);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x2d2c[_0x4b73a2];return _0x383c66;};var polly=require(_0xc2d2('0x0'));var lex=require(_0xc2d2('0x1'));module[_0xc2d2('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x9261=['./polly','./lex'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x9261,0x1de));var _0x1926=function(_0x23ca2f,_0x271c2b){_0x23ca2f=_0x23ca2f-0x0;var _0x4f4b51=_0x9261[_0x23ca2f];return _0x4f4b51;};var polly=require(_0x1926('0x0'));var lex=require(_0x1926('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 5d9137c..e703f0e 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x1c27bb,_0x4a4906,_0x3f643d,_0x306b6e,_0x2221f1,_0x10d2c4){return lex(_0x1c27bb,_0x4a4906,_0x3f643d,_0x306b6e,_0x2221f1,_0x10d2c4);}; \ No newline at end of file +var _0xe605=['./lib/api','exports'];(function(_0x10f1c0,_0x36c5d3){var _0x45e42d=function(_0x5682f5){while(--_0x5682f5){_0x10f1c0['push'](_0x10f1c0['shift']());}};_0x45e42d(++_0x36c5d3);}(_0xe605,0x92));var _0x5e60=function(_0x59af4b,_0x533a0a){_0x59af4b=_0x59af4b-0x0;var _0x2c824d=_0xe605[_0x59af4b];return _0x2c824d;};'use strict';var lex=require(_0x5e60('0x0'));module[_0x5e60('0x1')]=function(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3){return lex(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 7dab313..29249cb 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(_0x533f44,_0x2e49ca){var _0x94dfd8=function(_0x56b77c){while(--_0x56b77c){_0x533f44['push'](_0x533f44['shift']());}};_0x94dfd8(++_0x2e49ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x4b956e,_0x4a366c){var _0xffafa8=function(_0x13fca2){while(--_0x13fca2){_0x4b956e['push'](_0x4b956e['shift']());}};_0xffafa8(++_0x4a366c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index f93977b..498570d 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 _0x6f08=['exports','./lib/api'];(function(_0xfc05ac,_0x48f5ed){var _0xa8cc6=function(_0x95526a){while(--_0x95526a){_0xfc05ac['push'](_0xfc05ac['shift']());}};_0xa8cc6(++_0x48f5ed);}(_0x6f08,0x161));var _0x86f0=function(_0x628767,_0x2bbf3e){_0x628767=_0x628767-0x0;var _0xbfdbc5=_0x6f08[_0x628767];return _0xbfdbc5;};'use strict';var polly=require(_0x86f0('0x0'));module[_0x86f0('0x1')]=function(_0xdfbc79,_0x1e6481,_0xa3321f,_0x14918c,_0x22d7bc,_0x56a13f,_0x16063f){return polly(_0xdfbc79,_0x1e6481,_0xa3321f,_0x14918c,_0x22d7bc,_0x56a13f,_0x16063f);}; \ No newline at end of file +var _0x59ca=['./lib/api'];(function(_0x4c1f42,_0x22b3ec){var _0x51230b=function(_0x133b59){while(--_0x133b59){_0x4c1f42['push'](_0x4c1f42['shift']());}};_0x51230b(++_0x22b3ec);}(_0x59ca,0x137));var _0xa59c=function(_0x397dd1,_0x13494a){_0x397dd1=_0x397dd1-0x0;var _0x312517=_0x59ca[_0x397dd1];return _0x312517;};'use strict';var polly=require(_0xa59c('0x0'));module['exports']=function(_0xb19bd9,_0x2ac44c,_0x5c9b44,_0x17d759,_0x3c4d25,_0x2a9095,_0x1b9287){return polly(_0xb19bd9,_0x2ac44c,_0x5c9b44,_0x17d759,_0x3c4d25,_0x2a9095,_0x1b9287);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index cc51199..bcd2045 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 _0x456c=['synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring','aws-sdk'];(function(_0x5d030b,_0x3638f1){var _0x3036b6=function(_0x11e4ed){while(--_0x11e4ed){_0x5d030b['push'](_0x5d030b['shift']());}};_0x3036b6(++_0x3638f1);}(_0x456c,0xf9));var _0xc456=function(_0x2d926d,_0x106492){_0x2d926d=_0x2d926d-0x0;var _0x2aa16c=_0x456c[_0x2d926d];return _0x2aa16c;};'use strict';var fs=require('fs');var path=require(_0xc456('0x0'));var BPromise=require(_0xc456('0x1'));var rs=require(_0xc456('0x2'));var AWS=require(_0xc456('0x3'));function pollyResult(_0x4f4cdc,_0x222f6c,_0x5b9e59){return new BPromise(function(_0x213adb,_0xafcaa4){_0x4f4cdc[_0xc456('0x4')](_0x222f6c,function(_0x72aea0,_0x23616b){if(_0x72aea0){_0xafcaa4(_0x72aea0);}else if(_0x23616b){if(_0x23616b[_0xc456('0x5')]instanceof Buffer){fs['writeFile'](_0x5b9e59,_0x23616b[_0xc456('0x5')],function(_0x2ae482){if(_0x2ae482){_0xafcaa4(_0x2ae482);}else{_0x213adb();}});}else{_0xafcaa4(new Error(_0xc456('0x6')));}}else{_0xafcaa4(new Error(_0xc456('0x7')));}});});}module[_0xc456('0x8')]=function(_0x1d77b0,_0x409242,_0x27eb70,_0x480d3b,_0x3104d8,_0x4ff962,_0x128124){var _0x1088bf=new AWS[(_0xc456('0x9'))]({'accessKeyId':_0x1d77b0,'secretAccessKey':_0x409242,'region':_0x27eb70});var _0x2eaa23={'Text':_0x3104d8,'TextType':_0x4ff962||_0xc456('0xa'),'OutputFormat':'mp3','VoiceId':_0x480d3b};return pollyResult(_0x1088bf,_0x2eaa23,_0x128124);}; \ No newline at end of file +var _0xe1ce=['synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','bluebird','randomstring','aws-sdk'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xe1ce,0xce));var _0xee1c=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xe1ce[_0x47a349];return _0x18ab75;};'use strict';var fs=require('fs');var path=require(_0xee1c('0x0'));var BPromise=require(_0xee1c('0x1'));var rs=require(_0xee1c('0x2'));var AWS=require(_0xee1c('0x3'));function pollyResult(_0x129b5c,_0x404d69,_0x13ee08){return new BPromise(function(_0x534be2,_0x526839){_0x129b5c[_0xee1c('0x4')](_0x404d69,function(_0x4a4a06,_0x4daea0){if(_0x4a4a06){_0x526839(_0x4a4a06);}else if(_0x4daea0){if(_0x4daea0[_0xee1c('0x5')]instanceof Buffer){fs['writeFile'](_0x13ee08,_0x4daea0['AudioStream'],function(_0x7c6864){if(_0x7c6864){_0x526839(_0x7c6864);}else{_0x534be2();}});}else{_0x526839(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x526839(new Error(_0xee1c('0x6')));}});});}module[_0xee1c('0x7')]=function(_0x416015,_0x58c014,_0x5b248a,_0x302434,_0x35abf2,_0x43eaeb,_0x3ad126){var _0x33dd5f=new AWS[(_0xee1c('0x8'))]({'accessKeyId':_0x416015,'secretAccessKey':_0x58c014,'region':_0x5b248a});var _0x258f35={'Text':_0x35abf2,'TextType':_0x43eaeb||'text','OutputFormat':_0xee1c('0x9'),'VoiceId':_0x302434};return pollyResult(_0x33dd5f,_0x258f35,_0x3ad126);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index 1591954..fe6239b 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 _0x119a=['./lib/api','exports'];(function(_0x407399,_0x28a31f){var _0x5e9ae9=function(_0x3cb0a1){while(--_0x3cb0a1){_0x407399['push'](_0x407399['shift']());}};_0x5e9ae9(++_0x28a31f);}(_0x119a,0x196));var _0xa119=function(_0x2d5ecf,_0xa1fb31){_0x2d5ecf=_0x2d5ecf-0x0;var _0x488a6a=_0x119a[_0x2d5ecf];return _0x488a6a;};'use strict';var asr=require(_0xa119('0x0'));module[_0xa119('0x1')]=function(_0x2082ba,_0x3ae6ca,_0x59c772,_0x2addef){return asr(_0x2082ba,_0x3ae6ca,_0x59c772);}; \ No newline at end of file +var _0x73ed=['./lib/api','exports'];(function(_0x42534d,_0x5324c7){var _0x2ad83a=function(_0x4e6d35){while(--_0x4e6d35){_0x42534d['push'](_0x42534d['shift']());}};_0x2ad83a(++_0x5324c7);}(_0x73ed,0x198));var _0xd73e=function(_0x19cb02,_0x437c42){_0x19cb02=_0x19cb02-0x0;var _0x4e9301=_0x73ed[_0x19cb02];return _0x4e9301;};'use strict';var asr=require(_0xd73e('0x0'));module[_0xd73e('0x1')]=function(_0xa80bd2,_0xb30b72,_0x1ba1d1,_0x114fcf){return asr(_0xa80bd2,_0xb30b72,_0x1ba1d1);}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index a041b95..5383a8a 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 _0x0f9f=['readFileSync','toString','POST','/v1/speech:recognize?key=','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x3bdd36,_0x139fe0){var _0x4c3089=function(_0x3f6dcb){while(--_0x3f6dcb){_0x3bdd36['push'](_0x3bdd36['shift']());}};_0x4c3089(++_0x139fe0);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x2acd0f,_0x3ac736){_0x2acd0f=_0x2acd0f-0x0;var _0x434b3e=_0x0f9f[_0x2acd0f];return _0x434b3e;};'use strict';var url=require('url');var BPromise=require(_0xf0f9('0x0'));var fs=require('fs');var host=_0xf0f9('0x1');module[_0xf0f9('0x2')]=function(_0x48fa0e,_0x5cf55e,_0x45cc98){return new BPromise(function(_0x257b44,_0x17eab4){var _0x2f8d38;if(typeof _0x48fa0e!==_0xf0f9('0x3')||_0x48fa0e[_0xf0f9('0x4')]===0x0){return _0x17eab4(_0xf0f9('0x5'));}if(typeof _0x5cf55e!==_0xf0f9('0x3')||_0x5cf55e[_0xf0f9('0x4')]===0x0){return _0x17eab4('key\x20should\x20be\x20a\x20string');}if(typeof _0x45cc98!==_0xf0f9('0x6')&&(typeof _0x45cc98!==_0xf0f9('0x3')||_0x45cc98['length']===0x0)){return _0x17eab4(_0xf0f9('0x7'));}try{_0x2f8d38=fs[_0xf0f9('0x8')](_0x48fa0e)[_0xf0f9('0x9')]('base64');}catch(_0x196f21){return _0x17eab4(_0x196f21);}return _0x257b44({'method':_0xf0f9('0xa'),'uri':host+_0xf0f9('0xb')+_0x5cf55e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x45cc98},'audio':{'content':_0x2f8d38}},'json':!![]});});}; \ No newline at end of file +var _0x32ef=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32ef,0xf9));var _0xf32e=function(_0x77837d,_0x3027f5){_0x77837d=_0x77837d-0x0;var _0x4d7a79=_0x32ef[_0x77837d];return _0x4d7a79;};'use strict';var url=require(_0xf32e('0x0'));var BPromise=require(_0xf32e('0x1'));var fs=require('fs');var host=_0xf32e('0x2');module[_0xf32e('0x3')]=function(_0x286041,_0x82113b,_0x5da060){return new BPromise(function(_0x232ead,_0x1ff6ab){var _0x4ef070;if(typeof _0x286041!==_0xf32e('0x4')||_0x286041[_0xf32e('0x5')]===0x0){return _0x1ff6ab(_0xf32e('0x6'));}if(typeof _0x82113b!==_0xf32e('0x4')||_0x82113b[_0xf32e('0x5')]===0x0){return _0x1ff6ab(_0xf32e('0x7'));}if(typeof _0x5da060!=='undefined'&&(typeof _0x5da060!==_0xf32e('0x4')||_0x5da060['length']===0x0)){return _0x1ff6ab(_0xf32e('0x8'));}try{_0x4ef070=fs[_0xf32e('0x9')](_0x286041)[_0xf32e('0xa')](_0xf32e('0xb'));}catch(_0x243ad7){return _0x1ff6ab(_0x243ad7);}return _0x232ead({'method':'POST','uri':host+_0xf32e('0xc')+_0x82113b,'body':{'config':{'encoding':_0xf32e('0xd'),'sampleRateHertz':_0xf32e('0xe'),'languageCode':_0x5da060},'audio':{'content':_0x4ef070}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 48a8901..783b065 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 _0xb2b7=['./asr'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb2b7,0x1b3));var _0x7b2b=function(_0x517d0a,_0x1b35c4){_0x517d0a=_0x517d0a-0x0;var _0x3c949d=_0xb2b7[_0x517d0a];return _0x3c949d;};var asr=require(_0x7b2b('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xc20e=['./asr'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xc20e,0xee));var _0xec20=function(_0x4f2ebf,_0x3d220c){_0x4f2ebf=_0x4f2ebf-0x0;var _0x45d931=_0xc20e[_0x4f2ebf];return _0x45d931;};var asr=require(_0xec20('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index ad3f0d2..dfd4964 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 _0x3131=['intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','path','querystring','sox','url','parse','util','./aws','./google','./sestek','../../../config/logger','agi','protocol','host','get','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','finish','info','unlink','pipe','end','WHAT_EVER','\x20failed,\x20status\x20code\x20=\x20','data','transcode','wav','error\x20convert','resolve','tmp','.wav','writeFileSync','base64','then','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','generate','from','audioContent','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','parse\x20response\x20failed:\x0a','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','responseId'];(function(_0x2235b1,_0x1cf222){var _0x5e8411=function(_0x19ba1b){while(--_0x19ba1b){_0x2235b1['push'](_0x2235b1['shift']());}};_0x5e8411(++_0x1cf222);}(_0x3131,0x99));var _0x1313=function(_0x3773b5,_0x400b3f){_0x3773b5=_0x3773b5-0x0;var _0x3ade1d=_0x3131[_0x3773b5];return _0x3ade1d;};'use strict';var apiai=require(_0x1313('0x0'));var BPromise=require(_0x1313('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x1313('0x2'));var https=require(_0x1313('0x3'));var md5=require(_0x1313('0x4'));var path=require(_0x1313('0x5'));var querystring=require(_0x1313('0x6'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x1313('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x1313('0x8'))[_0x1313('0x9')];var util=require(_0x1313('0xa'));var aws=require(_0x1313('0xb'));var google=require(_0x1313('0xc'));var sestek=require(_0x1313('0xd'));var tilde=require('./tilde');var logger=require(_0x1313('0xe'))(_0x1313('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x1660ab,_0x40f9cb){return new BPromise(function(_0xe7e6d2,_0x86f6f6){var _0x481c04=urlParse(_0x1660ab);var _0x4feffd=_0x481c04[_0x1313('0x10')]==='https:'?https:http;var _0x4db681={'host':_0x481c04[_0x1313('0x11')],'path':_0x481c04[_0x1313('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x4feffd[_0x1313('0x12')](_0x4db681,function(_0x18c387){if(_0x18c387[_0x1313('0x13')]!==0xc8){logger[_0x1313('0x14')](_0x1313('0x15')+_0x1660ab+'\x20failed,\x20status\x20code\x20=\x20'+_0x18c387[_0x1313('0x13')]+'\x20('+_0x18c387[_0x1313('0x16')]+')');_0x86f6f6(new Error(_0x1313('0x15')+_0x1660ab+'\x20failed,\x20status\x20code\x20=\x20'+_0x18c387['statusCode']+'\x20('+_0x18c387[_0x1313('0x16')]+')'));return;}var _0x252d63=fs[_0x1313('0x17')](_0x40f9cb);_0x252d63['on'](_0x1313('0x18'),function(){logger[_0x1313('0x19')]('finish\x20download\x20file');_0x252d63['close'](_0xe7e6d2);});_0x252d63['on'](_0x1313('0x14'),function(_0x1da1fd){fs[_0x1313('0x1a')](_0x40f9cb);logger[_0x1313('0x14')]('download\x20error',_0x1da1fd);_0x86f6f6(_0x1da1fd);});_0x18c387[_0x1313('0x1b')](_0x252d63);})['on'](_0x1313('0x14'),function(_0x2895cb){logger['error'](_0x2895cb);_0x86f6f6(_0x2895cb);})[_0x1313('0x1c')]();});}function uploadFile(_0x2e7a37){return new BPromise(function(_0x250405,_0x220ef4){var _0x5188ff=urlParse(_0x2e7a37);var _0x5f0b23=_0x5188ff[_0x1313('0x10')]==='https:'?https:http;var _0x566d34={'host':_0x5188ff['host'],'path':_0x5188ff[_0x1313('0x5')],'headers':{'user-agent':_0x1313('0x1d')}};_0x5f0b23['get'](_0x566d34,function(_0x57ce59){if(_0x57ce59[_0x1313('0x13')]!==0xc8){_0x220ef4(new Error(_0x1313('0x15')+_0x2e7a37+_0x1313('0x1e')+_0x57ce59[_0x1313('0x13')]+'\x20('+_0x57ce59['statusMessage']+')'));return;}var _0x268af7='';_0x57ce59['on'](_0x1313('0x1f'),function(_0x352d27){_0x268af7+=_0x352d27;});_0x57ce59['on'](_0x1313('0x1c'),function(){_0x250405(_0x268af7);});})['on'](_0x1313('0x14'),function(_0x6fe28e){_0x220ef4(_0x6fe28e);})[_0x1313('0x1c')]();});}function convertFile(_0x3b565d,_0x27ba62){return new BPromise(function(_0x13b596,_0x55e8ce){var _0x42dd02=sox[_0x1313('0x20')](_0x3b565d,_0x27ba62,{'sampleRate':0x1f40,'format':_0x1313('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x42dd02['on'](_0x1313('0x14'),function(_0x107bd3){logger['error'](_0x1313('0x22'),_0x107bd3);_0x55e8ce(_0x107bd3);});_0x42dd02['on'](_0x1313('0x1c'),function(){logger[_0x1313('0x19')]('finish\x20to\x20convert');_0x13b596();});_0x42dd02['start']();});}function base64Decode(_0x546b21,_0x440340){var _0x42335f=path[_0x1313('0x23')](__dirname,_0x1313('0x24'),rs['generate'](0x4)+_0x1313('0x25'));fs[_0x1313('0x26')](_0x42335f,_0x546b21,_0x1313('0x27'));return convertFile(_0x42335f,_0x440340)[_0x1313('0x28')](function(){try{fs[_0x1313('0x1a')](_0x42335f);fs['chmodSync'](_0x440340,_0x1313('0x29'));}catch(_0x2b6999){logger[_0x1313('0x14')](_0x2b6999);}return _0x440340[_0x1313('0x2a')]('.')[0x0];});}function base64Encode(_0x6dc9a0){var _0x4dc158=fs['readFileSync'](_0x6dc9a0);return new Buffer(_0x4dc158)[_0x1313('0x2b')]('base64');}exports[_0x1313('0x2c')]=function(_0x1506ef,_0x5cb7c7,_0x458e33,_0x373847,_0x8128d7,_0x17581e){var _0x44b4e2,_0x1920d0;var _0x43fb79=_0x1313('0x2d');var _0x173109=_0x1313('0x2e')+_0x1506ef;var _0x3581b9={};if(_0x5cb7c7===_0x1313('0x2f')){_0x3581b9[_0x1313('0x30')]={'ssml':_0x458e33};}else{_0x3581b9['input']={'text':_0x458e33};};_0x3581b9[_0x1313('0x31')]={'languageCode':_0x373847,'ssmlGender':_0x8128d7};_0x3581b9[_0x1313('0x32')]={'audioEncoding':_0x1313('0x33'),'sampleRateHertz':0x1f40};var _0xf24cf2={'url':_0x43fb79+_0x1313('0x34')+_0x173109,'method':_0x1313('0x35'),'json':!![],'body':_0x3581b9};return rp(_0xf24cf2)['then'](function(_0x2abef9){return new BPromise(function(_0x4d0ac6,_0x228b7c){_0x44b4e2=path[_0x1313('0x23')](__dirname,_0x1313('0x24'),rs[_0x1313('0x36')](0x4)+'.mp3');var _0x571343=Buffer[_0x1313('0x37')](_0x2abef9[_0x1313('0x38')],_0x1313('0x27'));return fs[_0x1313('0x39')](_0x44b4e2,_0x571343,function(_0x2eff21){_0x228b7c(_0x2eff21);},function(_0xe80cbe){fs[_0x1313('0x3a')](_0x44b4e2,_0x1313('0x29'));_0x4d0ac6(_0xe80cbe);});});})[_0x1313('0x28')](function(_0x581b0c){_0x1920d0=path[_0x1313('0x23')](__dirname,'tmp',rs['generate'](0x4)+_0x1313('0x25'));return convertFile(_0x44b4e2,_0x1920d0);})[_0x1313('0x28')](function(){try{fs[_0x1313('0x1a')](_0x44b4e2);fs['chmodSync'](_0x1920d0,_0x1313('0x29'));}catch(_0x338683){logger[_0x1313('0x14')](_0x338683);}logger[_0x1313('0x19')](_0x1313('0x3b'),_0x1920d0[_0x1313('0x2a')]('.')[0x0]);return _0x1920d0['split']('.')[0x0];});};exports[_0x1313('0x3c')]=function(_0x21887f,_0x531a00){var _0x2862b7=_0x1313('0x3d');var _0x2893af,_0xdb5023;var _0x3d9160;var _0x4dd154={'encoding':_0x1313('0x3e'),'method':'POST','timeout':0x2710,'url':_0x2862b7,'headers':{'Content-Type':_0x1313('0x3f')},'body':_0x1313('0x40')+encodeURIComponent(JSON[_0x1313('0x41')]([[[_0x1313('0x42'),JSON['stringify']([_0x21887f,_0x531a00||'en',![],_0x1313('0x43')]),null,_0x1313('0x44')]]]))};return rp(_0x4dd154)[_0x1313('0x28')](function(_0x367e09){try{_0x3d9160=eval(_0x367e09[_0x1313('0x45')](0x5))[0x0][0x2];}catch(_0x20f7e7){throw new Error('parse\x20response\x20failed:\x0a'+_0x367e09[_0x1313('0x1f')]);}if(!_0x3d9160){if(_0x21887f[_0x1313('0x46')]>0xc8){throw new Error(_0x1313('0x47'));}else{throw new Error('lang\x20\x22'+_0x531a00+'\x22\x20might\x20not\x20exist');}}try{_0x3d9160=eval(_0x3d9160)[0x0];}catch(_0x1eeb20){throw new Error(_0x1313('0x48')+res[_0x1313('0x1f')]);}const _0x92db35=_0x3d9160;_0x2893af=path[_0x1313('0x23')](__dirname,'tmp',rs[_0x1313('0x36')](0x4)+_0x1313('0x49'));fs[_0x1313('0x26')](_0x2893af,_0x3d9160,{'encoding':'base64'});_0xdb5023=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x1313('0x25'));return convertFile(_0x2893af,_0xdb5023);})['then'](function(){try{fs['unlink'](_0x2893af);fs['chmodSync'](_0xdb5023,_0x1313('0x29'));}catch(_0x586b2e){logger[_0x1313('0x14')](_0x586b2e);}logger[_0x1313('0x19')](_0x1313('0x4a'),_0xdb5023[_0x1313('0x2a')]('.')[0x0]);return _0xdb5023[_0x1313('0x2a')]('.')[0x0];});};exports[_0x1313('0x4b')]=function(_0x2a5f56,_0x875c31,_0x5e934e){return google[_0x1313('0x4c')](_0x2a5f56,_0x875c31,_0x5e934e)['then'](function(_0x60455){logger[_0x1313('0x19')](_0x60455[_0x1313('0x4d')]);return rp(_0x60455);})[_0x1313('0x28')](function(_0x4e8296){var _0x2f9af9='';var _0x2904d5=0x0;try{fs[_0x1313('0x1a')](_0x2a5f56);}catch(_0x1244ef){logger[_0x1313('0x14')](_0x1244ef);}if(_0x4e8296&&_0x4e8296[_0x1313('0x4e')]){_0x2f9af9=_0x4e8296[_0x1313('0x4e')]['map'](function(_0x32c540){return _0x32c540&&_0x32c540[_0x1313('0x4f')][0x0]&&_0x32c540[_0x1313('0x4f')][0x0][_0x1313('0x50')]?_0x32c540[_0x1313('0x4f')][0x0][_0x1313('0x50')]:'';})[_0x1313('0x51')]('\x0a');_0x2904d5=_0x4e8296['results']['map'](function(_0x5131ad){return _0x5131ad&&_0x5131ad[_0x1313('0x4f')][0x0]&&_0x5131ad[_0x1313('0x4f')][0x0][_0x1313('0x52')]?_0x5131ad['alternatives'][0x0]['confidence']:0x0;})[_0x1313('0x51')]('\x0a');}logger[_0x1313('0x19')](_0x1313('0x53'),_0x2f9af9);logger[_0x1313('0x19')](_0x1313('0x54'),_0x2904d5);return{'transcript':_0x2f9af9,'confidence':_0x2904d5};})[_0x1313('0x55')](function(_0x56593d){logger[_0x1313('0x14')](_0x1313('0x56'),_0x56593d['statusCode'],_0x56593d[_0x1313('0x57')],_0x56593d[_0x1313('0x58')]);});};exports[_0x1313('0x59')]=function(_0x29fcc5,_0x5e2147,_0x38c0b7,_0x78ab74){var _0x2411e0=apiai(_0x5e2147,{'language':_0x78ab74||'en'});return _0x2411e0[_0x1313('0x5a')](_0x38c0b7,{'sessionId':md5(_0x29fcc5)})['then'](function(_0x1d355a){logger[_0x1313('0x19')](JSON[_0x1313('0x41')](_0x1d355a));return{'source':_0x1d355a[_0x1313('0x5b')][_0x1313('0x5c')],'resolvedQuery':_0x1d355a[_0x1313('0x5b')]['resolvedQuery'],'action':_0x1d355a['result'][_0x1313('0x5d')],'actionIncomplete':_0x1d355a[_0x1313('0x5b')]['actionIncomplete'],'speech':_0x1d355a[_0x1313('0x5b')][_0x1313('0x5e')]['speech'],'score':_0x1d355a[_0x1313('0x5b')][_0x1313('0x5f')],'statusCode':_0x1d355a[_0x1313('0x60')][_0x1313('0x61')],'endConversation':_0x1d355a[_0x1313('0x5b')][_0x1313('0x62')][_0x1313('0x63')]||![],'isFallbackIntent':_0x1d355a[_0x1313('0x5b')][_0x1313('0x62')][_0x1313('0x64')]};});};exports[_0x1313('0x65')]=function(_0x2fcf35,_0x1e48d3,_0x487338,_0x587cb1,_0x2a948c,_0x4effda){var _0x5432b3=_0x587cb1[_0x1313('0x66')](/\\n/g,'\x0a');var _0x48eb79={'credentials':{'private_key':_0x5432b3,'client_email':_0x487338}};var _0x5d06de=new dialogflow['SessionsClient'](_0x48eb79);var _0xc11265=_0x5d06de[_0x1313('0x67')](_0x1e48d3,md5(_0x2fcf35));var _0x2c3cfe={'session':_0xc11265,'queryInput':{'text':{'text':_0x2a948c,'languageCode':_0x4effda}}};return _0x5d06de[_0x1313('0x68')](_0x2c3cfe)[_0x1313('0x28')](function(_0x3e7804){if(_0x3e7804&&_0x3e7804[_0x1313('0x46')]){logger[_0x1313('0x19')](_0x1313('0x69'),JSON['stringify'](_0x3e7804));var _0x200756=_0x3e7804[0x0];if(_0x200756){var _0x3935c6={'action':_0x200756['queryResult'][_0x1313('0x5d')],'allRequiredParamsPresent':_0x200756['queryResult'][_0x1313('0x6a')],'endConversation':_0x200756['queryResult']['diagnosticInfo']&&_0x200756[_0x1313('0x6b')][_0x1313('0x6c')]['fields']?_0x200756[_0x1313('0x6b')][_0x1313('0x6c')][_0x1313('0x6d')]['end_conversation'][_0x1313('0x6e')]:![],'fulfillmentText':_0x200756[_0x1313('0x6b')][_0x1313('0x6f')],'intentName':_0x200756[_0x1313('0x6b')][_0x1313('0x70')][_0x1313('0x57')],'intentDisplayName':_0x200756[_0x1313('0x6b')][_0x1313('0x70')][_0x1313('0x71')],'isFallbackIntent':_0x200756[_0x1313('0x6b')][_0x1313('0x70')]['isFallback'],'languageCode':_0x200756[_0x1313('0x6b')][_0x1313('0x72')],'queryText':_0x200756[_0x1313('0x6b')][_0x1313('0x73')],'responseId':_0x200756[_0x1313('0x74')],'score':_0x200756[_0x1313('0x6b')][_0x1313('0x75')],'speech':_0x200756[_0x1313('0x6b')][_0x1313('0x6f')],'providerResponse':JSON[_0x1313('0x41')](_0x3e7804)};return _0x3935c6;}}});};exports['tildeASR']=function(_0x2d0713,_0x4964f1,_0x23c7a5,_0x232b2f){return tilde[_0x1313('0x4c')](_0x2d0713,_0x4964f1,_0x23c7a5,_0x232b2f)[_0x1313('0x28')](function(_0x125455){try{fs[_0x1313('0x1a')](_0x2d0713);}catch(_0x4f6225){logger['error'](_0x4f6225);}logger[_0x1313('0x19')](_0x1313('0x76'),_0x125455[_0x1313('0x50')]);logger[_0x1313('0x19')](_0x1313('0x77'),_0x125455['confidence']);return _0x125455;});};exports[_0x1313('0x78')]=function(_0x5012cb,_0x22a973,_0x52cc16,_0x4c25b4,_0x43d285,_0x393c3c){var _0x420cca=path[_0x1313('0x23')](__dirname,_0x1313('0x24'),rs[_0x1313('0x36')](0x4)+_0x1313('0x49'));var _0x5845b9;return aws[_0x1313('0x79')](_0x5012cb,_0x22a973,_0x52cc16,_0x4c25b4,_0x43d285,_0x393c3c,_0x420cca)[_0x1313('0x28')](function(){_0x5845b9=path[_0x1313('0x23')](__dirname,'tmp',rs[_0x1313('0x36')](0x4)+'.wav');return convertFile(_0x420cca,_0x5845b9);})['then'](function(){try{fs[_0x1313('0x1a')](_0x420cca);fs['chmodSync'](_0x5845b9,_0x1313('0x29'));}catch(_0x23aaf5){logger['error'](_0x23aaf5);}return _0x5845b9[_0x1313('0x2a')]('.')[0x0];});};exports['awsLex']=function(_0x25bbfe,_0x94dc91,_0x2efa14,_0x169a9a,_0x48e5a8,_0x2681bb){return aws[_0x1313('0x7a')](_0x25bbfe,_0x94dc91,_0x2efa14,_0x169a9a,_0x48e5a8,_0x2681bb)[_0x1313('0x28')](function(_0x5c751b){logger[_0x1313('0x19')](JSON[_0x1313('0x41')](_0x5c751b));return _0x5c751b;});};exports['ispeechTTS']=function(_0x41023b,_0x2bea55,_0xfbf9a8,_0x350013){var _0x4e689d=util['format'](_0x1313('0x7b'),ISPEECH_API,_0x41023b,encodeURIComponent(_0x2bea55),_0xfbf9a8,_0x350013);var _0x4ddb02=path[_0x1313('0x23')](__dirname,_0x1313('0x24'),rs[_0x1313('0x36')](0x4)+'.mp3');var _0x39c131;return downloadFile(_0x4e689d,_0x4ddb02)[_0x1313('0x28')](function(){_0x39c131=path[_0x1313('0x23')](__dirname,'tmp',rs[_0x1313('0x36')](0x4)+_0x1313('0x25'));return convertFile(_0x4ddb02,_0x39c131);})['then'](function(){try{fs[_0x1313('0x1a')](_0x4ddb02);fs[_0x1313('0x3a')](_0x39c131,_0x1313('0x29'));}catch(_0x287a9b){logger[_0x1313('0x14')](_0x287a9b);}return _0x39c131['split']('.')[0x0];});};exports['ispeechASR']=function(_0x4dc8ba,_0x8fd8d4,_0x2aafef,_0x3a37d7){var _0x1806aa=util[_0x1313('0x7c')](_0x1313('0x7d'),ISPEECH_API,_0x8fd8d4,_0x2aafef,base64Encode(_0x4dc8ba),_0x3a37d7?util[_0x1313('0x7c')](_0x1313('0x7e'),encodeURIComponent(_0x3a37d7)):'freeform=3');return uploadFile(_0x1806aa)[_0x1313('0x28')](function(_0x153fc5){return querystring[_0x1313('0x9')](_0x153fc5);});};exports[_0x1313('0x7f')]=function(_0xb2b3ff,_0x550f2b){return sestek[_0x1313('0x80')](_0xb2b3ff,_0x550f2b)[_0x1313('0x28')](function(_0x2d9971){logger['info'](JSON['stringify'](_0x2d9971));var _0x48ea70={'speech':_0x2d9971[_0x1313('0x81')],'action':_0x2d9971[_0x1313('0x82')]?_0x2d9971[_0x1313('0x82')]['CustomAction']:undefined,'actiondata':_0x2d9971[_0x1313('0x82')]?_0x2d9971['channelData']['CustomActionData']:undefined};if(_0x2d9971[_0x1313('0x82')]&&_0x2d9971[_0x1313('0x82')][_0x1313('0x83')]){return base64Decode(_0x2d9971[_0x1313('0x82')][_0x1313('0x83')][_0x1313('0x84')],path[_0x1313('0x23')](__dirname,'tmp',rs[_0x1313('0x36')](0x4)+_0x1313('0x25')))[_0x1313('0x28')](function(_0xeec1ce){_0x48ea70[_0x1313('0x85')]=_0xeec1ce;return _0x48ea70;});}return _0x48ea70;});};exports[_0x1313('0x86')]=function(){return __dirname;}; \ No newline at end of file +var _0x9ed1=['results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','result','source','action','actionIncomplete','fulfillment','speech','endConversation','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','fields','diagnosticInfo','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','unlink','download\x20error','end','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','writeFileSync','base64','then','chmodSync','777','toString','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','generate','audioContent','.wav','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','uri'];(function(_0x3f4a75,_0x1ff97e){var _0x1cd60d=function(_0x317c0d){while(--_0x317c0d){_0x3f4a75['push'](_0x3f4a75['shift']());}};_0x1cd60d(++_0x1ff97e);}(_0x9ed1,0x142));var _0x19ed=function(_0x5df7ef,_0x16ad2b){_0x5df7ef=_0x5df7ef-0x0;var _0x1865d7=_0x9ed1[_0x5df7ef];return _0x1865d7;};'use strict';var apiai=require(_0x19ed('0x0'));var BPromise=require(_0x19ed('0x1'));var dialogflow=require(_0x19ed('0x2'));var fs=require('fs');var http=require(_0x19ed('0x3'));var https=require(_0x19ed('0x4'));var md5=require(_0x19ed('0x5'));var path=require(_0x19ed('0x6'));var querystring=require(_0x19ed('0x7'));var rp=require(_0x19ed('0x8'));var rs=require(_0x19ed('0x9'));var sox=require(_0x19ed('0xa'));var tts=require(_0x19ed('0xb'));var urlParse=require('url')[_0x19ed('0xc')];var util=require(_0x19ed('0xd'));var aws=require(_0x19ed('0xe'));var google=require(_0x19ed('0xf'));var sestek=require(_0x19ed('0x10'));var tilde=require(_0x19ed('0x11'));var logger=require(_0x19ed('0x12'))('agi');var ISPEECH_API=_0x19ed('0x13');function downloadFile(_0x52c071,_0x1434ea){return new BPromise(function(_0x4fe6a1,_0x592f76){var _0x4c6c09=urlParse(_0x52c071);var _0x577e8f=_0x4c6c09[_0x19ed('0x14')]==='https:'?https:http;var _0x5dc205={'host':_0x4c6c09[_0x19ed('0x15')],'path':_0x4c6c09['path'],'headers':{'user-agent':_0x19ed('0x16')}};_0x577e8f[_0x19ed('0x17')](_0x5dc205,function(_0x352c56){if(_0x352c56[_0x19ed('0x18')]!==0xc8){logger[_0x19ed('0x19')](_0x19ed('0x1a')+_0x52c071+'\x20failed,\x20status\x20code\x20=\x20'+_0x352c56[_0x19ed('0x18')]+'\x20('+_0x352c56[_0x19ed('0x1b')]+')');_0x592f76(new Error(_0x19ed('0x1a')+_0x52c071+_0x19ed('0x1c')+_0x352c56[_0x19ed('0x18')]+'\x20('+_0x352c56[_0x19ed('0x1b')]+')'));return;}var _0x30824f=fs[_0x19ed('0x1d')](_0x1434ea);_0x30824f['on'](_0x19ed('0x1e'),function(){logger[_0x19ed('0x1f')](_0x19ed('0x20'));_0x30824f['close'](_0x4fe6a1);});_0x30824f['on'](_0x19ed('0x19'),function(_0x28cd69){fs[_0x19ed('0x21')](_0x1434ea);logger[_0x19ed('0x19')](_0x19ed('0x22'),_0x28cd69);_0x592f76(_0x28cd69);});_0x352c56['pipe'](_0x30824f);})['on'](_0x19ed('0x19'),function(_0x157880){logger[_0x19ed('0x19')](_0x157880);_0x592f76(_0x157880);})[_0x19ed('0x23')]();});}function uploadFile(_0x4b4a2e){return new BPromise(function(_0x306c4d,_0x3001a6){var _0x32efd0=urlParse(_0x4b4a2e);var _0xba8303=_0x32efd0['protocol']==='https:'?https:http;var _0xd599b2={'host':_0x32efd0[_0x19ed('0x15')],'path':_0x32efd0[_0x19ed('0x6')],'headers':{'user-agent':_0x19ed('0x16')}};_0xba8303[_0x19ed('0x17')](_0xd599b2,function(_0x454eed){if(_0x454eed[_0x19ed('0x18')]!==0xc8){_0x3001a6(new Error('request\x20to\x20'+_0x4b4a2e+_0x19ed('0x1c')+_0x454eed[_0x19ed('0x18')]+'\x20('+_0x454eed['statusMessage']+')'));return;}var _0xaccb4='';_0x454eed['on']('data',function(_0x5edc64){_0xaccb4+=_0x5edc64;});_0x454eed['on'](_0x19ed('0x23'),function(){_0x306c4d(_0xaccb4);});})['on'](_0x19ed('0x19'),function(_0x2ecda6){_0x3001a6(_0x2ecda6);})['end']();});}function convertFile(_0x438672,_0x2664f2){return new BPromise(function(_0x1188eb,_0x593e3f){var _0x24736b=sox['transcode'](_0x438672,_0x2664f2,{'sampleRate':0x1f40,'format':_0x19ed('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x24736b['on'](_0x19ed('0x19'),function(_0x3e12d1){logger[_0x19ed('0x19')](_0x19ed('0x25'),_0x3e12d1);_0x593e3f(_0x3e12d1);});_0x24736b['on'](_0x19ed('0x23'),function(){logger[_0x19ed('0x1f')](_0x19ed('0x26'));_0x1188eb();});_0x24736b[_0x19ed('0x27')]();});}function base64Decode(_0x4a65aa,_0x1e0620){var _0x36d506=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+'.wav');fs[_0x19ed('0x2a')](_0x36d506,_0x4a65aa,_0x19ed('0x2b'));return convertFile(_0x36d506,_0x1e0620)[_0x19ed('0x2c')](function(){try{fs[_0x19ed('0x21')](_0x36d506);fs[_0x19ed('0x2d')](_0x1e0620,_0x19ed('0x2e'));}catch(_0x34be67){logger[_0x19ed('0x19')](_0x34be67);}return _0x1e0620['split']('.')[0x0];});}function base64Encode(_0x1b82a0){var _0x3fead6=fs['readFileSync'](_0x1b82a0);return new Buffer(_0x3fead6)[_0x19ed('0x2f')](_0x19ed('0x2b'));}exports['googleCloudTTS']=function(_0x37eb5d,_0xef1a1,_0x58db37,_0x253526,_0x4b3a68,_0x37cf24){var _0x58f078,_0x5f3bf7;var _0x336951=_0x19ed('0x30');var _0x361298='?key='+_0x37eb5d;var _0x25ddfc={};if(_0xef1a1===_0x19ed('0x31')){_0x25ddfc[_0x19ed('0x32')]={'ssml':_0x58db37};}else{_0x25ddfc[_0x19ed('0x32')]={'text':_0x58db37};};_0x25ddfc[_0x19ed('0x33')]={'languageCode':_0x253526,'ssmlGender':_0x4b3a68};_0x25ddfc[_0x19ed('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x16719d={'url':_0x336951+'text:synthesize'+_0x361298,'method':'POST','json':!![],'body':_0x25ddfc};return rp(_0x16719d)[_0x19ed('0x2c')](function(_0x38be2a){return new BPromise(function(_0x188832,_0x41e723){_0x58f078=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+'.mp3');var _0x303455=Buffer['from'](_0x38be2a[_0x19ed('0x36')],_0x19ed('0x2b'));return fs['writeFile'](_0x58f078,_0x303455,function(_0x2d4167){_0x41e723(_0x2d4167);},function(_0x518d0d){fs[_0x19ed('0x2d')](_0x58f078,_0x19ed('0x2e'));_0x188832(_0x518d0d);});});})[_0x19ed('0x2c')](function(_0x51ef21){_0x5f3bf7=path['resolve'](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+_0x19ed('0x37'));return convertFile(_0x58f078,_0x5f3bf7);})[_0x19ed('0x2c')](function(){try{fs['unlink'](_0x58f078);fs[_0x19ed('0x2d')](_0x5f3bf7,'777');}catch(_0x15b1c5){logger['error'](_0x15b1c5);}logger[_0x19ed('0x1f')]('googleCloudTTS\x20path',_0x5f3bf7[_0x19ed('0x38')]('.')[0x0]);return _0x5f3bf7[_0x19ed('0x38')]('.')[0x0];});};exports[_0x19ed('0x39')]=function(_0x1e9560,_0x33e38e){var _0x1ba7c0=_0x19ed('0x3a');var _0x2ecc84,_0x5c030a;var _0x116729;var _0x4fca1e={'encoding':_0x19ed('0x3b'),'method':_0x19ed('0x3c'),'timeout':0x2710,'url':_0x1ba7c0,'headers':{'Content-Type':_0x19ed('0x3d')},'body':_0x19ed('0x3e')+encodeURIComponent(JSON['stringify']([[[_0x19ed('0x3f'),JSON[_0x19ed('0x40')]([_0x1e9560,_0x33e38e||'en',![],_0x19ed('0x41')]),null,_0x19ed('0x42')]]]))};return rp(_0x4fca1e)[_0x19ed('0x2c')](function(_0x4000d6){try{_0x116729=eval(_0x4000d6[_0x19ed('0x43')](0x5))[0x0][0x2];}catch(_0x63f9d8){throw new Error(_0x19ed('0x44')+_0x4000d6[_0x19ed('0x45')]);}if(!_0x116729){if(_0x1e9560[_0x19ed('0x46')]>0xc8){throw new Error(_0x19ed('0x47'));}else{throw new Error('lang\x20\x22'+_0x33e38e+_0x19ed('0x48'));}}try{_0x116729=eval(_0x116729)[0x0];}catch(_0x551b1c){throw new Error(_0x19ed('0x44')+res[_0x19ed('0x45')]);}const _0x44ff30=_0x116729;_0x2ecc84=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+_0x19ed('0x49'));fs[_0x19ed('0x2a')](_0x2ecc84,_0x116729,{'encoding':_0x19ed('0x2b')});_0x5c030a=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+_0x19ed('0x37'));return convertFile(_0x2ecc84,_0x5c030a);})[_0x19ed('0x2c')](function(){try{fs[_0x19ed('0x21')](_0x2ecc84);fs[_0x19ed('0x2d')](_0x5c030a,_0x19ed('0x2e'));}catch(_0x17ce98){logger[_0x19ed('0x19')](_0x17ce98);}logger['info'](_0x19ed('0x4a'),_0x5c030a[_0x19ed('0x38')]('.')[0x0]);return _0x5c030a[_0x19ed('0x38')]('.')[0x0];});};exports[_0x19ed('0x4b')]=function(_0x1f2432,_0x506bfc,_0x3b8c32){return google['asr'](_0x1f2432,_0x506bfc,_0x3b8c32)[_0x19ed('0x2c')](function(_0x4b82f3){logger[_0x19ed('0x1f')](_0x4b82f3[_0x19ed('0x4c')]);return rp(_0x4b82f3);})[_0x19ed('0x2c')](function(_0x21cb17){var _0x4991a4='';var _0x3dc7e2=0x0;try{fs['unlink'](_0x1f2432);}catch(_0x227b33){logger[_0x19ed('0x19')](_0x227b33);}if(_0x21cb17&&_0x21cb17['results']){_0x4991a4=_0x21cb17[_0x19ed('0x4d')][_0x19ed('0x4e')](function(_0x319cfc){return _0x319cfc&&_0x319cfc['alternatives'][0x0]&&_0x319cfc[_0x19ed('0x4f')][0x0][_0x19ed('0x50')]?_0x319cfc[_0x19ed('0x4f')][0x0]['transcript']:'';})['join']('\x0a');_0x3dc7e2=_0x21cb17[_0x19ed('0x4d')]['map'](function(_0x33b297){return _0x33b297&&_0x33b297['alternatives'][0x0]&&_0x33b297[_0x19ed('0x4f')][0x0][_0x19ed('0x51')]?_0x33b297[_0x19ed('0x4f')][0x0][_0x19ed('0x51')]:0x0;})[_0x19ed('0x52')]('\x0a');}logger['info'](_0x19ed('0x53'),_0x4991a4);logger[_0x19ed('0x1f')](_0x19ed('0x54'),_0x3dc7e2);return{'transcript':_0x4991a4,'confidence':_0x3dc7e2};})[_0x19ed('0x55')](function(_0x115fcb){logger[_0x19ed('0x19')]('[%s]\x20%s:%s',_0x115fcb[_0x19ed('0x18')],_0x115fcb['name'],_0x115fcb[_0x19ed('0x56')]);});};exports[_0x19ed('0x57')]=function(_0x388615,_0x5eb6af,_0x38a077,_0x3f03c2){var _0x1d7cda=apiai(_0x5eb6af,{'language':_0x3f03c2||'en'});return _0x1d7cda['textRequest'](_0x38a077,{'sessionId':md5(_0x388615)})[_0x19ed('0x2c')](function(_0x3a8961){logger['info'](JSON[_0x19ed('0x40')](_0x3a8961));return{'source':_0x3a8961[_0x19ed('0x58')][_0x19ed('0x59')],'resolvedQuery':_0x3a8961[_0x19ed('0x58')]['resolvedQuery'],'action':_0x3a8961['result'][_0x19ed('0x5a')],'actionIncomplete':_0x3a8961[_0x19ed('0x58')][_0x19ed('0x5b')],'speech':_0x3a8961[_0x19ed('0x58')][_0x19ed('0x5c')][_0x19ed('0x5d')],'score':_0x3a8961[_0x19ed('0x58')]['score'],'statusCode':_0x3a8961['status']['code'],'endConversation':_0x3a8961['result']['metadata'][_0x19ed('0x5e')]||![],'isFallbackIntent':_0x3a8961[_0x19ed('0x58')]['metadata']['isFallbackIntent']};});};exports[_0x19ed('0x5f')]=function(_0x40ba03,_0x112791,_0x53d64a,_0x2b1d99,_0x2c0e12,_0x5b5bb3){var _0x150df5=_0x2b1d99[_0x19ed('0x60')](/\\n/g,'\x0a');var _0x4c213d={'credentials':{'private_key':_0x150df5,'client_email':_0x53d64a}};var _0xa272b4=new dialogflow[(_0x19ed('0x61'))](_0x4c213d);var _0x2e2514=_0xa272b4[_0x19ed('0x62')](_0x112791,md5(_0x40ba03));var _0x47234c={'session':_0x2e2514,'queryInput':{'text':{'text':_0x2c0e12,'languageCode':_0x5b5bb3}}};return _0xa272b4[_0x19ed('0x63')](_0x47234c)['then'](function(_0x51b98){if(_0x51b98&&_0x51b98[_0x19ed('0x46')]){logger[_0x19ed('0x1f')](_0x19ed('0x64'),JSON[_0x19ed('0x40')](_0x51b98));var _0x3c9f9c=_0x51b98[0x0];if(_0x3c9f9c){var _0x45e40a={'action':_0x3c9f9c['queryResult']['action'],'allRequiredParamsPresent':_0x3c9f9c['queryResult'][_0x19ed('0x65')],'endConversation':_0x3c9f9c[_0x19ed('0x66')]['diagnosticInfo']&&_0x3c9f9c[_0x19ed('0x66')]['diagnosticInfo'][_0x19ed('0x67')]?_0x3c9f9c['queryResult'][_0x19ed('0x68')]['fields']['end_conversation'][_0x19ed('0x69')]:![],'fulfillmentText':_0x3c9f9c['queryResult'][_0x19ed('0x6a')],'intentName':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x6b')]['name'],'intentDisplayName':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x6b')][_0x19ed('0x6c')],'isFallbackIntent':_0x3c9f9c['queryResult'][_0x19ed('0x6b')][_0x19ed('0x6d')],'languageCode':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x6e')],'queryText':_0x3c9f9c[_0x19ed('0x66')]['queryText'],'responseId':_0x3c9f9c[_0x19ed('0x6f')],'score':_0x3c9f9c[_0x19ed('0x66')][_0x19ed('0x70')],'speech':_0x3c9f9c['queryResult'][_0x19ed('0x6a')],'providerResponse':JSON[_0x19ed('0x40')](_0x51b98)};return _0x45e40a;}}});};exports[_0x19ed('0x71')]=function(_0x31b23e,_0xe8e5e0,_0x3ad518,_0x1e7e63){return tilde[_0x19ed('0x72')](_0x31b23e,_0xe8e5e0,_0x3ad518,_0x1e7e63)[_0x19ed('0x2c')](function(_0x118f03){try{fs[_0x19ed('0x21')](_0x31b23e);}catch(_0x229099){logger[_0x19ed('0x19')](_0x229099);}logger['info'](_0x19ed('0x73'),_0x118f03[_0x19ed('0x50')]);logger[_0x19ed('0x1f')](_0x19ed('0x74'),_0x118f03['confidence']);return _0x118f03;});};exports[_0x19ed('0x75')]=function(_0x275541,_0x83a39d,_0x1f71bf,_0x33e0ad,_0x569086,_0x296679){var _0x3af0f5=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+_0x19ed('0x49'));var _0x1c0152;return aws[_0x19ed('0x76')](_0x275541,_0x83a39d,_0x1f71bf,_0x33e0ad,_0x569086,_0x296679,_0x3af0f5)[_0x19ed('0x2c')](function(){_0x1c0152=path[_0x19ed('0x28')](__dirname,'tmp',rs[_0x19ed('0x35')](0x4)+_0x19ed('0x37'));return convertFile(_0x3af0f5,_0x1c0152);})['then'](function(){try{fs[_0x19ed('0x21')](_0x3af0f5);fs[_0x19ed('0x2d')](_0x1c0152,'777');}catch(_0x38983f){logger[_0x19ed('0x19')](_0x38983f);}return _0x1c0152[_0x19ed('0x38')]('.')[0x0];});};exports[_0x19ed('0x77')]=function(_0x30dd07,_0x338e35,_0x1acab8,_0xeff821,_0x3e1905,_0x58ef5c){return aws[_0x19ed('0x78')](_0x30dd07,_0x338e35,_0x1acab8,_0xeff821,_0x3e1905,_0x58ef5c)[_0x19ed('0x2c')](function(_0x21194c){logger[_0x19ed('0x1f')](JSON[_0x19ed('0x40')](_0x21194c));return _0x21194c;});};exports[_0x19ed('0x79')]=function(_0x3ab300,_0x5b8ae9,_0x34294a,_0x4dfd80){var _0x5db03e=util[_0x19ed('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3ab300,encodeURIComponent(_0x5b8ae9),_0x34294a,_0x4dfd80);var _0x552b26=path['resolve'](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+_0x19ed('0x49'));var _0x548584;return downloadFile(_0x5db03e,_0x552b26)[_0x19ed('0x2c')](function(){_0x548584=path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs[_0x19ed('0x35')](0x4)+'.wav');return convertFile(_0x552b26,_0x548584);})[_0x19ed('0x2c')](function(){try{fs[_0x19ed('0x21')](_0x552b26);fs[_0x19ed('0x2d')](_0x548584,'777');}catch(_0x55ae48){logger['error'](_0x55ae48);}return _0x548584['split']('.')[0x0];});};exports[_0x19ed('0x7b')]=function(_0x319216,_0x1bdd54,_0x3dc605,_0x178944){var _0x194a2e=util['format'](_0x19ed('0x7c'),ISPEECH_API,_0x1bdd54,_0x3dc605,base64Encode(_0x319216),_0x178944?util['format'](_0x19ed('0x7d'),encodeURIComponent(_0x178944)):'freeform=3');return uploadFile(_0x194a2e)[_0x19ed('0x2c')](function(_0x2d364f){return querystring[_0x19ed('0xc')](_0x2d364f);});};exports['sestekNDA']=function(_0x434026,_0x3fc5be){return sestek[_0x19ed('0x7e')](_0x434026,_0x3fc5be)[_0x19ed('0x2c')](function(_0x3ebad1){logger['info'](JSON[_0x19ed('0x40')](_0x3ebad1));var _0x3e1063={'speech':_0x3ebad1['text'],'action':_0x3ebad1[_0x19ed('0x7f')]?_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x80')]:undefined,'actiondata':_0x3ebad1[_0x19ed('0x7f')]?_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x81')]:undefined};if(_0x3ebad1[_0x19ed('0x7f')]&&_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x82')]){return base64Decode(_0x3ebad1[_0x19ed('0x7f')][_0x19ed('0x82')][_0x19ed('0x83')],path[_0x19ed('0x28')](__dirname,_0x19ed('0x29'),rs['generate'](0x4)+_0x19ed('0x37')))['then'](function(_0x4e46fe){_0x3e1063[_0x19ed('0x84')]=_0x4e46fe;return _0x3e1063;});}return _0x3e1063;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index e038611..ddb582e 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 _0xc553=['exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc553,0x172));var _0x3c55=function(_0x310dab,_0x20d5ea){_0x310dab=_0x310dab-0x0;var _0x18cf45=_0xc553[_0x310dab];return _0x18cf45;};var nda=require('./nda');module[_0x3c55('0x0')]={'nda':nda}; \ No newline at end of file +var _0x0a59=['./nda'];(function(_0x59b98f,_0x3f143e){var _0x51f042=function(_0x3019d8){while(--_0x3019d8){_0x59b98f['push'](_0x59b98f['shift']());}};_0x51f042(++_0x3f143e);}(_0x0a59,0xaf));var _0x90a5=function(_0x42119d,_0x21f004){_0x42119d=_0x42119d-0x0;var _0x767ad3=_0x0a59[_0x42119d];return _0x767ad3;};var nda=require(_0x90a5('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index f82ccf0..f4796d5 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 _0x0cee=['ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0cee,0x12f));var _0xe0ce=function(_0x2f2b67,_0x4bc11c){_0x2f2b67=_0x2f2b67-0x0;var _0x220ae3=_0x0cee[_0x2f2b67];return _0x220ae3;};'use strict';var rp=require(_0xe0ce('0x0'));var url=require(_0xe0ce('0x1'));var logger=require(_0xe0ce('0x2'))(_0xe0ce('0x3'));module[_0xe0ce('0x4')]=function(_0x25ec67,_0x54f977){var _0x563553={'method':_0xe0ce('0x5'),'uri':url[_0xe0ce('0x6')](_0x54f977[_0xe0ce('0x7')],_0xe0ce('0x8')),'form':{'grant_type':_0xe0ce('0x9'),'username':_0x54f977[_0xe0ce('0xa')],'password':_0x54f977[_0xe0ce('0x9')]},'json':!![]};return rp(_0x563553)[_0xe0ce('0xb')](function(_0x494eca){var _0x27eea3={'method':_0xe0ce('0x5'),'uri':url['resolve'](_0x54f977[_0xe0ce('0xc')],_0xe0ce('0xd')),'body':{'type':_0x54f977[_0xe0ce('0xe')]||_0xe0ce('0xf'),'channelId':'Nda','conversation':{'id':_0x25ec67['uniqueid']},'from':{'id':_0x25ec67['callerid'],'name':_0x25ec67[_0xe0ce('0x10')]},'recipient':{'id':_0x25ec67[_0xe0ce('0x11')],'name':_0x25ec67[_0xe0ce('0x12')]},'text':_0x54f977[_0xe0ce('0x13')],'channelData':{}},'headers':{'Authorization':_0xe0ce('0x14')+_0x494eca[_0xe0ce('0x15')]},'json':!![]};if(_0x54f977[_0xe0ce('0x16')]){_0x27eea3[_0xe0ce('0x17')][_0xe0ce('0x18')][_0xe0ce('0x19')]=_0x54f977[_0xe0ce('0x16')];}if(_0x54f977[_0xe0ce('0x1a')]=='1'){_0x27eea3['body']['channelData'][_0xe0ce('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe0ce('0x1c')};}if(_0x54f977['custom_action']){_0x27eea3['body'][_0xe0ce('0x18')][_0xe0ce('0x1d')]=_0x54f977[_0xe0ce('0x1e')];if(_0x54f977[_0xe0ce('0x1f')]){_0x27eea3[_0xe0ce('0x17')]['channelData'][_0xe0ce('0x20')]=_0x54f977['custom_action_data'];}}logger[_0xe0ce('0x21')](JSON[_0xe0ce('0x22')](_0x27eea3));return rp(_0x27eea3);});}; \ No newline at end of file +var _0x25a3=['url','../../../../../config/logger','exports','POST','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise'];(function(_0x463070,_0x8ad452){var _0x265b86=function(_0x134491){while(--_0x134491){_0x463070['push'](_0x463070['shift']());}};_0x265b86(++_0x8ad452);}(_0x25a3,0x121));var _0x325a=function(_0x145f0e,_0x4c0ffd){_0x145f0e=_0x145f0e-0x0;var _0x2e41bf=_0x25a3[_0x145f0e];return _0x2e41bf;};'use strict';var rp=require(_0x325a('0x0'));var url=require(_0x325a('0x1'));var logger=require(_0x325a('0x2'))('agi');module[_0x325a('0x3')]=function(_0x50e9ba,_0x46df7b){var _0x3b887a={'method':_0x325a('0x4'),'uri':url['resolve'](_0x46df7b[_0x325a('0x5')],_0x325a('0x6')),'form':{'grant_type':_0x325a('0x7'),'username':_0x46df7b['username'],'password':_0x46df7b['password']},'json':!![]};return rp(_0x3b887a)[_0x325a('0x8')](function(_0x209f5e){var _0x43bd79={'method':_0x325a('0x4'),'uri':url['resolve'](_0x46df7b['ndassistant_url'],_0x325a('0x9')),'body':{'type':_0x46df7b[_0x325a('0xa')]||_0x325a('0xb'),'channelId':_0x325a('0xc'),'conversation':{'id':_0x50e9ba[_0x325a('0xd')]},'from':{'id':_0x50e9ba[_0x325a('0xe')],'name':_0x50e9ba['calleridname']},'recipient':{'id':_0x50e9ba[_0x325a('0xf')],'name':_0x50e9ba[_0x325a('0x10')]},'text':_0x46df7b['text'],'channelData':{}},'headers':{'Authorization':_0x325a('0x11')+_0x209f5e[_0x325a('0x12')]},'json':!![]};if(_0x46df7b[_0x325a('0x13')]){_0x43bd79[_0x325a('0x14')]['channelData']['ProjectName']=_0x46df7b[_0x325a('0x13')];}if(_0x46df7b['ndagenerate_audio']=='1'){_0x43bd79[_0x325a('0x14')][_0x325a('0x15')][_0x325a('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x325a('0x17')};}if(_0x46df7b[_0x325a('0x18')]){_0x43bd79[_0x325a('0x14')][_0x325a('0x15')][_0x325a('0x19')]=_0x46df7b[_0x325a('0x18')];if(_0x46df7b[_0x325a('0x1a')]){_0x43bd79[_0x325a('0x14')][_0x325a('0x15')][_0x325a('0x1b')]=_0x46df7b[_0x325a('0x1a')];}}logger['info'](JSON[_0x325a('0x1c')](_0x43bd79));return rp(_0x43bd79);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index 91a1d40..e05a09a 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 _0x71d4=['exports','./lib/api'];(function(_0x48e4ad,_0x4a8b62){var _0x5c8167=function(_0x1f87e6){while(--_0x1f87e6){_0x48e4ad['push'](_0x48e4ad['shift']());}};_0x5c8167(++_0x4a8b62);}(_0x71d4,0x173));var _0x471d=function(_0x2ff88c,_0x444be2){_0x2ff88c=_0x2ff88c-0x0;var _0x5e3c4d=_0x71d4[_0x2ff88c];return _0x5e3c4d;};'use strict';var asr=require(_0x471d('0x0'));module[_0x471d('0x1')]=function(_0xb6853c,_0x510b4a,_0x17b58b,_0x494cc0){return asr(_0xb6853c,_0x510b4a,_0x17b58b,_0x494cc0);}; \ No newline at end of file +var _0x5e3f=['exports'];(function(_0x1915a8,_0x581c9a){var _0x5e3c96=function(_0x4b8be5){while(--_0x4b8be5){_0x1915a8['push'](_0x1915a8['shift']());}};_0x5e3c96(++_0x581c9a);}(_0x5e3f,0x1f3));var _0xf5e3=function(_0x2b38fd,_0x5dc4b7){_0x2b38fd=_0x2b38fd-0x0;var _0x26fb90=_0x5e3f[_0x2b38fd];return _0x26fb90;};'use strict';var asr=require('./lib/api');module[_0xf5e3('0x0')]=function(_0x25841a,_0x1be14a,_0x12e064,_0x7a7bb){return asr(_0x25841a,_0x1be14a,_0x12e064,_0x7a7bb);}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index 7cdea06..f35e1b0 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 _0xa662=['../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','data','send','close','EOS','error','terminate','parse','final','Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto'];(function(_0x25b213,_0x4706fd){var _0x136413=function(_0x4a6fc9){while(--_0x4a6fc9){_0x25b213['push'](_0x25b213['shift']());}};_0x136413(++_0x4706fd);}(_0xa662,0xc5));var _0x2a66=function(_0x1e9e54,_0x56bf22){_0x1e9e54=_0x1e9e54-0x0;var _0x259995=_0xa662[_0x1e9e54];return _0x259995;};'use strict';var BPromise=require(_0x2a66('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2a66('0x1'));var crypto=require(_0x2a66('0x2'));var logger=require(_0x2a66('0x3'))('agi');module[_0x2a66('0x4')]=function(_0x23a299,_0x43f603,_0x2e37de,_0x36c0e5){return new BPromise(function(_0x5c7699,_0x1ada9d){logger[_0x2a66('0x5')](_0x2a66('0x6'),_0x36c0e5||_0x2a66('0x7'));var _0x505c64=new WebSocket(_0x36c0e5||_0x2a66('0x7'),{'perMessageDeflate':![]});var _0x4e6140='';var _0x3c958a='0';var _0x136f7a='1';var _0x18e107='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x55336b(_0x3f66a1){var _0x5cbbbf=crypto[_0x2a66('0x8')](_0x2a66('0x9'));_0x5cbbbf[_0x2a66('0xa')](_0x3f66a1);return _0x5cbbbf['digest'](_0x2a66('0xb'));}function _0x41d5f0(){try{logger[_0x2a66('0x5')](_0x2a66('0xc'));var _0x3ac10b=moment()[_0x2a66('0xd')]();var _0x3ab6e6=_0x55336b(_0x3ac10b+_0x43f603+_0x2e37de);_0x505c64['send'](JSON[_0x2a66('0xe')]({'appID':_0x43f603,'timestamp':_0x3ac10b,'appKey':_0x3ab6e6}));var _0x1dd70d=fs[_0x2a66('0xf')](_0x23a299);_0x1dd70d['on'](_0x2a66('0x10'),function(_0x5b98ab){_0x505c64[_0x2a66('0x11')](_0x5b98ab);});_0x1dd70d['on'](_0x2a66('0x12'),function(){_0x505c64[_0x2a66('0x11')](_0x2a66('0x13'));});}catch(_0x32ff06){logger[_0x2a66('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x2a66('0xe')](_0x32ff06));_0x505c64[_0x2a66('0x15')]();}}function _0x14c4ef(_0x397380){try{if(_0x397380){var _0x28a94f=JSON[_0x2a66('0x16')](_0x397380);switch(_0x28a94f['status']){case 0x0:if(_0x28a94f['result']){if(_0x28a94f['result'][_0x2a66('0x17')]){logger[_0x2a66('0x5')](_0x2a66('0x18'),JSON['stringify'](_0x28a94f['result']['hypotheses']));_0x4e6140=_0x28a94f[_0x2a66('0x19')][_0x2a66('0x1a')][0x0][_0x2a66('0x1b')];_0x3c958a=_0x28a94f[_0x2a66('0x19')][_0x2a66('0x1a')][0x0][_0x2a66('0x1c')];_0x136f7a='0';_0x18e107=_0x2a66('0x1d');_0x505c64['terminate']();}}break;case 0x1:logger[_0x2a66('0x5')](_0x2a66('0x1e'));_0x136f7a='1';_0x18e107='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x2a66('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x136f7a='2';_0x18e107=_0x2a66('0x1f');break;case 0x9:logger[_0x2a66('0x5')](_0x2a66('0x20'));_0x136f7a='9';_0x18e107='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x2a66('0x21'));_0x136f7a='10';_0x18e107='Authentication\x20failed.';break;case 0xb:logger[_0x2a66('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x136f7a='11';_0x18e107=_0x2a66('0x22');}}}catch(_0x478afd){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0x2a66('0xe')](_0x478afd));_0x505c64['terminate']();}}function _0x1daabb(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x5c7699({'transcript':_0x4e6140,'confidence':_0x3c958a,'status':_0x136f7a,'status_message':_0x18e107});}function _0x16d2c9(_0x50cd2c){logger[_0x2a66('0x14')](_0x2a66('0x23'));if(!_[_0x2a66('0x24')](_0x50cd2c)){logger[_0x2a66('0x14')](_[_0x2a66('0x25')](_0x50cd2c)?JSON[_0x2a66('0xe')](_0x50cd2c):_0x50cd2c);}}_0x505c64['on'](_0x2a66('0x26'),_0x41d5f0);_0x505c64['on'](_0x2a66('0x27'),_0x14c4ef);_0x505c64['on'](_0x2a66('0x12'),_0x1daabb);_0x505c64['on']('error',_0x16d2c9);});}; \ No newline at end of file +var _0xda2c=['parse','status','result','final','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0xda2c,0x1e0));var _0xcda2=function(_0x551f98,_0x4b4d12){_0x551f98=_0x551f98-0x0;var _0x45e16b=_0xda2c[_0x551f98];return _0x45e16b;};'use strict';var BPromise=require(_0xcda2('0x0'));var _=require(_0xcda2('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xcda2('0x2'));var logger=require('../../../../../../config/logger')(_0xcda2('0x3'));module[_0xcda2('0x4')]=function(_0x7f699f,_0x13f2e9,_0x5dd58e,_0x124f15){return new BPromise(function(_0x574b59,_0x1c5eea){logger[_0xcda2('0x5')](_0xcda2('0x6'),_0x124f15||_0xcda2('0x7'));var _0x405890=new WebSocket(_0x124f15||_0xcda2('0x7'),{'perMessageDeflate':![]});var _0x4ca872='';var _0x1551ba='0';var _0x3aff41='1';var _0x5d370c=_0xcda2('0x8');function _0x2ea7cb(_0x2e1735){var _0x3fe651=crypto[_0xcda2('0x9')](_0xcda2('0xa'));_0x3fe651[_0xcda2('0xb')](_0x2e1735);return _0x3fe651['digest'](_0xcda2('0xc'));}function _0x3a693a(){try{logger[_0xcda2('0x5')](_0xcda2('0xd'));var _0x4c2b7a=moment()[_0xcda2('0xe')]();var _0x23ba91=_0x2ea7cb(_0x4c2b7a+_0x13f2e9+_0x5dd58e);_0x405890[_0xcda2('0xf')](JSON[_0xcda2('0x10')]({'appID':_0x13f2e9,'timestamp':_0x4c2b7a,'appKey':_0x23ba91}));var _0x5c6f21=fs[_0xcda2('0x11')](_0x7f699f);_0x5c6f21['on'](_0xcda2('0x12'),function(_0x1a53e9){_0x405890[_0xcda2('0xf')](_0x1a53e9);});_0x5c6f21['on'](_0xcda2('0x13'),function(){_0x405890[_0xcda2('0xf')](_0xcda2('0x14'));});}catch(_0x34a024){logger[_0xcda2('0x15')](_0xcda2('0x16'),JSON[_0xcda2('0x10')](_0x34a024));_0x405890[_0xcda2('0x17')]();}}function _0x10c64c(_0x493f65){try{if(_0x493f65){var _0x1b5843=JSON[_0xcda2('0x18')](_0x493f65);switch(_0x1b5843[_0xcda2('0x19')]){case 0x0:if(_0x1b5843[_0xcda2('0x1a')]){if(_0x1b5843[_0xcda2('0x1a')][_0xcda2('0x1b')]){logger[_0xcda2('0x5')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x1b5843['result'][_0xcda2('0x1c')]));_0x4ca872=_0x1b5843[_0xcda2('0x1a')][_0xcda2('0x1c')][0x0][_0xcda2('0x1d')];_0x1551ba=_0x1b5843[_0xcda2('0x1a')][_0xcda2('0x1c')][0x0][_0xcda2('0x1e')];_0x3aff41='0';_0x5d370c=_0xcda2('0x1f');_0x405890['terminate']();}}break;case 0x1:logger[_0xcda2('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x3aff41='1';_0x5d370c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xcda2('0x5')](_0xcda2('0x20'));_0x3aff41='2';_0x5d370c=_0xcda2('0x20');break;case 0x9:logger[_0xcda2('0x5')](_0xcda2('0x21'));_0x3aff41='9';_0x5d370c=_0xcda2('0x21');break;case 0xa:logger[_0xcda2('0x5')](_0xcda2('0x22'));_0x3aff41='10';_0x5d370c='Authentication\x20failed.';break;case 0xb:logger[_0xcda2('0x5')](_0xcda2('0x23'));_0x3aff41='11';_0x5d370c=_0xcda2('0x23');}}}catch(_0x27c6ea){logger[_0xcda2('0x15')](_0xcda2('0x24'),JSON[_0xcda2('0x10')](_0x27c6ea));_0x405890[_0xcda2('0x17')]();}}function _0x268256(){logger['info'](_0xcda2('0x25'));_0x574b59({'transcript':_0x4ca872,'confidence':_0x1551ba,'status':_0x3aff41,'status_message':_0x5d370c});}function _0x596871(_0x4a5f80){logger[_0xcda2('0x15')](_0xcda2('0x26'));if(!_['isNil'](_0x4a5f80)){logger[_0xcda2('0x15')](_[_0xcda2('0x27')](_0x4a5f80)?JSON[_0xcda2('0x10')](_0x4a5f80):_0x4a5f80);}}_0x405890['on'](_0xcda2('0x28'),_0x3a693a);_0x405890['on'](_0xcda2('0x29'),_0x10c64c);_0x405890['on'](_0xcda2('0x13'),_0x268256);_0x405890['on'](_0xcda2('0x15'),_0x596871);});}; \ No newline at end of file diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 785ea1d..10cb4be 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 _0x4a80=['exports','./asr'];(function(_0x3205a6,_0x177082){var _0x2e7a05=function(_0x16c54a){while(--_0x16c54a){_0x3205a6['push'](_0x3205a6['shift']());}};_0x2e7a05(++_0x177082);}(_0x4a80,0x175));var _0x04a8=function(_0x11c632,_0x37a6d1){_0x11c632=_0x11c632-0x0;var _0x552909=_0x4a80[_0x11c632];return _0x552909;};var asr=require(_0x04a8('0x0'));module[_0x04a8('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4e3fef3..1432987 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 _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x3cb86b,_0x3c75f6){var _0x3c10a0=function(_0x71331f){while(--_0x71331f){_0x3cb86b['push'](_0x3cb86b['shift']());}};_0x3c10a0(++_0x3c75f6);}(_0xe706,0xa3));var _0x6e70=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xe706[_0x5e42a7];return _0x36d21b;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x31abee,_0x11ff0c){var _0x3c1761=function(_0x2b5062){while(--_0x2b5062){_0x31abee['push'](_0x31abee['shift']());}};_0x3c1761(++_0x11ff0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0f858f9..771ea6b 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 _0xc978=['Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','test','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','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','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','operation','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','failure','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','XMCS-UNIQUEID','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','replaceAll','join','exports','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getTrunk','getSound','getSoundById','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','calleridname','extension','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','callerid','agentLogout','agentLogin','internal','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','PUT','toUpperCase','body','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','tildeASR','appid','appsecret','uri','clear','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','retry','mrcpsynth','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var util=require(_0x8c97('0x0'));var _=require(_0x8c97('0x1'));var sh=require(_0x8c97('0x2'));var odbc=require(_0x8c97('0x3'))();var rs=require(_0x8c97('0x4'));var moment=require(_0x8c97('0x5'));var Mustache=require('mustache');var rp=require(_0x8c97('0x6'));var logger=require(_0x8c97('0x7'))(_0x8c97('0x8'));var config=require(_0x8c97('0x9'));var scripts=require(_0x8c97('0xa'));var FILES_PATH=_0x8c97('0xb');var recursiveMapAttributes=[_0x8c97('0xc'),'rawBody'];var verticesWithRetry=[_0x8c97('0xd'),_0x8c97('0xe'),_0x8c97('0xf')];var AGIVertices=function(_0x26ff40,_0x12116e,_0x2be0b3){this[_0x8c97('0x10')]=_0x26ff40;this['rpc']=_0x12116e;this[_0x8c97('0x11')]=_0x2be0b3;};AGIVertices[_0x8c97('0x12')][_0x8c97('0x13')]=function(_0x3a34b2,_0x400eb6){this[_0x8c97('0x14')][_0x8c97('0x15')](_0x3a34b2)[_0x8c97('0x16')](function(_0x36a84b){_0x400eb6(null,_0x36a84b?_0x36a84b['name']:![]);})[_0x8c97('0x17')](function(_0x346274){_0x400eb6(_0x346274);});};AGIVertices['prototype'][_0x8c97('0x18')]=function(_0x34be9b,_0x4c6227){this[_0x8c97('0x14')]['getVoiceQueueById'](_0x34be9b)['then'](function(_0x57902c){_0x4c6227(null,_0x57902c?_0x57902c[_0x8c97('0x19')]:![]);})[_0x8c97('0x17')](function(_0x17065f){_0x4c6227(_0x17065f);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x1a')]=function(_0x29767b,_0x1ea67f){this[_0x8c97('0x14')][_0x8c97('0x1b')](_0x29767b)['then'](function(_0x3d9c35){_0x1ea67f(null,_0x3d9c35?_0x3d9c35[_0x8c97('0x19')]:![]);})[_0x8c97('0x17')](function(_0x3b57ed){_0x1ea67f(_0x3b57ed);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x1c')]=function(_0xb502e7,_0x400bbc){this[_0x8c97('0x14')][_0x8c97('0x1d')](_0xb502e7)[_0x8c97('0x16')](function(_0xb55f9b){_0x400bbc(null,_0xb55f9b?_0xb55f9b[_0x8c97('0x1e')]:![]);})[_0x8c97('0x17')](function(_0x3ea5a3){_0x400bbc(_0x3ea5a3);});};AGIVertices[_0x8c97('0x12')]['getUser']=function(_0x33a9a8,_0x29b396){this[_0x8c97('0x14')]['getUserById'](_0x33a9a8)['then'](function(_0xe5268d){_0x29b396(null,_0xe5268d?_0xe5268d['name']:![]);})[_0x8c97('0x17')](function(_0x1f2dd5){_0x29b396(_0x1f2dd5);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x1f')]=function(_0x354251,_0x42464a){this[_0x8c97('0x14')]['getTrunkById'](_0x354251)['then'](function(_0x3804d0){_0x42464a(null,_0x3804d0?_0x3804d0[_0x8c97('0x19')]:![]);})[_0x8c97('0x17')](function(_0x50d003){_0x42464a(_0x50d003);});};AGIVertices['prototype'][_0x8c97('0x20')]=function(_0x37986d,_0x34095){var _0x1609de=this;this[_0x8c97('0x14')][_0x8c97('0x21')](_0x37986d)['then'](function(_0x443dfd){_0x34095(null,_0x443dfd?_0x1609de['getSoundPath'](_0x443dfd[_0x8c97('0x22')]):![]);})['catch'](function(_0x245d15){_0x34095(_0x245d15);});};AGIVertices[_0x8c97('0x12')]['getMailAccount']=function(_0x3da4fc,_0x57fef8){this[_0x8c97('0x14')][_0x8c97('0x23')](_0x3da4fc)[_0x8c97('0x16')](function(_0x2ebba4){_0x57fef8(null,_0x2ebba4?_0x2ebba4:![]);})[_0x8c97('0x17')](function(_0x3644dd){_0x57fef8(_0x3644dd);});};AGIVertices['prototype']['sendMailMessage']=function(_0x12a7d0,_0x26d5dc,_0x2575d0){this['mailRpc'][_0x8c97('0x24')](_0x12a7d0,_0x26d5dc)['then'](function(){_0x2575d0(null);})['catch'](function(_0x27f76d){_0x2575d0(_0x27f76d);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x25')]=function(_0x1ff954,_0x1e5751){this[_0x8c97('0x14')]['getIntervalById'](_0x1ff954)[_0x8c97('0x16')](function(_0x3168ba){if(_0x3168ba){if(_0x3168ba[_0x8c97('0x26')]){_0x1e5751(null,[_0x3168ba[_0x8c97('0x27')]]);}else{_0x1e5751(null,_[_0x8c97('0x28')](_0x3168ba[_0x8c97('0x29')],_0x8c97('0x27')));}}else{_0x1e5751(null,![]);}})[_0x8c97('0x17')](function(_0x5e16d6){_0x1e5751(_0x5e16d6);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x2a')]=function(_0x2e07e6){return util[_0x8c97('0x2b')](_0x8c97('0x2c'),FILES_PATH,_0x2e07e6);};AGIVertices[_0x8c97('0x12')]['getQueryOdbc']=function(_0x473d52,_0x441612,_0x2beaaf){odbc[_0x8c97('0x2d')](_0x473d52,function(_0x19045e){if(_0x19045e){logger[_0x8c97('0x2e')](_0x8c97('0x2f'),_0x19045e);_0x2beaaf(_0x19045e);}else{logger[_0x8c97('0x30')](_0x8c97('0x31'));odbc['query'](_0x441612,function(_0x20fe2f,_0x3bcce3){if(_0x20fe2f){logger[_0x8c97('0x30')](_0x8c97('0x32'),_0x441612);_0x2beaaf(_0x20fe2f);}else{logger[_0x8c97('0x30')](_0x8c97('0x33'),_0x441612);odbc['close'](function(_0x20b9c3){if(_0x20b9c3){logger[_0x8c97('0x2e')](_0x8c97('0x34'),_0x20b9c3);}_0x2beaaf(null,_0x3bcce3);});}});}});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x35')]=function(_0x4374c5,_0x1e3719){this[_0x8c97('0x14')][_0x8c97('0x36')](_0x4374c5)[_0x8c97('0x16')](function(_0x3220b7){_0x1e3719(null,_0x3220b7?_0x3220b7:![]);})[_0x8c97('0x17')](function(_0x3b41f6){_0x1e3719(_0x3b41f6);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x37')]=function(_0xdd2417,_0x44f204){this[_0x8c97('0x14')][_0x8c97('0x37')](_0xdd2417)[_0x8c97('0x16')](function(_0x4cf496){_0x44f204(null,_0x4cf496);})[_0x8c97('0x17')](function(_0x340060){_0x44f204(_0x340060);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x38')]=function(_0x35a230,_0x30da94,_0x541c69){this[_0x8c97('0x14')][_0x8c97('0x38')]({'uniqueid':this[_0x8c97('0x10')][_0x8c97('0x39')],'node':_0x35a230[_0x8c97('0x3a')],'application':_0x35a230[_0x8c97('0x3b')],'data':_0x30da94||null,'project_name':this[_0x8c97('0x10')][_0x8c97('0x3c')],'callerid':this[_0x8c97('0x10')]['callerid']})[_0x8c97('0x16')](function(_0x1a69fe){if(_0x541c69){_0x541c69(null,_0x1a69fe);}})[_0x8c97('0x17')](function(_0x42c0e0){if(_0x541c69){_0x541c69(_0x42c0e0);}});};AGIVertices[_0x8c97('0x12')]['createSquareRecording']=function(_0x50e565,_0x13bec2,_0x5b505b,_0x3039b9){this[_0x8c97('0x14')]['createSquareRecording']({'uniqueid':this[_0x8c97('0x10')][_0x8c97('0x39')],'callerid':this['channel']['callerid'],'calleridname':this[_0x8c97('0x10')][_0x8c97('0x3d')],'context':this['channel']['context'],'extension':this['channel'][_0x8c97('0x3e')],'priority':this['channel']['priority'],'accountcode':this[_0x8c97('0x10')][_0x8c97('0x3f')],'dnid':this[_0x8c97('0x10')][_0x8c97('0x40')],'projectName':this[_0x8c97('0x10')][_0x8c97('0x3c')],'saveName':_0x13bec2,'filename':_0x50e565['file']||_0x13bec2,'savePath':_0x5b505b})[_0x8c97('0x16')](function(_0x3703eb){_0x3039b9(null,_0x3703eb);})[_0x8c97('0x17')](function(_0x451d61){_0x3039b9(_0x451d61);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x41')]=function(_0x431e0f,_0x15d0ab,_0x460261,_0x1147f9,_0x478390){this[_0x8c97('0x14')][_0x8c97('0x41')]({'uniqueid':this['channel'][_0x8c97('0x39')],'body':_0x431e0f,'direction':_0x15d0ab,'providerName':_0x460261,'providerResponse':_0x1147f9})[_0x8c97('0x16')](function(_0x35d935){if(_0x478390){_0x478390(null,_0x35d935);}})[_0x8c97('0x17')](function(_0x1252e1){if(_0x478390){_0x478390(_0x1252e1);}});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x42')]=function(_0x428a51,_0x3c4b55){this[_0x8c97('0x14')][_0x8c97('0x42')]({'firstName':_[_0x8c97('0x43')](_0x428a51['name'])||_[_0x8c97('0x44')](_0x428a51[_0x8c97('0x19')])?_0x8c97('0x45')+Math['random']():_0x428a51['name'],'lastName':_[_0x8c97('0x43')](_0x428a51['lastName'])||_[_0x8c97('0x44')](_0x428a51[_0x8c97('0x46')])?null:_0x428a51[_0x8c97('0x46')],'phone':_0x428a51[_0x8c97('0x47')],'ListId':_0x428a51[_0x8c97('0x48')],'scheduledat':_0x428a51[_0x8c97('0x49')],'callbackUniqueid':this[_0x8c97('0x10')][_0x8c97('0x39')],'tags':'callback','description':_0x8c97('0x4a')+_0x428a51[_0x8c97('0x49')][_0x8c97('0x4b')](),'priority':_0x428a51[_0x8c97('0x4c')]})['then'](function(_0x2440fd){_0x3c4b55(null,_0x2440fd);})['catch'](function(_0x5b5f3f){_0x3c4b55(_0x5b5f3f);});};AGIVertices['prototype'][_0x8c97('0x4d')]=function(_0x53b5e7,_0xe84472){this[_0x8c97('0x14')][_0x8c97('0x4e')](_0x53b5e7)[_0x8c97('0x16')](function(_0x30ff13){_0xe84472(null,_0x30ff13?_0x30ff13[_0x8c97('0x19')]:![]);})[_0x8c97('0x17')](function(_0x1ac60e){_0xe84472(_0x1ac60e);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x4f')]=function(_0x4ad6bd,_0x5bf9ae,_0x3e5186){var _0x48c9d7={'role':_0x8c97('0x50')};_0x48c9d7[_0x4ad6bd]=this['channel']['callerid'];this[_0x8c97('0x14')][_0x8c97('0x4f')](_0x48c9d7,_0x5bf9ae,this['channel']['uniqueid'])[_0x8c97('0x16')](function(_0x345e27){_0x3e5186(null,_[_0x8c97('0x44')](_0x345e27)?![]:!![]);})[_0x8c97('0x17')](function(_0x583527){logger[_0x8c97('0x2e')](_0x583527);_0x3e5186(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x3d9f53,_0x5485b0){var _0x315fc9={'role':_0x8c97('0x50')};_0x315fc9[_0x3d9f53]=this[_0x8c97('0x10')][_0x8c97('0x51')];this[_0x8c97('0x14')]['agentUnpause'](_0x315fc9)[_0x8c97('0x16')](function(_0x2f92df){_0x5485b0(null,_['isNil'](_0x2f92df)?![]:!![]);})[_0x8c97('0x17')](function(_0x29b90a){logger['error'](_0x29b90a);_0x5485b0(null,![]);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x52')]=function(_0x10f97d,_0x37b41a){var _0x55452e={'role':'agent'};_0x55452e[_0x10f97d]=this[_0x8c97('0x10')]['callerid'];this[_0x8c97('0x14')]['agentLogout'](_0x55452e)[_0x8c97('0x16')](function(_0x32ebca){_0x37b41a(null,_[_0x8c97('0x44')](_0x32ebca)?![]:!![]);})[_0x8c97('0x17')](function(_0xb3a9e7){logger[_0x8c97('0x2e')](_0xb3a9e7);_0x37b41a(null,![]);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x53')]=function(_0x13b923,_0x5da113){var _0x16ecda={'role':_0x8c97('0x50')};_0x16ecda[_0x13b923]=this[_0x8c97('0x10')][_0x8c97('0x51')];var _0x17cd47=_0x13b923!=_0x8c97('0x54')?util[_0x8c97('0x2b')]('%s/%s@from-sip/n','LOCAL',this[_0x8c97('0x10')][_0x8c97('0x51')]):undefined;this[_0x8c97('0x14')][_0x8c97('0x53')](_0x16ecda,_0x17cd47)['then'](function(_0x43e81a){_0x5da113(null,_['isNil'](_0x43e81a)?![]:!![]);})[_0x8c97('0x17')](function(_0x36d7e8){logger[_0x8c97('0x2e')](_0x36d7e8);_0x5da113(null,![]);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x55')]=function(_0x1b0f58,_0x1dc1c4){sh[_0x8c97('0x56')](_[_0x8c97('0x57')](_0x1b0f58),function(_0x546847,_0x44e8d8){var _0x917baf=_0x44e8d8[_0x8c97('0x58')](/(\r\n|\n|\r)/gm,'');_0x1dc1c4(null,_0x917baf);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x59')]=function(_0x371cdf,_0x5edf01){scripts[_0x8c97('0x59')](_0x371cdf['apiKey'],_0x371cdf[_0x8c97('0x5a')]||'text',_0x371cdf[_0x8c97('0x5b')],_0x371cdf[_0x8c97('0x5c')]||_0x8c97('0x5d'),_0x371cdf[_0x8c97('0x5e')]||'MALE',_0x371cdf[_0x8c97('0x5f')]||'MP3')['then'](function(_0x5ed38c){_0x5edf01(null,_0x5ed38c);})['catch'](function(_0x9d4290){_0x5edf01(_0x9d4290);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x60')]=function(_0x79a956,_0x1804ce){scripts['googleTTS'](_0x79a956['text'],_0x79a956[_0x8c97('0x61')]||'en',0x1)[_0x8c97('0x16')](function(_0x3572a0){_0x1804ce(null,_0x3572a0);})[_0x8c97('0x17')](function(_0x1f83fe){_0x1804ce(_0x1f83fe);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x62')]=function(_0x15fc3b,_0x5c2e61){var _0x4eb51d={'uri':_0x15fc3b['url'],'method':_0x15fc3b[_0x8c97('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x15fc3b[_0x8c97('0x64')])===_0x8c97('0x65')&&parseInt(_0x15fc3b[_0x8c97('0x64')])>=0x1?parseInt(_0x15fc3b['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x8c97('0x66')](['POST',_0x8c97('0x67')],_0x4eb51d['method'][_0x8c97('0x68')]())){try{_0x4eb51d[_0x8c97('0x69')]=_0x15fc3b['rawBody']?JSON[_0x8c97('0x6a')](_0x15fc3b[_0x8c97('0x6b')]):{};}catch(_0x1e3c6c){logger[_0x8c97('0x2e')](_0x8c97('0x6c'),_0x1e3c6c);}}try{_0x4eb51d[_0x8c97('0x6d')]=_0x15fc3b[_0x8c97('0xc')]?JSON['parse'](_0x15fc3b[_0x8c97('0xc')]):{};}catch(_0x1d8ad6){logger[_0x8c97('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1d8ad6);}if(_0x15fc3b[_0x8c97('0x6e')]){try{var _0x105d97=require(_0x15fc3b[_0x8c97('0x6e')])[_0x8c97('0x6f')](this,_0x4eb51d);_0x4eb51d['uri']=Mustache[_0x8c97('0x70')](_0x15fc3b[_0x8c97('0x71')],_0x105d97,{},['$$','$$']);if(_0x4eb51d[_0x8c97('0x6d')]){_0x4eb51d['headers']=JSON['parse'](Mustache[_0x8c97('0x70')](JSON[_0x8c97('0x72')](_0x4eb51d[_0x8c97('0x6d')]),_0x105d97,{},['$$','$$']));}if(_0x4eb51d[_0x8c97('0x69')]){_0x4eb51d[_0x8c97('0x69')]=JSON[_0x8c97('0x6a')](Mustache[_0x8c97('0x70')](JSON[_0x8c97('0x72')](_0x4eb51d['body']),_0x105d97,{},['$$','$$']));}}catch(_0x57274e){logger[_0x8c97('0x2e')](_0x8c97('0x73'),_0x57274e);}}rp(_0x4eb51d)['then'](function(_0x969c33){var _0x4694a9={'statusCode':_0x969c33[_0x8c97('0x74')]||0xc8,'statusMessage':_0x969c33['statusMessage']||'OK','headers':_0x969c33['headers']||{},'body':_0x969c33[_0x8c97('0x69')]||{}};_0x5c2e61(null,_0x4694a9);})[_0x8c97('0x17')](function(_0x48517d){var _0x132595={'statusCode':_0x48517d[_0x8c97('0x74')]||0x1f4,'statusMessage':_0x48517d[_0x8c97('0x75')]||_0x8c97('0x76'),'headers':_0x48517d[_0x8c97('0x77')][_0x8c97('0x6d')]||{},'body':_0x48517d['options'][_0x8c97('0x69')]||{}};_0x5c2e61(null,_0x132595);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x78')]=function(_0x5a3678,_0x5ec529){scripts[_0x8c97('0x78')](this[_0x8c97('0x10')][_0x8c97('0x39')],_0x5a3678['key'],_0x5a3678['text'],_0x5a3678[_0x8c97('0x79')]||'en')[_0x8c97('0x16')](function(_0x301ea3){_0x5ec529(null,_0x301ea3);})['catch'](function(_0x2b95c0){_0x5ec529(_0x2b95c0);});};AGIVertices['prototype'][_0x8c97('0x7a')]=function(_0x51d6d2,_0x502f7e){scripts[_0x8c97('0x7a')](this[_0x8c97('0x10')][_0x8c97('0x39')],_0x51d6d2[_0x8c97('0x7b')],_0x51d6d2[_0x8c97('0x7c')],_0x51d6d2[_0x8c97('0x7d')],_0x51d6d2[_0x8c97('0x5b')],_0x51d6d2[_0x8c97('0x7e')]||'en')[_0x8c97('0x16')](function(_0x4a8a3b){_0x502f7e(null,_0x4a8a3b);})[_0x8c97('0x17')](function(_0xc5ee2d){_0x502f7e(_0xc5ee2d);});};AGIVertices['prototype']['sestekNDA']=function(_0x2f72db,_0x33b02c){scripts[_0x8c97('0x7f')](this[_0x8c97('0x10')],_0x2f72db)[_0x8c97('0x16')](function(_0xb76642){_0x33b02c(null,_0xb76642);})[_0x8c97('0x17')](function(_0x12a6c9){_0x33b02c(_0x12a6c9);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x80')]=function(_0x426399,_0x1d91bc){scripts['ispeechTTS'](_0x426399[_0x8c97('0x81')],_0x426399[_0x8c97('0x5b')],_0x426399[_0x8c97('0x82')]||_0x8c97('0x5d'),_0x426399[_0x8c97('0x83')])[_0x8c97('0x16')](function(_0x3ee7eb){_0x1d91bc(null,_0x3ee7eb);})[_0x8c97('0x17')](function(_0x519788){_0x1d91bc(_0x519788);});};AGIVertices['prototype'][_0x8c97('0x84')]=function(_0x23b8bf,_0x4b5bac,_0xff547f){scripts[_0x8c97('0x84')](_0x4b5bac,_0x23b8bf[_0x8c97('0x81')],_0x23b8bf[_0x8c97('0x85')]||_0x8c97('0x5d'),this[_0x8c97('0x86')](_0x23b8bf[_0x8c97('0x87')])?_0x23b8bf[_0x8c97('0x87')]:undefined)[_0x8c97('0x16')](function(_0x25fabd){_0xff547f(null,_0x25fabd);})[_0x8c97('0x17')](function(_0xb1f550){_0xff547f(_0xb1f550);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x88')]=function(_0x180df4,_0x4b2cc8){scripts[_0x8c97('0x88')](_0x180df4[_0x8c97('0x89')],_0x180df4[_0x8c97('0x8a')],_0x180df4['aws_polly_region'],_0x180df4[_0x8c97('0x8b')]||'Amy',_0x180df4['text'],_0x180df4['aws_text_type']||'text')[_0x8c97('0x16')](function(_0xc478a3){_0x4b2cc8(null,_0xc478a3);})[_0x8c97('0x17')](function(_0x5a95f6){_0x4b2cc8(_0x5a95f6);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x8c')]=function(_0x242da3,_0x57df4b){scripts[_0x8c97('0x8c')](this[_0x8c97('0x10')][_0x8c97('0x39')],_0x242da3[_0x8c97('0x89')],_0x242da3[_0x8c97('0x8a')],_0x242da3[_0x8c97('0x8d')],_0x242da3[_0x8c97('0x5b')],_0x242da3[_0x8c97('0x8e')])[_0x8c97('0x16')](function(_0x2faf32){_0x57df4b(null,_0x2faf32);})['catch'](function(_0x21292b){_0x57df4b(_0x21292b);});};AGIVertices[_0x8c97('0x12')]['googleASR']=function(_0x238038,_0x43debf,_0xed8d5c){scripts['googleASR'](_0x43debf,_0x238038[_0x8c97('0x81')],_0x238038['google_asr_language']||_0x8c97('0x5d'))[_0x8c97('0x16')](function(_0x2c7af6){_0xed8d5c(null,_0x2c7af6);})[_0x8c97('0x17')](function(_0xae164d){_0xed8d5c(_0xae164d);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x8f')]=function(_0x3654a9,_0x4c254a,_0x2f36f5){scripts[_0x8c97('0x8f')](_0x4c254a,_0x3654a9[_0x8c97('0x90')],_0x3654a9[_0x8c97('0x91')],_0x3654a9[_0x8c97('0x92')])[_0x8c97('0x16')](function(_0x4beb4d){_0x2f36f5(null,_0x4beb4d);})['catch'](function(_0x2dfed9){_0x2f36f5(_0x2dfed9);});};AGIVertices[_0x8c97('0x12')][_0x8c97('0x93')]=function(_0x5b7dd6){var _0x2c8979=_['includes'](verticesWithRetry,_0x5b7dd6[_0x8c97('0x3b')])?_0x5b7dd6:_['clone'](_0x5b7dd6);for(var _0x48f47e in _0x2c8979){if(_0x2c8979['hasOwnProperty'](_0x48f47e)){if(_0x2c8979[_0x48f47e]&&_[_0x8c97('0x94')](_0x2c8979[_0x48f47e])){if(_['includes'](recursiveMapAttributes,_0x48f47e)){_0x2c8979[_0x48f47e]=this[_0x8c97('0x95')](_0x2c8979[_0x48f47e]);}else{_0x2c8979[_0x48f47e]=this[_0x8c97('0x96')](_0x2c8979[_0x48f47e]);}}}}return _0x2c8979;};AGIVertices[_0x8c97('0x12')][_0x8c97('0x97')]=function(_0x38aca5){for(var _0x48bb64 in _0x38aca5){if(_0x38aca5[_0x8c97('0x98')](_0x48bb64)){if(_[_0x8c97('0x99')](_0x38aca5[_0x48bb64])){this[_0x8c97('0x97')](_0x38aca5[_0x48bb64]);}else if(_[_0x8c97('0x9a')](_0x38aca5[_0x48bb64])){for(var _0x4926d6=0x0;_0x4926d6<_0x38aca5[_0x48bb64][_0x8c97('0x9b')];_0x4926d6++){this[_0x8c97('0x97')](_0x38aca5[_0x48bb64][_0x4926d6]);}}else if(_['isString'](_0x38aca5[_0x48bb64])){_0x38aca5[_0x48bb64]=this[_0x8c97('0x96')](_0x38aca5[_0x48bb64]);}}}};AGIVertices[_0x8c97('0x12')][_0x8c97('0x9c')]=function(_0xf5cce3,_0x108dc8){for(var _0x50ed2b in _0xf5cce3){if(_0xf5cce3[_0x8c97('0x98')](_0x50ed2b)){if(_['isPlainObject'](_0xf5cce3[_0x50ed2b])){if(!_[_0x8c97('0x43')](_0xf5cce3[_0x50ed2b])){this['saveRestApiResult'](_0xf5cce3[_0x50ed2b],util[_0x8c97('0x2b')](_0x8c97('0x9d'),_0x108dc8,_0x50ed2b));}}else if(_[_0x8c97('0x9a')](_0xf5cce3[_0x50ed2b])){for(var _0x410886=0x0;_0x410886<_0xf5cce3[_0x50ed2b][_0x8c97('0x9b')];_0x410886++){this[_0x8c97('0x9c')](_0xf5cce3[_0x50ed2b][_0x410886],util['format'](_0x8c97('0x9d'),_0x108dc8,_0x50ed2b+'['+_0x410886+']'));}}else{if(!_[_0x8c97('0x44')](_0xf5cce3[_0x50ed2b])){this['channel'][_0x8c97('0x9e')](util[_0x8c97('0x2b')]('%s.%s',_0x108dc8,_0x50ed2b),_0xf5cce3[_0x50ed2b]);}}}}};AGIVertices[_0x8c97('0x12')]['replaceObjectAllVariables']=function(_0x275439){try{var _0x5ca8ca=JSON[_0x8c97('0x6a')](_0x275439);this['recursiveNodeIndex'](_0x5ca8ca);return JSON['stringify'](_0x5ca8ca);}catch(_0x3817b1){return this['replaceAllVariables'](_0x275439);}};AGIVertices[_0x8c97('0x12')][_0x8c97('0x96')]=function(_0x56fa28){var _0x52f714=_0x56fa28[_0x8c97('0x9f')]('{');for(var _0x4b7f97=0x1;_0x4b7f97<_0x52f714[_0x8c97('0x9b')];_0x4b7f97+=0x1){var _0x3a2396=_0x52f714[_0x4b7f97]['split']('}');if(_0x3a2396[_0x8c97('0x9b')]>0x1){_0x56fa28=_0x56fa28['replaceAll']('{'+_0x3a2396[0x0]+'}',this['channel'][_0x8c97('0x13')](_0x3a2396[0x0])['extra']||_0x3a2396[0x0]);}}if(_0x52f714[_0x8c97('0x9b')]===0x1){return _0x56fa28[_0x8c97('0x4b')]();}return this['replaceAllVariables'](_0x56fa28);};AGIVertices[_0x8c97('0x12')][_0x8c97('0xa0')]=function(_0x3b1907,_0x3608ba){var _0x2f1ccc=this[_0x8c97('0x10')][_0x8c97('0x13')](_0x3b1907);if(_0x2f1ccc[_0x8c97('0xa1')]===-0x1){return _0x2f1ccc;}logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0xa2'),_0x3608ba,_0x2f1ccc[_0x8c97('0xa3')]));return this[_0x8c97('0x10')][_0x8c97('0x9e')](_0x3608ba,_0x2f1ccc[_0x8c97('0xa3')]);};AGIVertices['prototype'][_0x8c97('0x86')]=function(_0x10cd3e){return _0x10cd3e&&_0x10cd3e!=='0'&&_0x10cd3e!=='-1'&&_0x10cd3e!=='';};AGIVertices['prototype']['maxRetry']=function(_0x5b1391){this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x5b1391,'-');_0x5b1391[_0x8c97('0xa4')]=_0x5b1391['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x8c97('0x12')][_0x8c97('0xa5')]=function(_0x41ba9a){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x41ba9a[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x41ba9a[_0x8c97('0x5b')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')]('no\x20text\x20configured');}var _0x3ae8b9='\x22'+_0x41ba9a[_0x8c97('0x5b')]+'\x22';if(this[_0x8c97('0x86')](_0x41ba9a[_0x8c97('0x77')])){_0x3ae8b9+=','+_0x41ba9a['options'];}var _0x446df3=this[_0x8c97('0x10')][_0x8c97('0x56')](_0x8c97('0xa7'),_0x3ae8b9);if(_0x446df3[_0x8c97('0xa1')]===-0x1){return _0x446df3;}return this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3ae8b9));};AGIVertices[_0x8c97('0x12')][_0x8c97('0xa8')]=function(_0x158dd9){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0xa9'),_0x158dd9[_0x8c97('0x3a')]));if(!this['isConfigured'](_0x158dd9[_0x8c97('0xaa')])){return this['channel'][_0x8c97('0xa6')](_0x8c97('0xab'));}var _0x561388=_0x158dd9['grammar'];if(this['isConfigured'](_0x158dd9[_0x8c97('0x77')])){_0x561388+=','+_0x158dd9['options'];}var _0x1ada0d=this[_0x8c97('0x10')]['exec']('MRCPRecog',_0x561388);if(_0x1ada0d[_0x8c97('0xa1')]===-0x1){return _0x1ada0d;}var _0x299d58=this[_0x8c97('0xa0')](_0x8c97('0xac'),_0x8c97('0xad'));if(_0x299d58[_0x8c97('0xa1')]===-0x1){return _0x299d58;}var _0x29f39e=this[_0x8c97('0xa0')](_0x8c97('0xae'),_0x8c97('0xaf'));if(_0x29f39e[_0x8c97('0xa1')]===-0x1){return _0x29f39e;}var _0x405159=this[_0x8c97('0xa0')](_0x8c97('0xb0'),_0x8c97('0xb1'));if(_0x405159[_0x8c97('0xa1')]===-0x1){return _0x405159;}return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xb2'),_0x561388));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x8')]=function(_0x54c9ef){logger['info'](util['format'](_0x8c97('0xb3'),_0x54c9ef[_0x8c97('0x3a')]));return this[_0x8c97('0x10')][_0x8c97('0x8')]([_0x54c9ef['command'],_0x54c9ef[_0x8c97('0xb4')]]);};AGIVertices[_0x8c97('0x12')]['answer']=function(_0x203620){logger[_0x8c97('0x30')](util['format'](_0x8c97('0xb5'),_0x203620[_0x8c97('0x3a')]));if(this[_0x8c97('0x86')](_0x203620[_0x8c97('0x64')])){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0xb6'),_0x203620[_0x8c97('0x64')]));var _0xddd9fe=this[_0x8c97('0x10')][_0x8c97('0xb7')](_0x203620[_0x8c97('0x64')]);if(_0xddd9fe[_0x8c97('0xa1')]===-0x1){return _0xddd9fe;}}return this[_0x8c97('0x10')][_0x8c97('0xb8')]();};AGIVertices['prototype'][_0x8c97('0xb9')]=function(_0x411b17){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x411b17[_0x8c97('0x3a')]));if(!this['isConfigured'](_0x411b17[_0x8c97('0x48')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x411b17,_0x8c97('0xba'));}_0x411b17[_0x8c97('0x49')]=moment();if(this[_0x8c97('0x86')](_0x411b17['delay'])){_0x411b17[_0x8c97('0x49')]=moment()[_0x8c97('0xbb')](_0x411b17[_0x8c97('0xbc')],_0x8c97('0xbd'));}if(!this[_0x8c97('0x86')](_0x411b17[_0x8c97('0x4c')])){_0x411b17['callback_priority']=0x2;}this['createCmContact'][_0x8c97('0x6f')](this,_0x411b17);return this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0xbe'),_0x411b17[_0x8c97('0x47')],_0x411b17['list_id'],_0x411b17[_0x8c97('0x49')]));};AGIVertices[_0x8c97('0x12')]['custom_app']=function(_0x3e4140){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0xbf'),_0x3e4140[_0x8c97('0x3a')]));var _0x4b0a66=this[_0x8c97('0x10')][_0x8c97('0x56')](_0x3e4140['application'],_0x3e4140[_0x8c97('0x77')]);if(_0x4b0a66[_0x8c97('0xa1')]===-0x1){return _0x4b0a66;}return this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xc0'),_0x3e4140[_0x8c97('0xc1')],_0x3e4140[_0x8c97('0x77')]));};AGIVertices[_0x8c97('0x12')]['lumenvoxtts']=function(_0x3b7254){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0xc2'),_0x3b7254[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x3b7254[_0x8c97('0x5b')])){return this[_0x8c97('0x10')]['noop']('no\x20text\x20configured');}var _0x51647c='\x22'+_0x3b7254[_0x8c97('0x5b')]+'\x22';if(this['isConfigured'](_0x3b7254[_0x8c97('0x77')])){_0x51647c+=','+_0x3b7254['options'];}var _0x2875b7=this[_0x8c97('0x10')]['exec'](_0x8c97('0xa7'),_0x51647c);if(_0x2875b7[_0x8c97('0xa1')]===-0x1){return _0x2875b7;}return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x51647c));};AGIVertices[_0x8c97('0x12')]['sestektts']=function(_0x46ee81){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0xc3'),_0x46ee81['label']));if(!this[_0x8c97('0x86')](_0x46ee81['text'])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xc4'));}var _0x3c523d='\x22'+_0x46ee81[_0x8c97('0x5b')]+'\x22';if(this[_0x8c97('0x86')](_0x46ee81[_0x8c97('0x77')])){_0x3c523d+=','+_0x46ee81[_0x8c97('0x77')];}var _0x5c1829=this[_0x8c97('0x10')]['exec'](_0x8c97('0xa7'),_0x3c523d);if(_0x5c1829[_0x8c97('0xa1')]===-0x1){return _0x5c1829;}return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xc5'),_0x3c523d));};AGIVertices[_0x8c97('0x12')][_0x8c97('0xc6')]=function(_0x1bf6d1){logger['info'](util[_0x8c97('0x2b')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1bf6d1[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x1bf6d1[_0x8c97('0xaa')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')]('no\x20grammar\x20configured');}var _0x13f67d=_0x1bf6d1['grammar'];if(this[_0x8c97('0x86')](_0x1bf6d1[_0x8c97('0x77')])){_0x13f67d+=','+_0x1bf6d1[_0x8c97('0x77')];}var _0x1950b7=this[_0x8c97('0x10')]['exec']('MRCPRecog',_0x13f67d);if(_0x1950b7['result']===-0x1){return _0x1950b7;}var _0x5a291c=this[_0x8c97('0xa0')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x5a291c[_0x8c97('0xa1')]===-0x1){return _0x5a291c;}var _0xc5944e=this['getAndSetVariable'](_0x8c97('0xae'),_0x8c97('0xc7'));if(_0xc5944e[_0x8c97('0xa1')]===-0x1){return _0xc5944e;}var _0x49253e=this[_0x8c97('0xa0')]('RECOG_INSTANCE()',_0x8c97('0xc8'));if(_0x49253e['result']===-0x1){return _0x49253e;}return this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xb2'),_0x13f67d));};AGIVertices[_0x8c97('0x12')][_0x8c97('0xc9')]=function(_0x4e839a){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0xca'),_0x4e839a[_0x8c97('0x3a')]));if(!this['isConfigured'](_0x4e839a[_0x8c97('0xaa')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')]('no\x20grammar\x20configured');}var _0x1ad561=_0x4e839a['grammar'];if(this[_0x8c97('0x86')](_0x4e839a['options'])){_0x1ad561+=','+_0x4e839a['options'];}var _0x26ecfd=this[_0x8c97('0x10')]['exec'](_0x8c97('0xcb'),_0x1ad561);if(_0x26ecfd[_0x8c97('0xa1')]===-0x1){return _0x26ecfd;}var _0x353add=this[_0x8c97('0xa0')](_0x8c97('0xac'),_0x8c97('0xcc'));if(_0x353add[_0x8c97('0xa1')]===-0x1){return _0x353add;}var _0x11da1f=this['getAndSetVariable'](_0x8c97('0xae'),_0x8c97('0xcd'));if(_0x11da1f[_0x8c97('0xa1')]===-0x1){return _0x11da1f;}var _0x46e6f9=this['getAndSetVariable'](_0x8c97('0xb0'),'SESTEK_ASR_INSTANCE');if(_0x46e6f9[_0x8c97('0xa1')]===-0x1){return _0x46e6f9;}return this['channel']['noop'](util[_0x8c97('0x2b')](_0x8c97('0xb2'),_0x1ad561));};AGIVertices[_0x8c97('0x12')][_0x8c97('0xce')]=function(_0x3932ca){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0xcf'),_0x3932ca[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x3932ca[_0x8c97('0xd0')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3932ca,'no\x20database\x20selected');}var _0x58dedc=this[_0x8c97('0x1c')][_0x8c97('0x6f')](this,_0x3932ca[_0x8c97('0xd0')]);if(!_0x58dedc){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3932ca,_0x8c97('0xd1'));}if(!this[_0x8c97('0x86')](_0x3932ca[_0x8c97('0xd2')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3932ca,_0x8c97('0xd3'));}var _0x13eac7=_0x3932ca['query'][_0x8c97('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0xd4'),_0x13eac7));var _0x104ed4=this[_0x8c97('0xd5')][_0x8c97('0x6f')](this,_0x58dedc,_0x13eac7);this[_0x8c97('0x38')]['sync'](this,_0x3932ca,_0x13eac7);if(!this['isConfigured'](_0x3932ca['variable_id'])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xd6'));}var _0x2316db=this[_0x8c97('0x13')][_0x8c97('0x6f')](this,_0x3932ca[_0x8c97('0xd7')]);if(!_0x2316db){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3932ca,_0x8c97('0xd8'));}var _0x1cd37c=this;_0x104ed4[_0x8c97('0xd9')](function(_0x43e060,_0x3c5286){Object[_0x8c97('0xda')](_0x43e060)['forEach'](function(_0x52b56d){_0x1cd37c[_0x8c97('0x10')][_0x8c97('0x9e')](util[_0x8c97('0x2b')](_0x8c97('0xdb'),_0x2316db,_0x3c5286,_0x52b56d),_0x43e060[_0x52b56d]);});});this[_0x8c97('0x10')][_0x8c97('0x9e')](util['format']('%s_ROWS_COUNT',_0x2316db),_0x104ed4['length']);return this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format'](_0x8c97('0xdc'),_0x2316db));};AGIVertices['prototype'][_0x8c97('0xdd')]=function(_0x4f695e){logger[_0x8c97('0xde')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x4f695e[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x4f695e[_0x8c97('0xdf')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x4f695e,_0x8c97('0xe0'));}var _0x5aca6a=this[_0x8c97('0xe1')][_0x8c97('0x6f')](this,_0x4f695e['sip_id']);if(!_0x5aca6a){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x4f695e,_0x8c97('0xe2'));}var _0x39bcdb=this[_0x8c97('0x10')]['exec'](_0x8c97('0xe3'),[util[_0x8c97('0x2b')](_0x8c97('0xe4'),_0x5aca6a),_0x4f695e[_0x8c97('0x64')],_0x4f695e[_0x8c97('0xe5')],_0x4f695e['url']]);if(_0x39bcdb[_0x8c97('0xa1')]===-0x1){return _0x39bcdb;}return this['channel'][_0x8c97('0xa6')](util['format']('Executed\x20command\x20%s',_0x8c97('0xe3')));};AGIVertices[_0x8c97('0x12')][_0x8c97('0xe6')]=function(_0x5a041d){logger['info'](util[_0x8c97('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5a041d['label']));if(!this[_0x8c97('0x86')](_0x5a041d['key'])){return this['channel'][_0x8c97('0xa6')](_0x8c97('0xe7'));}if(!this[_0x8c97('0x86')](_0x5a041d[_0x8c97('0x5b')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xc4'));}this[_0x8c97('0x10')][_0x8c97('0xe8')]=!![];this[_0x8c97('0x38')](_0x5a041d);this['createSquareMessage'](_0x5a041d[_0x8c97('0x5b')],'in','','');this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xe9'),_0x5a041d[_0x8c97('0x5b')]));var _0x1b5f36=this[_0x8c97('0x78')][_0x8c97('0x6f')](this,_0x5a041d);if(_0x1b5f36){for(var _0x3d61a3 in _0x1b5f36){if(_0x1b5f36[_0x8c97('0x98')](_0x3d61a3)){this[_0x8c97('0x10')][_0x8c97('0x9e')](util[_0x8c97('0x2b')]('DIALOGFLOW_%s',_0x3d61a3['toUpperCase']()),_0x1b5f36[_0x3d61a3]);}}this[_0x8c97('0x41')](_0x1b5f36[_0x8c97('0xea')],_0x8c97('0xeb'),'dialogflow','');return this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xec'),_0x1b5f36['speech']));}return this['channel'][_0x8c97('0x2e')](_0x5a041d,_0x8c97('0xed'));};AGIVertices[_0x8c97('0x12')][_0x8c97('0xee')]=function(_0x3476c3){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3476c3[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x3476c3[_0x8c97('0x7b')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xef'));}if(!this[_0x8c97('0x86')](_0x3476c3[_0x8c97('0x7c')])){return this[_0x8c97('0x10')]['noop'](_0x8c97('0xf0'));}if(!this[_0x8c97('0x86')](_0x3476c3['private_key'])){return this[_0x8c97('0x10')][_0x8c97('0xa6')]('no\x20private_key\x20configured');}if(!this[_0x8c97('0x86')](_0x3476c3[_0x8c97('0x7e')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xf1'));}if(!this['isConfigured'](_0x3476c3[_0x8c97('0x5b')])){return this['channel'][_0x8c97('0xa6')]('no\x20text\x20configured');}this[_0x8c97('0x10')][_0x8c97('0xe8')]=!![];this['createSquareDetailsReport'](_0x3476c3);this[_0x8c97('0x41')](_0x3476c3[_0x8c97('0x5b')],'in','','');this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xf2'),_0x3476c3['text']));var _0x54d366=this[_0x8c97('0x7a')][_0x8c97('0x6f')](this,_0x3476c3);if(_0x54d366){for(var _0x4330ec in _0x54d366){if(_0x54d366[_0x8c97('0x98')](_0x4330ec)){if(_0x4330ec!==_0x8c97('0xf3')){this[_0x8c97('0x10')][_0x8c97('0x9e')](util[_0x8c97('0x2b')]('DIALOGFLOW_%s',_0x4330ec['toUpperCase']()),_0x54d366[_0x4330ec]);}}}this[_0x8c97('0x41')](_0x54d366[_0x8c97('0xea')],_0x8c97('0xeb'),_0x8c97('0xee'),_0x54d366[_0x8c97('0xf3')]);return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xf4'),_0x54d366[_0x8c97('0xea')]));}return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3476c3,_0x8c97('0xf5'));};AGIVertices[_0x8c97('0x12')][_0x8c97('0xf6')]=function(_0xdfa917){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0xf7'),_0xdfa917[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0xdfa917['ndauth_url'])){return this[_0x8c97('0x10')]['noop'](_0x8c97('0xf8'));}if(!this['isConfigured'](_0xdfa917[_0x8c97('0xf9')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xfa'));}if(!this[_0x8c97('0x86')](_0xdfa917[_0x8c97('0xfb')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xfc'));}if(!this[_0x8c97('0x86')](_0xdfa917[_0x8c97('0xfd')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xc4'));}this[_0x8c97('0x10')][_0x8c97('0xe8')]=!![];this[_0x8c97('0x38')](_0xdfa917);this[_0x8c97('0x41')](_0xdfa917['text'],'in','','');this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format'](_0x8c97('0xfe'),_0xdfa917['text']));var _0x3d71a2=this['sestekNDA']['sync'](this,_0xdfa917);if(_0x3d71a2){for(var _0x336422 in _0x3d71a2){if(_0x3d71a2[_0x8c97('0x98')](_0x336422)){this[_0x8c97('0x10')][_0x8c97('0x9e')](util[_0x8c97('0x2b')](_0x8c97('0xff'),_0x336422[_0x8c97('0x68')]()),_0x3d71a2[_0x336422]);}}this[_0x8c97('0x41')](_0x3d71a2[_0x8c97('0xea')],'out',_0x8c97('0xf6'),'');if(_0x3d71a2['audiofile']){this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x100'),_0x3d71a2[_0x8c97('0x101')]));var _0x4964cb=this[_0x8c97('0x10')][_0x8c97('0x102')](_0x3d71a2[_0x8c97('0x101')]);try{fs[_0x8c97('0x103')](_0x3d71a2[_0x8c97('0x101')]+_0x8c97('0x104'));}catch(_0xa07b17){logger[_0x8c97('0x2e')](_0xa07b17);}return _0x4964cb;}else{return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('SestekNDA\x20Result\x20%s',_0x3d71a2[_0x8c97('0xea')]));}}return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0xdfa917,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x8c97('0x105')]=function(_0x3b71c8){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x3b71c8[_0x8c97('0x3a')]));return this[_0x8c97('0x10')]['noop']('end');};AGIVertices[_0x8c97('0x12')][_0x8c97('0x106')]=function(_0xe177c1){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x107'),_0xe177c1['label']));var _0x77985e='';if(_0xe177c1['trunk_id']){if(!this[_0x8c97('0x86')](_0xe177c1[_0x8c97('0x108')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0xe177c1,_0x8c97('0x109'));}else{var _0x1af38c=parseInt(_0xe177c1[_0x8c97('0x108')],0xa);if(isNaN(_0x1af38c)){_0x77985e=_0xe177c1[_0x8c97('0x108')];}else{_0x77985e=this[_0x8c97('0x1f')][_0x8c97('0x6f')](this,_0xe177c1[_0x8c97('0x108')]);if(!_0x77985e){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0xe177c1,_0x8c97('0x10a'));}}}}else if(_0xe177c1[_0x8c97('0x10b')]){_0x77985e=_0xe177c1[_0x8c97('0x10b')];}else{return this[_0x8c97('0x10')]['error'](_0xe177c1,_0x8c97('0x109'));}var _0x169b34=this[_0x8c97('0x10')][_0x8c97('0x56')](_0x8c97('0xe3'),[util[_0x8c97('0x2b')](_0x8c97('0x10c'),_0x77985e,_0xe177c1[_0x8c97('0x47')]),_0xe177c1[_0x8c97('0x64')],_0xe177c1[_0x8c97('0xe5')],_0xe177c1[_0x8c97('0x71')]]);if(_0x169b34[_0x8c97('0xa1')]===-0x1){return _0x169b34;}return this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format']('Executed\x20command\x20%s',_0x8c97('0xe3')));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x10d')]=function(_0x116aeb){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x10e'),_0x116aeb[_0x8c97('0x3a')]));return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x10d'));};AGIVertices['prototype']['getdigits']=function(_0x3e39d5){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x10f'),_0x3e39d5[_0x8c97('0x3a')]));if(_0x3e39d5[_0x8c97('0xa4')]===0x0){return this[_0x8c97('0x110')](_0x3e39d5);}_0x3e39d5[_0x8c97('0xa4')]-=0x1;if(!this[_0x8c97('0x86')](_0x3e39d5['file_id'])){return this['channel'][_0x8c97('0x2e')](_0x3e39d5,_0x8c97('0x111'));}var _0x50f643=this[_0x8c97('0x20')][_0x8c97('0x6f')](this,_0x3e39d5['file_id']);if(!_0x50f643){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3e39d5,_0x8c97('0x112'));}if(!this[_0x8c97('0x86')](_0x3e39d5[_0x8c97('0xd7')])){return this[_0x8c97('0x10')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x595efe=this['channel']['getData'](_0x50f643,_0x3e39d5[_0x8c97('0x113')],_0x3e39d5[_0x8c97('0x114')]);var _0x455361=_0x595efe[_0x8c97('0xa1')]?_0x595efe[_0x8c97('0xa1')][_0x8c97('0x4b')]():'';logger[_0x8c97('0x30')](_0x8c97('0x115'),JSON[_0x8c97('0x72')](_0x595efe));if(_0x595efe[_0x8c97('0xa1')]===-0x1){this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x3e39d5,_0x455361);return _0x595efe;}else if(_0x595efe[_0x8c97('0xa3')]===_0x8c97('0x64')){_0x595efe[_0x8c97('0xa1')]=_0x455361[_0x8c97('0x9b')]>=parseInt(_0x3e39d5['mindigit'])?'x':'i';}else{_0x595efe['result']=_0x455361['length']>=parseInt(_0x3e39d5['mindigit'])&&_0x455361[_0x8c97('0x9b')]<=parseInt(_0x3e39d5['maxdigit'])?'x':'i';}var _0xfbe555=this[_0x8c97('0x13')][_0x8c97('0x6f')](this,_0x3e39d5[_0x8c97('0xd7')]);if(!_0xfbe555){return this['channel']['error'](_0x3e39d5,_0x8c97('0xd8'));}this[_0x8c97('0x10')]['setVariable'](_0xfbe555,_0x455361);if(this[_0x8c97('0x86')](_0x3e39d5[_0x8c97('0x116')])){var _0x2c1813=parseInt(_0x3e39d5[_0x8c97('0x116')],0xa);var _0x38490=rs[_0x8c97('0x117')]({'charset':'*','length':_0x2c1813});var _0x2a0f62=_0x455361['length'];if(_0x2a0f62>0x0){if(_0x2a0f62>_0x2c1813){this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x3e39d5,_0x3e39d5[_0x8c97('0x118')]==='first'?_0x38490+_0x455361[_0x8c97('0x119')](_0x2c1813):_0x455361[_0x8c97('0x119')](0x0,_0x2a0f62-_0x2c1813)+_0x38490);}else{this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x3e39d5,rs[_0x8c97('0x117')]({'charset':'*','length':_0x2a0f62}));}}else{this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x3e39d5,'');}}else{this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x3e39d5,_0x455361);}return _0x595efe;};AGIVertices[_0x8c97('0x12')][_0x8c97('0xf')]=function(_0x2172e4){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x11a'),_0x2172e4[_0x8c97('0x3a')]));return this[_0x8c97('0xe')](_0x2172e4);};AGIVertices['prototype'][_0x8c97('0x11b')]=function(_0x55b4e4){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x11c'),_0x55b4e4['label']));this['createSquareDetailsReport'][_0x8c97('0x6f')](this,_0x55b4e4,_0x55b4e4[_0x8c97('0x11d')]);return this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format']('GOAL\x20%s',_0x55b4e4[_0x8c97('0x11d')]));};AGIVertices['prototype'][_0x8c97('0x11e')]=function(_0x425ad8){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x11f'),_0x425ad8['label']));if(!this['isConfigured'](_0x425ad8['aws_access_key_id'])||!this[_0x8c97('0x86')](_0x425ad8[_0x8c97('0x8a')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x120'));}if(!this[_0x8c97('0x86')](_0x425ad8[_0x8c97('0x5b')])){return this[_0x8c97('0x10')]['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0x8c97('0x2b')]('Trying\x20aws\x20Polly\x20%s',_0x425ad8[_0x8c97('0x5b')]));var _0x5d198f=this[_0x8c97('0x88')]['sync'](this,_0x425ad8);if(_0x5d198f){this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x121'),_0x5d198f));var _0x4d49e5=this[_0x8c97('0x10')]['streamFile'](_0x5d198f);try{fs[_0x8c97('0x103')](_0x5d198f+_0x8c97('0x104'));}catch(_0x278df3){logger[_0x8c97('0x2e')](_0x278df3);}return _0x4d49e5;}return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x425ad8,_0x8c97('0x122'));};AGIVertices[_0x8c97('0x12')]['awslex']=function(_0x7cb467){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x7cb467[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x7cb467[_0x8c97('0x89')])||!this[_0x8c97('0x86')](_0x7cb467['aws_secret_access_key'])){return this['channel'][_0x8c97('0xa6')](_0x8c97('0x120'));}if(!this[_0x8c97('0x86')](_0x7cb467[_0x8c97('0x8e')])){return this[_0x8c97('0x10')]['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x8c97('0x86')](_0x7cb467[_0x8c97('0x5b')])){return this[_0x8c97('0x10')]['noop']('no\x20text\x20configured');}this[_0x8c97('0x10')][_0x8c97('0xe8')]=!![];this[_0x8c97('0x38')](_0x7cb467);this[_0x8c97('0x41')](_0x7cb467[_0x8c97('0x5b')],'in','','');this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0x123'),_0x7cb467[_0x8c97('0x5b')]));var _0x4a84d2=this[_0x8c97('0x8c')][_0x8c97('0x6f')](this,_0x7cb467);if(_0x4a84d2){for(var _0x4e1282 in _0x4a84d2){if(_0x4a84d2['hasOwnProperty'](_0x4e1282)&&_[_0x8c97('0x94')](_0x4a84d2[_0x4e1282])){this[_0x8c97('0x10')]['setVariable'](util[_0x8c97('0x2b')]('AWS_LEX_%s',_0x4e1282[_0x8c97('0x68')]()),_0x4a84d2[_0x4e1282]);}}if(_['isNil'](_0x4a84d2[_0x8c97('0x75')])){return this['channel']['noop'](_0x8c97('0x124'));}else{this['createSquareMessage'](_0x4a84d2[_0x8c97('0x75')],'out','amazonlex','');return this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x4a84d2[_0x8c97('0x75')]));}}return this['channel'][_0x8c97('0x2e')](_0x7cb467,_0x8c97('0x125'));};AGIVertices[_0x8c97('0x12')]['googleasr']=function(_0x48cf73){logger['info'](util[_0x8c97('0x2b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x48cf73[_0x8c97('0x3a')],_0x48cf73[_0x8c97('0x64')]));if(!this['isConfigured'](_0x48cf73[_0x8c97('0x81')])){return this['channel'][_0x8c97('0xa6')]('no\x20key\x20configured');}var _0x2edd38=_0x8c97('0x126');var _0x464109=util[_0x8c97('0x2b')](_0x8c97('0x127'),FILES_PATH,rs[_0x8c97('0x117')](0x4));var _0x33ac0c=util[_0x8c97('0x2b')](_0x8c97('0x9d'),_0x464109,_0x2edd38);var _0x3dc671=!![];if(_0x48cf73[_0x8c97('0x128')]===_0x8c97('0x129')){_0x3dc671=![];}var _0x233038=this['channel'][_0x8c97('0x12a')](_0x464109,_0x2edd38,_0x48cf73[_0x8c97('0x12b')],_0x48cf73[_0x8c97('0x64')],undefined,_0x3dc671);if(_0x233038[_0x8c97('0xa1')]!==-0x1){this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x12c'),_0x33ac0c));var _0x563af6=this[_0x8c97('0x12d')][_0x8c97('0x6f')](this,_0x48cf73,_0x33ac0c);if(_0x563af6){for(var _0xa8ee0d in _0x563af6){if(_0x563af6[_0x8c97('0x98')](_0xa8ee0d)){this[_0x8c97('0x10')]['setVariable'](util[_0x8c97('0x2b')](_0x8c97('0x12e'),_0xa8ee0d[_0x8c97('0x68')]()),_0x563af6[_0xa8ee0d]);}}return this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x563af6)));}}return _0x233038;};AGIVertices[_0x8c97('0x12')]['tildeasr']=function(_0x45f09f){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x12f'),_0x45f09f[_0x8c97('0x3a')]));if(!this['isConfigured'](_0x45f09f[_0x8c97('0x90')])){return this['channel'][_0x8c97('0xa6')](_0x8c97('0x130'));}if(!this[_0x8c97('0x86')](_0x45f09f[_0x8c97('0x91')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x83594a='wav';var _0xf642ae=util[_0x8c97('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x8c97('0x117')](0x4));var _0x1d5d55=util[_0x8c97('0x2b')](_0x8c97('0x9d'),_0xf642ae,_0x83594a);var _0x57d1cf=!![];if(_0x45f09f['beep']===_0x8c97('0x129')){_0x57d1cf=![];}var _0x54c56e=this['channel']['recordFile'](_0xf642ae,_0x83594a,_0x45f09f[_0x8c97('0x12b')],_0x45f09f['timeout'],undefined,_0x57d1cf);if(_0x54c56e[_0x8c97('0xa1')]!==-0x1){this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x131'),_0x1d5d55));var _0x52d57a=this[_0x8c97('0x8f')][_0x8c97('0x6f')](this,_0x45f09f,_0x1d5d55);if(_0x52d57a){for(var _0x1512b0 in _0x52d57a){if(_0x52d57a[_0x8c97('0x98')](_0x1512b0)){this[_0x8c97('0x10')][_0x8c97('0x9e')](util[_0x8c97('0x2b')]('TILDE_ASR_%s',_0x1512b0[_0x8c97('0x68')]()),_0x52d57a[_0x1512b0]);}}return this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x132'),JSON[_0x8c97('0x72')](_0x52d57a)));}}return _0x54c56e;};AGIVertices[_0x8c97('0x12')][_0x8c97('0x133')]=function(_0x3af3f9){logger[_0x8c97('0x30')](util['format'](_0x8c97('0x134'),_0x3af3f9['label']));return this[_0x8c97('0x10')]['continueAt'](_0x3af3f9['context'],_0x3af3f9[_0x8c97('0x3e')],_0x3af3f9['priority']);};AGIVertices['prototype'][_0x8c97('0x135')]=function(_0x33cad4){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x136'),_0x33cad4[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x33cad4[_0x8c97('0x137')])){return this[_0x8c97('0x10')]['error'](_0x33cad4,_0x8c97('0x138'));}try{var _0x1095be=eval(_0x33cad4[_0x8c97('0x137')])?_0x8c97('0x139'):_0x8c97('0x13a');this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x13b'),_0x33cad4['condition'],_0x1095be));return{'code':0xc8,'result':_0x1095be};}catch(_0x486c8c){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x8c97('0x12')]['gotoiftime']=function(_0x51361b){logger['info'](util['format'](_0x8c97('0x13c'),_0x51361b[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x51361b['interval_id'])){return this['channel'][_0x8c97('0x2e')](_0x51361b,_0x8c97('0x13d'));}var _0x270de5=this[_0x8c97('0x25')][_0x8c97('0x6f')](this,_0x51361b[_0x8c97('0x13e')]);if(!_0x270de5){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x51361b,_0x8c97('0x13f'));}for(var _0x28fe84=0x0;_0x28fe84<_0x270de5[_0x8c97('0x9b')];_0x28fe84+=0x1){var _0x2a6296=this[_0x8c97('0x10')][_0x8c97('0x13')](util[_0x8c97('0x2b')](_0x8c97('0x140'),_0x270de5[_0x28fe84]));if(_0x2a6296[_0x8c97('0xa1')]===-0x1){return _0x2a6296;}logger['info'](util['format'](_0x8c97('0x141'),_0x270de5[_0x28fe84],_0x2a6296['extra']));if(_0x2a6296[_0x8c97('0xa3')]===_0x8c97('0x139')){logger['info'](util['format'](_0x8c97('0x141'),_0x270de5[_0x28fe84],_0x8c97('0x139')));this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('IFTIME\x20%s\x20%s',_0x270de5[_0x28fe84],_0x8c97('0x139')));return{'code':0xc8,'result':_0x8c97('0x139')};}else{logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x141'),_0x270de5[_0x28fe84],_0x8c97('0x13a')));this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0x141'),_0x270de5[_0x28fe84],_0x8c97('0x13a')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x8c97('0x12')][_0x8c97('0x142')]=function(_0x675693){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x143'),_0x675693[_0x8c97('0x3a')]));return this['channel'][_0x8c97('0x142')]();};AGIVertices[_0x8c97('0x12')][_0x8c97('0x144')]=function(_0x1a4c13){logger['info'](util[_0x8c97('0x2b')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1a4c13['label']));if(!this[_0x8c97('0x86')](_0x1a4c13['key'])){return this['channel'][_0x8c97('0xa6')](_0x8c97('0xe7'));}var _0x3fcce4='wav';var _0x20d097=util[_0x8c97('0x2b')](_0x8c97('0x127'),FILES_PATH,rs['generate'](0x4));var _0x2191af=util['format'](_0x8c97('0x9d'),_0x20d097,_0x3fcce4);var _0x44bf7e=!![];if(_0x1a4c13[_0x8c97('0x128')]==='NOBEEP'){_0x44bf7e=![];}var _0x5457bf=this[_0x8c97('0x10')][_0x8c97('0x12a')](_0x20d097,_0x3fcce4,_0x1a4c13[_0x8c97('0x12b')],_0x1a4c13['timeout'],undefined,_0x44bf7e);if(_0x5457bf[_0x8c97('0xa1')]!==-0x1){this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0x145'),_0x2191af));var _0x3c227a=this[_0x8c97('0x84')][_0x8c97('0x6f')](this,_0x1a4c13,_0x2191af);if(_0x3c227a){for(var _0x18b83a in _0x3c227a){if(_0x3c227a[_0x8c97('0x98')](_0x18b83a)){this['channel']['setVariable'](util[_0x8c97('0x2b')](_0x8c97('0x146'),_0x18b83a[_0x8c97('0x68')]()),_0x3c227a[_0x18b83a]);}}return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x147'),JSON[_0x8c97('0x72')](_0x3c227a)));}}return _0x5457bf;};AGIVertices[_0x8c97('0x12')][_0x8c97('0x148')]=function(_0x3c749e){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x149'),_0x3c749e[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x3c749e[_0x8c97('0x81')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xe7'));}if(!this[_0x8c97('0x86')](_0x3c749e[_0x8c97('0x5b')])){return this['channel'][_0x8c97('0xa6')](_0x8c97('0xc4'));}this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x3c749e[_0x8c97('0x5b')]));var _0x1f85e8=this['ispeechTTS'][_0x8c97('0x6f')](this,_0x3c749e);if(_0x1f85e8){this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0x145'),_0x1f85e8));var _0x4e726f=this[_0x8c97('0x10')][_0x8c97('0x102')](_0x1f85e8,_0x3c749e[_0x8c97('0x12b')]);try{fs[_0x8c97('0x103')](_0x1f85e8+_0x8c97('0x104'));}catch(_0x3c0413){logger[_0x8c97('0x2e')](_0x3c0413);}return _0x4e726f;}return this['channel'][_0x8c97('0x2e')](_0x3c749e,_0x8c97('0x14a'));};AGIVertices[_0x8c97('0x12')]['login']=function(_0x41c539){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x14b'),_0x41c539[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x41c539[_0x8c97('0x14c')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x41c539,'no\x20find\x20by\x20configured');}logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8c97('0x10')]['callerid'],_0x41c539['findBy']));var _0x2ff442=this[_0x8c97('0x53')][_0x8c97('0x6f')](this,_0x41c539['findBy']);if(_0x2ff442){logger[_0x8c97('0x30')](util['format'](_0x8c97('0x14d'),this['channel']['callerid'],_0x41c539[_0x8c97('0x14c')]));this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x8c97('0x10')][_0x8c97('0x51')],_0x41c539[_0x8c97('0x14c')]));return{'code':0xc8,'result':_0x8c97('0x14e')};}else{logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x14f'),this[_0x8c97('0x10')]['callerid'],_0x41c539['findBy']));this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x14f'),this['channel'][_0x8c97('0x51')],_0x41c539['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8c97('0x12')]['logout']=function(_0x5cef9f){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x150'),_0x5cef9f[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x5cef9f['findBy'])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x5cef9f,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x8c97('0x151'),this[_0x8c97('0x10')][_0x8c97('0x51')],_0x5cef9f[_0x8c97('0x14c')]));var _0x463f66=this[_0x8c97('0x52')][_0x8c97('0x6f')](this,_0x5cef9f[_0x8c97('0x14c')]);if(_0x463f66){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x14d'),this[_0x8c97('0x10')][_0x8c97('0x51')],_0x5cef9f[_0x8c97('0x14c')]));this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x8c97('0x10')]['callerid'],_0x5cef9f[_0x8c97('0x14c')]));return{'code':0xc8,'result':_0x8c97('0x14e')};}else{logger['info'](util[_0x8c97('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x8c97('0x51')],_0x5cef9f['findBy']));this['channel'][_0x8c97('0xa6')](util['format'](_0x8c97('0x14f'),this['channel'][_0x8c97('0x51')],_0x5cef9f[_0x8c97('0x14c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x8c97('0x152')]=function(_0xf7f9ca){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0xf7f9ca[_0x8c97('0x3a')]));if(!this['isConfigured'](_0xf7f9ca[_0x8c97('0x153')])){return this[_0x8c97('0x10')]['error'](_0xf7f9ca,'no\x20operation\x20configured');}this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0x154'),_0xf7f9ca['operation']));var _0x420b2c=eval(_0xf7f9ca[_0x8c97('0x153')]);if(!this[_0x8c97('0x86')](_0xf7f9ca['variable_id'])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0xd6'));}var _0x47c6a9=this[_0x8c97('0x13')][_0x8c97('0x6f')](this,_0xf7f9ca[_0x8c97('0xd7')]);if(!_0x47c6a9){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0xf7f9ca,_0x8c97('0xd8'));}if(_[_0x8c97('0x9a')](_0x420b2c)){var _0x1230c6=this;_0x420b2c[_0x8c97('0xd9')](function(_0x2eb4fb,_0x5da651){_0x1230c6[_0x8c97('0x10')][_0x8c97('0x9e')](util['format']('%s[%s]',_0x47c6a9,_0x5da651),_0x2eb4fb);});return this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format'](_0x8c97('0x155'),_0x47c6a9));}else{return this[_0x8c97('0x10')][_0x8c97('0x9e')](_0x47c6a9,_0x420b2c);}};AGIVertices[_0x8c97('0x12')][_0x8c97('0xd')]=function(_0x535efd){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x156'),_0x535efd[_0x8c97('0x3a')]));if(_0x535efd[_0x8c97('0xa4')]===0x0){return this[_0x8c97('0x110')](_0x535efd);}_0x535efd[_0x8c97('0xa4')]-=0x1;if(!this[_0x8c97('0x86')](_0x535efd[_0x8c97('0x157')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x535efd,'no\x20file\x20audio\x20selected');}var _0x32963e=this[_0x8c97('0x20')][_0x8c97('0x6f')](this,_0x535efd[_0x8c97('0x157')]);if(!_0x32963e){return this['channel'][_0x8c97('0x2e')](_0x535efd,_0x8c97('0x112'));}var _0xefdd9d=this[_0x8c97('0x10')][_0x8c97('0x158')](_0x32963e,_0x535efd['response'],_0x535efd['digit']);var _0x5b806a=_0xefdd9d[_0x8c97('0xa1')];if(_0xefdd9d[_0x8c97('0xa1')]===-0x1){this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x535efd,'-1');return _0xefdd9d;}else if(_0xefdd9d[_0x8c97('0xa3')]===_0x8c97('0x64')){_0xefdd9d[_0x8c97('0xa1')]=_0xefdd9d['result'][_0x8c97('0x9b')]>0x0?_0xefdd9d['result']:'t';}else if(_[_0x8c97('0x43')](_0xefdd9d[_0x8c97('0xa1')])){_0xefdd9d[_0x8c97('0xa1')]='#';_0x5b806a='#';}if(!this[_0x8c97('0x86')](_0x535efd[_0x8c97('0xd7')])){this['channel'][_0x8c97('0xa6')](_0x8c97('0xd6'));}else{var _0x35362e=this['getVariable'][_0x8c97('0x6f')](this,_0x535efd['variable_id']);if(!_0x35362e){return this['channel'][_0x8c97('0x2e')](_0x535efd,_0x8c97('0xd8'));}this[_0x8c97('0x10')][_0x8c97('0x9e')](_0x35362e,_0x5b806a);}this[_0x8c97('0x38')]['sync'](this,_0x535efd,_0x5b806a);return _0xefdd9d;};AGIVertices[_0x8c97('0x12')][_0x8c97('0xa6')]=function(_0x2d1cc3){logger['info'](util['format'](_0x8c97('0x159'),_0x2d1cc3['label']));return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x2d1cc3[_0x8c97('0x15a')]||_0x2d1cc3['label']);};AGIVertices[_0x8c97('0x12')][_0x8c97('0x15b')]=function(_0x472a19){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x15c'),_0x472a19[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x472a19[_0x8c97('0x14c')])){return this['channel'][_0x8c97('0x2e')](_0x472a19,'no\x20find\x20by\x20configured');}logger[_0x8c97('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x8c97('0x10')][_0x8c97('0x51')],_0x472a19['findBy']));var _0x1207f9=this[_0x8c97('0x4d')][_0x8c97('0x6f')](this,_0x472a19[_0x8c97('0x15d')]);var _0x765b31=this[_0x8c97('0x4f')]['sync'](this,_0x472a19['findBy'],_0x1207f9);if(_0x765b31){logger[_0x8c97('0x30')](util['format'](_0x8c97('0x14d'),this[_0x8c97('0x10')][_0x8c97('0x51')],_0x472a19[_0x8c97('0x14c')]));this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x14d'),this[_0x8c97('0x10')][_0x8c97('0x51')],_0x472a19['findBy']));return{'code':0xc8,'result':_0x8c97('0x14e')};}else{logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x14f'),this['channel']['callerid'],_0x472a19[_0x8c97('0x14c')]));this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format'](_0x8c97('0x14d'),this[_0x8c97('0x10')][_0x8c97('0x51')],_0x472a19[_0x8c97('0x14c')]));return{'code':0xc8,'result':_0x8c97('0x15e')};}};AGIVertices[_0x8c97('0x12')][_0x8c97('0x15f')]=function(_0x269d59){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x160'),_0x269d59[_0x8c97('0x3a')]));if(!this['isConfigured'](_0x269d59[_0x8c97('0x157')])){return this[_0x8c97('0x10')]['error'](_0x269d59,_0x8c97('0x111'));}var _0x26018f=this[_0x8c97('0x20')][_0x8c97('0x6f')](this,_0x269d59[_0x8c97('0x157')]);if(!_0x26018f){return this[_0x8c97('0x10')]['error'](_0x269d59,_0x8c97('0x112'));}var _0x326d43=this[_0x8c97('0x10')][_0x8c97('0x56')]('PLAYBACK',[_0x26018f,_0x269d59[_0x8c97('0xe5')]]);if(_0x326d43[_0x8c97('0xa1')]===-0x1){return _0x326d43;}return this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')]('Executed\x20command\x20%s\x20%s',_0x8c97('0x161'),_0x26018f));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x162')]=function(_0x5e23f7){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x163'),_0x5e23f7['label']));if(!this['isConfigured'](_0x5e23f7[_0x8c97('0x164')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x5e23f7,_0x8c97('0x165'));}var _0x59340e='';var _0x32e47c=parseInt(_0x5e23f7[_0x8c97('0x164')],0xa);if(isNaN(_0x32e47c)){_0x59340e=_0x5e23f7[_0x8c97('0x164')];}else{_0x59340e=this['getVoiceQueue'][_0x8c97('0x6f')](this,_0x5e23f7[_0x8c97('0x164')]);if(!_0x59340e){return this[_0x8c97('0x10')]['error'](_0x5e23f7,'no\x20queue\x20found');}}var _0x5d1b39='';if(this['isConfigured'](_0x5e23f7['file_id'])){var _0x5430d2=this['getSound'][_0x8c97('0x6f')](this,_0x5e23f7[_0x8c97('0x157')]);if(_0x5430d2){_0x5d1b39=_0x5430d2;}}this[_0x8c97('0x38')]['sync'](this,_0x5e23f7,_0x59340e);if(_0x5e23f7[_0x8c97('0xe5')][_0x8c97('0x166')]('x')<0x0){_0x5e23f7['opts']+='x';}if(_0x5e23f7[_0x8c97('0xe5')][_0x8c97('0x166')]('X')<0x0){_0x5e23f7['opts']+='X';}this[_0x8c97('0x10')][_0x8c97('0x9e')](_0x8c97('0x167'),_0x59340e?_0x59340e[_0x8c97('0x168')]():'');var _0x26eece=this[_0x8c97('0x10')][_0x8c97('0x56')](_0x8c97('0x169'),[_0x59340e,_0x5e23f7[_0x8c97('0xe5')],_0x5e23f7[_0x8c97('0x71')],_0x5d1b39,_0x5e23f7['timeout'],_0x5e23f7['agi'],_0x5e23f7[_0x8c97('0x16a')],_0x5e23f7[_0x8c97('0x16b')],'',_0x5e23f7[_0x8c97('0x16c')]]);if(_0x26eece[_0x8c97('0xa1')]===-0x1){return _0x26eece;}return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x59340e));};AGIVertices['prototype'][_0x8c97('0x16d')]=function(_0x2c6152){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x16e'),_0x2c6152['label']));var _0x1d38c5=_0x2c6152[_0x8c97('0x16f')]||_0x8c97('0x126');var _0x82e909=util[_0x8c97('0x2b')](_0x8c97('0x170'),this[_0x8c97('0x10')][_0x8c97('0x39')],rs[_0x8c97('0x117')](0x5));var _0x57aba2=util['format'](_0x8c97('0x171'),FILES_PATH,_0x82e909,_0x1d38c5);var _0x1e391d=util[_0x8c97('0x2b')]('%s/recordings/%s',FILES_PATH,_0x82e909);this['createSquareRecording'][_0x8c97('0x6f')](this,_0x2c6152,_0x82e909,_0x57aba2);this[_0x8c97('0x10')][_0x8c97('0x9e')](_0x8c97('0x172'),_0x82e909);logger[_0x8c97('0x30')](_0x8c97('0x173'),_0x1e391d,_0x1d38c5,_0x2c6152[_0x8c97('0x174')],_0x2c6152[_0x8c97('0x64')]);return this['channel']['recordFile'](_0x1e391d,_0x1d38c5,_0x2c6152['escape_digits'],_0x2c6152[_0x8c97('0x64')],undefined,!![]);};AGIVertices[_0x8c97('0x12')][_0x8c97('0x175')]=function(_0x3d0b07){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x176'),_0x3d0b07[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x3d0b07[_0x8c97('0x71')])){return this[_0x8c97('0x10')]['noop']('no\x20url\x20configured');}var _0x220bba=this[_0x8c97('0x62')][_0x8c97('0x6f')](this,_0x3d0b07);logger['info'](util['format'](_0x8c97('0x177'),util[_0x8c97('0x178')](_0x220bba,{'showHidden':![],'depth':null})));if(!this[_0x8c97('0x86')](_0x3d0b07['variable_id'])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x179'));}var _0x4ef935=this[_0x8c97('0x13')][_0x8c97('0x6f')](this,_0x3d0b07[_0x8c97('0xd7')]);if(!_0x4ef935){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3d0b07,_0x8c97('0xd8'));}this[_0x8c97('0x10')][_0x8c97('0x9e')](util['format'](_0x8c97('0x17a'),_0x4ef935),_0x220bba[_0x8c97('0x74')]?_0x220bba[_0x8c97('0x74')]:_0x8c97('0x17b'));this['channel'][_0x8c97('0x9e')](util[_0x8c97('0x2b')](_0x8c97('0x17c'),_0x4ef935),_0x220bba[_0x8c97('0x17d')]?_0x220bba[_0x8c97('0x17d')]:'OK');if(_0x220bba[_0x8c97('0x69')]){try{this[_0x8c97('0x9c')](_0x220bba[_0x8c97('0x69')],_0x4ef935);}catch(_0x32d0d7){logger[_0x8c97('0x2e')](util[_0x8c97('0x2b')](_0x8c97('0x17e'),_0x4ef935));}}return this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0xdc'),_0x4ef935));};AGIVertices['prototype'][_0x8c97('0x17f')]=function(_0x44d401){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x180'),_0x44d401[_0x8c97('0x3a')]));return this[_0x8c97('0x10')][_0x8c97('0x181')](_0x44d401['digits'][_0x8c97('0x58')](/\s+/g,''),_0x44d401[_0x8c97('0x174')]);};AGIVertices[_0x8c97('0x12')][_0x8c97('0x182')]=function(_0x6f29ef){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x183'),_0x6f29ef[_0x8c97('0x3a')]));return this[_0x8c97('0x10')]['sayNumber'](_0x6f29ef[_0x8c97('0x65')][_0x8c97('0x58')](/\s+/g,''),_0x6f29ef[_0x8c97('0x174')]);};AGIVertices[_0x8c97('0x12')][_0x8c97('0x184')]=function(_0x3f7220){logger['info'](util['format'](_0x8c97('0x185'),_0x3f7220[_0x8c97('0x3a')]));return this[_0x8c97('0x10')][_0x8c97('0x186')](_0x3f7220[_0x8c97('0x5b')],_0x3f7220[_0x8c97('0x174')]);};AGIVertices[_0x8c97('0x12')]['sendMail']=function(_0x2f3f51){logger['info'](util[_0x8c97('0x2b')](_0x8c97('0x187'),_0x2f3f51[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x2f3f51[_0x8c97('0x188')])){return this[_0x8c97('0x10')]['noop'](_0x8c97('0x189'));}var _0x5e229c=this['getMailAccount'][_0x8c97('0x6f')](this,_0x2f3f51[_0x8c97('0x188')]);if(!_0x5e229c||!_0x5e229c['Smtp']){return this[_0x8c97('0x10')]['error'](_0x2f3f51,_0x8c97('0x18a'));}var _0x58a66b={'from':util[_0x8c97('0x2b')](_0x8c97('0x18b'),_0x5e229c[_0x8c97('0x19')],_0x5e229c[_0x8c97('0x18c')]||_0x5e229c['Smtp'][_0x8c97('0x18d')]),'to':_0x2f3f51['to']||'','cc':_0x2f3f51['cc']||'','bcc':_0x2f3f51[_0x8c97('0x18e')]||'','subject':_0x2f3f51[_0x8c97('0x18f')],'html':_0x2f3f51[_0x8c97('0x5b')],'text':_0x2f3f51[_0x8c97('0x5b')]};if(this[_0x8c97('0x86')](_0x2f3f51[_0x8c97('0x190')])){}logger['debug'](_0x8c97('0x191'),JSON['stringify'](_0x58a66b));this['createSquareDetailsReport'][_0x8c97('0x6f')](this,_0x2f3f51,_0x2f3f51[_0x8c97('0x188')]);this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x192'),_0x5e229c[_0x8c97('0x19')]));this[_0x8c97('0x24')]['sync'](this,_0x5e229c['smtpOptions'],_0x58a66b);return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x193'));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x194')]=function(_0x1bb295){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x195'),_0x1bb295[_0x8c97('0x3a')]));return this['channel'][_0x8c97('0xa6')](_0x8c97('0x196'));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x197')]=function(_0xace51e){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x198'),_0xace51e[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0xace51e[_0x8c97('0x199')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x19a'));}var _0x1552a2=this[_0x8c97('0x35')][_0x8c97('0x6f')](this,_0xace51e[_0x8c97('0x199')]);if(!_0x1552a2){return this[_0x8c97('0x10')]['error'](_0xace51e,_0x8c97('0x19b'));}var _0xc98f53={'body':_0xace51e[_0x8c97('0x19c')],'phone':_0xace51e['to']||'','SmsAccountId':_0x1552a2['id']};logger['debug'](_0x8c97('0x19d'),JSON[_0x8c97('0x72')](_0xc98f53));this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0xace51e,_0xace51e[_0x8c97('0x199')]);this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1552a2[_0x8c97('0x19')]));this[_0x8c97('0x37')][_0x8c97('0x6f')](this,_0xc98f53);return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x19e'));};AGIVertices[_0x8c97('0x12')]['set']=function(_0x1878ef){logger[_0x8c97('0x30')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x1878ef[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x1878ef[_0x8c97('0xd7')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x1878ef,_0x8c97('0x19f'));}var _0x2285c7=this['getVariable'][_0x8c97('0x6f')](this,_0x1878ef['variable_id']);if(!_0x2285c7){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x1878ef,_0x8c97('0xd8'));}return this['channel'][_0x8c97('0x9e')](_0x2285c7,_0x1878ef[_0x8c97('0x1a0')]);};AGIVertices[_0x8c97('0x12')]['start']=function(_0x2b406b){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20START\x20(%s)\x20block',_0x2b406b[_0x8c97('0x3a')]));this[_0x8c97('0x10')]['noop']('START\x20CALLY\x20SQUARE');var _0x18246a=this[_0x8c97('0x10')][_0x8c97('0x13')](_0x8c97('0x1a1'));if(!_['isEmpty'](_0x18246a[_0x8c97('0xa3')])){this[_0x8c97('0x10')]['uniqueid']=_0x18246a[_0x8c97('0xa3')];}if(_0x2b406b['answer']==='yes'){this[_0x8c97('0x10')][_0x8c97('0xa6')]('Answer');return this['channel'][_0x8c97('0xb8')]();}return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x1a2'));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x1a3')]=function(_0x3c13a8){logger['info'](util[_0x8c97('0x2b')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3c13a8[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x3c13a8[_0x8c97('0x1a4')])){return this['channel'][_0x8c97('0x2e')](_0x3c13a8,_0x8c97('0x1a5'));}var _0x3efa6c=this[_0x8c97('0x1a')]['sync'](this,_0x3c13a8['project_id']);if(!this['isConfigured'](_0x3efa6c)){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x3c13a8,util[_0x8c97('0x2b')](_0x8c97('0x1a6'),_0x3c13a8[_0x8c97('0x1a4')]));}if(_0x3efa6c===this[_0x8c97('0x10')]['arg_1']){return this['channel'][_0x8c97('0x2e')](_0x3c13a8,_0x8c97('0x1a7'));}this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x3c13a8,_0x3efa6c);var _0x278670=this[_0x8c97('0x10')]['exec']('AGI',util[_0x8c97('0x2b')](_0x8c97('0x1a8'),config['agi'][_0x8c97('0x1a9')]||_0x8c97('0x1aa'),_0x3efa6c,this[_0x8c97('0x10')][_0x8c97('0x3c')]));if(_0x278670[_0x8c97('0xa1')]===-0x1){return _0x278670;}return this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('Executed\x20command\x20%s\x20%s',_0x8c97('0x1ab'),_0x3efa6c));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x1ac')]=function(_0x1352da){logger[_0x8c97('0x30')](util['format'](_0x8c97('0x1ad'),_0x1352da[_0x8c97('0x3a')]));var _0x1a6a6b=this[_0x8c97('0x55')][_0x8c97('0x6f')](this,_0x1352da[_0x8c97('0x1ae')]);this[_0x8c97('0x38')][_0x8c97('0x6f')](this,_0x1352da,_0x1352da[_0x8c97('0x1ae')]);if(this[_0x8c97('0x86')](_0x1352da[_0x8c97('0xd7')])){var _0x5be7ec=this[_0x8c97('0x13')]['sync'](this,_0x1352da['variable_id']);if(_0x5be7ec){this['channel']['setVariable'](_0x5be7ec,_0x1a6a6b);return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1352da[_0x8c97('0x1ae')],_0x5be7ec));}}return this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x1af'),_0x1352da[_0x8c97('0x1ae')]));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x1b0')]=function(_0x508d3d){logger['info'](util['format'](_0x8c97('0x1b1'),_0x508d3d[_0x8c97('0x3a')]));_0x508d3d[_0x8c97('0x5b')]=_0x508d3d['text'][_0x8c97('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x508d3d[_0x8c97('0x1b2')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')](_0x8c97('0x1b3'));}if(!this[_0x8c97('0x86')](_0x508d3d[_0x8c97('0x5b')])){return this[_0x8c97('0x10')][_0x8c97('0xa6')]('no\x20text\x20configured');}this[_0x8c97('0x10')]['noop'](util[_0x8c97('0x2b')](_0x8c97('0x1b4'),_0x508d3d[_0x8c97('0x5b')]));var _0x2cf89e=this['googleCloudTTS'][_0x8c97('0x6f')](this,_0x508d3d);if(_0x2cf89e){this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x1b5'),_0x2cf89e));var _0x56122f=this[_0x8c97('0x10')][_0x8c97('0x102')](_0x2cf89e);try{fs[_0x8c97('0x103')](_0x2cf89e+_0x8c97('0x104'));}catch(_0x324246){logger[_0x8c97('0x2e')](_0x324246);}return _0x56122f;}return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x508d3d,_0x8c97('0x1b6'));};AGIVertices[_0x8c97('0x12')][_0x8c97('0x1b7')]=function(_0x54c3d6){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x1b8'),_0x54c3d6[_0x8c97('0x3a')]));_0x54c3d6[_0x8c97('0x5b')]=_0x54c3d6[_0x8c97('0x5b')][_0x8c97('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x8c97('0x86')](_0x54c3d6[_0x8c97('0x5b')])){return this[_0x8c97('0x10')]['noop'](_0x8c97('0xc4'));}this[_0x8c97('0x10')][_0x8c97('0xa6')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x54c3d6[_0x8c97('0x5b')]));var _0x302209=this['googleTTS'][_0x8c97('0x6f')](this,_0x54c3d6);if(_0x302209){this['channel']['noop'](util[_0x8c97('0x2b')](_0x8c97('0x1b9'),_0x302209));var _0x27896d=this[_0x8c97('0x10')][_0x8c97('0x102')](_0x302209);try{fs[_0x8c97('0x103')](_0x302209+_0x8c97('0x104'));}catch(_0x49594c){logger[_0x8c97('0x2e')](_0x49594c);}return _0x27896d;}return this['channel']['error'](_0x54c3d6,_0x8c97('0x1ba'));};AGIVertices['prototype'][_0x8c97('0x1bb')]=function(_0x2227dc){logger[_0x8c97('0x30')](util['format'](_0x8c97('0x1bc'),_0x2227dc['label']));if(!this['isConfigured'](_0x2227dc[_0x8c97('0x14c')])){return this['channel'][_0x8c97('0x2e')](_0x2227dc,_0x8c97('0x1bd'));}logger[_0x8c97('0x30')](util['format'](_0x8c97('0x151'),this[_0x8c97('0x10')]['callerid'],_0x2227dc[_0x8c97('0x14c')]));var _0x9916fd=this['agentUnpause'][_0x8c97('0x6f')](this,_0x2227dc['findBy']);if(_0x9916fd){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x14d'),this[_0x8c97('0x10')]['callerid'],_0x2227dc[_0x8c97('0x14c')]));this[_0x8c97('0x10')][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x14d'),this[_0x8c97('0x10')]['callerid'],_0x2227dc['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x8c97('0x10')][_0x8c97('0x51')],_0x2227dc['findBy']));this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0x14f'),this['channel']['callerid'],_0x2227dc[_0x8c97('0x14c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x8c97('0x12')]['voicemail']=function(_0x57efad){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')](_0x8c97('0x1be'),_0x57efad[_0x8c97('0x3a')]));var _0xb09268=this['channel'][_0x8c97('0x56')]('VOICEMAIL',[_0x57efad[_0x8c97('0x1bf')],_0x57efad[_0x8c97('0x77')]]);if(_0xb09268[_0x8c97('0xa1')]===-0x1){return _0xb09268;}return this['channel'][_0x8c97('0xa6')](util[_0x8c97('0x2b')](_0x8c97('0xc0'),_0x8c97('0x1c0'),_0x57efad['mailbox']));};AGIVertices[_0x8c97('0x12')]['vswitch']=function(_0x2bbcb3){logger[_0x8c97('0x30')](util[_0x8c97('0x2b')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2bbcb3[_0x8c97('0x3a')]));if(!this[_0x8c97('0x86')](_0x2bbcb3[_0x8c97('0xd7')])){return this[_0x8c97('0x10')][_0x8c97('0x2e')](_0x2bbcb3,_0x8c97('0x19f'));}var _0x9b2dbc=this[_0x8c97('0x13')][_0x8c97('0x6f')](this,_0x2bbcb3['variable_id']);if(!_0x9b2dbc){return this[_0x8c97('0x10')]['error'](_0x2bbcb3,_0x8c97('0xd8'));}var _0x8f2dd=this[_0x8c97('0x10')][_0x8c97('0x13')](_0x9b2dbc);return{'code':0xc8,'result':_0x8f2dd['extra']?_0x8f2dd['extra']:'-'};};String[_0x8c97('0x12')][_0x8c97('0x1c1')]=function(_0x2ac5d2,_0x1014d1){return this['split'](_0x2ac5d2)[_0x8c97('0x1c2')](_0x1014d1);};module[_0x8c97('0x1c3')]=AGIVertices; \ No newline at end of file +var _0xb717=['shelljs','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','getVariableById','name','catch','rpc','getVoiceQueueById','getSquareProject','then','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','context','extension','priority','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','text','languageCode','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','isString','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','toString','getAndSetVariable','sync','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','list_id','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','forEach','dial','sip_id','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','phone','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getData','test','mindigit','maxdigit','no\x20variable\x20found','generate','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','.wav','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','%s/recordings/%s','RECORDING_SAVENAME','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','template_id','debug','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','voicemail','VOICEMAIL','mailbox','join','exports','util'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xb717,0x1b4));var _0x7b71=function(_0xb0055d,_0x272b8d){_0xb0055d=_0xb0055d-0x0;var _0x259dcf=_0xb717[_0xb0055d];return _0x259dcf;};'use strict';var fs=require('fs');var util=require(_0x7b71('0x0'));var _=require('lodash');var sh=require(_0x7b71('0x1'));var odbc=require('odbc')();var rs=require(_0x7b71('0x2'));var moment=require(_0x7b71('0x3'));var Mustache=require(_0x7b71('0x4'));var rp=require('request-promise');var logger=require(_0x7b71('0x5'))(_0x7b71('0x6'));var config=require(_0x7b71('0x7'));var scripts=require(_0x7b71('0x8'));var FILES_PATH=_0x7b71('0x9');var recursiveMapAttributes=['rawHeaders',_0x7b71('0xa')];var verticesWithRetry=[_0x7b71('0xb'),_0x7b71('0xc'),_0x7b71('0xd')];var AGIVertices=function(_0xc46853,_0x570e98,_0x18867f){this[_0x7b71('0xe')]=_0xc46853;this['rpc']=_0x570e98;this[_0x7b71('0xf')]=_0x18867f;};AGIVertices[_0x7b71('0x10')][_0x7b71('0x11')]=function(_0x55c72a,_0x2aed3b){this['rpc'][_0x7b71('0x12')](_0x55c72a)['then'](function(_0x191289){_0x2aed3b(null,_0x191289?_0x191289[_0x7b71('0x13')]:![]);})[_0x7b71('0x14')](function(_0x101181){_0x2aed3b(_0x101181);});};AGIVertices[_0x7b71('0x10')]['getVoiceQueue']=function(_0x453d50,_0x481d32){this[_0x7b71('0x15')][_0x7b71('0x16')](_0x453d50)['then'](function(_0x351442){_0x481d32(null,_0x351442?_0x351442[_0x7b71('0x13')]:![]);})[_0x7b71('0x14')](function(_0x5888f9){_0x481d32(_0x5888f9);});};AGIVertices['prototype'][_0x7b71('0x17')]=function(_0x3dc48a,_0x35c943){this[_0x7b71('0x15')]['getSquareProjectById'](_0x3dc48a)[_0x7b71('0x18')](function(_0x5ca420){_0x35c943(null,_0x5ca420?_0x5ca420['name']:![]);})[_0x7b71('0x14')](function(_0xbde25){_0x35c943(_0xbde25);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x19')]=function(_0x2fc4a0,_0x51d647){this[_0x7b71('0x15')][_0x7b71('0x1a')](_0x2fc4a0)[_0x7b71('0x18')](function(_0x1941b9){_0x51d647(null,_0x1941b9?_0x1941b9[_0x7b71('0x1b')]:![]);})[_0x7b71('0x14')](function(_0x527e3f){_0x51d647(_0x527e3f);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x1c')]=function(_0x204c69,_0x375f85){this['rpc']['getUserById'](_0x204c69)[_0x7b71('0x18')](function(_0xbd752b){_0x375f85(null,_0xbd752b?_0xbd752b[_0x7b71('0x13')]:![]);})[_0x7b71('0x14')](function(_0x3aca34){_0x375f85(_0x3aca34);});};AGIVertices['prototype'][_0x7b71('0x1d')]=function(_0x58591c,_0x16c1f3){this[_0x7b71('0x15')][_0x7b71('0x1e')](_0x58591c)[_0x7b71('0x18')](function(_0x49ce76){_0x16c1f3(null,_0x49ce76?_0x49ce76['name']:![]);})[_0x7b71('0x14')](function(_0x28841d){_0x16c1f3(_0x28841d);});};AGIVertices['prototype'][_0x7b71('0x1f')]=function(_0x214555,_0x7c978b){var _0x2f9ca9=this;this[_0x7b71('0x15')]['getSoundById'](_0x214555)['then'](function(_0x2b323b){_0x7c978b(null,_0x2b323b?_0x2f9ca9['getSoundPath'](_0x2b323b[_0x7b71('0x20')]):![]);})['catch'](function(_0x18cc43){_0x7c978b(_0x18cc43);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x21')]=function(_0x5539b3,_0x1e4e89){this[_0x7b71('0x15')][_0x7b71('0x22')](_0x5539b3)['then'](function(_0x5e11e1){_0x1e4e89(null,_0x5e11e1?_0x5e11e1:![]);})[_0x7b71('0x14')](function(_0x14ff72){_0x1e4e89(_0x14ff72);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x23')]=function(_0x43925c,_0x38c1a8,_0x4761cb){this['mailRpc'][_0x7b71('0x23')](_0x43925c,_0x38c1a8)[_0x7b71('0x18')](function(){_0x4761cb(null);})[_0x7b71('0x14')](function(_0x57e8ce){_0x4761cb(_0x57e8ce);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x24')]=function(_0x2de811,_0x37ef84){this[_0x7b71('0x15')][_0x7b71('0x25')](_0x2de811)['then'](function(_0x3f231c){if(_0x3f231c){if(_0x3f231c[_0x7b71('0x26')]){_0x37ef84(null,[_0x3f231c[_0x7b71('0x27')]]);}else{_0x37ef84(null,_[_0x7b71('0x28')](_0x3f231c[_0x7b71('0x29')],'interval'));}}else{_0x37ef84(null,![]);}})[_0x7b71('0x14')](function(_0x31e0d1){_0x37ef84(_0x31e0d1);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x2a')]=function(_0x7cb6c1){return util[_0x7b71('0x2b')](_0x7b71('0x2c'),FILES_PATH,_0x7cb6c1);};AGIVertices[_0x7b71('0x10')]['getQueryOdbc']=function(_0x3be99c,_0x3074aa,_0x2a3330){odbc[_0x7b71('0x2d')](_0x3be99c,function(_0x4b816f){if(_0x4b816f){logger[_0x7b71('0x2e')](_0x7b71('0x2f'),_0x4b816f);_0x2a3330(_0x4b816f);}else{logger['info'](_0x7b71('0x30'));odbc[_0x7b71('0x31')](_0x3074aa,function(_0x12b48d,_0x1af1c6){if(_0x12b48d){logger['info'](_0x7b71('0x32'),_0x3074aa);_0x2a3330(_0x12b48d);}else{logger[_0x7b71('0x33')](_0x7b71('0x34'),_0x3074aa);odbc[_0x7b71('0x35')](function(_0x25b7f4){if(_0x25b7f4){logger[_0x7b71('0x2e')](_0x7b71('0x36'),_0x25b7f4);}_0x2a3330(null,_0x1af1c6);});}});}});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x37')]=function(_0x6cc0ab,_0xa1db9f){this[_0x7b71('0x15')]['getSmsAccountById'](_0x6cc0ab)[_0x7b71('0x18')](function(_0x3f795b){_0xa1db9f(null,_0x3f795b?_0x3f795b:![]);})['catch'](function(_0x1b30e8){_0xa1db9f(_0x1b30e8);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x38')]=function(_0x1719b8,_0x20b8fc){this['rpc'][_0x7b71('0x38')](_0x1719b8)[_0x7b71('0x18')](function(_0x2d6f20){_0x20b8fc(null,_0x2d6f20);})[_0x7b71('0x14')](function(_0x136070){_0x20b8fc(_0x136070);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x3f9e98,_0x541730,_0x2c2729){this[_0x7b71('0x15')][_0x7b71('0x39')]({'uniqueid':this[_0x7b71('0xe')][_0x7b71('0x3a')],'node':_0x3f9e98[_0x7b71('0x3b')],'application':_0x3f9e98[_0x7b71('0x3c')],'data':_0x541730||null,'project_name':this['channel'][_0x7b71('0x3d')],'callerid':this[_0x7b71('0xe')]['callerid']})[_0x7b71('0x18')](function(_0x96c37e){if(_0x2c2729){_0x2c2729(null,_0x96c37e);}})[_0x7b71('0x14')](function(_0x443e61){if(_0x2c2729){_0x2c2729(_0x443e61);}});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x3e')]=function(_0xf78be9,_0x227b5e,_0x18435c,_0x4412ca){this[_0x7b71('0x15')][_0x7b71('0x3e')]({'uniqueid':this[_0x7b71('0xe')]['uniqueid'],'callerid':this[_0x7b71('0xe')][_0x7b71('0x3f')],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0x7b71('0x40')],'extension':this[_0x7b71('0xe')][_0x7b71('0x41')],'priority':this['channel'][_0x7b71('0x42')],'accountcode':this[_0x7b71('0xe')]['accountcode'],'dnid':this[_0x7b71('0xe')][_0x7b71('0x43')],'projectName':this[_0x7b71('0xe')]['arg_1'],'saveName':_0x227b5e,'filename':_0xf78be9[_0x7b71('0x44')]||_0x227b5e,'savePath':_0x18435c})[_0x7b71('0x18')](function(_0x945c68){_0x4412ca(null,_0x945c68);})[_0x7b71('0x14')](function(_0x20e9ed){_0x4412ca(_0x20e9ed);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x45')]=function(_0x30e8d8,_0xdb438,_0x32bf02,_0x35b792,_0xe6825d){this['rpc'][_0x7b71('0x45')]({'uniqueid':this['channel'][_0x7b71('0x3a')],'body':_0x30e8d8,'direction':_0xdb438,'providerName':_0x32bf02,'providerResponse':_0x35b792})[_0x7b71('0x18')](function(_0x45f94b){if(_0xe6825d){_0xe6825d(null,_0x45f94b);}})[_0x7b71('0x14')](function(_0x3571d0){if(_0xe6825d){_0xe6825d(_0x3571d0);}});};AGIVertices[_0x7b71('0x10')]['createCmContact']=function(_0x318605,_0x5c6146){this['rpc'][_0x7b71('0x46')]({'firstName':_['isEmpty'](_0x318605[_0x7b71('0x13')])||_[_0x7b71('0x47')](_0x318605[_0x7b71('0x13')])?_0x7b71('0x48')+Math[_0x7b71('0x49')]():_0x318605[_0x7b71('0x13')],'lastName':_[_0x7b71('0x4a')](_0x318605[_0x7b71('0x4b')])||_[_0x7b71('0x47')](_0x318605[_0x7b71('0x4b')])?null:_0x318605[_0x7b71('0x4b')],'phone':_0x318605['phone'],'ListId':_0x318605['list_id'],'scheduledat':_0x318605[_0x7b71('0x4c')],'callbackUniqueid':this['channel'][_0x7b71('0x3a')],'tags':_0x7b71('0x4d'),'description':_0x7b71('0x4e')+_0x318605['scheduledAt']['toString'](),'priority':_0x318605['callback_priority']})[_0x7b71('0x18')](function(_0x48b486){_0x5c6146(null,_0x48b486);})[_0x7b71('0x14')](function(_0x1af6a2){_0x5c6146(_0x1af6a2);});};AGIVertices['prototype'][_0x7b71('0x4f')]=function(_0x5c8dd2,_0x46c589){this['rpc'][_0x7b71('0x50')](_0x5c8dd2)['then'](function(_0x2256f6){_0x46c589(null,_0x2256f6?_0x2256f6['name']:![]);})[_0x7b71('0x14')](function(_0x53e33a){_0x46c589(_0x53e33a);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x51')]=function(_0x2980e7,_0x5bfdfb,_0x510a30){var _0x265b04={'role':_0x7b71('0x52')};_0x265b04[_0x2980e7]=this[_0x7b71('0xe')][_0x7b71('0x3f')];this[_0x7b71('0x15')][_0x7b71('0x51')](_0x265b04,_0x5bfdfb,this['channel'][_0x7b71('0x3a')])[_0x7b71('0x18')](function(_0x4dd001){_0x510a30(null,_[_0x7b71('0x47')](_0x4dd001)?![]:!![]);})['catch'](function(_0x5bc4f9){logger[_0x7b71('0x2e')](_0x5bc4f9);_0x510a30(null,![]);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x53')]=function(_0x4e478d,_0x38dbd7){var _0x361d38={'role':_0x7b71('0x52')};_0x361d38[_0x4e478d]=this[_0x7b71('0xe')][_0x7b71('0x3f')];this[_0x7b71('0x15')][_0x7b71('0x53')](_0x361d38)[_0x7b71('0x18')](function(_0x46856b){_0x38dbd7(null,_['isNil'](_0x46856b)?![]:!![]);})[_0x7b71('0x14')](function(_0x2304b7){logger[_0x7b71('0x2e')](_0x2304b7);_0x38dbd7(null,![]);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x54')]=function(_0x3a138a,_0x3cadf7){var _0x2f1b0b={'role':_0x7b71('0x52')};_0x2f1b0b[_0x3a138a]=this[_0x7b71('0xe')]['callerid'];this[_0x7b71('0x15')]['agentLogout'](_0x2f1b0b)['then'](function(_0x43261a){_0x3cadf7(null,_[_0x7b71('0x47')](_0x43261a)?![]:!![]);})[_0x7b71('0x14')](function(_0x964817){logger[_0x7b71('0x2e')](_0x964817);_0x3cadf7(null,![]);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x55')]=function(_0x17f0e2,_0x33cdb5){var _0x50b77d={'role':_0x7b71('0x52')};_0x50b77d[_0x17f0e2]=this[_0x7b71('0xe')][_0x7b71('0x3f')];var _0x487320=_0x17f0e2!=_0x7b71('0x56')?util[_0x7b71('0x2b')](_0x7b71('0x57'),_0x7b71('0x58'),this['channel']['callerid']):undefined;this[_0x7b71('0x15')][_0x7b71('0x55')](_0x50b77d,_0x487320)[_0x7b71('0x18')](function(_0x763ce1){_0x33cdb5(null,_[_0x7b71('0x47')](_0x763ce1)?![]:!![]);})[_0x7b71('0x14')](function(_0x4073f3){logger[_0x7b71('0x2e')](_0x4073f3);_0x33cdb5(null,![]);});};AGIVertices[_0x7b71('0x10')]['shellCommand']=function(_0x9d6c3c,_0xcd130f){sh[_0x7b71('0x59')](_[_0x7b71('0x5a')](_0x9d6c3c),function(_0x90f3b1,_0x47759b){var _0x3f2952=_0x47759b[_0x7b71('0x5b')](/(\r\n|\n|\r)/gm,'');_0xcd130f(null,_0x3f2952);});};AGIVertices['prototype'][_0x7b71('0x5c')]=function(_0x1e983c,_0x4e40f7){scripts[_0x7b71('0x5c')](_0x1e983c['apiKey'],_0x1e983c['google_cloud_tts_text_type']||'text',_0x1e983c[_0x7b71('0x5d')],_0x1e983c[_0x7b71('0x5e')]||'en-US',_0x1e983c['ssmlGender']||_0x7b71('0x5f'),_0x1e983c[_0x7b71('0x60')]||_0x7b71('0x61'))[_0x7b71('0x18')](function(_0x33042d){_0x4e40f7(null,_0x33042d);})[_0x7b71('0x14')](function(_0x743a94){_0x4e40f7(_0x743a94);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x62')]=function(_0x4364a3,_0x33a0a9){scripts[_0x7b71('0x62')](_0x4364a3[_0x7b71('0x5d')],_0x4364a3[_0x7b71('0x63')]||'en',0x1)[_0x7b71('0x18')](function(_0x6da04d){_0x33a0a9(null,_0x6da04d);})[_0x7b71('0x14')](function(_0x1d4152){_0x33a0a9(_0x1d4152);});};AGIVertices['prototype']['restAPI']=function(_0x564b69,_0x4269a6){var _0x58ed1d={'uri':_0x564b69[_0x7b71('0x64')],'method':_0x564b69[_0x7b71('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x564b69[_0x7b71('0x66')])===_0x7b71('0x67')&&parseInt(_0x564b69[_0x7b71('0x66')])>=0x1?parseInt(_0x564b69[_0x7b71('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x7b71('0x68'),_0x7b71('0x69')],_0x58ed1d[_0x7b71('0x65')][_0x7b71('0x6a')]())){try{_0x58ed1d[_0x7b71('0x6b')]=_0x564b69['rawBody']?JSON['parse'](_0x564b69[_0x7b71('0xa')]):{};}catch(_0x10445b){logger[_0x7b71('0x2e')](_0x7b71('0x6c'),_0x10445b);}}try{_0x58ed1d[_0x7b71('0x6d')]=_0x564b69[_0x7b71('0x6e')]?JSON[_0x7b71('0x6f')](_0x564b69[_0x7b71('0x6e')]):{};}catch(_0x2461b6){logger[_0x7b71('0x2e')](_0x7b71('0x70'),_0x2461b6);}if(_0x564b69['computedVariables']){try{var _0x45cecd=require(_0x564b69['computedVariables'])['sync'](this,_0x58ed1d);_0x58ed1d[_0x7b71('0x71')]=Mustache['render'](_0x564b69[_0x7b71('0x64')],_0x45cecd,{},['$$','$$']);if(_0x58ed1d['headers']){_0x58ed1d['headers']=JSON[_0x7b71('0x6f')](Mustache[_0x7b71('0x72')](JSON[_0x7b71('0x73')](_0x58ed1d['headers']),_0x45cecd,{},['$$','$$']));}if(_0x58ed1d[_0x7b71('0x6b')]){_0x58ed1d[_0x7b71('0x6b')]=JSON[_0x7b71('0x6f')](Mustache['render'](JSON[_0x7b71('0x73')](_0x58ed1d[_0x7b71('0x6b')]),_0x45cecd,{},['$$','$$']));}}catch(_0x4458f8){logger[_0x7b71('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4458f8);}}rp(_0x58ed1d)[_0x7b71('0x18')](function(_0x311476){var _0x2681ae={'statusCode':_0x311476[_0x7b71('0x74')]||0xc8,'statusMessage':_0x311476[_0x7b71('0x75')]||'OK','headers':_0x311476[_0x7b71('0x6d')]||{},'body':_0x311476[_0x7b71('0x6b')]||{}};_0x4269a6(null,_0x2681ae);})[_0x7b71('0x14')](function(_0x718699){var _0x3d298c={'statusCode':_0x718699[_0x7b71('0x74')]||0x1f4,'statusMessage':_0x718699[_0x7b71('0x76')]||_0x7b71('0x77'),'headers':_0x718699[_0x7b71('0x78')]['headers']||{},'body':_0x718699['options'][_0x7b71('0x6b')]||{}};_0x4269a6(null,_0x3d298c);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x79')]=function(_0x3553de,_0x457115){scripts['googleDialogflow'](this[_0x7b71('0xe')][_0x7b71('0x3a')],_0x3553de[_0x7b71('0x7a')],_0x3553de[_0x7b71('0x5d')],_0x3553de[_0x7b71('0x7b')]||'en')[_0x7b71('0x18')](function(_0x37446f){_0x457115(null,_0x37446f);})[_0x7b71('0x14')](function(_0x4973f8){_0x457115(_0x4973f8);});};AGIVertices[_0x7b71('0x10')]['googleDialogflowV2']=function(_0x56f4d0,_0x5768b5){scripts[_0x7b71('0x7c')](this[_0x7b71('0xe')][_0x7b71('0x3a')],_0x56f4d0['dialogflowV2_project_id'],_0x56f4d0[_0x7b71('0x7d')],_0x56f4d0[_0x7b71('0x7e')],_0x56f4d0[_0x7b71('0x5d')],_0x56f4d0[_0x7b71('0x7f')]||'en')['then'](function(_0x16755e){_0x5768b5(null,_0x16755e);})[_0x7b71('0x14')](function(_0x43041f){_0x5768b5(_0x43041f);});};AGIVertices[_0x7b71('0x10')]['sestekNDA']=function(_0x1e0728,_0x2b4c3f){scripts[_0x7b71('0x80')](this[_0x7b71('0xe')],_0x1e0728)['then'](function(_0x21eeb0){_0x2b4c3f(null,_0x21eeb0);})['catch'](function(_0x366b4b){_0x2b4c3f(_0x366b4b);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x81')]=function(_0x490e5b,_0x82c11d){scripts[_0x7b71('0x81')](_0x490e5b['key'],_0x490e5b['text'],_0x490e5b[_0x7b71('0x82')]||'en-US',_0x490e5b[_0x7b71('0x83')])[_0x7b71('0x18')](function(_0x2cde65){_0x82c11d(null,_0x2cde65);})['catch'](function(_0x5b133a){_0x82c11d(_0x5b133a);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x84')]=function(_0x1be4eb,_0x1a5633,_0x4132c0){scripts[_0x7b71('0x84')](_0x1a5633,_0x1be4eb[_0x7b71('0x7a')],_0x1be4eb[_0x7b71('0x85')]||_0x7b71('0x86'),this[_0x7b71('0x87')](_0x1be4eb[_0x7b71('0x88')])?_0x1be4eb['model']:undefined)[_0x7b71('0x18')](function(_0x34e61a){_0x4132c0(null,_0x34e61a);})[_0x7b71('0x14')](function(_0x4b7678){_0x4132c0(_0x4b7678);});};AGIVertices[_0x7b71('0x10')]['awsPolly']=function(_0xcfe64f,_0x35d65f){scripts[_0x7b71('0x89')](_0xcfe64f[_0x7b71('0x8a')],_0xcfe64f['aws_secret_access_key'],_0xcfe64f[_0x7b71('0x8b')],_0xcfe64f['aws_polly_voice']||'Amy',_0xcfe64f[_0x7b71('0x5d')],_0xcfe64f['aws_text_type']||_0x7b71('0x5d'))[_0x7b71('0x18')](function(_0x3a489e){_0x35d65f(null,_0x3a489e);})[_0x7b71('0x14')](function(_0x5ab7b8){_0x35d65f(_0x5ab7b8);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x8c')]=function(_0x513d92,_0x12b00b){scripts[_0x7b71('0x8c')](this['channel'][_0x7b71('0x3a')],_0x513d92[_0x7b71('0x8a')],_0x513d92['aws_secret_access_key'],_0x513d92[_0x7b71('0x8d')],_0x513d92[_0x7b71('0x5d')],_0x513d92[_0x7b71('0x8e')])[_0x7b71('0x18')](function(_0xd8a3f0){_0x12b00b(null,_0xd8a3f0);})['catch'](function(_0x29abe0){_0x12b00b(_0x29abe0);});};AGIVertices[_0x7b71('0x10')]['googleASR']=function(_0x2efaea,_0xa8e84f,_0x95cf38){scripts[_0x7b71('0x8f')](_0xa8e84f,_0x2efaea['key'],_0x2efaea[_0x7b71('0x90')]||_0x7b71('0x86'))[_0x7b71('0x18')](function(_0x3f6670){_0x95cf38(null,_0x3f6670);})[_0x7b71('0x14')](function(_0x2fbce9){_0x95cf38(_0x2fbce9);});};AGIVertices['prototype'][_0x7b71('0x91')]=function(_0x2a791e,_0x452dc4,_0xe0323f){scripts[_0x7b71('0x91')](_0x452dc4,_0x2a791e[_0x7b71('0x92')],_0x2a791e[_0x7b71('0x93')],_0x2a791e['uri'])['then'](function(_0x31f22d){_0xe0323f(null,_0x31f22d);})[_0x7b71('0x14')](function(_0x145827){_0xe0323f(_0x145827);});};AGIVertices[_0x7b71('0x10')][_0x7b71('0x94')]=function(_0x1351a5){var _0x5839c4=_[_0x7b71('0x95')](verticesWithRetry,_0x1351a5[_0x7b71('0x3c')])?_0x1351a5:_[_0x7b71('0x96')](_0x1351a5);for(var _0x14ef43 in _0x5839c4){if(_0x5839c4[_0x7b71('0x97')](_0x14ef43)){if(_0x5839c4[_0x14ef43]&&_['isString'](_0x5839c4[_0x14ef43])){if(_[_0x7b71('0x95')](recursiveMapAttributes,_0x14ef43)){_0x5839c4[_0x14ef43]=this[_0x7b71('0x98')](_0x5839c4[_0x14ef43]);}else{_0x5839c4[_0x14ef43]=this['replaceAllVariables'](_0x5839c4[_0x14ef43]);}}}}return _0x5839c4;};AGIVertices[_0x7b71('0x10')]['recursiveNodeIndex']=function(_0x1bbad5){for(var _0x1e2cc9 in _0x1bbad5){if(_0x1bbad5[_0x7b71('0x97')](_0x1e2cc9)){if(_[_0x7b71('0x99')](_0x1bbad5[_0x1e2cc9])){this[_0x7b71('0x9a')](_0x1bbad5[_0x1e2cc9]);}else if(_[_0x7b71('0x9b')](_0x1bbad5[_0x1e2cc9])){for(var _0x2d0389=0x0;_0x2d0389<_0x1bbad5[_0x1e2cc9][_0x7b71('0x9c')];_0x2d0389++){this[_0x7b71('0x9a')](_0x1bbad5[_0x1e2cc9][_0x2d0389]);}}else if(_[_0x7b71('0x9d')](_0x1bbad5[_0x1e2cc9])){_0x1bbad5[_0x1e2cc9]=this[_0x7b71('0x9e')](_0x1bbad5[_0x1e2cc9]);}}}};AGIVertices[_0x7b71('0x10')]['saveRestApiResult']=function(_0x56405c,_0x4cc313){for(var _0x1531c0 in _0x56405c){if(_0x56405c[_0x7b71('0x97')](_0x1531c0)){if(_[_0x7b71('0x99')](_0x56405c[_0x1531c0])){if(!_['isEmpty'](_0x56405c[_0x1531c0])){this['saveRestApiResult'](_0x56405c[_0x1531c0],util[_0x7b71('0x2b')]('%s.%s',_0x4cc313,_0x1531c0));}}else if(_['isArray'](_0x56405c[_0x1531c0])){for(var _0x4a4f73=0x0;_0x4a4f73<_0x56405c[_0x1531c0][_0x7b71('0x9c')];_0x4a4f73++){this[_0x7b71('0x9f')](_0x56405c[_0x1531c0][_0x4a4f73],util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x4cc313,_0x1531c0+'['+_0x4a4f73+']'));}}else{if(!_[_0x7b71('0x47')](_0x56405c[_0x1531c0])){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x4cc313,_0x1531c0),_0x56405c[_0x1531c0]);}}}}};AGIVertices['prototype'][_0x7b71('0x98')]=function(_0x174e6a){try{var _0x326663=JSON[_0x7b71('0x6f')](_0x174e6a);this[_0x7b71('0x9a')](_0x326663);return JSON[_0x7b71('0x73')](_0x326663);}catch(_0x1e2f82){return this['replaceAllVariables'](_0x174e6a);}};AGIVertices[_0x7b71('0x10')]['replaceAllVariables']=function(_0x5c38ed){var _0x8bb6fc=_0x5c38ed[_0x7b71('0xa2')]('{');for(var _0x35ccb9=0x1;_0x35ccb9<_0x8bb6fc[_0x7b71('0x9c')];_0x35ccb9+=0x1){var _0x2f156f=_0x8bb6fc[_0x35ccb9][_0x7b71('0xa2')]('}');if(_0x2f156f[_0x7b71('0x9c')]>0x1){_0x5c38ed=_0x5c38ed[_0x7b71('0xa3')]('{'+_0x2f156f[0x0]+'}',this[_0x7b71('0xe')][_0x7b71('0x11')](_0x2f156f[0x0])[_0x7b71('0xa4')]||_0x2f156f[0x0]);}}if(_0x8bb6fc[_0x7b71('0x9c')]===0x1){return _0x5c38ed[_0x7b71('0xa5')]();}return this[_0x7b71('0x9e')](_0x5c38ed);};AGIVertices[_0x7b71('0x10')][_0x7b71('0xa6')]=function(_0x4b927a,_0x3a24d7){var _0x188bac=this[_0x7b71('0xe')][_0x7b71('0x11')](_0x4b927a);if(_0x188bac['result']===-0x1){return _0x188bac;}logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3a24d7,_0x188bac[_0x7b71('0xa4')]));return this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x3a24d7,_0x188bac['extra']);};AGIVertices[_0x7b71('0x10')]['isConfigured']=function(_0x5673db){return _0x5673db&&_0x5673db!=='0'&&_0x5673db!=='-1'&&_0x5673db!=='';};AGIVertices[_0x7b71('0x10')]['maxRetry']=function(_0x5dc3c3){this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x5dc3c3,'-');_0x5dc3c3['retry']=_0x5dc3c3[_0x7b71('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x7b71('0xa9')]=function(_0x235350){logger[_0x7b71('0x33')](util['format'](_0x7b71('0xaa'),_0x235350['label']));if(!this[_0x7b71('0x87')](_0x235350['text'])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20text\x20configured');}var _0x2d1fe3='\x22'+_0x235350[_0x7b71('0x5d')]+'\x22';if(this[_0x7b71('0x87')](_0x235350[_0x7b71('0x78')])){_0x2d1fe3+=','+_0x235350[_0x7b71('0x78')];}var _0x42f6d7=this['channel'][_0x7b71('0x59')](_0x7b71('0xac'),_0x2d1fe3);if(_0x42f6d7[_0x7b71('0xad')]===-0x1){return _0x42f6d7;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xae'),_0x2d1fe3));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xaf')]=function(_0x360bd5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x360bd5[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x360bd5[_0x7b71('0xb0')])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20grammar\x20configured');}var _0xf7d3db=_0x360bd5['grammar'];if(this[_0x7b71('0x87')](_0x360bd5[_0x7b71('0x78')])){_0xf7d3db+=','+_0x360bd5[_0x7b71('0x78')];}var _0x1d6f93=this['channel'][_0x7b71('0x59')](_0x7b71('0xb1'),_0xf7d3db);if(_0x1d6f93[_0x7b71('0xad')]===-0x1){return _0x1d6f93;}var _0x3778d6=this[_0x7b71('0xa6')](_0x7b71('0xb2'),'MRCP_RECOG_CONFIDENCE');if(_0x3778d6[_0x7b71('0xad')]===-0x1){return _0x3778d6;}var _0x56e0ab=this['getAndSetVariable'](_0x7b71('0xb3'),_0x7b71('0xb4'));if(_0x56e0ab[_0x7b71('0xad')]===-0x1){return _0x56e0ab;}var _0xcf3dd6=this[_0x7b71('0xa6')](_0x7b71('0xb5'),_0x7b71('0xb6'));if(_0xcf3dd6['result']===-0x1){return _0xcf3dd6;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xb7'),_0xf7d3db));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x6')]=function(_0x41dc95){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xb8'),_0x41dc95[_0x7b71('0x3b')]));return this['channel']['agi']([_0x41dc95[_0x7b71('0xb9')],_0x41dc95[_0x7b71('0xba')]]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0xbb')]=function(_0x513f35){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xbc'),_0x513f35[_0x7b71('0x3b')]));if(this['isConfigured'](_0x513f35[_0x7b71('0x66')])){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x513f35[_0x7b71('0x66')]));var _0x3748e6=this[_0x7b71('0xe')][_0x7b71('0xbd')](_0x513f35[_0x7b71('0x66')]);if(_0x3748e6['result']===-0x1){return _0x3748e6;}}return this[_0x7b71('0xe')]['answer']();};AGIVertices[_0x7b71('0x10')][_0x7b71('0x4d')]=function(_0x54eeb8){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x54eeb8[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x54eeb8[_0x7b71('0xbe')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x54eeb8,'no\x20list\x20selected');}_0x54eeb8[_0x7b71('0x4c')]=moment();if(this['isConfigured'](_0x54eeb8[_0x7b71('0xbf')])){_0x54eeb8[_0x7b71('0x4c')]=moment()[_0x7b71('0xc0')](_0x54eeb8[_0x7b71('0xbf')],_0x7b71('0xc1'));}if(!this[_0x7b71('0x87')](_0x54eeb8['callback_priority'])){_0x54eeb8['callback_priority']=0x2;}this[_0x7b71('0x46')][_0x7b71('0xa7')](this,_0x54eeb8);return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc2'),_0x54eeb8['phone'],_0x54eeb8[_0x7b71('0xbe')],_0x54eeb8[_0x7b71('0x4c')]));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xc3')]=function(_0x57e3a6){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xc4'),_0x57e3a6[_0x7b71('0x3b')]));var _0x5d14b5=this['channel'][_0x7b71('0x59')](_0x57e3a6[_0x7b71('0xc5')],_0x57e3a6[_0x7b71('0x78')]);if(_0x5d14b5['result']===-0x1){return _0x5d14b5;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),_0x57e3a6[_0x7b71('0xc5')],_0x57e3a6[_0x7b71('0x78')]));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xc7')]=function(_0x1d308f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x1d308f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x1d308f[_0x7b71('0x5d')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xc8'));}var _0x169397='\x22'+_0x1d308f['text']+'\x22';if(this[_0x7b71('0x87')](_0x1d308f[_0x7b71('0x78')])){_0x169397+=','+_0x1d308f[_0x7b71('0x78')];}var _0x520011=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xac'),_0x169397);if(_0x520011[_0x7b71('0xad')]===-0x1){return _0x520011;}return this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0xae'),_0x169397));};AGIVertices['prototype'][_0x7b71('0xc9')]=function(_0x394db2){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x394db2[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x394db2['text'])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xc8'));}var _0x4bf980='\x22'+_0x394db2[_0x7b71('0x5d')]+'\x22';if(this[_0x7b71('0x87')](_0x394db2['options'])){_0x4bf980+=','+_0x394db2[_0x7b71('0x78')];}var _0x320356=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xac'),_0x4bf980);if(_0x320356['result']===-0x1){return _0x320356;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xae'),_0x4bf980));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xca')]=function(_0xcadd1b){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xcb'),_0xcadd1b[_0x7b71('0x3b')]));if(!this['isConfigured'](_0xcadd1b['grammar'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xcc'));}var _0x1a7212=_0xcadd1b[_0x7b71('0xb0')];if(this['isConfigured'](_0xcadd1b[_0x7b71('0x78')])){_0x1a7212+=','+_0xcadd1b[_0x7b71('0x78')];}var _0x57f295=this['channel'][_0x7b71('0x59')](_0x7b71('0xb1'),_0x1a7212);if(_0x57f295['result']===-0x1){return _0x57f295;}var _0xf67613=this[_0x7b71('0xa6')]('RECOG_CONFIDENCE()',_0x7b71('0xcd'));if(_0xf67613[_0x7b71('0xad')]===-0x1){return _0xf67613;}var _0xd138b=this[_0x7b71('0xa6')](_0x7b71('0xb3'),_0x7b71('0xce'));if(_0xd138b['result']===-0x1){return _0xd138b;}var _0x1476f4=this[_0x7b71('0xa6')]('RECOG_INSTANCE()',_0x7b71('0xcf'));if(_0x1476f4[_0x7b71('0xad')]===-0x1){return _0x1476f4;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x1a7212));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xd0')]=function(_0x5f36a6){logger['info'](util[_0x7b71('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5f36a6[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x5f36a6['grammar'])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xcc'));}var _0x56b2d5=_0x5f36a6[_0x7b71('0xb0')];if(this[_0x7b71('0x87')](_0x5f36a6[_0x7b71('0x78')])){_0x56b2d5+=','+_0x5f36a6[_0x7b71('0x78')];}var _0x1b634d=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xb1'),_0x56b2d5);if(_0x1b634d[_0x7b71('0xad')]===-0x1){return _0x1b634d;}var _0xc843a9=this['getAndSetVariable'](_0x7b71('0xb2'),_0x7b71('0xd1'));if(_0xc843a9[_0x7b71('0xad')]===-0x1){return _0xc843a9;}var _0x55b3af=this['getAndSetVariable'](_0x7b71('0xb3'),'SESTEK_ASR_TRANSCRIPT');if(_0x55b3af[_0x7b71('0xad')]===-0x1){return _0x55b3af;}var _0x2b8f55=this['getAndSetVariable'](_0x7b71('0xb5'),_0x7b71('0xd2'));if(_0x2b8f55[_0x7b71('0xad')]===-0x1){return _0x2b8f55;}return this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x56b2d5));};AGIVertices[_0x7b71('0x10')]['database']=function(_0x2e16e5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0xd3'),_0x2e16e5[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x2e16e5['odbc_id'])){return this[_0x7b71('0xe')]['error'](_0x2e16e5,_0x7b71('0xd4'));}var _0xeb3f38=this[_0x7b71('0x19')][_0x7b71('0xa7')](this,_0x2e16e5['odbc_id']);if(!_0xeb3f38){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2e16e5,_0x7b71('0xd5'));}if(!this[_0x7b71('0x87')](_0x2e16e5[_0x7b71('0x31')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2e16e5,_0x7b71('0xd6'));}var _0x3d8ecc=_0x2e16e5[_0x7b71('0x31')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0xd7'),_0x3d8ecc));var _0x40890e=this[_0x7b71('0xd8')]['sync'](this,_0xeb3f38,_0x3d8ecc);this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x2e16e5,_0x3d8ecc);if(!this[_0x7b71('0x87')](_0x2e16e5[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xda'));}var _0x517bd8=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x2e16e5[_0x7b71('0xd9')]);if(!_0x517bd8){return this['channel'][_0x7b71('0x2e')](_0x2e16e5,'no\x20variable\x20found');}var _0x3a88f4=this;_0x40890e['forEach'](function(_0x5b3fcf,_0x3fa2c0){Object[_0x7b71('0xdb')](_0x5b3fcf)[_0x7b71('0xdc')](function(_0x1728f1){_0x3a88f4[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')]('%s[%s][%s]',_0x517bd8,_0x3fa2c0,_0x1728f1),_0x5b3fcf[_0x1728f1]);});});this['channel'][_0x7b71('0xa1')](util[_0x7b71('0x2b')]('%s_ROWS_COUNT',_0x517bd8),_0x40890e[_0x7b71('0x9c')]);return this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')]('variable\x20%s\x20set',_0x517bd8));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xdd')]=function(_0x2ddc64){logger['debug'](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2ddc64[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x2ddc64[_0x7b71('0xde')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2ddc64,'no\x20user\x20selected');}var _0x5e70c6=this[_0x7b71('0x1c')]['sync'](this,_0x2ddc64[_0x7b71('0xde')]);if(!_0x5e70c6){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2ddc64,'no\x20user\x20found');}var _0x1944d0=this['channel'][_0x7b71('0x59')](_0x7b71('0xdf'),[util[_0x7b71('0x2b')](_0x7b71('0xe0'),_0x5e70c6),_0x2ddc64[_0x7b71('0x66')],_0x2ddc64[_0x7b71('0xe1')],_0x2ddc64[_0x7b71('0x64')]]);if(_0x1944d0[_0x7b71('0xad')]===-0x1){return _0x1944d0;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xe2'),'DIAL'));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xe3')]=function(_0x150f2d){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x150f2d[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x150f2d[_0x7b71('0x7a')])){return this['channel'][_0x7b71('0xab')]('no\x20key\x20configured');}if(!this[_0x7b71('0x87')](_0x150f2d[_0x7b71('0x5d')])){return this['channel'][_0x7b71('0xab')]('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xe4')]=!![];this[_0x7b71('0x39')](_0x150f2d);this[_0x7b71('0x45')](_0x150f2d[_0x7b71('0x5d')],'in','','');this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xe5'),_0x150f2d[_0x7b71('0x5d')]));var _0x2c11eb=this[_0x7b71('0x79')][_0x7b71('0xa7')](this,_0x150f2d);if(_0x2c11eb){for(var _0x511f88 in _0x2c11eb){if(_0x2c11eb[_0x7b71('0x97')](_0x511f88)){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')]('DIALOGFLOW_%s',_0x511f88[_0x7b71('0x6a')]()),_0x2c11eb[_0x511f88]);}}this[_0x7b71('0x45')](_0x2c11eb[_0x7b71('0xe6')],_0x7b71('0xe7'),_0x7b71('0xe3'),'');return this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0xe8'),_0x2c11eb[_0x7b71('0xe6')]));}return this['channel']['error'](_0x150f2d,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype']['dialogflowV2']=function(_0x15a001){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x15a001[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0xe9')])){return this['channel']['noop'](_0x7b71('0xea'));}if(!this[_0x7b71('0x87')](_0x15a001['client_email'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xeb'));}if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0x7e')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0xec'));}if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0x7f')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xed'));}if(!this[_0x7b71('0x87')](_0x15a001[_0x7b71('0x5d')])){return this[_0x7b71('0xe')]['noop']('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xe4')]=!![];this[_0x7b71('0x39')](_0x15a001);this[_0x7b71('0x45')](_0x15a001[_0x7b71('0x5d')],'in','','');this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xee'),_0x15a001[_0x7b71('0x5d')]));var _0x36f1fb=this[_0x7b71('0x7c')][_0x7b71('0xa7')](this,_0x15a001);if(_0x36f1fb){for(var _0x5c6127 in _0x36f1fb){if(_0x36f1fb[_0x7b71('0x97')](_0x5c6127)){if(_0x5c6127!==_0x7b71('0xef')){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0xf0'),_0x5c6127[_0x7b71('0x6a')]()),_0x36f1fb[_0x5c6127]);}}}this[_0x7b71('0x45')](_0x36f1fb['speech'],_0x7b71('0xe7'),_0x7b71('0xf1'),_0x36f1fb[_0x7b71('0xef')]);return this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0xf2'),_0x36f1fb[_0x7b71('0xe6')]));}return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x15a001,_0x7b71('0xf3'));};AGIVertices['prototype'][_0x7b71('0xf4')]=function(_0xdb046f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0xdb046f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0xdb046f[_0x7b71('0xf5')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xf6'));}if(!this[_0x7b71('0x87')](_0xdb046f[_0x7b71('0xf7')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xf8'));}if(!this[_0x7b71('0x87')](_0xdb046f['password'])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20password\x20configured');}if(!this[_0x7b71('0x87')](_0xdb046f[_0x7b71('0xf9')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0xc8'));}this[_0x7b71('0xe')][_0x7b71('0xe4')]=!![];this['createSquareDetailsReport'](_0xdb046f);this['createSquareMessage'](_0xdb046f[_0x7b71('0x5d')],'in','','');this['channel']['noop'](util[_0x7b71('0x2b')](_0x7b71('0xfa'),_0xdb046f[_0x7b71('0x5d')]));var _0x298952=this[_0x7b71('0x80')][_0x7b71('0xa7')](this,_0xdb046f);if(_0x298952){for(var _0x35929f in _0x298952){if(_0x298952[_0x7b71('0x97')](_0x35929f)){this['channel'][_0x7b71('0xa1')](util['format']('SESTEK_NDA_%s',_0x35929f['toUpperCase']()),_0x298952[_0x35929f]);}}this[_0x7b71('0x45')](_0x298952[_0x7b71('0xe6')],_0x7b71('0xe7'),_0x7b71('0xf4'),'');if(_0x298952[_0x7b71('0xfb')]){this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0xfc'),_0x298952[_0x7b71('0xfb')]));var _0x59c39f=this[_0x7b71('0xe')][_0x7b71('0xfd')](_0x298952[_0x7b71('0xfb')]);try{fs[_0x7b71('0xfe')](_0x298952[_0x7b71('0xfb')]+'.wav');}catch(_0x506881){logger[_0x7b71('0x2e')](_0x506881);}return _0x59c39f;}else{return this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0xff'),_0x298952['speech']));}}return this['channel'][_0x7b71('0x2e')](_0xdb046f,_0x7b71('0x100'));};AGIVertices['prototype'][_0x7b71('0x101')]=function(_0x23e4bc){logger['info'](util['format'](_0x7b71('0x102'),_0x23e4bc['label']));return this['channel'][_0x7b71('0xab')](_0x7b71('0x101'));};AGIVertices['prototype'][_0x7b71('0x103')]=function(_0x2a7868){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x104'),_0x2a7868['label']));var _0x51687c='';if(_0x2a7868[_0x7b71('0x105')]){if(!this['isConfigured'](_0x2a7868['trunk_id'])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2a7868,_0x7b71('0x106'));}else{var _0x276f13=parseInt(_0x2a7868['trunk_id'],0xa);if(isNaN(_0x276f13)){_0x51687c=_0x2a7868[_0x7b71('0x105')];}else{_0x51687c=this[_0x7b71('0x1d')][_0x7b71('0xa7')](this,_0x2a7868['trunk_id']);if(!_0x51687c){return this['channel']['error'](_0x2a7868,_0x7b71('0x107'));}}}}else if(_0x2a7868['trunk_name']){_0x51687c=_0x2a7868[_0x7b71('0x108')];}else{return this['channel']['error'](_0x2a7868,'no\x20trunk\x20selected');}var _0x555954=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0xdf'),[util[_0x7b71('0x2b')](_0x7b71('0x109'),_0x51687c,_0x2a7868[_0x7b71('0x10a')]),_0x2a7868[_0x7b71('0x66')],_0x2a7868[_0x7b71('0xe1')],_0x2a7868[_0x7b71('0x64')]]);if(_0x555954[_0x7b71('0xad')]===-0x1){return _0x555954;}return this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xe2'),_0x7b71('0xdf')));};AGIVertices['prototype'][_0x7b71('0x10b')]=function(_0x5563a0){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x10c'),_0x5563a0[_0x7b71('0x3b')]));return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x10b'));};AGIVertices[_0x7b71('0x10')][_0x7b71('0xc')]=function(_0x66c78){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x10d'),_0x66c78[_0x7b71('0x3b')]));if(_0x66c78[_0x7b71('0x10e')]===0x0){return this[_0x7b71('0xa8')](_0x66c78);}_0x66c78[_0x7b71('0x10e')]-=0x1;if(!this[_0x7b71('0x87')](_0x66c78[_0x7b71('0x10f')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x66c78,_0x7b71('0x110'));}var _0x3aad7a=this[_0x7b71('0x1f')]['sync'](this,_0x66c78[_0x7b71('0x10f')]);if(!_0x3aad7a){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x66c78,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x66c78[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x7b71('0xda'));}var _0x13d21d=this['channel'][_0x7b71('0x111')](_0x3aad7a,_0x66c78['response'],_0x66c78['maxdigit']);var _0x4f463d=_0x13d21d['result']?_0x13d21d['result']['toString']():'';logger[_0x7b71('0x33')](_0x7b71('0x112'),JSON[_0x7b71('0x73')](_0x13d21d));if(_0x13d21d['result']===-0x1){this['createSquareDetailsReport'][_0x7b71('0xa7')](this,_0x66c78,_0x4f463d);return _0x13d21d;}else if(_0x13d21d['extra']===_0x7b71('0x66')){_0x13d21d[_0x7b71('0xad')]=_0x4f463d[_0x7b71('0x9c')]>=parseInt(_0x66c78[_0x7b71('0x113')])?'x':'i';}else{_0x13d21d['result']=_0x4f463d['length']>=parseInt(_0x66c78[_0x7b71('0x113')])&&_0x4f463d['length']<=parseInt(_0x66c78[_0x7b71('0x114')])?'x':'i';}var _0x2a8282=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x66c78[_0x7b71('0xd9')]);if(!_0x2a8282){return this['channel'][_0x7b71('0x2e')](_0x66c78,_0x7b71('0x115'));}this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x2a8282,_0x4f463d);if(this[_0x7b71('0x87')](_0x66c78['hiddendigitsnum'])){var _0x5f2519=parseInt(_0x66c78['hiddendigitsnum'],0xa);var _0x14e82f=rs[_0x7b71('0x116')]({'charset':'*','length':_0x5f2519});var _0x55342a=_0x4f463d[_0x7b71('0x9c')];if(_0x55342a>0x0){if(_0x55342a>_0x5f2519){this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x66c78,_0x66c78['hiddendigitspos']==='first'?_0x14e82f+_0x4f463d[_0x7b71('0x117')](_0x5f2519):_0x4f463d[_0x7b71('0x117')](0x0,_0x55342a-_0x5f2519)+_0x14e82f);}else{this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x66c78,rs[_0x7b71('0x116')]({'charset':'*','length':_0x55342a}));}}else{this[_0x7b71('0x39')]['sync'](this,_0x66c78,'');}}else{this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x66c78,_0x4f463d);}return _0x13d21d;};AGIVertices[_0x7b71('0x10')][_0x7b71('0xd')]=function(_0x4cd59f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x4cd59f[_0x7b71('0x3b')]));return this['getdigits'](_0x4cd59f);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x118')]=function(_0x1d4e15){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x119'),_0x1d4e15[_0x7b71('0x3b')]));this[_0x7b71('0x39')]['sync'](this,_0x1d4e15,_0x1d4e15[_0x7b71('0x11a')]);return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('GOAL\x20%s',_0x1d4e15[_0x7b71('0x11a')]));};AGIVertices['prototype']['awspolly']=function(_0x783b5f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x11b'),_0x783b5f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x783b5f[_0x7b71('0x8a')])||!this[_0x7b71('0x87')](_0x783b5f[_0x7b71('0x11c')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x11d'));}if(!this[_0x7b71('0x87')](_0x783b5f[_0x7b71('0x5d')])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x11e'),_0x783b5f['text']));var _0x58cb84=this['awsPolly'][_0x7b71('0xa7')](this,_0x783b5f);if(_0x58cb84){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x11f'),_0x58cb84));var _0x16e5d5=this[_0x7b71('0xe')][_0x7b71('0xfd')](_0x58cb84);try{fs[_0x7b71('0xfe')](_0x58cb84+'.wav');}catch(_0xf52364){logger[_0x7b71('0x2e')](_0xf52364);}return _0x16e5d5;}return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x783b5f,_0x7b71('0x120'));};AGIVertices['prototype'][_0x7b71('0x121')]=function(_0x30fdfd){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x30fdfd[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x8a')])||!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x11c')])){return this[_0x7b71('0xe')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x8e')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x122'));}if(!this[_0x7b71('0x87')](_0x30fdfd[_0x7b71('0x5d')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0xc8'));}this[_0x7b71('0xe')]['bot']=!![];this[_0x7b71('0x39')](_0x30fdfd);this[_0x7b71('0x45')](_0x30fdfd[_0x7b71('0x5d')],'in','','');this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x123'),_0x30fdfd[_0x7b71('0x5d')]));var _0x321a2c=this[_0x7b71('0x8c')]['sync'](this,_0x30fdfd);if(_0x321a2c){for(var _0x47f1c9 in _0x321a2c){if(_0x321a2c[_0x7b71('0x97')](_0x47f1c9)&&_[_0x7b71('0x9d')](_0x321a2c[_0x47f1c9])){this[_0x7b71('0xe')][_0x7b71('0xa1')](util['format'](_0x7b71('0x124'),_0x47f1c9['toUpperCase']()),_0x321a2c[_0x47f1c9]);}}if(_[_0x7b71('0x47')](_0x321a2c[_0x7b71('0x76')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x125'));}else{this[_0x7b71('0x45')](_0x321a2c[_0x7b71('0x76')],'out',_0x7b71('0x126'),'');return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x127'),_0x321a2c[_0x7b71('0x76')]));}}return this['channel'][_0x7b71('0x2e')](_0x30fdfd,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x7b71('0x10')][_0x7b71('0x128')]=function(_0x588d86){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x129'),_0x588d86[_0x7b71('0x3b')],_0x588d86[_0x7b71('0x66')]));if(!this['isConfigured'](_0x588d86['key'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x12a'));}var _0x1a0500=_0x7b71('0x12b');var _0x1689e1=util[_0x7b71('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0x7b71('0x116')](0x4));var _0x7c551c=util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x1689e1,_0x1a0500);var _0x332a7b=!![];if(_0x588d86[_0x7b71('0x12c')]==='NOBEEP'){_0x332a7b=![];}var _0x1735d2=this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x1689e1,_0x1a0500,_0x588d86[_0x7b71('0x12e')],_0x588d86['timeout'],undefined,_0x332a7b);if(_0x1735d2[_0x7b71('0xad')]!==-0x1){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x12f'),_0x7c551c));var _0x932ff8=this[_0x7b71('0x8f')][_0x7b71('0xa7')](this,_0x588d86,_0x7c551c);if(_0x932ff8){for(var _0x373b96 in _0x932ff8){if(_0x932ff8[_0x7b71('0x97')](_0x373b96)){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0x130'),_0x373b96['toUpperCase']()),_0x932ff8[_0x373b96]);}}return this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')](_0x7b71('0x131'),JSON[_0x7b71('0x73')](_0x932ff8)));}}return _0x1735d2;};AGIVertices[_0x7b71('0x10')]['tildeasr']=function(_0x139700){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x132'),_0x139700[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x139700[_0x7b71('0x92')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x133'));}if(!this[_0x7b71('0x87')](_0x139700[_0x7b71('0x93')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x134'));}var _0xf4ecac='wav';var _0x112da2=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x7b71('0x116')](0x4));var _0x1ce689=util[_0x7b71('0x2b')]('%s.%s',_0x112da2,_0xf4ecac);var _0x5007b1=!![];if(_0x139700[_0x7b71('0x12c')]===_0x7b71('0x135')){_0x5007b1=![];}var _0x2576db=this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x112da2,_0xf4ecac,_0x139700['intKey'],_0x139700[_0x7b71('0x66')],undefined,_0x5007b1);if(_0x2576db['result']!==-0x1){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x136'),_0x1ce689));var _0x13bbc0=this['tildeASR'][_0x7b71('0xa7')](this,_0x139700,_0x1ce689);if(_0x13bbc0){for(var _0x12a279 in _0x13bbc0){if(_0x13bbc0[_0x7b71('0x97')](_0x12a279)){this[_0x7b71('0xe')][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0x137'),_0x12a279['toUpperCase']()),_0x13bbc0[_0x12a279]);}}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x138'),JSON[_0x7b71('0x73')](_0x13bbc0)));}}return _0x2576db;};AGIVertices[_0x7b71('0x10')]['gotoc']=function(_0x2e76c5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2e76c5[_0x7b71('0x3b')]));return this[_0x7b71('0xe')][_0x7b71('0x139')](_0x2e76c5[_0x7b71('0x40')],_0x2e76c5[_0x7b71('0x41')],_0x2e76c5[_0x7b71('0x42')]);};AGIVertices[_0x7b71('0x10')]['gotoif']=function(_0x11170b){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x11170b[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x11170b[_0x7b71('0x13a')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x11170b,_0x7b71('0x13b'));}try{var _0x33f111=eval(_0x11170b[_0x7b71('0x13a')])?_0x7b71('0x13c'):_0x7b71('0x13d');this['channel'][_0x7b71('0xab')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x11170b[_0x7b71('0x13a')],_0x33f111));return{'code':0xc8,'result':_0x33f111};}catch(_0xdca961){return{'code':0xc8,'result':_0x7b71('0x13d')};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x13e')]=function(_0x55735f){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x13f'),_0x55735f[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x55735f[_0x7b71('0x140')])){return this['channel'][_0x7b71('0x2e')](_0x55735f,_0x7b71('0x141'));}var _0x364b99=this['getIntervals'][_0x7b71('0xa7')](this,_0x55735f[_0x7b71('0x140')]);if(!_0x364b99){return this[_0x7b71('0xe')]['error'](_0x55735f,_0x7b71('0x142'));}for(var _0x1e1df6=0x0;_0x1e1df6<_0x364b99[_0x7b71('0x9c')];_0x1e1df6+=0x1){var _0x142ce1=this[_0x7b71('0xe')][_0x7b71('0x11')](util[_0x7b71('0x2b')](_0x7b71('0x143'),_0x364b99[_0x1e1df6]));if(_0x142ce1['result']===-0x1){return _0x142ce1;}logger[_0x7b71('0x33')](util['format'](_0x7b71('0x144'),_0x364b99[_0x1e1df6],_0x142ce1[_0x7b71('0xa4')]));if(_0x142ce1[_0x7b71('0xa4')]===_0x7b71('0x13c')){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x144'),_0x364b99[_0x1e1df6],_0x7b71('0x13c')));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('IFTIME\x20%s\x20%s',_0x364b99[_0x1e1df6],_0x7b71('0x13c')));return{'code':0xc8,'result':'true'};}else{logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x144'),_0x364b99[_0x1e1df6],'false'));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x144'),_0x364b99[_0x1e1df6],_0x7b71('0x13d')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x7b71('0x10')][_0x7b71('0x145')]=function(_0x30b996){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x146'),_0x30b996[_0x7b71('0x3b')]));return this['channel'][_0x7b71('0x145')]();};AGIVertices[_0x7b71('0x10')][_0x7b71('0x147')]=function(_0x35eb13){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x148'),_0x35eb13[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x35eb13[_0x7b71('0x7a')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0x12a'));}var _0x18b6a0=_0x7b71('0x12b');var _0x2051f4=util[_0x7b71('0x2b')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x137daa=util[_0x7b71('0x2b')](_0x7b71('0xa0'),_0x2051f4,_0x18b6a0);var _0x14d2a6=!![];if(_0x35eb13[_0x7b71('0x12c')]==='NOBEEP'){_0x14d2a6=![];}var _0x556536=this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x2051f4,_0x18b6a0,_0x35eb13['intKey'],_0x35eb13[_0x7b71('0x66')],undefined,_0x14d2a6);if(_0x556536[_0x7b71('0xad')]!==-0x1){this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x149'),_0x137daa));var _0x2cce64=this[_0x7b71('0x84')]['sync'](this,_0x35eb13,_0x137daa);if(_0x2cce64){for(var _0x560a8d in _0x2cce64){if(_0x2cce64['hasOwnProperty'](_0x560a8d)){this[_0x7b71('0xe')]['setVariable'](util['format']('ISPEECH_ASR_%s',_0x560a8d[_0x7b71('0x6a')]()),_0x2cce64[_0x560a8d]);}}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x14a'),JSON[_0x7b71('0x73')](_0x2cce64)));}}return _0x556536;};AGIVertices[_0x7b71('0x10')]['ispeechtts']=function(_0x41495d){logger['info'](util['format'](_0x7b71('0x14b'),_0x41495d['label']));if(!this['isConfigured'](_0x41495d[_0x7b71('0x7a')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x12a'));}if(!this[_0x7b71('0x87')](_0x41495d['text'])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20text\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x14c'),_0x41495d['text']));var _0x2d9fa7=this['ispeechTTS'][_0x7b71('0xa7')](this,_0x41495d);if(_0x2d9fa7){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x149'),_0x2d9fa7));var _0x18a96f=this['channel'][_0x7b71('0xfd')](_0x2d9fa7,_0x41495d[_0x7b71('0x12e')]);try{fs['unlink'](_0x2d9fa7+_0x7b71('0x14d'));}catch(_0x497190){logger['error'](_0x497190);}return _0x18a96f;}return this['channel'][_0x7b71('0x2e')](_0x41495d,_0x7b71('0x14e'));};AGIVertices['prototype'][_0x7b71('0x14f')]=function(_0x3809a3){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x150'),_0x3809a3['label']));if(!this[_0x7b71('0x87')](_0x3809a3[_0x7b71('0x151')])){return this['channel']['error'](_0x3809a3,_0x7b71('0x152'));}logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x153'),this['channel'][_0x7b71('0x3f')],_0x3809a3['findBy']));var _0x59be22=this[_0x7b71('0x55')][_0x7b71('0xa7')](this,_0x3809a3[_0x7b71('0x151')]);if(_0x59be22){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x154'),this['channel'][_0x7b71('0x3f')],_0x3809a3[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x154'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x3809a3['findBy']));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x3809a3[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')]['callerid'],_0x3809a3[_0x7b71('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x157')]=function(_0x446f9e){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x446f9e[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x446f9e[_0x7b71('0x151')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x446f9e,_0x7b71('0x152'));}logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x153'),this['channel'][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));var _0x5bf531=this[_0x7b71('0x54')]['sync'](this,_0x446f9e[_0x7b71('0x151')]);if(_0x5bf531){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x154'),this['channel'][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));this['channel']['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x446f9e['findBy']));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x446f9e[_0x7b71('0x151')]));return{'code':0xc8,'result':_0x7b71('0x158')};}};AGIVertices[_0x7b71('0x10')]['math']=function(_0x4b48d3){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x159'),_0x4b48d3[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x4b48d3[_0x7b71('0x15a')])){return this[_0x7b71('0xe')]['error'](_0x4b48d3,'no\x20operation\x20configured');}this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x15b'),_0x4b48d3[_0x7b71('0x15a')]));var _0x455858=eval(_0x4b48d3['operation']);if(!this[_0x7b71('0x87')](_0x4b48d3[_0x7b71('0xd9')])){return this[_0x7b71('0xe')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1031b3=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x4b48d3['variable_id']);if(!_0x1031b3){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x4b48d3,_0x7b71('0x115'));}if(_[_0x7b71('0x9b')](_0x455858)){var _0x24e67c=this;_0x455858[_0x7b71('0xdc')](function(_0x2247e2,_0x507341){_0x24e67c[_0x7b71('0xe')]['setVariable'](util[_0x7b71('0x2b')]('%s[%s]',_0x1031b3,_0x507341),_0x2247e2);});return this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0x15c'),_0x1031b3));}else{return this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x1031b3,_0x455858);}};AGIVertices[_0x7b71('0x10')][_0x7b71('0xb')]=function(_0x25a9cd){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x15d'),_0x25a9cd[_0x7b71('0x3b')]));if(_0x25a9cd['retry']===0x0){return this[_0x7b71('0xa8')](_0x25a9cd);}_0x25a9cd[_0x7b71('0x10e')]-=0x1;if(!this['isConfigured'](_0x25a9cd[_0x7b71('0x10f')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x25a9cd,_0x7b71('0x110'));}var _0x26b243=this[_0x7b71('0x1f')][_0x7b71('0xa7')](this,_0x25a9cd[_0x7b71('0x10f')]);if(!_0x26b243){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x25a9cd,_0x7b71('0x15e'));}var _0x4d9bc3=this[_0x7b71('0xe')][_0x7b71('0x111')](_0x26b243,_0x25a9cd[_0x7b71('0x15f')],_0x25a9cd[_0x7b71('0x160')]);var _0x4c3d9b=_0x4d9bc3[_0x7b71('0xad')];if(_0x4d9bc3[_0x7b71('0xad')]===-0x1){this[_0x7b71('0x39')]['sync'](this,_0x25a9cd,'-1');return _0x4d9bc3;}else if(_0x4d9bc3[_0x7b71('0xa4')]===_0x7b71('0x66')){_0x4d9bc3[_0x7b71('0xad')]=_0x4d9bc3[_0x7b71('0xad')][_0x7b71('0x9c')]>0x0?_0x4d9bc3[_0x7b71('0xad')]:'t';}else if(_[_0x7b71('0x4a')](_0x4d9bc3['result'])){_0x4d9bc3['result']='#';_0x4c3d9b='#';}if(!this[_0x7b71('0x87')](_0x25a9cd['variable_id'])){this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xda'));}else{var _0x130787=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x25a9cd[_0x7b71('0xd9')]);if(!_0x130787){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x25a9cd,_0x7b71('0x115'));}this['channel'][_0x7b71('0xa1')](_0x130787,_0x4c3d9b);}this[_0x7b71('0x39')]['sync'](this,_0x25a9cd,_0x4c3d9b);return _0x4d9bc3;};AGIVertices[_0x7b71('0x10')][_0x7b71('0xab')]=function(_0x1db714){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x161'),_0x1db714[_0x7b71('0x3b')]));return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x1db714['output']||_0x1db714[_0x7b71('0x3b')]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x162')]=function(_0x2e74ff){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x163'),_0x2e74ff[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x2e74ff['findBy'])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x2e74ff,_0x7b71('0x152'));}logger[_0x7b71('0x33')](util['format'](_0x7b71('0x153'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x2e74ff['findBy']));var _0x4acaa2=this[_0x7b71('0x4f')][_0x7b71('0xa7')](this,_0x2e74ff[_0x7b71('0x164')]);var _0xa29f32=this[_0x7b71('0x51')][_0x7b71('0xa7')](this,_0x2e74ff[_0x7b71('0x151')],_0x4acaa2);if(_0xa29f32){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x154'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x2e74ff[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7b71('0x3f')],_0x2e74ff['findBy']));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x156'),this['channel'][_0x7b71('0x3f')],_0x2e74ff[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7b71('0x3f')],_0x2e74ff[_0x7b71('0x151')]));return{'code':0xc8,'result':_0x7b71('0x158')};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x165')]=function(_0x217fd9){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x166'),_0x217fd9[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x217fd9[_0x7b71('0x10f')])){return this[_0x7b71('0xe')]['error'](_0x217fd9,_0x7b71('0x110'));}var _0x343d7f=this[_0x7b71('0x1f')][_0x7b71('0xa7')](this,_0x217fd9[_0x7b71('0x10f')]);if(!_0x343d7f){return this['channel']['error'](_0x217fd9,_0x7b71('0x15e'));}var _0x2efa23=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0x167'),[_0x343d7f,_0x217fd9['opts']]);if(_0x2efa23[_0x7b71('0xad')]===-0x1){return _0x2efa23;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),'PLAYBACK',_0x343d7f));};AGIVertices[_0x7b71('0x10')]['queue']=function(_0x478558){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x478558[_0x7b71('0x3b')]));if(!this['isConfigured'](_0x478558[_0x7b71('0x168')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x478558,'no\x20queue\x20selected');}var _0x20ce9c='';var _0x316576=parseInt(_0x478558[_0x7b71('0x168')],0xa);if(isNaN(_0x316576)){_0x20ce9c=_0x478558[_0x7b71('0x168')];}else{_0x20ce9c=this['getVoiceQueue'][_0x7b71('0xa7')](this,_0x478558[_0x7b71('0x168')]);if(!_0x20ce9c){return this[_0x7b71('0xe')]['error'](_0x478558,'no\x20queue\x20found');}}var _0x697f0f='';if(this[_0x7b71('0x87')](_0x478558[_0x7b71('0x10f')])){var _0x3c9325=this[_0x7b71('0x1f')][_0x7b71('0xa7')](this,_0x478558['file_id']);if(_0x3c9325){_0x697f0f=_0x3c9325;}}this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x478558,_0x20ce9c);if(_0x478558[_0x7b71('0xe1')]['indexOf']('x')<0x0){_0x478558[_0x7b71('0xe1')]+='x';}if(_0x478558[_0x7b71('0xe1')]['indexOf']('X')<0x0){_0x478558[_0x7b71('0xe1')]+='X';}this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x7b71('0x169'),_0x20ce9c?_0x20ce9c[_0x7b71('0x16a')]():'');var _0x514dce=this['channel']['exec'](_0x7b71('0x16b'),[_0x20ce9c,_0x478558['opts'],_0x478558['url'],_0x697f0f,_0x478558['timeout'],_0x478558[_0x7b71('0x6')],_0x478558[_0x7b71('0x16c')],_0x478558[_0x7b71('0x16d')],'',_0x478558[_0x7b71('0x16e')]]);if(_0x514dce[_0x7b71('0xad')]===-0x1){return _0x514dce;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),_0x7b71('0x16b'),_0x20ce9c));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x16f')]=function(_0x56988d){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x170'),_0x56988d[_0x7b71('0x3b')]));var _0x2c790c=_0x56988d[_0x7b71('0x171')]||'wav';var _0xf98623=util[_0x7b71('0x2b')](_0x7b71('0x172'),this['channel'][_0x7b71('0x3a')],rs[_0x7b71('0x116')](0x5));var _0x133fb0=util['format'](_0x7b71('0x173'),FILES_PATH,_0xf98623,_0x2c790c);var _0x4c34b7=util['format'](_0x7b71('0x174'),FILES_PATH,_0xf98623);this[_0x7b71('0x3e')][_0x7b71('0xa7')](this,_0x56988d,_0xf98623,_0x133fb0);this[_0x7b71('0xe')][_0x7b71('0xa1')](_0x7b71('0x175'),_0xf98623);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x4c34b7,_0x2c790c,_0x56988d[_0x7b71('0x176')],_0x56988d[_0x7b71('0x66')]);return this[_0x7b71('0xe')][_0x7b71('0x12d')](_0x4c34b7,_0x2c790c,_0x56988d[_0x7b71('0x176')],_0x56988d[_0x7b71('0x66')],undefined,!![]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x177')]=function(_0x12e4cf){logger['info'](util[_0x7b71('0x2b')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x12e4cf[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x12e4cf['url'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x178'));}var _0x39397e=this['restAPI'][_0x7b71('0xa7')](this,_0x12e4cf);logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x179'),util[_0x7b71('0x17a')](_0x39397e,{'showHidden':![],'depth':null})));if(!this[_0x7b71('0x87')](_0x12e4cf[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0xab')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1bef21=this[_0x7b71('0x11')]['sync'](this,_0x12e4cf[_0x7b71('0xd9')]);if(!_0x1bef21){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x12e4cf,_0x7b71('0x115'));}this['channel'][_0x7b71('0xa1')](util[_0x7b71('0x2b')](_0x7b71('0x17b'),_0x1bef21),_0x39397e['statusCode']?_0x39397e[_0x7b71('0x74')]:'200');this[_0x7b71('0xe')]['setVariable'](util[_0x7b71('0x2b')](_0x7b71('0x17c'),_0x1bef21),_0x39397e[_0x7b71('0x75')]?_0x39397e[_0x7b71('0x75')]:'OK');if(_0x39397e[_0x7b71('0x6b')]){try{this[_0x7b71('0x9f')](_0x39397e[_0x7b71('0x6b')],_0x1bef21);}catch(_0x415729){logger[_0x7b71('0x2e')](util['format'](_0x7b71('0x17d'),_0x1bef21));}}return this['channel']['noop'](util[_0x7b71('0x2b')]('variable\x20%s\x20set',_0x1bef21));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x17e')]=function(_0x2a9b4f){logger['info'](util['format'](_0x7b71('0x17f'),_0x2a9b4f[_0x7b71('0x3b')]));return this[_0x7b71('0xe')]['sayDigits'](_0x2a9b4f[_0x7b71('0x180')][_0x7b71('0x5b')](/\s+/g,''),_0x2a9b4f['escape_digits']);};AGIVertices[_0x7b71('0x10')]['saynumber']=function(_0x4506a5){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x181'),_0x4506a5['label']));return this[_0x7b71('0xe')]['sayNumber'](_0x4506a5[_0x7b71('0x67')]['replace'](/\s+/g,''),_0x4506a5['escape_digits']);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x182')]=function(_0x5cc919){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5cc919[_0x7b71('0x3b')]));return this['channel'][_0x7b71('0x183')](_0x5cc919[_0x7b71('0x5d')],_0x5cc919['escape_digits']);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x184')]=function(_0x27b291){logger['info'](util[_0x7b71('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x27b291['label']));if(!this[_0x7b71('0x87')](_0x27b291[_0x7b71('0x185')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x186'));}var _0xe58fe=this[_0x7b71('0x21')][_0x7b71('0xa7')](this,_0x27b291[_0x7b71('0x185')]);if(!_0xe58fe||!_0xe58fe[_0x7b71('0x187')]){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x27b291,_0x7b71('0x188'));}var _0x2df42a={'from':util[_0x7b71('0x2b')](_0x7b71('0x189'),_0xe58fe[_0x7b71('0x13')],_0xe58fe['email']||_0xe58fe['Smtp']['user']),'to':_0x27b291['to']||'','cc':_0x27b291['cc']||'','bcc':_0x27b291['bcc']||'','subject':_0x27b291['subject'],'html':_0x27b291[_0x7b71('0x5d')],'text':_0x27b291[_0x7b71('0x5d')]};if(this[_0x7b71('0x87')](_0x27b291[_0x7b71('0x18a')])){}logger[_0x7b71('0x18b')](_0x7b71('0x18c'),JSON[_0x7b71('0x73')](_0x2df42a));this['createSquareDetailsReport'][_0x7b71('0xa7')](this,_0x27b291,_0x27b291[_0x7b71('0x185')]);this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')]('Trying\x20SendMail\x20with\x20account\x20%s',_0xe58fe[_0x7b71('0x13')]));this[_0x7b71('0x23')][_0x7b71('0xa7')](this,_0xe58fe['smtpOptions'],_0x2df42a);return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0x18d'));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x18e')]=function(_0x4ce27d){logger[_0x7b71('0x33')](util['format'](_0x7b71('0x18f'),_0x4ce27d['label']));return this[_0x7b71('0xe')][_0x7b71('0xab')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x7b71('0x10')]['sendSMS']=function(_0x7a11c1){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x7a11c1[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x7a11c1[_0x7b71('0x190')])){return this['channel'][_0x7b71('0xab')](_0x7b71('0x191'));}var _0x1bda6e=this[_0x7b71('0x37')][_0x7b71('0xa7')](this,_0x7a11c1[_0x7b71('0x190')]);if(!_0x1bda6e){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x7a11c1,_0x7b71('0x192'));}var _0x34d8ec={'body':_0x7a11c1[_0x7b71('0x193')],'phone':_0x7a11c1['to']||'','SmsAccountId':_0x1bda6e['id']};logger[_0x7b71('0x18b')](_0x7b71('0x194'),JSON[_0x7b71('0x73')](_0x34d8ec));this[_0x7b71('0x39')][_0x7b71('0xa7')](this,_0x7a11c1,_0x7a11c1[_0x7b71('0x190')]);this[_0x7b71('0xe')]['noop'](util['format'](_0x7b71('0x195'),_0x1bda6e[_0x7b71('0x13')]));this[_0x7b71('0x38')]['sync'](this,_0x34d8ec);return this[_0x7b71('0xe')]['noop'](_0x7b71('0x196'));};AGIVertices[_0x7b71('0x10')]['set']=function(_0x14df27){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x14df27[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x14df27[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x14df27,_0x7b71('0x197'));}var _0x34b4e9=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x14df27['variable_id']);if(!_0x34b4e9){return this['channel'][_0x7b71('0x2e')](_0x14df27,'no\x20variable\x20found');}return this[_0x7b71('0xe')]['setVariable'](_0x34b4e9,_0x14df27[_0x7b71('0x198')]);};AGIVertices[_0x7b71('0x10')][_0x7b71('0x199')]=function(_0x3481ab){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x19a'),_0x3481ab[_0x7b71('0x3b')]));this[_0x7b71('0xe')]['noop'](_0x7b71('0x19b'));var _0x2321e3=this['channel'][_0x7b71('0x11')](_0x7b71('0x19c'));if(!_[_0x7b71('0x4a')](_0x2321e3[_0x7b71('0xa4')])){this[_0x7b71('0xe')][_0x7b71('0x3a')]=_0x2321e3[_0x7b71('0xa4')];}if(_0x3481ab[_0x7b71('0xbb')]==='yes'){this[_0x7b71('0xe')]['noop'](_0x7b71('0x19d'));return this[_0x7b71('0xe')][_0x7b71('0xbb')]();}return this['channel'][_0x7b71('0xab')](_0x7b71('0x19e'));};AGIVertices[_0x7b71('0x10')]['subproject']=function(_0x3a4be2){logger['info'](util[_0x7b71('0x2b')](_0x7b71('0x19f'),_0x3a4be2[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x3a4be2[_0x7b71('0x1a0')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x3a4be2,_0x7b71('0x1a1'));}var _0x2f15ba=this[_0x7b71('0x17')][_0x7b71('0xa7')](this,_0x3a4be2['project_id']);if(!this[_0x7b71('0x87')](_0x2f15ba)){return this[_0x7b71('0xe')]['error'](_0x3a4be2,util[_0x7b71('0x2b')](_0x7b71('0x1a2'),_0x3a4be2[_0x7b71('0x1a0')]));}if(_0x2f15ba===this[_0x7b71('0xe')][_0x7b71('0x3d')]){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x3a4be2,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x7b71('0x39')]['sync'](this,_0x3a4be2,_0x2f15ba);var _0x540902=this[_0x7b71('0xe')][_0x7b71('0x59')](_0x7b71('0x1a3'),util[_0x7b71('0x2b')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x7b71('0x6')]['host']||'127.0.0.1',_0x2f15ba,this[_0x7b71('0xe')][_0x7b71('0x3d')]));if(_0x540902[_0x7b71('0xad')]===-0x1){return _0x540902;}return this['channel']['noop'](util[_0x7b71('0x2b')]('Executed\x20command\x20%s\x20%s',_0x7b71('0x1a3'),_0x2f15ba));};AGIVertices[_0x7b71('0x10')]['system']=function(_0x4995bc){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')](_0x7b71('0x1a4'),_0x4995bc['label']));var _0x48aa8b=this[_0x7b71('0x1a5')][_0x7b71('0xa7')](this,_0x4995bc[_0x7b71('0xb9')]);this[_0x7b71('0x39')]['sync'](this,_0x4995bc,_0x4995bc[_0x7b71('0xb9')]);if(this[_0x7b71('0x87')](_0x4995bc[_0x7b71('0xd9')])){var _0x5d0389=this[_0x7b71('0x11')][_0x7b71('0xa7')](this,_0x4995bc['variable_id']);if(_0x5d0389){this[_0x7b71('0xe')]['setVariable'](_0x5d0389,_0x48aa8b);return this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x1a6'),_0x4995bc[_0x7b71('0xb9')],_0x5d0389));}}return this[_0x7b71('0xe')]['noop'](util[_0x7b71('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x4995bc[_0x7b71('0xb9')]));};AGIVertices[_0x7b71('0x10')][_0x7b71('0x1a7')]=function(_0x20e3db){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x20e3db[_0x7b71('0x3b')]));_0x20e3db[_0x7b71('0x5d')]=_0x20e3db[_0x7b71('0x5d')][_0x7b71('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7b71('0x87')](_0x20e3db[_0x7b71('0x1a8')])){return this[_0x7b71('0xe')]['noop'](_0x7b71('0x1a9'));}if(!this[_0x7b71('0x87')](_0x20e3db[_0x7b71('0x5d')])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xc8'));}this[_0x7b71('0xe')][_0x7b71('0xab')](util['format'](_0x7b71('0x1aa'),_0x20e3db[_0x7b71('0x5d')]));var _0x56511b=this[_0x7b71('0x5c')][_0x7b71('0xa7')](this,_0x20e3db);if(_0x56511b){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x1ab'),_0x56511b));var _0x59f4ef=this[_0x7b71('0xe')][_0x7b71('0xfd')](_0x56511b);try{fs[_0x7b71('0xfe')](_0x56511b+'.wav');}catch(_0xc4c4ec){logger['error'](_0xc4c4ec);}return _0x59f4ef;}return this['channel'][_0x7b71('0x2e')](_0x20e3db,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x7b71('0x1ac')]=function(_0x3c5355){logger[_0x7b71('0x33')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3c5355[_0x7b71('0x3b')]));_0x3c5355[_0x7b71('0x5d')]=_0x3c5355[_0x7b71('0x5d')][_0x7b71('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7b71('0x87')](_0x3c5355['text'])){return this[_0x7b71('0xe')][_0x7b71('0xab')](_0x7b71('0xc8'));}this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x1ad'),_0x3c5355[_0x7b71('0x5d')]));var _0x37cdae=this[_0x7b71('0x62')][_0x7b71('0xa7')](this,_0x3c5355);if(_0x37cdae){this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x1ae'),_0x37cdae));var _0x498cb9=this['channel'][_0x7b71('0xfd')](_0x37cdae);try{fs[_0x7b71('0xfe')](_0x37cdae+_0x7b71('0x14d'));}catch(_0x4bb5a9){logger[_0x7b71('0x2e')](_0x4bb5a9);}return _0x498cb9;}return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x3c5355,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x7b71('0x1af')]=function(_0x35cd57){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x35cd57['label']));if(!this[_0x7b71('0x87')](_0x35cd57[_0x7b71('0x151')])){return this['channel'][_0x7b71('0x2e')](_0x35cd57,'no\x20find\x20by\x20configured');}logger['info'](util[_0x7b71('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57['findBy']));var _0x50393c=this['agentUnpause'][_0x7b71('0xa7')](this,_0x35cd57[_0x7b71('0x151')]);if(_0x50393c){logger[_0x7b71('0x33')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57['findBy']));this['channel'][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x154'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57[_0x7b71('0x151')]));return{'code':0xc8,'result':_0x7b71('0x155')};}else{logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7b71('0xe')]['callerid'],_0x35cd57[_0x7b71('0x151')]));this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0x156'),this[_0x7b71('0xe')][_0x7b71('0x3f')],_0x35cd57['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7b71('0x10')][_0x7b71('0x1b0')]=function(_0x346e4a){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x346e4a['label']));var _0x56caee=this[_0x7b71('0xe')]['exec'](_0x7b71('0x1b1'),[_0x346e4a[_0x7b71('0x1b2')],_0x346e4a[_0x7b71('0x78')]]);if(_0x56caee['result']===-0x1){return _0x56caee;}return this[_0x7b71('0xe')][_0x7b71('0xab')](util[_0x7b71('0x2b')](_0x7b71('0xc6'),_0x7b71('0x1b1'),_0x346e4a[_0x7b71('0x1b2')]));};AGIVertices[_0x7b71('0x10')]['vswitch']=function(_0x36cb50){logger[_0x7b71('0x33')](util[_0x7b71('0x2b')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x36cb50[_0x7b71('0x3b')]));if(!this[_0x7b71('0x87')](_0x36cb50[_0x7b71('0xd9')])){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x36cb50,'no\x20variable\x20selected');}var _0x14500e=this[_0x7b71('0x11')]['sync'](this,_0x36cb50[_0x7b71('0xd9')]);if(!_0x14500e){return this[_0x7b71('0xe')][_0x7b71('0x2e')](_0x36cb50,_0x7b71('0x115'));}var _0xf2619c=this[_0x7b71('0xe')][_0x7b71('0x11')](_0x14500e);return{'code':0xc8,'result':_0xf2619c[_0x7b71('0xa4')]?_0xf2619c[_0x7b71('0xa4')]:'-'};};String[_0x7b71('0x10')][_0x7b71('0xa3')]=function(_0x2fe57a,_0x3694ca){return this[_0x7b71('0xa2')](_0x2fe57a)[_0x7b71('0x1b3')](_0x3694ca);};module[_0x7b71('0x1b4')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 98e49b3..aefd635 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 _0x1967=['queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','updateAcw','error','message','uniqueid','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','attended','isUndefined','linkedid','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','lastPauseAt','timer','update','then','info','catch','[%s][UPDATE][ERRORS:%s]','finally','interface'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x1967,0x173));var _0x7196=function(_0x530aeb,_0x373e0f){_0x530aeb=_0x530aeb-0x0;var _0x4590fa=_0x1967[_0x530aeb];return _0x4590fa;};'use strict';var _=require('lodash');var moment=require(_0x7196('0x0'));var ami=require(_0x7196('0x1'));var logger=require(_0x7196('0x2'))(_0x7196('0x3'));var RpcUser=require(_0x7196('0x4'));var RpcVoiceAgentReport=require(_0x7196('0x5'));function Acw(_0x302f34){this[_0x7196('0x6')]=_0x302f34[_0x7196('0x6')];this[_0x7196('0x7')]=_0x302f34['agents'];this[_0x7196('0x8')]=_0x302f34[_0x7196('0x8')];this[_0x7196('0x9')]={};ami['on'](_0x7196('0xa'),this[_0x7196('0xb')][_0x7196('0xc')](this));ami['on']('hanguprequest',this[_0x7196('0xd')][_0x7196('0xc')](this));ami['on'](_0x7196('0xe'),this[_0x7196('0xf')][_0x7196('0xc')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x7196('0xc')](this));ami['on'](_0x7196('0x10'),this[_0x7196('0x11')][_0x7196('0xc')](this));ami['on'](_0x7196('0x12'),this[_0x7196('0x13')][_0x7196('0xc')](this));ami['on'](_0x7196('0x14'),this[_0x7196('0x15')][_0x7196('0xc')](this));}function getDiff(_0x154101){var _0x4e8c4c=moment()[_0x7196('0x16')](0x0);var _0x3feccd=moment(_0x154101)[_0x7196('0x16')](0x0);return _0x4e8c4c[_0x7196('0x17')](_0x3feccd,'seconds');}Acw[_0x7196('0x18')]['updateAcw']=function(_0xe32933,_0x2590a6){var _0xf7e97=this;var _0x3ed1ad=getDiff(_0xf7e97[_0x7196('0x8')][_0xe32933][_0x7196('0x19')]);clearTimeout(_0xf7e97[_0x7196('0x8')][_0xe32933][_0x7196('0x1a')]);_0xf7e97[_0x7196('0x8')][_0xe32933][_0x7196('0x1a')]=![];return RpcVoiceAgentReport[_0x7196('0x1b')]({'acwtime':_0x3ed1ad},_0xf7e97['timers'][_0xe32933]['uniqueid'],_0xe32933)[_0x7196('0x1c')](function(_0x26b447){logger[_0x7196('0x1d')]('[%s][UPDATE][ACWTIME:%s]',_0x2590a6,_0x3ed1ad,_0x26b447);})[_0x7196('0x1e')](function(_0x539d8b){logger['error'](_0x7196('0x1f'),_0x2590a6,_0x539d8b);})[_0x7196('0x20')](function(){delete _0xf7e97[_0x7196('0x8')][_0xe32933];});};Acw['prototype']['startAcw']=function(_0x38d291){try{var _0x3cd8ff=this;var _0x598a26=this[_0x7196('0x9')][_0x38d291][_0x7196('0x21')];var _0x6e22e5=this[_0x7196('0x9')][_0x38d291][_0x7196('0x22')];var _0x549f34=this[_0x7196('0x6')][_0x6e22e5];var _0x520d01=![];var _0x3ce9a0=_0x7196('0x23');if(_0x549f34[_0x7196('0x24')]&&_0x549f34[_0x7196('0x25')][_0x7196('0x26')]){_0x520d01=!![];_0x3ce9a0=_0x549f34[_0x7196('0x25')]['name'];}if(!_0x3cd8ff['agents'][_0x598a26]){return Promise[_0x7196('0x27')]();}return RpcUser[_0x7196('0x28')](_0x3cd8ff[_0x7196('0x7')][_0x598a26]['id'])['then'](function(_0x5aa538){if(!_0x5aa538||_0x5aa538[_0x7196('0x29')]){logger[_0x7196('0x1d')](_0x7196('0x2a'),_0x38d291,_0x598a26,_0x6e22e5);return;}logger['info'](_0x7196('0x2b'),_0x38d291,_0x598a26,_0x6e22e5);var _0x4ecea1=_0x3cd8ff[_0x7196('0x9')][_0x38d291]['attended']&&_0x3cd8ff[_0x7196('0x9')][_0x38d291][_0x7196('0x2c')]?_0x3cd8ff[_0x7196('0x9')][_0x38d291]['destlinkedid']:_0x38d291;return RpcUser[_0x7196('0x2d')](_0x3cd8ff[_0x7196('0x7')][_0x598a26],_0x3ce9a0,_0x4ecea1);})[_0x7196('0x1c')](function(_0xf999e9){if(_0x520d01||!_0xf999e9){return;}_0x3cd8ff['timers'][_0x598a26]={};logger[_0x7196('0x1d')](_0x7196('0x2e'),_0x38d291,_0x3cd8ff[_0x7196('0x6')][_0x6e22e5][_0x7196('0x2f')],_0x598a26,_0x6e22e5);_0x3cd8ff[_0x7196('0x8')][_0x598a26][_0x7196('0x1a')]=setTimeout(_0x3cd8ff[_0x7196('0x30')][_0x7196('0xc')](_0x3cd8ff,_0x598a26),_0x3cd8ff[_0x7196('0x6')][_0x6e22e5][_0x7196('0x2f')]*0x3e8);_0x3cd8ff[_0x7196('0x8')][_0x598a26]['lastPauseAt']=moment()[_0x7196('0x31')]('YYYY-MM-DD\x20HH:mm:ss');_0x3cd8ff[_0x7196('0x8')][_0x598a26]['uniqueid']=_0x38d291;_0x3cd8ff[_0x7196('0x8')][_0x598a26][_0x7196('0x22')]=_0x6e22e5;_0x3cd8ff['timers'][_0x598a26][_0x7196('0x32')]=_0x3cd8ff[_0x7196('0x32')][_0x7196('0xc')](_0x3cd8ff,_0x598a26,_0x38d291);})[_0x7196('0x1e')](function(){logger[_0x7196('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x38d291,_0x3cd8ff[_0x7196('0x6')][_0x6e22e5][_0x7196('0x2f')],_0x598a26,_0x6e22e5);})[_0x7196('0x20')](function(){delete _0x3cd8ff[_0x7196('0x9')][_0x38d291];});}catch(_0x3e8f98){logger[_0x7196('0x33')]('[ACW][START]\x20%s',_0x3e8f98[_0x7196('0x34')]);}};Acw[_0x7196('0x18')][_0x7196('0x30')]=function(_0x4f6b27){try{var _0x33831a=this;if(_0x33831a[_0x7196('0x8')][_0x4f6b27]){_0x33831a[_0x7196('0x8')][_0x4f6b27][_0x7196('0x1a')]=![];var _0x11d4ec=_0x33831a[_0x7196('0x8')][_0x4f6b27][_0x7196('0x35')];var _0x1ab720=_0x33831a[_0x7196('0x8')][_0x4f6b27][_0x7196('0x22')];var _0x5354d3=_0x33831a[_0x7196('0x6')][_0x1ab720][_0x7196('0x2f')];logger['info'](_0x7196('0x36'),_0x11d4ec,_0x4f6b27);RpcUser['saveUnpause'](this['agents'][_0x4f6b27]);RpcVoiceAgentReport[_0x7196('0x1b')]({'acwtime':_0x5354d3,'agentacw':!![]},_0x11d4ec,_0x4f6b27)[_0x7196('0x1c')](function(_0x4d03c9){logger['info'](_0x7196('0x37'),_0x11d4ec,_0x5354d3,_0x4d03c9);})[_0x7196('0x1e')](function(_0xed32cd){logger['error'](_0x7196('0x1f'),_0x11d4ec,_0xed32cd);});}else{logger[_0x7196('0x33')](_0x7196('0x38'),_0x4f6b27);if(_0x33831a[_0x7196('0x8')]){logger[_0x7196('0x1d')](_0x7196('0x39'),JSON[_0x7196('0x3a')](_0x33831a[_0x7196('0x8')]));}}}catch(_0x5cd903){logger[_0x7196('0x33')](_0x7196('0x3b'),_0x5cd903['message']);}};Acw[_0x7196('0x18')][_0x7196('0xb')]=function(_0x48178f){try{if(this[_0x7196('0x6')][_0x48178f[_0x7196('0x22')]]&&(this[_0x7196('0x6')][_0x48178f['queue']][_0x7196('0x3')]||this[_0x7196('0x6')][_0x48178f['queue']][_0x7196('0x24')])){if(this[_0x7196('0x7')][_0x48178f['interface']]){this[_0x7196('0x9')][_0x48178f['uniqueid']]={'queue':_0x48178f['queue'],'interface':_0x48178f['interface'],'destlinkedid':_0x48178f['destlinkedid']};}}}catch(_0x57060a){logger[_0x7196('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x57060a[_0x7196('0x34')]);}};Acw[_0x7196('0x18')][_0x7196('0x15')]=function(_0x6766b8){try{if(this['voiceQueues'][_0x6766b8[_0x7196('0x22')]]&&(this['voiceQueues'][_0x6766b8[_0x7196('0x22')]][_0x7196('0x3')]||this[_0x7196('0x6')][_0x6766b8['queue']][_0x7196('0x24')])){if(this[_0x7196('0x7')][_0x6766b8[_0x7196('0x21')]]){this['channels'][_0x6766b8['uniqueid']]={'queue':_0x6766b8[_0x7196('0x22')],'interface':_0x6766b8['interface']};}}}catch(_0x29c7e8){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x29c7e8[_0x7196('0x34')]);}};Acw['prototype']['syncHangupRequest']=function(_0x516825){try{if(this[_0x7196('0x9')][_0x516825['uniqueid']]&&_['isUndefined'](this[_0x7196('0x9')][_0x516825[_0x7196('0x35')]][_0x7196('0x3c')])){logger[_0x7196('0x1d')]('[%s][HANGUP:UNIQUEID]',_0x516825[_0x7196('0x35')]);this['startAcw'](_0x516825[_0x7196('0x35')]);}else if(this[_0x7196('0x9')][_0x516825['linkedid']]&&_[_0x7196('0x3d')](this[_0x7196('0x9')][_0x516825[_0x7196('0x3e')]]['attended'])){logger[_0x7196('0x1d')]('[%s][HANGUP:LINKEDID]',_0x516825[_0x7196('0x3e')]);this[_0x7196('0x3f')](_0x516825[_0x7196('0x3e')]);}}catch(_0x1fd83f){logger[_0x7196('0x33')](_0x7196('0x40'),_0x1fd83f[_0x7196('0x34')]);}};Acw[_0x7196('0x18')]['syncHangup']=function(_0x54f39d){try{if(this[_0x7196('0x9')][_0x54f39d[_0x7196('0x35')]]&&this[_0x7196('0x9')][_0x54f39d[_0x7196('0x35')]]['attended']){logger[_0x7196('0x1d')](_0x7196('0x41'),_0x54f39d[_0x7196('0x35')]);this[_0x7196('0x3f')](_0x54f39d[_0x7196('0x35')]);}else if(this[_0x7196('0x9')][_0x54f39d[_0x7196('0x3e')]]&&this[_0x7196('0x9')][_0x54f39d[_0x7196('0x3e')]][_0x7196('0x3c')]){logger[_0x7196('0x1d')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x54f39d[_0x7196('0x3e')]);this[_0x7196('0x3f')](_0x54f39d[_0x7196('0x3e')]);}}catch(_0x48f196){logger[_0x7196('0x33')]('[ACW][syncHangup]\x20%s',_0x48f196[_0x7196('0x34')]);}};Acw[_0x7196('0x18')][_0x7196('0x11')]=function(_0x3e74ef){try{if(!_[_0x7196('0x42')](this['channels'][_0x3e74ef[_0x7196('0x43')]])){this['startAcw'](_0x3e74ef['transfereeuniqueid']);if(this['channels'][_0x3e74ef[_0x7196('0x44')]]){this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x44')]][_0x7196('0x3c')]=!![];this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x45')]]=this[_0x7196('0x9')][_0x3e74ef['secondtransfereruniqueid']];delete this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x44')]];}}else if(!_[_0x7196('0x42')](this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x45')]])){this['startAcw'](_0x3e74ef['transfertargetuniqueid']);if(this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x46')]]){this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x46')]][_0x7196('0x3c')]=!![];this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x43')]]=this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x46')]];delete this[_0x7196('0x9')][_0x3e74ef[_0x7196('0x46')]];}}}catch(_0x57d729){logger[_0x7196('0x33')](_0x7196('0x47'),_0x57d729[_0x7196('0x34')]);}};Acw[_0x7196('0x18')]['syncBlindTransfer']=function(_0x4bd0f3){try{if(this[_0x7196('0x9')][_0x4bd0f3[_0x7196('0x48')]]){logger[_0x7196('0x1d')](_0x7196('0x49'),JSON[_0x7196('0x3a')](_0x4bd0f3[_0x7196('0x48')]));this['startAcw'](_0x4bd0f3[_0x7196('0x48')]);}else if(this[_0x7196('0x9')][_0x4bd0f3[_0x7196('0x4a')]]){logger[_0x7196('0x1d')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x7196('0x3a')](_0x4bd0f3[_0x7196('0x4a')]));this[_0x7196('0x3f')](_0x4bd0f3[_0x7196('0x4a')]);}}catch(_0x4673e9){logger[_0x7196('0x33')](_0x7196('0x4b'),_0x4673e9['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x72f6f1){try{if(this['voiceQueues'][_0x72f6f1[_0x7196('0x22')]]&&this[_0x7196('0x6')][_0x72f6f1[_0x7196('0x22')]][_0x7196('0x4c')]===_0x7196('0x4d')){if(this[_0x7196('0x7')][_0x72f6f1[_0x7196('0x21')]]){logger[_0x7196('0x1d')](_0x7196('0x4e'),_0x72f6f1['uniqueid'],_0x72f6f1['interface'],_0x72f6f1[_0x7196('0x22')]);return RpcUser[_0x7196('0x2d')](this[_0x7196('0x7')][_0x72f6f1[_0x7196('0x21')]],_0x7196('0x4f'),_0x72f6f1[_0x7196('0x35')]);}}}catch(_0xa55f4b){logger[_0x7196('0x33')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0xa55f4b['message']);}};module[_0x7196('0x50')]=Acw; \ No newline at end of file +var _0x36c3=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','uniqueid','then','info','catch','finally','queue','ACW','mandatoryDispositionPause','name','resolve','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','error','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','syncAgentConnect','interface','destlinkedid','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil'];(function(_0x148fa4,_0x103c8b){var _0x5155f7=function(_0x12bcdc){while(--_0x12bcdc){_0x148fa4['push'](_0x148fa4['shift']());}};_0x5155f7(++_0x103c8b);}(_0x36c3,0x1a6));var _0x336c=function(_0x4a6362,_0x9e782a){_0x4a6362=_0x4a6362-0x0;var _0x2653a5=_0x36c3[_0x4a6362];return _0x2653a5;};'use strict';var _=require(_0x336c('0x0'));var moment=require(_0x336c('0x1'));var ami=require('../ami');var logger=require(_0x336c('0x2'))(_0x336c('0x3'));var RpcUser=require(_0x336c('0x4'));var RpcVoiceAgentReport=require(_0x336c('0x5'));function Acw(_0x32aed2){this[_0x336c('0x6')]=_0x32aed2[_0x336c('0x6')];this['agents']=_0x32aed2[_0x336c('0x7')];this[_0x336c('0x8')]=_0x32aed2[_0x336c('0x8')];this[_0x336c('0x9')]={};ami['on'](_0x336c('0xa'),this['syncAgentConnect'][_0x336c('0xb')](this));ami['on'](_0x336c('0xc'),this[_0x336c('0xd')][_0x336c('0xb')](this));ami['on'](_0x336c('0xe'),this[_0x336c('0xf')][_0x336c('0xb')](this));ami['on'](_0x336c('0x10'),this[_0x336c('0x11')][_0x336c('0xb')](this));ami['on'](_0x336c('0x12'),this[_0x336c('0x13')][_0x336c('0xb')](this));ami['on'](_0x336c('0x14'),this[_0x336c('0x15')][_0x336c('0xb')](this));ami['on'](_0x336c('0x16'),this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0x1c3961){var _0x577bd6=moment()[_0x336c('0x17')](0x0);var _0xc6a857=moment(_0x1c3961)[_0x336c('0x17')](0x0);return _0x577bd6[_0x336c('0x18')](_0xc6a857,'seconds');}Acw[_0x336c('0x19')][_0x336c('0x1a')]=function(_0x4ce90a,_0x23b375){var _0x5f5ae1=this;var _0x2c7474=getDiff(_0x5f5ae1['timers'][_0x4ce90a][_0x336c('0x1b')]);clearTimeout(_0x5f5ae1['timers'][_0x4ce90a][_0x336c('0x1c')]);_0x5f5ae1[_0x336c('0x8')][_0x4ce90a]['timer']=![];return RpcVoiceAgentReport['update']({'acwtime':_0x2c7474},_0x5f5ae1[_0x336c('0x8')][_0x4ce90a][_0x336c('0x1d')],_0x4ce90a)[_0x336c('0x1e')](function(_0x221408){logger[_0x336c('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x23b375,_0x2c7474,_0x221408);})[_0x336c('0x20')](function(_0x532e12){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x23b375,_0x532e12);})[_0x336c('0x21')](function(){delete _0x5f5ae1[_0x336c('0x8')][_0x4ce90a];});};Acw[_0x336c('0x19')]['startAcw']=function(_0x5adb5f){try{var _0x5b6cc3=this;var _0x3ba228=this[_0x336c('0x9')][_0x5adb5f]['interface'];var _0x260ef3=this[_0x336c('0x9')][_0x5adb5f][_0x336c('0x22')];var _0x56a6fb=this[_0x336c('0x6')][_0x260ef3];var _0x314f5f=![];var _0x24f8ca=_0x336c('0x23');if(_0x56a6fb['mandatoryDisposition']&&_0x56a6fb[_0x336c('0x24')][_0x336c('0x25')]){_0x314f5f=!![];_0x24f8ca=_0x56a6fb[_0x336c('0x24')][_0x336c('0x25')];}if(!_0x5b6cc3[_0x336c('0x7')][_0x3ba228]){return Promise[_0x336c('0x26')]();}return RpcUser['getAgent'](_0x5b6cc3[_0x336c('0x7')][_0x3ba228]['id'])[_0x336c('0x1e')](function(_0x2a1fb3){if(!_0x2a1fb3||_0x2a1fb3[_0x336c('0x27')]){logger['info'](_0x336c('0x28'),_0x5adb5f,_0x3ba228,_0x260ef3);return;}logger[_0x336c('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x5adb5f,_0x3ba228,_0x260ef3);var _0x5476ff=_0x5b6cc3['channels'][_0x5adb5f][_0x336c('0x29')]&&_0x5b6cc3[_0x336c('0x9')][_0x5adb5f]['destlinkedid']?_0x5b6cc3['channels'][_0x5adb5f]['destlinkedid']:_0x5adb5f;return RpcUser[_0x336c('0x2a')](_0x5b6cc3[_0x336c('0x7')][_0x3ba228],_0x24f8ca,_0x5476ff);})[_0x336c('0x1e')](function(_0x424712){if(_0x314f5f||!_0x424712){return;}_0x5b6cc3[_0x336c('0x8')][_0x3ba228]={};logger[_0x336c('0x1f')](_0x336c('0x2b'),_0x5adb5f,_0x5b6cc3['voiceQueues'][_0x260ef3][_0x336c('0x2c')],_0x3ba228,_0x260ef3);_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1c')]=setTimeout(_0x5b6cc3[_0x336c('0x2d')]['bind'](_0x5b6cc3,_0x3ba228),_0x5b6cc3[_0x336c('0x6')][_0x260ef3][_0x336c('0x2c')]*0x3e8);_0x5b6cc3['timers'][_0x3ba228][_0x336c('0x1b')]=moment()[_0x336c('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1d')]=_0x5adb5f;_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x22')]=_0x260ef3;_0x5b6cc3[_0x336c('0x8')][_0x3ba228][_0x336c('0x1a')]=_0x5b6cc3[_0x336c('0x1a')][_0x336c('0xb')](_0x5b6cc3,_0x3ba228,_0x5adb5f);})['catch'](function(){logger[_0x336c('0x2f')](_0x336c('0x2b'),_0x5adb5f,_0x5b6cc3[_0x336c('0x6')][_0x260ef3][_0x336c('0x2c')],_0x3ba228,_0x260ef3);})[_0x336c('0x21')](function(){delete _0x5b6cc3[_0x336c('0x9')][_0x5adb5f];});}catch(_0x6d823a){logger[_0x336c('0x2f')](_0x336c('0x30'),_0x6d823a[_0x336c('0x31')]);}};Acw['prototype'][_0x336c('0x2d')]=function(_0x3d3583){try{var _0x4690c3=this;if(_0x4690c3[_0x336c('0x8')][_0x3d3583]){_0x4690c3[_0x336c('0x8')][_0x3d3583][_0x336c('0x1c')]=![];var _0x853b2d=_0x4690c3[_0x336c('0x8')][_0x3d3583][_0x336c('0x1d')];var _0xf9c76a=_0x4690c3['timers'][_0x3d3583][_0x336c('0x22')];var _0x20e7a5=_0x4690c3[_0x336c('0x6')][_0xf9c76a]['acwTimeout'];logger[_0x336c('0x1f')](_0x336c('0x32'),_0x853b2d,_0x3d3583);RpcUser[_0x336c('0x33')](this[_0x336c('0x7')][_0x3d3583]);RpcVoiceAgentReport['update']({'acwtime':_0x20e7a5,'agentacw':!![]},_0x853b2d,_0x3d3583)[_0x336c('0x1e')](function(_0x1055bd){logger['info'](_0x336c('0x34'),_0x853b2d,_0x20e7a5,_0x1055bd);})[_0x336c('0x20')](function(_0x1d30ac){logger['error'](_0x336c('0x35'),_0x853b2d,_0x1d30ac);});}else{logger[_0x336c('0x2f')](_0x336c('0x36'),_0x3d3583);if(_0x4690c3[_0x336c('0x8')]){logger[_0x336c('0x1f')](_0x336c('0x37'),JSON[_0x336c('0x38')](_0x4690c3[_0x336c('0x8')]));}}}catch(_0x1ab068){logger[_0x336c('0x2f')]('[ACW][STOP]\x20%s',_0x1ab068[_0x336c('0x31')]);}};Acw[_0x336c('0x19')][_0x336c('0x39')]=function(_0x5b2f25){try{if(this[_0x336c('0x6')][_0x5b2f25[_0x336c('0x22')]]&&(this['voiceQueues'][_0x5b2f25[_0x336c('0x22')]][_0x336c('0x3')]||this[_0x336c('0x6')][_0x5b2f25[_0x336c('0x22')]]['mandatoryDisposition'])){if(this[_0x336c('0x7')][_0x5b2f25[_0x336c('0x3a')]]){this['channels'][_0x5b2f25[_0x336c('0x1d')]]={'queue':_0x5b2f25[_0x336c('0x22')],'interface':_0x5b2f25['interface'],'destlinkedid':_0x5b2f25[_0x336c('0x3b')]};}}}catch(_0xcf3f00){logger[_0x336c('0x2f')](_0x336c('0x3c'),_0xcf3f00['message']);}};Acw[_0x336c('0x19')][_0x336c('0x3d')]=function(_0x8df853){try{if(this[_0x336c('0x6')][_0x8df853[_0x336c('0x22')]]&&(this[_0x336c('0x6')][_0x8df853[_0x336c('0x22')]][_0x336c('0x3')]||this[_0x336c('0x6')][_0x8df853['queue']][_0x336c('0x3e')])){if(this[_0x336c('0x7')][_0x8df853[_0x336c('0x3a')]]){this[_0x336c('0x9')][_0x8df853[_0x336c('0x1d')]]={'queue':_0x8df853[_0x336c('0x22')],'interface':_0x8df853[_0x336c('0x3a')]};}}}catch(_0xbfac47){logger[_0x336c('0x2f')](_0x336c('0x3f'),_0xbfac47[_0x336c('0x31')]);}};Acw[_0x336c('0x19')][_0x336c('0xd')]=function(_0x58d26c){try{if(this[_0x336c('0x9')][_0x58d26c['uniqueid']]&&_['isUndefined'](this[_0x336c('0x9')][_0x58d26c['uniqueid']]['attended'])){logger[_0x336c('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x58d26c[_0x336c('0x1d')]);this[_0x336c('0x40')](_0x58d26c[_0x336c('0x1d')]);}else if(this[_0x336c('0x9')][_0x58d26c['linkedid']]&&_['isUndefined'](this[_0x336c('0x9')][_0x58d26c[_0x336c('0x41')]]['attended'])){logger[_0x336c('0x1f')](_0x336c('0x42'),_0x58d26c['linkedid']);this[_0x336c('0x40')](_0x58d26c[_0x336c('0x41')]);}}catch(_0x2eb56f){logger[_0x336c('0x2f')]('[ACW][syncHangupRequest]\x20%s',_0x2eb56f[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncHangup']=function(_0x57857d){try{if(this['channels'][_0x57857d['uniqueid']]&&this['channels'][_0x57857d[_0x336c('0x1d')]][_0x336c('0x29')]){logger[_0x336c('0x1f')](_0x336c('0x43'),_0x57857d['uniqueid']);this[_0x336c('0x40')](_0x57857d[_0x336c('0x1d')]);}else if(this[_0x336c('0x9')][_0x57857d[_0x336c('0x41')]]&&this['channels'][_0x57857d[_0x336c('0x41')]]['attended']){logger[_0x336c('0x1f')](_0x336c('0x44'),_0x57857d[_0x336c('0x41')]);this[_0x336c('0x40')](_0x57857d[_0x336c('0x41')]);}}catch(_0x171b00){logger['error']('[ACW][syncHangup]\x20%s',_0x171b00[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncAttendedTransfer']=function(_0x22a0bd){try{if(!_[_0x336c('0x45')](this[_0x336c('0x9')][_0x22a0bd['transfereeuniqueid']])){this['startAcw'](_0x22a0bd[_0x336c('0x46')]);if(this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]]){this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]][_0x336c('0x29')]=!![];this['channels'][_0x22a0bd[_0x336c('0x48')]]=this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x47')]];delete this['channels'][_0x22a0bd['secondtransfereruniqueid']];}}else if(!_[_0x336c('0x45')](this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x48')]])){this[_0x336c('0x40')](_0x22a0bd[_0x336c('0x48')]);if(this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x49')]]){this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x49')]][_0x336c('0x29')]=!![];this[_0x336c('0x9')][_0x22a0bd[_0x336c('0x46')]]=this[_0x336c('0x9')][_0x22a0bd['origtransfereruniqueid']];delete this['channels'][_0x22a0bd['origtransfereruniqueid']];}}}catch(_0x4ddd8d){logger[_0x336c('0x2f')](_0x336c('0x4a'),_0x4ddd8d['message']);}};Acw[_0x336c('0x19')][_0x336c('0x15')]=function(_0x3c31f6){try{if(this[_0x336c('0x9')][_0x3c31f6[_0x336c('0x4b')]]){logger[_0x336c('0x1f')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x336c('0x38')](_0x3c31f6['transfereruniqueid']));this[_0x336c('0x40')](_0x3c31f6[_0x336c('0x4b')]);}else if(this[_0x336c('0x9')][_0x3c31f6['transfererlinkedid']]){logger[_0x336c('0x1f')](_0x336c('0x4c'),JSON['stringify'](_0x3c31f6[_0x336c('0x4d')]));this['startAcw'](_0x3c31f6[_0x336c('0x4d')]);}}catch(_0x186177){logger[_0x336c('0x2f')](_0x336c('0x4e'),_0x186177[_0x336c('0x31')]);}};Acw[_0x336c('0x19')]['syncAgentRingNoAnswer']=function(_0x33130d){try{if(this['voiceQueues'][_0x33130d['queue']]&&this['voiceQueues'][_0x33130d['queue']]['autopause']==='all'){if(this[_0x336c('0x7')][_0x33130d[_0x336c('0x3a')]]){logger[_0x336c('0x1f')](_0x336c('0x4f'),_0x33130d[_0x336c('0x1d')],_0x33130d[_0x336c('0x3a')],_0x33130d[_0x336c('0x22')]);return RpcUser['savePause'](this[_0x336c('0x7')][_0x33130d[_0x336c('0x3a')]],_0x336c('0x50'),_0x33130d[_0x336c('0x1d')]);}}}catch(_0x4ba9de){logger[_0x336c('0x2f')](_0x336c('0x51'),_0x4ba9de[_0x336c('0x31')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 893e613..df98824 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 _0x5b95=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionDeviceStateList','actionSipPeerStatus','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b95,0xb7));var _0x55b9=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x5b95[_0x525c7b];return _0x27b33e;};'use strict';var Manager=require(_0x55b9('0x0'));var BPromise=require(_0x55b9('0x1'));var util=require(_0x55b9('0x2'));var logger=require(_0x55b9('0x3'))(_0x55b9('0x4'));var config=require(_0x55b9('0x5'));var ami=new Manager(config[_0x55b9('0x6')][_0x55b9('0x7')],config[_0x55b9('0x6')]['ip'],config[_0x55b9('0x6')]['username'],config[_0x55b9('0x6')][_0x55b9('0x8')],!![]);ami['keepConnected']();ami[_0x55b9('0x9')]=BPromise[_0x55b9('0xa')](ami[_0x55b9('0xb')]);function error(_0x5f1d7d){logger[_0x55b9('0xc')](util[_0x55b9('0xd')](_0x55b9('0xe'),config[_0x55b9('0x6')][_0x55b9('0xf')],config[_0x55b9('0x6')]['ip'],config[_0x55b9('0x6')][_0x55b9('0x7')],util[_0x55b9('0x10')](_0x5f1d7d,![],null)));}function close(){logger[_0x55b9('0xc')](util['format'](_0x55b9('0x11'),config[_0x55b9('0x6')][_0x55b9('0xf')],config['asterisk']['ip'],config[_0x55b9('0x6')]['port']));}ami[_0x55b9('0x12')]=function(){return function(){return ami['Action']({'action':_0x55b9('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x55b9('0x9')]({'action':_0x55b9('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x55b9('0x9')]({'action':_0x55b9('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x55b9('0x16')});};};ami[_0x55b9('0x17')]=function(){return function(){return ami[_0x55b9('0x9')]({'action':_0x55b9('0x18')});};};function connect(){logger[_0x55b9('0x19')](util[_0x55b9('0xd')](_0x55b9('0x1a'),config['asterisk'][_0x55b9('0xf')],config[_0x55b9('0x6')]['ip'],config[_0x55b9('0x6')][_0x55b9('0x7')]));ami[_0x55b9('0x1b')](_0x55b9('0xc'),error);ami['once'](_0x55b9('0x1c'),close);}ami['on'](_0x55b9('0x1d'),connect);ami['on'](_0x55b9('0x1e'),function(_0x149e63){logger['info'](util[_0x55b9('0xd')](_0x55b9('0x1f'),config['asterisk']['username'],config[_0x55b9('0x6')]['ip'],config['asterisk'][_0x55b9('0x7')],util['inspect'](_0x149e63,![],null)));});ami['on'](_0x55b9('0x20'),function(){logger['info'](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x55b9('0x6')][_0x55b9('0xf')],config[_0x55b9('0x6')]['ip'],config[_0x55b9('0x6')][_0x55b9('0x7')]));return Promise[_0x55b9('0x21')]()[_0x55b9('0x22')](ami[_0x55b9('0x12')]())['then'](ami[_0x55b9('0x23')]())[_0x55b9('0x22')](ami[_0x55b9('0x24')]())[_0x55b9('0x22')](ami['actionQueueSummary']())[_0x55b9('0x22')](ami[_0x55b9('0x17')]())[_0x55b9('0x25')](function(_0x4bc74b){logger[_0x55b9('0xc')](_0x55b9('0x26'),util[_0x55b9('0x10')](_0x4bc74b,{'showHidden':![],'depth':null}));});});ami[_0x55b9('0x1b')](_0x55b9('0xc'),error);ami[_0x55b9('0x1b')](_0x55b9('0x1c'),close);module[_0x55b9('0x27')]=ami; \ No newline at end of file +var _0xbdc9=['action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','resolve','then','exports','asterisk-manager','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','promisify'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xbdc9,0x106));var _0x9bdc=function(_0x2f5ead,_0x5e3b75){_0x2f5ead=_0x2f5ead-0x0;var _0x121722=_0xbdc9[_0x2f5ead];return _0x121722;};'use strict';var Manager=require(_0x9bdc('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require(_0x9bdc('0x1'))(_0x9bdc('0x2'));var config=require(_0x9bdc('0x3'));var ami=new Manager(config[_0x9bdc('0x4')][_0x9bdc('0x5')],config[_0x9bdc('0x4')]['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x6')],config[_0x9bdc('0x4')][_0x9bdc('0x7')],!![]);ami[_0x9bdc('0x8')]();ami['Action']=BPromise[_0x9bdc('0x9')](ami[_0x9bdc('0xa')]);function error(_0xdf112c){logger[_0x9bdc('0xb')](util['format'](_0x9bdc('0xc'),config[_0x9bdc('0x4')]['username'],config[_0x9bdc('0x4')]['ip'],config['asterisk']['port'],util[_0x9bdc('0xd')](_0xdf112c,![],null)));}function close(){logger[_0x9bdc('0xb')](util[_0x9bdc('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x9bdc('0x6')],config['asterisk']['ip'],config[_0x9bdc('0x4')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x10')});};};ami[_0x9bdc('0x11')]=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x12')});};};ami[_0x9bdc('0x13')]=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x14')});};};ami[_0x9bdc('0x15')]=function(){return function(){return ami['Action']({'action':_0x9bdc('0x16')});};};ami[_0x9bdc('0x17')]=function(){return function(){return ami[_0x9bdc('0xf')]({'action':_0x9bdc('0x18')});};};function connect(){logger[_0x9bdc('0x19')](util[_0x9bdc('0xe')](_0x9bdc('0x1a'),config[_0x9bdc('0x4')][_0x9bdc('0x6')],config[_0x9bdc('0x4')]['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x5')]));ami[_0x9bdc('0x1b')](_0x9bdc('0xb'),error);ami[_0x9bdc('0x1b')](_0x9bdc('0x1c'),close);}ami['on'](_0x9bdc('0x1d'),connect);ami['on'](_0x9bdc('0x1e'),function(_0x454ceb){logger[_0x9bdc('0x19')](util[_0x9bdc('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x9bdc('0x6')],config[_0x9bdc('0x4')]['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x5')],util[_0x9bdc('0xd')](_0x454ceb,![],null)));});ami['on']('fullybooted',function(){logger[_0x9bdc('0x19')](util[_0x9bdc('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x9bdc('0x4')]['username'],config['asterisk']['ip'],config[_0x9bdc('0x4')][_0x9bdc('0x5')]));return Promise[_0x9bdc('0x1f')]()['then'](ami['actionSipShowRegistry']())[_0x9bdc('0x20')](ami[_0x9bdc('0x11')]())[_0x9bdc('0x20')](ami[_0x9bdc('0x13')]())['then'](ami[_0x9bdc('0x15')]())[_0x9bdc('0x20')](ami['actionCoreShowChannels']())['catch'](function(_0x54fb1b){logger[_0x9bdc('0xb')]('[ami.js][fullybooted]',util[_0x9bdc('0xd')](_0x54fb1b,{'showHidden':![],'depth':null}));});});ami[_0x9bdc('0x1b')](_0x9bdc('0xb'),error);ami[_0x9bdc('0x1b')](_0x9bdc('0x1c'),close);module[_0x9bdc('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 601928e..fba27bd 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 _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x70e0,0x17b));var _0x070e=function(_0x38cd2f,_0x2f1d44){_0x38cd2f=_0x38cd2f-0x0;var _0x41fab3=_0x70e0[_0x38cd2f];return _0x41fab3;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xe706,0xa3));var _0x6e70=function(_0x3f9631,_0x51ffcb){_0x3f9631=_0x3f9631-0x0;var _0x242d84=_0xe706[_0x3f9631];return _0x242d84;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 57bad3d..ecf5bc1 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 _0x50db=['type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','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','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','---------------------------','getSeconds','debug','name','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','prototype','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','length','Action','command','iftime\x20%s,%s','interval','indexOf','true','content','catch','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','predictive','power','handlePower','dialPowerLevel','Queue','silly','Dialer::ifTime()','intervalIftime','[ifTime][promiseAll]','isGlobal','Error','queue','uniqueId','ivr','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete]','updateOriginated','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','dropreason','CALLEREXIT','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','additional','countabandonedretry','CampaignId','Abandoned','endtime','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','isNil','paused','stateinterface','locked','queueBooked','push','merge','idHopper','roundrobin','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','run','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','response','Success','[callProgressDetecting]\x20','syncVarSet','amdstatus','exten','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','value','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','membername','AMD','[syncHangupInAMDIvr][createHistory]','MACHINE','Machine','countnoanswerretry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','queuesSummary','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','filter','dialPreviewRecallmeReminder','reachable','map','Agent','user:%s','clearZombieChannels','[actions]','sequence','enqueue','[Dialer][checkChannel]','getVoiceQueueRtPauses','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','checkPreviewRecallReminder','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundNoSuchCallsDay','NoSuchNumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','one\x20call\x20every:','milliseconds','[handlePredictive]','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','loggerHandler','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','erlangb','exports','lodash','moment','ioredis','./utils','./utils/hopper','dialer','../../../config/logger','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','emit'];(function(_0x488ca1,_0xf6858e){var _0x4dd0a4=function(_0x40fb65){while(--_0x40fb65){_0x488ca1['push'](_0x488ca1['shift']());}};_0x4dd0a4(++_0xf6858e);}(_0x50db,0x1d6));var _0xb50d=function(_0x1eac47,_0x943cea){_0x1eac47=_0x1eac47-0x0;var _0x460b89=_0x50db[_0x1eac47];return _0x460b89;};'use strict';var util=require('util');var _=require(_0xb50d('0x0'));var uuid=require('uuid');var moment=require(_0xb50d('0x1'));var rr=require('rr');var Redis=require(_0xb50d('0x2'));var utils=require(_0xb50d('0x3'));var hopperUtils=require(_0xb50d('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xb50d('0x5'));var loggerBooked=require(_0xb50d('0x6'))(_0xb50d('0x7'));var loggerPredictive=require(_0xb50d('0x6'))('predictive');var loggerPredictiveCalls=require(_0xb50d('0x6'))(_0xb50d('0x8'));var loggerSyncQueueSummary=require(_0xb50d('0x6'))(_0xb50d('0x9'));var ami=require('../ami');config[_0xb50d('0xa')]=_[_0xb50d('0xb')](config[_0xb50d('0xa')],{'host':_0xb50d('0xc'),'port':0x18eb});var io=require(_0xb50d('0xd'))(new Redis(config[_0xb50d('0xa')]));var cmHopper=require(_0xb50d('0xe'));var voiceQueueRt=require(_0xb50d('0xf'));var RpcSetting=require(_0xb50d('0x10'));var Interval=require('../rpc/interval');var Action=require(_0xb50d('0x11'));var History=require(_0xb50d('0x12'));var Final=require(_0xb50d('0x13'));var AgentComplete=require(_0xb50d('0x14'));var QueueCallerAbandon=require(_0xb50d('0x15'));var Hangup=require('./models/hangup');var ipAgi=process[_0xb50d('0x16')][_0xb50d('0x17')]||_0xb50d('0x18');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x2153e5){this[_0xb50d('0x19')]=this[_0xb50d('0x19')]?this[_0xb50d('0x19')]['finally'](_0x2153e5):_0x2153e5();};function Dialer(_0x385dfb,_0x360c37){this['sequence']=new Sequence();this[_0xb50d('0x1a')]=_0x360c37;this[_0xb50d('0x1b')]=_0x385dfb[_0xb50d('0x1b')];this[_0xb50d('0x1c')]=_0x385dfb[_0xb50d('0x1c')];this[_0xb50d('0x1d')]=_0x385dfb['agents'];this[_0xb50d('0x1e')]=_0x385dfb['trunks'];this[_0xb50d('0x1f')]=config[_0xb50d('0x1f')]||0x2;this[_0xb50d('0x20')]={};this[_0xb50d('0x21')]={};this[_0xb50d('0x22')]={};this['uniqueId']={};this[_0xb50d('0x23')]={};this[_0xb50d('0x24')]={};this[_0xb50d('0x25')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0xb50d('0x26')]={};this['queuesSummary']={};ami['on'](_0xb50d('0x27'),this[_0xb50d('0x28')]['bind'](this));ami['on'](_0xb50d('0x29'),this[_0xb50d('0x2a')][_0xb50d('0x2b')](this));ami['on'](_0xb50d('0x2c'),this[_0xb50d('0x2d')][_0xb50d('0x2b')](this));ami['on'](_0xb50d('0x2e'),this[_0xb50d('0x2f')][_0xb50d('0x2b')](this));ami['on']('custom:queuesummary',this[_0xb50d('0x9')]['bind'](this));ami['on'](_0xb50d('0x30'),this[_0xb50d('0x31')][_0xb50d('0x2b')](this));ami['on']('hangup',this[_0xb50d('0x32')][_0xb50d('0x2b')](this));ami['on']('newexten',this[_0xb50d('0x33')]['bind'](this));ami['on'](_0xb50d('0x34'),this['syncVarSet'][_0xb50d('0x2b')](this));ami['on'](_0xb50d('0x35'),this[_0xb50d('0x36')][_0xb50d('0x2b')](this));ami['on'](_0xb50d('0x37'),this[_0xb50d('0x38')]['bind'](this));this[_0xb50d('0x39')]();this[_0xb50d('0x3a')]();RpcSetting[_0xb50d('0x3b')]()[_0xb50d('0x3c')](function(_0x5234c7){previewRecallmeReminderInterval=_0x5234c7['previewRecallmeReminderInterval'];});}function isNotNull(_0x35b5a2){return _0x35b5a2!==null&&!_['isUndefined'](_0x35b5a2);}function msgResponse(_0x317021,_0x2703be,_0x4c105f){return{'action':_0x317021,'response':_0x2703be,'message':_0x4c105f,'stack':_0x4c105f};}function emit(_0x15ca94,_0x4af06d,_0x45c87c){io['to'](_0x15ca94)[_0xb50d('0x3d')](_0x4af06d,_0x45c87c);}function emitOutboundVoiceQueueSummary(_0x2b75d3){if(_0x2b75d3[_0xb50d('0x3e')]===_0xb50d('0x3f')){logger['debug'](_0xb50d('0x40'),util[_0xb50d('0x41')](_0x2b75d3,{'showHidden':![],'depth':null}));emit(util[_0xb50d('0x42')](_0xb50d('0x43'),_0x2b75d3['name']),_0xb50d('0x44'),_0x2b75d3);}}function checkGetDataPredictive(_0x359140){if(isNotNull(_0x359140)&&!_['isEmpty'](_0x359140)){loggerPredictive[_0xb50d('0x45')](_0xb50d('0x46'));loggerPredictive[_0xb50d('0x45')](_0xb50d('0x47'),_0x359140[_0xb50d('0x48')]);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x49'),_0x359140[_0xb50d('0x4a')]);loggerPredictive[_0xb50d('0x45')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x359140['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xb50d('0x4b'),_0x359140[_0xb50d('0x4c')]);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x4d'),_0x359140[_0xb50d('0x4e')]);loggerPredictive['info'](_0xb50d('0x4f'),_0x359140[_0xb50d('0x50')]);loggerPredictive[_0xb50d('0x45')]('---------------------------');if(_0x359140['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x359140[_0xb50d('0x50')])&&_0x359140[_0xb50d('0x50')]>0x0){return!![];}loggerPredictive[_0xb50d('0x45')](_0xb50d('0x51'));if(!_[_0xb50d('0x52')](_0x359140[_0xb50d('0x4e')])&&_0x359140[_0xb50d('0x4e')]>0x0){return!![];}loggerPredictive[_0xb50d('0x45')](_0xb50d('0x53'));}else{loggerPredictive[_0xb50d('0x45')](_0xb50d('0x54'));}}else{loggerPredictive[_0xb50d('0x45')](_0xb50d('0x55'));}return![];}function mergeDataErlangB(_0x16063a){return function(_0x250a61){loggerPredictive[_0xb50d('0x45')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xb50d('0x45')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x250a61[_0xb50d('0x56')]);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x57'),_0x250a61[_0xb50d('0x58')]);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x59'),_0x250a61[_0xb50d('0x5a')]);loggerPredictive[_0xb50d('0x45')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x250a61[_0xb50d('0x5b')]);loggerPredictive[_0xb50d('0x45')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x250a61['erlangAbandonmentRate']);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x5c'));_['merge'](_0x16063a,_0x250a61);};}function ifInterval(_0x35ab54,_0x1b0a40){if(_[_0xb50d('0x52')](_0x1b0a40)){return![];}return utils[_0xb50d('0x5d')](undefined,_0x1b0a40)<_0x35ab54*0x3c;}function clearPredictiveAttributes(_0x546c13){if(_0x546c13[_0xb50d('0x25')]){_0x546c13[_0xb50d('0x25')]=undefined;loggerPredictive[_0xb50d('0x5e')](_0x546c13[_0xb50d('0x5f')],_0xb50d('0x60'));}if(_0x546c13[_0xb50d('0x24')]){_0x546c13[_0xb50d('0x24')]=undefined;loggerPredictive[_0xb50d('0x5e')](_0x546c13[_0xb50d('0x5f')],_0xb50d('0x61'));}if(_0x546c13[_0xb50d('0x62')]){clearInterval(_0x546c13['handlePredictive']);_0x546c13[_0xb50d('0x62')]=undefined;loggerPredictive[_0xb50d('0x5e')](_0x546c13[_0xb50d('0x5f')],_0xb50d('0x63'));}}function loggerCatchPredictive(_0x6b39a5,_0x1c4afa){return function(_0x4e2bcd){loggerPredictive[_0xb50d('0x64')](_0x1c4afa[_0xb50d('0x5f')],_0x6b39a5);loggerPredictive[_0xb50d('0x64')](_0x4e2bcd['stack']);clearPredictiveAttributes(_0x1c4afa);};}function loggerCatch(_0x4f7df6){return function(_0x1c1e07){logger[_0xb50d('0x64')](_0x4f7df6,util['inspect'](_0x1c1e07,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x26a65e,_0x582767,_0x3429bb){return function(_0x149815){utils[_0xb50d('0x65')](_0x582767,_0x3429bb,0x0);_0x582767['temp']=0x0;logger[_0xb50d('0x64')](_0x26a65e,util['inspect'](_0x149815,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4be67f){return function(_0x4b5ac0){if(isNotNull(_0x4b5ac0)&&isNotNull(_0x4b5ac0[0x0])){if(_0x4b5ac0[0x0][_0xb50d('0x66')]>0x0){_0x4be67f[_0xb50d('0x67')]=utils[_0xb50d('0x68')]['CONTACTS_RESCHEDULED'];logger[_0xb50d('0x45')]('[getContactDialer2][ReScheduled]'+_0x4be67f['name'],_0x4b5ac0[0x0][_0xb50d('0x66')],_0xb50d('0x69'));}else{_0x4be67f[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x6a')];logger[_0xb50d('0x45')](_0xb50d('0x6b')+_0x4be67f['name']);}}};}function createObjHistory(_0x18d9d0,_0x5ef6c2,_0x20048e,_0x50946b,_0x255db5){_0x18d9d0[_0xb50d('0x67')]=_0x20048e;var _0xe32142=new Action(_0x18d9d0,_0x5ef6c2);var _0x34aa94=new History(_0xe32142);_0x34aa94[_0xb50d('0x6c')]=_0x50946b;_0x34aa94[_0xb50d('0x6d')]=_0x255db5;_0x34aa94['endtime']=_0xe32142[_0xb50d('0x6e')];return _0x34aa94;}function unlockQueueStatus(_0x1e1194,_0x111bb4){setTimeout(function(){if(_['isUndefined'](_0x1e1194[_0xb50d('0x6f')])){loggerBooked[_0xb50d('0x64')]('[unlockQueueStatus][undefined]',_0x111bb4);}_0x1e1194['queueStatusComplete']=!![];loggerBooked[_0xb50d('0x45')]('[booked][unlockQueueStatus]',_0x111bb4,JSON[_0xb50d('0x70')](_[_0xb50d('0x71')](_0x1e1194,[_0xb50d('0x5f'),_0xb50d('0x6f')])));},0x1f3);}function checkInterval(_0x2a8ef2){return function(){if(!isNotNull(_0x2a8ef2[_0xb50d('0x72')])){_0x2a8ef2[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x73')];throw _0x2a8ef2[_0xb50d('0x5f')]+_0xb50d('0x74');}if(!isNotNull(_0x2a8ef2[_0xb50d('0x72')][_0xb50d('0x75')])){_0x2a8ef2[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x73')];throw _0x2a8ef2[_0xb50d('0x5f')]+_0xb50d('0x74');}if(!isNotNull(_[_0xb50d('0x76')](_0x2a8ef2[_0xb50d('0x72')][_0xb50d('0x75')]))){_0x2a8ef2[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x73')];throw _0x2a8ef2[_0xb50d('0x5f')]+_0xb50d('0x74');}};}function checkIsIVRCampaignActive(_0x3c1c40){return function(){if(!utils[_0xb50d('0x77')](_0x3c1c40)){_0x3c1c40['message']=utils[_0xb50d('0x68')][_0xb50d('0x78')];throw _0x3c1c40['name']+_0xb50d('0x79');}};}function emitCampaignSummary(_0x2dd1ca){if(utils[_0xb50d('0x7a')](_0x2dd1ca)){emit(util['format']('campaign:ivr:%s',_0x2dd1ca[_0xb50d('0x5f')]),_0xb50d('0x7b'),_0x2dd1ca);}}function loggerCatchQueueSummary(_0x5e9357,_0x4754b8){return function(_0x28fce9){clearPredictiveAttributes(_0x4754b8);emitCampaignSummary(_0x4754b8);loggerSyncQueueSummary['debug'](_0x5e9357,util['inspect'](_0x28fce9,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x523d82){if(_0x523d82['sendMessageOneNotActive']){if(_0x523d82[_0xb50d('0x7c')]===0x0){_0x523d82[_0xb50d('0x7d')]=![];_0x523d82[_0xb50d('0x67')]=utils[_0xb50d('0x68')]['INACTIVE'];loggerSyncQueueSummary[_0xb50d('0x5e')](_0xb50d('0x7e'),_0x523d82[_0xb50d('0x5f')],_0xb50d('0x7f'));}else{_0x523d82[_0xb50d('0x67')]=utils[_0xb50d('0x68')]['DISACTIVED'];loggerSyncQueueSummary[_0xb50d('0x5e')](_0xb50d('0x7e'),_0x523d82[_0xb50d('0x5f')],_0xb50d('0x80'));}emitCampaignSummary(_0x523d82);}}function myreject(_0xd9cca0){return function(_0x5bb7b8){return _0xd9cca0(msgResponse('[ifTime][Action]','Error',JSON[_0xb50d('0x70')](_0x5bb7b8)));};}Dialer[_0xb50d('0x81')][_0xb50d('0x82')]=function(_0x28efd8){return!_['isUndefined'](_0x28efd8)&&_0x28efd8&&!_[_0xb50d('0x52')](_0x28efd8['name'])&&!_[_0xb50d('0x52')](_0x28efd8['active'])&&_0x28efd8[_0xb50d('0x83')]&&(this[_0xb50d('0x1e')][util[_0xb50d('0x42')]('SIP/%s',_0x28efd8[_0xb50d('0x5f')])]['status']==='reachable'||this[_0xb50d('0x1e')][util[_0xb50d('0x42')](_0xb50d('0x84'),_0x28efd8[_0xb50d('0x5f')])][_0xb50d('0x85')]===_0xb50d('0x86'));};Dialer[_0xb50d('0x81')][_0xb50d('0x87')]=function(_0x4ff61f){var _0x11f38a=this;return function(){if(!_0x11f38a[_0xb50d('0x82')](_0x4ff61f[_0xb50d('0x88')])){if(!_0x11f38a[_0xb50d('0x82')](_0x4ff61f[_0xb50d('0x89')])){_0x4ff61f[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x8a')];throw _0x4ff61f[_0xb50d('0x5f')]+_0xb50d('0x8b');}}};};Dialer['prototype'][_0xb50d('0x8c')]=function(_0x32c5c5,_0x4d170a,_0x1d46d1,_0x1a0fcc){var _0x47aecb=this;return function(){var _0x44e88a=!![];return _0x47aecb[_0xb50d('0x8d')](_0x32c5c5,_0x4d170a,_0x1d46d1,_0x1a0fcc,_0x44e88a);};};Dialer[_0xb50d('0x81')][_0xb50d('0x8e')]=function(_0x223977,_0x3e3941,_0xc368c,_0x2c0ee6){var _0x173c5c=this;return function(){var _0x92258=![];return _0x173c5c['ifTimeIvr'](_0x223977[_0xb50d('0x75')],_0x3e3941,_0xc368c,_0x2c0ee6,_0x92258);};};Dialer[_0xb50d('0x81')][_0xb50d('0x8d')]=function(_0x3f629e,_0x250bac,_0x4b82f2,_0x303732,_0xb43ca5){var _0x2ddb82=[];return new Promise(function(_0x2d6294,_0x22f0a0){if(!isNotNull(_0x3f629e)){_0x303732[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x73')];return _0x22f0a0(msgResponse(_0xb50d('0x8f'),_0xb50d('0x90'),_0x4b82f2+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xb50d('0x76')](_0x3f629e)){_0x303732['message']=utils[_0xb50d('0x68')][_0xb50d('0x91')];return _0x22f0a0(msgResponse(_0xb50d('0x8f'),'Failure',_0x4b82f2+_0xb50d('0x92')));}if(_0x250bac&&_[_0xb50d('0x52')](config[_0xb50d('0x93')][_0x250bac])){_0x303732[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x94')];return _0x22f0a0(msgResponse(_0xb50d('0x8f'),'Failure',_0x4b82f2+_0xb50d('0x95')+_0x250bac));}if(_['isArray'](_0x3f629e)){for(var _0x114994=0x0;_0x114994<_0x3f629e[_0xb50d('0x96')];_0x114994+=0x1){_0x2ddb82['push'](ami[_0xb50d('0x97')]({'action':_0xb50d('0x98'),'command':util['format'](_0xb50d('0x99'),_0x3f629e[_0x114994][_0xb50d('0x9a')],!_[_0xb50d('0x52')](config[_0xb50d('0x93')][_0x250bac])?_0x250bac:'')})[_0xb50d('0x3c')](function(_0x8b7eb9){return _0x8b7eb9['content'][_0xb50d('0x9b')](_0xb50d('0x9c'))>=0x0;})['catch'](myreject(_0x22f0a0)));}}else{_0x2ddb82['push'](ami['Action']({'action':'command','command':util['format']('iftime\x20%s,%s',_0x3f629e,!_['isUndefined'](config[_0xb50d('0x93')][_0x250bac])?_0x250bac:'')})[_0xb50d('0x3c')](function(_0x33e977){return _0x33e977[_0xb50d('0x9d')]['indexOf'](_0xb50d('0x9c'))>=0x0;})[_0xb50d('0x9e')](myreject(_0x22f0a0)));}Promise[_0xb50d('0x9f')](_0x2ddb82)[_0xb50d('0x3c')](function(_0x3b8a18){var _0x5b2e99=_[_0xb50d('0xa0')](_0x3b8a18);if(_0x5b2e99){return _0x2d6294(_0x5b2e99);}else{_0x303732[_0xb50d('0x67')]=_0xb43ca5?utils['CAMPAIGN_STATUS'][_0xb50d('0xa1')]:utils[_0xb50d('0x68')][_0xb50d('0xa2')];return _0x22f0a0(msgResponse('[ifTime][promiseAll]',_0xb50d('0x90'),_0xb50d('0xa3')+_0xb43ca5+'\x20'+_0x4b82f2+_0xb50d('0xa4')+util['inspect'](_0x3f629e,{'showHidden':![],'depth':null})+_0xb50d('0xa5')+_0x250bac));}})[_0xb50d('0x9e')](function(_0x2654b9){return _0x22f0a0(msgResponse('ifTime',_0xb50d('0x90'),JSON[_0xb50d('0x70')](_0x2654b9)));});});};Dialer[_0xb50d('0x81')][_0xb50d('0x39')]=function(){var _0x5cdfb6=this;return cmHopper[_0xb50d('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0xb50d('0x3c')](function(){setInterval(function(){_0x5cdfb6[_0xb50d('0xa7')]();},0x3e8);});};Dialer[_0xb50d('0x81')][_0xb50d('0xa7')]=function(){var _0x29cb0f=this;var _0x1b506c;for(var _0x26956c in this[_0xb50d('0x1c')]){if(typeof this[_0xb50d('0x1c')][_0x26956c]!=='undefined'){_0x1b506c=this[_0xb50d('0x1c')][_0x26956c];if(utils['isIVRCampaign'](_0x1b506c)&&utils['isIVRCampaignActive'](_0x1b506c)){_0x1b506c['sendMessageOneNotActive']=!![];Promise[_0xb50d('0xa8')]()[_0xb50d('0x3c')](checkIsIVRCampaignActive(_0x1b506c))['then'](checkInterval(_0x1b506c))[_0xb50d('0x3c')](_0x29cb0f[_0xb50d('0x87')](_0x1b506c))[_0xb50d('0x3c')](_0x29cb0f[_0xb50d('0x8c')](_0x1b506c[_0xb50d('0xa9')],_0x1b506c[_0xb50d('0xaa')],_0x1b506c['name'],_0x1b506c))[_0xb50d('0x3c')](_0x29cb0f[_0xb50d('0x8e')](_0x1b506c['Interval'],_0x1b506c[_0xb50d('0xaa')],_0x1b506c['name'],_0x1b506c))[_0xb50d('0x3c')](_0x29cb0f[_0xb50d('0xab')](_0x1b506c))[_0xb50d('0x9e')](loggerCatchQueueSummary(_0xb50d('0xac'),_0x1b506c));}else{notSendMessagesCampaign(_0x1b506c);}}}};Dialer[_0xb50d('0x81')][_0xb50d('0xad')]=function(_0x2141b1){if(_0x2141b1[_0xb50d('0xae')]!==_0xb50d('0xaf')){clearPredictiveAttributes(_0x2141b1);}switch(_0x2141b1[_0xb50d('0xae')]){case'progressive':this['handlePower'](_0x2141b1,0x1);break;case _0xb50d('0xb0'):this[_0xb50d('0xb1')](_0x2141b1,_0x2141b1[_0xb50d('0xb2')]);break;case _0xb50d('0xaf'):this[_0xb50d('0xaf')](_0x2141b1);break;case _0xb50d('0x7'):this['handlePower'](_0x2141b1,0x1);break;default:logger[_0xb50d('0x64')](_0xb50d('0xb3'),_0x2141b1['name'],'method\x20not\x20recognized');}};Dialer[_0xb50d('0x81')]['ifTime']=function(_0x214a5e,_0x24984b){var _0x638e1b=_0x214a5e[_0xb50d('0xaa')];var _0x207a5a=_0x24984b?_0x214a5e[_0xb50d('0xa9')]:_0x214a5e[_0xb50d('0x72')]['Intervals'];logger[_0xb50d('0xb4')](_0xb50d('0xb5'),_0x207a5a,_0x638e1b,_0x214a5e['name'],util['format']('Voice\x20Queue\x20%s\x20$s',_0x214a5e['name'],_0x214a5e['id']));var _0x43063f=null;return Interval[_0xb50d('0xb6')](_0x207a5a,_0x638e1b)[_0xb50d('0x3c')](function(_0x59e804){if(_0x59e804===!![]){return _0x59e804;}else{_0x214a5e[_0xb50d('0x67')]=_0x24984b?utils['CAMPAIGN_STATUS'][_0xb50d('0xa1')]:utils[_0xb50d('0x68')]['OVERTIME_INTERVAL'];_0x43063f=msgResponse(_0xb50d('0xb7'),_0xb50d('0x90'),_0xb50d('0xa3')+_0x24984b+'\x20'+_0x214a5e[_0xb50d('0x5f')]+_0xb50d('0xa4')+util['inspect'](_0x207a5a,{'showHidden':![],'depth':null})+_0xb50d('0xa5')+_0x638e1b);}if(_0x43063f!==null){logger['silly']('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x43063f);_0x43063f[_0xb50d('0xb8')]=_0x24984b;throw _0x43063f;}})[_0xb50d('0x9e')](function(_0x3c9073){logger[_0xb50d('0x64')]('AMI\x20IfTime',_0x3c9073);throw msgResponse('[ifTime][Action]',_0xb50d('0xb9'),util[_0xb50d('0x41')](_0x3c9073,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xb50d('0x28')]=function(_0x4cbc6e){if(this['voiceQueues'][_0x4cbc6e[_0xb50d('0xba')]]){if(this[_0xb50d('0xbb')][_0x4cbc6e['uniqueid']]&&this[_0xb50d('0xbb')][_0x4cbc6e['uniqueid']][_0xb50d('0x3e')]!==_0xb50d('0xbc')){this['updateOriginated'](this[_0xb50d('0x1b')][_0x4cbc6e['queue']]);this[_0xb50d('0xbb')][_0x4cbc6e[_0xb50d('0xbd')]][_0xb50d('0xbe')]=moment()[_0xb50d('0x42')](_0xb50d('0xbf'));}}};Dialer['prototype'][_0xb50d('0x2f')]=function(_0x5d1e8b){var _0x53dc88=this[_0xb50d('0xbb')][_0x5d1e8b[_0xb50d('0xbd')]];if(this[_0xb50d('0x1b')][_0x5d1e8b[_0xb50d('0xba')]]){if(_0x53dc88&&_0x53dc88[_0xb50d('0x3e')]!==_0xb50d('0xbc')){delete this[_0xb50d('0xbb')][_0x5d1e8b[_0xb50d('0xbd')]];this[_0xb50d('0x1b')][_0x5d1e8b['queue']][_0xb50d('0xc0')]+=0x1;var _0x5cdfb2=new AgentComplete(_0x53dc88,_0x5d1e8b);if(_0x5d1e8b[_0xb50d('0xc1')]===_0xb50d('0xc2')){_0x5cdfb2[_0xb50d('0xc3')]=this[_0xb50d('0x1b')][_0x5d1e8b['queue']][_0xb50d('0xc4')]&&this[_0xb50d('0x1b')][_0x5d1e8b['queue']][_0xb50d('0xc5')]?moment()[_0xb50d('0x42')](_0xb50d('0xbf')):undefined;}hopperUtils[_0xb50d('0xc6')](_0x5cdfb2)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5cdfb2)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0xc7')));}}};Dialer['prototype'][_0xb50d('0x2a')]=function(_0x4af234){var _0x440247=this[_0xb50d('0xbb')][_0x4af234['uniqueid']];var _0x5a82f5=this;var _0x41fda4=![];var _0x39d639;var _0x379cc1;if(this['voiceQueues'][_0x4af234[_0xb50d('0xba')]]){if(_0x440247&&_0x440247[_0xb50d('0x3e')]!==_0xb50d('0xbc')){delete this[_0xb50d('0xbb')][_0x4af234['uniqueid']];this[_0xb50d('0xc8')](this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]]);_0x440247[_0xb50d('0xc9')]=moment()['format'](_0xb50d('0xbf'));var _0x41d1a1=new QueueCallerAbandon(_0x440247,_0x4af234);if(utils[_0xb50d('0x5d')](_0x440247[_0xb50d('0xc9')],_0x440247[_0xb50d('0xca')])>=_0x440247['dialQueueTimeout']){this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]][_0xb50d('0xcb')]+=0x1;this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]][_0xb50d('0xcc')]+=0x1;_0x41d1a1[_0xb50d('0x6c')]=0xa;_0x41d1a1[_0xb50d('0x6d')]=_0xb50d('0xcd');_0x41d1a1['dropreason']='TIMEOUT';_0x41d1a1[_0xb50d('0xc3')]=this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]]['dialQueueProject2']?moment()[_0xb50d('0x42')](_0xb50d('0xbf')):undefined;_0x41d1a1[_0xb50d('0xce')]+=0x1;_0x41d1a1[_0xb50d('0xcf')]+=0x1;_0x39d639=this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]]['dialDropRetryFrequency'];_0x379cc1=this[_0xb50d('0x1b')][_0x4af234['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0xb50d('0xd0')](_0x41d1a1,_0x41d1a1[_0xb50d('0x6c')],_0x440247[_0xb50d('0xd1')])[_0xb50d('0x3c')](function(_0x3007bd){_0x41fda4=_0x3007bd['additional']==0x1;if(_0x41d1a1[_0xb50d('0xce')]>=_0x5a82f5[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]]['dialDropMaxRetry']){_0x5a82f5[_0xb50d('0xd2')](_0x41d1a1,_0x3007bd['additional']);}else{hopperUtils[_0xb50d('0xd3')]({'active':![],'countdropretry':_0x41d1a1['countdropretry'],'scheduledat':moment()[_0xb50d('0xd4')](_0x5a82f5['voiceQueues'][_0x4af234['queue']][_0xb50d('0xd5')],_0xb50d('0xd6'))['format'](_0xb50d('0xbf')),'ContactId':_0x440247[_0xb50d('0xd7')],'ListId':_0x440247[_0xb50d('0xd8')],'VoiceQueueId':_0x440247[_0xb50d('0xd9')]||undefined,'CampaignId':_0x440247['CampaignId']||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0xda')));var _0x4141e9=new History(_0x41d1a1);_0x4141e9[_0xb50d('0x6c')]=0xa;_0x4141e9['statedesc']=_0xb50d('0xcd');_0x4141e9[_0xb50d('0x6e')]=moment()[_0xb50d('0x42')](_0xb50d('0xbf'));_0x4141e9['endtime']=_0x4141e9[_0xb50d('0x6e')];_0x4141e9[_0xb50d('0xdb')]=_0x41d1a1[_0xb50d('0xdb')];_0x4141e9[_0xb50d('0xdc')]=_0x41d1a1['calleridnum'];hopperUtils[_0xb50d('0xc6')](_0x4141e9)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0xdd')));}})[_0xb50d('0x3c')](function(){if(_0x41fda4)hopperUtils[_0xb50d('0xde')](_0x41d1a1,_0x39d639,_0x379cc1)[_0xb50d('0x3c')](function(){return 0x1;});});}else{this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]][_0xb50d('0x4c')]+=0x1;this[_0xb50d('0x1b')][_0x4af234['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x41d1a1[_0xb50d('0x6c')]=0xb;_0x41d1a1[_0xb50d('0x6d')]='Abandoned';_0x41d1a1[_0xb50d('0xdf')]=_0xb50d('0xe0');_0x41d1a1['countabandonedretry']+=0x1;_0x41d1a1[_0xb50d('0xcf')]+=0x1;_0x39d639=this[_0xb50d('0x1b')][_0x4af234[_0xb50d('0xba')]]['dialAbandonedRetryFrequency'];_0x379cc1=this['voiceQueues'][_0x4af234[_0xb50d('0xba')]][_0xb50d('0xe1')];hopperUtils['verifyAdditionalPhones'](_0x41d1a1,_0x41d1a1[_0xb50d('0x6c')],_0x440247[_0xb50d('0xd1')])[_0xb50d('0x3c')](function(_0x634a5d){if(_0x41d1a1['countabandonedretry']>=_0x5a82f5[_0xb50d('0x1b')][_0x4af234['queue']][_0xb50d('0xe2')]){_0x5a82f5[_0xb50d('0xd2')](_0x41d1a1,_0x634a5d[_0xb50d('0xe3')]);}else{hopperUtils[_0xb50d('0xd3')]({'active':![],'countabandonedretry':_0x41d1a1[_0xb50d('0xe4')],'scheduledat':moment()['add'](_0x5a82f5[_0xb50d('0x1b')][_0x4af234['queue']]['dialAbandonedRetryFrequency'],_0xb50d('0xd6'))['format'](_0xb50d('0xbf')),'ContactId':_0x440247['ContactId'],'ListId':_0x440247['ListId'],'VoiceQueueId':_0x440247[_0xb50d('0xd9')]||undefined,'CampaignId':_0x440247[_0xb50d('0xe5')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x3cdef7=new History(_0x41d1a1);_0x3cdef7[_0xb50d('0x6c')]=0xb;_0x3cdef7[_0xb50d('0x6d')]=_0xb50d('0xe6');_0x3cdef7[_0xb50d('0x6e')]=moment()[_0xb50d('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0x3cdef7[_0xb50d('0xe7')]=_0x3cdef7[_0xb50d('0x6e')];_0x3cdef7[_0xb50d('0xdb')]=_0x41d1a1[_0xb50d('0xdb')];_0x3cdef7[_0xb50d('0xdc')]=_0x41d1a1[_0xb50d('0xdc')];hopperUtils['createHistory'](_0x3cdef7)['catch'](loggerCatch(_0xb50d('0xe8')));}})[_0xb50d('0x3c')](function(){if(_0x41fda4)hopperUtils[_0xb50d('0xde')](_0x41d1a1,_0x39d639,_0x379cc1)['then'](function(){return 0x1;});});}}}};Dialer[_0xb50d('0x81')][_0xb50d('0x33')]=function(_0x511ea4){if(this[_0xb50d('0x21')][_0x511ea4['uniqueid']]){this['actions'][_0x511ea4[_0xb50d('0xbd')]]['channel']=_0x511ea4[_0xb50d('0xe9')];}if(this[_0xb50d('0xbb')][_0x511ea4[_0xb50d('0xbd')]]){this['uniqueId'][_0x511ea4['uniqueid']][_0xb50d('0xe9')]=_0x511ea4['channel'];}};Dialer[_0xb50d('0x81')]['syncQueueMember']=function(_0xd0f62d){if(!this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]]){return;}var _0x6a84e=this[_0xb50d('0x1b')][this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]][_0xb50d('0xba')]][_0xb50d('0xeb')]||_0xb50d('0xec');if(_0x6a84e==='roundrobin'){if(this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]]&&_[_0xb50d('0xed')](this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]]['locked'])&&_0xd0f62d['status']==='1'&&_0xd0f62d[_0xb50d('0xee')]==='0'){if(this[_0xb50d('0x1d')][_0xd0f62d[_0xb50d('0xef')]]){if(!this[_0xb50d('0x1d')][_0xd0f62d['stateinterface']][_0xb50d('0xf0')]){this[_0xb50d('0x1d')][_0xd0f62d[_0xb50d('0xef')]]['locked']=!![];this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]]['locked']=!![];this[_0xb50d('0x21')][_0xd0f62d['actionid']]['stateinterface']=_0xd0f62d[_0xb50d('0xef')];}}}}else if(_0x6a84e===_0xb50d('0xec')){if(this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]]){if(this[_0xb50d('0x1d')][_0xd0f62d[_0xb50d('0xef')]]){this['actions'][_0xd0f62d[_0xb50d('0xea')]][_0xb50d('0xef')]=_0xd0f62d[_0xb50d('0xef')];if(_[_0xb50d('0xed')](this[_0xb50d('0xf1')][this['actions'][_0xd0f62d[_0xb50d('0xea')]][_0xb50d('0xba')]])){this[_0xb50d('0xf1')][this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]][_0xb50d('0xba')]]=[];}this['queueBooked'][this[_0xb50d('0x21')][_0xd0f62d['actionid']][_0xb50d('0xba')]][_0xb50d('0xf2')](_[_0xb50d('0xf3')](_[_0xb50d('0x71')](this[_0xb50d('0x21')][_0xd0f62d[_0xb50d('0xea')]],[_0xb50d('0xf4'),_0xb50d('0xef')]),{'status':_0xd0f62d[_0xb50d('0x85')],'paused':_0xd0f62d[_0xb50d('0xee')]}));}}}};Dialer['prototype'][_0xb50d('0x38')]=function(_0x4e1795){if(!this['actions'][_0x4e1795['actionid']]){return;}var _0x22a42c=this;var _0x474e09=this['voiceQueues'][this[_0xb50d('0x21')][_0x4e1795['actionid']][_0xb50d('0xba')]];var _0x55210e=_0x474e09[_0xb50d('0xeb')]||_0xb50d('0xec');if(_0x55210e===_0xb50d('0xf5')){if(this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]]&&this['actions'][_0x4e1795['actionid']]['stateinterface']){this[_0xb50d('0x1a')]['run'](this[_0xb50d('0x21')][_0x4e1795['actionid']][_0xb50d('0xf4')],this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xef')])[_0xb50d('0x9e')](function(_0x478192){logger[_0xb50d('0x64')](_0xb50d('0xf6'),util[_0xb50d('0x41')](_0x478192,{'showHidden':![],'depth':null}));})[_0xb50d('0xf7')](function(){_0x22a42c[_0xb50d('0xc8')](_0x22a42c[_0xb50d('0x1b')][_0x22a42c['actions'][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xba')]]);_0x22a42c['agents'][_0x22a42c[_0xb50d('0x21')][_0x4e1795['actionid']][_0xb50d('0xef')]]['locked']=![];delete _0x22a42c[_0xb50d('0x21')][_0x4e1795['actionid']];unlockQueueStatus(_0x474e09);});}else{this[_0xb50d('0xc8')](this[_0xb50d('0x1b')][this['actions'][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xba')]]);hopperUtils[_0xb50d('0xd3')]({'active':![],'ContactId':this[_0xb50d('0x21')][_0x4e1795['actionid']][_0xb50d('0xd7')],'ListId':this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]]['ListId'],'VoiceQueueId':this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xd9')]||undefined,'CampaignId':this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0xf8')));delete this['actions'][_0x4e1795[_0xb50d('0xea')]];unlockQueueStatus(_0x474e09);}}else if(_0x55210e===_0xb50d('0xec')){var _0x1d74d3;if(this[_0xb50d('0x21')][_0x4e1795['actionid']]&&!_['isEmpty'](this[_0xb50d('0xf1')][this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xba')]])){if(this[_0xb50d('0x26')][_0x22a42c['actions'][_0x4e1795['actionid']][_0xb50d('0xba')]]){this[_0xb50d('0x26')][_0x22a42c[_0xb50d('0x21')][_0x4e1795['actionid']][_0xb50d('0xba')]]=this[_0xb50d('0x26')][this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xba')]]?this['queueBookedRR'][this['actions'][_0x4e1795['actionid']]['queue']]:this[_0xb50d('0xf1')][this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xba')]]?this[_0xb50d('0xf1')][this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xba')]]['_rr']||0x0:0x0;}this[_0xb50d('0xf1')][this[_0xb50d('0x21')][_0x4e1795[_0xb50d('0xea')]]['queue']][_0xb50d('0xf9')]=this[_0xb50d('0x26')][this['actions'][_0x4e1795[_0xb50d('0xea')]][_0xb50d('0xba')]];for(var _0x15673d=0x0;_0x15673d=_0x581e63[_0xb50d('0x118')]){_0x3a9ecc[_0xb50d('0x119')](_0x5081ce,_0x541776,_0x303257,_0xb50d('0x11a'));}else{if(_0x5081ce[_0xb50d('0x116')]>=_0x581e63[_0xb50d('0x11b')]){_0x3a9ecc[_0xb50d('0x11c')](_0x5081ce,_0x541776,_0x303257,_0xb50d('0x11d'));}else{hopperUtils[_0xb50d('0xd3')]({'active':![],'countmachineretry':_0x5081ce[_0xb50d('0x116')],'scheduledat':moment()['add'](_0x581e63[_0xb50d('0x11e')],_0xb50d('0xd6'))[_0xb50d('0x42')](_0xb50d('0xbf')),'ContactId':_0x5081ce[_0xb50d('0xd7')],'ListId':_0x5081ce[_0xb50d('0xd8')],'VoiceQueueId':_0x5081ce[_0xb50d('0xd9')]||undefined,'CampaignId':_0x5081ce[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch('[rescheduleContact][Machine]'));_0x541776({'reschedule':0x1});}}});}if(_0x50ce37[_0xb50d('0x3e')]===_0xb50d('0xbc')&&this[_0xb50d('0x1c')][_0x50ce37['queue']][_0xb50d('0x108')]&&_0x407566[_0xb50d('0x111')]===_0xb50d('0x109')){delete this[_0xb50d('0xbb')][_0x407566['uniqueid']];this['updateOriginated'](this[_0xb50d('0x1c')][_0x50ce37[_0xb50d('0xba')]]);_0x3717cc=new Hangup(_0x50ce37,_0x407566);_0x3717cc[_0xb50d('0x6c')]=0x12;_0x3717cc[_0xb50d('0x6d')]=_0xb50d('0x10b');_0x3717cc[_0xb50d('0x11f')]=_0xb50d('0x120');ami[_0xb50d('0x3d')](_0xb50d('0x10c'),ut[_0xb50d('0x10d')](_0x3717cc,_0xb50d('0x10e')));this['saveInDb'](_0x3717cc,_0xb50d('0x121'),'[syncHangupInAMDIvr]');}if(_0x50ce37['type']===_0xb50d('0xbc')&&this[_0xb50d('0x1c')][_0x50ce37[_0xb50d('0xba')]]['dialAMDActive']&&_0x407566[_0xb50d('0x111')]===_0xb50d('0x122')){return new Promise(function(_0x493ef5,_0x14a07d){delete _0x3a9ecc[_0xb50d('0xbb')][_0x407566['uniqueid']];_0x3a9ecc[_0xb50d('0xc8')](_0x3a9ecc[_0xb50d('0x1c')][_0x50ce37[_0xb50d('0xba')]]);_0x3a9ecc[_0xb50d('0x1c')][_0x50ce37[_0xb50d('0xba')]]['outboundAnswerCallsDay']+=0x1;_0x3a9ecc[_0xb50d('0x1c')][_0x50ce37[_0xb50d('0xba')]][_0xb50d('0x10a')]+=0x1;var _0x1a5d87=_0x3a9ecc[_0xb50d('0x1c')][_0x50ce37[_0xb50d('0xba')]];var _0x1dde59=new Hangup(_0x50ce37,_0x407566);_0x1dde59[_0xb50d('0x6c')]=0x13;_0x1dde59[_0xb50d('0x6d')]=_0xb50d('0x123');_0x1dde59[_0xb50d('0x11f')]=_0xb50d('0x120');_0x1dde59[_0xb50d('0x116')]+=0x1;_0x1dde59[_0xb50d('0xcf')]+=0x1;_0x1dde59[_0xb50d('0x10e')]=!![];ami[_0xb50d('0x3d')](_0xb50d('0x10c'),ut[_0xb50d('0x10d')](_0x1dde59,_0xb50d('0x10e')));hopperUtils['createHistory'](_0x1dde59)[_0xb50d('0x9e')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1dde59['countbusyretry']+_0x1dde59[_0xb50d('0x114')]+_0x1dde59[_0xb50d('0x124')]+_0x1dde59[_0xb50d('0x115')]+_0x1dde59[_0xb50d('0xce')]+_0x1dde59[_0xb50d('0xe4')]+_0x1dde59['countmachineretry']+_0x1dde59['countagentrejectretry']>=_0x1a5d87[_0xb50d('0x118')]){_0x3a9ecc[_0xb50d('0x119')](_0x1dde59,_0x493ef5,_0x14a07d,_0xb50d('0x11a'));}else{if(_0x1dde59['countmachineretry']>=_0x1a5d87[_0xb50d('0x11b')]){_0x3a9ecc[_0xb50d('0x11c')](_0x1dde59,_0x493ef5,_0x14a07d,_0xb50d('0x11d'));}else{hopperUtils[_0xb50d('0xd3')]({'active':![],'countmachineretry':_0x1dde59[_0xb50d('0x116')],'scheduledat':moment()[_0xb50d('0xd4')](_0x1a5d87[_0xb50d('0x11e')],_0xb50d('0xd6'))[_0xb50d('0x42')](_0xb50d('0xbf')),'ContactId':_0x1dde59[_0xb50d('0xd7')],'ListId':_0x1dde59['ListId'],'VoiceQueueId':_0x1dde59[_0xb50d('0xd9')]||undefined,'CampaignId':_0x1dde59[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x125')));_0x493ef5({'reschedule':0x1});}}});}}};Dialer[_0xb50d('0x81')][_0xb50d('0x32')]=function(_0x38ae74){var _0x58dc65=this[_0xb50d('0xbb')][_0x38ae74[_0xb50d('0xbd')]];var _0x2f8617;if(_0x58dc65&&_0x58dc65[_0xb50d('0x3e')]===_0xb50d('0xbc')){delete this[_0xb50d('0xbb')][_0x38ae74[_0xb50d('0xbd')]];this['updateOriginated'](this['campaigns'][_0x58dc65[_0xb50d('0xba')]]);this['campaigns'][_0x58dc65[_0xb50d('0xba')]][_0xb50d('0x126')]+=0x1;_0x2f8617=new Hangup(_0x58dc65,_0x38ae74);hopperUtils['createHistory'](_0x2f8617)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x127')));hopperUtils[_0xb50d('0x128')](_0x2f8617)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x129')));}if(_0x58dc65&&_0x58dc65[_0xb50d('0x3e')]!==_0xb50d('0xbc')&&isNotNull(this[_0xb50d('0x1b')][_0x58dc65[_0xb50d('0xba')]]['dialQueueProject'])){delete this['uniqueId'][_0x38ae74[_0xb50d('0xbd')]];this[_0xb50d('0xc8')](this['voiceQueues'][_0x58dc65[_0xb50d('0xba')]]);this[_0xb50d('0x1b')][_0x58dc65[_0xb50d('0xba')]]['outboundAnswerCallsDay']+=0x1;this[_0xb50d('0x1b')][_0x58dc65[_0xb50d('0xba')]][_0xb50d('0x10a')]+=0x1;_0x2f8617=new Hangup(_0x58dc65,_0x38ae74);_0x2f8617[_0xb50d('0x6c')]=0x10;_0x2f8617['statedesc']=_0xb50d('0x12a');_0x2f8617[_0xb50d('0x11f')]=_0xb50d('0x12b');hopperUtils[_0xb50d('0xc6')](_0x2f8617)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x127')));hopperUtils[_0xb50d('0x128')](_0x2f8617)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x129')));}if(_0x58dc65&&_0x58dc65['type']!==_0xb50d('0xbc')&&!isNotNull(this['voiceQueues'][_0x58dc65[_0xb50d('0xba')]][_0xb50d('0x12c')])){delete this[_0xb50d('0xbb')][_0x38ae74[_0xb50d('0xbd')]];this[_0xb50d('0xc8')](this['voiceQueues'][_0x58dc65[_0xb50d('0xba')]]);this[_0xb50d('0x1b')][_0x58dc65[_0xb50d('0xba')]][_0xb50d('0x12d')]+=0x1;_0x2f8617=new Hangup(_0x58dc65,_0x38ae74);_0x2f8617['state']=0xc;_0x2f8617['statedesc']=_0x38ae74[_0xb50d('0x12e')];_0x2f8617['membername']='Unknow';hopperUtils['createHistory'](_0x2f8617)[_0xb50d('0x9e')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xb50d('0x128')](_0x2f8617)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x129')));}};Dialer[_0xb50d('0x81')][_0xb50d('0x9')]=function(_0x17f2c8){var _0x3528a2=this;if(!_0x3528a2['queuesSummary'][_0x17f2c8[_0xb50d('0x5f')]]){_0x3528a2[_0xb50d('0x12f')][_0x17f2c8[_0xb50d('0x5f')]]={'running':![]};}else if(_0x3528a2['queuesSummary'][_0x17f2c8[_0xb50d('0x5f')]][_0xb50d('0x130')]===!![]){return;}else if(_0x3528a2[_0xb50d('0x12f')][_0x17f2c8[_0xb50d('0x5f')]][_0xb50d('0x130')]===![]){_0x3528a2[_0xb50d('0x12f')][_0x17f2c8[_0xb50d('0x5f')]][_0xb50d('0x130')]=!![];}var _0x592c6e=_0x3528a2['voiceQueues'][_0x17f2c8[_0xb50d('0x5f')]];var _0x1dec28=_0x592c6e[_0xb50d('0x67')]!==utils[_0xb50d('0x68')][_0xb50d('0x78')];var _0x572d53=utils[_0xb50d('0x131')](_0x592c6e);_0x592c6e['statusMessage']=utils[_0xb50d('0x132')](_0x592c6e,_0x3528a2[_0xb50d('0x1e')]);Promise[_0xb50d('0xa8')]()['then'](function(){if(_0x592c6e[_0xb50d('0x133')]===utils[_0xb50d('0x68')][_0xb50d('0x78')]){if(_0x1dec28){clearPredictiveAttributes(_0x592c6e);_0x17f2c8['startPredictive']=undefined;_0x17f2c8[_0xb50d('0x25')]=undefined;}if(_0x592c6e[_0xb50d('0x133')]===utils[_0xb50d('0x68')][_0xb50d('0x78')]){_0x17f2c8['available']=0x0;_0x17f2c8[_0xb50d('0xee')]=0x0;_0x17f2c8[_0xb50d('0x134')]=0x0;_0x17f2c8[_0xb50d('0x135')]=0x0;_0x17f2c8[_0xb50d('0x136')]=0x0;}}else if(_0x592c6e[_0xb50d('0x133')]===utils[_0xb50d('0x68')][_0xb50d('0x137')]&&!_0x572d53){return _0x3528a2['ifTime'](_0x592c6e,!![])['then'](function(){return _0x3528a2[_0xb50d('0x8f')](_0x592c6e,![]);})[_0xb50d('0x3c')](function(){return _0x3528a2[_0xb50d('0xad')](_0x592c6e);})['catch'](function(_0x21ede4){loggerSyncQueueSummary[_0xb50d('0x5e')](_0xb50d('0x138'),util[_0xb50d('0x41')](_0x21ede4,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x592c6e);});}else{clearPredictiveAttributes(_0x592c6e);}})['then'](function(){var _0x49580d=_0x17f2c8[_0xb50d('0x139')](_0x592c6e);if(_0x49580d||_0x592c6e[_0xb50d('0x13a')]){_0x592c6e[_0xb50d('0x13a')]=![];_0x17f2c8[_0xb50d('0x13b')](_0x592c6e);Object[_0xb50d('0x13c')](_0x592c6e,_0x17f2c8);emitOutboundVoiceQueueSummary(_0x17f2c8);}_0x3528a2[_0xb50d('0x12f')][_0x592c6e['name']][_0xb50d('0x130')]=![];})[_0xb50d('0x9e')](function(_0x4a157d){logger[_0xb50d('0x64')](_0xb50d('0x138'),util['inspect'](_0x4a157d,{'showHidden':![],'depth':null}));_0x3528a2[_0xb50d('0x12f')][_0x592c6e[_0xb50d('0x5f')]]['running']=![];});};Dialer[_0xb50d('0x81')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0xa80b75=_[_0xb50d('0x13d')](this['voiceQueues'],function(_0x316cf5){return _0x316cf5[_0xb50d('0x13e')];});var _0x450fd4=_[_0xb50d('0x13d')](this['agents'],function(_0x4e23fc){return _0x4e23fc['online']&&_0x4e23fc['status']===_0xb50d('0x13f');});if(_0xa80b75['length']>0x0&&_0x450fd4[_0xb50d('0x96')]>0x0){return Promise[_0xb50d('0xa8')]()[_0xb50d('0x3c')](cmHopper['handlePreviewRecallNotifications'](_[_0xb50d('0x140')](_0xa80b75,'id'),previewRecallmeReminderInterval,_[_0xb50d('0x140')](_0x450fd4,'id')))[_0xb50d('0x3c')](function(_0x3cba18){for(var _0x4d4164=0x0;_0x4d4164<_0x3cba18[_0xb50d('0x96')];_0x4d4164++){var _0x5e809e=_0x3cba18[_0x4d4164][_0xb50d('0x141')][_0xb50d('0x5f')];if(_0x5e809e)io['to'](util[_0xb50d('0x42')](_0xb50d('0x142'),_0x5e809e))[_0xb50d('0x3d')]('user:dialPreviewRecallReminder',{'hopper':_0x3cba18[_0x4d4164]});}})[_0xb50d('0x9e')](function(_0x6bc4b9){logger[_0xb50d('0x64')]('checkPreviewRecallReminder',_0x6bc4b9);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xb50d('0x81')][_0xb50d('0x3a')]=function(){var _0x4429eb=this;setInterval(function(){_0x4429eb[_0xb50d('0x143')](_0x4429eb['uniqueId'],'[uniqueid]');_0x4429eb[_0xb50d('0x143')](_0x4429eb[_0xb50d('0x21')],_0xb50d('0x144'));},0x32c8);};Dialer[_0xb50d('0x81')][_0xb50d('0x143')]=function(_0x4dee01,_0x1b48de){var _0x6b8097=this;for(var _0x36109d in _0x4dee01){if(typeof _0x4dee01[_0x36109d]!=='undefined'){this[_0xb50d('0x145')][_0xb50d('0x146')](function(){if(!_[_0xb50d('0xed')](_0x4dee01[_0x36109d])){return ami['Action']({'action':_0xb50d('0x85'),'channel':_0x4dee01[_0x36109d]['channel']})[_0xb50d('0x9e')](function(_0x430851){if(_0x430851['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x4dee01[_0x36109d]&&_0x4dee01[_0x36109d][_0xb50d('0x3e')]!==_0xb50d('0xbc')){_0x6b8097[_0xb50d('0xc8')](_0x6b8097[_0xb50d('0x1b')][_0x4dee01[_0x36109d][_0xb50d('0xba')]]);logger[_0xb50d('0x64')](_0xb50d('0x147'),_0x1b48de,_0x36109d,_0x4dee01[_0x36109d][_0xb50d('0xba')]);delete _0x4dee01[_0x36109d];}if(_0x4dee01[_0x36109d]&&_0x4dee01[_0x36109d][_0xb50d('0x3e')]===_0xb50d('0xbc')){_0x6b8097[_0xb50d('0xc8')](_0x6b8097[_0xb50d('0x1c')][_0x4dee01[_0x36109d][_0xb50d('0xba')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x1b48de,_0x36109d,_0x4dee01[_0x36109d][_0xb50d('0xba')]);delete _0x4dee01[_0x36109d];}},0x2328);}});}});}}};Dialer[_0xb50d('0x81')][_0xb50d('0x148')]=function(_0x8e76f2){return Promise[_0xb50d('0xa8')]()[_0xb50d('0x3c')](voiceQueueRt['getVoiceQueueRtPauses'](_0x8e76f2))[_0xb50d('0x9e')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xb50d('0x81')][_0xb50d('0xc8')]=function(_0x27d63f){if(!_['isUndefined'](_0x27d63f)&&_0x27d63f!==null){if(typeof _0x27d63f[_0xb50d('0x7c')]!==_0xb50d('0x149')){if(_0x27d63f[_0xb50d('0x7c')]>0x0){_0x27d63f['originated']-=0x1;}else{logger['error'](_0xb50d('0x14a'));}}}else{logger[_0xb50d('0x64')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xb50d('0x81')]['loggerHandler']=function(_0x29c75b,_0x413b2a){var _0xd926aa=this;return function(_0x28eb44){_0xd926aa[_0xb50d('0xc8')](_0x413b2a);logger[_0xb50d('0x64')](_0x29c75b,util[_0xb50d('0x41')](_0x28eb44,{'showHidden':![],'depth':null}));};};Dialer[_0xb50d('0x81')][_0xb50d('0x14b')]=function(_0x22f5cd,_0x24a51b,_0x352c70){var _0x13fe5a={'state':0x19,'statedesc':_0xb50d('0x14c')};this[_0xb50d('0xc8')](_0x24a51b);this[_0xb50d('0x10f')](_[_0xb50d('0xf3')](_0x13fe5a,_['pick'](_0x352c70,[_0xb50d('0xd7'),_0xb50d('0xd8'),_0xb50d('0x14d'),'VoiceQueueId',_0xb50d('0xe5')])),_0xb50d('0x14e'),_0xb50d('0x14f'));logger[_0xb50d('0x64')](_0x22f5cd);};Dialer['prototype']['saveInDb']=function(_0x585289,_0x25dc52,_0x5a9286){hopperUtils['createHistory'](_0x585289)[_0xb50d('0x9e')](loggerCatch(_0x25dc52));hopperUtils['moveContactManagedDialer'](_0x585289)[_0xb50d('0x9e')](loggerCatch(_0x5a9286));};Dialer[_0xb50d('0x81')][_0xb50d('0xd2')]=function(_0x506883,_0x3f4512){hopperUtils[_0xb50d('0xc6')](_0x506883)[_0xb50d('0x9e')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x3f4512==0x0){hopperUtils[_0xb50d('0x128')](_0x506883)[_0xb50d('0x9e')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xb50d('0x81')][_0xb50d('0x150')]=function(_0x5502a4){return Promise[_0xb50d('0xa8')]()[_0xb50d('0x3c')](cmHopper['handlePreviewRecallNotifications'](_0x5502a4['id'],previewRecallmeReminderInterval))['then'](function(_0x2a1d31){for(var _0x246954=0x0;_0x246954<_0x2a1d31[_0xb50d('0x96')];_0x246954++){var _0x41ba41=_0x2a1d31[_0x246954][_0xb50d('0x141')]['name'];if(_0x41ba41)io['to'](util['format'](_0xb50d('0x142'),_0x41ba41))[_0xb50d('0x3d')]('user:dialPreviewRecallReminder',{'hopper':_0x2a1d31[_0x246954]});}})[_0xb50d('0x9e')](function(){});};Dialer[_0xb50d('0x81')]['launchHandleIvr']=function(_0x4255bd){var _0x57b452=this;return function(){_0x57b452['handleIvr'](_0x4255bd);};};Dialer[_0xb50d('0x81')][_0xb50d('0x151')]=function(_0x4f1d45,_0x1f8381){var _0x569afe=this;var _0x48b194=uuid['v4']();this[_0xb50d('0x21')][_0x48b194]=new Action(_0x4f1d45,_0x1f8381,_0x48b194);return new Promise(function(_0x223789,_0x308fe6){if(_[_0xb50d('0x52')](_0x4f1d45)&&typeof _0x4f1d45!==_0xb50d('0x152')){return _0x308fe6(msgResponse(_0xb50d('0x153'),_0xb50d('0x90'),_0xb50d('0x154')));}if(_['isUndefined'](_0x1f8381['phone'])||_0x1f8381[_0xb50d('0x155')]===null){return _0x308fe6(msgResponse('originate',_0xb50d('0x90'),'contact\x20is\x20undefine'));}var _0x300e9c={'XMD-CALLERID':_0x569afe[_0xb50d('0x21')][_0x48b194][_0xb50d('0x156')](),'XMD-AGI':_0x4f1d45[_0xb50d('0x12c')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x4f1d45['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x4f1d45[_0xb50d('0xc4')]?util[_0xb50d('0x42')](_0xb50d('0x157'),ipAgi,_0x4f1d45['dialQueueProject2']):_0xb50d('0x158'),'XMD-QUEUE':utils[_0xb50d('0x159')](_0x4f1d45)?util[_0xb50d('0x42')](_0xb50d('0x15a'),_0x4f1d45['name'],_0x4f1d45[_0xb50d('0x15b')]||'',_0x4f1d45[_0xb50d('0xc5')]?'c':'',_0x4f1d45[_0xb50d('0x15c')]||0x3):'NONE','XMD-CONTACTID':_0x1f8381[_0xb50d('0xd7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x569afe[_0xb50d('0x21')][_0x48b194]['getCaller'](),'XMD-AMD':_0x4f1d45['dialAMDActive']?_0xb50d('0x137'):_0xb50d('0x158'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4f1d45[_0xb50d('0x108')]){_0x300e9c['XMD-AMDINITIALSILENCE']=_0x4f1d45['dialAMDInitialSilence']||0x9c4;_0x300e9c[_0xb50d('0x15d')]=_0x4f1d45[_0xb50d('0x15e')]||0x5dc;_0x300e9c[_0xb50d('0x15f')]=_0x4f1d45['dialAMDAfterGreetingSilence']||0x320;_0x300e9c[_0xb50d('0x160')]=_0x4f1d45['dialAMDTotalAnalysisTime']||0x1388;_0x300e9c[_0xb50d('0x161')]=_0x4f1d45[_0xb50d('0x162')]||0x64;_0x300e9c[_0xb50d('0x163')]=_0x4f1d45[_0xb50d('0x164')]||0x32;_0x300e9c[_0xb50d('0x165')]=_0x4f1d45[_0xb50d('0x166')]||0x3;_0x300e9c['XMD-AMDSILENCETHRESHOLD']=_0x4f1d45['dialAMDSilenceThreshold']||0x100;_0x300e9c[_0xb50d('0x167')]=_0x4f1d45['dialAMDMaximumWordLength']||0x1388;}if(utils[_0xb50d('0x159')](_0x4f1d45)){_0x300e9c[_0xb50d('0x168')]=_0x1f8381[_0xb50d('0xd9')];}else{_0x300e9c['XMD-CAMPAIGNID']=_0x1f8381[_0xb50d('0xe5')];}var _0xc1d4c3=utils[_0xb50d('0x169')](_0x1f8381[_0xb50d('0x16a')]);Object[_0xb50d('0x13c')](_0x300e9c,_0xc1d4c3);var _0x2dfd9d=_0x569afe[_0xb50d('0x82')](_0x4f1d45['Trunk'])?utils[_0xb50d('0x16b')](_0x4f1d45['Trunk'][_0xb50d('0x16c')],_0x4f1d45['dialOriginateCallerIdName'],_0x4f1d45['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x4f1d45[_0xb50d('0x16d')],_0x4f1d45[_0xb50d('0x16e')]):_0x4f1d45['dialOriginateCallerIdNumber']):utils[_0xb50d('0x16b')](_[_0xb50d('0xed')](_0x4f1d45['TrunkBackup'])?_0x4f1d45[_0xb50d('0x88')][_0xb50d('0x16c')]:_0x4f1d45[_0xb50d('0x89')][_0xb50d('0x16c')],_0x4f1d45[_0xb50d('0x16f')],_0x4f1d45[_0xb50d('0x16e')]>0x0?utils[_0xb50d('0x170')](_0x4f1d45[_0xb50d('0x16d')],_0x4f1d45['dialRandomLastDigitCallerIdNumber']):_0x4f1d45['dialOriginateCallerIdNumber']);if(_0x2dfd9d){_0x300e9c[_0xb50d('0x171')]=_0x569afe[_0xb50d('0x21')][_0x48b194]['originatecalleridname']=utils[_0xb50d('0x172')](_0x2dfd9d);_0x300e9c[_0xb50d('0x173')]=_0x1f8381['phone'];}_0x4f1d45[_0xb50d('0x174')]=_0x300e9c;return ami[_0xb50d('0x97')]({'actionid':_0x48b194,'action':_0xb50d('0x153'),'channel':_0x569afe['isTrunkReachable'](_0x4f1d45[_0xb50d('0x88')])?util[_0xb50d('0x42')](_0xb50d('0x175'),_0x4f1d45[_0xb50d('0x88')][_0xb50d('0x5f')],isNotNull(_0x4f1d45['dialPrefix'])?_0x4f1d45[_0xb50d('0x176')]['trim']()||'':'',_0x4f1d45['dialCutDigit']>0x0?_0x1f8381[_0xb50d('0x155')]['substring'](_0x4f1d45[_0xb50d('0x177')]):_0x1f8381[_0xb50d('0x155')]):util['format'](_0xb50d('0x175'),_[_0xb50d('0xed')](_0x4f1d45[_0xb50d('0x89')])?_0x4f1d45[_0xb50d('0x88')][_0xb50d('0x5f')]:_0x4f1d45[_0xb50d('0x89')][_0xb50d('0x5f')],isNotNull(_0x4f1d45[_0xb50d('0x176')])?_0x4f1d45['dialPrefix']['trim']()||'':'',_0x4f1d45['dialCutDigit']>0x0?_0x1f8381[_0xb50d('0x155')]['substring'](_0x4f1d45[_0xb50d('0x177')]):_0x1f8381[_0xb50d('0x155')]),'callerid':_0x2dfd9d,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x300e9c,'timeout':(_0x4f1d45[_0xb50d('0x178')]||0x1e)*0x3e8,'async':!![],'channelid':_0x48b194})[_0xb50d('0x3c')](function(_0x1cf01e){return _0x223789(_0x1cf01e);})[_0xb50d('0x9e')](function(_0x320ba0){_0x4f1d45[_0xb50d('0x179')]+=0x1;var _0x1a7c50=new History(_0x569afe[_0xb50d('0x21')][_0x48b194]);logger[_0xb50d('0x64')](util[_0xb50d('0x42')](_0xb50d('0x17a'),JSON[_0xb50d('0x70')](_0x320ba0)));_0x1a7c50[_0xb50d('0x6c')]=0xe;_0x1a7c50[_0xb50d('0x6d')]='OriginateError';_0x1a7c50['starttime']=moment()[_0xb50d('0x42')](_0xb50d('0xbf'));_0x1a7c50[_0xb50d('0xe7')]=_0x1a7c50['starttime'];hopperUtils[_0xb50d('0xc6')](_0x1a7c50)['catch'](loggerCatch(_0xb50d('0x17b')));_0x569afe['moveContactManagedDialer'](_0x1a7c50)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x17b')))['finally'](function(){delete _0x569afe[_0xb50d('0x21')][_0x48b194];return _0x308fe6(msgResponse(_0xb50d('0x153'),_0xb50d('0xb9'),_0xb50d('0x17c')));});});});};Dialer[_0xb50d('0x81')][_0xb50d('0x17d')]=function(_0x1ad833,_0x19b5f6,_0x27afee){var _0x3a7be2=new History(_0x19b5f6);if(_0x3a7be2[_0xb50d('0x113')]+_0x3a7be2['countcongestionretry']+_0x3a7be2[_0xb50d('0x124')]+_0x3a7be2[_0xb50d('0x115')]+_0x3a7be2['countdropretry']+_0x3a7be2[_0xb50d('0xe4')]+_0x3a7be2['countmachineretry']+_0x3a7be2[_0xb50d('0x117')]>=_0x27afee[_0xb50d('0x118')]-0x1){return!![];}switch(_0x1ad833){case 0x3:if(_0x3a7be2['countnoanswerretry']>=_0x27afee['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xb50d('0xd3')]({'active':![],'countnoanswerretry':_0x3a7be2[_0xb50d('0x124')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee[_0xb50d('0x17e')],_0xb50d('0xd6'))[_0xb50d('0x42')](_0xb50d('0xbf')),'ContactId':_0x3a7be2['ContactId'],'ListId':_0x3a7be2[_0xb50d('0xd8')],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x3a7be2[_0xb50d('0x113')]>=_0x27afee[_0xb50d('0x17f')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x3a7be2[_0xb50d('0x113')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee[_0xb50d('0x180')],_0xb50d('0xd6'))[_0xb50d('0x42')](_0xb50d('0xbf')),'ContactId':_0x3a7be2[_0xb50d('0xd7')],'ListId':_0x3a7be2['ListId'],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x181')));break;case 0x8:if(_0x3a7be2[_0xb50d('0x114')]>=_0x27afee['dialCongestionMaxRetry']-0x1){return!![];}hopperUtils[_0xb50d('0xd3')]({'active':![],'countcongestionretry':_0x3a7be2[_0xb50d('0x114')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee['dialCongestionRetryFrequency'],'minutes')[_0xb50d('0x42')](_0xb50d('0xbf')),'ContactId':_0x3a7be2[_0xb50d('0xd7')],'ListId':_0x3a7be2['ListId'],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x182')));break;case 0x0:if(_0x3a7be2['countnosuchnumberretry']>=_0x27afee[_0xb50d('0x183')]-0x1){return!![];}else{hopperUtils[_0xb50d('0xd3')]({'active':![],'countnosuchnumberretry':_0x3a7be2[_0xb50d('0x115')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee['dialNoSuchNumberRetryFrequency'],_0xb50d('0xd6'))[_0xb50d('0x42')](_0xb50d('0xbf')),'ContactId':_0x3a7be2[_0xb50d('0xd7')],'ListId':_0x3a7be2[_0xb50d('0xd8')],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2['CampaignId']||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x184')));}break;case 0xa:if(_0x3a7be2['countdropretry']>=_0x27afee['dialDropMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x3a7be2[_0xb50d('0xce')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee[_0xb50d('0xd5')],'minutes')[_0xb50d('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3a7be2['ContactId'],'ListId':_0x3a7be2[_0xb50d('0xd8')],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x3a7be2[_0xb50d('0xe4')]>=_0x27afee['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils[_0xb50d('0xd3')]({'active':![],'countabandonedretry':_0x3a7be2[_0xb50d('0xe4')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee[_0xb50d('0x185')],_0xb50d('0xd6'))[_0xb50d('0x42')](_0xb50d('0xbf')),'ContactId':_0x3a7be2['ContactId'],'ListId':_0x3a7be2['ListId'],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x186')));break;case 0x13:if(_0x3a7be2[_0xb50d('0x116')]>=_0x27afee['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3a7be2[_0xb50d('0x116')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee[_0xb50d('0x11e')],_0xb50d('0xd6'))[_0xb50d('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3a7be2[_0xb50d('0xd7')],'ListId':_0x3a7be2['ListId'],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x125')));break;case 0x14:if(_0x3a7be2[_0xb50d('0x117')]>=_0x27afee[_0xb50d('0x187')]-0x1){return!![];}hopperUtils[_0xb50d('0xd3')]({'active':![],'countagentrejectretry':_0x3a7be2[_0xb50d('0x117')]+=0x1,'scheduledat':moment()[_0xb50d('0xd4')](_0x27afee[_0xb50d('0x188')],_0xb50d('0xd6'))['format'](_0xb50d('0xbf')),'ContactId':_0x3a7be2[_0xb50d('0xd7')],'ListId':_0x3a7be2[_0xb50d('0xd8')],'VoiceQueueId':_0x3a7be2[_0xb50d('0xd9')]||undefined,'CampaignId':_0x3a7be2[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xb50d('0x81')]['callProgressDetecting']=function(_0x2feea1,_0x23230d,_0x4763f4){var _0x29d450=this;var _0x254956=new History(_0x2feea1);var _0x14fb59=![];var _0x3fe44;var _0x29eb13;return new Promise(function(_0xbc4e3b,_0x54071e){if(_['isUndefined'](_0x23230d)&&typeof _0x23230d!=='object'){return _0x54071e(msgResponse('[callProgressDetecting]',_0xb50d('0x90'),'entity\x20is\x20undefine'));}if(_[_0xb50d('0x52')](_0x4763f4)&&typeof _0x4763f4!==_0xb50d('0x152')){return _0x54071e(msgResponse('[callProgressDetecting]',_0xb50d('0x90'),'evt\x20is\x20undefine'));}hopperUtils[_0xb50d('0xd0')](_0x254956,_0x4763f4[_0xb50d('0xc1')],_0x23230d)['then'](function(_0x21cf7c){if(_0x21cf7c[_0xb50d('0xe3')]==0x1)_0x14fb59=!![];switch(_0x4763f4[_0xb50d('0xc1')]){case'0':_0x23230d[_0xb50d('0x189')]+=0x1;_0x254956[_0xb50d('0x6c')]=0x0;_0x254956[_0xb50d('0x6d')]=_0xb50d('0x18a');_0x254956[_0xb50d('0x115')]+=0x1;_0x254956['countglobal']+=0x1;ami[_0xb50d('0x3d')]('custom:agentnosuchnumber',ut['buildObj'](_0x2feea1,'nosuchnumber'));_0x3fe44=_0x23230d['dialNoSuchNumberRetryFrequency'];_0x29eb13=_0x23230d[_0xb50d('0xe1')];hopperUtils[_0xb50d('0xc6')](_0x254956)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x112')));if(_0x29d450['checkRetriveMax'](0x0,_0x2feea1,_0x23230d)&&!_0x14fb59){if(_0x254956[_0xb50d('0x115')]>=_0x23230d[_0xb50d('0x183')]){_0x29d450[_0xb50d('0x11c')](_0x254956,_0xbc4e3b,_0x54071e,_0xb50d('0x18b'));}else{_0x29d450[_0xb50d('0x119')](_0x254956,_0xbc4e3b,_0x54071e,_0xb50d('0x18b'));}}break;case'3':_0x23230d[_0xb50d('0x18c')]+=0x1;_0x254956[_0xb50d('0x6c')]=0x3;_0x254956['statedesc']=_0xb50d('0x18d');_0x254956['countnoanswerretry']+=0x1;_0x254956[_0xb50d('0xcf')]+=0x1;var _0x3efdb8=ut[_0xb50d('0x18e')](_0x2feea1,_0x23230d);ami[_0xb50d('0x3d')](_0xb50d('0x18f'),_0x3efdb8);_0x3fe44=_0x23230d[_0xb50d('0x17e')];_0x29eb13=_0x23230d[_0xb50d('0xe1')];hopperUtils[_0xb50d('0xc6')](_0x254956)[_0xb50d('0x9e')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x29d450['checkRetriveMax'](0x3,_0x2feea1,_0x23230d)&&!_0x14fb59){if(_0x254956[_0xb50d('0x124')]>=_0x23230d['dialNoAnswerMaxRetry']){_0x29d450[_0xb50d('0x11c')](_0x254956,_0xbc4e3b,_0x54071e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x29d450[_0xb50d('0x119')](_0x254956,_0xbc4e3b,_0x54071e,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x23230d[_0xb50d('0x190')]+=0x1;_0x254956[_0xb50d('0x6c')]=0x5;_0x254956[_0xb50d('0x6d')]=_0xb50d('0x191');_0x254956['countbusyretry']+=0x1;_0x254956[_0xb50d('0xcf')]+=0x1;ami[_0xb50d('0x3d')](_0xb50d('0x192'),ut[_0xb50d('0x10d')](_0x2feea1,_0xb50d('0x193')));_0x3fe44=_0x23230d[_0xb50d('0x180')];_0x29eb13=_0x23230d[_0xb50d('0xe1')];hopperUtils[_0xb50d('0xc6')](_0x254956)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x29d450['checkRetriveMax'](0x5,_0x2feea1,_0x23230d)&&!_0x14fb59){if(_0x254956[_0xb50d('0x113')]>=_0x23230d[_0xb50d('0x17f')]){_0x29d450[_0xb50d('0x11c')](_0x254956,_0xbc4e3b,_0x54071e,_0xb50d('0x194'));}else{_0x29d450[_0xb50d('0x119')](_0x254956,_0xbc4e3b,_0x54071e,_0xb50d('0x194'));}}break;case'8':_0x23230d[_0xb50d('0x195')]+=0x1;_0x254956[_0xb50d('0x6c')]=0x8;_0x254956[_0xb50d('0x6d')]=_0xb50d('0x196');_0x254956[_0xb50d('0x114')]+=0x1;_0x254956['countglobal']+=0x1;_0x3fe44=_0x23230d[_0xb50d('0x197')];_0x29eb13=_0x23230d[_0xb50d('0xe1')];ami[_0xb50d('0x3d')](_0xb50d('0x198'),ut[_0xb50d('0x10d')](_0x2feea1,_0xb50d('0x199')));hopperUtils[_0xb50d('0xc6')](_0x254956)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x19a')));if(_0x29d450[_0xb50d('0x17d')](0x8,_0x2feea1,_0x23230d)&&!_0x14fb59){if(_0x254956[_0xb50d('0x114')]>=_0x23230d[_0xb50d('0x19b')]){_0x29d450[_0xb50d('0x11c')](_0x254956,_0xbc4e3b,_0x54071e,_0xb50d('0x19c'));}else{_0x29d450['stateGlobal'](_0x254956,_0xbc4e3b,_0x54071e,'reason\x208\x20congestion');}}break;case'11':_0x23230d[_0xb50d('0x19d')]+=0x1;_0x254956['state']=0xb;_0x254956[_0xb50d('0x6d')]='Abandoned';_0x254956[_0xb50d('0xe4')]+=0x1;_0x254956['countglobal']+=0x1;_0x3fe44=_0x23230d[_0xb50d('0x185')];_0x29eb13=_0x23230d[_0xb50d('0xe1')];hopperUtils[_0xb50d('0xc6')](_0x254956)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0xe8')));if(_0x29d450[_0xb50d('0x17d')](0xb,_0x2feea1,_0x23230d)&&!_0x14fb59){if(_0x254956[_0xb50d('0xe4')]>=_0x23230d[_0xb50d('0xe2')]){_0x29d450[_0xb50d('0x11c')](_0x254956,_0xbc4e3b,_0x54071e,_0xb50d('0x19e'));}else{_0x29d450[_0xb50d('0x119')](_0x254956,_0xbc4e3b,_0x54071e,_0xb50d('0x19e'));}}break;case'20':_0x23230d[_0xb50d('0x19f')]+=0x1;_0x254956[_0xb50d('0x6c')]=0x14;_0x254956[_0xb50d('0x6d')]=_0xb50d('0x1a0');_0x254956[_0xb50d('0x117')]+=0x1;_0x254956[_0xb50d('0xcf')]+=0x1;_0x3fe44=_0x23230d['dialAgentRejectRetryFrequency'];_0x29eb13=_0x23230d['callAdditionalPhoneAfterMin'];ami[_0xb50d('0x3d')]('custom:agentreject',ut['buildObj'](_0x2feea1,_0xb50d('0x1a1')));hopperUtils[_0xb50d('0xc6')](_0x254956)[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x1a2')));if(_0x29d450[_0xb50d('0x17d')](0x14,_0x2feea1,_0x23230d)&&!_0x14fb59){if(_0x254956['countagentrejectretry']>=_0x23230d['dialAgentRejectMaxRetry']){_0x29d450[_0xb50d('0x11c')](_0x254956,_0xbc4e3b,_0x54071e,'reason\x2020\x20agentreject');}else{_0x29d450[_0xb50d('0x119')](_0x254956,_0xbc4e3b,_0x54071e,'reason\x2020\x20agentreject');}}break;default:_0x23230d[_0xb50d('0x12d')]+=0x1;_0x254956[_0xb50d('0x6c')]=0xc;_0x254956[_0xb50d('0x6d')]=_0x4763f4['reason'];_0x3fe44=_0x23230d[_0xb50d('0x188')];_0x29eb13=_0x23230d['callAdditionalPhoneAfterMin'];hopperUtils[_0xb50d('0xc6')](_0x254956)['catch'](loggerCatch(_0xb50d('0x1a3')));if(_0x29d450[_0xb50d('0x17d')](_0x4763f4[_0xb50d('0xc1')],_0x2feea1,_0x23230d)&&!_0x14fb59){if(_0x254956[_0xb50d('0x113')]+_0x254956[_0xb50d('0x114')]+_0x254956[_0xb50d('0x124')]+_0x254956['countnosuchnumberretry']+_0x254956[_0xb50d('0xce')]+_0x254956[_0xb50d('0xe4')]+_0x254956[_0xb50d('0x116')]+_0x254956[_0xb50d('0x117')]>=_0x23230d['dialGlobalMaxRetry']){_0x29d450[_0xb50d('0x119')](_0x254956,_0xbc4e3b,_0x54071e,_0x4763f4['reason']);}else{_0x29d450[_0xb50d('0x11c')](_0x254956,_0xbc4e3b,_0x54071e,_0x4763f4[_0xb50d('0xc1')]);}}}})[_0xb50d('0x3c')](function(){if(_0x14fb59){hopperUtils['swapAdditionalPhones'](_0x254956,_0x3fe44,_0x29eb13)[_0xb50d('0x3c')](function(){return _0xbc4e3b(0x1);});}});});};Dialer[_0xb50d('0x81')][_0xb50d('0x119')]=function(_0x5da79e,_0x560665,_0x53429c,_0x10ead4){var _0x242d5b=new Final(_0x5da79e);_0x242d5b['state']=0xf;_0x242d5b['statedesc']=_0xb50d('0x1a4');this[_0xb50d('0x11c')](_0x242d5b,_0x560665,_0x53429c,_0x10ead4);};Dialer[_0xb50d('0x81')][_0xb50d('0x11c')]=function(_0x178e60,_0x38286a,_0x1d22af,_0x145cd5){hopperUtils[_0xb50d('0x128')](_0x178e60)[_0xb50d('0x3c')](function(){return _0x38286a(msgResponse(_0xb50d('0x1a5'),'Success',_0x145cd5));})[_0xb50d('0x9e')](function(){return _0x1d22af(msgResponse(_0xb50d('0x1a6'),'Failure',_0xb50d('0x1a7')));});};Dialer[_0xb50d('0x81')][_0xb50d('0xaf')]=function(_0x5d08a2){var _0x2a827d=_0x5d08a2['dialPredictiveOptimizationPercentage']/0x64;var _0xcbe4bf=_0x5d08a2[_0xb50d('0xcb')]/(_0x5d08a2[_0xb50d('0xcb')]+_0x5d08a2['outboundAnswerCallsDay']);var _0x463ca9=Math[_0xb50d('0x1a8')](_0x5d08a2[_0xb50d('0x1a9')]*(_0x5d08a2[_0xb50d('0x1aa')]/0x64));var _0x5bd9a5=Math[_0xb50d('0x1a8')](_0x5d08a2[_0xb50d('0x1a9')]*(_0x5d08a2[_0xb50d('0x1ab')]/0x64));var _0x305648=_0x5d08a2[_0xb50d('0x1ac')]+_0x5d08a2[_0xb50d('0x135')];var _0x4df61e=Math[_0xb50d('0x1ad')](_0x5d08a2[_0xb50d('0x56')]*_0x5d08a2[_0xb50d('0x5a')]*_0x5d08a2[_0xb50d('0x1ae')]*_0x5d08a2[_0xb50d('0x1af')]);if(_[_0xb50d('0x52')](_0x5d08a2[_0xb50d('0x25')])){if(!_[_0xb50d('0x52')](_0x5d08a2[_0xb50d('0x24')])){_0x5d08a2[_0xb50d('0x24')]=undefined;loggerPredictive[_0xb50d('0x64')](_0xb50d('0x1b0'),_0xb50d('0x1b1'));}if(!_[_0xb50d('0x52')](_0x5d08a2['handlePredictive'])){loggerPredictive['error'](_0xb50d('0x1b0'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5d08a2[_0xb50d('0x62')]);_0x5d08a2[_0xb50d('0x62')]=undefined;}_0x5d08a2[_0xb50d('0x25')]=moment()['format'](_0xb50d('0xbf'));loggerPredictive[_0xb50d('0x45')](_0x5d08a2[_0xb50d('0x5f')],'collection\x20data\x20in\x20progressive\x20at',_0x5d08a2[_0xb50d('0x25')]);this[_0xb50d('0xb1')](_0x5d08a2,0x1);}else if(ifInterval(_0x5d08a2[_0xb50d('0x1b2')],_0x5d08a2['startProgressive'])){this['handlePower'](_0x5d08a2,0x1);loggerPredictiveCalls[_0xb50d('0x45')](_0xb50d('0x1b3'),_0x5d08a2[_0xb50d('0x25')],_0x5d08a2[_0xb50d('0x5f')]);_0x5d08a2[_0xb50d('0x56')]=0x0;_0x5d08a2['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x2a827d<_0xcbe4bf&&_0x5d08a2[_0xb50d('0x1b4')]==='dropRate'){clearPredictiveAttributes(_0x5d08a2);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x1b5'),_0xb50d('0x1b6'),_0xcbe4bf,_0xb50d('0x25'),_0x5d08a2[_0xb50d('0x5f')]);}else if(_0x4df61e<_0x5d08a2[_0xb50d('0xcc')]&&_0x5d08a2['dialPredictiveOptimization']===_0xb50d('0x1b7')){clearPredictiveAttributes(_0x5d08a2);loggerPredictive[_0xb50d('0x45')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xb50d('0x1b8'),_0x4df61e,_0xb50d('0x1b9'),_0x5d08a2[_0xb50d('0xcc')],'startProgressive',_0x5d08a2[_0xb50d('0x5f')]);}else if(!ifInterval(_0x5d08a2[_0xb50d('0x1b2')],_0x5d08a2[_0xb50d('0x25')])&&_[_0xb50d('0x52')](_0x5d08a2[_0xb50d('0x24')])&&!_[_0xb50d('0x52')](_0x5d08a2[_0xb50d('0x25')])){_0x5d08a2[_0xb50d('0x24')]=moment()[_0xb50d('0x42')](_0xb50d('0xbf'));loggerPredictive[_0xb50d('0x45')](_0x5d08a2['name'],_0xb50d('0x1ba'),_0x5d08a2['startPredictive']);hopperUtils['avgHandleTime'](_0x5d08a2[_0xb50d('0x1b2')])[_0xb50d('0x3c')](this['getDataPredictive'](_0x5d08a2))[_0xb50d('0x3c')](mergeDataErlangB(_0x5d08a2))[_0xb50d('0x3c')](this[_0xb50d('0x1bb')](_0x5d08a2))['catch'](loggerCatchPredictive(_0xb50d('0x1bc'),_0x5d08a2));}else if(!ifInterval(_0x5d08a2[_0xb50d('0x1b2')],_0x5d08a2[_0xb50d('0x24')])){_0x5d08a2[_0xb50d('0xcc')]=0x0;_0x5d08a2['startPredictive']=moment()['format'](_0xb50d('0xbf'));loggerPredictive[_0xb50d('0x45')](_0x5d08a2[_0xb50d('0x5f')],_0xb50d('0x1bd'),_0x5d08a2[_0xb50d('0x24')]);clearInterval(_0x5d08a2[_0xb50d('0x62')]);_0x5d08a2[_0xb50d('0x62')]=undefined;hopperUtils[_0xb50d('0x1be')](_0x5d08a2['dialPredictiveInterval'])[_0xb50d('0x3c')](this[_0xb50d('0x1bf')](_0x5d08a2))['then'](mergeDataErlangB(_0x5d08a2))[_0xb50d('0x3c')](this['startMethodPredictive'](_0x5d08a2))['catch'](loggerCatchPredictive(_0xb50d('0x1c0'),_0x5d08a2));}else if(_0x5d08a2[_0xb50d('0x1a9')]&&_0x305648<_0x5d08a2[_0xb50d('0x1a9')]-_0x5bd9a5){clearPredictiveAttributes(_0x5d08a2);loggerPredictive[_0xb50d('0x45')](_0x5d08a2[_0xb50d('0x5f')],_0xb50d('0x1c1'),_0x305648,_0xb50d('0x1c2'),_0x5d08a2['predictiveIntervalAvailable'],'-',_0x5bd9a5,'=',_0x5d08a2[_0xb50d('0x1a9')]-_0x5bd9a5,')');}else if(_0x5d08a2[_0xb50d('0x1a9')]&&_0x305648>_0x5d08a2[_0xb50d('0x1a9')]+_0x463ca9){clearPredictiveAttributes(_0x5d08a2);loggerPredictive[_0xb50d('0x45')](_0x5d08a2[_0xb50d('0x5f')],_0xb50d('0x1c1'),_0x305648,_0xb50d('0x1c3'),_0x5d08a2['predictiveIntervalAvailable'],'+',_0x463ca9,'=',_0x5d08a2[_0xb50d('0x1a9')]+_0x463ca9,')');}};Dialer[_0xb50d('0x81')][_0xb50d('0x1bf')]=function(_0x53f314){var _0x232719=this;return function(_0x4b4e7a){return new Promise(function(_0x12840b,_0x346fce){_['merge'](_0x53f314,_0x4b4e7a[0x0]);if(checkGetDataPredictive(_0x4b4e7a[0x0])){var _0x10fdef=_0x53f314[_0xb50d('0x1a9')]=_0x53f314[_0xb50d('0x135')]+_0x53f314[_0xb50d('0x1ac')];var _0x285f4f=_0x53f314['dialPredictiveInterval']*0x3c;var _0x4b4d81=_0x4b4e7a[0x0][_0xb50d('0x50')]+_0x4b4e7a[0x0]['predictiveIntervalAvgHoldtime'];var _0x3de10f=(_0x4b4e7a[0x0]['predictiveIntervalAnsweredCalls']+_0x4b4e7a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b4e7a[0x0][_0xb50d('0x4c')])/_0x4b4e7a[0x0][_0xb50d('0x48')];_0x53f314[_0xb50d('0x1ae')]=_0x3de10f>0x0?_0x3de10f:0x1;switch(_0x53f314[_0xb50d('0x1b4')]){case _0xb50d('0x1b7'):var _0x36d9ae=_0x53f314[_0xb50d('0x1c4')]/0x64;return _0x232719[_0xb50d('0x1c5')](_0x10fdef,_0x285f4f,_0x4b4d81,_0x3de10f,_0x36d9ae)[_0xb50d('0x3c')](function(_0x55f10f){return _0x12840b(_0x55f10f);});case _0xb50d('0x1c6'):var _0x500bbf=_0x53f314[_0xb50d('0x1c4')]/0x64;return _0x232719[_0xb50d('0x1c7')](_0x10fdef,_0x285f4f,_0x4b4d81,_0x3de10f,_0x500bbf)[_0xb50d('0x3c')](function(_0x27fafe){return _0x12840b(_0x27fafe);});default:return _0x346fce(msgResponse(_0xb50d('0x1c8'),_0xb50d('0x90'),_0xb50d('0x1c9')));}}else{return _0x346fce(msgResponse(_0xb50d('0x1c8'),_0xb50d('0x90'),_0xb50d('0x1ca')));}});};};Dialer[_0xb50d('0x81')]['getDataPredictiveOld']=function(_0x1ecc53){var _0x1334e0=this;return function(_0x476a35){return new Promise(function(_0x1a96a1,_0xe807c3){_[_0xb50d('0xf3')](_0x1ecc53,_0x476a35[0x0]);if(checkGetDataPredictive(_0x476a35[0x0])){loggerPredictive[_0xb50d('0x45')](JSON[_0xb50d('0x70')](_0x476a35[0x0]));if(_0x1ecc53[_0xb50d('0x1b4')]===_0xb50d('0x1b7')){return _0x1334e0[_0xb50d('0x148')](_0x1ecc53['id'])[_0xb50d('0x3c')](function(_0x382736){var _0x2a78da=_0x1ecc53[_0xb50d('0x1cb')]-_0x382736[0x0][_0xb50d('0x1cc')];var _0xe79b61=_0x1ecc53[_0xb50d('0x1b2')]*0x3c;var _0x2ef181=_0x476a35[0x0]['predictiveIntervalAvgTalktime']+_0x476a35[0x0][_0xb50d('0x4e')];var _0xc15060=(_0x476a35[0x0]['predictiveIntervalAnsweredCalls']+_0x476a35[0x0][_0xb50d('0x1cd')]+_0x476a35[0x0][_0xb50d('0x4c')])/_0x476a35[0x0][_0xb50d('0x48')];var _0x2b2d3b=_0x1ecc53[_0xb50d('0x1c4')]/0x64;_0x1ecc53[_0xb50d('0x1ce')]=_0x382736[0x0]['outboundQueuePauses']||0x0;_0x1ecc53[_0xb50d('0x1ae')]=_0xc15060>0x0?_0xc15060:0x1;return _0x1334e0[_0xb50d('0x1c5')](_0x2a78da,_0xe79b61,_0x2ef181,_0xc15060,_0x2b2d3b);})[_0xb50d('0x3c')](function(_0x1f616b){return _0x1a96a1(_0x1f616b);})[_0xb50d('0x9e')](function(_0x31a4b1){return _0xe807c3(msgResponse('[CatchErlangB]',_0xb50d('0x90'),JSON[_0xb50d('0x70')](_0x31a4b1)));});}if(_0x1ecc53['dialPredictiveOptimization']===_0xb50d('0x1c6')){return _0x1334e0['getVoiceQueueRtPauses'](_0x1ecc53['id'])['then'](function(_0x2e4ae6){var _0x30987b=_0x1ecc53[_0xb50d('0x1cb')]-_0x2e4ae6[0x0][_0xb50d('0x1cc')];var _0x274979=_0x1ecc53[_0xb50d('0x1b2')]*0x3c;var _0x8d5239=_0x476a35[0x0][_0xb50d('0x50')]+_0x476a35[0x0][_0xb50d('0x4e')];var _0x148dd4=(_0x476a35[0x0]['predictiveIntervalAnsweredCalls']+_0x476a35[0x0][_0xb50d('0x1cd')]+_0x476a35[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x476a35[0x0]['predictiveIntervalTotalCalls'];var _0x461b91=_0x1ecc53[_0xb50d('0x1c4')]/0x64;_0x1ecc53['predictiveIntervalPauses']=_0x2e4ae6[0x0][_0xb50d('0x1cc')]||0x0;_0x1ecc53[_0xb50d('0x1ae')]=_0x148dd4>0x0?_0x148dd4:0x1;return _0x1334e0[_0xb50d('0x1c7')](_0x30987b,_0x274979,_0x8d5239,_0x148dd4,_0x461b91);})[_0xb50d('0x3c')](function(_0x47de47){return _0x1a96a1(_0x47de47);})[_0xb50d('0x9e')](function(_0x5bf7f4){return _0xe807c3(msgResponse('[CatchErlangB]',_0xb50d('0x90'),JSON['stringify'](_0x5bf7f4)));});}}else{return _0xe807c3(msgResponse('[getDataPredictive]',_0xb50d('0x90'),_0xb50d('0x1ca')));}});};};Dialer['prototype'][_0xb50d('0x1bb')]=function(_0x3eed4b){var _0x80cda=this;return function(){var _0x4eb057=0x0;var _0x5595c5=Math['floor'](_0x3eed4b[_0xb50d('0x58')]*0x3e8);if(_0x5595c5>0x0){_0x5595c5=_0x5595c5<0x64?0x64:_0x5595c5;loggerPredictive[_0xb50d('0x45')](_0x3eed4b['name'],_0xb50d('0x1cf'),_0x5595c5,_0xb50d('0x1d0'));_0x3eed4b['handlePredictive']=setInterval(function(){_0x80cda[_0xb50d('0x62')](_0x3eed4b);loggerPredictiveCalls[_0xb50d('0x45')](_0xb50d('0x1d1'),_0x4eb057+=0x1);},_0x5595c5);}else{loggerPredictive[_0xb50d('0x45')](_0x3eed4b[_0xb50d('0x5f')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xb50d('0x81')]['checkContactBlack']=function(_0x38f5d6,_0xfac0bd){var _0x28b3d6=this;return function(_0x59b4f0){if(_[_0xb50d('0x76')](_0x59b4f0)){if(_[_0xb50d('0xed')](_0xfac0bd[_0xb50d('0x14d')])||!_0xfac0bd[_0xb50d('0x1d2')]){if(_0x38f5d6[_0xb50d('0xae')]==='booked'){_0x38f5d6['queueStatusComplete']=_[_0xb50d('0x52')](_0x38f5d6[_0xb50d('0x6f')])?!![]:_0x38f5d6[_0xb50d('0x6f')];var _0x376f58=uuid['v4']();_0x28b3d6[_0xb50d('0x21')][_0x376f58]=new Action(_0x38f5d6,_0xfac0bd,_0x376f58);loggerBooked['info'](_0xb50d('0x1d3'),_0x376f58,_0xb50d('0x1d4'),JSON[_0xb50d('0x70')](_0x38f5d6[_0xb50d('0x6f')]),_0xb50d('0x1d5'),_0x38f5d6['name']);if(_0x38f5d6['queueStatusComplete']){_0x38f5d6[_0xb50d('0x6f')]=![];_0x28b3d6[_0xb50d('0xf1')][_0x28b3d6[_0xb50d('0x21')][_0x376f58]['queue']]=[];ami['Action']({'actionid':_0x376f58,'action':'queuestatus','queue':_0x38f5d6[_0xb50d('0x5f')]})[_0xb50d('0x9e')](function(){_0x28b3d6[_0xb50d('0xc8')](_0x38f5d6);hopperUtils[_0xb50d('0xd3')]({'active':![],'ContactId':_0x28b3d6[_0xb50d('0x21')][_0x376f58][_0xb50d('0xd7')],'ListId':_0x28b3d6[_0xb50d('0x21')][_0x376f58][_0xb50d('0xd8')],'VoiceQueueId':_0x28b3d6[_0xb50d('0x21')][_0x376f58][_0xb50d('0xd9')]||undefined,'CampaignId':_0x28b3d6[_0xb50d('0x21')][_0x376f58][_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x1d6')));delete _0x28b3d6[_0xb50d('0x21')][_0x376f58];});}else{loggerBooked[_0xb50d('0x45')](_0xb50d('0x1d7'),JSON[_0xb50d('0x70')](_0x38f5d6['queueStatusComplete']),_0xb50d('0x1d5'),_0x38f5d6[_0xb50d('0x5f')]);_0x28b3d6[_0xb50d('0xc8')](_0x38f5d6);hopperUtils[_0xb50d('0xd3')]({'active':![],'ContactId':_0x28b3d6[_0xb50d('0x21')][_0x376f58]['ContactId'],'ListId':_0x28b3d6[_0xb50d('0x21')][_0x376f58]['ListId'],'VoiceQueueId':_0x28b3d6[_0xb50d('0x21')][_0x376f58][_0xb50d('0xd9')]||undefined,'CampaignId':_0x28b3d6[_0xb50d('0x21')][_0x376f58][_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x1d6')));delete _0x28b3d6[_0xb50d('0x21')][_0x376f58];}}else{return _0x28b3d6[_0xb50d('0x151')](_0x38f5d6,_0xfac0bd);}}else{if(utils['getSeconds'](undefined,_0xfac0bd[_0xb50d('0x1d8')])<_0x38f5d6[_0xb50d('0x1d9')]*0x3c){if(_0xfac0bd['Agent']&&!_0xfac0bd[_0xb50d('0x141')][_0xb50d('0x1da')]){_0x28b3d6[_0xb50d('0x1a')][_0xb50d('0xfc')](_0xfac0bd['id'])[_0xb50d('0xf7')](function(){_0x28b3d6[_0xb50d('0xc8')](_0x38f5d6);});}else{hopperUtils[_0xb50d('0x1db')]({'active':![]},_0xfac0bd['id'],0x1)[_0xb50d('0xf7')](function(){_0x28b3d6['updateOriginated'](_0x38f5d6);});}}else{_0x38f5d6[_0xb50d('0x1dc')]+=0x1;_0x28b3d6[_0xb50d('0xc8')](_0x38f5d6);if(_0x38f5d6[_0xb50d('0x1dd')]){hopperUtils[_0xb50d('0xd3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xfac0bd[_0xb50d('0xd7')],'ListId':_0xfac0bd[_0xb50d('0xd8')],'VoiceQueueId':_0xfac0bd[_0xb50d('0xd9')]||undefined,'CampaignId':_0xfac0bd[_0xb50d('0xe5')]||undefined})[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x1de')));hopperUtils[_0xb50d('0xc6')](createObjHistory(_0x38f5d6,_0xfac0bd,utils[_0xb50d('0x68')][_0xb50d('0x1df')],0x17,_0xb50d('0x1e0')))['catch'](loggerCatch(_0xb50d('0x1e1')));}else{_0x28b3d6['saveInDb'](createObjHistory(_0x38f5d6,_0xfac0bd,utils[_0xb50d('0x68')][_0xb50d('0x1e2')],0x16,_0xb50d('0x1e3')),'[Originate][HistoryRecallClose][historyCatch]',_0xb50d('0x1e4'));}}}}else{_0x38f5d6[_0xb50d('0x1e5')]+=0x1;_0x28b3d6[_0xb50d('0x10f')](createObjHistory(_0x38f5d6,_0xfac0bd,utils[_0xb50d('0x68')][_0xb50d('0x1e6')],0xd,_0xb50d('0x1e7')),_0xb50d('0x1e8'),_0xb50d('0x1e9'));throw _0xb50d('0x1ea');}};};Dialer[_0xb50d('0x81')]['handleIvr']=function(_0x229a7b){var _0x187c3d=this;var _0x324050=_0x229a7b[_0xb50d('0x1eb')]-_0x229a7b[_0xb50d('0x7c')];emitCampaignSummary(_0x229a7b);if(_0x324050>0x0&&_0x229a7b['temp']==0x0){if(_0x324050>this[_0xb50d('0x1f')]){_0x324050=this['maxNumberOriginate'];}_0x229a7b[_0xb50d('0x1ec')]=0x1;hopperUtils[_0xb50d('0x1ed')](_0x229a7b,_0x324050)['then'](function(_0x480462){_0x229a7b[_0xb50d('0x1ec')]=0x0;if(_0x480462){if(!utils[_0xb50d('0x1ee')](_0x480462)){_0x229a7b[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x6a')];logger[_0xb50d('0x45')](_0xb50d('0x1ef')+_0x229a7b[_0xb50d('0x5f')]);}else{_0x229a7b['originated']+=_0x480462[_0xb50d('0x96')];_0x229a7b['message']=utils[_0xb50d('0x68')][_0xb50d('0x1f0')];for(var _0x99e9a1=0x0;_0x99e9a1<_0x480462[_0xb50d('0x96')];_0x99e9a1+=0x1){_0x229a7b[_0xb50d('0x1f1')]+=0x1;if(_['isNil'](_0x480462[_0x99e9a1])||_[_0xb50d('0xed')](_0x480462[_0x99e9a1][_0xb50d('0x16a')])||_['isNil'](_0x480462[_0x99e9a1][_0xb50d('0x155')])){_0x187c3d[_0xb50d('0x14b')]('[actionOriginate]\x20',_0x229a7b,_0x480462[_0x99e9a1]);}else{hopperUtils['checkIsBlackListIvr'](_[_0xb50d('0x71')](_0x480462[_0x99e9a1],[_0xb50d('0xe5'),_0xb50d('0x155')]))['then'](_0x187c3d[_0xb50d('0x1f2')](_0x229a7b,_0x480462[_0x99e9a1]))[_0xb50d('0x9e')](_0x187c3d['loggerHandler'](_0xb50d('0x1f3'),_0x229a7b));}}}}})['catch'](loggerGetContactDialer(_0xb50d('0x1f4'),_0x229a7b,_0x324050));}};Dialer[_0xb50d('0x81')][_0xb50d('0xb1')]=function(_0x3590d9,_0x25c0e3){var _0x1a0be5=this;var _0xb9d693=[];if(_0x25c0e3<0x1||_0x3590d9[_0xb50d('0xae')]===_0xb50d('0x7')){_0x25c0e3=0x1;}var _0x15b241=Math['floor'](_0x3590d9['available']*_0x25c0e3)-_0x3590d9['originated'];if(_0x3590d9['dialLimitQueue']>0x0){var _0x33324=_0x3590d9[_0xb50d('0x1f5')]-_0x3590d9[_0xb50d('0x7c')]-_0x3590d9[_0xb50d('0x135')]-_0x3590d9[_0xb50d('0x136')];if(_0x15b241>_0x33324){_0x15b241=_0x33324;}}if(_0x15b241>0x0&&_0x3590d9[_0xb50d('0x1ec')]==0x0){if(_0x3590d9[_0xb50d('0xae')]==='booked'){_0x15b241=0x1;}if(_0x15b241>this['maxNumberOriginate']){_0x15b241=this[_0xb50d('0x1f')];}for(var _0x17f1f2 in this[_0xb50d('0x1d')]){if(typeof this[_0xb50d('0x1d')][_0x17f1f2]!=='undefined'){if(this['agents'][_0x17f1f2][_0xb50d('0x6c')]===_0xb50d('0x1f6')&&this['agents'][_0x17f1f2][_0xb50d('0x85')]===_0xb50d('0x13f')){_0xb9d693[_0xb50d('0xf2')](this['agents'][_0x17f1f2]['id']);}}}_0x3590d9['temp']=0x1;hopperUtils[_0xb50d('0x1f7')](_0x3590d9,_0xb9d693,_0x15b241)[_0xb50d('0x3c')](function(_0x1dba48){_0x3590d9['temp']=0x0;if(_0x1dba48){if(!utils[_0xb50d('0x1ee')](_0x1dba48)){hopperUtils['countReScheduled'](_0x3590d9)[_0xb50d('0x3c')](sendMessageReschedule(_0x3590d9))[_0xb50d('0x9e')](loggerCatch('[countReScheduled]\x20'));}else{_0x3590d9[_0xb50d('0x7c')]+=_0x1dba48[_0xb50d('0x96')];_0x3590d9[_0xb50d('0x67')]=_0x3590d9[_0xb50d('0xae')]==='booked'?utils[_0xb50d('0x68')][_0xb50d('0x137')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x4b431f=0x0;_0x4b431f<_0x1dba48[_0xb50d('0x96')];_0x4b431f+=0x1){if(_[_0xb50d('0xed')](_0x1dba48[_0x4b431f])||_['isNil'](_0x1dba48[_0x4b431f][_0xb50d('0x16a')])||_[_0xb50d('0xed')](_0x1dba48[_0x4b431f]['phone'])){_0x1a0be5[_0xb50d('0x14b')]('[actionOriginate]\x20',_0x3590d9,_0x1dba48[_0x4b431f]);}else{hopperUtils['checkIsBlackList'](_[_0xb50d('0x71')](_0x1dba48[_0x4b431f],['VoiceQueueId',_0xb50d('0x155')]))['then'](_0x1a0be5['checkContactBlack'](_0x3590d9,_0x1dba48[_0x4b431f]))[_0xb50d('0x9e')](_0x1a0be5[_0xb50d('0x1f8')](_0xb50d('0x1f9'),_0x3590d9));}}}}})[_0xb50d('0x9e')](loggerGetContactDialer(_0xb50d('0x1fa'),_0x3590d9,_0x15b241));}};Dialer[_0xb50d('0x81')][_0xb50d('0x62')]=function(_0x439183){if(_0x439183['dialLimitQueue']>0x0){var _0x34c03b=_0x439183[_0xb50d('0x1f5')]-_0x439183[_0xb50d('0x7c')]-_0x439183['talking'];if(_0x34c03b>0x0&&_0x439183[_0xb50d('0x1ec')]==0x0){this[_0xb50d('0x1fb')](_0x439183);}else{loggerPredictiveCalls[_0xb50d('0x45')](_0xb50d('0x1fc'));}}else{this[_0xb50d('0x1fb')](_0x439183);}};Dialer[_0xb50d('0x81')][_0xb50d('0x1fb')]=function(_0x12a02d){var _0x19740f=this;var _0x5c538a=[];_0x12a02d[_0xb50d('0x7c')]+=0x1;for(var _0x3d480c in this['agents']){if(typeof this[_0xb50d('0x1d')][_0x3d480c]!==_0xb50d('0x149')){if(this['agents'][_0x3d480c][_0xb50d('0x6c')]==='not_inuse'&&this['agents'][_0x3d480c][_0xb50d('0x85')]===_0xb50d('0x13f')){_0x5c538a[_0xb50d('0xf2')](this['agents'][_0x3d480c]['id']);}}}_0x12a02d['temp']=0x1;return this[_0xb50d('0x1f7')](_0x12a02d['id'],_0x5c538a,0x1,_0x12a02d[_0xb50d('0x1fd')],_0x12a02d)[_0xb50d('0x3c')](function(_0x54887b){_0x12a02d[_0xb50d('0x1ec')]=0x1;if(_0x54887b){if(!utils[_0xb50d('0x1ee')](_0x54887b)){utils[_0xb50d('0x65')](_0x12a02d,0x1,0x0);return hopperUtils[_0xb50d('0x1fe')](_0x12a02d)['then'](sendMessageReschedule(_0x12a02d))[_0xb50d('0x9e')](loggerCatch(_0xb50d('0x1ff')));}else{_0x12a02d[_0xb50d('0x67')]=utils[_0xb50d('0x68')][_0xb50d('0x1f0')];if(_['isNil'](_0x54887b[0x0])||_['isNil'](_0x54887b[0x0][_0xb50d('0x16a')])||_[_0xb50d('0xed')](_0x54887b[0x0][_0xb50d('0x155')])){_0x19740f[_0xb50d('0x14b')]('[actionOriginate]\x20',_0x12a02d,_0x54887b[0x0]);}else{return hopperUtils[_0xb50d('0x200')](_['pick'](_0x54887b[0x0],[_0xb50d('0xd9'),_0xb50d('0x155')]))['then'](_0x19740f['checkContactBlack'](_0x12a02d,_0x54887b[0x0]))[_0xb50d('0x9e')](_0x19740f['loggerHandler']('[actionOriginatePredictive]\x20',_0x12a02d));}}}})[_0xb50d('0x9e')](loggerGetContactDialer(_0xb50d('0x201'),_0x12a02d,0x1));};Dialer[_0xb50d('0x81')]['abandonmentRate']=function(_0x265dc5,_0xb22e,_0x1e7bc9,_0x391198,_0x139c7d,_0x5a5b82){loggerPredictive[_0xb50d('0x45')](_0xb50d('0x202'));loggerPredictive[_0xb50d('0x45')](_0xb50d('0x203'),_0x265dc5);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x204'),_0xb22e);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x205'),_0x1e7bc9);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x206'),_0x391198);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x207'),_0x139c7d);loggerPredictive['info'](_0xb50d('0x5c'));return new Promise(function(_0x21af94,_0xd741ca){if(_0x265dc5<=0x0||isNaN(_0x265dc5)){return _0xd741ca(msgResponse(_0xb50d('0x208'),_0xb50d('0xb9'),_0xb50d('0x209')+_0x265dc5));}if(_0x1e7bc9<=0x0||isNaN(_0x1e7bc9)){return _0xd741ca(msgResponse(_0xb50d('0x208'),_0xb50d('0xb9'),_0xb50d('0x20a')+_0x1e7bc9));}if(_0x391198<=0x0||isNaN(_0x391198)){return _0xd741ca(msgResponse(_0xb50d('0x208'),'Error','p\x20=\x20'+_0x391198));}if(_0xb22e<=0x0||isNaN(_0xb22e)){return _0xd741ca(msgResponse(_0xb50d('0x208'),_0xb50d('0xb9'),_0xb50d('0x20b')+_0xb22e));}if(_0x139c7d<=0x0||isNaN(_0x139c7d)){return _0xd741ca(msgResponse(_0xb50d('0x208'),_0xb50d('0xb9'),_0xb50d('0x20c')+_0x139c7d));}_0x5a5b82=_0x5a5b82||0x0;var _0x34ac69=0x1/_0x1e7bc9;var _0x2b5979=0x0;var _0x298889=0x0;var _0x1e27a6=0x0;var _0x570c07=0x0;for(var _0x405bf6=0x0;_0x1e27a6<_0x139c7d;_0x405bf6+=0x1){_0x298889=_0x405bf6/_0xb22e;_0x2b5979=(_0x391198*_0x298889+_0x5a5b82)/_0x34ac69;_0x1e27a6=utils['erlangb'](_0x2b5979,_0x265dc5);_0x570c07=_0x2b5979/_0x265dc5*(0x1-utils['erlangb'](_0x2b5979,_0x265dc5));}return _0x21af94({'erlangCalls':_0x405bf6,'erlangCallToSecond':_0xb22e/_0x405bf6,'erlangAbandonmentRate':_0x1e27a6,'erlangBusyFactor':_0x570c07});});};Dialer['prototype'][_0xb50d('0x1c7')]=function(_0x18640d,_0x4d610f,_0xb1a43d,_0x26923c,_0x216fa8,_0x152b75){loggerPredictive[_0xb50d('0x45')](_0xb50d('0x20d'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x18640d);loggerPredictive[_0xb50d('0x45')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d610f);loggerPredictive[_0xb50d('0x45')]('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',_0xb1a43d);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x26923c);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x20e'),_0x216fa8);loggerPredictive[_0xb50d('0x45')](_0xb50d('0x5c'));return new Promise(function(_0x3a3fb7,_0x1d9a7d){if(_0x18640d<=0x0||isNaN(_0x18640d)){return _0x1d9a7d(msgResponse(_0xb50d('0x20f'),_0xb50d('0xb9'),_0xb50d('0x209')+_0x18640d));}if(_0xb1a43d<=0x0||isNaN(_0xb1a43d)){return _0x1d9a7d(msgResponse(_0xb50d('0x20f'),_0xb50d('0xb9'),_0xb50d('0x20a')+_0xb1a43d));}if(_0x26923c<=0x0||isNaN(_0x26923c)){return _0x1d9a7d(msgResponse(_0xb50d('0x20f'),'Error',_0xb50d('0x210')+_0x26923c));}if(_0x4d610f<=0x0||isNaN(_0x4d610f)){return _0x1d9a7d(msgResponse(_0xb50d('0x20f'),_0xb50d('0xb9'),_0xb50d('0x20b')+_0x4d610f));}if(_0x216fa8<=0x0||isNaN(_0x216fa8)){return _0x1d9a7d(msgResponse(_0xb50d('0x20f'),_0xb50d('0xb9'),_0xb50d('0x211')+_0x216fa8));}_0x152b75=_0x152b75||0x0;var _0x289318=0x1/_0xb1a43d;var _0x540a8d=0x0;var _0x290c7e=0x0;var _0x30e35e=0x0;var _0xebc97f=0x0;for(var _0x177971=0x0;_0xebc97f<_0x216fa8;_0x177971+=0x1){_0x290c7e=_0x177971/_0x4d610f;_0x540a8d=(_0x26923c*_0x290c7e+_0x152b75)/_0x289318;_0x30e35e=utils[_0xb50d('0x212')](_0x540a8d,_0x18640d);_0xebc97f=_0x540a8d/_0x18640d*(0x1-utils[_0xb50d('0x212')](_0x540a8d,_0x18640d));}return _0x3a3fb7({'erlangCalls':_0x177971,'erlangCallToSecond':_0x4d610f/_0x177971,'erlangAbandonmentRate':_0x30e35e,'erlangBusyFactor':_0xebc97f});});};module[_0xb50d('0x213')]=Dialer; \ No newline at end of file +var _0x3951=['dialAbandonedRetryFrequency','voiceQueue','countabandonedretry','dialAbandonedMaxRetry','ContactId','[rescheduleContact][Abandoned]','Abandoned','calleridname','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','rrmemory','roundrobin','paused','stateinterface','locked','isNil','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','emit','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','dialMachineMaxRetry','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','[syncHangupIvr][createHistory]','dialQueueProject','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','queueSummaryCountersUpdated','assign','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','[syncAgentComplete][createHistory]','user:%s','launchHandleIvr','handleIvr','object','phone','originate','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','dialQueueOptions','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','Trunk','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Drop]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','NO_AVAILABLE_CONTACTS','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','RUNNING','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','erlangb','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','getSeconds','debug','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','CAMPAIGN_STATUS','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','isTrunkReachable','active','format','status','reachable','SIP/%s','unmonitored','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','iftime\x20%s,%s','interval','indexOf','true','catch','command','timezones','content','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','isIVRCampaignActive','resolve','checkIsTrunkReachable','checkIfTime','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','OVERTIME_GLOBAL_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','Drop','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','ListId','VoiceQueueId','CampaignId','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x3951,0x139));var _0x1395=function(_0x329fb9,_0x500419){_0x329fb9=_0x329fb9-0x0;var _0x1bf602=_0x3951[_0x329fb9];return _0x1bf602;};'use strict';var util=require(_0x1395('0x0'));var _=require('lodash');var uuid=require('uuid');var moment=require(_0x1395('0x1'));var rr=require('rr');var Redis=require(_0x1395('0x2'));var utils=require(_0x1395('0x3'));var hopperUtils=require(_0x1395('0x4'));var ut=require(_0x1395('0x5'));var config=require(_0x1395('0x6'));var logger=require(_0x1395('0x7'))('dialer');var loggerBooked=require(_0x1395('0x7'))(_0x1395('0x8'));var loggerPredictive=require(_0x1395('0x7'))(_0x1395('0x9'));var loggerPredictiveCalls=require(_0x1395('0x7'))(_0x1395('0xa'));var loggerSyncQueueSummary=require(_0x1395('0x7'))(_0x1395('0xb'));var ami=require(_0x1395('0xc'));config[_0x1395('0xd')]=_[_0x1395('0xe')](config['redis'],{'host':_0x1395('0xf'),'port':0x18eb});var io=require(_0x1395('0x10'))(new Redis(config[_0x1395('0xd')]));var cmHopper=require(_0x1395('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x1395('0x12'));var Interval=require(_0x1395('0x13'));var Action=require(_0x1395('0x14'));var History=require(_0x1395('0x15'));var Final=require(_0x1395('0x16'));var AgentComplete=require(_0x1395('0x17'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x1395('0x18'));var ipAgi=process[_0x1395('0x19')][_0x1395('0x1a')]||_0x1395('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1395('0x1c')]['enqueue']=function(_0xc9f88c){this[_0x1395('0x1d')]=this[_0x1395('0x1d')]?this[_0x1395('0x1d')][_0x1395('0x1e')](_0xc9f88c):_0xc9f88c();};function Dialer(_0x13ce5a,_0x23e2e1){this[_0x1395('0x1f')]=new Sequence();this[_0x1395('0x20')]=_0x23e2e1;this['voiceQueues']=_0x13ce5a[_0x1395('0x21')];this['campaigns']=_0x13ce5a[_0x1395('0x22')];this[_0x1395('0x23')]=_0x13ce5a[_0x1395('0x23')];this[_0x1395('0x24')]=_0x13ce5a[_0x1395('0x24')];this[_0x1395('0x25')]=config['maxNumberOriginate']||0x2;this[_0x1395('0x26')]={};this[_0x1395('0x27')]={};this[_0x1395('0x28')]={};this[_0x1395('0x29')]={};this['optionPredictive']={};this[_0x1395('0x2a')]={};this[_0x1395('0x2b')]={};this[_0x1395('0x2c')]={};this[_0x1395('0x2d')]={};this[_0x1395('0x2e')]={};this[_0x1395('0x2f')]={};ami['on'](_0x1395('0x30'),this[_0x1395('0x31')]['bind'](this));ami['on'](_0x1395('0x32'),this[_0x1395('0x33')]['bind'](this));ami['on'](_0x1395('0x34'),this[_0x1395('0x35')][_0x1395('0x36')](this));ami['on'](_0x1395('0x37'),this[_0x1395('0x38')][_0x1395('0x36')](this));ami['on'](_0x1395('0x39'),this[_0x1395('0xb')][_0x1395('0x36')](this));ami['on'](_0x1395('0x3a'),this[_0x1395('0x3b')][_0x1395('0x36')](this));ami['on'](_0x1395('0x3c'),this[_0x1395('0x3d')][_0x1395('0x36')](this));ami['on']('newexten',this[_0x1395('0x3e')][_0x1395('0x36')](this));ami['on'](_0x1395('0x3f'),this[_0x1395('0x40')][_0x1395('0x36')](this));ami['on'](_0x1395('0x41'),this[_0x1395('0x42')]['bind'](this));ami['on']('queuestatuscomplete',this[_0x1395('0x43')][_0x1395('0x36')](this));this[_0x1395('0x44')]();this[_0x1395('0x45')]();RpcSetting[_0x1395('0x46')]()[_0x1395('0x47')](function(_0x5cbb77){previewRecallmeReminderInterval=_0x5cbb77[_0x1395('0x48')];});}function isNotNull(_0xcc0f63){return _0xcc0f63!==null&&!_[_0x1395('0x49')](_0xcc0f63);}function msgResponse(_0x2a28eb,_0x2298ad,_0x51370a){return{'action':_0x2a28eb,'response':_0x2298ad,'message':_0x51370a,'stack':_0x51370a};}function emit(_0x285ce1,_0x5a7fc1,_0x178c2f){io['to'](_0x285ce1)['emit'](_0x5a7fc1,_0x178c2f);}function emitOutboundVoiceQueueSummary(_0x490cc7){if(_0x490cc7[_0x1395('0x4a')]===_0x1395('0x4b')){logger['debug'](_0x1395('0x4c'),util[_0x1395('0x4d')](_0x490cc7,{'showHidden':![],'depth':null}));emit(util['format'](_0x1395('0x4e'),_0x490cc7[_0x1395('0x4f')]),_0x1395('0x50'),_0x490cc7);}}function checkGetDataPredictive(_0x160476){if(isNotNull(_0x160476)&&!_[_0x1395('0x51')](_0x160476)){loggerPredictive['info'](_0x1395('0x52'));loggerPredictive[_0x1395('0x53')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x160476[_0x1395('0x54')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x55'),_0x160476[_0x1395('0x56')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x57'),_0x160476[_0x1395('0x58')]);loggerPredictive[_0x1395('0x53')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x160476[_0x1395('0x59')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x5a'),_0x160476[_0x1395('0x5b')]);loggerPredictive[_0x1395('0x53')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x160476[_0x1395('0x5c')]);loggerPredictive[_0x1395('0x53')]('---------------------------');if(_0x160476[_0x1395('0x54')]>0x0){if(!_[_0x1395('0x49')](_0x160476[_0x1395('0x5c')])&&_0x160476[_0x1395('0x5c')]>0x0){return!![];}loggerPredictive[_0x1395('0x53')](_0x1395('0x5d'));if(!_[_0x1395('0x49')](_0x160476['predictiveIntervalAvgHoldtime'])&&_0x160476[_0x1395('0x5b')]>0x0){return!![];}loggerPredictive['info'](_0x1395('0x5e'));}else{loggerPredictive['info'](_0x1395('0x5f'));}}else{loggerPredictive[_0x1395('0x53')](_0x1395('0x60'));}return![];}function mergeDataErlangB(_0x442f37){return function(_0x5f2cd8){loggerPredictive[_0x1395('0x53')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x1395('0x53')](_0x1395('0x61'),_0x5f2cd8[_0x1395('0x62')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x63'),_0x5f2cd8['erlangCallToSecond']);loggerPredictive[_0x1395('0x53')](_0x1395('0x64'),_0x5f2cd8[_0x1395('0x65')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x66'),_0x5f2cd8[_0x1395('0x67')]);loggerPredictive[_0x1395('0x53')](_0x1395('0x64'),_0x5f2cd8['erlangAbandonmentRate']);loggerPredictive[_0x1395('0x53')](_0x1395('0x68'));_[_0x1395('0x69')](_0x442f37,_0x5f2cd8);};}function ifInterval(_0xf8248d,_0x3a646e){if(_[_0x1395('0x49')](_0x3a646e)){return![];}return utils[_0x1395('0x6a')](undefined,_0x3a646e)<_0xf8248d*0x3c;}function clearPredictiveAttributes(_0x30fedf){if(_0x30fedf[_0x1395('0x2b')]){_0x30fedf['startProgressive']=undefined;loggerPredictive[_0x1395('0x6b')](_0x30fedf[_0x1395('0x4f')],_0x1395('0x6c'));}if(_0x30fedf[_0x1395('0x2a')]){_0x30fedf[_0x1395('0x2a')]=undefined;loggerPredictive['debug'](_0x30fedf['name'],'startPredictive\x20value\x20cleared');}if(_0x30fedf[_0x1395('0x6d')]){clearInterval(_0x30fedf[_0x1395('0x6d')]);_0x30fedf[_0x1395('0x6d')]=undefined;loggerPredictive[_0x1395('0x6b')](_0x30fedf[_0x1395('0x4f')],_0x1395('0x6e'));}}function loggerCatchPredictive(_0x430a6a,_0x2fe0fb){return function(_0x2b6d52){loggerPredictive[_0x1395('0x6f')](_0x2fe0fb[_0x1395('0x4f')],_0x430a6a);loggerPredictive[_0x1395('0x6f')](_0x2b6d52['stack']);clearPredictiveAttributes(_0x2fe0fb);};}function loggerCatch(_0x5a3f84){return function(_0x3fb8a0){logger['error'](_0x5a3f84,util[_0x1395('0x4d')](_0x3fb8a0,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4c4b3f,_0x28ebe5,_0x5d907c){return function(_0x52b3fb){utils[_0x1395('0x70')](_0x28ebe5,_0x5d907c,0x0);_0x28ebe5[_0x1395('0x71')]=0x0;logger[_0x1395('0x6f')](_0x4c4b3f,util[_0x1395('0x4d')](_0x52b3fb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4e3a76){return function(_0x16a752){if(isNotNull(_0x16a752)&&isNotNull(_0x16a752[0x0])){if(_0x16a752[0x0][_0x1395('0x72')]>0x0){_0x4e3a76[_0x1395('0x73')]=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x1395('0x53')](_0x1395('0x74')+_0x4e3a76[_0x1395('0x4f')],_0x16a752[0x0][_0x1395('0x72')],_0x1395('0x75'));}else{_0x4e3a76['message']=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x1395('0x53')](_0x1395('0x76')+_0x4e3a76[_0x1395('0x4f')]);}}};}function createObjHistory(_0x4e2c9e,_0x50475a,_0xc52b2e,_0x53e258,_0x128e0b){_0x4e2c9e['message']=_0xc52b2e;var _0x501786=new Action(_0x4e2c9e,_0x50475a);var _0xe88650=new History(_0x501786);_0xe88650[_0x1395('0x77')]=_0x53e258;_0xe88650[_0x1395('0x78')]=_0x128e0b;_0xe88650[_0x1395('0x79')]=_0x501786[_0x1395('0x7a')];return _0xe88650;}function unlockQueueStatus(_0x41bf39,_0x41578d){setTimeout(function(){if(_[_0x1395('0x49')](_0x41bf39[_0x1395('0x7b')])){loggerBooked['error'](_0x1395('0x7c'),_0x41578d);}_0x41bf39[_0x1395('0x7b')]=!![];loggerBooked[_0x1395('0x53')](_0x1395('0x7d'),_0x41578d,JSON[_0x1395('0x7e')](_[_0x1395('0x7f')](_0x41bf39,[_0x1395('0x4f'),_0x1395('0x7b')])));},0x1f3);}function checkInterval(_0xf2ad29){return function(){if(!isNotNull(_0xf2ad29[_0x1395('0x80')])){_0xf2ad29[_0x1395('0x73')]=utils[_0x1395('0x81')]['NULL_INTERVAL'];throw _0xf2ad29[_0x1395('0x4f')]+_0x1395('0x82');}if(!isNotNull(_0xf2ad29[_0x1395('0x80')][_0x1395('0x83')])){_0xf2ad29[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x84')];throw _0xf2ad29[_0x1395('0x4f')]+_0x1395('0x82');}if(!isNotNull(_[_0x1395('0x51')](_0xf2ad29[_0x1395('0x80')][_0x1395('0x83')]))){_0xf2ad29[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x84')];throw _0xf2ad29[_0x1395('0x4f')]+_0x1395('0x82');}};}function checkIsIVRCampaignActive(_0x63bdec){return function(){if(!utils['isIVRCampaignActive'](_0x63bdec)){_0x63bdec[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x85')];throw _0x63bdec[_0x1395('0x4f')]+_0x1395('0x86');}};}function emitCampaignSummary(_0x5cade8){if(utils['isIVRCampaign'](_0x5cade8)){emit(util['format'](_0x1395('0x87'),_0x5cade8[_0x1395('0x4f')]),'campaign:save',_0x5cade8);}}function loggerCatchQueueSummary(_0x4e8391,_0x21b392){return function(_0x33798e){clearPredictiveAttributes(_0x21b392);emitCampaignSummary(_0x21b392);loggerSyncQueueSummary[_0x1395('0x6b')](_0x4e8391,util[_0x1395('0x4d')](_0x33798e,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x147021){if(_0x147021[_0x1395('0x88')]){if(_0x147021[_0x1395('0x89')]===0x0){_0x147021[_0x1395('0x88')]=![];_0x147021[_0x1395('0x73')]=utils['CAMPAIGN_STATUS'][_0x1395('0x85')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x147021['name'],_0x1395('0x8a'));}else{_0x147021[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x8b')];loggerSyncQueueSummary[_0x1395('0x6b')](_0x1395('0x8c'),_0x147021[_0x1395('0x4f')],'is\x20disactive');}emitCampaignSummary(_0x147021);}}function myreject(_0x3a140e){return function(_0x1ba9f7){return _0x3a140e(msgResponse(_0x1395('0x8d'),_0x1395('0x8e'),JSON[_0x1395('0x7e')](_0x1ba9f7)));};}Dialer[_0x1395('0x1c')][_0x1395('0x8f')]=function(_0x1181fb){return!_['isUndefined'](_0x1181fb)&&_0x1181fb&&!_['isUndefined'](_0x1181fb[_0x1395('0x4f')])&&!_['isUndefined'](_0x1181fb[_0x1395('0x90')])&&_0x1181fb['active']&&(this[_0x1395('0x24')][util[_0x1395('0x91')]('SIP/%s',_0x1181fb['name'])][_0x1395('0x92')]===_0x1395('0x93')||this[_0x1395('0x24')][util[_0x1395('0x91')](_0x1395('0x94'),_0x1181fb[_0x1395('0x4f')])][_0x1395('0x92')]===_0x1395('0x95'));};Dialer[_0x1395('0x1c')]['checkIsTrunkReachable']=function(_0x2605d8){var _0x2cab2a=this;return function(){if(!_0x2cab2a[_0x1395('0x8f')](_0x2605d8['Trunk'])){if(!_0x2cab2a['isTrunkReachable'](_0x2605d8[_0x1395('0x96')])){_0x2605d8[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x97')];throw _0x2605d8[_0x1395('0x4f')]+_0x1395('0x98');}}};};Dialer['prototype']['checkIfTime']=function(_0x143bf5,_0x4e6b83,_0x5f2631,_0x125233){var _0xc68cd=this;return function(){var _0x217c82=!![];return _0xc68cd[_0x1395('0x99')](_0x143bf5,_0x4e6b83,_0x5f2631,_0x125233,_0x217c82);};};Dialer[_0x1395('0x1c')][_0x1395('0x9a')]=function(_0x4d3b36,_0x36eb44,_0x13467a,_0x14ba15){var _0x3470bc=this;return function(){var _0x3ad17f=![];return _0x3470bc[_0x1395('0x99')](_0x4d3b36['Intervals'],_0x36eb44,_0x13467a,_0x14ba15,_0x3ad17f);};};Dialer[_0x1395('0x1c')][_0x1395('0x99')]=function(_0x3ea454,_0x10b871,_0x148a1b,_0x3d440c,_0x364ae6){var _0x3b38fa=[];return new Promise(function(_0x4a7595,_0x57d034){if(!isNotNull(_0x3ea454)){_0x3d440c[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x84')];return _0x57d034(msgResponse(_0x1395('0x9b'),_0x1395('0x9c'),_0x148a1b+_0x1395('0x9d')));}if(_['isEmpty'](_0x3ea454)){_0x3d440c[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x9e')];return _0x57d034(msgResponse(_0x1395('0x9b'),'Failure',_0x148a1b+_0x1395('0x9f')));}if(_0x10b871&&_[_0x1395('0x49')](config['timezones'][_0x10b871])){_0x3d440c[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0xa0')];return _0x57d034(msgResponse(_0x1395('0x9b'),_0x1395('0x9c'),_0x148a1b+_0x1395('0xa1')+_0x10b871));}if(_[_0x1395('0xa2')](_0x3ea454)){for(var _0x1dd66c=0x0;_0x1dd66c<_0x3ea454['length'];_0x1dd66c+=0x1){_0x3b38fa[_0x1395('0xa3')](ami[_0x1395('0xa4')]({'action':'command','command':util[_0x1395('0x91')](_0x1395('0xa5'),_0x3ea454[_0x1dd66c][_0x1395('0xa6')],!_['isUndefined'](config['timezones'][_0x10b871])?_0x10b871:'')})['then'](function(_0x4d5cd9){return _0x4d5cd9['content'][_0x1395('0xa7')](_0x1395('0xa8'))>=0x0;})[_0x1395('0xa9')](myreject(_0x57d034)));}}else{_0x3b38fa[_0x1395('0xa3')](ami[_0x1395('0xa4')]({'action':_0x1395('0xaa'),'command':util[_0x1395('0x91')](_0x1395('0xa5'),_0x3ea454,!_['isUndefined'](config[_0x1395('0xab')][_0x10b871])?_0x10b871:'')})[_0x1395('0x47')](function(_0x4a3ac5){return _0x4a3ac5[_0x1395('0xac')][_0x1395('0xa7')](_0x1395('0xa8'))>=0x0;})[_0x1395('0xa9')](myreject(_0x57d034)));}Promise['all'](_0x3b38fa)['then'](function(_0x3054e4){var _0x510cdb=_['some'](_0x3054e4);if(_0x510cdb){return _0x4a7595(_0x510cdb);}else{_0x3d440c[_0x1395('0x73')]=_0x364ae6?utils[_0x1395('0x81')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x1395('0x81')][_0x1395('0xad')];return _0x57d034(msgResponse(_0x1395('0xae'),'Failure',_0x1395('0xaf')+_0x364ae6+'\x20'+_0x148a1b+_0x1395('0xb0')+util['inspect'](_0x3ea454,{'showHidden':![],'depth':null})+_0x1395('0xb1')+_0x10b871));}})[_0x1395('0xa9')](function(_0x15d252){return _0x57d034(msgResponse(_0x1395('0x9b'),_0x1395('0x9c'),JSON['stringify'](_0x15d252)));});});};Dialer['prototype'][_0x1395('0x44')]=function(){var _0x215d65=this;return cmHopper[_0x1395('0xb2')]({'active':![]},{'where':{'active':!![]}})[_0x1395('0x47')](function(){setInterval(function(){_0x215d65[_0x1395('0xb3')]();},0x3e8);});};Dialer[_0x1395('0x1c')][_0x1395('0xb3')]=function(){var _0x408ce5=this;var _0x4614b0;for(var _0x70d485 in this[_0x1395('0x22')]){if(typeof this[_0x1395('0x22')][_0x70d485]!==_0x1395('0xb4')){_0x4614b0=this[_0x1395('0x22')][_0x70d485];if(utils[_0x1395('0xb5')](_0x4614b0)&&utils[_0x1395('0xb6')](_0x4614b0)){_0x4614b0[_0x1395('0x88')]=!![];Promise[_0x1395('0xb7')]()[_0x1395('0x47')](checkIsIVRCampaignActive(_0x4614b0))['then'](checkInterval(_0x4614b0))[_0x1395('0x47')](_0x408ce5[_0x1395('0xb8')](_0x4614b0))[_0x1395('0x47')](_0x408ce5[_0x1395('0xb9')](_0x4614b0['dialGlobalInterval'],_0x4614b0['dialTimezone'],_0x4614b0[_0x1395('0x4f')],_0x4614b0))[_0x1395('0x47')](_0x408ce5[_0x1395('0x9a')](_0x4614b0['Interval'],_0x4614b0[_0x1395('0xba')],_0x4614b0['name'],_0x4614b0))[_0x1395('0x47')](_0x408ce5['launchHandleIvr'](_0x4614b0))[_0x1395('0xa9')](loggerCatchQueueSummary(_0x1395('0xbb'),_0x4614b0));}else{notSendMessagesCampaign(_0x4614b0);}}}};Dialer[_0x1395('0x1c')][_0x1395('0xbc')]=function(_0x3edcae){if(_0x3edcae[_0x1395('0xbd')]!==_0x1395('0x9')){clearPredictiveAttributes(_0x3edcae);}switch(_0x3edcae[_0x1395('0xbd')]){case _0x1395('0xbe'):this[_0x1395('0xbf')](_0x3edcae,0x1);break;case _0x1395('0xc0'):this[_0x1395('0xbf')](_0x3edcae,_0x3edcae['dialPowerLevel']);break;case _0x1395('0x9'):this[_0x1395('0x9')](_0x3edcae);break;case _0x1395('0x8'):this[_0x1395('0xbf')](_0x3edcae,0x1);break;default:logger['error'](_0x1395('0xc1'),_0x3edcae[_0x1395('0x4f')],_0x1395('0xc2'));}};Dialer[_0x1395('0x1c')][_0x1395('0x9b')]=function(_0x4caa83,_0x2a84cc){var _0x3ac800=_0x4caa83['dialTimezone'];var _0x344104=_0x2a84cc?_0x4caa83[_0x1395('0xc3')]:_0x4caa83['Interval'][_0x1395('0x83')];logger[_0x1395('0xc4')](_0x1395('0xc5'),_0x344104,_0x3ac800,_0x4caa83[_0x1395('0x4f')],util['format'](_0x1395('0xc6'),_0x4caa83[_0x1395('0x4f')],_0x4caa83['id']));var _0x13b20a=null;return Interval['intervalIftime'](_0x344104,_0x3ac800)[_0x1395('0x47')](function(_0x6b9614){if(_0x6b9614===!![]){return _0x6b9614;}else{_0x4caa83[_0x1395('0x73')]=_0x2a84cc?utils['CAMPAIGN_STATUS'][_0x1395('0xc7')]:utils[_0x1395('0x81')][_0x1395('0xad')];_0x13b20a=msgResponse('[ifTime][promiseAll]',_0x1395('0x9c'),_0x1395('0xaf')+_0x2a84cc+'\x20'+_0x4caa83['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x1395('0x4d')](_0x344104,{'showHidden':![],'depth':null})+_0x1395('0xb1')+_0x3ac800);}if(_0x13b20a!==null){logger[_0x1395('0xc4')](_0x1395('0xc8'),_0x13b20a);_0x13b20a[_0x1395('0xc9')]=_0x2a84cc;throw _0x13b20a;}})[_0x1395('0xa9')](function(_0x4e6ae0){logger['error'](_0x1395('0xca'),_0x4e6ae0);throw msgResponse('[ifTime][Action]',_0x1395('0x8e'),util[_0x1395('0x4d')](_0x4e6ae0,{'showHidden':![],'depth':null}));});};Dialer[_0x1395('0x1c')][_0x1395('0x31')]=function(_0x465e88){if(this[_0x1395('0x21')][_0x465e88[_0x1395('0xcb')]]){if(this[_0x1395('0x29')][_0x465e88[_0x1395('0xcc')]]&&this[_0x1395('0x29')][_0x465e88[_0x1395('0xcc')]][_0x1395('0x4a')]!==_0x1395('0xcd')){this[_0x1395('0xce')](this[_0x1395('0x21')][_0x465e88['queue']]);this[_0x1395('0x29')][_0x465e88[_0x1395('0xcc')]]['answertime']=moment()[_0x1395('0x91')](_0x1395('0xcf'));}}};Dialer[_0x1395('0x1c')][_0x1395('0x38')]=function(_0x39e3c4){var _0x47f81e=this[_0x1395('0x29')][_0x39e3c4[_0x1395('0xcc')]];if(this[_0x1395('0x21')][_0x39e3c4[_0x1395('0xcb')]]){if(_0x47f81e&&_0x47f81e[_0x1395('0x4a')]!==_0x1395('0xcd')){delete this[_0x1395('0x29')][_0x39e3c4[_0x1395('0xcc')]];this[_0x1395('0x21')][_0x39e3c4[_0x1395('0xcb')]][_0x1395('0xd0')]+=0x1;var _0x22d83e=new AgentComplete(_0x47f81e,_0x39e3c4);if(_0x39e3c4[_0x1395('0xd1')]===_0x1395('0xd2')){_0x22d83e['agiafterat']=this['voiceQueues'][_0x39e3c4['queue']][_0x1395('0xd3')]&&this[_0x1395('0x21')][_0x39e3c4[_0x1395('0xcb')]][_0x1395('0xd4')]?moment()[_0x1395('0x91')](_0x1395('0xcf')):undefined;}hopperUtils['createHistory'](_0x22d83e)[_0x1395('0xa9')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x1395('0xd5')](_0x22d83e)[_0x1395('0xa9')](loggerCatch(_0x1395('0xd6')));}}};Dialer['prototype'][_0x1395('0x33')]=function(_0x363c7){var _0x5f54f6=this[_0x1395('0x29')][_0x363c7[_0x1395('0xcc')]];var _0x397513=this;var _0x12d9fb=![];var _0x5f86b0;var _0x4d8dc6;if(this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]]){if(_0x5f54f6&&_0x5f54f6[_0x1395('0x4a')]!==_0x1395('0xcd')){delete this[_0x1395('0x29')][_0x363c7[_0x1395('0xcc')]];this[_0x1395('0xce')](this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]]);_0x5f54f6[_0x1395('0xd7')]=moment()[_0x1395('0x91')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1246bf=new QueueCallerAbandon(_0x5f54f6,_0x363c7);if(utils[_0x1395('0x6a')](_0x5f54f6['droptime'],_0x5f54f6[_0x1395('0xd8')])>=_0x5f54f6['dialQueueTimeout']){this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0x58')]+=0x1;this['voiceQueues'][_0x363c7['queue']]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x363c7[_0x1395('0xcb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x1246bf[_0x1395('0x77')]=0xa;_0x1246bf[_0x1395('0x78')]=_0x1395('0xd9');_0x1246bf['dropreason']=_0x1395('0xda');_0x1246bf['agiafterat']=this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0xd3')]?moment()[_0x1395('0x91')](_0x1395('0xcf')):undefined;_0x1246bf[_0x1395('0xdb')]+=0x1;_0x1246bf[_0x1395('0xdc')]+=0x1;_0x5f86b0=this['voiceQueues'][_0x363c7[_0x1395('0xcb')]][_0x1395('0xdd')];_0x4d8dc6=this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0xde')];hopperUtils[_0x1395('0xdf')](_0x1246bf,_0x1246bf[_0x1395('0x77')],_0x5f54f6['voiceQueue'])[_0x1395('0x47')](function(_0x1a9b6b){_0x12d9fb=_0x1a9b6b[_0x1395('0xe0')]==0x1;if(_0x1246bf['countdropretry']>=_0x397513[_0x1395('0x21')][_0x363c7['queue']][_0x1395('0xe1')]){_0x397513[_0x1395('0xe2')](_0x1246bf,_0x1a9b6b[_0x1395('0xe0')]);}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countdropretry':_0x1246bf['countdropretry'],'scheduledat':moment()[_0x1395('0xe4')](_0x397513['voiceQueues'][_0x363c7[_0x1395('0xcb')]]['dialDropRetryFrequency'],'minutes')[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x5f54f6['ContactId'],'ListId':_0x5f54f6[_0x1395('0xe5')],'VoiceQueueId':_0x5f54f6[_0x1395('0xe6')]||undefined,'CampaignId':_0x5f54f6[_0x1395('0xe7')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x44c3ee=new History(_0x1246bf);_0x44c3ee[_0x1395('0x77')]=0xa;_0x44c3ee['statedesc']=_0x1395('0xd9');_0x44c3ee[_0x1395('0x7a')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));_0x44c3ee['endtime']=_0x44c3ee[_0x1395('0x7a')];_0x44c3ee['calleridname']=_0x1246bf['calleridname'];_0x44c3ee[_0x1395('0xe8')]=_0x1246bf[_0x1395('0xe8')];hopperUtils[_0x1395('0xe9')](_0x44c3ee)['catch'](loggerCatch(_0x1395('0xea')));}})[_0x1395('0x47')](function(){if(_0x12d9fb)hopperUtils['swapAdditionalPhones'](_0x1246bf,_0x5f86b0,_0x4d8dc6)[_0x1395('0x47')](function(){return 0x1;});});}else{this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0x59')]+=0x1;this[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]][_0x1395('0xeb')]+=0x1;_0x1246bf['state']=0xb;_0x1246bf[_0x1395('0x78')]='Abandoned';_0x1246bf[_0x1395('0xec')]=_0x1395('0xed');_0x1246bf['countabandonedretry']+=0x1;_0x1246bf['countglobal']+=0x1;_0x5f86b0=this[_0x1395('0x21')][_0x363c7['queue']][_0x1395('0xee')];_0x4d8dc6=this['voiceQueues'][_0x363c7[_0x1395('0xcb')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x1395('0xdf')](_0x1246bf,_0x1246bf[_0x1395('0x77')],_0x5f54f6[_0x1395('0xef')])[_0x1395('0x47')](function(_0x43a735){if(_0x1246bf[_0x1395('0xf0')]>=_0x397513['voiceQueues'][_0x363c7['queue']][_0x1395('0xf1')]){_0x397513[_0x1395('0xe2')](_0x1246bf,_0x43a735[_0x1395('0xe0')]);}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countabandonedretry':_0x1246bf[_0x1395('0xf0')],'scheduledat':moment()[_0x1395('0xe4')](_0x397513[_0x1395('0x21')][_0x363c7[_0x1395('0xcb')]]['dialAbandonedRetryFrequency'],'minutes')[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x5f54f6[_0x1395('0xf2')],'ListId':_0x5f54f6[_0x1395('0xe5')],'VoiceQueueId':_0x5f54f6[_0x1395('0xe6')]||undefined,'CampaignId':_0x5f54f6[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0xf3')));var _0x342898=new History(_0x1246bf);_0x342898['state']=0xb;_0x342898[_0x1395('0x78')]=_0x1395('0xf4');_0x342898[_0x1395('0x7a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x342898[_0x1395('0x79')]=_0x342898[_0x1395('0x7a')];_0x342898[_0x1395('0xf5')]=_0x1246bf[_0x1395('0xf5')];_0x342898['calleridnum']=_0x1246bf[_0x1395('0xe8')];hopperUtils[_0x1395('0xe9')](_0x342898)['catch'](loggerCatch(_0x1395('0xf6')));}})['then'](function(){if(_0x12d9fb)hopperUtils['swapAdditionalPhones'](_0x1246bf,_0x5f86b0,_0x4d8dc6)[_0x1395('0x47')](function(){return 0x1;});});}}}};Dialer[_0x1395('0x1c')][_0x1395('0x3e')]=function(_0x5dc64e){if(this[_0x1395('0x27')][_0x5dc64e[_0x1395('0xcc')]]){this['actions'][_0x5dc64e['uniqueid']][_0x1395('0xf7')]=_0x5dc64e[_0x1395('0xf7')];}if(this[_0x1395('0x29')][_0x5dc64e['uniqueid']]){this['uniqueId'][_0x5dc64e['uniqueid']][_0x1395('0xf7')]=_0x5dc64e[_0x1395('0xf7')];}};Dialer[_0x1395('0x1c')][_0x1395('0x42')]=function(_0x34c536){if(!this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]){return;}var _0x3e706f=this[_0x1395('0x21')][this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]][_0x1395('0xcb')]][_0x1395('0xf9')]||_0x1395('0xfa');if(_0x3e706f===_0x1395('0xfb')){if(this[_0x1395('0x27')][_0x34c536['actionid']]&&_['isNil'](this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['locked'])&&_0x34c536[_0x1395('0x92')]==='1'&&_0x34c536[_0x1395('0xfc')]==='0'){if(this[_0x1395('0x23')][_0x34c536['stateinterface']]){if(!this[_0x1395('0x23')][_0x34c536[_0x1395('0xfd')]][_0x1395('0xfe')]){this['agents'][_0x34c536[_0x1395('0xfd')]][_0x1395('0xfe')]=!![];this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['locked']=!![];this['actions'][_0x34c536[_0x1395('0xf8')]][_0x1395('0xfd')]=_0x34c536[_0x1395('0xfd')];}}}}else if(_0x3e706f===_0x1395('0xfa')){if(this[_0x1395('0x27')][_0x34c536['actionid']]){if(this[_0x1395('0x23')][_0x34c536[_0x1395('0xfd')]]){this[_0x1395('0x27')][_0x34c536['actionid']][_0x1395('0xfd')]=_0x34c536[_0x1395('0xfd')];if(_[_0x1395('0xff')](this[_0x1395('0x2d')][this['actions'][_0x34c536['actionid']]['queue']])){this['queueBooked'][this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['queue']]=[];}this[_0x1395('0x2d')][this[_0x1395('0x27')][_0x34c536[_0x1395('0xf8')]]['queue']][_0x1395('0xa3')](_[_0x1395('0x69')](_[_0x1395('0x7f')](this['actions'][_0x34c536[_0x1395('0xf8')]],[_0x1395('0x100'),'stateinterface']),{'status':_0x34c536[_0x1395('0x92')],'paused':_0x34c536[_0x1395('0xfc')]}));}}}};Dialer[_0x1395('0x1c')][_0x1395('0x43')]=function(_0x3118d9){if(!this['actions'][_0x3118d9['actionid']]){return;}var _0x40753a=this;var _0x340551=this['voiceQueues'][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]];var _0x5759d0=_0x340551['strategy']||_0x1395('0xfa');if(_0x5759d0===_0x1395('0xfb')){if(this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]]&&this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xfd')]){this[_0x1395('0x20')][_0x1395('0x101')](this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]]['idHopper'],this['actions'][_0x3118d9[_0x1395('0xf8')]]['stateinterface'])[_0x1395('0xa9')](function(_0x3915b3){logger[_0x1395('0x6f')](_0x1395('0x102'),util[_0x1395('0x4d')](_0x3915b3,{'showHidden':![],'depth':null}));})['finally'](function(){_0x40753a[_0x1395('0xce')](_0x40753a['voiceQueues'][_0x40753a['actions'][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]);_0x40753a['agents'][_0x40753a['actions'][_0x3118d9['actionid']]['stateinterface']][_0x1395('0xfe')]=![];delete _0x40753a['actions'][_0x3118d9[_0x1395('0xf8')]];unlockQueueStatus(_0x340551);});}else{this[_0x1395('0xce')](this[_0x1395('0x21')][this[_0x1395('0x27')][_0x3118d9['actionid']][_0x1395('0xcb')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xf2')],'ListId':this[_0x1395('0x27')][_0x3118d9['actionid']][_0x1395('0xe5')],'VoiceQueueId':this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xe6')]||undefined,'CampaignId':this['actions'][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x103')));delete this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]];unlockQueueStatus(_0x340551);}}else if(_0x5759d0===_0x1395('0xfa')){var _0x24b96e;if(this[_0x1395('0x27')][_0x3118d9['actionid']]&&!_['isEmpty'](this[_0x1395('0x2d')][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]])){if(this['queueBookedRR'][_0x40753a[_0x1395('0x27')][_0x3118d9['actionid']]['queue']]){this[_0x1395('0x2e')][_0x40753a[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]=this[_0x1395('0x2e')][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]?this[_0x1395('0x2e')][this[_0x1395('0x27')][_0x3118d9['actionid']]['queue']]:this['queueBooked'][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]?this[_0x1395('0x2d')][this[_0x1395('0x27')][_0x3118d9['actionid']][_0x1395('0xcb')]][_0x1395('0x104')]||0x0:0x0;}this[_0x1395('0x2d')][this['actions'][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]]['_rr']=this['queueBookedRR'][this[_0x1395('0x27')][_0x3118d9[_0x1395('0xf8')]][_0x1395('0xcb')]];for(var _0xaec8d2=0x0;_0xaec8d2=_0xb375d3[_0x1395('0x128')]){_0x334e84[_0x1395('0x129')](_0x295b09,_0x1d81af,_0x903742,_0x1395('0x12a'));}else{if(_0x295b09[_0x1395('0x122')]>=_0xb375d3['dialMachineMaxRetry']){_0x334e84[_0x1395('0x12b')](_0x295b09,_0x1d81af,_0x903742,_0x1395('0x12c'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x295b09[_0x1395('0x122')],'scheduledat':moment()[_0x1395('0xe4')](_0xb375d3[_0x1395('0x12d')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x295b09[_0x1395('0xf2')],'ListId':_0x295b09[_0x1395('0xe5')],'VoiceQueueId':_0x295b09[_0x1395('0xe6')]||undefined,'CampaignId':_0x295b09[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact][Machine]'));_0x1d81af({'reschedule':0x1});}}});}if(_0x52f630[_0x1395('0x4a')]===_0x1395('0xcd')&&this[_0x1395('0x22')][_0x52f630['queue']][_0x1395('0x115')]&&_0x75f1f7[_0x1395('0x116')]===_0x1395('0x117')){delete this[_0x1395('0x29')][_0x75f1f7['uniqueid']];this[_0x1395('0xce')](this[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]]);_0x1186fb=new Hangup(_0x52f630,_0x75f1f7);_0x1186fb[_0x1395('0x77')]=0x12;_0x1186fb[_0x1395('0x78')]=_0x1395('0x12f');_0x1186fb[_0x1395('0x119')]=_0x1395('0x11a');ami['emit']('custom:amd',ut[_0x1395('0x11d')](_0x1186fb,_0x1395('0x123')));this[_0x1395('0x11e')](_0x1186fb,_0x1395('0x130'),_0x1395('0x131'));}if(_0x52f630['type']===_0x1395('0xcd')&&this[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]][_0x1395('0x115')]&&_0x75f1f7[_0x1395('0x116')]===_0x1395('0x132')){return new Promise(function(_0x3eea50,_0x228ee7){delete _0x334e84[_0x1395('0x29')][_0x75f1f7[_0x1395('0xcc')]];_0x334e84[_0x1395('0xce')](_0x334e84[_0x1395('0x22')][_0x52f630['queue']]);_0x334e84[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]][_0x1395('0xd0')]+=0x1;_0x334e84[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x5312c6=_0x334e84[_0x1395('0x22')][_0x52f630[_0x1395('0xcb')]];var _0xdb50c1=new Hangup(_0x52f630,_0x75f1f7);_0xdb50c1[_0x1395('0x77')]=0x13;_0xdb50c1[_0x1395('0x78')]=_0x1395('0x121');_0xdb50c1[_0x1395('0x119')]=_0x1395('0x11a');_0xdb50c1['countmachineretry']+=0x1;_0xdb50c1[_0x1395('0xdc')]+=0x1;_0xdb50c1['amd']=!![];ami[_0x1395('0x11b')]('custom:amd',ut[_0x1395('0x11d')](_0xdb50c1,'amd'));hopperUtils[_0x1395('0xe9')](_0xdb50c1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xdb50c1[_0x1395('0x124')]+_0xdb50c1[_0x1395('0x125')]+_0xdb50c1[_0x1395('0x126')]+_0xdb50c1[_0x1395('0x127')]+_0xdb50c1[_0x1395('0xdb')]+_0xdb50c1['countabandonedretry']+_0xdb50c1[_0x1395('0x122')]+_0xdb50c1['countagentrejectretry']>=_0x5312c6[_0x1395('0x128')]){_0x334e84[_0x1395('0x129')](_0xdb50c1,_0x3eea50,_0x228ee7,_0x1395('0x12a'));}else{if(_0xdb50c1[_0x1395('0x122')]>=_0x5312c6[_0x1395('0x133')]){_0x334e84[_0x1395('0x12b')](_0xdb50c1,_0x3eea50,_0x228ee7,_0x1395('0x12c'));}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countmachineretry':_0xdb50c1[_0x1395('0x122')],'scheduledat':moment()[_0x1395('0xe4')](_0x5312c6['dialMachineRetryFrequency'],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0xdb50c1[_0x1395('0xf2')],'ListId':_0xdb50c1[_0x1395('0xe5')],'VoiceQueueId':_0xdb50c1['VoiceQueueId']||undefined,'CampaignId':_0xdb50c1[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x134')));_0x3eea50({'reschedule':0x1});}}});}}};Dialer[_0x1395('0x1c')][_0x1395('0x3d')]=function(_0x995950){var _0x57ee05=this[_0x1395('0x29')][_0x995950[_0x1395('0xcc')]];var _0x462f94;if(_0x57ee05&&_0x57ee05[_0x1395('0x4a')]===_0x1395('0xcd')){delete this[_0x1395('0x29')][_0x995950[_0x1395('0xcc')]];this['updateOriginated'](this[_0x1395('0x22')][_0x57ee05[_0x1395('0xcb')]]);this[_0x1395('0x22')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x135')]+=0x1;_0x462f94=new Hangup(_0x57ee05,_0x995950);hopperUtils[_0x1395('0xe9')](_0x462f94)[_0x1395('0xa9')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x1395('0xd5')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x136')));}if(_0x57ee05&&_0x57ee05[_0x1395('0x4a')]!==_0x1395('0xcd')&&isNotNull(this[_0x1395('0x21')][_0x57ee05['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x995950[_0x1395('0xcc')]];this[_0x1395('0xce')](this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]]);this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0xd0')]+=0x1;this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x118')]+=0x1;_0x462f94=new Hangup(_0x57ee05,_0x995950);_0x462f94[_0x1395('0x77')]=0x10;_0x462f94[_0x1395('0x78')]=_0x1395('0x137');_0x462f94['membername']='AGI';hopperUtils[_0x1395('0xe9')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x138')));hopperUtils['moveContactManagedDialer'](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x136')));}if(_0x57ee05&&_0x57ee05[_0x1395('0x4a')]!==_0x1395('0xcd')&&!isNotNull(this['voiceQueues'][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x139')])){delete this[_0x1395('0x29')][_0x995950[_0x1395('0xcc')]];this['updateOriginated'](this['voiceQueues'][_0x57ee05[_0x1395('0xcb')]]);this[_0x1395('0x21')][_0x57ee05[_0x1395('0xcb')]][_0x1395('0x13a')]+=0x1;_0x462f94=new Hangup(_0x57ee05,_0x995950);_0x462f94['state']=0xc;_0x462f94[_0x1395('0x78')]=_0x995950['cause-txt'];_0x462f94['membername']=_0x1395('0x13b');hopperUtils[_0x1395('0xe9')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x138')));hopperUtils[_0x1395('0xd5')](_0x462f94)[_0x1395('0xa9')](loggerCatch(_0x1395('0x136')));}};Dialer['prototype']['syncQueueSummary']=function(_0x5bc015){var _0x5e35d2=this;if(!_0x5e35d2[_0x1395('0x2f')][_0x5bc015[_0x1395('0x4f')]]){_0x5e35d2[_0x1395('0x2f')][_0x5bc015[_0x1395('0x4f')]]={'running':![]};}else if(_0x5e35d2[_0x1395('0x2f')][_0x5bc015[_0x1395('0x4f')]][_0x1395('0x13c')]===!![]){return;}else if(_0x5e35d2[_0x1395('0x2f')][_0x5bc015['name']][_0x1395('0x13c')]===![]){_0x5e35d2[_0x1395('0x2f')][_0x5bc015['name']][_0x1395('0x13c')]=!![];}var _0x3d178c=_0x5e35d2[_0x1395('0x21')][_0x5bc015['name']];var _0xd2be16=_0x3d178c[_0x1395('0x73')]!==utils[_0x1395('0x81')][_0x1395('0x85')];var _0x412a9e=utils[_0x1395('0x13d')](_0x3d178c);_0x3d178c[_0x1395('0x13e')]=utils[_0x1395('0x13f')](_0x3d178c,_0x5e35d2[_0x1395('0x24')]);Promise[_0x1395('0xb7')]()[_0x1395('0x47')](function(){if(_0x3d178c[_0x1395('0x13e')]===utils[_0x1395('0x81')][_0x1395('0x85')]){if(_0xd2be16){clearPredictiveAttributes(_0x3d178c);_0x5bc015['startPredictive']=undefined;_0x5bc015[_0x1395('0x2b')]=undefined;}if(_0x3d178c[_0x1395('0x13e')]===utils[_0x1395('0x81')]['INACTIVE']){_0x5bc015[_0x1395('0x140')]=0x0;_0x5bc015[_0x1395('0xfc')]=0x0;_0x5bc015[_0x1395('0x141')]=0x0;_0x5bc015[_0x1395('0x142')]=0x0;_0x5bc015[_0x1395('0x143')]=0x0;}}else if(_0x3d178c[_0x1395('0x13e')]===utils[_0x1395('0x81')][_0x1395('0x144')]&&!_0x412a9e){return _0x5e35d2['ifTime'](_0x3d178c,!![])[_0x1395('0x47')](function(){return _0x5e35d2[_0x1395('0x9b')](_0x3d178c,![]);})[_0x1395('0x47')](function(){return _0x5e35d2[_0x1395('0xbc')](_0x3d178c);})[_0x1395('0xa9')](function(_0x2947c0){loggerSyncQueueSummary[_0x1395('0x6b')]('[syncQueueSummary]',util[_0x1395('0x4d')](_0x2947c0,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3d178c);});}else{clearPredictiveAttributes(_0x3d178c);}})['then'](function(){var _0x49c116=_0x5bc015['compareToOutboundQueue'](_0x3d178c);if(_0x49c116||_0x3d178c[_0x1395('0x145')]){_0x3d178c[_0x1395('0x145')]=![];_0x5bc015['updateReportFromOutboundQueue'](_0x3d178c);Object[_0x1395('0x146')](_0x3d178c,_0x5bc015);emitOutboundVoiceQueueSummary(_0x5bc015);}_0x5e35d2[_0x1395('0x2f')][_0x3d178c[_0x1395('0x4f')]][_0x1395('0x13c')]=![];})[_0x1395('0xa9')](function(_0x4e7ac0){logger['error'](_0x1395('0x147'),util['inspect'](_0x4e7ac0,{'showHidden':![],'depth':null}));_0x5e35d2[_0x1395('0x2f')][_0x3d178c[_0x1395('0x4f')]][_0x1395('0x13c')]=![];});};Dialer[_0x1395('0x1c')][_0x1395('0x3b')]=_[_0x1395('0x148')](function(){var _0xcb6b10=_[_0x1395('0x149')](this[_0x1395('0x21')],function(_0x4b6b42){return _0x4b6b42[_0x1395('0x14a')];});var _0x3d4252=_[_0x1395('0x149')](this[_0x1395('0x23')],function(_0x5095bf){return _0x5095bf[_0x1395('0x14b')]&&_0x5095bf[_0x1395('0x92')]==='reachable';});if(_0xcb6b10[_0x1395('0x105')]>0x0&&_0x3d4252['length']>0x0){return Promise[_0x1395('0xb7')]()[_0x1395('0x47')](cmHopper[_0x1395('0x14c')](_[_0x1395('0x14d')](_0xcb6b10,'id'),previewRecallmeReminderInterval,_[_0x1395('0x14d')](_0x3d4252,'id')))[_0x1395('0x47')](function(_0x52ab87){for(var _0xf1216d=0x0;_0xf1216d<_0x52ab87[_0x1395('0x105')];_0xf1216d++){var _0x465f46=_0x52ab87[_0xf1216d][_0x1395('0x14e')][_0x1395('0x4f')];if(_0x465f46)io['to'](util[_0x1395('0x91')]('user:%s',_0x465f46))[_0x1395('0x11b')](_0x1395('0x14f'),{'hopper':_0x52ab87[_0xf1216d]});}})['catch'](function(_0x47b6b6){logger[_0x1395('0x6f')](_0x1395('0x150'),_0x47b6b6);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x1395('0x1c')][_0x1395('0x45')]=function(){var _0x750c58=this;setInterval(function(){_0x750c58[_0x1395('0x151')](_0x750c58[_0x1395('0x29')],_0x1395('0x152'));_0x750c58[_0x1395('0x151')](_0x750c58[_0x1395('0x27')],_0x1395('0x153'));},0x32c8);};Dialer['prototype'][_0x1395('0x151')]=function(_0x1f215b,_0x169418){var _0x12071f=this;for(var _0x3d0ae3 in _0x1f215b){if(typeof _0x1f215b[_0x3d0ae3]!==_0x1395('0xb4')){this[_0x1395('0x1f')]['enqueue'](function(){if(!_[_0x1395('0xff')](_0x1f215b[_0x3d0ae3])){return ami['Action']({'action':_0x1395('0x92'),'channel':_0x1f215b[_0x3d0ae3][_0x1395('0xf7')]})[_0x1395('0xa9')](function(_0x44fcb6){if(_0x44fcb6[_0x1395('0x73')]===_0x1395('0x154')){setTimeout(function(){if(_0x1f215b[_0x3d0ae3]&&_0x1f215b[_0x3d0ae3][_0x1395('0x4a')]!==_0x1395('0xcd')){_0x12071f[_0x1395('0xce')](_0x12071f[_0x1395('0x21')][_0x1f215b[_0x3d0ae3]['queue']]);logger['error'](_0x1395('0x155'),_0x169418,_0x3d0ae3,_0x1f215b[_0x3d0ae3][_0x1395('0xcb')]);delete _0x1f215b[_0x3d0ae3];}if(_0x1f215b[_0x3d0ae3]&&_0x1f215b[_0x3d0ae3][_0x1395('0x4a')]===_0x1395('0xcd')){_0x12071f[_0x1395('0xce')](_0x12071f[_0x1395('0x22')][_0x1f215b[_0x3d0ae3][_0x1395('0xcb')]]);logger[_0x1395('0x6f')](_0x1395('0x156'),_0x169418,_0x3d0ae3,_0x1f215b[_0x3d0ae3][_0x1395('0xcb')]);delete _0x1f215b[_0x3d0ae3];}},0x2328);}});}});}}};Dialer[_0x1395('0x1c')][_0x1395('0x157')]=function(_0xd994fb){return Promise[_0x1395('0xb7')]()[_0x1395('0x47')](voiceQueueRt['getVoiceQueueRtPauses'](_0xd994fb))[_0x1395('0xa9')](loggerCatch(_0x1395('0x158')));};Dialer[_0x1395('0x1c')][_0x1395('0xce')]=function(_0x5e2e83){if(!_['isUndefined'](_0x5e2e83)&&_0x5e2e83!==null){if(typeof _0x5e2e83[_0x1395('0x89')]!=='undefined'){if(_0x5e2e83['originated']>0x0){_0x5e2e83[_0x1395('0x89')]-=0x1;}else{logger[_0x1395('0x6f')](_0x1395('0x159'));}}}else{logger[_0x1395('0x6f')](_0x1395('0x15a'));}};Dialer[_0x1395('0x1c')][_0x1395('0x15b')]=function(_0x35eef4,_0x11b8d0){var _0x42ac8f=this;return function(_0x3fd680){_0x42ac8f['updateOriginated'](_0x11b8d0);logger[_0x1395('0x6f')](_0x35eef4,util[_0x1395('0x4d')](_0x3fd680,{'showHidden':![],'depth':null}));};};Dialer[_0x1395('0x1c')][_0x1395('0x15c')]=function(_0xb17dea,_0x532ca7,_0x4e9739){var _0x3f5086={'state':0x19,'statedesc':_0x1395('0x15d')};this[_0x1395('0xce')](_0x532ca7);this[_0x1395('0x11e')](_[_0x1395('0x69')](_0x3f5086,_[_0x1395('0x7f')](_0x4e9739,['ContactId',_0x1395('0xe5'),_0x1395('0x15e'),_0x1395('0xe6'),_0x1395('0xe7')])),'[emptyContact][createHistory]',_0x1395('0x15f'));logger[_0x1395('0x6f')](_0xb17dea);};Dialer[_0x1395('0x1c')]['saveInDb']=function(_0x167bdc,_0x5d8ba1,_0x7d32bd){hopperUtils[_0x1395('0xe9')](_0x167bdc)['catch'](loggerCatch(_0x5d8ba1));hopperUtils[_0x1395('0xd5')](_0x167bdc)[_0x1395('0xa9')](loggerCatch(_0x7d32bd));};Dialer[_0x1395('0x1c')][_0x1395('0xe2')]=function(_0x49c74a,_0x544dd1){hopperUtils[_0x1395('0xe9')](_0x49c74a)['catch'](loggerCatch(_0x1395('0x160')));if(_0x544dd1==0x0){hopperUtils['moveContactManagedDialer'](_0x49c74a)[_0x1395('0xa9')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x1395('0x1c')]['checkPreviewRecallReminder']=function(_0xec0cb8){return Promise[_0x1395('0xb7')]()[_0x1395('0x47')](cmHopper['handlePreviewRecallNotifications'](_0xec0cb8['id'],previewRecallmeReminderInterval))[_0x1395('0x47')](function(_0xf5f7b0){for(var _0x5715d3=0x0;_0x5715d3<_0xf5f7b0[_0x1395('0x105')];_0x5715d3++){var _0x37b476=_0xf5f7b0[_0x5715d3][_0x1395('0x14e')][_0x1395('0x4f')];if(_0x37b476)io['to'](util[_0x1395('0x91')](_0x1395('0x161'),_0x37b476))[_0x1395('0x11b')]('user:dialPreviewRecallReminder',{'hopper':_0xf5f7b0[_0x5715d3]});}})[_0x1395('0xa9')](function(){});};Dialer[_0x1395('0x1c')][_0x1395('0x162')]=function(_0x5377e8){var _0x3c170c=this;return function(){_0x3c170c[_0x1395('0x163')](_0x5377e8);};};Dialer[_0x1395('0x1c')]['actionOriginate']=function(_0x4b6d68,_0x2f4d40){var _0x2d96fa=this;var _0x257eba=uuid['v4']();this['actions'][_0x257eba]=new Action(_0x4b6d68,_0x2f4d40,_0x257eba);return new Promise(function(_0x459dc7,_0x310a44){if(_[_0x1395('0x49')](_0x4b6d68)&&typeof _0x4b6d68!==_0x1395('0x164')){return _0x310a44(msgResponse('originate',_0x1395('0x9c'),'voiceQueue\x20is\x20undefine'));}if(_[_0x1395('0x49')](_0x2f4d40['phone'])||_0x2f4d40[_0x1395('0x165')]===null){return _0x310a44(msgResponse(_0x1395('0x166'),_0x1395('0x9c'),_0x1395('0x167')));}var _0x162362={'XMD-CALLERID':_0x2d96fa['actions'][_0x257eba][_0x1395('0x168')](),'XMD-AGI':_0x4b6d68[_0x1395('0x139')]?util[_0x1395('0x91')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4b6d68['dialQueueProject']):_0x1395('0x169'),'XMD-AGIAFTER':_0x4b6d68[_0x1395('0xd3')]?util['format'](_0x1395('0x16a'),ipAgi,_0x4b6d68[_0x1395('0xd3')]):_0x1395('0x169'),'XMD-QUEUE':utils[_0x1395('0x16b')](_0x4b6d68)?util['format']('\x22%s,%s%s,,,%s\x22',_0x4b6d68[_0x1395('0x4f')],_0x4b6d68[_0x1395('0x16c')]||'',_0x4b6d68[_0x1395('0xd4')]?'c':'',_0x4b6d68['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x2f4d40[_0x1395('0xf2')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d96fa[_0x1395('0x27')][_0x257eba][_0x1395('0x168')](),'XMD-AMD':_0x4b6d68[_0x1395('0x115')]?_0x1395('0x144'):'NONE','XMD-DESTINATION':_0x1395('0x16d')};if(_0x4b6d68[_0x1395('0x115')]){_0x162362[_0x1395('0x16e')]=_0x4b6d68[_0x1395('0x16f')]||0x9c4;_0x162362[_0x1395('0x170')]=_0x4b6d68['dialAMDGreeting']||0x5dc;_0x162362['XMD-AMDAFTERGREETINGSILENCE']=_0x4b6d68[_0x1395('0x171')]||0x320;_0x162362['XMD-AMDTOTALANALYSISTIME']=_0x4b6d68[_0x1395('0x172')]||0x1388;_0x162362['XMD-AMDMINWORDLENGTH']=_0x4b6d68['dialAMDMinWordLength']||0x64;_0x162362[_0x1395('0x173')]=_0x4b6d68[_0x1395('0x174')]||0x32;_0x162362[_0x1395('0x175')]=_0x4b6d68['dialAMDMaximumNumberOfWords']||0x3;_0x162362['XMD-AMDSILENCETHRESHOLD']=_0x4b6d68[_0x1395('0x176')]||0x100;_0x162362[_0x1395('0x177')]=_0x4b6d68[_0x1395('0x178')]||0x1388;}if(utils[_0x1395('0x16b')](_0x4b6d68)){_0x162362[_0x1395('0x179')]=_0x2f4d40[_0x1395('0xe6')];}else{_0x162362[_0x1395('0x17a')]=_0x2f4d40[_0x1395('0xe7')];}var _0x2d68cf=utils['setXMDContactVariables'](_0x2f4d40[_0x1395('0x17b')]);Object[_0x1395('0x146')](_0x162362,_0x2d68cf);var _0x4a6f47=_0x2d96fa['isTrunkReachable'](_0x4b6d68[_0x1395('0x17c')])?utils[_0x1395('0x17d')](_0x4b6d68[_0x1395('0x17c')]['callerid'],_0x4b6d68[_0x1395('0x17e')],_0x4b6d68[_0x1395('0x17f')]>0x0?utils['getCallerIdRandom'](_0x4b6d68[_0x1395('0x180')],_0x4b6d68[_0x1395('0x17f')]):_0x4b6d68[_0x1395('0x180')]):utils[_0x1395('0x17d')](_[_0x1395('0xff')](_0x4b6d68[_0x1395('0x96')])?_0x4b6d68[_0x1395('0x17c')][_0x1395('0x181')]:_0x4b6d68[_0x1395('0x96')]['callerid'],_0x4b6d68[_0x1395('0x17e')],_0x4b6d68[_0x1395('0x17f')]>0x0?utils[_0x1395('0x182')](_0x4b6d68['dialOriginateCallerIdNumber'],_0x4b6d68[_0x1395('0x17f')]):_0x4b6d68[_0x1395('0x180')]);if(_0x4a6f47){_0x162362[_0x1395('0x183')]=_0x2d96fa[_0x1395('0x27')][_0x257eba][_0x1395('0x184')]=utils[_0x1395('0x185')](_0x4a6f47);_0x162362[_0x1395('0x186')]=_0x2f4d40['phone'];}_0x4b6d68[_0x1395('0x187')]=_0x162362;return ami[_0x1395('0xa4')]({'actionid':_0x257eba,'action':_0x1395('0x166'),'channel':_0x2d96fa['isTrunkReachable'](_0x4b6d68[_0x1395('0x17c')])?util['format'](_0x1395('0x188'),_0x4b6d68[_0x1395('0x17c')]['name'],isNotNull(_0x4b6d68[_0x1395('0x189')])?_0x4b6d68['dialPrefix'][_0x1395('0x18a')]()||'':'',_0x4b6d68['dialCutDigit']>0x0?_0x2f4d40['phone']['substring'](_0x4b6d68[_0x1395('0x18b')]):_0x2f4d40[_0x1395('0x165')]):util[_0x1395('0x91')](_0x1395('0x188'),_[_0x1395('0xff')](_0x4b6d68[_0x1395('0x96')])?_0x4b6d68[_0x1395('0x17c')]['name']:_0x4b6d68['TrunkBackup'][_0x1395('0x4f')],isNotNull(_0x4b6d68['dialPrefix'])?_0x4b6d68[_0x1395('0x189')][_0x1395('0x18a')]()||'':'',_0x4b6d68[_0x1395('0x18b')]>0x0?_0x2f4d40[_0x1395('0x165')][_0x1395('0x18c')](_0x4b6d68[_0x1395('0x18b')]):_0x2f4d40[_0x1395('0x165')]),'callerid':_0x4a6f47,'Exten':_0x1395('0x16d'),'Context':'from-sip','Priority':'1','variable':_0x162362,'timeout':(_0x4b6d68[_0x1395('0x18d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x257eba})[_0x1395('0x47')](function(_0x45ebed){return _0x459dc7(_0x45ebed);})[_0x1395('0xa9')](function(_0xf02af9){_0x4b6d68[_0x1395('0x18e')]+=0x1;var _0x593193=new History(_0x2d96fa[_0x1395('0x27')][_0x257eba]);logger[_0x1395('0x6f')](util['format'](_0x1395('0x18f'),JSON[_0x1395('0x7e')](_0xf02af9)));_0x593193['state']=0xe;_0x593193[_0x1395('0x78')]=_0x1395('0x190');_0x593193[_0x1395('0x7a')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));_0x593193['endtime']=_0x593193['starttime'];hopperUtils[_0x1395('0xe9')](_0x593193)[_0x1395('0xa9')](loggerCatch(_0x1395('0x191')));_0x2d96fa[_0x1395('0xd5')](_0x593193)['catch'](loggerCatch(_0x1395('0x191')))[_0x1395('0x1e')](function(){delete _0x2d96fa[_0x1395('0x27')][_0x257eba];return _0x310a44(msgResponse('originate',_0x1395('0x8e'),'originate\x20action\x20Error'));});});});};Dialer[_0x1395('0x1c')][_0x1395('0x192')]=function(_0x397375,_0x55257f,_0x176cd6){var _0x54bd86=new History(_0x55257f);if(_0x54bd86[_0x1395('0x124')]+_0x54bd86['countcongestionretry']+_0x54bd86['countnoanswerretry']+_0x54bd86['countnosuchnumberretry']+_0x54bd86[_0x1395('0xdb')]+_0x54bd86[_0x1395('0xf0')]+_0x54bd86['countmachineretry']+_0x54bd86['countagentrejectretry']>=_0x176cd6[_0x1395('0x128')]-0x1){return!![];}switch(_0x397375){case 0x3:if(_0x54bd86[_0x1395('0x126')]>=_0x176cd6['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countnoanswerretry':_0x54bd86[_0x1395('0x126')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x193')],_0x1395('0x12e'))['format'](_0x1395('0xcf')),'ContactId':_0x54bd86['ContactId'],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x54bd86[_0x1395('0x124')]>=_0x176cd6[_0x1395('0x194')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countbusyretry':_0x54bd86[_0x1395('0x124')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6['dialBusyRetryFrequency'],_0x1395('0x12e'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x54bd86[_0x1395('0x125')]>=_0x176cd6[_0x1395('0x195')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countcongestionretry':_0x54bd86['countcongestionretry']+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x196')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})['catch'](loggerCatch(_0x1395('0x197')));break;case 0x0:if(_0x54bd86[_0x1395('0x127')]>=_0x176cd6[_0x1395('0x198')]-0x1){return!![];}else{hopperUtils[_0x1395('0xe3')]({'active':![],'countnosuchnumberretry':_0x54bd86[_0x1395('0x127')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x199')],_0x1395('0x12e'))['format'](_0x1395('0xcf')),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86['ListId'],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x54bd86[_0x1395('0xdb')]>=_0x176cd6[_0x1395('0xe1')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countdropretry':_0x54bd86[_0x1395('0xdb')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0xdd')],_0x1395('0x12e'))[_0x1395('0x91')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x19a')));break;case 0xb:if(_0x54bd86[_0x1395('0xf0')]>=_0x176cd6[_0x1395('0xf1')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countabandonedretry':_0x54bd86[_0x1395('0xf0')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0xee')],'minutes')[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86['ContactId'],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})['catch'](loggerCatch(_0x1395('0xf3')));break;case 0x13:if(_0x54bd86[_0x1395('0x122')]>=_0x176cd6['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x54bd86[_0x1395('0x122')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x12d')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86[_0x1395('0xf2')],'ListId':_0x54bd86['ListId'],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86['CampaignId']||undefined})[_0x1395('0xa9')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x54bd86[_0x1395('0x19b')]>=_0x176cd6[_0x1395('0x19c')]-0x1){return!![];}hopperUtils[_0x1395('0xe3')]({'active':![],'countagentrejectretry':_0x54bd86[_0x1395('0x19b')]+=0x1,'scheduledat':moment()[_0x1395('0xe4')](_0x176cd6[_0x1395('0x19d')],_0x1395('0x12e'))[_0x1395('0x91')](_0x1395('0xcf')),'ContactId':_0x54bd86['ContactId'],'ListId':_0x54bd86[_0x1395('0xe5')],'VoiceQueueId':_0x54bd86[_0x1395('0xe6')]||undefined,'CampaignId':_0x54bd86[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x19e')));break;default:return!![];}};Dialer[_0x1395('0x1c')][_0x1395('0x111')]=function(_0xa70dfe,_0x3d9123,_0x4cfd5e){var _0x1ef4b8=this;var _0x3ebe9a=new History(_0xa70dfe);var _0x2b9c87=![];var _0x327995;var _0x38d79c;return new Promise(function(_0x2c036c,_0x1c0f3c){if(_[_0x1395('0x49')](_0x3d9123)&&typeof _0x3d9123!==_0x1395('0x164')){return _0x1c0f3c(msgResponse(_0x1395('0x19f'),_0x1395('0x9c'),_0x1395('0x1a0')));}if(_[_0x1395('0x49')](_0x4cfd5e)&&typeof _0x4cfd5e!==_0x1395('0x164')){return _0x1c0f3c(msgResponse(_0x1395('0x19f'),'Failure','evt\x20is\x20undefine'));}hopperUtils[_0x1395('0xdf')](_0x3ebe9a,_0x4cfd5e[_0x1395('0xd1')],_0x3d9123)['then'](function(_0x12f6ba){if(_0x12f6ba[_0x1395('0xe0')]==0x1)_0x2b9c87=!![];switch(_0x4cfd5e[_0x1395('0xd1')]){case'0':_0x3d9123[_0x1395('0x1a1')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x0;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1a2');_0x3ebe9a[_0x1395('0x127')]+=0x1;_0x3ebe9a[_0x1395('0xdc')]+=0x1;ami['emit'](_0x1395('0x1a3'),ut[_0x1395('0x11d')](_0xa70dfe,'nosuchnumber'));_0x327995=_0x3d9123[_0x1395('0x199')];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils[_0x1395('0xe9')](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch(_0x1395('0x1a4')));if(_0x1ef4b8[_0x1395('0x192')](0x0,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a[_0x1395('0x127')]>=_0x3d9123['dialNoSuchNumberMaxRetry']){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,'reason\x200\x20no\x20such\x20number....');}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1a5'));}}break;case'3':_0x3d9123[_0x1395('0x1a6')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x3;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1a7');_0x3ebe9a['countnoanswerretry']+=0x1;_0x3ebe9a['countglobal']+=0x1;var _0x21c55c=ut[_0x1395('0x1a8')](_0xa70dfe,_0x3d9123);ami[_0x1395('0x11b')](_0x1395('0x1a9'),_0x21c55c);_0x327995=_0x3d9123[_0x1395('0x193')];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils[_0x1395('0xe9')](_0x3ebe9a)['catch'](loggerCatch(_0x1395('0x1aa')));if(_0x1ef4b8[_0x1395('0x192')](0x3,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a[_0x1395('0x126')]>=_0x3d9123[_0x1395('0x1ab')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1ac'));}else{_0x1ef4b8['stateGlobal'](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1ac'));}}break;case'5':_0x3d9123[_0x1395('0x1ad')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x5;_0x3ebe9a[_0x1395('0x78')]='Busy';_0x3ebe9a[_0x1395('0x124')]+=0x1;_0x3ebe9a['countglobal']+=0x1;ami[_0x1395('0x11b')](_0x1395('0x1ae'),ut[_0x1395('0x11d')](_0xa70dfe,_0x1395('0x1af')));_0x327995=_0x3d9123[_0x1395('0x1b0')];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils[_0x1395('0xe9')](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1ef4b8[_0x1395('0x192')](0x5,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countbusyretry']>=_0x3d9123['dialBusyMaxRetry']){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b1'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b1'));}}break;case'8':_0x3d9123[_0x1395('0x1b2')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x8;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1b3');_0x3ebe9a[_0x1395('0x125')]+=0x1;_0x3ebe9a[_0x1395('0xdc')]+=0x1;_0x327995=_0x3d9123[_0x1395('0x196')];_0x38d79c=_0x3d9123[_0x1395('0xde')];ami[_0x1395('0x11b')](_0x1395('0x1b4'),ut[_0x1395('0x11d')](_0xa70dfe,'congestion'));hopperUtils[_0x1395('0xe9')](_0x3ebe9a)['catch'](loggerCatch(_0x1395('0x1b5')));if(_0x1ef4b8[_0x1395('0x192')](0x8,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a[_0x1395('0x125')]>=_0x3d9123[_0x1395('0x195')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b6'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b6'));}}break;case'11':_0x3d9123[_0x1395('0x1b7')]+=0x1;_0x3ebe9a['state']=0xb;_0x3ebe9a[_0x1395('0x78')]='Abandoned';_0x3ebe9a[_0x1395('0xf0')]+=0x1;_0x3ebe9a[_0x1395('0xdc')]+=0x1;_0x327995=_0x3d9123['dialAbandonedRetryFrequency'];_0x38d79c=_0x3d9123[_0x1395('0xde')];hopperUtils['createHistory'](_0x3ebe9a)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1ef4b8[_0x1395('0x192')](0xb,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countabandonedretry']>=_0x3d9123[_0x1395('0xf1')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b8'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1b8'));}}break;case'20':_0x3d9123['outboundRejectCallsDay']+=0x1;_0x3ebe9a[_0x1395('0x77')]=0x14;_0x3ebe9a[_0x1395('0x78')]=_0x1395('0x1b9');_0x3ebe9a[_0x1395('0x19b')]+=0x1;_0x3ebe9a['countglobal']+=0x1;_0x327995=_0x3d9123[_0x1395('0x19d')];_0x38d79c=_0x3d9123['callAdditionalPhoneAfterMin'];ami['emit'](_0x1395('0x1ba'),ut[_0x1395('0x11d')](_0xa70dfe,'agentreject'));hopperUtils[_0x1395('0xe9')](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x1ef4b8[_0x1395('0x192')](0x14,_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countagentrejectretry']>=_0x3d9123[_0x1395('0x19c')]){_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x1395('0x1bb'));}else{_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,'reason\x2020\x20agentreject');}}break;default:_0x3d9123[_0x1395('0x13a')]+=0x1;_0x3ebe9a[_0x1395('0x77')]=0xc;_0x3ebe9a[_0x1395('0x78')]=_0x4cfd5e[_0x1395('0xd1')];_0x327995=_0x3d9123['dialAgentRejectRetryFrequency'];_0x38d79c=_0x3d9123['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x3ebe9a)[_0x1395('0xa9')](loggerCatch(_0x1395('0x1bc')));if(_0x1ef4b8[_0x1395('0x192')](_0x4cfd5e['reason'],_0xa70dfe,_0x3d9123)&&!_0x2b9c87){if(_0x3ebe9a['countbusyretry']+_0x3ebe9a[_0x1395('0x125')]+_0x3ebe9a[_0x1395('0x126')]+_0x3ebe9a[_0x1395('0x127')]+_0x3ebe9a['countdropretry']+_0x3ebe9a['countabandonedretry']+_0x3ebe9a[_0x1395('0x122')]+_0x3ebe9a['countagentrejectretry']>=_0x3d9123[_0x1395('0x128')]){_0x1ef4b8[_0x1395('0x129')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x4cfd5e['reason']);}else{_0x1ef4b8[_0x1395('0x12b')](_0x3ebe9a,_0x2c036c,_0x1c0f3c,_0x4cfd5e[_0x1395('0xd1')]);}}}})[_0x1395('0x47')](function(){if(_0x2b9c87){hopperUtils['swapAdditionalPhones'](_0x3ebe9a,_0x327995,_0x38d79c)[_0x1395('0x47')](function(){return _0x2c036c(0x1);});}});});};Dialer['prototype'][_0x1395('0x129')]=function(_0x1951d4,_0xcf6e60,_0x2bfcfa,_0x3b700f){var _0x259afe=new Final(_0x1951d4);_0x259afe[_0x1395('0x77')]=0xf;_0x259afe[_0x1395('0x78')]=_0x1395('0x1bd');this[_0x1395('0x12b')](_0x259afe,_0xcf6e60,_0x2bfcfa,_0x3b700f);};Dialer[_0x1395('0x1c')][_0x1395('0x12b')]=function(_0x4f8031,_0x4b92cf,_0x57eb6e,_0x542dfe){hopperUtils[_0x1395('0xd5')](_0x4f8031)[_0x1395('0x47')](function(){return _0x4b92cf(msgResponse(_0x1395('0x19f'),_0x1395('0x110'),_0x542dfe));})[_0x1395('0xa9')](function(){return _0x57eb6e(msgResponse(_0x1395('0x1be'),_0x1395('0x9c'),_0x1395('0x1bf')));});};Dialer[_0x1395('0x1c')]['predictive']=function(_0x3e0067){var _0x5901ed=_0x3e0067[_0x1395('0x1c0')]/0x64;var _0x1fd0b1=_0x3e0067[_0x1395('0x1c1')]/(_0x3e0067[_0x1395('0x1c1')]+_0x3e0067[_0x1395('0xd0')]);var _0x566d81=Math[_0x1395('0x1c2')](_0x3e0067[_0x1395('0x1c3')]*(_0x3e0067[_0x1395('0x1c4')]/0x64));var _0x88bb4d=Math[_0x1395('0x1c2')](_0x3e0067[_0x1395('0x1c3')]*(_0x3e0067[_0x1395('0x1c5')]/0x64));var _0x2d0abc=_0x3e0067[_0x1395('0x140')]+_0x3e0067[_0x1395('0x142')];var _0x5bd70e=Math[_0x1395('0x1c6')](_0x3e0067[_0x1395('0x62')]*_0x3e0067[_0x1395('0x65')]*_0x3e0067[_0x1395('0x1c7')]*_0x3e0067['predictiveIntervalMultiplicativeFactor']);if(_[_0x1395('0x49')](_0x3e0067[_0x1395('0x2b')])){if(!_['isUndefined'](_0x3e0067[_0x1395('0x2a')])){_0x3e0067[_0x1395('0x2a')]=undefined;loggerPredictive[_0x1395('0x6f')](_0x1395('0x1c8'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x1395('0x49')](_0x3e0067['handlePredictive'])){loggerPredictive[_0x1395('0x6f')]('[startMethodPredictive][StartProgressive]',_0x1395('0x1c9'));clearInterval(_0x3e0067[_0x1395('0x6d')]);_0x3e0067[_0x1395('0x6d')]=undefined;}_0x3e0067[_0x1395('0x2b')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));loggerPredictive[_0x1395('0x53')](_0x3e0067[_0x1395('0x4f')],_0x1395('0x1ca'),_0x3e0067[_0x1395('0x2b')]);this[_0x1395('0xbf')](_0x3e0067,0x1);}else if(ifInterval(_0x3e0067[_0x1395('0x1cb')],_0x3e0067['startProgressive'])){this[_0x1395('0xbf')](_0x3e0067,0x1);loggerPredictiveCalls[_0x1395('0x53')](_0x1395('0x1cc'),_0x3e0067['startProgressive'],_0x3e0067['name']);_0x3e0067[_0x1395('0x62')]=0x0;_0x3e0067[_0x1395('0x1cd')]=0x0;}else if(_0x5901ed<_0x1fd0b1&&_0x3e0067[_0x1395('0x1ce')]==='dropRate'){clearPredictiveAttributes(_0x3e0067);loggerPredictive[_0x1395('0x53')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x1395('0x1cf'),_0x1fd0b1,_0x1395('0x2b'),_0x3e0067[_0x1395('0x4f')]);}else if(_0x5bd70e<_0x3e0067[_0x1395('0x1cd')]&&_0x3e0067[_0x1395('0x1ce')]===_0x1395('0x1d0')){clearPredictiveAttributes(_0x3e0067);loggerPredictive['info'](_0x1395('0x1d1'),_0x1395('0x1d2'),_0x5bd70e,_0x1395('0x1d3'),_0x3e0067['predictiveIntervalErlangCallsDroppedCalls'],_0x1395('0x2b'),_0x3e0067[_0x1395('0x4f')]);}else if(!ifInterval(_0x3e0067[_0x1395('0x1cb')],_0x3e0067['startProgressive'])&&_['isUndefined'](_0x3e0067[_0x1395('0x2a')])&&!_['isUndefined'](_0x3e0067[_0x1395('0x2b')])){_0x3e0067[_0x1395('0x2a')]=moment()[_0x1395('0x91')](_0x1395('0xcf'));loggerPredictive[_0x1395('0x53')](_0x3e0067['name'],'started\x20in\x20predictive\x20at',_0x3e0067[_0x1395('0x2a')]);hopperUtils[_0x1395('0x1d4')](_0x3e0067[_0x1395('0x1cb')])['then'](this[_0x1395('0x1d5')](_0x3e0067))[_0x1395('0x47')](mergeDataErlangB(_0x3e0067))[_0x1395('0x47')](this[_0x1395('0x1d6')](_0x3e0067))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3e0067));}else if(!ifInterval(_0x3e0067[_0x1395('0x1cb')],_0x3e0067['startPredictive'])){_0x3e0067['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3e0067[_0x1395('0x2a')]=moment()[_0x1395('0x91')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x3e0067[_0x1395('0x4f')],_0x1395('0x1d7'),_0x3e0067[_0x1395('0x2a')]);clearInterval(_0x3e0067[_0x1395('0x6d')]);_0x3e0067[_0x1395('0x6d')]=undefined;hopperUtils['avgHandleTime'](_0x3e0067[_0x1395('0x1cb')])[_0x1395('0x47')](this[_0x1395('0x1d5')](_0x3e0067))[_0x1395('0x47')](mergeDataErlangB(_0x3e0067))[_0x1395('0x47')](this['startMethodPredictive'](_0x3e0067))['catch'](loggerCatchPredictive(_0x1395('0x1d8'),_0x3e0067));}else if(_0x3e0067[_0x1395('0x1c3')]&&_0x2d0abc<_0x3e0067[_0x1395('0x1c3')]-_0x88bb4d){clearPredictiveAttributes(_0x3e0067);loggerPredictive[_0x1395('0x53')](_0x3e0067[_0x1395('0x4f')],_0x1395('0x1d9'),_0x2d0abc,_0x1395('0x1da'),_0x3e0067[_0x1395('0x1c3')],'-',_0x88bb4d,'=',_0x3e0067['predictiveIntervalAvailable']-_0x88bb4d,')');}else if(_0x3e0067[_0x1395('0x1c3')]&&_0x2d0abc>_0x3e0067[_0x1395('0x1c3')]+_0x566d81){clearPredictiveAttributes(_0x3e0067);loggerPredictive[_0x1395('0x53')](_0x3e0067[_0x1395('0x4f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2d0abc,_0x1395('0x1db'),_0x3e0067[_0x1395('0x1c3')],'+',_0x566d81,'=',_0x3e0067['predictiveIntervalAvailable']+_0x566d81,')');}};Dialer[_0x1395('0x1c')]['getDataPredictive']=function(_0x12c719){var _0x1eca71=this;return function(_0x552247){return new Promise(function(_0x5911c5,_0xbf249e){_[_0x1395('0x69')](_0x12c719,_0x552247[0x0]);if(checkGetDataPredictive(_0x552247[0x0])){var _0x2bf2bc=_0x12c719[_0x1395('0x1c3')]=_0x12c719[_0x1395('0x142')]+_0x12c719[_0x1395('0x140')];var _0x29f62d=_0x12c719[_0x1395('0x1cb')]*0x3c;var _0xe4009e=_0x552247[0x0]['predictiveIntervalAvgTalktime']+_0x552247[0x0]['predictiveIntervalAvgHoldtime'];var _0x9f7622=(_0x552247[0x0][_0x1395('0x56')]+_0x552247[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x552247[0x0][_0x1395('0x59')])/_0x552247[0x0]['predictiveIntervalTotalCalls'];_0x12c719[_0x1395('0x1c7')]=_0x9f7622>0x0?_0x9f7622:0x1;switch(_0x12c719[_0x1395('0x1ce')]){case _0x1395('0x1d0'):var _0x539f62=_0x12c719[_0x1395('0x1c0')]/0x64;return _0x1eca71[_0x1395('0x1dc')](_0x2bf2bc,_0x29f62d,_0xe4009e,_0x9f7622,_0x539f62)[_0x1395('0x47')](function(_0x350001){return _0x5911c5(_0x350001);});case'agentBusyFactor':var _0x3c33fe=_0x12c719[_0x1395('0x1c0')]/0x64;return _0x1eca71[_0x1395('0x1dd')](_0x2bf2bc,_0x29f62d,_0xe4009e,_0x9f7622,_0x3c33fe)['then'](function(_0x4b1109){return _0x5911c5(_0x4b1109);});default:return _0xbf249e(msgResponse(_0x1395('0x1de'),_0x1395('0x9c'),'Unknown\x20Predictive'));}}else{return _0xbf249e(msgResponse('[getDataPredictive]',_0x1395('0x9c'),_0x1395('0x1df')));}});};};Dialer[_0x1395('0x1c')][_0x1395('0x1e0')]=function(_0x59053b){var _0x388721=this;return function(_0x542500){return new Promise(function(_0x46965a,_0x2bc2e9){_[_0x1395('0x69')](_0x59053b,_0x542500[0x0]);if(checkGetDataPredictive(_0x542500[0x0])){loggerPredictive['info'](JSON['stringify'](_0x542500[0x0]));if(_0x59053b[_0x1395('0x1ce')]===_0x1395('0x1d0')){return _0x388721['getVoiceQueueRtPauses'](_0x59053b['id'])['then'](function(_0x4d06b3){var _0x12cf7c=_0x59053b[_0x1395('0x1e1')]-_0x4d06b3[0x0][_0x1395('0x1e2')];var _0xa1fe74=_0x59053b[_0x1395('0x1cb')]*0x3c;var _0x5a8ff9=_0x542500[0x0][_0x1395('0x5c')]+_0x542500[0x0][_0x1395('0x5b')];var _0x85a13a=(_0x542500[0x0]['predictiveIntervalAnsweredCalls']+_0x542500[0x0][_0x1395('0x58')]+_0x542500[0x0][_0x1395('0x59')])/_0x542500[0x0]['predictiveIntervalTotalCalls'];var _0x2ffb7b=_0x59053b[_0x1395('0x1c0')]/0x64;_0x59053b[_0x1395('0x1e3')]=_0x4d06b3[0x0]['outboundQueuePauses']||0x0;_0x59053b[_0x1395('0x1c7')]=_0x85a13a>0x0?_0x85a13a:0x1;return _0x388721['abandonmentRate'](_0x12cf7c,_0xa1fe74,_0x5a8ff9,_0x85a13a,_0x2ffb7b);})['then'](function(_0x2ed3ba){return _0x46965a(_0x2ed3ba);})[_0x1395('0xa9')](function(_0x23aa14){return _0x2bc2e9(msgResponse(_0x1395('0x1e4'),_0x1395('0x9c'),JSON['stringify'](_0x23aa14)));});}if(_0x59053b[_0x1395('0x1ce')]===_0x1395('0x1e5')){return _0x388721[_0x1395('0x157')](_0x59053b['id'])[_0x1395('0x47')](function(_0x3ea09e){var _0x2c6d6f=_0x59053b['loggedIn']-_0x3ea09e[0x0][_0x1395('0x1e2')];var _0x3d181a=_0x59053b[_0x1395('0x1cb')]*0x3c;var _0x29a286=_0x542500[0x0][_0x1395('0x5c')]+_0x542500[0x0][_0x1395('0x5b')];var _0x58492d=(_0x542500[0x0][_0x1395('0x56')]+_0x542500[0x0][_0x1395('0x58')]+_0x542500[0x0][_0x1395('0x59')])/_0x542500[0x0]['predictiveIntervalTotalCalls'];var _0x6d2cc1=_0x59053b[_0x1395('0x1c0')]/0x64;_0x59053b[_0x1395('0x1e3')]=_0x3ea09e[0x0][_0x1395('0x1e2')]||0x0;_0x59053b['predictiveIntervalHitRate']=_0x58492d>0x0?_0x58492d:0x1;return _0x388721['busyFactor'](_0x2c6d6f,_0x3d181a,_0x29a286,_0x58492d,_0x6d2cc1);})[_0x1395('0x47')](function(_0x4ef951){return _0x46965a(_0x4ef951);})[_0x1395('0xa9')](function(_0x22f2cb){return _0x2bc2e9(msgResponse(_0x1395('0x1e4'),_0x1395('0x9c'),JSON['stringify'](_0x22f2cb)));});}}else{return _0x2bc2e9(msgResponse('[getDataPredictive]','Failure',_0x1395('0x1df')));}});};};Dialer[_0x1395('0x1c')][_0x1395('0x1d6')]=function(_0x586daa){var _0x34385a=this;return function(){var _0x14a83f=0x0;var _0x421049=Math['floor'](_0x586daa[_0x1395('0x1e6')]*0x3e8);if(_0x421049>0x0){_0x421049=_0x421049<0x64?0x64:_0x421049;loggerPredictive[_0x1395('0x53')](_0x586daa[_0x1395('0x4f')],_0x1395('0x1e7'),_0x421049,'milliseconds');_0x586daa['handlePredictive']=setInterval(function(){_0x34385a[_0x1395('0x6d')](_0x586daa);loggerPredictiveCalls[_0x1395('0x53')](_0x1395('0x1e8'),_0x14a83f+=0x1);},_0x421049);}else{loggerPredictive['info'](_0x586daa[_0x1395('0x4f')],_0x1395('0x1e9'));}};};Dialer[_0x1395('0x1c')][_0x1395('0x1ea')]=function(_0x25189,_0x185a0d){var _0x1d758a=this;return function(_0x3017ca){if(_[_0x1395('0x51')](_0x3017ca)){if(_[_0x1395('0xff')](_0x185a0d[_0x1395('0x15e')])||!_0x185a0d[_0x1395('0x1eb')]){if(_0x25189[_0x1395('0xbd')]==='booked'){_0x25189['queueStatusComplete']=_[_0x1395('0x49')](_0x25189[_0x1395('0x7b')])?!![]:_0x25189[_0x1395('0x7b')];var _0x268bef=uuid['v4']();_0x1d758a[_0x1395('0x27')][_0x268bef]=new Action(_0x25189,_0x185a0d,_0x268bef);loggerBooked[_0x1395('0x53')](_0x1395('0x1ec'),_0x268bef,_0x1395('0x1ed'),JSON[_0x1395('0x7e')](_0x25189[_0x1395('0x7b')]),_0x1395('0x1ee'),_0x25189[_0x1395('0x4f')]);if(_0x25189[_0x1395('0x7b')]){_0x25189[_0x1395('0x7b')]=![];_0x1d758a[_0x1395('0x2d')][_0x1d758a['actions'][_0x268bef][_0x1395('0xcb')]]=[];ami['Action']({'actionid':_0x268bef,'action':_0x1395('0x1ef'),'queue':_0x25189[_0x1395('0x4f')]})['catch'](function(){_0x1d758a[_0x1395('0xce')](_0x25189);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xf2')],'ListId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe5')],'VoiceQueueId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe6')]||undefined,'CampaignId':_0x1d758a[_0x1395('0x27')][_0x268bef]['CampaignId']||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x1f0')));delete _0x1d758a['actions'][_0x268bef];});}else{loggerBooked['info'](_0x1395('0x1f1'),JSON[_0x1395('0x7e')](_0x25189['queueStatusComplete']),_0x1395('0x1ee'),_0x25189[_0x1395('0x4f')]);_0x1d758a[_0x1395('0xce')](_0x25189);hopperUtils[_0x1395('0xe3')]({'active':![],'ContactId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xf2')],'ListId':_0x1d758a['actions'][_0x268bef][_0x1395('0xe5')],'VoiceQueueId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe6')]||undefined,'CampaignId':_0x1d758a[_0x1395('0x27')][_0x268bef][_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x1f0')));delete _0x1d758a[_0x1395('0x27')][_0x268bef];}}else{return _0x1d758a[_0x1395('0x1f2')](_0x25189,_0x185a0d);}}else{if(utils[_0x1395('0x6a')](undefined,_0x185a0d[_0x1395('0x1f3')])<_0x25189[_0x1395('0x1f4')]*0x3c){if(_0x185a0d[_0x1395('0x14e')]&&!_0x185a0d[_0x1395('0x14e')][_0x1395('0x1f5')]){_0x1d758a[_0x1395('0x20')][_0x1395('0x101')](_0x185a0d['id'])[_0x1395('0x1e')](function(){_0x1d758a[_0x1395('0xce')](_0x25189);});}else{hopperUtils[_0x1395('0x1f6')]({'active':![]},_0x185a0d['id'],0x1)[_0x1395('0x1e')](function(){_0x1d758a[_0x1395('0xce')](_0x25189);});}}else{_0x25189[_0x1395('0x1f7')]+=0x1;_0x1d758a[_0x1395('0xce')](_0x25189);if(_0x25189['dialRecallInQueue']){hopperUtils[_0x1395('0xe3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x185a0d[_0x1395('0xf2')],'ListId':_0x185a0d[_0x1395('0xe5')],'VoiceQueueId':_0x185a0d['VoiceQueueId']||undefined,'CampaignId':_0x185a0d[_0x1395('0xe7')]||undefined})[_0x1395('0xa9')](loggerCatch(_0x1395('0x1f8')));hopperUtils[_0x1395('0xe9')](createObjHistory(_0x25189,_0x185a0d,utils[_0x1395('0x81')][_0x1395('0x1f9')],0x17,'RecallInQueue'))[_0x1395('0xa9')](loggerCatch(_0x1395('0x1fa')));}else{_0x1d758a[_0x1395('0x11e')](createObjHistory(_0x25189,_0x185a0d,utils[_0x1395('0x81')][_0x1395('0x1fb')],0x16,_0x1395('0x1fc')),_0x1395('0x1fd'),'[Originate][HistoryRecallClose]');}}}}else{_0x25189['outboundBlacklistCallsDay']+=0x1;_0x1d758a[_0x1395('0x11e')](createObjHistory(_0x25189,_0x185a0d,utils[_0x1395('0x81')][_0x1395('0x1fe')],0xd,_0x1395('0x1ff')),_0x1395('0x200'),'[Originate][MoveBlacklist]');throw _0x1395('0x201');}};};Dialer['prototype']['handleIvr']=function(_0x31020e){var _0x57fd9f=this;var _0x575bc2=_0x31020e[_0x1395('0x202')]-_0x31020e['originated'];emitCampaignSummary(_0x31020e);if(_0x575bc2>0x0&&_0x31020e[_0x1395('0x71')]==0x0){if(_0x575bc2>this[_0x1395('0x25')]){_0x575bc2=this[_0x1395('0x25')];}_0x31020e[_0x1395('0x71')]=0x1;hopperUtils[_0x1395('0x203')](_0x31020e,_0x575bc2)['then'](function(_0x34f4fd){_0x31020e[_0x1395('0x71')]=0x0;if(_0x34f4fd){if(!utils[_0x1395('0x204')](_0x34f4fd)){_0x31020e[_0x1395('0x73')]=utils[_0x1395('0x81')][_0x1395('0x205')];logger[_0x1395('0x53')](_0x1395('0x206')+_0x31020e[_0x1395('0x4f')]);}else{_0x31020e[_0x1395('0x89')]+=_0x34f4fd[_0x1395('0x105')];_0x31020e[_0x1395('0x73')]=utils[_0x1395('0x81')]['RUNNING'];for(var _0xe5183d=0x0;_0xe5183d<_0x34f4fd[_0x1395('0x105')];_0xe5183d+=0x1){_0x31020e[_0x1395('0x207')]+=0x1;if(_[_0x1395('0xff')](_0x34f4fd[_0xe5183d])||_[_0x1395('0xff')](_0x34f4fd[_0xe5183d][_0x1395('0x17b')])||_[_0x1395('0xff')](_0x34f4fd[_0xe5183d]['phone'])){_0x57fd9f[_0x1395('0x15c')](_0x1395('0x208'),_0x31020e,_0x34f4fd[_0xe5183d]);}else{hopperUtils[_0x1395('0x209')](_[_0x1395('0x7f')](_0x34f4fd[_0xe5183d],[_0x1395('0xe7'),_0x1395('0x165')]))[_0x1395('0x47')](_0x57fd9f[_0x1395('0x1ea')](_0x31020e,_0x34f4fd[_0xe5183d]))[_0x1395('0xa9')](_0x57fd9f[_0x1395('0x15b')](_0x1395('0x20a'),_0x31020e));}}}}})[_0x1395('0xa9')](loggerGetContactDialer(_0x1395('0x20b'),_0x31020e,_0x575bc2));}};Dialer[_0x1395('0x1c')][_0x1395('0xbf')]=function(_0x2c6ebe,_0x541200){var _0x169af1=this;var _0x38b802=[];if(_0x541200<0x1||_0x2c6ebe['dialMethod']===_0x1395('0x8')){_0x541200=0x1;}var _0x53b35f=Math[_0x1395('0x1c6')](_0x2c6ebe[_0x1395('0x140')]*_0x541200)-_0x2c6ebe[_0x1395('0x89')];if(_0x2c6ebe[_0x1395('0x20c')]>0x0){var _0x5ca8bb=_0x2c6ebe[_0x1395('0x20c')]-_0x2c6ebe[_0x1395('0x89')]-_0x2c6ebe[_0x1395('0x142')]-_0x2c6ebe[_0x1395('0x143')];if(_0x53b35f>_0x5ca8bb){_0x53b35f=_0x5ca8bb;}}if(_0x53b35f>0x0&&_0x2c6ebe['temp']==0x0){if(_0x2c6ebe[_0x1395('0xbd')]===_0x1395('0x8')){_0x53b35f=0x1;}if(_0x53b35f>this[_0x1395('0x25')]){_0x53b35f=this[_0x1395('0x25')];}for(var _0x1ca329 in this[_0x1395('0x23')]){if(typeof this[_0x1395('0x23')][_0x1ca329]!==_0x1395('0xb4')){if(this[_0x1395('0x23')][_0x1ca329][_0x1395('0x77')]===_0x1395('0x20d')&&this[_0x1395('0x23')][_0x1ca329][_0x1395('0x92')]==='reachable'){_0x38b802[_0x1395('0xa3')](this[_0x1395('0x23')][_0x1ca329]['id']);}}}_0x2c6ebe[_0x1395('0x71')]=0x1;hopperUtils[_0x1395('0x20e')](_0x2c6ebe,_0x38b802,_0x53b35f)['then'](function(_0x312acd){_0x2c6ebe[_0x1395('0x71')]=0x0;if(_0x312acd){if(!utils[_0x1395('0x204')](_0x312acd)){hopperUtils[_0x1395('0x20f')](_0x2c6ebe)[_0x1395('0x47')](sendMessageReschedule(_0x2c6ebe))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x2c6ebe[_0x1395('0x89')]+=_0x312acd[_0x1395('0x105')];_0x2c6ebe[_0x1395('0x73')]=_0x2c6ebe['dialMethod']===_0x1395('0x8')?utils[_0x1395('0x81')][_0x1395('0x144')]:utils[_0x1395('0x81')][_0x1395('0x210')];for(var _0x243d66=0x0;_0x243d66<_0x312acd[_0x1395('0x105')];_0x243d66+=0x1){if(_[_0x1395('0xff')](_0x312acd[_0x243d66])||_['isNil'](_0x312acd[_0x243d66][_0x1395('0x17b')])||_[_0x1395('0xff')](_0x312acd[_0x243d66][_0x1395('0x165')])){_0x169af1[_0x1395('0x15c')](_0x1395('0x208'),_0x2c6ebe,_0x312acd[_0x243d66]);}else{hopperUtils[_0x1395('0x211')](_[_0x1395('0x7f')](_0x312acd[_0x243d66],['VoiceQueueId',_0x1395('0x165')]))['then'](_0x169af1[_0x1395('0x1ea')](_0x2c6ebe,_0x312acd[_0x243d66]))[_0x1395('0xa9')](_0x169af1[_0x1395('0x15b')](_0x1395('0x208'),_0x2c6ebe));}}}}})['catch'](loggerGetContactDialer(_0x1395('0x212'),_0x2c6ebe,_0x53b35f));}};Dialer[_0x1395('0x1c')][_0x1395('0x6d')]=function(_0x99f723){if(_0x99f723['dialLimitQueue']>0x0){var _0x2cc78e=_0x99f723[_0x1395('0x20c')]-_0x99f723[_0x1395('0x89')]-_0x99f723['talking'];if(_0x2cc78e>0x0&&_0x99f723[_0x1395('0x71')]==0x0){this['tryOriginatePredictive'](_0x99f723);}else{loggerPredictiveCalls[_0x1395('0x53')](_0x1395('0x213'));}}else{this['tryOriginatePredictive'](_0x99f723);}};Dialer[_0x1395('0x1c')][_0x1395('0x214')]=function(_0xa8ce07){var _0x1034f2=this;var _0x225606=[];_0xa8ce07['originated']+=0x1;for(var _0x394d5c in this['agents']){if(typeof this[_0x1395('0x23')][_0x394d5c]!=='undefined'){if(this[_0x1395('0x23')][_0x394d5c][_0x1395('0x77')]===_0x1395('0x20d')&&this[_0x1395('0x23')][_0x394d5c][_0x1395('0x92')]===_0x1395('0x93')){_0x225606['push'](this[_0x1395('0x23')][_0x394d5c]['id']);}}}_0xa8ce07[_0x1395('0x71')]=0x1;return this[_0x1395('0x20e')](_0xa8ce07['id'],_0x225606,0x1,_0xa8ce07[_0x1395('0x215')],_0xa8ce07)[_0x1395('0x47')](function(_0x542809){_0xa8ce07[_0x1395('0x71')]=0x1;if(_0x542809){if(!utils['checkContactEmpty'](_0x542809)){utils['checkContactLowerLimitOriginate'](_0xa8ce07,0x1,0x0);return hopperUtils[_0x1395('0x20f')](_0xa8ce07)[_0x1395('0x47')](sendMessageReschedule(_0xa8ce07))[_0x1395('0xa9')](loggerCatch('[countReScheduled]\x20'));}else{_0xa8ce07['message']=utils[_0x1395('0x81')][_0x1395('0x210')];if(_[_0x1395('0xff')](_0x542809[0x0])||_[_0x1395('0xff')](_0x542809[0x0][_0x1395('0x17b')])||_[_0x1395('0xff')](_0x542809[0x0][_0x1395('0x165')])){_0x1034f2[_0x1395('0x15c')](_0x1395('0x208'),_0xa8ce07,_0x542809[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x1395('0x7f')](_0x542809[0x0],[_0x1395('0xe6'),_0x1395('0x165')]))[_0x1395('0x47')](_0x1034f2[_0x1395('0x1ea')](_0xa8ce07,_0x542809[0x0]))[_0x1395('0xa9')](_0x1034f2['loggerHandler']('[actionOriginatePredictive]\x20',_0xa8ce07));}}}})[_0x1395('0xa9')](loggerGetContactDialer(_0x1395('0x216'),_0xa8ce07,0x1));};Dialer[_0x1395('0x1c')][_0x1395('0x1dc')]=function(_0x1791f5,_0x50dc8a,_0x58ed3d,_0xa7dba1,_0x302a6d,_0x31f5d2){loggerPredictive[_0x1395('0x53')](_0x1395('0x217'));loggerPredictive[_0x1395('0x53')](_0x1395('0x218'),_0x1791f5);loggerPredictive['info'](_0x1395('0x219'),_0x50dc8a);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58ed3d);loggerPredictive[_0x1395('0x53')](_0x1395('0x21a'),_0xa7dba1);loggerPredictive[_0x1395('0x53')](_0x1395('0x21b'),_0x302a6d);loggerPredictive[_0x1395('0x53')](_0x1395('0x68'));return new Promise(function(_0xc83667,_0x1188be){if(_0x1791f5<=0x0||isNaN(_0x1791f5)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),_0x1395('0x21d')+_0x1791f5));}if(_0x58ed3d<=0x0||isNaN(_0x58ed3d)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),_0x1395('0x21e')+_0x58ed3d));}if(_0xa7dba1<=0x0||isNaN(_0xa7dba1)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),_0x1395('0x21f')+_0xa7dba1));}if(_0x50dc8a<=0x0||isNaN(_0x50dc8a)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),'interval\x20=\x20'+_0x50dc8a));}if(_0x302a6d<=0x0||isNaN(_0x302a6d)){return _0x1188be(msgResponse(_0x1395('0x21c'),_0x1395('0x8e'),'Amax\x20=\x20'+_0x302a6d));}_0x31f5d2=_0x31f5d2||0x0;var _0x570904=0x1/_0x58ed3d;var _0x5a4b05=0x0;var _0x54bbbf=0x0;var _0x53f3de=0x0;var _0x2c5934=0x0;for(var _0x46b2cf=0x0;_0x53f3de<_0x302a6d;_0x46b2cf+=0x1){_0x54bbbf=_0x46b2cf/_0x50dc8a;_0x5a4b05=(_0xa7dba1*_0x54bbbf+_0x31f5d2)/_0x570904;_0x53f3de=utils[_0x1395('0x220')](_0x5a4b05,_0x1791f5);_0x2c5934=_0x5a4b05/_0x1791f5*(0x1-utils[_0x1395('0x220')](_0x5a4b05,_0x1791f5));}return _0xc83667({'erlangCalls':_0x46b2cf,'erlangCallToSecond':_0x50dc8a/_0x46b2cf,'erlangAbandonmentRate':_0x53f3de,'erlangBusyFactor':_0x2c5934});});};Dialer[_0x1395('0x1c')][_0x1395('0x1dd')]=function(_0x135e92,_0x5347a5,_0x534170,_0x4b3da8,_0x14e3cc,_0x544098){loggerPredictive[_0x1395('0x53')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x1395('0x53')](_0x1395('0x218'),_0x135e92);loggerPredictive[_0x1395('0x53')](_0x1395('0x219'),_0x5347a5);loggerPredictive['info'](_0x1395('0x221'),_0x534170);loggerPredictive[_0x1395('0x53')](_0x1395('0x21a'),_0x4b3da8);loggerPredictive[_0x1395('0x53')](_0x1395('0x222'),_0x14e3cc);loggerPredictive[_0x1395('0x53')](_0x1395('0x68'));return new Promise(function(_0xc5a408,_0x550a5c){if(_0x135e92<=0x0||isNaN(_0x135e92)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x21d')+_0x135e92));}if(_0x534170<=0x0||isNaN(_0x534170)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x21e')+_0x534170));}if(_0x4b3da8<=0x0||isNaN(_0x4b3da8)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x21f')+_0x4b3da8));}if(_0x5347a5<=0x0||isNaN(_0x5347a5)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x224')+_0x5347a5));}if(_0x14e3cc<=0x0||isNaN(_0x14e3cc)){return _0x550a5c(msgResponse(_0x1395('0x223'),_0x1395('0x8e'),_0x1395('0x225')+_0x14e3cc));}_0x544098=_0x544098||0x0;var _0x40d7f4=0x1/_0x534170;var _0x5367e7=0x0;var _0x2b0d5f=0x0;var _0x423f18=0x0;var _0x257d5c=0x0;for(var _0x4c5547=0x0;_0x257d5c<_0x14e3cc;_0x4c5547+=0x1){_0x2b0d5f=_0x4c5547/_0x5347a5;_0x5367e7=(_0x4b3da8*_0x2b0d5f+_0x544098)/_0x40d7f4;_0x423f18=utils[_0x1395('0x220')](_0x5367e7,_0x135e92);_0x257d5c=_0x5367e7/_0x135e92*(0x1-utils[_0x1395('0x220')](_0x5367e7,_0x135e92));}return _0xc5a408({'erlangCalls':_0x4c5547,'erlangCallToSecond':_0x5347a5/_0x4c5547,'erlangAbandonmentRate':_0x423f18,'erlangBusyFactor':_0x257d5c});});};module[_0x1395('0x226')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index f2769ef..8d56cd2 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 _0xa735=['originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','prototype','queue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x30001c,_0x1078f3){var _0x3332fb=function(_0x3476a9){while(--_0x3476a9){_0x30001c['push'](_0x30001c['shift']());}};_0x3332fb(++_0x1078f3);}(_0xa735,0xe3));var _0x5a73=function(_0x42220a,_0x35c311){_0x42220a=_0x42220a-0x0;var _0x5a23ec=_0xa735[_0x42220a];return _0x5a23ec;};'use strict';var util=require(_0x5a73('0x0'));var _=require(_0x5a73('0x1'));var moment=require(_0x5a73('0x2'));function checkNameSurname(_0x156115,_0x4fbb76,_0x556ac3){var _0x51f509='';if(!_[_0x5a73('0x3')](_0x4fbb76)&&_0x5a73('0x4')===typeof _0x4fbb76){_0x51f509+=_0x4fbb76;}if(!_[_0x5a73('0x3')](_0x556ac3)&&'string'===typeof _0x556ac3){_0x51f509+='\x20'+_0x556ac3;}if(_0x51f509!==''){return _0x51f509;}return _0x156115;}function Action(_0x55acf2,_0xe064c8,_0x35b524){this[_0x5a73('0x5')]=_0x55acf2;this[_0x5a73('0x6')]=_0x35b524||undefined;this[_0x5a73('0x7')]=checkNameSurname(_0xe064c8[_0x5a73('0x8')][_0x5a73('0x9')],_0xe064c8['Contact'][_0x5a73('0xa')],_0xe064c8[_0x5a73('0x8')]['lastName']);this[_0x5a73('0xb')]=_0xe064c8['phone'];this['queue']=_0x55acf2[_0x5a73('0x7')];this[_0x5a73('0xc')]=_0xe064c8[_0x5a73('0xc')]||![];this['type']=_0x55acf2['type'];this[_0x5a73('0xd')]=_0x55acf2[_0x5a73('0xd')]||0x3;this[_0x5a73('0xe')]=_0xe064c8[_0x5a73('0xe')];this[_0x5a73('0xf')]=_0xe064c8[_0x5a73('0xf')];this[_0x5a73('0x10')]=_0xe064c8[_0x5a73('0x10')];this[_0x5a73('0x11')]=_0xe064c8['countnoanswerretry'];this[_0x5a73('0x12')]=_0xe064c8[_0x5a73('0x12')];this[_0x5a73('0x13')]=_0xe064c8[_0x5a73('0x13')];this[_0x5a73('0x14')]=_0xe064c8[_0x5a73('0x14')];this[_0x5a73('0x15')]=_0xe064c8[_0x5a73('0x15')];this[_0x5a73('0x16')]=_0xe064c8['countagentrejectretry'];this[_0x5a73('0x17')]=_0xe064c8[_0x5a73('0x17')];this['ListId']=_0xe064c8[_0x5a73('0x18')];this['UserId']=_0xe064c8[_0x5a73('0x19')];this[_0x5a73('0x1a')]=_0xe064c8[_0x5a73('0x1a')];this[_0x5a73('0x1b')]=_0xe064c8['CampaignId'];this[_0x5a73('0x1c')]=_0xe064c8['id'];this[_0x5a73('0x1d')]=_0xe064c8[_0x5a73('0x8')][_0x5a73('0xa')]||'';this['starttime']=moment()[_0x5a73('0x1e')](_0x5a73('0x1f'));this[_0x5a73('0x20')]=_0xe064c8[_0x5a73('0x20')];this[_0x5a73('0x21')]=_0xe064c8['callbackuniqueid'];this[_0x5a73('0x22')]=_0xe064c8[_0x5a73('0x22')];this['recallme']=_0xe064c8[_0x5a73('0x23')];this[_0x5a73('0x24')]='';this[_0x5a73('0x25')]='';}Action['prototype'][_0x5a73('0x26')]=function(){return util[_0x5a73('0x1e')](_0x5a73('0x27'),this['name'],this[_0x5a73('0x5')][_0x5a73('0x28')]>0x0?this['number']['substring'](this[_0x5a73('0x5')][_0x5a73('0x28')]):this['number']);};Action[_0x5a73('0x29')]['getQueue']=function(){return this[_0x5a73('0x2a')];};module[_0x5a73('0x2b')]=Action; \ No newline at end of file +var _0x6201=['exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','queue','name','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue'];(function(_0x2a6d47,_0x581e0d){var _0x3d67c1=function(_0x10a3d0){while(--_0x10a3d0){_0x2a6d47['push'](_0x2a6d47['shift']());}};_0x3d67c1(++_0x581e0d);}(_0x6201,0x1cd));var _0x1620=function(_0x47ed1a,_0x34e1d8){_0x47ed1a=_0x47ed1a-0x0;var _0x23b059=_0x6201[_0x47ed1a];return _0x23b059;};'use strict';var util=require(_0x1620('0x0'));var _=require(_0x1620('0x1'));var moment=require(_0x1620('0x2'));function checkNameSurname(_0x1a513a,_0x21a387,_0x364462){var _0x3f77fc='';if(!_[_0x1620('0x3')](_0x21a387)&&_0x1620('0x4')===typeof _0x21a387){_0x3f77fc+=_0x21a387;}if(!_[_0x1620('0x3')](_0x364462)&&_0x1620('0x4')===typeof _0x364462){_0x3f77fc+='\x20'+_0x364462;}if(_0x3f77fc!==''){return _0x3f77fc;}return _0x1a513a;}function Action(_0x141362,_0x55b90b,_0x449108){this[_0x1620('0x5')]=_0x141362;this[_0x1620('0x6')]=_0x449108||undefined;this['name']=checkNameSurname(_0x55b90b[_0x1620('0x7')][_0x1620('0x8')],_0x55b90b[_0x1620('0x7')][_0x1620('0x9')],_0x55b90b['Contact'][_0x1620('0xa')]);this['number']=_0x55b90b[_0x1620('0x8')];this[_0x1620('0xb')]=_0x141362[_0x1620('0xc')];this['active']=_0x55b90b['active']||![];this[_0x1620('0xd')]=_0x141362[_0x1620('0xd')];this[_0x1620('0xe')]=_0x141362['dialQueueTimeout']||0x3;this[_0x1620('0xf')]=_0x55b90b[_0x1620('0xf')];this['countbusyretry']=_0x55b90b[_0x1620('0x10')];this[_0x1620('0x11')]=_0x55b90b['countcongestionretry'];this[_0x1620('0x12')]=_0x55b90b[_0x1620('0x12')];this['countnosuchnumberretry']=_0x55b90b[_0x1620('0x13')];this['countdropretry']=_0x55b90b['countdropretry'];this[_0x1620('0x14')]=_0x55b90b[_0x1620('0x14')];this[_0x1620('0x15')]=_0x55b90b[_0x1620('0x15')];this['countagentrejectretry']=_0x55b90b[_0x1620('0x16')];this[_0x1620('0x17')]=_0x55b90b['ContactId'];this[_0x1620('0x18')]=_0x55b90b[_0x1620('0x18')];this[_0x1620('0x19')]=_0x55b90b[_0x1620('0x19')];this[_0x1620('0x1a')]=_0x55b90b[_0x1620('0x1a')];this[_0x1620('0x1b')]=_0x55b90b[_0x1620('0x1b')];this[_0x1620('0x1c')]=_0x55b90b['id'];this[_0x1620('0x1d')]=_0x55b90b['Contact']['firstName']||'';this['starttime']=moment()['format'](_0x1620('0x1e'));this[_0x1620('0x1f')]=_0x55b90b[_0x1620('0x1f')];this[_0x1620('0x20')]=_0x55b90b[_0x1620('0x20')];this[_0x1620('0x21')]=_0x55b90b['callbackat'];this[_0x1620('0x22')]=_0x55b90b[_0x1620('0x22')];this[_0x1620('0x23')]='';this[_0x1620('0x24')]='';}Action[_0x1620('0x25')][_0x1620('0x26')]=function(){return util[_0x1620('0x27')](_0x1620('0x28'),this[_0x1620('0xc')],this['voiceQueue'][_0x1620('0x29')]>0x0?this[_0x1620('0x2a')][_0x1620('0x2b')](this['voiceQueue'][_0x1620('0x29')]):this[_0x1620('0x2a')]);};Action['prototype'][_0x1620('0x2c')]=function(){return this[_0x1620('0xb')];};module[_0x1620('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 10c90bf..58117ac 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 _0x0bfd=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','getSeconds','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x24a618,_0x23af9b){var _0x2b8a8b=function(_0x276c60){while(--_0x276c60){_0x24a618['push'](_0x24a618['shift']());}};_0x2b8a8b(++_0x23af9b);}(_0x0bfd,0xa5));var _0xd0bf=function(_0x356da5,_0x36bcb3){_0x356da5=_0x356da5-0x0;var _0x55156f=_0x0bfd[_0x356da5];return _0x55156f;};'use strict';var moment=require(_0xd0bf('0x0'));var utils=require(_0xd0bf('0x1'));function AgentComplete(_0x1df10d,_0xf4d450){this[_0xd0bf('0x2')]=0x4;this[_0xd0bf('0x3')]='Answer';this[_0xd0bf('0x4')]=_0x1df10d[_0xd0bf('0x4')];this['type']=_0x1df10d[_0xd0bf('0x5')];this[_0xd0bf('0x6')]=_0x1df10d[_0xd0bf('0x5')]===_0xd0bf('0x7')?_0xd0bf('0x8'):_0x1df10d[_0xd0bf('0x5')];this[_0xd0bf('0x9')]=_0x1df10d[_0xd0bf('0x9')];this[_0xd0bf('0xa')]=_0x1df10d['countcongestionretry'];this['countnoanswerretry']=_0x1df10d[_0xd0bf('0xb')];this[_0xd0bf('0xc')]=_0x1df10d[_0xd0bf('0x9')]+_0x1df10d[_0xd0bf('0xa')]+_0x1df10d[_0xd0bf('0xb')]+_0x1df10d[_0xd0bf('0xd')]+_0x1df10d[_0xd0bf('0xe')]+_0x1df10d[_0xd0bf('0xf')]+_0x1df10d[_0xd0bf('0x10')]+_0x1df10d[_0xd0bf('0x11')];this[_0xd0bf('0xd')]=_0x1df10d[_0xd0bf('0xd')];this['countdropretry']=_0x1df10d[_0xd0bf('0xe')];this[_0xd0bf('0xf')]=_0x1df10d[_0xd0bf('0xf')];this[_0xd0bf('0x10')]=_0x1df10d[_0xd0bf('0x10')];this[_0xd0bf('0x11')]=_0x1df10d[_0xd0bf('0x11')];this[_0xd0bf('0x12')]=_0xf4d450[_0xd0bf('0x12')];this[_0xd0bf('0x13')]=_0x1df10d['name'];this['calleridnum']=_0x1df10d[_0xd0bf('0x14')];this[_0xd0bf('0x15')]=_0x1df10d[_0xd0bf('0x15')];this[_0xd0bf('0x16')]=_0x1df10d[_0xd0bf('0x16')];this[_0xd0bf('0x17')]=_0x1df10d['answertime'];this['endtime']=moment()[_0xd0bf('0x18')](_0xd0bf('0x19'));this[_0xd0bf('0x1a')]=utils['getSeconds'](_0x1df10d[_0xd0bf('0x16')],_0x1df10d['starttime']);this[_0xd0bf('0x1b')]=utils[_0xd0bf('0x1c')](_0x1df10d[_0xd0bf('0x17')],_0x1df10d[_0xd0bf('0x16')]);this['talktime']=utils[_0xd0bf('0x1c')](this[_0xd0bf('0x1d')],_0x1df10d['answertime']);this['queue']=_0xf4d450['queue'];this[_0xd0bf('0x1e')]=_0xf4d450[_0xd0bf('0x1e')];this['reason']=_0xf4d450[_0xd0bf('0x1f')];this[_0xd0bf('0x20')]=_0x1df10d[_0xd0bf('0x20')];this[_0xd0bf('0x21')]=_0x1df10d['callbackuniqueid'];this[_0xd0bf('0x22')]=_0x1df10d['callbackat'];this[_0xd0bf('0x23')]=_0x1df10d[_0xd0bf('0x23')];this['ContactId']=_0x1df10d[_0xd0bf('0x24')];this['ListId']=_0x1df10d[_0xd0bf('0x25')];this[_0xd0bf('0x26')]=_0x1df10d[_0xd0bf('0x26')];this[_0xd0bf('0x27')]=_0x1df10d[_0xd0bf('0x27')];this[_0xd0bf('0x28')]=_0x1df10d['CampaignId'];this[_0xd0bf('0x29')]=_0x1df10d['originatecalleridnum']||'';this[_0xd0bf('0x2a')]=_0x1df10d[_0xd0bf('0x2a')]||'';this[_0xd0bf('0x2b')]=_0x1df10d[_0xd0bf('0x2b')];}module['exports']=AgentComplete; \ No newline at end of file +var _0x0f6e=['Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc'];(function(_0x3022da,_0x127ee2){var _0x4641bf=function(_0x19680e){while(--_0x19680e){_0x3022da['push'](_0x3022da['shift']());}};_0x4641bf(++_0x127ee2);}(_0x0f6e,0x14d));var _0xe0f6=function(_0x40675d,_0xd7fa27){_0x40675d=_0x40675d-0x0;var _0x2842ae=_0x0f6e[_0x40675d];return _0x2842ae;};'use strict';var moment=require(_0xe0f6('0x0'));var utils=require(_0xe0f6('0x1'));function AgentComplete(_0x1aebff,_0x118107){this['state']=0x4;this[_0xe0f6('0x2')]=_0xe0f6('0x3');this[_0xe0f6('0x4')]=_0x1aebff['scheduledat'];this[_0xe0f6('0x5')]=_0x1aebff[_0xe0f6('0x5')];this[_0xe0f6('0x6')]=_0x1aebff['type']===_0xe0f6('0x7')?'queue':_0x1aebff[_0xe0f6('0x5')];this[_0xe0f6('0x8')]=_0x1aebff[_0xe0f6('0x8')];this[_0xe0f6('0x9')]=_0x1aebff[_0xe0f6('0x9')];this[_0xe0f6('0xa')]=_0x1aebff[_0xe0f6('0xa')];this[_0xe0f6('0xb')]=_0x1aebff[_0xe0f6('0x8')]+_0x1aebff[_0xe0f6('0x9')]+_0x1aebff[_0xe0f6('0xa')]+_0x1aebff[_0xe0f6('0xc')]+_0x1aebff[_0xe0f6('0xd')]+_0x1aebff[_0xe0f6('0xe')]+_0x1aebff[_0xe0f6('0xf')]+_0x1aebff[_0xe0f6('0x10')];this[_0xe0f6('0xc')]=_0x1aebff[_0xe0f6('0xc')];this[_0xe0f6('0xd')]=_0x1aebff['countdropretry'];this[_0xe0f6('0xe')]=_0x1aebff['countabandonedretry'];this[_0xe0f6('0xf')]=_0x1aebff[_0xe0f6('0xf')];this[_0xe0f6('0x10')]=_0x1aebff[_0xe0f6('0x10')];this[_0xe0f6('0x11')]=_0x118107[_0xe0f6('0x11')];this[_0xe0f6('0x12')]=_0x1aebff[_0xe0f6('0x13')];this[_0xe0f6('0x14')]=_0x1aebff[_0xe0f6('0x15')];this['starttime']=_0x1aebff[_0xe0f6('0x16')];this['responsetime']=_0x1aebff[_0xe0f6('0x17')];this[_0xe0f6('0x18')]=_0x1aebff[_0xe0f6('0x18')];this[_0xe0f6('0x19')]=moment()[_0xe0f6('0x1a')](_0xe0f6('0x1b'));this[_0xe0f6('0x1c')]=utils[_0xe0f6('0x1d')](_0x1aebff[_0xe0f6('0x17')],_0x1aebff[_0xe0f6('0x16')]);this[_0xe0f6('0x1e')]=utils[_0xe0f6('0x1d')](_0x1aebff[_0xe0f6('0x18')],_0x1aebff[_0xe0f6('0x17')]);this[_0xe0f6('0x1f')]=utils[_0xe0f6('0x1d')](this['endtime'],_0x1aebff['answertime']);this[_0xe0f6('0x20')]=_0x118107[_0xe0f6('0x20')];this[_0xe0f6('0x21')]=_0x118107[_0xe0f6('0x21')];this[_0xe0f6('0x22')]=_0x118107[_0xe0f6('0x22')];this[_0xe0f6('0x23')]=_0x1aebff['callback'];this[_0xe0f6('0x24')]=_0x1aebff[_0xe0f6('0x24')];this[_0xe0f6('0x25')]=_0x1aebff[_0xe0f6('0x25')];this[_0xe0f6('0x26')]=_0x1aebff[_0xe0f6('0x26')];this['ContactId']=_0x1aebff[_0xe0f6('0x27')];this[_0xe0f6('0x28')]=_0x1aebff[_0xe0f6('0x28')];this[_0xe0f6('0x29')]=_0x1aebff[_0xe0f6('0x29')];this[_0xe0f6('0x2a')]=_0x1aebff[_0xe0f6('0x2a')];this[_0xe0f6('0x2b')]=_0x1aebff[_0xe0f6('0x2b')];this[_0xe0f6('0x2c')]=_0x1aebff[_0xe0f6('0x2c')]||'';this[_0xe0f6('0x2d')]=_0x1aebff[_0xe0f6('0x2d')]||'';this[_0xe0f6('0x2e')]=_0x1aebff['agiafterat'];}module[_0xe0f6('0x2f')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 712eac0..4b9011f 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 _0x695b=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x695b,0xe8));var _0xb695=function(_0x3d43ed,_0x53866c){_0x3d43ed=_0x3d43ed-0x0;var _0x3ce1ad=_0x695b[_0x3d43ed];return _0x3ce1ad;};'use strict';function Final(_0x4097bd){this[_0xb695('0x0')]=_0x4097bd[_0xb695('0x0')];this[_0xb695('0x1')]=_0x4097bd[_0xb695('0x1')];this[_0xb695('0x2')]=_0x4097bd[_0xb695('0x2')];this[_0xb695('0x3')]=_0x4097bd[_0xb695('0x2')]===_0xb695('0x4')?_0xb695('0x5'):_0x4097bd[_0xb695('0x2')];this[_0xb695('0x6')]=_0x4097bd[_0xb695('0x6')];this[_0xb695('0x7')]=_0x4097bd[_0xb695('0x7')];this[_0xb695('0x8')]=_0x4097bd['countnoanswerretry'];this[_0xb695('0x9')]=_0x4097bd['countbusyretry']+_0x4097bd[_0xb695('0x7')]+_0x4097bd[_0xb695('0x8')]+_0x4097bd[_0xb695('0xa')]+_0x4097bd[_0xb695('0xb')]+_0x4097bd['countabandonedretry']+_0x4097bd[_0xb695('0xc')]+_0x4097bd[_0xb695('0xd')];this['countnosuchnumberretry']=_0x4097bd['countnosuchnumberretry'];this[_0xb695('0xb')]=_0x4097bd['countdropretry'];this[_0xb695('0xe')]=_0x4097bd[_0xb695('0xe')];this['countmachineretry']=_0x4097bd['countmachineretry'];this[_0xb695('0xd')]=_0x4097bd[_0xb695('0xd')];this[_0xb695('0x5')]=_0x4097bd[_0xb695('0x5')];this[_0xb695('0xf')]=_0x4097bd[_0xb695('0xf')];this['calleridnum']=_0x4097bd['calleridnum'];this['starttime']=_0x4097bd['starttime'];this[_0xb695('0x10')]=_0x4097bd[_0xb695('0x10')];this[_0xb695('0x11')]=_0x4097bd[_0xb695('0x10')];this[_0xb695('0x12')]=_0x4097bd[_0xb695('0x12')]||0x0;this[_0xb695('0x13')]=_0x4097bd['holdtime']||0x0;this[_0xb695('0x14')]=_0x4097bd[_0xb695('0x14')]||0x0;this['callback']=_0x4097bd['callback'];this[_0xb695('0x15')]=_0x4097bd[_0xb695('0x15')];this[_0xb695('0x16')]=_0x4097bd['callbackat'];this[_0xb695('0x17')]=_0x4097bd['recallme'];this[_0xb695('0x18')]=_0x4097bd[_0xb695('0x18')];this[_0xb695('0x19')]=_0x4097bd[_0xb695('0x19')];this[_0xb695('0x1a')]=_0x4097bd['UserId'];this['VoiceQueueId']=_0x4097bd[_0xb695('0x1b')];this[_0xb695('0x1c')]=_0x4097bd['CampaignId'];this[_0xb695('0x1d')]=_0x4097bd[_0xb695('0x1d')]||'';this[_0xb695('0x1e')]=_0x4097bd['originatecalleridname']||'';this['state']=_0x4097bd[_0xb695('0x1f')];this[_0xb695('0x20')]=_0x4097bd['statedesc'];}module[_0xb695('0x21')]=Final; \ No newline at end of file +var _0x5947=['uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports'];(function(_0x44b912,_0x1e9fc1){var _0x49f5a2=function(_0x286d35){while(--_0x286d35){_0x44b912['push'](_0x44b912['shift']());}};_0x49f5a2(++_0x1e9fc1);}(_0x5947,0x69));var _0x7594=function(_0x3bcfc9,_0x3ca88f){_0x3bcfc9=_0x3bcfc9-0x0;var _0x31b21b=_0x5947[_0x3bcfc9];return _0x31b21b;};'use strict';function Final(_0x5adc01){this[_0x7594('0x0')]=_0x5adc01[_0x7594('0x0')];this[_0x7594('0x1')]=_0x5adc01['scheduledat'];this[_0x7594('0x2')]=_0x5adc01[_0x7594('0x2')];this[_0x7594('0x3')]=_0x5adc01[_0x7594('0x2')]==='outbound'?'queue':_0x5adc01[_0x7594('0x2')];this[_0x7594('0x4')]=_0x5adc01[_0x7594('0x4')];this['countcongestionretry']=_0x5adc01[_0x7594('0x5')];this['countnoanswerretry']=_0x5adc01[_0x7594('0x6')];this[_0x7594('0x7')]=_0x5adc01[_0x7594('0x4')]+_0x5adc01[_0x7594('0x5')]+_0x5adc01[_0x7594('0x6')]+_0x5adc01[_0x7594('0x8')]+_0x5adc01[_0x7594('0x9')]+_0x5adc01[_0x7594('0xa')]+_0x5adc01[_0x7594('0xb')]+_0x5adc01[_0x7594('0xc')];this[_0x7594('0x8')]=_0x5adc01['countnosuchnumberretry'];this[_0x7594('0x9')]=_0x5adc01[_0x7594('0x9')];this['countabandonedretry']=_0x5adc01['countabandonedretry'];this[_0x7594('0xb')]=_0x5adc01['countmachineretry'];this[_0x7594('0xc')]=_0x5adc01[_0x7594('0xc')];this['queue']=_0x5adc01[_0x7594('0xd')];this['calleridname']=_0x5adc01[_0x7594('0xe')];this['calleridnum']=_0x5adc01[_0x7594('0xf')];this[_0x7594('0x10')]=_0x5adc01['starttime'];this[_0x7594('0x11')]=_0x5adc01[_0x7594('0x11')];this[_0x7594('0x12')]=_0x5adc01[_0x7594('0x11')];this['ringtime']=_0x5adc01['ringtime']||0x0;this[_0x7594('0x13')]=_0x5adc01['holdtime']||0x0;this['talktime']=_0x5adc01[_0x7594('0x14')]||0x0;this[_0x7594('0x15')]=_0x5adc01[_0x7594('0x15')];this[_0x7594('0x16')]=_0x5adc01['callbackuniqueid'];this[_0x7594('0x17')]=_0x5adc01[_0x7594('0x17')];this[_0x7594('0x18')]=_0x5adc01['recallme'];this[_0x7594('0x19')]=_0x5adc01[_0x7594('0x19')];this[_0x7594('0x1a')]=_0x5adc01[_0x7594('0x1a')];this[_0x7594('0x1b')]=_0x5adc01[_0x7594('0x1b')];this[_0x7594('0x1c')]=_0x5adc01['VoiceQueueId'];this[_0x7594('0x1d')]=_0x5adc01[_0x7594('0x1d')];this['originatecalleridnum']=_0x5adc01[_0x7594('0x1e')]||'';this[_0x7594('0x1f')]=_0x5adc01[_0x7594('0x1f')]||'';this[_0x7594('0x20')]=_0x5adc01['state'];this['statedesc']=_0x5adc01[_0x7594('0x21')];}module[_0x7594('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index d94e92f..6307bdf 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 _0x153a=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime'];(function(_0x470814,_0x2efd95){var _0x5a7ea1=function(_0x39e19a){while(--_0x39e19a){_0x470814['push'](_0x470814['shift']());}};_0x5a7ea1(++_0x2efd95);}(_0x153a,0x172));var _0xa153=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x153a[_0x819464];return _0x49dcc0;};'use strict';var moment=require(_0xa153('0x0'));var utils=require(_0xa153('0x1'));function Hangup(_0x2f3152,_0x102340){this[_0xa153('0x2')]=0x4;this[_0xa153('0x3')]=_0xa153('0x4');this[_0xa153('0x5')]=_0x2f3152[_0xa153('0x5')];this[_0xa153('0x6')]=_0x2f3152[_0xa153('0x6')];this[_0xa153('0x7')]=_0x2f3152['type']===_0xa153('0x8')?_0xa153('0x9'):_0x2f3152[_0xa153('0x6')];this[_0xa153('0xa')]=_0x2f3152['amd']||![];this['countbusyretry']=_0x2f3152['countbusyretry'];this[_0xa153('0xb')]=_0x2f3152[_0xa153('0xb')];this[_0xa153('0xc')]=_0x2f3152['countnoanswerretry'];this[_0xa153('0xd')]=_0x2f3152[_0xa153('0xe')]+_0x2f3152[_0xa153('0xb')]+_0x2f3152[_0xa153('0xc')]+_0x2f3152[_0xa153('0xf')]+_0x2f3152[_0xa153('0x10')]+_0x2f3152[_0xa153('0x11')]+_0x2f3152[_0xa153('0x12')]+_0x2f3152['countagentrejectretry'];this[_0xa153('0xf')]=_0x2f3152[_0xa153('0xf')];this[_0xa153('0x10')]=_0x2f3152[_0xa153('0x10')];this[_0xa153('0x11')]=_0x2f3152[_0xa153('0x11')];this['countmachineretry']=_0x2f3152['countmachineretry'];this[_0xa153('0x13')]=_0x2f3152[_0xa153('0x13')];this[_0xa153('0x14')]=_0x102340[_0xa153('0x14')];this[_0xa153('0x15')]=_0x2f3152[_0xa153('0x16')];this['calleridnum']=_0x2f3152[_0xa153('0x17')];this['starttime']=_0x2f3152[_0xa153('0x18')];this[_0xa153('0x19')]=_0x2f3152[_0xa153('0x19')];this[_0xa153('0x1a')]=moment()[_0xa153('0x1b')](_0xa153('0x1c'));this[_0xa153('0x1d')]=utils[_0xa153('0x1e')](_0x2f3152[_0xa153('0x19')],_0x2f3152['starttime']);this[_0xa153('0x1f')]=0x0;this[_0xa153('0x20')]=utils[_0xa153('0x1e')](this[_0xa153('0x1a')],_0x2f3152[_0xa153('0x19')]);this[_0xa153('0x9')]=_0x2f3152['queue'];this['membername']=_0xa153('0x21');this[_0xa153('0x22')]=_0x102340[_0xa153('0x23')];this['callback']=_0x2f3152[_0xa153('0x24')];this[_0xa153('0x25')]=_0x2f3152[_0xa153('0x25')];this[_0xa153('0x26')]=_0x2f3152[_0xa153('0x26')];this[_0xa153('0x27')]=_0x2f3152[_0xa153('0x27')];this[_0xa153('0x28')]=_0x2f3152['ContactId'];this[_0xa153('0x29')]=_0x2f3152['ListId'];this['UserId']=_0x2f3152['UserId'];this[_0xa153('0x2a')]=_0x2f3152[_0xa153('0x2a')];this[_0xa153('0x2b')]=_0x2f3152[_0xa153('0x2b')];}module['exports']=Hangup; \ No newline at end of file +var _0x0663=['uniqueid','name','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry'];(function(_0x53e3c2,_0x90a8fd){var _0x10aa40=function(_0x535ead){while(--_0x535ead){_0x53e3c2['push'](_0x53e3c2['shift']());}};_0x10aa40(++_0x90a8fd);}(_0x0663,0xea));var _0x3066=function(_0x293150,_0x3bec15){_0x293150=_0x293150-0x0;var _0x38cae7=_0x0663[_0x293150];return _0x38cae7;};'use strict';var moment=require(_0x3066('0x0'));var utils=require(_0x3066('0x1'));function Hangup(_0x492e00,_0x4a073f){this[_0x3066('0x2')]=0x4;this[_0x3066('0x3')]=_0x3066('0x4');this[_0x3066('0x5')]=_0x492e00[_0x3066('0x5')];this['type']=_0x492e00[_0x3066('0x6')];this['campaigntype']=_0x492e00[_0x3066('0x6')]===_0x3066('0x7')?_0x3066('0x8'):_0x492e00['type'];this[_0x3066('0x9')]=_0x492e00['amd']||![];this[_0x3066('0xa')]=_0x492e00[_0x3066('0xa')];this[_0x3066('0xb')]=_0x492e00['countcongestionretry'];this['countnoanswerretry']=_0x492e00[_0x3066('0xc')];this['countglobal']=_0x492e00['countbusyretry']+_0x492e00[_0x3066('0xb')]+_0x492e00[_0x3066('0xc')]+_0x492e00['countnosuchnumberretry']+_0x492e00[_0x3066('0xd')]+_0x492e00[_0x3066('0xe')]+_0x492e00['countmachineretry']+_0x492e00[_0x3066('0xf')];this['countnosuchnumberretry']=_0x492e00[_0x3066('0x10')];this[_0x3066('0xd')]=_0x492e00[_0x3066('0xd')];this['countabandonedretry']=_0x492e00[_0x3066('0xe')];this[_0x3066('0x11')]=_0x492e00[_0x3066('0x11')];this[_0x3066('0xf')]=_0x492e00[_0x3066('0xf')];this[_0x3066('0x12')]=_0x4a073f[_0x3066('0x12')];this['calleridname']=_0x492e00[_0x3066('0x13')];this['calleridnum']=_0x492e00[_0x3066('0x14')];this[_0x3066('0x15')]=_0x492e00[_0x3066('0x15')];this[_0x3066('0x16')]=_0x492e00['responsetime'];this['endtime']=moment()[_0x3066('0x17')](_0x3066('0x18'));this[_0x3066('0x19')]=utils[_0x3066('0x1a')](_0x492e00[_0x3066('0x16')],_0x492e00[_0x3066('0x15')]);this[_0x3066('0x1b')]=0x0;this[_0x3066('0x1c')]=utils[_0x3066('0x1a')](this[_0x3066('0x1d')],_0x492e00['responsetime']);this[_0x3066('0x8')]=_0x492e00[_0x3066('0x8')];this['membername']=_0x3066('0x1e');this[_0x3066('0x1f')]=_0x4a073f[_0x3066('0x20')];this[_0x3066('0x21')]=_0x492e00[_0x3066('0x21')];this[_0x3066('0x22')]=_0x492e00[_0x3066('0x22')];this[_0x3066('0x23')]=_0x492e00[_0x3066('0x23')];this['recallme']=_0x492e00['recallme'];this['ContactId']=_0x492e00[_0x3066('0x24')];this[_0x3066('0x25')]=_0x492e00[_0x3066('0x25')];this[_0x3066('0x26')]=_0x492e00[_0x3066('0x26')];this[_0x3066('0x27')]=_0x492e00['VoiceQueueId'];this[_0x3066('0x28')]=_0x492e00[_0x3066('0x28')];}module[_0x3066('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 9286e7e..0bc02d1 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 _0x76e8=['uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils'];(function(_0x36f3e3,_0x5e14e0){var _0x134ca9=function(_0x73c3a1){while(--_0x73c3a1){_0x36f3e3['push'](_0x36f3e3['shift']());}};_0x134ca9(++_0x5e14e0);}(_0x76e8,0x77));var _0x876e=function(_0x1b7917,_0x592c32){_0x1b7917=_0x1b7917-0x0;var _0x43fd57=_0x76e8[_0x1b7917];return _0x43fd57;};'use strict';var utils=require(_0x876e('0x0'));function History(_0x28e5e2){this[_0x876e('0x1')]=_0x28e5e2['uniqueid'];this[_0x876e('0x2')]=_0x28e5e2[_0x876e('0x2')]||undefined;this[_0x876e('0x3')]=_0x28e5e2[_0x876e('0x3')];this[_0x876e('0x4')]=_0x28e5e2[_0x876e('0x3')]===_0x876e('0x5')?_0x876e('0x6'):_0x28e5e2[_0x876e('0x3')];this[_0x876e('0x7')]=_0x28e5e2[_0x876e('0x7')];this[_0x876e('0x8')]=_0x28e5e2[_0x876e('0x8')];this[_0x876e('0x9')]=_0x28e5e2[_0x876e('0x9')];this[_0x876e('0xa')]=_0x28e5e2[_0x876e('0x7')]+_0x28e5e2[_0x876e('0x8')]+_0x28e5e2[_0x876e('0x9')]+_0x28e5e2[_0x876e('0xb')]+_0x28e5e2[_0x876e('0xc')]+_0x28e5e2[_0x876e('0xd')]+_0x28e5e2['countmachineretry']+_0x28e5e2[_0x876e('0xe')];this['countnosuchnumberretry']=_0x28e5e2[_0x876e('0xb')];this['countdropretry']=_0x28e5e2[_0x876e('0xc')];this[_0x876e('0xd')]=_0x28e5e2['countabandonedretry'];this[_0x876e('0xf')]=_0x28e5e2[_0x876e('0xf')];this[_0x876e('0xe')]=_0x28e5e2[_0x876e('0xe')];this['queue']=_0x28e5e2[_0x876e('0x6')];this[_0x876e('0x10')]=_0x28e5e2[_0x876e('0x11')];this[_0x876e('0x12')]=_0x28e5e2[_0x876e('0x13')];this[_0x876e('0x14')]=_0x28e5e2[_0x876e('0x14')];this[_0x876e('0x15')]=_0x28e5e2[_0x876e('0x15')];this[_0x876e('0x16')]=_0x28e5e2[_0x876e('0x15')];this[_0x876e('0x17')]=utils[_0x876e('0x18')](_0x28e5e2['responsetime'],_0x28e5e2[_0x876e('0x14')]);this[_0x876e('0x19')]=0x0;this[_0x876e('0x1a')]=0x0;this[_0x876e('0x1b')]=_0x28e5e2[_0x876e('0x1b')];this[_0x876e('0x1c')]=_0x28e5e2[_0x876e('0x1c')];this[_0x876e('0x1d')]=_0x28e5e2[_0x876e('0x1d')];this[_0x876e('0x1e')]=_0x28e5e2[_0x876e('0x1e')];this[_0x876e('0x1f')]=_0x28e5e2['ContactId'];this['ListId']=_0x28e5e2['ListId'];this[_0x876e('0x20')]=_0x28e5e2[_0x876e('0x20')];this['VoiceQueueId']=_0x28e5e2[_0x876e('0x21')];this[_0x876e('0x22')]=_0x28e5e2[_0x876e('0x22')];this[_0x876e('0x23')]=_0x28e5e2['originatecalleridnum']||'';this[_0x876e('0x24')]=_0x28e5e2[_0x876e('0x24')]||'';this[_0x876e('0x25')]=_0x28e5e2['state'];this[_0x876e('0x26')]=_0x28e5e2['statedesc'];}module[_0x876e('0x27')]=History; \ No newline at end of file +var _0x1bcc=['state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x96fb3a,_0x392e22){var _0x268e4f=function(_0x95cbfd){while(--_0x95cbfd){_0x96fb3a['push'](_0x96fb3a['shift']());}};_0x268e4f(++_0x392e22);}(_0x1bcc,0x16a));var _0xc1bc=function(_0x741427,_0x21fe4c){_0x741427=_0x741427-0x0;var _0x5e0a59=_0x1bcc[_0x741427];return _0x5e0a59;};'use strict';var utils=require(_0xc1bc('0x0'));function History(_0x5dd23e){this[_0xc1bc('0x1')]=_0x5dd23e[_0xc1bc('0x1')];this[_0xc1bc('0x2')]=_0x5dd23e[_0xc1bc('0x2')]||undefined;this[_0xc1bc('0x3')]=_0x5dd23e[_0xc1bc('0x3')];this[_0xc1bc('0x4')]=_0x5dd23e['type']==='outbound'?'queue':_0x5dd23e[_0xc1bc('0x3')];this[_0xc1bc('0x5')]=_0x5dd23e['countbusyretry'];this[_0xc1bc('0x6')]=_0x5dd23e[_0xc1bc('0x6')];this[_0xc1bc('0x7')]=_0x5dd23e[_0xc1bc('0x7')];this['countglobal']=_0x5dd23e[_0xc1bc('0x5')]+_0x5dd23e[_0xc1bc('0x6')]+_0x5dd23e['countnoanswerretry']+_0x5dd23e[_0xc1bc('0x8')]+_0x5dd23e[_0xc1bc('0x9')]+_0x5dd23e['countabandonedretry']+_0x5dd23e[_0xc1bc('0xa')]+_0x5dd23e[_0xc1bc('0xb')];this['countnosuchnumberretry']=_0x5dd23e[_0xc1bc('0x8')];this[_0xc1bc('0x9')]=_0x5dd23e[_0xc1bc('0x9')];this['countabandonedretry']=_0x5dd23e[_0xc1bc('0xc')];this[_0xc1bc('0xa')]=_0x5dd23e[_0xc1bc('0xa')];this[_0xc1bc('0xb')]=_0x5dd23e[_0xc1bc('0xb')];this[_0xc1bc('0xd')]=_0x5dd23e['queue'];this[_0xc1bc('0xe')]=_0x5dd23e[_0xc1bc('0xf')];this[_0xc1bc('0x10')]=_0x5dd23e['number'];this[_0xc1bc('0x11')]=_0x5dd23e[_0xc1bc('0x11')];this[_0xc1bc('0x12')]=_0x5dd23e[_0xc1bc('0x12')];this[_0xc1bc('0x13')]=_0x5dd23e[_0xc1bc('0x12')];this[_0xc1bc('0x14')]=utils[_0xc1bc('0x15')](_0x5dd23e['responsetime'],_0x5dd23e[_0xc1bc('0x11')]);this[_0xc1bc('0x16')]=0x0;this[_0xc1bc('0x17')]=0x0;this[_0xc1bc('0x18')]=_0x5dd23e[_0xc1bc('0x18')];this['callbackuniqueid']=_0x5dd23e[_0xc1bc('0x19')];this['callbackat']=_0x5dd23e[_0xc1bc('0x1a')];this[_0xc1bc('0x1b')]=_0x5dd23e[_0xc1bc('0x1b')];this[_0xc1bc('0x1c')]=_0x5dd23e[_0xc1bc('0x1c')];this[_0xc1bc('0x1d')]=_0x5dd23e['ListId'];this[_0xc1bc('0x1e')]=_0x5dd23e[_0xc1bc('0x1e')];this['VoiceQueueId']=_0x5dd23e['VoiceQueueId'];this['CampaignId']=_0x5dd23e[_0xc1bc('0x1f')];this[_0xc1bc('0x20')]=_0x5dd23e['originatecalleridnum']||'';this['originatecalleridname']=_0x5dd23e[_0xc1bc('0x21')]||'';this[_0xc1bc('0x22')]=_0x5dd23e[_0xc1bc('0x22')];this['statedesc']=_0x5dd23e[_0xc1bc('0x23')];}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index cd05cd2..489b66b 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 _0xc931=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','droptime','dropreason','ringtime','getSeconds','responsetime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x5e6515,_0x2954b1){var _0xd33ce2=function(_0x5ce7ea){while(--_0x5ce7ea){_0x5e6515['push'](_0x5e6515['shift']());}};_0xd33ce2(++_0x2954b1);}(_0xc931,0x19c));var _0x1c93=function(_0x550350,_0x4cb095){_0x550350=_0x550350-0x0;var _0x1e7082=_0xc931[_0x550350];return _0x1e7082;};'use strict';var utils=require(_0x1c93('0x0'));function QueueCallerAbandon(_0x2bd1b7,_0x54da8d){this[_0x1c93('0x1')]=_0x2bd1b7[_0x1c93('0x1')];this[_0x1c93('0x2')]=_0x2bd1b7[_0x1c93('0x2')];this[_0x1c93('0x3')]=_0x2bd1b7[_0x1c93('0x2')]===_0x1c93('0x4')?_0x1c93('0x5'):_0x2bd1b7[_0x1c93('0x2')];this['countbusyretry']=_0x2bd1b7[_0x1c93('0x6')];this[_0x1c93('0x7')]=_0x2bd1b7[_0x1c93('0x7')];this['countnoanswerretry']=_0x2bd1b7[_0x1c93('0x8')];this[_0x1c93('0x9')]=_0x2bd1b7[_0x1c93('0x6')]+_0x2bd1b7[_0x1c93('0x7')]+_0x2bd1b7[_0x1c93('0x8')]+_0x2bd1b7[_0x1c93('0xa')]+_0x2bd1b7['countdropretry']+_0x2bd1b7[_0x1c93('0xb')]+_0x2bd1b7['countmachineretry']+_0x2bd1b7['countagentrejectretry'];this['countnosuchnumberretry']=_0x2bd1b7['countnosuchnumberretry'];this[_0x1c93('0xc')]=_0x2bd1b7[_0x1c93('0xc')];this[_0x1c93('0xb')]=_0x2bd1b7[_0x1c93('0xb')];this['countmachineretry']=_0x2bd1b7[_0x1c93('0xd')];this[_0x1c93('0xe')]=_0x2bd1b7[_0x1c93('0xe')];this['uniqueid']=_0x54da8d[_0x1c93('0xf')];this[_0x1c93('0x10')]=_0x2bd1b7[_0x1c93('0x11')];this[_0x1c93('0x12')]=_0x2bd1b7[_0x1c93('0x13')];this[_0x1c93('0x14')]=_0x2bd1b7[_0x1c93('0x14')];this['responsetime']=_0x2bd1b7['responsetime'];this[_0x1c93('0x15')]=_0x2bd1b7[_0x1c93('0x15')];this[_0x1c93('0x16')]=_0x2bd1b7[_0x1c93('0x16')];this['endtime']=this['droptime'];this[_0x1c93('0x17')]=utils[_0x1c93('0x18')](_0x2bd1b7[_0x1c93('0x19')],_0x2bd1b7[_0x1c93('0x14')]);this[_0x1c93('0x1a')]=utils[_0x1c93('0x18')](this['droptime'],_0x2bd1b7['responsetime']);this['talktime']=0x0;this['queue']=_0x54da8d[_0x1c93('0x5')];this[_0x1c93('0x1b')]=_0x54da8d[_0x1c93('0x1c')];this[_0x1c93('0x1d')]=_0x54da8d[_0x1c93('0x1d')];this[_0x1c93('0x1e')]=_0x2bd1b7[_0x1c93('0x1e')];this[_0x1c93('0x1f')]=_0x2bd1b7[_0x1c93('0x1f')];this[_0x1c93('0x20')]=_0x2bd1b7[_0x1c93('0x20')];this[_0x1c93('0x21')]=_0x2bd1b7[_0x1c93('0x21')];this[_0x1c93('0x22')]=_0x2bd1b7[_0x1c93('0x22')];this['ListId']=_0x2bd1b7[_0x1c93('0x23')];this[_0x1c93('0x24')]=_0x2bd1b7['UserId'];this[_0x1c93('0x25')]=_0x2bd1b7[_0x1c93('0x25')];this[_0x1c93('0x26')]=_0x2bd1b7[_0x1c93('0x26')];this[_0x1c93('0x27')]=_0x2bd1b7[_0x1c93('0x27')]||'';this[_0x1c93('0x28')]=_0x2bd1b7[_0x1c93('0x28')]||'';this[_0x1c93('0x29')]=_0x2bd1b7[_0x1c93('0x29')];this['state']=_0x2bd1b7[_0x1c93('0x2a')];this['statedesc']=_0x2bd1b7[_0x1c93('0x2b')];}module[_0x1c93('0x2c')]=QueueCallerAbandon; \ No newline at end of file +var _0xdb03=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','agiafterat','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','holdtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackat'];(function(_0x71f648,_0x19654f){var _0x56203f=function(_0x5c25e0){while(--_0x5c25e0){_0x71f648['push'](_0x71f648['shift']());}};_0x56203f(++_0x19654f);}(_0xdb03,0x1cc));var _0x3db0=function(_0x185d52,_0x376ade){_0x185d52=_0x185d52-0x0;var _0x4f8cf7=_0xdb03[_0x185d52];return _0x4f8cf7;};'use strict';var utils=require(_0x3db0('0x0'));function QueueCallerAbandon(_0x575dc0,_0x236c69){this[_0x3db0('0x1')]=_0x575dc0[_0x3db0('0x1')];this[_0x3db0('0x2')]=_0x575dc0['type'];this['campaigntype']=_0x575dc0[_0x3db0('0x2')]===_0x3db0('0x3')?_0x3db0('0x4'):_0x575dc0[_0x3db0('0x2')];this[_0x3db0('0x5')]=_0x575dc0['countbusyretry'];this[_0x3db0('0x6')]=_0x575dc0[_0x3db0('0x6')];this[_0x3db0('0x7')]=_0x575dc0[_0x3db0('0x7')];this[_0x3db0('0x8')]=_0x575dc0[_0x3db0('0x5')]+_0x575dc0[_0x3db0('0x6')]+_0x575dc0[_0x3db0('0x7')]+_0x575dc0['countnosuchnumberretry']+_0x575dc0[_0x3db0('0x9')]+_0x575dc0[_0x3db0('0xa')]+_0x575dc0['countmachineretry']+_0x575dc0[_0x3db0('0xb')];this[_0x3db0('0xc')]=_0x575dc0[_0x3db0('0xc')];this[_0x3db0('0x9')]=_0x575dc0[_0x3db0('0x9')];this[_0x3db0('0xa')]=_0x575dc0[_0x3db0('0xa')];this[_0x3db0('0xd')]=_0x575dc0['countmachineretry'];this[_0x3db0('0xb')]=_0x575dc0[_0x3db0('0xb')];this[_0x3db0('0xe')]=_0x236c69[_0x3db0('0xe')];this[_0x3db0('0xf')]=_0x575dc0[_0x3db0('0x10')];this[_0x3db0('0x11')]=_0x575dc0['number'];this[_0x3db0('0x12')]=_0x575dc0[_0x3db0('0x12')];this[_0x3db0('0x13')]=_0x575dc0[_0x3db0('0x13')];this[_0x3db0('0x14')]=_0x575dc0[_0x3db0('0x14')];this['dropreason']=_0x575dc0[_0x3db0('0x15')];this[_0x3db0('0x16')]=this[_0x3db0('0x14')];this[_0x3db0('0x17')]=utils['getSeconds'](_0x575dc0[_0x3db0('0x13')],_0x575dc0[_0x3db0('0x12')]);this[_0x3db0('0x18')]=utils[_0x3db0('0x19')](this[_0x3db0('0x14')],_0x575dc0['responsetime']);this[_0x3db0('0x1a')]=0x0;this[_0x3db0('0x4')]=_0x236c69[_0x3db0('0x4')];this[_0x3db0('0x1b')]=_0x236c69[_0x3db0('0x1c')];this[_0x3db0('0x1d')]=_0x236c69[_0x3db0('0x1d')];this[_0x3db0('0x1e')]=_0x575dc0[_0x3db0('0x1e')];this['callbackuniqueid']=_0x575dc0['callbackuniqueid'];this[_0x3db0('0x1f')]=_0x575dc0[_0x3db0('0x1f')];this['recallme']=_0x575dc0['recallme'];this[_0x3db0('0x20')]=_0x575dc0[_0x3db0('0x20')];this[_0x3db0('0x21')]=_0x575dc0[_0x3db0('0x21')];this[_0x3db0('0x22')]=_0x575dc0[_0x3db0('0x22')];this[_0x3db0('0x23')]=_0x575dc0[_0x3db0('0x23')];this['CampaignId']=_0x575dc0[_0x3db0('0x24')];this['originatecalleridnum']=_0x575dc0[_0x3db0('0x25')]||'';this['originatecalleridname']=_0x575dc0['originatecalleridname']||'';this[_0x3db0('0x26')]=_0x575dc0['agiafterat'];this['state']=_0x575dc0['state'];this[_0x3db0('0x27')]=_0x575dc0['statedesc'];}module[_0x3db0('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 1442172..8557a81 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 _0x326f=['catch','temp','error','getContactDialerIvr','dialOrderByScheduledAt','countReScheduled','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','[createHistory]','util','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer'];(function(_0x5903da,_0x573b67){var _0x13f8bd=function(_0x4f9272){while(--_0x4f9272){_0x5903da['push'](_0x5903da['shift']());}};_0x13f8bd(++_0x573b67);}(_0x326f,0xd1));var _0xf326=function(_0x7bb28e,_0x555979){_0x7bb28e=_0x7bb28e-0x0;var _0x39a6d2=_0x326f[_0x7bb28e];return _0x39a6d2;};'use strict';var util=require(_0xf326('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require(_0xf326('0x1'));var cmHopperAdditionalPhone=require(_0xf326('0x2'));var cmHopperBlack=require(_0xf326('0x3'));var cmHopperHistory=require(_0xf326('0x4'));function inspectError(_0x27e8d7){return util[_0xf326('0x5')](_0x27e8d7,{'showHidden':![],'depth':null});}function getContactDialer(_0x9445c6,_0xf1c243,_0x1b5a56){return cmHopper[_0xf326('0x6')](_0x9445c6['id'],_0xf1c243,_0x1b5a56,_0x9445c6['dialOrderByScheduledAt'])[_0xf326('0x7')](function(_0x3851eb){_0x9445c6[_0xf326('0x8')]=0x0;logger[_0xf326('0x9')]('[getContactDialer]',inspectError(_0x3851eb));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x592975,_0x3bacf2){return cmHopper[_0xf326('0xa')](_0x592975['id'],_0x3bacf2,_0x592975[_0xf326('0xb')])[_0xf326('0x7')](function(_0x1f3a33){_0x592975['temp']=0x0;logger[_0xf326('0x9')]('[getContactDialerIvr]',inspectError(_0x1f3a33));});}exports[_0xf326('0xa')]=getContactDialerIvr;function countReScheduled(_0x4aaf3a){return cmHopper[_0xf326('0xc')](_0x4aaf3a)['catch'](function(_0x3162f9){logger[_0xf326('0x9')]('[countReScheduled]',inspectError(_0x3162f9));});}exports[_0xf326('0xc')]=countReScheduled;function rescheduleContact(_0x472632){return cmHopper[_0xf326('0xd')](_0x472632)[_0xf326('0x7')](function(_0x5c8483){logger[_0xf326('0x9')]('[rescheduleContact]',inspectError(_0x5c8483));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0xdf21d9,_0x11f6d2,_0x1f2e5a){return cmHopper[_0xf326('0xe')](_0xdf21d9,_0x11f6d2,_0x1f2e5a)[_0xf326('0x7')](function(_0x287a2a){logger[_0xf326('0x9')](_0xf326('0xf'),inspectError(_0x287a2a));});}exports['unlockContact']=unlockContact;function moveContactManagedDialer(_0x3ad7da){return cmHopper[_0xf326('0x10')](_0x3ad7da)[_0xf326('0x7')](function(_0x31ffb9){logger[_0xf326('0x9')](_0xf326('0x11'),inspectError(_0x31ffb9));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x4a5b6c){return cmHopperBlack['checkIsBlackList'](_0x4a5b6c)[_0xf326('0x7')](function(_0x289f4b){logger['error']('[checkIsBlackList]',inspectError(_0x289f4b));});}exports[_0xf326('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x4dfa76){return cmHopperBlack['checkIsBlackListIvr'](_0x4dfa76)[_0xf326('0x7')](function(_0x18ead3){logger['error']('[checkIsBlackListIvr]',inspectError(_0x18ead3));});}exports[_0xf326('0x13')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0xb1efcf,_0x5f21a2,_0x337ed5){return cmHopperAdditionalPhone[_0xf326('0x14')](_0xb1efcf,_0x5f21a2,_0x337ed5)[_0xf326('0x7')](function(_0x295752){logger[_0xf326('0x9')](_0xf326('0x15'),inspectError(_0x295752));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x55b9f4,_0x4f31f6,_0x520d85){return cmHopperAdditionalPhone[_0xf326('0x16')](_0x55b9f4,_0x4f31f6,_0x520d85)[_0xf326('0x7')](function(_0x1ff2b5){logger[_0xf326('0x9')](_0xf326('0x17'),inspectError(_0x1ff2b5));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x201d28){return cmHopperHistory[_0xf326('0x18')](_0x201d28)[_0xf326('0x7')](function(_0x581531){logger[_0xf326('0x9')]('[avgHandleTime]',inspectError(_0x581531));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x6a8e89){return cmHopperHistory[_0xf326('0x19')](_0x6a8e89)[_0xf326('0x7')](function(_0x5dbe63){logger[_0xf326('0x9')](_0xf326('0x1a'),inspectError(_0x5dbe63));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xbff5=['moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[createHistory]','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3e18cc,_0x43d46c){var _0x4fc8b4=function(_0x443a8e){while(--_0x443a8e){_0x3e18cc['push'](_0x3e18cc['shift']());}};_0x4fc8b4(++_0x43d46c);}(_0xbff5,0x1bc));var _0x5bff=function(_0x89c1db,_0x642b3c){_0x89c1db=_0x89c1db-0x0;var _0x7d32c=_0xbff5[_0x89c1db];return _0x7d32c;};'use strict';var util=require(_0x5bff('0x0'));var logger=require(_0x5bff('0x1'))(_0x5bff('0x2'));var cmHopper=require(_0x5bff('0x3'));var cmHopperAdditionalPhone=require(_0x5bff('0x4'));var cmHopperBlack=require(_0x5bff('0x5'));var cmHopperHistory=require(_0x5bff('0x6'));function inspectError(_0x4dccf3){return util[_0x5bff('0x7')](_0x4dccf3,{'showHidden':![],'depth':null});}function getContactDialer(_0x486083,_0x4c567d,_0x16ed7b){return cmHopper[_0x5bff('0x8')](_0x486083['id'],_0x4c567d,_0x16ed7b,_0x486083[_0x5bff('0x9')])[_0x5bff('0xa')](function(_0x43605a){_0x486083[_0x5bff('0xb')]=0x0;logger[_0x5bff('0xc')](_0x5bff('0xd'),inspectError(_0x43605a));});}exports[_0x5bff('0x8')]=getContactDialer;function getContactDialerIvr(_0x4a1be2,_0x20e26f){return cmHopper['getContactDialerIvr'](_0x4a1be2['id'],_0x20e26f,_0x4a1be2[_0x5bff('0x9')])[_0x5bff('0xa')](function(_0x4fc146){_0x4a1be2[_0x5bff('0xb')]=0x0;logger['error'](_0x5bff('0xe'),inspectError(_0x4fc146));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x207835){return cmHopper[_0x5bff('0xf')](_0x207835)['catch'](function(_0x132dc9){logger['error'](_0x5bff('0x10'),inspectError(_0x132dc9));});}exports[_0x5bff('0xf')]=countReScheduled;function rescheduleContact(_0x548128){return cmHopper[_0x5bff('0x11')](_0x548128)[_0x5bff('0xa')](function(_0x5b0d2d){logger['error'](_0x5bff('0x12'),inspectError(_0x5b0d2d));});}exports[_0x5bff('0x11')]=rescheduleContact;function unlockContact(_0x3a507c,_0x4d883e,_0x2d22ab){return cmHopper[_0x5bff('0x13')](_0x3a507c,_0x4d883e,_0x2d22ab)[_0x5bff('0xa')](function(_0x56c7b2){logger[_0x5bff('0xc')](_0x5bff('0x14'),inspectError(_0x56c7b2));});}exports[_0x5bff('0x13')]=unlockContact;function moveContactManagedDialer(_0x546351){return cmHopper[_0x5bff('0x15')](_0x546351)[_0x5bff('0xa')](function(_0x36653b){logger[_0x5bff('0xc')]('[moveContactManagedDialer]',inspectError(_0x36653b));});}exports[_0x5bff('0x15')]=moveContactManagedDialer;function checkIsBlackList(_0x5357d4){return cmHopperBlack[_0x5bff('0x16')](_0x5357d4)['catch'](function(_0x1fc4cf){logger[_0x5bff('0xc')](_0x5bff('0x17'),inspectError(_0x1fc4cf));});}exports[_0x5bff('0x16')]=checkIsBlackList;function checkIsBlackListIvr(_0x12d018){return cmHopperBlack[_0x5bff('0x18')](_0x12d018)[_0x5bff('0xa')](function(_0x13ee8f){logger[_0x5bff('0xc')]('[checkIsBlackListIvr]',inspectError(_0x13ee8f));});}exports[_0x5bff('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x263cf5,_0x4369b0,_0x1e7f8a){return cmHopperAdditionalPhone[_0x5bff('0x19')](_0x263cf5,_0x4369b0,_0x1e7f8a)[_0x5bff('0xa')](function(_0x3913fd){logger[_0x5bff('0xc')]('[verifyAdditionalPhone]',inspectError(_0x3913fd));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x9a69de,_0x53bd97,_0x220c8f){return cmHopperAdditionalPhone[_0x5bff('0x1a')](_0x9a69de,_0x53bd97,_0x220c8f)[_0x5bff('0xa')](function(_0x6f18f1){logger[_0x5bff('0xc')](_0x5bff('0x1b'),inspectError(_0x6f18f1));});}exports[_0x5bff('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0xedba9d){return cmHopperHistory['avgHandleTime'](_0xedba9d)['catch'](function(_0x20d750){logger[_0x5bff('0xc')]('[avgHandleTime]',inspectError(_0x20d750));});}exports[_0x5bff('0x1c')]=avgHandleTime;function createHistory(_0x588078){return cmHopperHistory['createHistory'](_0x588078)[_0x5bff('0xa')](function(_0x5cf207){logger[_0x5bff('0xc')](_0x5bff('0x1d'),inspectError(_0x5cf207));});}exports[_0x5bff('0x1e')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 48f157c..717aada 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 _0x3491=['status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','\x5cw{0,','pow','random','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','lodash','util','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','IS_DISACTIVED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes'];(function(_0x2ff622,_0x21c8f8){var _0x4d5317=function(_0x5651fe){while(--_0x5651fe){_0x2ff622['push'](_0x2ff622['shift']());}};_0x4d5317(++_0x21c8f8);}(_0x3491,0x7b));var _0x1349=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3491[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x1349('0x0'));var moment=require('moment');var util=require(_0x1349('0x1'));var logger=require('../../../../config/logger')(_0x1349('0x2'));var timezones=require(_0x1349('0x3'))[_0x1349('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x1349('0x5'),'BLACKLIST':_0x1349('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x1349('0x7'),'EMPTY_INTERVAL':_0x1349('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x1349('0x9'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x1349('0xa'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x1349('0xb'),'RECALL_TIMEOUT':_0x1349('0xc'),'RUNNING':_0x1349('0xd'),'UNKNOWN_TIMEZONE':_0x1349('0xe'),'UNREACHABLE_TRUNK':_0x1349('0xf')};exports[_0x1349('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x264e39){return _0x264e39[_0x1349('0x11')]==='preview';}exports[_0x1349('0x12')]=isPreviewCampaign;function isIVRCampaign(_0x43646f){return _0x43646f[_0x1349('0x13')]===_0x1349('0x14');}exports[_0x1349('0x15')]=isIVRCampaign;function isOutboundQueue(_0x5a39c2){return _0x5a39c2['type']===_0x1349('0x16');}exports[_0x1349('0x17')]=isOutboundQueue;function isQueueCampaignActive(_0x5dcba8){return _0x5dcba8[_0x1349('0x18')];}exports[_0x1349('0x19')]=isQueueCampaignActive;function isIVRCampaignActive(_0x520d2f){return _0x520d2f[_0x1349('0x1a')];}exports[_0x1349('0x1b')]=isIVRCampaignActive;function getSeconds(_0x3a1fb4,_0x5bd78d){var _0x34b85d=moment(_0x3a1fb4)[_0x1349('0x1c')](0x0);var _0x13dce=moment(_0x5bd78d)[_0x1349('0x1c')](0x0);return _0x34b85d[_0x1349('0x1d')](_0x13dce,_0x1349('0x1e'));}exports[_0x1349('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x1106cb,_0x5a3219){var _0x44693f=![];var _0x1e8937=_0x1106cb[_0x1349('0x11')]!==_0x5a3219['dialMethod']||_0x1106cb['dialActive']!==_0x5a3219[_0x1349('0x18')]||_0x1106cb['message']!==_0x5a3219[_0x1349('0x20')];var _0x13c9e2=_0x1106cb[_0x1349('0x21')]!==_0x5a3219[_0x1349('0x21')]||_0x1106cb['loggedIn']!==_0x5a3219[_0x1349('0x22')]||_0x1106cb['loggedInDb']!==_0x5a3219[_0x1349('0x23')]||_0x1106cb[_0x1349('0x24')]!==_0x5a3219[_0x1349('0x24')]||_0x1106cb['talking']!==_0x5a3219[_0x1349('0x25')]||_0x1106cb[_0x1349('0x26')]!==_0x5a3219[_0x1349('0x26')]||_0x1106cb[_0x1349('0x27')]!==_0x5a3219[_0x1349('0x27')]||_0x1106cb['inUse']!==_0x5a3219[_0x1349('0x28')]||_0x1106cb[_0x1349('0x29')]!==_0x5a3219['originated'];if(_0x1106cb[_0x1349('0x2a')]&&_0x5a3219['Trunk']){_0x44693f=_0x1106cb[_0x1349('0x2a')][_0x1349('0x2b')]!==_0x5a3219[_0x1349('0x2a')][_0x1349('0x2b')]||_0x1106cb['Trunk']['active']!==_0x5a3219[_0x1349('0x2a')][_0x1349('0x1a')];}return _0x1e8937||_0x13c9e2||_0x44693f;}exports[_0x1349('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2bedb3){var _0x527450=null;var _0x588d6=_0x2bedb3['dialTimezone'];if(_[_0x1349('0x2d')](_0x2bedb3[_0x1349('0x2e')])||_[_0x1349('0x2d')](_0x2bedb3['Interval'])||_[_0x1349('0x2d')](_0x2bedb3['Interval'][_0x1349('0x2f')])){_0x527450=CAMPAIGN_STATUS[_0x1349('0x30')];}else if(_[_0x1349('0x31')](_0x2bedb3['dialGlobalInterval'])||_[_0x1349('0x31')](_0x2bedb3['Interval'][_0x1349('0x2f')])){_0x527450=CAMPAIGN_STATUS[_0x1349('0x32')];}else if(_0x588d6&&!timezones[_0x588d6]){_0x527450=CAMPAIGN_STATUS[_0x1349('0x33')];}return _0x527450;}function checkAnyValidTrunk(_0x4b599e,_0x2244de){var _0x32af92=null;var _0x2a4cf9=_0x1349('0x34');var _0x14cdce=['reachable',_0x1349('0x35')];var _0x1a003e=!![];if(_0x4b599e[_0x1349('0x2a')]&&_0x4b599e['Trunk'][_0x1349('0x1a')]){_0x2a4cf9+=_0x4b599e[_0x1349('0x2a')]['name'];_0x32af92=_0x2244de[_0x2a4cf9];_0x1a003e=_0x14cdce[_0x1349('0x36')](_0x32af92[_0x1349('0x37')]);}else if(_0x4b599e[_0x1349('0x38')]&&_0x4b599e[_0x1349('0x38')][_0x1349('0x1a')]){_0x2a4cf9+=_0x4b599e[_0x1349('0x38')][_0x1349('0x2b')];_0x32af92=_0x2244de[_0x2a4cf9];_0x1a003e=_0x14cdce[_0x1349('0x36')](_0x32af92[_0x1349('0x37')]);}return _0x1a003e;}function getQueueCampaignStatusMessage(_0x151765,_0x416894){var _0x3d8e50=CAMPAIGN_STATUS[_0x1349('0x5')];var _0x24fac6=isPreviewCampaign(_0x151765);if(!isQueueCampaignActive(_0x151765)){if(_0x24fac6){_0x3d8e50=CAMPAIGN_STATUS[_0x1349('0x39')];}else{if(_0x151765[_0x1349('0x29')]===0x0&&_0x151765[_0x1349('0x25')]===0x0&&_0x151765[_0x1349('0x27')]===0x0&&(_0x151765[_0x1349('0x26')]||0x0)===0x0){_0x3d8e50=CAMPAIGN_STATUS['INACTIVE'];}else{_0x3d8e50=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x151765[_0x1349('0x22')]===0x0){_0x3d8e50=CAMPAIGN_STATUS[_0x1349('0x3a')];}else if(!checkAnyValidTrunk(_0x151765,_0x416894)){_0x3d8e50=CAMPAIGN_STATUS[_0x1349('0x3b')];}else if(!isPreviewCampaign(_0x151765)){var _0x44a9ab=checkAnyValidQueueCampaignInterval(_0x151765);if(_0x44a9ab){_0x3d8e50=_0x44a9ab;}}return _0x3d8e50;}exports[_0x1349('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x17dbf1){var _0x38697e=CAMPAIGN_STATUS[_0x1349('0x3d')];if(_0x17dbf1['originated']===0x0&&_0x17dbf1[_0x1349('0x25')]===0x0&&_0x17dbf1[_0x1349('0x27')]===0x0&&(_0x17dbf1[_0x1349('0x26')]||0x0)===0x0){_0x38697e=CAMPAIGN_STATUS['INACTIVE'];}return _0x38697e;}exports[_0x1349('0x3e')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x22d23a){var _0x23aab8=_0x22d23a[_0x1349('0x3f')](/"(.*?)"/);return _0x23aab8?_0x23aab8[0x1]:_0x22d23a;}exports[_0x1349('0x40')]=extractCalleridName;function getCallerId(_0x21d8f0,_0x5a0f77,_0x854286){if(!_[_0x1349('0x41')](_0x854286)&&typeof _0x854286===_0x1349('0x42')&&!_[_0x1349('0x31')](_0x854286)){if(!_[_0x1349('0x41')](_0x5a0f77)&&typeof _0x5a0f77==='string'&&!_[_0x1349('0x31')](_0x5a0f77)){return util[_0x1349('0x43')]('\x22%s\x22\x20<%s>',_0x5a0f77,_0x854286);}return util['format'](_0x1349('0x44'),_0x854286,_0x854286);}if(!_[_0x1349('0x41')](_0x21d8f0)&&typeof _0x21d8f0==='string'&&!_[_0x1349('0x31')](_0x21d8f0)){return _0x21d8f0;}return _0x1349('0x45');}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x5f305c,_0x279ba8){var _0x399260;var _0x3ff97c;var _0x3b0aaf;if(_0x279ba8<=0x0){_0x279ba8=0x1;}_0x399260=new RegExp(_0x1349('0x46')+_0x279ba8+'}$');_0x3ff97c=Math[_0x1349('0x47')](0xa,_0x279ba8-0x1);_0x3b0aaf=Math['pow'](0xa,_0x279ba8)-0x1;return util[_0x1349('0x43')]('%s',_['replace'](_0x5f305c,_0x399260,_[_0x1349('0x48')](_0x3ff97c,_0x3b0aaf)['toString']()));}exports[_0x1349('0x49')]=getCallerIdRandom;function decrementOriginate(_0x35a372){if(_0x35a372[_0x1349('0x29')]&&_0x35a372[_0x1349('0x29')]>0x0){_0x35a372[_0x1349('0x29')]-=0x1;}else{logger[_0x1349('0x4a')](_0x1349('0x4b'));}}exports[_0x1349('0x4c')]=decrementOriginate;function checkContactEmpty(_0x99428){return _0x99428&&_0x99428[_0x1349('0x4d')]>0x0;}exports[_0x1349('0x4e')]=checkContactEmpty;function erlangb(_0x46fdf7,_0x242e97){if(_0x242e97===0x0){return 0x0;}var _0x187ebb=0x1;for(var _0x2a5e86=0x1;_0x2a5e86<=_0x242e97;_0x2a5e86+=0x1){_0x187ebb=0x1+_0x187ebb*_0x2a5e86/_0x46fdf7;}return 0x1/_0x187ebb;}exports[_0x1349('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x344c67,_0x1b0674,_0x42f3c1){if(_0x1b0674>_0x42f3c1){for(var _0x22aece=0x0;_0x22aece<_0x1b0674-_0x42f3c1;_0x22aece+=0x1){decrementOriginate(_0x344c67);}}}exports[_0x1349('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0xde6620){var _0x5ee18a={};var _0x5d1508=['id',_0x1349('0x51'),'description',_0x1349('0x52'),_0x1349('0x53')];if(_0xde6620){for(var _0x184252 in _0xde6620){if(typeof _0xde6620[_0x184252]!==_0x1349('0x54')){if(!_['isNil'](_0xde6620[_0x184252])&&!_0x5d1508[_0x1349('0x36')](_0x184252)){_0x5ee18a[util['format'](_0x1349('0x55'),_0x1349('0x56'),_0x184252[_0x1349('0x57')]())]=_0xde6620[_0x184252];}}}}return _0x5ee18a;}exports[_0x1349('0x58')]=setXMDContactVariables; \ No newline at end of file +var _0x7c94=['waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','isEmpty','Interval','Intervals','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','undefined','%s%s','XMD-','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','outbound','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking'];(function(_0x4ca8e6,_0x4a230c){var _0x2330a9=function(_0x4341c6){while(--_0x4341c6){_0x4ca8e6['push'](_0x4ca8e6['shift']());}};_0x2330a9(++_0x4a230c);}(_0x7c94,0xe8));var _0x47c9=function(_0x311e77,_0x49a459){_0x311e77=_0x311e77-0x0;var _0x559c54=_0x7c94[_0x311e77];return _0x559c54;};'use strict';var _=require(_0x47c9('0x0'));var moment=require(_0x47c9('0x1'));var util=require(_0x47c9('0x2'));var logger=require(_0x47c9('0x3'))(_0x47c9('0x4'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':_0x47c9('0x5'),'BLACKLIST':_0x47c9('0x6'),'CONTACTS_RESCHEDULED':_0x47c9('0x7'),'DEACTIVATED':_0x47c9('0x8'),'DISACTIVED':_0x47c9('0x9'),'EMPTY_INTERVAL':_0x47c9('0xa'),'INACTIVE':_0x47c9('0xb'),'NO_AGENTS_LOGGED':_0x47c9('0xc'),'NO_AVAILABLE_CONTACTS':_0x47c9('0xd'),'NULL_INTERVAL':_0x47c9('0xe'),'OVERTIME_INTERVAL':_0x47c9('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x47c9('0x10'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x47c9('0x11'),'UNREACHABLE_TRUNK':_0x47c9('0x12')};exports[_0x47c9('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x4a7b38){return _0x4a7b38[_0x47c9('0x14')]===_0x47c9('0x15');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x4dbdee){return _0x4dbdee[_0x47c9('0x16')]===_0x47c9('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x101a7){return _0x101a7['type']===_0x47c9('0x18');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x3415e5){return _0x3415e5[_0x47c9('0x19')];}exports[_0x47c9('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5a343b){return _0x5a343b['active'];}exports[_0x47c9('0x1b')]=isIVRCampaignActive;function getSeconds(_0x2ceccb,_0x187e79){var _0x511160=moment(_0x2ceccb)['milliseconds'](0x0);var _0x428d4d=moment(_0x187e79)[_0x47c9('0x1c')](0x0);return _0x511160[_0x47c9('0x1d')](_0x428d4d,_0x47c9('0x1e'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x447f06,_0x546df8){var _0x1f3b7e=![];var _0x409920=_0x447f06[_0x47c9('0x14')]!==_0x546df8[_0x47c9('0x14')]||_0x447f06[_0x47c9('0x19')]!==_0x546df8[_0x47c9('0x19')]||_0x447f06['message']!==_0x546df8[_0x47c9('0x1f')];var _0x1af0ba=_0x447f06[_0x47c9('0x20')]!==_0x546df8[_0x47c9('0x20')]||_0x447f06[_0x47c9('0x21')]!==_0x546df8[_0x47c9('0x21')]||_0x447f06['loggedInDb']!==_0x546df8[_0x47c9('0x22')]||_0x447f06[_0x47c9('0x23')]!==_0x546df8[_0x47c9('0x23')]||_0x447f06[_0x47c9('0x24')]!==_0x546df8['talking']||_0x447f06[_0x47c9('0x25')]!==_0x546df8[_0x47c9('0x25')]||_0x447f06[_0x47c9('0x26')]!==_0x546df8[_0x47c9('0x26')]||_0x447f06[_0x47c9('0x27')]!==_0x546df8[_0x47c9('0x27')]||_0x447f06['originated']!==_0x546df8[_0x47c9('0x28')];if(_0x447f06['Trunk']&&_0x546df8['Trunk']){_0x1f3b7e=_0x447f06[_0x47c9('0x29')][_0x47c9('0x2a')]!==_0x546df8[_0x47c9('0x29')][_0x47c9('0x2a')]||_0x447f06['Trunk']['active']!==_0x546df8['Trunk'][_0x47c9('0x2b')];}return _0x409920||_0x1af0ba||_0x1f3b7e;}exports[_0x47c9('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x3e7042){var _0xf23cb4=null;var _0x576b7e=_0x3e7042[_0x47c9('0x2d')];if(_[_0x47c9('0x2e')](_0x3e7042[_0x47c9('0x2f')])||_['isNil'](_0x3e7042['Interval'])||_[_0x47c9('0x2e')](_0x3e7042['Interval']['Intervals'])){_0xf23cb4=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0x47c9('0x30')](_0x3e7042[_0x47c9('0x2f')])||_[_0x47c9('0x30')](_0x3e7042[_0x47c9('0x31')][_0x47c9('0x32')])){_0xf23cb4=CAMPAIGN_STATUS[_0x47c9('0x33')];}else if(_0x576b7e&&!timezones[_0x576b7e]){_0xf23cb4=CAMPAIGN_STATUS[_0x47c9('0x34')];}return _0xf23cb4;}function checkAnyValidTrunk(_0x146b3c,_0x15153c){var _0x4259e7=null;var _0x1040a3=_0x47c9('0x35');var _0x15dc22=[_0x47c9('0x36'),_0x47c9('0x37')];var _0x4583e7=!![];if(_0x146b3c[_0x47c9('0x29')]&&_0x146b3c[_0x47c9('0x29')][_0x47c9('0x2b')]){_0x1040a3+=_0x146b3c[_0x47c9('0x29')][_0x47c9('0x2a')];_0x4259e7=_0x15153c[_0x1040a3];_0x4583e7=_0x15dc22[_0x47c9('0x38')](_0x4259e7[_0x47c9('0x39')]);}else if(_0x146b3c['TrunkBackup']&&_0x146b3c[_0x47c9('0x3a')][_0x47c9('0x2b')]){_0x1040a3+=_0x146b3c['TrunkBackup']['name'];_0x4259e7=_0x15153c[_0x1040a3];_0x4583e7=_0x15dc22[_0x47c9('0x38')](_0x4259e7[_0x47c9('0x39')]);}return _0x4583e7;}function getQueueCampaignStatusMessage(_0xa557ba,_0x33bc53){var _0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x5')];var _0x2f75ff=isPreviewCampaign(_0xa557ba);if(!isQueueCampaignActive(_0xa557ba)){if(_0x2f75ff){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3b')];}else{if(_0xa557ba['originated']===0x0&&_0xa557ba[_0x47c9('0x24')]===0x0&&_0xa557ba[_0x47c9('0x26')]===0x0&&(_0xa557ba[_0x47c9('0x25')]||0x0)===0x0){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3b')];}else{_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3c')];}}}else if(_0xa557ba[_0x47c9('0x21')]===0x0){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3d')];}else if(!checkAnyValidTrunk(_0xa557ba,_0x33bc53)){_0x4fe871=CAMPAIGN_STATUS[_0x47c9('0x3e')];}else if(!isPreviewCampaign(_0xa557ba)){var _0x473425=checkAnyValidQueueCampaignInterval(_0xa557ba);if(_0x473425){_0x4fe871=_0x473425;}}return _0x4fe871;}exports[_0x47c9('0x3f')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x537959){var _0x3102a5=CAMPAIGN_STATUS[_0x47c9('0x3c')];if(_0x537959[_0x47c9('0x28')]===0x0&&_0x537959[_0x47c9('0x24')]===0x0&&_0x537959['waiting']===0x0&&(_0x537959['pTalking']||0x0)===0x0){_0x3102a5=CAMPAIGN_STATUS[_0x47c9('0x3b')];}return _0x3102a5;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x58eb73){var _0x5d285d=_0x58eb73[_0x47c9('0x40')](/"(.*?)"/);return _0x5d285d?_0x5d285d[0x1]:_0x58eb73;}exports[_0x47c9('0x41')]=extractCalleridName;function getCallerId(_0x1dd0d5,_0x3e9981,_0x3c1101){if(!_[_0x47c9('0x42')](_0x3c1101)&&typeof _0x3c1101===_0x47c9('0x43')&&!_['isEmpty'](_0x3c1101)){if(!_[_0x47c9('0x42')](_0x3e9981)&&typeof _0x3e9981==='string'&&!_['isEmpty'](_0x3e9981)){return util[_0x47c9('0x44')](_0x47c9('0x45'),_0x3e9981,_0x3c1101);}return util[_0x47c9('0x44')](_0x47c9('0x45'),_0x3c1101,_0x3c1101);}if(!_[_0x47c9('0x42')](_0x1dd0d5)&&typeof _0x1dd0d5===_0x47c9('0x43')&&!_[_0x47c9('0x30')](_0x1dd0d5)){return _0x1dd0d5;}return _0x47c9('0x46');}exports[_0x47c9('0x47')]=getCallerId;function getCallerIdRandom(_0x2f1659,_0x3e3d4c){var _0xb04483;var _0x31731a;var _0x5cb9fe;if(_0x3e3d4c<=0x0){_0x3e3d4c=0x1;}_0xb04483=new RegExp(_0x47c9('0x48')+_0x3e3d4c+'}$');_0x31731a=Math['pow'](0xa,_0x3e3d4c-0x1);_0x5cb9fe=Math[_0x47c9('0x49')](0xa,_0x3e3d4c)-0x1;return util[_0x47c9('0x44')]('%s',_[_0x47c9('0x4a')](_0x2f1659,_0xb04483,_[_0x47c9('0x4b')](_0x31731a,_0x5cb9fe)['toString']()));}exports[_0x47c9('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x2b9450){if(_0x2b9450['originated']&&_0x2b9450[_0x47c9('0x28')]>0x0){_0x2b9450[_0x47c9('0x28')]-=0x1;}else{logger[_0x47c9('0x4d')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0x47c9('0x4e')]=decrementOriginate;function checkContactEmpty(_0x5a5ba4){return _0x5a5ba4&&_0x5a5ba4[_0x47c9('0x4f')]>0x0;}exports[_0x47c9('0x50')]=checkContactEmpty;function erlangb(_0x52fe3b,_0x40937f){if(_0x40937f===0x0){return 0x0;}var _0x9cafcd=0x1;for(var _0x2aed78=0x1;_0x2aed78<=_0x40937f;_0x2aed78+=0x1){_0x9cafcd=0x1+_0x9cafcd*_0x2aed78/_0x52fe3b;}return 0x1/_0x9cafcd;}exports[_0x47c9('0x51')]=erlangb;function checkContactLowerLimitOriginate(_0x452a7f,_0x11ac61,_0x3856d4){if(_0x11ac61>_0x3856d4){for(var _0x420c67=0x0;_0x420c67<_0x11ac61-_0x3856d4;_0x420c67+=0x1){decrementOriginate(_0x452a7f);}}}exports[_0x47c9('0x52')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x41086c){var _0x22a254={};var _0x5959b7=['id',_0x47c9('0x53'),_0x47c9('0x54'),_0x47c9('0x55'),'updatedAt'];if(_0x41086c){for(var _0x35d98a in _0x41086c){if(typeof _0x41086c[_0x35d98a]!==_0x47c9('0x56')){if(!_[_0x47c9('0x2e')](_0x41086c[_0x35d98a])&&!_0x5959b7[_0x47c9('0x38')](_0x35d98a)){_0x22a254[util[_0x47c9('0x44')](_0x47c9('0x57'),_0x47c9('0x58'),_0x35d98a['toUpperCase']())]=_0x41086c[_0x35d98a];}}}}return _0x22a254;}exports[_0x47c9('0x59')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 6016143..39e4559 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(_0x17bbe5,_0x2784bb){var _0x453863=function(_0x49f5e3){while(--_0x49f5e3){_0x17bbe5['push'](_0x17bbe5['shift']());}};_0x453863(++_0x2784bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x102ab0,_0x4f24cf){var _0x672547=function(_0x5eaf35){while(--_0x5eaf35){_0x102ab0['push'](_0x102ab0['shift']());}};_0x672547(++_0x4f24cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 8d54858..e13ed61 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 _0xc594=['updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','message','checkTrunk','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','syncNewchannel','syncVarSet','bind','newstate','syncNewState','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','value','channelstate','channelstatedesc','syncNewExten','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]'];(function(_0x2d69e1,_0x43f881){var _0x9b5140=function(_0x374b86){while(--_0x374b86){_0x2d69e1['push'](_0x2d69e1['shift']());}};_0x9b5140(++_0x43f881);}(_0xc594,0x9d));var _0x4c59=function(_0x387934,_0x1a8221){_0x387934=_0x387934-0x0;var _0x227ea9=_0xc594[_0x387934];return _0x227ea9;};'use strict';var util=require(_0x4c59('0x0'));var _=require(_0x4c59('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4c59('0x2'));var moment=require(_0x4c59('0x3'));var path=require(_0x4c59('0x4'));var tiff2pdf=require(_0x4c59('0x5'));var gs=require(_0x4c59('0x6'));var logger=require(_0x4c59('0x7'))(_0x4c59('0x8'));var ami=require(_0x4c59('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x4c59('0xa'));var ut=require('./util/util');var Action=require(_0x4c59('0xb'));var faxAccount=require(_0x4c59('0xc'));var attachment=require(_0x4c59('0xd'));var faxMessage=require(_0x4c59('0xe'));function Fax(_0xea1132){this['channels']={};this[_0x4c59('0xf')]=_0xea1132[_0x4c59('0xf')];this[_0x4c59('0x10')]=_0xea1132[_0x4c59('0x10')];this[_0x4c59('0x11')]={};ami['on']('newchannel',this[_0x4c59('0x12')]['bind'](this));ami['on']('varset',this[_0x4c59('0x13')][_0x4c59('0x14')](this));ami['on'](_0x4c59('0x15'),this[_0x4c59('0x16')][_0x4c59('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0x4c59('0x14')](this));ami['on'](_0x4c59('0x17'),this['syncFaxStatus'][_0x4c59('0x14')](this));ami['on']('receivefax',this[_0x4c59('0x18')][_0x4c59('0x14')](this));ami['on'](_0x4c59('0x19'),this[_0x4c59('0x1a')][_0x4c59('0x14')](this));ami['on'](_0x4c59('0x1b'),this[_0x4c59('0x1c')][_0x4c59('0x14')](this));}Fax['prototype'][_0x4c59('0x12')]=function(_0x33775f){if(_0x33775f[_0x4c59('0x1d')]===_0x4c59('0x1e')){for(var _0x24d1e7 in this['faxAccounts']){if(this['faxAccounts'][_0x4c59('0x1f')](_0x24d1e7)){if(_0x33775f[_0x4c59('0x20')]===this[_0x4c59('0xf')][_0x24d1e7][_0x4c59('0x21')]){this['channels'][_0x33775f['uniqueid']]={};this[_0x4c59('0x22')][_0x33775f[_0x4c59('0x23')]][_0x4c59('0x24')]=_0x33775f[_0x4c59('0x24')];this['channels'][_0x33775f[_0x4c59('0x23')]]['id']=this[_0x4c59('0xf')][_0x24d1e7]['id'];this[_0x4c59('0x22')][_0x33775f[_0x4c59('0x23')]][_0x4c59('0x25')]=this[_0x4c59('0xf')][_0x24d1e7][_0x4c59('0x25')];logger[_0x4c59('0x26')](_0x33775f['uniqueid'],_0x4c59('0x27'));}}}}if(this[_0x4c59('0x11')][_0x33775f[_0x4c59('0x23')]]){this[_0x4c59('0x22')][_0x33775f['uniqueid']]={};this['channels'][_0x33775f[_0x4c59('0x23')]][_0x4c59('0x24')]=_0x33775f['channel'];logger['info'](_0x33775f[_0x4c59('0x23')],_0x4c59('0x27'));}};Fax[_0x4c59('0x28')]['syncVarSet']=function(_0x9da0f7){if(this[_0x4c59('0x22')][_0x9da0f7[_0x4c59('0x23')]]){for(var _0x53f575 in _0x9da0f7['variable']){if(_0x9da0f7['variable'][_0x4c59('0x1f')](_0x53f575)){this['channels'][_0x9da0f7[_0x4c59('0x23')]][_0x53f575]=_0x9da0f7[_0x4c59('0x29')];}}}};Fax['prototype'][_0x4c59('0x16')]=function(_0xd37b00){if(this[_0x4c59('0x22')][_0xd37b00[_0x4c59('0x23')]]){this['channels'][_0xd37b00[_0x4c59('0x23')]][_0x4c59('0x2a')]=_0xd37b00[_0x4c59('0x2a')];this['channels'][_0xd37b00['uniqueid']]['channelstatedesc']=_0xd37b00[_0x4c59('0x2b')];}};Fax[_0x4c59('0x28')][_0x4c59('0x2c')]=function(_0x20852c){if(this[_0x4c59('0x22')][_0x20852c['uniqueid']]){for(var _0xe07382 in _0x20852c[_0x4c59('0x2d')]){if(_0x20852c['variable']['hasOwnProperty'](_0xe07382)){this['channels'][_0x20852c[_0x4c59('0x23')]][_0xe07382]=_0x20852c['value'];}}}};Fax[_0x4c59('0x28')]['syncFaxStatus']=function(_0x4a71cf){if(this[_0x4c59('0x22')][_0x4a71cf[_0x4c59('0x23')]]){this['channels'][_0x4a71cf[_0x4c59('0x23')]]['operation']=_0x4a71cf[_0x4c59('0x2e')];this[_0x4c59('0x22')][_0x4a71cf[_0x4c59('0x23')]]['status']=_0x4a71cf[_0x4c59('0x2f')];this[_0x4c59('0x22')][_0x4a71cf[_0x4c59('0x23')]][_0x4c59('0x21')]=_0x4a71cf[_0x4c59('0x21')];this[_0x4c59('0x22')][_0x4a71cf[_0x4c59('0x23')]][_0x4c59('0x30')]=_0x4a71cf[_0x4c59('0x30')];logger[_0x4c59('0x26')](_0x4a71cf[_0x4c59('0x23')],_0x4c59('0x31'));}};Fax[_0x4c59('0x28')][_0x4c59('0x18')]=function(_0x23f8c9){var _0x3a0138=this;if(this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]]){var _0x488b9b=this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]]['id'];this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]][_0x4c59('0x32')]=_0x23f8c9['remotestationid'];this['channels'][_0x23f8c9[_0x4c59('0x23')]]['pagestransferred']=_0x23f8c9[_0x4c59('0x33')];this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]][_0x4c59('0x21')]=_0x23f8c9[_0x4c59('0x21')];this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]][_0x4c59('0x34')]=_0x23f8c9[_0x4c59('0x34')];this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]][_0x4c59('0x35')]=_0x23f8c9[_0x4c59('0x35')];this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]]['filename']=_0x23f8c9[_0x4c59('0x30')];this[_0x4c59('0x22')][_0x23f8c9[_0x4c59('0x23')]][_0x4c59('0x36')]=_0x23f8c9[_0x4c59('0x36')];if(this[_0x4c59('0x22')][_0x23f8c9['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x23f8c9['filename'],_0x4c59('0x37'),function(_0x2bb7c8){logger[_0x4c59('0x26')](_0x23f8c9[_0x4c59('0x23')],_0x4c59('0x38'),_0x2bb7c8['message']);attachment['create']({'name':path['parse'](_0x23f8c9[_0x4c59('0x30')])[_0x4c59('0x25')],'basename':path[_0x4c59('0x39')](_0x23f8c9[_0x4c59('0x30')])['name']+_0x4c59('0x3a'),'type':_0x4c59('0x3b')})[_0x4c59('0x3c')](function(_0x2d81cf){faxAccount[_0x4c59('0x3d')](_0x488b9b,{'from':_0x23f8c9[_0x4c59('0x36')],'mapKey':_0x4c59('0x8'),'body':path[_0x4c59('0x39')](_0x23f8c9[_0x4c59('0x30')])['name']+_0x4c59('0x3a'),'AttachmentId':_0x2d81cf['id']})[_0x4c59('0x3e')](function(_0x3b0899){logger['error'](_0x23f8c9[_0x4c59('0x23')],_0x4c59('0x3f'),JSON[_0x4c59('0x40')](_0x3b0899));});})[_0x4c59('0x3e')](function(_0x4b8778){logger[_0x4c59('0x41')](_0x23f8c9[_0x4c59('0x23')],_0x4c59('0x42'),JSON[_0x4c59('0x40')](_0x4b8778));});});}logger['info'](_0x23f8c9[_0x4c59('0x23')],_0x4c59('0x42'));}};Fax[_0x4c59('0x28')][_0x4c59('0x1c')]=function(_0xdac5c1){if(this['actions'][_0xdac5c1['uniqueid']]){_[_0x4c59('0x43')](this[_0x4c59('0x22')][_0xdac5c1[_0x4c59('0x23')]],_[_0x4c59('0x44')](_0xdac5c1,[_0x4c59('0x45'),_0x4c59('0x46')]));}};function updateStatus(_0x5744b5){if(_0x5744b5[_0x4c59('0x47')]){faxMessage[_0x4c59('0x48')](_0x5744b5[_0x4c59('0x47')],{'failMessage':_0x4c59('0x49')})[_0x4c59('0x3c')](function(_0x42e158){ut[_0x4c59('0x4a')](_0x4c59('0x4b'),_0x42e158);})[_0x4c59('0x3e')](function(_0x2a6c78){ut['logger'](_0x4c59('0x4c'),_0x2a6c78);});}else{ut[_0x4c59('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x4c59('0x28')][_0x4c59('0x4d')]=function(_0x28cbbc,_0x371832,_0x2346fa){var _0x295f6e=this;var _0x195882={};if(_0x371832){_0x195882={'read':_0x371832};}else{_0x195882={'failMessage':_0x2346fa};}if(this[_0x4c59('0x11')][_0x28cbbc][_0x4c59('0x47')]){faxMessage[_0x4c59('0x48')](this[_0x4c59('0x11')][_0x28cbbc][_0x4c59('0x47')],_0x195882)[_0x4c59('0x3c')](function(_0x493381){ut['logger'](_0x4c59('0x4e'),_0x493381);})[_0x4c59('0x3e')](function(_0x14f898){ut['logger'](_0x4c59('0x4f'),_0x14f898);})['finally'](function(){delete _0x295f6e[_0x4c59('0x22')][_0x28cbbc];delete _0x295f6e['actions'][_0x28cbbc];});}else{ut[_0x4c59('0x4a')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x28cbbc];delete this[_0x4c59('0x11')][_0x28cbbc];}};Fax['prototype'][_0x4c59('0x1a')]=function(_0x40a38f){var _0xf51464=this;if(this[_0x4c59('0x22')][_0x40a38f['uniqueid']]){if(this['actions'][_0x40a38f[_0x4c59('0x23')]]){this['channels'][_0x40a38f['uniqueid']]['id']=this['actions'][_0x40a38f[_0x4c59('0x23')]]['id'];this[_0x4c59('0x22')][_0x40a38f[_0x4c59('0x23')]]['name']=this[_0x4c59('0x11')][_0x40a38f[_0x4c59('0x23')]][_0x4c59('0x25')];}logger[_0x4c59('0x26')](_0x40a38f[_0x4c59('0x23')],this[_0x4c59('0x11')][_0x40a38f[_0x4c59('0x23')]]?_0x4c59('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x4c59('0x40')](this[_0x4c59('0x22')][_0x40a38f[_0x4c59('0x23')]]));if(this[_0x4c59('0x11')][_0x40a38f[_0x4c59('0x23')]]){if(this[_0x4c59('0x22')][_0x40a38f[_0x4c59('0x23')]][_0x4c59('0x51')]>0x0&&this[_0x4c59('0x22')][_0x40a38f[_0x4c59('0x23')]]['faxstatus']===_0x4c59('0x52')){this['updateStatus'](_0x40a38f[_0x4c59('0x23')],!![]);}else{this[_0x4c59('0x4d')](_0x40a38f[_0x4c59('0x23')],![],this['channels'][_0x40a38f['uniqueid']]['faxstatusstring']?_0x4c59('0x53')+this[_0x4c59('0x22')][_0x40a38f[_0x4c59('0x23')]][_0x4c59('0x54')]:'SENDING\x20FAILED');}}}};Fax[_0x4c59('0x28')][_0x4c59('0x55')]=function(_0x1a39a3){var _0xefe8c2=this;return new BPromise(function(_0x264871,_0x31a4ed){_0xefe8c2[_0x4c59('0x56')](_0x1a39a3,_0xefe8c2[_0x4c59('0xf')][_0x1a39a3[_0x4c59('0x57')]])['then'](function(_0x2518c0){ut[_0x4c59('0x4a')](_0x4c59('0x58'),_0x2518c0);_0x264871(ut['message'](_0x4c59('0x59')));})[_0x4c59('0x3e')](function(_0x48a974){ut[_0x4c59('0x4a')](_0x4c59('0x5a'),_0x48a974);updateStatus(_0x1a39a3);_0x31a4ed(ut[_0x4c59('0x5b')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0xc7c48){var _0x429e4e=this;return new BPromise(function(_0x22d9c5,_0x4598f7){var _0x232341=_0x429e4e[_0x4c59('0x5c')](_0x429e4e[_0x4c59('0xf')][_0xc7c48[_0x4c59('0x57')]]['Trunk'],_0xc7c48);if(_0x232341[_0x4c59('0x5d')]){_0x22d9c5(ut['message'](_0x4c59('0x5e')));}else{_0x4598f7(ut[_0x4c59('0x5b')](_0x232341[_0x4c59('0x5b')]));}});};function originate(_0x36de1d,_0x51edd1,_0x1f907b){return new BPromise(function(_0x78d489,_0x2300b8){if(_0x1f907b){var _0x56fa3f=util[_0x4c59('0x5f')](_0x4c59('0x60'),path[_0x4c59('0x39')](_0x36de1d['path'])[_0x4c59('0x25')],_0x36de1d['path']);gs[_0x4c59('0x61')](_0x56fa3f)[_0x4c59('0x3c')](function(){_0x36de1d[_0x4c59('0x4')]=util[_0x4c59('0x5f')]('%s/%s.tif',path['parse'](_0x36de1d[_0x4c59('0x4')])[_0x4c59('0x62')],path[_0x4c59('0x39')](_0x36de1d[_0x4c59('0x4')])[_0x4c59('0x25')]);_0x51edd1[_0x4c59('0x63')]=_0x36de1d[_0x4c59('0x4')];ut[_0x4c59('0x4a')](_0x4c59('0x64'),'');ami[_0x4c59('0x65')](ut[_0x4c59('0x66')](_0x36de1d,_0x51edd1))['then'](function(_0x4eb59e){_0x78d489(_0x4eb59e);})['catch'](function(_0x12618e){_0x2300b8(_0x12618e);});})[_0x4c59('0x3e')](function(_0x40e8d4){_0x2300b8(_0x40e8d4);});}else{ami[_0x4c59('0x65')](ut[_0x4c59('0x66')](_0x36de1d,_0x51edd1))[_0x4c59('0x3c')](function(_0x11d5d6){_0x78d489(_0x11d5d6);})[_0x4c59('0x3e')](function(_0x53cc57){_0x2300b8(_0x53cc57);});}});}Fax[_0x4c59('0x28')][_0x4c59('0x56')]=function(_0x238105,_0x5d87e1){var _0xeb551a=this;return new BPromise(function(_0x3025ff,_0x5a3fc2){var _0x36d74a=uuid['v4']();var _0x51f2db=ut[_0x4c59('0x67')](_0x238105,_0x5d87e1);_0xeb551a[_0x4c59('0x11')][_0x36d74a]=new Action(_0x36d74a,_0x5d87e1,_0x238105);var _0x570064=_0xeb551a['actions'][_0x36d74a];if(path['parse'](_0x238105['path'])[_0x4c59('0x68')]===_0x4c59('0x3a')){originate(_0x570064,_0x51f2db,!![])[_0x4c59('0x3c')](function(_0x33d5b0){_0x3025ff(_0x33d5b0);})[_0x4c59('0x3e')](function(_0x55ce1a){_0x5a3fc2(_0x55ce1a);});}else{originate(_0x570064,_0x51f2db,![])[_0x4c59('0x3c')](function(_0x57b3ad){_0x3025ff(_0x57b3ad);})['catch'](function(_0x2efe35){_0x5a3fc2(_0x2efe35);});}});};Fax[_0x4c59('0x28')]['isTrunkReachable']=function(_0x52a61a){return!_[_0x4c59('0x69')](_0x52a61a)&&!_[_0x4c59('0x69')](_0x52a61a[_0x4c59('0x25')])&&!_['isNil'](_0x52a61a[_0x4c59('0x6a')])&&_0x52a61a['active']&&!_[_0x4c59('0x69')](this[_0x4c59('0x10')][util['format']('SIP/%s',_0x52a61a[_0x4c59('0x25')])])&&!_['isNil'](this[_0x4c59('0x10')][util[_0x4c59('0x5f')]('SIP/%s',_0x52a61a[_0x4c59('0x25')])][_0x4c59('0x2f')])&&(this[_0x4c59('0x10')][util[_0x4c59('0x5f')]('SIP/%s',_0x52a61a[_0x4c59('0x25')])][_0x4c59('0x2f')]==='reachable'||this[_0x4c59('0x10')][util['format'](_0x4c59('0x6b'),_0x52a61a['name'])][_0x4c59('0x2f')]===_0x4c59('0x6c'));};Fax['prototype'][_0x4c59('0x5c')]=function(_0x395e66,_0x48d71c){if(!this[_0x4c59('0x6d')](_0x395e66)){ut[_0x4c59('0x4a')](_0x4c59('0x6e'),_[_0x4c59('0x69')](_0x395e66)?'':_0x395e66[_0x4c59('0x25')]+_0x4c59('0x6f'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x4c59('0x69')](_0x48d71c[_0x4c59('0x8')])){ut[_0x4c59('0x4a')](_0x4c59('0x70'),JSON['stringify'](_0x48d71c));return{'isValid':![],'message':_0x4c59('0x71')};}if(_['isNil'](_0x48d71c['path'])){ut[_0x4c59('0x4a')](_0x4c59('0x72'),JSON[_0x4c59('0x40')](_0x48d71c));return{'isValid':![],'message':_0x4c59('0x73')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x4c59('0x74')]=Fax; \ No newline at end of file +var _0xf143=['./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','varset','syncVarSet','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','from-voip-provider','hasOwnProperty','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','syncNewState','channelstate','channelstatedesc','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','\x20notify\x20','catch','error','\x20receiveFax\x20','stringify','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','../../../config/logger','fax','../ami','./channel'];(function(_0x361026,_0x2375e2){var _0x37028e=function(_0x4f89e0){while(--_0x4f89e0){_0x361026['push'](_0x361026['shift']());}};_0x37028e(++_0x2375e2);}(_0xf143,0x1be));var _0x3f14=function(_0x3c8d82,_0xab4911){_0x3c8d82=_0x3c8d82-0x0;var _0x446e55=_0xf143[_0x3c8d82];return _0x446e55;};'use strict';var util=require(_0x3f14('0x0'));var _=require(_0x3f14('0x1'));var BPromise=require(_0x3f14('0x2'));var uuid=require(_0x3f14('0x3'));var moment=require(_0x3f14('0x4'));var path=require(_0x3f14('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x3f14('0x6'))(_0x3f14('0x7'));var ami=require(_0x3f14('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0x3f14('0x9'));var ut=require(_0x3f14('0xa'));var Action=require('./action');var faxAccount=require(_0x3f14('0xb'));var attachment=require(_0x3f14('0xc'));var faxMessage=require(_0x3f14('0xd'));function Fax(_0x3c4cc2){this[_0x3f14('0xe')]={};this[_0x3f14('0xf')]=_0x3c4cc2[_0x3f14('0xf')];this[_0x3f14('0x10')]=_0x3c4cc2[_0x3f14('0x10')];this[_0x3f14('0x11')]={};ami['on']('newchannel',this[_0x3f14('0x12')]['bind'](this));ami['on'](_0x3f14('0x13'),this[_0x3f14('0x14')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x16'),this['syncNewState'][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x17'),this[_0x3f14('0x18')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x19'),this[_0x3f14('0x1a')][_0x3f14('0x15')](this));ami['on']('receivefax',this[_0x3f14('0x1b')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x1c'),this[_0x3f14('0x1d')][_0x3f14('0x15')](this));ami['on'](_0x3f14('0x1e'),this['syncOriginateResponse']['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0xe90fcc){if(_0xe90fcc['context']===_0x3f14('0x1f')){for(var _0x4cc147 in this[_0x3f14('0xf')]){if(this[_0x3f14('0xf')][_0x3f14('0x20')](_0x4cc147)){if(_0xe90fcc['exten']===this[_0x3f14('0xf')][_0x4cc147]['localstationid']){this['channels'][_0xe90fcc[_0x3f14('0x21')]]={};this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]]['channel']=_0xe90fcc[_0x3f14('0x22')];this['channels'][_0xe90fcc['uniqueid']]['id']=this[_0x3f14('0xf')][_0x4cc147]['id'];this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]][_0x3f14('0x23')]=this[_0x3f14('0xf')][_0x4cc147][_0x3f14('0x23')];logger[_0x3f14('0x24')](_0xe90fcc[_0x3f14('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x3f14('0x11')][_0xe90fcc['uniqueid']]){this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]]={};this[_0x3f14('0xe')][_0xe90fcc[_0x3f14('0x21')]][_0x3f14('0x22')]=_0xe90fcc[_0x3f14('0x22')];logger['info'](_0xe90fcc[_0x3f14('0x21')],_0x3f14('0x25'));}};Fax[_0x3f14('0x26')]['syncVarSet']=function(_0x2e856c){if(this[_0x3f14('0xe')][_0x2e856c[_0x3f14('0x21')]]){for(var _0x2675d9 in _0x2e856c[_0x3f14('0x27')]){if(_0x2e856c[_0x3f14('0x27')][_0x3f14('0x20')](_0x2675d9)){this[_0x3f14('0xe')][_0x2e856c[_0x3f14('0x21')]][_0x2675d9]=_0x2e856c[_0x3f14('0x28')];}}}};Fax[_0x3f14('0x26')][_0x3f14('0x29')]=function(_0x24923c){if(this[_0x3f14('0xe')][_0x24923c['uniqueid']]){this[_0x3f14('0xe')][_0x24923c[_0x3f14('0x21')]]['channelstate']=_0x24923c[_0x3f14('0x2a')];this['channels'][_0x24923c[_0x3f14('0x21')]]['channelstatedesc']=_0x24923c[_0x3f14('0x2b')];}};Fax[_0x3f14('0x26')]['syncNewExten']=function(_0x3fd793){if(this[_0x3f14('0xe')][_0x3fd793[_0x3f14('0x21')]]){for(var _0x332f79 in _0x3fd793[_0x3f14('0x27')]){if(_0x3fd793[_0x3f14('0x27')][_0x3f14('0x20')](_0x332f79)){this[_0x3f14('0xe')][_0x3fd793[_0x3f14('0x21')]][_0x332f79]=_0x3fd793[_0x3f14('0x28')];}}}};Fax[_0x3f14('0x26')][_0x3f14('0x1a')]=function(_0x1ddaa6){if(this[_0x3f14('0xe')][_0x1ddaa6[_0x3f14('0x21')]]){this['channels'][_0x1ddaa6[_0x3f14('0x21')]]['operation']=_0x1ddaa6['operation'];this[_0x3f14('0xe')][_0x1ddaa6['uniqueid']][_0x3f14('0x2c')]=_0x1ddaa6[_0x3f14('0x2c')];this[_0x3f14('0xe')][_0x1ddaa6[_0x3f14('0x21')]][_0x3f14('0x2d')]=_0x1ddaa6[_0x3f14('0x2d')];this['channels'][_0x1ddaa6[_0x3f14('0x21')]][_0x3f14('0x2e')]=_0x1ddaa6['filename'];logger[_0x3f14('0x24')](_0x1ddaa6[_0x3f14('0x21')],'\x20syncFaxStatus\x20');}};Fax[_0x3f14('0x26')][_0x3f14('0x1b')]=function(_0x23b8d6){var _0x3e7887=this;if(this['channels'][_0x23b8d6['uniqueid']]){var _0x37eec0=this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]]['id'];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x2f')]=_0x23b8d6[_0x3f14('0x2f')];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x30')]=_0x23b8d6['pagestransferred'];this['channels'][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x2d')]=_0x23b8d6['localstationid'];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x31')]=_0x23b8d6['resolution'];this['channels'][_0x23b8d6[_0x3f14('0x21')]]['transferrate']=_0x23b8d6[_0x3f14('0x32')];this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]]['filename']=_0x23b8d6[_0x3f14('0x2e')];this[_0x3f14('0xe')][_0x23b8d6['uniqueid']][_0x3f14('0x33')]=_0x23b8d6[_0x3f14('0x33')];if(this[_0x3f14('0xe')][_0x23b8d6[_0x3f14('0x21')]][_0x3f14('0x30')]>0x0){tiff2pdf(_0x23b8d6['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x20b691){logger[_0x3f14('0x24')](_0x23b8d6['uniqueid'],_0x3f14('0x34'),_0x20b691[_0x3f14('0x35')]);attachment[_0x3f14('0x36')]({'name':path[_0x3f14('0x37')](_0x23b8d6[_0x3f14('0x2e')])['name'],'basename':path['parse'](_0x23b8d6[_0x3f14('0x2e')])['name']+_0x3f14('0x38'),'type':'application/pdf'})[_0x3f14('0x39')](function(_0x3cec60){faxAccount[_0x3f14('0x3a')](_0x37eec0,{'from':_0x23b8d6[_0x3f14('0x33')],'mapKey':_0x3f14('0x7'),'body':path['parse'](_0x23b8d6[_0x3f14('0x2e')])['name']+'.pdf','AttachmentId':_0x3cec60['id']})['catch'](function(_0x49eefa){logger['error'](_0x23b8d6[_0x3f14('0x21')],_0x3f14('0x3b'),JSON['stringify'](_0x49eefa));});})[_0x3f14('0x3c')](function(_0x5b37ee){logger[_0x3f14('0x3d')](_0x23b8d6['uniqueid'],_0x3f14('0x3e'),JSON[_0x3f14('0x3f')](_0x5b37ee));});});}logger[_0x3f14('0x24')](_0x23b8d6[_0x3f14('0x21')],'\x20receiveFax\x20');}};Fax[_0x3f14('0x26')][_0x3f14('0x40')]=function(_0x3399e8){if(this['actions'][_0x3399e8[_0x3f14('0x21')]]){_[_0x3f14('0x41')](this[_0x3f14('0xe')][_0x3399e8[_0x3f14('0x21')]],_['pick'](_0x3399e8,[_0x3f14('0x42'),_0x3f14('0x43')]));}};function updateStatus(_0x43a4b2){if(_0x43a4b2[_0x3f14('0x44')]){faxMessage[_0x3f14('0x45')](_0x43a4b2[_0x3f14('0x44')],{'failMessage':_0x3f14('0x46')})[_0x3f14('0x39')](function(_0x77aa11){ut[_0x3f14('0x47')](_0x3f14('0x48'),_0x77aa11);})[_0x3f14('0x3c')](function(_0x2ee8d9){ut[_0x3f14('0x47')](_0x3f14('0x49'),_0x2ee8d9);});}else{ut[_0x3f14('0x47')](_0x3f14('0x4a'));}}Fax[_0x3f14('0x26')]['updateStatus']=function(_0x12d862,_0x3e665b,_0x31b33d){var _0x292ee0=this;var _0xfdd417={};if(_0x3e665b){_0xfdd417={'read':_0x3e665b};}else{_0xfdd417={'failMessage':_0x31b33d};}if(this[_0x3f14('0x11')][_0x12d862][_0x3f14('0x44')]){faxMessage[_0x3f14('0x45')](this[_0x3f14('0x11')][_0x12d862][_0x3f14('0x44')],_0xfdd417)[_0x3f14('0x39')](function(_0x3ba954){ut[_0x3f14('0x47')](_0x3f14('0x4b'),_0x3ba954);})[_0x3f14('0x3c')](function(_0x3d5ad9){ut['logger'](_0x3f14('0x4c'),_0x3d5ad9);})[_0x3f14('0x4d')](function(){delete _0x292ee0[_0x3f14('0xe')][_0x12d862];delete _0x292ee0[_0x3f14('0x11')][_0x12d862];});}else{ut[_0x3f14('0x47')]('[Fax][Message][NoUpdate2]');delete this[_0x3f14('0xe')][_0x12d862];delete this[_0x3f14('0x11')][_0x12d862];}};Fax[_0x3f14('0x26')]['syncHangup']=function(_0x447a1a){var _0x5bf1d9=this;if(this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]]){if(this[_0x3f14('0x11')][_0x447a1a[_0x3f14('0x21')]]){this['channels'][_0x447a1a[_0x3f14('0x21')]]['id']=this[_0x3f14('0x11')][_0x447a1a['uniqueid']]['id'];this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x23')]=this['actions'][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x23')];}logger[_0x3f14('0x24')](_0x447a1a[_0x3f14('0x21')],this[_0x3f14('0x11')][_0x447a1a[_0x3f14('0x21')]]?_0x3f14('0x4e'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]]));if(this['actions'][_0x447a1a[_0x3f14('0x21')]]){if(this['channels'][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x4f')]>0x0&&this['channels'][_0x447a1a['uniqueid']][_0x3f14('0x19')]===_0x3f14('0x50')){this[_0x3f14('0x51')](_0x447a1a['uniqueid'],!![]);}else{this[_0x3f14('0x51')](_0x447a1a[_0x3f14('0x21')],![],this[_0x3f14('0xe')][_0x447a1a[_0x3f14('0x21')]][_0x3f14('0x52')]?_0x3f14('0x53')+this[_0x3f14('0xe')][_0x447a1a['uniqueid']][_0x3f14('0x52')]:_0x3f14('0x54'));}}}};Fax[_0x3f14('0x26')]['send']=function(_0x2d6bd4){var _0x1fb311=this;return new BPromise(function(_0x286a16,_0x432e7c){_0x1fb311[_0x3f14('0x55')](_0x2d6bd4,_0x1fb311[_0x3f14('0xf')][_0x2d6bd4['FaxAccountId']])[_0x3f14('0x39')](function(_0x210478){ut[_0x3f14('0x47')](_0x3f14('0x56'),_0x210478);_0x286a16(ut[_0x3f14('0x35')](_0x3f14('0x57')));})[_0x3f14('0x3c')](function(_0x5f12a3){ut['logger']('[Fax][execOriginate][failure]',_0x5f12a3);updateStatus(_0x2d6bd4);_0x432e7c(ut[_0x3f14('0x35')](_0x3f14('0x58')));});});};Fax['prototype']['checkAfterSend']=function(_0x48e385){var _0x1ccf70=this;return new BPromise(function(_0x31de10,_0x29cd7c){var _0x4d3bfc=_0x1ccf70['checkTrunk'](_0x1ccf70[_0x3f14('0xf')][_0x48e385[_0x3f14('0x59')]][_0x3f14('0x5a')],_0x48e385);if(_0x4d3bfc[_0x3f14('0x5b')]){_0x31de10(ut[_0x3f14('0x35')](_0x3f14('0x5c')));}else{_0x29cd7c(ut['message'](_0x4d3bfc['message']));}});};function originate(_0x504033,_0x48f4da,_0x446793){return new BPromise(function(_0xee132b,_0x581f01){if(_0x446793){var _0x26facd=util[_0x3f14('0x5d')](_0x3f14('0x5e'),path['parse'](_0x504033['path'])[_0x3f14('0x23')],_0x504033[_0x3f14('0x5')]);gs[_0x3f14('0x5f')](_0x26facd)['then'](function(){_0x504033['path']=util[_0x3f14('0x5d')](_0x3f14('0x60'),path[_0x3f14('0x37')](_0x504033[_0x3f14('0x5')])[_0x3f14('0x61')],path['parse'](_0x504033[_0x3f14('0x5')])[_0x3f14('0x23')]);_0x48f4da[_0x3f14('0x62')]=_0x504033['path'];ut['logger'](_0x3f14('0x63'),'');ami['Action'](ut[_0x3f14('0x64')](_0x504033,_0x48f4da))[_0x3f14('0x39')](function(_0x2f5ae9){_0xee132b(_0x2f5ae9);})[_0x3f14('0x3c')](function(_0x4c9cc6){_0x581f01(_0x4c9cc6);});})['catch'](function(_0xee32fa){_0x581f01(_0xee32fa);});}else{ami[_0x3f14('0x65')](ut['variablesAction'](_0x504033,_0x48f4da))[_0x3f14('0x39')](function(_0xc8dce2){_0xee132b(_0xc8dce2);})[_0x3f14('0x3c')](function(_0x47509e){_0x581f01(_0x47509e);});}});}Fax[_0x3f14('0x26')][_0x3f14('0x55')]=function(_0x3da0f0,_0xd17269){var _0x4454ea=this;return new BPromise(function(_0x593649,_0x55c3a4){var _0x5c928e=uuid['v4']();var _0x5ca1b9=ut['addVariables'](_0x3da0f0,_0xd17269);_0x4454ea[_0x3f14('0x11')][_0x5c928e]=new Action(_0x5c928e,_0xd17269,_0x3da0f0);var _0x45fcad=_0x4454ea['actions'][_0x5c928e];if(path[_0x3f14('0x37')](_0x3da0f0[_0x3f14('0x5')])['ext']==='.pdf'){originate(_0x45fcad,_0x5ca1b9,!![])[_0x3f14('0x39')](function(_0x3806b7){_0x593649(_0x3806b7);})[_0x3f14('0x3c')](function(_0x26fcd2){_0x55c3a4(_0x26fcd2);});}else{originate(_0x45fcad,_0x5ca1b9,![])[_0x3f14('0x39')](function(_0x51e073){_0x593649(_0x51e073);})[_0x3f14('0x3c')](function(_0x43321c){_0x55c3a4(_0x43321c);});}});};Fax[_0x3f14('0x26')][_0x3f14('0x66')]=function(_0x20bb44){return!_[_0x3f14('0x67')](_0x20bb44)&&!_[_0x3f14('0x67')](_0x20bb44[_0x3f14('0x23')])&&!_['isNil'](_0x20bb44[_0x3f14('0x68')])&&_0x20bb44[_0x3f14('0x68')]&&!_[_0x3f14('0x67')](this['trunks'][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44[_0x3f14('0x23')])])&&!_['isNil'](this[_0x3f14('0x10')][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44['name'])][_0x3f14('0x2c')])&&(this[_0x3f14('0x10')][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44[_0x3f14('0x23')])][_0x3f14('0x2c')]===_0x3f14('0x6a')||this['trunks'][util[_0x3f14('0x5d')](_0x3f14('0x69'),_0x20bb44[_0x3f14('0x23')])][_0x3f14('0x2c')]==='unmonitored');};Fax[_0x3f14('0x26')][_0x3f14('0x6b')]=function(_0x5704ae,_0x30b295){if(!this[_0x3f14('0x66')](_0x5704ae)){ut[_0x3f14('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x3f14('0x67')](_0x5704ae)?'':_0x5704ae[_0x3f14('0x23')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3f14('0x6c')};}if(_['isNil'](_0x30b295[_0x3f14('0x7')])){ut[_0x3f14('0x47')](_0x3f14('0x6d'),JSON['stringify'](_0x30b295));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3f14('0x67')](_0x30b295[_0x3f14('0x5')])){ut['logger'](_0x3f14('0x6e'),JSON['stringify'](_0x30b295));return{'isValid':![],'message':_0x3f14('0x6f')};}return{'isValid':!![],'message':_0x3f14('0x70')};};module[_0x3f14('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 809cd7a..bea3376 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 _0x827a=['util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','then'];(function(_0x3cafb8,_0x32860e){var _0x4b7f85=function(_0x31b11d){while(--_0x31b11d){_0x3cafb8['push'](_0x3cafb8['shift']());}};_0x4b7f85(++_0x32860e);}(_0x827a,0xf0));var _0xa827=function(_0x515ed6,_0x5655e5){_0x515ed6=_0x515ed6-0x0;var _0x302e1a=_0x827a[_0x515ed6];return _0x302e1a;};'use strict';var util=require(_0xa827('0x0'));var BPromise=require(_0xa827('0x1'));var logger=require(_0xa827('0x2'))(_0xa827('0x3'));var _=require(_0xa827('0x4'));var faxAccount=require(_0xa827('0x5'));function loggerCatch(_0x4cba08){return function(_0x4979a5){logger[_0xa827('0x6')](_0x4cba08,util[_0xa827('0x7')](_0x4979a5,{'showHidden':![],'depth':null}));};}exports[_0xa827('0x8')]=function(_0x2f58fb,_0x3dcbf9){return BPromise['resolve']()[_0xa827('0x9')](faxAccount[_0xa827('0x8')](_0x2f58fb,_0x3dcbf9))['catch'](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xb61a=['catch','[Notify]\x20','bluebird','../../../config/logger','preview','error','inspect','notify','resolve'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xb61a,0x1f1));var _0xab61=function(_0x3296e6,_0x5aa944){_0x3296e6=_0x3296e6-0x0;var _0x4d4dc8=_0xb61a[_0x3296e6];return _0x4d4dc8;};'use strict';var util=require('util');var BPromise=require(_0xab61('0x0'));var logger=require(_0xab61('0x1'))(_0xab61('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x373c48){return function(_0x26cb9f){logger[_0xab61('0x3')](_0x373c48,util[_0xab61('0x4')](_0x26cb9f,{'showHidden':![],'depth':null}));};}exports[_0xab61('0x5')]=function(_0x3e10d8,_0x465ea1){return BPromise[_0xab61('0x6')]()['then'](faxAccount[_0xab61('0x5')](_0x3e10d8,_0x465ea1))[_0xab61('0x7')](loggerCatch(_0xab61('0x8')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index c007501..3801240 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 _0x263c=['info','\x20Error\x20:','inspect','util','bluebird','child_process','exec','Exec\x20gs'];(function(_0x2abd03,_0x15bd78){var _0x397306=function(_0x203b1e){while(--_0x203b1e){_0x2abd03['push'](_0x2abd03['shift']());}};_0x397306(++_0x15bd78);}(_0x263c,0x11b));var _0xc263=function(_0x374f59,_0x5c2098){_0x374f59=_0x374f59-0x0;var _0x408ead=_0x263c[_0x374f59];return _0x408ead;};'use strict';var util=require(_0xc263('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xc263('0x1'));var exec=require(_0xc263('0x2'))[_0xc263('0x3')];exports['execute']=function(_0x25b7c4){return new BPromise(function(_0x3c6d8c,_0x20f470){exec(_0x25b7c4,function(_0x5bd539,_0x58d8f3,_0xa17e82){logger['info'](_0xc263('0x4'),_0x58d8f3);if(_0x5bd539){logger[_0xc263('0x5')](_0xc263('0x4'),_0xc263('0x6'),util[_0xc263('0x7')](_0x5bd539,{'showHidden':![],'depth':null}),_0x58d8f3,_0xa17e82);_0x20f470(_0x5bd539);}_0x3c6d8c(_0x58d8f3);});});}; \ No newline at end of file +var _0xa6c6=['bluebird','child_process','exec','info','\x20Error\x20:','inspect'];(function(_0x566c5a,_0x42e09c){var _0x3c4abe=function(_0x2489a0){while(--_0x2489a0){_0x566c5a['push'](_0x566c5a['shift']());}};_0x3c4abe(++_0x42e09c);}(_0xa6c6,0x138));var _0x6a6c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa6c6[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x6a6c('0x0'));var exec=require(_0x6a6c('0x1'))[_0x6a6c('0x2')];exports['execute']=function(_0xc10562){return new BPromise(function(_0x79f5f7,_0x78bcae){exec(_0xc10562,function(_0x2a4723,_0x505ea8,_0x28d1d2){logger[_0x6a6c('0x3')]('Exec\x20gs',_0x505ea8);if(_0x2a4723){logger[_0x6a6c('0x3')]('Exec\x20gs',_0x6a6c('0x4'),util[_0x6a6c('0x5')](_0x2a4723,{'showHidden':![],'depth':null}),_0x505ea8,_0x28d1d2);_0x78bcae(_0x2a4723);}_0x79f5f7(_0x505ea8);});});}; \ No newline at end of file diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index 71cdb6e..e64b701 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 _0x1dd4=['lodash','fax','message','logger','info','inspect','addVariables','ecm','format','\x22%s\x22','gateway','faxdetect','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x1dd4,0xa7));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x41dd('0x0'));var _=require(_0x41dd('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x41dd('0x2'));exports[_0x41dd('0x3')]=function(_0x3f836e){return{'message':_0x3f836e};};exports[_0x41dd('0x4')]=function(_0xf1be6e,_0x2671d4){logger[_0x41dd('0x5')](_0xf1be6e,util[_0x41dd('0x6')](_0x2671d4,{'showHidden':![],'depth':null}));};exports[_0x41dd('0x7')]=function(_0x5cb6f3,_0x397beb){var _0x47fa3b={'XMF-ECM':_0x397beb[_0x41dd('0x8')],'XMF-HEADERINFO':_0x397beb['headerinfo'],'XMF-MINRATE':_0x397beb['minrate'],'XMF-MAXRATE':_0x397beb['maxrate'],'XMF-MODEM':util[_0x41dd('0x9')](_0x41dd('0xa'),_0x397beb['modem']),'XMF-GATEWAY':_0x397beb[_0x41dd('0xb')],'XMF-FAXDETECT':_0x397beb[_0x41dd('0xc')],'XMF-T38TIMEOUT':_0x397beb['t38timeout'],'XMF-LOCALSTATIONID':_0x397beb[_0x41dd('0xd')],'XMF-PATH':_0x5cb6f3['path']};return _0x47fa3b;};exports[_0x41dd('0xe')]=function(_0x4391b9,_0xaa6bf){return{'actionid':_0x4391b9[_0x41dd('0xf')],'action':_0x41dd('0x10'),'channel':_0x4391b9[_0x41dd('0x11')],'Exten':_0x41dd('0x12'),'Context':_0x41dd('0x13'),'Priority':'1','callerid':util[_0x41dd('0x9')](_0x41dd('0x14'),_0x4391b9['headerinfo']?_0x4391b9['headerinfo']:'',_0x4391b9[_0x41dd('0xd')]),'variable':_0xaa6bf,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4391b9[_0x41dd('0xf')]};}; \ No newline at end of file +var _0x3f11=['localstationid','util','lodash','../../../../config/logger','fax','message','logger','info','inspect','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','path','uniqueid','originate','from-sip'];(function(_0x59e643,_0x30da39){var _0x188357=function(_0x1dd127){while(--_0x1dd127){_0x59e643['push'](_0x59e643['shift']());}};_0x188357(++_0x30da39);}(_0x3f11,0x1a5));var _0x13f1=function(_0x55bc6c,_0x1f7ab1){_0x55bc6c=_0x55bc6c-0x0;var _0x5300ec=_0x3f11[_0x55bc6c];return _0x5300ec;};'use strict';var util=require(_0x13f1('0x0'));var _=require(_0x13f1('0x1'));var moment=require('moment');var logger=require(_0x13f1('0x2'))(_0x13f1('0x3'));exports[_0x13f1('0x4')]=function(_0x3d817a){return{'message':_0x3d817a};};exports[_0x13f1('0x5')]=function(_0xd0d33,_0x494357){logger[_0x13f1('0x6')](_0xd0d33,util[_0x13f1('0x7')](_0x494357,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x56aa7b,_0x1606c2){var _0x19cb86={'XMF-ECM':_0x1606c2['ecm'],'XMF-HEADERINFO':_0x1606c2[_0x13f1('0x8')],'XMF-MINRATE':_0x1606c2[_0x13f1('0x9')],'XMF-MAXRATE':_0x1606c2[_0x13f1('0xa')],'XMF-MODEM':util[_0x13f1('0xb')](_0x13f1('0xc'),_0x1606c2[_0x13f1('0xd')]),'XMF-GATEWAY':_0x1606c2['gateway'],'XMF-FAXDETECT':_0x1606c2[_0x13f1('0xe')],'XMF-T38TIMEOUT':_0x1606c2[_0x13f1('0xf')],'XMF-LOCALSTATIONID':_0x1606c2['localstationid'],'XMF-PATH':_0x56aa7b[_0x13f1('0x10')]};return _0x19cb86;};exports['variablesAction']=function(_0x42f612,_0x4369c8){return{'actionid':_0x42f612[_0x13f1('0x11')],'action':_0x13f1('0x12'),'channel':_0x42f612['channel'],'Exten':'xcally-motion-fax','Context':_0x13f1('0x13'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x42f612['headerinfo']?_0x42f612[_0x13f1('0x8')]:'',_0x42f612[_0x13f1('0x14')]),'variable':_0x4369c8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x42f612[_0x13f1('0x11')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 01adce5..6ccbc7e 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 _0x7f17=['./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','inspect','listen','sync','[index.js][main]','util','moment','./realtime','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk'];(function(_0x1b2ac9,_0x5371e8){var _0x3da279=function(_0x880506){while(--_0x880506){_0x1b2ac9['push'](_0x1b2ac9['shift']());}};_0x3da279(++_0x5371e8);}(_0x7f17,0x1f4));var _0x77f1=function(_0x2e409e,_0x2d227e){_0x2e409e=_0x2e409e-0x0;var _0xe6e039=_0x7f17[_0x2e409e];return _0xe6e039;};'use strict';var util=require(_0x77f1('0x0'));var moment=require(_0x77f1('0x1'));var server=require('./server');var Realtime=require(_0x77f1('0x2'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x77f1('0x3'));var Dialer=require('./dialer');var Preview=require(_0x77f1('0x4'));var Fax=require(_0x77f1('0x5'));var user=require(_0x77f1('0x6'));var voiceQueue=require(_0x77f1('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x77f1('0x8'));var trigger=require('./rpc/trigger');var template=require(_0x77f1('0x9'));var cmHopperHistory=require(_0x77f1('0xa'));var campaign=require(_0x77f1('0xb'));var voiceExtension=require(_0x77f1('0xc'));var faxAccount=require(_0x77f1('0xd'));var zendesk=require(_0x77f1('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x77f1('0xf'));var freshdesk=require(_0x77f1('0x10'));var desk=require(_0x77f1('0x11'));var zoho=require(_0x77f1('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x77f1('0x13'));var servicenow=require(_0x77f1('0x14'));var dynamics365=require(_0x77f1('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x77f1('0x16'))(_0x77f1('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x77f1('0x18')](_0x77f1('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x77f1('0x18')](_0x77f1('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()[_0x77f1('0x1a')](user[_0x77f1('0x1b')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x1c')]())[_0x77f1('0x1a')](user[_0x77f1('0x1d')]())['then'](realtime[_0x77f1('0x1e')]())[_0x77f1('0x1a')](trunk[_0x77f1('0x1f')]())['then'](realtime[_0x77f1('0x20')]())[_0x77f1('0x1a')](voiceQueue[_0x77f1('0x21')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x22')]())[_0x77f1('0x1a')](trigger[_0x77f1('0x23')]())[_0x77f1('0x1a')](realtime['initTriggers']())[_0x77f1('0x1a')](template[_0x77f1('0x24')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x25')]())['then'](zendesk['getZendeskAccounts']())[_0x77f1('0x1a')](realtime[_0x77f1('0x26')]())[_0x77f1('0x1a')](salesforce[_0x77f1('0x27')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x28')]())['then'](sugarcrm[_0x77f1('0x29')]())[_0x77f1('0x1a')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x77f1('0x2a')]())[_0x77f1('0x1a')](realtime['initFreshdeskAccounts']())[_0x77f1('0x1a')](desk[_0x77f1('0x2b')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x2c')]())[_0x77f1('0x1a')](zoho[_0x77f1('0x2d')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x2e')]())[_0x77f1('0x1a')](vtiger[_0x77f1('0x2f')]())['then'](realtime[_0x77f1('0x30')]())[_0x77f1('0x1a')](freshsales[_0x77f1('0x31')]())['then'](realtime[_0x77f1('0x32')]())[_0x77f1('0x1a')](servicenow[_0x77f1('0x33')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x34')]())['then'](dynamics365[_0x77f1('0x35')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x36')]())[_0x77f1('0x1a')](campaign[_0x77f1('0x37')]())['then'](realtime[_0x77f1('0x38')]())[_0x77f1('0x1a')](voiceExtension[_0x77f1('0x39')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x3a')]())[_0x77f1('0x1a')](faxAccount[_0x77f1('0x3b')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x3c')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x77f1('0x3d')]()['then'](voiceQueueReport[_0x77f1('0x3e')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x3f')]())[_0x77f1('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x77f1('0x1a')](realtime[_0x77f1('0x40')]())[_0x77f1('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0x77f1('0x1a')](realtime[_0x77f1('0x41')]())[_0x77f1('0x1a')](voiceCallReport[_0x77f1('0x42')]())[_0x77f1('0x1a')](realtime[_0x77f1('0x43')]())[_0x77f1('0x44')](function(_0x5eb4f0){logger[_0x77f1('0x45')]('[index.js][initParams]',util[_0x77f1('0x46')](_0x5eb4f0,{'showHidden':![],'depth':null}));});}function main(){return server[_0x77f1('0x47')](realtime,preview,fax)[_0x77f1('0x1a')](function(){return initRealtime();})['then'](function(){return initParams();})[_0x77f1('0x1a')](function(){report[_0x77f1('0x48')]();setInterval(initRealtime,0x1388);})[_0x77f1('0x44')](function(_0x57f133){logger[_0x77f1('0x45')](_0x77f1('0x49'),util[_0x77f1('0x46')](_0x57f133,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x238a=['./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','moment','./server','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger'];(function(_0x172036,_0x5a7619){var _0x19d18c=function(_0x3f27a8){while(--_0x3f27a8){_0x172036['push'](_0x172036['shift']());}};_0x19d18c(++_0x5a7619);}(_0x238a,0xba));var _0xa238=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x238a[_0x5eaa0b];return _0x28b295;};'use strict';var util=require('util');var moment=require(_0xa238('0x0'));var server=require(_0xa238('0x1'));var Realtime=require('./realtime');var Report=require(_0xa238('0x2'));var Acw=require(_0xa238('0x3'));var Trigger=require(_0xa238('0x4'));var Dialer=require(_0xa238('0x5'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0xa238('0x6'));var voiceQueue=require(_0xa238('0x7'));var voiceQueueReport=require(_0xa238('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xa238('0x9'));var trigger=require(_0xa238('0xa'));var template=require(_0xa238('0xb'));var cmHopperHistory=require(_0xa238('0xc'));var campaign=require(_0xa238('0xd'));var voiceExtension=require(_0xa238('0xe'));var faxAccount=require(_0xa238('0xf'));var zendesk=require(_0xa238('0x10'));var salesforce=require(_0xa238('0x11'));var sugarcrm=require(_0xa238('0x12'));var freshdesk=require(_0xa238('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xa238('0x14'));var freshsales=require(_0xa238('0x15'));var servicenow=require(_0xa238('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xa238('0x17'))(_0xa238('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa238('0x19')](_0xa238('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xa238('0x1b')]()[_0xa238('0x1c')](user[_0xa238('0x1d')]())['then'](realtime[_0xa238('0x1e')]())[_0xa238('0x1c')](user[_0xa238('0x1f')]())['then'](realtime[_0xa238('0x20')]())[_0xa238('0x1c')](trunk[_0xa238('0x21')]())[_0xa238('0x1c')](realtime[_0xa238('0x22')]())['then'](voiceQueue[_0xa238('0x23')]())[_0xa238('0x1c')](realtime[_0xa238('0x24')]())['then'](trigger['getTriggers']())[_0xa238('0x1c')](realtime[_0xa238('0x25')]())['then'](template[_0xa238('0x26')]())[_0xa238('0x1c')](realtime['initTemplates']())[_0xa238('0x1c')](zendesk['getZendeskAccounts']())[_0xa238('0x1c')](realtime[_0xa238('0x27')]())[_0xa238('0x1c')](salesforce['getSalesforceAccounts']())[_0xa238('0x1c')](realtime['initSalesforceAccounts']())[_0xa238('0x1c')](sugarcrm[_0xa238('0x28')]())[_0xa238('0x1c')](realtime[_0xa238('0x29')]())[_0xa238('0x1c')](freshdesk['getFreshdeskAccounts']())[_0xa238('0x1c')](realtime['initFreshdeskAccounts']())[_0xa238('0x1c')](desk[_0xa238('0x2a')]())[_0xa238('0x1c')](realtime[_0xa238('0x2b')]())['then'](zoho['getZohoAccounts']())['then'](realtime['initZohoAccounts']())[_0xa238('0x1c')](vtiger[_0xa238('0x2c')]())[_0xa238('0x1c')](realtime[_0xa238('0x2d')]())[_0xa238('0x1c')](freshsales[_0xa238('0x2e')]())[_0xa238('0x1c')](realtime['initFreshsalesAccounts']())[_0xa238('0x1c')](servicenow[_0xa238('0x2f')]())[_0xa238('0x1c')](realtime[_0xa238('0x30')]())[_0xa238('0x1c')](dynamics365[_0xa238('0x31')]())['then'](realtime[_0xa238('0x32')]())[_0xa238('0x1c')](campaign['getCampaigns']())['then'](realtime[_0xa238('0x33')]())['then'](voiceExtension[_0xa238('0x34')]())['then'](realtime[_0xa238('0x35')]())['then'](faxAccount[_0xa238('0x36')]())[_0xa238('0x1c')](realtime[_0xa238('0x37')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0xa238('0x1b')]()[_0xa238('0x1c')](voiceQueueReport[_0xa238('0x38')]())[_0xa238('0x1c')](realtime[_0xa238('0x39')]())['then'](cmHopperHistory[_0xa238('0x3a')]())[_0xa238('0x1c')](realtime[_0xa238('0x3b')]())[_0xa238('0x1c')](cmHopperHistory[_0xa238('0x3c')]())['then'](realtime[_0xa238('0x3d')]())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xa238('0x3e')]())[_0xa238('0x3f')](function(_0x100c73){logger[_0xa238('0x40')](_0xa238('0x41'),util[_0xa238('0x42')](_0x100c73,{'showHidden':![],'depth':null}));});}function main(){return server[_0xa238('0x43')](realtime,preview,fax)['then'](function(){return initRealtime();})[_0xa238('0x1c')](function(){return initParams();})[_0xa238('0x1c')](function(){report[_0xa238('0x44')]();setInterval(initRealtime,0x1388);})[_0xa238('0x3f')](function(_0xa3577){logger['error']('[index.js][main]',util[_0xa238('0x42')](_0xa3577,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 0d840e8..43dfac8 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 _0x55a5=['state','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','onhold','local','prototype','updateStatusRealtime','idle','inuse','talking','statePause','toNumber','format','voiceStatusTime','voiceStatusQueue','emit','user:ami:update','user:presence','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname'];(function(_0x280cd6,_0xf6a99e){var _0x3e69e7=function(_0x520b75){while(--_0x520b75){_0x280cd6['push'](_0x280cd6['shift']());}};_0x3e69e7(++_0xf6a99e);}(_0x55a5,0xf7));var _0x555a=function(_0xeadc11,_0x27e378){_0xeadc11=_0xeadc11-0x0;var _0x4257b6=_0x55a5[_0xeadc11];return _0x4257b6;};'use strict';var _=require(_0x555a('0x0'));var util=require('util');var moment=require(_0x555a('0x1'));var Redis=require(_0x555a('0x2'));var config=require(_0x555a('0x3'));config[_0x555a('0x4')]=_[_0x555a('0x5')](config[_0x555a('0x4')],{'host':_0x555a('0x6'),'port':0x18eb});var io=require(_0x555a('0x7'))(new Redis(config[_0x555a('0x4')]));function Agent(_0x262aee){this['id']=_0x262aee['id']||0x0;this[_0x555a('0x8')]=_0x262aee[_0x555a('0x8')]||'';this[_0x555a('0x9')]=_0x262aee[_0x555a('0x9')]||'';this[_0x555a('0xa')]=_0x262aee['accountcode']||'';this[_0x555a('0xb')]=_0x262aee[_0x555a('0xb')]||'';this[_0x555a('0xc')]=_0x555a('0xd');this[_0x555a('0xe')]=0x0;this[_0x555a('0xf')]=_0x555a('0xd');this[_0x555a('0x10')]='';this['phone']='';this[_0x555a('0x11')]='';this[_0x555a('0x12')]='';this[_0x555a('0x13')]=_0x262aee[_0x555a('0x13')]||![];this[_0x555a('0x14')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0x555a('0x15')]=![];this[_0x555a('0x16')]=![];}Agent[_0x555a('0x17')][_0x555a('0x18')]=function(_0x1c5016){if(!_0x1c5016[_0x555a('0xc')]){return;}var _0x3fe691=null;var _0x29ad45=_0x1c5016['state']['toLowerCase']();switch(_0x29ad45){case'not_inuse':_0x29ad45=_0x555a('0x19');break;case _0x555a('0x1a'):_0x29ad45=_0x555a('0x1b');break;}if(this['voiceStatus']!==_0x29ad45||_0x1c5016[_0x555a('0x1c')]){_0x3fe691=_[_0x555a('0x1d')](moment()[_0x555a('0x1e')]('x'));}var _0x59e2e4={'id':this['id'],'name':this[_0x555a('0x8')],'email':this['email'],'accountcode':this[_0x555a('0xa')],'fullname':this[_0x555a('0xb')],'state':this[_0x555a('0xc')],'stateTime':this[_0x555a('0xe')],'status':this[_0x555a('0xf')],'address':this[_0x555a('0x10')],'voiceStatus':_0x29ad45||this[_0x555a('0x14')],'voiceStatusTime':_0x3fe691||this[_0x555a('0x1f')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x555a('0x20')],'interface':this[_0x555a('0x12')],'onhold':this[_0x555a('0x15')]};if(this['voiceStatus']!==_0x29ad45){this[_0x555a('0x14')]=_0x29ad45;io['to'](util[_0x555a('0x1e')]('user:%s',_0x59e2e4[_0x555a('0x8')]))[_0x555a('0x21')](_0x555a('0x22'),_0x59e2e4);io[_0x555a('0x21')](_0x555a('0x23'),_0x59e2e4);}};module[_0x555a('0x24')]=Agent; \ No newline at end of file +var _0xea70=['not_inuse','talking','statePause','toNumber','format','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','user:%s','emit','user:ami:update','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','local','prototype','updateStatusRealtime','toLowerCase'];(function(_0x3a8789,_0x5bb70b){var _0x19e422=function(_0x49d386){while(--_0x49d386){_0x3a8789['push'](_0x3a8789['shift']());}};_0x19e422(++_0x5bb70b);}(_0xea70,0x175));var _0x0ea7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xea70[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x0ea7('0x0'));var util=require(_0x0ea7('0x1'));var moment=require(_0x0ea7('0x2'));var Redis=require('ioredis');var config=require(_0x0ea7('0x3'));config['redis']=_[_0x0ea7('0x4')](config['redis'],{'host':_0x0ea7('0x5'),'port':0x18eb});var io=require(_0x0ea7('0x6'))(new Redis(config[_0x0ea7('0x7')]));function Agent(_0x221ac8){this['id']=_0x221ac8['id']||0x0;this[_0x0ea7('0x8')]=_0x221ac8['name']||'';this[_0x0ea7('0x9')]=_0x221ac8[_0x0ea7('0x9')]||'';this['accountcode']=_0x221ac8[_0x0ea7('0xa')]||'';this[_0x0ea7('0xb')]=_0x221ac8['fullname']||'';this[_0x0ea7('0xc')]=_0x0ea7('0xd');this[_0x0ea7('0xe')]=0x0;this[_0x0ea7('0xf')]='unknown';this[_0x0ea7('0x10')]='';this[_0x0ea7('0x11')]='';this[_0x0ea7('0x12')]='';this[_0x0ea7('0x13')]='';this[_0x0ea7('0x14')]=_0x221ac8['online']||![];this[_0x0ea7('0x15')]=_0x0ea7('0xd');this[_0x0ea7('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x0ea7('0x17')]=![];}Agent[_0x0ea7('0x18')][_0x0ea7('0x19')]=function(_0x2cd543){if(!_0x2cd543['state']){return;}var _0x488067=null;var _0x48044a=_0x2cd543[_0x0ea7('0xc')][_0x0ea7('0x1a')]();switch(_0x48044a){case _0x0ea7('0x1b'):_0x48044a='idle';break;case'inuse':_0x48044a=_0x0ea7('0x1c');break;}if(this[_0x0ea7('0x15')]!==_0x48044a||_0x2cd543[_0x0ea7('0x1d')]){_0x488067=_[_0x0ea7('0x1e')](moment()[_0x0ea7('0x1f')]('x'));}var _0x987032={'id':this['id'],'name':this[_0x0ea7('0x8')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x0ea7('0xb')],'state':this[_0x0ea7('0xc')],'stateTime':this['stateTime'],'status':this[_0x0ea7('0xf')],'address':this[_0x0ea7('0x10')],'voiceStatus':_0x48044a||this[_0x0ea7('0x15')],'voiceStatusTime':_0x488067||this[_0x0ea7('0x16')],'voiceStatusCallerIdNumber':this[_0x0ea7('0x20')],'voiceStatusQueue':this[_0x0ea7('0x21')],'interface':this['interface'],'onhold':this[_0x0ea7('0x22')]};if(this[_0x0ea7('0x15')]!==_0x48044a){this[_0x0ea7('0x15')]=_0x48044a;io['to'](util[_0x0ea7('0x1f')](_0x0ea7('0x23'),_0x987032[_0x0ea7('0x8')]))[_0x0ea7('0x24')](_0x0ea7('0x25'),_0x987032);io['emit'](_0x0ea7('0x26'),_0x987032);}};module[_0x0ea7('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 707c747..650fda5 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 _0xc9d8=['dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0xc9d8,0xc2));var _0x8c9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9d8[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x230d61){this['id']=_0x230d61['id']||0x0;this[_0x8c9d('0x0')]=_0x230d61[_0x8c9d('0x0')]||'';this[_0x8c9d('0x1')]=_0x230d61['type']||_0x8c9d('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x8c9d('0x3')]=0x0;this[_0x8c9d('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x8c9d('0x5')]=_0x230d61[_0x8c9d('0x5')];this[_0x8c9d('0x6')]=_0x230d61[_0x8c9d('0x6')];this['dialTimezone']=_0x230d61['dialTimezone']||null;this[_0x8c9d('0x7')]=_0x230d61[_0x8c9d('0x7')]?_0x230d61[_0x8c9d('0x7')]:null;this[_0x8c9d('0x8')]=_0x230d61[_0x8c9d('0x8')];this[_0x8c9d('0x9')]=_0x230d61['dialOriginateCallerIdNumber'];this[_0x8c9d('0xa')]=_0x230d61[_0x8c9d('0xa')]||0x1e;this[_0x8c9d('0xb')]=_0x230d61['dialCongestionMaxRetry'];this[_0x8c9d('0xc')]=_0x230d61[_0x8c9d('0xc')];this[_0x8c9d('0xd')]=_0x230d61['dialBusyMaxRetry'];this[_0x8c9d('0xe')]=_0x230d61[_0x8c9d('0xe')];this[_0x8c9d('0xf')]=_0x230d61['dialNoAnswerMaxRetry'];this[_0x8c9d('0x10')]=_0x230d61[_0x8c9d('0x10')];this[_0x8c9d('0x11')]=_0x230d61[_0x8c9d('0x11')];this[_0x8c9d('0x12')]=_0x230d61[_0x8c9d('0x12')]||0x3;this[_0x8c9d('0x13')]=_0x230d61[_0x8c9d('0x13')]||0x96;this[_0x8c9d('0x14')]=_0x230d61[_0x8c9d('0x14')]||0x3;this[_0x8c9d('0x15')]=_0x230d61[_0x8c9d('0x15')]||0x96;this[_0x8c9d('0x16')]=_0x230d61[_0x8c9d('0x16')]||0x3;this[_0x8c9d('0x17')]=_0x230d61[_0x8c9d('0x17')]||0x96;this[_0x8c9d('0x18')]=_0x230d61[_0x8c9d('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x230d61[_0x8c9d('0x19')]||0x96;this[_0x8c9d('0x1a')]=_0x230d61[_0x8c9d('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x230d61[_0x8c9d('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0x230d61['dialOrderByScheduledAt']||_0x8c9d('0x1c');this[_0x8c9d('0x1d')]=_0x230d61[_0x8c9d('0x1d')]||undefined;this[_0x8c9d('0x1e')]=_0x230d61[_0x8c9d('0x1e')]||undefined;this[_0x8c9d('0x1f')]=_0x230d61[_0x8c9d('0x1f')]||undefined;this[_0x8c9d('0x20')]=_0x230d61['TrunkBackup']?_0x230d61[_0x8c9d('0x20')]:undefined;this[_0x8c9d('0x21')]=_0x230d61[_0x8c9d('0x21')]?_0x230d61['Trunk']:undefined;this['Interval']=_0x230d61[_0x8c9d('0x22')]?_0x230d61[_0x8c9d('0x22')]:undefined;this[_0x8c9d('0x23')]=_0x230d61[_0x8c9d('0x23')]?_0x230d61[_0x8c9d('0x23')]:undefined;this[_0x8c9d('0x24')]=_0x230d61[_0x8c9d('0x23')]?_0x230d61[_0x8c9d('0x23')][_0x8c9d('0x0')]:undefined;this['dialAMDActive']=_0x230d61[_0x8c9d('0x25')]||![];this[_0x8c9d('0x26')]=_0x230d61[_0x8c9d('0x26')];this[_0x8c9d('0x27')]=_0x230d61[_0x8c9d('0x27')];this[_0x8c9d('0x28')]=_0x230d61[_0x8c9d('0x28')];this['dialAMDTotalAnalysisTime']=_0x230d61[_0x8c9d('0x29')];this[_0x8c9d('0x2a')]=_0x230d61[_0x8c9d('0x2a')];this['dialAMDBetweenWordsSilence']=_0x230d61['dialAMDBetweenWordsSilence'];this[_0x8c9d('0x2b')]=_0x230d61[_0x8c9d('0x2b')];this['dialAMDSilenceThreshold']=_0x230d61[_0x8c9d('0x2c')];this[_0x8c9d('0x2d')]=_0x230d61[_0x8c9d('0x2d')];}module['exports']=Campaign; \ No newline at end of file +var _0x49f6=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x44371f,_0x56bac3){var _0x3de047=function(_0x2d1978){while(--_0x2d1978){_0x44371f['push'](_0x44371f['shift']());}};_0x3de047(++_0x56bac3);}(_0x49f6,0xaf));var _0x649f=function(_0xb0c646,_0x518e15){_0xb0c646=_0xb0c646-0x0;var _0x3bf186=_0x49f6[_0xb0c646];return _0x3bf186;};'use strict';function Campaign(_0x133017){this['id']=_0x133017['id']||0x0;this[_0x649f('0x0')]=_0x133017['name']||'';this[_0x649f('0x1')]=_0x133017[_0x649f('0x1')]||_0x649f('0x2');this[_0x649f('0x3')]=0x0;this['temp']=0x0;this[_0x649f('0x4')]=0x0;this[_0x649f('0x5')]=0x0;this[_0x649f('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x649f('0x7')]=_0x133017['active'];this[_0x649f('0x8')]=_0x133017['limitCalls'];this[_0x649f('0x9')]=_0x133017[_0x649f('0x9')]||null;this['dialGlobalInterval']=_0x133017[_0x649f('0xa')]?_0x133017[_0x649f('0xa')]:null;this[_0x649f('0xb')]=_0x133017[_0x649f('0xb')];this[_0x649f('0xc')]=_0x133017[_0x649f('0xc')];this[_0x649f('0xd')]=_0x133017[_0x649f('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x133017[_0x649f('0xe')];this[_0x649f('0xf')]=_0x133017['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x133017['dialBusyMaxRetry'];this[_0x649f('0x10')]=_0x133017[_0x649f('0x10')];this[_0x649f('0x11')]=_0x133017['dialNoAnswerMaxRetry'];this[_0x649f('0x12')]=_0x133017['dialNoAnswerRetryFrequency'];this[_0x649f('0x13')]=_0x133017['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x133017[_0x649f('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x133017[_0x649f('0x15')]||0x96;this[_0x649f('0x16')]=_0x133017['dialDropMaxRetry']||0x3;this[_0x649f('0x17')]=_0x133017[_0x649f('0x17')]||0x96;this[_0x649f('0x18')]=_0x133017[_0x649f('0x18')]||0x3;this[_0x649f('0x19')]=_0x133017[_0x649f('0x19')]||0x96;this[_0x649f('0x1a')]=_0x133017[_0x649f('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x133017['dialMachineRetryFrequency']||0x96;this[_0x649f('0x1b')]=_0x133017[_0x649f('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x133017[_0x649f('0x1c')]||0x96;this[_0x649f('0x1d')]=_0x133017[_0x649f('0x1d')]||'DESC';this['dialPrefix']=_0x133017['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x133017[_0x649f('0x1e')]||undefined;this[_0x649f('0x1f')]=_0x133017[_0x649f('0x1f')]||undefined;this[_0x649f('0x20')]=_0x133017[_0x649f('0x20')]?_0x133017[_0x649f('0x20')]:undefined;this['Trunk']=_0x133017[_0x649f('0x21')]?_0x133017[_0x649f('0x21')]:undefined;this['Interval']=_0x133017[_0x649f('0x22')]?_0x133017['Interval']:undefined;this[_0x649f('0x23')]=_0x133017[_0x649f('0x23')]?_0x133017[_0x649f('0x23')]:undefined;this[_0x649f('0x24')]=_0x133017['SquareProject']?_0x133017[_0x649f('0x23')][_0x649f('0x0')]:undefined;this['dialAMDActive']=_0x133017['dialAMDActive']||![];this[_0x649f('0x25')]=_0x133017['dialAMDInitialSilence'];this[_0x649f('0x26')]=_0x133017[_0x649f('0x26')];this[_0x649f('0x27')]=_0x133017[_0x649f('0x27')];this[_0x649f('0x28')]=_0x133017[_0x649f('0x28')];this['dialAMDMinWordLength']=_0x133017[_0x649f('0x29')];this[_0x649f('0x2a')]=_0x133017[_0x649f('0x2a')];this[_0x649f('0x2b')]=_0x133017[_0x649f('0x2b')];this[_0x649f('0x2c')]=_0x133017[_0x649f('0x2c')];this[_0x649f('0x2d')]=_0x133017['dialAMDMaximumWordLength'];}module[_0x649f('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index f41c758..e1c21b1 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 _0x7292=['queue','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','type','monitor','monitorFilename'];(function(_0x15e1d3,_0xa81e3d){var _0x1b8c3c=function(_0xaa126a){while(--_0xaa126a){_0x15e1d3['push'](_0x15e1d3['shift']());}};_0x1b8c3c(++_0xa81e3d);}(_0x7292,0x6d));var _0x2729=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x7292[_0x1ccdf7];return _0x52a0ae;};'use strict';function Channel(){this[_0x2729('0x0')]=null;this[_0x2729('0x1')]='';this[_0x2729('0x2')]='';this[_0x2729('0x3')]=0x0;this[_0x2729('0x4')]='';this[_0x2729('0x5')]=undefined;this['connectedlinename']=undefined;this[_0x2729('0x6')]=0x0;this[_0x2729('0x7')]='';this[_0x2729('0x8')]=0x0;this[_0x2729('0x9')]=0x0;this[_0x2729('0xa')]=0x0;this['answered']=![];this[_0x2729('0xb')]=null;this[_0x2729('0xc')]=null;this[_0x2729('0xd')]=![];this[_0x2729('0xe')]=![];this[_0x2729('0xf')]='';this[_0x2729('0x10')]='';this['duration']=0x0;this[_0x2729('0x11')]=0x0;this['holdtime']=0x0;this[_0x2729('0x12')]=null;this['tag']=null;this['disposition']=null;this[_0x2729('0x13')]=![];this[_0x2729('0x14')]=null;this[_0x2729('0x15')]=null;this[_0x2729('0x16')]=[];this[_0x2729('0x17')]=undefined;this[_0x2729('0x18')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x2729('0x19')]=Channel; \ No newline at end of file +var _0xa509=['answered','endtime','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','accountcode','context','uniqueid','linkedid'];(function(_0x5246d6,_0x2a9766){var _0x5c1be4=function(_0x18e208){while(--_0x18e208){_0x5246d6['push'](_0x5246d6['shift']());}};_0x5c1be4(++_0x2a9766);}(_0xa509,0x12f));var _0x9a50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa509[_0x122ef9];return _0x42fba0;};'use strict';function Channel(){this[_0x9a50('0x0')]=null;this[_0x9a50('0x1')]='';this[_0x9a50('0x2')]='';this[_0x9a50('0x3')]=0x0;this['calleridname']='';this[_0x9a50('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x9a50('0x5')]=0x0;this[_0x9a50('0x6')]='';this[_0x9a50('0x7')]=0x0;this[_0x9a50('0x8')]=0x0;this['exten']=0x0;this[_0x9a50('0x9')]=![];this['answertime']=null;this[_0x9a50('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0x9a50('0xb')]=0x0;this[_0x9a50('0xc')]=0x0;this[_0x9a50('0xd')]=0x0;this[_0x9a50('0xe')]=null;this[_0x9a50('0xf')]=null;this[_0x9a50('0x10')]=null;this[_0x9a50('0x11')]=![];this[_0x9a50('0x12')]=null;this[_0x9a50('0x13')]=null;this[_0x9a50('0x14')]=[];this[_0x9a50('0x15')]=undefined;this[_0x9a50('0x16')]=undefined;this[_0x9a50('0x17')]=undefined;this[_0x9a50('0x18')]=0x0;}module[_0x9a50('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 208d9d4..82c8d9d 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 _0x02bd=['tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x3f5102,_0x4797aa){var _0x1835fa=function(_0x114ddb){while(--_0x114ddb){_0x3f5102['push'](_0x3f5102['shift']());}};_0x1835fa(++_0x4797aa);}(_0x02bd,0x1bf));var _0xd02b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x02bd[_0x4b369d];return _0x571a98;};'use strict';function DeskAccount(_0x4ddba0){this['id']=_0x4ddba0['id']||0x0;this[_0xd02b('0x0')]=_0x4ddba0[_0xd02b('0x0')]||'';this[_0xd02b('0x1')]=_0x4ddba0[_0xd02b('0x1')]||'';this[_0xd02b('0x2')]=_0x4ddba0[_0xd02b('0x2')]||'';this[_0xd02b('0x3')]=_0x4ddba0['authType']||'';this[_0xd02b('0x4')]=_0x4ddba0['password']||'';this[_0xd02b('0x5')]=_0x4ddba0['consumerKey']||'';this[_0xd02b('0x6')]=_0x4ddba0[_0xd02b('0x6')]||'';this[_0xd02b('0x7')]=_0x4ddba0[_0xd02b('0x7')]||'';this[_0xd02b('0x8')]=_0x4ddba0[_0xd02b('0x8')]||'';this[_0xd02b('0x9')]=_0x4ddba0[_0xd02b('0x9')]||'';this[_0xd02b('0xa')]=_0x4ddba0[_0xd02b('0xa')]||'';this[_0xd02b('0xb')]=_0x4ddba0[_0xd02b('0xb')]||{};}module[_0xd02b('0xc')]=DeskAccount; \ No newline at end of file +var _0x7489=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x7489,0x196));var _0x9748=function(_0x247338,_0x495ac3){_0x247338=_0x247338-0x0;var _0x24ca6d=_0x7489[_0x247338];return _0x24ca6d;};'use strict';function DeskAccount(_0x5e7af1){this['id']=_0x5e7af1['id']||0x0;this[_0x9748('0x0')]=_0x5e7af1[_0x9748('0x0')]||'';this[_0x9748('0x1')]=_0x5e7af1['username']||'';this[_0x9748('0x2')]=_0x5e7af1[_0x9748('0x2')]||'';this[_0x9748('0x3')]=_0x5e7af1[_0x9748('0x3')]||'';this[_0x9748('0x4')]=_0x5e7af1[_0x9748('0x4')]||'';this[_0x9748('0x5')]=_0x5e7af1['consumerKey']||'';this[_0x9748('0x6')]=_0x5e7af1[_0x9748('0x6')]||'';this['token']=_0x5e7af1[_0x9748('0x7')]||'';this[_0x9748('0x8')]=_0x5e7af1[_0x9748('0x8')]||'';this[_0x9748('0x9')]=_0x5e7af1[_0x9748('0x9')]||'';this['serverUrl']=_0x5e7af1[_0x9748('0xa')]||'';this[_0x9748('0xb')]=_0x5e7af1[_0x9748('0xb')]||{};}module[_0x9748('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c716e44..ec7f673 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 _0x5696=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri'];(function(_0x4d8023,_0x201da7){var _0x723969=function(_0x3c206e){while(--_0x3c206e){_0x4d8023['push'](_0x4d8023['shift']());}};_0x723969(++_0x201da7);}(_0x5696,0x1b4));var _0x6569=function(_0xda7efc,_0x33708c){_0xda7efc=_0xda7efc-0x0;var _0x5cdf85=_0x5696[_0xda7efc];return _0x5cdf85;};'use strict';function Dynamics365Account(_0x2c2a41){this['id']=_0x2c2a41['id']||0x0;this[_0x6569('0x0')]=_0x2c2a41[_0x6569('0x0')]||'';this[_0x6569('0x1')]=_0x2c2a41[_0x6569('0x1')]||'';this[_0x6569('0x2')]=_0x2c2a41['password']||'';this[_0x6569('0x3')]=_0x2c2a41['remoteUri']||'';this['tenantId']=_0x2c2a41['tenantId']||'';this[_0x6569('0x4')]=_0x2c2a41[_0x6569('0x4')]||'';this[_0x6569('0x5')]=_0x2c2a41[_0x6569('0x5')]||{};this[_0x6569('0x6')]=_0x2c2a41['serverUrl']||'';this['modernAuthentication']=_0x2c2a41[_0x6569('0x7')]||![];this[_0x6569('0x8')]=_0x2c2a41['Configurations']||{};this[_0x6569('0x9')]=_0x2c2a41['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xe7bf=['modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x32ff5d,_0x232301){var _0x108cdd=function(_0x413149){while(--_0x413149){_0x32ff5d['push'](_0x32ff5d['shift']());}};_0x108cdd(++_0x232301);}(_0xe7bf,0xc4));var _0xfe7b=function(_0x48e60c,_0x159a4d){_0x48e60c=_0x48e60c-0x0;var _0x2c80c3=_0xe7bf[_0x48e60c];return _0x2c80c3;};'use strict';function Dynamics365Account(_0x5f1de6){this['id']=_0x5f1de6['id']||0x0;this['name']=_0x5f1de6[_0xfe7b('0x0')]||'';this[_0xfe7b('0x1')]=_0x5f1de6[_0xfe7b('0x1')]||'';this[_0xfe7b('0x2')]=_0x5f1de6['password']||'';this[_0xfe7b('0x3')]=_0x5f1de6[_0xfe7b('0x3')]||'';this['tenantId']=_0x5f1de6[_0xfe7b('0x4')]||'';this[_0xfe7b('0x5')]=_0x5f1de6[_0xfe7b('0x5')]||'';this[_0xfe7b('0x6')]=_0x5f1de6[_0xfe7b('0x6')]||{};this[_0xfe7b('0x7')]=_0x5f1de6[_0xfe7b('0x7')]||'';this[_0xfe7b('0x8')]=_0x5f1de6[_0xfe7b('0x8')]||![];this[_0xfe7b('0x9')]=_0x5f1de6['Configurations']||{};this[_0xfe7b('0xa')]=_0x5f1de6[_0xfe7b('0xa')]||{};}module[_0xfe7b('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 947e798..66165fc 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 _0xd3e1=['localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd3e1,0x7a));var _0x1d3e=function(_0x571c1e,_0x3b5f56){_0x571c1e=_0x571c1e-0x0;var _0x4b2fd9=_0xd3e1[_0x571c1e];return _0x4b2fd9;};'use strict';function FaxAccount(_0x1e26f3){this['id']=_0x1e26f3['id']||0x0;this[_0x1d3e('0x0')]=_0x1e26f3[_0x1d3e('0x0')]||'';this[_0x1d3e('0x1')]=_0x1e26f3[_0x1d3e('0x1')];this[_0x1d3e('0x2')]=_0x1e26f3[_0x1d3e('0x2')];this[_0x1d3e('0x3')]=_0x1e26f3[_0x1d3e('0x3')];this[_0x1d3e('0x4')]=_0x1e26f3[_0x1d3e('0x4')];this[_0x1d3e('0x5')]=_0x1e26f3['minrate']||0x960;this[_0x1d3e('0x6')]=_0x1e26f3[_0x1d3e('0x6')]||0x3840;this[_0x1d3e('0x7')]=_0x1e26f3[_0x1d3e('0x7')]||_0x1d3e('0x8');this['gateway']=_0x1e26f3[_0x1d3e('0x9')]||'no';this['faxdetect']=_0x1e26f3[_0x1d3e('0xa')]||'no';this[_0x1d3e('0xb')]=_0x1e26f3[_0x1d3e('0xb')]||0x1388;this[_0x1d3e('0xc')]=_0x1e26f3[_0x1d3e('0xc')]||_0x1d3e('0xd');this['Trunk']=_0x1e26f3[_0x1d3e('0xe')]?_0x1e26f3[_0x1d3e('0xe')]:undefined;this[_0x1d3e('0xf')]=_0x1e26f3[_0x1d3e('0xf')];this['key']=_0x1e26f3[_0x1d3e('0x10')];}module[_0x1d3e('0x11')]=FaxAccount; \ No newline at end of file +var _0xc2b2=['Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','SIP'];(function(_0x5c6fc0,_0x2ae293){var _0x10a569=function(_0x298f7a){while(--_0x298f7a){_0x5c6fc0['push'](_0x5c6fc0['shift']());}};_0x10a569(++_0x2ae293);}(_0xc2b2,0xb8));var _0x2c2b=function(_0x3d0231,_0x3d4bae){_0x3d0231=_0x3d0231-0x0;var _0x25d000=_0xc2b2[_0x3d0231];return _0x25d000;};'use strict';function FaxAccount(_0x3db3fe){this['id']=_0x3db3fe['id']||0x0;this[_0x2c2b('0x0')]=_0x3db3fe[_0x2c2b('0x0')]||'';this[_0x2c2b('0x1')]=_0x3db3fe['description'];this[_0x2c2b('0x2')]=_0x3db3fe[_0x2c2b('0x2')];this['headerinfo']=_0x3db3fe[_0x2c2b('0x3')];this['localstationid']=_0x3db3fe['localstationid'];this[_0x2c2b('0x4')]=_0x3db3fe[_0x2c2b('0x4')]||0x960;this['maxrate']=_0x3db3fe[_0x2c2b('0x5')]||0x3840;this['modem']=_0x3db3fe['modem']||_0x2c2b('0x6');this[_0x2c2b('0x7')]=_0x3db3fe[_0x2c2b('0x7')]||'no';this[_0x2c2b('0x8')]=_0x3db3fe[_0x2c2b('0x8')]||'no';this[_0x2c2b('0x9')]=_0x3db3fe[_0x2c2b('0x9')]||0x1388;this['tech']=_0x3db3fe['tech']||_0x2c2b('0xa');this[_0x2c2b('0xb')]=_0x3db3fe['Trunk']?_0x3db3fe['Trunk']:undefined;this[_0x2c2b('0xc')]=_0x3db3fe['ListId'];this['key']=_0x3db3fe[_0x2c2b('0xd')];}module[_0x2c2b('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index a5d8783..a6925c2 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 _0x2ce6=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x104ada,_0xc16fff){var _0x70ab44=function(_0x5f2d8b){while(--_0x5f2d8b){_0x104ada['push'](_0x104ada['shift']());}};_0x70ab44(++_0xc16fff);}(_0x2ce6,0x1d7));var _0x62ce=function(_0x33e566,_0x3e90f4){_0x33e566=_0x33e566-0x0;var _0x828b80=_0x2ce6[_0x33e566];return _0x828b80;};'use strict';function FreshdeskAccount(_0x4e59b1){this['id']=_0x4e59b1['id']||0x0;this[_0x62ce('0x0')]=_0x4e59b1[_0x62ce('0x0')]||'';this[_0x62ce('0x1')]=_0x4e59b1[_0x62ce('0x1')]||'';this[_0x62ce('0x2')]=_0x4e59b1[_0x62ce('0x3')]||'';this[_0x62ce('0x4')]=_0x4e59b1[_0x62ce('0x4')]||'';this[_0x62ce('0x5')]=_0x4e59b1[_0x62ce('0x5')]||'';this[_0x62ce('0x6')]=_0x4e59b1[_0x62ce('0x6')]||{};}module[_0x62ce('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x178c=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x178c,0xdd));var _0xc178=function(_0x8fd62a,_0x18203d){_0x8fd62a=_0x8fd62a-0x0;var _0x2354bc=_0x178c[_0x8fd62a];return _0x2354bc;};'use strict';function FreshdeskAccount(_0x197539){this['id']=_0x197539['id']||0x0;this[_0xc178('0x0')]=_0x197539[_0xc178('0x0')]||'';this[_0xc178('0x1')]=_0x197539[_0xc178('0x1')]||'';this[_0xc178('0x2')]=_0x197539[_0xc178('0x3')]||'';this[_0xc178('0x4')]=_0x197539[_0xc178('0x4')]||'';this[_0xc178('0x5')]=_0x197539['serverUrl']||'';this[_0xc178('0x6')]=_0x197539[_0xc178('0x6')]||{};}module[_0xc178('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 68aa962..b24e997 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 _0xab3f=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x1c36f9,_0x14139c){var _0x36d105=function(_0x905955){while(--_0x905955){_0x1c36f9['push'](_0x1c36f9['shift']());}};_0x36d105(++_0x14139c);}(_0xab3f,0x72));var _0xfab3=function(_0x48d4c5,_0xc0140e){_0x48d4c5=_0x48d4c5-0x0;var _0x258d98=_0xab3f[_0x48d4c5];return _0x258d98;};'use strict';function FreshsalesAccount(_0x2cd0f4){this['id']=_0x2cd0f4['id']||0x0;this['name']=_0x2cd0f4[_0xfab3('0x0')]||'';this[_0xfab3('0x1')]=_0x2cd0f4[_0xfab3('0x1')]||'';this[_0xfab3('0x2')]=_0x2cd0f4[_0xfab3('0x3')]||'';this[_0xfab3('0x4')]=_0x2cd0f4[_0xfab3('0x4')]||'';this[_0xfab3('0x5')]=_0x2cd0f4[_0xfab3('0x5')]||'';this[_0xfab3('0x6')]=_0x2cd0f4[_0xfab3('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xb194=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0xb194,0x1b2));var _0x4b19=function(_0x53615b,_0xf060d5){_0x53615b=_0x53615b-0x0;var _0x6058f=_0xb194[_0x53615b];return _0x6058f;};'use strict';function FreshsalesAccount(_0xfec122){this['id']=_0xfec122['id']||0x0;this['name']=_0xfec122[_0x4b19('0x0')]||'';this[_0x4b19('0x1')]=_0xfec122[_0x4b19('0x1')]||'';this[_0x4b19('0x2')]=_0xfec122[_0x4b19('0x3')]||'';this['remoteUri']=_0xfec122[_0x4b19('0x4')]||'';this[_0x4b19('0x5')]=_0xfec122['serverUrl']||'';this[_0x4b19('0x6')]=_0xfec122['Configurations']||{};}module[_0x4b19('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 9290892..86dc815 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 _0x44ef=['calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','channel','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','voice','routealias','variables','exports','type','inbound','calleridnum'];(function(_0x2491a0,_0x5528d7){var _0x3d21e9=function(_0x54d373){while(--_0x54d373){_0x2491a0['push'](_0x2491a0['shift']());}};_0x3d21e9(++_0x5528d7);}(_0x44ef,0x142));var _0xf44e=function(_0x1fe605,_0x40b736){_0x1fe605=_0x1fe605-0x0;var _0x3a6f6c=_0x44ef[_0x1fe605];return _0x3a6f6c;};'use strict';function QueueReport(){this[_0xf44e('0x0')]=_0xf44e('0x1');this['uniqueid']='';this[_0xf44e('0x2')]='';this[_0xf44e('0x3')]='';this['queue']='';this[_0xf44e('0x4')]=null;this[_0xf44e('0x5')]=null;this[_0xf44e('0x6')]=0x1;this[_0xf44e('0x7')]=0x1;this['queuecallerabandon']=![];this[_0xf44e('0x8')]=null;this[_0xf44e('0x9')]=![];this['queuecallercompleteAt']=null;this[_0xf44e('0xa')]=![];this[_0xf44e('0xb')]=null;this['originalposition']=0x1;this[_0xf44e('0xc')]='';this['connectedlinenum']='';this[_0xf44e('0xd')]='';this[_0xf44e('0xe')]='';this[_0xf44e('0xf')]='';this[_0xf44e('0x10')]='';this['priority']='';this[_0xf44e('0x11')]=0x0;this[_0xf44e('0x12')]=![];this[_0xf44e('0x13')]='';this[_0xf44e('0x14')]=_0xf44e('0x15');this[_0xf44e('0x16')]=null;this['mohtime']=0x0;this[_0xf44e('0x17')]={};}module[_0xf44e('0x18')]=QueueReport; \ No newline at end of file +var _0xee14=['accountcode','exten','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename'];(function(_0x3a6288,_0x36ede4){var _0x24eb1a=function(_0x57f771){while(--_0x57f771){_0x3a6288['push'](_0x3a6288['shift']());}};_0x24eb1a(++_0x36ede4);}(_0xee14,0xc1));var _0x4ee1=function(_0x12b849,_0x4793e6){_0x12b849=_0x12b849-0x0;var _0x5ca429=_0xee14[_0x12b849];return _0x5ca429;};'use strict';function QueueReport(){this[_0x4ee1('0x0')]='inbound';this[_0x4ee1('0x1')]='';this[_0x4ee1('0x2')]='';this[_0x4ee1('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x4ee1('0x4')]=null;this['position']=0x1;this[_0x4ee1('0x5')]=0x1;this[_0x4ee1('0x6')]=![];this[_0x4ee1('0x7')]=null;this['queuecallercomplete']=![];this[_0x4ee1('0x8')]=null;this[_0x4ee1('0x9')]=![];this[_0x4ee1('0xa')]=null;this[_0x4ee1('0xb')]=0x1;this[_0x4ee1('0xc')]='';this['connectedlinenum']='';this[_0x4ee1('0xd')]='';this[_0x4ee1('0xe')]='';this['context']='';this[_0x4ee1('0xf')]='';this['priority']='';this[_0x4ee1('0x10')]=0x0;this[_0x4ee1('0x11')]=![];this[_0x4ee1('0x12')]='';this['motionChannel']=_0x4ee1('0x13');this['routealias']=null;this[_0x4ee1('0x14')]=0x0;this[_0x4ee1('0x15')]={};}module[_0x4ee1('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 45573df..a77afec 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 _0x4c41=['type','serverUrl','Configurations','exports','name','remoteUri','password','clientId','clientSecret'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x4c41,0xf7));var _0x14c4=function(_0x195894,_0x39f89f){_0x195894=_0x195894-0x0;var _0x2c1cbf=_0x4c41[_0x195894];return _0x2c1cbf;};'use strict';function SalesforceAccount(_0x536b58){this['id']=_0x536b58['id']||0x0;this[_0x14c4('0x0')]=_0x536b58['name']||'';this['username']=_0x536b58['username']||'';this['remoteUri']=_0x536b58[_0x14c4('0x1')]||'';this[_0x14c4('0x2')]=_0x536b58['password']||'';this[_0x14c4('0x3')]=_0x536b58[_0x14c4('0x3')]||'';this['clientSecret']=_0x536b58[_0x14c4('0x4')]||'';this['securityToken']=_0x536b58['securityToken']||'';this['type']=_0x536b58[_0x14c4('0x5')]||'integrationTab';this['serverUrl']=_0x536b58[_0x14c4('0x6')]||'';this['Configurations']=_0x536b58[_0x14c4('0x7')]||{};}module[_0x14c4('0x8')]=SalesforceAccount; \ No newline at end of file +var _0x856f=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x3dc98a,_0x403f00){var _0x27f3ad=function(_0xaa6123){while(--_0xaa6123){_0x3dc98a['push'](_0x3dc98a['shift']());}};_0x27f3ad(++_0x403f00);}(_0x856f,0x1b7));var _0xf856=function(_0x5e5177,_0x2601ae){_0x5e5177=_0x5e5177-0x0;var _0xf7695f=_0x856f[_0x5e5177];return _0xf7695f;};'use strict';function SalesforceAccount(_0x1cbd13){this['id']=_0x1cbd13['id']||0x0;this[_0xf856('0x0')]=_0x1cbd13[_0xf856('0x0')]||'';this[_0xf856('0x1')]=_0x1cbd13['username']||'';this['remoteUri']=_0x1cbd13[_0xf856('0x2')]||'';this[_0xf856('0x3')]=_0x1cbd13['password']||'';this[_0xf856('0x4')]=_0x1cbd13['clientId']||'';this[_0xf856('0x5')]=_0x1cbd13[_0xf856('0x5')]||'';this[_0xf856('0x6')]=_0x1cbd13[_0xf856('0x6')]||'';this[_0xf856('0x7')]=_0x1cbd13[_0xf856('0x7')]||_0xf856('0x8');this[_0xf856('0x9')]=_0x1cbd13[_0xf856('0x9')]||'';this[_0xf856('0xa')]=_0x1cbd13[_0xf856('0xa')]||{};}module[_0xf856('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 6b90666..8104788 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 _0x4a92=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4f8ef3,_0x27f00a){var _0x15471e=function(_0x3b20a1){while(--_0x3b20a1){_0x4f8ef3['push'](_0x4f8ef3['shift']());}};_0x15471e(++_0x27f00a);}(_0x4a92,0x85));var _0x24a9=function(_0x5d6482,_0x1c9b00){_0x5d6482=_0x5d6482-0x0;var _0x32e681=_0x4a92[_0x5d6482];return _0x32e681;};'use strict';function ServicenowAccount(_0x458e8f){this['id']=_0x458e8f['id']||0x0;this['name']=_0x458e8f[_0x24a9('0x0')]||'';this['username']=_0x458e8f[_0x24a9('0x1')]||'';this[_0x24a9('0x2')]=_0x458e8f['password']||'';this[_0x24a9('0x3')]=_0x458e8f[_0x24a9('0x3')]||'';this[_0x24a9('0x4')]=_0x458e8f[_0x24a9('0x4')]||'';this['Configurations']=_0x458e8f[_0x24a9('0x5')]||{};}module[_0x24a9('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x37d1=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xd6aad,_0x3fd78e){var _0x1109e6=function(_0x37f59c){while(--_0x37f59c){_0xd6aad['push'](_0xd6aad['shift']());}};_0x1109e6(++_0x3fd78e);}(_0x37d1,0x14b));var _0x137d=function(_0x50f5af,_0x24108f){_0x50f5af=_0x50f5af-0x0;var _0x312322=_0x37d1[_0x50f5af];return _0x312322;};'use strict';function ServicenowAccount(_0x421495){this['id']=_0x421495['id']||0x0;this[_0x137d('0x0')]=_0x421495[_0x137d('0x0')]||'';this[_0x137d('0x1')]=_0x421495[_0x137d('0x1')]||'';this[_0x137d('0x2')]=_0x421495['password']||'';this[_0x137d('0x3')]=_0x421495[_0x137d('0x3')]||'';this[_0x137d('0x4')]=_0x421495['serverUrl']||'';this['Configurations']=_0x421495[_0x137d('0x5')]||{};}module[_0x137d('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 6247326..3218c88 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 _0xe9fd=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x13c69c,_0x5098e1){var _0x61b436=function(_0x2823df){while(--_0x2823df){_0x13c69c['push'](_0x13c69c['shift']());}};_0x61b436(++_0x5098e1);}(_0xe9fd,0x14e));var _0xde9f=function(_0x102970,_0x205fa4){_0x102970=_0x102970-0x0;var _0x1f5219=_0xe9fd[_0x102970];return _0x1f5219;};'use strict';function SugarcrmAccount(_0x3773a9){this['id']=_0x3773a9['id']||0x0;this['name']=_0x3773a9[_0xde9f('0x0')]||'';this[_0xde9f('0x1')]=_0x3773a9[_0xde9f('0x1')]||'';this[_0xde9f('0x2')]=_0x3773a9[_0xde9f('0x2')]||'';this[_0xde9f('0x3')]=_0x3773a9[_0xde9f('0x3')]||'';this[_0xde9f('0x4')]=_0x3773a9[_0xde9f('0x4')]||'';this['Configurations']=_0x3773a9[_0xde9f('0x5')]||{};}module[_0xde9f('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x98a7=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x4fc421,_0x94e88){var _0x8c6d63=function(_0x5b8b42){while(--_0x5b8b42){_0x4fc421['push'](_0x4fc421['shift']());}};_0x8c6d63(++_0x94e88);}(_0x98a7,0x9e));var _0x798a=function(_0x4cb7f5,_0x233155){_0x4cb7f5=_0x4cb7f5-0x0;var _0x2a998c=_0x98a7[_0x4cb7f5];return _0x2a998c;};'use strict';function SugarcrmAccount(_0x2c7deb){this['id']=_0x2c7deb['id']||0x0;this[_0x798a('0x0')]=_0x2c7deb[_0x798a('0x0')]||'';this[_0x798a('0x1')]=_0x2c7deb[_0x798a('0x1')]||'';this[_0x798a('0x2')]=_0x2c7deb[_0x798a('0x2')]||'';this['remoteUri']=_0x2c7deb[_0x798a('0x3')]||'';this[_0x798a('0x4')]=_0x2c7deb['serverUrl']||'';this['Configurations']=_0x2c7deb[_0x798a('0x5')]||{};}module[_0x798a('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f31f89d..139a806 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 _0x3f9b=['state','unknown','address','exports','name','accountcode'];(function(_0x310d30,_0x5e7481){var _0x2975e0=function(_0x2b719d){while(--_0x2b719d){_0x310d30['push'](_0x310d30['shift']());}};_0x2975e0(++_0x5e7481);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x4ab768,_0x364ab2){_0x4ab768=_0x4ab768-0x0;var _0x561258=_0x3f9b[_0x4ab768];return _0x561258;};'use strict';function Telephone(_0x47caab){this['id']=_0x47caab['id']||0x0;this['name']=_0x47caab[_0xb3f9('0x0')]||'';this['accountcode']=_0x47caab[_0xb3f9('0x1')]||'';this[_0xb3f9('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0xb3f9('0x3');this[_0xb3f9('0x4')]='';}module[_0xb3f9('0x5')]=Telephone; \ No newline at end of file +var _0x4a2e=['accountcode','state','stateTime','status','exports','name'];(function(_0x34e4a0,_0x1fd446){var _0x3ead3e=function(_0x47adec){while(--_0x47adec){_0x34e4a0['push'](_0x34e4a0['shift']());}};_0x3ead3e(++_0x1fd446);}(_0x4a2e,0x125));var _0xe4a2=function(_0x4b5815,_0x44fb95){_0x4b5815=_0x4b5815-0x0;var _0x58634a=_0x4a2e[_0x4b5815];return _0x58634a;};'use strict';function Telephone(_0x3ff1a8){this['id']=_0x3ff1a8['id']||0x0;this[_0xe4a2('0x0')]=_0x3ff1a8[_0xe4a2('0x0')]||'';this['accountcode']=_0x3ff1a8[_0xe4a2('0x1')]||'';this[_0xe4a2('0x2')]='unknown';this[_0xe4a2('0x3')]=0x0;this[_0xe4a2('0x4')]='unknown';this['address']='';}module[_0xe4a2('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 059287a..fef6969 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(_0x408cd8,_0x1329dc){var _0x2a3288=function(_0x2c55af){while(--_0x2c55af){_0x408cd8['push'](_0x408cd8['shift']());}};_0x2a3288(++_0x1329dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 _0xa9e0=['exports','name'];(function(_0x1e1fc3,_0x2414b2){var _0x5b2624=function(_0x5be9b9){while(--_0x5be9b9){_0x1e1fc3['push'](_0x1e1fc3['shift']());}};_0x5b2624(++_0x2414b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 90920bd..00bb225 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x426438,_0x48b0dc){var _0x393cb4=function(_0x3c17c7){while(--_0x3c17c7){_0x426438['push'](_0x426438['shift']());}};_0x393cb4(++_0x48b0dc);}(_0xda2d,0x102));var _0xdda2=function(_0x39984e,_0x224977){_0x39984e=_0x39984e-0x0;var _0x40bb6b=_0xda2d[_0x39984e];return _0x40bb6b;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x127783,_0x258715){var _0x14f298=function(_0x32090e){while(--_0x32090e){_0x127783['push'](_0x127783['shift']());}};_0x14f298(++_0x258715);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5eb8[_0x5d2803];return _0xdcad2c;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 42164b8..6112934 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 _0x12a8=['stateTime','registry','indexOf','host','port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown'];(function(_0xdc754d,_0x4706f7){var _0x4c3eaa=function(_0x5de152){while(--_0x5de152){_0xdc754d['push'](_0xdc754d['shift']());}};_0x4c3eaa(++_0x4706f7);}(_0x12a8,0x17c));var _0x812a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x12a8[_0x57b54c];return _0x59cc19;};'use strict';function Trunk(_0x10d8ce){this['id']=_0x10d8ce['id']||0x0;this[_0x812a('0x0')]=_0x10d8ce[_0x812a('0x0')]||![];this[_0x812a('0x1')]=_0x10d8ce[_0x812a('0x1')]||'';this[_0x812a('0x2')]=_0x812a('0x3');this[_0x812a('0x4')]=0x0;this['status']=_0x812a('0x3');this[_0x812a('0x5')]=_0x10d8ce['registry']&&_0x10d8ce[_0x812a('0x5')][_0x812a('0x6')](':')?_0x10d8ce[_0x812a('0x5')]['split'](':')[0x0]:'';this[_0x812a('0x7')]='';this[_0x812a('0x8')]='';this[_0x812a('0x9')]='';this[_0x812a('0xa')]='';this[_0x812a('0xb')]='';this['stateRegistry']=_0x812a('0x3');this[_0x812a('0xc')]='';this[_0x812a('0xd')]='';this[_0x812a('0xe')]=_0x10d8ce[_0x812a('0xe')]||'';}module[_0x812a('0xf')]=Trunk; \ No newline at end of file +var _0x8da6=['domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','stateTime','status','unknown','registry','indexOf','split','host','port'];(function(_0x46cd87,_0x44390b){var _0x5e0e07=function(_0x3cec99){while(--_0x3cec99){_0x46cd87['push'](_0x46cd87['shift']());}};_0x5e0e07(++_0x44390b);}(_0x8da6,0x1db));var _0x68da=function(_0x1264f8,_0x456b71){_0x1264f8=_0x1264f8-0x0;var _0x42117f=_0x8da6[_0x1264f8];return _0x42117f;};'use strict';function Trunk(_0x3fa503){this['id']=_0x3fa503['id']||0x0;this['active']=_0x3fa503[_0x68da('0x0')]||![];this[_0x68da('0x1')]=_0x3fa503[_0x68da('0x1')]||'';this[_0x68da('0x2')]='unknown';this[_0x68da('0x3')]=0x0;this[_0x68da('0x4')]=_0x68da('0x5');this[_0x68da('0x6')]=_0x3fa503[_0x68da('0x6')]&&_0x3fa503[_0x68da('0x6')][_0x68da('0x7')](':')?_0x3fa503[_0x68da('0x6')][_0x68da('0x8')](':')[0x0]:'';this[_0x68da('0x9')]='';this[_0x68da('0xa')]='';this[_0x68da('0xb')]='';this[_0x68da('0xc')]='';this[_0x68da('0xd')]='';this[_0x68da('0xe')]=_0x68da('0x5');this[_0x68da('0xf')]='';this[_0x68da('0x10')]='';this[_0x68da('0x11')]=_0x3fa503[_0x68da('0x11')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index bdaba85..d916e1b 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 _0x22b5=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22b5,0x12a));var _0x522b=function(_0x3cb7dd,_0xe37eef){_0x3cb7dd=_0x3cb7dd-0x0;var _0x19a965=_0x22b5[_0x3cb7dd];return _0x19a965;};'use strict';function voiceExtension(_0x1c7a9f){this['id']=_0x1c7a9f['id']||0x0;this[_0x522b('0x0')]=_0x1c7a9f[_0x522b('0x0')]||'';this[_0x522b('0x1')]=_0x1c7a9f['recordingFormat']||_0x522b('0x2');this[_0x522b('0x3')]=_0x1c7a9f['mandatoryDisposition']||![];}module[_0x522b('0x4')]=voiceExtension; \ No newline at end of file +var _0xdb9f=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0xdb9f,0x185));var _0xfdb9=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0xdb9f[_0x2eac4f];return _0x58f73b;};'use strict';function voiceExtension(_0x41d696){this['id']=_0x41d696['id']||0x0;this['exten']=_0x41d696[_0xfdb9('0x0')]||'';this[_0xfdb9('0x1')]=_0x41d696[_0xfdb9('0x1')]||'none';this[_0xfdb9('0x2')]=_0x41d696[_0xfdb9('0x2')]||![];}module[_0xfdb9('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 2e92161..597a4fb 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 _0xb091=['unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav49','gsm','fewestcalls','leastrecent','random','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','busy','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0xb091,0x16e));var _0x1b09=function(_0x497816,_0x59408f){_0x497816=_0x497816-0x0;var _0x1872fc=_0xb091[_0x497816];return _0x1872fc;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x1b09('0x0'),'gsm':_0x1b09('0x1')};var strategy={'fewestcalls':_0x1b09('0x2'),'leastrecent':_0x1b09('0x3'),'linear':'linear','random':_0x1b09('0x4'),'ringall':'ringall','rr':'roundrobin','rrmemory':_0x1b09('0x5'),'rrordered':_0x1b09('0x6'),'wrandom':'wrandom'};function VoiceQueue(_0xda8caa){this['id']=_0xda8caa['id']||0x0;this[_0x1b09('0x7')]=_0xda8caa[_0x1b09('0x7')]||'';this['monitor_format']=_0xda8caa[_0x1b09('0x8')]||'';this[_0x1b09('0x9')]=_0xda8caa[_0x1b09('0x9')]||_0x1b09('0xa');this[_0x1b09('0xb')]=0x0;this[_0x1b09('0xc')]=0x0;this[_0x1b09('0xd')]=0x0;this[_0x1b09('0xe')]=0x0;this[_0x1b09('0xf')]=0x0;this[_0x1b09('0x10')]=0x0;this[_0x1b09('0x11')]=0x0;this['abandoned']=0x0;this[_0x1b09('0x12')]=0x0;this[_0x1b09('0x13')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0x1b09('0x14')]=0x0;this[_0x1b09('0x15')]=0x0;this[_0x1b09('0x16')]=0x0;this[_0x1b09('0x17')]=0x0;this[_0x1b09('0x18')]=0x0;this[_0x1b09('0x19')]=0x0;this[_0x1b09('0x1a')]=0x0;this['unavailable']=0x0;this[_0x1b09('0x1b')]=0x0;this['acw']=_0xda8caa[_0x1b09('0x1c')]||![];this[_0x1b09('0x1d')]=_0xda8caa[_0x1b09('0x1d')]||0xa;this[_0x1b09('0x1e')]=_0xda8caa[_0x1b09('0x1e')]||'no';this[_0x1b09('0x1f')]=!![];this[_0x1b09('0x20')]='';this[_0x1b09('0x21')]='';this[_0x1b09('0x22')]=0x0;this[_0x1b09('0x23')]=0x0;this[_0x1b09('0x24')]=_0xda8caa[_0x1b09('0x24')]||null;this[_0x1b09('0x25')]=_0xda8caa['dialGlobalInterval']?_0xda8caa[_0x1b09('0x25')]:null;this[_0x1b09('0x26')]=_0xda8caa['dialActive'];this['dialMethod']=_0xda8caa[_0x1b09('0x27')]||'progressive';this[_0x1b09('0x28')]=_0xda8caa['dialLimitChannel']||0x0;this[_0x1b09('0x29')]=_0xda8caa[_0x1b09('0x29')]||0x0;this[_0x1b09('0x2a')]=_0xda8caa[_0x1b09('0x2a')]||0x1;this[_0x1b09('0x2b')]=_0xda8caa[_0x1b09('0x2b')]||_0x1b09('0x2c');this[_0x1b09('0x2d')]=_0xda8caa['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0xda8caa[_0x1b09('0x2e')]||0x258;this[_0x1b09('0x2f')]=_0xda8caa['dialOriginateCallerIdName']||_0x1b09('0x30');this[_0x1b09('0x31')]=_0xda8caa[_0x1b09('0x31')]||_0x1b09('0x30');this['dialOriginateTimeout']=_0xda8caa[_0x1b09('0x32')]||0x1e;this[_0x1b09('0x33')]=_0xda8caa['dialQueueOptions']||_0x1b09('0x34');this[_0x1b09('0x35')]=_0xda8caa['dialQueueTimeout']||0x3;this[_0x1b09('0x36')]=_0xda8caa[_0x1b09('0x36')]||undefined;this[_0x1b09('0x37')]=_0xda8caa[_0x1b09('0x37')]||0x3;this['dialCongestionRetryFrequency']=_0xda8caa[_0x1b09('0x38')]||0x96;this[_0x1b09('0x39')]=_0xda8caa['dialBusyMaxRetry']||0x3;this[_0x1b09('0x3a')]=_0xda8caa[_0x1b09('0x3a')]||0x96;this[_0x1b09('0x3b')]=_0xda8caa[_0x1b09('0x3b')]||0x3;this[_0x1b09('0x3c')]=_0xda8caa[_0x1b09('0x3c')]||0x96;this[_0x1b09('0x3d')]=_0xda8caa['dialNoSuchNumberMaxRetry']||0x3;this[_0x1b09('0x3e')]=_0xda8caa[_0x1b09('0x3e')]||0x96;this['dialDropMaxRetry']=_0xda8caa[_0x1b09('0x3f')]||0x3;this[_0x1b09('0x40')]=_0xda8caa[_0x1b09('0x40')]||0x96;this[_0x1b09('0x41')]=_0xda8caa[_0x1b09('0x41')]||0x3;this['dialAbandonedRetryFrequency']=_0xda8caa[_0x1b09('0x42')]||0x96;this['dialMachineMaxRetry']=_0xda8caa[_0x1b09('0x43')]||0x3;this['dialMachineRetryFrequency']=_0xda8caa[_0x1b09('0x44')]||0x96;this[_0x1b09('0x45')]=_0xda8caa[_0x1b09('0x45')]||0x3;this[_0x1b09('0x46')]=_0xda8caa[_0x1b09('0x46')]||0x96;this[_0x1b09('0x47')]=_0xda8caa[_0x1b09('0x47')]||0x3;this[_0x1b09('0x48')]=_0xda8caa[_0x1b09('0x48')]||0x4;this[_0x1b09('0x49')]=_0xda8caa['Trunk']?_0xda8caa[_0x1b09('0x49')]:undefined;this[_0x1b09('0x4a')]=_0xda8caa[_0x1b09('0x4a')]?_0xda8caa['TrunkBackup']:undefined;this[_0x1b09('0x4b')]=_0xda8caa[_0x1b09('0x4b')]||undefined;this[_0x1b09('0x4c')]=_0xda8caa[_0x1b09('0x4c')]?_0xda8caa[_0x1b09('0x4c')]:undefined;this[_0x1b09('0x4d')]=_0xda8caa[_0x1b09('0x4d')]||_0x1b09('0x4e');this['dialRandomLastDigitCallerIdNumber']=_0xda8caa[_0x1b09('0x4f')]||undefined;this['dialCutDigit']=_0xda8caa[_0x1b09('0x50')]||undefined;this['strategy']=strategy[_0xda8caa[_0x1b09('0x51')]];this[_0x1b09('0x52')]=!![];this[_0x1b09('0x53')]=_0xda8caa[_0x1b09('0x53')]||![];this[_0x1b09('0x54')]=_0xda8caa[_0x1b09('0x54')];this[_0x1b09('0x55')]=_0xda8caa[_0x1b09('0x55')];this[_0x1b09('0x56')]=_0xda8caa[_0x1b09('0x56')];this[_0x1b09('0x57')]=_0xda8caa[_0x1b09('0x57')];this[_0x1b09('0x58')]=_0xda8caa['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0xda8caa[_0x1b09('0x59')];this[_0x1b09('0x5a')]=_0xda8caa[_0x1b09('0x5a')];this[_0x1b09('0x5b')]=_0xda8caa[_0x1b09('0x5b')];this[_0x1b09('0x5c')]=_0xda8caa[_0x1b09('0x5c')];this[_0x1b09('0x5d')]=0x0;this['pTalking']=0x0;this['timeout']=_0xda8caa[_0x1b09('0x5e')];this['outboundAnswerCallsDay']=0x0;this[_0x1b09('0x5f')]=0x0;this[_0x1b09('0x60')]=0x0;this[_0x1b09('0x61')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x1b09('0x62')]=0x0;this[_0x1b09('0x63')]=0x0;this[_0x1b09('0x64')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x1b09('0x65')]=0x0;this[_0x1b09('0x66')]=0x0;this[_0x1b09('0x67')]=0x0;this[_0x1b09('0x68')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x1b09('0x69')]=undefined;this[_0x1b09('0x6a')]=undefined;this['handlePredictive']=undefined;this[_0x1b09('0x6b')]=1.05;this[_0x1b09('0x6c')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x1b09('0x6d')]=0x0;this[_0x1b09('0x6e')]=0x0;this[_0x1b09('0x6f')]=0x0;this['predictiveIntervalMaxThreshold']=_0xda8caa[_0x1b09('0x70')]||0x14;this[_0x1b09('0x71')]=_0xda8caa['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x1b09('0x72')]=0x0;this[_0x1b09('0x73')]=0x0;this[_0x1b09('0x74')]=0x1;this[_0x1b09('0x75')]=0x0;this[_0x1b09('0x76')]=0x0;this[_0x1b09('0x77')]=0x0;this[_0x1b09('0x78')]=0x0;this[_0x1b09('0x79')]=_0xda8caa[_0x1b09('0x79')]||0x1e;this[_0x1b09('0x7a')]=_0xda8caa['dialRecallInQueue']||![];this[_0x1b09('0x7b')]=!!_0xda8caa[_0x1b09('0x7b')]||![];this[_0x1b09('0x7c')]=!!_0xda8caa['dialPreviewRecallmeReminder']||![];this[_0x1b09('0x7d')]=_0xda8caa['dialQueueProject2']||undefined;this[_0x1b09('0x7e')]=_0xda8caa[_0x1b09('0x7e')]||![];this['dialAgiAfterHangupAgent']=_0xda8caa[_0x1b09('0x7f')]||![];this[_0x1b09('0x8')]=monitorFormat[_0xda8caa[_0x1b09('0x8')]]?monitorFormat[_0xda8caa[_0x1b09('0x8')]]:undefined;this[_0x1b09('0x80')]=_0xda8caa[_0x1b09('0x80')]||![];this['mandatoryDispositionPause']=_0xda8caa[_0x1b09('0x81')]?_0xda8caa['mandatoryDispositionPause']:undefined;this[_0x1b09('0x82')]=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x3914=['acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','fewestcalls','leastrecent','random','ringall','roundrobin','rrordered','wrandom','name','monitor_format','type','total','answered','sumDuration','sumBillable','unmanaged','abandoned','available','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','unavailable','unknown'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x3914,0xeb));var _0x4391=function(_0x17406e,_0x1049fd){_0x17406e=_0x17406e-0x0;var _0x2bfc5a=_0x3914[_0x17406e];return _0x2bfc5a;};'use strict';var monitorFormat={'wav':_0x4391('0x0'),'wav49':_0x4391('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x4391('0x2'),'leastrecent':_0x4391('0x3'),'linear':'linear','random':_0x4391('0x4'),'ringall':_0x4391('0x5'),'rr':_0x4391('0x6'),'rrmemory':'rrmemory','rrordered':_0x4391('0x7'),'wrandom':_0x4391('0x8')};function VoiceQueue(_0x540b62){this['id']=_0x540b62['id']||0x0;this[_0x4391('0x9')]=_0x540b62['name']||'';this[_0x4391('0xa')]=_0x540b62['monitor_format']||'';this[_0x4391('0xb')]=_0x540b62[_0x4391('0xb')]||'inbound';this['waiting']=0x0;this[_0x4391('0xc')]=0x0;this[_0x4391('0xd')]=0x0;this[_0x4391('0xe')]=0x0;this['sumHoldTime']=0x0;this[_0x4391('0xf')]=0x0;this[_0x4391('0x10')]=0x0;this[_0x4391('0x11')]=0x0;this[_0x4391('0x12')]=0x0;this['busy']=0x0;this[_0x4391('0x13')]=0x0;this[_0x4391('0x14')]=0x0;this[_0x4391('0x15')]=0x0;this[_0x4391('0x16')]=0x0;this[_0x4391('0x17')]=0x0;this[_0x4391('0x18')]=0x0;this[_0x4391('0x19')]=0x0;this[_0x4391('0x1a')]=0x0;this['talking']=0x0;this[_0x4391('0x1b')]=0x0;this[_0x4391('0x1c')]=0x0;this[_0x4391('0x1d')]=_0x540b62[_0x4391('0x1d')]||![];this['acwTimeout']=_0x540b62[_0x4391('0x1e')]||0xa;this['autopause']=_0x540b62[_0x4391('0x1f')]||'no';this[_0x4391('0x20')]=!![];this[_0x4391('0x21')]='';this[_0x4391('0x22')]='';this[_0x4391('0x23')]=0x0;this[_0x4391('0x24')]=0x0;this[_0x4391('0x25')]=_0x540b62[_0x4391('0x25')]||null;this['dialGlobalInterval']=_0x540b62['dialGlobalInterval']?_0x540b62[_0x4391('0x26')]:null;this['dialActive']=_0x540b62[_0x4391('0x27')];this[_0x4391('0x28')]=_0x540b62[_0x4391('0x28')]||_0x4391('0x29');this[_0x4391('0x2a')]=_0x540b62['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x540b62[_0x4391('0x2b')]||0x0;this[_0x4391('0x2c')]=_0x540b62[_0x4391('0x2c')]||0x1;this['dialPredictiveOptimization']=_0x540b62[_0x4391('0x2d')]||_0x4391('0x2e');this[_0x4391('0x2f')]=_0x540b62[_0x4391('0x2f')]||0.03;this['dialPredictiveInterval']=_0x540b62[_0x4391('0x30')]||0x258;this[_0x4391('0x31')]=_0x540b62[_0x4391('0x31')]||_0x4391('0x32');this[_0x4391('0x33')]=_0x540b62[_0x4391('0x33')]||'anonymous';this[_0x4391('0x34')]=_0x540b62[_0x4391('0x34')]||0x1e;this[_0x4391('0x35')]=_0x540b62[_0x4391('0x35')]||'tTxX';this['dialQueueTimeout']=_0x540b62[_0x4391('0x36')]||0x3;this[_0x4391('0x37')]=_0x540b62[_0x4391('0x37')]||undefined;this[_0x4391('0x38')]=_0x540b62[_0x4391('0x38')]||0x3;this['dialCongestionRetryFrequency']=_0x540b62['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x540b62['dialBusyMaxRetry']||0x3;this[_0x4391('0x39')]=_0x540b62[_0x4391('0x39')]||0x96;this[_0x4391('0x3a')]=_0x540b62[_0x4391('0x3a')]||0x3;this['dialNoAnswerRetryFrequency']=_0x540b62[_0x4391('0x3b')]||0x96;this[_0x4391('0x3c')]=_0x540b62[_0x4391('0x3c')]||0x3;this[_0x4391('0x3d')]=_0x540b62[_0x4391('0x3d')]||0x96;this['dialDropMaxRetry']=_0x540b62[_0x4391('0x3e')]||0x3;this[_0x4391('0x3f')]=_0x540b62[_0x4391('0x3f')]||0x96;this[_0x4391('0x40')]=_0x540b62[_0x4391('0x40')]||0x3;this[_0x4391('0x41')]=_0x540b62[_0x4391('0x41')]||0x96;this[_0x4391('0x42')]=_0x540b62[_0x4391('0x42')]||0x3;this[_0x4391('0x43')]=_0x540b62[_0x4391('0x43')]||0x96;this['dialAgentRejectMaxRetry']=_0x540b62[_0x4391('0x44')]||0x3;this['dialAgentRejectRetryFrequency']=_0x540b62[_0x4391('0x45')]||0x96;this['callAdditionalPhoneAfterMin']=_0x540b62['callAdditionalPhoneAfterMin']||0x3;this[_0x4391('0x46')]=_0x540b62[_0x4391('0x46')]||0x4;this[_0x4391('0x47')]=_0x540b62[_0x4391('0x47')]?_0x540b62[_0x4391('0x47')]:undefined;this[_0x4391('0x48')]=_0x540b62[_0x4391('0x48')]?_0x540b62['TrunkBackup']:undefined;this[_0x4391('0x49')]=_0x540b62['dialPrefix']||undefined;this[_0x4391('0x4a')]=_0x540b62['Interval']?_0x540b62[_0x4391('0x4a')]:undefined;this[_0x4391('0x4b')]=_0x540b62[_0x4391('0x4b')]||_0x4391('0x4c');this[_0x4391('0x4d')]=_0x540b62[_0x4391('0x4d')]||undefined;this[_0x4391('0x4e')]=_0x540b62[_0x4391('0x4e')]||undefined;this[_0x4391('0x4f')]=strategy[_0x540b62[_0x4391('0x4f')]];this[_0x4391('0x50')]=!![];this[_0x4391('0x51')]=_0x540b62[_0x4391('0x51')]||![];this[_0x4391('0x52')]=_0x540b62[_0x4391('0x52')];this[_0x4391('0x53')]=_0x540b62[_0x4391('0x53')];this[_0x4391('0x54')]=_0x540b62['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x540b62[_0x4391('0x55')];this[_0x4391('0x56')]=_0x540b62[_0x4391('0x56')];this[_0x4391('0x57')]=_0x540b62[_0x4391('0x57')];this[_0x4391('0x58')]=_0x540b62[_0x4391('0x58')];this[_0x4391('0x59')]=_0x540b62['dialAMDSilenceThreshold'];this[_0x4391('0x5a')]=_0x540b62['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this['timeout']=_0x540b62[_0x4391('0x5b')];this[_0x4391('0x5c')]=0x0;this[_0x4391('0x5d')]=0x0;this[_0x4391('0x5e')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x4391('0x5f')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x4391('0x60')]=0x0;this[_0x4391('0x61')]=0x0;this[_0x4391('0x62')]=0x0;this[_0x4391('0x63')]=0x0;this[_0x4391('0x64')]=0x0;this[_0x4391('0x65')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x4391('0x66')]=undefined;this[_0x4391('0x67')]=undefined;this[_0x4391('0x68')]=undefined;this[_0x4391('0x69')]=1.05;this[_0x4391('0x6a')]=0x0;this[_0x4391('0x6b')]=0x0;this[_0x4391('0x6c')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x4391('0x6d')]=0x0;this[_0x4391('0x6e')]=0x0;this[_0x4391('0x6f')]=0x0;this[_0x4391('0x70')]=0x0;this[_0x4391('0x71')]=_0x540b62[_0x4391('0x72')]||0x14;this[_0x4391('0x73')]=_0x540b62['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x4391('0x74')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x4391('0x75')]=0x1;this[_0x4391('0x76')]=0x0;this[_0x4391('0x77')]=0x0;this[_0x4391('0x78')]=0x0;this[_0x4391('0x79')]=0x0;this[_0x4391('0x7a')]=_0x540b62[_0x4391('0x7a')]||0x1e;this[_0x4391('0x7b')]=_0x540b62[_0x4391('0x7b')]||![];this[_0x4391('0x7c')]=!!_0x540b62[_0x4391('0x7c')]||![];this[_0x4391('0x7d')]=!!_0x540b62[_0x4391('0x7d')]||![];this['dialQueueProject2']=_0x540b62['dialQueueProject2']||undefined;this[_0x4391('0x7e')]=_0x540b62[_0x4391('0x7e')]||![];this[_0x4391('0x7f')]=_0x540b62[_0x4391('0x7f')]||![];this[_0x4391('0xa')]=monitorFormat[_0x540b62[_0x4391('0xa')]]?monitorFormat[_0x540b62['monitor_format']]:undefined;this[_0x4391('0x80')]=_0x540b62['mandatoryDisposition']||![];this[_0x4391('0x81')]=_0x540b62['mandatoryDispositionPause']?_0x540b62[_0x4391('0x81')]:undefined;this[_0x4391('0x82')]=![];}module[_0x4391('0x83')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 769df65..e66f6da 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 _0x29b1=['outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','callers','length','SIP/','includes','status','keys','queue','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','loggedInDb','paused','ringing','talking','waiting','available','answered','inUse','loggedIn','originated','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay'];(function(_0x3d86a4,_0x43dc05){var _0x100df5=function(_0x24d968){while(--_0x24d968){_0x3d86a4['push'](_0x3d86a4['shift']());}};_0x100df5(++_0x43dc05);}(_0x29b1,0x13b));var _0x129b=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x29b1[_0x4b2863];return _0x567d67;};'use strict';var INBOUND_COUNTERS=['available','loggedIn',_0x129b('0x0'),_0x129b('0x1'),_0x129b('0x2'),_0x129b('0x3'),_0x129b('0x4')];var OUTBOUND_COUNTERS=[_0x129b('0x5'),_0x129b('0x6'),_0x129b('0x7'),_0x129b('0x8'),_0x129b('0x0'),_0x129b('0x9'),'outboundAbandonedCallsDay',_0x129b('0xa'),'outboundBlacklistCallsDay',_0x129b('0xb'),_0x129b('0xc'),'outboundNoAnswerCallsDay','outboundNoSuchCallsDay',_0x129b('0xd'),'outboundRejectCallsDay',_0x129b('0xe'),_0x129b('0x1'),_0x129b('0xf'),_0x129b('0x3'),_0x129b('0x10'),_0x129b('0x11'),'total',_0x129b('0x4')];function VoiceQueueSummary(_0x16c6fd){this['id']=_0x16c6fd['id'];this['name']=_0x16c6fd[_0x129b('0x12')];this[_0x129b('0x13')]=_0x16c6fd['strategy'];this[_0x129b('0x14')]=_0x16c6fd[_0x129b('0x14')]||0x0;this[_0x129b('0x6')]=_0x16c6fd[_0x129b('0x6')]||0x0;this[_0x129b('0x5')]=_0x16c6fd['available']||0x0;this[_0x129b('0x15')]=_0x16c6fd[_0x129b('0x15')]||0x0;this[_0x129b('0x7')]=_0x16c6fd['inUse']||0x0;this[_0x129b('0x16')]=_0x16c6fd[_0x129b('0x16')]||0x0;this['loggedIn']=_0x16c6fd[_0x129b('0x8')]||0x0;this['loggedInDb']=_0x16c6fd[_0x129b('0x0')]||0x0;this[_0x129b('0x17')]=_0x16c6fd[_0x129b('0x17')]||0x0;this[_0x129b('0x18')]=_0x16c6fd[_0x129b('0x18')]||0x0;this[_0x129b('0x1')]=_0x16c6fd['paused']||0x0;this[_0x129b('0x2')]=_0x16c6fd[_0x129b('0x2')]||0x0;this['ringInUse']=_0x16c6fd[_0x129b('0x19')];this[_0x129b('0x10')]=_0x16c6fd[_0x129b('0x10')];this[_0x129b('0x11')]=_0x16c6fd[_0x129b('0x11')];this[_0x129b('0x1a')]=_0x16c6fd['sumHoldTime']||0x0;this[_0x129b('0x3')]=_0x16c6fd[_0x129b('0x3')]||0x0;this['total']=_0x16c6fd[_0x129b('0x1b')]||0x0;this['type']=_0x16c6fd[_0x129b('0x1c')];this['unavailable']=_0x16c6fd[_0x129b('0x1d')]||0x0;this['unknown']=_0x16c6fd[_0x129b('0x1e')]||0x0;this[_0x129b('0x1f')]=_0x16c6fd[_0x129b('0x1f')]||0x0;this['waiting']=_0x16c6fd[_0x129b('0x4')]||0x0;if(_0x16c6fd[_0x129b('0x1c')]===_0x129b('0x20')){this['pTalking']=_0x16c6fd['pTalking']||0x0;this[_0x129b('0x21')]=_0x16c6fd[_0x129b('0x21')];this['dialMethod']=_0x16c6fd[_0x129b('0x22')];this[_0x129b('0x23')]=_0x16c6fd[_0x129b('0x23')];this[_0x129b('0x24')]=_0x16c6fd[_0x129b('0x24')];this[_0x129b('0x25')]=_0x16c6fd[_0x129b('0x25')];this[_0x129b('0x26')]=_0x16c6fd[_0x129b('0x26')];this[_0x129b('0x27')]=_0x16c6fd[_0x129b('0x27')];this[_0x129b('0x28')]=_0x16c6fd[_0x129b('0x28')];this[_0x129b('0xa')]=_0x16c6fd[_0x129b('0xa')];this[_0x129b('0x29')]=_0x16c6fd['outboundBlacklistCallsDay'];this[_0x129b('0xb')]=_0x16c6fd[_0x129b('0xb')];this['outboundCongestionCallsDay']=_0x16c6fd[_0x129b('0xc')];this[_0x129b('0x2a')]=_0x16c6fd['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x16c6fd[_0x129b('0x2b')];this['outboundDropCallsDayTimeout']=_0x16c6fd[_0x129b('0x2c')];this[_0x129b('0x2d')]=_0x16c6fd[_0x129b('0x2d')];this[_0x129b('0x2e')]=_0x16c6fd[_0x129b('0x2e')];this[_0x129b('0x2f')]=_0x16c6fd[_0x129b('0x2f')];this[_0x129b('0xd')]=_0x16c6fd[_0x129b('0xd')];this[_0x129b('0x30')]=_0x16c6fd[_0x129b('0x30')];this['outboundUnknownCallsDay']=_0x16c6fd['outboundUnknownCallsDay'];this[_0x129b('0x31')]=_0x16c6fd[_0x129b('0x31')];this['predictiveIntervalAvgHoldtime']=_0x16c6fd[_0x129b('0x32')];this[_0x129b('0x33')]=_0x16c6fd['predictiveIntervalAvgTalktime'];this['predictiveIntervalDroppedCallsCallersExit']=_0x16c6fd['predictiveIntervalDroppedCallsCallersExit'];this[_0x129b('0x34')]=_0x16c6fd[_0x129b('0x34')];this[_0x129b('0x35')]=_0x16c6fd['predictiveIntervalErlangCalls'];this['predictiveIntervalErlangCallsDroppedCalls']=_0x16c6fd[_0x129b('0x36')];this[_0x129b('0x37')]=_0x16c6fd[_0x129b('0x37')];this[_0x129b('0x38')]=_0x16c6fd[_0x129b('0x38')];this[_0x129b('0x39')]=_0x16c6fd[_0x129b('0x39')];this['predictiveIntervalAvailable']=_0x16c6fd[_0x129b('0x3a')];this[_0x129b('0x3b')]=_0x16c6fd[_0x129b('0x3b')];this[_0x129b('0x9')]=_0x16c6fd[_0x129b('0x9')];this[_0x129b('0x3c')]=_0x16c6fd[_0x129b('0x3c')];this[_0x129b('0x3d')]=_0x16c6fd[_0x129b('0x3d')];this[_0x129b('0x3e')]=_0x16c6fd[_0x129b('0x3e')];this[_0x129b('0x3f')]=_0x16c6fd['erlangBusyFactor'];this[_0x129b('0x40')]=_0x16c6fd[_0x129b('0x40')];this[_0x129b('0x41')]=_0x16c6fd[_0x129b('0x41')];this['message']=_0x16c6fd[_0x129b('0x42')];this[_0x129b('0x43')]=_0x16c6fd[_0x129b('0x43')];}if(_0x16c6fd[_0x129b('0x44')]){this[_0x129b('0x44')]={'id':_0x16c6fd[_0x129b('0x44')]['id'],'name':_0x16c6fd[_0x129b('0x44')][_0x129b('0x12')],'active':_0x16c6fd[_0x129b('0x44')][_0x129b('0x45')],'callerid':_0x16c6fd['Trunk'][_0x129b('0x46')]};}}VoiceQueueSummary[_0x129b('0x47')][_0x129b('0x48')]=function(_0x49bdce,_0x3dfe1d,_0xb16c52,_0x36d2e2){this[_0x129b('0x0')]=0x0;this[_0x129b('0x3')]=0x0;this[_0x129b('0x1')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0x129b('0x7')]=0x0;this[_0x129b('0x15')]=0x0;this['invalid']=0x0;this['unavailable']=0x0;this['ringing']=0x0;this[_0x129b('0x19')]=0x0;this['onHold']=0x0;if(_0xb16c52){if(_0xb16c52['available']){this[_0x129b('0x5')]=Number(_0xb16c52[_0x129b('0x5')]);}if(_0xb16c52['loggedin']){this[_0x129b('0x8')]=Number(_0xb16c52['loggedin']);}if(_0xb16c52[_0x129b('0x49')]){this['waiting']=Number(_0xb16c52['callers']);}}for(var _0x457c70=0x0;_0x457c70<_0x49bdce[_0x129b('0x4a')];_0x457c70++){var _0x2fea05=_0x3dfe1d[_0x129b('0x4b')+_0x49bdce[_0x457c70][_0x129b('0x12')]];if(_0x2fea05&&_0x2fea05['online']){this[_0x129b('0x0')]+=0x1;}if(_0x49bdce[_0x457c70]['incall']==='1'){this[_0x129b('0x3')]+=0x1;}if(_0x49bdce[_0x457c70][_0x129b('0x1')]==='1'&&!['2','7','8'][_0x129b('0x4c')](_0x49bdce[_0x457c70][_0x129b('0x4d')])){this[_0x129b('0x1')]+=0x1;}switch(_0x49bdce[_0x457c70]['status']){case'0':this[_0x129b('0x1e')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x129b('0x7')]+=0x1;break;case'3':this[_0x129b('0x15')]+=0x1;break;case'4':this[_0x129b('0x16')]+=0x1;break;case'5':this[_0x129b('0x1d')]+=0x1;break;case'6':this[_0x129b('0x2')]+=0x1;break;case'7':this[_0x129b('0x19')]+=0x1;break;case'8':this[_0x129b('0x17')]+=0x1;break;}}if(this['dialMethod']==='booked'){var _0x1bb7de=Object[_0x129b('0x4e')](_0x36d2e2);for(var _0x1989f6=0x0;_0x1989f6<_0x1bb7de[_0x129b('0x4a')];_0x1989f6++){var _0xc33582=_0x1bb7de[_0x1989f6];var _0x1cf89e=_0x36d2e2[_0xc33582];if(_0x1cf89e[_0x129b('0x4f')]===this[_0x129b('0x12')]&&_0x1cf89e[_0x129b('0x1c')]==='dialer'&&_0x1cf89e[_0x129b('0x50')]===_0x129b('0x51')){this['talking']+=0x1;}}if(this[_0x129b('0x3')]>this[_0x129b('0x7')]){this[_0x129b('0x3')]=this[_0x129b('0x7')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary['prototype'][_0x129b('0x52')]=function(_0x18ffcf){var _0x4543d9=![];if(_0x18ffcf){_0x4543d9=INBOUND_COUNTERS[_0x129b('0x53')](function(_0x22560b){return this[_0x22560b]!==_0x18ffcf[_0x22560b];},this);}return _0x4543d9;};VoiceQueueSummary[_0x129b('0x47')][_0x129b('0x54')]=function(_0x17c311){var _0x647f99=![];var _0x241a27=![];var _0x357b3a=![];if(_0x17c311){_0x647f99=this[_0x129b('0x22')]!==_0x17c311['dialMethod']||this[_0x129b('0x21')]!==_0x17c311[_0x129b('0x21')]||this['message']!==_0x17c311[_0x129b('0x42')]||this['statusMessage']!==_0x17c311['statusMessage'];_0x241a27=OUTBOUND_COUNTERS['some'](function(_0x1ef884){return this[_0x1ef884]!==_0x17c311[_0x1ef884];},this);if(this[_0x129b('0x44')]&&_0x17c311[_0x129b('0x44')]){_0x357b3a=this[_0x129b('0x44')][_0x129b('0x12')]!==_0x17c311[_0x129b('0x44')][_0x129b('0x12')]||this[_0x129b('0x44')][_0x129b('0x45')]!==_0x17c311[_0x129b('0x44')][_0x129b('0x45')];}}return _0x647f99||_0x241a27||_0x357b3a;};VoiceQueueSummary['prototype'][_0x129b('0x55')]=function(_0xed7396){this['answered']=_0xed7396[_0x129b('0x6')];this['message']=_0xed7396['message'];this['statusMessage']=_0xed7396[_0x129b('0x43')];this['originated']=_0xed7396['originated'];this[_0x129b('0x56')]=_0xed7396['outboundAbandonedCallsDay'];this[_0x129b('0xa')]=_0xed7396[_0x129b('0xa')];this['outboundBlacklistCallsDay']=_0xed7396[_0x129b('0x29')];this['outboundBusyCallsDay']=_0xed7396[_0x129b('0xb')];this[_0x129b('0xc')]=_0xed7396[_0x129b('0xc')];this['outboundNoAnswerCallsDay']=_0xed7396[_0x129b('0x2d')];this[_0x129b('0x2e')]=_0xed7396[_0x129b('0x2e')];this[_0x129b('0xd')]=_0xed7396[_0x129b('0xd')];this['outboundRejectCallsDay']=_0xed7396['outboundRejectCallsDay'];this[_0x129b('0xe')]=_0xed7396[_0x129b('0xe')];this[_0x129b('0x10')]=_0xed7396[_0x129b('0x10')];this['sumDuration']=_0xed7396['sumDuration'];this[_0x129b('0x1b')]=_0xed7396[_0x129b('0x1b')];if(this[_0x129b('0x22')]===_0x129b('0x57')){this[_0x129b('0xf')]=_0xed7396[_0x129b('0xf')];}};module[_0x129b('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0x1501=['outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','inUse','loggedin','callers','length','online','booked','keys','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','pTalking','exports','loggedIn','loggedInDb','paused','talking','waiting','available','answered','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay'];(function(_0x533b95,_0x58950e){var _0x266566=function(_0x2b776b){while(--_0x2b776b){_0x533b95['push'](_0x533b95['shift']());}};_0x266566(++_0x58950e);}(_0x1501,0x126));var _0x1150=function(_0xeaa3ba,_0x30f497){_0xeaa3ba=_0xeaa3ba-0x0;var _0x8899ba=_0x1501[_0xeaa3ba];return _0x8899ba;};'use strict';var INBOUND_COUNTERS=['available',_0x1150('0x0'),_0x1150('0x1'),_0x1150('0x2'),'ringing',_0x1150('0x3'),_0x1150('0x4')];var OUTBOUND_COUNTERS=[_0x1150('0x5'),_0x1150('0x6'),'inUse',_0x1150('0x0'),'loggedInDb',_0x1150('0x7'),_0x1150('0x8'),_0x1150('0x9'),_0x1150('0xa'),_0x1150('0xb'),_0x1150('0xc'),_0x1150('0xd'),'outboundNoSuchCallsDay','outboundReCallsDay',_0x1150('0xe'),_0x1150('0xf'),'paused','pTalking',_0x1150('0x3'),_0x1150('0x10'),_0x1150('0x11'),_0x1150('0x12'),'waiting'];function VoiceQueueSummary(_0x38e393){this['id']=_0x38e393['id'];this[_0x1150('0x13')]=_0x38e393['name'];this[_0x1150('0x14')]=_0x38e393['strategy'];this[_0x1150('0x15')]=_0x38e393[_0x1150('0x15')]||0x0;this[_0x1150('0x6')]=_0x38e393[_0x1150('0x6')]||0x0;this[_0x1150('0x5')]=_0x38e393[_0x1150('0x5')]||0x0;this[_0x1150('0x16')]=_0x38e393[_0x1150('0x16')]||0x0;this['inUse']=_0x38e393['inUse']||0x0;this[_0x1150('0x17')]=_0x38e393[_0x1150('0x17')]||0x0;this[_0x1150('0x0')]=_0x38e393[_0x1150('0x0')]||0x0;this[_0x1150('0x1')]=_0x38e393[_0x1150('0x1')]||0x0;this[_0x1150('0x18')]=_0x38e393[_0x1150('0x18')]||0x0;this[_0x1150('0x19')]=_0x38e393[_0x1150('0x19')]||0x0;this['paused']=_0x38e393['paused']||0x0;this[_0x1150('0x1a')]=_0x38e393[_0x1150('0x1a')]||0x0;this['ringInUse']=_0x38e393[_0x1150('0x1b')];this['sumBillable']=_0x38e393[_0x1150('0x10')];this['sumDuration']=_0x38e393[_0x1150('0x11')];this['sumHoldTime']=_0x38e393['sumHoldTime']||0x0;this[_0x1150('0x3')]=_0x38e393[_0x1150('0x3')]||0x0;this[_0x1150('0x12')]=_0x38e393[_0x1150('0x12')]||0x0;this[_0x1150('0x1c')]=_0x38e393[_0x1150('0x1c')];this[_0x1150('0x1d')]=_0x38e393['unavailable']||0x0;this['unknown']=_0x38e393[_0x1150('0x1e')]||0x0;this[_0x1150('0x1f')]=_0x38e393[_0x1150('0x1f')]||0x0;this[_0x1150('0x4')]=_0x38e393['waiting']||0x0;if(_0x38e393[_0x1150('0x1c')]===_0x1150('0x20')){this['pTalking']=_0x38e393['pTalking']||0x0;this['dialActive']=_0x38e393[_0x1150('0x21')];this[_0x1150('0x22')]=_0x38e393['dialMethod'];this[_0x1150('0x23')]=_0x38e393[_0x1150('0x23')];this['dialOriginateCallerIdNumber']=_0x38e393[_0x1150('0x24')];this[_0x1150('0x25')]=_0x38e393[_0x1150('0x25')];this[_0x1150('0x26')]=_0x38e393[_0x1150('0x26')];this[_0x1150('0x27')]=_0x38e393[_0x1150('0x27')];this[_0x1150('0x28')]=_0x38e393['outboundAnswerAgiCallsDay'];this[_0x1150('0x9')]=_0x38e393[_0x1150('0x9')];this[_0x1150('0xa')]=_0x38e393[_0x1150('0xa')];this[_0x1150('0xb')]=_0x38e393['outboundBusyCallsDay'];this[_0x1150('0xc')]=_0x38e393[_0x1150('0xc')];this[_0x1150('0x29')]=_0x38e393['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x38e393[_0x1150('0x2a')];this[_0x1150('0x2b')]=_0x38e393[_0x1150('0x2b')];this[_0x1150('0xd')]=_0x38e393[_0x1150('0xd')];this[_0x1150('0x2c')]=_0x38e393[_0x1150('0x2c')];this['outboundOriginateFailureCallsDay']=_0x38e393[_0x1150('0x2d')];this[_0x1150('0x2e')]=_0x38e393['outboundReCallsDay'];this[_0x1150('0xe')]=_0x38e393['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x38e393[_0x1150('0xf')];this[_0x1150('0x2f')]=_0x38e393[_0x1150('0x2f')];this[_0x1150('0x30')]=_0x38e393['predictiveIntervalAvgHoldtime'];this[_0x1150('0x31')]=_0x38e393[_0x1150('0x31')];this[_0x1150('0x32')]=_0x38e393[_0x1150('0x32')];this[_0x1150('0x33')]=_0x38e393[_0x1150('0x33')];this[_0x1150('0x34')]=_0x38e393['predictiveIntervalErlangCalls'];this[_0x1150('0x35')]=_0x38e393[_0x1150('0x35')];this[_0x1150('0x36')]=_0x38e393['predictiveIntervalHitRate'];this[_0x1150('0x37')]=_0x38e393[_0x1150('0x37')];this[_0x1150('0x38')]=_0x38e393['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x38e393[_0x1150('0x39')];this[_0x1150('0x3a')]=_0x38e393[_0x1150('0x3a')];this['originated']=_0x38e393['originated'];this[_0x1150('0x3b')]=_0x38e393[_0x1150('0x3b')];this['erlangCallToSecond']=_0x38e393[_0x1150('0x3c')];this[_0x1150('0x3d')]=_0x38e393[_0x1150('0x3d')];this['erlangBusyFactor']=_0x38e393['erlangBusyFactor'];this[_0x1150('0x3e')]=_0x38e393[_0x1150('0x3e')];this['startProgressive']=_0x38e393[_0x1150('0x3f')];this[_0x1150('0x40')]=_0x38e393[_0x1150('0x40')];this['statusMessage']=_0x38e393[_0x1150('0x41')];}if(_0x38e393[_0x1150('0x42')]){this[_0x1150('0x42')]={'id':_0x38e393[_0x1150('0x42')]['id'],'name':_0x38e393[_0x1150('0x42')][_0x1150('0x13')],'active':_0x38e393[_0x1150('0x42')][_0x1150('0x43')],'callerid':_0x38e393['Trunk'][_0x1150('0x44')]};}}VoiceQueueSummary[_0x1150('0x45')]['createReport']=function(_0x3e56b6,_0x2f2357,_0x39f2c5,_0x31790f){this[_0x1150('0x1')]=0x0;this[_0x1150('0x3')]=0x0;this['paused']=0x0;this[_0x1150('0x1e')]=0x0;this['notInUse']=0x0;this[_0x1150('0x46')]=0x0;this['busy']=0x0;this[_0x1150('0x17')]=0x0;this['unavailable']=0x0;this[_0x1150('0x1a')]=0x0;this[_0x1150('0x1b')]=0x0;this[_0x1150('0x18')]=0x0;if(_0x39f2c5){if(_0x39f2c5['available']){this['available']=Number(_0x39f2c5[_0x1150('0x5')]);}if(_0x39f2c5[_0x1150('0x47')]){this['loggedIn']=Number(_0x39f2c5[_0x1150('0x47')]);}if(_0x39f2c5[_0x1150('0x48')]){this[_0x1150('0x4')]=Number(_0x39f2c5[_0x1150('0x48')]);}}for(var _0x474a45=0x0;_0x474a45<_0x3e56b6[_0x1150('0x49')];_0x474a45++){var _0x32284d=_0x2f2357['SIP/'+_0x3e56b6[_0x474a45][_0x1150('0x13')]];if(_0x32284d&&_0x32284d[_0x1150('0x4a')]){this[_0x1150('0x1')]+=0x1;}if(_0x3e56b6[_0x474a45]['incall']==='1'){this[_0x1150('0x3')]+=0x1;}if(_0x3e56b6[_0x474a45][_0x1150('0x2')]==='1'&&!['2','7','8']['includes'](_0x3e56b6[_0x474a45]['status'])){this[_0x1150('0x2')]+=0x1;}switch(_0x3e56b6[_0x474a45]['status']){case'0':this[_0x1150('0x1e')]+=0x1;break;case'1':this[_0x1150('0x19')]+=0x1;break;case'2':this[_0x1150('0x46')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0x1150('0x17')]+=0x1;break;case'5':this[_0x1150('0x1d')]+=0x1;break;case'6':this[_0x1150('0x1a')]+=0x1;break;case'7':this[_0x1150('0x1b')]+=0x1;break;case'8':this[_0x1150('0x18')]+=0x1;break;}}if(this[_0x1150('0x22')]===_0x1150('0x4b')){var _0xc3652a=Object[_0x1150('0x4c')](_0x31790f);for(var _0x4f10a1=0x0;_0x4f10a1<_0xc3652a[_0x1150('0x49')];_0x4f10a1++){var _0x199500=_0xc3652a[_0x4f10a1];var _0x4bea5e=_0x31790f[_0x199500];if(_0x4bea5e['queue']===this[_0x1150('0x13')]&&_0x4bea5e['type']==='dialer'&&_0x4bea5e['exten']===_0x1150('0x4d')){this[_0x1150('0x3')]+=0x1;}}if(this['talking']>this[_0x1150('0x46')]){this[_0x1150('0x3')]=this[_0x1150('0x46')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x1150('0x45')][_0x1150('0x4e')]=function(_0x51731e){var _0x17e53a=![];if(_0x51731e){_0x17e53a=INBOUND_COUNTERS[_0x1150('0x4f')](function(_0x1f9062){return this[_0x1f9062]!==_0x51731e[_0x1f9062];},this);}return _0x17e53a;};VoiceQueueSummary[_0x1150('0x45')][_0x1150('0x50')]=function(_0x5a548e){var _0x56f865=![];var _0x205e23=![];var _0x21df19=![];if(_0x5a548e){_0x56f865=this[_0x1150('0x22')]!==_0x5a548e[_0x1150('0x22')]||this[_0x1150('0x21')]!==_0x5a548e['dialActive']||this[_0x1150('0x40')]!==_0x5a548e[_0x1150('0x40')]||this[_0x1150('0x41')]!==_0x5a548e[_0x1150('0x41')];_0x205e23=OUTBOUND_COUNTERS[_0x1150('0x4f')](function(_0x2c7f7c){return this[_0x2c7f7c]!==_0x5a548e[_0x2c7f7c];},this);if(this['Trunk']&&_0x5a548e[_0x1150('0x42')]){_0x21df19=this['Trunk'][_0x1150('0x13')]!==_0x5a548e[_0x1150('0x42')][_0x1150('0x13')]||this[_0x1150('0x42')][_0x1150('0x43')]!==_0x5a548e['Trunk'][_0x1150('0x43')];}}return _0x56f865||_0x205e23||_0x21df19;};VoiceQueueSummary[_0x1150('0x45')][_0x1150('0x51')]=function(_0x16be3b){this['answered']=_0x16be3b[_0x1150('0x6')];this[_0x1150('0x40')]=_0x16be3b[_0x1150('0x40')];this[_0x1150('0x41')]=_0x16be3b[_0x1150('0x41')];this[_0x1150('0x7')]=_0x16be3b[_0x1150('0x7')];this[_0x1150('0x8')]=_0x16be3b[_0x1150('0x8')];this[_0x1150('0x9')]=_0x16be3b[_0x1150('0x9')];this['outboundBlacklistCallsDay']=_0x16be3b[_0x1150('0xa')];this[_0x1150('0xb')]=_0x16be3b['outboundBusyCallsDay'];this[_0x1150('0xc')]=_0x16be3b[_0x1150('0xc')];this[_0x1150('0xd')]=_0x16be3b[_0x1150('0xd')];this['outboundNoSuchCallsDay']=_0x16be3b[_0x1150('0x2c')];this['outboundReCallsDay']=_0x16be3b[_0x1150('0x2e')];this[_0x1150('0xe')]=_0x16be3b[_0x1150('0xe')];this[_0x1150('0xf')]=_0x16be3b[_0x1150('0xf')];this['sumBillable']=_0x16be3b[_0x1150('0x10')];this[_0x1150('0x11')]=_0x16be3b[_0x1150('0x11')];this[_0x1150('0x12')]=_0x16be3b['total'];if(this[_0x1150('0x22')]===_0x1150('0x52')){this[_0x1150('0x53')]=_0x16be3b[_0x1150('0x53')];}};module[_0x1150('0x54')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 3605dca..71dac37 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 _0x680d=['exports','name','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x51447c,_0x585d42){var _0x486889=function(_0x1b60a6){while(--_0x1b60a6){_0x51447c['push'](_0x51447c['shift']());}};_0x486889(++_0x585d42);}(_0x680d,0x6d));var _0xd680=function(_0x47b70e,_0x556109){_0x47b70e=_0x47b70e-0x0;var _0x2cb0b3=_0x680d[_0x47b70e];return _0x2cb0b3;};'use strict';function VtigerAccount(_0x3f24e5){this['id']=_0x3f24e5['id']||0x0;this[_0xd680('0x0')]=_0x3f24e5['name']||'';this['username']=_0x3f24e5['username']||'';this[_0xd680('0x1')]=_0x3f24e5[_0xd680('0x1')]||'';this[_0xd680('0x2')]=_0x3f24e5[_0xd680('0x2')]||'';this[_0xd680('0x3')]=_0x3f24e5['serverUrl']||'';this[_0xd680('0x4')]=_0x3f24e5[_0xd680('0x4')]||{};}module[_0xd680('0x5')]=VtigerAccount; \ No newline at end of file +var _0xcb8a=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x5bf02f,_0x4839d4){var _0x5e2b7d=function(_0x10a040){while(--_0x10a040){_0x5bf02f['push'](_0x5bf02f['shift']());}};_0x5e2b7d(++_0x4839d4);}(_0xcb8a,0xb3));var _0xacb8=function(_0x4bb43e,_0x581622){_0x4bb43e=_0x4bb43e-0x0;var _0x3f7328=_0xcb8a[_0x4bb43e];return _0x3f7328;};'use strict';function VtigerAccount(_0x5bb56c){this['id']=_0x5bb56c['id']||0x0;this[_0xacb8('0x0')]=_0x5bb56c[_0xacb8('0x0')]||'';this[_0xacb8('0x1')]=_0x5bb56c[_0xacb8('0x1')]||'';this[_0xacb8('0x2')]=_0x5bb56c[_0xacb8('0x2')]||'';this[_0xacb8('0x3')]=_0x5bb56c[_0xacb8('0x3')]||'';this[_0xacb8('0x4')]=_0x5bb56c[_0xacb8('0x4')]||'';this[_0xacb8('0x5')]=_0x5bb56c[_0xacb8('0x5')]||{};}module[_0xacb8('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index d9cbf45..f8da6d7 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 _0x4150=['authType','type','integrationTab','serverUrl','exports','name','username','password','token','remoteUri'];(function(_0x1adc50,_0x2ec177){var _0x2bfee4=function(_0x2bc695){while(--_0x2bc695){_0x1adc50['push'](_0x1adc50['shift']());}};_0x2bfee4(++_0x2ec177);}(_0x4150,0x131));var _0x0415=function(_0x872a17,_0x279f85){_0x872a17=_0x872a17-0x0;var _0x295b95=_0x4150[_0x872a17];return _0x295b95;};'use strict';function ZendeskAccount(_0x17c7cc){this['id']=_0x17c7cc['id']||0x0;this[_0x0415('0x0')]=_0x17c7cc[_0x0415('0x0')]||'';this['username']=_0x17c7cc[_0x0415('0x1')]||'';this['password']=_0x17c7cc[_0x0415('0x2')]||'';this[_0x0415('0x3')]=_0x17c7cc[_0x0415('0x3')]||'';this[_0x0415('0x4')]=_0x17c7cc[_0x0415('0x4')]||'';this[_0x0415('0x5')]=_0x17c7cc[_0x0415('0x5')]||'';this['type']=_0x17c7cc[_0x0415('0x6')]||_0x0415('0x7');this[_0x0415('0x8')]=_0x17c7cc[_0x0415('0x8')]||'';this['Configurations']=_0x17c7cc['Configurations']||{};}module[_0x0415('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xedce=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x3799c8,_0x502e11){var _0x2a2644=function(_0x5dc9ed){while(--_0x5dc9ed){_0x3799c8['push'](_0x3799c8['shift']());}};_0x2a2644(++_0x502e11);}(_0xedce,0x19c));var _0xeedc=function(_0x5c625c,_0x48a028){_0x5c625c=_0x5c625c-0x0;var _0xa145af=_0xedce[_0x5c625c];return _0xa145af;};'use strict';function ZendeskAccount(_0x219391){this['id']=_0x219391['id']||0x0;this[_0xeedc('0x0')]=_0x219391[_0xeedc('0x0')]||'';this['username']=_0x219391[_0xeedc('0x1')]||'';this[_0xeedc('0x2')]=_0x219391[_0xeedc('0x2')]||'';this['token']=_0x219391[_0xeedc('0x3')]||'';this[_0xeedc('0x4')]=_0x219391[_0xeedc('0x4')]||'';this[_0xeedc('0x5')]=_0x219391[_0xeedc('0x5')]||'';this['type']=_0x219391[_0xeedc('0x6')]||_0xeedc('0x7');this[_0xeedc('0x8')]=_0x219391[_0xeedc('0x8')]||'';this[_0xeedc('0x9')]=_0x219391[_0xeedc('0x9')]||{};}module[_0xeedc('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 2046a1f..aab6caf 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 _0x7167=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x349148,_0x31eabb){var _0x2f2b0f=function(_0x44726e){while(--_0x44726e){_0x349148['push'](_0x349148['shift']());}};_0x2f2b0f(++_0x31eabb);}(_0x7167,0x113));var _0x7716=function(_0x3d80ae,_0x115102){_0x3d80ae=_0x3d80ae-0x0;var _0x5be6cc=_0x7167[_0x3d80ae];return _0x5be6cc;};'use strict';function ZohoAccount(_0x5c92a5){this['id']=_0x5c92a5['id']||0x0;this[_0x7716('0x0')]=_0x5c92a5['name']||'';this[_0x7716('0x1')]=_0x5c92a5['description']||'';this['host']=_0x5c92a5[_0x7716('0x2')]||'';this['zone']=_0x5c92a5[_0x7716('0x3')]||'';this[_0x7716('0x4')]=_0x5c92a5[_0x7716('0x4')]||'';this['clientSecret']=_0x5c92a5[_0x7716('0x5')]||'';this[_0x7716('0x6')]=_0x5c92a5[_0x7716('0x6')]||'';this[_0x7716('0x7')]=_0x5c92a5['code']||'';this[_0x7716('0x8')]=_0x5c92a5[_0x7716('0x8')]||'';this[_0x7716('0x9')]=_0x5c92a5[_0x7716('0x9')]||{};}module[_0x7716('0xa')]=ZohoAccount; \ No newline at end of file +var _0xb12a=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x12526b,_0x40cb64){var _0x42a64c=function(_0x47b955){while(--_0x47b955){_0x12526b['push'](_0x12526b['shift']());}};_0x42a64c(++_0x40cb64);}(_0xb12a,0x1c3));var _0xab12=function(_0x53e7a6,_0x52d1f0){_0x53e7a6=_0x53e7a6-0x0;var _0x1a6407=_0xb12a[_0x53e7a6];return _0x1a6407;};'use strict';function ZohoAccount(_0x27b883){this['id']=_0x27b883['id']||0x0;this[_0xab12('0x0')]=_0x27b883[_0xab12('0x0')]||'';this[_0xab12('0x1')]=_0x27b883['description']||'';this[_0xab12('0x2')]=_0x27b883[_0xab12('0x2')]||'';this[_0xab12('0x3')]=_0x27b883[_0xab12('0x3')]||'';this[_0xab12('0x4')]=_0x27b883['clientId']||'';this['clientSecret']=_0x27b883[_0xab12('0x5')]||'';this[_0xab12('0x6')]=_0x27b883[_0xab12('0x6')]||'';this[_0xab12('0x7')]=_0x27b883[_0xab12('0x7')]||'';this[_0xab12('0x8')]=_0x27b883['refreshToken']||'';this[_0xab12('0x9')]=_0x27b883[_0xab12('0x9')]||{};}module[_0xab12('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index c5feed7..e60a75c 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 _0x3423=['Agent','membername','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','prototype','getCaller','format','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3342('0x0'));function checkNameSurname(_0x16bdb3,_0x3477de,_0x3b763d){var _0x21bdc2='';if(!_[_0x3342('0x1')](_0x3477de)&&_0x3342('0x2')===typeof _0x3477de){_0x21bdc2+=_0x3477de;}if(!_[_0x3342('0x1')](_0x3b763d)&&_0x3342('0x2')===typeof _0x3b763d){_0x21bdc2+='\x20'+_0x3b763d;}if(_0x21bdc2!==''){return _0x21bdc2;}return _0x16bdb3;}function Action(_0x19206f,_0x467453,_0x2ccbe0,_0x29c40c,_0x420d4b){this[_0x3342('0x3')]=_0x2ccbe0||undefined;this[_0x3342('0x4')]=_0x19206f['id'];this[_0x3342('0x5')]=_0x467453[_0x3342('0x6')];this[_0x3342('0x7')]=_0x467453['type'];this['campaigntype']=_0x3342('0x5');this['dialAnswer']=![];this['membername']=_['isNil'](_0x19206f['Agent'])?undefined:_0x19206f[_0x3342('0x8')][_0x3342('0x6')];this['channelAgent']=this[_0x3342('0x9')]?util['format'](_0x3342('0xa'),this[_0x3342('0x9')]):_0x29c40c||undefined;this['calleridname']=checkNameSurname(_0x19206f[_0x3342('0xb')][_0x3342('0xc')],_0x19206f[_0x3342('0xb')][_0x3342('0xd')],_0x19206f[_0x3342('0xb')][_0x3342('0xe')]);this[_0x3342('0xf')]=_0x19206f['active']||![];this[_0x3342('0x10')]=_0x19206f[_0x3342('0xc')];this['scheduledat']=_0x19206f[_0x3342('0x11')];this[_0x3342('0x12')]=_0x19206f['countbusyretry']||0x0;this['countcongestionretry']=_0x19206f[_0x3342('0x13')]||0x0;this[_0x3342('0x14')]=_0x19206f[_0x3342('0x14')]||0x0;this[_0x3342('0x15')]=(_0x19206f[_0x3342('0x12')]||0x0)+(_0x19206f[_0x3342('0x13')]||0x0)+(_0x19206f[_0x3342('0x14')]||0x0)+(_0x19206f[_0x3342('0x16')]||0x0)+(_0x19206f[_0x3342('0x17')]||0x0)+(_0x19206f['countabandonedretry']||0x0)+(_0x19206f[_0x3342('0x18')]||0x0)+(_0x19206f[_0x3342('0x19')]||0x0);this[_0x3342('0x16')]=_0x19206f['countnosuchnumberretry']||0x0;this[_0x3342('0x17')]=_0x19206f[_0x3342('0x17')]||0x0;this['countabandonedretry']=_0x19206f[_0x3342('0x1a')]||0x0;this[_0x3342('0x18')]=_0x19206f['countmachineretry']||0x0;this[_0x3342('0x19')]=_0x19206f['countagentrejectretry']||0x0;this[_0x3342('0x1b')]=_0x19206f[_0x3342('0x1b')];this[_0x3342('0x1c')]=_0x19206f[_0x3342('0x1c')];this[_0x3342('0x1d')]=_0x19206f[_0x3342('0x1d')];this[_0x3342('0x1e')]=_0x19206f[_0x3342('0x1e')];this['ContactId']=_0x19206f[_0x3342('0x1f')];this['ListId']=_0x19206f['ListId'];this[_0x3342('0x20')]=_['isNil'](_0x19206f['Agent'])?_0x19206f[_0x3342('0x20')]:_0x19206f['Agent']['id'];this[_0x3342('0x21')]=_0x19206f['VoiceQueueId'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x3342('0x22')][_0x3342('0x23')]=function(){return util[_0x3342('0x24')]('\x22%s\x22\x20<%s>',this[_0x3342('0x25')],this[_0x3342('0x26')]);};module[_0x3342('0x27')]=Action; \ No newline at end of file +var _0x77e6=['VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x3d6f87,_0x379d4c){var _0x48620e=function(_0x5d0228){while(--_0x5d0228){_0x3d6f87['push'](_0x3d6f87['shift']());}};_0x48620e(++_0x379d4c);}(_0x77e6,0x1a6));var _0x677e=function(_0x1f21b0,_0x20eb66){_0x1f21b0=_0x1f21b0-0x0;var _0x241097=_0x77e6[_0x1f21b0];return _0x241097;};'use strict';var util=require(_0x677e('0x0'));var _=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));function checkNameSurname(_0xa48f0c,_0x2dba41,_0x3a0a0e){var _0x4142a3='';if(!_[_0x677e('0x3')](_0x2dba41)&&'string'===typeof _0x2dba41){_0x4142a3+=_0x2dba41;}if(!_[_0x677e('0x3')](_0x3a0a0e)&&_0x677e('0x4')===typeof _0x3a0a0e){_0x4142a3+='\x20'+_0x3a0a0e;}if(_0x4142a3!==''){return _0x4142a3;}return _0xa48f0c;}function Action(_0x52e3f9,_0x18c5e1,_0x591b21,_0x40d314,_0x4d1a57){this['uniqueid']=_0x591b21||undefined;this[_0x677e('0x5')]=_0x52e3f9['id'];this[_0x677e('0x6')]=_0x18c5e1[_0x677e('0x7')];this[_0x677e('0x8')]=_0x18c5e1['type'];this[_0x677e('0x9')]='queue';this[_0x677e('0xa')]=![];this[_0x677e('0xb')]=_[_0x677e('0x3')](_0x52e3f9[_0x677e('0xc')])?undefined:_0x52e3f9[_0x677e('0xc')][_0x677e('0x7')];this[_0x677e('0xd')]=this[_0x677e('0xb')]?util[_0x677e('0xe')](_0x677e('0xf'),this[_0x677e('0xb')]):_0x40d314||undefined;this[_0x677e('0x10')]=checkNameSurname(_0x52e3f9[_0x677e('0x11')][_0x677e('0x12')],_0x52e3f9['Contact']['firstName'],_0x52e3f9['Contact'][_0x677e('0x13')]);this[_0x677e('0x14')]=_0x52e3f9[_0x677e('0x14')]||![];this[_0x677e('0x15')]=_0x52e3f9[_0x677e('0x12')];this[_0x677e('0x16')]=_0x52e3f9[_0x677e('0x16')];this[_0x677e('0x17')]=_0x52e3f9[_0x677e('0x17')]||0x0;this[_0x677e('0x18')]=_0x52e3f9[_0x677e('0x18')]||0x0;this[_0x677e('0x19')]=_0x52e3f9['countnoanswerretry']||0x0;this[_0x677e('0x1a')]=(_0x52e3f9[_0x677e('0x17')]||0x0)+(_0x52e3f9[_0x677e('0x18')]||0x0)+(_0x52e3f9[_0x677e('0x19')]||0x0)+(_0x52e3f9[_0x677e('0x1b')]||0x0)+(_0x52e3f9[_0x677e('0x1c')]||0x0)+(_0x52e3f9['countabandonedretry']||0x0)+(_0x52e3f9[_0x677e('0x1d')]||0x0)+(_0x52e3f9['countagentrejectretry']||0x0);this[_0x677e('0x1b')]=_0x52e3f9[_0x677e('0x1b')]||0x0;this[_0x677e('0x1c')]=_0x52e3f9['countdropretry']||0x0;this[_0x677e('0x1e')]=_0x52e3f9[_0x677e('0x1e')]||0x0;this[_0x677e('0x1d')]=_0x52e3f9[_0x677e('0x1d')]||0x0;this[_0x677e('0x1f')]=_0x52e3f9[_0x677e('0x1f')]||0x0;this[_0x677e('0x20')]=_0x52e3f9['callback'];this['callbackuniqueid']=_0x52e3f9['callbackuniqueid'];this[_0x677e('0x21')]=_0x52e3f9[_0x677e('0x21')];this[_0x677e('0x22')]=_0x52e3f9[_0x677e('0x22')];this[_0x677e('0x23')]=_0x52e3f9[_0x677e('0x23')];this[_0x677e('0x24')]=_0x52e3f9[_0x677e('0x24')];this[_0x677e('0x25')]=_[_0x677e('0x3')](_0x52e3f9['Agent'])?_0x52e3f9['UserId']:_0x52e3f9[_0x677e('0xc')]['id'];this[_0x677e('0x26')]=_0x52e3f9['VoiceQueueId'];this[_0x677e('0x27')]='';this[_0x677e('0x28')]='';}Action[_0x677e('0x29')][_0x677e('0x2a')]=function(){return util[_0x677e('0xe')](_0x677e('0x2b'),this['calleridname'],this[_0x677e('0x2c')]);};module[_0x677e('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index a0b96b7..aa09a0d 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 _0xc71b=['originatecalleridnum','extractCalleridNumber','setXMDContactVariables','assign','merge','toLowerVariables','variables','OriginateError','syncNewExten','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','disableContact','destuniqueid','keys','variable','value','error','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','preview','../../../config/logger','actionPreview','./action','./util/util','defaults','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','name','\x20is\x20not\x20active','message','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','clearZombieChannels','dialActive','setMessage','recallMe','isNil','actions','queue','originated:\x20','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','logCustomer','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','then','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumBillable','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','NOANSWER','outboundNoAnswerCallsDay','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','pick','unlock','unlockContact','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Queue','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','getCallerIdRandom'];(function(_0x4d973c,_0x36153f){var _0x33d408=function(_0x4e1fc3){while(--_0x4e1fc3){_0x4d973c['push'](_0x4d973c['shift']());}};_0x33d408(++_0x36153f);}(_0xc71b,0x164));var _0xbc71=function(_0xf2c1d7,_0x3b0708){_0xf2c1d7=_0xf2c1d7-0x0;var _0x40f855=_0xc71b[_0xf2c1d7];return _0x40f855;};'use strict';var util=require(_0xbc71('0x0'));var _=require(_0xbc71('0x1'));var uuid=require(_0xbc71('0x2'));var moment=require(_0xbc71('0x3'));var Redis=require('ioredis');var config=require(_0xbc71('0x4'));var logger=require('../../../config/logger')(_0xbc71('0x5'));var loggerAction=require(_0xbc71('0x6'))(_0xbc71('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0xbc71('0x8'));var ut=require(_0xbc71('0x9'));var utils=require('../dialer/utils');config['redis']=_[_0xbc71('0xa')](config[_0xbc71('0xb')],{'host':_0xbc71('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbc71('0xb')]));var Sequence=function(){};Sequence[_0xbc71('0xd')][_0xbc71('0xe')]=function(_0x28f610){this[_0xbc71('0xf')]=this[_0xbc71('0xf')]?this[_0xbc71('0xf')][_0xbc71('0x10')](_0x28f610):_0x28f610();};function Preview(_0x543cb6){this[_0xbc71('0x11')]=new Sequence();this[_0xbc71('0x12')]=_0x543cb6[_0xbc71('0x13')];this[_0xbc71('0x14')]=_0x543cb6['trunks'];this['actions']={};this[_0xbc71('0x15')]=_0x543cb6[_0xbc71('0x15')];this[_0xbc71('0x16')]=0x0;ami['on'](_0xbc71('0x17'),this[_0xbc71('0x18')][_0xbc71('0x19')](this));ami['on'](_0xbc71('0x1a'),this[_0xbc71('0x1b')][_0xbc71('0x19')](this));ami['on'](_0xbc71('0x1c'),this[_0xbc71('0x1d')]['bind'](this));ami['on'](_0xbc71('0x1e'),this[_0xbc71('0x1f')][_0xbc71('0x19')](this));ami['on'](_0xbc71('0x20'),this['syncNewExten'][_0xbc71('0x19')](this));ami['on'](_0xbc71('0x21'),this[_0xbc71('0x22')]['bind'](this));ami['on'](_0xbc71('0x23'),this[_0xbc71('0x24')][_0xbc71('0x19')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xbc71('0x19')](this));this['loopCampaigns'](this[_0xbc71('0x12')]);}function emit(_0x8008c0,_0x415862,_0x4d06e4){io['to'](_0x8008c0)[_0xbc71('0x25')](_0x415862,_0x4d06e4);}function emitVoiceQueueChannelRemove(_0x395e33){logger[_0xbc71('0x26')](_0xbc71('0x27'),JSON[_0xbc71('0x28')](_0x395e33));emit(util[_0xbc71('0x29')](_0xbc71('0x2a'),_0x395e33['name']),_0xbc71('0x2b'),_0x395e33);io['emit'](_0xbc71('0x2c'),_0x395e33);}function notSendMessagesQueue(_0x1b226f){if(_0x1b226f[_0xbc71('0x2d')]){if(_0x1b226f[_0xbc71('0x2e')]===0x0&&_0x1b226f[_0xbc71('0x2f')]===0x0){_0x1b226f['sendMessageOneNotActive']=![];_0x1b226f[_0xbc71('0x30')]=0x0;_0x1b226f[_0xbc71('0x31')]=0x0;_0x1b226f['message']=utils[_0xbc71('0x32')][_0xbc71('0x33')];ut[_0xbc71('0x34')](_0xbc71('0x35'),_0x1b226f[_0xbc71('0x36')]+_0xbc71('0x37'));}else{_0x1b226f[_0xbc71('0x38')]=utils[_0xbc71('0x32')][_0xbc71('0x39')];ut[_0xbc71('0x34')](_0xbc71('0x35'),_0x1b226f[_0xbc71('0x36')]+_0xbc71('0x3a'));}}}Preview['prototype']['loopCampaigns']=function(){var _0x20c1a8=this;setInterval(function(){_0x20c1a8[_0xbc71('0x3b')]();},0x7cf);};Preview[_0xbc71('0xd')][_0xbc71('0x3b')]=function(){var _0x3c59e7=this[_0xbc71('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x50b051 in _0x3c59e7){if(_0x3c59e7[_0xbc71('0x3c')](_0x50b051)&&(_0x3c59e7[_0x50b051][_0xbc71('0x3d')]===_0xbc71('0x5')||_0x3c59e7[_0x50b051]['dialMethod']===_0xbc71('0x3e'))&&_0x3c59e7[_0x50b051][_0xbc71('0x3f')]===_0xbc71('0x40')){if(this[_0xbc71('0x16')]>0x7){this[_0xbc71('0x16')]=0x0;this[_0xbc71('0x41')]();}}if(_0x3c59e7[_0xbc71('0x3c')](_0x50b051)&&_0x3c59e7[_0x50b051]['dialMethod']===_0xbc71('0x5')&&_0x3c59e7[_0x50b051][_0xbc71('0x3f')]==='outbound'){if(_0x3c59e7[_0x50b051][_0xbc71('0x42')]){this[_0xbc71('0x43')](_0x3c59e7[_0x50b051]);if(_0x3c59e7[_0x50b051]['dialPreviewAutoRecallMe'])this[_0xbc71('0x44')](_0x3c59e7[_0x50b051]);}else{notSendMessagesQueue(_0x3c59e7[_0x50b051]);}}}};Preview[_0xbc71('0xd')]['clearZombieChannel']=function(_0x538d5f){var _0x7c69c=this;this['sequence']['enqueue'](function(){if(!_[_0xbc71('0x45')](_0x7c69c[_0xbc71('0x46')][_0x538d5f])){loggerAction[_0xbc71('0x26')]('[clearZombieChannels][talking]',_0x538d5f,'Queue',_0x7c69c[_0xbc71('0x46')][_0x538d5f][_0xbc71('0x47')],_0xbc71('0x48'),JSON['stringify'](_0x7c69c['campaignsPreview'][_0x7c69c['actions'][_0x538d5f][_0xbc71('0x47')]][_0xbc71('0x2e')]),_0xbc71('0x49'),JSON[_0xbc71('0x28')](_0x7c69c['campaignsPreview'][_0x7c69c[_0xbc71('0x46')][_0x538d5f]['queue']][_0xbc71('0x2f')]),JSON[_0xbc71('0x28')](_0x7c69c[_0xbc71('0x46')][_0x538d5f]['dialAnswer']),JSON['stringify'](_['pick'](_0x7c69c['actions'][_0x538d5f],[_0xbc71('0x4a'),_0xbc71('0x4b'),_0xbc71('0x4c'),_0xbc71('0x4d')])));return ami[_0xbc71('0x4e')]({'action':_0xbc71('0x4f'),'channel':_0x7c69c['actions'][_0x538d5f][_0xbc71('0x50')]})[_0xbc71('0x51')](function(_0x503001){if(_0x503001['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x7c69c[_0xbc71('0x46')][_0x538d5f]){ut['updateOriginated'](_0x7c69c[_0xbc71('0x12')][_0x7c69c[_0xbc71('0x46')][_0x538d5f][_0xbc71('0x47')]],_0xbc71('0x52'));if(_0x7c69c[_0xbc71('0x46')][_0x538d5f][_0xbc71('0x53')]===!![]){ut[_0xbc71('0x54')](_0x7c69c[_0xbc71('0x12')][_0x7c69c[_0xbc71('0x46')][_0x538d5f]['queue']],_0xbc71('0x52'));ut['loggerError'](_0xbc71('0x55')+_0x538d5f,_0x7c69c[_0xbc71('0x46')][_0x538d5f][_0xbc71('0x47')]);}ut[_0xbc71('0x56')](_0xbc71('0x57')+_0x538d5f,_0x7c69c[_0xbc71('0x46')][_0x538d5f]['queue']);delete _0x7c69c[_0xbc71('0x46')][_0x538d5f];}},0x2328);}});}});};Preview['prototype'][_0xbc71('0x41')]=function(){var _0x1284fb=this;loggerAction[_0xbc71('0x26')](_0xbc71('0x58'),_[_0xbc71('0x59')](this[_0xbc71('0x46')]));for(var _0x3ebb4d in this[_0xbc71('0x46')]){if(_0x1284fb[_0xbc71('0x46')][_0xbc71('0x3c')](_0x3ebb4d)){_0x1284fb[_0xbc71('0x5a')](_0x3ebb4d);}}};Preview['prototype'][_0xbc71('0x44')]=function(_0x1bc170){var _0x3033df=this;rpcDb[_0xbc71('0x5b')](_0x1bc170['id'],ut[_0xbc71('0x5c')](this['agents']))['then'](function(_0x2cb981){if(!_[_0xbc71('0x45')](_0x2cb981)){for(var _0x163d67=0x0;_0x163d67<_0x2cb981[_0xbc71('0x5d')];_0x163d67+=0x1){if(ut['getDiff'](_0x2cb981[_0x163d67][_0xbc71('0x5e')])<_0x1bc170[_0xbc71('0x5f')]*0x3c){if(_0x2cb981[_0x163d67]['Agent']&&!_0x2cb981[_0x163d67][_0xbc71('0x60')][_0xbc71('0x61')]){_0x3033df[_0xbc71('0x62')](_0x2cb981[_0x163d67]['id'])['then'](ut[_0xbc71('0x63')](_0xbc71('0x64')))[_0xbc71('0x51')](ut[_0xbc71('0x63')](_0xbc71('0x64')));}else{rpcDb['disableContact'](_0x2cb981[_0x163d67]['id']);}}else{var _0x570dd3=new Action(_0x2cb981[_0x163d67],_0x1bc170);_0x570dd3[_0xbc71('0x65')]=moment()[_0xbc71('0x29')](_0xbc71('0x66'));_0x1bc170[_0xbc71('0x67')]+=0x1;ut['logCustomer'](_0x570dd3,0x17,'RecallInQueue');if(_0x1bc170['dialRecallInQueue']){rpcDb[_0xbc71('0x68')](ut[_0xbc71('0x69')](_0x2cb981[_0x163d67]));rpcDb[_0xbc71('0x6a')](_0x570dd3,_0xbc71('0x6b'));}else{ut['logCustomer'](_0x570dd3,0x16,_0xbc71('0x6c'));rpcDb[_0xbc71('0x6a')](_0x570dd3,_0xbc71('0x6d'));rpcDb[_0xbc71('0x6e')](_0x570dd3,_0xbc71('0x6d'));}}}}})[_0xbc71('0x51')](ut[_0xbc71('0x63')](_0xbc71('0x6f')));};Preview[_0xbc71('0xd')]['setMessage']=function(_0x4314f1){_0x4314f1[_0xbc71('0x2d')]=!![];if(ut[_0xbc71('0x70')](_0x4314f1[_0xbc71('0x71')])){_0x4314f1[_0xbc71('0x38')]=utils[_0xbc71('0x32')][_0xbc71('0x72')];}else if(!ut['isActive'](_0x4314f1[_0xbc71('0x42')])){_0x4314f1[_0xbc71('0x38')]=utils['CAMPAIGN_STATUS']['INACTIVE'];}else if(!this[_0xbc71('0x73')](_0x4314f1[_0xbc71('0x74')])){if(!this[_0xbc71('0x73')](_0x4314f1[_0xbc71('0x75')])){_0x4314f1[_0xbc71('0x38')]=utils[_0xbc71('0x32')][_0xbc71('0x76')];}else{_0x4314f1[_0xbc71('0x38')]=utils[_0xbc71('0x32')]['ACTIVE'];}}else{_0x4314f1[_0xbc71('0x38')]=utils['CAMPAIGN_STATUS'][_0xbc71('0x77')];}};Preview[_0xbc71('0xd')][_0xbc71('0x78')]=function(_0x1ae9b7,_0x4b0b78,_0x284705){var _0xc1c91=this;var _0x7c1a90=this[_0xbc71('0x46')][_0x4b0b78];var _0x3a022f=this[_0xbc71('0x12')][_0x7c1a90[_0xbc71('0x47')]];var _0x174de0;var _0x1ea2a9=![];var _0x4b7011=0x2;var _0x1b6253=0x3;if(_0x3a022f){switch(_0x284705){case'1':_0x3a022f[_0xbc71('0x79')]+=0x1;_0x7c1a90[_0xbc71('0x7a')]+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut[_0xbc71('0x7c')](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0x0,_0xbc71('0x7e'));ami[_0xbc71('0x25')](_0xbc71('0x7f'),ut[_0xbc71('0x80')](_0x7c1a90,_0xbc71('0x81')));rpcDb[_0xbc71('0x6a')](_0x7c1a90,'[callProgressDetectingCustomer][logNoSuch]');_0xc1c91[_0xbc71('0x82')](_0x7c1a90,'0',_0x3a022f)[_0xbc71('0x83')](function(_0x5a9e74){_0x1ea2a9=_0x5a9e74[_0xbc71('0x84')]==0x1;_0x4b7011=_0x3a022f[_0xbc71('0x85')];_0x1b6253=_0x3a022f[_0xbc71('0x86')];if(!_0x1ea2a9){if(ut['totalGlobal'](_0x7c1a90)>=_0x3a022f[_0xbc71('0x87')]){_0x174de0=ut['cloneAction'](_0x7c1a90,0xf,_0xbc71('0x88'));rpcDb[_0xbc71('0x6e')](_0x174de0,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x7c1a90['countnosuchnumberretry']>=_0x3a022f[_0xbc71('0x89')]){rpcDb[_0xbc71('0x6e')](_0x7c1a90,_0xbc71('0x8a'));}else{rpcDb[_0xbc71('0x8b')](ut[_0xbc71('0x8c')](_0x7c1a90,_0xbc71('0x7a'),_0x3a022f['dialNoSuchNumberRetryFrequency']),_0x7c1a90[_0xbc71('0x8d')],_0x7c1a90[_0xbc71('0x8e')]);}}delete this[_0xbc71('0x46')][_0x1ae9b7['linkedid']];}else{_0x7c1a90[_0xbc71('0x7a')]++;logger[_0xbc71('0x26')](_0xbc71('0x8f'),_0x7c1a90[_0xbc71('0x7a')]);logger[_0xbc71('0x26')]('id',_0x7c1a90[_0xbc71('0x90')]);_0xc1c91[_0xbc71('0x91')]({'id':_0x7c1a90['idContact'],'field':{'countnosuchnumberretry':_0x7c1a90[_0xbc71('0x7a')]}})[_0xbc71('0x83')](function(){_0xc1c91[_0xbc71('0x92')](_0x7c1a90,_0x4b7011,_0x1b6253)['then'](function(){});});}});break;case _0xbc71('0x93'):var _0x13d3b3=moment()[_0xbc71('0x29')](_0xbc71('0x66'));_0x7c1a90[_0xbc71('0x94')]=_0x13d3b3;_0x7c1a90['answertime']=_0x13d3b3;_0x7c1a90['dialAnswer']=!![];_0x3a022f['pTalking']+=0x1;logger[_0xbc71('0x26')](_0xbc71('0x95'),_0x7c1a90[_0xbc71('0x96')],'\x20Queue',_0x3a022f['name'],_0xbc71('0x49'),_0x3a022f['pTalking']);ami[_0xbc71('0x25')](_0xbc71('0x97'),ut[_0xbc71('0x80')](_0x7c1a90,_0xbc71('0x98'),this[_0xbc71('0x12')][_0x7c1a90[_0xbc71('0x47')]]));if(_0x3a022f[_0xbc71('0x99')]){ami[_0xbc71('0x25')](_0xbc71('0x9a'),ut[_0xbc71('0x9b')](_0x7c1a90));}break;case'16':ami[_0xbc71('0x25')](_0xbc71('0x9c'),ut['buildObj'](_0x7c1a90,'complete',this[_0xbc71('0x12')][_0x7c1a90['queue']]));emitVoiceQueueChannelRemove(ut[_0xbc71('0x80')](_0x7c1a90,'complete'));_0x3a022f['outboundAnswerCallsDay']+=0x1;_0x3a022f[_0xbc71('0x9d')]+=0x1;_0x3a022f['answered']+=0x1;ut[_0xbc71('0x54')](_0x3a022f,_0xbc71('0x9e'));_0x7c1a90[_0xbc71('0x7b')]=ut['totalGlobal'](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0x4,_0xbc71('0x9f'));rpcDb[_0xbc71('0x6a')](_0x7c1a90,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xbc71('0x6e')](_0x7c1a90,_0xbc71('0xa0'));rpcDb[_0xbc71('0xa1')](_0x7c1a90);_0x3a022f['sumDuration']+=_0x7c1a90['talktime'];_0x3a022f[_0xbc71('0xa2')]+=_0x7c1a90[_0xbc71('0xa3')];logger[_0xbc71('0x26')](_0xbc71('0xa4'),_0x7c1a90[_0xbc71('0x96')],_0xbc71('0xa5'),_0x3a022f[_0xbc71('0x36')],_0xbc71('0x49'),_0x3a022f[_0xbc71('0x2f')]);delete this[_0xbc71('0x46')][_0x1ae9b7[_0xbc71('0xa6')]];break;case _0xbc71('0xa7'):_0x3a022f[_0xbc71('0xa8')]+=0x1;_0x7c1a90[_0xbc71('0xa9')]+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut['totalGlobal'](_0x7c1a90);ut['logCustomer'](_0x7c1a90,0x5,_0xbc71('0xaa'));_0x4b7011=_0x3a022f[_0xbc71('0xab')];_0x1b6253=_0x3a022f[_0xbc71('0x86')];ami[_0xbc71('0x25')](_0xbc71('0xac'),ut[_0xbc71('0x80')](_0x7c1a90,'busy'));rpcDb['createCustomerHistory'](_0x7c1a90,_0xbc71('0xad'));_0xc1c91[_0xbc71('0x82')](_0x7c1a90,'5',_0x3a022f)[_0xbc71('0x83')](function(_0x44c40a){_0x1ea2a9=_0x44c40a[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut['totalGlobal'](_0x7c1a90)>=_0x3a022f[_0xbc71('0x87')]){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0xf,_0xbc71('0x88'));rpcDb[_0xbc71('0x6e')](_0x174de0,_0xbc71('0xaf'));}else{if(_0x7c1a90[_0xbc71('0xa9')]>=_0x3a022f['dialBusyMaxRetry']){rpcDb[_0xbc71('0x6e')](_0x7c1a90,_0xbc71('0xad'));}else{rpcDb[_0xbc71('0x8b')](ut[_0xbc71('0x8c')](_0x7c1a90,'countbusyretry',_0x3a022f['dialBusyRetryFrequency']),_0x7c1a90['unlockAgent'],_0x7c1a90['activeContact']);}}}else{_0x7c1a90['countbusyretry']++;_0xc1c91['incrementPreviewCounters']({'id':_0x7c1a90[_0xbc71('0x90')],'field':{'countbusyretry':_0x7c1a90[_0xbc71('0xa9')]}})[_0xbc71('0x83')](function(){_0xc1c91[_0xbc71('0x92')](_0x7c1a90,_0x4b7011,_0x1b6253)['then'](function(){});});}});break;case _0xbc71('0xb0'):_0x3a022f[_0xbc71('0xb1')]+=0x1;_0x7c1a90['countnoanswerretry']+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut['totalGlobal'](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0x3,'NoAnswer');_0x4b7011=_0x3a022f['dialNoAnswerRetryFrequency'];_0x1b6253=_0x3a022f[_0xbc71('0x86')];var _0x360ea8=ut['buildNoAnswerEventPayload'](_0x7c1a90,_0x3a022f);ami[_0xbc71('0x25')](_0xbc71('0xb2'),_0x360ea8);rpcDb[_0xbc71('0x6a')](_0x7c1a90,_0xbc71('0xb3'));_0xc1c91[_0xbc71('0x82')](_0x7c1a90,'3',_0x3a022f)[_0xbc71('0x83')](function(_0x13f4ba){_0x1ea2a9=_0x13f4ba[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut[_0xbc71('0x7c')](_0x7c1a90)>=_0x3a022f[_0xbc71('0x87')]){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0xf,'Global');rpcDb[_0xbc71('0x6e')](_0x174de0,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x7c1a90[_0xbc71('0xb4')]>=_0x3a022f[_0xbc71('0xb5')]){rpcDb[_0xbc71('0x6e')](_0x7c1a90,_0xbc71('0xb3'));}else{rpcDb[_0xbc71('0x8b')](ut[_0xbc71('0x8c')](_0x7c1a90,_0xbc71('0xb4'),_0x3a022f['dialNoAnswerRetryFrequency']),_0x7c1a90[_0xbc71('0x8d')],_0x7c1a90[_0xbc71('0x8e')]);}}}else{_0x7c1a90[_0xbc71('0xb4')]++;_0xc1c91[_0xbc71('0x91')]({'id':_0x7c1a90[_0xbc71('0x90')],'field':{'countnoanswerretry':_0x7c1a90[_0xbc71('0xb4')]}})[_0xbc71('0x83')](function(){_0xc1c91['swapAdditionalPhones'](_0x7c1a90,_0x4b7011,_0x1b6253)[_0xbc71('0x83')](function(){});});}});break;case _0xbc71('0xb6'):_0x3a022f['outboundCongestionCallsDay']+=0x1;_0x7c1a90[_0xbc71('0xb7')]+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut[_0xbc71('0x7c')](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0x8,_0xbc71('0xb8'));_0x4b7011=_0x3a022f[_0xbc71('0xb9')];_0x1b6253=_0x3a022f[_0xbc71('0x86')];ami[_0xbc71('0x25')](_0xbc71('0xba'),ut[_0xbc71('0x80')](_0x7c1a90,_0xbc71('0xbb')));rpcDb[_0xbc71('0x6a')](_0x7c1a90,'[callProgressDetectingCustomer][logCongestion]');_0xc1c91['verifyAdditionalPhones'](_0x7c1a90,'8',_0x3a022f)['then'](function(_0x467aaf){_0x1ea2a9=_0x467aaf[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut['totalGlobal'](_0x7c1a90)>=_0x3a022f[_0xbc71('0x87')]){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0xf,_0xbc71('0x88'));rpcDb['createCustomerFinal'](_0x174de0,_0xbc71('0xbc'));}else{if(_0x7c1a90[_0xbc71('0xb7')]>=_0x3a022f[_0xbc71('0xbd')]){rpcDb[_0xbc71('0x6e')](_0x7c1a90,_0xbc71('0xbe'));}else{rpcDb[_0xbc71('0x8b')](ut['scheduledAt'](_0x7c1a90,_0xbc71('0xb7'),_0x3a022f[_0xbc71('0xab')]),_0x7c1a90[_0xbc71('0x8d')],_0x7c1a90[_0xbc71('0x8e')]);}}}else{_0x7c1a90['countcongestionretry']++;_0xc1c91[_0xbc71('0x91')]({'id':_0x7c1a90[_0xbc71('0x90')],'field':{'countcongestionretry':_0x7c1a90['countcongestionretry']}})[_0xbc71('0x83')](function(){_0xc1c91[_0xbc71('0x92')](_0x7c1a90,_0x4b7011,_0x1b6253)[_0xbc71('0x83')](function(){});});}});break;case'CANCEL':_0x3a022f[_0xbc71('0xbf')]+=0x1;_0x7c1a90[_0xbc71('0xc0')]+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut[_0xbc71('0x7c')](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0x14,_0xbc71('0xc1'));_0x4b7011=_0x3a022f[_0xbc71('0xc2')];_0x1b6253=_0x3a022f[_0xbc71('0x86')];ami[_0xbc71('0x25')](_0xbc71('0xc3'),ut[_0xbc71('0x80')](_0x7c1a90,'agentreject'));rpcDb[_0xbc71('0x6a')](_0x7c1a90,_0xbc71('0xc4'));_0xc1c91[_0xbc71('0x82')](_0x7c1a90,'20',_0x3a022f)[_0xbc71('0x83')](function(_0x56038a){_0x1ea2a9=_0x56038a[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut['totalGlobal'](_0x7c1a90)>=_0x3a022f['dialGlobalMaxRetry']){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0x14,'AgentReject');rpcDb[_0xbc71('0x6e')](_0x174de0,_0xbc71('0xc5'));}else{if(_0x7c1a90[_0xbc71('0xc0')]>=_0x3a022f[_0xbc71('0xc6')]){rpcDb[_0xbc71('0x6e')](_0x7c1a90,_0xbc71('0xc5'));}else{rpcDb[_0xbc71('0x8b')](ut['scheduledAt'](_0x7c1a90,_0xbc71('0xc0'),_0x3a022f[_0xbc71('0xc2')]),_0x7c1a90[_0xbc71('0x8d')],_0x7c1a90[_0xbc71('0x8e')]);}}}else{_0x7c1a90['countnoanswerretry']++;_0xc1c91[_0xbc71('0x91')]({'id':_0x7c1a90[_0xbc71('0x90')],'field':{'countnoanswerretry':_0x7c1a90[_0xbc71('0xb4')]}})['then'](function(){_0xc1c91['swapAdditionalPhones'](_0x7c1a90,_0x4b7011,_0x1b6253)['then'](function(){});});}});break;case _0xbc71('0xc7'):_0x3a022f[_0xbc71('0xc8')]+=0x1;_0x7c1a90['countabandonedretry']+=0x1;_0x7c1a90['countglobal']=ut[_0xbc71('0x7c')](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0xb,_0xbc71('0xc9'));rpcDb[_0xbc71('0x6a')](_0x7c1a90,'[callProgressDetectingCustomer][logAbandoned]');_0xc1c91[_0xbc71('0x82')](_0x7c1a90,'11',_0x3a022f)[_0xbc71('0x83')](function(_0x2292b8){_0x1ea2a9=_0x2292b8[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut[_0xbc71('0x7c')](_0x7c1a90)>=_0x3a022f[_0xbc71('0x87')]){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0xf,'Global');rpcDb[_0xbc71('0x6e')](_0x174de0,_0xbc71('0xca'));}else{if(_0x7c1a90['countabandonedetry']>=_0x3a022f['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x7c1a90,_0xbc71('0xca'));}else{rpcDb['rescheduleContact'](ut[_0xbc71('0x8c')](_0x7c1a90,_0xbc71('0xcb'),_0x3a022f['dialAbandonedRetryFrequency']),_0x7c1a90[_0xbc71('0x8d')],_0x7c1a90['activeContact']);}}}else{_0x7c1a90[_0xbc71('0xb4')]++;_0xc1c91['incrementPreviewCounters']({'id':_0x7c1a90[_0xbc71('0x90')],'field':{'countnoanswerretry':_0x7c1a90[_0xbc71('0xb4')]}})[_0xbc71('0x83')](function(){_0xc1c91[_0xbc71('0x92')](_0x7c1a90,_0x4b7011,_0x1b6253)['then'](function(){});});}});break;case'18':_0x3a022f[_0xbc71('0xcc')]+=0x1;_0x7c1a90[_0xbc71('0xcd')]+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut['totalGlobal'](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0x12,_0x1ae9b7[_0xbc71('0xce')]||_0x1ae9b7[_0xbc71('0xcf')]);ami[_0xbc71('0x25')]('custom:amd',ut['buildObj'](_0x7c1a90,_0xbc71('0xd0')));rpcDb[_0xbc71('0x6a')](_0x7c1a90,_0xbc71('0xd1'));_0xc1c91['verifyAdditionalPhones'](_0x7c1a90,'18',_0x3a022f)[_0xbc71('0x83')](function(_0x4ca9cb){_0x1ea2a9=_0x4ca9cb[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut['totalGlobal'](_0x7c1a90)>=_0x3a022f[_0xbc71('0x87')]){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0x12,_0xbc71('0x88'));rpcDb[_0xbc71('0x6e')](_0x174de0,_0xbc71('0xd1'));}else{rpcDb[_0xbc71('0x6e')](_0x7c1a90,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x7c1a90[_0xbc71('0xb4')]++;_0xc1c91['incrementPreviewCounters']({'id':_0x7c1a90['idContact'],'field':{'countnoanswerretry':_0x7c1a90[_0xbc71('0xb4')]}})['then'](function(){_0xc1c91[_0xbc71('0x92')](_0x7c1a90,_0x4b7011,_0x1b6253)['then'](function(){});});}});delete this['actions'][_0x1ae9b7[_0xbc71('0xa6')]];break;case'19':_0x3a022f[_0xbc71('0xcc')]+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut[_0xbc71('0x7c')](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0x13,_0x1ae9b7[_0xbc71('0xce')]||_0x1ae9b7['dialstatus']);ami['emit'](_0xbc71('0xd2'),ut[_0xbc71('0x80')](_0x7c1a90,_0xbc71('0xd0')));rpcDb[_0xbc71('0x6a')](_0x7c1a90,'[callProgressDetectingCustomer][machine]');_0xc1c91['verifyAdditionalPhones'](_0x7c1a90,'18',_0x3a022f)[_0xbc71('0x83')](function(_0x4ba718){_0x1ea2a9=_0x4ba718[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut[_0xbc71('0x7c')](_0x7c1a90)>=_0x3a022f[_0xbc71('0x87')]){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0xf,_0xbc71('0x88'));rpcDb[_0xbc71('0x6e')](_0x174de0,_0xbc71('0xd3'));}else{rpcDb[_0xbc71('0x6e')](_0x7c1a90,'[callProgressDetectingCustomer][machine]');}}else{_0x7c1a90[_0xbc71('0xb4')]++;_0xc1c91[_0xbc71('0x91')]({'id':_0x7c1a90[_0xbc71('0x90')],'field':{'countnoanswerretry':_0x7c1a90[_0xbc71('0xb4')]}})[_0xbc71('0x83')](function(){_0xc1c91[_0xbc71('0x92')](_0x7c1a90,_0x4b7011,_0x1b6253)['then'](function(){});});}});delete this[_0xbc71('0x46')][_0x1ae9b7[_0xbc71('0xa6')]];break;default:if(_0x7c1a90[_0xbc71('0x53')]){ut[_0xbc71('0x54')](_0x3a022f,_0xbc71('0xd4'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x3a022f[_0xbc71('0x36')],_0x1ae9b7);}_0x3a022f['outboundUnknownCallsDay']+=0x1;_0x7c1a90[_0xbc71('0x7b')]=ut['totalGlobal'](_0x7c1a90);ut[_0xbc71('0x7d')](_0x7c1a90,0xc,_0x1ae9b7[_0xbc71('0xce')]||_0x1ae9b7[_0xbc71('0xcf')]);_0x4b7011=_0x3a022f[_0xbc71('0xc2')];_0x1b6253=_0x3a022f[_0xbc71('0x86')];rpcDb[_0xbc71('0x6a')](_0x7c1a90,'[callProgressDetectingCustomer][logUnknown]');_0xc1c91['verifyAdditionalPhones'](_0x7c1a90,'20',_0x3a022f)['then'](function(_0x2a15d1){_0x1ea2a9=_0x2a15d1[_0xbc71('0x84')]==0x1;if(!_0x1ea2a9){if(ut[_0xbc71('0x7c')](_0x7c1a90)>=_0x3a022f['dialGlobalMaxRetry']){_0x174de0=ut[_0xbc71('0xae')](_0x7c1a90,0xf,_0xbc71('0x88'));rpcDb[_0xbc71('0x6e')](_0x174de0,_0xbc71('0xd5'));}else{rpcDb[_0xbc71('0x6e')](_0x7c1a90,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xbc71('0x46')][_0x1ae9b7['linkedid']];}else{_0xc1c91['swapAdditionalPhones'](_0x7c1a90,_0x4b7011,_0x1b6253)[_0xbc71('0x83')](function(){});}});}if(!(_0x7c1a90[_0xbc71('0x53')]&&_0x284705==='16')){ut[_0xbc71('0xd6')](_0x3a022f,_0xbc71('0xd7'));logger['info'](_0xbc71('0xd8'),_0x7c1a90[_0xbc71('0x96')],'\x20Queue',_0x3a022f[_0xbc71('0x36')],_0xbc71('0x48'),_0x3a022f[_0xbc71('0x2e')]);}if(_0x284705!==_0xbc71('0x93')){delete this['actions'][_0x1ae9b7[_0xbc71('0xa6')]];delete this['actions'][_0x1ae9b7[_0xbc71('0xd9')]];}_0x3a022f[_0xbc71('0xda')]=!![];}};Preview[_0xbc71('0xd')][_0xbc71('0xdb')]=function(_0x1a0b46,_0x30f101,_0x2f8777){if(_[_0xbc71('0xdc')](_0x30f101)&&_0xbc71('0xdd')!==typeof _0x30f101){return;}if(_['isUndefined'](_0x2f8777)&&'object'!==typeof _0x2f8777){return;}switch(_0x2f8777[_0xbc71('0xde')]){case'0':ut[_0xbc71('0xdf')](_0x1a0b46,0x0,_0xbc71('0x7e'));rpcDb[_0xbc71('0xe0')](_0x1a0b46,_0xbc71('0xe1'));break;case'3':ut[_0xbc71('0xdf')](_0x1a0b46,0x3,'NoAnswer');rpcDb[_0xbc71('0xe0')](_0x1a0b46,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xbc71('0xdf')](_0x1a0b46,0x5,_0xbc71('0xaa'));rpcDb['createAgentHistory'](_0x1a0b46,_0xbc71('0xe2'));break;case'8':ut[_0xbc71('0xdf')](_0x1a0b46,0x8,_0xbc71('0xb8'));rpcDb['createAgentHistory'](_0x1a0b46,_0xbc71('0xe3'));break;case'22':ut['logAgent'](_0x1a0b46,0x16,_0xbc71('0xe4'));rpcDb['createAgentHistory'](_0x1a0b46,_0xbc71('0xe5'));break;default:ut[_0xbc71('0xdf')](_0x1a0b46,0xc,_0x2f8777['reason']);rpcDb[_0xbc71('0xe0')](_0x1a0b46,_0xbc71('0xe3'));}ut[_0xbc71('0xd6')](_0x30f101,_0xbc71('0xe6'));logger[_0xbc71('0x26')](_0xbc71('0xe7'),_0x1a0b46[_0xbc71('0x96')],_0xbc71('0xa5'),_0x30f101['name'],_0xbc71('0x48'),_0x30f101[_0xbc71('0x2e')]);delete this[_0xbc71('0x46')][_0x1a0b46[_0xbc71('0x96')]];};Preview[_0xbc71('0xd')][_0xbc71('0x82')]=function(_0x31f227,_0x16f52c,_0xdf12e7){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x31f227,_0x16f52c,_0xdf12e7)['catch'](logger['info']('[verifyAdditionalPhone]\x20'));};Preview['prototype']['swapAdditionalPhones']=function(_0x4c800c,_0xbf0e52,_0x259f0b){return cmHopperAdditionalPhone[_0xbc71('0x92')](_0x4c800c,_0xbf0e52,_0x259f0b)[_0xbc71('0x51')](logger[_0xbc71('0x26')](_0xbc71('0xe8')));};Preview[_0xbc71('0xd')][_0xbc71('0x91')]=function(_0x5a164e){return Promise['resolve']()[_0xbc71('0x83')](cmHopperAdditionalPhone[_0xbc71('0x91')](_0x5a164e))['catch'](logger[_0xbc71('0x26')](_0xbc71('0xe9')));};Preview[_0xbc71('0xd')][_0xbc71('0xea')]=function(_0x346692,_0x4a6b1f,_0x966ee0,_0x268317,_0x1f9c51){var _0x409e68=this;return new Promise(function(_0x308776,_0x2ae8fc){if(_[_0xbc71('0x45')](_0x4a6b1f)||_['isNil'](_0x4a6b1f[_0xbc71('0xeb')])||_[_0xbc71('0x45')](_0x4a6b1f[_0xbc71('0xec')])||_[_0xbc71('0x45')](_0x4a6b1f[_0xbc71('0x4c')])){_0x2ae8fc(ut['message'](_0xbc71('0xed'),_0x268317,_0x1f9c51));return;}var _0x446635=uuid['v4']();var _0x5274bf=_0x409e68[_0xbc71('0x12')][_0x4a6b1f['Queue'][_0xbc71('0x36')]];var _0x597701=_0x966ee0?_0x409e68[_0xbc71('0x15')][_0x966ee0]['id']:undefined;_0x409e68[_0xbc71('0x46')][_0x446635]=new Action(_0x4a6b1f,_0x5274bf,_0x446635,_0x966ee0,_0x597701);var _0xce2eca=_0x409e68[_0xbc71('0x46')][_0x446635];_0xce2eca[_0xbc71('0x8d')]=_0x268317;_0xce2eca[_0xbc71('0x8e')]=_0x1f9c51;_0xce2eca['lookAgent']=_0x966ee0;if(_['isEmpty'](_0x346692)){_0x409e68[_0xbc71('0xee')](_0xce2eca,_0x5274bf,_0x4a6b1f,_0x966ee0)[_0xbc71('0x83')](function(_0xa940eb){logger[_0xbc71('0x26')](_0xbc71('0xef'),_0xbc71('0xf0')+_0xce2eca[_0xbc71('0x47')]+'\x20IdHopper:\x20'+_0xce2eca[_0xbc71('0x90')],JSON['stringify'](_0xa940eb));ami[_0xbc71('0x25')](_0xbc71('0xf1'),ut[_0xbc71('0x80')](_0xce2eca,_0xbc71('0xf2'),_0x409e68[_0xbc71('0x12')][_0xce2eca[_0xbc71('0x47')]]));_0x308776(ut[_0xbc71('0x38')](_0xbc71('0xf3')));})[_0xbc71('0x51')](function(_0x57fc19){ut['logger'](_0xbc71('0xf4'),_0x57fc19);_0x2ae8fc(ut[_0xbc71('0x38')](_0xbc71('0xf5'),_0x268317,_0x1f9c51));});}else{_0x5274bf[_0xbc71('0xf6')]+=0x1;ut[_0xbc71('0xf7')](_0xce2eca);rpcDb[_0xbc71('0xf8')](_0xce2eca,_0xbc71('0xf9'));delete _0x409e68[_0xbc71('0x46')][_0x446635];_0x2ae8fc(ut[_0xbc71('0x38')](_0xbc71('0xfa'),_0x268317,_0x1f9c51));}});};Preview[_0xbc71('0xd')][_0xbc71('0x73')]=function(_0x90d6d){return!_[_0xbc71('0x45')](_0x90d6d)&&!_['isNil'](_0x90d6d[_0xbc71('0x36')])&&!_[_0xbc71('0x45')](_0x90d6d['active'])&&_0x90d6d[_0xbc71('0xfb')]&&!_[_0xbc71('0x45')](this['trunks'][util[_0xbc71('0x29')](_0xbc71('0xfc'),_0x90d6d['name'])])&&!_[_0xbc71('0x45')](this['trunks'][util[_0xbc71('0x29')]('SIP/%s',_0x90d6d[_0xbc71('0x36')])]['status'])&&(this[_0xbc71('0x14')][util[_0xbc71('0x29')](_0xbc71('0xfc'),_0x90d6d[_0xbc71('0x36')])][_0xbc71('0x4f')]===_0xbc71('0xfd')||this[_0xbc71('0x14')][util[_0xbc71('0x29')](_0xbc71('0xfc'),_0x90d6d['name'])][_0xbc71('0x4f')]===_0xbc71('0xfe'));};Preview['prototype'][_0xbc71('0x62')]=function(_0x29433e,_0x41904c){return this[_0xbc71('0xff')](_0x29433e,_0x41904c)[_0xbc71('0x83')](function(_0x5d9f4d){return _[_0xbc71('0x100')](_0x5d9f4d,[_0xbc71('0x38')]);})['catch'](function(_0x4a159b){if(_0x4a159b[_0xbc71('0x101')]){rpcDb[_0xbc71('0x102')](_0x29433e);}if(_0x4a159b[_0xbc71('0xfb')]){rpcDb['disableContact'](_0x29433e);}throw _['pick'](_0x4a159b,['message']);});};Preview['prototype'][_0xbc71('0xff')]=function(_0x48db2b,_0x449f87){var _0x5f107a=this;var _0x35d47d,_0x4286ce;return rpcDb['getContactPreview'](_0x48db2b)[_0xbc71('0x83')](function(_0x1d2e5e){if(!_['isNil'](_0x1d2e5e[0x0])){_0x4286ce=_0x1d2e5e[0x0]['recallme']?![]:!![];_0x35d47d=_0x1d2e5e[0x0][_0xbc71('0x103')]?!![]:![];_0x35d47d=_0x449f87?!![]:_0x35d47d;}var _0x5f3d34=_0x5f107a['validateContact'](_0x1d2e5e);if(_0x5f3d34[_0xbc71('0x104')]){rpcDb[_0xbc71('0x105')](_[_0xbc71('0x100')](_0x1d2e5e[0x0],['VoiceQueueId',_0xbc71('0xec')]))['then'](function(_0x10e2cb){_0x5f107a[_0xbc71('0xea')](_0x10e2cb,_0x1d2e5e[0x0],_0x449f87,_0x4286ce,_0x35d47d)[_0xbc71('0x83')](function(_0x40daf9){return _0x40daf9;})[_0xbc71('0x51')](function(_0xd1c47e){throw _0xd1c47e;});})[_0xbc71('0x51')](function(_0x314884){ut[_0xbc71('0x34')](_0xbc71('0x106'),_0x314884);throw ut[_0xbc71('0x38')]('Call\x20unsuccessful',_0x4286ce,_0x35d47d);});}else{throw ut['message'](_0x5f3d34['message'],_0x4286ce,_0x35d47d);}})['catch'](function(_0x19641c){ut[_0xbc71('0x34')](_0xbc71('0x107'),_0x19641c);throw ut[_0xbc71('0x38')](_0xbc71('0x108'),![],!![]);});};Preview[_0xbc71('0xd')]['validateContact']=function(_0x3b61e8){if(_[_0xbc71('0x45')](_0x3b61e8)||_[_0xbc71('0x109')](_0x3b61e8)||!_[_0xbc71('0x45')](_0x3b61e8[0x0]['Agent'])&&_[_0xbc71('0x45')](_0x3b61e8[0x0]['Agent']['name'])){ut['logger'](_0xbc71('0x10a'),_0x3b61e8);return{'isValid':![],'message':_0xbc71('0x10b')};}var _0x43960e=this['campaignsPreview'][_0x3b61e8[0x0][_0xbc71('0x10c')][_0xbc71('0x36')]];_0x43960e[_0xbc71('0x38')]=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0xbc71('0x45')](_0x43960e)){ut['logger'](_0xbc71('0x10d'),_0x43960e);return{'isValid':![],'message':_0xbc71('0x10e')};}if(!this['isTrunkReachable'](_0x43960e[_0xbc71('0x74')])){ut[_0xbc71('0x34')](_0xbc71('0x10f'),_0xbc71('0x110')+_0x43960e[_0xbc71('0x36')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xbc71('0x73')](_0x43960e['TrunkBackup'])){ut[_0xbc71('0x34')](_0xbc71('0x10f'),_0x43960e[_0xbc71('0x36')]+_0xbc71('0x111'));return{'isValid':![],'message':_0xbc71('0x112')};}}if(!ut[_0xbc71('0x113')](_0x43960e['dialActive'])){ut[_0xbc71('0x34')](_0xbc71('0x114'),_0x43960e[_0xbc71('0x36')]+_0xbc71('0x115'));return{'isValid':![],'message':_0xbc71('0x110')+_0x43960e[_0xbc71('0x36')]+_0xbc71('0x115')};}return{'isValid':!![],'message':_0xbc71('0x116')};};Preview[_0xbc71('0xd')][_0xbc71('0xee')]=function(_0x9dd522,_0x4dae31,_0x118fae,_0x51026e){var _0x5c27d8=this;return new Promise(function(_0x296434,_0x4d8fb5){var _0x3bab69=_0x9dd522[_0xbc71('0x96')];var _0x5e606a=_0x5c27d8['isTrunkReachable'](_0x4dae31[_0xbc71('0x74')])?util['format'](_0xbc71('0x117'),_0x4dae31[_0xbc71('0x74')][_0xbc71('0x36')],_[_0xbc71('0x45')](_0x4dae31[_0xbc71('0x118')])?'':_0x4dae31[_0xbc71('0x118')][_0xbc71('0x119')]()||'',_0x4dae31['dialCutDigit']>0x0?_0x118fae[_0xbc71('0xec')][_0xbc71('0x11a')](_0x4dae31[_0xbc71('0x11b')]):_0x118fae[_0xbc71('0xec')]):util[_0xbc71('0x29')](_0xbc71('0x117'),_['isNil'](_0x4dae31[_0xbc71('0x75')])?_0x4dae31['Trunk'][_0xbc71('0x36')]:_0x4dae31[_0xbc71('0x75')][_0xbc71('0x36')],_['isNil'](_0x4dae31[_0xbc71('0x118')])?'':_0x4dae31['dialPrefix']['trim']()||'',_0x4dae31[_0xbc71('0x11b')]>0x0?_0x118fae[_0xbc71('0xec')][_0xbc71('0x11a')](_0x4dae31[_0xbc71('0x11b')]):_0x118fae['phone']);var _0x5ce1cb=_0x5c27d8['isTrunkReachable'](_0x4dae31[_0xbc71('0x74')])?ut[_0xbc71('0x11c')](_0x4dae31[_0xbc71('0x74')]['callerid'],_0x4dae31[_0xbc71('0x11d')],_0x4dae31[_0xbc71('0x11e')]>0x0?ut['getCallerIdRandom'](_0x4dae31[_0xbc71('0x11f')],_0x4dae31[_0xbc71('0x11e')]):_0x4dae31['dialOriginateCallerIdNumber']):ut[_0xbc71('0x11c')](_[_0xbc71('0x45')](_0x4dae31[_0xbc71('0x75')])?_0x4dae31[_0xbc71('0x74')]['callerid']:_0x4dae31[_0xbc71('0x75')][_0xbc71('0x120')],_0x4dae31[_0xbc71('0x11d')],_0x4dae31[_0xbc71('0x11e')]>0x0?ut[_0xbc71('0x121')](_0x4dae31[_0xbc71('0x11f')],_0x4dae31[_0xbc71('0x11e')]):_0x4dae31[_0xbc71('0x11f')]);if(_0x5ce1cb){_0x9dd522['originatecalleridname']=ut['extractCalleridName'](_0x5ce1cb);_0x9dd522[_0xbc71('0x122')]=ut[_0xbc71('0x123')](_0x5ce1cb);}var _0x327ebc=ut['addVariables'](_0x4dae31,_0x118fae,_0x5e606a,_0x5ce1cb,_0x3bab69,_0x9dd522);var _0x4e69a9=utils[_0xbc71('0x124')](_0x118fae[_0xbc71('0xeb')]);Object[_0xbc71('0x125')](_0x327ebc,_0x4e69a9);_[_0xbc71('0x126')](_0x9dd522,ut[_0xbc71('0x127')](_0x327ebc));_0x9dd522[_0xbc71('0x65')]=moment()[_0xbc71('0x29')](_0xbc71('0x66'));_0x4dae31[_0xbc71('0x128')]=_0x327ebc;var _0x38f932=ut['variablesAction'](_0x9dd522,_0x4dae31,_0x327ebc,_0x9dd522[_0xbc71('0x8e')],_0x51026e);return ami[_0xbc71('0x4e')](_0x38f932)['then'](function(_0x3aa7e1){_0x4dae31[_0xbc71('0x2e')]+=0x1;logger['info']('[originated][increment]',_0x3bab69,_0xbc71('0xa5'),_0x4dae31[_0xbc71('0x36')],_0xbc71('0x48'),_0x4dae31[_0xbc71('0x2e')]);_0x296434(_0x3aa7e1);})[_0xbc71('0x51')](function(_0x5923d3){ut['logAgent'](_0x9dd522,0xe,_0xbc71('0x129'));rpcDb[_0xbc71('0xe0')](_0x9dd522,'[originateFailure][logOriginateFailure]');_0x4d8fb5(_0x5923d3);});});};Preview[_0xbc71('0xd')][_0xbc71('0x12a')]=function(_0x3df9a){if(this['actions'][_0x3df9a['linkedid']]){this['actions'][_0x3df9a['linkedid']][_0xbc71('0x50')]=_0x3df9a[_0xbc71('0x50')];}};Preview[_0xbc71('0xd')][_0xbc71('0x18')]=function(_0x54c906){var _0x8cd55e=this;var _0x4190d8=this['actions'][_0x54c906['actionid']];if(_0x4190d8){if(_0x4190d8['lookAgent']&&this[_0xbc71('0x15')][_0x4190d8[_0xbc71('0x12b')]]){ut[_0xbc71('0x12c')](_0x4190d8,this[_0xbc71('0x15')][_0x4190d8['lookAgent']][_0xbc71('0x36')],this[_0xbc71('0x15')][_0x4190d8['lookAgent']]['id']);}var _0x1bc37b=_[_0xbc71('0x12d')](_0x4190d8);_0x1bc37b[_0xbc71('0x94')]=moment()[_0xbc71('0x29')]('YYYY-MM-DD\x20HH:mm:ss');var _0xf5c52=_0x8cd55e['campaignsPreview'][_0x4190d8[_0xbc71('0x47')]];if(ut[_0xbc71('0x12e')](_0x54c906[_0xbc71('0x12f')])){if(_0x4190d8['unlockAgent']){rpcDb[_0xbc71('0x102')](_0x4190d8[_0xbc71('0x90')]);}if(_0x4190d8['activeContact']){rpcDb['disableContact'](_0x4190d8[_0xbc71('0x90')]);}ami[_0xbc71('0x25')](_0xbc71('0x130'),ut[_0xbc71('0x80')](_0x4190d8,_0xbc71('0x131'),this[_0xbc71('0x12')][_0x4190d8[_0xbc71('0x47')]]));this[_0xbc71('0xdb')](_0x1bc37b,_0xf5c52,_0x54c906);}else{_0x4190d8['starttime']=moment()[_0xbc71('0x29')](_0xbc71('0x66'));ut[_0xbc71('0xdf')](_0x1bc37b,0x4,_0xbc71('0x9f'));rpcDb[_0xbc71('0xe0')](_0x1bc37b,_0xbc71('0x132'));}}};Preview[_0xbc71('0xd')][_0xbc71('0x1b')]=function(_0x5a7758){var _0x5d9e15=this['actions'][_0x5a7758[_0xbc71('0xa6')]];var _0x38f473;if(_0x5d9e15){_0x38f473=this[_0xbc71('0x12')][_0x5d9e15[_0xbc71('0x47')]];logger[_0xbc71('0x26')](_0xbc71('0x133'),_0x5a7758[_0xbc71('0xa6')],_0xbc71('0xa5'),_0x38f473[_0xbc71('0x36')],_0xbc71('0x49'),_0x38f473[_0xbc71('0x2f')]);}if(this[_0xbc71('0x46')][_0x5a7758[_0xbc71('0xa6')]]&&_0x5a7758[_0xbc71('0xa6')]!==_0x5a7758[_0xbc71('0x96')]){if(_0x5a7758[_0xbc71('0x134')]==='16'&&this[_0xbc71('0x46')][_0x5a7758[_0xbc71('0xa6')]][_0xbc71('0x53')]){this['callProgressDetectingCustomer'](_0x5a7758,_0x5a7758['linkedid'],_0x5a7758[_0xbc71('0x134')]);}else if(this[_0xbc71('0x46')][_0x5a7758[_0xbc71('0xa6')]][_0xbc71('0x53')]){logger['info'](_0xbc71('0x135'),_0x5a7758[_0xbc71('0xa6')],_0x5a7758[_0xbc71('0x134')],_0xbc71('0xa5'),_0x38f473[_0xbc71('0x36')],_0xbc71('0x49'),_0x38f473[_0xbc71('0x2f')]);this[_0xbc71('0x78')](_0x5a7758,_0x5a7758[_0xbc71('0xa6')],_0x5a7758[_0xbc71('0x134')]);}}else if(_0x5d9e15&&_[_0xbc71('0x45')](_0x5d9e15[_0xbc71('0x136')])&&_0x38f473[_0xbc71('0x137')]&&_0x5a7758['linkedid']===_0x5a7758[_0xbc71('0x96')]&&_[_0xbc71('0x45')](_0x5a7758[_0xbc71('0xde')])&&_0x5a7758['cause']==='16'&&_0x5a7758[_0xbc71('0x138')]==='6'&&_[_0xbc71('0xdc')](_0x5d9e15[_0xbc71('0x139')])){if(_0x5d9e15['unlockAgent']){rpcDb[_0xbc71('0x102')](_0x5d9e15[_0xbc71('0x90')]);}if(_0x5d9e15[_0xbc71('0x8e')]){rpcDb[_0xbc71('0x13a')](_0x5d9e15[_0xbc71('0x90')]);}_0x5a7758[_0xbc71('0xde')]='22';this[_0xbc71('0xdb')](_0x5d9e15,_0x38f473,_0x5a7758);}else if(_0x5d9e15&&_0x5d9e15[_0xbc71('0x139')]){if(_0x5a7758[_0xbc71('0x134')]==='16'&&this[_0xbc71('0x46')][_0x5a7758[_0xbc71('0xa6')]]['dialAnswer']){logger['info']('[syncHangup][talking][transfer]',_0x5a7758[_0xbc71('0xa6')],_0x5a7758[_0xbc71('0x134')],_0xbc71('0xa5'),_0x38f473['name'],'pTalking:\x20',_0x38f473[_0xbc71('0x2f')]);this[_0xbc71('0x78')](_0x5a7758,_0x5a7758[_0xbc71('0xa6')],_0x5a7758[_0xbc71('0x134')]);}else if(this[_0xbc71('0x46')][_0x5a7758['linkedid']][_0xbc71('0x53')]){logger[_0xbc71('0x26')]('[syncHangup][talking][cause]',_0x5a7758[_0xbc71('0xa6')],_0x5a7758[_0xbc71('0x134')],_0xbc71('0xa5'),_0x38f473[_0xbc71('0x36')],_0xbc71('0x49'),_0x38f473[_0xbc71('0x2f')]);this['callProgressDetectingCustomer'](_0x5a7758,_0x5a7758['linkedid'],_0x5a7758[_0xbc71('0x134')]);}}};Preview[_0xbc71('0xd')]['syncDialEnd']=function(_0xd29273){if(this[_0xbc71('0x46')][_0xd29273[_0xbc71('0xd9')]]&&_0xd29273[_0xbc71('0xd9')]!==_0xd29273[_0xbc71('0x13b')]){this['callProgressDetectingCustomer'](_0xd29273,_0xd29273[_0xbc71('0xd9')],_0xd29273[_0xbc71('0xcf')]);}};Preview[_0xbc71('0xd')][_0xbc71('0x1d')]=function(_0x1afa88){if(this['actions'][_0x1afa88[_0xbc71('0xa6')]]&&_0x1afa88[_0xbc71('0xa6')]!==_0x1afa88[_0xbc71('0x96')]&&!this['actions'][_0x1afa88[_0xbc71('0xa6')]]['dialAnswer']){if(_0x1afa88[_0xbc71('0x134')]==='1'){this[_0xbc71('0x78')](_0x1afa88,_0x1afa88['linkedid'],_0x1afa88[_0xbc71('0x134')]);}}};Preview[_0xbc71('0xd')]['addVariable']=function(_0x44739a,_0x11bb46,_0xc727eb){if(this[_0xbc71('0x46')][_0x44739a]){if(_[_0xbc71('0x45')](this[_0xbc71('0x46')][_0x44739a]['variables'])){this[_0xbc71('0x46')][_0x44739a]['variables']={};}this['actions'][_0x44739a]['variables'][_0x11bb46]=_0xc727eb;}};Preview['prototype'][_0xbc71('0x22')]=function(_0x2dac44){try{if(!_['isNil'](_0x2dac44)){if(ut['filterKey'](_[_0xbc71('0x13c')](_0x2dac44['variable'])[0x0])){this['addVariable'](_0x2dac44[_0xbc71('0x96')],_[_0xbc71('0x13c')](_0x2dac44[_0xbc71('0x13d')])[0x0],_0x2dac44[_0xbc71('0x13e')]);}}}catch(_0x5b0e25){logger[_0xbc71('0x13f')]('[syncVarSet][Preview]',util['inspect'](_0x5b0e25,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xbc71('0x24')]=function(_0x5bd558){if(_0x5bd558){if(this[_0xbc71('0x46')][_0x5bd558[_0xbc71('0x140')]]){this[_0xbc71('0x46')][_0x5bd558[_0xbc71('0x140')]]['transfer']=!![];}}};Preview[_0xbc71('0xd')]['syncBlindTransfer']=function(_0x257ddc){if(_0x257ddc){if(this[_0xbc71('0x46')][_0x257ddc[_0xbc71('0x141')]]){this[_0xbc71('0x46')][_0x257ddc[_0xbc71('0x141')]][_0xbc71('0x139')]=!![];}}};module[_0xbc71('0x142')]=Preview; \ No newline at end of file +var _0x849d=['sendMessageOneNotActive','pTalking','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','prototype','hasOwnProperty','dialMethod','booked','type','outbound','clearZombieChannels','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','queue','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','\x20Queue','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','sumBillable','[syncHangup][talking][decrement]','uniqueid','linkedid','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','status','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','dialPrefix','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','originatecalleridnum','assign','merge','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','isFailure','response','custom:agentringnoanswer','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','filterKey','variable','keys','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/logger','preview','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','redis','defaults','localhost','socket.io-emitter','tail','finally','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','name','voice_queue_channel:remove','voice_queue_presence:remove'];(function(_0x3403d5,_0x3d99fc){var _0xf9df4f=function(_0x33d748){while(--_0x33d748){_0x3403d5['push'](_0x3403d5['shift']());}};_0xf9df4f(++_0x3d99fc);}(_0x849d,0x11f));var _0xd849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd849('0x0'));var _=require(_0xd849('0x1'));var uuid=require(_0xd849('0x2'));var moment=require(_0xd849('0x3'));var Redis=require(_0xd849('0x4'));var config=require('../../../config/environment');var logger=require(_0xd849('0x5'))(_0xd849('0x6'));var loggerAction=require('../../../config/logger')(_0xd849('0x7'));var ami=require('../ami');var rpcDb=require(_0xd849('0x8'));var cmHopperAdditionalPhone=require(_0xd849('0x9'));var Action=require('./action');var ut=require(_0xd849('0xa'));var utils=require('../dialer/utils');config[_0xd849('0xb')]=_[_0xd849('0xc')](config[_0xd849('0xb')],{'host':_0xd849('0xd'),'port':0x18eb});var io=require(_0xd849('0xe'))(new Redis(config[_0xd849('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x583c01){this[_0xd849('0xf')]=this['tail']?this[_0xd849('0xf')][_0xd849('0x10')](_0x583c01):_0x583c01();};function Preview(_0x3a017e){this['sequence']=new Sequence();this[_0xd849('0x11')]=_0x3a017e['voiceQueues'];this['trunks']=_0x3a017e[_0xd849('0x12')];this[_0xd849('0x13')]={};this['agents']=_0x3a017e[_0xd849('0x14')];this[_0xd849('0x15')]=0x0;ami['on'](_0xd849('0x16'),this[_0xd849('0x17')][_0xd849('0x18')](this));ami['on']('hangup',this[_0xd849('0x19')][_0xd849('0x18')](this));ami['on'](_0xd849('0x1a'),this[_0xd849('0x1b')]['bind'](this));ami['on'](_0xd849('0x1c'),this[_0xd849('0x1d')][_0xd849('0x18')](this));ami['on'](_0xd849('0x1e'),this[_0xd849('0x1f')][_0xd849('0x18')](this));ami['on'](_0xd849('0x20'),this[_0xd849('0x21')][_0xd849('0x18')](this));ami['on'](_0xd849('0x22'),this[_0xd849('0x23')][_0xd849('0x18')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xd849('0x18')](this));this[_0xd849('0x24')](this[_0xd849('0x11')]);}function emit(_0x26cecd,_0x495dc4,_0x379301){io['to'](_0x26cecd)[_0xd849('0x25')](_0x495dc4,_0x379301);}function emitVoiceQueueChannelRemove(_0x3e6095){logger[_0xd849('0x26')](_0xd849('0x27'),JSON[_0xd849('0x28')](_0x3e6095));emit(util['format']('voice:queue:%s',_0x3e6095[_0xd849('0x29')]),_0xd849('0x2a'),_0x3e6095);io[_0xd849('0x25')](_0xd849('0x2b'),_0x3e6095);}function notSendMessagesQueue(_0x3b73cb){if(_0x3b73cb[_0xd849('0x2c')]){if(_0x3b73cb['originated']===0x0&&_0x3b73cb[_0xd849('0x2d')]===0x0){_0x3b73cb[_0xd849('0x2c')]=![];_0x3b73cb[_0xd849('0x2e')]=0x0;_0x3b73cb[_0xd849('0x2f')]=0x0;_0x3b73cb[_0xd849('0x30')]=utils[_0xd849('0x31')][_0xd849('0x32')];ut[_0xd849('0x33')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3b73cb[_0xd849('0x29')]+_0xd849('0x34'));}else{_0x3b73cb[_0xd849('0x30')]=utils[_0xd849('0x31')][_0xd849('0x35')];ut['logger'](_0xd849('0x36'),_0x3b73cb[_0xd849('0x29')]+_0xd849('0x37'));}}}Preview['prototype'][_0xd849('0x24')]=function(){var _0x45d018=this;setInterval(function(){_0x45d018[_0xd849('0x38')]();},0x7cf);};Preview[_0xd849('0x39')][_0xd849('0x38')]=function(){var _0x593147=this[_0xd849('0x11')];this[_0xd849('0x15')]+=0x1;for(var _0x209df4 in _0x593147){if(_0x593147[_0xd849('0x3a')](_0x209df4)&&(_0x593147[_0x209df4][_0xd849('0x3b')]==='preview'||_0x593147[_0x209df4][_0xd849('0x3b')]===_0xd849('0x3c'))&&_0x593147[_0x209df4][_0xd849('0x3d')]===_0xd849('0x3e')){if(this[_0xd849('0x15')]>0x7){this[_0xd849('0x15')]=0x0;this[_0xd849('0x3f')]();}}if(_0x593147[_0xd849('0x3a')](_0x209df4)&&_0x593147[_0x209df4][_0xd849('0x3b')]===_0xd849('0x6')&&_0x593147[_0x209df4][_0xd849('0x3d')]===_0xd849('0x3e')){if(_0x593147[_0x209df4][_0xd849('0x40')]){this[_0xd849('0x41')](_0x593147[_0x209df4]);if(_0x593147[_0x209df4][_0xd849('0x42')])this[_0xd849('0x43')](_0x593147[_0x209df4]);}else{notSendMessagesQueue(_0x593147[_0x209df4]);}}}};Preview[_0xd849('0x39')][_0xd849('0x44')]=function(_0x209331){var _0x3644af=this;this['sequence'][_0xd849('0x45')](function(){if(!_[_0xd849('0x46')](_0x3644af[_0xd849('0x13')][_0x209331])){loggerAction[_0xd849('0x26')](_0xd849('0x47'),_0x209331,'Queue',_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')],'originated:\x20',JSON[_0xd849('0x28')](_0x3644af['campaignsPreview'][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]][_0xd849('0x49')]),_0xd849('0x4a'),JSON[_0xd849('0x28')](_0x3644af[_0xd849('0x11')][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]][_0xd849('0x2d')]),JSON['stringify'](_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x4b')]),JSON[_0xd849('0x28')](_[_0xd849('0x4c')](_0x3644af['actions'][_0x209331],[_0xd849('0x4d'),_0xd849('0x4e'),_0xd849('0x4f'),'ListId'])));return ami[_0xd849('0x50')]({'action':'status','channel':_0x3644af['actions'][_0x209331][_0xd849('0x51')]})[_0xd849('0x52')](function(_0x5bce8c){if(_0x5bce8c[_0xd849('0x30')]===_0xd849('0x53')){setTimeout(function(){if(_0x3644af[_0xd849('0x13')][_0x209331]){ut[_0xd849('0x54')](_0x3644af[_0xd849('0x11')][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]],_0xd849('0x55'));if(_0x3644af[_0xd849('0x13')][_0x209331]['dialAnswer']===!![]){ut['decrementTalkink'](_0x3644af['campaignsPreview'][_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]],_0xd849('0x55'));ut['loggerError'](_0xd849('0x56')+_0x209331,_0x3644af[_0xd849('0x13')][_0x209331][_0xd849('0x48')]);}ut['loggerError'](_0xd849('0x57')+_0x209331,_0x3644af['actions'][_0x209331][_0xd849('0x48')]);delete _0x3644af[_0xd849('0x13')][_0x209331];}},0x2328);}});}});};Preview[_0xd849('0x39')]['clearZombieChannels']=function(){var _0x97beea=this;loggerAction[_0xd849('0x26')](_0xd849('0x58'),_[_0xd849('0x59')](this[_0xd849('0x13')]));for(var _0x1d0571 in this[_0xd849('0x13')]){if(_0x97beea[_0xd849('0x13')]['hasOwnProperty'](_0x1d0571)){_0x97beea[_0xd849('0x44')](_0x1d0571);}}};Preview[_0xd849('0x39')][_0xd849('0x43')]=function(_0x35e4bb){var _0x27f345=this;rpcDb['getContactRecallMe'](_0x35e4bb['id'],ut[_0xd849('0x5a')](this[_0xd849('0x14')]))[_0xd849('0x5b')](function(_0x51a7d0){if(!_[_0xd849('0x46')](_0x51a7d0)){for(var _0x2c1382=0x0;_0x2c1382<_0x51a7d0[_0xd849('0x5c')];_0x2c1382+=0x1){if(ut[_0xd849('0x5d')](_0x51a7d0[_0x2c1382]['scheduledat'])<_0x35e4bb[_0xd849('0x5e')]*0x3c){if(_0x51a7d0[_0x2c1382][_0xd849('0x5f')]&&!_0x51a7d0[_0x2c1382][_0xd849('0x5f')][_0xd849('0x60')]){_0x27f345[_0xd849('0x61')](_0x51a7d0[_0x2c1382]['id'])['then'](ut[_0xd849('0x62')](_0xd849('0x63')))[_0xd849('0x52')](ut[_0xd849('0x62')]('[RecallMe]'));}else{rpcDb[_0xd849('0x64')](_0x51a7d0[_0x2c1382]['id']);}}else{var _0x319304=new Action(_0x51a7d0[_0x2c1382],_0x35e4bb);_0x319304['starttime']=moment()[_0xd849('0x65')](_0xd849('0x66'));_0x35e4bb[_0xd849('0x67')]+=0x1;ut[_0xd849('0x68')](_0x319304,0x17,_0xd849('0x69'));if(_0x35e4bb[_0xd849('0x6a')]){rpcDb[_0xd849('0x6b')](ut[_0xd849('0x6c')](_0x51a7d0[_0x2c1382]));rpcDb[_0xd849('0x6d')](_0x319304,_0xd849('0x6e'));}else{ut[_0xd849('0x68')](_0x319304,0x16,_0xd849('0x6f'));rpcDb[_0xd849('0x6d')](_0x319304,_0xd849('0x70'));rpcDb[_0xd849('0x71')](_0x319304,_0xd849('0x70'));}}}}})['catch'](ut[_0xd849('0x62')]('[getContactRecallMe]'));};Preview[_0xd849('0x39')][_0xd849('0x41')]=function(_0x2a01c4){_0x2a01c4[_0xd849('0x2c')]=!![];if(ut[_0xd849('0x72')](_0x2a01c4[_0xd849('0x73')])){_0x2a01c4[_0xd849('0x30')]=utils['CAMPAIGN_STATUS'][_0xd849('0x74')];}else if(!ut[_0xd849('0x75')](_0x2a01c4[_0xd849('0x40')])){_0x2a01c4[_0xd849('0x30')]=utils[_0xd849('0x31')][_0xd849('0x32')];}else if(!this[_0xd849('0x76')](_0x2a01c4[_0xd849('0x77')])){if(!this['isTrunkReachable'](_0x2a01c4[_0xd849('0x78')])){_0x2a01c4['message']=utils[_0xd849('0x31')][_0xd849('0x79')];}else{_0x2a01c4['message']=utils[_0xd849('0x31')][_0xd849('0x7a')];}}else{_0x2a01c4[_0xd849('0x30')]=utils[_0xd849('0x31')]['ACTIVE'];}};Preview[_0xd849('0x39')][_0xd849('0x7b')]=function(_0x5b640d,_0xfc8599,_0x332a74){var _0x2d87dc=this;var _0x3082f7=this['actions'][_0xfc8599];var _0x259910=this[_0xd849('0x11')][_0x3082f7['queue']];var _0x3e3dd1;var _0x46c180=![];var _0x185ca1=0x2;var _0x37379c=0x3;if(_0x259910){switch(_0x332a74){case'1':_0x259910['outboundNoSuchCallsDay']+=0x1;_0x3082f7[_0xd849('0x7c')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x0,_0xd849('0x7f'));ami[_0xd849('0x25')](_0xd849('0x80'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0x82')));rpcDb[_0xd849('0x6d')](_0x3082f7,'[callProgressDetectingCustomer][logNoSuch]');_0x2d87dc[_0xd849('0x83')](_0x3082f7,'0',_0x259910)[_0xd849('0x5b')](function(_0x509ad6){_0x46c180=_0x509ad6[_0xd849('0x84')]==0x1;_0x185ca1=_0x259910[_0xd849('0x85')];_0x37379c=_0x259910[_0xd849('0x86')];if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut['cloneAction'](_0x3082f7,0xf,'Global');rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0x88'));}else{if(_0x3082f7[_0xd849('0x7c')]>=_0x259910[_0xd849('0x89')]){rpcDb['createCustomerFinal'](_0x3082f7,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0x7c'),_0x259910[_0xd849('0x85')]),_0x3082f7['unlockAgent'],_0x3082f7[_0xd849('0x8b')]);}}delete this[_0xd849('0x13')][_0x5b640d['linkedid']];}else{_0x3082f7[_0xd849('0x7c')]++;logger[_0xd849('0x26')]('actioncountonusuch',_0x3082f7[_0xd849('0x7c')]);logger[_0xd849('0x26')]('id',_0x3082f7[_0xd849('0x8c')]);_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnosuchnumberretry':_0x3082f7['countnosuchnumberretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});break;case _0xd849('0x8f'):var _0x4dfb16=moment()[_0xd849('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x3082f7['responsetime']=_0x4dfb16;_0x3082f7['answertime']=_0x4dfb16;_0x3082f7[_0xd849('0x4b')]=!![];_0x259910[_0xd849('0x2d')]+=0x1;logger[_0xd849('0x26')](_0xd849('0x90'),_0x3082f7['uniqueid'],_0xd849('0x91'),_0x259910['name'],_0xd849('0x4a'),_0x259910[_0xd849('0x2d')]);ami[_0xd849('0x25')]('custom:agentconnect',ut[_0xd849('0x81')](_0x3082f7,_0xd849('0x92'),this['campaignsPreview'][_0x3082f7[_0xd849('0x48')]]));if(_0x259910['acw']){ami[_0xd849('0x25')](_0xd849('0x93'),ut[_0xd849('0x94')](_0x3082f7));}break;case'16':ami[_0xd849('0x25')](_0xd849('0x95'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0x96'),this[_0xd849('0x11')][_0x3082f7[_0xd849('0x48')]]));emitVoiceQueueChannelRemove(ut[_0xd849('0x81')](_0x3082f7,'complete'));_0x259910[_0xd849('0x97')]+=0x1;_0x259910[_0xd849('0x98')]+=0x1;_0x259910[_0xd849('0x99')]+=0x1;ut['decrementTalkink'](_0x259910,_0xd849('0x9a'));_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x4,_0xd849('0x9b'));rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0x9c'));rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0x9d'));rpcDb['crateCustomerReportQueue'](_0x3082f7);_0x259910['sumDuration']+=_0x3082f7[_0xd849('0x9e')];_0x259910[_0xd849('0x9f')]+=_0x3082f7[_0xd849('0x9e')];logger[_0xd849('0x26')](_0xd849('0xa0'),_0x3082f7[_0xd849('0xa1')],'\x20Queue',_0x259910[_0xd849('0x29')],_0xd849('0x4a'),_0x259910['pTalking']);delete this['actions'][_0x5b640d[_0xd849('0xa2')]];break;case _0xd849('0xa3'):_0x259910['outboundBusyCallsDay']+=0x1;_0x3082f7[_0xd849('0xa4')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x5,_0xd849('0xa5'));_0x185ca1=_0x259910[_0xd849('0xa6')];_0x37379c=_0x259910[_0xd849('0x86')];ami[_0xd849('0x25')](_0xd849('0xa7'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0xa8')));rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0xa9'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'5',_0x259910)[_0xd849('0x5b')](function(_0x40657a){_0x46c180=_0x40657a[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xac'));}else{if(_0x3082f7['countbusyretry']>=_0x259910[_0xd849('0xad')]){rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd849('0xae')](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xa4'),_0x259910[_0xd849('0xa6')]),_0x3082f7[_0xd849('0xaf')],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xa4')]++;_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countbusyretry':_0x3082f7[_0xd849('0xa4')]}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});break;case _0xd849('0xb0'):_0x259910[_0xd849('0xb1')]+=0x1;_0x3082f7['countnoanswerretry']+=0x1;_0x3082f7['countglobal']=ut[_0xd849('0x7e')](_0x3082f7);ut['logCustomer'](_0x3082f7,0x3,_0xd849('0xb2'));_0x185ca1=_0x259910[_0xd849('0xb3')];_0x37379c=_0x259910[_0xd849('0x86')];var _0x31ae06=ut[_0xd849('0xb4')](_0x3082f7,_0x259910);ami[_0xd849('0x25')](_0xd849('0xb5'),_0x31ae06);rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xb6'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'3',_0x259910)['then'](function(_0x490d0a){_0x46c180=_0x490d0a['additional']==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,_0xd849('0xab'));rpcDb['createCustomerFinal'](_0x3e3dd1,_0xd849('0xb7'));}else{if(_0x3082f7[_0xd849('0xb8')]>=_0x259910[_0xd849('0xb9')]){rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0xb6'));}else{rpcDb[_0xd849('0xae')](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xb8'),_0x259910[_0xd849('0xb3')]),_0x3082f7['unlockAgent'],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7[_0xd849('0xb8')]}})['then'](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});break;case _0xd849('0xba'):_0x259910[_0xd849('0xbb')]+=0x1;_0x3082f7[_0xd849('0xbc')]+=0x1;_0x3082f7['countglobal']=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x8,_0xd849('0xbd'));_0x185ca1=_0x259910[_0xd849('0xbe')];_0x37379c=_0x259910[_0xd849('0x86')];ami[_0xd849('0x25')]('custom:agentcongestion',ut[_0xd849('0x81')](_0x3082f7,'congestion'));rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xbf'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'8',_0x259910)['then'](function(_0xad7dd3){_0x46c180=_0xad7dd3[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut['cloneAction'](_0x3082f7,0xf,_0xd849('0xab'));rpcDb['createCustomerFinal'](_0x3e3dd1,_0xd849('0xc0'));}else{if(_0x3082f7['countcongestionretry']>=_0x259910['dialCongestionMaxRetry']){rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0xbf'));}else{rpcDb['rescheduleContact'](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xbc'),_0x259910[_0xd849('0xa6')]),_0x3082f7[_0xd849('0xaf')],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xbc')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countcongestionretry':_0x3082f7['countcongestionretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});break;case _0xd849('0xc1'):_0x259910[_0xd849('0xc2')]+=0x1;_0x3082f7[_0xd849('0xc3')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x14,_0xd849('0xc4'));_0x185ca1=_0x259910[_0xd849('0xc5')];_0x37379c=_0x259910[_0xd849('0x86')];ami[_0xd849('0x25')](_0xd849('0xc6'),ut['buildObj'](_0x3082f7,_0xd849('0xc7')));rpcDb[_0xd849('0x6d')](_0x3082f7,'[syncHangupRequest][logAgentReject]');_0x2d87dc[_0xd849('0x83')](_0x3082f7,'20',_0x259910)[_0xd849('0x5b')](function(_0x4aff54){_0x46c180=_0x4aff54['additional']==0x1;if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0x14,_0xd849('0xc4'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xc8'));}else{if(_0x3082f7[_0xd849('0xc3')]>=_0x259910[_0xd849('0xc9')]){rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd849('0xae')](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xc3'),_0x259910[_0xd849('0xc5')]),_0x3082f7[_0xd849('0xaf')],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7['countnoanswerretry']++;_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7['countnoanswerretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});break;case _0xd849('0xca'):_0x259910[_0xd849('0xcb')]+=0x1;_0x3082f7['countabandonedretry']+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0xb,_0xd849('0xcc'));rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xcd'));_0x2d87dc['verifyAdditionalPhones'](_0x3082f7,'11',_0x259910)['then'](function(_0x4e2f71){_0x46c180=_0x4e2f71['additional']==0x1;if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut['cloneAction'](_0x3082f7,0xf,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xcd'));}else{if(_0x3082f7[_0xd849('0xce')]>=_0x259910[_0xd849('0xcf')]){rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0xd849('0x8a')](_0x3082f7,_0xd849('0xd0'),_0x259910[_0xd849('0xd1')]),_0x3082f7['unlockAgent'],_0x3082f7[_0xd849('0x8b')]);}}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc[_0xd849('0x8d')]({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7['countnoanswerretry']}})[_0xd849('0x5b')](function(){_0x2d87dc[_0xd849('0x8e')](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});break;case'18':_0x259910['outboundUnknownCallsDay']+=0x1;_0x3082f7[_0xd849('0xd2')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x12,_0x5b640d[_0xd849('0xd3')]||_0x5b640d['dialstatus']);ami[_0xd849('0x25')]('custom:amd',ut[_0xd849('0x81')](_0x3082f7,'amd'));rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0xd4'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'18',_0x259910)['then'](function(_0x1a0d9f){_0x46c180=_0x1a0d9f[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut['totalGlobal'](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0x12,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xd849('0x71')](_0x3082f7,_0xd849('0xd4'));}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7[_0xd849('0xb8')]}})[_0xd849('0x5b')](function(){_0x2d87dc['swapAdditionalPhones'](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});});}});delete this[_0xd849('0x13')][_0x5b640d['linkedid']];break;case'19':_0x259910[_0xd849('0xd5')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut[_0xd849('0x7e')](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0x13,_0x5b640d[_0xd849('0xd3')]||_0x5b640d[_0xd849('0xd6')]);ami[_0xd849('0x25')](_0xd849('0xd7'),ut[_0xd849('0x81')](_0x3082f7,_0xd849('0xd8')));rpcDb['createCustomerHistory'](_0x3082f7,_0xd849('0xd9'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'18',_0x259910)[_0xd849('0x5b')](function(_0x2f8127){_0x46c180=_0x2f8127['additional']==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910['dialGlobalMaxRetry']){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,'Global');rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xd9'));}else{rpcDb[_0xd849('0x71')](_0x3082f7,'[callProgressDetectingCustomer][machine]');}}else{_0x3082f7[_0xd849('0xb8')]++;_0x2d87dc['incrementPreviewCounters']({'id':_0x3082f7[_0xd849('0x8c')],'field':{'countnoanswerretry':_0x3082f7[_0xd849('0xb8')]}})[_0xd849('0x5b')](function(){_0x2d87dc['swapAdditionalPhones'](_0x3082f7,_0x185ca1,_0x37379c)['then'](function(){});});}});delete this[_0xd849('0x13')][_0x5b640d[_0xd849('0xa2')]];break;default:if(_0x3082f7[_0xd849('0x4b')]){ut[_0xd849('0xda')](_0x259910,_0xd849('0xdb'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x259910[_0xd849('0x29')],_0x5b640d);}_0x259910[_0xd849('0xd5')]+=0x1;_0x3082f7[_0xd849('0x7d')]=ut['totalGlobal'](_0x3082f7);ut[_0xd849('0x68')](_0x3082f7,0xc,_0x5b640d[_0xd849('0xd3')]||_0x5b640d[_0xd849('0xd6')]);_0x185ca1=_0x259910['dialAgentRejectRetryFrequency'];_0x37379c=_0x259910[_0xd849('0x86')];rpcDb[_0xd849('0x6d')](_0x3082f7,_0xd849('0xdc'));_0x2d87dc[_0xd849('0x83')](_0x3082f7,'20',_0x259910)['then'](function(_0x46e7ac){_0x46c180=_0x46e7ac[_0xd849('0x84')]==0x1;if(!_0x46c180){if(ut[_0xd849('0x7e')](_0x3082f7)>=_0x259910[_0xd849('0x87')]){_0x3e3dd1=ut[_0xd849('0xaa')](_0x3082f7,0xf,_0xd849('0xab'));rpcDb[_0xd849('0x71')](_0x3e3dd1,_0xd849('0xdd'));}else{rpcDb['createCustomerFinal'](_0x3082f7,_0xd849('0xdd'));}delete this[_0xd849('0x13')][_0x5b640d[_0xd849('0xa2')]];}else{_0x2d87dc['swapAdditionalPhones'](_0x3082f7,_0x185ca1,_0x37379c)[_0xd849('0x5b')](function(){});}});}if(!(_0x3082f7['dialAnswer']&&_0x332a74==='16')){ut['updateOriginated'](_0x259910,_0xd849('0xde'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x3082f7['uniqueid'],'\x20Queue',_0x259910[_0xd849('0x29')],'originated:\x20',_0x259910[_0xd849('0x49')]);}if(_0x332a74!==_0xd849('0x8f')){delete this[_0xd849('0x13')][_0x5b640d[_0xd849('0xa2')]];delete this['actions'][_0x5b640d[_0xd849('0xdf')]];}_0x259910[_0xd849('0xe0')]=!![];}};Preview[_0xd849('0x39')][_0xd849('0xe1')]=function(_0x29fb6b,_0x35c602,_0x27abb4){if(_[_0xd849('0xe2')](_0x35c602)&&'object'!==typeof _0x35c602){return;}if(_[_0xd849('0xe2')](_0x27abb4)&&_0xd849('0xe3')!==typeof _0x27abb4){return;}switch(_0x27abb4[_0xd849('0xe4')]){case'0':ut[_0xd849('0xe5')](_0x29fb6b,0x0,_0xd849('0x7f'));rpcDb['createAgentHistory'](_0x29fb6b,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xd849('0xe5')](_0x29fb6b,0x3,'NoAnswer');rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe7'));break;case'5':ut[_0xd849('0xe5')](_0x29fb6b,0x5,_0xd849('0xa5'));rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe8'));break;case'8':ut[_0xd849('0xe5')](_0x29fb6b,0x8,_0xd849('0xbd'));rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe9'));break;case'22':ut[_0xd849('0xe5')](_0x29fb6b,0x16,_0xd849('0xea'));rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xeb'));break;default:ut[_0xd849('0xe5')](_0x29fb6b,0xc,_0x27abb4[_0xd849('0xe4')]);rpcDb[_0xd849('0xe6')](_0x29fb6b,_0xd849('0xe9'));}ut['updateOriginated'](_0x35c602,_0xd849('0xec'));logger[_0xd849('0x26')](_0xd849('0xed'),_0x29fb6b['uniqueid'],_0xd849('0x91'),_0x35c602['name'],_0xd849('0xee'),_0x35c602[_0xd849('0x49')]);delete this[_0xd849('0x13')][_0x29fb6b[_0xd849('0xa1')]];};Preview[_0xd849('0x39')][_0xd849('0x83')]=function(_0x232290,_0x4d6e2a,_0x3272f4){return cmHopperAdditionalPhone[_0xd849('0x83')](_0x232290,_0x4d6e2a,_0x3272f4)[_0xd849('0x52')](logger[_0xd849('0x26')](_0xd849('0xef')));};Preview[_0xd849('0x39')]['swapAdditionalPhones']=function(_0xbcc126,_0x2cdcde,_0x1f8639){return cmHopperAdditionalPhone[_0xd849('0x8e')](_0xbcc126,_0x2cdcde,_0x1f8639)[_0xd849('0x52')](logger[_0xd849('0x26')](_0xd849('0xf0')));};Preview[_0xd849('0x39')][_0xd849('0x8d')]=function(_0x2c6d3c){return Promise[_0xd849('0xf1')]()['then'](cmHopperAdditionalPhone[_0xd849('0x8d')](_0x2c6d3c))['catch'](logger[_0xd849('0x26')](_0xd849('0xf2')));};Preview[_0xd849('0x39')][_0xd849('0xf3')]=function(_0x9eb31,_0x327631,_0x2183fa,_0x5346a7,_0x104052){var _0x2df7ff=this;return new Promise(function(_0x2a3dec,_0x1ff489){if(_[_0xd849('0x46')](_0x327631)||_['isNil'](_0x327631[_0xd849('0xf4')])||_[_0xd849('0x46')](_0x327631[_0xd849('0xf5')])||_[_0xd849('0x46')](_0x327631[_0xd849('0x4f')])){_0x1ff489(ut[_0xd849('0x30')](_0xd849('0xf6'),_0x5346a7,_0x104052));return;}var _0x399d5d=uuid['v4']();var _0x341b43=_0x2df7ff[_0xd849('0x11')][_0x327631[_0xd849('0xf7')]['name']];var _0x2fb512=_0x2183fa?_0x2df7ff[_0xd849('0x14')][_0x2183fa]['id']:undefined;_0x2df7ff[_0xd849('0x13')][_0x399d5d]=new Action(_0x327631,_0x341b43,_0x399d5d,_0x2183fa,_0x2fb512);var _0x2b7215=_0x2df7ff[_0xd849('0x13')][_0x399d5d];_0x2b7215[_0xd849('0xaf')]=_0x5346a7;_0x2b7215[_0xd849('0x8b')]=_0x104052;_0x2b7215[_0xd849('0xf8')]=_0x2183fa;if(_[_0xd849('0xf9')](_0x9eb31)){_0x2df7ff[_0xd849('0xfa')](_0x2b7215,_0x341b43,_0x327631,_0x2183fa)['then'](function(_0x3362e6){logger[_0xd849('0x26')](_0xd849('0xfb'),'Queue:\x20'+_0x2b7215[_0xd849('0x48')]+_0xd849('0xfc')+_0x2b7215[_0xd849('0x8c')],JSON[_0xd849('0x28')](_0x3362e6));ami[_0xd849('0x25')]('custom:agentcalled',ut['buildObj'](_0x2b7215,_0xd849('0xfd'),_0x2df7ff[_0xd849('0x11')][_0x2b7215[_0xd849('0x48')]]));_0x2a3dec(ut[_0xd849('0x30')](_0xd849('0xfe')));})[_0xd849('0x52')](function(_0x28c37a){ut['logger'](_0xd849('0xff'),_0x28c37a);_0x1ff489(ut[_0xd849('0x30')]('Call\x20failed',_0x5346a7,_0x104052));});}else{_0x341b43[_0xd849('0x100')]+=0x1;ut[_0xd849('0x101')](_0x2b7215);rpcDb[_0xd849('0x102')](_0x2b7215,_0xd849('0x103'));delete _0x2df7ff[_0xd849('0x13')][_0x399d5d];_0x1ff489(ut[_0xd849('0x30')]('Contact\x20in\x20black\x20List',_0x5346a7,_0x104052));}});};Preview[_0xd849('0x39')]['isTrunkReachable']=function(_0x16ef9f){return!_['isNil'](_0x16ef9f)&&!_[_0xd849('0x46')](_0x16ef9f[_0xd849('0x29')])&&!_['isNil'](_0x16ef9f[_0xd849('0x104')])&&_0x16ef9f[_0xd849('0x104')]&&!_[_0xd849('0x46')](this[_0xd849('0x12')][util[_0xd849('0x65')](_0xd849('0x105'),_0x16ef9f['name'])])&&!_['isNil'](this['trunks'][util['format'](_0xd849('0x105'),_0x16ef9f[_0xd849('0x29')])][_0xd849('0x106')])&&(this[_0xd849('0x12')][util[_0xd849('0x65')](_0xd849('0x105'),_0x16ef9f['name'])][_0xd849('0x106')]===_0xd849('0x107')||this[_0xd849('0x12')][util['format'](_0xd849('0x105'),_0x16ef9f['name'])][_0xd849('0x106')]===_0xd849('0x108'));};Preview[_0xd849('0x39')][_0xd849('0x61')]=function(_0x96faf2,_0x45cd54){return this['execRun'](_0x96faf2,_0x45cd54)[_0xd849('0x5b')](function(_0x3a3542){return _['pick'](_0x3a3542,[_0xd849('0x30')]);})[_0xd849('0x52')](function(_0x2fbd6f){if(_0x2fbd6f[_0xd849('0x109')]){rpcDb[_0xd849('0x10a')](_0x96faf2);}if(_0x2fbd6f['active']){rpcDb[_0xd849('0x64')](_0x96faf2);}throw _[_0xd849('0x4c')](_0x2fbd6f,[_0xd849('0x30')]);});};Preview[_0xd849('0x39')][_0xd849('0x10b')]=function(_0x308270,_0x548229){var _0x110e4=this;var _0x1e8930,_0x1680f6;return rpcDb[_0xd849('0x10c')](_0x308270)['then'](function(_0x130ede){if(!_[_0xd849('0x46')](_0x130ede[0x0])){_0x1680f6=_0x130ede[0x0]['recallme']?![]:!![];_0x1e8930=_0x130ede[0x0][_0xd849('0x10d')]?!![]:![];_0x1e8930=_0x548229?!![]:_0x1e8930;}var _0x5c5578=_0x110e4[_0xd849('0x10e')](_0x130ede);if(_0x5c5578[_0xd849('0x10f')]){rpcDb[_0xd849('0x110')](_['pick'](_0x130ede[0x0],[_0xd849('0x4f'),'phone']))[_0xd849('0x5b')](function(_0xe0dcf5){_0x110e4[_0xd849('0xf3')](_0xe0dcf5,_0x130ede[0x0],_0x548229,_0x1680f6,_0x1e8930)['then'](function(_0x32f9e1){return _0x32f9e1;})[_0xd849('0x52')](function(_0x594deb){throw _0x594deb;});})['catch'](function(_0x12658d){ut[_0xd849('0x33')]('[Preview][checkIsBlackList]',_0x12658d);throw ut[_0xd849('0x30')](_0xd849('0x111'),_0x1680f6,_0x1e8930);});}else{throw ut['message'](_0x5c5578[_0xd849('0x30')],_0x1680f6,_0x1e8930);}})[_0xd849('0x52')](function(_0x455a45){ut[_0xd849('0x33')](_0xd849('0x112'),_0x455a45);throw ut[_0xd849('0x30')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xd849('0x39')][_0xd849('0x10e')]=function(_0x2c0301){if(_[_0xd849('0x46')](_0x2c0301)||_[_0xd849('0xf9')](_0x2c0301)||!_[_0xd849('0x46')](_0x2c0301[0x0][_0xd849('0x5f')])&&_[_0xd849('0x46')](_0x2c0301[0x0][_0xd849('0x5f')][_0xd849('0x29')])){ut[_0xd849('0x33')](_0xd849('0x113'),_0x2c0301);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x59aab3=this['campaignsPreview'][_0x2c0301[0x0]['Queue'][_0xd849('0x29')]];_0x59aab3['message']=utils[_0xd849('0x31')][_0xd849('0x7a')];if(_[_0xd849('0x46')](_0x59aab3)){ut[_0xd849('0x33')](_0xd849('0x114'),_0x59aab3);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xd849('0x76')](_0x59aab3[_0xd849('0x77')])){ut[_0xd849('0x33')](_0xd849('0x115'),_0xd849('0x116')+_0x59aab3['name']+_0xd849('0x117'));if(!this[_0xd849('0x76')](_0x59aab3[_0xd849('0x78')])){ut[_0xd849('0x33')](_0xd849('0x115'),_0x59aab3[_0xd849('0x29')]+_0xd849('0x118'));return{'isValid':![],'message':_0xd849('0x119')};}}if(!ut[_0xd849('0x75')](_0x59aab3[_0xd849('0x40')])){ut['logger'](_0xd849('0x11a'),_0x59aab3['name']+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x59aab3[_0xd849('0x29')]+_0xd849('0x11b')};}return{'isValid':!![],'message':_0xd849('0x11c')};};Preview[_0xd849('0x39')]['execCall']=function(_0x4cdc39,_0x283be9,_0x291a0a,_0x121cbf){var _0x43bb23=this;return new Promise(function(_0x174ac2,_0x53e101){var _0x29268b=_0x4cdc39['uniqueid'];var _0x283a41=_0x43bb23[_0xd849('0x76')](_0x283be9[_0xd849('0x77')])?util[_0xd849('0x65')](_0xd849('0x11d'),_0x283be9[_0xd849('0x77')][_0xd849('0x29')],_[_0xd849('0x46')](_0x283be9['dialPrefix'])?'':_0x283be9['dialPrefix'][_0xd849('0x11e')]()||'',_0x283be9['dialCutDigit']>0x0?_0x291a0a[_0xd849('0xf5')]['substring'](_0x283be9[_0xd849('0x11f')]):_0x291a0a[_0xd849('0xf5')]):util[_0xd849('0x65')](_0xd849('0x11d'),_['isNil'](_0x283be9['TrunkBackup'])?_0x283be9[_0xd849('0x77')][_0xd849('0x29')]:_0x283be9[_0xd849('0x78')]['name'],_['isNil'](_0x283be9[_0xd849('0x120')])?'':_0x283be9[_0xd849('0x120')][_0xd849('0x11e')]()||'',_0x283be9[_0xd849('0x11f')]>0x0?_0x291a0a[_0xd849('0xf5')][_0xd849('0x121')](_0x283be9[_0xd849('0x11f')]):_0x291a0a[_0xd849('0xf5')]);var _0x4e445f=_0x43bb23[_0xd849('0x76')](_0x283be9[_0xd849('0x77')])?ut[_0xd849('0x122')](_0x283be9['Trunk'][_0xd849('0x123')],_0x283be9[_0xd849('0x124')],_0x283be9[_0xd849('0x125')]>0x0?ut[_0xd849('0x126')](_0x283be9['dialOriginateCallerIdNumber'],_0x283be9[_0xd849('0x125')]):_0x283be9['dialOriginateCallerIdNumber']):ut[_0xd849('0x122')](_[_0xd849('0x46')](_0x283be9['TrunkBackup'])?_0x283be9[_0xd849('0x77')][_0xd849('0x123')]:_0x283be9[_0xd849('0x78')][_0xd849('0x123')],_0x283be9[_0xd849('0x124')],_0x283be9[_0xd849('0x125')]>0x0?ut['getCallerIdRandom'](_0x283be9[_0xd849('0x127')],_0x283be9[_0xd849('0x125')]):_0x283be9[_0xd849('0x127')]);if(_0x4e445f){_0x4cdc39['originatecalleridname']=ut[_0xd849('0x128')](_0x4e445f);_0x4cdc39[_0xd849('0x129')]=ut['extractCalleridNumber'](_0x4e445f);}var _0xd2a48=ut['addVariables'](_0x283be9,_0x291a0a,_0x283a41,_0x4e445f,_0x29268b,_0x4cdc39);var _0x281b9d=utils['setXMDContactVariables'](_0x291a0a[_0xd849('0xf4')]);Object[_0xd849('0x12a')](_0xd2a48,_0x281b9d);_[_0xd849('0x12b')](_0x4cdc39,ut[_0xd849('0x12c')](_0xd2a48));_0x4cdc39['starttime']=moment()[_0xd849('0x65')](_0xd849('0x66'));_0x283be9[_0xd849('0x12d')]=_0xd2a48;var _0x8fdb46=ut[_0xd849('0x12e')](_0x4cdc39,_0x283be9,_0xd2a48,_0x4cdc39[_0xd849('0x8b')],_0x121cbf);return ami[_0xd849('0x50')](_0x8fdb46)[_0xd849('0x5b')](function(_0x5cfb95){_0x283be9[_0xd849('0x49')]+=0x1;logger[_0xd849('0x26')](_0xd849('0x12f'),_0x29268b,_0xd849('0x91'),_0x283be9['name'],_0xd849('0xee'),_0x283be9[_0xd849('0x49')]);_0x174ac2(_0x5cfb95);})[_0xd849('0x52')](function(_0x3105a8){ut[_0xd849('0xe5')](_0x4cdc39,0xe,_0xd849('0x130'));rpcDb[_0xd849('0xe6')](_0x4cdc39,_0xd849('0x131'));_0x53e101(_0x3105a8);});});};Preview[_0xd849('0x39')][_0xd849('0x1f')]=function(_0x3794c5){if(this[_0xd849('0x13')][_0x3794c5[_0xd849('0xa2')]]){this[_0xd849('0x13')][_0x3794c5[_0xd849('0xa2')]][_0xd849('0x51')]=_0x3794c5[_0xd849('0x51')];}};Preview[_0xd849('0x39')][_0xd849('0x17')]=function(_0x169e85){var _0x51297c=this;var _0x42aa4c=this[_0xd849('0x13')][_0x169e85[_0xd849('0x132')]];if(_0x42aa4c){if(_0x42aa4c[_0xd849('0xf8')]&&this[_0xd849('0x14')][_0x42aa4c[_0xd849('0xf8')]]){ut['logLookAgent'](_0x42aa4c,this[_0xd849('0x14')][_0x42aa4c[_0xd849('0xf8')]]['name'],this[_0xd849('0x14')][_0x42aa4c[_0xd849('0xf8')]]['id']);}var _0x85790e=_['clone'](_0x42aa4c);_0x85790e['responsetime']=moment()[_0xd849('0x65')](_0xd849('0x66'));var _0x3d4f3b=_0x51297c['campaignsPreview'][_0x42aa4c[_0xd849('0x48')]];if(ut[_0xd849('0x133')](_0x169e85[_0xd849('0x134')])){if(_0x42aa4c[_0xd849('0xaf')]){rpcDb['unlockContact'](_0x42aa4c[_0xd849('0x8c')]);}if(_0x42aa4c[_0xd849('0x8b')]){rpcDb[_0xd849('0x64')](_0x42aa4c[_0xd849('0x8c')]);}ami['emit'](_0xd849('0x135'),ut[_0xd849('0x81')](_0x42aa4c,_0xd849('0x136'),this[_0xd849('0x11')][_0x42aa4c['queue']]));this[_0xd849('0xe1')](_0x85790e,_0x3d4f3b,_0x169e85);}else{_0x42aa4c[_0xd849('0x137')]=moment()['format'](_0xd849('0x66'));ut[_0xd849('0xe5')](_0x85790e,0x4,_0xd849('0x9b'));rpcDb[_0xd849('0xe6')](_0x85790e,_0xd849('0x138'));}}};Preview[_0xd849('0x39')][_0xd849('0x19')]=function(_0xae3f16){var _0x271056=this['actions'][_0xae3f16[_0xd849('0xa2')]];var _0x5275b1;if(_0x271056){_0x5275b1=this[_0xd849('0x11')][_0x271056[_0xd849('0x48')]];logger[_0xd849('0x26')](_0xd849('0x139'),_0xae3f16[_0xd849('0xa2')],_0xd849('0x91'),_0x5275b1['name'],_0xd849('0x4a'),_0x5275b1['pTalking']);}if(this[_0xd849('0x13')][_0xae3f16[_0xd849('0xa2')]]&&_0xae3f16[_0xd849('0xa2')]!==_0xae3f16[_0xd849('0xa1')]){if(_0xae3f16[_0xd849('0x13a')]==='16'&&this[_0xd849('0x13')][_0xae3f16['linkedid']][_0xd849('0x4b')]){this[_0xd849('0x7b')](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}else if(this[_0xd849('0x13')][_0xae3f16[_0xd849('0xa2')]]['dialAnswer']){logger[_0xd849('0x26')](_0xd849('0x13b'),_0xae3f16[_0xd849('0xa2')],_0xae3f16['cause'],_0xd849('0x91'),_0x5275b1['name'],_0xd849('0x4a'),_0x5275b1[_0xd849('0x2d')]);this[_0xd849('0x7b')](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}}else if(_0x271056&&_[_0xd849('0x46')](_0x271056[_0xd849('0x13c')])&&_0x5275b1[_0xd849('0x13d')]&&_0xae3f16[_0xd849('0xa2')]===_0xae3f16[_0xd849('0xa1')]&&_['isNil'](_0xae3f16[_0xd849('0xe4')])&&_0xae3f16[_0xd849('0x13a')]==='16'&&_0xae3f16[_0xd849('0x13e')]==='6'&&_[_0xd849('0xe2')](_0x271056[_0xd849('0x13f')])){if(_0x271056[_0xd849('0xaf')]){rpcDb['unlockContact'](_0x271056['idContact']);}if(_0x271056[_0xd849('0x8b')]){rpcDb[_0xd849('0x64')](_0x271056[_0xd849('0x8c')]);}_0xae3f16[_0xd849('0xe4')]='22';this['callProgressDetectingAgent'](_0x271056,_0x5275b1,_0xae3f16);}else if(_0x271056&&_0x271056[_0xd849('0x13f')]){if(_0xae3f16[_0xd849('0x13a')]==='16'&&this['actions'][_0xae3f16[_0xd849('0xa2')]][_0xd849('0x4b')]){logger['info'](_0xd849('0x140'),_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')],_0xd849('0x91'),_0x5275b1['name'],_0xd849('0x4a'),_0x5275b1[_0xd849('0x2d')]);this['callProgressDetectingCustomer'](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}else if(this[_0xd849('0x13')][_0xae3f16[_0xd849('0xa2')]][_0xd849('0x4b')]){logger[_0xd849('0x26')](_0xd849('0x13b'),_0xae3f16['linkedid'],_0xae3f16[_0xd849('0x13a')],_0xd849('0x91'),_0x5275b1[_0xd849('0x29')],_0xd849('0x4a'),_0x5275b1[_0xd849('0x2d')]);this['callProgressDetectingCustomer'](_0xae3f16,_0xae3f16[_0xd849('0xa2')],_0xae3f16[_0xd849('0x13a')]);}}};Preview['prototype'][_0xd849('0x1d')]=function(_0xbc1c9d){if(this[_0xd849('0x13')][_0xbc1c9d[_0xd849('0xdf')]]&&_0xbc1c9d[_0xd849('0xdf')]!==_0xbc1c9d['destuniqueid']){this[_0xd849('0x7b')](_0xbc1c9d,_0xbc1c9d[_0xd849('0xdf')],_0xbc1c9d[_0xd849('0xd6')]);}};Preview[_0xd849('0x39')][_0xd849('0x1b')]=function(_0x41810d){if(this['actions'][_0x41810d[_0xd849('0xa2')]]&&_0x41810d[_0xd849('0xa2')]!==_0x41810d[_0xd849('0xa1')]&&!this[_0xd849('0x13')][_0x41810d['linkedid']]['dialAnswer']){if(_0x41810d[_0xd849('0x13a')]==='1'){this[_0xd849('0x7b')](_0x41810d,_0x41810d['linkedid'],_0x41810d[_0xd849('0x13a')]);}}};Preview['prototype'][_0xd849('0x141')]=function(_0x20611c,_0x488196,_0x17bb96){if(this[_0xd849('0x13')][_0x20611c]){if(_[_0xd849('0x46')](this['actions'][_0x20611c][_0xd849('0x12d')])){this[_0xd849('0x13')][_0x20611c][_0xd849('0x12d')]={};}this[_0xd849('0x13')][_0x20611c][_0xd849('0x12d')][_0x488196]=_0x17bb96;}};Preview['prototype'][_0xd849('0x21')]=function(_0x1572de){try{if(!_[_0xd849('0x46')](_0x1572de)){if(ut[_0xd849('0x142')](_['keys'](_0x1572de[_0xd849('0x143')])[0x0])){this[_0xd849('0x141')](_0x1572de[_0xd849('0xa1')],_[_0xd849('0x144')](_0x1572de[_0xd849('0x143')])[0x0],_0x1572de[_0xd849('0x145')]);}}}catch(_0x3c9680){logger[_0xd849('0x146')]('[syncVarSet][Preview]',util[_0xd849('0x147')](_0x3c9680,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xd849('0x23')]=function(_0x258448){if(_0x258448){if(this[_0xd849('0x13')][_0x258448['transfertargetlinkedid']]){this[_0xd849('0x13')][_0x258448[_0xd849('0x148')]][_0xd849('0x13f')]=!![];}}};Preview[_0xd849('0x39')]['syncBlindTransfer']=function(_0x200957){if(_0x200957){if(this[_0xd849('0x13')][_0x200957[_0xd849('0x149')]]){this[_0xd849('0x13')][_0x200957[_0xd849('0x149')]][_0xd849('0x13f')]=!![];}}};module[_0xd849('0x14a')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 34e7f0e..ce802a9 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 _0xf9f4=['checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','holdtime','assigned','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0xf9f4,0x173));var _0x4f9f=function(_0x4e7473,_0x33f381){_0x4e7473=_0x4e7473-0x0;var _0x5a155b=_0xf9f4[_0x4e7473];return _0x5a155b;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x4f9f('0x0'))('preview');var cmHopper=require(_0x4f9f('0x1'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x4f9f('0x2'));var agentReportPreview=require(_0x4f9f('0x3'));var voiceQueueReport=require(_0x4f9f('0x4'));function loggerCatch(_0x2bba94){return function(_0x325856){logger[_0x4f9f('0x5')](_0x2bba94,util[_0x4f9f('0x6')](_0x325856,{'showHidden':![],'depth':null}));};}function create(_0x4f21a4){return cmHopperHistory[_0x4f9f('0x7')](_0x4f21a4)[_0x4f9f('0x8')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x39ea07){return BPromise[_0x4f9f('0x9')]()[_0x4f9f('0xa')](agentReportPreview[_0x4f9f('0x7')](_0x39ea07))[_0x4f9f('0x8')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x52e76c){return cmHopper[_0x4f9f('0xb')](_0x52e76c,!![])['catch'](loggerCatch(_0x4f9f('0xc')));}exports['checkIsBlackList']=function(_0x2f3b5a){return cmHopperBlack[_0x4f9f('0xd')](_0x2f3b5a)[_0x4f9f('0x8')](loggerCatch(_0x4f9f('0xe')));};exports[_0x4f9f('0xf')]=function(_0x35a3c5){return BPromise[_0x4f9f('0x9')]()['then'](cmHopper[_0x4f9f('0xf')](_0x35a3c5))[_0x4f9f('0x8')](loggerCatch(_0x4f9f('0x10')));};exports['createHistory']=function(_0x2d0c3c,_0x19b7b6){create(_0x2d0c3c)[_0x4f9f('0x8')](loggerCatch(_0x19b7b6));moveContact(_0x2d0c3c)['catch'](loggerCatch(_0x19b7b6));};exports[_0x4f9f('0x11')]=function(_0x4ad03e,_0x357e94){createAgent(_0x4ad03e)['catch'](loggerCatch(_0x357e94));};exports['createCustomerHistory']=function(_0x20d2d7,_0x481277){create(_0x20d2d7)[_0x4f9f('0x8')](loggerCatch(_0x481277));};exports[_0x4f9f('0x12')]=function(_0x300344,_0x2b0d0b){moveContact(_0x300344)['catch'](loggerCatch(_0x2b0d0b));};exports[_0x4f9f('0x13')]=function(_0x544958,_0xeb23da,_0x1b8d62){if(_0xeb23da){_0x544958['UserId']=null;}if(_0x1b8d62){_0x544958['active']=![];}return cmHopper[_0x4f9f('0x13')](_0x544958)[_0x4f9f('0x8')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x4f9f('0x14')]=function(_0x1ba25e){return cmHopper[_0x4f9f('0x14')](_0x1ba25e)[_0x4f9f('0x8')](loggerCatch(_0x4f9f('0x15')));};exports[_0x4f9f('0x16')]=function(_0x38578c){return cmHopper['unlockContact']({'UserId':null},_0x38578c,0x1)[_0x4f9f('0x8')](loggerCatch(_0x4f9f('0x17')));};exports['disableContact']=function(_0x330a40){return cmHopper[_0x4f9f('0x16')]({'active':![]},_0x330a40,0x1)[_0x4f9f('0x8')](loggerCatch(_0x4f9f('0x18')));};exports[_0x4f9f('0x19')]=function(_0x130aa9){var _0x22b552={};_0x22b552[_0x4f9f('0x1a')]=_0x130aa9[_0x4f9f('0x1a')];_0x22b552[_0x4f9f('0x1b')]=_0x130aa9[_0x4f9f('0x1b')];_0x22b552['calleridnum']=_0x130aa9[_0x4f9f('0x1c')];_0x22b552[_0x4f9f('0x1d')]=_0x130aa9['calleridname'];_0x22b552[_0x4f9f('0x1e')]=_0x130aa9[_0x4f9f('0x1e')];_0x22b552[_0x4f9f('0x1f')]=_0x130aa9[_0x4f9f('0x20')];_0x22b552[_0x4f9f('0x21')]=_0x130aa9['answertime'];_0x22b552[_0x4f9f('0x22')]=0x1;_0x22b552[_0x4f9f('0x23')]=_0x130aa9[_0x4f9f('0x24')];_0x22b552[_0x4f9f('0x25')]=_0x130aa9[_0x4f9f('0x26')];_0x22b552['context']=_0x4f9f('0x27');_0x22b552[_0x4f9f('0x28')]='xcally-motion-preview';_0x22b552[_0x4f9f('0x29')]=0x0;_0x22b552[_0x4f9f('0x2a')]=0x1;_0x22b552['lastAssignedTo']=_0x130aa9['membername'];_0x22b552[_0x4f9f('0x2b')]='COMPLETED';return BPromise[_0x4f9f('0x9')]()['then'](voiceQueueReport[_0x4f9f('0x2c')](_0x22b552))[_0x4f9f('0x8')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x4f9f('0x2d')]=function(_0x1b367a,_0x2cbe70){return BPromise['resolve']()[_0x4f9f('0xa')](cmHopper[_0x4f9f('0x2d')](_0x1b367a,_0x2cbe70))['catch'](loggerCatch(_0x4f9f('0x2e')));};exports[_0x4f9f('0x2f')]=function(_0x208d0a){return cmHopper[_0x4f9f('0x13')](_0x208d0a,!![],!![])[_0x4f9f('0x8')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x4e07=['queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','context','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','active','rescheduleContact','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x4e07,0x18d));var _0x74e0=function(_0x2d82e0,_0x4071cd){_0x2d82e0=_0x2d82e0-0x0;var _0x4d6568=_0x4e07[_0x2d82e0];return _0x4d6568;};'use strict';var util=require(_0x74e0('0x0'));var BPromise=require(_0x74e0('0x1'));var logger=require(_0x74e0('0x2'))(_0x74e0('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x74e0('0x4'));var cmHopperBlack=require(_0x74e0('0x5'));var agentReportPreview=require(_0x74e0('0x6'));var voiceQueueReport=require(_0x74e0('0x7'));function loggerCatch(_0xb9df4b){return function(_0x517384){logger[_0x74e0('0x8')](_0xb9df4b,util[_0x74e0('0x9')](_0x517384,{'showHidden':![],'depth':null}));};}function create(_0x2f82fd){return cmHopperHistory['createHistory'](_0x2f82fd)[_0x74e0('0xa')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x13ee5b){return BPromise[_0x74e0('0xb')]()[_0x74e0('0xc')](agentReportPreview[_0x74e0('0xd')](_0x13ee5b))[_0x74e0('0xa')](loggerCatch(_0x74e0('0xe')));}function moveContact(_0x521fb2){return cmHopper[_0x74e0('0xf')](_0x521fb2,!![])[_0x74e0('0xa')](loggerCatch(_0x74e0('0x10')));}exports[_0x74e0('0x11')]=function(_0x485b93){return cmHopperBlack[_0x74e0('0x11')](_0x485b93)[_0x74e0('0xa')](loggerCatch(_0x74e0('0x12')));};exports[_0x74e0('0x13')]=function(_0x2ad5f7){return BPromise[_0x74e0('0xb')]()[_0x74e0('0xc')](cmHopper[_0x74e0('0x13')](_0x2ad5f7))['catch'](loggerCatch(_0x74e0('0x14')));};exports['createHistory']=function(_0x219bc4,_0x18fc75){create(_0x219bc4)['catch'](loggerCatch(_0x18fc75));moveContact(_0x219bc4)['catch'](loggerCatch(_0x18fc75));};exports[_0x74e0('0x15')]=function(_0x471b7e,_0x1384ef){createAgent(_0x471b7e)[_0x74e0('0xa')](loggerCatch(_0x1384ef));};exports[_0x74e0('0x16')]=function(_0x5154b1,_0x591f54){create(_0x5154b1)[_0x74e0('0xa')](loggerCatch(_0x591f54));};exports['createCustomerFinal']=function(_0x2fba0a,_0x22e1e3){moveContact(_0x2fba0a)['catch'](loggerCatch(_0x22e1e3));};exports['rescheduleContact']=function(_0x2926ab,_0x40654a,_0x3150a7){if(_0x40654a){_0x2926ab['UserId']=null;}if(_0x3150a7){_0x2926ab[_0x74e0('0x17')]=![];}return cmHopper[_0x74e0('0x18')](_0x2926ab)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x74e0('0x19')]=function(_0x3e5233){return cmHopper['countReScheduled'](_0x3e5233)[_0x74e0('0xa')](loggerCatch('[countReScheduled]\x20'));};exports[_0x74e0('0x1a')]=function(_0x27c82b){return cmHopper[_0x74e0('0x1a')]({'UserId':null},_0x27c82b,0x1)[_0x74e0('0xa')](loggerCatch(_0x74e0('0x1b')));};exports['disableContact']=function(_0x569f45){return cmHopper[_0x74e0('0x1a')]({'active':![]},_0x569f45,0x1)[_0x74e0('0xa')](loggerCatch(_0x74e0('0x1c')));};exports[_0x74e0('0x1d')]=function(_0x1bf64c){var _0x5e0498={};_0x5e0498[_0x74e0('0x1e')]=_0x1bf64c['type'];_0x5e0498[_0x74e0('0x1f')]=_0x1bf64c['uniqueid'];_0x5e0498['calleridnum']=_0x1bf64c[_0x74e0('0x20')];_0x5e0498[_0x74e0('0x21')]=_0x1bf64c[_0x74e0('0x21')];_0x5e0498[_0x74e0('0x22')]=_0x1bf64c[_0x74e0('0x22')];_0x5e0498[_0x74e0('0x23')]=_0x1bf64c[_0x74e0('0x24')];_0x5e0498[_0x74e0('0x25')]=_0x1bf64c['answertime'];_0x5e0498[_0x74e0('0x26')]=0x1;_0x5e0498['queuecallercompleteAt']=_0x1bf64c[_0x74e0('0x27')];_0x5e0498['connectedlinename']=_0x1bf64c['membername'];_0x5e0498[_0x74e0('0x28')]=_0x74e0('0x29');_0x5e0498[_0x74e0('0x2a')]='xcally-motion-preview';_0x5e0498[_0x74e0('0x2b')]=0x0;_0x5e0498[_0x74e0('0x2c')]=0x1;_0x5e0498[_0x74e0('0x2d')]=_0x1bf64c[_0x74e0('0x2e')];_0x5e0498[_0x74e0('0x2f')]=_0x74e0('0x30');return BPromise[_0x74e0('0xb')]()[_0x74e0('0xc')](voiceQueueReport[_0x74e0('0x31')](_0x5e0498))[_0x74e0('0xa')](loggerCatch(_0x74e0('0x32')));};exports[_0x74e0('0x33')]=function(_0x14ca9c,_0x12f5bb){return BPromise[_0x74e0('0xb')]()['then'](cmHopper[_0x74e0('0x33')](_0x14ca9c,_0x12f5bb))['catch'](loggerCatch(_0x74e0('0x34')));};exports[_0x74e0('0x35')]=function(_0x1fd740){return cmHopper[_0x74e0('0x18')](_0x1fd740,!![],!![])[_0x74e0('0xa')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 45efc5f..826a211 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 _0xc7b7=['xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','extractCalleridNumber','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','preview','env','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','toLower','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','logAgent','state','statedesc','responsetime','ringtime','starttime','UserId','endtime','getSeconds','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','add','minutes','ContactId','ListId','decrementTalkink','IsNotLoggedIn','lastevent','motionChannel','mandatoryDisposition','buildObj','buildAcw','queue','interface','not_inuse','status','push','getDiff','milliseconds','diff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','membername','calleridname','scheduledat','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-callerid'];(function(_0x167ecb,_0xa9299){var _0x1148c7=function(_0x13c445){while(--_0x13c445){_0x167ecb['push'](_0x167ecb['shift']());}};_0x1148c7(++_0xa9299);}(_0xc7b7,0xa3));var _0x7c7b=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xc7b7[_0x29e35f];return _0x266b74;};'use strict';var util=require(_0x7c7b('0x0'));var _=require('lodash');var moment=require(_0x7c7b('0x1'));var logger=require('../../../../config/logger')(_0x7c7b('0x2'));var ipAgi=process[_0x7c7b('0x3')][_0x7c7b('0x4')]||'127.0.0.1';var utils=require(_0x7c7b('0x5'));exports[_0x7c7b('0x6')]=function(_0x5a5b85){return function(_0x13159e){logger[_0x7c7b('0x7')](_0x5a5b85,util[_0x7c7b('0x8')](_0x13159e,{'showHidden':![],'depth':null}));};};exports[_0x7c7b('0x9')]=function(_0x12bb1c,_0x1afdde){logger[_0x7c7b('0xa')](_0x12bb1c,util[_0x7c7b('0x8')](_0x1afdde,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x259232,_0x14daf5){logger[_0x7c7b('0x7')](_0x259232,util[_0x7c7b('0x8')](_0x14daf5,{'showHidden':![],'depth':null}));};exports[_0x7c7b('0xb')]=function(_0x33a703){return function(_0x53136b){logger['info'](_0x33a703,util['inspect'](_0x53136b,{'showHidden':![],'depth':null}));};};exports[_0x7c7b('0xc')]=function(_0x2cc4b5,_0x5ed3fa,_0x2677f3){return{'message':_0x2cc4b5,'unlock':_0x5ed3fa,'active':_0x2677f3};};exports[_0x7c7b('0xd')]=function(_0x58c6c3,_0x218ece,_0x1bbfe4){if(!_['isUndefined'](_0x1bbfe4)&&_0x7c7b('0xe')===typeof _0x1bbfe4&&!_[_0x7c7b('0xf')](_0x1bbfe4)){if(!_[_0x7c7b('0x10')](_0x218ece)&&'string'===typeof _0x218ece&&!_[_0x7c7b('0xf')](_0x218ece)){return util[_0x7c7b('0x11')](_0x7c7b('0x12'),_0x218ece,_0x1bbfe4);}return util['format'](_0x7c7b('0x12'),_0x1bbfe4,_0x1bbfe4);}if(!_['isUndefined'](_0x58c6c3)&&_0x7c7b('0xe')===typeof _0x58c6c3&&!_[_0x7c7b('0xf')](_0x58c6c3)){return _0x58c6c3;}return _0x7c7b('0x13');};exports[_0x7c7b('0x14')]=function(_0x2f4494){if(_[_0x7c7b('0x15')](_0x2f4494)){return![];}return _0x2f4494;};exports[_0x7c7b('0x16')]=function(_0x54a7a2,_0x39942a,_0x18abcc,_0x525b43,_0x1afbde,_0x361c66){var _0x65ac09={'XMD-QUEUE':_0x39942a['Queue']?_0x39942a[_0x7c7b('0x17')][_0x7c7b('0x18')]:'','XMD-CALLERID':_0x525b43,'XMD-CALLERID-PREVIEW':_0x361c66?util[_0x7c7b('0x11')](_0x7c7b('0x12'),_0x361c66['calleridname'],_0x361c66[_0x7c7b('0x19')]):_0x525b43,'XMD-DIALID':_0x1afbde,'XMD-CONTACTID':_0x39942a['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x525b43,'XMD-VOICEQUEUEID':_0x39942a[_0x7c7b('0x1a')],'XMD-DIALCHANNEL':_0x18abcc,'XMD-DIALTIMEOUT':_0x54a7a2[_0x7c7b('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x7c7b('0x11')](_0x7c7b('0x1c'),_0x54a7a2[_0x7c7b('0x1d')]?'g':'',_[_0x7c7b('0xf')](_0x54a7a2[_0x7c7b('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x54a7a2[_0x7c7b('0x1f')]||'','XMD-AGI':_0x54a7a2[_0x7c7b('0x20')]?util['format'](_0x7c7b('0x21'),ipAgi,_0x54a7a2[_0x7c7b('0x20')]):_0x7c7b('0x22'),'XMD-AGIAFTER':_0x54a7a2[_0x7c7b('0x1d')]?util[_0x7c7b('0x11')](_0x7c7b('0x21'),ipAgi,_0x54a7a2['dialQueueProject2']):_0x7c7b('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x361c66?_0x361c66[_0x7c7b('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x361c66?_0x361c66[_0x7c7b('0x24')]:'','XMD-DESTINATION':_0x7c7b('0x25'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x7c7b('0xf')](_0x54a7a2[_0x7c7b('0x1e')])){_0x65ac09[util[_0x7c7b('0x11')]('%s',_0x7c7b('0x26'))]=_0x54a7a2[_0x7c7b('0x1e')];_0x65ac09[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1afbde;}return _0x65ac09;};exports[_0x7c7b('0x27')]=function(_0x24e954){var _0x2c9b98={};for(var _0x562b51 in _0x24e954){if(_0x24e954['hasOwnProperty'](_0x562b51)){_0x2c9b98[util[_0x7c7b('0x11')]('%s',_[_0x7c7b('0x28')](_0x562b51))]=_0x24e954[_0x562b51];}}return{'variables':_0x2c9b98};};exports['updateOriginated']=function(_0x23917d,_0x2b72c3){if(!_['isNil'](_0x23917d)){if(_0x23917d[_0x7c7b('0x29')](_0x7c7b('0x2a'))){if(_0x23917d[_0x7c7b('0x2a')]>0x0){_0x23917d['originated']-=0x1;}else{logger[_0x7c7b('0x7')](_0x7c7b('0x2b'),_0x2b72c3);}}}else{logger['error'](_0x7c7b('0x2c'),_0x2b72c3);}};exports[_0x7c7b('0x2d')]=function(_0x223cf2){var _0x4a2254=moment()['format'](_0x7c7b('0x2e'));_0x223cf2['state']=0xd;_0x223cf2['statedesc']=_0x7c7b('0x2f');_0x223cf2['starttime']=_0x4a2254;_0x223cf2['responsetime']=_0x4a2254;_0x223cf2['endtime']=_0x4a2254;};exports[_0x7c7b('0x30')]=function(_0x196b27,_0x44ace4,_0x1546f2){var _0x48a908=moment()['format'](_0x7c7b('0x2e'));_0x196b27[_0x7c7b('0x31')]=_0x44ace4;_0x196b27[_0x7c7b('0x32')]=_0x1546f2;_0x196b27[_0x7c7b('0x33')]=_0x48a908;_0x196b27[_0x7c7b('0x34')]=utils['getSeconds'](_0x196b27[_0x7c7b('0x33')],_0x196b27[_0x7c7b('0x35')]);};exports['logLookAgent']=function(_0x2f690f,_0x1b8f73,_0xfaacd1){_0x2f690f['membername']=_0x1b8f73;_0x2f690f[_0x7c7b('0x36')]=_0xfaacd1;};exports['logCustomer']=function(_0x108d37,_0x987698,_0x27ca5a){var _0x3e9b9e=moment()[_0x7c7b('0x11')](_0x7c7b('0x2e'));_0x108d37[_0x7c7b('0x31')]=_0x987698;_0x108d37[_0x7c7b('0x32')]=_0x27ca5a;_0x108d37['responsetime']=_0x108d37[_0x7c7b('0x33')]?_0x108d37['responsetime']:_0x3e9b9e;_0x108d37[_0x7c7b('0x37')]=_0x108d37['endtime']?_0x108d37['endtime']:_0x3e9b9e;_0x108d37['ringtime']=utils[_0x7c7b('0x38')](_0x108d37[_0x7c7b('0x33')]||0x0,_0x108d37[_0x7c7b('0x35')]||0x0);_0x108d37['talktime']=_0x108d37[_0x7c7b('0x39')]?utils[_0x7c7b('0x38')](_0x108d37[_0x7c7b('0x37')],_0x108d37[_0x7c7b('0x39')]):0x0;};exports[_0x7c7b('0x3a')]=function(_0x7e2252){return _0x7e2252===_0x7c7b('0x3b');};exports[_0x7c7b('0x3c')]=function(_0x362d2f,_0x1db314,_0x1059dc,_0x261ef1,_0x581bba){var _0xcbb87a=_0x261ef1?'RECALL':_0x362d2f['calleridname'];_0xcbb87a=_0x581bba?_0x7c7b('0x3d'):_0xcbb87a;return{'actionid':_0x362d2f[_0x7c7b('0x3e')],'action':'originate','channel':_0x362d2f[_0x7c7b('0x3f')],'callerid':util['format'](_0x7c7b('0x12'),_0xcbb87a,_0x362d2f[_0x7c7b('0x19')]),'Exten':'xcally-motion-preview','Context':_0x7c7b('0x40'),'Priority':'1','variable':_0x1059dc,'timeout':(_0x1db314[_0x7c7b('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x362d2f[_0x7c7b('0x3e')]};};exports[_0x7c7b('0x42')]=function(_0x11b661){return _0x11b661['countbusyretry']+_0x11b661[_0x7c7b('0x43')]+_0x11b661[_0x7c7b('0x44')]+_0x11b661[_0x7c7b('0x45')]+_0x11b661[_0x7c7b('0x46')];};exports[_0x7c7b('0x47')]=function(_0x24b38c){var _0x3d9d5c=_['clone'](_0x24b38c);_0x3d9d5c['state']=0xf;_0x3d9d5c[_0x7c7b('0x32')]=_0x7c7b('0x48');return _0x3d9d5c;};exports[_0x7c7b('0x49')]=function(_0x6a2471,_0xb2ca3,_0x1af013){var _0x4d84b1={};_0x4d84b1[_0xb2ca3]=_0x6a2471[_0xb2ca3];_0x4d84b1[_0x7c7b('0x4a')]=![];_0x4d84b1['scheduledat']=moment()[_0x7c7b('0x4b')](_0x1af013,_0x7c7b('0x4c'))[_0x7c7b('0x11')](_0x7c7b('0x2e'));_0x4d84b1[_0x7c7b('0x4d')]=_0x6a2471['ContactId'];_0x4d84b1[_0x7c7b('0x4e')]=_0x6a2471['ListId'];_0x4d84b1[_0x7c7b('0x1a')]=_0x6a2471[_0x7c7b('0x1a')]||undefined;return _0x4d84b1;};exports[_0x7c7b('0x4f')]=function(_0xacc56c,_0x13041e){if(!_[_0x7c7b('0x15')](_0xacc56c)){if(_0xacc56c['pTalking']>0x0){_0xacc56c['pTalking']-=0x1;}else{logger[_0x7c7b('0x7')](_0x13041e,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x7c7b('0x7')](_0x13041e,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x7c7b('0x50')]=function(_0x2e38d1){if(_0x2e38d1<=0x0){return!![];}return![];};function buildObj(_0x285acc,_0x2a5212,_0x4b561f){_0x285acc[_0x7c7b('0x51')]=_0x2a5212;_0x285acc[_0x7c7b('0x18')]=_0x285acc['queue'];_0x285acc['interface']=_0x285acc[_0x7c7b('0x3f')];_0x285acc[_0x7c7b('0x52')]='voice';if(_0x4b561f){_0x285acc[_0x7c7b('0x53')]=_0x4b561f['mandatoryDisposition'];}return _0x285acc;}exports[_0x7c7b('0x54')]=buildObj;exports[_0x7c7b('0x55')]=function(_0x9ec362){var _0x3e57c4={};_0x3e57c4['queue']=_0x9ec362[_0x7c7b('0x56')];_0x3e57c4[_0x7c7b('0x57')]=_0x9ec362[_0x7c7b('0x3f')];_0x3e57c4[_0x7c7b('0x3e')]=_0x9ec362[_0x7c7b('0x3e')];return _0x3e57c4;};exports['agentReadyId']=function(_0x5c2ad4){var _0x3e8a6b=[];for(var _0xc47ef0 in _0x5c2ad4){if(_0x5c2ad4['hasOwnProperty'](_0xc47ef0)){if(!_[_0x7c7b('0x15')](_0x5c2ad4[_0xc47ef0])&&_0x5c2ad4[_0xc47ef0]['state']===_0x7c7b('0x58')&&_0x5c2ad4[_0xc47ef0][_0x7c7b('0x59')]==='reachable'){_0x3e8a6b[_0x7c7b('0x5a')](_0x5c2ad4[_0xc47ef0]['id']);}}}return _0x3e8a6b;};exports[_0x7c7b('0x5b')]=function(_0x2252fb){var _0x37318e=moment()[_0x7c7b('0x5c')](0x0);var _0x260bf6=moment(_0x2252fb)[_0x7c7b('0x5c')](0x0);return _0x37318e[_0x7c7b('0x5d')](_0x260bf6,'seconds');};exports[_0x7c7b('0x5e')]=function(_0x1171e2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1171e2[_0x7c7b('0x4d')],'ListId':_0x1171e2[_0x7c7b('0x4e')],'VoiceQueueId':_0x1171e2[_0x7c7b('0x1a')]||undefined,'CampaignId':_0x1171e2['CampaignId']||undefined};};exports[_0x7c7b('0x5f')]=function(_0x4b0c03){if(_0x4b0c03===_0x7c7b('0x3e')||_0x4b0c03===_0x7c7b('0x60')||_0x4b0c03===_0x7c7b('0x56')||_0x4b0c03===_0x7c7b('0x61')||_0x4b0c03===_0x7c7b('0x62')||_0x4b0c03===_0x7c7b('0x63')||_0x4b0c03===_0x7c7b('0x64')||_0x4b0c03===_0x7c7b('0x3f')||_0x4b0c03===_0x7c7b('0x65')||_0x4b0c03===_0x7c7b('0x4a')||_0x4b0c03===_0x7c7b('0x19')||_0x4b0c03===_0x7c7b('0x66')||_0x4b0c03===_0x7c7b('0x67')||_0x4b0c03===_0x7c7b('0x43')||_0x4b0c03===_0x7c7b('0x44')||_0x4b0c03===_0x7c7b('0x68')||_0x4b0c03===_0x7c7b('0x69')||_0x4b0c03===_0x7c7b('0x6a')||_0x4b0c03===_0x7c7b('0x6b')||_0x4b0c03==='recallme'||_0x4b0c03===_0x7c7b('0x4d')||_0x4b0c03==='ListId'||_0x4b0c03===_0x7c7b('0x36')||_0x4b0c03===_0x7c7b('0x1a')||_0x4b0c03==='sipcallid'||_0x4b0c03===_0x7c7b('0x6c')||_0x4b0c03===_0x7c7b('0x6d')||_0x4b0c03==='xmd-phone'||_0x4b0c03===_0x7c7b('0x6e')||_0x4b0c03===_0x7c7b('0x6f')||_0x4b0c03===_0x7c7b('0x70')||_0x4b0c03===_0x7c7b('0x71')||_0x4b0c03==='xmd-dialid'||_0x4b0c03===_0x7c7b('0x72')||_0x4b0c03===_0x7c7b('0x73')||_0x4b0c03==='xmd-cdrtype'||_0x4b0c03===_0x7c7b('0x74')||_0x4b0c03===_0x7c7b('0x75')||_0x4b0c03===_0x7c7b('0x76')||_0x4b0c03==='rtpaudioqos'||_0x4b0c03==='rtpaudioqosbridged'||_0x4b0c03===_0x7c7b('0x77')||_0x4b0c03===_0x7c7b('0x78')||_0x4b0c03==='rtpaudioqosloss'||_0x4b0c03===_0x7c7b('0x79')||_0x4b0c03===_0x7c7b('0x7a')||_0x4b0c03===_0x7c7b('0x7b')||_0x4b0c03===_0x7c7b('0x7c')||_0x4b0c03===_0x7c7b('0x7d')||_0x4b0c03===_0x7c7b('0x77')||_0x4b0c03===_0x7c7b('0x78')||_0x4b0c03===_0x7c7b('0x7e')||_0x4b0c03===_0x7c7b('0x79')||_0x4b0c03===_0x7c7b('0x7a')||_0x4b0c03==='rtpaudioqosrttbridged'||_0x4b0c03===_0x7c7b('0x7f')||_0x4b0c03===_0x7c7b('0x80')||_0x4b0c03===_0x7c7b('0x31')||_0x4b0c03===_0x7c7b('0x32')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x53db9c,_0x2ed2ea){var _0x49d1ad,_0x305026,_0x375ea5;if(_0x2ed2ea<=0x0){_0x2ed2ea=0x1;}_0x49d1ad=new RegExp(_0x7c7b('0x81')+_0x2ed2ea+'}$');_0x305026=Math[_0x7c7b('0x82')](0xa,_0x2ed2ea-0x1);_0x375ea5=Math[_0x7c7b('0x82')](0xa,_0x2ed2ea)-0x1;return util[_0x7c7b('0x11')]('%s',_['replace'](_0x53db9c,_0x49d1ad,_[_0x7c7b('0x83')](_0x305026,_0x375ea5)));};exports[_0x7c7b('0x84')]=function(_0x409a72){var _0x4ab986=_0x409a72['match'](/"(.*?)"/);return _0x4ab986?_0x4ab986[0x1]:_0x409a72;};exports[_0x7c7b('0x85')]=function(_0x449a32){var _0x2025c0=_0x449a32[_0x7c7b('0x86')](/<(.*?)>/);return _0x2025c0?_0x2025c0[0x1]:_0x449a32;};function buildNoAnswerEventPayload(_0x60a757,_0x894222){var _0xbd943d=buildObj(_0x60a757,_0x7c7b('0x87'));if(!_[_0x7c7b('0xf')](_0x894222[_0x7c7b('0x88')])){Object['keys'](_0x894222[_0x7c7b('0x88')])[_0x7c7b('0x89')](function(_0x601ae6){_0xbd943d[_0x601ae6[_0x7c7b('0x8a')]()]=_0x894222[_0x7c7b('0x88')][_0x601ae6];});}return _0xbd943d;}exports[_0x7c7b('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x6228=['rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','info','inspect','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridnum','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','toLower','updateOriginated','originated','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','statedesc','getSeconds','logLookAgent','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','interface','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','seconds','CampaignId','filterKey','type','campaigntype','membername','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss'];(function(_0x4bc232,_0x39ff32){var _0x4db762=function(_0x2b51c3){while(--_0x2b51c3){_0x4bc232['push'](_0x4bc232['shift']());}};_0x4db762(++_0x39ff32);}(_0x6228,0x9f));var _0x8622=function(_0x1cb1a8,_0x17b037){_0x1cb1a8=_0x1cb1a8-0x0;var _0x719d46=_0x6228[_0x1cb1a8];return _0x719d46;};'use strict';var util=require(_0x8622('0x0'));var _=require(_0x8622('0x1'));var moment=require(_0x8622('0x2'));var logger=require('../../../../config/logger')(_0x8622('0x3'));var ipAgi=process[_0x8622('0x4')][_0x8622('0x5')]||_0x8622('0x6');var utils=require(_0x8622('0x7'));exports[_0x8622('0x8')]=function(_0x8f412d){return function(_0x4b8876){logger[_0x8622('0x9')](_0x8f412d,util['inspect'](_0x4b8876,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x390696,_0x4d080c){logger[_0x8622('0xa')](_0x390696,util[_0x8622('0xb')](_0x4d080c,{'showHidden':![],'depth':null}));};exports[_0x8622('0xc')]=function(_0xf4f5a,_0x38db6e){logger[_0x8622('0x9')](_0xf4f5a,util[_0x8622('0xb')](_0x38db6e,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x245177){return function(_0xb744e0){logger[_0x8622('0xa')](_0x245177,util[_0x8622('0xb')](_0xb744e0,{'showHidden':![],'depth':null}));};};exports[_0x8622('0xd')]=function(_0x4952b8,_0x57179e,_0x30a2c8){return{'message':_0x4952b8,'unlock':_0x57179e,'active':_0x30a2c8};};exports['getCallerId']=function(_0x1d8a0d,_0x32179e,_0x2c22b4){if(!_[_0x8622('0xe')](_0x2c22b4)&&_0x8622('0xf')===typeof _0x2c22b4&&!_['isEmpty'](_0x2c22b4)){if(!_['isUndefined'](_0x32179e)&&_0x8622('0xf')===typeof _0x32179e&&!_[_0x8622('0x10')](_0x32179e)){return util[_0x8622('0x11')](_0x8622('0x12'),_0x32179e,_0x2c22b4);}return util[_0x8622('0x11')](_0x8622('0x12'),_0x2c22b4,_0x2c22b4);}if(!_[_0x8622('0xe')](_0x1d8a0d)&&_0x8622('0xf')===typeof _0x1d8a0d&&!_[_0x8622('0x10')](_0x1d8a0d)){return _0x1d8a0d;}return _0x8622('0x13');};exports['isActive']=function(_0x487d39){if(_[_0x8622('0x14')](_0x487d39)){return![];}return _0x487d39;};exports[_0x8622('0x15')]=function(_0x320793,_0x561fea,_0x385aee,_0x1e3ae1,_0x56d0ae,_0x62de30){var _0x487069={'XMD-QUEUE':_0x561fea[_0x8622('0x16')]?_0x561fea[_0x8622('0x16')][_0x8622('0x17')]:'','XMD-CALLERID':_0x1e3ae1,'XMD-CALLERID-PREVIEW':_0x62de30?util[_0x8622('0x11')]('\x22%s\x22\x20<%s>',_0x62de30['calleridname'],_0x62de30[_0x8622('0x18')]):_0x1e3ae1,'XMD-DIALID':_0x56d0ae,'XMD-CONTACTID':_0x561fea['ContactId'],'XMD-CDRTYPE':_0x8622('0x19'),'CALLERID(all)':_0x1e3ae1,'XMD-VOICEQUEUEID':_0x561fea['VoiceQueueId'],'XMD-DIALCHANNEL':_0x385aee,'XMD-DIALTIMEOUT':_0x320793[_0x8622('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x8622('0x11')](_0x8622('0x1b'),_0x320793['dialQueueProject2']?'g':'',_[_0x8622('0x10')](_0x320793[_0x8622('0x1c')])?'':_0x8622('0x1d')),'XMD-DIALURL':_0x320793[_0x8622('0x1e')]||'','XMD-AGI':_0x320793[_0x8622('0x1f')]?util[_0x8622('0x11')](_0x8622('0x20'),ipAgi,_0x320793[_0x8622('0x1f')]):_0x8622('0x21'),'XMD-AGIAFTER':_0x320793['dialQueueProject2']?util[_0x8622('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x320793[_0x8622('0x22')]):_0x8622('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x62de30?_0x62de30[_0x8622('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x62de30?_0x62de30[_0x8622('0x24')]:'','XMD-DESTINATION':_0x8622('0x25'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x320793[_0x8622('0x1c')])){_0x487069[util[_0x8622('0x11')]('%s',_0x8622('0x26'))]=_0x320793[_0x8622('0x1c')];_0x487069[util[_0x8622('0x11')]('%s',_0x8622('0x27'))]=_0x56d0ae;}return _0x487069;};exports['toLowerVariables']=function(_0x3b802c){var _0x1d6ae0={};for(var _0x138978 in _0x3b802c){if(_0x3b802c[_0x8622('0x28')](_0x138978)){_0x1d6ae0[util[_0x8622('0x11')]('%s',_[_0x8622('0x29')](_0x138978))]=_0x3b802c[_0x138978];}}return{'variables':_0x1d6ae0};};exports[_0x8622('0x2a')]=function(_0x3fa1ca,_0x2601fd){if(!_[_0x8622('0x14')](_0x3fa1ca)){if(_0x3fa1ca[_0x8622('0x28')](_0x8622('0x2b'))){if(_0x3fa1ca['originated']>0x0){_0x3fa1ca['originated']-=0x1;}else{logger[_0x8622('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2601fd);}}}else{logger[_0x8622('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2601fd);}};exports['logBlacklist']=function(_0x1d8919){var _0x59bc5f=moment()[_0x8622('0x11')](_0x8622('0x2c'));_0x1d8919[_0x8622('0x2d')]=0xd;_0x1d8919['statedesc']=_0x8622('0x2e');_0x1d8919[_0x8622('0x2f')]=_0x59bc5f;_0x1d8919[_0x8622('0x30')]=_0x59bc5f;_0x1d8919[_0x8622('0x31')]=_0x59bc5f;};exports['logAgent']=function(_0x300b6d,_0x17f93a,_0x204991){var _0x2d7eda=moment()[_0x8622('0x11')](_0x8622('0x2c'));_0x300b6d[_0x8622('0x2d')]=_0x17f93a;_0x300b6d[_0x8622('0x32')]=_0x204991;_0x300b6d[_0x8622('0x30')]=_0x2d7eda;_0x300b6d['ringtime']=utils[_0x8622('0x33')](_0x300b6d[_0x8622('0x30')],_0x300b6d[_0x8622('0x2f')]);};exports[_0x8622('0x34')]=function(_0x2e10fc,_0x6835ea,_0x184dd2){_0x2e10fc['membername']=_0x6835ea;_0x2e10fc[_0x8622('0x35')]=_0x184dd2;};exports[_0x8622('0x36')]=function(_0x53182,_0x30c0a5,_0x3d3cad){var _0x5772d=moment()['format'](_0x8622('0x2c'));_0x53182[_0x8622('0x2d')]=_0x30c0a5;_0x53182[_0x8622('0x32')]=_0x3d3cad;_0x53182['responsetime']=_0x53182[_0x8622('0x30')]?_0x53182[_0x8622('0x30')]:_0x5772d;_0x53182[_0x8622('0x31')]=_0x53182[_0x8622('0x31')]?_0x53182[_0x8622('0x31')]:_0x5772d;_0x53182[_0x8622('0x37')]=utils[_0x8622('0x33')](_0x53182[_0x8622('0x30')]||0x0,_0x53182[_0x8622('0x2f')]||0x0);_0x53182[_0x8622('0x38')]=_0x53182[_0x8622('0x39')]?utils['getSeconds'](_0x53182[_0x8622('0x31')],_0x53182['answertime']):0x0;};exports[_0x8622('0x3a')]=function(_0x3d3d9a){return _0x3d3d9a===_0x8622('0x3b');};exports[_0x8622('0x3c')]=function(_0x360de2,_0x4a7c93,_0x533b16,_0x176400,_0x376e7b){var _0x4c38fa=_0x176400?_0x8622('0x3d'):_0x360de2[_0x8622('0x3e')];_0x4c38fa=_0x376e7b?'BOOKED':_0x4c38fa;return{'actionid':_0x360de2[_0x8622('0x3f')],'action':'originate','channel':_0x360de2[_0x8622('0x40')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x4c38fa,_0x360de2[_0x8622('0x18')]),'Exten':_0x8622('0x25'),'Context':_0x8622('0x41'),'Priority':'1','variable':_0x533b16,'timeout':(_0x4a7c93[_0x8622('0x42')]||0x1e)*0x3e8,'async':!![],'channelid':_0x360de2[_0x8622('0x3f')]};};exports[_0x8622('0x43')]=function(_0x28ded2){return _0x28ded2['countbusyretry']+_0x28ded2[_0x8622('0x44')]+_0x28ded2['countnoanswerretry']+_0x28ded2['countagentrejectretry']+_0x28ded2['countnosuchnumberretry'];};exports[_0x8622('0x45')]=function(_0x202e07){var _0x94eb2e=_['clone'](_0x202e07);_0x94eb2e['state']=0xf;_0x94eb2e[_0x8622('0x32')]=_0x8622('0x46');return _0x94eb2e;};exports[_0x8622('0x47')]=function(_0x15ff22,_0x3667fb,_0x1d1b2e){var _0x1d1fa3={};_0x1d1fa3[_0x3667fb]=_0x15ff22[_0x3667fb];_0x1d1fa3[_0x8622('0x48')]=![];_0x1d1fa3[_0x8622('0x49')]=moment()[_0x8622('0x4a')](_0x1d1b2e,_0x8622('0x4b'))['format'](_0x8622('0x2c'));_0x1d1fa3['ContactId']=_0x15ff22[_0x8622('0x4c')];_0x1d1fa3['ListId']=_0x15ff22[_0x8622('0x4d')];_0x1d1fa3[_0x8622('0x4e')]=_0x15ff22[_0x8622('0x4e')]||undefined;return _0x1d1fa3;};exports[_0x8622('0x4f')]=function(_0x53284e,_0x3bb56d){if(!_[_0x8622('0x14')](_0x53284e)){if(_0x53284e[_0x8622('0x50')]>0x0){_0x53284e['pTalking']-=0x1;}else{logger[_0x8622('0x9')](_0x3bb56d,_0x8622('0x51'));}}else{logger['error'](_0x3bb56d,_0x8622('0x52'));}};exports[_0x8622('0x53')]=function(_0x457ac7){if(_0x457ac7<=0x0){return!![];}return![];};function buildObj(_0x17fbee,_0x18e075,_0x453066){_0x17fbee['lastevent']=_0x18e075;_0x17fbee[_0x8622('0x17')]=_0x17fbee[_0x8622('0x54')];_0x17fbee[_0x8622('0x55')]=_0x17fbee[_0x8622('0x40')];_0x17fbee['motionChannel']=_0x8622('0x56');if(_0x453066){_0x17fbee[_0x8622('0x57')]=_0x453066[_0x8622('0x57')];}return _0x17fbee;}exports[_0x8622('0x58')]=buildObj;exports[_0x8622('0x59')]=function(_0x17cabb){var _0x349746={};_0x349746['queue']=_0x17cabb[_0x8622('0x54')];_0x349746['interface']=_0x17cabb[_0x8622('0x40')];_0x349746[_0x8622('0x3f')]=_0x17cabb[_0x8622('0x3f')];return _0x349746;};exports[_0x8622('0x5a')]=function(_0x212d39){var _0xdc6907=[];for(var _0x36e4b9 in _0x212d39){if(_0x212d39[_0x8622('0x28')](_0x36e4b9)){if(!_['isNil'](_0x212d39[_0x36e4b9])&&_0x212d39[_0x36e4b9][_0x8622('0x2d')]===_0x8622('0x5b')&&_0x212d39[_0x36e4b9][_0x8622('0x5c')]===_0x8622('0x5d')){_0xdc6907[_0x8622('0x5e')](_0x212d39[_0x36e4b9]['id']);}}}return _0xdc6907;};exports[_0x8622('0x5f')]=function(_0x4817dd){var _0x1aba93=moment()['milliseconds'](0x0);var _0x5485fd=moment(_0x4817dd)['milliseconds'](0x0);return _0x1aba93[_0x8622('0x60')](_0x5485fd,_0x8622('0x61'));};exports['createBody']=function(_0x4a9252){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a9252['ContactId'],'ListId':_0x4a9252['ListId'],'VoiceQueueId':_0x4a9252['VoiceQueueId']||undefined,'CampaignId':_0x4a9252[_0x8622('0x62')]||undefined};};exports[_0x8622('0x63')]=function(_0x5302ad){if(_0x5302ad===_0x8622('0x3f')||_0x5302ad==='idContact'||_0x5302ad===_0x8622('0x54')||_0x5302ad===_0x8622('0x64')||_0x5302ad===_0x8622('0x65')||_0x5302ad==='dialAnswer'||_0x5302ad===_0x8622('0x66')||_0x5302ad===_0x8622('0x40')||_0x5302ad===_0x8622('0x3e')||_0x5302ad===_0x8622('0x48')||_0x5302ad===_0x8622('0x18')||_0x5302ad===_0x8622('0x49')||_0x5302ad===_0x8622('0x67')||_0x5302ad===_0x8622('0x44')||_0x5302ad===_0x8622('0x68')||_0x5302ad===_0x8622('0x69')||_0x5302ad===_0x8622('0x6a')||_0x5302ad===_0x8622('0x6b')||_0x5302ad===_0x8622('0x6c')||_0x5302ad===_0x8622('0x6d')||_0x5302ad===_0x8622('0x4c')||_0x5302ad===_0x8622('0x4d')||_0x5302ad===_0x8622('0x35')||_0x5302ad===_0x8622('0x4e')||_0x5302ad===_0x8622('0x6e')||_0x5302ad==='xmd-voicequeueid'||_0x5302ad===_0x8622('0x6f')||_0x5302ad===_0x8622('0x70')||_0x5302ad===_0x8622('0x71')||_0x5302ad==='xmd-dialurl'||_0x5302ad===_0x8622('0x72')||_0x5302ad===_0x8622('0x73')||_0x5302ad==='xmd-dialid'||_0x5302ad===_0x8622('0x74')||_0x5302ad===_0x8622('0x75')||_0x5302ad===_0x8622('0x76')||_0x5302ad==='xmd-callerid'||_0x5302ad===_0x8622('0x77')||_0x5302ad===_0x8622('0x78')||_0x5302ad===_0x8622('0x79')||_0x5302ad===_0x8622('0x7a')||_0x5302ad===_0x8622('0x7b')||_0x5302ad==='rtpaudioqosjitterbridged'||_0x5302ad===_0x8622('0x7c')||_0x5302ad==='rtpaudioqoslossbridged'||_0x5302ad===_0x8622('0x7d')||_0x5302ad===_0x8622('0x7e')||_0x5302ad===_0x8622('0x79')||_0x5302ad===_0x8622('0x7a')||_0x5302ad===_0x8622('0x7b')||_0x5302ad==='rtpaudioqosjitterbridged'||_0x5302ad===_0x8622('0x7c')||_0x5302ad===_0x8622('0x7f')||_0x5302ad===_0x8622('0x7d')||_0x5302ad===_0x8622('0x7e')||_0x5302ad==='bridgepeer'||_0x5302ad==='bridgepvtcallid'||_0x5302ad===_0x8622('0x2d')||_0x5302ad===_0x8622('0x32')){return![];}return!![];};exports[_0x8622('0x80')]=function(_0x230a4b,_0x377f3e){var _0x16e033,_0x342299,_0x5e9015;if(_0x377f3e<=0x0){_0x377f3e=0x1;}_0x16e033=new RegExp(_0x8622('0x81')+_0x377f3e+'}$');_0x342299=Math[_0x8622('0x82')](0xa,_0x377f3e-0x1);_0x5e9015=Math[_0x8622('0x82')](0xa,_0x377f3e)-0x1;return util[_0x8622('0x11')]('%s',_[_0x8622('0x83')](_0x230a4b,_0x16e033,_[_0x8622('0x84')](_0x342299,_0x5e9015)));};exports[_0x8622('0x85')]=function(_0xa32383){var _0x260e43=_0xa32383[_0x8622('0x86')](/"(.*?)"/);return _0x260e43?_0x260e43[0x1]:_0xa32383;};exports[_0x8622('0x87')]=function(_0x11b299){var _0x53093b=_0x11b299['match'](/<(.*?)>/);return _0x53093b?_0x53093b[0x1]:_0x11b299;};function buildNoAnswerEventPayload(_0x3c9fae,_0x404f22){var _0x1421b6=buildObj(_0x3c9fae,_0x8622('0x88'));if(!_[_0x8622('0x10')](_0x404f22[_0x8622('0x89')])){Object[_0x8622('0x8a')](_0x404f22[_0x8622('0x89')])[_0x8622('0x8b')](function(_0x330215){_0x1421b6[_0x330215[_0x8622('0x8c')]()]=_0x404f22['variables'][_0x330215];});}return _0x1421b6;}exports[_0x8622('0x8d')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 8dd646a..1a3b2f8 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 _0x4022=['queuepause','voicechannel','voicequeuechannelhangup','string','number','queueremove'];(function(_0x3d0e09,_0x3b2db7){var _0x16e7bd=function(_0x4dab73){while(--_0x4dab73){_0x3d0e09['push'](_0x3d0e09['shift']());}};_0x16e7bd(++_0x3b2db7);}(_0x4022,0xed));var _0x2402=function(_0x1c12e1,_0x22c6e4){_0x1c12e1=_0x1c12e1-0x0;var _0x37a21c=_0x4022[_0x1c12e1];return _0x37a21c;};'use strict';exports['queueadd']={'queue':{'type':_0x2402('0x0'),'required':!![]},'interface':{'type':_0x2402('0x0'),'required':!![]},'membername':{'type':_0x2402('0x0'),'required':!![]},'penalty':{'type':_0x2402('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x2402('0x2')]={'queue':{'type':_0x2402('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x2402('0x3')]={'interface':{'type':_0x2402('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x2402('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x2402('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x2402('0x0'),'required':!![]}};exports[_0x2402('0x4')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x2402('0x0')},'format':{'type':_0x2402('0x0')},'mixmonitorid':{'type':_0x2402('0x0')}};exports[_0x2402('0x5')]={'uniqueid':{'type':_0x2402('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x2402('0x0'),'required':!![]},'context':{'type':_0x2402('0x0')}}; \ No newline at end of file +var _0x1469=['voicequeuechannelredirect','queueadd','string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1469,0x1d7));var _0x9146=function(_0x293838,_0x541252){_0x293838=_0x293838-0x0;var _0x5b50c3=_0x1469[_0x293838];return _0x5b50c3;};'use strict';exports[_0x9146('0x0')]={'queue':{'type':_0x9146('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x9146('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x9146('0x2'),'required':![]}};exports[_0x9146('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x9146('0x1'),'required':!![]}};exports[_0x9146('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x9146('0x2')},'reason':{'type':_0x9146('0x1'),'required':![]}};exports[_0x9146('0x5')]={'module':{'type':_0x9146('0x1'),'required':![]}};exports[_0x9146('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9146('0x7')]={'uniqueid':{'type':_0x9146('0x1'),'required':!![]},'filename':{'type':_0x9146('0x1')},'format':{'type':_0x9146('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x9146('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9146('0x9')]={'uniqueid':{'type':_0x9146('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x9146('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index be2ba50..f4aa9df 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 _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(_0x3b06c8,_0x397e2f){var _0x57beed=function(_0x1c71cb){while(--_0x1c71cb){_0x3b06c8['push'](_0x3b06c8['shift']());}};_0x57beed(++_0x397e2f);}(_0xb10b,0x12a));var _0xbb10=function(_0x532b5b,_0xce6ec8){_0x532b5b=_0x532b5b-0x0;var _0x169ff9=_0xb10b[_0x532b5b];return _0x169ff9;};'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 +var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x57fd82,_0x493e7d){var _0x411f70=function(_0x1660d9){while(--_0x1660d9){_0x57fd82['push'](_0x57fd82['shift']());}};_0x411f70(++_0x493e7d);}(_0xadb5,0xad));var _0x5adb=function(_0x12bcbb,_0x5220e6){_0x12bcbb=_0x12bcbb-0x0;var _0x1b0d1c=_0xadb5[_0x12bcbb];return _0x1b0d1c;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 3775322..82d1cde 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 _0xee4f=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x3855fd,_0x26003f){var _0x226a53=function(_0x14186f){while(--_0x14186f){_0x3855fd['push'](_0x3855fd['shift']());}};_0x226a53(++_0x26003f);}(_0xee4f,0x1b4));var _0xfee4=function(_0x2e4dd3,_0x418e03){_0x2e4dd3=_0x2e4dd3-0x0;var _0x216815=_0xee4f[_0x2e4dd3];return _0x216815;};'use strict';function mergeDBDataToRealtime(_0x342e55,_0x5d4452){var _0x2d0cdc=Object[_0xfee4('0x0')]({},_0x342e55);for(var _0x2f7531 in _0x5d4452){if(_0x2d0cdc[_0xfee4('0x1')](_0x2f7531)){_0x2d0cdc[_0x2f7531]=_0x5d4452[_0x2f7531];}}return _0x2d0cdc;}exports[_0xfee4('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xebc0=['assign','mergeDBDataToRealtime'];(function(_0x1de55e,_0x136570){var _0x8d2760=function(_0x8f239b){while(--_0x8f239b){_0x1de55e['push'](_0x1de55e['shift']());}};_0x8d2760(++_0x136570);}(_0xebc0,0x1d0));var _0x0ebc=function(_0x4f347b,_0x5d76c9){_0x4f347b=_0x4f347b-0x0;var _0x16d8dd=_0xebc0[_0x4f347b];return _0x16d8dd;};'use strict';function mergeDBDataToRealtime(_0x54c506,_0x69fa28){var _0x549f9e=Object[_0x0ebc('0x0')]({},_0x54c506);for(var _0x4e0c27 in _0x69fa28){if(_0x549f9e['hasOwnProperty'](_0x4e0c27)){_0x549f9e[_0x4e0c27]=_0x69fa28[_0x4e0c27];}}return _0x549f9e;}exports[_0x0ebc('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d26e1d6..33ae4c3 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 _0x6bc8=['YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','destination','exten','type','dialer','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','disposition','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','UserId','split','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','telephones','interface','format','SIP/%s','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6bc8,0x8e));var _0x86bc=function(_0x2cdb69,_0x3f999e){_0x2cdb69=_0x2cdb69-0x0;var _0xd5ea7e=_0x6bc8[_0x2cdb69];return _0xd5ea7e;};'use strict';var _=require(_0x86bc('0x0'));var moment=require(_0x86bc('0x1'));var util=require('util');var config=require(_0x86bc('0x2'));var ami=require(_0x86bc('0x3'));var RpcVoiceAgentReport=require(_0x86bc('0x4'));var RpcVoiceCallReport=require(_0x86bc('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x86bc('0x6'));var RpcVoiceQueueReport=require(_0x86bc('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x86bc('0x8'));var VoiceQueueReport=require(_0x86bc('0x9'));var VoiceCallReport=require(_0x86bc('0xa'));var VoiceAgentReport=require(_0x86bc('0xb'));var VoiceDialReport=require(_0x86bc('0xc'));var UserReport=require(_0x86bc('0xd'));function Report(_0x5cefe7){this[_0x86bc('0xe')]=_0x5cefe7;this[_0x86bc('0xf')]=_0x5cefe7['agents'];this['telephones']=_0x5cefe7['telephones'];}Report[_0x86bc('0x10')][_0x86bc('0x11')]=function(_0x3b1d2a){var _0x35949e=new VoiceQueueReport(this[_0x86bc('0xe')]);var _0x4bea68=new VoiceAgentReport(this['realtime']);var _0x100e6f=new VoiceDialReport(this['realtime']);var _0x4c2812=new VoiceCallReport(this[_0x86bc('0xe')]);var _0x3660e3=new UserReport(this[_0x86bc('0xe')]);if(config[_0x86bc('0x12')]&&config[_0x86bc('0x12')][_0x86bc('0x13')]){ami['on'](_0x86bc('0x14'),this[_0x86bc('0x15')][_0x86bc('0x16')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x86bc('0x16')](this));ami['on'](_0x86bc('0x17'),this[_0x86bc('0x18')][_0x86bc('0x16')](this));ami['on'](_0x86bc('0x19'),this[_0x86bc('0x1a')][_0x86bc('0x16')](this));ami['on'](_0x86bc('0x1b'),this['blindTransfer'][_0x86bc('0x16')](this));ami['on'](_0x86bc('0x1c'),this[_0x86bc('0x1d')][_0x86bc('0x16')](this));}};Report[_0x86bc('0x10')][_0x86bc('0x1e')]=function(_0xd3bc63){var _0x4338cc;_0x4338cc=_[_0x86bc('0x1f')](this[_0x86bc('0xf')],function(_0x5ccd42){return _0x5ccd42[_0x86bc('0x20')]==_0xd3bc63||_0x5ccd42[_0x86bc('0x21')]==_0xd3bc63;});if(_[_0x86bc('0x22')](_0x4338cc)){var _0x17af4e=_['find'](this[_0x86bc('0x23')],function(_0x5485fb){return _0x5485fb[_0x86bc('0x20')]==_0xd3bc63||_0x5485fb[_0x86bc('0x21')]==_0xd3bc63;});if(_0x17af4e){_0x4338cc=_[_0x86bc('0x1f')](this[_0x86bc('0xf')],function(_0x566f9d){return _0x566f9d[_0x86bc('0x24')]==util[_0x86bc('0x25')](_0x86bc('0x26'),_0x17af4e[_0x86bc('0x21')]);});}}return _0x4338cc;};Report[_0x86bc('0x10')][_0x86bc('0x15')]=function(_0x1e6b94){for(var _0x513ae3=0x0;_0x513ae3<_0x1e6b94[_0x86bc('0x27')];_0x513ae3+=0x1){var _0x19f4ea=this[_0x86bc('0x1e')](_0x1e6b94[_0x513ae3][_0x86bc('0x28')]);if(_0x19f4ea){_0x1e6b94[_0x513ae3][_0x86bc('0x20')]=_0x19f4ea['accountcode'];_0x1e6b94[_0x513ae3][_0x86bc('0x29')]=!![];_0x1e6b94[_0x513ae3]['lastAssignedTo']=_0x19f4ea['name'];_0x1e6b94[_0x513ae3][_0x86bc('0x24')]=_[_0x86bc('0x22')](_0x19f4ea[_0x86bc('0x24')])?util['format'](_0x86bc('0x26'),_0x19f4ea[_0x86bc('0x21')]):_0x19f4ea['interface'];if(_0x1e6b94[_0x513ae3][_0x86bc('0x2a')]){_0x1e6b94[_0x513ae3][_0x86bc('0x2b')]=moment()['format'](_0x86bc('0x2c'));}if(_0x1e6b94[_0x513ae3][_0x86bc('0x2d')]){_0x1e6b94[_0x513ae3]['queuecallerexitAt']=moment()['format'](_0x86bc('0x2c'));}RpcMemberReport[_0x86bc('0x15')](_0x1e6b94[_0x513ae3]);}RpcVoiceQueueReport[_0x86bc('0x2e')](_0x1e6b94[_0x513ae3]);}};function extractCalleridNumber(_0x13511d){var _0x4a7731=_0x13511d[_0x86bc('0x2f')](/<(.*?)>/);return _0x4a7731?_0x4a7731[0x1]:_0x13511d;}Report[_0x86bc('0x10')][_0x86bc('0x30')]=function(_0x487e80){for(var _0x3123f6=0x0;_0x3123f6','linkedid','transfers','transfereelinkedid','uniqueid','UserId','create','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','calleridname','connectedlinename','membername','exten','xcally-motion-dialer','isArray','forEach','voiceDialReport','mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','accountcode','name','interface','format','SIP/%s','prototype','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','getAgentByInternal','keys','length','getCallType','channel','split','calleridnum','outbound','voiceCallReport','destination','type','dialer','lastapplication','queue','lastdata','context','from-sip'];(function(_0x1cf600,_0x5445d0){var _0x2a474c=function(_0x5c6993){while(--_0x5c6993){_0x1cf600['push'](_0x1cf600['shift']());}};_0x2a474c(++_0x5445d0);}(_0xd018,0x1a0));var _0x8d01=function(_0x5d4df0,_0x4792b0){_0x5d4df0=_0x5d4df0-0x0;var _0x5324c7=_0xd018[_0x5d4df0];return _0x5324c7;};'use strict';var _=require(_0x8d01('0x0'));var moment=require(_0x8d01('0x1'));var util=require(_0x8d01('0x2'));var config=require(_0x8d01('0x3'));var ami=require(_0x8d01('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x8d01('0x5'));var RpcVoiceDialReport=require(_0x8d01('0x6'));var RpcMemberReport=require(_0x8d01('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x8d01('0x8'));var RpcVoiceTransferReport=require(_0x8d01('0x9'));var VoiceQueueReport=require(_0x8d01('0xa'));var VoiceCallReport=require(_0x8d01('0xb'));var VoiceAgentReport=require(_0x8d01('0xc'));var VoiceDialReport=require(_0x8d01('0xd'));var UserReport=require('./userReport');function Report(_0x376a58){this['realtime']=_0x376a58;this[_0x8d01('0xe')]=_0x376a58[_0x8d01('0xe')];this[_0x8d01('0xf')]=_0x376a58[_0x8d01('0xf')];}Report['prototype'][_0x8d01('0x10')]=function(_0x4fd1b4){var _0x379cae=new VoiceQueueReport(this[_0x8d01('0x11')]);var _0x285dfc=new VoiceAgentReport(this[_0x8d01('0x11')]);var _0x404e38=new VoiceDialReport(this[_0x8d01('0x11')]);var _0x25e649=new VoiceCallReport(this[_0x8d01('0x11')]);var _0x1145f1=new UserReport(this[_0x8d01('0x11')]);if(config[_0x8d01('0x12')]&&config[_0x8d01('0x12')][_0x8d01('0x13')]){ami['on'](_0x8d01('0x14'),this[_0x8d01('0x15')]['bind'](this));ami['on'](_0x8d01('0x16'),this['voiceCallReport'][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x18'),this[_0x8d01('0x19')][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x1a'),this['voiceDialReport'][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x1b'),this[_0x8d01('0x1c')][_0x8d01('0x17')](this));ami['on'](_0x8d01('0x1d'),this[_0x8d01('0x1e')]['bind'](this));}};Report['prototype'][_0x8d01('0x1f')]=function(_0x471c46){var _0xaddd1a;_0xaddd1a=_[_0x8d01('0x20')](this[_0x8d01('0xe')],function(_0x17262a){return _0x17262a['accountcode']==_0x471c46||_0x17262a['name']==_0x471c46;});if(_[_0x8d01('0x21')](_0xaddd1a)){var _0x1dd994=_['find'](this[_0x8d01('0xf')],function(_0x348bcf){return _0x348bcf[_0x8d01('0x22')]==_0x471c46||_0x348bcf[_0x8d01('0x23')]==_0x471c46;});if(_0x1dd994){_0xaddd1a=_[_0x8d01('0x20')](this[_0x8d01('0xe')],function(_0xefd33d){return _0xefd33d[_0x8d01('0x24')]==util[_0x8d01('0x25')](_0x8d01('0x26'),_0x1dd994[_0x8d01('0x23')]);});}}return _0xaddd1a;};Report[_0x8d01('0x27')][_0x8d01('0x15')]=function(_0x36a377){for(var _0x5d2705=0x0;_0x5d2705<_0x36a377['length'];_0x5d2705+=0x1){var _0x333453=this['findAgent'](_0x36a377[_0x5d2705][_0x8d01('0x28')]);if(_0x333453){_0x36a377[_0x5d2705]['accountcode']=_0x333453[_0x8d01('0x22')];_0x36a377[_0x5d2705][_0x8d01('0x29')]=!![];_0x36a377[_0x5d2705][_0x8d01('0x2a')]=_0x333453[_0x8d01('0x23')];_0x36a377[_0x5d2705][_0x8d01('0x24')]=_[_0x8d01('0x21')](_0x333453[_0x8d01('0x24')])?util['format'](_0x8d01('0x26'),_0x333453[_0x8d01('0x23')]):_0x333453[_0x8d01('0x24')];if(_0x36a377[_0x5d2705]['queuecallercomplete']){_0x36a377[_0x5d2705][_0x8d01('0x2b')]=moment()['format'](_0x8d01('0x2c'));}if(_0x36a377[_0x5d2705]['queuecallerexit']){_0x36a377[_0x5d2705][_0x8d01('0x2d')]=moment()[_0x8d01('0x25')](_0x8d01('0x2c'));}RpcMemberReport[_0x8d01('0x15')](_0x36a377[_0x5d2705]);}RpcVoiceQueueReport['create'](_0x36a377[_0x5d2705]);}};function extractCalleridNumber(_0x51d9aa){var _0x81c5d8=_0x51d9aa[_0x8d01('0x2e')](/<(.*?)>/);return _0x81c5d8?_0x81c5d8[0x1]:_0x51d9aa;}Report['prototype'][_0x8d01('0x2f')]=function(_0x4901ad){for(var _0x18686d=0x0;_0x18686d0x0?!![]:![];if(!_0x4eb013){return this[_0x56fa('0x6c')](this[_0x56fa('0x17')][_0x56fa('0x6d')]);}};VoiceQueueReport[_0x56fa('0xd')][_0x56fa('0x1c')]=function(_0x3d5544){var _0x4aabaf=this[_0x56fa('0x17')]['id'];if(this['summary']['queuestatus'][_0x4aabaf]&&this[_0x56fa('0x17')]['queuestatus'][_0x4aabaf][_0x3d5544['actionid']]){this['summary'][_0x56fa('0x63')][_0x4aabaf][_0x3d5544[_0x56fa('0x62')]]['agents'][_0x56fa('0x6e')](_0x3d5544);}};VoiceQueueReport[_0x56fa('0xd')]['syncQueueSummary']=function(_0x2871ea){var _0x269976=this;try{if(this[_0x56fa('0x6f')](_0x2871ea)&&this[_0x56fa('0x6f')](_0x2871ea[_0x56fa('0x50')])){logger[_0x56fa('0x53')](_0x56fa('0x70'),util[_0x56fa('0x45')](_0x2871ea,{'showHidden':![],'depth':null}));var _0x2c3b8b=this[_0x56fa('0x15')][_0x2871ea[_0x56fa('0x50')]];if(_0x2c3b8b){logger[_0x56fa('0x53')](_0x56fa('0x71'),_0x2c3b8b[_0x56fa('0x5a')]);this[_0x56fa('0x17')][_0x56fa('0x5d')][_0x2c3b8b[_0x56fa('0x5a')]]={'summaryEvent':_0x2871ea};this[_0x56fa('0x17')][_0x56fa('0x6b')]+=0x1;return ami['Action']({'action':'queuestatus','queue':_0x2c3b8b[_0x56fa('0x5a')]})[_0x56fa('0x61')](function(_0x31e4cb){if(!_0x269976[_0x56fa('0x17')]['queuestatus'][_0x2871ea[_0x56fa('0x62')]]){_0x269976[_0x56fa('0x17')][_0x56fa('0x63')][_0x2871ea[_0x56fa('0x62')]]={};}_0x269976[_0x56fa('0x17')]['queuestatus'][_0x2871ea['actionid']][_0x31e4cb[_0x56fa('0x62')]]={'queue':_0x2c3b8b[_0x56fa('0x5a')],'agents':[]};})[_0x56fa('0x40')](function(_0x271f09){throw _0x271f09;});}}}catch(_0x23144a){logger[_0x56fa('0x42')](_0x56fa('0x72'),util[_0x56fa('0x45')](_0x23144a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x318633){if(this[_0x56fa('0x17')][_0x56fa('0x6b')]>0x0){this['summary'][_0x56fa('0x6d')]=_0x318633;return;}logger[_0x56fa('0x53')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x56fa('0x45')](_0x318633,{'showHidden':![],'depth':null}));this[_0x56fa('0x17')]=initializeSummary();ami[_0x56fa('0x4a')](_0x56fa('0x73'),{});};VoiceQueueReport[_0x56fa('0xd')]['syncQueueCallerJoin']=function(_0x46dc18){try{if(this['isNotNull'](_0x46dc18)){logger[_0x56fa('0x53')](_0x56fa('0x74'),_0x46dc18[_0x56fa('0x4d')],util[_0x56fa('0x45')](_0x46dc18,{'showHidden':![],'depth':null}));if(_[_0x56fa('0x5c')](this['queueReports'][_0x46dc18['uniqueid']])){this[_0x56fa('0x11')][_0x46dc18[_0x56fa('0x4d')]]=[];}if(_[_0x56fa('0x5c')](this[_0x56fa('0x3b')][_0x46dc18[_0x56fa('0x4d')]])){this['channels'][_0x46dc18[_0x56fa('0x4d')]]={};}var _0x38f164=new QueueReport();_0x38f164['queue']=_0x46dc18[_0x56fa('0x50')];_0x38f164[_0x56fa('0x57')]=this[_0x56fa('0x15')][_0x38f164[_0x56fa('0x50')]]&&this[_0x56fa('0x15')][_0x38f164[_0x56fa('0x50')]][_0x56fa('0x57')]?this[_0x56fa('0x15')][_0x38f164['queue']][_0x56fa('0x57')]||_0x56fa('0x58'):_0x56fa('0x58');_0x38f164[_0x56fa('0x75')]=moment()[_0x56fa('0x4e')](_0x56fa('0x76'));_0x38f164[_0x56fa('0x77')]=_0x46dc18[_0x56fa('0x77')];_0x38f164[_0x56fa('0x78')]=_0x46dc18[_0x56fa('0x78')];_0x38f164[_0x56fa('0x4d')]=_0x46dc18[_0x56fa('0x4d')];_0x38f164[_0x56fa('0x79')]=this['channels'][_0x46dc18[_0x56fa('0x4d')]][_0x56fa('0x79')];logger[_0x56fa('0x7a')](_0x56fa('0x7b'),_0x38f164[_0x56fa('0x50')],_0x38f164['type']);Object[_0x56fa('0x68')](_0x38f164,_[_0x56fa('0x7c')](_0x46dc18,_[_0x56fa('0x7d')](_0x38f164)));this[_0x56fa('0x11')][_0x46dc18[_0x56fa('0x4d')]][_0x56fa('0x6e')](_0x38f164);this[_0x56fa('0x3b')][_0x46dc18[_0x56fa('0x4d')]]=_0x38f164;this[_0x56fa('0x7e')](_0x38f164,'queuecallerjoin');}}catch(_0x553f56){logger[_0x56fa('0x42')](_0x56fa('0x74'),_0x46dc18[_0x56fa('0x4d')],util[_0x56fa('0x45')](_0x553f56,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56fa('0xd')][_0x56fa('0x21')]=function(_0x440e26){try{if(this[_0x56fa('0x6f')](_0x440e26)){logger['debug'](_0x56fa('0x7f'),_0x440e26[_0x56fa('0x4d')],util['inspect'](_0x440e26,{'showHidden':![],'depth':null}));if(this[_0x56fa('0x11')][_0x440e26['uniqueid']]){var _0x486b40=_['last'](this[_0x56fa('0x11')][_0x440e26[_0x56fa('0x4d')]]);_0x486b40[_0x56fa('0x80')]=![];_0x486b40[_0x56fa('0x81')]=null;_0x486b40[_0x56fa('0x82')]=_0x440e26[_0x56fa('0x82')];_0x486b40[_0x56fa('0x83')]=_0x440e26[_0x56fa('0x83')];_0x486b40[_0x56fa('0x20')]=!![];_0x486b40[_0x56fa('0x84')]=moment()[_0x56fa('0x4e')](_0x56fa('0x76'));_0x486b40[_0x56fa('0x85')]=_0x56fa('0x86');_0x486b40['lastAssignedTo']=null;logger[_0x56fa('0x7a')](_0x56fa('0x87'),_0x486b40['queue'],_0x486b40['type']);this[_0x56fa('0x3b')][_0x440e26[_0x56fa('0x4d')]]=_0x486b40;this['emitVoiceQueueChannelRemove'](_0x486b40,_0x56fa('0x20'));}}}catch(_0x3c0a88){logger[_0x56fa('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0x440e26[_0x56fa('0x4d')],util[_0x56fa('0x45')](_0x3c0a88,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56fa('0xd')]['syncQueueCallerLeave']=function(_0x202ca0){try{if(this[_0x56fa('0x6f')](_0x202ca0)){logger[_0x56fa('0x53')](_0x56fa('0x88'),_0x202ca0[_0x56fa('0x4d')],util['inspect'](_0x202ca0,{'showHidden':![],'depth':null}));if(this[_0x56fa('0x11')][_0x202ca0[_0x56fa('0x4d')]]){var _0x341c04=_[_0x56fa('0x89')](this['queueReports'][_0x202ca0[_0x56fa('0x4d')]]);_0x341c04[_0x56fa('0x8a')]=moment()[_0x56fa('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x341c04[_0x56fa('0x8b')]=_0x202ca0[_0x56fa('0x8b')];_0x341c04[_0x56fa('0x8c')]=_0x202ca0[_0x56fa('0x8c')];logger[_0x56fa('0x7a')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x341c04[_0x56fa('0x50')],_0x341c04[_0x56fa('0x57')],_0x202ca0[_0x56fa('0x8b')],_0x202ca0[_0x56fa('0x8c')]);this['channels'][_0x202ca0[_0x56fa('0x4d')]]=_0x341c04;this[_0x56fa('0x7e')](_0x341c04,'queuecallerleave');}}}catch(_0x1c1d80){logger[_0x56fa('0x42')](_0x56fa('0x88'),_0x202ca0['uniqueid'],util[_0x56fa('0x45')](_0x1c1d80,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56fa('0xd')][_0x56fa('0x25')]=function(_0x394176){try{if(this['isNotNull'](_0x394176)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x394176['uniqueid'],util[_0x56fa('0x45')](_0x394176,{'showHidden':![],'depth':null}));if(this[_0x56fa('0x11')][_0x394176[_0x56fa('0x4d')]]){var _0x5a9ca8=_[_0x56fa('0x89')](this[_0x56fa('0x11')][_0x394176['uniqueid']]);_0x5a9ca8[_0x56fa('0x80')]=!![];_0x5a9ca8[_0x56fa('0x85')]=_0x56fa('0x8d');logger[_0x56fa('0x7a')](_0x56fa('0x8e'),_0x5a9ca8[_0x56fa('0x50')],_0x5a9ca8[_0x56fa('0x57')]);}}}catch(_0x1704d3){logger[_0x56fa('0x42')](_0x56fa('0x8f'),_0x394176['uniqueid'],util[_0x56fa('0x45')](_0x1704d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56fa('0xd')][_0x56fa('0x24')]=function(_0x161a63){try{if(this[_0x56fa('0x6f')](_0x161a63)){logger['debug'](_0x56fa('0x90'),_0x161a63['uniqueid'],util['inspect'](_0x161a63,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x161a63[_0x56fa('0x4d')]]){var _0x3030a0=_['last'](this[_0x56fa('0x11')][_0x161a63[_0x56fa('0x4d')]]);_0x3030a0[_0x56fa('0x20')]=![];_0x3030a0['queuecallerabandonAt']=null;_0x3030a0['assigned']=!![];_0x3030a0['lastAssignedTo']=_0x161a63[_0x56fa('0x91')];_0x3030a0[_0x56fa('0x82')]=_0x161a63['holdtime'];_0x3030a0[_0x56fa('0x80')]=!![];_0x3030a0[_0x56fa('0x92')]=![];_0x3030a0[_0x56fa('0x93')]=null;if(!_0x3030a0[_0x56fa('0x94')]){if(_0x161a63[_0x56fa('0x95')]==_0x56fa('0x94')){_0x3030a0['queuecallerexitreason']='COMPLETED';logger[_0x56fa('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3030a0['queue'],_0x3030a0[_0x56fa('0x57')]);}else{if(_[_0x56fa('0x96')](_0x161a63[_0x56fa('0x3f')][_0x56fa('0x97')](),_0x56fa('0x98'))){if(this[_0x56fa('0x11')][_0x161a63[_0x56fa('0x99')]]){var _0xd6467=_[_0x56fa('0x89')](this['queueReports'][_0x161a63['linkedid']]);_0xd6467[_0x56fa('0x80')]=![];_0xd6467[_0x56fa('0x92')]=!![];_0xd6467[_0x56fa('0x93')]=moment(_0x3030a0[_0x56fa('0x75')])[_0x56fa('0x9a')](_0x161a63[_0x56fa('0x82')],_0x56fa('0x9b'))['format'](_0x56fa('0x76'));_0xd6467[_0x56fa('0x85')]=_0x56fa('0x9c');_0xd6467['transfer']=!![];_0xd6467[_0x56fa('0x9d')]=_0x56fa('0x9e');_0xd6467[_0x56fa('0x9f')]=_0x161a63[_0x56fa('0xa0')];_0xd6467[_0x56fa('0xa1')]=_0x161a63[_0x56fa('0x4d')];logger[_0x56fa('0x7a')](_0x56fa('0xa2'),_0xd6467[_0x56fa('0x50')],_0xd6467[_0x56fa('0x57')]);var _0x61eedd=this[_0x56fa('0x11')][_0x161a63[_0x56fa('0x99')]];this[_0x56fa('0x11')][_0x161a63[_0x56fa('0x99')]]=this[_0x56fa('0x11')][_0x161a63['uniqueid']];this['queueReports'][_0x161a63[_0x56fa('0x4d')]]=_0x61eedd;}}else{_0x3030a0[_0x56fa('0x85')]=_0x56fa('0xa3')+_0x161a63[_0x56fa('0x95')]['toUpperCase']();logger[_0x56fa('0x7a')](_0x56fa('0xa4'),_0x3030a0['queue'],_0x3030a0[_0x56fa('0x57')],_0x3030a0[_0x56fa('0x85')]);}}}this[_0x56fa('0x3b')][_0x161a63[_0x56fa('0x4d')]]=_0x3030a0;}}}catch(_0x4d7b36){logger[_0x56fa('0x42')](_0x56fa('0x90'),_0x161a63['uniqueid'],util['inspect'](_0x4d7b36,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56fa('0xd')][_0x56fa('0x27')]=function(_0x1011e2){try{if(this[_0x56fa('0x6f')](_0x1011e2)){logger[_0x56fa('0x53')](_0x56fa('0xa5'),_0x1011e2['uniqueid'],util['inspect'](_0x1011e2,{'showHidden':![],'depth':null}));this[_0x56fa('0xa6')](_0x1011e2[_0x56fa('0x4d')],_[_0x56fa('0x7d')](_0x1011e2['variable'])[0x0],_0x1011e2[_0x56fa('0xa7')]);if(this[_0x56fa('0x11')][_0x1011e2[_0x56fa('0x4d')]]){var _0x3b5be5=_[_0x56fa('0x89')](this[_0x56fa('0x11')][_0x1011e2[_0x56fa('0x4d')]]);if(_0x3b5be5){if(this[_0x56fa('0x6f')](_0x1011e2[_0x56fa('0xa8')])&&this['isNotNull'](_0x1011e2[_0x56fa('0xa8')][_0x56fa('0x63')])){switch(_0x1011e2[_0x56fa('0xa7')]){case'CONTINUE':_0x3b5be5[_0x56fa('0x92')]=![];_0x3b5be5[_0x56fa('0x93')]=null;break;case _0x56fa('0xa9'):_0x3b5be5[_0x56fa('0xaa')]=_0x56fa('0xab');_0x3b5be5['queuecallerexit']=!![];_0x3b5be5[_0x56fa('0x93')]=moment()[_0x56fa('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3b5be5['queuecallerleaveAt']=moment()[_0x56fa('0x4e')](_0x56fa('0x76'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1011e2[_0x56fa('0x4d')],util[_0x56fa('0x45')](_0x3b5be5,{'showHidden':![],'depth':null}));ami[_0x56fa('0x4a')](_0x56fa('0xac'),_0x3b5be5);break;default:_0x3b5be5['queuecallerexit']=!![];_0x3b5be5['queuecallerexitAt']=moment()['format'](_0x56fa('0x76'));_0x3b5be5[_0x56fa('0x8a')]=moment()[_0x56fa('0x4e')](_0x56fa('0x76'));}_0x3b5be5[_0x56fa('0x20')]=![];_0x3b5be5['queuecallerabandonAt']=null;_0x3b5be5[_0x56fa('0x85')]=_0x1011e2[_0x56fa('0xa7')];this[_0x56fa('0x3b')][_0x1011e2[_0x56fa('0x4d')]]=_0x3b5be5;this['emitVoiceQueueChannelRemove'](_0x3b5be5,_0x56fa('0x26'));}else if(this[_0x56fa('0x6f')](_0x1011e2[_0x56fa('0xa8')])&&this[_0x56fa('0x6f')](_0x1011e2[_0x56fa('0xa8')]['queueposition'])){if(!_0x3b5be5[_0x56fa('0x20')]){_0x3b5be5[_0x56fa('0x92')]=!![];_0x3b5be5[_0x56fa('0x93')]=moment()[_0x56fa('0x4e')](_0x56fa('0x76'));_0x3b5be5[_0x56fa('0x85')]=_0x56fa('0xad');_0x3b5be5[_0x56fa('0x8a')]=moment()[_0x56fa('0x4e')](_0x56fa('0x76'));this[_0x56fa('0x3b')][_0x1011e2[_0x56fa('0x4d')]]=_0x3b5be5;}}logger[_0x56fa('0x7a')](_0x56fa('0xae'),_0x1011e2[_0x56fa('0x4d')],_0x3b5be5[_0x56fa('0x50')],_0x3b5be5[_0x56fa('0x57')],_[_0x56fa('0x7d')](_0x1011e2[_0x56fa('0xa8')])[0x0],_0x1011e2[_0x56fa('0xa7')]);_0x3b5be5[_0x56fa('0x18')]=this[_0x56fa('0x18')][_0x1011e2[_0x56fa('0x4d')]];}}}}catch(_0x5712ea){logger[_0x56fa('0x42')](_0x56fa('0xa5'),_0x1011e2['uniqueid'],util[_0x56fa('0x45')](_0x5712ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x56fa('0xd')][_0x56fa('0xa6')]=function(_0x42e99d,_0x278e66,_0x5ef55b){var _0x1d40b9=['rtpaudioqos',_0x56fa('0xaf'),_0x56fa('0xb0'),_0x56fa('0xb1'),_0x56fa('0xb2'),_0x56fa('0xb3'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x56fa('0xb4'),_0x56fa('0xb5'),_0x56fa('0xb6'),_0x56fa('0xb7'),_0x56fa('0xb8'),_0x56fa('0xb9'),'memberinterface','memberlastcall',_0x56fa('0x91'),_0x56fa('0xba'),_0x56fa('0xbb')];if(!_[_0x56fa('0x3d')](_0x278e66)&&!_[_0x56fa('0xbc')](_0x1d40b9,_0x278e66)){if(_[_0x56fa('0x5c')](this[_0x56fa('0x18')][_0x42e99d])){this['variables'][_0x42e99d]={};}this[_0x56fa('0x18')][_0x42e99d][_0x278e66]=_0x5ef55b;}};VoiceQueueReport['prototype'][_0x56fa('0xbd')]=function(_0x4567c2,_0x350a4e,_0x559b48){try{var _0x30c649={};if(this[_0x56fa('0x11')][_0x4567c2]){for(var _0x208b24=0x0;_0x208b240x0?!![]:![];if(!_0x49a33c){return this[_0xcf33('0x16')](this[_0xcf33('0x44')][_0xcf33('0x6d')]);}};VoiceQueueReport[_0xcf33('0xa')]['syncQueueMember']=function(_0x244d8b){var _0x5b2d85=this[_0xcf33('0x44')]['id'];if(this[_0xcf33('0x44')][_0xcf33('0x69')][_0x5b2d85]&&this['summary'][_0xcf33('0x69')][_0x5b2d85][_0x244d8b[_0xcf33('0x62')]]){this[_0xcf33('0x44')]['queuestatus'][_0x5b2d85][_0x244d8b[_0xcf33('0x62')]][_0xcf33('0x10')][_0xcf33('0x6e')](_0x244d8b);}};VoiceQueueReport[_0xcf33('0xa')]['syncQueueSummary']=function(_0x2bac4e){var _0xfc7a1d=this;try{if(this[_0xcf33('0x5a')](_0x2bac4e)&&this[_0xcf33('0x5a')](_0x2bac4e[_0xcf33('0x52')])){logger[_0xcf33('0x4f')](_0xcf33('0x6f'),util[_0xcf33('0x3f')](_0x2bac4e,{'showHidden':![],'depth':null}));var _0x1b5baf=this[_0xcf33('0x12')][_0x2bac4e['queue']];if(_0x1b5baf){logger[_0xcf33('0x4f')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x1b5baf['name']);this[_0xcf33('0x44')][_0xcf33('0x5d')][_0x1b5baf[_0xcf33('0x59')]]={'summaryEvent':_0x2bac4e};this[_0xcf33('0x44')][_0xcf33('0x6c')]+=0x1;return ami[_0xcf33('0x38')]({'action':_0xcf33('0x69'),'queue':_0x1b5baf[_0xcf33('0x59')]})[_0xcf33('0x61')](function(_0x1c879d){if(!_0xfc7a1d[_0xcf33('0x44')]['queuestatus'][_0x2bac4e['actionid']]){_0xfc7a1d['summary'][_0xcf33('0x69')][_0x2bac4e[_0xcf33('0x62')]]={};}_0xfc7a1d[_0xcf33('0x44')]['queuestatus'][_0x2bac4e['actionid']][_0x1c879d[_0xcf33('0x62')]]={'queue':_0x1b5baf[_0xcf33('0x59')],'agents':[]};})['catch'](function(_0x52341b){throw _0x52341b;});}}}catch(_0x37b592){logger[_0xcf33('0x3e')]('[voiceQueueReport][queuesummary]',util[_0xcf33('0x3f')](_0x37b592,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x16')]=function(_0x456c25){if(this[_0xcf33('0x44')]['statusRequests']>0x0){this['summary']['completeEvent']=_0x456c25;return;}logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xcf33('0x3f')](_0x456c25,{'showHidden':![],'depth':null}));this[_0xcf33('0x44')]=initializeSummary();ami[_0xcf33('0x47')](_0xcf33('0x70'),{});};VoiceQueueReport[_0xcf33('0xa')]['syncQueueCallerJoin']=function(_0x13ebb4){try{if(this[_0xcf33('0x5a')](_0x13ebb4)){logger['debug'](_0xcf33('0x71'),_0x13ebb4[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x13ebb4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xcf33('0xe')][_0x13ebb4[_0xcf33('0x4a')]])){this[_0xcf33('0xe')][_0x13ebb4[_0xcf33('0x4a')]]=[];}if(_[_0xcf33('0x5b')](this[_0xcf33('0x36')][_0x13ebb4[_0xcf33('0x4a')]])){this[_0xcf33('0x36')][_0x13ebb4[_0xcf33('0x4a')]]={};}var _0x33aae2=new QueueReport();_0x33aae2['queue']=_0x13ebb4[_0xcf33('0x52')];_0x33aae2['type']=this[_0xcf33('0x12')][_0x33aae2['queue']]&&this[_0xcf33('0x12')][_0x33aae2['queue']][_0xcf33('0x56')]?this[_0xcf33('0x12')][_0x33aae2[_0xcf33('0x52')]][_0xcf33('0x56')]||'inbound':_0xcf33('0x57');_0x33aae2[_0xcf33('0x72')]=moment()[_0xcf33('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x33aae2['position']=_0x13ebb4[_0xcf33('0x73')];_0x33aae2[_0xcf33('0x74')]=_0x13ebb4[_0xcf33('0x74')];_0x33aae2[_0xcf33('0x4a')]=_0x13ebb4[_0xcf33('0x4a')];_0x33aae2[_0xcf33('0x75')]=this[_0xcf33('0x36')][_0x13ebb4['uniqueid']][_0xcf33('0x75')];logger[_0xcf33('0x76')](_0xcf33('0x77'),_0x33aae2[_0xcf33('0x52')],_0x33aae2[_0xcf33('0x56')]);Object[_0xcf33('0x68')](_0x33aae2,_[_0xcf33('0x78')](_0x13ebb4,_['keys'](_0x33aae2)));this[_0xcf33('0xe')][_0x13ebb4['uniqueid']]['push'](_0x33aae2);this[_0xcf33('0x36')][_0x13ebb4[_0xcf33('0x4a')]]=_0x33aae2;this[_0xcf33('0x48')](_0x33aae2,'queuecallerjoin');}}catch(_0x4c3e86){logger['error'](_0xcf33('0x71'),_0x13ebb4[_0xcf33('0x4a')],util['inspect'](_0x4c3e86,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x1b')]=function(_0x548c14){try{if(this[_0xcf33('0x5a')](_0x548c14)){logger[_0xcf33('0x4f')](_0xcf33('0x79'),_0x548c14[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x548c14,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0x548c14[_0xcf33('0x4a')]]){var _0x3b936c=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x548c14[_0xcf33('0x4a')]]);_0x3b936c[_0xcf33('0x35')]=![];_0x3b936c[_0xcf33('0x7b')]=null;_0x3b936c[_0xcf33('0x7c')]=_0x548c14[_0xcf33('0x7c')];_0x3b936c[_0xcf33('0x7d')]=_0x548c14['originalposition'];_0x3b936c['queuecallerabandon']=!![];_0x3b936c['queuecallerabandonAt']=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));_0x3b936c[_0xcf33('0x51')]=_0xcf33('0x7f');_0x3b936c[_0xcf33('0x80')]=null;logger[_0xcf33('0x76')](_0xcf33('0x81'),_0x3b936c[_0xcf33('0x52')],_0x3b936c[_0xcf33('0x56')]);this[_0xcf33('0x36')][_0x548c14[_0xcf33('0x4a')]]=_0x3b936c;this[_0xcf33('0x45')](_0x3b936c,_0xcf33('0x1a'));}}}catch(_0x368806){logger[_0xcf33('0x3e')]('[%s][voiceQueueReport][queuecallerabandon]',_0x548c14[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x368806,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5a7410){try{if(this['isNotNull'](_0x5a7410)){logger[_0xcf33('0x4f')](_0xcf33('0x82'),_0x5a7410[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x5a7410,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0x5a7410[_0xcf33('0x4a')]]){var _0x9ae4b4=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x5a7410[_0xcf33('0x4a')]]);_0x9ae4b4[_0xcf33('0x83')]=moment()[_0xcf33('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x9ae4b4['connectedlinenum']=_0x5a7410[_0xcf33('0x84')];_0x9ae4b4['connectedlinename']=_0x5a7410[_0xcf33('0x85')];logger[_0xcf33('0x76')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x9ae4b4[_0xcf33('0x52')],_0x9ae4b4[_0xcf33('0x56')],_0x5a7410[_0xcf33('0x84')],_0x5a7410[_0xcf33('0x85')]);this[_0xcf33('0x36')][_0x5a7410['uniqueid']]=_0x9ae4b4;this['emitVoiceQueueChannelSave'](_0x9ae4b4,_0xcf33('0x1c'));}}}catch(_0x230b22){logger[_0xcf33('0x3e')](_0xcf33('0x82'),_0x5a7410[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x230b22,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x20')]=function(_0x54f62c){try{if(this[_0xcf33('0x5a')](_0x54f62c)){logger[_0xcf33('0x4f')](_0xcf33('0x86'),_0x54f62c[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x54f62c,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0x54f62c['uniqueid']]){var _0x5fa249=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x54f62c[_0xcf33('0x4a')]]);_0x5fa249[_0xcf33('0x35')]=!![];_0x5fa249[_0xcf33('0x51')]=_0xcf33('0x87');logger['info'](_0xcf33('0x88'),_0x5fa249[_0xcf33('0x52')],_0x5fa249['type']);}}}catch(_0x4a7192){logger[_0xcf33('0x3e')](_0xcf33('0x86'),_0x54f62c['uniqueid'],util['inspect'](_0x4a7192,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0x1e')]=function(_0xadfd7f){try{if(this[_0xcf33('0x5a')](_0xadfd7f)){logger[_0xcf33('0x4f')]('[%s][voiceQueueReport][agentcomplete]',_0xadfd7f[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0xadfd7f,{'showHidden':![],'depth':null}));if(this[_0xcf33('0xe')][_0xadfd7f[_0xcf33('0x4a')]]){var _0x2edcd5=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0xadfd7f[_0xcf33('0x4a')]]);_0x2edcd5['queuecallerabandon']=![];_0x2edcd5[_0xcf33('0x89')]=null;_0x2edcd5[_0xcf33('0x8a')]=!![];_0x2edcd5[_0xcf33('0x80')]=_0xadfd7f[_0xcf33('0x8b')];_0x2edcd5['holdtime']=_0xadfd7f['holdtime'];_0x2edcd5[_0xcf33('0x35')]=!![];_0x2edcd5[_0xcf33('0x34')]=![];_0x2edcd5[_0xcf33('0x8c')]=null;if(!_0x2edcd5['transfer']){if(_0xadfd7f[_0xcf33('0x8d')]==_0xcf33('0x8e')){_0x2edcd5[_0xcf33('0x51')]=_0xcf33('0x8f');logger[_0xcf33('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2edcd5['queue'],_0x2edcd5[_0xcf33('0x56')]);}else{if(_[_0xcf33('0x90')](_0xadfd7f['channel'][_0xcf33('0x91')](),'local/')){if(this['queueReports'][_0xadfd7f[_0xcf33('0x92')]]){var _0x454b9d=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0xadfd7f[_0xcf33('0x92')]]);_0x454b9d[_0xcf33('0x35')]=![];_0x454b9d[_0xcf33('0x34')]=!![];_0x454b9d['queuecallerexitAt']=moment(_0x2edcd5[_0xcf33('0x72')])[_0xcf33('0x93')](_0xadfd7f[_0xcf33('0x7c')],'seconds')[_0xcf33('0x4b')](_0xcf33('0x7e'));_0x454b9d[_0xcf33('0x51')]=_0xcf33('0x94');_0x454b9d[_0xcf33('0x8e')]=!![];_0x454b9d[_0xcf33('0x95')]=_0xcf33('0x96');_0x454b9d[_0xcf33('0x97')]=_0xadfd7f['destexten'];_0x454b9d[_0xcf33('0x98')]=_0xadfd7f[_0xcf33('0x4a')];logger[_0xcf33('0x76')](_0xcf33('0x99'),_0x454b9d['queue'],_0x454b9d[_0xcf33('0x56')]);var _0x360845=this['queueReports'][_0xadfd7f['linkedid']];this['queueReports'][_0xadfd7f['linkedid']]=this['queueReports'][_0xadfd7f[_0xcf33('0x4a')]];this['queueReports'][_0xadfd7f[_0xcf33('0x4a')]]=_0x360845;}}else{_0x2edcd5[_0xcf33('0x51')]=_0xcf33('0x9a')+_0xadfd7f[_0xcf33('0x8d')]['toUpperCase']();logger[_0xcf33('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x2edcd5[_0xcf33('0x52')],_0x2edcd5['type'],_0x2edcd5[_0xcf33('0x51')]);}}}this[_0xcf33('0x36')][_0xadfd7f[_0xcf33('0x4a')]]=_0x2edcd5;}}}catch(_0x335ffd){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0xadfd7f['uniqueid'],util[_0xcf33('0x3f')](_0x335ffd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xcf33('0x21')]=function(_0x17252){try{if(this[_0xcf33('0x5a')](_0x17252)){logger[_0xcf33('0x4f')](_0xcf33('0x9b'),_0x17252[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x17252,{'showHidden':![],'depth':null}));this['addVariable'](_0x17252[_0xcf33('0x4a')],_[_0xcf33('0x9c')](_0x17252['variable'])[0x0],_0x17252[_0xcf33('0x9d')]);if(this['queueReports'][_0x17252[_0xcf33('0x4a')]]){var _0x8f2931=_[_0xcf33('0x7a')](this[_0xcf33('0xe')][_0x17252[_0xcf33('0x4a')]]);if(_0x8f2931){if(this['isNotNull'](_0x17252[_0xcf33('0x9e')])&&this[_0xcf33('0x5a')](_0x17252[_0xcf33('0x9e')][_0xcf33('0x69')])){switch(_0x17252[_0xcf33('0x9d')]){case _0xcf33('0x9f'):_0x8f2931[_0xcf33('0x34')]=![];_0x8f2931[_0xcf33('0x8c')]=null;break;case _0xcf33('0xa0'):_0x8f2931['lastevent']=_0xcf33('0xa1');_0x8f2931[_0xcf33('0x34')]=!![];_0x8f2931[_0xcf33('0x8c')]=moment()['format'](_0xcf33('0x7e'));_0x8f2931[_0xcf33('0x83')]=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));logger[_0xcf33('0x4f')](_0xcf33('0xa2'),_0x17252[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x8f2931,{'showHidden':![],'depth':null}));ami[_0xcf33('0x47')](_0xcf33('0xa3'),_0x8f2931);break;default:_0x8f2931['queuecallerexit']=!![];_0x8f2931['queuecallerexitAt']=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));_0x8f2931['queuecallerleaveAt']=moment()[_0xcf33('0x4b')](_0xcf33('0x7e'));}_0x8f2931['queuecallerabandon']=![];_0x8f2931[_0xcf33('0x89')]=null;_0x8f2931[_0xcf33('0x51')]=_0x17252[_0xcf33('0x9d')];this[_0xcf33('0x36')][_0x17252[_0xcf33('0x4a')]]=_0x8f2931;this[_0xcf33('0x45')](_0x8f2931,_0xcf33('0xa4'));}else if(this[_0xcf33('0x5a')](_0x17252['variable'])&&this['isNotNull'](_0x17252[_0xcf33('0x9e')][_0xcf33('0xa5')])){if(!_0x8f2931[_0xcf33('0x1a')]){_0x8f2931[_0xcf33('0x34')]=!![];_0x8f2931['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x8f2931[_0xcf33('0x51')]=_0xcf33('0xa6');_0x8f2931[_0xcf33('0x83')]=moment()[_0xcf33('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcf33('0x36')][_0x17252[_0xcf33('0x4a')]]=_0x8f2931;}}logger[_0xcf33('0x76')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x17252[_0xcf33('0x4a')],_0x8f2931['queue'],_0x8f2931[_0xcf33('0x56')],_['keys'](_0x17252['variable'])[0x0],_0x17252[_0xcf33('0x9d')]);_0x8f2931[_0xcf33('0x40')]=this[_0xcf33('0x40')][_0x17252[_0xcf33('0x4a')]];}}}}catch(_0x4afc61){logger[_0xcf33('0x3e')](_0xcf33('0x9b'),_0x17252[_0xcf33('0x4a')],util[_0xcf33('0x3f')](_0x4afc61,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0xa7')]=function(_0x52f47b,_0x5c86fb,_0x5ae142){var _0x84f7f=['rtpaudioqos',_0xcf33('0xa8'),_0xcf33('0xa9'),_0xcf33('0xaa'),'rtpaudioqosloss',_0xcf33('0xab'),'rtpaudioqosrtt',_0xcf33('0xac'),'sipcallid',_0xcf33('0xad'),_0xcf33('0xae'),'bridgepvtcallid',_0xcf33('0xaf'),_0xcf33('0xb0'),'memberinterface',_0xcf33('0xb1'),_0xcf33('0x8b'),_0xcf33('0xb2'),'memberrealtime'];if(!_[_0xcf33('0x37')](_0x5c86fb)&&!_[_0xcf33('0xb3')](_0x84f7f,_0x5c86fb)){if(_[_0xcf33('0x5b')](this[_0xcf33('0x40')][_0x52f47b])){this[_0xcf33('0x40')][_0x52f47b]={};}this[_0xcf33('0x40')][_0x52f47b][_0x5c86fb]=_0x5ae142;}};VoiceQueueReport[_0xcf33('0xa')][_0xcf33('0xb4')]=function(_0xa38fa6,_0x507065,_0x26ddd5){try{var _0x5ecb2={};if(this['queueReports'][_0xa38fa6]){for(var _0x2be0d9=0x0;_0x2be0d9=0x0?moment(_0x30b762[_0xcc56('0x1a')])[_0xcc56('0x1b')](_0x30b762[_0xcc56('0x19')],'seconds'):null,'data1':_0xcc56('0x1d'),'data2':_0x30b762[_0xcc56('0x14')],'data3':_0x30b762[_0xcc56('0x11')],'data4':_0x30b762[_0xcc56('0x1e')]||null,'role':_0xcc56('0x13'),'internal':_0x30b762[_0xcc56('0x14')]?_['toNumber'](_0x30b762[_0xcc56('0x14')]):undefined,'uniqueid':_0x30b762[_0xcc56('0x1f')]},'log':_0xcc56('0x7')});}; \ No newline at end of file +var _0x67c1=['outbound','dialstring','toNumber','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime'];(function(_0xfcf66a,_0x1d16d5){var _0x1f29a7=function(_0x33954c){while(--_0x33954c){_0xfcf66a['push'](_0xfcf66a['shift']());}};_0x1f29a7(++_0x1d16d5);}(_0x67c1,0x177));var _0x167c=function(_0x339760,_0x21e51a){_0x339760=_0x339760-0x0;var _0x522e5f=_0x67c1[_0x339760];return _0x522e5f;};'use strict';var moment=require('moment');var _=require(_0x167c('0x0'));var util=require(_0x167c('0x1'));var client=require(_0x167c('0x2'));exports[_0x167c('0x3')]=function(_0x4c123d){var _0x4e7008=_0x4c123d[_0x167c('0x4')]||_0x4c123d[_0x167c('0x5')];return client[_0x167c('0x6')](_0x167c('0x7'),{'body':{'channel':_0x167c('0x8'),'membername':_0x4c123d[_0x167c('0x9')],'interface':_[_0x167c('0xa')](_0x4c123d[_0x167c('0xb')])?util[_0x167c('0xc')](_0x167c('0xd'),_0x4c123d[_0x167c('0x9')]):_0x4c123d['interface'],'type':_0x167c('0xe'),'enterAt':_0x4c123d['queuecallerleaveAt'],'exitAt':_0x4e7008,'duration':moment(_0x4e7008)[_0x167c('0xf')](_0x4c123d[_0x167c('0x10')],_0x167c('0x11')),'data1':_0x167c('0x12'),'data2':_0x4c123d[_0x167c('0x13')],'data3':_0x4c123d[_0x167c('0x14')],'data4':null,'data5':_0x4c123d['queue'],'role':_0x167c('0x15'),'internal':_0x4c123d[_0x167c('0x16')]?_['toNumber'](_0x4c123d['accountcode']):undefined,'uniqueid':_0x4c123d[_0x167c('0x17')]},'log':_0x167c('0x7')});};exports[_0x167c('0x18')]=function(_0x414a62){return client[_0x167c('0x6')](_0x167c('0x7'),{'body':{'channel':'voice','membername':_0x414a62[_0x167c('0x19')],'interface':_0x414a62['interface'],'type':_0x167c('0xe'),'enterAt':_0x414a62[_0x167c('0x1a')],'exitAt':_0x414a62[_0x167c('0x1b')],'duration':moment(_0x414a62[_0x167c('0x1b')])[_0x167c('0xf')](_0x414a62[_0x167c('0x1a')],_0x167c('0x11'))>=0x0?moment(_0x414a62['endtime'])[_0x167c('0xf')](_0x414a62[_0x167c('0x1a')],_0x167c('0x11')):null,'data1':_0x167c('0x1c'),'data2':_0x414a62[_0x167c('0x16')],'data3':_0x414a62[_0x167c('0x14')],'data4':_0x414a62[_0x167c('0x1d')]||null,'role':_0x167c('0x15'),'internal':_0x414a62[_0x167c('0x16')]?_[_0x167c('0x1e')](_0x414a62['accountcode']):undefined,'uniqueid':_0x414a62[_0x167c('0x17')]},'log':_0x167c('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 86fee05..e1674e4 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 _0x8ba6=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','Request'];(function(_0x42498f,_0x48186c){var _0x1a7382=function(_0x5ccebb){while(--_0x5ccebb){_0x42498f['push'](_0x42498f['shift']());}};_0x1a7382(++_0x48186c);}(_0x8ba6,0x11b));var _0x68ba=function(_0xdbb707,_0x31c33c){_0xdbb707=_0xdbb707-0x0;var _0xfc5508=_0x8ba6[_0xdbb707];return _0xfc5508;};'use strict';var client=require(_0x68ba('0x0'));exports['getSettings']=function(){return client[_0x68ba('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x68ba('0x2'),_0x68ba('0x3')]},'log':_0x68ba('0x4')});}; \ No newline at end of file +var _0x4b20=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x2ebceb,_0x300449){var _0x5e28c0=function(_0x454df1){while(--_0x454df1){_0x2ebceb['push'](_0x2ebceb['shift']());}};_0x5e28c0(++_0x300449);}(_0x4b20,0x116));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x04b2('0x0'));exports[_0x04b2('0x1')]=function(){return client[_0x04b2('0x2')](_0x04b2('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x04b2('0x4'),_0x04b2('0x5')]},'log':_0x04b2('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index d2edc44..ddf9bba 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 _0xf5fe=['../client','getTemplates','Request','name','html','GetTemplate'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xf5fe,0x1da));var _0xef5f=function(_0x467599,_0x10804a){_0x467599=_0x467599-0x0;var _0x4ae44c=_0xf5fe[_0x467599];return _0x4ae44c;};'use strict';var client=require(_0xef5f('0x0'));exports[_0xef5f('0x1')]=function(_0x23606a){return function(_0x1a61a6){return client[_0xef5f('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xef5f('0x3'),_0xef5f('0x4')]},'log':_0xef5f('0x5')});};}; \ No newline at end of file +var _0xf6c1=['html','../client','GetTemplate','name'];(function(_0x157873,_0x192c4e){var _0x137f3d=function(_0x36f0ce){while(--_0x36f0ce){_0x157873['push'](_0x157873['shift']());}};_0x137f3d(++_0x192c4e);}(_0xf6c1,0x149));var _0x1f6c=function(_0x1c7f00,_0xa8c7e0){_0x1c7f00=_0x1c7f00-0x0;var _0x34be95=_0xf6c1[_0x1c7f00];return _0x34be95;};'use strict';var client=require(_0x1f6c('0x0'));exports['getTemplates']=function(_0x4a4c95){return function(_0x28a29e){return client['Request'](_0x1f6c('0x1'),{'options':{'raw':!![],'attributes':['id',_0x1f6c('0x2'),_0x1f6c('0x3')]},'log':_0x1f6c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 1215def..542320e 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 _0xd67f=['GetTrigger','name','channel','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data2','data3','data4','data5','data6','../client','Request'];(function(_0x57e019,_0x108434){var _0x419297=function(_0x492a3f){while(--_0x492a3f){_0x57e019['push'](_0x57e019['shift']());}};_0x419297(++_0x108434);}(_0xd67f,0x1a0));var _0xfd67=function(_0x2104a5,_0x268e07){_0x2104a5=_0x2104a5-0x0;var _0x45c970=_0xd67f[_0x2104a5];return _0x45c970;};'use strict';var client=require(_0xfd67('0x0'));exports['getTriggers']=function(_0x1ae1e7){return function(_0x23a881){return client[_0xfd67('0x1')](_0xfd67('0x2'),{'options':{'raw':![],'attributes':['id',_0xfd67('0x3'),_0xfd67('0x4'),'status'],'include':[{'model':'Condition','as':_0xfd67('0x5'),'attributes':['id','field',_0xfd67('0x6'),_0xfd67('0x7')]},{'model':'Condition','as':_0xfd67('0x8'),'attributes':['id',_0xfd67('0x9'),_0xfd67('0x6'),_0xfd67('0x7')]},{'model':_0xfd67('0xa'),'as':_0xfd67('0xb'),'attributes':['id',_0xfd67('0xc'),_0xfd67('0xd'),_0xfd67('0xe'),_0xfd67('0xf'),_0xfd67('0x10'),_0xfd67('0x11'),_0xfd67('0x12'),'data7']}]},'log':_0xfd67('0x2')});};}; \ No newline at end of file +var _0xdc28=['GetTrigger','name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','action','data1','data2','data4','data5','data7','../client','getTriggers','Request'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0xdc28,0x166));var _0x8dc2=function(_0x2060a2,_0x5b190b){_0x2060a2=_0x2060a2-0x0;var _0x2aeeee=_0xdc28[_0x2060a2];return _0x2aeeee;};'use strict';var client=require(_0x8dc2('0x0'));exports[_0x8dc2('0x1')]=function(_0x5828d6){return function(_0x559e0d){return client[_0x8dc2('0x2')](_0x8dc2('0x3'),{'options':{'raw':![],'attributes':['id',_0x8dc2('0x4'),_0x8dc2('0x5'),'status'],'include':[{'model':_0x8dc2('0x6'),'as':_0x8dc2('0x7'),'attributes':['id','field',_0x8dc2('0x8'),_0x8dc2('0x9')]},{'model':_0x8dc2('0x6'),'as':_0x8dc2('0xa'),'attributes':['id',_0x8dc2('0xb'),_0x8dc2('0x8'),_0x8dc2('0x9')]},{'model':_0x8dc2('0xc'),'as':'Actions','attributes':['id',_0x8dc2('0xd'),_0x8dc2('0xe'),_0x8dc2('0xf'),'data3',_0x8dc2('0x10'),_0x8dc2('0x11'),'data6',_0x8dc2('0x12')]}]},'log':_0x8dc2('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index d0037c2..d1ed3df 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 _0x98d3=['defaultuser','../client','getTrunks','GetTrunk','registry'];(function(_0x4f72a3,_0xa2faeb){var _0x126a73=function(_0x755da4){while(--_0x755da4){_0x4f72a3['push'](_0x4f72a3['shift']());}};_0x126a73(++_0xa2faeb);}(_0x98d3,0x173));var _0x398d=function(_0x2e1f11,_0x2e454d){_0x2e1f11=_0x2e1f11-0x0;var _0x11d005=_0x98d3[_0x2e1f11];return _0x11d005;};'use strict';var client=require(_0x398d('0x0'));exports[_0x398d('0x1')]=function(_0x58c1f9){return function(_0x35bbe1){return client['Request'](_0x398d('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x398d('0x3'),_0x398d('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x5329=['registry','getTrunks','Request','GetTrunk','name'];(function(_0x532b24,_0x7bb352){var _0x443122=function(_0x1c6f70){while(--_0x1c6f70){_0x532b24['push'](_0x532b24['shift']());}};_0x443122(++_0x7bb352);}(_0x5329,0xab));var _0x9532=function(_0x164bf3,_0x5473c2){_0x164bf3=_0x164bf3-0x0;var _0x97fe6f=_0x5329[_0x164bf3];return _0x97fe6f;};'use strict';var client=require('../client');exports[_0x9532('0x0')]=function(_0xc9aa42){return function(_0x295436){return client[_0x9532('0x1')](_0x9532('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9532('0x3'),_0x9532('0x4'),'defaultuser']},'log':_0x9532('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index bce8539..369c3c9 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 _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(_0x4e35a2,_0x4bd134){var _0x24def6=function(_0x2bb4bd){while(--_0x2bb4bd){_0x4e35a2['push'](_0x4e35a2['shift']());}};_0x24def6(++_0x4bd134);}(_0x34e8,0x12c));var _0x834e=function(_0x263eb8,_0x1aa925){_0x263eb8=_0x263eb8-0x0;var _0x284802=_0x34e8[_0x263eb8];return _0x284802;};'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 +var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 1dba29d..d4fbf9e 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 _0xd119=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x5848a7,_0x1decea){var _0x5b32e2=function(_0x34b72d){while(--_0x34b72d){_0x5848a7['push'](_0x5848a7['shift']());}};_0x5b32e2(++_0x1decea);}(_0xd119,0xd2));var _0x9d11=function(_0x19c5f2,_0x44ed13){_0x19c5f2=_0x19c5f2-0x0;var _0xb94caf=_0xd119[_0x19c5f2];return _0xb94caf;};'use strict';var client=require(_0x9d11('0x0'));exports[_0x9d11('0x1')]=function(_0x45b4a6){return client[_0x9d11('0x2')](_0x9d11('0x3'),{'body':_0x45b4a6,'log':_0x9d11('0x3')});};exports[_0x9d11('0x4')]=function(_0x20f050,_0x255eb1,_0x11660d){return client[_0x9d11('0x2')]('UpdateVoiceAgentReport',{'body':_0x20f050,'options':{'where':{'uniqueid':_0x255eb1,'interface':_0x11660d,'agentcomplete':!![]}},'log':_0x9d11('0x5')});}; \ No newline at end of file +var _0xca4d=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xca4d,0x9a));var _0xdca4=function(_0x572492,_0x4cbe56){_0x572492=_0x572492-0x0;var _0x12987a=_0xca4d[_0x572492];return _0x12987a;};'use strict';var client=require('../client');exports[_0xdca4('0x0')]=function(_0x425b3d){return client['Request'](_0xdca4('0x1'),{'body':_0x425b3d,'log':_0xdca4('0x1')});};exports['update']=function(_0x4605c7,_0x556268,_0x3dd7c0){return client['Request'](_0xdca4('0x2'),{'body':_0x4605c7,'options':{'where':{'uniqueid':_0x556268,'interface':_0x3dd7c0,'agentcomplete':!![]}},'log':_0xdca4('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 7a9525c..0d991c5 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 _0xf0ba=['disposition','duration','util','lodash','create','Request','merge','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type'];(function(_0x432821,_0x3b1d70){var _0x552583=function(_0x2f226f){while(--_0x2f226f){_0x432821['push'](_0x432821['shift']());}};_0x552583(++_0x3b1d70);}(_0xf0ba,0x110));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var util=require(_0xaf0b('0x0'));var _=require(_0xaf0b('0x1'));var client=require('../client');exports[_0xaf0b('0x2')]=function(_0x54b79f){return client[_0xaf0b('0x3')]('CreateVoiceCallReport',{'body':_[_0xaf0b('0x4')](_0x54b79f,{'source':_0x54b79f['calleridnum'],'destinationcontext':_0x54b79f['context'],'callerid':_0x54b79f[_0xaf0b('0x5')],'amaflags':_0xaf0b('0x6')}),'log':_0xaf0b('0x7')});};exports[_0xaf0b('0x8')]=function(){return function(){return client[_0xaf0b('0x3')](_0xaf0b('0x9'),{'options':{'where':{'type':[_0xaf0b('0xa')],'createdAt':{'$between':[moment()['startOf']('day')[_0xaf0b('0xb')](_0xaf0b('0xc')),moment()[_0xaf0b('0xd')](_0xaf0b('0xe'))['format'](_0xaf0b('0xc'))]}},'attributes':[_0xaf0b('0xf'),_0xaf0b('0x10'),_0xaf0b('0x11'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x3e12=['Request','CreateVoiceCallReport','calleridnum','context','callerid','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','moment','util','../client','create'];(function(_0x37986a,_0x240bda){var _0x85ace7=function(_0x7a783d){while(--_0x7a783d){_0x37986a['push'](_0x37986a['shift']());}};_0x85ace7(++_0x240bda);}(_0x3e12,0xc2));var _0x23e1=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x3e12[_0x2a2166];return _0x3bcf50;};'use strict';var moment=require(_0x23e1('0x0'));var util=require(_0x23e1('0x1'));var _=require('lodash');var client=require(_0x23e1('0x2'));exports[_0x23e1('0x3')]=function(_0x5590b7){return client[_0x23e1('0x4')](_0x23e1('0x5'),{'body':_['merge'](_0x5590b7,{'source':_0x5590b7[_0x23e1('0x6')],'destinationcontext':_0x5590b7[_0x23e1('0x7')],'callerid':_0x5590b7[_0x23e1('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x23e1('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x23e1('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x23e1('0x9')],'createdAt':{'$between':[moment()[_0x23e1('0xa')](_0x23e1('0xb'))[_0x23e1('0xc')](_0x23e1('0xd')),moment()[_0x23e1('0xe')](_0x23e1('0xb'))['format'](_0x23e1('0xd'))]}},'attributes':['type',_0x23e1('0xf'),_0x23e1('0x10'),_0x23e1('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index eb5f850..f5f82a6 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 _0xdeeb=['CreateVoiceDialReport','create','Request'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0xdeeb,0x1d2));var _0xbdee=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xdeeb[_0x16771d];return _0x386f11;};'use strict';var client=require('../client');exports[_0xbdee('0x0')]=function(_0x36268a){return client[_0xbdee('0x1')](_0xbdee('0x2'),{'body':_0x36268a,'log':_0xbdee('0x2')});}; \ No newline at end of file +var _0x3970=['create','Request','CreateVoiceDialReport','../client'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0x3970,0x147));var _0x0397=function(_0x38fb8b,_0x70dd0a){_0x38fb8b=_0x38fb8b-0x0;var _0x1ec681=_0x3970[_0x38fb8b];return _0x1ec681;};'use strict';var client=require(_0x0397('0x0'));exports[_0x0397('0x1')]=function(_0x4adb46){return client[_0x0397('0x2')]('CreateVoiceDialReport',{'body':_0x4adb46,'log':_0x0397('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5d6e38b..5501d9c 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 _0xde9d=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xde9d,0x156));var _0xdde9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde9d[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xdde9('0x0'));exports[_0xdde9('0x1')]=function(){return function(){return client[_0xdde9('0x2')](_0xdde9('0x3'),{'options':{'raw':!![],'attributes':['id',_0xdde9('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xdde9('0x1')});};}; \ No newline at end of file +var _0x6ea9=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x56eb89,_0xa70f63){var _0x237f9d=function(_0xee35df){while(--_0xee35df){_0x56eb89['push'](_0x56eb89['shift']());}};_0x237f9d(++_0xa70f63);}(_0x6ea9,0x89));var _0x96ea=function(_0xa859a2,_0x4beb72){_0xa859a2=_0xa859a2-0x0;var _0x2d796c=_0x6ea9[_0xa859a2];return _0x2d796c;};'use strict';var client=require(_0x96ea('0x0'));exports[_0x96ea('0x1')]=function(){return function(){return client[_0x96ea('0x2')](_0x96ea('0x3'),{'options':{'raw':!![],'attributes':['id',_0x96ea('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x96ea('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index d480d7b..84eb9e1 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 _0xa9ae=['callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','monitor_format','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialQueueOptions','dialQueueTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup'];(function(_0x3236be,_0x47eb9b){var _0x40a904=function(_0x14301c){while(--_0x14301c){_0x3236be['push'](_0x3236be['shift']());}};_0x40a904(++_0x47eb9b);}(_0xa9ae,0x193));var _0xea9a=function(_0x34cf4a,_0x5605fd){_0x34cf4a=_0x34cf4a-0x0;var _0x4339b2=_0xa9ae[_0x34cf4a];return _0x4339b2;};'use strict';var client=require(_0xea9a('0x0'));exports[_0xea9a('0x1')]=function(){return function(){return client[_0xea9a('0x2')](_0xea9a('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xea9a('0x4'),_0xea9a('0x5'),'autopause',_0xea9a('0x6'),_0xea9a('0x7'),_0xea9a('0x8'),'dialMethod','dialLimitChannel',_0xea9a('0x9'),_0xea9a('0xa'),_0xea9a('0xb'),_0xea9a('0xc'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout',_0xea9a('0xd'),_0xea9a('0xe'),'dialQueueProject','dialCongestionMaxRetry',_0xea9a('0xf'),_0xea9a('0x10'),_0xea9a('0x11'),'dialNoAnswerMaxRetry',_0xea9a('0x12'),'dialGlobalMaxRetry',_0xea9a('0x13'),_0xea9a('0x14'),_0xea9a('0x15'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0xea9a('0x16'),_0xea9a('0x17'),_0xea9a('0x18'),_0xea9a('0x19'),_0xea9a('0x1a'),_0xea9a('0x1b'),'dialAMDSilenceThreshold',_0xea9a('0x1c'),_0xea9a('0x1d'),_0xea9a('0x1e'),_0xea9a('0x1f'),_0xea9a('0x20'),_0xea9a('0x21'),_0xea9a('0x22'),'dialQueueProject2',_0xea9a('0x6'),_0xea9a('0x23'),'dialRandomLastDigitCallerIdNumber',_0xea9a('0x24'),_0xea9a('0x25'),_0xea9a('0x26'),'dialDropMaxRetry',_0xea9a('0x27'),_0xea9a('0x28'),_0xea9a('0x29'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0xea9a('0x2a'),_0xea9a('0x2b'),'mandatoryDisposition',_0xea9a('0x2c'),_0xea9a('0x2d'),_0xea9a('0x2e'),'dialPreviewRecallmeReminder'],'include':[{'model':_0xea9a('0x2f'),'as':_0xea9a('0x2f'),'attributes':['id',_0xea9a('0x30'),'callerid',_0xea9a('0x31')]},{'model':_0xea9a('0x32'),'as':_0xea9a('0x33'),'attributes':['id',_0xea9a('0x30')]},{'model':_0xea9a('0x2f'),'as':_0xea9a('0x34'),'attributes':['id',_0xea9a('0x30'),_0xea9a('0x35'),_0xea9a('0x31')]},{'model':'Interval','as':_0xea9a('0x36'),'attributes':['id',_0xea9a('0x30')],'include':[{'model':_0xea9a('0x36'),'as':_0xea9a('0x37'),'attributes':['id','name',_0xea9a('0x38')]}]}]},'log':_0xea9a('0x1')});};}; \ No newline at end of file +var _0x0884=['dialPreviewAutoRecallMe','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','Interval','getVoiceQueues','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold'];(function(_0x4ebe67,_0x3b8559){var _0x2ece89=function(_0xf7d805){while(--_0xf7d805){_0x4ebe67['push'](_0x4ebe67['shift']());}};_0x2ece89(++_0x3b8559);}(_0x0884,0x1cf));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x4088('0x0')]=function(){return function(){return client['Request'](_0x4088('0x1'),{'options':{'raw':![],'attributes':['id',_0x4088('0x2'),'acw',_0x4088('0x3'),_0x4088('0x4'),_0x4088('0x5'),'type','dialActive',_0x4088('0x6'),_0x4088('0x7'),_0x4088('0x8'),'dialPowerLevel',_0x4088('0x9'),_0x4088('0xa'),_0x4088('0xb'),_0x4088('0xc'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0x4088('0xd'),'dialQueueTimeout','dialQueueProject',_0x4088('0xe'),_0x4088('0xf'),'dialBusyMaxRetry',_0x4088('0x10'),_0x4088('0x11'),_0x4088('0x12'),_0x4088('0x13'),_0x4088('0x14'),_0x4088('0x15'),_0x4088('0x16'),_0x4088('0x17'),_0x4088('0x18'),_0x4088('0x19'),_0x4088('0x1a'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x4088('0x1b'),_0x4088('0x1c'),_0x4088('0x1d'),_0x4088('0x1e'),_0x4088('0x1f'),_0x4088('0x20'),_0x4088('0x21'),_0x4088('0x22'),'dialOrderByScheduledAt',_0x4088('0x23'),_0x4088('0x24'),_0x4088('0x25'),_0x4088('0x5'),_0x4088('0x26'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x4088('0x27'),_0x4088('0x28'),_0x4088('0x29'),'dialDropRetryFrequency',_0x4088('0x2a'),_0x4088('0x2b'),_0x4088('0x2c'),_0x4088('0x2d'),_0x4088('0x2e'),_0x4088('0x2f'),_0x4088('0x30'),_0x4088('0x31'),'dialPredictiveIntervalMinThreshold',_0x4088('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':_0x4088('0x33'),'as':_0x4088('0x33'),'attributes':['id',_0x4088('0x2'),_0x4088('0x34'),'active']},{'model':_0x4088('0x35'),'as':_0x4088('0x36'),'attributes':['id',_0x4088('0x2')]},{'model':_0x4088('0x33'),'as':_0x4088('0x37'),'attributes':['id',_0x4088('0x2'),_0x4088('0x34'),'active']},{'model':_0x4088('0x38'),'as':_0x4088('0x38'),'attributes':['id',_0x4088('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x4088('0x2'),'interval']}]}]},'log':_0x4088('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 0e5beb2..7051582 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(_0x17835f,_0x58d892){var _0x1b6426=function(_0x212f46){while(--_0x212f46){_0x17835f['push'](_0x17835f['shift']());}};_0x1b6426(++_0x58d892);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x5cb6af,_0x5c42e3){var _0x2b27e0=function(_0x33ab3a){while(--_0x33ab3a){_0x5cb6af['push'](_0x5cb6af['shift']());}};_0x2b27e0(++_0x5c42e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 12cfad4..54529bc 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 _0xe169=['getVoiceQueueRtPauses','../client','Request','GetVoiceQueueRtPauses'];(function(_0x330821,_0x1e53f1){var _0x2aa30c=function(_0x3680ff){while(--_0x3680ff){_0x330821['push'](_0x330821['shift']());}};_0x2aa30c(++_0x1e53f1);}(_0xe169,0x10d));var _0x9e16=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe169[_0x4b369d];return _0x571a98;};'use strict';var client=require(_0x9e16('0x0'));exports['getVoiceQueueRtPauses']=function(_0x35a023){return function(){return client[_0x9e16('0x1')](_0x9e16('0x2'),{'options':{'where':{'VoiceQueueId':_0x35a023,'paused':!![]},'raw':!![]},'log':_0x9e16('0x3')});};}; \ No newline at end of file +var _0xb4d2=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x33723d,_0x4b74b0){var _0x13f7bc=function(_0x4a3a50){while(--_0x4a3a50){_0x33723d['push'](_0x33723d['shift']());}};_0x13f7bc(++_0x4b74b0);}(_0xb4d2,0x6a));var _0x2b4d=function(_0x33705b,_0x27d6c4){_0x33705b=_0x33705b-0x0;var _0x55b837=_0xb4d2[_0x33705b];return _0x55b837;};'use strict';var client=require('../client');exports[_0x2b4d('0x0')]=function(_0xfdc9e5){return function(){return client[_0x2b4d('0x1')](_0x2b4d('0x2'),{'options':{'where':{'VoiceQueueId':_0xfdc9e5,'paused':!![]},'raw':!![]},'log':_0x2b4d('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index f63946f..b0845fb 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2146d9,_0x50cab5){var _0x5ed8dc=function(_0x3c58e3){while(--_0x3c58e3){_0x2146d9['push'](_0x2146d9['shift']());}};_0x5ed8dc(++_0x50cab5);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x468c8f,_0x3ac2c4){var _0x30d3af=function(_0x56d3c7){while(--_0x56d3c7){_0x468c8f['push'](_0x468c8f['shift']());}};_0x30d3af(++_0x3ac2c4);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index df67c13..fd05ac1 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 _0x9472=['origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','attendedTransfer','Request'];(function(_0x495560,_0xde54bf){var _0x319c9d=function(_0xfb14fb){while(--_0xfb14fb){_0x495560['push'](_0x495560['shift']());}};_0x319c9d(++_0xde54bf);}(_0x9472,0x89));var _0x2947=function(_0x4cef44,_0x140814){_0x4cef44=_0x4cef44-0x0;var _0x22b699=_0x9472[_0x4cef44];return _0x22b699;};'use strict';var client=require(_0x2947('0x0'));exports[_0x2947('0x1')]={};exports['blindTransfer']=function(_0x4e655d){return client['Request'](_0x2947('0x2'),{'body':{'result':_0x4e655d[_0x2947('0x3')],'transfererchannel':_0x4e655d['transfererchannel'],'transferercalleridnum':_0x4e655d['transferercalleridnum'],'transferercalleridname':_0x4e655d[_0x2947('0x4')],'transfererconnectedlinenum':_0x4e655d[_0x2947('0x5')],'transfererconnectedlinename':_0x4e655d[_0x2947('0x6')],'transfereraccountcode':_0x4e655d[_0x2947('0x7')],'transferercontext':_0x4e655d[_0x2947('0x8')],'transfererexten':_0x4e655d[_0x2947('0x9')],'transfererlinkedid':_0x4e655d[_0x2947('0xa')],'transfereechannel':_0x4e655d[_0x2947('0xb')],'transfereecalleridnum':_0x4e655d[_0x2947('0xc')],'transfereecalleridname':_0x4e655d[_0x2947('0xd')],'transfereeconnectedlinenum':_0x4e655d[_0x2947('0xe')],'transfereeconnectedlinename':_0x4e655d['transfereeconnectedlinename'],'transfereeaccountcode':_0x4e655d[_0x2947('0xf')],'transfereecontext':_0x4e655d[_0x2947('0x10')],'transfereeexten':_0x4e655d[_0x2947('0x11')],'transfereelinkedid':_0x4e655d[_0x2947('0x12')],'isexternal':_0x4e655d[_0x2947('0x13')],'context':_0x4e655d['context'],'extension':_0x4e655d[_0x2947('0x14')],'type':'blind'},'log':_0x2947('0x2')});};exports[_0x2947('0x15')]=function(_0x56a7e6){return client[_0x2947('0x16')](_0x2947('0x2'),{'body':{'result':_0x56a7e6['result'],'transfererchannel':_0x56a7e6[_0x2947('0x17')],'transferercalleridnum':_0x56a7e6[_0x2947('0x18')],'transferercalleridname':_0x56a7e6[_0x2947('0x19')],'transfererconnectedlinenum':_0x56a7e6[_0x2947('0x1a')],'transfererconnectedlinename':_0x56a7e6[_0x2947('0x1b')],'transfereraccountcode':_0x56a7e6[_0x2947('0x1c')],'transferercontext':_0x56a7e6[_0x2947('0x1d')],'transfererexten':_0x56a7e6[_0x2947('0x1e')],'transfererlinkedid':_0x56a7e6[_0x2947('0x1f')],'transfereechannel':_0x56a7e6[_0x2947('0x20')],'transfereecalleridnum':_0x56a7e6[_0x2947('0x21')],'transfereecalleridname':_0x56a7e6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x56a7e6['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x56a7e6['transfertargetconnectedlinename'],'transfereeaccountcode':_0x56a7e6[_0x2947('0x22')],'transfereecontext':_0x56a7e6[_0x2947('0x23')],'transfereeexten':_0x56a7e6[_0x2947('0x24')],'transfereelinkedid':_0x56a7e6[_0x2947('0x25')],'isexternal':_0x56a7e6[_0x2947('0x13')],'context':_0x56a7e6[_0x2947('0x26')],'extension':_0x56a7e6['origtransfererexten'],'type':_0x2947('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xea43=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridname'];(function(_0x1721d3,_0x37c184){var _0xed4e63=function(_0x8b3b8a){while(--_0x8b3b8a){_0x1721d3['push'](_0x1721d3['shift']());}};_0xed4e63(++_0x37c184);}(_0xea43,0x16f));var _0x3ea4=function(_0x17c1ac,_0xac6ad6){_0x17c1ac=_0x17c1ac-0x0;var _0x517769=_0xea43[_0x17c1ac];return _0x517769;};'use strict';var client=require(_0x3ea4('0x0'));exports[_0x3ea4('0x1')]={};exports[_0x3ea4('0x2')]=function(_0x4f6d86){return client[_0x3ea4('0x3')](_0x3ea4('0x4'),{'body':{'result':_0x4f6d86['result'],'transfererchannel':_0x4f6d86['transfererchannel'],'transferercalleridnum':_0x4f6d86[_0x3ea4('0x5')],'transferercalleridname':_0x4f6d86['transferercalleridname'],'transfererconnectedlinenum':_0x4f6d86[_0x3ea4('0x6')],'transfererconnectedlinename':_0x4f6d86['transfererconnectedlinename'],'transfereraccountcode':_0x4f6d86[_0x3ea4('0x7')],'transferercontext':_0x4f6d86[_0x3ea4('0x8')],'transfererexten':_0x4f6d86[_0x3ea4('0x9')],'transfererlinkedid':_0x4f6d86[_0x3ea4('0xa')],'transfereechannel':_0x4f6d86['transfereechannel'],'transfereecalleridnum':_0x4f6d86[_0x3ea4('0xb')],'transfereecalleridname':_0x4f6d86['transfereecalleridname'],'transfereeconnectedlinenum':_0x4f6d86['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4f6d86[_0x3ea4('0xc')],'transfereeaccountcode':_0x4f6d86[_0x3ea4('0xd')],'transfereecontext':_0x4f6d86['transfereecontext'],'transfereeexten':_0x4f6d86[_0x3ea4('0xe')],'transfereelinkedid':_0x4f6d86[_0x3ea4('0xf')],'isexternal':_0x4f6d86[_0x3ea4('0x10')],'context':_0x4f6d86[_0x3ea4('0x11')],'extension':_0x4f6d86['extension'],'type':'blind'},'log':_0x3ea4('0x4')});};exports[_0x3ea4('0x12')]=function(_0x1a672c){return client[_0x3ea4('0x3')](_0x3ea4('0x4'),{'body':{'result':_0x1a672c['result'],'transfererchannel':_0x1a672c[_0x3ea4('0x13')],'transferercalleridnum':_0x1a672c[_0x3ea4('0x14')],'transferercalleridname':_0x1a672c[_0x3ea4('0x15')],'transfererconnectedlinenum':_0x1a672c[_0x3ea4('0x16')],'transfererconnectedlinename':_0x1a672c[_0x3ea4('0x17')],'transfereraccountcode':_0x1a672c[_0x3ea4('0x18')],'transferercontext':_0x1a672c[_0x3ea4('0x19')],'transfererexten':_0x1a672c[_0x3ea4('0x1a')],'transfererlinkedid':_0x1a672c[_0x3ea4('0x1b')],'transfereechannel':_0x1a672c['transfertargetchannel'],'transfereecalleridnum':_0x1a672c['transfertargetcalleridnum'],'transfereecalleridname':_0x1a672c[_0x3ea4('0x1c')],'transfereeconnectedlinenum':_0x1a672c[_0x3ea4('0x1d')],'transfereeconnectedlinename':_0x1a672c[_0x3ea4('0x1e')],'transfereeaccountcode':_0x1a672c[_0x3ea4('0x1f')],'transfereecontext':_0x1a672c[_0x3ea4('0x20')],'transfereeexten':_0x1a672c['transfertargetexten'],'transfereelinkedid':_0x1a672c['transfertargetlinkedid'],'isexternal':_0x1a672c[_0x3ea4('0x10')],'context':_0x1a672c[_0x3ea4('0x21')],'extension':_0x1a672c[_0x3ea4('0x22')],'type':_0x3ea4('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 9d17920..f587292 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(_0x128f54,_0x92ec19){var _0x575c7e=function(_0x1fc4cb){while(--_0x1fc4cb){_0x128f54['push'](_0x128f54['shift']());}};_0x575c7e(++_0x92ec19);}(_0xb10b,0x12a));var _0xbb10=function(_0x57d500,_0xf52c67){_0x57d500=_0x57d500-0x0;var _0x142c14=_0xb10b[_0x57d500];return _0x142c14;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x135ed1,_0x5de0c5){var _0x2c3f0d=function(_0x5102d1){while(--_0x5102d1){_0x135ed1['push'](_0x135ed1['shift']());}};_0x2c3f0d(++_0x5de0c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x2009cd,_0x549a5d){_0x2009cd=_0x2009cd-0x0;var _0x509e8a=_0xb10b[_0x2009cd];return _0x509e8a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 58e3578..883c85a 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 _0x3fa0=['scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','uniqueid','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','','calleridname','firstName','destcalleridname','Unknown','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','util','../../../../config/environment','defaults','redis','localhost','info','[CM][%s][%s]','emit','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','lastName','createdAt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3fa0,0x100));var _0x03fa=function(_0x44ce21,_0x1bb925){_0x44ce21=_0x44ce21-0x0;var _0x183514=_0x3fa0[_0x44ce21];return _0x183514;};'use strict';var _=require('lodash');var BPromise=require(_0x03fa('0x0'));var Redis=require(_0x03fa('0x1'));var util=require(_0x03fa('0x2'));var config=require(_0x03fa('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require('../../rpc/cmContact');config['redis']=_[_0x03fa('0x4')](config[_0x03fa('0x5')],{'host':_0x03fa('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x03fa('0x5')]));function emit(_0xa6d7cf,_0x217e31,_0x1ee1d8,_0x347656,_0xca04ea){logger[_0x03fa('0x7')](_0x03fa('0x8'),_0xa6d7cf,_0x217e31['id'],_0x1ee1d8,_0x347656,JSON['stringify'](_0xca04ea));io['to'](_0x1ee1d8)[_0x03fa('0x9')](_0x347656,_0xca04ea);}exports['exec']=function(_0x5d120b,_0x220c1e,_0xa592f3,_0x32e743){var _0x25aa61,_0x1566c4;var _0xda0c0a={};var _0x530ba3;var _0x750328=Number(_0xa592f3[_0x03fa('0xa')]);var _0x20e759=_0xa592f3['data2']?Boolean(Number(_0xa592f3[_0x03fa('0xb')])):![];var _0x43e1cb;var _0x40ef8e=![];if(!_['isNil'](_0xa592f3[_0x03fa('0xc')])){if(_0xa592f3['data5']=='1')_0x40ef8e=!![];}if(!_0x40ef8e){if(_0x32e743[_0x03fa('0xd')]){_0xda0c0a['id']=_0x32e743[_0x03fa('0xd')];}}if(!_0xda0c0a['id']){_0xda0c0a[_0x03fa('0xe')]=_0x750328;_0x43e1cb=_0xa592f3[_0x03fa('0xf')]&&_0xa592f3[_0x03fa('0xf')]!=='0'?_0xa592f3[_0x03fa('0xf')][_0x03fa('0x10')](','):[_0x03fa('0x11')];_0xda0c0a[_0x03fa('0x12')]=_['map'](_0x43e1cb,function(_0x14155d){var _0x2a044c={};_0x2a044c[_0x14155d]=_0x32e743[_0x03fa('0x13')]?_0x32e743[_0x03fa('0x14')]:_0x32e743[_0x03fa('0x15')];return _0x2a044c;});_0x530ba3=_0x32e743[_0x03fa('0x13')]?_0x32e743[_0x03fa('0x14')]:_0x32e743[_0x03fa('0x15')];}var _0x401700=['id','firstName',_0x03fa('0x16'),_0x03fa('0x11'),'mobile','fax','ListId',_0x03fa('0x17'),_0x03fa('0x18'),_0x03fa('0x19')];var _0x395949=_[_0x03fa('0x1a')](_0x401700,_0x43e1cb);BPromise[_0x03fa('0x1b')]()[_0x03fa('0x1c')](cmContactRpc['getContacts']({'attributes':_0x395949,'where':_0xda0c0a,'phone':_0x530ba3}))[_0x03fa('0x1c')](function(_0x45feb0){_0x1566c4=_0x45feb0;if(!_[_0x03fa('0x1d')](_0x1566c4)){if(_0x1566c4[_0x03fa('0x1e')]===0x1){_0x25aa61=_0x1566c4[0x0];logger[_0x03fa('0x7')](_0x03fa('0x1f'),_0x32e743['uniqueid'],_0x220c1e['id'],_0x25aa61['id']);}else{logger[_0x03fa('0x7')](_0x03fa('0x20'),_0x32e743['uniqueid'],_0x220c1e['id'],_[_0x03fa('0x21')](_0x1566c4,'id')[_0x03fa('0x22')](','));}return;}else{logger[_0x03fa('0x7')](_0x03fa('0x23'),_0x32e743[_0x03fa('0x24')],_0x220c1e['id']);var _0x3efa21={'ListId':_0x750328};var _0x1ba132=_0xa592f3[_0x03fa('0x25')]&&_0xa592f3[_0x03fa('0x25')]!=='0'?_0xa592f3[_0x03fa('0x25')]:_0x03fa('0x11');if(_0x20e759){logger['info'](_0x03fa('0x26'),_0x32e743[_0x03fa('0x24')],_0x220c1e['id']);_0x3efa21[_0x1ba132]=_[_0x03fa('0x27')](_0x32e743['routeId'])?_0x32e743['calleridnum']:_0x32e743[_0x03fa('0x14')];if(_[_0x03fa('0x27')](_0x32e743[_0x03fa('0x13')])){_0x3efa21['firstName']=_0x32e743['calleridname']&&_0x32e743['calleridname']!==_0x03fa('0x28')?_0x32e743[_0x03fa('0x29')]:'Unknown';}else{_0x3efa21[_0x03fa('0x2a')]=_0x32e743[_0x03fa('0x2b')]&&_0x32e743[_0x03fa('0x2b')]!==_0x03fa('0x28')?_0x32e743[_0x03fa('0x2b')]:_0x03fa('0x2c');}return BPromise['resolve']()['then'](cmContactRpc[_0x03fa('0x2d')](_0x3efa21))[_0x03fa('0x1c')](function(_0x5532b2){_0x25aa61=_0x5532b2;_0x1566c4[_0x03fa('0x2e')](_0x5532b2);if(_0x25aa61){logger[_0x03fa('0x7')](_0x03fa('0x2f'),_0x32e743[_0x03fa('0x24')],_0x220c1e['id'],_0x25aa61['id']);}return;});}else{logger['info'](_0x03fa('0x30'),_0x32e743[_0x03fa('0x24')],_0x220c1e['id']);_0x3efa21[_0x1ba132]=_[_0x03fa('0x27')](_0x32e743[_0x03fa('0x13')])?_0x32e743[_0x03fa('0x15')]:_0x32e743['destcalleridnum'];if(_['isNil'](_0x32e743['routeId'])){_0x3efa21[_0x03fa('0x2a')]=_0x32e743[_0x03fa('0x29')]&&_0x32e743[_0x03fa('0x29')]!==_0x03fa('0x28')?_0x32e743[_0x03fa('0x29')]:_0x03fa('0x2c');}else{_0x3efa21['firstName']=_0x32e743[_0x03fa('0x2b')]&&_0x32e743[_0x03fa('0x2b')]!==_0x03fa('0x28')?_0x32e743[_0x03fa('0x2b')]:'Unknown';}_0x25aa61=_0x3efa21;_0x1566c4[_0x03fa('0x2e')](_0x3efa21);return;}}})[_0x03fa('0x1c')](function(){if(_0x5d120b){emit(_0x32e743[_0x03fa('0x24')],_0x220c1e,util[_0x03fa('0x31')](_0x03fa('0x32'),_0x5d120b[_0x03fa('0x33')]),util['format'](_0x03fa('0x34'),_0xa592f3[_0x03fa('0x35')][_0x03fa('0x36')]()),{'evt':_[_0x03fa('0x37')](_0x32e743,{'autoCreate':_0x20e759}),'contact':_0x25aa61===undefined?{}:_0x25aa61,'contacts':_0x1566c4[_0x03fa('0x1e')]===0x0?undefined:_0x1566c4});}});}; \ No newline at end of file +var _0x22fb=['lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','data1','isNil','data5','xmd-contactid','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','toLowerCase','merge'];(function(_0x1a6304,_0x37b41e){var _0x825ac7=function(_0x342321){while(--_0x342321){_0x1a6304['push'](_0x1a6304['shift']());}};_0x825ac7(++_0x37b41e);}(_0x22fb,0x18f));var _0xb22f=function(_0xec6bc3,_0x59e93f){_0xec6bc3=_0xec6bc3-0x0;var _0x47f488=_0x22fb[_0xec6bc3];return _0x47f488;};'use strict';var _=require(_0xb22f('0x0'));var BPromise=require(_0xb22f('0x1'));var Redis=require(_0xb22f('0x2'));var util=require('util');var config=require(_0xb22f('0x3'));var logger=require(_0xb22f('0x4'))('trigger');var cmContactRpc=require(_0xb22f('0x5'));config[_0xb22f('0x6')]=_[_0xb22f('0x7')](config[_0xb22f('0x6')],{'host':_0xb22f('0x8'),'port':0x18eb});var io=require(_0xb22f('0x9'))(new Redis(config[_0xb22f('0x6')]));function emit(_0x5bf93a,_0x2fe563,_0x5e1f1b,_0x5465c5,_0x37d0ca){logger[_0xb22f('0xa')]('[CM][%s][%s]',_0x5bf93a,_0x2fe563['id'],_0x5e1f1b,_0x5465c5,JSON[_0xb22f('0xb')](_0x37d0ca));io['to'](_0x5e1f1b)[_0xb22f('0xc')](_0x5465c5,_0x37d0ca);}exports[_0xb22f('0xd')]=function(_0x1ba770,_0x11b3fe,_0x30c0bb,_0x39f75c){var _0x4a61e0,_0x4791c8;var _0x4859a7={};var _0x3937e1;var _0x405a9f=Number(_0x30c0bb[_0xb22f('0xe')]);var _0x1fc5fd=_0x30c0bb['data2']?Boolean(Number(_0x30c0bb['data2'])):![];var _0x27edaa;var _0x14efa8=![];if(!_[_0xb22f('0xf')](_0x30c0bb[_0xb22f('0x10')])){if(_0x30c0bb[_0xb22f('0x10')]=='1')_0x14efa8=!![];}if(!_0x14efa8){if(_0x39f75c['xmd-contactid']){_0x4859a7['id']=_0x39f75c[_0xb22f('0x11')];}}if(!_0x4859a7['id']){_0x4859a7['ListId']=_0x405a9f;_0x27edaa=_0x30c0bb[_0xb22f('0x12')]&&_0x30c0bb[_0xb22f('0x12')]!=='0'?_0x30c0bb[_0xb22f('0x12')][_0xb22f('0x13')](','):[_0xb22f('0x14')];_0x4859a7[_0xb22f('0x15')]=_[_0xb22f('0x16')](_0x27edaa,function(_0x55f289){var _0x14ecc1={};_0x14ecc1[_0x55f289]=_0x39f75c['routeId']?_0x39f75c[_0xb22f('0x17')]:_0x39f75c[_0xb22f('0x18')];return _0x14ecc1;});_0x3937e1=_0x39f75c[_0xb22f('0x19')]?_0x39f75c[_0xb22f('0x17')]:_0x39f75c[_0xb22f('0x18')];}var _0x1d2846=['id','firstName','lastName',_0xb22f('0x14'),_0xb22f('0x1a'),_0xb22f('0x1b'),_0xb22f('0x1c'),_0xb22f('0x1d'),_0xb22f('0x1e'),_0xb22f('0x1f')];var _0x676b41=_[_0xb22f('0x20')](_0x1d2846,_0x27edaa);BPromise[_0xb22f('0x21')]()[_0xb22f('0x22')](cmContactRpc[_0xb22f('0x23')]({'attributes':_0x676b41,'where':_0x4859a7,'phone':_0x3937e1}))[_0xb22f('0x22')](function(_0x3b074e){_0x4791c8=_0x3b074e;if(!_[_0xb22f('0x24')](_0x4791c8)){if(_0x4791c8[_0xb22f('0x25')]===0x1){_0x4a61e0=_0x4791c8[0x0];logger[_0xb22f('0xa')](_0xb22f('0x26'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id'],_0x4a61e0['id']);}else{logger[_0xb22f('0xa')](_0xb22f('0x28'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id'],_[_0xb22f('0x16')](_0x4791c8,'id')[_0xb22f('0x29')](','));}return;}else{logger[_0xb22f('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x39f75c['uniqueid'],_0x11b3fe['id']);var _0x4ff759={'ListId':_0x405a9f};var _0x53871d=_0x30c0bb[_0xb22f('0x2a')]&&_0x30c0bb['data4']!=='0'?_0x30c0bb[_0xb22f('0x2a')]:_0xb22f('0x14');if(_0x1fc5fd){logger[_0xb22f('0xa')](_0xb22f('0x2b'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id']);_0x4ff759[_0x53871d]=_['isNil'](_0x39f75c['routeId'])?_0x39f75c['calleridnum']:_0x39f75c[_0xb22f('0x17')];if(_[_0xb22f('0xf')](_0x39f75c[_0xb22f('0x19')])){_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x2d')]&&_0x39f75c[_0xb22f('0x2d')]!==_0xb22f('0x2e')?_0x39f75c[_0xb22f('0x2d')]:_0xb22f('0x2f');}else{_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x30')]&&_0x39f75c[_0xb22f('0x30')]!==_0xb22f('0x2e')?_0x39f75c[_0xb22f('0x30')]:_0xb22f('0x2f');}return BPromise[_0xb22f('0x21')]()[_0xb22f('0x22')](cmContactRpc[_0xb22f('0x31')](_0x4ff759))[_0xb22f('0x22')](function(_0x1c723f){_0x4a61e0=_0x1c723f;_0x4791c8[_0xb22f('0x32')](_0x1c723f);if(_0x4a61e0){logger[_0xb22f('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id'],_0x4a61e0['id']);}return;});}else{logger[_0xb22f('0xa')](_0xb22f('0x33'),_0x39f75c[_0xb22f('0x27')],_0x11b3fe['id']);_0x4ff759[_0x53871d]=_[_0xb22f('0xf')](_0x39f75c['routeId'])?_0x39f75c[_0xb22f('0x18')]:_0x39f75c[_0xb22f('0x17')];if(_[_0xb22f('0xf')](_0x39f75c[_0xb22f('0x19')])){_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x2d')]&&_0x39f75c[_0xb22f('0x2d')]!==_0xb22f('0x2e')?_0x39f75c[_0xb22f('0x2d')]:_0xb22f('0x2f');}else{_0x4ff759[_0xb22f('0x2c')]=_0x39f75c[_0xb22f('0x30')]&&_0x39f75c[_0xb22f('0x30')]!==_0xb22f('0x2e')?_0x39f75c['destcalleridname']:'Unknown';}_0x4a61e0=_0x4ff759;_0x4791c8[_0xb22f('0x32')](_0x4ff759);return;}}})[_0xb22f('0x22')](function(){if(_0x1ba770){emit(_0x39f75c[_0xb22f('0x27')],_0x11b3fe,util[_0xb22f('0x34')](_0xb22f('0x35'),_0x1ba770[_0xb22f('0x36')]),util[_0xb22f('0x34')]('trigger:%s',_0x30c0bb['action'][_0xb22f('0x37')]()),{'evt':_[_0xb22f('0x38')](_0x39f75c,{'autoCreate':_0x1fc5fd}),'contact':_0x4a61e0===undefined?{}:_0x4a61e0,'contacts':_0x4791c8['length']===0x0?undefined:_0x4791c8});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 5e23ce3..6d3056a 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 _0xc6df=['dynamics365Accounts','freshsalesAccounts','zendeskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:substatus','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','interface','hasOwnProperty','status','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','popup','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','data3','isNil','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winArguments','format','user:%s','name','data1','integration','exec','accounts','queue','routeId','script','query','search','checkTrigger','channel','length','every','AnyConditions','some','checkConditions','checkTrigger:\x20trigger','evt','account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','created','equals','exports','lodash','url','mustache','ioredis','./urlforward','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts'];(function(_0x4290d9,_0xceffdf){var _0x25fcac=function(_0x828da5){while(--_0x828da5){_0x4290d9['push'](_0x4290d9['shift']());}};_0x25fcac(++_0xceffdf);}(_0xc6df,0x65));var _0xfc6d=function(_0x1ed870,_0x988581){_0x1ed870=_0x1ed870-0x0;var _0x49f62c=_0xc6df[_0x1ed870];return _0x49f62c;};'use strict';var util=require('util');var _=require(_0xfc6d('0x0'));var url=require(_0xfc6d('0x1'));var Mustache=require(_0xfc6d('0x2'));var Redis=require(_0xfc6d('0x3'));var urlforward=require(_0xfc6d('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0xfc6d('0x5'));var config=require(_0xfc6d('0x6'));var logger=require(_0xfc6d('0x7'))(_0xfc6d('0x8'));var ami=require(_0xfc6d('0x9'));config[_0xfc6d('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfc6d('0xb'))(new Redis(config[_0xfc6d('0xa')]));var operators={'equals':function(_0x46340e,_0x51894c){return _0x46340e==_0x51894c;},'not_equals':function(_0x4a2c93,_0x8eda1e){return _0x4a2c93!=_0x8eda1e;}};var barAndWebActions=['popup','url',_0xfc6d('0xc')];function Trigger(_0x212ee1){this[_0xfc6d('0xd')]=_0x212ee1['triggers'];this[_0xfc6d('0xe')]=_0x212ee1[_0xfc6d('0xe')];this[_0xfc6d('0xf')]=_0x212ee1['voiceQueues'];this[_0xfc6d('0x10')]=_0x212ee1['templates'];this[_0xfc6d('0x11')]=_0x212ee1[_0xfc6d('0x11')];this['zendeskAccounts']=_0x212ee1['zendeskAccounts'];this[_0xfc6d('0x12')]=_0x212ee1[_0xfc6d('0x12')];this[_0xfc6d('0x13')]=_0x212ee1[_0xfc6d('0x13')];this[_0xfc6d('0x14')]=_0x212ee1[_0xfc6d('0x14')];this[_0xfc6d('0x15')]=_0x212ee1['zohoAccounts'];this[_0xfc6d('0x16')]=_0x212ee1[_0xfc6d('0x16')];this[_0xfc6d('0x17')]=_0x212ee1['vtigerAccounts'];this['servicenowAccounts']=_0x212ee1[_0xfc6d('0x18')];this[_0xfc6d('0x19')]=_0x212ee1['dynamics365Accounts'];this[_0xfc6d('0x1a')]=_0x212ee1[_0xfc6d('0x1a')];this['accounts']={'zendesk':this[_0xfc6d('0x1b')],'salesforce':this[_0xfc6d('0x13')],'freshdesk':this[_0xfc6d('0x12')],'sugarcrm':this[_0xfc6d('0x14')],'zoho':this['zohoAccounts'],'desk':this[_0xfc6d('0x16')],'vtiger':this[_0xfc6d('0x17')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xfc6d('0x18')]};ami['on'](_0xfc6d('0x1c'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on']('custom:agentconnect',this[_0xfc6d('0x1d')]['bind'](this));ami['on'](_0xfc6d('0x1f'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x20'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on']('custom:agentnosuchnumber',this[_0xfc6d('0x1d')]['bind'](this));ami['on'](_0xfc6d('0x21'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x22'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x23'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x24'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x25'),this['syncCustomEvent'][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x26'),this['syncCustomEvent'][_0xfc6d('0x1e')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0xfc6d('0x1e')](this));ami['on']('custom:dialbegin',this[_0xfc6d('0x27')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x28'),this[_0xfc6d('0x27')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x29'),this['syncAgentDial'][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x2a'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on']('custom:closedinteraction',this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x2b'),this['syncCustomEvent'][_0xfc6d('0x1e')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x2c'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on']('custom:acceptmessage',this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x2d'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));ami['on'](_0xfc6d('0x2e'),this[_0xfc6d('0x1d')][_0xfc6d('0x1e')](this));}Trigger[_0xfc6d('0x2f')][_0xfc6d('0x30')]=function(_0x10a63f,_0xdf429a,_0x541d53){logger['info'](_0x10a63f,_0xdf429a,JSON[_0xfc6d('0x31')](_0x541d53));io['to'](_0x10a63f)[_0xfc6d('0x30')](_0xdf429a,_0x541d53);};Trigger[_0xfc6d('0x2f')][_0xfc6d('0x1d')]=function(_0x46fdd0){var _0x3c7ef8=_[_0xfc6d('0x32')](_0x46fdd0);if(typeof _0x3c7ef8[_0xfc6d('0x33')]===_0xfc6d('0x34')){_0x3c7ef8[_0xfc6d('0x33')]=_0xfc6d('0x35');}logger[_0xfc6d('0x36')]('syncCustomEvent',util[_0xfc6d('0x37')](_0x3c7ef8,{'showHidden':!![],'depth':null}));this[_0xfc6d('0x38')](_0x3c7ef8);};Trigger['prototype'][_0xfc6d('0x27')]=function(_0xa63e06){if(this[_0xfc6d('0xe')][_0xa63e06[_0xfc6d('0x39')]]){this['syncCustomEvent'](_0xa63e06);}};Trigger[_0xfc6d('0x2f')][_0xfc6d('0x38')]=function(_0x3f4dd0){var _0x753a25;for(var _0x15baab in this[_0xfc6d('0xd')]){if(this[_0xfc6d('0xd')][_0xfc6d('0x3a')](_0x15baab)){if(this[_0xfc6d('0xd')][_0x15baab][_0xfc6d('0x3b')]){_0x753a25=this['checkTrigger'](this[_0xfc6d('0xd')][_0x15baab],_0x3f4dd0);if(_0x753a25){_[_0xfc6d('0x3c')](_0x3f4dd0,_0x3f4dd0[_0xfc6d('0x3d')]);for(var _0x5c40c5=0x0,_0x3e5c75,_0x2cfd39,_0x42b7f1;_0x5c40c50x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14b,0x93));var _0xbe14=function(_0x262cc9,_0x33bcef){_0x262cc9=_0x262cc9-0x0;var _0x105e30=_0xe14b[_0x262cc9];return _0x105e30;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 909cb5a..fbbda7c 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 _0x6eb2=['toLowerCase','outbound','destcalleridnum','/systemusers(','4.0','body','headers','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','&$filter=','replace','%2b','value',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','info',']\x20Enduser\x20created!','forEach','includes','string','picklist','nameField','customField','idField','indexOf','content','incidents','assign','getString','Descriptions','/contacts(','Fields','ticketType','callDirection','queue','phonecalls','Subjects','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','modernAuthentication','remoteUri','data7','data2','CloudProvider','POST','username','password','clientSecret','access_token','error',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','email','length','internalemailaddress','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch'];(function(_0x316994,_0x5ceead){var _0x225a4a=function(_0x5536ee){while(--_0x5536ee){_0x316994['push'](_0x316994['shift']());}};_0x225a4a(++_0x5ceead);}(_0x6eb2,0x1ed));var _0x26eb=function(_0x4be774,_0x5b2d48){_0x4be774=_0x4be774-0x0;var _0x31d1c9=_0x6eb2[_0x4be774];return _0x31d1c9;};'use strict';var _=require(_0x26eb('0x0'));var rp=require(_0x26eb('0x1'));var util=require(_0x26eb('0x2'));var intUtil=require(_0x26eb('0x3'));var md5=require(_0x26eb('0x4'));var Redis=require(_0x26eb('0x5'));var logger=require(_0x26eb('0x6'))(_0x26eb('0x7'));var config=require(_0x26eb('0x8'));config[_0x26eb('0x9')]=_[_0x26eb('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x26eb('0x9')]));function getAuthToken(_0x3aef2c,_0x5489e2,_0x45b538){if(_0x3aef2c[_0x26eb('0xb')]){_0x3aef2c[_0x26eb('0xc')]=_0x3aef2c['CloudProvider'][_0x26eb('0xd')];_0x3aef2c['tenantId']=_0x3aef2c['CloudProvider'][_0x26eb('0xe')];return Promise['resolve'](_0x3aef2c[_0x26eb('0xf')]['data5']);}var _0x19301d={'method':_0x26eb('0x10'),'uri':_0x5489e2,'form':{'client_id':_0x3aef2c['clientId'],'resource':_0x3aef2c['remoteUri'],'username':_0x3aef2c[_0x26eb('0x11')],'password':_0x3aef2c[_0x26eb('0x12')],'grant_type':_0x26eb('0x12'),'client_secret':_0x3aef2c[_0x26eb('0x13')]},'json':!![]};return rp(_0x19301d)['then'](function(_0x380d24){return _0x380d24[_0x26eb('0x14')];})['catch'](function(_0x384568){logger[_0x26eb('0x15')]('['+[_0x45b538['toUpperCase']()]+_0x26eb('0x16'));return _0x384568[_0x26eb('0x17')];});}function getUser(_0x48adea,_0x216c2c,_0x248b2b,_0x44c02c,_0x2e4cae,_0x4015dc){return new Promise(function(_0x2e5db9,_0x4c24cd){return getAuthToken(_0x216c2c,_0x44c02c,_0x4015dc)[_0x26eb('0x18')](function(_0x278c55){var _0x286485={'method':_0x26eb('0x19'),'uri':_0x2e4cae+_0x26eb('0x1a'),'headers':{'Authorization':_0x26eb('0x1b')+_0x278c55,'OData-Version':'4.0'},'json':!![]};return rp(_0x286485);})[_0x26eb('0x18')](function(_0x149be1){var _0x1570e3=_0x149be1['value'];var _0x503276=![];var _0x438e77=null;if(!_['isNil'](_0x248b2b)){if(intUtil['validateEmail'](_0x248b2b[_0x26eb('0x1c')])){_0x48adea['userEmail']=_0x248b2b[_0x26eb('0x1c')];for(_0x438e77=0x0;_0x438e77<_0x1570e3[_0x26eb('0x1d')];_0x438e77++){if(_0x1570e3[_0x438e77][_0x26eb('0x1e')]===_0x248b2b[_0x26eb('0x1c')]&&!_0x1570e3[_0x438e77]['isdisabled']){_0x503276=!![];logger['info']('['+[_0x4015dc[_0x26eb('0x1f')]()]+_0x26eb('0x20')+_0x1570e3[_0x438e77][_0x26eb('0x21')]+'!');_0x48adea[_0x26eb('0x22')]=_0x1570e3[_0x438e77][_0x26eb('0x21')];}}}}if(!_0x503276){logger['info']('['+[_0x4015dc[_0x26eb('0x1f')]()]+_0x26eb('0x23'));_0x48adea['userEmail']=_0x216c2c[_0x26eb('0x11')];for(_0x438e77=0x0;_0x438e77<_0x1570e3[_0x26eb('0x1d')];_0x438e77++){if(_0x1570e3[_0x438e77][_0x26eb('0x1e')]===_0x216c2c[_0x26eb('0x11')]){_0x48adea[_0x26eb('0x22')]=_0x1570e3[_0x438e77]['systemuserid'];}}}_0x2e5db9(_0x48adea);})[_0x26eb('0x24')](function(_0x1e6ef1){_0x4c24cd(_0x1e6ef1[_0x26eb('0x17')]);});});}function createEndUser(_0x439cd0,_0x271de4,_0x2162c1,_0x1c5aa6,_0x5a5534,_0x1b8d7c,_0x2893a8){return new Promise(function(_0x22ddb3,_0x1fb115){return getAuthToken(_0x271de4,_0x2162c1,_0x1b8d7c)[_0x26eb('0x18')](function(_0x1609b2){var _0x4d50e8=_0x1b8d7c[_0x26eb('0x25')]()===_0x26eb('0x26')?_0x5a5534[_0x26eb('0x27')]:_0x5a5534['calleridnum'];var _0x4dff74={'method':_0x26eb('0x10'),'uri':_0x1c5aa6+'contacts','body':{'fullname':_0x4d50e8,'firstname':_0x4d50e8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x26eb('0x28')+_0x439cd0[_0x26eb('0x22')]+')'},'headers':{'Authorization':_0x26eb('0x1b')+_0x1609b2,'OData-Version':_0x26eb('0x29')},'json':!![],'resolveWithFullResponse':!![]};_0x4dff74[_0x26eb('0x2a')][_0x2893a8]=_0x4d50e8;return rp(_0x4dff74);})[_0x26eb('0x18')](function(_0xe1873){var _0x17fdca=_0xe1873[_0x26eb('0x2b')]['odata-entityid'];var _0x4caeb8=_0x17fdca[_0x26eb('0x2c')](_0x17fdca['lastIndexOf']('(')+0x1,_0x17fdca[_0x26eb('0x2d')](')'));_0x439cd0[_0x26eb('0x2e')]=_0x4caeb8;_0x22ddb3(_0x439cd0);})['catch'](function(_0x25e473){_0x1fb115(_0x25e473[_0x26eb('0x17')]);});});}function getEndUser(_0x588547,_0x1efcd1,_0x1f2457,_0x5c8b15,_0x172658,_0x2fc711,_0x48c4d6,_0xd40cb9){var _0x144026=_0x2fc711[_0x26eb('0x25')]()===_0x26eb('0x26')?_0x172658[_0x26eb('0x27')]:_0x172658[_0x26eb('0x2f')];return getAuthToken(_0x1efcd1,_0x1f2457,_0x2fc711)[_0x26eb('0x18')](function(_0x2892fc){_0xd40cb9=_0xd40cb9?_0xd40cb9:_0x26eb('0x30');var _0x1c10f8={'method':_0x26eb('0x19'),'uri':_0x5c8b15+_0x26eb('0x31')+_0xd40cb9+_0x26eb('0x32')+_0xd40cb9+'\x20eq\x20\x27'+_0x144026[_0x26eb('0x33')]('+',_0x26eb('0x34'))+'\x27','headers':{'Authorization':_0x26eb('0x1b')+_0x2892fc,'If-None-Match':null,'OData-Version':_0x26eb('0x29')},'json':!![]};return rp(_0x1c10f8);})[_0x26eb('0x18')](function(_0x23d7f8){var _0x23c638=![];if(!_0x23d7f8)return _0x23c638;var _0x41e542=_0x23d7f8[_0x26eb('0x35')];for(var _0x54f696=0x0;_0x54f696<_0x41e542[_0x26eb('0x1d')];_0x54f696++){if(_0x41e542[_0x54f696][_0xd40cb9]===_0x144026){_0x23c638=!![];_0x588547[_0x26eb('0x2e')]=_0x41e542[_0x54f696]['contactid'];}}return _0x23c638;})[_0x26eb('0x18')](function(_0x206fa7){if(_0x206fa7)return _0x588547;if(_0x48c4d6==='nothing'){logger['info']('['+[_0x2fc711[_0x26eb('0x1f')]()]+_0x26eb('0x36'));return _0x588547;}return createEndUser(_0x588547,_0x1efcd1,_0x1f2457,_0x5c8b15,_0x172658,_0x2fc711,_0xd40cb9)[_0x26eb('0x18')](function(_0x365651){logger[_0x26eb('0x37')]('['+[_0x2fc711[_0x26eb('0x1f')]()]+_0x26eb('0x38'),_0x365651[_0x26eb('0x2e')]);return _0x365651;});});}function getCustomFields(_0x32589a,_0x1247d2,_0x3938d3){var _0x1626bb={};if(_0x32589a[_0x26eb('0x1d')]>0x0){_[_0x26eb('0x39')](_0x32589a,function(_0x3aed92){if(_[_0x26eb('0x3a')]([_0x26eb('0x3b'),_0x26eb('0x3c')],_0x3aed92['type'])&&_0x3aed92[_0x26eb('0x3d')]&&!_0x3aed92[_0x26eb('0x3e')]){var _0x9b662a=_0x3aed92[_0x26eb('0x3f')][_0x26eb('0x25')]();var _0x488e1a=_0x9b662a['substring'](0x0,_0x9b662a[_0x26eb('0x40')]('_'));var _0x128ba1=_0x9b662a[_0x26eb('0x2c')](_0x9b662a[_0x26eb('0x40')]('_')+0x1);if(_0x488e1a===_0x3938d3){_0x1626bb[_0x128ba1]=_0x3aed92[_0x26eb('0x41')];}}});}return _0x1626bb;}function getTicket(_0x5171a4,_0x331ce5,_0x1a3d66,_0x2cbde2,_0x378b5c,_0xb8133b,_0x9b2489){return new Promise(function(_0x59755f,_0x274649){var _0x2045c4;return getAuthToken(_0x331ce5,_0x1a3d66,_0x9b2489)['then'](function(_0x2eba4e){if(_0xb8133b['ticketType']==='incident'){_0x2045c4={'method':'POST','uri':_0x2cbde2+_0x26eb('0x42'),'body':Object[_0x26eb('0x43')]({},{'title':intUtil[_0x26eb('0x44')](_0xb8133b['Subjects'],_0x378b5c,'\x20'),'description':intUtil['getString'](_0xb8133b[_0x26eb('0x45')],_0x378b5c,'\x0a'),'customerid_contact@odata.bind':_0x5171a4[_0x26eb('0x2e')]?_0x26eb('0x46')+_0x5171a4[_0x26eb('0x2e')]+')':undefined,'ownerid@odata.bind':_0x26eb('0x28')+_0x5171a4[_0x26eb('0x22')]+')','caseorigincode':'1'},getCustomFields(_0xb8133b[_0x26eb('0x47')],_0x378b5c,_0xb8133b['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x2eba4e,'OData-Version':_0x26eb('0x29')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xb8133b[_0x26eb('0x48')]==='phonecall'){var _0x3ab100=_0x5171a4['enduserId']?[{'partyid_systemuser@odata.bind':_0x26eb('0x28')+_0x5171a4[_0x26eb('0x22')]+')','participationtypemask':_0x5171a4[_0x26eb('0x49')]===_0x26eb('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0x26eb('0x46')+_0x5171a4[_0x26eb('0x2e')]+')','participationtypemask':_0x5171a4[_0x26eb('0x49')]===_0x26eb('0x4a')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x5171a4[_0x26eb('0x22')]+')','participationtypemask':_0x5171a4['callDirection']===_0x26eb('0x4a')?0x2:0x1}];_0x2045c4={'method':_0x26eb('0x10'),'uri':_0x2cbde2+_0x26eb('0x4b'),'body':Object['assign']({},{'subject':intUtil['getString'](_0xb8133b[_0x26eb('0x4c')],_0x378b5c,'\x20'),'phonenumber':String(_0x378b5c[_0x26eb('0x2f')]),'description':intUtil[_0x26eb('0x44')](_0xb8133b[_0x26eb('0x45')],_0x378b5c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5171a4[_0x26eb('0x2e')]?'/contacts('+_0x5171a4[_0x26eb('0x2e')]+')':undefined,'ownerid@odata.bind':_0x26eb('0x28')+_0x5171a4['userId']+')','directioncode':_0x5171a4['callDirection']===_0x26eb('0x4a')?![]:!![],'phonecall_activity_parties':_0x3ab100},getCustomFields(_0xb8133b[_0x26eb('0x47')],_0x378b5c,_0xb8133b[_0x26eb('0x48')])),'headers':{'Authorization':_0x26eb('0x1b')+_0x2eba4e,'OData-Version':_0x26eb('0x29')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2045c4);})['then'](function(_0x2ed308){var _0x485cf2=_0x2ed308[_0x26eb('0x2b')]['odata-entityid'];var _0x15313c=_0x485cf2[_0x26eb('0x2c')](_0x485cf2[_0x26eb('0x2d')]('(')+0x1,_0x485cf2[_0x26eb('0x2d')](')'));_0x5171a4[_0x26eb('0x4d')]=_0x15313c;_0x59755f(_0x5171a4);})[_0x26eb('0x24')](function(_0x580f0d){_0x274649(_0x580f0d[_0x26eb('0x17')]);});});}function emit(_0x1a4c40,_0x5e7ff3,_0x25526d,_0x486861){var _0x169e5e={'uri':util[_0x26eb('0x4e')](_0x26eb('0x4f'),_0x1a4c40,_0x25526d,_0x486861)};io['to'](util[_0x26eb('0x4e')](_0x26eb('0x50'),_0x5e7ff3))[_0x26eb('0x51')]('trigger:browser:url',_0x169e5e);}exports['cs']=function(_0x171bde,_0x4a6b5e,_0x47f885,_0x532cab,_0x4da5d3,_0x120257,_0x3ff16f,_0x933e38){var _0x284f7e={};_0x120257[_0x26eb('0xc')]=_0x120257[_0x26eb('0xb')]?intUtil['stripTrailingSlash'](_0x120257[_0x26eb('0xf')][_0x26eb('0xd')]):intUtil[_0x26eb('0x52')](_0x120257[_0x26eb('0xc')]);_0x120257[_0x26eb('0x53')]=intUtil[_0x26eb('0x52')](_0x120257['serverUrl']);_0x284f7e[_0x26eb('0x49')]=_0x933e38===_0x26eb('0x4a')||_0x933e38===_0x26eb('0x54')?_0x26eb('0x4a'):_0x26eb('0x26');var _0x6cc329=_0x120257['modernAuthentication']?util[_0x26eb('0x4e')]('%s/api/data/v9.0/',_0x120257['CloudProvider']['data7']):util[_0x26eb('0x4e')](_0x26eb('0x55'),_0x120257[_0x26eb('0xc')]);var _0x14c9a8=util[_0x26eb('0x4e')](_0x26eb('0x56'),_0x120257['tenantId']);var _0x27ea46=util[_0x26eb('0x4e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x120257['serverUrl'],_0x4a6b5e[_0x26eb('0x57')],md5(_0x4a6b5e[_0x26eb('0x57')]));if(_0x4da5d3&&_0x4da5d3[_0x26eb('0x58')]){logger[_0x26eb('0x37')]('[QUEUE]',_0x26eb('0x59'));_0x4a6b5e['recordingURL']=_0x27ea46;}else if(_0x3ff16f&&_0x3ff16f[_0x26eb('0x5a')]&&_0x3ff16f['recordingFormat']!==_0x26eb('0x5b')){logger[_0x26eb('0x37')](_0x26eb('0x5c'),_0x26eb('0x59'));_0x4a6b5e[_0x26eb('0x5d')]=_0x27ea46;}else{_0x4a6b5e[_0x26eb('0x5d')]='';}return getUser(_0x284f7e,_0x120257,_0x532cab,_0x14c9a8,_0x6cc329,_0x933e38)[_0x26eb('0x18')](function(_0x597d93){logger[_0x26eb('0x37')]('['+_0x933e38[_0x26eb('0x1f')]()+_0x26eb('0x5e'),_0x597d93[_0x26eb('0x22')]);logger[_0x26eb('0x37')]('['+_0x933e38[_0x26eb('0x1f')]()+_0x26eb('0x5f'),_0x597d93[_0x26eb('0x60')]);return getEndUser(_0x597d93,_0x120257,_0x14c9a8,_0x6cc329,_0x4a6b5e,_0x933e38,_0x47f885[_0x26eb('0x61')],_0x47f885['additionalSearchContact']);})['then'](function(_0x530c57){logger[_0x26eb('0x37')]('['+_0x933e38[_0x26eb('0x1f')]()+_0x26eb('0x62'),_0x530c57[_0x26eb('0x2e')]);logger['info']('['+_0x933e38[_0x26eb('0x1f')]()+_0x26eb('0x63'),_0x4a6b5e[_0x26eb('0x2f')]);return getTicket(_0x530c57,_0x120257,_0x14c9a8,_0x6cc329,_0x4a6b5e,_0x47f885,_0x933e38);})[_0x26eb('0x18')](function(_0x29dda4){logger['info'](util[_0x26eb('0x4e')]('['+_0x933e38[_0x26eb('0x1f')]()+_0x26eb('0x64'),_0x47f885['ticketType'],_0x29dda4[_0x26eb('0x4d')]));logger[_0x26eb('0x37')](util[_0x26eb('0x4e')]('['+_0x933e38['toUpperCase']()+_0x26eb('0x65'),_0x933e38));if(_0x933e38!==_0x26eb('0x54')&&_0x47f885[_0x26eb('0x66')]){logger[_0x26eb('0x37')]('['+_0x933e38[_0x26eb('0x1f')]()+']',_0x26eb('0x67'));emit(_0x120257[_0x26eb('0xc')],_0x532cab[_0x26eb('0x68')],_0x47f885[_0x26eb('0x48')],_0x29dda4[_0x26eb('0x4d')]);}})[_0x26eb('0x24')](function(_0x4fb50f){logger[_0x26eb('0x15')]('['+_0x933e38[_0x26eb('0x1f')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x4fb50f[_0x26eb('0x17')]);console[_0x26eb('0x15')](_0x26eb('0x69'),_0x4fb50f);});}; \ No newline at end of file +var _0x95a0=['emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','resolve','data5','POST','clientId','username','password','clientSecret','access_token','catch','error',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','email','length','internalemailaddress','isdisabled','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','destcalleridnum','contacts','/systemusers(','body','substring','lastIndexOf','outbound','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','odata-entityid','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s'];(function(_0x17fd4d,_0x402899){var _0x5e12f5=function(_0xebfa1c){while(--_0xebfa1c){_0x17fd4d['push'](_0x17fd4d['shift']());}};_0x5e12f5(++_0x402899);}(_0x95a0,0x178));var _0x095a=function(_0x56620a,_0x35d368){_0x56620a=_0x56620a-0x0;var _0x3914ce=_0x95a0[_0x56620a];return _0x3914ce;};'use strict';var _=require(_0x095a('0x0'));var rp=require(_0x095a('0x1'));var util=require(_0x095a('0x2'));var intUtil=require(_0x095a('0x3'));var md5=require(_0x095a('0x4'));var Redis=require(_0x095a('0x5'));var logger=require(_0x095a('0x6'))(_0x095a('0x7'));var config=require(_0x095a('0x8'));config[_0x095a('0x9')]=_[_0x095a('0xa')](config['redis'],{'host':_0x095a('0xb'),'port':0x18eb});var io=require(_0x095a('0xc'))(new Redis(config[_0x095a('0x9')]));function getAuthToken(_0x3d7d49,_0x162dc5,_0x27a6bd){if(_0x3d7d49[_0x095a('0xd')]){_0x3d7d49[_0x095a('0xe')]=_0x3d7d49[_0x095a('0xf')][_0x095a('0x10')];_0x3d7d49[_0x095a('0x11')]=_0x3d7d49[_0x095a('0xf')]['data2'];return Promise[_0x095a('0x12')](_0x3d7d49[_0x095a('0xf')][_0x095a('0x13')]);}var _0x222837={'method':_0x095a('0x14'),'uri':_0x162dc5,'form':{'client_id':_0x3d7d49[_0x095a('0x15')],'resource':_0x3d7d49['remoteUri'],'username':_0x3d7d49[_0x095a('0x16')],'password':_0x3d7d49[_0x095a('0x17')],'grant_type':'password','client_secret':_0x3d7d49[_0x095a('0x18')]},'json':!![]};return rp(_0x222837)['then'](function(_0x694ea1){return _0x694ea1[_0x095a('0x19')];})[_0x095a('0x1a')](function(_0x4c95ca){logger[_0x095a('0x1b')]('['+[_0x27a6bd['toUpperCase']()]+_0x095a('0x1c'));return _0x4c95ca[_0x095a('0x1d')];});}function getUser(_0x16d3ee,_0x5ccfa2,_0x4e532e,_0xe9b768,_0x192fe0,_0x26d653){return new Promise(function(_0x2ee0ed,_0x19dd5f){return getAuthToken(_0x5ccfa2,_0xe9b768,_0x26d653)[_0x095a('0x1e')](function(_0x468fc7){var _0x53b871={'method':_0x095a('0x1f'),'uri':_0x192fe0+_0x095a('0x20'),'headers':{'Authorization':_0x095a('0x21')+_0x468fc7,'OData-Version':_0x095a('0x22')},'json':!![]};return rp(_0x53b871);})[_0x095a('0x1e')](function(_0x2c2eb3){var _0x7d0903=_0x2c2eb3[_0x095a('0x23')];var _0x33b167=![];var _0x221edf=null;if(!_[_0x095a('0x24')](_0x4e532e)){if(intUtil[_0x095a('0x25')](_0x4e532e['email'])){_0x16d3ee[_0x095a('0x26')]=_0x4e532e[_0x095a('0x27')];for(_0x221edf=0x0;_0x221edf<_0x7d0903[_0x095a('0x28')];_0x221edf++){if(_0x7d0903[_0x221edf][_0x095a('0x29')]===_0x4e532e['email']&&!_0x7d0903[_0x221edf][_0x095a('0x2a')]){_0x33b167=!![];logger['info']('['+[_0x26d653[_0x095a('0x2b')]()]+_0x095a('0x2c')+_0x7d0903[_0x221edf][_0x095a('0x2d')]+'!');_0x16d3ee[_0x095a('0x2e')]=_0x7d0903[_0x221edf][_0x095a('0x2d')];}}}}if(!_0x33b167){logger[_0x095a('0x2f')]('['+[_0x26d653[_0x095a('0x2b')]()]+_0x095a('0x30'));_0x16d3ee[_0x095a('0x26')]=_0x5ccfa2[_0x095a('0x16')];for(_0x221edf=0x0;_0x221edf<_0x7d0903[_0x095a('0x28')];_0x221edf++){if(_0x7d0903[_0x221edf][_0x095a('0x29')]===_0x5ccfa2[_0x095a('0x16')]){_0x16d3ee[_0x095a('0x2e')]=_0x7d0903[_0x221edf][_0x095a('0x2d')];}}}_0x2ee0ed(_0x16d3ee);})[_0x095a('0x1a')](function(_0x1d84c){_0x19dd5f(_0x1d84c[_0x095a('0x1d')]);});});}function createEndUser(_0x243509,_0x5c0bd2,_0x52350a,_0x4b4626,_0x28a717,_0xcc0ca8,_0x4ff642){return new Promise(function(_0x56d765,_0x53cb53){return getAuthToken(_0x5c0bd2,_0x52350a,_0xcc0ca8)['then'](function(_0x525b33){var _0x588a82=_0xcc0ca8[_0x095a('0x31')]()==='outbound'?_0x28a717[_0x095a('0x32')]:_0x28a717['calleridnum'];var _0x586ef2={'method':_0x095a('0x14'),'uri':_0x4b4626+_0x095a('0x33'),'body':{'fullname':_0x588a82,'firstname':_0x588a82,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x095a('0x34')+_0x243509[_0x095a('0x2e')]+')'},'headers':{'Authorization':_0x095a('0x21')+_0x525b33,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x586ef2[_0x095a('0x35')][_0x4ff642]=_0x588a82;return rp(_0x586ef2);})[_0x095a('0x1e')](function(_0x42bcfa){var _0x13d535=_0x42bcfa['headers']['odata-entityid'];var _0x3f52a9=_0x13d535[_0x095a('0x36')](_0x13d535[_0x095a('0x37')]('(')+0x1,_0x13d535[_0x095a('0x37')](')'));_0x243509['enduserId']=_0x3f52a9;_0x56d765(_0x243509);})[_0x095a('0x1a')](function(_0xfb9cb5){_0x53cb53(_0xfb9cb5[_0x095a('0x1d')]);});});}function getEndUser(_0x5e5c37,_0x26ed85,_0x5c1fb2,_0x28c387,_0x3267f9,_0x6c6eb2,_0x429d7a,_0x5905d4){var _0x28bab8=_0x6c6eb2[_0x095a('0x31')]()===_0x095a('0x38')?_0x3267f9['destcalleridnum']:_0x3267f9[_0x095a('0x39')];return getAuthToken(_0x26ed85,_0x5c1fb2,_0x6c6eb2)[_0x095a('0x1e')](function(_0x441e60){_0x5905d4=_0x5905d4?_0x5905d4:_0x095a('0x3a');var _0x1de600={'method':_0x095a('0x1f'),'uri':_0x28c387+_0x095a('0x3b')+_0x5905d4+_0x095a('0x3c')+_0x5905d4+_0x095a('0x3d')+_0x28bab8['replace']('+',_0x095a('0x3e'))+'\x27','headers':{'Authorization':_0x095a('0x21')+_0x441e60,'If-None-Match':null,'OData-Version':_0x095a('0x22')},'json':!![]};return rp(_0x1de600);})[_0x095a('0x1e')](function(_0x3a2054){var _0x159015=![];if(!_0x3a2054)return _0x159015;var _0x3bc49f=_0x3a2054[_0x095a('0x23')];for(var _0x511163=0x0;_0x511163<_0x3bc49f['length'];_0x511163++){if(_0x3bc49f[_0x511163][_0x5905d4]===_0x28bab8){_0x159015=!![];_0x5e5c37[_0x095a('0x3f')]=_0x3bc49f[_0x511163][_0x095a('0x40')];}}return _0x159015;})['then'](function(_0x77445d){if(_0x77445d)return _0x5e5c37;if(_0x429d7a===_0x095a('0x41')){logger[_0x095a('0x2f')]('['+[_0x6c6eb2[_0x095a('0x2b')]()]+_0x095a('0x42'));return _0x5e5c37;}return createEndUser(_0x5e5c37,_0x26ed85,_0x5c1fb2,_0x28c387,_0x3267f9,_0x6c6eb2,_0x5905d4)[_0x095a('0x1e')](function(_0x6e2f59){logger[_0x095a('0x2f')]('['+[_0x6c6eb2[_0x095a('0x2b')]()]+']\x20Enduser\x20created!',_0x6e2f59[_0x095a('0x3f')]);return _0x6e2f59;});});}function getCustomFields(_0x1ae323,_0x60881a,_0x3c6f39){var _0x500b24={};if(_0x1ae323[_0x095a('0x28')]>0x0){_[_0x095a('0x43')](_0x1ae323,function(_0x3853b0){if(_[_0x095a('0x44')]([_0x095a('0x45'),_0x095a('0x46')],_0x3853b0[_0x095a('0x47')])&&_0x3853b0[_0x095a('0x48')]&&!_0x3853b0[_0x095a('0x49')]){var _0x48ce4a=_0x3853b0[_0x095a('0x4a')]['toLowerCase']();var _0x44e7aa=_0x48ce4a['substring'](0x0,_0x48ce4a[_0x095a('0x4b')]('_'));var _0x1a92d8=_0x48ce4a[_0x095a('0x36')](_0x48ce4a['indexOf']('_')+0x1);if(_0x44e7aa===_0x3c6f39){_0x500b24[_0x1a92d8]=_0x3853b0[_0x095a('0x4c')];}}});}return _0x500b24;}function getTicket(_0x43f7c9,_0x1511c8,_0x5929c4,_0x32bfcc,_0x4f66a7,_0x15116c,_0x1a67df){return new Promise(function(_0x23cd44,_0x42747a){var _0x3ae9bc;return getAuthToken(_0x1511c8,_0x5929c4,_0x1a67df)[_0x095a('0x1e')](function(_0x1a02ab){if(_0x15116c[_0x095a('0x4d')]==='incident'){_0x3ae9bc={'method':_0x095a('0x14'),'uri':_0x32bfcc+_0x095a('0x4e'),'body':Object[_0x095a('0x4f')]({},{'title':intUtil[_0x095a('0x50')](_0x15116c[_0x095a('0x51')],_0x4f66a7,'\x20'),'description':intUtil[_0x095a('0x50')](_0x15116c[_0x095a('0x52')],_0x4f66a7,'\x0a'),'customerid_contact@odata.bind':_0x43f7c9[_0x095a('0x3f')]?_0x095a('0x53')+_0x43f7c9[_0x095a('0x3f')]+')':undefined,'ownerid@odata.bind':_0x095a('0x34')+_0x43f7c9[_0x095a('0x2e')]+')','caseorigincode':'1'},getCustomFields(_0x15116c[_0x095a('0x54')],_0x4f66a7,_0x15116c[_0x095a('0x4d')])),'headers':{'Authorization':_0x095a('0x21')+_0x1a02ab,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x15116c[_0x095a('0x4d')]===_0x095a('0x55')){var _0x192ec4=_0x43f7c9['enduserId']?[{'partyid_systemuser@odata.bind':_0x095a('0x34')+_0x43f7c9[_0x095a('0x2e')]+')','participationtypemask':_0x43f7c9[_0x095a('0x56')]===_0x095a('0x57')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x43f7c9['enduserId']+')','participationtypemask':_0x43f7c9['callDirection']===_0x095a('0x57')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x095a('0x34')+_0x43f7c9['userId']+')','participationtypemask':_0x43f7c9[_0x095a('0x56')]===_0x095a('0x57')?0x2:0x1}];_0x3ae9bc={'method':_0x095a('0x14'),'uri':_0x32bfcc+'phonecalls','body':Object[_0x095a('0x4f')]({},{'subject':intUtil['getString'](_0x15116c[_0x095a('0x51')],_0x4f66a7,'\x20'),'phonenumber':String(_0x4f66a7[_0x095a('0x39')]),'description':intUtil[_0x095a('0x50')](_0x15116c[_0x095a('0x52')],_0x4f66a7,'\x0a'),'regardingobjectid_contact@odata.bind':_0x43f7c9[_0x095a('0x3f')]?_0x095a('0x53')+_0x43f7c9['enduserId']+')':undefined,'ownerid@odata.bind':_0x095a('0x34')+_0x43f7c9[_0x095a('0x2e')]+')','directioncode':_0x43f7c9[_0x095a('0x56')]==='queue'?![]:!![],'phonecall_activity_parties':_0x192ec4},getCustomFields(_0x15116c[_0x095a('0x54')],_0x4f66a7,_0x15116c['ticketType'])),'headers':{'Authorization':_0x095a('0x21')+_0x1a02ab,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3ae9bc);})[_0x095a('0x1e')](function(_0x35edd8){var _0x101c17=_0x35edd8['headers'][_0x095a('0x58')];var _0x1007e6=_0x101c17[_0x095a('0x36')](_0x101c17[_0x095a('0x37')]('(')+0x1,_0x101c17[_0x095a('0x37')](')'));_0x43f7c9['ticketId']=_0x1007e6;_0x23cd44(_0x43f7c9);})['catch'](function(_0x30158d){_0x42747a(_0x30158d['message']);});});}function emit(_0x27dfa0,_0x5e759d,_0x598670,_0x464d25){var _0x8a5022={'uri':util[_0x095a('0x59')](_0x095a('0x5a'),_0x27dfa0,_0x598670,_0x464d25)};io['to'](util['format'](_0x095a('0x5b'),_0x5e759d))[_0x095a('0x5c')](_0x095a('0x5d'),_0x8a5022);}exports['cs']=function(_0x158cc9,_0x50ffce,_0x15eb38,_0x261371,_0xd27b40,_0x20d119,_0x46d9a5,_0x4b41a2){var _0x1bc2c6={};_0x20d119['remoteUri']=_0x20d119[_0x095a('0xd')]?intUtil['stripTrailingSlash'](_0x20d119[_0x095a('0xf')][_0x095a('0x10')]):intUtil[_0x095a('0x5e')](_0x20d119[_0x095a('0xe')]);_0x20d119[_0x095a('0x5f')]=intUtil[_0x095a('0x5e')](_0x20d119[_0x095a('0x5f')]);_0x1bc2c6[_0x095a('0x56')]=_0x4b41a2===_0x095a('0x57')||_0x4b41a2===_0x095a('0x60')?_0x095a('0x57'):_0x095a('0x38');var _0x4cee2c=_0x20d119[_0x095a('0xd')]?util[_0x095a('0x59')]('%s/api/data/v9.0/',_0x20d119[_0x095a('0xf')][_0x095a('0x10')]):util[_0x095a('0x59')](_0x095a('0x61'),_0x20d119[_0x095a('0xe')]);var _0x16b9df=util[_0x095a('0x59')](_0x095a('0x62'),_0x20d119[_0x095a('0x11')]);var _0x99ad73=util[_0x095a('0x59')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20d119[_0x095a('0x5f')],_0x50ffce['uniqueid'],md5(_0x50ffce[_0x095a('0x63')]));if(_0xd27b40&&_0xd27b40['monitor_format']){logger[_0x095a('0x2f')](_0x095a('0x64'),_0x095a('0x65'));_0x50ffce[_0x095a('0x66')]=_0x99ad73;}else if(_0x46d9a5&&_0x46d9a5['recordingFormat']&&_0x46d9a5[_0x095a('0x67')]!==_0x095a('0x68')){logger[_0x095a('0x2f')](_0x095a('0x69'),_0x095a('0x65'));_0x50ffce[_0x095a('0x66')]=_0x99ad73;}else{_0x50ffce[_0x095a('0x66')]='';}return getUser(_0x1bc2c6,_0x20d119,_0x261371,_0x16b9df,_0x4cee2c,_0x4b41a2)['then'](function(_0x372ad3){logger[_0x095a('0x2f')]('['+_0x4b41a2['toUpperCase']()+_0x095a('0x6a'),_0x372ad3['userId']);logger['info']('['+_0x4b41a2['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x372ad3['userEmail']);return getEndUser(_0x372ad3,_0x20d119,_0x16b9df,_0x4cee2c,_0x50ffce,_0x4b41a2,_0x15eb38[_0x095a('0x6b')],_0x15eb38[_0x095a('0x6c')]);})[_0x095a('0x1e')](function(_0x264162){logger[_0x095a('0x2f')]('['+_0x4b41a2[_0x095a('0x2b')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x264162[_0x095a('0x3f')]);logger[_0x095a('0x2f')]('['+_0x4b41a2['toUpperCase']()+_0x095a('0x6d'),_0x50ffce[_0x095a('0x39')]);return getTicket(_0x264162,_0x20d119,_0x16b9df,_0x4cee2c,_0x50ffce,_0x15eb38,_0x4b41a2);})[_0x095a('0x1e')](function(_0x4db195){logger[_0x095a('0x2f')](util['format']('['+_0x4b41a2[_0x095a('0x2b')]()+_0x095a('0x6e'),_0x15eb38[_0x095a('0x4d')],_0x4db195[_0x095a('0x6f')]));logger['info'](util[_0x095a('0x59')]('['+_0x4b41a2[_0x095a('0x2b')]()+_0x095a('0x70'),_0x4b41a2));if(_0x4b41a2!==_0x095a('0x60')&&_0x15eb38[_0x095a('0x71')]){logger[_0x095a('0x2f')]('['+_0x4b41a2[_0x095a('0x2b')]()+']',_0x095a('0x72'));emit(_0x20d119['remoteUri'],_0x261371['name'],_0x15eb38[_0x095a('0x4d')],_0x4db195[_0x095a('0x6f')]);}})[_0x095a('0x1a')](function(_0x28eea4){logger[_0x095a('0x1b')]('['+_0x4b41a2[_0x095a('0x2b')]()+_0x095a('0x73'),_0x28eea4[_0x095a('0x1d')]);console['error'](_0x095a('0x74'),_0x28eea4);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 98f8526..af5b022 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 _0xe7ec=['variableName','customVariable','name','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','Authorization','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','monitor_format','lastevent','toUpperCase','The\x20User\x20ID\x20is:','lodash','md5','util','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','info','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','Tags','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','customField','nameField','toLowerCase','content','includes','type','idField','push','variable'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe7ec,0x1ec));var _0xce7e=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0xe7ec[_0x496333];return _0x44256e;};'use strict';var _=require(_0xce7e('0x0'));var rp=require('request-promise');var md5=require(_0xce7e('0x1'));var util=require(_0xce7e('0x2'));var Redis=require(_0xce7e('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xce7e('0x4'))('freshdesk');config[_0xce7e('0x5')]=_['defaults'](config[_0xce7e('0x5')],{'host':_0xce7e('0x6'),'port':0x18eb});var io=require(_0xce7e('0x7'))(new Redis(config[_0xce7e('0x5')]));var headers={'Content-Type':_0xce7e('0x8'),'Accept':'application/json'};function emit(_0x193a27,_0x3a60c2,_0x1e4343){io['to'](_0x193a27)[_0xce7e('0x9')](_0x3a60c2,_0x1e4343);}function getTicket(_0x1ec03a,_0x21c7d9,_0x6cc4e7,_0x2e5d75,_0x5c07ab){logger[_0xce7e('0xa')]('Creating\x20new\x20ticket...');var _0x19f563=_[_0xce7e('0xb')]({'responder_id':_0x21c7d9['id'],'requester_id':_0x6cc4e7['id'],'name':util['format'](_0xce7e('0xc'),_0x5c07ab[_0xce7e('0xd')]),'phone':_0x5c07ab[_0xce7e('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xce7e('0xf')](_0x2e5d75[_0xce7e('0x10')],_0x5c07ab,'\x20'),'description':intUtil[_0xce7e('0xf')](_0x2e5d75[_0xce7e('0x11')],_0x5c07ab,'
'),'tags':getTags(_0x2e5d75[_0xce7e('0x12')],'name')},getCustomFields(_0x2e5d75[_0xce7e('0x13')],_0x5c07ab));_0x19f563[_0xce7e('0x14')]=_[_0xce7e('0x15')](_[_0xce7e('0x16')](_0x19f563['custom_fields'],'id'),_0xce7e('0x17'));return request({'uri':util['format']('%s/api/v2/tickets',_0x1ec03a[_0xce7e('0x18')]),'method':_0xce7e('0x19'),'body':_0x19f563})[_0xce7e('0x1a')](function(_0x284b70){logger[_0xce7e('0xa')](_0xce7e('0x1b'));return _0x284b70;});}function getUser(_0x179e8d,_0x5b9d77){if(intUtil[_0xce7e('0x1c')](_0x5b9d77)){return request({'uri':util['format'](_0xce7e('0x1d'),_0x179e8d[_0xce7e('0x18')]),'qs':{'email':_0x5b9d77}})[_0xce7e('0x1a')](function(_0x1de742){if(_0x1de742[_0xce7e('0x1e')]){logger[_0xce7e('0xa')]('Agent\x20found!');return _[_0xce7e('0x1f')](_0x1de742,function(_0x1eff62){return _0x1eff62[_0xce7e('0x20')]['email']===_0x5b9d77;});}else{logger['info'](_0xce7e('0x21'));return request({'uri':util[_0xce7e('0x22')](_0xce7e('0x23'),_0x179e8d[_0xce7e('0x18')])})[_0xce7e('0x1a')](function(_0x69e427){logger[_0xce7e('0xa')](_0xce7e('0x24'));return _0x69e427;});}});}else{logger[_0xce7e('0xa')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xce7e('0x23'),_0x179e8d[_0xce7e('0x18')])})[_0xce7e('0x1a')](function(_0x271e0b){logger[_0xce7e('0xa')]('Admin\x20account\x20selected.');return _0x271e0b;});}}function getEndUser(_0x5ed482,_0x21c4f5,_0x4315d8){logger[_0xce7e('0xa')](_0xce7e('0x25'),_0x4315d8);return request({'uri':util[_0xce7e('0x22')]('%s/api/v2/contacts',_0x5ed482[_0xce7e('0x18')]),'qs':{'phone':_0x4315d8}})[_0xce7e('0x1a')](function(_0x1bb1f5){if(_0x1bb1f5['length']){logger[_0xce7e('0xa')](_0xce7e('0x26'));return _['find'](_0x1bb1f5,{'phone':_0x4315d8});}else{logger[_0xce7e('0xa')](_0xce7e('0x27'));return request({'uri':util[_0xce7e('0x22')](_0xce7e('0x28'),_0x5ed482[_0xce7e('0x18')]),'method':_0xce7e('0x19'),'body':{'name':_0x21c4f5,'phone':_0x4315d8}})['then'](function(_0x42a3c4){logger[_0xce7e('0xa')]('Enduser\x20created.');return _0x42a3c4;});}});}function getAuth(_0x69c313){return util[_0xce7e('0x22')](_0xce7e('0x29'),new Buffer(_0x69c313['apiKey']+':X')[_0xce7e('0x2a')]('base64'));}function request(_0x236400){logger[_0xce7e('0x2b')](_0xce7e('0x2c'),JSON[_0xce7e('0x2d')](_0x236400));return rp(_['defaults'](_0x236400,{'method':_0xce7e('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x316e64,_0xfe5470){var _0x2b639c=[];if(_0x316e64&&_0x316e64[_0xce7e('0x1e')]>0x0){_0x2b639c=_[_0xce7e('0x2f')](_0x316e64,_0xfe5470);}return _0x2b639c;}function getCustomFields(_0x23ecc0,_0x1c6ecc){var _0x5ec705=[];var _0x14f5b2={'custom_fields':[]};if(_0x23ecc0[_0xce7e('0x1e')]>0x0){_[_0xce7e('0x30')](_0x23ecc0,function(_0x344f2a){if(_['includes']([_0xce7e('0x31'),_0xce7e('0x32')],_0x344f2a['type'])&&_0x344f2a['nameField']&&!_0x344f2a[_0xce7e('0x33')]){_0x14f5b2[_0x344f2a[_0xce7e('0x34')][_0xce7e('0x35')]()]=_0x344f2a[_0xce7e('0x36')][_0xce7e('0x2a')]();}else if(_[_0xce7e('0x37')]([_0xce7e('0x31'),_0xce7e('0x32')],_0x344f2a[_0xce7e('0x38')])&&_0x344f2a[_0xce7e('0x39')]&&_0x344f2a[_0xce7e('0x33')]){_0x14f5b2[_0xce7e('0x14')][_0xce7e('0x3a')]({'id':_0x344f2a['idField'],'value':_0x344f2a[_0xce7e('0x36')][_0xce7e('0x2a')]()});}else if(_0x344f2a[_0xce7e('0x38')]===_0xce7e('0x3b')&&_0x344f2a[_0xce7e('0x3c')]&&_0x344f2a[_0xce7e('0x39')]&&_0x344f2a[_0xce7e('0x33')]){_0x1c6ecc[_0x344f2a[_0xce7e('0x3c')]]&&_0x14f5b2[_0xce7e('0x14')]['push']({'id':_0x344f2a[_0xce7e('0x39')],'value':_0x1c6ecc[_0x344f2a[_0xce7e('0x3c')]][_0xce7e('0x2a')]()});}else if(_0x344f2a[_0xce7e('0x38')]===_0xce7e('0x3d')&&_0x344f2a['Variable']&&_0x344f2a['Variable'][_0xce7e('0x3e')]&&_0x344f2a[_0xce7e('0x39')]&&_0x344f2a[_0xce7e('0x33')]){_0x1c6ecc[_0x344f2a['Variable'][_0xce7e('0x3e')][_0xce7e('0x35')]()]&&_0x14f5b2['custom_fields'][_0xce7e('0x3a')]({'id':_0x344f2a['idField'],'value':_0x1c6ecc[_0x344f2a[_0xce7e('0x3f')][_0xce7e('0x3e')][_0xce7e('0x35')]()][_0xce7e('0x2a')]()});}});}return _0x14f5b2;}exports[_0xce7e('0x40')]=function(_0x19672f,_0x36b051,_0x46c415,_0x341847,_0x5935bf,_0x239561){var _0x17cc09,_0x366143;_0x239561[_0xce7e('0x18')]=intUtil[_0xce7e('0x41')](_0x239561[_0xce7e('0x18')]);_0x239561[_0xce7e('0x42')]=intUtil['stripTrailingSlash'](_0x239561[_0xce7e('0x42')]);if(_0x5935bf&&_0x5935bf['monitor_format']){logger[_0xce7e('0xa')](_0xce7e('0x43'),'Recording\x20is\x20enabled!');_0x36b051[_0xce7e('0x44')]=util[_0xce7e('0x22')](_0xce7e('0x45'),_0x239561[_0xce7e('0x42')],_0x36b051['uniqueid'],md5(_0x36b051[_0xce7e('0x46')]));}else{_0x36b051['recordingURL']='';}headers['Authorization']=getAuth(_0x239561);return getUser(_0x239561,_0x341847[_0xce7e('0x47')])[_0xce7e('0x1a')](function(_0x1ab444){_0x17cc09=_0x1ab444;logger[_0xce7e('0xa')]('The\x20User\x20ID\x20is:',_0x17cc09['id']);return getEndUser(_0x239561,_0x36b051[_0xce7e('0xd')],_0x36b051[_0xce7e('0xe')]);})[_0xce7e('0x1a')](function(_0x4feb8a){_0x366143=_0x4feb8a;logger[_0xce7e('0xa')](_0xce7e('0x48'),_0x366143['id']);return getTicket(_0x239561,_0x17cc09,_0x366143,_0x46c415,_0x36b051);})['then'](function(_0xd79671){if(_0xd79671&&_0xd79671['id']){logger[_0xce7e('0xa')](_0xce7e('0x1b'));logger[_0xce7e('0xa')](_0xce7e('0x49'),_0xd79671['id']);logger[_0xce7e('0xa')](_0xce7e('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xce7e('0x4a'),_0x341847['name']),_0xce7e('0x4b'),{'uri':util['format'](_0xce7e('0x4c'),_0x239561[_0xce7e('0x18')],_0xd79671['id'])});}})[_0xce7e('0x4d')](function(_0x4bc6c7){logger[_0xce7e('0x4e')](_0xce7e('0x43'),JSON[_0xce7e('0x2d')](_0x4bc6c7));});};exports[_0xce7e('0x4f')]=function(_0x53ebca,_0x5079f7,_0x4828a1,_0x164b5b,_0x30ffce,_0x363777,_0x22ea2d){var _0x3ddad6,_0x242c05;_0x363777['remoteUri']=intUtil[_0xce7e('0x41')](_0x363777[_0xce7e('0x18')]);_0x363777[_0xce7e('0x42')]=intUtil[_0xce7e('0x41')](_0x363777[_0xce7e('0x42')]);if(_0x22ea2d&&_0x22ea2d[_0xce7e('0x50')]&&_0x22ea2d[_0xce7e('0x50')]!==_0xce7e('0x51')){logger[_0xce7e('0xa')](_0xce7e('0x52'),_0xce7e('0x53'));_0x5079f7[_0xce7e('0x44')]=util[_0xce7e('0x22')](_0xce7e('0x45'),_0x363777[_0xce7e('0x42')],_0x5079f7[_0xce7e('0x46')],md5(_0x5079f7[_0xce7e('0x46')]));}headers[_0xce7e('0x54')]=getAuth(_0x363777);return getUser(_0x363777,_0x164b5b[_0xce7e('0x47')])[_0xce7e('0x1a')](function(_0x662082){_0x3ddad6=_0x662082;logger[_0xce7e('0xa')]('The\x20User\x20ID\x20is:',_0x3ddad6['id']);return getEndUser(_0x363777,_0x5079f7[_0xce7e('0x55')],_0x5079f7['destcalleridnum']);})[_0xce7e('0x1a')](function(_0x33e23d){_0x242c05=_0x33e23d;logger[_0xce7e('0xa')](_0xce7e('0x48'),_0x242c05['id']);return getTicket(_0x363777,_0x3ddad6,_0x242c05,_0x4828a1,_0x5079f7);})['then'](function(_0x49bbae){if(_0x49bbae&&_0x49bbae['id']){logger[_0xce7e('0xa')](_0xce7e('0x1b'));logger[_0xce7e('0xa')](_0xce7e('0x49'),_0x49bbae['id']);logger[_0xce7e('0xa')]('[OUTBOUND]',_0xce7e('0x56'));emit(util[_0xce7e('0x22')](_0xce7e('0x4a'),_0x164b5b[_0xce7e('0x3e')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x363777[_0xce7e('0x18')],_0x49bbae['id'])});}})[_0xce7e('0x4d')](function(_0x480a6f){logger[_0xce7e('0x4e')](_0xce7e('0x52'),JSON['stringify'](_0x480a6f));});};exports[_0xce7e('0x57')]=function(_0x346994,_0x1a0c18,_0x283f57,_0x6bafe1,_0x3ca5f2,_0x2b78ba){var _0x3f2ec3,_0x5e27e4;_0x2b78ba['remoteUri']=intUtil[_0xce7e('0x41')](_0x2b78ba[_0xce7e('0x18')]);_0x2b78ba['serverUrl']=intUtil[_0xce7e('0x41')](_0x2b78ba['serverUrl']);if(_0x3ca5f2&&_0x3ca5f2[_0xce7e('0x58')]){logger[_0xce7e('0xa')]('['+_0x1a0c18[_0xce7e('0x59')][_0xce7e('0x5a')]()+']',_0xce7e('0x53'));_0x1a0c18['recordingURL']=util[_0xce7e('0x22')](_0xce7e('0x45'),_0x2b78ba[_0xce7e('0x42')],_0x1a0c18['uniqueid'],md5(_0x1a0c18[_0xce7e('0x46')]));}else{_0x1a0c18[_0xce7e('0x44')]='';}headers[_0xce7e('0x54')]=getAuth(_0x2b78ba);return getUser(_0x2b78ba,'')[_0xce7e('0x1a')](function(_0x3d90d4){_0x3f2ec3=_0x3d90d4;logger[_0xce7e('0xa')](_0xce7e('0x5b'),_0x3f2ec3['id']);return getEndUser(_0x2b78ba,_0x1a0c18[_0xce7e('0xd')],_0x1a0c18['calleridnum']);})['then'](function(_0x52f25d){_0x5e27e4=_0x52f25d;logger[_0xce7e('0xa')](_0xce7e('0x48'),_0x5e27e4['id']);return getTicket(_0x2b78ba,_0x3f2ec3,_0x5e27e4,_0x283f57,_0x1a0c18);})['then'](function(_0x1b1981){if(_0x1b1981){logger['info'](_0xce7e('0x1b'));logger[_0xce7e('0xa')](_0xce7e('0x49'),_0x1b1981['id']);}})['catch'](function(_0x20272d){logger[_0xce7e('0x4e')]('['+_0x1a0c18[_0xce7e('0x59')][_0xce7e('0x5a')]()+']',JSON[_0xce7e('0x2d')](_0x20272d));});}; \ No newline at end of file +var _0x0aa5=['apiKey','toString','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','picklist','type','nameField','content','string','idField','customField','push','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','email','destcalleridnum','[OUTBOUND]','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','./util','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s'];(function(_0x36aa05,_0x3117cc){var _0x293263=function(_0x1bdc70){while(--_0x1bdc70){_0x36aa05['push'](_0x36aa05['shift']());}};_0x293263(++_0x3117cc);}(_0x0aa5,0x15b));var _0x50aa=function(_0x141a4f,_0x37ead0){_0x141a4f=_0x141a4f-0x0;var _0x23657c=_0x0aa5[_0x141a4f];return _0x23657c;};'use strict';var _=require(_0x50aa('0x0'));var rp=require(_0x50aa('0x1'));var md5=require(_0x50aa('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x50aa('0x3'));var config=require('../../../../config/environment');var logger=require(_0x50aa('0x4'))(_0x50aa('0x5'));config['redis']=_['defaults'](config[_0x50aa('0x6')],{'host':_0x50aa('0x7'),'port':0x18eb});var io=require(_0x50aa('0x8'))(new Redis(config[_0x50aa('0x6')]));var headers={'Content-Type':_0x50aa('0x9'),'Accept':_0x50aa('0x9')};function emit(_0xf5185b,_0x147e4b,_0x9cc145){io['to'](_0xf5185b)[_0x50aa('0xa')](_0x147e4b,_0x9cc145);}function getTicket(_0x3f1d50,_0x59dbb8,_0xa021e2,_0x23d5ca,_0x1ccca4){logger[_0x50aa('0xb')](_0x50aa('0xc'));var _0x7d38c3=_[_0x50aa('0xd')]({'responder_id':_0x59dbb8['id'],'requester_id':_0xa021e2['id'],'name':util[_0x50aa('0xe')](_0x50aa('0xf'),_0x1ccca4[_0x50aa('0x10')]),'phone':_0x1ccca4[_0x50aa('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x50aa('0x12')](_0x23d5ca[_0x50aa('0x13')],_0x1ccca4,'\x20'),'description':intUtil[_0x50aa('0x12')](_0x23d5ca['Descriptions'],_0x1ccca4,_0x50aa('0x14')),'tags':getTags(_0x23d5ca[_0x50aa('0x15')],'name')},getCustomFields(_0x23d5ca[_0x50aa('0x16')],_0x1ccca4));_0x7d38c3[_0x50aa('0x17')]=_[_0x50aa('0x18')](_[_0x50aa('0x19')](_0x7d38c3['custom_fields'],'id'),_0x50aa('0x1a'));return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x1b'),_0x3f1d50['remoteUri']),'method':_0x50aa('0x1c'),'body':_0x7d38c3})[_0x50aa('0x1d')](function(_0x1857b2){logger['info']('Ticket\x20created!');return _0x1857b2;});}function getUser(_0x1a97bf,_0x472870){if(intUtil['validateEmail'](_0x472870)){return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x1e'),_0x1a97bf[_0x50aa('0x1f')]),'qs':{'email':_0x472870}})[_0x50aa('0x1d')](function(_0x469b41){if(_0x469b41[_0x50aa('0x20')]){logger[_0x50aa('0xb')](_0x50aa('0x21'));return _[_0x50aa('0x22')](_0x469b41,function(_0x53dfd5){return _0x53dfd5[_0x50aa('0x23')]['email']===_0x472870;});}else{logger[_0x50aa('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x50aa('0x24'),_0x1a97bf[_0x50aa('0x1f')])})[_0x50aa('0x1d')](function(_0x274bf1){logger[_0x50aa('0xb')](_0x50aa('0x25'));return _0x274bf1;});}});}else{logger['info'](_0x50aa('0x26'));return request({'uri':util[_0x50aa('0xe')]('%s/api/v2/agents/me',_0x1a97bf[_0x50aa('0x1f')])})[_0x50aa('0x1d')](function(_0x8e423f){logger[_0x50aa('0xb')]('Admin\x20account\x20selected.');return _0x8e423f;});}}function getEndUser(_0x2af3e3,_0x444c6a,_0x155129){logger['info'](_0x50aa('0x27'),_0x155129);return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x28'),_0x2af3e3[_0x50aa('0x1f')]),'qs':{'phone':_0x155129}})['then'](function(_0xf4c284){if(_0xf4c284['length']){logger[_0x50aa('0xb')](_0x50aa('0x29'));return _['find'](_0xf4c284,{'phone':_0x155129});}else{logger[_0x50aa('0xb')](_0x50aa('0x2a'));return request({'uri':util[_0x50aa('0xe')](_0x50aa('0x28'),_0x2af3e3[_0x50aa('0x1f')]),'method':_0x50aa('0x1c'),'body':{'name':_0x444c6a,'phone':_0x155129}})['then'](function(_0x4cc86a){logger[_0x50aa('0xb')](_0x50aa('0x2b'));return _0x4cc86a;});}});}function getAuth(_0x59f9d9){return util[_0x50aa('0xe')](_0x50aa('0x2c'),new Buffer(_0x59f9d9[_0x50aa('0x2d')]+':X')[_0x50aa('0x2e')]('base64'));}function request(_0x45ec){logger[_0x50aa('0x2f')](_0x50aa('0x30'),JSON[_0x50aa('0x31')](_0x45ec));return rp(_[_0x50aa('0x32')](_0x45ec,{'method':_0x50aa('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x5d23c2,_0x374541){var _0x440b82=[];if(_0x5d23c2&&_0x5d23c2[_0x50aa('0x20')]>0x0){_0x440b82=_[_0x50aa('0x34')](_0x5d23c2,_0x374541);}return _0x440b82;}function getCustomFields(_0x55b157,_0x1c8bb3){var _0x4b00ea=[];var _0x7dee91={'custom_fields':[]};if(_0x55b157[_0x50aa('0x20')]>0x0){_[_0x50aa('0x35')](_0x55b157,function(_0x43fc7d){if(_[_0x50aa('0x36')](['string',_0x50aa('0x37')],_0x43fc7d[_0x50aa('0x38')])&&_0x43fc7d['nameField']&&!_0x43fc7d['customField']){_0x7dee91[_0x43fc7d[_0x50aa('0x39')]['toLowerCase']()]=_0x43fc7d[_0x50aa('0x3a')][_0x50aa('0x2e')]();}else if(_[_0x50aa('0x36')]([_0x50aa('0x3b'),'picklist'],_0x43fc7d['type'])&&_0x43fc7d[_0x50aa('0x3c')]&&_0x43fc7d[_0x50aa('0x3d')]){_0x7dee91[_0x50aa('0x17')][_0x50aa('0x3e')]({'id':_0x43fc7d[_0x50aa('0x3c')],'value':_0x43fc7d[_0x50aa('0x3a')][_0x50aa('0x2e')]()});}else if(_0x43fc7d[_0x50aa('0x38')]===_0x50aa('0x3f')&&_0x43fc7d[_0x50aa('0x40')]&&_0x43fc7d[_0x50aa('0x3c')]&&_0x43fc7d['customField']){_0x1c8bb3[_0x43fc7d[_0x50aa('0x40')]]&&_0x7dee91[_0x50aa('0x17')][_0x50aa('0x3e')]({'id':_0x43fc7d['idField'],'value':_0x1c8bb3[_0x43fc7d[_0x50aa('0x40')]]['toString']()});}else if(_0x43fc7d[_0x50aa('0x38')]===_0x50aa('0x41')&&_0x43fc7d['Variable']&&_0x43fc7d[_0x50aa('0x42')][_0x50aa('0x43')]&&_0x43fc7d[_0x50aa('0x3c')]&&_0x43fc7d['customField']){_0x1c8bb3[_0x43fc7d[_0x50aa('0x42')][_0x50aa('0x43')][_0x50aa('0x44')]()]&&_0x7dee91[_0x50aa('0x17')]['push']({'id':_0x43fc7d['idField'],'value':_0x1c8bb3[_0x43fc7d[_0x50aa('0x42')][_0x50aa('0x43')][_0x50aa('0x44')]()][_0x50aa('0x2e')]()});}});}return _0x7dee91;}exports[_0x50aa('0x45')]=function(_0x3e22c6,_0x1b6a0d,_0x1a6903,_0xaff751,_0x508b6e,_0x135fe1){var _0x55aa79,_0x14f7f3;_0x135fe1['remoteUri']=intUtil[_0x50aa('0x46')](_0x135fe1[_0x50aa('0x1f')]);_0x135fe1[_0x50aa('0x47')]=intUtil['stripTrailingSlash'](_0x135fe1[_0x50aa('0x47')]);if(_0x508b6e&&_0x508b6e[_0x50aa('0x48')]){logger['info'](_0x50aa('0x49'),_0x50aa('0x4a'));_0x1b6a0d[_0x50aa('0x4b')]=util['format'](_0x50aa('0x4c'),_0x135fe1['serverUrl'],_0x1b6a0d[_0x50aa('0x4d')],md5(_0x1b6a0d[_0x50aa('0x4d')]));}else{_0x1b6a0d[_0x50aa('0x4b')]='';}headers[_0x50aa('0x4e')]=getAuth(_0x135fe1);return getUser(_0x135fe1,_0xaff751['email'])[_0x50aa('0x1d')](function(_0x284a38){_0x55aa79=_0x284a38;logger[_0x50aa('0xb')](_0x50aa('0x4f'),_0x55aa79['id']);return getEndUser(_0x135fe1,_0x1b6a0d[_0x50aa('0x10')],_0x1b6a0d[_0x50aa('0x11')]);})['then'](function(_0x4b65a2){_0x14f7f3=_0x4b65a2;logger[_0x50aa('0xb')](_0x50aa('0x50'),_0x14f7f3['id']);return getTicket(_0x135fe1,_0x55aa79,_0x14f7f3,_0x1a6903,_0x1b6a0d);})[_0x50aa('0x1d')](function(_0x56d902){if(_0x56d902&&_0x56d902['id']){logger[_0x50aa('0xb')](_0x50aa('0x51'));logger[_0x50aa('0xb')](_0x50aa('0x52'),_0x56d902['id']);logger['info']('[QUEUE]',_0x50aa('0x53'));emit(util[_0x50aa('0xe')](_0x50aa('0x54'),_0xaff751[_0x50aa('0x43')]),_0x50aa('0x55'),{'uri':util[_0x50aa('0xe')]('%s/helpdesk/tickets/%d',_0x135fe1[_0x50aa('0x1f')],_0x56d902['id'])});}})[_0x50aa('0x56')](function(_0x145f6a){logger[_0x50aa('0x57')](_0x50aa('0x49'),JSON[_0x50aa('0x31')](_0x145f6a));});};exports[_0x50aa('0x58')]=function(_0x1aa643,_0x54c15d,_0x4eca0e,_0x2473fb,_0x3a7c5e,_0x3c44fb,_0x10f24b){var _0x40f9ef,_0x2fe2ab;_0x3c44fb[_0x50aa('0x1f')]=intUtil[_0x50aa('0x46')](_0x3c44fb['remoteUri']);_0x3c44fb[_0x50aa('0x47')]=intUtil[_0x50aa('0x46')](_0x3c44fb['serverUrl']);if(_0x10f24b&&_0x10f24b['recordingFormat']&&_0x10f24b[_0x50aa('0x59')]!==_0x50aa('0x5a')){logger['info']('[OUTBOUND]',_0x50aa('0x4a'));_0x54c15d[_0x50aa('0x4b')]=util[_0x50aa('0xe')](_0x50aa('0x4c'),_0x3c44fb[_0x50aa('0x47')],_0x54c15d[_0x50aa('0x4d')],md5(_0x54c15d[_0x50aa('0x4d')]));}headers[_0x50aa('0x4e')]=getAuth(_0x3c44fb);return getUser(_0x3c44fb,_0x2473fb[_0x50aa('0x5b')])[_0x50aa('0x1d')](function(_0x5b5c27){_0x40f9ef=_0x5b5c27;logger[_0x50aa('0xb')](_0x50aa('0x4f'),_0x40f9ef['id']);return getEndUser(_0x3c44fb,_0x54c15d['destcalleridname'],_0x54c15d[_0x50aa('0x5c')]);})[_0x50aa('0x1d')](function(_0x7c292a){_0x2fe2ab=_0x7c292a;logger['info'](_0x50aa('0x50'),_0x2fe2ab['id']);return getTicket(_0x3c44fb,_0x40f9ef,_0x2fe2ab,_0x4eca0e,_0x54c15d);})[_0x50aa('0x1d')](function(_0x3528a7){if(_0x3528a7&&_0x3528a7['id']){logger[_0x50aa('0xb')](_0x50aa('0x51'));logger['info'](_0x50aa('0x52'),_0x3528a7['id']);logger[_0x50aa('0xb')](_0x50aa('0x5d'),_0x50aa('0x53'));emit(util[_0x50aa('0xe')](_0x50aa('0x54'),_0x2473fb[_0x50aa('0x43')]),_0x50aa('0x55'),{'uri':util['format'](_0x50aa('0x5e'),_0x3c44fb[_0x50aa('0x1f')],_0x3528a7['id'])});}})['catch'](function(_0x33d0a6){logger['error'](_0x50aa('0x5d'),JSON['stringify'](_0x33d0a6));});};exports[_0x50aa('0x5f')]=function(_0x52cce3,_0x45313f,_0x26d8f4,_0x3843bd,_0x35fe60,_0x65d7b1){var _0x1bc1dc,_0x4c38d3;_0x65d7b1[_0x50aa('0x1f')]=intUtil['stripTrailingSlash'](_0x65d7b1[_0x50aa('0x1f')]);_0x65d7b1['serverUrl']=intUtil[_0x50aa('0x46')](_0x65d7b1[_0x50aa('0x47')]);if(_0x35fe60&&_0x35fe60[_0x50aa('0x48')]){logger[_0x50aa('0xb')]('['+_0x45313f[_0x50aa('0x60')][_0x50aa('0x61')]()+']','Recording\x20is\x20enabled!');_0x45313f[_0x50aa('0x4b')]=util[_0x50aa('0xe')](_0x50aa('0x4c'),_0x65d7b1['serverUrl'],_0x45313f[_0x50aa('0x4d')],md5(_0x45313f[_0x50aa('0x4d')]));}else{_0x45313f[_0x50aa('0x4b')]='';}headers[_0x50aa('0x4e')]=getAuth(_0x65d7b1);return getUser(_0x65d7b1,'')[_0x50aa('0x1d')](function(_0x490d9b){_0x1bc1dc=_0x490d9b;logger[_0x50aa('0xb')](_0x50aa('0x4f'),_0x1bc1dc['id']);return getEndUser(_0x65d7b1,_0x45313f['calleridname'],_0x45313f[_0x50aa('0x11')]);})[_0x50aa('0x1d')](function(_0x41c120){_0x4c38d3=_0x41c120;logger[_0x50aa('0xb')]('The\x20Enduser\x20ID\x20is:',_0x4c38d3['id']);return getTicket(_0x65d7b1,_0x1bc1dc,_0x4c38d3,_0x26d8f4,_0x45313f);})[_0x50aa('0x1d')](function(_0x133c6a){if(_0x133c6a){logger[_0x50aa('0xb')](_0x50aa('0x51'));logger[_0x50aa('0xb')]('The\x20Ticket\x20ID\x20is:',_0x133c6a['id']);}})[_0x50aa('0x56')](function(_0x16f8b7){logger[_0x50aa('0x57')]('['+_0x45313f[_0x50aa('0x60')][_0x50aa('0x61')]()+']',JSON[_0x50aa('0x31')](_0x16f8b7));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 3558eda..ac4d317 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 _0x2f4d=['&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','headers','contact','Creating\x20new\x20task','getString','Subjects','Contact','add','ticketId','task','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','util','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f='];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x2f4d,0x1ed));var _0xd2f4=function(_0x14d712,_0x4ef832){_0x14d712=_0x14d712-0x0;var _0x27457f=_0x2f4d[_0x14d712];return _0x27457f;};'use strict';var _=require(_0xd2f4('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xd2f4('0x1'));var moment=require(_0xd2f4('0x2'));var Promise=require(_0xd2f4('0x3'));var Redis=require(_0xd2f4('0x4'));var intUtil=require(_0xd2f4('0x5'));var config=require(_0xd2f4('0x6'));var logger=require('../../../../config/logger')(_0xd2f4('0x7'));config[_0xd2f4('0x8')]=_[_0xd2f4('0x9')](config[_0xd2f4('0x8')],{'host':_0xd2f4('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x33d63f,_0xa8b04f,_0x23e2b0,_0x30b535){return new Promise(function(_0x152b25,_0x222b18){var _0x5c9d81=![];var _0x4a616e={'method':'GET','uri':_0x30b535+_0xd2f4('0xb'),'json':!![]};_0x4a616e['headers']=_0x23e2b0;logger[_0xd2f4('0xc')](_0xd2f4('0xd'));return rp(_0x4a616e)[_0xd2f4('0xe')](function(_0x54ee2b){if(_0x54ee2b){var _0xd21ae0=_0x54ee2b[_0xd2f4('0xf')];var _0x424544=null;for(_0x424544=0x0;_0x424544<_0xd21ae0[_0xd2f4('0x10')];_0x424544++){if(_0xd21ae0[_0x424544]['email']===_0x33d63f[_0xd2f4('0x11')]){_0x33d63f[_0xd2f4('0x12')]=_0xd21ae0[_0x424544]['id'];_0x5c9d81=!![];}}if(_0x5c9d81){logger[_0xd2f4('0xc')]('Admin\x20found:',_0x33d63f[_0xd2f4('0x12')]);_0x152b25(_0x33d63f);}else{_0x222b18({'statusCode':0x194,'message':_0xd2f4('0x13')});}}else{_0x222b18({'statusCode':0x194,'message':_0xd2f4('0x13')});}})[_0xd2f4('0x14')](function(_0x1b0baa){logger[_0xd2f4('0x15')]('['+[_0xa8b04f[_0xd2f4('0x16')]()]+']',_0x1b0baa[_0xd2f4('0x17')]);_0x222b18(_0x1b0baa);});});}function getUser(_0x1e8f7a,_0x53bba7,_0x341542){return function(_0x4f399a){return new Promise(function(_0x449abc,_0x21b3d0){var _0x372246={'method':_0xd2f4('0x18'),'uri':_0x341542+_0xd2f4('0xb'),'json':!![]};_0x372246['headers']=_0x53bba7;logger[_0xd2f4('0xc')](_0xd2f4('0x19'));return rp(_0x372246)[_0xd2f4('0xe')](function(_0x5d79df){if(_0x5d79df){var _0xd26ecb=_0x5d79df[_0xd2f4('0xf')];var _0x586a4c=![];var _0x5402d7=null;if(_0x4f399a[_0xd2f4('0x1a')]!==null){logger[_0xd2f4('0xc')](_0xd2f4('0x1b'),_0x4f399a[_0xd2f4('0x1a')]);_0x4f399a[_0xd2f4('0x1c')]=_0x4f399a[_0xd2f4('0x1a')];for(_0x5402d7=0x0;_0x5402d7<_0xd26ecb[_0xd2f4('0x10')];_0x5402d7++){if(_0xd26ecb[_0x5402d7][_0xd2f4('0x1d')]===_0x4f399a[_0xd2f4('0x1a')]){_0x586a4c=!![];_0x4f399a[_0xd2f4('0x1e')]=_0xd26ecb[_0x5402d7]['id'];logger['info'](_0xd2f4('0x1f'),_0x4f399a[_0xd2f4('0x1e')]);}}}if(!_0x586a4c){logger[_0xd2f4('0xc')](_0xd2f4('0x20'));_0x4f399a[_0xd2f4('0x1c')]=_0x4f399a['adminEmail'];_0x4f399a['userId']=_0x4f399a['adminId'];_0x586a4c=!![];}if(_0x586a4c){_0x449abc(_0x4f399a);}else{_0x21b3d0({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x21b3d0({'statusCode':0x194,'message':_0xd2f4('0x13')});}})[_0xd2f4('0x14')](function(_0x31cbe9){logger[_0xd2f4('0x15')]('['+[_0x1e8f7a[_0xd2f4('0x16')]()]+']',_0x31cbe9[_0xd2f4('0x17')]);_0x21b3d0(_0x31cbe9);});});};}function searchContact(_0x3ffb83,_0x195034,_0x3f85e5,_0x4af9fe){return new Promise(function(_0x19f75e,_0x23a39c){var _0x523cbf={'method':'GET','headers':_0x195034,'uri':_0x3ffb83+_0xd2f4('0x21')+_0x4af9fe+_0xd2f4('0x22')+_0x3f85e5+_0xd2f4('0x23'),'json':!![]};rp(_0x523cbf)[_0xd2f4('0xe')](function(_0x30e04f){var _0x252a6d=_[_0xd2f4('0x24')](_0x30e04f[_0xd2f4('0x25')]['contacts'],[_0x3f85e5,_0x4af9fe]);_0x19f75e(_0x252a6d);})[_0xd2f4('0x14')](function(_0x43c72c){_0x23a39c(_0x43c72c);});});}function getEndUser(_0x549ff1,_0x36fd46,_0x5d18ac){return function(_0x5d4332){return new Promise(function(_0x276a0e,_0x2ea711){logger[_0xd2f4('0xc')](util[_0xd2f4('0x26')](_0xd2f4('0x27'),_0x5d4332[_0xd2f4('0x28')]));searchContact(_0x5d18ac,_0x36fd46,_0xd2f4('0x29'),_0x5d4332[_0xd2f4('0x28')])['then'](function(_0x443ba5){if(_0x443ba5){_0x5d4332[_0xd2f4('0x2a')]=_0x443ba5['id'];logger[_0xd2f4('0xc')](_0xd2f4('0x2b'),_0x5d4332['endUserId']);return _0x276a0e(_0x5d4332);}searchContact(_0x5d18ac,_0x36fd46,_0xd2f4('0x2c'),_0x5d4332[_0xd2f4('0x28')])[_0xd2f4('0xe')](function(_0x28ef12){if(_0x28ef12){_0x5d4332['endUserId']=_0x28ef12['id'];logger[_0xd2f4('0xc')](_0xd2f4('0x2d'),_0x5d4332[_0xd2f4('0x2a')]);return _0x276a0e(_0x5d4332);}createEndUser(_0x5d4332,_0x549ff1,_0x36fd46,_0x5d18ac)['then'](function(_0x177faf){logger[_0xd2f4('0xc')]('Contact\x20created:',_0x177faf[_0xd2f4('0x2a')]);return _0x276a0e(_0x177faf);});});})[_0xd2f4('0x14')](function(_0x4f565c){_0x2ea711(_0x4f565c);});});};}function createEndUser(_0x400a46,_0x3b22f4,_0x2a6074,_0x3463a2){return new Promise(function(_0x2440a3,_0x35bd61){var _0x5b3559=moment();var _0x5750c7={'method':_0xd2f4('0x2e'),'uri':_0x3463a2+_0xd2f4('0x2f'),'body':{'contact':{'last_name':_0x400a46['contactNumber'],'work_number':_0x400a46[_0xd2f4('0x28')],'mobile_number':_0x400a46[_0xd2f4('0x28')],'owner_id':_0x400a46[_0xd2f4('0x1e')],'created_at':_0x5b3559['format'](_0xd2f4('0x30'))}},'json':!![]};_0x5750c7[_0xd2f4('0x31')]=_0x2a6074;logger[_0xd2f4('0xc')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x5750c7)[_0xd2f4('0xe')](function(_0x1e01b5){_0x400a46[_0xd2f4('0x2a')]=_0x1e01b5[_0xd2f4('0x32')]['id'];_0x2440a3(_0x400a46);})[_0xd2f4('0x14')](function(_0x1b8b2f){logger[_0xd2f4('0x15')]('['+[_0x3b22f4[_0xd2f4('0x16')]()]+']',_0x1b8b2f[_0xd2f4('0x17')]);_0x35bd61(_0x1b8b2f[_0xd2f4('0x17')]);});});}function getTicket(_0x1b9a1c,_0x245a5c,_0x4ca418,_0x2926ad,_0x40ccd0){return function(_0x38bde0){logger[_0xd2f4('0xc')](_0xd2f4('0x33'));return new Promise(function(_0x1b7f05,_0x10dd51){var _0x18b069=moment();var _0xbffab1={'method':'POST','uri':_0x4ca418+'/api/tasks','body':{'title':intUtil[_0xd2f4('0x34')](_0x2926ad[_0xd2f4('0x35')],_0x40ccd0,'\x20'),'description':intUtil['getString'](_0x2926ad['Descriptions'],_0x40ccd0,'\x0a'),'owner_id':_0x38bde0[_0xd2f4('0x1e')],'creater_id':_0x38bde0[_0xd2f4('0x12')],'targetable_id':_0x38bde0[_0xd2f4('0x2a')],'targetable_type':_0xd2f4('0x36'),'created_at':_0x18b069[_0xd2f4('0x26')](_0xd2f4('0x30')),'due_date':_0x18b069[_0xd2f4('0x37')](0x1e,'m')[_0xd2f4('0x26')](_0xd2f4('0x30'))},'json':!![]};_0xbffab1[_0xd2f4('0x31')]=_0x245a5c;return rp(_0xbffab1)[_0xd2f4('0xe')](function(_0x526a8b){_0x38bde0[_0xd2f4('0x38')]=_0x526a8b[_0xd2f4('0x39')]['id'];logger[_0xd2f4('0xc')]('Task\x20created:',_0x38bde0[_0xd2f4('0x38')]);_0x1b7f05(_0x38bde0);})[_0xd2f4('0x14')](function(_0x1b847d){logger['error']('['+[_0x1b9a1c[_0xd2f4('0x16')]()]+']',_0x1b847d[_0xd2f4('0x17')]);_0x10dd51(_0x1b847d[_0xd2f4('0x17')]);});});};}function emit(_0x32ad7c,_0x38acd5,_0x52b746){var _0x3e2617={'uri':_0x32ad7c+'/contacts/'+_0x52b746};io['to'](util[_0xd2f4('0x26')](_0xd2f4('0x3a'),_0x38acd5))[_0xd2f4('0x3b')](_0xd2f4('0x3c'),_0x3e2617);}exports['cs']=function(_0x13caa1,_0x5361df,_0x21d24a,_0x5c81d9,_0x5ce141,_0x101f3b,_0xf5969b,_0x2c25fc){var _0x17b760={};var _0x35b59d={'Authorization':_0xd2f4('0x3d')+_0x101f3b[_0xd2f4('0x3e')]};_0x101f3b[_0xd2f4('0x3f')]=intUtil[_0xd2f4('0x40')](_0x101f3b[_0xd2f4('0x3f')]);_0x101f3b['serverUrl']=intUtil[_0xd2f4('0x40')](_0x101f3b[_0xd2f4('0x41')]);var _0x3216a9=_0x101f3b[_0xd2f4('0x3f')];_0x17b760[_0xd2f4('0x11')]=_0x101f3b[_0xd2f4('0x42')];_0x17b760[_0xd2f4('0x28')]=_0x2c25fc[_0xd2f4('0x43')]()===_0xd2f4('0x44')?_0x5361df[_0xd2f4('0x45')]:_0x5361df[_0xd2f4('0x46')];_0x17b760[_0xd2f4('0x47')]=_0x2c25fc===_0xd2f4('0x48')||_0x2c25fc===_0xd2f4('0x49')?_0xd2f4('0x48'):_0xd2f4('0x44');if(_0x5c81d9){_0x17b760[_0xd2f4('0x1a')]=_0x5c81d9[_0xd2f4('0x1d')];}var _0x2ced45=util[_0xd2f4('0x26')](_0xd2f4('0x4a'),_0x101f3b[_0xd2f4('0x41')],_0x5361df[_0xd2f4('0x4b')],md5(_0x5361df[_0xd2f4('0x4b')]));if(_0x5ce141&&_0x5ce141[_0xd2f4('0x4c')]){logger[_0xd2f4('0xc')](_0xd2f4('0x4d'),_0xd2f4('0x4e'));_0x5361df[_0xd2f4('0x4f')]=_0x2ced45;}else if(_0xf5969b&&_0xf5969b[_0xd2f4('0x50')]&&_0xf5969b['recordingFormat']!==_0xd2f4('0x51')){logger[_0xd2f4('0xc')](_0xd2f4('0x52'),_0xd2f4('0x4e'));_0x5361df[_0xd2f4('0x4f')]=_0x2ced45;}else{_0x5361df[_0xd2f4('0x4f')]='';}return getAdminId(_0x17b760,_0x2c25fc,_0x35b59d,_0x3216a9)[_0xd2f4('0xe')](getUser(_0x2c25fc,_0x35b59d,_0x3216a9))['then'](getEndUser(_0x2c25fc,_0x35b59d,_0x3216a9))['then'](getTicket(_0x2c25fc,_0x35b59d,_0x3216a9,_0x21d24a,_0x5361df))[_0xd2f4('0xe')](function(_0x323fce){logger['info'](util[_0xd2f4('0x26')](_0xd2f4('0x53'),_0x323fce[_0xd2f4('0x38')]));if(_0x2c25fc!==_0xd2f4('0x49')){logger[_0xd2f4('0xc')]('['+[_0x2c25fc[_0xd2f4('0x16')]()]+']',_0xd2f4('0x54'));emit(_0x3216a9,_0x5c81d9[_0xd2f4('0x55')],_0x323fce[_0xd2f4('0x2a')]);}})[_0xd2f4('0x14')](function(_0x42f364){logger[_0xd2f4('0x15')]('['+[_0x2c25fc[_0xd2f4('0x16')]()]+_0xd2f4('0x56'),util[_0xd2f4('0x57')](_0x42f364,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xae62=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','Getting\x20admin\x20information','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','headers','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','message','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','then','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','Subjects','getString','Descriptions','Contact','add','ticketId','task','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0xae62,0xb3));var _0x2ae6=function(_0x263296,_0x207799){_0x263296=_0x263296-0x0;var _0x2488bf=_0xae62[_0x263296];return _0x2488bf;};'use strict';var _=require('lodash');var rp=require(_0x2ae6('0x0'));var md5=require(_0x2ae6('0x1'));var util=require(_0x2ae6('0x2'));var moment=require('moment');var Promise=require(_0x2ae6('0x3'));var Redis=require(_0x2ae6('0x4'));var intUtil=require(_0x2ae6('0x5'));var config=require(_0x2ae6('0x6'));var logger=require(_0x2ae6('0x7'))(_0x2ae6('0x8'));config[_0x2ae6('0x9')]=_[_0x2ae6('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2ae6('0xb'))(new Redis(config[_0x2ae6('0x9')]));function getAdminId(_0x2ce77b,_0x3e9578,_0x8fd2fe,_0x13644d){return new Promise(function(_0x1b0a66,_0x175193){var _0xd94f73=![];var _0x8b2255={'method':_0x2ae6('0xc'),'uri':_0x13644d+_0x2ae6('0xd'),'json':!![]};_0x8b2255['headers']=_0x8fd2fe;logger['info'](_0x2ae6('0xe'));return rp(_0x8b2255)['then'](function(_0x5efdec){if(_0x5efdec){var _0x5e0153=_0x5efdec['users'];var _0x567924=null;for(_0x567924=0x0;_0x567924<_0x5e0153[_0x2ae6('0xf')];_0x567924++){if(_0x5e0153[_0x567924][_0x2ae6('0x10')]===_0x2ce77b[_0x2ae6('0x11')]){_0x2ce77b[_0x2ae6('0x12')]=_0x5e0153[_0x567924]['id'];_0xd94f73=!![];}}if(_0xd94f73){logger[_0x2ae6('0x13')](_0x2ae6('0x14'),_0x2ce77b['adminId']);_0x1b0a66(_0x2ce77b);}else{_0x175193({'statusCode':0x194,'message':_0x2ae6('0x15')});}}else{_0x175193({'statusCode':0x194,'message':_0x2ae6('0x15')});}})[_0x2ae6('0x16')](function(_0x5cac78){logger[_0x2ae6('0x17')]('['+[_0x3e9578[_0x2ae6('0x18')]()]+']',_0x5cac78['message']);_0x175193(_0x5cac78);});});}function getUser(_0x2b4cbd,_0x135bad,_0x46bc68){return function(_0x24dd8e){return new Promise(function(_0x139702,_0xb4c2eb){var _0x334b2e={'method':_0x2ae6('0xc'),'uri':_0x46bc68+'/api/selector/owners','json':!![]};_0x334b2e[_0x2ae6('0x19')]=_0x135bad;logger[_0x2ae6('0x13')](_0x2ae6('0x1a'));return rp(_0x334b2e)['then'](function(_0x570fc3){if(_0x570fc3){var _0x7b8e94=_0x570fc3[_0x2ae6('0x1b')];var _0x318380=![];var _0x43b470=null;if(_0x24dd8e[_0x2ae6('0x1c')]!==null){logger[_0x2ae6('0x13')](_0x2ae6('0x1d'),_0x24dd8e[_0x2ae6('0x1c')]);_0x24dd8e[_0x2ae6('0x1e')]=_0x24dd8e[_0x2ae6('0x1c')];for(_0x43b470=0x0;_0x43b470<_0x7b8e94['length'];_0x43b470++){if(_0x7b8e94[_0x43b470][_0x2ae6('0x10')]===_0x24dd8e[_0x2ae6('0x1c')]){_0x318380=!![];_0x24dd8e['userId']=_0x7b8e94[_0x43b470]['id'];logger[_0x2ae6('0x13')](_0x2ae6('0x1f'),_0x24dd8e[_0x2ae6('0x20')]);}}}if(!_0x318380){logger[_0x2ae6('0x13')]('Admin\x20selected');_0x24dd8e[_0x2ae6('0x1e')]=_0x24dd8e[_0x2ae6('0x11')];_0x24dd8e['userId']=_0x24dd8e[_0x2ae6('0x12')];_0x318380=!![];}if(_0x318380){_0x139702(_0x24dd8e);}else{_0xb4c2eb({'statusCode':0x194,'message':_0x2ae6('0x15')});}}else{_0xb4c2eb({'statusCode':0x194,'message':_0x2ae6('0x15')});}})[_0x2ae6('0x16')](function(_0xd71c5a){logger[_0x2ae6('0x17')]('['+[_0x2b4cbd['toUpperCase']()]+']',_0xd71c5a[_0x2ae6('0x21')]);_0xb4c2eb(_0xd71c5a);});});};}function searchContact(_0x47b524,_0x3581fd,_0x13a353,_0x3c6462){return new Promise(function(_0x1c19bf,_0x4920b5){var _0x8c7e12={'method':'GET','headers':_0x3581fd,'uri':_0x47b524+_0x2ae6('0x22')+_0x3c6462+'&f='+_0x13a353+_0x2ae6('0x23'),'json':!![]};rp(_0x8c7e12)['then'](function(_0x737f6f){var _0x26bc6a=_[_0x2ae6('0x24')](_0x737f6f[_0x2ae6('0x25')][_0x2ae6('0x25')],[_0x13a353,_0x3c6462]);_0x1c19bf(_0x26bc6a);})[_0x2ae6('0x16')](function(_0x5638b2){_0x4920b5(_0x5638b2);});});}function getEndUser(_0x54e558,_0x1c62ba,_0x2a85e0){return function(_0x2d046d){return new Promise(function(_0x17688f,_0xce1226){logger['info'](util[_0x2ae6('0x26')](_0x2ae6('0x27'),_0x2d046d[_0x2ae6('0x28')]));searchContact(_0x2a85e0,_0x1c62ba,_0x2ae6('0x29'),_0x2d046d[_0x2ae6('0x28')])[_0x2ae6('0x2a')](function(_0x5c5e3c){if(_0x5c5e3c){_0x2d046d['endUserId']=_0x5c5e3c['id'];logger['info'](_0x2ae6('0x2b'),_0x2d046d[_0x2ae6('0x2c')]);return _0x17688f(_0x2d046d);}searchContact(_0x2a85e0,_0x1c62ba,_0x2ae6('0x2d'),_0x2d046d[_0x2ae6('0x28')])[_0x2ae6('0x2a')](function(_0x3c2983){if(_0x3c2983){_0x2d046d[_0x2ae6('0x2c')]=_0x3c2983['id'];logger[_0x2ae6('0x13')](_0x2ae6('0x2e'),_0x2d046d[_0x2ae6('0x2c')]);return _0x17688f(_0x2d046d);}createEndUser(_0x2d046d,_0x54e558,_0x1c62ba,_0x2a85e0)[_0x2ae6('0x2a')](function(_0x2d1066){logger['info'](_0x2ae6('0x2f'),_0x2d1066['endUserId']);return _0x17688f(_0x2d1066);});});})['catch'](function(_0x151c1a){_0xce1226(_0x151c1a);});});};}function createEndUser(_0x2e4a67,_0x22c68c,_0x2650a2,_0x45fa87){return new Promise(function(_0x16a7a9,_0x20425d){var _0x27e7c3=moment();var _0x3c5aac={'method':_0x2ae6('0x30'),'uri':_0x45fa87+_0x2ae6('0x31'),'body':{'contact':{'last_name':_0x2e4a67[_0x2ae6('0x28')],'work_number':_0x2e4a67[_0x2ae6('0x28')],'mobile_number':_0x2e4a67[_0x2ae6('0x28')],'owner_id':_0x2e4a67[_0x2ae6('0x20')],'created_at':_0x27e7c3[_0x2ae6('0x26')](_0x2ae6('0x32'))}},'json':!![]};_0x3c5aac[_0x2ae6('0x19')]=_0x2650a2;logger[_0x2ae6('0x13')](_0x2ae6('0x33'));return rp(_0x3c5aac)['then'](function(_0x36ec6e){_0x2e4a67['endUserId']=_0x36ec6e[_0x2ae6('0x34')]['id'];_0x16a7a9(_0x2e4a67);})['catch'](function(_0x5bbc9c){logger[_0x2ae6('0x17')]('['+[_0x22c68c[_0x2ae6('0x18')]()]+']',_0x5bbc9c['message']);_0x20425d(_0x5bbc9c[_0x2ae6('0x21')]);});});}function getTicket(_0x145b6f,_0x461031,_0x2ed86d,_0x689ed0,_0xaabc7e){return function(_0x30ee35){logger[_0x2ae6('0x13')](_0x2ae6('0x35'));return new Promise(function(_0x2530e6,_0x47bb87){var _0x201406=moment();var _0x1524fc={'method':'POST','uri':_0x2ed86d+'/api/tasks','body':{'title':intUtil['getString'](_0x689ed0[_0x2ae6('0x36')],_0xaabc7e,'\x20'),'description':intUtil[_0x2ae6('0x37')](_0x689ed0[_0x2ae6('0x38')],_0xaabc7e,'\x0a'),'owner_id':_0x30ee35[_0x2ae6('0x20')],'creater_id':_0x30ee35[_0x2ae6('0x12')],'targetable_id':_0x30ee35[_0x2ae6('0x2c')],'targetable_type':_0x2ae6('0x39'),'created_at':_0x201406['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x201406[_0x2ae6('0x3a')](0x1e,'m')[_0x2ae6('0x26')](_0x2ae6('0x32'))},'json':!![]};_0x1524fc[_0x2ae6('0x19')]=_0x461031;return rp(_0x1524fc)[_0x2ae6('0x2a')](function(_0x8bfe06){_0x30ee35[_0x2ae6('0x3b')]=_0x8bfe06[_0x2ae6('0x3c')]['id'];logger['info']('Task\x20created:',_0x30ee35[_0x2ae6('0x3b')]);_0x2530e6(_0x30ee35);})['catch'](function(_0x3a9278){logger[_0x2ae6('0x17')]('['+[_0x145b6f[_0x2ae6('0x18')]()]+']',_0x3a9278[_0x2ae6('0x21')]);_0x47bb87(_0x3a9278['message']);});});};}function emit(_0x372b7f,_0x37aef8,_0x37e80e){var _0xfe9e10={'uri':_0x372b7f+'/contacts/'+_0x37e80e};io['to'](util['format']('user:%s',_0x37aef8))['emit'](_0x2ae6('0x3d'),_0xfe9e10);}exports['cs']=function(_0x48ca06,_0x1d53af,_0x3938d2,_0x32e4df,_0x26b691,_0x4e3e41,_0x3e3c05,_0x5899f2){var _0x2b5aff={};var _0x18bf18={'Authorization':_0x2ae6('0x3e')+_0x4e3e41[_0x2ae6('0x3f')]};_0x4e3e41[_0x2ae6('0x40')]=intUtil['stripTrailingSlash'](_0x4e3e41[_0x2ae6('0x40')]);_0x4e3e41[_0x2ae6('0x41')]=intUtil[_0x2ae6('0x42')](_0x4e3e41[_0x2ae6('0x41')]);var _0x9e5d29=_0x4e3e41[_0x2ae6('0x40')];_0x2b5aff[_0x2ae6('0x11')]=_0x4e3e41['username'];_0x2b5aff[_0x2ae6('0x28')]=_0x5899f2['toLowerCase']()==='outbound'?_0x1d53af[_0x2ae6('0x43')]:_0x1d53af[_0x2ae6('0x44')];_0x2b5aff[_0x2ae6('0x45')]=_0x5899f2===_0x2ae6('0x46')||_0x5899f2===_0x2ae6('0x47')?_0x2ae6('0x46'):_0x2ae6('0x48');if(_0x32e4df){_0x2b5aff['agentEmail']=_0x32e4df[_0x2ae6('0x10')];}var _0x4a1f28=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e3e41['serverUrl'],_0x1d53af[_0x2ae6('0x49')],md5(_0x1d53af[_0x2ae6('0x49')]));if(_0x26b691&&_0x26b691[_0x2ae6('0x4a')]){logger[_0x2ae6('0x13')](_0x2ae6('0x4b'),_0x2ae6('0x4c'));_0x1d53af[_0x2ae6('0x4d')]=_0x4a1f28;}else if(_0x3e3c05&&_0x3e3c05['recordingFormat']&&_0x3e3c05['recordingFormat']!==_0x2ae6('0x4e')){logger[_0x2ae6('0x13')](_0x2ae6('0x4f'),_0x2ae6('0x4c'));_0x1d53af[_0x2ae6('0x4d')]=_0x4a1f28;}else{_0x1d53af[_0x2ae6('0x4d')]='';}return getAdminId(_0x2b5aff,_0x5899f2,_0x18bf18,_0x9e5d29)[_0x2ae6('0x2a')](getUser(_0x5899f2,_0x18bf18,_0x9e5d29))['then'](getEndUser(_0x5899f2,_0x18bf18,_0x9e5d29))[_0x2ae6('0x2a')](getTicket(_0x5899f2,_0x18bf18,_0x9e5d29,_0x3938d2,_0x1d53af))[_0x2ae6('0x2a')](function(_0x4efe90){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4efe90['ticketId']));if(_0x5899f2!==_0x2ae6('0x47')){logger[_0x2ae6('0x13')]('['+[_0x5899f2[_0x2ae6('0x18')]()]+']',_0x2ae6('0x50'));emit(_0x9e5d29,_0x32e4df['name'],_0x4efe90[_0x2ae6('0x2c')]);}})[_0x2ae6('0x16')](function(_0x4f4708){logger[_0x2ae6('0x17')]('['+[_0x5899f2[_0x2ae6('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x2ae6('0x51')](_0x4f4708,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 8c64495..891005b 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 _0x17c9=['data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','desk','freshsales','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','lodash','util','./zendesk','./salesforce','./sugarcrm','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','vtiger','exec','toLowerCase','data1','data2','find','Configurations'];(function(_0x1927af,_0x28fbf5){var _0x3d5c39=function(_0x1071b7){while(--_0x1071b7){_0x1927af['push'](_0x1927af['shift']());}};_0x3d5c39(++_0x28fbf5);}(_0x17c9,0xc0));var _0x917c=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x17c9[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x917c('0x0'));var util=require(_0x917c('0x1'));var zendesk=require(_0x917c('0x2'));var salesforce=require(_0x917c('0x3'));var sugarcrm=require(_0x917c('0x4'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x917c('0x5'));var dynamics365=require(_0x917c('0x6'));var freshsales=require('./freshsales');var integrations=[_0x917c('0x7'),_0x917c('0x8'),'sugarcrm',_0x917c('0x9'),_0x917c('0xa'),'desk',_0x917c('0xb'),'dynamics365','freshsales','servicenow'];exports[_0x917c('0xc')]=function(_0x337396,_0x359b23,_0x16fc2a,_0x4fe371,_0x501702,_0x1c0144){if(_0x16fc2a){if(_['includes'](integrations,_0x337396['data1'][_0x917c('0xd')]())){try{var _0x30cb2a=null;var _0x2ee628='';var _0x3b13d2=_0x16fc2a[_0x337396[_0x917c('0xe')][_0x917c('0xd')]()];if(_0x3b13d2){var _0x41b1fa=_0x3b13d2[_0x337396[_0x917c('0xf')]];if(_0x41b1fa){var _0x59234e=_[_0x917c('0x10')](_0x41b1fa[_0x917c('0x11')],{'id':parseInt(_0x337396[_0x917c('0x12')],0xa)});if(_0x59234e){if(_0x4fe371){if(_0x501702&&_0x359b23[_0x917c('0x13')]){_0x2ee628='queue';}else if(_0x359b23[_0x917c('0x14')]){_0x2ee628=_0x917c('0x15');}else{console[_0x917c('0x16')](_0x917c('0x17'),_0x359b23);}}else{_0x2ee628=_0x917c('0x18');}switch(_0x337396[_0x917c('0xe')][_0x917c('0xd')]()){case _0x917c('0x7'):zendesk[_0x2ee628](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144);break;case'salesforce':salesforce[_0x2ee628](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144);break;case _0x917c('0x19'):sugarcrm[_0x2ee628](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144);break;case _0x917c('0x9'):freshdesk[_0x2ee628](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144);break;case _0x917c('0xa'):zoho[_0x2ee628](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144);break;case _0x917c('0x1a'):desk[_0x2ee628](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144);break;case _0x917c('0xb'):vtiger[_0x2ee628](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144);break;case _0x917c('0x1b'):freshsales['cs'](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144,_0x2ee628);break;case _0x917c('0x1c'):servicenow['cs'](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144,_0x2ee628);break;case _0x917c('0x1d'):dynamics365['cs'](_0x337396,_0x359b23,_0x59234e,_0x4fe371,_0x501702,_0x41b1fa,_0x1c0144,_0x2ee628);break;default:console[_0x917c('0x16')](_0x917c('0x1e'));}}else{_0x30cb2a=require(_0x917c('0x1f'))(_0x337396[_0x917c('0xe')]['toLowerCase']());_0x30cb2a[_0x917c('0x20')](_0x917c('0x21'),util[_0x917c('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x337396[_0x917c('0xe')][_0x917c('0xd')](),_0x337396[_0x917c('0x12')]));}}else{_0x30cb2a=require(_0x917c('0x1f'))(_0x337396['data1'][_0x917c('0xd')]());_0x30cb2a[_0x917c('0x20')](_0x917c('0x21'),util[_0x917c('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x337396[_0x917c('0xe')][_0x917c('0xd')](),_0x337396[_0x917c('0xf')]));}}else{}}catch(_0x2c01d6){console['error'](_0x2c01d6);}}}}; \ No newline at end of file +var _0x175e=['./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','util','./salesforce','./freshdesk'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x175e,0x138));var _0xe175=function(_0x3314cc,_0x158c72){_0x3314cc=_0x3314cc-0x0;var _0x2ef318=_0x175e[_0x3314cc];return _0x2ef318;};'use strict';var _=require('lodash');var util=require(_0xe175('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xe175('0x1'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xe175('0x2'));var zoho=require(_0xe175('0x3'));var desk=require('./desk');var vtiger=require(_0xe175('0x4'));var servicenow=require(_0xe175('0x5'));var dynamics365=require(_0xe175('0x6'));var freshsales=require('./freshsales');var integrations=[_0xe175('0x7'),_0xe175('0x8'),'sugarcrm',_0xe175('0x9'),_0xe175('0xa'),_0xe175('0xb'),_0xe175('0xc'),_0xe175('0xd'),_0xe175('0xe'),_0xe175('0xf')];exports[_0xe175('0x10')]=function(_0x9137c0,_0x4e4454,_0x559dfe,_0x3111db,_0x7ec81e,_0x1e4934){if(_0x559dfe){if(_['includes'](integrations,_0x9137c0[_0xe175('0x11')][_0xe175('0x12')]())){try{var _0x2f9cdf=null;var _0x24c38c='';var _0xf3dabc=_0x559dfe[_0x9137c0[_0xe175('0x11')][_0xe175('0x12')]()];if(_0xf3dabc){var _0x56cda0=_0xf3dabc[_0x9137c0[_0xe175('0x13')]];if(_0x56cda0){var _0x35b49a=_[_0xe175('0x14')](_0x56cda0[_0xe175('0x15')],{'id':parseInt(_0x9137c0[_0xe175('0x16')],0xa)});if(_0x35b49a){if(_0x3111db){if(_0x7ec81e&&_0x4e4454['queue']){_0x24c38c=_0xe175('0x17');}else if(_0x4e4454[_0xe175('0x18')]){_0x24c38c='outbound';}else{console[_0xe175('0x19')](_0xe175('0x1a'),_0x4e4454);}}else{_0x24c38c=_0xe175('0x1b');}switch(_0x9137c0[_0xe175('0x11')]['toLowerCase']()){case'zendesk':zendesk[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0x8'):salesforce[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0x1c'):sugarcrm[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0x9'):freshdesk[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case'zoho':zoho[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0xb'):desk[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0xc'):vtiger[_0x24c38c](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934);break;case _0xe175('0xe'):freshsales['cs'](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934,_0x24c38c);break;case _0xe175('0xf'):servicenow['cs'](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934,_0x24c38c);break;case _0xe175('0xd'):dynamics365['cs'](_0x9137c0,_0x4e4454,_0x35b49a,_0x3111db,_0x7ec81e,_0x56cda0,_0x1e4934,_0x24c38c);break;default:console[_0xe175('0x19')](_0xe175('0x1d'));}}else{_0x2f9cdf=require(_0xe175('0x1e'))(_0x9137c0['data1'][_0xe175('0x12')]());_0x2f9cdf[_0xe175('0x1f')](_0xe175('0x20'),util[_0xe175('0x21')](_0xe175('0x22'),_0x9137c0['data1'][_0xe175('0x12')](),_0x9137c0[_0xe175('0x16')]));}}else{_0x2f9cdf=require(_0xe175('0x1e'))(_0x9137c0['data1'][_0xe175('0x12')]());_0x2f9cdf[_0xe175('0x1f')]('[EXEC]',util[_0xe175('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x9137c0[_0xe175('0x11')][_0xe175('0x12')](),_0x9137c0[_0xe175('0x13')]));}}else{}}catch(_0x57eec9){console[_0xe175('0x1f')](_0x57eec9);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 2a4d0cd..3113f2f 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 _0xf97b=['toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','toString','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','newTab','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridname',']\x20Ticket\x20%s\x20created.','request-promise','moment','bluebird','jsforce','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','ticketType','Case','contact','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','execute','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Contact','Account','Name','attributes','type'];(function(_0x16863e,_0x2b522d){var _0x37c914=function(_0x27b427){while(--_0x27b427){_0x16863e['push'](_0x16863e['shift']());}};_0x37c914(++_0x2b522d);}(_0xf97b,0x13e));var _0xbf97=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf97b[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var rp=require(_0xbf97('0x0'));var moment=require(_0xbf97('0x1'));var BPromise=require(_0xbf97('0x2'));var md5=require('md5');var jsforce=require(_0xbf97('0x3'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xbf97('0x4'));var logger=require('../../../../config/logger')(_0xbf97('0x5'));config[_0xbf97('0x6')]=_[_0xbf97('0x7')](config[_0xbf97('0x6')],{'host':_0xbf97('0x8'),'port':0x18eb});var io=require(_0xbf97('0x9'))(new Redis(config[_0xbf97('0x6')]));function emit(_0x2d8e93,_0x50c08b,_0x387c8f){io['to'](_0x2d8e93)[_0xbf97('0xa')](_0x50c08b,_0x387c8f);}function getTicket(_0x188766,_0x4617a7,_0x33a4aa,_0x3320a7,_0x15f5b4,_0x19e277,_0x74ed98,_0x46fa63){var _0x34b1c8=Object[_0xbf97('0xb')]({},{'OwnerId':_0x4617a7['id'],'Subject':intUtil[_0xbf97('0xc')](_0x3320a7[_0xbf97('0xd')],_0x15f5b4,'\x20'),'Description':intUtil['getString'](_0x3320a7[_0xbf97('0xe')],_0x15f5b4,'\x0a')},getCustomFields(_0x19e277,_0x15f5b4));if(_0x33a4aa){if(_0x3320a7['ticketType']===_0xbf97('0xf')){_0x34b1c8['ActivityDate']=moment['utc']();_0x34b1c8[_0xbf97('0x10')]=![];_0x34b1c8[_0xbf97('0x11')]=![];if(_0x33a4aa[_0xbf97('0x12')]==='contact'||_0x33a4aa[_0xbf97('0x12')]===_0xbf97('0x13')){_0x34b1c8[_0xbf97('0x14')]=_0x33a4aa['id'];}else if(_0x33a4aa[_0xbf97('0x12')]===_0xbf97('0x15')){_0x34b1c8['WhatId']=_0x33a4aa['id'];}}else if(_0x3320a7[_0xbf97('0x16')]===_0xbf97('0x17')){if(_0x33a4aa[_0xbf97('0x12')]===_0xbf97('0x18')){_0x34b1c8['ContactId']=_0x33a4aa['id'];}else if(_0x33a4aa[_0xbf97('0x12')]===_0xbf97('0x15')){_0x34b1c8[_0xbf97('0x19')]=_0x33a4aa['id'];}else if(_0x33a4aa['endUserType']===_0xbf97('0x13')&&_0x3320a7[_0xbf97('0x1a')]){_0x34b1c8[_0x3320a7[_0xbf97('0x1a')]]=_0x33a4aa['id'];}else{logger[_0xbf97('0x1b')](_0xbf97('0x1c'));}}}return _0x74ed98[_0xbf97('0x1d')](_0x3320a7['ticketType'])[_0xbf97('0x1e')](_0x34b1c8);}function getUser(_0x3f3d87,_0x4d7631,_0x526ffc){if(!_[_0xbf97('0x1f')](_0x4d7631)&&intUtil['validateEmail'](_0x4d7631)){var _0x35b56e={'Email':_0x4d7631};var _0x2deab3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x526ffc['sobject'](_0xbf97('0x20'))[_0xbf97('0x21')](_0x35b56e,_0x2deab3)['execute']()[_0xbf97('0x22')](function(_0x4a0f15){if(_0x4a0f15[_0xbf97('0x23')]){var _0x45f574=_[_0xbf97('0x21')](_0x4a0f15,function(_0x465c86){return _0x465c86[_0xbf97('0x24')]===_0x4d7631;});if(_0x45f574){logger['info'](_0xbf97('0x25'),_0x4d7631);return BPromise[_0xbf97('0x26')]({'id':_0x45f574['Id'],'name':_0x45f574['Name']});}}else{logger[_0xbf97('0x1b')](_0xbf97('0x27'),_0x4d7631);return _0x526ffc[_0xbf97('0x28')]()[_0xbf97('0x22')](function(_0x43dd3f){return BPromise[_0xbf97('0x26')]({'id':_0x43dd3f[_0xbf97('0x29')],'name':_0x43dd3f[_0xbf97('0x2a')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4d7631);return _0x526ffc[_0xbf97('0x28')]()[_0xbf97('0x22')](function(_0x68b53f){return BPromise[_0xbf97('0x26')]({'id':_0x68b53f[_0xbf97('0x29')],'name':_0x68b53f['display_name']});});}}function getEndUser(_0xae6067,_0x4f3193,_0x8b8376,_0x321456,_0x144610){var _0x3aaa26={'$or':{'Phone':_0x321456}};var _0x3e487b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbf97('0x26')]()['then'](function(){logger[_0xbf97('0x1b')](_0xbf97('0x2b'),_0x321456,_0x4f3193[_0xbf97('0x2c')]);switch(_0x4f3193[_0xbf97('0x2c')]){case _0xbf97('0x2d'):var _0x1bfd9e=_[_0xbf97('0x2e')](_0x3aaa26);if(_0x4f3193[_0xbf97('0x2f')]){var _0x3e2f1c={};_0x3e2f1c[_0x4f3193['additionalSearchContact']]=_0x321456;_[_0xbf97('0x30')](_0x1bfd9e['$or'],_0x3e2f1c);}return _0x144610['sobject']('Contact')['find'](_0x1bfd9e,_0x3e487b)[_0xbf97('0x31')]()['then'](function(_0x26d727){if(_0x26d727&&_0x26d727['length']){return _0x26d727;}else{var _0x1baacb=_['cloneDeep'](_0x3aaa26);if(_0x4f3193[_0xbf97('0x32')]){var _0xe77bee={};_0xe77bee[_0x4f3193['additionalSearchLead']]=_0x321456;_[_0xbf97('0x30')](_0x1baacb[_0xbf97('0x33')],_0xe77bee);}return _0x144610['sobject'](_0xbf97('0x34'))['find'](_0x1baacb,_0x3e487b);}});case _0xbf97('0x35'):var _0x26b01c=_[_0xbf97('0x2e')](_0x3aaa26);if(_0x4f3193[_0xbf97('0x36')]){var _0x3e2f1c={};_0x3e2f1c[_0x4f3193[_0xbf97('0x36')]]=_0x321456;_[_0xbf97('0x30')](_0x26b01c[_0xbf97('0x33')],_0x3e2f1c);}return _0x144610[_0xbf97('0x1d')]('Account')[_0xbf97('0x21')](_0x26b01c,_0x3e487b)[_0xbf97('0x31')]()[_0xbf97('0x22')](function(_0x1a0af4){if(_0x1a0af4&&_0x1a0af4[_0xbf97('0x23')]){return _0x1a0af4;}else{var _0x2a1786=_['cloneDeep'](_0x3aaa26);if(_0x4f3193['additionalSearchContact']){var _0x3cf0ce={};_0x3cf0ce[_0x4f3193[_0xbf97('0x2f')]]=_0x321456;_[_0xbf97('0x30')](_0x2a1786[_0xbf97('0x33')],_0x3cf0ce);}return _0x144610[_0xbf97('0x1d')](_0xbf97('0x37'))[_0xbf97('0x21')](_0x2a1786,_0x3e487b)[_0xbf97('0x22')](function(_0x35ce42){if(_0x35ce42&&_0x35ce42[_0xbf97('0x23')]){return _0x35ce42;}else{var _0x56d22f=_[_0xbf97('0x2e')](_0x3aaa26);if(_0x4f3193['additionalSearchLead']){var _0x20de46={};_0x20de46[_0x4f3193[_0xbf97('0x32')]]=_0x321456;_[_0xbf97('0x30')](_0x56d22f[_0xbf97('0x33')],_0x20de46);}return _0x144610['sobject']('Lead')[_0xbf97('0x21')](_0x56d22f,_0x3e487b);}});}});case _0xbf97('0x18'):var _0x1bfd9e=_[_0xbf97('0x2e')](_0x3aaa26);if(_0x4f3193[_0xbf97('0x2f')]){var _0x3e2f1c={};_0x3e2f1c[_0x4f3193['additionalSearchContact']]=_0x321456;_[_0xbf97('0x30')](_0x1bfd9e['$or'],_0x3e2f1c);}return _0x144610[_0xbf97('0x1d')]('Contact')[_0xbf97('0x21')](_0x1bfd9e,_0x3e487b)[_0xbf97('0x31')]();case'lead':var _0x3daac3=_[_0xbf97('0x2e')](_0x3aaa26);if(_0x4f3193[_0xbf97('0x32')]){var _0x3e2f1c={};_0x3e2f1c[_0x4f3193[_0xbf97('0x32')]]=_0x321456;_['merge'](_0x3daac3[_0xbf97('0x33')],_0x3e2f1c);}return _0x144610[_0xbf97('0x1d')](_0xbf97('0x34'))[_0xbf97('0x21')](_0x3daac3,_0x3e487b);case _0xbf97('0x15'):var _0x26b01c=_['cloneDeep'](_0x3aaa26);if(_0x4f3193['additionalSearchAccount']){var _0x3e2f1c={};_0x3e2f1c[_0x4f3193[_0xbf97('0x36')]]=_0x321456;_[_0xbf97('0x30')](_0x26b01c['$or'],_0x3e2f1c);}return _0x144610[_0xbf97('0x1d')](_0xbf97('0x38'))[_0xbf97('0x21')](_0x26b01c,_0x3e487b);default:return null;}})[_0xbf97('0x22')](function(_0xea2530){if(_0xea2530&&_0xea2530[_0xbf97('0x23')]){var _0x1ddfbc=_['first'](_0xea2530);if(_0x1ddfbc){return BPromise[_0xbf97('0x26')]({'id':_0x1ddfbc['Id'],'name':_0x1ddfbc[_0xbf97('0x39')],'phone':_0x1ddfbc['Phone'],'endUserType':_0x1ddfbc[_0xbf97('0x3a')][_0xbf97('0x3b')][_0xbf97('0x3c')]()});}}})[_0xbf97('0x22')](function(_0x376d92){if(_0x376d92){logger[_0xbf97('0x1b')](_0xbf97('0x3d'),_0x376d92[_0xbf97('0x12')],_0x321456);return BPromise[_0xbf97('0x26')](_0x376d92);}else{logger[_0xbf97('0x1b')](_0xbf97('0x3e'),_0x321456);var _0x4cd6b6={'Phone':_0x321456};if(_0x4f3193[_0xbf97('0x3f')]){if(_0x4f3193['moduleCreate']===_0xbf97('0x18')){logger[_0xbf97('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x321456,_0x4f3193[_0xbf97('0x3f')]);_0x4cd6b6[_0xbf97('0x40')]=_0x8b8376!==_0xbf97('0x41')?_0x8b8376:util[_0xbf97('0x42')]('Caller\x20-\x20%s',_0x321456);}else if(_0x4f3193['moduleCreate']==='lead'){logger['info'](_0xbf97('0x43'),_0x321456,_0x4f3193[_0xbf97('0x3f')]);_0x4cd6b6[_0xbf97('0x40')]=_0x8b8376!==_0xbf97('0x41')?_0x8b8376:util[_0xbf97('0x42')](_0xbf97('0x44'),_0x321456);_0x4cd6b6['Company']=_0xbf97('0x45');}else if(_0x4f3193[_0xbf97('0x3f')]==='account'){logger[_0xbf97('0x1b')](_0xbf97('0x43'),_0x321456,_0x4f3193[_0xbf97('0x3f')]);_0x4cd6b6[_0xbf97('0x39')]=_0x8b8376!==_0xbf97('0x41')?_0x8b8376:util[_0xbf97('0x42')]('Caller\x20-\x20%s',_0x321456);}else{return null;}}return _0x144610[_0xbf97('0x1d')](_[_0xbf97('0x46')](_0x4f3193[_0xbf97('0x3f')]))[_0xbf97('0x1e')](_0x4cd6b6)[_0xbf97('0x22')](function(_0x49dc1c){return BPromise[_0xbf97('0x26')]({'id':_0x49dc1c['id'],'endUserType':_0x4f3193[_0xbf97('0x3f')]});});}});}function getCustomFields(_0x127573,_0x3b9253){var _0x542628={};if(_0x127573[_0xbf97('0x23')]>0x0){_[_0xbf97('0x47')](_0x127573,function(_0x4fc21a){if(_[_0xbf97('0x48')](['string',_0xbf97('0x49')],_0x4fc21a[_0xbf97('0x3b')])&&_0x4fc21a[_0xbf97('0x4a')]){_0x542628[_0x4fc21a[_0xbf97('0x4a')]]=_0x4fc21a[_0xbf97('0x4b')][_0xbf97('0x4c')]();}else if(_0x4fc21a['type']==='variable'&&_0x4fc21a[_0xbf97('0x4d')]&&_0x4fc21a[_0xbf97('0x4a')]){_0x3b9253[_0x4fc21a[_0xbf97('0x4d')]]&&(_0x542628[_0x4fc21a[_0xbf97('0x4a')]]=_0x3b9253[_0x4fc21a['variableName']][_0xbf97('0x4c')]());}else if(_0x4fc21a[_0xbf97('0x3b')]===_0xbf97('0x4e')&&_0x4fc21a[_0xbf97('0x4f')]&&_0x4fc21a[_0xbf97('0x4f')][_0xbf97('0x50')]&&_0x4fc21a[_0xbf97('0x4a')]){_0x3b9253[_0x4fc21a[_0xbf97('0x4f')][_0xbf97('0x50')]['toLowerCase']()]&&(_0x542628[_0x4fc21a[_0xbf97('0x4a')]]=_0x3b9253[_0x4fc21a['Variable'][_0xbf97('0x50')]['toLowerCase']()][_0xbf97('0x4c')]());}});}return _0x542628;}function getConnection(_0x4bafb1){var _0xc8bfb3=_0x4bafb1[_0xbf97('0x51')][_0xbf97('0x52')](_0x4bafb1[_0xbf97('0x53')]);var _0x42b583=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4bafb1[_0xbf97('0x54')]||_0xbf97('0x55'),'clientId':_0x4bafb1[_0xbf97('0x56')],'clientSecret':_0x4bafb1[_0xbf97('0x57')]}});return _0x42b583['login'](_0x4bafb1[_0xbf97('0x58')],_0xc8bfb3)['then'](function(){logger[_0xbf97('0x1b')](_0xbf97('0x59'));return _0x42b583;});}exports[_0xbf97('0x5a')]=function(_0x40b32b,_0x3d5f1c,_0x4360d6,_0x3214d3,_0x1cb6fb,_0x2bce2a){var _0x5559d2,_0x2fda6d,_0x4769f9,_0x42cbf2;_0x2bce2a['serverUrl']=intUtil[_0xbf97('0x5b')](_0x2bce2a['serverUrl']);_0x2bce2a['remoteUri']=intUtil[_0xbf97('0x5b')](_0x2bce2a[_0xbf97('0x54')]);if(_0x1cb6fb&&_0x1cb6fb['monitor_format']){logger[_0xbf97('0x1b')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3d5f1c[_0xbf97('0x5c')]=util[_0xbf97('0x42')](_0xbf97('0x5d'),_0x2bce2a[_0xbf97('0x5e')],_0x3d5f1c[_0xbf97('0x5f')],md5(_0x3d5f1c['uniqueid']));}else{_0x3d5f1c[_0xbf97('0x5c')]='';}return getConnection(_0x2bce2a)[_0xbf97('0x22')](function(_0x34448c){_0x42cbf2=_0x34448c;return getUser(_0x2bce2a,_0x3214d3[_0xbf97('0x60')],_0x42cbf2);})[_0xbf97('0x22')](function(_0x3f3f77){_0x5559d2=_0x3f3f77;return getEndUser(_0x2bce2a,_0x4360d6,_0x3d5f1c['calleridname'],_0x3d5f1c[_0xbf97('0x61')],_0x42cbf2);})[_0xbf97('0x22')](function(_0x4ac01e){_0x2fda6d=_0x4ac01e;return getTicket(_0x2bce2a,_0x5559d2,_0x2fda6d,_0x4360d6,_0x3d5f1c,_0x4360d6[_0xbf97('0x62')],_0x42cbf2,_0xbf97('0x5a'));})[_0xbf97('0x22')](function(_0xfb636b){_0x4769f9=_0xfb636b;logger['info'](_0xbf97('0x63'),_0x4769f9['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4769f9['id'],_0x3214d3[_0xbf97('0x50')],_0x2bce2a[_0xbf97('0x3b')]);switch(_0x2bce2a['type']){case _0xbf97('0x64'):emit(util[_0xbf97('0x42')]('user:%s',_0x3214d3[_0xbf97('0x50')]),'trigger:salesforce:display',{'recordId':_0x4769f9['id']});break;case _0xbf97('0x65'):emit(util['format'](_0xbf97('0x66'),_0x3214d3[_0xbf97('0x50')]),_0xbf97('0x67'),{'uri':util['format']('%s/%s/e',_0x42cbf2[_0xbf97('0x68')],_0x4769f9['id'])});break;default:logger[_0xbf97('0x69')](_0xbf97('0x6a'));}})[_0xbf97('0x6b')](function(_0x40ab3c){logger[_0xbf97('0x69')](_0xbf97('0x6c'),_0x40ab3c);});};exports[_0xbf97('0x6d')]=function(_0x145e90,_0x52a00b,_0x56368d,_0x44178c,_0x1bc6ee,_0x126056,_0x10d8c8){var _0x505790,_0x58eef8,_0x5a10af,_0x55aa17;_0x126056[_0xbf97('0x5e')]=intUtil[_0xbf97('0x5b')](_0x126056[_0xbf97('0x5e')]);_0x126056[_0xbf97('0x54')]=intUtil['stripTrailingSlash'](_0x126056[_0xbf97('0x54')]);if(_0x10d8c8&&_0x10d8c8['recordingFormat']&&_0x10d8c8[_0xbf97('0x6e')]!==_0xbf97('0x6f')){logger[_0xbf97('0x1b')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x52a00b[_0xbf97('0x5c')]=util[_0xbf97('0x42')](_0xbf97('0x5d'),_0x126056['serverUrl'],_0x52a00b[_0xbf97('0x5f')],md5(_0x52a00b[_0xbf97('0x5f')]));}return getConnection(_0x126056)[_0xbf97('0x22')](function(_0x46e2e2){_0x55aa17=_0x46e2e2;return getUser(_0x126056,_0x44178c[_0xbf97('0x60')],_0x55aa17);})['then'](function(_0x6dc744){_0x505790=_0x6dc744;return getEndUser(_0x126056,_0x56368d,_0x52a00b[_0xbf97('0x70')],_0x52a00b[_0xbf97('0x71')],_0x55aa17);})[_0xbf97('0x22')](function(_0x2e37b1){_0x58eef8=_0x2e37b1;return getTicket(_0x126056,_0x505790,_0x58eef8,_0x56368d,_0x52a00b,_0x56368d[_0xbf97('0x62')],_0x55aa17,_0xbf97('0x6d'));})['then'](function(_0x2c3823){_0x5a10af=_0x2c3823;logger[_0xbf97('0x1b')](_0xbf97('0x72'),_0x5a10af['id']);logger[_0xbf97('0x1b')](_0xbf97('0x73'),_0x5a10af['id'],_0x44178c[_0xbf97('0x50')],_0x126056['type']);switch(_0x126056['type']){case _0xbf97('0x64'):emit(util[_0xbf97('0x42')](_0xbf97('0x66'),_0x44178c[_0xbf97('0x50')]),_0xbf97('0x74'),{'recordId':_0x5a10af['id']});break;case _0xbf97('0x65'):emit(util['format'](_0xbf97('0x66'),_0x44178c[_0xbf97('0x50')]),_0xbf97('0x67'),{'uri':util[_0xbf97('0x42')]('%s/%s/e',_0x55aa17[_0xbf97('0x68')],_0x5a10af['id'])});break;default:logger[_0xbf97('0x69')](_0xbf97('0x75'),_0xbf97('0x76'));}})[_0xbf97('0x6b')](function(_0x3d3b29){logger[_0xbf97('0x69')](_0xbf97('0x75'),_0x3d3b29);});};exports[_0xbf97('0x77')]=function(_0x3f7d82,_0x200df6,_0x4e0fc0,_0xd254a3,_0x131eac,_0x10b544){var _0x1e15b5,_0x10a6ba,_0x2df506,_0x3b3848;_0x10b544[_0xbf97('0x5e')]=intUtil['stripTrailingSlash'](_0x10b544[_0xbf97('0x5e')]);_0x10b544['remoteUri']=intUtil[_0xbf97('0x5b')](_0x10b544[_0xbf97('0x54')]);if(_0x131eac&&_0x131eac[_0xbf97('0x78')]){logger[_0xbf97('0x1b')]('['+_0x200df6[_0xbf97('0x79')][_0xbf97('0x7a')]()+']',_0xbf97('0x7b'));_0x200df6[_0xbf97('0x5c')]=util['format'](_0xbf97('0x5d'),_0x10b544['serverUrl'],_0x200df6[_0xbf97('0x5f')],md5(_0x200df6[_0xbf97('0x5f')]));}else{_0x200df6['recordingURL']='';}return getConnection(_0x10b544)[_0xbf97('0x22')](function(_0x297235){_0x3b3848=_0x297235;if(!_['isNil'](_0xd254a3)){return getUser(_0x10b544,_0xd254a3['name'],_0x3b3848);}else{return getUser(_0x10b544,null,_0x3b3848);}})[_0xbf97('0x22')](function(_0x349bae){_0x1e15b5=_0x349bae;return getEndUser(_0x10b544,_0x4e0fc0,_0x200df6[_0xbf97('0x7c')],_0x200df6[_0xbf97('0x61')],_0x3b3848);})[_0xbf97('0x22')](function(_0x54508a){_0x10a6ba=_0x54508a;return getTicket(_0x10b544,_0x1e15b5,_0x10a6ba,_0x4e0fc0,_0x200df6,_0x4e0fc0[_0xbf97('0x62')],_0x3b3848);})[_0xbf97('0x22')](function(_0x3cf609){_0x2df506=_0x3cf609;logger['info']('['+_0x200df6[_0xbf97('0x79')][_0xbf97('0x7a')]()+_0xbf97('0x7d'),_0x2df506['id']);logger[_0xbf97('0x1b')]('['+_0x200df6['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x10b544[_0xbf97('0x3b')]);})[_0xbf97('0x6b')](function(_0x28d6e0){logger[_0xbf97('0x69')]('['+_0x200df6[_0xbf97('0x79')][_0xbf97('0x7a')]()+']',_0x28d6e0);});}; \ No newline at end of file +var _0x276e=['calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','user:%s','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','ioredis','../../../../config/logger','redis','defaults','localhost','emit','assign','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','account','contact','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','execute','then','length','find','Email','info','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','first','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','format','upperFirst','forEach','includes','string','picklist','idField','content','variable','variableName','toString','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','username','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x3c5ad6,_0x47b7bf){var _0x3154f2=function(_0x3a24de){while(--_0x3a24de){_0x3c5ad6['push'](_0x3c5ad6['shift']());}};_0x3154f2(++_0x47b7bf);}(_0x276e,0x110));var _0xe276=function(_0x43d79c,_0x531a55){_0x43d79c=_0x43d79c-0x0;var _0x4866b0=_0x276e[_0x43d79c];return _0x4866b0;};'use strict';var _=require('lodash');var rp=require(_0xe276('0x0'));var moment=require(_0xe276('0x1'));var BPromise=require(_0xe276('0x2'));var md5=require('md5');var jsforce=require(_0xe276('0x3'));var util=require('util');var Redis=require(_0xe276('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe276('0x5'))('salesforce');config[_0xe276('0x6')]=_[_0xe276('0x7')](config['redis'],{'host':_0xe276('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe276('0x6')]));function emit(_0x185b4e,_0x26fdef,_0x5252a3){io['to'](_0x185b4e)[_0xe276('0x9')](_0x26fdef,_0x5252a3);}function getTicket(_0xcbdc7,_0xeef2c5,_0x4f9fe5,_0x2be77b,_0x20fd9d,_0x5eb049,_0xb5c2f9,_0x98e476){var _0x3d8633=Object[_0xe276('0xa')]({},{'OwnerId':_0xeef2c5['id'],'Subject':intUtil[_0xe276('0xb')](_0x2be77b['Subjects'],_0x20fd9d,'\x20'),'Description':intUtil[_0xe276('0xb')](_0x2be77b['Descriptions'],_0x20fd9d,'\x0a')},getCustomFields(_0x5eb049,_0x20fd9d));if(_0x4f9fe5){if(_0x2be77b[_0xe276('0xc')]===_0xe276('0xd')){_0x3d8633[_0xe276('0xe')]=moment[_0xe276('0xf')]();_0x3d8633[_0xe276('0x10')]=![];_0x3d8633[_0xe276('0x11')]=![];if(_0x4f9fe5[_0xe276('0x12')]==='contact'||_0x4f9fe5[_0xe276('0x12')]==='lead'){_0x3d8633['WhoId']=_0x4f9fe5['id'];}else if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x13')){_0x3d8633['WhatId']=_0x4f9fe5['id'];}}else if(_0x2be77b[_0xe276('0xc')]==='Case'){if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x14')){_0x3d8633[_0xe276('0x15')]=_0x4f9fe5['id'];}else if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x13')){_0x3d8633[_0xe276('0x16')]=_0x4f9fe5['id'];}else if(_0x4f9fe5[_0xe276('0x12')]===_0xe276('0x17')&&_0x2be77b[_0xe276('0x18')]){_0x3d8633[_0x2be77b['leadId']]=_0x4f9fe5['id'];}else{logger['info'](_0xe276('0x19'));}}}return _0xb5c2f9[_0xe276('0x1a')](_0x2be77b[_0xe276('0xc')])[_0xe276('0x1b')](_0x3d8633);}function getUser(_0x24bcb4,_0x747ebc,_0x5cdc1e){if(!_[_0xe276('0x1c')](_0x747ebc)&&intUtil[_0xe276('0x1d')](_0x747ebc)){var _0x282c8c={'Email':_0x747ebc};var _0x3ccd76={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5cdc1e[_0xe276('0x1a')]('User')['find'](_0x282c8c,_0x3ccd76)[_0xe276('0x1e')]()[_0xe276('0x1f')](function(_0x3f57c8){if(_0x3f57c8[_0xe276('0x20')]){var _0x50f4f0=_[_0xe276('0x21')](_0x3f57c8,function(_0x5b5e78){return _0x5b5e78[_0xe276('0x22')]===_0x747ebc;});if(_0x50f4f0){logger[_0xe276('0x23')]('Agent\x20%s\x20found.',_0x747ebc);return BPromise[_0xe276('0x24')]({'id':_0x50f4f0['Id'],'name':_0x50f4f0[_0xe276('0x25')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x747ebc);return _0x5cdc1e[_0xe276('0x26')]()[_0xe276('0x1f')](function(_0x16e845){return BPromise['resolve']({'id':_0x16e845[_0xe276('0x27')],'name':_0x16e845[_0xe276('0x28')]});});}});}else{logger[_0xe276('0x23')](_0xe276('0x29'),_0x747ebc);return _0x5cdc1e[_0xe276('0x26')]()[_0xe276('0x1f')](function(_0x24a70d){return BPromise[_0xe276('0x24')]({'id':_0x24a70d[_0xe276('0x27')],'name':_0x24a70d[_0xe276('0x28')]});});}}function getEndUser(_0x3874c2,_0x58737e,_0x236726,_0x5e4509,_0x10b82e){var _0x79c7c6={'$or':{'Phone':_0x5e4509}};var _0x5c615b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xe276('0x1f')](function(){logger[_0xe276('0x23')](_0xe276('0x2a'),_0x5e4509,_0x58737e[_0xe276('0x2b')]);switch(_0x58737e[_0xe276('0x2b')]){case _0xe276('0x2c'):var _0xce69b5=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x2e')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x2e')]]=_0x5e4509;_['merge'](_0xce69b5[_0xe276('0x2f')],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x30'))['find'](_0xce69b5,_0x5c615b)[_0xe276('0x1e')]()['then'](function(_0x2f0db7){if(_0x2f0db7&&_0x2f0db7[_0xe276('0x20')]){return _0x2f0db7;}else{var _0x3b2f86=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x31')]){var _0x393506={};_0x393506[_0x58737e[_0xe276('0x31')]]=_0x5e4509;_[_0xe276('0x32')](_0x3b2f86[_0xe276('0x2f')],_0x393506);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x33'))[_0xe276('0x21')](_0x3b2f86,_0x5c615b);}});case _0xe276('0x34'):var _0x5a31e5=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x35')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x35')]]=_0x5e4509;_[_0xe276('0x32')](_0x5a31e5['$or'],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x36'))[_0xe276('0x21')](_0x5a31e5,_0x5c615b)[_0xe276('0x1e')]()[_0xe276('0x1f')](function(_0x4c203c){if(_0x4c203c&&_0x4c203c[_0xe276('0x20')]){return _0x4c203c;}else{var _0x6abf7f=_['cloneDeep'](_0x79c7c6);if(_0x58737e[_0xe276('0x2e')]){var _0x5d2105={};_0x5d2105[_0x58737e['additionalSearchContact']]=_0x5e4509;_[_0xe276('0x32')](_0x6abf7f[_0xe276('0x2f')],_0x5d2105);}return _0x10b82e['sobject'](_0xe276('0x30'))[_0xe276('0x21')](_0x6abf7f,_0x5c615b)[_0xe276('0x1f')](function(_0xce1cf8){if(_0xce1cf8&&_0xce1cf8[_0xe276('0x20')]){return _0xce1cf8;}else{var _0x3b216b=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e['additionalSearchLead']){var _0x4833ab={};_0x4833ab[_0x58737e['additionalSearchLead']]=_0x5e4509;_[_0xe276('0x32')](_0x3b216b[_0xe276('0x2f')],_0x4833ab);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x33'))[_0xe276('0x21')](_0x3b216b,_0x5c615b);}});}});case _0xe276('0x14'):var _0xce69b5=_['cloneDeep'](_0x79c7c6);if(_0x58737e[_0xe276('0x2e')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x2e')]]=_0x5e4509;_['merge'](_0xce69b5[_0xe276('0x2f')],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x30'))[_0xe276('0x21')](_0xce69b5,_0x5c615b)[_0xe276('0x1e')]();case _0xe276('0x17'):var _0x324ec0=_[_0xe276('0x2d')](_0x79c7c6);if(_0x58737e[_0xe276('0x31')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x31')]]=_0x5e4509;_['merge'](_0x324ec0[_0xe276('0x2f')],_0x16f362);}return _0x10b82e[_0xe276('0x1a')]('Lead')[_0xe276('0x21')](_0x324ec0,_0x5c615b);case _0xe276('0x13'):var _0x5a31e5=_['cloneDeep'](_0x79c7c6);if(_0x58737e[_0xe276('0x35')]){var _0x16f362={};_0x16f362[_0x58737e[_0xe276('0x35')]]=_0x5e4509;_[_0xe276('0x32')](_0x5a31e5['$or'],_0x16f362);}return _0x10b82e[_0xe276('0x1a')](_0xe276('0x36'))[_0xe276('0x21')](_0x5a31e5,_0x5c615b);default:return null;}})['then'](function(_0x12814e){if(_0x12814e&&_0x12814e[_0xe276('0x20')]){var _0x5c6c1c=_[_0xe276('0x37')](_0x12814e);if(_0x5c6c1c){return BPromise[_0xe276('0x24')]({'id':_0x5c6c1c['Id'],'name':_0x5c6c1c['Name'],'phone':_0x5c6c1c['Phone'],'endUserType':_0x5c6c1c['attributes'][_0xe276('0x38')][_0xe276('0x39')]()});}}})[_0xe276('0x1f')](function(_0xf2c35b){if(_0xf2c35b){logger[_0xe276('0x23')](_0xe276('0x3a'),_0xf2c35b[_0xe276('0x12')],_0x5e4509);return BPromise[_0xe276('0x24')](_0xf2c35b);}else{logger['info'](_0xe276('0x3b'),_0x5e4509);var _0x2c1b97={'Phone':_0x5e4509};if(_0x58737e[_0xe276('0x3c')]){if(_0x58737e['moduleCreate']===_0xe276('0x14')){logger[_0xe276('0x23')](_0xe276('0x3d'),_0x5e4509,_0x58737e[_0xe276('0x3c')]);_0x2c1b97[_0xe276('0x3e')]=_0x236726!==_0xe276('0x3f')?_0x236726:util['format'](_0xe276('0x40'),_0x5e4509);}else if(_0x58737e[_0xe276('0x3c')]===_0xe276('0x17')){logger[_0xe276('0x23')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5e4509,_0x58737e[_0xe276('0x3c')]);_0x2c1b97[_0xe276('0x3e')]=_0x236726!==''?_0x236726:util['format'](_0xe276('0x40'),_0x5e4509);_0x2c1b97[_0xe276('0x41')]='No\x20Company';}else if(_0x58737e[_0xe276('0x3c')]===_0xe276('0x13')){logger['info'](_0xe276('0x3d'),_0x5e4509,_0x58737e[_0xe276('0x3c')]);_0x2c1b97[_0xe276('0x25')]=_0x236726!==''?_0x236726:util[_0xe276('0x42')]('Caller\x20-\x20%s',_0x5e4509);}else{return null;}}return _0x10b82e[_0xe276('0x1a')](_[_0xe276('0x43')](_0x58737e[_0xe276('0x3c')]))[_0xe276('0x1b')](_0x2c1b97)['then'](function(_0x2afc7e){return BPromise[_0xe276('0x24')]({'id':_0x2afc7e['id'],'endUserType':_0x58737e[_0xe276('0x3c')]});});}});}function getCustomFields(_0x4a4717,_0x304709){var _0x4873bf={};if(_0x4a4717[_0xe276('0x20')]>0x0){_[_0xe276('0x44')](_0x4a4717,function(_0x563eeb){if(_[_0xe276('0x45')]([_0xe276('0x46'),_0xe276('0x47')],_0x563eeb['type'])&&_0x563eeb[_0xe276('0x48')]){_0x4873bf[_0x563eeb['idField']]=_0x563eeb[_0xe276('0x49')]['toString']();}else if(_0x563eeb[_0xe276('0x38')]===_0xe276('0x4a')&&_0x563eeb['variableName']&&_0x563eeb['idField']){_0x304709[_0x563eeb[_0xe276('0x4b')]]&&(_0x4873bf[_0x563eeb[_0xe276('0x48')]]=_0x304709[_0x563eeb['variableName']][_0xe276('0x4c')]());}else if(_0x563eeb[_0xe276('0x38')]==='customVariable'&&_0x563eeb[_0xe276('0x4d')]&&_0x563eeb['Variable'][_0xe276('0x4e')]&&_0x563eeb[_0xe276('0x48')]){_0x304709[_0x563eeb[_0xe276('0x4d')]['name']['toLowerCase']()]&&(_0x4873bf[_0x563eeb[_0xe276('0x48')]]=_0x304709[_0x563eeb['Variable'][_0xe276('0x4e')][_0xe276('0x39')]()]['toString']());}});}return _0x4873bf;}function getConnection(_0x18b834){var _0x47aaa2=_0x18b834[_0xe276('0x4f')][_0xe276('0x50')](_0x18b834[_0xe276('0x51')]);var _0x2a14df=new jsforce['Connection']({'oauth2':{'loginUrl':_0x18b834[_0xe276('0x52')]||_0xe276('0x53'),'clientId':_0x18b834['clientId'],'clientSecret':_0x18b834[_0xe276('0x54')]}});return _0x2a14df['login'](_0x18b834[_0xe276('0x55')],_0x47aaa2)[_0xe276('0x1f')](function(){logger[_0xe276('0x23')]('Connection\x20established.');return _0x2a14df;});}exports[_0xe276('0x56')]=function(_0x309bd3,_0x25c4a0,_0x3ffe56,_0x3350b7,_0x2e33cc,_0x3d6da5){var _0x3384eb,_0x1e2284,_0x27d66b,_0x5d9767;_0x3d6da5[_0xe276('0x57')]=intUtil[_0xe276('0x58')](_0x3d6da5[_0xe276('0x57')]);_0x3d6da5[_0xe276('0x52')]=intUtil[_0xe276('0x58')](_0x3d6da5['remoteUri']);if(_0x2e33cc&&_0x2e33cc['monitor_format']){logger[_0xe276('0x23')](_0xe276('0x59'),'Recording\x20is\x20enabled!');_0x25c4a0[_0xe276('0x5a')]=util[_0xe276('0x42')](_0xe276('0x5b'),_0x3d6da5[_0xe276('0x57')],_0x25c4a0[_0xe276('0x5c')],md5(_0x25c4a0[_0xe276('0x5c')]));}else{_0x25c4a0['recordingURL']='';}return getConnection(_0x3d6da5)[_0xe276('0x1f')](function(_0x454ee2){_0x5d9767=_0x454ee2;return getUser(_0x3d6da5,_0x3350b7[_0xe276('0x5d')],_0x5d9767);})[_0xe276('0x1f')](function(_0x38ff5f){_0x3384eb=_0x38ff5f;return getEndUser(_0x3d6da5,_0x3ffe56,_0x25c4a0[_0xe276('0x5e')],_0x25c4a0[_0xe276('0x5f')],_0x5d9767);})[_0xe276('0x1f')](function(_0x4feef8){_0x1e2284=_0x4feef8;return getTicket(_0x3d6da5,_0x3384eb,_0x1e2284,_0x3ffe56,_0x25c4a0,_0x3ffe56[_0xe276('0x60')],_0x5d9767,_0xe276('0x56'));})[_0xe276('0x1f')](function(_0x4691b5){_0x27d66b=_0x4691b5;logger[_0xe276('0x23')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x27d66b['id']);logger[_0xe276('0x23')](_0xe276('0x61'),_0x27d66b['id'],_0x3350b7[_0xe276('0x4e')],_0x3d6da5[_0xe276('0x38')]);switch(_0x3d6da5[_0xe276('0x38')]){case'integrationTab':emit(util['format']('user:%s',_0x3350b7[_0xe276('0x4e')]),_0xe276('0x62'),{'recordId':_0x27d66b['id']});break;case'newTab':emit(util[_0xe276('0x42')](_0xe276('0x63'),_0x3350b7[_0xe276('0x4e')]),'trigger:browser:url',{'uri':util[_0xe276('0x42')]('%s/%s/e',_0x5d9767[_0xe276('0x64')],_0x27d66b['id'])});break;default:logger[_0xe276('0x65')](_0xe276('0x66'));}})[_0xe276('0x67')](function(_0x2c4044){logger[_0xe276('0x65')](_0xe276('0x59'),_0x2c4044);});};exports[_0xe276('0x68')]=function(_0x1bb9bf,_0x146c57,_0x29ba25,_0x4a279f,_0x11c3a3,_0x10b67e,_0x1b80f2){var _0x487783,_0x1d2c05,_0x123af8,_0x908d56;_0x10b67e[_0xe276('0x57')]=intUtil[_0xe276('0x58')](_0x10b67e[_0xe276('0x57')]);_0x10b67e[_0xe276('0x52')]=intUtil[_0xe276('0x58')](_0x10b67e[_0xe276('0x52')]);if(_0x1b80f2&&_0x1b80f2[_0xe276('0x69')]&&_0x1b80f2['recordingFormat']!==_0xe276('0x6a')){logger[_0xe276('0x23')](_0xe276('0x6b'),_0xe276('0x6c'));_0x146c57[_0xe276('0x5a')]=util['format'](_0xe276('0x5b'),_0x10b67e[_0xe276('0x57')],_0x146c57[_0xe276('0x5c')],md5(_0x146c57[_0xe276('0x5c')]));}return getConnection(_0x10b67e)['then'](function(_0x14ee4c){_0x908d56=_0x14ee4c;return getUser(_0x10b67e,_0x4a279f['email'],_0x908d56);})[_0xe276('0x1f')](function(_0x4ce032){_0x487783=_0x4ce032;return getEndUser(_0x10b67e,_0x29ba25,_0x146c57[_0xe276('0x6d')],_0x146c57[_0xe276('0x6e')],_0x908d56);})[_0xe276('0x1f')](function(_0x4e0c73){_0x1d2c05=_0x4e0c73;return getTicket(_0x10b67e,_0x487783,_0x1d2c05,_0x29ba25,_0x146c57,_0x29ba25[_0xe276('0x60')],_0x908d56,_0xe276('0x68'));})[_0xe276('0x1f')](function(_0x5b60a0){_0x123af8=_0x5b60a0;logger['info'](_0xe276('0x6f'),_0x123af8['id']);logger[_0xe276('0x23')](_0xe276('0x70'),_0x123af8['id'],_0x4a279f[_0xe276('0x4e')],_0x10b67e[_0xe276('0x38')]);switch(_0x10b67e[_0xe276('0x38')]){case'integrationTab':emit(util[_0xe276('0x42')](_0xe276('0x63'),_0x4a279f[_0xe276('0x4e')]),_0xe276('0x62'),{'recordId':_0x123af8['id']});break;case _0xe276('0x71'):emit(util[_0xe276('0x42')](_0xe276('0x63'),_0x4a279f[_0xe276('0x4e')]),'trigger:browser:url',{'uri':util['format'](_0xe276('0x72'),_0x908d56[_0xe276('0x64')],_0x123af8['id'])});break;default:logger[_0xe276('0x65')]('[OUTBOUND]',_0xe276('0x73'));}})['catch'](function(_0x4f085e){logger[_0xe276('0x65')]('[OUTBOUND]',_0x4f085e);});};exports[_0xe276('0x74')]=function(_0x2ea605,_0x4a7f45,_0x1ec757,_0x2afe5f,_0x32793b,_0x5047cc){var _0x4f342c,_0x323a19,_0x338475,_0x2f88d7;_0x5047cc[_0xe276('0x57')]=intUtil['stripTrailingSlash'](_0x5047cc[_0xe276('0x57')]);_0x5047cc[_0xe276('0x52')]=intUtil[_0xe276('0x58')](_0x5047cc[_0xe276('0x52')]);if(_0x32793b&&_0x32793b[_0xe276('0x75')]){logger[_0xe276('0x23')]('['+_0x4a7f45[_0xe276('0x76')]['toUpperCase']()+']',_0xe276('0x6c'));_0x4a7f45[_0xe276('0x5a')]=util[_0xe276('0x42')](_0xe276('0x5b'),_0x5047cc[_0xe276('0x57')],_0x4a7f45[_0xe276('0x5c')],md5(_0x4a7f45['uniqueid']));}else{_0x4a7f45['recordingURL']='';}return getConnection(_0x5047cc)[_0xe276('0x1f')](function(_0x220131){_0x2f88d7=_0x220131;if(!_[_0xe276('0x1c')](_0x2afe5f)){return getUser(_0x5047cc,_0x2afe5f['name'],_0x2f88d7);}else{return getUser(_0x5047cc,null,_0x2f88d7);}})[_0xe276('0x1f')](function(_0x38ab7b){_0x4f342c=_0x38ab7b;return getEndUser(_0x5047cc,_0x1ec757,_0x4a7f45[_0xe276('0x5e')],_0x4a7f45[_0xe276('0x5f')],_0x2f88d7);})[_0xe276('0x1f')](function(_0x37ce4e){_0x323a19=_0x37ce4e;return getTicket(_0x5047cc,_0x4f342c,_0x323a19,_0x1ec757,_0x4a7f45,_0x1ec757[_0xe276('0x60')],_0x2f88d7);})[_0xe276('0x1f')](function(_0x1a3d19){_0x338475=_0x1a3d19;logger['info']('['+_0x4a7f45[_0xe276('0x76')]['toUpperCase']()+_0xe276('0x77'),_0x338475['id']);logger[_0xe276('0x23')]('['+_0x4a7f45[_0xe276('0x76')][_0xe276('0x78')]()+_0xe276('0x79'),_0x5047cc[_0xe276('0x38')]);})[_0xe276('0x67')](function(_0x4dcd48){logger['error']('['+_0x4a7f45['lastevent']['toUpperCase']()+']',_0x4dcd48);});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index c0cb612..c43a93d 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 _0x025a=['ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','toUpperCase','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','then','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','includes','string','type','customField','nameField','content','toString','picklist','idField','variable','variableName','toLowerCase','customVariable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','Subjects','getString','Descriptions','ticketNumber','number','label','label_entry','Incident','ticketId','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','md5'];(function(_0xe22cb,_0x40c0b6){var _0x59b903=function(_0x5d7eb5){while(--_0x5d7eb5){_0xe22cb['push'](_0xe22cb['shift']());}};_0x59b903(++_0x40c0b6);}(_0x025a,0x66));var _0xa025=function(_0x469665,_0x394876){_0x469665=_0x469665-0x0;var _0x291ab5=_0x025a[_0x469665];return _0x291ab5;};'use strict';var _=require(_0xa025('0x0'));var Promise=require(_0xa025('0x1'));var rp=require(_0xa025('0x2'));var util=require('util');var md5=require(_0xa025('0x3'));var Redis=require(_0xa025('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xa025('0x5'))('servicenow');config[_0xa025('0x6')]=_[_0xa025('0x7')](config[_0xa025('0x6')],{'host':_0xa025('0x8'),'port':0x18eb});var io=require(_0xa025('0x9'))(new Redis(config['redis']));function getAdminUser(_0x4145ae,_0xcdf287,_0x89f3f2,_0xd5bbda,_0x5c53c7,_0x2559be){return new Promise(function(_0xa9b27d,_0x315e27){var _0x121aa1={'method':_0xa025('0xa'),'uri':_0xd5bbda+_0xa025('0xb')+'&'+_0x5c53c7+'&'+_0x2559be,'auth':_0xcdf287,'json':!![]};return rp(_0x121aa1)['then'](function(_0x3aa7a7){if(_0x3aa7a7[_0xa025('0xc')][_0xa025('0xd')]>0x0){_0x89f3f2['adminId']=_0x3aa7a7[_0xa025('0xc')][0x0][_0xa025('0xe')];}logger['info']('['+[_0x4145ae[_0xa025('0xf')]()]+'],\x20getAdminUser\x20crm',_0x89f3f2);_0xa9b27d(_0x89f3f2);})[_0xa025('0x10')](function(_0x3173e3){logger[_0xa025('0x11')]('['+[_0x4145ae[_0xa025('0xf')]()]+']',_0x3173e3[_0xa025('0x12')]);_0x315e27(_0x3173e3['message']);});});}function getUser(_0xa1b64f,_0x5e56d3,_0x1824ea,_0x4e6897,_0x12e235){return function(_0x4a09aa){logger[_0xa025('0x13')]('['+[_0xa1b64f[_0xa025('0xf')]()]+_0xa025('0x14'),_0x4a09aa);return new Promise(function(_0x4c83ad,_0x4dee37){if(intUtil[_0xa025('0x15')](_0x4a09aa[_0xa025('0x16')])){var _0x28f50f={'method':_0xa025('0xa'),'uri':_0x1824ea+'sys_user?sysparm_query=email%3D'+_0x4a09aa['userEmail']+'&'+_0x4e6897+'&'+_0x12e235,'auth':_0x5e56d3,'json':!![]};logger[_0xa025('0x13')]('['+[_0xa1b64f[_0xa025('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x28f50f);return rp(_0x28f50f)[_0xa025('0x17')](function(_0x97c8c6){logger[_0xa025('0x13')]('['+[_0xa1b64f['toUpperCase']()]+_0xa025('0x18'),_0x97c8c6);if(_0x97c8c6[_0xa025('0xc')][_0xa025('0xd')]>0x0&&String(_0x97c8c6[_0xa025('0xc')][0x0][_0xa025('0x19')])===_0xa025('0x1a')){_0x4a09aa[_0xa025('0x1b')]=_0x97c8c6[_0xa025('0xc')][0x0][_0xa025('0xe')];}else{_0x4a09aa[_0xa025('0x1b')]=_0x4a09aa[_0xa025('0x1c')];_0x4a09aa[_0xa025('0x16')]=_0x4a09aa[_0xa025('0x1d')];}logger[_0xa025('0x13')]('['+[_0xa1b64f['toUpperCase']()]+_0xa025('0x1e'),_0x4a09aa);_0x4c83ad(_0x4a09aa);})[_0xa025('0x10')](function(_0xf39ac2){logger[_0xa025('0x11')]('['+[_0xa1b64f['toUpperCase']()]+']',_0xf39ac2['message']);_0x4dee37(_0xf39ac2[_0xa025('0x12')]);});}else{logger[_0xa025('0x13')]('['+[_0xa1b64f[_0xa025('0xf')]()]+']\x20using\x20admin\x20profile');_0x4a09aa[_0xa025('0x1b')]=_0x4a09aa['adminId'];_0x4a09aa['userEmail']=_0x4a09aa[_0xa025('0x1d')];_0x4c83ad(_0x4a09aa);}});};}function createEndUser(_0x27651c,_0x48850d,_0x551f90,_0xaabfbe,_0x1c047b){logger['info']('['+[_0x27651c['toUpperCase']()]+_0xa025('0x1f'),_0x551f90);return new Promise(function(_0x282400,_0x33e217){var _0xaa8a75={'method':_0xa025('0x20'),'uri':_0xaabfbe+_0xa025('0x21')+_0x1c047b,'body':{'user_name':_0x551f90[_0xa025('0x22')],'roles':_0xa025('0x23'),'first_name':_0x551f90[_0xa025('0x22')],'active':_0xa025('0x1a'),'date_format':_0xa025('0x24'),'phone':_0x551f90['endUserNumber']},'auth':_0x48850d,'json':!![]};return rp(_0xaa8a75)[_0xa025('0x17')](function(_0x2cbc89){logger[_0xa025('0x13')]('['+[_0x27651c[_0xa025('0xf')]()]+_0xa025('0x25'),_0x2cbc89['result']);_0x551f90['endUserId']=_0x2cbc89[_0xa025('0xc')][_0xa025('0xe')];_0x282400(_0x551f90);})[_0xa025('0x10')](function(_0x202706){logger[_0xa025('0x11')]('['+[_0x27651c['toUpperCase']()]+']',_0x202706[_0xa025('0x12')]);_0x33e217(_0x202706[_0xa025('0x12')]);});});}function getEndUser(_0x1c72ee,_0x46fb56,_0x35b3b9,_0x594dc9,_0x43d2d6){return function(_0xe7a13b){logger['info']('['+[_0x1c72ee[_0xa025('0xf')]()]+_0xa025('0x26'),_0xe7a13b);return new Promise(function(_0x3e5263,_0x557692){var _0x569857={'method':_0xa025('0xa'),'uri':_0x35b3b9+_0xa025('0x27')+_0xe7a13b[_0xa025('0x22')]+'&'+_0x594dc9+'&'+_0x43d2d6,'auth':_0x46fb56,'json':!![]};return rp(_0x569857)['then'](function(_0x511052){if(_0x511052[_0xa025('0xc')][_0xa025('0xd')]>0x0){_0xe7a13b[_0xa025('0x28')]=_0x511052[_0xa025('0xc')][0x0]['sys_id'];logger['info']('['+[_0x1c72ee['toUpperCase']()]+'],\x20getEndUser\x20crm',_0xe7a13b);_0x3e5263(_0xe7a13b);}else{return createEndUser(_0x1c72ee,_0x46fb56,_0xe7a13b,_0x35b3b9,_0x594dc9)[_0xa025('0x17')](function(_0x2dbbf4){logger['info']('['+[_0x1c72ee[_0xa025('0xf')]()]+_0xa025('0x29'),_0x2dbbf4);_0x3e5263(_0x2dbbf4);});}})[_0xa025('0x10')](function(_0x175c76){logger[_0xa025('0x11')]('['+[_0x1c72ee['toUpperCase']()]+']',_0x175c76[_0xa025('0x12')]);_0x557692(_0x175c76[_0xa025('0x12')]);});});};}function getCustomFields(_0x4a7d56,_0x4f81d0){var _0x2163bf={};if(_0x4a7d56[_0xa025('0xd')]>0x0){_['forEach'](_0x4a7d56,function(_0x4d5e80){if(_[_0xa025('0x2a')]([_0xa025('0x2b'),'picklist'],_0x4d5e80[_0xa025('0x2c')])&&_0x4d5e80['nameField']&&!_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x2e')]['toLowerCase']()]=_0x4d5e80[_0xa025('0x2f')][_0xa025('0x30')]();}else if(_[_0xa025('0x2a')]([_0xa025('0x2b'),_0xa025('0x31')],_0x4d5e80[_0xa025('0x2c')])&&_0x4d5e80['idField']&&_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x32')]['toLowerCase']()]=_0x4d5e80[_0xa025('0x2f')][_0xa025('0x30')]();}else if(_0x4d5e80[_0xa025('0x2c')]===_0xa025('0x33')&&_0x4d5e80[_0xa025('0x34')]&&_0x4d5e80['idField']&&_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x32')][_0xa025('0x35')]()]=_0x4f81d0[_0x4d5e80[_0xa025('0x34')]]['toString']();}else if(_0x4d5e80[_0xa025('0x2c')]===_0xa025('0x36')&&_0x4d5e80['Variable']&&_0x4d5e80['Variable']['name']&&_0x4d5e80[_0xa025('0x32')]&&_0x4d5e80[_0xa025('0x2d')]){_0x2163bf[_0x4d5e80[_0xa025('0x32')][_0xa025('0x35')]()]=_0x4f81d0[_0x4d5e80['Variable'][_0xa025('0x37')][_0xa025('0x35')]()][_0xa025('0x30')]();}});}return _0x2163bf;}function getTicket(_0x51c67c,_0x362188,_0x1ca6cf,_0x2b1369,_0x502b78,_0x29177e){return function(_0x24db57){logger['info']('['+[_0x51c67c[_0xa025('0xf')]()]+_0xa025('0x38'),_0x24db57);return new Promise(function(_0x2833c4,_0x1f938d){var _0x5e1df8=_0x51c67c[_0xa025('0x35')]()===_0xa025('0x39')?_0x24db57[_0xa025('0x1b')]:_0x24db57[_0xa025('0x28')];var _0x3c9a9a={'method':_0xa025('0x20'),'uri':_0x1ca6cf+_0xa025('0x3a')+'?'+_0x29177e,'body':Object[_0xa025('0x3b')]({},{'active':_0xa025('0x1a'),'caller_id':_0x5e1df8,'assigned_to':_0x24db57['userId'],'short_description':intUtil['getString'](_0x2b1369[_0xa025('0x3c')],_0x502b78,'\x20'),'description':intUtil[_0xa025('0x3d')](_0x2b1369[_0xa025('0x3e')],_0x502b78,'\x0a')},getCustomFields(_0x2b1369['Fields'],_0x502b78)),'auth':_0x362188,'json':!![]};return rp(_0x3c9a9a)[_0xa025('0x17')](function(_0x2bfaab){logger[_0xa025('0x13')]('['+[_0x51c67c[_0xa025('0xf')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x2bfaab[_0xa025('0xc')]);_0x24db57['ticketId']=_0x2bfaab[_0xa025('0xc')][_0xa025('0xe')];_0x24db57[_0xa025('0x3f')]=_0x2bfaab[_0xa025('0xc')][_0xa025('0x40')];logger[_0xa025('0x13')]('['+[_0x51c67c['toUpperCase']()]+']\x20getTicket\x20crm',_0x24db57);_0x2833c4(_0x24db57);})[_0xa025('0x10')](function(_0x3997f9){logger[_0xa025('0x11')]('['+[_0x51c67c['toUpperCase']()]+']',_0x3997f9[_0xa025('0x12')]);_0x1f938d(_0x3997f9[_0xa025('0x12')]);});});};}function createRemoteTag(_0x394a04,_0x3032be,_0x3f907d,_0xed1be6){return new Promise(function(_0x1df54f,_0x438e0c){var _0x4815ae={'method':'POST','uri':_0x3f907d+_0xa025('0x41')+'?'+_0xed1be6,'body':{'short_description':_0x394a04,'global':!![],'active':!![],'name':_0x394a04},'auth':_0x3032be,'json':!![]};return rp(_0x4815ae)['then'](function(_0x4e961f){var _0x52fc36=_0x4e961f['result'][_0xa025('0xe')];_0x1df54f(_0x52fc36);});});}function getRemoteTag(_0x565731,_0x2707e4,_0x4c0e03,_0x5de128,_0x330693){return new Promise(function(_0xacfa49,_0x38990d){var _0x3dc257={'method':'GET','uri':_0x4c0e03+'label'+'?sysparm_query=name%3D'+_0x565731+'&'+_0x5de128,'auth':_0x2707e4,'json':!![]};return rp(_0x3dc257)['then'](function(_0x33c47e){if(_0x33c47e[_0xa025('0xc')]['length']>0x0){var _0x376b22=_0x33c47e[_0xa025('0xc')][0x0][_0xa025('0xe')];_0xacfa49(_0x376b22);}else{return createRemoteTag(_0x565731,_0x2707e4,_0x4c0e03,_0x5de128)['then'](function(_0x1c59e5){_0xacfa49(_0x1c59e5);});}});});}function assignTagToIncident(_0x288c64,_0x1340f6,_0x3d7eab,_0x52384d,_0x154843){return new Promise(function(_0x50575c,_0x4dc6d9){var _0x479bc5={'method':_0xa025('0x20'),'uri':_0x3d7eab+_0xa025('0x42')+'?'+_0x154843,'body':{'label':_0x288c64,'table':_0xa025('0x3a'),'id_type':_0xa025('0x43'),'table_key':_0x52384d[_0xa025('0x44')],'title':'Incident\x20-\x20'+_0x52384d['ticketNumber'],'id_display':_0x52384d['ticketNumber']},'auth':_0x1340f6,'json':!![]};return rp(_0x479bc5)['then'](function(_0x8ed859){_0x50575c();})[_0xa025('0x10')](function(){_0x50575c();});});}function manageTags(_0x2de0bb,_0x2f8eb9,_0x26bfa4,_0x50686e,_0x196cd4,_0xeb38d7,_0x4890d6){return new Promise(function(_0xc06cc8,_0x360adc){var _0x1e585c=[];_0x2f8eb9[_0xa025('0x45')](function(_0x4140d5){_0x1e585c[_0xa025('0x46')](getRemoteTag(_0x4140d5,_0x26bfa4,_0x50686e,_0xeb38d7,_0x4890d6));});return Promise[_0xa025('0x47')](_0x1e585c)[_0xa025('0x17')](function(_0x5a6b7a){if(_0x5a6b7a[_0xa025('0xd')]){logger[_0xa025('0x13')]('['+[_0x2de0bb[_0xa025('0xf')]()]+_0xa025('0x48'),_0x5a6b7a);var _0x3d68ea=[];_0x5a6b7a['forEach'](function(_0x4d1469){_0x3d68ea[_0xa025('0x46')](assignTagToIncident(_0x4d1469,_0x26bfa4,_0x50686e,_0x196cd4,_0xeb38d7));});return Promise[_0xa025('0x47')](_0x3d68ea)[_0xa025('0x17')](function(){_0xc06cc8();})[_0xa025('0x10')](function(){_0xc06cc8();});}else{_0xc06cc8();}});});}function getTags(_0x3af05e,_0x4fc4e7,_0x4187e9,_0x2ea089,_0x9fe76c,_0x2ddfb6){return function(_0x56a0ca){return new Promise(function(_0x427712,_0x48f856){var _0x25d59c=[];var _0x13c963=_0x2ea089[_0xa025('0x49')];if(_0x13c963&&_0x13c963[_0xa025('0xd')]>0x0){_0x25d59c=_[_0xa025('0x4a')](_0x13c963,'name');}if(_0x25d59c[_0xa025('0xd')]>0x0){return manageTags(_0x3af05e,_0x25d59c,_0x4fc4e7,_0x4187e9,_0x56a0ca,_0x9fe76c,_0x2ddfb6)[_0xa025('0x17')](function(){_0x427712(_0x56a0ca);});}else{_0x427712(_0x56a0ca);}});};}function emit(_0x5bf5a7,_0x258acc,_0x3743f4){var _0x3635a1=_0xa025('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xa025('0x4c')+'%255EORDERBYDESCnumber';var _0x524792={'uri':_0x5bf5a7+_0xa025('0x4d')+_0x3743f4+_0x3635a1};io['to'](util[_0xa025('0x4e')](_0xa025('0x4f'),_0x258acc))[_0xa025('0x50')](_0xa025('0x51'),_0x524792);}exports['cs']=function(_0x17a93a,_0x24718a,_0x5c59b0,_0x3cb05a,_0x44251f,_0x853f44,_0x1964b6,_0x1736c9){var _0x2ebf07={};var _0x5d1afb={'user':_0x853f44[_0xa025('0x52')],'pass':_0x853f44['password']};var _0x363b03=_0xa025('0x53');var _0x1b66ed=_0xa025('0x54');_0x853f44[_0xa025('0x55')]=intUtil[_0xa025('0x56')](_0x853f44[_0xa025('0x55')]);_0x853f44[_0xa025('0x57')]=intUtil[_0xa025('0x56')](_0x853f44[_0xa025('0x57')]);var _0x5d06e0=util[_0xa025('0x4e')](_0xa025('0x58'),_0x853f44[_0xa025('0x55')]);_0x2ebf07['userEmail']=!_['isNil'](_0x3cb05a)?_0x3cb05a[_0xa025('0x59')]:null;_0x2ebf07['adminEmail']=_0x853f44['email'];_0x2ebf07['endUserNumber']=_0x1736c9[_0xa025('0x35')]()===_0xa025('0x39')?_0x24718a[_0xa025('0x5a')]:_0x24718a[_0xa025('0x5b')];_0x2ebf07[_0xa025('0x5c')]=_0x1736c9===_0xa025('0x5d')||_0x1736c9===_0xa025('0x5e')?'queue':_0xa025('0x39');var _0x2d6ea9=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x853f44[_0xa025('0x57')],_0x24718a[_0xa025('0x5f')],md5(_0x24718a[_0xa025('0x5f')]));if(_0x44251f&&_0x44251f[_0xa025('0x60')]){logger[_0xa025('0x13')]('[QUEUE]',_0xa025('0x61'));_0x24718a['recordingURL']=_0x2d6ea9;}else if(_0x1964b6&&_0x1964b6[_0xa025('0x62')]&&_0x1964b6[_0xa025('0x62')]!==_0xa025('0x63')){logger[_0xa025('0x13')](_0xa025('0x64'),_0xa025('0x61'));_0x24718a[_0xa025('0x65')]=_0x2d6ea9;}else{_0x24718a['recordingURL']='';}return getAdminUser(_0x1736c9,_0x5d1afb,_0x2ebf07,_0x5d06e0,_0x1b66ed,_0x363b03)[_0xa025('0x17')](getUser(_0x1736c9,_0x5d1afb,_0x5d06e0,_0x1b66ed,_0x363b03))[_0xa025('0x17')](getEndUser(_0x1736c9,_0x5d1afb,_0x5d06e0,_0x1b66ed,_0x363b03))['then'](getTicket(_0x1736c9,_0x5d1afb,_0x5d06e0,_0x5c59b0,_0x24718a,_0x1b66ed))[_0xa025('0x17')](function(_0x511d1f){logger[_0xa025('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x511d1f[_0xa025('0x44')]));logger[_0xa025('0x13')](util[_0xa025('0x4e')](_0xa025('0x66'),_0x1736c9));if(_0x1736c9!==_0xa025('0x5e')){logger[_0xa025('0x13')]('['+[_0x1736c9[_0xa025('0xf')]()]+']',_0xa025('0x67'));emit(_0x853f44[_0xa025('0x55')],_0x3cb05a[_0xa025('0x37')],_0x511d1f[_0xa025('0x44')]);}})[_0xa025('0x10')](function(_0x5aeeaf){logger[_0xa025('0x11')]('['+[_0x1736c9[_0xa025('0xf')]()]+_0xa025('0x68'),util[_0xa025('0x69')](_0x5aeeaf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x47ac=['request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','info','toUpperCase','catch','error','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','sys_id','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','name','Variable',']\x20getTicket\x20input\x20crm','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','email','outbound','destcalleridnum','queue','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird'];(function(_0x5c10dc,_0x1c0913){var _0x298b81=function(_0x487861){while(--_0x487861){_0x5c10dc['push'](_0x5c10dc['shift']());}};_0x298b81(++_0x1c0913);}(_0x47ac,0x19e));var _0xc47a=function(_0x49a124,_0x208eab){_0x49a124=_0x49a124-0x0;var _0x39e13e=_0x47ac[_0x49a124];return _0x39e13e;};'use strict';var _=require(_0xc47a('0x0'));var Promise=require(_0xc47a('0x1'));var rp=require(_0xc47a('0x2'));var util=require(_0xc47a('0x3'));var md5=require('md5');var Redis=require(_0xc47a('0x4'));var intUtil=require('./util');var config=require(_0xc47a('0x5'));var logger=require(_0xc47a('0x6'))(_0xc47a('0x7'));config[_0xc47a('0x8')]=_[_0xc47a('0x9')](config[_0xc47a('0x8')],{'host':_0xc47a('0xa'),'port':0x18eb});var io=require(_0xc47a('0xb'))(new Redis(config[_0xc47a('0x8')]));function getAdminUser(_0x556a0f,_0x117202,_0x1f0677,_0x4cde56,_0x14c9cf,_0x46637c){return new Promise(function(_0xc06cf0,_0x4baf2f){var _0x1c22ce={'method':_0xc47a('0xc'),'uri':_0x4cde56+_0xc47a('0xd')+'&'+_0x14c9cf+'&'+_0x46637c,'auth':_0x117202,'json':!![]};return rp(_0x1c22ce)[_0xc47a('0xe')](function(_0x280d81){if(_0x280d81[_0xc47a('0xf')]['length']>0x0){_0x1f0677[_0xc47a('0x10')]=_0x280d81['result'][0x0]['sys_id'];}logger[_0xc47a('0x11')]('['+[_0x556a0f[_0xc47a('0x12')]()]+'],\x20getAdminUser\x20crm',_0x1f0677);_0xc06cf0(_0x1f0677);})[_0xc47a('0x13')](function(_0x410b2c){logger[_0xc47a('0x14')]('['+[_0x556a0f[_0xc47a('0x12')]()]+']',_0x410b2c[_0xc47a('0x15')]);_0x4baf2f(_0x410b2c[_0xc47a('0x15')]);});});}function getUser(_0x5895be,_0x2d5d9f,_0x53613a,_0x3b2b91,_0x29c0ec){return function(_0x230951){logger[_0xc47a('0x11')]('['+[_0x5895be['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x230951);return new Promise(function(_0x5aa8e3,_0x2a713d){if(intUtil['validateEmail'](_0x230951[_0xc47a('0x16')])){var _0xf9ee5f={'method':_0xc47a('0xc'),'uri':_0x53613a+_0xc47a('0x17')+_0x230951['userEmail']+'&'+_0x3b2b91+'&'+_0x29c0ec,'auth':_0x2d5d9f,'json':!![]};logger[_0xc47a('0x11')]('['+[_0x5895be['toUpperCase']()]+_0xc47a('0x18'),_0xf9ee5f);return rp(_0xf9ee5f)[_0xc47a('0xe')](function(_0x5b65eb){logger[_0xc47a('0x11')]('['+[_0x5895be[_0xc47a('0x12')]()]+_0xc47a('0x19'),_0x5b65eb);if(_0x5b65eb[_0xc47a('0xf')][_0xc47a('0x1a')]>0x0&&String(_0x5b65eb[_0xc47a('0xf')][0x0][_0xc47a('0x1b')])===_0xc47a('0x1c')){_0x230951['userId']=_0x5b65eb['result'][0x0][_0xc47a('0x1d')];}else{_0x230951[_0xc47a('0x1e')]=_0x230951[_0xc47a('0x10')];_0x230951[_0xc47a('0x16')]=_0x230951[_0xc47a('0x1f')];}logger[_0xc47a('0x11')]('['+[_0x5895be[_0xc47a('0x12')]()]+_0xc47a('0x20'),_0x230951);_0x5aa8e3(_0x230951);})['catch'](function(_0x2edced){logger[_0xc47a('0x14')]('['+[_0x5895be['toUpperCase']()]+']',_0x2edced[_0xc47a('0x15')]);_0x2a713d(_0x2edced['message']);});}else{logger[_0xc47a('0x11')]('['+[_0x5895be['toUpperCase']()]+_0xc47a('0x21'));_0x230951[_0xc47a('0x1e')]=_0x230951[_0xc47a('0x10')];_0x230951['userEmail']=_0x230951[_0xc47a('0x1f')];_0x5aa8e3(_0x230951);}});};}function createEndUser(_0x5809d8,_0x407328,_0x4c1084,_0x3e3ee1,_0x551459){logger[_0xc47a('0x11')]('['+[_0x5809d8[_0xc47a('0x12')]()]+_0xc47a('0x22'),_0x4c1084);return new Promise(function(_0x169003,_0x43cefb){var _0x4b59ce={'method':_0xc47a('0x23'),'uri':_0x3e3ee1+_0xc47a('0x24')+_0x551459,'body':{'user_name':_0x4c1084[_0xc47a('0x25')],'roles':_0xc47a('0x26'),'first_name':_0x4c1084[_0xc47a('0x25')],'active':'true','date_format':_0xc47a('0x27'),'phone':_0x4c1084[_0xc47a('0x25')]},'auth':_0x407328,'json':!![]};return rp(_0x4b59ce)['then'](function(_0x54705c){logger[_0xc47a('0x11')]('['+[_0x5809d8[_0xc47a('0x12')]()]+_0xc47a('0x28'),_0x54705c[_0xc47a('0xf')]);_0x4c1084[_0xc47a('0x29')]=_0x54705c[_0xc47a('0xf')][_0xc47a('0x1d')];_0x169003(_0x4c1084);})[_0xc47a('0x13')](function(_0x3920d9){logger[_0xc47a('0x14')]('['+[_0x5809d8['toUpperCase']()]+']',_0x3920d9[_0xc47a('0x15')]);_0x43cefb(_0x3920d9[_0xc47a('0x15')]);});});}function getEndUser(_0x41945d,_0x364ff6,_0x37a04d,_0x1ec879,_0x11997c){return function(_0x31e542){logger[_0xc47a('0x11')]('['+[_0x41945d[_0xc47a('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x31e542);return new Promise(function(_0x167f2e,_0x2b56af){var _0x1d062c={'method':_0xc47a('0xc'),'uri':_0x37a04d+'sys_user?sysparm_query=phone%3D'+_0x31e542[_0xc47a('0x25')]+'&'+_0x1ec879+'&'+_0x11997c,'auth':_0x364ff6,'json':!![]};return rp(_0x1d062c)[_0xc47a('0xe')](function(_0x4caa26){if(_0x4caa26[_0xc47a('0xf')]['length']>0x0){_0x31e542[_0xc47a('0x29')]=_0x4caa26[_0xc47a('0xf')][0x0]['sys_id'];logger[_0xc47a('0x11')]('['+[_0x41945d[_0xc47a('0x12')]()]+_0xc47a('0x2a'),_0x31e542);_0x167f2e(_0x31e542);}else{return createEndUser(_0x41945d,_0x364ff6,_0x31e542,_0x37a04d,_0x1ec879)['then'](function(_0x5d27ad){logger[_0xc47a('0x11')]('['+[_0x41945d[_0xc47a('0x12')]()]+_0xc47a('0x2b'),_0x5d27ad);_0x167f2e(_0x5d27ad);});}})[_0xc47a('0x13')](function(_0x334811){logger['error']('['+[_0x41945d['toUpperCase']()]+']',_0x334811[_0xc47a('0x15')]);_0x2b56af(_0x334811[_0xc47a('0x15')]);});});};}function getCustomFields(_0x35c291,_0x42a244){var _0xe49e16={};if(_0x35c291['length']>0x0){_[_0xc47a('0x2c')](_0x35c291,function(_0xb2c06b){if(_[_0xc47a('0x2d')]([_0xc47a('0x2e'),_0xc47a('0x2f')],_0xb2c06b[_0xc47a('0x30')])&&_0xb2c06b['nameField']&&!_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x32')][_0xc47a('0x33')]()]=_0xb2c06b[_0xc47a('0x34')][_0xc47a('0x35')]();}else if(_[_0xc47a('0x2d')]([_0xc47a('0x2e'),_0xc47a('0x2f')],_0xb2c06b[_0xc47a('0x30')])&&_0xb2c06b[_0xc47a('0x36')]&&_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x36')][_0xc47a('0x33')]()]=_0xb2c06b[_0xc47a('0x34')][_0xc47a('0x35')]();}else if(_0xb2c06b['type']===_0xc47a('0x37')&&_0xb2c06b[_0xc47a('0x38')]&&_0xb2c06b[_0xc47a('0x36')]&&_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x36')][_0xc47a('0x33')]()]=_0x42a244[_0xb2c06b[_0xc47a('0x38')]][_0xc47a('0x35')]();}else if(_0xb2c06b[_0xc47a('0x30')]==='customVariable'&&_0xb2c06b['Variable']&&_0xb2c06b['Variable'][_0xc47a('0x39')]&&_0xb2c06b[_0xc47a('0x36')]&&_0xb2c06b[_0xc47a('0x31')]){_0xe49e16[_0xb2c06b[_0xc47a('0x36')][_0xc47a('0x33')]()]=_0x42a244[_0xb2c06b[_0xc47a('0x3a')][_0xc47a('0x39')][_0xc47a('0x33')]()][_0xc47a('0x35')]();}});}return _0xe49e16;}function getTicket(_0x493fb3,_0x1c2302,_0x1d75ca,_0x32b757,_0x344a37,_0x57ce56){return function(_0x41cf51){logger[_0xc47a('0x11')]('['+[_0x493fb3[_0xc47a('0x12')]()]+_0xc47a('0x3b'),_0x41cf51);return new Promise(function(_0x3b4096,_0x1d20eb){var _0x4a9f0c=_0x493fb3[_0xc47a('0x33')]()==='outbound'?_0x41cf51['userId']:_0x41cf51[_0xc47a('0x29')];var _0x33a650={'method':_0xc47a('0x23'),'uri':_0x1d75ca+_0xc47a('0x3c')+'?'+_0x57ce56,'body':Object['assign']({},{'active':_0xc47a('0x1c'),'caller_id':_0x4a9f0c,'assigned_to':_0x41cf51[_0xc47a('0x1e')],'short_description':intUtil[_0xc47a('0x3d')](_0x32b757['Subjects'],_0x344a37,'\x20'),'description':intUtil[_0xc47a('0x3d')](_0x32b757[_0xc47a('0x3e')],_0x344a37,'\x0a')},getCustomFields(_0x32b757[_0xc47a('0x3f')],_0x344a37)),'auth':_0x1c2302,'json':!![]};return rp(_0x33a650)[_0xc47a('0xe')](function(_0x24ac25){logger[_0xc47a('0x11')]('['+[_0x493fb3['toUpperCase']()]+_0xc47a('0x40'),_0x24ac25[_0xc47a('0xf')]);_0x41cf51[_0xc47a('0x41')]=_0x24ac25['result']['sys_id'];_0x41cf51[_0xc47a('0x42')]=_0x24ac25[_0xc47a('0xf')][_0xc47a('0x43')];logger[_0xc47a('0x11')]('['+[_0x493fb3[_0xc47a('0x12')]()]+_0xc47a('0x44'),_0x41cf51);_0x3b4096(_0x41cf51);})[_0xc47a('0x13')](function(_0x24cbd4){logger[_0xc47a('0x14')]('['+[_0x493fb3[_0xc47a('0x12')]()]+']',_0x24cbd4[_0xc47a('0x15')]);_0x1d20eb(_0x24cbd4[_0xc47a('0x15')]);});});};}function createRemoteTag(_0x2ca127,_0x30f8c3,_0x21abb6,_0x3a1b34){return new Promise(function(_0x4b5d58,_0x52defa){var _0x566bdf={'method':_0xc47a('0x23'),'uri':_0x21abb6+_0xc47a('0x45')+'?'+_0x3a1b34,'body':{'short_description':_0x2ca127,'global':!![],'active':!![],'name':_0x2ca127},'auth':_0x30f8c3,'json':!![]};return rp(_0x566bdf)['then'](function(_0x2eb663){var _0x381cf4=_0x2eb663['result'][_0xc47a('0x1d')];_0x4b5d58(_0x381cf4);});});}function getRemoteTag(_0x407978,_0x34b089,_0x51484f,_0x1e5357,_0x5cec40){return new Promise(function(_0x1da06d,_0x5f42ca){var _0x2e0ba6={'method':_0xc47a('0xc'),'uri':_0x51484f+_0xc47a('0x45')+'?sysparm_query=name%3D'+_0x407978+'&'+_0x1e5357,'auth':_0x34b089,'json':!![]};return rp(_0x2e0ba6)[_0xc47a('0xe')](function(_0x273944){if(_0x273944[_0xc47a('0xf')]['length']>0x0){var _0x101d72=_0x273944[_0xc47a('0xf')][0x0]['sys_id'];_0x1da06d(_0x101d72);}else{return createRemoteTag(_0x407978,_0x34b089,_0x51484f,_0x1e5357)[_0xc47a('0xe')](function(_0x4313c6){_0x1da06d(_0x4313c6);});}});});}function assignTagToIncident(_0x56c8e5,_0x5963bf,_0x5134ab,_0x42c3c2,_0x3825b7){return new Promise(function(_0x349187,_0x4a9143){var _0x285fc2={'method':_0xc47a('0x23'),'uri':_0x5134ab+'label_entry'+'?'+_0x3825b7,'body':{'label':_0x56c8e5,'table':_0xc47a('0x3c'),'id_type':'Incident','table_key':_0x42c3c2[_0xc47a('0x41')],'title':_0xc47a('0x46')+_0x42c3c2[_0xc47a('0x42')],'id_display':_0x42c3c2[_0xc47a('0x42')]},'auth':_0x5963bf,'json':!![]};return rp(_0x285fc2)[_0xc47a('0xe')](function(_0x2102dc){_0x349187();})['catch'](function(){_0x349187();});});}function manageTags(_0x350c51,_0x5a9600,_0x33677f,_0x458f81,_0x14216f,_0x2e1e18,_0x3f9cac){return new Promise(function(_0x5840f0,_0x477695){var _0x1d8fef=[];_0x5a9600[_0xc47a('0x2c')](function(_0x527f38){_0x1d8fef[_0xc47a('0x47')](getRemoteTag(_0x527f38,_0x33677f,_0x458f81,_0x2e1e18,_0x3f9cac));});return Promise['all'](_0x1d8fef)[_0xc47a('0xe')](function(_0x40561c){if(_0x40561c[_0xc47a('0x1a')]){logger[_0xc47a('0x11')]('['+[_0x350c51[_0xc47a('0x12')]()]+_0xc47a('0x48'),_0x40561c);var _0x3b78c2=[];_0x40561c[_0xc47a('0x2c')](function(_0x1a3251){_0x3b78c2[_0xc47a('0x47')](assignTagToIncident(_0x1a3251,_0x33677f,_0x458f81,_0x14216f,_0x2e1e18));});return Promise[_0xc47a('0x49')](_0x3b78c2)[_0xc47a('0xe')](function(){_0x5840f0();})[_0xc47a('0x13')](function(){_0x5840f0();});}else{_0x5840f0();}});});}function getTags(_0x54f4ea,_0x461db6,_0x32fcc1,_0x27340f,_0x5569c5,_0x1d3107){return function(_0x7ddda7){return new Promise(function(_0x4fde18,_0x13c81d){var _0x1d672f=[];var _0x9fe2ce=_0x27340f[_0xc47a('0x4a')];if(_0x9fe2ce&&_0x9fe2ce['length']>0x0){_0x1d672f=_[_0xc47a('0x4b')](_0x9fe2ce,'name');}if(_0x1d672f['length']>0x0){return manageTags(_0x54f4ea,_0x1d672f,_0x461db6,_0x32fcc1,_0x7ddda7,_0x5569c5,_0x1d3107)[_0xc47a('0xe')](function(){_0x4fde18(_0x7ddda7);});}else{_0x4fde18(_0x7ddda7);}});};}function emit(_0xa19a51,_0x5d301f,_0x213f41){var _0x159224=_0xc47a('0x4c')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xc47a('0x4d')+_0xc47a('0x4e');var _0x3be815={'uri':_0xa19a51+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x213f41+_0x159224};io['to'](util['format'](_0xc47a('0x4f'),_0x5d301f))['emit'](_0xc47a('0x50'),_0x3be815);}exports['cs']=function(_0x316c0b,_0x4f0111,_0x3b9f67,_0x41cd89,_0x552799,_0x439566,_0x2ed21a,_0x54a3a9){var _0x382dfd={};var _0x588888={'user':_0x439566['username'],'pass':_0x439566[_0xc47a('0x51')]};var _0x4cd774=_0xc47a('0x52');var _0x3bf885=_0xc47a('0x53');_0x439566[_0xc47a('0x54')]=intUtil[_0xc47a('0x55')](_0x439566[_0xc47a('0x54')]);_0x439566[_0xc47a('0x56')]=intUtil[_0xc47a('0x55')](_0x439566['serverUrl']);var _0x50816b=util['format']('%s/api/now/table/',_0x439566['remoteUri']);_0x382dfd[_0xc47a('0x16')]=!_['isNil'](_0x41cd89)?_0x41cd89[_0xc47a('0x57')]:null;_0x382dfd[_0xc47a('0x1f')]=_0x439566[_0xc47a('0x57')];_0x382dfd['endUserNumber']=_0x54a3a9[_0xc47a('0x33')]()===_0xc47a('0x58')?_0x4f0111[_0xc47a('0x59')]:_0x4f0111['calleridnum'];_0x382dfd['callDirection']=_0x54a3a9===_0xc47a('0x5a')||_0x54a3a9==='unmanaged'?_0xc47a('0x5a'):'outbound';var _0x977cfe=util[_0xc47a('0x5b')](_0xc47a('0x5c'),_0x439566[_0xc47a('0x56')],_0x4f0111[_0xc47a('0x5d')],md5(_0x4f0111[_0xc47a('0x5d')]));if(_0x552799&&_0x552799[_0xc47a('0x5e')]){logger[_0xc47a('0x11')](_0xc47a('0x5f'),_0xc47a('0x60'));_0x4f0111['recordingURL']=_0x977cfe;}else if(_0x2ed21a&&_0x2ed21a['recordingFormat']&&_0x2ed21a[_0xc47a('0x61')]!=='none'){logger[_0xc47a('0x11')](_0xc47a('0x62'),'Recording\x20is\x20enabled!');_0x4f0111['recordingURL']=_0x977cfe;}else{_0x4f0111[_0xc47a('0x63')]='';}return getAdminUser(_0x54a3a9,_0x588888,_0x382dfd,_0x50816b,_0x3bf885,_0x4cd774)[_0xc47a('0xe')](getUser(_0x54a3a9,_0x588888,_0x50816b,_0x3bf885,_0x4cd774))['then'](getEndUser(_0x54a3a9,_0x588888,_0x50816b,_0x3bf885,_0x4cd774))[_0xc47a('0xe')](getTicket(_0x54a3a9,_0x588888,_0x50816b,_0x3b9f67,_0x4f0111,_0x3bf885))[_0xc47a('0xe')](function(_0x4fe532){logger[_0xc47a('0x11')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4fe532[_0xc47a('0x41')]));logger[_0xc47a('0x11')](util[_0xc47a('0x5b')]('call\x20direction:\x20%s',_0x54a3a9));if(_0x54a3a9!==_0xc47a('0x64')){logger[_0xc47a('0x11')]('['+[_0x54a3a9[_0xc47a('0x12')]()]+']',_0xc47a('0x65'));emit(_0x439566[_0xc47a('0x54')],_0x41cd89[_0xc47a('0x39')],_0x4fe532['ticketId']);}})[_0xc47a('0x13')](function(_0x30df6d){logger['error']('['+[_0x54a3a9['toUpperCase']()]+_0xc47a('0x66'),util[_0xc47a('0x67')](_0x30df6d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 58eda8d..8ea7121 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 _0x7421=['value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','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','debug','[HTTP]','merge','map','nameField','customField','content','toString','type','string','custom_fields','push','idField','variable','customVariable','Variable','toLowerCase','login','username','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','catch','unmanaged','lastevent','toUpperCase','error','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','duration_hours','duration_minutes','parent_id','Contacts','parent_name','direction','length','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','isNil','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find'];(function(_0xd5ea1c,_0x5222ee){var _0x37c9e8=function(_0x2a2c5f){while(--_0x2a2c5f){_0xd5ea1c['push'](_0xd5ea1c['shift']());}};_0x37c9e8(++_0x5222ee);}(_0x7421,0x149));var _0x1742=function(_0x303959,_0x12aa60){_0x303959=_0x303959-0x0;var _0x3d0d33=_0x7421[_0x303959];return _0x3d0d33;};'use strict';var _=require('lodash');var rp=require(_0x1742('0x0'));var BPromise=require(_0x1742('0x1'));var md5=require(_0x1742('0x2'));var util=require(_0x1742('0x3'));var Redis=require(_0x1742('0x4'));var intUtil=require(_0x1742('0x5'));var config=require('../../../../config/environment');var logger=require(_0x1742('0x6'))(_0x1742('0x7'));config['redis']=_[_0x1742('0x8')](config[_0x1742('0x9')],{'host':_0x1742('0xa'),'port':0x18eb});var io=require(_0x1742('0xb'))(new Redis(config[_0x1742('0x9')]));var def={'method':_0x1742('0xc'),'json':!![]};function emit(_0x2d6f37,_0x67da7a,_0x38ea3b){io['to'](_0x2d6f37)[_0x1742('0xd')](_0x67da7a,_0x38ea3b);}function getTicket(_0xd66644,_0x2f498d,_0x3986f4,_0xd62e30,_0x11bf76,_0x57fb94,_0x6cecd,_0x1a23aa){logger[_0x1742('0xe')](_0x1742('0xf'));var _0x47f42e=new Date();var _0x14de16=[{'name':_0x1742('0x10'),'value':intUtil[_0x1742('0x11')](_0xd62e30[_0x1742('0x12')],_0x11bf76,'\x20')},{'name':'assigned_user_id','value':_0x2f498d['id']},{'name':_0x1742('0x13'),'value':_0x2f498d['id']},{'name':_0x1742('0x14'),'value':intUtil[_0x1742('0x11')](_0xd62e30[_0x1742('0x15')],_0x11bf76,'\x0a')},{'name':_0x1742('0x16'),'value':_0x47f42e[_0x1742('0x17')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0x1742('0x18'),'value':'0'},{'name':_0x1742('0x19'),'value':'15'},{'name':_0x1742('0x1a'),'value':_0x3986f4['id']},{'name':'parent_type','value':_0x1742('0x1b')},{'name':_0x1742('0x1c'),'value':_0x3986f4[_0x1742('0x10')]},{'name':_0x1742('0x1d'),'value':_0x1a23aa}];if(_0x57fb94[_0x1742('0x1e')]){_[_0x1742('0x1f')](_0x57fb94,function(_0x26b109){if(_0x11bf76[_0x26b109['variableName']]){_0x14de16['push']({'name':_0x26b109['idField'],'value':_0x11bf76[_0x26b109[_0x1742('0x20')]]});}});}return request({'form':{'method':_0x1742('0x21'),'input_type':_0x1742('0x22'),'response_type':'JSON','rest_data':JSON[_0x1742('0x23')]({'session':_0x6cecd['id'],'module_name':_0x1742('0x24'),'name_value_list':_0x14de16})}});}function getAuth(_0x2d77b1){return util[_0x1742('0x25')](_0x1742('0x26'),new Buffer(_0x2d77b1[_0x1742('0x27')]+':X')['toString'](_0x1742('0x28')));}function getServerInfo(_0x458507){return request({'form':{'method':'get_server_info','input_type':_0x1742('0x22'),'response_type':_0x1742('0x22'),'rest_data':JSON['stringify']({'session':_0x458507['id']})}});}function getUser(_0x3ad750,_0x2b35a3,_0x517e8b){if(!_[_0x1742('0x29')](_0x2b35a3)){logger['info']('Getting\x20agent\x20with\x20name',_0x2b35a3);return request({'form':{'method':_0x1742('0x2a'),'input_type':_0x1742('0x22'),'response_type':_0x1742('0x22'),'rest_data':JSON[_0x1742('0x23')]({'session':_0x517e8b['id'],'module_name':_0x1742('0x2b'),'query':util['format'](_0x1742('0x2c'),_0x2b35a3),'order_by':'','offset':'0','select_fields':['id',_0x1742('0x10'),_0x1742('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1742('0x2e')](function(_0x154f44){if(_0x154f44[_0x1742('0x2f')][_0x1742('0x1e')]){var _0x381d77=_[_0x1742('0x30')](_0x154f44[_0x1742('0x2f')],function(_0x4696d8){return _0x4696d8['name_value_list'][_0x1742('0x2d')][_0x1742('0x31')]===_0x2b35a3;});if(_0x381d77){logger[_0x1742('0xe')](_0x1742('0x32'));return BPromise[_0x1742('0x33')]({'id':_0x381d77[_0x1742('0x34')]['id'][_0x1742('0x31')],'name':_0x381d77[_0x1742('0x34')]['name'][_0x1742('0x31')]});}}logger['info'](_0x1742('0x35'));return BPromise[_0x1742('0x33')]({'id':_0x517e8b[_0x1742('0x34')][_0x1742('0x36')][_0x1742('0x31')],'name':_0x517e8b['name_value_list']['user_name'][_0x1742('0x31')]});});}else{logger[_0x1742('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x1742('0x33')]({'id':_0x517e8b['name_value_list']['user_id'][_0x1742('0x31')],'name':_0x517e8b[_0x1742('0x34')]['user_name'][_0x1742('0x31')]});}}function getEndUser(_0x175939,_0xc673b,_0x5a21aa,_0x437640){logger[_0x1742('0xe')](_0x1742('0x37'),_0x5a21aa);return request({'form':{'method':_0x1742('0x2a'),'input_type':_0x1742('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x437640['id'],'module_name':'Contacts','query':util[_0x1742('0x25')](_0x1742('0x38'),_0x5a21aa),'order_by':'','offset':'0','select_fields':['id',_0x1742('0x10'),_0x1742('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x1742('0x2e')](function(_0x1cf9ce){if(_0x1cf9ce[_0x1742('0x2f')][_0x1742('0x1e')]){var _0x57ef49=_[_0x1742('0x30')](_0x1cf9ce['entry_list'],function(_0x1463ec){return _0x1463ec[_0x1742('0x34')][_0x1742('0x39')][_0x1742('0x31')]===_0x5a21aa;});if(_0x57ef49){logger['info'](_0x1742('0x3a'));return BPromise[_0x1742('0x33')]({'id':_0x57ef49[_0x1742('0x34')]['id'][_0x1742('0x31')],'name':_0x57ef49[_0x1742('0x34')][_0x1742('0x10')][_0x1742('0x31')],'phone':_0x57ef49[_0x1742('0x34')]['phone_home']['value']});}}else{logger[_0x1742('0xe')](_0x1742('0x3b'));return request({'form':{'method':_0x1742('0x21'),'input_type':_0x1742('0x22'),'response_type':_0x1742('0x22'),'rest_data':JSON['stringify']({'session':_0x437640['id'],'module_name':'Contacts','name_value_list':[{'name':_0x1742('0x3c'),'value':_0xc673b!==_0x1742('0x3d')?_0xc673b:util['format'](_0x1742('0x3e'),_0x5a21aa)},{'name':_0x1742('0x39'),'value':_0x5a21aa}]})}})['then'](function(_0x5e084a){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x5e084a['id'],'name':_0x5e084a[_0x1742('0x2f')][_0x1742('0x3c')][_0x1742('0x31')],'phone':_0x5e084a['entry_list'][_0x1742('0x39')][_0x1742('0x31')]});});}});}function request(_0x36036c){logger[_0x1742('0x3f')](_0x1742('0x40'),JSON['stringify'](_0x36036c));return rp(_[_0x1742('0x41')](def,_0x36036c));}function getTags(_0x1c56e8,_0x1bb136){var _0xb85a2f=[];if(_0x1c56e8&&_0x1c56e8[_0x1742('0x1e')]>0x0){_0xb85a2f=_[_0x1742('0x42')](_0x1c56e8,_0x1bb136);}return _0xb85a2f;}function getCustomFields(_0x5d2318,_0x37b5fc){var _0x5b088c=[];var _0x807f2c={'custom_fields':[]};if(_0x5d2318[_0x1742('0x1e')]>0x0){_[_0x1742('0x1f')](_0x5d2318,function(_0x46283d){if(_0x46283d['type']==='string'&&_0x46283d[_0x1742('0x43')]&&!_0x46283d[_0x1742('0x44')]){_0x807f2c[_0x46283d[_0x1742('0x43')]['toLowerCase']()]=_0x46283d[_0x1742('0x45')][_0x1742('0x46')]();}else if(_0x46283d[_0x1742('0x47')]===_0x1742('0x48')&&_0x46283d['idField']&&_0x46283d[_0x1742('0x44')]){_0x807f2c[_0x1742('0x49')][_0x1742('0x4a')]({'id':_0x46283d[_0x1742('0x4b')],'value':_0x46283d[_0x1742('0x45')][_0x1742('0x46')]()});}else if(_0x46283d[_0x1742('0x47')]===_0x1742('0x4c')&&_0x46283d[_0x1742('0x20')]&&_0x46283d[_0x1742('0x4b')]&&_0x46283d[_0x1742('0x44')]){_0x37b5fc[_0x46283d[_0x1742('0x20')]]&&_0x807f2c[_0x1742('0x49')][_0x1742('0x4a')]({'id':_0x46283d[_0x1742('0x4b')],'value':_0x37b5fc[_0x46283d[_0x1742('0x20')]][_0x1742('0x46')]()});}else if(_0x46283d[_0x1742('0x47')]===_0x1742('0x4d')&&_0x46283d[_0x1742('0x4e')]&&_0x46283d[_0x1742('0x4e')][_0x1742('0x10')]&&_0x46283d['idField']&&_0x46283d[_0x1742('0x44')]){_0x37b5fc[_0x46283d[_0x1742('0x4e')]['name'][_0x1742('0x4f')]()]&&_0x807f2c[_0x1742('0x49')][_0x1742('0x4a')]({'id':_0x46283d[_0x1742('0x4b')],'value':_0x37b5fc[_0x46283d[_0x1742('0x4e')][_0x1742('0x10')]['toLowerCase']()]['toString']()});}});}return _0x807f2c;}function getConnection(_0x432b4d){return request({'method':'POST','form':{'method':_0x1742('0x50'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x1742('0x23')]({'user_auth':{'user_name':_0x432b4d[_0x1742('0x51')],'password':_0x432b4d['password'],'encryption':_0x1742('0x52')},'application':_0x1742('0x53')})}})['then'](function(_0x14a0ad){var _0x404440=_0x14a0ad;if(_0x404440['id']){def['sessionID']=_0x404440['id'];return BPromise[_0x1742('0x33')](_0x404440);}else{throw new Error(util[_0x1742('0x25')](_0x1742('0x54'),_0x432b4d['id']));}});}function setRelationship(_0x54e8ec,_0xb3aa0b,_0x5ca2a6,_0x522500){return request({'form':{'method':'set_relationship','input_type':_0x1742('0x22'),'response_type':_0x1742('0x22'),'rest_data':JSON[_0x1742('0x23')]({'session':_0x54e8ec['id'],'module_name':_0x1742('0x24'),'module_id':_0x5ca2a6['id'],'link_field_name':_0x522500,'related_ids':[_0xb3aa0b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x1742('0x55')]=function(_0x235f0a,_0x3089b6,_0x45a00b,_0x5e64bb,_0x2d8057,_0xb6ea61){var _0x1bdb72,_0x675196,_0x40d503,_0x1ff857;_0xb6ea61[_0x1742('0x56')]=intUtil[_0x1742('0x57')](_0xb6ea61['remoteUri']);_0xb6ea61[_0x1742('0x58')]=intUtil['stripTrailingSlash'](_0xb6ea61[_0x1742('0x58')]);def[_0x1742('0x59')]=util[_0x1742('0x25')](_0x1742('0x5a'),_0xb6ea61[_0x1742('0x56')]);if(_0x2d8057&&_0x2d8057[_0x1742('0x5b')]){logger[_0x1742('0xe')]('[QUEUE]',_0x1742('0x5c'));_0x3089b6[_0x1742('0x5d')]=util[_0x1742('0x25')](_0x1742('0x5e'),_0xb6ea61['serverUrl'],_0x3089b6['uniqueid'],md5(_0x3089b6[_0x1742('0x5f')]));}else{_0x3089b6[_0x1742('0x5d')]='';}return getConnection(_0xb6ea61)[_0x1742('0x2e')](function(_0x25e5c9){_0x1ff857=_0x25e5c9;return getUser(_0xb6ea61,_0x5e64bb['name'],_0x1ff857);})[_0x1742('0x2e')](function(_0x55148d){_0x1bdb72=_0x55148d;logger[_0x1742('0xe')](_0x1742('0x60'),_0x1bdb72['id']);return getEndUser(_0xb6ea61,_0x3089b6[_0x1742('0x61')],_0x3089b6[_0x1742('0x62')],_0x1ff857);})[_0x1742('0x2e')](function(_0x57d7a0){_0x675196=_0x57d7a0;logger[_0x1742('0xe')](_0x1742('0x63'),_0x675196['id']);return getTicket(_0xb6ea61,_0x1bdb72,_0x675196,_0x45a00b,_0x3089b6,_0x45a00b[_0x1742('0x64')],_0x1ff857,_0x1742('0x65'));})['then'](function(_0x3461d7){_0x40d503=_0x3461d7;logger[_0x1742('0xe')](_0x1742('0x66'));logger['info'](_0x1742('0x67'),_0x40d503['id']);return setRelationship(_0x1ff857,_0x1bdb72,_0x40d503,_0x1742('0x68'));})[_0x1742('0x2e')](function(){return setRelationship(_0x1ff857,_0x675196,_0x40d503,_0x1742('0x69'));})[_0x1742('0x2e')](function(){return getServerInfo(_0x1ff857);})[_0x1742('0x2e')](function(_0x564c0c){var _0x2550c5=parseInt(_0x564c0c[_0x1742('0x6a')][_0x1742('0x6b')](0x0));var _0x17a404=util[_0x1742('0x25')](_0x1742('0x6c'),_0xb6ea61['remoteUri'],_0x40d503['id']);if(_0x2550c5>0x6){_0x17a404=util['format'](_0x1742('0x6d'),_0xb6ea61['remoteUri'],_0x40d503['id']);}logger['info'](_0x1742('0x6e'),_0x1742('0x6f'));emit(util['format'](_0x1742('0x70'),_0x5e64bb[_0x1742('0x10')]),_0x1742('0x71'),{'uri':_0x17a404});})['catch'](function(_0xfe92f6){logger['error'](_0x1742('0x6e'),JSON[_0x1742('0x23')](_0xfe92f6));});};exports[_0x1742('0x72')]=function(_0x3b0fbf,_0x42d07e,_0x3f7e46,_0x256f4b,_0x199cc2,_0x6c4a0e,_0x5b3c8e){var _0x4adcbd,_0x55f7d7,_0x217c54,_0x414693;_0x6c4a0e[_0x1742('0x56')]=intUtil[_0x1742('0x57')](_0x6c4a0e['remoteUri']);_0x6c4a0e[_0x1742('0x58')]=intUtil[_0x1742('0x57')](_0x6c4a0e[_0x1742('0x58')]);def[_0x1742('0x59')]=util[_0x1742('0x25')](_0x1742('0x5a'),_0x6c4a0e[_0x1742('0x56')]);if(_0x5b3c8e&&_0x5b3c8e[_0x1742('0x73')]&&_0x5b3c8e[_0x1742('0x73')]!==_0x1742('0x74')){logger['info'](_0x1742('0x75'),_0x1742('0x5c'));_0x42d07e[_0x1742('0x5d')]=util['format'](_0x1742('0x5e'),_0x6c4a0e['serverUrl'],_0x42d07e[_0x1742('0x5f')],md5(_0x42d07e[_0x1742('0x5f')]));}return getConnection(_0x6c4a0e)[_0x1742('0x2e')](function(_0x912718){_0x414693=_0x912718;return getUser(_0x6c4a0e,_0x256f4b[_0x1742('0x10')],_0x414693);})[_0x1742('0x2e')](function(_0x2de098){_0x4adcbd=_0x2de098;logger['info'](_0x1742('0x60'),_0x4adcbd['id']);return getEndUser(_0x6c4a0e,_0x42d07e[_0x1742('0x76')],_0x42d07e[_0x1742('0x77')],_0x414693);})[_0x1742('0x2e')](function(_0xa186fe){_0x55f7d7=_0xa186fe;logger[_0x1742('0xe')]('The\x20Enduser\x20ID\x20is:',_0x55f7d7['id']);return getTicket(_0x6c4a0e,_0x4adcbd,_0x55f7d7,_0x3f7e46,_0x42d07e,_0x3f7e46[_0x1742('0x64')],_0x414693,_0x1742('0x78'));})[_0x1742('0x2e')](function(_0x484b2d){_0x217c54=_0x484b2d;logger[_0x1742('0xe')](_0x1742('0x66'));logger[_0x1742('0xe')](_0x1742('0x67'),_0x217c54['id']);return setRelationship(_0x414693,_0x4adcbd,_0x217c54,_0x1742('0x68'));})['then'](function(){return setRelationship(_0x414693,_0x55f7d7,_0x217c54,_0x1742('0x69'));})[_0x1742('0x2e')](function(){return getServerInfo(_0x414693);})[_0x1742('0x2e')](function(_0x5efd8){var _0x30584e=parseInt(_0x5efd8['version'][_0x1742('0x6b')](0x0));var _0x175859=util[_0x1742('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x6c4a0e[_0x1742('0x56')],_0x217c54['id']);if(_0x30584e>0x6){_0x175859=util[_0x1742('0x25')](_0x1742('0x6d'),_0x6c4a0e[_0x1742('0x56')],_0x217c54['id']);}logger[_0x1742('0xe')]('[OUTBOUND]',_0x1742('0x6f'));emit(util[_0x1742('0x25')](_0x1742('0x70'),_0x256f4b[_0x1742('0x10')]),'trigger:browser:url',{'uri':_0x175859});})[_0x1742('0x79')](function(_0x22abc){logger['error'](_0x1742('0x75'),JSON[_0x1742('0x23')](_0x22abc));});};exports[_0x1742('0x7a')]=function(_0x2585bd,_0x503945,_0x3b0091,_0x849674,_0x150cad,_0x2a2a3d){var _0x50a8d2,_0x1525e0,_0x29d5a6,_0x3ad6f8;_0x2a2a3d['remoteUri']=intUtil['stripTrailingSlash'](_0x2a2a3d[_0x1742('0x56')]);_0x2a2a3d['serverUrl']=intUtil[_0x1742('0x57')](_0x2a2a3d[_0x1742('0x58')]);def[_0x1742('0x59')]=util[_0x1742('0x25')]('%s/service/v4_1/rest.php',_0x2a2a3d[_0x1742('0x56')]);if(_0x150cad&&_0x150cad[_0x1742('0x5b')]){logger['info']('['+_0x503945[_0x1742('0x7b')][_0x1742('0x7c')]()+']',_0x1742('0x5c'));_0x503945[_0x1742('0x5d')]=util[_0x1742('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a2a3d[_0x1742('0x58')],_0x503945[_0x1742('0x5f')],md5(_0x503945[_0x1742('0x5f')]));}else{_0x503945[_0x1742('0x5d')]='';}return getConnection(_0x2a2a3d)[_0x1742('0x2e')](function(_0x7c5b5b){_0x3ad6f8=_0x7c5b5b;if(!_[_0x1742('0x29')](_0x849674)){return getUser(_0x2a2a3d,_0x849674[_0x1742('0x10')],_0x3ad6f8);}else{return getUser(_0x2a2a3d,null,_0x3ad6f8);}})[_0x1742('0x2e')](function(_0x9f36bc){_0x50a8d2=_0x9f36bc;logger[_0x1742('0xe')](_0x1742('0x60'),_0x50a8d2['id']);return getEndUser(_0x2a2a3d,_0x503945['calleridname'],_0x503945[_0x1742('0x62')],_0x3ad6f8);})[_0x1742('0x2e')](function(_0x4ae9e4){_0x1525e0=_0x4ae9e4;logger[_0x1742('0xe')](_0x1742('0x63'),_0x1525e0['id']);return getTicket(_0x2a2a3d,_0x50a8d2,_0x1525e0,_0x3b0091,_0x503945,_0x3b0091[_0x1742('0x64')],_0x3ad6f8,_0x1742('0x65'));})[_0x1742('0x2e')](function(_0x25222d){_0x29d5a6=_0x25222d;logger[_0x1742('0xe')](_0x1742('0x66'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x29d5a6['id']);return setRelationship(_0x3ad6f8,_0x50a8d2,_0x29d5a6,_0x1742('0x68'));})[_0x1742('0x2e')](function(){return setRelationship(_0x3ad6f8,_0x1525e0,_0x29d5a6,_0x1742('0x69'));})[_0x1742('0x2e')](function(){return getServerInfo(_0x3ad6f8);})[_0x1742('0x79')](function(_0x3e277f){logger[_0x1742('0x7d')]('['+_0x503945[_0x1742('0x7b')][_0x1742('0x7c')]()+']',JSON[_0x1742('0x23')](_0x3e277f));});}; \ No newline at end of file +var _0xcf28=['customField','toLowerCase','content','variable','custom_fields','customVariable','Variable','login','password','PLAIN','sessionID','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','charAt','[OUTBOUND]','user:%s','unmanaged','lastevent','toUpperCase','isNil','Ticket\x20created!','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','variableName','push','idField','set_entry','JSON','stringify','apiKey','toString','base64','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','then','entry_list','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','first_name','[HTTP]','map','forEach','type'];(function(_0x1d6b32,_0x6efa18){var _0x43099d=function(_0x3f2e85){while(--_0x3f2e85){_0x1d6b32['push'](_0x1d6b32['shift']());}};_0x43099d(++_0x6efa18);}(_0xcf28,0xa9));var _0x8cf2=function(_0x30e7ca,_0x1135e2){_0x30e7ca=_0x30e7ca-0x0;var _0x1a65ec=_0xcf28[_0x30e7ca];return _0x1a65ec;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x8cf2('0x0'));var md5=require(_0x8cf2('0x1'));var util=require(_0x8cf2('0x2'));var Redis=require('ioredis');var intUtil=require(_0x8cf2('0x3'));var config=require(_0x8cf2('0x4'));var logger=require(_0x8cf2('0x5'))('sugarcrm');config[_0x8cf2('0x6')]=_[_0x8cf2('0x7')](config[_0x8cf2('0x6')],{'host':_0x8cf2('0x8'),'port':0x18eb});var io=require(_0x8cf2('0x9'))(new Redis(config['redis']));var def={'method':_0x8cf2('0xa'),'json':!![]};function emit(_0x3a2922,_0x34f939,_0x395501){io['to'](_0x3a2922)['emit'](_0x34f939,_0x395501);}function getTicket(_0x4e3fe4,_0x478303,_0x54da7c,_0x502738,_0x2136ac,_0x546cf7,_0x20ee9a,_0x16aebe){logger[_0x8cf2('0xb')](_0x8cf2('0xc'));var _0x6d20b2=new Date();var _0x5b6bbd=[{'name':_0x8cf2('0xd'),'value':intUtil[_0x8cf2('0xe')](_0x502738[_0x8cf2('0xf')],_0x2136ac,'\x20')},{'name':_0x8cf2('0x10'),'value':_0x478303['id']},{'name':'created_by','value':_0x478303['id']},{'name':_0x8cf2('0x11'),'value':intUtil[_0x8cf2('0xe')](_0x502738[_0x8cf2('0x12')],_0x2136ac,'\x0a')},{'name':'date_start','value':_0x6d20b2['toISOString']()[_0x8cf2('0x13')](0x0,0x13)[_0x8cf2('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x8cf2('0x15'),'value':'15'},{'name':_0x8cf2('0x16'),'value':_0x54da7c['id']},{'name':_0x8cf2('0x17'),'value':_0x8cf2('0x18')},{'name':_0x8cf2('0x19'),'value':_0x54da7c['name']},{'name':'direction','value':_0x16aebe}];if(_0x546cf7[_0x8cf2('0x1a')]){_['forEach'](_0x546cf7,function(_0x2d5feb){if(_0x2136ac[_0x2d5feb[_0x8cf2('0x1b')]]){_0x5b6bbd[_0x8cf2('0x1c')]({'name':_0x2d5feb[_0x8cf2('0x1d')],'value':_0x2136ac[_0x2d5feb[_0x8cf2('0x1b')]]});}});}return request({'form':{'method':_0x8cf2('0x1e'),'input_type':'JSON','response_type':_0x8cf2('0x1f'),'rest_data':JSON[_0x8cf2('0x20')]({'session':_0x20ee9a['id'],'module_name':'Calls','name_value_list':_0x5b6bbd})}});}function getAuth(_0x1dc00d){return util['format']('Basic\x20%s',new Buffer(_0x1dc00d[_0x8cf2('0x21')]+':X')[_0x8cf2('0x22')](_0x8cf2('0x23')));}function getServerInfo(_0x590311){return request({'form':{'method':'get_server_info','input_type':_0x8cf2('0x1f'),'response_type':_0x8cf2('0x1f'),'rest_data':JSON['stringify']({'session':_0x590311['id']})}});}function getUser(_0x4536dc,_0x516f69,_0x58a76f){if(!_['isNil'](_0x516f69)){logger['info'](_0x8cf2('0x24'),_0x516f69);return request({'form':{'method':_0x8cf2('0x25'),'input_type':_0x8cf2('0x1f'),'response_type':_0x8cf2('0x1f'),'rest_data':JSON['stringify']({'session':_0x58a76f['id'],'module_name':_0x8cf2('0x26'),'query':util[_0x8cf2('0x27')](_0x8cf2('0x28'),_0x516f69),'order_by':'','offset':'0','select_fields':['id',_0x8cf2('0xd'),_0x8cf2('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5ed4d0){if(_0x5ed4d0['entry_list'][_0x8cf2('0x1a')]){var _0x2218de=_[_0x8cf2('0x2a')](_0x5ed4d0['entry_list'],function(_0x5676b9){return _0x5676b9[_0x8cf2('0x2b')][_0x8cf2('0x29')][_0x8cf2('0x2c')]===_0x516f69;});if(_0x2218de){logger[_0x8cf2('0xb')]('Agent\x20found!');return BPromise[_0x8cf2('0x2d')]({'id':_0x2218de['name_value_list']['id'][_0x8cf2('0x2c')],'name':_0x2218de['name_value_list'][_0x8cf2('0xd')][_0x8cf2('0x2c')]});}}logger['info'](_0x8cf2('0x2e'));return BPromise[_0x8cf2('0x2d')]({'id':_0x58a76f[_0x8cf2('0x2b')]['user_id'][_0x8cf2('0x2c')],'name':_0x58a76f['name_value_list'][_0x8cf2('0x29')][_0x8cf2('0x2c')]});});}else{logger[_0x8cf2('0xb')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x58a76f[_0x8cf2('0x2b')]['user_id']['value'],'name':_0x58a76f[_0x8cf2('0x2b')][_0x8cf2('0x29')][_0x8cf2('0x2c')]});}}function getEndUser(_0x4d8857,_0xfc95b7,_0xf1bdd2,_0x12e2a3){logger[_0x8cf2('0xb')](_0x8cf2('0x2f'),_0xf1bdd2);return request({'form':{'method':'get_entry_list','input_type':_0x8cf2('0x1f'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x12e2a3['id'],'module_name':_0x8cf2('0x18'),'query':util[_0x8cf2('0x27')](_0x8cf2('0x30'),_0xf1bdd2),'order_by':'','offset':'0','select_fields':['id',_0x8cf2('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8cf2('0x31')](function(_0x28dc40){if(_0x28dc40[_0x8cf2('0x32')]['length']){var _0x3cacae=_[_0x8cf2('0x2a')](_0x28dc40[_0x8cf2('0x32')],function(_0x5564f1){return _0x5564f1['name_value_list'][_0x8cf2('0x33')][_0x8cf2('0x2c')]===_0xf1bdd2;});if(_0x3cacae){logger[_0x8cf2('0xb')](_0x8cf2('0x34'));return BPromise[_0x8cf2('0x2d')]({'id':_0x3cacae[_0x8cf2('0x2b')]['id'][_0x8cf2('0x2c')],'name':_0x3cacae['name_value_list'][_0x8cf2('0xd')]['value'],'phone':_0x3cacae[_0x8cf2('0x2b')]['phone_home'][_0x8cf2('0x2c')]});}}else{logger[_0x8cf2('0xb')](_0x8cf2('0x35'));return request({'form':{'method':_0x8cf2('0x1e'),'input_type':_0x8cf2('0x1f'),'response_type':_0x8cf2('0x1f'),'rest_data':JSON[_0x8cf2('0x20')]({'session':_0x12e2a3['id'],'module_name':_0x8cf2('0x18'),'name_value_list':[{'name':'first_name','value':_0xfc95b7!==_0x8cf2('0x36')?_0xfc95b7:util[_0x8cf2('0x27')](_0x8cf2('0x37'),_0xf1bdd2)},{'name':_0x8cf2('0x33'),'value':_0xf1bdd2}]})}})['then'](function(_0x527c6f){logger['info']('Enduser\x20created.');return BPromise['resolve']({'id':_0x527c6f['id'],'name':_0x527c6f[_0x8cf2('0x32')][_0x8cf2('0x38')][_0x8cf2('0x2c')],'phone':_0x527c6f['entry_list'][_0x8cf2('0x33')][_0x8cf2('0x2c')]});});}});}function request(_0x4a19b4){logger['debug'](_0x8cf2('0x39'),JSON[_0x8cf2('0x20')](_0x4a19b4));return rp(_['merge'](def,_0x4a19b4));}function getTags(_0x451bc3,_0x174e82){var _0x8e05f4=[];if(_0x451bc3&&_0x451bc3['length']>0x0){_0x8e05f4=_[_0x8cf2('0x3a')](_0x451bc3,_0x174e82);}return _0x8e05f4;}function getCustomFields(_0x5eb95c,_0x5b5aed){var _0x588602=[];var _0x429cbd={'custom_fields':[]};if(_0x5eb95c[_0x8cf2('0x1a')]>0x0){_[_0x8cf2('0x3b')](_0x5eb95c,function(_0x483d98){if(_0x483d98[_0x8cf2('0x3c')]==='string'&&_0x483d98['nameField']&&!_0x483d98[_0x8cf2('0x3d')]){_0x429cbd[_0x483d98['nameField'][_0x8cf2('0x3e')]()]=_0x483d98[_0x8cf2('0x3f')][_0x8cf2('0x22')]();}else if(_0x483d98[_0x8cf2('0x3c')]==='string'&&_0x483d98[_0x8cf2('0x1d')]&&_0x483d98[_0x8cf2('0x3d')]){_0x429cbd['custom_fields'][_0x8cf2('0x1c')]({'id':_0x483d98['idField'],'value':_0x483d98[_0x8cf2('0x3f')][_0x8cf2('0x22')]()});}else if(_0x483d98[_0x8cf2('0x3c')]===_0x8cf2('0x40')&&_0x483d98[_0x8cf2('0x1b')]&&_0x483d98[_0x8cf2('0x1d')]&&_0x483d98[_0x8cf2('0x3d')]){_0x5b5aed[_0x483d98['variableName']]&&_0x429cbd[_0x8cf2('0x41')][_0x8cf2('0x1c')]({'id':_0x483d98['idField'],'value':_0x5b5aed[_0x483d98['variableName']][_0x8cf2('0x22')]()});}else if(_0x483d98[_0x8cf2('0x3c')]===_0x8cf2('0x42')&&_0x483d98['Variable']&&_0x483d98[_0x8cf2('0x43')][_0x8cf2('0xd')]&&_0x483d98[_0x8cf2('0x1d')]&&_0x483d98[_0x8cf2('0x3d')]){_0x5b5aed[_0x483d98[_0x8cf2('0x43')][_0x8cf2('0xd')]['toLowerCase']()]&&_0x429cbd[_0x8cf2('0x41')][_0x8cf2('0x1c')]({'id':_0x483d98[_0x8cf2('0x1d')],'value':_0x5b5aed[_0x483d98[_0x8cf2('0x43')][_0x8cf2('0xd')][_0x8cf2('0x3e')]()][_0x8cf2('0x22')]()});}});}return _0x429cbd;}function getConnection(_0xbb2097){return request({'method':_0x8cf2('0xa'),'form':{'method':_0x8cf2('0x44'),'input_type':'JSON','response_type':_0x8cf2('0x1f'),'rest_data':JSON[_0x8cf2('0x20')]({'user_auth':{'user_name':_0xbb2097['username'],'password':_0xbb2097[_0x8cf2('0x45')],'encryption':_0x8cf2('0x46')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x8cf2('0x31')](function(_0x40c4f1){var _0xe0482e=_0x40c4f1;if(_0xe0482e['id']){def[_0x8cf2('0x47')]=_0xe0482e['id'];return BPromise[_0x8cf2('0x2d')](_0xe0482e);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0xbb2097['id']));}});}function setRelationship(_0x3a5b8d,_0x405247,_0x1f46f5,_0x42cd8a){return request({'form':{'method':_0x8cf2('0x48'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8cf2('0x20')]({'session':_0x3a5b8d['id'],'module_name':_0x8cf2('0x49'),'module_id':_0x1f46f5['id'],'link_field_name':_0x42cd8a,'related_ids':[_0x405247['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x8cf2('0x4a')]=function(_0x49876c,_0x1ef049,_0x5b39cf,_0x2fe5e9,_0x2b5574,_0x4ae1ed){var _0x46ba7b,_0x237d6b,_0x12c740,_0x3edbd5;_0x4ae1ed[_0x8cf2('0x4b')]=intUtil['stripTrailingSlash'](_0x4ae1ed[_0x8cf2('0x4b')]);_0x4ae1ed[_0x8cf2('0x4c')]=intUtil[_0x8cf2('0x4d')](_0x4ae1ed[_0x8cf2('0x4c')]);def[_0x8cf2('0x4e')]=util[_0x8cf2('0x27')](_0x8cf2('0x4f'),_0x4ae1ed[_0x8cf2('0x4b')]);if(_0x2b5574&&_0x2b5574[_0x8cf2('0x50')]){logger[_0x8cf2('0xb')](_0x8cf2('0x51'),_0x8cf2('0x52'));_0x1ef049[_0x8cf2('0x53')]=util[_0x8cf2('0x27')](_0x8cf2('0x54'),_0x4ae1ed['serverUrl'],_0x1ef049[_0x8cf2('0x55')],md5(_0x1ef049[_0x8cf2('0x55')]));}else{_0x1ef049[_0x8cf2('0x53')]='';}return getConnection(_0x4ae1ed)[_0x8cf2('0x31')](function(_0x57cdab){_0x3edbd5=_0x57cdab;return getUser(_0x4ae1ed,_0x2fe5e9[_0x8cf2('0xd')],_0x3edbd5);})[_0x8cf2('0x31')](function(_0x3506ec){_0x46ba7b=_0x3506ec;logger[_0x8cf2('0xb')](_0x8cf2('0x56'),_0x46ba7b['id']);return getEndUser(_0x4ae1ed,_0x1ef049[_0x8cf2('0x57')],_0x1ef049[_0x8cf2('0x58')],_0x3edbd5);})[_0x8cf2('0x31')](function(_0x3d70ce){_0x237d6b=_0x3d70ce;logger[_0x8cf2('0xb')](_0x8cf2('0x59'),_0x237d6b['id']);return getTicket(_0x4ae1ed,_0x46ba7b,_0x237d6b,_0x5b39cf,_0x1ef049,_0x5b39cf[_0x8cf2('0x5a')],_0x3edbd5,_0x8cf2('0x5b'));})['then'](function(_0x9eaba){_0x12c740=_0x9eaba;logger['info']('Ticket\x20created!');logger[_0x8cf2('0xb')]('The\x20Ticket\x20ID\x20is:',_0x12c740['id']);return setRelationship(_0x3edbd5,_0x46ba7b,_0x12c740,_0x8cf2('0x5c'));})['then'](function(){return setRelationship(_0x3edbd5,_0x237d6b,_0x12c740,_0x8cf2('0x5d'));})[_0x8cf2('0x31')](function(){return getServerInfo(_0x3edbd5);})['then'](function(_0x190c35){var _0xb23e48=parseInt(_0x190c35[_0x8cf2('0x5e')]['charAt'](0x0));var _0x273f71=util['format'](_0x8cf2('0x5f'),_0x4ae1ed[_0x8cf2('0x4b')],_0x12c740['id']);if(_0xb23e48>0x6){_0x273f71=util[_0x8cf2('0x27')](_0x8cf2('0x60'),_0x4ae1ed['remoteUri'],_0x12c740['id']);}logger[_0x8cf2('0xb')]('[QUEUE]',_0x8cf2('0x61'));emit(util[_0x8cf2('0x27')]('user:%s',_0x2fe5e9[_0x8cf2('0xd')]),_0x8cf2('0x62'),{'uri':_0x273f71});})[_0x8cf2('0x63')](function(_0x29e734){logger[_0x8cf2('0x64')](_0x8cf2('0x51'),JSON[_0x8cf2('0x20')](_0x29e734));});};exports['outbound']=function(_0x34faf4,_0x255e91,_0x4b1f12,_0xc93376,_0x2b83fe,_0x42f575,_0x186eb5){var _0x489c98,_0x335b42,_0x3866f6,_0x351c42;_0x42f575[_0x8cf2('0x4b')]=intUtil['stripTrailingSlash'](_0x42f575[_0x8cf2('0x4b')]);_0x42f575[_0x8cf2('0x4c')]=intUtil[_0x8cf2('0x4d')](_0x42f575[_0x8cf2('0x4c')]);def[_0x8cf2('0x4e')]=util[_0x8cf2('0x27')](_0x8cf2('0x4f'),_0x42f575[_0x8cf2('0x4b')]);if(_0x186eb5&&_0x186eb5[_0x8cf2('0x65')]&&_0x186eb5[_0x8cf2('0x65')]!==_0x8cf2('0x66')){logger[_0x8cf2('0xb')]('[OUTBOUND]',_0x8cf2('0x52'));_0x255e91[_0x8cf2('0x53')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42f575[_0x8cf2('0x4c')],_0x255e91[_0x8cf2('0x55')],md5(_0x255e91[_0x8cf2('0x55')]));}return getConnection(_0x42f575)[_0x8cf2('0x31')](function(_0x831338){_0x351c42=_0x831338;return getUser(_0x42f575,_0xc93376[_0x8cf2('0xd')],_0x351c42);})[_0x8cf2('0x31')](function(_0x5cfd69){_0x489c98=_0x5cfd69;logger[_0x8cf2('0xb')](_0x8cf2('0x56'),_0x489c98['id']);return getEndUser(_0x42f575,_0x255e91[_0x8cf2('0x67')],_0x255e91[_0x8cf2('0x68')],_0x351c42);})['then'](function(_0x49ce67){_0x335b42=_0x49ce67;logger[_0x8cf2('0xb')](_0x8cf2('0x59'),_0x335b42['id']);return getTicket(_0x42f575,_0x489c98,_0x335b42,_0x4b1f12,_0x255e91,_0x4b1f12['Fields'],_0x351c42,_0x8cf2('0x69'));})[_0x8cf2('0x31')](function(_0x12d842){_0x3866f6=_0x12d842;logger[_0x8cf2('0xb')]('Ticket\x20created!');logger[_0x8cf2('0xb')](_0x8cf2('0x6a'),_0x3866f6['id']);return setRelationship(_0x351c42,_0x489c98,_0x3866f6,'users');})['then'](function(){return setRelationship(_0x351c42,_0x335b42,_0x3866f6,_0x8cf2('0x5d'));})[_0x8cf2('0x31')](function(){return getServerInfo(_0x351c42);})['then'](function(_0x482257){var _0x266b62=parseInt(_0x482257[_0x8cf2('0x5e')][_0x8cf2('0x6b')](0x0));var _0x33d3ac=util['format'](_0x8cf2('0x5f'),_0x42f575['remoteUri'],_0x3866f6['id']);if(_0x266b62>0x6){_0x33d3ac=util['format'](_0x8cf2('0x60'),_0x42f575['remoteUri'],_0x3866f6['id']);}logger[_0x8cf2('0xb')](_0x8cf2('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8cf2('0x27')](_0x8cf2('0x6d'),_0xc93376[_0x8cf2('0xd')]),_0x8cf2('0x62'),{'uri':_0x33d3ac});})['catch'](function(_0xfc1dc8){logger[_0x8cf2('0x64')]('[OUTBOUND]',JSON[_0x8cf2('0x20')](_0xfc1dc8));});};exports[_0x8cf2('0x6e')]=function(_0x509c32,_0x46f4c3,_0x25f942,_0x36de80,_0x49c256,_0x402abf){var _0x5f13c2,_0x37be3c,_0x590e35,_0x45fcf7;_0x402abf[_0x8cf2('0x4b')]=intUtil[_0x8cf2('0x4d')](_0x402abf[_0x8cf2('0x4b')]);_0x402abf[_0x8cf2('0x4c')]=intUtil['stripTrailingSlash'](_0x402abf[_0x8cf2('0x4c')]);def['uri']=util[_0x8cf2('0x27')](_0x8cf2('0x4f'),_0x402abf[_0x8cf2('0x4b')]);if(_0x49c256&&_0x49c256[_0x8cf2('0x50')]){logger[_0x8cf2('0xb')]('['+_0x46f4c3[_0x8cf2('0x6f')][_0x8cf2('0x70')]()+']',_0x8cf2('0x52'));_0x46f4c3[_0x8cf2('0x53')]=util[_0x8cf2('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x402abf[_0x8cf2('0x4c')],_0x46f4c3[_0x8cf2('0x55')],md5(_0x46f4c3[_0x8cf2('0x55')]));}else{_0x46f4c3[_0x8cf2('0x53')]='';}return getConnection(_0x402abf)[_0x8cf2('0x31')](function(_0x2e3663){_0x45fcf7=_0x2e3663;if(!_[_0x8cf2('0x71')](_0x36de80)){return getUser(_0x402abf,_0x36de80[_0x8cf2('0xd')],_0x45fcf7);}else{return getUser(_0x402abf,null,_0x45fcf7);}})[_0x8cf2('0x31')](function(_0x5ca112){_0x5f13c2=_0x5ca112;logger[_0x8cf2('0xb')](_0x8cf2('0x56'),_0x5f13c2['id']);return getEndUser(_0x402abf,_0x46f4c3[_0x8cf2('0x57')],_0x46f4c3[_0x8cf2('0x58')],_0x45fcf7);})['then'](function(_0x391f3b){_0x37be3c=_0x391f3b;logger[_0x8cf2('0xb')](_0x8cf2('0x59'),_0x37be3c['id']);return getTicket(_0x402abf,_0x5f13c2,_0x37be3c,_0x25f942,_0x46f4c3,_0x25f942[_0x8cf2('0x5a')],_0x45fcf7,'Inbound');})[_0x8cf2('0x31')](function(_0x3ea00d){_0x590e35=_0x3ea00d;logger[_0x8cf2('0xb')](_0x8cf2('0x72'));logger['info'](_0x8cf2('0x6a'),_0x590e35['id']);return setRelationship(_0x45fcf7,_0x5f13c2,_0x590e35,'users');})[_0x8cf2('0x31')](function(){return setRelationship(_0x45fcf7,_0x37be3c,_0x590e35,_0x8cf2('0x5d'));})['then'](function(){return getServerInfo(_0x45fcf7);})[_0x8cf2('0x63')](function(_0x355d61){logger[_0x8cf2('0x64')]('['+_0x46f4c3[_0x8cf2('0x6f')][_0x8cf2('0x70')]()+']',JSON[_0x8cf2('0x20')](_0x355d61));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index 69b1ac6..f249634 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 _0x34b9=['push','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','keyContent','%s:\x20%s','format','join','stripTrailingSlash','slice','substring','lastIndexOf','test','getString','length','sortBy','type','string','content','variable','variableName'];(function(_0x34d012,_0x4bb7bc){var _0x2aaaef=function(_0x199c78){while(--_0x199c78){_0x34d012['push'](_0x34d012['shift']());}};_0x2aaaef(++_0x4bb7bc);}(_0x34b9,0x1b2));var _0x934b=function(_0x3c1045,_0xe39ccb){_0x3c1045=_0x3c1045-0x0;var _0x23a897=_0x34b9[_0x3c1045];return _0x23a897;};'use strict';var _=require('lodash');var util=require('util');exports[_0x934b('0x0')]=function(_0xd708e9,_0xf646b9,_0x35f001){var _0x420cbb=[];if(_0xd708e9[_0x934b('0x1')]>0x0){var _0x193827=_[_0x934b('0x2')](_0xd708e9,['id']);for(var _0x2abd86=0x0;_0x2abd86<_0x193827[_0x934b('0x1')];_0x2abd86++){var _0x1820cd=_0x193827[_0x2abd86];if(_0x1820cd[_0x934b('0x3')]===_0x934b('0x4')){_0x420cbb['push'](_0x1820cd[_0x934b('0x5')]);}else if(_0x1820cd['type']===_0x934b('0x6')&&_0x1820cd[_0x934b('0x7')]){_0xf646b9[_0x1820cd[_0x934b('0x7')]]&&_0x420cbb[_0x934b('0x8')](_0xf646b9[_0x1820cd[_0x934b('0x7')]]['toString']());}else if(_0x1820cd[_0x934b('0x3')]===_0x934b('0x9')&&_0x1820cd['Variable']&&_0x1820cd[_0x934b('0xa')][_0x934b('0xb')]){_0xf646b9[_0x1820cd[_0x934b('0xa')][_0x934b('0xb')][_0x934b('0xc')]()]&&_0x420cbb[_0x934b('0x8')](_0xf646b9[_0x1820cd[_0x934b('0xa')][_0x934b('0xb')][_0x934b('0xc')]()][_0x934b('0xd')]());}else if(_0x1820cd['type']===_0x934b('0xe')){if(_0x1820cd[_0x934b('0xf')]===_0x934b('0x4')&&_0x1820cd['key']){_0x420cbb[_0x934b('0x8')](util['format']('%s:\x20%s',_0x1820cd[_0x934b('0x10')],_0x1820cd[_0x934b('0x11')]));}else if(_0x1820cd[_0x934b('0xf')]==='variable'&&_0x1820cd[_0x934b('0x7')]&&_0x1820cd[_0x934b('0x10')]){_0xf646b9[_0x1820cd[_0x934b('0x7')]]&&_0x420cbb[_0x934b('0x8')](util['format'](_0x934b('0x12'),_0x1820cd[_0x934b('0x10')],_0xf646b9[_0x1820cd[_0x934b('0x7')]]));}else if(_0x1820cd[_0x934b('0xf')]===_0x934b('0x9')&&_0x1820cd[_0x934b('0xa')]&&_0x1820cd[_0x934b('0xa')][_0x934b('0xb')]&&_0x1820cd[_0x934b('0x10')]){_0xf646b9[_0x1820cd['Variable']['name'][_0x934b('0xc')]()]&&_0x420cbb[_0x934b('0x8')](util[_0x934b('0x13')](_0x934b('0x12'),_0x1820cd[_0x934b('0x10')],_0xf646b9[_0x1820cd['Variable'][_0x934b('0xb')]['toLowerCase']()]));}}}}return _0x420cbb[_0x934b('0x14')](_0x35f001);};exports[_0x934b('0x15')]=function(_0x171550){var _0xfa133b=_0x171550[_0x934b('0x16')](-0x1);if(_0xfa133b==='/'){_0x171550=_0x171550[_0x934b('0x17')](0x0,_0x171550[_0x934b('0x18')](_0xfa133b));}return _0x171550;};exports['validateEmail']=function(_0x2f4b0e){if(!_['isNil'](_0x2f4b0e)&&_0x2f4b0e!==''){var _0x549b9b=/^(([^<>()\[\]\\.,;:\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 _0x549b9b[_0x934b('0x19')](String(_0x2f4b0e)[_0x934b('0xc')]());}else{return![];}}; \ No newline at end of file +var _0x1215=['name','keyValue','keyType','key','format','%s:\x20%s','customVariable','toLowerCase','join','stripTrailingSlash','substring','validateEmail','lodash','getString','sortBy','length','string','content','type','variable','variableName','push','toString','Variable'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x1215,0x84));var _0x5121=function(_0x23832b,_0x6a777){_0x23832b=_0x23832b-0x0;var _0x583750=_0x1215[_0x23832b];return _0x583750;};'use strict';var _=require(_0x5121('0x0'));var util=require('util');exports[_0x5121('0x1')]=function(_0x3bbe50,_0x10d85a,_0x3a5e05){var _0x4b9be2=[];if(_0x3bbe50['length']>0x0){var _0x1e4069=_[_0x5121('0x2')](_0x3bbe50,['id']);for(var _0x512028=0x0;_0x512028<_0x1e4069[_0x5121('0x3')];_0x512028++){var _0x15b11c=_0x1e4069[_0x512028];if(_0x15b11c['type']===_0x5121('0x4')){_0x4b9be2['push'](_0x15b11c[_0x5121('0x5')]);}else if(_0x15b11c[_0x5121('0x6')]===_0x5121('0x7')&&_0x15b11c[_0x5121('0x8')]){_0x10d85a[_0x15b11c[_0x5121('0x8')]]&&_0x4b9be2[_0x5121('0x9')](_0x10d85a[_0x15b11c[_0x5121('0x8')]][_0x5121('0xa')]());}else if(_0x15b11c[_0x5121('0x6')]==='customVariable'&&_0x15b11c[_0x5121('0xb')]&&_0x15b11c['Variable'][_0x5121('0xc')]){_0x10d85a[_0x15b11c['Variable']['name']['toLowerCase']()]&&_0x4b9be2[_0x5121('0x9')](_0x10d85a[_0x15b11c[_0x5121('0xb')][_0x5121('0xc')]['toLowerCase']()][_0x5121('0xa')]());}else if(_0x15b11c['type']===_0x5121('0xd')){if(_0x15b11c[_0x5121('0xe')]==='string'&&_0x15b11c[_0x5121('0xf')]){_0x4b9be2['push'](util[_0x5121('0x10')](_0x5121('0x11'),_0x15b11c['key'],_0x15b11c['keyContent']));}else if(_0x15b11c[_0x5121('0xe')]==='variable'&&_0x15b11c[_0x5121('0x8')]&&_0x15b11c[_0x5121('0xf')]){_0x10d85a[_0x15b11c[_0x5121('0x8')]]&&_0x4b9be2[_0x5121('0x9')](util[_0x5121('0x10')]('%s:\x20%s',_0x15b11c[_0x5121('0xf')],_0x10d85a[_0x15b11c[_0x5121('0x8')]]));}else if(_0x15b11c[_0x5121('0xe')]===_0x5121('0x12')&&_0x15b11c[_0x5121('0xb')]&&_0x15b11c[_0x5121('0xb')][_0x5121('0xc')]&&_0x15b11c['key']){_0x10d85a[_0x15b11c[_0x5121('0xb')][_0x5121('0xc')][_0x5121('0x13')]()]&&_0x4b9be2[_0x5121('0x9')](util[_0x5121('0x10')](_0x5121('0x11'),_0x15b11c[_0x5121('0xf')],_0x10d85a[_0x15b11c[_0x5121('0xb')]['name']['toLowerCase']()]));}}}}return _0x4b9be2[_0x5121('0x14')](_0x3a5e05);};exports[_0x5121('0x15')]=function(_0x1ab4b6){var _0x3a05d0=_0x1ab4b6['slice'](-0x1);if(_0x3a05d0==='/'){_0x1ab4b6=_0x1ab4b6[_0x5121('0x16')](0x0,_0x1ab4b6['lastIndexOf'](_0x3a05d0));}return _0x1ab4b6;};exports[_0x5121('0x17')]=function(_0xae6c60){if(!_['isNil'](_0xae6c60)&&_0xae6c60!==''){var _0x4d4864=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x4d4864['test'](String(_0xae6c60)[_0x5121('0x13')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index b759689..be71ac0 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(_0x19d73b,_0x4faf4f){var _0x551496=function(_0x646799){while(--_0x646799){_0x19d73b['push'](_0x19d73b['shift']());}};_0x551496(++_0x4faf4f);}(_0x34e8,0x12c));var _0x834e=function(_0x4eca73,_0x4fa9a0){_0x4eca73=_0x4eca73-0x0;var _0x4ed3cc=_0x34e8[_0x4eca73];return _0x4ed3cc;};'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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x29e7eb,_0x31eafb){var _0x3815f1=function(_0x1b39a1){while(--_0x1b39a1){_0x29e7eb['push'](_0x29e7eb['shift']());}};_0x3815f1(++_0x31eafb);}(_0xe706,0xa3));var _0x6e70=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xe706[_0x312abc];return _0x314298;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 7b8bea1..0e7be1f 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 _0xe8b5=['Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','Subjects','getString','Descriptions','Fields','then','Ticket\x20created!','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable','variableName','customVariable'];(function(_0x25f4c1,_0x44497e){var _0x282b09=function(_0x4dc45a){while(--_0x4dc45a){_0x25f4c1['push'](_0x25f4c1['shift']());}};_0x282b09(++_0x44497e);}(_0xe8b5,0x109));var _0x5e8b=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0xe8b5[_0x4bd67a];return _0x2be5fb;};'use strict';var _=require(_0x5e8b('0x0'));var rp=require('request-promise');var md5=require(_0x5e8b('0x1'));var util=require(_0x5e8b('0x2'));var Redis=require(_0x5e8b('0x3'));var intUtil=require(_0x5e8b('0x4'));var config=require(_0x5e8b('0x5'));var logger=require(_0x5e8b('0x6'))('zendesk');config['redis']=_[_0x5e8b('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5e8b('0x8'))(new Redis(config['redis']));function emit(_0x28defc,_0x27418d,_0xa0aa4d){io['to'](_0x28defc)[_0x5e8b('0x9')](_0x27418d,_0xa0aa4d);}var headers={'Content-Type':_0x5e8b('0xa'),'Accept':'application/json'};function getTicket(_0x13da07,_0x3ef0da,_0x1f244b,_0xe245a8,_0x3dd25c){logger[_0x5e8b('0xb')](_0x5e8b('0xc'));return request({'uri':util[_0x5e8b('0xd')](_0x5e8b('0xe'),_0x13da07[_0x5e8b('0xf')]),'method':_0x5e8b('0x10'),'body':{'ticket':_[_0x5e8b('0x11')]({'requester_id':_0x1f244b['id'],'submitter_id':_0x3ef0da?_0x3ef0da['id']:undefined,'assignee_id':_0x3ef0da?_0x3ef0da['id']:undefined,'tags':getTags(_0xe245a8[_0x5e8b('0x12')],'name'),'subject':intUtil['getString'](_0xe245a8[_0x5e8b('0x13')],_0x3dd25c,'\x20'),'description':intUtil[_0x5e8b('0x14')](_0xe245a8[_0x5e8b('0x15')],_0x3dd25c,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5e8b('0x14')](_0xe245a8['Descriptions'],_0x3dd25c,'\x0a')}},getCustomFields(_0xe245a8[_0x5e8b('0x16')],_0x3dd25c))}})[_0x5e8b('0x17')](function(_0x648fbe){logger[_0x5e8b('0xb')](_0x5e8b('0x18'));return _0x648fbe['ticket'];});}function getUser(_0x5cbca7,_0x504127){if(intUtil['validateEmail'](_0x504127)){logger['info'](_0x5e8b('0x19'),_0x504127);return request({'uri':util[_0x5e8b('0xd')](_0x5e8b('0x1a'),_0x5cbca7[_0x5e8b('0xf')]),'qs':{'query':util[_0x5e8b('0xd')](_0x5e8b('0x1b'),_0x504127)}})['then'](function(_0x3c3ceb){if(_0x3c3ceb[_0x5e8b('0x1c')]){logger[_0x5e8b('0xb')](_0x5e8b('0x1d'));return _['find'](_0x3c3ceb[_0x5e8b('0x1e')],{'email':_0x504127,'role':_0x5e8b('0x1f')});}else{logger[_0x5e8b('0xb')](_0x5e8b('0x20'));return request({'uri':util[_0x5e8b('0xd')](_0x5e8b('0x21'),_0x5cbca7[_0x5e8b('0xf')])})[_0x5e8b('0x17')](function(_0x25abca){logger['info']('Admin\x20account\x20selected.');return _0x25abca['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5e8b('0xd')](_0x5e8b('0x21'),_0x5cbca7[_0x5e8b('0xf')])})[_0x5e8b('0x17')](function(_0xb5ed97){logger[_0x5e8b('0xb')](_0x5e8b('0x22'));return _0xb5ed97[_0x5e8b('0x23')];});}}function getEndUser(_0x21b0a5,_0x105532,_0x365f35){logger['info'](_0x5e8b('0x24'),_0x365f35);return request({'uri':util[_0x5e8b('0xd')]('%s/search.json',_0x21b0a5[_0x5e8b('0xf')]),'qs':{'query':util[_0x5e8b('0xd')](_0x5e8b('0x25'),_0x365f35)}})[_0x5e8b('0x17')](function(_0x5bb851){var _0x3f3ba0;if(_0x5bb851['results'][_0x5e8b('0x26')]){_0x5bb851[_0x5e8b('0x1e')]=_[_0x5e8b('0x27')](_0x5bb851[_0x5e8b('0x1e')],{'suspended':![],'role':_0x5e8b('0x28')});if(_0x5bb851[_0x5e8b('0x1e')][_0x5e8b('0x26')]){_0x3f3ba0=_['first'](_0x5bb851[_0x5e8b('0x1e')]);}}if(_0x3f3ba0){logger[_0x5e8b('0xb')](_0x5e8b('0x29'));return _0x3f3ba0;}else{logger[_0x5e8b('0xb')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x5e8b('0xd')]('%s/users.json',_0x21b0a5[_0x5e8b('0xf')]),'method':'POST','body':{'user':{'role':_0x5e8b('0x28'),'name':util[_0x5e8b('0xd')](_0x5e8b('0x2a'),_0x105532||_0x365f35),'phone':_0x365f35}}})[_0x5e8b('0x17')](function(_0x49a0d5){logger['info']('Enduser\x20created.');return _0x49a0d5[_0x5e8b('0x23')];});}});}function getAuth(_0x11b5c9){var _0x41cb5a;if(_0x11b5c9[_0x5e8b('0x2b')]===_0x5e8b('0x2c')){_0x41cb5a=util['format'](_0x5e8b('0x2d'),_0x11b5c9[_0x5e8b('0x2e')],_0x11b5c9['password']);}else if(_0x11b5c9[_0x5e8b('0x2b')]===_0x5e8b('0x2f')){_0x41cb5a=util['format'](_0x5e8b('0x30'),_0x11b5c9[_0x5e8b('0x2e')],_0x11b5c9[_0x5e8b('0x2f')]);}return util[_0x5e8b('0xd')](_0x5e8b('0x31'),new Buffer(_0x41cb5a)[_0x5e8b('0x32')]('base64'));}function request(_0x231055){logger[_0x5e8b('0x33')](_0x5e8b('0x34'),JSON[_0x5e8b('0x35')](_0x231055));return rp(_[_0x5e8b('0x7')](_0x231055,{'method':_0x5e8b('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x89d25f,_0x186a7b){var _0x189c7a=[];if(_0x89d25f&&_0x89d25f['length']>0x0){_0x189c7a=_[_0x5e8b('0x37')](_0x89d25f,_0x186a7b);}return _0x189c7a;}function getCustomFields(_0x3c5a85,_0x33576c){var _0x56d883=[];var _0x3ac407={'custom_fields':[]};if(_0x3c5a85[_0x5e8b('0x26')]>0x0){_[_0x5e8b('0x38')](_0x3c5a85,function(_0xde1fcc){if(_[_0x5e8b('0x39')]([_0x5e8b('0x3a'),_0x5e8b('0x3b')],_0xde1fcc[_0x5e8b('0x3c')])&&_0xde1fcc[_0x5e8b('0x3d')]&&!_0xde1fcc[_0x5e8b('0x3e')]){_0x3ac407[_0xde1fcc[_0x5e8b('0x3d')][_0x5e8b('0x3f')]()]=_0xde1fcc[_0x5e8b('0x40')][_0x5e8b('0x32')]();}else if(_[_0x5e8b('0x39')](['string',_0x5e8b('0x3b')],_0xde1fcc[_0x5e8b('0x3c')])&&_0xde1fcc['idField']&&_0xde1fcc[_0x5e8b('0x3e')]){_0x3ac407[_0x5e8b('0x41')][_0x5e8b('0x42')]({'id':_0xde1fcc[_0x5e8b('0x43')],'value':_0xde1fcc[_0x5e8b('0x40')][_0x5e8b('0x32')]()});}else if(_0xde1fcc['type']===_0x5e8b('0x44')&&_0xde1fcc[_0x5e8b('0x45')]&&_0xde1fcc['idField']&&_0xde1fcc[_0x5e8b('0x3e')]){_0x33576c[_0xde1fcc['variableName']]&&_0x3ac407[_0x5e8b('0x41')][_0x5e8b('0x42')]({'id':_0xde1fcc[_0x5e8b('0x43')],'value':_0x33576c[_0xde1fcc[_0x5e8b('0x45')]][_0x5e8b('0x32')]()});}else if(_0xde1fcc[_0x5e8b('0x3c')]===_0x5e8b('0x46')&&_0xde1fcc[_0x5e8b('0x47')]&&_0xde1fcc[_0x5e8b('0x47')][_0x5e8b('0x48')]&&_0xde1fcc[_0x5e8b('0x43')]&&_0xde1fcc[_0x5e8b('0x3e')]){_0x33576c[_0xde1fcc[_0x5e8b('0x47')]['name']['toLowerCase']()]&&_0x3ac407[_0x5e8b('0x41')][_0x5e8b('0x42')]({'id':_0xde1fcc[_0x5e8b('0x43')],'value':_0x33576c[_0xde1fcc[_0x5e8b('0x47')][_0x5e8b('0x48')][_0x5e8b('0x3f')]()][_0x5e8b('0x32')]()});}});}return _0x3ac407;}exports[_0x5e8b('0x49')]=function(_0x23a9cd,_0x52d949,_0x8fb992,_0x396e06,_0x230cfa,_0x3aaf13){var _0x179aa6,_0x240be4;_0x3aaf13[_0x5e8b('0xf')]=intUtil[_0x5e8b('0x4a')](_0x3aaf13[_0x5e8b('0xf')]);_0x3aaf13[_0x5e8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3aaf13[_0x5e8b('0x4b')]);if(_0x230cfa&&_0x230cfa[_0x5e8b('0x4c')]){logger['info']('[QUEUE]',_0x5e8b('0x4d'));_0x52d949[_0x5e8b('0x4e')]=util[_0x5e8b('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3aaf13[_0x5e8b('0x4b')],_0x52d949[_0x5e8b('0x4f')],md5(_0x52d949['uniqueid']));}else{_0x52d949[_0x5e8b('0x4e')]='';}headers['Authorization']=getAuth(_0x3aaf13);return getUser(_0x3aaf13,_0x396e06['email'])[_0x5e8b('0x17')](function(_0x432bca){_0x179aa6=_0x432bca;logger['info']('The\x20User\x20ID\x20is:',_0x179aa6['id']);return getEndUser(_0x3aaf13,_0x52d949['calleridname'],_0x52d949[_0x5e8b('0x50')]);})[_0x5e8b('0x17')](function(_0x4414b3){_0x240be4=_0x4414b3;logger[_0x5e8b('0xb')](_0x5e8b('0x51'),_0x240be4['id']);return getTicket(_0x3aaf13,_0x179aa6,_0x240be4,_0x8fb992,_0x52d949);})[_0x5e8b('0x17')](function(_0x409d7c){if(_0x409d7c){logger['info'](_0x5e8b('0x52'),_0x409d7c['id']);switch(_0x3aaf13[_0x5e8b('0x3c')]){case _0x5e8b('0x53'):logger[_0x5e8b('0xb')](_0x5e8b('0x54'),_0x5e8b('0x55'));return request({'uri':util[_0x5e8b('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x3aaf13[_0x5e8b('0xf')],_0x179aa6['id'],_0x409d7c['id']),'method':'POST'});case _0x5e8b('0x56'):logger[_0x5e8b('0xb')](_0x5e8b('0x54'),_0x5e8b('0x57'));emit(util['format'](_0x5e8b('0x58'),_0x396e06[_0x5e8b('0x48')]),'trigger:browser:url',{'uri':util[_0x5e8b('0xd')](_0x5e8b('0x59'),_0x3aaf13[_0x5e8b('0xf')][_0x5e8b('0x5a')](_0x5e8b('0x5b'),''),_0x409d7c['id'])});break;default:logger[_0x5e8b('0x5c')]('[QUEUE]',_0x5e8b('0x5d'));}}})[_0x5e8b('0x5e')](function(_0x489222){logger[_0x5e8b('0x5c')](_0x5e8b('0x5f'),util[_0x5e8b('0x60')](_0x489222,{'showHidden':!![],'depth':null}));});};exports[_0x5e8b('0x61')]=function(_0x592db2,_0x4fd493,_0x181ff0,_0x4717b9,_0xa8d108,_0x20fa43,_0x4f68ac){var _0x42f254,_0x23dd6c;_0x20fa43[_0x5e8b('0xf')]=intUtil[_0x5e8b('0x4a')](_0x20fa43['remoteUri']);_0x20fa43['serverUrl']=intUtil[_0x5e8b('0x4a')](_0x20fa43[_0x5e8b('0x4b')]);if(_0x4f68ac&&_0x4f68ac[_0x5e8b('0x62')]&&_0x4f68ac[_0x5e8b('0x62')]!==_0x5e8b('0x63')){logger['info'](_0x5e8b('0x64'),_0x5e8b('0x4d'));_0x4fd493['recordingURL']=util[_0x5e8b('0xd')](_0x5e8b('0x65'),_0x20fa43[_0x5e8b('0x4b')],_0x4fd493[_0x5e8b('0x4f')],md5(_0x4fd493[_0x5e8b('0x4f')]));}headers[_0x5e8b('0x66')]=getAuth(_0x20fa43);return getUser(_0x20fa43,_0x4717b9[_0x5e8b('0x67')])[_0x5e8b('0x17')](function(_0x46528d){_0x42f254=_0x46528d;logger[_0x5e8b('0xb')](_0x5e8b('0x68'),_0x42f254['id']);return getEndUser(_0x20fa43,_0x4fd493['destcalleridname'],_0x4fd493[_0x5e8b('0x69')]);})[_0x5e8b('0x17')](function(_0x55bcc9){_0x23dd6c=_0x55bcc9;logger[_0x5e8b('0xb')]('The\x20Enduser\x20ID\x20is:',_0x23dd6c['id']);return getTicket(_0x20fa43,_0x42f254,_0x23dd6c,_0x181ff0,_0x4fd493);})[_0x5e8b('0x17')](function(_0x1acf69){if(_0x1acf69){logger['info'](_0x5e8b('0x52'),_0x1acf69['id']);switch(_0x20fa43['type']){case _0x5e8b('0x53'):logger[_0x5e8b('0xb')]('[OUTBOUND]',_0x5e8b('0x55'));return request({'uri':util[_0x5e8b('0xd')](_0x5e8b('0x6a'),_0x20fa43[_0x5e8b('0xf')],_0x42f254['id'],_0x1acf69['id']),'method':'POST'});case _0x5e8b('0x56'):logger['info'](_0x5e8b('0x64'),_0x5e8b('0x57'));emit(util['format'](_0x5e8b('0x58'),_0x4717b9['name']),_0x5e8b('0x6b'),{'uri':util[_0x5e8b('0xd')]('%s/agent/tickets/%s',_0x20fa43[_0x5e8b('0xf')][_0x5e8b('0x5a')]('/api/v2',''),_0x1acf69['id'])});break;default:logger[_0x5e8b('0x5c')](_0x5e8b('0x64'),_0x5e8b('0x5d'));}}})[_0x5e8b('0x5e')](function(_0x50fd51){logger[_0x5e8b('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5e8b('0x60')](_0x50fd51,{'showHidden':!![],'depth':null}));});};exports[_0x5e8b('0x6c')]=function(_0xa1c9df,_0x59fbd4,_0x5eb72e,_0xe3bafd,_0x5e6b93,_0x3eeca4){var _0x3f652e,_0x10690f;_0x3eeca4[_0x5e8b('0xf')]=intUtil[_0x5e8b('0x4a')](_0x3eeca4[_0x5e8b('0xf')]);_0x3eeca4[_0x5e8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3eeca4['serverUrl']);if(_0x5e6b93&&_0x5e6b93[_0x5e8b('0x4c')]){logger[_0x5e8b('0xb')]('['+_0x59fbd4[_0x5e8b('0x6d')][_0x5e8b('0x6e')]()+']','Recording\x20is\x20enabled!');_0x59fbd4[_0x5e8b('0x4e')]=util[_0x5e8b('0xd')](_0x5e8b('0x65'),_0x3eeca4[_0x5e8b('0x4b')],_0x59fbd4[_0x5e8b('0x4f')],md5(_0x59fbd4['uniqueid']));}else{_0x59fbd4[_0x5e8b('0x4e')]='';}headers[_0x5e8b('0x66')]=getAuth(_0x3eeca4);return getUser(_0x3eeca4)['then'](function(_0x4b119e){_0x3f652e=_0x4b119e;logger['info'](_0x5e8b('0x68'),_0x3f652e['id']);return getEndUser(_0x3eeca4,_0x59fbd4[_0x5e8b('0x6f')],_0x59fbd4[_0x5e8b('0x50')]);})['then'](function(_0x1fdfd4){_0x10690f=_0x1fdfd4;logger[_0x5e8b('0xb')]('The\x20Enduser\x20ID\x20is:',_0x10690f['id']);return getTicket(_0x3eeca4,_0x3f652e,_0x10690f,_0x5eb72e,_0x59fbd4);})[_0x5e8b('0x17')](function(_0x830587){if(_0x830587){logger[_0x5e8b('0xb')]('The\x20Ticket\x20ID\x20is:',_0x830587['id']);}})['catch'](function(_0x292f40){logger[_0x5e8b('0x5c')]('['+_0x59fbd4[_0x5e8b('0x6d')][_0x5e8b('0x6e')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x292f40,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x847c=['Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','format','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','%s:%s','username','Basic\x20%s','toString','base64','debug','GET','map','picklist','type','nameField','customField','toLowerCase','includes','idField','custom_fields','push','content','variable','variableName','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x5a628a,_0x4195b6){var _0x4edab4=function(_0x51fc15){while(--_0x51fc15){_0x5a628a['push'](_0x5a628a['shift']());}};_0x4edab4(++_0x4195b6);}(_0x847c,0xef));var _0xc847=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x847c[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var rp=require(_0xc847('0x0'));var md5=require('md5');var util=require(_0xc847('0x1'));var Redis=require(_0xc847('0x2'));var intUtil=require(_0xc847('0x3'));var config=require(_0xc847('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0xc847('0x5')]=_[_0xc847('0x6')](config[_0xc847('0x5')],{'host':_0xc847('0x7'),'port':0x18eb});var io=require(_0xc847('0x8'))(new Redis(config[_0xc847('0x5')]));function emit(_0x13d703,_0x53387e,_0x2fc2e6){io['to'](_0x13d703)[_0xc847('0x9')](_0x53387e,_0x2fc2e6);}var headers={'Content-Type':'application/json','Accept':_0xc847('0xa')};function getTicket(_0xebf9bf,_0x18631e,_0x3816fa,_0x213c3c,_0x2ce754){logger[_0xc847('0xb')](_0xc847('0xc'));return request({'uri':util['format']('%s/tickets.json',_0xebf9bf['remoteUri']),'method':_0xc847('0xd'),'body':{'ticket':_[_0xc847('0xe')]({'requester_id':_0x3816fa['id'],'submitter_id':_0x18631e?_0x18631e['id']:undefined,'assignee_id':_0x18631e?_0x18631e['id']:undefined,'tags':getTags(_0x213c3c['Tags'],_0xc847('0xf')),'subject':intUtil[_0xc847('0x10')](_0x213c3c[_0xc847('0x11')],_0x2ce754,'\x20'),'description':intUtil['getString'](_0x213c3c[_0xc847('0x12')],_0x2ce754,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc847('0x10')](_0x213c3c[_0xc847('0x12')],_0x2ce754,'\x0a')}},getCustomFields(_0x213c3c[_0xc847('0x13')],_0x2ce754))}})[_0xc847('0x14')](function(_0x10373a){logger[_0xc847('0xb')](_0xc847('0x15'));return _0x10373a[_0xc847('0x16')];});}function getUser(_0x3ee23a,_0x357360){if(intUtil[_0xc847('0x17')](_0x357360)){logger[_0xc847('0xb')](_0xc847('0x18'),_0x357360);return request({'uri':util['format']('%s/search.json',_0x3ee23a[_0xc847('0x19')]),'qs':{'query':util[_0xc847('0x1a')]('type:user\x20role:agent\x20email:%s',_0x357360)}})[_0xc847('0x14')](function(_0x25d961){if(_0x25d961[_0xc847('0x1b')]){logger[_0xc847('0xb')](_0xc847('0x1c'));return _[_0xc847('0x1d')](_0x25d961[_0xc847('0x1e')],{'email':_0x357360,'role':_0xc847('0x1f')});}else{logger['info'](_0xc847('0x20'));return request({'uri':util[_0xc847('0x1a')]('%s/users/me.json',_0x3ee23a[_0xc847('0x19')])})[_0xc847('0x14')](function(_0x11e206){logger[_0xc847('0xb')](_0xc847('0x21'));return _0x11e206[_0xc847('0x22')];});}});}else{logger[_0xc847('0xb')](_0xc847('0x20'));return request({'uri':util[_0xc847('0x1a')](_0xc847('0x23'),_0x3ee23a['remoteUri'])})[_0xc847('0x14')](function(_0x24fa06){logger[_0xc847('0xb')](_0xc847('0x21'));return _0x24fa06[_0xc847('0x22')];});}}function getEndUser(_0x31b054,_0x2efa0b,_0x50e040){logger[_0xc847('0xb')](_0xc847('0x24'),_0x50e040);return request({'uri':util[_0xc847('0x1a')]('%s/search.json',_0x31b054[_0xc847('0x19')]),'qs':{'query':util[_0xc847('0x1a')](_0xc847('0x25'),_0x50e040)}})[_0xc847('0x14')](function(_0x30576c){var _0x29a35e;if(_0x30576c[_0xc847('0x1e')][_0xc847('0x26')]){_0x30576c['results']=_['filter'](_0x30576c[_0xc847('0x1e')],{'suspended':![],'role':_0xc847('0x27')});if(_0x30576c['results']['length']){_0x29a35e=_[_0xc847('0x28')](_0x30576c[_0xc847('0x1e')]);}}if(_0x29a35e){logger[_0xc847('0xb')](_0xc847('0x29'));return _0x29a35e;}else{logger[_0xc847('0xb')](_0xc847('0x2a'));return request({'uri':util[_0xc847('0x1a')]('%s/users.json',_0x31b054[_0xc847('0x19')]),'method':_0xc847('0xd'),'body':{'user':{'role':_0xc847('0x27'),'name':util['format']('Caller\x20-\x20%s',_0x2efa0b||_0x50e040),'phone':_0x50e040}}})[_0xc847('0x14')](function(_0x5270eb){logger[_0xc847('0xb')](_0xc847('0x2b'));return _0x5270eb[_0xc847('0x22')];});}});}function getAuth(_0x5f1816){var _0x16076f;if(_0x5f1816[_0xc847('0x2c')]==='password'){_0x16076f=util[_0xc847('0x1a')](_0xc847('0x2d'),_0x5f1816['username'],_0x5f1816['password']);}else if(_0x5f1816['authType']==='token'){_0x16076f=util[_0xc847('0x1a')]('%s/token:%s',_0x5f1816[_0xc847('0x2e')],_0x5f1816['token']);}return util['format'](_0xc847('0x2f'),new Buffer(_0x16076f)[_0xc847('0x30')](_0xc847('0x31')));}function request(_0x3a273b){logger[_0xc847('0x32')]('[HTTP]',JSON['stringify'](_0x3a273b));return rp(_['defaults'](_0x3a273b,{'method':_0xc847('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x2f935d,_0x339952){var _0x2720ad=[];if(_0x2f935d&&_0x2f935d[_0xc847('0x26')]>0x0){_0x2720ad=_[_0xc847('0x34')](_0x2f935d,_0x339952);}return _0x2720ad;}function getCustomFields(_0x2967fb,_0xaa89e2){var _0x38bb81=[];var _0x5d17b2={'custom_fields':[]};if(_0x2967fb[_0xc847('0x26')]>0x0){_['forEach'](_0x2967fb,function(_0x582eae){if(_['includes'](['string',_0xc847('0x35')],_0x582eae[_0xc847('0x36')])&&_0x582eae[_0xc847('0x37')]&&!_0x582eae[_0xc847('0x38')]){_0x5d17b2[_0x582eae[_0xc847('0x37')][_0xc847('0x39')]()]=_0x582eae['content'][_0xc847('0x30')]();}else if(_[_0xc847('0x3a')](['string',_0xc847('0x35')],_0x582eae[_0xc847('0x36')])&&_0x582eae[_0xc847('0x3b')]&&_0x582eae['customField']){_0x5d17b2[_0xc847('0x3c')][_0xc847('0x3d')]({'id':_0x582eae[_0xc847('0x3b')],'value':_0x582eae[_0xc847('0x3e')][_0xc847('0x30')]()});}else if(_0x582eae[_0xc847('0x36')]===_0xc847('0x3f')&&_0x582eae[_0xc847('0x40')]&&_0x582eae[_0xc847('0x3b')]&&_0x582eae[_0xc847('0x38')]){_0xaa89e2[_0x582eae['variableName']]&&_0x5d17b2['custom_fields'][_0xc847('0x3d')]({'id':_0x582eae[_0xc847('0x3b')],'value':_0xaa89e2[_0x582eae[_0xc847('0x40')]][_0xc847('0x30')]()});}else if(_0x582eae[_0xc847('0x36')]==='customVariable'&&_0x582eae['Variable']&&_0x582eae[_0xc847('0x41')][_0xc847('0xf')]&&_0x582eae[_0xc847('0x3b')]&&_0x582eae[_0xc847('0x38')]){_0xaa89e2[_0x582eae[_0xc847('0x41')][_0xc847('0xf')][_0xc847('0x39')]()]&&_0x5d17b2[_0xc847('0x3c')][_0xc847('0x3d')]({'id':_0x582eae[_0xc847('0x3b')],'value':_0xaa89e2[_0x582eae[_0xc847('0x41')][_0xc847('0xf')][_0xc847('0x39')]()][_0xc847('0x30')]()});}});}return _0x5d17b2;}exports['queue']=function(_0x1ac010,_0x337ca6,_0x2cb439,_0x3b44b2,_0x30a898,_0x3b87cb){var _0x5dd5e8,_0xea9970;_0x3b87cb[_0xc847('0x19')]=intUtil[_0xc847('0x42')](_0x3b87cb[_0xc847('0x19')]);_0x3b87cb[_0xc847('0x43')]=intUtil[_0xc847('0x42')](_0x3b87cb[_0xc847('0x43')]);if(_0x30a898&&_0x30a898['monitor_format']){logger[_0xc847('0xb')](_0xc847('0x44'),_0xc847('0x45'));_0x337ca6[_0xc847('0x46')]=util[_0xc847('0x1a')](_0xc847('0x47'),_0x3b87cb[_0xc847('0x43')],_0x337ca6['uniqueid'],md5(_0x337ca6[_0xc847('0x48')]));}else{_0x337ca6[_0xc847('0x46')]='';}headers[_0xc847('0x49')]=getAuth(_0x3b87cb);return getUser(_0x3b87cb,_0x3b44b2[_0xc847('0x4a')])['then'](function(_0x4e7c27){_0x5dd5e8=_0x4e7c27;logger[_0xc847('0xb')](_0xc847('0x4b'),_0x5dd5e8['id']);return getEndUser(_0x3b87cb,_0x337ca6[_0xc847('0x4c')],_0x337ca6[_0xc847('0x4d')]);})[_0xc847('0x14')](function(_0x6e695e){_0xea9970=_0x6e695e;logger[_0xc847('0xb')]('The\x20Enduser\x20ID\x20is:',_0xea9970['id']);return getTicket(_0x3b87cb,_0x5dd5e8,_0xea9970,_0x2cb439,_0x337ca6);})[_0xc847('0x14')](function(_0xd5a741){if(_0xd5a741){logger[_0xc847('0xb')]('The\x20Ticket\x20ID\x20is:',_0xd5a741['id']);switch(_0x3b87cb[_0xc847('0x36')]){case _0xc847('0x4e'):logger[_0xc847('0xb')](_0xc847('0x44'),_0xc847('0x4f'));return request({'uri':util['format'](_0xc847('0x50'),_0x3b87cb[_0xc847('0x19')],_0x5dd5e8['id'],_0xd5a741['id']),'method':_0xc847('0xd')});case _0xc847('0x51'):logger[_0xc847('0xb')](_0xc847('0x44'),_0xc847('0x52'));emit(util[_0xc847('0x1a')]('user:%s',_0x3b44b2['name']),_0xc847('0x53'),{'uri':util[_0xc847('0x1a')](_0xc847('0x54'),_0x3b87cb['remoteUri'][_0xc847('0x55')](_0xc847('0x56'),''),_0xd5a741['id'])});break;default:logger['error'](_0xc847('0x44'),_0xc847('0x57'));}}})[_0xc847('0x58')](function(_0x8d3cc2){logger[_0xc847('0x59')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x8d3cc2,{'showHidden':!![],'depth':null}));});};exports[_0xc847('0x5a')]=function(_0x129203,_0x36f7ae,_0x10b260,_0x389524,_0x8086fa,_0x44847d,_0x5f0d73){var _0x395f1d,_0x426472;_0x44847d[_0xc847('0x19')]=intUtil[_0xc847('0x42')](_0x44847d[_0xc847('0x19')]);_0x44847d['serverUrl']=intUtil[_0xc847('0x42')](_0x44847d[_0xc847('0x43')]);if(_0x5f0d73&&_0x5f0d73[_0xc847('0x5b')]&&_0x5f0d73[_0xc847('0x5b')]!==_0xc847('0x5c')){logger[_0xc847('0xb')](_0xc847('0x5d'),_0xc847('0x45'));_0x36f7ae[_0xc847('0x46')]=util[_0xc847('0x1a')](_0xc847('0x47'),_0x44847d[_0xc847('0x43')],_0x36f7ae[_0xc847('0x48')],md5(_0x36f7ae[_0xc847('0x48')]));}headers[_0xc847('0x49')]=getAuth(_0x44847d);return getUser(_0x44847d,_0x389524[_0xc847('0x4a')])[_0xc847('0x14')](function(_0xd3980){_0x395f1d=_0xd3980;logger[_0xc847('0xb')]('The\x20User\x20ID\x20is:',_0x395f1d['id']);return getEndUser(_0x44847d,_0x36f7ae[_0xc847('0x5e')],_0x36f7ae['destcalleridnum']);})[_0xc847('0x14')](function(_0x2f75fb){_0x426472=_0x2f75fb;logger[_0xc847('0xb')](_0xc847('0x5f'),_0x426472['id']);return getTicket(_0x44847d,_0x395f1d,_0x426472,_0x10b260,_0x36f7ae);})[_0xc847('0x14')](function(_0x4ef0d1){if(_0x4ef0d1){logger[_0xc847('0xb')](_0xc847('0x60'),_0x4ef0d1['id']);switch(_0x44847d[_0xc847('0x36')]){case _0xc847('0x4e'):logger[_0xc847('0xb')](_0xc847('0x5d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xc847('0x50'),_0x44847d[_0xc847('0x19')],_0x395f1d['id'],_0x4ef0d1['id']),'method':_0xc847('0xd')});case _0xc847('0x51'):logger['info'](_0xc847('0x5d'),_0xc847('0x52'));emit(util['format'](_0xc847('0x61'),_0x389524[_0xc847('0xf')]),_0xc847('0x53'),{'uri':util[_0xc847('0x1a')](_0xc847('0x54'),_0x44847d[_0xc847('0x19')][_0xc847('0x55')]('/api/v2',''),_0x4ef0d1['id'])});break;default:logger[_0xc847('0x59')](_0xc847('0x5d'),_0xc847('0x57'));}}})[_0xc847('0x58')](function(_0x37ab9b){logger[_0xc847('0x59')](_0xc847('0x62'),util[_0xc847('0x63')](_0x37ab9b,{'showHidden':!![],'depth':null}));});};exports[_0xc847('0x64')]=function(_0x366c9d,_0x1af103,_0x53fabf,_0x521163,_0x37ef4b,_0x104394){var _0x2736ba,_0x14fb7e;_0x104394[_0xc847('0x19')]=intUtil[_0xc847('0x42')](_0x104394[_0xc847('0x19')]);_0x104394[_0xc847('0x43')]=intUtil['stripTrailingSlash'](_0x104394['serverUrl']);if(_0x37ef4b&&_0x37ef4b['monitor_format']){logger[_0xc847('0xb')]('['+_0x1af103[_0xc847('0x65')][_0xc847('0x66')]()+']',_0xc847('0x45'));_0x1af103[_0xc847('0x46')]=util['format'](_0xc847('0x47'),_0x104394[_0xc847('0x43')],_0x1af103['uniqueid'],md5(_0x1af103['uniqueid']));}else{_0x1af103[_0xc847('0x46')]='';}headers[_0xc847('0x49')]=getAuth(_0x104394);return getUser(_0x104394)[_0xc847('0x14')](function(_0x3c975f){_0x2736ba=_0x3c975f;logger['info'](_0xc847('0x4b'),_0x2736ba['id']);return getEndUser(_0x104394,_0x1af103[_0xc847('0x4c')],_0x1af103[_0xc847('0x4d')]);})['then'](function(_0x511996){_0x14fb7e=_0x511996;logger[_0xc847('0xb')](_0xc847('0x5f'),_0x14fb7e['id']);return getTicket(_0x104394,_0x2736ba,_0x14fb7e,_0x53fabf,_0x1af103);})[_0xc847('0x14')](function(_0x579bcf){if(_0x579bcf){logger['info'](_0xc847('0x60'),_0x579bcf['id']);}})[_0xc847('0x58')](function(_0x267361){logger[_0xc847('0x59')]('['+_0x1af103[_0xc847('0x65')]['toUpperCase']()+']'+_0xc847('0x67'),util[_0xc847('0x63')](_0x267361,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 70d63c2..7fe0bb5 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 _0x544a=['toLowerCase','indexOf','split','isNil','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','startCase','Error:\x20','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subjects','getString','Contacts','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','merge','Fields','/crm/v2/Calls','err','stack','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','email','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','md5','moment','ioredis','bluebird','../../../../config/environment','defaults','redis','localhost','emit','debug','[HTTP]','length','forEach','includes','idField','variable','variableName','toString','type','customVariable','Variable','name'];(function(_0x58dc86,_0x361cef){var _0xe1857f=function(_0x23b1ac){while(--_0x23b1ac){_0x58dc86['push'](_0x58dc86['shift']());}};_0xe1857f(++_0x361cef);}(_0x544a,0x118));var _0xa544=function(_0x5bdcc4,_0x84ac61){_0x5bdcc4=_0x5bdcc4-0x0;var _0x482ed2=_0x544a[_0x5bdcc4];return _0x482ed2;};'use strict';var _=require(_0xa544('0x0'));var rp=require(_0xa544('0x1'));var md5=require(_0xa544('0x2'));var util=require('util');var intUtil=require('./util');var moment=require(_0xa544('0x3'));var Redis=require(_0xa544('0x4'));var BPromise=require(_0xa544('0x5'));var config=require(_0xa544('0x6'));var logger=require('../../../../config/logger')('zoho');config['redis']=_[_0xa544('0x7')](config[_0xa544('0x8')],{'host':_0xa544('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa544('0x8')]));function emit(_0x13ce7a,_0x35abfd,_0x4a0b98){io['to'](_0x13ce7a)[_0xa544('0xa')](_0x35abfd,_0x4a0b98);}function request(_0x3066dd){logger[_0xa544('0xb')](_0xa544('0xc'),JSON['stringify'](_0x3066dd));return rp(_0x3066dd);}function getCustomFields(_0x295267,_0x1c961e){var _0xee3ce7={};if(_0x295267[_0xa544('0xd')]>0x0){_[_0xa544('0xe')](_0x295267,function(_0x49e946){if(_[_0xa544('0xf')](['string','picklist'],_0x49e946['type'])&&_0x49e946[_0xa544('0x10')]){_0xee3ce7[_0x49e946[_0xa544('0x10')]]=_0x49e946['content']['toString']();}else if(_0x49e946['type']===_0xa544('0x11')&&_0x49e946[_0xa544('0x12')]&&_0x49e946[_0xa544('0x10')]&&_0x1c961e[_0x49e946['variableName']]){_0xee3ce7[_0x49e946[_0xa544('0x10')]]=_0x1c961e[_0x49e946[_0xa544('0x12')]][_0xa544('0x13')]();}else if(_0x49e946[_0xa544('0x14')]===_0xa544('0x15')&&_0x49e946[_0xa544('0x16')]&&_0x49e946['Variable'][_0xa544('0x17')]&&_0x49e946[_0xa544('0x10')]&&_0x1c961e[_0x49e946['Variable']['name'][_0xa544('0x18')]()]){_0xee3ce7[_0x49e946[_0xa544('0x10')]]=_0x1c961e[_0x49e946[_0xa544('0x16')][_0xa544('0x17')][_0xa544('0x18')]()][_0xa544('0x13')]();}});}return _0xee3ce7;}function getName(_0x1c9b5d){if(_0x1c9b5d[_0xa544('0x19')]('\x20')>0x0){var _0x34ed6d=_0x1c9b5d[_0xa544('0x1a')](/ (.+)/);if(_0x34ed6d[0x1]){return _0x34ed6d;}}return[_0x1c9b5d,_0x1c9b5d];}var accountsTokens={};function getAccessToken(_0x19912e){return new Promise(function(_0x317d10,_0x415637){if(!_[_0xa544('0x1b')](accountsTokens[_0x19912e['id']])&&!_[_0xa544('0x1b')](accountsTokens[_0x19912e['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x19912e['id']][_0xa544('0x1c')])){_0x317d10(accountsTokens[_0x19912e['id']][_0xa544('0x1d')]);}}var _0x52e614;switch(_0x19912e[_0xa544('0x1e')]){case'US':_0x52e614=_0xa544('0x1f');break;case'AU':_0x52e614=_0xa544('0x20');break;case'EU':_0x52e614=_0xa544('0x21');break;case'IN':_0x52e614=_0xa544('0x22');break;case'CN':_0x52e614='https://accounts.zoho.com.cn';break;default:_0x52e614='https://accounts.zoho.eu';break;}var _0xe9bea3={'method':_0xa544('0x23'),'uri':_0x52e614+_0xa544('0x24'),'qs':{'refresh_token':_0x19912e[_0xa544('0x25')],'client_id':_0x19912e[_0xa544('0x26')],'client_secret':_0x19912e[_0xa544('0x27')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xe9bea3)[_0xa544('0x28')](function(_0x3ec847){accountsTokens[_0x19912e['id']]={'access_token':_0x3ec847[_0xa544('0x1d')],'expires_in':moment()[_0xa544('0x29')](_0x3ec847[_0xa544('0x1c')],_0xa544('0x2a'))};_0x317d10(_0x3ec847[_0xa544('0x1d')]);})[_0xa544('0x2b')](function(_0x3f422d){logger[_0xa544('0x2c')]('Failing\x20creating\x20the\x20access_token',_0x3f422d['stack']);_0x415637(_0x3f422d);});});}function getUser(_0x1360e2,_0x416e88,_0x28d835,_0xe9357a){logger[_0xa544('0x2d')](_0xa544('0x2e'));return request({'method':'GET','uri':util[_0xa544('0x2f')](_0xa544('0x30'),_0x416e88),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1360e2},'json':!![]})['then'](function(_0x424065){if(_0x424065[_0xa544('0x31')]){var _0x83bfb2=-0x1;if(_[_0xa544('0x32')](_0x424065[_0xa544('0x31')])){if(!_['isNil'](_0xe9357a)){_0x83bfb2=_[_0xa544('0x33')](_0x424065[_0xa544('0x31')],function(_0x314c56){return _0x314c56['email']===_0xe9357a;});}if(_0x83bfb2>=0x0){logger[_0xa544('0x2d')](_0xa544('0x34'));}else{logger[_0xa544('0x2d')](_0xa544('0x35'));_0x83bfb2=_[_0xa544('0x33')](_0x424065[_0xa544('0x31')],function(_0x5915ba){return _0x5915ba[_0xa544('0x36')][_0xa544('0x17')]==='Administrator';});}return _0x424065['users'][_0x83bfb2];}else{if(_0x424065[_0xa544('0x37')][_0xa544('0x36')][_0xa544('0x17')]===_0xa544('0x38')){logger[_0xa544('0x2d')](_0xa544('0x35'));user=_0x424065[_0xa544('0x37')];return user;}else{logger[_0xa544('0x2c')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x424065));throw new Error(_0xa544('0x39')+JSON[_0xa544('0x3a')](_0x424065));}}}else{logger[_0xa544('0x2c')](_0xa544('0x3b'),JSON[_0xa544('0x3a')](_0x424065));throw new Error(_0xa544('0x39')+JSON[_0xa544('0x3a')](_0x424065));}})[_0xa544('0x2b')](function(_0xe54eb1){console[_0xa544('0x2c')](_0xe54eb1);});}function getZohoUser(_0x5ed660,_0x5b0730){return new BPromise(function(_0x57a4d0,_0x53eabc){request(_0x5ed660)[_0xa544('0x28')](function(_0x1f912c){var _0x3c6ed3=null;if(_0x1f912c){_0x3c6ed3=_0x1f912c[_0xa544('0x3c')][0x0];_0x3c6ed3[_0xa544('0x3d')]=_0x5b0730;}_0x57a4d0(_0x3c6ed3);})[_0xa544('0x2b')](function(_0x195079){_0x53eabc(_0x195079);});});}function createEndUser(_0x5d6441,_0x55ba3f,_0x586b02,_0x42d9b6,_0x20b5f1,_0x527a3b){var _0x586b02=getName(_0x586b02);return request({'method':'POST','uri':_0xa544('0x3e')+_0x55ba3f+'/crm/v2/'+_['startCase'](_0x527a3b[_0xa544('0x3f')])+'s','body':{'data':[{'Last_Name':_0x586b02[0x1],'First_Name':_0x586b02[0x0],'Phone':_0x42d9b6,'Owner':{'name':!_[_0xa544('0x1b')](_0x20b5f1[_0xa544('0x40')][_0xa544('0x17')])?_0x20b5f1[_0xa544('0x40')][_0xa544('0x17')]:!_[_0xa544('0x1b')](_0x20b5f1[_0xa544('0x41')])?_0x20b5f1[_0xa544('0x41')]+'\x20'+_0x20b5f1[_0xa544('0x42')]:_0x20b5f1['last_name'],'id':_0x20b5f1['id']}}]},'headers':{'Authorization':_0xa544('0x43')+_0x5d6441},'json':!![]})[_0xa544('0x28')](function(_0x2dd803){if(_0x2dd803&&_0x2dd803[_0xa544('0x3c')][0x0][_0xa544('0x44')]===_0xa544('0x45')){var _0x13eb1e=_0x2dd803['data'][0x0][_0xa544('0x46')];_0x13eb1e[_0xa544('0x3d')]=_[_0xa544('0x47')](_0x527a3b['moduleCreate'])+'s';return _0x13eb1e;}logger['error'](_0xa544('0x3b'),JSON['stringify'](data));throw new Error(_0xa544('0x48')+JSON[_0xa544('0x3a')](data));})[_0xa544('0x2b')](function(_0x2048f8){console['log'](_0xa544('0x49'),_0x2048f8);});}function getEndUser(_0xb2b4c8,_0x48c333,_0x356b3e,_0x1567f8,_0x447249,_0x34511d,_0x18c457){var _0x4d26dc={'method':_0xa544('0x4a'),'uri':'','headers':{'Authorization':_0xa544('0x43')+_0xb2b4c8},'json':!![]};switch(_0x18c457[_0xa544('0x4b')]){case _0xa544('0x4c'):_0x4d26dc[_0xa544('0x4d')]='https://www.zohoapis.'+_0x48c333+_0xa544('0x4e')+_0x447249+'))';return getZohoUser(_0x4d26dc,'Contacts')['then'](function(_0x1a8e51){if(_0x1a8e51)return _0x1a8e51;_0x4d26dc[_0xa544('0x4d')]=_0xa544('0x3e')+_0x48c333+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x447249+'))';return getZohoUser(_0x4d26dc,_0xa544('0x4f'))[_0xa544('0x28')](function(_0x2b0f4a){if(_0x2b0f4a)return _0x2b0f4a;if(_0x18c457[_0xa544('0x3f')]!=_0xa544('0x50')){return createEndUser(_0xb2b4c8,_0x48c333,_0x1567f8,_0x447249,_0x34511d,_0x18c457);}else{return{};}});});break;case _0xa544('0x51'):_0x4d26dc[_0xa544('0x4d')]='https://www.zohoapis.'+_0x48c333+_0xa544('0x4e')+_0x447249+'))';return getZohoUser(_0x4d26dc,'Contacts')[_0xa544('0x28')](function(_0x359333){if(_0x359333)return _0x359333;if(_0x18c457[_0xa544('0x3f')]!='nothing'){return createEndUser(_0xb2b4c8,_0x48c333,_0x1567f8,_0x447249,_0x34511d,_0x18c457);}else{return{};}});break;case _0xa544('0x52'):_0x4d26dc[_0xa544('0x4d')]=_0xa544('0x3e')+_0x48c333+_0xa544('0x53')+_0x447249+'))';return getZohoUser(_0x4d26dc,_0xa544('0x4f'))[_0xa544('0x28')](function(_0x54e052){if(_0x54e052)return _0x54e052;if(_0x18c457['moduleCreate']!=_0xa544('0x50')){return createEndUser(_0xb2b4c8,_0x48c333,_0x1567f8,_0x447249,_0x34511d,_0x18c457);}else{return{};}});break;}}function getCall(_0x5dad55,_0xbd97eb,_0x3fc50e,_0x57e817,_0x265224,_0x360d50,_0x227587,_0x1c6865){logger[_0xa544('0x2d')](_0xa544('0x54'));var _0x7a4f3a={};_0x7a4f3a[_0xa544('0x55')]={'name':!_[_0xa544('0x1b')](_0x57e817[_0xa544('0x40')][_0xa544('0x17')])&&!_[_0xa544('0x1b')](_0x57e817['profile']['name'])&&_0x57e817[_0xa544('0x36')][_0xa544('0x17')]===_0xa544('0x56')?_0x57e817['role']['name']:!_['isNil'](_0x57e817[_0xa544('0x41')])?_0x57e817[_0xa544('0x41')]+'\x20'+_0x57e817['last_name']:_0x57e817[_0xa544('0x42')],'id':_0x57e817['id']};_0x7a4f3a['Subject']=intUtil['getString'](_0x360d50[_0xa544('0x57')],_0x227587,'\x20');_0x7a4f3a['Description']=intUtil[_0xa544('0x58')](_0x360d50['Descriptions'],_0x227587,'\x0a');if(_0x265224['enduserType']===_0xa544('0x59')){_0x7a4f3a[_0xa544('0x5a')]={'name':!_['isNil'](_0x265224[_0xa544('0x5b')])?_0x265224[_0xa544('0x5b')]:!_['isNil'](_0x265224[_0xa544('0x5c')])?_0x265224[_0xa544('0x5c')]+'\x20'+_0x265224[_0xa544('0x5d')]:_0x265224[_0xa544('0x5d')],'id':_0x265224['id']};}if(_0x265224[_0xa544('0x3d')]===_0xa544('0x4f')){_0x7a4f3a['What_Id']={'name':!_[_0xa544('0x1b')](_0x265224['Full_Name'])?_0x265224[_0xa544('0x5b')]:!_[_0xa544('0x1b')](_0x265224[_0xa544('0x5c')])?_0x265224[_0xa544('0x5c')]+'\x20'+_0x265224[_0xa544('0x5d')]:_0x265224[_0xa544('0x5d')],'id':_0x265224['id']};_0x7a4f3a[_0xa544('0x5e')]=_[_0xa544('0x47')](_0x265224[_0xa544('0x3d')]);}if(_0x227587[_0xa544('0x5f')]){_0x7a4f3a[_0xa544('0x60')]=moment[_0xa544('0x61')](parseInt(_0x227587[_0xa544('0x5f')])*0x3e8)[_0xa544('0x2f')]('mm:ss');}else if(_0x227587[_0xa544('0x62')]&&_0x227587[_0xa544('0x63')]){_0x7a4f3a['Call_Duration']=moment[_0xa544('0x61')](moment(_0x227587['endtime'],_0xa544('0x64'))[_0xa544('0x65')](moment(_0x227587[_0xa544('0x66')],'YYYY-MM-DDTHH:mm:ss')))[_0xa544('0x2f')]('mm:ss');}switch(_0x227587[_0xa544('0x67')]){case'called':_0x7a4f3a['Call_Result']=_0xa544('0x68');break;case _0xa544('0x69'):case'connect':_0x7a4f3a[_0xa544('0x6a')]=_0xa544('0x6b');break;case _0xa544('0x6c'):_0x7a4f3a[_0xa544('0x6a')]=_0xa544('0x6d');break;case _0xa544('0x6e'):_0x7a4f3a[_0xa544('0x6a')]=_0xa544('0x6f');break;case _0xa544('0x70'):_0x7a4f3a[_0xa544('0x6a')]='Timeout';default:}_0x7a4f3a[_0xa544('0x71')]=(_0x1c6865===_0xa544('0x72')?moment(_0x227587[_0xa544('0x66')])[_0xa544('0x2f')](_0xa544('0x64')):moment(_0x227587[_0xa544('0x73')])[_0xa544('0x2f')](_0xa544('0x64')))||moment()[_0xa544('0x2f')](_0xa544('0x64'));_0x7a4f3a['Call_Type']=_0x1c6865||'Inbound';_0x7a4f3a=_[_0xa544('0x74')](_0x7a4f3a,getCustomFields(_0x360d50[_0xa544('0x75')],_0x227587));return request({'method':_0xa544('0x23'),'uri':_0xa544('0x3e')+_0xbd97eb+_0xa544('0x76'),'headers':{'Authorization':_0xa544('0x43')+_0x5dad55},'body':{'data':[_0x7a4f3a]},'json':!![]})[_0xa544('0x28')](function(_0x101d66){if(_0x101d66&&_0x101d66['data'][0x0][_0xa544('0x44')]==='SUCCESS'){logger[_0xa544('0x2d')]('Call\x20created!');return{'id':_0x101d66['data'][0x0]['details']['id']};}})[_0xa544('0x2b')](function(_0xaf8e4c){logger['info'](_0xa544('0x77'),_0xaf8e4c[_0xa544('0x78')]);console[_0xa544('0x79')](_0xa544('0x77'),_0xaf8e4c);});}exports[_0xa544('0x7a')]=function(_0x1bb4b0,_0x402a29,_0x131f2d,_0x43eb4f,_0x26d1b9,_0x22faee){var _0x2e2740,_0x5a27c9,_0x55904b;_0x22faee[_0xa544('0x7b')]=intUtil[_0xa544('0x7c')](_0x22faee['host']);_0x22faee[_0xa544('0x7d')]=intUtil[_0xa544('0x7c')](_0x22faee[_0xa544('0x7d')]);if(_0x26d1b9&&_0x26d1b9[_0xa544('0x7e')]){logger[_0xa544('0x2d')](_0xa544('0x7f'),'Recording\x20is\x20enabled!');_0x402a29[_0xa544('0x80')]=_0x22faee[_0xa544('0x7d')]+_0xa544('0x81')+_0x402a29['uniqueid']+_0xa544('0x82')+md5(_0x402a29[_0xa544('0x83')]);}else{_0x402a29[_0xa544('0x80')]='';}var _0x352239=_0x22faee[_0xa544('0x7b')]==='zoho.eu'?'eu':_0xa544('0x84');return getAccessToken(_0x22faee)[_0xa544('0x28')](function(_0x11cd45){_0x55904b=_0x11cd45;return getUser(_0x55904b,_0x352239,_0x22faee,_0x43eb4f['email']);})[_0xa544('0x28')](function(_0x37a77e){_0x2e2740=_0x37a77e;logger[_0xa544('0x2d')](_0xa544('0x85'),_0x2e2740['id']);return getEndUser(_0x55904b,_0x352239,_0x22faee,_0x402a29['calleridname'],_0x402a29[_0xa544('0x86')],_0x2e2740,_0x131f2d);})[_0xa544('0x28')](function(_0x57d085){_0x5a27c9=_0x57d085;return getCall(_0x55904b,_0x352239,_0x22faee,_0x2e2740,_0x5a27c9,_0x131f2d,_0x402a29,_0xa544('0x87'));})[_0xa544('0x28')](function(_0x563038){if(_0x563038){logger[_0xa544('0x2d')](_0xa544('0x88'),_0x563038['id']);logger[_0xa544('0x2d')](_0xa544('0x7f'),_0xa544('0x89'));emit(util[_0xa544('0x2f')](_0xa544('0x8a'),_0x43eb4f[_0xa544('0x17')]),'trigger:browser:url',{'uri':_0xa544('0x8b')+_0x22faee[_0xa544('0x7b')]+_0xa544('0x8c')+_0x563038['id']});}})['catch'](function(_0x1190e2){logger[_0xa544('0x2c')](_0xa544('0x7f'),JSON[_0xa544('0x3a')](_0x1190e2));});};exports[_0xa544('0x72')]=function(_0x3a691c,_0x10c7da,_0x30aca8,_0x3f7137,_0x296989,_0x44362f,_0x5e35bd){var _0x327857,_0x1fcdb1,_0x4ab4e9;_0x44362f[_0xa544('0x7b')]=intUtil['stripTrailingSlash'](_0x44362f[_0xa544('0x7b')]);_0x44362f['serverUrl']=intUtil[_0xa544('0x7c')](_0x44362f[_0xa544('0x7d')]);if(_0x5e35bd&&_0x5e35bd[_0xa544('0x8d')]&&_0x5e35bd[_0xa544('0x8d')]!==_0xa544('0x8e')){logger[_0xa544('0x2d')](_0xa544('0x8f'),'Recording\x20is\x20enabled!');_0x10c7da['recordingURL']=_0x44362f[_0xa544('0x7d')]+_0xa544('0x81')+_0x10c7da['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x10c7da[_0xa544('0x83')]);}var _0x30df45=_0x44362f[_0xa544('0x7b')]===_0xa544('0x90')?'eu':_0xa544('0x84');return getAccessToken(_0x44362f)[_0xa544('0x28')](function(_0x57360c){_0x4ab4e9=_0x57360c;return getUser(_0x4ab4e9,_0x30df45,_0x44362f,_0x3f7137[_0xa544('0x91')]);})[_0xa544('0x28')](function(_0x109cca){_0x327857=_0x109cca;logger[_0xa544('0x2d')](_0xa544('0x85'),_0x327857['id']);return getEndUser(_0x4ab4e9,_0x30df45,_0x44362f,_0x10c7da[_0xa544('0x92')],_0x10c7da[_0xa544('0x93')],_0x327857,_0x30aca8);})['then'](function(_0x2fc878){_0x1fcdb1=_0x2fc878;return getCall(_0x4ab4e9,_0x30df45,_0x44362f,_0x327857,_0x1fcdb1,_0x30aca8,_0x10c7da,'Outbound');})[_0xa544('0x28')](function(_0x4032ce){if(_0x4032ce){logger['info'](_0xa544('0x88'),_0x4032ce['id']);logger[_0xa544('0x2d')](_0xa544('0x8f'),_0xa544('0x89'));emit(util[_0xa544('0x2f')](_0xa544('0x8a'),_0x3f7137[_0xa544('0x17')]),_0xa544('0x94'),{'uri':_0xa544('0x8b')+_0x44362f['host']+_0xa544('0x8c')+_0x4032ce['id']});}})[_0xa544('0x2b')](function(_0x8552a1){logger[_0xa544('0x2c')](_0xa544('0x8f'),JSON[_0xa544('0x3a')](_0x8552a1));});};exports[_0xa544('0x95')]=function(_0x5aed4b,_0x358966,_0x31aaac,_0x360017,_0x5d94f6,_0x54b46d){var _0x5cec72,_0x1764fa,_0x85d2fb;_0x54b46d[_0xa544('0x7b')]=intUtil[_0xa544('0x7c')](_0x54b46d[_0xa544('0x7b')]);_0x54b46d['serverUrl']=intUtil['stripTrailingSlash'](_0x54b46d[_0xa544('0x7d')]);if(_0x5d94f6&&_0x5d94f6[_0xa544('0x7e')]){logger['info']('['+_0x358966['lastevent'][_0xa544('0x96')]()+']',_0xa544('0x97'));_0x358966['recordingURL']=_0x54b46d[_0xa544('0x7d')]+_0xa544('0x81')+_0x358966[_0xa544('0x83')]+_0xa544('0x82')+md5(_0x358966[_0xa544('0x83')]);}else{_0x358966[_0xa544('0x80')]='';}var _0x2b68c9=_0x54b46d['host']==='zoho.eu'?'eu':_0xa544('0x84');return getAccessToken(_0x54b46d)[_0xa544('0x28')](function(_0x555038){_0x85d2fb=_0x555038;return getUser(_0x85d2fb,_0x2b68c9,_0x54b46d);})[_0xa544('0x28')](function(_0x1f9dcf){_0x5cec72=_0x1f9dcf;logger[_0xa544('0x2d')](_0xa544('0x85'),_0x5cec72['id']);return getEndUser(_0x85d2fb,_0x2b68c9,_0x54b46d,_0x358966['calleridname'],_0x358966[_0xa544('0x86')],_0x5cec72,_0x31aaac);})[_0xa544('0x28')](function(_0x5968f5){_0x1764fa=_0x5968f5;return getCall(_0x85d2fb,_0x2b68c9,_0x54b46d,_0x5cec72,_0x1764fa,_0x31aaac,_0x358966,_0xa544('0x87'));})[_0xa544('0x28')](function(_0x5cc790){if(_0x5cc790){logger['info'](_0xa544('0x88'),_0x5cc790['id']);}})['catch'](function(_0x402c67){logger[_0xa544('0x2c')]('['+_0x358966['lastevent'][_0xa544('0x96')]()+']',JSON[_0xa544('0x3a')](_0x402c67));});}; \ No newline at end of file +var _0xe6b9=['picklist','idField','content','type','variable','variableName','toString','Variable','name','toLowerCase','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','Contacts','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','utc','mm:ss','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','com','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string'];(function(_0x43516f,_0x467147){var _0x1b67cd=function(_0x315ab6){while(--_0x315ab6){_0x43516f['push'](_0x43516f['shift']());}};_0x1b67cd(++_0x467147);}(_0xe6b9,0x1cd));var _0x9e6b=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0xe6b9[_0x3fd3a3];return _0xa3e4d5;};'use strict';var _=require(_0x9e6b('0x0'));var rp=require(_0x9e6b('0x1'));var md5=require(_0x9e6b('0x2'));var util=require(_0x9e6b('0x3'));var intUtil=require('./util');var moment=require(_0x9e6b('0x4'));var Redis=require(_0x9e6b('0x5'));var BPromise=require(_0x9e6b('0x6'));var config=require(_0x9e6b('0x7'));var logger=require(_0x9e6b('0x8'))(_0x9e6b('0x9'));config[_0x9e6b('0xa')]=_[_0x9e6b('0xb')](config[_0x9e6b('0xa')],{'host':_0x9e6b('0xc'),'port':0x18eb});var io=require(_0x9e6b('0xd'))(new Redis(config[_0x9e6b('0xa')]));function emit(_0x50bc15,_0x232225,_0x5ef308){io['to'](_0x50bc15)[_0x9e6b('0xe')](_0x232225,_0x5ef308);}function request(_0x33c49f){logger[_0x9e6b('0xf')](_0x9e6b('0x10'),JSON[_0x9e6b('0x11')](_0x33c49f));return rp(_0x33c49f);}function getCustomFields(_0xeaed37,_0x271463){var _0x14df99={};if(_0xeaed37[_0x9e6b('0x12')]>0x0){_[_0x9e6b('0x13')](_0xeaed37,function(_0x160c73){if(_[_0x9e6b('0x14')]([_0x9e6b('0x15'),_0x9e6b('0x16')],_0x160c73['type'])&&_0x160c73[_0x9e6b('0x17')]){_0x14df99[_0x160c73[_0x9e6b('0x17')]]=_0x160c73[_0x9e6b('0x18')]['toString']();}else if(_0x160c73[_0x9e6b('0x19')]===_0x9e6b('0x1a')&&_0x160c73[_0x9e6b('0x1b')]&&_0x160c73['idField']&&_0x271463[_0x160c73[_0x9e6b('0x1b')]]){_0x14df99[_0x160c73[_0x9e6b('0x17')]]=_0x271463[_0x160c73[_0x9e6b('0x1b')]][_0x9e6b('0x1c')]();}else if(_0x160c73[_0x9e6b('0x19')]==='customVariable'&&_0x160c73['Variable']&&_0x160c73[_0x9e6b('0x1d')][_0x9e6b('0x1e')]&&_0x160c73['idField']&&_0x271463[_0x160c73[_0x9e6b('0x1d')]['name'][_0x9e6b('0x1f')]()]){_0x14df99[_0x160c73[_0x9e6b('0x17')]]=_0x271463[_0x160c73[_0x9e6b('0x1d')]['name'][_0x9e6b('0x1f')]()][_0x9e6b('0x1c')]();}});}return _0x14df99;}function getName(_0x33bfcf){if(_0x33bfcf['indexOf']('\x20')>0x0){var _0x1d4816=_0x33bfcf['split'](/ (.+)/);if(_0x1d4816[0x1]){return _0x1d4816;}}return[_0x33bfcf,_0x33bfcf];}var accountsTokens={};function getAccessToken(_0x4370da){return new Promise(function(_0x5e6e4f,_0x4238ea){if(!_[_0x9e6b('0x20')](accountsTokens[_0x4370da['id']])&&!_[_0x9e6b('0x20')](accountsTokens[_0x4370da['id']]['access_token'])){if(moment()[_0x9e6b('0x21')](accountsTokens[_0x4370da['id']][_0x9e6b('0x22')])){_0x5e6e4f(accountsTokens[_0x4370da['id']][_0x9e6b('0x23')]);}}var _0x3a3179;switch(_0x4370da[_0x9e6b('0x24')]){case'US':_0x3a3179=_0x9e6b('0x25');break;case'AU':_0x3a3179=_0x9e6b('0x26');break;case'EU':_0x3a3179=_0x9e6b('0x27');break;case'IN':_0x3a3179=_0x9e6b('0x28');break;case'CN':_0x3a3179=_0x9e6b('0x29');break;default:_0x3a3179=_0x9e6b('0x27');break;}var _0x8d67d0={'method':_0x9e6b('0x2a'),'uri':_0x3a3179+_0x9e6b('0x2b'),'qs':{'refresh_token':_0x4370da['refreshToken'],'client_id':_0x4370da[_0x9e6b('0x2c')],'client_secret':_0x4370da[_0x9e6b('0x2d')],'grant_type':_0x9e6b('0x2e')},'json':!![]};return rp(_0x8d67d0)[_0x9e6b('0x2f')](function(_0x12eb78){accountsTokens[_0x4370da['id']]={'access_token':_0x12eb78[_0x9e6b('0x23')],'expires_in':moment()[_0x9e6b('0x30')](_0x12eb78[_0x9e6b('0x22')],_0x9e6b('0x31'))};_0x5e6e4f(_0x12eb78[_0x9e6b('0x23')]);})[_0x9e6b('0x32')](function(_0xa729f8){logger['error'](_0x9e6b('0x33'),_0xa729f8[_0x9e6b('0x34')]);_0x4238ea(_0xa729f8);});});}function getUser(_0x57297e,_0x434822,_0x26ccb5,_0x1e6512){logger[_0x9e6b('0x35')](_0x9e6b('0x36'));return request({'method':_0x9e6b('0x37'),'uri':util[_0x9e6b('0x38')](_0x9e6b('0x39'),_0x434822),'qs':{'type':_0x9e6b('0x3a')},'headers':{'Authorization':_0x9e6b('0x3b')+_0x57297e},'json':!![]})[_0x9e6b('0x2f')](function(_0x36fc43){if(_0x36fc43['users']){var _0x8da4e6=-0x1;if(_[_0x9e6b('0x3c')](_0x36fc43['users'])){if(!_[_0x9e6b('0x20')](_0x1e6512)){_0x8da4e6=_[_0x9e6b('0x3d')](_0x36fc43[_0x9e6b('0x3e')],function(_0x550cf4){return _0x550cf4[_0x9e6b('0x3f')]===_0x1e6512;});}if(_0x8da4e6>=0x0){logger[_0x9e6b('0x35')](_0x9e6b('0x40'));}else{logger[_0x9e6b('0x35')](_0x9e6b('0x41'));_0x8da4e6=_[_0x9e6b('0x3d')](_0x36fc43[_0x9e6b('0x3e')],function(_0x4adada){return _0x4adada['profile'][_0x9e6b('0x1e')]===_0x9e6b('0x42');});}return _0x36fc43[_0x9e6b('0x3e')][_0x8da4e6];}else{if(_0x36fc43[_0x9e6b('0x43')][_0x9e6b('0x44')][_0x9e6b('0x1e')]===_0x9e6b('0x42')){logger[_0x9e6b('0x35')](_0x9e6b('0x41'));user=_0x36fc43['user'];return user;}else{logger[_0x9e6b('0x45')](_0x9e6b('0x46'),JSON[_0x9e6b('0x11')](_0x36fc43));throw new Error(_0x9e6b('0x47')+JSON[_0x9e6b('0x11')](_0x36fc43));}}}else{logger['error'](_0x9e6b('0x46'),JSON['stringify'](_0x36fc43));throw new Error(_0x9e6b('0x47')+JSON[_0x9e6b('0x11')](_0x36fc43));}})[_0x9e6b('0x32')](function(_0x4c130e){console[_0x9e6b('0x45')](_0x4c130e);});}function getZohoUser(_0x93b03b,_0xa52685){return new BPromise(function(_0x1c6243,_0x9a0039){request(_0x93b03b)[_0x9e6b('0x2f')](function(_0x1d5092){var _0x4c0f16=null;if(_0x1d5092){_0x4c0f16=_0x1d5092[_0x9e6b('0x48')][0x0];_0x4c0f16[_0x9e6b('0x49')]=_0xa52685;}_0x1c6243(_0x4c0f16);})[_0x9e6b('0x32')](function(_0xd21538){_0x9a0039(_0xd21538);});});}function createEndUser(_0x33c3ad,_0x30e459,_0x58bdfc,_0x5a2f88,_0x328cca,_0x42e5e3){var _0x58bdfc=getName(_0x58bdfc);return request({'method':_0x9e6b('0x2a'),'uri':_0x9e6b('0x4a')+_0x30e459+'/crm/v2/'+_[_0x9e6b('0x4b')](_0x42e5e3[_0x9e6b('0x4c')])+'s','body':{'data':[{'Last_Name':_0x58bdfc[0x1],'First_Name':_0x58bdfc[0x0],'Phone':_0x5a2f88,'Owner':{'name':!_[_0x9e6b('0x20')](_0x328cca[_0x9e6b('0x4d')][_0x9e6b('0x1e')])?_0x328cca[_0x9e6b('0x4d')][_0x9e6b('0x1e')]:!_[_0x9e6b('0x20')](_0x328cca[_0x9e6b('0x4e')])?_0x328cca[_0x9e6b('0x4e')]+'\x20'+_0x328cca['last_name']:_0x328cca[_0x9e6b('0x4f')],'id':_0x328cca['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x33c3ad},'json':!![]})[_0x9e6b('0x2f')](function(_0x5261b6){if(_0x5261b6&&_0x5261b6[_0x9e6b('0x48')][0x0][_0x9e6b('0x50')]===_0x9e6b('0x51')){var _0xfe7d6b=_0x5261b6[_0x9e6b('0x48')][0x0][_0x9e6b('0x52')];_0xfe7d6b[_0x9e6b('0x49')]=_[_0x9e6b('0x4b')](_0x42e5e3[_0x9e6b('0x4c')])+'s';return _0xfe7d6b;}logger[_0x9e6b('0x45')]('The\x20failing\x20result\x20is',JSON[_0x9e6b('0x11')](data));throw new Error(_0x9e6b('0x53')+JSON[_0x9e6b('0x11')](data));})[_0x9e6b('0x32')](function(_0x33e1bc){console[_0x9e6b('0x54')]('CREATE\x20ERROR',_0x33e1bc);});}function getEndUser(_0x256a5f,_0x4231fc,_0x4f850b,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1){var _0x47aa04={'method':_0x9e6b('0x37'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x256a5f},'json':!![]};switch(_0x206dc1['moduleSearch']){case _0x9e6b('0x55'):_0x47aa04[_0x9e6b('0x56')]=_0x9e6b('0x4a')+_0x4231fc+_0x9e6b('0x57')+_0x2d22da+'))';return getZohoUser(_0x47aa04,'Contacts')[_0x9e6b('0x2f')](function(_0x3ad51b){if(_0x3ad51b)return _0x3ad51b;_0x47aa04['uri']=_0x9e6b('0x4a')+_0x4231fc+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2d22da+'))';return getZohoUser(_0x47aa04,'Leads')[_0x9e6b('0x2f')](function(_0x3ad876){if(_0x3ad876)return _0x3ad876;if(_0x206dc1[_0x9e6b('0x4c')]!=_0x9e6b('0x58')){return createEndUser(_0x256a5f,_0x4231fc,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1);}else{return{};}});});break;case'contact':_0x47aa04[_0x9e6b('0x56')]=_0x9e6b('0x4a')+_0x4231fc+_0x9e6b('0x57')+_0x2d22da+'))';return getZohoUser(_0x47aa04,'Contacts')[_0x9e6b('0x2f')](function(_0x3c547d){if(_0x3c547d)return _0x3c547d;if(_0x206dc1[_0x9e6b('0x4c')]!=_0x9e6b('0x58')){return createEndUser(_0x256a5f,_0x4231fc,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1);}else{return{};}});break;case _0x9e6b('0x59'):_0x47aa04[_0x9e6b('0x56')]=_0x9e6b('0x4a')+_0x4231fc+_0x9e6b('0x5a')+_0x2d22da+'))';return getZohoUser(_0x47aa04,_0x9e6b('0x5b'))['then'](function(_0x5f27e4){if(_0x5f27e4)return _0x5f27e4;if(_0x206dc1[_0x9e6b('0x4c')]!=_0x9e6b('0x58')){return createEndUser(_0x256a5f,_0x4231fc,_0x5cfa79,_0x2d22da,_0x1a5a15,_0x206dc1);}else{return{};}});break;}}function getCall(_0x367c22,_0x2674eb,_0x5870a1,_0x4a0b75,_0x387a96,_0x308abd,_0x3a08b9,_0x3a5231){logger['info'](_0x9e6b('0x5c'));var _0x429aed={};_0x429aed[_0x9e6b('0x5d')]={'name':!_[_0x9e6b('0x20')](_0x4a0b75[_0x9e6b('0x4d')][_0x9e6b('0x1e')])&&!_[_0x9e6b('0x20')](_0x4a0b75['profile'][_0x9e6b('0x1e')])&&_0x4a0b75[_0x9e6b('0x44')][_0x9e6b('0x1e')]===_0x9e6b('0x5e')?_0x4a0b75[_0x9e6b('0x4d')]['name']:!_[_0x9e6b('0x20')](_0x4a0b75[_0x9e6b('0x4e')])?_0x4a0b75[_0x9e6b('0x4e')]+'\x20'+_0x4a0b75[_0x9e6b('0x4f')]:_0x4a0b75['last_name'],'id':_0x4a0b75['id']};_0x429aed[_0x9e6b('0x5f')]=intUtil[_0x9e6b('0x60')](_0x308abd[_0x9e6b('0x61')],_0x3a08b9,'\x20');_0x429aed['Description']=intUtil['getString'](_0x308abd[_0x9e6b('0x62')],_0x3a08b9,'\x0a');if(_0x387a96['enduserType']===_0x9e6b('0x63')){_0x429aed[_0x9e6b('0x64')]={'name':!_['isNil'](_0x387a96[_0x9e6b('0x65')])?_0x387a96[_0x9e6b('0x65')]:!_[_0x9e6b('0x20')](_0x387a96[_0x9e6b('0x66')])?_0x387a96[_0x9e6b('0x66')]+'\x20'+_0x387a96['Last_Name']:_0x387a96['Last_Name'],'id':_0x387a96['id']};}if(_0x387a96['enduserType']===_0x9e6b('0x5b')){_0x429aed[_0x9e6b('0x67')]={'name':!_['isNil'](_0x387a96[_0x9e6b('0x65')])?_0x387a96[_0x9e6b('0x65')]:!_[_0x9e6b('0x20')](_0x387a96[_0x9e6b('0x66')])?_0x387a96[_0x9e6b('0x66')]+'\x20'+_0x387a96['Last_Name']:_0x387a96[_0x9e6b('0x68')],'id':_0x387a96['id']};_0x429aed[_0x9e6b('0x69')]=_[_0x9e6b('0x4b')](_0x387a96['enduserType']);}if(_0x3a08b9[_0x9e6b('0x6a')]){_0x429aed['Call_Duration']=moment[_0x9e6b('0x6b')](parseInt(_0x3a08b9['talktime'])*0x3e8)[_0x9e6b('0x38')](_0x9e6b('0x6c'));}else if(_0x3a08b9['answertime']&&_0x3a08b9[_0x9e6b('0x6d')]){_0x429aed[_0x9e6b('0x6e')]=moment[_0x9e6b('0x6b')](moment(_0x3a08b9['endtime'],_0x9e6b('0x6f'))[_0x9e6b('0x70')](moment(_0x3a08b9['starttime'],_0x9e6b('0x6f'))))['format'](_0x9e6b('0x6c'));}switch(_0x3a08b9[_0x9e6b('0x71')]){case _0x9e6b('0x72'):_0x429aed[_0x9e6b('0x73')]='Called';break;case _0x9e6b('0x74'):case _0x9e6b('0x75'):_0x429aed[_0x9e6b('0x73')]=_0x9e6b('0x76');break;case _0x9e6b('0x77'):_0x429aed['Call_Result']=_0x9e6b('0x78');break;case'abandoned':_0x429aed[_0x9e6b('0x73')]=_0x9e6b('0x79');break;case _0x9e6b('0x7a'):_0x429aed[_0x9e6b('0x73')]=_0x9e6b('0x7b');default:}_0x429aed[_0x9e6b('0x7c')]=(_0x3a5231===_0x9e6b('0x7d')?moment(_0x3a08b9[_0x9e6b('0x7e')])[_0x9e6b('0x38')](_0x9e6b('0x6f')):moment(_0x3a08b9[_0x9e6b('0x7f')])[_0x9e6b('0x38')](_0x9e6b('0x6f')))||moment()[_0x9e6b('0x38')]('YYYY-MM-DDTHH:mm:ss');_0x429aed[_0x9e6b('0x80')]=_0x3a5231||_0x9e6b('0x81');_0x429aed=_['merge'](_0x429aed,getCustomFields(_0x308abd[_0x9e6b('0x82')],_0x3a08b9));return request({'method':'POST','uri':_0x9e6b('0x4a')+_0x2674eb+'/crm/v2/Calls','headers':{'Authorization':_0x9e6b('0x3b')+_0x367c22},'body':{'data':[_0x429aed]},'json':!![]})[_0x9e6b('0x2f')](function(_0x24fec1){if(_0x24fec1&&_0x24fec1['data'][0x0]['code']===_0x9e6b('0x51')){logger['info'](_0x9e6b('0x83'));return{'id':_0x24fec1[_0x9e6b('0x48')][0x0]['details']['id']};}})[_0x9e6b('0x32')](function(_0x1cfaa7){logger[_0x9e6b('0x35')](_0x9e6b('0x84'),_0x1cfaa7[_0x9e6b('0x34')]);console[_0x9e6b('0x54')]('err',_0x1cfaa7);});}exports[_0x9e6b('0x85')]=function(_0x3a3c42,_0x8e4647,_0x46a273,_0x514601,_0x494121,_0x3b79f2){var _0x3c5683,_0x3e6e99,_0x556e4e;_0x3b79f2[_0x9e6b('0x86')]=intUtil[_0x9e6b('0x87')](_0x3b79f2[_0x9e6b('0x86')]);_0x3b79f2['serverUrl']=intUtil['stripTrailingSlash'](_0x3b79f2[_0x9e6b('0x88')]);if(_0x494121&&_0x494121['monitor_format']){logger[_0x9e6b('0x35')](_0x9e6b('0x89'),_0x9e6b('0x8a'));_0x8e4647[_0x9e6b('0x8b')]=_0x3b79f2[_0x9e6b('0x88')]+_0x9e6b('0x8c')+_0x8e4647[_0x9e6b('0x8d')]+_0x9e6b('0x8e')+md5(_0x8e4647['uniqueid']);}else{_0x8e4647['recordingURL']='';}var _0x5eb92b=_0x3b79f2[_0x9e6b('0x86')]===_0x9e6b('0x8f')?'eu':'com';return getAccessToken(_0x3b79f2)['then'](function(_0x19c5f8){_0x556e4e=_0x19c5f8;return getUser(_0x556e4e,_0x5eb92b,_0x3b79f2,_0x514601[_0x9e6b('0x3f')]);})[_0x9e6b('0x2f')](function(_0x248f43){_0x3c5683=_0x248f43;logger[_0x9e6b('0x35')](_0x9e6b('0x90'),_0x3c5683['id']);return getEndUser(_0x556e4e,_0x5eb92b,_0x3b79f2,_0x8e4647[_0x9e6b('0x91')],_0x8e4647[_0x9e6b('0x92')],_0x3c5683,_0x46a273);})[_0x9e6b('0x2f')](function(_0x1d4e11){_0x3e6e99=_0x1d4e11;return getCall(_0x556e4e,_0x5eb92b,_0x3b79f2,_0x3c5683,_0x3e6e99,_0x46a273,_0x8e4647,_0x9e6b('0x81'));})[_0x9e6b('0x2f')](function(_0x108b3d){if(_0x108b3d){logger['info'](_0x9e6b('0x93'),_0x108b3d['id']);logger['info'](_0x9e6b('0x89'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9e6b('0x38')]('user:%s',_0x514601['name']),'trigger:browser:url',{'uri':_0x9e6b('0x94')+_0x3b79f2[_0x9e6b('0x86')]+'/crm/EntityInfo.do?module=Calls&id='+_0x108b3d['id']});}})[_0x9e6b('0x32')](function(_0x40d5b8){logger[_0x9e6b('0x45')](_0x9e6b('0x89'),JSON[_0x9e6b('0x11')](_0x40d5b8));});};exports[_0x9e6b('0x7d')]=function(_0x2c9433,_0x595365,_0x1444a7,_0x1a6fe8,_0x14231e,_0x3dff57,_0x3ba1f5){var _0x74d140,_0x32a80f,_0x19916e;_0x3dff57[_0x9e6b('0x86')]=intUtil[_0x9e6b('0x87')](_0x3dff57[_0x9e6b('0x86')]);_0x3dff57[_0x9e6b('0x88')]=intUtil[_0x9e6b('0x87')](_0x3dff57[_0x9e6b('0x88')]);if(_0x3ba1f5&&_0x3ba1f5['recordingFormat']&&_0x3ba1f5[_0x9e6b('0x95')]!==_0x9e6b('0x96')){logger[_0x9e6b('0x35')](_0x9e6b('0x97'),_0x9e6b('0x8a'));_0x595365[_0x9e6b('0x8b')]=_0x3dff57['serverUrl']+'/api/voice/recordings/'+_0x595365[_0x9e6b('0x8d')]+'/downloads?type=uniqueid&token='+md5(_0x595365[_0x9e6b('0x8d')]);}var _0x290202=_0x3dff57[_0x9e6b('0x86')]===_0x9e6b('0x8f')?'eu':'com';return getAccessToken(_0x3dff57)['then'](function(_0xf57cba){_0x19916e=_0xf57cba;return getUser(_0x19916e,_0x290202,_0x3dff57,_0x1a6fe8[_0x9e6b('0x3f')]);})[_0x9e6b('0x2f')](function(_0x5d6cfa){_0x74d140=_0x5d6cfa;logger[_0x9e6b('0x35')](_0x9e6b('0x90'),_0x74d140['id']);return getEndUser(_0x19916e,_0x290202,_0x3dff57,_0x595365[_0x9e6b('0x98')],_0x595365[_0x9e6b('0x99')],_0x74d140,_0x1444a7);})[_0x9e6b('0x2f')](function(_0x4b516e){_0x32a80f=_0x4b516e;return getCall(_0x19916e,_0x290202,_0x3dff57,_0x74d140,_0x32a80f,_0x1444a7,_0x595365,'Outbound');})[_0x9e6b('0x2f')](function(_0x49609b){if(_0x49609b){logger['info'](_0x9e6b('0x93'),_0x49609b['id']);logger[_0x9e6b('0x35')](_0x9e6b('0x97'),_0x9e6b('0x9a'));emit(util[_0x9e6b('0x38')](_0x9e6b('0x9b'),_0x1a6fe8['name']),'trigger:browser:url',{'uri':_0x9e6b('0x94')+_0x3dff57[_0x9e6b('0x86')]+_0x9e6b('0x9c')+_0x49609b['id']});}})[_0x9e6b('0x32')](function(_0x7175a6){logger['error'](_0x9e6b('0x97'),JSON['stringify'](_0x7175a6));});};exports[_0x9e6b('0x9d')]=function(_0x53ee54,_0x2d97ee,_0x362c6f,_0x246932,_0x3d29a6,_0x5dd737){var _0x41e3bd,_0x6b2b2a,_0x39545b;_0x5dd737[_0x9e6b('0x86')]=intUtil['stripTrailingSlash'](_0x5dd737[_0x9e6b('0x86')]);_0x5dd737[_0x9e6b('0x88')]=intUtil['stripTrailingSlash'](_0x5dd737[_0x9e6b('0x88')]);if(_0x3d29a6&&_0x3d29a6[_0x9e6b('0x9e')]){logger[_0x9e6b('0x35')]('['+_0x2d97ee[_0x9e6b('0x71')][_0x9e6b('0x9f')]()+']',_0x9e6b('0x8a'));_0x2d97ee[_0x9e6b('0x8b')]=_0x5dd737[_0x9e6b('0x88')]+'/api/voice/recordings/'+_0x2d97ee[_0x9e6b('0x8d')]+_0x9e6b('0x8e')+md5(_0x2d97ee[_0x9e6b('0x8d')]);}else{_0x2d97ee[_0x9e6b('0x8b')]='';}var _0x1a57f1=_0x5dd737[_0x9e6b('0x86')]===_0x9e6b('0x8f')?'eu':_0x9e6b('0xa0');return getAccessToken(_0x5dd737)[_0x9e6b('0x2f')](function(_0x30b1da){_0x39545b=_0x30b1da;return getUser(_0x39545b,_0x1a57f1,_0x5dd737);})[_0x9e6b('0x2f')](function(_0x507e34){_0x41e3bd=_0x507e34;logger['info'](_0x9e6b('0x90'),_0x41e3bd['id']);return getEndUser(_0x39545b,_0x1a57f1,_0x5dd737,_0x2d97ee[_0x9e6b('0x91')],_0x2d97ee[_0x9e6b('0x92')],_0x41e3bd,_0x362c6f);})[_0x9e6b('0x2f')](function(_0x1c1896){_0x6b2b2a=_0x1c1896;return getCall(_0x39545b,_0x1a57f1,_0x5dd737,_0x41e3bd,_0x6b2b2a,_0x362c6f,_0x2d97ee,_0x9e6b('0x81'));})['then'](function(_0x965a40){if(_0x965a40){logger[_0x9e6b('0x35')](_0x9e6b('0x93'),_0x965a40['id']);}})[_0x9e6b('0x32')](function(_0x53900d){logger[_0x9e6b('0x45')]('['+_0x2d97ee[_0x9e6b('0x71')][_0x9e6b('0x9f')]()+']',JSON[_0x9e6b('0x11')](_0x53900d));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 27d468d..905a48d 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 _0xb5eb=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','trigger','exec','data2','Script','data3','render','format'];(function(_0x3d9d90,_0x562154){var _0xa0979b=function(_0xef61c7){while(--_0xef61c7){_0x3d9d90['push'](_0x3d9d90['shift']());}};_0xa0979b(++_0x562154);}(_0xb5eb,0x14d));var _0xbb5e=function(_0x2ac1ee,_0x5ec3af){_0x2ac1ee=_0x2ac1ee-0x0;var _0x1cc46c=_0xb5eb[_0x2ac1ee];return _0x1cc46c;};'use strict';var util=require(_0xbb5e('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xbb5e('0x1'));exports[_0xbb5e('0x2')]=function(_0x1e24c6,_0x31764b){var _0x23c603=_0x1e24c6[_0xbb5e('0x3')]?_0x1e24c6['data2']:_0xbb5e('0x4');var _0x349e1c=_0x1e24c6[_0xbb5e('0x5')]?Mustache[_0xbb5e('0x6')](_0x1e24c6[_0xbb5e('0x5')],_0x31764b):_0x31764b;sh['exec'](_0x349e1c,function(_0x1cd744,_0x3bf1f6,_0x4f2644){if(_0x1cd744!==0x0){logger['error'](util[_0xbb5e('0x7')](_0xbb5e('0x8'),_0x23c603,_0x349e1c,_0x1cd744,_0x4f2644));}else{logger[_0xbb5e('0x9')](util[_0xbb5e('0x7')](_0xbb5e('0xa'),_0x23c603,_0x349e1c,_0x3bf1f6));}});}; \ No newline at end of file +var _0x9306=['mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x13822d,_0x16dc5b){var _0x2b729f=function(_0x50312c){while(--_0x50312c){_0x13822d['push'](_0x13822d['shift']());}};_0x2b729f(++_0x16dc5b);}(_0x9306,0x10c));var _0x6930=function(_0x318c9e,_0x164fb0){_0x318c9e=_0x318c9e-0x0;var _0x295579=_0x9306[_0x318c9e];return _0x295579;};'use strict';var util=require(_0x6930('0x0'));var sh=require(_0x6930('0x1'));var Mustache=require(_0x6930('0x2'));var logger=require(_0x6930('0x3'))(_0x6930('0x4'));exports[_0x6930('0x5')]=function(_0x5122fe,_0x2bc52c){var _0xfec865=_0x5122fe[_0x6930('0x6')]?_0x5122fe[_0x6930('0x6')]:_0x6930('0x7');var _0x360808=_0x5122fe[_0x6930('0x8')]?Mustache[_0x6930('0x9')](_0x5122fe[_0x6930('0x8')],_0x2bc52c):_0x2bc52c;sh[_0x6930('0x5')](_0x360808,function(_0x47b069,_0x50d0c5,_0x212166){if(_0x47b069!==0x0){logger[_0x6930('0xa')](util[_0x6930('0xb')](_0x6930('0xc'),_0xfec865,_0x360808,_0x47b069,_0x212166));}else{logger[_0x6930('0xd')](util[_0x6930('0xb')](_0x6930('0xe'),_0xfec865,_0x360808,_0x50d0c5));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 568d5a4..e5d771c 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 _0x7aac=['number','data5','headers','data6','parse','stack','POST','PUT','data7','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','exec','data1','toUpperCase','render','data2'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7aac,0x159));var _0xc7aa=function(_0x121420,_0x252320){_0x121420=_0x121420-0x0;var _0x409d63=_0x7aac[_0x121420];return _0x409d63;};'use strict';var rp=require('request-promise');var util=require(_0xc7aa('0x0'));var _=require(_0xc7aa('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0xc7aa('0x2')]=function(_0xfaffa9,_0x57f3b7){var _0x2f129c,_0x35ba22;var _0x977fa7={'method':_0xfaffa9[_0xc7aa('0x3')][_0xc7aa('0x4')](),'uri':Mustache[_0xc7aa('0x5')](_0xfaffa9[_0xc7aa('0x6')],_0x57f3b7),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xfaffa9['data5'])===_0xc7aa('0x7')&&parseInt(_0xfaffa9[_0xc7aa('0x8')])>=0x1&&parseInt(_0xfaffa9['data5'])<=0xa?parseInt(_0xfaffa9['data5'])*0x3e8:0x5*0x3e8};try{_0x977fa7[_0xc7aa('0x9')]=_0xfaffa9[_0xc7aa('0xa')]?JSON[_0xc7aa('0xb')](Mustache['render'](_0xfaffa9[_0xc7aa('0xa')],_0x57f3b7)):{};}catch(_0x54076b){logger['error'](_0x54076b[_0xc7aa('0xc')]);}switch(_0xfaffa9[_0xc7aa('0x3')][_0xc7aa('0x4')]()){case'GET':case'DELETE':_0x2f129c=null;_0x977fa7['qs']=_0x57f3b7;break;case _0xc7aa('0xd'):case _0xc7aa('0xe'):if(_0xfaffa9[_0xc7aa('0xf')]){try{_0x2f129c=JSON[_0xc7aa('0xb')](Mustache[_0xc7aa('0x5')](_0xfaffa9[_0xc7aa('0xf')],_0x57f3b7));_0x977fa7['body']=_0x2f129c;}catch(_0x11df57){logger[_0xc7aa('0x10')](_0x11df57[_0xc7aa('0xc')]);logger[_0xc7aa('0x10')](_0xc7aa('0x11'));}}else{_0x2f129c=_0x57f3b7;_0x977fa7[_0xc7aa('0x12')]=_0x2f129c;}break;}logger[_0xc7aa('0x13')](util[_0xc7aa('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0xfaffa9['data1'],_0xfaffa9[_0xc7aa('0x6')],JSON[_0xc7aa('0x15')](_0x977fa7)));rp(_0x977fa7)[_0xc7aa('0x16')](function(_0x7cc15b){_0x2f129c=!_[_0xc7aa('0x17')](_0x2f129c)?_0xc7aa('0x18')+_0x2f129c:'';_0x35ba22=typeof _0x7cc15b[_0xc7aa('0x12')]===_0xc7aa('0x19')?JSON['stringify'](_0x7cc15b[_0xc7aa('0x12')]):_0x7cc15b[_0xc7aa('0x12')];logger['info'](util[_0xc7aa('0x14')](_0xc7aa('0x1a'),_0xfaffa9[_0xc7aa('0x3')],_0xfaffa9[_0xc7aa('0x6')],_0x7cc15b[_0xc7aa('0x1b')],_0x35ba22));})[_0xc7aa('0x1c')](function(_0x5065fe){logger[_0xc7aa('0x10')](util[_0xc7aa('0x14')](_0xc7aa('0x1d'),_0xfaffa9[_0xc7aa('0x3')],_0xfaffa9[_0xc7aa('0x6')],_0x5065fe[_0xc7aa('0x1b')],_0x5065fe[_0xc7aa('0x1e')],_0x5065fe[_0xc7aa('0x1f')]));});}; \ No newline at end of file +var _0x6cc8=['object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','number','data5','headers','parse','render','data6','POST','PUT','data7','body','stack','error','info','format','stringify','isNil'];(function(_0x141a50,_0x47c7d5){var _0x12a37f=function(_0x459a8f){while(--_0x459a8f){_0x141a50['push'](_0x141a50['shift']());}};_0x12a37f(++_0x47c7d5);}(_0x6cc8,0xf6));var _0x86cc=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x6cc8[_0x187ee1];return _0x388160;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x86cc('0x0'));var Mustache=require(_0x86cc('0x1'));var logger=require(_0x86cc('0x2'))(_0x86cc('0x3'));exports[_0x86cc('0x4')]=function(_0x39522e,_0x87d730){var _0x5516ed,_0x102ef7;var _0x17b76d={'method':_0x39522e[_0x86cc('0x5')][_0x86cc('0x6')](),'uri':Mustache['render'](_0x39522e[_0x86cc('0x7')],_0x87d730),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x39522e['data5'])===_0x86cc('0x8')&&parseInt(_0x39522e[_0x86cc('0x9')])>=0x1&&parseInt(_0x39522e['data5'])<=0xa?parseInt(_0x39522e[_0x86cc('0x9')])*0x3e8:0x5*0x3e8};try{_0x17b76d[_0x86cc('0xa')]=_0x39522e['data6']?JSON[_0x86cc('0xb')](Mustache[_0x86cc('0xc')](_0x39522e[_0x86cc('0xd')],_0x87d730)):{};}catch(_0xd8de8b){logger['error'](_0xd8de8b['stack']);}switch(_0x39522e['data1'][_0x86cc('0x6')]()){case'GET':case'DELETE':_0x5516ed=null;_0x17b76d['qs']=_0x87d730;break;case _0x86cc('0xe'):case _0x86cc('0xf'):if(_0x39522e[_0x86cc('0x10')]){try{_0x5516ed=JSON[_0x86cc('0xb')](Mustache[_0x86cc('0xc')](_0x39522e[_0x86cc('0x10')],_0x87d730));_0x17b76d[_0x86cc('0x11')]=_0x5516ed;}catch(_0x307a19){logger['error'](_0x307a19[_0x86cc('0x12')]);logger[_0x86cc('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x5516ed=_0x87d730;_0x17b76d[_0x86cc('0x11')]=_0x5516ed;}break;}logger[_0x86cc('0x14')](util[_0x86cc('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x39522e[_0x86cc('0x5')],_0x39522e[_0x86cc('0x7')],JSON[_0x86cc('0x16')](_0x17b76d)));rp(_0x17b76d)['then'](function(_0x5afb60){_0x5516ed=!_[_0x86cc('0x17')](_0x5516ed)?',\x20request\x20body:\x20'+_0x5516ed:'';_0x102ef7=typeof _0x5afb60[_0x86cc('0x11')]===_0x86cc('0x18')?JSON[_0x86cc('0x16')](_0x5afb60['body']):_0x5afb60['body'];logger['info'](util[_0x86cc('0x15')](_0x86cc('0x19'),_0x39522e[_0x86cc('0x5')],_0x39522e[_0x86cc('0x7')],_0x5afb60[_0x86cc('0x1a')],_0x102ef7));})[_0x86cc('0x1b')](function(_0x5ccfab){logger[_0x86cc('0x13')](util[_0x86cc('0x15')](_0x86cc('0x1c'),_0x39522e[_0x86cc('0x5')],_0x39522e[_0x86cc('0x7')],_0x5ccfab[_0x86cc('0x1a')],_0x5ccfab[_0x86cc('0x1d')],_0x5ccfab['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 6f6cb42..9d2f2cd 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 _0x4eb0=['then','debug','rpc','error','message','result','exports','bluebird','../../config/logger','routing','client','Request'];(function(_0x2eda7d,_0x162382){var _0x2fd21d=function(_0x3bf4d0){while(--_0x3bf4d0){_0x2eda7d['push'](_0x2eda7d['shift']());}};_0x2fd21d(++_0x162382);}(_0x4eb0,0x8b));var _0x04eb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4eb0[_0x3ab51d];return _0x29a04e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x04eb('0x0'));var logger=require(_0x04eb('0x1'))(_0x04eb('0x2'));var client=jayson[_0x04eb('0x3')]['http']({'port':0x2329});client[_0x04eb('0x4')]=function(_0x1e2d4d,_0x5bd301){return new BPromise(function(_0x36163e,_0x20fdb8){return client['request'](_0x1e2d4d,_0x5bd301)[_0x04eb('0x5')](function(_0x128da2){logger[_0x04eb('0x6')](_0x04eb('0x7'),_0x04eb('0x2'),_0x1e2d4d,_0x5bd301,_0x128da2);if(_0x128da2[_0x04eb('0x8')]){logger['error']('rpc',_0x04eb('0x2'),_0x1e2d4d,_0x128da2[_0x04eb('0x8')]['message'],_0x5bd301);return _0x20fdb8(_0x128da2['error'][_0x04eb('0x9')]);}else{return _0x36163e(_0x128da2[_0x04eb('0xa')]);}})['catch'](function(_0xd42da5){logger[_0x04eb('0x8')](_0x04eb('0x7'),_0x04eb('0x2'),_0x1e2d4d,_0xd42da5,_0x5bd301);return _0x20fdb8(_0xd42da5);});});};module[_0x04eb('0xb')]=client; \ No newline at end of file +var _0x1065=['../../config/logger','client','http','Request','request','then','rpc','routing','error','message','result','catch','jayson/promise','bluebird'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x1065,0x7c));var _0x5106=function(_0x5703a9,_0x5ab7a9){_0x5703a9=_0x5703a9-0x0;var _0xcd7af5=_0x1065[_0x5703a9];return _0xcd7af5;};'use strict';var jayson=require(_0x5106('0x0'));var BPromise=require(_0x5106('0x1'));var logger=require(_0x5106('0x2'))('routing');var client=jayson[_0x5106('0x3')][_0x5106('0x4')]({'port':0x2329});client[_0x5106('0x5')]=function(_0x192e5b,_0x3b0e1c){return new BPromise(function(_0x2a2733,_0x28ea39){return client[_0x5106('0x6')](_0x192e5b,_0x3b0e1c)[_0x5106('0x7')](function(_0x4f1506){logger['debug'](_0x5106('0x8'),_0x5106('0x9'),_0x192e5b,_0x3b0e1c,_0x4f1506);if(_0x4f1506[_0x5106('0xa')]){logger[_0x5106('0xa')](_0x5106('0x8'),'routing',_0x192e5b,_0x4f1506['error'][_0x5106('0xb')],_0x3b0e1c);return _0x28ea39(_0x4f1506['error'][_0x5106('0xb')]);}else{return _0x2a2733(_0x4f1506[_0x5106('0xc')]);}})[_0x5106('0xd')](function(_0x18a1dc){logger[_0x5106('0xa')]('rpc',_0x5106('0x9'),_0x192e5b,_0x18a1dc,_0x3b0e1c);return _0x28ea39(_0x18a1dc);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 7e7046d..1745dde 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 _0x24e9=['Email\x20service\x20initialization','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','refresh','mailAccounts','listen','getSettings','loginMailFrequency','error'];(function(_0x3dd3de,_0x54508f){var _0x30c8da=function(_0x2502b6){while(--_0x2502b6){_0x3dd3de['push'](_0x3dd3de['shift']());}};_0x30c8da(++_0x54508f);}(_0x24e9,0xb7));var _0x924e=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x24e9[_0x43b06b];return _0x2c555b;};'use strict';var server=require('./server');var Realtime=require(_0x924e('0x0'));var EmailChannel=require(_0x924e('0x1'));var mailAccount=require(_0x924e('0x2'));var setting=require(_0x924e('0x3'));var logger=require(_0x924e('0x4'))(_0x924e('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x924e('0x6')](mailAccount['getMailAccounts']())[_0x924e('0x6')](realtime['initMailAccounts']())[_0x924e('0x6')](function(){email[_0x924e('0x7')](realtime[_0x924e('0x8')]);return realtime;});}function main(){return server[_0x924e('0x9')](realtime,email)[_0x924e('0x6')](function(){return initRealtime();})[_0x924e('0x6')](function(){return setting[_0x924e('0xa')]();})[_0x924e('0x6')](function(_0x47c878){return setInterval(initRealtime,_0x47c878[_0x924e('0xb')]*0x3e8);})['catch'](function(_0x4492ba){logger[_0x924e('0xc')](_0x924e('0xd'),_0x4492ba);});}main(); \ No newline at end of file +var _0xac4a=['./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','getSettings','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xac4a,0x16c));var _0xaac4=function(_0x4f1497,_0xd4de37){_0x4f1497=_0x4f1497-0x0;var _0xb9b325=_0xac4a[_0x4f1497];return _0xb9b325;};'use strict';var server=require(_0xaac4('0x0'));var Realtime=require(_0xaac4('0x1'));var EmailChannel=require(_0xaac4('0x2'));var mailAccount=require(_0xaac4('0x3'));var setting=require(_0xaac4('0x4'));var logger=require(_0xaac4('0x5'))(_0xaac4('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xaac4('0x7')](mailAccount[_0xaac4('0x8')]())['then'](realtime[_0xaac4('0x9')]())[_0xaac4('0x7')](function(){email[_0xaac4('0xa')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)[_0xaac4('0x7')](function(){return initRealtime();})[_0xaac4('0x7')](function(){return setting[_0xaac4('0xb')]();})['then'](function(_0x2f7bf9){return setInterval(initRealtime,_0x2f7bf9[_0xaac4('0xc')]*0x3e8);})[_0xaac4('0xd')](function(_0x2c5b69){logger[_0xaac4('0xe')](_0xaac4('0xf'),_0x2c5b69);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 9dfeb21..18236a1 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 _0xb54d=['../../../config/environment','../../../config/logger','email','defaults','redis','./imap','./smtp','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','total','stringify','mailAccount:update','refresh','service','provider','custom','hasOwnProperty','imapAccounts','box','handleImapBox','bind','handleImapEmail','error','isNil','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapError','sendMail','send','Smtp','lastSync','exports','bluebird','md5','ioredis'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xb54d,0x1c8));var _0xdb54=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0xb54d[_0x5311a1];return _0x2acb9f;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xdb54('0x0'));var md5=require(_0xdb54('0x1'));var Redis=require(_0xdb54('0x2'));var config=require(_0xdb54('0x3'));var logger=require(_0xdb54('0x4'))(_0xdb54('0x5'));config['redis']=_[_0xdb54('0x6')](config[_0xdb54('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdb54('0x7')]));var EmailImap=require(_0xdb54('0x8'));var EmailSmtp=require(_0xdb54('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x423121){logger['info'](_0xdb54('0xa'));this[_0xdb54('0xb')]=_0x423121[_0xdb54('0xb')];this['imapAccounts']={};this[_0xdb54('0xc')]=new EmailSmtp();}EmailChannel[_0xdb54('0xd')][_0xdb54('0xe')]=function(_0x3d61db){var _0x7f694c=this[_0xdb54('0xb')][_0x3d61db];var _0x3b40be={'id':_0x7f694c['id'],'name':_0x7f694c[_0xdb54('0xf')],'key':_0x7f694c[_0xdb54('0x10')],'active':_0x7f694c[_0xdb54('0x11')],'Imap':{'status':_0x7f694c['Imap'][_0xdb54('0x12')],'messageStatus':_0x7f694c[_0xdb54('0x13')][_0xdb54('0x14')],'total':_0x7f694c[_0xdb54('0x13')][_0xdb54('0x15')]}};if(_['isNil'](md5Accounts[_0x3d61db])){md5Accounts[_0x3d61db]={};}var _0x4fe7fa=md5(JSON[_0xdb54('0x16')](_0x3b40be));if(md5Accounts[_0x3d61db][_0xdb54('0x1')]!==_0x4fe7fa){md5Accounts[_0x3d61db][_0xdb54('0x1')]=_0x4fe7fa;io['emit'](_0xdb54('0x17'),_0x3b40be);}};EmailChannel[_0xdb54('0xd')][_0xdb54('0x18')]=function(_0x59fecf){for(var _0x3bf918 in _0x59fecf){if(_0x59fecf['hasOwnProperty'](_0x3bf918)){if(_0x59fecf[_0x3bf918][_0xdb54('0x13')]&&_0x59fecf[_0x3bf918][_0xdb54('0x11')]){var _0x169495=_0x59fecf[_0x3bf918][_0xdb54('0x13')];if(!_0x169495[_0xdb54('0x19')]&&_0x59fecf[_0x3bf918][_0xdb54('0x1a')]!==_0xdb54('0x1b'))_0x169495[_0xdb54('0x19')]=_0x59fecf[_0x3bf918][_0xdb54('0x1a')];if(!this['imapAccounts'][_0xdb54('0x1c')](_0x169495['id'])){this[_0xdb54('0x1d')][_0x169495['id']]=new EmailImap(_0x169495,_0x59fecf[_0x3bf918][_0xdb54('0x5')]);this[_0xdb54('0x1d')][_0x169495['id']]['on'](_0xdb54('0x1e'),this[_0xdb54('0x1f')][_0xdb54('0x20')](this,_0x3bf918));this[_0xdb54('0x1d')][_0x169495['id']]['on'](_0xdb54('0x5'),this[_0xdb54('0x21')][_0xdb54('0x20')](this,_0x3bf918));this[_0xdb54('0x1d')][_0x169495['id']]['on']('end',this['handleImapEnd'][_0xdb54('0x20')](this,_0x3bf918));this[_0xdb54('0x1d')][_0x169495['id']]['on'](_0xdb54('0x22'),this['handleImapError'][_0xdb54('0x20')](this,_0x3bf918));}}else{if(_[_0xdb54('0x23')](this[_0xdb54('0xb')][_0x3bf918][_0xdb54('0x13')])){this['mailAccounts'][_0x3bf918][_0xdb54('0x13')]={};}this[_0xdb54('0xb')][_0x3bf918][_0xdb54('0x13')]['status']='disabled';this[_0xdb54('0xb')][_0x3bf918]['Imap']['messageStatus']='';this[_0xdb54('0xe')](_0x3bf918);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x57a5f3,_0x33141d){if(this[_0xdb54('0xb')][_0x57a5f3]){this['mailAccounts'][_0x57a5f3][_0xdb54('0x13')][_0xdb54('0x12')]='connected';this[_0xdb54('0xb')][_0x57a5f3]['Imap'][_0xdb54('0x14')]=_0x33141d['name'];if(_0x33141d[_0xdb54('0x24')]){this[_0xdb54('0xb')][_0x57a5f3][_0xdb54('0x13')][_0xdb54('0x15')]=_0x33141d[_0xdb54('0x24')]['total'];}return this[_0xdb54('0xe')](_0x57a5f3);}};EmailChannel[_0xdb54('0xd')][_0xdb54('0x21')]=function(_0x363711,_0x4cc69a){logger[_0xdb54('0x25')](_0xdb54('0x26'),_0x4cc69a[_0xdb54('0x27')],_0x4cc69a['lastName'],_0x4cc69a[_0xdb54('0x28')],_0x363711);if(this['mailAccounts'][_0x363711]){return mailAccount['notify'](_0x363711,_0x4cc69a)[_0xdb54('0x29')](function(_0x41d22a){if(_0x41d22a){logger[_0xdb54('0x25')](_0xdb54('0x2a'));}})[_0xdb54('0x2b')](function(_0x18c167){logger[_0xdb54('0x22')](_0xdb54('0x2c'),JSON[_0xdb54('0x16')](_0x18c167));});}};EmailChannel[_0xdb54('0xd')]['handleImapEnd']=function(_0x571e32){if(this['mailAccounts'][_0x571e32]&&this[_0xdb54('0xb')][_0x571e32][_0xdb54('0x13')]){if(this[_0xdb54('0x1d')][this[_0xdb54('0xb')][_0x571e32][_0xdb54('0x13')]['id']]){delete this['imapAccounts'][this[_0xdb54('0xb')][_0x571e32]['Imap']['id']];}this[_0xdb54('0xb')][_0x571e32][_0xdb54('0x13')]['lastSync']=moment();this[_0xdb54('0xe')](_0x571e32);}};EmailChannel['prototype'][_0xdb54('0x2d')]=function(_0x5a0e92,_0x40feae){if(this[_0xdb54('0xb')][_0x5a0e92]){this[_0xdb54('0xb')][_0x5a0e92][_0xdb54('0x13')][_0xdb54('0x12')]=_0xdb54('0x22');this['mailAccounts'][_0x5a0e92][_0xdb54('0x13')][_0xdb54('0x14')]=_0x40feae;return this[_0xdb54('0xe')](_0x5a0e92);}};EmailChannel[_0xdb54('0xd')][_0xdb54('0x2e')]=function(_0xd2b1d4,_0x13a098){return this[_0xdb54('0xc')][_0xdb54('0x2f')](_0xd2b1d4,_0x13a098);};EmailChannel[_0xdb54('0xd')]['verifySmtp']=function(_0x233e1){var _0x522723=this;if(this[_0xdb54('0xb')][_0x233e1['id']]){if(_[_0xdb54('0x23')](this[_0xdb54('0xb')][_0x233e1['id']][_0xdb54('0x30')])){this[_0xdb54('0xb')][_0x233e1['id']][_0xdb54('0x30')]={};}this[_0xdb54('0xb')][_0x233e1['id']][_0xdb54('0x30')][_0xdb54('0x31')]=moment();return new BPromise(function(_0x90c964,_0x5809f8){return _0x522723[_0xdb54('0xc')]['verify'](_0x233e1)['then'](function(_0x3c698b){_0x522723[_0xdb54('0xb')][_0x233e1['id']]['Smtp']['status']='verified';_0x522723['mailAccounts'][_0x233e1['id']]['Smtp'][_0xdb54('0x14')]='';_0x522723[_0xdb54('0xe')](_0x233e1['id']);_0x90c964(_0x3c698b);})[_0xdb54('0x2b')](function(_0xece700){_0x522723[_0xdb54('0xb')][_0x233e1['id']][_0xdb54('0x30')]['status']='error';_0x522723['mailAccounts'][_0x233e1['id']][_0xdb54('0x30')][_0xdb54('0x14')]=_0xece700;_0x522723[_0xdb54('0xe')](_0x233e1['id']);_0x5809f8(_0xece700);});});}return this['smtp']['verify'](_0x233e1);};module[_0xdb54('0x32')]=EmailChannel; \ No newline at end of file +var _0xe0fa=['prototype','hasOwnProperty','service','provider','custom','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','connected','name','total','firstName','lastName','from','notify','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','then','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','active','Imap','status','messageStatus','isNil'];(function(_0x126fe0,_0x17a187){var _0x5af076=function(_0x1e4cbb){while(--_0x1e4cbb){_0x126fe0['push'](_0x126fe0['shift']());}};_0x5af076(++_0x17a187);}(_0xe0fa,0x1a0));var _0xae0f=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xe0fa[_0x2112d4];return _0x434972;};'use strict';var _=require(_0xae0f('0x0'));var moment=require(_0xae0f('0x1'));var BPromise=require(_0xae0f('0x2'));var md5=require(_0xae0f('0x3'));var Redis=require(_0xae0f('0x4'));var config=require(_0xae0f('0x5'));var logger=require(_0xae0f('0x6'))('email');config[_0xae0f('0x7')]=_[_0xae0f('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xae0f('0x9'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require(_0xae0f('0xa'));var mailAccount=require(_0xae0f('0xb'));var md5Accounts={};function EmailChannel(_0x2a38cd){logger[_0xae0f('0xc')](_0xae0f('0xd'));this[_0xae0f('0xe')]=_0x2a38cd[_0xae0f('0xe')];this[_0xae0f('0xf')]={};this[_0xae0f('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0xae0f('0x11')]=function(_0x4de74d){var _0x2a8433=this[_0xae0f('0xe')][_0x4de74d];var _0x193b02={'id':_0x2a8433['id'],'name':_0x2a8433['name'],'key':_0x2a8433[_0xae0f('0x12')],'active':_0x2a8433[_0xae0f('0x13')],'Imap':{'status':_0x2a8433[_0xae0f('0x14')][_0xae0f('0x15')],'messageStatus':_0x2a8433['Imap'][_0xae0f('0x16')],'total':_0x2a8433['Imap']['total']}};if(_[_0xae0f('0x17')](md5Accounts[_0x4de74d])){md5Accounts[_0x4de74d]={};}var _0x9bd453=md5(JSON['stringify'](_0x193b02));if(md5Accounts[_0x4de74d][_0xae0f('0x3')]!==_0x9bd453){md5Accounts[_0x4de74d][_0xae0f('0x3')]=_0x9bd453;io[_0xae0f('0x11')]('mailAccount:update',_0x193b02);}};EmailChannel[_0xae0f('0x18')]['refresh']=function(_0x26f3f3){for(var _0x49b6c6 in _0x26f3f3){if(_0x26f3f3[_0xae0f('0x19')](_0x49b6c6)){if(_0x26f3f3[_0x49b6c6][_0xae0f('0x14')]&&_0x26f3f3[_0x49b6c6]['active']){var _0x350a88=_0x26f3f3[_0x49b6c6][_0xae0f('0x14')];if(!_0x350a88[_0xae0f('0x1a')]&&_0x26f3f3[_0x49b6c6][_0xae0f('0x1b')]!==_0xae0f('0x1c'))_0x350a88[_0xae0f('0x1a')]=_0x26f3f3[_0x49b6c6][_0xae0f('0x1b')];if(!this[_0xae0f('0xf')][_0xae0f('0x19')](_0x350a88['id'])){this[_0xae0f('0xf')][_0x350a88['id']]=new EmailImap(_0x350a88,_0x26f3f3[_0x49b6c6][_0xae0f('0x1d')]);this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x1e'),this[_0xae0f('0x1f')][_0xae0f('0x20')](this,_0x49b6c6));this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x1d'),this[_0xae0f('0x21')]['bind'](this,_0x49b6c6));this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x22'),this[_0xae0f('0x23')][_0xae0f('0x20')](this,_0x49b6c6));this[_0xae0f('0xf')][_0x350a88['id']]['on'](_0xae0f('0x24'),this[_0xae0f('0x25')][_0xae0f('0x20')](this,_0x49b6c6));}}else{if(_[_0xae0f('0x17')](this[_0xae0f('0xe')][_0x49b6c6][_0xae0f('0x14')])){this['mailAccounts'][_0x49b6c6][_0xae0f('0x14')]={};}this[_0xae0f('0xe')][_0x49b6c6][_0xae0f('0x14')][_0xae0f('0x15')]=_0xae0f('0x26');this[_0xae0f('0xe')][_0x49b6c6]['Imap'][_0xae0f('0x16')]='';this[_0xae0f('0x11')](_0x49b6c6);}}}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x1f')]=function(_0x47a242,_0x1c2634){if(this[_0xae0f('0xe')][_0x47a242]){this[_0xae0f('0xe')][_0x47a242][_0xae0f('0x14')][_0xae0f('0x15')]=_0xae0f('0x27');this['mailAccounts'][_0x47a242][_0xae0f('0x14')][_0xae0f('0x16')]=_0x1c2634[_0xae0f('0x28')];if(_0x1c2634['messages']){this[_0xae0f('0xe')][_0x47a242][_0xae0f('0x14')]['total']=_0x1c2634['messages'][_0xae0f('0x29')];}return this[_0xae0f('0x11')](_0x47a242);}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x21')]=function(_0x2c5aa0,_0x6816d0){logger[_0xae0f('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x6816d0[_0xae0f('0x2a')],_0x6816d0[_0xae0f('0x2b')],_0x6816d0[_0xae0f('0x2c')],_0x2c5aa0);if(this[_0xae0f('0xe')][_0x2c5aa0]){return mailAccount[_0xae0f('0x2d')](_0x2c5aa0,_0x6816d0)['then'](function(_0x19e86a){if(_0x19e86a){logger[_0xae0f('0xc')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0xfe4210){logger[_0xae0f('0x24')](_0xae0f('0x2e'),JSON['stringify'](_0xfe4210));});}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x23')]=function(_0x259383){if(this['mailAccounts'][_0x259383]&&this[_0xae0f('0xe')][_0x259383][_0xae0f('0x14')]){if(this['imapAccounts'][this[_0xae0f('0xe')][_0x259383]['Imap']['id']]){delete this[_0xae0f('0xf')][this['mailAccounts'][_0x259383][_0xae0f('0x14')]['id']];}this['mailAccounts'][_0x259383]['Imap'][_0xae0f('0x2f')]=moment();this[_0xae0f('0x11')](_0x259383);}};EmailChannel['prototype'][_0xae0f('0x25')]=function(_0x4a5e30,_0x40be39){if(this['mailAccounts'][_0x4a5e30]){this['mailAccounts'][_0x4a5e30][_0xae0f('0x14')][_0xae0f('0x15')]=_0xae0f('0x24');this['mailAccounts'][_0x4a5e30][_0xae0f('0x14')][_0xae0f('0x16')]=_0x40be39;return this['emit'](_0x4a5e30);}};EmailChannel[_0xae0f('0x18')][_0xae0f('0x30')]=function(_0x233262,_0x16f0a0){return this[_0xae0f('0x10')][_0xae0f('0x31')](_0x233262,_0x16f0a0);};EmailChannel[_0xae0f('0x18')][_0xae0f('0x32')]=function(_0x34a603){var _0x2d178d=this;if(this[_0xae0f('0xe')][_0x34a603['id']]){if(_[_0xae0f('0x17')](this['mailAccounts'][_0x34a603['id']]['Smtp'])){this[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')]={};}this[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x2f')]=moment();return new BPromise(function(_0x1777a9,_0x50f058){return _0x2d178d[_0xae0f('0x10')]['verify'](_0x34a603)[_0xae0f('0x34')](function(_0x1e53c8){_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x15')]='verified';_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x16')]='';_0x2d178d[_0xae0f('0x11')](_0x34a603['id']);_0x1777a9(_0x1e53c8);})['catch'](function(_0x37221f){_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')][_0xae0f('0x15')]='error';_0x2d178d[_0xae0f('0xe')][_0x34a603['id']][_0xae0f('0x33')]['messageStatus']=_0x37221f;_0x2d178d['emit'](_0x34a603['id']);_0x50f058(_0x37221f);});});}return this[_0xae0f('0x10')][_0xae0f('0x35')](_0x34a603);};module[_0xae0f('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 0cd6028..c278f52 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 _0x9db5=['bind','end','handleEnd','error','handleError','inherits','connTimeout','authTimeout','user','xoauth2','generateXOAuth2Token','password','anonymous@xcally.com','tls','autotls','required','prototype','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','parser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9db5,0x113));var _0x59db=function(_0x4e5e7b,_0x444760){_0x4e5e7b=_0x4e5e7b-0x0;var _0x2831b7=_0x9db5[_0x4e5e7b];return _0x2831b7;};'use strict';var _=require(_0x59db('0x0'));var util=require('util');var Imap=require(_0x59db('0x1'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x59db('0x2'))[_0x59db('0x3')];var EventEmitter=require(_0x59db('0x4'))[_0x59db('0x5')];var utils=require(_0x59db('0x6'));var logger=require(_0x59db('0x7'))(_0x59db('0x8'));function EmailImap(_0x2e4c6c,_0x3ca9fe){this[_0x59db('0x9')]=_0x2e4c6c[_0x59db('0x9')];this[_0x59db('0xa')]=this[_0x59db('0xb')](_0x2e4c6c,_0x3ca9fe);this[_0x59db('0x1')]=new Imap(this['account']);this[_0x59db('0x1')][_0x59db('0xc')](_0x59db('0xd'),this[_0x59db('0xe')][_0x59db('0xf')](this));this[_0x59db('0x1')]['once'](_0x59db('0x10'),this[_0x59db('0x11')]['bind'](this));this[_0x59db('0x1')]['on'](_0x59db('0x12'),this[_0x59db('0x13')]['bind'](this));this[_0x59db('0x1')]['connect']();}util[_0x59db('0x14')](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x39b5ff,_0x46c5b7){var _0xd31f58={'connTimeout':_0x39b5ff[_0x59db('0x15')]?_0x39b5ff[_0x59db('0x15')]*0x3e8:0x2710,'authTimeout':_0x39b5ff[_0x59db('0x16')]?_0x39b5ff[_0x59db('0x16')]*0x3e8:0x1388};if(_0x39b5ff['service']){_0xd31f58['user']=_0x39b5ff[_0x59db('0x17')];if(_0x39b5ff['modernAuthentication']){_0xd31f58[_0x59db('0x18')]=utils[_0x59db('0x19')](_0x39b5ff['CloudProvider']['data5'],_0x39b5ff['user']);}else{_0xd31f58[_0x59db('0x1a')]=_0x39b5ff['password'];}}else{if(_0x39b5ff['authentication']){_0xd31f58[_0x59db('0x17')]=_0x39b5ff[_0x59db('0x17')];_0xd31f58[_0x59db('0x1a')]=_0x39b5ff[_0x59db('0x1a')];}}_0xd31f58[_0x59db('0x8')]=_0x46c5b7||_0x39b5ff[_0x59db('0x17')]||_0x59db('0x1b');_0xd31f58['host']=_0x39b5ff['host'];_0xd31f58['port']=_0x39b5ff['port']||0x3e1;if(_0x39b5ff[_0x59db('0x1c')]){_0xd31f58[_0x59db('0x1c')]=!![];}else{_0xd31f58[_0x59db('0x1c')]=![];_0xd31f58[_0x59db('0x1d')]=_0x59db('0x1e');}return _0xd31f58;};EmailImap[_0x59db('0x1f')]['handleReady']=function(){this[_0x59db('0x1')][_0x59db('0x20')](this[_0x59db('0x9')],![],this[_0x59db('0x21')][_0x59db('0xf')](this));};EmailImap['prototype'][_0x59db('0x21')]=function(_0x5408ae,_0xb0abb8){if(_0x5408ae){this[_0x59db('0x13')](_0x5408ae,!![]);}else{this['emit'](_0x59db('0x22'),_0xb0abb8);this[_0x59db('0x23')]();}};EmailImap[_0x59db('0x1f')][_0x59db('0x24')]=function(_0x121866){if(_0x121866){this[_0x59db('0x13')](_0x121866,!![]);}else{this['imap'][_0x59db('0x10')]();}};EmailImap['prototype'][_0x59db('0x23')]=function(){this[_0x59db('0x1')][_0x59db('0x25')](['UNSEEN'],this[_0x59db('0x26')]['bind'](this));};EmailImap['prototype'][_0x59db('0x26')]=function(_0x1be17e,_0x4e912b){if(_0x1be17e){this[_0x59db('0x13')](_0x1be17e,!![]);}else{if(_0x4e912b[_0x59db('0x27')]){try{var _0x33a760=this[_0x59db('0x1')][_0x59db('0x28')](_0x4e912b,{'bodies':'','markSeen':!![]});_0x33a760['on'](_0x59db('0x29'),this['handleFetchMessage'][_0x59db('0xf')](this));_0x33a760[_0x59db('0xc')](_0x59db('0x12'),this[_0x59db('0x2a')]['bind'](this));_0x33a760[_0x59db('0xc')](_0x59db('0x10'),this[_0x59db('0x2b')][_0x59db('0xf')](this));}catch(_0x321dee){logger[_0x59db('0x12')](_0x321dee);}}else{this[_0x59db('0x1')][_0x59db('0x2c')](!![],this[_0x59db('0x24')][_0x59db('0xf')](this));}}};EmailImap[_0x59db('0x1f')][_0x59db('0x2d')]=function(_0x48c6e1){_0x48c6e1['on'](_0x59db('0x2e'),this[_0x59db('0x2f')][_0x59db('0xf')](this));_0x48c6e1[_0x59db('0xc')](_0x59db('0x30'),this['handleMessageAttributes'][_0x59db('0xf')](this));_0x48c6e1[_0x59db('0xc')](_0x59db('0x10'),this[_0x59db('0x31')]['bind'](this));};EmailImap[_0x59db('0x1f')]['handleMessageBody']=function(_0x1a1339){simpleParser(_0x1a1339,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x59db('0x1f')][_0x59db('0x32')]=function(){};EmailImap[_0x59db('0x1f')][_0x59db('0x31')]=function(){};EmailImap[_0x59db('0x1f')]['handleSimpleParser']=function(_0x3b6315,_0x5b2490){if(_0x3b6315){logger['error'](_0x3b6315);}else{var _0x9dfee2=this;utils[_0x59db('0x33')](this[_0x59db('0xa')],_0x5b2490,function(_0x20425a){_0x9dfee2[_0x59db('0x34')]('email',_0x20425a);});}};EmailImap[_0x59db('0x1f')][_0x59db('0x2b')]=function(){this[_0x59db('0x1')]['closeBox'](!![],this[_0x59db('0x24')][_0x59db('0xf')](this));};EmailImap[_0x59db('0x1f')][_0x59db('0x2a')]=function(_0x587fdc){this['handleError'](_0x587fdc);this[_0x59db('0x1')][_0x59db('0x2c')](!![],this[_0x59db('0x24')][_0x59db('0xf')](this));};EmailImap['prototype'][_0x59db('0x11')]=function(){this[_0x59db('0x34')](_0x59db('0x10'));};EmailImap[_0x59db('0x1f')]['handleError']=function(_0x2cb959,_0x38a3de){logger[_0x59db('0x12')](_0x59db('0x13'),this[_0x59db('0xa')][_0x59db('0x8')],JSON[_0x59db('0x35')](_0x2cb959));var _0x34e36d='';if(_0x2cb959){if(_0x2cb959[_0x59db('0x36')]){_0x34e36d=_0x2cb959['textCode'];}else{for(var _0x448030 in _0x2cb959){if(_0x2cb959[_0x59db('0x37')](_0x448030)){_0x34e36d+=_[_0x59db('0x38')](_0x448030)+':\x20'+_0x2cb959[_0x448030]+'\x0a';}}}}if(_0x38a3de){this[_0x59db('0x1')][_0x59db('0x10')]();}else{this[_0x59db('0x34')](_0x59db('0x12'),_0x34e36d);this[_0x59db('0x34')](_0x59db('0x10'));}};module[_0x59db('0x39')]=EmailImap; \ No newline at end of file +var _0xb1c7=['stringify','textCode','hasOwnProperty','lodash','util','imap','mailparser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','account','getAccount','ready','handleReady','once','end','handleEnd','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser'];(function(_0x55046e,_0x172d80){var _0x2b7ac3=function(_0x533cab){while(--_0x533cab){_0x55046e['push'](_0x55046e['shift']());}};_0x2b7ac3(++_0x172d80);}(_0xb1c7,0x183));var _0x7b1c=function(_0x560d2a,_0x4a9f54){_0x560d2a=_0x560d2a-0x0;var _0x3df62d=_0xb1c7[_0x560d2a];return _0x3df62d;};'use strict';var _=require(_0x7b1c('0x0'));var util=require(_0x7b1c('0x1'));var Imap=require(_0x7b1c('0x2'));var simpleParser=require(_0x7b1c('0x3'))['simpleParser'];var Iconv=require(_0x7b1c('0x4'))[_0x7b1c('0x5')];var EventEmitter=require(_0x7b1c('0x6'))[_0x7b1c('0x7')];var utils=require('./utils');var logger=require(_0x7b1c('0x8'))('email');function EmailImap(_0x4a02b4,_0x2116d3){this[_0x7b1c('0x9')]=_0x4a02b4[_0x7b1c('0x9')];this[_0x7b1c('0xa')]=this[_0x7b1c('0xb')](_0x4a02b4,_0x2116d3);this[_0x7b1c('0x2')]=new Imap(this[_0x7b1c('0xa')]);this[_0x7b1c('0x2')]['once'](_0x7b1c('0xc'),this[_0x7b1c('0xd')]['bind'](this));this[_0x7b1c('0x2')][_0x7b1c('0xe')](_0x7b1c('0xf'),this[_0x7b1c('0x10')][_0x7b1c('0x11')](this));this[_0x7b1c('0x2')]['on'](_0x7b1c('0x12'),this[_0x7b1c('0x13')][_0x7b1c('0x11')](this));this[_0x7b1c('0x2')][_0x7b1c('0x14')]();}util[_0x7b1c('0x15')](EmailImap,EventEmitter);EmailImap[_0x7b1c('0x16')][_0x7b1c('0xb')]=function(_0x5eebb3,_0x547009){var _0x826363={'connTimeout':_0x5eebb3['connTimeout']?_0x5eebb3[_0x7b1c('0x17')]*0x3e8:0x2710,'authTimeout':_0x5eebb3['authTimeout']?_0x5eebb3[_0x7b1c('0x18')]*0x3e8:0x1388};if(_0x5eebb3[_0x7b1c('0x19')]){_0x826363['user']=_0x5eebb3[_0x7b1c('0x1a')];if(_0x5eebb3[_0x7b1c('0x1b')]){_0x826363[_0x7b1c('0x1c')]=utils[_0x7b1c('0x1d')](_0x5eebb3['CloudProvider'][_0x7b1c('0x1e')],_0x5eebb3[_0x7b1c('0x1a')]);}else{_0x826363[_0x7b1c('0x1f')]=_0x5eebb3[_0x7b1c('0x1f')];}}else{if(_0x5eebb3[_0x7b1c('0x20')]){_0x826363[_0x7b1c('0x1a')]=_0x5eebb3[_0x7b1c('0x1a')];_0x826363['password']=_0x5eebb3[_0x7b1c('0x1f')];}}_0x826363[_0x7b1c('0x21')]=_0x547009||_0x5eebb3[_0x7b1c('0x1a')]||_0x7b1c('0x22');_0x826363[_0x7b1c('0x23')]=_0x5eebb3['host'];_0x826363[_0x7b1c('0x24')]=_0x5eebb3[_0x7b1c('0x24')]||0x3e1;if(_0x5eebb3[_0x7b1c('0x25')]){_0x826363[_0x7b1c('0x25')]=!![];}else{_0x826363[_0x7b1c('0x25')]=![];_0x826363[_0x7b1c('0x26')]=_0x7b1c('0x27');}return _0x826363;};EmailImap[_0x7b1c('0x16')]['handleReady']=function(){this[_0x7b1c('0x2')][_0x7b1c('0x28')](this[_0x7b1c('0x9')],![],this[_0x7b1c('0x29')][_0x7b1c('0x11')](this));};EmailImap['prototype'][_0x7b1c('0x29')]=function(_0x1ed593,_0x45f4d2){if(_0x1ed593){this['handleError'](_0x1ed593,!![]);}else{this[_0x7b1c('0x2a')](_0x7b1c('0x2b'),_0x45f4d2);this[_0x7b1c('0x2c')]();}};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x2d')]=function(_0xdcf679){if(_0xdcf679){this['handleError'](_0xdcf679,!![]);}else{this[_0x7b1c('0x2')][_0x7b1c('0xf')]();}};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x2c')]=function(){this[_0x7b1c('0x2')][_0x7b1c('0x2e')](['UNSEEN'],this[_0x7b1c('0x2f')][_0x7b1c('0x11')](this));};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x2f')]=function(_0xe28f9e,_0x330ff6){if(_0xe28f9e){this[_0x7b1c('0x13')](_0xe28f9e,!![]);}else{if(_0x330ff6[_0x7b1c('0x30')]){try{var _0x33e355=this[_0x7b1c('0x2')]['fetch'](_0x330ff6,{'bodies':'','markSeen':!![]});_0x33e355['on'](_0x7b1c('0x31'),this[_0x7b1c('0x32')][_0x7b1c('0x11')](this));_0x33e355[_0x7b1c('0xe')](_0x7b1c('0x12'),this[_0x7b1c('0x33')][_0x7b1c('0x11')](this));_0x33e355[_0x7b1c('0xe')](_0x7b1c('0xf'),this[_0x7b1c('0x34')][_0x7b1c('0x11')](this));}catch(_0x246e49){logger['error'](_0x246e49);}}else{this['imap'][_0x7b1c('0x35')](!![],this[_0x7b1c('0x2d')][_0x7b1c('0x11')](this));}}};EmailImap[_0x7b1c('0x16')]['handleFetchMessage']=function(_0xbe663){_0xbe663['on'](_0x7b1c('0x36'),this[_0x7b1c('0x37')]['bind'](this));_0xbe663[_0x7b1c('0xe')](_0x7b1c('0x38'),this['handleMessageAttributes'][_0x7b1c('0x11')](this));_0xbe663['once']('end',this[_0x7b1c('0x39')][_0x7b1c('0x11')](this));};EmailImap[_0x7b1c('0x16')]['handleMessageBody']=function(_0x3f510f){simpleParser(_0x3f510f,{'Iconv':Iconv},this['handleSimpleParser'][_0x7b1c('0x11')](this));};EmailImap['prototype'][_0x7b1c('0x3a')]=function(){};EmailImap['prototype'][_0x7b1c('0x39')]=function(){};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x3b')]=function(_0x535687,_0x223ae3){if(_0x535687){logger['error'](_0x535687);}else{var _0x222a5f=this;utils[_0x7b1c('0x3c')](this[_0x7b1c('0xa')],_0x223ae3,function(_0x5dc215){_0x222a5f['emit'](_0x7b1c('0x21'),_0x5dc215);});}};EmailImap[_0x7b1c('0x16')][_0x7b1c('0x34')]=function(){this[_0x7b1c('0x2')][_0x7b1c('0x35')](!![],this[_0x7b1c('0x2d')]['bind'](this));};EmailImap['prototype']['handleFetchError']=function(_0x5ce747){this[_0x7b1c('0x13')](_0x5ce747);this[_0x7b1c('0x2')][_0x7b1c('0x35')](!![],this[_0x7b1c('0x2d')][_0x7b1c('0x11')](this));};EmailImap['prototype'][_0x7b1c('0x10')]=function(){this[_0x7b1c('0x2a')](_0x7b1c('0xf'));};EmailImap['prototype'][_0x7b1c('0x13')]=function(_0x500202,_0x36e043){logger[_0x7b1c('0x12')](_0x7b1c('0x13'),this[_0x7b1c('0xa')][_0x7b1c('0x21')],JSON[_0x7b1c('0x3d')](_0x500202));var _0x2f743f='';if(_0x500202){if(_0x500202['textCode']){_0x2f743f=_0x500202[_0x7b1c('0x3e')];}else{for(var _0x4db6bd in _0x500202){if(_0x500202[_0x7b1c('0x3f')](_0x4db6bd)){_0x2f743f+=_['upperFirst'](_0x4db6bd)+':\x20'+_0x500202[_0x4db6bd]+'\x0a';}}}}if(_0x36e043){this[_0x7b1c('0x2')][_0x7b1c('0xf')]();}else{this['emit']('error',_0x2f743f);this['emit'](_0x7b1c('0xf'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6d23383..a1c3bb7 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 _0x24f7=['sendMail','toString','prototype','verify','exports','nodemailer-plugin-inline-base64','send','createTransport','use','compile'];(function(_0x34e40f,_0x2e3780){var _0x3e5246=function(_0x7970ea){while(--_0x7970ea){_0x34e40f['push'](_0x34e40f['shift']());}};_0x3e5246(++_0x2e3780);}(_0x24f7,0x19f));var _0x724f=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x24f7[_0x27af45];return _0x18df21;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0x724f('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x724f('0x1')]=function(_0x1e2ecb,_0x18cd48){return new Promise(function(_0x4f5015,_0x47b00f){var _0x2c3d9a=nodemailer[_0x724f('0x2')](_0x1e2ecb);_0x2c3d9a[_0x724f('0x3')](_0x724f('0x4'),inlineBase64());_0x2c3d9a[_0x724f('0x5')](_0x18cd48,function(_0x290e32,_0x597dcb){if(_0x290e32){_0x47b00f(_0x290e32[_0x724f('0x6')]());}else{_0x4f5015(_0x597dcb);}});});};EmailSmtp[_0x724f('0x7')][_0x724f('0x8')]=function(_0x3f9710){return new Promise(function(_0x2f7a55,_0x24f11a){var _0x1ae2e2=nodemailer['createTransport'](_0x3f9710);_0x1ae2e2[_0x724f('0x8')](function(_0x235f5c,_0x2087a2){if(_0x235f5c){_0x24f11a(_0x235f5c[_0x724f('0x6')]());}else{if(_0x2087a2){_0x2f7a55(_0x2087a2);}else{_0x24f11a('Not\x20verifired');}}});});};module[_0x724f('0x9')]=EmailSmtp; \ No newline at end of file +var _0x9c41=['toString','verify','Not\x20verifired','exports','nodemailer','prototype','createTransport','use','compile','sendMail'];(function(_0x522d5e,_0x15761c){var _0x100da0=function(_0x16a655){while(--_0x16a655){_0x522d5e['push'](_0x522d5e['shift']());}};_0x100da0(++_0x15761c);}(_0x9c41,0x68));var _0x19c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c41[_0x14add3];return _0x4a174f;};'use strict';var nodemailer=require(_0x19c4('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x19c4('0x1')]['send']=function(_0x1005c8,_0x56e25d){return new Promise(function(_0x25ec43,_0x47857e){var _0x3d3766=nodemailer[_0x19c4('0x2')](_0x1005c8);_0x3d3766[_0x19c4('0x3')](_0x19c4('0x4'),inlineBase64());_0x3d3766[_0x19c4('0x5')](_0x56e25d,function(_0x3cfe3b,_0x43fb68){if(_0x3cfe3b){_0x47857e(_0x3cfe3b[_0x19c4('0x6')]());}else{_0x25ec43(_0x43fb68);}});});};EmailSmtp[_0x19c4('0x1')][_0x19c4('0x7')]=function(_0x1caa56){return new Promise(function(_0x5e993f,_0x3b47ce){var _0x3e4afa=nodemailer['createTransport'](_0x1caa56);_0x3e4afa[_0x19c4('0x7')](function(_0x55c2e8,_0x5a42a3){if(_0x55c2e8){_0x3b47ce(_0x55c2e8[_0x19c4('0x6')]());}else{if(_0x5a42a3){_0x5e993f(_0x5a42a3);}else{_0x3b47ce(_0x19c4('0x8'));}}});});};module[_0x19c4('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 30b4bae..7e24d23 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 _0xfce6=['Data','generateXOAuth2Token','auth=Bearer\x20','utf-8','base64','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','isEmpty','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title'];(function(_0x33a5ec,_0x10c014){var _0x38f89c=function(_0x15f7ee){while(--_0x15f7ee){_0x33a5ec['push'](_0x33a5ec['shift']());}};_0x38f89c(++_0x10c014);}(_0xfce6,0xd7));var _0x6fce=function(_0x38806d,_0x176c25){_0x38806d=_0x38806d-0x0;var _0x235ec0=_0xfce6[_0x38806d];return _0x235ec0;};'use strict';var _=require(_0x6fce('0x0'));var moment=require('moment');var random=require(_0x6fce('0x1'));var fs=require('fs');var path=require(_0x6fce('0x2'));var util=require(_0x6fce('0x3'));var tnef=require(_0x6fce('0x4'));var logger=require(_0x6fce('0x5'))(_0x6fce('0x6'));var config=require(_0x6fce('0x7'));function getAddress(_0x18efed){var _0x10506e=_[_0x6fce('0x8')](_0x18efed[_0x6fce('0x9')]);return _0x10506e&&_0x10506e[_0x6fce('0xa')]?_0x10506e[_0x6fce('0xa')]:_0x6fce('0xb')+random[_0x6fce('0xc')](0x6)+_0x6fce('0xd');}function getFirstName(_0x479834){var _0x12d043=_[_0x6fce('0x8')](_0x479834['value']);if(_0x12d043&&_0x12d043[_0x6fce('0xe')]){if(_0x12d043[_0x6fce('0xe')]==_0x12d043[_0x6fce('0xa')]){return _0x12d043[_0x6fce('0xe')][_0x6fce('0xf')](0x0,_0x12d043[_0x6fce('0xe')][_0x6fce('0x10')]('@'));}var _0x21a264=_0x12d043['name'][_0x6fce('0x11')](/\s+/);return _0x21a264[_0x6fce('0x12')]>0x1?_0x21a264[_0x6fce('0x13')](0x0,-0x1)['join']('\x20'):_0x12d043[_0x6fce('0xe')];}return'Anonymous';}function getLastName(_0x426f7e){var _0x5f42bf=_[_0x6fce('0x8')](_0x426f7e['value']);if(_0x5f42bf&&_0x5f42bf[_0x6fce('0xe')]){var _0x23baef=_0x5f42bf['name'][_0x6fce('0x11')](/\s+/);return _0x23baef[_0x6fce('0x12')]>0x1?_0x23baef['pop']():'';}return'';}function getMails(_0x2c7b4e,_0x481928){var _0x4a5d95='';for(var _0x4182a3=0x0;_0x4182a3<_0x481928[_0x6fce('0x9')][_0x6fce('0x12')];_0x4182a3+=0x1){if(_0x481928['value'][_0x4182a3][_0x6fce('0xa')]!==_0x2c7b4e){if(!_[_0x6fce('0x14')](_0x4a5d95)){_0x4a5d95+=',';}_0x4a5d95+=_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xe')]||_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xa')]||'';_0x4a5d95+='\x20<';_0x4a5d95+=_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xa')]?_0x481928[_0x6fce('0x9')][_0x4182a3][_0x6fce('0xa')]:'anonymous'+random[_0x6fce('0xc')](0x6)+_0x6fce('0xd');_0x4a5d95+='>';}}return _0x4a5d95;}function parseEmail(_0x11d76a,_0x4dd695,_0x5556d3){if(_0x4dd695[_0x6fce('0x15')]){var _0x554b57=/)<[^<]*)*<\/script>/gi;while(_0x554b57[_0x6fce('0x16')](_0x4dd695[_0x6fce('0x15')])){_0x4dd695[_0x6fce('0x15')]=_0x4dd695[_0x6fce('0x15')][_0x6fce('0x17')](_0x554b57,'');}if(_0x4dd695['html'][_0x6fce('0x18')](_0x6fce('0x19'))){var _0x3e6ee9=[];_0x4dd695[_0x6fce('0x1a')]['forEach'](_0x2d81cb=>{_0x3e6ee9[_0x6fce('0x1b')](_0x2d81cb[_0x6fce('0x1c')]);});var _0x5e3ec3=/]+>/g;var _0x42035b=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xbd6c40=_0x4dd695[_0x6fce('0x15')][_0x6fce('0x17')](_0x42035b,_0x6fce('0x1d'));var _0x1d4f7a=_0xbd6c40[_0x6fce('0x17')](_0x5e3ec3,_0x6fce('0x1e'));for(let _0xcfee47=0x0;_0xcfee47<_0x3e6ee9[_0x6fce('0x12')];_0xcfee47++){var _0x553ded=_0x1d4f7a['replace'](_0x6fce('0x1e'),_0x6fce('0x1f')+_0x3e6ee9[_0xcfee47]+_0x6fce('0x20'));_0x1d4f7a=_0x553ded;}_0x4dd695[_0x6fce('0x15')]=_0x1d4f7a;}_0x5556d3[_0x6fce('0x21')]=_0x4dd695[_0x6fce('0x15')];}else{_0x5556d3[_0x6fce('0x21')]=_0x4dd695[_0x6fce('0x22')];}if(_0x5556d3[_0x6fce('0x21')]){_0x5556d3[_0x6fce('0x21')]=_0x5556d3[_0x6fce('0x21')][_0x6fce('0x17')](/0x0){var _0x113190=[_0x6fce('0x30'),_0x6fce('0x31'),'Precedence:\x20auto_reply'];for(var _0x13fc25=0x0;_0x13fc25<_0x4dd695['headerLines'][_0x6fce('0x12')];_0x13fc25++){var _0x160ce6=_[_0x6fce('0x10')](_0x113190,_0x4dd695[_0x6fce('0x2f')][_0x13fc25][_0x6fce('0x32')]);if(_0x160ce6>=0x0){_0x5556d3['isAutoreply']=!![];}}}return _0x5556d3;}exports[_0x6fce('0x33')]=function(_0x12bef8,_0x4f8cb1,_0x46db40){var _0x1c56b1={'from':getAddress(_0x4f8cb1[_0x6fce('0x34')]),'firstName':getFirstName(_0x4f8cb1[_0x6fce('0x34')]),'lastName':getLastName(_0x4f8cb1['from']),'mapKey':_0x6fce('0x6'),'message':{'from':getMails(_0x12bef8[_0x6fce('0x6')],_0x4f8cb1[_0x6fce('0x34')]),'to':_0x12bef8[_0x6fce('0x6')],'cc':'','subject':_0x4f8cb1[_0x6fce('0x35')]||'','messageId':_0x4f8cb1[_0x6fce('0x36')],'inReplyTo':_0x4f8cb1[_0x6fce('0x37')],'sentAt':moment(_0x4f8cb1[_0x6fce('0x38')])[_0x6fce('0x28')](_0x6fce('0x39')),'attach':![],'attachments':[]}};if(!_0x4f8cb1[_0x6fce('0x15')]&&!_0x4f8cb1[_0x6fce('0x22')]){var _0x3ff4c2=_['filter'](_0x4f8cb1[_0x6fce('0x1a')],{'contentType':'application/ms-tnef'});if(_0x3ff4c2[_0x6fce('0x12')]){logger[_0x6fce('0x3a')](util[_0x6fce('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x4f8cb1[_0x6fce('0x36')]));tnef[_0x6fce('0x3b')](_[_0x6fce('0x3c')](_0x3ff4c2)[_0x6fce('0x2e')],function(_0x2aa4ba,_0x1b03e1){if(_0x1b03e1){_0x4f8cb1['html']=_0x1b03e1[_0x6fce('0x3d')]||_0x6fce('0x3e');if(_0x1b03e1[_0x6fce('0x3f')]){for(var _0x14b0f4=0x0;_0x14b0f4<_0x1b03e1['Attachments'][_0x6fce('0x12')];_0x14b0f4++){var _0x205a6a=_0x1b03e1[_0x6fce('0x3f')][_0x14b0f4];_0x1c56b1[_0x6fce('0x24')][_0x6fce('0x1a')]['push']({'filename':_0x205a6a[_0x6fce('0x40')],'content':Buffer[_0x6fce('0x34')](_0x205a6a[_0x6fce('0x41')])});}}}_0x46db40(parseEmail(_0x12bef8,_0x4f8cb1,_0x1c56b1));});}else{_0x4f8cb1[_0x6fce('0x15')]=_0x6fce('0x3e');_0x46db40(parseEmail(_0x12bef8,_0x4f8cb1,_0x1c56b1));}}else{_0x46db40(parseEmail(_0x12bef8,_0x4f8cb1,_0x1c56b1));}};exports[_0x6fce('0x42')]=function(_0x4b4b80,_0x3af264){var _0x45fb86=['user='+(_0x3af264||''),_0x6fce('0x43')+_0x4b4b80,'',''];return Buffer[_0x6fce('0x34')](_0x45fb86[_0x6fce('0x2a')](''),_0x6fce('0x44'))['toString'](_0x6fce('0x45'));}; \ No newline at end of file +var _0x51e3=['_IMG','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','util','node-tnef','address','anonymous','generate','value','name','substring','indexOf','split','length','head','pop','isEmpty','html','test','replace','includes','attachments','push','filename','_SRC'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x51e3,0x1c4));var _0x351e=function(_0x178be5,_0x4b34ab){_0x178be5=_0x178be5-0x0;var _0x447763=_0x51e3[_0x178be5];return _0x447763;};'use strict';var _=require(_0x351e('0x0'));var moment=require(_0x351e('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x351e('0x2'));var tnef=require(_0x351e('0x3'));var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x10884b){var _0x1acd66=_['head'](_0x10884b['value']);return _0x1acd66&&_0x1acd66[_0x351e('0x4')]?_0x1acd66['address']:_0x351e('0x5')+random[_0x351e('0x6')](0x6)+'@xcally.com';}function getFirstName(_0x2c0a12){var _0x11d559=_['head'](_0x2c0a12[_0x351e('0x7')]);if(_0x11d559&&_0x11d559[_0x351e('0x8')]){if(_0x11d559[_0x351e('0x8')]==_0x11d559[_0x351e('0x4')]){return _0x11d559[_0x351e('0x8')][_0x351e('0x9')](0x0,_0x11d559['name'][_0x351e('0xa')]('@'));}var _0x262ed1=_0x11d559[_0x351e('0x8')][_0x351e('0xb')](/\s+/);return _0x262ed1[_0x351e('0xc')]>0x1?_0x262ed1['slice'](0x0,-0x1)['join']('\x20'):_0x11d559['name'];}return'Anonymous';}function getLastName(_0x9bbc6c){var _0xa71fde=_[_0x351e('0xd')](_0x9bbc6c['value']);if(_0xa71fde&&_0xa71fde[_0x351e('0x8')]){var _0x5b2e05=_0xa71fde[_0x351e('0x8')]['split'](/\s+/);return _0x5b2e05[_0x351e('0xc')]>0x1?_0x5b2e05[_0x351e('0xe')]():'';}return'';}function getMails(_0x1e93e3,_0x2e5b05){var _0xcc9b66='';for(var _0x2a2bc8=0x0;_0x2a2bc8<_0x2e5b05[_0x351e('0x7')][_0x351e('0xc')];_0x2a2bc8+=0x1){if(_0x2e5b05['value'][_0x2a2bc8][_0x351e('0x4')]!==_0x1e93e3){if(!_[_0x351e('0xf')](_0xcc9b66)){_0xcc9b66+=',';}_0xcc9b66+=_0x2e5b05[_0x351e('0x7')][_0x2a2bc8][_0x351e('0x8')]||_0x2e5b05[_0x351e('0x7')][_0x2a2bc8]['address']||'';_0xcc9b66+='\x20<';_0xcc9b66+=_0x2e5b05[_0x351e('0x7')][_0x2a2bc8][_0x351e('0x4')]?_0x2e5b05['value'][_0x2a2bc8]['address']:_0x351e('0x5')+random[_0x351e('0x6')](0x6)+'@xcally.com';_0xcc9b66+='>';}}return _0xcc9b66;}function parseEmail(_0x3eed77,_0x4c9aa7,_0x2923d6){if(_0x4c9aa7[_0x351e('0x10')]){var _0x2f33e8=/)<[^<]*)*<\/script>/gi;while(_0x2f33e8[_0x351e('0x11')](_0x4c9aa7['html'])){_0x4c9aa7[_0x351e('0x10')]=_0x4c9aa7[_0x351e('0x10')][_0x351e('0x12')](_0x2f33e8,'');}if(_0x4c9aa7[_0x351e('0x10')][_0x351e('0x13')]('{_0x472343[_0x351e('0x15')](_0x41823f[_0x351e('0x16')]);});var _0x494949=/]+>/g;var _0x2e99d2=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x34ab88=_0x4c9aa7[_0x351e('0x10')][_0x351e('0x12')](_0x2e99d2,_0x351e('0x17'));var _0x5db4c3=_0x34ab88[_0x351e('0x12')](_0x494949,'_IMG');for(let _0x1609db=0x0;_0x1609db<_0x472343['length'];_0x1609db++){var _0x35923b=_0x5db4c3[_0x351e('0x12')](_0x351e('0x18'),_0x351e('0x19')+_0x472343[_0x1609db]+_0x351e('0x1a'));_0x5db4c3=_0x35923b;}_0x4c9aa7[_0x351e('0x10')]=_0x5db4c3;}_0x2923d6[_0x351e('0x1b')]=_0x4c9aa7[_0x351e('0x10')];}else{_0x2923d6[_0x351e('0x1b')]=_0x4c9aa7['textAsHtml'];}if(_0x2923d6['body']){_0x2923d6[_0x351e('0x1b')]=_0x2923d6['body'][_0x351e('0x12')](/0x0){var _0x78265e=[_0x351e('0x2e'),'X-Auto-Response-Suppress:\x20All',_0x351e('0x2f')];for(var _0x45e272=0x0;_0x45e272<_0x4c9aa7[_0x351e('0x2d')][_0x351e('0xc')];_0x45e272++){var _0xfa5724=_[_0x351e('0xa')](_0x78265e,_0x4c9aa7[_0x351e('0x2d')][_0x45e272][_0x351e('0x30')]);if(_0xfa5724>=0x0){_0x2923d6[_0x351e('0x31')]=!![];}}}return _0x2923d6;}exports['parser']=function(_0x1890df,_0x4fa7fa,_0x1a6bc6){var _0x5c3902={'from':getAddress(_0x4fa7fa[_0x351e('0x32')]),'firstName':getFirstName(_0x4fa7fa[_0x351e('0x32')]),'lastName':getLastName(_0x4fa7fa[_0x351e('0x32')]),'mapKey':_0x351e('0x1e'),'message':{'from':getMails(_0x1890df[_0x351e('0x1e')],_0x4fa7fa[_0x351e('0x32')]),'to':_0x1890df[_0x351e('0x1e')],'cc':'','subject':_0x4fa7fa['subject']||'','messageId':_0x4fa7fa[_0x351e('0x33')],'inReplyTo':_0x4fa7fa[_0x351e('0x34')],'sentAt':moment(_0x4fa7fa[_0x351e('0x35')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4fa7fa[_0x351e('0x10')]&&!_0x4fa7fa['textAsHtml']){var _0x5988ff=_[_0x351e('0x36')](_0x4fa7fa[_0x351e('0x14')],{'contentType':'application/ms-tnef'});if(_0x5988ff[_0x351e('0xc')]){logger[_0x351e('0x37')](util[_0x351e('0x24')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x4fa7fa[_0x351e('0x33')]));tnef[_0x351e('0x38')](_[_0x351e('0x39')](_0x5988ff)[_0x351e('0x2b')],function(_0x572518,_0x1eaa4b){if(_0x1eaa4b){_0x4fa7fa[_0x351e('0x10')]=_0x1eaa4b[_0x351e('0x3a')]||_0x351e('0x3b');if(_0x1eaa4b[_0x351e('0x3c')]){for(var _0x28d013=0x0;_0x28d013<_0x1eaa4b[_0x351e('0x3c')][_0x351e('0xc')];_0x28d013++){var _0x9c3c0=_0x1eaa4b['Attachments'][_0x28d013];_0x5c3902[_0x351e('0x1d')][_0x351e('0x14')]['push']({'filename':_0x9c3c0['Title'],'content':Buffer[_0x351e('0x32')](_0x9c3c0[_0x351e('0x3d')])});}}}_0x1a6bc6(parseEmail(_0x1890df,_0x4fa7fa,_0x5c3902));});}else{_0x4fa7fa[_0x351e('0x10')]=_0x351e('0x3b');_0x1a6bc6(parseEmail(_0x1890df,_0x4fa7fa,_0x5c3902));}}else{_0x1a6bc6(parseEmail(_0x1890df,_0x4fa7fa,_0x5c3902));}};exports[_0x351e('0x3e')]=function(_0x302c50,_0x5b0665){var _0x4e321b=[_0x351e('0x3f')+(_0x5b0665||''),_0x351e('0x40')+_0x302c50,'',''];return Buffer[_0x351e('0x32')](_0x4e321b[_0x351e('0x27')](''),_0x351e('0x41'))[_0x351e('0x42')](_0x351e('0x43'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 8b80349..3dabf2d 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 _0xefff=['name','Service','key','SERV','active','Imap','Smtp','exports','lodash'];(function(_0x3ee7e2,_0x15cf09){var _0x1c1f18=function(_0x3426e0){while(--_0x3426e0){_0x3ee7e2['push'](_0x3ee7e2['shift']());}};_0x1c1f18(++_0x15cf09);}(_0xefff,0x6b));var _0xfeff=function(_0x36c87e,_0x4bb6c7){_0x36c87e=_0x36c87e-0x0;var _0xe380a0=_0xefff[_0x36c87e];return _0xe380a0;};'use strict';var _=require(_0xfeff('0x0'));function MailAccount(_0x24280f){this['id']=_0x24280f['id']||0x0;this[_0xfeff('0x1')]=_0x24280f[_0xfeff('0x1')]||_0xfeff('0x2');this[_0xfeff('0x3')]=_0x24280f['key']||_0xfeff('0x4');this[_0xfeff('0x5')]=_0x24280f[_0xfeff('0x5')]||![];this[_0xfeff('0x6')]=_0x24280f[_0xfeff('0x6')]||[];this[_0xfeff('0x7')]=_0x24280f['Smtp']||[];}module[_0xfeff('0x8')]=MailAccount; \ No newline at end of file +var _0x9a1c=['Imap','exports','lodash','name','Service','key','SERV','active'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x9a1c,0x1a2));var _0xc9a1=function(_0x16333b,_0x3b9288){_0x16333b=_0x16333b-0x0;var _0x425cb6=_0x9a1c[_0x16333b];return _0x425cb6;};'use strict';var _=require(_0xc9a1('0x0'));function MailAccount(_0xd84add){this['id']=_0xd84add['id']||0x0;this[_0xc9a1('0x1')]=_0xd84add[_0xc9a1('0x1')]||_0xc9a1('0x2');this[_0xc9a1('0x3')]=_0xd84add[_0xc9a1('0x3')]||_0xc9a1('0x4');this[_0xc9a1('0x5')]=_0xd84add[_0xc9a1('0x5')]||![];this[_0xc9a1('0x6')]=_0xd84add[_0xc9a1('0x6')]||[];this['Smtp']=_0xd84add['Smtp']||[];}module[_0xc9a1('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index f0a4e91..ef7431b 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 _0xcbe2=['merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xcbe2,0x119));var _0x2cbe=function(_0x3cc161,_0x33132f){_0x3cc161=_0x3cc161-0x0;var _0xea7289=_0xcbe2[_0x3cc161];return _0xea7289;};'use strict';var _=require(_0x2cbe('0x0'));var MailAccount=require(_0x2cbe('0x1'));var Realtime=function(){this[_0x2cbe('0x2')]={};};function freeIsNotKey(_0x2ac26f,_0x2569bf,_0x43c311){var _0x1eb900=_[_0x2cbe('0x3')](_0x2ac26f,function(_0xeb9161,_0x78a1f5){return _0xeb9161[_0x43c311];});for(var _0x2036c7 in _0x2569bf){if(_0x2569bf[_0x2cbe('0x4')](_0x2036c7)){if(!_0x1eb900[_0x2036c7]){delete _0x2569bf[_0x2036c7];}}}}Realtime[_0x2cbe('0x5')][_0x2cbe('0x6')]=function(_0x53bd31,_0x5a5c84){for(var _0x1729d3 in _0x5a5c84){if(_0x53bd31[_0x2cbe('0x4')](_0x1729d3)){_0x53bd31[_0x1729d3]=_0x5a5c84[_0x1729d3];}}};Realtime['prototype'][_0x2cbe('0x7')]=function(){var _0x451f2f=this;return function(_0x47c3b7){if(_0x47c3b7){freeIsNotKey(_0x47c3b7,_0x451f2f[_0x2cbe('0x2')],'id');for(var _0x258da0=0x0,_0x38fd53={},_0xf9d4b7={};_0x258da0<_0x47c3b7['length'];_0x258da0+=0x1){_0x38fd53=_0x47c3b7[_0x258da0];if(_[_0x2cbe('0x8')](_0x451f2f['mailAccounts'][_0x38fd53['id']])){_0x451f2f['mailAccounts'][_0x38fd53['id']]=new MailAccount(_0x38fd53);}else{_[_0x2cbe('0x9')](_0x451f2f[_0x2cbe('0x2')][_0x38fd53['id']],_0x38fd53);}}}return _0x451f2f['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xede7=['prototype','initMailAccounts','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xede7,0xf7));var _0x7ede=function(_0x581b33,_0x47bf03){_0x581b33=_0x581b33-0x0;var _0x13e619=_0xede7[_0x581b33];return _0x13e619;};'use strict';var _=require(_0x7ede('0x0'));var MailAccount=require(_0x7ede('0x1'));var Realtime=function(){this[_0x7ede('0x2')]={};};function freeIsNotKey(_0x3e311b,_0x44a714,_0x48f8f1){var _0x154de5=_[_0x7ede('0x3')](_0x3e311b,function(_0x131550,_0x293d76){return _0x131550[_0x48f8f1];});for(var _0x254a92 in _0x44a714){if(_0x44a714[_0x7ede('0x4')](_0x254a92)){if(!_0x154de5[_0x254a92]){delete _0x44a714[_0x254a92];}}}}Realtime[_0x7ede('0x5')]['mergeFromDatabase']=function(_0x4e32b5,_0x597527){for(var _0x2770de in _0x597527){if(_0x4e32b5[_0x7ede('0x4')](_0x2770de)){_0x4e32b5[_0x2770de]=_0x597527[_0x2770de];}}};Realtime[_0x7ede('0x5')][_0x7ede('0x6')]=function(){var _0xf35fc2=this;return function(_0x4d425a){if(_0x4d425a){freeIsNotKey(_0x4d425a,_0xf35fc2[_0x7ede('0x2')],'id');for(var _0x109eb0=0x0,_0x212a77={},_0x2ecb95={};_0x109eb0<_0x4d425a['length'];_0x109eb0+=0x1){_0x212a77=_0x4d425a[_0x109eb0];if(_['isUndefined'](_0xf35fc2['mailAccounts'][_0x212a77['id']])){_0xf35fc2[_0x7ede('0x2')][_0x212a77['id']]=new MailAccount(_0x212a77);}else{_[_0x7ede('0x7')](_0xf35fc2[_0x7ede('0x2')][_0x212a77['id']],_0x212a77);}}}return _0xf35fc2[_0x7ede('0x2')];};};module[_0x7ede('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 1278428..7d67001 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 _0xf40b=['Smtp','type','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','ListId','MailServerIn','Imap','CloudProvider','data5','MailServerOut'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0xf40b,0xb0));var _0xbf40=function(_0x35aeb5,_0x4e8855){_0x35aeb5=_0x35aeb5-0x0;var _0x18fcec=_0xf40b[_0x35aeb5];return _0x18fcec;};'use strict';var client=require('../client');exports[_0xbf40('0x0')]=function(){return function(){return client[_0xbf40('0x1')](_0xbf40('0x2'),{'options':{'attributes':['id',_0xbf40('0x3'),'provider',_0xbf40('0x4'),_0xbf40('0x5'),_0xbf40('0x6'),_0xbf40('0x7'),_0xbf40('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0xbf40('0x9'),'as':_0xbf40('0xa'),'include':[{'model':_0xbf40('0xb'),'attributes':['id',_0xbf40('0x3'),_0xbf40('0x4'),'type',_0xbf40('0xc')],'as':_0xbf40('0xb')}]},{'model':_0xbf40('0xd'),'as':_0xbf40('0xe'),'include':[{'model':_0xbf40('0xb'),'attributes':['id',_0xbf40('0x3'),_0xbf40('0x4'),_0xbf40('0xf'),'data5'],'as':_0xbf40('0xb')}]}]},'log':_0xbf40('0x10')});};};exports[_0xbf40('0x11')]=function(_0x3118d9,_0x380a1e){return client[_0xbf40('0x1')](_0xbf40('0x12'),{'account':{'id':_0x3118d9},'body':_0x380a1e,'log':_0xbf40('0x12')});}; \ No newline at end of file +var _0xb242=['type','MailServerOut','getMailAccount','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','service','email','ListId','TemplateId','Imap','CloudProvider'];(function(_0x2418e0,_0x7215b0){var _0x55ffbf=function(_0x4fc0ec){while(--_0x4fc0ec){_0x2418e0['push'](_0x2418e0['shift']());}};_0x55ffbf(++_0x7215b0);}(_0xb242,0x1f3));var _0x2b24=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0xb242[_0x19691f];return _0x5677b6;};'use strict';var client=require('../client');exports[_0x2b24('0x0')]=function(){return function(){return client[_0x2b24('0x1')](_0x2b24('0x2'),{'options':{'attributes':['id',_0x2b24('0x3'),_0x2b24('0x4'),_0x2b24('0x5'),_0x2b24('0x6'),'active','key',_0x2b24('0x7'),_0x2b24('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x2b24('0x9'),'include':[{'model':_0x2b24('0xa'),'attributes':['id',_0x2b24('0x3'),'service',_0x2b24('0xb'),'data5'],'as':_0x2b24('0xa')}]},{'model':_0x2b24('0xc'),'as':'Smtp','include':[{'model':_0x2b24('0xa'),'attributes':['id','name',_0x2b24('0x5'),_0x2b24('0xb'),'data5'],'as':'CloudProvider'}]}]},'log':_0x2b24('0xd')});};};exports['notify']=function(_0x3bb441,_0x2a23b6){return client[_0x2b24('0x1')](_0x2b24('0xe'),{'account':{'id':_0x3bb441},'body':_0x2a23b6,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 394a01d..c1b527b 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 _0x1612=['../client','Request','ShowSetting','loginMailFrequency'];(function(_0x4a39f2,_0x4ef331){var _0x1d8bc9=function(_0x44aa39){while(--_0x44aa39){_0x4a39f2['push'](_0x4a39f2['shift']());}};_0x1d8bc9(++_0x4ef331);}(_0x1612,0xe0));var _0x2161=function(_0x265bc8,_0x4c88f4){_0x265bc8=_0x265bc8-0x0;var _0x4ee96a=_0x1612[_0x265bc8];return _0x4ee96a;};'use strict';var client=require(_0x2161('0x0'));exports['getSettings']=function(){return client[_0x2161('0x1')](_0x2161('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2161('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xd092=['GetSettings','getSettings','Request','loginMailFrequency'];(function(_0x208df8,_0x3ba904){var _0x5dfb26=function(_0xb8dee0){while(--_0xb8dee0){_0x208df8['push'](_0x208df8['shift']());}};_0x5dfb26(++_0x3ba904);}(_0xd092,0x149));var _0x2d09=function(_0x1009a2,_0x2db50b){_0x1009a2=_0x1009a2-0x0;var _0x55b1fd=_0xd092[_0x1009a2];return _0x55b1fd;};'use strict';var client=require('../client');exports[_0x2d09('0x0')]=function(){return client[_0x2d09('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2d09('0x2')]},'log':_0x2d09('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 223efbc..1111e28 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(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 2ec5c58..2e21f5f 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 _0xac20=['websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../routes','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','createServer','timeout','listen','port','socket.io'];(function(_0x11df3a,_0x244119){var _0x3dc03c=function(_0x2e62f6){while(--_0x2e62f6){_0x11df3a['push'](_0x11df3a['shift']());}};_0x3dc03c(++_0x244119);}(_0xac20,0xd3));var _0x0ac2=function(_0x333dbb,_0xbcc410){_0x333dbb=_0x333dbb-0x0;var _0x15bd7d=_0xac20[_0x333dbb];return _0x15bd7d;};'use strict';var _=require(_0x0ac2('0x0'));var http=require(_0x0ac2('0x1'));var express=require(_0x0ac2('0x2'));var sticky=require('sticky-session');var Redis=require(_0x0ac2('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x0ac2('0x4')](app);server[_0x0ac2('0x5')]=0xdbba0;if(sticky[_0x0ac2('0x6')](server,config[_0x0ac2('0x7')])){var socketio=require(_0x0ac2('0x8'))(server,{'transports':[_0x0ac2('0x9'),_0x0ac2('0xa')]});config['redis']=_[_0x0ac2('0xb')](config[_0x0ac2('0xc')],{'host':_0x0ac2('0xd'),'port':0x18eb});socketio[_0x0ac2('0xe')](require(_0x0ac2('0xf'))({'pubClient':new Redis(config[_0x0ac2('0xc')]),'subClient':new Redis(config[_0x0ac2('0xc')])}));require(_0x0ac2('0x10'))[_0x0ac2('0x11')]();require(_0x0ac2('0x12'))[_0x0ac2('0x11')](socketio);require('../../config/express')[_0x0ac2('0x11')](app);require(_0x0ac2('0x13'))[_0x0ac2('0x11')](app);}else{server['once']('listening',function(){console['log'](_0x0ac2('0x14'),config[_0x0ac2('0x7')]);});}exports=module[_0x0ac2('0x15')]=app; \ No newline at end of file +var _0xa5db=['websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','createServer','timeout','listen','port','socket.io'];(function(_0x57949d,_0x2b1ec9){var _0x37b663=function(_0x2ddfc2){while(--_0x2ddfc2){_0x57949d['push'](_0x57949d['shift']());}};_0x37b663(++_0x2b1ec9);}(_0xa5db,0x87));var _0xba5d=function(_0x39ffcb,_0x48d1f3){_0x39ffcb=_0x39ffcb-0x0;var _0x24dd09=_0xa5db[_0x39ffcb];return _0x24dd09;};'use strict';var _=require(_0xba5d('0x0'));var http=require(_0xba5d('0x1'));var express=require(_0xba5d('0x2'));var sticky=require('sticky-session');var Redis=require(_0xba5d('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0xba5d('0x4')](app);server[_0xba5d('0x5')]=0xdbba0;if(sticky[_0xba5d('0x6')](server,config[_0xba5d('0x7')])){var socketio=require(_0xba5d('0x8'))(server,{'transports':[_0xba5d('0x9'),_0xba5d('0xa')]});config[_0xba5d('0xb')]=_[_0xba5d('0xc')](config[_0xba5d('0xb')],{'host':_0xba5d('0xd'),'port':0x18eb});socketio[_0xba5d('0xe')](require(_0xba5d('0xf'))({'pubClient':new Redis(config[_0xba5d('0xb')]),'subClient':new Redis(config[_0xba5d('0xb')])}));require('../../config/triggers')[_0xba5d('0x10')]();require('../../config/socketio')[_0xba5d('0x10')](socketio);require(_0xba5d('0x11'))[_0xba5d('0x10')](app);require(_0xba5d('0x12'))['default'](app);}else{server[_0xba5d('0x13')](_0xba5d('0x14'),function(){console[_0xba5d('0x15')](_0xba5d('0x16'),config['port']);});}exports=module[_0xba5d('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index a0a350f..d0dd55f 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 _0xa197=['result','catch','exports','jayson/promise','routing','client','http','Request','request','then','debug','rpc','error','message'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa197,0x153));var _0x7a19=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xa197[_0x2dbce7];return _0x3a3ed0;};'use strict';var jayson=require(_0x7a19('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x7a19('0x1'));var client=jayson[_0x7a19('0x2')][_0x7a19('0x3')]({'port':0x2329});client[_0x7a19('0x4')]=function(_0x5d9662,_0x5dd30a){return new BPromise(function(_0x4c792e,_0x2150e3){return client[_0x7a19('0x5')](_0x5d9662,_0x5dd30a)[_0x7a19('0x6')](function(_0x166237){logger[_0x7a19('0x7')](_0x7a19('0x8'),_0x7a19('0x1'),_0x5d9662,_0x5dd30a,_0x166237);if(_0x166237[_0x7a19('0x9')]){logger['error']('rpc','routing',_0x5d9662,_0x166237[_0x7a19('0x9')]['message'],_0x5dd30a);return _0x2150e3(_0x166237['error'][_0x7a19('0xa')]);}else{return _0x4c792e(_0x166237[_0x7a19('0xb')]);}})[_0x7a19('0xc')](function(_0x10fe85){logger[_0x7a19('0x9')](_0x7a19('0x8'),'routing',_0x5d9662,_0x10fe85,_0x5dd30a);return _0x2150e3(_0x10fe85);});});};module[_0x7a19('0xd')]=client; \ No newline at end of file +var _0x533e=['error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger','routing','Request','request','debug'];(function(_0x5cd383,_0x4b5a9a){var _0x3aa024=function(_0x3e190c){while(--_0x3e190c){_0x5cd383['push'](_0x5cd383['shift']());}};_0x3aa024(++_0x4b5a9a);}(_0x533e,0xd1));var _0xe533=function(_0x4c64f1,_0x2e29ab){_0x4c64f1=_0x4c64f1-0x0;var _0x2e06ed=_0x533e[_0x4c64f1];return _0x2e06ed;};'use strict';var jayson=require(_0xe533('0x0'));var BPromise=require(_0xe533('0x1'));var logger=require(_0xe533('0x2'))(_0xe533('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0xe533('0x4')]=function(_0xfda019,_0x223a14){return new BPromise(function(_0x47955f,_0x50c8de){return client[_0xe533('0x5')](_0xfda019,_0x223a14)['then'](function(_0x5985aa){logger[_0xe533('0x6')]('rpc',_0xe533('0x3'),_0xfda019,_0x223a14,_0x5985aa);if(_0x5985aa[_0xe533('0x7')]){logger['error']('rpc',_0xe533('0x3'),_0xfda019,_0x5985aa['error'][_0xe533('0x8')],_0x223a14);return _0x50c8de(_0x5985aa[_0xe533('0x7')][_0xe533('0x8')]);}else{return _0x47955f(_0x5985aa[_0xe533('0x9')]);}})[_0xe533('0xa')](function(_0x5dd395){logger['error'](_0xe533('0xb'),'routing',_0xfda019,_0x5dd395,_0x223a14);return _0x50c8de(_0x5dd395);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index d8348d4..2ccf576 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 _0xec50=['then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xec50,0x1b4));var _0x0ec5=function(_0x3a412f,_0x1634db){_0x3a412f=_0x3a412f-0x0;var _0x41ddbf=_0xec50[_0x3a412f];return _0x41ddbf;};'use strict';var BPromise=require(_0x0ec5('0x0'));var server=require(_0x0ec5('0x1'));var Realtime=require(_0x0ec5('0x2'));var user=require('./rpc/user');var interval=require(_0x0ec5('0x3'));var openchannelQueue=require(_0x0ec5('0x4'));var chatQueue=require(_0x0ec5('0x5'));var smsQueue=require(_0x0ec5('0x6'));var mailQueue=require(_0x0ec5('0x7'));var faxQueue=require(_0x0ec5('0x8'));var whatsappQueue=require(_0x0ec5('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x0ec5('0xa')]()['then'](user[_0x0ec5('0xb')]())[_0x0ec5('0xc')](realtime[_0x0ec5('0xd')]())[_0x0ec5('0xc')](interval[_0x0ec5('0xe')]())[_0x0ec5('0xc')](realtime[_0x0ec5('0xf')]())[_0x0ec5('0xc')](openchannelQueue[_0x0ec5('0x10')]())[_0x0ec5('0xc')](realtime[_0x0ec5('0x11')]())[_0x0ec5('0xc')](chatQueue[_0x0ec5('0x12')]())[_0x0ec5('0xc')](realtime['initChatQueues']())['then'](smsQueue[_0x0ec5('0x13')]())[_0x0ec5('0xc')](realtime['initSmsQueues']())['then'](mailQueue[_0x0ec5('0x14')]())[_0x0ec5('0xc')](realtime[_0x0ec5('0x15')]())[_0x0ec5('0xc')](faxQueue[_0x0ec5('0x16')]())[_0x0ec5('0xc')](realtime[_0x0ec5('0x17')]())[_0x0ec5('0xc')](whatsappQueue[_0x0ec5('0x18')]())[_0x0ec5('0xc')](realtime['initWhatsappQueues']())[_0x0ec5('0xc')](function(){return realtime;});}function main(){return server[_0x0ec5('0x19')](realtime)[_0x0ec5('0xc')](function(_0x5f7f3c){return initRealtime();})[_0x0ec5('0xc')](function(_0x4e4ccd){return setInterval(initRealtime,0x1388);})[_0x0ec5('0x1a')](function(_0x5938d0){console[_0x0ec5('0x1b')](_0x5938d0);});}main(); \ No newline at end of file +var _0x10b1=['getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','log','bluebird','./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x477350,_0x1abada){var _0x242610=function(_0x53f066){while(--_0x53f066){_0x477350['push'](_0x477350['shift']());}};_0x242610(++_0x1abada);}(_0x10b1,0x14e));var _0x110b=function(_0x1edaf6,_0x259828){_0x1edaf6=_0x1edaf6-0x0;var _0x545921=_0x10b1[_0x1edaf6];return _0x545921;};'use strict';var BPromise=require(_0x110b('0x0'));var server=require('./server');var Realtime=require(_0x110b('0x1'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x110b('0x2'));var chatQueue=require(_0x110b('0x3'));var smsQueue=require(_0x110b('0x4'));var mailQueue=require(_0x110b('0x5'));var faxQueue=require(_0x110b('0x6'));var whatsappQueue=require(_0x110b('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x110b('0x8')]()['then'](user[_0x110b('0x9')]())[_0x110b('0xa')](realtime[_0x110b('0xb')]())[_0x110b('0xa')](interval[_0x110b('0xc')]())[_0x110b('0xa')](realtime[_0x110b('0xd')]())[_0x110b('0xa')](openchannelQueue[_0x110b('0xe')]())[_0x110b('0xa')](realtime[_0x110b('0xf')]())['then'](chatQueue[_0x110b('0x10')]())[_0x110b('0xa')](realtime[_0x110b('0x11')]())['then'](smsQueue[_0x110b('0x12')]())['then'](realtime['initSmsQueues']())[_0x110b('0xa')](mailQueue['getMailQueues']())[_0x110b('0xa')](realtime[_0x110b('0x13')]())['then'](faxQueue[_0x110b('0x14')]())['then'](realtime[_0x110b('0x15')]())[_0x110b('0xa')](whatsappQueue[_0x110b('0x16')]())[_0x110b('0xa')](realtime['initWhatsappQueues']())[_0x110b('0xa')](function(){return realtime;});}function main(){return server[_0x110b('0x17')](realtime)['then'](function(_0xf0d453){return initRealtime();})[_0x110b('0xa')](function(_0x539198){return setInterval(initRealtime,0x1388);})['catch'](function(_0x5f96a){console[_0x110b('0x18')](_0x5f96a);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index e4780b7..04536ad 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(_0x11dc6c,_0x21bdfe){var _0xddae9c=function(_0x11f846){while(--_0x11f846){_0x11dc6c['push'](_0x11dc6c['shift']());}};_0xddae9c(++_0x21bdfe);}(_0x814b,0x1a2));var _0xb814=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x814b[_0x2cfb48];return _0xc4594f;};'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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0xcfe9cb,_0x427934){var _0x163cd3=function(_0x4ee5cf){while(--_0x4ee5cf){_0xcfe9cb['push'](_0xcfe9cb['shift']());}};_0x163cd3(++_0x427934);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x5fc3[_0x1a595a];return _0x33f008;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index f350ef7..416ba54 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 _0xca7b=['bluebird','jayson/promise','http','then','error','message','catch','SendMail'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xca7b,0x70));var _0xbca7=function(_0x38d118,_0x33e77a){_0x38d118=_0x38d118-0x0;var _0x268a16=_0xca7b[_0x38d118];return _0x268a16;};'use strict';var BPromise=require(_0xbca7('0x0'));var jayson=require(_0xbca7('0x1'));var client=jayson['client'][_0xbca7('0x2')]({'port':0x232b});function request(_0x1a7e95,_0x3dc0b3){return new BPromise(function(_0x544a4a,_0x40d31f){return client['request'](_0x1a7e95,_0x3dc0b3)[_0xbca7('0x3')](function(_0x207cad){if(_0x207cad['error']){return _0x40d31f(_0x207cad[_0xbca7('0x4')][_0xbca7('0x5')]);}else{return _0x544a4a(_0x207cad['result']);}})[_0xbca7('0x6')](function(_0x35fbad){return _0x40d31f(_0x35fbad);});});}exports['sendMailMessage']=function(_0x3affd9,_0x2105bb){return request(_0xbca7('0x7'),{'account':_0x3affd9,'message':_0x2105bb});}; \ No newline at end of file +var _0xa2b6=['http','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x143d6d,_0x295a66){var _0x45c605=function(_0x338783){while(--_0x338783){_0x143d6d['push'](_0x143d6d['shift']());}};_0x45c605(++_0x295a66);}(_0xa2b6,0xb7));var _0x6a2b=function(_0x33e153,_0xcfd570){_0x33e153=_0x33e153-0x0;var _0x4894c9=_0xa2b6[_0x33e153];return _0x4894c9;};'use strict';var BPromise=require(_0x6a2b('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6a2b('0x1')]({'port':0x232b});function request(_0x1e7dee,_0x87453f){return new BPromise(function(_0xce436,_0x1bcac0){return client['request'](_0x1e7dee,_0x87453f)['then'](function(_0x2bbd05){if(_0x2bbd05[_0x6a2b('0x2')]){return _0x1bcac0(_0x2bbd05[_0x6a2b('0x2')][_0x6a2b('0x3')]);}else{return _0xce436(_0x2bbd05[_0x6a2b('0x4')]);}})[_0x6a2b('0x5')](function(_0x2bade5){return _0x1bcac0(_0x2bade5);});});}exports[_0x6a2b('0x6')]=function(_0x25275c,_0x33b27f){return request(_0x6a2b('0x7'),{'account':_0x25275c,'message':_0x33b27f});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 4451ce4..53c2497 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 _0x142f=['lodash','md5','moment','ioredis','../../../config/environment','redis','socket.io-emitter','name','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','smsWaitingInteractions','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail','chat','openchannel','fax','sms','length','Status','StatusTime','toNumber','format','online','chatPause','chatCurrentCapacity','whatsappCurrentCapacity','whatsappWaitingInteractions','emit','user:routing:update','omit','exports'];(function(_0x3872db,_0x421b76){var _0x22b54b=function(_0x136b5e){while(--_0x136b5e){_0x3872db['push'](_0x3872db['shift']());}};_0x22b54b(++_0x421b76);}(_0x142f,0x14f));var _0xf142=function(_0x510313,_0xd493e1){_0x510313=_0x510313-0x0;var _0xd9ad55=_0x142f[_0x510313];return _0xd9ad55;};'use strict';var _=require(_0xf142('0x0'));var md5=require(_0xf142('0x1'));var moment=require(_0xf142('0x2'));var Redis=require(_0xf142('0x3'));var config=require(_0xf142('0x4'));config['redis']=_['defaults'](config[_0xf142('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf142('0x6'))(new Redis(config[_0xf142('0x5')]));function Agent(_0x1e6cc9){this['id']=_0x1e6cc9['id']||0x0;this[_0xf142('0x7')]=_0x1e6cc9['name']||'';this[_0xf142('0x8')]=_0x1e6cc9['voicePause']||![];this['chatPause']=_0x1e6cc9['chatPause']||![];this['mailPause']=_0x1e6cc9[_0xf142('0x9')]||![];this[_0xf142('0xa')]=_0x1e6cc9[_0xf142('0xa')]||![];this[_0xf142('0xb')]=_0x1e6cc9[_0xf142('0xb')]||![];this[_0xf142('0xc')]=_0x1e6cc9['openchannelPause']||![];this[_0xf142('0xd')]=_0xf142('0xe');this[_0xf142('0xf')]=0x0;this[_0xf142('0x10')]=_0x1e6cc9[_0xf142('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']='unknown';this[_0xf142('0x11')]=0x0;this[_0xf142('0x12')]=_0x1e6cc9['mailCapacity']||0x0;this[_0xf142('0x13')]=0x0;this[_0xf142('0x14')]='unknown';this[_0xf142('0x15')]=0x0;this[_0xf142('0x16')]=_0x1e6cc9[_0xf142('0x16')]||0x0;this[_0xf142('0x17')]=0x0;this[_0xf142('0x18')]=_0xf142('0xe');this[_0xf142('0x19')]=0x0;this['smsCapacity']=_0x1e6cc9[_0xf142('0x1a')]||0x0;this[_0xf142('0x1b')]=0x0;this[_0xf142('0x1c')]='unknown';this[_0xf142('0x1d')]=0x0;this[_0xf142('0x1e')]=_0x1e6cc9['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xf142('0x1f')]=_0xf142('0xe');this[_0xf142('0x20')]=0x0;this[_0xf142('0x21')]=_0x1e6cc9[_0xf142('0x21')]||0x0;this[_0xf142('0x22')]=0x0;this[_0xf142('0x23')]=![];this[_0xf142('0x24')]=undefined;this['md5']='';this[_0xf142('0x25')]={};this[_0xf142('0x26')]={};this[_0xf142('0x27')]={};this['openchannelWaitingInteractions']={};this[_0xf142('0x28')]={};this['whatsappWaitingInteractions']={};this['updateRealtime']();}Agent[_0xf142('0x29')]['getChannelStatus']=function(_0x14296f){if(this[_0x14296f+_0xf142('0x2a')]>0x0){if(this[_0x14296f+_0xf142('0x2b')]>0x0&&this[_0x14296f+_0xf142('0x2a')]>=this[_0x14296f+_0xf142('0x2b')]){return _0xf142('0x2c');}else{return _0xf142('0x2d');}}else{return _0xf142('0x2e');}};Agent[_0xf142('0x29')][_0xf142('0x2f')]=function(){var _0x5208fd=[_0xf142('0x30'),_0xf142('0x31'),_0xf142('0x32'),_0xf142('0x33'),_0xf142('0x34'),'whatsapp'];for(var _0x1b86e7=0x0;_0x1b86e7<_0x5208fd[_0xf142('0x35')];_0x1b86e7+=0x1){var _0x1c039b=this['getChannelStatus'](_0x5208fd[_0x1b86e7]);if(this[_0x5208fd[_0x1b86e7]+_0xf142('0x36')]!==_0x1c039b){this[_0x5208fd[_0x1b86e7]+_0xf142('0x37')]=_[_0xf142('0x38')](moment()[_0xf142('0x39')]('x'));}this[_0x5208fd[_0x1b86e7]+_0xf142('0x36')]=_0x1c039b;}var _0x230f6c={'id':this['id'],'name':this[_0xf142('0x7')],'online':this[_0xf142('0x3a')],'voicePause':this[_0xf142('0x8')],'chatPause':this[_0xf142('0x3b')],'mailPause':this[_0xf142('0x9')],'smsPause':this[_0xf142('0xb')],'faxPause':this[_0xf142('0xa')],'openchannelPause':this[_0xf142('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xf142('0x3c')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xf142('0x11')],'mailCapacity':this[_0xf142('0x12')],'mailCurrentCapacity':this[_0xf142('0x13')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xf142('0x15')],'faxCapacity':this[_0xf142('0x16')],'faxCurrentCapacity':this[_0xf142('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xf142('0x1a')],'smsCurrentCapacity':this[_0xf142('0x1b')],'whatsappStatus':this[_0xf142('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xf142('0x3d')],'openchannelStatus':this[_0xf142('0x1f')],'openchannelStatusTime':this[_0xf142('0x20')],'openchannelCapacity':this[_0xf142('0x21')],'openchannelCurrentCapacity':this[_0xf142('0x22')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0xf142('0x25')],'faxWaitingInteractions':this[_0xf142('0x26')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0xf142('0x28')],'whatsappWaitingInteractions':this[_0xf142('0x3e')]};var _0x53f553=md5(JSON['stringify'](_0x230f6c));if(this['md5']!==_0x53f553){this[_0xf142('0x1')]=_0x53f553;io[_0xf142('0x3f')](_0xf142('0x40'),_[_0xf142('0x41')](_0x230f6c,[_0xf142('0x3a')]));}};module[_0xf142('0x42')]=Agent; \ No newline at end of file +var _0x5f66=['busyQueue','stringify','user:routing:update','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelCurrentCapacity','busy','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working','prototype','fax','sms','length','getChannelStatus','Status','StatusTime','chatStatusTime','mailStatus','faxCurrentCapacity','smsStatusTime','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var md5=require(_0x65f6('0x0'));var moment=require('moment');var Redis=require(_0x65f6('0x1'));var config=require(_0x65f6('0x2'));config[_0x65f6('0x3')]=_[_0x65f6('0x4')](config[_0x65f6('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x65f6('0x5'))(new Redis(config['redis']));function Agent(_0x1c9f5b){this['id']=_0x1c9f5b['id']||0x0;this[_0x65f6('0x6')]=_0x1c9f5b['name']||'';this['online']=_0x1c9f5b[_0x65f6('0x7')]||!![];this[_0x65f6('0x8')]=_0x1c9f5b[_0x65f6('0x8')]||![];this[_0x65f6('0x9')]=_0x1c9f5b[_0x65f6('0x9')]||![];this[_0x65f6('0xa')]=_0x1c9f5b['mailPause']||![];this['faxPause']=_0x1c9f5b[_0x65f6('0xb')]||![];this[_0x65f6('0xc')]=_0x1c9f5b[_0x65f6('0xc')]||![];this[_0x65f6('0xd')]=_0x1c9f5b['openchannelPause']||![];this[_0x65f6('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0x65f6('0xf')]=_0x1c9f5b['chatCapacity']||0x0;this[_0x65f6('0x10')]=0x0;this['mailStatus']=_0x65f6('0x11');this[_0x65f6('0x12')]=0x0;this[_0x65f6('0x13')]=_0x1c9f5b[_0x65f6('0x13')]||0x0;this[_0x65f6('0x14')]=0x0;this[_0x65f6('0x15')]=_0x65f6('0x11');this[_0x65f6('0x16')]=0x0;this[_0x65f6('0x17')]=_0x1c9f5b[_0x65f6('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x65f6('0x18')]='unknown';this['smsStatusTime']=0x0;this[_0x65f6('0x19')]=_0x1c9f5b[_0x65f6('0x19')]||0x0;this[_0x65f6('0x1a')]=0x0;this[_0x65f6('0x1b')]=_0x65f6('0x11');this[_0x65f6('0x1c')]=0x0;this[_0x65f6('0x1d')]=_0x1c9f5b[_0x65f6('0x1d')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x65f6('0x11');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x1c9f5b['openchannelCapacity']||0x0;this[_0x65f6('0x1e')]=0x0;this[_0x65f6('0x1f')]=![];this['busyQueue']=undefined;this[_0x65f6('0x0')]='';this[_0x65f6('0x20')]={};this[_0x65f6('0x21')]={};this[_0x65f6('0x22')]={};this[_0x65f6('0x23')]={};this[_0x65f6('0x24')]={};this['whatsappWaitingInteractions']={};this[_0x65f6('0x25')]();}Agent['prototype']['getChannelStatus']=function(_0x212247){if(this[_0x212247+_0x65f6('0x26')]>0x0){if(this[_0x212247+'Capacity']>0x0&&this[_0x212247+_0x65f6('0x26')]>=this[_0x212247+_0x65f6('0x27')]){return _0x65f6('0x28');}else{return _0x65f6('0x29');}}else{return'idle';}};Agent[_0x65f6('0x2a')][_0x65f6('0x25')]=function(){var _0x20a161=['mail','chat','openchannel',_0x65f6('0x2b'),_0x65f6('0x2c'),'whatsapp'];for(var _0x296cd9=0x0;_0x296cd9<_0x20a161[_0x65f6('0x2d')];_0x296cd9+=0x1){var _0x52277c=this[_0x65f6('0x2e')](_0x20a161[_0x296cd9]);if(this[_0x20a161[_0x296cd9]+_0x65f6('0x2f')]!==_0x52277c){this[_0x20a161[_0x296cd9]+_0x65f6('0x30')]=_['toNumber'](moment()['format']('x'));}this[_0x20a161[_0x296cd9]+'Status']=_0x52277c;}var _0x266cfe={'id':this['id'],'name':this[_0x65f6('0x6')],'online':this[_0x65f6('0x7')],'voicePause':this[_0x65f6('0x8')],'chatPause':this[_0x65f6('0x9')],'mailPause':this[_0x65f6('0xa')],'smsPause':this[_0x65f6('0xc')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x65f6('0xe')],'chatStatusTime':this[_0x65f6('0x31')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x65f6('0x32')],'mailStatusTime':this[_0x65f6('0x12')],'mailCapacity':this[_0x65f6('0x13')],'mailCurrentCapacity':this[_0x65f6('0x14')],'faxStatus':this[_0x65f6('0x15')],'faxStatusTime':this[_0x65f6('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x65f6('0x33')],'smsStatus':this[_0x65f6('0x18')],'smsStatusTime':this[_0x65f6('0x34')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x65f6('0x1a')],'whatsappStatus':this[_0x65f6('0x1b')],'whatsappStatusTime':this[_0x65f6('0x1c')],'whatsappCapacity':this[_0x65f6('0x1d')],'whatsappCurrentCapacity':this[_0x65f6('0x35')],'openchannelStatus':this[_0x65f6('0x36')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x65f6('0x37')],'openchannelCurrentCapacity':this[_0x65f6('0x1e')],'busy':this['busy'],'busyQueue':this[_0x65f6('0x38')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x65f6('0x21')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0x65f6('0x23')],'smsWaitingInteractions':this[_0x65f6('0x24')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x12dee6=md5(JSON[_0x65f6('0x39')](_0x266cfe));if(this[_0x65f6('0x0')]!==_0x12dee6){this['md5']=_0x12dee6;io['emit'](_0x65f6('0x3a'),_['omit'](_0x266cfe,[_0x65f6('0x7')]));}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 80bfecb..26e4f1e 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 _0x2741=['redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','chatPause','available','stringify','format','emit','chat_queue:save','lodash','ioredis','../../../config/environment'];(function(_0x41e8f2,_0x17797c){var _0x20e3fc=function(_0x28a52d){while(--_0x28a52d){_0x41e8f2['push'](_0x41e8f2['shift']());}};_0x20e3fc(++_0x17797c);}(_0x2741,0x126));var _0x1274=function(_0x27276a,_0x58dcaa){_0x27276a=_0x27276a-0x0;var _0x44a298=_0x2741[_0x27276a];return _0x44a298;};'use strict';var _=require(_0x1274('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x1274('0x1'));var config=require(_0x1274('0x2'));config['redis']=_['defaults'](config[_0x1274('0x3')],{'host':_0x1274('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1274('0x3')]));function ChatQueue(_0x4bc8ea){this['id']=_0x4bc8ea['id']||0x0;this[_0x1274('0x5')]=_0x4bc8ea[_0x1274('0x5')]||'';this[_0x1274('0x6')]=_0x4bc8ea[_0x1274('0x6')]||0xa;this['strategy']=_0x4bc8ea[_0x1274('0x7')]||_0x1274('0x8');this['Agents']=_0x4bc8ea[_0x1274('0x9')];this[_0x1274('0xa')]={};this[_0x1274('0xb')]=0x0;this[_0x1274('0xc')]='';this[_0x1274('0xd')]();this[_0x1274('0xe')]();}ChatQueue[_0x1274('0xf')]['updateRouting']=function(){var _0x2dc124=this[_0x1274('0xa')]['_rr'];this[_0x1274('0xa')]=_[_0x1274('0x10')](this['Agents'],'id');this[_0x1274('0xa')][_0x1274('0x11')]=_0x2dc124;};ChatQueue[_0x1274('0xf')][_0x1274('0xe')]=function(){this[_0x1274('0x12')]=0x0;this[_0x1274('0x13')]=0x0;for(var _0x21c9f4=0x0;_0x21c9f4=0x0?this[_0x1274('0x16')]:0x0;var _0x517ba2={'id':this['id'],'available':this[_0x1274('0x16')],'loggedIn':this[_0x1274('0x12')],'name':this['name'],'paused':this[_0x1274('0x13')],'waiting':this[_0x1274('0xb')]};var _0x2168e1=md5(JSON[_0x1274('0x17')](_0x517ba2));if(this[_0x1274('0xc')]!==_0x2168e1){this[_0x1274('0xc')]=_0x2168e1;io['to'](util[_0x1274('0x18')]('chat:queue:%s',_0x517ba2[_0x1274('0x5')]))[_0x1274('0x19')](_0x1274('0x1a'),_0x517ba2);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x43a2=['chat_queue:save','exports','md5','../../../config/environment','redis','defaults','localhost','name','timeout','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','chatPause','available','format','chat:queue:%s','emit'];(function(_0x49363f,_0x403a8e){var _0x348f1b=function(_0x252d9e){while(--_0x252d9e){_0x49363f['push'](_0x49363f['shift']());}};_0x348f1b(++_0x403a8e);}(_0x43a2,0x7f));var _0x243a=function(_0x18e2ea,_0x534a59){_0x18e2ea=_0x18e2ea-0x0;var _0x228370=_0x43a2[_0x18e2ea];return _0x228370;};'use strict';var _=require('lodash');var md5=require(_0x243a('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x243a('0x1'));config[_0x243a('0x2')]=_[_0x243a('0x3')](config[_0x243a('0x2')],{'host':_0x243a('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x28e313){this['id']=_0x28e313['id']||0x0;this[_0x243a('0x5')]=_0x28e313[_0x243a('0x5')]||'';this[_0x243a('0x6')]=_0x28e313[_0x243a('0x6')]||0xa;this['strategy']=_0x28e313['strategy']||'beepall';this[_0x243a('0x7')]=_0x28e313[_0x243a('0x7')];this[_0x243a('0x8')]={};this[_0x243a('0x9')]=0x0;this[_0x243a('0x0')]='';this[_0x243a('0xa')]();this['updateRealtime']();}ChatQueue[_0x243a('0xb')]['updateRouting']=function(){var _0xe561bb=this[_0x243a('0x8')][_0x243a('0xc')];this['mapAgentsId']=_['map'](this[_0x243a('0x7')],'id');this[_0x243a('0x8')][_0x243a('0xc')]=_0xe561bb;};ChatQueue[_0x243a('0xb')][_0x243a('0xd')]=function(){this[_0x243a('0xe')]=0x0;this[_0x243a('0xf')]=0x0;for(var _0x46de19=0x0;_0x46de19=0x0?this['available']:0x0;var _0x5ddda3={'id':this['id'],'available':this[_0x243a('0x13')],'loggedIn':this[_0x243a('0xe')],'name':this[_0x243a('0x5')],'paused':this[_0x243a('0xf')],'waiting':this['waiting']};var _0x4c2f20=md5(JSON['stringify'](_0x5ddda3));if(this[_0x243a('0x0')]!==_0x4c2f20){this['md5']=_0x4c2f20;io['to'](util[_0x243a('0x14')](_0x243a('0x15'),_0x5ddda3[_0x243a('0x5')]))[_0x243a('0x16')](_0x243a('0x17'),_0x5ddda3);}};module[_0x243a('0x18')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index dbc51f7..0ff8386 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 _0xbbc1=['format','emit','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','md5','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','online','faxPause','available','stringify'];(function(_0x3e00e0,_0x40aba1){var _0x6930ef=function(_0x127a34){while(--_0x127a34){_0x3e00e0['push'](_0x3e00e0['shift']());}};_0x6930ef(++_0x40aba1);}(_0xbbc1,0xb1));var _0x1bbc=function(_0x2ddd9d,_0x3eef84){_0x2ddd9d=_0x2ddd9d-0x0;var _0x2fb5fa=_0xbbc1[_0x2ddd9d];return _0x2fb5fa;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1bbc('0x0'));var Redis=require(_0x1bbc('0x1'));var config=require(_0x1bbc('0x2'));config[_0x1bbc('0x3')]=_[_0x1bbc('0x4')](config[_0x1bbc('0x3')],{'host':_0x1bbc('0x5'),'port':0x18eb});var io=require(_0x1bbc('0x6'))(new Redis(config[_0x1bbc('0x3')]));function FaxQueue(_0x2adee7){this['id']=_0x2adee7['id']||0x0;this[_0x1bbc('0x7')]=_0x2adee7[_0x1bbc('0x7')]||'';this[_0x1bbc('0x8')]=_0x2adee7[_0x1bbc('0x8')]||0xa;this[_0x1bbc('0x9')]=_0x2adee7['strategy']||'beepall';this[_0x1bbc('0xa')]=_0x2adee7[_0x1bbc('0xa')];this['mapAgentsId']={};this[_0x1bbc('0xb')]=0x0;this[_0x1bbc('0xc')]='';this[_0x1bbc('0xd')]();this['updateRealtime']();}FaxQueue[_0x1bbc('0xe')]['updateRouting']=function(){var _0x2952fe=this[_0x1bbc('0xf')][_0x1bbc('0x10')];this['mapAgentsId']=_[_0x1bbc('0x11')](this[_0x1bbc('0xa')],'id');this[_0x1bbc('0xf')][_0x1bbc('0x10')]=_0x2952fe;};FaxQueue['prototype'][_0x1bbc('0x12')]=function(){this[_0x1bbc('0x13')]=0x0;this[_0x1bbc('0x14')]=0x0;for(var _0x26138e=0x0;_0x26138e=0x0?this[_0x1bbc('0x18')]:0x0;var _0x2fb217={'id':this['id'],'available':this[_0x1bbc('0x18')],'loggedIn':this[_0x1bbc('0x13')],'name':this[_0x1bbc('0x7')],'paused':this['paused'],'waiting':this[_0x1bbc('0xb')]};var _0x430976=md5(JSON[_0x1bbc('0x19')](_0x2fb217));if(this['md5']!==_0x430976){this['md5']=_0x430976;io['to'](util[_0x1bbc('0x1a')]('fax:queue:%s',_0x2fb217[_0x1bbc('0x7')]))[_0x1bbc('0x1b')]('fax_queue:save',_0x2fb217);}};module[_0x1bbc('0x1c')]=FaxQueue; \ No newline at end of file +var _0x6a86=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6a86,0x9f));var _0x66a8=function(_0xcc6c87,_0x153f9a){_0xcc6c87=_0xcc6c87-0x0;var _0x210718=_0x6a86[_0xcc6c87];return _0x210718;};'use strict';var _=require(_0x66a8('0x0'));var md5=require('md5');var util=require(_0x66a8('0x1'));var Redis=require(_0x66a8('0x2'));var config=require(_0x66a8('0x3'));config[_0x66a8('0x4')]=_[_0x66a8('0x5')](config[_0x66a8('0x4')],{'host':_0x66a8('0x6'),'port':0x18eb});var io=require(_0x66a8('0x7'))(new Redis(config[_0x66a8('0x4')]));function FaxQueue(_0x2b7cc2){this['id']=_0x2b7cc2['id']||0x0;this[_0x66a8('0x8')]=_0x2b7cc2[_0x66a8('0x8')]||'';this[_0x66a8('0x9')]=_0x2b7cc2['timeout']||0xa;this[_0x66a8('0xa')]=_0x2b7cc2[_0x66a8('0xa')]||'beepall';this[_0x66a8('0xb')]=_0x2b7cc2[_0x66a8('0xb')];this[_0x66a8('0xc')]={};this[_0x66a8('0xd')]=0x0;this[_0x66a8('0xe')]='';this[_0x66a8('0xf')]();this[_0x66a8('0x10')]();}FaxQueue[_0x66a8('0x11')][_0x66a8('0xf')]=function(){var _0x55cb88=this[_0x66a8('0xc')][_0x66a8('0x12')];this[_0x66a8('0xc')]=_[_0x66a8('0x13')](this[_0x66a8('0xb')],'id');this[_0x66a8('0xc')][_0x66a8('0x12')]=_0x55cb88;};FaxQueue[_0x66a8('0x11')]['updateRealtime']=function(){this[_0x66a8('0x14')]=0x0;this[_0x66a8('0x15')]=0x0;for(var _0x248a80=0x0;_0x248a80=0x0?this[_0x66a8('0x18')]:0x0;var _0x1586a7={'id':this['id'],'available':this[_0x66a8('0x18')],'loggedIn':this[_0x66a8('0x14')],'name':this[_0x66a8('0x8')],'paused':this[_0x66a8('0x15')],'waiting':this[_0x66a8('0xd')]};var _0xf83ef3=md5(JSON[_0x66a8('0x19')](_0x1586a7));if(this['md5']!==_0xf83ef3){this[_0x66a8('0xe')]=_0xf83ef3;io['to'](util['format'](_0x66a8('0x1a'),_0x1586a7[_0x66a8('0x8')]))[_0x66a8('0x1b')](_0x66a8('0x1c'),_0x1586a7);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 1c7085a..1a113b8 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 _0x1603=['exports','name','Intervals'];(function(_0x2685c2,_0x2464ed){var _0x5c38f2=function(_0x235f5d){while(--_0x235f5d){_0x2685c2['push'](_0x2685c2['shift']());}};_0x5c38f2(++_0x2464ed);}(_0x1603,0x1bd));var _0x3160=function(_0x3f1842,_0x1e1a6f){_0x3f1842=_0x3f1842-0x0;var _0x23cad2=_0x1603[_0x3f1842];return _0x23cad2;};'use strict';function Interval(_0x46d9d4){this['id']=_0x46d9d4['id']||0x0;this['name']=_0x46d9d4[_0x3160('0x0')]||'';this[_0x3160('0x1')]=_0x46d9d4['Intervals']||{};}module[_0x3160('0x2')]=Interval; \ No newline at end of file +var _0x0e3c=['Intervals','exports','name'];(function(_0x4dcec1,_0x2f3a6d){var _0x4cafd7=function(_0x393299){while(--_0x393299){_0x4dcec1['push'](_0x4dcec1['shift']());}};_0x4cafd7(++_0x2f3a6d);}(_0x0e3c,0xc8));var _0xc0e3=function(_0x40179c,_0x214b2e){_0x40179c=_0x40179c-0x0;var _0x94346b=_0x0e3c[_0x40179c];return _0x94346b;};'use strict';function Interval(_0x531d01){this['id']=_0x531d01['id']||0x0;this[_0xc0e3('0x0')]=_0x531d01[_0xc0e3('0x0')]||'';this[_0xc0e3('0x1')]=_0x531d01['Intervals']||{};}module[_0xc0e3('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 4d0f15f..8d59dc1 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 _0xed5a=['_rr','map','paused','length','loggedIn','available','stringify','md5','format','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0xed5a,0x84));var _0xaed5=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xed5a[_0x55821d];return _0x58ea8a;};'use strict';var _=require(_0xaed5('0x0'));var md5=require('md5');var util=require(_0xaed5('0x1'));var Redis=require(_0xaed5('0x2'));var config=require(_0xaed5('0x3'));config['redis']=_[_0xaed5('0x4')](config[_0xaed5('0x5')],{'host':_0xaed5('0x6'),'port':0x18eb});var io=require(_0xaed5('0x7'))(new Redis(config['redis']));function MailQueue(_0xc866ca){this['id']=_0xc866ca['id']||0x0;this[_0xaed5('0x8')]=_0xc866ca[_0xaed5('0x8')]||'';this[_0xaed5('0x9')]=_0xc866ca[_0xaed5('0x9')]||0xa;this[_0xaed5('0xa')]=_0xc866ca[_0xaed5('0xa')]||_0xaed5('0xb');this[_0xaed5('0xc')]=_0xc866ca[_0xaed5('0xc')];this[_0xaed5('0xd')]={};this[_0xaed5('0xe')]=0x0;this['md5']='';this[_0xaed5('0xf')]();this[_0xaed5('0x10')]();}MailQueue[_0xaed5('0x11')][_0xaed5('0xf')]=function(){var _0x3b3836=this[_0xaed5('0xd')][_0xaed5('0x12')];this['mapAgentsId']=_[_0xaed5('0x13')](this['Agents'],'id');this[_0xaed5('0xd')][_0xaed5('0x12')]=_0x3b3836;};MailQueue['prototype'][_0xaed5('0x10')]=function(){this['loggedIn']=0x0;this[_0xaed5('0x14')]=0x0;for(var _0x4c82db=0x0;_0x4c82db=0x0?this[_0xaed5('0x17')]:0x0;var _0x3f04e1={'id':this['id'],'available':this[_0xaed5('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xaed5('0x14')],'waiting':this[_0xaed5('0xe')]};var _0x5377ca=md5(JSON[_0xaed5('0x18')](_0x3f04e1));if(this[_0xaed5('0x19')]!==_0x5377ca){this[_0xaed5('0x19')]=_0x5377ca;io['to'](util[_0xaed5('0x1a')]('mail:queue:%s',_0x3f04e1['name']))[_0xaed5('0x1b')](_0xaed5('0x1c'),_0x3f04e1);}};module[_0xaed5('0x1d')]=MailQueue; \ No newline at end of file +var _0x4d28=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','length','online','loggedIn','mailPause','available','paused','stringify','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name'];(function(_0x302c6f,_0x4a9502){var _0x34378c=function(_0x81667a){while(--_0x81667a){_0x302c6f['push'](_0x302c6f['shift']());}};_0x34378c(++_0x4a9502);}(_0x4d28,0x91));var _0x84d2=function(_0x56e063,_0x453233){_0x56e063=_0x56e063-0x0;var _0x766fcf=_0x4d28[_0x56e063];return _0x766fcf;};'use strict';var _=require(_0x84d2('0x0'));var md5=require(_0x84d2('0x1'));var util=require(_0x84d2('0x2'));var Redis=require(_0x84d2('0x3'));var config=require(_0x84d2('0x4'));config['redis']=_[_0x84d2('0x5')](config[_0x84d2('0x6')],{'host':_0x84d2('0x7'),'port':0x18eb});var io=require(_0x84d2('0x8'))(new Redis(config[_0x84d2('0x6')]));function MailQueue(_0x53ca22){this['id']=_0x53ca22['id']||0x0;this[_0x84d2('0x9')]=_0x53ca22[_0x84d2('0x9')]||'';this[_0x84d2('0xa')]=_0x53ca22['timeout']||0xa;this[_0x84d2('0xb')]=_0x53ca22[_0x84d2('0xb')]||_0x84d2('0xc');this[_0x84d2('0xd')]=_0x53ca22[_0x84d2('0xd')];this[_0x84d2('0xe')]={};this[_0x84d2('0xf')]=0x0;this[_0x84d2('0x1')]='';this[_0x84d2('0x10')]();this[_0x84d2('0x11')]();}MailQueue[_0x84d2('0x12')][_0x84d2('0x10')]=function(){var _0x2c3f9f=this[_0x84d2('0xe')]['_rr'];this[_0x84d2('0xe')]=_[_0x84d2('0x13')](this[_0x84d2('0xd')],'id');this['mapAgentsId'][_0x84d2('0x14')]=_0x2c3f9f;};MailQueue[_0x84d2('0x12')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x34b408=0x0;_0x34b408=0x0?this[_0x84d2('0x19')]:0x0;var _0x5efa0c={'id':this['id'],'available':this[_0x84d2('0x19')],'loggedIn':this[_0x84d2('0x17')],'name':this['name'],'paused':this[_0x84d2('0x1a')],'waiting':this[_0x84d2('0xf')]};var _0x164b32=md5(JSON[_0x84d2('0x1b')](_0x5efa0c));if(this[_0x84d2('0x1')]!==_0x164b32){this[_0x84d2('0x1')]=_0x164b32;io['to'](util[_0x84d2('0x1c')]('mail:queue:%s',_0x5efa0c[_0x84d2('0x9')]))[_0x84d2('0x1d')]('mail_queue:save',_0x5efa0c);}};module[_0x84d2('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e59f10e..ddef83e 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 _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x57d0dc,_0x387f3e){var _0x177765=function(_0x1bbc9e){while(--_0x1bbc9e){_0x57d0dc['push'](_0x57d0dc['shift']());}};_0x177765(++_0x387f3e);}(_0xadb5,0xad));var _0x5adb=function(_0x502a1c,_0x10d08c){_0x502a1c=_0x502a1c-0x0;var _0x5e9fef=_0xadb5[_0x502a1c];return _0x5e9fef;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 78dacb7..fc6313b 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 _0x9f94=['loggedIn','length','online','Agents','smsPause','available','paused','waiting','stringify','sms:queue:%s','emit','lodash','md5','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype'];(function(_0x348d44,_0x1392c6){var _0x59d011=function(_0x568db4){while(--_0x568db4){_0x348d44['push'](_0x348d44['shift']());}};_0x59d011(++_0x1392c6);}(_0x9f94,0x1e7));var _0x49f9=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9f94[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x49f9('0x0'));var md5=require(_0x49f9('0x1'));var util=require(_0x49f9('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x49f9('0x3')]=_[_0x49f9('0x4')](config[_0x49f9('0x3')],{'host':_0x49f9('0x5'),'port':0x18eb});var io=require(_0x49f9('0x6'))(new Redis(config['redis']));function SmsQueue(_0x6dbeac){this['id']=_0x6dbeac['id']||0x0;this[_0x49f9('0x7')]=_0x6dbeac[_0x49f9('0x7')]||'';this[_0x49f9('0x8')]=_0x6dbeac[_0x49f9('0x8')]||0xa;this[_0x49f9('0x9')]=_0x6dbeac[_0x49f9('0x9')]||_0x49f9('0xa');this['Agents']=_0x6dbeac['Agents'];this[_0x49f9('0xb')]={};this['waiting']=0x0;this[_0x49f9('0x1')]='';this[_0x49f9('0xc')]();this[_0x49f9('0xd')]();}SmsQueue['prototype'][_0x49f9('0xc')]=function(){var _0x59bb47=this[_0x49f9('0xb')][_0x49f9('0xe')];this[_0x49f9('0xb')]=_[_0x49f9('0xf')](this['Agents'],'id');this['mapAgentsId'][_0x49f9('0xe')]=_0x59bb47;};SmsQueue[_0x49f9('0x10')][_0x49f9('0xd')]=function(){this[_0x49f9('0x11')]=0x0;this['paused']=0x0;for(var _0x4e7790=0x0;_0x4e7790=0x0?this[_0x49f9('0x16')]:0x0;var _0x3cc45e={'id':this['id'],'available':this[_0x49f9('0x16')],'loggedIn':this[_0x49f9('0x11')],'name':this[_0x49f9('0x7')],'paused':this[_0x49f9('0x17')],'waiting':this[_0x49f9('0x18')]};var _0xa9b24c=md5(JSON[_0x49f9('0x19')](_0x3cc45e));if(this[_0x49f9('0x1')]!==_0xa9b24c){this['md5']=_0xa9b24c;io['to'](util['format'](_0x49f9('0x1a'),_0x3cc45e['name']))[_0x49f9('0x1b')]('sms_queue:save',_0x3cc45e);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xe13a=['waiting','updateRouting','prototype','_rr','map','length','online','loggedIn','paused','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xe13a,0x178));var _0xae13=function(_0xa930d5,_0x5ea087){_0xa930d5=_0xa930d5-0x0;var _0x3df493=_0xe13a[_0xa930d5];return _0x3df493;};'use strict';var _=require('lodash');var md5=require(_0xae13('0x0'));var util=require(_0xae13('0x1'));var Redis=require(_0xae13('0x2'));var config=require(_0xae13('0x3'));config['redis']=_[_0xae13('0x4')](config[_0xae13('0x5')],{'host':_0xae13('0x6'),'port':0x18eb});var io=require(_0xae13('0x7'))(new Redis(config[_0xae13('0x5')]));function SmsQueue(_0x248e53){this['id']=_0x248e53['id']||0x0;this[_0xae13('0x8')]=_0x248e53[_0xae13('0x8')]||'';this[_0xae13('0x9')]=_0x248e53['timeout']||0xa;this[_0xae13('0xa')]=_0x248e53[_0xae13('0xa')]||_0xae13('0xb');this[_0xae13('0xc')]=_0x248e53[_0xae13('0xc')];this[_0xae13('0xd')]={};this[_0xae13('0xe')]=0x0;this[_0xae13('0x0')]='';this[_0xae13('0xf')]();this['updateRealtime']();}SmsQueue[_0xae13('0x10')][_0xae13('0xf')]=function(){var _0x3d6a85=this[_0xae13('0xd')][_0xae13('0x11')];this[_0xae13('0xd')]=_[_0xae13('0x12')](this['Agents'],'id');this[_0xae13('0xd')][_0xae13('0x11')]=_0x3d6a85;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x52484b=0x0;_0x52484b=0x0?this[_0xae13('0x17')]:0x0;var _0x1b33b7={'id':this['id'],'available':this[_0xae13('0x17')],'loggedIn':this[_0xae13('0x15')],'name':this[_0xae13('0x8')],'paused':this['paused'],'waiting':this[_0xae13('0xe')]};var _0x50eb6c=md5(JSON[_0xae13('0x18')](_0x1b33b7));if(this[_0xae13('0x0')]!==_0x50eb6c){this['md5']=_0x50eb6c;io['to'](util[_0xae13('0x19')](_0xae13('0x1a'),_0x1b33b7[_0xae13('0x8')]))[_0xae13('0x1b')](_0xae13('0x1c'),_0x1b33b7);}};module[_0xae13('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index ab6d427..ccc6f97 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 _0xb38c=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','waiting','format','whatsapp:queue:%s','whatsapp_queue:save','exports','util','ioredis'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb38c,0xfa));var _0xcb38=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0xb38c[_0x151381];return _0x2afab6;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xcb38('0x0'));var Redis=require(_0xcb38('0x1'));var config=require(_0xcb38('0x2'));config[_0xcb38('0x3')]=_[_0xcb38('0x4')](config[_0xcb38('0x3')],{'host':_0xcb38('0x5'),'port':0x18eb});var io=require(_0xcb38('0x6'))(new Redis(config[_0xcb38('0x3')]));function WhatsappQueue(_0x27eb4a){this['id']=_0x27eb4a['id']||0x0;this[_0xcb38('0x7')]=_0x27eb4a[_0xcb38('0x7')]||'';this[_0xcb38('0x8')]=_0x27eb4a[_0xcb38('0x8')]||0xa;this[_0xcb38('0x9')]=_0x27eb4a[_0xcb38('0x9')]||_0xcb38('0xa');this['Agents']=_0x27eb4a[_0xcb38('0xb')];this[_0xcb38('0xc')]={};this['waiting']=0x0;this[_0xcb38('0xd')]='';this[_0xcb38('0xe')]();this[_0xcb38('0xf')]();}WhatsappQueue[_0xcb38('0x10')]['updateRouting']=function(){var _0x3414b4=this[_0xcb38('0xc')][_0xcb38('0x11')];this[_0xcb38('0xc')]=_[_0xcb38('0x12')](this[_0xcb38('0xb')],'id');this[_0xcb38('0xc')][_0xcb38('0x11')]=_0x3414b4;};WhatsappQueue[_0xcb38('0x10')][_0xcb38('0xf')]=function(){this[_0xcb38('0x13')]=0x0;this[_0xcb38('0x14')]=0x0;for(var _0x28aaa0=0x0;_0x28aaa0=0x0?this[_0xcb38('0x16')]:0x0;var _0x4d643d={'id':this['id'],'available':this[_0xcb38('0x16')],'loggedIn':this[_0xcb38('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xcb38('0x17')]};var _0x9f4702=md5(JSON['stringify'](_0x4d643d));if(this[_0xcb38('0xd')]!==_0x9f4702){this['md5']=_0x9f4702;io['to'](util[_0xcb38('0x18')](_0xcb38('0x19'),_0x4d643d[_0xcb38('0x7')]))['emit'](_0xcb38('0x1a'),_0x4d643d);}};module[_0xcb38('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x6b98=['updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','paused','length','online','whatsappPause','available','format','whatsapp:queue:%s','whatsapp_queue:save','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x58df06,_0x12780b){var _0x4e7710=function(_0x592ac5){while(--_0x592ac5){_0x58df06['push'](_0x58df06['shift']());}};_0x4e7710(++_0x12780b);}(_0x6b98,0x13a));var _0x86b9=function(_0x3f4683,_0x4062f9){_0x3f4683=_0x3f4683-0x0;var _0x1a80aa=_0x6b98[_0x3f4683];return _0x1a80aa;};'use strict';var _=require('lodash');var md5=require(_0x86b9('0x0'));var util=require(_0x86b9('0x1'));var Redis=require(_0x86b9('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x86b9('0x3')],{'host':_0x86b9('0x4'),'port':0x18eb});var io=require(_0x86b9('0x5'))(new Redis(config[_0x86b9('0x3')]));function WhatsappQueue(_0x190659){this['id']=_0x190659['id']||0x0;this['name']=_0x190659[_0x86b9('0x6')]||'';this[_0x86b9('0x7')]=_0x190659['timeout']||0xa;this[_0x86b9('0x8')]=_0x190659[_0x86b9('0x8')]||_0x86b9('0x9');this['Agents']=_0x190659[_0x86b9('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x86b9('0x0')]='';this['updateRouting']();this[_0x86b9('0xb')]();}WhatsappQueue[_0x86b9('0xc')]['updateRouting']=function(){var _0x4f0c6e=this['mapAgentsId'][_0x86b9('0xd')];this[_0x86b9('0xe')]=_[_0x86b9('0xf')](this[_0x86b9('0xa')],'id');this[_0x86b9('0xe')][_0x86b9('0xd')]=_0x4f0c6e;};WhatsappQueue[_0x86b9('0xc')]['updateRealtime']=function(){this[_0x86b9('0x10')]=0x0;this[_0x86b9('0x11')]=0x0;for(var _0x2d4cc5=0x0;_0x2d4cc5=0x0?this['available']:0x0;var _0x378e94={'id':this['id'],'available':this[_0x86b9('0x15')],'loggedIn':this[_0x86b9('0x10')],'name':this[_0x86b9('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x2a44ff=md5(JSON['stringify'](_0x378e94));if(this[_0x86b9('0x0')]!==_0x2a44ff){this[_0x86b9('0x0')]=_0x2a44ff;io['to'](util[_0x86b9('0x16')](_0x86b9('0x17'),_0x378e94[_0x86b9('0x6')]))['emit'](_0x86b9('0x18'),_0x378e94);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 652ead3..d88b0aa 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index a97cdac..14ac445 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 _0xc859=['UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','../client','update'];(function(_0x2207fc,_0x424044){var _0x3d7025=function(_0x43ccb9){while(--_0x43ccb9){_0x2207fc['push'](_0x2207fc['shift']());}};_0x3d7025(++_0x424044);}(_0xc859,0x1c5));var _0x9c85=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xc859[_0x4d07cc];return _0x42de3b;};'use strict';var client=require(_0x9c85('0x0'));exports[_0x9c85('0x1')]=function(_0x38f2c,_0x57b49f){return client['Request'](_0x9c85('0x2'),{'body':_0x57b49f,'options':{'where':{'id':_0x38f2c}},'log':_0x9c85('0x3')});};exports[_0x9c85('0x4')]=function(_0xc5806f,_0x67a59){return client[_0x9c85('0x5')](_0x9c85('0x6'),{'body':_0x67a59,'options':{'where':{'id':_0xc5806f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x0333=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0x0333,0x164));var _0x3033=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0x0333[_0x32f6b9];return _0x267d52;};'use strict';var client=require('../client');exports[_0x3033('0x0')]=function(_0x2b7a9c,_0x2c9020){return client[_0x3033('0x1')](_0x3033('0x2'),{'body':_0x2c9020,'options':{'where':{'id':_0x2b7a9c}},'log':_0x3033('0x3')});};exports[_0x3033('0x4')]=function(_0x84924d,_0x2b8d9d){return client[_0x3033('0x1')](_0x3033('0x5'),{'body':_0x2b8d9d,'options':{'where':{'id':_0x84924d}},'log':_0x3033('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index d7d3e9b..560bc03 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 _0x94a5=['CreateChatMessage'];(function(_0x57cd19,_0x376ac7){var _0x21ea00=function(_0x1b6c98){while(--_0x1b6c98){_0x57cd19['push'](_0x57cd19['shift']());}};_0x21ea00(++_0x376ac7);}(_0x94a5,0x166));var _0x594a=function(_0x1babed,_0x3ed74b){_0x1babed=_0x1babed-0x0;var _0x4e9b0a=_0x94a5[_0x1babed];return _0x4e9b0a;};'use strict';var client=require('../client');exports['create']=function(_0x329b7a){return client['Request'](_0x594a('0x0'),{'body':_0x329b7a,'log':'createChatMessage'});}; \ No newline at end of file +var _0x1dcc=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1dcc,0x72));var _0xc1dc=function(_0x2fe5b0,_0x35e231){_0x2fe5b0=_0x2fe5b0-0x0;var _0x280786=_0x1dcc[_0x2fe5b0];return _0x280786;};'use strict';var client=require(_0xc1dc('0x0'));exports[_0xc1dc('0x1')]=function(_0x56b898){return client[_0xc1dc('0x2')](_0xc1dc('0x3'),{'body':_0x56b898,'log':_0xc1dc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c2c4287..08bffa7 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 _0x1052=['strategy','User','Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1052,0xf4));var _0x2105=function(_0x3c9741,_0x557e3d){_0x3c9741=_0x3c9741-0x0;var _0x72aa01=_0x1052[_0x3c9741];return _0x72aa01;};'use strict';var client=require(_0x2105('0x0'));exports[_0x2105('0x1')]=function(){return function(){return client[_0x2105('0x2')](_0x2105('0x3'),{'options':{'raw':![],'attributes':['id',_0x2105('0x4'),_0x2105('0x5'),_0x2105('0x6')],'include':[{'model':_0x2105('0x7'),'as':_0x2105('0x8'),'attributes':['id','name','online',_0x2105('0x9')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x9fc5=['online','chatPause','getChatQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x285678,_0x43ad36){var _0x2c4fb7=function(_0x4548f8){while(--_0x4548f8){_0x285678['push'](_0x285678['shift']());}};_0x2c4fb7(++_0x43ad36);}(_0x9fc5,0xb6));var _0x59fc=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0x9fc5[_0x65d12e];return _0x4274e0;};'use strict';var client=require('../client');exports[_0x59fc('0x0')]=function(){return function(){return client[_0x59fc('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x59fc('0x2'),_0x59fc('0x3'),_0x59fc('0x4')],'include':[{'model':_0x59fc('0x5'),'as':_0x59fc('0x6'),'attributes':['id',_0x59fc('0x2'),_0x59fc('0x7'),_0x59fc('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 65deb8b..9797cf3 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 _0x9d02=['update','Request','UpdateChatQueueReport','DESC','../client','CreateChatQueueReport'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9d02,0x118));var _0x29d0=function(_0x10fe31,_0x51c669){_0x10fe31=_0x10fe31-0x0;var _0x72eb43=_0x9d02[_0x10fe31];return _0x72eb43;};'use strict';var client=require(_0x29d0('0x0'));exports['create']=function(_0x38b711){return client['Request'](_0x29d0('0x1'),{'body':_0x38b711,'log':'CreateChatQueueReport'});};exports[_0x29d0('0x2')]=function(_0x13171d,_0x58e99e){return client[_0x29d0('0x3')](_0x29d0('0x4'),{'body':_0x58e99e,'options':{'where':{'uniqueid':_0x13171d},'order':[['id',_0x29d0('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x1f63=['DESC','UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport'];(function(_0x31e3d5,_0x3fa1cd){var _0x4da910=function(_0x5dc244){while(--_0x5dc244){_0x31e3d5['push'](_0x31e3d5['shift']());}};_0x4da910(++_0x3fa1cd);}(_0x1f63,0x7a));var _0x31f6=function(_0xeaef5,_0x26684c){_0xeaef5=_0xeaef5-0x0;var _0x336a80=_0x1f63[_0xeaef5];return _0x336a80;};'use strict';var client=require(_0x31f6('0x0'));exports[_0x31f6('0x1')]=function(_0x57257d){return client[_0x31f6('0x2')](_0x31f6('0x3'),{'body':_0x57257d,'log':_0x31f6('0x3')});};exports['update']=function(_0xd0f319,_0x33b415){return client['Request']('UpdateChatQueueReport',{'body':_0x33b415,'options':{'where':{'uniqueid':_0xd0f319},'order':[['id',_0x31f6('0x4')]],'limit':0x1},'log':_0x31f6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e7024fa..7b2e685 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x9ad1e1,_0x375db7){var _0x5da13d=function(_0x4f1556){while(--_0x4f1556){_0x9ad1e1['push'](_0x9ad1e1['shift']());}};_0x5da13d(++_0x375db7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x5705cf,_0x20016d){var _0x222f3c=function(_0x50d35f){while(--_0x50d35f){_0x5705cf['push'](_0x5705cf['shift']());}};_0x222f3c(++_0x20016d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 88d8694..a822f1b 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 _0x9f7e=['CreateFaxMessage','../client','create','Request'];(function(_0x40be86,_0x68fe5d){var _0xda3c3b=function(_0x39deab){while(--_0x39deab){_0x40be86['push'](_0x40be86['shift']());}};_0xda3c3b(++_0x68fe5d);}(_0x9f7e,0xe5));var _0xe9f7=function(_0x2d7150,_0x1d32ed){_0x2d7150=_0x2d7150-0x0;var _0x4976e0=_0x9f7e[_0x2d7150];return _0x4976e0;};'use strict';var client=require(_0xe9f7('0x0'));exports[_0xe9f7('0x1')]=function(_0x2ceb26){return client[_0xe9f7('0x2')](_0xe9f7('0x3'),{'body':_0x2ceb26,'log':'createFaxMessage'});}; \ No newline at end of file +var _0xded7=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x4aad6a,_0xac649c){var _0x9812dc=function(_0x37d2ed){while(--_0x37d2ed){_0x4aad6a['push'](_0x4aad6a['shift']());}};_0x9812dc(++_0xac649c);}(_0xded7,0x89));var _0x7ded=function(_0x575544,_0x363453){_0x575544=_0x575544-0x0;var _0x5786c9=_0xded7[_0x575544];return _0x5786c9;};'use strict';var client=require(_0x7ded('0x0'));exports[_0x7ded('0x1')]=function(_0xdd112f){return client[_0x7ded('0x2')](_0x7ded('0x3'),{'body':_0xdd112f,'log':_0x7ded('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d74f55f..1998b80 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 _0xbe44=['timeout','online','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x1f2d6f,_0x2fff33){var _0x573615=function(_0x292845){while(--_0x292845){_0x1f2d6f['push'](_0x1f2d6f['shift']());}};_0x573615(++_0x2fff33);}(_0xbe44,0x1e8));var _0x4be4=function(_0x5b04a3,_0xfda4fd){_0x5b04a3=_0x5b04a3-0x0;var _0x1adf11=_0xbe44[_0x5b04a3];return _0x1adf11;};'use strict';var client=require('../client');exports[_0x4be4('0x0')]=function(){return function(){return client[_0x4be4('0x1')](_0x4be4('0x2'),{'options':{'raw':![],'attributes':['id',_0x4be4('0x3'),_0x4be4('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x4be4('0x5'),'faxPause']}]},'log':_0x4be4('0x0')});};}; \ No newline at end of file +var _0x39b1=['GetFaxQueue','name','timeout','Agents','../client','getFaxQueues','Request'];(function(_0x43231e,_0x3f9f21){var _0x4ef1bf=function(_0x4c0463){while(--_0x4c0463){_0x43231e['push'](_0x43231e['shift']());}};_0x4ef1bf(++_0x3f9f21);}(_0x39b1,0x10e));var _0x139b=function(_0x544ade,_0x45e0e9){_0x544ade=_0x544ade-0x0;var _0x43a740=_0x39b1[_0x544ade];return _0x43a740;};'use strict';var client=require(_0x139b('0x0'));exports[_0x139b('0x1')]=function(){return function(){return client[_0x139b('0x2')](_0x139b('0x3'),{'options':{'raw':![],'attributes':['id',_0x139b('0x4'),_0x139b('0x5'),'strategy'],'include':[{'model':'User','as':_0x139b('0x6'),'attributes':['id',_0x139b('0x4'),'online','faxPause']}]},'log':_0x139b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index b1049de..aa23172 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 _0xea30=['UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport','update'];(function(_0x11b92e,_0x382de4){var _0xde41c2=function(_0x20d2cd){while(--_0x20d2cd){_0x11b92e['push'](_0x11b92e['shift']());}};_0xde41c2(++_0x382de4);}(_0xea30,0xc2));var _0x0ea3=function(_0x4bcb0d,_0x389a59){_0x4bcb0d=_0x4bcb0d-0x0;var _0x5b41c5=_0xea30[_0x4bcb0d];return _0x5b41c5;};'use strict';var client=require(_0x0ea3('0x0'));exports['create']=function(_0x356822){return client[_0x0ea3('0x1')](_0x0ea3('0x2'),{'body':_0x356822,'log':'CreateFaxQueueReport'});};exports[_0x0ea3('0x3')]=function(_0x345630,_0x4f037e){return client[_0x0ea3('0x1')](_0x0ea3('0x4'),{'body':_0x4f037e,'options':{'where':{'uniqueid':_0x345630},'order':[['id',_0x0ea3('0x5')]],'limit':0x1},'log':_0x0ea3('0x4')});}; \ No newline at end of file +var _0x9df4=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9df4,0x185));var _0x49df=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0x9df4[_0xf458be];return _0x52b318;};'use strict';var client=require(_0x49df('0x0'));exports[_0x49df('0x1')]=function(_0x1d3d07){return client[_0x49df('0x2')](_0x49df('0x3'),{'body':_0x1d3d07,'log':_0x49df('0x3')});};exports['update']=function(_0x26a8c3,_0x56a9ee){return client[_0x49df('0x2')](_0x49df('0x4'),{'body':_0x56a9ee,'options':{'where':{'uniqueid':_0x26a8c3},'order':[['id',_0x49df('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index afbfcff..87df092 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 _0xa1d2=['Request','GetInterval','name','Interval','Intervals','interval','../client','getIntervals'];(function(_0x384bbe,_0x1fb31d){var _0x49e066=function(_0x552b87){while(--_0x552b87){_0x384bbe['push'](_0x384bbe['shift']());}};_0x49e066(++_0x1fb31d);}(_0xa1d2,0x10e));var _0x2a1d=function(_0x5c7dea,_0x460e53){_0x5c7dea=_0x5c7dea-0x0;var _0x3975fb=_0xa1d2[_0x5c7dea];return _0x3975fb;};'use strict';var client=require(_0x2a1d('0x0'));exports[_0x2a1d('0x1')]=function(){return function(){return client[_0x2a1d('0x2')](_0x2a1d('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2a1d('0x4')],'include':[{'model':_0x2a1d('0x5'),'as':_0x2a1d('0x6'),'attributes':['id',_0x2a1d('0x4'),_0x2a1d('0x7')]}]},'log':_0x2a1d('0x1')});};}; \ No newline at end of file +var _0x3d15=['name','Interval','Intervals','interval','getIntervals','../client'];(function(_0x5fb1c,_0x595dfe){var _0x497014=function(_0x473db5){while(--_0x473db5){_0x5fb1c['push'](_0x5fb1c['shift']());}};_0x497014(++_0x595dfe);}(_0x3d15,0x17f));var _0x53d1=function(_0x28caf4,_0x797e55){_0x28caf4=_0x28caf4-0x0;var _0x503f93=_0x3d15[_0x28caf4];return _0x503f93;};'use strict';var client=require(_0x53d1('0x0'));exports['getIntervals']=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x53d1('0x1')],'include':[{'model':_0x53d1('0x2'),'as':_0x53d1('0x3'),'attributes':['id',_0x53d1('0x1'),_0x53d1('0x4')]}]},'log':_0x53d1('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 892a3b1..b213621 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 _0x896e=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x896e,0x1e9));var _0xe896=function(_0x470933,_0x4a87b4){_0x470933=_0x470933-0x0;var _0x4354f9=_0x896e[_0x470933];return _0x4354f9;};'use strict';var client=require(_0xe896('0x0'));exports[_0xe896('0x1')]=function(_0x3feebe,_0x229b59){return client[_0xe896('0x2')](_0xe896('0x3'),{'body':_0x229b59,'options':{'where':{'id':_0x3feebe}},'log':_0xe896('0x4')});};exports[_0xe896('0x5')]=function(_0x3f85e5,_0x2d3521){return client[_0xe896('0x2')](_0xe896('0x6'),{'body':_0x2d3521,'options':{'where':{'id':_0x3f85e5}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x1eba=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x1eba[_0x2cde0a];return _0x260610;};'use strict';var client=require(_0xa1eb('0x0'));exports[_0xa1eb('0x1')]=function(_0x406a58,_0x2158d5){return client[_0xa1eb('0x2')]('UpdateMailInteraction',{'body':_0x2158d5,'options':{'where':{'id':_0x406a58}},'log':'updateMailInteraction'});};exports[_0xa1eb('0x3')]=function(_0x34be5a,_0x16a13a){return client[_0xa1eb('0x2')](_0xa1eb('0x4'),{'body':_0x16a13a,'options':{'where':{'id':_0x34be5a}},'log':_0xa1eb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 81a0da0..7b53d28 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 _0x8230=['create','CreateMailMessage','createMailMessage','../client'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0x8230,0x137));var _0x0823=function(_0x1de3ce,_0x57c0ad){_0x1de3ce=_0x1de3ce-0x0;var _0x669651=_0x8230[_0x1de3ce];return _0x669651;};'use strict';var client=require(_0x0823('0x0'));exports[_0x0823('0x1')]=function(_0x4063e7){return client['Request'](_0x0823('0x2'),{'body':_0x4063e7,'log':_0x0823('0x3')});}; \ No newline at end of file +var _0xf26b=['create','Request','CreateMailMessage'];(function(_0x4035b1,_0x14eed8){var _0x5c65b2=function(_0xb6c0a3){while(--_0xb6c0a3){_0x4035b1['push'](_0x4035b1['shift']());}};_0x5c65b2(++_0x14eed8);}(_0xf26b,0x183));var _0xbf26=function(_0x4926c7,_0x88884c){_0x4926c7=_0x4926c7-0x0;var _0x40bd06=_0xf26b[_0x4926c7];return _0x40bd06;};'use strict';var client=require('../client');exports[_0xbf26('0x0')]=function(_0x4c700d){return client[_0xbf26('0x1')](_0xbf26('0x2'),{'body':_0x4c700d,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 0efe2ad..93b7ab6 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 _0x401d=['GetMailQueue','name','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request'];(function(_0x4b95bb,_0x24ca5c){var _0x5bc320=function(_0x122f7b){while(--_0x122f7b){_0x4b95bb['push'](_0x4b95bb['shift']());}};_0x5bc320(++_0x24ca5c);}(_0x401d,0x1c9));var _0xd401=function(_0x1b3505,_0x5a33a5){_0x1b3505=_0x1b3505-0x0;var _0x5936ae=_0x401d[_0x1b3505];return _0x5936ae;};'use strict';var client=require(_0xd401('0x0'));exports[_0xd401('0x1')]=function(){return function(){return client[_0xd401('0x2')](_0xd401('0x3'),{'options':{'raw':![],'attributes':['id',_0xd401('0x4'),'timeout',_0xd401('0x5')],'include':[{'model':_0xd401('0x6'),'as':_0xd401('0x7'),'attributes':['id',_0xd401('0x4'),_0xd401('0x8'),_0xd401('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xd3df=['Agents','name','online','../client','getMailQueues','Request','GetMailQueue'];(function(_0x3d8785,_0x55603f){var _0x27458b=function(_0x2c8ec3){while(--_0x2c8ec3){_0x3d8785['push'](_0x3d8785['shift']());}};_0x27458b(++_0x55603f);}(_0xd3df,0xab));var _0xfd3d=function(_0x182ef5,_0x3439f8){_0x182ef5=_0x182ef5-0x0;var _0x3e1d9a=_0xd3df[_0x182ef5];return _0x3e1d9a;};'use strict';var client=require(_0xfd3d('0x0'));exports[_0xfd3d('0x1')]=function(){return function(){return client[_0xfd3d('0x2')](_0xfd3d('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':_0xfd3d('0x4'),'attributes':['id',_0xfd3d('0x5'),_0xfd3d('0x6'),'mailPause']}]},'log':_0xfd3d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index c06d220..455a8ba 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 _0x8548=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0x658a4c,_0x1f2c66){var _0x3e7d40=function(_0x3d387b){while(--_0x3d387b){_0x658a4c['push'](_0x658a4c['shift']());}};_0x3e7d40(++_0x1f2c66);}(_0x8548,0x155));var _0x8854=function(_0x3a47c7,_0x416b17){_0x3a47c7=_0x3a47c7-0x0;var _0x9b7d65=_0x8548[_0x3a47c7];return _0x9b7d65;};'use strict';var client=require(_0x8854('0x0'));exports[_0x8854('0x1')]=function(_0x363a4b){return client[_0x8854('0x2')](_0x8854('0x3'),{'body':_0x363a4b,'log':'CreateMailQueueReport'});};exports[_0x8854('0x4')]=function(_0x4fd420,_0x560dd8){return client[_0x8854('0x2')](_0x8854('0x5'),{'body':_0x560dd8,'options':{'where':{'uniqueid':_0x4fd420},'order':[['id','DESC']],'limit':0x1},'log':_0x8854('0x5')});}; \ No newline at end of file +var _0xf189=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x7867c9,_0x2e12d0){var _0x5d17fc=function(_0x4a141b){while(--_0x4a141b){_0x7867c9['push'](_0x7867c9['shift']());}};_0x5d17fc(++_0x2e12d0);}(_0xf189,0xb0));var _0x9f18=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf189[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x9f18('0x0'));exports[_0x9f18('0x1')]=function(_0x4dfc4d){return client[_0x9f18('0x2')](_0x9f18('0x3'),{'body':_0x4dfc4d,'log':_0x9f18('0x3')});};exports[_0x9f18('0x4')]=function(_0x2b4c92,_0x147a6a){return client[_0x9f18('0x2')](_0x9f18('0x5'),{'body':_0x147a6a,'options':{'where':{'uniqueid':_0x2b4c92},'order':[['id',_0x9f18('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 50c369d..f0d3283 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 _0x55e7=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x3b25f7,_0x305c1e){var _0x36988e=function(_0x339b6e){while(--_0x339b6e){_0x3b25f7['push'](_0x3b25f7['shift']());}};_0x36988e(++_0x305c1e);}(_0x55e7,0xa2));var _0x755e=function(_0xcec27,_0x1fcf1a){_0xcec27=_0xcec27-0x0;var _0x110f9c=_0x55e7[_0xcec27];return _0x110f9c;};'use strict';var client=require(_0x755e('0x0'));exports[_0x755e('0x1')]=function(_0x13d05c,_0x182001){return client[_0x755e('0x2')](_0x755e('0x3'),{'body':_0x182001,'options':{'where':{'id':_0x13d05c}},'log':_0x755e('0x4')});};exports['addTags']=function(_0x478ee6,_0x39da46){return client[_0x755e('0x2')](_0x755e('0x5'),{'body':_0x39da46,'options':{'where':{'id':_0x478ee6}},'log':_0x755e('0x6')});}; \ No newline at end of file +var _0x8557=['Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x59ffff,_0x5bd5cf){var _0x1d3757=function(_0x1739e5){while(--_0x1739e5){_0x59ffff['push'](_0x59ffff['shift']());}};_0x1d3757(++_0x5bd5cf);}(_0x8557,0xc5));var _0x7855=function(_0x5df2df,_0x34d2f5){_0x5df2df=_0x5df2df-0x0;var _0x69a0af=_0x8557[_0x5df2df];return _0x69a0af;};'use strict';var client=require(_0x7855('0x0'));exports['update']=function(_0x48fbed,_0x404aa2){return client[_0x7855('0x1')]('UpdateOpenchannelInteraction',{'body':_0x404aa2,'options':{'where':{'id':_0x48fbed}},'log':_0x7855('0x2')});};exports[_0x7855('0x3')]=function(_0x1ceb69,_0x51a5b4){return client['Request'](_0x7855('0x4'),{'body':_0x51a5b4,'options':{'where':{'id':_0x1ceb69}},'log':_0x7855('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index e944f45..b991fbd 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 _0x6bba=['CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x3cc96f,_0x4b41e5){var _0x43a2c0=function(_0x55ca2c){while(--_0x55ca2c){_0x3cc96f['push'](_0x3cc96f['shift']());}};_0x43a2c0(++_0x4b41e5);}(_0x6bba,0x194));var _0xa6bb=function(_0x1c1798,_0x24812b){_0x1c1798=_0x1c1798-0x0;var _0x4f235e=_0x6bba[_0x1c1798];return _0x4f235e;};'use strict';var client=require(_0xa6bb('0x0'));exports['create']=function(_0x289210){return client['Request'](_0xa6bb('0x1'),{'body':_0x289210,'log':_0xa6bb('0x2')});}; \ No newline at end of file +var _0x5c7d=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5c7d,0x149));var _0xd5c7=function(_0x1517e2,_0x85febe){_0x1517e2=_0x1517e2-0x0;var _0x81b4bc=_0x5c7d[_0x1517e2];return _0x81b4bc;};'use strict';var client=require(_0xd5c7('0x0'));exports[_0xd5c7('0x1')]=function(_0x130ef1){return client[_0xd5c7('0x2')](_0xd5c7('0x3'),{'body':_0x130ef1,'log':_0xd5c7('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 30d5ead..0e764be 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 _0xd506=['online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','User','name'];(function(_0x306a91,_0x3f288f){var _0xe1e52a=function(_0xd097ea){while(--_0xd097ea){_0x306a91['push'](_0x306a91['shift']());}};_0xe1e52a(++_0x3f288f);}(_0xd506,0x11a));var _0x6d50=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xd506[_0xaa0309];return _0x5de7ce;};'use strict';var client=require(_0x6d50('0x0'));exports[_0x6d50('0x1')]=function(){return function(){return client['Request'](_0x6d50('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x6d50('0x3'),'as':'Agents','attributes':['id',_0x6d50('0x4'),_0x6d50('0x5'),_0x6d50('0x6')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x85ae=['timeout','User','Agents','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x4fd5d3,_0x214090){var _0xf62a8b=function(_0x500b1e){while(--_0x500b1e){_0x4fd5d3['push'](_0x4fd5d3['shift']());}};_0xf62a8b(++_0x214090);}(_0x85ae,0xf7));var _0xe85a=function(_0x37a78b,_0x411e6b){_0x37a78b=_0x37a78b-0x0;var _0x41b329=_0x85ae[_0x37a78b];return _0x41b329;};'use strict';var client=require(_0xe85a('0x0'));exports[_0xe85a('0x1')]=function(){return function(){return client[_0xe85a('0x2')](_0xe85a('0x3'),{'options':{'raw':![],'attributes':['id',_0xe85a('0x4'),_0xe85a('0x5'),'strategy'],'include':[{'model':_0xe85a('0x6'),'as':_0xe85a('0x7'),'attributes':['id',_0xe85a('0x4'),_0xe85a('0x8'),'openchannelPause']}]},'log':_0xe85a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 2f6c716..39262b4 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 _0x88fa=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x88fa,0x1d3));var _0xa88f=function(_0x18da3b,_0x5c3808){_0x18da3b=_0x18da3b-0x0;var _0x54806b=_0x88fa[_0x18da3b];return _0x54806b;};'use strict';var client=require(_0xa88f('0x0'));exports['create']=function(_0x3a9105){return client[_0xa88f('0x1')](_0xa88f('0x2'),{'body':_0x3a9105,'log':_0xa88f('0x2')});};exports[_0xa88f('0x3')]=function(_0x5be83c,_0x53a4e8){return client[_0xa88f('0x1')](_0xa88f('0x4'),{'body':_0x53a4e8,'options':{'where':{'uniqueid':_0x5be83c},'order':[['id',_0xa88f('0x5')]],'limit':0x1},'log':_0xa88f('0x4')});}; \ No newline at end of file +var _0x9744=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9744,0x1ea));var _0x4974=function(_0x1b4749,_0x548ecf){_0x1b4749=_0x1b4749-0x0;var _0x28d020=_0x9744[_0x1b4749];return _0x28d020;};'use strict';var client=require(_0x4974('0x0'));exports[_0x4974('0x1')]=function(_0x550fb9){return client[_0x4974('0x2')](_0x4974('0x3'),{'body':_0x550fb9,'log':_0x4974('0x3')});};exports[_0x4974('0x4')]=function(_0x1bb8ea,_0x2b3142){return client[_0x4974('0x2')](_0x4974('0x5'),{'body':_0x2b3142,'options':{'where':{'uniqueid':_0x1bb8ea},'order':[['id',_0x4974('0x6')]],'limit':0x1},'log':_0x4974('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0861524..d9059df 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 _0x1247=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x1247,0xb6));var _0x7124=function(_0x323d87,_0x4ef3f9){_0x323d87=_0x323d87-0x0;var _0x5e8f74=_0x1247[_0x323d87];return _0x5e8f74;};'use strict';var client=require(_0x7124('0x0'));exports[_0x7124('0x1')]=function(_0x498325,_0x4d37c0){return client[_0x7124('0x2')](_0x7124('0x3'),{'body':_0x4d37c0,'options':{'where':{'id':_0x498325}},'log':_0x7124('0x4')});};exports['addTags']=function(_0x3bdce3,_0x3ab32e){return client[_0x7124('0x2')](_0x7124('0x5'),{'body':_0x3ab32e,'options':{'where':{'id':_0x3bdce3}},'log':_0x7124('0x6')});}; \ No newline at end of file +var _0xcee8=['UpdateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','Request'];(function(_0x9f39cd,_0x54ddae){var _0x3bd683=function(_0x87a8f9){while(--_0x87a8f9){_0x9f39cd['push'](_0x9f39cd['shift']());}};_0x3bd683(++_0x54ddae);}(_0xcee8,0xb1));var _0x8cee=function(_0x915572,_0x525887){_0x915572=_0x915572-0x0;var _0xf011c8=_0xcee8[_0x915572];return _0xf011c8;};'use strict';var client=require(_0x8cee('0x0'));exports[_0x8cee('0x1')]=function(_0x2a57bd,_0x1471b2){return client[_0x8cee('0x2')](_0x8cee('0x3'),{'body':_0x1471b2,'options':{'where':{'id':_0x2a57bd}},'log':'updateSmsInteraction'});};exports[_0x8cee('0x4')]=function(_0x4e4143,_0xffd42d){return client[_0x8cee('0x2')]('AddTagsToSmsInteraction',{'body':_0xffd42d,'options':{'where':{'id':_0x4e4143}},'log':_0x8cee('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index ef54dc5..0e30c63 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 _0xfc62=['../client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc62,0x1c4));var _0x2fc6=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xfc62[_0x18ab2a];return _0x16dcee;};'use strict';var client=require(_0x2fc6('0x0'));exports['create']=function(_0xa1845f){return client['Request']('CreateSmsMessage',{'body':_0xa1845f,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x14b9=['CreateSmsMessage','../client','Request'];(function(_0x35081f,_0x52afa5){var _0x4365d9=function(_0x5d8e3d){while(--_0x5d8e3d){_0x35081f['push'](_0x35081f['shift']());}};_0x4365d9(++_0x52afa5);}(_0x14b9,0x1c9));var _0x914b=function(_0x12a877,_0x3da530){_0x12a877=_0x12a877-0x0;var _0x581184=_0x14b9[_0x12a877];return _0x581184;};'use strict';var client=require(_0x914b('0x0'));exports['create']=function(_0x338327){return client[_0x914b('0x1')](_0x914b('0x2'),{'body':_0x338327,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 7e346cf..0946279 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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x1a987f,_0x2b1fd8){var _0x5382cb=function(_0x552bb2){while(--_0x552bb2){_0x1a987f['push'](_0x1a987f['shift']());}};_0x5382cb(++_0x2b1fd8);}(_0xe706,0xa3));var _0x6e70=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0xe706[_0x13b392];return _0x39db24;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x35c300,_0x284351){var _0x59e44b=function(_0x327e5c){while(--_0x327e5c){_0x35c300['push'](_0x35c300['shift']());}};_0x59e44b(++_0x284351);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index f3965dd..737411c 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xedd9,0xfc));var _0x9edd=function(_0x100066,_0x72dbf5){_0x100066=_0x100066-0x0;var _0x1c76c9=_0xedd9[_0x100066];return _0x1c76c9;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x9ec3bf,_0x1cc976){var _0x46f792=function(_0x21922b){while(--_0x21922b){_0x9ec3bf['push'](_0x9ec3bf['shift']());}};_0x46f792(++_0x1cc976);}(_0x34e8,0x12c));var _0x834e=function(_0x2e290c,_0x4204b3){_0x2e290c=_0x2e290c-0x0;var _0x3b2311=_0x34e8[_0x2e290c];return _0x3b2311;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index a8c91db..84fbd55 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(_0x25fe8e,_0x5811f0){var _0xe8d307=function(_0x17c596){while(--_0x17c596){_0x25fe8e['push'](_0x25fe8e['shift']());}};_0xe8d307(++_0x5811f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x144d9a,_0x55a411){var _0x42c1c2=function(_0x20baf5){while(--_0x20baf5){_0x144d9a['push'](_0x144d9a['shift']());}};_0x42c1c2(++_0x55a411);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 75deb9d..84ec6ac 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 _0x4975=['addTags','AddTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4975,0x86));var _0x5497=function(_0x1639d8,_0x2732ca){_0x1639d8=_0x1639d8-0x0;var _0x4c397e=_0x4975[_0x1639d8];return _0x4c397e;};'use strict';var client=require(_0x5497('0x0'));exports['update']=function(_0x474989,_0x3f9e37){return client[_0x5497('0x1')](_0x5497('0x2'),{'body':_0x3f9e37,'options':{'where':{'id':_0x474989}},'log':_0x5497('0x3')});};exports[_0x5497('0x4')]=function(_0x14cecb,_0xeb31af){return client[_0x5497('0x1')](_0x5497('0x5'),{'body':_0xeb31af,'options':{'where':{'id':_0x14cecb}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xcedf=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client','update'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xcedf,0x1b6));var _0xfced=function(_0x30c906,_0x13a7e1){_0x30c906=_0x30c906-0x0;var _0x4685bd=_0xcedf[_0x30c906];return _0x4685bd;};'use strict';var client=require(_0xfced('0x0'));exports[_0xfced('0x1')]=function(_0x1ce4e6,_0x157ed6){return client['Request'](_0xfced('0x2'),{'body':_0x157ed6,'options':{'where':{'id':_0x1ce4e6}},'log':_0xfced('0x3')});};exports['addTags']=function(_0x5b16af,_0x1dad76){return client['Request'](_0xfced('0x4'),{'body':_0x1dad76,'options':{'where':{'id':_0x5b16af}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 157354a..60559c4 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 _0xa5b0=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0xf5b712,_0x5487bf){var _0x410413=function(_0x5209ce){while(--_0x5209ce){_0xf5b712['push'](_0xf5b712['shift']());}};_0x410413(++_0x5487bf);}(_0xa5b0,0xf0));var _0x0a5b=function(_0x53e19d,_0x604957){_0x53e19d=_0x53e19d-0x0;var _0x5ba332=_0xa5b0[_0x53e19d];return _0x5ba332;};'use strict';var client=require(_0x0a5b('0x0'));exports[_0x0a5b('0x1')]=function(_0x3043c3){return client[_0x0a5b('0x2')](_0x0a5b('0x3'),{'body':_0x3043c3,'log':_0x0a5b('0x4')});}; \ No newline at end of file +var _0x2207=['../client','create','createWhatsappMessage'];(function(_0x343703,_0xffcbea){var _0x5134cd=function(_0x4ede89){while(--_0x4ede89){_0x343703['push'](_0x343703['shift']());}};_0x5134cd(++_0xffcbea);}(_0x2207,0x180));var _0x7220=function(_0x22022f,_0x2525c4){_0x22022f=_0x22022f-0x0;var _0x3ba9a2=_0x2207[_0x22022f];return _0x3ba9a2;};'use strict';var client=require(_0x7220('0x0'));exports[_0x7220('0x1')]=function(_0x1edd56){return client['Request']('CreateWhatsappMessage',{'body':_0x1edd56,'log':_0x7220('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 62e6bb6..63eef62 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 _0xc407=['Request','GetWhatsappQueue','name','timeout','strategy','online','whatsappPause','getWhatsappQueues','../client'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xc407,0xaa));var _0x7c40=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xc407[_0x330414];return _0x99dbff;};'use strict';var client=require(_0x7c40('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x7c40('0x1')](_0x7c40('0x2'),{'options':{'raw':![],'attributes':['id',_0x7c40('0x3'),_0x7c40('0x4'),_0x7c40('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x7c40('0x3'),_0x7c40('0x6'),_0x7c40('0x7')]}]},'log':_0x7c40('0x8')});};}; \ No newline at end of file +var _0xcefa=['Request','GetWhatsappQueue','name','timeout','strategy','Agents','online','whatsappPause','getWhatsappQueues','../client'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xcefa,0x1ad));var _0xacef=function(_0x289330,_0x54f85a){_0x289330=_0x289330-0x0;var _0x22d2d0=_0xcefa[_0x289330];return _0x22d2d0;};'use strict';var client=require(_0xacef('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xacef('0x1')](_0xacef('0x2'),{'options':{'raw':![],'attributes':['id',_0xacef('0x3'),_0xacef('0x4'),_0xacef('0x5')],'include':[{'model':'User','as':_0xacef('0x6'),'attributes':['id',_0xacef('0x3'),_0xacef('0x7'),_0xacef('0x8')]}]},'log':_0xacef('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index dcb11b8..8c4df2e 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 _0xc5dc=['DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x3903df,_0x4fae4c){var _0x1a2ac5=function(_0x3fa0c4){while(--_0x3fa0c4){_0x3903df['push'](_0x3903df['shift']());}};_0x1a2ac5(++_0x4fae4c);}(_0xc5dc,0x9c));var _0xcc5d=function(_0xe42667,_0x3021e9){_0xe42667=_0xe42667-0x0;var _0x5567d1=_0xc5dc[_0xe42667];return _0x5567d1;};'use strict';var client=require(_0xcc5d('0x0'));exports[_0xcc5d('0x1')]=function(_0x21a2ca){return client[_0xcc5d('0x2')](_0xcc5d('0x3'),{'body':_0x21a2ca,'log':_0xcc5d('0x3')});};exports[_0xcc5d('0x4')]=function(_0x20a850,_0x5da5ba){return client[_0xcc5d('0x2')]('UpdateWhatsappQueueReport',{'body':_0x5da5ba,'options':{'where':{'uniqueid':_0x20a850},'order':[['id',_0xcc5d('0x5')]],'limit':0x1},'log':_0xcc5d('0x6')});}; \ No newline at end of file +var _0xa486=['../client','Request','CreateWhatsappQueueReport','update','DESC'];(function(_0x3968bf,_0x2231f4){var _0x3c93f0=function(_0x5c7110){while(--_0x5c7110){_0x3968bf['push'](_0x3968bf['shift']());}};_0x3c93f0(++_0x2231f4);}(_0xa486,0xeb));var _0x6a48=function(_0x1dd2b5,_0x175d22){_0x1dd2b5=_0x1dd2b5-0x0;var _0x3054d0=_0xa486[_0x1dd2b5];return _0x3054d0;};'use strict';var client=require(_0x6a48('0x0'));exports['create']=function(_0x6d9df5){return client[_0x6a48('0x1')](_0x6a48('0x2'),{'body':_0x6d9df5,'log':_0x6a48('0x2')});};exports[_0x6a48('0x3')]=function(_0x38d8ea,_0x12fce1){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x12fce1,'options':{'where':{'uniqueid':_0x38d8ea},'order':[['id',_0x6a48('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index a65edba..343ae92 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 _0xee49=['stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','map','message','stop','find','agents','createQueue','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x34a063,_0xc906a6){var _0x1a7081=function(_0x1b01bd){while(--_0x1b01bd){_0x34a063['push'](_0x34a063['shift']());}};_0x1a7081(++_0xc906a6);}(_0xee49,0xe1));var _0x9ee4=function(_0x1d5476,_0x2f8795){_0x1d5476=_0x1d5476-0x0;var _0x4ac71f=_0xee49[_0x1d5476];return _0x4ac71f;};'use strict';var schema=require(_0x9ee4('0x0'));var _=require(_0x9ee4('0x1'));var util=require('util');var seqqueue=require(_0x9ee4('0x2'));var logger=require(_0x9ee4('0x3'))(_0x9ee4('0x4'));var strategy=require(_0x9ee4('0x5'));var queue=schema({'name':{'type':_0x9ee4('0x6'),'required':!![],'message':_0x9ee4('0x7')},'timeout':{'type':'number','message':_0x9ee4('0x8')}});function writeLog(_0x2f8dfc,_0x293a25,_0x5a4991){return logger[_0x9ee4('0x9')](util[_0x9ee4('0xa')](_0x9ee4('0xb'),_0x2f8dfc,_0x293a25['name'],_0x5a4991));}function handleFindAgent(_0x940c36){return function(_0x5b790c){return _0x5b790c[_0x9ee4('0xc')][_0x9ee4('0xd')]()===_0x940c36[_0x9ee4('0xd')]();};}exports[_0x9ee4('0xe')]=function(_0x2b6f7b,_0x4d4ee6,_0x3fa0c6,_0x23608b){return function(_0x5bd1f3){try{var _0xa345ae={'name':_0x4d4ee6[0x0],'timeout':_0x4d4ee6[0x1]};var _0x467e86=queue[_0x9ee4('0x0')](_0xa345ae,{'typecast':!![]});if(_0x467e86['length']){logger[_0x9ee4('0xf')]('[%s][AGENT]\x20%s',_0x2b6f7b,_[_0x9ee4('0x10')](_0x467e86,_0x9ee4('0x11'))['join'](',\x20'));_0x5bd1f3[_0x9ee4('0x12')]();}else{var _0x3cd944=_[_0x9ee4('0x13')](_0x3fa0c6[_0x9ee4('0x14')],handleFindAgent(_0xa345ae[_0x9ee4('0xc')]));if(_0x3cd944){var _0x5dee91=(_0xa345ae['timeout']||0xa)*0x3e8;var _0x552c71,_0x59b9f4;var _0x3846fd=seqqueue[_0x9ee4('0x15')](_0x5dee91);_0x3846fd['id']=_0x2b6f7b;_0x3846fd['atimeout']=_0x5dee91;_0x3846fd[_0x9ee4('0x16')]=_0x23608b[_0x9ee4('0x16')];writeLog(_0x2b6f7b,_0x3cd944,util['format']('START:%s',_0x5dee91));_0x3fa0c6[_0x9ee4('0x17')][_0x2b6f7b]['on'](_0x9ee4('0x18'),function(){logger['info'](_0x9ee4('0x19'),_0x2b6f7b);clearTimeout(_0x59b9f4);_0x59b9f4=undefined;_0x3846fd[_0x9ee4('0x1a')]();if(_0x3fa0c6[_0x9ee4('0x17')][_0x2b6f7b]){delete _0x3fa0c6[_0x9ee4('0x17')][_0x2b6f7b];}_0x5bd1f3[_0x9ee4('0x12')]();});_0x3fa0c6[_0x9ee4('0x17')][_0x2b6f7b]['on'](_0x9ee4('0x1b'),function(){if(_0x3fa0c6[_0x9ee4('0x17')][_0x2b6f7b]){delete _0x3fa0c6[_0x9ee4('0x17')][_0x2b6f7b];}});_0x59b9f4=setTimeout(function(){logger[_0x9ee4('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x2b6f7b);clearTimeout(_0x59b9f4);_0x3846fd['close']();_0x5bd1f3[_0x9ee4('0x1c')]();},_0x5dee91);strategy['agent'](_0x3846fd,_0x3cd944,_0x3fa0c6,_0x23608b);}else{logger[_0x9ee4('0xf')](_0x9ee4('0x1d'),_0x2b6f7b,_0xa345ae['name']);_0x5bd1f3['stop']();}}}catch(_0x12da58){console[_0x9ee4('0x1e')](_0x12da58);logger[_0x9ee4('0xf')]('[%s][QUEUE]\x20%s',_0x2b6f7b,_0x12da58[_0x9ee4('0x1f')]);_0x5bd1f3['stop']();}};}; \ No newline at end of file +var _0x2fed=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy'];(function(_0x736e58,_0x803a63){var _0x14ef6b=function(_0x181675){while(--_0x181675){_0x736e58['push'](_0x736e58['shift']());}};_0x14ef6b(++_0x803a63);}(_0x2fed,0x69));var _0xd2fe=function(_0x3aeaf1,_0x261df5){_0x3aeaf1=_0x3aeaf1-0x0;var _0x5cc62f=_0x2fed[_0x3aeaf1];return _0x5cc62f;};'use strict';var schema=require(_0xd2fe('0x0'));var _=require(_0xd2fe('0x1'));var util=require(_0xd2fe('0x2'));var seqqueue=require(_0xd2fe('0x3'));var logger=require('../../../../config/logger')(_0xd2fe('0x4'));var strategy=require(_0xd2fe('0x5'));var queue=schema({'name':{'type':_0xd2fe('0x6'),'required':!![],'message':_0xd2fe('0x7')},'timeout':{'type':'number','message':_0xd2fe('0x8')}});function writeLog(_0x505e9f,_0x18987f,_0x4b5538){return logger[_0xd2fe('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x505e9f,_0x18987f[_0xd2fe('0xa')],_0x4b5538));}function handleFindAgent(_0x4d31d8){return function(_0x428a6e){return _0x428a6e['name'][_0xd2fe('0xb')]()===_0x4d31d8[_0xd2fe('0xb')]();};}exports[_0xd2fe('0xc')]=function(_0x25d7d7,_0x46d8ba,_0x2b824a,_0x3200be){return function(_0x31b2f0){try{var _0x35fde8={'name':_0x46d8ba[0x0],'timeout':_0x46d8ba[0x1]};var _0x372476=queue[_0xd2fe('0x0')](_0x35fde8,{'typecast':!![]});if(_0x372476[_0xd2fe('0xd')]){logger[_0xd2fe('0xe')]('[%s][AGENT]\x20%s',_0x25d7d7,_[_0xd2fe('0xf')](_0x372476,_0xd2fe('0x10'))[_0xd2fe('0x11')](',\x20'));_0x31b2f0[_0xd2fe('0x12')]();}else{var _0x29dd97=_[_0xd2fe('0x13')](_0x2b824a[_0xd2fe('0x14')],handleFindAgent(_0x35fde8[_0xd2fe('0xa')]));if(_0x29dd97){var _0x7cc775=(_0x35fde8[_0xd2fe('0x15')]||0xa)*0x3e8;var _0x20dc5b,_0x408499;var _0x1468c1=seqqueue[_0xd2fe('0x16')](_0x7cc775);_0x1468c1['id']=_0x25d7d7;_0x1468c1[_0xd2fe('0x17')]=_0x7cc775;_0x1468c1[_0xd2fe('0x18')]=_0x3200be[_0xd2fe('0x18')];writeLog(_0x25d7d7,_0x29dd97,util['format'](_0xd2fe('0x19'),_0x7cc775));_0x2b824a[_0xd2fe('0x1a')][_0x25d7d7]['on'](_0xd2fe('0x1b'),function(){logger[_0xd2fe('0x9')](_0xd2fe('0x1c'),_0x25d7d7);clearTimeout(_0x408499);_0x408499=undefined;_0x1468c1['close']();if(_0x2b824a[_0xd2fe('0x1a')][_0x25d7d7]){delete _0x2b824a[_0xd2fe('0x1a')][_0x25d7d7];}_0x31b2f0['stop']();});_0x2b824a[_0xd2fe('0x1a')][_0x25d7d7]['on']('complete',function(){if(_0x2b824a['rules'][_0x25d7d7]){delete _0x2b824a['rules'][_0x25d7d7];}});_0x408499=setTimeout(function(){logger[_0xd2fe('0x9')](_0xd2fe('0x1d'),_0x25d7d7);clearTimeout(_0x408499);_0x1468c1[_0xd2fe('0x1e')]();_0x31b2f0[_0xd2fe('0x1f')]();},_0x7cc775);strategy[_0xd2fe('0x20')](_0x1468c1,_0x29dd97,_0x2b824a,_0x3200be);}else{logger['error'](_0xd2fe('0x21'),_0x25d7d7,_0x35fde8[_0xd2fe('0xa')]);_0x31b2f0[_0xd2fe('0x12')]();}}}catch(_0x305ee6){console[_0xd2fe('0x22')](_0x305ee6);logger['error'](_0xd2fe('0x23'),_0x25d7d7,_0x305ee6[_0xd2fe('0x24')]);_0x31b2f0[_0xd2fe('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index a232518..53c9e04 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 _0x2e3f=['whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','body','getMustacheRender','Message','create','info','error','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','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x34ed22,_0x8c2101){var _0x48c653=function(_0x4e77bc){while(--_0x4e77bc){_0x34ed22['push'](_0x34ed22['shift']());}};_0x48c653(++_0x8c2101);}(_0x2e3f,0x122));var _0xf2e3=function(_0x352623,_0x4680f8){_0x352623=_0x352623-0x0;var _0xcffaa9=_0x2e3f[_0x352623];return _0xcffaa9;};'use strict';var _=require(_0xf2e3('0x0'));var moment=require(_0xf2e3('0x1'));var AWS=require('aws-sdk');var utils=require(_0xf2e3('0x2'));var logger=require(_0xf2e3('0x3'))(_0xf2e3('0x4'));var rpc={'chatMessage':require(_0xf2e3('0x5')),'openchannelMessage':require(_0xf2e3('0x6')),'mailMessage':require(_0xf2e3('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf2e3('0x8')),'whatsappMessage':require(_0xf2e3('0x9'))};exports[_0xf2e3('0xa')]=function(_0x542c97,_0xac5f31){return function(_0x5e9bda){try{if(!_[_0xf2e3('0xb')](this[_0xf2e3('0xc')]['UserId'])){logger['info'](_0xf2e3('0xd'),_0x542c97,_0xf2e3('0xe'));return _0x5e9bda[_0xf2e3('0xf')]();}var _0x5ebc6e={'ContactId':this[_0xf2e3('0x10')]['id'],'sentAt':moment()[_0xf2e3('0x11')](_0xf2e3('0x12')),'direction':_0xf2e3('0x13')};if(this[_0xf2e3('0x14')]===_0xf2e3('0x15')||this[_0xf2e3('0x14')]===_0xf2e3('0x16')){_0x5ebc6e[_0xf2e3('0x17')]=this['interaction']['phone'];}var _0x5ea8ec=this['channel'];if(_0x5ea8ec===_0xf2e3('0x18')){_0x5ebc6e[_0xf2e3('0x19')]=this[_0xf2e3('0x1a')]['id'];}else{_0x5ebc6e[_[_0xf2e3('0x1b')](_0x5ea8ec)+_0xf2e3('0x1c')]=this[_0xf2e3('0x1a')]['id'];}_0x5ebc6e[_[_0xf2e3('0x1b')](_0x5ea8ec)+'InteractionId']=this['interaction']['id'];if(this[_0xf2e3('0xc')][_0xf2e3('0x1d')]){var _0x10af95=_0xac5f31[0x4];if(!_['isEmpty'](_0x10af95)){_0x5ebc6e[_0xf2e3('0x1e')]=utils[_0xf2e3('0x1f')](_0x10af95,this);return rpc[_0x5ea8ec+_0xf2e3('0x20')][_0xf2e3('0x21')](_0x5ebc6e)['then'](function(_0x6ae49b){logger[_0xf2e3('0x22')](_0xf2e3('0xd'),_0x542c97,_0x5ebc6e[_0xf2e3('0x1e')]);})['catch'](function(_0x4a90b1){logger[_0xf2e3('0x23')](_0xf2e3('0xd'),_0x542c97,JSON[_0xf2e3('0x24')](_0x4a90b1));})[_0xf2e3('0x25')](function(){logger[_0xf2e3('0x22')](_0xf2e3('0x26'),_0x542c97);_0x5e9bda[_0xf2e3('0x27')]();});}else{logger[_0xf2e3('0x22')](_0xf2e3('0x28'),_0x542c97);_0x5e9bda[_0xf2e3('0x27')]();}}else{var _0x34773d=this;var _0x5c7366=new AWS[(_0xf2e3('0x29'))]({'accessKeyId':_0xac5f31[0x0],'secretAccessKey':_0xac5f31[0x1],'region':_0xac5f31[0x2]});var _0x1702b2={'botAlias':_0xf2e3('0x2a'),'botName':_0xac5f31[0x3],'inputText':this[_0xf2e3('0x2b')][_0xf2e3('0x1e')],'userId':this[_0xf2e3('0x14')]+':'+this['interaction']['id'][_0xf2e3('0x2c')]()};_0x5c7366[_0xf2e3('0x2d')](_0x1702b2,function(_0x329080,_0x43fb74){if(_0x329080){logger['error']('[%s][AMAZONLEX]\x20%s',_0x542c97,_0x329080[_0xf2e3('0x2b')]);_0x5e9bda[_0xf2e3('0xf')]();}else if(_0x43fb74&&_0x43fb74['message']){_0x34773d[_0xf2e3('0x1e')][_0xf2e3('0x2e')]=_0x43fb74;_0x5ebc6e[_0xf2e3('0x1e')]=_0x43fb74[_0xf2e3('0x2b')];_0x5ebc6e[_0xf2e3('0x2f')]='amazonlex';_0x5ebc6e[_0xf2e3('0x30')]=JSON['stringify'](_0x43fb74);return rpc[_0x5ea8ec+'Message'][_0xf2e3('0x21')](_0x5ebc6e)['then'](function(_0x5eae57){logger['info']('[%s][AMAZONLEX]\x20%s',_0x542c97,_0x5ebc6e['body']);if(_0x43fb74[_0xf2e3('0x31')]==_0xf2e3('0x32')){_0x5e9bda[_0xf2e3('0xf')]();}else{_0x5e9bda[_0xf2e3('0x27')]();}})[_0xf2e3('0x33')](function(_0x86ef26){logger[_0xf2e3('0x23')](_0xf2e3('0xd'),_0x542c97,JSON[_0xf2e3('0x24')](_0x86ef26));_0x5e9bda[_0xf2e3('0xf')]();});}else{_0x5e9bda['next']();}});}}catch(_0x227015){logger['error'](_0xf2e3('0xd'),_0x542c97,JSON[_0xf2e3('0x24')](_0x227015));_0x5e9bda[_0xf2e3('0x27')]();}};}; \ No newline at end of file +var _0xf3a8=['getMustacheRender','Message','create','info','catch','error','finally','stop','LexRuntime','message','toString','amazonlex','providerName','providerResponse','stringify','Failed','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body'];(function(_0x24d15a,_0x1f6bcf){var _0x261d7b=function(_0x3b8ee6){while(--_0x3b8ee6){_0x24d15a['push'](_0x24d15a['shift']());}};_0x261d7b(++_0x1f6bcf);}(_0xf3a8,0x1ae));var _0x8f3a=function(_0x4b0d76,_0x2a782f){_0x4b0d76=_0x4b0d76-0x0;var _0xe5528e=_0xf3a8[_0x4b0d76];return _0xe5528e;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x8f3a('0x0'))(_0x8f3a('0x1'));var rpc={'chatMessage':require(_0x8f3a('0x2')),'openchannelMessage':require(_0x8f3a('0x3')),'mailMessage':require(_0x8f3a('0x4')),'smsMessage':require(_0x8f3a('0x5')),'faxMessage':require(_0x8f3a('0x6')),'whatsappMessage':require(_0x8f3a('0x7'))};exports[_0x8f3a('0x8')]=function(_0x13407b,_0x53054b){return function(_0x558e63){try{if(!_[_0x8f3a('0x9')](this[_0x8f3a('0xa')][_0x8f3a('0xb')])){logger['info'](_0x8f3a('0xc'),_0x13407b,_0x8f3a('0xd'));return _0x558e63[_0x8f3a('0xe')]();}var _0x292d3c={'ContactId':this[_0x8f3a('0xf')]['id'],'sentAt':moment()[_0x8f3a('0x10')](_0x8f3a('0x11')),'direction':_0x8f3a('0x12')};if(this[_0x8f3a('0x13')]===_0x8f3a('0x14')||this[_0x8f3a('0x13')]===_0x8f3a('0x15')){_0x292d3c[_0x8f3a('0x16')]=this[_0x8f3a('0xa')][_0x8f3a('0x16')];}var _0x42b25d=this[_0x8f3a('0x13')];if(_0x42b25d==='chat'){_0x292d3c['ChatWebsiteId']=this[_0x8f3a('0x17')]['id'];}else{_0x292d3c[_[_0x8f3a('0x18')](_0x42b25d)+_0x8f3a('0x19')]=this[_0x8f3a('0x17')]['id'];}_0x292d3c[_['upperFirst'](_0x42b25d)+_0x8f3a('0x1a')]=this['interaction']['id'];if(this[_0x8f3a('0xa')][_0x8f3a('0x1b')]){var _0x49b879=_0x53054b[0x4];if(!_[_0x8f3a('0x1c')](_0x49b879)){_0x292d3c[_0x8f3a('0x1d')]=utils[_0x8f3a('0x1e')](_0x49b879,this);return rpc[_0x42b25d+_0x8f3a('0x1f')][_0x8f3a('0x20')](_0x292d3c)['then'](function(_0x55c4ec){logger[_0x8f3a('0x21')](_0x8f3a('0xc'),_0x13407b,_0x292d3c[_0x8f3a('0x1d')]);})[_0x8f3a('0x22')](function(_0x5e5859){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,JSON['stringify'](_0x5e5859));})[_0x8f3a('0x24')](function(){logger[_0x8f3a('0x21')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x13407b);_0x558e63['stop']();});}else{logger[_0x8f3a('0x21')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x13407b);_0x558e63[_0x8f3a('0x25')]();}}else{var _0x13bf5e=this;var _0x45e02d=new AWS[(_0x8f3a('0x26'))]({'accessKeyId':_0x53054b[0x0],'secretAccessKey':_0x53054b[0x1],'region':_0x53054b[0x2]});var _0x5bc2cd={'botAlias':'$LATEST','botName':_0x53054b[0x3],'inputText':this[_0x8f3a('0x27')]['body'],'userId':this[_0x8f3a('0x13')]+':'+this[_0x8f3a('0xa')]['id'][_0x8f3a('0x28')]()};_0x45e02d['postText'](_0x5bc2cd,function(_0x1ddb07,_0x3da7f4){if(_0x1ddb07){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,_0x1ddb07[_0x8f3a('0x27')]);_0x558e63['next']();}else if(_0x3da7f4&&_0x3da7f4[_0x8f3a('0x27')]){_0x13bf5e[_0x8f3a('0x1d')][_0x8f3a('0x29')]=_0x3da7f4;_0x292d3c[_0x8f3a('0x1d')]=_0x3da7f4[_0x8f3a('0x27')];_0x292d3c[_0x8f3a('0x2a')]=_0x8f3a('0x29');_0x292d3c[_0x8f3a('0x2b')]=JSON[_0x8f3a('0x2c')](_0x3da7f4);return rpc[_0x42b25d+'Message'][_0x8f3a('0x20')](_0x292d3c)['then'](function(_0x4462d2){logger['info']('[%s][AMAZONLEX]\x20%s',_0x13407b,_0x292d3c[_0x8f3a('0x1d')]);if(_0x3da7f4['dialogState']==_0x8f3a('0x2d')){_0x558e63[_0x8f3a('0xe')]();}else{_0x558e63[_0x8f3a('0x25')]();}})[_0x8f3a('0x22')](function(_0x471adc){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,JSON['stringify'](_0x471adc));_0x558e63[_0x8f3a('0xe')]();});}else{_0x558e63[_0x8f3a('0xe')]();}});}}catch(_0x53c406){logger[_0x8f3a('0x23')](_0x8f3a('0xc'),_0x13407b,JSON['stringify'](_0x53c406));_0x558e63['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index e2af8e6..a6dea96 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 _0x126d=['smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','[%s][AUTOREPLY]\x20%s','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','create','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','created','interaction','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','','replace','','headers','auto-replied','All','auto_reply','sendMailMessage'];(function(_0x556109,_0x18bc57){var _0x4b8364=function(_0x57bf28){while(--_0x57bf28){_0x556109['push'](_0x556109['shift']());}};_0x4b8364(++_0x18bc57);}(_0x126d,0x1b2));var _0xd126=function(_0x4c93b9,_0x442904){_0x4c93b9=_0x4c93b9-0x0;var _0x40141c=_0x126d[_0x4c93b9];return _0x40141c;};'use strict';var _=require('lodash');var moment=require(_0xd126('0x0'));var utils=require(_0xd126('0x1'));var logger=require('../../../../config/logger')(_0xd126('0x2'));var rpc={'chatMessage':require(_0xd126('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd126('0x4')),'smsMessage':require(_0xd126('0x5')),'faxMessage':require(_0xd126('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xd126('0x7')),'openchannelInteraction':require(_0xd126('0x8')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xd126('0x9')),'faxInteraction':require(_0xd126('0xa')),'whatsappInteraction':require(_0xd126('0xb'))};var mailRpc=require(_0xd126('0xc'));exports[_0xd126('0xd')]=function(_0x2be103,_0x437a78,_0x436b50,_0x56bc56){return function(_0xe6c82){try{var _0x5902f1=this[_0xd126('0xe')];if(_0x5902f1===_0xd126('0xf')&&_0x56bc56[_0xd126('0x10')][_0xd126('0x11')]){logger[_0xd126('0x12')]('[%s][AUTOREPLY]\x20%s',_0x2be103,_0xd126('0x13'));return _0xe6c82['next']();}if(_0x437a78[0x0]==='1'&&(_[_0xd126('0x14')](this['interaction'][_0xd126('0x15')])||!this['interaction'][_0xd126('0x15')])){logger[_0xd126('0x12')]('[%s][AUTOREPLY]\x20%s',_0x2be103,'Autoreply\x20already\x20sent');return _0xe6c82['next']();}if(_0x437a78[0x0]==='2'&&this[_0xd126('0x16')][_0xd126('0x17')]){logger[_0xd126('0x12')](_0xd126('0x18'),_0x2be103,_0xd126('0x19'));return _0xe6c82[_0xd126('0x1a')]();}var _0x21ee72={'ContactId':this[_0xd126('0x1b')]['id'],'sentAt':moment()[_0xd126('0x1c')](_0xd126('0x1d')),'direction':'out'};if(this[_0xd126('0xe')]==='mail'){_0x21ee72['body']=utils[_0xd126('0x1e')](_0x437a78[0x2],this);}else{_0x21ee72[_0xd126('0x10')]=utils[_0xd126('0x1e')](_0x437a78[0x1],this);}if(this['message']){_0x21ee72['to']=this[_0xd126('0x1f')][_0xd126('0x20')]||'';if(this['channel']===_0xd126('0xf')&&_0x437a78[0x1]==='1'){_0x21ee72['cc']=this['message']['cc']||'';}_0x21ee72[_0xd126('0x20')]=this[_0xd126('0x1f')]['to']||'';_0x21ee72[_0xd126('0x21')]=this['message']['phone']||'';_0x21ee72[_0xd126('0x22')]=!![];if(this[_0xd126('0x1f')]['subject']){_0x21ee72[_0xd126('0x23')]='';_0x21ee72['subject']+=_[_0xd126('0x24')](this[_0xd126('0x1f')][_0xd126('0x23')],'Re:')?'':_0xd126('0x25');_0x21ee72[_0xd126('0x23')]+=this['message'][_0xd126('0x23')];}}if(this[_0xd126('0xe')]===_0xd126('0x26')){_0x21ee72[_0xd126('0x27')]=this[_0xd126('0x28')]['id'];}else{_0x21ee72[_[_0xd126('0x29')](this['channel'])+_0xd126('0x2a')]=this[_0xd126('0x28')]['id'];}_0x21ee72[_['upperFirst'](this[_0xd126('0xe')])+'InteractionId']=this['interaction']['id'];var _0x50c457=this['interaction'];if(rpc[this[_0xd126('0xe')]+_0xd126('0x2b')]){if(this[_0xd126('0xe')]===_0xd126('0xf')){_0x21ee72[_0xd126('0x2c')]=this[_0xd126('0x1f')][_0xd126('0x2d')];_0x21ee72[_0xd126('0x2e')]=_0xd126('0x2f')+_[_0xd126('0x30')](_0x21ee72[_0xd126('0x10')],'','','auto-replied','All','sendMailMessage','smtpOptions','then','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)'];(function(_0x1d5759,_0x417e09){var _0x51ddcd=function(_0x4e3f43){while(--_0x4e3f43){_0x1d5759['push'](_0x1d5759['shift']());}};_0x51ddcd(++_0x417e09);}(_0x4048,0x180));var _0x8404=function(_0x480d0d,_0x2b74fa){_0x480d0d=_0x480d0d-0x0;var _0x9a6442=_0x4048[_0x480d0d];return _0x9a6442;};'use strict';var _=require(_0x8404('0x0'));var moment=require('moment');var utils=require(_0x8404('0x1'));var logger=require('../../../../config/logger')(_0x8404('0x2'));var rpc={'chatMessage':require(_0x8404('0x3')),'openchannelMessage':require(_0x8404('0x4')),'mailMessage':require(_0x8404('0x5')),'smsMessage':require(_0x8404('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x8404('0x7')),'chatInteraction':require(_0x8404('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x8404('0x9')),'smsInteraction':require(_0x8404('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require('../../mailRpc');exports[_0x8404('0xb')]=function(_0x2b9f0b,_0xc3851d,_0x262fb3,_0xc74c39){return function(_0x5191d6){try{var _0x1c48b4=this[_0x8404('0xc')];if(_0x1c48b4==='mail'&&_0xc74c39[_0x8404('0xd')][_0x8404('0xe')]){logger[_0x8404('0xf')](_0x8404('0x10'),_0x2b9f0b,_0x8404('0x11'));return _0x5191d6[_0x8404('0x12')]();}if(_0xc3851d[0x0]==='1'&&(_[_0x8404('0x13')](this[_0x8404('0x14')][_0x8404('0x15')])||!this[_0x8404('0x14')]['created'])){logger[_0x8404('0xf')](_0x8404('0x10'),_0x2b9f0b,_0x8404('0x16'));return _0x5191d6[_0x8404('0x12')]();}if(_0xc3851d[0x0]==='2'&&this['interaction'][_0x8404('0x17')]){logger[_0x8404('0xf')](_0x8404('0x18'),_0x2b9f0b,_0x8404('0x19'));return _0x5191d6['next']();}var _0x597ba6={'ContactId':this[_0x8404('0x1a')]['id'],'sentAt':moment()[_0x8404('0x1b')](_0x8404('0x1c')),'direction':_0x8404('0x1d')};if(this['channel']===_0x8404('0x1e')){_0x597ba6[_0x8404('0xd')]=utils[_0x8404('0x1f')](_0xc3851d[0x2],this);}else{_0x597ba6[_0x8404('0xd')]=utils['getMustacheRender'](_0xc3851d[0x1],this);}if(this[_0x8404('0x20')]){_0x597ba6['to']=this[_0x8404('0x20')][_0x8404('0x21')]||'';if(this['channel']==='mail'&&_0xc3851d[0x1]==='1'){_0x597ba6['cc']=this['message']['cc']||'';}_0x597ba6['from']=this[_0x8404('0x20')]['to']||'';_0x597ba6['phone']=this[_0x8404('0x20')][_0x8404('0x22')]||'';_0x597ba6[_0x8404('0x23')]=!![];if(this[_0x8404('0x20')][_0x8404('0x24')]){_0x597ba6[_0x8404('0x24')]='';_0x597ba6[_0x8404('0x24')]+=_['startsWith'](this[_0x8404('0x20')]['subject'],_0x8404('0x25'))?'':_0x8404('0x26');_0x597ba6[_0x8404('0x24')]+=this['message'][_0x8404('0x24')];}}if(this['channel']===_0x8404('0x27')){_0x597ba6['ChatWebsiteId']=this[_0x8404('0x28')]['id'];}else{_0x597ba6[_['upperFirst'](this[_0x8404('0xc')])+_0x8404('0x29')]=this['account']['id'];}_0x597ba6[_[_0x8404('0x2a')](this[_0x8404('0xc')])+_0x8404('0x2b')]=this[_0x8404('0x14')]['id'];var _0x27d465=this[_0x8404('0x14')];if(rpc[this[_0x8404('0xc')]+_0x8404('0x2c')]){if(this[_0x8404('0xc')]===_0x8404('0x1e')){_0x597ba6['inReplyTo']=this[_0x8404('0x20')][_0x8404('0x2d')];_0x597ba6[_0x8404('0x2e')]=_0x8404('0x2f')+_['replace'](_0x597ba6[_0x8404('0xd')],_0x8404('0x30'),_0x8404('0x31'))+_0x8404('0x32');_0x597ba6['headers']={'Auto-Submitted':_0x8404('0x33'),'X-Auto-Response-Suppress':_0x8404('0x34'),'Precedence':'auto_reply'};return mailRpc[_0x8404('0x35')](this[_0x8404('0x28')][_0x8404('0x36')],_0x597ba6)[_0x8404('0x37')](function(_0xda9d15){logger[_0x8404('0xf')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x2b9f0b);_0x597ba6[_0x8404('0x2d')]=_0xda9d15['message'][_0x8404('0x2d')];return rpc[_0x1c48b4+_0x8404('0x2c')][_0x8404('0x38')](_0x597ba6);})[_0x8404('0x37')](function(_0x103c48){logger[_0x8404('0xf')]('[%s][AUTOREPLY]\x20%s',_0x2b9f0b,JSON['stringify'](_0x103c48));})[_0x8404('0x39')](function(_0x74766f){logger[_0x8404('0x3a')](_0x8404('0x3b'),_0x2b9f0b,JSON['stringify'](_0x74766f));})[_0x8404('0x3c')](function(){Promise[_0x8404('0x3d')]()['then'](function(){if(_0xc3851d[0x0]!=='2'||_0x27d465[_0x8404('0x17')])return;return rpc[_0x1c48b4+_0x8404('0x3e')]['update'](_0x27d465['id'],{'autoreplyExecuted':!![]})[_0x8404('0x37')](function(_0x4887d1){logger['info'](_0x8404('0x18'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x4887d1));})['catch'](function(_0xab1022){logger['error'](_0x8404('0x40'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0xab1022));});})[_0x8404('0x37')](function(){_0x5191d6['next']();});});}else{return rpc[this[_0x8404('0xc')]+_0x8404('0x2c')][_0x8404('0x38')](_0x597ba6)['then'](function(){logger[_0x8404('0xf')](_0x8404('0x10'),_0x2b9f0b,_0x597ba6[_0x8404('0xd')]);})['catch'](function(_0x4064c5){logger[_0x8404('0x3a')](_0x8404('0x10'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x4064c5));})[_0x8404('0x3c')](function(){Promise[_0x8404('0x3d')]()['then'](function(){if(_0xc3851d[0x0]!=='2'||_0x27d465[_0x8404('0x17')])return;return rpc[_0x1c48b4+_0x8404('0x3e')][_0x8404('0x41')](_0x27d465['id'],{'autoreplyExecuted':!![]})[_0x8404('0x37')](function(_0x98d52c){logger[_0x8404('0xf')](_0x8404('0x18'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x98d52c));})['catch'](function(_0x4e5d53){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2b9f0b,JSON[_0x8404('0x3f')](_0x4e5d53));});})[_0x8404('0x37')](function(){_0x5191d6['next']();});});}}}catch(_0x543a56){logger[_0x8404('0x3a')](_0x8404('0x10'),_0x2b9f0b,JSON[_0x8404('0x3f')](_0x543a56));_0x5191d6[_0x8404('0x42')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 8701995..3f9f82f 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 _0x670f=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing'];(function(_0x5cd253,_0x4162da){var _0x36e179=function(_0x597977){while(--_0x597977){_0x5cd253['push'](_0x5cd253['shift']());}};_0x36e179(++_0x4162da);}(_0x670f,0xcc));var _0xf670=function(_0x4998bd,_0x3faca9){_0x4998bd=_0x4998bd-0x0;var _0x5d4b6c=_0x670f[_0x4998bd];return _0x5d4b6c;};'use strict';var moment=require(_0xf670('0x0'));var logger=require(_0xf670('0x1'))(_0xf670('0x2'));var rpc={'chatInteraction':require(_0xf670('0x3')),'openchannelInteraction':require(_0xf670('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xf670('0x5')),'faxInteraction':require(_0xf670('0x6')),'whatsappInteraction':require(_0xf670('0x7'))};exports[_0xf670('0x8')]=function(_0x591eb8,_0x262758,_0x16e832,_0x43c8b7){return function(_0x557789){try{logger[_0xf670('0x9')](_0xf670('0xa'),_0x591eb8,_0x262758[0x0]);var _0x401413={'closed':0x1,'closedAt':moment()[_0xf670('0xb')](_0xf670('0xc')),'closeReason':'system','disposition':_0x262758[0x0]};if(rpc[_0x43c8b7[_0xf670('0xd')]+_0xf670('0xe')]){rpc[_0x43c8b7[_0xf670('0xd')]+_0xf670('0xe')][_0xf670('0xf')](_0x43c8b7['interaction']['id'],_0x401413)['then'](function(_0x22e8dc){logger['info'](_0xf670('0x10'),_0x591eb8,_0x43c8b7[_0xf670('0x11')]['id']);})[_0xf670('0x12')](function(_0x53abc5){logger[_0xf670('0x13')](_0xf670('0x14'),_0x591eb8,JSON[_0xf670('0x15')](_0x53abc5));})['finally'](function(){_0x557789[_0xf670('0x16')]();});}}catch(_0x2e3a18){logger[_0xf670('0x13')](_0xf670('0x14'),_0x591eb8,JSON[_0xf670('0x15')](_0x2e3a18));_0x557789[_0xf670('0x16')]();}};}; \ No newline at end of file +var _0xfa90=['stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','error'];(function(_0x3f5e8c,_0x31b005){var _0x406be4=function(_0x21ed91){while(--_0x21ed91){_0x3f5e8c['push'](_0x3f5e8c['shift']());}};_0x406be4(++_0x31b005);}(_0xfa90,0xd1));var _0x0fa9=function(_0x2629f5,_0x5782dd){_0x2629f5=_0x2629f5-0x0;var _0x227aa4=_0xfa90[_0x2629f5];return _0x227aa4;};'use strict';var moment=require('moment');var logger=require(_0x0fa9('0x0'))(_0x0fa9('0x1'));var rpc={'chatInteraction':require(_0x0fa9('0x2')),'openchannelInteraction':require(_0x0fa9('0x3')),'smsInteraction':require(_0x0fa9('0x4')),'mailInteraction':require(_0x0fa9('0x5')),'faxInteraction':require(_0x0fa9('0x6')),'whatsappInteraction':require(_0x0fa9('0x7'))};exports[_0x0fa9('0x8')]=function(_0x58ee0d,_0x184e72,_0x45c9b1,_0xffea8e){return function(_0x192db6){try{logger[_0x0fa9('0x9')](_0x0fa9('0xa'),_0x58ee0d,_0x184e72[0x0]);var _0x2389ef={'closed':0x1,'closedAt':moment()[_0x0fa9('0xb')](_0x0fa9('0xc')),'closeReason':_0x0fa9('0xd'),'disposition':_0x184e72[0x0]};if(rpc[_0xffea8e[_0x0fa9('0xe')]+_0x0fa9('0xf')]){rpc[_0xffea8e['channel']+_0x0fa9('0xf')][_0x0fa9('0x10')](_0xffea8e[_0x0fa9('0x11')]['id'],_0x2389ef)[_0x0fa9('0x12')](function(_0x12a8c3){logger[_0x0fa9('0x9')](_0x0fa9('0x13'),_0x58ee0d,_0xffea8e[_0x0fa9('0x11')]['id']);})[_0x0fa9('0x14')](function(_0x57f94a){logger['error'](_0x0fa9('0x15'),_0x58ee0d,JSON[_0x0fa9('0x16')](_0x57f94a));})[_0x0fa9('0x17')](function(){_0x192db6['stop']();});}}catch(_0x3b63ae){logger[_0x0fa9('0x18')](_0x0fa9('0x15'),_0x58ee0d,JSON['stringify'](_0x3b63ae));_0x192db6[_0x0fa9('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 16c94b6..9a3b0a5 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 _0x36bb=['phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','providerResponse','create','metadata','endConversation','next','catch','lodash','moment','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','whatsapp'];(function(_0x52eabc,_0x37a34e){var _0x150fb3=function(_0x46a049){while(--_0x46a049){_0x52eabc['push'](_0x52eabc['shift']());}};_0x150fb3(++_0x37a34e);}(_0x36bb,0xe6));var _0xb36b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36bb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb36b('0x0'));var moment=require(_0xb36b('0x1'));var apiai=require(_0xb36b('0x2'));var md5=require('md5');var utils=require(_0xb36b('0x3'));var logger=require(_0xb36b('0x4'))(_0xb36b('0x5'));var rpc={'chatMessage':require(_0xb36b('0x6')),'openchannelMessage':require(_0xb36b('0x7')),'mailMessage':require(_0xb36b('0x8')),'smsMessage':require(_0xb36b('0x9')),'faxMessage':require(_0xb36b('0xa')),'whatsappMessage':require(_0xb36b('0xb'))};exports[_0xb36b('0xc')]=function(_0x181f45,_0x2e9885){return function(_0x229483){try{if(!_[_0xb36b('0xd')](this[_0xb36b('0xe')][_0xb36b('0xf')])){logger[_0xb36b('0x10')](_0xb36b('0x11'),_0x181f45,_0xb36b('0x12'));return _0x229483['next']();}var _0x2323b0={'ContactId':this[_0xb36b('0x13')]['id'],'sentAt':moment()[_0xb36b('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb36b('0x15')};if(this[_0xb36b('0x16')]===_0xb36b('0x17')||this[_0xb36b('0x16')]===_0xb36b('0x18')){_0x2323b0[_0xb36b('0x19')]=this[_0xb36b('0xe')][_0xb36b('0x19')];}var _0x1e686b=this[_0xb36b('0x16')];if(_0x1e686b===_0xb36b('0x1a')){_0x2323b0['ChatWebsiteId']=this[_0xb36b('0x1b')]['id'];}else{_0x2323b0[_['upperFirst'](_0x1e686b)+'AccountId']=this[_0xb36b('0x1b')]['id'];}_0x2323b0[_[_0xb36b('0x1c')](_0x1e686b)+_0xb36b('0x1d')]=this[_0xb36b('0xe')]['id'];if(this[_0xb36b('0xe')][_0xb36b('0x1e')]){var _0x5ad8c8=_0x2e9885[0x2];if(!_[_0xb36b('0x1f')](_0x5ad8c8)){_0x2323b0[_0xb36b('0x20')]=utils[_0xb36b('0x21')](_0x5ad8c8,this);return rpc[_0x1e686b+_0xb36b('0x22')]['create'](_0x2323b0)[_0xb36b('0x23')](function(_0x211a91){logger[_0xb36b('0x10')]('[%s][DIALOGFLOW]\x20%s',_0x181f45,_0x2323b0[_0xb36b('0x20')]);})['catch'](function(_0xcb8893){logger[_0xb36b('0x24')](_0xb36b('0x11'),_0x181f45,JSON[_0xb36b('0x25')](_0xcb8893));})[_0xb36b('0x26')](function(){logger[_0xb36b('0x10')](_0xb36b('0x27'),_0x181f45);_0x229483['stop']();});}else{logger[_0xb36b('0x10')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x181f45);_0x229483[_0xb36b('0x28')]();}}else{var _0x52b74f=this;var _0x3b8030=apiai(_0x2e9885[0x0],{'language':_0x2e9885[0x1]||'en'});return _0x3b8030[_0xb36b('0x29')](this[_0xb36b('0x2a')][_0xb36b('0x20')],{'sessionId':md5(this[_0xb36b('0xe')]['id'])})['then'](function(_0x474083){_0x52b74f[_0xb36b('0x20')][_0xb36b('0x2b')]=_0x474083;_0x2323b0['body']=_0x474083[_0xb36b('0x2c')]['fulfillment']['speech'];_0x2323b0['providerName']=_0xb36b('0x2b');_0x2323b0[_0xb36b('0x2d')]=JSON[_0xb36b('0x25')](_0x474083);return rpc[_0x1e686b+_0xb36b('0x22')][_0xb36b('0x2e')](_0x2323b0)[_0xb36b('0x23')](function(_0xd28a27){logger[_0xb36b('0x10')]('[%s][DIALOGFLOW]\x20%s',_0x181f45,_0x2323b0['body']);if(_0x474083[_0xb36b('0x2c')][_0xb36b('0x2f')][_0xb36b('0x30')]){_0x229483[_0xb36b('0x31')]();}else{_0x229483['stop']();}})['catch'](function(_0x14d3f1){logger['error'](_0xb36b('0x11'),_0x181f45,JSON[_0xb36b('0x25')](_0x14d3f1));_0x229483['next']();});})[_0xb36b('0x32')](function(_0x24f8bc){logger[_0xb36b('0x24')](_0xb36b('0x11'),_0x181f45,_0x24f8bc[_0xb36b('0x2a')]);_0x229483[_0xb36b('0x31')]();});}}catch(_0x2e8349){logger[_0xb36b('0x24')](_0xb36b('0x11'),_0x181f45,JSON[_0xb36b('0x25')](_0x2e8349));_0x229483[_0xb36b('0x28')]();}};}; \ No newline at end of file +var _0x7b27=['md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','stringify','metadata','error','lodash','apiai-promise'];(function(_0x3ef4ae,_0xb1929a){var _0xbd87ae=function(_0x15d55d){while(--_0x15d55d){_0x3ef4ae['push'](_0x3ef4ae['shift']());}};_0xbd87ae(++_0xb1929a);}(_0x7b27,0x186));var _0x77b2=function(_0x12de96,_0x1afd83){_0x12de96=_0x12de96-0x0;var _0x35dafc=_0x7b27[_0x12de96];return _0x35dafc;};'use strict';var _=require(_0x77b2('0x0'));var moment=require('moment');var apiai=require(_0x77b2('0x1'));var md5=require(_0x77b2('0x2'));var utils=require(_0x77b2('0x3'));var logger=require(_0x77b2('0x4'))('routing');var rpc={'chatMessage':require(_0x77b2('0x5')),'openchannelMessage':require(_0x77b2('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x77b2('0x7')),'faxMessage':require(_0x77b2('0x8')),'whatsappMessage':require(_0x77b2('0x9'))};exports['consequence']=function(_0x22bdcf,_0x2a97d8){return function(_0x2f01a2){try{if(!_[_0x77b2('0xa')](this['interaction'][_0x77b2('0xb')])){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x22bdcf,_0x77b2('0xe'));return _0x2f01a2[_0x77b2('0xf')]();}var _0x3abfbc={'ContactId':this[_0x77b2('0x10')]['id'],'sentAt':moment()[_0x77b2('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x77b2('0x12')};if(this[_0x77b2('0x13')]==='sms'||this[_0x77b2('0x13')]==='whatsapp'){_0x3abfbc[_0x77b2('0x14')]=this[_0x77b2('0x15')]['phone'];}var _0x2a14ba=this['channel'];if(_0x2a14ba===_0x77b2('0x16')){_0x3abfbc[_0x77b2('0x17')]=this[_0x77b2('0x18')]['id'];}else{_0x3abfbc[_[_0x77b2('0x19')](_0x2a14ba)+_0x77b2('0x1a')]=this[_0x77b2('0x18')]['id'];}_0x3abfbc[_[_0x77b2('0x19')](_0x2a14ba)+_0x77b2('0x1b')]=this[_0x77b2('0x15')]['id'];if(this['interaction']['created']){var _0x2cea4a=_0x2a97d8[0x2];if(!_[_0x77b2('0x1c')](_0x2cea4a)){_0x3abfbc[_0x77b2('0x1d')]=utils[_0x77b2('0x1e')](_0x2cea4a,this);return rpc[_0x2a14ba+_0x77b2('0x1f')][_0x77b2('0x20')](_0x3abfbc)[_0x77b2('0x21')](function(_0x4dc713){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x22bdcf,_0x3abfbc[_0x77b2('0x1d')]);})[_0x77b2('0x22')](function(_0x23fbf){logger['error'](_0x77b2('0xd'),_0x22bdcf,JSON['stringify'](_0x23fbf));})[_0x77b2('0x23')](function(){logger[_0x77b2('0xc')](_0x77b2('0x24'),_0x22bdcf);_0x2f01a2[_0x77b2('0x25')]();});}else{logger[_0x77b2('0xc')](_0x77b2('0x26'),_0x22bdcf);_0x2f01a2[_0x77b2('0x25')]();}}else{var _0x542d76=this;var _0x4d5c66=apiai(_0x2a97d8[0x0],{'language':_0x2a97d8[0x1]||'en'});return _0x4d5c66['textRequest'](this[_0x77b2('0x27')][_0x77b2('0x1d')],{'sessionId':md5(this[_0x77b2('0x15')]['id'])})[_0x77b2('0x21')](function(_0x93374a){_0x542d76[_0x77b2('0x1d')][_0x77b2('0x28')]=_0x93374a;_0x3abfbc['body']=_0x93374a[_0x77b2('0x29')][_0x77b2('0x2a')][_0x77b2('0x2b')];_0x3abfbc[_0x77b2('0x2c')]=_0x77b2('0x28');_0x3abfbc[_0x77b2('0x2d')]=JSON[_0x77b2('0x2e')](_0x93374a);return rpc[_0x2a14ba+_0x77b2('0x1f')][_0x77b2('0x20')](_0x3abfbc)[_0x77b2('0x21')](function(_0x5c50a1){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x22bdcf,_0x3abfbc[_0x77b2('0x1d')]);if(_0x93374a[_0x77b2('0x29')][_0x77b2('0x2f')]['endConversation']){_0x2f01a2[_0x77b2('0xf')]();}else{_0x2f01a2[_0x77b2('0x25')]();}})[_0x77b2('0x22')](function(_0x334366){logger[_0x77b2('0x30')](_0x77b2('0xd'),_0x22bdcf,JSON[_0x77b2('0x2e')](_0x334366));_0x2f01a2[_0x77b2('0xf')]();});})[_0x77b2('0x22')](function(_0x16815b){logger[_0x77b2('0x30')](_0x77b2('0xd'),_0x22bdcf,_0x16815b['message']);_0x2f01a2['next']();});}}catch(_0x5c2db3){logger['error'](_0x77b2('0xd'),_0x22bdcf,JSON[_0x77b2('0x2e')](_0x5c2db3));_0x2f01a2['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index cd93510..66e32c7 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 _0xc7e2=['account','InteractionId','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','intent','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','stop','stack','md5','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','body','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','upperFirst','AccountId'];(function(_0x18298c,_0x49f0ee){var _0x27bf0a=function(_0x1b9ec4){while(--_0x1b9ec4){_0x18298c['push'](_0x18298c['shift']());}};_0x27bf0a(++_0x49f0ee);}(_0xc7e2,0x128));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x2c7e('0x0'));var moment=require('moment');var Promise=require(_0x2c7e('0x1'));var logger=require(_0x2c7e('0x2'))(_0x2c7e('0x3'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2c7e('0x4')),'mailMessage':require(_0x2c7e('0x5')),'smsMessage':require(_0x2c7e('0x6')),'faxMessage':require(_0x2c7e('0x7')),'whatsappMessage':require(_0x2c7e('0x8'))};function createMessage(_0x349b69,_0x455c01,_0x92c692,_0x18207c){return new Promise(function(_0x24057f,_0x41e3b7){var _0x175ddc=_[_0x2c7e('0x9')](_0x92c692);_0x175ddc['body']=_0x18207c;return rpc[_0x455c01+_0x2c7e('0xa')][_0x2c7e('0xb')](_0x175ddc)[_0x2c7e('0xc')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x349b69,_0x175ddc[_0x2c7e('0xd')]);_0x24057f();})[_0x2c7e('0xe')](function(_0x4756d8){logger[_0x2c7e('0xf')](_0x2c7e('0x10'),_0x349b69,JSON[_0x2c7e('0x11')](_0x4756d8));_0x41e3b7(_0x4756d8);});});}exports['consequence']=function(_0x43afe7,_0x47b8ac){return function(_0x21b28e){try{if(!_[_0x2c7e('0x12')](this[_0x2c7e('0x13')][_0x2c7e('0x14')])){logger[_0x2c7e('0x15')](_0x2c7e('0x10'),_0x43afe7,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x21b28e[_0x2c7e('0x16')]();}var _0x3a8977={'ContactId':this[_0x2c7e('0x17')]['id'],'sentAt':moment()[_0x2c7e('0x18')](_0x2c7e('0x19')),'direction':_0x2c7e('0x1a')};if(this[_0x2c7e('0x1b')]===_0x2c7e('0x1c')||this[_0x2c7e('0x1b')]==='whatsapp'){_0x3a8977['phone']=this['interaction'][_0x2c7e('0x1d')];}var _0x3d5c91=this[_0x2c7e('0x1b')];if(_0x3d5c91===_0x2c7e('0x1e')){_0x3a8977[_0x2c7e('0x1f')]=this['account']['id'];}else{_0x3a8977[_[_0x2c7e('0x20')](_0x3d5c91)+_0x2c7e('0x21')]=this[_0x2c7e('0x22')]['id'];}_0x3a8977[_[_0x2c7e('0x20')](_0x3d5c91)+_0x2c7e('0x23')]=this[_0x2c7e('0x13')]['id'];if(this['interaction']['created']){var _0x2c77db=_0x47b8ac[0x4];if(!_[_0x2c7e('0x24')](_0x2c77db)){_0x3a8977['body']=utils[_0x2c7e('0x25')](_0x2c77db,this);return rpc[_0x3d5c91+_0x2c7e('0xa')][_0x2c7e('0xb')](_0x3a8977)[_0x2c7e('0xc')](function(_0x18e671){logger[_0x2c7e('0x15')](_0x2c7e('0x10'),_0x43afe7,_0x3a8977['body']);})[_0x2c7e('0xe')](function(_0x38b0f2){logger[_0x2c7e('0xf')](_0x2c7e('0x10'),_0x43afe7,JSON[_0x2c7e('0x11')](_0x38b0f2));})[_0x2c7e('0x26')](function(){logger[_0x2c7e('0x15')](_0x2c7e('0x27'),_0x43afe7);_0x21b28e['stop']();});}else{logger[_0x2c7e('0x15')](_0x2c7e('0x28'),_0x43afe7);_0x21b28e['stop']();}}else{var _0x15b51d=this;var _0x244687=_0x47b8ac[0x2][_0x2c7e('0x29')](/\\n/g,'\x0a');var _0x170b53={'credentials':{'private_key':_0x244687,'client_email':_0x47b8ac[0x1]}};var _0x1158ee=new dialogflow[(_0x2c7e('0x2a'))](_0x170b53);var _0x1abee2=_0x1158ee[_0x2c7e('0x2b')](_0x47b8ac[0x0],md5(_0x15b51d[_0x2c7e('0x13')]['id']));var _0x37ab2a={'session':_0x1abee2,'queryInput':{'text':{'text':_0x15b51d[_0x2c7e('0x2c')][_0x2c7e('0xd')],'languageCode':_0x47b8ac[0x3]||'en'}}};return _0x1158ee[_0x2c7e('0x2d')](_0x37ab2a)[_0x2c7e('0xc')](function(_0x474cee){if(_0x474cee&&_0x474cee['length']){_0x15b51d[_0x2c7e('0xd')]['dialogflowV2']=_0x474cee;var _0x50c3f1=_0x474cee[0x0];var _0x5e9b8a=_0x50c3f1[_0x2c7e('0x2e')]['diagnosticInfo']&&_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x2f')][_0x2c7e('0x30')]?_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x2f')][_0x2c7e('0x30')][_0x2c7e('0x31')][_0x2c7e('0x32')]:![];_0x15b51d['body']['DIALOGFLOWV2_ACTION']=_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x33')];_0x15b51d[_0x2c7e('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x50c3f1[_0x2c7e('0x2e')]['allRequiredParamsPresent'];_0x15b51d[_0x2c7e('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x2f')]&&_0x50c3f1['queryResult'][_0x2c7e('0x2f')][_0x2c7e('0x30')]?_0x50c3f1[_0x2c7e('0x2e')]['diagnosticInfo'][_0x2c7e('0x30')][_0x2c7e('0x31')]['boolValue']:![];_0x15b51d[_0x2c7e('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x34')]['name'];_0x15b51d['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x50c3f1['queryResult'][_0x2c7e('0x34')][_0x2c7e('0x35')];_0x15b51d['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x34')][_0x2c7e('0x36')];_0x15b51d[_0x2c7e('0xd')][_0x2c7e('0x37')]=_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x38')];_0x15b51d[_0x2c7e('0xd')]['DIALOGFLOWV2_QUERYTEXT']=_0x50c3f1['queryResult']['queryText'];_0x15b51d[_0x2c7e('0xd')]['DIALOGFLOWV2_SCORE']=_0x50c3f1[_0x2c7e('0x2e')][_0x2c7e('0x39')];_0x3a8977[_0x2c7e('0x3a')]=_0x2c7e('0x3b');_0x3a8977[_0x2c7e('0x3c')]=JSON[_0x2c7e('0x11')](_0x474cee);var _0x267dd7=[];for(var _0x555c5f=0x0;_0x555c5f<_0x474cee['length'];_0x555c5f++){var _0x2a43f9=_0x474cee[_0x555c5f];if(_0x2a43f9&&_0x2a43f9[_0x2c7e('0x2e')]&&_0x2a43f9['queryResult'][_0x2c7e('0x3d')]){_0x267dd7[_0x2c7e('0x3e')](createMessage(_0x43afe7,_0x3d5c91,_0x3a8977,_0x2a43f9['queryResult'][_0x2c7e('0x3d')]));}}return Promise[_0x2c7e('0x3f')](_0x267dd7)['then'](function(){if(_0x5e9b8a){_0x21b28e['next']();}else{_0x21b28e[_0x2c7e('0x40')]();}})[_0x2c7e('0xe')](function(_0x1e2014){logger[_0x2c7e('0xf')](_0x2c7e('0x10'),_0x43afe7,JSON['stringify'](_0x1e2014));_0x21b28e[_0x2c7e('0x16')]();});}})['catch'](function(_0x1a3921){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x43afe7,_0x1a3921['message'],_0x1a3921[_0x2c7e('0x41')]);_0x21b28e['next']();});}}catch(_0x3d9fda){logger[_0x2c7e('0xf')](_0x2c7e('0x10'),_0x43afe7,JSON[_0x2c7e('0x11')](_0x3d9fda));_0x21b28e[_0x2c7e('0x40')]();}};}; \ No newline at end of file +var _0x8db3=['message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','providerResponse','length','push','all','stack','dialogflow','moment','bluebird','../../../../config/logger','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','isEmpty','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','sessionPath','interaction'];(function(_0x121707,_0x270973){var _0xded885=function(_0xf11153){while(--_0xf11153){_0x121707['push'](_0x121707['shift']());}};_0xded885(++_0x270973);}(_0x8db3,0xee));var _0x38db=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x8db3[_0x39096d];return _0x13da4f;};'use strict';var _=require('lodash');var dialogflow=require(_0x38db('0x0'));var md5=require('md5');var moment=require(_0x38db('0x1'));var Promise=require(_0x38db('0x2'));var logger=require(_0x38db('0x3'))('routing');var utils=require(_0x38db('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x38db('0x5')),'mailMessage':require(_0x38db('0x6')),'smsMessage':require(_0x38db('0x7')),'faxMessage':require(_0x38db('0x8')),'whatsappMessage':require(_0x38db('0x9'))};function createMessage(_0x2a80fd,_0xfa2c68,_0x28ec3b,_0xb60841){return new Promise(function(_0xb254f0,_0x5cf618){var _0x16a585=_['clone'](_0x28ec3b);_0x16a585[_0x38db('0xa')]=_0xb60841;return rpc[_0xfa2c68+_0x38db('0xb')][_0x38db('0xc')](_0x16a585)[_0x38db('0xd')](function(){logger[_0x38db('0xe')](_0x38db('0xf'),_0x2a80fd,_0x16a585[_0x38db('0xa')]);_0xb254f0();})[_0x38db('0x10')](function(_0x5767ae){logger[_0x38db('0x11')](_0x38db('0xf'),_0x2a80fd,JSON[_0x38db('0x12')](_0x5767ae));_0x5cf618(_0x5767ae);});});}exports[_0x38db('0x13')]=function(_0x1b699a,_0xf3c318){return function(_0x2324a9){try{if(!_[_0x38db('0x14')](this['interaction'][_0x38db('0x15')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1b699a,_0x38db('0x16'));return _0x2324a9[_0x38db('0x17')]();}var _0x20579b={'ContactId':this[_0x38db('0x18')]['id'],'sentAt':moment()[_0x38db('0x19')](_0x38db('0x1a')),'direction':_0x38db('0x1b')};if(this['channel']===_0x38db('0x1c')||this[_0x38db('0x1d')]===_0x38db('0x1e')){_0x20579b[_0x38db('0x1f')]=this['interaction'][_0x38db('0x1f')];}var _0x16b64e=this['channel'];if(_0x16b64e===_0x38db('0x20')){_0x20579b[_0x38db('0x21')]=this[_0x38db('0x22')]['id'];}else{_0x20579b[_[_0x38db('0x23')](_0x16b64e)+'AccountId']=this[_0x38db('0x22')]['id'];}_0x20579b[_[_0x38db('0x23')](_0x16b64e)+'InteractionId']=this['interaction']['id'];if(this['interaction']['created']){var _0x358929=_0xf3c318[0x4];if(!_[_0x38db('0x24')](_0x358929)){_0x20579b[_0x38db('0xa')]=utils[_0x38db('0x25')](_0x358929,this);return rpc[_0x16b64e+'Message'][_0x38db('0xc')](_0x20579b)[_0x38db('0xd')](function(_0x40e680){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1b699a,_0x20579b[_0x38db('0xa')]);})[_0x38db('0x10')](function(_0x21c6ba){logger[_0x38db('0x11')](_0x38db('0xf'),_0x1b699a,JSON[_0x38db('0x12')](_0x21c6ba));})[_0x38db('0x26')](function(){logger[_0x38db('0xe')](_0x38db('0x27'),_0x1b699a);_0x2324a9['stop']();});}else{logger['info'](_0x38db('0x28'),_0x1b699a);_0x2324a9[_0x38db('0x29')]();}}else{var _0x138304=this;var _0x4fe91d=_0xf3c318[0x2][_0x38db('0x2a')](/\\n/g,'\x0a');var _0x389bda={'credentials':{'private_key':_0x4fe91d,'client_email':_0xf3c318[0x1]}};var _0x3ef32b=new dialogflow[(_0x38db('0x2b'))](_0x389bda);var _0x2abf88=_0x3ef32b[_0x38db('0x2c')](_0xf3c318[0x0],md5(_0x138304[_0x38db('0x2d')]['id']));var _0x2ffbba={'session':_0x2abf88,'queryInput':{'text':{'text':_0x138304[_0x38db('0x2e')][_0x38db('0xa')],'languageCode':_0xf3c318[0x3]||'en'}}};return _0x3ef32b[_0x38db('0x2f')](_0x2ffbba)['then'](function(_0x3b4223){if(_0x3b4223&&_0x3b4223['length']){_0x138304[_0x38db('0xa')][_0x38db('0x30')]=_0x3b4223;var _0x41e9f6=_0x3b4223[0x0];var _0x59bc35=_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')]&&_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')][_0x38db('0x33')]?_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')][_0x38db('0x33')][_0x38db('0x34')]['boolValue']:![];_0x138304['body'][_0x38db('0x35')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x36')];_0x138304[_0x38db('0xa')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x41e9f6[_0x38db('0x31')]['allRequiredParamsPresent'];_0x138304[_0x38db('0xa')][_0x38db('0x37')]=_0x41e9f6['queryResult']['diagnosticInfo']&&_0x41e9f6['queryResult'][_0x38db('0x32')]['fields']?_0x41e9f6[_0x38db('0x31')][_0x38db('0x32')][_0x38db('0x33')]['end_conversation'][_0x38db('0x38')]:![];_0x138304[_0x38db('0xa')][_0x38db('0x39')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3a')]['name'];_0x138304[_0x38db('0xa')][_0x38db('0x3b')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3a')][_0x38db('0x3c')];_0x138304['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3a')]['isFallback'];_0x138304[_0x38db('0xa')][_0x38db('0x3d')]=_0x41e9f6['queryResult']['languageCode'];_0x138304[_0x38db('0xa')][_0x38db('0x3e')]=_0x41e9f6[_0x38db('0x31')][_0x38db('0x3f')];_0x138304[_0x38db('0xa')]['DIALOGFLOWV2_SCORE']=_0x41e9f6[_0x38db('0x31')][_0x38db('0x40')];_0x20579b[_0x38db('0x41')]='dialogflowV2';_0x20579b[_0x38db('0x42')]=JSON[_0x38db('0x12')](_0x3b4223);var _0x3e2d4f=[];for(var _0x148efe=0x0;_0x148efe<_0x3b4223[_0x38db('0x43')];_0x148efe++){var _0x1b07a1=_0x3b4223[_0x148efe];if(_0x1b07a1&&_0x1b07a1[_0x38db('0x31')]&&_0x1b07a1[_0x38db('0x31')]['fulfillmentText']){_0x3e2d4f[_0x38db('0x44')](createMessage(_0x1b699a,_0x16b64e,_0x20579b,_0x1b07a1['queryResult']['fulfillmentText']));}}return Promise[_0x38db('0x45')](_0x3e2d4f)[_0x38db('0xd')](function(){if(_0x59bc35){_0x2324a9[_0x38db('0x17')]();}else{_0x2324a9[_0x38db('0x29')]();}})[_0x38db('0x10')](function(_0x3e4b51){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1b699a,JSON[_0x38db('0x12')](_0x3e4b51));_0x2324a9[_0x38db('0x17')]();});}})[_0x38db('0x10')](function(_0x4802f6){logger[_0x38db('0x11')](_0x38db('0xf'),_0x1b699a,_0x4802f6[_0x38db('0x2e')],_0x4802f6[_0x38db('0x46')]);_0x2324a9['next']();});}}catch(_0x2ef472){logger[_0x38db('0x11')](_0x38db('0xf'),_0x1b699a,JSON[_0x38db('0x12')](_0x2ef472));_0x2324a9[_0x38db('0x29')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 02fb2f4..184919e 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 _0xa8cf=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x1b9f11,_0x3be3de){var _0x3311d2=function(_0x1a5150){while(--_0x1a5150){_0x1b9f11['push'](_0x1b9f11['shift']());}};_0x3311d2(++_0x3be3de);}(_0xa8cf,0x198));var _0xfa8c=function(_0x2fb22b,_0xa4226e){_0x2fb22b=_0x2fb22b-0x0;var _0x14f065=_0xa8cf[_0x2fb22b];return _0x14f065;};'use strict';var schema=require(_0xfa8c('0x0'));var _=require(_0xfa8c('0x1'));var htmlToText=require(_0xfa8c('0x2'));var utils=require(_0xfa8c('0x3'));var logger=require(_0xfa8c('0x4'))(_0xfa8c('0x5'));var gotoif=schema({'condition':{'type':_0xfa8c('0x6'),'required':!![],'message':_0xfa8c('0x7')},'priorityTrue':{'type':'number','message':_0xfa8c('0x8')},'priorityFalse':{'type':_0xfa8c('0x9'),'message':_0xfa8c('0xa')}});exports[_0xfa8c('0xb')]=function(_0xb57914,_0x1facda){return function(_0x574415){try{var _0xf82358={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x1facda[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1facda[0x1],'priorityFalse':_0x1facda[0x2]};var _0x94f689=gotoif[_0xfa8c('0x0')](_0xf82358,{'typecast':!![]});if(_0x94f689[_0xfa8c('0xc')]){logger[_0xfa8c('0xd')](_0xfa8c('0xe'),_0xb57914,_[_0xfa8c('0xf')](_0x94f689,_0xfa8c('0x10'))[_0xfa8c('0x11')](',\x20'));_0x574415['stop']();}else{try{var _0x465f34=eval('('+_0xf82358[_0xfa8c('0x12')]+')');var _0x54b9a4=_0x465f34?_0xf82358['priorityTrue']:_0xf82358[_0xfa8c('0x13')];logger['info'](_0xfa8c('0x14'),_0xb57914,_0xf82358[_0xfa8c('0x12')],_0x465f34,_0x54b9a4||'next');if(_0x54b9a4){var _0x12cac4=_['findIndex'](_0x574415[_0xfa8c('0x15')](),{'p':_0x54b9a4});if(_0x12cac4>=0x0){logger[_0xfa8c('0x16')](_0xfa8c('0x17'),_0xb57914,_0x54b9a4||_0xfa8c('0x18'),_0x12cac4);_0x574415['next'](_0x12cac4);}else{logger[_0xfa8c('0x16')](_0xfa8c('0x19'),_0xb57914,_0x54b9a4||_0xfa8c('0x18'));_0x574415[_0xfa8c('0x1a')]();}}else{_0x574415[_0xfa8c('0x18')]();}}catch(_0x12e50c){logger[_0xfa8c('0xd')](_0xfa8c('0x1b'),_0xb57914,_0x12e50c[_0xfa8c('0x10')]);_0x574415[_0xfa8c('0x1a')]();}}}catch(_0x306861){logger['error'](_0xfa8c('0xe'),_0xb57914,JSON[_0xfa8c('0x1c')](_0x306861));_0x574415[_0xfa8c('0x1a')]();}};}; \ No newline at end of file +var _0xfbf9=['consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number'];(function(_0x204b2d,_0x4b4175){var _0x8da4bf=function(_0x491736){while(--_0x491736){_0x204b2d['push'](_0x204b2d['shift']());}};_0x8da4bf(++_0x4b4175);}(_0xfbf9,0xc9));var _0x9fbf=function(_0xeeb156,_0x5392f4){_0xeeb156=_0xeeb156-0x0;var _0x4b7c74=_0xfbf9[_0xeeb156];return _0x4b7c74;};'use strict';var schema=require(_0x9fbf('0x0'));var _=require('lodash');var htmlToText=require(_0x9fbf('0x1'));var utils=require('./utils');var logger=require(_0x9fbf('0x2'))(_0x9fbf('0x3'));var gotoif=schema({'condition':{'type':_0x9fbf('0x4'),'required':!![],'message':_0x9fbf('0x5')},'priorityTrue':{'type':_0x9fbf('0x6'),'message':_0x9fbf('0x7')},'priorityFalse':{'type':'number','message':_0x9fbf('0x8')}});exports[_0x9fbf('0x9')]=function(_0x1d8b3d,_0x1c270d){return function(_0x18693f){try{var _0x106000={'condition':htmlToText[_0x9fbf('0xa')](utils[_0x9fbf('0xb')](_0x1c270d[0x0],this),{'wordwrap':![]})[_0x9fbf('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1c270d[0x1],'priorityFalse':_0x1c270d[0x2]};var _0x2fa005=gotoif[_0x9fbf('0x0')](_0x106000,{'typecast':!![]});if(_0x2fa005[_0x9fbf('0xd')]){logger[_0x9fbf('0xe')](_0x9fbf('0xf'),_0x1d8b3d,_[_0x9fbf('0x10')](_0x2fa005,'message')[_0x9fbf('0x11')](',\x20'));_0x18693f[_0x9fbf('0x12')]();}else{try{var _0x450b8d=eval('('+_0x106000[_0x9fbf('0x13')]+')');var _0x7eb0d0=_0x450b8d?_0x106000[_0x9fbf('0x14')]:_0x106000['priorityFalse'];logger[_0x9fbf('0x15')](_0x9fbf('0x16'),_0x1d8b3d,_0x106000['condition'],_0x450b8d,_0x7eb0d0||_0x9fbf('0x17'));if(_0x7eb0d0){var _0x32885e=_[_0x9fbf('0x18')](_0x18693f[_0x9fbf('0x19')](),{'p':_0x7eb0d0});if(_0x32885e>=0x0){logger[_0x9fbf('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1d8b3d,_0x7eb0d0||_0x9fbf('0x17'),_0x32885e);_0x18693f[_0x9fbf('0x17')](_0x32885e);}else{logger[_0x9fbf('0x15')](_0x9fbf('0x1a'),_0x1d8b3d,_0x7eb0d0||_0x9fbf('0x17'));_0x18693f[_0x9fbf('0x12')]();}}else{_0x18693f['next']();}}catch(_0x7e09ef){logger[_0x9fbf('0xe')](_0x9fbf('0x1b'),_0x1d8b3d,_0x7e09ef[_0x9fbf('0x1c')]);_0x18693f[_0x9fbf('0x12')]();}}}catch(_0x4f73c4){logger[_0x9fbf('0xe')](_0x9fbf('0xf'),_0x1d8b3d,JSON[_0x9fbf('0x1d')](_0x4f73c4));_0x18693f[_0x9fbf('0x12')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index ae0f576..e4ad807 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 _0x0c1f=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x1d046a,_0x30db41){var _0x2c0b0c=function(_0x30a3c5){while(--_0x30a3c5){_0x1d046a['push'](_0x1d046a['shift']());}};_0x2c0b0c(++_0x30db41);}(_0x0c1f,0x8f));var _0xf0c1=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0x0c1f[_0x408b34];return _0x1182aa;};'use strict';var schema=require(_0xf0c1('0x0'));var _=require(_0xf0c1('0x1'));var logger=require(_0xf0c1('0x2'))(_0xf0c1('0x3'));var gotop=schema({'priority':{'type':_0xf0c1('0x4'),'required':!![],'message':_0xf0c1('0x5')}});exports[_0xf0c1('0x6')]=function(_0x8d87d6,_0x4487bc){return function(_0x4d332c){try{var _0x2d8c14={'priority':_0x4487bc[0x0]};var _0x22415b=gotop[_0xf0c1('0x0')](_0x2d8c14,{'typecast':!![]});if(_0x22415b[_0xf0c1('0x7')]){logger[_0xf0c1('0x8')](_0xf0c1('0x9'),_0x8d87d6,_['map'](_0x22415b,_0xf0c1('0xa'))[_0xf0c1('0xb')](',\x20'));_0x4d332c[_0xf0c1('0xc')]();}else{logger[_0xf0c1('0xd')](_0xf0c1('0xe'),_0x8d87d6,_0x2d8c14['priority']);if(_0x2d8c14[_0xf0c1('0xf')]){var _0x2af868=_['findIndex'](_0x4d332c['rules'](),{'p':_0x2d8c14[_0xf0c1('0xf')]});if(_0x2af868>=0x0){logger[_0xf0c1('0xd')](_0xf0c1('0x10'),_0x8d87d6,_0x2d8c14[_0xf0c1('0xf')]||_0xf0c1('0x11'),_0x2af868);_0x4d332c['next'](_0x2af868);}else{logger[_0xf0c1('0xd')](_0xf0c1('0x12'),_0x8d87d6,_0x2d8c14[_0xf0c1('0xf')]||_0xf0c1('0x11'));_0x4d332c['stop']();}}else{_0x4d332c[_0xf0c1('0x11')]();}}}catch(_0x345999){logger[_0xf0c1('0x8')](_0xf0c1('0x9'),_0x8d87d6,JSON[_0xf0c1('0x13')](_0x345999));_0x4d332c[_0xf0c1('0xc')]();}};}; \ No newline at end of file +var _0x21f6=['stringify','validate','lodash','../../../../config/logger','routing','number','consequence','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x1769a8,_0x328d23){var _0x217eb8=function(_0xd82868){while(--_0xd82868){_0x1769a8['push'](_0x1769a8['shift']());}};_0x217eb8(++_0x328d23);}(_0x21f6,0x19f));var _0x621f=function(_0x4edc9f,_0x48cf5c){_0x4edc9f=_0x4edc9f-0x0;var _0x2e9b37=_0x21f6[_0x4edc9f];return _0x2e9b37;};'use strict';var schema=require(_0x621f('0x0'));var _=require(_0x621f('0x1'));var logger=require(_0x621f('0x2'))(_0x621f('0x3'));var gotop=schema({'priority':{'type':_0x621f('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x621f('0x5')]=function(_0x3d89e9,_0x33da54){return function(_0x3bf55b){try{var _0x296f36={'priority':_0x33da54[0x0]};var _0x3e8464=gotop[_0x621f('0x0')](_0x296f36,{'typecast':!![]});if(_0x3e8464['length']){logger[_0x621f('0x6')](_0x621f('0x7'),_0x3d89e9,_[_0x621f('0x8')](_0x3e8464,_0x621f('0x9'))['join'](',\x20'));_0x3bf55b[_0x621f('0xa')]();}else{logger[_0x621f('0xb')](_0x621f('0xc'),_0x3d89e9,_0x296f36[_0x621f('0xd')]);if(_0x296f36[_0x621f('0xd')]){var _0x532578=_[_0x621f('0xe')](_0x3bf55b['rules'](),{'p':_0x296f36[_0x621f('0xd')]});if(_0x532578>=0x0){logger[_0x621f('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3d89e9,_0x296f36['priority']||'next',_0x532578);_0x3bf55b[_0x621f('0xf')](_0x532578);}else{logger[_0x621f('0xb')](_0x621f('0x10'),_0x3d89e9,_0x296f36[_0x621f('0xd')]||'next');_0x3bf55b['stop']();}}else{_0x3bf55b[_0x621f('0xf')]();}}}catch(_0x58de4d){logger[_0x621f('0x6')](_0x621f('0x7'),_0x3d89e9,JSON[_0x621f('0x11')](_0x58de4d));_0x3bf55b[_0x621f('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 6745408..6e3a883 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 _0x95a9=['info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','AccountId','upperFirst','InteractionId','interaction','Message','create'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x95a9,0x10b));var _0x995a=function(_0x2e861c,_0x504895){_0x2e861c=_0x2e861c-0x0;var _0x33caba=_0x95a9[_0x2e861c];return _0x33caba;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x995a('0x0'))(_0x995a('0x1'));var rpc={'chatMessage':require(_0x995a('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x995a('0x3')),'faxMessage':require(_0x995a('0x4')),'whatsappMessage':require(_0x995a('0x5'))};exports[_0x995a('0x6')]=function(_0x4ec437,_0x49c545){return function(_0x37446c){try{var _0x572282={'body':utils[_0x995a('0x7')](_0x49c545[0x0],this),'ContactId':this[_0x995a('0x8')]['id']};if(this['channel']===_0x995a('0x9')){_0x572282[_0x995a('0xa')]=this[_0x995a('0xb')]['id'];}else{_0x572282[_['upperFirst'](this[_0x995a('0xc')])+_0x995a('0xd')]=this[_0x995a('0xb')]['id'];}_0x572282[_[_0x995a('0xe')](this[_0x995a('0xc')])+_0x995a('0xf')]=this[_0x995a('0x10')]['id'];if(rpc[this[_0x995a('0xc')]+_0x995a('0x11')]){return rpc[this[_0x995a('0xc')]+_0x995a('0x11')][_0x995a('0x12')](_0x572282)['then'](function(_0x7085cc){logger[_0x995a('0x13')](_0x995a('0x14'),_0x4ec437,_0x572282['body']);_0x37446c[_0x995a('0x15')]();})[_0x995a('0x16')](function(_0x3ef75c){logger[_0x995a('0x17')](_0x995a('0x14'),_0x4ec437,JSON[_0x995a('0x18')](_0x3ef75c));_0x37446c[_0x995a('0x19')]();});}}catch(_0x2b4d1a){logger['error'](_0x995a('0x14'),_0x4ec437,JSON[_0x995a('0x18')](_0x2b4d1a));_0x37446c[_0x995a('0x19')]();}};}; \ No newline at end of file +var _0xac9d=['../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','stop','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x47838c,_0x10eb98){var _0x2a62b6=function(_0xcdebad){while(--_0xcdebad){_0x47838c['push'](_0x47838c['shift']());}};_0x2a62b6(++_0x10eb98);}(_0xac9d,0x19c));var _0xdac9=function(_0x271a80,_0x268bac){_0x271a80=_0x271a80-0x0;var _0xf8233e=_0xac9d[_0x271a80];return _0xf8233e;};'use strict';var _=require(_0xdac9('0x0'));var utils=require(_0xdac9('0x1'));var logger=require('../../../../config/logger')(_0xdac9('0x2'));var rpc={'chatMessage':require(_0xdac9('0x3')),'openchannelMessage':require(_0xdac9('0x4')),'mailMessage':require(_0xdac9('0x5')),'smsMessage':require(_0xdac9('0x6')),'faxMessage':require(_0xdac9('0x7')),'whatsappMessage':require(_0xdac9('0x8'))};exports[_0xdac9('0x9')]=function(_0x510309,_0x369687){return function(_0x3f8e2f){try{var _0x4e8967={'body':utils['getMustacheRender'](_0x369687[0x0],this),'ContactId':this[_0xdac9('0xa')]['id']};if(this[_0xdac9('0xb')]===_0xdac9('0xc')){_0x4e8967[_0xdac9('0xd')]=this[_0xdac9('0xe')]['id'];}else{_0x4e8967[_[_0xdac9('0xf')](this[_0xdac9('0xb')])+_0xdac9('0x10')]=this[_0xdac9('0xe')]['id'];}_0x4e8967[_[_0xdac9('0xf')](this['channel'])+_0xdac9('0x11')]=this[_0xdac9('0x12')]['id'];if(rpc[this[_0xdac9('0xb')]+_0xdac9('0x13')]){return rpc[this[_0xdac9('0xb')]+_0xdac9('0x13')][_0xdac9('0x14')](_0x4e8967)[_0xdac9('0x15')](function(_0x5466fe){logger[_0xdac9('0x16')](_0xdac9('0x17'),_0x510309,_0x4e8967[_0xdac9('0x18')]);_0x3f8e2f[_0xdac9('0x19')]();})['catch'](function(_0x29a123){logger['error']('[%s][MESSAGE]\x20%s',_0x510309,JSON['stringify'](_0x29a123));_0x3f8e2f[_0xdac9('0x1a')]();});}}catch(_0xdd546a){logger['error'](_0xdac9('0x17'),_0x510309,JSON[_0xdac9('0x1b')](_0xdd546a));_0x3f8e2f[_0xdac9('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 8115d28..f75ff09 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 _0x9821=['[%s][NOOP]\x20%s','getMustacheRender','error','stringify','./utils','../../../../config/logger','info'];(function(_0x5160ba,_0x33c98b){var _0x44744e=function(_0x4bae30){while(--_0x4bae30){_0x5160ba['push'](_0x5160ba['shift']());}};_0x44744e(++_0x33c98b);}(_0x9821,0x74));var _0x1982=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x9821[_0x381589];return _0x2a075d;};'use strict';var utils=require(_0x1982('0x0'));var logger=require(_0x1982('0x1'))('routing');exports['consequence']=function(_0x309145,_0x5d8736){return function(_0x26c9e2){try{logger[_0x1982('0x2')](_0x1982('0x3'),_0x309145,utils[_0x1982('0x4')](_0x5d8736[0x0],this));_0x26c9e2['next']();}catch(_0x419294){logger[_0x1982('0x5')](_0x1982('0x3'),_0x309145,JSON[_0x1982('0x6')](_0x419294));_0x26c9e2['stop']();}};}; \ No newline at end of file +var _0x9ce8=['stringify','stop','./utils','../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x3dfa1c,_0x25e509){var _0x521747=function(_0x450db8){while(--_0x450db8){_0x3dfa1c['push'](_0x3dfa1c['shift']());}};_0x521747(++_0x25e509);}(_0x9ce8,0xf5));var _0x89ce=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x9ce8[_0x47b58b];return _0x46bebe;};'use strict';var utils=require(_0x89ce('0x0'));var logger=require(_0x89ce('0x1'))('routing');exports['consequence']=function(_0x13892a,_0x44d51e){return function(_0x443a8f){try{logger[_0x89ce('0x2')](_0x89ce('0x3'),_0x13892a,utils[_0x89ce('0x4')](_0x44d51e[0x0],this));_0x443a8f[_0x89ce('0x5')]();}catch(_0x41c940){logger[_0x89ce('0x6')](_0x89ce('0x3'),_0x13892a,JSON[_0x89ce('0x7')](_0x41c940));_0x443a8f[_0x89ce('0x8')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 58d7819..a7dcdb8 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 _0xd757=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','update','then','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','map','stop','find','Queues','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','push','capitalize','InteractionId','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save'];(function(_0x59b606,_0x32f840){var _0x48f8d8=function(_0x5a3b1b){while(--_0x5a3b1b){_0x59b606['push'](_0x59b606['shift']());}};_0x48f8d8(++_0x32f840);}(_0xd757,0x1e5));var _0x7d75=function(_0x48ea2e,_0x50184e){_0x48ea2e=_0x48ea2e-0x0;var _0x3b6f6d=_0xd757[_0x48ea2e];return _0x3b6f6d;};'use strict';var schema=require(_0x7d75('0x0'));var _=require(_0x7d75('0x1'));var util=require(_0x7d75('0x2'));var seqqueue=require(_0x7d75('0x3'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x7d75('0x4'));var logger=require(_0x7d75('0x5'))('routing');var strategy=require(_0x7d75('0x6'));config[_0x7d75('0x7')]=_[_0x7d75('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7d75('0x9'))(new Redis(config[_0x7d75('0x7')]));var attributes=['id',_0x7d75('0xa'),_0x7d75('0xb'),_0x7d75('0xc'),_0x7d75('0xd'),_0x7d75('0xe')];function emit(_0x3720c7,_0x24e1d8,_0x79266b){io['to'](_0x3720c7)[_0x7d75('0xf')](_0x24e1d8,_0x79266b);}function emitChannelQueueInteraction(_0x3043fc,_0x2ac971,_0x5eadfc,_0x4bc531,_0x38cd18,_0x244488,_0x469592,_0x5ef6cf){var _0x3e7b97=_[_0x7d75('0x10')](_0x5eadfc);_0x3e7b97['queue_id']=_0x5ef6cf;_0x3e7b97[_0x7d75('0xc')]=_0x2ac971;_0x3e7b97[_0x7d75('0xb')]=_0x4bc531;_0x3e7b97['id']=_0x38cd18;if(_0x244488){attributes[_0x7d75('0x11')](_[_0x7d75('0x12')](_0x3043fc)+_0x7d75('0x13'));_0x469592[util[_0x7d75('0x14')]('%sQueuesWaitingInteractions',_0x3043fc)][_0x38cd18]=_[_0x7d75('0x15')](_0x3e7b97,attributes);}else{delete _0x469592[util[_0x7d75('0x14')](_0x7d75('0x16'),_0x3043fc)][_0x38cd18];}emit(util[_0x7d75('0x14')](_0x7d75('0x17'),_0x3043fc,_0x2ac971),util[_0x7d75('0x14')]('%s_queue_waiting_interaction:%s',_0x3043fc,_0x244488?_0x7d75('0x18'):'remove'),_[_0x7d75('0x15')](_0x3e7b97,attributes));}var rpc={'openchannelQueueReport':require(_0x7d75('0x19')),'mailQueueReport':require(_0x7d75('0x1a')),'chatQueueReport':require(_0x7d75('0x1b')),'smsQueueReport':require(_0x7d75('0x1c')),'faxQueueReport':require(_0x7d75('0x1d')),'whatsappQueueReport':require(_0x7d75('0x1e')),'chatInteraction':require(_0x7d75('0x1f')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0x7d75('0x20')),'smsInteraction':require(_0x7d75('0x21')),'whatsappInteraction':require(_0x7d75('0x22'))};var queue=schema({'name':{'type':_0x7d75('0x23'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x7d75('0x24'),'message':_0x7d75('0x25')}});function startRouting(_0x103056,_0x3b10c2,_0x232c46,_0x187093){if(_0x103056&&_0x3b10c2&&_0x232c46){_0x3b10c2[_0x7d75('0x26')]+=0x1;var _0x3490d4={'uniqueid':_0x103056,'from':_0x232c46[_0x7d75('0x27')]?_0x232c46[_0x7d75('0x27')][_0x7d75('0xd')]:'','joinAt':moment()[_0x7d75('0x14')](_0x7d75('0x28')),'ContactId':_0x232c46[_0x7d75('0x29')]?_0x232c46[_0x7d75('0x29')]['id']:null,'ListId':_0x232c46[_0x7d75('0x2a')]?_0x232c46[_0x7d75('0x2a')]['id']:null};_0x3490d4[_[_0x7d75('0x2b')](_0x232c46['channel'])+_0x7d75('0x2c')]=_0x3b10c2['id']||null;_0x3490d4[_[_0x7d75('0x2b')](_0x232c46['channel'])+_0x7d75('0x13')]=_0x232c46['interaction']?_0x232c46[_0x7d75('0x2d')]['id']:null;_0x3490d4[_[_0x7d75('0x2b')](_0x232c46[_0x7d75('0x2e')])+_0x7d75('0x2f')]=_0x232c46[_0x7d75('0x30')]?_0x232c46['message']['id']:null;_0x3490d4[_[_0x7d75('0x2b')](_0x232c46[_0x7d75('0x2e')])+(_0x232c46[_0x7d75('0x2e')]!==_0x7d75('0x31')?_0x7d75('0x32'):_0x7d75('0x33'))]=_0x232c46['account']?_0x232c46[_0x7d75('0xb')]['id']:null;logger[_0x7d75('0x34')](util[_0x7d75('0x14')](_0x7d75('0x35'),_0x103056,_0x3b10c2[_0x7d75('0x36')]));emitChannelQueueInteraction(_0x232c46[_0x7d75('0x2e')],_0x3b10c2[_0x7d75('0x36')],_0x3490d4,_0x232c46['account']['name'],_0x232c46['message']['id'],!![],_0x187093,_0x3b10c2['id']);if(rpc[_0x232c46[_0x7d75('0x2e')]+'QueueReport']){return rpc[_0x232c46[_0x7d75('0x2e')]+_0x7d75('0x37')][_0x7d75('0x38')](_0x3490d4)[_0x7d75('0x39')](function(_0x3c9235){logger['error'](_0x7d75('0x3a'),_0x3c9235);});}}}function stopRouting(_0x38a9d5,_0x2a5049,_0x31c17c,_0x38268e){if(_0x38a9d5&&_0x2a5049){_0x2a5049[_0x7d75('0x26')]-=0x1;var _0x3c9640={'leaveAt':moment()[_0x7d75('0x14')](_0x7d75('0x28')),'acceptAt':moment()[_0x7d75('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7d75('0x3b')};logger[_0x7d75('0x34')](util[_0x7d75('0x14')](_0x7d75('0x3c'),_0x38a9d5,_0x2a5049[_0x7d75('0x36')]));emitChannelQueueInteraction(_0x31c17c[_0x7d75('0x2e')],_0x2a5049['name'],_0x31c17c[_0x7d75('0x27')],_0x31c17c[_0x7d75('0xb')]['name'],_0x31c17c['message']['id'],![],_0x38268e,_0x2a5049['id']);return rpc[_0x31c17c[_0x7d75('0x2e')]+_0x7d75('0x3d')][_0x7d75('0x3e')](_0x31c17c[_0x7d75('0x2d')]['id'],{'queueId':_0x2a5049['id']})[_0x7d75('0x3f')](function(){if(rpc[_0x31c17c[_0x7d75('0x2e')]+'QueueReport']){return rpc[_0x31c17c[_0x7d75('0x2e')]+_0x7d75('0x37')]['update'](_0x38a9d5,_0x3c9640)[_0x7d75('0x39')](function(_0x22e613){logger[_0x7d75('0x40')](_0x7d75('0x41'),_0x22e613);});}});}}function endRouting(_0x30aeab,_0x25d38c,_0x1f3c5b,_0x815d03){if(_0x30aeab&&_0x25d38c){_0x25d38c[_0x7d75('0x26')]-=0x1;var _0x182e51={'leaveAt':moment()[_0x7d75('0x14')](_0x7d75('0x28')),'exitAt':moment()[_0x7d75('0x14')](_0x7d75('0x28')),'reason':_0x7d75('0x42')};logger[_0x7d75('0x34')](util[_0x7d75('0x14')](_0x7d75('0x43'),_0x30aeab,_0x25d38c[_0x7d75('0x36')]));emitChannelQueueInteraction(_0x1f3c5b[_0x7d75('0x2e')],_0x25d38c['name'],_0x1f3c5b['body'],_0x1f3c5b[_0x7d75('0xb')][_0x7d75('0x36')],_0x1f3c5b[_0x7d75('0x30')]['id'],![],_0x815d03);if(rpc[_0x1f3c5b[_0x7d75('0x2e')]+_0x7d75('0x37')]){return rpc[_0x1f3c5b[_0x7d75('0x2e')]+_0x7d75('0x37')]['update'](_0x30aeab,_0x182e51)[_0x7d75('0x39')](function(_0x23e6f9){logger[_0x7d75('0x40')]('update\x20queue\x20report',_0x23e6f9);});}}}function handleFindQueue(_0x2e1f36){return function(_0x13384f){return _0x13384f[_0x7d75('0x36')][_0x7d75('0x44')]()===_0x2e1f36[_0x7d75('0x44')]();};}exports[_0x7d75('0x45')]=function(_0xa4655f,_0x43b488,_0x1381f4,_0x1089cf){return function(_0x3ce0e7){try{var _0x4c8f60={'name':_0x43b488[0x0],'timeout':_0x43b488[0x1]};var _0x46aa45=queue['validate'](_0x4c8f60,{'typecast':!![]});if(_0x46aa45['length']){logger[_0x7d75('0x40')]('[%s][QUEUE]\x20%s',_0xa4655f,_[_0x7d75('0x46')](_0x46aa45,_0x7d75('0x30'))['join'](',\x20'));_0x3ce0e7[_0x7d75('0x47')]();}else{var _0x39623a=_[_0x7d75('0x48')](_0x1381f4[_0x1089cf[_0x7d75('0x2e')]+_0x7d75('0x49')],handleFindQueue(_0x4c8f60[_0x7d75('0x36')]));if(_0x39623a){startRouting(_0xa4655f,_0x39623a,_0x1089cf,_0x1381f4);var _0x907fd7=(_0x39623a[_0x7d75('0x42')]||0xa)*0x3e8;var _0x5a8a87=(_0x4c8f60[_0x7d75('0x42')]||0x14)*0x3e8;var _0x2564ba;if(_0x907fd7>_0x5a8a87){_0x5a8a87=_0x907fd7;}var _0x14869d=seqqueue['createQueue'](_0x907fd7);_0x14869d['id']=_0xa4655f;_0x14869d[_0x7d75('0x4a')]=_0x907fd7;_0x14869d[_0x7d75('0x4b')]=_0x5a8a87;_0x14869d[_0x7d75('0x2e')]=_0x1089cf[_0x7d75('0x2e')];_0x1381f4[_0x7d75('0x4c')][_0xa4655f]['on'](_0x7d75('0x4d'),function(){logger['info'](_0x7d75('0x4e'),_0xa4655f);stopRouting(_0xa4655f,_0x39623a,_0x1089cf,_0x1381f4);clearTimeout(_0x2564ba);_0x2564ba=undefined;_0x14869d[_0x7d75('0x4f')](!![]);if(_0x1381f4[_0x7d75('0x4c')][_0xa4655f]){delete _0x1381f4[_0x7d75('0x4c')][_0xa4655f];}_0x3ce0e7[_0x7d75('0x47')]();});_0x1381f4[_0x7d75('0x4c')][_0xa4655f]['on']('complete',function(){if(_0x1381f4[_0x7d75('0x4c')][_0xa4655f]){delete _0x1381f4[_0x7d75('0x4c')][_0xa4655f];}});_0x2564ba=setTimeout(function(){logger[_0x7d75('0x34')]('[%s][QUEUE]\x20APPLICATION\x20END',_0xa4655f);endRouting(_0xa4655f,_0x39623a,_0x1089cf,_0x1381f4);clearTimeout(_0x2564ba);_0x14869d[_0x7d75('0x4f')](!![]);_0x3ce0e7['next']();},_0x5a8a87);switch(_0x39623a[_0x7d75('0x50')]){case'rrmemory':strategy[_0x7d75('0x51')](_0x14869d,_0x39623a,_0x1381f4,_0x1089cf);break;default:strategy[_0x7d75('0x52')](_0x14869d,_0x39623a,_0x1381f4,_0x1089cf);}}else{logger[_0x7d75('0x40')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xa4655f,_0x4c8f60[_0x7d75('0x36')]);_0x3ce0e7['stop']();}}}catch(_0x316b83){logger[_0x7d75('0x40')](_0x7d75('0x53'),_0xa4655f,_0x316b83[_0x7d75('0x54')]);_0x3ce0e7[_0x7d75('0x47')]();}};}; \ No newline at end of file +var _0x42b9=['number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','Interaction','then','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','rrmemory','beepall','stack','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','clone','queue_id','push','capitalize','InteractionId','%sQueuesWaitingInteractions','format','%s_queue_waiting_interaction:%s','pick','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x42b9,0x12d));var _0x942b=function(_0x2ff1da,_0x29ea0e){_0x2ff1da=_0x2ff1da-0x0;var _0x22bd85=_0x42b9[_0x2ff1da];return _0x22bd85;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x942b('0x0'));var seqqueue=require(_0x942b('0x1'));var moment=require(_0x942b('0x2'));var Redis=require(_0x942b('0x3'));var config=require(_0x942b('0x4'));var logger=require(_0x942b('0x5'))(_0x942b('0x6'));var strategy=require(_0x942b('0x7'));config[_0x942b('0x8')]=_[_0x942b('0x9')](config[_0x942b('0x8')],{'host':_0x942b('0xa'),'port':0x18eb});var io=require(_0x942b('0xb'))(new Redis(config['redis']));var attributes=['id','queue_id',_0x942b('0xc'),_0x942b('0xd'),_0x942b('0xe'),_0x942b('0xf')];function emit(_0x3ae6b5,_0x585a91,_0x158551){io['to'](_0x3ae6b5)['emit'](_0x585a91,_0x158551);}function emitChannelQueueInteraction(_0x263f82,_0x565b1a,_0x241a62,_0x162a48,_0x2330d7,_0x3c2dcc,_0x3978a6,_0x16f73e){var _0x58c861=_[_0x942b('0x10')](_0x241a62);_0x58c861[_0x942b('0x11')]=_0x16f73e;_0x58c861[_0x942b('0xd')]=_0x565b1a;_0x58c861[_0x942b('0xc')]=_0x162a48;_0x58c861['id']=_0x2330d7;if(_0x3c2dcc){attributes[_0x942b('0x12')](_[_0x942b('0x13')](_0x263f82)+_0x942b('0x14'));_0x3978a6[util['format'](_0x942b('0x15'),_0x263f82)][_0x2330d7]=_['pick'](_0x58c861,attributes);}else{delete _0x3978a6[util['format'](_0x942b('0x15'),_0x263f82)][_0x2330d7];}emit(util[_0x942b('0x16')]('%s:queue:%s',_0x263f82,_0x565b1a),util['format'](_0x942b('0x17'),_0x263f82,_0x3c2dcc?'save':'remove'),_[_0x942b('0x18')](_0x58c861,attributes));}var rpc={'openchannelQueueReport':require(_0x942b('0x19')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x942b('0x1a')),'faxQueueReport':require(_0x942b('0x1b')),'whatsappQueueReport':require(_0x942b('0x1c')),'chatInteraction':require(_0x942b('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require(_0x942b('0x1e')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x942b('0x1f')),'whatsappInteraction':require(_0x942b('0x20'))};var queue=schema({'name':{'type':_0x942b('0x21'),'required':!![],'message':_0x942b('0x22')},'timeout':{'type':_0x942b('0x23'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2f6f68,_0x2bf4ca,_0x1665d7,_0x4c0438){if(_0x2f6f68&&_0x2bf4ca&&_0x1665d7){_0x2bf4ca[_0x942b('0x24')]+=0x1;var _0x47d8cc={'uniqueid':_0x2f6f68,'from':_0x1665d7['body']?_0x1665d7['body'][_0x942b('0xe')]:'','joinAt':moment()['format'](_0x942b('0x25')),'ContactId':_0x1665d7[_0x942b('0x26')]?_0x1665d7[_0x942b('0x26')]['id']:null,'ListId':_0x1665d7['list']?_0x1665d7[_0x942b('0x27')]['id']:null};_0x47d8cc[_['upperFirst'](_0x1665d7[_0x942b('0x28')])+_0x942b('0x29')]=_0x2bf4ca['id']||null;_0x47d8cc[_[_0x942b('0x2a')](_0x1665d7[_0x942b('0x28')])+_0x942b('0x14')]=_0x1665d7[_0x942b('0x2b')]?_0x1665d7[_0x942b('0x2b')]['id']:null;_0x47d8cc[_[_0x942b('0x2a')](_0x1665d7[_0x942b('0x28')])+'MessageId']=_0x1665d7[_0x942b('0x2c')]?_0x1665d7['message']['id']:null;_0x47d8cc[_[_0x942b('0x2a')](_0x1665d7[_0x942b('0x28')])+(_0x1665d7['channel']!=='chat'?_0x942b('0x2d'):_0x942b('0x2e'))]=_0x1665d7[_0x942b('0xc')]?_0x1665d7[_0x942b('0xc')]['id']:null;logger[_0x942b('0x2f')](util[_0x942b('0x16')](_0x942b('0x30'),_0x2f6f68,_0x2bf4ca[_0x942b('0x31')]));emitChannelQueueInteraction(_0x1665d7[_0x942b('0x28')],_0x2bf4ca['name'],_0x47d8cc,_0x1665d7['account']['name'],_0x1665d7[_0x942b('0x2c')]['id'],!![],_0x4c0438,_0x2bf4ca['id']);if(rpc[_0x1665d7[_0x942b('0x28')]+'QueueReport']){return rpc[_0x1665d7[_0x942b('0x28')]+_0x942b('0x32')][_0x942b('0x33')](_0x47d8cc)[_0x942b('0x34')](function(_0x4e03ed){logger[_0x942b('0x35')](_0x942b('0x36'),_0x4e03ed);});}}}function stopRouting(_0x311cf7,_0x242b7e,_0x1f641e,_0x351dd6){if(_0x311cf7&&_0x242b7e){_0x242b7e[_0x942b('0x24')]-=0x1;var _0x152568={'leaveAt':moment()['format'](_0x942b('0x25')),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x942b('0x37')};logger['info'](util[_0x942b('0x16')](_0x942b('0x38'),_0x311cf7,_0x242b7e[_0x942b('0x31')]));emitChannelQueueInteraction(_0x1f641e[_0x942b('0x28')],_0x242b7e['name'],_0x1f641e[_0x942b('0x39')],_0x1f641e[_0x942b('0xc')]['name'],_0x1f641e[_0x942b('0x2c')]['id'],![],_0x351dd6,_0x242b7e['id']);return rpc[_0x1f641e['channel']+_0x942b('0x3a')]['update'](_0x1f641e[_0x942b('0x2b')]['id'],{'queueId':_0x242b7e['id']})[_0x942b('0x3b')](function(){if(rpc[_0x1f641e[_0x942b('0x28')]+_0x942b('0x32')]){return rpc[_0x1f641e[_0x942b('0x28')]+'QueueReport'][_0x942b('0x3c')](_0x311cf7,_0x152568)[_0x942b('0x34')](function(_0x9c985d){logger['error']('update\x20queue\x20report',_0x9c985d);});}});}}function endRouting(_0x4add14,_0x13f67a,_0x1309d1,_0x31043a){if(_0x4add14&&_0x13f67a){_0x13f67a[_0x942b('0x24')]-=0x1;var _0x550de3={'leaveAt':moment()[_0x942b('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x942b('0x16')](_0x942b('0x25')),'reason':_0x942b('0x3d')};logger[_0x942b('0x2f')](util[_0x942b('0x16')](_0x942b('0x3e'),_0x4add14,_0x13f67a[_0x942b('0x31')]));emitChannelQueueInteraction(_0x1309d1[_0x942b('0x28')],_0x13f67a[_0x942b('0x31')],_0x1309d1[_0x942b('0x39')],_0x1309d1[_0x942b('0xc')]['name'],_0x1309d1[_0x942b('0x2c')]['id'],![],_0x31043a);if(rpc[_0x1309d1['channel']+_0x942b('0x32')]){return rpc[_0x1309d1[_0x942b('0x28')]+_0x942b('0x32')][_0x942b('0x3c')](_0x4add14,_0x550de3)[_0x942b('0x34')](function(_0x1a7d61){logger[_0x942b('0x35')](_0x942b('0x3f'),_0x1a7d61);});}}}function handleFindQueue(_0x25b947){return function(_0x41ddae){return _0x41ddae[_0x942b('0x31')]['toLowerCase']()===_0x25b947[_0x942b('0x40')]();};}exports[_0x942b('0x41')]=function(_0x35397d,_0x547460,_0x56807d,_0x5253d2){return function(_0xde0813){try{var _0x51369f={'name':_0x547460[0x0],'timeout':_0x547460[0x1]};var _0x3845b3=queue[_0x942b('0x42')](_0x51369f,{'typecast':!![]});if(_0x3845b3[_0x942b('0x43')]){logger['error'](_0x942b('0x44'),_0x35397d,_[_0x942b('0x45')](_0x3845b3,_0x942b('0x2c'))[_0x942b('0x46')](',\x20'));_0xde0813[_0x942b('0x47')]();}else{var _0x3640b4=_[_0x942b('0x48')](_0x56807d[_0x5253d2[_0x942b('0x28')]+_0x942b('0x49')],handleFindQueue(_0x51369f[_0x942b('0x31')]));if(_0x3640b4){startRouting(_0x35397d,_0x3640b4,_0x5253d2,_0x56807d);var _0x2707f5=(_0x3640b4[_0x942b('0x3d')]||0xa)*0x3e8;var _0x4cb63a=(_0x51369f['timeout']||0x14)*0x3e8;var _0x516377;if(_0x2707f5>_0x4cb63a){_0x4cb63a=_0x2707f5;}var _0x2b7f77=seqqueue[_0x942b('0x4a')](_0x2707f5);_0x2b7f77['id']=_0x35397d;_0x2b7f77[_0x942b('0x4b')]=_0x2707f5;_0x2b7f77[_0x942b('0x4c')]=_0x4cb63a;_0x2b7f77[_0x942b('0x28')]=_0x5253d2[_0x942b('0x28')];_0x56807d[_0x942b('0x4d')][_0x35397d]['on']('end',function(){logger['info'](_0x942b('0x4e'),_0x35397d);stopRouting(_0x35397d,_0x3640b4,_0x5253d2,_0x56807d);clearTimeout(_0x516377);_0x516377=undefined;_0x2b7f77[_0x942b('0x4f')](!![]);if(_0x56807d[_0x942b('0x4d')][_0x35397d]){delete _0x56807d['rules'][_0x35397d];}_0xde0813[_0x942b('0x47')]();});_0x56807d[_0x942b('0x4d')][_0x35397d]['on']('complete',function(){if(_0x56807d['rules'][_0x35397d]){delete _0x56807d[_0x942b('0x4d')][_0x35397d];}});_0x516377=setTimeout(function(){logger[_0x942b('0x2f')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x35397d);endRouting(_0x35397d,_0x3640b4,_0x5253d2,_0x56807d);clearTimeout(_0x516377);_0x2b7f77[_0x942b('0x4f')](!![]);_0xde0813[_0x942b('0x50')]();},_0x4cb63a);switch(_0x3640b4['strategy']){case _0x942b('0x51'):strategy[_0x942b('0x51')](_0x2b7f77,_0x3640b4,_0x56807d,_0x5253d2);break;default:strategy[_0x942b('0x52')](_0x2b7f77,_0x3640b4,_0x56807d,_0x5253d2);}}else{logger[_0x942b('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x35397d,_0x51369f[_0x942b('0x31')]);_0xde0813[_0x942b('0x47')]();}}}catch(_0x149d83){logger[_0x942b('0x35')](_0x942b('0x44'),_0x35397d,_0x149d83[_0x942b('0x53')]);_0xde0813['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 944aba5..faf2154 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 _0x9f62=['../../../../../config/logger','routing','notificationId','squeue','agent','push','handleRun','bind','handleTimeout','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','saveWaitingNotification','showNotification','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','removeWaitingNotification','STOP','TIMEOUT','exports','uuid'];(function(_0x12480e,_0x325b57){var _0x3fd27e=function(_0x389942){while(--_0x389942){_0x12480e['push'](_0x12480e['shift']());}};_0x3fd27e(++_0x325b57);}(_0x9f62,0x154));var _0x29f6=function(_0x43f120,_0x4d3bac){_0x43f120=_0x43f120-0x0;var _0x1b924c=_0x9f62[_0x43f120];return _0x1b924c;};'use strict';var _=require('lodash');var uuid=require(_0x29f6('0x0'));var util=require('./util');var logger=require(_0x29f6('0x1'))(_0x29f6('0x2'));var Agent=function(_0x548050,_0x5618b7,_0x54d164,_0x258ddd){this[_0x29f6('0x3')]=uuid['v4']();this[_0x29f6('0x4')]=_0x548050;this[_0x29f6('0x5')]=_0x5618b7;this['realtime']=_0x54d164;this[_0x29f6('0x2')]=_0x258ddd;this[_0x29f6('0x4')][_0x29f6('0x6')](this[_0x29f6('0x7')][_0x29f6('0x8')](this),this['handleTimeout']['bind'](this));this['squeue']['on']('timeout',this[_0x29f6('0x9')][_0x29f6('0x8')](this));this['squeue']['on']('drained',this[_0x29f6('0xa')][_0x29f6('0x8')](this));};Agent['prototype'][_0x29f6('0x6')]=function(){this[_0x29f6('0x4')]['push'](this['handleRun']['bind'](this),this['handleTimeout'][_0x29f6('0x8')](this));};Agent[_0x29f6('0xb')][_0x29f6('0xa')]=function(){this[_0x29f6('0x9')](!![]);};Agent[_0x29f6('0xb')][_0x29f6('0x7')]=function(){logger[_0x29f6('0xc')](_0x29f6('0xd'),this[_0x29f6('0x4')]['id'],this[_0x29f6('0x5')]['id']);if(_[_0x29f6('0xe')](this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']])){logger[_0x29f6('0xc')](_0x29f6('0x11'),this[_0x29f6('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x29f6('0x8')](this),0x3e8);}else{if(this[_0x29f6('0x2')][_0x29f6('0x12')]||util['isAgentAvailable'](this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')]['agents'][this[_0x29f6('0x5')]['id']],this[_0x29f6('0x4')][_0x29f6('0x13')],![])){this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']]['busy']=!![];this[_0x29f6('0xf')]['agents'][this['agent']['id']][_0x29f6('0x14')]=undefined;util[_0x29f6('0x15')](this[_0x29f6('0xf')],this[_0x29f6('0x2')],this['agent'],this[_0x29f6('0x4')]['channel']);util[_0x29f6('0x16')](this[_0x29f6('0x3')],this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')]['agents'][this[_0x29f6('0x5')]['id']],null,this[_0x29f6('0x2')]);util['writeLog'](this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']],_0x29f6('0x17')+(this[_0x29f6('0x2')][_0x29f6('0x12')]?':FORCED':''));}else{logger[_0x29f6('0xc')](_0x29f6('0x18'),this[_0x29f6('0x4')]['id'],this[_0x29f6('0x5')]['id']);setTimeout(this[_0x29f6('0x6')][_0x29f6('0x8')](this),0x3e8);}}};Agent[_0x29f6('0xb')][_0x29f6('0x9')]=function(_0x3d88db){if(_[_0x29f6('0xe')](this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']])){return logger[_0x29f6('0xc')](_0x29f6('0x11'),this[_0x29f6('0x4')]['id'],this[_0x29f6('0x5')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x29f6('0x4')]['id'],this['agent']['id']);util[_0x29f6('0x19')](this[_0x29f6('0x3')],this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')]['agents'][this['agent']['id']],null,this[_0x29f6('0x2')]);this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']][_0x29f6('0x1a')]=![];this[_0x29f6('0xf')][_0x29f6('0x10')][this[_0x29f6('0x5')]['id']][_0x29f6('0x14')]=undefined;util[_0x29f6('0x1b')](this[_0x29f6('0xf')],this[_0x29f6('0x2')],this[_0x29f6('0x5')],this[_0x29f6('0x4')]['channel']);util['writeLog'](this[_0x29f6('0x4')]['id'],this[_0x29f6('0xf')][_0x29f6('0x10')][this['agent']['id']],_0x3d88db?_0x29f6('0x1c'):_0x29f6('0x1d'));}if(!_0x3d88db){setTimeout(this[_0x29f6('0x6')][_0x29f6('0x8')](this),0x3e8);}};function agent(_0x1d2b3c,_0x48fbd1,_0x7695ee,_0x2ad06f){return new Agent(_0x1d2b3c,_0x48fbd1,_0x7695ee,_0x2ad06f);}module[_0x29f6('0x1e')]=agent; \ No newline at end of file +var _0x84ab=['realtime','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','bind','handleTimeout','prototype','handleRun','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x84ab,0x12f));var _0xb84a=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x84ab[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xb84a('0x0'));var uuid=require(_0xb84a('0x1'));var util=require(_0xb84a('0x2'));var logger=require(_0xb84a('0x3'))(_0xb84a('0x4'));var Agent=function(_0x512f13,_0xc83587,_0x18a4a5,_0x47b8e3){this[_0xb84a('0x5')]=uuid['v4']();this[_0xb84a('0x6')]=_0x512f13;this[_0xb84a('0x7')]=_0xc83587;this['realtime']=_0x18a4a5;this['routing']=_0x47b8e3;this['squeue'][_0xb84a('0x8')](this['handleRun'][_0xb84a('0x9')](this),this[_0xb84a('0xa')]['bind'](this));this[_0xb84a('0x6')]['on']('timeout',this[_0xb84a('0xa')][_0xb84a('0x9')](this));this[_0xb84a('0x6')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0xb84a('0xb')][_0xb84a('0x8')]=function(){this[_0xb84a('0x6')][_0xb84a('0x8')](this[_0xb84a('0xc')]['bind'](this),this[_0xb84a('0xa')][_0xb84a('0x9')](this));};Agent[_0xb84a('0xb')][_0xb84a('0xd')]=function(){this[_0xb84a('0xa')](!![]);};Agent[_0xb84a('0xb')][_0xb84a('0xc')]=function(){logger[_0xb84a('0xe')](_0xb84a('0xf'),this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);if(_[_0xb84a('0x10')](this['realtime'][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']])){logger[_0xb84a('0xe')](_0xb84a('0x12'),this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);setTimeout(this[_0xb84a('0x8')][_0xb84a('0x9')](this),0x3e8);}else{if(this[_0xb84a('0x4')][_0xb84a('0x13')]||util[_0xb84a('0x14')](this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this['agent']['id']],this[_0xb84a('0x6')][_0xb84a('0x16')],![])){this['realtime'][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']][_0xb84a('0x17')]=!![];this[_0xb84a('0x15')]['agents'][this['agent']['id']][_0xb84a('0x18')]=undefined;util[_0xb84a('0x19')](this[_0xb84a('0x15')],this[_0xb84a('0x4')],this[_0xb84a('0x7')],this[_0xb84a('0x6')][_0xb84a('0x16')]);util[_0xb84a('0x1a')](this[_0xb84a('0x5')],this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']],null,this[_0xb84a('0x4')]);util[_0xb84a('0x1b')](this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']],_0xb84a('0x1c')+(this[_0xb84a('0x4')][_0xb84a('0x13')]?_0xb84a('0x1d'):''));}else{logger[_0xb84a('0xe')](_0xb84a('0x1e'),this[_0xb84a('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0xb84a('0x9')](this),0x3e8);}}};Agent[_0xb84a('0xb')]['handleTimeout']=function(_0x1f690a){if(_[_0xb84a('0x10')](this['realtime']['agents'][this[_0xb84a('0x7')]['id']])){return logger[_0xb84a('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);}else{logger[_0xb84a('0xe')](_0xb84a('0x1f'),this[_0xb84a('0x6')]['id'],this[_0xb84a('0x7')]['id']);util[_0xb84a('0x20')](this[_0xb84a('0x5')],this['squeue']['id'],this[_0xb84a('0x15')]['agents'][this['agent']['id']],null,this[_0xb84a('0x4')]);this[_0xb84a('0x15')]['agents'][this['agent']['id']][_0xb84a('0x17')]=![];this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']][_0xb84a('0x18')]=undefined;util[_0xb84a('0x21')](this[_0xb84a('0x15')],this[_0xb84a('0x4')],this['agent'],this[_0xb84a('0x6')][_0xb84a('0x16')]);util[_0xb84a('0x1b')](this[_0xb84a('0x6')]['id'],this[_0xb84a('0x15')][_0xb84a('0x11')][this[_0xb84a('0x7')]['id']],_0x1f690a?'STOP':_0xb84a('0x22'));}if(!_0x1f690a){setTimeout(this['push'][_0xb84a('0x9')](this),0x3e8);}};function agent(_0xb93cca,_0x2f7e6c,_0x4d04fb,_0x4af084){return new Agent(_0xb93cca,_0x2f7e6c,_0x4d04fb,_0x4af084);}module[_0xb84a('0x23')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 33088d1..3abb3f6 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 _0xf47c=['name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','removeWaitingNotification','lodash','./util','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','prototype','isNil','Agents','length','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','busy'];(function(_0x506e0b,_0x46074c){var _0x31941a=function(_0x2947bf){while(--_0x2947bf){_0x506e0b['push'](_0x506e0b['shift']());}};_0x31941a(++_0x46074c);}(_0xf47c,0x1e8));var _0xcf47=function(_0x17e31a,_0x47d6ea){_0x17e31a=_0x17e31a-0x0;var _0x87d10a=_0xf47c[_0x17e31a];return _0x87d10a;};'use strict';var _=require(_0xcf47('0x0'));var uuid=require('uuid');var util=require(_0xcf47('0x1'));var logger=require('../../../../../config/logger')(_0xcf47('0x2'));var Beepall=function(_0x196f6a,_0x1279c3,_0x5d1e0f,_0x1348ca){this[_0xcf47('0x3')]=uuid['v4']();this[_0xcf47('0x4')]=_0x196f6a;this[_0xcf47('0x5')]=_0x1279c3;this[_0xcf47('0x6')]=_0x5d1e0f;this[_0xcf47('0x2')]=_0x1348ca;this['squeue'][_0xcf47('0x7')](this[_0xcf47('0x8')][_0xcf47('0x9')](this),this[_0xcf47('0xa')][_0xcf47('0x9')](this));this[_0xcf47('0x4')]['on'](_0xcf47('0xb'),this['handleTimeout'][_0xcf47('0x9')](this));this[_0xcf47('0x4')]['on'](_0xcf47('0xc'),this['handleDrained'][_0xcf47('0x9')](this));};Beepall[_0xcf47('0xd')][_0xcf47('0x7')]=function(){this[_0xcf47('0x4')][_0xcf47('0x7')](this[_0xcf47('0x8')][_0xcf47('0x9')](this),this['handleTimeout'][_0xcf47('0x9')](this));};Beepall[_0xcf47('0xd')]['handleDrained']=function(){this[_0xcf47('0xa')](!![]);};Beepall[_0xcf47('0xd')][_0xcf47('0x8')]=function(){var _0x1f8582=!![];if(!_['isNil'](this['queue'])&&!_[_0xcf47('0xe')](this[_0xcf47('0x5')][_0xcf47('0xf')])&&this[_0xcf47('0x5')]['Agents'][_0xcf47('0x10')]>0x0){for(var _0x1365a8=0x0,_0x524082;_0x1365a80x0){for(var _0x57aac3=0x0,_0x206872;_0x57aac30x0&&_0x2d18d6[_0x1d99b7+'CurrentCapacity']>=_0x2d18d6[_0x1d99b7+_0x12cc('0x25')]){writeLog(_0xd92481,_0x2d18d6,_0x1d99b7[_0x12cc('0x26')]()+_0x12cc('0x27'));return![];}}return!![];};exports[_0x12cc('0x28')]=function(_0x448b5a,_0x281da6,_0x30439d,_0x17a66b,_0x12c139){return sendNotification(!![],_0x448b5a,_0x281da6,_0x30439d,_0x17a66b,_0x12c139);};exports[_0x12cc('0x29')]=function(_0x283977,_0x102654,_0x420222,_0x435a28,_0x214f24){return sendNotification(![],_0x283977,_0x102654,_0x420222,_0x435a28,_0x214f24);};exports[_0x12cc('0x2a')]=function(_0x5cb159,_0x38413b,_0xfbb4f2){var _0x781b72=_0x38413b[_0x12cc('0x2b')][_0x12cc('0x2c')];if(!_0x781b72&&_0xfbb4f2){_0x781b72=_0xfbb4f2['id'];}var _0x3acd5c=_[_0x12cc('0x2d')](_0x5cb159[_0x38413b['channel']+_0x12cc('0x2e')],function(_0x290586){var _0x3070bf=_[_0x12cc('0x2f')](_0x38413b[_0x12cc('0x30')])+'InteractionId';return _0x290586[_0x3070bf]===_0x38413b[_0x12cc('0x2b')]['id'];});if(!_0x3acd5c&&_0x781b72&&_0x5cb159[_0x12cc('0x31')][_0x781b72]){_0x3acd5c=_[_0x12cc('0x2d')](_0x5cb159[_0x12cc('0x31')][_0x781b72][_0x38413b[_0x12cc('0x30')]+_0x12cc('0x32')],function(_0x14b661){return _0x14b661['id']===_0x38413b[_0x12cc('0x2b')]['id'];});}return _0x3acd5c;};exports[_0x12cc('0x33')]=function(_0x3bcaa0,_0x13ea36,_0x3af6a7,_0x44fa34){if(_0x3af6a7&&_0x3af6a7['id']&&_0x3bcaa0[_0x12cc('0x31')]&&_0x3bcaa0[_0x12cc('0x31')][_0x3af6a7['id']]){_0x3bcaa0['agents'][_0x3af6a7['id']][_0x44fa34+_0x12cc('0x32')][_0x13ea36[_0x12cc('0x19')]['id']]={'id':_0x13ea36[_0x12cc('0x2b')]['id']};}};exports[_0x12cc('0x34')]=function(_0x2c8a95,_0x751ce7,_0x5d9eeb,_0x2f148a){if(_0x5d9eeb&&_0x5d9eeb['id']&&_0x2c8a95[_0x12cc('0x31')]&&_0x2c8a95[_0x12cc('0x31')][_0x5d9eeb['id']]){delete _0x2c8a95['agents'][_0x5d9eeb['id']][_0x2f148a+_0x12cc('0x32')][_0x751ce7[_0x12cc('0x19')]['id']];}};exports[_0x12cc('0x35')]=writeLog; \ No newline at end of file +var _0x85d8=['PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','channel','QueuesWaitingInteractions','capitalize','interaction','agents','some','WaitingInteractions','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','routing','redis','defaults','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause'];(function(_0x276eb7,_0x528ee2){var _0x3e04cc=function(_0x4d9979){while(--_0x4d9979){_0x276eb7['push'](_0x276eb7['shift']());}};_0x3e04cc(++_0x528ee2);}(_0x85d8,0x1b0));var _0x885d=function(_0xf569a,_0x542911){_0xf569a=_0xf569a-0x0;var _0x175f73=_0x85d8[_0xf569a];return _0x175f73;};'use strict';var _=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var utils=require(_0x885d('0x2'));var Redis=require(_0x885d('0x3'));var config=require(_0x885d('0x4'));var logger=require('../../../../../config/logger')(_0x885d('0x5'));config[_0x885d('0x6')]=_[_0x885d('0x7')](config[_0x885d('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x885d('0x6')]));function sendNotification(_0x30dcc2,_0x3715b4,_0x1df2e5,_0x18428b,_0x11e6d7,_0x1a9f6e){io['to'](util[_0x885d('0x8')](_0x885d('0x9'),_0x18428b[_0x885d('0xa')]))[_0x885d('0xb')](_0x885d('0xc'),_0x18428b);var _0x3ce28f=_0x1a9f6e||{};var _0x1e5761=_0x1df2e5[_0x885d('0xd')]('.');var _0x46bd88={'uniqueid':_0x3715b4,'channel':_0x1e5761[0x0],'id':_0x1e5761[0x1],'title':_0x1e5761[0x0]+_0x885d('0xe'),'interactionId':_0x1e5761[0x2],'queue':_0x11e6d7?_0x11e6d7[_0x885d('0xa')]:null,'sound':_0x3ce28f[_0x885d('0xf')]['notificationSound'],'shake':_0x3ce28f['account'][_0x885d('0x10')]};try{if(!_0x3ce28f[_0x885d('0x11')]){_0x3ce28f['body']={};}if(_0x11e6d7){_0x3ce28f[_0x885d('0x11')][_0x885d('0x12')]=_0x11e6d7;}else if(_0x3ce28f['body']['queue']){delete _0x3ce28f[_0x885d('0x11')][_0x885d('0x12')];}_0x46bd88[_0x885d('0x13')]=utils[_0x885d('0x14')](_0x3ce28f[_0x885d('0xf')][_0x885d('0x15')],_0x3ce28f);}catch(_0x5d8bcd){_0x46bd88['msg']=_0x885d('0x16');logger[_0x885d('0x17')](util[_0x885d('0x8')](_0x885d('0x18'),_0x3715b4,_0x5d8bcd[_0x885d('0x19')]));}io['to'](util[_0x885d('0x8')](_0x885d('0x9'),_0x18428b[_0x885d('0xa')]))['emit'](util[_0x885d('0x8')](_0x885d('0x1a'),_0x30dcc2?_0x885d('0x1b'):_0x885d('0x1c')),_0x46bd88);}function writeLog(_0x31e173,_0x5a72b8,_0x1326a9){return logger[_0x885d('0x1d')](util['format'](_0x885d('0x1e'),_0x31e173,_0x5a72b8['name'],_0x1326a9));}exports[_0x885d('0x1f')]=function(_0x2a1c31,_0x22550d,_0x90589,_0x261c0f){if(_0x22550d[_0x885d('0x20')]){writeLog(_0x2a1c31,_0x22550d,_0x885d('0x21'));return![];}if(!_0x22550d[_0x885d('0x22')]){writeLog(_0x2a1c31,_0x22550d,'OFFLINE');return![];}if(_0x22550d[_0x90589+_0x885d('0x23')]){writeLog(_0x2a1c31,_0x22550d,_0x885d('0x24'));return![];}if(_0x261c0f&&_0x22550d[_0x885d('0x25')](_0x90589+'Capacity')&&_0x22550d[_0x885d('0x25')](_0x90589+_0x885d('0x26'))){if(_0x22550d[_0x90589+_0x885d('0x27')]>0x0&&_0x22550d[_0x90589+_0x885d('0x26')]>=_0x22550d[_0x90589+_0x885d('0x27')]){writeLog(_0x2a1c31,_0x22550d,_0x90589[_0x885d('0x28')]()+_0x885d('0x29'));return![];}}return!![];};exports[_0x885d('0x2a')]=function(_0x402440,_0x54e121,_0x5eb6a0,_0x13948c,_0x4cd7fb){return sendNotification(!![],_0x402440,_0x54e121,_0x5eb6a0,_0x13948c,_0x4cd7fb);};exports[_0x885d('0x2b')]=function(_0x17fde0,_0x34c415,_0x1f7120,_0x16f4c1,_0x4589ee){return sendNotification(![],_0x17fde0,_0x34c415,_0x1f7120,_0x16f4c1,_0x4589ee);};exports['checkWaitingNotifications']=function(_0x172d26,_0x3b139b,_0x502e8d){var _0x370e6c=_0x3b139b['interaction']['UserId'];if(!_0x370e6c&&_0x502e8d){_0x370e6c=_0x502e8d['id'];}var _0x3db722=_['some'](_0x172d26[_0x3b139b[_0x885d('0x2c')]+_0x885d('0x2d')],function(_0x20a5f8){var _0x379000=_[_0x885d('0x2e')](_0x3b139b[_0x885d('0x2c')])+'InteractionId';return _0x20a5f8[_0x379000]===_0x3b139b[_0x885d('0x2f')]['id'];});if(!_0x3db722&&_0x370e6c&&_0x172d26[_0x885d('0x30')][_0x370e6c]){_0x3db722=_[_0x885d('0x31')](_0x172d26[_0x885d('0x30')][_0x370e6c][_0x3b139b[_0x885d('0x2c')]+'WaitingInteractions'],function(_0x446fba){return _0x446fba['id']===_0x3b139b[_0x885d('0x2f')]['id'];});}return _0x3db722;};exports['saveWaitingNotification']=function(_0x168a2a,_0x51b769,_0x14a349,_0x23aa7c){if(_0x14a349&&_0x14a349['id']&&_0x168a2a[_0x885d('0x30')]&&_0x168a2a[_0x885d('0x30')][_0x14a349['id']]){_0x168a2a[_0x885d('0x30')][_0x14a349['id']][_0x23aa7c+_0x885d('0x32')][_0x51b769['message']['id']]={'id':_0x51b769['interaction']['id']};}};exports['removeWaitingNotification']=function(_0x488a93,_0x3d6ce7,_0x15a2dc,_0x4ca2de){if(_0x15a2dc&&_0x15a2dc['id']&&_0x488a93[_0x885d('0x30')]&&_0x488a93['agents'][_0x15a2dc['id']]){delete _0x488a93[_0x885d('0x30')][_0x15a2dc['id']][_0x4ca2de+_0x885d('0x32')][_0x3d6ce7[_0x885d('0x19')]['id']];}};exports[_0x885d('0x33')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index c4f5dff..a9bd2cb 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 _0x2b95=['replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x2b95,0x159));var _0x52b9=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0x2b95[_0x2a9f4];return _0x3c39e0;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x52b9('0x0'));var utils=require(_0x52b9('0x1'));var logger=require(_0x52b9('0x2'))(_0x52b9('0x3'));var system=schema({'command':{'type':_0x52b9('0x4'),'required':!![],'message':_0x52b9('0x5')}});exports[_0x52b9('0x6')]=function(_0x3d7e4b,_0x16b0b4){return function(_0x3df583){try{var _0x1b62d6={'command':_0x16b0b4[0x0]};var _0x49a291=system['validate'](_0x1b62d6,{'typecast':!![]});if(_0x49a291[_0x52b9('0x7')]){logger[_0x52b9('0x8')]('[%s][SYSTEM]\x20%s',_0x3d7e4b,_[_0x52b9('0x9')](_0x49a291,_0x52b9('0xa'))[_0x52b9('0xb')](',\x20'));logger[_0x52b9('0xc')](_0x52b9('0xd'),_0x3d7e4b);_0x3df583[_0x52b9('0xe')]();}else{var _0xbc2516=this;var _0x1e15f5=utils[_0x52b9('0xf')](_0x16b0b4[0x0],this);logger['info'](_0x52b9('0x10'),_0x3d7e4b,_0x1e15f5);sh[_0x52b9('0x11')](_['trim'](_0x1e15f5),function(_0x3c9668,_0x239314){logger['info'](_0x52b9('0x12'),_0x3d7e4b,_0x3c9668);if(_0x3c9668==0x0){var _0x5b6924=_0x239314[_0x52b9('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x16b0b4[0x1])||_[_0x52b9('0x14')](_0x16b0b4[0x1])){logger[_0x52b9('0xc')](_0x52b9('0x15'),_0x3d7e4b);_0xbc2516[_0x52b9('0x16')][_0x16b0b4[0x1]]=_0x5b6924;}else{logger[_0x52b9('0xc')](_0x52b9('0x17'),_0x3d7e4b,_0x16b0b4[0x1],_0x5b6924);_0xbc2516[_0x52b9('0x16')][_0x16b0b4[0x1]]=_0x5b6924;}}_0x3df583[_0x52b9('0xe')]();});}}catch(_0x32fe60){logger[_0x52b9('0x8')](_0x52b9('0x18'),_0x3d7e4b,_[_0x52b9('0x19')](_0x32fe60)?JSON['stringify'](_0x32fe60):_0x32fe60);logger[_0x52b9('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3d7e4b);_0x3df583[_0x52b9('0xe')]();}};}; \ No newline at end of file +var _0xa61d=['isObject','stringify','validate','shelljs','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x16e253,_0xc313a2){var _0x4154=function(_0x29e0a5){while(--_0x29e0a5){_0x16e253['push'](_0x16e253['shift']());}};_0x4154(++_0xc313a2);}(_0xa61d,0x7f));var _0xda61=function(_0x2b869b,_0x81ce74){_0x2b869b=_0x2b869b-0x0;var _0x494958=_0xa61d[_0x2b869b];return _0x494958;};'use strict';var schema=require(_0xda61('0x0'));var sh=require(_0xda61('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xda61('0x2'))('routing');var system=schema({'command':{'type':_0xda61('0x3'),'required':!![],'message':_0xda61('0x4')}});exports[_0xda61('0x5')]=function(_0x58f4f2,_0x1a6a3d){return function(_0x957cce){try{var _0x2b94b9={'command':_0x1a6a3d[0x0]};var _0x30781e=system[_0xda61('0x0')](_0x2b94b9,{'typecast':!![]});if(_0x30781e[_0xda61('0x6')]){logger[_0xda61('0x7')]('[%s][SYSTEM]\x20%s',_0x58f4f2,_[_0xda61('0x8')](_0x30781e,_0xda61('0x9'))[_0xda61('0xa')](',\x20'));logger[_0xda61('0xb')](_0xda61('0xc'),_0x58f4f2);_0x957cce[_0xda61('0xd')]();}else{var _0x3d1aee=this;var _0x266e80=utils[_0xda61('0xe')](_0x1a6a3d[0x0],this);logger['info'](_0xda61('0xf'),_0x58f4f2,_0x266e80);sh[_0xda61('0x10')](_[_0xda61('0x11')](_0x266e80),function(_0x2254b1,_0x4ea4c8){logger[_0xda61('0xb')](_0xda61('0x12'),_0x58f4f2,_0x2254b1);if(_0x2254b1==0x0){var _0x49da05=_0x4ea4c8[_0xda61('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xda61('0x14')](_0x1a6a3d[0x1])||_['isEmpty'](_0x1a6a3d[0x1])){logger[_0xda61('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x58f4f2);_0x3d1aee[_0xda61('0x15')][_0x1a6a3d[0x1]]=_0x49da05;}else{logger[_0xda61('0xb')](_0xda61('0x16'),_0x58f4f2,_0x1a6a3d[0x1],_0x49da05);_0x3d1aee[_0xda61('0x15')][_0x1a6a3d[0x1]]=_0x49da05;}}_0x957cce['next']();});}}catch(_0x3d059e){logger[_0xda61('0x7')]('[%s][SYSTEM]\x20%s',_0x58f4f2,_[_0xda61('0x17')](_0x3d059e)?JSON[_0xda61('0x18')](_0x3d059e):_0x3d059e);logger['info'](_0xda61('0xc'),_0x58f4f2);_0x957cce['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 37f5d3a..27e02ad 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 _0x3b73=['stringify','finally','next','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch'];(function(_0x3aacfb,_0x233658){var _0x42cc0c=function(_0x3f6fb5){while(--_0x3f6fb5){_0x3aacfb['push'](_0x3aacfb['shift']());}};_0x42cc0c(++_0x233658);}(_0x3b73,0x174));var _0x33b7=function(_0x12ce70,_0x45a795){_0x12ce70=_0x12ce70-0x0;var _0xa47da5=_0x3b73[_0x12ce70];return _0xa47da5;};'use strict';var schema=require(_0x33b7('0x0'));var _=require(_0x33b7('0x1'));var rpc={'chatInteraction':require(_0x33b7('0x2')),'openchannelInteraction':require(_0x33b7('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x33b7('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':_0x33b7('0x5')}});exports[_0x33b7('0x6')]=function(_0x48d237,_0xae3288,_0x3559a6,_0x4134c0){return function(_0x556e67){try{var _0x433614={'tag':_0xae3288[0x0]};var _0x2cf8b2=tag[_0x33b7('0x0')](_0x433614,{'typecast':!![]});if(_0x2cf8b2['length']){logger[_0x33b7('0x7')](_0x33b7('0x8'),_0x48d237,_[_0x33b7('0x9')](_0x2cf8b2,_0x33b7('0xa'))['join'](',\x20'));logger[_0x33b7('0xb')](_0x33b7('0xc'),_0x48d237);_0x556e67['next']();}else{var _0x5a10d2={'ids':[_0xae3288[0x0]]};if(rpc[_0x4134c0[_0x33b7('0xd')]+'Interaction']){rpc[_0x4134c0[_0x33b7('0xd')]+_0x33b7('0xe')][_0x33b7('0xf')](_0x4134c0[_0x33b7('0x10')]['id'],_0x5a10d2)['then'](function(_0x1f0d29){logger[_0x33b7('0xb')](_0x33b7('0x11'),_0x48d237,_0xae3288[0x1],_0x4134c0[_0x33b7('0xd')],_0x4134c0[_0x33b7('0x10')]['id']);})[_0x33b7('0x12')](function(_0x112b41){logger['error'](_0x33b7('0x8'),_0x48d237,JSON[_0x33b7('0x13')](_0x112b41));logger[_0x33b7('0xb')](_0x33b7('0xc'),_0x48d237);})[_0x33b7('0x14')](function(){_0x556e67[_0x33b7('0x15')]();});}}}catch(_0x3771c6){logger[_0x33b7('0x7')]('[%s][TAG]\x20%s',_0x48d237,_[_0x33b7('0x16')](_0x3771c6)?JSON[_0x33b7('0x13')](_0x3771c6):_0x3771c6);logger[_0x33b7('0xb')](_0x33b7('0xc'),_0x48d237);_0x556e67[_0x33b7('0x15')]();}};}; \ No newline at end of file +var _0x1db0=['stringify','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','length','error','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s'];(function(_0x5549d7,_0x26b12e){var _0x299932=function(_0x2f9d97){while(--_0x2f9d97){_0x5549d7['push'](_0x5549d7['shift']());}};_0x299932(++_0x26b12e);}(_0x1db0,0x13a));var _0x01db=function(_0x6e51f1,_0x11371a){_0x6e51f1=_0x6e51f1-0x0;var _0x141b4c=_0x1db0[_0x6e51f1];return _0x141b4c;};'use strict';var schema=require(_0x01db('0x0'));var _=require(_0x01db('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x01db('0x2')),'smsInteraction':require(_0x01db('0x3')),'mailInteraction':require(_0x01db('0x4')),'faxInteraction':require(_0x01db('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x829ee4,_0x439441,_0x1c2530,_0x353a13){return function(_0x34ffa6){try{var _0x50f29f={'tag':_0x439441[0x0]};var _0x3dff47=tag[_0x01db('0x0')](_0x50f29f,{'typecast':!![]});if(_0x3dff47[_0x01db('0x6')]){logger[_0x01db('0x7')]('[%s][TAG]\x20%s',_0x829ee4,_[_0x01db('0x8')](_0x3dff47,_0x01db('0x9'))[_0x01db('0xa')](',\x20'));logger['info'](_0x01db('0xb'),_0x829ee4);_0x34ffa6[_0x01db('0xc')]();}else{var _0xaf0786={'ids':[_0x439441[0x0]]};if(rpc[_0x353a13[_0x01db('0xd')]+_0x01db('0xe')]){rpc[_0x353a13['channel']+_0x01db('0xe')][_0x01db('0xf')](_0x353a13[_0x01db('0x10')]['id'],_0xaf0786)[_0x01db('0x11')](function(_0x3e4014){logger[_0x01db('0x12')](_0x01db('0x13'),_0x829ee4,_0x439441[0x1],_0x353a13[_0x01db('0xd')],_0x353a13['interaction']['id']);})[_0x01db('0x14')](function(_0x1e500a){logger[_0x01db('0x7')](_0x01db('0x15'),_0x829ee4,JSON[_0x01db('0x16')](_0x1e500a));logger[_0x01db('0x12')](_0x01db('0xb'),_0x829ee4);})['finally'](function(){_0x34ffa6['next']();});}}}catch(_0x45e96e){logger['error'](_0x01db('0x15'),_0x829ee4,_[_0x01db('0x17')](_0x45e96e)?JSON[_0x01db('0x16')](_0x45e96e):_0x45e96e);logger[_0x01db('0x12')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x829ee4);_0x34ffa6[_0x01db('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 345a6ae..d872e23 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 _0x4d44=['push','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','utf8','POST','application/json-rpc','then','parse','logged','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4d44,0xb2));var _0x44d4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4d44[_0x42cae2];return _0x5f256f;};'use strict';var rp=require(_0x44d4('0x0'));var logger=require(_0x44d4('0x1'))(_0x44d4('0x2'));var _=require(_0x44d4('0x3'));var arr=[];exports[_0x44d4('0x4')]=function(_0x19b283,_0x59555a){return function(_0x4832f9){var _0x381070=_0x59555a[0xa];var _0x293913=_0x59555a[0xb];var _0x797e20=_0x59555a[0xc];var _0x5c15b6=_0x59555a[0xd];var _0x1a183b=_0x59555a[0xe];var _0x3eaec=_0x59555a[0xf][_0x44d4('0x5')](/\n/g,_0x44d4('0x6'));var _0x2cda3b=_0x59555a[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x44d4('0x7')](_0x293913)){arr[_0x44d4('0x8')](_0x293913);var _0x51f622=_0x59555a[0x3];var _0x8ef452=_0x59555a[0x4];var _0x4ef374=_0x59555a[0x1];var _0x44000b=_0x59555a[0x0];var _0x19ee39={};_0x19ee39['urlOnAnswer']=_0x59555a[0x8]+'?params='+_0x797e20+'|'+_0x381070+'|'+_0x5c15b6+'|'+_0x293913+'|'+_0x1a183b;_0x19ee39[_0x44d4('0x9')]=_0x59555a[0x7]+'?params='+_0x797e20+'|'+_0x381070+'|'+_0x5c15b6+'|'+_0x293913+'|'+_0x1a183b+'|'+_0x3eaec+'|'+_0x2cda3b;_0x19ee39[_0x44d4('0xa')]=_0x59555a[0x9];var _0x1ad8f7={};_0x1ad8f7[_0x44d4('0xb')]=_0x44d4('0xc');_0x1ad8f7[_0x44d4('0xd')]=_0x44d4('0xe');var _0x377285=[];_0x377285['push'](_0x59555a[0x2]);_0x377285[_0x44d4('0x8')](_0x59555a[0x5]);_0x377285[_0x44d4('0x8')](_0x59555a[0x6]);_0x1ad8f7[_0x44d4('0xf')]=_0x377285;_0x1ad8f7['id']=0x1;var _0x290d36=JSON[_0x44d4('0x10')](_0x1ad8f7);var _0x1431b4={'encoding':_0x44d4('0x11'),'method':_0x44d4('0x12'),'timeout':0x2710,'url':_0x51f622,'headers':{'Content-Type':_0x44d4('0x13')},'body':_0x290d36};return rp(_0x1431b4)[_0x44d4('0x14')](function(_0x1a22b8){const _0x2c9857=JSON[_0x44d4('0x15')](_0x1a22b8);if(!_0x2c9857['result'][_0x44d4('0x16')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x331d01=_0x293913;var _0x61d182='channelId='+_0x4ef374+'&serviceId='+_0x44000b+'&sessionId='+_0x331d01+_0x44d4('0x17')+JSON['stringify'](_0x19ee39);var _0x1ea8bf=_0x8ef452+'?'+_0x61d182;return rp(_0x1ea8bf);})['then'](function(_0x281a77){logger['info'](_0x44d4('0x18'),_0x19b283,_0x281a77);_0x4832f9[_0x44d4('0x19')]();})[_0x44d4('0x1a')](function(_0x4a704b){logger['error'](_0x44d4('0x1b'),_0x19b283,_['isObject'](_0x4a704b)?JSON[_0x44d4('0x10')](_0x4a704b):_0x4a704b);_0x4832f9[_0x44d4('0x19')]();});}else{logger[_0x44d4('0x1c')](_0x44d4('0x1d'),_0x19b283);_0x4832f9[_0x44d4('0x1e')]();}};}; \ No newline at end of file +var _0x6354=['utf8','POST','then','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','\x20-\x20','replace','?params=','urlOnRing','jsonrpc','2.0','login','push','params','stringify'];(function(_0x3a4437,_0x42420a){var _0x8406cc=function(_0x4f3cd1){while(--_0x4f3cd1){_0x3a4437['push'](_0x3a4437['shift']());}};_0x8406cc(++_0x42420a);}(_0x6354,0xcc));var _0x4635=function(_0x22a614,_0x3af6dc){_0x22a614=_0x22a614-0x0;var _0x232a32=_0x6354[_0x22a614];return _0x232a32;};'use strict';var rp=require('request-promise');var logger=require(_0x4635('0x0'))(_0x4635('0x1'));var _=require('lodash');var arr=[];exports['consequence']=function(_0x35f414,_0x26c7ad){return function(_0x7d7f9c){var _0x54cb94=_0x26c7ad[0xa];var _0x179bfb=_0x26c7ad[0xb];var _0x4b43f6=_0x26c7ad[0xc];var _0x49ec1d=_0x26c7ad[0xd];var _0x594979=_0x26c7ad[0xe];var _0x1a2f85=_0x26c7ad[0xf]['replace'](/\n/g,_0x4635('0x2'));var _0x39d057=_0x26c7ad[0x10][_0x4635('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x179bfb)){arr['push'](_0x179bfb);var _0x1ca31c=_0x26c7ad[0x3];var _0x22dcf5=_0x26c7ad[0x4];var _0x5c0ca3=_0x26c7ad[0x1];var _0x55b3e6=_0x26c7ad[0x0];var _0x409ddb={};_0x409ddb['urlOnAnswer']=_0x26c7ad[0x8]+_0x4635('0x4')+_0x4b43f6+'|'+_0x54cb94+'|'+_0x49ec1d+'|'+_0x179bfb+'|'+_0x594979;_0x409ddb[_0x4635('0x5')]=_0x26c7ad[0x7]+'?params='+_0x4b43f6+'|'+_0x54cb94+'|'+_0x49ec1d+'|'+_0x179bfb+'|'+_0x594979+'|'+_0x1a2f85+'|'+_0x39d057;_0x409ddb['title']=_0x26c7ad[0x9];var _0x5b6621={};_0x5b6621[_0x4635('0x6')]=_0x4635('0x7');_0x5b6621['method']=_0x4635('0x8');var _0x1b9899=[];_0x1b9899['push'](_0x26c7ad[0x2]);_0x1b9899['push'](_0x26c7ad[0x5]);_0x1b9899[_0x4635('0x9')](_0x26c7ad[0x6]);_0x5b6621[_0x4635('0xa')]=_0x1b9899;_0x5b6621['id']=0x1;var _0x1705c4=JSON[_0x4635('0xb')](_0x5b6621);var _0x19740f={'encoding':_0x4635('0xc'),'method':_0x4635('0xd'),'timeout':0x2710,'url':_0x1ca31c,'headers':{'Content-Type':'application/json-rpc'},'body':_0x1705c4};return rp(_0x19740f)[_0x4635('0xe')](function(_0x16da69){const _0x439d42=JSON['parse'](_0x16da69);if(!_0x439d42[_0x4635('0xf')][_0x4635('0x10')]){throw new Error(_0x4635('0x11'));}var _0x900468=_0x179bfb;var _0x590055=_0x4635('0x12')+_0x5c0ca3+'&serviceId='+_0x55b3e6+_0x4635('0x13')+_0x900468+_0x4635('0x14')+JSON[_0x4635('0xb')](_0x409ddb);var _0x80e2c4=_0x22dcf5+'?'+_0x590055;return rp(_0x80e2c4);})[_0x4635('0xe')](function(_0x3ec1ab){logger['info'](_0x4635('0x15'),_0x35f414,_0x3ec1ab);_0x7d7f9c['stop']();})['catch'](function(_0x18b1a8){logger[_0x4635('0x16')]('[%s][TVOX]\x20%s',_0x35f414,_[_0x4635('0x17')](_0x18b1a8)?JSON[_0x4635('0xb')](_0x18b1a8):_0x18b1a8);_0x7d7f9c[_0x4635('0x18')]();});}else{logger['info'](_0x4635('0x19'),_0x35f414);_0x7d7f9c[_0x4635('0x1a')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 2bd0a4c..ba2cb5e 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x45d264,_0x1bc55d){var _0x3ec9c8=function(_0x4aa424){while(--_0x4aa424){_0x45d264['push'](_0x45d264['shift']());}};_0x3ec9c8(++_0x1bc55d);}(_0xe706,0xa3));var _0x6e70=function(_0xf10ab2,_0x4139fa){_0xf10ab2=_0xf10ab2-0x0;var _0x4c6629=_0xe706[_0xf10ab2];return _0x4c6629;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x3b5ac9,_0x56992c){var _0x38d75c=function(_0x572970){while(--_0x572970){_0x3b5ac9['push'](_0x3b5ac9['shift']());}};_0x38d75c(++_0x56992c);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 313aa35..db025f0 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 _0xe54c=['capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','transfer','isArray','applications','length','existsSync','join','app','.js','toLowerCase','appdata','split','mail','push','slice','amazonlex','tag','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','./applications/','priority','info','Push\x20new\x20rule','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty'];(function(_0x3fe440,_0x18d0cb){var _0x30cf95=function(_0x1f7af5){while(--_0x1f7af5){_0x3fe440['push'](_0x3fe440['shift']());}};_0x30cf95(++_0x18d0cb);}(_0xe54c,0x79));var _0xce54=function(_0xabb8a1,_0x5ed479){_0xabb8a1=_0xabb8a1-0x0;var _0x9a4673=_0xe54c[_0xabb8a1];return _0x9a4673;};'use strict';var _=require(_0xce54('0x0'));var util=require(_0xce54('0x1'));var path=require(_0xce54('0x2'));var fs=require('fs');var jayson=require(_0xce54('0x3'));var BPromise=require(_0xce54('0x4'));var utils=require(_0xce54('0x5'));var sUtils=require(_0xce54('0x6'));var logger=require(_0xce54('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0xce54('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xce54('0x9')),'smsQueueReport':require(_0xce54('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xce54('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2b192d,_0x2d9821,_0x5940e9){return util[_0xce54('0xc')](_0xce54('0xd'),_0x2b192d,_0x2d9821||0x0,_0x5940e9||0x0);}function getIntervals(_0x14f326,_0x18fff5){var _0xb0f2df=[];if(!_[_0xce54('0xe')](_0x18fff5[_0xce54('0xf')])&&!_[_0xce54('0xe')](_0x14f326[_0x18fff5[_0xce54('0xf')]])&&!_[_0xce54('0xe')](_0x14f326[_0x18fff5[_0xce54('0xf')]][_0xce54('0x10')])){_0xb0f2df=_[_0xce54('0x11')](_0x14f326[_0x18fff5[_0xce54('0xf')]]['Intervals'],'interval');}else if(!_['isNil'](_0x18fff5[_0xce54('0x12')])){_0xb0f2df=[_0x18fff5['interval']];}return _0xb0f2df;}exports[_0xce54('0x13')]=function(_0x1f7a09){_0x1f7a09['rules']={};return new BPromise(function(_0x586520,_0x355e0f){var _0x14befa={'Start':function(_0x14b863){var _0x19724c=this;return new Promise(function(_0x3c8569,_0x57effb){if(_0x14b863){try{var _0x4fafc0=[];var _0x3eee0d=getId(_0x14b863[_0xce54('0x14')],_0x14b863[_0xce54('0x15')]?_0x14b863['message']['id']:0x0,_0x14b863[_0xce54('0x16')]?_0x14b863['interaction']['id']:0x0);var _0x340e8e=sUtils['checkWaitingNotifications'](_0x1f7a09,_0x14b863);if(_0x14b863[_0xce54('0x17')]||!_0x340e8e&&_0x14b863['applications']&&_[_0xce54('0x18')](_0x14b863[_0xce54('0x19')])&&_0x14b863[_0xce54('0x19')][_0xce54('0x1a')]){for(var _0x287530=0x0;_0x287530<_0x14b863['applications']['length'];_0x287530+=0x1){var _0x375ae4=_0x14b863[_0xce54('0x19')][_0x287530];if(fs[_0xce54('0x1b')](path[_0xce54('0x1c')](__dirname,_0xce54('0x19'),_0x375ae4[_0xce54('0x1d')]+_0xce54('0x1e')))){var _0x486d35=[];switch(_0x375ae4['app'][_0xce54('0x1f')]()){case'autoreply':var _0x3a6649=_0x375ae4[_0xce54('0x20')][_0xce54('0x21')](',');if(_0x14b863[_0xce54('0x14')]===_0xce54('0x22')){_0x486d35[_0xce54('0x23')](_0x3a6649[0x0]);_0x486d35['push'](_0x3a6649[0x1]);_0x486d35[_0xce54('0x23')](_0x3a6649[_0xce54('0x24')](0x2,_0x3a6649['length'])[_0xce54('0x1c')](','));}else{_0x486d35[_0xce54('0x23')](_0x3a6649[0x0]);_0x486d35[_0xce54('0x23')](_0x3a6649[_0xce54('0x24')](0x1,_0x3a6649[_0xce54('0x1a')])[_0xce54('0x1c')](','));}break;case'dialogflow':var _0x3e1a28=_0x375ae4['appdata']['split'](',');_0x486d35[_0xce54('0x23')](_0x3e1a28[0x0]);_0x486d35[_0xce54('0x23')](_0x3e1a28[0x1]);_0x486d35[_0xce54('0x23')](_0x3e1a28['slice'](0x2,_0x3e1a28[_0xce54('0x1a')])[_0xce54('0x1c')](','));break;case'dialogflowv2':var _0x5a9ba7=_0x375ae4[_0xce54('0x20')][_0xce54('0x21')](',');_0x486d35[_0xce54('0x23')](_0x5a9ba7[0x0]);_0x486d35['push'](_0x5a9ba7[0x1]);_0x486d35[_0xce54('0x23')](_0x5a9ba7[0x2]);_0x486d35[_0xce54('0x23')](_0x5a9ba7[0x3]);_0x486d35[_0xce54('0x23')](_0x5a9ba7[_0xce54('0x24')](0x4,_0x5a9ba7[_0xce54('0x1a')])[_0xce54('0x1c')](','));break;case _0xce54('0x25'):var _0x182741=_0x375ae4[_0xce54('0x20')][_0xce54('0x21')](',');_0x486d35[_0xce54('0x23')](_0x182741[0x0]);_0x486d35[_0xce54('0x23')](_0x182741[0x1]);_0x486d35['push'](_0x182741[0x2]);_0x486d35['push'](_0x182741[0x3]);_0x486d35['push'](_0x182741[_0xce54('0x24')](0x4,_0x182741[_0xce54('0x1a')])['join'](','));break;case'message':_0x486d35[_0xce54('0x23')](_0x375ae4[_0xce54('0x20')]);break;case _0xce54('0x26'):_0x486d35[_0xce54('0x23')](_0x375ae4[_0xce54('0x27')]);_0x486d35[_0xce54('0x23')](_0x375ae4[_0xce54('0x20')]);break;case _0xce54('0x28'):var _0x29824b=utils[_0xce54('0x29')](_0x14b863['account']['notificationTemplate'],_0x14b863);var _0x52e664=_0x375ae4['appdata'][_0xce54('0x21')](',');_0x486d35[_0xce54('0x23')](_0x52e664[0x0]);_0x486d35[_0xce54('0x23')](_0x52e664[0x1]);_0x486d35[_0xce54('0x23')](_0x52e664[0x2]);_0x486d35['push'](_0x52e664[0x3]);_0x486d35[_0xce54('0x23')](_0x52e664[0x4]);_0x486d35['push'](_0x52e664[0x5]);_0x486d35[_0xce54('0x23')](_0x52e664[0x6]);_0x486d35[_0xce54('0x23')](_0x52e664[0x7]);_0x486d35[_0xce54('0x23')](_0x52e664[0x8]);_0x486d35['push'](_0x52e664[0x9]);_0x486d35['push'](_0x52e664[0xa]);_0x486d35[_0xce54('0x23')](_0x14b863['interaction']['id']);_0x486d35['push'](_0x14b863[_0xce54('0x15')]['id']);_0x486d35[_0xce54('0x23')](_0x375ae4[_0xce54('0x2a')]);_0x486d35[_0xce54('0x23')](_0x14b863[_0xce54('0x16')][_0xce54('0x2b')]);_0x486d35[_0xce54('0x23')](_0x14b863[_0xce54('0x2c')][_0xce54('0x2c')]);_0x486d35[_0xce54('0x23')](_0x29824b);break;default:_0x486d35=_[_0xce54('0xe')](_0x375ae4[_0xce54('0x20')])?[]:_0x375ae4[_0xce54('0x20')][_0xce54('0x21')](',');}var _0x3f13a5={'id':util[_0xce54('0xc')]('%s:%s:%s',_0x3eee0d,_0x375ae4['id'],_0x375ae4[_0xce54('0x1d')]),'condition':require('./interval')['condition'](_0x3eee0d,getIntervals(_0x1f7a09['intervals'],_0x375ae4),_0x1f7a09),'consequence':require(_0xce54('0x2d')+_0x375ae4['app'])['consequence'](_0x3eee0d,_0x486d35,_0x1f7a09,_0x14b863),'p':_0x375ae4[_0xce54('0x2e')]||0x0};logger[_0xce54('0x2f')](_0xce54('0x30'),_0x3f13a5['id'],'on\x20interval',getIntervals(_0x1f7a09[_0xce54('0x31')],_0x375ae4)[_0xce54('0x1c')]('\x20|\x20'));_0x4fafc0[_0xce54('0x23')](_0x3f13a5);}else{logger[_0xce54('0x32')](_0xce54('0x33'),path[_0xce54('0x1c')](__dirname,'applications',_0x375ae4[_0xce54('0x1d')]+'.js'));}}_0x1f7a09['rules'][_0x3eee0d]=new RuleEngine(_0x4fafc0);_0x1f7a09[_0xce54('0x34')][_0x3eee0d][_0xce54('0x35')](_0x14b863,function(_0x5b0e58){logger['info']('Applications\x20executed',JSON[_0xce54('0x36')](_0x5b0e58[_0xce54('0x37')]));if(_0x1f7a09[_0xce54('0x34')][_0x3eee0d]){_0x1f7a09[_0xce54('0x34')][_0x3eee0d][_0xce54('0x38')](_0xce54('0x39'));}});return _0x3c8569({'code':0xc8,'message':_0x14b863});}else{if(_0x340e8e){logger[_0xce54('0x2f')](util[_0xce54('0xc')](_0xce54('0x3a'),_0x3eee0d));}else{logger[_0xce54('0x2f')](_0xce54('0x3b'));}return _0x3c8569({'code':0xc8,'message':_0x14b863});}}catch(_0x342551){logger['error'](_0x342551[_0xce54('0x3c')]);return _0x57effb(_0x19724c[_0xce54('0x32')](0x1f4,_0x342551));}}return _0x57effb(_0xce54('0x3d'));});},'AcceptMessage':function(_0x478fc3){var _0x3fee4f=this;return new Promise(function(_0x446a17,_0x21151f){if(_0x478fc3[_0xce54('0x3e')]&&_0x478fc3[_0xce54('0x3e')]['id']){if(_0x1f7a09[_0xce54('0x3f')][_0x478fc3[_0xce54('0x3e')]['id']]){_0x1f7a09[_0xce54('0x3f')][_0x478fc3[_0xce54('0x3e')]['id']][_0xce54('0x40')]=![];_0x1f7a09[_0xce54('0x3f')][_0x478fc3[_0xce54('0x3e')]['id']]['busyQueue']=undefined;}}if(_0x478fc3['message']&&_0x478fc3['message']['id']){try{var _0x4cc9cb=getId(_0x478fc3[_0xce54('0x14')],_0x478fc3[_0xce54('0x15')]?_0x478fc3[_0xce54('0x15')]['id']:0x0,_0x478fc3[_0xce54('0x16')]?_0x478fc3[_0xce54('0x16')]['id']:0x0);if(_0x1f7a09[_0xce54('0x34')][_0x4cc9cb]){_0x1f7a09['rules'][_0x4cc9cb][_0xce54('0x38')](_0xce54('0x41'));if(rpc[_0x478fc3[_0xce54('0x14')]+_0xce54('0x42')]){rpc[_0x478fc3[_0xce54('0x14')]+_0xce54('0x42')]['update'](_0x4cc9cb,{'UserId':_0x478fc3['message'][_0xce54('0x43')]})[_0xce54('0x44')](function(){logger['error'](_0xce54('0x45'));});}}return _0x446a17({'code':0xc8,'message':_0x478fc3});}catch(_0x53d950){logger[_0xce54('0x32')](_0x53d950[_0xce54('0x3c')]);return _0x21151f(_0x3fee4f[_0xce54('0x32')](0x1f4,_0x53d950));}}logger['error'](_0xce54('0x46'));return _0x21151f(_0x3fee4f[_0xce54('0x32')](0x1f4,_0xce54('0x46')));});},'RejectMessage':function(_0x13f78b){var _0x208943=this;return new Promise(function(_0xdaa118,_0x43fda2){if(_0x13f78b['agent']&&_0x13f78b[_0xce54('0x3e')]['id']){try{if(_0x1f7a09[_0xce54('0x3f')][_0x13f78b[_0xce54('0x3e')]['id']]){_0x1f7a09[_0xce54('0x3f')][_0x13f78b[_0xce54('0x3e')]['id']][_0xce54('0x40')]=![];_0x1f7a09['agents'][_0x13f78b[_0xce54('0x3e')]['id']][_0xce54('0x47')]=undefined;}return _0xdaa118({'code':0xc8,'message':_0x13f78b});}catch(_0x5ed03d){logger[_0xce54('0x32')](_0x5ed03d[_0xce54('0x3c')]);return _0x43fda2(_0x208943[_0xce54('0x32')](0x1f4,_0x5ed03d));}}logger[_0xce54('0x32')](_0xce54('0x46'));return _0x43fda2(_0x208943[_0xce54('0x32')](0x1f4,_0xce54('0x46')));});},'AbandonInteraction':function(_0x511919){var _0x3d996f=this;return new Promise(function(_0xa58008,_0x2a18d2){if(_0x511919['channel']&&_0x511919['interaction']&&_0x511919[_0xce54('0x16')]['id']){try{var _0x5c5303=getId(_0x511919[_0xce54('0x14')],_0x511919[_0xce54('0x15')]?_0x511919[_0xce54('0x15')]['id']:0x0,_0x511919['interaction']?_0x511919['interaction']['id']:0x0);if(_0x1f7a09[_0xce54('0x34')][_0x5c5303]){_0x1f7a09[_0xce54('0x34')][_0x5c5303][_0xce54('0x38')](_0xce54('0x41'));}return _0xa58008({'code':0xc8,'message':_0x511919});}catch(_0x3bc1df){logger[_0xce54('0x32')](_0x3bc1df[_0xce54('0x3c')]);return _0x2a18d2(_0x3d996f['error'](0x1f4,_0x3bc1df));}}logger[_0xce54('0x32')](_0xce54('0x46'));return _0x2a18d2(_0x3d996f[_0xce54('0x32')](0x1f4,_0xce54('0x46')));});},'AgentCapacity':function(_0x4ecc5f){var _0x5e2c97=this;return new Promise(function(_0x520b48,_0x7cac35){if(_0x1f7a09[_0xce54('0x3f')][_0xce54('0x48')](_0x4ecc5f['id'])){for(var _0x24ecb5 in _0x4ecc5f[_0xce54('0x49')]){if(_0x4ecc5f['capacity']['hasOwnProperty'](_0x24ecb5)){if(_0x1f7a09[_0xce54('0x3f')][_0x4ecc5f['id']]['hasOwnProperty'](_0x24ecb5+_0xce54('0x4a'))){_0x1f7a09[_0xce54('0x3f')][_0x4ecc5f['id']][_0x24ecb5+_0xce54('0x4a')]=parseInt(_0x4ecc5f['capacity'][_0x24ecb5],0xa);}}}_0x1f7a09['agents'][_0x4ecc5f['id']][_0xce54('0x4b')]();return _0x520b48({'code':0xc8,'message':_0x1f7a09[_0xce54('0x3f')][_0x4ecc5f['id']]});}else{return _0x7cac35(_0x5e2c97[_0xce54('0x32')](0x1f4,_0xce54('0x4c')));}});},'Agents':function(_0x51a685){return new Promise(function(_0x55a911){var _0x34361a=_['values'](_0x1f7a09[_0xce54('0x3f')]);if(_0x51a685&&_0x51a685['id']){var _0x41dfec=_[_0xce54('0x4d')](_0x34361a,function(_0x18996c){return _0x18996c['id']===_0x51a685['id'];});_0x55a911(_0x41dfec);}else{_0x55a911({'count':_0x34361a[_0xce54('0x1a')],'rows':_0x34361a});}});},'ChatQueues':function(){return new Promise(function(_0x519345){var _0x376ee8=[];for(var _0x122c70 in _0x1f7a09['chatQueues']){if(_0x1f7a09[_0xce54('0x4e')][_0xce54('0x48')](_0x122c70)){var _0x144765=_0x1f7a09[_0xce54('0x4e')][_0x122c70];var _0x3b940a={'id':_0x144765['id'],'available':_0x144765[_0xce54('0x4f')],'loggedIn':_0x144765[_0xce54('0x50')],'name':_0x144765[_0xce54('0x51')],'paused':_0x144765[_0xce54('0x52')],'waiting':_0x144765[_0xce54('0x53')]};_0x376ee8[_0xce54('0x23')](_0x3b940a);}}_0x519345({'count':_0x376ee8[_0xce54('0x1a')],'rows':_0x376ee8});});},'MailQueues':function(){return new Promise(function(_0x3cc676){var _0x4d74e3=[];for(var _0xf01211 in _0x1f7a09[_0xce54('0x54')]){if(_0x1f7a09[_0xce54('0x54')]['hasOwnProperty'](_0xf01211)){var _0x5bb2a5=_0x1f7a09[_0xce54('0x54')][_0xf01211];var _0x389b09={'id':_0x5bb2a5['id'],'available':_0x5bb2a5['available'],'loggedIn':_0x5bb2a5[_0xce54('0x50')],'name':_0x5bb2a5[_0xce54('0x51')],'paused':_0x5bb2a5[_0xce54('0x52')],'waiting':_0x5bb2a5['waiting']};_0x4d74e3['push'](_0x389b09);}}_0x3cc676({'count':_0x4d74e3['length'],'rows':_0x4d74e3});});},'OpenchannelQueues':function(){return new Promise(function(_0x592e6e){var _0x48fd7e=[];for(var _0x3f49a8 in _0x1f7a09[_0xce54('0x55')]){if(_0x1f7a09[_0xce54('0x55')][_0xce54('0x48')](_0x3f49a8)){var _0x306092=_0x1f7a09[_0xce54('0x55')][_0x3f49a8];var _0x95205b={'id':_0x306092['id'],'available':_0x306092[_0xce54('0x4f')],'loggedIn':_0x306092[_0xce54('0x50')],'name':_0x306092[_0xce54('0x51')],'paused':_0x306092[_0xce54('0x52')],'waiting':_0x306092[_0xce54('0x53')]};_0x48fd7e[_0xce54('0x23')](_0x95205b);}}_0x592e6e({'count':_0x48fd7e['length'],'rows':_0x48fd7e});});},'SmsQueues':function(){return new Promise(function(_0x5cf85c){var _0x53cfaa=[];for(var _0x20cc5a in _0x1f7a09[_0xce54('0x56')]){if(_0x1f7a09[_0xce54('0x56')][_0xce54('0x48')](_0x20cc5a)){var _0x3a8cd0=_0x1f7a09[_0xce54('0x56')][_0x20cc5a];var _0x29bbdb={'id':_0x3a8cd0['id'],'available':_0x3a8cd0[_0xce54('0x4f')],'loggedIn':_0x3a8cd0[_0xce54('0x50')],'name':_0x3a8cd0[_0xce54('0x51')],'paused':_0x3a8cd0[_0xce54('0x52')],'waiting':_0x3a8cd0[_0xce54('0x53')]};_0x53cfaa[_0xce54('0x23')](_0x29bbdb);}}_0x5cf85c({'count':_0x53cfaa[_0xce54('0x1a')],'rows':_0x53cfaa});});},'FaxQueues':function(){return new Promise(function(_0x49988a){var _0x1dd073=[];for(var _0x36b3f6 in _0x1f7a09['faxQueues']){if(_0x1f7a09['faxQueues'][_0xce54('0x48')](_0x36b3f6)){var _0x165c44=_0x1f7a09[_0xce54('0x57')][_0x36b3f6];var _0x85ae1e={'id':_0x165c44['id'],'available':_0x165c44[_0xce54('0x4f')],'loggedIn':_0x165c44['loggedIn'],'name':_0x165c44['name'],'paused':_0x165c44['paused'],'waiting':_0x165c44[_0xce54('0x53')]};_0x1dd073[_0xce54('0x23')](_0x85ae1e);}}_0x49988a({'count':_0x1dd073[_0xce54('0x1a')],'rows':_0x1dd073});});},'WhatsappQueues':function(){return new Promise(function(_0x1c41e4){var _0x2beaef=[];for(var _0x8ce65c in _0x1f7a09[_0xce54('0x58')]){if(_0x1f7a09[_0xce54('0x58')][_0xce54('0x48')](_0x8ce65c)){var _0x4c2507=_0x1f7a09[_0xce54('0x58')][_0x8ce65c];var _0x3ff153={'id':_0x4c2507['id'],'available':_0x4c2507['available'],'loggedIn':_0x4c2507[_0xce54('0x50')],'name':_0x4c2507[_0xce54('0x51')],'paused':_0x4c2507[_0xce54('0x52')],'waiting':_0x4c2507[_0xce54('0x53')]};_0x2beaef[_0xce54('0x23')](_0x3ff153);}}_0x1c41e4({'count':_0x2beaef[_0xce54('0x1a')],'rows':_0x2beaef});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x12a82b){var _0xfa301f=_[_0xce54('0x59')](_0x1f7a09[_0xce54('0x5a')]);_0x12a82b({'count':_0xfa301f[_0xce54('0x1a')],'rows':_0xfa301f});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x9623a0){var _0x3716ec=_[_0xce54('0x59')](_0x1f7a09[_0xce54('0x5b')]);_0x9623a0({'count':_0x3716ec['length'],'rows':_0x3716ec});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x185a2b){var _0x4a8bea=_[_0xce54('0x59')](_0x1f7a09['openchannelQueuesWaitingInteractions']);_0x185a2b({'count':_0x4a8bea[_0xce54('0x1a')],'rows':_0x4a8bea});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4dce8b){var _0x14e5f6=_['values'](_0x1f7a09[_0xce54('0x5c')]);_0x4dce8b({'count':_0x14e5f6[_0xce54('0x1a')],'rows':_0x14e5f6});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x62c7c1){var _0x1dc888=_[_0xce54('0x59')](_0x1f7a09[_0xce54('0x5d')]);_0x62c7c1({'count':_0x1dc888[_0xce54('0x1a')],'rows':_0x1dc888});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x2b3ceb){var _0x58129a=_[_0xce54('0x59')](_0x1f7a09[_0xce54('0x5e')]);_0x2b3ceb({'count':_0x58129a[_0xce54('0x1a')],'rows':_0x58129a});});}};var _0x495480=jayson['server'](_0x14befa)['http']();_0x495480['on'](_0xce54('0x32'),function(_0x1ec0c0){logger[_0xce54('0x32')](JSON[_0xce54('0x36')](_0x1ec0c0));return _0x355e0f(_0x1ec0c0);});_0x495480[_0xce54('0x13')](0x232c,'127.0.0.1',function(){console['log'](_0xce54('0x5f'),0x232c);return _0x586520(_0xce54('0x60')+0x232c);});});}; \ No newline at end of file +var _0x4efb=['push','slice','dialogflow','appdata','amazonlex','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','%s:%s:%s','./interval','condition','priority','info','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','UserId','catch','stack','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','smsQueuesWaitingInteractions','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','./applications/utils','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','existsSync','join','app','.js','autoreply','split','mail'];(function(_0x861e3a,_0x55a39c){var _0x5f8cee=function(_0x1f49db){while(--_0x1f49db){_0x861e3a['push'](_0x861e3a['shift']());}};_0x5f8cee(++_0x55a39c);}(_0x4efb,0xfa));var _0xb4ef=function(_0x15d6cb,_0x22c1cf){_0x15d6cb=_0x15d6cb-0x0;var _0x4d3d95=_0x4efb[_0x15d6cb];return _0x4d3d95;};'use strict';var _=require('lodash');var util=require(_0xb4ef('0x0'));var path=require(_0xb4ef('0x1'));var fs=require('fs');var jayson=require(_0xb4ef('0x2'));var BPromise=require('bluebird');var utils=require(_0xb4ef('0x3'));var sUtils=require('./applications/strategy/util');var logger=require(_0xb4ef('0x4'))(_0xb4ef('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb4ef('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xb4ef('0x7')),'faxQueueReport':require(_0xb4ef('0x8')),'whatsappQueueReport':require(_0xb4ef('0x9'))};var RuleEngine=require(_0xb4ef('0xa'));function getId(_0x863531,_0x4cbb88,_0x1a1a33){return util[_0xb4ef('0xb')](_0xb4ef('0xc'),_0x863531,_0x4cbb88||0x0,_0x1a1a33||0x0);}function getIntervals(_0x19d132,_0x7d4001){var _0xa976df=[];if(!_['isNil'](_0x7d4001[_0xb4ef('0xd')])&&!_['isNil'](_0x19d132[_0x7d4001[_0xb4ef('0xd')]])&&!_[_0xb4ef('0xe')](_0x19d132[_0x7d4001[_0xb4ef('0xd')]]['Intervals'])){_0xa976df=_[_0xb4ef('0xf')](_0x19d132[_0x7d4001[_0xb4ef('0xd')]][_0xb4ef('0x10')],_0xb4ef('0x11'));}else if(!_[_0xb4ef('0xe')](_0x7d4001[_0xb4ef('0x11')])){_0xa976df=[_0x7d4001['interval']];}return _0xa976df;}exports[_0xb4ef('0x12')]=function(_0x587c3a){_0x587c3a[_0xb4ef('0x13')]={};return new BPromise(function(_0xd98297,_0x2a9b25){var _0x231b8b={'Start':function(_0x1f68f1){var _0x31dd95=this;return new Promise(function(_0x187370,_0x4a20a6){if(_0x1f68f1){try{var _0x3c9671=[];var _0x6a401a=getId(_0x1f68f1[_0xb4ef('0x14')],_0x1f68f1[_0xb4ef('0x15')]?_0x1f68f1[_0xb4ef('0x15')]['id']:0x0,_0x1f68f1[_0xb4ef('0x16')]?_0x1f68f1['interaction']['id']:0x0);var _0x1d8bca=sUtils[_0xb4ef('0x17')](_0x587c3a,_0x1f68f1);if(_0x1f68f1[_0xb4ef('0x18')]||!_0x1d8bca&&_0x1f68f1[_0xb4ef('0x19')]&&_[_0xb4ef('0x1a')](_0x1f68f1[_0xb4ef('0x19')])&&_0x1f68f1[_0xb4ef('0x19')]['length']){for(var _0x311f00=0x0;_0x311f00<_0x1f68f1['applications'][_0xb4ef('0x1b')];_0x311f00+=0x1){var _0x3cf09e=_0x1f68f1[_0xb4ef('0x19')][_0x311f00];if(fs[_0xb4ef('0x1c')](path[_0xb4ef('0x1d')](__dirname,_0xb4ef('0x19'),_0x3cf09e[_0xb4ef('0x1e')]+_0xb4ef('0x1f')))){var _0xc146de=[];switch(_0x3cf09e[_0xb4ef('0x1e')]['toLowerCase']()){case _0xb4ef('0x20'):var _0x387583=_0x3cf09e['appdata'][_0xb4ef('0x21')](',');if(_0x1f68f1['channel']===_0xb4ef('0x22')){_0xc146de['push'](_0x387583[0x0]);_0xc146de[_0xb4ef('0x23')](_0x387583[0x1]);_0xc146de['push'](_0x387583[_0xb4ef('0x24')](0x2,_0x387583[_0xb4ef('0x1b')])['join'](','));}else{_0xc146de['push'](_0x387583[0x0]);_0xc146de[_0xb4ef('0x23')](_0x387583[_0xb4ef('0x24')](0x1,_0x387583[_0xb4ef('0x1b')])[_0xb4ef('0x1d')](','));}break;case _0xb4ef('0x25'):var _0x594747=_0x3cf09e[_0xb4ef('0x26')]['split'](',');_0xc146de[_0xb4ef('0x23')](_0x594747[0x0]);_0xc146de[_0xb4ef('0x23')](_0x594747[0x1]);_0xc146de['push'](_0x594747[_0xb4ef('0x24')](0x2,_0x594747[_0xb4ef('0x1b')])[_0xb4ef('0x1d')](','));break;case'dialogflowv2':var _0x55a5df=_0x3cf09e[_0xb4ef('0x26')][_0xb4ef('0x21')](',');_0xc146de[_0xb4ef('0x23')](_0x55a5df[0x0]);_0xc146de['push'](_0x55a5df[0x1]);_0xc146de[_0xb4ef('0x23')](_0x55a5df[0x2]);_0xc146de[_0xb4ef('0x23')](_0x55a5df[0x3]);_0xc146de[_0xb4ef('0x23')](_0x55a5df[_0xb4ef('0x24')](0x4,_0x55a5df['length'])[_0xb4ef('0x1d')](','));break;case _0xb4ef('0x27'):var _0x515634=_0x3cf09e[_0xb4ef('0x26')]['split'](',');_0xc146de[_0xb4ef('0x23')](_0x515634[0x0]);_0xc146de[_0xb4ef('0x23')](_0x515634[0x1]);_0xc146de[_0xb4ef('0x23')](_0x515634[0x2]);_0xc146de[_0xb4ef('0x23')](_0x515634[0x3]);_0xc146de[_0xb4ef('0x23')](_0x515634[_0xb4ef('0x24')](0x4,_0x515634['length'])[_0xb4ef('0x1d')](','));break;case _0xb4ef('0x15'):_0xc146de[_0xb4ef('0x23')](_0x3cf09e[_0xb4ef('0x26')]);break;case'tag':_0xc146de[_0xb4ef('0x23')](_0x3cf09e['TagId']);_0xc146de[_0xb4ef('0x23')](_0x3cf09e[_0xb4ef('0x26')]);break;case _0xb4ef('0x28'):var _0x582e98=utils[_0xb4ef('0x29')](_0x1f68f1[_0xb4ef('0x2a')][_0xb4ef('0x2b')],_0x1f68f1);var _0x88311f=_0x3cf09e['appdata'][_0xb4ef('0x21')](',');_0xc146de[_0xb4ef('0x23')](_0x88311f[0x0]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x1]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x2]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x3]);_0xc146de['push'](_0x88311f[0x4]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x5]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x6]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x7]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x8]);_0xc146de[_0xb4ef('0x23')](_0x88311f[0x9]);_0xc146de['push'](_0x88311f[0xa]);_0xc146de['push'](_0x1f68f1['interaction']['id']);_0xc146de[_0xb4ef('0x23')](_0x1f68f1['message']['id']);_0xc146de[_0xb4ef('0x23')](_0x3cf09e['ChatWebsiteId']);_0xc146de['push'](_0x1f68f1[_0xb4ef('0x16')][_0xb4ef('0x2c')]);_0xc146de[_0xb4ef('0x23')](_0x1f68f1[_0xb4ef('0x2d')][_0xb4ef('0x2d')]);_0xc146de['push'](_0x582e98);break;default:_0xc146de=_['isNil'](_0x3cf09e[_0xb4ef('0x26')])?[]:_0x3cf09e[_0xb4ef('0x26')][_0xb4ef('0x21')](',');}var _0x30d939={'id':util[_0xb4ef('0xb')](_0xb4ef('0x2e'),_0x6a401a,_0x3cf09e['id'],_0x3cf09e['app']),'condition':require(_0xb4ef('0x2f'))[_0xb4ef('0x30')](_0x6a401a,getIntervals(_0x587c3a['intervals'],_0x3cf09e),_0x587c3a),'consequence':require('./applications/'+_0x3cf09e[_0xb4ef('0x1e')])['consequence'](_0x6a401a,_0xc146de,_0x587c3a,_0x1f68f1),'p':_0x3cf09e[_0xb4ef('0x31')]||0x0};logger[_0xb4ef('0x32')]('Push\x20new\x20rule',_0x30d939['id'],_0xb4ef('0x33'),getIntervals(_0x587c3a['intervals'],_0x3cf09e)[_0xb4ef('0x1d')](_0xb4ef('0x34')));_0x3c9671[_0xb4ef('0x23')](_0x30d939);}else{logger['error'](_0xb4ef('0x35'),path[_0xb4ef('0x1d')](__dirname,'applications',_0x3cf09e['app']+_0xb4ef('0x1f')));}}_0x587c3a[_0xb4ef('0x13')][_0x6a401a]=new RuleEngine(_0x3c9671);_0x587c3a[_0xb4ef('0x13')][_0x6a401a][_0xb4ef('0x36')](_0x1f68f1,function(_0x3ad025){logger[_0xb4ef('0x32')](_0xb4ef('0x37'),JSON[_0xb4ef('0x38')](_0x3ad025[_0xb4ef('0x39')]));if(_0x587c3a[_0xb4ef('0x13')][_0x6a401a]){_0x587c3a['rules'][_0x6a401a][_0xb4ef('0x3a')]('complete');}});return _0x187370({'code':0xc8,'message':_0x1f68f1});}else{if(_0x1d8bca){logger['info'](util['format']('Skipped\x20routing\x20for\x20%s',_0x6a401a));}else{logger[_0xb4ef('0x32')](_0xb4ef('0x3b'));}return _0x187370({'code':0xc8,'message':_0x1f68f1});}}catch(_0xec9f35){logger[_0xb4ef('0x3c')](_0xec9f35['stack']);return _0x4a20a6(_0x31dd95[_0xb4ef('0x3c')](0x1f4,_0xec9f35));}}return _0x4a20a6(_0xb4ef('0x3d'));});},'AcceptMessage':function(_0xb31437){var _0x30f289=this;return new Promise(function(_0x4c59f1,_0x5e7dab){if(_0xb31437['agent']&&_0xb31437[_0xb4ef('0x3e')]['id']){if(_0x587c3a['agents'][_0xb31437[_0xb4ef('0x3e')]['id']]){_0x587c3a['agents'][_0xb31437[_0xb4ef('0x3e')]['id']]['busy']=![];_0x587c3a[_0xb4ef('0x3f')][_0xb31437['agent']['id']][_0xb4ef('0x40')]=undefined;}}if(_0xb31437['message']&&_0xb31437['message']['id']){try{var _0x239454=getId(_0xb31437['channel'],_0xb31437[_0xb4ef('0x15')]?_0xb31437['message']['id']:0x0,_0xb31437[_0xb4ef('0x16')]?_0xb31437[_0xb4ef('0x16')]['id']:0x0);if(_0x587c3a[_0xb4ef('0x13')][_0x239454]){_0x587c3a['rules'][_0x239454][_0xb4ef('0x3a')](_0xb4ef('0x41'));if(rpc[_0xb31437[_0xb4ef('0x14')]+_0xb4ef('0x42')]){rpc[_0xb31437['channel']+_0xb4ef('0x42')]['update'](_0x239454,{'UserId':_0xb31437['message'][_0xb4ef('0x43')]})[_0xb4ef('0x44')](function(){logger[_0xb4ef('0x3c')]('error\x20update\x20queue\x20report');});}}return _0x4c59f1({'code':0xc8,'message':_0xb31437});}catch(_0xd5b1d1){logger[_0xb4ef('0x3c')](_0xd5b1d1[_0xb4ef('0x45')]);return _0x5e7dab(_0x30f289[_0xb4ef('0x3c')](0x1f4,_0xd5b1d1));}}logger[_0xb4ef('0x3c')]('message\x20is\x20empty');return _0x5e7dab(_0x30f289['error'](0x1f4,_0xb4ef('0x46')));});},'RejectMessage':function(_0x5369e0){var _0x27e278=this;return new Promise(function(_0x3e7696,_0x1b366a){if(_0x5369e0['agent']&&_0x5369e0[_0xb4ef('0x3e')]['id']){try{if(_0x587c3a[_0xb4ef('0x3f')][_0x5369e0['agent']['id']]){_0x587c3a[_0xb4ef('0x3f')][_0x5369e0['agent']['id']][_0xb4ef('0x47')]=![];_0x587c3a['agents'][_0x5369e0[_0xb4ef('0x3e')]['id']][_0xb4ef('0x40')]=undefined;}return _0x3e7696({'code':0xc8,'message':_0x5369e0});}catch(_0x3cf7e5){logger['error'](_0x3cf7e5[_0xb4ef('0x45')]);return _0x1b366a(_0x27e278[_0xb4ef('0x3c')](0x1f4,_0x3cf7e5));}}logger[_0xb4ef('0x3c')](_0xb4ef('0x46'));return _0x1b366a(_0x27e278[_0xb4ef('0x3c')](0x1f4,_0xb4ef('0x46')));});},'AbandonInteraction':function(_0x56ab6d){var _0x8e9772=this;return new Promise(function(_0x507d7c,_0x38db2a){if(_0x56ab6d[_0xb4ef('0x14')]&&_0x56ab6d[_0xb4ef('0x16')]&&_0x56ab6d[_0xb4ef('0x16')]['id']){try{var _0x1978ab=getId(_0x56ab6d[_0xb4ef('0x14')],_0x56ab6d[_0xb4ef('0x15')]?_0x56ab6d[_0xb4ef('0x15')]['id']:0x0,_0x56ab6d[_0xb4ef('0x16')]?_0x56ab6d[_0xb4ef('0x16')]['id']:0x0);if(_0x587c3a[_0xb4ef('0x13')][_0x1978ab]){_0x587c3a[_0xb4ef('0x13')][_0x1978ab][_0xb4ef('0x3a')](_0xb4ef('0x41'));}return _0x507d7c({'code':0xc8,'message':_0x56ab6d});}catch(_0xfaf43c){logger[_0xb4ef('0x3c')](_0xfaf43c['stack']);return _0x38db2a(_0x8e9772[_0xb4ef('0x3c')](0x1f4,_0xfaf43c));}}logger['error'](_0xb4ef('0x46'));return _0x38db2a(_0x8e9772[_0xb4ef('0x3c')](0x1f4,_0xb4ef('0x46')));});},'AgentCapacity':function(_0x22c73b){var _0x5b3f81=this;return new Promise(function(_0x2a2718,_0x31e8e6){if(_0x587c3a[_0xb4ef('0x3f')][_0xb4ef('0x48')](_0x22c73b['id'])){for(var _0x30d9f0 in _0x22c73b[_0xb4ef('0x49')]){if(_0x22c73b[_0xb4ef('0x49')]['hasOwnProperty'](_0x30d9f0)){if(_0x587c3a[_0xb4ef('0x3f')][_0x22c73b['id']][_0xb4ef('0x48')](_0x30d9f0+_0xb4ef('0x4a'))){_0x587c3a[_0xb4ef('0x3f')][_0x22c73b['id']][_0x30d9f0+'CurrentCapacity']=parseInt(_0x22c73b[_0xb4ef('0x49')][_0x30d9f0],0xa);}}}_0x587c3a[_0xb4ef('0x3f')][_0x22c73b['id']][_0xb4ef('0x4b')]();return _0x2a2718({'code':0xc8,'message':_0x587c3a['agents'][_0x22c73b['id']]});}else{return _0x31e8e6(_0x5b3f81['error'](0x1f4,_0xb4ef('0x4c')));}});},'Agents':function(_0x7a7693){return new Promise(function(_0x313b10){var _0x1582b1=_['values'](_0x587c3a[_0xb4ef('0x3f')]);if(_0x7a7693&&_0x7a7693['id']){var _0x28217d=_['find'](_0x1582b1,function(_0x172c33){return _0x172c33['id']===_0x7a7693['id'];});_0x313b10(_0x28217d);}else{_0x313b10({'count':_0x1582b1[_0xb4ef('0x1b')],'rows':_0x1582b1});}});},'ChatQueues':function(){return new Promise(function(_0x53f5ef){var _0x16dc8c=[];for(var _0x32cf02 in _0x587c3a[_0xb4ef('0x4d')]){if(_0x587c3a[_0xb4ef('0x4d')][_0xb4ef('0x48')](_0x32cf02)){var _0x1f6f66=_0x587c3a[_0xb4ef('0x4d')][_0x32cf02];var _0x239815={'id':_0x1f6f66['id'],'available':_0x1f6f66[_0xb4ef('0x4e')],'loggedIn':_0x1f6f66[_0xb4ef('0x4f')],'name':_0x1f6f66[_0xb4ef('0x50')],'paused':_0x1f6f66[_0xb4ef('0x51')],'waiting':_0x1f6f66[_0xb4ef('0x52')]};_0x16dc8c[_0xb4ef('0x23')](_0x239815);}}_0x53f5ef({'count':_0x16dc8c[_0xb4ef('0x1b')],'rows':_0x16dc8c});});},'MailQueues':function(){return new Promise(function(_0x323a8e){var _0x48abfb=[];for(var _0x46b321 in _0x587c3a[_0xb4ef('0x53')]){if(_0x587c3a['mailQueues']['hasOwnProperty'](_0x46b321)){var _0x3c5270=_0x587c3a[_0xb4ef('0x53')][_0x46b321];var _0x3bf26a={'id':_0x3c5270['id'],'available':_0x3c5270[_0xb4ef('0x4e')],'loggedIn':_0x3c5270[_0xb4ef('0x4f')],'name':_0x3c5270[_0xb4ef('0x50')],'paused':_0x3c5270[_0xb4ef('0x51')],'waiting':_0x3c5270['waiting']};_0x48abfb[_0xb4ef('0x23')](_0x3bf26a);}}_0x323a8e({'count':_0x48abfb[_0xb4ef('0x1b')],'rows':_0x48abfb});});},'OpenchannelQueues':function(){return new Promise(function(_0x1183e3){var _0x36bb80=[];for(var _0x47a982 in _0x587c3a[_0xb4ef('0x54')]){if(_0x587c3a[_0xb4ef('0x54')][_0xb4ef('0x48')](_0x47a982)){var _0x44ef98=_0x587c3a[_0xb4ef('0x54')][_0x47a982];var _0x3b23cd={'id':_0x44ef98['id'],'available':_0x44ef98['available'],'loggedIn':_0x44ef98[_0xb4ef('0x4f')],'name':_0x44ef98[_0xb4ef('0x50')],'paused':_0x44ef98['paused'],'waiting':_0x44ef98[_0xb4ef('0x52')]};_0x36bb80['push'](_0x3b23cd);}}_0x1183e3({'count':_0x36bb80[_0xb4ef('0x1b')],'rows':_0x36bb80});});},'SmsQueues':function(){return new Promise(function(_0x53305d){var _0x3a2d32=[];for(var _0x136ca6 in _0x587c3a[_0xb4ef('0x55')]){if(_0x587c3a[_0xb4ef('0x55')][_0xb4ef('0x48')](_0x136ca6)){var _0x57a953=_0x587c3a[_0xb4ef('0x55')][_0x136ca6];var _0x102902={'id':_0x57a953['id'],'available':_0x57a953[_0xb4ef('0x4e')],'loggedIn':_0x57a953['loggedIn'],'name':_0x57a953[_0xb4ef('0x50')],'paused':_0x57a953['paused'],'waiting':_0x57a953[_0xb4ef('0x52')]};_0x3a2d32['push'](_0x102902);}}_0x53305d({'count':_0x3a2d32['length'],'rows':_0x3a2d32});});},'FaxQueues':function(){return new Promise(function(_0x529239){var _0x33f394=[];for(var _0x4e5895 in _0x587c3a['faxQueues']){if(_0x587c3a[_0xb4ef('0x56')][_0xb4ef('0x48')](_0x4e5895)){var _0x4a6587=_0x587c3a['faxQueues'][_0x4e5895];var _0x1b13e8={'id':_0x4a6587['id'],'available':_0x4a6587[_0xb4ef('0x4e')],'loggedIn':_0x4a6587[_0xb4ef('0x4f')],'name':_0x4a6587['name'],'paused':_0x4a6587['paused'],'waiting':_0x4a6587[_0xb4ef('0x52')]};_0x33f394[_0xb4ef('0x23')](_0x1b13e8);}}_0x529239({'count':_0x33f394['length'],'rows':_0x33f394});});},'WhatsappQueues':function(){return new Promise(function(_0x57c636){var _0x49889a=[];for(var _0x390f6d in _0x587c3a[_0xb4ef('0x57')]){if(_0x587c3a[_0xb4ef('0x57')][_0xb4ef('0x48')](_0x390f6d)){var _0x239f3d=_0x587c3a[_0xb4ef('0x57')][_0x390f6d];var _0x1489d4={'id':_0x239f3d['id'],'available':_0x239f3d[_0xb4ef('0x4e')],'loggedIn':_0x239f3d[_0xb4ef('0x4f')],'name':_0x239f3d[_0xb4ef('0x50')],'paused':_0x239f3d[_0xb4ef('0x51')],'waiting':_0x239f3d[_0xb4ef('0x52')]};_0x49889a[_0xb4ef('0x23')](_0x1489d4);}}_0x57c636({'count':_0x49889a[_0xb4ef('0x1b')],'rows':_0x49889a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x35c743){var _0x2bf72e=_[_0xb4ef('0x58')](_0x587c3a['chatQueuesWaitingInteractions']);_0x35c743({'count':_0x2bf72e[_0xb4ef('0x1b')],'rows':_0x2bf72e});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4b82ea){var _0x12b04e=_[_0xb4ef('0x58')](_0x587c3a['mailQueuesWaitingInteractions']);_0x4b82ea({'count':_0x12b04e[_0xb4ef('0x1b')],'rows':_0x12b04e});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x54a991){var _0x133fcb=_[_0xb4ef('0x58')](_0x587c3a['openchannelQueuesWaitingInteractions']);_0x54a991({'count':_0x133fcb[_0xb4ef('0x1b')],'rows':_0x133fcb});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3e3b4a){var _0x150382=_[_0xb4ef('0x58')](_0x587c3a[_0xb4ef('0x59')]);_0x3e3b4a({'count':_0x150382[_0xb4ef('0x1b')],'rows':_0x150382});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3611e3){var _0x162b90=_['values'](_0x587c3a['faxQueuesWaitingInteractions']);_0x3611e3({'count':_0x162b90['length'],'rows':_0x162b90});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x288ee7){var _0x8edb4c=_['values'](_0x587c3a['whatsappQueuesWaitingInteractions']);_0x288ee7({'count':_0x8edb4c[_0xb4ef('0x1b')],'rows':_0x8edb4c});});}};var _0xa685d9=jayson['server'](_0x231b8b)[_0xb4ef('0x5a')]();_0xa685d9['on']('error',function(_0x101f41){logger[_0xb4ef('0x3c')](JSON['stringify'](_0x101f41));return _0x2a9b25(_0x101f41);});_0xa685d9[_0xb4ef('0x12')](0x232c,_0xb4ef('0x5b'),function(){console[_0xb4ef('0x5c')](_0xb4ef('0x5d'),0x232c);return _0xd98297(_0xb4ef('0x5e')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 03b2479..20c2c8e 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 _0x0879=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','join','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','\x20|\x20','lodash','../../../utils/iftime','../../../config/logger','routing','condition'];(function(_0x23413b,_0xa8aa31){var _0x395459=function(_0x466153){while(--_0x466153){_0x23413b['push'](_0x23413b['shift']());}};_0x395459(++_0xa8aa31);}(_0x0879,0x1e9));var _0x9087=function(_0x5d689d,_0x3fac90){_0x5d689d=_0x5d689d-0x0;var _0x33a7a7=_0x0879[_0x5d689d];return _0x33a7a7;};'use strict';var _=require(_0x9087('0x0'));var iftime=require(_0x9087('0x1'))['iftime'];var logger=require(_0x9087('0x2'))(_0x9087('0x3'));exports[_0x9087('0x4')]=function(_0x58061e,_0x712373,_0x389bc2){return function(_0x440d77){if(_0x389bc2[_0x9087('0x5')]&&!_0x389bc2['rules'][_0x58061e]){logger[_0x9087('0x6')](_0x9087('0x7'),_0x58061e);return _0x440d77[_0x9087('0x8')]();}var _0x1f2a9a=_0x712373[_0x9087('0x9')](function(_0x174a24){return iftime(_0x174a24);});var _0x3608c6=_['some'](_0x1f2a9a);if(_0x3608c6){logger[_0x9087('0x6')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x58061e,_0x712373[_0x9087('0xa')]('\x20|\x20'),_0x3608c6);_0x440d77['when'](_0x3608c6);}else{logger[_0x9087('0x6')](_0x9087('0xb'),_0x58061e,_0x712373['join'](_0x9087('0xc')));_0x440d77[_0x9087('0x8')]();}};}; \ No newline at end of file +var _0xd5f2=['some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','routing','condition','rules','info','stop','map'];(function(_0x466611,_0x421a63){var _0x4112c4=function(_0xeb1aab){while(--_0xeb1aab){_0x466611['push'](_0x466611['shift']());}};_0x4112c4(++_0x421a63);}(_0xd5f2,0xe6));var _0x2d5f=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xd5f2[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x2d5f('0x0'));var iftime=require(_0x2d5f('0x1'))['iftime'];var logger=require('../../../config/logger')(_0x2d5f('0x2'));exports[_0x2d5f('0x3')]=function(_0xab5365,_0x4c4916,_0x2e7ce2){return function(_0xd2ca77){if(_0x2e7ce2[_0x2d5f('0x4')]&&!_0x2e7ce2[_0x2d5f('0x4')][_0xab5365]){logger[_0x2d5f('0x5')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0xab5365);return _0xd2ca77[_0x2d5f('0x6')]();}var _0xf77b31=_0x4c4916[_0x2d5f('0x7')](function(_0x37c365){return iftime(_0x37c365);});var _0x288631=_[_0x2d5f('0x8')](_0xf77b31);if(_0x288631){logger[_0x2d5f('0x5')](_0x2d5f('0x9'),_0xab5365,_0x4c4916[_0x2d5f('0xa')](_0x2d5f('0xb')),_0x288631);_0xd2ca77[_0x2d5f('0xc')](_0x288631);}else{logger[_0x2d5f('0x5')](_0x2d5f('0xd'),_0xab5365,_0x4c4916[_0x2d5f('0xa')](_0x2d5f('0xb')));_0xd2ca77['stop']();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7610c34..610034a 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 _0xbdb7=['push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','isNil','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','[%s][agents][hangup]','cause','rejected','indexOf','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','calleridnum','connectedlinenum','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','agentcalled','[%s][agents][agentcalled]','agentcalledAt','now','destuniqueid','lastevent','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime'];(function(_0x575a38,_0x2e83d7){var _0x5a7bdd=function(_0x1bf478){while(--_0x1bf478){_0x575a38['push'](_0x575a38['shift']());}};_0x5a7bdd(++_0x2e83d7);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0xbdb7[_0x264b61];return _0x8fff4f;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var utils=require(_0x7bdb('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2a2c1c,_0x23c326){utils[_0x7bdb('0x3')](util[_0x7bdb('0x4')](_0x7bdb('0x5'),_0x2a2c1c[_0x7bdb('0x6')],_0x2a2c1c['channel'],_0x2a2c1c[_0x7bdb('0x7')],_0x2a2c1c['membername'],_0x2a2c1c['interface'],_0x2a2c1c[_0x7bdb('0x8')],_0x2a2c1c[_0x7bdb('0x9')],_0x2a2c1c['lastevent']));if(_0x2a2c1c['queue']){utils[_0x7bdb('0xa')](_0x2a2c1c[_0x7bdb('0x7')])['then'](function(_0x4a3116){if(_0x4a3116){_0x2a2c1c[_0x7bdb('0xb')]=_0x4a3116[_0x7bdb('0xb')];_0x2a2c1c[_0x7bdb('0xc')]=_0x2a2c1c[_0x7bdb('0xd')]?_0x4a3116[_0x7bdb('0xe')]:![];_0x2a2c1c[_0x7bdb('0xf')]=_0x2a2c1c[_0x7bdb('0xc')]?_0x4a3116[_0x7bdb('0x10')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x2a2c1c);});}else{utils['request'](_0x7bdb('0x11'),_0x2a2c1c);}if(_0x23c326){delete transfers[_0x2a2c1c[_0x7bdb('0x6')]];}else{delete agents[_0x2a2c1c['destuniqueid']];}}exports[_0x7bdb('0x12')]=function(_0x53021d){try{utils['debug'](util[_0x7bdb('0x4')](_0x7bdb('0x13'),_0x53021d['uniqueid']),_0x53021d);agents[_0x53021d['destuniqueid']]=_0x53021d;agents[_0x53021d['destuniqueid']][_0x7bdb('0x14')]=utils[_0x7bdb('0x15')]();agents[_0x53021d[_0x7bdb('0x16')]][_0x7bdb('0x17')]=_0x7bdb('0x18');agents[_0x53021d[_0x7bdb('0x16')]][_0x7bdb('0x9')]=null;agents[_0x53021d[_0x7bdb('0x16')]]['connectedlinename']=null;utils[_0x7bdb('0x3')](util[_0x7bdb('0x4')](_0x7bdb('0x19'),_0x53021d[_0x7bdb('0x6')],agents[_0x53021d['destuniqueid']][_0x7bdb('0x1a')],_0x53021d[_0x7bdb('0x16')]));}catch(_0x5b8481){utils[_0x7bdb('0x1b')](util[_0x7bdb('0x4')](_0x7bdb('0x13'),_0x53021d[_0x7bdb('0x6')]),_0x5b8481);}};exports[_0x7bdb('0x1c')]=function(_0x5bfc35){try{if(!_['isNil'](agents[_0x5bfc35[_0x7bdb('0x16')]])){utils[_0x7bdb('0x1d')](util['format'](_0x7bdb('0x1e'),_0x5bfc35[_0x7bdb('0x6')]),_0x5bfc35);utils[_0x7bdb('0x3')](util[_0x7bdb('0x4')](_0x7bdb('0x1f'),_0x5bfc35['uniqueid'],agents[_0x5bfc35[_0x7bdb('0x16')]][_0x7bdb('0x1a')],_0x5bfc35[_0x7bdb('0x16')]));agents[_0x5bfc35[_0x7bdb('0x16')]]['agentringnoanswer']=!![];agents[_0x5bfc35['destuniqueid']][_0x7bdb('0x20')]=utils['now']();agents[_0x5bfc35['destuniqueid']]['lastevent']=_0x7bdb('0x21');agents[_0x5bfc35['destuniqueid']][_0x7bdb('0x22')]=_0x7bdb('0x21');agents[_0x5bfc35[_0x7bdb('0x16')]][_0x7bdb('0x23')]=_0x5bfc35[_0x7bdb('0x24')]?parseInt(_0x5bfc35['ringtime'])/0x3e8:0x0;agents[_0x5bfc35[_0x7bdb('0x16')]][_0x7bdb('0x25')]=0x0;unanswered[_0x7bdb('0x26')](_0x5bfc35[_0x7bdb('0x16')]);}}catch(_0x371e8a){utils[_0x7bdb('0x1b')](util[_0x7bdb('0x4')](_0x7bdb('0x1e'),_0x5bfc35[_0x7bdb('0x6')]),_0x371e8a);}};exports[_0x7bdb('0x27')]=function(_0x9ec48d){try{_[_0x7bdb('0x28')](agents,function(_0x5b386d,_0x388a45){if(_0x5b386d[_0x7bdb('0x6')]==_0x9ec48d[_0x7bdb('0x6')]&&!_[_0x7bdb('0x29')](unanswered,_0x5b386d[_0x7bdb('0x16')])){utils['debug'](util[_0x7bdb('0x4')](_0x7bdb('0x2a'),_0x9ec48d[_0x7bdb('0x6')]),_0x9ec48d);utils[_0x7bdb('0x3')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x9ec48d['uniqueid'],_0x5b386d[_0x7bdb('0x1a')],_0x5b386d['destuniqueid']));_0x5b386d[_0x7bdb('0x1c')]=!![];_0x5b386d['agentringnoanswerAt']=utils[_0x7bdb('0x15')]();_0x5b386d[_0x7bdb('0x17')]=_0x7bdb('0x2b');_0x5b386d['reason']=_0x7bdb('0x2b');_0x5b386d['holdtime']=_0x9ec48d['holdtime'];_0x5b386d[_0x7bdb('0x25')]=0x0;writeDB(_0x5b386d);}});}catch(_0x5611f5){utils[_0x7bdb('0x1b')](util['format']('[%s][agents][queuecallerabandon]',_0x9ec48d[_0x7bdb('0x6')]),_0x5611f5);}};exports[_0x7bdb('0x2c')]=function(_0x3ddee4){try{if(agents[_0x3ddee4[_0x7bdb('0x16')]]){utils[_0x7bdb('0x1d')](util[_0x7bdb('0x4')]('[%s][agents][agentconnect]',_0x3ddee4[_0x7bdb('0x6')]),_0x3ddee4);utils[_0x7bdb('0x3')](util[_0x7bdb('0x4')](_0x7bdb('0x2d'),_0x3ddee4[_0x7bdb('0x6')],agents[_0x3ddee4[_0x7bdb('0x16')]][_0x7bdb('0x1a')],_0x3ddee4[_0x7bdb('0x16')]));agents[_0x3ddee4[_0x7bdb('0x16')]]['agentconnectAt']=utils['now']();agents[_0x3ddee4[_0x7bdb('0x16')]][_0x7bdb('0x9')]=_0x3ddee4[_0x7bdb('0x9')];agents[_0x3ddee4[_0x7bdb('0x16')]][_0x7bdb('0x2e')]=_0x3ddee4['connectedlinename'];agents[_0x3ddee4['destuniqueid']][_0x7bdb('0x23')]=_0x3ddee4['ringtime'];agents[_0x3ddee4[_0x7bdb('0x16')]]['lastevent']=_0x7bdb('0x2f');_['forIn'](agents,function(_0x4cf3fa,_0x21dae7){if(_0x4cf3fa[_0x7bdb('0x16')]!=_0x3ddee4[_0x7bdb('0x16')]&&_0x4cf3fa[_0x7bdb('0x6')]==_0x3ddee4[_0x7bdb('0x6')]){_0x4cf3fa[_0x7bdb('0x25')]=0x0;_0x4cf3fa[_0x7bdb('0x23')]=_0x3ddee4['ringtime'];_0x4cf3fa['agentringnoanswer']=!![];_0x4cf3fa[_0x7bdb('0x20')]=utils[_0x7bdb('0x15')]();_0x4cf3fa[_0x7bdb('0x17')]=_0x7bdb('0x30');_0x4cf3fa[_0x7bdb('0x22')]=_0x7bdb('0x30');_0x4cf3fa[_0x7bdb('0x31')]=_0x3ddee4['destuniqueid'];_0x4cf3fa['answeredelsewheremembername']=_0x3ddee4[_0x7bdb('0x1a')];writeDB(_0x4cf3fa);}});}}catch(_0x8e893e){utils[_0x7bdb('0x1b')](util[_0x7bdb('0x4')]('[%s][agents][agentconnect]',_0x3ddee4[_0x7bdb('0x6')]),_0x8e893e);}};exports['agentcomplete']=function(_0x37029b){try{if(!_[_0x7bdb('0x32')](agents[_0x37029b[_0x7bdb('0x16')]])){utils[_0x7bdb('0x1d')](util[_0x7bdb('0x4')](_0x7bdb('0x33'),_0x37029b[_0x7bdb('0x6')]),_0x37029b);utils[_0x7bdb('0x3')](util[_0x7bdb('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x37029b[_0x7bdb('0x6')],agents[_0x37029b[_0x7bdb('0x16')]]['membername'],_0x37029b[_0x7bdb('0x16')]));agents[_0x37029b['destuniqueid']][_0x7bdb('0xd')]=!![];agents[_0x37029b[_0x7bdb('0x16')]][_0x7bdb('0x34')]=utils[_0x7bdb('0x15')]();agents[_0x37029b[_0x7bdb('0x16')]]['talktime']=utils[_0x7bdb('0x35')](agents[_0x37029b[_0x7bdb('0x16')]][_0x7bdb('0x34')],agents[_0x37029b[_0x7bdb('0x16')]][_0x7bdb('0x36')]);agents[_0x37029b['destuniqueid']][_0x7bdb('0x22')]=_0x37029b[_0x7bdb('0x22')];agents[_0x37029b[_0x7bdb('0x16')]][_0x7bdb('0x17')]=_0x7bdb('0x37');writeDB(agents[_0x37029b[_0x7bdb('0x16')]]);}}catch(_0x1895b6){utils[_0x7bdb('0x1b')](util[_0x7bdb('0x4')](_0x7bdb('0x33'),_0x37029b['uniqueid']),_0x1895b6);}};exports[_0x7bdb('0x38')]=function(_0x58c4bc){try{if(!_['isNil'](agents[_0x58c4bc[_0x7bdb('0x39')]])){utils[_0x7bdb('0x1d')](util['format'](_0x7bdb('0x3a'),_0x58c4bc[_0x7bdb('0x6')]),_0x58c4bc);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x58c4bc[_0x7bdb('0x6')],agents[_0x58c4bc[_0x7bdb('0x39')]][_0x7bdb('0x1a')],agents[_0x58c4bc[_0x7bdb('0x39')]][_0x7bdb('0x6')]));agents[_0x58c4bc[_0x7bdb('0x39')]][_0x7bdb('0x3b')]=!![];agents[_0x58c4bc[_0x7bdb('0x39')]][_0x7bdb('0x3c')]=_0x7bdb('0x3d');agents[_0x58c4bc['transfereruniqueid']][_0x7bdb('0x3e')]=_0x58c4bc['extension'];agents[_0x58c4bc[_0x7bdb('0x39')]][_0x7bdb('0x3f')]=agents[_0x58c4bc[_0x7bdb('0x39')]][_0x7bdb('0x6')];}}catch(_0x493d23){utils[_0x7bdb('0x1b')](util['format']('[%s][agents][blindtransfer]',_0x58c4bc[_0x7bdb('0x6')]),_0x493d23);}};exports[_0x7bdb('0x40')]=function(_0x5065ae){try{utils['debug'](util['format'](_0x7bdb('0x41'),_0x5065ae['origtransfereruniqueid']),_0x5065ae);if(_0x5065ae['origtransfereruniqueid']==_0x5065ae[_0x7bdb('0x42')]){if(!_[_0x7bdb('0x32')](agents[_0x5065ae[_0x7bdb('0x43')]])){utils[_0x7bdb('0x3')](util['format'](_0x7bdb('0x44'),_0x5065ae['origtransfereruniqueid'],agents[_0x5065ae[_0x7bdb('0x43')]][_0x7bdb('0x1a')]));agents[_0x5065ae[_0x7bdb('0x43')]][_0x7bdb('0x3b')]=!![];agents[_0x5065ae[_0x7bdb('0x43')]][_0x7bdb('0x3c')]='ATTENDED';agents[_0x5065ae[_0x7bdb('0x43')]][_0x7bdb('0x3e')]=_0x5065ae[_0x7bdb('0x45')];agents[_0x5065ae['secondtransfereruniqueid']][_0x7bdb('0x3f')]=_0x5065ae[_0x7bdb('0x46')];}if(_0x5065ae['transfereeuniqueid']&&agents[_0x5065ae[_0x7bdb('0x47')]]){agents[_0x5065ae['transfereeuniqueid']][_0x7bdb('0x48')]=0x1;transfers[_0x5065ae[_0x7bdb('0x47')]]=_['clone'](agents[_0x5065ae['transfereeuniqueid']]);transfers[_0x5065ae[_0x7bdb('0x47')]][_0x7bdb('0x8')]=agents[_0x5065ae['secondtransfereruniqueid']][_0x7bdb('0x8')];transfers[_0x5065ae['transfereeuniqueid']][_0x7bdb('0x49')]=agents[_0x5065ae['secondtransfereruniqueid']]['calleridname'];transfers[_0x5065ae[_0x7bdb('0x47')]][_0x7bdb('0x14')]=utils[_0x7bdb('0x15')]();transfers[_0x5065ae[_0x7bdb('0x47')]][_0x7bdb('0x36')]=utils[_0x7bdb('0x15')]();transfers[_0x5065ae[_0x7bdb('0x47')]][_0x7bdb('0x23')]=0x0;transfers[_0x5065ae[_0x7bdb('0x47')]][_0x7bdb('0x48')]=0x2;}}else if(_0x5065ae[_0x7bdb('0x43')]==_0x5065ae[_0x7bdb('0x4a')]){if(!_['isNil'](agents[_0x5065ae[_0x7bdb('0x46')]])){utils[_0x7bdb('0x3')](util['format'](_0x7bdb('0x44'),_0x5065ae[_0x7bdb('0x46')],agents[_0x5065ae[_0x7bdb('0x46')]][_0x7bdb('0x1a')]));agents[_0x5065ae[_0x7bdb('0x46')]]['transfer']=!![];agents[_0x5065ae[_0x7bdb('0x46')]][_0x7bdb('0x3c')]=_0x7bdb('0x4b');agents[_0x5065ae['origtransfereruniqueid']][_0x7bdb('0x3e')]=_0x5065ae[_0x7bdb('0x4c')];agents[_0x5065ae[_0x7bdb('0x46')]][_0x7bdb('0x3f')]=_0x5065ae[_0x7bdb('0x43')];}if(_0x5065ae[_0x7bdb('0x4d')]&&agents[_0x5065ae[_0x7bdb('0x4d')]]){agents[_0x5065ae[_0x7bdb('0x4d')]][_0x7bdb('0x48')]=0x1;transfers[_0x5065ae['transfertargetuniqueid']]=_[_0x7bdb('0x4e')](agents[_0x5065ae[_0x7bdb('0x4d')]]);transfers[_0x5065ae[_0x7bdb('0x4d')]][_0x7bdb('0x8')]=agents[_0x5065ae[_0x7bdb('0x46')]][_0x7bdb('0x8')];transfers[_0x5065ae[_0x7bdb('0x4d')]][_0x7bdb('0x49')]=agents[_0x5065ae[_0x7bdb('0x46')]][_0x7bdb('0x49')];transfers[_0x5065ae[_0x7bdb('0x4d')]][_0x7bdb('0x14')]=utils[_0x7bdb('0x15')]();transfers[_0x5065ae['transfertargetuniqueid']][_0x7bdb('0x36')]=utils['now']();transfers[_0x5065ae[_0x7bdb('0x4d')]][_0x7bdb('0x23')]=0x0;transfers[_0x5065ae[_0x7bdb('0x4d')]]['agententerreason']=0x2;}}}catch(_0xd57d33){utils[_0x7bdb('0x1b')](util['format'](_0x7bdb('0x41'),_0x5065ae[_0x7bdb('0x46')]),_0xd57d33);}};exports['hangup']=function(_0x1c4525){try{utils[_0x7bdb('0x1d')](util['format'](_0x7bdb('0x4f'),_0x1c4525[_0x7bdb('0x6')]),_0x1c4525);if(agents[_0x1c4525['uniqueid']]&&agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x22')]==='timeout'){if(_0x1c4525[_0x7bdb('0x50')]==='21'){agents[_0x1c4525['uniqueid']][_0x7bdb('0x22')]=_0x7bdb('0x51');agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x17')]=_0x7bdb('0x51');}utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1c4525[_0x7bdb('0x6')],agents[_0x1c4525['uniqueid']][_0x7bdb('0x1a')],agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x22')],agents[_0x1c4525['uniqueid']]['lastevent']));writeDB(agents[_0x1c4525[_0x7bdb('0x6')]]);var _0x10b3c4=unanswered[_0x7bdb('0x52')](_0x1c4525[_0x7bdb('0x6')]);if(_0x10b3c4>-0x1){unanswered['splice'](_0x10b3c4,0x1);}}if(transfers[_0x1c4525[_0x7bdb('0x6')]]){transfers[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0xd')]=!![];transfers[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x34')]=utils[_0x7bdb('0x15')]();transfers[_0x1c4525['uniqueid']][_0x7bdb('0x25')]=utils['diffTime'](transfers[_0x1c4525[_0x7bdb('0x6')]]['agentcompleteAt'],transfers[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x36')]);transfers[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x22')]=_0x7bdb('0x53');transfers[_0x1c4525['uniqueid']]['lastevent']=_0x7bdb('0x37');utils[_0x7bdb('0x3')](util['format'](_0x7bdb('0x54'),_0x1c4525[_0x7bdb('0x6')],transfers[_0x1c4525['uniqueid']][_0x7bdb('0x1a')],transfers[_0x1c4525[_0x7bdb('0x6')]]['reason'],transfers[_0x1c4525[_0x7bdb('0x6')]]['lastevent']));writeDB(transfers[_0x1c4525['uniqueid']],!![]);}if(agents[_0x1c4525[_0x7bdb('0x6')]]&&agents[_0x1c4525[_0x7bdb('0x6')]]['agentconnectAt']){agents[_0x1c4525['uniqueid']][_0x7bdb('0xd')]=!![];agents[_0x1c4525['uniqueid']][_0x7bdb('0x34')]=utils['now']();agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x25')]=utils[_0x7bdb('0x35')](agents[_0x1c4525[_0x7bdb('0x6')]]['agentcompleteAt'],agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x36')]);agents[_0x1c4525['uniqueid']][_0x7bdb('0x22')]=agents[_0x1c4525[_0x7bdb('0x6')]]['transfer']?_0x7bdb('0x3b'):_0x7bdb('0x53');agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x17')]='complete';utils[_0x7bdb('0x3')](util['format'](_0x7bdb('0x54'),_0x1c4525[_0x7bdb('0x6')],agents[_0x1c4525[_0x7bdb('0x6')]]['membername'],agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x22')],agents[_0x1c4525[_0x7bdb('0x6')]][_0x7bdb('0x17')]));writeDB(agents[_0x1c4525[_0x7bdb('0x6')]]);}}catch(_0x393baa){utils[_0x7bdb('0x1b')](util[_0x7bdb('0x4')](_0x7bdb('0x4f'),_0x1c4525[_0x7bdb('0x6')]),_0x393baa);}}; \ No newline at end of file +var _0x97c1=['connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','ringtime','talktime','push','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','called'];(function(_0x37da5e,_0x2db5a9){var _0x372e79=function(_0x445f1b){while(--_0x445f1b){_0x37da5e['push'](_0x37da5e['shift']());}};_0x372e79(++_0x2db5a9);}(_0x97c1,0xdf));var _0x197c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x97c1[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e2e81,_0x498f9c){utils['info'](util[_0x197c('0x2')](_0x197c('0x3'),_0x5e2e81[_0x197c('0x4')],_0x5e2e81[_0x197c('0x5')],_0x5e2e81[_0x197c('0x6')],_0x5e2e81['membername'],_0x5e2e81['interface'],_0x5e2e81[_0x197c('0x7')],_0x5e2e81[_0x197c('0x8')],_0x5e2e81[_0x197c('0x9')]));if(_0x5e2e81[_0x197c('0x6')]){utils['getVoiceQueueByName'](_0x5e2e81['queue'])[_0x197c('0xa')](function(_0x5cffb8){if(_0x5cffb8){_0x5e2e81[_0x197c('0xb')]=_0x5cffb8[_0x197c('0xb')];_0x5e2e81[_0x197c('0xc')]=_0x5e2e81[_0x197c('0xd')]?_0x5cffb8['acw']:![];_0x5e2e81[_0x197c('0xe')]=_0x5e2e81[_0x197c('0xc')]?_0x5cffb8[_0x197c('0xf')]:0x0;}utils[_0x197c('0x10')](_0x197c('0x11'),_0x5e2e81);});}else{utils['request'](_0x197c('0x11'),_0x5e2e81);}if(_0x498f9c){delete transfers[_0x5e2e81[_0x197c('0x4')]];}else{delete agents[_0x5e2e81[_0x197c('0x12')]];}}exports[_0x197c('0x13')]=function(_0x567658){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x567658);agents[_0x567658[_0x197c('0x12')]]=_0x567658;agents[_0x567658[_0x197c('0x12')]]['agentcalledAt']=utils['now']();agents[_0x567658[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x16');agents[_0x567658[_0x197c('0x12')]][_0x197c('0x8')]=null;agents[_0x567658[_0x197c('0x12')]][_0x197c('0x17')]=null;utils[_0x197c('0x18')](util['format'](_0x197c('0x19'),_0x567658['uniqueid'],agents[_0x567658['destuniqueid']][_0x197c('0x1a')],_0x567658[_0x197c('0x12')]));}catch(_0x2eca5e){utils[_0x197c('0x1b')](util['format'](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x2eca5e);}};exports[_0x197c('0x1c')]=function(_0x5c278a){try{if(!_[_0x197c('0x1d')](agents[_0x5c278a[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a[_0x197c('0x4')]),_0x5c278a);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x1f'),_0x5c278a[_0x197c('0x4')],agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1a')],_0x5c278a[_0x197c('0x12')]));agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1c')]=!![];agents[_0x5c278a[_0x197c('0x12')]]['agentringnoanswerAt']=utils[_0x197c('0x20')]();agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x9')]='timeout';agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x21')]='timeout';agents[_0x5c278a['destuniqueid']][_0x197c('0x22')]=_0x5c278a['ringtime']?parseInt(_0x5c278a[_0x197c('0x23')])/0x3e8:0x0;agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x24')]=0x0;unanswered[_0x197c('0x25')](_0x5c278a[_0x197c('0x12')]);}}catch(_0x3cdcd8){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a['uniqueid']),_0x3cdcd8);}};exports['queuecallerabandon']=function(_0x574274){try{_['forIn'](agents,function(_0x5f7425,_0x4c9256){if(_0x5f7425[_0x197c('0x4')]==_0x574274[_0x197c('0x4')]&&!_['includes'](unanswered,_0x5f7425[_0x197c('0x12')])){utils['debug'](util[_0x197c('0x2')](_0x197c('0x26'),_0x574274[_0x197c('0x4')]),_0x574274);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x27'),_0x574274[_0x197c('0x4')],_0x5f7425[_0x197c('0x1a')],_0x5f7425[_0x197c('0x12')]));_0x5f7425['agentringnoanswer']=!![];_0x5f7425['agentringnoanswerAt']=utils[_0x197c('0x20')]();_0x5f7425[_0x197c('0x9')]=_0x197c('0x28');_0x5f7425[_0x197c('0x21')]=_0x197c('0x28');_0x5f7425[_0x197c('0x22')]=_0x574274[_0x197c('0x22')];_0x5f7425['talktime']=0x0;writeDB(_0x5f7425);}});}catch(_0x54e6be){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][queuecallerabandon]',_0x574274['uniqueid']),_0x54e6be);}};exports[_0x197c('0x29')]=function(_0x2a884b){try{if(agents[_0x2a884b[_0x197c('0x12')]]){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x2a'),_0x2a884b[_0x197c('0x4')]),_0x2a884b);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a884b[_0x197c('0x4')],agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x1a')],_0x2a884b[_0x197c('0x12')]));agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x2b')]=utils['now']();agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x8')]=_0x2a884b[_0x197c('0x8')];agents[_0x2a884b['destuniqueid']][_0x197c('0x17')]=_0x2a884b[_0x197c('0x17')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x2c');_[_0x197c('0x2d')](agents,function(_0x1dc01b,_0x4a12fc){if(_0x1dc01b[_0x197c('0x12')]!=_0x2a884b[_0x197c('0x12')]&&_0x1dc01b['uniqueid']==_0x2a884b['uniqueid']){_0x1dc01b[_0x197c('0x24')]=0x0;_0x1dc01b[_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];_0x1dc01b[_0x197c('0x1c')]=!![];_0x1dc01b[_0x197c('0x2e')]=utils['now']();_0x1dc01b[_0x197c('0x9')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x21')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x30')]=_0x2a884b['destuniqueid'];_0x1dc01b[_0x197c('0x31')]=_0x2a884b[_0x197c('0x1a')];writeDB(_0x1dc01b);}});}}catch(_0x6d7bda){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][agentconnect]',_0x2a884b[_0x197c('0x4')]),_0x6d7bda);}};exports[_0x197c('0xd')]=function(_0x3b7fc1){try{if(!_[_0x197c('0x1d')](agents[_0x3b7fc1[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1[_0x197c('0x4')]),_0x3b7fc1);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3b7fc1['uniqueid'],agents[_0x3b7fc1['destuniqueid']]['membername'],_0x3b7fc1[_0x197c('0x12')]));agents[_0x3b7fc1[_0x197c('0x12')]]['agentcomplete']=!![];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')]=utils['now']();agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x24')]=utils['diffTime'](agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')],agents[_0x3b7fc1['destuniqueid']][_0x197c('0x2b')]);agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x21')]=_0x3b7fc1['reason'];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x34');writeDB(agents[_0x3b7fc1[_0x197c('0x12')]]);}}catch(_0x53295b){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1['uniqueid']),_0x53295b);}};exports['blindtransfer']=function(_0x3a5089){try{if(!_[_0x197c('0x1d')](agents[_0x3a5089[_0x197c('0x35')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089['uniqueid']),_0x3a5089);utils[_0x197c('0x18')](util['format'](_0x197c('0x37'),_0x3a5089[_0x197c('0x4')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x1a')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')]));agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x38')]=!![];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x39')]=_0x197c('0x3a');agents[_0x3a5089[_0x197c('0x35')]]['transferexten']=_0x3a5089[_0x197c('0x3b')];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x3c')]=agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')];}}catch(_0x22a106){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089[_0x197c('0x4')]),_0x22a106);}};exports['attendedtransfer']=function(_0x3e3176){try{utils[_0x197c('0x14')](util[_0x197c('0x2')]('[%s][agents][attendedtransfer]',_0x3e3176[_0x197c('0x3d')]),_0x3e3176);if(_0x3e3176[_0x197c('0x3d')]==_0x3e3176[_0x197c('0x3e')]){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3f')]])){utils['info'](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3f')]]['transfer']=!![];agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x42')]=_0x3e3176[_0x197c('0x43')];agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x3c')]=_0x3e3176[_0x197c('0x3d')];}if(_0x3e3176[_0x197c('0x44')]&&agents[_0x3e3176['transfereeuniqueid']]){agents[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176['transfereeuniqueid']]=_['clone'](agents[_0x3e3176[_0x197c('0x44')]]);transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x7')]=agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x7')];transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3f')]]['calleridname'];transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x47')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x2b')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x2;}}else if(_0x3e3176[_0x197c('0x3f')]==_0x3e3176['secondtransfererlinkedid']){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3d')]])){utils[_0x197c('0x18')](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x38')]=!![];agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176[_0x197c('0x3d')]]['transferexten']=_0x3e3176[_0x197c('0x48')];agents[_0x3e3176['origtransfereruniqueid']]['transferuniqueid']=_0x3e3176['secondtransfereruniqueid'];}if(_0x3e3176['transfertargetuniqueid']&&agents[_0x3e3176[_0x197c('0x49')]]){agents[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176[_0x197c('0x49')]]=_['clone'](agents[_0x3e3176[_0x197c('0x49')]]);transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x7')]=agents[_0x3e3176['origtransfereruniqueid']][_0x197c('0x7')];transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x46')];transfers[_0x3e3176[_0x197c('0x49')]]['agentcalledAt']=utils[_0x197c('0x20')]();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x2b')]=utils['now']();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x22')]=0x0;transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x2;}}}catch(_0x5596f3){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x4a'),_0x3e3176[_0x197c('0x3d')]),_0x5596f3);}};exports[_0x197c('0x4b')]=function(_0x342efa){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x4c'),_0x342efa[_0x197c('0x4')]),_0x342efa);if(agents[_0x342efa[_0x197c('0x4')]]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]==='timeout'){if(_0x342efa['cause']==='21'){agents[_0x342efa['uniqueid']][_0x197c('0x21')]='rejected';agents[_0x342efa[_0x197c('0x4')]]['lastevent']='rejected';}utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa['uniqueid'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],agents[_0x342efa['uniqueid']][_0x197c('0x21')],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);var _0x54206a=unanswered[_0x197c('0x4e')](_0x342efa['uniqueid']);if(_0x54206a>-0x1){unanswered[_0x197c('0x4f')](_0x54206a,0x1);}}if(transfers[_0x342efa['uniqueid']]){transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0xd')]=!![];transfers[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils[_0x197c('0x20')]();transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils['diffTime'](transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]);transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]='agent';transfers[_0x342efa[_0x197c('0x4')]]['lastevent']='complete';utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x342efa[_0x197c('0x4')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],transfers[_0x342efa['uniqueid']]['lastevent']));writeDB(transfers[_0x342efa['uniqueid']],!![]);}if(agents[_0x342efa['uniqueid']]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]){agents[_0x342efa['uniqueid']]['agentcomplete']=!![];agents[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils['now']();agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils[_0x197c('0x50')](agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],agents[_0x342efa[_0x197c('0x4')]]['agentconnectAt']);agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]=agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x38')]?_0x197c('0x38'):_0x197c('0x51');agents[_0x342efa[_0x197c('0x4')]]['lastevent']=_0x197c('0x34');utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa[_0x197c('0x4')],agents[_0x342efa[_0x197c('0x4')]]['membername'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],agents[_0x342efa['uniqueid']][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);}}catch(_0x173303){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][hangup]',_0x342efa['uniqueid']),_0x173303);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 6269cc4..da8b2ec 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 _0x362a=['ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','startsWith','split','lastIndexOf','includes','noop','gotoif','lodash','util','NO\x20ANSWER','FAILED','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','context','isNil','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','transfertargetchannel','origtransfereruniqueid','origtransfererchannel','_attended','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s'];(function(_0x303d49,_0x31689b){var _0x30624f=function(_0x2e91fc){while(--_0x2e91fc){_0x303d49['push'](_0x303d49['shift']());}};_0x30624f(++_0x31689b);}(_0x362a,0xe1));var _0xa362=function(_0xf5541e,_0x53a22f){_0xf5541e=_0xf5541e-0x0;var _0x3aed8e=_0x362a[_0xf5541e];return _0x3aed8e;};'use strict';var _=require(_0xa362('0x0'));var util=require(_0xa362('0x1'));var utils=require('./utils');var dispositions=[_0xa362('0x2'),_0xa362('0x3'),_0xa362('0x3'),_0xa362('0x2'),_0xa362('0x2'),_0xa362('0x2'),'ANSWERED','BUSY',_0xa362('0x3'),'FAILED',_0xa362('0x3')];var channels={};function writeDB(_0x5a35d0){utils[_0xa362('0x4')](util['format'](_0xa362('0x5'),_0x5a35d0[_0xa362('0x6')],_0x5a35d0[_0xa362('0x7')],_0x5a35d0['queue'],_0x5a35d0[_0xa362('0x8')],_0x5a35d0['interface'],_0x5a35d0[_0xa362('0x9')],_0x5a35d0[_0xa362('0xa')],_0x5a35d0[_0xa362('0xb')]));if(_0x5a35d0[_0xa362('0xc')]){utils['getUserByInternal'](_0x5a35d0[_0xa362('0xc')])[_0xa362('0xd')](function(_0x53d8d4){if(_0x53d8d4){_0x5a35d0[_0xa362('0xe')]=_0x53d8d4['id'];}utils['request']('CreateVoiceCallReport',_0x5a35d0);});}else{utils[_0xa362('0xf')](_0xa362('0x10'),_0x5a35d0);}if(channels[_0x5a35d0['uniqueid']]){delete channels[_0x5a35d0['uniqueid']];}}exports[_0xa362('0x11')]=function(_0x35e6c3){try{utils[_0xa362('0x12')](util[_0xa362('0x13')](_0xa362('0x14'),_0x35e6c3[_0xa362('0x6')]),_0x35e6c3);if(_0x35e6c3[_0xa362('0x6')]==_0x35e6c3[_0xa362('0x15')]&&_0x35e6c3[_0xa362('0x7')]!=_0xa362('0x16')){utils['info'](util[_0xa362('0x13')](_0xa362('0x17'),_0x35e6c3['uniqueid'],_0x35e6c3['context'],_0x35e6c3[_0xa362('0x18')]));channels[_0x35e6c3[_0xa362('0x6')]]={'uniqueid':_0x35e6c3[_0xa362('0x6')],'accountcode':_0x35e6c3[_0xa362('0xc')],'source':_0x35e6c3[_0xa362('0x9')],'destination':_0x35e6c3[_0xa362('0x18')],'destinationcontext':_0x35e6c3['context'],'channel':_0x35e6c3[_0xa362('0x7')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa362('0x2'),'amaflags':_0xa362('0x19')};}}catch(_0xb857da){utils[_0xa362('0x1a')](util['format'](_0xa362('0x14'),_0x35e6c3[_0xa362('0x6')]),_0xb857da);}};exports[_0xa362('0x1b')]=function(_0x4585d1){try{utils[_0xa362('0x12')](util[_0xa362('0x13')](_0xa362('0x1c'),_0x4585d1[_0xa362('0x6')]),_0x4585d1);if(!_['isNil'](channels[_0x4585d1[_0xa362('0x6')]])&&_0x4585d1[_0xa362('0x1d')]==0x6){utils[_0xa362('0x4')](util[_0xa362('0x13')](_0xa362('0x1e'),_0x4585d1[_0xa362('0x6')],_0x4585d1[_0xa362('0x1f')],_0x4585d1['channel']));if(_[_0xa362('0x20')](channels[_0x4585d1['uniqueid']]['systemanswertime'])){channels[_0x4585d1['uniqueid']]['systemanswertime']=utils[_0xa362('0x21')]();}}else if(!_[_0xa362('0x20')](channels[_0x4585d1[_0xa362('0x15')]])&&_0x4585d1[_0xa362('0x1d')]==0x6&&_0x4585d1[_0xa362('0x1f')]!=_0xa362('0x22')){utils[_0xa362('0x4')](util[_0xa362('0x13')](_0xa362('0x23'),_0x4585d1[_0xa362('0x6')],_0x4585d1['linkedid'],_0x4585d1[_0xa362('0x1f')],_0x4585d1[_0xa362('0x7')]));channels[_0x4585d1[_0xa362('0x15')]][_0xa362('0xc')]=_0x4585d1[_0xa362('0xc')];channels[_0x4585d1[_0xa362('0x15')]]['destinationchannel']=_0x4585d1[_0xa362('0x7')];if(_[_0xa362('0x20')](channels[_0x4585d1[_0xa362('0x15')]][_0xa362('0x24')])){channels[_0x4585d1['linkedid']][_0xa362('0x24')]=utils[_0xa362('0x21')]();}channels[_0x4585d1[_0xa362('0x15')]][_0xa362('0x25')]=dispositions[_[_0xa362('0x26')](_0x4585d1[_0xa362('0x1d')])]||'ANSWERED';}}catch(_0x1f94a9){utils[_0xa362('0x1a')](util['format'](_0xa362('0x1c'),_0x4585d1['uniqueid']),_0x1f94a9);}};exports[_0xa362('0x27')]=function(_0x29473b){try{if(!_['isNil'](channels[_0x29473b[_0xa362('0x6')]])){utils[_0xa362('0x12')](util[_0xa362('0x13')](_0xa362('0x28'),_0x29473b[_0xa362('0x6')]),_0x29473b);if(_['isNil'](channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x29')])){channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x29')]=_0x29473b[_0xa362('0x2a')]+'\x20<'+_0x29473b['calleridnum']+'>';}utils[_0xa362('0x4')](util[_0xa362('0x13')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x29473b[_0xa362('0x6')],channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x29')],_0x29473b[_0xa362('0x2b')]));channels[_0x29473b['uniqueid']][_0xa362('0x2c')]=utils[_0xa362('0x21')]();channels[_0x29473b['uniqueid']][_0xa362('0x2d')]=utils[_0xa362('0x2e')](channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x2c')],channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x2f')]);channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x30')]=channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x24')]?utils['diffTime'](channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x2c')],channels[_0x29473b[_0xa362('0x6')]][_0xa362('0x24')]):0x0;writeDB(channels[_0x29473b['uniqueid']]);}}catch(_0x28261e){utils['error'](util[_0xa362('0x13')](_0xa362('0x28'),_0x29473b['uniqueid']),_0x28261e);}};exports['attendedtransfer']=function(_0x1bb624){try{if(!_['isNil'](channels[_0x1bb624[_0xa362('0x31')]])){utils[_0xa362('0x12')](util[_0xa362('0x13')](_0xa362('0x32'),_0x1bb624['origtransfereruniqueid']),_0x1bb624);if(channels[_0x1bb624['localtwolinkedid']][_0xa362('0x7')]==_0x1bb624['transfereechannel']){utils[_0xa362('0x4')](util[_0xa362('0x13')](_0xa362('0x33'),_0x1bb624['origtransfereruniqueid'],_0x1bb624['localtwolinkedid'],_0x1bb624[_0xa362('0x34')]));channels[_0x1bb624['localtwolinkedid']][_0xa362('0x35')]=_0x1bb624[_0xa362('0x34')];channels[_0x1bb624[_0xa362('0x31')]][_0xa362('0x36')]='_attended';}else if(channels[_0x1bb624[_0xa362('0x31')]][_0xa362('0x7')]=_0x1bb624[_0xa362('0x37')]){utils['info'](util[_0xa362('0x13')](_0xa362('0x33'),_0x1bb624[_0xa362('0x38')],_0x1bb624[_0xa362('0x31')],_0x1bb624[_0xa362('0x39')]));channels[_0x1bb624[_0xa362('0x31')]]['destinationchannel']=_0x1bb624[_0xa362('0x39')];channels[_0x1bb624[_0xa362('0x31')]][_0xa362('0x36')]=_0xa362('0x3a');}}}catch(_0x1b2d60){utils[_0xa362('0x1a')](util[_0xa362('0x13')](_0xa362('0x32'),_0x1bb624[_0xa362('0x38')]),_0x1b2d60);}};exports['musiconholdstart']=function(_0x4983ec){try{if(!_[_0xa362('0x20')](channels[_0x4983ec[_0xa362('0x6')]])){utils[_0xa362('0x12')](util[_0xa362('0x13')]('[%s][calls][musiconholdstart]',_0x4983ec[_0xa362('0x6')]),_0x4983ec);channels[_0x4983ec[_0xa362('0x6')]][_0xa362('0x3b')]=utils[_0xa362('0x21')]();utils[_0xa362('0x4')](util[_0xa362('0x13')](_0xa362('0x3c'),_0x4983ec[_0xa362('0x6')],channels[_0x4983ec['uniqueid']][_0xa362('0x3b')]));}}catch(_0x5bf87f){utils[_0xa362('0x1a')](util[_0xa362('0x13')](_0xa362('0x3d'),_0x4983ec['uniqueid']),_0x5bf87f);}};exports[_0xa362('0x3e')]=function(_0x1d995b){try{if(!_[_0xa362('0x20')](channels[_0x1d995b[_0xa362('0x6')]])){utils['debug'](util[_0xa362('0x13')](_0xa362('0x3f'),_0x1d995b[_0xa362('0x6')]),_0x1d995b);if(!_[_0xa362('0x20')](channels[_0x1d995b[_0xa362('0x6')]]['musiconholdstartAt'])){channels[_0x1d995b[_0xa362('0x6')]]['mohtime']+=utils[_0xa362('0x2e')](utils[_0xa362('0x21')](),channels[_0x1d995b[_0xa362('0x6')]][_0xa362('0x3b')]);utils[_0xa362('0x4')](util[_0xa362('0x13')](_0xa362('0x40'),_0x1d995b[_0xa362('0x6')],channels[_0x1d995b['uniqueid']][_0xa362('0x41')]));delete channels[_0x1d995b[_0xa362('0x6')]][_0xa362('0x3b')];}}}catch(_0x357268){utils[_0xa362('0x1a')](util[_0xa362('0x13')](_0xa362('0x3f'),_0x1d995b[_0xa362('0x6')]),_0x357268);}};exports[_0xa362('0x42')]=function(_0x1a3096){try{if(!_['isNil'](channels[_0x1a3096[_0xa362('0x6')]])){utils['debug'](util[_0xa362('0x13')](_0xa362('0x43'),_0x1a3096[_0xa362('0x6')]),_0x1a3096);if(!_['isNil'](_0x1a3096[_0xa362('0x44')]['xmd-originatecalleridnum'])){utils[_0xa362('0x4')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1a3096[_0xa362('0x6')],_0x1a3096[_0xa362('0x45')]));channels[_0x1a3096[_0xa362('0x6')]]['source']=_0x1a3096[_0xa362('0x45')];}if(!_[_0xa362('0x20')](_0x1a3096[_0xa362('0x44')][_0xa362('0x46')])){utils['info'](util[_0xa362('0x13')](_0xa362('0x47'),_0x1a3096[_0xa362('0x6')],_0x1a3096['value']));channels[_0x1a3096['uniqueid']][_0xa362('0x48')]=_0x1a3096[_0xa362('0x45')];channels[_0x1a3096['uniqueid']][_0xa362('0x29')]='\x22'+_0x1a3096['value']+_0xa362('0x49')+_0x1a3096[_0xa362('0x45')]+'>';}if(!_[_0xa362('0x20')](_0x1a3096[_0xa362('0x44')]['xmd-callerid-preview'])||!_[_0xa362('0x20')](_0x1a3096['variable']['xmd-callerid'])){utils[_0xa362('0x4')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x1a3096[_0xa362('0x6')],!_['isNil'](_0x1a3096['variable']['xmd-callerid-preview'])?_0xa362('0x4a'):_0xa362('0x4b'),_0x1a3096['value']));channels[_0x1a3096[_0xa362('0x6')]][_0xa362('0x29')]=_0x1a3096['value'];}if(!_[_0xa362('0x20')](_0x1a3096[_0xa362('0x44')][_0xa362('0x4c')])||!_[_0xa362('0x20')](_0x1a3096[_0xa362('0x44')][_0xa362('0x4d')])){utils[_0xa362('0x4')](util[_0xa362('0x13')](_0xa362('0x4e'),_0x1a3096[_0xa362('0x6')],!_['isNil'](_0x1a3096[_0xa362('0x44')][_0xa362('0x4c')])?_0xa362('0x4c'):_0xa362('0x4d'),_0x1a3096['value']));channels[_0x1a3096['uniqueid']]['lastapplication']=_0xa362('0x4f');channels[_0x1a3096[_0xa362('0x6')]][_0xa362('0x50')]=_0x1a3096[_0xa362('0x45')];channels[_0x1a3096[_0xa362('0x6')]][_0xa362('0x51')]=!![];}if(!_['isNil'](_0x1a3096[_0xa362('0x44')][_0xa362('0x52')])){utils[_0xa362('0x4')](util[_0xa362('0x13')](_0xa362('0x53'),_0x1a3096[_0xa362('0x6')],_0x1a3096[_0xa362('0x45')]));channels[_0x1a3096['uniqueid']][_0xa362('0x54')]=_0x1a3096[_0xa362('0x45')];}if(!_[_0xa362('0x20')](_0x1a3096[_0xa362('0x44')]['xmd-cdrtype'])){utils['info'](util['format'](_0xa362('0x55'),_0x1a3096['uniqueid'],_0x1a3096[_0xa362('0x45')]));channels[_0x1a3096[_0xa362('0x6')]]['type']=_0x1a3096[_0xa362('0x45')];}if(!_[_0xa362('0x20')](_0x1a3096[_0xa362('0x44')][_0xa362('0x56')])){utils['info'](util[_0xa362('0x13')](_0xa362('0x57'),_0x1a3096['uniqueid'],_0x1a3096[_0xa362('0x45')]));channels[_0x1a3096[_0xa362('0x6')]][_0xa362('0x58')]=_0x1a3096['value'];}if(!_[_0xa362('0x20')](_0x1a3096[_0xa362('0x44')][_0xa362('0x59')])){utils[_0xa362('0x4')](util['format'](_0xa362('0x5a'),_0x1a3096[_0xa362('0x6')],_0x1a3096[_0xa362('0x45')]));channels[_0x1a3096[_0xa362('0x6')]][_0xa362('0x59')]=_0x1a3096[_0xa362('0x45')];}}}catch(_0x1e63a9){utils[_0xa362('0x1a')](util[_0xa362('0x13')](_0xa362('0x43'),_0x1a3096[_0xa362('0x6')]),_0x1e63a9);}};exports[_0xa362('0x5b')]=function(_0x46bc5c){try{if(!_[_0xa362('0x20')](channels[_0x46bc5c[_0xa362('0x6')]])){utils[_0xa362('0x12')](util[_0xa362('0x13')](_0xa362('0x5c'),_0x46bc5c[_0xa362('0x6')]),_0x46bc5c);utils[_0xa362('0x4')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x46bc5c[_0xa362('0x6')],_0x46bc5c[_0xa362('0x5d')],_0x46bc5c[_0xa362('0x5e')]));if(_0x46bc5c[_0xa362('0x5d')][_0xa362('0x5f')]()==_0xa362('0x60')&&_[_0xa362('0x61')](_0x46bc5c[_0xa362('0x5e')][_0xa362('0x5f')](),'cdr')){var _0x3b8f33=_0x46bc5c[_0xa362('0x5e')][_0xa362('0x62')]('=');var _0x26dcab=_0x3b8f33[0x0]['substring'](_0x3b8f33[0x0][_0xa362('0x63')]('(')+0x1,_0x3b8f33[0x0][_0xa362('0x63')](')'));var _0x1e7bb9=_0x3b8f33[0x1];channels[_0x46bc5c[_0xa362('0x6')]][_0x26dcab]=_0x1e7bb9;}if(!_[_0xa362('0x64')]([_0xa362('0x27'),_0xa362('0x65'),'execif','set',_0xa362('0x66')],_0x46bc5c['application'][_0xa362('0x5f')]())){channels[_0x46bc5c[_0xa362('0x6')]]['lastapplication']=_0x46bc5c[_0xa362('0x5d')];channels[_0x46bc5c[_0xa362('0x6')]]['lastdata']=_0x46bc5c[_0xa362('0x5e')];}}}catch(_0x572d2d){utils[_0xa362('0x1a')](util['format'](_0xa362('0x5c'),_0x46bc5c[_0xa362('0x6')]),_0x572d2d);}}; \ No newline at end of file +var _0x17b0=['includes','noop','execif','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','interface','calleridnum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','channel','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','lastIndexOf'];(function(_0x3bc2b4,_0x26366e){var _0x3cac50=function(_0x592f61){while(--_0x592f61){_0x3bc2b4['push'](_0x3bc2b4['shift']());}};_0x3cac50(++_0x26366e);}(_0x17b0,0x1a8));var _0x017b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x17b0[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x017b('0x0'));var util=require(_0x017b('0x1'));var utils=require(_0x017b('0x2'));var dispositions=[_0x017b('0x3'),'FAILED',_0x017b('0x4'),'NO\x20ANSWER',_0x017b('0x3'),_0x017b('0x3'),_0x017b('0x5'),'BUSY','FAILED',_0x017b('0x4'),_0x017b('0x4')];var channels={};function writeDB(_0x407816){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x8'),_0x407816[_0x017b('0x9')],_0x407816['channel'],_0x407816['queue'],_0x407816['membername'],_0x407816[_0x017b('0xa')],_0x407816[_0x017b('0xb')],_0x407816['connectedlinenum'],_0x407816['lastevent']));if(_0x407816[_0x017b('0xc')]){utils[_0x017b('0xd')](_0x407816[_0x017b('0xc')])[_0x017b('0xe')](function(_0x3c01e1){if(_0x3c01e1){_0x407816[_0x017b('0xf')]=_0x3c01e1['id'];}utils[_0x017b('0x10')](_0x017b('0x11'),_0x407816);});}else{utils[_0x017b('0x10')](_0x017b('0x11'),_0x407816);}if(channels[_0x407816[_0x017b('0x9')]]){delete channels[_0x407816[_0x017b('0x9')]];}}exports['newchannel']=function(_0x4d9316){try{utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x13'),_0x4d9316['uniqueid']),_0x4d9316);if(_0x4d9316[_0x017b('0x9')]==_0x4d9316[_0x017b('0x14')]&&_0x4d9316[_0x017b('0x15')]!='OutgoingSpoolFailed'){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x16'),_0x4d9316['uniqueid'],_0x4d9316[_0x017b('0x17')],_0x4d9316[_0x017b('0x18')]));channels[_0x4d9316['uniqueid']]={'uniqueid':_0x4d9316[_0x017b('0x9')],'accountcode':_0x4d9316['accountcode'],'source':_0x4d9316[_0x017b('0xb')],'destination':_0x4d9316[_0x017b('0x18')],'destinationcontext':_0x4d9316[_0x017b('0x17')],'channel':_0x4d9316[_0x017b('0x15')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x017b('0x3'),'amaflags':_0x017b('0x19')};}}catch(_0x33c963){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x13'),_0x4d9316[_0x017b('0x9')]),_0x33c963);}};exports[_0x017b('0x1b')]=function(_0xadd9db){try{utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x1c'),_0xadd9db['uniqueid']),_0xadd9db);if(!_[_0x017b('0x1d')](channels[_0xadd9db['uniqueid']])&&_0xadd9db[_0x017b('0x1e')]==0x6){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x1f'),_0xadd9db[_0x017b('0x9')],_0xadd9db[_0x017b('0x17')],_0xadd9db[_0x017b('0x15')]));if(_[_0x017b('0x1d')](channels[_0xadd9db[_0x017b('0x9')]]['systemanswertime'])){channels[_0xadd9db[_0x017b('0x9')]]['systemanswertime']=utils['now']();}}else if(!_['isNil'](channels[_0xadd9db[_0x017b('0x14')]])&&_0xadd9db[_0x017b('0x1e')]==0x6&&_0xadd9db[_0x017b('0x17')]!=_0x017b('0x20')){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x21'),_0xadd9db[_0x017b('0x9')],_0xadd9db['linkedid'],_0xadd9db[_0x017b('0x17')],_0xadd9db[_0x017b('0x15')]));channels[_0xadd9db[_0x017b('0x14')]][_0x017b('0xc')]=_0xadd9db[_0x017b('0xc')];channels[_0xadd9db[_0x017b('0x14')]][_0x017b('0x22')]=_0xadd9db[_0x017b('0x15')];if(_['isNil'](channels[_0xadd9db['linkedid']][_0x017b('0x23')])){channels[_0xadd9db['linkedid']][_0x017b('0x23')]=utils[_0x017b('0x24')]();}channels[_0xadd9db[_0x017b('0x14')]][_0x017b('0x25')]=dispositions[_[_0x017b('0x26')](_0xadd9db[_0x017b('0x1e')])]||'ANSWERED';}}catch(_0x3a35e7){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x1c'),_0xadd9db[_0x017b('0x9')]),_0x3a35e7);}};exports[_0x017b('0x27')]=function(_0x1e0f3a){try{if(!_[_0x017b('0x1d')](channels[_0x1e0f3a[_0x017b('0x9')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x28'),_0x1e0f3a[_0x017b('0x9')]),_0x1e0f3a);if(_[_0x017b('0x1d')](channels[_0x1e0f3a['uniqueid']][_0x017b('0x29')])){channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x29')]=_0x1e0f3a[_0x017b('0x2a')]+'\x20<'+_0x1e0f3a['calleridnum']+'>';}utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x2b'),_0x1e0f3a[_0x017b('0x9')],channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x29')],_0x1e0f3a[_0x017b('0x2c')]));channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x2d')]=utils[_0x017b('0x24')]();channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x2e')]=utils['diffTime'](channels[_0x1e0f3a['uniqueid']]['endtime'],channels[_0x1e0f3a[_0x017b('0x9')]][_0x017b('0x2f')]);channels[_0x1e0f3a['uniqueid']][_0x017b('0x30')]=channels[_0x1e0f3a[_0x017b('0x9')]]['answertime']?utils[_0x017b('0x31')](channels[_0x1e0f3a['uniqueid']][_0x017b('0x2d')],channels[_0x1e0f3a[_0x017b('0x9')]]['answertime']):0x0;writeDB(channels[_0x1e0f3a['uniqueid']]);}}catch(_0x11f746){utils[_0x017b('0x1a')](util[_0x017b('0x7')]('[%s][calls][hangup]',_0x1e0f3a['uniqueid']),_0x11f746);}};exports[_0x017b('0x32')]=function(_0x2fa9d4){try{if(!_[_0x017b('0x1d')](channels[_0x2fa9d4[_0x017b('0x33')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')]('[%s][calls][attendedtransfer]',_0x2fa9d4[_0x017b('0x34')]),_0x2fa9d4);if(channels[_0x2fa9d4['localtwolinkedid']][_0x017b('0x15')]==_0x2fa9d4['transfereechannel']){utils[_0x017b('0x6')](util['format'](_0x017b('0x35'),_0x2fa9d4[_0x017b('0x34')],_0x2fa9d4[_0x017b('0x33')],_0x2fa9d4['secondtransfererchannel']));channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x22')]=_0x2fa9d4[_0x017b('0x36')];channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x37')]=_0x017b('0x38');}else if(channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x15')]=_0x2fa9d4[_0x017b('0x39')]){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2fa9d4[_0x017b('0x34')],_0x2fa9d4[_0x017b('0x33')],_0x2fa9d4[_0x017b('0x3a')]));channels[_0x2fa9d4[_0x017b('0x33')]][_0x017b('0x22')]=_0x2fa9d4[_0x017b('0x3a')];channels[_0x2fa9d4[_0x017b('0x33')]]['userfield']=_0x017b('0x38');}}}catch(_0x3df30b){utils['error'](util['format'](_0x017b('0x3b'),_0x2fa9d4['origtransfereruniqueid']),_0x3df30b);}};exports[_0x017b('0x3c')]=function(_0x8372bd){try{if(!_[_0x017b('0x1d')](channels[_0x8372bd['uniqueid']])){utils['debug'](util[_0x017b('0x7')]('[%s][calls][musiconholdstart]',_0x8372bd['uniqueid']),_0x8372bd);channels[_0x8372bd[_0x017b('0x9')]][_0x017b('0x3d')]=utils['now']();utils['info'](util['format'](_0x017b('0x3e'),_0x8372bd[_0x017b('0x9')],channels[_0x8372bd['uniqueid']][_0x017b('0x3d')]));}}catch(_0x3913fb){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x3f'),_0x8372bd['uniqueid']),_0x3913fb);}};exports[_0x017b('0x40')]=function(_0x5e84b3){try{if(!_[_0x017b('0x1d')](channels[_0x5e84b3[_0x017b('0x9')]])){utils[_0x017b('0x12')](util['format'](_0x017b('0x41'),_0x5e84b3[_0x017b('0x9')]),_0x5e84b3);if(!_[_0x017b('0x1d')](channels[_0x5e84b3['uniqueid']][_0x017b('0x3d')])){channels[_0x5e84b3[_0x017b('0x9')]][_0x017b('0x42')]+=utils[_0x017b('0x31')](utils['now'](),channels[_0x5e84b3[_0x017b('0x9')]]['musiconholdstartAt']);utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x43'),_0x5e84b3[_0x017b('0x9')],channels[_0x5e84b3['uniqueid']][_0x017b('0x42')]));delete channels[_0x5e84b3[_0x017b('0x9')]]['musiconholdstartAt'];}}}catch(_0x439c88){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x41'),_0x5e84b3['uniqueid']),_0x439c88);}};exports[_0x017b('0x44')]=function(_0x25145b){try{if(!_[_0x017b('0x1d')](channels[_0x25145b[_0x017b('0x9')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')](_0x017b('0x45'),_0x25145b['uniqueid']),_0x25145b);if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x47')])){utils['info'](util[_0x017b('0x7')](_0x017b('0x48'),_0x25145b['uniqueid'],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x4a')]=_0x25145b['value'];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x4b')])){utils[_0x017b('0x6')](util['format'](_0x017b('0x4c'),_0x25145b[_0x017b('0x9')],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x4d')]=_0x25145b['value'];channels[_0x25145b['uniqueid']][_0x017b('0x29')]='\x22'+_0x25145b['value']+_0x017b('0x4e')+_0x25145b[_0x017b('0x49')]+'>';}if(!_['isNil'](_0x25145b['variable'][_0x017b('0x4f')])||!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')]['xmd-callerid'])){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x50'),_0x25145b[_0x017b('0x9')],!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x4f')])?_0x017b('0x4f'):'xmd-callerid',_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]]['callerid']=_0x25145b[_0x017b('0x49')];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x51')])||!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x52')])){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x50'),_0x25145b[_0x017b('0x9')],!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x51')])?_0x017b('0x51'):_0x017b('0x52'),_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x53')]='Queue';channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x54')]=_0x25145b[_0x017b('0x49')];channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x55')]=!![];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')]['xmd-contactid'])){utils['info'](util[_0x017b('0x7')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x25145b[_0x017b('0x9')],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]][_0x017b('0x56')]=_0x25145b[_0x017b('0x49')];}if(!_['isNil'](_0x25145b[_0x017b('0x46')][_0x017b('0x57')])){utils['info'](util[_0x017b('0x7')](_0x017b('0x58'),_0x25145b[_0x017b('0x9')],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]]['type']=_0x25145b[_0x017b('0x49')];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')]['outboundrouteid'])){utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x59'),_0x25145b[_0x017b('0x9')],_0x25145b['value']));channels[_0x25145b['uniqueid']][_0x017b('0x5a')]=_0x25145b['value'];}if(!_[_0x017b('0x1d')](_0x25145b[_0x017b('0x46')][_0x017b('0x5b')])){utils[_0x017b('0x6')](util['format'](_0x017b('0x5c'),_0x25145b['uniqueid'],_0x25145b[_0x017b('0x49')]));channels[_0x25145b[_0x017b('0x9')]]['sipcallid']=_0x25145b[_0x017b('0x49')];}}}catch(_0x12ddc0){utils[_0x017b('0x1a')](util[_0x017b('0x7')](_0x017b('0x45'),_0x25145b[_0x017b('0x9')]),_0x12ddc0);}};exports['newexten']=function(_0x562aee){try{if(!_['isNil'](channels[_0x562aee[_0x017b('0x9')]])){utils[_0x017b('0x12')](util[_0x017b('0x7')]('[%s][calls][newexten]',_0x562aee['uniqueid']),_0x562aee);utils[_0x017b('0x6')](util[_0x017b('0x7')](_0x017b('0x5d'),_0x562aee[_0x017b('0x9')],_0x562aee[_0x017b('0x5e')],_0x562aee[_0x017b('0x5f')]));if(_0x562aee[_0x017b('0x5e')]['toLowerCase']()==_0x017b('0x60')&&_[_0x017b('0x61')](_0x562aee[_0x017b('0x5f')][_0x017b('0x62')](),'cdr')){var _0x629479=_0x562aee[_0x017b('0x5f')][_0x017b('0x63')]('=');var _0x24bc52=_0x629479[0x0]['substring'](_0x629479[0x0]['lastIndexOf']('(')+0x1,_0x629479[0x0][_0x017b('0x64')](')'));var _0x4ad462=_0x629479[0x1];channels[_0x562aee[_0x017b('0x9')]][_0x24bc52]=_0x4ad462;}if(!_[_0x017b('0x65')]([_0x017b('0x27'),_0x017b('0x66'),_0x017b('0x67'),_0x017b('0x60'),'gotoif'],_0x562aee[_0x017b('0x5e')][_0x017b('0x62')]())){channels[_0x562aee[_0x017b('0x9')]][_0x017b('0x53')]=_0x562aee['application'];channels[_0x562aee[_0x017b('0x9')]][_0x017b('0x54')]=_0x562aee[_0x017b('0x5f')];}}}catch(_0x4e8b4d){utils['error'](util['format'](_0x017b('0x68'),_0x562aee['uniqueid']),_0x4e8b4d);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 8225ec0..b297275 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 _0x90ee=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x3c54d3,_0x9719e3){var _0xd67c8f=function(_0x4be75d){while(--_0x4be75d){_0x3c54d3['push'](_0x3c54d3['shift']());}};_0xd67c8f(++_0x9719e3);}(_0x90ee,0xd9));var _0xe90e=function(_0x503be0,_0x254ab5){_0x503be0=_0x503be0-0x0;var _0x2300f6=_0x90ee[_0x503be0];return _0x2300f6;};'use strict';var utils=require(_0xe90e('0x0'));exports[_0xe90e('0x1')]=function(){utils[_0xe90e('0x2')](_0xe90e('0x3'));};exports[_0xe90e('0x4')]=function(){utils[_0xe90e('0x2')](_0xe90e('0x5'));};exports['fullybooted']=function(){utils[_0xe90e('0x2')](_0xe90e('0x6'));};exports['error']=function(_0x3c7a1a){utils[_0xe90e('0x7')](_0xe90e('0x8'),_0x3c7a1a);};exports[_0xe90e('0x9')]=function(){utils[_0xe90e('0x2')](_0xe90e('0xa'));};exports[_0xe90e('0xb')]=function(_0x288668){}; \ No newline at end of file +var _0xa110=['fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','[core]\x20connected','info','[core]\x20shutdown'];(function(_0x290a56,_0x5c540a){var _0x89610=function(_0x4e901f){while(--_0x4e901f){_0x290a56['push'](_0x290a56['shift']());}};_0x89610(++_0x5c540a);}(_0xa110,0x19e));var _0x0a11=function(_0x5260b2,_0x1d6180){_0x5260b2=_0x5260b2-0x0;var _0x3a586b=_0xa110[_0x5260b2];return _0x3a586b;};'use strict';var utils=require(_0x0a11('0x0'));exports['connect']=function(){utils['info'](_0x0a11('0x1'));};exports['shutdown']=function(){utils[_0x0a11('0x2')](_0x0a11('0x3'));};exports[_0x0a11('0x4')]=function(){utils[_0x0a11('0x2')](_0x0a11('0x5'));};exports['error']=function(_0x2c14e8){utils[_0x0a11('0x6')](_0x0a11('0x7'),_0x2c14e8);};exports[_0x0a11('0x8')]=function(){utils[_0x0a11('0x2')](_0x0a11('0x9'));};exports[_0x0a11('0xa')]=function(_0x16d1a2){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 7dbb5c3..63da4e8 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 _0xba5a=['connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','util','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','newexten','debug','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','ANSWER','answertime'];(function(_0x1301aa,_0x4da5c4){var _0x5146a1=function(_0x417cd1){while(--_0x417cd1){_0x1301aa['push'](_0x1301aa['shift']());}};_0x5146a1(++_0x4da5c4);}(_0xba5a,0x6b));var _0xaba5=function(_0x10244a,_0x3e96f4){_0x10244a=_0x10244a-0x0;var _0x4daacd=_0xba5a[_0x10244a];return _0x4daacd;};'use strict';var _=require('lodash');var util=require(_0xaba5('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x5e5f82){utils['info'](util[_0xaba5('0x1')](_0xaba5('0x2'),_0x5e5f82[_0xaba5('0x3')],_0x5e5f82['channel'],_0x5e5f82[_0xaba5('0x4')],_0x5e5f82[_0xaba5('0x5')],_0x5e5f82['connectedlinenum'],_0x5e5f82[_0xaba5('0x6')]));utils['request'](_0xaba5('0x7'),_0x5e5f82);delete dials[_0x5e5f82[_0xaba5('0x3')]];}exports[_0xaba5('0x8')]=function(_0x48d762){try{utils[_0xaba5('0x9')](util[_0xaba5('0x1')]('[%s][dials][newexten]',_0x48d762[_0xaba5('0x3')]),_0x48d762);utils[_0xaba5('0xa')](util[_0xaba5('0x1')](_0xaba5('0xb'),_0x48d762['uniqueid'],_0x48d762[_0xaba5('0xc')],_0x48d762[_0xaba5('0xd')]));if(_0x48d762['application'][_0xaba5('0xe')]()==_0xaba5('0xf')&&_[_0xaba5('0x10')](_0x48d762[_0xaba5('0xd')][_0xaba5('0xe')](),_0xaba5('0x11'))){var _0x48555c=_0x48d762[_0xaba5('0xd')][_0xaba5('0x12')]('=');dials[_0x48d762['uniqueid']]={'routeId':_0x48555c[0x1]};}}catch(_0x4ab0c0){utils[_0xaba5('0x13')](util['format']('[%s][dials][newexten]',_0x48d762['uniqueid']),_0x4ab0c0);}};exports['varset']=function(_0x57f6e5){try{utils['debug'](util[_0xaba5('0x1')](_0xaba5('0x14'),_0x57f6e5[_0xaba5('0x3')]),_0x57f6e5);if(!_[_0xaba5('0x15')](_0x57f6e5[_0xaba5('0x16')][_0xaba5('0x17')])){utils[_0xaba5('0xa')](util[_0xaba5('0x1')](_0xaba5('0x18'),_0x57f6e5[_0xaba5('0x3')],_0x57f6e5[_0xaba5('0x19')]));dials[_0x57f6e5[_0xaba5('0x3')]]={'routeId':_0x57f6e5[_0xaba5('0x19')]};}}catch(_0x3e0768){utils[_0xaba5('0x13')](util[_0xaba5('0x1')](_0xaba5('0x14'),_0x57f6e5[_0xaba5('0x3')]),_0x3e0768);}};exports[_0xaba5('0x1a')]=function(_0x5f21d2){try{if(!_[_0xaba5('0x15')](dials[_0x5f21d2[_0xaba5('0x3')]])){utils[_0xaba5('0x9')](util[_0xaba5('0x1')](_0xaba5('0x1b'),_0x5f21d2[_0xaba5('0x3')]),_0x5f21d2);dials[_0x5f21d2[_0xaba5('0x3')]]=_[_0xaba5('0x1c')](dials[_0x5f21d2['uniqueid']],_0x5f21d2);dials[_0x5f21d2[_0xaba5('0x3')]]['starttime']=utils[_0xaba5('0x1d')]();dials[_0x5f21d2[_0xaba5('0x3')]]['lastevent']=_0xaba5('0x1e');utils['info'](util[_0xaba5('0x1')](_0xaba5('0x1f'),_0x5f21d2[_0xaba5('0x3')],dials[_0x5f21d2[_0xaba5('0x3')]][_0xaba5('0x20')]));}}catch(_0x48b646){utils['error'](util[_0xaba5('0x1')](_0xaba5('0x1b'),_0x5f21d2[_0xaba5('0x3')]),_0x48b646);}};exports[_0xaba5('0x21')]=function(_0x59f3de){try{if(!_['isNil'](dials[_0x59f3de['uniqueid']])){utils['debug'](util['format'](_0xaba5('0x22'),_0x59f3de[_0xaba5('0x3')]),_0x59f3de);dials[_0x59f3de[_0xaba5('0x3')]][_0xaba5('0x6')]=_0x59f3de[_0xaba5('0x6')];if(_0x59f3de[_0xaba5('0x6')]==_0xaba5('0x23')){dials[_0x59f3de[_0xaba5('0x3')]]=_[_0xaba5('0x1c')](dials[_0x59f3de[_0xaba5('0x3')]],_0x59f3de);dials[_0x59f3de['uniqueid']][_0xaba5('0x24')]=utils[_0xaba5('0x1d')]();dials[_0x59f3de[_0xaba5('0x3')]]['lastevent']=_0xaba5('0x25');utils['info'](util[_0xaba5('0x1')](_0xaba5('0x26'),_0x59f3de['uniqueid'],_0x59f3de[_0xaba5('0x6')],dials[_0x59f3de[_0xaba5('0x3')]][_0xaba5('0x24')]));}else{utils[_0xaba5('0xa')](util['format'](_0xaba5('0x27'),_0x59f3de[_0xaba5('0x3')],_0x59f3de[_0xaba5('0x6')]));}}}catch(_0x2125af){utils[_0xaba5('0x13')](util[_0xaba5('0x1')](_0xaba5('0x22'),_0x59f3de[_0xaba5('0x3')]),_0x2125af);}};exports[_0xaba5('0x28')]=function(_0x1158d3){try{if(!_['isNil'](dials[_0x1158d3[_0xaba5('0x3')]])){utils[_0xaba5('0x9')](util[_0xaba5('0x1')]('[%s][dials][hangup]',_0x1158d3[_0xaba5('0x3')]),_0x1158d3);utils[_0xaba5('0xa')](util[_0xaba5('0x1')](_0xaba5('0x29'),_0x1158d3['uniqueid'],_0x1158d3[_0xaba5('0x5')],_0x1158d3[_0xaba5('0x2a')],_0x1158d3[_0xaba5('0x2b')]));dials[_0x1158d3['uniqueid']]=_[_0xaba5('0x1c')](dials[_0x1158d3[_0xaba5('0x3')]],{'endtime':utils[_0xaba5('0x1d')](),'lastevent':'complete'});dials[_0x1158d3['uniqueid']][_0xaba5('0x2c')]=utils[_0xaba5('0x2d')](dials[_0x1158d3[_0xaba5('0x3')]][_0xaba5('0x2e')],dials[_0x1158d3[_0xaba5('0x3')]]['starttime']);dials[_0x1158d3[_0xaba5('0x3')]][_0xaba5('0x2f')]=utils[_0xaba5('0x2d')](dials[_0x1158d3[_0xaba5('0x3')]][_0xaba5('0x24')]||dials[_0x1158d3[_0xaba5('0x3')]][_0xaba5('0x2e')],dials[_0x1158d3['uniqueid']]['starttime']);dials[_0x1158d3['uniqueid']]['billableseconds']=dials[_0x1158d3[_0xaba5('0x3')]]['answertime']?utils[_0xaba5('0x2d')](dials[_0x1158d3[_0xaba5('0x3')]]['endtime'],dials[_0x1158d3[_0xaba5('0x3')]][_0xaba5('0x24')]):0x0;writeDB(dials[_0x1158d3['uniqueid']]);}}catch(_0x242fc1){utils[_0xaba5('0x13')](util[_0xaba5('0x1')]('[%s][dials][hangup]',_0x1158d3['uniqueid']),_0x242fc1);}}; \ No newline at end of file +var _0xb1a3=['[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','endtime','holdtime','billableseconds','util','info','format','uniqueid','dialstring','calleridnum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]'];(function(_0x53de3a,_0x349a45){var _0x54fd22=function(_0x3188d6){while(--_0x3188d6){_0x53de3a['push'](_0x53de3a['shift']());}};_0x54fd22(++_0x349a45);}(_0xb1a3,0x1c1));var _0x3b1a=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xb1a3[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require(_0x3b1a('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x26943d){utils[_0x3b1a('0x1')](util[_0x3b1a('0x2')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x26943d[_0x3b1a('0x3')],_0x26943d['channel'],_0x26943d[_0x3b1a('0x4')],_0x26943d[_0x3b1a('0x5')],_0x26943d['connectedlinenum'],_0x26943d['dialstatus']));utils[_0x3b1a('0x6')](_0x3b1a('0x7'),_0x26943d);delete dials[_0x26943d[_0x3b1a('0x3')]];}exports['newexten']=function(_0x3ffa9c){try{utils[_0x3b1a('0x8')](util[_0x3b1a('0x2')](_0x3b1a('0x9'),_0x3ffa9c[_0x3b1a('0x3')]),_0x3ffa9c);utils['info'](util[_0x3b1a('0x2')](_0x3b1a('0xa'),_0x3ffa9c[_0x3b1a('0x3')],_0x3ffa9c['application'],_0x3ffa9c[_0x3b1a('0xb')]));if(_0x3ffa9c[_0x3b1a('0xc')]['toLowerCase']()==_0x3b1a('0xd')&&_[_0x3b1a('0xe')](_0x3ffa9c[_0x3b1a('0xb')][_0x3b1a('0xf')](),_0x3b1a('0x10'))){var _0x2afc24=_0x3ffa9c[_0x3b1a('0xb')][_0x3b1a('0x11')]('=');dials[_0x3ffa9c[_0x3b1a('0x3')]]={'routeId':_0x2afc24[0x1]};}}catch(_0x4fe7d8){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')]('[%s][dials][newexten]',_0x3ffa9c['uniqueid']),_0x4fe7d8);}};exports[_0x3b1a('0x13')]=function(_0x223463){try{utils['debug'](util[_0x3b1a('0x2')](_0x3b1a('0x14'),_0x223463['uniqueid']),_0x223463);if(!_[_0x3b1a('0x15')](_0x223463[_0x3b1a('0x16')][_0x3b1a('0x17')])){utils[_0x3b1a('0x1')](util['format'](_0x3b1a('0x18'),_0x223463[_0x3b1a('0x3')],_0x223463['value']));dials[_0x223463[_0x3b1a('0x3')]]={'routeId':_0x223463[_0x3b1a('0x19')]};}}catch(_0x12894e){utils['error'](util['format'](_0x3b1a('0x14'),_0x223463[_0x3b1a('0x3')]),_0x12894e);}};exports[_0x3b1a('0x1a')]=function(_0x519dc1){try{if(!_['isNil'](dials[_0x519dc1[_0x3b1a('0x3')]])){utils[_0x3b1a('0x8')](util[_0x3b1a('0x2')](_0x3b1a('0x1b'),_0x519dc1[_0x3b1a('0x3')]),_0x519dc1);dials[_0x519dc1[_0x3b1a('0x3')]]=_[_0x3b1a('0x1c')](dials[_0x519dc1[_0x3b1a('0x3')]],_0x519dc1);dials[_0x519dc1['uniqueid']][_0x3b1a('0x1d')]=utils[_0x3b1a('0x1e')]();dials[_0x519dc1['uniqueid']][_0x3b1a('0x1f')]='called';utils[_0x3b1a('0x1')](util['format'](_0x3b1a('0x20'),_0x519dc1[_0x3b1a('0x3')],dials[_0x519dc1[_0x3b1a('0x3')]][_0x3b1a('0x1d')]));}}catch(_0x279c17){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')](_0x3b1a('0x1b'),_0x519dc1['uniqueid']),_0x279c17);}};exports[_0x3b1a('0x21')]=function(_0xcee4f){try{if(!_[_0x3b1a('0x15')](dials[_0xcee4f[_0x3b1a('0x3')]])){utils[_0x3b1a('0x8')](util[_0x3b1a('0x2')](_0x3b1a('0x22'),_0xcee4f[_0x3b1a('0x3')]),_0xcee4f);dials[_0xcee4f[_0x3b1a('0x3')]]['dialstatus']=_0xcee4f[_0x3b1a('0x23')];if(_0xcee4f[_0x3b1a('0x23')]==_0x3b1a('0x24')){dials[_0xcee4f[_0x3b1a('0x3')]]=_['assign'](dials[_0xcee4f['uniqueid']],_0xcee4f);dials[_0xcee4f['uniqueid']][_0x3b1a('0x25')]=utils[_0x3b1a('0x1e')]();dials[_0xcee4f['uniqueid']][_0x3b1a('0x1f')]=_0x3b1a('0x26');utils[_0x3b1a('0x1')](util[_0x3b1a('0x2')](_0x3b1a('0x27'),_0xcee4f['uniqueid'],_0xcee4f[_0x3b1a('0x23')],dials[_0xcee4f['uniqueid']]['answertime']));}else{utils[_0x3b1a('0x1')](util[_0x3b1a('0x2')](_0x3b1a('0x28'),_0xcee4f[_0x3b1a('0x3')],_0xcee4f[_0x3b1a('0x23')]));}}}catch(_0x485d00){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')](_0x3b1a('0x22'),_0xcee4f[_0x3b1a('0x3')]),_0x485d00);}};exports[_0x3b1a('0x29')]=function(_0x2e71e6){try{if(!_[_0x3b1a('0x15')](dials[_0x2e71e6[_0x3b1a('0x3')]])){utils[_0x3b1a('0x8')](util['format'](_0x3b1a('0x2a'),_0x2e71e6[_0x3b1a('0x3')]),_0x2e71e6);utils[_0x3b1a('0x1')](util['format'](_0x3b1a('0x2b'),_0x2e71e6[_0x3b1a('0x3')],_0x2e71e6[_0x3b1a('0x5')],_0x2e71e6[_0x3b1a('0x2c')],_0x2e71e6[_0x3b1a('0x2d')]));dials[_0x2e71e6[_0x3b1a('0x3')]]=_['assign'](dials[_0x2e71e6[_0x3b1a('0x3')]],{'endtime':utils[_0x3b1a('0x1e')](),'lastevent':'complete'});dials[_0x2e71e6['uniqueid']][_0x3b1a('0x2e')]=utils[_0x3b1a('0x2f')](dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x30')],dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x1d')]);dials[_0x2e71e6['uniqueid']][_0x3b1a('0x31')]=utils['diffTime'](dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x25')]||dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x30')],dials[_0x2e71e6[_0x3b1a('0x3')]]['starttime']);dials[_0x2e71e6['uniqueid']][_0x3b1a('0x32')]=dials[_0x2e71e6[_0x3b1a('0x3')]]['answertime']?utils[_0x3b1a('0x2f')](dials[_0x2e71e6['uniqueid']][_0x3b1a('0x30')],dials[_0x2e71e6[_0x3b1a('0x3')]][_0x3b1a('0x25')]):0x0;writeDB(dials[_0x2e71e6[_0x3b1a('0x3')]]);}}catch(_0x560d97){utils[_0x3b1a('0x12')](util[_0x3b1a('0x2')](_0x3b1a('0x2a'),_0x2e71e6[_0x3b1a('0x3')]),_0x560d97);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 111654a..195adcf 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 _0x90ee=['./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','xdr','disabled','env','production','local','asterisk','port','password','keepConnected','XDR\x20DISABLED','./agents.controller','./members.controller'];(function(_0x42cbb6,_0x16680a){var _0x516d69=function(_0x3c58ec){while(--_0x3c58ec){_0x42cbb6['push'](_0x42cbb6['shift']());}};_0x516d69(++_0x16680a);}(_0x90ee,0xb8));var _0xe90e=function(_0x3d7022,_0x59dfd5){_0x3d7022=_0x3d7022-0x0;var _0x40870b=_0x90ee[_0x3d7022];return _0x40870b;};var AsteriskManager=require(_0xe90e('0x0'));var config=require('../../config/environment');var utils=require(_0xe90e('0x1'));var util=require('util');var isXDREnabled=config[_0xe90e('0x2')]&&config[_0xe90e('0x2')][_0xe90e('0x3')]?!config[_0xe90e('0x2')]['disabled']:!![];var isProduction=config[_0xe90e('0x4')]===_0xe90e('0x5')||![];var isLocalAsterisk=config[_0xe90e('0x2')]&&config[_0xe90e('0x2')][_0xe90e('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xe90e('0x7')][_0xe90e('0x8')],config[_0xe90e('0x7')]['ip'],config[_0xe90e('0x7')]['username'],config['asterisk'][_0xe90e('0x9')],!![]);ami[_0xe90e('0xa')]();if(!isXDREnabled){utils['info'](_0xe90e('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xe90e('0xc'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0xe90e('0xd'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xe90e('0xe'));ami['on'](_0xe90e('0xf'),core[_0xe90e('0xf')]);ami['on'](_0xe90e('0x10'),core['shutdown']);ami['on'](_0xe90e('0x11'),core[_0xe90e('0x11')]);ami['on'](_0xe90e('0x12'),core[_0xe90e('0x12')]);ami['on'](_0xe90e('0x13'),core[_0xe90e('0x13')]);ami['on'](_0xe90e('0x14'),core[_0xe90e('0x14')]);ami['on'](_0xe90e('0x15'),function(_0x156a96){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')](_0xe90e('0x18'),_0x156a96[_0xe90e('0x19')]),_0x156a96);members[_0xe90e('0x15')](_0x156a96);}catch(_0x38714f){utils['error'](util[_0xe90e('0x17')](_0xe90e('0x18'),_0x156a96[_0xe90e('0x19')]),_0x38714f);}});ami['on'](_0xe90e('0x1a'),function(_0x41a9dc){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')]('[%s][index][agentcalled]',_0x41a9dc[_0xe90e('0x1b')]),_0x41a9dc);agents['agentcalled'](_0x41a9dc);}catch(_0x1d911b){utils[_0xe90e('0x12')](util[_0xe90e('0x17')]('[%s][index][agentcalled]',_0x41a9dc[_0xe90e('0x1b')]),_0x1d911b);}});ami['on'](_0xe90e('0x1c'),function(_0x55f2dd){try{utils[_0xe90e('0x16')](util['format'](_0xe90e('0x1d'),_0x55f2dd['uniqueid']),_0x55f2dd);agents[_0xe90e('0x1c')](_0x55f2dd);}catch(_0x1268ec){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x1d'),_0x55f2dd[_0xe90e('0x1b')]),_0x1268ec);}});ami['on'](_0xe90e('0x1e'),function(_0x48983c){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')](_0xe90e('0x1f'),_0x48983c[_0xe90e('0x1b')]),_0x48983c);agents['agentconnect'](_0x48983c);queues[_0xe90e('0x1e')](_0x48983c);}catch(_0x4afa77){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x1f'),_0x48983c[_0xe90e('0x1b')]),_0x4afa77);}});ami['on']('agentcomplete',function(_0x2f32c5){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')](_0xe90e('0x20'),_0x2f32c5[_0xe90e('0x1b')]),_0x2f32c5);agents[_0xe90e('0x21')](_0x2f32c5);queues[_0xe90e('0x21')](_0x2f32c5);members[_0xe90e('0x21')](_0x2f32c5);}catch(_0x1b616d){utils['error'](util[_0xe90e('0x17')](_0xe90e('0x20'),_0x2f32c5['uniqueid']),_0x1b616d);}});ami['on'](_0xe90e('0x22'),function(_0x42530b){try{utils[_0xe90e('0x16')](util['format'](_0xe90e('0x23'),_0x42530b[_0xe90e('0x1b')]),_0x42530b);agents[_0xe90e('0x22')](_0x42530b);queues[_0xe90e('0x22')](_0x42530b);}catch(_0x5031c4){utils[_0xe90e('0x12')](util[_0xe90e('0x17')]('[%s][index][queuecallerabandon]',_0x42530b['uniqueid']),_0x5031c4);}});ami['on'](_0xe90e('0x24'),function(_0x4a0290){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')]('[%s][index][queuecallerjoin]',_0x4a0290['uniqueid']),_0x4a0290);queues[_0xe90e('0x24')](_0x4a0290);recordings[_0xe90e('0x24')](_0x4a0290);}catch(_0x5edaea){utils['error'](util[_0xe90e('0x17')](_0xe90e('0x25'),_0x4a0290[_0xe90e('0x1b')]),_0x5edaea);}});ami['on'](_0xe90e('0x26'),function(_0x225f8e){try{utils['debug'](util[_0xe90e('0x17')]('[%s][index][queuecallerleave]',_0x225f8e[_0xe90e('0x1b')]),_0x225f8e);queues[_0xe90e('0x26')](_0x225f8e);}catch(_0x432bfb){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x27'),_0x225f8e['uniqueid']),_0x432bfb);}});ami['on'](_0xe90e('0x28'),function(_0x555f81){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')]('[%s][index][musiconholdstart]',_0x555f81[_0xe90e('0x1b')]),_0x555f81);queues[_0xe90e('0x28')](_0x555f81);calls[_0xe90e('0x28')](_0x555f81);}catch(_0x15e9a6){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x29'),_0x555f81[_0xe90e('0x1b')]),_0x15e9a6);}});ami['on'](_0xe90e('0x2a'),function(_0x34914f){try{utils[_0xe90e('0x16')](util['format'](_0xe90e('0x2b'),_0x34914f[_0xe90e('0x1b')]),_0x34914f);queues[_0xe90e('0x2a')](_0x34914f);calls[_0xe90e('0x2a')](_0x34914f);}catch(_0x2c2479){utils[_0xe90e('0x12')](util['format'](_0xe90e('0x2b'),_0x34914f[_0xe90e('0x1b')]),_0x2c2479);}});ami['on']('newstate',function(_0xc390e3){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')](_0xe90e('0x2c'),_0xc390e3[_0xe90e('0x1b')]),_0xc390e3);calls[_0xe90e('0x2d')](_0xc390e3);recordings[_0xe90e('0x2d')](_0xc390e3);}catch(_0x333778){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x2c'),_0xc390e3[_0xe90e('0x1b')]),_0x333778);}});ami['on']('hangup',function(_0x2585a5){try{utils['debug'](util[_0xe90e('0x17')](_0xe90e('0x2e'),_0x2585a5['uniqueid']),_0x2585a5);calls[_0xe90e('0x2f')](_0x2585a5);recordings[_0xe90e('0x2f')](_0x2585a5);dials[_0xe90e('0x2f')](_0x2585a5);agents['hangup'](_0x2585a5);queues[_0xe90e('0x2f')](_0x2585a5);}catch(_0x1eef24){utils[_0xe90e('0x12')](util[_0xe90e('0x17')]('[%s][index][hangup]',_0x2585a5[_0xe90e('0x1b')]),_0x1eef24);}});ami['on'](_0xe90e('0x30'),function(_0x24681f){try{utils['debug'](util[_0xe90e('0x17')](_0xe90e('0x31'),_0x24681f['uniqueid']),_0x24681f);members[_0xe90e('0x30')](_0x24681f);}catch(_0x226c28){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x31'),_0x24681f[_0xe90e('0x1b')]),_0x226c28);}});ami['on'](_0xe90e('0x32'),function(_0x1ec293){try{utils[_0xe90e('0x16')](util['format'](_0xe90e('0x33'),_0x1ec293[_0xe90e('0x1b')]),_0x1ec293);queues['blindtransfer'](_0x1ec293);agents[_0xe90e('0x32')](_0x1ec293);transfers[_0xe90e('0x32')](_0x1ec293);}catch(_0x987315){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x33'),_0x1ec293[_0xe90e('0x1b')]),_0x987315);}});ami['on'](_0xe90e('0x34'),function(_0x40adea){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')]('[%s][index][attendedtransfer]',_0x40adea[_0xe90e('0x35')]),_0x40adea);queues[_0xe90e('0x34')](_0x40adea);transfers[_0xe90e('0x34')](_0x40adea);agents[_0xe90e('0x34')](_0x40adea);calls[_0xe90e('0x34')](_0x40adea);}catch(_0x5597cd){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x36'),_0x40adea[_0xe90e('0x35')]),_0x5597cd);}});ami['on'](_0xe90e('0x37'),function(_0x529a68){try{utils[_0xe90e('0x16')](util['format'](_0xe90e('0x38'),_0x529a68[_0xe90e('0x1b')]),_0x529a68);queues['varset'](_0x529a68);recordings[_0xe90e('0x37')](_0x529a68);calls[_0xe90e('0x37')](_0x529a68);dials[_0xe90e('0x37')](_0x529a68);}catch(_0x173ad4){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x38'),_0x529a68['uniqueid']),_0x173ad4);}});ami['on'](_0xe90e('0x39'),function(_0x3b6e79){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')](_0xe90e('0x3a'),_0x3b6e79[_0xe90e('0x1b')]),_0x3b6e79);calls['newexten'](_0x3b6e79);recordings['newexten'](_0x3b6e79);dials[_0xe90e('0x39')](_0x3b6e79);}catch(_0x3b328c){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x3a'),_0x3b6e79['uniqueid']),_0x3b328c);}});ami['on']('newchannel',function(_0x25bf50){try{utils['debug'](util[_0xe90e('0x17')]('[%s][index][newchannel]',_0x25bf50['uniqueid']),_0x25bf50);calls[_0xe90e('0x3b')](_0x25bf50);recordings[_0xe90e('0x3b')](_0x25bf50);}catch(_0x48d804){utils[_0xe90e('0x12')](util[_0xe90e('0x17')](_0xe90e('0x3c'),_0x25bf50[_0xe90e('0x1b')]),_0x48d804);}});ami['on']('dialbegin',function(_0x439e77){try{utils[_0xe90e('0x16')](util[_0xe90e('0x17')](_0xe90e('0x3d'),_0x439e77[_0xe90e('0x1b')]),_0x439e77);dials[_0xe90e('0x3e')](_0x439e77);}catch(_0x58cd70){utils[_0xe90e('0x12')](util['format'](_0xe90e('0x3f'),_0x439e77[_0xe90e('0x1b')]),_0x58cd70);}});ami['on'](_0xe90e('0x40'),function(_0x59f9bd){try{utils[_0xe90e('0x16')](util['format'](_0xe90e('0x41'),_0x59f9bd['uniqueid']),_0x59f9bd);dials['dialend'](_0x59f9bd);}catch(_0x1f853e){utils[_0xe90e('0x12')](util['format'](_0xe90e('0x41'),_0x59f9bd[_0xe90e('0x1b')]),_0x1f853e);}});} \ No newline at end of file +var _0x72ef=['[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten'];(function(_0xb3c85f,_0x421ec0){var _0x5f1fde=function(_0xbe8343){while(--_0xbe8343){_0xb3c85f['push'](_0xb3c85f['shift']());}};_0x5f1fde(++_0x421ec0);}(_0x72ef,0xd7));var _0xf72e=function(_0x5b2f5d,_0x5508c8){_0x5b2f5d=_0x5b2f5d-0x0;var _0x404043=_0x72ef[_0x5b2f5d];return _0x404043;};var AsteriskManager=require(_0xf72e('0x0'));var config=require(_0xf72e('0x1'));var utils=require('./utils');var util=require(_0xf72e('0x2'));var isXDREnabled=config[_0xf72e('0x3')]&&config[_0xf72e('0x3')][_0xf72e('0x4')]?!config[_0xf72e('0x3')][_0xf72e('0x4')]:!![];var isProduction=config['env']===_0xf72e('0x5')||![];var isLocalAsterisk=config[_0xf72e('0x3')]&&config[_0xf72e('0x3')][_0xf72e('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xf72e('0x7')][_0xf72e('0x8')],config[_0xf72e('0x7')]['ip'],config[_0xf72e('0x7')][_0xf72e('0x9')],config[_0xf72e('0x7')][_0xf72e('0xa')],!![]);ami[_0xf72e('0xb')]();if(!isXDREnabled){utils['info'](_0xf72e('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xf72e('0xd')](_0xf72e('0xe'));}else{var agents=require(_0xf72e('0xf'));var calls=require(_0xf72e('0x10'));var queues=require(_0xf72e('0x11'));var recordings=require('./recordings.controller');var members=require(_0xf72e('0x12'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xf72e('0x13'));ami['on'](_0xf72e('0x14'),core['connect']);ami['on'](_0xf72e('0x15'),core['shutdown']);ami['on'](_0xf72e('0x16'),core[_0xf72e('0x16')]);ami['on'](_0xf72e('0x17'),core[_0xf72e('0x17')]);ami['on'](_0xf72e('0x18'),core[_0xf72e('0x18')]);ami['on'](_0xf72e('0x19'),core[_0xf72e('0x19')]);ami['on'](_0xf72e('0x1a'),function(_0x2748b3){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x1d'),_0x2748b3['device']),_0x2748b3);members['devicestatechange'](_0x2748b3);}catch(_0x57d506){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x1d'),_0x2748b3[_0xf72e('0x1e')]),_0x57d506);}});ami['on'](_0xf72e('0x1f'),function(_0x3b4394){try{utils['debug'](util[_0xf72e('0x1c')](_0xf72e('0x20'),_0x3b4394[_0xf72e('0x21')]),_0x3b4394);agents[_0xf72e('0x1f')](_0x3b4394);}catch(_0x530a5d){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x20'),_0x3b4394[_0xf72e('0x21')]),_0x530a5d);}});ami['on'](_0xf72e('0x22'),function(_0x44e9fc){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x23'),_0x44e9fc['uniqueid']),_0x44e9fc);agents[_0xf72e('0x22')](_0x44e9fc);}catch(_0x1cc75f){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x23'),_0x44e9fc[_0xf72e('0x21')]),_0x1cc75f);}});ami['on'](_0xf72e('0x24'),function(_0x567046){try{utils[_0xf72e('0x1b')](util['format']('[%s][index][agentconnect]',_0x567046['uniqueid']),_0x567046);agents[_0xf72e('0x24')](_0x567046);queues[_0xf72e('0x24')](_0x567046);}catch(_0x6b0fd4){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][agentconnect]',_0x567046[_0xf72e('0x21')]),_0x6b0fd4);}});ami['on'](_0xf72e('0x25'),function(_0x234322){try{utils['debug'](util['format'](_0xf72e('0x26'),_0x234322['uniqueid']),_0x234322);agents[_0xf72e('0x25')](_0x234322);queues[_0xf72e('0x25')](_0x234322);members['agentcomplete'](_0x234322);}catch(_0x5374e9){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x26'),_0x234322[_0xf72e('0x21')]),_0x5374e9);}});ami['on'](_0xf72e('0x27'),function(_0x5cc0c6){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x28'),_0x5cc0c6[_0xf72e('0x21')]),_0x5cc0c6);agents[_0xf72e('0x27')](_0x5cc0c6);queues[_0xf72e('0x27')](_0x5cc0c6);}catch(_0x39e075){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x28'),_0x5cc0c6[_0xf72e('0x21')]),_0x39e075);}});ami['on'](_0xf72e('0x29'),function(_0x59cb3e){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x2a'),_0x59cb3e['uniqueid']),_0x59cb3e);queues[_0xf72e('0x29')](_0x59cb3e);recordings[_0xf72e('0x29')](_0x59cb3e);}catch(_0x712fa7){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][queuecallerjoin]',_0x59cb3e[_0xf72e('0x21')]),_0x712fa7);}});ami['on'](_0xf72e('0x2b'),function(_0xd4a95a){try{utils['debug'](util[_0xf72e('0x1c')](_0xf72e('0x2c'),_0xd4a95a[_0xf72e('0x21')]),_0xd4a95a);queues['queuecallerleave'](_0xd4a95a);}catch(_0x42adf1){utils[_0xf72e('0x17')](util['format']('[%s][index][queuecallerleave]',_0xd4a95a[_0xf72e('0x21')]),_0x42adf1);}});ami['on']('musiconholdstart',function(_0x50c75f){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x2d'),_0x50c75f[_0xf72e('0x21')]),_0x50c75f);queues['musiconholdstart'](_0x50c75f);calls['musiconholdstart'](_0x50c75f);}catch(_0x3a939d){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][musiconholdstart]',_0x50c75f[_0xf72e('0x21')]),_0x3a939d);}});ami['on'](_0xf72e('0x2e'),function(_0x161da2){try{utils['debug'](util[_0xf72e('0x1c')]('[%s][index][musiconholdstop]',_0x161da2['uniqueid']),_0x161da2);queues[_0xf72e('0x2e')](_0x161da2);calls['musiconholdstop'](_0x161da2);}catch(_0x472269){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x2f'),_0x161da2['uniqueid']),_0x472269);}});ami['on'](_0xf72e('0x30'),function(_0x2dd956){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x31'),_0x2dd956['uniqueid']),_0x2dd956);calls[_0xf72e('0x30')](_0x2dd956);recordings[_0xf72e('0x30')](_0x2dd956);}catch(_0xc5e94d){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')]('[%s][index][newstate]',_0x2dd956[_0xf72e('0x21')]),_0xc5e94d);}});ami['on'](_0xf72e('0x32'),function(_0xdb9da6){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')]('[%s][index][hangup]',_0xdb9da6['uniqueid']),_0xdb9da6);calls[_0xf72e('0x32')](_0xdb9da6);recordings['hangup'](_0xdb9da6);dials[_0xf72e('0x32')](_0xdb9da6);agents[_0xf72e('0x32')](_0xdb9da6);queues[_0xf72e('0x32')](_0xdb9da6);}catch(_0x48b2b8){utils['error'](util[_0xf72e('0x1c')]('[%s][index][hangup]',_0xdb9da6['uniqueid']),_0x48b2b8);}});ami['on'](_0xf72e('0x33'),function(_0x2d4c4c){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x34'),_0x2d4c4c[_0xf72e('0x21')]),_0x2d4c4c);members[_0xf72e('0x33')](_0x2d4c4c);}catch(_0x2956c1){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x34'),_0x2d4c4c['uniqueid']),_0x2956c1);}});ami['on'](_0xf72e('0x35'),function(_0x51e05c){try{utils['debug'](util['format']('[%s][index][blindtransfer]',_0x51e05c[_0xf72e('0x21')]),_0x51e05c);queues[_0xf72e('0x35')](_0x51e05c);agents[_0xf72e('0x35')](_0x51e05c);transfers['blindtransfer'](_0x51e05c);}catch(_0x30e65a){utils[_0xf72e('0x17')](util['format'](_0xf72e('0x36'),_0x51e05c[_0xf72e('0x21')]),_0x30e65a);}});ami['on'](_0xf72e('0x37'),function(_0x468d92){try{utils[_0xf72e('0x1b')](util['format'](_0xf72e('0x38'),_0x468d92[_0xf72e('0x39')]),_0x468d92);queues[_0xf72e('0x37')](_0x468d92);transfers[_0xf72e('0x37')](_0x468d92);agents[_0xf72e('0x37')](_0x468d92);calls[_0xf72e('0x37')](_0x468d92);}catch(_0x5753f1){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x38'),_0x468d92[_0xf72e('0x39')]),_0x5753f1);}});ami['on'](_0xf72e('0x3a'),function(_0x4a250d){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x3b'),_0x4a250d[_0xf72e('0x21')]),_0x4a250d);queues[_0xf72e('0x3a')](_0x4a250d);recordings[_0xf72e('0x3a')](_0x4a250d);calls['varset'](_0x4a250d);dials[_0xf72e('0x3a')](_0x4a250d);}catch(_0x3ccd70){utils['error'](util['format'](_0xf72e('0x3b'),_0x4a250d['uniqueid']),_0x3ccd70);}});ami['on']('newexten',function(_0x340957){try{utils[_0xf72e('0x1b')](util['format']('[%s][index][newexten]',_0x340957['uniqueid']),_0x340957);calls['newexten'](_0x340957);recordings[_0xf72e('0x3c')](_0x340957);dials[_0xf72e('0x3c')](_0x340957);}catch(_0x499067){utils[_0xf72e('0x17')](util['format'](_0xf72e('0x3d'),_0x340957[_0xf72e('0x21')]),_0x499067);}});ami['on'](_0xf72e('0x3e'),function(_0x181112){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')](_0xf72e('0x3f'),_0x181112[_0xf72e('0x21')]),_0x181112);calls[_0xf72e('0x3e')](_0x181112);recordings[_0xf72e('0x3e')](_0x181112);}catch(_0x4e1930){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x3f'),_0x181112[_0xf72e('0x21')]),_0x4e1930);}});ami['on'](_0xf72e('0x40'),function(_0x594b9f){try{utils['debug'](util[_0xf72e('0x1c')](_0xf72e('0x41'),_0x594b9f[_0xf72e('0x21')]),_0x594b9f);dials[_0xf72e('0x40')](_0x594b9f);}catch(_0x281604){utils[_0xf72e('0x17')](util[_0xf72e('0x1c')](_0xf72e('0x42'),_0x594b9f[_0xf72e('0x21')]),_0x281604);}});ami['on'](_0xf72e('0x43'),function(_0x34c2ef){try{utils[_0xf72e('0x1b')](util[_0xf72e('0x1c')]('[%s][index][dialend]',_0x34c2ef[_0xf72e('0x21')]),_0x34c2ef);dials['dialend'](_0x34c2ef);}catch(_0x1961ac){utils['error'](util[_0xf72e('0x1c')](_0xf72e('0x44'),_0x34c2ef[_0xf72e('0x21')]),_0x1961ac);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5d3ac22..c5d3f2b 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 _0x0b8f=['state','INUSE','BUSY','voice','TALKING','now','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]','queue','assign','cdr','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','[%s][members][cdr]','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','type','membername','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0xcb1a33,_0x5f72f0){var _0x4fe585=function(_0x4bf99f){while(--_0x4bf99f){_0xcb1a33['push'](_0xcb1a33['shift']());}};_0x4fe585(++_0x5f72f0);}(_0x0b8f,0x174));var _0xf0b8=function(_0x5bd120,_0x9bf0c0){_0x5bd120=_0x5bd120-0x0;var _0x4c2b2e=_0x0b8f[_0x5bd120];return _0x4c2b2e;};'use strict';var _=require(_0xf0b8('0x0'));var util=require('util');var utils=require(_0xf0b8('0x1'));var members={};var exclude=[_0xf0b8('0x2'),_0xf0b8('0x3')];function writeDB(_0x1dd890){utils[_0xf0b8('0x4')](util[_0xf0b8('0x5')](_0xf0b8('0x6'),_0x1dd890[_0xf0b8('0x7')],_0x1dd890[_0xf0b8('0x8')],_0x1dd890[_0xf0b8('0x9')],_0x1dd890[_0xf0b8('0xa')],_0x1dd890['membername'],_0x1dd890[_0xf0b8('0xb')]));if(_0x1dd890['interface']){utils['getUserByInterface'](_0x1dd890['interface'])['then'](function(_0x4ac0e9){if(_0x4ac0e9){_0x1dd890[_0xf0b8('0xc')]=_0x4ac0e9[_0xf0b8('0xd')];_0x1dd890[_0xf0b8('0xe')]=_0x4ac0e9['internal'];utils[_0xf0b8('0xf')](_0xf0b8('0x10'),_0x1dd890);}else{utils[_0xf0b8('0x11')](_0x1dd890['interface'][_0xf0b8('0x12')]('/')[0x1])['then'](function(_0x70b20d){if(_0x70b20d){_0x1dd890[_0xf0b8('0xc')]=_0x70b20d[_0xf0b8('0xd')];_0x1dd890[_0xf0b8('0xe')]=_0x70b20d[_0xf0b8('0xe')];utils['request'](_0xf0b8('0x10'),_0x1dd890);}});}})['catch'](function(_0x1a0e2d){utils[_0xf0b8('0x13')](util[_0xf0b8('0x5')](_0xf0b8('0x14'),_0x1dd890['uniqueid']),_0x1a0e2d);});}delete members[_0x1dd890['interface']];}function startsWith(_0x298141,_0x532258){return _[_0xf0b8('0x15')](_0x298141,function(_0x26d0e2){return _[_0xf0b8('0x16')](_0x532258,_0x26d0e2);});}exports[_0xf0b8('0x17')]=function(_0x45176c){try{utils[_0xf0b8('0x18')](util['format'](_0xf0b8('0x19'),members[_0x45176c[_0xf0b8('0x1a')]]?members[_0x45176c[_0xf0b8('0x1a')]][_0xf0b8('0x7')]:_0x45176c['device']),_0x45176c);utils[_0xf0b8('0x4')](util[_0xf0b8('0x5')](_0xf0b8('0x1b'),members[_0x45176c[_0xf0b8('0x1a')]]?members[_0x45176c[_0xf0b8('0x1a')]][_0xf0b8('0x7')]:_0x45176c[_0xf0b8('0x1a')],_0x45176c['state'],_0x45176c['device']));switch(_0x45176c[_0xf0b8('0x1c')]){case _0xf0b8('0x1d'):case _0xf0b8('0x1e'):if(!startsWith(exclude,_0x45176c['device'])){members[_0x45176c[_0xf0b8('0x1a')]]={'channel':_0xf0b8('0x1f'),'interface':_0x45176c[_0xf0b8('0x1a')],'type':_0xf0b8('0x20'),'enterAt':utils[_0xf0b8('0x21')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xf0b8('0x22')](members[_0x45176c[_0xf0b8('0x1a')]])){members[_0x45176c[_0xf0b8('0x1a')]][_0xf0b8('0x23')]=utils['now']();members[_0x45176c[_0xf0b8('0x1a')]][_0xf0b8('0x24')]=utils[_0xf0b8('0x25')](members[_0x45176c[_0xf0b8('0x1a')]][_0xf0b8('0x23')],members[_0x45176c['device']][_0xf0b8('0x26')]);if(members[_0x45176c[_0xf0b8('0x1a')]][_0xf0b8('0x7')]){writeDB(members[_0x45176c['device']]);}}break;default:break;}}catch(_0x13457b){utils['error'](util[_0xf0b8('0x5')](_0xf0b8('0x19'),members[_0x45176c[_0xf0b8('0x1a')]]?members[_0x45176c[_0xf0b8('0x1a')]][_0xf0b8('0x7')]:_0x45176c[_0xf0b8('0x1a')]),_0x13457b);}};exports['agentcomplete']=function(_0x79af9e){try{if(!_[_0xf0b8('0x22')](members[_0x79af9e[_0xf0b8('0x8')]])){utils[_0xf0b8('0x18')](util['format'](_0xf0b8('0x27'),_0x79af9e[_0xf0b8('0x7')]),_0x79af9e);utils[_0xf0b8('0x4')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x79af9e[_0xf0b8('0x7')],_0x79af9e[_0xf0b8('0x8')],_0x79af9e[_0xf0b8('0x28')]));members[_0x79af9e['interface']]=_[_0xf0b8('0x29')](members[_0x79af9e['interface']],{'data4':_0x79af9e[_0xf0b8('0x28')],'uniqueid':_0x79af9e[_0xf0b8('0x7')]});}}catch(_0x527667){utils[_0xf0b8('0x13')](util['format'](_0xf0b8('0x27'),_0x79af9e[_0xf0b8('0x7')]),_0x527667);}};exports[_0xf0b8('0x2a')]=function(_0x568d30){try{utils[_0xf0b8('0x18')](util[_0xf0b8('0x5')]('[%s][members][cdr]',_0x568d30[_0xf0b8('0x7')]),_0x568d30);if(_0x568d30[_0xf0b8('0x9')]){var _0x396bd6=_0x568d30[_0xf0b8('0x9')][_0xf0b8('0x12')]('-')[0x0];if(!_[_0xf0b8('0x22')](members[_0x396bd6])){members[_0x396bd6]=_[_0xf0b8('0x29')](members[_0x396bd6],{'data1':members[_0x396bd6][_0xf0b8('0x2b')]||_0x568d30[_0xf0b8('0xb')],'data2':members[_0x396bd6]['data2']||_0x568d30[_0xf0b8('0x2c')],'data3':members[_0x396bd6][_0xf0b8('0x2d')]||_0x568d30[_0xf0b8('0x2e')],'uniqueid':members[_0x396bd6][_0xf0b8('0x7')]||_0x568d30[_0xf0b8('0x7')]});utils[_0xf0b8('0x4')](util['format'](_0xf0b8('0x2f'),_0x568d30[_0xf0b8('0x7')],members[_0x396bd6]['data1'],members[_0x396bd6]['data2'],members[_0x396bd6][_0xf0b8('0x2d')]));if(members[_0x396bd6][_0xf0b8('0x23')]){writeDB(members[_0x396bd6]);}}}if(_0x568d30[_0xf0b8('0x30')]){var _0x52d2fb=_0x568d30[_0xf0b8('0x30')][_0xf0b8('0x12')]('-')[0x0];if(!_[_0xf0b8('0x22')](members[_0x52d2fb])){members[_0x52d2fb]=_[_0xf0b8('0x29')](members[_0x52d2fb],{'data1':members[_0x52d2fb][_0xf0b8('0x2b')]||_0x568d30[_0xf0b8('0xb')],'data2':members[_0x52d2fb][_0xf0b8('0xa')]||_0x568d30['source'],'data3':members[_0x52d2fb][_0xf0b8('0x2d')]||_0x568d30[_0xf0b8('0x2e')],'uniqueid':members[_0x52d2fb][_0xf0b8('0x7')]||_0x568d30['uniqueid']});utils[_0xf0b8('0x4')](util[_0xf0b8('0x5')](_0xf0b8('0x2f'),_0x568d30[_0xf0b8('0x7')],members[_0x52d2fb]['data1'],members[_0x52d2fb]['data2'],members[_0x52d2fb][_0xf0b8('0x2d')]));if(members[_0x52d2fb][_0xf0b8('0x23')]){writeDB(members[_0x52d2fb]);}}}}catch(_0x9c9f30){utils[_0xf0b8('0x13')](util['format'](_0xf0b8('0x31'),_0x568d30['uniqueid']),_0x9c9f30);}}; \ No newline at end of file +var _0x87e6=['then','membername','name','internal','request','getUserByName','split','CreateMemberReport','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','assign','data1','type','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','interface','getUserByInterface'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x87e6,0x1a3));var _0x687e=function(_0x16f0e3,_0x56a01b){_0x16f0e3=_0x16f0e3-0x0;var _0x22754f=_0x87e6[_0x16f0e3];return _0x22754f;};'use strict';var _=require(_0x687e('0x0'));var util=require(_0x687e('0x1'));var utils=require(_0x687e('0x2'));var members={};var exclude=[_0x687e('0x3'),_0x687e('0x4')];function writeDB(_0x2a99aa){utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x7'),_0x2a99aa[_0x687e('0x8')],_0x2a99aa['interface'],_0x2a99aa[_0x687e('0x9')],_0x2a99aa[_0x687e('0xa')],_0x2a99aa['membername'],_0x2a99aa['type']));if(_0x2a99aa[_0x687e('0xb')]){utils[_0x687e('0xc')](_0x2a99aa[_0x687e('0xb')])[_0x687e('0xd')](function(_0x38f752){if(_0x38f752){_0x2a99aa[_0x687e('0xe')]=_0x38f752[_0x687e('0xf')];_0x2a99aa[_0x687e('0x10')]=_0x38f752[_0x687e('0x10')];utils[_0x687e('0x11')]('CreateMemberReport',_0x2a99aa);}else{utils[_0x687e('0x12')](_0x2a99aa[_0x687e('0xb')][_0x687e('0x13')]('/')[0x1])[_0x687e('0xd')](function(_0x55a376){if(_0x55a376){_0x2a99aa[_0x687e('0xe')]=_0x55a376[_0x687e('0xf')];_0x2a99aa[_0x687e('0x10')]=_0x55a376[_0x687e('0x10')];utils[_0x687e('0x11')](_0x687e('0x14'),_0x2a99aa);}});}})['catch'](function(_0x47c41d){utils[_0x687e('0x15')](util['format']('[%s][members][writeDB]',_0x2a99aa[_0x687e('0x8')]),_0x47c41d);});}delete members[_0x2a99aa[_0x687e('0xb')]];}function startsWith(_0x22573d,_0x3ff85a){return _[_0x687e('0x16')](_0x22573d,function(_0x58001a){return _[_0x687e('0x17')](_0x3ff85a,_0x58001a);});}exports[_0x687e('0x18')]=function(_0x445942){try{utils[_0x687e('0x19')](util[_0x687e('0x6')](_0x687e('0x1a'),members[_0x445942[_0x687e('0x1b')]]?members[_0x445942[_0x687e('0x1b')]][_0x687e('0x8')]:_0x445942[_0x687e('0x1b')]),_0x445942);utils[_0x687e('0x5')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x445942[_0x687e('0x1b')]]?members[_0x445942[_0x687e('0x1b')]][_0x687e('0x8')]:_0x445942['device'],_0x445942['state'],_0x445942[_0x687e('0x1b')]));switch(_0x445942[_0x687e('0x1c')]){case _0x687e('0x1d'):case _0x687e('0x1e'):if(!startsWith(exclude,_0x445942['device'])){members[_0x445942[_0x687e('0x1b')]]={'channel':'voice','interface':_0x445942[_0x687e('0x1b')],'type':_0x687e('0x1f'),'enterAt':utils[_0x687e('0x20')](),'role':_0x687e('0x21')};}break;case _0x687e('0x22'):if(!_[_0x687e('0x23')](members[_0x445942[_0x687e('0x1b')]])){members[_0x445942[_0x687e('0x1b')]]['exitAt']=utils[_0x687e('0x20')]();members[_0x445942[_0x687e('0x1b')]][_0x687e('0x24')]=utils[_0x687e('0x25')](members[_0x445942[_0x687e('0x1b')]][_0x687e('0x26')],members[_0x445942[_0x687e('0x1b')]][_0x687e('0x27')]);if(members[_0x445942[_0x687e('0x1b')]][_0x687e('0x8')]){writeDB(members[_0x445942[_0x687e('0x1b')]]);}}break;default:break;}}catch(_0x5b99a3){utils['error'](util[_0x687e('0x6')]('[%s][members][devicestatechange]',members[_0x445942[_0x687e('0x1b')]]?members[_0x445942['device']]['uniqueid']:_0x445942['device']),_0x5b99a3);}};exports[_0x687e('0x28')]=function(_0x14c783){try{if(!_[_0x687e('0x23')](members[_0x14c783['interface']])){utils[_0x687e('0x19')](util[_0x687e('0x6')]('[%s][members][agentcomplete]',_0x14c783[_0x687e('0x8')]),_0x14c783);utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x29'),_0x14c783['uniqueid'],_0x14c783[_0x687e('0xb')],_0x14c783[_0x687e('0x2a')]));members[_0x14c783[_0x687e('0xb')]]=_['assign'](members[_0x14c783[_0x687e('0xb')]],{'data4':_0x14c783[_0x687e('0x2a')],'uniqueid':_0x14c783[_0x687e('0x8')]});}}catch(_0x4ace7a){utils[_0x687e('0x15')](util[_0x687e('0x6')](_0x687e('0x2b'),_0x14c783[_0x687e('0x8')]),_0x4ace7a);}};exports[_0x687e('0x2c')]=function(_0x57365b){try{utils['debug'](util[_0x687e('0x6')](_0x687e('0x2d'),_0x57365b[_0x687e('0x8')]),_0x57365b);if(_0x57365b[_0x687e('0x9')]){var _0x5ecc1c=_0x57365b[_0x687e('0x9')][_0x687e('0x13')]('-')[0x0];if(!_[_0x687e('0x23')](members[_0x5ecc1c])){members[_0x5ecc1c]=_[_0x687e('0x2e')](members[_0x5ecc1c],{'data1':members[_0x5ecc1c][_0x687e('0x2f')]||_0x57365b[_0x687e('0x30')],'data2':members[_0x5ecc1c][_0x687e('0xa')]||_0x57365b['source'],'data3':members[_0x5ecc1c][_0x687e('0x31')]||_0x57365b[_0x687e('0x32')],'uniqueid':members[_0x5ecc1c][_0x687e('0x8')]||_0x57365b[_0x687e('0x8')]});utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x33'),_0x57365b[_0x687e('0x8')],members[_0x5ecc1c][_0x687e('0x2f')],members[_0x5ecc1c][_0x687e('0xa')],members[_0x5ecc1c]['data3']));if(members[_0x5ecc1c][_0x687e('0x26')]){writeDB(members[_0x5ecc1c]);}}}if(_0x57365b[_0x687e('0x34')]){var _0x1b6800=_0x57365b[_0x687e('0x34')][_0x687e('0x13')]('-')[0x0];if(!_[_0x687e('0x23')](members[_0x1b6800])){members[_0x1b6800]=_[_0x687e('0x2e')](members[_0x1b6800],{'data1':members[_0x1b6800][_0x687e('0x2f')]||_0x57365b['type'],'data2':members[_0x1b6800][_0x687e('0xa')]||_0x57365b[_0x687e('0x35')],'data3':members[_0x1b6800][_0x687e('0x31')]||_0x57365b[_0x687e('0x32')],'uniqueid':members[_0x1b6800][_0x687e('0x8')]||_0x57365b[_0x687e('0x8')]});utils[_0x687e('0x5')](util[_0x687e('0x6')](_0x687e('0x33'),_0x57365b[_0x687e('0x8')],members[_0x1b6800]['data1'],members[_0x1b6800]['data2'],members[_0x1b6800][_0x687e('0x31')]));if(members[_0x1b6800][_0x687e('0x26')]){writeDB(members[_0x1b6800]);}}}}catch(_0x472545){utils[_0x687e('0x15')](util[_0x687e('0x6')](_0x687e('0x2d'),_0x57365b[_0x687e('0x8')]),_0x472545);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index aee3c65..cd83d0b 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 _0xd357=['secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','lastAssignedTo','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','format','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','debug','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','info','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s'];(function(_0x356e3d,_0x3ca56c){var _0x102aff=function(_0x47a7e8){while(--_0x47a7e8){_0x356e3d['push'](_0x356e3d['shift']());}};_0x102aff(++_0x3ca56c);}(_0xd357,0xdd));var _0x7d35=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd357[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x7d35('0x0'));var util=require('util');var utils=require(_0x7d35('0x1'));var queues={};function writeDB(_0x428d73){utils['info'](util['format'](_0x7d35('0x2'),_0x428d73[_0x7d35('0x3')],_0x428d73['channel'],_0x428d73['queue'],_0x428d73[_0x7d35('0x4')],_0x428d73[_0x7d35('0x5')],_0x428d73['accountcode'],_0x428d73[_0x7d35('0x6')]));if(_0x428d73[_0x7d35('0x7')]){utils[_0x7d35('0x8')](_0x428d73[_0x7d35('0x7')])['then'](function(_0xa0c59){if(_0xa0c59){_0x428d73[_0x7d35('0x9')]=_0xa0c59[_0x7d35('0x9')];}utils['request'](_0x7d35('0xa'),_0x428d73);});}else{utils[_0x7d35('0xb')](_0x7d35('0xa'),_0x428d73);}if(_0x428d73[_0x7d35('0xc')]){delete queues[_0x428d73['transfereduniqueid']];}else{delete queues[_0x428d73[_0x7d35('0x3')]];}}exports[_0x7d35('0xd')]=function(_0x3c2972){try{utils['debug'](util[_0x7d35('0xe')](_0x7d35('0xf'),_0x3c2972[_0x7d35('0x3')]),_0x3c2972);utils['info'](util[_0x7d35('0xe')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x3c2972[_0x7d35('0x3')],_0x3c2972[_0x7d35('0x7')],_0x3c2972[_0x7d35('0x10')]));queues[_0x3c2972[_0x7d35('0x3')]]=_[_0x7d35('0x11')](_0x3c2972,{'originalposition':_0x3c2972[_0x7d35('0x10')],'queuecallerjoinAt':utils[_0x7d35('0x12')](),'mohtime':0x0});}catch(_0x1dd13d){utils[_0x7d35('0x13')](util[_0x7d35('0xe')]('[%s][queues][queuecallerjoin]',_0x3c2972[_0x7d35('0x3')]),_0x1dd13d);}};exports[_0x7d35('0x14')]=function(_0x43b0a2){try{if(!_['isNil'](queues[_0x43b0a2[_0x7d35('0x3')]])){utils['debug'](util[_0x7d35('0xe')](_0x7d35('0x15'),_0x43b0a2[_0x7d35('0x3')]),_0x43b0a2);if(queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0x16')]){if(!queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0x17')]&&!queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0x18')]){queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0x19')]=!![];queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0x1a')]=utils[_0x7d35('0x12')]();queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0x6')]=_0x7d35('0x1b');}utils['info'](util[_0x7d35('0xe')](_0x7d35('0x1c'),_0x43b0a2['uniqueid'],queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0x1d')],queues[_0x43b0a2['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x43b0a2[_0x7d35('0x3')]]);}else if(queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0xc')]){utils['info'](util[_0x7d35('0xe')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x43b0a2[_0x7d35('0x3')],queues[_0x43b0a2['uniqueid']][_0x7d35('0x1d')],queues[_0x43b0a2['uniqueid']][_0x7d35('0xc')]));queues[queues[_0x43b0a2[_0x7d35('0x3')]][_0x7d35('0xc')]]=queues[_0x43b0a2[_0x7d35('0x3')]];queues[queues[_0x43b0a2[_0x7d35('0x3')]]['transfereduniqueid']][_0x7d35('0x1e')]=0x2;delete queues[_0x43b0a2[_0x7d35('0x3')]];}}}catch(_0x1ec08c){utils[_0x7d35('0x13')](util[_0x7d35('0xe')](_0x7d35('0x15'),_0x43b0a2[_0x7d35('0x3')]),_0x1ec08c);}};exports[_0x7d35('0x1f')]=function(_0x3baa74){try{utils[_0x7d35('0x20')](util[_0x7d35('0xe')](_0x7d35('0x21'),_0x3baa74[_0x7d35('0x3')]),_0x3baa74);if(!_[_0x7d35('0x22')](_0x3baa74[_0x7d35('0x23')][_0x7d35('0x24')])&&_0x3baa74[_0x7d35('0x25')][_0x7d35('0x26')]()!==_0x7d35('0x27')){if(!_[_0x7d35('0x22')](queues[_0x3baa74['uniqueid']])){queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x17')]=![];queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x28')]=null;queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x18')]=!![];queues[_0x3baa74['uniqueid']][_0x7d35('0x29')]=utils[_0x7d35('0x12')]();queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x6')]=_0x3baa74['value'][_0x7d35('0x26')]();utils[_0x7d35('0x2a')](util[_0x7d35('0xe')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x3baa74[_0x7d35('0x3')],queues[_0x3baa74['uniqueid']][_0x7d35('0x1d')],_0x3baa74[_0x7d35('0x25')],queues[_0x3baa74['uniqueid']][_0x7d35('0x6')]));writeDB(queues[_0x3baa74[_0x7d35('0x3')]]);}}else if(!_[_0x7d35('0x22')](_0x3baa74[_0x7d35('0x23')][_0x7d35('0x2b')])){if(!_[_0x7d35('0x22')](queues[_0x3baa74[_0x7d35('0x3')]])&&!queues[_0x3baa74['uniqueid']]['queuecallerabandon']){queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x17')]=![];queues[_0x3baa74[_0x7d35('0x3')]]['queuecallerabandonAt']=null;queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x18')]=!![];queues[_0x3baa74['uniqueid']][_0x7d35('0x29')]=utils[_0x7d35('0x12')]();queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x6')]=_0x7d35('0x2c');utils['info'](util[_0x7d35('0xe')](_0x7d35('0x2d'),_0x3baa74[_0x7d35('0x3')],queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x1d')],_0x3baa74[_0x7d35('0x25')],queues[_0x3baa74[_0x7d35('0x3')]][_0x7d35('0x6')]));}}}catch(_0x1cc00c){utils['error'](util[_0x7d35('0xe')]('[%s][queues][varset]',_0x3baa74[_0x7d35('0x3')]),_0x1cc00c);}};exports[_0x7d35('0x17')]=function(_0x3af00a){try{if(!_[_0x7d35('0x22')](queues[_0x3af00a[_0x7d35('0x3')]])){utils[_0x7d35('0x20')](util[_0x7d35('0xe')]('[%s][queues][queuecallerabandon]',_0x3af00a[_0x7d35('0x3')]),_0x3af00a);queues[_0x3af00a[_0x7d35('0x3')]][_0x7d35('0x18')]=![];queues[_0x3af00a['uniqueid']][_0x7d35('0x29')]=null;queues[_0x3af00a['uniqueid']][_0x7d35('0x17')]=!![];queues[_0x3af00a['uniqueid']][_0x7d35('0x28')]=utils[_0x7d35('0x12')]();queues[_0x3af00a[_0x7d35('0x3')]][_0x7d35('0x6')]=_0x7d35('0x2e');utils[_0x7d35('0x2a')](util['format'](_0x7d35('0x2f'),_0x3af00a[_0x7d35('0x3')],queues[_0x3af00a[_0x7d35('0x3')]][_0x7d35('0x1d')],queues[_0x3af00a[_0x7d35('0x3')]][_0x7d35('0x6')]));}}catch(_0x20a418){utils['error'](util[_0x7d35('0xe')]('[%s][queues][queuecallerabandon]',_0x3af00a[_0x7d35('0x3')]),_0x20a418);}};exports[_0x7d35('0x30')]=function(_0x2cf6f9){try{if(!_['isNil'](queues[_0x2cf6f9[_0x7d35('0x3')]])){utils[_0x7d35('0x20')](util[_0x7d35('0xe')](_0x7d35('0x31'),_0x2cf6f9[_0x7d35('0x3')]),_0x2cf6f9);utils['info'](util[_0x7d35('0xe')](_0x7d35('0x32'),_0x2cf6f9[_0x7d35('0x3')],queues[_0x2cf6f9[_0x7d35('0x3')]]['name'],_0x2cf6f9[_0x7d35('0x33')],_0x2cf6f9[_0x7d35('0x34')]));queues[_0x2cf6f9[_0x7d35('0x3')]][_0x7d35('0x30')]=!![];queues[_0x2cf6f9[_0x7d35('0x3')]][_0x7d35('0x16')]=utils[_0x7d35('0x12')]();queues[_0x2cf6f9[_0x7d35('0x3')]][_0x7d35('0x35')]=utils[_0x7d35('0x36')](queues[_0x2cf6f9[_0x7d35('0x3')]][_0x7d35('0x16')],queues[_0x2cf6f9['uniqueid']][_0x7d35('0x37')]);queues[_0x2cf6f9[_0x7d35('0x3')]][_0x7d35('0x10')]=_0x2cf6f9[_0x7d35('0x10')];queues[_0x2cf6f9['uniqueid']][_0x7d35('0x38')]=_0x2cf6f9[_0x7d35('0x38')];queues[_0x2cf6f9[_0x7d35('0x3')]][_0x7d35('0x33')]=_0x2cf6f9[_0x7d35('0x33')];queues[_0x2cf6f9[_0x7d35('0x3')]][_0x7d35('0x34')]=_0x2cf6f9[_0x7d35('0x34')];}}catch(_0xd35b1c){utils['error'](util['format'](_0x7d35('0x31'),_0x2cf6f9['uniqueid']),_0xd35b1c);}};exports[_0x7d35('0x39')]=function(_0x314fec){try{if(!_['isNil'](queues[_0x314fec[_0x7d35('0x3')]])){utils[_0x7d35('0x20')](util[_0x7d35('0xe')](_0x7d35('0x3a'),_0x314fec['uniqueid']),_0x314fec);utils[_0x7d35('0x2a')](util[_0x7d35('0xe')](_0x7d35('0x3b'),_0x314fec[_0x7d35('0x3')],queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x1d')],_0x314fec['membername'],_0x314fec[_0x7d35('0x3c')]));queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x17')]=![];queues[_0x314fec[_0x7d35('0x3')]]['queuecallerabandon']=![];queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x28')]=null;queues[_0x314fec['uniqueid']][_0x7d35('0x18')]=![];queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x6')]=null;queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x29')]=null;queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x3d')]=!![];queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x3e')]=_0x314fec[_0x7d35('0x3c')];queues[_0x314fec[_0x7d35('0x3')]][_0x7d35('0x4')]=_0x314fec[_0x7d35('0x3f')];}}catch(_0x2ba91a){utils['error'](util[_0x7d35('0xe')]('[%s][queues][agentconnect]',_0x314fec['uniqueid']),_0x2ba91a);}};exports[_0x7d35('0x40')]=function(_0x169b0f){try{if(!_[_0x7d35('0x22')](queues[_0x169b0f['uniqueid']])){if(queues[_0x169b0f['uniqueid']]['queuecallerleaveAt']){utils[_0x7d35('0x20')](util[_0x7d35('0xe')](_0x7d35('0x41'),_0x169b0f['uniqueid']),_0x169b0f);queues[_0x169b0f[_0x7d35('0x3')]]['queuecallerabandon']=![];queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x17')]=![];queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x28')]=null;queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x18')]=![];queues[_0x169b0f[_0x7d35('0x3')]]['queuecallerexitAt']=null;queues[_0x169b0f[_0x7d35('0x3')]]['assigned']=!![];queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x4')]=_0x169b0f[_0x7d35('0x3f')];queues[_0x169b0f[_0x7d35('0x3')]]['queuecallercomplete']=!![];queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x1a')]=utils[_0x7d35('0x12')]();if(_0x169b0f[_0x7d35('0x42')]==_0x7d35('0x43')){if(!queues[_0x169b0f[_0x7d35('0x3')]]['transfer']){queues[_0x169b0f[_0x7d35('0x3')]]['queuecallerexitreason']=_0x7d35('0x44');}}else{queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x6')]=_0x7d35('0x45')+_0x169b0f[_0x7d35('0x42')]['toUpperCase']();}utils[_0x7d35('0x2a')](util[_0x7d35('0xe')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x169b0f[_0x7d35('0x3')],queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x1d')],_0x169b0f['membername'],queues[_0x169b0f[_0x7d35('0x3')]][_0x7d35('0x6')]));writeDB(queues[_0x169b0f['uniqueid']]);}}}catch(_0xdceb9b){utils[_0x7d35('0x13')](util[_0x7d35('0xe')](_0x7d35('0x41'),_0x169b0f[_0x7d35('0x3')]),_0xdceb9b);}};exports[_0x7d35('0x46')]=function(_0x2038a3){try{if(!_[_0x7d35('0x22')](queues[_0x2038a3['transfereeuniqueid']])){utils[_0x7d35('0x20')](util['format'](_0x7d35('0x47'),_0x2038a3[_0x7d35('0x3')]),_0x2038a3);queues[_0x2038a3[_0x7d35('0x48')]][_0x7d35('0x43')]=!![];queues[_0x2038a3[_0x7d35('0x48')]]['transfertype']='BLIND';queues[_0x2038a3[_0x7d35('0x48')]][_0x7d35('0x49')]=_0x2038a3['extension'];queues[_0x2038a3[_0x7d35('0x48')]][_0x7d35('0x4a')]=_0x2038a3['transfereeuniqueid'];queues[_0x2038a3[_0x7d35('0x48')]][_0x7d35('0x6')]=_0x7d35('0x4b');utils[_0x7d35('0x2a')](util['format'](_0x7d35('0x4c'),_0x2038a3[_0x7d35('0x3')],queues[_0x2038a3[_0x7d35('0x48')]][_0x7d35('0x1d')],_0x2038a3[_0x7d35('0x48')],_0x2038a3[_0x7d35('0x4d')]));}}catch(_0x604813){utils[_0x7d35('0x13')](util['format'](_0x7d35('0x47'),_0x2038a3[_0x7d35('0x3')]),_0x604813);}};exports[_0x7d35('0x4e')]=function(_0x18108d){try{utils[_0x7d35('0x20')](util[_0x7d35('0xe')](_0x7d35('0x4f'),_0x18108d[_0x7d35('0x50')]),_0x18108d);if(_0x18108d[_0x7d35('0x50')]==_0x18108d[_0x7d35('0x51')]){if(!_[_0x7d35('0x22')](queues[_0x18108d['secondtransfererlinkedid']])){utils[_0x7d35('0x2a')](util[_0x7d35('0xe')](_0x7d35('0x52'),_0x18108d['origtransfereruniqueid'],queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0x1d')],_0x18108d['origtransfererexten']));queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0x43')]=!![];queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0x54')]=_0x7d35('0x55');queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0x49')]=_0x18108d['origtransfererexten'];queues[_0x18108d['secondtransfererlinkedid']][_0x7d35('0x4a')]=_0x18108d[_0x7d35('0x50')];queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0x6')]=_0x7d35('0x56');}if(!_[_0x7d35('0x22')](queues[_0x18108d[_0x7d35('0x51')]])){if(_0x18108d[_0x7d35('0x57')]&&queues[_0x18108d[_0x7d35('0x57')]]){queues[_0x18108d['transfereelinkedid']][_0x7d35('0x1e')]=0x1;queues[_0x18108d[_0x7d35('0x48')]]=_[_0x7d35('0x58')](queues[_0x18108d['transfereelinkedid']]);queues[_0x18108d[_0x7d35('0x48')]]['transfereduniqueid']=_0x18108d[_0x7d35('0x59')];queues[_0x18108d[_0x7d35('0x48')]]['queuecallerenterreason']=0x2;queues[_0x18108d[_0x7d35('0x48')]][_0x7d35('0x5')]=queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0x5')];queues[_0x18108d[_0x7d35('0x48')]]['calleridname']=queues[_0x18108d['secondtransfererlinkedid']][_0x7d35('0x5a')];queues[_0x18108d[_0x7d35('0x48')]]['queuecallerjoinAt']=utils[_0x7d35('0x12')]();queues[_0x18108d['transfereeuniqueid']][_0x7d35('0x16')]=utils['now']();queues[_0x18108d[_0x7d35('0x48')]][_0x7d35('0x35')]=0x0;queues[_0x18108d[_0x7d35('0x48')]][_0x7d35('0x5b')]=0x0;utils[_0x7d35('0x2a')](util['format'](_0x7d35('0x5c'),_0x18108d[_0x7d35('0x50')],queues[_0x18108d[_0x7d35('0x48')]][_0x7d35('0x1d')],queues[_0x18108d[_0x7d35('0x48')]][_0x7d35('0x5')],queues[_0x18108d[_0x7d35('0x48')]]['calleridname']));}else{utils[_0x7d35('0x2a')](util[_0x7d35('0xe')](_0x7d35('0x5d'),_0x18108d[_0x7d35('0x50')],queues[_0x18108d[_0x7d35('0x51')]][_0x7d35('0x1d')],_0x18108d[_0x7d35('0x53')]));queues[_0x18108d['origtransfererlinkedid']]['transfereduniqueid']=_0x18108d['secondtransfererlinkedid'];}}}else if(_0x18108d[_0x7d35('0x5e')]==_0x18108d[_0x7d35('0x53')]){if(!_[_0x7d35('0x22')](queues[_0x18108d[_0x7d35('0x51')]])){utils[_0x7d35('0x2a')](util[_0x7d35('0xe')](_0x7d35('0x5f'),_0x18108d['origtransfereruniqueid'],queues[_0x18108d[_0x7d35('0x51')]][_0x7d35('0x1d')],_0x18108d[_0x7d35('0x5e')],_0x18108d[_0x7d35('0x60')]));queues[_0x18108d[_0x7d35('0x51')]][_0x7d35('0x43')]=!![];queues[_0x18108d[_0x7d35('0x51')]][_0x7d35('0x54')]=_0x7d35('0x55');queues[_0x18108d[_0x7d35('0x51')]]['transferexten']=_0x18108d[_0x7d35('0x60')];queues[_0x18108d[_0x7d35('0x51')]][_0x7d35('0x4a')]=_0x18108d[_0x7d35('0x5e')];queues[_0x18108d[_0x7d35('0x51')]][_0x7d35('0x6')]=_0x7d35('0x56');}if(!_[_0x7d35('0x22')](queues[_0x18108d[_0x7d35('0x53')]])){if(_0x18108d[_0x7d35('0x61')]&&queues[_0x18108d['transfertargetlinkedid']]){queues[_0x18108d['transfertargetlinkedid']][_0x7d35('0x1e')]=0x1;queues[_0x18108d['transfertargetuniqueid']]=_[_0x7d35('0x58')](queues[_0x18108d[_0x7d35('0x61')]]);queues[_0x18108d['transfertargetuniqueid']][_0x7d35('0xc')]=_0x18108d[_0x7d35('0x59')];queues[_0x18108d[_0x7d35('0x59')]]['queuecallerenterreason']=0x2;queues[_0x18108d[_0x7d35('0x59')]]['calleridnum']=queues[_0x18108d[_0x7d35('0x51')]][_0x7d35('0x5')];queues[_0x18108d[_0x7d35('0x59')]][_0x7d35('0x5a')]=queues[_0x18108d[_0x7d35('0x51')]]['calleridname'];queues[_0x18108d[_0x7d35('0x59')]][_0x7d35('0x37')]=utils[_0x7d35('0x12')]();queues[_0x18108d[_0x7d35('0x59')]][_0x7d35('0x16')]=utils[_0x7d35('0x12')]();queues[_0x18108d[_0x7d35('0x59')]][_0x7d35('0x35')]=0x0;queues[_0x18108d['transfertargetuniqueid']][_0x7d35('0x5b')]=0x0;utils[_0x7d35('0x2a')](util[_0x7d35('0xe')](_0x7d35('0x62'),_0x18108d[_0x7d35('0x50')],queues[_0x18108d[_0x7d35('0x59')]][_0x7d35('0x1d')],queues[_0x18108d['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x18108d[_0x7d35('0x59')]]['calleridnum'],queues[_0x18108d[_0x7d35('0x59')]][_0x7d35('0x5a')]));}else{utils[_0x7d35('0x2a')](util['format'](_0x7d35('0x5d'),_0x18108d[_0x7d35('0x50')],queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0x1d')],_0x18108d[_0x7d35('0x51')]));queues[_0x18108d[_0x7d35('0x53')]][_0x7d35('0xc')]=_0x18108d['origtransfererlinkedid'];}}}}catch(_0xbbda3){utils['error'](util[_0x7d35('0xe')]('[%s][queues][attendedtransfer]',_0x18108d[_0x7d35('0x50')]),_0xbbda3);}};exports[_0x7d35('0x63')]=function(_0x29cc2b){try{if(!_['isNil'](queues[_0x29cc2b['uniqueid']])){utils['debug'](util['format']('[%s][queues][musiconholdstart]',_0x29cc2b[_0x7d35('0x3')]),_0x29cc2b);queues[_0x29cc2b[_0x7d35('0x3')]][_0x7d35('0x64')]=utils[_0x7d35('0x12')]();utils[_0x7d35('0x2a')](util[_0x7d35('0xe')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x29cc2b[_0x7d35('0x3')],queues[_0x29cc2b[_0x7d35('0x3')]]['name'],queues[_0x29cc2b['uniqueid']][_0x7d35('0x64')]));}}catch(_0x108fce){utils[_0x7d35('0x13')](util[_0x7d35('0xe')](_0x7d35('0x65'),_0x29cc2b[_0x7d35('0x3')]),_0x108fce);}};exports[_0x7d35('0x66')]=function(_0x4d5d22){try{if(!_['isNil'](queues[_0x4d5d22['uniqueid']])){if(!_[_0x7d35('0x22')](queues[_0x4d5d22[_0x7d35('0x3')]][_0x7d35('0x64')])){utils[_0x7d35('0x20')](util[_0x7d35('0xe')](_0x7d35('0x67'),_0x4d5d22[_0x7d35('0x3')]),_0x4d5d22);queues[_0x4d5d22['uniqueid']][_0x7d35('0x5b')]+=utils[_0x7d35('0x36')](utils[_0x7d35('0x12')](),queues[_0x4d5d22[_0x7d35('0x3')]][_0x7d35('0x64')]);utils[_0x7d35('0x2a')](util[_0x7d35('0xe')](_0x7d35('0x68'),_0x4d5d22[_0x7d35('0x3')],queues[_0x4d5d22[_0x7d35('0x3')]][_0x7d35('0x1d')],queues[_0x4d5d22['uniqueid']][_0x7d35('0x5b')]));delete queues[_0x4d5d22[_0x7d35('0x3')]][_0x7d35('0x64')];}}}catch(_0x531d8c){utils['error'](util[_0x7d35('0xe')](_0x7d35('0x67'),_0x4d5d22[_0x7d35('0x3')]),_0x531d8c);}}; \ No newline at end of file +var _0x271d=['[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','membername','destaccountcode','assigned','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s'];(function(_0x3773f0,_0x12c210){var _0x2d0414=function(_0x2902f0){while(--_0x2902f0){_0x3773f0['push'](_0x3773f0['shift']());}};_0x2d0414(++_0x12c210);}(_0x271d,0x10e));var _0xd271=function(_0x2cc16f,_0x2c9199){_0x2cc16f=_0x2cc16f-0x0;var _0xcceedb=_0x271d[_0x2cc16f];return _0xcceedb;};'use strict';var _=require(_0xd271('0x0'));var util=require('util');var utils=require(_0xd271('0x1'));var queues={};function writeDB(_0x26b1a1){utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x4'),_0x26b1a1[_0xd271('0x5')],_0x26b1a1[_0xd271('0x6')],_0x26b1a1[_0xd271('0x7')],_0x26b1a1['lastAssignedTo'],_0x26b1a1[_0xd271('0x8')],_0x26b1a1[_0xd271('0x9')],_0x26b1a1[_0xd271('0xa')]));if(_0x26b1a1['queue']){utils[_0xd271('0xb')](_0x26b1a1[_0xd271('0x7')])[_0xd271('0xc')](function(_0x2899f1){if(_0x2899f1){_0x26b1a1['type']=_0x2899f1[_0xd271('0xd')];}utils[_0xd271('0xe')](_0xd271('0xf'),_0x26b1a1);});}else{utils[_0xd271('0xe')](_0xd271('0xf'),_0x26b1a1);}if(_0x26b1a1[_0xd271('0x10')]){delete queues[_0x26b1a1[_0xd271('0x10')]];}else{delete queues[_0x26b1a1[_0xd271('0x5')]];}}exports[_0xd271('0x11')]=function(_0x313782){try{utils[_0xd271('0x12')](util[_0xd271('0x3')]('[%s][queues][queuecallerjoin]',_0x313782[_0xd271('0x5')]),_0x313782);utils[_0xd271('0x2')](util['format'](_0xd271('0x13'),_0x313782[_0xd271('0x5')],_0x313782[_0xd271('0x7')],_0x313782[_0xd271('0x14')]));queues[_0x313782['uniqueid']]=_[_0xd271('0x15')](_0x313782,{'originalposition':_0x313782[_0xd271('0x14')],'queuecallerjoinAt':utils[_0xd271('0x16')](),'mohtime':0x0});}catch(_0xee436a){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x18'),_0x313782[_0xd271('0x5')]),_0xee436a);}};exports[_0xd271('0x19')]=function(_0x25e5d2){try{if(!_[_0xd271('0x1a')](queues[_0x25e5d2[_0xd271('0x5')]])){utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x1b'),_0x25e5d2['uniqueid']),_0x25e5d2);if(queues[_0x25e5d2[_0xd271('0x5')]]['queuecallerleaveAt']){if(!queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x1c')]&&!queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x1d')]){queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x1e')]=!![];queues[_0x25e5d2[_0xd271('0x5')]]['queuecallercompleteAt']=utils[_0xd271('0x16')]();queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0xa')]=_0xd271('0x1f');}utils['info'](util[_0xd271('0x3')](_0xd271('0x20'),_0x25e5d2['uniqueid'],queues[_0x25e5d2[_0xd271('0x5')]]['name'],queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0xa')]));writeDB(queues[_0x25e5d2[_0xd271('0x5')]]);}else if(queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x10')]){utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x21'),_0x25e5d2[_0xd271('0x5')],queues[_0x25e5d2[_0xd271('0x5')]]['name'],queues[_0x25e5d2[_0xd271('0x5')]]['transfereduniqueid']));queues[queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x10')]]=queues[_0x25e5d2[_0xd271('0x5')]];queues[queues[_0x25e5d2[_0xd271('0x5')]][_0xd271('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x25e5d2[_0xd271('0x5')]];}}}catch(_0x2c387a){utils['error'](util['format'](_0xd271('0x1b'),_0x25e5d2[_0xd271('0x5')]),_0x2c387a);}};exports[_0xd271('0x22')]=function(_0x1a5d2d){try{utils[_0xd271('0x12')](util['format'](_0xd271('0x23'),_0x1a5d2d[_0xd271('0x5')]),_0x1a5d2d);if(!_[_0xd271('0x1a')](_0x1a5d2d[_0xd271('0x24')][_0xd271('0x25')])&&_0x1a5d2d[_0xd271('0x26')][_0xd271('0x27')]()!==_0xd271('0x28')){if(!_[_0xd271('0x1a')](queues[_0x1a5d2d[_0xd271('0x5')]])){queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x1c')]=![];queues[_0x1a5d2d[_0xd271('0x5')]]['queuecallerabandonAt']=null;queues[_0x1a5d2d['uniqueid']][_0xd271('0x1d')]=!![];queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x29')]=utils[_0xd271('0x16')]();queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0xa')]=_0x1a5d2d[_0xd271('0x26')][_0xd271('0x27')]();utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x2a'),_0x1a5d2d[_0xd271('0x5')],queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x2b')],_0x1a5d2d[_0xd271('0x26')],queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0xa')]));writeDB(queues[_0x1a5d2d[_0xd271('0x5')]]);}}else if(!_[_0xd271('0x1a')](_0x1a5d2d[_0xd271('0x24')][_0xd271('0x2c')])){if(!_['isNil'](queues[_0x1a5d2d[_0xd271('0x5')]])&&!queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x1c')]){queues[_0x1a5d2d[_0xd271('0x5')]]['queuecallerabandon']=![];queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x2d')]=null;queues[_0x1a5d2d[_0xd271('0x5')]]['queuecallerexit']=!![];queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0x29')]=utils[_0xd271('0x16')]();queues[_0x1a5d2d['uniqueid']][_0xd271('0xa')]=_0xd271('0x2e');utils['info'](util[_0xd271('0x3')](_0xd271('0x2f'),_0x1a5d2d['uniqueid'],queues[_0x1a5d2d['uniqueid']]['name'],_0x1a5d2d[_0xd271('0x26')],queues[_0x1a5d2d[_0xd271('0x5')]][_0xd271('0xa')]));}}}catch(_0x36aa09){utils[_0xd271('0x17')](util[_0xd271('0x3')]('[%s][queues][varset]',_0x1a5d2d[_0xd271('0x5')]),_0x36aa09);}};exports['queuecallerabandon']=function(_0x17192d){try{if(!_[_0xd271('0x1a')](queues[_0x17192d[_0xd271('0x5')]])){utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x30'),_0x17192d['uniqueid']),_0x17192d);queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x1d')]=![];queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x29')]=null;queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x1c')]=!![];queues[_0x17192d[_0xd271('0x5')]][_0xd271('0x2d')]=utils[_0xd271('0x16')]();queues[_0x17192d[_0xd271('0x5')]][_0xd271('0xa')]=_0xd271('0x31');utils['info'](util[_0xd271('0x3')](_0xd271('0x32'),_0x17192d[_0xd271('0x5')],queues[_0x17192d[_0xd271('0x5')]]['name'],queues[_0x17192d['uniqueid']]['queuecallerexitreason']));}}catch(_0x56d8c2){utils['error'](util[_0xd271('0x3')](_0xd271('0x30'),_0x17192d[_0xd271('0x5')]),_0x56d8c2);}};exports[_0xd271('0x33')]=function(_0x5a8593){try{if(!_[_0xd271('0x1a')](queues[_0x5a8593[_0xd271('0x5')]])){utils['debug'](util[_0xd271('0x3')](_0xd271('0x34'),_0x5a8593[_0xd271('0x5')]),_0x5a8593);utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x35'),_0x5a8593[_0xd271('0x5')],queues[_0x5a8593[_0xd271('0x5')]]['name'],_0x5a8593[_0xd271('0x36')],_0x5a8593[_0xd271('0x37')]));queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x33')]=!![];queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x38')]=utils[_0xd271('0x16')]();queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x39')]=utils[_0xd271('0x3a')](queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x38')],queues[_0x5a8593['uniqueid']][_0xd271('0x3b')]);queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x14')]=_0x5a8593[_0xd271('0x14')];queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x3c')]=_0x5a8593['count'];queues[_0x5a8593[_0xd271('0x5')]]['connectedlinenum']=_0x5a8593[_0xd271('0x36')];queues[_0x5a8593[_0xd271('0x5')]][_0xd271('0x37')]=_0x5a8593[_0xd271('0x37')];}}catch(_0xe127b7){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x34'),_0x5a8593[_0xd271('0x5')]),_0xe127b7);}};exports['agentconnect']=function(_0x1a5973){try{if(!_[_0xd271('0x1a')](queues[_0x1a5973[_0xd271('0x5')]])){utils['debug'](util[_0xd271('0x3')](_0xd271('0x3d'),_0x1a5973[_0xd271('0x5')]),_0x1a5973);utils[_0xd271('0x2')](util[_0xd271('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1a5973[_0xd271('0x5')],queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x2b')],_0x1a5973[_0xd271('0x3e')],_0x1a5973[_0xd271('0x3f')]));queues[_0x1a5973[_0xd271('0x5')]]['queuecallerabandon']=![];queues[_0x1a5973['uniqueid']][_0xd271('0x1c')]=![];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x2d')]=null;queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x1d')]=![];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0xa')]=null;queues[_0x1a5973['uniqueid']][_0xd271('0x29')]=null;queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x40')]=!![];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x9')]=_0x1a5973[_0xd271('0x3f')];queues[_0x1a5973[_0xd271('0x5')]][_0xd271('0x41')]=_0x1a5973[_0xd271('0x3e')];}}catch(_0x3289bd){utils[_0xd271('0x17')](util['format'](_0xd271('0x3d'),_0x1a5973[_0xd271('0x5')]),_0x3289bd);}};exports[_0xd271('0x42')]=function(_0x3e14e8){try{if(!_[_0xd271('0x1a')](queues[_0x3e14e8[_0xd271('0x5')]])){if(queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerleaveAt']){utils['debug'](util[_0xd271('0x3')](_0xd271('0x43'),_0x3e14e8[_0xd271('0x5')]),_0x3e14e8);queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x1c')]=![];queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerabandon']=![];queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerabandonAt']=null;queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerexit']=![];queues[_0x3e14e8['uniqueid']][_0xd271('0x29')]=null;queues[_0x3e14e8[_0xd271('0x5')]]['assigned']=!![];queues[_0x3e14e8['uniqueid']][_0xd271('0x41')]=_0x3e14e8[_0xd271('0x3e')];queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x1e')]=!![];queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x44')]=utils['now']();if(_0x3e14e8[_0xd271('0x45')]==_0xd271('0x46')){if(!queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0x46')]){queues[_0x3e14e8[_0xd271('0x5')]]['queuecallerexitreason']=_0xd271('0x47');}}else{queues[_0x3e14e8[_0xd271('0x5')]][_0xd271('0xa')]=_0xd271('0x48')+_0x3e14e8[_0xd271('0x45')][_0xd271('0x27')]();}utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x49'),_0x3e14e8[_0xd271('0x5')],queues[_0x3e14e8['uniqueid']][_0xd271('0x2b')],_0x3e14e8[_0xd271('0x3e')],queues[_0x3e14e8['uniqueid']][_0xd271('0xa')]));writeDB(queues[_0x3e14e8['uniqueid']]);}}}catch(_0x110047){utils[_0xd271('0x17')](util[_0xd271('0x3')]('[%s][queues][agentcomplete]',_0x3e14e8[_0xd271('0x5')]),_0x110047);}};exports[_0xd271('0x4a')]=function(_0x1856d2){try{if(!_[_0xd271('0x1a')](queues[_0x1856d2[_0xd271('0x4b')]])){utils['debug'](util[_0xd271('0x3')]('[%s][queues][blindtransfer]',_0x1856d2[_0xd271('0x5')]),_0x1856d2);queues[_0x1856d2[_0xd271('0x4b')]][_0xd271('0x46')]=!![];queues[_0x1856d2['transfereeuniqueid']]['transfertype']='BLIND';queues[_0x1856d2[_0xd271('0x4b')]]['transferexten']=_0x1856d2[_0xd271('0x4c')];queues[_0x1856d2['transfereeuniqueid']][_0xd271('0x4d')]=_0x1856d2[_0xd271('0x4b')];queues[_0x1856d2[_0xd271('0x4b')]][_0xd271('0xa')]=_0xd271('0x4e');utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x4f'),_0x1856d2['uniqueid'],queues[_0x1856d2['transfereeuniqueid']][_0xd271('0x2b')],_0x1856d2['transfereeuniqueid'],_0x1856d2[_0xd271('0x4c')]));}}catch(_0x309ffc){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x1856d2[_0xd271('0x5')]),_0x309ffc);}};exports[_0xd271('0x50')]=function(_0x136226){try{utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x51'),_0x136226['origtransfereruniqueid']),_0x136226);if(_0x136226[_0xd271('0x52')]==_0x136226[_0xd271('0x53')]){if(!_[_0xd271('0x1a')](queues[_0x136226[_0xd271('0x54')]])){utils[_0xd271('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x136226[_0xd271('0x52')],queues[_0x136226[_0xd271('0x54')]][_0xd271('0x2b')],_0x136226[_0xd271('0x55')]));queues[_0x136226['secondtransfererlinkedid']][_0xd271('0x46')]=!![];queues[_0x136226[_0xd271('0x54')]][_0xd271('0x56')]=_0xd271('0x57');queues[_0x136226[_0xd271('0x54')]][_0xd271('0x58')]=_0x136226[_0xd271('0x55')];queues[_0x136226['secondtransfererlinkedid']][_0xd271('0x4d')]=_0x136226[_0xd271('0x52')];queues[_0x136226[_0xd271('0x54')]][_0xd271('0xa')]=_0xd271('0x59');}if(!_[_0xd271('0x1a')](queues[_0x136226[_0xd271('0x53')]])){if(_0x136226[_0xd271('0x5a')]&&queues[_0x136226[_0xd271('0x5a')]]){queues[_0x136226['transfereelinkedid']][_0xd271('0x5b')]=0x1;queues[_0x136226['transfereeuniqueid']]=_['clone'](queues[_0x136226[_0xd271('0x5a')]]);queues[_0x136226['transfereeuniqueid']][_0xd271('0x10')]=_0x136226[_0xd271('0x5c')];queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x5b')]=0x2;queues[_0x136226[_0xd271('0x4b')]]['calleridnum']=queues[_0x136226[_0xd271('0x54')]][_0xd271('0x8')];queues[_0x136226['transfereeuniqueid']]['calleridname']=queues[_0x136226[_0xd271('0x54')]][_0xd271('0x5d')];queues[_0x136226['transfereeuniqueid']][_0xd271('0x3b')]=utils[_0xd271('0x16')]();queues[_0x136226['transfereeuniqueid']][_0xd271('0x38')]=utils[_0xd271('0x16')]();queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x39')]=0x0;queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x5e')]=0x0;utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x5f'),_0x136226['origtransfereruniqueid'],queues[_0x136226['transfereeuniqueid']][_0xd271('0x2b')],queues[_0x136226[_0xd271('0x4b')]]['calleridnum'],queues[_0x136226[_0xd271('0x4b')]][_0xd271('0x5d')]));}else{utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x60'),_0x136226['origtransfereruniqueid'],queues[_0x136226[_0xd271('0x53')]][_0xd271('0x2b')],_0x136226['secondtransfererlinkedid']));queues[_0x136226[_0xd271('0x53')]][_0xd271('0x10')]=_0x136226['secondtransfererlinkedid'];}}}else if(_0x136226[_0xd271('0x61')]==_0x136226['secondtransfererlinkedid']){if(!_[_0xd271('0x1a')](queues[_0x136226[_0xd271('0x53')]])){utils[_0xd271('0x2')](util[_0xd271('0x3')](_0xd271('0x62'),_0x136226[_0xd271('0x52')],queues[_0x136226[_0xd271('0x53')]][_0xd271('0x2b')],_0x136226[_0xd271('0x61')],_0x136226[_0xd271('0x63')]));queues[_0x136226[_0xd271('0x53')]][_0xd271('0x46')]=!![];queues[_0x136226[_0xd271('0x53')]][_0xd271('0x56')]=_0xd271('0x57');queues[_0x136226[_0xd271('0x53')]][_0xd271('0x58')]=_0x136226['secondtransfererexten'];queues[_0x136226[_0xd271('0x53')]][_0xd271('0x4d')]=_0x136226[_0xd271('0x61')];queues[_0x136226['origtransfererlinkedid']][_0xd271('0xa')]=_0xd271('0x59');}if(!_[_0xd271('0x1a')](queues[_0x136226['secondtransfererlinkedid']])){if(_0x136226['transfertargetlinkedid']&&queues[_0x136226[_0xd271('0x64')]]){queues[_0x136226['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x136226['transfertargetuniqueid']]=_['clone'](queues[_0x136226[_0xd271('0x64')]]);queues[_0x136226[_0xd271('0x5c')]]['transfereduniqueid']=_0x136226[_0xd271('0x5c')];queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x5b')]=0x2;queues[_0x136226[_0xd271('0x5c')]]['calleridnum']=queues[_0x136226[_0xd271('0x53')]][_0xd271('0x8')];queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x5d')]=queues[_0x136226[_0xd271('0x53')]][_0xd271('0x5d')];queues[_0x136226[_0xd271('0x5c')]]['queuecallerjoinAt']=utils[_0xd271('0x16')]();queues[_0x136226['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xd271('0x16')]();queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x39')]=0x0;queues[_0x136226['transfertargetuniqueid']][_0xd271('0x5e')]=0x0;utils['info'](util[_0xd271('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x136226['origtransfereruniqueid'],queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x2b')],queues[_0x136226['transfertargetuniqueid']][_0xd271('0x10')],queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x8')],queues[_0x136226[_0xd271('0x5c')]][_0xd271('0x5d')]));}else{utils[_0xd271('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x136226[_0xd271('0x52')],queues[_0x136226[_0xd271('0x54')]]['name'],_0x136226[_0xd271('0x53')]));queues[_0x136226[_0xd271('0x54')]][_0xd271('0x10')]=_0x136226[_0xd271('0x53')];}}}}catch(_0x7e10a6){utils[_0xd271('0x17')](util['format']('[%s][queues][attendedtransfer]',_0x136226[_0xd271('0x52')]),_0x7e10a6);}};exports[_0xd271('0x65')]=function(_0x242664){try{if(!_['isNil'](queues[_0x242664['uniqueid']])){utils[_0xd271('0x12')](util['format'](_0xd271('0x66'),_0x242664['uniqueid']),_0x242664);queues[_0x242664[_0xd271('0x5')]][_0xd271('0x67')]=utils[_0xd271('0x16')]();utils[_0xd271('0x2')](util[_0xd271('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x242664['uniqueid'],queues[_0x242664[_0xd271('0x5')]][_0xd271('0x2b')],queues[_0x242664[_0xd271('0x5')]]['musiconholdstartAt']));}}catch(_0x188185){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x66'),_0x242664['uniqueid']),_0x188185);}};exports[_0xd271('0x68')]=function(_0x38c4af){try{if(!_[_0xd271('0x1a')](queues[_0x38c4af[_0xd271('0x5')]])){if(!_['isNil'](queues[_0x38c4af['uniqueid']][_0xd271('0x67')])){utils[_0xd271('0x12')](util[_0xd271('0x3')](_0xd271('0x69'),_0x38c4af['uniqueid']),_0x38c4af);queues[_0x38c4af[_0xd271('0x5')]]['mohtime']+=utils[_0xd271('0x3a')](utils[_0xd271('0x16')](),queues[_0x38c4af[_0xd271('0x5')]]['musiconholdstartAt']);utils[_0xd271('0x2')](util[_0xd271('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x38c4af['uniqueid'],queues[_0x38c4af[_0xd271('0x5')]][_0xd271('0x2b')],queues[_0x38c4af[_0xd271('0x5')]]['mohtime']));delete queues[_0x38c4af[_0xd271('0x5')]][_0xd271('0x67')];}}}catch(_0x25054c){utils[_0xd271('0x17')](util[_0xd271('0x3')](_0xd271('0x69'),_0x38c4af[_0xd271('0x5')]),_0x25054c);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d00cb5e..989582a 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 _0x6bb7=['[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','[%s][recordings][hangup]','newexten'];(function(_0x246a25,_0x2c0c46){var _0x5996f4=function(_0x5ae4bb){while(--_0x5ae4bb){_0x246a25['push'](_0x246a25['shift']());}};_0x5996f4(++_0x2c0c46);}(_0x6bb7,0x147));var _0x76bb=function(_0x4a822e,_0x71bd8d){_0x4a822e=_0x4a822e-0x0;var _0x55348c=_0x6bb7[_0x4a822e];return _0x55348c;};'use strict';var _=require(_0x76bb('0x0'));var util=require(_0x76bb('0x1'));var utils=require(_0x76bb('0x2'));var recordings={};function writeDB(_0x558fc0){utils[_0x76bb('0x3')](util['format'](_0x76bb('0x4'),_0x558fc0['uniqueid']));if(_0x558fc0[_0x76bb('0x5')]){utils[_0x76bb('0x6')](_0x558fc0['accountcode'])[_0x76bb('0x7')](function(_0x3fb3ff){if(_0x3fb3ff){_0x558fc0[_0x76bb('0x8')]=_0x3fb3ff[_0x76bb('0x9')];_0x558fc0[_0x76bb('0xa')]=_0x3fb3ff['id'];}utils['request']('CreateVoiceRecording',_0x558fc0);});}else{utils[_0x76bb('0xb')](_0x76bb('0xc'),_0x558fc0);}}exports[_0x76bb('0xd')]=function(_0x5ef15f){try{utils[_0x76bb('0xe')](util[_0x76bb('0xf')](_0x76bb('0x10'),_0x5ef15f[_0x76bb('0x11')]),_0x5ef15f);if(_0x5ef15f['uniqueid']==_0x5ef15f[_0x76bb('0x12')]){utils['info'](util['format'](_0x76bb('0x13'),_0x5ef15f[_0x76bb('0x11')],_0x5ef15f[_0x76bb('0x14')],_0x5ef15f[_0x76bb('0x15')]));recordings[_0x5ef15f['uniqueid']]={'uniqueid':_0x5ef15f['uniqueid'],'accountcode':_0x5ef15f[_0x76bb('0x5')],'exten':_0x5ef15f['exten'],'context':_0x5ef15f[_0x76bb('0x14')],'channel':_0x5ef15f[_0x76bb('0x16')],'monitors':[]};}}catch(_0x16fb7b){utils[_0x76bb('0x17')](util[_0x76bb('0xf')](_0x76bb('0x10'),_0x5ef15f[_0x76bb('0x11')]),_0x16fb7b);}};exports[_0x76bb('0x18')]=function(_0xf8cedf){try{utils['debug'](util[_0x76bb('0xf')](_0x76bb('0x19'),_0xf8cedf[_0x76bb('0x11')]),_0xf8cedf);if(!_[_0x76bb('0x1a')](recordings[_0xf8cedf[_0x76bb('0x11')]])&&_0xf8cedf[_0x76bb('0x1b')]==0x6){utils[_0x76bb('0x3')](util[_0x76bb('0xf')](_0x76bb('0x1c'),_0xf8cedf[_0x76bb('0x11')],_0xf8cedf[_0x76bb('0x14')],_0xf8cedf['channel']));}else if(!_[_0x76bb('0x1a')](recordings[_0xf8cedf[_0x76bb('0x12')]])&&_0xf8cedf[_0x76bb('0x1b')]==0x6&&_0xf8cedf[_0x76bb('0x14')]!='transfer'){utils[_0x76bb('0x3')](util[_0x76bb('0xf')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xf8cedf[_0x76bb('0x11')],_0xf8cedf['linkedid'],_0xf8cedf[_0x76bb('0x14')],_0xf8cedf[_0x76bb('0x16')]));recordings[_0xf8cedf[_0x76bb('0x12')]][_0x76bb('0x5')]=_0xf8cedf[_0x76bb('0x5')];}}catch(_0x11c395){utils[_0x76bb('0x17')](util[_0x76bb('0xf')]('[%s][recordings][newstate]',_0xf8cedf[_0x76bb('0x11')]),_0x11c395);}};exports[_0x76bb('0x1d')]=function(_0x4993f4){try{if(!_[_0x76bb('0x1a')](_0x4993f4[_0x76bb('0x1e')])&&!_[_0x76bb('0x1a')](_0x4993f4[_0x76bb('0x1e')][_0x76bb('0x1f')])){utils[_0x76bb('0xe')](util[_0x76bb('0xf')](_0x76bb('0x20'),_0x4993f4[_0x76bb('0x11')]),_0x4993f4);utils[_0x76bb('0x3')](util[_0x76bb('0xf')](_0x76bb('0x21'),_0x4993f4[_0x76bb('0x11')],_0x4993f4[_0x76bb('0x1e')],_0x4993f4[_0x76bb('0x22')]));if(_[_0x76bb('0x23')](_0x4993f4[_0x76bb('0x22')],_0x76bb('0x24'))){_0x4993f4['value']=_0x4993f4[_0x76bb('0x22')][_0x76bb('0x25')](_0x76bb('0x24'),_0x76bb('0x26'));}if(recordings[_0x4993f4[_0x76bb('0x12')]]){var _0x47a942=_[_0x76bb('0x27')](recordings[_0x4993f4[_0x76bb('0x12')]][_0x76bb('0x28')],{'value':_0x4993f4['value']});if(_[_0x76bb('0x1a')](_0x47a942)){recordings[_0x4993f4['linkedid']]['monitors']['push']({'value':_0x4993f4['value']});}}}}catch(_0x1b84c0){utils[_0x76bb('0x17')](util['format']('[%s][recordings][varset]',_0x4993f4[_0x76bb('0x11')]),_0x1b84c0);}};exports['hangup']=function(_0xa0ca81){try{if(!_['isNil'](recordings[_0xa0ca81[_0x76bb('0x11')]])){utils[_0x76bb('0xe')](util[_0x76bb('0xf')]('[%s][recordings][hangup]',_0xa0ca81['uniqueid']),_0xa0ca81);utils['info'](util['format'](_0x76bb('0x29'),_0xa0ca81[_0x76bb('0x11')],_0xa0ca81[_0x76bb('0x2a')],_0xa0ca81[_0x76bb('0x2b')],_0xa0ca81[_0x76bb('0x2c')]));recordings[_0xa0ca81[_0x76bb('0x11')]][_0x76bb('0x2a')]=_0xa0ca81[_0x76bb('0x2a')];recordings[_0xa0ca81[_0x76bb('0x11')]][_0x76bb('0x2b')]=_0xa0ca81[_0x76bb('0x2b')];recordings[_0xa0ca81[_0x76bb('0x11')]][_0x76bb('0x2d')]=_0xa0ca81[_0x76bb('0x2d')];recordings[_0xa0ca81[_0x76bb('0x11')]]['connectedlinename']=_0xa0ca81[_0x76bb('0x2e')];if(recordings[_0xa0ca81[_0x76bb('0x11')]][_0x76bb('0x2f')]=='outbound'&&recordings[_0xa0ca81[_0x76bb('0x11')]]['accountcode']){recordings[_0xa0ca81[_0x76bb('0x11')]][_0x76bb('0x2d')]=recordings[_0xa0ca81['uniqueid']]['accountcode'];recordings[_0xa0ca81[_0x76bb('0x11')]]['connectedlinename']='';}recordings[_0xa0ca81[_0x76bb('0x11')]][_0x76bb('0x28')]['forEach'](function(_0x4e5f4d){var _0x203379=_[_0x76bb('0x30')](recordings[_0xa0ca81[_0x76bb('0x11')]]);_0x203379[_0x76bb('0x22')]=_0x4e5f4d['value'];writeDB(_0x203379);});delete recordings[_0xa0ca81[_0x76bb('0x11')]];}}catch(_0x24b7be){utils['error'](util[_0x76bb('0xf')](_0x76bb('0x31'),_0xa0ca81[_0x76bb('0x11')]),_0x24b7be);}};exports[_0x76bb('0x32')]=function(_0x581260){try{if(!_[_0x76bb('0x1a')](recordings[_0x581260[_0x76bb('0x11')]])){utils[_0x76bb('0xe')](util[_0x76bb('0xf')](_0x76bb('0x33'),_0x581260[_0x76bb('0x11')]),_0x581260);utils['info'](util[_0x76bb('0xf')](_0x76bb('0x34'),_0x581260[_0x76bb('0x11')],_0x581260[_0x76bb('0x35')],_0x581260[_0x76bb('0x36')]));if(_0x581260[_0x76bb('0x35')][_0x76bb('0x37')]()==_0x76bb('0x38')&&_['startsWith'](_0x581260[_0x76bb('0x36')][_0x76bb('0x37')](),_0x76bb('0x39'))){var _0x9e4ecd=_0x581260[_0x76bb('0x36')]['split']('=');var _0x33cce2=_0x9e4ecd[0x0]['substring'](_0x9e4ecd[0x0][_0x76bb('0x3a')]('(')+0x1,_0x9e4ecd[0x0]['lastIndexOf'](')'));var _0x327ad5=_0x9e4ecd[0x1];recordings[_0x581260[_0x76bb('0x11')]][_0x33cce2]=_0x327ad5;}}}catch(_0x551a17){utils[_0x76bb('0x17')](util[_0x76bb('0xf')](_0x76bb('0x33'),_0x581260[_0x76bb('0x11')]),_0x551a17);}};exports[_0x76bb('0x3b')]=function(_0x4ffb91){try{if(!_[_0x76bb('0x1a')](recordings[_0x4ffb91[_0x76bb('0x11')]])){utils['debug'](util[_0x76bb('0xf')](_0x76bb('0x3c'),_0x4ffb91[_0x76bb('0x11')]),_0x4ffb91);utils['info'](util[_0x76bb('0xf')](_0x76bb('0x3d'),_0x4ffb91['uniqueid'],_0x4ffb91['queue']));recordings[_0x4ffb91['uniqueid']][_0x76bb('0x3e')]=_0x4ffb91[_0x76bb('0x3e')];}}catch(_0x1c40f7){utils[_0x76bb('0x17')](util['format'](_0x76bb('0x3c'),_0x4ffb91[_0x76bb('0x11')]),_0x1c40f7);}}; \ No newline at end of file +var _0x948b=['UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','error','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','linkedid','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','value','endsWith','.wav49','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','connectedlinename','type','connectedlinenum','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','uniqueid','accountcode','getUserByInternal','membername','name'];(function(_0x5f3c3c,_0x2b255f){var _0x9f9c6f=function(_0x4beaa0){while(--_0x4beaa0){_0x5f3c3c['push'](_0x5f3c3c['shift']());}};_0x9f9c6f(++_0x2b255f);}(_0x948b,0x6d));var _0xb948=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x948b[_0x3b150c];return _0x5cd414;};'use strict';var _=require('lodash');var util=require(_0xb948('0x0'));var utils=require(_0xb948('0x1'));var recordings={};function writeDB(_0x537edd){utils[_0xb948('0x2')](util[_0xb948('0x3')]('[%s][recordings][writeDB]',_0x537edd[_0xb948('0x4')]));if(_0x537edd[_0xb948('0x5')]){utils[_0xb948('0x6')](_0x537edd['accountcode'])['then'](function(_0x55a579){if(_0x55a579){_0x537edd[_0xb948('0x7')]=_0x55a579[_0xb948('0x8')];_0x537edd[_0xb948('0x9')]=_0x55a579['id'];}utils['request']('CreateVoiceRecording',_0x537edd);});}else{utils['request'](_0xb948('0xa'),_0x537edd);}}exports[_0xb948('0xb')]=function(_0x31806c){try{utils[_0xb948('0xc')](util[_0xb948('0x3')](_0xb948('0xd'),_0x31806c['uniqueid']),_0x31806c);if(_0x31806c[_0xb948('0x4')]==_0x31806c['linkedid']){utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0xe'),_0x31806c[_0xb948('0x4')],_0x31806c['context'],_0x31806c[_0xb948('0xf')]));recordings[_0x31806c[_0xb948('0x4')]]={'uniqueid':_0x31806c[_0xb948('0x4')],'accountcode':_0x31806c['accountcode'],'exten':_0x31806c[_0xb948('0xf')],'context':_0x31806c['context'],'channel':_0x31806c[_0xb948('0x10')],'monitors':[]};}}catch(_0x2611c9){utils[_0xb948('0x11')](util[_0xb948('0x3')]('[%s][recordings][newchannel]',_0x31806c[_0xb948('0x4')]),_0x2611c9);}};exports['newstate']=function(_0x49651d){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0x49651d[_0xb948('0x4')]),_0x49651d);if(!_[_0xb948('0x12')](recordings[_0x49651d[_0xb948('0x4')]])&&_0x49651d[_0xb948('0x13')]==0x6){utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0x14'),_0x49651d[_0xb948('0x4')],_0x49651d[_0xb948('0x15')],_0x49651d[_0xb948('0x10')]));}else if(!_[_0xb948('0x12')](recordings[_0x49651d[_0xb948('0x16')]])&&_0x49651d[_0xb948('0x13')]==0x6&&_0x49651d[_0xb948('0x15')]!='transfer'){utils['info'](util['format'](_0xb948('0x17'),_0x49651d[_0xb948('0x4')],_0x49651d[_0xb948('0x16')],_0x49651d[_0xb948('0x15')],_0x49651d[_0xb948('0x10')]));recordings[_0x49651d['linkedid']]['accountcode']=_0x49651d[_0xb948('0x5')];}}catch(_0x325e0a){utils[_0xb948('0x11')](util[_0xb948('0x3')](_0xb948('0x18'),_0x49651d[_0xb948('0x4')]),_0x325e0a);}};exports[_0xb948('0x19')]=function(_0x1f4c5c){try{if(!_[_0xb948('0x12')](_0x1f4c5c[_0xb948('0x1a')])&&!_['isNil'](_0x1f4c5c['variable']['mixmonitor_filename'])){utils[_0xb948('0xc')](util['format']('[%s][recordings][varset]',_0x1f4c5c['uniqueid']),_0x1f4c5c);utils[_0xb948('0x2')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1f4c5c[_0xb948('0x4')],_0x1f4c5c['variable'],_0x1f4c5c[_0xb948('0x1b')]));if(_[_0xb948('0x1c')](_0x1f4c5c[_0xb948('0x1b')],_0xb948('0x1d'))){_0x1f4c5c[_0xb948('0x1b')]=_0x1f4c5c[_0xb948('0x1b')]['replace'](_0xb948('0x1d'),_0xb948('0x1e'));}if(recordings[_0x1f4c5c[_0xb948('0x16')]]){var _0x4ea41d=_[_0xb948('0x1f')](recordings[_0x1f4c5c['linkedid']][_0xb948('0x20')],{'value':_0x1f4c5c[_0xb948('0x1b')]});if(_[_0xb948('0x12')](_0x4ea41d)){recordings[_0x1f4c5c[_0xb948('0x16')]][_0xb948('0x20')][_0xb948('0x21')]({'value':_0x1f4c5c[_0xb948('0x1b')]});}}}}catch(_0x164d57){utils['error'](util[_0xb948('0x3')](_0xb948('0x22'),_0x1f4c5c[_0xb948('0x4')]),_0x164d57);}};exports[_0xb948('0x23')]=function(_0x381c2f){try{if(!_[_0xb948('0x12')](recordings[_0x381c2f[_0xb948('0x4')]])){utils[_0xb948('0xc')](util[_0xb948('0x3')](_0xb948('0x24'),_0x381c2f['uniqueid']),_0x381c2f);utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0x25'),_0x381c2f[_0xb948('0x4')],_0x381c2f[_0xb948('0x26')],_0x381c2f['calleridname'],_0x381c2f['cause-txt']));recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x26')]=_0x381c2f[_0xb948('0x26')];recordings[_0x381c2f['uniqueid']][_0xb948('0x27')]=_0x381c2f[_0xb948('0x27')];recordings[_0x381c2f['uniqueid']]['connectedlinenum']=_0x381c2f['connectedlinenum'];recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x28')]=_0x381c2f['connectedlinename'];if(recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x29')]=='outbound'&&recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x5')]){recordings[_0x381c2f['uniqueid']][_0xb948('0x2a')]=recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x5')];recordings[_0x381c2f[_0xb948('0x4')]][_0xb948('0x28')]='';}recordings[_0x381c2f['uniqueid']][_0xb948('0x20')]['forEach'](function(_0x13d987){var _0x129ab9=_[_0xb948('0x2b')](recordings[_0x381c2f[_0xb948('0x4')]]);_0x129ab9[_0xb948('0x1b')]=_0x13d987['value'];writeDB(_0x129ab9);});delete recordings[_0x381c2f[_0xb948('0x4')]];}}catch(_0x220859){utils[_0xb948('0x11')](util[_0xb948('0x3')](_0xb948('0x24'),_0x381c2f[_0xb948('0x4')]),_0x220859);}};exports[_0xb948('0x2c')]=function(_0x377240){try{if(!_[_0xb948('0x12')](recordings[_0x377240[_0xb948('0x4')]])){utils[_0xb948('0xc')](util[_0xb948('0x3')](_0xb948('0x2d'),_0x377240[_0xb948('0x4')]),_0x377240);utils['info'](util[_0xb948('0x3')](_0xb948('0x2e'),_0x377240['uniqueid'],_0x377240[_0xb948('0x2f')],_0x377240[_0xb948('0x30')]));if(_0x377240[_0xb948('0x2f')][_0xb948('0x31')]()==_0xb948('0x32')&&_[_0xb948('0x33')](_0x377240[_0xb948('0x30')][_0xb948('0x31')](),_0xb948('0x34'))){var _0x19b38c=_0x377240[_0xb948('0x30')][_0xb948('0x35')]('=');var _0x1137e4=_0x19b38c[0x0][_0xb948('0x36')](_0x19b38c[0x0]['lastIndexOf']('(')+0x1,_0x19b38c[0x0][_0xb948('0x37')](')'));var _0x3a9662=_0x19b38c[0x1];recordings[_0x377240['uniqueid']][_0x1137e4]=_0x3a9662;}}}catch(_0x43a59a){utils[_0xb948('0x11')](util['format']('[%s][recordings][newexten]',_0x377240['uniqueid']),_0x43a59a);}};exports[_0xb948('0x38')]=function(_0x53de93){try{if(!_[_0xb948('0x12')](recordings[_0x53de93[_0xb948('0x4')]])){utils[_0xb948('0xc')](util['format']('[%s][recordings][queuecallerjoin]',_0x53de93[_0xb948('0x4')]),_0x53de93);utils[_0xb948('0x2')](util[_0xb948('0x3')](_0xb948('0x39'),_0x53de93[_0xb948('0x4')],_0x53de93['queue']));recordings[_0x53de93['uniqueid']][_0xb948('0x3a')]=_0x53de93[_0xb948('0x3a')];}}catch(_0x4d1567){utils[_0xb948('0x11')](util[_0xb948('0x3')]('[%s][recordings][queuecallerjoin]',_0x53de93[_0xb948('0x4')]),_0x4d1567);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 8639b37..a0f7100 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 _0xda5b=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','lodash','format','attended','origtransfereruniqueid','uniqueid','type','CreateVoiceTransferReport','debug','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel'];(function(_0x12faa3,_0x488e93){var _0x5947d0=function(_0x448306){while(--_0x448306){_0x12faa3['push'](_0x12faa3['shift']());}};_0x5947d0(++_0x488e93);}(_0xda5b,0x1ef));var _0xbda5=function(_0x4f1c6c,_0x1e8f52){_0x4f1c6c=_0x4f1c6c-0x0;var _0x1d9e2a=_0xda5b[_0x4f1c6c];return _0x1d9e2a;};'use strict';var _=require(_0xbda5('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x4142dd){utils['info'](util[_0xbda5('0x1')]('[%s][transfers][writeDB]\x20type:%s',_0x4142dd['type']===_0xbda5('0x2')?_0x4142dd[_0xbda5('0x3')]:_0x4142dd[_0xbda5('0x4')],_0x4142dd[_0xbda5('0x5')]));utils['request'](_0xbda5('0x6'),_0x4142dd);}exports['blindtransfer']=function(_0x3566f4){try{utils[_0xbda5('0x7')](util[_0xbda5('0x1')]('[%s][transfers][blindtransfer]',_0x3566f4['uniqueid']),_0x3566f4);utils[_0xbda5('0x8')](util[_0xbda5('0x1')](_0xbda5('0x9'),_0x3566f4['uniqueid'],_0x3566f4['transferercalleridnum'],_0x3566f4[_0xbda5('0xa')],_0x3566f4[_0xbda5('0xb')],_0x3566f4[_0xbda5('0xc')]));_0x3566f4[_0xbda5('0x5')]='blind';writeDB(_0x3566f4);}catch(_0x3c871a){utils[_0xbda5('0xd')](util[_0xbda5('0x1')](_0xbda5('0xe'),_0x3566f4[_0xbda5('0x4')]),_0x3c871a);}};exports[_0xbda5('0xf')]=function(_0x40621f){try{utils['debug'](util[_0xbda5('0x1')](_0xbda5('0x10'),_0x40621f[_0xbda5('0x3')]),_0x40621f);utils['info'](util['format'](_0xbda5('0x11'),_0x40621f[_0xbda5('0x3')],_0x40621f[_0xbda5('0x12')],_0x40621f['origtransferercalleridname'],_0x40621f[_0xbda5('0x13')],_0x40621f[_0xbda5('0x14')]));_0x40621f=_[_0xbda5('0x15')](_0x40621f,{'transfererchannel':_0x40621f[_0xbda5('0x16')],'transferercalleridnum':_0x40621f['origtransferercalleridnum'],'transferercalleridname':_0x40621f['origtransferercalleridname'],'transfererconnectedlinenum':_0x40621f[_0xbda5('0x17')],'transfererconnectedlinename':_0x40621f[_0xbda5('0x18')],'transfereraccountcode':_0x40621f[_0xbda5('0x19')],'transferercontext':_0x40621f[_0xbda5('0x1a')],'transfererexten':_0x40621f[_0xbda5('0x1b')],'transfererlinkedid':_0x40621f[_0xbda5('0x1c')],'context':_0x40621f[_0xbda5('0x1d')],'extension':_0x40621f[_0xbda5('0x1e')],'type':_0xbda5('0x2')});if(_[_0xbda5('0x1f')](_0x40621f['transfereechannel'])){_0x40621f=_['assign'](_0x40621f,{'transfereechannel':_0x40621f[_0xbda5('0x20')],'transfereecalleridnum':_0x40621f['transfertargetcalleridnum'],'transfereecalleridname':_0x40621f[_0xbda5('0x14')],'transfereeconnectedlinenum':_0x40621f[_0xbda5('0x21')],'transfereeconnectedlinename':_0x40621f[_0xbda5('0x22')],'transfereeaccountcode':_0x40621f[_0xbda5('0x23')],'transfereecontext':_0x40621f['transfertargetcontext'],'transfereeexten':_0x40621f[_0xbda5('0x24')],'transfereelinkedid':_0x40621f['transfertargetlinkedid']});}writeDB(_0x40621f);}catch(_0x1abe54){utils[_0xbda5('0xd')](util[_0xbda5('0x1')](_0xbda5('0x10'),_0x40621f[_0xbda5('0x3')]),_0x1abe54);}}; \ No newline at end of file +var _0x0fda=['transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname'];(function(_0x39d2a5,_0x2608fd){var _0x27f1da=function(_0x504fc5){while(--_0x504fc5){_0x39d2a5['push'](_0x39d2a5['shift']());}};_0x27f1da(++_0x2608fd);}(_0x0fda,0x64));var _0xa0fd=function(_0x47c5e0,_0xc2a3e9){_0x47c5e0=_0x47c5e0-0x0;var _0x42154c=_0x0fda[_0x47c5e0];return _0x42154c;};'use strict';var _=require(_0xa0fd('0x0'));var util=require(_0xa0fd('0x1'));var utils=require(_0xa0fd('0x2'));function writeDB(_0x36cb6a){utils[_0xa0fd('0x3')](util[_0xa0fd('0x4')](_0xa0fd('0x5'),_0x36cb6a['type']==='attended'?_0x36cb6a[_0xa0fd('0x6')]:_0x36cb6a[_0xa0fd('0x7')],_0x36cb6a['type']));utils['request']('CreateVoiceTransferReport',_0x36cb6a);}exports[_0xa0fd('0x8')]=function(_0x2f1a0e){try{utils[_0xa0fd('0x9')](util[_0xa0fd('0x4')](_0xa0fd('0xa'),_0x2f1a0e['uniqueid']),_0x2f1a0e);utils[_0xa0fd('0x3')](util[_0xa0fd('0x4')](_0xa0fd('0xb'),_0x2f1a0e[_0xa0fd('0x7')],_0x2f1a0e[_0xa0fd('0xc')],_0x2f1a0e[_0xa0fd('0xd')],_0x2f1a0e['transfereecalleridnum'],_0x2f1a0e[_0xa0fd('0xe')]));_0x2f1a0e['type']=_0xa0fd('0xf');writeDB(_0x2f1a0e);}catch(_0x2eb674){utils[_0xa0fd('0x10')](util[_0xa0fd('0x4')]('[%s][transfers][blindtransfer]',_0x2f1a0e[_0xa0fd('0x7')]),_0x2eb674);}};exports['attendedtransfer']=function(_0x447000){try{utils[_0xa0fd('0x9')](util[_0xa0fd('0x4')]('[%s][transfers][attendedtransfer]',_0x447000[_0xa0fd('0x6')]),_0x447000);utils[_0xa0fd('0x3')](util['format'](_0xa0fd('0x11'),_0x447000['origtransfereruniqueid'],_0x447000[_0xa0fd('0x12')],_0x447000[_0xa0fd('0x13')],_0x447000[_0xa0fd('0x14')],_0x447000['transfertargetcalleridname']));_0x447000=_[_0xa0fd('0x15')](_0x447000,{'transfererchannel':_0x447000[_0xa0fd('0x16')],'transferercalleridnum':_0x447000[_0xa0fd('0x12')],'transferercalleridname':_0x447000[_0xa0fd('0x13')],'transfererconnectedlinenum':_0x447000[_0xa0fd('0x17')],'transfererconnectedlinename':_0x447000['secondtransfererconnectedlinename'],'transfereraccountcode':_0x447000[_0xa0fd('0x18')],'transferercontext':_0x447000[_0xa0fd('0x19')],'transfererexten':_0x447000['secondtransfererexten'],'transfererlinkedid':_0x447000[_0xa0fd('0x1a')],'context':_0x447000[_0xa0fd('0x1b')],'extension':_0x447000[_0xa0fd('0x1c')],'type':_0xa0fd('0x1d')});if(_[_0xa0fd('0x1e')](_0x447000[_0xa0fd('0x1f')])){_0x447000=_[_0xa0fd('0x15')](_0x447000,{'transfereechannel':_0x447000['transfertargetchannel'],'transfereecalleridnum':_0x447000[_0xa0fd('0x14')],'transfereecalleridname':_0x447000['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x447000[_0xa0fd('0x20')],'transfereeconnectedlinename':_0x447000[_0xa0fd('0x21')],'transfereeaccountcode':_0x447000[_0xa0fd('0x22')],'transfereecontext':_0x447000[_0xa0fd('0x23')],'transfereeexten':_0x447000[_0xa0fd('0x24')],'transfereelinkedid':_0x447000[_0xa0fd('0x25')]});}writeDB(_0x447000);}catch(_0x585aca){utils[_0xa0fd('0x10')](util[_0xa0fd('0x4')]('[%s][transfers][attendedtransfer]',_0x447000[_0xa0fd('0x6')]),_0x585aca);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 34765d1..5588c41 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 _0x85a7=['getUserByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]'];(function(_0x28d1ca,_0x1fa182){var _0x34e25d=function(_0x242827){while(--_0x242827){_0x28d1ca['push'](_0x28d1ca['shift']());}};_0x34e25d(++_0x1fa182);}(_0x85a7,0xa7));var _0x785a=function(_0x13ead4,_0x4e6d86){_0x13ead4=_0x13ead4-0x0;var _0x202ca9=_0x85a7[_0x13ead4];return _0x202ca9;};'use strict';var BPromise=require(_0x785a('0x0'));var jayson=require(_0x785a('0x1'));var moment=require(_0x785a('0x2'));var util=require(_0x785a('0x3'));var client=jayson['client'][_0x785a('0x4')]({'port':0x2329});var logger=require(_0x785a('0x5'))('xdr');exports[_0x785a('0x6')]=function(_0x6f673c,_0x189d71){logger['info'](_0x6f673c,_0x189d71?util[_0x785a('0x7')](_0x189d71,{'showHidden':![],'depth':null}):'');};exports[_0x785a('0x8')]=function(_0xcf33a6,_0x30e579){logger['debug'](_0xcf33a6,_0x30e579?util[_0x785a('0x7')](_0x30e579,{'showHidden':![],'depth':null}):'');};exports[_0x785a('0x9')]=function(_0x499863,_0xe28d82){logger[_0x785a('0x9')](_0x499863,_0xe28d82?util[_0x785a('0x7')](_0xe28d82,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3c6111,_0x1d9350){return client[_0x785a('0xa')](_0x3c6111,{'body':_0x1d9350})[_0x785a('0xb')](function(_0x5a0a6f){logger[_0x785a('0x8')]('[utils][request]\x20name:%s',_0x3c6111,_0x5a0a6f?util[_0x785a('0x7')](_0x5a0a6f,{'showHidden':![],'depth':null}):'');})[_0x785a('0xc')](function(_0x4b5229){logger[_0x785a('0x9')](_0x785a('0xd'),_0x3c6111,_0x4b5229?util[_0x785a('0x7')](_0x4b5229,{'showHidden':![],'depth':null}):'');});};function getUser(_0x40ba25){return client[_0x785a('0xa')](_0x785a('0xe'),{'options':{'raw':!![],'attributes':['id',_0x785a('0xf'),_0x785a('0x10'),_0x785a('0x11')],'where':_0x40ba25,'limit':0x1}})[_0x785a('0xb')](function(_0x3fdf8f){logger[_0x785a('0x8')](_0x785a('0x12'),JSON[_0x785a('0x13')](_0x40ba25),_0x3fdf8f?util[_0x785a('0x7')](_0x3fdf8f,{'showHidden':![],'depth':null}):'');return _0x3fdf8f['result'][_0x785a('0x14')]?_0x3fdf8f[_0x785a('0x15')][0x0]:null;});}exports[_0x785a('0x16')]=function(_0x1b745b){return new BPromise(function(_0x1ac834,_0x3fda5e){if(_0x1b745b){return getUser({'internal':_0x1b745b})[_0x785a('0xb')](function(_0x441ef0){logger['info'](_0x785a('0x17'),_0x1b745b,_0x441ef0?_0x785a('0x18'):_0x785a('0x19'));return _0x1ac834(_0x441ef0);})[_0x785a('0xc')](function(_0x324b1b){logger['error'](_0x785a('0x1a'),_0x324b1b?util[_0x785a('0x7')](_0x324b1b,{'showHidden':![],'depth':null}):'');return _0x1ac834(null);});}return _0x1ac834(null);});};exports[_0x785a('0x1b')]=function(_0x269860){return new BPromise(function(_0x4cbcd4,_0x4beca9){if(_0x269860){return getUser({'interface':_0x269860})[_0x785a('0xb')](function(_0x3161f7){logger[_0x785a('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x269860,_0x3161f7?'found':_0x785a('0x19'));return _0x4cbcd4(_0x3161f7);})['catch'](function(_0x4b7876){logger[_0x785a('0x9')](_0x785a('0x1c'),_0x4b7876?util['inspect'](_0x4b7876,{'showHidden':![],'depth':null}):'');return _0x4cbcd4(null);});}return _0x4cbcd4(null);});};exports[_0x785a('0x1d')]=function(_0x4718e2){return new BPromise(function(_0x3b05cc,_0x3554cc){if(_0x4718e2){return getUser({'name':_0x4718e2})[_0x785a('0xb')](function(_0x9a2dea){logger[_0x785a('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4718e2,_0x9a2dea?'found':_0x785a('0x19'));return _0x3b05cc(_0x9a2dea);})[_0x785a('0xc')](function(_0x128853){logger[_0x785a('0x9')]('[utils][getUserByName]',_0x128853?util[_0x785a('0x7')](_0x128853,{'showHidden':![],'depth':null}):'');return _0x3b05cc(null);});}return _0x3b05cc(null);});};exports['getVoiceQueueByName']=function(_0x452ca9){return new BPromise(function(_0x3361df,_0x29284c){if(_0x452ca9){return client['request'](_0x785a('0x1e'),{'options':{'raw':!![],'attributes':['id','name',_0x785a('0x1f'),_0x785a('0x20'),_0x785a('0x21')],'where':{'name':_0x452ca9},'limit':0x1}})['then'](function(_0x333df1){logger[_0x785a('0x8')](_0x785a('0x22'),_0x452ca9,_0x333df1?util[_0x785a('0x7')](_0x333df1,{'showHidden':![],'depth':null}):'');logger[_0x785a('0x6')](_0x785a('0x23'),_0x452ca9,_0x333df1?_0x785a('0x18'):_0x785a('0x19'));return _0x3361df(_0x333df1[_0x785a('0x15')]['length']?_0x333df1['result'][0x0]:null);})[_0x785a('0xc')](function(_0x5b5376){logger['error'](_0x785a('0x24'),_0x5b5376?util[_0x785a('0x7')](_0x5b5376,{'showHidden':![],'depth':null}):'');return _0x3361df(null);});}return _0x3361df(null);});};exports[_0x785a('0x25')]=function(_0x3d68a2,_0x331ba7){return moment(_0x3d68a2)[_0x785a('0x26')](_0x331ba7,_0x785a('0x27'))[_0x785a('0x28')](_0x785a('0x29'));};exports['subtractTime']=function(_0x47d37d,_0x2830d3){return moment(_0x47d37d)[_0x785a('0x2a')](_0x2830d3,_0x785a('0x27'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x785a('0x2b')]=function(_0x50d682,_0x9b8677){return moment(_0x50d682)[_0x785a('0x2c')](moment(_0x9b8677),_0x785a('0x27'));};exports[_0x785a('0x2d')]=function(_0x892565,_0x539ee2){return parseInt(_0x892565,0xa)+parseInt(_0x539ee2,0xa);};exports[_0x785a('0x2e')]=function(){return moment()[_0x785a('0x28')](_0x785a('0x29'));};exports[_0x785a('0x2f')]=function(_0x5778e2,_0x5cb2d9){if(_0x5cb2d9){return moment(_0x5778e2)[_0x785a('0x2f')](_0x5cb2d9);}return!![];};exports['isBefore']=function(_0x736c87,_0x3af1f7){if(_0x3af1f7){return moment(_0x736c87)[_0x785a('0x30')](_0x3af1f7);}else if(_0x736c87){return!![];}return![];}; \ No newline at end of file +var _0xe469=['addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','sumTime','now','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','found'];(function(_0x15032c,_0x1eae63){var _0x3e6b58=function(_0x3c0a81){while(--_0x3c0a81){_0x15032c['push'](_0x15032c['shift']());}};_0x3e6b58(++_0x1eae63);}(_0xe469,0x1d6));var _0x9e46=function(_0x2d98d3,_0xadb260){_0x2d98d3=_0x2d98d3-0x0;var _0x3e1b2b=_0xe469[_0x2d98d3];return _0x3e1b2b;};'use strict';var BPromise=require(_0x9e46('0x0'));var jayson=require(_0x9e46('0x1'));var moment=require(_0x9e46('0x2'));var util=require(_0x9e46('0x3'));var client=jayson[_0x9e46('0x4')][_0x9e46('0x5')]({'port':0x2329});var logger=require(_0x9e46('0x6'))(_0x9e46('0x7'));exports['info']=function(_0x2d2c93,_0x485b9d){logger['info'](_0x2d2c93,_0x485b9d?util['inspect'](_0x485b9d,{'showHidden':![],'depth':null}):'');};exports[_0x9e46('0x8')]=function(_0x278971,_0x5e700b){logger['debug'](_0x278971,_0x5e700b?util[_0x9e46('0x9')](_0x5e700b,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x163643,_0x733f69){logger[_0x9e46('0xa')](_0x163643,_0x733f69?util[_0x9e46('0x9')](_0x733f69,{'showHidden':![],'depth':null}):'');};exports[_0x9e46('0xb')]=function(_0x280f8c,_0x33d940){return client[_0x9e46('0xb')](_0x280f8c,{'body':_0x33d940})[_0x9e46('0xc')](function(_0x236918){logger[_0x9e46('0x8')](_0x9e46('0xd'),_0x280f8c,_0x236918?util[_0x9e46('0x9')](_0x236918,{'showHidden':![],'depth':null}):'');})[_0x9e46('0xe')](function(_0x18411f){logger[_0x9e46('0xa')](_0x9e46('0xd'),_0x280f8c,_0x18411f?util[_0x9e46('0x9')](_0x18411f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2a8aa6){return client[_0x9e46('0xb')](_0x9e46('0xf'),{'options':{'raw':!![],'attributes':['id',_0x9e46('0x10'),_0x9e46('0x11'),_0x9e46('0x12')],'where':_0x2a8aa6,'limit':0x1}})['then'](function(_0x326fde){logger[_0x9e46('0x8')](_0x9e46('0x13'),JSON['stringify'](_0x2a8aa6),_0x326fde?util[_0x9e46('0x9')](_0x326fde,{'showHidden':![],'depth':null}):'');return _0x326fde[_0x9e46('0x14')][_0x9e46('0x15')]?_0x326fde[_0x9e46('0x14')][0x0]:null;});}exports[_0x9e46('0x16')]=function(_0x19f189){return new BPromise(function(_0x1fe5fa,_0x44efa2){if(_0x19f189){return getUser({'internal':_0x19f189})[_0x9e46('0xc')](function(_0x4e0e93){logger[_0x9e46('0x17')](_0x9e46('0x18'),_0x19f189,_0x4e0e93?'found':_0x9e46('0x19'));return _0x1fe5fa(_0x4e0e93);})[_0x9e46('0xe')](function(_0x474574){logger[_0x9e46('0xa')]('[utils][getUserByInternal]',_0x474574?util['inspect'](_0x474574,{'showHidden':![],'depth':null}):'');return _0x1fe5fa(null);});}return _0x1fe5fa(null);});};exports[_0x9e46('0x1a')]=function(_0x3f5057){return new BPromise(function(_0x5a888b,_0x4dfd1f){if(_0x3f5057){return getUser({'interface':_0x3f5057})[_0x9e46('0xc')](function(_0xfbb3de){logger[_0x9e46('0x17')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3f5057,_0xfbb3de?'found':_0x9e46('0x19'));return _0x5a888b(_0xfbb3de);})['catch'](function(_0x272e43){logger[_0x9e46('0xa')](_0x9e46('0x1b'),_0x272e43?util[_0x9e46('0x9')](_0x272e43,{'showHidden':![],'depth':null}):'');return _0x5a888b(null);});}return _0x5a888b(null);});};exports[_0x9e46('0x1c')]=function(_0x1acb2a){return new BPromise(function(_0x52304c,_0x5d19be){if(_0x1acb2a){return getUser({'name':_0x1acb2a})[_0x9e46('0xc')](function(_0x1c0774){logger['info'](_0x9e46('0x1d'),_0x1acb2a,_0x1c0774?'found':_0x9e46('0x19'));return _0x52304c(_0x1c0774);})['catch'](function(_0x4c94f6){logger[_0x9e46('0xa')]('[utils][getUserByName]',_0x4c94f6?util[_0x9e46('0x9')](_0x4c94f6,{'showHidden':![],'depth':null}):'');return _0x52304c(null);});}return _0x52304c(null);});};exports['getVoiceQueueByName']=function(_0x21a5a8){return new BPromise(function(_0xdf3625,_0x454005){if(_0x21a5a8){return client[_0x9e46('0xb')](_0x9e46('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x9e46('0x11'),_0x9e46('0x1f'),'acw',_0x9e46('0x20')],'where':{'name':_0x21a5a8},'limit':0x1}})[_0x9e46('0xc')](function(_0x4a64c2){logger[_0x9e46('0x8')](_0x9e46('0x21'),_0x21a5a8,_0x4a64c2?util[_0x9e46('0x9')](_0x4a64c2,{'showHidden':![],'depth':null}):'');logger[_0x9e46('0x17')](_0x9e46('0x22'),_0x21a5a8,_0x4a64c2?_0x9e46('0x23'):_0x9e46('0x19'));return _0xdf3625(_0x4a64c2['result'][_0x9e46('0x15')]?_0x4a64c2[_0x9e46('0x14')][0x0]:null);})[_0x9e46('0xe')](function(_0x2757c5){logger['error']('[utils][getVoiceQueueByName]',_0x2757c5?util['inspect'](_0x2757c5,{'showHidden':![],'depth':null}):'');return _0xdf3625(null);});}return _0xdf3625(null);});};exports[_0x9e46('0x24')]=function(_0x1d1947,_0x537d00){return moment(_0x1d1947)[_0x9e46('0x25')](_0x537d00,_0x9e46('0x26'))['format'](_0x9e46('0x27'));};exports[_0x9e46('0x28')]=function(_0x4288b7,_0x59f5c4){return moment(_0x4288b7)['subtract'](_0x59f5c4,_0x9e46('0x26'))[_0x9e46('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9e46('0x2a')]=function(_0x1f4b76,_0x1f1e89){return moment(_0x1f4b76)['diff'](moment(_0x1f1e89),_0x9e46('0x26'));};exports[_0x9e46('0x2b')]=function(_0x256b44,_0x13ef74){return parseInt(_0x256b44,0xa)+parseInt(_0x13ef74,0xa);};exports[_0x9e46('0x2c')]=function(){return moment()['format'](_0x9e46('0x27'));};exports['isAfter']=function(_0x5835de,_0x3e2fb1){if(_0x3e2fb1){return moment(_0x5835de)['isAfter'](_0x3e2fb1);}return!![];};exports[_0x9e46('0x2d')]=function(_0x5a4349,_0xacc4fb){if(_0xacc4fb){return moment(_0x5a4349)[_0x9e46('0x2d')](_0xacc4fb);}else if(_0x5a4349){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index aa0325c..d571dff 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 _0x9a46=['data','timestamp','auth','set','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for','statusCode','responseTime','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','remoteAddress','url','other','agent_name','test','setupLoggers','fs-extra','express-winston','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x9a46,0x172));var _0x69a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9a46[_0x20a584];return _0x4b41a8;};var fs=require(_0x69a4('0x0'));var _=require('lodash');var ewinston=require(_0x69a4('0x1'));var path=require(_0x69a4('0x2'));var util=require(_0x69a4('0x3'));var fileLogger=require(_0x69a4('0x4'))[_0x69a4('0x5')];var safeTemplate=require(_0x69a4('0x6'))[_0x69a4('0x7')];var maskSensitiveData=require(_0x69a4('0x8'))[_0x69a4('0x9')];function ClientSideLogger(){function _0x4d5d9(_0x48da8b){var _0x32c2aa=path[_0x69a4('0xa')](_0x69a4('0xb'),_0x69a4('0xc'),_0x69a4('0xd'));var _0x2e423d=path[_0x69a4('0xa')](_0x69a4('0xe'),_0x48da8b[_0x69a4('0xf')]+'-'+_0x48da8b[_0x69a4('0x10')]);return fs[_0x69a4('0x11')](path[_0x69a4('0xa')](_0x32c2aa,_0x2e423d))[_0x69a4('0x12')](function(){var _0x384dab=fileLogger(_0x69a4('0xe'),path[_0x69a4('0xa')](_0x32c2aa,_0x2e423d));return _0x384dab;})[_0x69a4('0x13')](function(_0x1a91b6){throw _0x1a91b6;});}this[_0x69a4('0xc')]=function(_0x4eb13d,_0x483dcf,_0x44207e,_0x1ca875){return _0x4d5d9(_0x4eb13d[_0x69a4('0x14')])[_0x69a4('0x12')](function(_0x4f73f3){var _0x21018f=_0x4f73f3[_0x483dcf];return _0x21018f;})[_0x69a4('0x12')](function(_0xb88ba0){var _0x20334b=_0x4eb13d[_0x69a4('0x14')]?_0x4eb13d[_0x69a4('0x14')]['id']:_0x69a4('0x15');var _0x34f255=_0x1ca875[_0x69a4('0x16')];var _0x57df06=_0x1ca875[_0x69a4('0x17')];var _0x3721f9=new Date(Number(_0x57df06));return _0xb88ba0(_0x20334b,_0x3721f9,_0x44207e,_0x34f255);})['catch'](function(_0x755252){fileLogger(_0x69a4('0xe'))['error'](_0x755252);});};}function setupLoggers(_0x1018a8){return new Promise(function(_0x56f872){var _0x3d1991=new ClientSideLogger();var _0x3b6886=fileLogger('api');var _0x5390a3=fileLogger(_0x69a4('0x18'));_0x1018a8[_0x69a4('0x19')]('client-side-logger',_0x3d1991);_0x1018a8['use'](ewinston[_0x69a4('0x1a')]({'winstonInstance':_0x3b6886,'meta':![],'statusLevels':!![],'msg':function(_0x42870a,_0x224d06){var _0x3c0dc4=_0x69a4('0x1b');if(!_[_0x69a4('0x1c')](_0x42870a[_0x69a4('0x1d')])){_0x3c0dc4+='\x20body=%s';var _0x50ab94=_0x42870a[_0x69a4('0x1d')];maskSensitiveData(_0x50ab94);}return safeTemplate(util[_0x69a4('0x1e')](_0x3c0dc4,_0x42870a[_0x69a4('0x1f')],_0x42870a[_0x69a4('0x20')][_0x69a4('0x21')]?_0x42870a[_0x69a4('0x20')][_0x69a4('0x21')]:_0x42870a['connection']['remoteAddress']||_0x42870a['ip'],_0x42870a['url'],_0x224d06[_0x69a4('0x22')],_0x224d06[_0x69a4('0x23')],_0x42870a['user']?_0x42870a['user']['id']:null,_0x42870a[_0x69a4('0x14')]?_0x42870a['user'][_0x69a4('0x10')]:null,_0x42870a[_0x69a4('0x14')]?_0x42870a[_0x69a4('0x14')][_0x69a4('0xf')]:null,_0x50ab94?util[_0x69a4('0x24')](_0x50ab94,![],null):''));}}));_0x1018a8[_0x69a4('0x25')](ewinston[_0x69a4('0x1a')]({'winstonInstance':_0x5390a3,'meta':![],'statusLevels':!![],'msg':function(_0x39174b,_0x50ba8e){var _0x2f3dd3=_0x69a4('0x26');if(_0x39174b[_0x69a4('0x1d')]&&_0x39174b[_0x69a4('0x1d')][_0x69a4('0x27')]&&_0x39174b[_0x69a4('0x1d')][_0x69a4('0x28')]){_0x2f3dd3=_0x69a4('0x29');}return util[_0x69a4('0x1e')](_0x2f3dd3,_0x39174b[_0x69a4('0x1f')],_0x39174b[_0x69a4('0x20')]['x-forwarded-for']?_0x39174b[_0x69a4('0x20')][_0x69a4('0x21')]:_0x39174b[_0x69a4('0x2a')][_0x69a4('0x2b')]||_0x39174b['ip'],_0x39174b[_0x69a4('0x2c')],_0x50ba8e[_0x69a4('0x22')],_0x50ba8e[_0x69a4('0x23')],_0x39174b[_0x69a4('0x14')]?_0x39174b[_0x69a4('0x14')]['id']:null,_0x39174b[_0x69a4('0x14')]?_0x39174b[_0x69a4('0x14')][_0x69a4('0x10')]:null,_0x39174b[_0x69a4('0x14')]?_0x39174b[_0x69a4('0x14')]['role']:null,_0x39174b[_0x69a4('0x1d')]&&_0x39174b[_0x69a4('0x1d')]['device']?_0x39174b[_0x69a4('0x1d')][_0x69a4('0x27')]:_0x69a4('0x2d'),_0x39174b[_0x69a4('0x1d')]&&_0x39174b['body'][_0x69a4('0x28')]?_0x39174b[_0x69a4('0x1d')][_0x69a4('0x28')]:'',_0x39174b['body']&&_0x39174b['body'][_0x69a4('0x2e')]?_0x39174b[_0x69a4('0x1d')][_0x69a4('0x2e')]:'');},'ignoreRoute':function(_0x7f4794){var _0x27b508=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x27b508[_0x69a4('0x2f')](_0x7f4794['url']);}}));return _0x56f872();});}exports[_0x69a4('0x30')]=setupLoggers; \ No newline at end of file +var _0x2ddc=['name','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','responseTime','other','agent_name','test','setupLoggers','fs-extra','path','util','./loggers','fileLogger','./safe-template','safeTemplate','maskSensitiveData','/var','join','client','role','catch','log','user','then','no-user','timestamp','error','api','auth','set','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url'];(function(_0x13a52e,_0x502f2e){var _0xcbc8c3=function(_0x228265){while(--_0x228265){_0x13a52e['push'](_0x13a52e['shift']());}};_0xcbc8c3(++_0x502f2e);}(_0x2ddc,0x9a));var _0xc2dd=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2ddc[_0x2aea9e];return _0x430b92;};var fs=require(_0xc2dd('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require(_0xc2dd('0x1'));var util=require(_0xc2dd('0x2'));var fileLogger=require(_0xc2dd('0x3'))[_0xc2dd('0x4')];var safeTemplate=require(_0xc2dd('0x5'))[_0xc2dd('0x6')];var maskSensitiveData=require('./mask-sensitive-data')[_0xc2dd('0x7')];function ClientSideLogger(){function _0x46e123(_0x5b46e3){var _0x409bb7=path['join'](_0xc2dd('0x8'),'log','xcally');var _0x557894=path[_0xc2dd('0x9')](_0xc2dd('0xa'),_0x5b46e3[_0xc2dd('0xb')]+'-'+_0x5b46e3['name']);return fs['ensureDir'](path['join'](_0x409bb7,_0x557894))['then'](function(){var _0x676f3=fileLogger(_0xc2dd('0xa'),path[_0xc2dd('0x9')](_0x409bb7,_0x557894));return _0x676f3;})[_0xc2dd('0xc')](function(_0x4bb7cb){throw _0x4bb7cb;});}this[_0xc2dd('0xd')]=function(_0xb48c90,_0x4d1619,_0x49f6fa,_0x4116b6){return _0x46e123(_0xb48c90[_0xc2dd('0xe')])['then'](function(_0x30ab13){var _0x5e75a8=_0x30ab13[_0x4d1619];return _0x5e75a8;})[_0xc2dd('0xf')](function(_0x230023){var _0x12a646=_0xb48c90['user']?_0xb48c90[_0xc2dd('0xe')]['id']:_0xc2dd('0x10');var _0x2d9c84=_0x4116b6['data'];var _0x2e20d5=_0x4116b6[_0xc2dd('0x11')];var _0x4fb48c=new Date(Number(_0x2e20d5));return _0x230023(_0x12a646,_0x4fb48c,_0x49f6fa,_0x2d9c84);})['catch'](function(_0xb118b5){fileLogger(_0xc2dd('0xa'))[_0xc2dd('0x12')](_0xb118b5);});};}function setupLoggers(_0x400657){return new Promise(function(_0x151dd1){var _0xdcca9d=new ClientSideLogger();var _0xb19a76=fileLogger(_0xc2dd('0x13'));var _0x575d8a=fileLogger(_0xc2dd('0x14'));_0x400657[_0xc2dd('0x15')]('client-side-logger',_0xdcca9d);_0x400657['use'](ewinston[_0xc2dd('0x16')]({'winstonInstance':_0xb19a76,'meta':![],'statusLevels':!![],'msg':function(_0x2f6c78,_0x51053d){var _0x69a11e=_0xc2dd('0x17');if(!_[_0xc2dd('0x18')](_0x2f6c78[_0xc2dd('0x19')])){_0x69a11e+=_0xc2dd('0x1a');var _0x4eb568=_0x2f6c78['body'];maskSensitiveData(_0x4eb568);}return safeTemplate(util[_0xc2dd('0x1b')](_0x69a11e,_0x2f6c78[_0xc2dd('0x1c')],_0x2f6c78[_0xc2dd('0x1d')][_0xc2dd('0x1e')]?_0x2f6c78[_0xc2dd('0x1d')]['x-forwarded-for']:_0x2f6c78[_0xc2dd('0x1f')][_0xc2dd('0x20')]||_0x2f6c78['ip'],_0x2f6c78[_0xc2dd('0x21')],_0x51053d['statusCode'],_0x51053d['responseTime'],_0x2f6c78['user']?_0x2f6c78[_0xc2dd('0xe')]['id']:null,_0x2f6c78[_0xc2dd('0xe')]?_0x2f6c78[_0xc2dd('0xe')][_0xc2dd('0x22')]:null,_0x2f6c78[_0xc2dd('0xe')]?_0x2f6c78['user']['role']:null,_0x4eb568?util[_0xc2dd('0x23')](_0x4eb568,![],null):''));}}));_0x400657[_0xc2dd('0x24')](ewinston[_0xc2dd('0x16')]({'winstonInstance':_0x575d8a,'meta':![],'statusLevels':!![],'msg':function(_0x212b80,_0x23b12){var _0xdb6331=_0xc2dd('0x25');if(_0x212b80[_0xc2dd('0x19')]&&_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x26')]&&_0x212b80['body'][_0xc2dd('0x27')]){_0xdb6331=_0xc2dd('0x28');}return util[_0xc2dd('0x1b')](_0xdb6331,_0x212b80[_0xc2dd('0x1c')],_0x212b80[_0xc2dd('0x1d')]['x-forwarded-for']?_0x212b80[_0xc2dd('0x1d')][_0xc2dd('0x1e')]:_0x212b80[_0xc2dd('0x1f')][_0xc2dd('0x20')]||_0x212b80['ip'],_0x212b80[_0xc2dd('0x21')],_0x23b12[_0xc2dd('0x29')],_0x23b12[_0xc2dd('0x2a')],_0x212b80[_0xc2dd('0xe')]?_0x212b80[_0xc2dd('0xe')]['id']:null,_0x212b80[_0xc2dd('0xe')]?_0x212b80['user'][_0xc2dd('0x22')]:null,_0x212b80[_0xc2dd('0xe')]?_0x212b80['user'][_0xc2dd('0xb')]:null,_0x212b80[_0xc2dd('0x19')]&&_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x26')]?_0x212b80['body'][_0xc2dd('0x26')]:_0xc2dd('0x2b'),_0x212b80['body']&&_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x27')]?_0x212b80['body']['agent_id']:'',_0x212b80[_0xc2dd('0x19')]&&_0x212b80['body'][_0xc2dd('0x2c')]?_0x212b80[_0xc2dd('0x19')][_0xc2dd('0x2c')]:'');},'ignoreRoute':function(_0x4d8430){var _0x140f03=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x140f03[_0xc2dd('0x2d')](_0x4d8430[_0xc2dd('0x21')]);}}));return _0x151dd1();});}exports[_0xc2dd('0x2e')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 8d2c171..fb982cf 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa32=['length','iftime','lodash','map','source','join','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','circularMonthInterval','clone','hours','minutes','startOf','isBetween','timeCompare','format','date','daysInMonth','max','min','domCompare','MMM','includes','monthCompare','guess','test','isMoment','padStart'];(function(_0x622035,_0x1a4b91){var _0x326cf2=function(_0x5c3002){while(--_0x5c3002){_0x622035['push'](_0x622035['shift']());}};_0x326cf2(++_0x1a4b91);}(_0xfa32,0x1e3));var _0x2fa3=function(_0x464167,_0x2133cd){_0x464167=_0x464167-0x0;var _0x3442b7=_0xfa32[_0x464167];return _0x3442b7;};var _=require(_0x2fa3('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x2fa3('0x1')](function(_0x55f628){return _0x55f628[_0x2fa3('0x2')];})[_0x2fa3('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0x2fa3('0x4');function throwIfDateNotValid(_0x42fffb){if(!_0x42fffb[_0x2fa3('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x191ef4){var _0x1f5109=_0x191ef4[_0x2fa3('0x6')](':')['map'](function(_0x39e633){return parseInt(_0x39e633,0xa);});var _0x3e11b6=_0x1f5109[0x0];var _0xb38aa9=_0x1f5109[0x1];if(_0x3e11b6<0x0||_0x3e11b6>0x17||_0xb38aa9<0x0||_0xb38aa9>0x3b){throw new Error(EINVALID_DATE);}return[_0x3e11b6,_0xb38aa9];}function circularDoWInterval(_0x49f7b8,_0x23426d){if(_0x49f7b8===_0x23426d){return[_0x49f7b8];}else{var _0x399c98=moment[_0x2fa3('0x7')]();moment[_0x2fa3('0x7')]('en');var _0x97564b=moment[_0x2fa3('0x8')]()[_0x2fa3('0x1')](function(_0x34581c){return _0x34581c[_0x2fa3('0x9')]();});moment[_0x2fa3('0x7')](_0x399c98);var _0x5c9e09=_0x97564b[_0x2fa3('0xa')](_0x49f7b8);var _0x523ea3=_0x97564b[_0x2fa3('0xa')](_0x23426d);if(_0x523ea3>_0x5c9e09){return _0x97564b[_0x2fa3('0xb')](_0x5c9e09,_0x523ea3+0x1);}else{var _0x134363=_0x97564b[_0x2fa3('0xb')](0x0,_0x523ea3+0x1);var _0x3c8754=_0x97564b[_0x2fa3('0xb')](_0x5c9e09);return _0x3c8754['concat'](_0x134363);}}}module[_0x2fa3('0xc')][_0x2fa3('0xd')]=circularDoWInterval;function circularMonthInterval(_0x36e3f2,_0x478814){if(_0x36e3f2===_0x478814){return[_0x36e3f2];}else{var _0x406811=moment[_0x2fa3('0x7')]();moment[_0x2fa3('0x7')]('en');var _0x1ea7c4=moment['monthsShort']()[_0x2fa3('0x1')](function(_0x52ab51){return _0x52ab51[_0x2fa3('0x9')]();});moment[_0x2fa3('0x7')](_0x406811);var _0x49ec41=_0x1ea7c4[_0x2fa3('0xa')](_0x36e3f2);var _0x31ae19=_0x1ea7c4[_0x2fa3('0xa')](_0x478814);if(_0x31ae19>_0x49ec41){return _0x1ea7c4[_0x2fa3('0xb')](_0x49ec41,_0x31ae19+0x1);}else{var _0x4d1d0e=_0x1ea7c4['slice'](0x0,_0x31ae19+0x1);var _0x1ad5f9=_0x1ea7c4[_0x2fa3('0xb')](_0x49ec41);return _0x1ad5f9[_0x2fa3('0xe')](_0x4d1d0e);}}}module[_0x2fa3('0xc')][_0x2fa3('0xf')]=circularMonthInterval;function parseDom(_0x4e9811){var _0x9a1037=parseInt(_0x4e9811,0xa);if(_0x9a1037<0x1||_0x9a1037>0x1f){throw new Error(EINVALID_DATE);}return _0x9a1037;}function timeCompare(_0x42b2d3,_0x5be0d2,_0xbb78f4){var _0x19ffab=_0x42b2d3['clone']();var _0x21815b=extractTime(_0x5be0d2);var _0x26dc96=_0x21815b[0x0];var _0x5a3245=_0x21815b[0x1];var _0x288b17=_0x42b2d3[_0x2fa3('0x10')]()[_0x2fa3('0x11')](_0x26dc96)['minutes'](_0x5a3245);throwIfDateNotValid(_0x288b17);var _0x339fa7=extractTime(_0xbb78f4);var _0x17c31a=_0x339fa7[0x0];var _0x506f5d=_0x339fa7[0x1];var _0x32ed0e=_0x42b2d3['clone']()['hours'](_0x17c31a)[_0x2fa3('0x12')](_0x506f5d);throwIfDateNotValid(_0x32ed0e);if(_0x32ed0e['isBefore'](_0x288b17)){var _0x3fd4b6=_0x19ffab[_0x2fa3('0x10')]()[_0x2fa3('0x13')]('day');var _0x5659df=_0x19ffab[_0x2fa3('0x10')]()['endOf']('day');return _0x19ffab['isBetween'](_0x288b17,_0x5659df,undefined,'[]')||_0x19ffab[_0x2fa3('0x14')](_0x3fd4b6,_0x32ed0e,undefined,'[]');}else{return _0x19ffab[_0x2fa3('0x14')](_0x288b17,_0x32ed0e,undefined,'[]');}}module['exports'][_0x2fa3('0x15')]=timeCompare;function dowCompare(_0x50f570,_0xeb51fe,_0x1652d2){var _0x3adab7=_0x50f570[_0x2fa3('0x7')]('en')[_0x2fa3('0x16')]('ddd')[_0x2fa3('0x9')]();return circularDoWInterval(_0xeb51fe,_0x1652d2)['includes'](_0x3adab7);}module[_0x2fa3('0xc')]['dowCompare']=dowCompare;function domCompare(_0x2c8950,_0x15559d,_0xa55a9e){var _0x111c1c=_0x2c8950[_0x2fa3('0x17')]();if(_0x15559d===_0xa55a9e){return _0x111c1c===_0x15559d;}else{var _0x2cf99f=_0x2c8950[_0x2fa3('0x18')]();var _0x3be7eb=_0x15559d<_0xa55a9e;let _0x1eeddc=![];var _0x57943c=0x0;var _0x31b04f=0x0;if(_0x3be7eb){_0x57943c=Math[_0x2fa3('0x19')](0x1,_0x15559d);_0x31b04f=Math[_0x2fa3('0x1a')](_0xa55a9e,_0x2cf99f);_0x1eeddc=_0x111c1c>=_0x57943c&&_0x111c1c<=_0x31b04f;}else{_0x57943c=Math[_0x2fa3('0x1a')](_0x15559d,_0x2cf99f);_0x31b04f=Math[_0x2fa3('0x19')](0x1,_0xa55a9e);_0x1eeddc=_0x111c1c>=_0x57943c||_0x111c1c<=_0x31b04f;}return _0x1eeddc;}}module[_0x2fa3('0xc')][_0x2fa3('0x1b')]=domCompare;function monthCompare(_0x5f1961,_0x14fdcf,_0x51bf98){var _0x1bbb23=_0x5f1961[_0x2fa3('0x7')]('en')[_0x2fa3('0x16')](_0x2fa3('0x1c'))[_0x2fa3('0x9')]();return circularMonthInterval(_0x14fdcf,_0x51bf98)[_0x2fa3('0x1d')](_0x1bbb23);}module[_0x2fa3('0xc')][_0x2fa3('0x1e')]=monthCompare;function iftime(_0x44121c,_0x5eee98=moment['tz'][_0x2fa3('0x1f')](),_0x37e251=moment()){if(!validateRx[_0x2fa3('0x20')](_0x44121c)){throw new Error(EINVALID_STRING);}else{var _0x15d9d6=(moment[_0x2fa3('0x21')](_0x37e251)?_0x37e251[_0x2fa3('0x10')]():moment(_0x37e251))['tz'](_0x5eee98)[_0x2fa3('0x7')]('en');throwIfDateNotValid(_0x15d9d6);var _0x450fb7=_0x44121c[_0x2fa3('0x6')](',');var _0xd221ef=_0x450fb7[0x0];var _0x5d8dd2=_0x450fb7[0x1];var _0x5bfadb=_0x450fb7[0x2];var _0x5e5f2e=_0x450fb7[0x3];let _0x273084=!![];if(_0xd221ef!=='*'){var _0x51b43f=_0xd221ef[_0x2fa3('0x6')]('-');var _0x545d67=_[_0x2fa3('0x22')](_0x51b43f[0x0],0x5,'0');var _0xe26463=_0x51b43f[_0x2fa3('0x23')]===0x2?_[_0x2fa3('0x22')](_0x51b43f[0x1],0x5,'0'):_0x545d67;_0x273084=timeCompare(_0x15d9d6,_0x545d67,_0xe26463);}let _0x2a2f33=!![];if(_0x5d8dd2!=='*'){var _0x3bb84a=_0x5d8dd2['split']('-');var _0x2fca9a=_0x3bb84a[0x0];var _0x6b5138=_0x3bb84a[_0x2fa3('0x23')]===0x2?_0x3bb84a[0x1]:_0x2fca9a;_0x2a2f33=dowCompare(_0x15d9d6,_0x2fca9a,_0x6b5138);}let _0x36f549=!![];if(_0x5bfadb!=='*'){var _0x5b8437=_0x5bfadb[_0x2fa3('0x6')]('-');var _0x5ecac6=parseDom(_0x5b8437[0x0]);var _0xbea82d=_0x5b8437[_0x2fa3('0x23')]===0x2?parseDom(_0x5b8437[0x1]):_0x5ecac6;_0x36f549=domCompare(_0x15d9d6,_0x5ecac6,_0xbea82d);}let _0x24ae0e=!![];if(_0x5e5f2e!=='*'){var _0x596da5=_0x5e5f2e[_0x2fa3('0x6')]('-');var _0x12ebdf=_0x596da5[0x0];var _0x4fd4c0=_0x596da5[_0x2fa3('0x23')]===0x2?_0x596da5[0x1]:_0x596da5[0x0];_0x24ae0e=monthCompare(_0x15d9d6,_0x12ebdf,_0x4fd4c0);}return _0x273084&&_0x2a2f33&&_0x36f549&&_0x24ae0e;}}module[_0x2fa3('0xc')][_0x2fa3('0x24')]=iftime; \ No newline at end of file +var _0x1423=['locale','weekdaysShort','indexOf','slice','concat','circularDoWInterval','monthsShort','toLowerCase','exports','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','format','ddd','includes','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','split','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid'];(function(_0x4937cb,_0x5287a6){var _0x20b5e1=function(_0x33644b){while(--_0x33644b){_0x4937cb['push'](_0x4937cb['shift']());}};_0x20b5e1(++_0x5287a6);}(_0x1423,0x1d1));var _0x3142=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1423[_0x2641f9];return _0x585741;};var _=require(_0x3142('0x0'));var moment=require(_0x3142('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x3142('0x2')](function(_0x313ab4){return _0x313ab4[_0x3142('0x3')];})[_0x3142('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x3142('0x5');var EINVALID_DATE=_0x3142('0x6');function throwIfDateNotValid(_0x40d092){if(!_0x40d092[_0x3142('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x1a61d4){var _0x36a35d=_0x1a61d4['split'](':')[_0x3142('0x2')](function(_0x5dd146){return parseInt(_0x5dd146,0xa);});var _0x4d7ef3=_0x36a35d[0x0];var _0x5779c0=_0x36a35d[0x1];if(_0x4d7ef3<0x0||_0x4d7ef3>0x17||_0x5779c0<0x0||_0x5779c0>0x3b){throw new Error(EINVALID_DATE);}return[_0x4d7ef3,_0x5779c0];}function circularDoWInterval(_0x2092bd,_0x49822b){if(_0x2092bd===_0x49822b){return[_0x2092bd];}else{var _0x2ac6d1=moment[_0x3142('0x8')]();moment[_0x3142('0x8')]('en');var _0x534beb=moment[_0x3142('0x9')]()[_0x3142('0x2')](function(_0x4203cf){return _0x4203cf['toLowerCase']();});moment[_0x3142('0x8')](_0x2ac6d1);var _0x176e4a=_0x534beb[_0x3142('0xa')](_0x2092bd);var _0x8aa970=_0x534beb[_0x3142('0xa')](_0x49822b);if(_0x8aa970>_0x176e4a){return _0x534beb['slice'](_0x176e4a,_0x8aa970+0x1);}else{var _0x3c88a7=_0x534beb[_0x3142('0xb')](0x0,_0x8aa970+0x1);var _0x59ed0b=_0x534beb['slice'](_0x176e4a);return _0x59ed0b[_0x3142('0xc')](_0x3c88a7);}}}module['exports'][_0x3142('0xd')]=circularDoWInterval;function circularMonthInterval(_0x3fa604,_0x5bfb72){if(_0x3fa604===_0x5bfb72){return[_0x3fa604];}else{var _0x10f551=moment['locale']();moment[_0x3142('0x8')]('en');var _0xa0e746=moment[_0x3142('0xe')]()[_0x3142('0x2')](function(_0x366c95){return _0x366c95[_0x3142('0xf')]();});moment['locale'](_0x10f551);var _0x54c778=_0xa0e746[_0x3142('0xa')](_0x3fa604);var _0x1e8acb=_0xa0e746[_0x3142('0xa')](_0x5bfb72);if(_0x1e8acb>_0x54c778){return _0xa0e746[_0x3142('0xb')](_0x54c778,_0x1e8acb+0x1);}else{var _0x5c6f19=_0xa0e746[_0x3142('0xb')](0x0,_0x1e8acb+0x1);var _0x2f0594=_0xa0e746[_0x3142('0xb')](_0x54c778);return _0x2f0594[_0x3142('0xc')](_0x5c6f19);}}}module[_0x3142('0x10')][_0x3142('0x11')]=circularMonthInterval;function parseDom(_0x48f6f7){var _0xb932ca=parseInt(_0x48f6f7,0xa);if(_0xb932ca<0x1||_0xb932ca>0x1f){throw new Error(EINVALID_DATE);}return _0xb932ca;}function timeCompare(_0x2a23ad,_0x37229b,_0x5ef85c){var _0x1e60a1=_0x2a23ad[_0x3142('0x12')]();var _0x153ce7=extractTime(_0x37229b);var _0x55fbbb=_0x153ce7[0x0];var _0x3fa983=_0x153ce7[0x1];var _0x172efc=_0x2a23ad[_0x3142('0x12')]()[_0x3142('0x13')](_0x55fbbb)[_0x3142('0x14')](_0x3fa983);throwIfDateNotValid(_0x172efc);var _0x4d69e5=extractTime(_0x5ef85c);var _0x3cb1a2=_0x4d69e5[0x0];var _0x1df201=_0x4d69e5[0x1];var _0xded86b=_0x2a23ad['clone']()['hours'](_0x3cb1a2)['minutes'](_0x1df201);throwIfDateNotValid(_0xded86b);if(_0xded86b[_0x3142('0x15')](_0x172efc)){var _0x4864d4=_0x1e60a1[_0x3142('0x12')]()[_0x3142('0x16')](_0x3142('0x17'));var _0x3abff5=_0x1e60a1[_0x3142('0x12')]()[_0x3142('0x18')](_0x3142('0x17'));return _0x1e60a1[_0x3142('0x19')](_0x172efc,_0x3abff5,undefined,'[]')||_0x1e60a1[_0x3142('0x19')](_0x4864d4,_0xded86b,undefined,'[]');}else{return _0x1e60a1['isBetween'](_0x172efc,_0xded86b,undefined,'[]');}}module[_0x3142('0x10')]['timeCompare']=timeCompare;function dowCompare(_0x4c3e73,_0x39959e,_0x51038d){var _0x161d91=_0x4c3e73['locale']('en')[_0x3142('0x1a')](_0x3142('0x1b'))['toLowerCase']();return circularDoWInterval(_0x39959e,_0x51038d)[_0x3142('0x1c')](_0x161d91);}module['exports']['dowCompare']=dowCompare;function domCompare(_0x946e17,_0x209117,_0x85ecb){var _0x351be8=_0x946e17[_0x3142('0x1d')]();if(_0x209117===_0x85ecb){return _0x351be8===_0x209117;}else{var _0xd4ebbe=_0x946e17[_0x3142('0x1e')]();var _0x3631f4=_0x209117<_0x85ecb;let _0x552992=![];var _0x998f1d=0x0;var _0x47a587=0x0;if(_0x3631f4){_0x998f1d=Math[_0x3142('0x1f')](0x1,_0x209117);_0x47a587=Math[_0x3142('0x20')](_0x85ecb,_0xd4ebbe);_0x552992=_0x351be8>=_0x998f1d&&_0x351be8<=_0x47a587;}else{_0x998f1d=Math['min'](_0x209117,_0xd4ebbe);_0x47a587=Math[_0x3142('0x1f')](0x1,_0x85ecb);_0x552992=_0x351be8>=_0x998f1d||_0x351be8<=_0x47a587;}return _0x552992;}}module[_0x3142('0x10')][_0x3142('0x21')]=domCompare;function monthCompare(_0x5d8f1f,_0xc949ca,_0x3c5e21){var _0x1dd8c1=_0x5d8f1f[_0x3142('0x8')]('en')[_0x3142('0x1a')](_0x3142('0x22'))[_0x3142('0xf')]();return circularMonthInterval(_0xc949ca,_0x3c5e21)[_0x3142('0x1c')](_0x1dd8c1);}module[_0x3142('0x10')][_0x3142('0x23')]=monthCompare;function iftime(_0x47353a,_0x25f75e=moment['tz'][_0x3142('0x24')](),_0x2b96e3=moment()){if(!validateRx[_0x3142('0x25')](_0x47353a)){throw new Error(EINVALID_STRING);}else{var _0x68911d=(moment[_0x3142('0x26')](_0x2b96e3)?_0x2b96e3[_0x3142('0x12')]():moment(_0x2b96e3))['tz'](_0x25f75e)[_0x3142('0x8')]('en');throwIfDateNotValid(_0x68911d);var _0x57c6c1=_0x47353a[_0x3142('0x27')](',');var _0x4bc5fe=_0x57c6c1[0x0];var _0x34930f=_0x57c6c1[0x1];var _0x1bd6b1=_0x57c6c1[0x2];var _0x36e053=_0x57c6c1[0x3];let _0x31b0d0=!![];if(_0x4bc5fe!=='*'){var _0x37d7ff=_0x4bc5fe[_0x3142('0x27')]('-');var _0x3cdf63=_[_0x3142('0x28')](_0x37d7ff[0x0],0x5,'0');var _0x37c56a=_0x37d7ff['length']===0x2?_[_0x3142('0x28')](_0x37d7ff[0x1],0x5,'0'):_0x3cdf63;_0x31b0d0=timeCompare(_0x68911d,_0x3cdf63,_0x37c56a);}let _0x2cc8e1=!![];if(_0x34930f!=='*'){var _0x19d46d=_0x34930f['split']('-');var _0x5f57ba=_0x19d46d[0x0];var _0x3009cc=_0x19d46d[_0x3142('0x29')]===0x2?_0x19d46d[0x1]:_0x5f57ba;_0x2cc8e1=dowCompare(_0x68911d,_0x5f57ba,_0x3009cc);}let _0x2e476b=!![];if(_0x1bd6b1!=='*'){var _0x3075c6=_0x1bd6b1[_0x3142('0x27')]('-');var _0x20ca90=parseDom(_0x3075c6[0x0]);var _0x5a0235=_0x3075c6[_0x3142('0x29')]===0x2?parseDom(_0x3075c6[0x1]):_0x20ca90;_0x2e476b=domCompare(_0x68911d,_0x20ca90,_0x5a0235);}let _0xf92aff=!![];if(_0x36e053!=='*'){var _0x5ee7c3=_0x36e053[_0x3142('0x27')]('-');var _0xcdeb41=_0x5ee7c3[0x0];var _0x16d4a=_0x5ee7c3[_0x3142('0x29')]===0x2?_0x5ee7c3[0x1]:_0x5ee7c3[0x0];_0xf92aff=monthCompare(_0x68911d,_0xcdeb41,_0x16d4a);}return _0x31b0d0&&_0x2cc8e1&&_0x2e476b&&_0xf92aff;}}module[_0x3142('0x10')][_0x3142('0x2a')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index b2e33e0..b76deb7 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8422=['level','toUpperCase','keys','meta','length','stringify','YYYY-MM-DD\x20HH:mm:ss','Console','warn','Logger','transports','error','File','%s-%s','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','red','bold\x20yellow','bold\x20green','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','join','format','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x1ffc57,_0x4524b1){var _0x5401f4=function(_0x50a4d2){while(--_0x50a4d2){_0x1ffc57['push'](_0x1ffc57['shift']());}};_0x5401f4(++_0x4524b1);}(_0x8422,0x1cc));var _0x2842=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x8422[_0x4b174a];return _0x3cd7bf;};'use strict';var path=require(_0x2842('0x0'));var util=require(_0x2842('0x1'));var moment=require(_0x2842('0x2'));var winston=require(_0x2842('0x3'));var config=require(_0x2842('0x4'));var debugLevel=config['debugLevel']?config[_0x2842('0x5')][_0x2842('0x6')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x2842('0x7'),'warn':_0x2842('0x8'),'info':'white','print':'bold\x20white','success':_0x2842('0x9'),'http':'gray','verbose':_0x2842('0xa'),'debug':_0x2842('0xb'),'silly':'bold\x20cyan'};winston[_0x2842('0xc')](XC_LOG_COLORS);function getLogFileName(_0x13ea03,_0x9183fe,_0x10dff7){var _0x45dfb1=_0x13ea03||_0x2842('0xd');return path[_0x2842('0xe')](_0x45dfb1,util[_0x2842('0xf')]('%s-%s.log',_0x9183fe,_0x10dff7));}function formatter(_0x4d5865,_0x1f8c5d){_0x1f8c5d[_0x2842('0x10')]=_0x1f8c5d[_0x2842('0x10')][_0x2842('0x11')](/@@{/g,_0x2842('0x12'))[_0x2842('0x11')](/}@@/g,_0x2842('0x13'))[_0x2842('0x11')](/@{/g,'{{')[_0x2842('0x11')](/}@/g,'}}');return util[_0x2842('0xf')](_0x2842('0x14'),moment()[_0x2842('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1f8c5d[_0x2842('0x15')][_0x2842('0x16')](),_0x4d5865,_0x1f8c5d['message']);}function fileFormat(_0x4ed831,_0x50028b){_0x50028b['message']=_0x50028b[_0x2842('0x10')][_0x2842('0x11')](/@@{/g,_0x2842('0x12'))[_0x2842('0x11')](/}@@/g,_0x2842('0x13'))[_0x2842('0x11')](/@{/g,'{{')[_0x2842('0x11')](/}@/g,'}}');var _0x478cc4=_0x50028b['meta']&&Object[_0x2842('0x17')](_0x50028b[_0x2842('0x18')])[_0x2842('0x19')]?'\x0a\x09'+JSON[_0x2842('0x1a')](_0x50028b[_0x2842('0x18')]):'';return util[_0x2842('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x2842('0xf')](_0x2842('0x1b')),_0x50028b['level'][_0x2842('0x16')](),_0x4ed831,_0x50028b[_0x2842('0x10')],_0x478cc4);}function consoleLogger(){var _0x102043=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x2842('0x1c'))]({'level':_0x2842('0x1d'),'json':![],'formatter':function(_0x125609){return formatter('',_0x125609);}})]});return _0x102043;}function fileLogger(_0x37fe6d,_0x819ab9){var _0x3f6c62=new winston[(_0x2842('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2842('0x1f'))]['File']({'name':util[_0x2842('0xf')]('%s-%s',_0x37fe6d,_0x2842('0x20')),'filename':getLogFileName(_0x819ab9,_0x37fe6d,_0x2842('0x20')),'level':_0x2842('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4ab4ce){return fileFormat(_0x37fe6d,_0x4ab4ce);}}),new winston[(_0x2842('0x1f'))][(_0x2842('0x21'))]({'name':util[_0x2842('0xf')](_0x2842('0x22'),_0x37fe6d,debugLevel),'filename':getLogFileName(_0x819ab9,_0x37fe6d,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x175759){return fileFormat(_0x37fe6d,_0x175759);}}),new winston['transports'][(_0x2842('0x1c'))]({'level':_0x2842('0x1d'),'json':![],'formatter':function(_0x2a65ee){return fileFormat(_0x37fe6d,_0x2a65ee);}})]});return _0x3f6c62;}exports[_0x2842('0x23')]=consoleLogger;exports[_0x2842('0x24')]=fileLogger; \ No newline at end of file +var _0x5534=['debugLevel','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','Console','transports','File','error','%s-%s','consoleLogger','fileLogger','path','moment','winston','../config/environment'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x5534,0xb5));var _0x4553=function(_0x38c249,_0x52e6f0){_0x38c249=_0x38c249-0x0;var _0x5c7f3a=_0x5534[_0x38c249];return _0x5c7f3a;};'use strict';var path=require(_0x4553('0x0'));var util=require('util');var moment=require(_0x4553('0x1'));var winston=require(_0x4553('0x2'));var config=require(_0x4553('0x3'));var debugLevel=config[_0x4553('0x4')]?config[_0x4553('0x4')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x4553('0x5'),'info':_0x4553('0x6'),'print':_0x4553('0x7'),'success':_0x4553('0x8'),'http':_0x4553('0x9'),'verbose':_0x4553('0xa'),'debug':_0x4553('0xb'),'silly':_0x4553('0xc')};winston[_0x4553('0xd')](XC_LOG_COLORS);function getLogFileName(_0x491727,_0x18000d,_0x2ad2da){var _0x3a5db9=_0x491727||_0x4553('0xe');return path['join'](_0x3a5db9,util[_0x4553('0xf')](_0x4553('0x10'),_0x18000d,_0x2ad2da));}function formatter(_0x3ed951,_0x273ba3){_0x273ba3[_0x4553('0x11')]=_0x273ba3[_0x4553('0x11')][_0x4553('0x12')](/@@{/g,_0x4553('0x13'))[_0x4553('0x12')](/}@@/g,_0x4553('0x14'))['replace'](/@{/g,'{{')[_0x4553('0x12')](/}@/g,'}}');return util[_0x4553('0xf')](_0x4553('0x15'),moment()['format'](_0x4553('0x16')),_0x273ba3['level'][_0x4553('0x17')](),_0x3ed951,_0x273ba3[_0x4553('0x11')]);}function fileFormat(_0x5e1a8b,_0x37e3bc){_0x37e3bc[_0x4553('0x11')]=_0x37e3bc[_0x4553('0x11')]['replace'](/@@{/g,_0x4553('0x13'))[_0x4553('0x12')](/}@@/g,_0x4553('0x14'))[_0x4553('0x12')](/@{/g,'{{')[_0x4553('0x12')](/}@/g,'}}');var _0x51d0f6=_0x37e3bc[_0x4553('0x18')]&&Object['keys'](_0x37e3bc[_0x4553('0x18')])[_0x4553('0x19')]?'\x0a\x09'+JSON[_0x4553('0x1a')](_0x37e3bc['meta']):'';return util[_0x4553('0xf')](_0x4553('0x1b'),moment()[_0x4553('0xf')](_0x4553('0x16')),_0x37e3bc[_0x4553('0x1c')][_0x4553('0x17')](),_0x5e1a8b,_0x37e3bc['message'],_0x51d0f6);}function consoleLogger(){var _0x30275a=new winston[(_0x4553('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x4553('0x1e'))]({'level':'warn','json':![],'formatter':function(_0xed07d9){return formatter('',_0xed07d9);}})]});return _0x30275a;}function fileLogger(_0x1f569c,_0x4343b3){var _0x5676ba=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4553('0x1f'))][(_0x4553('0x20'))]({'name':util[_0x4553('0xf')]('%s-%s',_0x1f569c,_0x4553('0x21')),'filename':getLogFileName(_0x4343b3,_0x1f569c,_0x4553('0x21')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x186761){return fileFormat(_0x1f569c,_0x186761);}}),new winston[(_0x4553('0x1f'))][(_0x4553('0x20'))]({'name':util[_0x4553('0xf')](_0x4553('0x22'),_0x1f569c,debugLevel),'filename':getLogFileName(_0x4343b3,_0x1f569c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x182173){return fileFormat(_0x1f569c,_0x182173);}}),new winston[(_0x4553('0x1f'))][(_0x4553('0x1e'))]({'level':'warn','json':![],'formatter':function(_0x40410e){return fileFormat(_0x1f569c,_0x40410e);}})]});return _0x5676ba;}exports[_0x4553('0x23')]=consoleLogger;exports[_0x4553('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 07ae7bd..5248617 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(_0x299478,_0x5afe3b){var _0x5c7533=function(_0x3f10e0){while(--_0x3f10e0){_0x299478['push'](_0x299478['shift']());}};_0x5c7533(++_0x5afe3b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3dc089,_0x5ccb0d){_0x3dc089=_0x3dc089-0x0;var _0x34d9d3=_0x0b0e[_0x3dc089];return _0x34d9d3;};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 _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x1967,0x173));var _0x7196=function(_0x308be1,_0x2c1f91){_0x308be1=_0x308be1-0x0;var _0x310219=_0x1967[_0x308be1];return _0x310219;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 8797e30..e3dd38b 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 _0x7708=['lodash','\x20}\x20}','isArray','map','isPlainObject','reduce','exports','safeTemplate'];(function(_0x2aebb8,_0x36a913){var _0xcb804f=function(_0x5357c3){while(--_0x5357c3){_0x2aebb8['push'](_0x2aebb8['shift']());}};_0xcb804f(++_0x36a913);}(_0x7708,0x188));var _0x8770=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x7708[_0x23c6f2];return _0x4c270b;};var _=require(_0x8770('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x24909b){return _0x24909b==='{{'?'{\x20{\x20':_0x8770('0x1');}function safeTemplate(_0x5a8b5b){var _0x5ca46f=_0x5a8b5b;if(typeof _0x5a8b5b==='string'){_0x5ca46f=_0x5a8b5b['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x8770('0x2')](_0x5a8b5b)){_0x5ca46f=_0x5a8b5b[_0x8770('0x3')](function(_0x577b13){return safeTemplate(_0x577b13);});}else if(_[_0x8770('0x4')](_0x5a8b5b)){_0x5ca46f=Object['keys'](_0x5a8b5b)[_0x8770('0x5')](function(_0x42d305,_0x2b0295){_0x42d305[_0x2b0295]=safeTemplate(_0x5a8b5b[_0x2b0295]);return _0x42d305;},{});}return _0x5ca46f;}module[_0x8770('0x6')][_0x8770('0x7')]=safeTemplate; \ No newline at end of file +var _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x1b6f60,_0x5d658a){var _0x29018c=function(_0x3e2fa9){while(--_0x3e2fa9){_0x1b6f60['push'](_0x1b6f60['shift']());}};_0x29018c(++_0x5d658a);}(_0x1a85,0x178));var _0x51a8=function(_0x474376,_0x385824){_0x474376=_0x474376-0x0;var _0x9141b=_0x1a85[_0x474376];return _0x9141b;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 316d95a..28d1c82 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 _0x00ab=['info','writeJSON','exports','path','../config/environment','resolve','server/app.json','apps','findIndex','name','motion2','string','env','NODE_PATH','pathExists','then','updated'];(function(_0x1d1b87,_0x4d8e8c){var _0x2a0c19=function(_0x6cb6cd){while(--_0x6cb6cd){_0x1d1b87['push'](_0x1d1b87['shift']());}};_0x2a0c19(++_0x4d8e8c);}(_0x00ab,0x135));var _0xb00a=function(_0x528ecb,_0x5d9fb9){_0x528ecb=_0x528ecb-0x0;var _0x33c465=_0x00ab[_0x528ecb];return _0x33c465;};var fs=require('fs-extra');var path=require(_0xb00a('0x0'));var config=require(_0xb00a('0x1'));var root=config['root'];var APP_JSON_PATH=path[_0xb00a('0x2')](root,_0xb00a('0x3'));var NODEPATH=path[_0xb00a('0x2')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x4b624b){let _0x463e9d=![];if(Array['isArray'](_0x4b624b[_0xb00a('0x4')])){var _0x1cfb10=_0x4b624b[_0xb00a('0x4')][_0xb00a('0x5')](function(_0x463b95){return _0x463b95[_0xb00a('0x6')]===_0xb00a('0x7');});if(_0x1cfb10>-0x1){var _0x15278e=_0x4b624b[_0xb00a('0x4')][_0x1cfb10];if(typeof _0x15278e['env']['NODE_PATH']!==_0xb00a('0x8')){_0x15278e[_0xb00a('0x9')][_0xb00a('0xa')]=NODEPATH;_0x463e9d=!![];}}return{'appConfig':_0x4b624b,'updated':_0x463e9d};}}function updateAppConfig(_0x57eb53){return fs[_0xb00a('0xb')](APP_JSON_PATH)['then'](function(_0x5d54bc){if(_0x5d54bc){return fs['readJSON'](APP_JSON_PATH)[_0xb00a('0xc')](function(_0x4a62d6){var _0x4fb213=setLegacyLibsNodeEnvPath(_0x4a62d6);if(_0x4fb213[_0xb00a('0xd')]){_0x57eb53[_0xb00a('0xe')]('Updating\x20app.json');return fs[_0xb00a('0xf')](APP_JSON_PATH,_0x4a62d6,{'spaces':0x2});}else{return Promise[_0xb00a('0x2')]();}});}else{return Promise[_0xb00a('0x2')]();}});}module[_0xb00a('0x10')]=updateAppConfig; \ No newline at end of file +var _0xb7d6=['env','string','NODE_PATH','then','readJSON','updated','Updating\x20app.json','writeJSON','exports','path','../config/environment','root','resolve','legacy-libs','isArray','name','motion2','apps'];(function(_0x272156,_0x5e4b0d){var _0x1071d0=function(_0x5f1f6b){while(--_0x5f1f6b){_0x272156['push'](_0x272156['shift']());}};_0x1071d0(++_0x5e4b0d);}(_0xb7d6,0x1a7));var _0x6b7d=function(_0x46d811,_0x2bde59){_0x46d811=_0x46d811-0x0;var _0x144840=_0xb7d6[_0x46d811];return _0x144840;};var fs=require('fs-extra');var path=require(_0x6b7d('0x0'));var config=require(_0x6b7d('0x1'));var root=config[_0x6b7d('0x2')];var APP_JSON_PATH=path[_0x6b7d('0x3')](root,'server/app.json');var NODEPATH=path[_0x6b7d('0x3')](root,_0x6b7d('0x4'));function setLegacyLibsNodeEnvPath(_0x392591){let _0x5027bd=![];if(Array[_0x6b7d('0x5')](_0x392591['apps'])){var _0x23399b=_0x392591['apps']['findIndex'](function(_0x5d59ee){return _0x5d59ee[_0x6b7d('0x6')]===_0x6b7d('0x7');});if(_0x23399b>-0x1){var _0x25b07b=_0x392591[_0x6b7d('0x8')][_0x23399b];if(typeof _0x25b07b[_0x6b7d('0x9')]['NODE_PATH']!==_0x6b7d('0xa')){_0x25b07b['env'][_0x6b7d('0xb')]=NODEPATH;_0x5027bd=!![];}}return{'appConfig':_0x392591,'updated':_0x5027bd};}}function updateAppConfig(_0x3ba2a0){return fs['pathExists'](APP_JSON_PATH)[_0x6b7d('0xc')](function(_0x4bcb77){if(_0x4bcb77){return fs[_0x6b7d('0xd')](APP_JSON_PATH)[_0x6b7d('0xc')](function(_0x32e4fe){var _0xd35f26=setLegacyLibsNodeEnvPath(_0x32e4fe);if(_0xd35f26[_0x6b7d('0xe')]){_0x3ba2a0['info'](_0x6b7d('0xf'));return fs[_0x6b7d('0x10')](APP_JSON_PATH,_0x32e4fe,{'spaces':0x2});}else{return Promise[_0x6b7d('0x3')]();}});}else{return Promise['resolve']();}});}module[_0x6b7d('0x11')]=updateAppConfig; \ No newline at end of file -- 1.7.1